Built motion from commit fb0188bc.|2.5.34
authorAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 10 Sep 2021 12:37:06 +0000 (14:37 +0200)
committerAndrea Amorese <andrea.amorese@xenialab.it>
Fri, 10 Sep 2021 12:37:06 +0000 (14:37 +0200)
1147 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/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 cdb4ab9..ecbcf3a 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-10T12:06:29.290Z",
+    "time": "2021-09-10T12:21:57.322Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 9dfdcd3..1e4a07b 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-10T12:06:29.290Z",
+    "time": "2021-09-10T12:21:57.322Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index a579f36..a350009 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1224=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x3f2ecf,_0x4ccad6){var _0xa6dd7e=function(_0x5e04c3){while(--_0x5e04c3){_0x3f2ecf['push'](_0x3f2ecf['shift']());}};_0xa6dd7e(++_0x4ccad6);}(_0x1224,0x10d));var _0x4122=function(_0x417d02,_0x4c0a6a){_0x417d02=_0x417d02-0x0;var _0x4d7758=_0x1224[_0x417d02];return _0x4d7758;};'use strict';var Sequelize=require(_0x4122('0x0'));module[_0x4122('0x1')]={'name':{'type':Sequelize[_0x4122('0x2')],'get':function(_0x4122fd){return this[_0x4122('0x3')](_0x4122('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x4122('0x5'),_0x4122('0x6'),_0x4122('0x7'),'jscripty',_0x4122('0x8'),_0x4122('0x9'),_0x4122('0xa'),_0x4122('0xb')]],'msg':_0x4122('0xc')}},'comment':_0x4122('0xc')},'data1':{'type':Sequelize[_0x4122('0xd')](0x1000),'comment':_0x4122('0xe')},'data2':{'type':Sequelize[_0x4122('0xd')](0x1000),'comment':_0x4122('0xf')},'data3':{'type':Sequelize[_0x4122('0xd')](0x1000),'comment':_0x4122('0x10')},'data4':{'type':Sequelize[_0x4122('0xd')](0x1000),'comments':_0x4122('0x11')},'data5':{'type':Sequelize[_0x4122('0xd')](0x1000),'comments':_0x4122('0x12')},'data6':{'type':Sequelize[_0x4122('0xd')],'comments':_0x4122('0x13')},'data7':{'type':Sequelize[_0x4122('0x14')],'comments':_0x4122('0x15')}};
\ No newline at end of file
+var _0x11e5=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','TEXT','sequelize','VIRTUAL','action','STRING','contactManager','motionbar','browser','bot','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x2fd08f,_0x2b2bb9){var _0x56a019=function(_0x8d0247){while(--_0x8d0247){_0x2fd08f['push'](_0x2fd08f['shift']());}};_0x56a019(++_0x2b2bb9);}(_0x11e5,0x8b));var _0x511e=function(_0x5a474d,_0x3c85e2){_0x5a474d=_0x5a474d-0x0;var _0x512f2a=_0x11e5[_0x5a474d];return _0x512f2a;};'use strict';var Sequelize=require(_0x511e('0x0'));module['exports']={'name':{'type':Sequelize[_0x511e('0x1')],'get':function(_0x269c68){return this['getDataValue'](_0x511e('0x2'));}},'action':{'type':Sequelize[_0x511e('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x511e('0x4'),'integration',_0x511e('0x5'),'jscripty','urlForward',_0x511e('0x6'),_0x511e('0x7'),_0x511e('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[_0x511e('0x3')](0x1000),'comment':_0x511e('0x9')},'data2':{'type':Sequelize[_0x511e('0x3')](0x1000),'comment':_0x511e('0xa')},'data3':{'type':Sequelize[_0x511e('0x3')](0x1000),'comment':_0x511e('0xb')},'data4':{'type':Sequelize[_0x511e('0x3')](0x1000),'comments':_0x511e('0xc')},'data5':{'type':Sequelize[_0x511e('0x3')](0x1000),'comments':_0x511e('0xd')},'data6':{'type':Sequelize[_0x511e('0x3')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x511e('0xe')],'comments':'urlForward[body]'}};
\ No newline at end of file
index d4efb37..b4e7206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32de=['status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','end','error','stack','name','send','update','body','Action','find','catch','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4cc13d,_0x52d8a0){var _0x3fee04=function(_0x25a0a0){while(--_0x25a0a0){_0x4cc13d['push'](_0x4cc13d['shift']());}};_0x3fee04(++_0x52d8a0);}(_0x32de,0x1cf));var _0xe32d=function(_0x16ce18,_0x4c67b9){_0x16ce18=_0x16ce18-0x0;var _0x4f3b2e=_0x32de[_0x16ce18];return _0x4f3b2e;};'use strict';var emlformat=require(_0xe32d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe32d('0x1'));var jsonpatch=require(_0xe32d('0x2'));var rp=require(_0xe32d('0x3'));var moment=require(_0xe32d('0x4'));var BPromise=require(_0xe32d('0x5'));var Mustache=require(_0xe32d('0x6'));var util=require(_0xe32d('0x7'));var path=require(_0xe32d('0x8'));var sox=require(_0xe32d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe32d('0xa'));var _=require(_0xe32d('0xb'));var squel=require('squel');var crypto=require(_0xe32d('0xc'));var jsforce=require(_0xe32d('0xd'));var deskjs=require(_0xe32d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe32d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe32d('0x10'));var logger=require(_0xe32d('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xe32d('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xe32d('0x13'))['db'];function respondWithStatusCode(_0x35a5c1,_0xc78f88){_0xc78f88=_0xc78f88||0xcc;return function(_0xb55518){if(_0xb55518){return _0x35a5c1[_0xe32d('0x14')](_0xc78f88);}return _0x35a5c1[_0xe32d('0x15')](_0xc78f88)['end']();};}function respondWithResult(_0x3367f7,_0x3e704a){_0x3e704a=_0x3e704a||0xc8;return function(_0xa2cba8){if(_0xa2cba8){return _0x3367f7['status'](_0x3e704a)[_0xe32d('0x16')](_0xa2cba8);}};}function respondWithFilteredResult(_0x4d7cca,_0x2e37b8){return function(_0x54bc3d){if(_0x54bc3d){var _0x4f983b=typeof _0x2e37b8[_0xe32d('0x17')]==='undefined'&&typeof _0x2e37b8['limit']===_0xe32d('0x18');var _0x127f83=_0x54bc3d[_0xe32d('0x19')];var _0x2da06e=_0x4f983b?0x0:_0x2e37b8[_0xe32d('0x17')];var _0x46b964=_0x4f983b?_0x54bc3d[_0xe32d('0x19')]:_0x2e37b8[_0xe32d('0x17')]+_0x2e37b8[_0xe32d('0x1a')];var _0x6b6cea;if(_0x46b964>=_0x127f83){_0x46b964=_0x127f83;_0x6b6cea=0xc8;}else{_0x6b6cea=0xce;}_0x4d7cca[_0xe32d('0x15')](_0x6b6cea);return _0x4d7cca[_0xe32d('0x1b')](_0xe32d('0x1c'),_0x2da06e+'-'+_0x46b964+'/'+_0x127f83)[_0xe32d('0x16')](_0x54bc3d);}return null;};}function patchUpdates(_0x3feb50){return function(_0x538ad4){try{jsonpatch['apply'](_0x538ad4,_0x3feb50,!![]);}catch(_0x1742a8){return BPromise[_0xe32d('0x1d')](_0x1742a8);}return _0x538ad4[_0xe32d('0x1e')]();};}function saveUpdates(_0x3fc64b,_0x1015db){return function(_0xe5f397){if(_0xe5f397){return _0xe5f397['update'](_0x3fc64b)[_0xe32d('0x1f')](function(_0x5050b0){return _0x5050b0;});}return null;};}function removeEntity(_0x4cbee5,_0x20eb21){return function(_0x42a285){if(_0x42a285){return _0x42a285['destroy']()[_0xe32d('0x1f')](function(){_0x4cbee5[_0xe32d('0x15')](0xcc)[_0xe32d('0x20')]();});}};}function handleEntityNotFound(_0x3667e3,_0x4f6c84){return function(_0x55473b){if(!_0x55473b){_0x3667e3[_0xe32d('0x14')](0x194);}return _0x55473b;};}function handleError(_0x26df3f,_0x3ebaf2){_0x3ebaf2=_0x3ebaf2||0x1f4;return function(_0x46701b){logger[_0xe32d('0x21')](_0x46701b[_0xe32d('0x22')]);if(_0x46701b[_0xe32d('0x23')]){delete _0x46701b[_0xe32d('0x23')];}_0x26df3f[_0xe32d('0x15')](_0x3ebaf2)[_0xe32d('0x24')](_0x46701b);};}exports[_0xe32d('0x25')]=function(_0xc11f87,_0x190c4d){if(_0xc11f87[_0xe32d('0x26')]['id']){delete _0xc11f87[_0xe32d('0x26')]['id'];}return db[_0xe32d('0x27')][_0xe32d('0x28')]({'where':{'id':_0xc11f87['params']['id']}})['then'](handleEntityNotFound(_0x190c4d,null))['then'](saveUpdates(_0xc11f87[_0xe32d('0x26')],null))[_0xe32d('0x1f')](respondWithResult(_0x190c4d,null))[_0xe32d('0x29')](handleError(_0x190c4d,null));};exports[_0xe32d('0x2a')]=function(_0x581c3f,_0x88c9c2){return db['Action']['find']({'where':{'id':_0x581c3f[_0xe32d('0x2b')]['id']}})[_0xe32d('0x1f')](handleEntityNotFound(_0x88c9c2,null))[_0xe32d('0x1f')](removeEntity(_0x88c9c2,null))[_0xe32d('0x29')](handleError(_0x88c9c2,null));};
\ No newline at end of file
+var _0xc962=['undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','send','body','Action','params','catch','destroy','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x4d2993,_0x1d827d){var _0x5d7d4b=function(_0x9ca18f){while(--_0x9ca18f){_0x4d2993['push'](_0x4d2993['shift']());}};_0x5d7d4b(++_0x1d827d);}(_0xc962,0x6d));var _0x2c96=function(_0x44b565,_0x20b3b3){_0x44b565=_0x44b565-0x0;var _0x35cb2e=_0xc962[_0x44b565];return _0x35cb2e;};'use strict';var emlformat=require(_0x2c96('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c96('0x1'));var moment=require(_0x2c96('0x2'));var BPromise=require(_0x2c96('0x3'));var Mustache=require(_0x2c96('0x4'));var util=require(_0x2c96('0x5'));var path=require(_0x2c96('0x6'));var sox=require(_0x2c96('0x7'));var csv=require(_0x2c96('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c96('0x9'));var _=require(_0x2c96('0xa'));var squel=require(_0x2c96('0xb'));var crypto=require(_0x2c96('0xc'));var jsforce=require(_0x2c96('0xd'));var deskjs=require(_0x2c96('0xe'));var toCsv=require(_0x2c96('0x8'));var querystring=require(_0x2c96('0xf'));var Papa=require(_0x2c96('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2c96('0x11'));var as=require(_0x2c96('0x12'));var hardwareService=require(_0x2c96('0x13'));var logger=require(_0x2c96('0x14'))(_0x2c96('0x15'));var utils=require(_0x2c96('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2c96('0x17'))['db'];function respondWithStatusCode(_0x43d83f,_0x27a97c){_0x27a97c=_0x27a97c||0xcc;return function(_0x2491a4){if(_0x2491a4){return _0x43d83f[_0x2c96('0x18')](_0x27a97c);}return _0x43d83f[_0x2c96('0x19')](_0x27a97c)[_0x2c96('0x1a')]();};}function respondWithResult(_0x534203,_0x4fa416){_0x4fa416=_0x4fa416||0xc8;return function(_0x4c1d9a){if(_0x4c1d9a){return _0x534203[_0x2c96('0x19')](_0x4fa416)[_0x2c96('0x1b')](_0x4c1d9a);}};}function respondWithFilteredResult(_0x567ef0,_0x35ad10){return function(_0x3903a7){if(_0x3903a7){var _0x54649f=typeof _0x35ad10[_0x2c96('0x1c')]===_0x2c96('0x1d')&&typeof _0x35ad10[_0x2c96('0x1e')]===_0x2c96('0x1d');var _0x4757f3=_0x3903a7[_0x2c96('0x1f')];var _0x2ccbed=_0x54649f?0x0:_0x35ad10[_0x2c96('0x1c')];var _0x3fde3e=_0x54649f?_0x3903a7['count']:_0x35ad10['offset']+_0x35ad10[_0x2c96('0x1e')];var _0x3fb8a6;if(_0x3fde3e>=_0x4757f3){_0x3fde3e=_0x4757f3;_0x3fb8a6=0xc8;}else{_0x3fb8a6=0xce;}_0x567ef0[_0x2c96('0x19')](_0x3fb8a6);return _0x567ef0['set'](_0x2c96('0x20'),_0x2ccbed+'-'+_0x3fde3e+'/'+_0x4757f3)[_0x2c96('0x1b')](_0x3903a7);}return null;};}function patchUpdates(_0x17573b){return function(_0x4f8178){try{jsonpatch[_0x2c96('0x21')](_0x4f8178,_0x17573b,!![]);}catch(_0x3450ab){return BPromise['reject'](_0x3450ab);}return _0x4f8178[_0x2c96('0x22')]();};}function saveUpdates(_0x173867,_0x361e42){return function(_0x14daf1){if(_0x14daf1){return _0x14daf1[_0x2c96('0x23')](_0x173867)[_0x2c96('0x24')](function(_0x623e95){return _0x623e95;});}return null;};}function removeEntity(_0x5b2332,_0x3d8b21){return function(_0x58933c){if(_0x58933c){return _0x58933c['destroy']()[_0x2c96('0x24')](function(){_0x5b2332['status'](0xcc)[_0x2c96('0x1a')]();});}};}function handleEntityNotFound(_0x66cd41,_0x39e8bf){return function(_0xa5a767){if(!_0xa5a767){_0x66cd41['sendStatus'](0x194);}return _0xa5a767;};}function handleError(_0x345b6c,_0x1496bb){_0x1496bb=_0x1496bb||0x1f4;return function(_0x490f14){logger[_0x2c96('0x25')](_0x490f14[_0x2c96('0x26')]);if(_0x490f14[_0x2c96('0x27')]){delete _0x490f14[_0x2c96('0x27')];}_0x345b6c['status'](_0x1496bb)[_0x2c96('0x28')](_0x490f14);};}exports[_0x2c96('0x23')]=function(_0x1ddcc5,_0x319ad5){if(_0x1ddcc5['body']['id']){delete _0x1ddcc5[_0x2c96('0x29')]['id'];}return db[_0x2c96('0x2a')]['find']({'where':{'id':_0x1ddcc5[_0x2c96('0x2b')]['id']}})['then'](handleEntityNotFound(_0x319ad5,null))[_0x2c96('0x24')](saveUpdates(_0x1ddcc5[_0x2c96('0x29')],null))[_0x2c96('0x24')](respondWithResult(_0x319ad5,null))[_0x2c96('0x2c')](handleError(_0x319ad5,null));};exports[_0x2c96('0x2d')]=function(_0x30799f,_0x431038){return db[_0x2c96('0x2a')]['find']({'where':{'id':_0x30799f[_0x2c96('0x2b')]['id']}})[_0x2c96('0x24')](handleEntityNotFound(_0x431038,null))[_0x2c96('0x24')](removeEntity(_0x431038,null))['catch'](handleError(_0x431038,null));};
\ No newline at end of file
index aa36acb..512d91d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x030d=['request-promise','path','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x030d,0x1c9));var _0xd030=function(_0x168057,_0x18fae0){_0x168057=_0x168057-0x0;var _0x470c2f=_0x030d[_0x168057];return _0x470c2f;};'use strict';var _=require(_0xd030('0x0'));var util=require(_0xd030('0x1'));var logger=require(_0xd030('0x2'))(_0xd030('0x3'));var moment=require('moment');var BPromise=require(_0xd030('0x4'));var rp=require(_0xd030('0x5'));var fs=require('fs');var path=require(_0xd030('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xd030('0x7')]=function(_0x19b5ae,_0x397e7d){return _0x19b5ae[_0xd030('0x8')](_0xd030('0x9'),attributes,{'tableName':_0xd030('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb9c=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xcb9c,0x110));var _0xccb9=function(_0x275e98,_0x219859){_0x275e98=_0x275e98-0x0;var _0x173b69=_0xcb9c[_0x275e98];return _0x173b69;};'use strict';var _=require(_0xccb9('0x0'));var util=require(_0xccb9('0x1'));var logger=require(_0xccb9('0x2'))(_0xccb9('0x3'));var moment=require(_0xccb9('0x4'));var BPromise=require(_0xccb9('0x5'));var rp=require(_0xccb9('0x6'));var fs=require('fs');var path=require(_0xccb9('0x7'));var rimraf=require('rimraf');var config=require(_0xccb9('0x8'));var attributes=require(_0xccb9('0x9'));module[_0xccb9('0xa')]=function(_0x5bb0e5,_0x34a3da){return _0x5bb0e5[_0xccb9('0xb')](_0xccb9('0xc'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d9ec80f..9ab43bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x6451f0,_0x140639){var _0x39163c=function(_0x546679){while(--_0x546679){_0x6451f0['push'](_0x6451f0['shift']());}};_0x39163c(++_0x140639);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x134cab,_0xdcaa87){_0x134cab=_0x134cab-0x0;var _0xe5a8ab=_0x7fbe[_0x134cab];return _0xe5a8ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2e20fb,_0x5b5c93){var _0x5e445a=function(_0x425bb3){while(--_0x425bb3){_0x2e20fb['push'](_0x2e20fb['shift']());}};_0x5e445a(++_0x5b5c93);}(_0x5fab,0x177));var _0xb5fa=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x5fab[_0x264b61];return _0x8fff4f;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
index 17038e7..18c6c79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceec=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','multer'];(function(_0x610f96,_0x30ccf5){var _0x38f0c9=function(_0x39b2e1){while(--_0x39b2e1){_0x610f96['push'](_0x610f96['shift']());}};_0x38f0c9(++_0x30ccf5);}(_0xceec,0x1bf));var _0xccee=function(_0x3bd528,_0x4503cd){_0x3bd528=_0x3bd528-0x0;var _0x2752b9=_0xceec[_0x3bd528];return _0x2752b9;};'use strict';var multer=require(_0xccee('0x0'));var util=require(_0xccee('0x1'));var path=require(_0xccee('0x2'));var timeout=require(_0xccee('0x3'));var express=require(_0xccee('0x4'));var router=express[_0xccee('0x5')]();var fs_extra=require(_0xccee('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xccee('0x7'));var config=require(_0xccee('0x8'));var controller=require(_0xccee('0x9'));router[_0xccee('0xa')](_0xccee('0xb'),auth[_0xccee('0xc')](),controller[_0xccee('0xd')]);router[_0xccee('0xe')](_0xccee('0xb'),auth[_0xccee('0xc')](),controller[_0xccee('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xe4ce=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x30acd2,_0x2f8429){var _0x217263=function(_0x1955cb){while(--_0x1955cb){_0x30acd2['push'](_0x30acd2['shift']());}};_0x217263(++_0x2f8429);}(_0xe4ce,0xec));var _0xee4c=function(_0x548ee8,_0x2b0e1e){_0x548ee8=_0x548ee8-0x0;var _0x2687e1=_0xe4ce[_0x548ee8];return _0x2687e1;};'use strict';var multer=require('multer');var util=require(_0xee4c('0x0'));var path=require(_0xee4c('0x1'));var timeout=require(_0xee4c('0x2'));var express=require(_0xee4c('0x3'));var router=express[_0xee4c('0x4')]();var fs_extra=require(_0xee4c('0x5'));var auth=require(_0xee4c('0x6'));var interaction=require(_0xee4c('0x7'));var config=require(_0xee4c('0x8'));var controller=require(_0xee4c('0x9'));router[_0xee4c('0xa')](_0xee4c('0xb'),auth[_0xee4c('0xc')](),controller[_0xee4c('0xd')]);router['delete']('/:id',auth[_0xee4c('0xc')](),controller[_0xee4c('0xe')]);module[_0xee4c('0xf')]=router;
\ No newline at end of file
index 4b112e3..8a74a00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda19=['exports','STRING','TEXT'];(function(_0x26c79f,_0x59d3fc){var _0x17a46e=function(_0x2f799c){while(--_0x2f799c){_0x26c79f['push'](_0x26c79f['shift']());}};_0x17a46e(++_0x59d3fc);}(_0xda19,0xd5));var _0x9da1=function(_0x411b75,_0x4de4ca){_0x411b75=_0x411b75-0x0;var _0x5a9239=_0xda19[_0x411b75];return _0x5a9239;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xf2ca=['STRING','TEXT','sequelize','exports'];(function(_0x331615,_0x13aebd){var _0x4ba773=function(_0x577243){while(--_0x577243){_0x331615['push'](_0x331615['shift']());}};_0x4ba773(++_0x13aebd);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x424ebf,_0x4c64d3){_0x424ebf=_0x424ebf-0x0;var _0x4c6aef=_0xf2ca[_0x424ebf];return _0x4c6aef;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'name':{'type':Sequelize[_0xaf2c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xaf2c('0x2')]},'table':{'type':Sequelize[_0xaf2c('0x2')]},'conditions':{'type':Sequelize[_0xaf2c('0x3')]},'joins':{'type':Sequelize[_0xaf2c('0x3')]}};
\ No newline at end of file
index a54c8da..ca254eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1409=['update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','intersection','model','query','attributes','fields','nolimit','sort','where','pick','filter','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','length','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','body','join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','function','replace','format','groupBy','orderBy','order','alias','joins','includes','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','operator','ValidationErrorItem','metric','parse','output','web','fullPath','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','select','countTable','COUNT(*)','run','runReport','AnalyticMetric','DESC','debug','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x1409,0x79));var _0x9140=function(_0x21729a,_0x374c08){_0x21729a=_0x21729a-0x0;var _0x2db545=_0x1409[_0x21729a];return _0x2db545;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9140('0x0'));var zipdir=require(_0x9140('0x1'));var jsonpatch=require(_0x9140('0x2'));var rp=require(_0x9140('0x3'));var moment=require(_0x9140('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9140('0x5'));var util=require(_0x9140('0x6'));var path=require(_0x9140('0x7'));var sox=require(_0x9140('0x8'));var csv=require(_0x9140('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9140('0xa'));var _=require(_0x9140('0xb'));var squel=require('squel');var crypto=require(_0x9140('0xc'));var jsforce=require(_0x9140('0xd'));var deskjs=require(_0x9140('0xe'));var toCsv=require(_0x9140('0x9'));var querystring=require('querystring');var Papa=require(_0x9140('0xf'));var Redis=require(_0x9140('0x10'));var authService=require(_0x9140('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9140('0x12'));var hardwareService=require(_0x9140('0x13'));var logger=require(_0x9140('0x14'))(_0x9140('0x15'));var utils=require(_0x9140('0x16'));var config=require(_0x9140('0x17'));var licenseUtil=require(_0x9140('0x18'));var db=require(_0x9140('0x19'))['db'];var dbH=require(_0x9140('0x19'))['dbH'];function respondWithStatusCode(_0x4d6996,_0x5d1ab1){_0x5d1ab1=_0x5d1ab1||0xcc;return function(_0x5bcc06){if(_0x5bcc06){return _0x4d6996[_0x9140('0x1a')](_0x5d1ab1);}return _0x4d6996[_0x9140('0x1b')](_0x5d1ab1)['end']();};}function respondWithResult(_0xe3e26,_0x3969d5){_0x3969d5=_0x3969d5||0xc8;return function(_0x23ac20){if(_0x23ac20){return _0xe3e26[_0x9140('0x1b')](_0x3969d5)[_0x9140('0x1c')](_0x23ac20);}};}function respondWithFilteredResult(_0x56bea4,_0x56e5b2){return function(_0x2c3879){if(_0x2c3879){var _0x4fce66=typeof _0x56e5b2[_0x9140('0x1d')]===_0x9140('0x1e')&&typeof _0x56e5b2[_0x9140('0x1f')]===_0x9140('0x1e');var _0x4102f5=_0x2c3879[_0x9140('0x20')];var _0x628bc8=_0x4fce66?0x0:_0x56e5b2[_0x9140('0x1d')];var _0x545256=_0x4fce66?_0x2c3879[_0x9140('0x20')]:_0x56e5b2['offset']+_0x56e5b2[_0x9140('0x1f')];var _0x2ce3a1;if(_0x545256>=_0x4102f5){_0x545256=_0x4102f5;_0x2ce3a1=0xc8;}else{_0x2ce3a1=0xce;}_0x56bea4[_0x9140('0x1b')](_0x2ce3a1);return _0x56bea4['set'](_0x9140('0x21'),_0x628bc8+'-'+_0x545256+'/'+_0x4102f5)[_0x9140('0x1c')](_0x2c3879);}return null;};}function patchUpdates(_0x4d757d){return function(_0x4b5c03){try{jsonpatch['apply'](_0x4b5c03,_0x4d757d,!![]);}catch(_0x460415){return BPromise[_0x9140('0x22')](_0x460415);}return _0x4b5c03[_0x9140('0x23')]();};}function saveUpdates(_0x2f36f3,_0x28c67e){return function(_0x5e21c4){if(_0x5e21c4){return _0x5e21c4[_0x9140('0x24')](_0x2f36f3)[_0x9140('0x25')](function(_0x283e5c){return _0x283e5c;});}return null;};}function removeEntity(_0x436851,_0x316c9b){return function(_0x1cd781){if(_0x1cd781){return _0x1cd781[_0x9140('0x26')]()[_0x9140('0x25')](function(){var _0x5e7c5e=_0x1cd781[_0x9140('0x27')]({'plain':!![]});var _0x26d5b9=_0x9140('0x28');return db[_0x9140('0x29')][_0x9140('0x26')]({'where':{'type':_0x26d5b9,'resourceId':_0x5e7c5e['id']}})[_0x9140('0x25')](function(){return _0x1cd781;});})[_0x9140('0x25')](function(){_0x436851[_0x9140('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c523,_0x4024a0){return function(_0x35e4ec){if(!_0x35e4ec){_0x50c523[_0x9140('0x1a')](0x194);}return _0x35e4ec;};}function handleError(_0x312748,_0x58b483){_0x58b483=_0x58b483||0x1f4;return function(_0x2c255d){logger[_0x9140('0x2a')](_0x2c255d[_0x9140('0x2b')]);if(_0x2c255d[_0x9140('0x2c')]){delete _0x2c255d[_0x9140('0x2c')];}_0x312748[_0x9140('0x1b')](_0x58b483)[_0x9140('0x2d')](_0x2c255d);};}exports[_0x9140('0x2e')]=function(_0x544dee,_0x9a9ae4){var _0x161749={},_0x4f49e0={},_0x307eca={'count':0x0,'rows':[]};var _0x160a8a=_[_0x9140('0x2f')](db[_0x9140('0x30')]['rawAttributes'],function(_0x34fe6a){return{'name':_0x34fe6a[_0x9140('0x31')],'type':_0x34fe6a[_0x9140('0x32')][_0x9140('0x33')]};});_0x4f49e0['model']=_[_0x9140('0x2f')](_0x160a8a,_0x9140('0x2c'));_0x4f49e0['query']=_['keys'](_0x544dee['query']);_0x4f49e0['filters']=_[_0x9140('0x34')](_0x4f49e0[_0x9140('0x35')],_0x4f49e0[_0x9140('0x36')]);_0x161749[_0x9140('0x37')]=_[_0x9140('0x34')](_0x4f49e0[_0x9140('0x35')],qs[_0x9140('0x38')](_0x544dee['query'][_0x9140('0x38')]));_0x161749[_0x9140('0x37')]=_0x161749[_0x9140('0x37')]['length']?_0x161749[_0x9140('0x37')]:_0x4f49e0[_0x9140('0x35')];if(!_0x544dee[_0x9140('0x36')]['hasOwnProperty'](_0x9140('0x39'))){_0x161749[_0x9140('0x1f')]=qs[_0x9140('0x1f')](_0x544dee[_0x9140('0x36')][_0x9140('0x1f')]);_0x161749['offset']=qs[_0x9140('0x1d')](_0x544dee[_0x9140('0x36')]['offset']);}_0x161749['order']=qs[_0x9140('0x3a')](_0x544dee[_0x9140('0x36')][_0x9140('0x3a')]);_0x161749[_0x9140('0x3b')]=qs['filters'](_[_0x9140('0x3c')](_0x544dee['query'],_0x4f49e0['filters']),_0x160a8a);if(_0x544dee[_0x9140('0x36')][_0x9140('0x3d')]){_0x161749[_0x9140('0x3b')]=_['merge'](_0x161749['where'],{'$or':_[_0x9140('0x2f')](_0x160a8a,function(_0x452fd7){if(_0x452fd7['type']!=='VIRTUAL'){var _0x507ef5={};_0x507ef5[_0x452fd7['name']]={'$like':'%'+_0x544dee[_0x9140('0x36')][_0x9140('0x3d')]+'%'};return _0x507ef5;}})});}_0x161749=_['merge']({},_0x161749,_0x544dee[_0x9140('0x3e')]);var _0x198e46={'where':_0x161749[_0x9140('0x3b')]};return db[_0x9140('0x30')][_0x9140('0x20')](_0x198e46)['then'](function(_0x2f8581){_0x307eca['count']=_0x2f8581;if(_0x544dee[_0x9140('0x36')][_0x9140('0x3f')]){_0x161749['include']=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x9140('0x40')](_0x161749);})[_0x9140('0x25')](function(_0x1d3457){_0x307eca[_0x9140('0x41')]=_0x1d3457;return _0x307eca;})['then'](respondWithFilteredResult(_0x9a9ae4,_0x161749))[_0x9140('0x42')](handleError(_0x9a9ae4,null));};exports['show']=function(_0x696ff2,_0x5329bc){var _0x1de01d={'raw':![],'where':{'id':_0x696ff2[_0x9140('0x43')]['id']}},_0x3f0332={};_0x3f0332[_0x9140('0x35')]=_[_0x9140('0x44')](db['AnalyticCustomReport'][_0x9140('0x45')]);_0x3f0332[_0x9140('0x36')]=_[_0x9140('0x44')](_0x696ff2[_0x9140('0x36')]);_0x3f0332['filters']=_[_0x9140('0x34')](_0x3f0332[_0x9140('0x35')],_0x3f0332[_0x9140('0x36')]);_0x1de01d[_0x9140('0x37')]=_[_0x9140('0x34')](_0x3f0332[_0x9140('0x35')],qs['fields'](_0x696ff2['query'][_0x9140('0x38')]));_0x1de01d[_0x9140('0x37')]=_0x1de01d[_0x9140('0x37')][_0x9140('0x46')]?_0x1de01d[_0x9140('0x37')]:_0x3f0332[_0x9140('0x35')];if(_0x696ff2['query'][_0x9140('0x3f')]){_0x1de01d['include']=[{'all':!![]}];}_0x1de01d=_[_0x9140('0x47')]({},_0x1de01d,_0x696ff2[_0x9140('0x3e')]);return db[_0x9140('0x30')]['find'](_0x1de01d)[_0x9140('0x25')](handleEntityNotFound(_0x5329bc,null))[_0x9140('0x25')](respondWithResult(_0x5329bc,null))[_0x9140('0x42')](handleError(_0x5329bc,null));};exports['create']=function(_0x23ff70,_0x76b97e){return db[_0x9140('0x30')][_0x9140('0x48')](_0x23ff70['body'],{})[_0x9140('0x25')](function(_0x3cab74){var _0x5e4640=_0x23ff70[_0x9140('0x49')][_0x9140('0x27')]({'plain':!![]});if(!_0x5e4640)throw new Error(_0x9140('0x4a'));if(_0x5e4640['role']===_0x9140('0x49')){var _0x2efd86=_0x3cab74[_0x9140('0x27')]({'plain':!![]});var _0x2167b6=_0x9140('0x4b');return db[_0x9140('0x4c')][_0x9140('0x4d')]({'where':{'name':_0x2167b6,'userProfileId':_0x5e4640[_0x9140('0x4e')]},'raw':!![]})[_0x9140('0x25')](function(_0x3bad42){if(_0x3bad42&&_0x3bad42['autoAssociation']===0x0){return db['UserProfileResource'][_0x9140('0x48')]({'name':_0x2efd86['name'],'resourceId':_0x2efd86['id'],'type':_0x9140('0x28'),'sectionId':_0x3bad42['id']},{})['then'](function(){return _0x3cab74;});}else{return _0x3cab74;}})['catch'](function(_0x25c720){logger[_0x9140('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25c720);throw _0x25c720;});}return _0x3cab74;})[_0x9140('0x25')](respondWithResult(_0x76b97e,0xc9))[_0x9140('0x42')](handleError(_0x76b97e,null));};exports[_0x9140('0x24')]=function(_0x25d2fa,_0x1848f9){if(_0x25d2fa[_0x9140('0x4f')]['id']){delete _0x25d2fa[_0x9140('0x4f')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x25d2fa[_0x9140('0x43')]['id']}})[_0x9140('0x25')](handleEntityNotFound(_0x1848f9,null))[_0x9140('0x25')](saveUpdates(_0x25d2fa[_0x9140('0x4f')],null))[_0x9140('0x25')](respondWithResult(_0x1848f9,null))[_0x9140('0x42')](handleError(_0x1848f9,null));};exports['destroy']=function(_0x1a1976,_0x583143){return db[_0x9140('0x30')][_0x9140('0x4d')]({'where':{'id':_0x1a1976[_0x9140('0x43')]['id']}})[_0x9140('0x25')](handleEntityNotFound(_0x583143,null))[_0x9140('0x25')](removeEntity(_0x583143,null))[_0x9140('0x42')](handleError(_0x583143,null));};exports['preview']=function(_0x1b8ff4,_0x503daf){var _0x4dd09b=0xa;var _0x461913=[_0x9140('0x50'),'left_join',_0x9140('0x51'),_0x9140('0x52')];var _0x397794={'SUM':'SUM(%s)','COUNT':_0x9140('0x53'),'COUNT DISTINCT':_0x9140('0x54'),'MAX':_0x9140('0x55'),'MIN':_0x9140('0x56'),'AVG':_0x9140('0x57'),'GROUP_CONCAT':_0x9140('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x9140('0x59')};var _0x3e997c={'SEC_TO_TIME':_0x9140('0x5a'),'DATE':_0x9140('0x5b'),'HOUR':_0x9140('0x5c'),'ROUND':_0x9140('0x5d'),'UNIX_TIMESTAMP':_0x9140('0x5e')};var _0x4ed230=function(_0x1eeeec){return!_['includes']([_0x9140('0x5f'),_0x9140('0x60'),_0x9140('0x61'),_0x9140('0x62')],_0x1eeeec);};var _0x1c0612=function(_0x566443){if(!_0x566443||!_0x566443['rules'][_0x9140('0x46')]){return'';}for(var _0xbc10d2='(',_0x30fbe8=0x0;_0x30fbe8<_0x566443[_0x9140('0x63')]['length'];_0x30fbe8+=0x1){_0x30fbe8>0x0&&(_0xbc10d2+='\x20'+_0x566443['operator']+'\x20');_0xbc10d2+=_0x566443[_0x9140('0x63')][_0x30fbe8][_0x9140('0x64')]?_0x1c0612(_0x566443[_0x9140('0x63')][_0x30fbe8]['group']):_0x566443[_0x9140('0x63')][_0x30fbe8][_0x9140('0x65')]+'\x20'+_0x566443[_0x9140('0x63')][_0x30fbe8]['condition']+(_0x4ed230(_0x566443[_0x9140('0x63')][_0x30fbe8][_0x9140('0x66')])?'\x20'+_0x566443['rules'][_0x30fbe8][_0x9140('0x67')]:'');}return _0xbc10d2+')';};var _0x129ea6={'where':{'id':_0x1b8ff4['params']['id']}},_0x3bdcd7,_0x2776b0,_0x1bdbfb,_0x3a30b6,_0x2d1e80;_0x129ea6=_[_0x9140('0x47')]({},_0x129ea6,_0x1b8ff4[_0x9140('0x3e')]);return db[_0x9140('0x30')][_0x9140('0x4d')](_0x129ea6)[_0x9140('0x25')](function(_0x5f2254){if(_0x5f2254){_0x3bdcd7=_0x5f2254;return _0x5f2254[_0x9140('0x68')]();}return null;})[_0x9140('0x25')](function(_0x328d1f){if(_0x328d1f){if(!_0x328d1f[_0x9140('0x46')]){throw new db[(_0x9140('0x69'))]['ValidationErrorItem'](_0x9140('0x6a'),0x193);}_0x2776b0=_0x328d1f;return db['AnalyticMetric'][_0x9140('0x40')]({'raw':!![]});}return null;})[_0x9140('0x25')](function(_0x564de0){if(_0x564de0){_0x1bdbfb=_[_0x9140('0x6b')](_0x564de0,'id');var _0xad25d6;var _0x1c63d2=squel['select']();_0x1c63d2[_0x9140('0x6c')](_0x3bdcd7[_0x9140('0x6d')]);for(var _0x40caee=0x0;_0x40caee<_0x2776b0[_0x9140('0x46')];_0x40caee+=0x1){_0xad25d6=_0x2776b0[_0x40caee]['MetricId']?_0x1bdbfb[_0x2776b0[_0x40caee][_0x9140('0x6e')]]['metric']:_0x2776b0[_0x40caee]['field'];_0xad25d6=_0x2776b0[_0x40caee][_0x9140('0x6f')]?_[_0x9140('0x70')](_0x397794[_0x2776b0[_0x40caee][_0x9140('0x6f')]],'%s',_0xad25d6):_0xad25d6;_0xad25d6=_0x2776b0[_0x40caee][_0x9140('0x71')]?_[_0x9140('0x70')](_0x3e997c[_0x2776b0[_0x40caee][_0x9140('0x71')]],'%s',_0xad25d6):_0xad25d6;if(_0x2776b0[_0x40caee][_0x9140('0x72')]){_0x1c63d2[_0x9140('0x64')](_0xad25d6);}_0x2776b0[_0x40caee][_0x9140('0x73')]&&_0x1c63d2[_0x9140('0x74')](_0xad25d6,_0x2776b0[_0x40caee][_0x9140('0x73')]==='DESC'?![]:!![]);_0x1c63d2[_0x9140('0x65')](_0xad25d6,_0x2776b0[_0x40caee][_0x9140('0x75')]||_0xad25d6);}if(_0x3bdcd7[_0x9140('0x76')]){_0x3bdcd7[_0x9140('0x76')]=JSON['parse'](_0x3bdcd7[_0x9140('0x76')]);for(var _0x2aa9ff=0x0;_0x2aa9ff<_0x3bdcd7[_0x9140('0x76')][_0x9140('0x46')];_0x2aa9ff+=0x1){if(_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x32')]&&_[_0x9140('0x77')](_0x461913,_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x32')])&&_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x78')]&&_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff]['foreignTable']&&_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x79')]){_0x1c63d2[_0x3bdcd7['joins'][_0x2aa9ff][_0x9140('0x32')]](_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x7a')],null,util['format'](_0x9140('0x7b'),_0x3bdcd7[_0x9140('0x6d')],_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x78')],_0x3bdcd7['joins'][_0x2aa9ff][_0x9140('0x7a')],_0x3bdcd7[_0x9140('0x76')][_0x2aa9ff][_0x9140('0x79')]));}}}if(_0x3bdcd7[_0x9140('0x7c')]){_0x3bdcd7[_0x9140('0x7c')]=JSON['parse'](_0x3bdcd7[_0x9140('0x7c')]);_0x1c63d2[_0x9140('0x3b')](_0x1c0612(_0x3bdcd7[_0x9140('0x7c')][_0x9140('0x64')]));}_0x2d1e80=_0x1c63d2[_0x9140('0x7d')]();_0x1c63d2[_0x9140('0x1f')](_0x4dd09b);_0x1c63d2[_0x9140('0x1d')](0x0);logger['debug'](_0x9140('0x7e'),_0x1c63d2[_0x9140('0x7f')]());return dbH[_0x9140('0x80')][_0x9140('0x36')](_0x1c63d2[_0x9140('0x7f')](),{'type':dbH[_0x9140('0x80')][_0x9140('0x81')][_0x9140('0x82')]});}})[_0x9140('0x25')](respondWithResult(_0x503daf,null))[_0x9140('0x42')](handleError(_0x503daf,null));};function runReport(_0xe9d458,_0x535f9c,_0x28436d){var _0x466e63=_0x535f9c[_0x9140('0x2c')];var _0x4e8825=0xa;var _0x260d86=[_0x9140('0x50'),_0x9140('0x83'),_0x9140('0x51'),_0x9140('0x52')];var _0x555589={'SUM':'SUM(%s)','COUNT':_0x9140('0x53'),'COUNT DISTINCT':_0x9140('0x54'),'MAX':'MAX(%s)','MIN':_0x9140('0x56'),'AVG':_0x9140('0x57'),'GROUP_CONCAT':_0x9140('0x58'),'GROUP_CONCAT ASC':_0x9140('0x84'),'GROUP_CONCAT DESC':_0x9140('0x59')};var _0x3cbbd7={'SEC_TO_TIME':_0x9140('0x5a'),'DATE':'DATE(%s)','HOUR':_0x9140('0x5c'),'ROUND':_0x9140('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47a891=function(_0x153350){return!_[_0x9140('0x77')]([_0x9140('0x5f'),_0x9140('0x60'),_0x9140('0x61'),_0x9140('0x62')],_0x153350);};var _0x53aa8c=function(_0x385ef5){if(!_0x385ef5||!_0x385ef5[_0x9140('0x63')]['length']){return'';}for(var _0x54b2e7='(',_0x1cadbc=0x0;_0x1cadbc<_0x385ef5[_0x9140('0x63')][_0x9140('0x46')];_0x1cadbc+=0x1){_0x1cadbc>0x0&&(_0x54b2e7+='\x20'+_0x385ef5[_0x9140('0x85')]+'\x20');_0x54b2e7+=_0x385ef5[_0x9140('0x63')][_0x1cadbc][_0x9140('0x64')]?_0x53aa8c(_0x385ef5['rules'][_0x1cadbc]['group']):_0x385ef5[_0x9140('0x63')][_0x1cadbc][_0x9140('0x65')]+'\x20'+_0x385ef5['rules'][_0x1cadbc]['condition']+(_0x47a891(_0x385ef5[_0x9140('0x63')][_0x1cadbc][_0x9140('0x66')])?'\x20'+_0x385ef5[_0x9140('0x63')][_0x1cadbc][_0x9140('0x67')]:'');}return _0x54b2e7+')';};var _0x2ec93f={'where':{'id':_0xe9d458['id']}},_0x599937,_0x200c3a,_0x19195e,_0x578f34,_0x475800;_0x2ec93f=_[_0x9140('0x47')]({},_0x2ec93f,_0x28436d);return db[_0x9140('0x30')][_0x9140('0x4d')](_0x2ec93f)[_0x9140('0x25')](function(_0x4bc0b6){if(_0x4bc0b6){_0x599937=_0x4bc0b6;return _0x4bc0b6[_0x9140('0x68')]();}return null;})[_0x9140('0x25')](function(_0x3bb84a){if(_0x3bb84a){if(!_0x3bb84a[_0x9140('0x46')]){throw new db['Sequelize'][(_0x9140('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x200c3a=_0x3bb84a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x9140('0x25')](function(_0x2bfd25){if(_0x2bfd25){_0x19195e=_[_0x9140('0x6b')](_0x2bfd25,'id');var _0x157448;var _0x203c79=squel['select']();_0x203c79[_0x9140('0x6c')](_0x599937['table']);for(var _0x9dacf5=0x0;_0x9dacf5<_0x200c3a[_0x9140('0x46')];_0x9dacf5+=0x1){_0x157448=_0x200c3a[_0x9dacf5][_0x9140('0x6e')]?_0x19195e[_0x200c3a[_0x9dacf5]['MetricId']][_0x9140('0x87')]:_0x200c3a[_0x9dacf5][_0x9140('0x65')];_0x157448=_0x200c3a[_0x9dacf5]['function']?_[_0x9140('0x70')](_0x555589[_0x200c3a[_0x9dacf5][_0x9140('0x6f')]],'%s',_0x157448):_0x157448;_0x157448=_0x200c3a[_0x9dacf5][_0x9140('0x71')]?_[_0x9140('0x70')](_0x3cbbd7[_0x200c3a[_0x9dacf5]['format']],'%s',_0x157448):_0x157448;if(_0x200c3a[_0x9dacf5][_0x9140('0x72')]){_0x203c79['group'](_0x157448);}_0x200c3a[_0x9dacf5]['orderBy']&&_0x203c79['order'](_0x157448,_0x200c3a[_0x9dacf5][_0x9140('0x73')]==='DESC'?![]:!![]);_0x203c79[_0x9140('0x65')](_0x157448,_0x200c3a[_0x9dacf5][_0x9140('0x75')]||_0x157448);}if(_0x599937[_0x9140('0x76')]){_0x599937[_0x9140('0x76')]=JSON[_0x9140('0x88')](_0x599937[_0x9140('0x76')]);for(var _0x500e9b=0x0;_0x500e9b<_0x599937[_0x9140('0x76')][_0x9140('0x46')];_0x500e9b+=0x1){if(_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x32')]&&_[_0x9140('0x77')](_0x260d86,_0x599937['joins'][_0x500e9b][_0x9140('0x32')])&&_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x78')]&&_0x599937['joins'][_0x500e9b][_0x9140('0x7a')]&&_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x79')]){_0x203c79[_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x32')]](_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x7a')],null,util[_0x9140('0x71')]('%s.%s\x20=\x20%s.%s',_0x599937[_0x9140('0x6d')],_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x78')],_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x7a')],_0x599937[_0x9140('0x76')][_0x500e9b][_0x9140('0x79')]));}}}if(_0x599937[_0x9140('0x7c')]){_0x599937[_0x9140('0x7c')]=JSON[_0x9140('0x88')](_0x599937[_0x9140('0x7c')]);_0x203c79['where'](_0x53aa8c(_0x599937['conditions']['group']));}_0x475800=_0x203c79[_0x9140('0x7d')]();_0x203c79[_0x9140('0x1f')](_0x4e8825);_0x203c79['offset'](0x0);return;}})[_0x9140('0x25')](function(){if(_0x535f9c[_0x9140('0x89')]===_0x9140('0x8a')){return null;}var _0x2a82ac=_[_0x9140('0x47')](_0x535f9c,{'name':_0x535f9c[_0x9140('0x8b')]||_0x535f9c[_0x9140('0x2c')]||_0x599937[_0x9140('0x2c')],'basename':_0x466e63,'savename':util[_0x9140('0x71')]('%s-%s.%s',_0x535f9c[_0x9140('0x2c')]||_0x599937[_0x9140('0x2c')],require('randomstring')['generate'](0x4),_0x535f9c['output']||_0x9140('0x8c')),'reportId':_0x599937['id'],'reportType':'custom'});return db[_0x9140('0x8d')][_0x9140('0x48')](_0x2a82ac,{'raw':!![]});})[_0x9140('0x25')](function(_0x4bd201){if(_0x599937['table']==='cdr'){_0x475800[_0x9140('0x3b')](_0x599937[_0x9140('0x6d')]+_0x9140('0x8e'),_0x535f9c[_0x9140('0x8f')],_0x535f9c[_0x9140('0x90')]);}else{_0x475800['where'](_0x599937[_0x9140('0x6d')]+_0x9140('0x91'),_0x535f9c[_0x9140('0x8f')],_0x535f9c['endDate']);}if(_0x4bd201){logger[_0x9140('0x92')]('Run\x20Query:',_0x475800[_0x9140('0x7f')]());require(_0x9140('0x93'))[_0x9140('0x94')](path['join'](__dirname,'../../components/export/',_0x4bd201[_0x9140('0x89')]),[_0x4bd201['id'],_0x475800[_0x9140('0x7f')](),path[_0x9140('0x50')](__dirname,'../../files/reports',_0x4bd201['savename']),_0x466e63]);return _0x4bd201;}else{var _0x2dcdc4=squel[_0x9140('0x95')]();_0x2dcdc4[_0x9140('0x6c')]('('+_0x475800[_0x9140('0x7f')]()+')',_0x9140('0x96'));_0x2dcdc4[_0x9140('0x65')](_0x9140('0x97'),'count');_0x475800[_0x9140('0x1f')](_0x535f9c[_0x9140('0x1f')]||_0x4e8825);_0x475800['offset'](_0x535f9c[_0x9140('0x1d')]||0x0);return dbH[_0x9140('0x80')][_0x9140('0x36')](_0x2dcdc4[_0x9140('0x7f')](),{'type':dbH[_0x9140('0x80')]['QueryTypes'][_0x9140('0x82')]})[_0x9140('0x25')](function(_0x5ef896){if(!_0x5ef896[_0x9140('0x46')]){_0x578f34=0x0;}else{_0x578f34=_0x5ef896[0x0][_0x9140('0x20')]||0x0;}return dbH['sequelize'][_0x9140('0x36')](_0x475800[_0x9140('0x7f')](),{'type':dbH[_0x9140('0x80')][_0x9140('0x81')][_0x9140('0x82')]});})[_0x9140('0x25')](function(_0xf60651){return{'rows':_0xf60651||[],'count':_0x578f34};});}});}exports[_0x9140('0x98')]=function(_0x3bea0e,_0x57a535){return runReport(_0x3bea0e[_0x9140('0x43')],_0x3bea0e[_0x9140('0x36')],_0x3bea0e[_0x9140('0x3e')])[_0x9140('0x25')](respondWithResult(_0x57a535,null))['catch'](handleError(_0x57a535,null));};exports[_0x9140('0x99')]=runReport;exports[_0x9140('0x36')]=function(_0x1ae889,_0x97f6c4){var _0x2440e9=0xa;var _0x3377fe=[_0x9140('0x50'),_0x9140('0x83'),_0x9140('0x51'),'cross_join'];var _0x312a06={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x9140('0x54'),'MAX':_0x9140('0x55'),'MIN':_0x9140('0x56'),'AVG':_0x9140('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x9140('0x84'),'GROUP_CONCAT DESC':_0x9140('0x59')};var _0x57ef27={'SEC_TO_TIME':_0x9140('0x5a'),'DATE':_0x9140('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x9140('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b1cf2=function(_0x3fb192){return!_[_0x9140('0x77')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x9140('0x62')],_0x3fb192);};var _0x44cc87=function(_0x479104){if(!_0x479104||!_0x479104[_0x9140('0x63')]['length']){return'';}for(var _0x3553e3='(',_0x58377f=0x0;_0x58377f<_0x479104[_0x9140('0x63')][_0x9140('0x46')];_0x58377f+=0x1){_0x58377f>0x0&&(_0x3553e3+='\x20'+_0x479104[_0x9140('0x85')]+'\x20');_0x3553e3+=_0x479104['rules'][_0x58377f][_0x9140('0x64')]?_0x44cc87(_0x479104[_0x9140('0x63')][_0x58377f][_0x9140('0x64')]):_0x479104[_0x9140('0x63')][_0x58377f][_0x9140('0x65')]+'\x20'+_0x479104[_0x9140('0x63')][_0x58377f][_0x9140('0x66')]+(_0x4b1cf2(_0x479104['rules'][_0x58377f]['condition'])?'\x20'+_0x479104[_0x9140('0x63')][_0x58377f][_0x9140('0x67')]:'');}return _0x3553e3+')';};var _0x4060d9={'where':{'id':_0x1ae889[_0x9140('0x43')]['id']}},_0x4d481d,_0x35bc14,_0xbbd268,_0x28efdb,_0x300933;_0x4060d9=_[_0x9140('0x47')]({},_0x4060d9,_0x1ae889[_0x9140('0x3e')]);return db[_0x9140('0x30')][_0x9140('0x4d')](_0x4060d9)[_0x9140('0x25')](function(_0x1ed422){if(_0x1ed422){_0x4d481d=_0x1ed422;return _0x1ed422[_0x9140('0x68')]();}return null;})['then'](function(_0x421acd){if(_0x421acd){if(!_0x421acd[_0x9140('0x46')]){throw new db[(_0x9140('0x69'))][(_0x9140('0x86'))](_0x9140('0x6a'),0x193);}_0x35bc14=_0x421acd;return db[_0x9140('0x9a')]['findAll']({'raw':!![]});}return null;})[_0x9140('0x25')](function(_0x4eac0f){if(_0x4eac0f){_0xbbd268=_[_0x9140('0x6b')](_0x4eac0f,'id');var _0x3b7359;var _0x44093a=squel[_0x9140('0x95')]();_0x44093a['from'](_0x4d481d[_0x9140('0x6d')]);for(var _0x5ccd9d=0x0;_0x5ccd9d<_0x35bc14['length'];_0x5ccd9d+=0x1){_0x3b7359=_0x35bc14[_0x5ccd9d][_0x9140('0x6e')]?_0xbbd268[_0x35bc14[_0x5ccd9d]['MetricId']][_0x9140('0x87')]:_0x35bc14[_0x5ccd9d][_0x9140('0x65')];_0x3b7359=_0x35bc14[_0x5ccd9d]['function']?_[_0x9140('0x70')](_0x312a06[_0x35bc14[_0x5ccd9d]['function']],'%s',_0x3b7359):_0x3b7359;_0x3b7359=_0x35bc14[_0x5ccd9d][_0x9140('0x71')]?_[_0x9140('0x70')](_0x57ef27[_0x35bc14[_0x5ccd9d]['format']],'%s',_0x3b7359):_0x3b7359;if(_0x35bc14[_0x5ccd9d]['groupBy']){_0x44093a[_0x9140('0x64')](_0x3b7359);}_0x35bc14[_0x5ccd9d]['orderBy']&&_0x44093a[_0x9140('0x74')](_0x3b7359,_0x35bc14[_0x5ccd9d][_0x9140('0x73')]===_0x9140('0x9b')?![]:!![]);_0x44093a['field'](_0x3b7359,_0x35bc14[_0x5ccd9d][_0x9140('0x75')]||_0x3b7359);}if(_0x4d481d[_0x9140('0x76')]){_0x4d481d[_0x9140('0x76')]=JSON[_0x9140('0x88')](_0x4d481d[_0x9140('0x76')]);for(var _0x306afb=0x0;_0x306afb<_0x4d481d['joins'][_0x9140('0x46')];_0x306afb+=0x1){if(_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x32')]&&_['includes'](_0x3377fe,_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x32')])&&_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x78')]&&_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x7a')]&&_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x79')]){_0x44093a[_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x32')]](_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x7a')],null,util[_0x9140('0x71')]('%s.%s\x20=\x20%s.%s',_0x4d481d['table'],_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x78')],_0x4d481d['joins'][_0x306afb][_0x9140('0x7a')],_0x4d481d[_0x9140('0x76')][_0x306afb][_0x9140('0x79')]));}}}if(_0x4d481d[_0x9140('0x7c')]){_0x4d481d['conditions']=JSON['parse'](_0x4d481d[_0x9140('0x7c')]);_0x44093a['where'](_0x44cc87(_0x4d481d[_0x9140('0x7c')][_0x9140('0x64')]));}_0x300933=_0x44093a[_0x9140('0x7d')]();_0x44093a[_0x9140('0x1f')](_0x2440e9);_0x44093a[_0x9140('0x1d')](0x0);logger[_0x9140('0x9c')](_0x9140('0x7e'),_0x44093a[_0x9140('0x7f')]());return dbH[_0x9140('0x80')][_0x9140('0x36')](_0x44093a['toString'](),{'type':dbH[_0x9140('0x80')]['QueryTypes'][_0x9140('0x82')]});}})['then'](function(){return{'sql':_0x300933[_0x9140('0x7f')]()};})[_0x9140('0x25')](respondWithResult(_0x97f6c4,null))['catch'](handleError(_0x97f6c4,null));};
\ No newline at end of file
+var _0x4d96=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','CustomReports','error','stack','name','send','AnalyticCustomReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','replace','format','groupBy','group','orderBy','field','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','IS\x20EMPTY','metric','function','DESC','alias','web','fullPath','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','savename','countTable','SELECT','runReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end'];(function(_0x3a2014,_0x20cd5d){var _0x1095ca=function(_0x4fff29){while(--_0x4fff29){_0x3a2014['push'](_0x3a2014['shift']());}};_0x1095ca(++_0x20cd5d);}(_0x4d96,0x89));var _0x64d9=function(_0x17f29d,_0x131c17){_0x17f29d=_0x17f29d-0x0;var _0x679af4=_0x4d96[_0x17f29d];return _0x679af4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64d9('0x0'));var zipdir=require(_0x64d9('0x1'));var jsonpatch=require(_0x64d9('0x2'));var rp=require(_0x64d9('0x3'));var moment=require(_0x64d9('0x4'));var BPromise=require(_0x64d9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x64d9('0x6'));var sox=require(_0x64d9('0x7'));var csv=require(_0x64d9('0x8'));var ejs=require(_0x64d9('0x9'));var fs=require('fs');var fs_extra=require(_0x64d9('0xa'));var _=require(_0x64d9('0xb'));var squel=require('squel');var crypto=require(_0x64d9('0xc'));var jsforce=require(_0x64d9('0xd'));var deskjs=require(_0x64d9('0xe'));var toCsv=require(_0x64d9('0x8'));var querystring=require('querystring');var Papa=require(_0x64d9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64d9('0x10'));var hardwareService=require(_0x64d9('0x11'));var logger=require(_0x64d9('0x12'))(_0x64d9('0x13'));var utils=require(_0x64d9('0x14'));var config=require(_0x64d9('0x15'));var licenseUtil=require(_0x64d9('0x16'));var db=require(_0x64d9('0x17'))['db'];var dbH=require(_0x64d9('0x17'))[_0x64d9('0x18')];function respondWithStatusCode(_0x432b1e,_0x2a00c9){_0x2a00c9=_0x2a00c9||0xcc;return function(_0x14c9f0){if(_0x14c9f0){return _0x432b1e[_0x64d9('0x19')](_0x2a00c9);}return _0x432b1e[_0x64d9('0x1a')](_0x2a00c9)[_0x64d9('0x1b')]();};}function respondWithResult(_0x4600ae,_0x433352){_0x433352=_0x433352||0xc8;return function(_0x4614f9){if(_0x4614f9){return _0x4600ae[_0x64d9('0x1a')](_0x433352)[_0x64d9('0x1c')](_0x4614f9);}};}function respondWithFilteredResult(_0x4302af,_0x239a15){return function(_0x5fc4e9){if(_0x5fc4e9){var _0x5cc1c5=typeof _0x239a15[_0x64d9('0x1d')]==='undefined'&&typeof _0x239a15[_0x64d9('0x1e')]===_0x64d9('0x1f');var _0x506bc8=_0x5fc4e9[_0x64d9('0x20')];var _0x322b14=_0x5cc1c5?0x0:_0x239a15[_0x64d9('0x1d')];var _0x197dda=_0x5cc1c5?_0x5fc4e9[_0x64d9('0x20')]:_0x239a15[_0x64d9('0x1d')]+_0x239a15[_0x64d9('0x1e')];var _0x564b23;if(_0x197dda>=_0x506bc8){_0x197dda=_0x506bc8;_0x564b23=0xc8;}else{_0x564b23=0xce;}_0x4302af[_0x64d9('0x1a')](_0x564b23);return _0x4302af[_0x64d9('0x21')](_0x64d9('0x22'),_0x322b14+'-'+_0x197dda+'/'+_0x506bc8)[_0x64d9('0x1c')](_0x5fc4e9);}return null;};}function patchUpdates(_0x2a3767){return function(_0x5750ae){try{jsonpatch[_0x64d9('0x23')](_0x5750ae,_0x2a3767,!![]);}catch(_0x77078f){return BPromise[_0x64d9('0x24')](_0x77078f);}return _0x5750ae[_0x64d9('0x25')]();};}function saveUpdates(_0x19911e,_0x483503){return function(_0x37366b){if(_0x37366b){return _0x37366b['update'](_0x19911e)[_0x64d9('0x26')](function(_0x867d74){return _0x867d74;});}return null;};}function removeEntity(_0x562633,_0x1f1e6c){return function(_0x45362d){if(_0x45362d){return _0x45362d[_0x64d9('0x27')]()['then'](function(){var _0x23d665=_0x45362d['get']({'plain':!![]});var _0x501689=_0x64d9('0x28');return db['UserProfileResource'][_0x64d9('0x27')]({'where':{'type':_0x501689,'resourceId':_0x23d665['id']}})[_0x64d9('0x26')](function(){return _0x45362d;});})[_0x64d9('0x26')](function(){_0x562633[_0x64d9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x437cd6,_0x326a2f){return function(_0x285613){if(!_0x285613){_0x437cd6[_0x64d9('0x19')](0x194);}return _0x285613;};}function handleError(_0x13c711,_0x6b04c0){_0x6b04c0=_0x6b04c0||0x1f4;return function(_0x111fd6){logger[_0x64d9('0x29')](_0x111fd6[_0x64d9('0x2a')]);if(_0x111fd6['name']){delete _0x111fd6[_0x64d9('0x2b')];}_0x13c711['status'](_0x6b04c0)[_0x64d9('0x2c')](_0x111fd6);};}exports['index']=function(_0x41f119,_0x1ab302){var _0xbbe1d3={},_0x4a919b={},_0x3c9514={'count':0x0,'rows':[]};var _0xe4d924=_['map'](db[_0x64d9('0x2d')]['rawAttributes'],function(_0x44328a){return{'name':_0x44328a[_0x64d9('0x2e')],'type':_0x44328a[_0x64d9('0x2f')][_0x64d9('0x30')]};});_0x4a919b[_0x64d9('0x31')]=_[_0x64d9('0x32')](_0xe4d924,_0x64d9('0x2b'));_0x4a919b[_0x64d9('0x33')]=_[_0x64d9('0x34')](_0x41f119[_0x64d9('0x33')]);_0x4a919b[_0x64d9('0x35')]=_[_0x64d9('0x36')](_0x4a919b[_0x64d9('0x31')],_0x4a919b['query']);_0xbbe1d3[_0x64d9('0x37')]=_[_0x64d9('0x36')](_0x4a919b[_0x64d9('0x31')],qs['fields'](_0x41f119['query'][_0x64d9('0x38')]));_0xbbe1d3[_0x64d9('0x37')]=_0xbbe1d3[_0x64d9('0x37')][_0x64d9('0x39')]?_0xbbe1d3[_0x64d9('0x37')]:_0x4a919b[_0x64d9('0x31')];if(!_0x41f119['query'][_0x64d9('0x3a')](_0x64d9('0x3b'))){_0xbbe1d3[_0x64d9('0x1e')]=qs[_0x64d9('0x1e')](_0x41f119['query'][_0x64d9('0x1e')]);_0xbbe1d3['offset']=qs[_0x64d9('0x1d')](_0x41f119['query'][_0x64d9('0x1d')]);}_0xbbe1d3[_0x64d9('0x3c')]=qs['sort'](_0x41f119[_0x64d9('0x33')][_0x64d9('0x3d')]);_0xbbe1d3['where']=qs[_0x64d9('0x35')](_['pick'](_0x41f119[_0x64d9('0x33')],_0x4a919b[_0x64d9('0x35')]),_0xe4d924);if(_0x41f119[_0x64d9('0x33')][_0x64d9('0x3e')]){_0xbbe1d3[_0x64d9('0x3f')]=_[_0x64d9('0x40')](_0xbbe1d3[_0x64d9('0x3f')],{'$or':_[_0x64d9('0x32')](_0xe4d924,function(_0x5d6bfa){if(_0x5d6bfa['type']!==_0x64d9('0x41')){var _0x421de5={};_0x421de5[_0x5d6bfa['name']]={'$like':'%'+_0x41f119[_0x64d9('0x33')][_0x64d9('0x3e')]+'%'};return _0x421de5;}})});}_0xbbe1d3=_[_0x64d9('0x40')]({},_0xbbe1d3,_0x41f119[_0x64d9('0x42')]);var _0x29336e={'where':_0xbbe1d3['where']};return db[_0x64d9('0x2d')][_0x64d9('0x20')](_0x29336e)['then'](function(_0x1cb935){_0x3c9514['count']=_0x1cb935;if(_0x41f119[_0x64d9('0x33')][_0x64d9('0x43')]){_0xbbe1d3[_0x64d9('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x64d9('0x45')](_0xbbe1d3);})[_0x64d9('0x26')](function(_0x1968fa){_0x3c9514[_0x64d9('0x46')]=_0x1968fa;return _0x3c9514;})[_0x64d9('0x26')](respondWithFilteredResult(_0x1ab302,_0xbbe1d3))[_0x64d9('0x47')](handleError(_0x1ab302,null));};exports[_0x64d9('0x48')]=function(_0x57209b,_0x451438){var _0x58f013={'raw':![],'where':{'id':_0x57209b[_0x64d9('0x49')]['id']}},_0x48ba67={};_0x48ba67[_0x64d9('0x31')]=_[_0x64d9('0x34')](db['AnalyticCustomReport'][_0x64d9('0x4a')]);_0x48ba67[_0x64d9('0x33')]=_['keys'](_0x57209b[_0x64d9('0x33')]);_0x48ba67[_0x64d9('0x35')]=_['intersection'](_0x48ba67[_0x64d9('0x31')],_0x48ba67[_0x64d9('0x33')]);_0x58f013['attributes']=_[_0x64d9('0x36')](_0x48ba67[_0x64d9('0x31')],qs['fields'](_0x57209b[_0x64d9('0x33')][_0x64d9('0x38')]));_0x58f013[_0x64d9('0x37')]=_0x58f013[_0x64d9('0x37')]['length']?_0x58f013['attributes']:_0x48ba67['model'];if(_0x57209b['query'][_0x64d9('0x43')]){_0x58f013[_0x64d9('0x44')]=[{'all':!![]}];}_0x58f013=_[_0x64d9('0x40')]({},_0x58f013,_0x57209b[_0x64d9('0x42')]);return db[_0x64d9('0x2d')][_0x64d9('0x4b')](_0x58f013)['then'](handleEntityNotFound(_0x451438,null))[_0x64d9('0x26')](respondWithResult(_0x451438,null))['catch'](handleError(_0x451438,null));};exports[_0x64d9('0x4c')]=function(_0x18cc6a,_0x2024db){return db[_0x64d9('0x2d')][_0x64d9('0x4c')](_0x18cc6a[_0x64d9('0x4d')],{})[_0x64d9('0x26')](function(_0x1bbf8e){var _0x4c5980=_0x18cc6a[_0x64d9('0x4e')][_0x64d9('0x4f')]({'plain':!![]});if(!_0x4c5980)throw new Error(_0x64d9('0x50'));if(_0x4c5980['role']===_0x64d9('0x4e')){var _0x519859=_0x1bbf8e[_0x64d9('0x4f')]({'plain':!![]});var _0x15233b=_0x64d9('0x51');return db[_0x64d9('0x52')][_0x64d9('0x4b')]({'where':{'name':_0x15233b,'userProfileId':_0x4c5980[_0x64d9('0x53')]},'raw':!![]})[_0x64d9('0x26')](function(_0x312129){if(_0x312129&&_0x312129['autoAssociation']===0x0){return db['UserProfileResource'][_0x64d9('0x4c')]({'name':_0x519859['name'],'resourceId':_0x519859['id'],'type':_0x64d9('0x28'),'sectionId':_0x312129['id']},{})[_0x64d9('0x26')](function(){return _0x1bbf8e;});}else{return _0x1bbf8e;}})['catch'](function(_0xa1c035){logger['error'](_0x64d9('0x54'),_0xa1c035);throw _0xa1c035;});}return _0x1bbf8e;})[_0x64d9('0x26')](respondWithResult(_0x2024db,0xc9))['catch'](handleError(_0x2024db,null));};exports[_0x64d9('0x55')]=function(_0xbcf7ad,_0x4b4324){if(_0xbcf7ad[_0x64d9('0x4d')]['id']){delete _0xbcf7ad[_0x64d9('0x4d')]['id'];}return db[_0x64d9('0x2d')][_0x64d9('0x4b')]({'where':{'id':_0xbcf7ad[_0x64d9('0x49')]['id']}})[_0x64d9('0x26')](handleEntityNotFound(_0x4b4324,null))[_0x64d9('0x26')](saveUpdates(_0xbcf7ad[_0x64d9('0x4d')],null))[_0x64d9('0x26')](respondWithResult(_0x4b4324,null))[_0x64d9('0x47')](handleError(_0x4b4324,null));};exports[_0x64d9('0x27')]=function(_0x19fd6b,_0x34dc53){return db['AnalyticCustomReport'][_0x64d9('0x4b')]({'where':{'id':_0x19fd6b[_0x64d9('0x49')]['id']}})[_0x64d9('0x26')](handleEntityNotFound(_0x34dc53,null))[_0x64d9('0x26')](removeEntity(_0x34dc53,null))[_0x64d9('0x47')](handleError(_0x34dc53,null));};exports['preview']=function(_0x268fbc,_0x56dc4d){var _0x27e1e5=0xa;var _0x4dcc44=['join',_0x64d9('0x56'),_0x64d9('0x57'),_0x64d9('0x58')];var _0x4db90e={'SUM':_0x64d9('0x59'),'COUNT':_0x64d9('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x64d9('0x5b'),'AVG':_0x64d9('0x5c'),'GROUP_CONCAT':_0x64d9('0x5d'),'GROUP_CONCAT ASC':_0x64d9('0x5e'),'GROUP_CONCAT DESC':_0x64d9('0x5f')};var _0x1806a0={'SEC_TO_TIME':_0x64d9('0x60'),'DATE':_0x64d9('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x64d9('0x62'),'UNIX_TIMESTAMP':_0x64d9('0x63')};var _0x51bf9d=function(_0x488def){return!_[_0x64d9('0x64')]([_0x64d9('0x65'),_0x64d9('0x66'),'IS\x20EMPTY',_0x64d9('0x67')],_0x488def);};var _0x5043c7=function(_0x130a19){if(!_0x130a19||!_0x130a19['rules'][_0x64d9('0x39')]){return'';}for(var _0x48ee02='(',_0xadfc8=0x0;_0xadfc8<_0x130a19[_0x64d9('0x68')][_0x64d9('0x39')];_0xadfc8+=0x1){_0xadfc8>0x0&&(_0x48ee02+='\x20'+_0x130a19[_0x64d9('0x69')]+'\x20');_0x48ee02+=_0x130a19[_0x64d9('0x68')][_0xadfc8]['group']?_0x5043c7(_0x130a19[_0x64d9('0x68')][_0xadfc8]['group']):_0x130a19['rules'][_0xadfc8]['field']+'\x20'+_0x130a19[_0x64d9('0x68')][_0xadfc8][_0x64d9('0x6a')]+(_0x51bf9d(_0x130a19[_0x64d9('0x68')][_0xadfc8]['condition'])?'\x20'+_0x130a19[_0x64d9('0x68')][_0xadfc8][_0x64d9('0x6b')]:'');}return _0x48ee02+')';};var _0x191bf3={'where':{'id':_0x268fbc[_0x64d9('0x49')]['id']}},_0x133a87,_0x47ba40,_0x42b39f,_0x50ca2f,_0x49612e;_0x191bf3=_['merge']({},_0x191bf3,_0x268fbc[_0x64d9('0x42')]);return db['AnalyticCustomReport'][_0x64d9('0x4b')](_0x191bf3)[_0x64d9('0x26')](function(_0x52696a){if(_0x52696a){_0x133a87=_0x52696a;return _0x52696a[_0x64d9('0x6c')]();}return null;})[_0x64d9('0x26')](function(_0x567565){if(_0x567565){if(!_0x567565[_0x64d9('0x39')]){throw new db[(_0x64d9('0x6d'))][(_0x64d9('0x6e'))](_0x64d9('0x6f'),0x193);}_0x47ba40=_0x567565;return db[_0x64d9('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x3725c9){if(_0x3725c9){_0x42b39f=_[_0x64d9('0x71')](_0x3725c9,'id');var _0x5e02b4;var _0xa1fbca=squel[_0x64d9('0x72')]();_0xa1fbca[_0x64d9('0x73')](_0x133a87['table']);for(var _0xb58347=0x0;_0xb58347<_0x47ba40['length'];_0xb58347+=0x1){_0x5e02b4=_0x47ba40[_0xb58347][_0x64d9('0x74')]?_0x42b39f[_0x47ba40[_0xb58347][_0x64d9('0x74')]]['metric']:_0x47ba40[_0xb58347]['field'];_0x5e02b4=_0x47ba40[_0xb58347]['function']?_[_0x64d9('0x75')](_0x4db90e[_0x47ba40[_0xb58347]['function']],'%s',_0x5e02b4):_0x5e02b4;_0x5e02b4=_0x47ba40[_0xb58347][_0x64d9('0x76')]?_[_0x64d9('0x75')](_0x1806a0[_0x47ba40[_0xb58347][_0x64d9('0x76')]],'%s',_0x5e02b4):_0x5e02b4;if(_0x47ba40[_0xb58347][_0x64d9('0x77')]){_0xa1fbca[_0x64d9('0x78')](_0x5e02b4);}_0x47ba40[_0xb58347]['orderBy']&&_0xa1fbca['order'](_0x5e02b4,_0x47ba40[_0xb58347][_0x64d9('0x79')]==='DESC'?![]:!![]);_0xa1fbca[_0x64d9('0x7a')](_0x5e02b4,_0x47ba40[_0xb58347]['alias']||_0x5e02b4);}if(_0x133a87[_0x64d9('0x7b')]){_0x133a87['joins']=JSON[_0x64d9('0x7c')](_0x133a87[_0x64d9('0x7b')]);for(var _0x4b53e4=0x0;_0x4b53e4<_0x133a87['joins'][_0x64d9('0x39')];_0x4b53e4+=0x1){if(_0x133a87[_0x64d9('0x7b')][_0x4b53e4][_0x64d9('0x2f')]&&_['includes'](_0x4dcc44,_0x133a87['joins'][_0x4b53e4][_0x64d9('0x2f')])&&_0x133a87[_0x64d9('0x7b')][_0x4b53e4][_0x64d9('0x7d')]&&_0x133a87[_0x64d9('0x7b')][_0x4b53e4]['foreignTable']&&_0x133a87['joins'][_0x4b53e4][_0x64d9('0x7e')]){_0xa1fbca[_0x133a87[_0x64d9('0x7b')][_0x4b53e4][_0x64d9('0x2f')]](_0x133a87['joins'][_0x4b53e4][_0x64d9('0x7f')],null,util['format'](_0x64d9('0x80'),_0x133a87[_0x64d9('0x81')],_0x133a87[_0x64d9('0x7b')][_0x4b53e4]['parentKey'],_0x133a87[_0x64d9('0x7b')][_0x4b53e4][_0x64d9('0x7f')],_0x133a87[_0x64d9('0x7b')][_0x4b53e4][_0x64d9('0x7e')]));}}}if(_0x133a87[_0x64d9('0x82')]){_0x133a87[_0x64d9('0x82')]=JSON[_0x64d9('0x7c')](_0x133a87['conditions']);_0xa1fbca[_0x64d9('0x3f')](_0x5043c7(_0x133a87[_0x64d9('0x82')][_0x64d9('0x78')]));}_0x49612e=_0xa1fbca[_0x64d9('0x83')]();_0xa1fbca[_0x64d9('0x1e')](_0x27e1e5);_0xa1fbca[_0x64d9('0x1d')](0x0);logger[_0x64d9('0x84')](_0x64d9('0x85'),_0xa1fbca[_0x64d9('0x86')]());return dbH[_0x64d9('0x87')][_0x64d9('0x33')](_0xa1fbca[_0x64d9('0x86')](),{'type':dbH['sequelize'][_0x64d9('0x88')]['SELECT']});}})['then'](respondWithResult(_0x56dc4d,null))[_0x64d9('0x47')](handleError(_0x56dc4d,null));};function runReport(_0x1c7901,_0x2286e8,_0x46fc80){var _0x651f98=_0x2286e8[_0x64d9('0x2b')];var _0x31cf90=0xa;var _0xf32067=[_0x64d9('0x89'),_0x64d9('0x56'),_0x64d9('0x57'),_0x64d9('0x58')];var _0x3dffb3={'SUM':'SUM(%s)','COUNT':_0x64d9('0x5a'),'COUNT DISTINCT':_0x64d9('0x8a'),'MAX':_0x64d9('0x8b'),'MIN':_0x64d9('0x5b'),'AVG':_0x64d9('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x64d9('0x5e'),'GROUP_CONCAT DESC':_0x64d9('0x5f')};var _0x287ae1={'SEC_TO_TIME':_0x64d9('0x60'),'DATE':_0x64d9('0x61'),'HOUR':_0x64d9('0x8c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x64d9('0x63')};var _0x3decb1=function(_0x50c198){return!_[_0x64d9('0x64')]([_0x64d9('0x65'),_0x64d9('0x66'),_0x64d9('0x8d'),_0x64d9('0x67')],_0x50c198);};var _0x270976=function(_0x32e7c9){if(!_0x32e7c9||!_0x32e7c9[_0x64d9('0x68')]['length']){return'';}for(var _0x28e8d5='(',_0x42e756=0x0;_0x42e756<_0x32e7c9[_0x64d9('0x68')]['length'];_0x42e756+=0x1){_0x42e756>0x0&&(_0x28e8d5+='\x20'+_0x32e7c9[_0x64d9('0x69')]+'\x20');_0x28e8d5+=_0x32e7c9[_0x64d9('0x68')][_0x42e756][_0x64d9('0x78')]?_0x270976(_0x32e7c9['rules'][_0x42e756][_0x64d9('0x78')]):_0x32e7c9['rules'][_0x42e756][_0x64d9('0x7a')]+'\x20'+_0x32e7c9[_0x64d9('0x68')][_0x42e756][_0x64d9('0x6a')]+(_0x3decb1(_0x32e7c9[_0x64d9('0x68')][_0x42e756][_0x64d9('0x6a')])?'\x20'+_0x32e7c9[_0x64d9('0x68')][_0x42e756][_0x64d9('0x6b')]:'');}return _0x28e8d5+')';};var _0x682ff6={'where':{'id':_0x1c7901['id']}},_0x372958,_0x3afff4,_0x47116c,_0x2e5ce3,_0x43162e;_0x682ff6=_['merge']({},_0x682ff6,_0x46fc80);return db[_0x64d9('0x2d')][_0x64d9('0x4b')](_0x682ff6)['then'](function(_0xf41af8){if(_0xf41af8){_0x372958=_0xf41af8;return _0xf41af8[_0x64d9('0x6c')]();}return null;})[_0x64d9('0x26')](function(_0x35d124){if(_0x35d124){if(!_0x35d124[_0x64d9('0x39')]){throw new db[(_0x64d9('0x6d'))][(_0x64d9('0x6e'))](_0x64d9('0x6f'),0x193);}_0x3afff4=_0x35d124;return db[_0x64d9('0x70')][_0x64d9('0x45')]({'raw':!![]});}return null;})[_0x64d9('0x26')](function(_0x5bc97d){if(_0x5bc97d){_0x47116c=_['keyBy'](_0x5bc97d,'id');var _0x1a0d48;var _0x4c242c=squel['select']();_0x4c242c[_0x64d9('0x73')](_0x372958[_0x64d9('0x81')]);for(var _0x427e95=0x0;_0x427e95<_0x3afff4[_0x64d9('0x39')];_0x427e95+=0x1){_0x1a0d48=_0x3afff4[_0x427e95]['MetricId']?_0x47116c[_0x3afff4[_0x427e95]['MetricId']][_0x64d9('0x8e')]:_0x3afff4[_0x427e95][_0x64d9('0x7a')];_0x1a0d48=_0x3afff4[_0x427e95][_0x64d9('0x8f')]?_[_0x64d9('0x75')](_0x3dffb3[_0x3afff4[_0x427e95][_0x64d9('0x8f')]],'%s',_0x1a0d48):_0x1a0d48;_0x1a0d48=_0x3afff4[_0x427e95][_0x64d9('0x76')]?_['replace'](_0x287ae1[_0x3afff4[_0x427e95]['format']],'%s',_0x1a0d48):_0x1a0d48;if(_0x3afff4[_0x427e95][_0x64d9('0x77')]){_0x4c242c['group'](_0x1a0d48);}_0x3afff4[_0x427e95][_0x64d9('0x79')]&&_0x4c242c[_0x64d9('0x3c')](_0x1a0d48,_0x3afff4[_0x427e95][_0x64d9('0x79')]===_0x64d9('0x90')?![]:!![]);_0x4c242c[_0x64d9('0x7a')](_0x1a0d48,_0x3afff4[_0x427e95][_0x64d9('0x91')]||_0x1a0d48);}if(_0x372958[_0x64d9('0x7b')]){_0x372958[_0x64d9('0x7b')]=JSON[_0x64d9('0x7c')](_0x372958[_0x64d9('0x7b')]);for(var _0xb02c61=0x0;_0xb02c61<_0x372958[_0x64d9('0x7b')]['length'];_0xb02c61+=0x1){if(_0x372958[_0x64d9('0x7b')][_0xb02c61]['type']&&_[_0x64d9('0x64')](_0xf32067,_0x372958[_0x64d9('0x7b')][_0xb02c61][_0x64d9('0x2f')])&&_0x372958['joins'][_0xb02c61][_0x64d9('0x7d')]&&_0x372958[_0x64d9('0x7b')][_0xb02c61][_0x64d9('0x7f')]&&_0x372958[_0x64d9('0x7b')][_0xb02c61][_0x64d9('0x7e')]){_0x4c242c[_0x372958[_0x64d9('0x7b')][_0xb02c61]['type']](_0x372958['joins'][_0xb02c61]['foreignTable'],null,util[_0x64d9('0x76')](_0x64d9('0x80'),_0x372958['table'],_0x372958[_0x64d9('0x7b')][_0xb02c61][_0x64d9('0x7d')],_0x372958['joins'][_0xb02c61][_0x64d9('0x7f')],_0x372958[_0x64d9('0x7b')][_0xb02c61][_0x64d9('0x7e')]));}}}if(_0x372958[_0x64d9('0x82')]){_0x372958[_0x64d9('0x82')]=JSON[_0x64d9('0x7c')](_0x372958[_0x64d9('0x82')]);_0x4c242c[_0x64d9('0x3f')](_0x270976(_0x372958[_0x64d9('0x82')][_0x64d9('0x78')]));}_0x43162e=_0x4c242c[_0x64d9('0x83')]();_0x4c242c['limit'](_0x31cf90);_0x4c242c[_0x64d9('0x1d')](0x0);return;}})['then'](function(){if(_0x2286e8['output']===_0x64d9('0x92')){return null;}var _0x28d213=_['merge'](_0x2286e8,{'name':_0x2286e8[_0x64d9('0x93')]||_0x2286e8[_0x64d9('0x2b')]||_0x372958[_0x64d9('0x2b')],'basename':_0x651f98,'savename':util[_0x64d9('0x76')]('%s-%s.%s',_0x2286e8['name']||_0x372958['name'],require(_0x64d9('0x94'))[_0x64d9('0x95')](0x4),_0x2286e8[_0x64d9('0x96')]||'csv'),'reportId':_0x372958['id'],'reportType':_0x64d9('0x97')});return db[_0x64d9('0x98')][_0x64d9('0x4c')](_0x28d213,{'raw':!![]});})[_0x64d9('0x26')](function(_0x253c15){if(_0x372958['table']===_0x64d9('0x99')){_0x43162e[_0x64d9('0x3f')](_0x372958['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2286e8[_0x64d9('0x9a')],_0x2286e8[_0x64d9('0x9b')]);}else{_0x43162e[_0x64d9('0x3f')](_0x372958[_0x64d9('0x81')]+_0x64d9('0x9c'),_0x2286e8[_0x64d9('0x9a')],_0x2286e8[_0x64d9('0x9b')]);}if(_0x253c15){logger[_0x64d9('0x9d')]('Run\x20Query:',_0x43162e[_0x64d9('0x86')]());require(_0x64d9('0x9e'))[_0x64d9('0x9f')](path[_0x64d9('0x89')](__dirname,_0x64d9('0xa0'),_0x253c15[_0x64d9('0x96')]),[_0x253c15['id'],_0x43162e[_0x64d9('0x86')](),path[_0x64d9('0x89')](__dirname,'../../files/reports',_0x253c15[_0x64d9('0xa1')]),_0x651f98]);return _0x253c15;}else{var _0x49521b=squel[_0x64d9('0x72')]();_0x49521b[_0x64d9('0x73')]('('+_0x43162e[_0x64d9('0x86')]()+')',_0x64d9('0xa2'));_0x49521b['field']('COUNT(*)','count');_0x43162e['limit'](_0x2286e8['limit']||_0x31cf90);_0x43162e[_0x64d9('0x1d')](_0x2286e8[_0x64d9('0x1d')]||0x0);return dbH[_0x64d9('0x87')][_0x64d9('0x33')](_0x49521b['toString'](),{'type':dbH[_0x64d9('0x87')][_0x64d9('0x88')][_0x64d9('0xa3')]})['then'](function(_0x297a58){if(!_0x297a58[_0x64d9('0x39')]){_0x2e5ce3=0x0;}else{_0x2e5ce3=_0x297a58[0x0][_0x64d9('0x20')]||0x0;}return dbH[_0x64d9('0x87')][_0x64d9('0x33')](_0x43162e[_0x64d9('0x86')](),{'type':dbH[_0x64d9('0x87')]['QueryTypes'][_0x64d9('0xa3')]});})[_0x64d9('0x26')](function(_0x3b987a){return{'rows':_0x3b987a||[],'count':_0x2e5ce3};});}});}exports['run']=function(_0x4d0c74,_0x14a56a){return runReport(_0x4d0c74[_0x64d9('0x49')],_0x4d0c74[_0x64d9('0x33')],_0x4d0c74[_0x64d9('0x42')])[_0x64d9('0x26')](respondWithResult(_0x14a56a,null))[_0x64d9('0x47')](handleError(_0x14a56a,null));};exports[_0x64d9('0xa4')]=runReport;exports['query']=function(_0x1ccd74,_0x112df7){var _0x16646f=0xa;var _0x57d884=[_0x64d9('0x89'),_0x64d9('0x56'),_0x64d9('0x57'),_0x64d9('0x58')];var _0x3c20a0={'SUM':_0x64d9('0x59'),'COUNT':_0x64d9('0x5a'),'COUNT DISTINCT':_0x64d9('0x8a'),'MAX':_0x64d9('0x8b'),'MIN':_0x64d9('0x5b'),'AVG':_0x64d9('0x5c'),'GROUP_CONCAT':_0x64d9('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x64d9('0x5f')};var _0x53dba6={'SEC_TO_TIME':_0x64d9('0x60'),'DATE':_0x64d9('0x61'),'HOUR':_0x64d9('0x8c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x64d9('0x63')};var _0x2022b0=function(_0x563116){return!_[_0x64d9('0x64')](['IS\x20NULL',_0x64d9('0x66'),_0x64d9('0x8d'),_0x64d9('0x67')],_0x563116);};var _0x4a2a38=function(_0x7333bf){if(!_0x7333bf||!_0x7333bf['rules'][_0x64d9('0x39')]){return'';}for(var _0x1001f2='(',_0x3c6179=0x0;_0x3c6179<_0x7333bf[_0x64d9('0x68')]['length'];_0x3c6179+=0x1){_0x3c6179>0x0&&(_0x1001f2+='\x20'+_0x7333bf[_0x64d9('0x69')]+'\x20');_0x1001f2+=_0x7333bf[_0x64d9('0x68')][_0x3c6179][_0x64d9('0x78')]?_0x4a2a38(_0x7333bf[_0x64d9('0x68')][_0x3c6179][_0x64d9('0x78')]):_0x7333bf[_0x64d9('0x68')][_0x3c6179][_0x64d9('0x7a')]+'\x20'+_0x7333bf[_0x64d9('0x68')][_0x3c6179][_0x64d9('0x6a')]+(_0x2022b0(_0x7333bf[_0x64d9('0x68')][_0x3c6179][_0x64d9('0x6a')])?'\x20'+_0x7333bf['rules'][_0x3c6179][_0x64d9('0x6b')]:'');}return _0x1001f2+')';};var _0x22c151={'where':{'id':_0x1ccd74['params']['id']}},_0x906989,_0x43d459,_0x94fa1f,_0x3817e8,_0x33977a;_0x22c151=_[_0x64d9('0x40')]({},_0x22c151,_0x1ccd74[_0x64d9('0x42')]);return db[_0x64d9('0x2d')][_0x64d9('0x4b')](_0x22c151)[_0x64d9('0x26')](function(_0x165c9e){if(_0x165c9e){_0x906989=_0x165c9e;return _0x165c9e['getFields']();}return null;})[_0x64d9('0x26')](function(_0x1846ff){if(_0x1846ff){if(!_0x1846ff[_0x64d9('0x39')]){throw new db['Sequelize'][(_0x64d9('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x43d459=_0x1846ff;return db[_0x64d9('0x70')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x20b149){if(_0x20b149){_0x94fa1f=_[_0x64d9('0x71')](_0x20b149,'id');var _0x1b2c72;var _0x1283dc=squel[_0x64d9('0x72')]();_0x1283dc[_0x64d9('0x73')](_0x906989[_0x64d9('0x81')]);for(var _0x2e78c8=0x0;_0x2e78c8<_0x43d459['length'];_0x2e78c8+=0x1){_0x1b2c72=_0x43d459[_0x2e78c8][_0x64d9('0x74')]?_0x94fa1f[_0x43d459[_0x2e78c8][_0x64d9('0x74')]][_0x64d9('0x8e')]:_0x43d459[_0x2e78c8][_0x64d9('0x7a')];_0x1b2c72=_0x43d459[_0x2e78c8][_0x64d9('0x8f')]?_['replace'](_0x3c20a0[_0x43d459[_0x2e78c8][_0x64d9('0x8f')]],'%s',_0x1b2c72):_0x1b2c72;_0x1b2c72=_0x43d459[_0x2e78c8][_0x64d9('0x76')]?_[_0x64d9('0x75')](_0x53dba6[_0x43d459[_0x2e78c8]['format']],'%s',_0x1b2c72):_0x1b2c72;if(_0x43d459[_0x2e78c8][_0x64d9('0x77')]){_0x1283dc[_0x64d9('0x78')](_0x1b2c72);}_0x43d459[_0x2e78c8][_0x64d9('0x79')]&&_0x1283dc[_0x64d9('0x3c')](_0x1b2c72,_0x43d459[_0x2e78c8][_0x64d9('0x79')]===_0x64d9('0x90')?![]:!![]);_0x1283dc[_0x64d9('0x7a')](_0x1b2c72,_0x43d459[_0x2e78c8]['alias']||_0x1b2c72);}if(_0x906989[_0x64d9('0x7b')]){_0x906989['joins']=JSON[_0x64d9('0x7c')](_0x906989['joins']);for(var _0x507b93=0x0;_0x507b93<_0x906989[_0x64d9('0x7b')][_0x64d9('0x39')];_0x507b93+=0x1){if(_0x906989[_0x64d9('0x7b')][_0x507b93][_0x64d9('0x2f')]&&_['includes'](_0x57d884,_0x906989[_0x64d9('0x7b')][_0x507b93][_0x64d9('0x2f')])&&_0x906989['joins'][_0x507b93][_0x64d9('0x7d')]&&_0x906989[_0x64d9('0x7b')][_0x507b93]['foreignTable']&&_0x906989['joins'][_0x507b93][_0x64d9('0x7e')]){_0x1283dc[_0x906989[_0x64d9('0x7b')][_0x507b93]['type']](_0x906989[_0x64d9('0x7b')][_0x507b93][_0x64d9('0x7f')],null,util[_0x64d9('0x76')](_0x64d9('0x80'),_0x906989[_0x64d9('0x81')],_0x906989[_0x64d9('0x7b')][_0x507b93][_0x64d9('0x7d')],_0x906989[_0x64d9('0x7b')][_0x507b93][_0x64d9('0x7f')],_0x906989[_0x64d9('0x7b')][_0x507b93][_0x64d9('0x7e')]));}}}if(_0x906989['conditions']){_0x906989['conditions']=JSON[_0x64d9('0x7c')](_0x906989[_0x64d9('0x82')]);_0x1283dc[_0x64d9('0x3f')](_0x4a2a38(_0x906989[_0x64d9('0x82')][_0x64d9('0x78')]));}_0x33977a=_0x1283dc[_0x64d9('0x83')]();_0x1283dc[_0x64d9('0x1e')](_0x16646f);_0x1283dc[_0x64d9('0x1d')](0x0);logger[_0x64d9('0x84')](_0x64d9('0x85'),_0x1283dc[_0x64d9('0x86')]());return dbH[_0x64d9('0x87')][_0x64d9('0x33')](_0x1283dc[_0x64d9('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x64d9('0xa3')]});}})[_0x64d9('0x26')](function(){return{'sql':_0x33977a[_0x64d9('0x86')]()};})[_0x64d9('0x26')](respondWithResult(_0x112df7,null))['catch'](handleError(_0x112df7,null));};
\ No newline at end of file
index 2bbba66..3bab273 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b6b=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','analytics_custom_reports'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x8b6b,0x15e));var _0xb8b6=function(_0x2afb28,_0x19e8b0){_0x2afb28=_0x2afb28-0x0;var _0x41d764=_0x8b6b[_0x2afb28];return _0x41d764;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb8b6('0x0'))('api');var moment=require(_0xb8b6('0x1'));var BPromise=require(_0xb8b6('0x2'));var rp=require(_0xb8b6('0x3'));var fs=require('fs');var path=require(_0xb8b6('0x4'));var rimraf=require(_0xb8b6('0x5'));var config=require(_0xb8b6('0x6'));var attributes=require(_0xb8b6('0x7'));module[_0xb8b6('0x8')]=function(_0x452ddb,_0xd0564){return _0x452ddb['define']('AnalyticCustomReport',attributes,{'tableName':_0xb8b6('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x65a4=['moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger'];(function(_0x17b139,_0x44ca66){var _0x19a5a4=function(_0x1019c4){while(--_0x1019c4){_0x17b139['push'](_0x17b139['shift']());}};_0x19a5a4(++_0x44ca66);}(_0x65a4,0x1ae));var _0x465a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x65a4[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x465a('0x0'));var logger=require(_0x465a('0x1'))('api');var moment=require(_0x465a('0x2'));var BPromise=require(_0x465a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x465a('0x4'));var rimraf=require(_0x465a('0x5'));var config=require(_0x465a('0x6'));var attributes=require(_0x465a('0x7'));module[_0x465a('0x8')]=function(_0x1208bc,_0x3198fd){return _0x1208bc[_0x465a('0x9')](_0x465a('0xa'),attributes,{'tableName':_0x465a('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 820dbf6..8f06d74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb701=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x192099,_0x38a593){var _0x3d6ccc=function(_0x541fff){while(--_0x541fff){_0x192099['push'](_0x192099['shift']());}};_0x3d6ccc(++_0x38a593);}(_0xb701,0x1c6));var _0x1b70=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb701[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x1b70('0x0'));var util=require(_0x1b70('0x1'));var moment=require(_0x1b70('0x2'));var BPromise=require(_0x1b70('0x3'));var rs=require(_0x1b70('0x4'));var fs=require('fs');var Redis=require(_0x1b70('0x5'));var db=require(_0x1b70('0x6'))['db'];var utils=require(_0x1b70('0x7'));var logger=require(_0x1b70('0x8'))(_0x1b70('0x9'));var config=require(_0x1b70('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1b70('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b9d91,_0x26648b,_0x30e717){return new BPromise(function(_0x2a94aa,_0x354d35){return client['request'](_0x5b9d91,_0x30e717)[_0x1b70('0xc')](function(_0x4a4dcc){logger[_0x1b70('0xd')](_0x1b70('0xe'),_0x26648b,'request\x20sent');logger[_0x1b70('0xf')](_0x1b70('0x10'),_0x26648b,'request\x20sent',JSON[_0x1b70('0x11')](_0x4a4dcc));if(_0x4a4dcc[_0x1b70('0x12')]){if(_0x4a4dcc[_0x1b70('0x12')][_0x1b70('0x13')]===0x1f4){logger[_0x1b70('0x12')](_0x1b70('0xe'),_0x26648b,_0x4a4dcc[_0x1b70('0x12')][_0x1b70('0x14')]);return _0x354d35(_0x4a4dcc[_0x1b70('0x12')][_0x1b70('0x14')]);}logger[_0x1b70('0x12')](_0x1b70('0xe'),_0x26648b,_0x4a4dcc['error'][_0x1b70('0x14')]);return _0x2a94aa(_0x4a4dcc[_0x1b70('0x12')][_0x1b70('0x14')]);}else{logger[_0x1b70('0xd')](_0x1b70('0xe'),_0x26648b,_0x1b70('0x15'));_0x2a94aa(_0x4a4dcc['result'][_0x1b70('0x14')]);}})[_0x1b70('0x16')](function(_0x573580){logger['error'](_0x1b70('0xe'),_0x26648b,_0x573580);_0x354d35(_0x573580);});});}
\ No newline at end of file
+var _0x3ab1=['client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x44a9f8,_0x54c90f){var _0x3a8546=function(_0x2dcbd9){while(--_0x2dcbd9){_0x44a9f8['push'](_0x44a9f8['shift']());}};_0x3a8546(++_0x54c90f);}(_0x3ab1,0xb4));var _0x13ab=function(_0x4c2a19,_0xbe609f){_0x4c2a19=_0x4c2a19-0x0;var _0x2bfbe3=_0x3ab1[_0x4c2a19];return _0x2bfbe3;};'use strict';var _=require(_0x13ab('0x0'));var util=require(_0x13ab('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x13ab('0x2'));var fs=require('fs');var Redis=require(_0x13ab('0x3'));var db=require(_0x13ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x13ab('0x5'))(_0x13ab('0x6'));var config=require(_0x13ab('0x7'));var jayson=require(_0x13ab('0x8'));var client=jayson[_0x13ab('0x9')][_0x13ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x191285,_0x5d7d27,_0x2fd4fb){return new BPromise(function(_0x4190a1,_0x477c6a){return client[_0x13ab('0xb')](_0x191285,_0x2fd4fb)[_0x13ab('0xc')](function(_0x153483){logger[_0x13ab('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5d7d27,_0x13ab('0xe'));logger[_0x13ab('0xf')](_0x13ab('0x10'),_0x5d7d27,_0x13ab('0xe'),JSON['stringify'](_0x153483));if(_0x153483[_0x13ab('0x11')]){if(_0x153483['error']['code']===0x1f4){logger['error'](_0x13ab('0x12'),_0x5d7d27,_0x153483[_0x13ab('0x11')][_0x13ab('0x13')]);return _0x477c6a(_0x153483['error']['message']);}logger['error'](_0x13ab('0x12'),_0x5d7d27,_0x153483[_0x13ab('0x11')][_0x13ab('0x13')]);return _0x4190a1(_0x153483[_0x13ab('0x11')][_0x13ab('0x13')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5d7d27,_0x13ab('0xe'));_0x4190a1(_0x153483[_0x13ab('0x14')][_0x13ab('0x13')]);}})['catch'](function(_0x522252){logger[_0x13ab('0x11')](_0x13ab('0x12'),_0x5d7d27,_0x522252);_0x477c6a(_0x522252);});});}
\ No newline at end of file
index 39e6109..dbcce9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3133=['destroy','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','index','isAuthenticated','show','/:id/preview','preview','run','/:id/query','query','post','create','put','/:id','update','delete'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x3133,0x9b));var _0x3313=function(_0x555e2f,_0x1e1550){_0x555e2f=_0x555e2f-0x0;var _0x3e2fbd=_0x3133[_0x555e2f];return _0x3e2fbd;};'use strict';var multer=require(_0x3313('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3313('0x1')]();var fs_extra=require(_0x3313('0x2'));var auth=require(_0x3313('0x3'));var interaction=require(_0x3313('0x4'));var config=require('../../config/environment');var controller=require(_0x3313('0x5'));router[_0x3313('0x6')]('/',auth['isAuthenticated'](),controller[_0x3313('0x7')]);router[_0x3313('0x6')]('/:id',auth[_0x3313('0x8')](),controller[_0x3313('0x9')]);router[_0x3313('0x6')](_0x3313('0xa'),auth[_0x3313('0x8')](),controller[_0x3313('0xb')]);router['get']('/:id/run',auth[_0x3313('0x8')](),controller[_0x3313('0xc')]);router[_0x3313('0x6')](_0x3313('0xd'),auth[_0x3313('0x8')](),controller[_0x3313('0xe')]);router[_0x3313('0xf')]('/',auth[_0x3313('0x8')](),controller[_0x3313('0x10')]);router[_0x3313('0x11')](_0x3313('0x12'),auth[_0x3313('0x8')](),controller[_0x3313('0x13')]);router[_0x3313('0x14')]('/:id',auth[_0x3313('0x8')](),controller[_0x3313('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xe7f0=['post','create','update','delete','/:id','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x429e41,_0x26cf44){var _0x285dd1=function(_0x5631fe){while(--_0x5631fe){_0x429e41['push'](_0x429e41['shift']());}};_0x285dd1(++_0x26cf44);}(_0xe7f0,0xc4));var _0x0e7f=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0xe7f0[_0x10d0f0];return _0x93e308;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0e7f('0x0'));var router=express[_0x0e7f('0x1')]();var fs_extra=require(_0x0e7f('0x2'));var auth=require(_0x0e7f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0e7f('0x4'));var controller=require(_0x0e7f('0x5'));router[_0x0e7f('0x6')]('/',auth[_0x0e7f('0x7')](),controller[_0x0e7f('0x8')]);router[_0x0e7f('0x6')]('/:id',auth[_0x0e7f('0x7')](),controller[_0x0e7f('0x9')]);router['get'](_0x0e7f('0xa'),auth[_0x0e7f('0x7')](),controller['preview']);router[_0x0e7f('0x6')](_0x0e7f('0xb'),auth[_0x0e7f('0x7')](),controller[_0x0e7f('0xc')]);router[_0x0e7f('0x6')](_0x0e7f('0xd'),auth[_0x0e7f('0x7')](),controller['query']);router[_0x0e7f('0xe')]('/',auth['isAuthenticated'](),controller[_0x0e7f('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0e7f('0x10')]);router[_0x0e7f('0x11')](_0x0e7f('0x12'),auth['isAuthenticated'](),controller[_0x0e7f('0x13')]);module[_0x0e7f('0x14')]=router;
\ No newline at end of file
index 9377580..ecb1595 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x415b65,_0x108c91){var _0x253100=function(_0x34398f){while(--_0x34398f){_0x415b65['push'](_0x415b65['shift']());}};_0x253100(++_0x108c91);}(_0x5d17,0x114));var _0x75d1=function(_0x18be96,_0x15e628){_0x18be96=_0x18be96-0x0;var _0x4b9baa=_0x5d17[_0x18be96];return _0x4b9baa;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5075=['exports','STRING','TEXT','sequelize'];(function(_0x5bff0,_0x20716d){var _0x3ead2e=function(_0x14f592){while(--_0x14f592){_0x5bff0['push'](_0x5bff0['shift']());}};_0x3ead2e(++_0x20716d);}(_0x5075,0x73));var _0x5507=function(_0x4af42d,_0x226c6d){_0x4af42d=_0x4af42d-0x0;var _0x14b54f=_0x5075[_0x4af42d];return _0x14b54f;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'name':{'type':Sequelize[_0x5507('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5507('0x2')]},'parent':{'type':Sequelize[_0x5507('0x2')]},'table':{'type':Sequelize[_0x5507('0x2')]},'conditions':{'type':Sequelize[_0x5507('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 568b2ef..89986b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','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','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x49fcb4,_0xce3f11){var _0x275daf=function(_0x512bda){while(--_0x512bda){_0x49fcb4['push'](_0x49fcb4['shift']());}};_0x275daf(++_0xce3f11);}(_0x4975,0x86));var _0x5497=function(_0x5425b5,_0x5c6d4f){_0x5425b5=_0x5425b5-0x0;var _0x314dea=_0x4975[_0x5425b5];return _0x314dea;};'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'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
+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(_0x474e07,_0x223d57){var _0x53f32b=function(_0xbcf040){while(--_0xbcf040){_0x474e07['push'](_0x474e07['shift']());}};_0x53f32b(++_0x223d57);}(_0x2675,0x75));var _0x5267=function(_0x28af04,_0xde7ae5){_0x28af04=_0x28af04-0x0;var _0x48ad3e=_0x2675[_0x28af04];return _0x48ad3e;};'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
index 2861d5b..8e414b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c05=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b231b,_0x1bc086){var _0x157264=function(_0x2a0bb7){while(--_0x2a0bb7){_0x4b231b['push'](_0x4b231b['shift']());}};_0x157264(++_0x1bc086);}(_0x1c05,0xc6));var _0x51c0=function(_0x2df3c9,_0x3d34a4){_0x2df3c9=_0x2df3c9-0x0;var _0x23696c=_0x1c05[_0x2df3c9];return _0x23696c;};'use strict';var _=require('lodash');var util=require(_0x51c0('0x0'));var logger=require(_0x51c0('0x1'))(_0x51c0('0x2'));var moment=require(_0x51c0('0x3'));var BPromise=require(_0x51c0('0x4'));var rp=require(_0x51c0('0x5'));var fs=require('fs');var path=require(_0x51c0('0x6'));var rimraf=require(_0x51c0('0x7'));var config=require(_0x51c0('0x8'));var attributes=require(_0x51c0('0x9'));module['exports']=function(_0x1af283,_0x5afe1e){return _0x1af283['define'](_0x51c0('0xa'),attributes,{'tableName':_0x51c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1f1a=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0xf49e6e,_0x1d33b1){var _0x4889b6=function(_0x2c0bf7){while(--_0x2c0bf7){_0xf49e6e['push'](_0xf49e6e['shift']());}};_0x4889b6(++_0x1d33b1);}(_0x1f1a,0x12c));var _0xa1f1=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x1f1a[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xa1f1('0x0'));var util=require('util');var logger=require(_0xa1f1('0x1'))(_0xa1f1('0x2'));var moment=require('moment');var BPromise=require(_0xa1f1('0x3'));var rp=require(_0xa1f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1f1('0x5'));var config=require(_0xa1f1('0x6'));var attributes=require(_0xa1f1('0x7'));module[_0xa1f1('0x8')]=function(_0x21b5ce,_0x3c866f){return _0x21b5ce[_0xa1f1('0x9')](_0xa1f1('0xa'),attributes,{'tableName':_0xa1f1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bab7186..27ab6c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa54=['http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xfa54,0xe9));var _0x4fa5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xfa54[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x4fa5('0x0'));var util=require(_0x4fa5('0x1'));var moment=require(_0x4fa5('0x2'));var BPromise=require('bluebird');var rs=require(_0x4fa5('0x3'));var fs=require('fs');var Redis=require(_0x4fa5('0x4'));var db=require(_0x4fa5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4fa5('0x6'))(_0x4fa5('0x7'));var config=require(_0x4fa5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4fa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39a5fc,_0x565080,_0x4b9d9a){return new BPromise(function(_0x11b6b5,_0x2a31b0){return client[_0x4fa5('0xa')](_0x39a5fc,_0x4b9d9a)['then'](function(_0x4e2448){logger[_0x4fa5('0xb')](_0x4fa5('0xc'),_0x565080,_0x4fa5('0xd'));logger[_0x4fa5('0xe')](_0x4fa5('0xf'),_0x565080,_0x4fa5('0xd'),JSON[_0x4fa5('0x10')](_0x4e2448));if(_0x4e2448[_0x4fa5('0x11')]){if(_0x4e2448[_0x4fa5('0x11')][_0x4fa5('0x12')]===0x1f4){logger[_0x4fa5('0x11')](_0x4fa5('0xc'),_0x565080,_0x4e2448[_0x4fa5('0x11')]['message']);return _0x2a31b0(_0x4e2448[_0x4fa5('0x11')]['message']);}logger[_0x4fa5('0x11')](_0x4fa5('0xc'),_0x565080,_0x4e2448[_0x4fa5('0x11')][_0x4fa5('0x13')]);return _0x11b6b5(_0x4e2448[_0x4fa5('0x11')]['message']);}else{logger[_0x4fa5('0xb')](_0x4fa5('0xc'),_0x565080,'request\x20sent');_0x11b6b5(_0x4e2448[_0x4fa5('0x14')][_0x4fa5('0x13')]);}})[_0x4fa5('0x15')](function(_0x238f54){logger['error'](_0x4fa5('0xc'),_0x565080,_0x238f54);_0x2a31b0(_0x238f54);});});}
\ No newline at end of file
+var _0x0701=['../../config/environment','jayson/promise','client','http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x31d849,_0x3db9bc){var _0x1c55b3=function(_0x3b8040){while(--_0x3b8040){_0x31d849['push'](_0x31d849['shift']());}};_0x1c55b3(++_0x3db9bc);}(_0x0701,0xca));var _0x1070=function(_0x52f09a,_0x58f11b){_0x52f09a=_0x52f09a-0x0;var _0x1899a3=_0x0701[_0x52f09a];return _0x1899a3;};'use strict';var _=require('lodash');var util=require(_0x1070('0x0'));var moment=require('moment');var BPromise=require(_0x1070('0x1'));var rs=require(_0x1070('0x2'));var fs=require('fs');var Redis=require(_0x1070('0x3'));var db=require(_0x1070('0x4'))['db'];var utils=require(_0x1070('0x5'));var logger=require(_0x1070('0x6'))(_0x1070('0x7'));var config=require(_0x1070('0x8'));var jayson=require(_0x1070('0x9'));var client=jayson[_0x1070('0xa')][_0x1070('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x124abd,_0x124414,_0x32aadd){return new BPromise(function(_0x26d067,_0xbabe8e){return client['request'](_0x124abd,_0x32aadd)['then'](function(_0x4c4e53){logger[_0x1070('0xc')](_0x1070('0xd'),_0x124414,_0x1070('0xe'));logger['debug'](_0x1070('0xf'),_0x124414,_0x1070('0xe'),JSON['stringify'](_0x4c4e53));if(_0x4c4e53['error']){if(_0x4c4e53[_0x1070('0x10')][_0x1070('0x11')]===0x1f4){logger['error'](_0x1070('0xd'),_0x124414,_0x4c4e53[_0x1070('0x10')][_0x1070('0x12')]);return _0xbabe8e(_0x4c4e53[_0x1070('0x10')][_0x1070('0x12')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x124414,_0x4c4e53[_0x1070('0x10')][_0x1070('0x12')]);return _0x26d067(_0x4c4e53['error']['message']);}else{logger[_0x1070('0xc')](_0x1070('0xd'),_0x124414,_0x1070('0xe'));_0x26d067(_0x4c4e53[_0x1070('0x13')][_0x1070('0x12')]);}})[_0x1070('0x14')](function(_0x4727b2){logger[_0x1070('0x10')](_0x1070('0xd'),_0x124414,_0x4727b2);_0xbabe8e(_0x4727b2);});});}
\ No newline at end of file
index 8f01033..967184d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83ff=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','/:id/query','post','create','put','delete','destroy','exports','util'];(function(_0x2b755b,_0x1d1daf){var _0x62c945=function(_0x18abc1){while(--_0x18abc1){_0x2b755b['push'](_0x2b755b['shift']());}};_0x62c945(++_0x1d1daf);}(_0x83ff,0x17f));var _0xf83f=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x83ff[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0xf83f('0x0'));var path=require(_0xf83f('0x1'));var timeout=require(_0xf83f('0x2'));var express=require(_0xf83f('0x3'));var router=express[_0xf83f('0x4')]();var fs_extra=require(_0xf83f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf83f('0x6'));var config=require(_0xf83f('0x7'));var controller=require(_0xf83f('0x8'));router['get']('/',auth[_0xf83f('0x9')](),controller[_0xf83f('0xa')]);router[_0xf83f('0xb')](_0xf83f('0xc'),auth[_0xf83f('0x9')](),controller[_0xf83f('0xd')]);router[_0xf83f('0xb')](_0xf83f('0xe'),auth[_0xf83f('0x9')](),controller[_0xf83f('0xf')]);router['get']('/:id/run',auth[_0xf83f('0x9')](),controller[_0xf83f('0x10')]);router[_0xf83f('0xb')](_0xf83f('0x11'),auth[_0xf83f('0x9')](),controller['query']);router[_0xf83f('0x12')]('/',auth['isAuthenticated'](),controller[_0xf83f('0x13')]);router[_0xf83f('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf83f('0x15')](_0xf83f('0xc'),auth['isAuthenticated'](),controller[_0xf83f('0x16')]);module[_0xf83f('0x17')]=router;
\ No newline at end of file
+var _0xeded=['Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x4c7043,_0x24bff4){var _0x3ec724=function(_0x43ec0d){while(--_0x43ec0d){_0x4c7043['push'](_0x4c7043['shift']());}};_0x3ec724(++_0x24bff4);}(_0xeded,0x10f));var _0xdede=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeded[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdede('0x0'));var util=require(_0xdede('0x1'));var path=require(_0xdede('0x2'));var timeout=require(_0xdede('0x3'));var express=require(_0xdede('0x4'));var router=express[_0xdede('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdede('0x6'));var interaction=require(_0xdede('0x7'));var config=require('../../config/environment');var controller=require(_0xdede('0x8'));router[_0xdede('0x9')]('/',auth[_0xdede('0xa')](),controller[_0xdede('0xb')]);router[_0xdede('0x9')](_0xdede('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xdede('0x9')](_0xdede('0xd'),auth[_0xdede('0xa')](),controller[_0xdede('0xe')]);router[_0xdede('0x9')]('/:id/run',auth[_0xdede('0xa')](),controller[_0xdede('0xf')]);router[_0xdede('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xdede('0x10')]);router[_0xdede('0x11')]('/',auth[_0xdede('0xa')](),controller['create']);router[_0xdede('0x12')](_0xdede('0xc'),auth[_0xdede('0xa')](),controller[_0xdede('0x13')]);router[_0xdede('0x14')](_0xdede('0xc'),auth[_0xdede('0xa')](),controller[_0xdede('0x15')]);module[_0xdede('0x16')]=router;
\ No newline at end of file
index a0d458a..4d7b9c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2acf=['DATE','Loading','manual','INTEGER','UNSIGNED','moment','exports','ENUM','pdf','xlsx','csv','STRING'];(function(_0x155200,_0x228087){var _0x354c3a=function(_0xb986be){while(--_0xb986be){_0x155200['push'](_0x155200['shift']());}};_0x354c3a(++_0x228087);}(_0x2acf,0x101));var _0xf2ac=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0x2acf[_0x595604];return _0x1466f3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf2ac('0x0'));module[_0xf2ac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xf2ac('0x2')]('csv',_0xf2ac('0x3'),_0xf2ac('0x4')),'allowNull':![],'defaultValue':_0xf2ac('0x5')},'savename':{'type':Sequelize[_0xf2ac('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf2ac('0x7')]},'endDate':{'type':Sequelize[_0xf2ac('0x7')]},'status':{'type':Sequelize[_0xf2ac('0x6')],'defaultValue':_0xf2ac('0x8')},'type':{'type':Sequelize['ENUM'](_0xf2ac('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xf2ac('0xa')](0xb)[_0xf2ac('0xb')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2512=['scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv','DATE','Loading'];(function(_0x146624,_0x103622){var _0x4b05fc=function(_0x3f40b3){while(--_0x3f40b3){_0x146624['push'](_0x146624['shift']());}};_0x4b05fc(++_0x103622);}(_0x2512,0xc0));var _0x2251=function(_0x59dccc,_0x184c1c){_0x59dccc=_0x59dccc-0x0;var _0xc97bcb=_0x2512[_0x59dccc];return _0xc97bcb;};'use strict';var Sequelize=require(_0x2251('0x0'));var moment=require(_0x2251('0x1'));module[_0x2251('0x2')]={'name':{'type':Sequelize[_0x2251('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x2251('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x2251('0x4')](_0x2251('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x2251('0x5')},'savename':{'type':Sequelize[_0x2251('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2251('0x6')]},'endDate':{'type':Sequelize[_0x2251('0x6')]},'status':{'type':Sequelize[_0x2251('0x3')],'defaultValue':_0x2251('0x7')},'type':{'type':Sequelize[_0x2251('0x4')]('manual',_0x2251('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2251('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2d99c4b..963e5e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56b9=['format','%s.%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','ExtractedReports','destroy','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','sendStatus','savename'];(function(_0x8e4e8,_0x158fc4){var _0x21fa1b=function(_0x56eb9c){while(--_0x56eb9c){_0x8e4e8['push'](_0x8e4e8['shift']());}};_0x21fa1b(++_0x158fc4);}(_0x56b9,0xc2));var _0x956b=function(_0x4f2540,_0x10e19b){_0x4f2540=_0x4f2540-0x0;var _0x151dd6=_0x56b9[_0x4f2540];return _0x151dd6;};'use strict';var emlformat=require(_0x956b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x956b('0x1'));var jsonpatch=require(_0x956b('0x2'));var rp=require(_0x956b('0x3'));var moment=require('moment');var BPromise=require(_0x956b('0x4'));var Mustache=require(_0x956b('0x5'));var util=require('util');var path=require(_0x956b('0x6'));var sox=require(_0x956b('0x7'));var csv=require(_0x956b('0x8'));var ejs=require(_0x956b('0x9'));var fs=require('fs');var fs_extra=require(_0x956b('0xa'));var _=require(_0x956b('0xb'));var squel=require(_0x956b('0xc'));var crypto=require('crypto');var jsforce=require(_0x956b('0xd'));var deskjs=require(_0x956b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x956b('0xf'));var Papa=require(_0x956b('0x10'));var Redis=require('ioredis');var authService=require(_0x956b('0x11'));var qs=require(_0x956b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x956b('0x13'));var logger=require(_0x956b('0x14'))('api');var utils=require(_0x956b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x956b('0x16'));var db=require(_0x956b('0x17'))['db'];function respondWithStatusCode(_0x5dc731,_0x2ab95b){_0x2ab95b=_0x2ab95b||0xcc;return function(_0x4540b6){if(_0x4540b6){return _0x5dc731['sendStatus'](_0x2ab95b);}return _0x5dc731[_0x956b('0x18')](_0x2ab95b)[_0x956b('0x19')]();};}function respondWithResult(_0x56bf2d,_0x3fff1f){_0x3fff1f=_0x3fff1f||0xc8;return function(_0x50f5a2){if(_0x50f5a2){return _0x56bf2d[_0x956b('0x18')](_0x3fff1f)[_0x956b('0x1a')](_0x50f5a2);}};}function respondWithFilteredResult(_0x168045,_0x2a21a1){return function(_0x12146b){if(_0x12146b){var _0x59d02d=typeof _0x2a21a1['offset']===_0x956b('0x1b')&&typeof _0x2a21a1[_0x956b('0x1c')]===_0x956b('0x1b');var _0x1feaee=_0x12146b[_0x956b('0x1d')];var _0x418f6a=_0x59d02d?0x0:_0x2a21a1[_0x956b('0x1e')];var _0x5d08a1=_0x59d02d?_0x12146b[_0x956b('0x1d')]:_0x2a21a1[_0x956b('0x1e')]+_0x2a21a1[_0x956b('0x1c')];var _0x4b252b;if(_0x5d08a1>=_0x1feaee){_0x5d08a1=_0x1feaee;_0x4b252b=0xc8;}else{_0x4b252b=0xce;}_0x168045['status'](_0x4b252b);return _0x168045[_0x956b('0x1f')](_0x956b('0x20'),_0x418f6a+'-'+_0x5d08a1+'/'+_0x1feaee)['json'](_0x12146b);}return null;};}function patchUpdates(_0xe8caaa){return function(_0x37ba88){try{jsonpatch[_0x956b('0x21')](_0x37ba88,_0xe8caaa,!![]);}catch(_0x55d161){return BPromise[_0x956b('0x22')](_0x55d161);}return _0x37ba88[_0x956b('0x23')]();};}function saveUpdates(_0x36b853,_0x236b6e){return function(_0x10a513){if(_0x10a513){return _0x10a513[_0x956b('0x24')](_0x36b853)[_0x956b('0x25')](function(_0x66135f){return _0x66135f;});}return null;};}function removeEntity(_0xc88bce,_0x197f5c){return function(_0x52b030){if(_0x52b030){return _0x52b030['destroy']()['then'](function(){var _0x4e462e=_0x52b030[_0x956b('0x26')]({'plain':!![]});var _0x27e6a2=_0x956b('0x27');return db['UserProfileResource'][_0x956b('0x28')]({'where':{'type':_0x27e6a2,'resourceId':_0x4e462e['id']}})[_0x956b('0x25')](function(){return _0x52b030;});})['then'](function(){_0xc88bce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x592259,_0x4d2089){return function(_0x2e6770){if(!_0x2e6770){_0x592259['sendStatus'](0x194);}return _0x2e6770;};}function handleError(_0x57a020,_0x8f52db){_0x8f52db=_0x8f52db||0x1f4;return function(_0x12aa8c){logger[_0x956b('0x29')](_0x12aa8c[_0x956b('0x2a')]);if(_0x12aa8c[_0x956b('0x2b')]){delete _0x12aa8c['name'];}_0x57a020['status'](_0x8f52db)[_0x956b('0x2c')](_0x12aa8c);};}exports['index']=function(_0x3d7945,_0x1bb348){var _0x136461={},_0x10cdf6={},_0x470155={'count':0x0,'rows':[]};var _0x22dbfd=_['map'](db[_0x956b('0x2d')][_0x956b('0x2e')],function(_0x4682aa){return{'name':_0x4682aa[_0x956b('0x2f')],'type':_0x4682aa[_0x956b('0x30')][_0x956b('0x31')]};});_0x10cdf6['model']=_[_0x956b('0x32')](_0x22dbfd,'name');_0x10cdf6[_0x956b('0x33')]=_[_0x956b('0x34')](_0x3d7945[_0x956b('0x33')]);_0x10cdf6[_0x956b('0x35')]=_[_0x956b('0x36')](_0x10cdf6[_0x956b('0x37')],_0x10cdf6['query']);_0x136461[_0x956b('0x38')]=_[_0x956b('0x36')](_0x10cdf6[_0x956b('0x37')],qs[_0x956b('0x39')](_0x3d7945[_0x956b('0x33')][_0x956b('0x39')]));_0x136461[_0x956b('0x38')]=_0x136461[_0x956b('0x38')][_0x956b('0x3a')]?_0x136461[_0x956b('0x38')]:_0x10cdf6[_0x956b('0x37')];if(!_0x3d7945[_0x956b('0x33')]['hasOwnProperty'](_0x956b('0x3b'))){_0x136461[_0x956b('0x1c')]=qs[_0x956b('0x1c')](_0x3d7945['query'][_0x956b('0x1c')]);_0x136461[_0x956b('0x1e')]=qs[_0x956b('0x1e')](_0x3d7945[_0x956b('0x33')][_0x956b('0x1e')]);}_0x136461[_0x956b('0x3c')]=qs[_0x956b('0x3d')](_0x3d7945[_0x956b('0x33')][_0x956b('0x3d')]);_0x136461[_0x956b('0x3e')]=qs[_0x956b('0x35')](_['pick'](_0x3d7945[_0x956b('0x33')],_0x10cdf6[_0x956b('0x35')]),_0x22dbfd);if(_0x3d7945['query'][_0x956b('0x3f')]){_0x136461[_0x956b('0x3e')]=_[_0x956b('0x40')](_0x136461[_0x956b('0x3e')],{'$or':_['map'](_0x22dbfd,function(_0x4f2f84){if(_0x4f2f84['type']!==_0x956b('0x41')){var _0x5058be={};_0x5058be[_0x4f2f84['name']]={'$like':'%'+_0x3d7945['query'][_0x956b('0x3f')]+'%'};return _0x5058be;}})});}_0x136461=_[_0x956b('0x40')]({},_0x136461,_0x3d7945[_0x956b('0x42')]);var _0x4c76e5={'where':_0x136461[_0x956b('0x3e')]};return db[_0x956b('0x2d')][_0x956b('0x1d')](_0x4c76e5)['then'](function(_0x380ff3){_0x470155[_0x956b('0x1d')]=_0x380ff3;if(_0x3d7945[_0x956b('0x33')][_0x956b('0x43')]){_0x136461['include']=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x136461);})['then'](function(_0x2a29e6){_0x470155['rows']=_0x2a29e6;return _0x470155;})['then'](respondWithFilteredResult(_0x1bb348,_0x136461))[_0x956b('0x44')](handleError(_0x1bb348,null));};exports[_0x956b('0x45')]=function(_0x5898dc,_0x43474e){var _0x72a99e={'raw':!![],'where':{'id':_0x5898dc['params']['id']}},_0x221b27={};_0x221b27[_0x956b('0x37')]=_[_0x956b('0x34')](db['AnalyticExtractedReport'][_0x956b('0x2e')]);_0x221b27[_0x956b('0x33')]=_[_0x956b('0x34')](_0x5898dc[_0x956b('0x33')]);_0x221b27[_0x956b('0x35')]=_[_0x956b('0x36')](_0x221b27['model'],_0x221b27[_0x956b('0x33')]);_0x72a99e['attributes']=_['intersection'](_0x221b27[_0x956b('0x37')],qs[_0x956b('0x39')](_0x5898dc[_0x956b('0x33')][_0x956b('0x39')]));_0x72a99e[_0x956b('0x38')]=_0x72a99e[_0x956b('0x38')][_0x956b('0x3a')]?_0x72a99e[_0x956b('0x38')]:_0x221b27[_0x956b('0x37')];if(_0x5898dc[_0x956b('0x33')][_0x956b('0x43')]){_0x72a99e[_0x956b('0x46')]=[{'all':!![]}];}_0x72a99e=_[_0x956b('0x40')]({},_0x72a99e,_0x5898dc[_0x956b('0x42')]);return db['AnalyticExtractedReport'][_0x956b('0x47')](_0x72a99e)[_0x956b('0x25')](handleEntityNotFound(_0x43474e,null))[_0x956b('0x25')](respondWithResult(_0x43474e,null))[_0x956b('0x44')](handleError(_0x43474e,null));};exports[_0x956b('0x48')]=function(_0x5aad3f,_0x49c17b){return db[_0x956b('0x2d')][_0x956b('0x48')](_0x5aad3f[_0x956b('0x49')],{})[_0x956b('0x25')](function(_0x1230c3){var _0x48dee5=_0x5aad3f[_0x956b('0x4a')][_0x956b('0x26')]({'plain':!![]});if(!_0x48dee5)throw new Error(_0x956b('0x4b'));if(_0x48dee5[_0x956b('0x4c')]==='user'){var _0x11d79a=_0x1230c3[_0x956b('0x26')]({'plain':!![]});var _0x331bcb=_0x956b('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x331bcb,'userProfileId':_0x48dee5[_0x956b('0x4d')]},'raw':!![]})[_0x956b('0x25')](function(_0x23ba26){if(_0x23ba26&&_0x23ba26[_0x956b('0x4e')]===0x0){return db[_0x956b('0x4f')]['create']({'name':_0x11d79a[_0x956b('0x2b')],'resourceId':_0x11d79a['id'],'type':_0x23ba26[_0x956b('0x2b')],'sectionId':_0x23ba26['id']},{})[_0x956b('0x25')](function(){return _0x1230c3;});}else{return _0x1230c3;}})[_0x956b('0x44')](function(_0x53e3e3){logger[_0x956b('0x29')](_0x956b('0x50'),_0x53e3e3);throw _0x53e3e3;});}return _0x1230c3;})[_0x956b('0x25')](respondWithResult(_0x49c17b,0xc9))[_0x956b('0x44')](handleError(_0x49c17b,null));};exports[_0x956b('0x24')]=function(_0x1d3c73,_0x31eac6){if(_0x1d3c73['body']['id']){delete _0x1d3c73[_0x956b('0x49')]['id'];}return db[_0x956b('0x2d')][_0x956b('0x47')]({'where':{'id':_0x1d3c73[_0x956b('0x51')]['id']}})[_0x956b('0x25')](handleEntityNotFound(_0x31eac6,null))[_0x956b('0x25')](saveUpdates(_0x1d3c73[_0x956b('0x49')],null))['then'](respondWithResult(_0x31eac6,null))[_0x956b('0x44')](handleError(_0x31eac6,null));};exports['destroy']=function(_0x3e2fee,_0xbda9ab){return db['AnalyticExtractedReport'][_0x956b('0x47')]({'where':{'id':_0x3e2fee['params']['id']}})[_0x956b('0x25')](handleEntityNotFound(_0xbda9ab,null))[_0x956b('0x25')](removeEntity(_0xbda9ab,null))['catch'](handleError(_0xbda9ab,null));};exports[_0x956b('0x52')]=function(_0x5be939,_0x2974e0,_0x5b62f7){return db[_0x956b('0x2d')]['find']({'where':{'id':_0x5be939['params']['id']},'attributes':[_0x956b('0x2b'),_0x956b('0x53'),'savename',_0x956b('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x2974e0,null))[_0x956b('0x25')](function(_0x49d89f){if(_0x49d89f){if(!fs[_0x956b('0x55')](path[_0x956b('0x56')](config[_0x956b('0x57')],_0x956b('0x58'),_0x49d89f['savename']))){throw new db[(_0x956b('0x59'))][(_0x956b('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5be939['query'][_0x956b('0x5b')]){return _0x2974e0[_0x956b('0x5c')](0xc8);}return _0x2974e0[_0x956b('0x52')](path[_0x956b('0x56')](config[_0x956b('0x57')],_0x956b('0x58'),_0x49d89f[_0x956b('0x5d')]),util[_0x956b('0x5e')](_0x956b('0x5f'),_0x49d89f['basename']||_0x49d89f[_0x956b('0x2b')],_0x49d89f['output']['toLowerCase']()));}})['catch'](handleError(_0x2974e0,null));};
\ No newline at end of file
+var _0x5627=['ejs','fs-extra','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','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','UserProfileResource','error','name','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','AnalyticExtractedReport','includeAll','include','rows','catch','show','filters','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x5627,0x1d5));var _0x7562=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5627[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x7562('0x0'));var rimraf=require(_0x7562('0x1'));var zipdir=require(_0x7562('0x2'));var jsonpatch=require(_0x7562('0x3'));var rp=require(_0x7562('0x4'));var moment=require(_0x7562('0x5'));var BPromise=require(_0x7562('0x6'));var Mustache=require('mustache');var util=require(_0x7562('0x7'));var path=require(_0x7562('0x8'));var sox=require(_0x7562('0x9'));var csv=require(_0x7562('0xa'));var ejs=require(_0x7562('0xb'));var fs=require('fs');var fs_extra=require(_0x7562('0xc'));var _=require('lodash');var squel=require(_0x7562('0xd'));var crypto=require(_0x7562('0xe'));var jsforce=require(_0x7562('0xf'));var deskjs=require(_0x7562('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7562('0x11'));var Redis=require('ioredis');var authService=require(_0x7562('0x12'));var qs=require(_0x7562('0x13'));var as=require(_0x7562('0x14'));var hardwareService=require(_0x7562('0x15'));var logger=require('../../config/logger')(_0x7562('0x16'));var utils=require(_0x7562('0x17'));var config=require(_0x7562('0x18'));var licenseUtil=require(_0x7562('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3943d4,_0x431588){_0x431588=_0x431588||0xcc;return function(_0x416f15){if(_0x416f15){return _0x3943d4[_0x7562('0x1a')](_0x431588);}return _0x3943d4[_0x7562('0x1b')](_0x431588)[_0x7562('0x1c')]();};}function respondWithResult(_0x41598f,_0x4ea694){_0x4ea694=_0x4ea694||0xc8;return function(_0x13c931){if(_0x13c931){return _0x41598f[_0x7562('0x1b')](_0x4ea694)[_0x7562('0x1d')](_0x13c931);}};}function respondWithFilteredResult(_0x1e5818,_0x9f7563){return function(_0x5951bf){if(_0x5951bf){var _0x1e50c9=typeof _0x9f7563['offset']===_0x7562('0x1e')&&typeof _0x9f7563[_0x7562('0x1f')]===_0x7562('0x1e');var _0x5b722f=_0x5951bf[_0x7562('0x20')];var _0xbf4ab6=_0x1e50c9?0x0:_0x9f7563[_0x7562('0x21')];var _0x1ae96f=_0x1e50c9?_0x5951bf[_0x7562('0x20')]:_0x9f7563[_0x7562('0x21')]+_0x9f7563['limit'];var _0x5b7892;if(_0x1ae96f>=_0x5b722f){_0x1ae96f=_0x5b722f;_0x5b7892=0xc8;}else{_0x5b7892=0xce;}_0x1e5818[_0x7562('0x1b')](_0x5b7892);return _0x1e5818[_0x7562('0x22')](_0x7562('0x23'),_0xbf4ab6+'-'+_0x1ae96f+'/'+_0x5b722f)[_0x7562('0x1d')](_0x5951bf);}return null;};}function patchUpdates(_0x584e02){return function(_0x21c084){try{jsonpatch['apply'](_0x21c084,_0x584e02,!![]);}catch(_0x27aaa0){return BPromise['reject'](_0x27aaa0);}return _0x21c084[_0x7562('0x24')]();};}function saveUpdates(_0x8d3a57,_0x3b06b4){return function(_0x35646d){if(_0x35646d){return _0x35646d[_0x7562('0x25')](_0x8d3a57)[_0x7562('0x26')](function(_0x463417){return _0x463417;});}return null;};}function removeEntity(_0x1c2f3b,_0x29a841){return function(_0x212b1a){if(_0x212b1a){return _0x212b1a[_0x7562('0x27')]()[_0x7562('0x26')](function(){var _0x93cc7=_0x212b1a['get']({'plain':!![]});var _0x4c3726='ExtractedReports';return db[_0x7562('0x28')][_0x7562('0x27')]({'where':{'type':_0x4c3726,'resourceId':_0x93cc7['id']}})[_0x7562('0x26')](function(){return _0x212b1a;});})[_0x7562('0x26')](function(){_0x1c2f3b[_0x7562('0x1b')](0xcc)[_0x7562('0x1c')]();});}};}function handleEntityNotFound(_0x3ddb97,_0x5a0dac){return function(_0xe924a){if(!_0xe924a){_0x3ddb97[_0x7562('0x1a')](0x194);}return _0xe924a;};}function handleError(_0x5554e6,_0x476b81){_0x476b81=_0x476b81||0x1f4;return function(_0x3bb8a0){logger[_0x7562('0x29')](_0x3bb8a0['stack']);if(_0x3bb8a0[_0x7562('0x2a')]){delete _0x3bb8a0[_0x7562('0x2a')];}_0x5554e6[_0x7562('0x1b')](_0x476b81)['send'](_0x3bb8a0);};}exports['index']=function(_0x3a4e5f,_0x5b9247){var _0x500bd6={},_0x2cde91={},_0xa7a045={'count':0x0,'rows':[]};var _0x41668e=_[_0x7562('0x2b')](db['AnalyticExtractedReport'][_0x7562('0x2c')],function(_0x32200b){return{'name':_0x32200b[_0x7562('0x2d')],'type':_0x32200b[_0x7562('0x2e')]['key']};});_0x2cde91[_0x7562('0x2f')]=_[_0x7562('0x2b')](_0x41668e,_0x7562('0x2a'));_0x2cde91[_0x7562('0x30')]=_[_0x7562('0x31')](_0x3a4e5f['query']);_0x2cde91['filters']=_['intersection'](_0x2cde91['model'],_0x2cde91[_0x7562('0x30')]);_0x500bd6[_0x7562('0x32')]=_[_0x7562('0x33')](_0x2cde91[_0x7562('0x2f')],qs[_0x7562('0x34')](_0x3a4e5f['query'][_0x7562('0x34')]));_0x500bd6['attributes']=_0x500bd6['attributes'][_0x7562('0x35')]?_0x500bd6[_0x7562('0x32')]:_0x2cde91[_0x7562('0x2f')];if(!_0x3a4e5f[_0x7562('0x30')][_0x7562('0x36')](_0x7562('0x37'))){_0x500bd6[_0x7562('0x1f')]=qs[_0x7562('0x1f')](_0x3a4e5f[_0x7562('0x30')][_0x7562('0x1f')]);_0x500bd6['offset']=qs[_0x7562('0x21')](_0x3a4e5f[_0x7562('0x30')][_0x7562('0x21')]);}_0x500bd6[_0x7562('0x38')]=qs[_0x7562('0x39')](_0x3a4e5f[_0x7562('0x30')][_0x7562('0x39')]);_0x500bd6['where']=qs['filters'](_[_0x7562('0x3a')](_0x3a4e5f[_0x7562('0x30')],_0x2cde91['filters']),_0x41668e);if(_0x3a4e5f[_0x7562('0x30')][_0x7562('0x3b')]){_0x500bd6['where']=_[_0x7562('0x3c')](_0x500bd6[_0x7562('0x3d')],{'$or':_[_0x7562('0x2b')](_0x41668e,function(_0x5a98fe){if(_0x5a98fe[_0x7562('0x2e')]!==_0x7562('0x3e')){var _0x28f4a8={};_0x28f4a8[_0x5a98fe[_0x7562('0x2a')]]={'$like':'%'+_0x3a4e5f[_0x7562('0x30')][_0x7562('0x3b')]+'%'};return _0x28f4a8;}})});}_0x500bd6=_['merge']({},_0x500bd6,_0x3a4e5f[_0x7562('0x3f')]);var _0x54f47f={'where':_0x500bd6[_0x7562('0x3d')]};return db[_0x7562('0x40')][_0x7562('0x20')](_0x54f47f)[_0x7562('0x26')](function(_0xc56e02){_0xa7a045[_0x7562('0x20')]=_0xc56e02;if(_0x3a4e5f[_0x7562('0x30')][_0x7562('0x41')]){_0x500bd6[_0x7562('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x500bd6);})[_0x7562('0x26')](function(_0x2cc20a){_0xa7a045[_0x7562('0x43')]=_0x2cc20a;return _0xa7a045;})[_0x7562('0x26')](respondWithFilteredResult(_0x5b9247,_0x500bd6))[_0x7562('0x44')](handleError(_0x5b9247,null));};exports[_0x7562('0x45')]=function(_0x433447,_0x41ef7a){var _0x3f8663={'raw':!![],'where':{'id':_0x433447['params']['id']}},_0x5b54ba={};_0x5b54ba['model']=_[_0x7562('0x31')](db[_0x7562('0x40')][_0x7562('0x2c')]);_0x5b54ba[_0x7562('0x30')]=_[_0x7562('0x31')](_0x433447[_0x7562('0x30')]);_0x5b54ba[_0x7562('0x46')]=_['intersection'](_0x5b54ba[_0x7562('0x2f')],_0x5b54ba[_0x7562('0x30')]);_0x3f8663['attributes']=_[_0x7562('0x33')](_0x5b54ba[_0x7562('0x2f')],qs[_0x7562('0x34')](_0x433447[_0x7562('0x30')][_0x7562('0x34')]));_0x3f8663[_0x7562('0x32')]=_0x3f8663[_0x7562('0x32')][_0x7562('0x35')]?_0x3f8663[_0x7562('0x32')]:_0x5b54ba['model'];if(_0x433447[_0x7562('0x30')][_0x7562('0x41')]){_0x3f8663['include']=[{'all':!![]}];}_0x3f8663=_[_0x7562('0x3c')]({},_0x3f8663,_0x433447[_0x7562('0x3f')]);return db['AnalyticExtractedReport'][_0x7562('0x47')](_0x3f8663)[_0x7562('0x26')](handleEntityNotFound(_0x41ef7a,null))['then'](respondWithResult(_0x41ef7a,null))[_0x7562('0x44')](handleError(_0x41ef7a,null));};exports[_0x7562('0x48')]=function(_0x36ca77,_0x3380b3){return db['AnalyticExtractedReport'][_0x7562('0x48')](_0x36ca77['body'],{})[_0x7562('0x26')](function(_0x47a5b8){var _0x546dae=_0x36ca77[_0x7562('0x49')][_0x7562('0x4a')]({'plain':!![]});if(!_0x546dae)throw new Error(_0x7562('0x4b'));if(_0x546dae[_0x7562('0x4c')]==='user'){var _0x2b6b79=_0x47a5b8[_0x7562('0x4a')]({'plain':!![]});var _0x106f68='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x106f68,'userProfileId':_0x546dae[_0x7562('0x4d')]},'raw':!![]})['then'](function(_0x2b6f2a){if(_0x2b6f2a&&_0x2b6f2a[_0x7562('0x4e')]===0x0){return db[_0x7562('0x28')][_0x7562('0x48')]({'name':_0x2b6b79[_0x7562('0x2a')],'resourceId':_0x2b6b79['id'],'type':_0x2b6f2a['name'],'sectionId':_0x2b6f2a['id']},{})[_0x7562('0x26')](function(){return _0x47a5b8;});}else{return _0x47a5b8;}})['catch'](function(_0x207350){logger['error'](_0x7562('0x4f'),_0x207350);throw _0x207350;});}return _0x47a5b8;})[_0x7562('0x26')](respondWithResult(_0x3380b3,0xc9))[_0x7562('0x44')](handleError(_0x3380b3,null));};exports[_0x7562('0x25')]=function(_0x3c9c1c,_0x414f37){if(_0x3c9c1c[_0x7562('0x50')]['id']){delete _0x3c9c1c[_0x7562('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x7562('0x47')]({'where':{'id':_0x3c9c1c['params']['id']}})['then'](handleEntityNotFound(_0x414f37,null))[_0x7562('0x26')](saveUpdates(_0x3c9c1c[_0x7562('0x50')],null))[_0x7562('0x26')](respondWithResult(_0x414f37,null))[_0x7562('0x44')](handleError(_0x414f37,null));};exports[_0x7562('0x27')]=function(_0x4bb8a2,_0x492452){return db[_0x7562('0x40')][_0x7562('0x47')]({'where':{'id':_0x4bb8a2[_0x7562('0x51')]['id']}})[_0x7562('0x26')](handleEntityNotFound(_0x492452,null))[_0x7562('0x26')](removeEntity(_0x492452,null))[_0x7562('0x44')](handleError(_0x492452,null));};exports[_0x7562('0x52')]=function(_0x18466a,_0x46e7fc,_0x2d0a28){return db[_0x7562('0x40')][_0x7562('0x47')]({'where':{'id':_0x18466a[_0x7562('0x51')]['id']},'attributes':['name',_0x7562('0x53'),_0x7562('0x54'),_0x7562('0x55')],'raw':!![]})[_0x7562('0x26')](handleEntityNotFound(_0x46e7fc,null))['then'](function(_0x43c572){if(_0x43c572){if(!fs[_0x7562('0x56')](path[_0x7562('0x57')](config[_0x7562('0x58')],_0x7562('0x59'),_0x43c572['savename']))){throw new db[(_0x7562('0x5a'))][(_0x7562('0x5b'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x18466a[_0x7562('0x30')][_0x7562('0x5c')]){return _0x46e7fc[_0x7562('0x1a')](0xc8);}return _0x46e7fc[_0x7562('0x52')](path[_0x7562('0x57')](config[_0x7562('0x58')],_0x7562('0x59'),_0x43c572[_0x7562('0x54')]),util[_0x7562('0x5d')](_0x7562('0x5e'),_0x43c572['basename']||_0x43c572[_0x7562('0x2a')],_0x43c572[_0x7562('0x55')][_0x7562('0x5f')]()));}})['catch'](handleError(_0x46e7fc,null));};
\ No newline at end of file
index 6cd808c..ba2527d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce97=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x284609,_0x386b54){var _0x55116b=function(_0x3cdc4e){while(--_0x3cdc4e){_0x284609['push'](_0x284609['shift']());}};_0x55116b(++_0x386b54);}(_0xce97,0x118));var _0x7ce9=function(_0x10c680,_0x50c234){_0x10c680=_0x10c680-0x0;var _0x399c3b=_0xce97[_0x10c680];return _0x399c3b;};'use strict';var _=require(_0x7ce9('0x0'));var util=require(_0x7ce9('0x1'));var logger=require(_0x7ce9('0x2'))(_0x7ce9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7ce9('0x4'));var fs=require('fs');var path=require(_0x7ce9('0x5'));var rimraf=require(_0x7ce9('0x6'));var config=require(_0x7ce9('0x7'));var attributes=require(_0x7ce9('0x8'));module[_0x7ce9('0x9')]=function(_0x4f2ef7,_0x5a7d79){return _0x4f2ef7[_0x7ce9('0xa')](_0x7ce9('0xb'),attributes,{'tableName':_0x7ce9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x67bb=['bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x5e8602,_0x2ce012){var _0x4434fb=function(_0x5ea1cb){while(--_0x5ea1cb){_0x5e8602['push'](_0x5e8602['shift']());}};_0x4434fb(++_0x2ce012);}(_0x67bb,0xa3));var _0xb67b=function(_0x479218,_0x4ebc6a){_0x479218=_0x479218-0x0;var _0x5f0a39=_0x67bb[_0x479218];return _0x5f0a39;};'use strict';var _=require(_0xb67b('0x0'));var util=require(_0xb67b('0x1'));var logger=require(_0xb67b('0x2'))(_0xb67b('0x3'));var moment=require(_0xb67b('0x4'));var BPromise=require(_0xb67b('0x5'));var rp=require(_0xb67b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb67b('0x7'));var config=require(_0xb67b('0x8'));var attributes=require(_0xb67b('0x9'));module[_0xb67b('0xa')]=function(_0xbb344d,_0x4a0e40){return _0xbb344d[_0xb67b('0xb')](_0xb67b('0xc'),attributes,{'tableName':_0xb67b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5424b13..275f482 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5dc=['error','code','message','catch','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0xc5dc,0xc2));var _0xcc5d=function(_0x3dbec3,_0x4e4b3b){_0x3dbec3=_0x3dbec3-0x0;var _0x61a2ec=_0xc5dc[_0x3dbec3];return _0x61a2ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc5d('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcc5d('0x1'));var db=require(_0xcc5d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc5d('0x3'))('rpc');var config=require(_0xcc5d('0x4'));var jayson=require(_0xcc5d('0x5'));var client=jayson[_0xcc5d('0x6')][_0xcc5d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x176398,_0x3145db,_0x4ceb49){return new BPromise(function(_0x56ebc1,_0x2a8647){return client[_0xcc5d('0x8')](_0x176398,_0x4ceb49)['then'](function(_0x55b3fd){logger[_0xcc5d('0x9')](_0xcc5d('0xa'),_0x3145db,_0xcc5d('0xb'));logger[_0xcc5d('0xc')](_0xcc5d('0xd'),_0x3145db,'request\x20sent',JSON[_0xcc5d('0xe')](_0x55b3fd));if(_0x55b3fd[_0xcc5d('0xf')]){if(_0x55b3fd['error'][_0xcc5d('0x10')]===0x1f4){logger[_0xcc5d('0xf')](_0xcc5d('0xa'),_0x3145db,_0x55b3fd[_0xcc5d('0xf')][_0xcc5d('0x11')]);return _0x2a8647(_0x55b3fd[_0xcc5d('0xf')][_0xcc5d('0x11')]);}logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x3145db,_0x55b3fd[_0xcc5d('0xf')][_0xcc5d('0x11')]);return _0x56ebc1(_0x55b3fd[_0xcc5d('0xf')][_0xcc5d('0x11')]);}else{logger[_0xcc5d('0x9')](_0xcc5d('0xa'),_0x3145db,_0xcc5d('0xb'));_0x56ebc1(_0x55b3fd['result'][_0xcc5d('0x11')]);}})[_0xcc5d('0x12')](function(_0x1a9619){logger['error'](_0xcc5d('0xa'),_0x3145db,_0x1a9619);_0x2a8647(_0x1a9619);});});}
\ No newline at end of file
+var _0x6137=['message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x314dbf,_0x262af1){var _0x541e60=function(_0x56ad0d){while(--_0x56ad0d){_0x314dbf['push'](_0x314dbf['shift']());}};_0x541e60(++_0x262af1);}(_0x6137,0x11c));var _0x7613=function(_0x155c1b,_0x2bf8ef){_0x155c1b=_0x155c1b-0x0;var _0x1a0045=_0x6137[_0x155c1b];return _0x1a0045;};'use strict';var _=require(_0x7613('0x0'));var util=require('util');var moment=require(_0x7613('0x1'));var BPromise=require(_0x7613('0x2'));var rs=require(_0x7613('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7613('0x4'))['db'];var utils=require(_0x7613('0x5'));var logger=require(_0x7613('0x6'))('rpc');var config=require(_0x7613('0x7'));var jayson=require(_0x7613('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x283b3b,_0x1e07d0,_0x38bb53){return new BPromise(function(_0x236678,_0x3a6e13){return client['request'](_0x283b3b,_0x38bb53)[_0x7613('0x9')](function(_0x486862){logger[_0x7613('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e07d0,'request\x20sent');logger[_0x7613('0xb')](_0x7613('0xc'),_0x1e07d0,_0x7613('0xd'),JSON[_0x7613('0xe')](_0x486862));if(_0x486862['error']){if(_0x486862[_0x7613('0xf')]['code']===0x1f4){logger[_0x7613('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e07d0,_0x486862[_0x7613('0xf')][_0x7613('0x10')]);return _0x3a6e13(_0x486862[_0x7613('0xf')][_0x7613('0x10')]);}logger[_0x7613('0xf')](_0x7613('0x11'),_0x1e07d0,_0x486862[_0x7613('0xf')]['message']);return _0x236678(_0x486862[_0x7613('0xf')][_0x7613('0x10')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e07d0,_0x7613('0xd'));_0x236678(_0x486862[_0x7613('0x12')][_0x7613('0x10')]);}})[_0x7613('0x13')](function(_0x5b5485){logger['error'](_0x7613('0x11'),_0x1e07d0,_0x5b5485);_0x3a6e13(_0x5b5485);});});}
\ No newline at end of file
index dce0341..0b27378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x040d=['get','isAuthenticated','/:id','download','create','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x450eae,_0x2ad04d){var _0x2379d3=function(_0x4d7f9a){while(--_0x4d7f9a){_0x450eae['push'](_0x450eae['shift']());}};_0x2379d3(++_0x2ad04d);}(_0x040d,0xd5));var _0xd040=function(_0x1b2bd2,_0x491f68){_0x1b2bd2=_0x1b2bd2-0x0;var _0x34a271=_0x040d[_0x1b2bd2];return _0x34a271;};'use strict';var multer=require('multer');var util=require(_0xd040('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd040('0x1'));var router=express[_0xd040('0x2')]();var fs_extra=require(_0xd040('0x3'));var auth=require(_0xd040('0x4'));var interaction=require(_0xd040('0x5'));var config=require(_0xd040('0x6'));var controller=require(_0xd040('0x7'));router[_0xd040('0x8')]('/',auth[_0xd040('0x9')](),controller['index']);router[_0xd040('0x8')](_0xd040('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd040('0x8')]('/:id/download',auth[_0xd040('0x9')](),controller[_0xd040('0xb')]);router['post']('/',auth[_0xd040('0x9')](),controller[_0xd040('0xc')]);router[_0xd040('0xd')]('/:id',auth[_0xd040('0x9')](),controller[_0xd040('0xe')]);router[_0xd040('0xf')](_0xd040('0xa'),auth[_0xd040('0x9')](),controller[_0xd040('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xadf2=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x39ad32,_0x2a822d){var _0x12d60b=function(_0x167ad3){while(--_0x167ad3){_0x39ad32['push'](_0x39ad32['shift']());}};_0x12d60b(++_0x2a822d);}(_0xadf2,0x146));var _0x2adf=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0xadf2[_0x1203f];return _0x365f0a;};'use strict';var multer=require(_0x2adf('0x0'));var util=require(_0x2adf('0x1'));var path=require(_0x2adf('0x2'));var timeout=require(_0x2adf('0x3'));var express=require(_0x2adf('0x4'));var router=express[_0x2adf('0x5')]();var fs_extra=require(_0x2adf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2adf('0x7'));var config=require(_0x2adf('0x8'));var controller=require(_0x2adf('0x9'));router[_0x2adf('0xa')]('/',auth[_0x2adf('0xb')](),controller[_0x2adf('0xc')]);router[_0x2adf('0xa')](_0x2adf('0xd'),auth['isAuthenticated'](),controller[_0x2adf('0xe')]);router[_0x2adf('0xa')](_0x2adf('0xf'),auth[_0x2adf('0xb')](),controller[_0x2adf('0x10')]);router[_0x2adf('0x11')]('/',auth[_0x2adf('0xb')](),controller['create']);router[_0x2adf('0x12')](_0x2adf('0xd'),auth['isAuthenticated'](),controller[_0x2adf('0x13')]);router['delete'](_0x2adf('0xd'),auth[_0x2adf('0xb')](),controller[_0x2adf('0x14')]);module[_0x2adf('0x15')]=router;
\ No newline at end of file
index b286619..c6a5443 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc53a=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x1a3689,_0x3d233f){var _0xc59e17=function(_0x1b2293){while(--_0x1b2293){_0x1a3689['push'](_0x1a3689['shift']());}};_0xc59e17(++_0x3d233f);}(_0xc53a,0xaf));var _0xac53=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc53a[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xac53('0x0'));module[_0xac53('0x1')]={'field':{'type':Sequelize[_0xac53('0x2')]},'alias':{'type':Sequelize[_0xac53('0x3')]},'function':{'type':Sequelize[_0xac53('0x3')]},'format':{'type':Sequelize[_0xac53('0x3')]},'groupBy':{'type':Sequelize[_0xac53('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xac53('0x3')]},'custom':{'type':Sequelize[_0xac53('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x48e8=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0xc25da0,_0x1949b6){var _0x20fb4c=function(_0x2d72fc){while(--_0x2d72fc){_0xc25da0['push'](_0xc25da0['shift']());}};_0x20fb4c(++_0x1949b6);}(_0x48e8,0x153));var _0x848e=function(_0x1bd4a7,_0x5a27b8){_0x1bd4a7=_0x1bd4a7-0x0;var _0x524a91=_0x48e8[_0x1bd4a7];return _0x524a91;};'use strict';var Sequelize=require(_0x848e('0x0'));module[_0x848e('0x1')]={'field':{'type':Sequelize[_0x848e('0x2')]},'alias':{'type':Sequelize[_0x848e('0x3')]},'function':{'type':Sequelize[_0x848e('0x3')]},'format':{'type':Sequelize[_0x848e('0x3')]},'groupBy':{'type':Sequelize[_0x848e('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x848e('0x4')],'defaultValue':![]}};
\ No newline at end of file
index a15a28f..594367d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe65a=['attributes','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','options','include','params','fields','includeAll','find','catch','body','bulkCreate','addFields','AnalyticCustomReport','findOne','sequelize','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe65a,0x148));var _0xae65=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xe65a[_0x5cb1af];return _0x8d7940;};'use strict';var emlformat=require(_0xae65('0x0'));var rimraf=require(_0xae65('0x1'));var zipdir=require(_0xae65('0x2'));var jsonpatch=require(_0xae65('0x3'));var rp=require('request-promise');var moment=require(_0xae65('0x4'));var BPromise=require(_0xae65('0x5'));var Mustache=require(_0xae65('0x6'));var util=require(_0xae65('0x7'));var path=require(_0xae65('0x8'));var sox=require(_0xae65('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae65('0xa'));var _=require('lodash');var squel=require(_0xae65('0xb'));var crypto=require(_0xae65('0xc'));var jsforce=require(_0xae65('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xae65('0xe'));var querystring=require(_0xae65('0xf'));var Papa=require('papaparse');var Redis=require(_0xae65('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xae65('0x11'));var as=require(_0xae65('0x12'));var hardwareService=require(_0xae65('0x13'));var logger=require(_0xae65('0x14'))('api');var utils=require(_0xae65('0x15'));var config=require(_0xae65('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38f7f7,_0x220468){_0x220468=_0x220468||0xcc;return function(_0x395ca0){if(_0x395ca0){return _0x38f7f7[_0xae65('0x17')](_0x220468);}return _0x38f7f7[_0xae65('0x18')](_0x220468)[_0xae65('0x19')]();};}function respondWithResult(_0x4b64fd,_0xe9a53d){_0xe9a53d=_0xe9a53d||0xc8;return function(_0x2c58d5){if(_0x2c58d5){return _0x4b64fd[_0xae65('0x18')](_0xe9a53d)[_0xae65('0x1a')](_0x2c58d5);}};}function respondWithFilteredResult(_0x39cde1,_0x4e0040){return function(_0x2308b3){if(_0x2308b3){var _0x3a5b0d=typeof _0x4e0040[_0xae65('0x1b')]===_0xae65('0x1c')&&typeof _0x4e0040['limit']==='undefined';var _0x4f992e=_0x2308b3[_0xae65('0x1d')];var _0x249f60=_0x3a5b0d?0x0:_0x4e0040[_0xae65('0x1b')];var _0x4a26ec=_0x3a5b0d?_0x2308b3[_0xae65('0x1d')]:_0x4e0040['offset']+_0x4e0040['limit'];var _0x5e6e4d;if(_0x4a26ec>=_0x4f992e){_0x4a26ec=_0x4f992e;_0x5e6e4d=0xc8;}else{_0x5e6e4d=0xce;}_0x39cde1['status'](_0x5e6e4d);return _0x39cde1['set'](_0xae65('0x1e'),_0x249f60+'-'+_0x4a26ec+'/'+_0x4f992e)[_0xae65('0x1a')](_0x2308b3);}return null;};}function patchUpdates(_0x317791){return function(_0x19ceb8){try{jsonpatch[_0xae65('0x1f')](_0x19ceb8,_0x317791,!![]);}catch(_0x44c252){return BPromise[_0xae65('0x20')](_0x44c252);}return _0x19ceb8[_0xae65('0x21')]();};}function saveUpdates(_0x4ea83b,_0x143891){return function(_0x16cf17){if(_0x16cf17){return _0x16cf17[_0xae65('0x22')](_0x4ea83b)[_0xae65('0x23')](function(_0x2fb670){return _0x2fb670;});}return null;};}function removeEntity(_0x15deea,_0x1c1840){return function(_0x203d76){if(_0x203d76){return _0x203d76[_0xae65('0x24')]()['then'](function(){_0x15deea[_0xae65('0x18')](0xcc)[_0xae65('0x19')]();});}};}function handleEntityNotFound(_0x34c667,_0x33574a){return function(_0x5c0720){if(!_0x5c0720){_0x34c667[_0xae65('0x17')](0x194);}return _0x5c0720;};}function handleError(_0x1f8f39,_0x2aad67){_0x2aad67=_0x2aad67||0x1f4;return function(_0x97a75b){logger[_0xae65('0x25')](_0x97a75b[_0xae65('0x26')]);if(_0x97a75b['name']){delete _0x97a75b['name'];}_0x1f8f39[_0xae65('0x18')](_0x2aad67)[_0xae65('0x27')](_0x97a75b);};}exports[_0xae65('0x28')]=function(_0x3b6106,_0x15e904){var _0x2a6dcb={},_0x2af31e={},_0x38f57b={'count':0x0,'rows':[]};var _0x13ea04=_['map'](db[_0xae65('0x29')][_0xae65('0x2a')],function(_0x21601e){return{'name':_0x21601e[_0xae65('0x2b')],'type':_0x21601e[_0xae65('0x2c')]['key']};});_0x2af31e[_0xae65('0x2d')]=_[_0xae65('0x2e')](_0x13ea04,_0xae65('0x2f'));_0x2af31e[_0xae65('0x30')]=_[_0xae65('0x31')](_0x3b6106[_0xae65('0x30')]);_0x2af31e[_0xae65('0x32')]=_[_0xae65('0x33')](_0x2af31e[_0xae65('0x2d')],_0x2af31e[_0xae65('0x30')]);_0x2a6dcb['attributes']=_['intersection'](_0x2af31e[_0xae65('0x2d')],qs['fields'](_0x3b6106['query']['fields']));_0x2a6dcb[_0xae65('0x34')]=_0x2a6dcb[_0xae65('0x34')][_0xae65('0x35')]?_0x2a6dcb[_0xae65('0x34')]:_0x2af31e[_0xae65('0x2d')];if(!_0x3b6106[_0xae65('0x30')][_0xae65('0x36')]('nolimit')){_0x2a6dcb[_0xae65('0x37')]=qs[_0xae65('0x37')](_0x3b6106[_0xae65('0x30')][_0xae65('0x37')]);_0x2a6dcb[_0xae65('0x1b')]=qs['offset'](_0x3b6106['query'][_0xae65('0x1b')]);}_0x2a6dcb[_0xae65('0x38')]=qs['sort'](_0x3b6106[_0xae65('0x30')][_0xae65('0x39')]);_0x2a6dcb['where']=qs[_0xae65('0x32')](_['pick'](_0x3b6106[_0xae65('0x30')],_0x2af31e[_0xae65('0x32')]),_0x13ea04);if(_0x3b6106[_0xae65('0x30')][_0xae65('0x3a')]){_0x2a6dcb[_0xae65('0x3b')]=_[_0xae65('0x3c')](_0x2a6dcb[_0xae65('0x3b')],{'$or':_[_0xae65('0x2e')](_0x13ea04,function(_0x397f36){if(_0x397f36['type']!==_0xae65('0x3d')){var _0x26c648={};_0x26c648[_0x397f36[_0xae65('0x2f')]]={'$like':'%'+_0x3b6106['query'][_0xae65('0x3a')]+'%'};return _0x26c648;}})});}_0x2a6dcb=_[_0xae65('0x3c')]({},_0x2a6dcb,_0x3b6106[_0xae65('0x3e')]);var _0x4b297c={'where':_0x2a6dcb[_0xae65('0x3b')]};return db[_0xae65('0x29')]['count'](_0x4b297c)[_0xae65('0x23')](function(_0x4c5bcb){_0x38f57b[_0xae65('0x1d')]=_0x4c5bcb;if(_0x3b6106[_0xae65('0x30')]['includeAll']){_0x2a6dcb[_0xae65('0x3f')]=[{'all':!![]}];}return db[_0xae65('0x29')]['findAll'](_0x2a6dcb);})[_0xae65('0x23')](function(_0x38b9bb){_0x38f57b['rows']=_0x38b9bb;return _0x38f57b;})[_0xae65('0x23')](respondWithFilteredResult(_0x15e904,_0x2a6dcb))['catch'](handleError(_0x15e904,null));};exports['show']=function(_0x37b92b,_0x198e07){var _0x4b7f4c={'raw':![],'where':{'id':_0x37b92b[_0xae65('0x40')]['id']}},_0x4f5be1={};_0x4f5be1[_0xae65('0x2d')]=_[_0xae65('0x31')](db[_0xae65('0x29')]['rawAttributes']);_0x4f5be1['query']=_[_0xae65('0x31')](_0x37b92b[_0xae65('0x30')]);_0x4f5be1['filters']=_[_0xae65('0x33')](_0x4f5be1[_0xae65('0x2d')],_0x4f5be1['query']);_0x4b7f4c[_0xae65('0x34')]=_[_0xae65('0x33')](_0x4f5be1['model'],qs[_0xae65('0x41')](_0x37b92b[_0xae65('0x30')][_0xae65('0x41')]));_0x4b7f4c[_0xae65('0x34')]=_0x4b7f4c[_0xae65('0x34')]['length']?_0x4b7f4c['attributes']:_0x4f5be1['model'];if(_0x37b92b['query'][_0xae65('0x42')]){_0x4b7f4c[_0xae65('0x3f')]=[{'all':!![]}];}_0x4b7f4c=_[_0xae65('0x3c')]({},_0x4b7f4c,_0x37b92b[_0xae65('0x3e')]);return db[_0xae65('0x29')][_0xae65('0x43')](_0x4b7f4c)['then'](handleEntityNotFound(_0x198e07,null))['then'](respondWithResult(_0x198e07,null))[_0xae65('0x44')](handleError(_0x198e07,null));};exports['create']=function(_0x221b46,_0x49179d){return db['AnalyticFieldReport']['create'](_0x221b46[_0xae65('0x45')],{})['then'](respondWithResult(_0x49179d,0xc9))['catch'](handleError(_0x49179d,null));};exports[_0xae65('0x46')]=function(_0x40660d,_0x32de81){return db['AnalyticFieldReport'][_0xae65('0x46')](_0x40660d[_0xae65('0x45')],{'raw':![],'individualHooks':!![]})[_0xae65('0x23')](respondWithResult(_0x32de81,0xc9))[_0xae65('0x44')](handleError(_0x32de81,null));};exports[_0xae65('0x22')]=function(_0x11f5d1,_0x3c87c8){if(_0x11f5d1['body']['id']){delete _0x11f5d1['body']['id'];}return db[_0xae65('0x29')][_0xae65('0x43')]({'where':{'id':_0x11f5d1[_0xae65('0x40')]['id']}})[_0xae65('0x23')](handleEntityNotFound(_0x3c87c8,null))['then'](saveUpdates(_0x11f5d1[_0xae65('0x45')],null))['then'](respondWithResult(_0x3c87c8,null))[_0xae65('0x44')](handleError(_0x3c87c8,null));};exports[_0xae65('0x24')]=function(_0x5e88d6,_0x10beca){return db['AnalyticFieldReport'][_0xae65('0x43')]({'where':{'id':_0x5e88d6[_0xae65('0x40')]['id']}})[_0xae65('0x23')](handleEntityNotFound(_0x10beca,null))[_0xae65('0x23')](removeEntity(_0x10beca,null))['catch'](handleError(_0x10beca,null));};exports['bulkDestroy']=function(_0x5a2346,_0x182e58){return db[_0xae65('0x29')]['destroy']({'where':{'id':_0x5a2346['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xae65('0x23')](respondWithResult(_0x182e58,0xcc))[_0xae65('0x44')](handleError(_0x182e58,null));};exports[_0xae65('0x47')]=function(_0x1c1206,_0x3bd0c9,_0xb43654){return db[_0xae65('0x48')][_0xae65('0x49')]({'where':{'id':_0x1c1206[_0xae65('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bd0c9,null))[_0xae65('0x23')](function(_0x1650f0){if(_0x1650f0){return db[_0xae65('0x4a')]['transaction'](function(_0x34c1dd){return db['AnalyticFieldReport'][_0xae65('0x24')]({'where':{'CustomReportId':_0x1c1206[_0xae65('0x40')]['id']},'transaction':_0x34c1dd})[_0xae65('0x23')](function(_0x1cccde){var _0xe72154=_[_0xae65('0x2e')](_0x1c1206['body'],function(_0x2f0390){delete _0x2f0390['id'];_0x2f0390['CustomReportId']=_0x1c1206['params']['id'];return _0x2f0390;});return db[_0xae65('0x29')][_0xae65('0x46')](_0xe72154,{'transaction':_0x34c1dd});});})[_0xae65('0x23')](function(){return db[_0xae65('0x29')][_0xae65('0x4b')]({'where':{'CustomReportId':_0x1c1206[_0xae65('0x40')]['id']}});});}})[_0xae65('0x23')](respondWithResult(_0x3bd0c9,null))[_0xae65('0x44')](handleError(_0x3bd0c9,null));};
\ No newline at end of file
+var _0xd667=['offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','bulkCreate','body','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x21e646,_0x5944f9){var _0x4f02ae=function(_0x1456a7){while(--_0x1456a7){_0x21e646['push'](_0x21e646['shift']());}};_0x4f02ae(++_0x5944f9);}(_0xd667,0x120));var _0x7d66=function(_0x50b02a,_0x57dd42){_0x50b02a=_0x50b02a-0x0;var _0x279b52=_0xd667[_0x50b02a];return _0x279b52;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7d66('0x0'));var rp=require('request-promise');var moment=require(_0x7d66('0x1'));var BPromise=require(_0x7d66('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d66('0x3'));var sox=require(_0x7d66('0x4'));var csv=require(_0x7d66('0x5'));var ejs=require(_0x7d66('0x6'));var fs=require('fs');var fs_extra=require(_0x7d66('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d66('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7d66('0x9'));var toCsv=require(_0x7d66('0x5'));var querystring=require('querystring');var Papa=require(_0x7d66('0xa'));var Redis=require(_0x7d66('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x7d66('0xc'));var as=require(_0x7d66('0xd'));var hardwareService=require(_0x7d66('0xe'));var logger=require(_0x7d66('0xf'))(_0x7d66('0x10'));var utils=require(_0x7d66('0x11'));var config=require(_0x7d66('0x12'));var licenseUtil=require(_0x7d66('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dd3d5,_0x12a28e){_0x12a28e=_0x12a28e||0xcc;return function(_0x930bf6){if(_0x930bf6){return _0x5dd3d5[_0x7d66('0x14')](_0x12a28e);}return _0x5dd3d5[_0x7d66('0x15')](_0x12a28e)[_0x7d66('0x16')]();};}function respondWithResult(_0x33edb2,_0xc09fd8){_0xc09fd8=_0xc09fd8||0xc8;return function(_0x206a8a){if(_0x206a8a){return _0x33edb2[_0x7d66('0x15')](_0xc09fd8)[_0x7d66('0x17')](_0x206a8a);}};}function respondWithFilteredResult(_0x101cc2,_0x40e732){return function(_0x4f6df2){if(_0x4f6df2){var _0x488cfa=typeof _0x40e732[_0x7d66('0x18')]===_0x7d66('0x19')&&typeof _0x40e732[_0x7d66('0x1a')]===_0x7d66('0x19');var _0x4d24c9=_0x4f6df2[_0x7d66('0x1b')];var _0x3ecb0e=_0x488cfa?0x0:_0x40e732[_0x7d66('0x18')];var _0x42552f=_0x488cfa?_0x4f6df2[_0x7d66('0x1b')]:_0x40e732[_0x7d66('0x18')]+_0x40e732[_0x7d66('0x1a')];var _0x484dc1;if(_0x42552f>=_0x4d24c9){_0x42552f=_0x4d24c9;_0x484dc1=0xc8;}else{_0x484dc1=0xce;}_0x101cc2[_0x7d66('0x15')](_0x484dc1);return _0x101cc2['set']('Content-Range',_0x3ecb0e+'-'+_0x42552f+'/'+_0x4d24c9)['json'](_0x4f6df2);}return null;};}function patchUpdates(_0x49cf0c){return function(_0x4ffd30){try{jsonpatch[_0x7d66('0x1c')](_0x4ffd30,_0x49cf0c,!![]);}catch(_0x837ccb){return BPromise[_0x7d66('0x1d')](_0x837ccb);}return _0x4ffd30[_0x7d66('0x1e')]();};}function saveUpdates(_0x4e0e4d,_0x188a73){return function(_0x2acd0a){if(_0x2acd0a){return _0x2acd0a[_0x7d66('0x1f')](_0x4e0e4d)[_0x7d66('0x20')](function(_0x2108e6){return _0x2108e6;});}return null;};}function removeEntity(_0x2266a2,_0x33b801){return function(_0x13fb89){if(_0x13fb89){return _0x13fb89[_0x7d66('0x21')]()['then'](function(){_0x2266a2[_0x7d66('0x15')](0xcc)[_0x7d66('0x16')]();});}};}function handleEntityNotFound(_0x4d260e,_0xba0c53){return function(_0xff9ace){if(!_0xff9ace){_0x4d260e[_0x7d66('0x14')](0x194);}return _0xff9ace;};}function handleError(_0x714296,_0x30bb6f){_0x30bb6f=_0x30bb6f||0x1f4;return function(_0x1a8bef){logger[_0x7d66('0x22')](_0x1a8bef[_0x7d66('0x23')]);if(_0x1a8bef[_0x7d66('0x24')]){delete _0x1a8bef[_0x7d66('0x24')];}_0x714296[_0x7d66('0x15')](_0x30bb6f)[_0x7d66('0x25')](_0x1a8bef);};}exports[_0x7d66('0x26')]=function(_0xc7eb99,_0x3c6a20){var _0x4b5d9e={},_0xcb562d={},_0x31c460={'count':0x0,'rows':[]};var _0x2740b1=_[_0x7d66('0x27')](db[_0x7d66('0x28')][_0x7d66('0x29')],function(_0x7e4369){return{'name':_0x7e4369['fieldName'],'type':_0x7e4369[_0x7d66('0x2a')][_0x7d66('0x2b')]};});_0xcb562d['model']=_[_0x7d66('0x27')](_0x2740b1,_0x7d66('0x24'));_0xcb562d[_0x7d66('0x2c')]=_[_0x7d66('0x2d')](_0xc7eb99[_0x7d66('0x2c')]);_0xcb562d[_0x7d66('0x2e')]=_[_0x7d66('0x2f')](_0xcb562d[_0x7d66('0x30')],_0xcb562d[_0x7d66('0x2c')]);_0x4b5d9e['attributes']=_[_0x7d66('0x2f')](_0xcb562d[_0x7d66('0x30')],qs[_0x7d66('0x31')](_0xc7eb99['query'][_0x7d66('0x31')]));_0x4b5d9e[_0x7d66('0x32')]=_0x4b5d9e[_0x7d66('0x32')][_0x7d66('0x33')]?_0x4b5d9e['attributes']:_0xcb562d[_0x7d66('0x30')];if(!_0xc7eb99[_0x7d66('0x2c')][_0x7d66('0x34')](_0x7d66('0x35'))){_0x4b5d9e[_0x7d66('0x1a')]=qs[_0x7d66('0x1a')](_0xc7eb99[_0x7d66('0x2c')][_0x7d66('0x1a')]);_0x4b5d9e[_0x7d66('0x18')]=qs['offset'](_0xc7eb99['query'][_0x7d66('0x18')]);}_0x4b5d9e[_0x7d66('0x36')]=qs[_0x7d66('0x37')](_0xc7eb99[_0x7d66('0x2c')]['sort']);_0x4b5d9e[_0x7d66('0x38')]=qs[_0x7d66('0x2e')](_[_0x7d66('0x39')](_0xc7eb99[_0x7d66('0x2c')],_0xcb562d[_0x7d66('0x2e')]),_0x2740b1);if(_0xc7eb99[_0x7d66('0x2c')][_0x7d66('0x3a')]){_0x4b5d9e['where']=_[_0x7d66('0x3b')](_0x4b5d9e['where'],{'$or':_[_0x7d66('0x27')](_0x2740b1,function(_0x36b8ec){if(_0x36b8ec['type']!=='VIRTUAL'){var _0x50e6c2={};_0x50e6c2[_0x36b8ec['name']]={'$like':'%'+_0xc7eb99[_0x7d66('0x2c')]['filter']+'%'};return _0x50e6c2;}})});}_0x4b5d9e=_[_0x7d66('0x3b')]({},_0x4b5d9e,_0xc7eb99['options']);var _0x1b6fa2={'where':_0x4b5d9e[_0x7d66('0x38')]};return db[_0x7d66('0x28')][_0x7d66('0x1b')](_0x1b6fa2)[_0x7d66('0x20')](function(_0x2063f3){_0x31c460['count']=_0x2063f3;if(_0xc7eb99['query'][_0x7d66('0x3c')]){_0x4b5d9e[_0x7d66('0x3d')]=[{'all':!![]}];}return db[_0x7d66('0x28')][_0x7d66('0x3e')](_0x4b5d9e);})[_0x7d66('0x20')](function(_0x501dd1){_0x31c460[_0x7d66('0x3f')]=_0x501dd1;return _0x31c460;})[_0x7d66('0x20')](respondWithFilteredResult(_0x3c6a20,_0x4b5d9e))[_0x7d66('0x40')](handleError(_0x3c6a20,null));};exports[_0x7d66('0x41')]=function(_0x113ec3,_0x244943){var _0x2cd77f={'raw':![],'where':{'id':_0x113ec3[_0x7d66('0x42')]['id']}},_0x35e463={};_0x35e463[_0x7d66('0x30')]=_[_0x7d66('0x2d')](db[_0x7d66('0x28')][_0x7d66('0x29')]);_0x35e463['query']=_[_0x7d66('0x2d')](_0x113ec3[_0x7d66('0x2c')]);_0x35e463[_0x7d66('0x2e')]=_['intersection'](_0x35e463[_0x7d66('0x30')],_0x35e463[_0x7d66('0x2c')]);_0x2cd77f[_0x7d66('0x32')]=_[_0x7d66('0x2f')](_0x35e463[_0x7d66('0x30')],qs[_0x7d66('0x31')](_0x113ec3[_0x7d66('0x2c')]['fields']));_0x2cd77f[_0x7d66('0x32')]=_0x2cd77f['attributes'][_0x7d66('0x33')]?_0x2cd77f[_0x7d66('0x32')]:_0x35e463[_0x7d66('0x30')];if(_0x113ec3['query']['includeAll']){_0x2cd77f[_0x7d66('0x3d')]=[{'all':!![]}];}_0x2cd77f=_[_0x7d66('0x3b')]({},_0x2cd77f,_0x113ec3['options']);return db[_0x7d66('0x28')][_0x7d66('0x43')](_0x2cd77f)[_0x7d66('0x20')](handleEntityNotFound(_0x244943,null))[_0x7d66('0x20')](respondWithResult(_0x244943,null))[_0x7d66('0x40')](handleError(_0x244943,null));};exports[_0x7d66('0x44')]=function(_0x5bbebc,_0x2f009c){return db['AnalyticFieldReport'][_0x7d66('0x44')](_0x5bbebc['body'],{})[_0x7d66('0x20')](respondWithResult(_0x2f009c,0xc9))[_0x7d66('0x40')](handleError(_0x2f009c,null));};exports[_0x7d66('0x45')]=function(_0x247c1a,_0x570090){return db[_0x7d66('0x28')][_0x7d66('0x45')](_0x247c1a[_0x7d66('0x46')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x570090,0xc9))[_0x7d66('0x40')](handleError(_0x570090,null));};exports['update']=function(_0xa67852,_0x193de4){if(_0xa67852[_0x7d66('0x46')]['id']){delete _0xa67852[_0x7d66('0x46')]['id'];}return db[_0x7d66('0x28')][_0x7d66('0x43')]({'where':{'id':_0xa67852[_0x7d66('0x42')]['id']}})[_0x7d66('0x20')](handleEntityNotFound(_0x193de4,null))[_0x7d66('0x20')](saveUpdates(_0xa67852[_0x7d66('0x46')],null))[_0x7d66('0x20')](respondWithResult(_0x193de4,null))['catch'](handleError(_0x193de4,null));};exports['destroy']=function(_0x26a462,_0x31b571){return db[_0x7d66('0x28')][_0x7d66('0x43')]({'where':{'id':_0x26a462['params']['id']}})[_0x7d66('0x20')](handleEntityNotFound(_0x31b571,null))[_0x7d66('0x20')](removeEntity(_0x31b571,null))['catch'](handleError(_0x31b571,null));};exports['bulkDestroy']=function(_0xa4e141,_0x1db0ad){return db['AnalyticFieldReport'][_0x7d66('0x21')]({'where':{'id':_0xa4e141[_0x7d66('0x2c')][_0x7d66('0x47')]||[]},'raw':![],'individualHooks':!![]})[_0x7d66('0x20')](respondWithResult(_0x1db0ad,0xcc))['catch'](handleError(_0x1db0ad,null));};exports[_0x7d66('0x48')]=function(_0x4e9674,_0x226734,_0x19e780){return db[_0x7d66('0x49')][_0x7d66('0x4a')]({'where':{'id':_0x4e9674[_0x7d66('0x42')]['id']}})['then'](handleEntityNotFound(_0x226734,null))['then'](function(_0x4320eb){if(_0x4320eb){return db[_0x7d66('0x4b')][_0x7d66('0x4c')](function(_0x32b3f3){return db['AnalyticFieldReport'][_0x7d66('0x21')]({'where':{'CustomReportId':_0x4e9674[_0x7d66('0x42')]['id']},'transaction':_0x32b3f3})[_0x7d66('0x20')](function(_0x4b673c){var _0x4646e8=_[_0x7d66('0x27')](_0x4e9674[_0x7d66('0x46')],function(_0x1fc058){delete _0x1fc058['id'];_0x1fc058[_0x7d66('0x4d')]=_0x4e9674[_0x7d66('0x42')]['id'];return _0x1fc058;});return db[_0x7d66('0x28')][_0x7d66('0x45')](_0x4646e8,{'transaction':_0x32b3f3});});})[_0x7d66('0x20')](function(){return db['AnalyticFieldReport'][_0x7d66('0x3e')]({'where':{'CustomReportId':_0x4e9674['params']['id']}});});}})[_0x7d66('0x20')](respondWithResult(_0x226734,null))['catch'](handleError(_0x226734,null));};
\ No newline at end of file
index bc8a4b3..ad3d41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5312=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger'];(function(_0xd98d94,_0x520f4a){var _0x1c4142=function(_0x58fa82){while(--_0x58fa82){_0xd98d94['push'](_0xd98d94['shift']());}};_0x1c4142(++_0x520f4a);}(_0x5312,0x186));var _0x2531=function(_0x32ae44,_0x52fe4d){_0x32ae44=_0x32ae44-0x0;var _0x5bac3f=_0x5312[_0x32ae44];return _0x5bac3f;};'use strict';var _=require('lodash');var util=require(_0x2531('0x0'));var logger=require(_0x2531('0x1'))(_0x2531('0x2'));var moment=require(_0x2531('0x3'));var BPromise=require(_0x2531('0x4'));var rp=require(_0x2531('0x5'));var fs=require('fs');var path=require(_0x2531('0x6'));var rimraf=require(_0x2531('0x7'));var config=require(_0x2531('0x8'));var attributes=require(_0x2531('0x9'));module[_0x2531('0xa')]=function(_0x324487,_0x53bb34){return _0x324487[_0x2531('0xb')](_0x2531('0xc'),attributes,{'tableName':_0x2531('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x938a=['exports','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x938a,0xb7));var _0xa938=function(_0x3e4584,_0x43afce){_0x3e4584=_0x3e4584-0x0;var _0x272f56=_0x938a[_0x3e4584];return _0x272f56;};'use strict';var _=require(_0xa938('0x0'));var util=require(_0xa938('0x1'));var logger=require('../../config/logger')(_0xa938('0x2'));var moment=require(_0xa938('0x3'));var BPromise=require(_0xa938('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa938('0x5'));var rimraf=require(_0xa938('0x6'));var config=require(_0xa938('0x7'));var attributes=require(_0xa938('0x8'));module[_0xa938('0x9')]=function(_0x30c7d8,_0x4f775f){return _0x30c7d8['define'](_0xa938('0xa'),attributes,{'tableName':_0xa938('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a8977da..90918dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f76=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5cabfd,_0x5dea47){var _0x4bc06c=function(_0x4a2fea){while(--_0x4a2fea){_0x5cabfd['push'](_0x5cabfd['shift']());}};_0x4bc06c(++_0x5dea47);}(_0x2f76,0x1f1));var _0x62f7=function(_0x2d9c96,_0x5b12f0){_0x2d9c96=_0x2d9c96-0x0;var _0x44bf16=_0x2f76[_0x2d9c96];return _0x44bf16;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x62f7('0x0'));var rs=require(_0x62f7('0x1'));var fs=require('fs');var Redis=require(_0x62f7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x62f7('0x3'));var logger=require(_0x62f7('0x4'))(_0x62f7('0x5'));var config=require(_0x62f7('0x6'));var jayson=require(_0x62f7('0x7'));var client=jayson[_0x62f7('0x8')][_0x62f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a09e3,_0x4adccc,_0x3cf3c1){return new BPromise(function(_0xf25145,_0x5b382d){return client[_0x62f7('0xa')](_0x1a09e3,_0x3cf3c1)[_0x62f7('0xb')](function(_0x4b830f){logger[_0x62f7('0xc')](_0x62f7('0xd'),_0x4adccc,'request\x20sent');logger[_0x62f7('0xe')](_0x62f7('0xf'),_0x4adccc,_0x62f7('0x10'),JSON[_0x62f7('0x11')](_0x4b830f));if(_0x4b830f[_0x62f7('0x12')]){if(_0x4b830f['error'][_0x62f7('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4adccc,_0x4b830f['error']['message']);return _0x5b382d(_0x4b830f['error'][_0x62f7('0x14')]);}logger[_0x62f7('0x12')](_0x62f7('0xd'),_0x4adccc,_0x4b830f['error'][_0x62f7('0x14')]);return _0xf25145(_0x4b830f['error']['message']);}else{logger[_0x62f7('0xc')](_0x62f7('0xd'),_0x4adccc,_0x62f7('0x10'));_0xf25145(_0x4b830f[_0x62f7('0x15')][_0x62f7('0x14')]);}})[_0x62f7('0x16')](function(_0x4cd60d){logger[_0x62f7('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4adccc,_0x4cd60d);_0x5b382d(_0x4cd60d);});});}
\ No newline at end of file
+var _0x4455=['AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x27cae0,_0xa9c427){var _0x1a3b1d=function(_0x4d2d55){while(--_0x4d2d55){_0x27cae0['push'](_0x27cae0['shift']());}};_0x1a3b1d(++_0xa9c427);}(_0x4455,0x14c));var _0x5445=function(_0x3eea25,_0x227322){_0x3eea25=_0x3eea25-0x0;var _0x377094=_0x4455[_0x3eea25];return _0x377094;};'use strict';var _=require(_0x5445('0x0'));var util=require(_0x5445('0x1'));var moment=require(_0x5445('0x2'));var BPromise=require(_0x5445('0x3'));var rs=require(_0x5445('0x4'));var fs=require('fs');var Redis=require(_0x5445('0x5'));var db=require(_0x5445('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5445('0x7'))('rpc');var config=require(_0x5445('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5445('0x9')][_0x5445('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dded8,_0x451cdb,_0x52f3d7){return new BPromise(function(_0x27ec2f,_0x227c64){return client['request'](_0x2dded8,_0x52f3d7)[_0x5445('0xb')](function(_0x92f20d){logger[_0x5445('0xc')](_0x5445('0xd'),_0x451cdb,'request\x20sent');logger[_0x5445('0xe')](_0x5445('0xf'),_0x451cdb,_0x5445('0x10'),JSON[_0x5445('0x11')](_0x92f20d));if(_0x92f20d[_0x5445('0x12')]){if(_0x92f20d[_0x5445('0x12')][_0x5445('0x13')]===0x1f4){logger['error'](_0x5445('0xd'),_0x451cdb,_0x92f20d[_0x5445('0x12')][_0x5445('0x14')]);return _0x227c64(_0x92f20d[_0x5445('0x12')][_0x5445('0x14')]);}logger[_0x5445('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x451cdb,_0x92f20d[_0x5445('0x12')][_0x5445('0x14')]);return _0x27ec2f(_0x92f20d[_0x5445('0x12')][_0x5445('0x14')]);}else{logger[_0x5445('0xc')](_0x5445('0xd'),_0x451cdb,'request\x20sent');_0x27ec2f(_0x92f20d[_0x5445('0x15')]['message']);}})[_0x5445('0x16')](function(_0x31f000){logger[_0x5445('0x12')](_0x5445('0xd'),_0x451cdb,_0x31f000);_0x227c64(_0x31f000);});});}
\ No newline at end of file
index 5155407..65574fe 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(_0x1d3215,_0x55184b){var _0x591f69=function(_0x41a9cb){while(--_0x41a9cb){_0x1d3215['push'](_0x1d3215['shift']());}};_0x591f69(++_0x55184b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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(_0x558f07,_0x112aec){var _0x5a4eb6=function(_0x460258){while(--_0x460258){_0x558f07['push'](_0x558f07['shift']());}};_0x5a4eb6(++_0x112aec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 ac6bf7d..d4d8c2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x705f=['TEXT','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x705f,0x75));var _0xf705=function(_0x3720d1,_0x968d8b){_0x3720d1=_0x3720d1-0x0;var _0x14a1e8=_0x705f[_0x3720d1];return _0x14a1e8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf705('0x0')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xf705('0x0')]},'metric':{'type':Sequelize[_0xf705('0x1')]},'description':{'type':Sequelize[_0xf705('0x0')]}};
\ No newline at end of file
+var _0x438a=['sequelize','exports','STRING','name','TEXT'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x438a,0x18b));var _0xa438=function(_0x25dc04,_0x2acf53){_0x25dc04=_0x25dc04-0x0;var _0xfbbf59=_0x438a[_0x25dc04];return _0xfbbf59;};'use strict';var Sequelize=require(_0xa438('0x0'));module[_0xa438('0x1')]={'name':{'type':Sequelize[_0xa438('0x2')],'allowNull':![],'unique':_0xa438('0x3')},'table':{'type':Sequelize[_0xa438('0x2')]},'metric':{'type':Sequelize[_0xa438('0x4')]},'description':{'type':Sequelize[_0xa438('0x2')]}};
\ No newline at end of file
index d53a416..86c095e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0x207301,_0x235203){var _0x10be14=function(_0x203ac4){while(--_0x203ac4){_0x207301['push'](_0x207301['shift']());}};_0x10be14(++_0x235203);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x35c2e7,_0x4071cc){_0x35c2e7=_0x35c2e7-0x0;var _0x211088=_0x8d0e[_0x35c2e7];return _0x211088;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
+var _0x00bb=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','undefined','limit','offset','apply','reject','update','destroy','get','Metrics','then','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','find'];(function(_0x111455,_0x274b6e){var _0x54e83d=function(_0x2ee37a){while(--_0x2ee37a){_0x111455['push'](_0x111455['shift']());}};_0x54e83d(++_0x274b6e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x00bb[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];function respondWithStatusCode(_0x2d8ddf,_0x1be8aa){_0x1be8aa=_0x1be8aa||0xcc;return function(_0x466b9b){if(_0x466b9b){return _0x2d8ddf[_0xb00b('0x15')](_0x1be8aa);}return _0x2d8ddf[_0xb00b('0x16')](_0x1be8aa)['end']();};}function respondWithResult(_0x218de2,_0xb0d42e){_0xb0d42e=_0xb0d42e||0xc8;return function(_0x482fe6){if(_0x482fe6){return _0x218de2[_0xb00b('0x16')](_0xb0d42e)[_0xb00b('0x17')](_0x482fe6);}};}function respondWithFilteredResult(_0x540b79,_0x5da36b){return function(_0x9b471e){if(_0x9b471e){var _0x4dcd45=typeof _0x5da36b['offset']===_0xb00b('0x18')&&typeof _0x5da36b[_0xb00b('0x19')]===_0xb00b('0x18');var _0xbb72fc=_0x9b471e['count'];var _0x2a7231=_0x4dcd45?0x0:_0x5da36b['offset'];var _0x415f91=_0x4dcd45?_0x9b471e['count']:_0x5da36b[_0xb00b('0x1a')]+_0x5da36b['limit'];var _0xb26ebb;if(_0x415f91>=_0xbb72fc){_0x415f91=_0xbb72fc;_0xb26ebb=0xc8;}else{_0xb26ebb=0xce;}_0x540b79[_0xb00b('0x16')](_0xb26ebb);return _0x540b79['set']('Content-Range',_0x2a7231+'-'+_0x415f91+'/'+_0xbb72fc)[_0xb00b('0x17')](_0x9b471e);}return null;};}function patchUpdates(_0x4a334b){return function(_0x1344c4){try{jsonpatch[_0xb00b('0x1b')](_0x1344c4,_0x4a334b,!![]);}catch(_0x2fe48d){return BPromise[_0xb00b('0x1c')](_0x2fe48d);}return _0x1344c4['save']();};}function saveUpdates(_0x362ee0,_0x4df284){return function(_0x25a973){if(_0x25a973){return _0x25a973[_0xb00b('0x1d')](_0x362ee0)['then'](function(_0x231293){return _0x231293;});}return null;};}function removeEntity(_0x2896d1,_0x520444){return function(_0x3ab3cc){if(_0x3ab3cc){return _0x3ab3cc[_0xb00b('0x1e')]()['then'](function(){var _0x44efe5=_0x3ab3cc[_0xb00b('0x1f')]({'plain':!![]});var _0x3c9500=_0xb00b('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0x3c9500,'resourceId':_0x44efe5['id']}})[_0xb00b('0x21')](function(){return _0x3ab3cc;});})['then'](function(){_0x2896d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ac55,_0x73b6b0){return function(_0x2592cf){if(!_0x2592cf){_0x16ac55[_0xb00b('0x15')](0x194);}return _0x2592cf;};}function handleError(_0x1f14fa,_0x197379){_0x197379=_0x197379||0x1f4;return function(_0x15d3b9){logger['error'](_0x15d3b9[_0xb00b('0x22')]);if(_0x15d3b9['name']){delete _0x15d3b9[_0xb00b('0x23')];}_0x1f14fa[_0xb00b('0x16')](_0x197379)[_0xb00b('0x24')](_0x15d3b9);};}exports['index']=function(_0x2fc11a,_0x280ed3){var _0x16fbd5={},_0x183233={},_0x303625={'count':0x0,'rows':[]};var _0x2b9824=_[_0xb00b('0x25')](db[_0xb00b('0x26')][_0xb00b('0x27')],function(_0x54e247){return{'name':_0x54e247[_0xb00b('0x28')],'type':_0x54e247[_0xb00b('0x29')]['key']};});_0x183233[_0xb00b('0x2a')]=_[_0xb00b('0x25')](_0x2b9824,'name');_0x183233[_0xb00b('0x2b')]=_['keys'](_0x2fc11a[_0xb00b('0x2b')]);_0x183233[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x183233[_0xb00b('0x2a')],_0x183233[_0xb00b('0x2b')]);_0x16fbd5[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x183233['model'],qs['fields'](_0x2fc11a['query'][_0xb00b('0x2f')]));_0x16fbd5[_0xb00b('0x2e')]=_0x16fbd5[_0xb00b('0x2e')][_0xb00b('0x30')]?_0x16fbd5['attributes']:_0x183233[_0xb00b('0x2a')];if(!_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x31')](_0xb00b('0x32'))){_0x16fbd5[_0xb00b('0x19')]=qs[_0xb00b('0x19')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x19')]);_0x16fbd5['offset']=qs['offset'](_0x2fc11a[_0xb00b('0x2b')]['offset']);}_0x16fbd5[_0xb00b('0x33')]=qs[_0xb00b('0x34')](_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x34')]);_0x16fbd5[_0xb00b('0x35')]=qs[_0xb00b('0x2c')](_[_0xb00b('0x36')](_0x2fc11a['query'],_0x183233[_0xb00b('0x2c')]),_0x2b9824);if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]){_0x16fbd5[_0xb00b('0x35')]=_[_0xb00b('0x38')](_0x16fbd5[_0xb00b('0x35')],{'$or':_['map'](_0x2b9824,function(_0x36980a){if(_0x36980a[_0xb00b('0x29')]!=='VIRTUAL'){var _0x17ff34={};_0x17ff34[_0x36980a[_0xb00b('0x23')]]={'$like':'%'+_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x37')]+'%'};return _0x17ff34;}})});}_0x16fbd5=_[_0xb00b('0x38')]({},_0x16fbd5,_0x2fc11a['options']);var _0x14ff6a={'where':_0x16fbd5[_0xb00b('0x35')]};return db[_0xb00b('0x26')][_0xb00b('0x39')](_0x14ff6a)['then'](function(_0x4867fe){_0x303625[_0xb00b('0x39')]=_0x4867fe;if(_0x2fc11a[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x16fbd5[_0xb00b('0x3b')]=[{'all':!![]}];}return db[_0xb00b('0x26')][_0xb00b('0x3c')](_0x16fbd5);})[_0xb00b('0x21')](function(_0x493841){_0x303625[_0xb00b('0x3d')]=_0x493841;return _0x303625;})[_0xb00b('0x21')](respondWithFilteredResult(_0x280ed3,_0x16fbd5))[_0xb00b('0x3e')](handleError(_0x280ed3,null));};exports[_0xb00b('0x3f')]=function(_0x302ded,_0x1dc4c5){var _0x2e3d83={'raw':!![],'where':{'id':_0x302ded[_0xb00b('0x40')]['id']}},_0x974a29={};_0x974a29[_0xb00b('0x2a')]=_[_0xb00b('0x41')](db[_0xb00b('0x26')]['rawAttributes']);_0x974a29[_0xb00b('0x2b')]=_[_0xb00b('0x41')](_0x302ded[_0xb00b('0x2b')]);_0x974a29[_0xb00b('0x2c')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],_0x974a29[_0xb00b('0x2b')]);_0x2e3d83[_0xb00b('0x2e')]=_[_0xb00b('0x2d')](_0x974a29[_0xb00b('0x2a')],qs[_0xb00b('0x2f')](_0x302ded[_0xb00b('0x2b')]['fields']));_0x2e3d83['attributes']=_0x2e3d83['attributes'][_0xb00b('0x30')]?_0x2e3d83[_0xb00b('0x2e')]:_0x974a29['model'];if(_0x302ded[_0xb00b('0x2b')][_0xb00b('0x3a')]){_0x2e3d83[_0xb00b('0x3b')]=[{'all':!![]}];}_0x2e3d83=_[_0xb00b('0x38')]({},_0x2e3d83,_0x302ded['options']);return db['AnalyticMetric'][_0xb00b('0x42')](_0x2e3d83)[_0xb00b('0x21')](handleEntityNotFound(_0x1dc4c5,null))['then'](respondWithResult(_0x1dc4c5,null))['catch'](handleError(_0x1dc4c5,null));};exports[_0xb00b('0x43')]=function(_0x3a205d,_0x4e0be4){return db[_0xb00b('0x26')]['create'](_0x3a205d['body'],{})['then'](function(_0x465d90){var _0x481515=_0x3a205d[_0xb00b('0x44')][_0xb00b('0x1f')]({'plain':!![]});if(!_0x481515)throw new Error(_0xb00b('0x45'));if(_0x481515[_0xb00b('0x46')]===_0xb00b('0x44')){var _0xda60ca=_0x465d90['get']({'plain':!![]});var _0x5bd40c=_0xb00b('0x20');return db[_0xb00b('0x47')]['find']({'where':{'name':_0x5bd40c,'userProfileId':_0x481515[_0xb00b('0x48')]},'raw':!![]})[_0xb00b('0x21')](function(_0x57f6ab){if(_0x57f6ab&&_0x57f6ab[_0xb00b('0x49')]===0x0){return db[_0xb00b('0x4a')][_0xb00b('0x43')]({'name':_0xda60ca['name'],'resourceId':_0xda60ca['id'],'type':_0x57f6ab['name'],'sectionId':_0x57f6ab['id']},{})[_0xb00b('0x21')](function(){return _0x465d90;});}else{return _0x465d90;}})[_0xb00b('0x3e')](function(_0x12737d){logger[_0xb00b('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12737d);throw _0x12737d;});}return _0x465d90;})[_0xb00b('0x21')](respondWithResult(_0x4e0be4,0xc9))[_0xb00b('0x3e')](handleError(_0x4e0be4,null));};exports['update']=function(_0x4cd9fd,_0x160965){if(_0x4cd9fd['body']['id']){delete _0x4cd9fd[_0xb00b('0x4c')]['id'];}return db[_0xb00b('0x26')][_0xb00b('0x42')]({'where':{'id':_0x4cd9fd[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x160965,null))[_0xb00b('0x21')](saveUpdates(_0x4cd9fd['body'],null))[_0xb00b('0x21')](respondWithResult(_0x160965,null))['catch'](handleError(_0x160965,null));};exports[_0xb00b('0x1e')]=function(_0x98caa9,_0x4129ba){return db['AnalyticMetric'][_0xb00b('0x42')]({'where':{'id':_0x98caa9[_0xb00b('0x40')]['id']}})[_0xb00b('0x21')](handleEntityNotFound(_0x4129ba,null))['then'](removeEntity(_0x4129ba,null))[_0xb00b('0x3e')](handleError(_0x4129ba,null));};
\ No newline at end of file
index 2f68b55..0ed80cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf981=['exports','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes'];(function(_0xf95ac1,_0x253c5d){var _0x101165=function(_0x23490c){while(--_0x23490c){_0xf95ac1['push'](_0xf95ac1['shift']());}};_0x101165(++_0x253c5d);}(_0xf981,0xe6));var _0x1f98=function(_0x4992ff,_0x354b44){_0x4992ff=_0x4992ff-0x0;var _0x1772ed=_0xf981[_0x4992ff];return _0x1772ed;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var logger=require(_0x1f98('0x2'))(_0x1f98('0x3'));var moment=require(_0x1f98('0x4'));var BPromise=require(_0x1f98('0x5'));var rp=require(_0x1f98('0x6'));var fs=require('fs');var path=require(_0x1f98('0x7'));var rimraf=require('rimraf');var config=require(_0x1f98('0x8'));var attributes=require(_0x1f98('0x9'));module[_0x1f98('0xa')]=function(_0x14bb19,_0x285cdc){return _0x14bb19['define']('AnalyticMetric',attributes,{'tableName':_0x1f98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14f5=['moment','bluebird','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api'];(function(_0x22fc46,_0x25ae77){var _0x1a4946=function(_0x37f6d0){while(--_0x37f6d0){_0x22fc46['push'](_0x22fc46['shift']());}};_0x1a4946(++_0x25ae77);}(_0x14f5,0xae));var _0x514f=function(_0x3c5735,_0x1f4f53){_0x3c5735=_0x3c5735-0x0;var _0x2cd61d=_0x14f5[_0x3c5735];return _0x2cd61d;};'use strict';var _=require('lodash');var util=require(_0x514f('0x0'));var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x514f('0x4'));var rimraf=require(_0x514f('0x5'));var config=require('../../config/environment');var attributes=require(_0x514f('0x6'));module[_0x514f('0x7')]=function(_0xc2ca56,_0x434452){return _0xc2ca56[_0x514f('0x8')](_0x514f('0x9'),attributes,{'tableName':_0x514f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ccb92dc..cd9428d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c78=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','moment'];(function(_0x20a5df,_0x4e1567){var _0x2124e4=function(_0x174f7d){while(--_0x174f7d){_0x20a5df['push'](_0x20a5df['shift']());}};_0x2124e4(++_0x4e1567);}(_0x0c78,0x1c7));var _0x80c7=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x0c78[_0x468b0f];return _0x3e74d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x80c7('0x0'));var BPromise=require('bluebird');var rs=require(_0x80c7('0x1'));var fs=require('fs');var Redis=require(_0x80c7('0x2'));var db=require(_0x80c7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x80c7('0x4'))(_0x80c7('0x5'));var config=require(_0x80c7('0x6'));var jayson=require(_0x80c7('0x7'));var client=jayson['client'][_0x80c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f39c4,_0x22ae08,_0x4ffc81){return new BPromise(function(_0x200df3,_0x51144b){return client[_0x80c7('0x9')](_0x5f39c4,_0x4ffc81)['then'](function(_0x5bc4f8){logger[_0x80c7('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x22ae08,_0x80c7('0xb'));logger[_0x80c7('0xc')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x22ae08,'request\x20sent',JSON[_0x80c7('0xd')](_0x5bc4f8));if(_0x5bc4f8[_0x80c7('0xe')]){if(_0x5bc4f8[_0x80c7('0xe')][_0x80c7('0xf')]===0x1f4){logger[_0x80c7('0xe')](_0x80c7('0x10'),_0x22ae08,_0x5bc4f8[_0x80c7('0xe')]['message']);return _0x51144b(_0x5bc4f8[_0x80c7('0xe')][_0x80c7('0x11')]);}logger[_0x80c7('0xe')](_0x80c7('0x10'),_0x22ae08,_0x5bc4f8[_0x80c7('0xe')][_0x80c7('0x11')]);return _0x200df3(_0x5bc4f8[_0x80c7('0xe')][_0x80c7('0x11')]);}else{logger[_0x80c7('0xa')](_0x80c7('0x10'),_0x22ae08,_0x80c7('0xb'));_0x200df3(_0x5bc4f8['result'][_0x80c7('0x11')]);}})[_0x80c7('0x12')](function(_0x1dfc36){logger[_0x80c7('0xe')](_0x80c7('0x10'),_0x22ae08,_0x1dfc36);_0x51144b(_0x1dfc36);});});}
\ No newline at end of file
+var _0x1ed1=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','AnalyticMetric,\x20%s,\x20%s'];(function(_0x313ca1,_0x2b46de){var _0x4f9057=function(_0x1da794){while(--_0x1da794){_0x313ca1['push'](_0x313ca1['shift']());}};_0x4f9057(++_0x2b46de);}(_0x1ed1,0x161));var _0x11ed=function(_0x4d6265,_0x1794ee){_0x4d6265=_0x4d6265-0x0;var _0x108595=_0x1ed1[_0x4d6265];return _0x108595;};'use strict';var _=require(_0x11ed('0x0'));var util=require(_0x11ed('0x1'));var moment=require(_0x11ed('0x2'));var BPromise=require(_0x11ed('0x3'));var rs=require(_0x11ed('0x4'));var fs=require('fs');var Redis=require(_0x11ed('0x5'));var db=require(_0x11ed('0x6'))['db'];var utils=require(_0x11ed('0x7'));var logger=require(_0x11ed('0x8'))('rpc');var config=require(_0x11ed('0x9'));var jayson=require(_0x11ed('0xa'));var client=jayson[_0x11ed('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x293483,_0x19618d,_0x36de89){return new BPromise(function(_0x58ab37,_0x4f9c63){return client[_0x11ed('0xc')](_0x293483,_0x36de89)[_0x11ed('0xd')](function(_0x2bf2bf){logger['info'](_0x11ed('0xe'),_0x19618d,'request\x20sent');logger['debug'](_0x11ed('0xf'),_0x19618d,_0x11ed('0x10'),JSON[_0x11ed('0x11')](_0x2bf2bf));if(_0x2bf2bf[_0x11ed('0x12')]){if(_0x2bf2bf[_0x11ed('0x12')][_0x11ed('0x13')]===0x1f4){logger[_0x11ed('0x12')](_0x11ed('0xe'),_0x19618d,_0x2bf2bf['error'][_0x11ed('0x14')]);return _0x4f9c63(_0x2bf2bf[_0x11ed('0x12')][_0x11ed('0x14')]);}logger['error'](_0x11ed('0xe'),_0x19618d,_0x2bf2bf[_0x11ed('0x12')][_0x11ed('0x14')]);return _0x58ab37(_0x2bf2bf[_0x11ed('0x12')][_0x11ed('0x14')]);}else{logger[_0x11ed('0x15')](_0x11ed('0xe'),_0x19618d,_0x11ed('0x10'));_0x58ab37(_0x2bf2bf['result'][_0x11ed('0x14')]);}})[_0x11ed('0x16')](function(_0x116828){logger[_0x11ed('0x12')](_0x11ed('0xe'),_0x19618d,_0x116828);_0x4f9c63(_0x116828);});});}
\ No newline at end of file
index 8fb48da..082888b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb491=['express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1c1791,_0x15ac03){var _0x1ecc4f=function(_0x5c68ae){while(--_0x5c68ae){_0x1c1791['push'](_0x1c1791['shift']());}};_0x1ecc4f(++_0x15ac03);}(_0xb491,0x18c));var _0x1b49=function(_0x4a6cf8,_0x5534ef){_0x4a6cf8=_0x4a6cf8-0x0;var _0x22205e=_0xb491[_0x4a6cf8];return _0x22205e;};'use strict';var multer=require(_0x1b49('0x0'));var util=require(_0x1b49('0x1'));var path=require(_0x1b49('0x2'));var timeout=require(_0x1b49('0x3'));var express=require(_0x1b49('0x4'));var router=express[_0x1b49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b49('0x6'));var interaction=require(_0x1b49('0x7'));var config=require('../../config/environment');var controller=require(_0x1b49('0x8'));router[_0x1b49('0x9')]('/',auth[_0x1b49('0xa')](),controller['index']);router[_0x1b49('0x9')]('/:id',auth[_0x1b49('0xa')](),controller[_0x1b49('0xb')]);router[_0x1b49('0xc')]('/',auth[_0x1b49('0xa')](),controller[_0x1b49('0xd')]);router[_0x1b49('0xe')](_0x1b49('0xf'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x10')]);router[_0x1b49('0x11')](_0x1b49('0xf'),auth[_0x1b49('0xa')](),controller[_0x1b49('0x12')]);module[_0x1b49('0x13')]=router;
\ No newline at end of file
+var _0xac0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x56e4e7,_0x1db098){var _0x383618=function(_0xb088c6){while(--_0xb088c6){_0x56e4e7['push'](_0x56e4e7['shift']());}};_0x383618(++_0x1db098);}(_0xac0a,0x11e));var _0xaac0=function(_0x52cb4b,_0x44aae6){_0x52cb4b=_0x52cb4b-0x0;var _0xb506df=_0xac0a[_0x52cb4b];return _0xb506df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaac0('0x0'));var timeout=require(_0xaac0('0x1'));var express=require('express');var router=express[_0xaac0('0x2')]();var fs_extra=require(_0xaac0('0x3'));var auth=require(_0xaac0('0x4'));var interaction=require(_0xaac0('0x5'));var config=require(_0xaac0('0x6'));var controller=require(_0xaac0('0x7'));router[_0xaac0('0x8')]('/',auth[_0xaac0('0x9')](),controller[_0xaac0('0xa')]);router[_0xaac0('0x8')](_0xaac0('0xb'),auth[_0xaac0('0x9')](),controller['show']);router[_0xaac0('0xc')]('/',auth[_0xaac0('0x9')](),controller['create']);router[_0xaac0('0xd')](_0xaac0('0xb'),auth[_0xaac0('0x9')](),controller[_0xaac0('0xe')]);router[_0xaac0('0xf')](_0xaac0('0xb'),auth[_0xaac0('0x9')](),controller[_0xaac0('0x10')]);module[_0xaac0('0x11')]=router;
\ No newline at end of file
index b2d847d..a8460bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b24=['sequelize','exports','TEXT'];(function(_0x5f746f,_0x5b05ab){var _0x198d15=function(_0x58c7e7){while(--_0x58c7e7){_0x5f746f['push'](_0x5f746f['shift']());}};_0x198d15(++_0x5b05ab);}(_0x7b24,0x183));var _0x47b2=function(_0x374731,_0x382d68){_0x374731=_0x374731-0x0;var _0x11dd89=_0x7b24[_0x374731];return _0x11dd89;};'use strict';var Sequelize=require(_0x47b2('0x0'));module[_0x47b2('0x1')]={'tree':{'type':Sequelize[_0x47b2('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4b83=['sequelize','exports','TEXT'];(function(_0xef0e02,_0x25703b){var _0x542c19=function(_0x4855c0){while(--_0x4855c0){_0xef0e02['push'](_0xef0e02['shift']());}};_0x542c19(++_0x25703b);}(_0x4b83,0xba));var _0x34b8=function(_0xe4a604,_0x225d31){_0xe4a604=_0xe4a604-0x0;var _0x240f2f=_0x4b83[_0xe4a604];return _0x240f2f;};'use strict';var Sequelize=require(_0x34b8('0x0'));module[_0x34b8('0x1')]={'tree':{'type':Sequelize[_0x34b8('0x2')],'allowNull':![]}};
\ No newline at end of file
index e3a1590..b70fa67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1535=['crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','options','AnalyticTreeReport','findAll','rows','catch','params','merge','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1535,0x144));var _0x5153=function(_0x5222d7,_0x473f09){_0x5222d7=_0x5222d7-0x0;var _0x421737=_0x1535[_0x5222d7];return _0x421737;};'use strict';var emlformat=require(_0x5153('0x0'));var rimraf=require(_0x5153('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5153('0x2'));var moment=require(_0x5153('0x3'));var BPromise=require(_0x5153('0x4'));var Mustache=require(_0x5153('0x5'));var util=require('util');var path=require(_0x5153('0x6'));var sox=require(_0x5153('0x7'));var csv=require(_0x5153('0x8'));var ejs=require(_0x5153('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5153('0xa'));var crypto=require(_0x5153('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5153('0xc'));var toCsv=require(_0x5153('0x8'));var querystring=require(_0x5153('0xd'));var Papa=require('papaparse');var Redis=require(_0x5153('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5153('0xf'));var hardwareService=require(_0x5153('0x10'));var logger=require(_0x5153('0x11'))('api');var utils=require(_0x5153('0x12'));var config=require(_0x5153('0x13'));var licenseUtil=require(_0x5153('0x14'));var db=require(_0x5153('0x15'))['db'];function respondWithStatusCode(_0x204128,_0x397ddb){_0x397ddb=_0x397ddb||0xcc;return function(_0x33554d){if(_0x33554d){return _0x204128[_0x5153('0x16')](_0x397ddb);}return _0x204128['status'](_0x397ddb)[_0x5153('0x17')]();};}function respondWithResult(_0x57ed7b,_0x331e02){_0x331e02=_0x331e02||0xc8;return function(_0x2abe26){if(_0x2abe26){return _0x57ed7b[_0x5153('0x18')](_0x331e02)[_0x5153('0x19')](_0x2abe26);}};}function respondWithFilteredResult(_0x33c0cb,_0x196515){return function(_0x3bc69f){if(_0x3bc69f){var _0x3d87d7=typeof _0x196515[_0x5153('0x1a')]===_0x5153('0x1b')&&typeof _0x196515[_0x5153('0x1c')]===_0x5153('0x1b');var _0x329eea=_0x3bc69f[_0x5153('0x1d')];var _0x51fe76=_0x3d87d7?0x0:_0x196515[_0x5153('0x1a')];var _0x2aa053=_0x3d87d7?_0x3bc69f[_0x5153('0x1d')]:_0x196515[_0x5153('0x1a')]+_0x196515[_0x5153('0x1c')];var _0x21c065;if(_0x2aa053>=_0x329eea){_0x2aa053=_0x329eea;_0x21c065=0xc8;}else{_0x21c065=0xce;}_0x33c0cb[_0x5153('0x18')](_0x21c065);return _0x33c0cb[_0x5153('0x1e')]('Content-Range',_0x51fe76+'-'+_0x2aa053+'/'+_0x329eea)[_0x5153('0x19')](_0x3bc69f);}return null;};}function patchUpdates(_0x5bf6d3){return function(_0x5becda){try{jsonpatch[_0x5153('0x1f')](_0x5becda,_0x5bf6d3,!![]);}catch(_0x4f6fff){return BPromise['reject'](_0x4f6fff);}return _0x5becda['save']();};}function saveUpdates(_0x345fb9,_0x32af90){return function(_0xfb483c){if(_0xfb483c){return _0xfb483c[_0x5153('0x20')](_0x345fb9)[_0x5153('0x21')](function(_0x148e05){return _0x148e05;});}return null;};}function removeEntity(_0x2f67eb,_0x3a1094){return function(_0x169fea){if(_0x169fea){return _0x169fea[_0x5153('0x22')]()['then'](function(){_0x2f67eb[_0x5153('0x18')](0xcc)[_0x5153('0x17')]();});}};}function handleEntityNotFound(_0xc096d3,_0x22ba69){return function(_0x24893f){if(!_0x24893f){_0xc096d3[_0x5153('0x16')](0x194);}return _0x24893f;};}function handleError(_0x319a5f,_0x392d4f){_0x392d4f=_0x392d4f||0x1f4;return function(_0x841566){logger['error'](_0x841566[_0x5153('0x23')]);if(_0x841566[_0x5153('0x24')]){delete _0x841566['name'];}_0x319a5f['status'](_0x392d4f)[_0x5153('0x25')](_0x841566);};}exports['index']=function(_0x59c7bc,_0x1d5f46){var _0x26dd34={},_0x148e58={},_0x2f3913={'count':0x0,'rows':[]};var _0x27a027=_['map'](db['AnalyticTreeReport'][_0x5153('0x26')],function(_0x389935){return{'name':_0x389935[_0x5153('0x27')],'type':_0x389935[_0x5153('0x28')][_0x5153('0x29')]};});_0x148e58[_0x5153('0x2a')]=_['map'](_0x27a027,'name');_0x148e58[_0x5153('0x2b')]=_[_0x5153('0x2c')](_0x59c7bc['query']);_0x148e58[_0x5153('0x2d')]=_[_0x5153('0x2e')](_0x148e58[_0x5153('0x2a')],_0x148e58['query']);_0x26dd34[_0x5153('0x2f')]=_[_0x5153('0x2e')](_0x148e58['model'],qs[_0x5153('0x30')](_0x59c7bc['query'][_0x5153('0x30')]));_0x26dd34[_0x5153('0x2f')]=_0x26dd34['attributes']['length']?_0x26dd34[_0x5153('0x2f')]:_0x148e58[_0x5153('0x2a')];if(!_0x59c7bc[_0x5153('0x2b')][_0x5153('0x31')](_0x5153('0x32'))){_0x26dd34[_0x5153('0x1c')]=qs[_0x5153('0x1c')](_0x59c7bc[_0x5153('0x2b')][_0x5153('0x1c')]);_0x26dd34[_0x5153('0x1a')]=qs['offset'](_0x59c7bc[_0x5153('0x2b')][_0x5153('0x1a')]);}_0x26dd34[_0x5153('0x33')]=qs[_0x5153('0x34')](_0x59c7bc[_0x5153('0x2b')][_0x5153('0x34')]);_0x26dd34[_0x5153('0x35')]=qs['filters'](_['pick'](_0x59c7bc['query'],_0x148e58['filters']),_0x27a027);if(_0x59c7bc['query'][_0x5153('0x36')]){_0x26dd34[_0x5153('0x35')]=_['merge'](_0x26dd34[_0x5153('0x35')],{'$or':_[_0x5153('0x37')](_0x27a027,function(_0x52a147){if(_0x52a147['type']!==_0x5153('0x38')){var _0x13e08f={};_0x13e08f[_0x52a147[_0x5153('0x24')]]={'$like':'%'+_0x59c7bc[_0x5153('0x2b')][_0x5153('0x36')]+'%'};return _0x13e08f;}})});}_0x26dd34=_['merge']({},_0x26dd34,_0x59c7bc[_0x5153('0x39')]);var _0xb05020={'where':_0x26dd34[_0x5153('0x35')]};return db['AnalyticTreeReport'][_0x5153('0x1d')](_0xb05020)['then'](function(_0x31c6a5){_0x2f3913['count']=_0x31c6a5;if(_0x59c7bc[_0x5153('0x2b')]['includeAll']){_0x26dd34['include']=[{'all':!![]}];}return db[_0x5153('0x3a')][_0x5153('0x3b')](_0x26dd34);})['then'](function(_0x3e8c07){_0x2f3913[_0x5153('0x3c')]=_0x3e8c07;return _0x2f3913;})['then'](respondWithFilteredResult(_0x1d5f46,_0x26dd34))[_0x5153('0x3d')](handleError(_0x1d5f46,null));};exports['show']=function(_0xadd7e0,_0x1f331e){var _0x370bea={'raw':!![],'where':{'id':_0xadd7e0[_0x5153('0x3e')]['id']}},_0x596738={};_0x596738[_0x5153('0x2a')]=_['keys'](db[_0x5153('0x3a')][_0x5153('0x26')]);_0x596738[_0x5153('0x2b')]=_[_0x5153('0x2c')](_0xadd7e0[_0x5153('0x2b')]);_0x596738[_0x5153('0x2d')]=_['intersection'](_0x596738['model'],_0x596738['query']);_0x370bea[_0x5153('0x2f')]=_[_0x5153('0x2e')](_0x596738[_0x5153('0x2a')],qs[_0x5153('0x30')](_0xadd7e0[_0x5153('0x2b')][_0x5153('0x30')]));_0x370bea[_0x5153('0x2f')]=_0x370bea[_0x5153('0x2f')]['length']?_0x370bea[_0x5153('0x2f')]:_0x596738[_0x5153('0x2a')];if(_0xadd7e0[_0x5153('0x2b')]['includeAll']){_0x370bea['include']=[{'all':!![]}];}_0x370bea=_[_0x5153('0x3f')]({},_0x370bea,_0xadd7e0[_0x5153('0x39')]);return db[_0x5153('0x3a')][_0x5153('0x40')](_0x370bea)[_0x5153('0x21')](handleEntityNotFound(_0x1f331e,null))[_0x5153('0x21')](respondWithResult(_0x1f331e,null))[_0x5153('0x3d')](handleError(_0x1f331e,null));};exports[_0x5153('0x41')]=function(_0xce6bea,_0x472101){return db['AnalyticTreeReport'][_0x5153('0x41')](_0xce6bea['body'],{})['then'](respondWithResult(_0x472101,0xc9))[_0x5153('0x3d')](handleError(_0x472101,null));};exports['update']=function(_0x488a3a,_0x276b18){if(_0x488a3a[_0x5153('0x42')]['id']){delete _0x488a3a[_0x5153('0x42')]['id'];}return db[_0x5153('0x3a')][_0x5153('0x40')]({'where':{'id':_0x488a3a[_0x5153('0x3e')]['id']}})[_0x5153('0x21')](handleEntityNotFound(_0x276b18,null))[_0x5153('0x21')](saveUpdates(_0x488a3a[_0x5153('0x42')],null))[_0x5153('0x21')](respondWithResult(_0x276b18,null))[_0x5153('0x3d')](handleError(_0x276b18,null));};exports[_0x5153('0x22')]=function(_0x233795,_0x329e0d){return db['AnalyticTreeReport']['find']({'where':{'id':_0x233795[_0x5153('0x3e')]['id']}})[_0x5153('0x21')](handleEntityNotFound(_0x329e0d,null))[_0x5153('0x21')](removeEntity(_0x329e0d,null))[_0x5153('0x3d')](handleError(_0x329e0d,null));};
\ No newline at end of file
+var _0x7ae7=['set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','count','includeAll','AnalyticTreeReport','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','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','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x4303e1,_0x492c81){var _0x548ec9=function(_0x26e6c3){while(--_0x26e6c3){_0x4303e1['push'](_0x4303e1['shift']());}};_0x548ec9(++_0x492c81);}(_0x7ae7,0x19e));var _0x77ae=function(_0x5199af,_0x1eb67c){_0x5199af=_0x5199af-0x0;var _0x381974=_0x7ae7[_0x5199af];return _0x381974;};'use strict';var emlformat=require(_0x77ae('0x0'));var rimraf=require(_0x77ae('0x1'));var zipdir=require(_0x77ae('0x2'));var jsonpatch=require(_0x77ae('0x3'));var rp=require('request-promise');var moment=require(_0x77ae('0x4'));var BPromise=require(_0x77ae('0x5'));var Mustache=require(_0x77ae('0x6'));var util=require(_0x77ae('0x7'));var path=require('path');var sox=require(_0x77ae('0x8'));var csv=require(_0x77ae('0x9'));var ejs=require(_0x77ae('0xa'));var fs=require('fs');var fs_extra=require(_0x77ae('0xb'));var _=require(_0x77ae('0xc'));var squel=require('squel');var crypto=require(_0x77ae('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x77ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0x77ae('0xf'));var Papa=require(_0x77ae('0x10'));var Redis=require(_0x77ae('0x11'));var authService=require(_0x77ae('0x12'));var qs=require(_0x77ae('0x13'));var as=require(_0x77ae('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x77ae('0x15'));var utils=require(_0x77ae('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x77ae('0x17'))['db'];function respondWithStatusCode(_0x3dce55,_0x1a381b){_0x1a381b=_0x1a381b||0xcc;return function(_0x522bb4){if(_0x522bb4){return _0x3dce55[_0x77ae('0x18')](_0x1a381b);}return _0x3dce55['status'](_0x1a381b)['end']();};}function respondWithResult(_0x3ea8a3,_0x54a11b){_0x54a11b=_0x54a11b||0xc8;return function(_0xf649d4){if(_0xf649d4){return _0x3ea8a3[_0x77ae('0x19')](_0x54a11b)[_0x77ae('0x1a')](_0xf649d4);}};}function respondWithFilteredResult(_0x42cb04,_0x5c70d8){return function(_0x38a283){if(_0x38a283){var _0x3e574b=typeof _0x5c70d8[_0x77ae('0x1b')]===_0x77ae('0x1c')&&typeof _0x5c70d8[_0x77ae('0x1d')]===_0x77ae('0x1c');var _0xa4cd3b=_0x38a283['count'];var _0x59c4e2=_0x3e574b?0x0:_0x5c70d8['offset'];var _0x26e6f0=_0x3e574b?_0x38a283['count']:_0x5c70d8[_0x77ae('0x1b')]+_0x5c70d8[_0x77ae('0x1d')];var _0x57e778;if(_0x26e6f0>=_0xa4cd3b){_0x26e6f0=_0xa4cd3b;_0x57e778=0xc8;}else{_0x57e778=0xce;}_0x42cb04[_0x77ae('0x19')](_0x57e778);return _0x42cb04[_0x77ae('0x1e')](_0x77ae('0x1f'),_0x59c4e2+'-'+_0x26e6f0+'/'+_0xa4cd3b)[_0x77ae('0x1a')](_0x38a283);}return null;};}function patchUpdates(_0x13359b){return function(_0x29a553){try{jsonpatch[_0x77ae('0x20')](_0x29a553,_0x13359b,!![]);}catch(_0xa69b7f){return BPromise[_0x77ae('0x21')](_0xa69b7f);}return _0x29a553[_0x77ae('0x22')]();};}function saveUpdates(_0x35ed78,_0x51c51b){return function(_0x5ec6dd){if(_0x5ec6dd){return _0x5ec6dd[_0x77ae('0x23')](_0x35ed78)['then'](function(_0x199ee6){return _0x199ee6;});}return null;};}function removeEntity(_0x44efb7,_0x1b7116){return function(_0x47b7f9){if(_0x47b7f9){return _0x47b7f9['destroy']()[_0x77ae('0x24')](function(){_0x44efb7['status'](0xcc)[_0x77ae('0x25')]();});}};}function handleEntityNotFound(_0x482336,_0x1951de){return function(_0x6f82d1){if(!_0x6f82d1){_0x482336[_0x77ae('0x18')](0x194);}return _0x6f82d1;};}function handleError(_0x545f6e,_0x2eeaf9){_0x2eeaf9=_0x2eeaf9||0x1f4;return function(_0x166d59){logger[_0x77ae('0x26')](_0x166d59[_0x77ae('0x27')]);if(_0x166d59['name']){delete _0x166d59[_0x77ae('0x28')];}_0x545f6e[_0x77ae('0x19')](_0x2eeaf9)[_0x77ae('0x29')](_0x166d59);};}exports[_0x77ae('0x2a')]=function(_0x190b49,_0x2838e9){var _0x49a804={},_0x33f148={},_0x2cbbee={'count':0x0,'rows':[]};var _0x6b650d=_['map'](db['AnalyticTreeReport'][_0x77ae('0x2b')],function(_0x21ebae){return{'name':_0x21ebae['fieldName'],'type':_0x21ebae[_0x77ae('0x2c')]['key']};});_0x33f148[_0x77ae('0x2d')]=_[_0x77ae('0x2e')](_0x6b650d,'name');_0x33f148[_0x77ae('0x2f')]=_[_0x77ae('0x30')](_0x190b49['query']);_0x33f148['filters']=_[_0x77ae('0x31')](_0x33f148[_0x77ae('0x2d')],_0x33f148[_0x77ae('0x2f')]);_0x49a804[_0x77ae('0x32')]=_['intersection'](_0x33f148[_0x77ae('0x2d')],qs[_0x77ae('0x33')](_0x190b49['query']['fields']));_0x49a804[_0x77ae('0x32')]=_0x49a804[_0x77ae('0x32')][_0x77ae('0x34')]?_0x49a804[_0x77ae('0x32')]:_0x33f148['model'];if(!_0x190b49[_0x77ae('0x2f')][_0x77ae('0x35')]('nolimit')){_0x49a804['limit']=qs[_0x77ae('0x1d')](_0x190b49[_0x77ae('0x2f')][_0x77ae('0x1d')]);_0x49a804[_0x77ae('0x1b')]=qs['offset'](_0x190b49[_0x77ae('0x2f')][_0x77ae('0x1b')]);}_0x49a804[_0x77ae('0x36')]=qs['sort'](_0x190b49[_0x77ae('0x2f')][_0x77ae('0x37')]);_0x49a804['where']=qs[_0x77ae('0x38')](_[_0x77ae('0x39')](_0x190b49[_0x77ae('0x2f')],_0x33f148[_0x77ae('0x38')]),_0x6b650d);if(_0x190b49[_0x77ae('0x2f')][_0x77ae('0x3a')]){_0x49a804[_0x77ae('0x3b')]=_['merge'](_0x49a804[_0x77ae('0x3b')],{'$or':_[_0x77ae('0x2e')](_0x6b650d,function(_0x3c6080){if(_0x3c6080[_0x77ae('0x2c')]!=='VIRTUAL'){var _0x3cba52={};_0x3cba52[_0x3c6080[_0x77ae('0x28')]]={'$like':'%'+_0x190b49[_0x77ae('0x2f')][_0x77ae('0x3a')]+'%'};return _0x3cba52;}})});}_0x49a804=_[_0x77ae('0x3c')]({},_0x49a804,_0x190b49[_0x77ae('0x3d')]);var _0x22cdbb={'where':_0x49a804[_0x77ae('0x3b')]};return db['AnalyticTreeReport'][_0x77ae('0x3e')](_0x22cdbb)[_0x77ae('0x24')](function(_0x5a8022){_0x2cbbee[_0x77ae('0x3e')]=_0x5a8022;if(_0x190b49['query'][_0x77ae('0x3f')]){_0x49a804['include']=[{'all':!![]}];}return db[_0x77ae('0x40')]['findAll'](_0x49a804);})[_0x77ae('0x24')](function(_0x58d429){_0x2cbbee[_0x77ae('0x41')]=_0x58d429;return _0x2cbbee;})[_0x77ae('0x24')](respondWithFilteredResult(_0x2838e9,_0x49a804))[_0x77ae('0x42')](handleError(_0x2838e9,null));};exports[_0x77ae('0x43')]=function(_0x3a8d5d,_0x5919c0){var _0x5a7daa={'raw':!![],'where':{'id':_0x3a8d5d[_0x77ae('0x44')]['id']}},_0x20da03={};_0x20da03[_0x77ae('0x2d')]=_['keys'](db[_0x77ae('0x40')][_0x77ae('0x2b')]);_0x20da03[_0x77ae('0x2f')]=_[_0x77ae('0x30')](_0x3a8d5d[_0x77ae('0x2f')]);_0x20da03[_0x77ae('0x38')]=_['intersection'](_0x20da03[_0x77ae('0x2d')],_0x20da03[_0x77ae('0x2f')]);_0x5a7daa[_0x77ae('0x32')]=_[_0x77ae('0x31')](_0x20da03[_0x77ae('0x2d')],qs[_0x77ae('0x33')](_0x3a8d5d[_0x77ae('0x2f')][_0x77ae('0x33')]));_0x5a7daa[_0x77ae('0x32')]=_0x5a7daa['attributes'][_0x77ae('0x34')]?_0x5a7daa[_0x77ae('0x32')]:_0x20da03[_0x77ae('0x2d')];if(_0x3a8d5d['query'][_0x77ae('0x3f')]){_0x5a7daa[_0x77ae('0x45')]=[{'all':!![]}];}_0x5a7daa=_[_0x77ae('0x3c')]({},_0x5a7daa,_0x3a8d5d[_0x77ae('0x3d')]);return db['AnalyticTreeReport'][_0x77ae('0x46')](_0x5a7daa)[_0x77ae('0x24')](handleEntityNotFound(_0x5919c0,null))[_0x77ae('0x24')](respondWithResult(_0x5919c0,null))[_0x77ae('0x42')](handleError(_0x5919c0,null));};exports[_0x77ae('0x47')]=function(_0xb20e4e,_0x41bf89){return db[_0x77ae('0x40')][_0x77ae('0x47')](_0xb20e4e[_0x77ae('0x48')],{})[_0x77ae('0x24')](respondWithResult(_0x41bf89,0xc9))[_0x77ae('0x42')](handleError(_0x41bf89,null));};exports['update']=function(_0x1b1635,_0x3b8f5e){if(_0x1b1635[_0x77ae('0x48')]['id']){delete _0x1b1635[_0x77ae('0x48')]['id'];}return db[_0x77ae('0x40')]['find']({'where':{'id':_0x1b1635[_0x77ae('0x44')]['id']}})[_0x77ae('0x24')](handleEntityNotFound(_0x3b8f5e,null))[_0x77ae('0x24')](saveUpdates(_0x1b1635['body'],null))[_0x77ae('0x24')](respondWithResult(_0x3b8f5e,null))[_0x77ae('0x42')](handleError(_0x3b8f5e,null));};exports[_0x77ae('0x49')]=function(_0xf023d7,_0x3d107f){return db[_0x77ae('0x40')][_0x77ae('0x46')]({'where':{'id':_0xf023d7[_0x77ae('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d107f,null))['then'](removeEntity(_0x3d107f,null))[_0x77ae('0x42')](handleError(_0x3d107f,null));};
\ No newline at end of file
index f0e0f3b..c70bbe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0184=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x329a42,_0x735890){var _0x412fc3=function(_0x38562f){while(--_0x38562f){_0x329a42['push'](_0x329a42['shift']());}};_0x412fc3(++_0x735890);}(_0x0184,0xe0));var _0x4018=function(_0x27b3df,_0x34a01a){_0x27b3df=_0x27b3df-0x0;var _0x275390=_0x0184[_0x27b3df];return _0x275390;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4018('0x0'))('api');var moment=require(_0x4018('0x1'));var BPromise=require(_0x4018('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4018('0x3'));var rimraf=require(_0x4018('0x4'));var config=require(_0x4018('0x5'));var attributes=require(_0x4018('0x6'));module[_0x4018('0x7')]=function(_0x4c6815,_0x272ddf){return _0x4c6815[_0x4018('0x8')](_0x4018('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbedd=['define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xbedd,0xdf));var _0xdbed=function(_0x428d9a,_0x4e724d){_0x428d9a=_0x428d9a-0x0;var _0x50da90=_0xbedd[_0x428d9a];return _0x50da90;};'use strict';var _=require(_0xdbed('0x0'));var util=require('util');var logger=require(_0xdbed('0x1'))('api');var moment=require('moment');var BPromise=require(_0xdbed('0x2'));var rp=require(_0xdbed('0x3'));var fs=require('fs');var path=require(_0xdbed('0x4'));var rimraf=require(_0xdbed('0x5'));var config=require(_0xdbed('0x6'));var attributes=require(_0xdbed('0x7'));module['exports']=function(_0x463bdb,_0x1ca51d){return _0x463bdb[_0xdbed('0x8')](_0xdbed('0x9'),attributes,{'tableName':_0xdbed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da032e4..fb252f9 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(_0x572532,_0x3e2f17){var _0x6d4902=function(_0x35ad26){while(--_0x35ad26){_0x572532['push'](_0x572532['shift']());}};_0x6d4902(++_0x3e2f17);}(_0x5f2f,0x73));var _0xf5f2=function(_0x925aff,_0x43dc77){_0x925aff=_0x925aff-0x0;var _0x519702=_0x5f2f[_0x925aff];return _0x519702;};'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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2cb11a,_0x27f77a){var _0xe67271=function(_0x5e4e3e){while(--_0x5e4e3e){_0x2cb11a['push'](_0x2cb11a['shift']());}};_0xe67271(++_0x27f77a);}(_0xadb5,0xad));var _0x5adb=function(_0x21d19a,_0x2b48d7){_0x21d19a=_0x21d19a-0x0;var _0x183628=_0xadb5[_0x21d19a];return _0x183628;};'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']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index 0c7dd7a..15edbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5808=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete'];(function(_0x3aa1bc,_0x48147f){var _0x302650=function(_0x319da1){while(--_0x319da1){_0x3aa1bc['push'](_0x3aa1bc['shift']());}};_0x302650(++_0x48147f);}(_0x5808,0xf8));var _0x8580=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x5808[_0x16337a];return _0x422365;};'use strict';var multer=require(_0x8580('0x0'));var util=require(_0x8580('0x1'));var path=require(_0x8580('0x2'));var timeout=require(_0x8580('0x3'));var express=require(_0x8580('0x4'));var router=express[_0x8580('0x5')]();var fs_extra=require(_0x8580('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8580('0x7'));var controller=require(_0x8580('0x8'));router[_0x8580('0x9')]('/',auth[_0x8580('0xa')](),controller[_0x8580('0xb')]);router[_0x8580('0x9')](_0x8580('0xc'),auth[_0x8580('0xa')](),controller['show']);router[_0x8580('0xd')]('/',auth[_0x8580('0xa')](),controller[_0x8580('0xe')]);router[_0x8580('0xf')](_0x8580('0xc'),auth[_0x8580('0xa')](),controller[_0x8580('0x10')]);router[_0x8580('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8580('0x12')]=router;
\ No newline at end of file
+var _0xff68=['isAuthenticated','/:id','show','post','put','update','destroy','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0xff68,0xd7));var _0x8ff6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xff68[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8ff6('0x0'));var express=require(_0x8ff6('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8ff6('0x2'));var interaction=require(_0x8ff6('0x3'));var config=require('../../config/environment');var controller=require(_0x8ff6('0x4'));router[_0x8ff6('0x5')]('/',auth[_0x8ff6('0x6')](),controller['index']);router[_0x8ff6('0x5')](_0x8ff6('0x7'),auth[_0x8ff6('0x6')](),controller[_0x8ff6('0x8')]);router[_0x8ff6('0x9')]('/',auth[_0x8ff6('0x6')](),controller['create']);router[_0x8ff6('0xa')](_0x8ff6('0x7'),auth[_0x8ff6('0x6')](),controller[_0x8ff6('0xb')]);router['delete'](_0x8ff6('0x7'),auth['isAuthenticated'](),controller[_0x8ff6('0xc')]);module['exports']=router;
\ No newline at end of file
index fd2ad65..b04d422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f7=['STRING','sequelize','exports'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xf9f7,0xdf));var _0x7f9f=function(_0x5a9b6c,_0x30ccd0){_0x5a9b6c=_0x5a9b6c-0x0;var _0x72bed=_0xf9f7[_0x5a9b6c];return _0x72bed;};'use strict';var Sequelize=require(_0x7f9f('0x0'));module[_0x7f9f('0x1')]={'name':{'type':Sequelize[_0x7f9f('0x2')]},'basename':{'type':Sequelize[_0x7f9f('0x2')]},'type':{'type':Sequelize[_0x7f9f('0x2')]}};
\ No newline at end of file
+var _0xc39c=['exports','STRING'];(function(_0x18b680,_0xad85cd){var _0x441328=function(_0x28bdfb){while(--_0x28bdfb){_0x18b680['push'](_0x18b680['shift']());}};_0x441328(++_0xad85cd);}(_0xc39c,0xd2));var _0xcc39=function(_0x3ed234,_0xcda5dc){_0x3ed234=_0x3ed234-0x0;var _0x593f3a=_0xc39c[_0x3ed234];return _0x593f3a;};'use strict';var Sequelize=require('sequelize');module[_0xcc39('0x0')]={'name':{'type':Sequelize[_0xcc39('0x1')]},'basename':{'type':Sequelize[_0xcc39('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 31b4131..13dc6d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa90b=['json','undefined','limit','count','offset','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','clone','params','find','get','omit','body','updatedAt','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa90b,0xf3));var _0xba90=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xa90b[_0x51b0dc];return _0x13fa89;};'use strict';var emlformat=require(_0xba90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba90('0x1'));var jsonpatch=require(_0xba90('0x2'));var rp=require(_0xba90('0x3'));var moment=require('moment');var BPromise=require(_0xba90('0x4'));var Mustache=require(_0xba90('0x5'));var util=require(_0xba90('0x6'));var path=require('path');var sox=require(_0xba90('0x7'));var csv=require('to-csv');var ejs=require(_0xba90('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba90('0x9'));var squel=require(_0xba90('0xa'));var crypto=require(_0xba90('0xb'));var jsforce=require(_0xba90('0xc'));var deskjs=require(_0xba90('0xd'));var toCsv=require(_0xba90('0xe'));var querystring=require(_0xba90('0xf'));var Papa=require('papaparse');var Redis=require(_0xba90('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xba90('0x11'));var as=require(_0xba90('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba90('0x13'))(_0xba90('0x14'));var utils=require(_0xba90('0x15'));var config=require(_0xba90('0x16'));var licenseUtil=require(_0xba90('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19911e,_0x462a18){_0x462a18=_0x462a18||0xcc;return function(_0x4d54a3){if(_0x4d54a3){return _0x19911e[_0xba90('0x18')](_0x462a18);}return _0x19911e[_0xba90('0x19')](_0x462a18)[_0xba90('0x1a')]();};}function respondWithResult(_0x488d29,_0x1a921a){_0x1a921a=_0x1a921a||0xc8;return function(_0x25cbc1){if(_0x25cbc1){return _0x488d29[_0xba90('0x19')](_0x1a921a)[_0xba90('0x1b')](_0x25cbc1);}};}function respondWithFilteredResult(_0x820164,_0x348503){return function(_0x3bad0f){if(_0x3bad0f){var _0x4f16d2=typeof _0x348503['offset']===_0xba90('0x1c')&&typeof _0x348503[_0xba90('0x1d')]===_0xba90('0x1c');var _0xf1dc15=_0x3bad0f[_0xba90('0x1e')];var _0x427db4=_0x4f16d2?0x0:_0x348503[_0xba90('0x1f')];var _0x58c480=_0x4f16d2?_0x3bad0f['count']:_0x348503[_0xba90('0x1f')]+_0x348503[_0xba90('0x1d')];var _0x5b719f;if(_0x58c480>=_0xf1dc15){_0x58c480=_0xf1dc15;_0x5b719f=0xc8;}else{_0x5b719f=0xce;}_0x820164[_0xba90('0x19')](_0x5b719f);return _0x820164[_0xba90('0x20')](_0xba90('0x21'),_0x427db4+'-'+_0x58c480+'/'+_0xf1dc15)[_0xba90('0x1b')](_0x3bad0f);}return null;};}function patchUpdates(_0x424490){return function(_0x519681){try{jsonpatch[_0xba90('0x22')](_0x519681,_0x424490,!![]);}catch(_0x1c5d38){return BPromise['reject'](_0x1c5d38);}return _0x519681['save']();};}function saveUpdates(_0x1cb25c,_0x374a6d){return function(_0x12c5eb){if(_0x12c5eb){return _0x12c5eb[_0xba90('0x23')](_0x1cb25c)['then'](function(_0x283d05){return _0x283d05;});}return null;};}function removeEntity(_0x522d29,_0x1239b9){return function(_0x31dcec){if(_0x31dcec){return _0x31dcec[_0xba90('0x24')]()[_0xba90('0x25')](function(){_0x522d29[_0xba90('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4b9c,_0x1f9350){return function(_0x165c55){if(!_0x165c55){_0x5f4b9c[_0xba90('0x18')](0x194);}return _0x165c55;};}function handleError(_0x2a9c5b,_0x193c72){_0x193c72=_0x193c72||0x1f4;return function(_0xc61dbb){logger[_0xba90('0x26')](_0xc61dbb[_0xba90('0x27')]);if(_0xc61dbb[_0xba90('0x28')]){delete _0xc61dbb[_0xba90('0x28')];}_0x2a9c5b['status'](_0x193c72)[_0xba90('0x29')](_0xc61dbb);};}exports[_0xba90('0x2a')]=function(_0x1c70f8,_0x1e6dfe){var _0x558d97={},_0x4ee152={},_0x52aada={'count':0x0,'rows':[]};var _0xc932f9=_[_0xba90('0x2b')](db[_0xba90('0x2c')][_0xba90('0x2d')],function(_0x8a7454){return{'name':_0x8a7454[_0xba90('0x2e')],'type':_0x8a7454[_0xba90('0x2f')]['key']};});_0x4ee152[_0xba90('0x30')]=_[_0xba90('0x2b')](_0xc932f9,_0xba90('0x28'));_0x4ee152['query']=_[_0xba90('0x31')](_0x1c70f8['query']);_0x4ee152[_0xba90('0x32')]=_[_0xba90('0x33')](_0x4ee152['model'],_0x4ee152['query']);_0x558d97['attributes']=_[_0xba90('0x33')](_0x4ee152[_0xba90('0x30')],qs[_0xba90('0x34')](_0x1c70f8[_0xba90('0x35')]['fields']));_0x558d97[_0xba90('0x36')]=_0x558d97[_0xba90('0x36')][_0xba90('0x37')]?_0x558d97[_0xba90('0x36')]:_0x4ee152[_0xba90('0x30')];if(!_0x1c70f8[_0xba90('0x35')][_0xba90('0x38')](_0xba90('0x39'))){_0x558d97[_0xba90('0x1d')]=qs['limit'](_0x1c70f8['query'][_0xba90('0x1d')]);_0x558d97[_0xba90('0x1f')]=qs['offset'](_0x1c70f8[_0xba90('0x35')][_0xba90('0x1f')]);}_0x558d97[_0xba90('0x3a')]=qs[_0xba90('0x3b')](_0x1c70f8[_0xba90('0x35')][_0xba90('0x3b')]);_0x558d97['where']=qs['filters'](_[_0xba90('0x3c')](_0x1c70f8[_0xba90('0x35')],_0x4ee152[_0xba90('0x32')]),_0xc932f9);if(_0x1c70f8[_0xba90('0x35')][_0xba90('0x3d')]){_0x558d97['where']=_[_0xba90('0x3e')](_0x558d97[_0xba90('0x3f')],{'$or':_[_0xba90('0x2b')](_0xc932f9,function(_0x3315af){if(_0x3315af['type']!==_0xba90('0x40')){var _0x327858={};_0x327858[_0x3315af['name']]={'$like':'%'+_0x1c70f8[_0xba90('0x35')][_0xba90('0x3d')]+'%'};return _0x327858;}})});}_0x558d97=_[_0xba90('0x3e')]({},_0x558d97,_0x1c70f8[_0xba90('0x41')]);var _0x20e8bf={'where':_0x558d97[_0xba90('0x3f')]};return db[_0xba90('0x2c')][_0xba90('0x1e')](_0x20e8bf)['then'](function(_0x3ee454){_0x52aada[_0xba90('0x1e')]=_0x3ee454;if(_0x1c70f8[_0xba90('0x35')]['includeAll']){_0x558d97[_0xba90('0x42')]=[{'all':!![]}];}return db[_0xba90('0x2c')][_0xba90('0x43')](_0x558d97);})[_0xba90('0x25')](function(_0x550f03){_0x52aada[_0xba90('0x44')]=_0x550f03;return _0x52aada;})[_0xba90('0x25')](respondWithFilteredResult(_0x1e6dfe,_0x558d97))[_0xba90('0x45')](handleError(_0x1e6dfe,null));};exports[_0xba90('0x46')]=function(_0x51feb7,_0x111831){var _0x1befdb={'raw':!![],'where':{'id':_0x51feb7['params']['id']}},_0x219c73={};_0x219c73[_0xba90('0x30')]=_[_0xba90('0x31')](db[_0xba90('0x2c')]['rawAttributes']);_0x219c73[_0xba90('0x35')]=_[_0xba90('0x31')](_0x51feb7[_0xba90('0x35')]);_0x219c73[_0xba90('0x32')]=_[_0xba90('0x33')](_0x219c73[_0xba90('0x30')],_0x219c73[_0xba90('0x35')]);_0x1befdb[_0xba90('0x36')]=_[_0xba90('0x33')](_0x219c73['model'],qs[_0xba90('0x34')](_0x51feb7['query']['fields']));_0x1befdb['attributes']=_0x1befdb['attributes']['length']?_0x1befdb[_0xba90('0x36')]:_0x219c73['model'];if(_0x51feb7[_0xba90('0x35')][_0xba90('0x47')]){_0x1befdb[_0xba90('0x42')]=[{'all':!![]}];}_0x1befdb=_[_0xba90('0x3e')]({},_0x1befdb,_0x51feb7[_0xba90('0x41')]);return db[_0xba90('0x2c')]['find'](_0x1befdb)[_0xba90('0x25')](handleEntityNotFound(_0x111831,null))[_0xba90('0x25')](respondWithResult(_0x111831,null))['catch'](handleError(_0x111831,null));};exports[_0xba90('0x48')]=function(_0x174f8c,_0x2cd497){var _0x515297={'where':{'id':_0x174f8c[_0xba90('0x49')]['id']}},_0x5a8dea={};_0x5a8dea['model']=_['keys'](db[_0xba90('0x2c')][_0xba90('0x2d')]);_0x515297[_0xba90('0x36')]=_['intersection'](_0x5a8dea[_0xba90('0x30')],qs[_0xba90('0x34')](_0x174f8c['query'][_0xba90('0x34')]));_0x515297[_0xba90('0x36')]=_0x515297[_0xba90('0x36')][_0xba90('0x37')]?_0x515297[_0xba90('0x36')]:_0x5a8dea['model'];if(_0x174f8c[_0xba90('0x35')][_0xba90('0x47')]){_0x515297[_0xba90('0x42')]=[{'all':!![]}];}_0x515297=_['merge']({},_0x515297,_0x174f8c['options']);return db['Attachment'][_0xba90('0x4a')](_0x515297)[_0xba90('0x25')](handleEntityNotFound(_0x2cd497,null))[_0xba90('0x25')](function(_0x5c33f1){if(_0x5c33f1){var _0x330b2d=_0x5c33f1[_0xba90('0x4b')]({'plain':!![]});_0x330b2d=qs[_0xba90('0x4c')](_0x330b2d,['id','createdAt','updatedAt']);_0x174f8c['body']=_[_0xba90('0x4c')](_0x174f8c[_0xba90('0x4d')],['id','createdAt',_0xba90('0x4e')]);return db[_0xba90('0x2c')][_0xba90('0x4f')](_[_0xba90('0x3e')](_0x330b2d,_0x174f8c[_0xba90('0x4d')]),{'include':_0x174f8c[_0xba90('0x35')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xba90('0x25')](respondWithResult(_0x2cd497,0xc9))[_0xba90('0x45')](handleError(_0x2cd497,null));};exports[_0xba90('0x23')]=function(_0x1a02ec,_0x44f457){if(_0x1a02ec[_0xba90('0x4d')]['id']){delete _0x1a02ec['body']['id'];}return db[_0xba90('0x2c')][_0xba90('0x4a')]({'where':{'id':_0x1a02ec[_0xba90('0x49')]['id']}})[_0xba90('0x25')](handleEntityNotFound(_0x44f457,null))['then'](saveUpdates(_0x1a02ec[_0xba90('0x4d')],null))[_0xba90('0x25')](respondWithResult(_0x44f457,null))[_0xba90('0x45')](handleError(_0x44f457,null));};exports[_0xba90('0x24')]=function(_0x133453,_0x81a3af){return db[_0xba90('0x2c')][_0xba90('0x4a')]({'where':{'id':_0x133453['params']['id']}})[_0xba90('0x25')](handleEntityNotFound(_0x81a3af,null))[_0xba90('0x25')](removeEntity(_0x81a3af,null))['catch'](handleError(_0x81a3af,null));};exports[_0xba90('0x4f')]=function(_0x2bfc81,_0x597066,_0x21d93a){_0x2bfc81[_0xba90('0x4d')][_0xba90('0x28')]=_0x2bfc81[_0xba90('0x50')][_0xba90('0x51')];_0x2bfc81[_0xba90('0x4d')][_0xba90('0x52')]=_0x2bfc81[_0xba90('0x50')][_0xba90('0x53')];_0x2bfc81[_0xba90('0x4d')][_0xba90('0x2f')]=_0x2bfc81[_0xba90('0x50')][_0xba90('0x54')];return db[_0xba90('0x2c')][_0xba90('0x4f')](_0x2bfc81[_0xba90('0x4d')])['then'](respondWithResult(_0x597066,0xc9))[_0xba90('0x45')](handleError(_0x597066,null));};exports[_0xba90('0x55')]=function(_0x2b4737,_0x3492e4,_0x493533){return db[_0xba90('0x2c')][_0xba90('0x56')]({'where':{'id':_0x2b4737[_0xba90('0x49')]['id']},'raw':!![]})[_0xba90('0x25')](handleEntityNotFound(_0x3492e4,null))[_0xba90('0x25')](function(_0x390b8a){if(_0x390b8a){var _0x1d82e5=_0x390b8a[_0xba90('0x57')]!==null;var _0xb18b3b=path[_0xba90('0x58')](config['root'],_0xba90('0x59'));if(_0x1d82e5){_0xb18b3b=path[_0xba90('0x58')](_0xb18b3b,'offline-chat/');}var _0x406c2f=path[_0xba90('0x58')](_0xb18b3b,_0x390b8a['basename']);return _0x3492e4['download'](_0x406c2f);}})[_0xba90('0x45')](handleError(_0x3492e4,null));};
\ No newline at end of file
+var _0x71be=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','clone','omit','createdAt','updatedAt','body','create','update','file','originalname','filename','type','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','offline-chat/','join','basename','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','model','query','keys','filters'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x71be,0x86));var _0xe71b=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0x71be[_0x577519];return _0x5b12f7;};'use strict';var emlformat=require(_0xe71b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe71b('0x1'));var moment=require(_0xe71b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xe71b('0x3'));var util=require(_0xe71b('0x4'));var path=require(_0xe71b('0x5'));var sox=require(_0xe71b('0x6'));var csv=require(_0xe71b('0x7'));var ejs=require(_0xe71b('0x8'));var fs=require('fs');var fs_extra=require(_0xe71b('0x9'));var _=require(_0xe71b('0xa'));var squel=require(_0xe71b('0xb'));var crypto=require(_0xe71b('0xc'));var jsforce=require(_0xe71b('0xd'));var deskjs=require(_0xe71b('0xe'));var toCsv=require(_0xe71b('0x7'));var querystring=require(_0xe71b('0xf'));var Papa=require(_0xe71b('0x10'));var Redis=require(_0xe71b('0x11'));var authService=require(_0xe71b('0x12'));var qs=require(_0xe71b('0x13'));var as=require(_0xe71b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe71b('0x15'))(_0xe71b('0x16'));var utils=require(_0xe71b('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe71b('0x18'))['db'];function respondWithStatusCode(_0x304f32,_0x5b765e){_0x5b765e=_0x5b765e||0xcc;return function(_0x2bca94){if(_0x2bca94){return _0x304f32['sendStatus'](_0x5b765e);}return _0x304f32[_0xe71b('0x19')](_0x5b765e)[_0xe71b('0x1a')]();};}function respondWithResult(_0x810cc2,_0x4d4833){_0x4d4833=_0x4d4833||0xc8;return function(_0x21f305){if(_0x21f305){return _0x810cc2[_0xe71b('0x19')](_0x4d4833)['json'](_0x21f305);}};}function respondWithFilteredResult(_0x4442d5,_0x4388da){return function(_0x4c5884){if(_0x4c5884){var _0x5d59e4=typeof _0x4388da['offset']===_0xe71b('0x1b')&&typeof _0x4388da[_0xe71b('0x1c')]===_0xe71b('0x1b');var _0x453f33=_0x4c5884[_0xe71b('0x1d')];var _0x340331=_0x5d59e4?0x0:_0x4388da[_0xe71b('0x1e')];var _0x4a4589=_0x5d59e4?_0x4c5884[_0xe71b('0x1d')]:_0x4388da[_0xe71b('0x1e')]+_0x4388da[_0xe71b('0x1c')];var _0x1c5a52;if(_0x4a4589>=_0x453f33){_0x4a4589=_0x453f33;_0x1c5a52=0xc8;}else{_0x1c5a52=0xce;}_0x4442d5[_0xe71b('0x19')](_0x1c5a52);return _0x4442d5[_0xe71b('0x1f')](_0xe71b('0x20'),_0x340331+'-'+_0x4a4589+'/'+_0x453f33)[_0xe71b('0x21')](_0x4c5884);}return null;};}function patchUpdates(_0x5617c2){return function(_0x8185b){try{jsonpatch[_0xe71b('0x22')](_0x8185b,_0x5617c2,!![]);}catch(_0x4dc51b){return BPromise[_0xe71b('0x23')](_0x4dc51b);}return _0x8185b[_0xe71b('0x24')]();};}function saveUpdates(_0x1bfdcd,_0xa32480){return function(_0x5f4270){if(_0x5f4270){return _0x5f4270['update'](_0x1bfdcd)[_0xe71b('0x25')](function(_0x19f16c){return _0x19f16c;});}return null;};}function removeEntity(_0x4d869d,_0x2cab00){return function(_0x81d5e){if(_0x81d5e){return _0x81d5e['destroy']()[_0xe71b('0x25')](function(){_0x4d869d[_0xe71b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d29fd,_0x163afa){return function(_0x59f458){if(!_0x59f458){_0x5d29fd[_0xe71b('0x26')](0x194);}return _0x59f458;};}function handleError(_0x464717,_0x31545e){_0x31545e=_0x31545e||0x1f4;return function(_0xf5c211){logger[_0xe71b('0x27')](_0xf5c211[_0xe71b('0x28')]);if(_0xf5c211[_0xe71b('0x29')]){delete _0xf5c211[_0xe71b('0x29')];}_0x464717[_0xe71b('0x19')](_0x31545e)[_0xe71b('0x2a')](_0xf5c211);};}exports[_0xe71b('0x2b')]=function(_0x208bc8,_0x364eac){var _0x7e2127={},_0x52dd16={},_0x370b27={'count':0x0,'rows':[]};var _0x44e2fa=_[_0xe71b('0x2c')](db[_0xe71b('0x2d')][_0xe71b('0x2e')],function(_0x4cbd15){return{'name':_0x4cbd15[_0xe71b('0x2f')],'type':_0x4cbd15['type']['key']};});_0x52dd16[_0xe71b('0x30')]=_[_0xe71b('0x2c')](_0x44e2fa,_0xe71b('0x29'));_0x52dd16[_0xe71b('0x31')]=_[_0xe71b('0x32')](_0x208bc8['query']);_0x52dd16[_0xe71b('0x33')]=_[_0xe71b('0x34')](_0x52dd16[_0xe71b('0x30')],_0x52dd16[_0xe71b('0x31')]);_0x7e2127['attributes']=_[_0xe71b('0x34')](_0x52dd16[_0xe71b('0x30')],qs[_0xe71b('0x35')](_0x208bc8[_0xe71b('0x31')]['fields']));_0x7e2127[_0xe71b('0x36')]=_0x7e2127['attributes'][_0xe71b('0x37')]?_0x7e2127[_0xe71b('0x36')]:_0x52dd16['model'];if(!_0x208bc8[_0xe71b('0x31')][_0xe71b('0x38')](_0xe71b('0x39'))){_0x7e2127[_0xe71b('0x1c')]=qs[_0xe71b('0x1c')](_0x208bc8['query'][_0xe71b('0x1c')]);_0x7e2127[_0xe71b('0x1e')]=qs[_0xe71b('0x1e')](_0x208bc8[_0xe71b('0x31')][_0xe71b('0x1e')]);}_0x7e2127[_0xe71b('0x3a')]=qs['sort'](_0x208bc8['query'][_0xe71b('0x3b')]);_0x7e2127[_0xe71b('0x3c')]=qs[_0xe71b('0x33')](_[_0xe71b('0x3d')](_0x208bc8[_0xe71b('0x31')],_0x52dd16[_0xe71b('0x33')]),_0x44e2fa);if(_0x208bc8[_0xe71b('0x31')][_0xe71b('0x3e')]){_0x7e2127[_0xe71b('0x3c')]=_[_0xe71b('0x3f')](_0x7e2127[_0xe71b('0x3c')],{'$or':_[_0xe71b('0x2c')](_0x44e2fa,function(_0x1ea591){if(_0x1ea591['type']!==_0xe71b('0x40')){var _0x3e2617={};_0x3e2617[_0x1ea591[_0xe71b('0x29')]]={'$like':'%'+_0x208bc8[_0xe71b('0x31')][_0xe71b('0x3e')]+'%'};return _0x3e2617;}})});}_0x7e2127=_[_0xe71b('0x3f')]({},_0x7e2127,_0x208bc8[_0xe71b('0x41')]);var _0x2a90e7={'where':_0x7e2127[_0xe71b('0x3c')]};return db[_0xe71b('0x2d')][_0xe71b('0x1d')](_0x2a90e7)['then'](function(_0x201798){_0x370b27[_0xe71b('0x1d')]=_0x201798;if(_0x208bc8[_0xe71b('0x31')][_0xe71b('0x42')]){_0x7e2127[_0xe71b('0x43')]=[{'all':!![]}];}return db[_0xe71b('0x2d')][_0xe71b('0x44')](_0x7e2127);})[_0xe71b('0x25')](function(_0x190afe){_0x370b27[_0xe71b('0x45')]=_0x190afe;return _0x370b27;})[_0xe71b('0x25')](respondWithFilteredResult(_0x364eac,_0x7e2127))['catch'](handleError(_0x364eac,null));};exports[_0xe71b('0x46')]=function(_0xf932f7,_0x2c9217){var _0x4b676f={'raw':!![],'where':{'id':_0xf932f7[_0xe71b('0x47')]['id']}},_0x523805={};_0x523805[_0xe71b('0x30')]=_[_0xe71b('0x32')](db['Attachment'][_0xe71b('0x2e')]);_0x523805[_0xe71b('0x31')]=_[_0xe71b('0x32')](_0xf932f7[_0xe71b('0x31')]);_0x523805[_0xe71b('0x33')]=_[_0xe71b('0x34')](_0x523805['model'],_0x523805['query']);_0x4b676f[_0xe71b('0x36')]=_[_0xe71b('0x34')](_0x523805['model'],qs['fields'](_0xf932f7['query'][_0xe71b('0x35')]));_0x4b676f[_0xe71b('0x36')]=_0x4b676f[_0xe71b('0x36')]['length']?_0x4b676f['attributes']:_0x523805[_0xe71b('0x30')];if(_0xf932f7['query'][_0xe71b('0x42')]){_0x4b676f['include']=[{'all':!![]}];}_0x4b676f=_[_0xe71b('0x3f')]({},_0x4b676f,_0xf932f7[_0xe71b('0x41')]);return db[_0xe71b('0x2d')][_0xe71b('0x48')](_0x4b676f)[_0xe71b('0x25')](handleEntityNotFound(_0x2c9217,null))[_0xe71b('0x25')](respondWithResult(_0x2c9217,null))[_0xe71b('0x49')](handleError(_0x2c9217,null));};exports[_0xe71b('0x4a')]=function(_0x42e6d0,_0x34a40a){var _0x430fcf={'where':{'id':_0x42e6d0[_0xe71b('0x47')]['id']}},_0x541131={};_0x541131['model']=_[_0xe71b('0x32')](db[_0xe71b('0x2d')][_0xe71b('0x2e')]);_0x430fcf[_0xe71b('0x36')]=_['intersection'](_0x541131[_0xe71b('0x30')],qs[_0xe71b('0x35')](_0x42e6d0['query'][_0xe71b('0x35')]));_0x430fcf[_0xe71b('0x36')]=_0x430fcf[_0xe71b('0x36')]['length']?_0x430fcf[_0xe71b('0x36')]:_0x541131[_0xe71b('0x30')];if(_0x42e6d0[_0xe71b('0x31')]['includeAll']){_0x430fcf[_0xe71b('0x43')]=[{'all':!![]}];}_0x430fcf=_[_0xe71b('0x3f')]({},_0x430fcf,_0x42e6d0['options']);return db[_0xe71b('0x2d')]['find'](_0x430fcf)[_0xe71b('0x25')](handleEntityNotFound(_0x34a40a,null))[_0xe71b('0x25')](function(_0x8876b8){if(_0x8876b8){var _0x5bb387=_0x8876b8['get']({'plain':!![]});_0x5bb387=qs[_0xe71b('0x4b')](_0x5bb387,['id',_0xe71b('0x4c'),_0xe71b('0x4d')]);_0x42e6d0[_0xe71b('0x4e')]=_['omit'](_0x42e6d0[_0xe71b('0x4e')],['id','createdAt','updatedAt']);return db[_0xe71b('0x2d')][_0xe71b('0x4f')](_[_0xe71b('0x3f')](_0x5bb387,_0x42e6d0[_0xe71b('0x4e')]),{'include':_0x42e6d0[_0xe71b('0x31')][_0xe71b('0x42')]?[{'all':!![]}]:undefined});}})[_0xe71b('0x25')](respondWithResult(_0x34a40a,0xc9))[_0xe71b('0x49')](handleError(_0x34a40a,null));};exports[_0xe71b('0x50')]=function(_0x2b890b,_0x19cc7d){if(_0x2b890b['body']['id']){delete _0x2b890b['body']['id'];}return db['Attachment'][_0xe71b('0x48')]({'where':{'id':_0x2b890b[_0xe71b('0x47')]['id']}})[_0xe71b('0x25')](handleEntityNotFound(_0x19cc7d,null))[_0xe71b('0x25')](saveUpdates(_0x2b890b[_0xe71b('0x4e')],null))['then'](respondWithResult(_0x19cc7d,null))[_0xe71b('0x49')](handleError(_0x19cc7d,null));};exports['destroy']=function(_0x7176b8,_0x41a2d7){return db[_0xe71b('0x2d')][_0xe71b('0x48')]({'where':{'id':_0x7176b8[_0xe71b('0x47')]['id']}})[_0xe71b('0x25')](handleEntityNotFound(_0x41a2d7,null))['then'](removeEntity(_0x41a2d7,null))[_0xe71b('0x49')](handleError(_0x41a2d7,null));};exports[_0xe71b('0x4f')]=function(_0x31c448,_0x2545b1,_0x20ecc7){_0x31c448['body'][_0xe71b('0x29')]=_0x31c448[_0xe71b('0x51')][_0xe71b('0x52')];_0x31c448[_0xe71b('0x4e')]['basename']=_0x31c448[_0xe71b('0x51')][_0xe71b('0x53')];_0x31c448['body'][_0xe71b('0x54')]=_0x31c448[_0xe71b('0x51')][_0xe71b('0x55')];return db[_0xe71b('0x2d')]['create'](_0x31c448[_0xe71b('0x4e')])['then'](respondWithResult(_0x2545b1,0xc9))[_0xe71b('0x49')](handleError(_0x2545b1,null));};exports[_0xe71b('0x56')]=function(_0x22826c,_0x12e89a,_0x3b8609){return db[_0xe71b('0x2d')][_0xe71b('0x57')]({'where':{'id':_0x22826c['params']['id']},'raw':!![]})[_0xe71b('0x25')](handleEntityNotFound(_0x12e89a,null))[_0xe71b('0x25')](function(_0x12bd95){if(_0x12bd95){var _0x35e5fd=_0x12bd95[_0xe71b('0x58')]!==null;var _0x3f830e=path['join'](config['root'],_0xe71b('0x59'));if(_0x35e5fd){_0x3f830e=path['join'](_0x3f830e,_0xe71b('0x5a'));}var _0x7aacee=path[_0xe71b('0x5b')](_0x3f830e,_0x12bd95[_0xe71b('0x5c')]);return _0x12e89a['download'](_0x7aacee);}})['catch'](handleError(_0x12e89a,null));};
\ No newline at end of file
index 7403170..81d27fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba7b=['Attachment','attachments','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x401234,_0xfd4275){var _0x12842c=function(_0x1286df){while(--_0x1286df){_0x401234['push'](_0x401234['shift']());}};_0x12842c(++_0xfd4275);}(_0xba7b,0x14c));var _0xbba7=function(_0xda3f7,_0x589235){_0xda3f7=_0xda3f7-0x0;var _0x308866=_0xba7b[_0xda3f7];return _0x308866;};'use strict';var _=require(_0xbba7('0x0'));var util=require(_0xbba7('0x1'));var logger=require(_0xbba7('0x2'))('api');var moment=require(_0xbba7('0x3'));var BPromise=require(_0xbba7('0x4'));var rp=require(_0xbba7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbba7('0x6'));var attributes=require('./attachment.attributes');module[_0xbba7('0x7')]=function(_0x16df83,_0x57706){return _0x16df83['define'](_0xbba7('0x8'),attributes,{'tableName':_0xbba7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61bc=['bluebird','rimraf','../../config/environment','./attachment.attributes','define','attachments','util','../../config/logger','api','moment'];(function(_0x439a54,_0x50e19a){var _0x194a38=function(_0x584c87){while(--_0x584c87){_0x439a54['push'](_0x439a54['shift']());}};_0x194a38(++_0x50e19a);}(_0x61bc,0x1d2));var _0xc61b=function(_0x375766,_0x446b5f){_0x375766=_0x375766-0x0;var _0x21e179=_0x61bc[_0x375766];return _0x21e179;};'use strict';var _=require('lodash');var util=require(_0xc61b('0x0'));var logger=require(_0xc61b('0x1'))(_0xc61b('0x2'));var moment=require(_0xc61b('0x3'));var BPromise=require(_0xc61b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc61b('0x5'));var config=require(_0xc61b('0x6'));var attributes=require(_0xc61b('0x7'));module['exports']=function(_0xc99cf1,_0x48a133){return _0xc99cf1[_0xc61b('0x8')]('Attachment',attributes,{'tableName':_0xc61b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf0cf2b..27cbad7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d70=['jayson/promise','client','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Attachment','create','body','options','raw','then','CreateAttachment','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x5d70,0x8d));var _0x05d7=function(_0x5a31bd,_0x4977f9){_0x5a31bd=_0x5a31bd-0x0;var _0x3dc4e8=_0x5d70[_0x5a31bd];return _0x3dc4e8;};'use strict';var _=require(_0x05d7('0x0'));var util=require(_0x05d7('0x1'));var moment=require('moment');var BPromise=require(_0x05d7('0x2'));var rs=require(_0x05d7('0x3'));var fs=require('fs');var Redis=require(_0x05d7('0x4'));var db=require(_0x05d7('0x5'))['db'];var utils=require(_0x05d7('0x6'));var logger=require(_0x05d7('0x7'))('rpc');var config=require(_0x05d7('0x8'));var jayson=require(_0x05d7('0x9'));var client=jayson[_0x05d7('0xa')][_0x05d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b155c,_0x54d5be,_0x1e1254){return new BPromise(function(_0x29a5e0,_0x147340){return client['request'](_0x4b155c,_0x1e1254)['then'](function(_0x1cc0a3){logger[_0x05d7('0xc')](_0x05d7('0xd'),_0x54d5be,_0x05d7('0xe'));logger[_0x05d7('0xf')](_0x05d7('0x10'),_0x54d5be,_0x05d7('0xe'),JSON[_0x05d7('0x11')](_0x1cc0a3));if(_0x1cc0a3[_0x05d7('0x12')]){if(_0x1cc0a3[_0x05d7('0x12')][_0x05d7('0x13')]===0x1f4){logger[_0x05d7('0x12')](_0x05d7('0xd'),_0x54d5be,_0x1cc0a3[_0x05d7('0x12')][_0x05d7('0x14')]);return _0x147340(_0x1cc0a3[_0x05d7('0x12')][_0x05d7('0x14')]);}logger[_0x05d7('0x12')](_0x05d7('0xd'),_0x54d5be,_0x1cc0a3[_0x05d7('0x12')][_0x05d7('0x14')]);return _0x29a5e0(_0x1cc0a3[_0x05d7('0x12')][_0x05d7('0x14')]);}else{logger['info'](_0x05d7('0xd'),_0x54d5be,'request\x20sent');_0x29a5e0(_0x1cc0a3[_0x05d7('0x15')][_0x05d7('0x14')]);}})['catch'](function(_0x559545){logger['error']('Attachment,\x20%s,\x20%s',_0x54d5be,_0x559545);_0x147340(_0x559545);});});}exports['CreateAttachment']=function(_0x3e364b){var _0x9e84b2=this;return new Promise(function(_0x292d48,_0x248d88){return db[_0x05d7('0x16')][_0x05d7('0x17')](_0x3e364b[_0x05d7('0x18')],{'raw':_0x3e364b[_0x05d7('0x19')]?_0x3e364b[_0x05d7('0x19')][_0x05d7('0x1a')]===undefined?!![]:![]:!![]})[_0x05d7('0x1b')](function(_0x31199b){logger['info'](_0x05d7('0x1c'),_0x3e364b);logger['debug']('CreateAttachment',_0x3e364b,JSON[_0x05d7('0x11')](_0x31199b));_0x292d48(_0x31199b);})[_0x05d7('0x1d')](function(_0xd1e51b){logger[_0x05d7('0x12')](_0x05d7('0x1c'),_0xd1e51b[_0x05d7('0x14')],_0x3e364b);_0x248d88(_0x9e84b2[_0x05d7('0x12')](0x1f4,_0xd1e51b[_0x05d7('0x14')]));});});};
\ No newline at end of file
+var _0x8388=['rpc','jayson/promise','client','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x8388,0x18d));var _0x8838=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x8388[_0x1bc762];return _0x40f70c;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca2d0f,_0x2d9615,_0x27707c){return new BPromise(function(_0x56596f,_0x4645f4){return client['request'](_0xca2d0f,_0x27707c)['then'](function(_0x8555b2){logger['info']('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));logger[_0x8838('0xc')](_0x8838('0xd'),_0x2d9615,_0x8838('0xb'),JSON['stringify'](_0x8555b2));if(_0x8555b2[_0x8838('0xe')]){if(_0x8555b2[_0x8838('0xe')][_0x8838('0xf')]===0x1f4){logger[_0x8838('0xe')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8555b2[_0x8838('0xe')]['message']);return _0x4645f4(_0x8555b2['error'][_0x8838('0x10')]);}logger[_0x8838('0xe')](_0x8838('0x11'),_0x2d9615,_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);return _0x56596f(_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);}else{logger[_0x8838('0x12')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));_0x56596f(_0x8555b2[_0x8838('0x13')]['message']);}})[_0x8838('0x14')](function(_0xab3fb8){logger[_0x8838('0xe')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0xab3fb8);_0x4645f4(_0xab3fb8);});});}exports[_0x8838('0x15')]=function(_0x522d44){var _0xc4129=this;return new Promise(function(_0x204120,_0xe9e4f4){return db['Attachment'][_0x8838('0x16')](_0x522d44[_0x8838('0x17')],{'raw':_0x522d44['options']?_0x522d44[_0x8838('0x18')][_0x8838('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x9de0f6){logger[_0x8838('0x12')]('CreateAttachment',_0x522d44);logger['debug'](_0x8838('0x15'),_0x522d44,JSON[_0x8838('0x1a')](_0x9de0f6));_0x204120(_0x9de0f6);})[_0x8838('0x14')](function(_0xb74e1b){logger[_0x8838('0xe')](_0x8838('0x15'),_0xb74e1b[_0x8838('0x10')],_0x522d44);_0xe9e4f4(_0xc4129[_0x8838('0xe')](0x1f4,_0xb74e1b[_0x8838('0x10')]));});});};
\ No newline at end of file
index 5e57b7c..6accaf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x37a66e,_0x1a169f){var _0x1a3329=function(_0x3d657b){while(--_0x3d657b){_0x37a66e['push'](_0x37a66e['shift']());}};_0x1a3329(++_0x1a169f);}(_0xadb5,0xad));var _0x5adb=function(_0x13de80,_0x51d47f){_0x13de80=_0x13de80-0x0;var _0x14138e=_0xadb5[_0x13de80];return _0x14138e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x26d319,_0x15e6f1){var _0xbd58df=function(_0xda75c6){while(--_0xda75c6){_0x26d319['push'](_0x26d319['shift']());}};_0xbd58df(++_0x15e6f1);}(_0x2032,0xd9));var _0x2203=function(_0x25ac96,_0x3ff063){_0x25ac96=_0x25ac96-0x0;var _0x1a3761=_0x2032[_0x25ac96];return _0x1a3761;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
index b23dfe5..ec298e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd961=['admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','blockDuration','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../config/environment','../../components/auth/service','signToken','../../config/utils','google','/login','profile','email','use','secret','callbackURL','Setting','findOne','allowedLoginAttempts','then','User','find','map','emails','value'];(function(_0x5d7726,_0x57adac){var _0x521e1c=function(_0x3799a1){while(--_0x3799a1){_0x5d7726['push'](_0x5d7726['shift']());}};_0x521e1c(++_0x57adac);}(_0xd961,0x174));var _0x1d96=function(_0x4c3904,_0x56db61){_0x4c3904=_0x4c3904-0x0;var _0x44fd48=_0xd961[_0x4c3904];return _0x44fd48;};'use strict';var _=require(_0x1d96('0x0'));var passport=require(_0x1d96('0x1'));var GoogleStrategy=require(_0x1d96('0x2'))['Strategy'];var moment=require(_0x1d96('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x1d96('0x4'));var signToken=require(_0x1d96('0x5'))[_0x1d96('0x6')];var utils=require(_0x1d96('0x7'));exports['login']=passport['authenticate'](_0x1d96('0x8'),{'failureRedirect':_0x1d96('0x9'),'scope':[_0x1d96('0xa'),_0x1d96('0xb')],'session':![]});exports['callback']=passport['authenticate'](_0x1d96('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x1d96('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x1d96('0x8')]['clientID']:'id','clientSecret':config['google']?config[_0x1d96('0x8')]['clientSecret']:_0x1d96('0xd'),'callbackURL':config[_0x1d96('0x8')]?config['google'][_0x1d96('0xe')]:''},function(_0x2c427a,_0x45d39f,_0x48c593,_0x3535b4){var _0x4e7eae,_0x45783b;return db[_0x1d96('0xf')][_0x1d96('0x10')]({'where':{'id':0x1},'attributes':[_0x1d96('0x11'),'blockDuration'],'raw':!![]})[_0x1d96('0x12')](function(_0x33dc13){_0x4e7eae=_0x33dc13;return db[_0x1d96('0x13')][_0x1d96('0x14')]({'where':{'email':_[_0x1d96('0x15')](_0x48c593[_0x1d96('0x16')],_0x1d96('0x17')),'role':{'$or':[_0x1d96('0x18'),_0x1d96('0x19'),_0x1d96('0x1a')]}}});})[_0x1d96('0x12')](function(_0x40344f){_0x45783b=_0x40344f;if(_0x45783b){if(_0x45783b[_0x1d96('0x1b')]){return _0x3535b4(_0x1d96('0x1c'));}else if(_0x4e7eae['blockDuration']>0x0){if(_0x45783b[_0x1d96('0x1d')]){if(moment(_0x45783b[_0x1d96('0x1e')])[_0x1d96('0x1f')](_0x4e7eae[_0x1d96('0x20')],'minutes')>moment()){return _0x3535b4(_0x1d96('0x1c'));}else{return utils[_0x1d96('0x21')](_0x45783b,0x0,![],null)[_0x1d96('0x12')](function(){return utils[_0x1d96('0x22')](_0x45783b);})[_0x1d96('0x12')](function(){return _0x3535b4(null,_0x45783b);});}}else{return utils[_0x1d96('0x22')](_0x45783b)['then'](function(){return _0x3535b4(null,_0x45783b);});}}else{return utils[_0x1d96('0x22')](_0x45783b)['then'](function(){return _0x3535b4(null,_0x45783b);});}}return _0x3535b4(_0x1d96('0x1c'));})[_0x1d96('0x23')](function(_0xd96368){_0x3535b4(_0xd96368);});}));
\ No newline at end of file
+var _0x7ff0=['signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','Setting','blockDuration','then','User','find','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','passport-google-oauth20','../../config/environment','../../components/auth/service'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7ff0,0x190));var _0x07ff=function(_0x1e06f1,_0x59d7e1){_0x1e06f1=_0x1e06f1-0x0;var _0x34f77e=_0x7ff0[_0x1e06f1];return _0x34f77e;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x07ff('0x0'))['Strategy'];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x07ff('0x1'));var signToken=require(_0x07ff('0x2'))[_0x07ff('0x3')];var utils=require(_0x07ff('0x4'));exports[_0x07ff('0x5')]=passport[_0x07ff('0x6')](_0x07ff('0x7'),{'failureRedirect':_0x07ff('0x8'),'scope':[_0x07ff('0x9'),_0x07ff('0xa')],'session':![]});exports[_0x07ff('0xb')]=passport[_0x07ff('0x6')](_0x07ff('0x7'),{'failureRedirect':_0x07ff('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x07ff('0x7')][_0x07ff('0xc')]:'id','clientSecret':config['google']?config[_0x07ff('0x7')]['clientSecret']:'secret','callbackURL':config[_0x07ff('0x7')]?config['google']['callbackURL']:''},function(_0x41f650,_0x47f785,_0x12a2db,_0x372d39){var _0x307161,_0xb1028b;return db[_0x07ff('0xd')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x07ff('0xe')],'raw':!![]})[_0x07ff('0xf')](function(_0x598a26){_0x307161=_0x598a26;return db[_0x07ff('0x10')][_0x07ff('0x11')]({'where':{'email':_[_0x07ff('0x12')](_0x12a2db[_0x07ff('0x13')],_0x07ff('0x14')),'role':{'$or':[_0x07ff('0x15'),_0x07ff('0x16'),_0x07ff('0x17')]}}});})[_0x07ff('0xf')](function(_0x24d937){_0xb1028b=_0x24d937;if(_0xb1028b){if(_0xb1028b[_0x07ff('0x18')]){return _0x372d39(_0x07ff('0x19'));}else if(_0x307161[_0x07ff('0xe')]>0x0){if(_0xb1028b[_0x07ff('0x1a')]){if(moment(_0xb1028b[_0x07ff('0x1b')])[_0x07ff('0x1c')](_0x307161['blockDuration'],'minutes')>moment()){return _0x372d39(_0x07ff('0x19'));}else{return utils[_0x07ff('0x1d')](_0xb1028b,0x0,![],null)[_0x07ff('0xf')](function(){return utils[_0x07ff('0x1e')](_0xb1028b);})[_0x07ff('0xf')](function(){return _0x372d39(null,_0xb1028b);});}}else{return utils[_0x07ff('0x1e')](_0xb1028b)[_0x07ff('0xf')](function(){return _0x372d39(null,_0xb1028b);});}}else{return utils[_0x07ff('0x1e')](_0xb1028b)[_0x07ff('0xf')](function(){return _0x372d39(null,_0xb1028b);});}}return _0x372d39(_0x07ff('0x19'));})['catch'](function(_0xcf0144){_0x372d39(_0xcf0144);});}));
\ No newline at end of file
index 54dfe59..9e2a4c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb539=['get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','../user/user.controller.js','../../components/auth/service'];(function(_0x5570ac,_0x44b319){var _0x83ebc4=function(_0x512c4c){while(--_0x512c4c){_0x5570ac['push'](_0x5570ac['shift']());}};_0x83ebc4(++_0x44b319);}(_0xb539,0x8b));var _0x9b53=function(_0x412ed6,_0x5ac827){_0x412ed6=_0x412ed6-0x0;var _0x3883d2=_0xb539[_0x412ed6];return _0x3883d2;};'use strict';var express=require(_0x9b53('0x0'));var passport=require(_0x9b53('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x9b53('0x2'));var authService=require(_0x9b53('0x3'));router['get']('/',controller['login']);router[_0x9b53('0x4')](_0x9b53('0x5'),controller[_0x9b53('0x6')],authService[_0x9b53('0x7')],userController[_0x9b53('0x8')],authService[_0x9b53('0x9')]);module[_0x9b53('0xa')]=router;
\ No newline at end of file
+var _0xe168=['exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xe168,0x79));var _0x8e16=function(_0x5e92ea,_0x2511c2){_0x5e92ea=_0x5e92ea-0x0;var _0x5d1e68=_0xe168[_0x5e92ea];return _0x5d1e68;};'use strict';var express=require('express');var passport=require(_0x8e16('0x0'));var router=express[_0x8e16('0x1')]();var controller=require(_0x8e16('0x2'));var userController=require(_0x8e16('0x3'));var authService=require(_0x8e16('0x4'));router[_0x8e16('0x5')]('/',controller[_0x8e16('0x6')]);router['get']('/callback',controller['callback'],authService[_0x8e16('0x7')],userController[_0x8e16('0x6')],authService[_0x8e16('0x8')]);module[_0x8e16('0x9')]=router;
\ No newline at end of file
index f4fffe2..f618ce4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x453b=['now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','token','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','blockDuration','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','authentication','auth','merge','request','SendMail','error','message','stringify','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires'];(function(_0x410e4e,_0x54f0ad){var _0x13e214=function(_0x11528a){while(--_0x11528a){_0x410e4e['push'](_0x410e4e['shift']());}};_0x13e214(++_0x54f0ad);}(_0x453b,0x164));var _0xb453=function(_0x3cb86b,_0x3c75f6){_0x3cb86b=_0x3cb86b-0x0;var _0x3c10a0=_0x453b[_0x3cb86b];return _0x3c10a0;};'use strict';var util=require(_0xb453('0x0'));var passport=require(_0xb453('0x1'));var LocalStrategy=require(_0xb453('0x2'))[_0xb453('0x3')];var jayson=require(_0xb453('0x4'));var _=require(_0xb453('0x5'));var rs=require(_0xb453('0x6'));var moment=require(_0xb453('0x7'));var db=require(_0xb453('0x8'))['db'];var authService=require(_0xb453('0x9'));var utils=require(_0xb453('0xa'));var client=jayson[_0xb453('0xb')][_0xb453('0xc')]({'port':0x232b});function localAuthenticate(_0x4d7c1e,_0x1ab841,_0x2436a7,_0x4fdd93){var _0x12c490,_0x3486a8;return db['Setting'][_0xb453('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb453('0xe')],'raw':!![]})[_0xb453('0xf')](function(_0x446cd3){_0x12c490=_0x446cd3;return _0x4d7c1e[_0xb453('0xd')]({'attributes':['id','name',_0xb453('0x10'),_0xb453('0x11'),_0xb453('0x12'),_0xb453('0x13'),_0xb453('0x14'),_0xb453('0x15'),_0xb453('0x16')],'where':{'name':_0x1ab841,'role':{'$or':[_0xb453('0x17'),_0xb453('0x18'),'agent']}}});})['then'](function(_0x4e930c){if(!_0x4e930c||_0x4e930c&&_0x4e930c[_0xb453('0x19')]!==_0x1ab841){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3486a8=_0x4e930c;return _0x3486a8;}})[_0xb453('0xf')](function(){_0x3486a8[_0xb453('0x1a')](_0x2436a7,function(_0x1cb023,_0x4b3d05){var _0x5ee747=_0x3486a8[_0xb453('0x16')]+0x1;if(_0x1cb023){return _0x4fdd93(_0x1cb023);}else if(!_0x4b3d05){if(_0x3486a8[_0xb453('0x13')]){return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}else if(_0x12c490[_0xb453('0x1c')]>0x0){if(_0x3486a8[_0xb453('0x14')]){if(_0x12c490[_0xb453('0xe')]>0x0){if(moment(_0x3486a8[_0xb453('0x15')])[_0xb453('0x1d')](_0x12c490[_0xb453('0xe')],'minutes')>moment()){return _0x4fdd93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x3486a8,_0x5ee747,![],null)['then'](function(){return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});});}}else{return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}}else{if(_0x5ee747>=_0x12c490[_0xb453('0x1c')]){return utils[_0xb453('0x1e')](_0x3486a8,0x0,!![],moment())[_0xb453('0xf')](function(){return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});});}else{return utils['clearBlockUser'](_0x3486a8,_0x5ee747,![],null)['then'](function(){return _0x4fdd93(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}}else{if(_0x3486a8['disabled']){return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}else if(_0x12c490[_0xb453('0x1c')]>0x0){if(_0x3486a8[_0xb453('0x14')]){if(_0x12c490[_0xb453('0xe')]>0x0){if(moment(_0x3486a8[_0xb453('0x15')])[_0xb453('0x1d')](_0x12c490[_0xb453('0xe')],_0xb453('0x1f'))>moment()){return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}else{return utils['clearBlockUser'](_0x3486a8,0x0,![],null)[_0xb453('0xf')](function(){return utils[_0xb453('0x20')](_0x3486a8);})[_0xb453('0xf')](function(){return _0x4fdd93(null,_0x3486a8);});}}else{return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}}else{return utils[_0xb453('0x1e')](_0x3486a8,0x0,![],null)[_0xb453('0xf')](function(){return utils[_0xb453('0x20')](_0x3486a8);})[_0xb453('0xf')](function(){return _0x4fdd93(null,_0x3486a8);})[_0xb453('0x21')](function(_0x1e65cc){return _0x4fdd93(null,![],_0x1e65cc);});}}else{if(_0x3486a8[_0xb453('0x14')]){return _0x4fdd93(null,![],{'message':_0xb453('0x1b')});}else{return utils[_0xb453('0x20')](_0x3486a8)['then'](function(){return _0x4fdd93(null,_0x3486a8);});}}}});})[_0xb453('0x21')](function(_0x170809){return _0x4fdd93(null,![],_0x170809);});}function sendServiceMail(_0x9da2f4){return db[_0xb453('0x22')][_0xb453('0x23')]({'where':{'service':!![]},'attributes':['id',_0xb453('0x19'),_0xb453('0x24')],'include':[{'model':db[_0xb453('0x25')],'as':_0xb453('0x26')}]})['then'](function(_0x3e7418){if(!_0x3e7418){throw new Error(_0xb453('0x27'));}var _0x3e386d={'tls':{'rejectUnauthorized':![]}};if(_0x3e7418['Smtp']['service']){_0x3e386d[_0xb453('0x28')]=_0x3e7418[_0xb453('0x26')][_0xb453('0x28')];}else{_0x3e386d[_0xb453('0x29')]=_0x3e7418['Smtp']['host'];_0x3e386d['port']=_0x3e7418[_0xb453('0x26')]['port'];_0x3e386d['secure']=_0x3e7418[_0xb453('0x26')][_0xb453('0x2a')];}if(_0x3e7418[_0xb453('0x26')][_0xb453('0x2b')]){_0x3e386d[_0xb453('0x2c')]={'user':_0x3e7418[_0xb453('0x26')][_0xb453('0x18')],'pass':_0x3e7418[_0xb453('0x26')]['pass']};}var _0x49250f={'account':_0x3e386d,'message':_[_0xb453('0x2d')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x3e7418[_0xb453('0x19')],_0x3e7418[_0xb453('0x24')]||_0x3e7418['Smtp'][_0xb453('0x18')])},_0x9da2f4)};return client[_0xb453('0x2e')](_0xb453('0x2f'),_0x49250f);})[_0xb453('0xf')](function(_0x174711){if(_0x174711['error']){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x174711[_0xb453('0x30')][_0xb453('0x31')]||JSON[_0xb453('0x32')](_0x174711['error'])));}return!![];});}function handleError(_0x39be10,_0x5e5dce,_0x246843){return _0x39be10['status'](_0x5e5dce||0x1f4)[_0xb453('0x33')]({'message':_0x246843?_0x246843[_0xb453('0x31')]||_0x246843:''});}exports[_0xb453('0x34')]=function(_0x3bd4e9,_0x362c16,_0x3ef32f){passport[_0xb453('0x1a')](_0xb453('0x35'),function(_0x17f851,_0x413b6e,_0x542b6e){var _0x5461e8=_0x17f851||_0x542b6e;if(_0x5461e8){return handleError(_0x362c16,0x191,_0x5461e8);}if(!_0x413b6e){return handleError(_0x362c16,0x194,{'message':_0xb453('0x36')});}else{var _0x1b8de9={'payload':{'id':_0x413b6e['id'],'role':_0x413b6e[_0xb453('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0xb453('0x37')](_0x1b8de9)['then'](function(_0x49a4f2){_0x362c16['json']({'id':_0x413b6e['id'],'token':_0x49a4f2,'statusCall':'','isAlreadyLogged':_0x413b6e[_0xb453('0x38')]});});}})(_0x3bd4e9,_0x362c16,_0x3ef32f);};exports[_0xb453('0x39')]=function(_0x4d8178,_0x562120,_0x1a1d4e){if(!_0x4d8178[_0xb453('0x3a')]['email']){return handleError(_0x562120,0x1f4,{'message':_0xb453('0x3b')});}var _0x4227ae=rs[_0xb453('0x3c')]();_0x4d8178[_0xb453('0x3a')][_0xb453('0x24')]=_0x4d8178[_0xb453('0x3a')]['email']['trim']()[_0xb453('0x3d')]();var _0x19fb6e;return db[_0xb453('0x3e')][_0xb453('0xd')]({'where':{'id':0x1},'attributes':[_0xb453('0x1c'),_0xb453('0xe')],'raw':!![]})[_0xb453('0xf')](function(_0x14fb82){_0x19fb6e=_0x14fb82;return db[_0xb453('0x3f')][_0xb453('0x23')]({'where':{'email':_0x4d8178[_0xb453('0x3a')][_0xb453('0x24')]}});})[_0xb453('0xf')](function(_0x574a1d){if(!_0x574a1d){throw new Error(_0xb453('0x40'));}if(_0x574a1d['disabled']){throw new Error(_0xb453('0x41'));}if(_0x574a1d[_0xb453('0x14')]){if(moment(_0x574a1d[_0xb453('0x15')])[_0xb453('0x1d')](_0x19fb6e[_0xb453('0xe')],_0xb453('0x1f'))>moment()){throw new Error(_0xb453('0x42'));}else{_0x574a1d[_0xb453('0x14')]=![];_0x574a1d['blockedAt']=null;}}_0x574a1d[_0xb453('0x43')]=_0x4227ae;_0x574a1d[_0xb453('0x44')]=Date[_0xb453('0x45')]()+0x36ee80;return _0x574a1d[_0xb453('0x46')]();})[_0xb453('0xf')](function(){return sendServiceMail({'to':_0x4d8178[_0xb453('0x3a')][_0xb453('0x24')],'subject':_0xb453('0x47'),'text':_0xb453('0x48')+_0xb453('0x49')+'https://'+_0x4d8178[_0xb453('0x4a')][_0xb453('0x29')]+'/reset/'+_0x4227ae+'\x0a\x0a'+_0xb453('0x4b')});})[_0xb453('0xf')](function(){_0x562120[_0xb453('0x4c')](0xc8)[_0xb453('0x33')]({'message':_0xb453('0x4d')});})['catch'](function(_0xf9ed81){return handleError(_0x562120,0x1f4,_0xf9ed81);});};exports[_0xb453('0x4e')]=function(_0x4c2a74,_0x24ba2c,_0x5f02ca){return db[_0xb453('0x3f')][_0xb453('0x23')]({'where':{'resetPasswordToken':_0x4c2a74['params'][_0xb453('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xb453('0x45')]()}}})[_0xb453('0xf')](function(_0x21557d){if(!_0x21557d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xb453('0xd')]({'attributes':['id','securePassword','enforcePasswordHistory',_0xb453('0x50')]})[_0xb453('0xf')](function(_0x5572bb){if(_0x5572bb[_0xb453('0x51')])authService[_0xb453('0x52')](_0x4c2a74['body'][_0xb453('0x10')]);if(!_0x5572bb['enforcePasswordHistory']||!_0x21557d['previousPasswords'])return _0x21557d;authService['validatePasswordHistory'](_0x4c2a74[_0xb453('0x3a')][_0xb453('0x10')],_0x21557d[_0xb453('0x53')],_0x5572bb['passwordHistoryLimit']);return _0x21557d;})[_0xb453('0xf')](function(){_0x21557d['password']=_0x4c2a74[_0xb453('0x3a')][_0xb453('0x10')];_0x21557d['resetPasswordToken']=null;_0x21557d[_0xb453('0x44')]=null;return _0x21557d['save']();});})[_0xb453('0xf')](function(){_0x24ba2c[_0xb453('0x4c')](0xc8)['send']({'message':_0xb453('0x54')});})[_0xb453('0x21')](function(_0x3d8e0a){return handleError(_0x24ba2c,0x1f4,_0x3d8e0a);});};passport['use'](new LocalStrategy({'usernameField':_0xb453('0x19'),'passwordField':'password'},function(_0x555c1a,_0x134833,_0x455851){return localAuthenticate(db['User'],_0x555c1a,_0x134833,_0x455851);}));
\ No newline at end of file
+var _0x3e74=['headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','password','Password\x20reset!','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','name','salt','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','auth','pass','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','message','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','body','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','https://'];(function(_0x317452,_0x1e1170){var _0x5a7ae3=function(_0x20cb38){while(--_0x20cb38){_0x317452['push'](_0x317452['shift']());}};_0x5a7ae3(++_0x1e1170);}(_0x3e74,0x1e4));var _0x43e7=function(_0x470622,_0x5a7fb2){_0x470622=_0x470622-0x0;var _0x4b26b2=_0x3e74[_0x470622];return _0x4b26b2;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x43e7('0x0'))[_0x43e7('0x1')];var jayson=require('jayson/promise');var _=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var moment=require(_0x43e7('0x4'));var db=require(_0x43e7('0x5'))['db'];var authService=require(_0x43e7('0x6'));var utils=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232b});function localAuthenticate(_0x43bf32,_0x50fe45,_0x5310d9,_0x4abe5e){var _0x2917a3,_0x5c04dc;return db[_0x43e7('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x43e7('0xb'),_0x43e7('0xc')],'raw':!![]})['then'](function(_0x54e551){_0x2917a3=_0x54e551;return _0x43bf32['findOne']({'attributes':['id',_0x43e7('0xd'),'password',_0x43e7('0xe'),'role',_0x43e7('0xf'),_0x43e7('0x10'),_0x43e7('0x11'),_0x43e7('0x12')],'where':{'name':_0x50fe45,'role':{'$or':[_0x43e7('0x13'),'user',_0x43e7('0x14')]}}});})[_0x43e7('0x15')](function(_0x610417){if(!_0x610417||_0x610417&&_0x610417[_0x43e7('0xd')]!==_0x50fe45){throw new Error(_0x43e7('0x16'));}else{_0x5c04dc=_0x610417;return _0x5c04dc;}})[_0x43e7('0x15')](function(){_0x5c04dc['authenticate'](_0x5310d9,function(_0x12aeb5,_0x38bf01){var _0x1607b9=_0x5c04dc['loginAttempts']+0x1;if(_0x12aeb5){return _0x4abe5e(_0x12aeb5);}else if(!_0x38bf01){if(_0x5c04dc[_0x43e7('0xf')]){return _0x4abe5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2917a3['allowedLoginAttempts']>0x0){if(_0x5c04dc[_0x43e7('0x10')]){if(_0x2917a3['blockDuration']>0x0){if(moment(_0x5c04dc[_0x43e7('0x11')])['add'](_0x2917a3[_0x43e7('0xc')],'minutes')>moment()){return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});}else{return utils['clearBlockUser'](_0x5c04dc,_0x1607b9,![],null)['then'](function(){return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});});}}else{return _0x4abe5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1607b9>=_0x2917a3[_0x43e7('0xb')]){return utils[_0x43e7('0x17')](_0x5c04dc,0x0,!![],moment())[_0x43e7('0x15')](function(){return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});});}else{return utils[_0x43e7('0x17')](_0x5c04dc,_0x1607b9,![],null)[_0x43e7('0x15')](function(){return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});});}}}else{return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});}}else{if(_0x5c04dc['disabled']){return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});}else if(_0x2917a3[_0x43e7('0xb')]>0x0){if(_0x5c04dc[_0x43e7('0x10')]){if(_0x2917a3[_0x43e7('0xc')]>0x0){if(moment(_0x5c04dc['blockedAt'])[_0x43e7('0x18')](_0x2917a3['blockDuration'],_0x43e7('0x19'))>moment()){return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});}else{return utils[_0x43e7('0x17')](_0x5c04dc,0x0,![],null)[_0x43e7('0x15')](function(){return utils[_0x43e7('0x1a')](_0x5c04dc);})[_0x43e7('0x15')](function(){return _0x4abe5e(null,_0x5c04dc);});}}else{return _0x4abe5e(null,![],{'message':_0x43e7('0x16')});}}else{return utils[_0x43e7('0x17')](_0x5c04dc,0x0,![],null)['then'](function(){return utils['getLicense'](_0x5c04dc);})[_0x43e7('0x15')](function(){return _0x4abe5e(null,_0x5c04dc);})[_0x43e7('0x1b')](function(_0x5dc1fd){return _0x4abe5e(null,![],_0x5dc1fd);});}}else{if(_0x5c04dc[_0x43e7('0x10')]){return _0x4abe5e(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x43e7('0x1a')](_0x5c04dc)['then'](function(){return _0x4abe5e(null,_0x5c04dc);});}}}});})['catch'](function(_0x4ce1ad){return _0x4abe5e(null,![],_0x4ce1ad);});}function sendServiceMail(_0x179fe5){return db[_0x43e7('0x1c')][_0x43e7('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x43e7('0xd'),_0x43e7('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x43e7('0x1f')}]})[_0x43e7('0x15')](function(_0x15b653){if(!_0x15b653){throw new Error(_0x43e7('0x20'));}var _0x34f921={'tls':{'rejectUnauthorized':![]}};if(_0x15b653['Smtp'][_0x43e7('0x21')]){_0x34f921[_0x43e7('0x21')]=_0x15b653[_0x43e7('0x1f')][_0x43e7('0x21')];}else{_0x34f921[_0x43e7('0x22')]=_0x15b653[_0x43e7('0x1f')][_0x43e7('0x22')];_0x34f921[_0x43e7('0x23')]=_0x15b653[_0x43e7('0x1f')][_0x43e7('0x23')];_0x34f921['secure']=_0x15b653[_0x43e7('0x1f')][_0x43e7('0x24')];}if(_0x15b653['Smtp']['authentication']){_0x34f921[_0x43e7('0x25')]={'user':_0x15b653['Smtp']['user'],'pass':_0x15b653[_0x43e7('0x1f')][_0x43e7('0x26')]};}var _0x143c77={'account':_0x34f921,'message':_['merge']({'from':util[_0x43e7('0x27')](_0x43e7('0x28'),_0x15b653['name'],_0x15b653[_0x43e7('0x1e')]||_0x15b653[_0x43e7('0x1f')][_0x43e7('0x29')])},_0x179fe5)};return client[_0x43e7('0x2a')](_0x43e7('0x2b'),_0x143c77);})[_0x43e7('0x15')](function(_0x5cc7e3){if(_0x5cc7e3[_0x43e7('0x2c')]){throw new Error(util[_0x43e7('0x27')](_0x43e7('0x2d'),_0x5cc7e3['error']['message']||JSON['stringify'](_0x5cc7e3[_0x43e7('0x2c')])));}return!![];});}function handleError(_0x5aa91e,_0x144bb3,_0x270e6c){return _0x5aa91e[_0x43e7('0x2e')](_0x144bb3||0x1f4)['send']({'message':_0x270e6c?_0x270e6c[_0x43e7('0x2f')]||_0x270e6c:''});}exports[_0x43e7('0x30')]=function(_0x33268f,_0x311248,_0x5ecbd7){passport['authenticate'](_0x43e7('0x31'),function(_0x54f1f7,_0x85fca3,_0x39afad){var _0x54f9b7=_0x54f1f7||_0x39afad;if(_0x54f9b7){return handleError(_0x311248,0x191,_0x54f9b7);}if(!_0x85fca3){return handleError(_0x311248,0x194,{'message':_0x43e7('0x32')});}else{var _0x515dd2={'payload':{'id':_0x85fca3['id'],'role':_0x85fca3[_0x43e7('0x33')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x515dd2)[_0x43e7('0x15')](function(_0x578825){_0x311248[_0x43e7('0x34')]({'id':_0x85fca3['id'],'token':_0x578825,'statusCall':'','isAlreadyLogged':_0x85fca3['online']});});}})(_0x33268f,_0x311248,_0x5ecbd7);};exports['forgot']=function(_0x31eeb4,_0x5dee0,_0x319dd0){if(!_0x31eeb4[_0x43e7('0x35')][_0x43e7('0x1e')]){return handleError(_0x5dee0,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1d863a=rs['generate']();_0x31eeb4[_0x43e7('0x35')][_0x43e7('0x1e')]=_0x31eeb4[_0x43e7('0x35')][_0x43e7('0x1e')][_0x43e7('0x36')]()[_0x43e7('0x37')]();var _0x3a49bd;return db[_0x43e7('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0x43e7('0xb'),_0x43e7('0xc')],'raw':!![]})[_0x43e7('0x15')](function(_0x113461){_0x3a49bd=_0x113461;return db[_0x43e7('0x38')]['find']({'where':{'email':_0x31eeb4[_0x43e7('0x35')][_0x43e7('0x1e')]}});})[_0x43e7('0x15')](function(_0x489c52){if(!_0x489c52){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x489c52['disabled']){throw new Error(_0x43e7('0x39'));}if(_0x489c52[_0x43e7('0x10')]){if(moment(_0x489c52['blockedAt'])[_0x43e7('0x18')](_0x3a49bd[_0x43e7('0xc')],_0x43e7('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x489c52[_0x43e7('0x10')]=![];_0x489c52[_0x43e7('0x11')]=null;}}_0x489c52['resetPasswordToken']=_0x1d863a;_0x489c52[_0x43e7('0x3a')]=Date[_0x43e7('0x3b')]()+0x36ee80;return _0x489c52[_0x43e7('0x3c')]();})[_0x43e7('0x15')](function(){return sendServiceMail({'to':_0x31eeb4[_0x43e7('0x35')][_0x43e7('0x1e')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x43e7('0x3d')+_0x31eeb4[_0x43e7('0x3e')][_0x43e7('0x22')]+_0x43e7('0x3f')+_0x1d863a+'\x0a\x0a'+_0x43e7('0x40')});})[_0x43e7('0x15')](function(){_0x5dee0[_0x43e7('0x2e')](0xc8)[_0x43e7('0x41')]({'message':_0x43e7('0x42')});})[_0x43e7('0x1b')](function(_0x3f5b38){return handleError(_0x5dee0,0x1f4,_0x3f5b38);});};exports[_0x43e7('0x43')]=function(_0x20e90f,_0x5c72f3,_0x34f0b8){return db['User']['find']({'where':{'resetPasswordToken':_0x20e90f['params'][_0x43e7('0x44')],'resetPasswordExpires':{'$gt':Date[_0x43e7('0x3b')]()}}})[_0x43e7('0x15')](function(_0x250d01){if(!_0x250d01){throw new Error(_0x43e7('0x45'));}return db[_0x43e7('0xa')][_0x43e7('0x46')]({'attributes':['id',_0x43e7('0x47'),'enforcePasswordHistory',_0x43e7('0x48')]})[_0x43e7('0x15')](function(_0x3ad53b){if(_0x3ad53b[_0x43e7('0x47')])authService['validatePasswordPattern'](_0x20e90f['body']['password']);if(!_0x3ad53b[_0x43e7('0x49')]||!_0x250d01[_0x43e7('0x4a')])return _0x250d01;authService[_0x43e7('0x4b')](_0x20e90f[_0x43e7('0x35')][_0x43e7('0x4c')],_0x250d01[_0x43e7('0x4a')],_0x3ad53b['passwordHistoryLimit']);return _0x250d01;})[_0x43e7('0x15')](function(){_0x250d01[_0x43e7('0x4c')]=_0x20e90f[_0x43e7('0x35')][_0x43e7('0x4c')];_0x250d01['resetPasswordToken']=null;_0x250d01[_0x43e7('0x3a')]=null;return _0x250d01[_0x43e7('0x3c')]();});})[_0x43e7('0x15')](function(){_0x5c72f3['status'](0xc8)[_0x43e7('0x41')]({'message':_0x43e7('0x4d')});})[_0x43e7('0x1b')](function(_0x1ce0c1){return handleError(_0x5c72f3,0x1f4,_0x1ce0c1);});};passport['use'](new LocalStrategy({'usernameField':_0x43e7('0xd'),'passwordField':_0x43e7('0x4c')},function(_0x2cf3fd,_0x419a62,_0x40da1f){return localAuthenticate(db['User'],_0x2cf3fd,_0x419a62,_0x40da1f);}));
\ No newline at end of file
index 426c3fd..95ae69e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f83=['reset','express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token'];(function(_0xda631a,_0x34d21f){var _0x48d7aa=function(_0x3ff034){while(--_0x3ff034){_0xda631a['push'](_0xda631a['shift']());}};_0x48d7aa(++_0x34d21f);}(_0x8f83,0x1d5));var _0x38f8=function(_0xf1b942,_0x373db6){_0xf1b942=_0xf1b942-0x0;var _0x1b7756=_0x8f83[_0xf1b942];return _0x1b7756;};'use strict';var express=require(_0x38f8('0x0'));var router=express[_0x38f8('0x1')]();var controller=require(_0x38f8('0x2'));router[_0x38f8('0x3')]('/',controller[_0x38f8('0x4')]);router[_0x38f8('0x3')](_0x38f8('0x5'),controller[_0x38f8('0x6')]);router['post'](_0x38f8('0x7'),controller[_0x38f8('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x1002=['reset','exports','Router','post','login'];(function(_0xd7b7c4,_0x3bde33){var _0x3701d4=function(_0x37f7de){while(--_0x37f7de){_0xd7b7c4['push'](_0xd7b7c4['shift']());}};_0x3701d4(++_0x3bde33);}(_0x1002,0x12e));var _0x2100=function(_0x325a95,_0x3ed033){_0x325a95=_0x325a95-0x0;var _0x55bdfa=_0x1002[_0x325a95];return _0x55bdfa;};'use strict';var express=require('express');var router=express[_0x2100('0x0')]();var controller=require('./authLocal.controller');router[_0x2100('0x1')]('/',controller[_0x2100('0x2')]);router[_0x2100('0x1')]('/forgot',controller['forgot']);router[_0x2100('0x1')]('/reset/:token',controller[_0x2100('0x3')]);module[_0x2100('0x4')]=router;
\ No newline at end of file
index 92c8a1b..52947cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c18=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x166287,_0x3f467d){var _0x11ebfa=function(_0x2d3f32){while(--_0x2d3f32){_0x166287['push'](_0x166287['shift']());}};_0x11ebfa(++_0x3f467d);}(_0x7c18,0x15d));var _0x87c1=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7c18[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0x87c1('0x0')]={'name':{'type':Sequelize[_0x87c1('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x87c1('0x1')]},'description':{'type':Sequelize[_0x87c1('0x1')]},'status':{'type':Sequelize[_0x87c1('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x87c1('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x987f=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x27c3f0,_0x198aa2){var _0x11e51c=function(_0x2a48ec){while(--_0x2a48ec){_0x27c3f0['push'](_0x27c3f0['shift']());}};_0x11e51c(++_0x198aa2);}(_0x987f,0x11d));var _0xf987=function(_0x599318,_0x319486){_0x599318=_0x599318-0x0;var _0x7b06fa=_0x987f[_0x599318];return _0x7b06fa;};'use strict';var Sequelize=require(_0xf987('0x0'));module[_0xf987('0x1')]={'name':{'type':Sequelize[_0xf987('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xf987('0x2')]},'description':{'type':Sequelize[_0xf987('0x2')]},'status':{'type':Sequelize[_0xf987('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf987('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index af8d6b4..8c18abb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5da=['findOne','Condition','addActions','Action','getActions','rawAttributes','order','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','limit','undefined','count','offset','set','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','rows','show','params','find','catch','create','body','addConditions','ids','omit','getConditions'];(function(_0xf9e76,_0x2e6b9a){var _0x119a9b=function(_0x146396){while(--_0x146396){_0xf9e76['push'](_0xf9e76['shift']());}};_0x119a9b(++_0x2e6b9a);}(_0xe5da,0xb3));var _0xae5d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe5da[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xae5d('0x0'));var rimraf=require(_0xae5d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae5d('0x2'));var rp=require(_0xae5d('0x3'));var moment=require(_0xae5d('0x4'));var BPromise=require(_0xae5d('0x5'));var Mustache=require('mustache');var util=require(_0xae5d('0x6'));var path=require(_0xae5d('0x7'));var sox=require(_0xae5d('0x8'));var csv=require(_0xae5d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae5d('0xa'));var _=require(_0xae5d('0xb'));var squel=require(_0xae5d('0xc'));var crypto=require(_0xae5d('0xd'));var jsforce=require(_0xae5d('0xe'));var deskjs=require(_0xae5d('0xf'));var toCsv=require(_0xae5d('0x9'));var querystring=require(_0xae5d('0x10'));var Papa=require(_0xae5d('0x11'));var Redis=require('ioredis');var authService=require(_0xae5d('0x12'));var qs=require(_0xae5d('0x13'));var as=require(_0xae5d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae5d('0x15'))(_0xae5d('0x16'));var utils=require(_0xae5d('0x17'));var config=require(_0xae5d('0x18'));var licenseUtil=require(_0xae5d('0x19'));var db=require(_0xae5d('0x1a'))['db'];function respondWithStatusCode(_0x28f54f,_0x2a0126){_0x2a0126=_0x2a0126||0xcc;return function(_0x4bfe11){if(_0x4bfe11){return _0x28f54f[_0xae5d('0x1b')](_0x2a0126);}return _0x28f54f[_0xae5d('0x1c')](_0x2a0126)[_0xae5d('0x1d')]();};}function respondWithResult(_0x2aa3e9,_0x3dac6a){_0x3dac6a=_0x3dac6a||0xc8;return function(_0x359108){if(_0x359108){return _0x2aa3e9['status'](_0x3dac6a)[_0xae5d('0x1e')](_0x359108);}};}function respondWithFilteredResult(_0x7aad17,_0x3c974f){return function(_0x1aa168){if(_0x1aa168){var _0x2ae99d=typeof _0x3c974f['offset']==='undefined'&&typeof _0x3c974f[_0xae5d('0x1f')]===_0xae5d('0x20');var _0x1062b2=_0x1aa168[_0xae5d('0x21')];var _0xc7fe5a=_0x2ae99d?0x0:_0x3c974f[_0xae5d('0x22')];var _0x3dbb09=_0x2ae99d?_0x1aa168[_0xae5d('0x21')]:_0x3c974f[_0xae5d('0x22')]+_0x3c974f[_0xae5d('0x1f')];var _0x821aca;if(_0x3dbb09>=_0x1062b2){_0x3dbb09=_0x1062b2;_0x821aca=0xc8;}else{_0x821aca=0xce;}_0x7aad17[_0xae5d('0x1c')](_0x821aca);return _0x7aad17[_0xae5d('0x23')]('Content-Range',_0xc7fe5a+'-'+_0x3dbb09+'/'+_0x1062b2)[_0xae5d('0x1e')](_0x1aa168);}return null;};}function patchUpdates(_0xbed0f){return function(_0x41a85b){try{jsonpatch['apply'](_0x41a85b,_0xbed0f,!![]);}catch(_0x13722f){return BPromise[_0xae5d('0x24')](_0x13722f);}return _0x41a85b['save']();};}function saveUpdates(_0xb5497e,_0x28500b){return function(_0x42ebc8){if(_0x42ebc8){return _0x42ebc8[_0xae5d('0x25')](_0xb5497e)[_0xae5d('0x26')](function(_0x21e8d3){return _0x21e8d3;});}return null;};}function removeEntity(_0x3399e0,_0x15065d){return function(_0x226c8a){if(_0x226c8a){return _0x226c8a[_0xae5d('0x27')]()[_0xae5d('0x26')](function(){_0x3399e0[_0xae5d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271c14,_0x59b8fc){return function(_0x490d10){if(!_0x490d10){_0x271c14[_0xae5d('0x1b')](0x194);}return _0x490d10;};}function handleError(_0x3ae7f3,_0x301c84){_0x301c84=_0x301c84||0x1f4;return function(_0x353acf){logger[_0xae5d('0x28')](_0x353acf[_0xae5d('0x29')]);if(_0x353acf[_0xae5d('0x2a')]){delete _0x353acf[_0xae5d('0x2a')];}_0x3ae7f3[_0xae5d('0x1c')](_0x301c84)[_0xae5d('0x2b')](_0x353acf);};}exports[_0xae5d('0x2c')]=function(_0x1a17af,_0x516e8d){var _0x15a21f={},_0x4e7692={},_0x1ab853={'count':0x0,'rows':[]};var _0x1f3795=_[_0xae5d('0x2d')](db['Automation']['rawAttributes'],function(_0x2584de){return{'name':_0x2584de[_0xae5d('0x2e')],'type':_0x2584de[_0xae5d('0x2f')]['key']};});_0x4e7692[_0xae5d('0x30')]=_[_0xae5d('0x2d')](_0x1f3795,_0xae5d('0x2a'));_0x4e7692['query']=_[_0xae5d('0x31')](_0x1a17af[_0xae5d('0x32')]);_0x4e7692[_0xae5d('0x33')]=_[_0xae5d('0x34')](_0x4e7692['model'],_0x4e7692['query']);_0x15a21f[_0xae5d('0x35')]=_[_0xae5d('0x34')](_0x4e7692[_0xae5d('0x30')],qs[_0xae5d('0x36')](_0x1a17af['query'][_0xae5d('0x36')]));_0x15a21f[_0xae5d('0x35')]=_0x15a21f[_0xae5d('0x35')][_0xae5d('0x37')]?_0x15a21f[_0xae5d('0x35')]:_0x4e7692[_0xae5d('0x30')];if(!_0x1a17af['query'][_0xae5d('0x38')](_0xae5d('0x39'))){_0x15a21f[_0xae5d('0x1f')]=qs[_0xae5d('0x1f')](_0x1a17af[_0xae5d('0x32')][_0xae5d('0x1f')]);_0x15a21f[_0xae5d('0x22')]=qs[_0xae5d('0x22')](_0x1a17af[_0xae5d('0x32')][_0xae5d('0x22')]);}_0x15a21f['order']=qs[_0xae5d('0x3a')](_0x1a17af[_0xae5d('0x32')][_0xae5d('0x3a')]);_0x15a21f[_0xae5d('0x3b')]=qs[_0xae5d('0x33')](_[_0xae5d('0x3c')](_0x1a17af[_0xae5d('0x32')],_0x4e7692[_0xae5d('0x33')]),_0x1f3795);if(_0x1a17af[_0xae5d('0x32')][_0xae5d('0x3d')]){_0x15a21f[_0xae5d('0x3b')]=_[_0xae5d('0x3e')](_0x15a21f[_0xae5d('0x3b')],{'$or':_[_0xae5d('0x2d')](_0x1f3795,function(_0x6cba13){if(_0x6cba13[_0xae5d('0x2f')]!==_0xae5d('0x3f')){var _0x161f7a={};_0x161f7a[_0x6cba13[_0xae5d('0x2a')]]={'$like':'%'+_0x1a17af[_0xae5d('0x32')][_0xae5d('0x3d')]+'%'};return _0x161f7a;}})});}_0x15a21f=_[_0xae5d('0x3e')]({},_0x15a21f,_0x1a17af[_0xae5d('0x40')]);var _0x33281f={'where':_0x15a21f[_0xae5d('0x3b')]};return db[_0xae5d('0x41')][_0xae5d('0x21')](_0x33281f)[_0xae5d('0x26')](function(_0x27f959){_0x1ab853[_0xae5d('0x21')]=_0x27f959;if(_0x1a17af[_0xae5d('0x32')][_0xae5d('0x42')]){_0x15a21f[_0xae5d('0x43')]=[{'all':!![]}];}return db[_0xae5d('0x41')]['findAll'](_0x15a21f);})[_0xae5d('0x26')](function(_0x18722b){_0x1ab853[_0xae5d('0x44')]=_0x18722b;return _0x1ab853;})['then'](respondWithFilteredResult(_0x516e8d,_0x15a21f))['catch'](handleError(_0x516e8d,null));};exports[_0xae5d('0x45')]=function(_0x1ea62e,_0x2c0216){var _0x7db5fd={'raw':![],'where':{'id':_0x1ea62e[_0xae5d('0x46')]['id']}},_0x415f7a={};_0x415f7a['model']=_[_0xae5d('0x31')](db[_0xae5d('0x41')]['rawAttributes']);_0x415f7a[_0xae5d('0x32')]=_['keys'](_0x1ea62e[_0xae5d('0x32')]);_0x415f7a[_0xae5d('0x33')]=_[_0xae5d('0x34')](_0x415f7a[_0xae5d('0x30')],_0x415f7a[_0xae5d('0x32')]);_0x7db5fd[_0xae5d('0x35')]=_['intersection'](_0x415f7a[_0xae5d('0x30')],qs[_0xae5d('0x36')](_0x1ea62e[_0xae5d('0x32')][_0xae5d('0x36')]));_0x7db5fd[_0xae5d('0x35')]=_0x7db5fd[_0xae5d('0x35')]['length']?_0x7db5fd[_0xae5d('0x35')]:_0x415f7a[_0xae5d('0x30')];if(_0x1ea62e[_0xae5d('0x32')][_0xae5d('0x42')]){_0x7db5fd[_0xae5d('0x43')]=[{'all':!![]}];}_0x7db5fd=_[_0xae5d('0x3e')]({},_0x7db5fd,_0x1ea62e['options']);return db[_0xae5d('0x41')][_0xae5d('0x47')](_0x7db5fd)[_0xae5d('0x26')](handleEntityNotFound(_0x2c0216,null))[_0xae5d('0x26')](respondWithResult(_0x2c0216,null))[_0xae5d('0x48')](handleError(_0x2c0216,null));};exports['create']=function(_0x35a802,_0x481fef){return db['Automation'][_0xae5d('0x49')](_0x35a802[_0xae5d('0x4a')],{})['then'](respondWithResult(_0x481fef,0xc9))[_0xae5d('0x48')](handleError(_0x481fef,null));};exports['update']=function(_0x54752b,_0x374347){if(_0x54752b[_0xae5d('0x4a')]['id']){delete _0x54752b['body']['id'];}return db['Automation'][_0xae5d('0x47')]({'where':{'id':_0x54752b['params']['id']}})[_0xae5d('0x26')](handleEntityNotFound(_0x374347,null))[_0xae5d('0x26')](saveUpdates(_0x54752b[_0xae5d('0x4a')],null))[_0xae5d('0x26')](respondWithResult(_0x374347,null))[_0xae5d('0x48')](handleError(_0x374347,null));};exports[_0xae5d('0x27')]=function(_0x375fab,_0x20250){return db[_0xae5d('0x41')][_0xae5d('0x47')]({'where':{'id':_0x375fab[_0xae5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x20250,null))[_0xae5d('0x26')](removeEntity(_0x20250,null))['catch'](handleError(_0x20250,null));};exports[_0xae5d('0x4b')]=function(_0x229777,_0x219399,_0xfe60d4){return db['Condition'][_0xae5d('0x47')]({'where':{'id':_0x229777[_0xae5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x219399,null))['then'](function(_0x2d6b6d){if(_0x2d6b6d){return _0x2d6b6d[_0xae5d('0x4b')](_0x229777[_0xae5d('0x4a')][_0xae5d('0x4c')],_[_0xae5d('0x4d')](_0x229777[_0xae5d('0x4a')],['ids','id'])||{});}})[_0xae5d('0x26')](respondWithResult(_0x219399,null))[_0xae5d('0x48')](handleError(_0x219399,null));};exports[_0xae5d('0x4e')]=function(_0x452fb3,_0x45500c,_0x2e6916){var _0x1bcf4c={};var _0x3c034a={};var _0x46c016;var _0x32774c;return db['Automation'][_0xae5d('0x4f')]({'where':{'id':_0x452fb3[_0xae5d('0x46')]['id']}})[_0xae5d('0x26')](handleEntityNotFound(_0x45500c,null))[_0xae5d('0x26')](function(_0x2a86ab){if(_0x2a86ab){_0x46c016=_0x2a86ab;_0x3c034a[_0xae5d('0x30')]=_['keys'](db[_0xae5d('0x50')]['rawAttributes']);_0x3c034a[_0xae5d('0x32')]=_[_0xae5d('0x31')](_0x452fb3[_0xae5d('0x32')]);_0x3c034a[_0xae5d('0x33')]=_[_0xae5d('0x34')](_0x3c034a[_0xae5d('0x30')],_0x3c034a[_0xae5d('0x32')]);_0x1bcf4c['attributes']=_[_0xae5d('0x34')](_0x3c034a['model'],qs[_0xae5d('0x36')](_0x452fb3[_0xae5d('0x32')][_0xae5d('0x36')]));_0x1bcf4c[_0xae5d('0x35')]=_0x1bcf4c[_0xae5d('0x35')][_0xae5d('0x37')]?_0x1bcf4c[_0xae5d('0x35')]:_0x3c034a[_0xae5d('0x30')];_0x1bcf4c['order']=qs[_0xae5d('0x3a')](_0x452fb3[_0xae5d('0x32')][_0xae5d('0x3a')]);_0x1bcf4c[_0xae5d('0x3b')]=qs['filters'](_[_0xae5d('0x3c')](_0x452fb3[_0xae5d('0x32')],_0x3c034a[_0xae5d('0x33')]));if(_0x452fb3[_0xae5d('0x32')][_0xae5d('0x3d')]){_0x1bcf4c[_0xae5d('0x3b')]=_[_0xae5d('0x3e')](_0x1bcf4c[_0xae5d('0x3b')],{'$or':_[_0xae5d('0x2d')](_0x1bcf4c['attributes'],function(_0x55cf90){var _0x3adba9={};_0x3adba9[_0x55cf90]={'$like':'%'+_0x452fb3[_0xae5d('0x32')][_0xae5d('0x3d')]+'%'};return _0x3adba9;})});}_0x1bcf4c=_[_0xae5d('0x3e')]({},_0x1bcf4c,_0x452fb3[_0xae5d('0x40')]);return _0x46c016[_0xae5d('0x4e')](_0x1bcf4c);}})[_0xae5d('0x26')](function(_0x2d9488){if(_0x2d9488){_0x32774c=_0x2d9488[_0xae5d('0x37')];if(!_0x452fb3[_0xae5d('0x32')][_0xae5d('0x38')]('nolimit')){_0x1bcf4c['limit']=qs[_0xae5d('0x1f')](_0x452fb3[_0xae5d('0x32')]['limit']);_0x1bcf4c[_0xae5d('0x22')]=qs[_0xae5d('0x22')](_0x452fb3[_0xae5d('0x32')]['offset']);}return _0x46c016[_0xae5d('0x4e')](_0x1bcf4c);}})[_0xae5d('0x26')](function(_0x4d58ff){if(_0x4d58ff){return _0x4d58ff?{'count':_0x32774c,'rows':_0x4d58ff}:null;}})[_0xae5d('0x26')](respondWithResult(_0x45500c,null))[_0xae5d('0x48')](handleError(_0x45500c,null));};exports[_0xae5d('0x51')]=function(_0x1887f2,_0x2995c6,_0x337360){return db[_0xae5d('0x52')][_0xae5d('0x47')]({'where':{'id':_0x1887f2['params']['id']}})[_0xae5d('0x26')](handleEntityNotFound(_0x2995c6,null))[_0xae5d('0x26')](function(_0x5f3f9a){if(_0x5f3f9a){return _0x5f3f9a[_0xae5d('0x51')](_0x1887f2[_0xae5d('0x4a')][_0xae5d('0x4c')],_[_0xae5d('0x4d')](_0x1887f2[_0xae5d('0x4a')],['ids','id'])||{});}})[_0xae5d('0x26')](respondWithResult(_0x2995c6,null))[_0xae5d('0x48')](handleError(_0x2995c6,null));};exports[_0xae5d('0x53')]=function(_0x222247,_0x892881,_0x28c9d3){var _0x476f59={};var _0x1d43a6={};var _0x1083d7;var _0x2f085b;return db[_0xae5d('0x41')][_0xae5d('0x4f')]({'where':{'id':_0x222247[_0xae5d('0x46')]['id']}})['then'](handleEntityNotFound(_0x892881,null))['then'](function(_0x4f96b0){if(_0x4f96b0){_0x1083d7=_0x4f96b0;_0x1d43a6[_0xae5d('0x30')]=_[_0xae5d('0x31')](db[_0xae5d('0x52')][_0xae5d('0x54')]);_0x1d43a6[_0xae5d('0x32')]=_[_0xae5d('0x31')](_0x222247['query']);_0x1d43a6['filters']=_['intersection'](_0x1d43a6[_0xae5d('0x30')],_0x1d43a6[_0xae5d('0x32')]);_0x476f59['attributes']=_[_0xae5d('0x34')](_0x1d43a6[_0xae5d('0x30')],qs[_0xae5d('0x36')](_0x222247[_0xae5d('0x32')][_0xae5d('0x36')]));_0x476f59[_0xae5d('0x35')]=_0x476f59[_0xae5d('0x35')][_0xae5d('0x37')]?_0x476f59[_0xae5d('0x35')]:_0x1d43a6[_0xae5d('0x30')];_0x476f59[_0xae5d('0x55')]=qs['sort'](_0x222247['query'][_0xae5d('0x3a')]);_0x476f59[_0xae5d('0x3b')]=qs['filters'](_['pick'](_0x222247[_0xae5d('0x32')],_0x1d43a6[_0xae5d('0x33')]));if(_0x222247[_0xae5d('0x32')][_0xae5d('0x3d')]){_0x476f59[_0xae5d('0x3b')]=_[_0xae5d('0x3e')](_0x476f59[_0xae5d('0x3b')],{'$or':_['map'](_0x476f59[_0xae5d('0x35')],function(_0xfbae34){var _0x2c9a53={};_0x2c9a53[_0xfbae34]={'$like':'%'+_0x222247[_0xae5d('0x32')][_0xae5d('0x3d')]+'%'};return _0x2c9a53;})});}_0x476f59=_[_0xae5d('0x3e')]({},_0x476f59,_0x222247[_0xae5d('0x40')]);return _0x1083d7[_0xae5d('0x53')](_0x476f59);}})[_0xae5d('0x26')](function(_0x3a7d96){if(_0x3a7d96){_0x2f085b=_0x3a7d96[_0xae5d('0x37')];if(!_0x222247['query'][_0xae5d('0x38')](_0xae5d('0x39'))){_0x476f59[_0xae5d('0x1f')]=qs[_0xae5d('0x1f')](_0x222247[_0xae5d('0x32')][_0xae5d('0x1f')]);_0x476f59[_0xae5d('0x22')]=qs[_0xae5d('0x22')](_0x222247[_0xae5d('0x32')][_0xae5d('0x22')]);}return _0x1083d7[_0xae5d('0x53')](_0x476f59);}})['then'](function(_0x6b65ac){if(_0x6b65ac){return _0x6b65ac?{'count':_0x2f085b,'rows':_0x6b65ac}:null;}})[_0xae5d('0x26')](respondWithResult(_0x892881,null))['catch'](handleError(_0x892881,null));};
\ No newline at end of file
+var _0xca15=['getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','then','error','stack','name','index','map','Automation','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','body','destroy','addConditions','Condition','ids','getConditions','findOne','addActions','Action','omit'];(function(_0x499238,_0x226523){var _0x5613f7=function(_0x33cd11){while(--_0x33cd11){_0x499238['push'](_0x499238['shift']());}};_0x5613f7(++_0x226523);}(_0xca15,0x182));var _0x5ca1=function(_0x8377ed,_0x5d4c1a){_0x8377ed=_0x8377ed-0x0;var _0x1a71ae=_0xca15[_0x8377ed];return _0x1a71ae;};'use strict';var emlformat=require(_0x5ca1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ca1('0x1'));var jsonpatch=require(_0x5ca1('0x2'));var rp=require(_0x5ca1('0x3'));var moment=require(_0x5ca1('0x4'));var BPromise=require(_0x5ca1('0x5'));var Mustache=require('mustache');var util=require(_0x5ca1('0x6'));var path=require(_0x5ca1('0x7'));var sox=require(_0x5ca1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ca1('0x9'));var _=require(_0x5ca1('0xa'));var squel=require(_0x5ca1('0xb'));var crypto=require('crypto');var jsforce=require(_0x5ca1('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5ca1('0xd'));var Papa=require('papaparse');var Redis=require(_0x5ca1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5ca1('0xf'));var as=require(_0x5ca1('0x10'));var hardwareService=require(_0x5ca1('0x11'));var logger=require(_0x5ca1('0x12'))(_0x5ca1('0x13'));var utils=require(_0x5ca1('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x39e5b6,_0x2d82c0){_0x2d82c0=_0x2d82c0||0xcc;return function(_0x21d9e2){if(_0x21d9e2){return _0x39e5b6[_0x5ca1('0x15')](_0x2d82c0);}return _0x39e5b6[_0x5ca1('0x16')](_0x2d82c0)[_0x5ca1('0x17')]();};}function respondWithResult(_0x162f72,_0x4773db){_0x4773db=_0x4773db||0xc8;return function(_0x14b882){if(_0x14b882){return _0x162f72[_0x5ca1('0x16')](_0x4773db)[_0x5ca1('0x18')](_0x14b882);}};}function respondWithFilteredResult(_0x400e3c,_0x88c886){return function(_0x4a19bd){if(_0x4a19bd){var _0x3ef025=typeof _0x88c886[_0x5ca1('0x19')]===_0x5ca1('0x1a')&&typeof _0x88c886[_0x5ca1('0x1b')]==='undefined';var _0x3d88d6=_0x4a19bd['count'];var _0x1940bb=_0x3ef025?0x0:_0x88c886[_0x5ca1('0x19')];var _0x339bd0=_0x3ef025?_0x4a19bd['count']:_0x88c886[_0x5ca1('0x19')]+_0x88c886['limit'];var _0x3dc14f;if(_0x339bd0>=_0x3d88d6){_0x339bd0=_0x3d88d6;_0x3dc14f=0xc8;}else{_0x3dc14f=0xce;}_0x400e3c['status'](_0x3dc14f);return _0x400e3c[_0x5ca1('0x1c')](_0x5ca1('0x1d'),_0x1940bb+'-'+_0x339bd0+'/'+_0x3d88d6)[_0x5ca1('0x18')](_0x4a19bd);}return null;};}function patchUpdates(_0xb824e1){return function(_0x4c0896){try{jsonpatch['apply'](_0x4c0896,_0xb824e1,!![]);}catch(_0x41a6c3){return BPromise[_0x5ca1('0x1e')](_0x41a6c3);}return _0x4c0896['save']();};}function saveUpdates(_0x2fab4e,_0x1d9dea){return function(_0x39a28c){if(_0x39a28c){return _0x39a28c[_0x5ca1('0x1f')](_0x2fab4e)[_0x5ca1('0x20')](function(_0x1685e1){return _0x1685e1;});}return null;};}function removeEntity(_0x584f1a,_0x5a89b5){return function(_0x3ed0cc){if(_0x3ed0cc){return _0x3ed0cc['destroy']()[_0x5ca1('0x20')](function(){_0x584f1a[_0x5ca1('0x16')](0xcc)[_0x5ca1('0x17')]();});}};}function handleEntityNotFound(_0x2ab53f,_0x64a2b6){return function(_0xa14173){if(!_0xa14173){_0x2ab53f['sendStatus'](0x194);}return _0xa14173;};}function handleError(_0x50248b,_0x3409da){_0x3409da=_0x3409da||0x1f4;return function(_0x544c50){logger[_0x5ca1('0x21')](_0x544c50[_0x5ca1('0x22')]);if(_0x544c50[_0x5ca1('0x23')]){delete _0x544c50['name'];}_0x50248b['status'](_0x3409da)['send'](_0x544c50);};}exports[_0x5ca1('0x24')]=function(_0x5afc87,_0x1a86fe){var _0x2f24c2={},_0x52f07b={},_0xa2e433={'count':0x0,'rows':[]};var _0x3c7a64=_[_0x5ca1('0x25')](db[_0x5ca1('0x26')][_0x5ca1('0x27')],function(_0x58d55f){return{'name':_0x58d55f['fieldName'],'type':_0x58d55f[_0x5ca1('0x28')]['key']};});_0x52f07b[_0x5ca1('0x29')]=_['map'](_0x3c7a64,_0x5ca1('0x23'));_0x52f07b[_0x5ca1('0x2a')]=_[_0x5ca1('0x2b')](_0x5afc87[_0x5ca1('0x2a')]);_0x52f07b['filters']=_[_0x5ca1('0x2c')](_0x52f07b[_0x5ca1('0x29')],_0x52f07b[_0x5ca1('0x2a')]);_0x2f24c2[_0x5ca1('0x2d')]=_['intersection'](_0x52f07b[_0x5ca1('0x29')],qs[_0x5ca1('0x2e')](_0x5afc87['query'][_0x5ca1('0x2e')]));_0x2f24c2['attributes']=_0x2f24c2[_0x5ca1('0x2d')][_0x5ca1('0x2f')]?_0x2f24c2[_0x5ca1('0x2d')]:_0x52f07b[_0x5ca1('0x29')];if(!_0x5afc87[_0x5ca1('0x2a')][_0x5ca1('0x30')](_0x5ca1('0x31'))){_0x2f24c2[_0x5ca1('0x1b')]=qs[_0x5ca1('0x1b')](_0x5afc87[_0x5ca1('0x2a')][_0x5ca1('0x1b')]);_0x2f24c2['offset']=qs[_0x5ca1('0x19')](_0x5afc87[_0x5ca1('0x2a')]['offset']);}_0x2f24c2[_0x5ca1('0x32')]=qs[_0x5ca1('0x33')](_0x5afc87[_0x5ca1('0x2a')][_0x5ca1('0x33')]);_0x2f24c2[_0x5ca1('0x34')]=qs[_0x5ca1('0x35')](_[_0x5ca1('0x36')](_0x5afc87[_0x5ca1('0x2a')],_0x52f07b['filters']),_0x3c7a64);if(_0x5afc87['query'][_0x5ca1('0x37')]){_0x2f24c2[_0x5ca1('0x34')]=_[_0x5ca1('0x38')](_0x2f24c2[_0x5ca1('0x34')],{'$or':_['map'](_0x3c7a64,function(_0x2ed4f9){if(_0x2ed4f9['type']!==_0x5ca1('0x39')){var _0x4ffea0={};_0x4ffea0[_0x2ed4f9[_0x5ca1('0x23')]]={'$like':'%'+_0x5afc87[_0x5ca1('0x2a')][_0x5ca1('0x37')]+'%'};return _0x4ffea0;}})});}_0x2f24c2=_['merge']({},_0x2f24c2,_0x5afc87[_0x5ca1('0x3a')]);var _0x1ca1a2={'where':_0x2f24c2[_0x5ca1('0x34')]};return db[_0x5ca1('0x26')]['count'](_0x1ca1a2)[_0x5ca1('0x20')](function(_0x3e961f){_0xa2e433['count']=_0x3e961f;if(_0x5afc87[_0x5ca1('0x2a')][_0x5ca1('0x3b')]){_0x2f24c2[_0x5ca1('0x3c')]=[{'all':!![]}];}return db[_0x5ca1('0x26')]['findAll'](_0x2f24c2);})[_0x5ca1('0x20')](function(_0xe9e20c){_0xa2e433[_0x5ca1('0x3d')]=_0xe9e20c;return _0xa2e433;})[_0x5ca1('0x20')](respondWithFilteredResult(_0x1a86fe,_0x2f24c2))[_0x5ca1('0x3e')](handleError(_0x1a86fe,null));};exports[_0x5ca1('0x3f')]=function(_0x2326c5,_0x3d596d){var _0x4e5944={'raw':![],'where':{'id':_0x2326c5[_0x5ca1('0x40')]['id']}},_0x269389={};_0x269389[_0x5ca1('0x29')]=_[_0x5ca1('0x2b')](db[_0x5ca1('0x26')]['rawAttributes']);_0x269389[_0x5ca1('0x2a')]=_[_0x5ca1('0x2b')](_0x2326c5['query']);_0x269389[_0x5ca1('0x35')]=_[_0x5ca1('0x2c')](_0x269389[_0x5ca1('0x29')],_0x269389[_0x5ca1('0x2a')]);_0x4e5944[_0x5ca1('0x2d')]=_['intersection'](_0x269389[_0x5ca1('0x29')],qs[_0x5ca1('0x2e')](_0x2326c5[_0x5ca1('0x2a')]['fields']));_0x4e5944[_0x5ca1('0x2d')]=_0x4e5944[_0x5ca1('0x2d')]['length']?_0x4e5944[_0x5ca1('0x2d')]:_0x269389[_0x5ca1('0x29')];if(_0x2326c5['query']['includeAll']){_0x4e5944['include']=[{'all':!![]}];}_0x4e5944=_[_0x5ca1('0x38')]({},_0x4e5944,_0x2326c5[_0x5ca1('0x3a')]);return db[_0x5ca1('0x26')][_0x5ca1('0x41')](_0x4e5944)[_0x5ca1('0x20')](handleEntityNotFound(_0x3d596d,null))[_0x5ca1('0x20')](respondWithResult(_0x3d596d,null))['catch'](handleError(_0x3d596d,null));};exports['create']=function(_0x356c4e,_0x46c3c5){return db['Automation']['create'](_0x356c4e['body'],{})[_0x5ca1('0x20')](respondWithResult(_0x46c3c5,0xc9))[_0x5ca1('0x3e')](handleError(_0x46c3c5,null));};exports[_0x5ca1('0x1f')]=function(_0x1761ba,_0x5440c0){if(_0x1761ba[_0x5ca1('0x42')]['id']){delete _0x1761ba['body']['id'];}return db[_0x5ca1('0x26')][_0x5ca1('0x41')]({'where':{'id':_0x1761ba[_0x5ca1('0x40')]['id']}})[_0x5ca1('0x20')](handleEntityNotFound(_0x5440c0,null))['then'](saveUpdates(_0x1761ba[_0x5ca1('0x42')],null))['then'](respondWithResult(_0x5440c0,null))[_0x5ca1('0x3e')](handleError(_0x5440c0,null));};exports[_0x5ca1('0x43')]=function(_0x51b84b,_0x1ebad1){return db[_0x5ca1('0x26')][_0x5ca1('0x41')]({'where':{'id':_0x51b84b['params']['id']}})[_0x5ca1('0x20')](handleEntityNotFound(_0x1ebad1,null))[_0x5ca1('0x20')](removeEntity(_0x1ebad1,null))['catch'](handleError(_0x1ebad1,null));};exports[_0x5ca1('0x44')]=function(_0x225a6f,_0x515f3f,_0x3db3d4){return db[_0x5ca1('0x45')][_0x5ca1('0x41')]({'where':{'id':_0x225a6f[_0x5ca1('0x40')]['id']}})[_0x5ca1('0x20')](handleEntityNotFound(_0x515f3f,null))[_0x5ca1('0x20')](function(_0x2c2cef){if(_0x2c2cef){return _0x2c2cef[_0x5ca1('0x44')](_0x225a6f[_0x5ca1('0x42')][_0x5ca1('0x46')],_['omit'](_0x225a6f['body'],['ids','id'])||{});}})[_0x5ca1('0x20')](respondWithResult(_0x515f3f,null))[_0x5ca1('0x3e')](handleError(_0x515f3f,null));};exports[_0x5ca1('0x47')]=function(_0x23d644,_0x5c5463,_0x3a9415){var _0x4519c3={};var _0x14ce93={};var _0x50b98c;var _0x405282;return db[_0x5ca1('0x26')][_0x5ca1('0x48')]({'where':{'id':_0x23d644[_0x5ca1('0x40')]['id']}})[_0x5ca1('0x20')](handleEntityNotFound(_0x5c5463,null))['then'](function(_0x2243f3){if(_0x2243f3){_0x50b98c=_0x2243f3;_0x14ce93[_0x5ca1('0x29')]=_[_0x5ca1('0x2b')](db[_0x5ca1('0x45')][_0x5ca1('0x27')]);_0x14ce93[_0x5ca1('0x2a')]=_[_0x5ca1('0x2b')](_0x23d644[_0x5ca1('0x2a')]);_0x14ce93[_0x5ca1('0x35')]=_[_0x5ca1('0x2c')](_0x14ce93['model'],_0x14ce93[_0x5ca1('0x2a')]);_0x4519c3[_0x5ca1('0x2d')]=_[_0x5ca1('0x2c')](_0x14ce93[_0x5ca1('0x29')],qs[_0x5ca1('0x2e')](_0x23d644[_0x5ca1('0x2a')][_0x5ca1('0x2e')]));_0x4519c3[_0x5ca1('0x2d')]=_0x4519c3[_0x5ca1('0x2d')][_0x5ca1('0x2f')]?_0x4519c3[_0x5ca1('0x2d')]:_0x14ce93['model'];_0x4519c3[_0x5ca1('0x32')]=qs['sort'](_0x23d644[_0x5ca1('0x2a')][_0x5ca1('0x33')]);_0x4519c3[_0x5ca1('0x34')]=qs[_0x5ca1('0x35')](_['pick'](_0x23d644[_0x5ca1('0x2a')],_0x14ce93[_0x5ca1('0x35')]));if(_0x23d644[_0x5ca1('0x2a')]['filter']){_0x4519c3[_0x5ca1('0x34')]=_['merge'](_0x4519c3[_0x5ca1('0x34')],{'$or':_[_0x5ca1('0x25')](_0x4519c3[_0x5ca1('0x2d')],function(_0x559936){var _0x231d83={};_0x231d83[_0x559936]={'$like':'%'+_0x23d644[_0x5ca1('0x2a')]['filter']+'%'};return _0x231d83;})});}_0x4519c3=_['merge']({},_0x4519c3,_0x23d644[_0x5ca1('0x3a')]);return _0x50b98c['getConditions'](_0x4519c3);}})['then'](function(_0x561577){if(_0x561577){_0x405282=_0x561577[_0x5ca1('0x2f')];if(!_0x23d644['query'][_0x5ca1('0x30')](_0x5ca1('0x31'))){_0x4519c3[_0x5ca1('0x1b')]=qs[_0x5ca1('0x1b')](_0x23d644['query']['limit']);_0x4519c3[_0x5ca1('0x19')]=qs[_0x5ca1('0x19')](_0x23d644['query'][_0x5ca1('0x19')]);}return _0x50b98c['getConditions'](_0x4519c3);}})['then'](function(_0x16b610){if(_0x16b610){return _0x16b610?{'count':_0x405282,'rows':_0x16b610}:null;}})[_0x5ca1('0x20')](respondWithResult(_0x5c5463,null))[_0x5ca1('0x3e')](handleError(_0x5c5463,null));};exports[_0x5ca1('0x49')]=function(_0xc9d694,_0x112556,_0x247266){return db[_0x5ca1('0x4a')]['find']({'where':{'id':_0xc9d694[_0x5ca1('0x40')]['id']}})[_0x5ca1('0x20')](handleEntityNotFound(_0x112556,null))[_0x5ca1('0x20')](function(_0x1ddfcb){if(_0x1ddfcb){return _0x1ddfcb[_0x5ca1('0x49')](_0xc9d694[_0x5ca1('0x42')][_0x5ca1('0x46')],_[_0x5ca1('0x4b')](_0xc9d694[_0x5ca1('0x42')],['ids','id'])||{});}})[_0x5ca1('0x20')](respondWithResult(_0x112556,null))[_0x5ca1('0x3e')](handleError(_0x112556,null));};exports[_0x5ca1('0x4c')]=function(_0x1a4cbf,_0x5be831,_0xeb04d2){var _0x300de6={};var _0x4e5031={};var _0x4d029e;var _0x302dcb;return db[_0x5ca1('0x26')][_0x5ca1('0x48')]({'where':{'id':_0x1a4cbf[_0x5ca1('0x40')]['id']}})[_0x5ca1('0x20')](handleEntityNotFound(_0x5be831,null))[_0x5ca1('0x20')](function(_0xb6897c){if(_0xb6897c){_0x4d029e=_0xb6897c;_0x4e5031[_0x5ca1('0x29')]=_[_0x5ca1('0x2b')](db[_0x5ca1('0x4a')][_0x5ca1('0x27')]);_0x4e5031[_0x5ca1('0x2a')]=_['keys'](_0x1a4cbf[_0x5ca1('0x2a')]);_0x4e5031[_0x5ca1('0x35')]=_[_0x5ca1('0x2c')](_0x4e5031[_0x5ca1('0x29')],_0x4e5031[_0x5ca1('0x2a')]);_0x300de6[_0x5ca1('0x2d')]=_[_0x5ca1('0x2c')](_0x4e5031['model'],qs['fields'](_0x1a4cbf[_0x5ca1('0x2a')][_0x5ca1('0x2e')]));_0x300de6[_0x5ca1('0x2d')]=_0x300de6[_0x5ca1('0x2d')][_0x5ca1('0x2f')]?_0x300de6[_0x5ca1('0x2d')]:_0x4e5031[_0x5ca1('0x29')];_0x300de6[_0x5ca1('0x32')]=qs[_0x5ca1('0x33')](_0x1a4cbf[_0x5ca1('0x2a')][_0x5ca1('0x33')]);_0x300de6['where']=qs[_0x5ca1('0x35')](_[_0x5ca1('0x36')](_0x1a4cbf['query'],_0x4e5031[_0x5ca1('0x35')]));if(_0x1a4cbf[_0x5ca1('0x2a')]['filter']){_0x300de6['where']=_[_0x5ca1('0x38')](_0x300de6[_0x5ca1('0x34')],{'$or':_[_0x5ca1('0x25')](_0x300de6['attributes'],function(_0xcd3360){var _0x241ad1={};_0x241ad1[_0xcd3360]={'$like':'%'+_0x1a4cbf[_0x5ca1('0x2a')][_0x5ca1('0x37')]+'%'};return _0x241ad1;})});}_0x300de6=_[_0x5ca1('0x38')]({},_0x300de6,_0x1a4cbf[_0x5ca1('0x3a')]);return _0x4d029e[_0x5ca1('0x4c')](_0x300de6);}})['then'](function(_0x66de7b){if(_0x66de7b){_0x302dcb=_0x66de7b[_0x5ca1('0x2f')];if(!_0x1a4cbf[_0x5ca1('0x2a')][_0x5ca1('0x30')](_0x5ca1('0x31'))){_0x300de6[_0x5ca1('0x1b')]=qs[_0x5ca1('0x1b')](_0x1a4cbf[_0x5ca1('0x2a')][_0x5ca1('0x1b')]);_0x300de6[_0x5ca1('0x19')]=qs[_0x5ca1('0x19')](_0x1a4cbf[_0x5ca1('0x2a')][_0x5ca1('0x19')]);}return _0x4d029e['getActions'](_0x300de6);}})[_0x5ca1('0x20')](function(_0x1b4148){if(_0x1b4148){return _0x1b4148?{'count':_0x302dcb,'rows':_0x1b4148}:null;}})['then'](respondWithResult(_0x5be831,null))[_0x5ca1('0x3e')](handleError(_0x5be831,null));};
\ No newline at end of file
index 3525404..c473c9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf72e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger'];(function(_0x25adb4,_0x5582f7){var _0x588c67=function(_0x2f5a56){while(--_0x2f5a56){_0x25adb4['push'](_0x25adb4['shift']());}};_0x588c67(++_0x5582f7);}(_0xf72e,0xa7));var _0xef72=function(_0x4f0c59,_0xdcce7d){_0x4f0c59=_0x4f0c59-0x0;var _0xa36d16=_0xf72e[_0x4f0c59];return _0xa36d16;};'use strict';var _=require(_0xef72('0x0'));var util=require('util');var logger=require(_0xef72('0x1'))('api');var moment=require(_0xef72('0x2'));var BPromise=require(_0xef72('0x3'));var rp=require(_0xef72('0x4'));var fs=require('fs');var path=require(_0xef72('0x5'));var rimraf=require(_0xef72('0x6'));var config=require(_0xef72('0x7'));var attributes=require(_0xef72('0x8'));module[_0xef72('0x9')]=function(_0x1129d8,_0x36f745){return _0x1129d8[_0xef72('0xa')](_0xef72('0xb'),attributes,{'tableName':_0xef72('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x739d=['../../config/environment','./automation.attributes','exports','define','lodash','util','bluebird','request-promise','path'];(function(_0x73740d,_0x49a324){var _0x3eecfe=function(_0x21a628){while(--_0x21a628){_0x73740d['push'](_0x73740d['shift']());}};_0x3eecfe(++_0x49a324);}(_0x739d,0x100));var _0xd739=function(_0x46ed8c,_0x3c606f){_0x46ed8c=_0x46ed8c-0x0;var _0x4d83f9=_0x739d[_0x46ed8c];return _0x4d83f9;};'use strict';var _=require(_0xd739('0x0'));var util=require(_0xd739('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd739('0x2'));var rp=require(_0xd739('0x3'));var fs=require('fs');var path=require(_0xd739('0x4'));var rimraf=require('rimraf');var config=require(_0xd739('0x5'));var attributes=require(_0xd739('0x6'));module[_0xd739('0x7')]=function(_0x374ef0,_0x5375c3){return _0x374ef0[_0xd739('0x8')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 672c9ea..a12e286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a48=['request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0xdd40fb,_0xe18a2){var _0x360d68=function(_0x32c27f){while(--_0x32c27f){_0xdd40fb['push'](_0xdd40fb['shift']());}};_0x360d68(++_0xe18a2);}(_0x0a48,0x95));var _0x80a4=function(_0x130a52,_0x1880c9){_0x130a52=_0x130a52-0x0;var _0x6f239a=_0x0a48[_0x130a52];return _0x6f239a;};'use strict';var _=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var moment=require('moment');var BPromise=require(_0x80a4('0x2'));var rs=require(_0x80a4('0x3'));var fs=require('fs');var Redis=require(_0x80a4('0x4'));var db=require(_0x80a4('0x5'))['db'];var utils=require(_0x80a4('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x80a4('0x7'));var jayson=require(_0x80a4('0x8'));var client=jayson[_0x80a4('0x9')][_0x80a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3ac0,_0x3ccc33,_0x55bd77){return new BPromise(function(_0x5c7c37,_0x338d47){return client[_0x80a4('0xb')](_0x5f3ac0,_0x55bd77)['then'](function(_0x5dfe4a){logger[_0x80a4('0xc')](_0x80a4('0xd'),_0x3ccc33,_0x80a4('0xe'));logger[_0x80a4('0xf')]('Automation,\x20%s,\x20%s,\x20%s',_0x3ccc33,_0x80a4('0xe'),JSON['stringify'](_0x5dfe4a));if(_0x5dfe4a[_0x80a4('0x10')]){if(_0x5dfe4a['error'][_0x80a4('0x11')]===0x1f4){logger[_0x80a4('0x10')]('Automation,\x20%s,\x20%s',_0x3ccc33,_0x5dfe4a[_0x80a4('0x10')][_0x80a4('0x12')]);return _0x338d47(_0x5dfe4a[_0x80a4('0x10')][_0x80a4('0x12')]);}logger[_0x80a4('0x10')](_0x80a4('0xd'),_0x3ccc33,_0x5dfe4a[_0x80a4('0x10')]['message']);return _0x5c7c37(_0x5dfe4a['error'][_0x80a4('0x12')]);}else{logger[_0x80a4('0xc')](_0x80a4('0xd'),_0x3ccc33,_0x80a4('0xe'));_0x5c7c37(_0x5dfe4a['result'][_0x80a4('0x12')]);}})[_0x80a4('0x13')](function(_0x38ba44){logger[_0x80a4('0x10')](_0x80a4('0xd'),_0x3ccc33,_0x38ba44);_0x338d47(_0x38ba44);});});}
\ No newline at end of file
+var _0x57b7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x57b7,0x160));var _0x757b=function(_0x5eeee0,_0x49c455){_0x5eeee0=_0x5eeee0-0x0;var _0x54f8fc=_0x57b7[_0x5eeee0];return _0x54f8fc;};'use strict';var _=require(_0x757b('0x0'));var util=require(_0x757b('0x1'));var moment=require(_0x757b('0x2'));var BPromise=require(_0x757b('0x3'));var rs=require(_0x757b('0x4'));var fs=require('fs');var Redis=require(_0x757b('0x5'));var db=require(_0x757b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x757b('0x7'))(_0x757b('0x8'));var config=require(_0x757b('0x9'));var jayson=require(_0x757b('0xa'));var client=jayson['client'][_0x757b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8528c7,_0x36c83c,_0x224503){return new BPromise(function(_0x18b130,_0x1845cf){return client[_0x757b('0xc')](_0x8528c7,_0x224503)[_0x757b('0xd')](function(_0x53a1ce){logger[_0x757b('0xe')](_0x757b('0xf'),_0x36c83c,'request\x20sent');logger[_0x757b('0x10')]('Automation,\x20%s,\x20%s,\x20%s',_0x36c83c,_0x757b('0x11'),JSON['stringify'](_0x53a1ce));if(_0x53a1ce[_0x757b('0x12')]){if(_0x53a1ce[_0x757b('0x12')]['code']===0x1f4){logger[_0x757b('0x12')](_0x757b('0xf'),_0x36c83c,_0x53a1ce['error'][_0x757b('0x13')]);return _0x1845cf(_0x53a1ce['error'][_0x757b('0x13')]);}logger[_0x757b('0x12')]('Automation,\x20%s,\x20%s',_0x36c83c,_0x53a1ce[_0x757b('0x12')]['message']);return _0x18b130(_0x53a1ce[_0x757b('0x12')][_0x757b('0x13')]);}else{logger[_0x757b('0xe')]('Automation,\x20%s,\x20%s',_0x36c83c,_0x757b('0x11'));_0x18b130(_0x53a1ce[_0x757b('0x14')]['message']);}})[_0x757b('0x15')](function(_0x493286){logger['error'](_0x757b('0xf'),_0x36c83c,_0x493286);_0x1845cf(_0x493286);});});}
\ No newline at end of file
index ebce5bb..7997bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','/:id','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get'];(function(_0x27b1f0,_0x3185ec){var _0x27cfec=function(_0x528dc3){while(--_0x528dc3){_0x27b1f0['push'](_0x27b1f0['shift']());}};_0x27cfec(++_0x3185ec);}(_0xfd28,0x148));var _0x8fd2=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xfd28[_0x1d70db];return _0x3060c6;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8fd2('0xa')]);router[_0x8fd2('0x7')](_0x8fd2('0xb'),auth['isAuthenticated'](),controller[_0x8fd2('0xc')]);router['get'](_0x8fd2('0xd'),auth['isAuthenticated'](),controller[_0x8fd2('0xe')]);router['post']('/',auth[_0x8fd2('0x8')](),controller['create']);router[_0x8fd2('0xf')]('/:id/conditions',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x10')]);router[_0x8fd2('0xf')](_0x8fd2('0xd'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x11')]);router[_0x8fd2('0x12')](_0x8fd2('0x13'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x14')]);router[_0x8fd2('0x15')](_0x8fd2('0x13'),auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x16')]);module[_0x8fd2('0x17')]=router;
\ No newline at end of file
+var _0x1fec=['create','/:id/conditions','addConditions','addActions','put','delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','index','get','/:id','isAuthenticated','getConditions','getActions','post'];(function(_0x540e9d,_0x5a4d9a){var _0x58641e=function(_0x204357){while(--_0x204357){_0x540e9d['push'](_0x540e9d['shift']());}};_0x58641e(++_0x5a4d9a);}(_0x1fec,0x1ea));var _0xc1fe=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1fec[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0xc1fe('0x0'));var path=require(_0xc1fe('0x1'));var timeout=require(_0xc1fe('0x2'));var express=require(_0xc1fe('0x3'));var router=express[_0xc1fe('0x4')]();var fs_extra=require(_0xc1fe('0x5'));var auth=require(_0xc1fe('0x6'));var interaction=require(_0xc1fe('0x7'));var config=require('../../config/environment');var controller=require(_0xc1fe('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc1fe('0x9')]);router[_0xc1fe('0xa')](_0xc1fe('0xb'),auth[_0xc1fe('0xc')](),controller['show']);router[_0xc1fe('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xc1fe('0xd')]);router[_0xc1fe('0xa')]('/:id/actions',auth[_0xc1fe('0xc')](),controller[_0xc1fe('0xe')]);router[_0xc1fe('0xf')]('/',auth[_0xc1fe('0xc')](),controller[_0xc1fe('0x10')]);router['post'](_0xc1fe('0x11'),auth['isAuthenticated'](),controller[_0xc1fe('0x12')]);router[_0xc1fe('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0xc1fe('0x13')]);router[_0xc1fe('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc1fe('0x15')](_0xc1fe('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 8c1b886..eb09d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f75=['ASC','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x1dbd64,_0x2abb00){var _0x261351=function(_0x392b7a){while(--_0x392b7a){_0x1dbd64['push'](_0x1dbd64['shift']());}};_0x261351(++_0x2abb00);}(_0x3f75,0xc8));var _0x53f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f75[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x53f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x53f7('0x1')],'unique':_0x53f7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x53f7('0x3')](_0x53f7('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x53f7('0x5')],'defaultValue':0x0,'comment':_0x53f7('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x53f7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x53f7('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x53f7('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x53f7('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x53f7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x53f7('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x53f7('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x53f7('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'defaultValue':0x3,'comment':_0x53f7('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x53f7('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x53f7('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x53f7('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x53f7('0x3')](_0x53f7('0x10'),_0x53f7('0x11'),_0x53f7('0x12')),'defaultValue':_0x53f7('0x10')},'dialAMDActive':{'type':Sequelize[_0x53f7('0x5')],'defaultValue':0x0,'comment':_0x53f7('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x53f7('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x53f7('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x53f7('0x9')](0x9)[_0x53f7('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x53f7('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x53f7('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x53f7('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x53f7('0x9')](0x9)[_0x53f7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x53f7('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x53f7('0x9')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x53f7('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x53f7('0x9')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x53f7('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x53f7('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x53f7('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x53f7('0x9')](0x9)[_0x53f7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x53f7('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x53f7('0x3')]('DESC',_0x53f7('0x1c')),'defaultValue':_0x53f7('0x1d')},'dialPrefix':{'type':Sequelize[_0x53f7('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x53f7('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x53f7('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x53f7('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x53f7('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x53f7('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x53f7('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x53f7('0x9')](0x3)[_0x53f7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x53f7('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x53f7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x53f7('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x53f7('0x9')](0x5)[_0x53f7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xe52a=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name'];(function(_0x51a20,_0x195290){var _0x18dbbd=function(_0x522eac){while(--_0x522eac){_0x51a20['push'](_0x51a20['shift']());}};_0x18dbbd(++_0x195290);}(_0xe52a,0x94));var _0xae52=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xe52a[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0xae52('0x0'));module[_0xae52('0x1')]={'name':{'type':Sequelize[_0xae52('0x2')],'unique':_0xae52('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xae52('0x4')),'allowNull':![],'defaultValue':_0xae52('0x4')},'description':{'type':Sequelize[_0xae52('0x2')]},'active':{'type':Sequelize[_0xae52('0x5')],'defaultValue':0x0,'comment':_0xae52('0x6')},'limitCalls':{'type':Sequelize[_0xae52('0x7')](0x4)[_0xae52('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xae52('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xae52('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xae52('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xae52('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xae52('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xae52('0x7')](0x5)[_0xae52('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'defaultValue':0x3,'comment':_0xae52('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xae52('0x7')](0x5)[_0xae52('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xae52('0x10')},'dialTimezone':{'type':Sequelize[_0xae52('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xae52('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xae52('0x11')](_0xae52('0x12'),_0xae52('0x13'),'onlyIfOpen'),'defaultValue':_0xae52('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xae52('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xae52('0x7')](0x9)[_0xae52('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xae52('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xae52('0x7')](0x9)[_0xae52('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xae52('0x7')](0x9)[_0xae52('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xae52('0x7')](0x9)[_0xae52('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xae52('0x7')](0x9)[_0xae52('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xae52('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xae52('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xae52('0x7')](0x9)[_0xae52('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xae52('0x7')](0x5)[_0xae52('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xae52('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xae52('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xae52('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xae52('0x19'),_0xae52('0x1a')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xae52('0x1b')},'dialCutDigit':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xae52('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xae52('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xae52('0x7')](0x5)[_0xae52('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xae52('0x7')](0x3)[_0xae52('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xae52('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xae52('0x7')](0x5)[_0xae52('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xae52('0x25')}};
\ No newline at end of file
index 29c7e0d..6007383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7b6=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','type','keys','query','filters','attributes','model','fields','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','length','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','cm_contacts','COALESCE(phone,\x27\x27)','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','into','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache'];(function(_0x3d339f,_0x5e6668){var _0x2120f0=function(_0xfb0ed){while(--_0xfb0ed){_0x3d339f['push'](_0x3d339f['shift']());}};_0x2120f0(++_0x5e6668);}(_0xb7b6,0x193));var _0x6b7b=function(_0x465270,_0x3b32e7){_0x465270=_0x465270-0x0;var _0x2855ce=_0xb7b6[_0x465270];return _0x2855ce;};'use strict';var emlformat=require(_0x6b7b('0x0'));var rimraf=require(_0x6b7b('0x1'));var zipdir=require(_0x6b7b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6b7b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6b7b('0x4'));var util=require(_0x6b7b('0x5'));var path=require('path');var sox=require(_0x6b7b('0x6'));var csv=require(_0x6b7b('0x7'));var ejs=require(_0x6b7b('0x8'));var fs=require('fs');var fs_extra=require(_0x6b7b('0x9'));var _=require(_0x6b7b('0xa'));var squel=require(_0x6b7b('0xb'));var crypto=require(_0x6b7b('0xc'));var jsforce=require(_0x6b7b('0xd'));var deskjs=require(_0x6b7b('0xe'));var toCsv=require(_0x6b7b('0x7'));var querystring=require(_0x6b7b('0xf'));var Papa=require('papaparse');var Redis=require(_0x6b7b('0x10'));var authService=require(_0x6b7b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6b7b('0x12'));var logger=require('../../config/logger')(_0x6b7b('0x13'));var utils=require(_0x6b7b('0x14'));var config=require(_0x6b7b('0x15'));var licenseUtil=require(_0x6b7b('0x16'));var db=require(_0x6b7b('0x17'))['db'];function respondWithStatusCode(_0x7e0865,_0x4f6220){_0x4f6220=_0x4f6220||0xcc;return function(_0x57d6cf){if(_0x57d6cf){return _0x7e0865[_0x6b7b('0x18')](_0x4f6220);}return _0x7e0865[_0x6b7b('0x19')](_0x4f6220)[_0x6b7b('0x1a')]();};}function respondWithResult(_0x3c6cf3,_0x2cc9ad){_0x2cc9ad=_0x2cc9ad||0xc8;return function(_0x114be1){if(_0x114be1){return _0x3c6cf3[_0x6b7b('0x19')](_0x2cc9ad)['json'](_0x114be1);}};}function respondWithFilteredResult(_0x300922,_0x42e230){return function(_0x229357){if(_0x229357){var _0x5baa48=typeof _0x42e230[_0x6b7b('0x1b')]===_0x6b7b('0x1c')&&typeof _0x42e230[_0x6b7b('0x1d')]===_0x6b7b('0x1c');var _0x2f4bd8=_0x229357[_0x6b7b('0x1e')];var _0x45f0a2=_0x5baa48?0x0:_0x42e230[_0x6b7b('0x1b')];var _0x2099f0=_0x5baa48?_0x229357[_0x6b7b('0x1e')]:_0x42e230[_0x6b7b('0x1b')]+_0x42e230[_0x6b7b('0x1d')];var _0x66e356;if(_0x2099f0>=_0x2f4bd8){_0x2099f0=_0x2f4bd8;_0x66e356=0xc8;}else{_0x66e356=0xce;}_0x300922[_0x6b7b('0x19')](_0x66e356);return _0x300922[_0x6b7b('0x1f')]('Content-Range',_0x45f0a2+'-'+_0x2099f0+'/'+_0x2f4bd8)['json'](_0x229357);}return null;};}function patchUpdates(_0x3d3d61){return function(_0x28b385){try{jsonpatch[_0x6b7b('0x20')](_0x28b385,_0x3d3d61,!![]);}catch(_0x1bc0f2){return BPromise[_0x6b7b('0x21')](_0x1bc0f2);}return _0x28b385[_0x6b7b('0x22')]();};}function saveUpdates(_0x27b470,_0x309de4){return function(_0x4858ce){if(_0x4858ce){return _0x4858ce[_0x6b7b('0x23')](_0x27b470)[_0x6b7b('0x24')](function(_0x3fb671){return _0x3fb671;});}return null;};}function removeEntity(_0x23af29,_0x47cc28){return function(_0x220cc1){if(_0x220cc1){return _0x220cc1[_0x6b7b('0x25')]()['then'](function(){var _0xb72029=_0x220cc1[_0x6b7b('0x26')]({'plain':!![]});var _0x3cace9='IvrCampaigns';return db[_0x6b7b('0x27')][_0x6b7b('0x25')]({'where':{'type':_0x3cace9,'resourceId':_0xb72029['id']}})[_0x6b7b('0x24')](function(){return _0x220cc1;});})[_0x6b7b('0x24')](function(){_0x23af29[_0x6b7b('0x19')](0xcc)[_0x6b7b('0x1a')]();});}};}function handleEntityNotFound(_0x35f8dd,_0x37ca13){return function(_0x217297){if(!_0x217297){_0x35f8dd[_0x6b7b('0x18')](0x194);}return _0x217297;};}function handleError(_0x462e57,_0x2abdec){_0x2abdec=_0x2abdec||0x1f4;return function(_0x39b719){logger[_0x6b7b('0x28')](_0x39b719['stack']);if(_0x39b719[_0x6b7b('0x29')]){delete _0x39b719[_0x6b7b('0x29')];}_0x462e57[_0x6b7b('0x19')](_0x2abdec)[_0x6b7b('0x2a')](_0x39b719);};}exports[_0x6b7b('0x2b')]=function(_0x5ec64c,_0x3a2fad){var _0x20c262={},_0x358f5c={},_0x31d66b={'count':0x0,'rows':[]};var _0x31a5a6=_[_0x6b7b('0x2c')](db[_0x6b7b('0x2d')][_0x6b7b('0x2e')],function(_0x3f87b5){return{'name':_0x3f87b5['fieldName'],'type':_0x3f87b5[_0x6b7b('0x2f')]['key']};});_0x358f5c['model']=_[_0x6b7b('0x2c')](_0x31a5a6,_0x6b7b('0x29'));_0x358f5c['query']=_[_0x6b7b('0x30')](_0x5ec64c[_0x6b7b('0x31')]);_0x358f5c[_0x6b7b('0x32')]=_['intersection'](_0x358f5c['model'],_0x358f5c[_0x6b7b('0x31')]);_0x20c262[_0x6b7b('0x33')]=_['intersection'](_0x358f5c[_0x6b7b('0x34')],qs[_0x6b7b('0x35')](_0x5ec64c[_0x6b7b('0x31')][_0x6b7b('0x35')]));_0x20c262[_0x6b7b('0x33')]=_0x20c262[_0x6b7b('0x33')]['length']?_0x20c262['attributes']:_0x358f5c[_0x6b7b('0x34')];if(!_0x5ec64c[_0x6b7b('0x31')][_0x6b7b('0x36')](_0x6b7b('0x37'))){_0x20c262[_0x6b7b('0x1d')]=qs['limit'](_0x5ec64c[_0x6b7b('0x31')][_0x6b7b('0x1d')]);_0x20c262['offset']=qs[_0x6b7b('0x1b')](_0x5ec64c['query'][_0x6b7b('0x1b')]);}_0x20c262['order']=qs[_0x6b7b('0x38')](_0x5ec64c['query']['sort']);_0x20c262['where']=qs['filters'](_['pick'](_0x5ec64c[_0x6b7b('0x31')],_0x358f5c[_0x6b7b('0x32')]),_0x31a5a6);if(_0x5ec64c[_0x6b7b('0x31')][_0x6b7b('0x39')]){_0x20c262[_0x6b7b('0x3a')]=_[_0x6b7b('0x3b')](_0x20c262['where'],{'$or':_[_0x6b7b('0x2c')](_0x31a5a6,function(_0x424076){if(_0x424076['type']!==_0x6b7b('0x3c')){var _0xdb1005={};_0xdb1005[_0x424076['name']]={'$like':'%'+_0x5ec64c[_0x6b7b('0x31')]['filter']+'%'};return _0xdb1005;}})});}_0x20c262=_[_0x6b7b('0x3b')]({},_0x20c262,_0x5ec64c[_0x6b7b('0x3d')]);var _0x373cb5={'where':_0x20c262[_0x6b7b('0x3a')]};return db[_0x6b7b('0x2d')][_0x6b7b('0x1e')](_0x373cb5)[_0x6b7b('0x24')](function(_0x3c137a){_0x31d66b[_0x6b7b('0x1e')]=_0x3c137a;if(_0x5ec64c['query'][_0x6b7b('0x3e')]){_0x20c262[_0x6b7b('0x3f')]=[{'all':!![]}];}return db[_0x6b7b('0x2d')][_0x6b7b('0x40')](_0x20c262);})['then'](function(_0x34f4d2){_0x31d66b[_0x6b7b('0x41')]=_0x34f4d2;return _0x31d66b;})[_0x6b7b('0x24')](respondWithFilteredResult(_0x3a2fad,_0x20c262))[_0x6b7b('0x42')](handleError(_0x3a2fad,null));};exports[_0x6b7b('0x43')]=function(_0x546ba4,_0x6136fc){var _0x41c5ce={'raw':![],'where':{'id':_0x546ba4[_0x6b7b('0x44')]['id']}},_0x4efd91={};_0x4efd91[_0x6b7b('0x34')]=_[_0x6b7b('0x30')](db['Campaign'][_0x6b7b('0x2e')]);_0x4efd91[_0x6b7b('0x31')]=_[_0x6b7b('0x30')](_0x546ba4['query']);_0x4efd91[_0x6b7b('0x32')]=_[_0x6b7b('0x45')](_0x4efd91['model'],_0x4efd91[_0x6b7b('0x31')]);_0x41c5ce[_0x6b7b('0x33')]=_[_0x6b7b('0x45')](_0x4efd91['model'],qs[_0x6b7b('0x35')](_0x546ba4[_0x6b7b('0x31')][_0x6b7b('0x35')]));_0x41c5ce[_0x6b7b('0x33')]=_0x41c5ce[_0x6b7b('0x33')]['length']?_0x41c5ce[_0x6b7b('0x33')]:_0x4efd91[_0x6b7b('0x34')];if(_0x546ba4[_0x6b7b('0x31')]['includeAll']){_0x41c5ce[_0x6b7b('0x3f')]=[{'all':!![]}];}_0x41c5ce=_[_0x6b7b('0x3b')]({},_0x41c5ce,_0x546ba4[_0x6b7b('0x3d')]);return db[_0x6b7b('0x2d')][_0x6b7b('0x46')](_0x41c5ce)[_0x6b7b('0x24')](handleEntityNotFound(_0x6136fc,null))[_0x6b7b('0x24')](respondWithResult(_0x6136fc,null))[_0x6b7b('0x42')](handleError(_0x6136fc,null));};exports[_0x6b7b('0x47')]=function(_0x23fdb7,_0x1b6b8a){return db[_0x6b7b('0x2d')][_0x6b7b('0x47')](_0x23fdb7['body'],{})[_0x6b7b('0x24')](function(_0x48d846){var _0x55138a=_0x23fdb7[_0x6b7b('0x48')][_0x6b7b('0x26')]({'plain':!![]});if(!_0x55138a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55138a['role']===_0x6b7b('0x48')){var _0x372cea=_0x48d846[_0x6b7b('0x26')]({'plain':!![]});var _0x102e6a='IvrCampaigns';return db['UserProfileSection']['find']({'where':{'name':_0x102e6a,'userProfileId':_0x55138a[_0x6b7b('0x49')]},'raw':!![]})[_0x6b7b('0x24')](function(_0x454438){if(_0x454438&&_0x454438[_0x6b7b('0x4a')]===0x0){return db[_0x6b7b('0x27')][_0x6b7b('0x47')]({'name':_0x372cea['name'],'resourceId':_0x372cea['id'],'type':_0x454438[_0x6b7b('0x29')],'sectionId':_0x454438['id']},{})['then'](function(){return _0x48d846;});}else{return _0x48d846;}})[_0x6b7b('0x42')](function(_0xed4d7b){logger[_0x6b7b('0x28')](_0x6b7b('0x4b'),_0xed4d7b);throw _0xed4d7b;});}return _0x48d846;})['then'](respondWithResult(_0x1b6b8a,0xc9))[_0x6b7b('0x42')](handleError(_0x1b6b8a,null));};exports[_0x6b7b('0x4c')]=function(_0x4f089c,_0x319089){var _0x49d847={'where':{'id':_0x4f089c[_0x6b7b('0x44')]['id']}},_0x419200={};_0x419200[_0x6b7b('0x34')]=_[_0x6b7b('0x30')](db[_0x6b7b('0x2d')][_0x6b7b('0x2e')]);_0x49d847[_0x6b7b('0x33')]=_[_0x6b7b('0x45')](_0x419200[_0x6b7b('0x34')],qs[_0x6b7b('0x35')](_0x4f089c[_0x6b7b('0x31')][_0x6b7b('0x35')]));_0x49d847[_0x6b7b('0x33')]=_0x49d847['attributes']['length']?_0x49d847['attributes']:_0x419200[_0x6b7b('0x34')];if(_0x4f089c[_0x6b7b('0x31')]['includeAll']){_0x49d847[_0x6b7b('0x3f')]=[{'all':!![]}];}_0x49d847=_[_0x6b7b('0x3b')]({},_0x49d847,_0x4f089c[_0x6b7b('0x3d')]);return db['Campaign'][_0x6b7b('0x46')](_0x49d847)[_0x6b7b('0x24')](handleEntityNotFound(_0x319089,null))[_0x6b7b('0x24')](function(_0x2d0bc9){if(_0x2d0bc9){var _0x2c69b6=_0x2d0bc9[_0x6b7b('0x26')]({'plain':!![]});_0x2c69b6=qs[_0x6b7b('0x4d')](_0x2c69b6,['id','createdAt',_0x6b7b('0x4e')]);_0x4f089c[_0x6b7b('0x4f')]=_[_0x6b7b('0x4d')](_0x4f089c[_0x6b7b('0x4f')],['id',_0x6b7b('0x50'),_0x6b7b('0x4e')]);return db[_0x6b7b('0x2d')][_0x6b7b('0x47')](_[_0x6b7b('0x3b')](_0x2c69b6,_0x4f089c[_0x6b7b('0x4f')]),{'include':_0x4f089c[_0x6b7b('0x31')][_0x6b7b('0x3e')]?[{'all':!![]}]:undefined})[_0x6b7b('0x24')](function(_0x52381d){var _0x2c6e15=_0x4f089c[_0x6b7b('0x48')][_0x6b7b('0x26')]({'plain':!![]});if(!_0x2c6e15)throw new Error(_0x6b7b('0x51'));if(_0x2c6e15[_0x6b7b('0x52')]===_0x6b7b('0x48')){var _0x4601e8=_0x52381d['get']({'plain':!![]});var _0x2ff914=_0x6b7b('0x53');return db[_0x6b7b('0x54')][_0x6b7b('0x46')]({'where':{'name':_0x2ff914,'userProfileId':_0x2c6e15[_0x6b7b('0x49')]},'raw':!![]})[_0x6b7b('0x24')](function(_0x270a51){if(_0x270a51&&_0x270a51[_0x6b7b('0x4a')]===0x0){return db[_0x6b7b('0x27')][_0x6b7b('0x47')]({'name':_0x4601e8['name'],'resourceId':_0x4601e8['id'],'type':_0x270a51[_0x6b7b('0x29')],'sectionId':_0x270a51['id']},{})[_0x6b7b('0x24')](function(){return _0x52381d;});}else{return _0x52381d;}})[_0x6b7b('0x42')](function(_0x1b0cf4){logger[_0x6b7b('0x28')](_0x6b7b('0x4b'),_0x1b0cf4);throw _0x1b0cf4;});}return _0x52381d;});}})[_0x6b7b('0x24')](respondWithResult(_0x319089,0xc9))['catch'](handleError(_0x319089,null));};exports['update']=function(_0x506f6e,_0x2c4637){if(_0x506f6e['body']['id']){delete _0x506f6e['body']['id'];}return db[_0x6b7b('0x2d')][_0x6b7b('0x46')]({'where':{'id':_0x506f6e[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x2c4637,null))[_0x6b7b('0x24')](saveUpdates(_0x506f6e[_0x6b7b('0x4f')],null))[_0x6b7b('0x24')](respondWithResult(_0x2c4637,null))['catch'](handleError(_0x2c4637,null));};exports[_0x6b7b('0x25')]=function(_0x3f141f,_0x18cb47){return db['Campaign'][_0x6b7b('0x46')]({'where':{'id':_0x3f141f[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x18cb47,null))[_0x6b7b('0x24')](removeEntity(_0x18cb47,null))[_0x6b7b('0x42')](handleError(_0x18cb47,null));};exports['getHoppers']=function(_0x22ff56,_0xf92e26,_0x10e828){var _0x363134={'raw':!![],'where':{}};var _0x4e37d2={};var _0x1f0c85={'count':0x0,'rows':[]};return db[_0x6b7b('0x2d')][_0x6b7b('0x55')]({'where':{'id':_0x22ff56[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0xf92e26,null))[_0x6b7b('0x24')](function(_0x3329e1){if(_0x3329e1){_0x4e37d2['model']=_[_0x6b7b('0x30')](db[_0x6b7b('0x56')]['rawAttributes']);_0x4e37d2[_0x6b7b('0x31')]=_[_0x6b7b('0x30')](_0x22ff56[_0x6b7b('0x31')]);_0x4e37d2[_0x6b7b('0x32')]=_[_0x6b7b('0x45')](_0x4e37d2[_0x6b7b('0x34')],_0x4e37d2['query']);_0x363134['attributes']=_[_0x6b7b('0x45')](_0x4e37d2[_0x6b7b('0x34')],qs[_0x6b7b('0x35')](_0x22ff56['query'][_0x6b7b('0x35')]));_0x363134[_0x6b7b('0x33')]=_0x363134[_0x6b7b('0x33')]['length']?_0x363134[_0x6b7b('0x33')]:_0x4e37d2[_0x6b7b('0x34')];if(!_0x22ff56[_0x6b7b('0x31')][_0x6b7b('0x36')]('nolimit')){_0x363134['limit']=qs['limit'](_0x22ff56[_0x6b7b('0x31')][_0x6b7b('0x1d')]);_0x363134[_0x6b7b('0x1b')]=qs[_0x6b7b('0x1b')](_0x22ff56[_0x6b7b('0x31')][_0x6b7b('0x1b')]);}_0x363134['order']=qs[_0x6b7b('0x38')](_0x22ff56['query'][_0x6b7b('0x38')]);_0x363134[_0x6b7b('0x3a')]=qs[_0x6b7b('0x32')](_[_0x6b7b('0x57')](_0x22ff56[_0x6b7b('0x31')],_0x4e37d2[_0x6b7b('0x32')]));_0x363134[_0x6b7b('0x3a')][_0x6b7b('0x58')]=_0x3329e1['id'];if(_0x22ff56[_0x6b7b('0x31')][_0x6b7b('0x39')]){_0x363134['where']=_['merge'](_0x363134[_0x6b7b('0x3a')],{'$or':_[_0x6b7b('0x2c')](_0x363134[_0x6b7b('0x33')],function(_0x2810ad){var _0x4c6627={};_0x4c6627[_0x2810ad]={'$like':'%'+_0x22ff56[_0x6b7b('0x31')][_0x6b7b('0x39')]+'%'};return _0x4c6627;})});}_0x363134=_[_0x6b7b('0x3b')]({},_0x363134,_0x22ff56[_0x6b7b('0x3d')]);return db[_0x6b7b('0x56')]['count']({'where':_0x363134[_0x6b7b('0x3a')]})['then'](function(_0x30daf5){_0x1f0c85[_0x6b7b('0x1e')]=_0x30daf5;if(_0x22ff56[_0x6b7b('0x31')][_0x6b7b('0x3e')]){_0x363134[_0x6b7b('0x3f')]=[{'all':!![]}];}return db[_0x6b7b('0x56')][_0x6b7b('0x40')](_0x363134);})['then'](function(_0x4d637b){_0x1f0c85['rows']=_0x4d637b;return _0x1f0c85;});}})[_0x6b7b('0x24')](respondWithFilteredResult(_0xf92e26,_0x363134))['catch'](handleError(_0xf92e26,null));};exports[_0x6b7b('0x59')]=function(_0x31b4d3,_0x44d01d,_0x25ec62){var _0xadff80={'raw':!![],'where':{}};var _0x52d85d={};var _0x5edfc2={'count':0x0,'rows':[]};return db[_0x6b7b('0x2d')][_0x6b7b('0x55')]({'where':{'id':_0x31b4d3['params']['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x44d01d,null))[_0x6b7b('0x24')](function(_0x118b87){if(_0x118b87){_0x52d85d['model']=_[_0x6b7b('0x30')](db[_0x6b7b('0x5a')][_0x6b7b('0x2e')]);_0x52d85d[_0x6b7b('0x31')]=_[_0x6b7b('0x30')](_0x31b4d3[_0x6b7b('0x31')]);_0x52d85d[_0x6b7b('0x32')]=_[_0x6b7b('0x45')](_0x52d85d[_0x6b7b('0x34')],_0x52d85d[_0x6b7b('0x31')]);_0xadff80['attributes']=_[_0x6b7b('0x45')](_0x52d85d[_0x6b7b('0x34')],qs[_0x6b7b('0x35')](_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x35')]));_0xadff80[_0x6b7b('0x33')]=_0xadff80['attributes'][_0x6b7b('0x5b')]?_0xadff80[_0x6b7b('0x33')]:_0x52d85d[_0x6b7b('0x34')];if(!_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x36')](_0x6b7b('0x37'))){_0xadff80[_0x6b7b('0x1d')]=qs['limit'](_0x31b4d3[_0x6b7b('0x31')]['limit']);_0xadff80[_0x6b7b('0x1b')]=qs[_0x6b7b('0x1b')](_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x1b')]);}_0xadff80[_0x6b7b('0x5c')]=qs[_0x6b7b('0x38')](_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x38')]);_0xadff80[_0x6b7b('0x3a')]=qs[_0x6b7b('0x32')](_[_0x6b7b('0x57')](_0x31b4d3[_0x6b7b('0x31')],_0x52d85d[_0x6b7b('0x32')]));_0xadff80[_0x6b7b('0x3a')][_0x6b7b('0x58')]=_0x118b87['id'];if(_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x39')]){_0xadff80[_0x6b7b('0x3a')]=_['merge'](_0xadff80[_0x6b7b('0x3a')],{'$or':_[_0x6b7b('0x2c')](_0xadff80[_0x6b7b('0x33')],function(_0x25934c){var _0x306411={};_0x306411[_0x25934c]={'$like':'%'+_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x39')]+'%'};return _0x306411;})});}_0xadff80=_[_0x6b7b('0x3b')]({},_0xadff80,_0x31b4d3[_0x6b7b('0x3d')]);return db[_0x6b7b('0x5a')][_0x6b7b('0x1e')]({'where':_0xadff80[_0x6b7b('0x3a')]})['then'](function(_0x2d6fa1){_0x5edfc2[_0x6b7b('0x1e')]=_0x2d6fa1;if(_0x31b4d3[_0x6b7b('0x31')][_0x6b7b('0x3e')]){_0xadff80[_0x6b7b('0x3f')]=[{'all':!![]}];}return db[_0x6b7b('0x5a')]['findAll'](_0xadff80);})[_0x6b7b('0x24')](function(_0x25ee8e){_0x5edfc2[_0x6b7b('0x41')]=_0x25ee8e;return _0x5edfc2;});}})[_0x6b7b('0x24')](respondWithFilteredResult(_0x44d01d,_0xadff80))[_0x6b7b('0x42')](handleError(_0x44d01d,null));};exports[_0x6b7b('0x5d')]=function(_0x42af17,_0x1a4f66,_0x4dbbf9){var _0x44a8c1={'raw':!![],'where':{}};var _0x28e77b={};var _0x536a7e={'count':0x0,'rows':[]};return db[_0x6b7b('0x2d')][_0x6b7b('0x55')]({'where':{'id':_0x42af17[_0x6b7b('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a4f66,null))[_0x6b7b('0x24')](function(_0x222a51){if(_0x222a51){_0x28e77b[_0x6b7b('0x34')]=_[_0x6b7b('0x30')](db[_0x6b7b('0x5e')][_0x6b7b('0x2e')]);_0x28e77b[_0x6b7b('0x31')]=_['keys'](_0x42af17[_0x6b7b('0x31')]);_0x28e77b['filters']=_['intersection'](_0x28e77b[_0x6b7b('0x34')],_0x28e77b[_0x6b7b('0x31')]);_0x44a8c1['attributes']=_[_0x6b7b('0x45')](_0x28e77b[_0x6b7b('0x34')],qs[_0x6b7b('0x35')](_0x42af17[_0x6b7b('0x31')][_0x6b7b('0x35')]));_0x44a8c1[_0x6b7b('0x33')]=_0x44a8c1[_0x6b7b('0x33')][_0x6b7b('0x5b')]?_0x44a8c1[_0x6b7b('0x33')]:_0x28e77b[_0x6b7b('0x34')];if(!_0x42af17[_0x6b7b('0x31')][_0x6b7b('0x36')](_0x6b7b('0x37'))){_0x44a8c1['limit']=qs[_0x6b7b('0x1d')](_0x42af17[_0x6b7b('0x31')][_0x6b7b('0x1d')]);_0x44a8c1[_0x6b7b('0x1b')]=qs[_0x6b7b('0x1b')](_0x42af17[_0x6b7b('0x31')][_0x6b7b('0x1b')]);}_0x44a8c1[_0x6b7b('0x5c')]=qs[_0x6b7b('0x38')](_0x42af17['query'][_0x6b7b('0x38')]);_0x44a8c1[_0x6b7b('0x3a')]=qs[_0x6b7b('0x32')](_[_0x6b7b('0x57')](_0x42af17[_0x6b7b('0x31')],_0x28e77b[_0x6b7b('0x32')]));_0x44a8c1[_0x6b7b('0x3a')]['CampaignId']=_0x222a51['id'];if(_0x42af17[_0x6b7b('0x31')]['filter']){_0x44a8c1['where']=_[_0x6b7b('0x3b')](_0x44a8c1[_0x6b7b('0x3a')],{'$or':_[_0x6b7b('0x2c')](_0x44a8c1['attributes'],function(_0x4883ca){var _0x89f23a={};_0x89f23a[_0x4883ca]={'$like':'%'+_0x42af17[_0x6b7b('0x31')][_0x6b7b('0x39')]+'%'};return _0x89f23a;})});}_0x44a8c1=_[_0x6b7b('0x3b')]({},_0x44a8c1,_0x42af17[_0x6b7b('0x3d')]);return db[_0x6b7b('0x5e')][_0x6b7b('0x1e')]({'where':_0x44a8c1[_0x6b7b('0x3a')]})[_0x6b7b('0x24')](function(_0x469826){_0x536a7e['count']=_0x469826;if(_0x42af17[_0x6b7b('0x31')][_0x6b7b('0x3e')]){_0x44a8c1[_0x6b7b('0x3f')]=[{'all':!![]}];}return db[_0x6b7b('0x5e')][_0x6b7b('0x40')](_0x44a8c1);})[_0x6b7b('0x24')](function(_0x4f4359){_0x536a7e[_0x6b7b('0x41')]=_0x4f4359;return _0x536a7e;});}})[_0x6b7b('0x24')](respondWithFilteredResult(_0x1a4f66,_0x44a8c1))[_0x6b7b('0x42')](handleError(_0x1a4f66,null));};exports[_0x6b7b('0x5f')]=function(_0xcad0f8,_0x1a0e06,_0x55ddb0){var _0x3301a4={'raw':!![],'where':{}};var _0x4755b2={};var _0x371493={'count':0x0,'rows':[]};return db[_0x6b7b('0x2d')]['findOne']({'where':{'id':_0xcad0f8['params']['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x1a0e06,null))[_0x6b7b('0x24')](function(_0x2abeb1){if(_0x2abeb1){_0x4755b2[_0x6b7b('0x34')]=_[_0x6b7b('0x30')](db['CmHopperBlack']['rawAttributes']);_0x4755b2[_0x6b7b('0x31')]=_[_0x6b7b('0x30')](_0xcad0f8['query']);_0x4755b2[_0x6b7b('0x32')]=_[_0x6b7b('0x45')](_0x4755b2['model'],_0x4755b2[_0x6b7b('0x31')]);_0x3301a4['attributes']=_[_0x6b7b('0x45')](_0x4755b2[_0x6b7b('0x34')],qs[_0x6b7b('0x35')](_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x35')]));_0x3301a4[_0x6b7b('0x33')]=_0x3301a4[_0x6b7b('0x33')]['length']?_0x3301a4[_0x6b7b('0x33')]:_0x4755b2[_0x6b7b('0x34')];if(!_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x36')](_0x6b7b('0x37'))){_0x3301a4['limit']=qs[_0x6b7b('0x1d')](_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x1d')]);_0x3301a4['offset']=qs['offset'](_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x1b')]);}_0x3301a4[_0x6b7b('0x5c')]=qs[_0x6b7b('0x38')](_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x38')]);_0x3301a4['where']=qs[_0x6b7b('0x32')](_[_0x6b7b('0x57')](_0xcad0f8[_0x6b7b('0x31')],_0x4755b2[_0x6b7b('0x32')]));_0x3301a4[_0x6b7b('0x3a')][_0x6b7b('0x58')]=_0x2abeb1['id'];if(_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x39')]){_0x3301a4[_0x6b7b('0x3a')]=_[_0x6b7b('0x3b')](_0x3301a4[_0x6b7b('0x3a')],{'$or':_[_0x6b7b('0x2c')](_0x3301a4[_0x6b7b('0x33')],function(_0x37622e){var _0x481b5e={};_0x481b5e[_0x37622e]={'$like':'%'+_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x39')]+'%'};return _0x481b5e;})});}_0x3301a4=_['merge']({},_0x3301a4,_0xcad0f8['options']);return db[_0x6b7b('0x60')][_0x6b7b('0x1e')]({'where':_0x3301a4[_0x6b7b('0x3a')]})[_0x6b7b('0x24')](function(_0xa8e5e7){_0x371493[_0x6b7b('0x1e')]=_0xa8e5e7;if(_0xcad0f8[_0x6b7b('0x31')][_0x6b7b('0x3e')]){_0x3301a4[_0x6b7b('0x3f')]=[{'all':!![]}];}return db[_0x6b7b('0x60')][_0x6b7b('0x40')](_0x3301a4);})[_0x6b7b('0x24')](function(_0x147e73){_0x371493[_0x6b7b('0x41')]=_0x147e73;return _0x371493;});}})[_0x6b7b('0x24')](respondWithFilteredResult(_0x1a0e06,_0x3301a4))[_0x6b7b('0x42')](handleError(_0x1a0e06,null));};exports['getLists']=function(_0x3ce84d,_0x57ce41,_0x24dbd7){var _0x386d52={};var _0x4c88a4={};var _0x35edc2;var _0x1d171a;return db['Campaign'][_0x6b7b('0x55')]({'where':{'id':_0x3ce84d[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x57ce41,null))[_0x6b7b('0x24')](function(_0x1f16f9){if(_0x1f16f9){_0x35edc2=_0x1f16f9;_0x4c88a4['model']=_['keys'](db[_0x6b7b('0x61')][_0x6b7b('0x2e')]);_0x4c88a4[_0x6b7b('0x31')]=_[_0x6b7b('0x30')](_0x3ce84d['query']);_0x4c88a4['filters']=_[_0x6b7b('0x45')](_0x4c88a4['model'],_0x4c88a4['query']);_0x386d52['attributes']=_[_0x6b7b('0x45')](_0x4c88a4[_0x6b7b('0x34')],qs['fields'](_0x3ce84d['query'][_0x6b7b('0x35')]));_0x386d52[_0x6b7b('0x33')]=_0x386d52[_0x6b7b('0x33')]['length']?_0x386d52[_0x6b7b('0x33')]:_0x4c88a4['model'];_0x386d52['order']=qs[_0x6b7b('0x38')](_0x3ce84d[_0x6b7b('0x31')]['sort']);_0x386d52['where']=qs[_0x6b7b('0x32')](_[_0x6b7b('0x57')](_0x3ce84d['query'],_0x4c88a4[_0x6b7b('0x32')]));if(_0x3ce84d[_0x6b7b('0x31')][_0x6b7b('0x39')]){_0x386d52['where']=_['merge'](_0x386d52['where'],{'$or':_['map'](_0x386d52[_0x6b7b('0x33')],function(_0x44be44){var _0x4fbd9c={};_0x4fbd9c[_0x44be44]={'$like':'%'+_0x3ce84d[_0x6b7b('0x31')]['filter']+'%'};return _0x4fbd9c;})});}_0x386d52=_['merge']({},_0x386d52,_0x3ce84d[_0x6b7b('0x3d')]);return _0x35edc2[_0x6b7b('0x62')](_0x386d52);}})['then'](function(_0x53815a){if(_0x53815a){_0x1d171a=_0x53815a[_0x6b7b('0x5b')];if(!_0x3ce84d[_0x6b7b('0x31')][_0x6b7b('0x36')](_0x6b7b('0x37'))){_0x386d52['limit']=qs[_0x6b7b('0x1d')](_0x3ce84d['query'][_0x6b7b('0x1d')]);_0x386d52[_0x6b7b('0x1b')]=qs['offset'](_0x3ce84d[_0x6b7b('0x31')][_0x6b7b('0x1b')]);}return _0x35edc2[_0x6b7b('0x62')](_0x386d52);}})['then'](function(_0x5cef6e){if(_0x5cef6e){return _0x5cef6e?{'count':_0x1d171a,'rows':_0x5cef6e}:null;}})[_0x6b7b('0x24')](respondWithResult(_0x57ce41,null))[_0x6b7b('0x42')](handleError(_0x57ce41,null));};exports[_0x6b7b('0x63')]=function(_0x19c62e,_0x2b4807,_0x2a2c47){var _0x2af1ef,_0x4bef28;return db[_0x6b7b('0x2d')][_0x6b7b('0x46')]({'where':{'id':_0x19c62e[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x2b4807,null))['then'](function(_0x58d663){if(_0x58d663){_0x4bef28=_0x58d663;return _0x58d663[_0x6b7b('0x63')](_0x19c62e['body'][_0x6b7b('0x64')],_[_0x6b7b('0x4d')](_0x19c62e[_0x6b7b('0x4f')],[_0x6b7b('0x64'),'id'])||{});}return null;})['spread'](function(_0x5c62c1){var _0x5f4745;_0x2af1ef=_0x5c62c1||[];var _0x28518b=[];if(_0x5c62c1){for(var _0x8fdc86=0x0;_0x8fdc86<_0x5c62c1['length'];_0x8fdc86+=0x1){var _0x20b65e=_0x5c62c1[_0x8fdc86][_0x6b7b('0x26')]({'plain':!![]});_0x4bef28[_0x6b7b('0x65')]=_0x19c62e[_0x6b7b('0x4f')][_0x6b7b('0x65')]?_0x19c62e[_0x6b7b('0x4f')]['dialCheckDuplicateType']:_0x4bef28[_0x6b7b('0x65')];switch(_0x4bef28[_0x6b7b('0x65')]){case _0x6b7b('0x66'):_0x5f4745=squel[_0x6b7b('0x67')]()['into'](_0x6b7b('0x68'))[_0x6b7b('0x69')]([_0x6b7b('0x6a'),_0x6b7b('0x6b'),_0x6b7b('0x6c'),_0x6b7b('0x6d'),_0x6b7b('0x58'),_0x6b7b('0x50'),'updatedAt'],squel['select']()[_0x6b7b('0x6e')](_0x6b7b('0x6a'),_0x6b7b('0x6a'))[_0x6b7b('0x6e')](_0x6b7b('0x6f'),_0x6b7b('0x6b'))[_0x6b7b('0x6e')]('id','ContactId')[_0x6b7b('0x6e')](_0x20b65e[_0x6b7b('0x70')][_0x6b7b('0x71')](),_0x6b7b('0x6d'))[_0x6b7b('0x6e')](_0x19c62e[_0x6b7b('0x44')]['id']['toString'](),_0x6b7b('0x58'))[_0x6b7b('0x6e')](_0x6b7b('0x6f'),_0x6b7b('0x50'))[_0x6b7b('0x6e')](_0x6b7b('0x6f'),_0x6b7b('0x4e'))[_0x6b7b('0x72')]('cm_contacts')[_0x6b7b('0x3a')](_0x6b7b('0x73'))[_0x6b7b('0x3a')](_0x6b7b('0x74'),_0x20b65e[_0x6b7b('0x70')][_0x6b7b('0x71')]())[_0x6b7b('0x3a')](_0x6b7b('0x75'))[_0x6b7b('0x3a')](_0x6b7b('0x76'),squel[_0x6b7b('0x77')]()['field'](_0x6b7b('0x78'))[_0x6b7b('0x72')](_0x6b7b('0x79'))['where'](_0x6b7b('0x7a'),_0x19c62e[_0x6b7b('0x44')]['id'][_0x6b7b('0x71')]()))[_0x6b7b('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6b7b('0x6e')]('COALESCE(phone,\x27\x27)')[_0x6b7b('0x72')](_0x6b7b('0x68'))[_0x6b7b('0x3a')]('CampaignId\x20=\x20?',_0x19c62e[_0x6b7b('0x44')]['id']['toString']())))[_0x6b7b('0x71')]();break;case _0x6b7b('0x7b'):_0x5f4745=squel['insert']()['into'](_0x6b7b('0x68'))['fromQuery']([_0x6b7b('0x6a'),_0x6b7b('0x6b'),_0x6b7b('0x6c'),'ListId',_0x6b7b('0x58'),_0x6b7b('0x50'),_0x6b7b('0x4e')],squel[_0x6b7b('0x77')]()[_0x6b7b('0x6e')](_0x6b7b('0x6a'),_0x6b7b('0x6a'))[_0x6b7b('0x6e')](_0x6b7b('0x6f'),_0x6b7b('0x6b'))[_0x6b7b('0x6e')]('id',_0x6b7b('0x6c'))[_0x6b7b('0x6e')](_0x20b65e[_0x6b7b('0x70')][_0x6b7b('0x71')](),_0x6b7b('0x6d'))[_0x6b7b('0x6e')](_0x19c62e[_0x6b7b('0x44')]['id'][_0x6b7b('0x71')](),_0x6b7b('0x58'))['field'](_0x6b7b('0x6f'),'createdAt')[_0x6b7b('0x6e')](_0x6b7b('0x6f'),_0x6b7b('0x4e'))[_0x6b7b('0x72')](_0x6b7b('0x7c'))[_0x6b7b('0x3a')](_0x6b7b('0x73'))['where']('ListId\x20=\x20?',_0x20b65e[_0x6b7b('0x70')][_0x6b7b('0x71')]())[_0x6b7b('0x3a')](_0x6b7b('0x75'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6b7b('0x77')]()['field'](_0x6b7b('0x7d'))['from']('cm_hopper')[_0x6b7b('0x3a')](_0x6b7b('0x7a'),_0x19c62e[_0x6b7b('0x44')]['id'][_0x6b7b('0x71')]())))[_0x6b7b('0x71')]();break;default:_0x5f4745=squel[_0x6b7b('0x67')]()['into'](_0x6b7b('0x68'))['fromQuery']([_0x6b7b('0x6a'),'scheduledAt',_0x6b7b('0x6c'),_0x6b7b('0x6d'),_0x6b7b('0x58'),_0x6b7b('0x50'),_0x6b7b('0x4e')],squel[_0x6b7b('0x77')]()['field']('phone','phone')['field'](_0x6b7b('0x6f'),_0x6b7b('0x6b'))[_0x6b7b('0x6e')]('id',_0x6b7b('0x6c'))['field'](_0x20b65e[_0x6b7b('0x70')]['toString'](),'ListId')[_0x6b7b('0x6e')](_0x19c62e[_0x6b7b('0x44')]['id'][_0x6b7b('0x71')](),'CampaignId')[_0x6b7b('0x6e')](_0x6b7b('0x6f'),_0x6b7b('0x50'))['field'](_0x6b7b('0x6f'),_0x6b7b('0x4e'))['from'](_0x6b7b('0x7c'))['where'](_0x6b7b('0x73'))[_0x6b7b('0x3a')](_0x6b7b('0x74'),_0x20b65e[_0x6b7b('0x70')][_0x6b7b('0x71')]())[_0x6b7b('0x3a')](_0x6b7b('0x75')))['toString']();}_0x28518b['push'](db[_0x6b7b('0x7e')]['query'](_0x5f4745));}return BPromise[_0x6b7b('0x7f')](_0x28518b);}})[_0x6b7b('0x24')](function(){return _0x2af1ef;})['then'](respondWithResult(_0x2b4807,null))[_0x6b7b('0x42')](handleError(_0x2b4807,null));};exports[_0x6b7b('0x80')]=function(_0x5182d5,_0x303ee4,_0xfddd7d){return db[_0x6b7b('0x2d')][_0x6b7b('0x46')]({'where':{'id':_0x5182d5['params']['id']}})['then'](handleEntityNotFound(_0x303ee4,null))['then'](function(_0x484ee7){if(_0x484ee7){return _0x484ee7[_0x6b7b('0x80')](_0x5182d5[_0x6b7b('0x31')][_0x6b7b('0x64')]);}})[_0x6b7b('0x24')](function(_0x2aecbe){if(_0x2aecbe){return db[_0x6b7b('0x56')]['destroy']({'where':{'ListId':_0x5182d5['query'][_0x6b7b('0x64')],'CampaignId':_0x5182d5[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](function(){return _0x2aecbe;});}})[_0x6b7b('0x24')](respondWithStatusCode(_0x303ee4,null))[_0x6b7b('0x42')](handleError(_0x303ee4,null));};exports['getBlackLists']=function(_0x36440b,_0x108e73,_0xd365f3){var _0x4ef756={};var _0x3fc692={};var _0x1adad1;var _0x25f554;return db[_0x6b7b('0x2d')][_0x6b7b('0x55')]({'where':{'id':_0x36440b[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x108e73,null))[_0x6b7b('0x24')](function(_0x319209){if(_0x319209){_0x1adad1=_0x319209;_0x3fc692[_0x6b7b('0x34')]=_[_0x6b7b('0x30')](db[_0x6b7b('0x61')]['rawAttributes']);_0x3fc692[_0x6b7b('0x31')]=_[_0x6b7b('0x30')](_0x36440b[_0x6b7b('0x31')]);_0x3fc692[_0x6b7b('0x32')]=_['intersection'](_0x3fc692[_0x6b7b('0x34')],_0x3fc692['query']);_0x4ef756['attributes']=_[_0x6b7b('0x45')](_0x3fc692['model'],qs[_0x6b7b('0x35')](_0x36440b[_0x6b7b('0x31')]['fields']));_0x4ef756[_0x6b7b('0x33')]=_0x4ef756[_0x6b7b('0x33')][_0x6b7b('0x5b')]?_0x4ef756['attributes']:_0x3fc692[_0x6b7b('0x34')];_0x4ef756['order']=qs[_0x6b7b('0x38')](_0x36440b['query'][_0x6b7b('0x38')]);_0x4ef756[_0x6b7b('0x3a')]=qs['filters'](_[_0x6b7b('0x57')](_0x36440b[_0x6b7b('0x31')],_0x3fc692[_0x6b7b('0x32')]));if(_0x36440b['query'][_0x6b7b('0x39')]){_0x4ef756[_0x6b7b('0x3a')]=_[_0x6b7b('0x3b')](_0x4ef756[_0x6b7b('0x3a')],{'$or':_['map'](_0x4ef756[_0x6b7b('0x33')],function(_0x2a10d5){var _0x506398={};_0x506398[_0x2a10d5]={'$like':'%'+_0x36440b[_0x6b7b('0x31')]['filter']+'%'};return _0x506398;})});}_0x4ef756=_[_0x6b7b('0x3b')]({},_0x4ef756,_0x36440b[_0x6b7b('0x3d')]);return _0x1adad1[_0x6b7b('0x81')](_0x4ef756);}})[_0x6b7b('0x24')](function(_0x244131){if(_0x244131){_0x25f554=_0x244131[_0x6b7b('0x5b')];if(!_0x36440b['query'][_0x6b7b('0x36')]('nolimit')){_0x4ef756['limit']=qs[_0x6b7b('0x1d')](_0x36440b[_0x6b7b('0x31')]['limit']);_0x4ef756['offset']=qs[_0x6b7b('0x1b')](_0x36440b['query'][_0x6b7b('0x1b')]);}return _0x1adad1['getBlackLists'](_0x4ef756);}})[_0x6b7b('0x24')](function(_0x506088){if(_0x506088){return _0x506088?{'count':_0x25f554,'rows':_0x506088}:null;}})[_0x6b7b('0x24')](respondWithResult(_0x108e73,null))[_0x6b7b('0x42')](handleError(_0x108e73,null));};exports[_0x6b7b('0x82')]=function(_0x29286d,_0x5a8c56,_0x1ea42d){var _0x11c26a,_0x5d1712;return db[_0x6b7b('0x2d')]['find']({'where':{'id':_0x29286d[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](handleEntityNotFound(_0x5a8c56,null))[_0x6b7b('0x24')](function(_0x5f1ff8){if(_0x5f1ff8){_0x5d1712=_0x5f1ff8;return _0x5f1ff8[_0x6b7b('0x82')](_0x29286d['body'][_0x6b7b('0x64')],_[_0x6b7b('0x4d')](_0x29286d[_0x6b7b('0x4f')],[_0x6b7b('0x64'),'id'])||{});}return null;})[_0x6b7b('0x83')](function(_0x580ebb){var _0x4b366c;_0x11c26a=_0x580ebb||[];var _0x6ac5c2=[];if(_0x580ebb){for(var _0x441ca3=0x0;_0x441ca3<_0x580ebb[_0x6b7b('0x5b')];_0x441ca3+=0x1){var _0x2a46f2=_0x580ebb[_0x441ca3]['get']({'plain':!![]});_0x4b366c=squel[_0x6b7b('0x67')]()[_0x6b7b('0x84')](_0x6b7b('0x85'))['fromQuery'](['phone',_0x6b7b('0x6c'),_0x6b7b('0x6d'),_0x6b7b('0x58'),'createdAt',_0x6b7b('0x4e')],squel[_0x6b7b('0x77')]()['field'](_0x6b7b('0x6a'),_0x6b7b('0x6a'))[_0x6b7b('0x6e')]('id',_0x6b7b('0x6c'))[_0x6b7b('0x6e')](_0x2a46f2[_0x6b7b('0x70')][_0x6b7b('0x71')](),'ListId')[_0x6b7b('0x6e')](_0x29286d[_0x6b7b('0x44')]['id'][_0x6b7b('0x71')](),_0x6b7b('0x58'))['field'](_0x6b7b('0x6f'),_0x6b7b('0x50'))[_0x6b7b('0x6e')]('NOW()',_0x6b7b('0x4e'))[_0x6b7b('0x72')]('cm_contacts')[_0x6b7b('0x3a')](_0x6b7b('0x73'))['where'](_0x6b7b('0x74'),_0x2a46f2[_0x6b7b('0x70')][_0x6b7b('0x71')]())['where'](_0x6b7b('0x75')))['toString']();_0x6ac5c2[_0x6b7b('0x86')](db[_0x6b7b('0x7e')][_0x6b7b('0x31')](_0x4b366c));}return BPromise[_0x6b7b('0x7f')](_0x6ac5c2);}})['then'](function(){return _0x11c26a;})['then'](respondWithResult(_0x5a8c56,null))[_0x6b7b('0x42')](handleError(_0x5a8c56,null));};exports[_0x6b7b('0x87')]=function(_0x5287c3,_0x6db5f5,_0x15a464){return db['Campaign'][_0x6b7b('0x46')]({'where':{'id':_0x5287c3['params']['id']}})['then'](handleEntityNotFound(_0x6db5f5,null))[_0x6b7b('0x24')](function(_0x357daa){if(_0x357daa){return _0x357daa[_0x6b7b('0x87')](_0x5287c3[_0x6b7b('0x31')][_0x6b7b('0x64')]);}})['then'](function(_0x3a7516){if(_0x3a7516){return db[_0x6b7b('0x60')][_0x6b7b('0x25')]({'where':{'ListId':_0x5287c3[_0x6b7b('0x31')][_0x6b7b('0x64')],'CampaignId':_0x5287c3[_0x6b7b('0x44')]['id']}})[_0x6b7b('0x24')](function(){return _0x3a7516;});}})[_0x6b7b('0x24')](respondWithStatusCode(_0x6db5f5,null))[_0x6b7b('0x42')](handleError(_0x6db5f5,null));};
\ No newline at end of file
+var _0x1edc=['order','CampaignId','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','CampaignId\x20=\x20?','cm_hopper','into','cm_contacts','COALESCE(phone,\x27\x27)','all','removeLists','getBlackLists','addBlackLists','deletedAt\x20IS\x20NULL','push','sequelize','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','index','map','Campaign','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','catch','show','params','length','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','getHoppers','findOne','CmHopper'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x1edc,0x135));var _0xc1ed=function(_0x51cbc6,_0x56410c){_0x51cbc6=_0x51cbc6-0x0;var _0x2dc19c=_0x1edc[_0x51cbc6];return _0x2dc19c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1ed('0x0'));var zipdir=require(_0xc1ed('0x1'));var jsonpatch=require(_0xc1ed('0x2'));var rp=require(_0xc1ed('0x3'));var moment=require(_0xc1ed('0x4'));var BPromise=require(_0xc1ed('0x5'));var Mustache=require(_0xc1ed('0x6'));var util=require(_0xc1ed('0x7'));var path=require(_0xc1ed('0x8'));var sox=require(_0xc1ed('0x9'));var csv=require('to-csv');var ejs=require(_0xc1ed('0xa'));var fs=require('fs');var fs_extra=require(_0xc1ed('0xb'));var _=require('lodash');var squel=require(_0xc1ed('0xc'));var crypto=require(_0xc1ed('0xd'));var jsforce=require(_0xc1ed('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc1ed('0xf'));var querystring=require(_0xc1ed('0x10'));var Papa=require(_0xc1ed('0x11'));var Redis=require(_0xc1ed('0x12'));var authService=require(_0xc1ed('0x13'));var qs=require(_0xc1ed('0x14'));var as=require(_0xc1ed('0x15'));var hardwareService=require(_0xc1ed('0x16'));var logger=require(_0xc1ed('0x17'))(_0xc1ed('0x18'));var utils=require(_0xc1ed('0x19'));var config=require(_0xc1ed('0x1a'));var licenseUtil=require(_0xc1ed('0x1b'));var db=require(_0xc1ed('0x1c'))['db'];function respondWithStatusCode(_0x5bfe81,_0x5052ca){_0x5052ca=_0x5052ca||0xcc;return function(_0x357cb1){if(_0x357cb1){return _0x5bfe81[_0xc1ed('0x1d')](_0x5052ca);}return _0x5bfe81['status'](_0x5052ca)['end']();};}function respondWithResult(_0x1c87d9,_0x47b779){_0x47b779=_0x47b779||0xc8;return function(_0x5b0fc6){if(_0x5b0fc6){return _0x1c87d9['status'](_0x47b779)[_0xc1ed('0x1e')](_0x5b0fc6);}};}function respondWithFilteredResult(_0x3cfa24,_0x14bf29){return function(_0x245b49){if(_0x245b49){var _0x2952de=typeof _0x14bf29['offset']===_0xc1ed('0x1f')&&typeof _0x14bf29[_0xc1ed('0x20')]===_0xc1ed('0x1f');var _0x3ebee3=_0x245b49[_0xc1ed('0x21')];var _0x5babbd=_0x2952de?0x0:_0x14bf29[_0xc1ed('0x22')];var _0x265105=_0x2952de?_0x245b49[_0xc1ed('0x21')]:_0x14bf29[_0xc1ed('0x22')]+_0x14bf29[_0xc1ed('0x20')];var _0x1b2a69;if(_0x265105>=_0x3ebee3){_0x265105=_0x3ebee3;_0x1b2a69=0xc8;}else{_0x1b2a69=0xce;}_0x3cfa24[_0xc1ed('0x23')](_0x1b2a69);return _0x3cfa24['set'](_0xc1ed('0x24'),_0x5babbd+'-'+_0x265105+'/'+_0x3ebee3)[_0xc1ed('0x1e')](_0x245b49);}return null;};}function patchUpdates(_0x2b2cb9){return function(_0xf617fc){try{jsonpatch[_0xc1ed('0x25')](_0xf617fc,_0x2b2cb9,!![]);}catch(_0x3ac073){return BPromise['reject'](_0x3ac073);}return _0xf617fc[_0xc1ed('0x26')]();};}function saveUpdates(_0x44bff,_0xd64e2d){return function(_0x4941a3){if(_0x4941a3){return _0x4941a3[_0xc1ed('0x27')](_0x44bff)[_0xc1ed('0x28')](function(_0x3559d7){return _0x3559d7;});}return null;};}function removeEntity(_0x3e6132,_0x13acef){return function(_0x4d77bd){if(_0x4d77bd){return _0x4d77bd[_0xc1ed('0x29')]()[_0xc1ed('0x28')](function(){var _0x59f0ec=_0x4d77bd[_0xc1ed('0x2a')]({'plain':!![]});var _0x2a9610=_0xc1ed('0x2b');return db[_0xc1ed('0x2c')][_0xc1ed('0x29')]({'where':{'type':_0x2a9610,'resourceId':_0x59f0ec['id']}})[_0xc1ed('0x28')](function(){return _0x4d77bd;});})['then'](function(){_0x3e6132[_0xc1ed('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bfd39,_0x4f6f8f){return function(_0x2c53fb){if(!_0x2c53fb){_0x3bfd39[_0xc1ed('0x1d')](0x194);}return _0x2c53fb;};}function handleError(_0x5c74d5,_0x27127a){_0x27127a=_0x27127a||0x1f4;return function(_0x1bf98e){logger[_0xc1ed('0x2d')](_0x1bf98e['stack']);if(_0x1bf98e[_0xc1ed('0x2e')]){delete _0x1bf98e[_0xc1ed('0x2e')];}_0x5c74d5[_0xc1ed('0x23')](_0x27127a)['send'](_0x1bf98e);};}exports[_0xc1ed('0x2f')]=function(_0x49ba26,_0x3d99c4){var _0x4b31a7={},_0x5a18b5={},_0x287a54={'count':0x0,'rows':[]};var _0x42134c=_[_0xc1ed('0x30')](db[_0xc1ed('0x31')][_0xc1ed('0x32')],function(_0x5464d3){return{'name':_0x5464d3[_0xc1ed('0x33')],'type':_0x5464d3[_0xc1ed('0x34')]['key']};});_0x5a18b5['model']=_[_0xc1ed('0x30')](_0x42134c,_0xc1ed('0x2e'));_0x5a18b5['query']=_[_0xc1ed('0x35')](_0x49ba26[_0xc1ed('0x36')]);_0x5a18b5[_0xc1ed('0x37')]=_[_0xc1ed('0x38')](_0x5a18b5['model'],_0x5a18b5[_0xc1ed('0x36')]);_0x4b31a7[_0xc1ed('0x39')]=_[_0xc1ed('0x38')](_0x5a18b5[_0xc1ed('0x3a')],qs[_0xc1ed('0x3b')](_0x49ba26['query'][_0xc1ed('0x3b')]));_0x4b31a7[_0xc1ed('0x39')]=_0x4b31a7['attributes']['length']?_0x4b31a7[_0xc1ed('0x39')]:_0x5a18b5[_0xc1ed('0x3a')];if(!_0x49ba26['query'][_0xc1ed('0x3c')](_0xc1ed('0x3d'))){_0x4b31a7[_0xc1ed('0x20')]=qs[_0xc1ed('0x20')](_0x49ba26[_0xc1ed('0x36')][_0xc1ed('0x20')]);_0x4b31a7[_0xc1ed('0x22')]=qs[_0xc1ed('0x22')](_0x49ba26[_0xc1ed('0x36')][_0xc1ed('0x22')]);}_0x4b31a7['order']=qs[_0xc1ed('0x3e')](_0x49ba26[_0xc1ed('0x36')][_0xc1ed('0x3e')]);_0x4b31a7[_0xc1ed('0x3f')]=qs[_0xc1ed('0x37')](_[_0xc1ed('0x40')](_0x49ba26[_0xc1ed('0x36')],_0x5a18b5['filters']),_0x42134c);if(_0x49ba26[_0xc1ed('0x36')][_0xc1ed('0x41')]){_0x4b31a7[_0xc1ed('0x3f')]=_[_0xc1ed('0x42')](_0x4b31a7[_0xc1ed('0x3f')],{'$or':_[_0xc1ed('0x30')](_0x42134c,function(_0x2a4c12){if(_0x2a4c12[_0xc1ed('0x34')]!=='VIRTUAL'){var _0x122d06={};_0x122d06[_0x2a4c12[_0xc1ed('0x2e')]]={'$like':'%'+_0x49ba26[_0xc1ed('0x36')][_0xc1ed('0x41')]+'%'};return _0x122d06;}})});}_0x4b31a7=_[_0xc1ed('0x42')]({},_0x4b31a7,_0x49ba26['options']);var _0x19924a={'where':_0x4b31a7[_0xc1ed('0x3f')]};return db['Campaign']['count'](_0x19924a)[_0xc1ed('0x28')](function(_0xa421d2){_0x287a54['count']=_0xa421d2;if(_0x49ba26[_0xc1ed('0x36')][_0xc1ed('0x43')]){_0x4b31a7['include']=[{'all':!![]}];}return db[_0xc1ed('0x31')][_0xc1ed('0x44')](_0x4b31a7);})[_0xc1ed('0x28')](function(_0x3f0fb8){_0x287a54['rows']=_0x3f0fb8;return _0x287a54;})['then'](respondWithFilteredResult(_0x3d99c4,_0x4b31a7))[_0xc1ed('0x45')](handleError(_0x3d99c4,null));};exports[_0xc1ed('0x46')]=function(_0x223d16,_0x3f1b3a){var _0x4f791b={'raw':![],'where':{'id':_0x223d16[_0xc1ed('0x47')]['id']}},_0x31f08c={};_0x31f08c[_0xc1ed('0x3a')]=_['keys'](db[_0xc1ed('0x31')][_0xc1ed('0x32')]);_0x31f08c['query']=_[_0xc1ed('0x35')](_0x223d16[_0xc1ed('0x36')]);_0x31f08c[_0xc1ed('0x37')]=_['intersection'](_0x31f08c[_0xc1ed('0x3a')],_0x31f08c[_0xc1ed('0x36')]);_0x4f791b['attributes']=_[_0xc1ed('0x38')](_0x31f08c[_0xc1ed('0x3a')],qs['fields'](_0x223d16[_0xc1ed('0x36')][_0xc1ed('0x3b')]));_0x4f791b[_0xc1ed('0x39')]=_0x4f791b['attributes'][_0xc1ed('0x48')]?_0x4f791b[_0xc1ed('0x39')]:_0x31f08c[_0xc1ed('0x3a')];if(_0x223d16[_0xc1ed('0x36')][_0xc1ed('0x43')]){_0x4f791b[_0xc1ed('0x49')]=[{'all':!![]}];}_0x4f791b=_[_0xc1ed('0x42')]({},_0x4f791b,_0x223d16[_0xc1ed('0x4a')]);return db[_0xc1ed('0x31')][_0xc1ed('0x4b')](_0x4f791b)[_0xc1ed('0x28')](handleEntityNotFound(_0x3f1b3a,null))['then'](respondWithResult(_0x3f1b3a,null))[_0xc1ed('0x45')](handleError(_0x3f1b3a,null));};exports[_0xc1ed('0x4c')]=function(_0x5b5743,_0x5dc1f7){return db[_0xc1ed('0x31')][_0xc1ed('0x4c')](_0x5b5743['body'],{})[_0xc1ed('0x28')](function(_0x55ccda){var _0x4c4e4d=_0x5b5743[_0xc1ed('0x4d')][_0xc1ed('0x2a')]({'plain':!![]});if(!_0x4c4e4d)throw new Error(_0xc1ed('0x4e'));if(_0x4c4e4d[_0xc1ed('0x4f')]==='user'){var _0x5d96b3=_0x55ccda[_0xc1ed('0x2a')]({'plain':!![]});var _0x2846e5=_0xc1ed('0x2b');return db[_0xc1ed('0x50')][_0xc1ed('0x4b')]({'where':{'name':_0x2846e5,'userProfileId':_0x4c4e4d['userProfileId']},'raw':!![]})[_0xc1ed('0x28')](function(_0x29ae3c){if(_0x29ae3c&&_0x29ae3c[_0xc1ed('0x51')]===0x0){return db[_0xc1ed('0x2c')][_0xc1ed('0x4c')]({'name':_0x5d96b3[_0xc1ed('0x2e')],'resourceId':_0x5d96b3['id'],'type':_0x29ae3c[_0xc1ed('0x2e')],'sectionId':_0x29ae3c['id']},{})[_0xc1ed('0x28')](function(){return _0x55ccda;});}else{return _0x55ccda;}})[_0xc1ed('0x45')](function(_0x1fb11d){logger[_0xc1ed('0x2d')](_0xc1ed('0x52'),_0x1fb11d);throw _0x1fb11d;});}return _0x55ccda;})['then'](respondWithResult(_0x5dc1f7,0xc9))[_0xc1ed('0x45')](handleError(_0x5dc1f7,null));};exports['clone']=function(_0x59ced5,_0x13194e){var _0x3c6d26={'where':{'id':_0x59ced5[_0xc1ed('0x47')]['id']}},_0x4d4061={};_0x4d4061['model']=_[_0xc1ed('0x35')](db[_0xc1ed('0x31')][_0xc1ed('0x32')]);_0x3c6d26[_0xc1ed('0x39')]=_['intersection'](_0x4d4061[_0xc1ed('0x3a')],qs[_0xc1ed('0x3b')](_0x59ced5['query']['fields']));_0x3c6d26['attributes']=_0x3c6d26[_0xc1ed('0x39')][_0xc1ed('0x48')]?_0x3c6d26[_0xc1ed('0x39')]:_0x4d4061[_0xc1ed('0x3a')];if(_0x59ced5['query'][_0xc1ed('0x43')]){_0x3c6d26[_0xc1ed('0x49')]=[{'all':!![]}];}_0x3c6d26=_[_0xc1ed('0x42')]({},_0x3c6d26,_0x59ced5[_0xc1ed('0x4a')]);return db[_0xc1ed('0x31')][_0xc1ed('0x4b')](_0x3c6d26)[_0xc1ed('0x28')](handleEntityNotFound(_0x13194e,null))[_0xc1ed('0x28')](function(_0x14520c){if(_0x14520c){var _0x33c886=_0x14520c['get']({'plain':!![]});_0x33c886=qs[_0xc1ed('0x53')](_0x33c886,['id',_0xc1ed('0x54'),_0xc1ed('0x55')]);_0x59ced5[_0xc1ed('0x56')]=_[_0xc1ed('0x53')](_0x59ced5[_0xc1ed('0x56')],['id','createdAt','updatedAt']);return db[_0xc1ed('0x31')][_0xc1ed('0x4c')](_[_0xc1ed('0x42')](_0x33c886,_0x59ced5[_0xc1ed('0x56')]),{'include':_0x59ced5['query'][_0xc1ed('0x43')]?[{'all':!![]}]:undefined})[_0xc1ed('0x28')](function(_0xb1982b){var _0x4adc95=_0x59ced5[_0xc1ed('0x4d')][_0xc1ed('0x2a')]({'plain':!![]});if(!_0x4adc95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4adc95[_0xc1ed('0x4f')]===_0xc1ed('0x4d')){var _0x209c78=_0xb1982b[_0xc1ed('0x2a')]({'plain':!![]});var _0x564c16=_0xc1ed('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x564c16,'userProfileId':_0x4adc95['userProfileId']},'raw':!![]})[_0xc1ed('0x28')](function(_0x143698){if(_0x143698&&_0x143698[_0xc1ed('0x51')]===0x0){return db[_0xc1ed('0x2c')][_0xc1ed('0x4c')]({'name':_0x209c78[_0xc1ed('0x2e')],'resourceId':_0x209c78['id'],'type':_0x143698[_0xc1ed('0x2e')],'sectionId':_0x143698['id']},{})[_0xc1ed('0x28')](function(){return _0xb1982b;});}else{return _0xb1982b;}})[_0xc1ed('0x45')](function(_0x15da19){logger[_0xc1ed('0x2d')](_0xc1ed('0x52'),_0x15da19);throw _0x15da19;});}return _0xb1982b;});}})[_0xc1ed('0x28')](respondWithResult(_0x13194e,0xc9))[_0xc1ed('0x45')](handleError(_0x13194e,null));};exports[_0xc1ed('0x27')]=function(_0x1e7390,_0x4e4d8e){if(_0x1e7390['body']['id']){delete _0x1e7390[_0xc1ed('0x56')]['id'];}return db[_0xc1ed('0x31')]['find']({'where':{'id':_0x1e7390[_0xc1ed('0x47')]['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x4e4d8e,null))[_0xc1ed('0x28')](saveUpdates(_0x1e7390[_0xc1ed('0x56')],null))[_0xc1ed('0x28')](respondWithResult(_0x4e4d8e,null))[_0xc1ed('0x45')](handleError(_0x4e4d8e,null));};exports[_0xc1ed('0x29')]=function(_0x4bda89,_0x29f639){return db[_0xc1ed('0x31')][_0xc1ed('0x4b')]({'where':{'id':_0x4bda89['params']['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x29f639,null))[_0xc1ed('0x28')](removeEntity(_0x29f639,null))[_0xc1ed('0x45')](handleError(_0x29f639,null));};exports[_0xc1ed('0x57')]=function(_0x4b3d3d,_0x40c31c,_0x431c27){var _0x518c1c={'raw':!![],'where':{}};var _0x8cb2b8={};var _0x5341cc={'count':0x0,'rows':[]};return db[_0xc1ed('0x31')][_0xc1ed('0x58')]({'where':{'id':_0x4b3d3d[_0xc1ed('0x47')]['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x40c31c,null))['then'](function(_0x4e6cf4){if(_0x4e6cf4){_0x8cb2b8[_0xc1ed('0x3a')]=_[_0xc1ed('0x35')](db[_0xc1ed('0x59')][_0xc1ed('0x32')]);_0x8cb2b8[_0xc1ed('0x36')]=_['keys'](_0x4b3d3d[_0xc1ed('0x36')]);_0x8cb2b8[_0xc1ed('0x37')]=_[_0xc1ed('0x38')](_0x8cb2b8[_0xc1ed('0x3a')],_0x8cb2b8[_0xc1ed('0x36')]);_0x518c1c['attributes']=_[_0xc1ed('0x38')](_0x8cb2b8[_0xc1ed('0x3a')],qs['fields'](_0x4b3d3d[_0xc1ed('0x36')][_0xc1ed('0x3b')]));_0x518c1c['attributes']=_0x518c1c[_0xc1ed('0x39')][_0xc1ed('0x48')]?_0x518c1c[_0xc1ed('0x39')]:_0x8cb2b8[_0xc1ed('0x3a')];if(!_0x4b3d3d['query'][_0xc1ed('0x3c')]('nolimit')){_0x518c1c['limit']=qs['limit'](_0x4b3d3d[_0xc1ed('0x36')][_0xc1ed('0x20')]);_0x518c1c[_0xc1ed('0x22')]=qs['offset'](_0x4b3d3d[_0xc1ed('0x36')][_0xc1ed('0x22')]);}_0x518c1c[_0xc1ed('0x5a')]=qs[_0xc1ed('0x3e')](_0x4b3d3d[_0xc1ed('0x36')][_0xc1ed('0x3e')]);_0x518c1c[_0xc1ed('0x3f')]=qs['filters'](_[_0xc1ed('0x40')](_0x4b3d3d[_0xc1ed('0x36')],_0x8cb2b8[_0xc1ed('0x37')]));_0x518c1c[_0xc1ed('0x3f')][_0xc1ed('0x5b')]=_0x4e6cf4['id'];if(_0x4b3d3d[_0xc1ed('0x36')][_0xc1ed('0x41')]){_0x518c1c['where']=_[_0xc1ed('0x42')](_0x518c1c['where'],{'$or':_['map'](_0x518c1c['attributes'],function(_0xec7b84){var _0x385f2c={};_0x385f2c[_0xec7b84]={'$like':'%'+_0x4b3d3d[_0xc1ed('0x36')]['filter']+'%'};return _0x385f2c;})});}_0x518c1c=_[_0xc1ed('0x42')]({},_0x518c1c,_0x4b3d3d[_0xc1ed('0x4a')]);return db[_0xc1ed('0x59')][_0xc1ed('0x21')]({'where':_0x518c1c[_0xc1ed('0x3f')]})['then'](function(_0x3de7b8){_0x5341cc[_0xc1ed('0x21')]=_0x3de7b8;if(_0x4b3d3d['query']['includeAll']){_0x518c1c[_0xc1ed('0x49')]=[{'all':!![]}];}return db[_0xc1ed('0x59')]['findAll'](_0x518c1c);})[_0xc1ed('0x28')](function(_0x21ca68){_0x5341cc[_0xc1ed('0x5c')]=_0x21ca68;return _0x5341cc;});}})[_0xc1ed('0x28')](respondWithFilteredResult(_0x40c31c,_0x518c1c))['catch'](handleError(_0x40c31c,null));};exports[_0xc1ed('0x5d')]=function(_0x536af1,_0xdc1b33,_0x4b8faa){var _0x200a06={'raw':!![],'where':{}};var _0x4a204f={};var _0x1e10c3={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x536af1['params']['id']}})['then'](handleEntityNotFound(_0xdc1b33,null))[_0xc1ed('0x28')](function(_0x4e9bd2){if(_0x4e9bd2){_0x4a204f['model']=_['keys'](db[_0xc1ed('0x5e')][_0xc1ed('0x32')]);_0x4a204f[_0xc1ed('0x36')]=_[_0xc1ed('0x35')](_0x536af1[_0xc1ed('0x36')]);_0x4a204f['filters']=_[_0xc1ed('0x38')](_0x4a204f['model'],_0x4a204f[_0xc1ed('0x36')]);_0x200a06[_0xc1ed('0x39')]=_[_0xc1ed('0x38')](_0x4a204f[_0xc1ed('0x3a')],qs[_0xc1ed('0x3b')](_0x536af1[_0xc1ed('0x36')][_0xc1ed('0x3b')]));_0x200a06[_0xc1ed('0x39')]=_0x200a06[_0xc1ed('0x39')]['length']?_0x200a06[_0xc1ed('0x39')]:_0x4a204f[_0xc1ed('0x3a')];if(!_0x536af1[_0xc1ed('0x36')][_0xc1ed('0x3c')]('nolimit')){_0x200a06['limit']=qs[_0xc1ed('0x20')](_0x536af1[_0xc1ed('0x36')][_0xc1ed('0x20')]);_0x200a06[_0xc1ed('0x22')]=qs[_0xc1ed('0x22')](_0x536af1[_0xc1ed('0x36')]['offset']);}_0x200a06[_0xc1ed('0x5a')]=qs[_0xc1ed('0x3e')](_0x536af1[_0xc1ed('0x36')][_0xc1ed('0x3e')]);_0x200a06[_0xc1ed('0x3f')]=qs['filters'](_[_0xc1ed('0x40')](_0x536af1[_0xc1ed('0x36')],_0x4a204f[_0xc1ed('0x37')]));_0x200a06[_0xc1ed('0x3f')][_0xc1ed('0x5b')]=_0x4e9bd2['id'];if(_0x536af1['query'][_0xc1ed('0x41')]){_0x200a06[_0xc1ed('0x3f')]=_[_0xc1ed('0x42')](_0x200a06[_0xc1ed('0x3f')],{'$or':_[_0xc1ed('0x30')](_0x200a06[_0xc1ed('0x39')],function(_0x24fab3){var _0x229ea7={};_0x229ea7[_0x24fab3]={'$like':'%'+_0x536af1[_0xc1ed('0x36')][_0xc1ed('0x41')]+'%'};return _0x229ea7;})});}_0x200a06=_[_0xc1ed('0x42')]({},_0x200a06,_0x536af1[_0xc1ed('0x4a')]);return db['CmHopperHistory']['count']({'where':_0x200a06[_0xc1ed('0x3f')]})['then'](function(_0x52d3fe){_0x1e10c3[_0xc1ed('0x21')]=_0x52d3fe;if(_0x536af1[_0xc1ed('0x36')]['includeAll']){_0x200a06[_0xc1ed('0x49')]=[{'all':!![]}];}return db[_0xc1ed('0x5e')][_0xc1ed('0x44')](_0x200a06);})[_0xc1ed('0x28')](function(_0x253c6b){_0x1e10c3[_0xc1ed('0x5c')]=_0x253c6b;return _0x1e10c3;});}})[_0xc1ed('0x28')](respondWithFilteredResult(_0xdc1b33,_0x200a06))[_0xc1ed('0x45')](handleError(_0xdc1b33,null));};exports['getHopperFinals']=function(_0x596172,_0x1752e1,_0x35a163){var _0x43df21={'raw':!![],'where':{}};var _0x3c86fc={};var _0x175ca1={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x596172[_0xc1ed('0x47')]['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x1752e1,null))[_0xc1ed('0x28')](function(_0x41c938){if(_0x41c938){_0x3c86fc[_0xc1ed('0x3a')]=_[_0xc1ed('0x35')](db[_0xc1ed('0x5f')][_0xc1ed('0x32')]);_0x3c86fc[_0xc1ed('0x36')]=_[_0xc1ed('0x35')](_0x596172[_0xc1ed('0x36')]);_0x3c86fc[_0xc1ed('0x37')]=_['intersection'](_0x3c86fc['model'],_0x3c86fc['query']);_0x43df21[_0xc1ed('0x39')]=_[_0xc1ed('0x38')](_0x3c86fc[_0xc1ed('0x3a')],qs['fields'](_0x596172['query'][_0xc1ed('0x3b')]));_0x43df21[_0xc1ed('0x39')]=_0x43df21['attributes']['length']?_0x43df21[_0xc1ed('0x39')]:_0x3c86fc['model'];if(!_0x596172[_0xc1ed('0x36')][_0xc1ed('0x3c')]('nolimit')){_0x43df21['limit']=qs[_0xc1ed('0x20')](_0x596172[_0xc1ed('0x36')][_0xc1ed('0x20')]);_0x43df21[_0xc1ed('0x22')]=qs[_0xc1ed('0x22')](_0x596172[_0xc1ed('0x36')][_0xc1ed('0x22')]);}_0x43df21['order']=qs[_0xc1ed('0x3e')](_0x596172[_0xc1ed('0x36')][_0xc1ed('0x3e')]);_0x43df21[_0xc1ed('0x3f')]=qs[_0xc1ed('0x37')](_[_0xc1ed('0x40')](_0x596172['query'],_0x3c86fc['filters']));_0x43df21[_0xc1ed('0x3f')][_0xc1ed('0x5b')]=_0x41c938['id'];if(_0x596172[_0xc1ed('0x36')][_0xc1ed('0x41')]){_0x43df21[_0xc1ed('0x3f')]=_['merge'](_0x43df21[_0xc1ed('0x3f')],{'$or':_[_0xc1ed('0x30')](_0x43df21['attributes'],function(_0x2209fd){var _0x53e278={};_0x53e278[_0x2209fd]={'$like':'%'+_0x596172[_0xc1ed('0x36')]['filter']+'%'};return _0x53e278;})});}_0x43df21=_[_0xc1ed('0x42')]({},_0x43df21,_0x596172['options']);return db[_0xc1ed('0x5f')][_0xc1ed('0x21')]({'where':_0x43df21[_0xc1ed('0x3f')]})[_0xc1ed('0x28')](function(_0x375151){_0x175ca1[_0xc1ed('0x21')]=_0x375151;if(_0x596172[_0xc1ed('0x36')][_0xc1ed('0x43')]){_0x43df21['include']=[{'all':!![]}];}return db[_0xc1ed('0x5f')][_0xc1ed('0x44')](_0x43df21);})[_0xc1ed('0x28')](function(_0x208da0){_0x175ca1[_0xc1ed('0x5c')]=_0x208da0;return _0x175ca1;});}})['then'](respondWithFilteredResult(_0x1752e1,_0x43df21))['catch'](handleError(_0x1752e1,null));};exports[_0xc1ed('0x60')]=function(_0x59f58b,_0x298f11,_0x342f94){var _0x2e2cd2={'raw':!![],'where':{}};var _0x27f371={};var _0x97a12b={'count':0x0,'rows':[]};return db[_0xc1ed('0x31')][_0xc1ed('0x58')]({'where':{'id':_0x59f58b[_0xc1ed('0x47')]['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x298f11,null))['then'](function(_0x2dd821){if(_0x2dd821){_0x27f371[_0xc1ed('0x3a')]=_[_0xc1ed('0x35')](db[_0xc1ed('0x61')][_0xc1ed('0x32')]);_0x27f371['query']=_[_0xc1ed('0x35')](_0x59f58b[_0xc1ed('0x36')]);_0x27f371[_0xc1ed('0x37')]=_['intersection'](_0x27f371[_0xc1ed('0x3a')],_0x27f371[_0xc1ed('0x36')]);_0x2e2cd2[_0xc1ed('0x39')]=_['intersection'](_0x27f371[_0xc1ed('0x3a')],qs[_0xc1ed('0x3b')](_0x59f58b['query'][_0xc1ed('0x3b')]));_0x2e2cd2[_0xc1ed('0x39')]=_0x2e2cd2[_0xc1ed('0x39')][_0xc1ed('0x48')]?_0x2e2cd2[_0xc1ed('0x39')]:_0x27f371[_0xc1ed('0x3a')];if(!_0x59f58b['query'][_0xc1ed('0x3c')](_0xc1ed('0x3d'))){_0x2e2cd2[_0xc1ed('0x20')]=qs[_0xc1ed('0x20')](_0x59f58b[_0xc1ed('0x36')][_0xc1ed('0x20')]);_0x2e2cd2[_0xc1ed('0x22')]=qs[_0xc1ed('0x22')](_0x59f58b[_0xc1ed('0x36')][_0xc1ed('0x22')]);}_0x2e2cd2[_0xc1ed('0x5a')]=qs['sort'](_0x59f58b[_0xc1ed('0x36')][_0xc1ed('0x3e')]);_0x2e2cd2[_0xc1ed('0x3f')]=qs[_0xc1ed('0x37')](_[_0xc1ed('0x40')](_0x59f58b[_0xc1ed('0x36')],_0x27f371[_0xc1ed('0x37')]));_0x2e2cd2[_0xc1ed('0x3f')]['CampaignId']=_0x2dd821['id'];if(_0x59f58b[_0xc1ed('0x36')][_0xc1ed('0x41')]){_0x2e2cd2[_0xc1ed('0x3f')]=_[_0xc1ed('0x42')](_0x2e2cd2[_0xc1ed('0x3f')],{'$or':_[_0xc1ed('0x30')](_0x2e2cd2['attributes'],function(_0x53894b){var _0x1df74b={};_0x1df74b[_0x53894b]={'$like':'%'+_0x59f58b[_0xc1ed('0x36')][_0xc1ed('0x41')]+'%'};return _0x1df74b;})});}_0x2e2cd2=_[_0xc1ed('0x42')]({},_0x2e2cd2,_0x59f58b[_0xc1ed('0x4a')]);return db['CmHopperBlack'][_0xc1ed('0x21')]({'where':_0x2e2cd2[_0xc1ed('0x3f')]})['then'](function(_0x3d6535){_0x97a12b[_0xc1ed('0x21')]=_0x3d6535;if(_0x59f58b[_0xc1ed('0x36')][_0xc1ed('0x43')]){_0x2e2cd2['include']=[{'all':!![]}];}return db[_0xc1ed('0x61')]['findAll'](_0x2e2cd2);})[_0xc1ed('0x28')](function(_0x2f6021){_0x97a12b['rows']=_0x2f6021;return _0x97a12b;});}})[_0xc1ed('0x28')](respondWithFilteredResult(_0x298f11,_0x2e2cd2))[_0xc1ed('0x45')](handleError(_0x298f11,null));};exports[_0xc1ed('0x62')]=function(_0x1cece0,_0x13935e,_0x3e2aef){var _0x6fa108={};var _0x3fe337={};var _0xe1a21b;var _0x2eeb73;return db[_0xc1ed('0x31')]['findOne']({'where':{'id':_0x1cece0['params']['id']}})['then'](handleEntityNotFound(_0x13935e,null))[_0xc1ed('0x28')](function(_0x42d972){if(_0x42d972){_0xe1a21b=_0x42d972;_0x3fe337[_0xc1ed('0x3a')]=_['keys'](db[_0xc1ed('0x63')][_0xc1ed('0x32')]);_0x3fe337[_0xc1ed('0x36')]=_[_0xc1ed('0x35')](_0x1cece0[_0xc1ed('0x36')]);_0x3fe337[_0xc1ed('0x37')]=_[_0xc1ed('0x38')](_0x3fe337['model'],_0x3fe337['query']);_0x6fa108[_0xc1ed('0x39')]=_[_0xc1ed('0x38')](_0x3fe337['model'],qs[_0xc1ed('0x3b')](_0x1cece0[_0xc1ed('0x36')]['fields']));_0x6fa108[_0xc1ed('0x39')]=_0x6fa108['attributes']['length']?_0x6fa108[_0xc1ed('0x39')]:_0x3fe337[_0xc1ed('0x3a')];_0x6fa108['order']=qs[_0xc1ed('0x3e')](_0x1cece0['query'][_0xc1ed('0x3e')]);_0x6fa108[_0xc1ed('0x3f')]=qs[_0xc1ed('0x37')](_[_0xc1ed('0x40')](_0x1cece0['query'],_0x3fe337[_0xc1ed('0x37')]));if(_0x1cece0['query']['filter']){_0x6fa108[_0xc1ed('0x3f')]=_[_0xc1ed('0x42')](_0x6fa108[_0xc1ed('0x3f')],{'$or':_['map'](_0x6fa108['attributes'],function(_0x42475e){var _0x32d318={};_0x32d318[_0x42475e]={'$like':'%'+_0x1cece0[_0xc1ed('0x36')][_0xc1ed('0x41')]+'%'};return _0x32d318;})});}_0x6fa108=_['merge']({},_0x6fa108,_0x1cece0['options']);return _0xe1a21b[_0xc1ed('0x62')](_0x6fa108);}})[_0xc1ed('0x28')](function(_0xb7937a){if(_0xb7937a){_0x2eeb73=_0xb7937a[_0xc1ed('0x48')];if(!_0x1cece0[_0xc1ed('0x36')][_0xc1ed('0x3c')](_0xc1ed('0x3d'))){_0x6fa108[_0xc1ed('0x20')]=qs[_0xc1ed('0x20')](_0x1cece0['query'][_0xc1ed('0x20')]);_0x6fa108[_0xc1ed('0x22')]=qs['offset'](_0x1cece0[_0xc1ed('0x36')][_0xc1ed('0x22')]);}return _0xe1a21b['getLists'](_0x6fa108);}})['then'](function(_0x271ac6){if(_0x271ac6){return _0x271ac6?{'count':_0x2eeb73,'rows':_0x271ac6}:null;}})[_0xc1ed('0x28')](respondWithResult(_0x13935e,null))[_0xc1ed('0x45')](handleError(_0x13935e,null));};exports['addLists']=function(_0x366df9,_0x1b8fde,_0x3f371){var _0x3539fa,_0x487fb9;return db[_0xc1ed('0x31')][_0xc1ed('0x4b')]({'where':{'id':_0x366df9['params']['id']}})['then'](handleEntityNotFound(_0x1b8fde,null))[_0xc1ed('0x28')](function(_0x319f0b){if(_0x319f0b){_0x487fb9=_0x319f0b;return _0x319f0b[_0xc1ed('0x64')](_0x366df9['body'][_0xc1ed('0x65')],_[_0xc1ed('0x53')](_0x366df9[_0xc1ed('0x56')],[_0xc1ed('0x65'),'id'])||{});}return null;})[_0xc1ed('0x66')](function(_0x38a3e4){var _0x1c5c06;_0x3539fa=_0x38a3e4||[];var _0x1d7b69=[];if(_0x38a3e4){for(var _0x2dc77a=0x0;_0x2dc77a<_0x38a3e4[_0xc1ed('0x48')];_0x2dc77a+=0x1){var _0x295607=_0x38a3e4[_0x2dc77a]['get']({'plain':!![]});_0x487fb9[_0xc1ed('0x67')]=_0x366df9[_0xc1ed('0x56')]['dialCheckDuplicateType']?_0x366df9[_0xc1ed('0x56')][_0xc1ed('0x67')]:_0x487fb9[_0xc1ed('0x67')];switch(_0x487fb9['dialCheckDuplicateType']){case _0xc1ed('0x68'):_0x1c5c06=squel[_0xc1ed('0x69')]()['into']('cm_hopper')[_0xc1ed('0x6a')]([_0xc1ed('0x6b'),_0xc1ed('0x6c'),_0xc1ed('0x6d'),_0xc1ed('0x6e'),_0xc1ed('0x5b'),_0xc1ed('0x54'),_0xc1ed('0x55')],squel[_0xc1ed('0x6f')]()[_0xc1ed('0x70')](_0xc1ed('0x6b'),'phone')[_0xc1ed('0x70')]('NOW()',_0xc1ed('0x6c'))['field']('id',_0xc1ed('0x6d'))['field'](_0x295607[_0xc1ed('0x71')][_0xc1ed('0x72')](),_0xc1ed('0x6e'))[_0xc1ed('0x70')](_0x366df9[_0xc1ed('0x47')]['id']['toString'](),_0xc1ed('0x5b'))['field'](_0xc1ed('0x73'),_0xc1ed('0x54'))[_0xc1ed('0x70')](_0xc1ed('0x73'),'updatedAt')[_0xc1ed('0x74')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xc1ed('0x3f')](_0xc1ed('0x75'),_0x295607['CmListId'][_0xc1ed('0x72')]())['where'](_0xc1ed('0x76'))['where'](_0xc1ed('0x77'),squel[_0xc1ed('0x6f')]()[_0xc1ed('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0xc1ed('0x74')]('cm_hopper_final')[_0xc1ed('0x3f')](_0xc1ed('0x78'),_0x366df9[_0xc1ed('0x47')]['id']['toString']()))[_0xc1ed('0x3f')](_0xc1ed('0x77'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0xc1ed('0x74')](_0xc1ed('0x79'))[_0xc1ed('0x3f')](_0xc1ed('0x78'),_0x366df9['params']['id'][_0xc1ed('0x72')]())))[_0xc1ed('0x72')]();break;case'onlyIfOpen':_0x1c5c06=squel[_0xc1ed('0x69')]()[_0xc1ed('0x7a')](_0xc1ed('0x79'))[_0xc1ed('0x6a')]([_0xc1ed('0x6b'),_0xc1ed('0x6c'),_0xc1ed('0x6d'),_0xc1ed('0x6e'),_0xc1ed('0x5b'),_0xc1ed('0x54'),_0xc1ed('0x55')],squel[_0xc1ed('0x6f')]()[_0xc1ed('0x70')](_0xc1ed('0x6b'),_0xc1ed('0x6b'))[_0xc1ed('0x70')]('NOW()',_0xc1ed('0x6c'))[_0xc1ed('0x70')]('id',_0xc1ed('0x6d'))[_0xc1ed('0x70')](_0x295607['CmListId'][_0xc1ed('0x72')](),'ListId')['field'](_0x366df9[_0xc1ed('0x47')]['id'][_0xc1ed('0x72')](),_0xc1ed('0x5b'))[_0xc1ed('0x70')](_0xc1ed('0x73'),_0xc1ed('0x54'))['field'](_0xc1ed('0x73'),_0xc1ed('0x55'))['from'](_0xc1ed('0x7b'))[_0xc1ed('0x3f')]('deletedAt\x20IS\x20NULL')[_0xc1ed('0x3f')](_0xc1ed('0x75'),_0x295607[_0xc1ed('0x71')][_0xc1ed('0x72')]())[_0xc1ed('0x3f')](_0xc1ed('0x76'))[_0xc1ed('0x3f')](_0xc1ed('0x77'),squel['select']()['field'](_0xc1ed('0x7c'))['from'](_0xc1ed('0x79'))[_0xc1ed('0x3f')](_0xc1ed('0x78'),_0x366df9[_0xc1ed('0x47')]['id'][_0xc1ed('0x72')]())))[_0xc1ed('0x72')]();break;default:_0x1c5c06=squel[_0xc1ed('0x69')]()['into'](_0xc1ed('0x79'))[_0xc1ed('0x6a')](['phone','scheduledAt',_0xc1ed('0x6d'),_0xc1ed('0x6e'),_0xc1ed('0x5b'),_0xc1ed('0x54'),_0xc1ed('0x55')],squel['select']()['field'](_0xc1ed('0x6b'),_0xc1ed('0x6b'))[_0xc1ed('0x70')](_0xc1ed('0x73'),_0xc1ed('0x6c'))['field']('id',_0xc1ed('0x6d'))[_0xc1ed('0x70')](_0x295607['CmListId'][_0xc1ed('0x72')](),_0xc1ed('0x6e'))[_0xc1ed('0x70')](_0x366df9[_0xc1ed('0x47')]['id']['toString'](),_0xc1ed('0x5b'))[_0xc1ed('0x70')](_0xc1ed('0x73'),_0xc1ed('0x54'))[_0xc1ed('0x70')](_0xc1ed('0x73'),_0xc1ed('0x55'))[_0xc1ed('0x74')](_0xc1ed('0x7b'))[_0xc1ed('0x3f')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x295607[_0xc1ed('0x71')]['toString']())[_0xc1ed('0x3f')](_0xc1ed('0x76')))['toString']();}_0x1d7b69['push'](db['sequelize'][_0xc1ed('0x36')](_0x1c5c06));}return BPromise[_0xc1ed('0x7d')](_0x1d7b69);}})[_0xc1ed('0x28')](function(){return _0x3539fa;})[_0xc1ed('0x28')](respondWithResult(_0x1b8fde,null))['catch'](handleError(_0x1b8fde,null));};exports[_0xc1ed('0x7e')]=function(_0x43e802,_0x531eee,_0x11641a){return db['Campaign'][_0xc1ed('0x4b')]({'where':{'id':_0x43e802[_0xc1ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x531eee,null))[_0xc1ed('0x28')](function(_0x27684e){if(_0x27684e){return _0x27684e[_0xc1ed('0x7e')](_0x43e802[_0xc1ed('0x36')][_0xc1ed('0x65')]);}})[_0xc1ed('0x28')](function(_0x461cf5){if(_0x461cf5){return db['CmHopper'][_0xc1ed('0x29')]({'where':{'ListId':_0x43e802[_0xc1ed('0x36')][_0xc1ed('0x65')],'CampaignId':_0x43e802[_0xc1ed('0x47')]['id']}})[_0xc1ed('0x28')](function(){return _0x461cf5;});}})[_0xc1ed('0x28')](respondWithStatusCode(_0x531eee,null))[_0xc1ed('0x45')](handleError(_0x531eee,null));};exports[_0xc1ed('0x7f')]=function(_0x3f0efc,_0x4b2200,_0x58fef4){var _0x171ef0={};var _0x121dc5={};var _0x2dabe9;var _0x39b8be;return db['Campaign'][_0xc1ed('0x58')]({'where':{'id':_0x3f0efc['params']['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x4b2200,null))[_0xc1ed('0x28')](function(_0x1b48a5){if(_0x1b48a5){_0x2dabe9=_0x1b48a5;_0x121dc5['model']=_[_0xc1ed('0x35')](db['CmList'][_0xc1ed('0x32')]);_0x121dc5[_0xc1ed('0x36')]=_['keys'](_0x3f0efc['query']);_0x121dc5[_0xc1ed('0x37')]=_[_0xc1ed('0x38')](_0x121dc5['model'],_0x121dc5['query']);_0x171ef0[_0xc1ed('0x39')]=_[_0xc1ed('0x38')](_0x121dc5[_0xc1ed('0x3a')],qs[_0xc1ed('0x3b')](_0x3f0efc[_0xc1ed('0x36')][_0xc1ed('0x3b')]));_0x171ef0[_0xc1ed('0x39')]=_0x171ef0[_0xc1ed('0x39')][_0xc1ed('0x48')]?_0x171ef0[_0xc1ed('0x39')]:_0x121dc5['model'];_0x171ef0['order']=qs[_0xc1ed('0x3e')](_0x3f0efc[_0xc1ed('0x36')]['sort']);_0x171ef0[_0xc1ed('0x3f')]=qs[_0xc1ed('0x37')](_[_0xc1ed('0x40')](_0x3f0efc[_0xc1ed('0x36')],_0x121dc5[_0xc1ed('0x37')]));if(_0x3f0efc[_0xc1ed('0x36')]['filter']){_0x171ef0[_0xc1ed('0x3f')]=_[_0xc1ed('0x42')](_0x171ef0[_0xc1ed('0x3f')],{'$or':_['map'](_0x171ef0['attributes'],function(_0x240b28){var _0x1cb505={};_0x1cb505[_0x240b28]={'$like':'%'+_0x3f0efc[_0xc1ed('0x36')][_0xc1ed('0x41')]+'%'};return _0x1cb505;})});}_0x171ef0=_[_0xc1ed('0x42')]({},_0x171ef0,_0x3f0efc[_0xc1ed('0x4a')]);return _0x2dabe9[_0xc1ed('0x7f')](_0x171ef0);}})[_0xc1ed('0x28')](function(_0x196e9e){if(_0x196e9e){_0x39b8be=_0x196e9e[_0xc1ed('0x48')];if(!_0x3f0efc['query'][_0xc1ed('0x3c')](_0xc1ed('0x3d'))){_0x171ef0[_0xc1ed('0x20')]=qs[_0xc1ed('0x20')](_0x3f0efc[_0xc1ed('0x36')][_0xc1ed('0x20')]);_0x171ef0[_0xc1ed('0x22')]=qs['offset'](_0x3f0efc[_0xc1ed('0x36')]['offset']);}return _0x2dabe9[_0xc1ed('0x7f')](_0x171ef0);}})[_0xc1ed('0x28')](function(_0x1c5967){if(_0x1c5967){return _0x1c5967?{'count':_0x39b8be,'rows':_0x1c5967}:null;}})[_0xc1ed('0x28')](respondWithResult(_0x4b2200,null))['catch'](handleError(_0x4b2200,null));};exports['addBlackLists']=function(_0xe6a30d,_0x121e5b,_0x33a17b){var _0x254ffc,_0x4cf08c;return db[_0xc1ed('0x31')][_0xc1ed('0x4b')]({'where':{'id':_0xe6a30d[_0xc1ed('0x47')]['id']}})['then'](handleEntityNotFound(_0x121e5b,null))['then'](function(_0x3c2f1a){if(_0x3c2f1a){_0x4cf08c=_0x3c2f1a;return _0x3c2f1a[_0xc1ed('0x80')](_0xe6a30d[_0xc1ed('0x56')][_0xc1ed('0x65')],_[_0xc1ed('0x53')](_0xe6a30d[_0xc1ed('0x56')],[_0xc1ed('0x65'),'id'])||{});}return null;})['spread'](function(_0x420a80){var _0x5f34d6;_0x254ffc=_0x420a80||[];var _0x5162fc=[];if(_0x420a80){for(var _0x501e47=0x0;_0x501e47<_0x420a80[_0xc1ed('0x48')];_0x501e47+=0x1){var _0x23efe9=_0x420a80[_0x501e47][_0xc1ed('0x2a')]({'plain':!![]});_0x5f34d6=squel[_0xc1ed('0x69')]()[_0xc1ed('0x7a')]('cm_hopper_black')['fromQuery']([_0xc1ed('0x6b'),_0xc1ed('0x6d'),_0xc1ed('0x6e'),_0xc1ed('0x5b'),_0xc1ed('0x54'),_0xc1ed('0x55')],squel[_0xc1ed('0x6f')]()[_0xc1ed('0x70')](_0xc1ed('0x6b'),_0xc1ed('0x6b'))[_0xc1ed('0x70')]('id',_0xc1ed('0x6d'))[_0xc1ed('0x70')](_0x23efe9[_0xc1ed('0x71')][_0xc1ed('0x72')](),_0xc1ed('0x6e'))[_0xc1ed('0x70')](_0xe6a30d[_0xc1ed('0x47')]['id'][_0xc1ed('0x72')](),_0xc1ed('0x5b'))['field'](_0xc1ed('0x73'),_0xc1ed('0x54'))[_0xc1ed('0x70')](_0xc1ed('0x73'),_0xc1ed('0x55'))[_0xc1ed('0x74')]('cm_contacts')[_0xc1ed('0x3f')](_0xc1ed('0x81'))[_0xc1ed('0x3f')](_0xc1ed('0x75'),_0x23efe9[_0xc1ed('0x71')][_0xc1ed('0x72')]())[_0xc1ed('0x3f')](_0xc1ed('0x76')))[_0xc1ed('0x72')]();_0x5162fc[_0xc1ed('0x82')](db[_0xc1ed('0x83')][_0xc1ed('0x36')](_0x5f34d6));}return BPromise['all'](_0x5162fc);}})[_0xc1ed('0x28')](function(){return _0x254ffc;})[_0xc1ed('0x28')](respondWithResult(_0x121e5b,null))['catch'](handleError(_0x121e5b,null));};exports[_0xc1ed('0x84')]=function(_0x1ee431,_0x4d2e55,_0x14055a){return db[_0xc1ed('0x31')][_0xc1ed('0x4b')]({'where':{'id':_0x1ee431[_0xc1ed('0x47')]['id']}})[_0xc1ed('0x28')](handleEntityNotFound(_0x4d2e55,null))[_0xc1ed('0x28')](function(_0x47cd5d){if(_0x47cd5d){return _0x47cd5d['removeBlackLists'](_0x1ee431[_0xc1ed('0x36')][_0xc1ed('0x65')]);}})[_0xc1ed('0x28')](function(_0x2db743){if(_0x2db743){return db[_0xc1ed('0x61')][_0xc1ed('0x29')]({'where':{'ListId':_0x1ee431[_0xc1ed('0x36')][_0xc1ed('0x65')],'CampaignId':_0x1ee431['params']['id']}})['then'](function(){return _0x2db743;});}})['then'](respondWithStatusCode(_0x4d2e55,null))[_0xc1ed('0x45')](handleError(_0x4d2e55,null));};
\ No newline at end of file
index 57086f8..6ec8ea1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0x7a54,0x106));var _0x47a5=function(_0x144c05,_0x152f5a){_0x144c05=_0x144c05-0x0;var _0x1157c4=_0x7a54[_0x144c05];return _0x1157c4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e497c50..695e037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd04b=['request\x20sent','debug','stringify','error','message','result','GetCampaign','findAll','options','attributes','limit','include','map','model','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xd04b,0x145));var _0xbd04=function(_0x129a3b,_0x41e316){_0x129a3b=_0x129a3b-0x0;var _0x5d1641=_0xd04b[_0x129a3b];return _0x5d1641;};'use strict';var _=require(_0xbd04('0x0'));var util=require(_0xbd04('0x1'));var moment=require(_0xbd04('0x2'));var BPromise=require('bluebird');var rs=require(_0xbd04('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd04('0x4'))['db'];var utils=require(_0xbd04('0x5'));var logger=require(_0xbd04('0x6'))(_0xbd04('0x7'));var config=require(_0xbd04('0x8'));var jayson=require(_0xbd04('0x9'));var client=jayson[_0xbd04('0xa')][_0xbd04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaf5d,_0x3d949f,_0x421a71){return new BPromise(function(_0x5c3d7a,_0x67fdcd){return client[_0xbd04('0xc')](_0xaf5d,_0x421a71)[_0xbd04('0xd')](function(_0x24f7de){logger[_0xbd04('0xe')](_0xbd04('0xf'),_0x3d949f,_0xbd04('0x10'));logger[_0xbd04('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x3d949f,_0xbd04('0x10'),JSON[_0xbd04('0x12')](_0x24f7de));if(_0x24f7de[_0xbd04('0x13')]){if(_0x24f7de[_0xbd04('0x13')]['code']===0x1f4){logger[_0xbd04('0x13')](_0xbd04('0xf'),_0x3d949f,_0x24f7de[_0xbd04('0x13')]['message']);return _0x67fdcd(_0x24f7de['error']['message']);}logger['error'](_0xbd04('0xf'),_0x3d949f,_0x24f7de[_0xbd04('0x13')][_0xbd04('0x14')]);return _0x5c3d7a(_0x24f7de['error']['message']);}else{logger[_0xbd04('0xe')]('Campaign,\x20%s,\x20%s',_0x3d949f,_0xbd04('0x10'));_0x5c3d7a(_0x24f7de[_0xbd04('0x15')]['message']);}})['catch'](function(_0x4b001a){logger[_0xbd04('0x13')](_0xbd04('0xf'),_0x3d949f,_0x4b001a);_0x67fdcd(_0x4b001a);});});}exports[_0xbd04('0x16')]=function(_0x45e341){var _0x61161c=this;return new Promise(function(_0x6f0345,_0x48828f){return db['Campaign'][_0xbd04('0x17')]({'raw':_0x45e341[_0xbd04('0x18')]?_0x45e341['options']['raw']===undefined?!![]:![]:!![],'where':_0x45e341['options']?_0x45e341[_0xbd04('0x18')]['where']||null:null,'attributes':_0x45e341[_0xbd04('0x18')]?_0x45e341['options'][_0xbd04('0x19')]||null:null,'limit':_0x45e341[_0xbd04('0x18')]?_0x45e341['options'][_0xbd04('0x1a')]||null:null,'include':_0x45e341[_0xbd04('0x18')]?_0x45e341['options'][_0xbd04('0x1b')]?_[_0xbd04('0x1c')](_0x45e341[_0xbd04('0x18')][_0xbd04('0x1b')],function(_0x19d792){return{'model':db[_0x19d792['model']],'as':_0x19d792['as'],'attributes':_0x19d792[_0xbd04('0x19')],'include':_0x19d792[_0xbd04('0x1b')]?_[_0xbd04('0x1c')](_0x19d792[_0xbd04('0x1b')],function(_0x3d3e5b){return{'model':db[_0x3d3e5b['model']],'as':_0x3d3e5b['as'],'attributes':_0x3d3e5b[_0xbd04('0x19')],'include':_0x3d3e5b['include']?_[_0xbd04('0x1c')](_0x3d3e5b[_0xbd04('0x1b')],function(_0x45923c){return{'model':db[_0x45923c[_0xbd04('0x1d')]],'as':_0x45923c['as'],'attributes':_0x45923c[_0xbd04('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbd04('0xd')](function(_0x104036){logger[_0xbd04('0xe')](_0xbd04('0x16'),_0x45e341);logger[_0xbd04('0x11')]('GetCampaign',_0x45e341,JSON['stringify'](_0x104036));_0x6f0345(_0x104036);})[_0xbd04('0x1e')](function(_0x2230f9){logger[_0xbd04('0x13')](_0xbd04('0x16'),_0x2230f9[_0xbd04('0x14')],_0x45e341);_0x48828f(_0x61161c['error'](0x1f4,_0x2230f9[_0xbd04('0x14')]));});});};
\ No newline at end of file
+var _0xa854=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetCampaign','Campaign','findAll','raw','options','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x340bf4,_0x37dfb4){var _0x491343=function(_0x445a68){while(--_0x445a68){_0x340bf4['push'](_0x340bf4['shift']());}};_0x491343(++_0x37dfb4);}(_0xa854,0x103));var _0x4a85=function(_0x3e7bb3,_0x351063){_0x3e7bb3=_0x3e7bb3-0x0;var _0x5708d5=_0xa854[_0x3e7bb3];return _0x5708d5;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var moment=require(_0x4a85('0x2'));var BPromise=require(_0x4a85('0x3'));var rs=require(_0x4a85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a85('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a85('0x6'))('rpc');var config=require(_0x4a85('0x7'));var jayson=require(_0x4a85('0x8'));var client=jayson['client'][_0x4a85('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x142b27,_0x545fce,_0xb1605c){return new BPromise(function(_0x507c59,_0x2a3050){return client[_0x4a85('0xa')](_0x142b27,_0xb1605c)[_0x4a85('0xb')](function(_0x1cb2dc){logger[_0x4a85('0xc')](_0x4a85('0xd'),_0x545fce,_0x4a85('0xe'));logger[_0x4a85('0xf')](_0x4a85('0x10'),_0x545fce,'request\x20sent',JSON[_0x4a85('0x11')](_0x1cb2dc));if(_0x1cb2dc[_0x4a85('0x12')]){if(_0x1cb2dc[_0x4a85('0x12')][_0x4a85('0x13')]===0x1f4){logger[_0x4a85('0x12')](_0x4a85('0xd'),_0x545fce,_0x1cb2dc[_0x4a85('0x12')][_0x4a85('0x14')]);return _0x2a3050(_0x1cb2dc[_0x4a85('0x12')]['message']);}logger[_0x4a85('0x12')](_0x4a85('0xd'),_0x545fce,_0x1cb2dc[_0x4a85('0x12')][_0x4a85('0x14')]);return _0x507c59(_0x1cb2dc[_0x4a85('0x12')][_0x4a85('0x14')]);}else{logger[_0x4a85('0xc')](_0x4a85('0xd'),_0x545fce,_0x4a85('0xe'));_0x507c59(_0x1cb2dc[_0x4a85('0x15')][_0x4a85('0x14')]);}})['catch'](function(_0x28a7d3){logger[_0x4a85('0x12')]('Campaign,\x20%s,\x20%s',_0x545fce,_0x28a7d3);_0x2a3050(_0x28a7d3);});});}exports[_0x4a85('0x16')]=function(_0x159ed0){var _0x4435db=this;return new Promise(function(_0x50e210,_0x374f34){return db[_0x4a85('0x17')][_0x4a85('0x18')]({'raw':_0x159ed0['options']?_0x159ed0['options'][_0x4a85('0x19')]===undefined?!![]:![]:!![],'where':_0x159ed0[_0x4a85('0x1a')]?_0x159ed0[_0x4a85('0x1a')][_0x4a85('0x1b')]||null:null,'attributes':_0x159ed0[_0x4a85('0x1a')]?_0x159ed0[_0x4a85('0x1a')][_0x4a85('0x1c')]||null:null,'limit':_0x159ed0[_0x4a85('0x1a')]?_0x159ed0['options']['limit']||null:null,'include':_0x159ed0['options']?_0x159ed0[_0x4a85('0x1a')][_0x4a85('0x1d')]?_[_0x4a85('0x1e')](_0x159ed0[_0x4a85('0x1a')]['include'],function(_0x154bea){return{'model':db[_0x154bea[_0x4a85('0x1f')]],'as':_0x154bea['as'],'attributes':_0x154bea[_0x4a85('0x1c')],'include':_0x154bea[_0x4a85('0x1d')]?_[_0x4a85('0x1e')](_0x154bea['include'],function(_0x1075e2){return{'model':db[_0x1075e2[_0x4a85('0x1f')]],'as':_0x1075e2['as'],'attributes':_0x1075e2[_0x4a85('0x1c')],'include':_0x1075e2[_0x4a85('0x1d')]?_[_0x4a85('0x1e')](_0x1075e2[_0x4a85('0x1d')],function(_0x4a34d5){return{'model':db[_0x4a34d5[_0x4a85('0x1f')]],'as':_0x4a34d5['as'],'attributes':_0x4a34d5[_0x4a85('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4a85('0xb')](function(_0x56c41b){logger[_0x4a85('0xc')]('GetCampaign',_0x159ed0);logger[_0x4a85('0xf')](_0x4a85('0x16'),_0x159ed0,JSON[_0x4a85('0x11')](_0x56c41b));_0x50e210(_0x56c41b);})[_0x4a85('0x20')](function(_0x4596c6){logger[_0x4a85('0x12')](_0x4a85('0x16'),_0x4596c6[_0x4a85('0x14')],_0x159ed0);_0x374f34(_0x4435db['error'](0x1f4,_0x4596c6[_0x4a85('0x14')]));});});};
\ No newline at end of file
index 124f936..10e464d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8743=['destroy','removeBlackLists','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','isAuthenticated','show','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','delete'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8743,0x7a));var _0x3874=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x8743[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x3874('0x0'));var util=require(_0x3874('0x1'));var path=require(_0x3874('0x2'));var timeout=require('connect-timeout');var express=require(_0x3874('0x3'));var router=express[_0x3874('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3874('0x5'));var config=require(_0x3874('0x6'));var controller=require(_0x3874('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3874('0x8')]);router[_0x3874('0x9')]('/:id',auth[_0x3874('0xa')](),controller[_0x3874('0xb')]);router[_0x3874('0x9')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0x3874('0x9')]('/:id/hopper_histories',auth[_0x3874('0xa')](),controller[_0x3874('0xc')]);router['get']('/:id/hopper_finals',auth[_0x3874('0xa')](),controller[_0x3874('0xd')]);router[_0x3874('0x9')](_0x3874('0xe'),auth[_0x3874('0xa')](),controller[_0x3874('0xf')]);router['get'](_0x3874('0x10'),auth[_0x3874('0xa')](),controller[_0x3874('0x11')]);router[_0x3874('0x9')](_0x3874('0x12'),auth[_0x3874('0xa')](),controller['getBlackLists']);router[_0x3874('0x13')]('/',auth[_0x3874('0xa')](),controller[_0x3874('0x14')]);router[_0x3874('0x13')](_0x3874('0x15'),auth['isAuthenticated'](),controller[_0x3874('0x16')]);router[_0x3874('0x13')]('/:id/lists',auth[_0x3874('0xa')](),controller[_0x3874('0x17')]);router[_0x3874('0x13')](_0x3874('0x12'),auth[_0x3874('0xa')](),controller[_0x3874('0x18')]);router[_0x3874('0x19')](_0x3874('0x1a'),auth['isAuthenticated'](),controller['update']);router[_0x3874('0x1b')](_0x3874('0x1a'),auth[_0x3874('0xa')](),controller[_0x3874('0x1c')]);router[_0x3874('0x1b')](_0x3874('0x10'),auth[_0x3874('0xa')](),controller['removeLists']);router[_0x3874('0x1b')]('/:id/blacklists',auth[_0x3874('0xa')](),controller[_0x3874('0x1d')]);module['exports']=router;
\ No newline at end of file
+var _0xe4d6=['/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./campaign.controller','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xe4d6,0xd7));var _0x6e4d=function(_0x312765,_0x39e8b0){_0x312765=_0x312765-0x0;var _0x389760=_0xe4d6[_0x312765];return _0x389760;};'use strict';var multer=require(_0x6e4d('0x0'));var util=require(_0x6e4d('0x1'));var path=require(_0x6e4d('0x2'));var timeout=require(_0x6e4d('0x3'));var express=require('express');var router=express[_0x6e4d('0x4')]();var fs_extra=require(_0x6e4d('0x5'));var auth=require(_0x6e4d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6e4d('0x7'));router['get']('/',auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x9')]);router[_0x6e4d('0xa')](_0x6e4d('0xb'),auth[_0x6e4d('0x8')](),controller['show']);router['get'](_0x6e4d('0xc'),auth[_0x6e4d('0x8')](),controller[_0x6e4d('0xd')]);router['get'](_0x6e4d('0xe'),auth['isAuthenticated'](),controller[_0x6e4d('0xf')]);router[_0x6e4d('0xa')](_0x6e4d('0x10'),auth[_0x6e4d('0x8')](),controller['getHopperFinals']);router['get'](_0x6e4d('0x11'),auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x12')]);router[_0x6e4d('0xa')](_0x6e4d('0x13'),auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x14')]);router[_0x6e4d('0xa')](_0x6e4d('0x15'),auth['isAuthenticated'](),controller[_0x6e4d('0x16')]);router[_0x6e4d('0x17')]('/',auth[_0x6e4d('0x8')](),controller['create']);router['post'](_0x6e4d('0x18'),auth['isAuthenticated'](),controller[_0x6e4d('0x19')]);router[_0x6e4d('0x17')]('/:id/lists',auth[_0x6e4d('0x8')](),controller['addLists']);router[_0x6e4d('0x17')](_0x6e4d('0x15'),auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x1a')]);router[_0x6e4d('0x1b')]('/:id',auth[_0x6e4d('0x8')](),controller['update']);router[_0x6e4d('0x1c')](_0x6e4d('0xb'),auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x1d')]);router['delete'](_0x6e4d('0x13'),auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x1e')]);router[_0x6e4d('0x1c')]('/:id/blacklists',auth[_0x6e4d('0x8')](),controller[_0x6e4d('0x1f')]);module[_0x6e4d('0x20')]=router;
\ No newline at end of file
index 447bfe4..27f9c95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a7b=['STRING','TEXT','exports'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x6a7b,0x1d0));var _0xb6a7=function(_0x598f07,_0x1d91de){_0x598f07=_0x598f07-0x0;var _0x428a9b=_0x6a7b[_0x598f07];return _0x428a9b;};'use strict';var Sequelize=require('sequelize');module[_0xb6a7('0x0')]={'key':{'type':Sequelize[_0xb6a7('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xb6a7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb6a7('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('key');}}};
\ No newline at end of file
+var _0xc02b=['VIRTUAL','getDataValue','key','sequelize','STRING','TEXT'];(function(_0x4a77b8,_0xdd710){var _0x509c8c=function(_0x2bf2a5){while(--_0x2bf2a5){_0x4a77b8['push'](_0x4a77b8['shift']());}};_0x509c8c(++_0xdd710);}(_0xc02b,0x183));var _0xbc02=function(_0x5c18ef,_0xa2e81d){_0x5c18ef=_0x5c18ef-0x0;var _0x33789d=_0xc02b[_0x5c18ef];return _0x33789d;};'use strict';var Sequelize=require(_0xbc02('0x0'));module['exports']={'key':{'type':Sequelize[_0xbc02('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xbc02('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbc02('0x1')]},'name':{'type':Sequelize[_0xbc02('0x3')],'get':function(){return this[_0xbc02('0x4')](_0xbc02('0x5'));}}};
\ No newline at end of file
index 0400bd5..8be5529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1542=['type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','include','findAll','rows','catch','show','includeAll','options','body','params','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','reject','save','update','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x1542,0x134));var _0x2154=function(_0x51a105,_0x1f25ca){_0x51a105=_0x51a105-0x0;var _0x2366c9=_0x1542[_0x51a105];return _0x2366c9;};'use strict';var emlformat=require(_0x2154('0x0'));var rimraf=require(_0x2154('0x1'));var zipdir=require(_0x2154('0x2'));var jsonpatch=require(_0x2154('0x3'));var rp=require(_0x2154('0x4'));var moment=require(_0x2154('0x5'));var BPromise=require(_0x2154('0x6'));var Mustache=require(_0x2154('0x7'));var util=require(_0x2154('0x8'));var path=require('path');var sox=require(_0x2154('0x9'));var csv=require(_0x2154('0xa'));var ejs=require(_0x2154('0xb'));var fs=require('fs');var fs_extra=require(_0x2154('0xc'));var _=require('lodash');var squel=require(_0x2154('0xd'));var crypto=require(_0x2154('0xe'));var jsforce=require(_0x2154('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2154('0xa'));var querystring=require(_0x2154('0x10'));var Papa=require(_0x2154('0x11'));var Redis=require(_0x2154('0x12'));var authService=require(_0x2154('0x13'));var qs=require(_0x2154('0x14'));var as=require(_0x2154('0x15'));var hardwareService=require(_0x2154('0x16'));var logger=require('../../config/logger')(_0x2154('0x17'));var utils=require('../../config/utils');var config=require(_0x2154('0x18'));var licenseUtil=require(_0x2154('0x19'));var db=require(_0x2154('0x1a'))['db'];function respondWithStatusCode(_0x2344a2,_0x4ec10d){_0x4ec10d=_0x4ec10d||0xcc;return function(_0x2ef5d9){if(_0x2ef5d9){return _0x2344a2[_0x2154('0x1b')](_0x4ec10d);}return _0x2344a2['status'](_0x4ec10d)[_0x2154('0x1c')]();};}function respondWithResult(_0x33d1dd,_0x2cc7f5){_0x2cc7f5=_0x2cc7f5||0xc8;return function(_0xa2564f){if(_0xa2564f){return _0x33d1dd[_0x2154('0x1d')](_0x2cc7f5)[_0x2154('0x1e')](_0xa2564f);}};}function respondWithFilteredResult(_0x317a1d,_0x22a863){return function(_0x400b08){if(_0x400b08){var _0x30611c=typeof _0x22a863[_0x2154('0x1f')]==='undefined'&&typeof _0x22a863[_0x2154('0x20')]===_0x2154('0x21');var _0x21cdca=_0x400b08[_0x2154('0x22')];var _0x486836=_0x30611c?0x0:_0x22a863[_0x2154('0x1f')];var _0x3d680a=_0x30611c?_0x400b08[_0x2154('0x22')]:_0x22a863[_0x2154('0x1f')]+_0x22a863[_0x2154('0x20')];var _0x493781;if(_0x3d680a>=_0x21cdca){_0x3d680a=_0x21cdca;_0x493781=0xc8;}else{_0x493781=0xce;}_0x317a1d[_0x2154('0x1d')](_0x493781);return _0x317a1d['set'](_0x2154('0x23'),_0x486836+'-'+_0x3d680a+'/'+_0x21cdca)[_0x2154('0x1e')](_0x400b08);}return null;};}function patchUpdates(_0x2ea075){return function(_0x3abb04){try{jsonpatch['apply'](_0x3abb04,_0x2ea075,!![]);}catch(_0x134255){return BPromise[_0x2154('0x24')](_0x134255);}return _0x3abb04[_0x2154('0x25')]();};}function saveUpdates(_0x3b26c1,_0x440b34){return function(_0x287494){if(_0x287494){return _0x287494[_0x2154('0x26')](_0x3b26c1)['then'](function(_0x2dfad0){return _0x2dfad0;});}return null;};}function removeEntity(_0x19524e,_0x3f1212){return function(_0x513dc0){if(_0x513dc0){return _0x513dc0['destroy']()[_0x2154('0x27')](function(){var _0x40b244=_0x513dc0[_0x2154('0x28')]({'plain':!![]});var _0xe1f9db=_0x2154('0x29');return db[_0x2154('0x2a')][_0x2154('0x2b')]({'where':{'type':_0xe1f9db,'resourceId':_0x40b244['id']}})[_0x2154('0x27')](function(){return _0x513dc0;});})[_0x2154('0x27')](function(){_0x19524e[_0x2154('0x1d')](0xcc)[_0x2154('0x1c')]();});}};}function handleEntityNotFound(_0xffc073,_0x158680){return function(_0x38b3ec){if(!_0x38b3ec){_0xffc073[_0x2154('0x1b')](0x194);}return _0x38b3ec;};}function handleError(_0x20c0a4,_0x2d885a){_0x2d885a=_0x2d885a||0x1f4;return function(_0x3b0a4a){logger[_0x2154('0x2c')](_0x3b0a4a[_0x2154('0x2d')]);if(_0x3b0a4a[_0x2154('0x2e')]){delete _0x3b0a4a[_0x2154('0x2e')];}_0x20c0a4[_0x2154('0x1d')](_0x2d885a)[_0x2154('0x2f')](_0x3b0a4a);};}exports[_0x2154('0x30')]=function(_0x47fc08,_0x488ef4){var _0x122881={},_0xfd83ef={},_0xdd491d={'count':0x0,'rows':[]};var _0x580be8=_[_0x2154('0x31')](db[_0x2154('0x32')][_0x2154('0x33')],function(_0x2344f8){return{'name':_0x2344f8['fieldName'],'type':_0x2344f8[_0x2154('0x34')]['key']};});_0xfd83ef[_0x2154('0x35')]=_[_0x2154('0x31')](_0x580be8,_0x2154('0x2e'));_0xfd83ef['query']=_[_0x2154('0x36')](_0x47fc08['query']);_0xfd83ef['filters']=_[_0x2154('0x37')](_0xfd83ef[_0x2154('0x35')],_0xfd83ef[_0x2154('0x38')]);_0x122881[_0x2154('0x39')]=_['intersection'](_0xfd83ef[_0x2154('0x35')],qs[_0x2154('0x3a')](_0x47fc08[_0x2154('0x38')][_0x2154('0x3a')]));_0x122881[_0x2154('0x39')]=_0x122881[_0x2154('0x39')][_0x2154('0x3b')]?_0x122881[_0x2154('0x39')]:_0xfd83ef[_0x2154('0x35')];if(!_0x47fc08[_0x2154('0x38')][_0x2154('0x3c')](_0x2154('0x3d'))){_0x122881[_0x2154('0x20')]=qs['limit'](_0x47fc08[_0x2154('0x38')][_0x2154('0x20')]);_0x122881[_0x2154('0x1f')]=qs['offset'](_0x47fc08[_0x2154('0x38')][_0x2154('0x1f')]);}_0x122881[_0x2154('0x3e')]=qs['sort'](_0x47fc08['query']['sort']);_0x122881[_0x2154('0x3f')]=qs[_0x2154('0x40')](_['pick'](_0x47fc08[_0x2154('0x38')],_0xfd83ef[_0x2154('0x40')]),_0x580be8);if(_0x47fc08[_0x2154('0x38')]['filter']){_0x122881['where']=_['merge'](_0x122881[_0x2154('0x3f')],{'$or':[{'key':{'$like':'%'+_0x47fc08['query'][_0x2154('0x41')]+'%'}},{'value':{'$like':'%'+_0x47fc08[_0x2154('0x38')][_0x2154('0x41')]+'%'}}]});}_0x122881=_[_0x2154('0x42')]({},_0x122881,_0x47fc08['options']);var _0x536ced={'where':_0x122881[_0x2154('0x3f')]};return db['CannedAnswer'][_0x2154('0x22')](_0x536ced)[_0x2154('0x27')](function(_0x380946){_0xdd491d[_0x2154('0x22')]=_0x380946;if(_0x47fc08[_0x2154('0x38')]['includeAll']){_0x122881[_0x2154('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2154('0x44')](_0x122881);})[_0x2154('0x27')](function(_0x3b9982){_0xdd491d[_0x2154('0x45')]=_0x3b9982;return _0xdd491d;})['then'](respondWithFilteredResult(_0x488ef4,_0x122881))[_0x2154('0x46')](handleError(_0x488ef4,null));};exports[_0x2154('0x47')]=function(_0x30988f,_0x45d570){var _0x20ed35={'raw':!![],'where':{'id':_0x30988f['params']['id']}},_0x2332ce={};_0x2332ce[_0x2154('0x35')]=_['keys'](db[_0x2154('0x32')]['rawAttributes']);_0x2332ce[_0x2154('0x38')]=_[_0x2154('0x36')](_0x30988f[_0x2154('0x38')]);_0x2332ce[_0x2154('0x40')]=_[_0x2154('0x37')](_0x2332ce['model'],_0x2332ce[_0x2154('0x38')]);_0x20ed35[_0x2154('0x39')]=_[_0x2154('0x37')](_0x2332ce[_0x2154('0x35')],qs[_0x2154('0x3a')](_0x30988f[_0x2154('0x38')][_0x2154('0x3a')]));_0x20ed35[_0x2154('0x39')]=_0x20ed35[_0x2154('0x39')]['length']?_0x20ed35[_0x2154('0x39')]:_0x2332ce[_0x2154('0x35')];if(_0x30988f[_0x2154('0x38')][_0x2154('0x48')]){_0x20ed35[_0x2154('0x43')]=[{'all':!![]}];}_0x20ed35=_[_0x2154('0x42')]({},_0x20ed35,_0x30988f[_0x2154('0x49')]);return db['CannedAnswer']['find'](_0x20ed35)[_0x2154('0x27')](handleEntityNotFound(_0x45d570,null))['then'](respondWithResult(_0x45d570,null))['catch'](handleError(_0x45d570,null));};exports[_0x2154('0x26')]=function(_0x4de0c9,_0x35eb4e){if(_0x4de0c9[_0x2154('0x4a')]['id']){delete _0x4de0c9['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x4de0c9[_0x2154('0x4b')]['id']}})[_0x2154('0x27')](handleEntityNotFound(_0x35eb4e,null))[_0x2154('0x27')](saveUpdates(_0x4de0c9[_0x2154('0x4a')],null))[_0x2154('0x27')](respondWithResult(_0x35eb4e,null))[_0x2154('0x46')](handleError(_0x35eb4e,null));};exports[_0x2154('0x2b')]=function(_0x585208,_0x48a8fe){return db[_0x2154('0x32')][_0x2154('0x4c')]({'where':{'id':_0x585208[_0x2154('0x4b')]['id']}})[_0x2154('0x27')](handleEntityNotFound(_0x48a8fe,null))['then'](removeEntity(_0x48a8fe,null))[_0x2154('0x46')](handleError(_0x48a8fe,null));};exports[_0x2154('0x4d')]=function(_0x3eb3de,_0x548dfa){var _0x213a41={'key':_0x3eb3de[_0x2154('0x4a')]['key']};if(_0x3eb3de[_0x2154('0x4a')][_0x2154('0x4e')]){_0x213a41[_0x2154('0x4e')]=_0x3eb3de[_0x2154('0x4a')][_0x2154('0x4e')];}else if(_0x3eb3de['body'][_0x2154('0x4f')]){_0x213a41[_0x2154('0x4f')]=_0x3eb3de[_0x2154('0x4a')][_0x2154('0x4f')];}else if(_0x3eb3de[_0x2154('0x4a')][_0x2154('0x50')]){_0x213a41[_0x2154('0x50')]=_0x3eb3de[_0x2154('0x4a')][_0x2154('0x50')];}else if(_0x3eb3de[_0x2154('0x4a')][_0x2154('0x51')]){_0x213a41[_0x2154('0x51')]=_0x3eb3de[_0x2154('0x4a')][_0x2154('0x51')];}return db[_0x2154('0x32')]['find']({'where':_0x213a41})['then'](function(_0x46910d){if(_0x46910d){throw new db['Sequelize'][(_0x2154('0x52'))](_0x2154('0x53'));}return db[_0x2154('0x32')][_0x2154('0x4d')](_0x3eb3de[_0x2154('0x4a')]);})[_0x2154('0x27')](function(_0x9a78d1){var _0x432a2e=_0x3eb3de['user']['get']({'plain':!![]});if(!_0x432a2e)throw new Error(_0x2154('0x54'));if(_0x432a2e['role']===_0x2154('0x55')){var _0x57b401=_0x9a78d1[_0x2154('0x28')]({'plain':!![]});return db[_0x2154('0x56')][_0x2154('0x4c')]({'where':{'name':_0x2154('0x29'),'userProfileId':_0x432a2e[_0x2154('0x57')]},'raw':!![]})['then'](function(_0x343151){if(_0x343151&&_0x343151[_0x2154('0x58')]===0x0){return db[_0x2154('0x2a')][_0x2154('0x4d')]({'name':_0x57b401[_0x2154('0x2e')],'resourceId':_0x57b401['id'],'type':_0x343151[_0x2154('0x2e')],'sectionId':_0x343151['id']},{})[_0x2154('0x27')](function(){return _0x9a78d1;});}else{return _0x9a78d1;}})[_0x2154('0x46')](function(_0xf3d88d){logger[_0x2154('0x2c')](_0x2154('0x59'),_0xf3d88d);throw _0xf3d88d;});}return _0x9a78d1;})[_0x2154('0x27')](respondWithResult(_0x548dfa,0xc9))[_0x2154('0x46')](handleError(_0x548dfa,null));};
\ No newline at end of file
+var _0x3ec0=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','Content-Range','reject','save','update','then','get','destroy','error','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0xbb6973,_0x34c32e){var _0x2f19f2=function(_0x32a42e){while(--_0x32a42e){_0xbb6973['push'](_0xbb6973['shift']());}};_0x2f19f2(++_0x34c32e);}(_0x3ec0,0xa8));var _0x03ec=function(_0x5c42de,_0x4b3fcd){_0x5c42de=_0x5c42de-0x0;var _0x7e3b46=_0x3ec0[_0x5c42de];return _0x7e3b46;};'use strict';var emlformat=require(_0x03ec('0x0'));var rimraf=require(_0x03ec('0x1'));var zipdir=require(_0x03ec('0x2'));var jsonpatch=require(_0x03ec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x03ec('0x4'));var Mustache=require(_0x03ec('0x5'));var util=require(_0x03ec('0x6'));var path=require(_0x03ec('0x7'));var sox=require(_0x03ec('0x8'));var csv=require('to-csv');var ejs=require(_0x03ec('0x9'));var fs=require('fs');var fs_extra=require(_0x03ec('0xa'));var _=require(_0x03ec('0xb'));var squel=require('squel');var crypto=require(_0x03ec('0xc'));var jsforce=require(_0x03ec('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x03ec('0xe'));var querystring=require(_0x03ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x03ec('0x10'));var authService=require(_0x03ec('0x11'));var qs=require(_0x03ec('0x12'));var as=require(_0x03ec('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03ec('0x14'))(_0x03ec('0x15'));var utils=require(_0x03ec('0x16'));var config=require(_0x03ec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x03ec('0x18'))['db'];function respondWithStatusCode(_0x28c845,_0x1aab11){_0x1aab11=_0x1aab11||0xcc;return function(_0x3c7382){if(_0x3c7382){return _0x28c845[_0x03ec('0x19')](_0x1aab11);}return _0x28c845[_0x03ec('0x1a')](_0x1aab11)[_0x03ec('0x1b')]();};}function respondWithResult(_0x436233,_0x79c2b7){_0x79c2b7=_0x79c2b7||0xc8;return function(_0x2ce012){if(_0x2ce012){return _0x436233[_0x03ec('0x1a')](_0x79c2b7)[_0x03ec('0x1c')](_0x2ce012);}};}function respondWithFilteredResult(_0x3a57ef,_0x1323db){return function(_0x276380){if(_0x276380){var _0x5755f7=typeof _0x1323db['offset']===_0x03ec('0x1d')&&typeof _0x1323db[_0x03ec('0x1e')]===_0x03ec('0x1d');var _0x3aba5d=_0x276380[_0x03ec('0x1f')];var _0x13f07a=_0x5755f7?0x0:_0x1323db['offset'];var _0x29810f=_0x5755f7?_0x276380[_0x03ec('0x1f')]:_0x1323db['offset']+_0x1323db[_0x03ec('0x1e')];var _0x45a7a0;if(_0x29810f>=_0x3aba5d){_0x29810f=_0x3aba5d;_0x45a7a0=0xc8;}else{_0x45a7a0=0xce;}_0x3a57ef[_0x03ec('0x1a')](_0x45a7a0);return _0x3a57ef['set'](_0x03ec('0x20'),_0x13f07a+'-'+_0x29810f+'/'+_0x3aba5d)['json'](_0x276380);}return null;};}function patchUpdates(_0x461675){return function(_0x2abd9c){try{jsonpatch['apply'](_0x2abd9c,_0x461675,!![]);}catch(_0x35dfd7){return BPromise[_0x03ec('0x21')](_0x35dfd7);}return _0x2abd9c[_0x03ec('0x22')]();};}function saveUpdates(_0x1f60f0,_0x467642){return function(_0x19d383){if(_0x19d383){return _0x19d383[_0x03ec('0x23')](_0x1f60f0)[_0x03ec('0x24')](function(_0x5579d1){return _0x5579d1;});}return null;};}function removeEntity(_0x1a8644,_0x5cf033){return function(_0x3e6a1b){if(_0x3e6a1b){return _0x3e6a1b['destroy']()[_0x03ec('0x24')](function(){var _0x32823b=_0x3e6a1b[_0x03ec('0x25')]({'plain':!![]});var _0x8d8590='CannedAnswers';return db['UserProfileResource'][_0x03ec('0x26')]({'where':{'type':_0x8d8590,'resourceId':_0x32823b['id']}})[_0x03ec('0x24')](function(){return _0x3e6a1b;});})[_0x03ec('0x24')](function(){_0x1a8644[_0x03ec('0x1a')](0xcc)[_0x03ec('0x1b')]();});}};}function handleEntityNotFound(_0x50edbb,_0x2f943a){return function(_0xc00f34){if(!_0xc00f34){_0x50edbb[_0x03ec('0x19')](0x194);}return _0xc00f34;};}function handleError(_0x3baf44,_0x1bfa5f){_0x1bfa5f=_0x1bfa5f||0x1f4;return function(_0x2090c5){logger[_0x03ec('0x27')](_0x2090c5['stack']);if(_0x2090c5[_0x03ec('0x28')]){delete _0x2090c5['name'];}_0x3baf44[_0x03ec('0x1a')](_0x1bfa5f)[_0x03ec('0x29')](_0x2090c5);};}exports[_0x03ec('0x2a')]=function(_0x475fc1,_0x38d7fa){var _0x80a941={},_0x1458eb={},_0x15ee08={'count':0x0,'rows':[]};var _0x36e930=_[_0x03ec('0x2b')](db[_0x03ec('0x2c')][_0x03ec('0x2d')],function(_0x51acb6){return{'name':_0x51acb6[_0x03ec('0x2e')],'type':_0x51acb6['type'][_0x03ec('0x2f')]};});_0x1458eb[_0x03ec('0x30')]=_[_0x03ec('0x2b')](_0x36e930,_0x03ec('0x28'));_0x1458eb[_0x03ec('0x31')]=_[_0x03ec('0x32')](_0x475fc1[_0x03ec('0x31')]);_0x1458eb[_0x03ec('0x33')]=_[_0x03ec('0x34')](_0x1458eb['model'],_0x1458eb[_0x03ec('0x31')]);_0x80a941[_0x03ec('0x35')]=_[_0x03ec('0x34')](_0x1458eb[_0x03ec('0x30')],qs[_0x03ec('0x36')](_0x475fc1['query'][_0x03ec('0x36')]));_0x80a941[_0x03ec('0x35')]=_0x80a941['attributes'][_0x03ec('0x37')]?_0x80a941[_0x03ec('0x35')]:_0x1458eb['model'];if(!_0x475fc1[_0x03ec('0x31')][_0x03ec('0x38')](_0x03ec('0x39'))){_0x80a941[_0x03ec('0x1e')]=qs[_0x03ec('0x1e')](_0x475fc1[_0x03ec('0x31')]['limit']);_0x80a941['offset']=qs[_0x03ec('0x3a')](_0x475fc1['query'][_0x03ec('0x3a')]);}_0x80a941['order']=qs[_0x03ec('0x3b')](_0x475fc1[_0x03ec('0x31')]['sort']);_0x80a941[_0x03ec('0x3c')]=qs[_0x03ec('0x33')](_[_0x03ec('0x3d')](_0x475fc1[_0x03ec('0x31')],_0x1458eb[_0x03ec('0x33')]),_0x36e930);if(_0x475fc1[_0x03ec('0x31')][_0x03ec('0x3e')]){_0x80a941[_0x03ec('0x3c')]=_[_0x03ec('0x3f')](_0x80a941[_0x03ec('0x3c')],{'$or':[{'key':{'$like':'%'+_0x475fc1[_0x03ec('0x31')][_0x03ec('0x3e')]+'%'}},{'value':{'$like':'%'+_0x475fc1[_0x03ec('0x31')][_0x03ec('0x3e')]+'%'}}]});}_0x80a941=_[_0x03ec('0x3f')]({},_0x80a941,_0x475fc1[_0x03ec('0x40')]);var _0x354482={'where':_0x80a941[_0x03ec('0x3c')]};return db[_0x03ec('0x2c')]['count'](_0x354482)[_0x03ec('0x24')](function(_0x1ed017){_0x15ee08['count']=_0x1ed017;if(_0x475fc1[_0x03ec('0x31')][_0x03ec('0x41')]){_0x80a941[_0x03ec('0x42')]=[{'all':!![]}];}return db[_0x03ec('0x2c')]['findAll'](_0x80a941);})[_0x03ec('0x24')](function(_0x57c170){_0x15ee08[_0x03ec('0x43')]=_0x57c170;return _0x15ee08;})['then'](respondWithFilteredResult(_0x38d7fa,_0x80a941))[_0x03ec('0x44')](handleError(_0x38d7fa,null));};exports['show']=function(_0x44fc18,_0xbc51f9){var _0x3ea222={'raw':!![],'where':{'id':_0x44fc18[_0x03ec('0x45')]['id']}},_0x5c5a38={};_0x5c5a38[_0x03ec('0x30')]=_['keys'](db[_0x03ec('0x2c')][_0x03ec('0x2d')]);_0x5c5a38[_0x03ec('0x31')]=_[_0x03ec('0x32')](_0x44fc18[_0x03ec('0x31')]);_0x5c5a38[_0x03ec('0x33')]=_[_0x03ec('0x34')](_0x5c5a38[_0x03ec('0x30')],_0x5c5a38[_0x03ec('0x31')]);_0x3ea222[_0x03ec('0x35')]=_[_0x03ec('0x34')](_0x5c5a38[_0x03ec('0x30')],qs['fields'](_0x44fc18['query'][_0x03ec('0x36')]));_0x3ea222['attributes']=_0x3ea222[_0x03ec('0x35')]['length']?_0x3ea222[_0x03ec('0x35')]:_0x5c5a38['model'];if(_0x44fc18['query'][_0x03ec('0x41')]){_0x3ea222[_0x03ec('0x42')]=[{'all':!![]}];}_0x3ea222=_[_0x03ec('0x3f')]({},_0x3ea222,_0x44fc18['options']);return db[_0x03ec('0x2c')][_0x03ec('0x46')](_0x3ea222)[_0x03ec('0x24')](handleEntityNotFound(_0xbc51f9,null))[_0x03ec('0x24')](respondWithResult(_0xbc51f9,null))[_0x03ec('0x44')](handleError(_0xbc51f9,null));};exports[_0x03ec('0x23')]=function(_0x38d6c8,_0x1506b4){if(_0x38d6c8[_0x03ec('0x47')]['id']){delete _0x38d6c8[_0x03ec('0x47')]['id'];}return db[_0x03ec('0x2c')][_0x03ec('0x46')]({'where':{'id':_0x38d6c8[_0x03ec('0x45')]['id']}})[_0x03ec('0x24')](handleEntityNotFound(_0x1506b4,null))['then'](saveUpdates(_0x38d6c8[_0x03ec('0x47')],null))[_0x03ec('0x24')](respondWithResult(_0x1506b4,null))[_0x03ec('0x44')](handleError(_0x1506b4,null));};exports[_0x03ec('0x26')]=function(_0x1abbd6,_0x6445b1){return db[_0x03ec('0x2c')][_0x03ec('0x46')]({'where':{'id':_0x1abbd6[_0x03ec('0x45')]['id']}})[_0x03ec('0x24')](handleEntityNotFound(_0x6445b1,null))[_0x03ec('0x24')](removeEntity(_0x6445b1,null))[_0x03ec('0x44')](handleError(_0x6445b1,null));};exports[_0x03ec('0x48')]=function(_0x124c8e,_0x342c4f){var _0x21cc44={'key':_0x124c8e[_0x03ec('0x47')][_0x03ec('0x2f')]};if(_0x124c8e[_0x03ec('0x47')][_0x03ec('0x49')]){_0x21cc44[_0x03ec('0x49')]=_0x124c8e['body'][_0x03ec('0x49')];}else if(_0x124c8e['body'][_0x03ec('0x4a')]){_0x21cc44[_0x03ec('0x4a')]=_0x124c8e[_0x03ec('0x47')]['SmsAccountId'];}else if(_0x124c8e[_0x03ec('0x47')][_0x03ec('0x4b')]){_0x21cc44['OpenchannelAccountId']=_0x124c8e[_0x03ec('0x47')][_0x03ec('0x4b')];}else if(_0x124c8e[_0x03ec('0x47')]['ChatWebsiteId']){_0x21cc44[_0x03ec('0x4c')]=_0x124c8e['body'][_0x03ec('0x4c')];}return db[_0x03ec('0x2c')][_0x03ec('0x46')]({'where':_0x21cc44})['then'](function(_0x3985dc){if(_0x3985dc){throw new db[(_0x03ec('0x4d'))][(_0x03ec('0x4e'))](_0x03ec('0x4f'));}return db[_0x03ec('0x2c')]['create'](_0x124c8e[_0x03ec('0x47')]);})['then'](function(_0x2facc7){var _0x279b0a=_0x124c8e[_0x03ec('0x50')][_0x03ec('0x25')]({'plain':!![]});if(!_0x279b0a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x279b0a['role']===_0x03ec('0x50')){var _0x333f2f=_0x2facc7['get']({'plain':!![]});return db[_0x03ec('0x51')][_0x03ec('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x279b0a[_0x03ec('0x52')]},'raw':!![]})['then'](function(_0x4242af){if(_0x4242af&&_0x4242af[_0x03ec('0x53')]===0x0){return db['UserProfileResource'][_0x03ec('0x48')]({'name':_0x333f2f[_0x03ec('0x28')],'resourceId':_0x333f2f['id'],'type':_0x4242af[_0x03ec('0x28')],'sectionId':_0x4242af['id']},{})[_0x03ec('0x24')](function(){return _0x2facc7;});}else{return _0x2facc7;}})[_0x03ec('0x44')](function(_0x46128c){logger[_0x03ec('0x27')](_0x03ec('0x54'),_0x46128c);throw _0x46128c;});}return _0x2facc7;})['then'](respondWithResult(_0x342c4f,0xc9))[_0x03ec('0x44')](handleError(_0x342c4f,null));};
\ No newline at end of file
index d7869e6..2e9c5a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe844=['CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define'];(function(_0x1536ab,_0x44ac02){var _0x2e16ae=function(_0x10532d){while(--_0x10532d){_0x1536ab['push'](_0x1536ab['shift']());}};_0x2e16ae(++_0x44ac02);}(_0xe844,0xba));var _0x4e84=function(_0x3a2d12,_0x2dc2c2){_0x3a2d12=_0x3a2d12-0x0;var _0x22e212=_0xe844[_0x3a2d12];return _0x22e212;};'use strict';var _=require(_0x4e84('0x0'));var util=require(_0x4e84('0x1'));var logger=require(_0x4e84('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4e84('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e84('0x4'));var rimraf=require(_0x4e84('0x5'));var config=require(_0x4e84('0x6'));var attributes=require(_0x4e84('0x7'));module['exports']=function(_0x455042,_0x245309){return _0x455042[_0x4e84('0x8')](_0x4e84('0x9'),attributes,{'tableName':_0x4e84('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4e84('0xb'),'collate':_0x4e84('0xc')});};
\ No newline at end of file
+var _0xbc7c=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xbc7c,0x1a4));var _0xcbc7=function(_0x3b8170,_0x3f8a3f){_0x3b8170=_0x3b8170-0x0;var _0xbd0a3b=_0xbc7c[_0x3b8170];return _0xbd0a3b;};'use strict';var _=require('lodash');var util=require(_0xcbc7('0x0'));var logger=require('../../config/logger')(_0xcbc7('0x1'));var moment=require(_0xcbc7('0x2'));var BPromise=require(_0xcbc7('0x3'));var rp=require(_0xcbc7('0x4'));var fs=require('fs');var path=require(_0xcbc7('0x5'));var rimraf=require(_0xcbc7('0x6'));var config=require(_0xcbc7('0x7'));var attributes=require(_0xcbc7('0x8'));module[_0xcbc7('0x9')]=function(_0x4a1d0f,_0x1dc456){return _0x4a1d0f[_0xcbc7('0xa')](_0xcbc7('0xb'),attributes,{'tableName':_0xcbc7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcbc7('0xd')});};
\ No newline at end of file
index 5fd1986..13e07a5 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(_0x5675a8,_0x20cf73){var _0x401165=function(_0xeb8fbe){while(--_0xeb8fbe){_0x5675a8['push'](_0x5675a8['shift']());}};_0x401165(++_0x20cf73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+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(_0x31bd37,_0x5f5495){var _0x524163=function(_0x2b48a0){while(--_0x2b48a0){_0x31bd37['push'](_0x31bd37['shift']());}};_0x524163(++_0x5f5495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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 71436da..0e1704c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb0=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','get','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0xb1b7b,_0x13eaa0){var _0x339c3b=function(_0x5ca153){while(--_0x5ca153){_0xb1b7b['push'](_0xb1b7b['shift']());}};_0x339c3b(++_0x13eaa0);}(_0x6bb0,0xb2));var _0x06bb=function(_0x3414b2,_0x38fedb){_0x3414b2=_0x3414b2-0x0;var _0x295550=_0x6bb0[_0x3414b2];return _0x295550;};'use strict';var multer=require(_0x06bb('0x0'));var util=require(_0x06bb('0x1'));var path=require(_0x06bb('0x2'));var timeout=require(_0x06bb('0x3'));var express=require(_0x06bb('0x4'));var router=express[_0x06bb('0x5')]();var fs_extra=require(_0x06bb('0x6'));var auth=require(_0x06bb('0x7'));var interaction=require(_0x06bb('0x8'));var config=require(_0x06bb('0x9'));var controller=require(_0x06bb('0xa'));router['get']('/',auth[_0x06bb('0xb')](),controller['index']);router[_0x06bb('0xc')]('/:id',auth[_0x06bb('0xb')](),controller['show']);router[_0x06bb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x06bb('0xe')](_0x06bb('0xf'),auth[_0x06bb('0xb')](),controller[_0x06bb('0x10')]);router[_0x06bb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x06bb('0x12')]);module[_0x06bb('0x13')]=router;
\ No newline at end of file
+var _0x36f0=['get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36f0,0x9f));var _0x036f=function(_0x58a975,_0x4f7451){_0x58a975=_0x58a975-0x0;var _0x47f055=_0x36f0[_0x58a975];return _0x47f055;};'use strict';var multer=require(_0x036f('0x0'));var util=require(_0x036f('0x1'));var path=require(_0x036f('0x2'));var timeout=require(_0x036f('0x3'));var express=require('express');var router=express[_0x036f('0x4')]();var fs_extra=require(_0x036f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x036f('0x6'));var config=require(_0x036f('0x7'));var controller=require(_0x036f('0x8'));router[_0x036f('0x9')]('/',auth['isAuthenticated'](),controller[_0x036f('0xa')]);router[_0x036f('0x9')](_0x036f('0xb'),auth['isAuthenticated'](),controller[_0x036f('0xc')]);router[_0x036f('0xd')]('/',auth[_0x036f('0xe')](),controller[_0x036f('0xf')]);router[_0x036f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x036f('0x11')]);router[_0x036f('0x12')]('/:id',auth[_0x036f('0xe')](),controller[_0x036f('0x13')]);module[_0x036f('0x14')]=router;
\ No newline at end of file
index 695efd3..19f0b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9993=['sequelize','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x53dc7e,_0x4e032a){var _0x6645ea=function(_0x6ab792){while(--_0x6ab792){_0x53dc7e['push'](_0x53dc7e['shift']());}};_0x6645ea(++_0x4e032a);}(_0x9993,0x109));var _0x3999=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x9993[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require(_0x3999('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x3999('0x1')],'allowNull':![],'defaultValue':_0x3999('0x2')},'clid':{'type':Sequelize[_0x3999('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x3999('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3999('0x3')]},'dstchannel':{'type':Sequelize[_0x3999('0x3')]},'lastapp':{'type':Sequelize[_0x3999('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x3999('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3999('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x3999('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3999('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3999('0x3')]},'linkedid':{'type':Sequelize[_0x3999('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x3999('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x3999('0x3')]}};
\ No newline at end of file
+var _0x2b52=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0xb63a92,_0x306d43){var _0x38fe73=function(_0x5c04ff){while(--_0x5c04ff){_0xb63a92['push'](_0xb63a92['shift']());}};_0x38fe73(++_0x306d43);}(_0x2b52,0x12a));var _0x22b5=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x2b52[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x22b5('0x0'));module[_0x22b5('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x22b5('0x2')},'clid':{'type':Sequelize[_0x22b5('0x3')]},'src':{'type':Sequelize[_0x22b5('0x3')]},'dst':{'type':Sequelize[_0x22b5('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x22b5('0x3')]},'lastapp':{'type':Sequelize[_0x22b5('0x3')]},'lastdata':{'type':Sequelize[_0x22b5('0x3')]},'duration':{'type':Sequelize[_0x22b5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x22b5('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x22b5('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x22b5('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x22b5('0x3')]},'peeraccount':{'type':Sequelize[_0x22b5('0x3')]},'type':{'type':Sequelize[_0x22b5('0x3')]},'tag':{'type':Sequelize[_0x22b5('0x3')]}};
\ No newline at end of file
index 99c3987..7a6f81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce50=['api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xce50,0x1d8));var _0x0ce5=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xce50[_0x1ccdf7];return _0x52a0ae;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0ce5('0x0'));var zipdir=require(_0x0ce5('0x1'));var jsonpatch=require(_0x0ce5('0x2'));var rp=require(_0x0ce5('0x3'));var moment=require(_0x0ce5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0ce5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0ce5('0x6'));var ejs=require(_0x0ce5('0x7'));var fs=require('fs');var fs_extra=require(_0x0ce5('0x8'));var _=require(_0x0ce5('0x9'));var squel=require('squel');var crypto=require(_0x0ce5('0xa'));var jsforce=require(_0x0ce5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0ce5('0x6'));var querystring=require('querystring');var Papa=require(_0x0ce5('0xc'));var Redis=require(_0x0ce5('0xd'));var authService=require(_0x0ce5('0xe'));var qs=require(_0x0ce5('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ce5('0x10'));var logger=require(_0x0ce5('0x11'))(_0x0ce5('0x12'));var utils=require(_0x0ce5('0x13'));var config=require(_0x0ce5('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x529265,_0x59c22e){_0x59c22e=_0x59c22e||0xcc;return function(_0xb530fa){if(_0xb530fa){return _0x529265[_0x0ce5('0x15')](_0x59c22e);}return _0x529265[_0x0ce5('0x16')](_0x59c22e)['end']();};}function respondWithResult(_0x85bbb,_0x117fa9){_0x117fa9=_0x117fa9||0xc8;return function(_0x5f4317){if(_0x5f4317){return _0x85bbb[_0x0ce5('0x16')](_0x117fa9)['json'](_0x5f4317);}};}function respondWithFilteredResult(_0x1ece6f,_0x1dd856){return function(_0x3b5a36){if(_0x3b5a36){var _0x13ce5a=typeof _0x1dd856[_0x0ce5('0x17')]===_0x0ce5('0x18')&&typeof _0x1dd856[_0x0ce5('0x19')]===_0x0ce5('0x18');var _0x5eab29=_0x3b5a36[_0x0ce5('0x1a')];var _0x4292ce=_0x13ce5a?0x0:_0x1dd856['offset'];var _0x4f5e0b=_0x13ce5a?_0x3b5a36[_0x0ce5('0x1a')]:_0x1dd856['offset']+_0x1dd856[_0x0ce5('0x19')];var _0x477451;if(_0x4f5e0b>=_0x5eab29){_0x4f5e0b=_0x5eab29;_0x477451=0xc8;}else{_0x477451=0xce;}_0x1ece6f[_0x0ce5('0x16')](_0x477451);return _0x1ece6f[_0x0ce5('0x1b')](_0x0ce5('0x1c'),_0x4292ce+'-'+_0x4f5e0b+'/'+_0x5eab29)[_0x0ce5('0x1d')](_0x3b5a36);}return null;};}function patchUpdates(_0x57d9da){return function(_0x2cc733){try{jsonpatch[_0x0ce5('0x1e')](_0x2cc733,_0x57d9da,!![]);}catch(_0x1a1b8a){return BPromise[_0x0ce5('0x1f')](_0x1a1b8a);}return _0x2cc733['save']();};}function saveUpdates(_0x20f520,_0x4e8e46){return function(_0x16ff16){if(_0x16ff16){return _0x16ff16[_0x0ce5('0x20')](_0x20f520)[_0x0ce5('0x21')](function(_0x78be90){return _0x78be90;});}return null;};}function removeEntity(_0x334e7d,_0xbb1a2c){return function(_0x3ca9de){if(_0x3ca9de){return _0x3ca9de[_0x0ce5('0x22')]()[_0x0ce5('0x21')](function(){_0x334e7d[_0x0ce5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5392a4,_0x2332d4){return function(_0x56ef06){if(!_0x56ef06){_0x5392a4['sendStatus'](0x194);}return _0x56ef06;};}function handleError(_0x73f240,_0x564276){_0x564276=_0x564276||0x1f4;return function(_0x2c7414){logger[_0x0ce5('0x23')](_0x2c7414['stack']);if(_0x2c7414['name']){delete _0x2c7414[_0x0ce5('0x24')];}_0x73f240[_0x0ce5('0x16')](_0x564276)['send'](_0x2c7414);};}exports[_0x0ce5('0x25')]=function(_0x470fb6,_0x3d7153){var _0x54a385={},_0x55aa97={},_0x343137={'count':0x0,'rows':[]};var _0x28080b=_[_0x0ce5('0x26')](db[_0x0ce5('0x27')][_0x0ce5('0x28')],function(_0x44dabc){return{'name':_0x44dabc[_0x0ce5('0x29')],'type':_0x44dabc[_0x0ce5('0x2a')][_0x0ce5('0x2b')]};});_0x55aa97[_0x0ce5('0x2c')]=_[_0x0ce5('0x26')](_0x28080b,_0x0ce5('0x24'));_0x55aa97[_0x0ce5('0x2d')]=_[_0x0ce5('0x2e')](_0x470fb6[_0x0ce5('0x2d')]);_0x55aa97[_0x0ce5('0x2f')]=_[_0x0ce5('0x30')](_0x55aa97[_0x0ce5('0x2c')],_0x55aa97[_0x0ce5('0x2d')]);_0x54a385[_0x0ce5('0x31')]=_[_0x0ce5('0x30')](_0x55aa97[_0x0ce5('0x2c')],qs['fields'](_0x470fb6[_0x0ce5('0x2d')][_0x0ce5('0x32')]));_0x54a385[_0x0ce5('0x31')]=_0x54a385['attributes'][_0x0ce5('0x33')]?_0x54a385[_0x0ce5('0x31')]:_0x55aa97[_0x0ce5('0x2c')];if(!_0x470fb6[_0x0ce5('0x2d')]['hasOwnProperty'](_0x0ce5('0x34'))){_0x54a385[_0x0ce5('0x19')]=qs[_0x0ce5('0x19')](_0x470fb6[_0x0ce5('0x2d')][_0x0ce5('0x19')]);_0x54a385[_0x0ce5('0x17')]=qs[_0x0ce5('0x17')](_0x470fb6[_0x0ce5('0x2d')][_0x0ce5('0x17')]);}_0x54a385[_0x0ce5('0x35')]=qs[_0x0ce5('0x36')](_0x470fb6[_0x0ce5('0x2d')]['sort']);_0x54a385[_0x0ce5('0x37')]=qs[_0x0ce5('0x2f')](_[_0x0ce5('0x38')](_0x470fb6['query'],_0x55aa97[_0x0ce5('0x2f')]),_0x28080b);if(_0x470fb6[_0x0ce5('0x2d')][_0x0ce5('0x39')]){_0x54a385[_0x0ce5('0x37')]=_['merge'](_0x54a385[_0x0ce5('0x37')],{'$or':_['map'](_0x28080b,function(_0x27cbee){if(_0x27cbee['type']!=='VIRTUAL'){var _0x3b30a4={};_0x3b30a4[_0x27cbee[_0x0ce5('0x24')]]={'$like':'%'+_0x470fb6[_0x0ce5('0x2d')]['filter']+'%'};return _0x3b30a4;}})});}_0x54a385=_[_0x0ce5('0x3a')]({},_0x54a385,_0x470fb6[_0x0ce5('0x3b')]);var _0x245ac6={'where':_0x54a385[_0x0ce5('0x37')]};return db['Cdr'][_0x0ce5('0x1a')](_0x245ac6)[_0x0ce5('0x21')](function(_0x238f52){_0x343137[_0x0ce5('0x1a')]=_0x238f52;if(_0x470fb6[_0x0ce5('0x2d')][_0x0ce5('0x3c')]){_0x54a385['include']=[{'all':!![]}];}return db[_0x0ce5('0x27')][_0x0ce5('0x3d')](_0x54a385);})[_0x0ce5('0x21')](function(_0x1fa06f){_0x343137[_0x0ce5('0x3e')]=_0x1fa06f;return _0x343137;})[_0x0ce5('0x21')](respondWithFilteredResult(_0x3d7153,_0x54a385))[_0x0ce5('0x3f')](handleError(_0x3d7153,null));};exports[_0x0ce5('0x40')]=function(_0xa9b36a,_0x48ebfc){var _0x5e280c={'raw':!![],'where':{'id':_0xa9b36a[_0x0ce5('0x41')]['id']}},_0x1a16b7={};_0x1a16b7['model']=_['keys'](db[_0x0ce5('0x27')][_0x0ce5('0x28')]);_0x1a16b7[_0x0ce5('0x2d')]=_[_0x0ce5('0x2e')](_0xa9b36a[_0x0ce5('0x2d')]);_0x1a16b7[_0x0ce5('0x2f')]=_[_0x0ce5('0x30')](_0x1a16b7[_0x0ce5('0x2c')],_0x1a16b7[_0x0ce5('0x2d')]);_0x5e280c[_0x0ce5('0x31')]=_['intersection'](_0x1a16b7['model'],qs['fields'](_0xa9b36a[_0x0ce5('0x2d')][_0x0ce5('0x32')]));_0x5e280c[_0x0ce5('0x31')]=_0x5e280c[_0x0ce5('0x31')][_0x0ce5('0x33')]?_0x5e280c[_0x0ce5('0x31')]:_0x1a16b7['model'];if(_0xa9b36a[_0x0ce5('0x2d')][_0x0ce5('0x3c')]){_0x5e280c[_0x0ce5('0x42')]=[{'all':!![]}];}_0x5e280c=_[_0x0ce5('0x3a')]({},_0x5e280c,_0xa9b36a['options']);return db[_0x0ce5('0x27')]['find'](_0x5e280c)['then'](handleEntityNotFound(_0x48ebfc,null))[_0x0ce5('0x21')](respondWithResult(_0x48ebfc,null))[_0x0ce5('0x3f')](handleError(_0x48ebfc,null));};exports[_0x0ce5('0x43')]=function(_0xf1fc01,_0x3a3ec5){return db[_0x0ce5('0x27')][_0x0ce5('0x43')](_0xf1fc01[_0x0ce5('0x44')],{})[_0x0ce5('0x21')](respondWithResult(_0x3a3ec5,0xc9))[_0x0ce5('0x3f')](handleError(_0x3a3ec5,null));};exports[_0x0ce5('0x20')]=function(_0x40e47c,_0x5629f4){if(_0x40e47c[_0x0ce5('0x44')]['id']){delete _0x40e47c['body']['id'];}return db[_0x0ce5('0x27')]['find']({'where':{'id':_0x40e47c['params']['id']}})['then'](handleEntityNotFound(_0x5629f4,null))[_0x0ce5('0x21')](saveUpdates(_0x40e47c['body'],null))['then'](respondWithResult(_0x5629f4,null))['catch'](handleError(_0x5629f4,null));};exports[_0x0ce5('0x22')]=function(_0x3cd81a,_0x1a9ce4){return db[_0x0ce5('0x27')]['find']({'where':{'id':_0x3cd81a['params']['id']}})[_0x0ce5('0x21')](handleEntityNotFound(_0x1a9ce4,null))[_0x0ce5('0x21')](removeEntity(_0x1a9ce4,null))[_0x0ce5('0x3f')](handleError(_0x1a9ce4,null));};exports[_0x0ce5('0x45')]=function(_0x4256e3,_0x30571c){return db[_0x0ce5('0x27')][_0x0ce5('0x45')]()[_0x0ce5('0x21')](respondWithResult(_0x30571c,null))[_0x0ce5('0x3f')](handleError(_0x30571c,null));};
\ No newline at end of file
+var _0x1670=['bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','Cdr','includeAll','include','findAll','rows','show','create','body','find','params','catch','describe','eml-format','rimraf','fast-json-patch','moment'];(function(_0x3ab909,_0x1f0383){var _0x3147bd=function(_0x4dc8f0){while(--_0x4dc8f0){_0x3ab909['push'](_0x3ab909['shift']());}};_0x3147bd(++_0x1f0383);}(_0x1670,0x9a));var _0x0167=function(_0x1138cb,_0x369d94){_0x1138cb=_0x1138cb-0x0;var _0x5b981f=_0x1670[_0x1138cb];return _0x5b981f;};'use strict';var emlformat=require(_0x0167('0x0'));var rimraf=require(_0x0167('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0167('0x2'));var rp=require('request-promise');var moment=require(_0x0167('0x3'));var BPromise=require(_0x0167('0x4'));var Mustache=require(_0x0167('0x5'));var util=require(_0x0167('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0167('0x7'));var ejs=require(_0x0167('0x8'));var fs=require('fs');var fs_extra=require(_0x0167('0x9'));var _=require(_0x0167('0xa'));var squel=require(_0x0167('0xb'));var crypto=require(_0x0167('0xc'));var jsforce=require(_0x0167('0xd'));var deskjs=require(_0x0167('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0167('0xf'));var Redis=require(_0x0167('0x10'));var authService=require(_0x0167('0x11'));var qs=require(_0x0167('0x12'));var as=require(_0x0167('0x13'));var hardwareService=require(_0x0167('0x14'));var logger=require(_0x0167('0x15'))(_0x0167('0x16'));var utils=require(_0x0167('0x17'));var config=require(_0x0167('0x18'));var licenseUtil=require(_0x0167('0x19'));var db=require(_0x0167('0x1a'))['db'];function respondWithStatusCode(_0x34ac02,_0x2ebfa3){_0x2ebfa3=_0x2ebfa3||0xcc;return function(_0x570965){if(_0x570965){return _0x34ac02[_0x0167('0x1b')](_0x2ebfa3);}return _0x34ac02['status'](_0x2ebfa3)[_0x0167('0x1c')]();};}function respondWithResult(_0x5eb5f9,_0x7744d1){_0x7744d1=_0x7744d1||0xc8;return function(_0x39e644){if(_0x39e644){return _0x5eb5f9[_0x0167('0x1d')](_0x7744d1)['json'](_0x39e644);}};}function respondWithFilteredResult(_0x50c1a3,_0x547dea){return function(_0x2eeaa7){if(_0x2eeaa7){var _0x7ae6e7=typeof _0x547dea['offset']===_0x0167('0x1e')&&typeof _0x547dea['limit']==='undefined';var _0x38f934=_0x2eeaa7['count'];var _0x22f07c=_0x7ae6e7?0x0:_0x547dea['offset'];var _0x16094a=_0x7ae6e7?_0x2eeaa7[_0x0167('0x1f')]:_0x547dea[_0x0167('0x20')]+_0x547dea[_0x0167('0x21')];var _0xc3f9fe;if(_0x16094a>=_0x38f934){_0x16094a=_0x38f934;_0xc3f9fe=0xc8;}else{_0xc3f9fe=0xce;}_0x50c1a3[_0x0167('0x1d')](_0xc3f9fe);return _0x50c1a3[_0x0167('0x22')](_0x0167('0x23'),_0x22f07c+'-'+_0x16094a+'/'+_0x38f934)[_0x0167('0x24')](_0x2eeaa7);}return null;};}function patchUpdates(_0x7c626){return function(_0x221d7c){try{jsonpatch[_0x0167('0x25')](_0x221d7c,_0x7c626,!![]);}catch(_0x5ba3d0){return BPromise[_0x0167('0x26')](_0x5ba3d0);}return _0x221d7c[_0x0167('0x27')]();};}function saveUpdates(_0x2375ff,_0x480245){return function(_0x2f69c3){if(_0x2f69c3){return _0x2f69c3[_0x0167('0x28')](_0x2375ff)[_0x0167('0x29')](function(_0x3c0a58){return _0x3c0a58;});}return null;};}function removeEntity(_0x5d25df,_0x38e811){return function(_0x4e8618){if(_0x4e8618){return _0x4e8618[_0x0167('0x2a')]()[_0x0167('0x29')](function(){_0x5d25df[_0x0167('0x1d')](0xcc)[_0x0167('0x1c')]();});}};}function handleEntityNotFound(_0x46231b,_0x41c8f9){return function(_0x31c5eb){if(!_0x31c5eb){_0x46231b['sendStatus'](0x194);}return _0x31c5eb;};}function handleError(_0x358b97,_0x436865){_0x436865=_0x436865||0x1f4;return function(_0x23a863){logger['error'](_0x23a863[_0x0167('0x2b')]);if(_0x23a863[_0x0167('0x2c')]){delete _0x23a863['name'];}_0x358b97[_0x0167('0x1d')](_0x436865)[_0x0167('0x2d')](_0x23a863);};}exports['index']=function(_0x31bbdc,_0x44dd56){var _0x4179d4={},_0x5610ef={},_0x210a3d={'count':0x0,'rows':[]};var _0x39b105=_['map'](db['Cdr'][_0x0167('0x2e')],function(_0x124763){return{'name':_0x124763[_0x0167('0x2f')],'type':_0x124763[_0x0167('0x30')]['key']};});_0x5610ef['model']=_[_0x0167('0x31')](_0x39b105,'name');_0x5610ef['query']=_[_0x0167('0x32')](_0x31bbdc[_0x0167('0x33')]);_0x5610ef[_0x0167('0x34')]=_[_0x0167('0x35')](_0x5610ef[_0x0167('0x36')],_0x5610ef[_0x0167('0x33')]);_0x4179d4[_0x0167('0x37')]=_['intersection'](_0x5610ef['model'],qs[_0x0167('0x38')](_0x31bbdc[_0x0167('0x33')][_0x0167('0x38')]));_0x4179d4[_0x0167('0x37')]=_0x4179d4[_0x0167('0x37')][_0x0167('0x39')]?_0x4179d4['attributes']:_0x5610ef[_0x0167('0x36')];if(!_0x31bbdc['query']['hasOwnProperty'](_0x0167('0x3a'))){_0x4179d4[_0x0167('0x21')]=qs[_0x0167('0x21')](_0x31bbdc['query'][_0x0167('0x21')]);_0x4179d4[_0x0167('0x20')]=qs[_0x0167('0x20')](_0x31bbdc[_0x0167('0x33')]['offset']);}_0x4179d4[_0x0167('0x3b')]=qs[_0x0167('0x3c')](_0x31bbdc[_0x0167('0x33')]['sort']);_0x4179d4[_0x0167('0x3d')]=qs[_0x0167('0x34')](_[_0x0167('0x3e')](_0x31bbdc[_0x0167('0x33')],_0x5610ef[_0x0167('0x34')]),_0x39b105);if(_0x31bbdc['query'][_0x0167('0x3f')]){_0x4179d4[_0x0167('0x3d')]=_['merge'](_0x4179d4[_0x0167('0x3d')],{'$or':_[_0x0167('0x31')](_0x39b105,function(_0x179f4d){if(_0x179f4d[_0x0167('0x30')]!==_0x0167('0x40')){var _0xfcc906={};_0xfcc906[_0x179f4d['name']]={'$like':'%'+_0x31bbdc[_0x0167('0x33')][_0x0167('0x3f')]+'%'};return _0xfcc906;}})});}_0x4179d4=_[_0x0167('0x41')]({},_0x4179d4,_0x31bbdc[_0x0167('0x42')]);var _0x49dc4d={'where':_0x4179d4[_0x0167('0x3d')]};return db[_0x0167('0x43')]['count'](_0x49dc4d)[_0x0167('0x29')](function(_0x3c393a){_0x210a3d[_0x0167('0x1f')]=_0x3c393a;if(_0x31bbdc['query'][_0x0167('0x44')]){_0x4179d4[_0x0167('0x45')]=[{'all':!![]}];}return db[_0x0167('0x43')][_0x0167('0x46')](_0x4179d4);})[_0x0167('0x29')](function(_0x42183d){_0x210a3d[_0x0167('0x47')]=_0x42183d;return _0x210a3d;})[_0x0167('0x29')](respondWithFilteredResult(_0x44dd56,_0x4179d4))['catch'](handleError(_0x44dd56,null));};exports[_0x0167('0x48')]=function(_0x47d862,_0x45f0d5){var _0x237969={'raw':!![],'where':{'id':_0x47d862['params']['id']}},_0x31d3da={};_0x31d3da['model']=_['keys'](db[_0x0167('0x43')][_0x0167('0x2e')]);_0x31d3da[_0x0167('0x33')]=_[_0x0167('0x32')](_0x47d862[_0x0167('0x33')]);_0x31d3da[_0x0167('0x34')]=_['intersection'](_0x31d3da['model'],_0x31d3da['query']);_0x237969[_0x0167('0x37')]=_['intersection'](_0x31d3da[_0x0167('0x36')],qs[_0x0167('0x38')](_0x47d862[_0x0167('0x33')][_0x0167('0x38')]));_0x237969['attributes']=_0x237969[_0x0167('0x37')][_0x0167('0x39')]?_0x237969[_0x0167('0x37')]:_0x31d3da[_0x0167('0x36')];if(_0x47d862[_0x0167('0x33')][_0x0167('0x44')]){_0x237969[_0x0167('0x45')]=[{'all':!![]}];}_0x237969=_[_0x0167('0x41')]({},_0x237969,_0x47d862[_0x0167('0x42')]);return db[_0x0167('0x43')]['find'](_0x237969)['then'](handleEntityNotFound(_0x45f0d5,null))[_0x0167('0x29')](respondWithResult(_0x45f0d5,null))['catch'](handleError(_0x45f0d5,null));};exports[_0x0167('0x49')]=function(_0x4d9315,_0x2c3efc){return db['Cdr'][_0x0167('0x49')](_0x4d9315[_0x0167('0x4a')],{})['then'](respondWithResult(_0x2c3efc,0xc9))['catch'](handleError(_0x2c3efc,null));};exports['update']=function(_0x174a7a,_0x55aaa0){if(_0x174a7a['body']['id']){delete _0x174a7a[_0x0167('0x4a')]['id'];}return db['Cdr'][_0x0167('0x4b')]({'where':{'id':_0x174a7a[_0x0167('0x4c')]['id']}})[_0x0167('0x29')](handleEntityNotFound(_0x55aaa0,null))['then'](saveUpdates(_0x174a7a[_0x0167('0x4a')],null))['then'](respondWithResult(_0x55aaa0,null))['catch'](handleError(_0x55aaa0,null));};exports['destroy']=function(_0xecc47d,_0x396c91){return db[_0x0167('0x43')][_0x0167('0x4b')]({'where':{'id':_0xecc47d[_0x0167('0x4c')]['id']}})['then'](handleEntityNotFound(_0x396c91,null))[_0x0167('0x29')](removeEntity(_0x396c91,null))[_0x0167('0x4d')](handleError(_0x396c91,null));};exports[_0x0167('0x4e')]=function(_0x441b4e,_0x5af280){return db['Cdr'][_0x0167('0x4e')]()['then'](respondWithResult(_0x5af280,null))[_0x0167('0x4d')](handleError(_0x5af280,null));};
\ No newline at end of file
index 833ae21..48e4c20 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(_0x4c9441,_0x912e8d){var _0x34b58a=function(_0x5b9086){while(--_0x5b9086){_0x4c9441['push'](_0x4c9441['shift']());}};_0x34b58a(++_0x912e8d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e1840,_0xb78018){_0x4e1840=_0x4e1840-0x0;var _0x5f183e=_0x7a54[_0x4e1840];return _0x5f183e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5f025e,_0x459129){var _0x3467cb=function(_0x1ceb7a){while(--_0x1ceb7a){_0x5f025e['push'](_0x5f025e['shift']());}};_0x3467cb(++_0x459129);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
index 9b63f05..2922e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf22d=['info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1204f9,_0x3a09e2){var _0x5e6d0a=function(_0xa1ff8){while(--_0xa1ff8){_0x1204f9['push'](_0x1204f9['shift']());}};_0x5e6d0a(++_0x3a09e2);}(_0xf22d,0x1ab));var _0xdf22=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xf22d[_0x411add];return _0x238242;};'use strict';var _=require(_0xdf22('0x0'));var util=require(_0xdf22('0x1'));var moment=require(_0xdf22('0x2'));var BPromise=require(_0xdf22('0x3'));var rs=require(_0xdf22('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf22('0x5'))['db'];var utils=require(_0xdf22('0x6'));var logger=require('../../config/logger')(_0xdf22('0x7'));var config=require(_0xdf22('0x8'));var jayson=require(_0xdf22('0x9'));var client=jayson['client'][_0xdf22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x394fdd,_0x40bcb5,_0x27826c){return new BPromise(function(_0x511686,_0x21af77){return client[_0xdf22('0xb')](_0x394fdd,_0x27826c)[_0xdf22('0xc')](function(_0x3acc75){logger[_0xdf22('0xd')]('Cdr,\x20%s,\x20%s',_0x40bcb5,'request\x20sent');logger[_0xdf22('0xe')](_0xdf22('0xf'),_0x40bcb5,_0xdf22('0x10'),JSON[_0xdf22('0x11')](_0x3acc75));if(_0x3acc75[_0xdf22('0x12')]){if(_0x3acc75['error']['code']===0x1f4){logger[_0xdf22('0x12')](_0xdf22('0x13'),_0x40bcb5,_0x3acc75[_0xdf22('0x12')][_0xdf22('0x14')]);return _0x21af77(_0x3acc75['error'][_0xdf22('0x14')]);}logger[_0xdf22('0x12')](_0xdf22('0x13'),_0x40bcb5,_0x3acc75[_0xdf22('0x12')][_0xdf22('0x14')]);return _0x511686(_0x3acc75[_0xdf22('0x12')]['message']);}else{logger[_0xdf22('0xd')](_0xdf22('0x13'),_0x40bcb5,_0xdf22('0x10'));_0x511686(_0x3acc75['result'][_0xdf22('0x14')]);}})[_0xdf22('0x15')](function(_0x1eabf6){logger[_0xdf22('0x12')](_0xdf22('0x13'),_0x40bcb5,_0x1eabf6);_0x21af77(_0x1eabf6);});});}
\ No newline at end of file
+var _0x0245=['Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x0245,0xcf));var _0x5024=function(_0x5b4222,_0x4039eb){_0x5b4222=_0x5b4222-0x0;var _0x28ef21=_0x0245[_0x5b4222];return _0x28ef21;};'use strict';var _=require(_0x5024('0x0'));var util=require(_0x5024('0x1'));var moment=require(_0x5024('0x2'));var BPromise=require(_0x5024('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5024('0x4'));var db=require(_0x5024('0x5'))['db'];var utils=require(_0x5024('0x6'));var logger=require('../../config/logger')(_0x5024('0x7'));var config=require('../../config/environment');var jayson=require(_0x5024('0x8'));var client=jayson[_0x5024('0x9')][_0x5024('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32f197,_0x39f105,_0x5e4e2e){return new BPromise(function(_0x265130,_0x3e181e){return client[_0x5024('0xb')](_0x32f197,_0x5e4e2e)['then'](function(_0x46d49c){logger[_0x5024('0xc')](_0x5024('0xd'),_0x39f105,'request\x20sent');logger['debug'](_0x5024('0xe'),_0x39f105,_0x5024('0xf'),JSON[_0x5024('0x10')](_0x46d49c));if(_0x46d49c['error']){if(_0x46d49c[_0x5024('0x11')]['code']===0x1f4){logger[_0x5024('0x11')](_0x5024('0xd'),_0x39f105,_0x46d49c['error'][_0x5024('0x12')]);return _0x3e181e(_0x46d49c[_0x5024('0x11')][_0x5024('0x12')]);}logger[_0x5024('0x11')](_0x5024('0xd'),_0x39f105,_0x46d49c[_0x5024('0x11')]['message']);return _0x265130(_0x46d49c[_0x5024('0x11')]['message']);}else{logger[_0x5024('0xc')]('Cdr,\x20%s,\x20%s',_0x39f105,'request\x20sent');_0x265130(_0x46d49c[_0x5024('0x13')]['message']);}})['catch'](function(_0x3e7a3c){logger['error'](_0x5024('0xd'),_0x39f105,_0x3e7a3c);_0x3e181e(_0x3e7a3c);});});}
\ No newline at end of file
index af0e12d..2624e34 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(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('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 _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(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 47234d7..43b1994 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b92=['noop','TEXT','sequelize','STRING'];(function(_0x5deea8,_0x58117f){var _0x1d4b0e=function(_0x47e735){while(--_0x47e735){_0x5deea8['push'](_0x5deea8['shift']());}};_0x1d4b0e(++_0x58117f);}(_0x4b92,0x126));var _0x24b9=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x4b92[_0x513aa5];return _0x1a1a7c;};'use strict';var Sequelize=require(_0x24b9('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x24b9('0x1')],'allowNull':![],'defaultValue':_0x24b9('0x2')},'appdata':{'type':Sequelize[_0x24b9('0x3')]()},'description':{'type':Sequelize[_0x24b9('0x1')]},'interval':{'type':Sequelize[_0x24b9('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xfa84=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xfa84,0xc7));var _0x4fa8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xfa84[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x4fa8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x4fa8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4fa8('0x2')],'allowNull':![],'defaultValue':_0x4fa8('0x3')},'appdata':{'type':Sequelize[_0x4fa8('0x4')]()},'description':{'type':Sequelize[_0x4fa8('0x2')]},'interval':{'type':Sequelize[_0x4fa8('0x2')],'defaultValue':_0x4fa8('0x5')}};
\ No newline at end of file
index 4202bb6..8941cb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0901=['model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','stack','name','send','show','params'];(function(_0x43c8de,_0x4ac946){var _0x17430a=function(_0x3b0199){while(--_0x3b0199){_0x43c8de['push'](_0x43c8de['shift']());}};_0x17430a(++_0x4ac946);}(_0x0901,0x134));var _0x1090=function(_0x455233,_0x4aeab0){_0x455233=_0x455233-0x0;var _0x56b92b=_0x0901[_0x455233];return _0x56b92b;};'use strict';var emlformat=require(_0x1090('0x0'));var rimraf=require(_0x1090('0x1'));var zipdir=require(_0x1090('0x2'));var jsonpatch=require(_0x1090('0x3'));var rp=require(_0x1090('0x4'));var moment=require(_0x1090('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1090('0x6'));var path=require(_0x1090('0x7'));var sox=require(_0x1090('0x8'));var csv=require(_0x1090('0x9'));var ejs=require(_0x1090('0xa'));var fs=require('fs');var fs_extra=require(_0x1090('0xb'));var _=require('lodash');var squel=require(_0x1090('0xc'));var crypto=require(_0x1090('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1090('0xe'));var toCsv=require(_0x1090('0x9'));var querystring=require(_0x1090('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1090('0x10'));var as=require(_0x1090('0x11'));var hardwareService=require(_0x1090('0x12'));var logger=require('../../config/logger')(_0x1090('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1090('0x14'));var db=require(_0x1090('0x15'))['db'];function respondWithStatusCode(_0x43f1b6,_0x2c0afa){_0x2c0afa=_0x2c0afa||0xcc;return function(_0x4250c6){if(_0x4250c6){return _0x43f1b6[_0x1090('0x16')](_0x2c0afa);}return _0x43f1b6[_0x1090('0x17')](_0x2c0afa)[_0x1090('0x18')]();};}function respondWithResult(_0x1cbc74,_0x897055){_0x897055=_0x897055||0xc8;return function(_0x477a41){if(_0x477a41){return _0x1cbc74[_0x1090('0x17')](_0x897055)[_0x1090('0x19')](_0x477a41);}};}function respondWithFilteredResult(_0x4dadef,_0x465cbd){return function(_0x28a09a){if(_0x28a09a){var _0x14e6dc=typeof _0x465cbd['offset']===_0x1090('0x1a')&&typeof _0x465cbd[_0x1090('0x1b')]===_0x1090('0x1a');var _0x31ef2f=_0x28a09a[_0x1090('0x1c')];var _0x496fb1=_0x14e6dc?0x0:_0x465cbd[_0x1090('0x1d')];var _0x2ea64c=_0x14e6dc?_0x28a09a[_0x1090('0x1c')]:_0x465cbd[_0x1090('0x1d')]+_0x465cbd[_0x1090('0x1b')];var _0x392fcc;if(_0x2ea64c>=_0x31ef2f){_0x2ea64c=_0x31ef2f;_0x392fcc=0xc8;}else{_0x392fcc=0xce;}_0x4dadef[_0x1090('0x17')](_0x392fcc);return _0x4dadef[_0x1090('0x1e')](_0x1090('0x1f'),_0x496fb1+'-'+_0x2ea64c+'/'+_0x31ef2f)['json'](_0x28a09a);}return null;};}function patchUpdates(_0x57dfc5){return function(_0x8df216){try{jsonpatch['apply'](_0x8df216,_0x57dfc5,!![]);}catch(_0x304e6d){return BPromise[_0x1090('0x20')](_0x304e6d);}return _0x8df216[_0x1090('0x21')]();};}function saveUpdates(_0xa48311,_0x211b39){return function(_0x29633c){if(_0x29633c){return _0x29633c[_0x1090('0x22')](_0xa48311)['then'](function(_0x505d09){return _0x505d09;});}return null;};}function removeEntity(_0x4c7434,_0x48b5c0){return function(_0x4d187a){if(_0x4d187a){return _0x4d187a['destroy']()['then'](function(){_0x4c7434[_0x1090('0x17')](0xcc)[_0x1090('0x18')]();});}};}function handleEntityNotFound(_0x54eeec,_0x3face7){return function(_0x50267d){if(!_0x50267d){_0x54eeec[_0x1090('0x16')](0x194);}return _0x50267d;};}function handleError(_0x33dc42,_0x3a2123){_0x3a2123=_0x3a2123||0x1f4;return function(_0x5e2859){logger['error'](_0x5e2859[_0x1090('0x23')]);if(_0x5e2859['name']){delete _0x5e2859[_0x1090('0x24')];}_0x33dc42['status'](_0x3a2123)[_0x1090('0x25')](_0x5e2859);};}exports[_0x1090('0x26')]=function(_0x124ac,_0x3b7f54){var _0x257645={'raw':!![],'where':{'id':_0x124ac[_0x1090('0x27')]['id']}},_0x5bd6ab={};_0x5bd6ab[_0x1090('0x28')]=_[_0x1090('0x29')](db[_0x1090('0x2a')][_0x1090('0x2b')]);_0x5bd6ab[_0x1090('0x2c')]=_[_0x1090('0x29')](_0x124ac[_0x1090('0x2c')]);_0x5bd6ab[_0x1090('0x2d')]=_[_0x1090('0x2e')](_0x5bd6ab['model'],_0x5bd6ab['query']);_0x257645[_0x1090('0x2f')]=_[_0x1090('0x2e')](_0x5bd6ab[_0x1090('0x28')],qs['fields'](_0x124ac[_0x1090('0x2c')][_0x1090('0x30')]));_0x257645[_0x1090('0x2f')]=_0x257645[_0x1090('0x2f')][_0x1090('0x31')]?_0x257645['attributes']:_0x5bd6ab[_0x1090('0x28')];if(_0x124ac[_0x1090('0x2c')][_0x1090('0x32')]){_0x257645[_0x1090('0x33')]=[{'all':!![]}];}_0x257645=_[_0x1090('0x34')]({},_0x257645,_0x124ac[_0x1090('0x35')]);return db['ChatApplication'][_0x1090('0x36')](_0x257645)['then'](handleEntityNotFound(_0x3b7f54,null))[_0x1090('0x37')](respondWithResult(_0x3b7f54,null))[_0x1090('0x38')](handleError(_0x3b7f54,null));};exports[_0x1090('0x22')]=function(_0x1b1d3a,_0x5ae313){if(_0x1b1d3a[_0x1090('0x39')]['id']){delete _0x1b1d3a[_0x1090('0x39')]['id'];}return db[_0x1090('0x2a')]['find']({'where':{'id':_0x1b1d3a['params']['id']}})[_0x1090('0x37')](handleEntityNotFound(_0x5ae313,null))['then'](saveUpdates(_0x1b1d3a[_0x1090('0x39')],null))['then'](respondWithResult(_0x5ae313,null))[_0x1090('0x38')](handleError(_0x5ae313,null));};exports['destroy']=function(_0x18cc57,_0x3f910f){return db['ChatApplication'][_0x1090('0x36')]({'where':{'id':_0x18cc57[_0x1090('0x27')]['id']}})[_0x1090('0x37')](handleEntityNotFound(_0x3f910f,null))[_0x1090('0x37')](removeEntity(_0x3f910f,null))[_0x1090('0x38')](handleError(_0x3f910f,null));};
\ No newline at end of file
+var _0x7fce=['eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','name','send','show','params','keys','rawAttributes','query','intersection','model','fields','attributes','includeAll','include','merge','options','ChatApplication','find','catch','body'];(function(_0x35862b,_0x542b1e){var _0x7b9fb3=function(_0x201852){while(--_0x201852){_0x35862b['push'](_0x35862b['shift']());}};_0x7b9fb3(++_0x542b1e);}(_0x7fce,0xdc));var _0xe7fc=function(_0xa57be,_0x564a5c){_0xa57be=_0xa57be-0x0;var _0x30ca39=_0x7fce[_0xa57be];return _0x30ca39;};'use strict';var emlformat=require(_0xe7fc('0x0'));var rimraf=require(_0xe7fc('0x1'));var zipdir=require(_0xe7fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7fc('0x3'));var moment=require('moment');var BPromise=require(_0xe7fc('0x4'));var Mustache=require('mustache');var util=require(_0xe7fc('0x5'));var path=require(_0xe7fc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe7fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7fc('0x8'));var squel=require(_0xe7fc('0x9'));var crypto=require(_0xe7fc('0xa'));var jsforce=require(_0xe7fc('0xb'));var deskjs=require(_0xe7fc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe7fc('0xd'));var Papa=require('papaparse');var Redis=require(_0xe7fc('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe7fc('0xf'));var as=require(_0xe7fc('0x10'));var hardwareService=require(_0xe7fc('0x11'));var logger=require(_0xe7fc('0x12'))('api');var utils=require(_0xe7fc('0x13'));var config=require(_0xe7fc('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243600,_0x59da2e){_0x59da2e=_0x59da2e||0xcc;return function(_0x38512a){if(_0x38512a){return _0x243600['sendStatus'](_0x59da2e);}return _0x243600['status'](_0x59da2e)[_0xe7fc('0x15')]();};}function respondWithResult(_0x14fcbf,_0x235692){_0x235692=_0x235692||0xc8;return function(_0x307f58){if(_0x307f58){return _0x14fcbf[_0xe7fc('0x16')](_0x235692)['json'](_0x307f58);}};}function respondWithFilteredResult(_0x272cd5,_0x5ce83f){return function(_0x4da73b){if(_0x4da73b){var _0x1302e5=typeof _0x5ce83f[_0xe7fc('0x17')]===_0xe7fc('0x18')&&typeof _0x5ce83f[_0xe7fc('0x19')]==='undefined';var _0x552429=_0x4da73b['count'];var _0x4aa4f0=_0x1302e5?0x0:_0x5ce83f['offset'];var _0x490a99=_0x1302e5?_0x4da73b[_0xe7fc('0x1a')]:_0x5ce83f['offset']+_0x5ce83f[_0xe7fc('0x19')];var _0xb43fde;if(_0x490a99>=_0x552429){_0x490a99=_0x552429;_0xb43fde=0xc8;}else{_0xb43fde=0xce;}_0x272cd5[_0xe7fc('0x16')](_0xb43fde);return _0x272cd5[_0xe7fc('0x1b')](_0xe7fc('0x1c'),_0x4aa4f0+'-'+_0x490a99+'/'+_0x552429)[_0xe7fc('0x1d')](_0x4da73b);}return null;};}function patchUpdates(_0x329051){return function(_0x763103){try{jsonpatch['apply'](_0x763103,_0x329051,!![]);}catch(_0x39c75a){return BPromise[_0xe7fc('0x1e')](_0x39c75a);}return _0x763103['save']();};}function saveUpdates(_0x587dee,_0x35bb53){return function(_0x3c31e7){if(_0x3c31e7){return _0x3c31e7[_0xe7fc('0x1f')](_0x587dee)[_0xe7fc('0x20')](function(_0x26977a){return _0x26977a;});}return null;};}function removeEntity(_0x11c5a3,_0x3f850f){return function(_0x1731b6){if(_0x1731b6){return _0x1731b6[_0xe7fc('0x21')]()[_0xe7fc('0x20')](function(){_0x11c5a3[_0xe7fc('0x16')](0xcc)[_0xe7fc('0x15')]();});}};}function handleEntityNotFound(_0x12ebdd,_0x5255b7){return function(_0x2d9e77){if(!_0x2d9e77){_0x12ebdd[_0xe7fc('0x22')](0x194);}return _0x2d9e77;};}function handleError(_0x416464,_0x3be1fd){_0x3be1fd=_0x3be1fd||0x1f4;return function(_0x2249ed){logger[_0xe7fc('0x23')](_0x2249ed['stack']);if(_0x2249ed[_0xe7fc('0x24')]){delete _0x2249ed[_0xe7fc('0x24')];}_0x416464[_0xe7fc('0x16')](_0x3be1fd)[_0xe7fc('0x25')](_0x2249ed);};}exports[_0xe7fc('0x26')]=function(_0x4416b5,_0x383ca6){var _0x4da084={'raw':!![],'where':{'id':_0x4416b5[_0xe7fc('0x27')]['id']}},_0x36a68b={};_0x36a68b['model']=_[_0xe7fc('0x28')](db['ChatApplication'][_0xe7fc('0x29')]);_0x36a68b[_0xe7fc('0x2a')]=_['keys'](_0x4416b5[_0xe7fc('0x2a')]);_0x36a68b['filters']=_[_0xe7fc('0x2b')](_0x36a68b[_0xe7fc('0x2c')],_0x36a68b[_0xe7fc('0x2a')]);_0x4da084['attributes']=_[_0xe7fc('0x2b')](_0x36a68b['model'],qs[_0xe7fc('0x2d')](_0x4416b5[_0xe7fc('0x2a')]['fields']));_0x4da084['attributes']=_0x4da084['attributes']['length']?_0x4da084[_0xe7fc('0x2e')]:_0x36a68b[_0xe7fc('0x2c')];if(_0x4416b5[_0xe7fc('0x2a')][_0xe7fc('0x2f')]){_0x4da084[_0xe7fc('0x30')]=[{'all':!![]}];}_0x4da084=_[_0xe7fc('0x31')]({},_0x4da084,_0x4416b5[_0xe7fc('0x32')]);return db[_0xe7fc('0x33')][_0xe7fc('0x34')](_0x4da084)[_0xe7fc('0x20')](handleEntityNotFound(_0x383ca6,null))['then'](respondWithResult(_0x383ca6,null))[_0xe7fc('0x35')](handleError(_0x383ca6,null));};exports[_0xe7fc('0x1f')]=function(_0x1d8d62,_0x266856){if(_0x1d8d62[_0xe7fc('0x36')]['id']){delete _0x1d8d62['body']['id'];}return db[_0xe7fc('0x33')][_0xe7fc('0x34')]({'where':{'id':_0x1d8d62[_0xe7fc('0x27')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x266856,null))[_0xe7fc('0x20')](saveUpdates(_0x1d8d62[_0xe7fc('0x36')],null))[_0xe7fc('0x20')](respondWithResult(_0x266856,null))[_0xe7fc('0x35')](handleError(_0x266856,null));};exports[_0xe7fc('0x21')]=function(_0xb0e7b2,_0x1bb010){return db[_0xe7fc('0x33')]['find']({'where':{'id':_0xb0e7b2[_0xe7fc('0x27')]['id']}})[_0xe7fc('0x20')](handleEntityNotFound(_0x1bb010,null))[_0xe7fc('0x20')](removeEntity(_0x1bb010,null))[_0xe7fc('0x35')](handleError(_0x1bb010,null));};
\ No newline at end of file
index a8c2db4..b3bda6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a30=['util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4','lodash'];(function(_0x2a5d6f,_0x17aa81){var _0x3fe1b4=function(_0x5681be){while(--_0x5681be){_0x2a5d6f['push'](_0x2a5d6f['shift']());}};_0x3fe1b4(++_0x17aa81);}(_0x8a30,0x1a1));var _0x08a3=function(_0x102e14,_0x59557f){_0x102e14=_0x102e14-0x0;var _0x3bea50=_0x8a30[_0x102e14];return _0x3bea50;};'use strict';var _=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var logger=require('../../config/logger')(_0x08a3('0x2'));var moment=require(_0x08a3('0x3'));var BPromise=require(_0x08a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x08a3('0x5'));var config=require(_0x08a3('0x6'));var attributes=require(_0x08a3('0x7'));module['exports']=function(_0xddad70,_0x5d969b){return _0xddad70[_0x08a3('0x8')](_0x08a3('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x08a3('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9f40=['bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9f40,0xc0));var _0x09f4=function(_0x14e57c,_0x5741dd){_0x14e57c=_0x14e57c-0x0;var _0x162915=_0x9f40[_0x14e57c];return _0x162915;};'use strict';var _=require('lodash');var util=require(_0x09f4('0x0'));var logger=require(_0x09f4('0x1'))(_0x09f4('0x2'));var moment=require('moment');var BPromise=require(_0x09f4('0x3'));var rp=require(_0x09f4('0x4'));var fs=require('fs');var path=require(_0x09f4('0x5'));var rimraf=require(_0x09f4('0x6'));var config=require(_0x09f4('0x7'));var attributes=require(_0x09f4('0x8'));module[_0x09f4('0x9')]=function(_0x56d06d,_0x419ceb){return _0x56d06d[_0x09f4('0xa')](_0x09f4('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x09f4('0xc')});};
\ No newline at end of file
index b5e4ce6..49b17d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6569=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x501502,_0x6e4f2a){var _0x4150c2=function(_0x527b4c){while(--_0x527b4c){_0x501502['push'](_0x501502['shift']());}};_0x4150c2(++_0x6e4f2a);}(_0x6569,0x1bd));var _0x9656=function(_0x10c93a,_0x296716){_0x10c93a=_0x10c93a-0x0;var _0x1e300f=_0x6569[_0x10c93a];return _0x1e300f;};'use strict';var _=require(_0x9656('0x0'));var util=require(_0x9656('0x1'));var moment=require('moment');var BPromise=require(_0x9656('0x2'));var rs=require(_0x9656('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9656('0x4'));var logger=require(_0x9656('0x5'))(_0x9656('0x6'));var config=require(_0x9656('0x7'));var jayson=require(_0x9656('0x8'));var client=jayson[_0x9656('0x9')][_0x9656('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb38a58,_0x4630dd,_0x4dfcdd){return new BPromise(function(_0x26c437,_0x131b21){return client[_0x9656('0xb')](_0xb38a58,_0x4dfcdd)[_0x9656('0xc')](function(_0x1e4cb6){logger['info'](_0x9656('0xd'),_0x4630dd,_0x9656('0xe'));logger['debug'](_0x9656('0xf'),_0x4630dd,'request\x20sent',JSON['stringify'](_0x1e4cb6));if(_0x1e4cb6[_0x9656('0x10')]){if(_0x1e4cb6[_0x9656('0x10')]['code']===0x1f4){logger[_0x9656('0x10')]('ChatApplication,\x20%s,\x20%s',_0x4630dd,_0x1e4cb6[_0x9656('0x10')][_0x9656('0x11')]);return _0x131b21(_0x1e4cb6[_0x9656('0x10')]['message']);}logger[_0x9656('0x10')](_0x9656('0xd'),_0x4630dd,_0x1e4cb6[_0x9656('0x10')][_0x9656('0x11')]);return _0x26c437(_0x1e4cb6['error']['message']);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x4630dd,'request\x20sent');_0x26c437(_0x1e4cb6[_0x9656('0x12')][_0x9656('0x11')]);}})['catch'](function(_0x504e63){logger[_0x9656('0x10')]('ChatApplication,\x20%s,\x20%s',_0x4630dd,_0x504e63);_0x131b21(_0x504e63);});});}
\ No newline at end of file
+var _0xbde0=['catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0xf51b8e,_0x3686a3){var _0x39536c=function(_0x1b705c){while(--_0x1b705c){_0xf51b8e['push'](_0xf51b8e['shift']());}};_0x39536c(++_0x3686a3);}(_0xbde0,0x1ef));var _0x0bde=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xbde0[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x0bde('0x0'));var util=require('util');var moment=require(_0x0bde('0x1'));var BPromise=require('bluebird');var rs=require(_0x0bde('0x2'));var fs=require('fs');var Redis=require(_0x0bde('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0bde('0x4'))(_0x0bde('0x5'));var config=require(_0x0bde('0x6'));var jayson=require(_0x0bde('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d3a2c,_0x2445d6,_0xeeb62a){return new BPromise(function(_0x59bf26,_0x10e80a){return client['request'](_0x2d3a2c,_0xeeb62a)['then'](function(_0x47d336){logger['info'](_0x0bde('0x8'),_0x2445d6,_0x0bde('0x9'));logger[_0x0bde('0xa')](_0x0bde('0xb'),_0x2445d6,_0x0bde('0x9'),JSON[_0x0bde('0xc')](_0x47d336));if(_0x47d336[_0x0bde('0xd')]){if(_0x47d336[_0x0bde('0xd')][_0x0bde('0xe')]===0x1f4){logger[_0x0bde('0xd')](_0x0bde('0x8'),_0x2445d6,_0x47d336[_0x0bde('0xd')]['message']);return _0x10e80a(_0x47d336[_0x0bde('0xd')]['message']);}logger[_0x0bde('0xd')](_0x0bde('0x8'),_0x2445d6,_0x47d336[_0x0bde('0xd')][_0x0bde('0xf')]);return _0x59bf26(_0x47d336[_0x0bde('0xd')][_0x0bde('0xf')]);}else{logger[_0x0bde('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2445d6,'request\x20sent');_0x59bf26(_0x47d336[_0x0bde('0x11')][_0x0bde('0xf')]);}})[_0x0bde('0x12')](function(_0x32efa0){logger[_0x0bde('0xd')](_0x0bde('0x8'),_0x2445d6,_0x32efa0);_0x10e80a(_0x32efa0);});});}
\ No newline at end of file
index 1cfdbef..9f3c272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1faf=['../../config/environment','./chatApplication.controller','get','put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4c51bf,_0x25d9a3){var _0x54fe43=function(_0x54f771){while(--_0x54f771){_0x4c51bf['push'](_0x4c51bf['shift']());}};_0x54fe43(++_0x25d9a3);}(_0x1faf,0x1c9));var _0xf1fa=function(_0x25ac99,_0x41d5ca){_0x25ac99=_0x25ac99-0x0;var _0x39436c=_0x1faf[_0x25ac99];return _0x39436c;};'use strict';var multer=require(_0xf1fa('0x0'));var util=require(_0xf1fa('0x1'));var path=require(_0xf1fa('0x2'));var timeout=require(_0xf1fa('0x3'));var express=require(_0xf1fa('0x4'));var router=express[_0xf1fa('0x5')]();var fs_extra=require(_0xf1fa('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf1fa('0x7'));var controller=require(_0xf1fa('0x8'));router[_0xf1fa('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf1fa('0xa')](_0xf1fa('0xb'),auth[_0xf1fa('0xc')](),controller[_0xf1fa('0xd')]);router[_0xf1fa('0xe')](_0xf1fa('0xb'),auth[_0xf1fa('0xc')](),controller[_0xf1fa('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xfe6d=['./chatApplication.controller','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x331a47,_0x3e4a6e){var _0x498008=function(_0x31b716){while(--_0x31b716){_0x331a47['push'](_0x331a47['shift']());}};_0x498008(++_0x3e4a6e);}(_0xfe6d,0x178));var _0xdfe6=function(_0xc6b104,_0x1d805a){_0xc6b104=_0xc6b104-0x0;var _0x1c6fce=_0xfe6d[_0xc6b104];return _0x1c6fce;};'use strict';var multer=require(_0xdfe6('0x0'));var util=require('util');var path=require(_0xdfe6('0x1'));var timeout=require(_0xdfe6('0x2'));var express=require(_0xdfe6('0x3'));var router=express[_0xdfe6('0x4')]();var fs_extra=require(_0xdfe6('0x5'));var auth=require(_0xdfe6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdfe6('0x7'));var controller=require(_0xdfe6('0x8'));router['get'](_0xdfe6('0x9'),auth[_0xdfe6('0xa')](),controller['show']);router[_0xdfe6('0xb')](_0xdfe6('0x9'),auth['isAuthenticated'](),controller[_0xdfe6('0xc')]);router[_0xdfe6('0xd')](_0xdfe6('0x9'),auth[_0xdfe6('0xa')](),controller[_0xdfe6('0xe')]);module[_0xdfe6('0xf')]=router;
\ No newline at end of file
index c0ff12e..863bab0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1805=['STRING','exports'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x1805,0x1bf));var _0x5180=function(_0x2349f2,_0xf53a18){_0x2349f2=_0x2349f2-0x0;var _0x2eda81=_0x1805[_0x2349f2];return _0x2eda81;};'use strict';var Sequelize=require('sequelize');module[_0x5180('0x0')]={'name':{'type':Sequelize[_0x5180('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5180('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x195f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x195f,0x113));var _0xf195=function(_0x15106b,_0x4d96f6){_0x15106b=_0x15106b-0x0;var _0x521203=_0x195f[_0x15106b];return _0x521203;};'use strict';var Sequelize=require(_0xf195('0x0'));module[_0xf195('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf195('0x2')]},'write':{'type':Sequelize[_0xf195('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 1d68439..a473d7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfd5=['YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','ChatGroup','fieldName','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','findOne','User','length','pick','getMembers','removeMembers','addMessage','ChatGroupId','$gte','split','format'];(function(_0x936f18,_0x110725){var _0x36b3b7=function(_0x5cd86b){while(--_0x5cd86b){_0x936f18['push'](_0x936f18['shift']());}};_0x36b3b7(++_0x110725);}(_0xdfd5,0x137));var _0x5dfd=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xdfd5[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x5dfd('0x0'));var rimraf=require(_0x5dfd('0x1'));var zipdir=require(_0x5dfd('0x2'));var jsonpatch=require(_0x5dfd('0x3'));var rp=require('request-promise');var moment=require(_0x5dfd('0x4'));var BPromise=require(_0x5dfd('0x5'));var Mustache=require(_0x5dfd('0x6'));var util=require(_0x5dfd('0x7'));var path=require('path');var sox=require(_0x5dfd('0x8'));var csv=require(_0x5dfd('0x9'));var ejs=require(_0x5dfd('0xa'));var fs=require('fs');var fs_extra=require(_0x5dfd('0xb'));var _=require('lodash');var squel=require(_0x5dfd('0xc'));var crypto=require('crypto');var jsforce=require(_0x5dfd('0xd'));var deskjs=require(_0x5dfd('0xe'));var toCsv=require(_0x5dfd('0x9'));var querystring=require(_0x5dfd('0xf'));var Papa=require(_0x5dfd('0x10'));var Redis=require(_0x5dfd('0x11'));var authService=require(_0x5dfd('0x12'));var qs=require(_0x5dfd('0x13'));var as=require(_0x5dfd('0x14'));var hardwareService=require(_0x5dfd('0x15'));var logger=require('../../config/logger')(_0x5dfd('0x16'));var utils=require(_0x5dfd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5dfd('0x18'));var db=require(_0x5dfd('0x19'))['db'];config[_0x5dfd('0x1a')]=_[_0x5dfd('0x1b')](config[_0x5dfd('0x1a')],{'host':_0x5dfd('0x1c'),'port':0x18eb});var socket=require(_0x5dfd('0x1d'))(new Redis(config[_0x5dfd('0x1a')]));require(_0x5dfd('0x1e'))[_0x5dfd('0x1f')](socket);function respondWithStatusCode(_0x36eff7,_0x12700c){_0x12700c=_0x12700c||0xcc;return function(_0x5b3e81){if(_0x5b3e81){return _0x36eff7[_0x5dfd('0x20')](_0x12700c);}return _0x36eff7['status'](_0x12700c)[_0x5dfd('0x21')]();};}function respondWithResult(_0x573f0a,_0x388b90){_0x388b90=_0x388b90||0xc8;return function(_0x3a2eb2){if(_0x3a2eb2){return _0x573f0a[_0x5dfd('0x22')](_0x388b90)['json'](_0x3a2eb2);}};}function respondWithFilteredResult(_0x5475d3,_0x377220){return function(_0x57b700){if(_0x57b700){var _0x3c0fe0=typeof _0x377220[_0x5dfd('0x23')]===_0x5dfd('0x24')&&typeof _0x377220['limit']===_0x5dfd('0x24');var _0x41e70c=_0x57b700[_0x5dfd('0x25')];var _0x3f6464=_0x3c0fe0?0x0:_0x377220['offset'];var _0x17d134=_0x3c0fe0?_0x57b700['count']:_0x377220[_0x5dfd('0x23')]+_0x377220[_0x5dfd('0x26')];var _0x361121;if(_0x17d134>=_0x41e70c){_0x17d134=_0x41e70c;_0x361121=0xc8;}else{_0x361121=0xce;}_0x5475d3[_0x5dfd('0x22')](_0x361121);return _0x5475d3[_0x5dfd('0x27')](_0x5dfd('0x28'),_0x3f6464+'-'+_0x17d134+'/'+_0x41e70c)[_0x5dfd('0x29')](_0x57b700);}return null;};}function patchUpdates(_0x2bacb8){return function(_0x13987e){try{jsonpatch[_0x5dfd('0x2a')](_0x13987e,_0x2bacb8,!![]);}catch(_0x1f031d){return BPromise[_0x5dfd('0x2b')](_0x1f031d);}return _0x13987e[_0x5dfd('0x2c')]();};}function saveUpdates(_0x47ce8f,_0x237278){return function(_0x4a41d8){if(_0x4a41d8){return _0x4a41d8[_0x5dfd('0x2d')](_0x47ce8f)['then'](function(_0x5c79b7){return _0x5c79b7;});}return null;};}function removeEntity(_0x4fbf82,_0x1a296c){return function(_0x4c7f3c){if(_0x4c7f3c){return _0x4c7f3c[_0x5dfd('0x2e')]()[_0x5dfd('0x2f')](function(){_0x4fbf82[_0x5dfd('0x22')](0xcc)[_0x5dfd('0x21')]();});}};}function handleEntityNotFound(_0x49964d,_0x229d16){return function(_0x39d07c){if(!_0x39d07c){_0x49964d[_0x5dfd('0x20')](0x194);}return _0x39d07c;};}function handleError(_0x40a624,_0x46d9a5){_0x46d9a5=_0x46d9a5||0x1f4;return function(_0x26f1e3){logger[_0x5dfd('0x30')](_0x26f1e3[_0x5dfd('0x31')]);if(_0x26f1e3[_0x5dfd('0x32')]){delete _0x26f1e3['name'];}_0x40a624[_0x5dfd('0x22')](_0x46d9a5)[_0x5dfd('0x33')](_0x26f1e3);};}exports[_0x5dfd('0x34')]=function(_0x11821e,_0xe6baed){var _0x5bfa8b={},_0x24b8d9={},_0x4090eb={'count':0x0,'rows':[]};var _0x3aaf55=_[_0x5dfd('0x35')](db[_0x5dfd('0x36')]['rawAttributes'],function(_0x310c7e){return{'name':_0x310c7e[_0x5dfd('0x37')],'type':_0x310c7e[_0x5dfd('0x38')]['key']};});_0x24b8d9['model']=_[_0x5dfd('0x35')](_0x3aaf55,'name');_0x24b8d9['query']=_[_0x5dfd('0x39')](_0x11821e[_0x5dfd('0x3a')]);_0x24b8d9[_0x5dfd('0x3b')]=_[_0x5dfd('0x3c')](_0x24b8d9[_0x5dfd('0x3d')],_0x24b8d9[_0x5dfd('0x3a')]);_0x5bfa8b[_0x5dfd('0x3e')]=_[_0x5dfd('0x3c')](_0x24b8d9[_0x5dfd('0x3d')],qs['fields'](_0x11821e[_0x5dfd('0x3a')][_0x5dfd('0x3f')]));_0x5bfa8b['attributes']=_0x5bfa8b[_0x5dfd('0x3e')]['length']?_0x5bfa8b[_0x5dfd('0x3e')]:_0x24b8d9[_0x5dfd('0x3d')];if(!_0x11821e['query'][_0x5dfd('0x40')](_0x5dfd('0x41'))){_0x5bfa8b[_0x5dfd('0x26')]=qs[_0x5dfd('0x26')](_0x11821e[_0x5dfd('0x3a')][_0x5dfd('0x26')]);_0x5bfa8b[_0x5dfd('0x23')]=qs[_0x5dfd('0x23')](_0x11821e[_0x5dfd('0x3a')][_0x5dfd('0x23')]);}_0x5bfa8b[_0x5dfd('0x42')]=qs[_0x5dfd('0x43')](_0x11821e[_0x5dfd('0x3a')]['sort']);_0x5bfa8b[_0x5dfd('0x44')]=qs[_0x5dfd('0x3b')](_['pick'](_0x11821e[_0x5dfd('0x3a')],_0x24b8d9[_0x5dfd('0x3b')]),_0x3aaf55);if(_0x11821e['query'][_0x5dfd('0x45')]){_0x5bfa8b[_0x5dfd('0x44')]=_[_0x5dfd('0x46')](_0x5bfa8b[_0x5dfd('0x44')],{'$or':_[_0x5dfd('0x35')](_0x3aaf55,function(_0x68c9af){if(_0x68c9af[_0x5dfd('0x38')]!=='VIRTUAL'){var _0x34350c={};_0x34350c[_0x68c9af[_0x5dfd('0x32')]]={'$like':'%'+_0x11821e['query'][_0x5dfd('0x45')]+'%'};return _0x34350c;}})});}_0x5bfa8b=_[_0x5dfd('0x46')]({},_0x5bfa8b,_0x11821e['options']);var _0x3c2b4b={'where':_0x5bfa8b[_0x5dfd('0x44')]};return db[_0x5dfd('0x36')]['count'](_0x3c2b4b)[_0x5dfd('0x2f')](function(_0x5f4054){_0x4090eb[_0x5dfd('0x25')]=_0x5f4054;if(_0x11821e['query'][_0x5dfd('0x47')]){_0x5bfa8b[_0x5dfd('0x48')]=[{'all':!![]}];}return db[_0x5dfd('0x36')][_0x5dfd('0x49')](_0x5bfa8b);})[_0x5dfd('0x2f')](function(_0x3be82b){_0x4090eb[_0x5dfd('0x4a')]=_0x3be82b;return _0x4090eb;})[_0x5dfd('0x2f')](respondWithFilteredResult(_0xe6baed,_0x5bfa8b))[_0x5dfd('0x4b')](handleError(_0xe6baed,null));};exports[_0x5dfd('0x4c')]=function(_0x2a9e38,_0x27a90b){var _0x41d64f={'raw':!![],'where':{'id':_0x2a9e38[_0x5dfd('0x4d')]['id']}},_0x5965a2={};_0x5965a2[_0x5dfd('0x3d')]=_[_0x5dfd('0x39')](db[_0x5dfd('0x36')][_0x5dfd('0x4e')]);_0x5965a2[_0x5dfd('0x3a')]=_[_0x5dfd('0x39')](_0x2a9e38[_0x5dfd('0x3a')]);_0x5965a2[_0x5dfd('0x3b')]=_[_0x5dfd('0x3c')](_0x5965a2[_0x5dfd('0x3d')],_0x5965a2[_0x5dfd('0x3a')]);_0x41d64f[_0x5dfd('0x3e')]=_[_0x5dfd('0x3c')](_0x5965a2[_0x5dfd('0x3d')],qs[_0x5dfd('0x3f')](_0x2a9e38[_0x5dfd('0x3a')]['fields']));_0x41d64f['attributes']=_0x41d64f['attributes']['length']?_0x41d64f[_0x5dfd('0x3e')]:_0x5965a2[_0x5dfd('0x3d')];if(_0x2a9e38[_0x5dfd('0x3a')][_0x5dfd('0x47')]){_0x41d64f[_0x5dfd('0x48')]=[{'all':!![]}];}_0x41d64f=_[_0x5dfd('0x46')]({},_0x41d64f,_0x2a9e38[_0x5dfd('0x4f')]);return db[_0x5dfd('0x36')][_0x5dfd('0x50')](_0x41d64f)['then'](handleEntityNotFound(_0x27a90b,null))['then'](respondWithResult(_0x27a90b,null))[_0x5dfd('0x4b')](handleError(_0x27a90b,null));};exports[_0x5dfd('0x51')]=function(_0x37951,_0x230c49){return db[_0x5dfd('0x36')][_0x5dfd('0x51')](_0x37951['body'],{})['then'](respondWithResult(_0x230c49,0xc9))['catch'](handleError(_0x230c49,null));};exports[_0x5dfd('0x2d')]=function(_0x7d1728,_0x514b3f){if(_0x7d1728[_0x5dfd('0x52')]['id']){delete _0x7d1728[_0x5dfd('0x52')]['id'];}return db[_0x5dfd('0x36')][_0x5dfd('0x50')]({'where':{'id':_0x7d1728['params']['id']}})[_0x5dfd('0x2f')](handleEntityNotFound(_0x514b3f,null))[_0x5dfd('0x2f')](saveUpdates(_0x7d1728['body'],null))[_0x5dfd('0x2f')](respondWithResult(_0x514b3f,null))[_0x5dfd('0x4b')](handleError(_0x514b3f,null));};exports[_0x5dfd('0x2e')]=function(_0xdcd72d,_0x5e95f8){return db[_0x5dfd('0x36')][_0x5dfd('0x50')]({'where':{'id':_0xdcd72d[_0x5dfd('0x4d')]['id']}})[_0x5dfd('0x2f')](handleEntityNotFound(_0x5e95f8,null))[_0x5dfd('0x2f')](removeEntity(_0x5e95f8,null))['catch'](handleError(_0x5e95f8,null));};exports[_0x5dfd('0x53')]=function(_0x5c37fb,_0x4f7ee6){return db[_0x5dfd('0x36')][_0x5dfd('0x53')]()[_0x5dfd('0x2f')](respondWithResult(_0x4f7ee6,null))[_0x5dfd('0x4b')](handleError(_0x4f7ee6,null));};exports['getUnread']=function(_0xa92ea0,_0x203f60,_0x7b6adf){return db[_0x5dfd('0x54')][_0x5dfd('0x25')]({'where':{'ChatGroupId':_0xa92ea0[_0x5dfd('0x4d')]['id'],'ToId':_0xa92ea0[_0x5dfd('0x55')]['id'],'read':![]}})[_0x5dfd('0x2f')](function(_0x4c0b4d){return{'id':_[_0x5dfd('0x56')](_0xa92ea0[_0x5dfd('0x4d')]['id']),'count':_0x4c0b4d};})[_0x5dfd('0x2f')](respondWithResult(_0x203f60,null))[_0x5dfd('0x4b')](handleError(_0x203f60,null));};exports[_0x5dfd('0x57')]=function(_0x13e927,_0x5a8ef7,_0x5eb4c5){return db['ChatGroup'][_0x5dfd('0x50')]({'where':{'id':_0x13e927[_0x5dfd('0x4d')]['id']}})[_0x5dfd('0x2f')](handleEntityNotFound(_0x5a8ef7,null))[_0x5dfd('0x2f')](function(_0x2deda6){if(_0x2deda6){return _0x2deda6[_0x5dfd('0x57')](_0x13e927['body'][_0x5dfd('0x58')],_[_0x5dfd('0x59')](_0x13e927[_0x5dfd('0x52')],[_0x5dfd('0x58'),'id'])||{});}})[_0x5dfd('0x2f')](respondWithResult(_0x5a8ef7,null))[_0x5dfd('0x4b')](handleError(_0x5a8ef7,null));};exports['getMembers']=function(_0x47c1dd,_0x583018,_0xdcdad2){var _0x12ff6d={};var _0x4660c5={};var _0x300e4b;var _0x57cfa4;return db[_0x5dfd('0x36')][_0x5dfd('0x5a')]({'where':{'id':_0x47c1dd[_0x5dfd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x583018,null))['then'](function(_0x522eec){if(_0x522eec){_0x300e4b=_0x522eec;_0x4660c5[_0x5dfd('0x3d')]=_[_0x5dfd('0x39')](db[_0x5dfd('0x5b')]['rawAttributes']);_0x4660c5[_0x5dfd('0x3a')]=_[_0x5dfd('0x39')](_0x47c1dd[_0x5dfd('0x3a')]);_0x4660c5['filters']=_[_0x5dfd('0x3c')](_0x4660c5[_0x5dfd('0x3d')],_0x4660c5[_0x5dfd('0x3a')]);_0x12ff6d[_0x5dfd('0x3e')]=_['intersection'](_0x4660c5[_0x5dfd('0x3d')],qs[_0x5dfd('0x3f')](_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x3f')]));_0x12ff6d[_0x5dfd('0x3e')]=_0x12ff6d[_0x5dfd('0x3e')][_0x5dfd('0x5c')]?_0x12ff6d[_0x5dfd('0x3e')]:_0x4660c5[_0x5dfd('0x3d')];_0x12ff6d['order']=qs[_0x5dfd('0x43')](_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x43')]);_0x12ff6d['where']=qs[_0x5dfd('0x3b')](_[_0x5dfd('0x5d')](_0x47c1dd[_0x5dfd('0x3a')],_0x4660c5['filters']));if(_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x45')]){_0x12ff6d[_0x5dfd('0x44')]=_[_0x5dfd('0x46')](_0x12ff6d[_0x5dfd('0x44')],{'$or':_[_0x5dfd('0x35')](_0x12ff6d['attributes'],function(_0x4632e8){var _0x3cadbf={};_0x3cadbf[_0x4632e8]={'$like':'%'+_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x45')]+'%'};return _0x3cadbf;})});}_0x12ff6d=_[_0x5dfd('0x46')]({},_0x12ff6d,_0x47c1dd[_0x5dfd('0x4f')]);return _0x300e4b[_0x5dfd('0x5e')](_0x12ff6d);}})[_0x5dfd('0x2f')](function(_0x11a893){if(_0x11a893){_0x57cfa4=_0x11a893[_0x5dfd('0x5c')];if(!_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x40')](_0x5dfd('0x41'))){_0x12ff6d[_0x5dfd('0x26')]=qs[_0x5dfd('0x26')](_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x26')]);_0x12ff6d[_0x5dfd('0x23')]=qs[_0x5dfd('0x23')](_0x47c1dd[_0x5dfd('0x3a')][_0x5dfd('0x23')]);}return _0x300e4b['getMembers'](_0x12ff6d);}})[_0x5dfd('0x2f')](function(_0x3010b9){if(_0x3010b9){return _0x3010b9?{'count':_0x57cfa4,'rows':_0x3010b9}:null;}})[_0x5dfd('0x2f')](respondWithResult(_0x583018,null))[_0x5dfd('0x4b')](handleError(_0x583018,null));};exports[_0x5dfd('0x5f')]=function(_0x4faf0d,_0x60fffa,_0x3a9b8e){return db[_0x5dfd('0x36')][_0x5dfd('0x50')]({'where':{'id':_0x4faf0d[_0x5dfd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x60fffa,null))[_0x5dfd('0x2f')](function(_0x3fed4f){if(_0x3fed4f){return _0x3fed4f[_0x5dfd('0x5f')](_0x4faf0d[_0x5dfd('0x3a')][_0x5dfd('0x58')]);}})[_0x5dfd('0x2f')](respondWithStatusCode(_0x60fffa,null))[_0x5dfd('0x4b')](handleError(_0x60fffa,null));};exports[_0x5dfd('0x60')]=function(_0x151b8,_0x455a32,_0xc4ed05){if(_0x151b8['body']['id']){delete _0x151b8[_0x5dfd('0x52')]['id'];}return db[_0x5dfd('0x36')][_0x5dfd('0x50')]({'where':{'id':_0x151b8[_0x5dfd('0x4d')]['id']}})[_0x5dfd('0x2f')](handleEntityNotFound(_0x455a32,null))[_0x5dfd('0x2f')](function(_0x3004db){if(_0x3004db){_0x151b8['body'][_0x5dfd('0x61')]=_0x3004db['id'];return db[_0x5dfd('0x54')][_0x5dfd('0x51')](_0x151b8['body']);}})[_0x5dfd('0x2f')](respondWithResult(_0x455a32,null))[_0x5dfd('0x4b')](handleError(_0x455a32,null));};exports['getMessages']=function(_0x275d1a,_0x5c60fb,_0xe2a169){var _0x3de52b={};var _0x4cae30={};var _0x304fa2;var _0x12e161;return db[_0x5dfd('0x36')][_0x5dfd('0x5a')]({'where':{'id':_0x275d1a[_0x5dfd('0x4d')]['id']}})[_0x5dfd('0x2f')](handleEntityNotFound(_0x5c60fb,null))[_0x5dfd('0x2f')](function(_0x28ebc3){if(_0x28ebc3){_0x304fa2=_0x28ebc3;_0x4cae30[_0x5dfd('0x3d')]=_[_0x5dfd('0x39')](db['ChatInternalMessage'][_0x5dfd('0x4e')]);_0x4cae30[_0x5dfd('0x3a')]=_['keys'](_0x275d1a[_0x5dfd('0x3a')]);_0x4cae30[_0x5dfd('0x3b')]=_['intersection'](_0x4cae30[_0x5dfd('0x3d')],_0x4cae30[_0x5dfd('0x3a')]);_0x3de52b[_0x5dfd('0x3e')]=_[_0x5dfd('0x3c')](_0x4cae30['model'],qs[_0x5dfd('0x3f')](_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x3f')]));_0x3de52b[_0x5dfd('0x3e')]=_0x3de52b[_0x5dfd('0x3e')][_0x5dfd('0x5c')]?_0x3de52b['attributes']:_0x4cae30['model'];_0x3de52b['order']=qs[_0x5dfd('0x43')](_0x275d1a['query'][_0x5dfd('0x43')]);_0x3de52b[_0x5dfd('0x44')]=qs[_0x5dfd('0x3b')](_[_0x5dfd('0x5d')](_0x275d1a['query'],_0x4cae30[_0x5dfd('0x3b')]));if(_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x45')]){_0x3de52b[_0x5dfd('0x44')]=_[_0x5dfd('0x46')](_0x3de52b[_0x5dfd('0x44')],{'$or':_['map'](_0x3de52b['attributes'],function(_0x322f64){var _0x1d058d={};_0x1d058d[_0x322f64]={'$like':'%'+_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x45')]+'%'};return _0x1d058d;})});}if(_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x62')]){var _0x38d440=_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x62')][_0x5dfd('0x63')](',');var _0xe58f46={};_0xe58f46[_0x38d440[0x0]]={'$gte':moment(_0x38d440[0x1])[_0x5dfd('0x64')](_0x5dfd('0x65'))};_0x3de52b['where']=_[_0x5dfd('0x46')](_0x3de52b['where'],_0xe58f46);}_0x3de52b=_['merge']({},_0x3de52b,_0x275d1a['options']);return _0x304fa2[_0x5dfd('0x66')](_0x3de52b);}})['then'](function(_0x25c1ee){if(_0x25c1ee){_0x12e161=_0x25c1ee[_0x5dfd('0x5c')];if(!_0x275d1a['query']['hasOwnProperty'](_0x5dfd('0x41'))){_0x3de52b[_0x5dfd('0x26')]=qs[_0x5dfd('0x26')](_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x26')]);_0x3de52b[_0x5dfd('0x23')]=qs[_0x5dfd('0x23')](_0x275d1a[_0x5dfd('0x3a')][_0x5dfd('0x23')]);}return _0x304fa2[_0x5dfd('0x66')](_0x3de52b);}})[_0x5dfd('0x2f')](function(_0x5d4f03){if(_0x5d4f03){return _0x5d4f03?{'count':_0x12e161,'rows':_0x5d4f03}:null;}})['then'](respondWithResult(_0x5c60fb,null))[_0x5dfd('0x4b')](handleError(_0x5c60fb,null));};
\ No newline at end of file
+var _0x17ac=['name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','show','params','find','create','body','catch','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','pick','nolimit','removeMembers','addMessage','ChatGroupId','findOne','$gte','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x55738f,_0x595b6f){var _0x5f40b8=function(_0x390ee8){while(--_0x390ee8){_0x55738f['push'](_0x55738f['shift']());}};_0x5f40b8(++_0x595b6f);}(_0x17ac,0x15b));var _0xc17a=function(_0x4a2378,_0x14106e){_0x4a2378=_0x4a2378-0x0;var _0x1ce2e0=_0x17ac[_0x4a2378];return _0x1ce2e0;};'use strict';var emlformat=require(_0xc17a('0x0'));var rimraf=require(_0xc17a('0x1'));var zipdir=require(_0xc17a('0x2'));var jsonpatch=require(_0xc17a('0x3'));var rp=require(_0xc17a('0x4'));var moment=require(_0xc17a('0x5'));var BPromise=require(_0xc17a('0x6'));var Mustache=require('mustache');var util=require(_0xc17a('0x7'));var path=require('path');var sox=require(_0xc17a('0x8'));var csv=require('to-csv');var ejs=require(_0xc17a('0x9'));var fs=require('fs');var fs_extra=require(_0xc17a('0xa'));var _=require(_0xc17a('0xb'));var squel=require(_0xc17a('0xc'));var crypto=require('crypto');var jsforce=require(_0xc17a('0xd'));var deskjs=require(_0xc17a('0xe'));var toCsv=require(_0xc17a('0xf'));var querystring=require('querystring');var Papa=require(_0xc17a('0x10'));var Redis=require(_0xc17a('0x11'));var authService=require(_0xc17a('0x12'));var qs=require(_0xc17a('0x13'));var as=require(_0xc17a('0x14'));var hardwareService=require(_0xc17a('0x15'));var logger=require(_0xc17a('0x16'))(_0xc17a('0x17'));var utils=require('../../config/utils');var config=require(_0xc17a('0x18'));var licenseUtil=require(_0xc17a('0x19'));var db=require(_0xc17a('0x1a'))['db'];config[_0xc17a('0x1b')]=_[_0xc17a('0x1c')](config['redis'],{'host':_0xc17a('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc17a('0x1b')]));require(_0xc17a('0x1e'))[_0xc17a('0x1f')](socket);function respondWithStatusCode(_0x19ac39,_0x2169ef){_0x2169ef=_0x2169ef||0xcc;return function(_0x3fd0b0){if(_0x3fd0b0){return _0x19ac39[_0xc17a('0x20')](_0x2169ef);}return _0x19ac39['status'](_0x2169ef)[_0xc17a('0x21')]();};}function respondWithResult(_0x12b5c5,_0x190dfb){_0x190dfb=_0x190dfb||0xc8;return function(_0x569f0f){if(_0x569f0f){return _0x12b5c5['status'](_0x190dfb)[_0xc17a('0x22')](_0x569f0f);}};}function respondWithFilteredResult(_0x14071b,_0x1bb572){return function(_0x4a381f){if(_0x4a381f){var _0x2ee8c0=typeof _0x1bb572['offset']===_0xc17a('0x23')&&typeof _0x1bb572[_0xc17a('0x24')]==='undefined';var _0x3ecbbf=_0x4a381f[_0xc17a('0x25')];var _0x5d2def=_0x2ee8c0?0x0:_0x1bb572[_0xc17a('0x26')];var _0x19a6d5=_0x2ee8c0?_0x4a381f['count']:_0x1bb572['offset']+_0x1bb572[_0xc17a('0x24')];var _0x2a45b1;if(_0x19a6d5>=_0x3ecbbf){_0x19a6d5=_0x3ecbbf;_0x2a45b1=0xc8;}else{_0x2a45b1=0xce;}_0x14071b[_0xc17a('0x27')](_0x2a45b1);return _0x14071b[_0xc17a('0x28')](_0xc17a('0x29'),_0x5d2def+'-'+_0x19a6d5+'/'+_0x3ecbbf)[_0xc17a('0x22')](_0x4a381f);}return null;};}function patchUpdates(_0x6f3c14){return function(_0x40a483){try{jsonpatch[_0xc17a('0x2a')](_0x40a483,_0x6f3c14,!![]);}catch(_0x318282){return BPromise[_0xc17a('0x2b')](_0x318282);}return _0x40a483[_0xc17a('0x2c')]();};}function saveUpdates(_0x6c0067,_0x1ee001){return function(_0x2a8340){if(_0x2a8340){return _0x2a8340[_0xc17a('0x2d')](_0x6c0067)[_0xc17a('0x2e')](function(_0x25698){return _0x25698;});}return null;};}function removeEntity(_0x19698c,_0x404999){return function(_0x46c3a5){if(_0x46c3a5){return _0x46c3a5[_0xc17a('0x2f')]()['then'](function(){_0x19698c[_0xc17a('0x27')](0xcc)[_0xc17a('0x21')]();});}};}function handleEntityNotFound(_0x2b52e2,_0x218d01){return function(_0x298902){if(!_0x298902){_0x2b52e2[_0xc17a('0x20')](0x194);}return _0x298902;};}function handleError(_0x325005,_0x361e56){_0x361e56=_0x361e56||0x1f4;return function(_0x3aeda6){logger[_0xc17a('0x30')](_0x3aeda6['stack']);if(_0x3aeda6[_0xc17a('0x31')]){delete _0x3aeda6[_0xc17a('0x31')];}_0x325005[_0xc17a('0x27')](_0x361e56)[_0xc17a('0x32')](_0x3aeda6);};}exports[_0xc17a('0x33')]=function(_0x29f88d,_0x37be31){var _0x211a43={},_0x3fdf72={},_0x2fb060={'count':0x0,'rows':[]};var _0x614237=_['map'](db[_0xc17a('0x34')][_0xc17a('0x35')],function(_0x1a87d4){return{'name':_0x1a87d4[_0xc17a('0x36')],'type':_0x1a87d4[_0xc17a('0x37')][_0xc17a('0x38')]};});_0x3fdf72[_0xc17a('0x39')]=_[_0xc17a('0x3a')](_0x614237,'name');_0x3fdf72['query']=_[_0xc17a('0x3b')](_0x29f88d[_0xc17a('0x3c')]);_0x3fdf72['filters']=_[_0xc17a('0x3d')](_0x3fdf72['model'],_0x3fdf72[_0xc17a('0x3c')]);_0x211a43['attributes']=_['intersection'](_0x3fdf72[_0xc17a('0x39')],qs[_0xc17a('0x3e')](_0x29f88d[_0xc17a('0x3c')][_0xc17a('0x3e')]));_0x211a43[_0xc17a('0x3f')]=_0x211a43[_0xc17a('0x3f')][_0xc17a('0x40')]?_0x211a43[_0xc17a('0x3f')]:_0x3fdf72[_0xc17a('0x39')];if(!_0x29f88d[_0xc17a('0x3c')][_0xc17a('0x41')]('nolimit')){_0x211a43['limit']=qs['limit'](_0x29f88d[_0xc17a('0x3c')][_0xc17a('0x24')]);_0x211a43[_0xc17a('0x26')]=qs[_0xc17a('0x26')](_0x29f88d[_0xc17a('0x3c')][_0xc17a('0x26')]);}_0x211a43[_0xc17a('0x42')]=qs[_0xc17a('0x43')](_0x29f88d[_0xc17a('0x3c')][_0xc17a('0x43')]);_0x211a43[_0xc17a('0x44')]=qs[_0xc17a('0x45')](_['pick'](_0x29f88d[_0xc17a('0x3c')],_0x3fdf72[_0xc17a('0x45')]),_0x614237);if(_0x29f88d[_0xc17a('0x3c')]['filter']){_0x211a43['where']=_[_0xc17a('0x46')](_0x211a43[_0xc17a('0x44')],{'$or':_[_0xc17a('0x3a')](_0x614237,function(_0x19629b){if(_0x19629b[_0xc17a('0x37')]!==_0xc17a('0x47')){var _0x1ecd90={};_0x1ecd90[_0x19629b[_0xc17a('0x31')]]={'$like':'%'+_0x29f88d[_0xc17a('0x3c')][_0xc17a('0x48')]+'%'};return _0x1ecd90;}})});}_0x211a43=_['merge']({},_0x211a43,_0x29f88d[_0xc17a('0x49')]);var _0x5d41a5={'where':_0x211a43['where']};return db[_0xc17a('0x34')][_0xc17a('0x25')](_0x5d41a5)[_0xc17a('0x2e')](function(_0x153247){_0x2fb060[_0xc17a('0x25')]=_0x153247;if(_0x29f88d['query'][_0xc17a('0x4a')]){_0x211a43[_0xc17a('0x4b')]=[{'all':!![]}];}return db[_0xc17a('0x34')]['findAll'](_0x211a43);})['then'](function(_0x15b8e5){_0x2fb060['rows']=_0x15b8e5;return _0x2fb060;})['then'](respondWithFilteredResult(_0x37be31,_0x211a43))['catch'](handleError(_0x37be31,null));};exports[_0xc17a('0x4c')]=function(_0x3a4517,_0x43e569){var _0x2859ed={'raw':!![],'where':{'id':_0x3a4517[_0xc17a('0x4d')]['id']}},_0x4f5cf4={};_0x4f5cf4[_0xc17a('0x39')]=_[_0xc17a('0x3b')](db[_0xc17a('0x34')][_0xc17a('0x35')]);_0x4f5cf4[_0xc17a('0x3c')]=_['keys'](_0x3a4517[_0xc17a('0x3c')]);_0x4f5cf4[_0xc17a('0x45')]=_[_0xc17a('0x3d')](_0x4f5cf4[_0xc17a('0x39')],_0x4f5cf4[_0xc17a('0x3c')]);_0x2859ed[_0xc17a('0x3f')]=_[_0xc17a('0x3d')](_0x4f5cf4[_0xc17a('0x39')],qs[_0xc17a('0x3e')](_0x3a4517['query']['fields']));_0x2859ed[_0xc17a('0x3f')]=_0x2859ed[_0xc17a('0x3f')][_0xc17a('0x40')]?_0x2859ed['attributes']:_0x4f5cf4[_0xc17a('0x39')];if(_0x3a4517[_0xc17a('0x3c')][_0xc17a('0x4a')]){_0x2859ed[_0xc17a('0x4b')]=[{'all':!![]}];}_0x2859ed=_['merge']({},_0x2859ed,_0x3a4517[_0xc17a('0x49')]);return db[_0xc17a('0x34')][_0xc17a('0x4e')](_0x2859ed)[_0xc17a('0x2e')](handleEntityNotFound(_0x43e569,null))[_0xc17a('0x2e')](respondWithResult(_0x43e569,null))['catch'](handleError(_0x43e569,null));};exports[_0xc17a('0x4f')]=function(_0x126c1b,_0x34e0e0){return db[_0xc17a('0x34')][_0xc17a('0x4f')](_0x126c1b[_0xc17a('0x50')],{})[_0xc17a('0x2e')](respondWithResult(_0x34e0e0,0xc9))[_0xc17a('0x51')](handleError(_0x34e0e0,null));};exports[_0xc17a('0x2d')]=function(_0x3f29b4,_0x393023){if(_0x3f29b4[_0xc17a('0x50')]['id']){delete _0x3f29b4[_0xc17a('0x50')]['id'];}return db[_0xc17a('0x34')][_0xc17a('0x4e')]({'where':{'id':_0x3f29b4[_0xc17a('0x4d')]['id']}})[_0xc17a('0x2e')](handleEntityNotFound(_0x393023,null))[_0xc17a('0x2e')](saveUpdates(_0x3f29b4[_0xc17a('0x50')],null))[_0xc17a('0x2e')](respondWithResult(_0x393023,null))[_0xc17a('0x51')](handleError(_0x393023,null));};exports[_0xc17a('0x2f')]=function(_0x1c35d0,_0x9f8b5f){return db[_0xc17a('0x34')][_0xc17a('0x4e')]({'where':{'id':_0x1c35d0[_0xc17a('0x4d')]['id']}})[_0xc17a('0x2e')](handleEntityNotFound(_0x9f8b5f,null))[_0xc17a('0x2e')](removeEntity(_0x9f8b5f,null))[_0xc17a('0x51')](handleError(_0x9f8b5f,null));};exports[_0xc17a('0x52')]=function(_0x273636,_0x18e6dc){return db[_0xc17a('0x34')][_0xc17a('0x52')]()['then'](respondWithResult(_0x18e6dc,null))['catch'](handleError(_0x18e6dc,null));};exports[_0xc17a('0x53')]=function(_0x1b97e3,_0x280b26,_0x48bcd7){return db[_0xc17a('0x54')][_0xc17a('0x25')]({'where':{'ChatGroupId':_0x1b97e3[_0xc17a('0x4d')]['id'],'ToId':_0x1b97e3['user']['id'],'read':![]}})['then'](function(_0x5ab627){return{'id':_[_0xc17a('0x55')](_0x1b97e3[_0xc17a('0x4d')]['id']),'count':_0x5ab627};})[_0xc17a('0x2e')](respondWithResult(_0x280b26,null))['catch'](handleError(_0x280b26,null));};exports[_0xc17a('0x56')]=function(_0x42ccb3,_0x2c9eab,_0x2ce8c6){return db[_0xc17a('0x34')][_0xc17a('0x4e')]({'where':{'id':_0x42ccb3[_0xc17a('0x4d')]['id']}})[_0xc17a('0x2e')](handleEntityNotFound(_0x2c9eab,null))['then'](function(_0x396fbe){if(_0x396fbe){return _0x396fbe[_0xc17a('0x56')](_0x42ccb3['body'][_0xc17a('0x57')],_[_0xc17a('0x58')](_0x42ccb3[_0xc17a('0x50')],[_0xc17a('0x57'),'id'])||{});}})[_0xc17a('0x2e')](respondWithResult(_0x2c9eab,null))[_0xc17a('0x51')](handleError(_0x2c9eab,null));};exports[_0xc17a('0x59')]=function(_0x4b7c3f,_0x57ed76,_0x42e148){var _0x12371d={};var _0x141e17={};var _0x3c00d5;var _0x38af46;return db[_0xc17a('0x34')]['findOne']({'where':{'id':_0x4b7c3f['params']['id']}})['then'](handleEntityNotFound(_0x57ed76,null))[_0xc17a('0x2e')](function(_0x45eccf){if(_0x45eccf){_0x3c00d5=_0x45eccf;_0x141e17['model']=_[_0xc17a('0x3b')](db[_0xc17a('0x5a')][_0xc17a('0x35')]);_0x141e17[_0xc17a('0x3c')]=_['keys'](_0x4b7c3f[_0xc17a('0x3c')]);_0x141e17[_0xc17a('0x45')]=_['intersection'](_0x141e17[_0xc17a('0x39')],_0x141e17['query']);_0x12371d[_0xc17a('0x3f')]=_[_0xc17a('0x3d')](_0x141e17[_0xc17a('0x39')],qs[_0xc17a('0x3e')](_0x4b7c3f[_0xc17a('0x3c')][_0xc17a('0x3e')]));_0x12371d[_0xc17a('0x3f')]=_0x12371d['attributes']['length']?_0x12371d['attributes']:_0x141e17['model'];_0x12371d[_0xc17a('0x42')]=qs[_0xc17a('0x43')](_0x4b7c3f[_0xc17a('0x3c')][_0xc17a('0x43')]);_0x12371d[_0xc17a('0x44')]=qs['filters'](_[_0xc17a('0x5b')](_0x4b7c3f[_0xc17a('0x3c')],_0x141e17[_0xc17a('0x45')]));if(_0x4b7c3f[_0xc17a('0x3c')]['filter']){_0x12371d[_0xc17a('0x44')]=_['merge'](_0x12371d[_0xc17a('0x44')],{'$or':_['map'](_0x12371d[_0xc17a('0x3f')],function(_0x5957f9){var _0x1a62d3={};_0x1a62d3[_0x5957f9]={'$like':'%'+_0x4b7c3f[_0xc17a('0x3c')][_0xc17a('0x48')]+'%'};return _0x1a62d3;})});}_0x12371d=_[_0xc17a('0x46')]({},_0x12371d,_0x4b7c3f[_0xc17a('0x49')]);return _0x3c00d5[_0xc17a('0x59')](_0x12371d);}})['then'](function(_0x13ea51){if(_0x13ea51){_0x38af46=_0x13ea51[_0xc17a('0x40')];if(!_0x4b7c3f['query'][_0xc17a('0x41')](_0xc17a('0x5c'))){_0x12371d['limit']=qs[_0xc17a('0x24')](_0x4b7c3f[_0xc17a('0x3c')][_0xc17a('0x24')]);_0x12371d[_0xc17a('0x26')]=qs[_0xc17a('0x26')](_0x4b7c3f['query'][_0xc17a('0x26')]);}return _0x3c00d5[_0xc17a('0x59')](_0x12371d);}})[_0xc17a('0x2e')](function(_0x1196e7){if(_0x1196e7){return _0x1196e7?{'count':_0x38af46,'rows':_0x1196e7}:null;}})[_0xc17a('0x2e')](respondWithResult(_0x57ed76,null))[_0xc17a('0x51')](handleError(_0x57ed76,null));};exports['removeMembers']=function(_0x5a85dc,_0x59d97b,_0x1c9286){return db[_0xc17a('0x34')][_0xc17a('0x4e')]({'where':{'id':_0x5a85dc[_0xc17a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x59d97b,null))[_0xc17a('0x2e')](function(_0x12a607){if(_0x12a607){return _0x12a607[_0xc17a('0x5d')](_0x5a85dc[_0xc17a('0x3c')][_0xc17a('0x57')]);}})[_0xc17a('0x2e')](respondWithStatusCode(_0x59d97b,null))[_0xc17a('0x51')](handleError(_0x59d97b,null));};exports[_0xc17a('0x5e')]=function(_0x160de2,_0x5306bc,_0x1c368e){if(_0x160de2['body']['id']){delete _0x160de2[_0xc17a('0x50')]['id'];}return db[_0xc17a('0x34')][_0xc17a('0x4e')]({'where':{'id':_0x160de2[_0xc17a('0x4d')]['id']}})[_0xc17a('0x2e')](handleEntityNotFound(_0x5306bc,null))[_0xc17a('0x2e')](function(_0x5f2d97){if(_0x5f2d97){_0x160de2[_0xc17a('0x50')][_0xc17a('0x5f')]=_0x5f2d97['id'];return db['ChatInternalMessage'][_0xc17a('0x4f')](_0x160de2['body']);}})['then'](respondWithResult(_0x5306bc,null))['catch'](handleError(_0x5306bc,null));};exports['getMessages']=function(_0x126162,_0x2c52b7,_0x38c071){var _0x5d3a0e={};var _0x383cae={};var _0x1b6e30;var _0x4db49d;return db[_0xc17a('0x34')][_0xc17a('0x60')]({'where':{'id':_0x126162[_0xc17a('0x4d')]['id']}})[_0xc17a('0x2e')](handleEntityNotFound(_0x2c52b7,null))[_0xc17a('0x2e')](function(_0x86d3a4){if(_0x86d3a4){_0x1b6e30=_0x86d3a4;_0x383cae[_0xc17a('0x39')]=_['keys'](db['ChatInternalMessage'][_0xc17a('0x35')]);_0x383cae[_0xc17a('0x3c')]=_[_0xc17a('0x3b')](_0x126162[_0xc17a('0x3c')]);_0x383cae[_0xc17a('0x45')]=_['intersection'](_0x383cae[_0xc17a('0x39')],_0x383cae[_0xc17a('0x3c')]);_0x5d3a0e[_0xc17a('0x3f')]=_['intersection'](_0x383cae[_0xc17a('0x39')],qs['fields'](_0x126162[_0xc17a('0x3c')][_0xc17a('0x3e')]));_0x5d3a0e[_0xc17a('0x3f')]=_0x5d3a0e[_0xc17a('0x3f')][_0xc17a('0x40')]?_0x5d3a0e[_0xc17a('0x3f')]:_0x383cae[_0xc17a('0x39')];_0x5d3a0e['order']=qs['sort'](_0x126162['query'][_0xc17a('0x43')]);_0x5d3a0e[_0xc17a('0x44')]=qs[_0xc17a('0x45')](_[_0xc17a('0x5b')](_0x126162[_0xc17a('0x3c')],_0x383cae['filters']));if(_0x126162[_0xc17a('0x3c')][_0xc17a('0x48')]){_0x5d3a0e[_0xc17a('0x44')]=_['merge'](_0x5d3a0e[_0xc17a('0x44')],{'$or':_['map'](_0x5d3a0e[_0xc17a('0x3f')],function(_0x3f0a9b){var _0x231945={};_0x231945[_0x3f0a9b]={'$like':'%'+_0x126162['query'][_0xc17a('0x48')]+'%'};return _0x231945;})});}if(_0x126162[_0xc17a('0x3c')][_0xc17a('0x61')]){var _0x105022=_0x126162[_0xc17a('0x3c')]['$gte']['split'](',');var _0x5a359f={};_0x5a359f[_0x105022[0x0]]={'$gte':moment(_0x105022[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5d3a0e['where']=_[_0xc17a('0x46')](_0x5d3a0e[_0xc17a('0x44')],_0x5a359f);}_0x5d3a0e=_[_0xc17a('0x46')]({},_0x5d3a0e,_0x126162[_0xc17a('0x49')]);return _0x1b6e30[_0xc17a('0x62')](_0x5d3a0e);}})[_0xc17a('0x2e')](function(_0x58597b){if(_0x58597b){_0x4db49d=_0x58597b['length'];if(!_0x126162[_0xc17a('0x3c')][_0xc17a('0x41')](_0xc17a('0x5c'))){_0x5d3a0e['limit']=qs[_0xc17a('0x24')](_0x126162[_0xc17a('0x3c')][_0xc17a('0x24')]);_0x5d3a0e[_0xc17a('0x26')]=qs[_0xc17a('0x26')](_0x126162[_0xc17a('0x3c')][_0xc17a('0x26')]);}return _0x1b6e30[_0xc17a('0x62')](_0x5d3a0e);}})['then'](function(_0x13f4cd){if(_0x13f4cd){return _0x13f4cd?{'count':_0x4db49d,'rows':_0x13f4cd}:null;}})[_0xc17a('0x2e')](respondWithResult(_0x2c52b7,null))[_0xc17a('0x51')](handleError(_0x2c52b7,null));};
\ No newline at end of file
index 381783e..021f6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f8=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x51af28,_0x3c5545){var _0x5437d2=function(_0x2531f9){while(--_0x2531f9){_0x51af28['push'](_0x51af28['shift']());}};_0x5437d2(++_0x3c5545);}(_0xa3f8,0x1f4));var _0x8a3f=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0xa3f8[_0x1be3b3];return _0x4f8b2d;};'use strict';var EventEmitter=require(_0x8a3f('0x0'));var ChatGroup=require(_0x8a3f('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8a3f('0x2')](0x0);var events={'afterCreate':_0x8a3f('0x3'),'afterUpdate':_0x8a3f('0x4'),'afterDestroy':_0x8a3f('0x5')};function emitEvent(_0x5d9346){return function(_0x219980,_0xb49e92,_0x20cb2b){ChatGroupEvents[_0x8a3f('0x6')](_0x5d9346+':'+_0x219980['id'],_0x219980);ChatGroupEvents[_0x8a3f('0x6')](_0x5d9346,_0x219980);_0x20cb2b(null);};}for(var e in events){if(events[_0x8a3f('0x7')](e)){var event=events[e];ChatGroup[_0x8a3f('0x8')](e,emitEvent(event));}}module[_0x8a3f('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xed0b=['exports','events','ChatGroup','setMaxListeners','save','hasOwnProperty','hook'];(function(_0x105a81,_0x1c526c){var _0x13f5ab=function(_0x24c33f){while(--_0x24c33f){_0x105a81['push'](_0x105a81['shift']());}};_0x13f5ab(++_0x1c526c);}(_0xed0b,0x15f));var _0xbed0=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0xed0b[_0x334651];return _0x29657c;};'use strict';var EventEmitter=require(_0xbed0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbed0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbed0('0x2')](0x0);var events={'afterCreate':_0xbed0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4d10b0){return function(_0x4375b2,_0x59df8c,_0x223998){ChatGroupEvents['emit'](_0x4d10b0+':'+_0x4375b2['id'],_0x4375b2);ChatGroupEvents['emit'](_0x4d10b0,_0x4375b2);_0x223998(null);};}for(var e in events){if(events[_0xbed0('0x4')](e)){var event=events[e];ChatGroup[_0xbed0('0x5')](e,emitEvent(event));}}module[_0xbed0('0x6')]=ChatGroupEvents;
\ No newline at end of file
index 7904b60..86351c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcc9=['../../config/environment','exports','define','chat_groups','util','bluebird','path','rimraf'];(function(_0x4c3851,_0xbebbfd){var _0x43a1e2=function(_0x271b9f){while(--_0x271b9f){_0x4c3851['push'](_0x4c3851['shift']());}};_0x43a1e2(++_0xbebbfd);}(_0xbcc9,0x13c));var _0x9bcc=function(_0x3d0c89,_0x39a2fa){_0x3d0c89=_0x3d0c89-0x0;var _0xd17883=_0xbcc9[_0x3d0c89];return _0xd17883;};'use strict';var _=require('lodash');var util=require(_0x9bcc('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9bcc('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bcc('0x2'));var rimraf=require(_0x9bcc('0x3'));var config=require(_0x9bcc('0x4'));var attributes=require('./chatGroup.attributes');module[_0x9bcc('0x5')]=function(_0x16110c,_0x594ab1){return _0x16110c[_0x9bcc('0x6')]('ChatGroup',attributes,{'tableName':_0x9bcc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4760=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x4760,0xaf));var _0x0476=function(_0x1a1172,_0x23864e){_0x1a1172=_0x1a1172-0x0;var _0x2dd3cf=_0x4760[_0x1a1172];return _0x2dd3cf;};'use strict';var _=require(_0x0476('0x0'));var util=require(_0x0476('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0476('0x2'));var BPromise=require(_0x0476('0x3'));var rp=require(_0x0476('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0476('0x5'));var config=require(_0x0476('0x6'));var attributes=require(_0x0476('0x7'));module['exports']=function(_0x2f83a4,_0x2da335){return _0x2f83a4[_0x0476('0x8')](_0x0476('0x9'),attributes,{'tableName':_0x0476('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8b6a10a..1afaeeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe94a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe94a,0x1c7));var _0xae94=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0xe94a[_0x3186aa];return _0x2d8c36;};'use strict';var _=require(_0xae94('0x0'));var util=require(_0xae94('0x1'));var moment=require(_0xae94('0x2'));var BPromise=require('bluebird');var rs=require(_0xae94('0x3'));var fs=require('fs');var Redis=require(_0xae94('0x4'));var db=require(_0xae94('0x5'))['db'];var utils=require(_0xae94('0x6'));var logger=require(_0xae94('0x7'))(_0xae94('0x8'));var config=require('../../config/environment');var jayson=require(_0xae94('0x9'));var client=jayson[_0xae94('0xa')][_0xae94('0xb')]({'port':0x232a});config[_0xae94('0xc')]=_[_0xae94('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xae94('0xe'))(new Redis(config[_0xae94('0xc')]));require('./chatGroup.socket')[_0xae94('0xf')](socket);function respondWithRpcPromise(_0x35cd04,_0x3a5a57,_0x2fa556){return new BPromise(function(_0x1cb23d,_0x3fdafe){return client[_0xae94('0x10')](_0x35cd04,_0x2fa556)[_0xae94('0x11')](function(_0x4cb724){logger['info'](_0xae94('0x12'),_0x3a5a57,_0xae94('0x13'));logger['debug'](_0xae94('0x14'),_0x3a5a57,'request\x20sent',JSON[_0xae94('0x15')](_0x4cb724));if(_0x4cb724[_0xae94('0x16')]){if(_0x4cb724[_0xae94('0x16')][_0xae94('0x17')]===0x1f4){logger[_0xae94('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3a5a57,_0x4cb724[_0xae94('0x16')][_0xae94('0x18')]);return _0x3fdafe(_0x4cb724[_0xae94('0x16')]['message']);}logger[_0xae94('0x16')]('ChatGroup,\x20%s,\x20%s',_0x3a5a57,_0x4cb724[_0xae94('0x16')]['message']);return _0x1cb23d(_0x4cb724[_0xae94('0x16')][_0xae94('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x3a5a57,_0xae94('0x13'));_0x1cb23d(_0x4cb724[_0xae94('0x19')][_0xae94('0x18')]);}})[_0xae94('0x1a')](function(_0x5d4379){logger[_0xae94('0x16')](_0xae94('0x12'),_0x3a5a57,_0x5d4379);_0x3fdafe(_0x5d4379);});});}
\ No newline at end of file
+var _0x4006=['rpc','client','redis','defaults','localhost','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x110924,_0x1374bb){var _0x12905b=function(_0x47d32c){while(--_0x47d32c){_0x110924['push'](_0x110924['shift']());}};_0x12905b(++_0x1374bb);}(_0x4006,0x1c7));var _0x6400=function(_0x4145cc,_0x438fc4){_0x4145cc=_0x4145cc-0x0;var _0xaf2cf0=_0x4006[_0x4145cc];return _0xaf2cf0;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var moment=require(_0x6400('0x1'));var BPromise=require(_0x6400('0x2'));var rs=require(_0x6400('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6400('0x4'));var logger=require('../../config/logger')(_0x6400('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6400('0x6')]['http']({'port':0x232a});config[_0x6400('0x7')]=_[_0x6400('0x8')](config[_0x6400('0x7')],{'host':_0x6400('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6400('0x7')]));require(_0x6400('0xa'))[_0x6400('0xb')](socket);function respondWithRpcPromise(_0x356982,_0x3b124f,_0x1c59d0){return new BPromise(function(_0x411472,_0xc3cf61){return client[_0x6400('0xc')](_0x356982,_0x1c59d0)[_0x6400('0xd')](function(_0x264391){logger['info'](_0x6400('0xe'),_0x3b124f,_0x6400('0xf'));logger[_0x6400('0x10')](_0x6400('0x11'),_0x3b124f,'request\x20sent',JSON[_0x6400('0x12')](_0x264391));if(_0x264391[_0x6400('0x13')]){if(_0x264391['error']['code']===0x1f4){logger['error'](_0x6400('0xe'),_0x3b124f,_0x264391[_0x6400('0x13')]['message']);return _0xc3cf61(_0x264391[_0x6400('0x13')]['message']);}logger[_0x6400('0x13')]('ChatGroup,\x20%s,\x20%s',_0x3b124f,_0x264391[_0x6400('0x13')][_0x6400('0x14')]);return _0x411472(_0x264391[_0x6400('0x13')][_0x6400('0x14')]);}else{logger['info'](_0x6400('0xe'),_0x3b124f,_0x6400('0xf'));_0x411472(_0x264391[_0x6400('0x15')]['message']);}})[_0x6400('0x16')](function(_0x205f8b){logger['error'](_0x6400('0xe'),_0x3b124f,_0x205f8b);_0xc3cf61(_0x205f8b);});});}
\ No newline at end of file
index f78d7e9..dd4334d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1512=['emit','removeListener','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x5eb22e,_0x27cbac){var _0x27fed5=function(_0x565467){while(--_0x565467){_0x5eb22e['push'](_0x5eb22e['shift']());}};_0x27fed5(++_0x27cbac);}(_0x1512,0x184));var _0x2151=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1512[_0x20a584];return _0x4b41a8;};'use strict';var ChatGroupEvents=require(_0x2151('0x0'));var events=[_0x2151('0x1'),_0x2151('0x2'),_0x2151('0x3')];function createListener(_0x1beae2,_0x1e4dae){return function(_0x593cce){_0x1e4dae[_0x2151('0x4')](_0x1beae2,_0x593cce);};}function removeListener(_0x37a729,_0x21fbd0){return function(){ChatGroupEvents[_0x2151('0x5')](_0x37a729,_0x21fbd0);};}exports['register']=function(_0x377b32){for(var _0x289826=0x0,_0x535a16=events[_0x2151('0x6')];_0x289826<_0x535a16;_0x289826++){var _0x2f093e=events[_0x289826];var _0x1aa98a=createListener(_0x2151('0x7')+_0x2f093e,_0x377b32);ChatGroupEvents['on'](_0x2f093e,_0x1aa98a);}};
\ No newline at end of file
+var _0xcbb2=['chatGroup:','remove','update','length'];(function(_0x38162f,_0x1558f2){var _0xad645a=function(_0x1fb032){while(--_0x1fb032){_0x38162f['push'](_0x38162f['shift']());}};_0xad645a(++_0x1558f2);}(_0xcbb2,0xe1));var _0x2cbb=function(_0x55852a,_0x14ae5e){_0x55852a=_0x55852a-0x0;var _0x3051c0=_0xcbb2[_0x55852a];return _0x3051c0;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x2cbb('0x0'),_0x2cbb('0x1')];function createListener(_0xf4a821,_0x4af068){return function(_0x13438c){_0x4af068['emit'](_0xf4a821,_0x13438c);};}function removeListener(_0x1297cd,_0x55325d){return function(){ChatGroupEvents['removeListener'](_0x1297cd,_0x55325d);};}exports['register']=function(_0x18ed8b){for(var _0x14db01=0x0,_0x418ca1=events[_0x2cbb('0x2')];_0x14db01<_0x418ca1;_0x14db01++){var _0x4c4cef=events[_0x14db01];var _0x38180e=createListener(_0x2cbb('0x3')+_0x4c4cef,_0x18ed8b);ChatGroupEvents['on'](_0x4c4cef,_0x38180e);}};
\ No newline at end of file
index 339db54..d4cd23a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeaa8=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','describe','/:id','show','getUnread','/:id/members','getMessages','post','create','addMembers','put','update','delete','destroy','exports','util','path'];(function(_0x44359e,_0x5f4b28){var _0x114834=function(_0x434939){while(--_0x434939){_0x44359e['push'](_0x44359e['shift']());}};_0x114834(++_0x5f4b28);}(_0xeaa8,0xc6));var _0x8eaa=function(_0x191649,_0x1d5896){_0x191649=_0x191649-0x0;var _0x330388=_0xeaa8[_0x191649];return _0x330388;};'use strict';var multer=require('multer');var util=require(_0x8eaa('0x0'));var path=require(_0x8eaa('0x1'));var timeout=require('connect-timeout');var express=require(_0x8eaa('0x2'));var router=express['Router']();var fs_extra=require(_0x8eaa('0x3'));var auth=require(_0x8eaa('0x4'));var interaction=require(_0x8eaa('0x5'));var config=require(_0x8eaa('0x6'));var controller=require(_0x8eaa('0x7'));router['get']('/',auth[_0x8eaa('0x8')](),controller[_0x8eaa('0x9')]);router[_0x8eaa('0xa')]('/describe',auth[_0x8eaa('0x8')](),controller[_0x8eaa('0xb')]);router['get'](_0x8eaa('0xc'),auth['isAuthenticated'](),controller[_0x8eaa('0xd')]);router[_0x8eaa('0xa')]('/:id/unread',auth[_0x8eaa('0x8')](),controller[_0x8eaa('0xe')]);router[_0x8eaa('0xa')](_0x8eaa('0xf'),auth[_0x8eaa('0x8')](),controller['getMembers']);router[_0x8eaa('0xa')]('/:id/messages',auth[_0x8eaa('0x8')](),controller[_0x8eaa('0x10')]);router[_0x8eaa('0x11')]('/',auth[_0x8eaa('0x8')](),controller[_0x8eaa('0x12')]);router[_0x8eaa('0x11')](_0x8eaa('0xf'),auth[_0x8eaa('0x8')](),controller[_0x8eaa('0x13')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x8eaa('0x14')](_0x8eaa('0xc'),auth[_0x8eaa('0x8')](),controller[_0x8eaa('0x15')]);router[_0x8eaa('0x16')](_0x8eaa('0xc'),auth[_0x8eaa('0x8')](),controller[_0x8eaa('0x17')]);router[_0x8eaa('0x16')](_0x8eaa('0xf'),auth[_0x8eaa('0x8')](),controller['removeMembers']);module[_0x8eaa('0x18')]=router;
\ No newline at end of file
+var _0x1238=['put','update','delete','/:id/members','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','isAuthenticated','describe','/:id','show','getMembers','/:id/messages','getMessages','post','addMembers','addMessage'];(function(_0xac83c3,_0x558091){var _0x3044b7=function(_0x5dde92){while(--_0x5dde92){_0xac83c3['push'](_0xac83c3['shift']());}};_0x3044b7(++_0x558091);}(_0x1238,0x81));var _0x8123=function(_0x332ddf,_0x1ed1b5){_0x332ddf=_0x332ddf-0x0;var _0x4798a9=_0x1238[_0x332ddf];return _0x4798a9;};'use strict';var multer=require(_0x8123('0x0'));var util=require(_0x8123('0x1'));var path=require('path');var timeout=require(_0x8123('0x2'));var express=require(_0x8123('0x3'));var router=express[_0x8123('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8123('0x5'));var interaction=require(_0x8123('0x6'));var config=require(_0x8123('0x7'));var controller=require(_0x8123('0x8'));router[_0x8123('0x9')]('/',auth['isAuthenticated'](),controller[_0x8123('0xa')]);router['get']('/describe',auth[_0x8123('0xb')](),controller[_0x8123('0xc')]);router[_0x8123('0x9')](_0x8123('0xd'),auth[_0x8123('0xb')](),controller[_0x8123('0xe')]);router[_0x8123('0x9')]('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router[_0x8123('0x9')]('/:id/members',auth[_0x8123('0xb')](),controller[_0x8123('0xf')]);router[_0x8123('0x9')](_0x8123('0x10'),auth[_0x8123('0xb')](),controller[_0x8123('0x11')]);router['post']('/',auth[_0x8123('0xb')](),controller['create']);router[_0x8123('0x12')]('/:id/members',auth[_0x8123('0xb')](),controller[_0x8123('0x13')]);router[_0x8123('0x12')](_0x8123('0x10'),auth[_0x8123('0xb')](),controller[_0x8123('0x14')]);router[_0x8123('0x15')](_0x8123('0xd'),auth[_0x8123('0xb')](),controller[_0x8123('0x16')]);router[_0x8123('0x17')](_0x8123('0xd'),auth[_0x8123('0xb')](),controller['destroy']);router[_0x8123('0x17')](_0x8123('0x18'),auth[_0x8123('0xb')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
index c2b4a15..b21d9c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5fb=['ENUM','star','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x1a9f6f,_0x4f2bc9){var _0x1e6f1d=function(_0x5339ce){while(--_0x5339ce){_0x1a9f6f['push'](_0x1a9f6f['shift']());}};_0x1e6f1d(++_0x4f2bc9);}(_0xe5fb,0xce));var _0xbe5f=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xe5fb[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xbe5f('0x2')]},'ratingType':{'type':Sequelize[_0xbe5f('0x3')](_0xbe5f('0x4'),'thumb'),'defaultValue':_0xbe5f('0x4')},'ratingMessage':{'type':Sequelize[_0xbe5f('0x5')]},'pathTranscript':{'type':Sequelize[_0xbe5f('0x5')]},'mailTranscript':{'type':Sequelize[_0xbe5f('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xbe5f('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbe5f('0x6')]},'thirdDisposition':{'type':Sequelize[_0xbe5f('0x6')]},'note':{'type':Sequelize[_0xbe5f('0x6')]},'browserName':{'type':Sequelize[_0xbe5f('0x6')]},'browserVersion':{'type':Sequelize[_0xbe5f('0x6')]},'osName':{'type':Sequelize[_0xbe5f('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xbe5f('0x6')]},'deviceVendor':{'type':Sequelize[_0xbe5f('0x6')]},'deviceType':{'type':Sequelize[_0xbe5f('0x6')]},'referer':{'type':Sequelize[_0xbe5f('0x5')]},'customerIp':{'type':Sequelize[_0xbe5f('0x6')]},'formData':{'type':Sequelize[_0xbe5f('0x5')](_0xbe5f('0x8'))},'read1stAt':{'type':Sequelize[_0xbe5f('0x7')]},'lastMsgAt':{'type':Sequelize[_0xbe5f('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xbe5f('0x3')]('in',_0xbe5f('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xbe5f('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xbe5f('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xbe5f('0xa')],'defaultValue':![]}};
\ No newline at end of file
+var _0xe706=['BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports'];(function(_0x5a3cd6,_0x6d913a){var _0xe9ae08=function(_0x18f574){while(--_0x18f574){_0x5a3cd6['push'](_0x5a3cd6['shift']());}};_0xe9ae08(++_0x6d913a);}(_0xe706,0xa3));var _0x6e70=function(_0x1f2422,_0x125fd2){_0x1f2422=_0x1f2422-0x0;var _0x4fb420=_0xe706[_0x1f2422];return _0x4fb420;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'closed':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5')),'defaultValue':_0x6e70('0x4')},'ratingMessage':{'type':Sequelize[_0x6e70('0x6')]},'pathTranscript':{'type':Sequelize[_0x6e70('0x6')]},'mailTranscript':{'type':Sequelize[_0x6e70('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6e70('0x8')]},'disposition':{'type':Sequelize[_0x6e70('0x7')]},'secondDisposition':{'type':Sequelize[_0x6e70('0x7')]},'thirdDisposition':{'type':Sequelize[_0x6e70('0x7')]},'note':{'type':Sequelize[_0x6e70('0x7')]},'browserName':{'type':Sequelize[_0x6e70('0x7')]},'browserVersion':{'type':Sequelize[_0x6e70('0x7')]},'osName':{'type':Sequelize[_0x6e70('0x7')]},'osVersion':{'type':Sequelize[_0x6e70('0x7')]},'deviceModel':{'type':Sequelize[_0x6e70('0x7')]},'deviceVendor':{'type':Sequelize[_0x6e70('0x7')]},'deviceType':{'type':Sequelize[_0x6e70('0x7')]},'referer':{'type':Sequelize[_0x6e70('0x6')]},'customerIp':{'type':Sequelize[_0x6e70('0x7')]},'formData':{'type':Sequelize[_0x6e70('0x6')](_0x6e70('0x9'))},'read1stAt':{'type':Sequelize[_0x6e70('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6e70('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6e70('0x7')]},'customerPort':{'type':Sequelize[_0x6e70('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6e70('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 459581e..149e138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955f=['CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','keyBy','ChatInteraction','a.key','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','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','ChatInteractionId','all','rows','includeAll','include','options','create','params','describe','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','update','disposition','AbandonInteraction','attachmentUpload','originalname','file','mimetype','attachmentDownload','findOne','closed','Unauthorized','Attachment','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','mailTranscript','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','pick','includeAgent','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','direction','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/utils','../../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','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','merge','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\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)'];(function(_0x123d20,_0x4932fa){var _0x3879c0=function(_0x5c83f6){while(--_0x5c83f6){_0x123d20['push'](_0x123d20['shift']());}};_0x3879c0(++_0x4932fa);}(_0x955f,0x1eb));var _0xf955=function(_0x3f7417,_0x1d921d){_0x3f7417=_0x3f7417-0x0;var _0x2b1603=_0x955f[_0x3f7417];return _0x2b1603;};'use strict';var emlformat=require(_0xf955('0x0'));var rimraf=require(_0xf955('0x1'));var zipdir=require(_0xf955('0x2'));var jsonpatch=require(_0xf955('0x3'));var rp=require(_0xf955('0x4'));var moment=require('moment');var BPromise=require(_0xf955('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf955('0x6'));var sox=require('sox');var csv=require(_0xf955('0x7'));var ejs=require(_0xf955('0x8'));var fs=require('fs');var fs_extra=require(_0xf955('0x9'));var _=require('lodash');var squel=require(_0xf955('0xa'));var crypto=require(_0xf955('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf955('0xc'));var toCsv=require(_0xf955('0x7'));var querystring=require(_0xf955('0xd'));var Papa=require(_0xf955('0xe'));var Redis=require(_0xf955('0xf'));var authService=require(_0xf955('0x10'));var qs=require(_0xf955('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf955('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf955('0x13'))(_0xf955('0x14'));var utils=require(_0xf955('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf955('0x16'));var db=require('../../mysqldb')['db'];config[_0xf955('0x17')]=_['defaults'](config[_0xf955('0x17')],{'host':_0xf955('0x18'),'port':0x18eb});var socket=require(_0xf955('0x19'))(new Redis(config[_0xf955('0x17')]));require(_0xf955('0x1a'))[_0xf955('0x1b')](socket);var jayson=require(_0xf955('0x1c'));var client=jayson[_0xf955('0x1d')][_0xf955('0x1e')]({'port':0x232b});var client9004=jayson[_0xf955('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0xc29b35,_0x54e60b,_0x3139d5,_0x3a814f){return new BPromise(function(_0x2f881b,_0x15c07c){var _0x50930d=_0x3a814f||client;return _0x50930d['request'](_0xc29b35,_0x3139d5)[_0xf955('0x1f')](function(_0xe6de5c){logger[_0xf955('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xf955('0x21'));logger[_0xf955('0x22')](_0xf955('0x23'),_0x54e60b,_0xf955('0x21'),JSON[_0xf955('0x24')](_0xe6de5c));if(_0xe6de5c['error']){if(_0xe6de5c[_0xf955('0x25')][_0xf955('0x26')]===0x1f4){logger[_0xf955('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x15c07c(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0xe6de5c[_0xf955('0x25')]['message']);return _0x2f881b(_0xe6de5c[_0xf955('0x25')][_0xf955('0x27')]);}else{logger[_0xf955('0x20')](_0xf955('0x28'),_0x54e60b,_0xf955('0x21'));_0x2f881b(_0xe6de5c[_0xf955('0x29')][_0xf955('0x27')]);}})['catch'](function(_0x18f435){logger[_0xf955('0x25')](_0xf955('0x28'),_0x54e60b,_0x18f435);_0x15c07c(_0x18f435);});});}function respondWithStatusCode(_0x406632,_0x2dcd55){_0x2dcd55=_0x2dcd55||0xcc;return function(_0x13a86d){if(_0x13a86d){return _0x406632[_0xf955('0x2a')](_0x2dcd55);}return _0x406632['status'](_0x2dcd55)[_0xf955('0x2b')]();};}function respondWithResult(_0x145098,_0x41c9f6){_0x41c9f6=_0x41c9f6||0xc8;return function(_0xbd0b74){if(_0xbd0b74){return _0x145098[_0xf955('0x2c')](_0x41c9f6)[_0xf955('0x2d')](_0xbd0b74);}};}function respondWithFilteredResult(_0x4d4af0,_0x2232a7){return function(_0x1e5d37){if(_0x1e5d37){var _0x4ec3e8=typeof _0x2232a7[_0xf955('0x2e')]===_0xf955('0x2f')&&typeof _0x2232a7[_0xf955('0x30')]===_0xf955('0x2f');var _0x59bfb5=_0x1e5d37[_0xf955('0x31')];var _0x518fb3=_0x4ec3e8?0x0:_0x2232a7[_0xf955('0x2e')];var _0x2c222a=_0x4ec3e8?_0x1e5d37[_0xf955('0x31')]:_0x2232a7[_0xf955('0x2e')]+_0x2232a7[_0xf955('0x30')];var _0x32121b;if(_0x2c222a>=_0x59bfb5){_0x2c222a=_0x59bfb5;_0x32121b=0xc8;}else{_0x32121b=0xce;}_0x4d4af0[_0xf955('0x2c')](_0x32121b);return _0x4d4af0[_0xf955('0x32')]('Content-Range',_0x518fb3+'-'+_0x2c222a+'/'+_0x59bfb5)[_0xf955('0x2d')](_0x1e5d37);}return null;};}function patchUpdates(_0x165cc4){return function(_0x3964d3){try{jsonpatch[_0xf955('0x33')](_0x3964d3,_0x165cc4,!![]);}catch(_0x4fea0c){return BPromise[_0xf955('0x34')](_0x4fea0c);}return _0x3964d3[_0xf955('0x35')]();};}function saveUpdates(_0x3c81bc,_0xe1b436){return function(_0xdbc53e){if(_0xdbc53e){return _0xdbc53e['update'](_0x3c81bc)['then'](function(_0x5480db){return _0x5480db;});}return null;};}function removeEntity(_0x2626cb,_0x3783dc){return function(_0x374e95){if(_0x374e95){return _0x374e95[_0xf955('0x36')]()[_0xf955('0x1f')](function(){_0x2626cb[_0xf955('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3acc4b,_0x515dc6){return function(_0x8f842f){if(!_0x8f842f){_0x3acc4b[_0xf955('0x2a')](0x194);}return _0x8f842f;};}function handleError(_0xe33ef2,_0x51762d){_0x51762d=_0x51762d||0x1f4;return function(_0x60a421){logger['error'](_0x60a421[_0xf955('0x37')]);if(_0x60a421[_0xf955('0x38')]){delete _0x60a421[_0xf955('0x38')];}_0xe33ef2[_0xf955('0x2c')](_0x51762d)['send'](_0x60a421);};}function getMustacheRender(_0xf35170,_0x118c92){return Mustache['render'](_0xf35170,_[_0xf955('0x39')](_0x118c92[_0xf955('0x3a')],{'contact':_0x118c92[_0xf955('0x3b')],'message':_0x118c92['message'],'agent':_0x118c92[_0xf955('0x3c')],'interaction':_0x118c92[_0xf955('0x3d')],'account':_0x118c92[_0xf955('0x3e')]}))||'';}function getInteractionUsers(_0x488b6e,_0x97e8ff){return new BPromise(function(_0x195faa,_0x21e4a6){try{if(_0x97e8ff[_0x488b6e['id']]){_0x488b6e[_0xf955('0x3f')]=_[_0xf955('0x40')](_0x97e8ff[_0x488b6e['id']],function(_0x3c4b29){return{'id':_0x3c4b29['id'],'fullname':_0x3c4b29[_0xf955('0x41')]};});}}catch(_0x228dae){_0x21e4a6(_0x228dae);}_0x195faa(_0x488b6e);});}function getInteractionTags(_0x5671c7,_0x8fa41b){return new BPromise(function(_0x7123c1,_0x2aacdf){try{if(_0x5671c7[_0xf955('0x42')]){_0x5671c7[_0xf955('0x43')]=[];_0x5671c7[_0xf955('0x42')][_0xf955('0x44')](',')[_0xf955('0x45')](function(_0x47651b){_0x5671c7[_0xf955('0x43')][_0xf955('0x46')](_0x8fa41b[_0x47651b]);});}delete _0x5671c7[_0xf955('0x42')];}catch(_0x40d7e9){_0x2aacdf(_0x40d7e9);}_0x7123c1(_0x5671c7);});}function updateChatInteraction(_0x159ae3,_0x3557b5,_0x248f60){return new BPromise(function(_0x356ec2,_0x34f0f1){return getInteractionUsers(_0x159ae3,_0x248f60)[_0xf955('0x1f')](function(_0x5dd300){return getInteractionTags(_0x5dd300,_0x3557b5);})[_0xf955('0x1f')](function(_0x25d809){_0x356ec2(_0x25d809);})[_0xf955('0x47')](function(_0x5f0ef9){_0x34f0f1(_0x5f0ef9);});});}exports[_0xf955('0x48')]=function(_0x485e77,_0x398224){var _0x56a4ca={},_0x103ac2={},_0x24cb74={'count':0x0,'rows':[]};var _0x213136=_[_0xf955('0x40')](db['ChatInteraction'][_0xf955('0x49')],function(_0xdb1cc){return{'name':_0xdb1cc[_0xf955('0x4a')],'type':_0xdb1cc['type']['key']};});_0x103ac2[_0xf955('0x4b')]=_[_0xf955('0x40')](_0x213136,_0xf955('0x38'));_0x103ac2[_0xf955('0x4c')]=_['keys'](_0x485e77[_0xf955('0x4c')]);_0x103ac2[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x103ac2['model'],_0x103ac2[_0xf955('0x4c')]);_0x56a4ca['attributes']=_[_0xf955('0x4e')](_0x103ac2[_0xf955('0x4b')],qs[_0xf955('0x4f')](_0x485e77['query'][_0xf955('0x4f')]));_0x56a4ca[_0xf955('0x50')]=_0x56a4ca[_0xf955('0x50')][_0xf955('0x51')]?_0x56a4ca['attributes']:_0x103ac2[_0xf955('0x4b')];if(!_0x485e77[_0xf955('0x4c')][_0xf955('0x52')](_0xf955('0x53'))){_0x56a4ca[_0xf955('0x30')]=qs['limit'](_0x485e77[_0xf955('0x4c')]['limit']);_0x56a4ca[_0xf955('0x2e')]=qs['offset'](_0x485e77[_0xf955('0x4c')]['offset']);}_0x56a4ca['order']=qs[_0xf955('0x54')](_0x485e77[_0xf955('0x4c')]['sort']);_0x56a4ca[_0xf955('0x55')]=qs['filters'](_['pick'](_0x485e77['query'],_0x103ac2['filters']),_0x213136);var _0x3c37e2=[];var _0x1abe1c=squel['select']()['field']('id')[_0xf955('0x56')](_0xf955('0x38'))[_0xf955('0x56')](_0xf955('0x57'))[_0xf955('0x58')](_0xf955('0x59'));var _0x190500=squel[_0xf955('0x5a')]()[_0xf955('0x56')](_0xf955('0x5b'))[_0xf955('0x56')](_0xf955('0x5c'))['field'](_0xf955('0x5d'))[_0xf955('0x58')](_0xf955('0x5e'),'ui')[_0xf955('0x5f')](_0xf955('0x60'),'u','u.id\x20=\x20ui.UserId');var _0xf5d575=squel[_0xf955('0x5a')]()[_0xf955('0x58')](_0xf955('0x61'),'i')[_0xf955('0x5f')](_0xf955('0x62'),'c',_0xf955('0x63'))[_0xf955('0x5f')](_0xf955('0x60'),'o',_0xf955('0x64'))['left_join'](_0xf955('0x65'),'a',_0xf955('0x66'))[_0xf955('0x5f')](_0xf955('0x67'),'me',_0xf955('0x68'))[_0xf955('0x5f')](_0xf955('0x69'),'it',_0xf955('0x6a'))[_0xf955('0x5f')](_0xf955('0x59'),'t',_0xf955('0x6b'));var _0x2b8173=squel['expr']();var _0x1388a0=[];var _0x452de9=squel[_0xf955('0x6c')]();var _0x3eb727;if(_0x485e77[_0xf955('0x4c')][_0xf955('0x6d')]){_0x3eb727=as[_0xf955('0x6e')](_0x485e77['query']['search']);var _0x5e73ff=_0x3eb727[_0xf955('0x6f')];for(var _0x530ec7=0x0;_0x530ec7<_0x3eb727['conditions'][_0xf955('0x51')];_0x530ec7++){var _0x533e0f=_0x3eb727[_0xf955('0x70')][_0x530ec7];var _0x3fa5b5='i';var _0x158469=_[_0xf955('0x71')](_0x213136,['name',_0x533e0f[_0xf955('0x56')]]);if(!_0x158469){switch(_0x533e0f[_0xf955('0x56')]){case _0xf955('0x72'):if(_0x533e0f[_0xf955('0x73')]==0x1){_0xf5d575[_0xf955('0x74')]('`'+_0x533e0f['field']+_0xf955('0x75'));}else{_0xf5d575['having']('`'+_0x533e0f[_0xf955('0x56')]+_0xf955('0x76'));}break;case _0xf955('0x77'):if(_0x533e0f['operator']===_0xf955('0x78')){if(_0x533e0f[_0xf955('0x73')][_0xf955('0x44')]('\x20')[_0xf955('0x51')]>0x1){_0x2b8173[_0x5e73ff](_0xf955('0x79'),qs[_0xf955('0x7a')](_0x533e0f[_0xf955('0x73')]),null);}else{var _0x47e5de='%'+_0x533e0f['value']+'%';_0x2b8173[_0x5e73ff](_0xf955('0x7b'),_0x47e5de,_0x47e5de,_0x47e5de);}}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x7c')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x7c');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}break;case'Tag':var _0x431729=_0x533e0f['value']['split'](',')[_0xf955('0x40')](function(_0x20f11c){return Number(_0x20f11c);});_0x431729['forEach'](function(_0x1e95c3){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x1e95c3+',%');});_0x1388a0=_['union'](_0x1388a0,_0x431729);break;case'User':if(_0x533e0f[_0xf955('0x82')]===_0xf955('0x78')){_0x2b8173[_0x5e73ff](_0xf955('0x83'),'%'+_0x533e0f['value']+'%',null);}else{_0x158469=_[_0xf955('0x71')](_0x213136,[_0xf955('0x38'),_0xf955('0x84')]);_0x533e0f[_0xf955('0x56')]=_0xf955('0x84');_0x4b85c2=as[_0xf955('0x7d')](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2['value'][_0xf955('0x80')],_0x4b85c2[_0xf955('0x73')]['end']);}break;case _0xf955('0x3a'):_0x4b85c2=as[_0xf955('0x7d')]('me',null,_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')]['start'],_0x4b85c2[_0xf955('0x73')][_0xf955('0x2b')]);break;}}else{var _0x4b85c2=as['buildExpression'](_0x3fa5b5,_0x158469[_0xf955('0x7e')],_0x533e0f);_0x2b8173[_0x5e73ff](_0x4b85c2[_0xf955('0x7f')],_0x4b85c2[_0xf955('0x73')][_0xf955('0x80')],_0x4b85c2['value'][_0xf955('0x2b')]);}}}else{var _0x430571=_(_0x485e77[_0xf955('0x4c')])[_0xf955('0x85')]()[_0xf955('0x40')](function(_0x3e9c6e){return _[_0xf955('0x86')](_0x213136,[_0xf955('0x38'),_0x3e9c6e])?_0x3e9c6e:undefined;})[_0xf955('0x87')]()[_0xf955('0x73')]();if(!_[_0xf955('0x88')](_0x430571)){_0x430571[_0xf955('0x45')](function(_0x4254a2){if(_0x4254a2==='ChatWebsiteId'){_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),[][_0xf955('0x8a')](_0x485e77[_0xf955('0x4c')][_0x4254a2]));}else if(_0x4254a2==='createdAt'){var _0xcf6900=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8c')];var _0x2b266d=JSON[_0xf955('0x8b')](_0x485e77[_0xf955('0x4c')][_0x4254a2])[_0xf955('0x8d')];_0xf5d575[_0xf955('0x55')](_0xf955('0x8e'),_0xcf6900,_0x2b266d);}else{if(_0x485e77[_0xf955('0x4c')][_0x4254a2]==='null'){_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x8f'));}else{_0xf5d575[_0xf955('0x55')]('i.'+_0x4254a2+_0xf955('0x90'),_0x485e77[_0xf955('0x4c')][_0x4254a2]);}}});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x91')]){if(_0x485e77['query'][_0xf955('0x91')]==0x1){_0xf5d575['having'](_0xf955('0x92'));}else{_0xf5d575['having'](_0xf955('0x93'));}}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]){_0x1388a0=_[_0xf955('0x95')](_0x485e77[_0xf955('0x4c')][_0xf955('0x94')])?_0x485e77['query'][_0xf955('0x94')]:new Array(_0x485e77[_0xf955('0x4c')][_0xf955('0x94')]);_0x1388a0['forEach'](function(_0x526346){_0x452de9['or'](_0xf955('0x81'),'%,'+_0x526346+',%');});}if(_0x485e77[_0xf955('0x4c')][_0xf955('0x96')]){var _0x595d60=_0x485e77[_0xf955('0x4c')]['filter'][_0xf955('0x97')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf955('0x98')](_0x595d60)){_0x2b8173['or'](_0xf955('0x99'),_0x595d60+'%');}else{_0x2b8173['or'](_0xf955('0x9a'),qs['getFullTextValue'](_0x595d60))['or'](_0xf955('0x9b'),_0x595d60+'%');}}}_0xf5d575[_0xf955('0x55')](_0x2b8173);_0xf5d575[_0xf955('0x9c')]('i.id');var _0xba62d0={'type':db[_0xf955('0x9d')][_0xf955('0x9e')][_0xf955('0x9f')],'raw':!![]};var _0x419da5=_0xf5d575[_0xf955('0xa0')]();_0x419da5[_0xf955('0x56')]('i.id');_0x419da5[_0xf955('0x56')](_0xf955('0xa1'),_0xf955('0x72'));if(_0x56a4ca[_0xf955('0xa2')]){_0x56a4ca[_0xf955('0xa2')]['forEach'](function(_0x15c3e1){var _0x23f90c=_0x15c3e1[0x0]==='contactName'?_0x15c3e1[0x0]:'i.'+_0x15c3e1[0x0];_0xf5d575['order'](_0x23f90c,_0x15c3e1[0x1]===_0xf955('0xa3')?![]:!![]);});}if(!_[_0xf955('0x88')](_0x1388a0)){_0xf5d575[_0xf955('0x74')](_0x452de9);_0x419da5[_0xf955('0x55')]('t.id\x20IN\x20?',_0x1388a0);}BPromise[_0xf955('0xa4')]()['then'](function(){if(!_0x3eb727){if(_0x485e77['query'][_0xf955('0xa5')])return;_0x419da5[_0xf955('0x55')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0xf5d575['where'](_0xf955('0xa6'));return;}if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]!=='agent')return;return _0x485e77['user'][_0xf955('0xa9')]({'attributes':['id'],'raw':!![]})[_0xf955('0x1f')](function(_0x15fc7e){if(_['isEmpty'](_0x15fc7e)){_0x419da5['where']('i.ChatWebsiteId\x20IS\x20NULL');_0xf5d575['where'](_0xf955('0xaa'));}else{_0x419da5['where'](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));_0xf5d575[_0xf955('0x55')](_0xf955('0x89'),_[_0xf955('0x40')](_0x15fc7e,'id'));}});})['then'](function(){if(_0x485e77[_0xf955('0xa7')][_0xf955('0xa8')]===_0xf955('0x3c')&&!_0x3eb727&&!_0x485e77[_0xf955('0x4c')]['ChatWebsiteId'])return[];return db[_0xf955('0xab')][_0xf955('0x4c')](_0x419da5['toString'](),_0xba62d0);})[_0xf955('0x1f')](function(_0x1819f6){_0x24cb74[_0xf955('0x31')]=_0x1819f6[_0xf955('0x51')];if(_0x24cb74[_0xf955('0x31')]===0x0)return[];return db[_0xf955('0xab')]['query'](_0x1abe1c['toString'](),_0xba62d0)[_0xf955('0x1f')](function(_0x545275){_0x3c37e2=_[_0xf955('0xac')](_0x545275,'id');_0xba62d0=_[_0xf955('0x39')](_0xba62d0,{'model':db[_0xf955('0xad')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x485e77[_0xf955('0x4c')]['fields']){_0x56a4ca['attributes'][_0xf955('0x45')](function(_0x12b9f8){_0xf5d575[_0xf955('0x56')]('i.'+_0x12b9f8);});}else{_0xf5d575[_0xf955('0x56')](_0xf955('0xa1'),'unreadMessages');_0xf5d575[_0xf955('0x56')](_0xf955('0xae'),_0xf955('0xaf'));_0xf5d575[_0xf955('0x56')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xf5d575[_0xf955('0x56')](_0xf955('0xb0'),'contactName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb1'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb2'),'Contact.firstName');_0xf5d575[_0xf955('0x56')](_0xf955('0xb3'),_0xf955('0xb4'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb5'),_0xf955('0xb6'));_0xf5d575[_0xf955('0x56')]('c.phone','Contact.phone');_0xf5d575['field'](_0xf955('0xb7'),_0xf955('0xb8'));_0xf5d575[_0xf955('0x56')](_0xf955('0xb9'),_0xf955('0xba'));_0xf5d575[_0xf955('0x56')](_0xf955('0xbb'),'Owner.fullname');_0xf5d575[_0xf955('0x56')](_0xf955('0xbc'),'Owner.internal');_0xf5d575[_0xf955('0x56')](_0xf955('0xbd'),_0xf955('0x42'));}if(_0x56a4ca[_0xf955('0x30')])_0xf5d575[_0xf955('0x30')](_0x56a4ca[_0xf955('0x30')]);if(_0x56a4ca[_0xf955('0x2e')])_0xf5d575[_0xf955('0x2e')](_0x56a4ca['offset']);return db['sequelize']['query'](_0xf5d575[_0xf955('0xbe')](),_0xba62d0);})[_0xf955('0x1f')](function(_0x210666){if(_0x210666[_0xf955('0x51')]>0x0)_0x190500[_0xf955('0x55')]('ui.ChatInteractionId\x20IN\x20?',_[_0xf955('0x40')](_0x210666,'id'));return db[_0xf955('0xab')][_0xf955('0x4c')](_0x190500[_0xf955('0xbe')](),_0xba62d0)[_0xf955('0x1f')](function(_0x36731b){var _0x11f6f8=_[_0xf955('0xbf')](_0x36731b,_0xf955('0xc0'));var _0x4a71e5=[];_0x210666[_0xf955('0x45')](function(_0x47daca){_0x4a71e5[_0xf955('0x46')](updateChatInteraction(_0x47daca,_0x3c37e2,_0x11f6f8));});return BPromise[_0xf955('0xc1')](_0x4a71e5);});});})[_0xf955('0x1f')](function(_0x427ab9){_0x24cb74[_0xf955('0xc2')]=_0x427ab9;return _0x24cb74;})[_0xf955('0x1f')](respondWithFilteredResult(_0x398224,_0x56a4ca))[_0xf955('0x47')](handleError(_0x398224,null));};exports['show']=function(_0x1ef189,_0x4bb590){var _0x222df2={'raw':![],'where':{'id':_0x1ef189['params']['id']}},_0x40d7c7={};_0x40d7c7[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xad')][_0xf955('0x49')]);_0x40d7c7[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x1ef189[_0xf955('0x4c')]);_0x40d7c7['filters']=_[_0xf955('0x4e')](_0x40d7c7[_0xf955('0x4b')],_0x40d7c7['query']);_0x222df2[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x40d7c7['model'],qs['fields'](_0x1ef189[_0xf955('0x4c')][_0xf955('0x4f')]));_0x222df2[_0xf955('0x50')]=_0x222df2['attributes'][_0xf955('0x51')]?_0x222df2[_0xf955('0x50')]:_0x40d7c7[_0xf955('0x4b')];if(_0x1ef189[_0xf955('0x4c')][_0xf955('0xc3')]){_0x222df2[_0xf955('0xc4')]=[{'all':!![]}];}_0x222df2=_[_0xf955('0x39')]({},_0x222df2,_0x1ef189[_0xf955('0xc5')]);return db[_0xf955('0xad')][_0xf955('0x71')](_0x222df2)[_0xf955('0x1f')](handleEntityNotFound(_0x4bb590,null))[_0xf955('0x1f')](respondWithResult(_0x4bb590,null))[_0xf955('0x47')](handleError(_0x4bb590,null));};exports[_0xf955('0xc6')]=function(_0x490981,_0x58464d){return db[_0xf955('0xad')][_0xf955('0xc6')](_0x490981[_0xf955('0x3a')],{})[_0xf955('0x1f')](respondWithResult(_0x58464d,0xc9))[_0xf955('0x47')](handleError(_0x58464d,null));};exports['update']=function(_0x161d06,_0x3bab0d){if(_0x161d06['body']['id']){delete _0x161d06[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x161d06[_0xf955('0xc7')]['id']}})['then'](handleEntityNotFound(_0x3bab0d,null))[_0xf955('0x1f')](saveUpdates(_0x161d06['body'],null))[_0xf955('0x1f')](respondWithResult(_0x3bab0d,null))[_0xf955('0x47')](handleError(_0x3bab0d,null));};exports[_0xf955('0x36')]=function(_0xe9f9a8,_0x5aff59){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0xe9f9a8[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x5aff59,null))[_0xf955('0x1f')](removeEntity(_0x5aff59,null))['catch'](handleError(_0x5aff59,null));};exports[_0xf955('0xc8')]=function(_0x1f38db,_0x395013){return db['ChatInteraction'][_0xf955('0xc8')]()[_0xf955('0x1f')](respondWithResult(_0x395013,null))[_0xf955('0x47')](handleError(_0x395013,null));};exports[_0xf955('0xc9')]=function(_0x19665c,_0x437020){var _0x12d158=_0x19665c['params']['id'];var _0x5a6abe;var _0x4e3013;var _0x345a7c;return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x12d158}})[_0xf955('0x1f')](function(_0x42ba43){_0x5a6abe=_0x42ba43;return db[_0xf955('0xca')]['findOne']({'where':{'id':_0x42ba43[_0xf955('0xa5')]},'attributes':['id',_0xf955('0xcb'),'vidaooEscalation','vidaooTopic',_0xf955('0xcc'),_0xf955('0xcd')],'raw':!![]});})[_0xf955('0x1f')](function(_0x30baa1){if(_0x30baa1&&_0x30baa1[_0xf955('0xcb')]&&_0x30baa1['vidaooEscalation']){_0x4e3013=_0x30baa1;var _0xc881d4={'interaction':{'id':_0x12d158},'agent':{'id':_0x19665c[_0xf955('0xa7')]['id'],'name':_0x19665c[_0xf955('0xa7')][_0xf955('0x38')],'fullname':_0x19665c[_0xf955('0xa7')]['fullname'],'email':_0x19665c[_0xf955('0xa7')][_0xf955('0xce')]},'contact':_0x19665c[_0xf955('0x3a')][_0xf955('0x3b')],'account':_0x19665c['body'][_0xf955('0x3e')]};var _0x410d1f={'rejectUnauthorized':![],'method':_0xf955('0xcf'),'url':_0xf955('0xd0'),'headers':{'X-APIKEY':_0x30baa1[_0xf955('0xcb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x19665c['user'][_0xf955('0xce')]],'buttons':null,'topic':_0x4e3013[_0xf955('0xd1')],'note':_['isNull'](_0x4e3013[_0xf955('0xcc')])?null:getMustacheRender(_0x4e3013[_0xf955('0xcc')],_0xc881d4),'metadata':null},'redirect':_0xf955('0xd2'),'json':!![]};try{if(!_[_0xf955('0xd3')](_0x4e3013[_0xf955('0xcd')])){var _0x38e031=getMustacheRender(_0x4e3013[_0xf955('0xcd')],_0xc881d4);var _0x4f53ef=JSON[_0xf955('0x8b')](_0x38e031);_0x410d1f[_0xf955('0x3a')]['metadata']=_0x4f53ef;}}catch(_0x5395aa){throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xd5'));}return rp(_0x410d1f);}else{throw new db[(_0xf955('0x9d'))]['ValidationError'](_0xf955('0xd6'));}})[_0xf955('0x1f')](function(_0x57e0d7){_0x345a7c=_0x57e0d7;if(_0x345a7c['id']){var _0x54903a={'body':_0x345a7c[_0xf955('0xd7')],'ChatWebsiteId':_0x4e3013['id'],'ChatInteractionId':_0x5a6abe['id'],'direction':_0xf955('0xd8'),'UserId':_0x19665c[_0xf955('0xa7')]['id']};return db[_0xf955('0xd9')]['create'](_0x54903a,{});}else{throw new db[(_0xf955('0x9d'))][(_0xf955('0xd4'))](_0xf955('0xda'));}})[_0xf955('0x1f')](function(){return _0x5a6abe[_0xf955('0xdb')]({'vidaooSessionId':_0x345a7c['id']});})[_0xf955('0x1f')](respondWithResult(_0x437020,null))[_0xf955('0x47')](handleError(_0x437020,null));};exports[_0xf955('0xdc')]=function(_0x4c7a54,_0xde084e){if(_0x4c7a54[_0xf955('0x3a')]['id']){delete _0x4c7a54[_0xf955('0x3a')]['id'];}return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x4c7a54[_0xf955('0xc7')]['id']},'include':[{'model':db[_0xf955('0xdd')],'as':_0xf955('0x77')}]})[_0xf955('0x1f')](handleEntityNotFound(_0xde084e,null))[_0xf955('0x1f')](saveUpdates(_0x4c7a54['body'],null))[_0xf955('0x1f')](respondWithResult(_0xde084e,null))[_0xf955('0x47')](handleError(_0xde084e,null));};exports[_0xf955('0xde')]=function(_0x27391f,_0x269ae2,_0x3250df){if(_0x27391f[_0xf955('0x3a')]['id']){delete _0x27391f['body']['id'];}return db[_0xf955('0xad')]['find']({'where':{'id':_0x27391f[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](function(_0x14cde9){if(!_0x14cde9){logger[_0xf955('0x25')](_0xf955('0xdf'),_0xf955('0xde'),0x194,_0xf955('0xe0'));_0x269ae2[_0xf955('0x2a')](0x194);}else{if(_0x14cde9[_0xf955('0x84')]){throw new db['Sequelize'][(_0xf955('0xd4'))](_0xf955('0xe1'));}}return _0x14cde9;})[_0xf955('0x1f')](function(_0x3d5c15){if(_0x3d5c15){return _0x3d5c15[_0xf955('0xe2')]({'closed':_0x27391f[_0xf955('0x3a')]['closed'],'disposition':_0x27391f[_0xf955('0x3a')][_0xf955('0xe3')]})[_0xf955('0x1f')](function(_0x5c8a3f){return _0x5c8a3f;});}})[_0xf955('0x1f')](function(_0x471223){return respondWithRpcPromise(_0xf955('0xe4'),_0xf955('0xde'),_0x27391f[_0xf955('0x3a')],client9004);})[_0xf955('0x1f')](respondWithResult(_0x269ae2,null))['catch'](handleError(_0x269ae2,null));};exports[_0xf955('0xe5')]=function(_0x4775bd,_0x2a862f,_0x42e3eb){_0x4775bd[_0xf955('0x3a')][_0xf955('0x38')]=_0x4775bd['file'][_0xf955('0xe6')];_0x4775bd['body']['basename']=_0x4775bd['file']['filename'];_0x4775bd[_0xf955('0x3a')]['type']=_0x4775bd[_0xf955('0xe7')][_0xf955('0xe8')];return db['Attachment'][_0xf955('0xc6')](_0x4775bd['body'])[_0xf955('0x1f')](respondWithResult(_0x2a862f,0xc9))['catch'](handleError(_0x2a862f,null));};exports[_0xf955('0xe9')]=function(_0x267963,_0x28ce39,_0x43a5c3){return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0x267963['params']['id']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null))[_0xf955('0x1f')](function(_0x30fd01){if(_0x30fd01){if(_0x30fd01[_0xf955('0xeb')]){return _0x28ce39[_0xf955('0x2c')](0x193)[_0xf955('0x2d')]({'status':0x193,'message':_0xf955('0xec')});}return db[_0xf955('0xed')][_0xf955('0xea')]({'where':{'id':_0x267963[_0xf955('0x4c')]['attachId']},'raw':!![]})[_0xf955('0x1f')](handleEntityNotFound(_0x28ce39,null));}})[_0xf955('0x1f')](function(_0x444e24){if(_0x444e24){var _0x2fb11a=_0x444e24[_0xf955('0xee')]!==null;var _0x2ce35c=path[_0xf955('0xef')](config['root'],_0xf955('0xf0'));if(_0x2fb11a){_0x2ce35c=path[_0xf955('0xef')](_0x2ce35c,_0xf955('0xf1'));}var _0x1e35d7=path[_0xf955('0xef')](_0x2ce35c,_0x444e24[_0xf955('0xf2')]);return _0x28ce39[_0xf955('0xf3')](_0x1e35d7);}})[_0xf955('0x47')](handleError(_0x28ce39,null));};exports[_0xf955('0xf4')]=function(_0x38016a,_0x52ad4d){var _0x1620ec=null;var _0x2c8e49=null;var _0x2b3deb=null;var _0x1ae12a=null;if(_0x38016a[_0xf955('0x3a')]['id']){delete _0x38016a[_0xf955('0x3a')]['id'];}if(_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')]){_0x1ae12a=path['join'](config[_0xf955('0xf6')],_0xf955('0xf7'),util[_0xf955('0xf8')](_0xf955('0xf9'),Date[_0xf955('0xfa')]()));_0x38016a[_0xf955('0x3a')][_0xf955('0xfb')]=_0x1ae12a;}return db[_0xf955('0xad')]['find']({'where':{'id':_0x38016a['params']['id']},'include':[{'model':db[_0xf955('0xd9')],'as':_0xf955('0xfc'),'include':[{'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd')}]}]})['then'](handleEntityNotFound(_0x52ad4d,null))['then'](saveUpdates(_0x38016a[_0xf955('0x3a')],null))[_0xf955('0x1f')](function(_0x4860ad){if(_0x4860ad){_0x1620ec=_0x4860ad;return db[_0xf955('0xca')][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0xa5')]}});}})[_0xf955('0x1f')](function(_0x1c0211){if(_0x1c0211){_0x2b3deb=_0x1c0211;return db['CmContact'][_0xf955('0x71')]({'where':{'id':_0x1620ec[_0xf955('0x7c')]}});}})[_0xf955('0x1f')](function(_0x106640){if(_0x106640){_0x2c8e49=_0x106640;if(_0x1ae12a){var _0x101722=null;for(var _0x479dc0=0x1;_0x479dc0<_0x1620ec[_0xf955('0xfc')]['length'];++_0x479dc0){_0x101722=_0x1620ec[_0xf955('0xfc')][_0x479dc0];var _0x570005=_0x101722[_0xf955('0x84')]?util[_0xf955('0xf8')](_0xf955('0xfe'),_0x2b3deb[_0xf955('0xff')],_0x101722[_0xf955('0x84')]):_0xf955('0x100');var _0x85661f=_0x38016a[_0xf955('0x3a')][_0xf955('0x101')]||util[_0xf955('0xf8')]('%s%d','Visitor',_0x101722[_0xf955('0x7c')]);switch(_0x2b3deb[_0xf955('0x102')]){case _0xf955('0x103'):_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb[_0xf955('0xff')],_0x101722['UserId']):'System';break;case _0xf955('0x104'):_0x570005=_0x101722['UserId']?_0x101722[_0xf955('0xfd')][_0xf955('0x105')]||_0x101722['User']['fullname']:_0xf955('0x100');break;case _0xf955('0x106'):_0x570005=_0x101722[_0xf955('0x84')]?_0x101722[_0xf955('0xfd')][_0xf955('0x41')]:'System';break;default:_0x570005=_0x101722[_0xf955('0x84')]?util['format']('%s%d',_0x2b3deb['agentAlias'],_0x101722[_0xf955('0x84')]):_0xf955('0x100');}var _0x23d382=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x101722[_0xf955('0x107')])['format'](_0xf955('0x108')),_0x101722['direction']==='in'?_0x85661f:_0x570005,_0x101722[_0xf955('0x3a')]);if(!_0x101722[_0xf955('0x109')]){fs['appendFileSync'](_0x1ae12a,_0x23d382);}}return db[_0xf955('0x10a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf955('0x10b')],'as':_0xf955('0x10c'),'raw':!![]}]});}}})[_0xf955('0x1f')](function(_0x1e6165){if(_0x1e6165&&_0x1e6165[_0xf955('0x10c')]&&_0x38016a['body']){var _0x4a6338={'tls':{'rejectUnauthorized':![]}};if(_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')]){_0x4a6338[_0xf955('0x10d')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10d')];}else{_0x4a6338[_0xf955('0x10e')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x10e')];_0x4a6338[_0xf955('0x10f')]=_0x1e6165['Smtp'][_0xf955('0x10f')];_0x4a6338[_0xf955('0x110')]=_0x1e6165[_0xf955('0x10c')][_0xf955('0x110')];}if(_0x1e6165[_0xf955('0x10c')]['authentication']){_0x4a6338[_0xf955('0x111')]={'user':_0x1e6165[_0xf955('0x10c')]['user'],'pass':_0x1e6165[_0xf955('0x10c')]['pass']};}return respondWithRpcPromise('SendMail',_0xf955('0x112'),{'account':_0x4a6338,'message':{'from':util[_0xf955('0xf8')](_0xf955('0x113'),_0x1e6165[_0xf955('0x38')],_0x1e6165['email']||_0x1e6165[_0xf955('0x10c')][_0xf955('0xa7')]),'to':_0x38016a[_0xf955('0x3a')][_0xf955('0xf5')],'subject':'Mail\x20Transcript','text':util[_0xf955('0xf8')](_0xf955('0x114'),_0x38016a['body'][_0xf955('0xf5')]),'attachments':[{'path':_0x1ae12a}]}})[_0xf955('0x1f')](function(){return _0x1620ec;})[_0xf955('0x47')](function(_0x50502a){console[_0xf955('0x25')](_0x50502a);});}else{return _0x1620ec;}})[_0xf955('0x1f')](respondWithStatusCode(_0x52ad4d,0xc8))[_0xf955('0x47')](handleError(_0x52ad4d,null));};exports['addMessage']=function(_0x1d2e9c,_0x49718e,_0x5aeba7){return db['ChatMessage'][_0xf955('0x71')]({'where':{'id':_0x1d2e9c[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x49718e,null))[_0xf955('0x1f')](function(_0x10cd8e){if(_0x10cd8e){return _0x10cd8e[_0xf955('0x115')](_0x1d2e9c['body'][_0xf955('0x116')],_[_0xf955('0x117')](_0x1d2e9c[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{});}})[_0xf955('0x1f')](respondWithResult(_0x49718e,null))[_0xf955('0x47')](handleError(_0x49718e,null));};exports[_0xf955('0x118')]=function(_0x287adf,_0x38177d,_0x56a307){var _0x49c6ca={'raw':![],'where':{}};var _0x36f3b3={};var _0x252118={'count':0x0,'rows':[]};return db[_0xf955('0xad')]['findOne']({'where':{'id':_0x287adf['params']['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x38177d,null))['then'](function(_0x1dd4b4){if(_0x1dd4b4){_0x36f3b3[_0xf955('0x4b')]=_[_0xf955('0x85')](db[_0xf955('0xd9')]['rawAttributes']);_0x36f3b3[_0xf955('0x4c')]=_[_0xf955('0x85')](_0x287adf[_0xf955('0x4c')]);_0x36f3b3['filters']=_[_0xf955('0x4e')](_0x36f3b3['model'],_0x36f3b3[_0xf955('0x4c')]);_0x49c6ca[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x36f3b3[_0xf955('0x4b')],qs['fields'](_0x287adf[_0xf955('0x4c')][_0xf955('0x4f')]));_0x49c6ca[_0xf955('0x50')]=_0x49c6ca['attributes'][_0xf955('0x51')]?_0x49c6ca['attributes']:_0x36f3b3[_0xf955('0x4b')];if(!_0x287adf['query'][_0xf955('0x52')]('nolimit')){_0x49c6ca[_0xf955('0x30')]=qs['limit'](_0x287adf['query']['limit']);_0x49c6ca[_0xf955('0x2e')]=qs['offset'](_0x287adf['query'][_0xf955('0x2e')]);}_0x49c6ca[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0x287adf[_0xf955('0x4c')][_0xf955('0x54')]);_0x49c6ca[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0x287adf['query'],_0x36f3b3[_0xf955('0x4d')]));_0x49c6ca[_0xf955('0x55')][_0xf955('0xc0')]=_0x1dd4b4['id'];if(_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]){_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca[_0xf955('0x55')],{'$or':_[_0xf955('0x40')](_0x49c6ca['attributes'],function(_0x1d1df4){var _0x1b7a62={};_0x1b7a62[_0x1d1df4]={'$like':'%'+_0x287adf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x1b7a62;})});}if(_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')]){var _0x547464=_0x287adf[_0xf955('0x4c')][_0xf955('0x8c')][_0xf955('0x44')](',');var _0x280d1c={};_0x280d1c[_0x547464[0x0]]={'$gte':moment(_0x547464[0x1])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x49c6ca[_0xf955('0x55')]=_[_0xf955('0x39')](_0x49c6ca['where'],_0x280d1c);}_0x49c6ca=_['merge']({},_0x49c6ca,_0x287adf['options']);return db[_0xf955('0xd9')][_0xf955('0x31')]({'where':_0x49c6ca[_0xf955('0x55')]})[_0xf955('0x1f')](function(_0x14bed6){_0x252118[_0xf955('0x31')]=_0x14bed6;if(_0x287adf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x49c6ca[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')]['findAll'](_0x49c6ca);})[_0xf955('0x1f')](function(_0x7996b8){_0x252118[_0xf955('0xc2')]=_0x7996b8;return _0x252118;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x38177d,_0x49c6ca))[_0xf955('0x47')](handleError(_0x38177d,null));};exports['getMyMessages']=function(_0xac8cdf,_0x70fa9f,_0x5e650f){var _0x39d911={'where':{}},_0x2fbf0c={},_0x1612e4={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf955('0xea')]({'where':{'id':_0xac8cdf[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x70fa9f,null))[_0xf955('0x1f')](function(_0x1a7da8){if(_0x1a7da8){_0x2fbf0c[_0xf955('0x4b')]=_[_0xf955('0x85')](db['ChatMessage'][_0xf955('0x49')]);_0x2fbf0c['query']=_['keys'](_0xac8cdf['query']);_0x2fbf0c[_0xf955('0x4d')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],_0x2fbf0c[_0xf955('0x4c')]);_0x39d911[_0xf955('0x50')]=_[_0xf955('0x4e')](_0x2fbf0c[_0xf955('0x4b')],qs['fields'](_0xac8cdf['query'][_0xf955('0x4f')]));_0x39d911[_0xf955('0x50')]=_0x39d911['attributes']['length']?_0x39d911[_0xf955('0x50')]:_0x2fbf0c[_0xf955('0x4b')];if(!_0xac8cdf[_0xf955('0x4c')]['hasOwnProperty']('nolimit')){_0x39d911[_0xf955('0x30')]=qs[_0xf955('0x30')](_0xac8cdf[_0xf955('0x4c')][_0xf955('0x30')]);_0x39d911[_0xf955('0x2e')]=qs['offset'](_0xac8cdf['query'][_0xf955('0x2e')]);}_0x39d911[_0xf955('0xa2')]=qs[_0xf955('0x54')](_0xac8cdf[_0xf955('0x4c')]['sort']);_0x39d911[_0xf955('0x55')]=qs[_0xf955('0x4d')](_[_0xf955('0x119')](_0xac8cdf[_0xf955('0x4c')],_0x2fbf0c[_0xf955('0x4d')]));_0x39d911[_0xf955('0x55')]['ChatInteractionId']=_0x1a7da8['id'];if(_0xac8cdf['query'][_0xf955('0x96')]){_0x39d911['where']=_[_0xf955('0x39')](_0x39d911[_0xf955('0x55')],{'$or':_['map'](_0x39d911['attributes'],function(_0x4a3d8c){var _0x170ea7={};_0x170ea7[_0x4a3d8c]={'$like':'%'+_0xac8cdf[_0xf955('0x4c')][_0xf955('0x96')]+'%'};return _0x170ea7;})});}_0x39d911[_0xf955('0x55')][_0xf955('0x109')]=![];if(_0xac8cdf[_0xf955('0x4c')]['id']){_0x39d911[_0xf955('0x55')]['id']={'$gt':_0xac8cdf[_0xf955('0x4c')]['id']};}_0x39d911=_[_0xf955('0x39')]({},_0x39d911,_0xac8cdf['options']);return db[_0xf955('0xd9')]['count']({'where':_0x39d911['where']})[_0xf955('0x1f')](function(_0x36327c){_0x1612e4[_0xf955('0x31')]=_0x36327c;_0x39d911[_0xf955('0xc4')]=[];if(_0xac8cdf['query'][_0xf955('0x11a')]){_0x39d911['include'][_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':_0xf955('0xfd'),'attributes':['id',_0xf955('0x41'),'alias']});}if(_0xac8cdf[_0xf955('0x4c')][_0xf955('0xc3')]){_0x39d911[_0xf955('0xc4')]=[{'all':!![]}];}return db[_0xf955('0xd9')][_0xf955('0x11b')](_0x39d911);})[_0xf955('0x1f')](function(_0x3e4239){_0x1612e4[_0xf955('0xc2')]=_0x3e4239;return _0x1612e4;});}})[_0xf955('0x1f')](respondWithFilteredResult(_0x70fa9f,_0x39d911))['catch'](handleError(_0x70fa9f,null));};exports[_0xf955('0x11c')]=function(_0x11a228,_0x2d37c2,_0x932b98){return db[_0xf955('0xad')]['find']({'where':{'id':_0x11a228[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x2d37c2,null))[_0xf955('0x1f')](function(_0x147f3c){if(_0x147f3c){return _0x147f3c[_0xf955('0x11d')](_0x11a228[_0xf955('0x3a')]['ids'],_[_0xf955('0x117')](_0x11a228[_0xf955('0x3a')],[_0xf955('0x116'),'id'])||{})[_0xf955('0x11e')](function(){return db[_0xf955('0x11f')]['findAll']({'attributes':['id',_0xf955('0x38'),_0xf955('0x57')],'where':{'id':_0x11a228[_0xf955('0x3a')]['ids']}});})[_0xf955('0x1f')](function(_0xfcaf21){socket['emit'](_0xf955('0x120'),{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]});return{'id':Number(_0x11a228[_0xf955('0xc7')]['id']),'tags':_0xfcaf21||[]};});}})[_0xf955('0x1f')](respondWithResult(_0x2d37c2,null))[_0xf955('0x47')](handleError(_0x2d37c2,null));};exports['removeTags']=function(_0x572efd,_0x357dbc,_0x2b9880){return db[_0xf955('0xad')][_0xf955('0x71')]({'where':{'id':_0x572efd[_0xf955('0xc7')]['id']}})[_0xf955('0x1f')](handleEntityNotFound(_0x357dbc,null))['then'](function(_0x23968f){if(_0x23968f){return _0x23968f[_0xf955('0x121')](_0x572efd[_0xf955('0x4c')][_0xf955('0x116')]);}})['then'](respondWithStatusCode(_0x357dbc,null))[_0xf955('0x47')](handleError(_0x357dbc,null));};exports[_0xf955('0xf3')]=function(_0x3842e1,_0x204e4e){var _0x47b877=moment()[_0xf955('0x122')]()[_0xf955('0xbe')]();var _0x1624e9=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),'tmp');var _0x3ccc35=path[_0xf955('0xef')](config[_0xf955('0xf6')],_0xf955('0x123'),_0xf955('0x124'),_0xf955('0x125'));var _0x72b500=path[_0xf955('0xef')](_0x1624e9,_0x47b877);var _0x1d4aa6=util[_0xf955('0xf8')](_0xf955('0x126'),_0x3842e1[_0xf955('0xc7')]['id'],_0x47b877);var _0x4896ae=path[_0xf955('0xef')](_0x1624e9,_0x1d4aa6);var _0x3b67e3=[];_0x3b67e3[_0xf955('0x46')]({'model':db['User'],'as':_0xf955('0xfd'),'attributes':['id','fullname'],'raw':!![]});_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xdd')],'as':_0xf955('0x77'),'attributes':['id',_0xf955('0x127'),'lastName'],'raw':!![]});if(_0x3842e1['query']['attachments']){_0x3b67e3[_0xf955('0x46')]({'model':db[_0xf955('0xed')],'as':_0xf955('0xed'),'raw':!![]});}var _0x21b589=[{'model':db[_0xf955('0xd9')],'as':'Messages','attributes':['id',_0xf955('0x3a'),_0xf955('0x107'),_0xf955('0x128'),_0xf955('0x109'),'read'],'include':_0x3b67e3}];_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xca')],'as':_0xf955('0x129'),'attributes':['id',_0xf955('0x38')]});_0x21b589[_0xf955('0x46')]({'model':db[_0xf955('0xfd')],'as':'Owner','attributes':['id',_0xf955('0x41')]});return db['ChatInteraction'][_0xf955('0x71')]({'where':{'id':_0x3842e1['params']['id']},'include':_0x21b589})[_0xf955('0x1f')](handleEntityNotFound(_0x204e4e,null))[_0xf955('0x1f')](function(_0x1ed31c){if(_0x1ed31c){var _0x2e8dc2=_0x1ed31c[_0xf955('0x12a')]({'plain':!![]});fs[_0xf955('0x12b')](_0x72b500);var _0x58b727={'channel':_0xf955('0x12c'),'account':_0x2e8dc2[_0xf955('0x129')][_0xf955('0x38')],'agent':_0x2e8dc2[_0xf955('0x12d')]?_0x2e8dc2[_0xf955('0x12d')][_0xf955('0x41')]:_0xf955('0x12e'),'createdAt':moment(_0x2e8dc2['createdAt'])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')](),'closedAt':_0x2e8dc2['closed']?moment(_0x2e8dc2[_0xf955('0x12f')])[_0xf955('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf955('0xbe')]():'','disposition':_0x2e8dc2['disposition'],'chatInfo':{'browser':_0x2e8dc2[_0xf955('0x130')],'os':_0x2e8dc2['osName'],'referer':_0x2e8dc2[_0xf955('0x131')],'customerIp':_0x2e8dc2[_0xf955('0x132')],'customerPort':_0x2e8dc2[_0xf955('0x133')]?_0x2e8dc2[_0xf955('0x133')]:'N.A.'},'messages':_(_0x2e8dc2[_0xf955('0xfc')])[_0xf955('0x134')]()[_0xf955('0x96')]({'secret':![]})[_0xf955('0x40')](function(_0x1307a6){if(_0x1307a6[_0xf955('0xed')]){var _0x3328b9=path[_0xf955('0xef')](_0x3ccc35,_0x1307a6['Attachment'][_0xf955('0xf2')]);if(fs[_0xf955('0x135')](_0x3328b9)){fs[_0xf955('0x136')](_0x3328b9)[_0xf955('0x137')](fs['createWriteStream'](path[_0xf955('0xef')](_0x72b500,_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')])));}}return{'date':moment(_0x1307a6[_0xf955('0x107')])[_0xf955('0xf8')](_0xf955('0x138'))['toString'](),'sender':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?_0x1307a6['User']?_0x1307a6[_0xf955('0xfd')][_0xf955('0x41')]:_0xf955('0x100'):_0x1307a6[_0xf955('0x77')][_0xf955('0x127')]+(_0x1307a6[_0xf955('0x77')][_0xf955('0x139')]?'\x20'+_0x1307a6['Contact'][_0xf955('0x139')]:''),'body':_0x1307a6[_0xf955('0xed')]?_0x1307a6[_0xf955('0xed')][_0xf955('0xf2')]:_0x1307a6[_0xf955('0x3a')],'direction':_0x1307a6[_0xf955('0x128')]===_0xf955('0xd8')?'A':'C','secret':_0x1307a6['secret'],'read':_0x1307a6[_0xf955('0x91')],'attachment':_0x1307a6[_0xf955('0xed')]};})[_0xf955('0x73')]()};return ejs[_0xf955('0x13a')](path[_0xf955('0xef')](config[_0xf955('0xf6')],'server',_0xf955('0x13b'),_0xf955('0x13c')),{'interaction':_0x58b727})[_0xf955('0x1f')](function(_0x385676){var _0x5a9193=path['join'](_0x72b500,_0xf955('0x13d')+_0x2e8dc2['id']+'-'+_0x47b877+_0xf955('0x13e'));var _0x157508={'path':_0x5a9193,'channel':'Chat','interactionId':_0x2e8dc2['id']};return pdf[_0xf955('0x13f')](_0x385676,_0x157508);})['then'](function(){return new BPromise(function(_0x37bdd4,_0x4f8fc8){zipdir(_0x72b500,{'saveTo':_0x4896ae},function(_0x5f3e0f,_0x4ad147){if(_0x5f3e0f)return _0x4f8fc8(_0x5f3e0f);return _0x37bdd4(_0x4ad147);});})[_0xf955('0x1f')](function(){return new BPromise(function(_0x2dc607,_0x355871){rimraf(_0x72b500,function(_0x1c5b1d){if(_0x1c5b1d)_0x355871(_0x1c5b1d);return _0x2dc607();});});})[_0xf955('0x1f')](function(){return _0x204e4e[_0xf955('0xf3')](_0x4896ae,_0x1d4aa6,function(_0x5eac2b){if(_0x5eac2b){console[_0xf955('0x140')](_0xf955('0x141'),_0x5eac2b);}else{fs[_0xf955('0x142')](_0x4896ae);}});});});}else{return _0x204e4e[_0xf955('0x2a')](0xc8);}})[_0xf955('0x47')](handleError(_0x204e4e,null));};
\ No newline at end of file
+var _0x0b0e=['closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','spread','chatInteractionTags:save','removeTags','files','tmp','attachments','lastName','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','createReadStream','pipe','createWriteStream','firstName','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','filters','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x238aff,_0x588dd9){var _0x1b3dcf=function(_0x41996e){while(--_0x41996e){_0x238aff['push'](_0x238aff['shift']());}};_0x1b3dcf(++_0x588dd9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x47794f,_0x12c9b3){_0x47794f=_0x47794f-0x0;var _0x2ca51d=_0x0b0e[_0x47794f];return _0x2ca51d;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);var jayson=require(_0xe0b0('0x1e'));var client=jayson['client'][_0xe0b0('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xe0b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xadee6e,_0x519ae8,_0x11fdca,_0x4a4cc0){return new BPromise(function(_0x2d6fb6,_0x100204){var _0x56bcc7=_0x4a4cc0||client;return _0x56bcc7['request'](_0xadee6e,_0x11fdca)[_0xe0b0('0x20')](function(_0x50a441){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'),JSON['stringify'](_0x50a441));if(_0x50a441[_0xe0b0('0x22')]){if(_0x50a441['error'][_0xe0b0('0x23')]===0x1f4){logger[_0xe0b0('0x22')](_0xe0b0('0x24'),_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x100204(_0x50a441['error']['message']);}logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x2d6fb6(_0x50a441['error'][_0xe0b0('0x25')]);}else{logger['info'](_0xe0b0('0x24'),_0x519ae8,'request\x20sent');_0x2d6fb6(_0x50a441[_0xe0b0('0x26')]['message']);}})[_0xe0b0('0x27')](function(_0x4de537){logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x4de537);_0x100204(_0x4de537);});});}function respondWithStatusCode(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0xcc;return function(_0x362aba){if(_0x362aba){return _0x3c221d[_0xe0b0('0x28')](_0x5c5317);}return _0x3c221d[_0xe0b0('0x29')](_0x5c5317)[_0xe0b0('0x2a')]();};}function respondWithResult(_0x3ec2,_0x10745d){_0x10745d=_0x10745d||0xc8;return function(_0x5200a6){if(_0x5200a6){return _0x3ec2[_0xe0b0('0x29')](_0x10745d)[_0xe0b0('0x2b')](_0x5200a6);}};}function respondWithFilteredResult(_0x5b7a64,_0x15e13b){return function(_0x419b1f){if(_0x419b1f){var _0x36d137=typeof _0x15e13b[_0xe0b0('0x2c')]===_0xe0b0('0x2d')&&typeof _0x15e13b[_0xe0b0('0x2e')]===_0xe0b0('0x2d');var _0x4fb3b7=_0x419b1f[_0xe0b0('0x2f')];var _0x3c0109=_0x36d137?0x0:_0x15e13b['offset'];var _0x4fe400=_0x36d137?_0x419b1f[_0xe0b0('0x2f')]:_0x15e13b[_0xe0b0('0x2c')]+_0x15e13b[_0xe0b0('0x2e')];var _0x3f81d5;if(_0x4fe400>=_0x4fb3b7){_0x4fe400=_0x4fb3b7;_0x3f81d5=0xc8;}else{_0x3f81d5=0xce;}_0x5b7a64[_0xe0b0('0x29')](_0x3f81d5);return _0x5b7a64['set'](_0xe0b0('0x30'),_0x3c0109+'-'+_0x4fe400+'/'+_0x4fb3b7)[_0xe0b0('0x2b')](_0x419b1f);}return null;};}function patchUpdates(_0x7867c4){return function(_0x29d725){try{jsonpatch[_0xe0b0('0x31')](_0x29d725,_0x7867c4,!![]);}catch(_0x4fe835){return BPromise[_0xe0b0('0x32')](_0x4fe835);}return _0x29d725[_0xe0b0('0x33')]();};}function saveUpdates(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(_0x3575bc){return _0x3575bc[_0xe0b0('0x34')](_0xfc51d3)[_0xe0b0('0x20')](function(_0x20908f){return _0x20908f;});}return null;};}function removeEntity(_0x2125d5,_0x1dd010){return function(_0xd56467){if(_0xd56467){return _0xd56467[_0xe0b0('0x35')]()[_0xe0b0('0x20')](function(){_0x2125d5[_0xe0b0('0x29')](0xcc)[_0xe0b0('0x2a')]();});}};}function handleEntityNotFound(_0x4cf80c,_0x121608){return function(_0x135be5){if(!_0x135be5){_0x4cf80c[_0xe0b0('0x28')](0x194);}return _0x135be5;};}function handleError(_0x1eb3f9,_0x1a2d24){_0x1a2d24=_0x1a2d24||0x1f4;return function(_0x2c6e60){logger[_0xe0b0('0x22')](_0x2c6e60['stack']);if(_0x2c6e60['name']){delete _0x2c6e60['name'];}_0x1eb3f9['status'](_0x1a2d24)[_0xe0b0('0x36')](_0x2c6e60);};}function getMustacheRender(_0xc3d967,_0xe6f635){return Mustache['render'](_0xc3d967,_[_0xe0b0('0x37')](_0xe6f635[_0xe0b0('0x38')],{'contact':_0xe6f635[_0xe0b0('0x39')],'message':_0xe6f635[_0xe0b0('0x25')],'agent':_0xe6f635['agent'],'interaction':_0xe6f635[_0xe0b0('0x3a')],'account':_0xe6f635[_0xe0b0('0x3b')]}))||'';}function getInteractionUsers(_0x43d352,_0x30dcbb){return new BPromise(function(_0x4265e3,_0x1205db){try{if(_0x30dcbb[_0x43d352['id']]){_0x43d352[_0xe0b0('0x3c')]=_[_0xe0b0('0x3d')](_0x30dcbb[_0x43d352['id']],function(_0xeaffbb){return{'id':_0xeaffbb['id'],'fullname':_0xeaffbb['fullname']};});}}catch(_0x3e349b){_0x1205db(_0x3e349b);}_0x4265e3(_0x43d352);});}function getInteractionTags(_0x54f646,_0x34178d){return new BPromise(function(_0x2d5f47,_0x46c4ea){try{if(_0x54f646[_0xe0b0('0x3e')]){_0x54f646['Tags']=[];_0x54f646[_0xe0b0('0x3e')][_0xe0b0('0x3f')](',')[_0xe0b0('0x40')](function(_0x402a0e){_0x54f646[_0xe0b0('0x41')][_0xe0b0('0x42')](_0x34178d[_0x402a0e]);});}delete _0x54f646[_0xe0b0('0x3e')];}catch(_0x3bde8b){_0x46c4ea(_0x3bde8b);}_0x2d5f47(_0x54f646);});}function updateChatInteraction(_0x52ffe4,_0x2aad80,_0x309bbf){return new BPromise(function(_0x528818,_0x515bd2){return getInteractionUsers(_0x52ffe4,_0x309bbf)[_0xe0b0('0x20')](function(_0x247f8d){return getInteractionTags(_0x247f8d,_0x2aad80);})['then'](function(_0x18a59d){_0x528818(_0x18a59d);})[_0xe0b0('0x27')](function(_0x6bca5c){_0x515bd2(_0x6bca5c);});});}exports[_0xe0b0('0x43')]=function(_0x1a8cc7,_0x5c31b5){var _0x5d2fa2={},_0x51c580={},_0xc3235b={'count':0x0,'rows':[]};var _0x38e715=_['map'](db[_0xe0b0('0x44')][_0xe0b0('0x45')],function(_0x14197b){return{'name':_0x14197b[_0xe0b0('0x46')],'type':_0x14197b[_0xe0b0('0x47')]['key']};});_0x51c580['model']=_[_0xe0b0('0x3d')](_0x38e715,_0xe0b0('0x48'));_0x51c580[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1a8cc7[_0xe0b0('0x49')]);_0x51c580['filters']=_[_0xe0b0('0x4b')](_0x51c580[_0xe0b0('0x4c')],_0x51c580['query']);_0x5d2fa2['attributes']=_['intersection'](_0x51c580[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x5d2fa2['attributes']=_0x5d2fa2[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5d2fa2['attributes']:_0x51c580['model'];if(!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x50')]('nolimit')){_0x5d2fa2[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1a8cc7['query']['limit']);_0x5d2fa2[_0xe0b0('0x2c')]=qs['offset'](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x2c')]);}_0x5d2fa2[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5d2fa2['where']=qs['filters'](_[_0xe0b0('0x53')](_0x1a8cc7['query'],_0x51c580['filters']),_0x38e715);var _0x249d9a=[];var _0x222174=squel['select']()['field']('id')[_0xe0b0('0x54')](_0xe0b0('0x48'))[_0xe0b0('0x54')](_0xe0b0('0x55'))[_0xe0b0('0x56')](_0xe0b0('0x57'));var _0x84fabb=squel['select']()[_0xe0b0('0x54')]('u.id')[_0xe0b0('0x54')]('u.fullname')['field'](_0xe0b0('0x58'))[_0xe0b0('0x56')](_0xe0b0('0x59'),'ui')[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'u',_0xe0b0('0x5c'));var _0x4548da=squel[_0xe0b0('0x5d')]()[_0xe0b0('0x56')]('chat_interactions','i')[_0xe0b0('0x5a')]('cm_contacts','c',_0xe0b0('0x5e'))[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'o',_0xe0b0('0x5f'))[_0xe0b0('0x5a')](_0xe0b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xe0b0('0x5a')](_0xe0b0('0x61'),'me',_0xe0b0('0x62'))[_0xe0b0('0x5a')](_0xe0b0('0x63'),'it',_0xe0b0('0x64'))[_0xe0b0('0x5a')](_0xe0b0('0x57'),'t',_0xe0b0('0x65'));var _0xf331df=squel[_0xe0b0('0x66')]();var _0x18ab99=[];var _0xc719d2=squel[_0xe0b0('0x66')]();var _0xcdf97;if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x67')]){_0xcdf97=as[_0xe0b0('0x68')](_0x1a8cc7['query'][_0xe0b0('0x67')]);var _0xe7fbac=_0xcdf97[_0xe0b0('0x69')];for(var _0x2f24e6=0x0;_0x2f24e6<_0xcdf97[_0xe0b0('0x6a')][_0xe0b0('0x4f')];_0x2f24e6++){var _0x2bdb59=_0xcdf97['conditions'][_0x2f24e6];var _0x47dcc4='i';var _0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0x2bdb59['field']]);if(!_0x139014){switch(_0x2bdb59[_0xe0b0('0x54')]){case _0xe0b0('0x6c'):if(_0x2bdb59[_0xe0b0('0x6d')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+'`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+_0xe0b0('0x6f'));}break;case'Contact':if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){if(_0x2bdb59['value'][_0xe0b0('0x3f')]('\x20')['length']>0x1){_0xf331df[_0xe7fbac]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b0('0x72')](_0x2bdb59['value']),null);}else{var _0x4d75e4='%'+_0x2bdb59[_0xe0b0('0x6d')]+'%';_0xf331df[_0xe7fbac](_0xe0b0('0x73'),_0x4d75e4,_0x4d75e4,_0x4d75e4);}}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),'ContactId']);_0x2bdb59[_0xe0b0('0x54')]=_0xe0b0('0x74');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')]['end']);}break;case'Tag':var _0x4b41a=_0x2bdb59[_0xe0b0('0x6d')][_0xe0b0('0x3f')](',')['map'](function(_0x49b754){return Number(_0x49b754);});_0x4b41a[_0xe0b0('0x40')](function(_0x26f36f){_0xc719d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26f36f+',%');});_0x18ab99=_['union'](_0x18ab99,_0x4b41a);break;case _0xe0b0('0x78'):if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){_0xf331df[_0xe7fbac](_0xe0b0('0x79'),'%'+_0x2bdb59[_0xe0b0('0x6d')]+'%',null);}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0xe0b0('0x7a')]);_0x2bdb59['field']=_0xe0b0('0x7a');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value']['start'],_0x14da9c['value']['end']);}break;case'body':_0x14da9c=as[_0xe0b0('0x75')]('me',null,_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value'][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);break;}}else{var _0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')]['start'],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);}}}else{var _0x86e90=_(_0x1a8cc7[_0xe0b0('0x49')])[_0xe0b0('0x4a')]()[_0xe0b0('0x3d')](function(_0x16a2ae){return _['some'](_0x38e715,[_0xe0b0('0x48'),_0x16a2ae])?_0x16a2ae:undefined;})['compact']()[_0xe0b0('0x6d')]();if(!_[_0xe0b0('0x7b')](_0x86e90)){_0x86e90[_0xe0b0('0x40')](function(_0x9c7221){if(_0x9c7221==='ChatWebsiteId'){_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x7d'),[]['concat'](_0x1a8cc7['query'][_0x9c7221]));}else if(_0x9c7221===_0xe0b0('0x7e')){var _0x30adc5=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x80')];var _0x31dd21=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x81')];_0x4548da[_0xe0b0('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30adc5,_0x31dd21);}else{if(_0x1a8cc7['query'][_0x9c7221]===_0xe0b0('0x82')){_0x4548da['where']('i.'+_0x9c7221+'\x20IS\x20NULL');}else{_0x4548da['where']('i.'+_0x9c7221+'\x20=\x20?',_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221]);}}});}if(_0x1a8cc7['query'][_0xe0b0('0x83')]){if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x83')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`unreadMessages`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')](_0xe0b0('0x84'));}}if(_0x1a8cc7['query'][_0xe0b0('0x85')]){_0x18ab99=_[_0xe0b0('0x86')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x85')])?_0x1a8cc7[_0xe0b0('0x49')]['tag']:new Array(_0x1a8cc7['query']['tag']);_0x18ab99['forEach'](function(_0x5c258b){_0xc719d2['or'](_0xe0b0('0x87'),'%,'+_0x5c258b+',%');});}if(_0x1a8cc7['query'][_0xe0b0('0x88')]){var _0x5f4aaf=_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x88')][_0xe0b0('0x89')]('\x5c','\x5c\x5c')[_0xe0b0('0x89')](/'/g,'\x27\x27');if(qs[_0xe0b0('0x8a')](_0x5f4aaf)){_0xf331df['or'](_0xe0b0('0x8b'),_0x5f4aaf+'%');}else{_0xf331df['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f4aaf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f4aaf+'%');}}}_0x4548da['where'](_0xf331df);_0x4548da[_0xe0b0('0x8c')](_0xe0b0('0x8d'));var _0x264363={'type':db[_0xe0b0('0x8e')][_0xe0b0('0x8f')]['SELECT'],'raw':!![]};var _0x234716=_0x4548da[_0xe0b0('0x90')]();_0x234716[_0xe0b0('0x54')](_0xe0b0('0x8d'));_0x234716[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));if(_0x5d2fa2[_0xe0b0('0x51')]){_0x5d2fa2[_0xe0b0('0x51')]['forEach'](function(_0x589c47){var _0x6e0e9=_0x589c47[0x0]===_0xe0b0('0x92')?_0x589c47[0x0]:'i.'+_0x589c47[0x0];_0x4548da['order'](_0x6e0e9,_0x589c47[0x1]===_0xe0b0('0x93')?![]:!![]);});}if(!_[_0xe0b0('0x7b')](_0x18ab99)){_0x4548da[_0xe0b0('0x6e')](_0xc719d2);_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x94'),_0x18ab99);}BPromise[_0xe0b0('0x95')]()[_0xe0b0('0x20')](function(){if(!_0xcdf97){if(_0x1a8cc7[_0xe0b0('0x49')]['ChatWebsiteId'])return;_0x234716['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x96'));return;}if(_0x1a8cc7['user'][_0xe0b0('0x97')]!==_0xe0b0('0x98'))return;return _0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56c4b9){if(_['isEmpty'](_0x56c4b9)){_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x9b'));_0x4548da['where'](_0xe0b0('0x9b'));}else{_0x234716[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x56c4b9,'id'));_0x4548da[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe0b0('0x3d')](_0x56c4b9,'id'));}});})['then'](function(){if(_0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x97')]===_0xe0b0('0x98')&&!_0xcdf97&&!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x9c')])return[];return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x234716[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x48497e){_0xc3235b[_0xe0b0('0x2f')]=_0x48497e[_0xe0b0('0x4f')];if(_0xc3235b[_0xe0b0('0x2f')]===0x0)return[];return db['sequelize'][_0xe0b0('0x49')](_0x222174['toString'](),_0x264363)[_0xe0b0('0x20')](function(_0x350c40){_0x249d9a=_['keyBy'](_0x350c40,'id');_0x264363=_[_0xe0b0('0x37')](_0x264363,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8cc7['query'][_0xe0b0('0x4d')]){_0x5d2fa2['attributes']['forEach'](function(_0x4f027c){_0x4548da[_0xe0b0('0x54')]('i.'+_0x4f027c);});}else{_0x4548da[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));_0x4548da[_0xe0b0('0x54')]('a.key',_0xe0b0('0x9f'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa0'),'Account.mandatoryDisposition');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa1'),'contactName');_0x4548da['field'](_0xe0b0('0xa2'));_0x4548da['field'](_0xe0b0('0xa3'),_0xe0b0('0xa4'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa5'),_0xe0b0('0xa6'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa7'),'Contact.email');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa8'),_0xe0b0('0xa9'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaa'),'Contact.mobile');_0x4548da['field'](_0xe0b0('0xab'),_0xe0b0('0xac'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xad'),_0xe0b0('0xae'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaf'),_0xe0b0('0xb0'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xb1'),'TagIds');}if(_0x5d2fa2[_0xe0b0('0x2e')])_0x4548da[_0xe0b0('0x2e')](_0x5d2fa2[_0xe0b0('0x2e')]);if(_0x5d2fa2[_0xe0b0('0x2c')])_0x4548da['offset'](_0x5d2fa2[_0xe0b0('0x2c')]);return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x4548da[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x484cb2){if(_0x484cb2[_0xe0b0('0x4f')]>0x0)_0x84fabb['where'](_0xe0b0('0xb2'),_[_0xe0b0('0x3d')](_0x484cb2,'id'));return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x84fabb[_0xe0b0('0x9e')](),_0x264363)['then'](function(_0x567e42){var _0x3822e4=_['groupBy'](_0x567e42,_0xe0b0('0xb3'));var _0x4c82d6=[];_0x484cb2[_0xe0b0('0x40')](function(_0x474fbb){_0x4c82d6[_0xe0b0('0x42')](updateChatInteraction(_0x474fbb,_0x249d9a,_0x3822e4));});return BPromise[_0xe0b0('0xb4')](_0x4c82d6);});});})[_0xe0b0('0x20')](function(_0x1bb4da){_0xc3235b[_0xe0b0('0xb5')]=_0x1bb4da;return _0xc3235b;})['then'](respondWithFilteredResult(_0x5c31b5,_0x5d2fa2))['catch'](handleError(_0x5c31b5,null));};exports[_0xe0b0('0xb6')]=function(_0x717e74,_0x184938){var _0x20d6bd={'raw':![],'where':{'id':_0x717e74[_0xe0b0('0xb7')]['id']}},_0xd83992={};_0xd83992[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db[_0xe0b0('0x44')][_0xe0b0('0x45')]);_0xd83992['query']=_['keys'](_0x717e74[_0xe0b0('0x49')]);_0xd83992[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0xd83992[_0xe0b0('0x4c')],_0xd83992[_0xe0b0('0x49')]);_0x20d6bd[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0xd83992['model'],qs['fields'](_0x717e74[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x20d6bd[_0xe0b0('0x4e')]=_0x20d6bd[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x20d6bd[_0xe0b0('0x4e')]:_0xd83992[_0xe0b0('0x4c')];if(_0x717e74[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x20d6bd[_0xe0b0('0xba')]=[{'all':!![]}];}_0x20d6bd=_['merge']({},_0x20d6bd,_0x717e74[_0xe0b0('0xbb')]);return db[_0xe0b0('0x44')]['find'](_0x20d6bd)[_0xe0b0('0x20')](handleEntityNotFound(_0x184938,null))[_0xe0b0('0x20')](respondWithResult(_0x184938,null))[_0xe0b0('0x27')](handleError(_0x184938,null));};exports[_0xe0b0('0xbc')]=function(_0x41fdef,_0x594f91){return db[_0xe0b0('0x44')][_0xe0b0('0xbc')](_0x41fdef[_0xe0b0('0x38')],{})[_0xe0b0('0x20')](respondWithResult(_0x594f91,0xc9))[_0xe0b0('0x27')](handleError(_0x594f91,null));};exports['update']=function(_0x475404,_0x58d61b){if(_0x475404[_0xe0b0('0x38')]['id']){delete _0x475404[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')]['find']({'where':{'id':_0x475404['params']['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x58d61b,null))[_0xe0b0('0x20')](saveUpdates(_0x475404[_0xe0b0('0x38')],null))['then'](respondWithResult(_0x58d61b,null))['catch'](handleError(_0x58d61b,null));};exports['destroy']=function(_0x5175e1,_0x57694c){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x5175e1[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x57694c,null))[_0xe0b0('0x20')](removeEntity(_0x57694c,null))[_0xe0b0('0x27')](handleError(_0x57694c,null));};exports[_0xe0b0('0xbd')]=function(_0xd73b8a,_0x437588){return db['ChatInteraction']['describe']()[_0xe0b0('0x20')](respondWithResult(_0x437588,null))[_0xe0b0('0x27')](handleError(_0x437588,null));};exports[_0xe0b0('0xbe')]=function(_0x52dfd8,_0x6ab413){var _0x395083=_0x52dfd8[_0xe0b0('0xb7')]['id'];var _0xd231c4;var _0x35ca4e;var _0x1b8d4a;return db['ChatInteraction']['findOne']({'where':{'id':_0x395083}})['then'](function(_0x1ce027){_0xd231c4=_0x1ce027;return db[_0xe0b0('0xbf')][_0xe0b0('0xc0')]({'where':{'id':_0x1ce027[_0xe0b0('0x9c')]},'attributes':['id',_0xe0b0('0xc1'),_0xe0b0('0xc2'),_0xe0b0('0xc3'),_0xe0b0('0xc4'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x28ba25){if(_0x28ba25&&_0x28ba25[_0xe0b0('0xc1')]&&_0x28ba25[_0xe0b0('0xc2')]){_0x35ca4e=_0x28ba25;var _0x5451e7={'interaction':{'id':_0x395083},'agent':{'id':_0x52dfd8[_0xe0b0('0x99')]['id'],'name':_0x52dfd8[_0xe0b0('0x99')][_0xe0b0('0x48')],'fullname':_0x52dfd8['user'][_0xe0b0('0xc5')],'email':_0x52dfd8['user'][_0xe0b0('0xc6')]},'contact':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x39')],'account':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x3b')]};var _0x26df60={'rejectUnauthorized':![],'method':_0xe0b0('0xc7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x28ba25[_0xe0b0('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x52dfd8[_0xe0b0('0x99')]['email']],'buttons':null,'topic':_0x35ca4e[_0xe0b0('0xc3')],'note':_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xc4')])?null:getMustacheRender(_0x35ca4e['vidaooNote'],_0x5451e7),'metadata':null},'redirect':_0xe0b0('0xc9'),'json':!![]};try{if(!_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xca')])){var _0x566a6e=getMustacheRender(_0x35ca4e[_0xe0b0('0xca')],_0x5451e7);var _0x32f67b=JSON[_0xe0b0('0x7f')](_0x566a6e);_0x26df60[_0xe0b0('0x38')][_0xe0b0('0xcb')]=_0x32f67b;}}catch(_0x15be52){throw new db['Sequelize'][(_0xe0b0('0xcc'))](_0xe0b0('0xcd'));}return rp(_0x26df60);}else{throw new db[(_0xe0b0('0x8e'))][(_0xe0b0('0xcc'))](_0xe0b0('0xce'));}})[_0xe0b0('0x20')](function(_0x38b2cf){_0x1b8d4a=_0x38b2cf;if(_0x1b8d4a['id']){var _0x31b01a={'body':_0x1b8d4a[_0xe0b0('0xcf')],'ChatWebsiteId':_0x35ca4e['id'],'ChatInteractionId':_0xd231c4['id'],'direction':_0xe0b0('0xd0'),'UserId':_0x52dfd8[_0xe0b0('0x99')]['id']};return db['ChatMessage'][_0xe0b0('0xbc')](_0x31b01a,{});}else{throw new db['Sequelize']['ValidationError'](_0xe0b0('0xd1'));}})[_0xe0b0('0x20')](function(){return _0xd231c4['updateAttributes']({'vidaooSessionId':_0x1b8d4a['id']});})[_0xe0b0('0x20')](respondWithResult(_0x6ab413,null))[_0xe0b0('0x27')](handleError(_0x6ab413,null));};exports[_0xe0b0('0xd2')]=function(_0x11e969,_0xa18619){if(_0x11e969[_0xe0b0('0x38')]['id']){delete _0x11e969[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x11e969['params']['id']},'include':[{'model':db[_0xe0b0('0xd3')],'as':_0xe0b0('0xd4')}]})[_0xe0b0('0x20')](handleEntityNotFound(_0xa18619,null))[_0xe0b0('0x20')](saveUpdates(_0x11e969['body'],null))['then'](respondWithResult(_0xa18619,null))[_0xe0b0('0x27')](handleError(_0xa18619,null));};exports[_0xe0b0('0xd5')]=function(_0x333c2a,_0x2cd7db,_0x308d03){if(_0x333c2a[_0xe0b0('0x38')]['id']){delete _0x333c2a[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x333c2a[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](function(_0xaa7a71){if(!_0xaa7a71){logger[_0xe0b0('0x22')](_0xe0b0('0xd6'),_0xe0b0('0xd5'),0x194,_0xe0b0('0xd7'));_0x2cd7db[_0xe0b0('0x28')](0x194);}else{if(_0xaa7a71[_0xe0b0('0x7a')]){throw new db[(_0xe0b0('0x8e'))]['ValidationError'](_0xe0b0('0xd8'));}}return _0xaa7a71;})[_0xe0b0('0x20')](function(_0x36a006){if(_0x36a006){return _0x36a006['update']({'closed':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xd9')],'disposition':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xda')]})[_0xe0b0('0x20')](function(_0x3532f1){return _0x3532f1;});}})[_0xe0b0('0x20')](function(_0x581ae9){return respondWithRpcPromise(_0xe0b0('0xdb'),'abandon',_0x333c2a[_0xe0b0('0x38')],client9004);})['then'](respondWithResult(_0x2cd7db,null))[_0xe0b0('0x27')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xdc')]=function(_0x4bd799,_0x2102bc,_0x4f0cbe){_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0x48')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xde')];_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0xdf')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xe0')];_0x4bd799['body'][_0xe0b0('0x47')]=_0x4bd799['file']['mimetype'];return db[_0xe0b0('0xe1')][_0xe0b0('0xbc')](_0x4bd799[_0xe0b0('0x38')])['then'](respondWithResult(_0x2102bc,0xc9))['catch'](handleError(_0x2102bc,null));};exports[_0xe0b0('0xe2')]=function(_0x3c207e,_0x4fc379,_0x98e7c9){return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0xb7')]['id']},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null))[_0xe0b0('0x20')](function(_0x4074bb){if(_0x4074bb){if(_0x4074bb[_0xe0b0('0xd9')]){return _0x4fc379[_0xe0b0('0x29')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe0b0('0xe1')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0x49')][_0xe0b0('0xe3')]},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null));}})[_0xe0b0('0x20')](function(_0x54f90a){if(_0x54f90a){var _0x1aa40b=_0x54f90a[_0xe0b0('0xe4')]!==null;var _0x22c8a2=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server/files/attachments/');if(_0x1aa40b){_0x22c8a2=path[_0xe0b0('0xe5')](_0x22c8a2,_0xe0b0('0xe7'));}var _0x321b0b=path[_0xe0b0('0xe5')](_0x22c8a2,_0x54f90a[_0xe0b0('0xdf')]);return _0x4fc379[_0xe0b0('0xe8')](_0x321b0b);}})[_0xe0b0('0x27')](handleError(_0x4fc379,null));};exports[_0xe0b0('0xe9')]=function(_0x1ccfc1,_0x2b1474){var _0x574f0a=null;var _0x108371=null;var _0x3f2ec=null;var _0x4f0db7=null;if(_0x1ccfc1[_0xe0b0('0x38')]['id']){delete _0x1ccfc1['body']['id'];}if(_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]){_0x4f0db7=path['join'](config[_0xe0b0('0xe6')],_0xe0b0('0xeb'),util[_0xe0b0('0xec')](_0xe0b0('0xed'),Date[_0xe0b0('0xee')]()));_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xef')]=_0x4f0db7;}return db['ChatInteraction']['find']({'where':{'id':_0x1ccfc1[_0xe0b0('0xb7')]['id']},'include':[{'model':db[_0xe0b0('0xf0')],'as':_0xe0b0('0xf1'),'include':[{'model':db['User'],'as':_0xe0b0('0x78')}]}]})[_0xe0b0('0x20')](handleEntityNotFound(_0x2b1474,null))[_0xe0b0('0x20')](saveUpdates(_0x1ccfc1[_0xe0b0('0x38')],null))[_0xe0b0('0x20')](function(_0x117d00){if(_0x117d00){_0x574f0a=_0x117d00;return db[_0xe0b0('0xbf')][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x9c')]}});}})[_0xe0b0('0x20')](function(_0x5aa313){if(_0x5aa313){_0x3f2ec=_0x5aa313;return db['CmContact'][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x74')]}});}})[_0xe0b0('0x20')](function(_0x3c93c6){if(_0x3c93c6){_0x108371=_0x3c93c6;if(_0x4f0db7){var _0x203351=null;for(var _0x343409=0x1;_0x343409<_0x574f0a[_0xe0b0('0xf1')]['length'];++_0x343409){_0x203351=_0x574f0a[_0xe0b0('0xf1')][_0x343409];var _0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util['format'](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351['UserId']):'System';var _0x3b3473=_0x1ccfc1['body'][_0xe0b0('0xf4')]||util['format'](_0xe0b0('0xf2'),_0xe0b0('0xf5'),_0x203351['ContactId']);switch(_0x3f2ec[_0xe0b0('0xf6')]){case _0xe0b0('0xf7'):_0x2e7fe2=_0x203351['UserId']?util[_0xe0b0('0xec')]('%s%d',_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');break;case _0xe0b0('0xf9'):_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?_0x203351[_0xe0b0('0x78')][_0xe0b0('0xfa')]||_0x203351['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8');break;case'agent_fullname':_0x2e7fe2=_0x203351['UserId']?_0x203351[_0xe0b0('0x78')]['fullname']:_0xe0b0('0xf8');break;default:_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util[_0xe0b0('0xec')](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');}var _0x8364b0=util[_0xe0b0('0xec')](_0xe0b0('0xfb'),moment(_0x203351[_0xe0b0('0x7e')])[_0xe0b0('0xec')](_0xe0b0('0xfc')),_0x203351[_0xe0b0('0xfd')]==='in'?_0x3b3473:_0x2e7fe2,_0x203351['body']);if(!_0x203351[_0xe0b0('0xfe')]){fs[_0xe0b0('0xff')](_0x4f0db7,_0x8364b0);}}return db[_0xe0b0('0x100')][_0xe0b0('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b0('0x101')],'as':'Smtp','raw':!![]}]});}}})[_0xe0b0('0x20')](function(_0x3a75d8){if(_0x3a75d8&&_0x3a75d8[_0xe0b0('0x102')]&&_0x1ccfc1[_0xe0b0('0x38')]){var _0x1e2ef8={'tls':{'rejectUnauthorized':![]}};if(_0x3a75d8[_0xe0b0('0x102')]['service']){_0x1e2ef8[_0xe0b0('0x103')]=_0x3a75d8['Smtp'][_0xe0b0('0x103')];}else{_0x1e2ef8[_0xe0b0('0x104')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x104')];_0x1e2ef8[_0xe0b0('0x105')]=_0x3a75d8[_0xe0b0('0x102')]['port'];_0x1e2ef8[_0xe0b0('0x106')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x106')];}if(_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x107')]){_0x1e2ef8[_0xe0b0('0x108')]={'user':_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x99')],'pass':_0x3a75d8['Smtp']['pass']};}return respondWithRpcPromise(_0xe0b0('0x109'),'sendMail',{'account':_0x1e2ef8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3a75d8['name'],_0x3a75d8[_0xe0b0('0xc6')]||_0x3a75d8['Smtp']['user']),'to':_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')],'subject':_0xe0b0('0x10a'),'text':util[_0xe0b0('0xec')](_0xe0b0('0x10b'),_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]),'attachments':[{'path':_0x4f0db7}]}})[_0xe0b0('0x20')](function(){return _0x574f0a;})[_0xe0b0('0x27')](function(_0x43f1b1){console['error'](_0x43f1b1);});}else{return _0x574f0a;}})['then'](respondWithStatusCode(_0x2b1474,0xc8))[_0xe0b0('0x27')](handleError(_0x2b1474,null));};exports[_0xe0b0('0x10c')]=function(_0x2b8a03,_0x4f784a,_0x4b5a48){return db[_0xe0b0('0xf0')]['find']({'where':{'id':_0x2b8a03[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x4f784a,null))['then'](function(_0x2e393e){if(_0x2e393e){return _0x2e393e[_0xe0b0('0x10c')](_0x2b8a03[_0xe0b0('0x38')][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x2b8a03[_0xe0b0('0x38')],[_0xe0b0('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x4f784a,null))[_0xe0b0('0x27')](handleError(_0x4f784a,null));};exports[_0xe0b0('0x10f')]=function(_0x1f3162,_0x22da3a,_0x2b2c68){var _0x5c5c2d={'raw':![],'where':{}};var _0x4d6429={};var _0x322d1b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1f3162[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22da3a,null))[_0xe0b0('0x20')](function(_0x151da2){if(_0x151da2){_0x4d6429[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage']['rawAttributes']);_0x4d6429[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1f3162[_0xe0b0('0x49')]);_0x4d6429[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x4d6429[_0xe0b0('0x4c')],_0x4d6429[_0xe0b0('0x49')]);_0x5c5c2d[_0xe0b0('0x4e')]=_['intersection'](_0x4d6429[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1f3162[_0xe0b0('0x49')]['fields']));_0x5c5c2d[_0xe0b0('0x4e')]=_0x5c5c2d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5c5c2d[_0xe0b0('0x4e')]:_0x4d6429[_0xe0b0('0x4c')];if(!_0x1f3162[_0xe0b0('0x49')]['hasOwnProperty'](_0xe0b0('0x110'))){_0x5c5c2d[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1f3162['query'][_0xe0b0('0x2e')]);_0x5c5c2d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x1f3162[_0xe0b0('0x49')]['offset']);}_0x5c5c2d[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5c5c2d[_0xe0b0('0x7c')]=qs[_0xe0b0('0xb8')](_[_0xe0b0('0x53')](_0x1f3162[_0xe0b0('0x49')],_0x4d6429['filters']));_0x5c5c2d[_0xe0b0('0x7c')]['ChatInteractionId']=_0x151da2['id'];if(_0x1f3162['query'][_0xe0b0('0x88')]){_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d['where'],{'$or':_[_0xe0b0('0x3d')](_0x5c5c2d['attributes'],function(_0xf0c217){var _0x4c5406={};_0x4c5406[_0xf0c217]={'$like':'%'+_0x1f3162['query']['filter']+'%'};return _0x4c5406;})});}if(_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x80')]){var _0x55e013=_0x1f3162[_0xe0b0('0x49')]['$gte']['split'](',');var _0x31fa9d={};_0x31fa9d[_0x55e013[0x0]]={'$gte':moment(_0x55e013[0x1])['format'](_0xe0b0('0x111'))};_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d[_0xe0b0('0x7c')],_0x31fa9d);}_0x5c5c2d=_['merge']({},_0x5c5c2d,_0x1f3162[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')][_0xe0b0('0x2f')]({'where':_0x5c5c2d[_0xe0b0('0x7c')]})[_0xe0b0('0x20')](function(_0x51600e){_0x322d1b[_0xe0b0('0x2f')]=_0x51600e;if(_0x1f3162[_0xe0b0('0x49')]['includeAll']){_0x5c5c2d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x5c5c2d);})[_0xe0b0('0x20')](function(_0x1e0374){_0x322d1b[_0xe0b0('0xb5')]=_0x1e0374;return _0x322d1b;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x22da3a,_0x5c5c2d))[_0xe0b0('0x27')](handleError(_0x22da3a,null));};exports[_0xe0b0('0x113')]=function(_0x5b7b02,_0x565f67,_0x2853bf){var _0x4c0d9d={'where':{}},_0x38dd79={},_0x2dc446={'count':0x0,'rows':[]};return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x5b7b02[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x565f67,null))['then'](function(_0x5996a6){if(_0x5996a6){_0x38dd79[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage'][_0xe0b0('0x45')]);_0x38dd79[_0xe0b0('0x49')]=_['keys'](_0x5b7b02[_0xe0b0('0x49')]);_0x38dd79[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x38dd79['model'],_0x38dd79[_0xe0b0('0x49')]);_0x4c0d9d[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0x38dd79[_0xe0b0('0x4c')],qs['fields'](_0x5b7b02[_0xe0b0('0x49')]['fields']));_0x4c0d9d[_0xe0b0('0x4e')]=_0x4c0d9d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x4c0d9d['attributes']:_0x38dd79[_0xe0b0('0x4c')];if(!_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x50')](_0xe0b0('0x110'))){_0x4c0d9d['limit']=qs[_0xe0b0('0x2e')](_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x2e')]);_0x4c0d9d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x5b7b02[_0xe0b0('0x49')]['offset']);}_0x4c0d9d['order']=qs['sort'](_0x5b7b02[_0xe0b0('0x49')]['sort']);_0x4c0d9d[_0xe0b0('0x7c')]=qs['filters'](_['pick'](_0x5b7b02[_0xe0b0('0x49')],_0x38dd79[_0xe0b0('0xb8')]));_0x4c0d9d[_0xe0b0('0x7c')][_0xe0b0('0xb3')]=_0x5996a6['id'];if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x88')]){_0x4c0d9d[_0xe0b0('0x7c')]=_['merge'](_0x4c0d9d[_0xe0b0('0x7c')],{'$or':_[_0xe0b0('0x3d')](_0x4c0d9d[_0xe0b0('0x4e')],function(_0x15033e){var _0x14ba21={};_0x14ba21[_0x15033e]={'$like':'%'+_0x5b7b02[_0xe0b0('0x49')]['filter']+'%'};return _0x14ba21;})});}_0x4c0d9d['where'][_0xe0b0('0xfe')]=![];if(_0x5b7b02[_0xe0b0('0x49')]['id']){_0x4c0d9d[_0xe0b0('0x7c')]['id']={'$gt':_0x5b7b02[_0xe0b0('0x49')]['id']};}_0x4c0d9d=_[_0xe0b0('0x37')]({},_0x4c0d9d,_0x5b7b02[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')]['count']({'where':_0x4c0d9d['where']})[_0xe0b0('0x20')](function(_0x16386b){_0x2dc446[_0xe0b0('0x2f')]=_0x16386b;_0x4c0d9d['include']=[];if(_0x5b7b02['query'][_0xe0b0('0x114')]){_0x4c0d9d[_0xe0b0('0xba')][_0xe0b0('0x42')]({'model':db[_0xe0b0('0x78')],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5'),_0xe0b0('0xfa')]});}if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x4c0d9d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x4c0d9d);})['then'](function(_0x2df3df){_0x2dc446['rows']=_0x2df3df;return _0x2dc446;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x565f67,_0x4c0d9d))[_0xe0b0('0x27')](handleError(_0x565f67,null));};exports['addTags']=function(_0x236966,_0x41fd0e,_0x17e7d4){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x236966[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x41fd0e,null))[_0xe0b0('0x20')](function(_0x19dafb){if(_0x19dafb){return _0x19dafb['setTags'](_0x236966['body'][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x236966['body'],['ids','id'])||{})[_0xe0b0('0x115')](function(){return db['Tag'][_0xe0b0('0x112')]({'attributes':['id',_0xe0b0('0x48'),_0xe0b0('0x55')],'where':{'id':_0x236966[_0xe0b0('0x38')][_0xe0b0('0x10d')]}});})[_0xe0b0('0x20')](function(_0x36106e){socket['emit'](_0xe0b0('0x116'),{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]});return{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]};});}})['then'](respondWithResult(_0x41fd0e,null))[_0xe0b0('0x27')](handleError(_0x41fd0e,null));};exports[_0xe0b0('0x117')]=function(_0x263288,_0x7117ca,_0x21ccfe){return db['ChatInteraction']['find']({'where':{'id':_0x263288['params']['id']}})['then'](handleEntityNotFound(_0x7117ca,null))[_0xe0b0('0x20')](function(_0x1bd420){if(_0x1bd420){return _0x1bd420[_0xe0b0('0x117')](_0x263288['query'][_0xe0b0('0x10d')]);}})[_0xe0b0('0x20')](respondWithStatusCode(_0x7117ca,null))[_0xe0b0('0x27')](handleError(_0x7117ca,null));};exports[_0xe0b0('0xe8')]=function(_0x2d2852,_0x16a02b){var _0x125ead=moment()['unix']()[_0xe0b0('0x9e')]();var _0x380fe1=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server',_0xe0b0('0x118'),_0xe0b0('0x119'));var _0x3eb643=path[_0xe0b0('0xe5')](config['root'],'server',_0xe0b0('0x118'),_0xe0b0('0x11a'));var _0x26bd6c=path[_0xe0b0('0xe5')](_0x380fe1,_0x125ead);var _0x104409=util[_0xe0b0('0xec')]('transcript-%d-%s.zip',_0x2d2852[_0xe0b0('0xb7')]['id'],_0x125ead);var _0x6f9dbd=path[_0xe0b0('0xe5')](_0x380fe1,_0x104409);var _0x4c6646=[];_0x4c6646[_0xe0b0('0x42')]({'model':db['User'],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5')],'raw':!![]});_0x4c6646['push']({'model':db[_0xe0b0('0xd3')],'as':'Contact','attributes':['id','firstName',_0xe0b0('0x11b')],'raw':!![]});if(_0x2d2852['query']['attachments']){_0x4c6646['push']({'model':db[_0xe0b0('0xe1')],'as':_0xe0b0('0xe1'),'raw':!![]});}var _0x573ca9=[{'model':db[_0xe0b0('0xf0')],'as':'Messages','attributes':['id',_0xe0b0('0x38'),_0xe0b0('0x7e'),_0xe0b0('0xfd'),_0xe0b0('0xfe'),'read'],'include':_0x4c6646}];_0x573ca9['push']({'model':db['ChatWebsite'],'as':_0xe0b0('0x11c'),'attributes':['id',_0xe0b0('0x48')]});_0x573ca9['push']({'model':db['User'],'as':_0xe0b0('0x11d'),'attributes':['id',_0xe0b0('0xc5')]});return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x2d2852['params']['id']},'include':_0x573ca9})['then'](handleEntityNotFound(_0x16a02b,null))[_0xe0b0('0x20')](function(_0x329684){if(_0x329684){var _0x5b1bb7=_0x329684[_0xe0b0('0x11e')]({'plain':!![]});fs[_0xe0b0('0x11f')](_0x26bd6c);var _0x5b7df1={'channel':'Chat','account':_0x5b1bb7['Account'][_0xe0b0('0x48')],'agent':_0x5b1bb7[_0xe0b0('0x11d')]?_0x5b1bb7['Owner'][_0xe0b0('0xc5')]:_0xe0b0('0x120'),'createdAt':moment(_0x5b1bb7[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'closedAt':_0x5b1bb7[_0xe0b0('0xd9')]?moment(_0x5b1bb7['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')]():'','disposition':_0x5b1bb7['disposition'],'chatInfo':{'browser':_0x5b1bb7[_0xe0b0('0x121')],'os':_0x5b1bb7['osName'],'referer':_0x5b1bb7['referer'],'customerIp':_0x5b1bb7[_0xe0b0('0x122')],'customerPort':_0x5b1bb7[_0xe0b0('0x123')]?_0x5b1bb7[_0xe0b0('0x123')]:_0xe0b0('0x120')},'messages':_(_0x5b1bb7['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x26a916){if(_0x26a916[_0xe0b0('0xe1')]){var _0x5b5bb2=path['join'](_0x3eb643,_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]);if(fs['existsSync'](_0x5b5bb2)){fs[_0xe0b0('0x124')](_0x5b5bb2)[_0xe0b0('0x125')](fs[_0xe0b0('0x126')](path[_0xe0b0('0xe5')](_0x26bd6c,_0x26a916['Attachment'][_0xe0b0('0xdf')])));}}return{'date':moment(_0x26a916[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'sender':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?_0x26a916[_0xe0b0('0x78')]?_0x26a916['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8'):_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x127')]+(_0x26a916[_0xe0b0('0xd4')]['lastName']?'\x20'+_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x11b')]:''),'body':_0x26a916['Attachment']?_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]:_0x26a916[_0xe0b0('0x38')],'direction':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?'A':'C','secret':_0x26a916[_0xe0b0('0xfe')],'read':_0x26a916['read'],'attachment':_0x26a916[_0xe0b0('0xe1')]};})[_0xe0b0('0x6d')]()};return ejs[_0xe0b0('0x128')](path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],_0xe0b0('0x129'),_0xe0b0('0x12a'),_0xe0b0('0x12b')),{'interaction':_0x5b7df1})[_0xe0b0('0x20')](function(_0x1f5871){var _0x4d12b2=path[_0xe0b0('0xe5')](_0x26bd6c,'transcript-'+_0x5b1bb7['id']+'-'+_0x125ead+_0xe0b0('0x12c'));var _0x4b655d={'path':_0x4d12b2,'channel':'Chat','interactionId':_0x5b1bb7['id']};return pdf[_0xe0b0('0x12d')](_0x1f5871,_0x4b655d);})[_0xe0b0('0x20')](function(){return new BPromise(function(_0x5b8cef,_0x4d4eae){zipdir(_0x26bd6c,{'saveTo':_0x6f9dbd},function(_0x388f0d,_0x317dee){if(_0x388f0d)return _0x4d4eae(_0x388f0d);return _0x5b8cef(_0x317dee);});})['then'](function(){return new BPromise(function(_0x5501c2,_0xa7f2cf){rimraf(_0x26bd6c,function(_0x2c61b3){if(_0x2c61b3)_0xa7f2cf(_0x2c61b3);return _0x5501c2();});});})['then'](function(){return _0x16a02b[_0xe0b0('0xe8')](_0x6f9dbd,_0x104409,function(_0x465315){if(_0x465315){console[_0xe0b0('0x12e')](_0xe0b0('0x12f'),_0x465315);}else{fs['unlinkSync'](_0x6f9dbd);}});});});}else{return _0x16a02b[_0xe0b0('0x28')](0xc8);}})[_0xe0b0('0x27')](handleError(_0x16a02b,null));};
\ No newline at end of file
index bfaa69d..a3cb1ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2732=['Users','map','findAll','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','getUsers','setDataValue'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x2732,0x1e8));var _0x2273=function(_0x499418,_0x58ca32){_0x499418=_0x499418-0x0;var _0xa0e702=_0x2732[_0x499418];return _0xa0e702;};'use strict';var EventEmitter=require(_0x2273('0x0'));var ChatInteraction=require(_0x2273('0x1'))['db'][_0x2273('0x2')];var ChatMessage=require(_0x2273('0x1'))['db'][_0x2273('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2273('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a5061){return function(_0x3a809d,_0x19a0c9,_0x16e5c3){_0x3a809d[_0x2273('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x23fbf1){_0x3a809d[_0x2273('0x6')](_0x2273('0x7'),_0x23fbf1[_0x2273('0x8')](function(_0x37a650){return{'id':_0x37a650['id']};}));return ChatMessage[_0x2273('0x9')]({'where':{'ChatInteractionId':_0x3a809d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x559a7d){_0x3a809d['setDataValue']('unreadMessages',_0x559a7d[_0x2273('0xa')]);ChatInteractionEvents[_0x2273('0xb')](_0x3a5061+':'+_0x3a809d['id'],_0x3a809d);ChatInteractionEvents[_0x2273('0xb')](_0x3a5061,_0x3a809d);_0x16e5c3(null);})[_0x2273('0xc')](_0x16e5c3(null));};}for(var e in events){if(events[_0x2273('0xd')](e)){var event=events[e];ChatInteraction[_0x2273('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x0071=['then','setDataValue','Users','map','findAll','emit','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x1b3852,_0x433d0e){var _0x2c8f2c=function(_0x3db1b0){while(--_0x3db1b0){_0x1b3852['push'](_0x1b3852['shift']());}};_0x2c8f2c(++_0x433d0e);}(_0x0071,0x1b1));var _0x1007=function(_0xbf60c7,_0x1a744b){_0xbf60c7=_0xbf60c7-0x0;var _0x4c14ab=_0x0071[_0xbf60c7];return _0x4c14ab;};'use strict';var EventEmitter=require(_0x1007('0x0'));var ChatInteraction=require(_0x1007('0x1'))['db'][_0x1007('0x2')];var ChatMessage=require(_0x1007('0x1'))['db'][_0x1007('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x1007('0x4')](0x0);var events={'afterCreate':_0x1007('0x5'),'afterUpdate':_0x1007('0x6'),'afterDestroy':_0x1007('0x7')};function emitEvent(_0x139893){return function(_0x4051a6,_0x1bc80e,_0x245ce5){_0x4051a6[_0x1007('0x8')]({'attributes':['id'],'raw':!![]})[_0x1007('0x9')](function(_0x2e609e){_0x4051a6[_0x1007('0xa')](_0x1007('0xb'),_0x2e609e[_0x1007('0xc')](function(_0x24de0c){return{'id':_0x24de0c['id']};}));return ChatMessage[_0x1007('0xd')]({'where':{'ChatInteractionId':_0x4051a6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1007('0x9')](function(_0x2cb19d){_0x4051a6[_0x1007('0xa')]('unreadMessages',_0x2cb19d['length']);ChatInteractionEvents['emit'](_0x139893+':'+_0x4051a6['id'],_0x4051a6);ChatInteractionEvents[_0x1007('0xe')](_0x139893,_0x4051a6);_0x245ce5(null);})['catch'](_0x245ce5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x1007('0xf')](e,emitEvent(event));}}module[_0x1007('0x10')]=ChatInteractionEvents;
\ No newline at end of file
index 81000e6..879c6af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a4c=['moment','request-promise','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0xa26a0e,_0x84fb14){var _0x51011d=function(_0xcfe96d){while(--_0xcfe96d){_0xa26a0e['push'](_0xa26a0e['shift']());}};_0x51011d(++_0x84fb14);}(_0x4a4c,0x16d));var _0xc4a4=function(_0x4f9a6f,_0x2a1c06){_0x4f9a6f=_0x4f9a6f-0x0;var _0x1a933a=_0x4a4c[_0x4f9a6f];return _0x1a933a;};'use strict';var _=require('lodash');var util=require(_0xc4a4('0x0'));var logger=require(_0xc4a4('0x1'))(_0xc4a4('0x2'));var moment=require(_0xc4a4('0x3'));var BPromise=require('bluebird');var rp=require(_0xc4a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4a4('0x5'));var config=require(_0xc4a4('0x6'));var attributes=require('./chatInteraction.attributes');module[_0xc4a4('0x7')]=function(_0x8f108c,_0x109eeb){return _0x8f108c[_0xc4a4('0x8')](_0xc4a4('0x9'),attributes,{'tableName':_0xc4a4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4860de,_0x5b1c4e,_0x5406f8){if(_0x4860de[_0xc4a4('0xb')](_0xc4a4('0xc'))){_0x4860de['closedAt']=moment()[_0xc4a4('0xd')](_0xc4a4('0xe'));}_0x5406f8(null,_0x4860de);}},'charset':'utf8mb4','collate':_0xc4a4('0xf')});};
\ No newline at end of file
+var _0xdfc2=['closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x3e2b4b,_0x25d3c7){var _0x11a501=function(_0x79be10){while(--_0x79be10){_0x3e2b4b['push'](_0x3e2b4b['shift']());}};_0x11a501(++_0x25d3c7);}(_0xdfc2,0x100));var _0x2dfc=function(_0x3855bd,_0x3983c1){_0x3855bd=_0x3855bd-0x0;var _0x5ddf0b=_0xdfc2[_0x3855bd];return _0x5ddf0b;};'use strict';var _=require(_0x2dfc('0x0'));var util=require(_0x2dfc('0x1'));var logger=require(_0x2dfc('0x2'))(_0x2dfc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2dfc('0x4'));var fs=require('fs');var path=require(_0x2dfc('0x5'));var rimraf=require(_0x2dfc('0x6'));var config=require(_0x2dfc('0x7'));var attributes=require(_0x2dfc('0x8'));module[_0x2dfc('0x9')]=function(_0x267385,_0x4e4a32){return _0x267385['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e2799,_0x2aea92,_0x1c5f7e){if(_0x1e2799['changed'](_0x2dfc('0xa'))){_0x1e2799['closedAt']=moment()[_0x2dfc('0xb')](_0x2dfc('0xc'));}_0x1c5f7e(null,_0x1e2799);}},'charset':'utf8mb4','collate':_0x2dfc('0xd')});};
\ No newline at end of file
index b2c6f64..45f1d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed28=['ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ChatInteraction','update','options','raw','where','limit','UpdateChatInteraction','stringify','find','addTags','body','omit','ids','spread','info','AddTags','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s'];(function(_0x71185f,_0x371d74){var _0x160ffe=function(_0x57feba){while(--_0x57feba){_0x71185f['push'](_0x71185f['shift']());}};_0x160ffe(++_0x371d74);}(_0xed28,0x14c));var _0x8ed2=function(_0x35f9e7,_0x1b5f66){_0x35f9e7=_0x35f9e7-0x0;var _0x36254a=_0xed28[_0x35f9e7];return _0x36254a;};'use strict';var _=require(_0x8ed2('0x0'));var util=require(_0x8ed2('0x1'));var moment=require(_0x8ed2('0x2'));var BPromise=require(_0x8ed2('0x3'));var rs=require(_0x8ed2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8ed2('0x5'));var logger=require(_0x8ed2('0x6'))(_0x8ed2('0x7'));var config=require(_0x8ed2('0x8'));var jayson=require(_0x8ed2('0x9'));var client=jayson[_0x8ed2('0xa')][_0x8ed2('0xb')]({'port':0x232a});config['redis']=_[_0x8ed2('0xc')](config[_0x8ed2('0xd')],{'host':_0x8ed2('0xe'),'port':0x18eb});var socket=require(_0x8ed2('0xf'))(new Redis(config[_0x8ed2('0xd')]));require(_0x8ed2('0x10'))[_0x8ed2('0x11')](socket);function respondWithRpcPromise(_0x13f928,_0x1ff1b1,_0x5a9877){return new BPromise(function(_0x5839fe,_0x371f1b){return client[_0x8ed2('0x12')](_0x13f928,_0x5a9877)['then'](function(_0x1c79b5){logger['info'](_0x8ed2('0x13'),_0x1ff1b1,'request\x20sent');logger['debug'](_0x8ed2('0x14'),_0x1ff1b1,_0x8ed2('0x15'),JSON['stringify'](_0x1c79b5));if(_0x1c79b5['error']){if(_0x1c79b5[_0x8ed2('0x16')][_0x8ed2('0x17')]===0x1f4){logger[_0x8ed2('0x16')](_0x8ed2('0x13'),_0x1ff1b1,_0x1c79b5['error'][_0x8ed2('0x18')]);return _0x371f1b(_0x1c79b5[_0x8ed2('0x16')][_0x8ed2('0x18')]);}logger[_0x8ed2('0x16')](_0x8ed2('0x13'),_0x1ff1b1,_0x1c79b5['error']['message']);return _0x5839fe(_0x1c79b5[_0x8ed2('0x16')]['message']);}else{logger['info'](_0x8ed2('0x13'),_0x1ff1b1,_0x8ed2('0x15'));_0x5839fe(_0x1c79b5[_0x8ed2('0x19')]['message']);}})[_0x8ed2('0x1a')](function(_0x27c75b){logger[_0x8ed2('0x16')](_0x8ed2('0x13'),_0x1ff1b1,_0x27c75b);_0x371f1b(_0x27c75b);});});}exports['UpdateChatInteraction']=function(_0x38346e){var _0x1deb72=this;return new Promise(function(_0x994270,_0x100d1e){return db[_0x8ed2('0x1b')][_0x8ed2('0x1c')](_0x38346e['body'],{'raw':_0x38346e[_0x8ed2('0x1d')]?_0x38346e[_0x8ed2('0x1d')][_0x8ed2('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38346e[_0x8ed2('0x1d')]?_0x38346e[_0x8ed2('0x1d')][_0x8ed2('0x1f')]||null:null,'attributes':_0x38346e[_0x8ed2('0x1d')]?_0x38346e['options']['attributes']||null:null,'limit':_0x38346e[_0x8ed2('0x1d')]?_0x38346e[_0x8ed2('0x1d')][_0x8ed2('0x20')]||null:null})['then'](function(_0x149c42){logger['info'](_0x8ed2('0x21'),_0x38346e);logger['debug'](_0x8ed2('0x21'),_0x38346e,JSON[_0x8ed2('0x22')](_0x149c42));_0x994270(_0x149c42);})[_0x8ed2('0x1a')](function(_0x3d81ed){logger[_0x8ed2('0x16')](_0x8ed2('0x21'),_0x3d81ed[_0x8ed2('0x18')],_0x38346e);_0x100d1e(_0x1deb72['error'](0x1f4,_0x3d81ed['message']));});});};exports['AddTagsToChatInteraction']=function(_0x2361e5){return new Promise(function(_0x36a549,_0x2ae596){return db[_0x8ed2('0x1b')][_0x8ed2('0x23')]({'where':_0x2361e5[_0x8ed2('0x1d')]?_0x2361e5['options'][_0x8ed2('0x1f')]||null:null})['then'](function(_0x2f12ce){if(_0x2f12ce){return _0x2f12ce[_0x8ed2('0x24')](_0x2361e5[_0x8ed2('0x25')]['ids'],_[_0x8ed2('0x26')](_0x2361e5['body'],[_0x8ed2('0x27'),'id'])||{});}})[_0x8ed2('0x28')](function(_0xd65804){logger[_0x8ed2('0x29')](_0x8ed2('0x2a'),_0x2361e5);logger[_0x8ed2('0x2b')](_0x8ed2('0x2a'),_0x2361e5,JSON[_0x8ed2('0x22')](_0xd65804));_0x36a549(_0xd65804);})[_0x8ed2('0x1a')](function(_0x4b0593){logger[_0x8ed2('0x16')]('AddTags',_0x4b0593['message'],_0x2361e5);_0x2ae596(_this[_0x8ed2('0x16')](0x1f4,_0x4b0593['message']));});});};
\ No newline at end of file
+var _0x35d2=['../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','code','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','find','addTags','ids','omit','AddTags','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x35d2,0x118));var _0x235d=function(_0x2705c6,_0x54f9b1){_0x2705c6=_0x2705c6-0x0;var _0x28737c=_0x35d2[_0x2705c6];return _0x28737c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x235d('0x0'));var rs=require(_0x235d('0x1'));var fs=require('fs');var Redis=require(_0x235d('0x2'));var db=require(_0x235d('0x3'))['db'];var utils=require(_0x235d('0x4'));var logger=require(_0x235d('0x5'))(_0x235d('0x6'));var config=require(_0x235d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x235d('0x8')][_0x235d('0x9')]({'port':0x232a});config['redis']=_[_0x235d('0xa')](config[_0x235d('0xb')],{'host':_0x235d('0xc'),'port':0x18eb});var socket=require(_0x235d('0xd'))(new Redis(config[_0x235d('0xb')]));require('./chatInteraction.socket')[_0x235d('0xe')](socket);function respondWithRpcPromise(_0x36b261,_0x3f4c70,_0x1f5c7b){return new BPromise(function(_0x42b9ca,_0x4d4443){return client[_0x235d('0xf')](_0x36b261,_0x1f5c7b)[_0x235d('0x10')](function(_0x363d37){logger[_0x235d('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x3f4c70,_0x235d('0x12'));logger[_0x235d('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3f4c70,_0x235d('0x12'),JSON[_0x235d('0x14')](_0x363d37));if(_0x363d37['error']){if(_0x363d37['error'][_0x235d('0x15')]===0x1f4){logger[_0x235d('0x16')](_0x235d('0x17'),_0x3f4c70,_0x363d37['error'][_0x235d('0x18')]);return _0x4d4443(_0x363d37[_0x235d('0x16')][_0x235d('0x18')]);}logger[_0x235d('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3f4c70,_0x363d37['error']['message']);return _0x42b9ca(_0x363d37[_0x235d('0x16')][_0x235d('0x18')]);}else{logger[_0x235d('0x11')](_0x235d('0x17'),_0x3f4c70,_0x235d('0x12'));_0x42b9ca(_0x363d37[_0x235d('0x19')][_0x235d('0x18')]);}})[_0x235d('0x1a')](function(_0x1b319b){logger[_0x235d('0x16')](_0x235d('0x17'),_0x3f4c70,_0x1b319b);_0x4d4443(_0x1b319b);});});}exports[_0x235d('0x1b')]=function(_0x355122){var _0x3a8944=this;return new Promise(function(_0x310bf4,_0x19d491){return db[_0x235d('0x1c')][_0x235d('0x1d')](_0x355122[_0x235d('0x1e')],{'raw':_0x355122[_0x235d('0x1f')]?_0x355122[_0x235d('0x1f')][_0x235d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x355122['options']?_0x355122[_0x235d('0x1f')][_0x235d('0x21')]||null:null,'attributes':_0x355122['options']?_0x355122[_0x235d('0x1f')][_0x235d('0x22')]||null:null,'limit':_0x355122[_0x235d('0x1f')]?_0x355122[_0x235d('0x1f')][_0x235d('0x23')]||null:null})['then'](function(_0x507d84){logger[_0x235d('0x11')](_0x235d('0x1b'),_0x355122);logger[_0x235d('0x13')]('UpdateChatInteraction',_0x355122,JSON[_0x235d('0x14')](_0x507d84));_0x310bf4(_0x507d84);})[_0x235d('0x1a')](function(_0x1c80c6){logger[_0x235d('0x16')]('UpdateChatInteraction',_0x1c80c6[_0x235d('0x18')],_0x355122);_0x19d491(_0x3a8944['error'](0x1f4,_0x1c80c6[_0x235d('0x18')]));});});};exports['AddTagsToChatInteraction']=function(_0x5e33ce){return new Promise(function(_0x5cc660,_0x11179c){return db['ChatInteraction'][_0x235d('0x24')]({'where':_0x5e33ce['options']?_0x5e33ce[_0x235d('0x1f')][_0x235d('0x21')]||null:null})[_0x235d('0x10')](function(_0x586a97){if(_0x586a97){return _0x586a97[_0x235d('0x25')](_0x5e33ce['body'][_0x235d('0x26')],_[_0x235d('0x27')](_0x5e33ce[_0x235d('0x1e')],[_0x235d('0x26'),'id'])||{});}})['spread'](function(_0x144a3b){logger[_0x235d('0x11')](_0x235d('0x28'),_0x5e33ce);logger['debug'](_0x235d('0x28'),_0x5e33ce,JSON[_0x235d('0x14')](_0x144a3b));_0x5cc660(_0x144a3b);})[_0x235d('0x1a')](function(_0x370cce){logger[_0x235d('0x16')](_0x235d('0x28'),_0x370cce[_0x235d('0x18')],_0x5e33ce);_0x11179c(_this[_0x235d('0x16')](0x1f4,_0x370cce['message']));});});};
\ No newline at end of file
index cad934e..ab857ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdde=['remove','update','removeListener','register','length','chatInteraction:'];(function(_0x47ad4f,_0x321a17){var _0x5b8f53=function(_0x271ee0){while(--_0x271ee0){_0x47ad4f['push'](_0x47ad4f['shift']());}};_0x5b8f53(++_0x321a17);}(_0xcdde,0xcc));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0xecdd('0x0'),_0xecdd('0x1')];function createListener(_0x31896a,_0x16fa58){return function(_0xbaa439){_0x16fa58['emit'](_0x31896a,_0xbaa439);};}function removeListener(_0x56a179,_0x13a725){return function(){ChatInteractionEvents[_0xecdd('0x2')](_0x56a179,_0x13a725);};}exports[_0xecdd('0x3')]=function(_0x4ad31c){for(var _0x4079d0=0x0,_0x34153a=events[_0xecdd('0x4')];_0x4079d0<_0x34153a;_0x4079d0++){var _0x2a7820=events[_0x4079d0];var _0x72c7c4=createListener(_0xecdd('0x5')+_0x2a7820,_0x4ad31c);ChatInteractionEvents['on'](_0x2a7820,_0x72c7c4);}};
\ No newline at end of file
+var _0x2086=['./chatInteraction.events','save','update','emit','removeListener','length','chatInteraction:'];(function(_0x5e327e,_0x224abf){var _0x326561=function(_0x43ca91){while(--_0x43ca91){_0x5e327e['push'](_0x5e327e['shift']());}};_0x326561(++_0x224abf);}(_0x2086,0x165));var _0x6208=function(_0x5c0404,_0x385870){_0x5c0404=_0x5c0404-0x0;var _0xc74be4=_0x2086[_0x5c0404];return _0xc74be4;};'use strict';var ChatInteractionEvents=require(_0x6208('0x0'));var events=[_0x6208('0x1'),'remove',_0x6208('0x2')];function createListener(_0x366656,_0x5adb71){return function(_0x52df5d){_0x5adb71[_0x6208('0x3')](_0x366656,_0x52df5d);};}function removeListener(_0x89822e,_0x11f438){return function(){ChatInteractionEvents[_0x6208('0x4')](_0x89822e,_0x11f438);};}exports['register']=function(_0x3e4d8c){for(var _0x3c3573=0x0,_0x17b6ef=events[_0x6208('0x5')];_0x3c3573<_0x17b6ef;_0x3c3573++){var _0x5bbcbd=events[_0x3c3573];var _0x311ec3=createListener(_0x6208('0x6')+_0x5bbcbd,_0x3e4d8c);ChatInteractionEvents['on'](_0x5bbcbd,_0x311ec3);}};
\ No newline at end of file
index 4198b82..74e059c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x308b=['server/files/attachments/','format','now','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','abandon','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','download','post','/:id/vidaoo','createVidaooSession','join','root'];(function(_0x4ecc60,_0x29b89f){var _0x23aba2=function(_0x2b0b1e){while(--_0x2b0b1e){_0x4ecc60['push'](_0x4ecc60['shift']());}};_0x23aba2(++_0x29b89f);}(_0x308b,0x82));var _0xb308=function(_0x396648,_0x422e03){_0x396648=_0x396648-0x0;var _0x5d5db2=_0x308b[_0x396648];return _0x5d5db2;};'use strict';var multer=require(_0xb308('0x0'));var util=require(_0xb308('0x1'));var path=require(_0xb308('0x2'));var timeout=require(_0xb308('0x3'));var express=require(_0xb308('0x4'));var router=express[_0xb308('0x5')]();var fs_extra=require(_0xb308('0x6'));var auth=require(_0xb308('0x7'));var interaction=require(_0xb308('0x8'));var config=require(_0xb308('0x9'));var controller=require(_0xb308('0xa'));router[_0xb308('0xb')]('/',auth[_0xb308('0xc')](),controller[_0xb308('0xd')]);router[_0xb308('0xb')]('/describe',auth['isAuthenticated'](),controller[_0xb308('0xe')]);router['get'](_0xb308('0xf'),auth[_0xb308('0x10')](),controller[_0xb308('0x11')]);router[_0xb308('0xb')](_0xb308('0x12'),auth[_0xb308('0x10')](),controller[_0xb308('0x13')]);router[_0xb308('0xb')](_0xb308('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb308('0xb')](_0xb308('0x15'),auth[_0xb308('0x10')](),controller[_0xb308('0x16')]);router['get']('/:id/download',auth[_0xb308('0xc')](),controller[_0xb308('0x17')]);router[_0xb308('0x18')]('/',auth[_0xb308('0xc')](),controller['create']);router[_0xb308('0x18')](_0xb308('0x19'),auth[_0xb308('0xc')](),controller[_0xb308('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x386293,_0x1ab1fd,_0x12f74d){_0x12f74d(null,path[_0xb308('0x1b')](config[_0xb308('0x1c')],_0xb308('0x1d')));},'filename':function(_0x46d771,_0x2694f0,_0x510bf1){_0x510bf1(null,util[_0xb308('0x1e')]('%s-%s',Date[_0xb308('0x1f')](),_0x2694f0[_0xb308('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb308('0x18')](_0xb308('0x21'),upload[_0xb308('0x22')](_0xb308('0x23')),controller[_0xb308('0x24')]);router[_0xb308('0x18')]('/:id/messages',auth[_0xb308('0x10')](),controller[_0xb308('0x25')]);router[_0xb308('0x18')](_0xb308('0x26'),auth[_0xb308('0xc')](),interaction[_0xb308('0x27')](_0xb308('0x28'),_0xb308('0x29')),controller[_0xb308('0x2a')]);router[_0xb308('0x2b')](_0xb308('0xf'),auth[_0xb308('0xc')](),interaction[_0xb308('0x27')](_0xb308('0x28'),_0xb308('0x2c')),controller[_0xb308('0x2d')]);router['put']('/:id/custom_update',controller[_0xb308('0x2e')]);router['put']('/:id/abandon',auth[_0xb308('0x10')](),controller[_0xb308('0x2f')]);router[_0xb308('0x2b')]('/:id/close',controller[_0xb308('0x30')]);router[_0xb308('0x31')]('/:id',auth[_0xb308('0xc')](),interaction[_0xb308('0x27')](_0xb308('0x28'),_0xb308('0x32')),controller[_0xb308('0x33')]);router[_0xb308('0x31')](_0xb308('0x26'),auth[_0xb308('0xc')](),controller[_0xb308('0x34')]);module['exports']=router;
\ No newline at end of file
+var _0x1852=['/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s','replace','/:id/attachment_upload','single','attachmentUpload','/:id/tags','tracked','addTags','put','chat','update','/:id/custom_update','/:id/abandon','abandon','close','delete','chatinteraction:destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x1852,0x156));var _0x2185=function(_0x5100d1,_0x5c6126){_0x5100d1=_0x5100d1-0x0;var _0x535de9=_0x1852[_0x5100d1];return _0x535de9;};'use strict';var multer=require(_0x2185('0x0'));var util=require(_0x2185('0x1'));var path=require('path');var timeout=require(_0x2185('0x2'));var express=require(_0x2185('0x3'));var router=express[_0x2185('0x4')]();var fs_extra=require(_0x2185('0x5'));var auth=require(_0x2185('0x6'));var interaction=require(_0x2185('0x7'));var config=require(_0x2185('0x8'));var controller=require(_0x2185('0x9'));router['get']('/',auth[_0x2185('0xa')](),controller[_0x2185('0xb')]);router[_0x2185('0xc')](_0x2185('0xd'),auth[_0x2185('0xa')](),controller[_0x2185('0xe')]);router[_0x2185('0xc')](_0x2185('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x2185('0x10')]);router['get'](_0x2185('0x11'),auth[_0x2185('0x12')](),controller[_0x2185('0x13')]);router[_0x2185('0xc')](_0x2185('0x14'),auth['isAuthenticated'](),controller[_0x2185('0x15')]);router[_0x2185('0xc')](_0x2185('0x16'),auth[_0x2185('0x12')](),controller['getMyMessages']);router[_0x2185('0xc')]('/:id/download',auth[_0x2185('0xa')](),controller[_0x2185('0x17')]);router['post']('/',auth[_0x2185('0xa')](),controller[_0x2185('0x18')]);router[_0x2185('0x19')](_0x2185('0x1a'),auth[_0x2185('0xa')](),controller[_0x2185('0x1b')]);var upload=multer({'storage':multer[_0x2185('0x1c')]({'destination':function(_0x54319c,_0x343cc0,_0x510f0d){_0x510f0d(null,path[_0x2185('0x1d')](config['root'],_0x2185('0x1e')));},'filename':function(_0x1e8970,_0x39b3b1,_0x9a3787){_0x9a3787(null,util[_0x2185('0x1f')](_0x2185('0x20'),Date['now'](),_0x39b3b1['originalname'][_0x2185('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2185('0x22'),upload[_0x2185('0x23')]('file'),controller[_0x2185('0x24')]);router[_0x2185('0x19')](_0x2185('0x14'),auth[_0x2185('0x12')](),controller['addMessage']);router[_0x2185('0x19')](_0x2185('0x25'),auth[_0x2185('0xa')](),interaction[_0x2185('0x26')]('chat','chatinteraction:addtags'),controller[_0x2185('0x27')]);router[_0x2185('0x28')](_0x2185('0xf'),auth[_0x2185('0xa')](),interaction[_0x2185('0x26')](_0x2185('0x29'),'chatinteraction:update'),controller[_0x2185('0x2a')]);router[_0x2185('0x28')](_0x2185('0x2b'),controller['customUpdate']);router['put'](_0x2185('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x2185('0x2d')]);router[_0x2185('0x28')]('/:id/close',controller[_0x2185('0x2e')]);router[_0x2185('0x2f')](_0x2185('0xf'),auth[_0x2185('0xa')](),interaction[_0x2185('0x26')](_0x2185('0x29'),_0x2185('0x30')),controller['destroy']);router[_0x2185('0x2f')](_0x2185('0x25'),auth['isAuthenticated'](),controller[_0x2185('0x31')]);module[_0x2185('0x32')]=router;
\ No newline at end of file
index ddd952e..a26e26e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5507=['BOOLEAN','exports','TEXT','medium'];(function(_0x23b9cb,_0x4c09f9){var _0x128f3a=function(_0x42714a){while(--_0x42714a){_0x23b9cb['push'](_0x23b9cb['shift']());}};_0x128f3a(++_0x4c09f9);}(_0x5507,0xf5));var _0x7550=function(_0x4be52a,_0x5548d4){_0x4be52a=_0x4be52a-0x0;var _0x5e24e7=_0x5507[_0x4be52a];return _0x5e24e7;};'use strict';var Sequelize=require('sequelize');module[_0x7550('0x0')]={'body':{'type':Sequelize[_0x7550('0x1')](_0x7550('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7550('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7bee=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x2ba612,_0x2bf4a6){var _0x369b4b=function(_0x2aa2f1){while(--_0x2aa2f1){_0x2ba612['push'](_0x2ba612['shift']());}};_0x369b4b(++_0x2bf4a6);}(_0x7bee,0x1f3));var _0xe7be=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7bee[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xe7be('0x0'));module[_0xe7be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe7be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe7be('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe7be('0x4')]}};
\ No newline at end of file
index 62ef5b7..2c946ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed0f=['userProfileId','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','messages','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','role','UserProfileSection','Agents'];(function(_0x9be9b3,_0x3b663f){var _0x54a65f=function(_0x293aff){while(--_0x293aff){_0x9be9b3['push'](_0x9be9b3['shift']());}};_0x54a65f(++_0x3b663f);}(_0xed0f,0x142));var _0xfed0=function(_0x2be0ad,_0x1604b2){_0x2be0ad=_0x2be0ad-0x0;var _0x3c1eac=_0xed0f[_0x2be0ad];return _0x3c1eac;};'use strict';var emlformat=require(_0xfed0('0x0'));var rimraf=require(_0xfed0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfed0('0x2'));var rp=require(_0xfed0('0x3'));var moment=require(_0xfed0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfed0('0x5'));var util=require(_0xfed0('0x6'));var path=require(_0xfed0('0x7'));var sox=require('sox');var csv=require(_0xfed0('0x8'));var ejs=require(_0xfed0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfed0('0xa'));var squel=require(_0xfed0('0xb'));var crypto=require(_0xfed0('0xc'));var jsforce=require(_0xfed0('0xd'));var deskjs=require(_0xfed0('0xe'));var toCsv=require(_0xfed0('0x8'));var querystring=require('querystring');var Papa=require(_0xfed0('0xf'));var Redis=require(_0xfed0('0x10'));var authService=require(_0xfed0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfed0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfed0('0x13'))(_0xfed0('0x14'));var utils=require(_0xfed0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfed0('0x16'));var db=require('../../mysqldb')['db'];config[_0xfed0('0x17')]=_[_0xfed0('0x18')](config[_0xfed0('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfed0('0x19'))(new Redis(config[_0xfed0('0x17')]));require(_0xfed0('0x1a'))[_0xfed0('0x1b')](socket);function respondWithStatusCode(_0x234fdf,_0x2bafb2){_0x2bafb2=_0x2bafb2||0xcc;return function(_0x50b54d){if(_0x50b54d){return _0x234fdf['sendStatus'](_0x2bafb2);}return _0x234fdf[_0xfed0('0x1c')](_0x2bafb2)['end']();};}function respondWithResult(_0x33da9c,_0x129590){_0x129590=_0x129590||0xc8;return function(_0x1e8428){if(_0x1e8428){return _0x33da9c['status'](_0x129590)[_0xfed0('0x1d')](_0x1e8428);}};}function respondWithFilteredResult(_0x15625a,_0x4410ef){return function(_0xf710b3){if(_0xf710b3){var _0x1b1b58=typeof _0x4410ef[_0xfed0('0x1e')]===_0xfed0('0x1f')&&typeof _0x4410ef['limit']===_0xfed0('0x1f');var _0x148ecc=_0xf710b3[_0xfed0('0x20')];var _0x16661d=_0x1b1b58?0x0:_0x4410ef['offset'];var _0x2bc6bb=_0x1b1b58?_0xf710b3[_0xfed0('0x20')]:_0x4410ef[_0xfed0('0x1e')]+_0x4410ef[_0xfed0('0x21')];var _0x1be748;if(_0x2bc6bb>=_0x148ecc){_0x2bc6bb=_0x148ecc;_0x1be748=0xc8;}else{_0x1be748=0xce;}_0x15625a[_0xfed0('0x1c')](_0x1be748);return _0x15625a[_0xfed0('0x22')](_0xfed0('0x23'),_0x16661d+'-'+_0x2bc6bb+'/'+_0x148ecc)[_0xfed0('0x1d')](_0xf710b3);}return null;};}function patchUpdates(_0x246eee){return function(_0x4529d2){try{jsonpatch['apply'](_0x4529d2,_0x246eee,!![]);}catch(_0x1a044b){return BPromise['reject'](_0x1a044b);}return _0x4529d2['save']();};}function saveUpdates(_0x338e85,_0x2fdc43){return function(_0x44745f){if(_0x44745f){return _0x44745f[_0xfed0('0x24')](_0x338e85)[_0xfed0('0x25')](function(_0x3ba047){return _0x3ba047;});}return null;};}function removeEntity(_0x2b2ad4,_0x2e0d38){return function(_0x152cf9){if(_0x152cf9){return _0x152cf9[_0xfed0('0x26')]()[_0xfed0('0x25')](function(){_0x2b2ad4[_0xfed0('0x1c')](0xcc)[_0xfed0('0x27')]();});}};}function handleEntityNotFound(_0x540a6c,_0x1f8121){return function(_0xe8fd74){if(!_0xe8fd74){_0x540a6c[_0xfed0('0x28')](0x194);}return _0xe8fd74;};}function handleError(_0x253370,_0x2c79a7){_0x2c79a7=_0x2c79a7||0x1f4;return function(_0x5c9999){logger[_0xfed0('0x29')](_0x5c9999[_0xfed0('0x2a')]);if(_0x5c9999[_0xfed0('0x2b')]){delete _0x5c9999[_0xfed0('0x2b')];}_0x253370[_0xfed0('0x1c')](_0x2c79a7)[_0xfed0('0x2c')](_0x5c9999);};}exports['index']=function(_0x2e18ea,_0x10d905){var _0x4b9634={},_0x1005d7={},_0x25a27b={'count':0x0,'rows':[]};var _0x38f9c6=_['map'](db[_0xfed0('0x2d')][_0xfed0('0x2e')],function(_0x133f0c){return{'name':_0x133f0c[_0xfed0('0x2f')],'type':_0x133f0c[_0xfed0('0x30')][_0xfed0('0x31')]};});_0x1005d7[_0xfed0('0x32')]=_[_0xfed0('0x33')](_0x38f9c6,_0xfed0('0x2b'));_0x1005d7[_0xfed0('0x34')]=_[_0xfed0('0x35')](_0x2e18ea[_0xfed0('0x34')]);_0x1005d7[_0xfed0('0x36')]=_[_0xfed0('0x37')](_0x1005d7[_0xfed0('0x32')],_0x1005d7['query']);_0x4b9634[_0xfed0('0x38')]=_[_0xfed0('0x37')](_0x1005d7[_0xfed0('0x32')],qs['fields'](_0x2e18ea[_0xfed0('0x34')][_0xfed0('0x39')]));_0x4b9634['attributes']=_0x4b9634[_0xfed0('0x38')][_0xfed0('0x3a')]?_0x4b9634[_0xfed0('0x38')]:_0x1005d7[_0xfed0('0x32')];if(!_0x2e18ea[_0xfed0('0x34')][_0xfed0('0x3b')](_0xfed0('0x3c'))){_0x4b9634[_0xfed0('0x21')]=qs[_0xfed0('0x21')](_0x2e18ea[_0xfed0('0x34')]['limit']);_0x4b9634[_0xfed0('0x1e')]=qs[_0xfed0('0x1e')](_0x2e18ea['query'][_0xfed0('0x1e')]);}_0x4b9634[_0xfed0('0x3d')]=qs[_0xfed0('0x3e')](_0x2e18ea[_0xfed0('0x34')][_0xfed0('0x3e')]);_0x4b9634[_0xfed0('0x3f')]=qs[_0xfed0('0x36')](_[_0xfed0('0x40')](_0x2e18ea[_0xfed0('0x34')],_0x1005d7[_0xfed0('0x36')]),_0x38f9c6);if(_0x2e18ea[_0xfed0('0x34')]['filter']){_0x4b9634[_0xfed0('0x3f')]=_[_0xfed0('0x41')](_0x4b9634['where'],{'$or':_[_0xfed0('0x33')](_0x38f9c6,function(_0x3ec75d){if(_0x3ec75d[_0xfed0('0x30')]!=='VIRTUAL'){var _0x50eb47={};_0x50eb47[_0x3ec75d[_0xfed0('0x2b')]]={'$like':'%'+_0x2e18ea[_0xfed0('0x34')][_0xfed0('0x42')]+'%'};return _0x50eb47;}})});}_0x4b9634=_[_0xfed0('0x41')]({},_0x4b9634,_0x2e18ea[_0xfed0('0x43')]);var _0x3ccd02={'where':_0x4b9634[_0xfed0('0x3f')]};return db[_0xfed0('0x2d')][_0xfed0('0x20')](_0x3ccd02)[_0xfed0('0x25')](function(_0xebb2d){_0x25a27b[_0xfed0('0x20')]=_0xebb2d;if(_0x2e18ea['query'][_0xfed0('0x44')]){_0x4b9634[_0xfed0('0x45')]=[{'all':!![]}];}return db[_0xfed0('0x2d')][_0xfed0('0x46')](_0x4b9634);})[_0xfed0('0x25')](function(_0x106d8e){_0x25a27b[_0xfed0('0x47')]=_0x106d8e;return _0x25a27b;})['then'](respondWithFilteredResult(_0x10d905,_0x4b9634))['catch'](handleError(_0x10d905,null));};exports[_0xfed0('0x48')]=function(_0xefd7c4,_0xa3c075){var _0x339d7c={'raw':!![],'where':{'id':_0xefd7c4[_0xfed0('0x49')]['id']}},_0x2ac1ce={};_0x2ac1ce['model']=_[_0xfed0('0x35')](db['ChatInternalMessage'][_0xfed0('0x2e')]);_0x2ac1ce[_0xfed0('0x34')]=_['keys'](_0xefd7c4['query']);_0x2ac1ce[_0xfed0('0x36')]=_['intersection'](_0x2ac1ce[_0xfed0('0x32')],_0x2ac1ce[_0xfed0('0x34')]);_0x339d7c['attributes']=_['intersection'](_0x2ac1ce[_0xfed0('0x32')],qs['fields'](_0xefd7c4['query'][_0xfed0('0x39')]));_0x339d7c[_0xfed0('0x38')]=_0x339d7c[_0xfed0('0x38')][_0xfed0('0x3a')]?_0x339d7c['attributes']:_0x2ac1ce[_0xfed0('0x32')];if(_0xefd7c4[_0xfed0('0x34')][_0xfed0('0x44')]){_0x339d7c['include']=[{'all':!![]}];}_0x339d7c=_[_0xfed0('0x41')]({},_0x339d7c,_0xefd7c4[_0xfed0('0x43')]);return db[_0xfed0('0x2d')][_0xfed0('0x4a')](_0x339d7c)[_0xfed0('0x25')](handleEntityNotFound(_0xa3c075,null))['then'](respondWithResult(_0xa3c075,null))[_0xfed0('0x4b')](handleError(_0xa3c075,null));};exports['create']=function(_0x24667f,_0xddb5e9){return db[_0xfed0('0x2d')][_0xfed0('0x4c')](_0x24667f['body'],{})[_0xfed0('0x25')](respondWithResult(_0xddb5e9,0xc9))[_0xfed0('0x4b')](handleError(_0xddb5e9,null));};exports[_0xfed0('0x24')]=function(_0x11fa29,_0x1efcaf){if(_0x11fa29[_0xfed0('0x4d')]['id']){delete _0x11fa29[_0xfed0('0x4d')]['id'];}return db[_0xfed0('0x2d')]['find']({'where':{'id':_0x11fa29[_0xfed0('0x49')]['id']}})[_0xfed0('0x25')](handleEntityNotFound(_0x1efcaf,null))[_0xfed0('0x25')](saveUpdates(_0x11fa29[_0xfed0('0x4d')],null))[_0xfed0('0x25')](respondWithResult(_0x1efcaf,null))[_0xfed0('0x4b')](handleError(_0x1efcaf,null));};exports[_0xfed0('0x26')]=function(_0x2f77f6,_0x4a4fe5){return db['ChatInternalMessage'][_0xfed0('0x4a')]({'where':{'id':_0x2f77f6[_0xfed0('0x49')]['id']}})[_0xfed0('0x25')](handleEntityNotFound(_0x4a4fe5,null))[_0xfed0('0x25')](removeEntity(_0x4a4fe5,null))[_0xfed0('0x4b')](handleError(_0x4a4fe5,null));};exports[_0xfed0('0x4e')]=function(_0x35564f,_0x5af5f5){return db[_0xfed0('0x2d')][_0xfed0('0x4e')]()[_0xfed0('0x25')](respondWithResult(_0x5af5f5,null))[_0xfed0('0x4b')](handleError(_0x5af5f5,null));};function wrapUser(_0x1faa85){return function(_0x7520d8){var _0x195822=_0x1faa85['get']({'plain':!![]});_0x195822[_0xfed0('0x4f')]=[];if(_0x7520d8){_0x195822['lastMessageAt']=_0x7520d8['createdAt'];_0x195822['lastMessage']=_0x7520d8;}else{_0x195822['lastMessageAt']=moment(0x0)[_0xfed0('0x50')](_0xfed0('0x51'));_0x195822[_0xfed0('0x52')]={};}return _0x195822;};}exports[_0xfed0('0x53')]=function(_0x550de5,_0x251bf0,_0x35515b){var _0x2035af=[];return db['User']['findAll']({'where':{'role':[_0xfed0('0x54'),_0xfed0('0x55'),'user']},'attributes':['id','fullname',_0xfed0('0x2b'),'role','userpic',_0xfed0('0x56'),_0xfed0('0x57'),_0xfed0('0x58'),'allowmessenger',_0xfed0('0x59')],'order':qs['sort'](_0xfed0('0x5a')),'include':[{'model':db[_0xfed0('0x5b')],'as':_0xfed0('0x5c'),'attributes':['id',_0xfed0('0x2b'),_0xfed0('0x30')],'through':{'attributes':[]}}]})[_0xfed0('0x25')](function(_0x369bfe){if(_0x369bfe){var _0x445e54=_0x550de5[_0xfed0('0x5d')][_0xfed0('0x5e')]({'plain':!![]});if(!_0x445e54)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x445e54[_0xfed0('0x5f')]===_0xfed0('0x5d')){return db[_0xfed0('0x60')][_0xfed0('0x4a')]({'where':{'name':_0xfed0('0x61'),'userProfileId':_0x445e54[_0xfed0('0x62')]},'raw':!![]})[_0xfed0('0x25')](function(_0x163375){if(_0x163375){if(_0x163375['autoAssociation']===0x0){return db['UserProfileResource'][_0xfed0('0x46')]({'where':{'sectionId':_0x163375['id']},'raw':!![]})[_0xfed0('0x25')](function(_0x4e7184){var _0x520925=[];if(_['isEmpty'](_0x4e7184)){_0x520925=_[_0xfed0('0x42')](_0x369bfe,function(_0x2b7a74){if(_0x2b7a74[_0xfed0('0x5f')]!=='agent'){return _0x2b7a74;}});return _0x520925;}else{for(var _0x28ecd5=0x0;_0x28ecd5<_0x369bfe[_0xfed0('0x3a')];_0x28ecd5++){var _0x70223d=_0x369bfe[_0x28ecd5];if(_0x70223d[_0xfed0('0x5f')]===_0xfed0('0x54')){var _0x51a4ee=_[_0xfed0('0x4a')](_0x4e7184,function(_0x88098b){return _0x88098b[_0xfed0('0x63')]===_0x70223d['id'];});if(_0x51a4ee)_0x520925[_0xfed0('0x64')](_0x70223d);}else{_0x520925[_0xfed0('0x64')](_0x70223d);}}return _0x520925;}});}else{return _0x369bfe;}}else{var _0x39cd75=_[_0xfed0('0x42')](_0x369bfe,function(_0x12a79e){if(_0x12a79e[_0xfed0('0x5f')]!==_0xfed0('0x54')){return _0x12a79e;}});return _0x39cd75;}});}else{return _0x369bfe;}}})[_0xfed0('0x25')](function(_0x58b11e){var _0x45e775=[];if(_0x58b11e){_0x2035af=_0x58b11e;for(var _0x2e6521=0x0;_0x2e6521<_0x58b11e[_0xfed0('0x3a')];_0x2e6521+=0x1){_0x2035af[_0x2e6521]['messages']=[];_0x45e775['push'](db[_0xfed0('0x2d')]['find']({'where':{'FromId':[_0x550de5['user']['id'],_0x58b11e[_0x2e6521]['id']],'ToId':[_0x550de5['user']['id'],_0x58b11e[_0x2e6521]['id']],'ChatGroupId':null},'attributes':['id',_0xfed0('0x65'),'FromId','ToId',_0xfed0('0x66'),_0xfed0('0x4d')],'order':qs['sort'](_0xfed0('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfed0('0x25')](wrapUser(_0x58b11e[_0x2e6521])));}return BPromise[_0xfed0('0x68')](_0x45e775);}return[];})[_0xfed0('0x25')](function(_0x1e33a9){return{'rows':_0x1e33a9,'count':_0x1e33a9['length']};})['then'](respondWithResult(_0x251bf0,null))['catch'](handleError(_0x251bf0,null));};
\ No newline at end of file
+var _0x0e59=['localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','resourceId','push','createdAt','FromId','ToId','-createdAt','all','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0e59,0x1b0));var _0x90e5=function(_0x5403a3,_0x5ad112){_0x5403a3=_0x5403a3-0x0;var _0x55cd89=_0x0e59[_0x5403a3];return _0x55cd89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90e5('0x0'));var zipdir=require(_0x90e5('0x1'));var jsonpatch=require(_0x90e5('0x2'));var rp=require(_0x90e5('0x3'));var moment=require(_0x90e5('0x4'));var BPromise=require(_0x90e5('0x5'));var Mustache=require(_0x90e5('0x6'));var util=require(_0x90e5('0x7'));var path=require(_0x90e5('0x8'));var sox=require(_0x90e5('0x9'));var csv=require(_0x90e5('0xa'));var ejs=require(_0x90e5('0xb'));var fs=require('fs');var fs_extra=require(_0x90e5('0xc'));var _=require(_0x90e5('0xd'));var squel=require(_0x90e5('0xe'));var crypto=require(_0x90e5('0xf'));var jsforce=require(_0x90e5('0x10'));var deskjs=require(_0x90e5('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x90e5('0x12'));var authService=require(_0x90e5('0x13'));var qs=require(_0x90e5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90e5('0x15'));var logger=require(_0x90e5('0x16'))(_0x90e5('0x17'));var utils=require('../../config/utils');var config=require(_0x90e5('0x18'));var licenseUtil=require(_0x90e5('0x19'));var db=require(_0x90e5('0x1a'))['db'];config[_0x90e5('0x1b')]=_['defaults'](config[_0x90e5('0x1b')],{'host':_0x90e5('0x1c'),'port':0x18eb});var socket=require(_0x90e5('0x1d'))(new Redis(config[_0x90e5('0x1b')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x34add5,_0x3398ab){_0x3398ab=_0x3398ab||0xcc;return function(_0x291acb){if(_0x291acb){return _0x34add5[_0x90e5('0x1e')](_0x3398ab);}return _0x34add5[_0x90e5('0x1f')](_0x3398ab)[_0x90e5('0x20')]();};}function respondWithResult(_0x13cfca,_0x20ccf3){_0x20ccf3=_0x20ccf3||0xc8;return function(_0x2e47ff){if(_0x2e47ff){return _0x13cfca[_0x90e5('0x1f')](_0x20ccf3)[_0x90e5('0x21')](_0x2e47ff);}};}function respondWithFilteredResult(_0x4c1a08,_0x25056c){return function(_0xb5fba1){if(_0xb5fba1){var _0x1e1ad5=typeof _0x25056c[_0x90e5('0x22')]===_0x90e5('0x23')&&typeof _0x25056c[_0x90e5('0x24')]===_0x90e5('0x23');var _0x26e5d0=_0xb5fba1['count'];var _0xb5f656=_0x1e1ad5?0x0:_0x25056c[_0x90e5('0x22')];var _0x35513d=_0x1e1ad5?_0xb5fba1[_0x90e5('0x25')]:_0x25056c['offset']+_0x25056c[_0x90e5('0x24')];var _0x219749;if(_0x35513d>=_0x26e5d0){_0x35513d=_0x26e5d0;_0x219749=0xc8;}else{_0x219749=0xce;}_0x4c1a08[_0x90e5('0x1f')](_0x219749);return _0x4c1a08[_0x90e5('0x26')](_0x90e5('0x27'),_0xb5f656+'-'+_0x35513d+'/'+_0x26e5d0)[_0x90e5('0x21')](_0xb5fba1);}return null;};}function patchUpdates(_0x1f3abf){return function(_0x4e06eb){try{jsonpatch[_0x90e5('0x28')](_0x4e06eb,_0x1f3abf,!![]);}catch(_0x3d00e4){return BPromise[_0x90e5('0x29')](_0x3d00e4);}return _0x4e06eb[_0x90e5('0x2a')]();};}function saveUpdates(_0x555791,_0x443d10){return function(_0xaeb1ef){if(_0xaeb1ef){return _0xaeb1ef['update'](_0x555791)[_0x90e5('0x2b')](function(_0x3246cc){return _0x3246cc;});}return null;};}function removeEntity(_0x184daa,_0x1d8b5c){return function(_0xf2867f){if(_0xf2867f){return _0xf2867f[_0x90e5('0x2c')]()[_0x90e5('0x2b')](function(){_0x184daa[_0x90e5('0x1f')](0xcc)[_0x90e5('0x20')]();});}};}function handleEntityNotFound(_0x7d5ece,_0x1c3767){return function(_0x1596db){if(!_0x1596db){_0x7d5ece[_0x90e5('0x1e')](0x194);}return _0x1596db;};}function handleError(_0x169b20,_0x10b882){_0x10b882=_0x10b882||0x1f4;return function(_0x346688){logger[_0x90e5('0x2d')](_0x346688[_0x90e5('0x2e')]);if(_0x346688[_0x90e5('0x2f')]){delete _0x346688[_0x90e5('0x2f')];}_0x169b20['status'](_0x10b882)[_0x90e5('0x30')](_0x346688);};}exports[_0x90e5('0x31')]=function(_0x42d88e,_0x5c74ad){var _0x335e3a={},_0x29543f={},_0x539b30={'count':0x0,'rows':[]};var _0x434fb3=_[_0x90e5('0x32')](db[_0x90e5('0x33')][_0x90e5('0x34')],function(_0x49451a){return{'name':_0x49451a[_0x90e5('0x35')],'type':_0x49451a[_0x90e5('0x36')][_0x90e5('0x37')]};});_0x29543f['model']=_['map'](_0x434fb3,'name');_0x29543f[_0x90e5('0x38')]=_[_0x90e5('0x39')](_0x42d88e[_0x90e5('0x38')]);_0x29543f[_0x90e5('0x3a')]=_[_0x90e5('0x3b')](_0x29543f[_0x90e5('0x3c')],_0x29543f[_0x90e5('0x38')]);_0x335e3a[_0x90e5('0x3d')]=_['intersection'](_0x29543f[_0x90e5('0x3c')],qs['fields'](_0x42d88e[_0x90e5('0x38')][_0x90e5('0x3e')]));_0x335e3a[_0x90e5('0x3d')]=_0x335e3a[_0x90e5('0x3d')][_0x90e5('0x3f')]?_0x335e3a[_0x90e5('0x3d')]:_0x29543f[_0x90e5('0x3c')];if(!_0x42d88e[_0x90e5('0x38')]['hasOwnProperty'](_0x90e5('0x40'))){_0x335e3a['limit']=qs[_0x90e5('0x24')](_0x42d88e['query'][_0x90e5('0x24')]);_0x335e3a['offset']=qs['offset'](_0x42d88e[_0x90e5('0x38')][_0x90e5('0x22')]);}_0x335e3a[_0x90e5('0x41')]=qs['sort'](_0x42d88e[_0x90e5('0x38')][_0x90e5('0x42')]);_0x335e3a['where']=qs[_0x90e5('0x3a')](_['pick'](_0x42d88e[_0x90e5('0x38')],_0x29543f[_0x90e5('0x3a')]),_0x434fb3);if(_0x42d88e[_0x90e5('0x38')][_0x90e5('0x43')]){_0x335e3a[_0x90e5('0x44')]=_[_0x90e5('0x45')](_0x335e3a[_0x90e5('0x44')],{'$or':_[_0x90e5('0x32')](_0x434fb3,function(_0x5b1537){if(_0x5b1537[_0x90e5('0x36')]!==_0x90e5('0x46')){var _0x447c12={};_0x447c12[_0x5b1537[_0x90e5('0x2f')]]={'$like':'%'+_0x42d88e[_0x90e5('0x38')][_0x90e5('0x43')]+'%'};return _0x447c12;}})});}_0x335e3a=_[_0x90e5('0x45')]({},_0x335e3a,_0x42d88e['options']);var _0x4cb76a={'where':_0x335e3a[_0x90e5('0x44')]};return db[_0x90e5('0x33')]['count'](_0x4cb76a)['then'](function(_0x535694){_0x539b30[_0x90e5('0x25')]=_0x535694;if(_0x42d88e[_0x90e5('0x38')][_0x90e5('0x47')]){_0x335e3a[_0x90e5('0x48')]=[{'all':!![]}];}return db[_0x90e5('0x33')][_0x90e5('0x49')](_0x335e3a);})[_0x90e5('0x2b')](function(_0x968c1f){_0x539b30[_0x90e5('0x4a')]=_0x968c1f;return _0x539b30;})[_0x90e5('0x2b')](respondWithFilteredResult(_0x5c74ad,_0x335e3a))[_0x90e5('0x4b')](handleError(_0x5c74ad,null));};exports['show']=function(_0x4965fe,_0x582878){var _0x3b2c7d={'raw':!![],'where':{'id':_0x4965fe[_0x90e5('0x4c')]['id']}},_0x1a0b89={};_0x1a0b89[_0x90e5('0x3c')]=_['keys'](db[_0x90e5('0x33')]['rawAttributes']);_0x1a0b89[_0x90e5('0x38')]=_[_0x90e5('0x39')](_0x4965fe[_0x90e5('0x38')]);_0x1a0b89[_0x90e5('0x3a')]=_[_0x90e5('0x3b')](_0x1a0b89[_0x90e5('0x3c')],_0x1a0b89[_0x90e5('0x38')]);_0x3b2c7d[_0x90e5('0x3d')]=_[_0x90e5('0x3b')](_0x1a0b89[_0x90e5('0x3c')],qs['fields'](_0x4965fe[_0x90e5('0x38')][_0x90e5('0x3e')]));_0x3b2c7d['attributes']=_0x3b2c7d['attributes'][_0x90e5('0x3f')]?_0x3b2c7d[_0x90e5('0x3d')]:_0x1a0b89[_0x90e5('0x3c')];if(_0x4965fe['query'][_0x90e5('0x47')]){_0x3b2c7d[_0x90e5('0x48')]=[{'all':!![]}];}_0x3b2c7d=_[_0x90e5('0x45')]({},_0x3b2c7d,_0x4965fe['options']);return db[_0x90e5('0x33')][_0x90e5('0x4d')](_0x3b2c7d)[_0x90e5('0x2b')](handleEntityNotFound(_0x582878,null))[_0x90e5('0x2b')](respondWithResult(_0x582878,null))[_0x90e5('0x4b')](handleError(_0x582878,null));};exports[_0x90e5('0x4e')]=function(_0x35f65d,_0x192d89){return db['ChatInternalMessage'][_0x90e5('0x4e')](_0x35f65d[_0x90e5('0x4f')],{})[_0x90e5('0x2b')](respondWithResult(_0x192d89,0xc9))[_0x90e5('0x4b')](handleError(_0x192d89,null));};exports[_0x90e5('0x50')]=function(_0x539b9c,_0x5a8929){if(_0x539b9c[_0x90e5('0x4f')]['id']){delete _0x539b9c['body']['id'];}return db[_0x90e5('0x33')]['find']({'where':{'id':_0x539b9c['params']['id']}})[_0x90e5('0x2b')](handleEntityNotFound(_0x5a8929,null))[_0x90e5('0x2b')](saveUpdates(_0x539b9c[_0x90e5('0x4f')],null))['then'](respondWithResult(_0x5a8929,null))[_0x90e5('0x4b')](handleError(_0x5a8929,null));};exports[_0x90e5('0x2c')]=function(_0x59c769,_0xb68e65){return db[_0x90e5('0x33')][_0x90e5('0x4d')]({'where':{'id':_0x59c769[_0x90e5('0x4c')]['id']}})[_0x90e5('0x2b')](handleEntityNotFound(_0xb68e65,null))['then'](removeEntity(_0xb68e65,null))[_0x90e5('0x4b')](handleError(_0xb68e65,null));};exports[_0x90e5('0x51')]=function(_0x5deda7,_0x704084){return db[_0x90e5('0x33')][_0x90e5('0x51')]()[_0x90e5('0x2b')](respondWithResult(_0x704084,null))[_0x90e5('0x4b')](handleError(_0x704084,null));};function wrapUser(_0x30bc3d){return function(_0x22b565){var _0xa000a7=_0x30bc3d['get']({'plain':!![]});_0xa000a7[_0x90e5('0x52')]=[];if(_0x22b565){_0xa000a7[_0x90e5('0x53')]=_0x22b565['createdAt'];_0xa000a7[_0x90e5('0x54')]=_0x22b565;}else{_0xa000a7[_0x90e5('0x53')]=moment(0x0)[_0x90e5('0x55')](_0x90e5('0x56'));_0xa000a7[_0x90e5('0x54')]={};}return _0xa000a7;};}exports['getUsers']=function(_0x2adaa5,_0x2a54d5,_0x4cb752){var _0x461154=[];return db['User'][_0x90e5('0x49')]({'where':{'role':[_0x90e5('0x57'),_0x90e5('0x58'),_0x90e5('0x59')]},'attributes':['id',_0x90e5('0x5a'),'name','role',_0x90e5('0x5b'),_0x90e5('0x5c'),_0x90e5('0x5d'),_0x90e5('0x5e'),_0x90e5('0x5f'),_0x90e5('0x60')],'order':qs[_0x90e5('0x42')](_0x90e5('0x61')),'include':[{'model':db[_0x90e5('0x62')],'as':_0x90e5('0x63'),'attributes':['id',_0x90e5('0x2f'),_0x90e5('0x36')],'through':{'attributes':[]}}]})[_0x90e5('0x2b')](function(_0x88e1ce){if(_0x88e1ce){var _0x30dd43=_0x2adaa5[_0x90e5('0x59')][_0x90e5('0x64')]({'plain':!![]});if(!_0x30dd43)throw new Error(_0x90e5('0x65'));if(_0x30dd43[_0x90e5('0x66')]===_0x90e5('0x59')){return db[_0x90e5('0x67')][_0x90e5('0x4d')]({'where':{'name':_0x90e5('0x68'),'userProfileId':_0x30dd43[_0x90e5('0x69')]},'raw':!![]})['then'](function(_0x5ef5a1){if(_0x5ef5a1){if(_0x5ef5a1[_0x90e5('0x6a')]===0x0){return db[_0x90e5('0x6b')][_0x90e5('0x49')]({'where':{'sectionId':_0x5ef5a1['id']},'raw':!![]})['then'](function(_0x2bb811){var _0x327e17=[];if(_['isEmpty'](_0x2bb811)){_0x327e17=_[_0x90e5('0x43')](_0x88e1ce,function(_0x4a22a5){if(_0x4a22a5[_0x90e5('0x66')]!==_0x90e5('0x57')){return _0x4a22a5;}});return _0x327e17;}else{for(var _0x4eeab6=0x0;_0x4eeab6<_0x88e1ce[_0x90e5('0x3f')];_0x4eeab6++){var _0x7b490b=_0x88e1ce[_0x4eeab6];if(_0x7b490b[_0x90e5('0x66')]===_0x90e5('0x57')){var _0x35b903=_[_0x90e5('0x4d')](_0x2bb811,function(_0x4e011d){return _0x4e011d[_0x90e5('0x6c')]===_0x7b490b['id'];});if(_0x35b903)_0x327e17['push'](_0x7b490b);}else{_0x327e17[_0x90e5('0x6d')](_0x7b490b);}}return _0x327e17;}});}else{return _0x88e1ce;}}else{var _0x5a7081=_[_0x90e5('0x43')](_0x88e1ce,function(_0x2ba94e){if(_0x2ba94e[_0x90e5('0x66')]!==_0x90e5('0x57')){return _0x2ba94e;}});return _0x5a7081;}});}else{return _0x88e1ce;}}})[_0x90e5('0x2b')](function(_0x1d0879){var _0x5b144a=[];if(_0x1d0879){_0x461154=_0x1d0879;for(var _0x5f2f1c=0x0;_0x5f2f1c<_0x1d0879[_0x90e5('0x3f')];_0x5f2f1c+=0x1){_0x461154[_0x5f2f1c]['messages']=[];_0x5b144a[_0x90e5('0x6d')](db[_0x90e5('0x33')][_0x90e5('0x4d')]({'where':{'FromId':[_0x2adaa5[_0x90e5('0x59')]['id'],_0x1d0879[_0x5f2f1c]['id']],'ToId':[_0x2adaa5[_0x90e5('0x59')]['id'],_0x1d0879[_0x5f2f1c]['id']],'ChatGroupId':null},'attributes':['id',_0x90e5('0x6e'),_0x90e5('0x6f'),_0x90e5('0x70'),'read',_0x90e5('0x4f')],'order':qs[_0x90e5('0x42')](_0x90e5('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x90e5('0x2b')](wrapUser(_0x1d0879[_0x5f2f1c])));}return BPromise[_0x90e5('0x72')](_0x5b144a);}return[];})[_0x90e5('0x2b')](function(_0x409be9){return{'rows':_0x409be9,'count':_0x409be9[_0x90e5('0x3f')]};})['then'](respondWithResult(_0x2a54d5,null))[_0x90e5('0x4b')](handleError(_0x2a54d5,null));};
\ No newline at end of file
index a187864..e86ba09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb22f=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb22f,0x141));var _0xfb22=function(_0x30022c,_0x3f3cc5){_0x30022c=_0x30022c-0x0;var _0x57d99d=_0xb22f[_0x30022c];return _0x57d99d;};'use strict';var EventEmitter=require(_0xfb22('0x0'));var ChatInternalMessage=require(_0xfb22('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfb22('0x2')](0x0);var events={'afterCreate':_0xfb22('0x3'),'afterUpdate':'update','afterDestroy':_0xfb22('0x4')};function emitEvent(_0x1bf9de){return function(_0x45ea6d,_0x1170a6,_0x456600){ChatInternalMessageEvents[_0xfb22('0x5')](_0x1bf9de+':'+_0x45ea6d['id'],_0x45ea6d);ChatInternalMessageEvents[_0xfb22('0x5')](_0x1bf9de,_0x45ea6d);_0x456600(null);};}for(var e in events){if(events[_0xfb22('0x6')](e)){var event=events[e];ChatInternalMessage[_0xfb22('0x7')](e,emitEvent(event));}}module[_0xfb22('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x06bc=['emit','hasOwnProperty','exports','../../mysqldb','update','remove'];(function(_0x372433,_0xb55d02){var _0x375ac3=function(_0x1c1d22){while(--_0x1c1d22){_0x372433['push'](_0x372433['shift']());}};_0x375ac3(++_0xb55d02);}(_0x06bc,0x6f));var _0xc06b=function(_0xeff764,_0x377cfe){_0xeff764=_0xeff764-0x0;var _0xe75e9f=_0x06bc[_0xeff764];return _0xe75e9f;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc06b('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc06b('0x1'),'afterDestroy':_0xc06b('0x2')};function emitEvent(_0x4f8ac9){return function(_0x546c5c,_0x1cd221,_0xb72d52){ChatInternalMessageEvents[_0xc06b('0x3')](_0x4f8ac9+':'+_0x546c5c['id'],_0x546c5c);ChatInternalMessageEvents['emit'](_0x4f8ac9,_0x546c5c);_0xb72d52(null);};}for(var e in events){if(events[_0xc06b('0x4')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xc06b('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
index 56be012..a0d97de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6661=['chat_internal_messages','utf8mb4','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','ChatInternalMessage'];(function(_0x3a97ad,_0x2a9a24){var _0x112c8a=function(_0x1d9f63){while(--_0x1d9f63){_0x3a97ad['push'](_0x3a97ad['shift']());}};_0x112c8a(++_0x2a9a24);}(_0x6661,0x10a));var _0x1666=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x6661[_0x5f309e];return _0x487b5e;};'use strict';var _=require('lodash');var util=require(_0x1666('0x0'));var logger=require(_0x1666('0x1'))('api');var moment=require(_0x1666('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1666('0x3'));var rimraf=require(_0x1666('0x4'));var config=require(_0x1666('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0x1666('0x6')]=function(_0x30c28f,_0x1cb858){return _0x30c28f[_0x1666('0x7')](_0x1666('0x8'),attributes,{'tableName':_0x1666('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1666('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x38fb=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x370b63,_0x2a9126){var _0x5590b2=function(_0x5dc74c){while(--_0x5dc74c){_0x370b63['push'](_0x370b63['shift']());}};_0x5590b2(++_0x2a9126);}(_0x38fb,0x143));var _0xb38f=function(_0x5eef05,_0x1be989){_0x5eef05=_0x5eef05-0x0;var _0x56d4b8=_0x38fb[_0x5eef05];return _0x56d4b8;};'use strict';var _=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var logger=require(_0xb38f('0x2'))(_0xb38f('0x3'));var moment=require(_0xb38f('0x4'));var BPromise=require(_0xb38f('0x5'));var rp=require(_0xb38f('0x6'));var fs=require('fs');var path=require(_0xb38f('0x7'));var rimraf=require(_0xb38f('0x8'));var config=require(_0xb38f('0x9'));var attributes=require(_0xb38f('0xa'));module[_0xb38f('0xb')]=function(_0x50950a,_0x48e2c9){return _0x50950a[_0xb38f('0xc')](_0xb38f('0xd'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb38f('0xe')});};
\ No newline at end of file
index 105f24e..45fb2fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3b=['redis','defaults','localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http'];(function(_0x120202,_0x254120){var _0xc5f215=function(_0x13d2be){while(--_0x13d2be){_0x120202['push'](_0x120202['shift']());}};_0xc5f215(++_0x254120);}(_0x7d3b,0x1d9));var _0xb7d3=function(_0x19a38e,_0x5cc39f){_0x19a38e=_0x19a38e-0x0;var _0x30a6f7=_0x7d3b[_0x19a38e];return _0x30a6f7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb7d3('0x0'));var rs=require(_0xb7d3('0x1'));var fs=require('fs');var Redis=require(_0xb7d3('0x2'));var db=require(_0xb7d3('0x3'))['db'];var utils=require(_0xb7d3('0x4'));var logger=require(_0xb7d3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb7d3('0x6')]({'port':0x232a});config[_0xb7d3('0x7')]=_[_0xb7d3('0x8')](config[_0xb7d3('0x7')],{'host':_0xb7d3('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7d3('0x7')]));require(_0xb7d3('0xa'))[_0xb7d3('0xb')](socket);function respondWithRpcPromise(_0x290f22,_0x5d98fc,_0x5729f9){return new BPromise(function(_0x4888fb,_0x2add8a){return client[_0xb7d3('0xc')](_0x290f22,_0x5729f9)[_0xb7d3('0xd')](function(_0x3df2c9){logger[_0xb7d3('0xe')](_0xb7d3('0xf'),_0x5d98fc,_0xb7d3('0x10'));logger[_0xb7d3('0x11')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5d98fc,_0xb7d3('0x10'),JSON[_0xb7d3('0x12')](_0x3df2c9));if(_0x3df2c9[_0xb7d3('0x13')]){if(_0x3df2c9['error'][_0xb7d3('0x14')]===0x1f4){logger[_0xb7d3('0x13')](_0xb7d3('0xf'),_0x5d98fc,_0x3df2c9[_0xb7d3('0x13')][_0xb7d3('0x15')]);return _0x2add8a(_0x3df2c9['error'][_0xb7d3('0x15')]);}logger[_0xb7d3('0x13')](_0xb7d3('0xf'),_0x5d98fc,_0x3df2c9[_0xb7d3('0x13')]['message']);return _0x4888fb(_0x3df2c9[_0xb7d3('0x13')][_0xb7d3('0x15')]);}else{logger[_0xb7d3('0xe')](_0xb7d3('0xf'),_0x5d98fc,_0xb7d3('0x10'));_0x4888fb(_0x3df2c9[_0xb7d3('0x16')][_0xb7d3('0x15')]);}})[_0xb7d3('0x17')](function(_0x2cbdbb){logger['error'](_0xb7d3('0xf'),_0x5d98fc,_0x2cbdbb);_0x2add8a(_0x2cbdbb);});});}
\ No newline at end of file
+var _0xba92=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','info'];(function(_0x479f47,_0x3d619a){var _0xc3fac2=function(_0x351634){while(--_0x351634){_0x479f47['push'](_0x479f47['shift']());}};_0xc3fac2(++_0x3d619a);}(_0xba92,0xe9));var _0x2ba9=function(_0x4dad6c,_0x131c34){_0x4dad6c=_0x4dad6c-0x0;var _0x1100a0=_0xba92[_0x4dad6c];return _0x1100a0;};'use strict';var _=require(_0x2ba9('0x0'));var util=require(_0x2ba9('0x1'));var moment=require(_0x2ba9('0x2'));var BPromise=require(_0x2ba9('0x3'));var rs=require(_0x2ba9('0x4'));var fs=require('fs');var Redis=require(_0x2ba9('0x5'));var db=require(_0x2ba9('0x6'))['db'];var utils=require(_0x2ba9('0x7'));var logger=require('../../config/logger')(_0x2ba9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2ba9('0x9')][_0x2ba9('0xa')]({'port':0x232a});config[_0x2ba9('0xb')]=_[_0x2ba9('0xc')](config['redis'],{'host':_0x2ba9('0xd'),'port':0x18eb});var socket=require(_0x2ba9('0xe'))(new Redis(config[_0x2ba9('0xb')]));require(_0x2ba9('0xf'))[_0x2ba9('0x10')](socket);function respondWithRpcPromise(_0x400937,_0x3feb02,_0x2ebbd9){return new BPromise(function(_0x233de2,_0x430f69){return client[_0x2ba9('0x11')](_0x400937,_0x2ebbd9)[_0x2ba9('0x12')](function(_0xdb397a){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x3feb02,'request\x20sent');logger[_0x2ba9('0x13')](_0x2ba9('0x14'),_0x3feb02,_0x2ba9('0x15'),JSON[_0x2ba9('0x16')](_0xdb397a));if(_0xdb397a['error']){if(_0xdb397a[_0x2ba9('0x17')][_0x2ba9('0x18')]===0x1f4){logger[_0x2ba9('0x17')](_0x2ba9('0x19'),_0x3feb02,_0xdb397a[_0x2ba9('0x17')][_0x2ba9('0x1a')]);return _0x430f69(_0xdb397a[_0x2ba9('0x17')][_0x2ba9('0x1a')]);}logger[_0x2ba9('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x3feb02,_0xdb397a[_0x2ba9('0x17')][_0x2ba9('0x1a')]);return _0x233de2(_0xdb397a[_0x2ba9('0x17')][_0x2ba9('0x1a')]);}else{logger[_0x2ba9('0x1b')](_0x2ba9('0x19'),_0x3feb02,'request\x20sent');_0x233de2(_0xdb397a['result'][_0x2ba9('0x1a')]);}})[_0x2ba9('0x1c')](function(_0x5a9f02){logger[_0x2ba9('0x17')](_0x2ba9('0x19'),_0x3feb02,_0x5a9f02);_0x430f69(_0x5a9f02);});});}
\ No newline at end of file
index ce2fc4d..f89442b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe8=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x37807f,_0x409cb8){var _0x5cafd0=function(_0x51b1bd){while(--_0x51b1bd){_0x37807f['push'](_0x37807f['shift']());}};_0x5cafd0(++_0x409cb8);}(_0xffe8,0xec));var _0x8ffe=function(_0x49a697,_0x47ba26){_0x49a697=_0x49a697-0x0;var _0x26448d=_0xffe8[_0x49a697];return _0x26448d;};'use strict';var ChatInternalMessageEvents=require(_0x8ffe('0x0'));var events=[_0x8ffe('0x1'),_0x8ffe('0x2'),_0x8ffe('0x3')];function createListener(_0x5cb339,_0x1885dd){return function(_0x5c0470){_0x1885dd[_0x8ffe('0x4')](_0x5cb339,_0x5c0470);};}function removeListener(_0x421907,_0x451043){return function(){ChatInternalMessageEvents[_0x8ffe('0x5')](_0x421907,_0x451043);};}exports['register']=function(_0x3b9e32){for(var _0x15af12=0x0,_0xd752e6=events[_0x8ffe('0x6')];_0x15af12<_0xd752e6;_0x15af12++){var _0xfa1cf4=events[_0x15af12];var _0xbd5ce1=createListener(_0x8ffe('0x7')+_0xfa1cf4,_0x3b9e32);ChatInternalMessageEvents['on'](_0xfa1cf4,_0xbd5ce1);}};
\ No newline at end of file
+var _0x025d=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener'];(function(_0x493a97,_0x50a93e){var _0x51f171=function(_0x26a0bb){while(--_0x26a0bb){_0x493a97['push'](_0x493a97['shift']());}};_0x51f171(++_0x50a93e);}(_0x025d,0x18f));var _0xd025=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x025d[_0x432682];return _0x463d05;};'use strict';var ChatInternalMessageEvents=require(_0xd025('0x0'));var events=[_0xd025('0x1'),_0xd025('0x2'),_0xd025('0x3')];function createListener(_0xa38c42,_0x5c466d){return function(_0x4f6c64){_0x5c466d[_0xd025('0x4')](_0xa38c42,_0x4f6c64);};}function removeListener(_0x26cbba,_0x579801){return function(){ChatInternalMessageEvents[_0xd025('0x5')](_0x26cbba,_0x579801);};}exports[_0xd025('0x6')]=function(_0x543a36){for(var _0x26cae7=0x0,_0x4777f7=events[_0xd025('0x7')];_0x26cae7<_0x4777f7;_0x26cae7++){var _0x4a7d22=events[_0x26cae7];var _0x103add=createListener(_0xd025('0x8')+_0x4a7d22,_0x543a36);ChatInternalMessageEvents['on'](_0x4a7d22,_0x103add);}};
\ No newline at end of file
index 8c7f520..e9bad2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b90=['../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','getUsers','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','fs-extra'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5b90,0x19d));var _0x05b9=function(_0x188a1d,_0x2249fc){_0x188a1d=_0x188a1d-0x0;var _0x43d0db=_0x5b90[_0x188a1d];return _0x43d0db;};'use strict';var multer=require(_0x05b9('0x0'));var util=require(_0x05b9('0x1'));var path=require(_0x05b9('0x2'));var timeout=require('connect-timeout');var express=require(_0x05b9('0x3'));var router=express['Router']();var fs_extra=require(_0x05b9('0x4'));var auth=require(_0x05b9('0x5'));var interaction=require(_0x05b9('0x6'));var config=require('../../config/environment');var controller=require(_0x05b9('0x7'));router[_0x05b9('0x8')]('/',auth[_0x05b9('0x9')](),controller[_0x05b9('0xa')]);router['get'](_0x05b9('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/users',auth[_0x05b9('0x9')](),controller[_0x05b9('0xc')]);router[_0x05b9('0x8')]('/:id',auth[_0x05b9('0x9')](),controller[_0x05b9('0xd')]);router[_0x05b9('0xe')]('/',auth['isAuthenticated'](),controller[_0x05b9('0xf')]);router[_0x05b9('0x10')](_0x05b9('0x11'),controller[_0x05b9('0x12')]);router[_0x05b9('0x13')](_0x05b9('0x11'),auth['isAuthenticated'](),controller[_0x05b9('0x14')]);module[_0x05b9('0x15')]=router;
\ No newline at end of file
+var _0x463e=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','show','create','put'];(function(_0x158c24,_0x46bc03){var _0x19d244=function(_0xa67520){while(--_0xa67520){_0x158c24['push'](_0x158c24['shift']());}};_0x19d244(++_0x46bc03);}(_0x463e,0x87));var _0xe463=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x463e[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0xe463('0x0'));var util=require(_0xe463('0x1'));var path=require(_0xe463('0x2'));var timeout=require(_0xe463('0x3'));var express=require('express');var router=express[_0xe463('0x4')]();var fs_extra=require(_0xe463('0x5'));var auth=require(_0xe463('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe463('0x7'));var controller=require(_0xe463('0x8'));router[_0xe463('0x9')]('/',auth[_0xe463('0xa')](),controller['index']);router[_0xe463('0x9')](_0xe463('0xb'),auth[_0xe463('0xa')](),controller[_0xe463('0xc')]);router[_0xe463('0x9')](_0xe463('0xd'),auth[_0xe463('0xa')](),controller[_0xe463('0xe')]);router[_0xe463('0x9')](_0xe463('0xf'),auth[_0xe463('0xa')](),controller[_0xe463('0x10')]);router['post']('/',auth[_0xe463('0xa')](),controller[_0xe463('0x11')]);router[_0xe463('0x12')](_0xe463('0xf'),controller[_0xe463('0x13')]);router['delete'](_0xe463('0xf'),auth[_0xe463('0xa')](),controller[_0xe463('0x14')]);module[_0xe463('0x15')]=router;
\ No newline at end of file
index c10b69b..dc4c2b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['DATE','STRING','sequelize','TEXT','BOOLEAN','ENUM','out'];(function(_0x3cec8c,_0x3f6c1d){var _0x38032e=function(_0x4ef75b){while(--_0x4ef75b){_0x3cec8c['push'](_0x3cec8c['shift']());}};_0x38032e(++_0x3f6c1d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'body':{'type':Sequelize[_0x7b7e('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b7e('0x3')]('in','out'),'defaultValue':_0x7b7e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7b7e('0x5')]},'providerName':{'type':Sequelize[_0x7b7e('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x2e21=['DATE','STRING','sequelize','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x10f92d,_0x21f26f){var _0x97766c=function(_0x3052f5){while(--_0x3052f5){_0x10f92d['push'](_0x10f92d['shift']());}};_0x97766c(++_0x21f26f);}(_0x2e21,0xba));var _0x12e2=function(_0x276f15,_0x17c840){_0x276f15=_0x276f15-0x0;var _0x1c7626=_0x2e21[_0x276f15];return _0x1c7626;};'use strict';var Sequelize=require(_0x12e2('0x0'));module[_0x12e2('0x1')]={'body':{'type':Sequelize[_0x12e2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x12e2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x12e2('0x4')]('in',_0x12e2('0x5')),'defaultValue':_0x12e2('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x12e2('0x6')]},'providerName':{'type':Sequelize[_0x12e2('0x7')]},'providerResponse':{'type':Sequelize[_0x12e2('0x2')]}};
\ No newline at end of file
index 728e7e6..d5ad3c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x75c655,_0x1ca2d6){var _0x356d9f=function(_0x11a6cb){while(--_0x11a6cb){_0x75c655['push'](_0x75c655['shift']());}};_0x356d9f(++_0x1ca2d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','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','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x4d1210,_0x1532dd){var _0x29b5a9=function(_0x5d236a){while(--_0x5d236a){_0x4d1210['push'](_0x4d1210['shift']());}};_0x29b5a9(++_0x1532dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
index 07212d1..2a58b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd59b=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xd59b,0x136));var _0xbd59=function(_0x22eff2,_0x240c9f){_0x22eff2=_0x22eff2-0x0;var _0x2771e2=_0xd59b[_0x22eff2];return _0x2771e2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xbd59('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xbd59('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd59('0x2'),'afterDestroy':_0xbd59('0x3')};function emitEvent(_0x23aec4){return function(_0x4e372c,_0xad4e3e,_0x22d264){ChatMessageEvents[_0xbd59('0x4')](_0x23aec4+':'+_0x4e372c['id'],_0x4e372c);ChatMessageEvents[_0xbd59('0x4')](_0x23aec4,_0x4e372c);_0x22d264(null);};}for(var e in events){if(events[_0xbd59('0x5')](e)){var event=events[e];ChatMessage[_0xbd59('0x6')](e,emitEvent(event));}}module[_0xbd59('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xfd8f=['hook','exports','events','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x505c95,_0x19f37d){var _0x1266cd=function(_0x294a96){while(--_0x294a96){_0x505c95['push'](_0x505c95['shift']());}};_0x1266cd(++_0x19f37d);}(_0xfd8f,0x19c));var _0xffd8=function(_0x31d927,_0x236eb1){_0x31d927=_0x31d927-0x0;var _0x439b70=_0xfd8f[_0x31d927];return _0x439b70;};'use strict';var EventEmitter=require(_0xffd8('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xffd8('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xffd8('0x2')](0x0);var events={'afterCreate':_0xffd8('0x3'),'afterUpdate':_0xffd8('0x4'),'afterDestroy':_0xffd8('0x5')};function emitEvent(_0x27df06){return function(_0x4548ee,_0x5a7b65,_0xbd2bea){ChatMessageEvents[_0xffd8('0x6')](_0x27df06+':'+_0x4548ee['id'],_0x4548ee);ChatMessageEvents[_0xffd8('0x6')](_0x27df06,_0x4548ee);_0xbd2bea(null);};}for(var e in events){if(events[_0xffd8('0x7')](e)){var event=events[e];ChatMessage[_0xffd8('0x8')](e,emitEvent(event));}}module[_0xffd8('0x9')]=ChatMessageEvents;
\ No newline at end of file
index 8140bc9..45ae7d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7497=['update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ChatMessage','fti_chat_messages','body','models','direction','toLowerCase','isNil','UserId','findOne','ChatInteractionId','then'];(function(_0x17b1a8,_0x2172de){var _0x18409d=function(_0x59c8c3){while(--_0x59c8c3){_0x17b1a8['push'](_0x17b1a8['shift']());}};_0x18409d(++_0x2172de);}(_0x7497,0xef));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7749('0x0'));var util=require(_0x7749('0x1'));var logger=require(_0x7749('0x2'))(_0x7749('0x3'));var moment=require(_0x7749('0x4'));var BPromise=require(_0x7749('0x5'));var rp=require(_0x7749('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7749('0x7'));var config=require(_0x7749('0x8'));var attributes=require('./chatMessage.attributes');module[_0x7749('0x9')]=function(_0x5a458e,_0x59e560){return _0x5a458e['define'](_0x7749('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x7749('0xb'),'fields':[_0x7749('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a3d76,_0x582b3a,_0x1cd851){var _0x5c936f=_0x5a458e[_0x7749('0xd')];var _0x45cfea=_0x3a3d76['get']({'plain':!![]});if(_0x45cfea[_0x7749('0xe')][_0x7749('0xf')]()==='in'||_0x45cfea[_0x7749('0xe')]['toLowerCase']()==='out'&&!_0x45cfea['secret']&&!_[_0x7749('0x10')](_0x45cfea[_0x7749('0x11')])){_0x5c936f['ChatInteraction'][_0x7749('0x12')]({'where':{'id':_0x45cfea[_0x7749('0x13')]}})[_0x7749('0x14')](function(_0x189fbd){if(_0x189fbd){_0x189fbd[_0x7749('0x15')]({'lastMsgAt':_0x45cfea['createdAt'],'lastMsgDirection':_0x45cfea['direction']['toLowerCase']()});}})[_0x7749('0x16')](function(_0x3b1758){console[_0x7749('0x17')](_0x3b1758);});}_0x1cd851();}},'charset':_0x7749('0x18'),'collate':_0x7749('0x19')});};
\ No newline at end of file
+var _0x3dbf=['error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','models','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3dbf,0x8f));var _0xf3db=function(_0x33076f,_0x1b1a84){_0x33076f=_0x33076f-0x0;var _0x47aa7b=_0x3dbf[_0x33076f];return _0x47aa7b;};'use strict';var _=require('lodash');var util=require(_0xf3db('0x0'));var logger=require(_0xf3db('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf3db('0x2'));var rp=require(_0xf3db('0x3'));var fs=require('fs');var path=require(_0xf3db('0x4'));var rimraf=require(_0xf3db('0x5'));var config=require(_0xf3db('0x6'));var attributes=require(_0xf3db('0x7'));module[_0xf3db('0x8')]=function(_0x5644db,_0x80b3d6){return _0x5644db[_0xf3db('0x9')](_0xf3db('0xa'),attributes,{'tableName':_0xf3db('0xb'),'paranoid':![],'indexes':[{'name':_0xf3db('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c9610,_0x468a12,_0x24f61d){var _0x4bf5ea=_0x5644db[_0xf3db('0xd')];var _0x3ea20e=_0x1c9610['get']({'plain':!![]});if(_0x3ea20e[_0xf3db('0xe')][_0xf3db('0xf')]()==='in'||_0x3ea20e[_0xf3db('0xe')][_0xf3db('0xf')]()===_0xf3db('0x10')&&!_0x3ea20e['secret']&&!_[_0xf3db('0x11')](_0x3ea20e[_0xf3db('0x12')])){_0x4bf5ea[_0xf3db('0x13')][_0xf3db('0x14')]({'where':{'id':_0x3ea20e['ChatInteractionId']}})[_0xf3db('0x15')](function(_0x156969){if(_0x156969){_0x156969[_0xf3db('0x16')]({'lastMsgAt':_0x3ea20e[_0xf3db('0x17')],'lastMsgDirection':_0x3ea20e[_0xf3db('0xe')]['toLowerCase']()});}})[_0xf3db('0x18')](function(_0x3be46e){console[_0xf3db('0x19')](_0x3be46e);});}_0x24f61d();}},'charset':_0xf3db('0x1a'),'collate':_0xf3db('0x1b')});};
\ No newline at end of file
index 6d2f7f6..e680c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4299=['bluebird','randomstring','rpc','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','lodash','util','moment'];(function(_0xf26344,_0x248f92){var _0x2045a3=function(_0x28da23){while(--_0x28da23){_0xf26344['push'](_0xf26344['shift']());}};_0x2045a3(++_0x248f92);}(_0x4299,0x1cd));var _0x9429=function(_0x14bc00,_0x5c7c2c){_0x14bc00=_0x14bc00-0x0;var _0x3ffcdf=_0x4299[_0x14bc00];return _0x3ffcdf;};'use strict';var _=require(_0x9429('0x0'));var util=require(_0x9429('0x1'));var moment=require(_0x9429('0x2'));var BPromise=require(_0x9429('0x3'));var rs=require(_0x9429('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9429('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9429('0x6')][_0x9429('0x7')]({'port':0x232a});config[_0x9429('0x8')]=_[_0x9429('0x9')](config[_0x9429('0x8')],{'host':_0x9429('0xa'),'port':0x18eb});var socket=require(_0x9429('0xb'))(new Redis(config[_0x9429('0x8')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x52c3f4,_0x409ff0,_0x1788ec){return new BPromise(function(_0x1a642a,_0xd24f35){return client[_0x9429('0xc')](_0x52c3f4,_0x1788ec)[_0x9429('0xd')](function(_0x21b874){logger[_0x9429('0xe')](_0x9429('0xf'),_0x409ff0,_0x9429('0x10'));logger[_0x9429('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x409ff0,_0x9429('0x10'),JSON[_0x9429('0x12')](_0x21b874));if(_0x21b874[_0x9429('0x13')]){if(_0x21b874[_0x9429('0x13')][_0x9429('0x14')]===0x1f4){logger[_0x9429('0x13')]('ChatMessage,\x20%s,\x20%s',_0x409ff0,_0x21b874[_0x9429('0x13')][_0x9429('0x15')]);return _0xd24f35(_0x21b874[_0x9429('0x13')][_0x9429('0x15')]);}logger[_0x9429('0x13')](_0x9429('0xf'),_0x409ff0,_0x21b874['error'][_0x9429('0x15')]);return _0x1a642a(_0x21b874[_0x9429('0x13')][_0x9429('0x15')]);}else{logger[_0x9429('0xe')](_0x9429('0xf'),_0x409ff0,_0x9429('0x10'));_0x1a642a(_0x21b874[_0x9429('0x16')]['message']);}})[_0x9429('0x17')](function(_0x308680){logger[_0x9429('0x13')](_0x9429('0xf'),_0x409ff0,_0x308680);_0xd24f35(_0x308680);});});}exports[_0x9429('0x18')]=function(_0x289b5f){var _0x30287e=this;return new Promise(function(_0x107e74,_0x460437){return db[_0x9429('0x19')][_0x9429('0x1a')](_0x289b5f['body'],{'raw':_0x289b5f[_0x9429('0x1b')]?_0x289b5f['options'][_0x9429('0x1c')]===undefined?!![]:![]:!![]})[_0x9429('0xd')](function(_0x511ead){logger[_0x9429('0xe')](_0x9429('0x18'),_0x289b5f);logger[_0x9429('0x11')](_0x9429('0x18'),_0x289b5f,JSON[_0x9429('0x12')](_0x511ead));_0x107e74(_0x511ead);})[_0x9429('0x17')](function(_0x3003c1){logger[_0x9429('0x13')](_0x9429('0x18'),_0x3003c1[_0x9429('0x15')],_0x289b5f);_0x460437(_0x30287e[_0x9429('0x13')](0x1f4,_0x3003c1[_0x9429('0x15')]));});});};
\ No newline at end of file
+var _0x927c=['stringify','error','message','result','CreateChatMessage','ChatMessage','create','body','options','catch','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x927c,0x190));var _0xc927=function(_0x1c5a9e,_0x26a8d9){_0x1c5a9e=_0x1c5a9e-0x0;var _0x1e82b6=_0x927c[_0x1c5a9e];return _0x1e82b6;};'use strict';var _=require('lodash');var util=require(_0xc927('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc927('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc927('0x2'))(_0xc927('0x3'));var config=require(_0xc927('0x4'));var jayson=require(_0xc927('0x5'));var client=jayson[_0xc927('0x6')][_0xc927('0x7')]({'port':0x232a});config[_0xc927('0x8')]=_[_0xc927('0x9')](config['redis'],{'host':_0xc927('0xa'),'port':0x18eb});var socket=require(_0xc927('0xb'))(new Redis(config[_0xc927('0x8')]));require(_0xc927('0xc'))[_0xc927('0xd')](socket);function respondWithRpcPromise(_0x1a246c,_0x4af2c5,_0x401ff3){return new BPromise(function(_0x375e17,_0x2e88ea){return client['request'](_0x1a246c,_0x401ff3)[_0xc927('0xe')](function(_0x5bc909){logger[_0xc927('0xf')](_0xc927('0x10'),_0x4af2c5,'request\x20sent');logger[_0xc927('0x11')](_0xc927('0x12'),_0x4af2c5,_0xc927('0x13'),JSON[_0xc927('0x14')](_0x5bc909));if(_0x5bc909[_0xc927('0x15')]){if(_0x5bc909[_0xc927('0x15')]['code']===0x1f4){logger[_0xc927('0x15')](_0xc927('0x10'),_0x4af2c5,_0x5bc909[_0xc927('0x15')][_0xc927('0x16')]);return _0x2e88ea(_0x5bc909[_0xc927('0x15')][_0xc927('0x16')]);}logger[_0xc927('0x15')](_0xc927('0x10'),_0x4af2c5,_0x5bc909['error'][_0xc927('0x16')]);return _0x375e17(_0x5bc909[_0xc927('0x15')][_0xc927('0x16')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x4af2c5,'request\x20sent');_0x375e17(_0x5bc909[_0xc927('0x17')][_0xc927('0x16')]);}})['catch'](function(_0x69804a){logger['error'](_0xc927('0x10'),_0x4af2c5,_0x69804a);_0x2e88ea(_0x69804a);});});}exports[_0xc927('0x18')]=function(_0x6773bc){var _0x1a8d78=this;return new Promise(function(_0x4156ec,_0x823d10){return db[_0xc927('0x19')][_0xc927('0x1a')](_0x6773bc[_0xc927('0x1b')],{'raw':_0x6773bc['options']?_0x6773bc[_0xc927('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xc927('0xe')](function(_0x59390c){logger[_0xc927('0xf')](_0xc927('0x18'),_0x6773bc);logger['debug'](_0xc927('0x18'),_0x6773bc,JSON[_0xc927('0x14')](_0x59390c));_0x4156ec(_0x59390c);})[_0xc927('0x1d')](function(_0x958ac6){logger['error'](_0xc927('0x18'),_0x958ac6[_0xc927('0x16')],_0x6773bc);_0x823d10(_0x1a8d78['error'](0x1f4,_0x958ac6[_0xc927('0x16')]));});});};
\ No newline at end of file
index 6d55732..913d605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdad2=['save','remove','register','chatMessage:'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xdad2,0x14c));var _0x2dad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdad2[_0x122ef9];return _0x42fba0;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x2dad('0x0'),_0x2dad('0x1'),'update'];function createListener(_0x22b0a0,_0x15946a){return function(_0x3988ca){_0x15946a['emit'](_0x22b0a0,_0x3988ca);};}function removeListener(_0x3212a5,_0x1437b9){return function(){ChatMessageEvents['removeListener'](_0x3212a5,_0x1437b9);};}exports[_0x2dad('0x2')]=function(_0x36a054){for(var _0x27ca04=0x0,_0xf0022b=events['length'];_0x27ca04<_0xf0022b;_0x27ca04++){var _0x5b6aa2=events[_0x27ca04];var _0x217e41=createListener(_0x2dad('0x3')+_0x5b6aa2,_0x36a054);ChatMessageEvents['on'](_0x5b6aa2,_0x217e41);}};
\ No newline at end of file
+var _0xdbf5=['save','emit','removeListener','register','length','chatMessage:'];(function(_0x19c75a,_0x5fde73){var _0xe51d07=function(_0x49b7e1){while(--_0x49b7e1){_0x19c75a['push'](_0x19c75a['shift']());}};_0xe51d07(++_0x5fde73);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x21c579,_0x1c9c8e){_0x21c579=_0x21c579-0x0;var _0x563d82=_0xdbf5[_0x21c579];return _0x563d82;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5dbf('0x0'),'remove','update'];function createListener(_0x19d2b4,_0xfd972b){return function(_0x32ec6b){_0xfd972b[_0x5dbf('0x1')](_0x19d2b4,_0x32ec6b);};}function removeListener(_0x38b629,_0x1a1ea9){return function(){ChatMessageEvents[_0x5dbf('0x2')](_0x38b629,_0x1a1ea9);};}exports[_0x5dbf('0x3')]=function(_0x3f8628){for(var _0x3f8222=0x0,_0x209b7d=events[_0x5dbf('0x4')];_0x3f8222<_0x209b7d;_0x3f8222++){var _0x93e657=events[_0x3f8222];var _0x52b039=createListener(_0x5dbf('0x5')+_0x93e657,_0x3f8628);ChatMessageEvents['on'](_0x93e657,_0x52b039);}};
\ No newline at end of file
index 78fe1a1..cc4f489 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e1f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked','chat','create','put','update','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout'];(function(_0x243b34,_0x254691){var _0x188a58=function(_0x5e0e4c){while(--_0x5e0e4c){_0x243b34['push'](_0x243b34['shift']());}};_0x188a58(++_0x254691);}(_0x3e1f,0x1ea));var _0xf3e1=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0x3e1f[_0x4327fe];return _0x138651;};'use strict';var multer=require(_0xf3e1('0x0'));var util=require(_0xf3e1('0x1'));var path=require(_0xf3e1('0x2'));var timeout=require(_0xf3e1('0x3'));var express=require(_0xf3e1('0x4'));var router=express[_0xf3e1('0x5')]();var fs_extra=require(_0xf3e1('0x6'));var auth=require(_0xf3e1('0x7'));var interaction=require(_0xf3e1('0x8'));var config=require(_0xf3e1('0x9'));var controller=require(_0xf3e1('0xa'));router[_0xf3e1('0xb')]('/',auth[_0xf3e1('0xc')](),controller[_0xf3e1('0xd')]);router[_0xf3e1('0xb')]('/describe',auth[_0xf3e1('0xc')](),controller['describe']);router['get'](_0xf3e1('0xe'),auth[_0xf3e1('0xc')](),controller[_0xf3e1('0xf')]);router[_0xf3e1('0x10')]('/',auth[_0xf3e1('0xc')](),interaction[_0xf3e1('0x11')](_0xf3e1('0x12'),'chatmessage:create'),controller[_0xf3e1('0x13')]);router[_0xf3e1('0x14')]('/:id',controller[_0xf3e1('0x15')]);router[_0xf3e1('0x14')]('/:id/accept',auth[_0xf3e1('0xc')](),controller[_0xf3e1('0x16')]);router[_0xf3e1('0x14')](_0xf3e1('0x17'),auth[_0xf3e1('0xc')](),controller[_0xf3e1('0x18')]);router[_0xf3e1('0x19')](_0xf3e1('0xe'),auth[_0xf3e1('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xab70=['isAuthenticated','index','get','/describe','/:id','show','tracked','chat','create','update','put','/:id/accept','/:id/reject','reject','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x32cb1f,_0x37db1d){var _0x37f3f6=function(_0x48683d){while(--_0x48683d){_0x32cb1f['push'](_0x32cb1f['shift']());}};_0x37f3f6(++_0x37db1d);}(_0xab70,0x82));var _0x0ab7=function(_0x2a5f3d,_0x21a8a2){_0x2a5f3d=_0x2a5f3d-0x0;var _0x22ab1a=_0xab70[_0x2a5f3d];return _0x22ab1a;};'use strict';var multer=require(_0x0ab7('0x0'));var util=require('util');var path=require(_0x0ab7('0x1'));var timeout=require(_0x0ab7('0x2'));var express=require(_0x0ab7('0x3'));var router=express[_0x0ab7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0ab7('0x5'));var interaction=require(_0x0ab7('0x6'));var config=require(_0x0ab7('0x7'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0x0ab7('0x8')](),controller[_0x0ab7('0x9')]);router[_0x0ab7('0xa')](_0x0ab7('0xb'),auth[_0x0ab7('0x8')](),controller['describe']);router[_0x0ab7('0xa')](_0x0ab7('0xc'),auth['isAuthenticated'](),controller[_0x0ab7('0xd')]);router['post']('/',auth[_0x0ab7('0x8')](),interaction[_0x0ab7('0xe')](_0x0ab7('0xf'),'chatmessage:create'),controller[_0x0ab7('0x10')]);router['put'](_0x0ab7('0xc'),controller[_0x0ab7('0x11')]);router[_0x0ab7('0x12')](_0x0ab7('0x13'),auth[_0x0ab7('0x8')](),controller['accept']);router[_0x0ab7('0x12')](_0x0ab7('0x14'),auth[_0x0ab7('0x8')](),controller[_0x0ab7('0x15')]);router['delete']('/:id',auth[_0x0ab7('0x8')](),controller['destroy']);module[_0x0ab7('0x16')]=router;
\ No newline at end of file
index 51b88d3..1c4e22c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4524=['sequelize','TEXT','medium'];(function(_0x242b28,_0x482ddb){var _0x2fffe3=function(_0x430ada){while(--_0x430ada){_0x242b28['push'](_0x242b28['shift']());}};_0x2fffe3(++_0x482ddb);}(_0x4524,0x17a));var _0x4452=function(_0x54c0cb,_0x2eb98e){_0x54c0cb=_0x54c0cb-0x0;var _0xbebe88=_0x4524[_0x54c0cb];return _0xbebe88;};'use strict';var Sequelize=require(_0x4452('0x0'));module['exports']={'body':{'type':Sequelize[_0x4452('0x1')](_0x4452('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x352d=['TEXT','medium','sequelize','exports'];(function(_0x37e848,_0x418405){var _0x512fe7=function(_0x1652c3){while(--_0x1652c3){_0x37e848['push'](_0x37e848['shift']());}};_0x512fe7(++_0x418405);}(_0x352d,0xce));var _0xd352=function(_0x21cd8a,_0x34bbd9){_0x21cd8a=_0x21cd8a-0x0;var _0x154e70=_0x352d[_0x21cd8a];return _0x154e70;};'use strict';var Sequelize=require(_0xd352('0x0'));module[_0xd352('0x1')]={'body':{'type':Sequelize[_0xd352('0x2')](_0xd352('0x3')),'allowNull':![]}};
\ No newline at end of file
index a1330e9..b362619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2c240b,_0x395224){var _0x6bb604=function(_0x1b889d){while(--_0x1b889d){_0x2c240b['push'](_0x2c240b['shift']());}};_0x6bb604(++_0x395224);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x7a54,0x106));var _0x47a5=function(_0x4cb3c6,_0xb22422){_0x4cb3c6=_0x4cb3c6-0x0;var _0x15afcb=_0x7a54[_0x4cb3c6];return _0x15afcb;};'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 7f021e9..e8794e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb501=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0xb501,0xd9));var _0x1b50=function(_0x4718d0,_0x52ca54){_0x4718d0=_0x4718d0-0x0;var _0x363882=_0xb501[_0x4718d0];return _0x363882;};'use strict';var _=require(_0x1b50('0x0'));var util=require(_0x1b50('0x1'));var logger=require(_0x1b50('0x2'))(_0x1b50('0x3'));var moment=require(_0x1b50('0x4'));var BPromise=require(_0x1b50('0x5'));var rp=require(_0x1b50('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b50('0x7'));var config=require(_0x1b50('0x8'));var attributes=require(_0x1b50('0x9'));module[_0x1b50('0xa')]=function(_0x3fb582,_0x2b033d){return _0x3fb582[_0x1b50('0xb')](_0x1b50('0xc'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1b50('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7953=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x7953,0x1b0));var _0x3795=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x7953[_0x34d275];return _0x1379cc;};'use strict';var _=require(_0x3795('0x0'));var util=require('util');var logger=require(_0x3795('0x1'))(_0x3795('0x2'));var moment=require(_0x3795('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3795('0x4'));var rimraf=require(_0x3795('0x5'));var config=require('../../config/environment');var attributes=require(_0x3795('0x6'));module[_0x3795('0x7')]=function(_0x5ba445,_0x4f6dce){return _0x5ba445[_0x3795('0x8')](_0x3795('0x9'),attributes,{'tableName':_0x3795('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3795('0xb'),'collate':_0x3795('0xc')});};
\ No newline at end of file
index 70a4b68..b8c660a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x514e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x514e,0x146));var _0xe514=function(_0x5a43aa,_0x1a007c){_0x5a43aa=_0x5a43aa-0x0;var _0x17314a=_0x514e[_0x5a43aa];return _0x17314a;};'use strict';var _=require(_0xe514('0x0'));var util=require(_0xe514('0x1'));var moment=require(_0xe514('0x2'));var BPromise=require(_0xe514('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe514('0x4'));var db=require(_0xe514('0x5'))['db'];var utils=require(_0xe514('0x6'));var logger=require(_0xe514('0x7'))(_0xe514('0x8'));var config=require(_0xe514('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe514('0xa')][_0xe514('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3532be,_0x35c38c,_0x1c0098){return new BPromise(function(_0x5a7fe2,_0x5a5044){return client[_0xe514('0xc')](_0x3532be,_0x1c0098)[_0xe514('0xd')](function(_0x4b89f6){logger[_0xe514('0xe')](_0xe514('0xf'),_0x35c38c,_0xe514('0x10'));logger['debug'](_0xe514('0x11'),_0x35c38c,_0xe514('0x10'),JSON['stringify'](_0x4b89f6));if(_0x4b89f6[_0xe514('0x12')]){if(_0x4b89f6['error'][_0xe514('0x13')]===0x1f4){logger[_0xe514('0x12')](_0xe514('0xf'),_0x35c38c,_0x4b89f6[_0xe514('0x12')]['message']);return _0x5a5044(_0x4b89f6[_0xe514('0x12')]['message']);}logger[_0xe514('0x12')](_0xe514('0xf'),_0x35c38c,_0x4b89f6['error'][_0xe514('0x14')]);return _0x5a7fe2(_0x4b89f6['error'][_0xe514('0x14')]);}else{logger[_0xe514('0xe')](_0xe514('0xf'),_0x35c38c,_0xe514('0x10'));_0x5a7fe2(_0x4b89f6[_0xe514('0x15')][_0xe514('0x14')]);}})['catch'](function(_0xc922bb){logger[_0xe514('0x12')](_0xe514('0xf'),_0x35c38c,_0xc922bb);_0x5a5044(_0xc922bb);});});}
\ No newline at end of file
+var _0xe421=['result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x15a320,_0x15fc2f){var _0x6e1776=function(_0x164e61){while(--_0x164e61){_0x15a320['push'](_0x15a320['shift']());}};_0x6e1776(++_0x15fc2f);}(_0xe421,0x18d));var _0x1e42=function(_0x1793fc,_0x3789a3){_0x1793fc=_0x1793fc-0x0;var _0x25b7b9=_0xe421[_0x1793fc];return _0x25b7b9;};'use strict';var _=require(_0x1e42('0x0'));var util=require(_0x1e42('0x1'));var moment=require(_0x1e42('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e42('0x3'));var db=require(_0x1e42('0x4'))['db'];var utils=require(_0x1e42('0x5'));var logger=require('../../config/logger')(_0x1e42('0x6'));var config=require('../../config/environment');var jayson=require(_0x1e42('0x7'));var client=jayson['client'][_0x1e42('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5eb087,_0x159cff,_0x22d013){return new BPromise(function(_0x3ea539,_0x497a62){return client['request'](_0x5eb087,_0x22d013)[_0x1e42('0x9')](function(_0x2e0ceb){logger[_0x1e42('0xa')](_0x1e42('0xb'),_0x159cff,_0x1e42('0xc'));logger[_0x1e42('0xd')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x159cff,_0x1e42('0xc'),JSON['stringify'](_0x2e0ceb));if(_0x2e0ceb['error']){if(_0x2e0ceb[_0x1e42('0xe')][_0x1e42('0xf')]===0x1f4){logger[_0x1e42('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x159cff,_0x2e0ceb[_0x1e42('0xe')]['message']);return _0x497a62(_0x2e0ceb[_0x1e42('0xe')][_0x1e42('0x10')]);}logger[_0x1e42('0xe')](_0x1e42('0xb'),_0x159cff,_0x2e0ceb[_0x1e42('0xe')][_0x1e42('0x10')]);return _0x3ea539(_0x2e0ceb[_0x1e42('0xe')]['message']);}else{logger[_0x1e42('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x159cff,'request\x20sent');_0x3ea539(_0x2e0ceb[_0x1e42('0x11')][_0x1e42('0x10')]);}})['catch'](function(_0x34aa1d){logger[_0x1e42('0xe')](_0x1e42('0xb'),_0x159cff,_0x34aa1d);_0x497a62(_0x34aa1d);});});}
\ No newline at end of file
index 349b85b..822de3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x127d=['put','update','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x768458,_0x3d0933){var _0x31385c=function(_0xf11dad){while(--_0xf11dad){_0x768458['push'](_0x768458['shift']());}};_0x31385c(++_0x3d0933);}(_0x127d,0x146));var _0xd127=function(_0x2fb66d,_0x266d45){_0x2fb66d=_0x2fb66d-0x0;var _0x2c36fd=_0x127d[_0x2fb66d];return _0x2c36fd;};'use strict';var multer=require(_0xd127('0x0'));var util=require(_0xd127('0x1'));var path=require(_0xd127('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd127('0x3')]();var fs_extra=require(_0xd127('0x4'));var auth=require(_0xd127('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd127('0x6'));var controller=require(_0xd127('0x7'));router[_0xd127('0x8')]('/',auth[_0xd127('0x9')](),controller['index']);router[_0xd127('0x8')](_0xd127('0xa'),auth['isAuthenticated'](),controller[_0xd127('0xb')]);router[_0xd127('0x8')](_0xd127('0xc'),auth[_0xd127('0x9')](),controller[_0xd127('0xd')]);router[_0xd127('0xe')]('/',auth[_0xd127('0x9')](),controller[_0xd127('0xf')]);router[_0xd127('0x10')](_0xd127('0xc'),auth[_0xd127('0x9')](),controller[_0xd127('0x11')]);router['delete'](_0xd127('0xc'),auth[_0xd127('0x9')](),controller[_0xd127('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4119=['isAuthenticated','index','/describe','post','create','/:id','update','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','get'];(function(_0x2a4497,_0x1b0574){var _0x4c6de6=function(_0x344071){while(--_0x344071){_0x2a4497['push'](_0x2a4497['shift']());}};_0x4c6de6(++_0x1b0574);}(_0x4119,0x179));var _0x9411=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x4119[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9411('0x0'));var timeout=require(_0x9411('0x1'));var express=require(_0x9411('0x2'));var router=express['Router']();var fs_extra=require(_0x9411('0x3'));var auth=require(_0x9411('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9411('0x5'));router[_0x9411('0x6')]('/',auth[_0x9411('0x7')](),controller[_0x9411('0x8')]);router['get'](_0x9411('0x9'),auth[_0x9411('0x7')](),controller['describe']);router[_0x9411('0x6')]('/:id',auth[_0x9411('0x7')](),controller['show']);router[_0x9411('0xa')]('/',auth[_0x9411('0x7')](),controller[_0x9411('0xb')]);router['put'](_0x9411('0xc'),auth['isAuthenticated'](),controller[_0x9411('0xd')]);router['delete'](_0x9411('0xc'),auth[_0x9411('0x7')](),controller[_0x9411('0xe')]);module[_0x9411('0xf')]=router;
\ No newline at end of file
index d42120e..6f83ede 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fb3=['INTEGER','STRING','mouseOver','timeout'];(function(_0xc4376d,_0x2e6841){var _0x291524=function(_0x235c70){while(--_0x235c70){_0xc4376d['push'](_0xc4376d['shift']());}};_0x291524(++_0x2e6841);}(_0x8fb3,0x199));var _0x38fb=function(_0x16ca59,_0x258531){_0x16ca59=_0x16ca59-0x0;var _0x5505f1=_0x8fb3[_0x16ca59];return _0x5505f1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x38fb('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x38fb('0x1'),_0x38fb('0x2')),'defaultValue':_0x38fb('0x1')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x38fb('0x3')]}};
\ No newline at end of file
+var _0x5057=['ENUM','timeout','mouseOver','sequelize','STRING'];(function(_0x4ada02,_0x206e9a){var _0x1449ae=function(_0x389ebb){while(--_0x389ebb){_0x4ada02['push'](_0x4ada02['shift']());}};_0x1449ae(++_0x206e9a);}(_0x5057,0x111));var _0x7505=function(_0x3b4693,_0x3a608a){_0x3b4693=_0x3b4693-0x0;var _0x2750ed=_0x5057[_0x3b4693];return _0x2750ed;};'use strict';var Sequelize=require(_0x7505('0x0'));module['exports']={'name':{'type':Sequelize[_0x7505('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7505('0x2')]('mouseOver',_0x7505('0x3')),'defaultValue':_0x7505('0x4')},'selector':{'type':Sequelize[_0x7505('0x1')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index b91e3e0..8da2b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f9=['query','filters','intersection','model','fields','attributes','includeAll','merge','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','send','show','params','keys','ChatProactiveAction','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1f9,0x88));var _0x9d1f=function(_0x1436d8,_0x5135aa){_0x1436d8=_0x1436d8-0x0;var _0x252c31=_0xd1f9[_0x1436d8];return _0x252c31;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d1f('0x0'));var jsonpatch=require(_0x9d1f('0x1'));var rp=require(_0x9d1f('0x2'));var moment=require(_0x9d1f('0x3'));var BPromise=require(_0x9d1f('0x4'));var Mustache=require(_0x9d1f('0x5'));var util=require(_0x9d1f('0x6'));var path=require(_0x9d1f('0x7'));var sox=require(_0x9d1f('0x8'));var csv=require('to-csv');var ejs=require(_0x9d1f('0x9'));var fs=require('fs');var fs_extra=require(_0x9d1f('0xa'));var _=require(_0x9d1f('0xb'));var squel=require(_0x9d1f('0xc'));var crypto=require(_0x9d1f('0xd'));var jsforce=require(_0x9d1f('0xe'));var deskjs=require(_0x9d1f('0xf'));var toCsv=require(_0x9d1f('0x10'));var querystring=require(_0x9d1f('0x11'));var Papa=require(_0x9d1f('0x12'));var Redis=require(_0x9d1f('0x13'));var authService=require(_0x9d1f('0x14'));var qs=require(_0x9d1f('0x15'));var as=require(_0x9d1f('0x16'));var hardwareService=require(_0x9d1f('0x17'));var logger=require(_0x9d1f('0x18'))(_0x9d1f('0x19'));var utils=require(_0x9d1f('0x1a'));var config=require(_0x9d1f('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d1f('0x1c'))['db'];function respondWithStatusCode(_0x15a999,_0x7edbfa){_0x7edbfa=_0x7edbfa||0xcc;return function(_0x5a4d43){if(_0x5a4d43){return _0x15a999[_0x9d1f('0x1d')](_0x7edbfa);}return _0x15a999['status'](_0x7edbfa)['end']();};}function respondWithResult(_0x71e9c9,_0x38395d){_0x38395d=_0x38395d||0xc8;return function(_0x25c0b0){if(_0x25c0b0){return _0x71e9c9[_0x9d1f('0x1e')](_0x38395d)[_0x9d1f('0x1f')](_0x25c0b0);}};}function respondWithFilteredResult(_0x40a87f,_0x9f8cfc){return function(_0x2488a3){if(_0x2488a3){var _0x24cd8a=typeof _0x9f8cfc[_0x9d1f('0x20')]===_0x9d1f('0x21')&&typeof _0x9f8cfc[_0x9d1f('0x22')]===_0x9d1f('0x21');var _0x57ba11=_0x2488a3[_0x9d1f('0x23')];var _0x42a2b4=_0x24cd8a?0x0:_0x9f8cfc['offset'];var _0x329b69=_0x24cd8a?_0x2488a3['count']:_0x9f8cfc['offset']+_0x9f8cfc['limit'];var _0x2d39f3;if(_0x329b69>=_0x57ba11){_0x329b69=_0x57ba11;_0x2d39f3=0xc8;}else{_0x2d39f3=0xce;}_0x40a87f[_0x9d1f('0x1e')](_0x2d39f3);return _0x40a87f[_0x9d1f('0x24')]('Content-Range',_0x42a2b4+'-'+_0x329b69+'/'+_0x57ba11)[_0x9d1f('0x1f')](_0x2488a3);}return null;};}function patchUpdates(_0x4cfcf5){return function(_0x1c0280){try{jsonpatch['apply'](_0x1c0280,_0x4cfcf5,!![]);}catch(_0x552a84){return BPromise[_0x9d1f('0x25')](_0x552a84);}return _0x1c0280[_0x9d1f('0x26')]();};}function saveUpdates(_0x35a80d,_0x2d861b){return function(_0x44ef15){if(_0x44ef15){return _0x44ef15[_0x9d1f('0x27')](_0x35a80d)[_0x9d1f('0x28')](function(_0x3b10f7){return _0x3b10f7;});}return null;};}function removeEntity(_0x2c6417,_0xc05aa){return function(_0x1ab0f4){if(_0x1ab0f4){return _0x1ab0f4[_0x9d1f('0x29')]()[_0x9d1f('0x28')](function(){_0x2c6417[_0x9d1f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b234d,_0xa2392f){return function(_0x48245c){if(!_0x48245c){_0x2b234d['sendStatus'](0x194);}return _0x48245c;};}function handleError(_0x1f2b0e,_0xfdd4ae){_0xfdd4ae=_0xfdd4ae||0x1f4;return function(_0x3ca450){logger[_0x9d1f('0x2a')](_0x3ca450[_0x9d1f('0x2b')]);if(_0x3ca450['name']){delete _0x3ca450['name'];}_0x1f2b0e[_0x9d1f('0x1e')](_0xfdd4ae)[_0x9d1f('0x2c')](_0x3ca450);};}exports[_0x9d1f('0x2d')]=function(_0x44515d,_0x1df1b8){var _0x1d8ffe={'raw':!![],'where':{'id':_0x44515d[_0x9d1f('0x2e')]['id']}},_0x48fbf5={};_0x48fbf5['model']=_[_0x9d1f('0x2f')](db[_0x9d1f('0x30')][_0x9d1f('0x31')]);_0x48fbf5[_0x9d1f('0x32')]=_[_0x9d1f('0x2f')](_0x44515d['query']);_0x48fbf5[_0x9d1f('0x33')]=_[_0x9d1f('0x34')](_0x48fbf5[_0x9d1f('0x35')],_0x48fbf5['query']);_0x1d8ffe['attributes']=_[_0x9d1f('0x34')](_0x48fbf5[_0x9d1f('0x35')],qs['fields'](_0x44515d[_0x9d1f('0x32')][_0x9d1f('0x36')]));_0x1d8ffe[_0x9d1f('0x37')]=_0x1d8ffe[_0x9d1f('0x37')]['length']?_0x1d8ffe[_0x9d1f('0x37')]:_0x48fbf5[_0x9d1f('0x35')];if(_0x44515d[_0x9d1f('0x32')][_0x9d1f('0x38')]){_0x1d8ffe['include']=[{'all':!![]}];}_0x1d8ffe=_[_0x9d1f('0x39')]({},_0x1d8ffe,_0x44515d['options']);return db[_0x9d1f('0x30')][_0x9d1f('0x3a')](_0x1d8ffe)[_0x9d1f('0x28')](handleEntityNotFound(_0x1df1b8,null))['then'](respondWithResult(_0x1df1b8,null))[_0x9d1f('0x3b')](handleError(_0x1df1b8,null));};exports[_0x9d1f('0x3c')]=function(_0x324242,_0x236ca3){return db[_0x9d1f('0x30')]['create'](_0x324242[_0x9d1f('0x3d')],{})[_0x9d1f('0x28')](respondWithResult(_0x236ca3,0xc9))[_0x9d1f('0x3b')](handleError(_0x236ca3,null));};exports[_0x9d1f('0x27')]=function(_0x245675,_0x381654){if(_0x245675[_0x9d1f('0x3d')]['id']){delete _0x245675['body']['id'];}return db[_0x9d1f('0x30')][_0x9d1f('0x3a')]({'where':{'id':_0x245675[_0x9d1f('0x2e')]['id']}})[_0x9d1f('0x28')](handleEntityNotFound(_0x381654,null))['then'](saveUpdates(_0x245675[_0x9d1f('0x3d')],null))['then'](respondWithResult(_0x381654,null))['catch'](handleError(_0x381654,null));};exports['destroy']=function(_0x3c9a17,_0x1253e2){return db['ChatProactiveAction'][_0x9d1f('0x3a')]({'where':{'id':_0x3c9a17[_0x9d1f('0x2e')]['id']}})[_0x9d1f('0x28')](handleEntityNotFound(_0x1253e2,null))[_0x9d1f('0x28')](removeEntity(_0x1253e2,null))[_0x9d1f('0x3b')](handleError(_0x1253e2,null));};
\ No newline at end of file
+var _0xec46=['to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','name','send','show','params','model','keys','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','ChatProactiveAction','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xec46,0x19c));var _0x6ec4=function(_0x3ae34a,_0x143082){_0x3ae34a=_0x3ae34a-0x0;var _0x4c9edc=_0xec46[_0x3ae34a];return _0x4c9edc;};'use strict';var emlformat=require(_0x6ec4('0x0'));var rimraf=require(_0x6ec4('0x1'));var zipdir=require(_0x6ec4('0x2'));var jsonpatch=require(_0x6ec4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ec4('0x4'));var Mustache=require(_0x6ec4('0x5'));var util=require(_0x6ec4('0x6'));var path=require('path');var sox=require(_0x6ec4('0x7'));var csv=require(_0x6ec4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ec4('0x9'));var _=require('lodash');var squel=require(_0x6ec4('0xa'));var crypto=require(_0x6ec4('0xb'));var jsforce=require(_0x6ec4('0xc'));var deskjs=require(_0x6ec4('0xd'));var toCsv=require(_0x6ec4('0x8'));var querystring=require(_0x6ec4('0xe'));var Papa=require(_0x6ec4('0xf'));var Redis=require(_0x6ec4('0x10'));var authService=require(_0x6ec4('0x11'));var qs=require(_0x6ec4('0x12'));var as=require(_0x6ec4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ec4('0x14'));var utils=require(_0x6ec4('0x15'));var config=require(_0x6ec4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ec4('0x17'))['db'];function respondWithStatusCode(_0x489707,_0x472484){_0x472484=_0x472484||0xcc;return function(_0x5e9b01){if(_0x5e9b01){return _0x489707[_0x6ec4('0x18')](_0x472484);}return _0x489707[_0x6ec4('0x19')](_0x472484)[_0x6ec4('0x1a')]();};}function respondWithResult(_0x15f87f,_0x2813b6){_0x2813b6=_0x2813b6||0xc8;return function(_0x5882d1){if(_0x5882d1){return _0x15f87f[_0x6ec4('0x19')](_0x2813b6)[_0x6ec4('0x1b')](_0x5882d1);}};}function respondWithFilteredResult(_0x43d7f8,_0x272d71){return function(_0x4f5390){if(_0x4f5390){var _0x861a21=typeof _0x272d71[_0x6ec4('0x1c')]===_0x6ec4('0x1d')&&typeof _0x272d71[_0x6ec4('0x1e')]===_0x6ec4('0x1d');var _0x1b7c00=_0x4f5390['count'];var _0x327724=_0x861a21?0x0:_0x272d71['offset'];var _0x516f22=_0x861a21?_0x4f5390[_0x6ec4('0x1f')]:_0x272d71['offset']+_0x272d71[_0x6ec4('0x1e')];var _0x1db2ea;if(_0x516f22>=_0x1b7c00){_0x516f22=_0x1b7c00;_0x1db2ea=0xc8;}else{_0x1db2ea=0xce;}_0x43d7f8[_0x6ec4('0x19')](_0x1db2ea);return _0x43d7f8['set'](_0x6ec4('0x20'),_0x327724+'-'+_0x516f22+'/'+_0x1b7c00)['json'](_0x4f5390);}return null;};}function patchUpdates(_0x574d80){return function(_0x9689ab){try{jsonpatch[_0x6ec4('0x21')](_0x9689ab,_0x574d80,!![]);}catch(_0x5b4966){return BPromise[_0x6ec4('0x22')](_0x5b4966);}return _0x9689ab[_0x6ec4('0x23')]();};}function saveUpdates(_0x34b76e,_0x364cfc){return function(_0x5032a1){if(_0x5032a1){return _0x5032a1[_0x6ec4('0x24')](_0x34b76e)['then'](function(_0x5ef6a5){return _0x5ef6a5;});}return null;};}function removeEntity(_0x2a6f2f,_0x766a30){return function(_0x3dd6e0){if(_0x3dd6e0){return _0x3dd6e0[_0x6ec4('0x25')]()[_0x6ec4('0x26')](function(){_0x2a6f2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x183257,_0x52b927){return function(_0x1bc94e){if(!_0x1bc94e){_0x183257['sendStatus'](0x194);}return _0x1bc94e;};}function handleError(_0x3bac89,_0x4dc97d){_0x4dc97d=_0x4dc97d||0x1f4;return function(_0x239430){logger['error'](_0x239430['stack']);if(_0x239430[_0x6ec4('0x27')]){delete _0x239430['name'];}_0x3bac89[_0x6ec4('0x19')](_0x4dc97d)[_0x6ec4('0x28')](_0x239430);};}exports[_0x6ec4('0x29')]=function(_0x51606c,_0x33ea66){var _0x486951={'raw':!![],'where':{'id':_0x51606c[_0x6ec4('0x2a')]['id']}},_0x1ada63={};_0x1ada63[_0x6ec4('0x2b')]=_[_0x6ec4('0x2c')](db['ChatProactiveAction'][_0x6ec4('0x2d')]);_0x1ada63[_0x6ec4('0x2e')]=_[_0x6ec4('0x2c')](_0x51606c[_0x6ec4('0x2e')]);_0x1ada63['filters']=_['intersection'](_0x1ada63[_0x6ec4('0x2b')],_0x1ada63[_0x6ec4('0x2e')]);_0x486951['attributes']=_[_0x6ec4('0x2f')](_0x1ada63['model'],qs[_0x6ec4('0x30')](_0x51606c[_0x6ec4('0x2e')][_0x6ec4('0x30')]));_0x486951[_0x6ec4('0x31')]=_0x486951['attributes'][_0x6ec4('0x32')]?_0x486951[_0x6ec4('0x31')]:_0x1ada63[_0x6ec4('0x2b')];if(_0x51606c[_0x6ec4('0x2e')][_0x6ec4('0x33')]){_0x486951[_0x6ec4('0x34')]=[{'all':!![]}];}_0x486951=_[_0x6ec4('0x35')]({},_0x486951,_0x51606c[_0x6ec4('0x36')]);return db[_0x6ec4('0x37')]['find'](_0x486951)[_0x6ec4('0x26')](handleEntityNotFound(_0x33ea66,null))[_0x6ec4('0x26')](respondWithResult(_0x33ea66,null))[_0x6ec4('0x38')](handleError(_0x33ea66,null));};exports['create']=function(_0x72790,_0x52e04f){return db['ChatProactiveAction'][_0x6ec4('0x39')](_0x72790[_0x6ec4('0x3a')],{})['then'](respondWithResult(_0x52e04f,0xc9))['catch'](handleError(_0x52e04f,null));};exports['update']=function(_0x51d98b,_0x529ccf){if(_0x51d98b[_0x6ec4('0x3a')]['id']){delete _0x51d98b['body']['id'];}return db[_0x6ec4('0x37')]['find']({'where':{'id':_0x51d98b[_0x6ec4('0x2a')]['id']}})[_0x6ec4('0x26')](handleEntityNotFound(_0x529ccf,null))['then'](saveUpdates(_0x51d98b[_0x6ec4('0x3a')],null))[_0x6ec4('0x26')](respondWithResult(_0x529ccf,null))['catch'](handleError(_0x529ccf,null));};exports[_0x6ec4('0x25')]=function(_0x494a1f,_0x13daac){return db['ChatProactiveAction'][_0x6ec4('0x3b')]({'where':{'id':_0x494a1f[_0x6ec4('0x2a')]['id']}})[_0x6ec4('0x26')](handleEntityNotFound(_0x13daac,null))[_0x6ec4('0x26')](removeEntity(_0x13daac,null))[_0x6ec4('0x38')](handleError(_0x13daac,null));};
\ No newline at end of file
index de532c5..737adfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b2=['exports','define','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5685d6,_0x5cce18){var _0x267f31=function(_0x4ac0d4){while(--_0x4ac0d4){_0x5685d6['push'](_0x5685d6['shift']());}};_0x267f31(++_0x5cce18);}(_0xd8b2,0x1f2));var _0x2d8b=function(_0x444076,_0x527e9a){_0x444076=_0x444076-0x0;var _0x430bed=_0xd8b2[_0x444076];return _0x430bed;};'use strict';var _=require('lodash');var util=require(_0x2d8b('0x0'));var logger=require(_0x2d8b('0x1'))(_0x2d8b('0x2'));var moment=require(_0x2d8b('0x3'));var BPromise=require(_0x2d8b('0x4'));var rp=require(_0x2d8b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d8b('0x6'));var config=require(_0x2d8b('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x2d8b('0x8')]=function(_0x574789,_0x13268e){return _0x574789[_0x2d8b('0x9')]('ChatProactiveAction',attributes,{'tableName':_0x2d8b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7fc8=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7fc8,0x137));var _0x87fc=function(_0x3a2910,_0x7936c6){_0x3a2910=_0x3a2910-0x0;var _0x2e8bce=_0x7fc8[_0x3a2910];return _0x2e8bce;};'use strict';var _=require(_0x87fc('0x0'));var util=require(_0x87fc('0x1'));var logger=require(_0x87fc('0x2'))(_0x87fc('0x3'));var moment=require('moment');var BPromise=require(_0x87fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x87fc('0x5'));var config=require(_0x87fc('0x6'));var attributes=require(_0x87fc('0x7'));module[_0x87fc('0x8')]=function(_0x195d25,_0x449be4){return _0x195d25[_0x87fc('0x9')](_0x87fc('0xa'),attributes,{'tableName':_0x87fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 33dc5bc..fa3cd79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eb2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x163596,_0x513b53){var _0x2c4bfd=function(_0xc68cb5){while(--_0xc68cb5){_0x163596['push'](_0x163596['shift']());}};_0x2c4bfd(++_0x513b53);}(_0x4eb2,0xe4));var _0x24eb=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4eb2[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x24eb('0x0'));var util=require(_0x24eb('0x1'));var moment=require(_0x24eb('0x2'));var BPromise=require('bluebird');var rs=require(_0x24eb('0x3'));var fs=require('fs');var Redis=require(_0x24eb('0x4'));var db=require(_0x24eb('0x5'))['db'];var utils=require(_0x24eb('0x6'));var logger=require(_0x24eb('0x7'))(_0x24eb('0x8'));var config=require(_0x24eb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x24eb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd72ba7,_0x37ab74,_0x1801dd){return new BPromise(function(_0x1a1438,_0x5829d4){return client[_0x24eb('0xb')](_0xd72ba7,_0x1801dd)[_0x24eb('0xc')](function(_0x1d29e6){logger['info'](_0x24eb('0xd'),_0x37ab74,_0x24eb('0xe'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x37ab74,_0x24eb('0xe'),JSON['stringify'](_0x1d29e6));if(_0x1d29e6[_0x24eb('0xf')]){if(_0x1d29e6[_0x24eb('0xf')][_0x24eb('0x10')]===0x1f4){logger[_0x24eb('0xf')](_0x24eb('0xd'),_0x37ab74,_0x1d29e6['error'][_0x24eb('0x11')]);return _0x5829d4(_0x1d29e6[_0x24eb('0xf')]['message']);}logger[_0x24eb('0xf')](_0x24eb('0xd'),_0x37ab74,_0x1d29e6[_0x24eb('0xf')][_0x24eb('0x11')]);return _0x1a1438(_0x1d29e6[_0x24eb('0xf')][_0x24eb('0x11')]);}else{logger[_0x24eb('0x12')](_0x24eb('0xd'),_0x37ab74,_0x24eb('0xe'));_0x1a1438(_0x1d29e6[_0x24eb('0x13')][_0x24eb('0x11')]);}})[_0x24eb('0x14')](function(_0x1d4cd1){logger[_0x24eb('0xf')](_0x24eb('0xd'),_0x37ab74,_0x1d4cd1);_0x5829d4(_0x1d4cd1);});});}
\ No newline at end of file
+var _0x5300=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x4f8184,_0x5b6b51){var _0xbd0150=function(_0x311117){while(--_0x311117){_0x4f8184['push'](_0x4f8184['shift']());}};_0xbd0150(++_0x5b6b51);}(_0x5300,0x94));var _0x0530=function(_0x45a767,_0x11eb1e){_0x45a767=_0x45a767-0x0;var _0x457884=_0x5300[_0x45a767];return _0x457884;};'use strict';var _=require(_0x0530('0x0'));var util=require(_0x0530('0x1'));var moment=require(_0x0530('0x2'));var BPromise=require(_0x0530('0x3'));var rs=require(_0x0530('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0530('0x5'))['db'];var utils=require(_0x0530('0x6'));var logger=require(_0x0530('0x7'))(_0x0530('0x8'));var config=require(_0x0530('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0530('0xa')][_0x0530('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x140c2,_0x5b1420,_0x166f46){return new BPromise(function(_0x79263e,_0x35114c){return client[_0x0530('0xc')](_0x140c2,_0x166f46)['then'](function(_0x2200b7){logger['info'](_0x0530('0xd'),_0x5b1420,_0x0530('0xe'));logger[_0x0530('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x5b1420,_0x0530('0xe'),JSON[_0x0530('0x10')](_0x2200b7));if(_0x2200b7[_0x0530('0x11')]){if(_0x2200b7[_0x0530('0x11')]['code']===0x1f4){logger[_0x0530('0x11')](_0x0530('0xd'),_0x5b1420,_0x2200b7[_0x0530('0x11')][_0x0530('0x12')]);return _0x35114c(_0x2200b7[_0x0530('0x11')]['message']);}logger[_0x0530('0x11')](_0x0530('0xd'),_0x5b1420,_0x2200b7[_0x0530('0x11')]['message']);return _0x79263e(_0x2200b7[_0x0530('0x11')][_0x0530('0x12')]);}else{logger[_0x0530('0x13')](_0x0530('0xd'),_0x5b1420,_0x0530('0xe'));_0x79263e(_0x2200b7['result'][_0x0530('0x12')]);}})[_0x0530('0x14')](function(_0x57a87c){logger[_0x0530('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x5b1420,_0x57a87c);_0x35114c(_0x57a87c);});});}
\ No newline at end of file
index 0f1f89f..2ee0bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x4e8b2b,_0x1126de){var _0x31de8a=function(_0x5f440a){while(--_0x5f440a){_0x4e8b2b['push'](_0x4e8b2b['shift']());}};_0x31de8a(++_0x1126de);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x14cb58,_0x214d62){_0x14cb58=_0x14cb58-0x0;var _0x5f097e=_0xfdbd[_0x14cb58];return _0x5f097e;};'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'](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xdfdb('0xc')]);router[_0xdfdb('0xd')]('/:id',auth[_0xdfdb('0xb')](),controller[_0xdfdb('0xe')]);router[_0xdfdb('0xf')](_0xdfdb('0xa'),auth[_0xdfdb('0xb')](),controller[_0xdfdb('0x10')]);module[_0xdfdb('0x11')]=router;
\ No newline at end of file
+var _0x7dfd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x12ba0e,_0x3174b8){var _0xe5d460=function(_0x743b2c){while(--_0x743b2c){_0x12ba0e['push'](_0x12ba0e['shift']());}};_0xe5d460(++_0x3174b8);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var fs_extra=require(_0xd7df('0x6'));var auth=require(_0xd7df('0x7'));var interaction=require(_0xd7df('0x8'));var config=require(_0xd7df('0x9'));var controller=require(_0xd7df('0xa'));router[_0xd7df('0xb')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0xe')]);router[_0xd7df('0xf')]('/',auth[_0xd7df('0xd')](),controller['create']);router[_0xd7df('0x10')](_0xd7df('0xc'),auth[_0xd7df('0xd')](),controller[_0xd7df('0x11')]);router['delete'](_0xd7df('0xc'),auth['isAuthenticated'](),controller[_0xd7df('0x12')]);module['exports']=router;
\ No newline at end of file
index e94aefe..35d9bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5380=['INTEGER','ENUM','beepall','roundrobin','exports','STRING'];(function(_0x848c55,_0x269495){var _0x4d7ad9=function(_0x139190){while(--_0x139190){_0x848c55['push'](_0x848c55['shift']());}};_0x4d7ad9(++_0x269495);}(_0x5380,0x148));var _0x0538=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5380[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x0538('0x0')]={'name':{'type':Sequelize[_0x0538('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0538('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0538('0x3')]('rrmemory',_0x0538('0x4'),_0x0538('0x5'))}};
\ No newline at end of file
+var _0xecae=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x3e79fb,_0x50655c){var _0x9e738c=function(_0x1da1cb){while(--_0x1da1cb){_0x3e79fb['push'](_0x3e79fb['shift']());}};_0x9e738c(++_0x50655c);}(_0xecae,0xd2));var _0xeeca=function(_0x32bafe,_0x18e4da){_0x32bafe=_0x32bafe-0x0;var _0x3e35c7=_0xecae[_0x32bafe];return _0x3e35c7;};'use strict';var Sequelize=require(_0xeeca('0x0'));module[_0xeeca('0x1')]={'name':{'type':Sequelize[_0xeeca('0x2')],'unique':_0xeeca('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeeca('0x2')]},'timeout':{'type':Sequelize[_0xeeca('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeeca('0x5')](_0xeeca('0x6'),_0xeeca('0x7'),_0xeeca('0x8'))}};
\ No newline at end of file
index bd57662..2ee52ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5117=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','hasOwnProperty','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./chatQueue.socket','register','jayson/promise','client','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','then','sendStatus','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','rows','show','params','keys','length','includeAll','include','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','findOne','UserChatQueue','ChatQueueId','findAll','User','findAndCountAll','agent','updatedAt','%s/%s','SIP','chatPause','createdAt','getTeams','Team','addTeams','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from'];(function(_0x36a616,_0x2fc36f){var _0x261241=function(_0x5ba5dc){while(--_0x5ba5dc){_0x36a616['push'](_0x36a616['shift']());}};_0x261241(++_0x2fc36f);}(_0x5117,0xb2));var _0x7511=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0x5117[_0x509273];return _0x38ef40;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7511('0x0'));var zipdir=require(_0x7511('0x1'));var jsonpatch=require(_0x7511('0x2'));var rp=require('request-promise');var moment=require(_0x7511('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7511('0x4'));var util=require(_0x7511('0x5'));var path=require(_0x7511('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7511('0x7'));var fs=require('fs');var fs_extra=require(_0x7511('0x8'));var _=require(_0x7511('0x9'));var squel=require('squel');var crypto=require(_0x7511('0xa'));var jsforce=require(_0x7511('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7511('0xc'));var querystring=require(_0x7511('0xd'));var Papa=require(_0x7511('0xe'));var Redis=require(_0x7511('0xf'));var authService=require(_0x7511('0x10'));var qs=require(_0x7511('0x11'));var as=require(_0x7511('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7511('0x13'))(_0x7511('0x14'));var utils=require(_0x7511('0x15'));var config=require(_0x7511('0x16'));var licenseUtil=require(_0x7511('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7511('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7511('0x19')]));require(_0x7511('0x1a'))[_0x7511('0x1b')](socket);var jayson=require(_0x7511('0x1c'));var client=jayson[_0x7511('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40cc4b,_0x148e78,_0x2fa0d8,_0x22b583){return new BPromise(function(_0xd963ca,_0x1fcef2){var _0x2b3aa4=_0x22b583||client;return _0x2b3aa4[_0x7511('0x1e')](_0x40cc4b,_0x2fa0d8)['then'](function(_0x585652){logger['info'](_0x7511('0x1f'),_0x148e78,_0x7511('0x20'));logger[_0x7511('0x21')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x148e78,'request\x20sent',JSON[_0x7511('0x22')](_0x585652));if(_0x585652[_0x7511('0x23')]){if(_0x585652[_0x7511('0x23')][_0x7511('0x24')]===0x1f4){logger[_0x7511('0x23')](_0x7511('0x1f'),_0x148e78,_0x585652['error'][_0x7511('0x25')]);return _0x1fcef2(_0x585652['error']['message']);}logger[_0x7511('0x23')]('ChatQueue,\x20%s,\x20%s',_0x148e78,_0x585652[_0x7511('0x23')][_0x7511('0x25')]);return _0xd963ca(_0x585652[_0x7511('0x23')][_0x7511('0x25')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x148e78,_0x7511('0x20'));_0xd963ca(_0x585652[_0x7511('0x26')][_0x7511('0x25')]);}})[_0x7511('0x27')](function(_0x2fbc4e){logger[_0x7511('0x23')]('ChatQueue,\x20%s,\x20%s',_0x148e78,_0x2fbc4e);_0x1fcef2(_0x2fbc4e);});});}function respondWithStatusCode(_0x474913,_0x49e1f0){_0x49e1f0=_0x49e1f0||0xcc;return function(_0x8e6ef9){if(_0x8e6ef9){return _0x474913['sendStatus'](_0x49e1f0);}return _0x474913[_0x7511('0x28')](_0x49e1f0)[_0x7511('0x29')]();};}function respondWithResult(_0x189ec2,_0xe813fc){_0xe813fc=_0xe813fc||0xc8;return function(_0xd1ba91){if(_0xd1ba91){return _0x189ec2['status'](_0xe813fc)['json'](_0xd1ba91);}};}function respondWithFilteredResult(_0x46a98d,_0x4414ea){return function(_0x38aca2){if(_0x38aca2){var _0x5a4dae=typeof _0x4414ea[_0x7511('0x2a')]==='undefined'&&typeof _0x4414ea[_0x7511('0x2b')]==='undefined';var _0x435b8f=_0x38aca2['count'];var _0x3a1053=_0x5a4dae?0x0:_0x4414ea[_0x7511('0x2a')];var _0x760b48=_0x5a4dae?_0x38aca2['count']:_0x4414ea[_0x7511('0x2a')]+_0x4414ea[_0x7511('0x2b')];var _0x13ed8;if(_0x760b48>=_0x435b8f){_0x760b48=_0x435b8f;_0x13ed8=0xc8;}else{_0x13ed8=0xce;}_0x46a98d[_0x7511('0x28')](_0x13ed8);return _0x46a98d[_0x7511('0x2c')](_0x7511('0x2d'),_0x3a1053+'-'+_0x760b48+'/'+_0x435b8f)[_0x7511('0x2e')](_0x38aca2);}return null;};}function patchUpdates(_0x9e4967){return function(_0x130bfd){try{jsonpatch[_0x7511('0x2f')](_0x130bfd,_0x9e4967,!![]);}catch(_0x1ad464){return BPromise[_0x7511('0x30')](_0x1ad464);}return _0x130bfd[_0x7511('0x31')]();};}function saveUpdates(_0x2f7d01,_0x43a236){return function(_0x148619){if(_0x148619){return _0x148619[_0x7511('0x32')](_0x2f7d01)['then'](function(_0x2e1000){return _0x2e1000;});}return null;};}function removeEntity(_0x5420e3,_0x3ba8ba){return function(_0x166eb5){if(_0x166eb5){return _0x166eb5[_0x7511('0x33')]()['then'](function(){var _0x33ff63=_0x166eb5[_0x7511('0x34')]({'plain':!![]});var _0xce3664=_0x7511('0x35');return db[_0x7511('0x36')][_0x7511('0x33')]({'where':{'type':_0xce3664,'resourceId':_0x33ff63['id']}})['then'](function(){return _0x166eb5;});})[_0x7511('0x37')](function(){_0x5420e3['status'](0xcc)[_0x7511('0x29')]();});}};}function handleEntityNotFound(_0x24cac3,_0x10239a){return function(_0x481083){if(!_0x481083){_0x24cac3[_0x7511('0x38')](0x194);}return _0x481083;};}function handleError(_0x247011,_0x1a3222){_0x1a3222=_0x1a3222||0x1f4;return function(_0x2fae03){logger[_0x7511('0x23')](_0x2fae03[_0x7511('0x39')]);if(_0x2fae03[_0x7511('0x3a')]){delete _0x2fae03['name'];}_0x247011[_0x7511('0x28')](_0x1a3222)[_0x7511('0x3b')](_0x2fae03);};}exports[_0x7511('0x3c')]=function(_0x5d9f8d,_0x1d45ed){var _0x194a1c={},_0x52bc14={},_0x568d05={'count':0x0,'rows':[]};var _0x5f3683=_[_0x7511('0x3d')](db[_0x7511('0x3e')][_0x7511('0x3f')],function(_0x49e77b){return{'name':_0x49e77b[_0x7511('0x40')],'type':_0x49e77b['type']['key']};});_0x52bc14[_0x7511('0x41')]=_['map'](_0x5f3683,_0x7511('0x3a'));_0x52bc14['query']=_['keys'](_0x5d9f8d[_0x7511('0x42')]);_0x52bc14['filters']=_[_0x7511('0x43')](_0x52bc14[_0x7511('0x41')],_0x52bc14['query']);_0x194a1c['attributes']=_[_0x7511('0x43')](_0x52bc14['model'],qs[_0x7511('0x44')](_0x5d9f8d[_0x7511('0x42')][_0x7511('0x44')]));_0x194a1c[_0x7511('0x45')]=_0x194a1c[_0x7511('0x45')]['length']?_0x194a1c[_0x7511('0x45')]:_0x52bc14['model'];if(!_0x5d9f8d[_0x7511('0x42')]['hasOwnProperty'](_0x7511('0x46'))){_0x194a1c['limit']=qs[_0x7511('0x2b')](_0x5d9f8d[_0x7511('0x42')][_0x7511('0x2b')]);_0x194a1c[_0x7511('0x2a')]=qs[_0x7511('0x2a')](_0x5d9f8d[_0x7511('0x42')][_0x7511('0x2a')]);}_0x194a1c[_0x7511('0x47')]=qs['sort'](_0x5d9f8d[_0x7511('0x42')][_0x7511('0x48')]);_0x194a1c[_0x7511('0x49')]=qs[_0x7511('0x4a')](_[_0x7511('0x4b')](_0x5d9f8d['query'],_0x52bc14[_0x7511('0x4a')]),_0x5f3683);if(_0x5d9f8d[_0x7511('0x42')][_0x7511('0x4c')]){_0x194a1c[_0x7511('0x49')]=_[_0x7511('0x4d')](_0x194a1c[_0x7511('0x49')],{'$or':_[_0x7511('0x3d')](_0x5f3683,function(_0x11eba2){if(_0x11eba2[_0x7511('0x4e')]!==_0x7511('0x4f')){var _0x4177c7={};_0x4177c7[_0x11eba2[_0x7511('0x3a')]]={'$like':'%'+_0x5d9f8d['query'][_0x7511('0x4c')]+'%'};return _0x4177c7;}})});}_0x194a1c=_[_0x7511('0x4d')]({},_0x194a1c,_0x5d9f8d[_0x7511('0x50')]);var _0xa1d188={'where':_0x194a1c['where']};return db['ChatQueue']['count'](_0xa1d188)[_0x7511('0x37')](function(_0x6db2f4){_0x568d05[_0x7511('0x51')]=_0x6db2f4;if(_0x5d9f8d[_0x7511('0x42')]['includeAll']){_0x194a1c['include']=[{'all':!![]}];}return db[_0x7511('0x3e')]['findAll'](_0x194a1c);})[_0x7511('0x37')](function(_0x3fd2dc){_0x568d05[_0x7511('0x52')]=_0x3fd2dc;return _0x568d05;})['then'](respondWithFilteredResult(_0x1d45ed,_0x194a1c))[_0x7511('0x27')](handleError(_0x1d45ed,null));};exports[_0x7511('0x53')]=function(_0x53dea0,_0x3a351d){var _0x35a682={'raw':!![],'where':{'id':_0x53dea0[_0x7511('0x54')]['id']}},_0x2243ff={};_0x2243ff[_0x7511('0x41')]=_[_0x7511('0x55')](db[_0x7511('0x3e')]['rawAttributes']);_0x2243ff[_0x7511('0x42')]=_[_0x7511('0x55')](_0x53dea0[_0x7511('0x42')]);_0x2243ff['filters']=_[_0x7511('0x43')](_0x2243ff[_0x7511('0x41')],_0x2243ff['query']);_0x35a682[_0x7511('0x45')]=_[_0x7511('0x43')](_0x2243ff['model'],qs[_0x7511('0x44')](_0x53dea0['query']['fields']));_0x35a682['attributes']=_0x35a682[_0x7511('0x45')][_0x7511('0x56')]?_0x35a682[_0x7511('0x45')]:_0x2243ff[_0x7511('0x41')];if(_0x53dea0[_0x7511('0x42')][_0x7511('0x57')]){_0x35a682[_0x7511('0x58')]=[{'all':!![]}];}_0x35a682=_[_0x7511('0x4d')]({},_0x35a682,_0x53dea0[_0x7511('0x50')]);return db[_0x7511('0x3e')][_0x7511('0x59')](_0x35a682)['then'](handleEntityNotFound(_0x3a351d,null))[_0x7511('0x37')](respondWithResult(_0x3a351d,null))['catch'](handleError(_0x3a351d,null));};exports['create']=function(_0x4b71fd,_0xd99fca){return db[_0x7511('0x3e')][_0x7511('0x5a')](_0x4b71fd[_0x7511('0x5b')],{})['then'](function(_0x359c50){var _0x5613f0=_0x4b71fd[_0x7511('0x5c')][_0x7511('0x34')]({'plain':!![]});if(!_0x5613f0)throw new Error(_0x7511('0x5d'));if(_0x5613f0['role']==='user'){var _0x3467c3=_0x359c50[_0x7511('0x34')]({'plain':!![]});var _0x58fb23='ChatQueues';return db['UserProfileSection'][_0x7511('0x59')]({'where':{'name':_0x58fb23,'userProfileId':_0x5613f0[_0x7511('0x5e')]},'raw':!![]})[_0x7511('0x37')](function(_0x401c6e){if(_0x401c6e&&_0x401c6e[_0x7511('0x5f')]===0x0){return db[_0x7511('0x36')]['create']({'name':_0x3467c3[_0x7511('0x3a')],'resourceId':_0x3467c3['id'],'type':_0x401c6e[_0x7511('0x3a')],'sectionId':_0x401c6e['id']},{})['then'](function(){return _0x359c50;});}else{return _0x359c50;}})[_0x7511('0x27')](function(_0x399d47){logger[_0x7511('0x23')](_0x7511('0x60'),_0x399d47);throw _0x399d47;});}return _0x359c50;})[_0x7511('0x37')](respondWithResult(_0xd99fca,0xc9))[_0x7511('0x27')](handleError(_0xd99fca,null));};exports['update']=function(_0xbb3a74,_0x5c2877){if(_0xbb3a74[_0x7511('0x5b')]['id']){delete _0xbb3a74[_0x7511('0x5b')]['id'];}return db[_0x7511('0x3e')]['find']({'where':{'id':_0xbb3a74[_0x7511('0x54')]['id']}})[_0x7511('0x37')](handleEntityNotFound(_0x5c2877,null))[_0x7511('0x37')](saveUpdates(_0xbb3a74[_0x7511('0x5b')],null))[_0x7511('0x37')](respondWithResult(_0x5c2877,null))[_0x7511('0x27')](handleError(_0x5c2877,null));};exports['destroy']=function(_0x108586,_0x17c5aa){return db[_0x7511('0x3e')][_0x7511('0x59')]({'where':{'id':_0x108586[_0x7511('0x54')]['id']}})['then'](handleEntityNotFound(_0x17c5aa,null))['then'](removeEntity(_0x17c5aa,null))[_0x7511('0x27')](handleError(_0x17c5aa,null));};exports[_0x7511('0x61')]=function(_0x4dc692,_0x31e303){return db[_0x7511('0x3e')][_0x7511('0x61')]()[_0x7511('0x37')](respondWithResult(_0x31e303,null))[_0x7511('0x27')](handleError(_0x31e303,null));};exports[_0x7511('0x62')]=function(_0x40e0c9,_0x50f08d,_0x143fb6){var _0x25326d={'raw':!![],'where':{}},_0xa5223f={},_0x117293;return db['ChatQueue'][_0x7511('0x63')]({'where':{'id':_0x40e0c9[_0x7511('0x54')]['id']}})[_0x7511('0x37')](handleEntityNotFound(_0x50f08d,null))['then'](function(_0x480de0){if(_0x480de0){_0x117293=_0x480de0[_0x7511('0x34')]({'plain':!![]});_0xa5223f[_0x7511('0x41')]=_[_0x7511('0x55')](db[_0x7511('0x64')]['rawAttributes']);_0xa5223f[_0x7511('0x42')]=_['keys'](_0x40e0c9['query']);_0xa5223f[_0x7511('0x4a')]=_[_0x7511('0x43')](_0xa5223f[_0x7511('0x41')],_0xa5223f['query']);_0x25326d[_0x7511('0x45')]=_[_0x7511('0x43')](_0xa5223f['model'],qs[_0x7511('0x44')](_0x40e0c9['query']['fields']));_0x25326d[_0x7511('0x45')]=_0x25326d[_0x7511('0x45')][_0x7511('0x56')]?_0x25326d[_0x7511('0x45')]:_0xa5223f[_0x7511('0x41')];if(!_0x40e0c9[_0x7511('0x42')]['hasOwnProperty'](_0x7511('0x46'))){_0x25326d['limit']=qs[_0x7511('0x2b')](_0x40e0c9[_0x7511('0x42')][_0x7511('0x2b')]);_0x25326d[_0x7511('0x2a')]=qs[_0x7511('0x2a')](_0x40e0c9[_0x7511('0x42')][_0x7511('0x2a')]);}_0x25326d[_0x7511('0x47')]=qs[_0x7511('0x48')](_0x40e0c9[_0x7511('0x42')]['sort']);_0x25326d[_0x7511('0x49')]=qs['filters'](_['pick'](_0x40e0c9[_0x7511('0x42')],_0xa5223f[_0x7511('0x4a')]));_0x25326d['where'][_0x7511('0x65')]=_0x480de0['id'];if(_0x40e0c9[_0x7511('0x42')]['filter']){_0x25326d['where']=_[_0x7511('0x4d')](_0x25326d['where'],{'$or':_[_0x7511('0x3d')](_0x25326d[_0x7511('0x45')],function(_0x3db7ac){var _0x38230b={};_0x38230b[_0x3db7ac]={'$like':'%'+_0x40e0c9[_0x7511('0x42')][_0x7511('0x4c')]+'%'};return _0x38230b;})});}_0x25326d=_[_0x7511('0x4d')]({},_0x25326d,_0x40e0c9[_0x7511('0x50')]);return db[_0x7511('0x64')][_0x7511('0x66')](_0x25326d);}})['then'](function(_0x357886){if(_0x357886){return db[_0x7511('0x67')][_0x7511('0x68')]({'where':{'id':_[_0x7511('0x3d')](_0x357886,'UserId'),'role':_0x7511('0x69')},'attributes':['id',_0x7511('0x3a'),'chatPause',_0x7511('0x6a'),'createdAt']});}})['then'](function(_0x4e0ee4){if(_0x4e0ee4){return{'count':_0x4e0ee4[_0x7511('0x51')],'rows':_['map'](_0x4e0ee4['rows'],function(_0x1d74dc){return{'membername':_0x1d74dc[_0x7511('0x3a')],'UserId':_0x1d74dc['id'],'queue_name':_0x117293[_0x7511('0x3a')],'ChatQueueId':_0x117293['id'],'interface':util['format'](_0x7511('0x6b'),_0x7511('0x6c'),_0x1d74dc[_0x7511('0x3a')]),'penalty':0x0,'paused':_0x1d74dc[_0x7511('0x6d')],'createdAt':_0x1d74dc[_0x7511('0x6e')],'updatedAt':_0x1d74dc[_0x7511('0x6a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x50f08d,_0x25326d))[_0x7511('0x27')](handleError(_0x50f08d,null));};exports[_0x7511('0x6f')]=function(_0x405eb1,_0xbfd7f8,_0x1db159){var _0x281531={};var _0x3b7e0a={};var _0x4958b1;var _0x24ff29;return db[_0x7511('0x3e')][_0x7511('0x63')]({'where':{'id':_0x405eb1[_0x7511('0x54')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x7511('0x37')](function(_0x5bd8b1){if(_0x5bd8b1){_0x4958b1=_0x5bd8b1;_0x3b7e0a[_0x7511('0x41')]=_[_0x7511('0x55')](db[_0x7511('0x70')][_0x7511('0x3f')]);_0x3b7e0a[_0x7511('0x42')]=_[_0x7511('0x55')](_0x405eb1[_0x7511('0x42')]);_0x3b7e0a[_0x7511('0x4a')]=_['intersection'](_0x3b7e0a[_0x7511('0x41')],_0x3b7e0a[_0x7511('0x42')]);_0x281531[_0x7511('0x45')]=_[_0x7511('0x43')](_0x3b7e0a[_0x7511('0x41')],qs[_0x7511('0x44')](_0x405eb1[_0x7511('0x42')][_0x7511('0x44')]));_0x281531[_0x7511('0x45')]=_0x281531[_0x7511('0x45')][_0x7511('0x56')]?_0x281531[_0x7511('0x45')]:_0x3b7e0a[_0x7511('0x41')];_0x281531['order']=qs['sort'](_0x405eb1['query']['sort']);_0x281531[_0x7511('0x49')]=qs[_0x7511('0x4a')](_[_0x7511('0x4b')](_0x405eb1[_0x7511('0x42')],_0x3b7e0a[_0x7511('0x4a')]));if(_0x405eb1['query'][_0x7511('0x4c')]){_0x281531['where']=_['merge'](_0x281531['where'],{'$or':_[_0x7511('0x3d')](_0x281531[_0x7511('0x45')],function(_0x334fee){var _0x38fdf6={};_0x38fdf6[_0x334fee]={'$like':'%'+_0x405eb1[_0x7511('0x42')][_0x7511('0x4c')]+'%'};return _0x38fdf6;})});}_0x281531=_['merge']({},_0x281531,_0x405eb1[_0x7511('0x50')]);return _0x4958b1[_0x7511('0x6f')](_0x281531);}})[_0x7511('0x37')](function(_0x177c2d){if(_0x177c2d){_0x24ff29=_0x177c2d[_0x7511('0x56')];if(!_0x405eb1['query']['hasOwnProperty'](_0x7511('0x46'))){_0x281531[_0x7511('0x2b')]=qs[_0x7511('0x2b')](_0x405eb1['query'][_0x7511('0x2b')]);_0x281531[_0x7511('0x2a')]=qs['offset'](_0x405eb1[_0x7511('0x42')][_0x7511('0x2a')]);}return _0x4958b1[_0x7511('0x6f')](_0x281531);}})['then'](function(_0x520c61){if(_0x520c61){return _0x520c61?{'count':_0x24ff29,'rows':_0x520c61}:null;}})['then'](respondWithResult(_0xbfd7f8,null))[_0x7511('0x27')](handleError(_0xbfd7f8,null));};exports[_0x7511('0x71')]=function(_0x4e15f0,_0x581b89,_0x594872){var _0x1b5416=_0x4e15f0[_0x7511('0x5b')]['ids'];return db[_0x7511('0x70')][_0x7511('0x66')]({'where':{'id':_0x1b5416},'attributes':['id'],'include':[{'model':db[_0x7511('0x67')],'as':_0x7511('0x72'),'attributes':['id',_0x7511('0x3a'),'online',_0x7511('0x73'),_0x7511('0x74')],'raw':!![]}]})[_0x7511('0x37')](function(_0x3732fb){if(_0x3732fb){var _0x403bb6=_[_0x7511('0x75')](_0x3732fb,function(_0xe3d029){var _0x2bef8b=_0xe3d029[_0x7511('0x34')]({'plain':!![]});return _0x2bef8b[_0x7511('0x72')];});return db[_0x7511('0x3e')][_0x7511('0x59')]({'where':{'id':_0x4e15f0['params']['id']}})[_0x7511('0x37')](function(_0x42f3f8){return db[_0x7511('0x76')][_0x7511('0x77')](function(_0xc9a3d0){return _0x42f3f8['addTeams'](_0x1b5416,{'transaction':_0xc9a3d0})[_0x7511('0x37')](function(){return BPromise[_0x7511('0x78')](_0x403bb6,function(_0x19f97e){return db[_0x7511('0x64')]['findOrCreate']({'where':{'UserId':_0x19f97e['id'],'ChatQueueId':_0x4e15f0['params']['id']},'transaction':_0xc9a3d0});});})[_0x7511('0x37')](function(){_0x403bb6[_0x7511('0x79')](function(_0x51abc9){socket[_0x7511('0x7a')](_0x7511('0x7b'),{'UserId':_0x51abc9['id'],'ChatQueueId':_0x42f3f8['id']});});});});});}})[_0x7511('0x37')](respondWithStatusCode(_0x581b89,null))[_0x7511('0x27')](handleError(_0x581b89,null));};exports[_0x7511('0x7c')]=function(_0x3e264b,_0x8d1e43,_0x47e7d7){return db[_0x7511('0x70')][_0x7511('0x66')]({'where':{'id':_0x3e264b[_0x7511('0x42')][_0x7511('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x7511('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7511('0x37')](handleEntityNotFound(_0x8d1e43,null))[_0x7511('0x37')](function(_0x203f23){var _0x247260=_[_0x7511('0x3d')](_0x203f23,'id');var _0x28d37a=[];var _0x37f26e=[];var _0x187569=squel[_0x7511('0x7e')]();_0x187569[_0x7511('0x7f')](_0x7511('0x80'))[_0x7511('0x81')]('team_has_chat_queues','tq')[_0x7511('0x82')](_0x7511('0x83'),'ut',_0x7511('0x84'))[_0x7511('0x49')](_0x7511('0x85'),_0x3e264b[_0x7511('0x54')]['id']);for(var _0x34bff0=0x0;_0x34bff0<_0x203f23[_0x7511('0x56')];_0x34bff0+=0x1){let _0x4b3d58=_0x203f23[_0x34bff0];for(var _0x4cc3e3=0x0;_0x4cc3e3<_0x4b3d58[_0x7511('0x72')]['length'];_0x4cc3e3+=0x1){let _0x18c9b6=_0x4b3d58[_0x7511('0x72')][_0x4cc3e3];var _0x482b65=_0x187569[_0x7511('0x86')]();_0x482b65[_0x7511('0x49')](_0x7511('0x87'),_0x18c9b6['id']);_0x37f26e[_0x7511('0x88')](db[_0x7511('0x76')]['query'](_0x482b65[_0x7511('0x89')](),{'type':db[_0x7511('0x76')][_0x7511('0x8a')][_0x7511('0x8b')]})[_0x7511('0x37')](function(_0x1e6112){if(_0x1e6112[_0x7511('0x56')]===0x1){return _0x18c9b6['id'];}else{var _0x1d7332=_['every'](_[_0x7511('0x3d')](_0x1e6112,_0x7511('0x8c')),function(_0x20ec52){return _[_0x7511('0x8d')](_0x247260,_0x20ec52);});if(_0x1d7332){return _0x18c9b6['id'];}}}));}}return BPromise[_0x7511('0x8e')](_0x37f26e)[_0x7511('0x37')](function(_0x1b207e){_0x28d37a=_(_0x28d37a)[_0x7511('0x8f')](_0x1b207e)[_0x7511('0x90')]()[_0x7511('0x91')]();return db[_0x7511('0x3e')][_0x7511('0x59')]({'where':{'id':_0x3e264b[_0x7511('0x54')]['id']}})[_0x7511('0x37')](function(_0x5a6b1e){return db[_0x7511('0x76')][_0x7511('0x77')](function(_0x16d059){return _0x5a6b1e[_0x7511('0x7c')](_0x3e264b['query'][_0x7511('0x7d')],{'transaction':_0x16d059})['then'](function(){if(!_['isEmpty'](_0x28d37a)){return _0x5a6b1e['removeAgents'](_0x28d37a,{'transaction':_0x16d059});}})['then'](function(){_0x28d37a[_0x7511('0x79')](function(_0x12ca35){socket['emit'](_0x7511('0x92'),{'UserId':_0x12ca35,'ChatQueueId':_0x5a6b1e['id']});});});});});});})[_0x7511('0x37')](respondWithStatusCode(_0x8d1e43,null))[_0x7511('0x27')](handleError(_0x8d1e43,null));};exports[_0x7511('0x93')]=function(_0x5a7b24,_0x54efe4,_0x4b15ad){return db[_0x7511('0x3e')][_0x7511('0x59')]({'where':{'id':_0x5a7b24[_0x7511('0x54')]['id']}})[_0x7511('0x37')](handleEntityNotFound(_0x54efe4,null))[_0x7511('0x37')](function(_0x1844e3){if(_0x1844e3){return _0x1844e3['addAgents'](_0x5a7b24[_0x7511('0x5b')]['ids'],_[_0x7511('0x94')](_0x5a7b24[_0x7511('0x5b')],[_0x7511('0x7d'),'id'])||{})[_0x7511('0x95')](function(_0x30dd34){for(var _0x450103=0x0;_0x450103<_0x5a7b24[_0x7511('0x5b')][_0x7511('0x7d')]['length'];_0x450103+=0x1){socket[_0x7511('0x7a')]('userChatQueue:save',{'UserId':Number(_0x5a7b24['body'][_0x7511('0x7d')][_0x450103]),'ChatQueueId':Number(_0x5a7b24[_0x7511('0x54')]['id'])});}return _0x30dd34;});}})[_0x7511('0x37')](respondWithResult(_0x54efe4,null))['catch'](handleError(_0x54efe4,null));};exports[_0x7511('0x96')]=function(_0x59a09c,_0x3c9c7a,_0x296829){return db[_0x7511('0x3e')][_0x7511('0x59')]({'where':{'id':_0x59a09c['params']['id']}})[_0x7511('0x37')](handleEntityNotFound(_0x3c9c7a,null))[_0x7511('0x37')](function(_0x3a20f4){if(_0x3a20f4){return _0x3a20f4[_0x7511('0x96')](_0x59a09c['query'][_0x7511('0x7d')])[_0x7511('0x37')](function(){if(_[_0x7511('0x97')](_0x59a09c[_0x7511('0x42')]['ids'])){for(var _0x45c8f5=0x0;_0x45c8f5<_0x59a09c[_0x7511('0x42')]['ids'][_0x7511('0x56')];_0x45c8f5+=0x1){socket[_0x7511('0x7a')](_0x7511('0x92'),{'UserId':Number(_0x59a09c[_0x7511('0x42')]['ids'][_0x45c8f5]),'ChatQueueId':Number(_0x59a09c[_0x7511('0x54')]['id'])});}}else{socket[_0x7511('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x59a09c[_0x7511('0x42')][_0x7511('0x7d')]),'ChatQueueId':Number(_0x59a09c[_0x7511('0x54')]['id'])});}});}})[_0x7511('0x37')](respondWithStatusCode(_0x3c9c7a,null))[_0x7511('0x27')](handleError(_0x3c9c7a,null));};exports[_0x7511('0x98')]=function(_0x2771c4,_0x3eb8d2,_0x9bb224){var _0x4921e6={};var _0x170580={};var _0x4974a3;var _0x174a7e;return db[_0x7511('0x3e')][_0x7511('0x63')]({'where':{'id':_0x2771c4[_0x7511('0x54')]['id']}})['then'](handleEntityNotFound(_0x3eb8d2,null))[_0x7511('0x37')](function(_0x14e6dc){if(_0x14e6dc){_0x4974a3=_0x14e6dc;_0x170580[_0x7511('0x41')]=_[_0x7511('0x55')](db['User']['rawAttributes']);_0x170580[_0x7511('0x42')]=_[_0x7511('0x55')](_0x2771c4[_0x7511('0x42')]);_0x170580['filters']=_[_0x7511('0x43')](_0x170580[_0x7511('0x41')],_0x170580[_0x7511('0x42')]);_0x4921e6[_0x7511('0x45')]=_[_0x7511('0x43')](_0x170580[_0x7511('0x41')],qs['fields'](_0x2771c4['query'][_0x7511('0x44')]));_0x4921e6['attributes']=_0x4921e6[_0x7511('0x45')][_0x7511('0x56')]?_0x4921e6[_0x7511('0x45')]:_0x170580[_0x7511('0x41')];_0x4921e6[_0x7511('0x47')]=qs['sort'](_0x2771c4[_0x7511('0x42')][_0x7511('0x48')]);_0x4921e6[_0x7511('0x49')]=qs[_0x7511('0x4a')](_[_0x7511('0x4b')](_0x2771c4[_0x7511('0x42')],_0x170580[_0x7511('0x4a')]));if(_0x2771c4['query']['filter']){_0x4921e6[_0x7511('0x49')]=_[_0x7511('0x4d')](_0x4921e6[_0x7511('0x49')],{'$or':_[_0x7511('0x3d')](_0x4921e6[_0x7511('0x45')],function(_0x189289){var _0x32e2a3={};_0x32e2a3[_0x189289]={'$like':'%'+_0x2771c4['query']['filter']+'%'};return _0x32e2a3;})});}_0x4921e6=_['merge']({},_0x4921e6,_0x2771c4[_0x7511('0x50')]);return _0x4974a3[_0x7511('0x98')](_0x4921e6);}})[_0x7511('0x37')](function(_0x4d1d03){if(_0x4d1d03){_0x174a7e=_0x4d1d03[_0x7511('0x56')];if(!_0x2771c4[_0x7511('0x42')][_0x7511('0x99')](_0x7511('0x46'))){_0x4921e6[_0x7511('0x2b')]=qs['limit'](_0x2771c4[_0x7511('0x42')]['limit']);_0x4921e6[_0x7511('0x2a')]=qs[_0x7511('0x2a')](_0x2771c4[_0x7511('0x42')][_0x7511('0x2a')]);}return _0x4974a3['getAgents'](_0x4921e6);}})[_0x7511('0x37')](function(_0x2bb4f7){if(_0x2bb4f7){return _0x2bb4f7?{'count':_0x174a7e,'rows':_0x2bb4f7}:null;}})[_0x7511('0x37')](respondWithResult(_0x3eb8d2,null))['catch'](handleError(_0x3eb8d2,null));};
\ No newline at end of file
+var _0xade3=['findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','join','ChatQueueId\x20=\x20?','clone','toString','SELECT','every','includes','all','compact','isEmpty','addAgents','omit','userChatQueue:save','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','count','includeAll','findAll','rows','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','ChatQueueId','options','UserChatQueue','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','Agents','sequelize','transaction','each'];(function(_0x40e074,_0x5ccda2){var _0x2b091d=function(_0x358067){while(--_0x358067){_0x40e074['push'](_0x40e074['shift']());}};_0x2b091d(++_0x5ccda2);}(_0xade3,0xab));var _0x3ade=function(_0x23ed26,_0x1d2ff4){_0x23ed26=_0x23ed26-0x0;var _0x545502=_0xade3[_0x23ed26];return _0x545502;};'use strict';var emlformat=require(_0x3ade('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ade('0x1'));var jsonpatch=require(_0x3ade('0x2'));var rp=require(_0x3ade('0x3'));var moment=require('moment');var BPromise=require(_0x3ade('0x4'));var Mustache=require(_0x3ade('0x5'));var util=require(_0x3ade('0x6'));var path=require(_0x3ade('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ade('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ade('0x9'));var squel=require(_0x3ade('0xa'));var crypto=require('crypto');var jsforce=require(_0x3ade('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3ade('0xc'));var querystring=require(_0x3ade('0xd'));var Papa=require(_0x3ade('0xe'));var Redis=require(_0x3ade('0xf'));var authService=require(_0x3ade('0x10'));var qs=require(_0x3ade('0x11'));var as=require(_0x3ade('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3ade('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3ade('0x14'))['db'];config[_0x3ade('0x15')]=_[_0x3ade('0x16')](config[_0x3ade('0x15')],{'host':_0x3ade('0x17'),'port':0x18eb});var socket=require(_0x3ade('0x18'))(new Redis(config[_0x3ade('0x15')]));require(_0x3ade('0x19'))[_0x3ade('0x1a')](socket);var jayson=require(_0x3ade('0x1b'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x289acd,_0x404097,_0x452c8c,_0x38da86){return new BPromise(function(_0xdf8df0,_0x30b909){var _0x5e45c7=_0x38da86||client;return _0x5e45c7[_0x3ade('0x1c')](_0x289acd,_0x452c8c)[_0x3ade('0x1d')](function(_0x5e6490){logger[_0x3ade('0x1e')](_0x3ade('0x1f'),_0x404097,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x404097,_0x3ade('0x20'),JSON[_0x3ade('0x21')](_0x5e6490));if(_0x5e6490[_0x3ade('0x22')]){if(_0x5e6490['error'][_0x3ade('0x23')]===0x1f4){logger['error'](_0x3ade('0x1f'),_0x404097,_0x5e6490[_0x3ade('0x22')][_0x3ade('0x24')]);return _0x30b909(_0x5e6490['error']['message']);}logger[_0x3ade('0x22')](_0x3ade('0x1f'),_0x404097,_0x5e6490[_0x3ade('0x22')][_0x3ade('0x24')]);return _0xdf8df0(_0x5e6490[_0x3ade('0x22')][_0x3ade('0x24')]);}else{logger[_0x3ade('0x1e')](_0x3ade('0x1f'),_0x404097,_0x3ade('0x20'));_0xdf8df0(_0x5e6490[_0x3ade('0x25')][_0x3ade('0x24')]);}})[_0x3ade('0x26')](function(_0x3ce1bc){logger[_0x3ade('0x22')]('ChatQueue,\x20%s,\x20%s',_0x404097,_0x3ce1bc);_0x30b909(_0x3ce1bc);});});}function respondWithStatusCode(_0x3e62e9,_0x88e1ba){_0x88e1ba=_0x88e1ba||0xcc;return function(_0xdf4fc8){if(_0xdf4fc8){return _0x3e62e9[_0x3ade('0x27')](_0x88e1ba);}return _0x3e62e9[_0x3ade('0x28')](_0x88e1ba)[_0x3ade('0x29')]();};}function respondWithResult(_0x47457d,_0x3cfd8a){_0x3cfd8a=_0x3cfd8a||0xc8;return function(_0x49943e){if(_0x49943e){return _0x47457d[_0x3ade('0x28')](_0x3cfd8a)['json'](_0x49943e);}};}function respondWithFilteredResult(_0x287ea9,_0x2fe71c){return function(_0x441bdd){if(_0x441bdd){var _0x39a802=typeof _0x2fe71c['offset']===_0x3ade('0x2a')&&typeof _0x2fe71c[_0x3ade('0x2b')]===_0x3ade('0x2a');var _0x98fd25=_0x441bdd['count'];var _0x1869eb=_0x39a802?0x0:_0x2fe71c[_0x3ade('0x2c')];var _0x447f2e=_0x39a802?_0x441bdd['count']:_0x2fe71c[_0x3ade('0x2c')]+_0x2fe71c[_0x3ade('0x2b')];var _0x3efb16;if(_0x447f2e>=_0x98fd25){_0x447f2e=_0x98fd25;_0x3efb16=0xc8;}else{_0x3efb16=0xce;}_0x287ea9[_0x3ade('0x28')](_0x3efb16);return _0x287ea9[_0x3ade('0x2d')](_0x3ade('0x2e'),_0x1869eb+'-'+_0x447f2e+'/'+_0x98fd25)['json'](_0x441bdd);}return null;};}function patchUpdates(_0x4e3707){return function(_0xa725be){try{jsonpatch[_0x3ade('0x2f')](_0xa725be,_0x4e3707,!![]);}catch(_0x22937c){return BPromise[_0x3ade('0x30')](_0x22937c);}return _0xa725be[_0x3ade('0x31')]();};}function saveUpdates(_0x39c965,_0x1a8566){return function(_0x9b0c22){if(_0x9b0c22){return _0x9b0c22[_0x3ade('0x32')](_0x39c965)[_0x3ade('0x1d')](function(_0x68c7d9){return _0x68c7d9;});}return null;};}function removeEntity(_0x1f2f21,_0x5e9304){return function(_0x217221){if(_0x217221){return _0x217221[_0x3ade('0x33')]()[_0x3ade('0x1d')](function(){var _0x3580a7=_0x217221[_0x3ade('0x34')]({'plain':!![]});var _0x4ed91e='ChatQueues';return db[_0x3ade('0x35')]['destroy']({'where':{'type':_0x4ed91e,'resourceId':_0x3580a7['id']}})[_0x3ade('0x1d')](function(){return _0x217221;});})[_0x3ade('0x1d')](function(){_0x1f2f21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x13b965,_0x5b6879){return function(_0x172d4d){if(!_0x172d4d){_0x13b965[_0x3ade('0x27')](0x194);}return _0x172d4d;};}function handleError(_0x446f75,_0x45cab7){_0x45cab7=_0x45cab7||0x1f4;return function(_0x20b583){logger[_0x3ade('0x22')](_0x20b583['stack']);if(_0x20b583[_0x3ade('0x36')]){delete _0x20b583[_0x3ade('0x36')];}_0x446f75['status'](_0x45cab7)[_0x3ade('0x37')](_0x20b583);};}exports[_0x3ade('0x38')]=function(_0x471418,_0x523954){var _0x23725a={},_0x137740={},_0x27300a={'count':0x0,'rows':[]};var _0x8320ef=_[_0x3ade('0x39')](db[_0x3ade('0x3a')][_0x3ade('0x3b')],function(_0x13ee33){return{'name':_0x13ee33[_0x3ade('0x3c')],'type':_0x13ee33['type'][_0x3ade('0x3d')]};});_0x137740[_0x3ade('0x3e')]=_['map'](_0x8320ef,_0x3ade('0x36'));_0x137740[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x471418[_0x3ade('0x3f')]);_0x137740[_0x3ade('0x41')]=_[_0x3ade('0x42')](_0x137740[_0x3ade('0x3e')],_0x137740[_0x3ade('0x3f')]);_0x23725a['attributes']=_[_0x3ade('0x42')](_0x137740[_0x3ade('0x3e')],qs[_0x3ade('0x43')](_0x471418[_0x3ade('0x3f')][_0x3ade('0x43')]));_0x23725a[_0x3ade('0x44')]=_0x23725a[_0x3ade('0x44')][_0x3ade('0x45')]?_0x23725a[_0x3ade('0x44')]:_0x137740[_0x3ade('0x3e')];if(!_0x471418[_0x3ade('0x3f')][_0x3ade('0x46')](_0x3ade('0x47'))){_0x23725a[_0x3ade('0x2b')]=qs[_0x3ade('0x2b')](_0x471418[_0x3ade('0x3f')][_0x3ade('0x2b')]);_0x23725a['offset']=qs['offset'](_0x471418[_0x3ade('0x3f')]['offset']);}_0x23725a[_0x3ade('0x48')]=qs['sort'](_0x471418[_0x3ade('0x3f')][_0x3ade('0x49')]);_0x23725a[_0x3ade('0x4a')]=qs[_0x3ade('0x41')](_[_0x3ade('0x4b')](_0x471418[_0x3ade('0x3f')],_0x137740['filters']),_0x8320ef);if(_0x471418[_0x3ade('0x3f')][_0x3ade('0x4c')]){_0x23725a['where']=_[_0x3ade('0x4d')](_0x23725a[_0x3ade('0x4a')],{'$or':_[_0x3ade('0x39')](_0x8320ef,function(_0x54cf86){if(_0x54cf86[_0x3ade('0x4e')]!==_0x3ade('0x4f')){var _0x1ce49b={};_0x1ce49b[_0x54cf86[_0x3ade('0x36')]]={'$like':'%'+_0x471418[_0x3ade('0x3f')][_0x3ade('0x4c')]+'%'};return _0x1ce49b;}})});}_0x23725a=_['merge']({},_0x23725a,_0x471418['options']);var _0x3fa068={'where':_0x23725a[_0x3ade('0x4a')]};return db[_0x3ade('0x3a')][_0x3ade('0x50')](_0x3fa068)['then'](function(_0xba7eb4){_0x27300a[_0x3ade('0x50')]=_0xba7eb4;if(_0x471418[_0x3ade('0x3f')][_0x3ade('0x51')]){_0x23725a['include']=[{'all':!![]}];}return db[_0x3ade('0x3a')][_0x3ade('0x52')](_0x23725a);})['then'](function(_0x1a938d){_0x27300a[_0x3ade('0x53')]=_0x1a938d;return _0x27300a;})[_0x3ade('0x1d')](respondWithFilteredResult(_0x523954,_0x23725a))[_0x3ade('0x26')](handleError(_0x523954,null));};exports[_0x3ade('0x54')]=function(_0x27f40e,_0x3922e5){var _0x308d12={'raw':!![],'where':{'id':_0x27f40e[_0x3ade('0x55')]['id']}},_0x1f754d={};_0x1f754d[_0x3ade('0x3e')]=_['keys'](db[_0x3ade('0x3a')][_0x3ade('0x3b')]);_0x1f754d[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x27f40e[_0x3ade('0x3f')]);_0x1f754d[_0x3ade('0x41')]=_['intersection'](_0x1f754d[_0x3ade('0x3e')],_0x1f754d['query']);_0x308d12[_0x3ade('0x44')]=_['intersection'](_0x1f754d['model'],qs[_0x3ade('0x43')](_0x27f40e['query']['fields']));_0x308d12['attributes']=_0x308d12[_0x3ade('0x44')]['length']?_0x308d12['attributes']:_0x1f754d['model'];if(_0x27f40e[_0x3ade('0x3f')][_0x3ade('0x51')]){_0x308d12[_0x3ade('0x56')]=[{'all':!![]}];}_0x308d12=_[_0x3ade('0x4d')]({},_0x308d12,_0x27f40e['options']);return db['ChatQueue'][_0x3ade('0x57')](_0x308d12)[_0x3ade('0x1d')](handleEntityNotFound(_0x3922e5,null))[_0x3ade('0x1d')](respondWithResult(_0x3922e5,null))['catch'](handleError(_0x3922e5,null));};exports[_0x3ade('0x58')]=function(_0x3aaa50,_0x41bdb2){return db[_0x3ade('0x3a')][_0x3ade('0x58')](_0x3aaa50[_0x3ade('0x59')],{})['then'](function(_0x26155e){var _0x309d00=_0x3aaa50['user']['get']({'plain':!![]});if(!_0x309d00)throw new Error(_0x3ade('0x5a'));if(_0x309d00[_0x3ade('0x5b')]===_0x3ade('0x5c')){var _0x44c526=_0x26155e[_0x3ade('0x34')]({'plain':!![]});var _0x176f1a=_0x3ade('0x5d');return db[_0x3ade('0x5e')][_0x3ade('0x57')]({'where':{'name':_0x176f1a,'userProfileId':_0x309d00[_0x3ade('0x5f')]},'raw':!![]})['then'](function(_0x4d9be8){if(_0x4d9be8&&_0x4d9be8[_0x3ade('0x60')]===0x0){return db['UserProfileResource'][_0x3ade('0x58')]({'name':_0x44c526[_0x3ade('0x36')],'resourceId':_0x44c526['id'],'type':_0x4d9be8[_0x3ade('0x36')],'sectionId':_0x4d9be8['id']},{})['then'](function(){return _0x26155e;});}else{return _0x26155e;}})['catch'](function(_0x265d25){logger[_0x3ade('0x22')](_0x3ade('0x61'),_0x265d25);throw _0x265d25;});}return _0x26155e;})['then'](respondWithResult(_0x41bdb2,0xc9))[_0x3ade('0x26')](handleError(_0x41bdb2,null));};exports['update']=function(_0x32b069,_0x2dbed5){if(_0x32b069['body']['id']){delete _0x32b069['body']['id'];}return db[_0x3ade('0x3a')][_0x3ade('0x57')]({'where':{'id':_0x32b069[_0x3ade('0x55')]['id']}})[_0x3ade('0x1d')](handleEntityNotFound(_0x2dbed5,null))[_0x3ade('0x1d')](saveUpdates(_0x32b069[_0x3ade('0x59')],null))[_0x3ade('0x1d')](respondWithResult(_0x2dbed5,null))[_0x3ade('0x26')](handleError(_0x2dbed5,null));};exports[_0x3ade('0x33')]=function(_0xf7daa9,_0x23b7c9){return db[_0x3ade('0x3a')][_0x3ade('0x57')]({'where':{'id':_0xf7daa9[_0x3ade('0x55')]['id']}})['then'](handleEntityNotFound(_0x23b7c9,null))['then'](removeEntity(_0x23b7c9,null))[_0x3ade('0x26')](handleError(_0x23b7c9,null));};exports[_0x3ade('0x62')]=function(_0x488f9c,_0xe8cf15){return db[_0x3ade('0x3a')][_0x3ade('0x62')]()[_0x3ade('0x1d')](respondWithResult(_0xe8cf15,null))[_0x3ade('0x26')](handleError(_0xe8cf15,null));};exports[_0x3ade('0x63')]=function(_0x3a3406,_0x4c7680,_0x17008a){var _0x52378a={'raw':!![],'where':{}},_0x7949bb={},_0x1895d2;return db[_0x3ade('0x3a')][_0x3ade('0x64')]({'where':{'id':_0x3a3406[_0x3ade('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c7680,null))[_0x3ade('0x1d')](function(_0x3fbe97){if(_0x3fbe97){_0x1895d2=_0x3fbe97[_0x3ade('0x34')]({'plain':!![]});_0x7949bb[_0x3ade('0x3e')]=_[_0x3ade('0x40')](db['UserChatQueue']['rawAttributes']);_0x7949bb[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x3a3406[_0x3ade('0x3f')]);_0x7949bb[_0x3ade('0x41')]=_[_0x3ade('0x42')](_0x7949bb[_0x3ade('0x3e')],_0x7949bb['query']);_0x52378a['attributes']=_[_0x3ade('0x42')](_0x7949bb[_0x3ade('0x3e')],qs[_0x3ade('0x43')](_0x3a3406[_0x3ade('0x3f')][_0x3ade('0x43')]));_0x52378a[_0x3ade('0x44')]=_0x52378a[_0x3ade('0x44')][_0x3ade('0x45')]?_0x52378a[_0x3ade('0x44')]:_0x7949bb[_0x3ade('0x3e')];if(!_0x3a3406[_0x3ade('0x3f')][_0x3ade('0x46')](_0x3ade('0x47'))){_0x52378a['limit']=qs[_0x3ade('0x2b')](_0x3a3406[_0x3ade('0x3f')][_0x3ade('0x2b')]);_0x52378a[_0x3ade('0x2c')]=qs[_0x3ade('0x2c')](_0x3a3406['query'][_0x3ade('0x2c')]);}_0x52378a[_0x3ade('0x48')]=qs[_0x3ade('0x49')](_0x3a3406[_0x3ade('0x3f')][_0x3ade('0x49')]);_0x52378a['where']=qs[_0x3ade('0x41')](_[_0x3ade('0x4b')](_0x3a3406[_0x3ade('0x3f')],_0x7949bb[_0x3ade('0x41')]));_0x52378a[_0x3ade('0x4a')][_0x3ade('0x65')]=_0x3fbe97['id'];if(_0x3a3406[_0x3ade('0x3f')][_0x3ade('0x4c')]){_0x52378a['where']=_['merge'](_0x52378a['where'],{'$or':_['map'](_0x52378a[_0x3ade('0x44')],function(_0x56da78){var _0x4a3bda={};_0x4a3bda[_0x56da78]={'$like':'%'+_0x3a3406['query'][_0x3ade('0x4c')]+'%'};return _0x4a3bda;})});}_0x52378a=_[_0x3ade('0x4d')]({},_0x52378a,_0x3a3406[_0x3ade('0x66')]);return db[_0x3ade('0x67')]['findAll'](_0x52378a);}})[_0x3ade('0x1d')](function(_0x4ed2ce){if(_0x4ed2ce){return db[_0x3ade('0x68')][_0x3ade('0x69')]({'where':{'id':_[_0x3ade('0x39')](_0x4ed2ce,_0x3ade('0x6a')),'role':_0x3ade('0x6b')},'attributes':['id',_0x3ade('0x36'),'chatPause',_0x3ade('0x6c'),'createdAt']});}})[_0x3ade('0x1d')](function(_0x6a9e5c){if(_0x6a9e5c){return{'count':_0x6a9e5c[_0x3ade('0x50')],'rows':_[_0x3ade('0x39')](_0x6a9e5c[_0x3ade('0x53')],function(_0x366230){return{'membername':_0x366230[_0x3ade('0x36')],'UserId':_0x366230['id'],'queue_name':_0x1895d2[_0x3ade('0x36')],'ChatQueueId':_0x1895d2['id'],'interface':util[_0x3ade('0x6d')](_0x3ade('0x6e'),_0x3ade('0x6f'),_0x366230['name']),'penalty':0x0,'paused':_0x366230['chatPause'],'createdAt':_0x366230[_0x3ade('0x70')],'updatedAt':_0x366230[_0x3ade('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3ade('0x1d')](respondWithFilteredResult(_0x4c7680,_0x52378a))[_0x3ade('0x26')](handleError(_0x4c7680,null));};exports[_0x3ade('0x71')]=function(_0x43eb33,_0x6db3cc,_0x230543){var _0x117186={};var _0x2d917b={};var _0xe1e6fb;var _0x33146b;return db[_0x3ade('0x3a')][_0x3ade('0x64')]({'where':{'id':_0x43eb33[_0x3ade('0x55')]['id']}})[_0x3ade('0x1d')](handleEntityNotFound(_0x6db3cc,null))[_0x3ade('0x1d')](function(_0x347963){if(_0x347963){_0xe1e6fb=_0x347963;_0x2d917b['model']=_[_0x3ade('0x40')](db[_0x3ade('0x72')][_0x3ade('0x3b')]);_0x2d917b[_0x3ade('0x3f')]=_['keys'](_0x43eb33[_0x3ade('0x3f')]);_0x2d917b[_0x3ade('0x41')]=_['intersection'](_0x2d917b[_0x3ade('0x3e')],_0x2d917b[_0x3ade('0x3f')]);_0x117186[_0x3ade('0x44')]=_[_0x3ade('0x42')](_0x2d917b['model'],qs['fields'](_0x43eb33['query']['fields']));_0x117186[_0x3ade('0x44')]=_0x117186[_0x3ade('0x44')][_0x3ade('0x45')]?_0x117186[_0x3ade('0x44')]:_0x2d917b[_0x3ade('0x3e')];_0x117186[_0x3ade('0x48')]=qs[_0x3ade('0x49')](_0x43eb33[_0x3ade('0x3f')][_0x3ade('0x49')]);_0x117186['where']=qs[_0x3ade('0x41')](_[_0x3ade('0x4b')](_0x43eb33[_0x3ade('0x3f')],_0x2d917b[_0x3ade('0x41')]));if(_0x43eb33[_0x3ade('0x3f')][_0x3ade('0x4c')]){_0x117186[_0x3ade('0x4a')]=_[_0x3ade('0x4d')](_0x117186[_0x3ade('0x4a')],{'$or':_[_0x3ade('0x39')](_0x117186[_0x3ade('0x44')],function(_0x3fbdc4){var _0x532a92={};_0x532a92[_0x3fbdc4]={'$like':'%'+_0x43eb33[_0x3ade('0x3f')][_0x3ade('0x4c')]+'%'};return _0x532a92;})});}_0x117186=_[_0x3ade('0x4d')]({},_0x117186,_0x43eb33['options']);return _0xe1e6fb[_0x3ade('0x71')](_0x117186);}})['then'](function(_0x35adc5){if(_0x35adc5){_0x33146b=_0x35adc5['length'];if(!_0x43eb33[_0x3ade('0x3f')][_0x3ade('0x46')]('nolimit')){_0x117186[_0x3ade('0x2b')]=qs[_0x3ade('0x2b')](_0x43eb33['query'][_0x3ade('0x2b')]);_0x117186[_0x3ade('0x2c')]=qs['offset'](_0x43eb33[_0x3ade('0x3f')][_0x3ade('0x2c')]);}return _0xe1e6fb[_0x3ade('0x71')](_0x117186);}})[_0x3ade('0x1d')](function(_0x5c62f4){if(_0x5c62f4){return _0x5c62f4?{'count':_0x33146b,'rows':_0x5c62f4}:null;}})['then'](respondWithResult(_0x6db3cc,null))[_0x3ade('0x26')](handleError(_0x6db3cc,null));};exports[_0x3ade('0x73')]=function(_0x4dd731,_0x68d447,_0x5a1f9f){var _0x4c1613=_0x4dd731[_0x3ade('0x59')][_0x3ade('0x74')];return db[_0x3ade('0x72')][_0x3ade('0x52')]({'where':{'id':_0x4c1613},'attributes':['id'],'include':[{'model':db[_0x3ade('0x68')],'as':'Agents','attributes':['id',_0x3ade('0x36'),_0x3ade('0x75'),_0x3ade('0x76'),'interface'],'raw':!![]}]})[_0x3ade('0x1d')](function(_0x11756e){if(_0x11756e){var _0x121256=_['flatMap'](_0x11756e,function(_0x1dc020){var _0xd9a6fb=_0x1dc020[_0x3ade('0x34')]({'plain':!![]});return _0xd9a6fb[_0x3ade('0x77')];});return db[_0x3ade('0x3a')][_0x3ade('0x57')]({'where':{'id':_0x4dd731[_0x3ade('0x55')]['id']}})[_0x3ade('0x1d')](function(_0x49791a){return db[_0x3ade('0x78')][_0x3ade('0x79')](function(_0x52b551){return _0x49791a[_0x3ade('0x73')](_0x4c1613,{'transaction':_0x52b551})[_0x3ade('0x1d')](function(){return BPromise[_0x3ade('0x7a')](_0x121256,function(_0x2efc54){return db['UserChatQueue'][_0x3ade('0x7b')]({'where':{'UserId':_0x2efc54['id'],'ChatQueueId':_0x4dd731[_0x3ade('0x55')]['id']},'transaction':_0x52b551});});})[_0x3ade('0x1d')](function(){_0x121256[_0x3ade('0x7c')](function(_0x14cb36){socket[_0x3ade('0x7d')]('userChatQueue:save',{'UserId':_0x14cb36['id'],'ChatQueueId':_0x49791a['id']});});});});});}})[_0x3ade('0x1d')](respondWithStatusCode(_0x68d447,null))[_0x3ade('0x26')](handleError(_0x68d447,null));};exports[_0x3ade('0x7e')]=function(_0x4e52d0,_0x2e9b9e,_0x189f6c){return db['Team']['findAll']({'where':{'id':_0x4e52d0[_0x3ade('0x3f')][_0x3ade('0x74')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3ade('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e9b9e,null))['then'](function(_0xc718ab){var _0x386299=_[_0x3ade('0x39')](_0xc718ab,'id');var _0x20640f=[];var _0x3b0530=[];var _0x476626=squel[_0x3ade('0x7f')]();_0x476626['field'](_0x3ade('0x80'))[_0x3ade('0x81')]('team_has_chat_queues','tq')[_0x3ade('0x82')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3ade('0x4a')](_0x3ade('0x83'),_0x4e52d0[_0x3ade('0x55')]['id']);for(var _0x282ea8=0x0;_0x282ea8<_0xc718ab['length'];_0x282ea8+=0x1){let _0x3948ee=_0xc718ab[_0x282ea8];for(var _0x3a6322=0x0;_0x3a6322<_0x3948ee[_0x3ade('0x77')][_0x3ade('0x45')];_0x3a6322+=0x1){let _0x290c3a=_0x3948ee[_0x3ade('0x77')][_0x3a6322];var _0x5869c5=_0x476626[_0x3ade('0x84')]();_0x5869c5['where']('ut.UserId\x20=\x20?',_0x290c3a['id']);_0x3b0530['push'](db[_0x3ade('0x78')]['query'](_0x5869c5[_0x3ade('0x85')](),{'type':db[_0x3ade('0x78')]['QueryTypes'][_0x3ade('0x86')]})['then'](function(_0x57e80e){if(_0x57e80e[_0x3ade('0x45')]===0x1){return _0x290c3a['id'];}else{var _0x4c0109=_[_0x3ade('0x87')](_['map'](_0x57e80e,'TeamId'),function(_0x5d92ee){return _[_0x3ade('0x88')](_0x386299,_0x5d92ee);});if(_0x4c0109){return _0x290c3a['id'];}}}));}}return BPromise[_0x3ade('0x89')](_0x3b0530)[_0x3ade('0x1d')](function(_0x4be7a3){_0x20640f=_(_0x20640f)['union'](_0x4be7a3)[_0x3ade('0x8a')]()['value']();return db[_0x3ade('0x3a')][_0x3ade('0x57')]({'where':{'id':_0x4e52d0[_0x3ade('0x55')]['id']}})[_0x3ade('0x1d')](function(_0x43cd56){return db[_0x3ade('0x78')]['transaction'](function(_0x2ae543){return _0x43cd56[_0x3ade('0x7e')](_0x4e52d0[_0x3ade('0x3f')][_0x3ade('0x74')],{'transaction':_0x2ae543})[_0x3ade('0x1d')](function(){if(!_[_0x3ade('0x8b')](_0x20640f)){return _0x43cd56['removeAgents'](_0x20640f,{'transaction':_0x2ae543});}})['then'](function(){_0x20640f[_0x3ade('0x7c')](function(_0x3e739c){socket[_0x3ade('0x7d')]('userChatQueue:remove',{'UserId':_0x3e739c,'ChatQueueId':_0x43cd56['id']});});});});});});})[_0x3ade('0x1d')](respondWithStatusCode(_0x2e9b9e,null))['catch'](handleError(_0x2e9b9e,null));};exports[_0x3ade('0x8c')]=function(_0x3bb5ea,_0x57a461,_0x1409d6){return db[_0x3ade('0x3a')][_0x3ade('0x57')]({'where':{'id':_0x3bb5ea[_0x3ade('0x55')]['id']}})[_0x3ade('0x1d')](handleEntityNotFound(_0x57a461,null))['then'](function(_0x12a38e){if(_0x12a38e){return _0x12a38e['addAgents'](_0x3bb5ea[_0x3ade('0x59')][_0x3ade('0x74')],_[_0x3ade('0x8d')](_0x3bb5ea[_0x3ade('0x59')],['ids','id'])||{})['spread'](function(_0x34d611){for(var _0x34bec1=0x0;_0x34bec1<_0x3bb5ea[_0x3ade('0x59')][_0x3ade('0x74')][_0x3ade('0x45')];_0x34bec1+=0x1){socket[_0x3ade('0x7d')](_0x3ade('0x8e'),{'UserId':Number(_0x3bb5ea[_0x3ade('0x59')][_0x3ade('0x74')][_0x34bec1]),'ChatQueueId':Number(_0x3bb5ea[_0x3ade('0x55')]['id'])});}return _0x34d611;});}})['then'](respondWithResult(_0x57a461,null))[_0x3ade('0x26')](handleError(_0x57a461,null));};exports[_0x3ade('0x8f')]=function(_0x189c83,_0x4c3e2e,_0x175b25){return db[_0x3ade('0x3a')][_0x3ade('0x57')]({'where':{'id':_0x189c83['params']['id']}})[_0x3ade('0x1d')](handleEntityNotFound(_0x4c3e2e,null))[_0x3ade('0x1d')](function(_0x9534ee){if(_0x9534ee){return _0x9534ee[_0x3ade('0x8f')](_0x189c83['query']['ids'])[_0x3ade('0x1d')](function(){if(_[_0x3ade('0x90')](_0x189c83['query'][_0x3ade('0x74')])){for(var _0x2504da=0x0;_0x2504da<_0x189c83[_0x3ade('0x3f')][_0x3ade('0x74')]['length'];_0x2504da+=0x1){socket[_0x3ade('0x7d')](_0x3ade('0x91'),{'UserId':Number(_0x189c83[_0x3ade('0x3f')][_0x3ade('0x74')][_0x2504da]),'ChatQueueId':Number(_0x189c83[_0x3ade('0x55')]['id'])});}}else{socket[_0x3ade('0x7d')](_0x3ade('0x91'),{'UserId':Number(_0x189c83['query'][_0x3ade('0x74')]),'ChatQueueId':Number(_0x189c83[_0x3ade('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c3e2e,null))[_0x3ade('0x26')](handleError(_0x4c3e2e,null));};exports[_0x3ade('0x92')]=function(_0x1f78a4,_0x39fc59,_0x593fc2){var _0x336c3b={};var _0x30d0c7={};var _0x4e0ba9;var _0x446fd8;return db['ChatQueue'][_0x3ade('0x64')]({'where':{'id':_0x1f78a4['params']['id']}})['then'](handleEntityNotFound(_0x39fc59,null))[_0x3ade('0x1d')](function(_0xccecc9){if(_0xccecc9){_0x4e0ba9=_0xccecc9;_0x30d0c7[_0x3ade('0x3e')]=_[_0x3ade('0x40')](db['User'][_0x3ade('0x3b')]);_0x30d0c7[_0x3ade('0x3f')]=_[_0x3ade('0x40')](_0x1f78a4['query']);_0x30d0c7[_0x3ade('0x41')]=_[_0x3ade('0x42')](_0x30d0c7['model'],_0x30d0c7['query']);_0x336c3b['attributes']=_['intersection'](_0x30d0c7[_0x3ade('0x3e')],qs[_0x3ade('0x43')](_0x1f78a4[_0x3ade('0x3f')][_0x3ade('0x43')]));_0x336c3b[_0x3ade('0x44')]=_0x336c3b[_0x3ade('0x44')][_0x3ade('0x45')]?_0x336c3b[_0x3ade('0x44')]:_0x30d0c7[_0x3ade('0x3e')];_0x336c3b['order']=qs['sort'](_0x1f78a4[_0x3ade('0x3f')]['sort']);_0x336c3b[_0x3ade('0x4a')]=qs['filters'](_[_0x3ade('0x4b')](_0x1f78a4[_0x3ade('0x3f')],_0x30d0c7['filters']));if(_0x1f78a4['query'][_0x3ade('0x4c')]){_0x336c3b[_0x3ade('0x4a')]=_[_0x3ade('0x4d')](_0x336c3b['where'],{'$or':_[_0x3ade('0x39')](_0x336c3b[_0x3ade('0x44')],function(_0x56126a){var _0x2d6b89={};_0x2d6b89[_0x56126a]={'$like':'%'+_0x1f78a4[_0x3ade('0x3f')]['filter']+'%'};return _0x2d6b89;})});}_0x336c3b=_[_0x3ade('0x4d')]({},_0x336c3b,_0x1f78a4[_0x3ade('0x66')]);return _0x4e0ba9[_0x3ade('0x92')](_0x336c3b);}})[_0x3ade('0x1d')](function(_0x368c00){if(_0x368c00){_0x446fd8=_0x368c00[_0x3ade('0x45')];if(!_0x1f78a4[_0x3ade('0x3f')][_0x3ade('0x46')](_0x3ade('0x47'))){_0x336c3b[_0x3ade('0x2b')]=qs[_0x3ade('0x2b')](_0x1f78a4[_0x3ade('0x3f')]['limit']);_0x336c3b[_0x3ade('0x2c')]=qs[_0x3ade('0x2c')](_0x1f78a4['query']['offset']);}return _0x4e0ba9[_0x3ade('0x92')](_0x336c3b);}})[_0x3ade('0x1d')](function(_0x24824d){if(_0x24824d){return _0x24824d?{'count':_0x446fd8,'rows':_0x24824d}:null;}})[_0x3ade('0x1d')](respondWithResult(_0x39fc59,null))[_0x3ade('0x26')](handleError(_0x39fc59,null));};
\ No newline at end of file
index ca1da3b..b6f032c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c35=['remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update'];(function(_0x14a3d1,_0x598705){var _0x5e647d=function(_0x2247dc){while(--_0x2247dc){_0x14a3d1['push'](_0x14a3d1['shift']());}};_0x5e647d(++_0x598705);}(_0x2c35,0xe5));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x52c3('0x0'));var ChatQueue=require(_0x52c3('0x1'))['db'][_0x52c3('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x52c3('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x52c3('0x4'),'afterDestroy':_0x52c3('0x5')};function emitEvent(_0x353239){return function(_0x42eb40,_0x437e8a,_0x5d28b5){ChatQueueEvents[_0x52c3('0x6')](_0x353239+':'+_0x42eb40['id'],_0x42eb40);ChatQueueEvents[_0x52c3('0x6')](_0x353239,_0x42eb40);_0x5d28b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x52c3('0x7')](e,emitEvent(event));}}module[_0x52c3('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x3273=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','remove'];(function(_0x14a69e,_0x262122){var _0x27520c=function(_0x5a3e8e){while(--_0x5a3e8e){_0x14a69e['push'](_0x14a69e['shift']());}};_0x27520c(++_0x262122);}(_0x3273,0x1d1));var _0x3327=function(_0x1ca59f,_0x1a5cd7){_0x1ca59f=_0x1ca59f-0x0;var _0x2f3153=_0x3273[_0x1ca59f];return _0x2f3153;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x3327('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3327('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3327('0x2'),'afterDestroy':_0x3327('0x3')};function emitEvent(_0xaf26e){return function(_0x128388,_0x22eacb,_0x18be05){ChatQueueEvents['emit'](_0xaf26e+':'+_0x128388['id'],_0x128388);ChatQueueEvents[_0x3327('0x4')](_0xaf26e,_0x128388);_0x18be05(null);};}for(var e in events){if(events[_0x3327('0x5')](e)){var event=events[e];ChatQueue[_0x3327('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
index 1fed897..bab9897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb5=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x535f88,_0x5d42de){var _0x2c006a=function(_0x205f38){while(--_0x205f38){_0x535f88['push'](_0x535f88['shift']());}};_0x2c006a(++_0x5d42de);}(_0x2eb5,0xe3));var _0x52eb=function(_0x1aa7b9,_0x176302){_0x1aa7b9=_0x1aa7b9-0x0;var _0x34f333=_0x2eb5[_0x1aa7b9];return _0x34f333;};'use strict';var _=require(_0x52eb('0x0'));var util=require(_0x52eb('0x1'));var logger=require(_0x52eb('0x2'))(_0x52eb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x52eb('0x4'));var fs=require('fs');var path=require(_0x52eb('0x5'));var rimraf=require(_0x52eb('0x6'));var config=require(_0x52eb('0x7'));var attributes=require(_0x52eb('0x8'));module[_0x52eb('0x9')]=function(_0x26d0d5,_0x58a2d4){return _0x26d0d5[_0x52eb('0xa')]('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbf40=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x50a28b,_0x2c57a2){var _0x5945eb=function(_0x4ef69a){while(--_0x4ef69a){_0x50a28b['push'](_0x50a28b['shift']());}};_0x5945eb(++_0x2c57a2);}(_0xbf40,0x1e9));var _0x0bf4=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0xbf40[_0x557fd2];return _0x1b54a2;};'use strict';var _=require('lodash');var util=require(_0x0bf4('0x0'));var logger=require(_0x0bf4('0x1'))('api');var moment=require(_0x0bf4('0x2'));var BPromise=require('bluebird');var rp=require(_0x0bf4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bf4('0x4'));var config=require(_0x0bf4('0x5'));var attributes=require(_0x0bf4('0x6'));module[_0x0bf4('0x7')]=function(_0x540d09,_0x3b4405){return _0x540d09[_0x0bf4('0x8')](_0x0bf4('0x9'),attributes,{'tableName':_0x0bf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b6fe53..1485e41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eb8=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetChatQueue','ChatQueue','findAll','options','raw','limit','include','map','model','attributes','ShowChatQueue','find','where','lodash','util','moment'];(function(_0x18efd3,_0x24f99e){var _0x36834b=function(_0x45f0b8){while(--_0x45f0b8){_0x18efd3['push'](_0x18efd3['shift']());}};_0x36834b(++_0x24f99e);}(_0x4eb8,0x1b5));var _0x84eb=function(_0x4c42ff,_0x3d3d75){_0x4c42ff=_0x4c42ff-0x0;var _0x27387f=_0x4eb8[_0x4c42ff];return _0x27387f;};'use strict';var _=require(_0x84eb('0x0'));var util=require(_0x84eb('0x1'));var moment=require(_0x84eb('0x2'));var BPromise=require(_0x84eb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x84eb('0x4'));var db=require(_0x84eb('0x5'))['db'];var utils=require(_0x84eb('0x6'));var logger=require(_0x84eb('0x7'))(_0x84eb('0x8'));var config=require(_0x84eb('0x9'));var jayson=require(_0x84eb('0xa'));var client=jayson[_0x84eb('0xb')][_0x84eb('0xc')]({'port':0x232a});config['redis']=_[_0x84eb('0xd')](config[_0x84eb('0xe')],{'host':_0x84eb('0xf'),'port':0x18eb});var socket=require(_0x84eb('0x10'))(new Redis(config[_0x84eb('0xe')]));require(_0x84eb('0x11'))[_0x84eb('0x12')](socket);function respondWithRpcPromise(_0x33e9cc,_0x2709d7,_0x4a04e6){return new BPromise(function(_0x15ee2b,_0xf0d060){return client[_0x84eb('0x13')](_0x33e9cc,_0x4a04e6)[_0x84eb('0x14')](function(_0x5b2d53){logger[_0x84eb('0x15')](_0x84eb('0x16'),_0x2709d7,_0x84eb('0x17'));logger[_0x84eb('0x18')](_0x84eb('0x19'),_0x2709d7,'request\x20sent',JSON[_0x84eb('0x1a')](_0x5b2d53));if(_0x5b2d53[_0x84eb('0x1b')]){if(_0x5b2d53[_0x84eb('0x1b')][_0x84eb('0x1c')]===0x1f4){logger[_0x84eb('0x1b')](_0x84eb('0x16'),_0x2709d7,_0x5b2d53[_0x84eb('0x1b')][_0x84eb('0x1d')]);return _0xf0d060(_0x5b2d53[_0x84eb('0x1b')][_0x84eb('0x1d')]);}logger[_0x84eb('0x1b')](_0x84eb('0x16'),_0x2709d7,_0x5b2d53['error'][_0x84eb('0x1d')]);return _0x15ee2b(_0x5b2d53[_0x84eb('0x1b')][_0x84eb('0x1d')]);}else{logger[_0x84eb('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2709d7,'request\x20sent');_0x15ee2b(_0x5b2d53['result']['message']);}})[_0x84eb('0x1e')](function(_0x242bee){logger[_0x84eb('0x1b')]('ChatQueue,\x20%s,\x20%s',_0x2709d7,_0x242bee);_0xf0d060(_0x242bee);});});}exports[_0x84eb('0x1f')]=function(_0x183111){var _0xdaf548=this;return new Promise(function(_0x3f4ffe,_0x26dcfd){return db[_0x84eb('0x20')][_0x84eb('0x21')]({'raw':_0x183111['options']?_0x183111[_0x84eb('0x22')][_0x84eb('0x23')]===undefined?!![]:![]:!![],'where':_0x183111['options']?_0x183111[_0x84eb('0x22')]['where']||null:null,'attributes':_0x183111[_0x84eb('0x22')]?_0x183111[_0x84eb('0x22')]['attributes']||null:null,'limit':_0x183111[_0x84eb('0x22')]?_0x183111[_0x84eb('0x22')][_0x84eb('0x24')]||null:null,'include':_0x183111[_0x84eb('0x22')]?_0x183111[_0x84eb('0x22')][_0x84eb('0x25')]?_[_0x84eb('0x26')](_0x183111[_0x84eb('0x22')]['include'],function(_0x1e71f7){return{'model':db[_0x1e71f7[_0x84eb('0x27')]],'as':_0x1e71f7['as'],'attributes':_0x1e71f7[_0x84eb('0x28')],'include':_0x1e71f7[_0x84eb('0x25')]?_[_0x84eb('0x26')](_0x1e71f7[_0x84eb('0x25')],function(_0xd51ee6){return{'model':db[_0xd51ee6[_0x84eb('0x27')]],'as':_0xd51ee6['as'],'attributes':_0xd51ee6[_0x84eb('0x28')],'include':_0xd51ee6[_0x84eb('0x25')]?_[_0x84eb('0x26')](_0xd51ee6[_0x84eb('0x25')],function(_0x22e11c){return{'model':db[_0x22e11c[_0x84eb('0x27')]],'as':_0x22e11c['as'],'attributes':_0x22e11c['attributes']};}):[]};}):[]};}):[]:[]})[_0x84eb('0x14')](function(_0x105774){logger[_0x84eb('0x15')](_0x84eb('0x1f'),_0x183111);logger[_0x84eb('0x18')]('GetChatQueue',_0x183111,JSON[_0x84eb('0x1a')](_0x105774));_0x3f4ffe(_0x105774);})[_0x84eb('0x1e')](function(_0x2cc885){logger['error'](_0x84eb('0x1f'),_0x2cc885[_0x84eb('0x1d')],_0x183111);_0x26dcfd(_0xdaf548[_0x84eb('0x1b')](0x1f4,_0x2cc885['message']));});});};exports[_0x84eb('0x29')]=function(_0x5e0ee3){var _0x1b2966=this;return new Promise(function(_0x189841,_0xcd74e5){return db[_0x84eb('0x20')][_0x84eb('0x2a')]({'raw':_0x5e0ee3[_0x84eb('0x22')]?_0x5e0ee3[_0x84eb('0x22')][_0x84eb('0x23')]===undefined?!![]:![]:!![],'where':_0x5e0ee3['options']?_0x5e0ee3[_0x84eb('0x22')][_0x84eb('0x2b')]||null:null,'attributes':_0x5e0ee3['options']?_0x5e0ee3[_0x84eb('0x22')][_0x84eb('0x28')]||null:null,'include':_0x5e0ee3[_0x84eb('0x22')]?_0x5e0ee3[_0x84eb('0x22')][_0x84eb('0x25')]?_['map'](_0x5e0ee3[_0x84eb('0x22')][_0x84eb('0x25')],function(_0x3759c8){return{'model':db[_0x3759c8[_0x84eb('0x27')]],'as':_0x3759c8['as'],'attributes':_0x3759c8[_0x84eb('0x28')],'include':_0x3759c8[_0x84eb('0x25')]?_[_0x84eb('0x26')](_0x3759c8['include'],function(_0x5a925d){return{'model':db[_0x5a925d[_0x84eb('0x27')]],'as':_0x5a925d['as'],'attributes':_0x5a925d['attributes'],'include':_0x5a925d[_0x84eb('0x25')]?_[_0x84eb('0x26')](_0x5a925d[_0x84eb('0x25')],function(_0x4d7eab){return{'model':db[_0x4d7eab[_0x84eb('0x27')]],'as':_0x4d7eab['as'],'attributes':_0x4d7eab[_0x84eb('0x28')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1034a0){logger[_0x84eb('0x15')]('ShowChatQueue',_0x5e0ee3);logger[_0x84eb('0x18')](_0x84eb('0x29'),_0x5e0ee3,JSON[_0x84eb('0x1a')](_0x1034a0));_0x189841(_0x1034a0);})[_0x84eb('0x1e')](function(_0x24ba38){logger[_0x84eb('0x1b')](_0x84eb('0x29'),_0x24ba38[_0x84eb('0x1d')],_0x5e0ee3);_0xcd74e5(_0x1b2966['error'](0x1f4,_0x24ba38[_0x84eb('0x1d')]));});});};
\ No newline at end of file
+var _0x0a6b=['find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0a6b,0x120));var _0xb0a6=function(_0x170994,_0x5adc66){_0x170994=_0x170994-0x0;var _0x3c89a3=_0x0a6b[_0x170994];return _0x3c89a3;};'use strict';var _=require(_0xb0a6('0x0'));var util=require('util');var moment=require(_0xb0a6('0x1'));var BPromise=require(_0xb0a6('0x2'));var rs=require(_0xb0a6('0x3'));var fs=require('fs');var Redis=require(_0xb0a6('0x4'));var db=require(_0xb0a6('0x5'))['db'];var utils=require(_0xb0a6('0x6'));var logger=require(_0xb0a6('0x7'))(_0xb0a6('0x8'));var config=require(_0xb0a6('0x9'));var jayson=require(_0xb0a6('0xa'));var client=jayson['client'][_0xb0a6('0xb')]({'port':0x232a});config['redis']=_[_0xb0a6('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb0a6('0xd'))(new Redis(config['redis']));require(_0xb0a6('0xe'))[_0xb0a6('0xf')](socket);function respondWithRpcPromise(_0x549cc4,_0x41e68d,_0x30150c){return new BPromise(function(_0x5cd9b3,_0x1245ab){return client[_0xb0a6('0x10')](_0x549cc4,_0x30150c)[_0xb0a6('0x11')](function(_0x13cd18){logger[_0xb0a6('0x12')](_0xb0a6('0x13'),_0x41e68d,_0xb0a6('0x14'));logger[_0xb0a6('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x41e68d,_0xb0a6('0x14'),JSON[_0xb0a6('0x16')](_0x13cd18));if(_0x13cd18[_0xb0a6('0x17')]){if(_0x13cd18[_0xb0a6('0x17')][_0xb0a6('0x18')]===0x1f4){logger['error'](_0xb0a6('0x13'),_0x41e68d,_0x13cd18[_0xb0a6('0x17')]['message']);return _0x1245ab(_0x13cd18[_0xb0a6('0x17')]['message']);}logger['error'](_0xb0a6('0x13'),_0x41e68d,_0x13cd18[_0xb0a6('0x17')][_0xb0a6('0x19')]);return _0x5cd9b3(_0x13cd18[_0xb0a6('0x17')][_0xb0a6('0x19')]);}else{logger[_0xb0a6('0x12')](_0xb0a6('0x13'),_0x41e68d,_0xb0a6('0x14'));_0x5cd9b3(_0x13cd18[_0xb0a6('0x1a')][_0xb0a6('0x19')]);}})[_0xb0a6('0x1b')](function(_0x57bf27){logger['error'](_0xb0a6('0x13'),_0x41e68d,_0x57bf27);_0x1245ab(_0x57bf27);});});}exports[_0xb0a6('0x1c')]=function(_0x5a23d5){var _0xd99d59=this;return new Promise(function(_0x5571c7,_0x1a5472){return db[_0xb0a6('0x1d')][_0xb0a6('0x1e')]({'raw':_0x5a23d5[_0xb0a6('0x1f')]?_0x5a23d5['options'][_0xb0a6('0x20')]===undefined?!![]:![]:!![],'where':_0x5a23d5['options']?_0x5a23d5[_0xb0a6('0x1f')][_0xb0a6('0x21')]||null:null,'attributes':_0x5a23d5[_0xb0a6('0x1f')]?_0x5a23d5[_0xb0a6('0x1f')][_0xb0a6('0x22')]||null:null,'limit':_0x5a23d5[_0xb0a6('0x1f')]?_0x5a23d5['options'][_0xb0a6('0x23')]||null:null,'include':_0x5a23d5[_0xb0a6('0x1f')]?_0x5a23d5[_0xb0a6('0x1f')][_0xb0a6('0x24')]?_[_0xb0a6('0x25')](_0x5a23d5['options'][_0xb0a6('0x24')],function(_0xf0d5f1){return{'model':db[_0xf0d5f1[_0xb0a6('0x26')]],'as':_0xf0d5f1['as'],'attributes':_0xf0d5f1['attributes'],'include':_0xf0d5f1[_0xb0a6('0x24')]?_[_0xb0a6('0x25')](_0xf0d5f1['include'],function(_0x7236f1){return{'model':db[_0x7236f1[_0xb0a6('0x26')]],'as':_0x7236f1['as'],'attributes':_0x7236f1['attributes'],'include':_0x7236f1['include']?_['map'](_0x7236f1['include'],function(_0x384522){return{'model':db[_0x384522[_0xb0a6('0x26')]],'as':_0x384522['as'],'attributes':_0x384522[_0xb0a6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x11')](function(_0x4cec07){logger['info'](_0xb0a6('0x1c'),_0x5a23d5);logger[_0xb0a6('0x15')]('GetChatQueue',_0x5a23d5,JSON[_0xb0a6('0x16')](_0x4cec07));_0x5571c7(_0x4cec07);})[_0xb0a6('0x1b')](function(_0x5d7b78){logger[_0xb0a6('0x17')](_0xb0a6('0x1c'),_0x5d7b78[_0xb0a6('0x19')],_0x5a23d5);_0x1a5472(_0xd99d59[_0xb0a6('0x17')](0x1f4,_0x5d7b78['message']));});});};exports[_0xb0a6('0x27')]=function(_0x51e2e9){var _0x4f56ec=this;return new Promise(function(_0x481cbc,_0x2ecab3){return db[_0xb0a6('0x1d')][_0xb0a6('0x28')]({'raw':_0x51e2e9['options']?_0x51e2e9[_0xb0a6('0x1f')][_0xb0a6('0x20')]===undefined?!![]:![]:!![],'where':_0x51e2e9[_0xb0a6('0x1f')]?_0x51e2e9[_0xb0a6('0x1f')][_0xb0a6('0x21')]||null:null,'attributes':_0x51e2e9['options']?_0x51e2e9[_0xb0a6('0x1f')]['attributes']||null:null,'include':_0x51e2e9[_0xb0a6('0x1f')]?_0x51e2e9['options'][_0xb0a6('0x24')]?_[_0xb0a6('0x25')](_0x51e2e9[_0xb0a6('0x1f')][_0xb0a6('0x24')],function(_0x13a9b4){return{'model':db[_0x13a9b4[_0xb0a6('0x26')]],'as':_0x13a9b4['as'],'attributes':_0x13a9b4[_0xb0a6('0x22')],'include':_0x13a9b4[_0xb0a6('0x24')]?_[_0xb0a6('0x25')](_0x13a9b4[_0xb0a6('0x24')],function(_0x47e675){return{'model':db[_0x47e675['model']],'as':_0x47e675['as'],'attributes':_0x47e675[_0xb0a6('0x22')],'include':_0x47e675['include']?_[_0xb0a6('0x25')](_0x47e675[_0xb0a6('0x24')],function(_0x356d02){return{'model':db[_0x356d02[_0xb0a6('0x26')]],'as':_0x356d02['as'],'attributes':_0x356d02['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a6('0x11')](function(_0x2cb473){logger['info'](_0xb0a6('0x27'),_0x51e2e9);logger[_0xb0a6('0x15')](_0xb0a6('0x27'),_0x51e2e9,JSON[_0xb0a6('0x16')](_0x2cb473));_0x481cbc(_0x2cb473);})['catch'](function(_0x26b3b2){logger['error'](_0xb0a6('0x27'),_0x26b3b2[_0xb0a6('0x19')],_0x51e2e9);_0x2ecab3(_0x4f56ec['error'](0x1f4,_0x26b3b2[_0xb0a6('0x19')]));});});};
\ No newline at end of file
index 322feba..efb09be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['save','update','emit','removeListener','register','length','chatQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe0bd('0x0'),'remove',_0xe0bd('0x1')];function createListener(_0x3dc984,_0x1d8922){return function(_0x1e198a){_0x1d8922[_0xe0bd('0x2')](_0x3dc984,_0x1e198a);};}function removeListener(_0x5541b9,_0x34df88){return function(){ChatQueueEvents[_0xe0bd('0x3')](_0x5541b9,_0x34df88);};}exports[_0xe0bd('0x4')]=function(_0x3b712a){for(var _0x22bfd1=0x0,_0x26393f=events[_0xe0bd('0x5')];_0x22bfd1<_0x26393f;_0x22bfd1++){var _0x491dc7=events[_0x22bfd1];var _0x40b36a=createListener(_0xe0bd('0x6')+_0x491dc7,_0x3b712a);ChatQueueEvents['on'](_0x491dc7,_0x40b36a);}};
\ No newline at end of file
+var _0x5c12=['removeListener','chatQueue:','save','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5c12,0x188));var _0x25c1=function(_0x419550,_0x15cdf1){_0x419550=_0x419550-0x0;var _0x55f9ef=_0x5c12[_0x419550];return _0x55f9ef;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x25c1('0x0'),_0x25c1('0x1'),'update'];function createListener(_0x44bc2e,_0x1991e5){return function(_0x4042fe){_0x1991e5[_0x25c1('0x2')](_0x44bc2e,_0x4042fe);};}function removeListener(_0x2c5df0,_0x21ec20){return function(){ChatQueueEvents[_0x25c1('0x3')](_0x2c5df0,_0x21ec20);};}exports['register']=function(_0x204287){for(var _0x42ac16=0x0,_0x382922=events['length'];_0x42ac16<_0x382922;_0x42ac16++){var _0x5c69b1=events[_0x42ac16];var _0x24981c=createListener(_0x25c1('0x4')+_0x5c69b1,_0x204287);ChatQueueEvents['on'](_0x5c69b1,_0x24981c);}};
\ No newline at end of file
index eb62ecf..2bb27ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5abb2a,_0x4aca47){var _0x4950dc=function(_0x336279){while(--_0x336279){_0x5abb2a['push'](_0x5abb2a['shift']());}};_0x4950dc(++_0x4aca47);}(_0xe14b,0x93));var _0xbe14=function(_0x25be08,_0x17b425){_0x25be08=_0x25be08-0x0;var _0x5b8d94=_0xe14b[_0x25be08];return _0x5b8d94;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _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(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0x5fc3[_0x1b1e76];return _0x3d743a;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
index 8bdd035..84bbf1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd689=['STRING','DATE','exports'];(function(_0x1e9e43,_0x4d84c5){var _0x3be730=function(_0x2dff27){while(--_0x2dff27){_0x1e9e43['push'](_0x1e9e43['shift']());}};_0x3be730(++_0x4d84c5);}(_0xd689,0x188));var _0x9d68=function(_0x455161,_0x520f10){_0x455161=_0x455161-0x0;var _0x3e7c03=_0xd689[_0x455161];return _0x3e7c03;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9d68('0x0')]={'uniqueid':{'type':Sequelize[_0x9d68('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x9d68('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9d68('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9d68('0x2')]},'reason':{'type':Sequelize[_0x9d68('0x1')]}};
\ No newline at end of file
+var _0x95d6=['DATE','sequelize','STRING'];(function(_0x464543,_0x471efe){var _0x3bbf98=function(_0x4c1dd4){while(--_0x4c1dd4){_0x464543['push'](_0x464543['shift']());}};_0x3bbf98(++_0x471efe);}(_0x95d6,0xdf));var _0x695d=function(_0xc4e2e3,_0x1db626){_0xc4e2e3=_0xc4e2e3-0x0;var _0x1fd956=_0x95d6[_0xc4e2e3];return _0x1fd956;};'use strict';var moment=require('moment');var Sequelize=require(_0x695d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x695d('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x695d('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x695d('0x2')]},'acceptAt':{'type':Sequelize[_0x695d('0x2')]},'exitAt':{'type':Sequelize[_0x695d('0x2')]},'reason':{'type':Sequelize[_0x695d('0x1')]}};
\ No newline at end of file
index ad64919..2f3696d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46c1=['limit','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset'];(function(_0x3d8d04,_0x51536b){var _0x43b01a=function(_0x330909){while(--_0x330909){_0x3d8d04['push'](_0x3d8d04['shift']());}};_0x43b01a(++_0x51536b);}(_0x46c1,0x7c));var _0x146c=function(_0x442281,_0x1fa0d6){_0x442281=_0x442281-0x0;var _0xde9648=_0x46c1[_0x442281];return _0xde9648;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x146c('0x0'));var zipdir=require(_0x146c('0x1'));var jsonpatch=require(_0x146c('0x2'));var rp=require(_0x146c('0x3'));var moment=require(_0x146c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x146c('0x5'));var util=require(_0x146c('0x6'));var path=require(_0x146c('0x7'));var sox=require(_0x146c('0x8'));var csv=require(_0x146c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x146c('0xa'));var squel=require(_0x146c('0xb'));var crypto=require(_0x146c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x146c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x146c('0xe'));var Papa=require(_0x146c('0xf'));var Redis=require('ioredis');var authService=require(_0x146c('0x10'));var qs=require(_0x146c('0x11'));var as=require(_0x146c('0x12'));var hardwareService=require(_0x146c('0x13'));var logger=require('../../config/logger')(_0x146c('0x14'));var utils=require('../../config/utils');var config=require(_0x146c('0x15'));var licenseUtil=require(_0x146c('0x16'));var db=require(_0x146c('0x17'))['db'];function respondWithStatusCode(_0x5c661e,_0xae68cf){_0xae68cf=_0xae68cf||0xcc;return function(_0x5921d3){if(_0x5921d3){return _0x5c661e[_0x146c('0x18')](_0xae68cf);}return _0x5c661e['status'](_0xae68cf)[_0x146c('0x19')]();};}function respondWithResult(_0x138063,_0xc9bd2d){_0xc9bd2d=_0xc9bd2d||0xc8;return function(_0x1cd513){if(_0x1cd513){return _0x138063['status'](_0xc9bd2d)[_0x146c('0x1a')](_0x1cd513);}};}function respondWithFilteredResult(_0xa535fd,_0x552524){return function(_0x25a3b3){if(_0x25a3b3){var _0x50bdae=typeof _0x552524['offset']===_0x146c('0x1b')&&typeof _0x552524['limit']===_0x146c('0x1b');var _0x1543f4=_0x25a3b3[_0x146c('0x1c')];var _0x4b1f21=_0x50bdae?0x0:_0x552524[_0x146c('0x1d')];var _0x22cd97=_0x50bdae?_0x25a3b3[_0x146c('0x1c')]:_0x552524[_0x146c('0x1d')]+_0x552524[_0x146c('0x1e')];var _0x3d469f;if(_0x22cd97>=_0x1543f4){_0x22cd97=_0x1543f4;_0x3d469f=0xc8;}else{_0x3d469f=0xce;}_0xa535fd[_0x146c('0x1f')](_0x3d469f);return _0xa535fd[_0x146c('0x20')](_0x146c('0x21'),_0x4b1f21+'-'+_0x22cd97+'/'+_0x1543f4)['json'](_0x25a3b3);}return null;};}function patchUpdates(_0x1b33f2){return function(_0x2c44b5){try{jsonpatch[_0x146c('0x22')](_0x2c44b5,_0x1b33f2,!![]);}catch(_0x8e7792){return BPromise[_0x146c('0x23')](_0x8e7792);}return _0x2c44b5['save']();};}function saveUpdates(_0x5b5ada,_0x1dfd0f){return function(_0x26f5ed){if(_0x26f5ed){return _0x26f5ed[_0x146c('0x24')](_0x5b5ada)[_0x146c('0x25')](function(_0x4c6d56){return _0x4c6d56;});}return null;};}function removeEntity(_0x41f2a2,_0x3ee8d7){return function(_0xbe3d5f){if(_0xbe3d5f){return _0xbe3d5f[_0x146c('0x26')]()[_0x146c('0x25')](function(){_0x41f2a2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1257ff,_0x3651b3){return function(_0x393e6c){if(!_0x393e6c){_0x1257ff[_0x146c('0x18')](0x194);}return _0x393e6c;};}function handleError(_0x4eef57,_0x33617e){_0x33617e=_0x33617e||0x1f4;return function(_0x2a3cde){logger[_0x146c('0x27')](_0x2a3cde[_0x146c('0x28')]);if(_0x2a3cde[_0x146c('0x29')]){delete _0x2a3cde[_0x146c('0x29')];}_0x4eef57[_0x146c('0x1f')](_0x33617e)[_0x146c('0x2a')](_0x2a3cde);};}exports[_0x146c('0x2b')]=function(_0x5158b2,_0x7c336b){var _0x566d90={},_0x5c44ef={},_0x3a88f9={'count':0x0,'rows':[]};var _0x46480c=_[_0x146c('0x2c')](db[_0x146c('0x2d')][_0x146c('0x2e')],function(_0x2e07e3){return{'name':_0x2e07e3[_0x146c('0x2f')],'type':_0x2e07e3[_0x146c('0x30')][_0x146c('0x31')]};});_0x5c44ef[_0x146c('0x32')]=_[_0x146c('0x2c')](_0x46480c,'name');_0x5c44ef[_0x146c('0x33')]=_[_0x146c('0x34')](_0x5158b2['query']);_0x5c44ef[_0x146c('0x35')]=_[_0x146c('0x36')](_0x5c44ef[_0x146c('0x32')],_0x5c44ef[_0x146c('0x33')]);_0x566d90[_0x146c('0x37')]=_['intersection'](_0x5c44ef['model'],qs[_0x146c('0x38')](_0x5158b2[_0x146c('0x33')][_0x146c('0x38')]));_0x566d90[_0x146c('0x37')]=_0x566d90[_0x146c('0x37')]['length']?_0x566d90[_0x146c('0x37')]:_0x5c44ef[_0x146c('0x32')];if(!_0x5158b2[_0x146c('0x33')][_0x146c('0x39')]('nolimit')){_0x566d90[_0x146c('0x1e')]=qs[_0x146c('0x1e')](_0x5158b2[_0x146c('0x33')][_0x146c('0x1e')]);_0x566d90[_0x146c('0x1d')]=qs[_0x146c('0x1d')](_0x5158b2[_0x146c('0x33')][_0x146c('0x1d')]);}_0x566d90[_0x146c('0x3a')]=qs[_0x146c('0x3b')](_0x5158b2[_0x146c('0x33')][_0x146c('0x3b')]);_0x566d90[_0x146c('0x3c')]=qs[_0x146c('0x35')](_[_0x146c('0x3d')](_0x5158b2[_0x146c('0x33')],_0x5c44ef['filters']),_0x46480c);if(_0x5158b2[_0x146c('0x33')]['filter']){_0x566d90[_0x146c('0x3c')]=_[_0x146c('0x3e')](_0x566d90['where'],{'$or':_[_0x146c('0x2c')](_0x46480c,function(_0x5dc288){if(_0x5dc288['type']!==_0x146c('0x3f')){var _0x2c998d={};_0x2c998d[_0x5dc288[_0x146c('0x29')]]={'$like':'%'+_0x5158b2[_0x146c('0x33')][_0x146c('0x40')]+'%'};return _0x2c998d;}})});}_0x566d90=_['merge']({},_0x566d90,_0x5158b2[_0x146c('0x41')]);var _0x3f3dcc={'where':_0x566d90['where']};return db[_0x146c('0x2d')][_0x146c('0x1c')](_0x3f3dcc)[_0x146c('0x25')](function(_0x2e6471){_0x3a88f9[_0x146c('0x1c')]=_0x2e6471;if(_0x5158b2[_0x146c('0x33')][_0x146c('0x42')]){_0x566d90[_0x146c('0x43')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x146c('0x44')](_0x566d90);})[_0x146c('0x25')](function(_0x1c8cbe){_0x3a88f9[_0x146c('0x45')]=_0x1c8cbe;return _0x3a88f9;})[_0x146c('0x25')](respondWithFilteredResult(_0x7c336b,_0x566d90))[_0x146c('0x46')](handleError(_0x7c336b,null));};exports[_0x146c('0x47')]=function(_0x1b188f,_0x1ca7cb){var _0x29149a={'raw':!![],'where':{'id':_0x1b188f[_0x146c('0x48')]['id']}},_0x58d7ec={};_0x58d7ec[_0x146c('0x32')]=_[_0x146c('0x34')](db['ChatQueueReport'][_0x146c('0x2e')]);_0x58d7ec[_0x146c('0x33')]=_[_0x146c('0x34')](_0x1b188f['query']);_0x58d7ec[_0x146c('0x35')]=_[_0x146c('0x36')](_0x58d7ec['model'],_0x58d7ec[_0x146c('0x33')]);_0x29149a[_0x146c('0x37')]=_[_0x146c('0x36')](_0x58d7ec[_0x146c('0x32')],qs[_0x146c('0x38')](_0x1b188f['query']['fields']));_0x29149a[_0x146c('0x37')]=_0x29149a['attributes'][_0x146c('0x49')]?_0x29149a[_0x146c('0x37')]:_0x58d7ec[_0x146c('0x32')];if(_0x1b188f['query'][_0x146c('0x42')]){_0x29149a[_0x146c('0x43')]=[{'all':!![]}];}_0x29149a=_[_0x146c('0x3e')]({},_0x29149a,_0x1b188f[_0x146c('0x41')]);return db[_0x146c('0x2d')]['find'](_0x29149a)['then'](handleEntityNotFound(_0x1ca7cb,null))[_0x146c('0x25')](respondWithResult(_0x1ca7cb,null))[_0x146c('0x46')](handleError(_0x1ca7cb,null));};exports[_0x146c('0x4a')]=function(_0x46398e,_0xc6b7be){return db[_0x146c('0x2d')]['create'](_0x46398e[_0x146c('0x4b')],{})['then'](respondWithResult(_0xc6b7be,0xc9))[_0x146c('0x46')](handleError(_0xc6b7be,null));};exports[_0x146c('0x24')]=function(_0x5a6e88,_0x58f581){if(_0x5a6e88[_0x146c('0x4b')]['id']){delete _0x5a6e88['body']['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x5a6e88[_0x146c('0x48')]['id']}})[_0x146c('0x25')](handleEntityNotFound(_0x58f581,null))[_0x146c('0x25')](saveUpdates(_0x5a6e88[_0x146c('0x4b')],null))['then'](respondWithResult(_0x58f581,null))[_0x146c('0x46')](handleError(_0x58f581,null));};exports[_0x146c('0x26')]=function(_0x4d80b2,_0x2aa597){return db[_0x146c('0x2d')][_0x146c('0x4c')]({'where':{'id':_0x4d80b2[_0x146c('0x48')]['id']}})[_0x146c('0x25')](handleEntityNotFound(_0x2aa597,null))[_0x146c('0x25')](removeEntity(_0x2aa597,null))[_0x146c('0x46')](handleError(_0x2aa597,null));};exports['describe']=function(_0x57c4e5,_0x52bf40){return db[_0x146c('0x2d')]['describe']()[_0x146c('0x25')](respondWithResult(_0x52bf40,null))[_0x146c('0x46')](handleError(_0x52bf40,null));};
\ No newline at end of file
+var _0x0650=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','rawAttributes','fieldName','key','model'];(function(_0x17cb83,_0x2eb2b5){var _0x4faaca=function(_0x19fa2e){while(--_0x19fa2e){_0x17cb83['push'](_0x17cb83['shift']());}};_0x4faaca(++_0x2eb2b5);}(_0x0650,0xed));var _0x0065=function(_0x12ac1f,_0x461a52){_0x12ac1f=_0x12ac1f-0x0;var _0x724467=_0x0650[_0x12ac1f];return _0x724467;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0065('0x1'));var jsonpatch=require(_0x0065('0x2'));var rp=require('request-promise');var moment=require(_0x0065('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0065('0x4'));var util=require(_0x0065('0x5'));var path=require(_0x0065('0x6'));var sox=require('sox');var csv=require(_0x0065('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0065('0x8'));var crypto=require(_0x0065('0x9'));var jsforce=require(_0x0065('0xa'));var deskjs=require(_0x0065('0xb'));var toCsv=require(_0x0065('0x7'));var querystring=require(_0x0065('0xc'));var Papa=require(_0x0065('0xd'));var Redis=require(_0x0065('0xe'));var authService=require(_0x0065('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0065('0x10'));var hardwareService=require(_0x0065('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0065('0x12'));var licenseUtil=require(_0x0065('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c7d1,_0x4255f6){_0x4255f6=_0x4255f6||0xcc;return function(_0x4c6296){if(_0x4c6296){return _0x45c7d1[_0x0065('0x14')](_0x4255f6);}return _0x45c7d1[_0x0065('0x15')](_0x4255f6)['end']();};}function respondWithResult(_0x5ae653,_0x1b9b1e){_0x1b9b1e=_0x1b9b1e||0xc8;return function(_0x5c0b74){if(_0x5c0b74){return _0x5ae653['status'](_0x1b9b1e)[_0x0065('0x16')](_0x5c0b74);}};}function respondWithFilteredResult(_0x5773d6,_0x38a870){return function(_0x48d817){if(_0x48d817){var _0x391fc1=typeof _0x38a870[_0x0065('0x17')]===_0x0065('0x18')&&typeof _0x38a870[_0x0065('0x19')]===_0x0065('0x18');var _0x34b0e2=_0x48d817[_0x0065('0x1a')];var _0x393d6e=_0x391fc1?0x0:_0x38a870['offset'];var _0x18bfa1=_0x391fc1?_0x48d817[_0x0065('0x1a')]:_0x38a870['offset']+_0x38a870[_0x0065('0x19')];var _0x3a0517;if(_0x18bfa1>=_0x34b0e2){_0x18bfa1=_0x34b0e2;_0x3a0517=0xc8;}else{_0x3a0517=0xce;}_0x5773d6[_0x0065('0x15')](_0x3a0517);return _0x5773d6[_0x0065('0x1b')](_0x0065('0x1c'),_0x393d6e+'-'+_0x18bfa1+'/'+_0x34b0e2)[_0x0065('0x16')](_0x48d817);}return null;};}function patchUpdates(_0x319e7a){return function(_0x529e30){try{jsonpatch['apply'](_0x529e30,_0x319e7a,!![]);}catch(_0x4b1213){return BPromise[_0x0065('0x1d')](_0x4b1213);}return _0x529e30[_0x0065('0x1e')]();};}function saveUpdates(_0x5b60c3,_0x2de3ae){return function(_0x5f1733){if(_0x5f1733){return _0x5f1733[_0x0065('0x1f')](_0x5b60c3)[_0x0065('0x20')](function(_0x3ec265){return _0x3ec265;});}return null;};}function removeEntity(_0x376452,_0x161b4c){return function(_0x1efa70){if(_0x1efa70){return _0x1efa70[_0x0065('0x21')]()['then'](function(){_0x376452[_0x0065('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4a4e,_0x3c715a){return function(_0x5924b3){if(!_0x5924b3){_0x4b4a4e[_0x0065('0x14')](0x194);}return _0x5924b3;};}function handleError(_0x6bf13b,_0x5db92c){_0x5db92c=_0x5db92c||0x1f4;return function(_0x123604){logger['error'](_0x123604['stack']);if(_0x123604[_0x0065('0x22')]){delete _0x123604[_0x0065('0x22')];}_0x6bf13b['status'](_0x5db92c)['send'](_0x123604);};}exports['index']=function(_0x51e091,_0x2e554f){var _0x1a977a={},_0x1f8813={},_0x369d08={'count':0x0,'rows':[]};var _0x4f15f5=_['map'](db['ChatQueueReport'][_0x0065('0x23')],function(_0x3a5286){return{'name':_0x3a5286[_0x0065('0x24')],'type':_0x3a5286['type'][_0x0065('0x25')]};});_0x1f8813[_0x0065('0x26')]=_['map'](_0x4f15f5,_0x0065('0x22'));_0x1f8813[_0x0065('0x27')]=_[_0x0065('0x28')](_0x51e091[_0x0065('0x27')]);_0x1f8813[_0x0065('0x29')]=_[_0x0065('0x2a')](_0x1f8813[_0x0065('0x26')],_0x1f8813[_0x0065('0x27')]);_0x1a977a['attributes']=_['intersection'](_0x1f8813['model'],qs[_0x0065('0x2b')](_0x51e091[_0x0065('0x27')][_0x0065('0x2b')]));_0x1a977a[_0x0065('0x2c')]=_0x1a977a[_0x0065('0x2c')][_0x0065('0x2d')]?_0x1a977a[_0x0065('0x2c')]:_0x1f8813['model'];if(!_0x51e091[_0x0065('0x27')][_0x0065('0x2e')](_0x0065('0x2f'))){_0x1a977a[_0x0065('0x19')]=qs[_0x0065('0x19')](_0x51e091['query'][_0x0065('0x19')]);_0x1a977a[_0x0065('0x17')]=qs[_0x0065('0x17')](_0x51e091[_0x0065('0x27')][_0x0065('0x17')]);}_0x1a977a[_0x0065('0x30')]=qs[_0x0065('0x31')](_0x51e091[_0x0065('0x27')][_0x0065('0x31')]);_0x1a977a[_0x0065('0x32')]=qs['filters'](_[_0x0065('0x33')](_0x51e091[_0x0065('0x27')],_0x1f8813[_0x0065('0x29')]),_0x4f15f5);if(_0x51e091['query'][_0x0065('0x34')]){_0x1a977a[_0x0065('0x32')]=_[_0x0065('0x35')](_0x1a977a[_0x0065('0x32')],{'$or':_[_0x0065('0x36')](_0x4f15f5,function(_0x231986){if(_0x231986['type']!==_0x0065('0x37')){var _0x2d1ba9={};_0x2d1ba9[_0x231986[_0x0065('0x22')]]={'$like':'%'+_0x51e091['query'][_0x0065('0x34')]+'%'};return _0x2d1ba9;}})});}_0x1a977a=_['merge']({},_0x1a977a,_0x51e091[_0x0065('0x38')]);var _0x37a434={'where':_0x1a977a['where']};return db[_0x0065('0x39')][_0x0065('0x1a')](_0x37a434)[_0x0065('0x20')](function(_0x3c1d6b){_0x369d08[_0x0065('0x1a')]=_0x3c1d6b;if(_0x51e091[_0x0065('0x27')]['includeAll']){_0x1a977a[_0x0065('0x3a')]=[{'all':!![]}];}return db[_0x0065('0x39')][_0x0065('0x3b')](_0x1a977a);})[_0x0065('0x20')](function(_0x1d251d){_0x369d08[_0x0065('0x3c')]=_0x1d251d;return _0x369d08;})[_0x0065('0x20')](respondWithFilteredResult(_0x2e554f,_0x1a977a))[_0x0065('0x3d')](handleError(_0x2e554f,null));};exports[_0x0065('0x3e')]=function(_0x41d6f7,_0x26cef9){var _0x32ab66={'raw':!![],'where':{'id':_0x41d6f7[_0x0065('0x3f')]['id']}},_0x35722d={};_0x35722d[_0x0065('0x26')]=_[_0x0065('0x28')](db[_0x0065('0x39')][_0x0065('0x23')]);_0x35722d[_0x0065('0x27')]=_[_0x0065('0x28')](_0x41d6f7[_0x0065('0x27')]);_0x35722d[_0x0065('0x29')]=_[_0x0065('0x2a')](_0x35722d['model'],_0x35722d[_0x0065('0x27')]);_0x32ab66['attributes']=_[_0x0065('0x2a')](_0x35722d['model'],qs[_0x0065('0x2b')](_0x41d6f7['query'][_0x0065('0x2b')]));_0x32ab66[_0x0065('0x2c')]=_0x32ab66[_0x0065('0x2c')]['length']?_0x32ab66['attributes']:_0x35722d[_0x0065('0x26')];if(_0x41d6f7[_0x0065('0x27')][_0x0065('0x40')]){_0x32ab66[_0x0065('0x3a')]=[{'all':!![]}];}_0x32ab66=_['merge']({},_0x32ab66,_0x41d6f7[_0x0065('0x38')]);return db[_0x0065('0x39')][_0x0065('0x41')](_0x32ab66)[_0x0065('0x20')](handleEntityNotFound(_0x26cef9,null))[_0x0065('0x20')](respondWithResult(_0x26cef9,null))['catch'](handleError(_0x26cef9,null));};exports[_0x0065('0x42')]=function(_0x5ef382,_0x339730){return db[_0x0065('0x39')][_0x0065('0x42')](_0x5ef382[_0x0065('0x43')],{})['then'](respondWithResult(_0x339730,0xc9))[_0x0065('0x3d')](handleError(_0x339730,null));};exports['update']=function(_0x86fa3d,_0x20b727){if(_0x86fa3d[_0x0065('0x43')]['id']){delete _0x86fa3d[_0x0065('0x43')]['id'];}return db[_0x0065('0x39')][_0x0065('0x41')]({'where':{'id':_0x86fa3d[_0x0065('0x3f')]['id']}})[_0x0065('0x20')](handleEntityNotFound(_0x20b727,null))[_0x0065('0x20')](saveUpdates(_0x86fa3d[_0x0065('0x43')],null))[_0x0065('0x20')](respondWithResult(_0x20b727,null))['catch'](handleError(_0x20b727,null));};exports[_0x0065('0x21')]=function(_0xcd7d13,_0x277b74){return db[_0x0065('0x39')][_0x0065('0x41')]({'where':{'id':_0xcd7d13[_0x0065('0x3f')]['id']}})[_0x0065('0x20')](handleEntityNotFound(_0x277b74,null))['then'](removeEntity(_0x277b74,null))['catch'](handleError(_0x277b74,null));};exports[_0x0065('0x44')]=function(_0x2da487,_0xf7e228){return db[_0x0065('0x39')][_0x0065('0x44')]()[_0x0065('0x20')](respondWithResult(_0xf7e228,null))[_0x0065('0x3d')](handleError(_0xf7e228,null));};
\ No newline at end of file
index 2b3948f..918653a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0xb10b,0x12a));var _0xbb10=function(_0x53286a,_0x485c92){_0x53286a=_0x53286a-0x0;var _0x5730ff=_0xb10b[_0x53286a];return _0x5730ff;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x295188,_0x55713e){var _0x534d04=function(_0x9d3a49){while(--_0x9d3a49){_0x295188['push'](_0x295188['shift']());}};_0x534d04(++_0x55713e);}(_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 fd4d729..6ddcee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1912=['CreateChatQueueReport','debug','update','attributes','UpdateChatQueueReport','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','ChatQueueReport','create','body','options','raw'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x1912,0x192));var _0x2191=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x1912[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x2191('0x0'));var util=require(_0x2191('0x1'));var moment=require(_0x2191('0x2'));var BPromise=require(_0x2191('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2191('0x4'));var db=require(_0x2191('0x5'))['db'];var utils=require(_0x2191('0x6'));var logger=require(_0x2191('0x7'))('rpc');var config=require(_0x2191('0x8'));var jayson=require(_0x2191('0x9'));var client=jayson[_0x2191('0xa')][_0x2191('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x539728,_0x1b27cf,_0x4f04d8){return new BPromise(function(_0x5a82f4,_0x3b91d6){return client[_0x2191('0xc')](_0x539728,_0x4f04d8)[_0x2191('0xd')](function(_0x1e0d15){logger[_0x2191('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x1b27cf,_0x2191('0xf'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x1b27cf,_0x2191('0xf'),JSON['stringify'](_0x1e0d15));if(_0x1e0d15[_0x2191('0x10')]){if(_0x1e0d15[_0x2191('0x10')][_0x2191('0x11')]===0x1f4){logger[_0x2191('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x1b27cf,_0x1e0d15[_0x2191('0x10')][_0x2191('0x12')]);return _0x3b91d6(_0x1e0d15[_0x2191('0x10')]['message']);}logger[_0x2191('0x10')](_0x2191('0x13'),_0x1b27cf,_0x1e0d15[_0x2191('0x10')][_0x2191('0x12')]);return _0x5a82f4(_0x1e0d15[_0x2191('0x10')]['message']);}else{logger[_0x2191('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x1b27cf,_0x2191('0xf'));_0x5a82f4(_0x1e0d15[_0x2191('0x14')]['message']);}})[_0x2191('0x15')](function(_0x2fc638){logger[_0x2191('0x10')](_0x2191('0x13'),_0x1b27cf,_0x2fc638);_0x3b91d6(_0x2fc638);});});}exports['CreateChatQueueReport']=function(_0x578dfa){var _0x4090e0=this;return new Promise(function(_0x37d320,_0x360ed2){return db[_0x2191('0x16')][_0x2191('0x17')](_0x578dfa[_0x2191('0x18')],{'raw':_0x578dfa[_0x2191('0x19')]?_0x578dfa[_0x2191('0x19')][_0x2191('0x1a')]===undefined?!![]:![]:!![]})[_0x2191('0xd')](function(_0x1d5b82){logger['info'](_0x2191('0x1b'),_0x578dfa);logger[_0x2191('0x1c')](_0x2191('0x1b'),_0x578dfa,JSON['stringify'](_0x1d5b82));_0x37d320(_0x1d5b82);})[_0x2191('0x15')](function(_0x1290cc){logger[_0x2191('0x10')](_0x2191('0x1b'),_0x1290cc[_0x2191('0x12')],_0x578dfa);_0x360ed2(_0x4090e0['error'](0x1f4,_0x1290cc[_0x2191('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x339905){var _0x386924=this;return new Promise(function(_0x2ffffc,_0x1ea581){return db[_0x2191('0x16')][_0x2191('0x1d')](_0x339905[_0x2191('0x18')],{'raw':_0x339905[_0x2191('0x19')]?_0x339905[_0x2191('0x19')][_0x2191('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339905[_0x2191('0x19')]?_0x339905[_0x2191('0x19')]['where']||null:null,'attributes':_0x339905[_0x2191('0x19')]?_0x339905[_0x2191('0x19')][_0x2191('0x1e')]||null:null,'limit':_0x339905['options']?_0x339905[_0x2191('0x19')]['limit']||null:null})['then'](function(_0x32a823){logger[_0x2191('0xe')](_0x2191('0x1f'),_0x339905);logger[_0x2191('0x1c')](_0x2191('0x1f'),_0x339905,JSON[_0x2191('0x20')](_0x32a823));_0x2ffffc(_0x32a823);})[_0x2191('0x15')](function(_0x552d73){logger[_0x2191('0x10')]('UpdateChatQueueReport',_0x552d73[_0x2191('0x12')],_0x339905);_0x1ea581(_0x386924[_0x2191('0x10')](0x1f4,_0x552d73[_0x2191('0x12')]));});});};
\ No newline at end of file
+var _0x7ff7=['UpdateChatQueueReport','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then'];(function(_0x4c7145,_0x2df4f8){var _0x13fe00=function(_0x2a5111){while(--_0x2a5111){_0x4c7145['push'](_0x4c7145['shift']());}};_0x13fe00(++_0x2df4f8);}(_0x7ff7,0xc2));var _0x77ff=function(_0x2630c9,_0x26bbbd){_0x2630c9=_0x2630c9-0x0;var _0x6f084c=_0x7ff7[_0x2630c9];return _0x6f084c;};'use strict';var _=require(_0x77ff('0x0'));var util=require(_0x77ff('0x1'));var moment=require(_0x77ff('0x2'));var BPromise=require(_0x77ff('0x3'));var rs=require(_0x77ff('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77ff('0x5'))['db'];var utils=require(_0x77ff('0x6'));var logger=require(_0x77ff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x77ff('0x8'));var client=jayson[_0x77ff('0x9')][_0x77ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x66c22e,_0xa33575,_0x3fbf4b){return new BPromise(function(_0x4a07ea,_0x1a7df4){return client[_0x77ff('0xb')](_0x66c22e,_0x3fbf4b)['then'](function(_0x13940f){logger[_0x77ff('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xa33575,_0x77ff('0xd'));logger[_0x77ff('0xe')](_0x77ff('0xf'),_0xa33575,_0x77ff('0xd'),JSON[_0x77ff('0x10')](_0x13940f));if(_0x13940f[_0x77ff('0x11')]){if(_0x13940f[_0x77ff('0x11')][_0x77ff('0x12')]===0x1f4){logger['error'](_0x77ff('0x13'),_0xa33575,_0x13940f[_0x77ff('0x11')][_0x77ff('0x14')]);return _0x1a7df4(_0x13940f[_0x77ff('0x11')][_0x77ff('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xa33575,_0x13940f[_0x77ff('0x11')][_0x77ff('0x14')]);return _0x4a07ea(_0x13940f[_0x77ff('0x11')][_0x77ff('0x14')]);}else{logger[_0x77ff('0xc')](_0x77ff('0x13'),_0xa33575,'request\x20sent');_0x4a07ea(_0x13940f[_0x77ff('0x15')][_0x77ff('0x14')]);}})[_0x77ff('0x16')](function(_0x177d84){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0xa33575,_0x177d84);_0x1a7df4(_0x177d84);});});}exports[_0x77ff('0x17')]=function(_0x135d0b){var _0x1d0ee6=this;return new Promise(function(_0x5d20ec,_0x5e42f3){return db[_0x77ff('0x18')][_0x77ff('0x19')](_0x135d0b[_0x77ff('0x1a')],{'raw':_0x135d0b[_0x77ff('0x1b')]?_0x135d0b['options'][_0x77ff('0x1c')]===undefined?!![]:![]:!![]})[_0x77ff('0x1d')](function(_0x37dbc2){logger[_0x77ff('0xc')]('CreateChatQueueReport',_0x135d0b);logger[_0x77ff('0xe')](_0x77ff('0x17'),_0x135d0b,JSON[_0x77ff('0x10')](_0x37dbc2));_0x5d20ec(_0x37dbc2);})[_0x77ff('0x16')](function(_0xd5a5ef){logger['error'](_0x77ff('0x17'),_0xd5a5ef[_0x77ff('0x14')],_0x135d0b);_0x5e42f3(_0x1d0ee6[_0x77ff('0x11')](0x1f4,_0xd5a5ef[_0x77ff('0x14')]));});});};exports[_0x77ff('0x1e')]=function(_0x343892){var _0x1bd962=this;return new Promise(function(_0x5a4e57,_0x557afb){return db[_0x77ff('0x18')]['update'](_0x343892['body'],{'raw':_0x343892[_0x77ff('0x1b')]?_0x343892[_0x77ff('0x1b')][_0x77ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x343892['options']?_0x343892[_0x77ff('0x1b')]['where']||null:null,'attributes':_0x343892[_0x77ff('0x1b')]?_0x343892[_0x77ff('0x1b')]['attributes']||null:null,'limit':_0x343892['options']?_0x343892['options'][_0x77ff('0x1f')]||null:null})[_0x77ff('0x1d')](function(_0x35b957){logger[_0x77ff('0xc')]('UpdateChatQueueReport',_0x343892);logger[_0x77ff('0xe')](_0x77ff('0x1e'),_0x343892,JSON[_0x77ff('0x10')](_0x35b957));_0x5a4e57(_0x35b957);})[_0x77ff('0x16')](function(_0x568fef){logger[_0x77ff('0x11')](_0x77ff('0x1e'),_0x568fef[_0x77ff('0x14')],_0x343892);_0x557afb(_0x1bd962[_0x77ff('0x11')](0x1f4,_0x568fef['message']));});});};
\ No newline at end of file
index 58e365c..fb15c87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4543=['show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','/describe','describe'];(function(_0x4b778a,_0x2a6d48){var _0x59562c=function(_0x322086){while(--_0x322086){_0x4b778a['push'](_0x4b778a['shift']());}};_0x59562c(++_0x2a6d48);}(_0x4543,0x12f));var _0x3454=function(_0x4916ca,_0x3d19c2){_0x4916ca=_0x4916ca-0x0;var _0x598fe8=_0x4543[_0x4916ca];return _0x598fe8;};'use strict';var multer=require(_0x3454('0x0'));var util=require('util');var path=require(_0x3454('0x1'));var timeout=require(_0x3454('0x2'));var express=require('express');var router=express[_0x3454('0x3')]();var fs_extra=require(_0x3454('0x4'));var auth=require(_0x3454('0x5'));var interaction=require(_0x3454('0x6'));var config=require(_0x3454('0x7'));var controller=require(_0x3454('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3454('0x9')](_0x3454('0xa'),auth['isAuthenticated'](),controller[_0x3454('0xb')]);router[_0x3454('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3454('0xc')]);router['post']('/',auth[_0x3454('0xd')](),controller[_0x3454('0xe')]);router[_0x3454('0xf')](_0x3454('0x10'),auth[_0x3454('0xd')](),controller[_0x3454('0x11')]);router[_0x3454('0x12')](_0x3454('0x10'),auth['isAuthenticated'](),controller[_0x3454('0x13')]);module[_0x3454('0x14')]=router;
\ No newline at end of file
+var _0xdae3=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout'];(function(_0x14e3db,_0x592f7c){var _0x28210f=function(_0x5d8951){while(--_0x5d8951){_0x14e3db['push'](_0x14e3db['shift']());}};_0x28210f(++_0x592f7c);}(_0xdae3,0x1dc));var _0x3dae=function(_0x7191bb,_0x4e6b7a){_0x7191bb=_0x7191bb-0x0;var _0x16e906=_0xdae3[_0x7191bb];return _0x16e906;};'use strict';var multer=require(_0x3dae('0x0'));var util=require(_0x3dae('0x1'));var path=require(_0x3dae('0x2'));var timeout=require(_0x3dae('0x3'));var express=require(_0x3dae('0x4'));var router=express['Router']();var fs_extra=require(_0x3dae('0x5'));var auth=require(_0x3dae('0x6'));var interaction=require(_0x3dae('0x7'));var config=require(_0x3dae('0x8'));var controller=require('./chatQueueReport.controller');router[_0x3dae('0x9')]('/',auth[_0x3dae('0xa')](),controller['index']);router[_0x3dae('0x9')](_0x3dae('0xb'),auth[_0x3dae('0xa')](),controller[_0x3dae('0xc')]);router[_0x3dae('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3dae('0xd')]);router[_0x3dae('0xe')]('/',auth[_0x3dae('0xa')](),controller[_0x3dae('0xf')]);router[_0x3dae('0x10')](_0x3dae('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x3dae('0x12')](_0x3dae('0x11'),auth[_0x3dae('0xa')](),controller[_0x3dae('0x13')]);module['exports']=router;
\ No newline at end of file
index 9f2eec3..e873fc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x42a2fd,_0x11002a){var _0xc7530=function(_0x22f4a4){while(--_0x22f4a4){_0x42a2fd['push'](_0x42a2fd['shift']());}};_0xc7530(++_0x11002a);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x00bb[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1cf8f3,_0x181a56){var _0x509cdf=function(_0x3a348d){while(--_0x3a348d){_0x1cf8f3['push'](_0x1cf8f3['shift']());}};_0x509cdf(++_0x181a56);}(_0xaa88,0x137));var _0x8aa8=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0xaa88[_0x485201];return _0x9ca98a;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
index d098cfe..279e8a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa927=['hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','ChatTransferReport','includeAll','include','findAll','rows','params','intersection','options','create','body','find','catch','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length'];(function(_0x59e537,_0x139c12){var _0x3b9cc6=function(_0x3a4640){while(--_0x3a4640){_0x59e537['push'](_0x59e537['shift']());}};_0x3b9cc6(++_0x139c12);}(_0xa927,0x187));var _0x7a92=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa927[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7a92('0x0'));var jsonpatch=require(_0x7a92('0x1'));var rp=require(_0x7a92('0x2'));var moment=require(_0x7a92('0x3'));var BPromise=require(_0x7a92('0x4'));var Mustache=require(_0x7a92('0x5'));var util=require(_0x7a92('0x6'));var path=require('path');var sox=require(_0x7a92('0x7'));var csv=require(_0x7a92('0x8'));var ejs=require(_0x7a92('0x9'));var fs=require('fs');var fs_extra=require(_0x7a92('0xa'));var _=require(_0x7a92('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a92('0xc'));var deskjs=require(_0x7a92('0xd'));var toCsv=require(_0x7a92('0x8'));var querystring=require(_0x7a92('0xe'));var Papa=require(_0x7a92('0xf'));var Redis=require(_0x7a92('0x10'));var authService=require(_0x7a92('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7a92('0x12'));var hardwareService=require(_0x7a92('0x13'));var logger=require('../../config/logger')(_0x7a92('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a92('0x15'));var db=require(_0x7a92('0x16'))['db'];function respondWithStatusCode(_0x1f0ffa,_0x4cc63d){_0x4cc63d=_0x4cc63d||0xcc;return function(_0x39bc9e){if(_0x39bc9e){return _0x1f0ffa[_0x7a92('0x17')](_0x4cc63d);}return _0x1f0ffa['status'](_0x4cc63d)[_0x7a92('0x18')]();};}function respondWithResult(_0x3a9ef3,_0x38deaf){_0x38deaf=_0x38deaf||0xc8;return function(_0x4b923d){if(_0x4b923d){return _0x3a9ef3['status'](_0x38deaf)[_0x7a92('0x19')](_0x4b923d);}};}function respondWithFilteredResult(_0x3bc595,_0x4a0e7e){return function(_0xa41a16){if(_0xa41a16){var _0x10dc58=typeof _0x4a0e7e[_0x7a92('0x1a')]===_0x7a92('0x1b')&&typeof _0x4a0e7e[_0x7a92('0x1c')]===_0x7a92('0x1b');var _0x87e348=_0xa41a16[_0x7a92('0x1d')];var _0x31e388=_0x10dc58?0x0:_0x4a0e7e[_0x7a92('0x1a')];var _0x53841e=_0x10dc58?_0xa41a16[_0x7a92('0x1d')]:_0x4a0e7e['offset']+_0x4a0e7e[_0x7a92('0x1c')];var _0x4722e4;if(_0x53841e>=_0x87e348){_0x53841e=_0x87e348;_0x4722e4=0xc8;}else{_0x4722e4=0xce;}_0x3bc595[_0x7a92('0x1e')](_0x4722e4);return _0x3bc595[_0x7a92('0x1f')]('Content-Range',_0x31e388+'-'+_0x53841e+'/'+_0x87e348)[_0x7a92('0x19')](_0xa41a16);}return null;};}function patchUpdates(_0x3be6c9){return function(_0x29e13e){try{jsonpatch[_0x7a92('0x20')](_0x29e13e,_0x3be6c9,!![]);}catch(_0x2ca60f){return BPromise[_0x7a92('0x21')](_0x2ca60f);}return _0x29e13e['save']();};}function saveUpdates(_0x5bb946,_0x2f93d9){return function(_0x40462f){if(_0x40462f){return _0x40462f[_0x7a92('0x22')](_0x5bb946)['then'](function(_0xf24776){return _0xf24776;});}return null;};}function removeEntity(_0x6328fd,_0x336658){return function(_0x414388){if(_0x414388){return _0x414388[_0x7a92('0x23')]()[_0x7a92('0x24')](function(){_0x6328fd[_0x7a92('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21829b,_0x1b5f05){return function(_0x555881){if(!_0x555881){_0x21829b[_0x7a92('0x17')](0x194);}return _0x555881;};}function handleError(_0x242b4e,_0x2b5efb){_0x2b5efb=_0x2b5efb||0x1f4;return function(_0x1e1aaf){logger[_0x7a92('0x25')](_0x1e1aaf[_0x7a92('0x26')]);if(_0x1e1aaf[_0x7a92('0x27')]){delete _0x1e1aaf[_0x7a92('0x27')];}_0x242b4e[_0x7a92('0x1e')](_0x2b5efb)[_0x7a92('0x28')](_0x1e1aaf);};}exports[_0x7a92('0x29')]=function(_0x4e874d,_0x5ce345){var _0x597b27={},_0x39b84b={},_0x27b64f={'count':0x0,'rows':[]};var _0x2a00cf=_[_0x7a92('0x2a')](db['ChatTransferReport'][_0x7a92('0x2b')],function(_0x2ecff7){return{'name':_0x2ecff7['fieldName'],'type':_0x2ecff7[_0x7a92('0x2c')][_0x7a92('0x2d')]};});_0x39b84b[_0x7a92('0x2e')]=_['map'](_0x2a00cf,'name');_0x39b84b[_0x7a92('0x2f')]=_[_0x7a92('0x30')](_0x4e874d[_0x7a92('0x2f')]);_0x39b84b[_0x7a92('0x31')]=_['intersection'](_0x39b84b[_0x7a92('0x2e')],_0x39b84b[_0x7a92('0x2f')]);_0x597b27[_0x7a92('0x32')]=_['intersection'](_0x39b84b[_0x7a92('0x2e')],qs[_0x7a92('0x33')](_0x4e874d[_0x7a92('0x2f')]['fields']));_0x597b27[_0x7a92('0x32')]=_0x597b27['attributes'][_0x7a92('0x34')]?_0x597b27['attributes']:_0x39b84b[_0x7a92('0x2e')];if(!_0x4e874d[_0x7a92('0x2f')][_0x7a92('0x35')](_0x7a92('0x36'))){_0x597b27['limit']=qs[_0x7a92('0x1c')](_0x4e874d[_0x7a92('0x2f')]['limit']);_0x597b27[_0x7a92('0x1a')]=qs[_0x7a92('0x1a')](_0x4e874d[_0x7a92('0x2f')][_0x7a92('0x1a')]);}_0x597b27[_0x7a92('0x37')]=qs['sort'](_0x4e874d[_0x7a92('0x2f')]['sort']);_0x597b27[_0x7a92('0x38')]=qs[_0x7a92('0x31')](_[_0x7a92('0x39')](_0x4e874d[_0x7a92('0x2f')],_0x39b84b['filters']),_0x2a00cf);if(_0x4e874d[_0x7a92('0x2f')][_0x7a92('0x3a')]){_0x597b27[_0x7a92('0x38')]=_['merge'](_0x597b27[_0x7a92('0x38')],{'$or':_[_0x7a92('0x2a')](_0x2a00cf,function(_0x223757){if(_0x223757[_0x7a92('0x2c')]!==_0x7a92('0x3b')){var _0x230c7f={};_0x230c7f[_0x223757[_0x7a92('0x27')]]={'$like':'%'+_0x4e874d[_0x7a92('0x2f')][_0x7a92('0x3a')]+'%'};return _0x230c7f;}})});}_0x597b27=_[_0x7a92('0x3c')]({},_0x597b27,_0x4e874d['options']);var _0x579460={'where':_0x597b27['where']};return db[_0x7a92('0x3d')]['count'](_0x579460)[_0x7a92('0x24')](function(_0x31732f){_0x27b64f[_0x7a92('0x1d')]=_0x31732f;if(_0x4e874d[_0x7a92('0x2f')][_0x7a92('0x3e')]){_0x597b27[_0x7a92('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x7a92('0x40')](_0x597b27);})[_0x7a92('0x24')](function(_0x54ae1d){_0x27b64f[_0x7a92('0x41')]=_0x54ae1d;return _0x27b64f;})[_0x7a92('0x24')](respondWithFilteredResult(_0x5ce345,_0x597b27))['catch'](handleError(_0x5ce345,null));};exports['show']=function(_0x4d102e,_0x18130e){var _0x28be63={'raw':!![],'where':{'id':_0x4d102e[_0x7a92('0x42')]['id']}},_0x47c203={};_0x47c203[_0x7a92('0x2e')]=_['keys'](db[_0x7a92('0x3d')][_0x7a92('0x2b')]);_0x47c203[_0x7a92('0x2f')]=_[_0x7a92('0x30')](_0x4d102e[_0x7a92('0x2f')]);_0x47c203['filters']=_[_0x7a92('0x43')](_0x47c203[_0x7a92('0x2e')],_0x47c203['query']);_0x28be63[_0x7a92('0x32')]=_['intersection'](_0x47c203[_0x7a92('0x2e')],qs['fields'](_0x4d102e['query'][_0x7a92('0x33')]));_0x28be63[_0x7a92('0x32')]=_0x28be63[_0x7a92('0x32')]['length']?_0x28be63[_0x7a92('0x32')]:_0x47c203[_0x7a92('0x2e')];if(_0x4d102e[_0x7a92('0x2f')][_0x7a92('0x3e')]){_0x28be63['include']=[{'all':!![]}];}_0x28be63=_['merge']({},_0x28be63,_0x4d102e[_0x7a92('0x44')]);return db[_0x7a92('0x3d')]['find'](_0x28be63)[_0x7a92('0x24')](handleEntityNotFound(_0x18130e,null))[_0x7a92('0x24')](respondWithResult(_0x18130e,null))['catch'](handleError(_0x18130e,null));};exports[_0x7a92('0x45')]=function(_0x1f1d8f,_0x225d93){return db[_0x7a92('0x3d')][_0x7a92('0x45')](_0x1f1d8f[_0x7a92('0x46')],{})[_0x7a92('0x24')](respondWithResult(_0x225d93,0xc9))['catch'](handleError(_0x225d93,null));};exports[_0x7a92('0x22')]=function(_0x85e8c9,_0x3d2a83){if(_0x85e8c9[_0x7a92('0x46')]['id']){delete _0x85e8c9[_0x7a92('0x46')]['id'];}return db[_0x7a92('0x3d')][_0x7a92('0x47')]({'where':{'id':_0x85e8c9['params']['id']}})['then'](handleEntityNotFound(_0x3d2a83,null))[_0x7a92('0x24')](saveUpdates(_0x85e8c9[_0x7a92('0x46')],null))[_0x7a92('0x24')](respondWithResult(_0x3d2a83,null))[_0x7a92('0x48')](handleError(_0x3d2a83,null));};exports['destroy']=function(_0xe111a9,_0x2b29bc){return db[_0x7a92('0x3d')][_0x7a92('0x47')]({'where':{'id':_0xe111a9[_0x7a92('0x42')]['id']}})[_0x7a92('0x24')](handleEntityNotFound(_0x2b29bc,null))[_0x7a92('0x24')](removeEntity(_0x2b29bc,null))[_0x7a92('0x48')](handleError(_0x2b29bc,null));};exports[_0x7a92('0x49')]=function(_0xef28b0,_0x3177c5){return db[_0x7a92('0x3d')][_0x7a92('0x49')]()[_0x7a92('0x24')](respondWithResult(_0x3177c5,null))[_0x7a92('0x48')](handleError(_0x3177c5,null));};
\ No newline at end of file
+var _0x3ee3=['order','sort','pick','filter','where','rows','show','params','fields','includeAll','include','merge','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3ee3,0xa4));var _0x33ee=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3ee3[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x33ee('0x0'));var rimraf=require(_0x33ee('0x1'));var zipdir=require(_0x33ee('0x2'));var jsonpatch=require(_0x33ee('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x33ee('0x4'));var util=require(_0x33ee('0x5'));var path=require(_0x33ee('0x6'));var sox=require(_0x33ee('0x7'));var csv=require(_0x33ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x33ee('0x9'));var squel=require(_0x33ee('0xa'));var crypto=require(_0x33ee('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x33ee('0x8'));var querystring=require('querystring');var Papa=require(_0x33ee('0xc'));var Redis=require(_0x33ee('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x33ee('0xe'));var as=require(_0x33ee('0xf'));var hardwareService=require(_0x33ee('0x10'));var logger=require(_0x33ee('0x11'))('api');var utils=require(_0x33ee('0x12'));var config=require(_0x33ee('0x13'));var licenseUtil=require(_0x33ee('0x14'));var db=require(_0x33ee('0x15'))['db'];function respondWithStatusCode(_0x3ca0b7,_0x889756){_0x889756=_0x889756||0xcc;return function(_0x41efc7){if(_0x41efc7){return _0x3ca0b7['sendStatus'](_0x889756);}return _0x3ca0b7[_0x33ee('0x16')](_0x889756)[_0x33ee('0x17')]();};}function respondWithResult(_0x259c66,_0x4f9821){_0x4f9821=_0x4f9821||0xc8;return function(_0x16917b){if(_0x16917b){return _0x259c66[_0x33ee('0x16')](_0x4f9821)[_0x33ee('0x18')](_0x16917b);}};}function respondWithFilteredResult(_0x1b0055,_0x210fcf){return function(_0x57e198){if(_0x57e198){var _0x10ef89=typeof _0x210fcf['offset']==='undefined'&&typeof _0x210fcf['limit']==='undefined';var _0x3d5a84=_0x57e198[_0x33ee('0x19')];var _0x335aea=_0x10ef89?0x0:_0x210fcf[_0x33ee('0x1a')];var _0x574077=_0x10ef89?_0x57e198[_0x33ee('0x19')]:_0x210fcf['offset']+_0x210fcf[_0x33ee('0x1b')];var _0x1d7df5;if(_0x574077>=_0x3d5a84){_0x574077=_0x3d5a84;_0x1d7df5=0xc8;}else{_0x1d7df5=0xce;}_0x1b0055[_0x33ee('0x16')](_0x1d7df5);return _0x1b0055[_0x33ee('0x1c')](_0x33ee('0x1d'),_0x335aea+'-'+_0x574077+'/'+_0x3d5a84)[_0x33ee('0x18')](_0x57e198);}return null;};}function patchUpdates(_0x24f3ad){return function(_0x155d89){try{jsonpatch['apply'](_0x155d89,_0x24f3ad,!![]);}catch(_0x446728){return BPromise[_0x33ee('0x1e')](_0x446728);}return _0x155d89[_0x33ee('0x1f')]();};}function saveUpdates(_0x263f77,_0x26dd83){return function(_0x3acdab){if(_0x3acdab){return _0x3acdab[_0x33ee('0x20')](_0x263f77)[_0x33ee('0x21')](function(_0x21f0c0){return _0x21f0c0;});}return null;};}function removeEntity(_0x3bdbc0,_0x559b31){return function(_0x3a1dce){if(_0x3a1dce){return _0x3a1dce[_0x33ee('0x22')]()[_0x33ee('0x21')](function(){_0x3bdbc0[_0x33ee('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x266f87,_0x52e938){return function(_0x5df709){if(!_0x5df709){_0x266f87[_0x33ee('0x23')](0x194);}return _0x5df709;};}function handleError(_0x462241,_0x9cf12e){_0x9cf12e=_0x9cf12e||0x1f4;return function(_0x4fffbe){logger[_0x33ee('0x24')](_0x4fffbe[_0x33ee('0x25')]);if(_0x4fffbe[_0x33ee('0x26')]){delete _0x4fffbe[_0x33ee('0x26')];}_0x462241['status'](_0x9cf12e)[_0x33ee('0x27')](_0x4fffbe);};}exports[_0x33ee('0x28')]=function(_0x3768b3,_0x343c74){var _0x5c48af={},_0x49f117={},_0x32349e={'count':0x0,'rows':[]};var _0x1c6ad9=_[_0x33ee('0x29')](db[_0x33ee('0x2a')][_0x33ee('0x2b')],function(_0x4c2243){return{'name':_0x4c2243[_0x33ee('0x2c')],'type':_0x4c2243[_0x33ee('0x2d')][_0x33ee('0x2e')]};});_0x49f117[_0x33ee('0x2f')]=_['map'](_0x1c6ad9,_0x33ee('0x26'));_0x49f117[_0x33ee('0x30')]=_[_0x33ee('0x31')](_0x3768b3[_0x33ee('0x30')]);_0x49f117[_0x33ee('0x32')]=_['intersection'](_0x49f117[_0x33ee('0x2f')],_0x49f117[_0x33ee('0x30')]);_0x5c48af['attributes']=_[_0x33ee('0x33')](_0x49f117[_0x33ee('0x2f')],qs['fields'](_0x3768b3[_0x33ee('0x30')]['fields']));_0x5c48af[_0x33ee('0x34')]=_0x5c48af[_0x33ee('0x34')][_0x33ee('0x35')]?_0x5c48af[_0x33ee('0x34')]:_0x49f117[_0x33ee('0x2f')];if(!_0x3768b3[_0x33ee('0x30')]['hasOwnProperty'](_0x33ee('0x36'))){_0x5c48af[_0x33ee('0x1b')]=qs['limit'](_0x3768b3[_0x33ee('0x30')][_0x33ee('0x1b')]);_0x5c48af[_0x33ee('0x1a')]=qs['offset'](_0x3768b3[_0x33ee('0x30')][_0x33ee('0x1a')]);}_0x5c48af[_0x33ee('0x37')]=qs[_0x33ee('0x38')](_0x3768b3[_0x33ee('0x30')][_0x33ee('0x38')]);_0x5c48af['where']=qs[_0x33ee('0x32')](_[_0x33ee('0x39')](_0x3768b3[_0x33ee('0x30')],_0x49f117[_0x33ee('0x32')]),_0x1c6ad9);if(_0x3768b3[_0x33ee('0x30')][_0x33ee('0x3a')]){_0x5c48af[_0x33ee('0x3b')]=_['merge'](_0x5c48af['where'],{'$or':_['map'](_0x1c6ad9,function(_0x3b7d48){if(_0x3b7d48[_0x33ee('0x2d')]!=='VIRTUAL'){var _0x38c13e={};_0x38c13e[_0x3b7d48[_0x33ee('0x26')]]={'$like':'%'+_0x3768b3[_0x33ee('0x30')]['filter']+'%'};return _0x38c13e;}})});}_0x5c48af=_['merge']({},_0x5c48af,_0x3768b3['options']);var _0x59e462={'where':_0x5c48af['where']};return db['ChatTransferReport'][_0x33ee('0x19')](_0x59e462)[_0x33ee('0x21')](function(_0x5ed86f){_0x32349e[_0x33ee('0x19')]=_0x5ed86f;if(_0x3768b3['query']['includeAll']){_0x5c48af['include']=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x5c48af);})['then'](function(_0x57236a){_0x32349e[_0x33ee('0x3c')]=_0x57236a;return _0x32349e;})[_0x33ee('0x21')](respondWithFilteredResult(_0x343c74,_0x5c48af))['catch'](handleError(_0x343c74,null));};exports[_0x33ee('0x3d')]=function(_0x4b0f61,_0x1cbcaa){var _0xd94375={'raw':!![],'where':{'id':_0x4b0f61[_0x33ee('0x3e')]['id']}},_0x332046={};_0x332046[_0x33ee('0x2f')]=_['keys'](db[_0x33ee('0x2a')][_0x33ee('0x2b')]);_0x332046[_0x33ee('0x30')]=_[_0x33ee('0x31')](_0x4b0f61[_0x33ee('0x30')]);_0x332046[_0x33ee('0x32')]=_[_0x33ee('0x33')](_0x332046[_0x33ee('0x2f')],_0x332046[_0x33ee('0x30')]);_0xd94375[_0x33ee('0x34')]=_[_0x33ee('0x33')](_0x332046['model'],qs[_0x33ee('0x3f')](_0x4b0f61[_0x33ee('0x30')][_0x33ee('0x3f')]));_0xd94375['attributes']=_0xd94375[_0x33ee('0x34')][_0x33ee('0x35')]?_0xd94375[_0x33ee('0x34')]:_0x332046[_0x33ee('0x2f')];if(_0x4b0f61[_0x33ee('0x30')][_0x33ee('0x40')]){_0xd94375[_0x33ee('0x41')]=[{'all':!![]}];}_0xd94375=_[_0x33ee('0x42')]({},_0xd94375,_0x4b0f61[_0x33ee('0x43')]);return db[_0x33ee('0x2a')][_0x33ee('0x44')](_0xd94375)['then'](handleEntityNotFound(_0x1cbcaa,null))[_0x33ee('0x21')](respondWithResult(_0x1cbcaa,null))[_0x33ee('0x45')](handleError(_0x1cbcaa,null));};exports[_0x33ee('0x46')]=function(_0x2a9dd2,_0xc35b7d){return db[_0x33ee('0x2a')]['create'](_0x2a9dd2[_0x33ee('0x47')],{})[_0x33ee('0x21')](respondWithResult(_0xc35b7d,0xc9))['catch'](handleError(_0xc35b7d,null));};exports[_0x33ee('0x20')]=function(_0x3798b8,_0x2cf061){if(_0x3798b8[_0x33ee('0x47')]['id']){delete _0x3798b8[_0x33ee('0x47')]['id'];}return db[_0x33ee('0x2a')][_0x33ee('0x44')]({'where':{'id':_0x3798b8[_0x33ee('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2cf061,null))['then'](saveUpdates(_0x3798b8[_0x33ee('0x47')],null))[_0x33ee('0x21')](respondWithResult(_0x2cf061,null))[_0x33ee('0x45')](handleError(_0x2cf061,null));};exports['destroy']=function(_0x359e55,_0x515889){return db['ChatTransferReport']['find']({'where':{'id':_0x359e55[_0x33ee('0x3e')]['id']}})[_0x33ee('0x21')](handleEntityNotFound(_0x515889,null))[_0x33ee('0x21')](removeEntity(_0x515889,null))['catch'](handleError(_0x515889,null));};exports[_0x33ee('0x48')]=function(_0x5a847f,_0x386969){return db[_0x33ee('0x2a')]['describe']()[_0x33ee('0x21')](respondWithResult(_0x386969,null))['catch'](handleError(_0x386969,null));};
\ No newline at end of file
index 6f9c9f6..c7f127f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8886=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0xfd7cb3,_0x7f7744){var _0x4a7f70=function(_0x27bf82){while(--_0x27bf82){_0xfd7cb3['push'](_0xfd7cb3['shift']());}};_0x4a7f70(++_0x7f7744);}(_0x8886,0x9a));var _0x6888=function(_0x426095,_0x2357f0){_0x426095=_0x426095-0x0;var _0x383d44=_0x8886[_0x426095];return _0x383d44;};'use strict';var _=require(_0x6888('0x0'));var util=require(_0x6888('0x1'));var logger=require('../../config/logger')(_0x6888('0x2'));var moment=require(_0x6888('0x3'));var BPromise=require(_0x6888('0x4'));var rp=require(_0x6888('0x5'));var fs=require('fs');var path=require(_0x6888('0x6'));var rimraf=require(_0x6888('0x7'));var config=require(_0x6888('0x8'));var attributes=require(_0x6888('0x9'));module[_0x6888('0xa')]=function(_0x216f40,_0x1b2e69){return _0x216f40[_0x6888('0xb')](_0x6888('0xc'),attributes,{'tableName':_0x6888('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x6888('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb775=['request-promise','path','rimraf','./chatTransferReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x40d60f,_0xd46fad){var _0x51afce=function(_0x2ebb78){while(--_0x2ebb78){_0x40d60f['push'](_0x40d60f['shift']());}};_0x51afce(++_0xd46fad);}(_0xb775,0x166));var _0x5b77=function(_0x4b973a,_0x472e35){_0x4b973a=_0x4b973a-0x0;var _0x4eb73d=_0xb775[_0x4b973a];return _0x4eb73d;};'use strict';var _=require(_0x5b77('0x0'));var util=require(_0x5b77('0x1'));var logger=require(_0x5b77('0x2'))(_0x5b77('0x3'));var moment=require('moment');var BPromise=require(_0x5b77('0x4'));var rp=require(_0x5b77('0x5'));var fs=require('fs');var path=require(_0x5b77('0x6'));var rimraf=require(_0x5b77('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b77('0x8'));module['exports']=function(_0x5bcd96,_0x99a824){return _0x5bcd96[_0x5b77('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x5b77('0xa'),'fields':[_0x5b77('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 974472c..aea8877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1284=['request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x1284,0xa2));var _0x4128=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0x1284[_0x3b9d5f];return _0x39924e;};'use strict';var _=require(_0x4128('0x0'));var util=require('util');var moment=require(_0x4128('0x1'));var BPromise=require('bluebird');var rs=require(_0x4128('0x2'));var fs=require('fs');var Redis=require(_0x4128('0x3'));var db=require(_0x4128('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4128('0x5'));var config=require(_0x4128('0x6'));var jayson=require(_0x4128('0x7'));var client=jayson['client'][_0x4128('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e5a98,_0x44202e,_0x22be57){return new BPromise(function(_0x32b69d,_0x474067){return client[_0x4128('0x9')](_0x5e5a98,_0x22be57)[_0x4128('0xa')](function(_0x2a611b){logger[_0x4128('0xb')](_0x4128('0xc'),_0x44202e,_0x4128('0xd'));logger['debug'](_0x4128('0xe'),_0x44202e,_0x4128('0xd'),JSON['stringify'](_0x2a611b));if(_0x2a611b[_0x4128('0xf')]){if(_0x2a611b['error']['code']===0x1f4){logger['error'](_0x4128('0xc'),_0x44202e,_0x2a611b['error'][_0x4128('0x10')]);return _0x474067(_0x2a611b[_0x4128('0xf')][_0x4128('0x10')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x44202e,_0x2a611b['error'][_0x4128('0x10')]);return _0x32b69d(_0x2a611b[_0x4128('0xf')][_0x4128('0x10')]);}else{logger[_0x4128('0xb')](_0x4128('0xc'),_0x44202e,_0x4128('0xd'));_0x32b69d(_0x2a611b[_0x4128('0x11')][_0x4128('0x10')]);}})[_0x4128('0x12')](function(_0x6341ca){logger[_0x4128('0xf')](_0x4128('0xc'),_0x44202e,_0x6341ca);_0x474067(_0x6341ca);});});}
\ No newline at end of file
+var _0x365f=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0x57ec1a,_0x2b7624){var _0x2159ad=function(_0x4738b4){while(--_0x4738b4){_0x57ec1a['push'](_0x57ec1a['shift']());}};_0x2159ad(++_0x2b7624);}(_0x365f,0x11f));var _0xf365=function(_0x1aaaba,_0x23a707){_0x1aaaba=_0x1aaaba-0x0;var _0xa6d4fa=_0x365f[_0x1aaaba];return _0xa6d4fa;};'use strict';var _=require(_0xf365('0x0'));var util=require(_0xf365('0x1'));var moment=require(_0xf365('0x2'));var BPromise=require(_0xf365('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf365('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf365('0x5'));var logger=require(_0xf365('0x6'))('rpc');var config=require(_0xf365('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf365('0x8')][_0xf365('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1eec52,_0x31b674,_0x1b4008){return new BPromise(function(_0x5d8839,_0x310567){return client[_0xf365('0xa')](_0x1eec52,_0x1b4008)['then'](function(_0x25ff1c){logger[_0xf365('0xb')](_0xf365('0xc'),_0x31b674,_0xf365('0xd'));logger[_0xf365('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x31b674,_0xf365('0xd'),JSON[_0xf365('0xf')](_0x25ff1c));if(_0x25ff1c[_0xf365('0x10')]){if(_0x25ff1c[_0xf365('0x10')][_0xf365('0x11')]===0x1f4){logger[_0xf365('0x10')](_0xf365('0xc'),_0x31b674,_0x25ff1c['error'][_0xf365('0x12')]);return _0x310567(_0x25ff1c['error'][_0xf365('0x12')]);}logger[_0xf365('0x10')](_0xf365('0xc'),_0x31b674,_0x25ff1c[_0xf365('0x10')][_0xf365('0x12')]);return _0x5d8839(_0x25ff1c['error'][_0xf365('0x12')]);}else{logger[_0xf365('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x31b674,_0xf365('0xd'));_0x5d8839(_0x25ff1c[_0xf365('0x13')][_0xf365('0x12')]);}})['catch'](function(_0x9dac31){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x31b674,_0x9dac31);_0x310567(_0x9dac31);});});}
\ No newline at end of file
index c744219..7e99a4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba5a=['isAuthenticated','/describe','describe','show','post','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x2407bd,_0x2efde4){var _0x470f2=function(_0x40f617){while(--_0x40f617){_0x2407bd['push'](_0x2407bd['shift']());}};_0x470f2(++_0x2efde4);}(_0xba5a,0x171));var _0xaba5=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0xba5a[_0x21b359];return _0x57b8e7;};'use strict';var multer=require(_0xaba5('0x0'));var util=require('util');var path=require(_0xaba5('0x1'));var timeout=require(_0xaba5('0x2'));var express=require(_0xaba5('0x3'));var router=express[_0xaba5('0x4')]();var fs_extra=require(_0xaba5('0x5'));var auth=require(_0xaba5('0x6'));var interaction=require(_0xaba5('0x7'));var config=require(_0xaba5('0x8'));var controller=require(_0xaba5('0x9'));router[_0xaba5('0xa')]('/',auth[_0xaba5('0xb')](),controller['index']);router[_0xaba5('0xa')](_0xaba5('0xc'),auth[_0xaba5('0xb')](),controller[_0xaba5('0xd')]);router[_0xaba5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xaba5('0xe')]);router[_0xaba5('0xf')]('/',auth[_0xaba5('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaba5('0x10')]);router[_0xaba5('0x11')]('/:id',auth[_0xaba5('0xb')](),controller['destroy']);module[_0xaba5('0x12')]=router;
\ No newline at end of file
+var _0x99d9=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','create','put','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x99d9,0x121));var _0x999d=function(_0x178ced,_0x52eeef){_0x178ced=_0x178ced-0x0;var _0x473885=_0x99d9[_0x178ced];return _0x473885;};'use strict';var multer=require(_0x999d('0x0'));var util=require(_0x999d('0x1'));var path=require(_0x999d('0x2'));var timeout=require(_0x999d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x999d('0x4'));var auth=require(_0x999d('0x5'));var interaction=require(_0x999d('0x6'));var config=require(_0x999d('0x7'));var controller=require(_0x999d('0x8'));router[_0x999d('0x9')]('/',auth[_0x999d('0xa')](),controller[_0x999d('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x999d('0xc')]);router[_0x999d('0x9')](_0x999d('0xd'),auth[_0x999d('0xa')](),controller['show']);router['post']('/',auth[_0x999d('0xa')](),controller[_0x999d('0xe')]);router[_0x999d('0xf')](_0x999d('0xd'),auth[_0x999d('0xa')](),controller['update']);router['delete']('/:id',auth[_0x999d('0xa')](),controller['destroy']);module[_0x999d('0x10')]=router;
\ No newline at end of file
index 9a417f8..50ccb78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa53b=['rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','thumb','star','stringify','input','name','getDataValue','onlineForm','textarea','Leave\x20your\x20comments','offlineForm','parse','setDataValue','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x39df08,_0x242920){var _0x2ea2e2=function(_0x4863db){while(--_0x4863db){_0x39df08['push'](_0x39df08['shift']());}};_0x2ea2e2(++_0x242920);}(_0xa53b,0xaf));var _0xba53=function(_0x1c3a65,_0x321ac0){_0x1c3a65=_0x1c3a65-0x0;var _0x2eb9d0=_0xa53b[_0x1c3a65];return _0x2eb9d0;};'use strict';var Sequelize=require(_0xba53('0x0'));var rs=require(_0xba53('0x1'));module[_0xba53('0x2')]={'name':{'type':Sequelize[_0xba53('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xba53('0x3')]},'mapKey':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xba53('0x5')},'customerAlias':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba53('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xba53('0x3')],'allowNull':![],'defaultValue':_0xba53('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba53('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xba53('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xba53('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xba53('0x9'),_0xba53('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0xb')},'offline_chat_button':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0xc')},'header_offline':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xba53('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xba53('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xba53('0xf')]},'closingQuestion':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x11')},'noteTitle':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xba53('0x13')},'closingMessage':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x14')},'closingMessageButton':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0xc')},'skipMessageButton':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x16')},'ratingType':{'type':Sequelize[_0xba53('0x17')]('star',_0xba53('0x18')),'defaultValue':_0xba53('0x19')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xba53('0xf')],'defaultValue':function(){return JSON[_0xba53('0x1a')]({'items':[{'type':_0xba53('0x1b'),'variable':null,'config':{'placeholder':_0xba53('0x1c'),'type':'text','required':!![]},'props':{'title':_0xba53('0x1c'),'helpText':''}},{'type':_0xba53('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xba53('0x4'),'type':_0xba53('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this[_0xba53('0x1d')](_0xba53('0x1e'))):{};},'set':function(_0x57a7dd){return this['setDataValue']('onlineForm',JSON[_0xba53('0x1a')](_0x57a7dd));}},'offlineForm':{'type':Sequelize[_0xba53('0xf')],'defaultValue':function(){return JSON[_0xba53('0x1a')]({'items':[{'type':_0xba53('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xba53('0x4'),'type':_0xba53('0x4')},'variable':null},{'type':_0xba53('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0xba53('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xba53('0x1d')](_0xba53('0x21'))?JSON[_0xba53('0x22')](this['getDataValue'](_0xba53('0x21'))):{};},'set':function(_0x38e1f1){return this[_0xba53('0x23')](_0xba53('0x21'),JSON['stringify'](_0x38e1f1));}},'token':{'type':Sequelize[_0xba53('0x3')],'defaultValue':function(){return rs[_0xba53('0x24')]();}},'autoclose':{'type':Sequelize[_0xba53('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xba53('0x3')]},'forwardOffline':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xba53('0x3')]},'waitingTitle':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xba53('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xba53('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xba53('0xf')],'defaultValue':function(){return _0xba53('0x27');}},'notificationSound':{'type':Sequelize[_0xba53('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xba53('0x3')],'defaultValue':_0xba53('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xba53('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xba53('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xba53('0x3')]},'customerAvatar':{'type':Sequelize[_0xba53('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xba53('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xba53('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xba53('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xba53('0x8')],'comment':_0xba53('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![],'comment':_0xba53('0x2a'),'set':function(_0x3c7608){if(!_0x3c7608)this[_0xba53('0x23')](_0xba53('0x2b'),null);this['setDataValue']('mandatoryDisposition',_0x3c7608);}},'vidaooEscalation':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xba53('0x3')]},'vidaooTopic':{'type':Sequelize[_0xba53('0x3')],'allowNull':![],'defaultValue':_0xba53('0x2c')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xba53('0x2d');}},'vidaooMetadata':{'type':Sequelize[_0xba53('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xba53('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xba53('0xf')]}};
\ No newline at end of file
+var _0xd40b=['Comments','Leave\x20your\x20comments','offlineForm','getDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','squared','Chat','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','thumb','stringify','input','text','onlineForm','setDataValue','textarea'];(function(_0x547bed,_0x2a47a8){var _0x1945e5=function(_0x249f7b){while(--_0x249f7b){_0x547bed['push'](_0x547bed['shift']());}};_0x1945e5(++_0x2a47a8);}(_0xd40b,0xb1));var _0xbd40=function(_0x1a7206,_0x160df3){_0x1a7206=_0x1a7206-0x0;var _0x2d34fc=_0xd40b[_0x1a7206];return _0x2d34fc;};'use strict';var Sequelize=require(_0xbd40('0x0'));var rs=require(_0xbd40('0x1'));module[_0xbd40('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xbd40('0x3')],'allowNull':![],'unique':_0xbd40('0x4')},'description':{'type':Sequelize[_0xbd40('0x3')]},'mapKey':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x5')},'mapKeyOffline':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x5')},'key':{'type':Sequelize[_0xbd40('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbd40('0x3')],'allowNull':![],'defaultValue':_0xbd40('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbd40('0x3')],'allowNull':![],'defaultValue':_0xbd40('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbd40('0x3')],'allowNull':![],'defaultValue':_0xbd40('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbd40('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbd40('0x3')]},'animation':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbd40('0xa')]('rounded',_0xbd40('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0xc')},'offline_chat_button':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbd40('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0xd')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbd40('0xe')]},'closingQuestion':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0xf')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbd40('0x10')},'noteTitle':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x11')},'placeholderMessage':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x12')},'closingMessage':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x13')},'closingMessageButton':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x14')},'skipMessageButton':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x15')},'conditionAgreement':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0xbd40('0x17'),_0xbd40('0x18')),'defaultValue':_0xbd40('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xbd40('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbd40('0xe')],'defaultValue':function(){return JSON[_0xbd40('0x19')]({'items':[{'type':_0xbd40('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0xbd40('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xbd40('0x1a'),'props':{'title':_0xbd40('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xbd40('0x5'),'type':_0xbd40('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue'](_0xbd40('0x1c'))):{};},'set':function(_0x1e810a){return this[_0xbd40('0x1d')](_0xbd40('0x1c'),JSON[_0xbd40('0x19')](_0x1e810a));}},'offlineForm':{'type':Sequelize[_0xbd40('0xe')],'defaultValue':function(){return JSON[_0xbd40('0x19')]({'items':[{'type':_0xbd40('0x1a'),'props':{'title':_0xbd40('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xbd40('0x5')},'variable':null},{'type':_0xbd40('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0xbd40('0x1f'),'helpText':_0xbd40('0x20')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xbd40('0x21'))?JSON['parse'](this[_0xbd40('0x22')]('offlineForm')):{};},'set':function(_0x278233){return this[_0xbd40('0x1d')](_0xbd40('0x21'),JSON[_0xbd40('0x19')](_0x278233));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbd40('0x23')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbd40('0x3')]},'forwardOffline':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbd40('0x3')]},'waitingTitle':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbd40('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xbd40('0x26')},'offlineMessageBody':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x28')},'skipUnmanaged':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x15')},'sendUnmanaged':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbd40('0x3')]},'notificationTemplate':{'type':Sequelize[_0xbd40('0xe')],'defaultValue':function(){return _0xbd40('0x29');}},'notificationSound':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0xbd40('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x2b')},'verticalAlignment':{'type':Sequelize[_0xbd40('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x2c')},'defaultTitle':{'type':Sequelize[_0xbd40('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbd40('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbd40('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbd40('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbd40('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':_0xbd40('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbd40('0x8')],'comment':_0xbd40('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![],'comment':_0xbd40('0x30'),'set':function(_0x42ab77){if(!_0x42ab77)this[_0xbd40('0x1d')](_0xbd40('0x31'),null);this[_0xbd40('0x1d')]('mandatoryDisposition',_0x42ab77);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xbd40('0x3')],'allowNull':![],'defaultValue':_0xbd40('0x32')},'vidaooNote':{'type':Sequelize[_0xbd40('0x3')],'defaultValue':function(){return _0xbd40('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xbd40('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbd40('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 39fb9e7..d204977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdf1=['%s\x20%s','version','device','vendor','format','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','Tag','Tags','color','tag','Command','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','virtual','increment','Intervals','push','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','referer','alignment','verticalAlignment','textColor','backgroundColor','addApplications','sequelize','transaction','ChatApplication','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','onlineForm','items','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','end','offset','undefined','count','limit','set','json','apply','reject','save','get','ChatWebsites','UserProfileResource','destroy','status','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','type','key','keys','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','attributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','Disposition','getDispositions','findOne','rawAttributes','ChatWebsiteId','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','getResult','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','list','orderBy','applications','priority','asc','ListId','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','x-real-port','browser','unknown'];(function(_0x29cd6a,_0x409b11){var _0x545b22=function(_0x2ef6eb){while(--_0x2ef6eb){_0x29cd6a['push'](_0x29cd6a['shift']());}};_0x545b22(++_0x409b11);}(_0xbdf1,0x86));var _0x1bdf=function(_0x46f016,_0x1821f3){_0x46f016=_0x46f016-0x0;var _0x482fe1=_0xbdf1[_0x46f016];return _0x482fe1;};'use strict';var emlformat=require(_0x1bdf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bdf('0x1'));var jsonpatch=require(_0x1bdf('0x2'));var rp=require(_0x1bdf('0x3'));var moment=require(_0x1bdf('0x4'));var BPromise=require(_0x1bdf('0x5'));var Mustache=require(_0x1bdf('0x6'));var util=require(_0x1bdf('0x7'));var path=require('path');var sox=require(_0x1bdf('0x8'));var csv=require(_0x1bdf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bdf('0xa'));var _=require(_0x1bdf('0xb'));var squel=require(_0x1bdf('0xc'));var crypto=require(_0x1bdf('0xd'));var jsforce=require(_0x1bdf('0xe'));var deskjs=require(_0x1bdf('0xf'));var toCsv=require(_0x1bdf('0x9'));var querystring=require('querystring');var Papa=require(_0x1bdf('0x10'));var Redis=require(_0x1bdf('0x11'));var authService=require(_0x1bdf('0x12'));var qs=require(_0x1bdf('0x13'));var as=require(_0x1bdf('0x14'));var hardwareService=require(_0x1bdf('0x15'));var logger=require(_0x1bdf('0x16'))(_0x1bdf('0x17'));var utils=require('../../config/utils');var config=require(_0x1bdf('0x18'));var licenseUtil=require(_0x1bdf('0x19'));var db=require(_0x1bdf('0x1a'))['db'];config[_0x1bdf('0x1b')]=_[_0x1bdf('0x1c')](config[_0x1bdf('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x1bdf('0x1d'))(new Redis(config['redis']));require(_0x1bdf('0x1e'))['register'](socket);var jayson=require(_0x1bdf('0x1f'));var client=jayson[_0x1bdf('0x20')][_0x1bdf('0x21')]({'port':0x232c});var client9002=jayson[_0x1bdf('0x20')][_0x1bdf('0x21')]({'port':0x232a});var client9003=jayson[_0x1bdf('0x20')][_0x1bdf('0x21')]({'port':0x232b});var client9001=jayson['client'][_0x1bdf('0x21')]({'port':0x2329});function respondWithRpcPromise(_0x3b2cf2,_0x54a504,_0x25d7dc,_0x2c22f8){return new BPromise(function(_0x4fe0c9,_0x2d7d6f){var _0xbd7108=_0x2c22f8||client;return _0xbd7108[_0x1bdf('0x22')](_0x3b2cf2,_0x25d7dc)[_0x1bdf('0x23')](function(_0x291680){logger['info'](_0x1bdf('0x24'),_0x54a504,_0x1bdf('0x25'));logger[_0x1bdf('0x26')](_0x1bdf('0x27'),_0x54a504,_0x1bdf('0x25'),JSON['stringify'](_0x291680));if(_0x291680['error']){if(_0x291680['error'][_0x1bdf('0x28')]===0x1f4){logger['error'](_0x1bdf('0x24'),_0x54a504,_0x291680[_0x1bdf('0x29')][_0x1bdf('0x2a')]);return _0x2d7d6f(_0x291680[_0x1bdf('0x29')][_0x1bdf('0x2a')]);}logger[_0x1bdf('0x29')](_0x1bdf('0x24'),_0x54a504,_0x291680[_0x1bdf('0x29')][_0x1bdf('0x2a')]);return _0x4fe0c9(_0x291680[_0x1bdf('0x29')][_0x1bdf('0x2a')]);}else{logger[_0x1bdf('0x2b')](_0x1bdf('0x24'),_0x54a504,'request\x20sent');_0x4fe0c9(_0x291680[_0x1bdf('0x2c')][_0x1bdf('0x2a')]);}})[_0x1bdf('0x2d')](function(_0x392344){logger[_0x1bdf('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x54a504,_0x392344);_0x2d7d6f(_0x392344);});});}function respondWithStatusCode(_0x37a83b,_0xece76d){_0xece76d=_0xece76d||0xcc;return function(_0x330451){if(_0x330451){return _0x37a83b['sendStatus'](_0xece76d);}return _0x37a83b['status'](_0xece76d)[_0x1bdf('0x2e')]();};}function respondWithResult(_0x481237,_0x4160be){_0x4160be=_0x4160be||0xc8;return function(_0x54efad){if(_0x54efad){return _0x481237['status'](_0x4160be)['json'](_0x54efad);}};}function respondWithFilteredResult(_0x55b021,_0x3cd522){return function(_0x47473a){if(_0x47473a){var _0x10a8aa=typeof _0x3cd522[_0x1bdf('0x2f')]==='undefined'&&typeof _0x3cd522['limit']===_0x1bdf('0x30');var _0x2dec06=_0x47473a['count'];var _0x126f03=_0x10a8aa?0x0:_0x3cd522[_0x1bdf('0x2f')];var _0x1f49af=_0x10a8aa?_0x47473a[_0x1bdf('0x31')]:_0x3cd522['offset']+_0x3cd522[_0x1bdf('0x32')];var _0x5303b9;if(_0x1f49af>=_0x2dec06){_0x1f49af=_0x2dec06;_0x5303b9=0xc8;}else{_0x5303b9=0xce;}_0x55b021['status'](_0x5303b9);return _0x55b021[_0x1bdf('0x33')]('Content-Range',_0x126f03+'-'+_0x1f49af+'/'+_0x2dec06)[_0x1bdf('0x34')](_0x47473a);}return null;};}function patchUpdates(_0x148946){return function(_0x25e054){try{jsonpatch[_0x1bdf('0x35')](_0x25e054,_0x148946,!![]);}catch(_0x1f026b){return BPromise[_0x1bdf('0x36')](_0x1f026b);}return _0x25e054[_0x1bdf('0x37')]();};}function saveUpdates(_0x3686d4,_0x53128c){return function(_0x21dda2){if(_0x21dda2){return _0x21dda2['update'](_0x3686d4)[_0x1bdf('0x23')](function(_0x28fe43){return _0x28fe43;});}return null;};}function removeEntity(_0xe30619,_0x5583db){return function(_0x939bbf){if(_0x939bbf){return _0x939bbf['destroy']()[_0x1bdf('0x23')](function(){var _0x331e01=_0x939bbf[_0x1bdf('0x38')]({'plain':!![]});var _0x1ab629=_0x1bdf('0x39');return db[_0x1bdf('0x3a')][_0x1bdf('0x3b')]({'where':{'type':_0x1ab629,'resourceId':_0x331e01['id']}})['then'](function(){return _0x939bbf;});})[_0x1bdf('0x23')](function(){_0xe30619[_0x1bdf('0x3c')](0xcc)[_0x1bdf('0x2e')]();});}};}function handleEntityNotFound(_0xd11000,_0x127f53){return function(_0x2230f6){if(!_0x2230f6){_0xd11000[_0x1bdf('0x3d')](0x194);}return _0x2230f6;};}function handleError(_0x14fce0,_0x1fa2a5){_0x1fa2a5=_0x1fa2a5||0x1f4;return function(_0x299c32){logger['error'](_0x299c32[_0x1bdf('0x3e')]);if(_0x299c32[_0x1bdf('0x3f')]){delete _0x299c32[_0x1bdf('0x3f')];}_0x14fce0[_0x1bdf('0x3c')](_0x1fa2a5)[_0x1bdf('0x40')](_0x299c32);};}exports[_0x1bdf('0x41')]=function(_0xb8088a,_0x3d5f8f){var _0x5d8521={'include':[{'model':db[_0x1bdf('0x42')],'as':_0x1bdf('0x43')}]},_0x12dc9f={},_0x2432ca={'count':0x0,'rows':[]};var _0x4a78ab=_[_0x1bdf('0x44')](db[_0x1bdf('0x45')]['rawAttributes'],function(_0x245fff){return{'name':_0x245fff['fieldName'],'type':_0x245fff[_0x1bdf('0x46')][_0x1bdf('0x47')]};});_0x12dc9f['model']=_[_0x1bdf('0x44')](_0x4a78ab,_0x1bdf('0x3f'));_0x12dc9f['query']=_[_0x1bdf('0x48')](_0xb8088a[_0x1bdf('0x49')]);_0x12dc9f[_0x1bdf('0x4a')]=_[_0x1bdf('0x4b')](_0x12dc9f[_0x1bdf('0x4c')],_0x12dc9f[_0x1bdf('0x49')]);_0x5d8521['attributes']=_[_0x1bdf('0x4b')](_0x12dc9f[_0x1bdf('0x4c')],qs['fields'](_0xb8088a[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x5d8521['attributes']=_0x5d8521['attributes'][_0x1bdf('0x4e')]?_0x5d8521['attributes']:_0x12dc9f[_0x1bdf('0x4c')];if(!_0xb8088a[_0x1bdf('0x49')][_0x1bdf('0x4f')](_0x1bdf('0x50'))){_0x5d8521[_0x1bdf('0x32')]=qs[_0x1bdf('0x32')](_0xb8088a[_0x1bdf('0x49')][_0x1bdf('0x32')]);_0x5d8521[_0x1bdf('0x2f')]=qs[_0x1bdf('0x2f')](_0xb8088a[_0x1bdf('0x49')]['offset']);}_0x5d8521[_0x1bdf('0x51')]=qs[_0x1bdf('0x52')](_0xb8088a[_0x1bdf('0x49')]['sort']);_0x5d8521['where']=qs['filters'](_[_0x1bdf('0x53')](_0xb8088a[_0x1bdf('0x49')],_0x12dc9f[_0x1bdf('0x4a')]),_0x4a78ab);if(_0xb8088a['query'][_0x1bdf('0x54')]){_0x5d8521[_0x1bdf('0x55')]=_[_0x1bdf('0x56')](_0x5d8521[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x4a78ab,function(_0x4bf936){if(_0x4bf936[_0x1bdf('0x46')]!==_0x1bdf('0x57')){var _0xcbd33f={};_0xcbd33f[_0x4bf936['name']]={'$like':'%'+_0xb8088a[_0x1bdf('0x49')]['filter']+'%'};return _0xcbd33f;}})});}_0x5d8521=_[_0x1bdf('0x56')]({},_0x5d8521,_0xb8088a[_0x1bdf('0x58')]);var _0x3df760={'where':_0x5d8521['where']};return db[_0x1bdf('0x45')][_0x1bdf('0x31')](_0x3df760)[_0x1bdf('0x23')](function(_0x5350d0){_0x2432ca[_0x1bdf('0x31')]=_0x5350d0;if(_0xb8088a[_0x1bdf('0x49')][_0x1bdf('0x59')]){_0x5d8521[_0x1bdf('0x5a')]=[{'all':!![]}];}return db[_0x1bdf('0x45')][_0x1bdf('0x5b')](_0x5d8521);})[_0x1bdf('0x23')](function(_0x282335){_0x2432ca[_0x1bdf('0x5c')]=_0x282335;return _0x2432ca;})['then'](respondWithFilteredResult(_0x3d5f8f,_0x5d8521))['catch'](handleError(_0x3d5f8f,null));};exports[_0x1bdf('0x5d')]=function(_0x471fa7,_0x24d199){var _0x180043={'raw':![],'where':{'id':_0x471fa7[_0x1bdf('0x5e')]['id']},'include':[{'model':db[_0x1bdf('0x42')],'as':_0x1bdf('0x43')}]},_0x4b6ad0={};_0x4b6ad0[_0x1bdf('0x4c')]=_[_0x1bdf('0x48')](db[_0x1bdf('0x45')]['rawAttributes']);_0x4b6ad0[_0x1bdf('0x49')]=_['keys'](_0x471fa7[_0x1bdf('0x49')]);_0x4b6ad0[_0x1bdf('0x4a')]=_[_0x1bdf('0x4b')](_0x4b6ad0[_0x1bdf('0x4c')],_0x4b6ad0['query']);_0x180043['attributes']=_[_0x1bdf('0x4b')](_0x4b6ad0[_0x1bdf('0x4c')],qs[_0x1bdf('0x4d')](_0x471fa7[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x180043[_0x1bdf('0x5f')]=_0x180043[_0x1bdf('0x5f')][_0x1bdf('0x4e')]?_0x180043[_0x1bdf('0x5f')]:_0x4b6ad0['model'];if(_0x471fa7[_0x1bdf('0x49')][_0x1bdf('0x59')]){_0x180043[_0x1bdf('0x5a')]=[{'all':!![]}];}_0x180043=_[_0x1bdf('0x56')]({},_0x180043,_0x471fa7[_0x1bdf('0x58')]);return db[_0x1bdf('0x45')][_0x1bdf('0x60')](_0x180043)[_0x1bdf('0x23')](handleEntityNotFound(_0x24d199,null))[_0x1bdf('0x23')](respondWithResult(_0x24d199,null))[_0x1bdf('0x2d')](handleError(_0x24d199,null));};exports[_0x1bdf('0x61')]=function(_0x4d079f,_0x413e48){return db[_0x1bdf('0x45')]['create'](_0x4d079f[_0x1bdf('0x62')],{})[_0x1bdf('0x23')](function(_0x4f45d3){var _0x1d8c05=_0x4d079f[_0x1bdf('0x63')][_0x1bdf('0x38')]({'plain':!![]});if(!_0x1d8c05)throw new Error(_0x1bdf('0x64'));if(_0x1d8c05[_0x1bdf('0x65')]===_0x1bdf('0x63')){var _0xf65c88=_0x4f45d3[_0x1bdf('0x38')]({'plain':!![]});var _0x3c7b60=_0x1bdf('0x39');return db[_0x1bdf('0x66')][_0x1bdf('0x60')]({'where':{'name':_0x3c7b60,'userProfileId':_0x1d8c05[_0x1bdf('0x67')]},'raw':!![]})[_0x1bdf('0x23')](function(_0x3361a8){if(_0x3361a8&&_0x3361a8['autoAssociation']===0x0){return db[_0x1bdf('0x3a')]['create']({'name':_0xf65c88[_0x1bdf('0x3f')],'resourceId':_0xf65c88['id'],'type':_0x3361a8['name'],'sectionId':_0x3361a8['id']},{})[_0x1bdf('0x23')](function(){return _0x4f45d3;});}else{return _0x4f45d3;}})[_0x1bdf('0x2d')](function(_0x308be1){logger[_0x1bdf('0x29')](_0x1bdf('0x68'),_0x308be1);throw _0x308be1;});}return _0x4f45d3;})[_0x1bdf('0x23')](respondWithResult(_0x413e48,0xc9))['catch'](handleError(_0x413e48,null));};exports[_0x1bdf('0x69')]=function(_0x2569e9,_0x10356d){if(_0x2569e9[_0x1bdf('0x62')]['id']){delete _0x2569e9[_0x1bdf('0x62')]['id'];}return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0x2569e9[_0x1bdf('0x5e')]['id']},'include':[{'model':db[_0x1bdf('0x42')],'as':'mandatoryDispositionPause'}]})[_0x1bdf('0x23')](handleEntityNotFound(_0x10356d,null))['then'](saveUpdates(_0x2569e9[_0x1bdf('0x62')],null))['then'](respondWithResult(_0x10356d,null))['catch'](handleError(_0x10356d,null));};exports['destroy']=function(_0x321922,_0x13ce65){return db['ChatWebsite'][_0x1bdf('0x60')]({'where':{'id':_0x321922[_0x1bdf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x13ce65,null))[_0x1bdf('0x23')](removeEntity(_0x13ce65,null))[_0x1bdf('0x2d')](handleError(_0x13ce65,null));};exports[_0x1bdf('0x6a')]=function(_0xdab918,_0x5b127b){return db[_0x1bdf('0x45')][_0x1bdf('0x6a')]()[_0x1bdf('0x23')](respondWithResult(_0x5b127b,null))['catch'](handleError(_0x5b127b,null));};exports[_0x1bdf('0x6b')]=function(_0xbb91bf,_0x49ef01,_0x267604){if(_0xbb91bf[_0x1bdf('0x62')]['id']){delete _0xbb91bf[_0x1bdf('0x62')]['id'];}return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0xbb91bf[_0x1bdf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x49ef01,null))[_0x1bdf('0x23')](function(_0x2631b4){if(_0x2631b4){_0xbb91bf[_0x1bdf('0x62')]['ChatWebsiteId']=_0x2631b4['id'];return db[_0x1bdf('0x6c')]['create'](_0xbb91bf[_0x1bdf('0x62')]);}})[_0x1bdf('0x23')](respondWithResult(_0x49ef01,null))[_0x1bdf('0x2d')](handleError(_0x49ef01,null));};exports[_0x1bdf('0x6d')]=function(_0x43b1dd,_0x4209b6,_0x1d43c4){var _0x404434={'raw':![],'where':{}};var _0xf0fb50={};var _0xb67c1={'count':0x0,'rows':[]};return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x43b1dd[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x4209b6,null))[_0x1bdf('0x23')](function(_0x13f653){if(_0x13f653){_0xf0fb50['model']=_[_0x1bdf('0x48')](db[_0x1bdf('0x6c')][_0x1bdf('0x6f')]);_0xf0fb50[_0x1bdf('0x49')]=_['keys'](_0x43b1dd[_0x1bdf('0x49')]);_0xf0fb50['filters']=_['intersection'](_0xf0fb50['model'],_0xf0fb50[_0x1bdf('0x49')]);_0x404434['attributes']=_['intersection'](_0xf0fb50[_0x1bdf('0x4c')],qs[_0x1bdf('0x4d')](_0x43b1dd[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x404434[_0x1bdf('0x5f')]=_0x404434[_0x1bdf('0x5f')][_0x1bdf('0x4e')]?_0x404434['attributes']:_0xf0fb50[_0x1bdf('0x4c')];if(!_0x43b1dd[_0x1bdf('0x49')]['hasOwnProperty'](_0x1bdf('0x50'))){_0x404434['limit']=qs[_0x1bdf('0x32')](_0x43b1dd[_0x1bdf('0x49')][_0x1bdf('0x32')]);_0x404434[_0x1bdf('0x2f')]=qs[_0x1bdf('0x2f')](_0x43b1dd['query'][_0x1bdf('0x2f')]);}_0x404434[_0x1bdf('0x51')]=qs[_0x1bdf('0x52')](_0x43b1dd['query'][_0x1bdf('0x52')]);_0x404434[_0x1bdf('0x55')]=qs[_0x1bdf('0x4a')](_[_0x1bdf('0x53')](_0x43b1dd[_0x1bdf('0x49')],_0xf0fb50[_0x1bdf('0x4a')]));_0x404434[_0x1bdf('0x55')][_0x1bdf('0x70')]=_0x13f653['id'];if(_0x43b1dd['query'][_0x1bdf('0x54')]){_0x404434[_0x1bdf('0x55')]=_['merge'](_0x404434[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x404434[_0x1bdf('0x5f')],function(_0x594792){var _0x25c10f={};_0x25c10f[_0x594792]={'$like':'%'+_0x43b1dd[_0x1bdf('0x49')][_0x1bdf('0x54')]+'%'};return _0x25c10f;})});}_0x404434=_[_0x1bdf('0x56')]({},_0x404434,_0x43b1dd['options']);return db[_0x1bdf('0x6c')]['count']({'where':_0x404434[_0x1bdf('0x55')]})[_0x1bdf('0x23')](function(_0x3d3ff0){_0xb67c1['count']=_0x3d3ff0;if(_0x43b1dd[_0x1bdf('0x49')]['includeAll']){_0x404434[_0x1bdf('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x1bdf('0x5b')](_0x404434);})['then'](function(_0x4f142a){_0xb67c1[_0x1bdf('0x5c')]=_0x4f142a;return _0xb67c1;});}})[_0x1bdf('0x23')](respondWithFilteredResult(_0x4209b6,_0x404434))[_0x1bdf('0x2d')](handleError(_0x4209b6,null));};exports[_0x1bdf('0x71')]=function(_0x123c6d,_0x56f61c,_0x3d023d){return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0x123c6d[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x56f61c,null))['then'](function(_0x26c021){if(_0x26c021){return _0x26c021[_0x1bdf('0x71')](_0x123c6d[_0x1bdf('0x49')][_0x1bdf('0x72')]);}})[_0x1bdf('0x23')](respondWithStatusCode(_0x56f61c,null))[_0x1bdf('0x2d')](handleError(_0x56f61c,null));};exports[_0x1bdf('0x73')]=function(_0x239762,_0x21fe36,_0x5997db){if(_0x239762[_0x1bdf('0x62')]['id']){delete _0x239762[_0x1bdf('0x62')]['id'];}return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0x239762[_0x1bdf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x21fe36,null))[_0x1bdf('0x23')](function(_0x43fba){if(_0x43fba){_0x239762[_0x1bdf('0x62')][_0x1bdf('0x70')]=_0x43fba['id'];return db['CannedAnswer'][_0x1bdf('0x61')](_0x239762[_0x1bdf('0x62')]);}})[_0x1bdf('0x23')](respondWithResult(_0x21fe36,null))[_0x1bdf('0x2d')](handleError(_0x21fe36,null));};exports[_0x1bdf('0x74')]=function(_0x2cc47d,_0x4b4b3a,_0x49f21f){var _0x55410c={'raw':![],'where':{}};var _0x17daf8={};var _0x44b241={'count':0x0,'rows':[]};return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x2cc47d[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x4b4b3a,null))['then'](function(_0x54c7f6){if(_0x54c7f6){_0x17daf8[_0x1bdf('0x4c')]=_[_0x1bdf('0x48')](db[_0x1bdf('0x75')][_0x1bdf('0x6f')]);_0x17daf8[_0x1bdf('0x49')]=_[_0x1bdf('0x48')](_0x2cc47d[_0x1bdf('0x49')]);_0x17daf8[_0x1bdf('0x4a')]=_['intersection'](_0x17daf8['model'],_0x17daf8[_0x1bdf('0x49')]);_0x55410c[_0x1bdf('0x5f')]=_[_0x1bdf('0x4b')](_0x17daf8['model'],qs['fields'](_0x2cc47d['query']['fields']));_0x55410c['attributes']=_0x55410c['attributes'][_0x1bdf('0x4e')]?_0x55410c['attributes']:_0x17daf8['model'];if(!_0x2cc47d[_0x1bdf('0x49')]['hasOwnProperty'](_0x1bdf('0x50'))){_0x55410c['limit']=qs[_0x1bdf('0x32')](_0x2cc47d[_0x1bdf('0x49')][_0x1bdf('0x32')]);_0x55410c['offset']=qs[_0x1bdf('0x2f')](_0x2cc47d['query']['offset']);}_0x55410c['order']=qs[_0x1bdf('0x52')](_0x2cc47d[_0x1bdf('0x49')][_0x1bdf('0x52')]);_0x55410c[_0x1bdf('0x55')]=qs[_0x1bdf('0x4a')](_['pick'](_0x2cc47d['query'],_0x17daf8[_0x1bdf('0x4a')]));_0x55410c['where'][_0x1bdf('0x70')]=_0x54c7f6['id'];if(_0x2cc47d[_0x1bdf('0x49')]['filter']){_0x55410c[_0x1bdf('0x55')]=_[_0x1bdf('0x56')](_0x55410c[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x55410c[_0x1bdf('0x5f')],function(_0x6c4f71){var _0x3ce07f={};_0x3ce07f[_0x6c4f71]={'$like':'%'+_0x2cc47d[_0x1bdf('0x49')][_0x1bdf('0x54')]+'%'};return _0x3ce07f;})});}_0x55410c=_[_0x1bdf('0x56')]({},_0x55410c,_0x2cc47d[_0x1bdf('0x58')]);return db['CannedAnswer']['count']({'where':_0x55410c[_0x1bdf('0x55')]})['then'](function(_0x9bf6f9){_0x44b241['count']=_0x9bf6f9;if(_0x2cc47d[_0x1bdf('0x49')][_0x1bdf('0x59')]){_0x55410c[_0x1bdf('0x5a')]=[{'all':!![]}];}return db[_0x1bdf('0x75')][_0x1bdf('0x5b')](_0x55410c);})[_0x1bdf('0x23')](function(_0x242134){_0x44b241['rows']=_0x242134;return _0x44b241;});}})[_0x1bdf('0x23')](respondWithFilteredResult(_0x4b4b3a,_0x55410c))[_0x1bdf('0x2d')](handleError(_0x4b4b3a,null));};exports[_0x1bdf('0x76')]=function(_0x2eff17,_0x3c38a2,_0x2db6b9){return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0x2eff17[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x3c38a2,null))[_0x1bdf('0x23')](function(_0x143b11){if(_0x143b11){return _0x143b11['removeAnswers'](_0x2eff17[_0x1bdf('0x49')][_0x1bdf('0x72')]);}})['then'](respondWithStatusCode(_0x3c38a2,null))['catch'](handleError(_0x3c38a2,null));};exports[_0x1bdf('0x77')]=function(_0x1370c5,_0x4d34f6,_0x3fbaa3){_0x1370c5['body'][_0x1bdf('0x78')]=_0x1370c5[_0x1bdf('0x79')][_0x1bdf('0x7a')];return db['ChatWebsite'][_0x1bdf('0x60')]({'where':{'id':_0x1370c5[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x4d34f6,null))[_0x1bdf('0x23')](saveUpdates(_0x1370c5[_0x1bdf('0x62')],null))[_0x1bdf('0x23')](respondWithResult(_0x4d34f6,null))['catch'](handleError(_0x4d34f6,null));};exports[_0x1bdf('0x7b')]=function(_0x397d4c,_0x5b7629,_0x22c91d){_0x397d4c[_0x1bdf('0x62')][_0x1bdf('0x7c')]=_0x397d4c[_0x1bdf('0x79')]['filename'];return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0x397d4c[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x5b7629,null))['then'](saveUpdates(_0x397d4c[_0x1bdf('0x62')],null))[_0x1bdf('0x23')](respondWithResult(_0x5b7629,null))[_0x1bdf('0x2d')](handleError(_0x5b7629,null));};exports[_0x1bdf('0x7d')]=function(_0x48337e,_0x3c5ec4,_0x266fee){_0x48337e[_0x1bdf('0x62')]['customerAvatar']=_0x48337e[_0x1bdf('0x79')][_0x1bdf('0x7a')];return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0x48337e['params']['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x3c5ec4,null))['then'](saveUpdates(_0x48337e[_0x1bdf('0x62')],null))[_0x1bdf('0x23')](respondWithResult(_0x3c5ec4,null))[_0x1bdf('0x2d')](handleError(_0x3c5ec4,null));};exports[_0x1bdf('0x7e')]=function(_0x430613,_0x177444,_0x1f6cd9){_0x430613[_0x1bdf('0x62')][_0x1bdf('0x7f')]=_0x430613[_0x1bdf('0x79')][_0x1bdf('0x7a')];return db[_0x1bdf('0x45')]['find']({'where':{'id':_0x430613[_0x1bdf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x177444,null))['then'](saveUpdates(_0x430613['body'],null))['then'](respondWithResult(_0x177444,null))[_0x1bdf('0x2d')](handleError(_0x177444,null));};exports[_0x1bdf('0x80')]=function(_0x3e0135,_0x367333,_0x4d1a4f){var _0x5e35bb=path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],_0x1bdf('0x83'));var _0x540c68={'where':{'id':_0x3e0135[_0x1bdf('0x5e')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x26e98d=![];return require(_0x1bdf('0x19'))[_0x1bdf('0x84')]()[_0x1bdf('0x23')](function(_0x19de22){if(_0x19de22){_0x26e98d=_0x19de22[_0x1bdf('0x85')];}})[_0x1bdf('0x23')](function(){return db[_0x1bdf('0x45')][_0x1bdf('0x60')](_0x540c68);})[_0x1bdf('0x23')](handleEntityNotFound(_0x367333,null))[_0x1bdf('0x23')](function(_0x3fe7f5){if(_0x3fe7f5){if(!_[_0x1bdf('0x86')](_0x3fe7f5[_0x1bdf('0x78')])){if(fs[_0x1bdf('0x87')](path['join'](config[_0x1bdf('0x82')],_0x1bdf('0x88'),_0x3fe7f5[_0x1bdf('0x78')]))&&_0x26e98d){_0x5e35bb=path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],'server/files/images/logos/',_0x3fe7f5['sitepic']);}}return _0x367333[_0x1bdf('0x89')](_0x5e35bb);}})[_0x1bdf('0x2d')](handleError(_0x367333,null));};exports[_0x1bdf('0x8a')]=function(_0x315549,_0x214b6c,_0x5af3d0){var _0x4d1450=path['join'](config[_0x1bdf('0x82')],_0x1bdf('0x8b'));var _0x2e9b4a={'where':{'id':_0x315549[_0x1bdf('0x5e')]['id']},'attributes':['id',_0x1bdf('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x1bdf('0x60')](_0x2e9b4a)[_0x1bdf('0x23')](handleEntityNotFound(_0x214b6c,null))['then'](function(_0x55b70b){if(_0x55b70b){if(!_[_0x1bdf('0x86')](_0x55b70b[_0x1bdf('0x7c')])){if(fs[_0x1bdf('0x87')](path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],_0x1bdf('0x8c'),_0x55b70b['agentAvatar']))){_0x4d1450=path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],_0x1bdf('0x8c'),_0x55b70b[_0x1bdf('0x7c')]);}}return _0x214b6c['download'](_0x4d1450);}})[_0x1bdf('0x2d')](handleError(_0x214b6c,null));};exports[_0x1bdf('0x8d')]=function(_0x222b36,_0x588a95,_0x456970){var _0x22fba4=path[_0x1bdf('0x81')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x1a93dd={'where':{'id':_0x222b36[_0x1bdf('0x5e')]['id']},'attributes':['id',_0x1bdf('0x8e'),_0x1bdf('0x8f')],'raw':!![]};return db[_0x1bdf('0x45')]['find'](_0x1a93dd)['then'](handleEntityNotFound(_0x588a95,null))[_0x1bdf('0x23')](function(_0xed79fe){if(_0xed79fe){if(!_['isNil'](_0xed79fe[_0x1bdf('0x8e')])){if(fs[_0x1bdf('0x87')](path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],_0x1bdf('0x8c'),_0xed79fe[_0x1bdf('0x8e')]))&&_0xed79fe['showCustomerAvatar']){_0x22fba4=path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],'server/files/images/avatars/',_0xed79fe[_0x1bdf('0x8e')]);}}return _0x588a95[_0x1bdf('0x89')](_0x22fba4);}})['catch'](handleError(_0x588a95,null));};exports[_0x1bdf('0x90')]=function(_0x3d1a3b,_0x619705,_0x14fa85){var _0x416c9b=path['join'](config['root'],_0x1bdf('0x91'));var _0x1a9f09={'where':{'id':_0x3d1a3b[_0x1bdf('0x5e')]['id']},'attributes':['id',_0x1bdf('0x7f')],'raw':!![]};return db['ChatWebsite'][_0x1bdf('0x60')](_0x1a9f09)[_0x1bdf('0x23')](handleEntityNotFound(_0x619705,null))[_0x1bdf('0x23')](function(_0x1df604){if(_0x1df604){if(!_[_0x1bdf('0x86')](_0x1df604[_0x1bdf('0x7f')])){if(fs[_0x1bdf('0x87')](path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],_0x1bdf('0x8c'),_0x1df604[_0x1bdf('0x7f')]))){_0x416c9b=path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],'server/files/images/avatars/',_0x1df604['systemAvatar']);}}return _0x619705[_0x1bdf('0x89')](_0x416c9b);}})[_0x1bdf('0x2d')](handleError(_0x619705,null));};exports[_0x1bdf('0x92')]=function(_0x148408,_0x398164,_0x55d063){var _0x2609d8=require('user-agent-parser');var _0xbebc8a=new _0x2609d8();var _0x3a2123=_0xbebc8a[_0x1bdf('0x93')](_0x148408['headers']['user-agent'])[_0x1bdf('0x94')]();var _0x315215={'body':_0x148408[_0x1bdf('0x62')],'channel':_0x1bdf('0x95')};var _0x2999c4=[];var _0x5bb830=[];var _0x481f44={};var _0x3d632a=![];return db[_0x1bdf('0x96')]['describe']()['then'](function(_0x20813d){if(!_0x20813d){throw new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))]('no\x20available\x20attributes');}_0x2999c4=_[_0x1bdf('0x99')](_[_0x1bdf('0x48')](_0x20813d),['createdAt','updatedAt']);_0x5bb830=_['difference'](_[_0x1bdf('0x48')](_0x20813d),[_0x1bdf('0x9a'),_0x1bdf('0x9b'),_0x1bdf('0x9c'),'ListId']);if(_0x148408[_0x1bdf('0x62')]['id']){delete _0x148408[_0x1bdf('0x62')]['id'];}if(_[_0x1bdf('0x86')](_0x148408['body'][_0x1bdf('0x9d')])){throw new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))](_0x1bdf('0x9e'));}if(_[_0x1bdf('0x86')](_0x148408[_0x1bdf('0x62')][_0x1bdf('0x62')])||_0x148408[_0x1bdf('0x62')][_0x1bdf('0x62')]===''){throw new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))](_0x1bdf('0x9f'));}if(_[_0x1bdf('0x86')](_0x148408['body'][_0x1bdf('0xa0')])){throw new db[(_0x1bdf('0x97'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5bb830);}if(!_[_0x1bdf('0xa1')](_0x5bb830,_0x148408[_0x1bdf('0x62')][_0x1bdf('0xa0')])){throw new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))](_0x1bdf('0xa2')+_0x5bb830);}_0x481f44[_0x148408[_0x1bdf('0x62')]['mapKey']]=_0x148408[_0x1bdf('0x62')][_0x1bdf('0x9d')];})[_0x1bdf('0x23')](function(){return db[_0x1bdf('0x45')]['find']({'where':{'id':_0x148408[_0x1bdf('0x5e')]['id']},'include':[{'model':db[_0x1bdf('0xa3')],'as':_0x1bdf('0xa4'),'include':[{'model':db['CmContact'],'as':_0x1bdf('0xa5'),'where':_0x481f44,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0x1bdf('0xa6')}]});})[_0x1bdf('0x23')](handleEntityNotFound(_0x398164,null))[_0x1bdf('0x23')](function(_0xdd8466){if(_0xdd8466&&_0xdd8466[_0x1bdf('0xa4')]){_0x315215[_0x1bdf('0xa7')]=_0xdd8466;_0x315215['applications']=_0xdd8466[_0x1bdf('0xa6')];_0x315215[_0x1bdf('0xa8')]=_0xdd8466[_0x1bdf('0xa4')];_0x315215['applications']=_[_0x1bdf('0xa9')](_0x315215[_0x1bdf('0xaa')],[_0x1bdf('0xab')],[_0x1bdf('0xac')]);if(_0x315215[_0x1bdf('0xa7')]['Applications']){delete _0x315215['account'][_0x1bdf('0xa6')];}if(_0x315215[_0x1bdf('0xa7')][_0x1bdf('0xa4')]&&_0x315215[_0x1bdf('0xa7')]['List']['Contacts'][_0x1bdf('0x4e')]){return _0x315215[_0x1bdf('0xa7')]['List'][_0x1bdf('0xa5')][0x0];}var _0x4bcae8=_[_0x1bdf('0x1c')](_0x148408[_0x1bdf('0x62')],{'firstName':_0x148408[_0x1bdf('0x62')][_0x1bdf('0x9d')],'ListId':_0xdd8466[_0x1bdf('0xad')]});_0x4bcae8[_0x148408[_0x1bdf('0x62')][_0x1bdf('0xa0')]]=_0x148408[_0x1bdf('0x62')][_0x1bdf('0x9d')];return db[_0x1bdf('0x96')][_0x1bdf('0x61')](_0x4bcae8,{'fields':_0x2999c4,'raw':!![]});}})[_0x1bdf('0x23')](handleEntityNotFound(_0x398164,null))['then'](function(_0x3e54c0){_0x315215[_0x1bdf('0xae')]=_0x3e54c0;var _0x5ef3e8=_0x148408['body'][_0x1bdf('0xaf')];if(_0x148408['headers'][_0x1bdf('0xb0')]){_0x5ef3e8=_0x148408[_0x1bdf('0xb1')][_0x1bdf('0xb0')];}else if(_0x148408['headers'][_0x1bdf('0xb2')]){_0x5ef3e8=_[_0x1bdf('0xb3')](_0x148408[_0x1bdf('0xb1')][_0x1bdf('0xb2')][_0x1bdf('0xb4')](','));}if(_0x3e54c0){var _0x33642={'ContactId':_0x3e54c0['id'],'ChatWebsiteId':_0x148408['params']['id'],'from':(_0x3e54c0[_0x1bdf('0xb5')]||'')+'\x20'+(_0x3e54c0['lastName']||''),'customerIp':_0x5ef3e8,'customerPort':_0x148408[_0x1bdf('0xb1')][_0x1bdf('0xb6')]?_0x148408[_0x1bdf('0xb1')][_0x1bdf('0xb6')]:null,'referer':_0x148408[_0x1bdf('0x62')]['referer'],'browserName':_0x3a2123[_0x1bdf('0xb7')]['name']&&_0x3a2123[_0x1bdf('0xb7')]['version']?util['format']('%s\x20%s',_0x3a2123[_0x1bdf('0xb7')]['name'],_0x3a2123[_0x1bdf('0xb7')]['version']):_0x1bdf('0xb8'),'browserVersion':_0x3a2123['browser']['version']||_0x1bdf('0xb8'),'osName':util['format'](_0x1bdf('0xb9'),_0x3a2123['os']['name'],_0x3a2123['os'][_0x1bdf('0xba')]),'osVersion':_0x3a2123['os']['version'],'deviceModel':_0x3a2123[_0x1bdf('0xbb')][_0x1bdf('0x4c')]&&_0x3a2123[_0x1bdf('0xbb')][_0x1bdf('0xbc')]?util[_0x1bdf('0xbd')]('%s\x20%s\x20%s',_0x3a2123[_0x1bdf('0xbb')][_0x1bdf('0x4c')],_0x3a2123['device'][_0x1bdf('0xbc')],_0x3a2123['device']['type']):null,'deviceVendor':_0x3a2123[_0x1bdf('0xbb')][_0x1bdf('0xbc')],'deviceType':_0x3a2123[_0x1bdf('0xbb')][_0x1bdf('0x46')],'formData':JSON[_0x1bdf('0xbe')](_0x148408[_0x1bdf('0x62')])};var _0x153f86={'ChatWebsiteId':_0x148408['params']['id'],'closed':![]};if(_0x148408[_0x1bdf('0x62')][_0x1bdf('0xbf')]){_0x153f86['threadId']=_0x148408[_0x1bdf('0x62')][_0x1bdf('0xbf')];return db[_0x1bdf('0xc0')][_0x1bdf('0x60')]({'where':_0x153f86})[_0x1bdf('0x23')](function(_0x288776){if(_0x288776){return[_0x288776,![]];}_0x33642['threadId']=_0x148408[_0x1bdf('0x62')][_0x1bdf('0xbf')];_0x33642[_0x1bdf('0xc1')]=_0x148408['body'][_0x1bdf('0xc1')];return db[_0x1bdf('0xc0')]['create'](_0x33642)[_0x1bdf('0x23')](function(_0x22bc1a){return[_0x22bc1a,!![]];});});}_0x153f86[_0x1bdf('0xc2')]=_0x3e54c0['id'];if(_0x148408[_0x1bdf('0x62')][_0x1bdf('0xc3')]&&_0x148408[_0x1bdf('0x62')][_0x1bdf('0xc3')]['id']){_0x153f86['id']=_0x148408['body']['interaction']['id'];return db[_0x1bdf('0xc0')]['find']({'where':_0x153f86})[_0x1bdf('0x23')](function(_0x1a4af3){if(_0x1a4af3){return[_0x1a4af3,![]];}return db[_0x1bdf('0xc0')][_0x1bdf('0x61')](_0x33642)[_0x1bdf('0x23')](function(_0x524bf7){return[_0x524bf7,!![]];});});}return db[_0x1bdf('0xc0')][_0x1bdf('0x61')](_0x33642)[_0x1bdf('0x23')](function(_0x3f6588){return[_0x3f6588,!![]];});}})['spread'](function(_0x51820b,_0x12fafd){if(_0x51820b){_0x3d632a=_0x12fafd;if(!_0x12fafd){var _0x389298={'from':(_0x315215[_0x1bdf('0xae')][_0x1bdf('0xb5')]||'')+'\x20'+(_0x315215[_0x1bdf('0xae')][_0x1bdf('0xc4')]||'')};if(_0x148408[_0x1bdf('0x62')][_0x1bdf('0xbf')]&&_0x148408[_0x1bdf('0x62')][_0x1bdf('0xc5')]&&_0x148408[_0x1bdf('0x62')][_0x1bdf('0xbf')]!=_0x148408[_0x1bdf('0x62')]['messageId']){_0x389298['threadId']=_0x148408[_0x1bdf('0x62')][_0x1bdf('0xc5')];}return _0x51820b[_0x1bdf('0x69')](_0x389298);}else{return _0x51820b;}}})[_0x1bdf('0x23')](function(_0x1f4bd8){_0x315215[_0x1bdf('0xc3')]=_0x1f4bd8[_0x1bdf('0x38')]({'plain':!![]});_0x315215[_0x1bdf('0xc3')]['created']=_0x3d632a;if(_0x315215[_0x1bdf('0xc3')][_0x1bdf('0xc6')]){if(_0x315215[_0x1bdf('0xa7')]['autoclose']){_0x315215[_0x1bdf('0xaa')]['push']({'id':0x0,'priority':_0x315215[_0x1bdf('0xaa')][_0x1bdf('0x4e')]+0x1,'app':_0x1bdf('0xc7'),'appdata':_0x1bdf('0xc8'),'interval':'*,*,*,*'});}}return db[_0x1bdf('0xc9')][_0x1bdf('0x61')]({'body':_0x148408[_0x1bdf('0x62')][_0x1bdf('0x62')],'ChatWebsiteId':_0x148408['params']['id'],'ChatInteractionId':_0x1f4bd8['id'],'direction':'in','ContactId':_0x315215['contact']['id'],'AttachmentId':_0x148408['body'][_0x1bdf('0xca')]});})['then'](function(_0x4fe142){_0x315215['message']=_0x4fe142;if(_0x315215[_0x1bdf('0xc3')][_0x1bdf('0xcb')]){return db[_0x1bdf('0xcc')][_0x1bdf('0x60')]({'attributes':['id','name'],'where':{'id':_0x315215['interaction']['UserId']}})[_0x1bdf('0x23')](function(_0xcc6f98){if(_0xcc6f98){_0x315215[_0x1bdf('0xaa')][_0x1bdf('0xcd')]({'id':0x0,'priority':0x0,'app':_0x1bdf('0xce'),'appdata':_0xcc6f98[_0x1bdf('0x3f')]+','+(_0x315215['account'][_0x1bdf('0xcf')]||0xa),'interval':_0x1bdf('0xd0')});_0x315215[_0x1bdf('0xd1')]=!![];}return respondWithRpcPromise(_0x1bdf('0xd2'),_0x1bdf('0xd3'),_0x315215);});}return respondWithRpcPromise(_0x1bdf('0xd2'),'startRouting',_0x315215);})[_0x1bdf('0x23')](function(_0x336e7f){respondWithRpcPromise(_0x1bdf('0xd4'),_0x1bdf('0xd4'),{'event':_0x1bdf('0x92'),'message':_0x336e7f},client9002);return _0x336e7f;})[_0x1bdf('0x23')](respondWithResult(_0x398164,null))[_0x1bdf('0x2d')](handleError(_0x398164,null));};exports[_0x1bdf('0xd5')]=function(_0x5c3889,_0x5631f3,_0x387f02){var _0x4e2c05,_0x18595d,_0x3ce3bc;var _0x13eb6c=[];var _0x3df6df=[];var _0x47a9dd={};var _0x530224=_0x5c3889[_0x1bdf('0xd6')]||[];var _0x37fa64=[];var _0x4fa481;return db[_0x1bdf('0x96')][_0x1bdf('0x6a')]()[_0x1bdf('0x23')](function(_0x2da616){if(!_0x2da616){throw new db[(_0x1bdf('0x97'))]['ValidationError'](_0x1bdf('0xd7'));}_0x3df6df=_['difference'](_['keys'](_0x2da616),[_0x1bdf('0x9a'),_0x1bdf('0x9b')]);_0x13eb6c=_['difference'](_[_0x1bdf('0x48')](_0x2da616),['createdAt','updatedAt',_0x1bdf('0x9c'),_0x1bdf('0xad')]);if(_0x5c3889[_0x1bdf('0x62')]['id']){delete _0x5c3889['body']['id'];}if(_[_0x1bdf('0x86')](_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0x9d')])){throw _0x5631f3[_0x1bdf('0x3c')](0x1f4)[_0x1bdf('0x40')](new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))](_0x1bdf('0x9e')));}if(_[_0x1bdf('0x86')](_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0x62')])||_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0x62')]===''){throw _0x5631f3[_0x1bdf('0x3c')](0x1f4)[_0x1bdf('0x40')](new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))](_0x1bdf('0x9f')));}if(_[_0x1bdf('0x86')](_0x5c3889[_0x1bdf('0x62')]['mapKeyOffline'])){throw _0x5631f3[_0x1bdf('0x3c')](0x1f4)[_0x1bdf('0x40')](new db[(_0x1bdf('0x97'))]['ValidationError'](_0x1bdf('0xd8')+_0x13eb6c));}if(!_[_0x1bdf('0xa1')](_0x13eb6c,_0x5c3889['body'][_0x1bdf('0xd9')])){throw _0x5631f3[_0x1bdf('0x3c')](0x1f4)['send'](new db[(_0x1bdf('0x97'))][(_0x1bdf('0x98'))](_0x1bdf('0xda')+_0x13eb6c));}_0x47a9dd[_0x5c3889[_0x1bdf('0x62')]['mapKeyOffline']]=_0x5c3889['body']['from'];})[_0x1bdf('0x23')](function(){return db[_0x1bdf('0x45')]['find']({'where':{'id':_0x5c3889[_0x1bdf('0x5e')]['id']},'include':[{'model':db[_0x1bdf('0xa3')],'as':'List'},{'model':db['MailAccount'],'as':_0x1bdf('0xdb')}]});})['then'](handleEntityNotFound(_0x5631f3,null))['then'](function(_0x386152){if(_0x386152&&_0x386152[_0x1bdf('0xa4')]){_0x18595d=_0x386152;var _0x35a168=_['defaults'](_0x5c3889[_0x1bdf('0x62')],{'firstName':_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0x9d')],'phone':_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0x9d')],'ListId':_0x386152[_0x1bdf('0xad')]});_0x35a168[_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0xd9')]]=_0x5c3889['body'][_0x1bdf('0x9d')];return db[_0x1bdf('0x96')]['findOrCreate']({'where':_0x47a9dd,'defaults':_0x35a168});}})[_0x1bdf('0xdc')](function(_0xf1455e){if(_0xf1455e){_0x3ce3bc=_0xf1455e;var _0x18e4d3=fs['readFileSync'](path[_0x1bdf('0x81')](config[_0x1bdf('0x82')],_0x1bdf('0xdd')),_0x1bdf('0xde'));var _0xc3aa4b=ejs[_0x1bdf('0xdf')](_0x18e4d3,{'body':_[_0x1bdf('0xe0')](_0x5c3889[_0x1bdf('0x62')][_0x1bdf('0x62')]),'bodyTitle':_0x18595d[_0x1bdf('0xe1')]});return db[_0x1bdf('0xe2')][_0x1bdf('0x61')]({'body':_0xc3aa4b,'ContactId':_0xf1455e['id'],'ChatWebsiteId':_0x18595d['id']});}})[_0x1bdf('0x23')](function(_0x5940cb){_0x4fa481=_0x5940cb;if(_0x530224[_0x1bdf('0x4e')]){var _0x56e9f8=_0x530224[_0x1bdf('0x44')](function(_0x24c731){return{'name':_0x24c731[_0x1bdf('0xe3')],'basename':_0x24c731[_0x1bdf('0x7a')],'type':_0x24c731['mimetype'],'ChatOfflineMessageId':_0x5940cb['id']};});_0x37fa64=_0x56e9f8[_0x1bdf('0x44')](_0x5f3741=>{var _0x3015a7={'filename':_0x5f3741[_0x1bdf('0x3f')],'path':path[_0x1bdf('0x81')](config['root'],_0x1bdf('0xe4'),_0x1bdf('0xd6'),_0x1bdf('0xe5'),_0x1bdf('0xe6'),_0x5f3741['basename'])};return _0x3015a7;});if(!_0x18595d[_0x1bdf('0xe7')]){return db['sequelize']['transaction'](function(_0x4468a7){return db[_0x1bdf('0xe8')][_0x1bdf('0xe9')](_0x56e9f8,{'transaction':_0x4468a7});});}}})[_0x1bdf('0x23')](function(){if(_0x4fa481){_0x4e2c05=_0x4fa481;return db[_0x1bdf('0xdb')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x1bdf('0xea')],'as':_0x1bdf('0xeb'),'raw':!![]}]});}})[_0x1bdf('0x23')](function(_0x26e7e5){if(_0x26e7e5&&_0x26e7e5[_0x1bdf('0xeb')]&&_0x18595d[_0x1bdf('0xec')]&&_0x18595d[_0x1bdf('0xed')]){var _0x52eaa2={'tls':{'rejectUnauthorized':![]}};if(_0x26e7e5[_0x1bdf('0xeb')][_0x1bdf('0xee')]){_0x52eaa2['service']=_0x26e7e5[_0x1bdf('0xeb')]['service'];}else{_0x52eaa2['host']=_0x26e7e5[_0x1bdf('0xeb')]['host'];_0x52eaa2[_0x1bdf('0xef')]=_0x26e7e5[_0x1bdf('0xeb')][_0x1bdf('0xef')];_0x52eaa2[_0x1bdf('0xf0')]=_0x26e7e5['Smtp'][_0x1bdf('0xf0')];}if(_0x26e7e5[_0x1bdf('0xeb')][_0x1bdf('0xf1')]){_0x52eaa2['auth']={'user':_0x26e7e5[_0x1bdf('0xeb')]['user'],'pass':_0x26e7e5['Smtp'][_0x1bdf('0xf2')]};}return respondWithRpcPromise(_0x1bdf('0xf3'),_0x1bdf('0xf4'),{'account':_0x52eaa2,'message':{'from':util[_0x1bdf('0xbd')](_0x1bdf('0xf5'),_0x26e7e5['name'],_0x26e7e5[_0x1bdf('0xf6')]||_0x26e7e5[_0x1bdf('0xeb')][_0x1bdf('0x63')]),'to':_0x18595d[_0x1bdf('0xed')],'subject':_0x18595d[_0x1bdf('0xf7')],'html':_0x4e2c05[_0x1bdf('0x62')],'attachments':_0x37fa64}},client9003)['then'](function(){return _0x4e2c05;})[_0x1bdf('0x2d')](function(_0x804847){console[_0x1bdf('0x29')](_0x804847);});}})['then'](function(){if(_0x18595d&&_0x18595d['openNewInteraction']&&_0x18595d['MailAccountId']){var _0x5296da=[];if(_0x530224['length']){_0x5296da=_0x530224[_0x1bdf('0x44')](function(_0x137e1d){return{'name':_0x137e1d[_0x1bdf('0xe3')],'basename':_0x137e1d[_0x1bdf('0x7a')],'type':_0x137e1d[_0x1bdf('0xf8')],'ChatOfflineMessageId':_0x4fa481['id']};});}var _0x4926b8;if(!_[_0x1bdf('0x86')](_0x18595d[_0x1bdf('0xf9')])){var _0xba6499=_[_0x1bdf('0x44')](_0x5c3889[_0x1bdf('0x62')],function(_0x181306){return _0x181306;});var _0x48b075=_[_0x1bdf('0xfa')](_0xba6499)[0x0];var _0x3e305c=_[_0x1bdf('0xfb')](_0x48b075,function(_0x320798){return _0x320798;});_0x4926b8=_0x3e305c[0x1][_0x18595d[_0x1bdf('0xf9')]];}var _0x594b47={'from':_0x3ce3bc['email'],'firstName':_0x3ce3bc[_0x1bdf('0xb5')],'lastName':_0x3ce3bc[_0x1bdf('0xc4')],'mapKey':_0x1bdf('0xf6'),'message':{'from':_0x3ce3bc[_0x1bdf('0xf6')],'to':_0x18595d[_0x1bdf('0xdb')][_0x1bdf('0xf6')],'cc':'','subject':_['isNil'](_0x4926b8)?_0x18595d['offlineMessageSubject']:_0x4926b8,'messageId':'','sentAt':new Date(),'attach':_0x5296da['length'],'attachments':_0x5296da,'originChannel':'Chat','ChatWebsiteId':_0x18595d['id'],'ChatOfflineMessageId':_0x4e2c05['id'],'originTo':_0x18595d['MailAccount'][_0x1bdf('0xf6')]},'body':_0x4e2c05['body']};var _0x54eec6={'account':{'id':_0x18595d[_0x1bdf('0xfc')]},'body':_0x594b47,'log':_0x1bdf('0xfd')};return respondWithRpcPromise(_0x1bdf('0xfd'),'notifyMail',_0x54eec6,client9001)[_0x1bdf('0x23')](function(){return _0x4e2c05;})[_0x1bdf('0x2d')](function(_0x382e03){console[_0x1bdf('0x29')](_0x382e03);});}return;})[_0x1bdf('0x23')](function(){if(_0x4e2c05){return _0x4e2c05;}})['then'](respondWithResult(_0x5631f3,null))[_0x1bdf('0x2d')](function(_0x3db91d){console[_0x1bdf('0x29')]('catch',_0x3db91d);for(var _0x179ad8 of _0x530224){var _0x50a03d=path['join'](config[_0x1bdf('0x82')],_0x1bdf('0xe4'),_0x1bdf('0xd6'),_0x1bdf('0xe5'),_0x1bdf('0xe6'),_0x179ad8[_0x1bdf('0x7a')]);fs_extra[_0x1bdf('0xfe')](_0x50a03d)[_0x1bdf('0x2d')](function(_0x1fb769){console[_0x1bdf('0x29')](_0x1bdf('0xff'),_0x50a03d,_0x1fb769);});}});};exports[_0x1bdf('0x100')]=function(_0x53ec6b,_0x1f7f76,_0x1cd85e){return db['ChatInteraction'][_0x1bdf('0x60')]({'where':{'id':_0x53ec6b['params']['id']}})['then'](handleEntityNotFound(_0x1f7f76,null))['then'](function(_0x336c89){if(_0x336c89){return _0x336c89[_0x1bdf('0x100')](_0x53ec6b[_0x1bdf('0x62')]['ids'],_[_0x1bdf('0x101')](_0x53ec6b[_0x1bdf('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x1f7f76,null))[_0x1bdf('0x2d')](handleError(_0x1f7f76,null));};exports[_0x1bdf('0x102')]=function(_0x265f9f,_0x3fe47e,_0x4ca5c3){var _0x1eb315={'raw':![],'where':{}};var _0x166769={};var _0x3b84f7={'count':0x0,'rows':[]};return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x265f9f[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x3fe47e,null))[_0x1bdf('0x23')](function(_0x5b8301){if(_0x5b8301){_0x166769[_0x1bdf('0x4c')]=_[_0x1bdf('0x48')](db[_0x1bdf('0xc0')][_0x1bdf('0x6f')]);_0x166769[_0x1bdf('0x49')]=_[_0x1bdf('0x48')](_0x265f9f['query']);_0x166769['filters']=_['intersection'](_0x166769['model'],_0x166769['query']);_0x1eb315[_0x1bdf('0x5f')]=_['intersection'](_0x166769[_0x1bdf('0x4c')],qs[_0x1bdf('0x4d')](_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x1eb315[_0x1bdf('0x5f')]=_0x1eb315[_0x1bdf('0x5f')][_0x1bdf('0x4e')]?_0x1eb315[_0x1bdf('0x5f')]:_0x166769['model'];if(!_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x4f')](_0x1bdf('0x50'))){_0x1eb315[_0x1bdf('0x32')]=qs[_0x1bdf('0x32')](_0x265f9f['query']['limit']);_0x1eb315['offset']=qs[_0x1bdf('0x2f')](_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x2f')]);}_0x1eb315[_0x1bdf('0x51')]=qs[_0x1bdf('0x52')](_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x52')]);_0x1eb315[_0x1bdf('0x55')]=qs[_0x1bdf('0x4a')](_['pick'](_0x265f9f[_0x1bdf('0x49')],_0x166769[_0x1bdf('0x4a')]));_0x1eb315[_0x1bdf('0x55')][_0x1bdf('0x70')]=_0x5b8301['id'];if(_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x54')]){_0x1eb315[_0x1bdf('0x55')]=_[_0x1bdf('0x56')](_0x1eb315[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x1eb315['attributes'],function(_0x391064){var _0x2b4384={};_0x2b4384[_0x391064]={'$like':'%'+_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x54')]+'%'};return _0x2b4384;})});}_0x1eb315=_[_0x1bdf('0x56')]({},_0x1eb315,_0x265f9f['options']);return db[_0x1bdf('0xc0')][_0x1bdf('0x31')]({'where':_0x1eb315[_0x1bdf('0x55')]})['then'](function(_0x51c87d){_0x3b84f7['count']=_0x51c87d;if(_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x59')]){_0x1eb315[_0x1bdf('0x5a')]=[{'model':db[_0x1bdf('0x96')],'as':_0x1bdf('0x103'),'required':![]},{'model':db[_0x1bdf('0xcc')],'as':_0x1bdf('0x104'),'attributes':['name','fullname','internal'],'required':![]},{'model':db[_0x1bdf('0x105')],'as':_0x1bdf('0x106'),'attributes':['id','name',_0x1bdf('0x107')],'where':_0x265f9f[_0x1bdf('0x49')]['tag']?{'id':_0x265f9f[_0x1bdf('0x49')][_0x1bdf('0x108')]}:undefined,'required':_0x265f9f['query']['tag']?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1eb315);})[_0x1bdf('0x23')](function(_0x2782db){_0x3b84f7[_0x1bdf('0x5c')]=_0x2782db;return _0x3b84f7;});}})[_0x1bdf('0x23')](respondWithFilteredResult(_0x3fe47e,_0x1eb315))[_0x1bdf('0x2d')](handleError(_0x3fe47e,null));};function iftimePromise(_0x4a34e2,_0x1d2372){return respondWithRpcPromise(_0x1bdf('0x109'),'getSnippet',{'command':_0x1d2372['timezone']?util[_0x1bdf('0xbd')](_0x1bdf('0x10a'),_0x4a34e2[_0x1bdf('0x10b')],_0x1d2372['timezone']):util[_0x1bdf('0xbd')](_0x1bdf('0x10c'),_0x4a34e2[_0x1bdf('0x10b')])},client9002)[_0x1bdf('0x23')](function(_0x5ef351){var _0x304572=_0x5ef351&&_0x5ef351[_0x1bdf('0x10d')](_0x1bdf('0x10e'))>=0x0?!![]:![];logger['info'](_0x1bdf('0x10f'),_0x1d2372['id'],_0x4a34e2['id'],_0x4a34e2['interval'],_0x304572?_0x1bdf('0x110'):_0x1bdf('0x111'),_0x1d2372[_0x1bdf('0x112')]?_0x1d2372[_0x1bdf('0x112')]:_0x1bdf('0x113'));return _0x304572;})[_0x1bdf('0x2d')](function(_0x316b9b){logger[_0x1bdf('0x29')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x1d2372['id'],_0x4a34e2['id'],_0x4a34e2[_0x1bdf('0x10b')],util[_0x1bdf('0x114')](_0x316b9b,{'showHidden':![],'depth':null}),_0x1d2372['timezone']?_0x1d2372[_0x1bdf('0x112')]:_0x1bdf('0x113'));return![];});}exports[_0x1bdf('0x115')]=function(_0x45723e,_0xfa1cd1,_0x38787d){var _0x4400cc=0x0;var _0xc59f7e=0x0;var _0x250597=![];var _0x1a425a;var _0xbe410b;return db['ChatWebsite'][_0x1bdf('0x60')]({'where':{'id':_0x45723e['params']['id']},'include':[{'model':db[_0x1bdf('0x116')],'as':_0x1bdf('0x116'),'include':[{'model':db[_0x1bdf('0x116')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x1bdf('0x23')](handleEntityNotFound(_0xfa1cd1,null))[_0x1bdf('0x23')](function(_0x57aba8){if(_0x57aba8){_0x1a425a=_0x57aba8;return _0x57aba8[_0x1bdf('0x117')]({'raw':!![]});}})['then'](function(_0x524348){if(_0x1a425a){if(_0x524348){_0xbe410b=_0x524348;}}return require(_0x1bdf('0x19'))[_0x1bdf('0x84')]();})['then'](function(_0xee9e11){if(_0xee9e11){_0xc59f7e=_0xee9e11[_0x1bdf('0x118')];_0x250597=_0xee9e11['custom'];}})[_0x1bdf('0x23')](function(){return db['ChatInteraction'][_0x1bdf('0x31')]({'where':{'closed':![]}});})['then'](function(_0x567a3f){_0x4400cc=_0x567a3f;if(_0xc59f7e&&_0x567a3f>_0xc59f7e){return db['License'][_0x1bdf('0x6e')]({'where':{'id':0x1}})[_0x1bdf('0x23')](function(_0x9dfcbd){if(_0x9dfcbd){_0x9dfcbd[_0x1bdf('0x119')]('chatLicenseExceeded');}});}})[_0x1bdf('0x23')](function(){if(_0x1a425a[_0x1bdf('0x116')]&&_0x1a425a[_0x1bdf('0x116')]['Intervals']){var _0x5c331e=[];for(var _0x22579e=0x0;_0x22579e<_0x1a425a[_0x1bdf('0x116')][_0x1bdf('0x11a')][_0x1bdf('0x4e')];_0x22579e++){var _0x272d2a=_0x1a425a[_0x1bdf('0x116')]['Intervals'][_0x22579e][_0x1bdf('0x38')]({'plain':!![]});_0x5c331e[_0x1bdf('0x11b')](iftimePromise(_0x272d2a,_0x1a425a));}return BPromise[_0x1bdf('0x11c')](_0x5c331e)['then'](function(_0x3f4bdf){return _[_0x1bdf('0x11d')](_0x3f4bdf);});}else{return!![];}})[_0x1bdf('0x23')](function(_0x54d9e2){var _0x5ba69c=fs[_0x1bdf('0x11e')](path['join'](config[_0x1bdf('0x82')],_0x1bdf('0x11f')),_0x1bdf('0xde'));var _0x5b3400={'remote':_0x1a425a[_0x1bdf('0x120')],'query':querystring[_0x1bdf('0xbe')](_[_0x1bdf('0x56')](_0x1a425a[_0x1bdf('0x38')]({'plain':!![]}),{'customerIp':_0x45723e['headers'][_0x1bdf('0xb2')]||_0x45723e[_0x1bdf('0xb1')][_0x1bdf('0x121')]||_0x45723e[_0x1bdf('0x122')][_0x1bdf('0x123')]||_0x45723e['ip'],'referer':_0x45723e[_0x1bdf('0xb1')][_0x1bdf('0x124')],'openedInteractions':_0x4400cc,'maxInteractions':_0xc59f7e,'virtual':_0x250597[_0x1bdf('0x118')],'online':_0x54d9e2,'custom':_0x250597}))['replace'](/'/g,'\x5c\x27')};_0xfa1cd1['send'](ejs[_0x1bdf('0xdf')](Mustache[_0x1bdf('0xdf')](_0x5ba69c,_0x5b3400),{'proactiveActions':_0xbe410b,'alignment':_0x1a425a[_0x1bdf('0x125')],'verticalAlignment':_0x1a425a[_0x1bdf('0x126')],'div_color':_0x1a425a[_0x1bdf('0x107')],'text_color':_0x1a425a[_0x1bdf('0x127')],'button_color':_0x1a425a['color_button'],'background_color':_0x1a425a[_0x1bdf('0x128')]}));})[_0x1bdf('0x2d')](handleError(_0xfa1cd1,null));};exports[_0x1bdf('0x129')]=function(_0x5c2493,_0x398dab,_0x4dbbe0){return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x5c2493[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x398dab,null))['then'](function(_0x241dca){if(_0x241dca){return db[_0x1bdf('0x12a')][_0x1bdf('0x12b')](function(_0x1ab67a){return db[_0x1bdf('0x12c')][_0x1bdf('0x3b')]({'where':{'ChatWebsiteId':_0x5c2493[_0x1bdf('0x5e')]['id']},'transaction':_0x1ab67a})['then'](function(_0x507f1b){var _0x3980c7=_[_0x1bdf('0x44')](_0x5c2493[_0x1bdf('0x62')],function(_0x8425ef){_0x8425ef['ChatWebsiteId']=_0x5c2493['params']['id'];return _0x8425ef;});return db['ChatApplication'][_0x1bdf('0xe9')](_0x3980c7,{'transaction':_0x1ab67a});});})[_0x1bdf('0x23')](function(){return db[_0x1bdf('0x12c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x5c2493[_0x1bdf('0x5e')]['id']},'order':_0x1bdf('0xab')});});}})[_0x1bdf('0x23')](respondWithResult(_0x398dab,null))[_0x1bdf('0x2d')](handleError(_0x398dab,null));};exports['getApplications']=function(_0x34c55f,_0xa255cb,_0x5f916b){var _0x4a10fe={};var _0x4902e9={};var _0x398c5f;var _0x1963d5;return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x34c55f[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0xa255cb,null))[_0x1bdf('0x23')](function(_0xbacf2a){if(_0xbacf2a){_0x398c5f=_0xbacf2a;_0x4902e9[_0x1bdf('0x4c')]=_[_0x1bdf('0x48')](db[_0x1bdf('0x12c')][_0x1bdf('0x6f')]);_0x4902e9[_0x1bdf('0x49')]=_['keys'](_0x34c55f[_0x1bdf('0x49')]);_0x4902e9['filters']=_[_0x1bdf('0x4b')](_0x4902e9['model'],_0x4902e9[_0x1bdf('0x49')]);_0x4a10fe[_0x1bdf('0x5f')]=_[_0x1bdf('0x4b')](_0x4902e9[_0x1bdf('0x4c')],qs[_0x1bdf('0x4d')](_0x34c55f['query'][_0x1bdf('0x4d')]));_0x4a10fe[_0x1bdf('0x5f')]=_0x4a10fe[_0x1bdf('0x5f')][_0x1bdf('0x4e')]?_0x4a10fe[_0x1bdf('0x5f')]:_0x4902e9[_0x1bdf('0x4c')];_0x4a10fe['order']=qs['sort'](_0x34c55f[_0x1bdf('0x49')][_0x1bdf('0x52')]);_0x4a10fe['where']=qs[_0x1bdf('0x4a')](_[_0x1bdf('0x53')](_0x34c55f['query'],_0x4902e9['filters']));if(_0x34c55f[_0x1bdf('0x49')][_0x1bdf('0x54')]){_0x4a10fe[_0x1bdf('0x55')]=_['merge'](_0x4a10fe[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x4a10fe[_0x1bdf('0x5f')],function(_0x5b2d20){var _0x4212a6={};_0x4212a6[_0x5b2d20]={'$like':'%'+_0x34c55f[_0x1bdf('0x49')][_0x1bdf('0x54')]+'%'};return _0x4212a6;})});}_0x4a10fe=_[_0x1bdf('0x56')]({},_0x4a10fe,_0x34c55f[_0x1bdf('0x58')]);return _0x398c5f[_0x1bdf('0x12d')](_0x4a10fe);}})['then'](function(_0x148022){if(_0x148022){_0x1963d5=_0x148022['length'];if(!_0x34c55f[_0x1bdf('0x49')][_0x1bdf('0x4f')](_0x1bdf('0x50'))){_0x4a10fe[_0x1bdf('0x32')]=qs[_0x1bdf('0x32')](_0x34c55f['query'][_0x1bdf('0x32')]);_0x4a10fe[_0x1bdf('0x2f')]=qs[_0x1bdf('0x2f')](_0x34c55f[_0x1bdf('0x49')][_0x1bdf('0x2f')]);}return _0x398c5f[_0x1bdf('0x12d')](_0x4a10fe);}})[_0x1bdf('0x23')](function(_0x3e83a0){if(_0x3e83a0){return _0x3e83a0?{'count':_0x1963d5,'rows':_0x3e83a0}:null;}})[_0x1bdf('0x23')](respondWithResult(_0xa255cb,null))[_0x1bdf('0x2d')](handleError(_0xa255cb,null));};exports[_0x1bdf('0x12e')]=function(_0x49f57d,_0x329460,_0x4f6e0f){return db[_0x1bdf('0x12f')][_0x1bdf('0x60')]({'where':{'id':_0x49f57d[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x329460,null))[_0x1bdf('0x23')](function(_0x4f0e42){if(_0x4f0e42){return _0x4f0e42[_0x1bdf('0x12e')](_0x49f57d[_0x1bdf('0x62')][_0x1bdf('0x72')],_[_0x1bdf('0x101')](_0x49f57d['body'],[_0x1bdf('0x72'),'id'])||{});}})['then'](respondWithResult(_0x329460,null))[_0x1bdf('0x2d')](handleError(_0x329460,null));};exports[_0x1bdf('0x117')]=function(_0x5c3eaf,_0x5b77ad,_0x556486){var _0x510f16={};var _0xe72f1a={};var _0x583dd6;var _0x5b7608;return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x5c3eaf[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x5b77ad,null))[_0x1bdf('0x23')](function(_0x1b43f1){if(_0x1b43f1){_0x583dd6=_0x1b43f1;_0xe72f1a[_0x1bdf('0x4c')]=_[_0x1bdf('0x48')](db[_0x1bdf('0x130')]['rawAttributes']);_0xe72f1a['query']=_[_0x1bdf('0x48')](_0x5c3eaf['query']);_0xe72f1a['filters']=_[_0x1bdf('0x4b')](_0xe72f1a['model'],_0xe72f1a[_0x1bdf('0x49')]);_0x510f16[_0x1bdf('0x5f')]=_[_0x1bdf('0x4b')](_0xe72f1a[_0x1bdf('0x4c')],qs[_0x1bdf('0x4d')](_0x5c3eaf[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x510f16[_0x1bdf('0x5f')]=_0x510f16[_0x1bdf('0x5f')][_0x1bdf('0x4e')]?_0x510f16[_0x1bdf('0x5f')]:_0xe72f1a[_0x1bdf('0x4c')];_0x510f16[_0x1bdf('0x51')]=qs[_0x1bdf('0x52')](_0x5c3eaf[_0x1bdf('0x49')]['sort']);_0x510f16[_0x1bdf('0x55')]=qs[_0x1bdf('0x4a')](_['pick'](_0x5c3eaf[_0x1bdf('0x49')],_0xe72f1a['filters']));if(_0x5c3eaf[_0x1bdf('0x49')][_0x1bdf('0x54')]){_0x510f16['where']=_[_0x1bdf('0x56')](_0x510f16[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x510f16[_0x1bdf('0x5f')],function(_0x270396){var _0x507577={};_0x507577[_0x270396]={'$like':'%'+_0x5c3eaf['query'][_0x1bdf('0x54')]+'%'};return _0x507577;})});}_0x510f16=_[_0x1bdf('0x56')]({},_0x510f16,_0x5c3eaf[_0x1bdf('0x58')]);return _0x583dd6[_0x1bdf('0x117')](_0x510f16);}})[_0x1bdf('0x23')](function(_0x507189){if(_0x507189){_0x5b7608=_0x507189[_0x1bdf('0x4e')];if(!_0x5c3eaf[_0x1bdf('0x49')]['hasOwnProperty']('nolimit')){_0x510f16[_0x1bdf('0x32')]=qs[_0x1bdf('0x32')](_0x5c3eaf[_0x1bdf('0x49')]['limit']);_0x510f16['offset']=qs[_0x1bdf('0x2f')](_0x5c3eaf['query'][_0x1bdf('0x2f')]);}return _0x583dd6[_0x1bdf('0x117')](_0x510f16);}})[_0x1bdf('0x23')](function(_0x189985){if(_0x189985){return _0x189985?{'count':_0x5b7608,'rows':_0x189985}:null;}})[_0x1bdf('0x23')](respondWithResult(_0x5b77ad,null))[_0x1bdf('0x2d')](handleError(_0x5b77ad,null));};exports['getFields']=function(_0x141be1,_0x125e20,_0x8b014b){var _0x26439f=_0x141be1[_0x1bdf('0x49')][_0x1bdf('0x131')]===_0x1bdf('0x132')?_0x1bdf('0x133'):_0x1bdf('0x134');return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'attributes':['id',_0x26439f],'where':{'id':_0x141be1['params']['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x125e20,null))[_0x1bdf('0x23')](function(_0x305ce5){if(_0x305ce5){var _0x3b4aeb=_0x305ce5[_0x26439f];var _0x2b5851=_0x3b4aeb&&_0x3b4aeb[_0x1bdf('0x135')]?_0x3b4aeb['items']:[];_0x125e20[_0x1bdf('0x40')]({'fromKey':_[_0x1bdf('0x86')](_0x3b4aeb['fromKey'])?undefined:_0x3b4aeb['fromKey'],'count':_0x2b5851[_0x1bdf('0x4e')],'rows':_0x2b5851});}})[_0x1bdf('0x2d')](handleError(_0x125e20,null));};exports[_0x1bdf('0x136')]=function(_0x32f3eb,_0x5262e5,_0x141821){var _0x4cb5f0={'raw':![],'where':{}};var _0x2c6806={};var _0x3740a7={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x1bdf('0x6e')]({'where':{'id':_0x32f3eb['params']['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x5262e5,null))['then'](function(_0x51fa02){if(_0x51fa02){_0x2c6806[_0x1bdf('0x4c')]=_['keys'](db[_0x1bdf('0xe2')]['rawAttributes']);_0x2c6806[_0x1bdf('0x49')]=_[_0x1bdf('0x48')](_0x32f3eb[_0x1bdf('0x49')]);_0x2c6806[_0x1bdf('0x4a')]=_[_0x1bdf('0x4b')](_0x2c6806[_0x1bdf('0x4c')],_0x2c6806[_0x1bdf('0x49')]);_0x4cb5f0[_0x1bdf('0x5f')]=_[_0x1bdf('0x4b')](_0x2c6806[_0x1bdf('0x4c')],qs[_0x1bdf('0x4d')](_0x32f3eb[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x4cb5f0[_0x1bdf('0x5f')]=_0x4cb5f0[_0x1bdf('0x5f')][_0x1bdf('0x4e')]?_0x4cb5f0['attributes']:_0x2c6806['model'];if(!_0x32f3eb[_0x1bdf('0x49')]['hasOwnProperty'](_0x1bdf('0x50'))){_0x4cb5f0[_0x1bdf('0x32')]=qs[_0x1bdf('0x32')](_0x32f3eb[_0x1bdf('0x49')][_0x1bdf('0x32')]);_0x4cb5f0[_0x1bdf('0x2f')]=qs[_0x1bdf('0x2f')](_0x32f3eb[_0x1bdf('0x49')][_0x1bdf('0x2f')]);}_0x4cb5f0[_0x1bdf('0x51')]=qs['sort'](_0x32f3eb[_0x1bdf('0x49')][_0x1bdf('0x52')]);_0x4cb5f0[_0x1bdf('0x55')]=qs[_0x1bdf('0x4a')](_['pick'](_0x32f3eb[_0x1bdf('0x49')],_0x2c6806[_0x1bdf('0x4a')]));_0x4cb5f0[_0x1bdf('0x55')][_0x1bdf('0x70')]=_0x51fa02['id'];if(_0x32f3eb[_0x1bdf('0x49')]['filter']){_0x4cb5f0[_0x1bdf('0x55')]=_[_0x1bdf('0x56')](_0x4cb5f0[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x4cb5f0[_0x1bdf('0x5f')],function(_0x3fa75f){var _0x12dc71={};_0x12dc71[_0x3fa75f]={'$like':'%'+_0x32f3eb[_0x1bdf('0x49')]['filter']+'%'};return _0x12dc71;})});}_0x4cb5f0=_[_0x1bdf('0x56')]({},_0x4cb5f0,_0x32f3eb[_0x1bdf('0x58')]);return db[_0x1bdf('0xe2')][_0x1bdf('0x31')]({'where':_0x4cb5f0[_0x1bdf('0x55')]})[_0x1bdf('0x23')](function(_0x6a13bf){_0x3740a7[_0x1bdf('0x31')]=_0x6a13bf;if(_0x32f3eb['query']['includeAll']){_0x4cb5f0[_0x1bdf('0x5a')]=[{'all':!![]}];}else{_0x4cb5f0[_0x1bdf('0x5a')]=[{'model':db['CmContact'],'as':_0x1bdf('0x103'),'required':![]},{'model':db[_0x1bdf('0xe8')],'as':_0x1bdf('0x137'),'required':![]}];}return db[_0x1bdf('0xe2')][_0x1bdf('0x5b')](_0x4cb5f0);})[_0x1bdf('0x23')](function(_0x40a09a){_0x3740a7[_0x1bdf('0x5c')]=_0x40a09a;return _0x3740a7;});}})[_0x1bdf('0x23')](respondWithFilteredResult(_0x5262e5,_0x4cb5f0))[_0x1bdf('0x2d')](handleError(_0x5262e5,null));};exports[_0x1bdf('0x138')]=function(_0x38df5c,_0x49a729,_0x2d51a7){return db['ChatWebsite']['find']({'where':{'id':_0x38df5c['params']['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x49a729,null))[_0x1bdf('0x23')](function(_0x146ecb){if(_0x146ecb){return _0x146ecb[_0x1bdf('0x138')](_0x38df5c[_0x1bdf('0x62')][_0x1bdf('0x72')],_[_0x1bdf('0x101')](_0x38df5c[_0x1bdf('0x62')],[_0x1bdf('0x72'),'id'])||{})['spread'](function(_0x55235a){for(var _0x18cad2=0x0;_0x18cad2<_0x38df5c[_0x1bdf('0x62')][_0x1bdf('0x72')]['length'];_0x18cad2+=0x1){socket[_0x1bdf('0x139')](_0x1bdf('0x13a'),{'UserId':Number(_0x38df5c['body'][_0x1bdf('0x72')][_0x18cad2]),'ChatWebsiteId':Number(_0x38df5c[_0x1bdf('0x5e')]['id'])});}return _0x55235a;});}})[_0x1bdf('0x23')](respondWithResult(_0x49a729,null))[_0x1bdf('0x2d')](handleError(_0x49a729,null));};exports[_0x1bdf('0x13b')]=function(_0xa5f68b,_0x3b8797,_0x22afde){return db[_0x1bdf('0x45')][_0x1bdf('0x60')]({'where':{'id':_0xa5f68b[_0x1bdf('0x5e')]['id']}})[_0x1bdf('0x23')](handleEntityNotFound(_0x3b8797,null))[_0x1bdf('0x23')](function(_0x134a53){if(_0x134a53){return _0x134a53[_0x1bdf('0x13b')](_0xa5f68b[_0x1bdf('0x49')][_0x1bdf('0x72')])[_0x1bdf('0x23')](function(){if(_[_0x1bdf('0x13c')](_0xa5f68b[_0x1bdf('0x49')][_0x1bdf('0x72')])){for(var _0x50643e=0x0;_0x50643e<_0xa5f68b[_0x1bdf('0x49')]['ids'][_0x1bdf('0x4e')];_0x50643e+=0x1){socket[_0x1bdf('0x139')](_0x1bdf('0x13d'),{'UserId':Number(_0xa5f68b[_0x1bdf('0x49')][_0x1bdf('0x72')][_0x50643e]),'ChatWebsiteId':Number(_0xa5f68b[_0x1bdf('0x5e')]['id'])});}}else{socket[_0x1bdf('0x139')](_0x1bdf('0x13d'),{'UserId':Number(_0xa5f68b[_0x1bdf('0x49')][_0x1bdf('0x72')]),'ChatWebsiteId':Number(_0xa5f68b[_0x1bdf('0x5e')]['id'])});}});}})[_0x1bdf('0x23')](respondWithStatusCode(_0x3b8797,null))[_0x1bdf('0x2d')](handleError(_0x3b8797,null));};exports[_0x1bdf('0x13e')]=function(_0x2230a0,_0x137241,_0x4a81fc){var _0x5be022={};var _0x2dbb11={};var _0xa0dee0;var _0x589293;return db[_0x1bdf('0x45')][_0x1bdf('0x6e')]({'where':{'id':_0x2230a0[_0x1bdf('0x5e')]['id']}})['then'](handleEntityNotFound(_0x137241,null))[_0x1bdf('0x23')](function(_0x46d544){if(_0x46d544){_0xa0dee0=_0x46d544;_0x2dbb11['model']=_['keys'](db['User'][_0x1bdf('0x6f')]);_0x2dbb11[_0x1bdf('0x49')]=_[_0x1bdf('0x48')](_0x2230a0[_0x1bdf('0x49')]);_0x2dbb11[_0x1bdf('0x4a')]=_['intersection'](_0x2dbb11[_0x1bdf('0x4c')],_0x2dbb11['query']);_0x5be022[_0x1bdf('0x5f')]=_['intersection'](_0x2dbb11['model'],qs[_0x1bdf('0x4d')](_0x2230a0[_0x1bdf('0x49')][_0x1bdf('0x4d')]));_0x5be022[_0x1bdf('0x5f')]=_0x5be022[_0x1bdf('0x5f')]['length']?_0x5be022[_0x1bdf('0x5f')]:_0x2dbb11[_0x1bdf('0x4c')];_0x5be022['order']=qs[_0x1bdf('0x52')](_0x2230a0['query'][_0x1bdf('0x52')]);_0x5be022[_0x1bdf('0x55')]=qs[_0x1bdf('0x4a')](_[_0x1bdf('0x53')](_0x2230a0['query'],_0x2dbb11['filters']));if(_0x2230a0['query'][_0x1bdf('0x54')]){_0x5be022['where']=_[_0x1bdf('0x56')](_0x5be022[_0x1bdf('0x55')],{'$or':_[_0x1bdf('0x44')](_0x5be022['attributes'],function(_0xf0deda){var _0x6ad04d={};_0x6ad04d[_0xf0deda]={'$like':'%'+_0x2230a0['query'][_0x1bdf('0x54')]+'%'};return _0x6ad04d;})});}_0x5be022=_[_0x1bdf('0x56')]({},_0x5be022,_0x2230a0[_0x1bdf('0x58')]);return _0xa0dee0[_0x1bdf('0x13e')](_0x5be022);}})['then'](function(_0x4085b3){if(_0x4085b3){_0x589293=_0x4085b3['length'];if(!_0x2230a0[_0x1bdf('0x49')]['hasOwnProperty'](_0x1bdf('0x50'))){_0x5be022[_0x1bdf('0x32')]=qs['limit'](_0x2230a0[_0x1bdf('0x49')][_0x1bdf('0x32')]);_0x5be022[_0x1bdf('0x2f')]=qs[_0x1bdf('0x2f')](_0x2230a0['query'][_0x1bdf('0x2f')]);}return _0xa0dee0[_0x1bdf('0x13e')](_0x5be022);}})['then'](function(_0x4e76ae){if(_0x4e76ae){return _0x4e76ae?{'count':_0x589293,'rows':_0x4e76ae}:null;}})[_0x1bdf('0x23')](respondWithResult(_0x137241,null))['catch'](handleError(_0x137241,null));};
\ No newline at end of file
+var _0xeaa4=['No\x20timezone','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','include','findAll','show','params','includeAll','options','find','create','body','user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','hasOwnProperty','pick','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','join','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','chat','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','DESC','ChatApplication','Applications','list','orderBy','asc','account','Contacts','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','format','%s\x20%s','version','unknown','browser','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','applications','push','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','Start','startRouting','EventManager','offline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','pass','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','mapValues','firstName','offlineMessageSubject','MailAccountId','NotifyMailAccount','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','OFFLINE'];(function(_0x29b3b9,_0x509d0a){var _0x21cdde=function(_0x2537b6){while(--_0x2537b6){_0x29b3b9['push'](_0x29b3b9['shift']());}};_0x21cdde(++_0x509d0a);}(_0xeaa4,0x15a));var _0x4eaa=function(_0x5901df,_0x127ebb){_0x5901df=_0x5901df-0x0;var _0x573cac=_0xeaa4[_0x5901df];return _0x573cac;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4eaa('0x0'));var jsonpatch=require(_0x4eaa('0x1'));var rp=require(_0x4eaa('0x2'));var moment=require(_0x4eaa('0x3'));var BPromise=require(_0x4eaa('0x4'));var Mustache=require(_0x4eaa('0x5'));var util=require(_0x4eaa('0x6'));var path=require(_0x4eaa('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4eaa('0x8'));var fs=require('fs');var fs_extra=require(_0x4eaa('0x9'));var _=require(_0x4eaa('0xa'));var squel=require(_0x4eaa('0xb'));var crypto=require(_0x4eaa('0xc'));var jsforce=require(_0x4eaa('0xd'));var deskjs=require(_0x4eaa('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4eaa('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4eaa('0x10'));var logger=require(_0x4eaa('0x11'))(_0x4eaa('0x12'));var utils=require(_0x4eaa('0x13'));var config=require(_0x4eaa('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4eaa('0x15')]=_[_0x4eaa('0x16')](config[_0x4eaa('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4eaa('0x15')]));require('./chatWebsite.socket')[_0x4eaa('0x17')](socket);var jayson=require(_0x4eaa('0x18'));var client=jayson[_0x4eaa('0x19')][_0x4eaa('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x4eaa('0x1a')]({'port':0x232a});var client9003=jayson['client'][_0x4eaa('0x1a')]({'port':0x232b});var client9001=jayson['client'][_0x4eaa('0x1a')]({'port':0x2329});function respondWithRpcPromise(_0x5a5eb0,_0x9ec560,_0x4dc734,_0x3954a8){return new BPromise(function(_0x355791,_0x5f5108){var _0x442d7c=_0x3954a8||client;return _0x442d7c[_0x4eaa('0x1b')](_0x5a5eb0,_0x4dc734)[_0x4eaa('0x1c')](function(_0x3b8d80){logger[_0x4eaa('0x1d')](_0x4eaa('0x1e'),_0x9ec560,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x9ec560,_0x4eaa('0x1f'),JSON[_0x4eaa('0x20')](_0x3b8d80));if(_0x3b8d80[_0x4eaa('0x21')]){if(_0x3b8d80[_0x4eaa('0x21')][_0x4eaa('0x22')]===0x1f4){logger[_0x4eaa('0x21')](_0x4eaa('0x1e'),_0x9ec560,_0x3b8d80[_0x4eaa('0x21')][_0x4eaa('0x23')]);return _0x5f5108(_0x3b8d80['error']['message']);}logger['error'](_0x4eaa('0x1e'),_0x9ec560,_0x3b8d80[_0x4eaa('0x21')][_0x4eaa('0x23')]);return _0x355791(_0x3b8d80[_0x4eaa('0x21')][_0x4eaa('0x23')]);}else{logger['info'](_0x4eaa('0x1e'),_0x9ec560,_0x4eaa('0x1f'));_0x355791(_0x3b8d80[_0x4eaa('0x24')][_0x4eaa('0x23')]);}})[_0x4eaa('0x25')](function(_0x5e4539){logger[_0x4eaa('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x9ec560,_0x5e4539);_0x5f5108(_0x5e4539);});});}function respondWithStatusCode(_0x218c79,_0x376e85){_0x376e85=_0x376e85||0xcc;return function(_0x30e835){if(_0x30e835){return _0x218c79['sendStatus'](_0x376e85);}return _0x218c79[_0x4eaa('0x26')](_0x376e85)[_0x4eaa('0x27')]();};}function respondWithResult(_0x4715ca,_0x55f134){_0x55f134=_0x55f134||0xc8;return function(_0x1761d2){if(_0x1761d2){return _0x4715ca[_0x4eaa('0x26')](_0x55f134)[_0x4eaa('0x28')](_0x1761d2);}};}function respondWithFilteredResult(_0x57e70f,_0x3288e1){return function(_0x5be637){if(_0x5be637){var _0x3845e5=typeof _0x3288e1[_0x4eaa('0x29')]===_0x4eaa('0x2a')&&typeof _0x3288e1[_0x4eaa('0x2b')]===_0x4eaa('0x2a');var _0x10c19=_0x5be637[_0x4eaa('0x2c')];var _0x33ba81=_0x3845e5?0x0:_0x3288e1[_0x4eaa('0x29')];var _0x176a23=_0x3845e5?_0x5be637[_0x4eaa('0x2c')]:_0x3288e1['offset']+_0x3288e1[_0x4eaa('0x2b')];var _0x4977ef;if(_0x176a23>=_0x10c19){_0x176a23=_0x10c19;_0x4977ef=0xc8;}else{_0x4977ef=0xce;}_0x57e70f['status'](_0x4977ef);return _0x57e70f[_0x4eaa('0x2d')](_0x4eaa('0x2e'),_0x33ba81+'-'+_0x176a23+'/'+_0x10c19)[_0x4eaa('0x28')](_0x5be637);}return null;};}function patchUpdates(_0x5efcf5){return function(_0x2e72c3){try{jsonpatch[_0x4eaa('0x2f')](_0x2e72c3,_0x5efcf5,!![]);}catch(_0x22405d){return BPromise[_0x4eaa('0x30')](_0x22405d);}return _0x2e72c3[_0x4eaa('0x31')]();};}function saveUpdates(_0x6c3479,_0x2502b9){return function(_0x22d664){if(_0x22d664){return _0x22d664[_0x4eaa('0x32')](_0x6c3479)['then'](function(_0x5af51d){return _0x5af51d;});}return null;};}function removeEntity(_0x5e6c6f,_0x288976){return function(_0x154151){if(_0x154151){return _0x154151[_0x4eaa('0x33')]()[_0x4eaa('0x1c')](function(){var _0x1bff84=_0x154151[_0x4eaa('0x34')]({'plain':!![]});var _0x574ecb=_0x4eaa('0x35');return db[_0x4eaa('0x36')][_0x4eaa('0x33')]({'where':{'type':_0x574ecb,'resourceId':_0x1bff84['id']}})[_0x4eaa('0x1c')](function(){return _0x154151;});})[_0x4eaa('0x1c')](function(){_0x5e6c6f[_0x4eaa('0x26')](0xcc)[_0x4eaa('0x27')]();});}};}function handleEntityNotFound(_0x1b2af6,_0x1e766c){return function(_0x5ef79a){if(!_0x5ef79a){_0x1b2af6['sendStatus'](0x194);}return _0x5ef79a;};}function handleError(_0x42505d,_0x2458d4){_0x2458d4=_0x2458d4||0x1f4;return function(_0x48a63a){logger[_0x4eaa('0x21')](_0x48a63a[_0x4eaa('0x37')]);if(_0x48a63a['name']){delete _0x48a63a[_0x4eaa('0x38')];}_0x42505d['status'](_0x2458d4)['send'](_0x48a63a);};}exports[_0x4eaa('0x39')]=function(_0xa2a8d,_0x21611c){var _0xf1e5bc={'include':[{'model':db[_0x4eaa('0x3a')],'as':_0x4eaa('0x3b')}]},_0x5cc740={},_0x31406a={'count':0x0,'rows':[]};var _0x938271=_[_0x4eaa('0x3c')](db[_0x4eaa('0x3d')][_0x4eaa('0x3e')],function(_0x568675){return{'name':_0x568675[_0x4eaa('0x3f')],'type':_0x568675['type']['key']};});_0x5cc740[_0x4eaa('0x40')]=_[_0x4eaa('0x3c')](_0x938271,_0x4eaa('0x38'));_0x5cc740[_0x4eaa('0x41')]=_[_0x4eaa('0x42')](_0xa2a8d[_0x4eaa('0x41')]);_0x5cc740[_0x4eaa('0x43')]=_[_0x4eaa('0x44')](_0x5cc740[_0x4eaa('0x40')],_0x5cc740[_0x4eaa('0x41')]);_0xf1e5bc[_0x4eaa('0x45')]=_[_0x4eaa('0x44')](_0x5cc740[_0x4eaa('0x40')],qs[_0x4eaa('0x46')](_0xa2a8d[_0x4eaa('0x41')][_0x4eaa('0x46')]));_0xf1e5bc[_0x4eaa('0x45')]=_0xf1e5bc[_0x4eaa('0x45')][_0x4eaa('0x47')]?_0xf1e5bc[_0x4eaa('0x45')]:_0x5cc740[_0x4eaa('0x40')];if(!_0xa2a8d['query']['hasOwnProperty'](_0x4eaa('0x48'))){_0xf1e5bc[_0x4eaa('0x2b')]=qs[_0x4eaa('0x2b')](_0xa2a8d[_0x4eaa('0x41')][_0x4eaa('0x2b')]);_0xf1e5bc[_0x4eaa('0x29')]=qs[_0x4eaa('0x29')](_0xa2a8d[_0x4eaa('0x41')][_0x4eaa('0x29')]);}_0xf1e5bc[_0x4eaa('0x49')]=qs['sort'](_0xa2a8d[_0x4eaa('0x41')][_0x4eaa('0x4a')]);_0xf1e5bc[_0x4eaa('0x4b')]=qs['filters'](_['pick'](_0xa2a8d['query'],_0x5cc740['filters']),_0x938271);if(_0xa2a8d[_0x4eaa('0x41')][_0x4eaa('0x4c')]){_0xf1e5bc[_0x4eaa('0x4b')]=_[_0x4eaa('0x4d')](_0xf1e5bc[_0x4eaa('0x4b')],{'$or':_[_0x4eaa('0x3c')](_0x938271,function(_0x32ab41){if(_0x32ab41[_0x4eaa('0x4e')]!=='VIRTUAL'){var _0x3fd1b6={};_0x3fd1b6[_0x32ab41[_0x4eaa('0x38')]]={'$like':'%'+_0xa2a8d[_0x4eaa('0x41')]['filter']+'%'};return _0x3fd1b6;}})});}_0xf1e5bc=_[_0x4eaa('0x4d')]({},_0xf1e5bc,_0xa2a8d['options']);var _0x34fe36={'where':_0xf1e5bc[_0x4eaa('0x4b')]};return db[_0x4eaa('0x3d')][_0x4eaa('0x2c')](_0x34fe36)[_0x4eaa('0x1c')](function(_0x209d25){_0x31406a[_0x4eaa('0x2c')]=_0x209d25;if(_0xa2a8d[_0x4eaa('0x41')]['includeAll']){_0xf1e5bc[_0x4eaa('0x4f')]=[{'all':!![]}];}return db[_0x4eaa('0x3d')][_0x4eaa('0x50')](_0xf1e5bc);})['then'](function(_0x11f511){_0x31406a['rows']=_0x11f511;return _0x31406a;})[_0x4eaa('0x1c')](respondWithFilteredResult(_0x21611c,_0xf1e5bc))[_0x4eaa('0x25')](handleError(_0x21611c,null));};exports[_0x4eaa('0x51')]=function(_0x3c28de,_0x462a7d){var _0x4deb44={'raw':![],'where':{'id':_0x3c28de[_0x4eaa('0x52')]['id']},'include':[{'model':db[_0x4eaa('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1742f5={};_0x1742f5[_0x4eaa('0x40')]=_['keys'](db[_0x4eaa('0x3d')]['rawAttributes']);_0x1742f5[_0x4eaa('0x41')]=_[_0x4eaa('0x42')](_0x3c28de[_0x4eaa('0x41')]);_0x1742f5['filters']=_[_0x4eaa('0x44')](_0x1742f5[_0x4eaa('0x40')],_0x1742f5[_0x4eaa('0x41')]);_0x4deb44['attributes']=_[_0x4eaa('0x44')](_0x1742f5[_0x4eaa('0x40')],qs[_0x4eaa('0x46')](_0x3c28de[_0x4eaa('0x41')]['fields']));_0x4deb44['attributes']=_0x4deb44[_0x4eaa('0x45')][_0x4eaa('0x47')]?_0x4deb44[_0x4eaa('0x45')]:_0x1742f5[_0x4eaa('0x40')];if(_0x3c28de['query'][_0x4eaa('0x53')]){_0x4deb44[_0x4eaa('0x4f')]=[{'all':!![]}];}_0x4deb44=_[_0x4eaa('0x4d')]({},_0x4deb44,_0x3c28de[_0x4eaa('0x54')]);return db['ChatWebsite'][_0x4eaa('0x55')](_0x4deb44)['then'](handleEntityNotFound(_0x462a7d,null))[_0x4eaa('0x1c')](respondWithResult(_0x462a7d,null))[_0x4eaa('0x25')](handleError(_0x462a7d,null));};exports[_0x4eaa('0x56')]=function(_0x2c3922,_0x12b4bf){return db[_0x4eaa('0x3d')][_0x4eaa('0x56')](_0x2c3922[_0x4eaa('0x57')],{})[_0x4eaa('0x1c')](function(_0x3dc276){var _0x1132b6=_0x2c3922[_0x4eaa('0x58')][_0x4eaa('0x34')]({'plain':!![]});if(!_0x1132b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1132b6[_0x4eaa('0x59')]===_0x4eaa('0x58')){var _0x5af2a7=_0x3dc276[_0x4eaa('0x34')]({'plain':!![]});var _0x5d6314='ChatWebsites';return db['UserProfileSection'][_0x4eaa('0x55')]({'where':{'name':_0x5d6314,'userProfileId':_0x1132b6['userProfileId']},'raw':!![]})[_0x4eaa('0x1c')](function(_0x4bdd43){if(_0x4bdd43&&_0x4bdd43[_0x4eaa('0x5a')]===0x0){return db['UserProfileResource'][_0x4eaa('0x56')]({'name':_0x5af2a7['name'],'resourceId':_0x5af2a7['id'],'type':_0x4bdd43[_0x4eaa('0x38')],'sectionId':_0x4bdd43['id']},{})[_0x4eaa('0x1c')](function(){return _0x3dc276;});}else{return _0x3dc276;}})[_0x4eaa('0x25')](function(_0x2bedcb){logger[_0x4eaa('0x21')](_0x4eaa('0x5b'),_0x2bedcb);throw _0x2bedcb;});}return _0x3dc276;})[_0x4eaa('0x1c')](respondWithResult(_0x12b4bf,0xc9))[_0x4eaa('0x25')](handleError(_0x12b4bf,null));};exports['update']=function(_0x343f72,_0x403ff4){if(_0x343f72[_0x4eaa('0x57')]['id']){delete _0x343f72[_0x4eaa('0x57')]['id'];}return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x343f72[_0x4eaa('0x52')]['id']},'include':[{'model':db[_0x4eaa('0x3a')],'as':_0x4eaa('0x3b')}]})[_0x4eaa('0x1c')](handleEntityNotFound(_0x403ff4,null))[_0x4eaa('0x1c')](saveUpdates(_0x343f72['body'],null))[_0x4eaa('0x1c')](respondWithResult(_0x403ff4,null))[_0x4eaa('0x25')](handleError(_0x403ff4,null));};exports['destroy']=function(_0x3e6c11,_0x29246e){return db['ChatWebsite'][_0x4eaa('0x55')]({'where':{'id':_0x3e6c11[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x29246e,null))['then'](removeEntity(_0x29246e,null))[_0x4eaa('0x25')](handleError(_0x29246e,null));};exports[_0x4eaa('0x5c')]=function(_0xef9801,_0x16873d){return db[_0x4eaa('0x3d')][_0x4eaa('0x5c')]()[_0x4eaa('0x1c')](respondWithResult(_0x16873d,null))['catch'](handleError(_0x16873d,null));};exports[_0x4eaa('0x5d')]=function(_0x4229c6,_0x417e43,_0x5c9e0e){if(_0x4229c6[_0x4eaa('0x57')]['id']){delete _0x4229c6[_0x4eaa('0x57')]['id'];}return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x4229c6['params']['id']}})['then'](handleEntityNotFound(_0x417e43,null))[_0x4eaa('0x1c')](function(_0x5c7ec3){if(_0x5c7ec3){_0x4229c6[_0x4eaa('0x57')][_0x4eaa('0x5e')]=_0x5c7ec3['id'];return db['Disposition'][_0x4eaa('0x56')](_0x4229c6[_0x4eaa('0x57')]);}})[_0x4eaa('0x1c')](respondWithResult(_0x417e43,null))[_0x4eaa('0x25')](handleError(_0x417e43,null));};exports[_0x4eaa('0x5f')]=function(_0x5df14e,_0x489c81,_0x9d057b){var _0x4a5733={'raw':![],'where':{}};var _0x1ef969={};var _0x3ba4d5={'count':0x0,'rows':[]};return db[_0x4eaa('0x3d')][_0x4eaa('0x60')]({'where':{'id':_0x5df14e[_0x4eaa('0x52')]['id']}})['then'](handleEntityNotFound(_0x489c81,null))[_0x4eaa('0x1c')](function(_0x37157d){if(_0x37157d){_0x1ef969[_0x4eaa('0x40')]=_[_0x4eaa('0x42')](db[_0x4eaa('0x61')][_0x4eaa('0x3e')]);_0x1ef969[_0x4eaa('0x41')]=_[_0x4eaa('0x42')](_0x5df14e[_0x4eaa('0x41')]);_0x1ef969['filters']=_['intersection'](_0x1ef969['model'],_0x1ef969[_0x4eaa('0x41')]);_0x4a5733[_0x4eaa('0x45')]=_[_0x4eaa('0x44')](_0x1ef969[_0x4eaa('0x40')],qs['fields'](_0x5df14e[_0x4eaa('0x41')][_0x4eaa('0x46')]));_0x4a5733['attributes']=_0x4a5733[_0x4eaa('0x45')][_0x4eaa('0x47')]?_0x4a5733['attributes']:_0x1ef969[_0x4eaa('0x40')];if(!_0x5df14e['query'][_0x4eaa('0x62')](_0x4eaa('0x48'))){_0x4a5733[_0x4eaa('0x2b')]=qs[_0x4eaa('0x2b')](_0x5df14e[_0x4eaa('0x41')]['limit']);_0x4a5733[_0x4eaa('0x29')]=qs[_0x4eaa('0x29')](_0x5df14e[_0x4eaa('0x41')][_0x4eaa('0x29')]);}_0x4a5733[_0x4eaa('0x49')]=qs['sort'](_0x5df14e['query'][_0x4eaa('0x4a')]);_0x4a5733[_0x4eaa('0x4b')]=qs[_0x4eaa('0x43')](_[_0x4eaa('0x63')](_0x5df14e[_0x4eaa('0x41')],_0x1ef969[_0x4eaa('0x43')]));_0x4a5733['where'][_0x4eaa('0x5e')]=_0x37157d['id'];if(_0x5df14e[_0x4eaa('0x41')][_0x4eaa('0x4c')]){_0x4a5733[_0x4eaa('0x4b')]=_['merge'](_0x4a5733['where'],{'$or':_[_0x4eaa('0x3c')](_0x4a5733['attributes'],function(_0x5c95a1){var _0x2f328b={};_0x2f328b[_0x5c95a1]={'$like':'%'+_0x5df14e[_0x4eaa('0x41')][_0x4eaa('0x4c')]+'%'};return _0x2f328b;})});}_0x4a5733=_[_0x4eaa('0x4d')]({},_0x4a5733,_0x5df14e[_0x4eaa('0x54')]);return db[_0x4eaa('0x61')][_0x4eaa('0x2c')]({'where':_0x4a5733['where']})[_0x4eaa('0x1c')](function(_0x56d17a){_0x3ba4d5['count']=_0x56d17a;if(_0x5df14e[_0x4eaa('0x41')]['includeAll']){_0x4a5733[_0x4eaa('0x4f')]=[{'all':!![]}];}return db[_0x4eaa('0x61')]['findAll'](_0x4a5733);})[_0x4eaa('0x1c')](function(_0x587a78){_0x3ba4d5[_0x4eaa('0x64')]=_0x587a78;return _0x3ba4d5;});}})[_0x4eaa('0x1c')](respondWithFilteredResult(_0x489c81,_0x4a5733))['catch'](handleError(_0x489c81,null));};exports[_0x4eaa('0x65')]=function(_0x119619,_0x4cb093,_0x67357f){return db['ChatWebsite'][_0x4eaa('0x55')]({'where':{'id':_0x119619[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x4cb093,null))['then'](function(_0x1e84f2){if(_0x1e84f2){return _0x1e84f2[_0x4eaa('0x65')](_0x119619[_0x4eaa('0x41')][_0x4eaa('0x66')]);}})[_0x4eaa('0x1c')](respondWithStatusCode(_0x4cb093,null))['catch'](handleError(_0x4cb093,null));};exports['addAnswer']=function(_0x4e3b37,_0x15ba07,_0x8340f2){if(_0x4e3b37[_0x4eaa('0x57')]['id']){delete _0x4e3b37[_0x4eaa('0x57')]['id'];}return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x4e3b37[_0x4eaa('0x52')]['id']}})['then'](handleEntityNotFound(_0x15ba07,null))[_0x4eaa('0x1c')](function(_0x5e5cb9){if(_0x5e5cb9){_0x4e3b37[_0x4eaa('0x57')][_0x4eaa('0x5e')]=_0x5e5cb9['id'];return db[_0x4eaa('0x67')][_0x4eaa('0x56')](_0x4e3b37['body']);}})[_0x4eaa('0x1c')](respondWithResult(_0x15ba07,null))[_0x4eaa('0x25')](handleError(_0x15ba07,null));};exports[_0x4eaa('0x68')]=function(_0x50b3ff,_0x3472f7,_0x35cb9a){var _0x4ebba5={'raw':![],'where':{}};var _0x76bbca={};var _0xd18db={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x4eaa('0x60')]({'where':{'id':_0x50b3ff['params']['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x3472f7,null))[_0x4eaa('0x1c')](function(_0x2e1bd7){if(_0x2e1bd7){_0x76bbca[_0x4eaa('0x40')]=_[_0x4eaa('0x42')](db['CannedAnswer']['rawAttributes']);_0x76bbca[_0x4eaa('0x41')]=_['keys'](_0x50b3ff[_0x4eaa('0x41')]);_0x76bbca[_0x4eaa('0x43')]=_['intersection'](_0x76bbca[_0x4eaa('0x40')],_0x76bbca[_0x4eaa('0x41')]);_0x4ebba5[_0x4eaa('0x45')]=_['intersection'](_0x76bbca['model'],qs[_0x4eaa('0x46')](_0x50b3ff['query'][_0x4eaa('0x46')]));_0x4ebba5[_0x4eaa('0x45')]=_0x4ebba5[_0x4eaa('0x45')]['length']?_0x4ebba5['attributes']:_0x76bbca['model'];if(!_0x50b3ff[_0x4eaa('0x41')][_0x4eaa('0x62')](_0x4eaa('0x48'))){_0x4ebba5['limit']=qs[_0x4eaa('0x2b')](_0x50b3ff[_0x4eaa('0x41')][_0x4eaa('0x2b')]);_0x4ebba5[_0x4eaa('0x29')]=qs[_0x4eaa('0x29')](_0x50b3ff[_0x4eaa('0x41')]['offset']);}_0x4ebba5['order']=qs[_0x4eaa('0x4a')](_0x50b3ff[_0x4eaa('0x41')][_0x4eaa('0x4a')]);_0x4ebba5[_0x4eaa('0x4b')]=qs['filters'](_[_0x4eaa('0x63')](_0x50b3ff['query'],_0x76bbca[_0x4eaa('0x43')]));_0x4ebba5['where'][_0x4eaa('0x5e')]=_0x2e1bd7['id'];if(_0x50b3ff[_0x4eaa('0x41')][_0x4eaa('0x4c')]){_0x4ebba5[_0x4eaa('0x4b')]=_[_0x4eaa('0x4d')](_0x4ebba5[_0x4eaa('0x4b')],{'$or':_[_0x4eaa('0x3c')](_0x4ebba5[_0x4eaa('0x45')],function(_0x383f9a){var _0x1779d5={};_0x1779d5[_0x383f9a]={'$like':'%'+_0x50b3ff[_0x4eaa('0x41')][_0x4eaa('0x4c')]+'%'};return _0x1779d5;})});}_0x4ebba5=_['merge']({},_0x4ebba5,_0x50b3ff[_0x4eaa('0x54')]);return db[_0x4eaa('0x67')][_0x4eaa('0x2c')]({'where':_0x4ebba5['where']})[_0x4eaa('0x1c')](function(_0x2209cc){_0xd18db['count']=_0x2209cc;if(_0x50b3ff[_0x4eaa('0x41')][_0x4eaa('0x53')]){_0x4ebba5[_0x4eaa('0x4f')]=[{'all':!![]}];}return db[_0x4eaa('0x67')]['findAll'](_0x4ebba5);})[_0x4eaa('0x1c')](function(_0x44a5ee){_0xd18db[_0x4eaa('0x64')]=_0x44a5ee;return _0xd18db;});}})[_0x4eaa('0x1c')](respondWithFilteredResult(_0x3472f7,_0x4ebba5))[_0x4eaa('0x25')](handleError(_0x3472f7,null));};exports[_0x4eaa('0x69')]=function(_0x55b50a,_0x58b6b0,_0x991ee2){return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x55b50a[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x58b6b0,null))[_0x4eaa('0x1c')](function(_0x71edd){if(_0x71edd){return _0x71edd[_0x4eaa('0x69')](_0x55b50a['query'][_0x4eaa('0x66')]);}})[_0x4eaa('0x1c')](respondWithStatusCode(_0x58b6b0,null))[_0x4eaa('0x25')](handleError(_0x58b6b0,null));};exports[_0x4eaa('0x6a')]=function(_0x1e32b3,_0x193523,_0x1cf2c4){_0x1e32b3['body'][_0x4eaa('0x6b')]=_0x1e32b3[_0x4eaa('0x6c')][_0x4eaa('0x6d')];return db[_0x4eaa('0x3d')]['find']({'where':{'id':_0x1e32b3[_0x4eaa('0x52')]['id']}})['then'](handleEntityNotFound(_0x193523,null))[_0x4eaa('0x1c')](saveUpdates(_0x1e32b3[_0x4eaa('0x57')],null))['then'](respondWithResult(_0x193523,null))[_0x4eaa('0x25')](handleError(_0x193523,null));};exports[_0x4eaa('0x6e')]=function(_0x378c49,_0x3df01e,_0x4cdee9){_0x378c49['body'][_0x4eaa('0x6f')]=_0x378c49[_0x4eaa('0x6c')][_0x4eaa('0x6d')];return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x378c49[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x3df01e,null))[_0x4eaa('0x1c')](saveUpdates(_0x378c49[_0x4eaa('0x57')],null))['then'](respondWithResult(_0x3df01e,null))[_0x4eaa('0x25')](handleError(_0x3df01e,null));};exports['addCustomerAvatar']=function(_0x39722b,_0x5aeea2,_0x21a7ef){_0x39722b['body'][_0x4eaa('0x70')]=_0x39722b[_0x4eaa('0x6c')]['filename'];return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x39722b[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x5aeea2,null))[_0x4eaa('0x1c')](saveUpdates(_0x39722b['body'],null))[_0x4eaa('0x1c')](respondWithResult(_0x5aeea2,null))['catch'](handleError(_0x5aeea2,null));};exports['addSystemAvatar']=function(_0x29dd97,_0x5d455b,_0x3bf18c){_0x29dd97['body'][_0x4eaa('0x71')]=_0x29dd97['file'][_0x4eaa('0x6d')];return db['ChatWebsite']['find']({'where':{'id':_0x29dd97['params']['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x5d455b,null))[_0x4eaa('0x1c')](saveUpdates(_0x29dd97['body'],null))[_0x4eaa('0x1c')](respondWithResult(_0x5d455b,null))['catch'](handleError(_0x5d455b,null));};exports[_0x4eaa('0x72')]=function(_0x266e3c,_0x3dcc84,_0x3b506f){var _0x39bddf=path['join'](config[_0x4eaa('0x73')],_0x4eaa('0x74'));var _0x1fe711={'where':{'id':_0x266e3c[_0x4eaa('0x52')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2c66db=![];return require(_0x4eaa('0x75'))['getLicense']()[_0x4eaa('0x1c')](function(_0x2432b){if(_0x2432b){_0x2c66db=_0x2432b[_0x4eaa('0x76')];}})['then'](function(){return db[_0x4eaa('0x3d')][_0x4eaa('0x55')](_0x1fe711);})[_0x4eaa('0x1c')](handleEntityNotFound(_0x3dcc84,null))[_0x4eaa('0x1c')](function(_0x511dd2){if(_0x511dd2){if(!_[_0x4eaa('0x77')](_0x511dd2[_0x4eaa('0x6b')])){if(fs[_0x4eaa('0x78')](path['join'](config[_0x4eaa('0x73')],_0x4eaa('0x79'),_0x511dd2[_0x4eaa('0x6b')]))&&_0x2c66db){_0x39bddf=path['join'](config[_0x4eaa('0x73')],_0x4eaa('0x79'),_0x511dd2[_0x4eaa('0x6b')]);}}return _0x3dcc84[_0x4eaa('0x7a')](_0x39bddf);}})[_0x4eaa('0x25')](handleError(_0x3dcc84,null));};exports['getAvatar']=function(_0x5277a3,_0x45075b,_0x56b09d){var _0x4bac8e=path[_0x4eaa('0x7b')](config[_0x4eaa('0x73')],_0x4eaa('0x7c'));var _0x36a89c={'where':{'id':_0x5277a3[_0x4eaa('0x52')]['id']},'attributes':['id',_0x4eaa('0x6f')],'raw':!![]};return db[_0x4eaa('0x3d')][_0x4eaa('0x55')](_0x36a89c)[_0x4eaa('0x1c')](handleEntityNotFound(_0x45075b,null))[_0x4eaa('0x1c')](function(_0x36ec08){if(_0x36ec08){if(!_[_0x4eaa('0x77')](_0x36ec08[_0x4eaa('0x6f')])){if(fs['existsSync'](path[_0x4eaa('0x7b')](config[_0x4eaa('0x73')],_0x4eaa('0x7d'),_0x36ec08['agentAvatar']))){_0x4bac8e=path[_0x4eaa('0x7b')](config['root'],'server/files/images/avatars/',_0x36ec08[_0x4eaa('0x6f')]);}}return _0x45075b[_0x4eaa('0x7a')](_0x4bac8e);}})[_0x4eaa('0x25')](handleError(_0x45075b,null));};exports[_0x4eaa('0x7e')]=function(_0x44214f,_0x20ce10,_0x8d8695){var _0xe66973=path[_0x4eaa('0x7b')](config['root'],_0x4eaa('0x7f'));var _0x37e18f={'where':{'id':_0x44214f[_0x4eaa('0x52')]['id']},'attributes':['id',_0x4eaa('0x70'),_0x4eaa('0x80')],'raw':!![]};return db[_0x4eaa('0x3d')][_0x4eaa('0x55')](_0x37e18f)[_0x4eaa('0x1c')](handleEntityNotFound(_0x20ce10,null))[_0x4eaa('0x1c')](function(_0x32aa81){if(_0x32aa81){if(!_[_0x4eaa('0x77')](_0x32aa81[_0x4eaa('0x70')])){if(fs['existsSync'](path[_0x4eaa('0x7b')](config[_0x4eaa('0x73')],'server/files/images/avatars/',_0x32aa81['customerAvatar']))&&_0x32aa81[_0x4eaa('0x80')]){_0xe66973=path['join'](config[_0x4eaa('0x73')],_0x4eaa('0x7d'),_0x32aa81[_0x4eaa('0x70')]);}}return _0x20ce10[_0x4eaa('0x7a')](_0xe66973);}})[_0x4eaa('0x25')](handleError(_0x20ce10,null));};exports[_0x4eaa('0x81')]=function(_0x3fca18,_0x282d06,_0x5cfe7f){var _0x1c9b4e=path['join'](config[_0x4eaa('0x73')],_0x4eaa('0x82'));var _0x44be5d={'where':{'id':_0x3fca18[_0x4eaa('0x52')]['id']},'attributes':['id',_0x4eaa('0x71')],'raw':!![]};return db[_0x4eaa('0x3d')][_0x4eaa('0x55')](_0x44be5d)[_0x4eaa('0x1c')](handleEntityNotFound(_0x282d06,null))[_0x4eaa('0x1c')](function(_0x154357){if(_0x154357){if(!_['isNil'](_0x154357['systemAvatar'])){if(fs[_0x4eaa('0x78')](path[_0x4eaa('0x7b')](config[_0x4eaa('0x73')],_0x4eaa('0x7d'),_0x154357['systemAvatar']))){_0x1c9b4e=path['join'](config[_0x4eaa('0x73')],'server/files/images/avatars/',_0x154357[_0x4eaa('0x71')]);}}return _0x282d06[_0x4eaa('0x7a')](_0x1c9b4e);}})['catch'](handleError(_0x282d06,null));};exports[_0x4eaa('0x83')]=function(_0x445ad0,_0x336338,_0x327ce2){var _0x59d36b=require(_0x4eaa('0x84'));var _0x4d6132=new _0x59d36b();var _0x215749=_0x4d6132[_0x4eaa('0x85')](_0x445ad0[_0x4eaa('0x86')][_0x4eaa('0x87')])['getResult']();var _0x5cf2ca={'body':_0x445ad0[_0x4eaa('0x57')],'channel':_0x4eaa('0x88')};var _0x2a2f62=[];var _0x25974f=[];var _0x188863={};var _0x442233=![];return db[_0x4eaa('0x89')][_0x4eaa('0x5c')]()[_0x4eaa('0x1c')](function(_0x56c824){if(!_0x56c824){throw new db[(_0x4eaa('0x8a'))][(_0x4eaa('0x8b'))]('no\x20available\x20attributes');}_0x2a2f62=_[_0x4eaa('0x8c')](_[_0x4eaa('0x42')](_0x56c824),[_0x4eaa('0x8d'),_0x4eaa('0x8e')]);_0x25974f=_[_0x4eaa('0x8c')](_[_0x4eaa('0x42')](_0x56c824),[_0x4eaa('0x8d'),_0x4eaa('0x8e'),_0x4eaa('0x8f'),_0x4eaa('0x90')]);if(_0x445ad0[_0x4eaa('0x57')]['id']){delete _0x445ad0['body']['id'];}if(_[_0x4eaa('0x77')](_0x445ad0[_0x4eaa('0x57')]['from'])){throw new db[(_0x4eaa('0x8a'))][(_0x4eaa('0x8b'))](_0x4eaa('0x91'));}if(_[_0x4eaa('0x77')](_0x445ad0['body'][_0x4eaa('0x57')])||_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0x57')]===''){throw new db[(_0x4eaa('0x8a'))]['ValidationError'](_0x4eaa('0x92'));}if(_[_0x4eaa('0x77')](_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0x93')])){throw new db['Sequelize']['ValidationError'](_0x4eaa('0x94')+_0x25974f);}if(!_['includes'](_0x25974f,_0x445ad0['body'][_0x4eaa('0x93')])){throw new db[(_0x4eaa('0x8a'))]['ValidationError'](_0x4eaa('0x95')+_0x25974f);}_0x188863[_0x445ad0[_0x4eaa('0x57')]['mapKey']]=_0x445ad0[_0x4eaa('0x57')]['from'];})['then'](function(){return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x445ad0[_0x4eaa('0x52')]['id']},'include':[{'model':db['CmList'],'as':_0x4eaa('0x96'),'include':[{'model':db[_0x4eaa('0x89')],'as':'Contacts','where':_0x188863,'limit':0x1,'order':[[_0x4eaa('0x8e'),_0x4eaa('0x97')]]}]},{'model':db[_0x4eaa('0x98')],'as':_0x4eaa('0x99')}]});})[_0x4eaa('0x1c')](handleEntityNotFound(_0x336338,null))[_0x4eaa('0x1c')](function(_0x3e7625){if(_0x3e7625&&_0x3e7625['List']){_0x5cf2ca['account']=_0x3e7625;_0x5cf2ca['applications']=_0x3e7625[_0x4eaa('0x99')];_0x5cf2ca[_0x4eaa('0x9a')]=_0x3e7625[_0x4eaa('0x96')];_0x5cf2ca['applications']=_[_0x4eaa('0x9b')](_0x5cf2ca['applications'],['priority'],[_0x4eaa('0x9c')]);if(_0x5cf2ca[_0x4eaa('0x9d')][_0x4eaa('0x99')]){delete _0x5cf2ca[_0x4eaa('0x9d')]['Applications'];}if(_0x5cf2ca[_0x4eaa('0x9d')][_0x4eaa('0x96')]&&_0x5cf2ca[_0x4eaa('0x9d')][_0x4eaa('0x96')][_0x4eaa('0x9e')][_0x4eaa('0x47')]){return _0x5cf2ca['account']['List']['Contacts'][0x0];}var _0x25cee7=_['defaults'](_0x445ad0[_0x4eaa('0x57')],{'firstName':_0x445ad0[_0x4eaa('0x57')]['from'],'ListId':_0x3e7625[_0x4eaa('0x90')]});_0x25cee7[_0x445ad0[_0x4eaa('0x57')]['mapKey']]=_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0x9f')];return db[_0x4eaa('0x89')][_0x4eaa('0x56')](_0x25cee7,{'fields':_0x2a2f62,'raw':!![]});}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x336338,null))['then'](function(_0x38c21a){_0x5cf2ca[_0x4eaa('0xa0')]=_0x38c21a;var _0x10e9af=_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xa1')];if(_0x445ad0[_0x4eaa('0x86')]['cf-connecting-ip']){_0x10e9af=_0x445ad0[_0x4eaa('0x86')][_0x4eaa('0xa2')];}else if(_0x445ad0['headers'][_0x4eaa('0xa3')]){_0x10e9af=_[_0x4eaa('0xa4')](_0x445ad0['headers']['x-forwarded-for'][_0x4eaa('0xa5')](','));}if(_0x38c21a){var _0x133bca={'ContactId':_0x38c21a['id'],'ChatWebsiteId':_0x445ad0[_0x4eaa('0x52')]['id'],'from':(_0x38c21a['firstName']||'')+'\x20'+(_0x38c21a['lastName']||''),'customerIp':_0x10e9af,'customerPort':_0x445ad0[_0x4eaa('0x86')][_0x4eaa('0xa6')]?_0x445ad0[_0x4eaa('0x86')]['x-real-port']:null,'referer':_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xa7')],'browserName':_0x215749['browser']['name']&&_0x215749['browser']['version']?util[_0x4eaa('0xa8')](_0x4eaa('0xa9'),_0x215749['browser'][_0x4eaa('0x38')],_0x215749['browser'][_0x4eaa('0xaa')]):_0x4eaa('0xab'),'browserVersion':_0x215749[_0x4eaa('0xac')][_0x4eaa('0xaa')]||_0x4eaa('0xab'),'osName':util[_0x4eaa('0xa8')](_0x4eaa('0xa9'),_0x215749['os'][_0x4eaa('0x38')],_0x215749['os'][_0x4eaa('0xaa')]),'osVersion':_0x215749['os'][_0x4eaa('0xaa')],'deviceModel':_0x215749[_0x4eaa('0xad')][_0x4eaa('0x40')]&&_0x215749[_0x4eaa('0xad')][_0x4eaa('0xae')]?util[_0x4eaa('0xa8')](_0x4eaa('0xaf'),_0x215749[_0x4eaa('0xad')]['model'],_0x215749['device']['vendor'],_0x215749['device'][_0x4eaa('0x4e')]):null,'deviceVendor':_0x215749[_0x4eaa('0xad')][_0x4eaa('0xae')],'deviceType':_0x215749[_0x4eaa('0xad')][_0x4eaa('0x4e')],'formData':JSON['stringify'](_0x445ad0[_0x4eaa('0x57')])};var _0x1d7ed2={'ChatWebsiteId':_0x445ad0['params']['id'],'closed':![]};if(_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb0')]){_0x1d7ed2[_0x4eaa('0xb0')]=_0x445ad0['body'][_0x4eaa('0xb0')];return db[_0x4eaa('0xb1')][_0x4eaa('0x55')]({'where':_0x1d7ed2})[_0x4eaa('0x1c')](function(_0xd91c31){if(_0xd91c31){return[_0xd91c31,![]];}_0x133bca['threadId']=_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb0')];_0x133bca['externalUrl']=_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb2')];return db[_0x4eaa('0xb1')][_0x4eaa('0x56')](_0x133bca)['then'](function(_0x24bfe8){return[_0x24bfe8,!![]];});});}_0x1d7ed2[_0x4eaa('0xb3')]=_0x38c21a['id'];if(_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb4')]&&_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb4')]['id']){_0x1d7ed2['id']=_0x445ad0[_0x4eaa('0x57')]['interaction']['id'];return db[_0x4eaa('0xb1')][_0x4eaa('0x55')]({'where':_0x1d7ed2})[_0x4eaa('0x1c')](function(_0x1dfe04){if(_0x1dfe04){return[_0x1dfe04,![]];}return db[_0x4eaa('0xb1')][_0x4eaa('0x56')](_0x133bca)[_0x4eaa('0x1c')](function(_0x26166f){return[_0x26166f,!![]];});});}return db[_0x4eaa('0xb1')][_0x4eaa('0x56')](_0x133bca)[_0x4eaa('0x1c')](function(_0x435632){return[_0x435632,!![]];});}})[_0x4eaa('0xb5')](function(_0x172b54,_0xb91ffa){if(_0x172b54){_0x442233=_0xb91ffa;if(!_0xb91ffa){var _0x2b7cfd={'from':(_0x5cf2ca['contact']['firstName']||'')+'\x20'+(_0x5cf2ca[_0x4eaa('0xa0')][_0x4eaa('0xb6')]||'')};if(_0x445ad0[_0x4eaa('0x57')]['threadId']&&_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb7')]&&_0x445ad0[_0x4eaa('0x57')]['threadId']!=_0x445ad0[_0x4eaa('0x57')][_0x4eaa('0xb7')]){_0x2b7cfd[_0x4eaa('0xb0')]=_0x445ad0['body'][_0x4eaa('0xb7')];}return _0x172b54[_0x4eaa('0x32')](_0x2b7cfd);}else{return _0x172b54;}}})[_0x4eaa('0x1c')](function(_0x494330){_0x5cf2ca[_0x4eaa('0xb4')]=_0x494330[_0x4eaa('0x34')]({'plain':!![]});_0x5cf2ca[_0x4eaa('0xb4')][_0x4eaa('0xb8')]=_0x442233;if(_0x5cf2ca['interaction'][_0x4eaa('0xb8')]){if(_0x5cf2ca[_0x4eaa('0x9d')][_0x4eaa('0xb9')]){_0x5cf2ca[_0x4eaa('0xba')][_0x4eaa('0xbb')]({'id':0x0,'priority':_0x5cf2ca['applications'][_0x4eaa('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x4eaa('0xbc')});}}return db[_0x4eaa('0xbd')][_0x4eaa('0x56')]({'body':_0x445ad0[_0x4eaa('0x57')]['body'],'ChatWebsiteId':_0x445ad0[_0x4eaa('0x52')]['id'],'ChatInteractionId':_0x494330['id'],'direction':'in','ContactId':_0x5cf2ca[_0x4eaa('0xa0')]['id'],'AttachmentId':_0x445ad0['body'][_0x4eaa('0xbe')]});})[_0x4eaa('0x1c')](function(_0x3a110b){_0x5cf2ca[_0x4eaa('0x23')]=_0x3a110b;if(_0x5cf2ca[_0x4eaa('0xb4')]['UserId']){return db[_0x4eaa('0xbf')]['find']({'attributes':['id',_0x4eaa('0x38')],'where':{'id':_0x5cf2ca[_0x4eaa('0xb4')][_0x4eaa('0xc0')]}})['then'](function(_0x29d4b9){if(_0x29d4b9){_0x5cf2ca[_0x4eaa('0xba')][_0x4eaa('0xc1')]({'id':0x0,'priority':0x0,'app':_0x4eaa('0xc2'),'appdata':_0x29d4b9['name']+','+(_0x5cf2ca[_0x4eaa('0x9d')]['waitForTheAssignedAgent']||0xa),'interval':_0x4eaa('0xbc')});_0x5cf2ca['forcedOwnership']=!![];}return respondWithRpcPromise(_0x4eaa('0xc3'),_0x4eaa('0xc4'),_0x5cf2ca);});}return respondWithRpcPromise(_0x4eaa('0xc3'),_0x4eaa('0xc4'),_0x5cf2ca);})[_0x4eaa('0x1c')](function(_0x1f521b){respondWithRpcPromise(_0x4eaa('0xc5'),'EventManager',{'event':'notify','message':_0x1f521b},client9002);return _0x1f521b;})['then'](respondWithResult(_0x336338,null))[_0x4eaa('0x25')](handleError(_0x336338,null));};exports[_0x4eaa('0xc6')]=function(_0x295da3,_0x3c1f1d,_0x51e716){var _0x5205b3,_0x183931,_0x404755;var _0x1d396c=[];var _0xad78ca=[];var _0x2a2519={};var _0x45fe41=_0x295da3['files']||[];var _0x334457=[];var _0x435f8f;return db['CmContact']['describe']()['then'](function(_0x466c85){if(!_0x466c85){throw new db[(_0x4eaa('0x8a'))][(_0x4eaa('0x8b'))]('no\x20available\x20attributes');}_0xad78ca=_[_0x4eaa('0x8c')](_[_0x4eaa('0x42')](_0x466c85),[_0x4eaa('0x8d'),_0x4eaa('0x8e')]);_0x1d396c=_[_0x4eaa('0x8c')](_[_0x4eaa('0x42')](_0x466c85),[_0x4eaa('0x8d'),_0x4eaa('0x8e'),'CompanyId',_0x4eaa('0x90')]);if(_0x295da3[_0x4eaa('0x57')]['id']){delete _0x295da3[_0x4eaa('0x57')]['id'];}if(_['isNil'](_0x295da3[_0x4eaa('0x57')][_0x4eaa('0x9f')])){throw _0x3c1f1d['status'](0x1f4)[_0x4eaa('0xc7')](new db[(_0x4eaa('0x8a'))][(_0x4eaa('0x8b'))](_0x4eaa('0x91')));}if(_[_0x4eaa('0x77')](_0x295da3[_0x4eaa('0x57')][_0x4eaa('0x57')])||_0x295da3[_0x4eaa('0x57')][_0x4eaa('0x57')]===''){throw _0x3c1f1d['status'](0x1f4)[_0x4eaa('0xc7')](new db[(_0x4eaa('0x8a'))][(_0x4eaa('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4eaa('0x77')](_0x295da3[_0x4eaa('0x57')]['mapKeyOffline'])){throw _0x3c1f1d[_0x4eaa('0x26')](0x1f4)[_0x4eaa('0xc7')](new db[(_0x4eaa('0x8a'))]['ValidationError'](_0x4eaa('0xc8')+_0x1d396c));}if(!_[_0x4eaa('0xc9')](_0x1d396c,_0x295da3[_0x4eaa('0x57')][_0x4eaa('0xca')])){throw _0x3c1f1d[_0x4eaa('0x26')](0x1f4)[_0x4eaa('0xc7')](new db[(_0x4eaa('0x8a'))]['ValidationError'](_0x4eaa('0xcb')+_0x1d396c));}_0x2a2519[_0x295da3['body'][_0x4eaa('0xca')]]=_0x295da3[_0x4eaa('0x57')][_0x4eaa('0x9f')];})[_0x4eaa('0x1c')](function(){return db[_0x4eaa('0x3d')]['find']({'where':{'id':_0x295da3[_0x4eaa('0x52')]['id']},'include':[{'model':db[_0x4eaa('0xcc')],'as':_0x4eaa('0x96')},{'model':db[_0x4eaa('0xcd')],'as':_0x4eaa('0xcd')}]});})[_0x4eaa('0x1c')](handleEntityNotFound(_0x3c1f1d,null))[_0x4eaa('0x1c')](function(_0x289635){if(_0x289635&&_0x289635['List']){_0x183931=_0x289635;var _0x193ee6=_[_0x4eaa('0x16')](_0x295da3[_0x4eaa('0x57')],{'firstName':_0x295da3[_0x4eaa('0x57')]['from'],'phone':_0x295da3[_0x4eaa('0x57')]['from'],'ListId':_0x289635[_0x4eaa('0x90')]});_0x193ee6[_0x295da3['body'][_0x4eaa('0xca')]]=_0x295da3[_0x4eaa('0x57')][_0x4eaa('0x9f')];return db[_0x4eaa('0x89')][_0x4eaa('0xce')]({'where':_0x2a2519,'defaults':_0x193ee6});}})[_0x4eaa('0xb5')](function(_0x193304){if(_0x193304){_0x404755=_0x193304;var _0x4d485c=fs[_0x4eaa('0xcf')](path[_0x4eaa('0x7b')](config[_0x4eaa('0x73')],_0x4eaa('0xd0')),_0x4eaa('0xd1'));var _0x40bea7=ejs['render'](_0x4d485c,{'body':_[_0x4eaa('0xd2')](_0x295da3[_0x4eaa('0x57')][_0x4eaa('0x57')]),'bodyTitle':_0x183931['offlineMessageBody']});return db[_0x4eaa('0xd3')][_0x4eaa('0x56')]({'body':_0x40bea7,'ContactId':_0x193304['id'],'ChatWebsiteId':_0x183931['id']});}})[_0x4eaa('0x1c')](function(_0x264620){_0x435f8f=_0x264620;if(_0x45fe41[_0x4eaa('0x47')]){var _0x383910=_0x45fe41[_0x4eaa('0x3c')](function(_0x2d123e){return{'name':_0x2d123e[_0x4eaa('0xd4')],'basename':_0x2d123e['filename'],'type':_0x2d123e[_0x4eaa('0xd5')],'ChatOfflineMessageId':_0x264620['id']};});_0x334457=_0x383910[_0x4eaa('0x3c')](_0x27660f=>{var _0x4d9d64={'filename':_0x27660f[_0x4eaa('0x38')],'path':path['join'](config[_0x4eaa('0x73')],_0x4eaa('0xd6'),_0x4eaa('0xd7'),_0x4eaa('0xd8'),_0x4eaa('0xd9'),_0x27660f['basename'])};return _0x4d9d64;});if(!_0x183931[_0x4eaa('0xda')]){return db['sequelize'][_0x4eaa('0xdb')](function(_0x5ba555){return db[_0x4eaa('0xdc')][_0x4eaa('0xdd')](_0x383910,{'transaction':_0x5ba555});});}}})[_0x4eaa('0x1c')](function(){if(_0x435f8f){_0x5205b3=_0x435f8f;return db[_0x4eaa('0xcd')][_0x4eaa('0x60')]({'where':{'active':!![]},'include':[{'model':db[_0x4eaa('0xde')],'as':'Smtp','raw':!![]}]});}})[_0x4eaa('0x1c')](function(_0xe9d29){if(_0xe9d29&&_0xe9d29[_0x4eaa('0xdf')]&&_0x183931['forwardOffline']&&_0x183931[_0x4eaa('0xe0')]){var _0x3cc926={'tls':{'rejectUnauthorized':![]}};if(_0xe9d29[_0x4eaa('0xdf')][_0x4eaa('0xe1')]){_0x3cc926['service']=_0xe9d29[_0x4eaa('0xdf')][_0x4eaa('0xe1')];}else{_0x3cc926[_0x4eaa('0xe2')]=_0xe9d29[_0x4eaa('0xdf')][_0x4eaa('0xe2')];_0x3cc926[_0x4eaa('0xe3')]=_0xe9d29[_0x4eaa('0xdf')]['port'];_0x3cc926[_0x4eaa('0xe4')]=_0xe9d29['Smtp']['secure'];}if(_0xe9d29[_0x4eaa('0xdf')]['authentication']){_0x3cc926['auth']={'user':_0xe9d29[_0x4eaa('0xdf')]['user'],'pass':_0xe9d29[_0x4eaa('0xdf')][_0x4eaa('0xe5')]};}return respondWithRpcPromise('SendMail',_0x4eaa('0xe6'),{'account':_0x3cc926,'message':{'from':util[_0x4eaa('0xa8')](_0x4eaa('0xe7'),_0xe9d29[_0x4eaa('0x38')],_0xe9d29[_0x4eaa('0xe8')]||_0xe9d29['Smtp']['user']),'to':_0x183931[_0x4eaa('0xe0')],'subject':_0x183931['offlineMessageSubject'],'html':_0x5205b3[_0x4eaa('0x57')],'attachments':_0x334457}},client9003)['then'](function(){return _0x5205b3;})[_0x4eaa('0x25')](function(_0x438eab){console['error'](_0x438eab);});}})[_0x4eaa('0x1c')](function(){if(_0x183931&&_0x183931[_0x4eaa('0xda')]&&_0x183931['MailAccountId']){var _0x3294db=[];if(_0x45fe41[_0x4eaa('0x47')]){_0x3294db=_0x45fe41[_0x4eaa('0x3c')](function(_0x1344ae){return{'name':_0x1344ae[_0x4eaa('0xd4')],'basename':_0x1344ae[_0x4eaa('0x6d')],'type':_0x1344ae[_0x4eaa('0xd5')],'ChatOfflineMessageId':_0x435f8f['id']};});}var _0x5ebdd6;if(!_['isNil'](_0x183931[_0x4eaa('0xe9')])){var _0x342368=_[_0x4eaa('0x3c')](_0x295da3[_0x4eaa('0x57')],function(_0x16bcab){return _0x16bcab;});var _0x12b5ac=_[_0x4eaa('0xea')](_0x342368)[0x0];var _0xc7bc53=_[_0x4eaa('0xeb')](_0x12b5ac,function(_0x122996){return _0x122996;});_0x5ebdd6=_0xc7bc53[0x1][_0x183931[_0x4eaa('0xe9')]];}var _0x3462c9={'from':_0x404755[_0x4eaa('0xe8')],'firstName':_0x404755[_0x4eaa('0xec')],'lastName':_0x404755[_0x4eaa('0xb6')],'mapKey':'email','message':{'from':_0x404755['email'],'to':_0x183931[_0x4eaa('0xcd')][_0x4eaa('0xe8')],'cc':'','subject':_['isNil'](_0x5ebdd6)?_0x183931[_0x4eaa('0xed')]:_0x5ebdd6,'messageId':'','sentAt':new Date(),'attach':_0x3294db[_0x4eaa('0x47')],'attachments':_0x3294db,'originChannel':'Chat','ChatWebsiteId':_0x183931['id'],'ChatOfflineMessageId':_0x5205b3['id'],'originTo':_0x183931[_0x4eaa('0xcd')][_0x4eaa('0xe8')]},'body':_0x5205b3['body']};var _0x5a824c={'account':{'id':_0x183931[_0x4eaa('0xee')]},'body':_0x3462c9,'log':_0x4eaa('0xef')};return respondWithRpcPromise(_0x4eaa('0xef'),'notifyMail',_0x5a824c,client9001)['then'](function(){return _0x5205b3;})['catch'](function(_0x548fa8){console[_0x4eaa('0x21')](_0x548fa8);});}return;})[_0x4eaa('0x1c')](function(){if(_0x5205b3){return _0x5205b3;}})[_0x4eaa('0x1c')](respondWithResult(_0x3c1f1d,null))['catch'](function(_0x406521){console['error'](_0x4eaa('0x25'),_0x406521);for(var _0x5f43b9 of _0x45fe41){var _0x899012=path['join'](config['root'],_0x4eaa('0xd6'),_0x4eaa('0xd7'),'attachments',_0x4eaa('0xd9'),_0x5f43b9['filename']);fs_extra['remove'](_0x899012)[_0x4eaa('0x25')](function(_0x21f812){console[_0x4eaa('0x21')]('Could\x20not\x20remove\x20attachment\x20file',_0x899012,_0x21f812);});}});};exports[_0x4eaa('0xf0')]=function(_0x463607,_0x55e673,_0x54f0f1){return db[_0x4eaa('0xb1')]['find']({'where':{'id':_0x463607[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x55e673,null))[_0x4eaa('0x1c')](function(_0x3a3c98){if(_0x3a3c98){return _0x3a3c98['addInteraction'](_0x463607[_0x4eaa('0x57')]['ids'],_[_0x4eaa('0xf1')](_0x463607['body'],['ids','id'])||{});}})[_0x4eaa('0x1c')](respondWithResult(_0x55e673,null))['catch'](handleError(_0x55e673,null));};exports[_0x4eaa('0xf2')]=function(_0x356774,_0x5b9b1c,_0x357022){var _0x365479={'raw':![],'where':{}};var _0x4924fd={};var _0x77a108={'count':0x0,'rows':[]};return db[_0x4eaa('0x3d')]['findOne']({'where':{'id':_0x356774['params']['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x5b9b1c,null))['then'](function(_0x2a0349){if(_0x2a0349){_0x4924fd['model']=_['keys'](db[_0x4eaa('0xb1')][_0x4eaa('0x3e')]);_0x4924fd[_0x4eaa('0x41')]=_['keys'](_0x356774['query']);_0x4924fd[_0x4eaa('0x43')]=_[_0x4eaa('0x44')](_0x4924fd[_0x4eaa('0x40')],_0x4924fd[_0x4eaa('0x41')]);_0x365479[_0x4eaa('0x45')]=_['intersection'](_0x4924fd[_0x4eaa('0x40')],qs[_0x4eaa('0x46')](_0x356774[_0x4eaa('0x41')][_0x4eaa('0x46')]));_0x365479[_0x4eaa('0x45')]=_0x365479['attributes']['length']?_0x365479[_0x4eaa('0x45')]:_0x4924fd['model'];if(!_0x356774[_0x4eaa('0x41')][_0x4eaa('0x62')](_0x4eaa('0x48'))){_0x365479[_0x4eaa('0x2b')]=qs[_0x4eaa('0x2b')](_0x356774['query'][_0x4eaa('0x2b')]);_0x365479[_0x4eaa('0x29')]=qs['offset'](_0x356774[_0x4eaa('0x41')][_0x4eaa('0x29')]);}_0x365479[_0x4eaa('0x49')]=qs[_0x4eaa('0x4a')](_0x356774['query'][_0x4eaa('0x4a')]);_0x365479[_0x4eaa('0x4b')]=qs[_0x4eaa('0x43')](_[_0x4eaa('0x63')](_0x356774['query'],_0x4924fd['filters']));_0x365479[_0x4eaa('0x4b')][_0x4eaa('0x5e')]=_0x2a0349['id'];if(_0x356774['query'][_0x4eaa('0x4c')]){_0x365479[_0x4eaa('0x4b')]=_['merge'](_0x365479[_0x4eaa('0x4b')],{'$or':_[_0x4eaa('0x3c')](_0x365479[_0x4eaa('0x45')],function(_0x1236ae){var _0x58d36c={};_0x58d36c[_0x1236ae]={'$like':'%'+_0x356774[_0x4eaa('0x41')]['filter']+'%'};return _0x58d36c;})});}_0x365479=_['merge']({},_0x365479,_0x356774['options']);return db[_0x4eaa('0xb1')][_0x4eaa('0x2c')]({'where':_0x365479[_0x4eaa('0x4b')]})[_0x4eaa('0x1c')](function(_0x4a44e2){_0x77a108[_0x4eaa('0x2c')]=_0x4a44e2;if(_0x356774[_0x4eaa('0x41')][_0x4eaa('0x53')]){_0x365479['include']=[{'model':db[_0x4eaa('0x89')],'as':_0x4eaa('0xf3'),'required':![]},{'model':db[_0x4eaa('0xbf')],'as':_0x4eaa('0xf4'),'attributes':[_0x4eaa('0x38'),_0x4eaa('0xf5'),'internal'],'required':![]},{'model':db[_0x4eaa('0xf6')],'as':_0x4eaa('0xf7'),'attributes':['id','name',_0x4eaa('0xf8')],'where':_0x356774['query']['tag']?{'id':_0x356774[_0x4eaa('0x41')][_0x4eaa('0xf9')]}:undefined,'required':_0x356774[_0x4eaa('0x41')][_0x4eaa('0xf9')]?!![]:![]}];}return db[_0x4eaa('0xb1')][_0x4eaa('0x50')](_0x365479);})[_0x4eaa('0x1c')](function(_0x283855){_0x77a108[_0x4eaa('0x64')]=_0x283855;return _0x77a108;});}})[_0x4eaa('0x1c')](respondWithFilteredResult(_0x5b9b1c,_0x365479))[_0x4eaa('0x25')](handleError(_0x5b9b1c,null));};function iftimePromise(_0x105ddf,_0x3b6a5a){return respondWithRpcPromise(_0x4eaa('0xfa'),_0x4eaa('0xfb'),{'command':_0x3b6a5a[_0x4eaa('0xfc')]?util[_0x4eaa('0xa8')](_0x4eaa('0xfd'),_0x105ddf[_0x4eaa('0xfe')],_0x3b6a5a[_0x4eaa('0xfc')]):util[_0x4eaa('0xa8')](_0x4eaa('0xff'),_0x105ddf[_0x4eaa('0xfe')])},client9002)[_0x4eaa('0x1c')](function(_0x154b30){var _0x24d221=_0x154b30&&_0x154b30['indexOf'](_0x4eaa('0x100'))>=0x0?!![]:![];logger[_0x4eaa('0x1d')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3b6a5a['id'],_0x105ddf['id'],_0x105ddf[_0x4eaa('0xfe')],_0x24d221?'ONLINE':_0x4eaa('0x101'),_0x3b6a5a['timezone']?_0x3b6a5a[_0x4eaa('0xfc')]:'No\x20timezone');return _0x24d221;})['catch'](function(_0x385992){logger[_0x4eaa('0x21')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3b6a5a['id'],_0x105ddf['id'],_0x105ddf[_0x4eaa('0xfe')],util['inspect'](_0x385992,{'showHidden':![],'depth':null}),_0x3b6a5a[_0x4eaa('0xfc')]?_0x3b6a5a[_0x4eaa('0xfc')]:_0x4eaa('0x102'));return![];});}exports[_0x4eaa('0xfb')]=function(_0x571fe4,_0x5f5b42,_0x408f82){var _0x42d503=0x0;var _0x5eaa66=0x0;var _0x345fbd=![];var _0x13af7b;var _0x31234a;return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x571fe4[_0x4eaa('0x52')]['id']},'include':[{'model':db[_0x4eaa('0x103')],'as':_0x4eaa('0x103'),'include':[{'model':db['Interval'],'as':_0x4eaa('0x104'),'attributes':['id',_0x4eaa('0xfe')],'raw':!![]}]}]})[_0x4eaa('0x1c')](handleEntityNotFound(_0x5f5b42,null))['then'](function(_0x267211){if(_0x267211){_0x13af7b=_0x267211;return _0x267211[_0x4eaa('0x105')]({'raw':!![]});}})[_0x4eaa('0x1c')](function(_0x1b8e9c){if(_0x13af7b){if(_0x1b8e9c){_0x31234a=_0x1b8e9c;}}return require(_0x4eaa('0x75'))['getLicense']();})[_0x4eaa('0x1c')](function(_0xe0248d){if(_0xe0248d){_0x5eaa66=_0xe0248d[_0x4eaa('0x106')];_0x345fbd=_0xe0248d['custom'];}})['then'](function(){return db[_0x4eaa('0xb1')][_0x4eaa('0x2c')]({'where':{'closed':![]}});})[_0x4eaa('0x1c')](function(_0x47cf50){_0x42d503=_0x47cf50;if(_0x5eaa66&&_0x47cf50>_0x5eaa66){return db[_0x4eaa('0x107')][_0x4eaa('0x60')]({'where':{'id':0x1}})[_0x4eaa('0x1c')](function(_0x5344cb){if(_0x5344cb){_0x5344cb[_0x4eaa('0x108')](_0x4eaa('0x109'));}});}})['then'](function(){if(_0x13af7b[_0x4eaa('0x103')]&&_0x13af7b[_0x4eaa('0x103')][_0x4eaa('0x104')]){var _0x2ee170=[];for(var _0x45f88a=0x0;_0x45f88a<_0x13af7b['Interval'][_0x4eaa('0x104')][_0x4eaa('0x47')];_0x45f88a++){var _0x28db05=_0x13af7b[_0x4eaa('0x103')][_0x4eaa('0x104')][_0x45f88a][_0x4eaa('0x34')]({'plain':!![]});_0x2ee170[_0x4eaa('0xbb')](iftimePromise(_0x28db05,_0x13af7b));}return BPromise[_0x4eaa('0x10a')](_0x2ee170)[_0x4eaa('0x1c')](function(_0x121fac){return _[_0x4eaa('0x10b')](_0x121fac);});}else{return!![];}})[_0x4eaa('0x1c')](function(_0x44f660){var _0x17fc00=fs[_0x4eaa('0xcf')](path[_0x4eaa('0x7b')](config[_0x4eaa('0x73')],_0x4eaa('0x10c')),'utf8');var _0x5e67b9={'remote':_0x13af7b[_0x4eaa('0x10d')],'query':querystring[_0x4eaa('0x20')](_['merge'](_0x13af7b[_0x4eaa('0x34')]({'plain':!![]}),{'customerIp':_0x571fe4[_0x4eaa('0x86')][_0x4eaa('0xa3')]||_0x571fe4[_0x4eaa('0x86')][_0x4eaa('0x10e')]||_0x571fe4[_0x4eaa('0x10f')][_0x4eaa('0x110')]||_0x571fe4['ip'],'referer':_0x571fe4[_0x4eaa('0x86')][_0x4eaa('0xa7')],'openedInteractions':_0x42d503,'maxInteractions':_0x5eaa66,'virtual':_0x345fbd[_0x4eaa('0x106')],'online':_0x44f660,'custom':_0x345fbd}))[_0x4eaa('0x111')](/'/g,'\x5c\x27')};_0x5f5b42[_0x4eaa('0xc7')](ejs[_0x4eaa('0x112')](Mustache[_0x4eaa('0x112')](_0x17fc00,_0x5e67b9),{'proactiveActions':_0x31234a,'alignment':_0x13af7b[_0x4eaa('0x113')],'verticalAlignment':_0x13af7b[_0x4eaa('0x114')],'div_color':_0x13af7b[_0x4eaa('0xf8')],'text_color':_0x13af7b[_0x4eaa('0x115')],'button_color':_0x13af7b[_0x4eaa('0x116')],'background_color':_0x13af7b[_0x4eaa('0x117')]}));})[_0x4eaa('0x25')](handleError(_0x5f5b42,null));};exports[_0x4eaa('0x118')]=function(_0x2be419,_0x3e1063,_0x4ca8d7){return db[_0x4eaa('0x3d')][_0x4eaa('0x60')]({'where':{'id':_0x2be419[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x3e1063,null))['then'](function(_0x34aacb){if(_0x34aacb){return db[_0x4eaa('0x119')][_0x4eaa('0xdb')](function(_0x14a594){return db[_0x4eaa('0x98')][_0x4eaa('0x33')]({'where':{'ChatWebsiteId':_0x2be419['params']['id']},'transaction':_0x14a594})['then'](function(_0x251b91){var _0x5a6468=_[_0x4eaa('0x3c')](_0x2be419[_0x4eaa('0x57')],function(_0x777bf3){_0x777bf3[_0x4eaa('0x5e')]=_0x2be419['params']['id'];return _0x777bf3;});return db['ChatApplication'][_0x4eaa('0xdd')](_0x5a6468,{'transaction':_0x14a594});});})[_0x4eaa('0x1c')](function(){return db['ChatApplication'][_0x4eaa('0x11a')]({'where':{'ChatWebsiteId':_0x2be419['params']['id']},'order':_0x4eaa('0x11b')});});}})[_0x4eaa('0x1c')](respondWithResult(_0x3e1063,null))[_0x4eaa('0x25')](handleError(_0x3e1063,null));};exports[_0x4eaa('0x11c')]=function(_0xc233e6,_0x213459,_0x3eaa8d){var _0x14808e={};var _0x90276f={};var _0x51f885;var _0x16c76a;return db[_0x4eaa('0x3d')][_0x4eaa('0x60')]({'where':{'id':_0xc233e6[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x213459,null))[_0x4eaa('0x1c')](function(_0x709ab1){if(_0x709ab1){_0x51f885=_0x709ab1;_0x90276f[_0x4eaa('0x40')]=_[_0x4eaa('0x42')](db[_0x4eaa('0x98')][_0x4eaa('0x3e')]);_0x90276f['query']=_[_0x4eaa('0x42')](_0xc233e6[_0x4eaa('0x41')]);_0x90276f[_0x4eaa('0x43')]=_['intersection'](_0x90276f[_0x4eaa('0x40')],_0x90276f[_0x4eaa('0x41')]);_0x14808e['attributes']=_[_0x4eaa('0x44')](_0x90276f[_0x4eaa('0x40')],qs['fields'](_0xc233e6[_0x4eaa('0x41')][_0x4eaa('0x46')]));_0x14808e[_0x4eaa('0x45')]=_0x14808e[_0x4eaa('0x45')]['length']?_0x14808e[_0x4eaa('0x45')]:_0x90276f[_0x4eaa('0x40')];_0x14808e[_0x4eaa('0x49')]=qs['sort'](_0xc233e6['query'][_0x4eaa('0x4a')]);_0x14808e[_0x4eaa('0x4b')]=qs['filters'](_[_0x4eaa('0x63')](_0xc233e6[_0x4eaa('0x41')],_0x90276f[_0x4eaa('0x43')]));if(_0xc233e6[_0x4eaa('0x41')][_0x4eaa('0x4c')]){_0x14808e[_0x4eaa('0x4b')]=_['merge'](_0x14808e[_0x4eaa('0x4b')],{'$or':_[_0x4eaa('0x3c')](_0x14808e['attributes'],function(_0x3471f0){var _0x37adbe={};_0x37adbe[_0x3471f0]={'$like':'%'+_0xc233e6['query']['filter']+'%'};return _0x37adbe;})});}_0x14808e=_['merge']({},_0x14808e,_0xc233e6['options']);return _0x51f885[_0x4eaa('0x11c')](_0x14808e);}})['then'](function(_0x128b07){if(_0x128b07){_0x16c76a=_0x128b07[_0x4eaa('0x47')];if(!_0xc233e6['query'][_0x4eaa('0x62')](_0x4eaa('0x48'))){_0x14808e[_0x4eaa('0x2b')]=qs[_0x4eaa('0x2b')](_0xc233e6[_0x4eaa('0x41')][_0x4eaa('0x2b')]);_0x14808e[_0x4eaa('0x29')]=qs[_0x4eaa('0x29')](_0xc233e6[_0x4eaa('0x41')]['offset']);}return _0x51f885[_0x4eaa('0x11c')](_0x14808e);}})[_0x4eaa('0x1c')](function(_0x4e5bd0){if(_0x4e5bd0){return _0x4e5bd0?{'count':_0x16c76a,'rows':_0x4e5bd0}:null;}})['then'](respondWithResult(_0x213459,null))[_0x4eaa('0x25')](handleError(_0x213459,null));};exports['addProactiveActions']=function(_0x24e36b,_0x435344,_0x39e507){return db[_0x4eaa('0x11d')][_0x4eaa('0x55')]({'where':{'id':_0x24e36b['params']['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x435344,null))[_0x4eaa('0x1c')](function(_0x42a1ac){if(_0x42a1ac){return _0x42a1ac[_0x4eaa('0x11e')](_0x24e36b['body']['ids'],_[_0x4eaa('0xf1')](_0x24e36b[_0x4eaa('0x57')],[_0x4eaa('0x66'),'id'])||{});}})[_0x4eaa('0x1c')](respondWithResult(_0x435344,null))['catch'](handleError(_0x435344,null));};exports[_0x4eaa('0x105')]=function(_0xfa39ca,_0x1be716,_0x8389c9){var _0xe06895={};var _0x42e255={};var _0x35e7d1;var _0x324514;return db['ChatWebsite']['findOne']({'where':{'id':_0xfa39ca[_0x4eaa('0x52')]['id']}})['then'](handleEntityNotFound(_0x1be716,null))[_0x4eaa('0x1c')](function(_0xad7660){if(_0xad7660){_0x35e7d1=_0xad7660;_0x42e255[_0x4eaa('0x40')]=_[_0x4eaa('0x42')](db[_0x4eaa('0x11f')][_0x4eaa('0x3e')]);_0x42e255['query']=_[_0x4eaa('0x42')](_0xfa39ca[_0x4eaa('0x41')]);_0x42e255[_0x4eaa('0x43')]=_['intersection'](_0x42e255['model'],_0x42e255[_0x4eaa('0x41')]);_0xe06895[_0x4eaa('0x45')]=_[_0x4eaa('0x44')](_0x42e255[_0x4eaa('0x40')],qs[_0x4eaa('0x46')](_0xfa39ca['query'][_0x4eaa('0x46')]));_0xe06895[_0x4eaa('0x45')]=_0xe06895[_0x4eaa('0x45')]['length']?_0xe06895[_0x4eaa('0x45')]:_0x42e255[_0x4eaa('0x40')];_0xe06895[_0x4eaa('0x49')]=qs[_0x4eaa('0x4a')](_0xfa39ca[_0x4eaa('0x41')]['sort']);_0xe06895[_0x4eaa('0x4b')]=qs[_0x4eaa('0x43')](_[_0x4eaa('0x63')](_0xfa39ca[_0x4eaa('0x41')],_0x42e255[_0x4eaa('0x43')]));if(_0xfa39ca[_0x4eaa('0x41')][_0x4eaa('0x4c')]){_0xe06895['where']=_['merge'](_0xe06895['where'],{'$or':_[_0x4eaa('0x3c')](_0xe06895[_0x4eaa('0x45')],function(_0x1a7065){var _0x362920={};_0x362920[_0x1a7065]={'$like':'%'+_0xfa39ca[_0x4eaa('0x41')][_0x4eaa('0x4c')]+'%'};return _0x362920;})});}_0xe06895=_['merge']({},_0xe06895,_0xfa39ca['options']);return _0x35e7d1[_0x4eaa('0x105')](_0xe06895);}})[_0x4eaa('0x1c')](function(_0x5c4ed2){if(_0x5c4ed2){_0x324514=_0x5c4ed2[_0x4eaa('0x47')];if(!_0xfa39ca[_0x4eaa('0x41')]['hasOwnProperty'](_0x4eaa('0x48'))){_0xe06895[_0x4eaa('0x2b')]=qs['limit'](_0xfa39ca[_0x4eaa('0x41')][_0x4eaa('0x2b')]);_0xe06895['offset']=qs[_0x4eaa('0x29')](_0xfa39ca[_0x4eaa('0x41')][_0x4eaa('0x29')]);}return _0x35e7d1['getProactiveActions'](_0xe06895);}})[_0x4eaa('0x1c')](function(_0x541ced){if(_0x541ced){return _0x541ced?{'count':_0x324514,'rows':_0x541ced}:null;}})['then'](respondWithResult(_0x1be716,null))[_0x4eaa('0x25')](handleError(_0x1be716,null));};exports['getFields']=function(_0x5dc7cd,_0x3e4805,_0x446b8b){var _0xd2e423=_0x5dc7cd[_0x4eaa('0x41')][_0x4eaa('0x120')]===_0x4eaa('0x121')?_0x4eaa('0x122'):_0x4eaa('0x123');return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'attributes':['id',_0xd2e423],'where':{'id':_0x5dc7cd['params']['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x3e4805,null))[_0x4eaa('0x1c')](function(_0x2d5341){if(_0x2d5341){var _0x52ca5d=_0x2d5341[_0xd2e423];var _0x1d3781=_0x52ca5d&&_0x52ca5d[_0x4eaa('0x124')]?_0x52ca5d[_0x4eaa('0x124')]:[];_0x3e4805[_0x4eaa('0xc7')]({'fromKey':_['isNil'](_0x52ca5d[_0x4eaa('0x125')])?undefined:_0x52ca5d[_0x4eaa('0x125')],'count':_0x1d3781['length'],'rows':_0x1d3781});}})['catch'](handleError(_0x3e4805,null));};exports[_0x4eaa('0x126')]=function(_0xc24a26,_0x3ea19d,_0x4f4de4){var _0x38f030={'raw':![],'where':{}};var _0x410c07={};var _0x1ef82f={'count':0x0,'rows':[]};return db[_0x4eaa('0x3d')][_0x4eaa('0x60')]({'where':{'id':_0xc24a26[_0x4eaa('0x52')]['id']}})['then'](handleEntityNotFound(_0x3ea19d,null))[_0x4eaa('0x1c')](function(_0x1b62d2){if(_0x1b62d2){_0x410c07['model']=_[_0x4eaa('0x42')](db[_0x4eaa('0xd3')][_0x4eaa('0x3e')]);_0x410c07[_0x4eaa('0x41')]=_[_0x4eaa('0x42')](_0xc24a26[_0x4eaa('0x41')]);_0x410c07[_0x4eaa('0x43')]=_[_0x4eaa('0x44')](_0x410c07[_0x4eaa('0x40')],_0x410c07['query']);_0x38f030[_0x4eaa('0x45')]=_[_0x4eaa('0x44')](_0x410c07[_0x4eaa('0x40')],qs[_0x4eaa('0x46')](_0xc24a26[_0x4eaa('0x41')][_0x4eaa('0x46')]));_0x38f030[_0x4eaa('0x45')]=_0x38f030[_0x4eaa('0x45')]['length']?_0x38f030['attributes']:_0x410c07[_0x4eaa('0x40')];if(!_0xc24a26['query'][_0x4eaa('0x62')](_0x4eaa('0x48'))){_0x38f030[_0x4eaa('0x2b')]=qs[_0x4eaa('0x2b')](_0xc24a26[_0x4eaa('0x41')][_0x4eaa('0x2b')]);_0x38f030[_0x4eaa('0x29')]=qs[_0x4eaa('0x29')](_0xc24a26[_0x4eaa('0x41')][_0x4eaa('0x29')]);}_0x38f030['order']=qs['sort'](_0xc24a26[_0x4eaa('0x41')]['sort']);_0x38f030[_0x4eaa('0x4b')]=qs[_0x4eaa('0x43')](_[_0x4eaa('0x63')](_0xc24a26[_0x4eaa('0x41')],_0x410c07[_0x4eaa('0x43')]));_0x38f030[_0x4eaa('0x4b')][_0x4eaa('0x5e')]=_0x1b62d2['id'];if(_0xc24a26['query'][_0x4eaa('0x4c')]){_0x38f030[_0x4eaa('0x4b')]=_[_0x4eaa('0x4d')](_0x38f030['where'],{'$or':_[_0x4eaa('0x3c')](_0x38f030[_0x4eaa('0x45')],function(_0x4e4193){var _0x143f30={};_0x143f30[_0x4e4193]={'$like':'%'+_0xc24a26[_0x4eaa('0x41')][_0x4eaa('0x4c')]+'%'};return _0x143f30;})});}_0x38f030=_[_0x4eaa('0x4d')]({},_0x38f030,_0xc24a26['options']);return db[_0x4eaa('0xd3')]['count']({'where':_0x38f030['where']})[_0x4eaa('0x1c')](function(_0x5e3540){_0x1ef82f[_0x4eaa('0x2c')]=_0x5e3540;if(_0xc24a26[_0x4eaa('0x41')][_0x4eaa('0x53')]){_0x38f030[_0x4eaa('0x4f')]=[{'all':!![]}];}else{_0x38f030['include']=[{'model':db[_0x4eaa('0x89')],'as':_0x4eaa('0xf3'),'required':![]},{'model':db['Attachment'],'as':_0x4eaa('0x127'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x38f030);})['then'](function(_0x5d9e7e){_0x1ef82f[_0x4eaa('0x64')]=_0x5d9e7e;return _0x1ef82f;});}})[_0x4eaa('0x1c')](respondWithFilteredResult(_0x3ea19d,_0x38f030))[_0x4eaa('0x25')](handleError(_0x3ea19d,null));};exports['addAgents']=function(_0xbda118,_0x5ab320,_0x220f26){return db[_0x4eaa('0x3d')]['find']({'where':{'id':_0xbda118[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x5ab320,null))[_0x4eaa('0x1c')](function(_0x31a3b4){if(_0x31a3b4){return _0x31a3b4['addAgents'](_0xbda118['body'][_0x4eaa('0x66')],_['omit'](_0xbda118[_0x4eaa('0x57')],[_0x4eaa('0x66'),'id'])||{})['spread'](function(_0x2f4ef7){for(var _0x47aabc=0x0;_0x47aabc<_0xbda118[_0x4eaa('0x57')]['ids'][_0x4eaa('0x47')];_0x47aabc+=0x1){socket[_0x4eaa('0x128')](_0x4eaa('0x129'),{'UserId':Number(_0xbda118[_0x4eaa('0x57')][_0x4eaa('0x66')][_0x47aabc]),'ChatWebsiteId':Number(_0xbda118['params']['id'])});}return _0x2f4ef7;});}})[_0x4eaa('0x1c')](respondWithResult(_0x5ab320,null))[_0x4eaa('0x25')](handleError(_0x5ab320,null));};exports[_0x4eaa('0x12a')]=function(_0x2c9827,_0x48e6d1,_0x51461d){return db[_0x4eaa('0x3d')][_0x4eaa('0x55')]({'where':{'id':_0x2c9827[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x48e6d1,null))[_0x4eaa('0x1c')](function(_0x37fe17){if(_0x37fe17){return _0x37fe17[_0x4eaa('0x12a')](_0x2c9827[_0x4eaa('0x41')]['ids'])[_0x4eaa('0x1c')](function(){if(_[_0x4eaa('0x12b')](_0x2c9827[_0x4eaa('0x41')][_0x4eaa('0x66')])){for(var _0x461290=0x0;_0x461290<_0x2c9827['query']['ids'][_0x4eaa('0x47')];_0x461290+=0x1){socket[_0x4eaa('0x128')](_0x4eaa('0x12c'),{'UserId':Number(_0x2c9827[_0x4eaa('0x41')]['ids'][_0x461290]),'ChatWebsiteId':Number(_0x2c9827[_0x4eaa('0x52')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x2c9827[_0x4eaa('0x41')][_0x4eaa('0x66')]),'ChatWebsiteId':Number(_0x2c9827[_0x4eaa('0x52')]['id'])});}});}})[_0x4eaa('0x1c')](respondWithStatusCode(_0x48e6d1,null))[_0x4eaa('0x25')](handleError(_0x48e6d1,null));};exports[_0x4eaa('0x12d')]=function(_0x5ef9a2,_0x1c04b4,_0x1b4774){var _0x40a3ff={};var _0x5a3527={};var _0x26213a;var _0x58638e;return db[_0x4eaa('0x3d')]['findOne']({'where':{'id':_0x5ef9a2[_0x4eaa('0x52')]['id']}})[_0x4eaa('0x1c')](handleEntityNotFound(_0x1c04b4,null))[_0x4eaa('0x1c')](function(_0x532d70){if(_0x532d70){_0x26213a=_0x532d70;_0x5a3527['model']=_['keys'](db['User'][_0x4eaa('0x3e')]);_0x5a3527['query']=_[_0x4eaa('0x42')](_0x5ef9a2[_0x4eaa('0x41')]);_0x5a3527[_0x4eaa('0x43')]=_[_0x4eaa('0x44')](_0x5a3527[_0x4eaa('0x40')],_0x5a3527['query']);_0x40a3ff[_0x4eaa('0x45')]=_[_0x4eaa('0x44')](_0x5a3527['model'],qs[_0x4eaa('0x46')](_0x5ef9a2[_0x4eaa('0x41')]['fields']));_0x40a3ff[_0x4eaa('0x45')]=_0x40a3ff[_0x4eaa('0x45')][_0x4eaa('0x47')]?_0x40a3ff[_0x4eaa('0x45')]:_0x5a3527[_0x4eaa('0x40')];_0x40a3ff[_0x4eaa('0x49')]=qs[_0x4eaa('0x4a')](_0x5ef9a2[_0x4eaa('0x41')][_0x4eaa('0x4a')]);_0x40a3ff[_0x4eaa('0x4b')]=qs[_0x4eaa('0x43')](_[_0x4eaa('0x63')](_0x5ef9a2[_0x4eaa('0x41')],_0x5a3527[_0x4eaa('0x43')]));if(_0x5ef9a2[_0x4eaa('0x41')][_0x4eaa('0x4c')]){_0x40a3ff[_0x4eaa('0x4b')]=_[_0x4eaa('0x4d')](_0x40a3ff['where'],{'$or':_['map'](_0x40a3ff[_0x4eaa('0x45')],function(_0xddce4){var _0x413ad9={};_0x413ad9[_0xddce4]={'$like':'%'+_0x5ef9a2[_0x4eaa('0x41')][_0x4eaa('0x4c')]+'%'};return _0x413ad9;})});}_0x40a3ff=_[_0x4eaa('0x4d')]({},_0x40a3ff,_0x5ef9a2[_0x4eaa('0x54')]);return _0x26213a[_0x4eaa('0x12d')](_0x40a3ff);}})[_0x4eaa('0x1c')](function(_0x1c8198){if(_0x1c8198){_0x58638e=_0x1c8198[_0x4eaa('0x47')];if(!_0x5ef9a2[_0x4eaa('0x41')][_0x4eaa('0x62')]('nolimit')){_0x40a3ff[_0x4eaa('0x2b')]=qs[_0x4eaa('0x2b')](_0x5ef9a2[_0x4eaa('0x41')][_0x4eaa('0x2b')]);_0x40a3ff[_0x4eaa('0x29')]=qs['offset'](_0x5ef9a2['query'][_0x4eaa('0x29')]);}return _0x26213a[_0x4eaa('0x12d')](_0x40a3ff);}})[_0x4eaa('0x1c')](function(_0x160f9b){if(_0x160f9b){return _0x160f9b?{'count':_0x58638e,'rows':_0x160f9b}:null;}})[_0x4eaa('0x1c')](respondWithResult(_0x1c04b4,null))[_0x4eaa('0x25')](handleError(_0x1c04b4,null));};
\ No newline at end of file
index bccf6be..d2e544c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d9=['ChatWebsite','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x55c937,_0x4136f7){var _0xc45fad=function(_0xf2e4c){while(--_0xf2e4c){_0x55c937['push'](_0x55c937['shift']());}};_0xc45fad(++_0x4136f7);}(_0x95d9,0x97));var _0x995d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x95d9[_0x2c91e9];return _0x13f0ff;};'use strict';var EventEmitter=require(_0x995d('0x0'));var ChatWebsite=require(_0x995d('0x1'))['db'][_0x995d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x995d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x995d('0x4'),'afterDestroy':_0x995d('0x5')};function emitEvent(_0x1932c3){return function(_0x5b44d3,_0x225c17,_0x14e096){ChatWebsiteEvents[_0x995d('0x6')](_0x1932c3+':'+_0x5b44d3['id'],_0x5b44d3);ChatWebsiteEvents[_0x995d('0x6')](_0x1932c3,_0x5b44d3);_0x14e096(null);};}for(var e in events){if(events[_0x995d('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x995d('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf483=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf483,0xf2));var _0x3f48=function(_0x3d2b6d,_0x1c710e){_0x3d2b6d=_0x3d2b6d-0x0;var _0x268764=_0xf483[_0x3d2b6d];return _0x268764;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3f48('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3f48('0x1')](0x0);var events={'afterCreate':_0x3f48('0x2'),'afterUpdate':_0x3f48('0x3'),'afterDestroy':_0x3f48('0x4')};function emitEvent(_0x169391){return function(_0x312d9c,_0x5deb61,_0x49f64a){ChatWebsiteEvents['emit'](_0x169391+':'+_0x312d9c['id'],_0x312d9c);ChatWebsiteEvents[_0x3f48('0x5')](_0x169391,_0x312d9c);_0x49f64a(null);};}for(var e in events){if(events[_0x3f48('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x3f48('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
index a2b74bb..be97e39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf184=['exports','ChatWebsite','chat_websites','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf184,0x179));var _0x4f18=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0xf184[_0x4ce028];return _0x583d0c;};'use strict';var _=require(_0x4f18('0x0'));var util=require(_0x4f18('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4f18('0x2'));var BPromise=require('bluebird');var rp=require(_0x4f18('0x3'));var fs=require('fs');var path=require(_0x4f18('0x4'));var rimraf=require(_0x4f18('0x5'));var config=require(_0x4f18('0x6'));var attributes=require(_0x4f18('0x7'));module[_0x4f18('0x8')]=function(_0x3eb330,_0x4688f5){return _0x3eb330['define'](_0x4f18('0x9'),attributes,{'tableName':_0x4f18('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff60=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0xff60,0x133));var _0x0ff6=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xff60[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x0ff6('0x0'));var util=require('util');var logger=require(_0x0ff6('0x1'))(_0x0ff6('0x2'));var moment=require(_0x0ff6('0x3'));var BPromise=require(_0x0ff6('0x4'));var rp=require(_0x0ff6('0x5'));var fs=require('fs');var path=require(_0x0ff6('0x6'));var rimraf=require(_0x0ff6('0x7'));var config=require(_0x0ff6('0x8'));var attributes=require(_0x0ff6('0x9'));module[_0x0ff6('0xa')]=function(_0x350e86,_0x3789bd){return _0x350e86[_0x0ff6('0xb')](_0x0ff6('0xc'),attributes,{'tableName':_0x0ff6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e8899a7..3e1662b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe86=['debug','stringify','error','ChatWebsite,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then','info'];(function(_0x20834a,_0x471f90){var _0x33da2d=function(_0x22a346){while(--_0x22a346){_0x20834a['push'](_0x20834a['shift']());}};_0x33da2d(++_0x471f90);}(_0xbe86,0x84));var _0x6be8=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0xbe86[_0xab0515];return _0x443d59;};'use strict';var _=require(_0x6be8('0x0'));var util=require(_0x6be8('0x1'));var moment=require(_0x6be8('0x2'));var BPromise=require('bluebird');var rs=require(_0x6be8('0x3'));var fs=require('fs');var Redis=require(_0x6be8('0x4'));var db=require(_0x6be8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6be8('0x6'))('rpc');var config=require(_0x6be8('0x7'));var jayson=require(_0x6be8('0x8'));var client=jayson[_0x6be8('0x9')][_0x6be8('0xa')]({'port':0x232a});config[_0x6be8('0xb')]=_[_0x6be8('0xc')](config[_0x6be8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6be8('0xd'))(new Redis(config[_0x6be8('0xb')]));require(_0x6be8('0xe'))[_0x6be8('0xf')](socket);function respondWithRpcPromise(_0x5136ff,_0x34c93e,_0x2f2144){return new BPromise(function(_0x55632d,_0x2a151e){return client['request'](_0x5136ff,_0x2f2144)[_0x6be8('0x10')](function(_0x3c3c4d){logger[_0x6be8('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x34c93e,'request\x20sent');logger[_0x6be8('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x34c93e,'request\x20sent',JSON[_0x6be8('0x13')](_0x3c3c4d));if(_0x3c3c4d[_0x6be8('0x14')]){if(_0x3c3c4d[_0x6be8('0x14')]['code']===0x1f4){logger['error'](_0x6be8('0x15'),_0x34c93e,_0x3c3c4d[_0x6be8('0x14')][_0x6be8('0x16')]);return _0x2a151e(_0x3c3c4d[_0x6be8('0x14')][_0x6be8('0x16')]);}logger[_0x6be8('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x34c93e,_0x3c3c4d[_0x6be8('0x14')][_0x6be8('0x16')]);return _0x55632d(_0x3c3c4d[_0x6be8('0x14')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x34c93e,_0x6be8('0x17'));_0x55632d(_0x3c3c4d[_0x6be8('0x18')][_0x6be8('0x16')]);}})['catch'](function(_0x3e34de){logger[_0x6be8('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x34c93e,_0x3e34de);_0x2a151e(_0x3e34de);});});}
\ No newline at end of file
+var _0x1ac4=['stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3cd071,_0x53b989){var _0x575ddb=function(_0x53f193){while(--_0x53f193){_0x3cd071['push'](_0x3cd071['shift']());}};_0x575ddb(++_0x53b989);}(_0x1ac4,0x155));var _0x41ac=function(_0x281a3b,_0x1df435){_0x281a3b=_0x281a3b-0x0;var _0x387721=_0x1ac4[_0x281a3b];return _0x387721;};'use strict';var _=require(_0x41ac('0x0'));var util=require('util');var moment=require(_0x41ac('0x1'));var BPromise=require('bluebird');var rs=require(_0x41ac('0x2'));var fs=require('fs');var Redis=require(_0x41ac('0x3'));var db=require(_0x41ac('0x4'))['db'];var utils=require(_0x41ac('0x5'));var logger=require(_0x41ac('0x6'))('rpc');var config=require(_0x41ac('0x7'));var jayson=require(_0x41ac('0x8'));var client=jayson[_0x41ac('0x9')][_0x41ac('0xa')]({'port':0x232a});config[_0x41ac('0xb')]=_[_0x41ac('0xc')](config[_0x41ac('0xb')],{'host':_0x41ac('0xd'),'port':0x18eb});var socket=require(_0x41ac('0xe'))(new Redis(config[_0x41ac('0xb')]));require('./chatWebsite.socket')[_0x41ac('0xf')](socket);function respondWithRpcPromise(_0x11a1a3,_0x4cce7d,_0x1dc32e){return new BPromise(function(_0x3f4576,_0x5a2b0b){return client[_0x41ac('0x10')](_0x11a1a3,_0x1dc32e)[_0x41ac('0x11')](function(_0xbde40e){logger[_0x41ac('0x12')](_0x41ac('0x13'),_0x4cce7d,'request\x20sent');logger[_0x41ac('0x14')](_0x41ac('0x15'),_0x4cce7d,_0x41ac('0x16'),JSON[_0x41ac('0x17')](_0xbde40e));if(_0xbde40e['error']){if(_0xbde40e[_0x41ac('0x18')]['code']===0x1f4){logger['error'](_0x41ac('0x13'),_0x4cce7d,_0xbde40e['error'][_0x41ac('0x19')]);return _0x5a2b0b(_0xbde40e[_0x41ac('0x18')]['message']);}logger[_0x41ac('0x18')](_0x41ac('0x13'),_0x4cce7d,_0xbde40e[_0x41ac('0x18')][_0x41ac('0x19')]);return _0x3f4576(_0xbde40e[_0x41ac('0x18')][_0x41ac('0x19')]);}else{logger[_0x41ac('0x12')](_0x41ac('0x13'),_0x4cce7d,_0x41ac('0x16'));_0x3f4576(_0xbde40e[_0x41ac('0x1a')][_0x41ac('0x19')]);}})[_0x41ac('0x1b')](function(_0x196f39){logger[_0x41ac('0x18')](_0x41ac('0x13'),_0x4cce7d,_0x196f39);_0x5a2b0b(_0x196f39);});});}
\ No newline at end of file
index 5ad8731..2ec4ef2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x698a=['length','chatWebsite:','save','remove','update','emit','removeListener','register'];(function(_0x4475ce,_0xea730){var _0xf5f37a=function(_0x4a21e5){while(--_0x4a21e5){_0x4475ce['push'](_0x4475ce['shift']());}};_0xf5f37a(++_0xea730);}(_0x698a,0x1ca));var _0xa698=function(_0x45050c,_0x2c514e){_0x45050c=_0x45050c-0x0;var _0x43be36=_0x698a[_0x45050c];return _0x43be36;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xa698('0x0'),_0xa698('0x1'),_0xa698('0x2')];function createListener(_0x289d97,_0x45ea3e){return function(_0x3bd56d){_0x45ea3e[_0xa698('0x3')](_0x289d97,_0x3bd56d);};}function removeListener(_0x3bfcac,_0x519618){return function(){ChatWebsiteEvents[_0xa698('0x4')](_0x3bfcac,_0x519618);};}exports[_0xa698('0x5')]=function(_0x267a9c){for(var _0x1fe135=0x0,_0x1b6de6=events[_0xa698('0x6')];_0x1fe135<_0x1b6de6;_0x1fe135++){var _0x240f17=events[_0x1fe135];var _0x5832d0=createListener(_0xa698('0x7')+_0x240f17,_0x267a9c);ChatWebsiteEvents['on'](_0x240f17,_0x5832d0);}};
\ No newline at end of file
+var _0xb1d8=['removeListener','register','length','./chatWebsite.events','remove','update','emit'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xb1d8,0xa4));var _0x8b1d=function(_0x24a302,_0x2f5690){_0x24a302=_0x24a302-0x0;var _0x523e4e=_0xb1d8[_0x24a302];return _0x523e4e;};'use strict';var ChatWebsiteEvents=require(_0x8b1d('0x0'));var events=['save',_0x8b1d('0x1'),_0x8b1d('0x2')];function createListener(_0x2b8eb7,_0x515505){return function(_0x3ccd16){_0x515505[_0x8b1d('0x3')](_0x2b8eb7,_0x3ccd16);};}function removeListener(_0x4088df,_0x370523){return function(){ChatWebsiteEvents[_0x8b1d('0x4')](_0x4088df,_0x370523);};}exports[_0x8b1d('0x5')]=function(_0x192793){for(var _0x1aabb3=0x0,_0x347f4a=events[_0x8b1d('0x6')];_0x1aabb3<_0x347f4a;_0x1aabb3++){var _0x565b59=events[_0x1aabb3];var _0x54fb62=createListener('chatWebsite:'+_0x565b59,_0x192793);ChatWebsiteEvents['on'](_0x565b59,_0x54fb62);}};
\ No newline at end of file
index f9193db..ab02d2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa48d=['/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','file','single','addAvatar','addCustomerAvatar','server/files/images/avatars/','addSystemAvatar','/:id/notify','notify','join','server/files','ensureDir','extname','/:id/offline','offline','addApplications','addProactiveActions','put','update','delete','destroy','removeAnswers','exports','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo'];(function(_0x4bc221,_0x51adfe){var _0x188462=function(_0x147bee){while(--_0x147bee){_0x4bc221['push'](_0x4bc221['shift']());}};_0x188462(++_0x51adfe);}(_0xa48d,0xc2));var _0xda48=function(_0x4f53d8,_0x3c45fa){_0x4f53d8=_0x4f53d8-0x0;var _0x537643=_0xa48d[_0x4f53d8];return _0x537643;};'use strict';var multer=require('multer');var util=require(_0xda48('0x0'));var path=require(_0xda48('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xda48('0x2')]();var fs_extra=require(_0xda48('0x3'));var auth=require(_0xda48('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xda48('0x5'));var controller=require(_0xda48('0x6'));router[_0xda48('0x7')]('/',auth[_0xda48('0x8')](),controller[_0xda48('0x9')]);router['get'](_0xda48('0xa'),auth[_0xda48('0x8')](),controller[_0xda48('0xb')]);router[_0xda48('0x7')](_0xda48('0xc'),auth[_0xda48('0x8')](),controller[_0xda48('0xd')]);router[_0xda48('0x7')](_0xda48('0xe'),auth[_0xda48('0x8')](),controller[_0xda48('0xf')]);router['get']('/:id/canned_answers',auth[_0xda48('0x8')](),controller[_0xda48('0x10')]);router[_0xda48('0x7')](_0xda48('0x11'),controller[_0xda48('0x12')]);router['get'](_0xda48('0x13'),controller[_0xda48('0x14')]);router['get'](_0xda48('0x15'),controller['getCustomerAvatar']);router[_0xda48('0x7')](_0xda48('0x16'),controller[_0xda48('0x17')]);router['get'](_0xda48('0x18'),auth[_0xda48('0x8')](),controller[_0xda48('0x19')]);router[_0xda48('0x7')](_0xda48('0x1a'),controller[_0xda48('0x1b')]);router[_0xda48('0x7')](_0xda48('0x1c'),auth[_0xda48('0x8')](),controller[_0xda48('0x1d')]);router[_0xda48('0x7')](_0xda48('0x1e'),auth[_0xda48('0x8')](),controller[_0xda48('0x1f')]);router[_0xda48('0x7')](_0xda48('0x20'),controller[_0xda48('0x21')]);router['get'](_0xda48('0x22'),auth[_0xda48('0x8')](),controller[_0xda48('0x23')]);router[_0xda48('0x7')](_0xda48('0x24'),auth['isAuthenticated'](),controller[_0xda48('0x25')]);router[_0xda48('0x26')]('/',auth['isAuthenticated'](),controller[_0xda48('0x27')]);router['post'](_0xda48('0xe'),auth[_0xda48('0x8')](),controller[_0xda48('0x28')]);router[_0xda48('0x26')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xda48('0x29')]);var upload=multer({'storage':multer[_0xda48('0x2a')]({'destination':function(_0x110fd3,_0xebb5f3,_0x2dc021){_0x2dc021(null,path['join'](config[_0xda48('0x2b')],_0xda48('0x2c')));},'filename':function(_0x9a4a0b,_0x47ae40,_0x1b1b71){_0x1b1b71(null,util[_0xda48('0x2d')](_0xda48('0x2e'),Date[_0xda48('0x2f')](),_0x47ae40[_0xda48('0x30')]));}})});router[_0xda48('0x26')](_0xda48('0x11'),upload['single'](_0xda48('0x31')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22b969,_0x1a18af,_0x3d99be){_0x3d99be(null,path['join'](config[_0xda48('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x50515e,_0x5f1f8b,_0x4dffaa){_0x4dffaa(null,util[_0xda48('0x2d')](_0xda48('0x2e'),Date['now'](),_0x5f1f8b[_0xda48('0x30')]));}})});router[_0xda48('0x26')](_0xda48('0x13'),upload[_0xda48('0x32')](_0xda48('0x31')),controller[_0xda48('0x33')]);var upload=multer({'storage':multer[_0xda48('0x2a')]({'destination':function(_0x23d9b5,_0x4477a1,_0x1f0a65){_0x1f0a65(null,path['join'](config[_0xda48('0x2b')],'server/files/images/avatars/'));},'filename':function(_0x77a1f,_0x4d0e34,_0x5d5263){_0x5d5263(null,util['format']('%s-%s',Date[_0xda48('0x2f')](),_0x4d0e34[_0xda48('0x30')]));}})});router[_0xda48('0x26')](_0xda48('0x15'),upload['single'](_0xda48('0x31')),controller[_0xda48('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x48d38a,_0x508268,_0x3237d1){_0x3237d1(null,path['join'](config[_0xda48('0x2b')],_0xda48('0x35')));},'filename':function(_0x2bb4a5,_0x32f533,_0x11767e){_0x11767e(null,util[_0xda48('0x2d')](_0xda48('0x2e'),Date[_0xda48('0x2f')](),_0x32f533['originalname']));}})});router[_0xda48('0x26')](_0xda48('0x16'),upload[_0xda48('0x32')](_0xda48('0x31')),controller[_0xda48('0x36')]);router[_0xda48('0x26')](_0xda48('0x37'),controller[_0xda48('0x38')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x120be8,_0x5febbd,_0x5790f2){const _0x1b508e=path[_0xda48('0x39')](config[_0xda48('0x2b')],_0xda48('0x3a'),'attachments','offline-chat');fs_extra[_0xda48('0x3b')](_0x1b508e,function(){_0x5790f2(null,_0x1b508e);});},'filename':function(_0x2d19b4,_0x28d420,_0x3ae3ac){const _0x504d34=_0x28d420[_0xda48('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3831f8=path[_0xda48('0x3c')](_0x504d34);const _0x544e45=Date['now']()+'-'+_0x504d34['replace'](_0x3831f8,'')+_0x3831f8;_0x3ae3ac(null,_0x544e45);}})});router[_0xda48('0x26')](_0xda48('0x3d'),offlineUploadMulter['any'](),controller[_0xda48('0x3e')]);router['post'](_0xda48('0x18'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xda48('0x26')]('/:id/applications',auth[_0xda48('0x8')](),controller[_0xda48('0x3f')]);router[_0xda48('0x26')](_0xda48('0x1e'),auth[_0xda48('0x8')](),controller[_0xda48('0x40')]);router['post'](_0xda48('0x24'),auth[_0xda48('0x8')](),controller['addAgents']);router[_0xda48('0x41')]('/:id',auth[_0xda48('0x8')](),controller[_0xda48('0x42')]);router[_0xda48('0x43')](_0xda48('0xc'),auth[_0xda48('0x8')](),controller[_0xda48('0x44')]);router['delete'](_0xda48('0xe'),auth[_0xda48('0x8')](),controller['removeDispositions']);router[_0xda48('0x43')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xda48('0x45')]);router['delete'](_0xda48('0x24'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xda48('0x46')]=router;
\ No newline at end of file
+var _0x021b=['/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','single','file','root','server/files/images/avatars/','originalname','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addApplications','/:id/proactive_actions','addProactiveActions','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet'];(function(_0xfa680,_0x35ec42){var _0x14ad20=function(_0x26f971){while(--_0x26f971){_0xfa680['push'](_0xfa680['shift']());}};_0x14ad20(++_0x35ec42);}(_0x021b,0x157));var _0xb021=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x021b[_0x44039a];return _0x525de5;};'use strict';var multer=require(_0xb021('0x0'));var util=require(_0xb021('0x1'));var path=require(_0xb021('0x2'));var timeout=require(_0xb021('0x3'));var express=require(_0xb021('0x4'));var router=express[_0xb021('0x5')]();var fs_extra=require(_0xb021('0x6'));var auth=require(_0xb021('0x7'));var interaction=require(_0xb021('0x8'));var config=require(_0xb021('0x9'));var controller=require(_0xb021('0xa'));router[_0xb021('0xb')]('/',auth[_0xb021('0xc')](),controller[_0xb021('0xd')]);router[_0xb021('0xb')](_0xb021('0xe'),auth[_0xb021('0xc')](),controller[_0xb021('0xf')]);router[_0xb021('0xb')](_0xb021('0x10'),auth[_0xb021('0xc')](),controller[_0xb021('0x11')]);router[_0xb021('0xb')](_0xb021('0x12'),auth[_0xb021('0xc')](),controller[_0xb021('0x13')]);router[_0xb021('0xb')]('/:id/canned_answers',auth[_0xb021('0xc')](),controller[_0xb021('0x14')]);router[_0xb021('0xb')](_0xb021('0x15'),controller[_0xb021('0x16')]);router[_0xb021('0xb')](_0xb021('0x17'),controller[_0xb021('0x18')]);router[_0xb021('0xb')](_0xb021('0x19'),controller[_0xb021('0x1a')]);router[_0xb021('0xb')](_0xb021('0x1b'),controller[_0xb021('0x1c')]);router[_0xb021('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xb021('0x1d')]);router[_0xb021('0xb')](_0xb021('0x1e'),controller[_0xb021('0x1f')]);router['get'](_0xb021('0x20'),auth['isAuthenticated'](),controller[_0xb021('0x21')]);router[_0xb021('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xb021('0x22')]);router[_0xb021('0xb')](_0xb021('0x23'),controller[_0xb021('0x24')]);router[_0xb021('0xb')](_0xb021('0x25'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0xb021('0xb')](_0xb021('0x26'),auth['isAuthenticated'](),controller[_0xb021('0x27')]);router[_0xb021('0x28')]('/',auth['isAuthenticated'](),controller[_0xb021('0x29')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xb021('0x2a')]);router[_0xb021('0x28')](_0xb021('0x2b'),auth[_0xb021('0xc')](),controller[_0xb021('0x2c')]);var upload=multer({'storage':multer[_0xb021('0x2d')]({'destination':function(_0x3ed0d7,_0x28fe68,_0x10a2f4){_0x10a2f4(null,path[_0xb021('0x2e')](config['root'],_0xb021('0x2f')));},'filename':function(_0x566d1f,_0x498b93,_0x5b40a5){_0x5b40a5(null,util[_0xb021('0x30')](_0xb021('0x31'),Date[_0xb021('0x32')](),_0x498b93['originalname']));}})});router['post'](_0xb021('0x15'),upload[_0xb021('0x33')](_0xb021('0x34')),controller['addLogo']);var upload=multer({'storage':multer[_0xb021('0x2d')]({'destination':function(_0x29aa46,_0x11003e,_0x515342){_0x515342(null,path[_0xb021('0x2e')](config[_0xb021('0x35')],_0xb021('0x36')));},'filename':function(_0x1f6d70,_0x224ff9,_0x203016){_0x203016(null,util['format']('%s-%s',Date[_0xb021('0x32')](),_0x224ff9[_0xb021('0x37')]));}})});router[_0xb021('0x28')](_0xb021('0x17'),upload['single'](_0xb021('0x34')),controller['addAvatar']);var upload=multer({'storage':multer[_0xb021('0x2d')]({'destination':function(_0x24d159,_0x167b2,_0x1f25d3){_0x1f25d3(null,path[_0xb021('0x2e')](config[_0xb021('0x35')],_0xb021('0x36')));},'filename':function(_0x1459f8,_0x26a0d8,_0x3da865){_0x3da865(null,util[_0xb021('0x30')](_0xb021('0x31'),Date['now'](),_0x26a0d8[_0xb021('0x37')]));}})});router[_0xb021('0x28')](_0xb021('0x19'),upload[_0xb021('0x33')](_0xb021('0x34')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xb021('0x2d')]({'destination':function(_0x261056,_0x116f29,_0x208446){_0x208446(null,path[_0xb021('0x2e')](config[_0xb021('0x35')],_0xb021('0x36')));},'filename':function(_0x3d0ce6,_0x1c491b,_0x8f1552){_0x8f1552(null,util[_0xb021('0x30')](_0xb021('0x31'),Date['now'](),_0x1c491b[_0xb021('0x37')]));}})});router[_0xb021('0x28')]('/:id/system_avatar',upload[_0xb021('0x33')]('file'),controller['addSystemAvatar']);router[_0xb021('0x28')](_0xb021('0x38'),controller[_0xb021('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0xb021('0x2d')]({'destination':function(_0x45a178,_0x11dbc7,_0x3827f0){const _0x29dba0=path['join'](config[_0xb021('0x35')],'server/files',_0xb021('0x3a'),_0xb021('0x3b'));fs_extra[_0xb021('0x3c')](_0x29dba0,function(){_0x3827f0(null,_0x29dba0);});},'filename':function(_0x22810d,_0x80a02f,_0x14cd88){const _0x264b33=_0x80a02f[_0xb021('0x37')][_0xb021('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4c919f=path[_0xb021('0x3e')](_0x264b33);const _0x3ad673=Date[_0xb021('0x32')]()+'-'+_0x264b33['replace'](_0x4c919f,'')+_0x4c919f;_0x14cd88(null,_0x3ad673);}})});router[_0xb021('0x28')]('/:id/offline',offlineUploadMulter[_0xb021('0x3f')](),controller[_0xb021('0x40')]);router[_0xb021('0x28')](_0xb021('0x41'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xb021('0x28')](_0xb021('0x20'),auth['isAuthenticated'](),controller[_0xb021('0x42')]);router[_0xb021('0x28')](_0xb021('0x43'),auth[_0xb021('0xc')](),controller[_0xb021('0x44')]);router[_0xb021('0x28')]('/:id/users',auth[_0xb021('0xc')](),controller['addAgents']);router[_0xb021('0x45')](_0xb021('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xb021('0x46')](_0xb021('0x10'),auth[_0xb021('0xc')](),controller[_0xb021('0x47')]);router['delete'](_0xb021('0x12'),auth[_0xb021('0xc')](),controller[_0xb021('0x48')]);router['delete'](_0xb021('0x2b'),auth['isAuthenticated'](),controller[_0xb021('0x49')]);router[_0xb021('0x46')](_0xb021('0x26'),auth[_0xb021('0xc')](),controller[_0xb021('0x4a')]);module['exports']=router;
\ No newline at end of file
index 1573591..91e754e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['exports','STRING','AmazonAWS','sequelize'];(function(_0x43d332,_0x1c31c3){var _0x386c3b=function(_0x40702b){while(--_0x40702b){_0x43d332['push'](_0x43d332['shift']());}};_0x386c3b(++_0x1c31c3);}(_0xf072,0x1cf));var _0x2f07=function(_0x471bc2,_0x55c430){_0x471bc2=_0x471bc2-0x0;var _0x16d4ce=_0xf072[_0x471bc2];return _0x16d4ce;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'name':{'type':Sequelize[_0x2f07('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2f07('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2f07('0x2')]},'data2':{'type':Sequelize[_0x2f07('0x2')]}};
\ No newline at end of file
+var _0x85d0=['Google','STRING','AmazonAWS'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x85d0,0x164));var _0x085d=function(_0x1c7329,_0x580af9){_0x1c7329=_0x1c7329-0x0;var _0x178713=_0x85d0[_0x1c7329];return _0x178713;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x085d('0x0'),_0x085d('0x1')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x085d('0x2')]},'data2':{'type':Sequelize[_0x085d('0x2')]}};
\ No newline at end of file
index 858306e..99af2b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x228279,_0x15e195){var _0xc48574=function(_0x4f9e55){while(--_0x4f9e55){_0x228279['push'](_0x228279['shift']());}};_0xc48574(++_0x15e195);}(_0x7a54,0x106));var _0x47a5=function(_0x1c08f4,_0x2f2b7f){_0x1c08f4=_0x1c08f4-0x0;var _0x45e9b7=_0x7a54[_0x1c08f4];return _0x45e9b7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
+var _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','CloudProvider','fieldName','type','key'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xadb5,0xad));var _0x5adb=function(_0x27e7bd,_0x49a065){_0x27e7bd=_0x27e7bd-0x0;var _0xf45550=_0xadb5[_0x27e7bd];return _0xf45550;};'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['CloudProvider']['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['CloudProvider'][_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['CloudProvider'][_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
index c85f376..215565c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f2=['api','moment','request-promise','path','../../config/environment','exports','define','cloud_providers','lodash','util','../../config/logger'];(function(_0x2dac34,_0x1aeb5e){var _0x7a0bf=function(_0x528fe5){while(--_0x528fe5){_0x2dac34['push'](_0x2dac34['shift']());}};_0x7a0bf(++_0x1aeb5e);}(_0x49f2,0x11b));var _0x249f=function(_0x167914,_0x1a5418){_0x167914=_0x167914-0x0;var _0x422c8e=_0x49f2[_0x167914];return _0x422c8e;};'use strict';var _=require(_0x249f('0x0'));var util=require(_0x249f('0x1'));var logger=require(_0x249f('0x2'))(_0x249f('0x3'));var moment=require(_0x249f('0x4'));var BPromise=require('bluebird');var rp=require(_0x249f('0x5'));var fs=require('fs');var path=require(_0x249f('0x6'));var rimraf=require('rimraf');var config=require(_0x249f('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x249f('0x8')]=function(_0xf6d991,_0x627e1b){return _0xf6d991[_0x249f('0x9')]('CloudProvider',attributes,{'tableName':_0x249f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cfc=['path','rimraf','../../config/environment','exports','CloudProvider','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2e1585,_0x5f234d){var _0x5a9ca7=function(_0x480ba9){while(--_0x480ba9){_0x2e1585['push'](_0x2e1585['shift']());}};_0x5a9ca7(++_0x5f234d);}(_0x6cfc,0x144));var _0xc6cf=function(_0x2125f0,_0x2f23b9){_0x2125f0=_0x2125f0-0x0;var _0x12d6eb=_0x6cfc[_0x2125f0];return _0x12d6eb;};'use strict';var _=require(_0xc6cf('0x0'));var util=require(_0xc6cf('0x1'));var logger=require('../../config/logger')(_0xc6cf('0x2'));var moment=require(_0xc6cf('0x3'));var BPromise=require(_0xc6cf('0x4'));var rp=require(_0xc6cf('0x5'));var fs=require('fs');var path=require(_0xc6cf('0x6'));var rimraf=require(_0xc6cf('0x7'));var config=require(_0xc6cf('0x8'));var attributes=require('./cloudProvider.attributes');module[_0xc6cf('0x9')]=function(_0x483683,_0x1296d2){return _0x483683['define'](_0xc6cf('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe5588c..ba278f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa958=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','lodash','moment','bluebird','randomstring'];(function(_0x2e15db,_0x5541ea){var _0x1d022e=function(_0x5097de){while(--_0x5097de){_0x2e15db['push'](_0x2e15db['shift']());}};_0x1d022e(++_0x5541ea);}(_0xa958,0x94));var _0x8a95=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xa958[_0x50a0c2];return _0x5ebadd;};'use strict';var _=require(_0x8a95('0x0'));var util=require('util');var moment=require(_0x8a95('0x1'));var BPromise=require(_0x8a95('0x2'));var rs=require(_0x8a95('0x3'));var fs=require('fs');var Redis=require(_0x8a95('0x4'));var db=require(_0x8a95('0x5'))['db'];var utils=require(_0x8a95('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8a95('0x7'));var jayson=require(_0x8a95('0x8'));var client=jayson[_0x8a95('0x9')][_0x8a95('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x387db4,_0xdd54e1,_0x161f00){return new BPromise(function(_0x49287d,_0xe03b31){return client[_0x8a95('0xb')](_0x387db4,_0x161f00)[_0x8a95('0xc')](function(_0x240b22){logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));logger['debug'](_0x8a95('0x10'),_0xdd54e1,_0x8a95('0xf'),JSON['stringify'](_0x240b22));if(_0x240b22[_0x8a95('0x11')]){if(_0x240b22['error']['code']===0x1f4){logger[_0x8a95('0x11')]('CloudProvider,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0xe03b31(_0x240b22['error'][_0x8a95('0x12')]);}logger[_0x8a95('0x11')]('CloudProvider,\x20%s,\x20%s',_0xdd54e1,_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);return _0x49287d(_0x240b22[_0x8a95('0x11')][_0x8a95('0x12')]);}else{logger[_0x8a95('0xd')](_0x8a95('0xe'),_0xdd54e1,_0x8a95('0xf'));_0x49287d(_0x240b22['result'][_0x8a95('0x12')]);}})['catch'](function(_0x334b18){logger['error'](_0x8a95('0xe'),_0xdd54e1,_0x334b18);_0xe03b31(_0x334b18);});});}
\ No newline at end of file
+var _0x486e=['CloudProvider,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4754b5,_0x3b0a85){var _0x216a2d=function(_0x6f1b12){while(--_0x6f1b12){_0x4754b5['push'](_0x4754b5['shift']());}};_0x216a2d(++_0x3b0a85);}(_0x486e,0xb2));var _0xe486=function(_0x4819c1,_0x11e719){_0x4819c1=_0x4819c1-0x0;var _0x45d265=_0x486e[_0x4819c1];return _0x45d265;};'use strict';var _=require(_0xe486('0x0'));var util=require(_0xe486('0x1'));var moment=require('moment');var BPromise=require(_0xe486('0x2'));var rs=require(_0xe486('0x3'));var fs=require('fs');var Redis=require(_0xe486('0x4'));var db=require(_0xe486('0x5'))['db'];var utils=require(_0xe486('0x6'));var logger=require(_0xe486('0x7'))(_0xe486('0x8'));var config=require(_0xe486('0x9'));var jayson=require(_0xe486('0xa'));var client=jayson[_0xe486('0xb')][_0xe486('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4fac5d,_0x2d0712,_0xea849d){return new BPromise(function(_0x8a85c7,_0x2114a5){return client[_0xe486('0xd')](_0x4fac5d,_0xea849d)[_0xe486('0xe')](function(_0x42c4b3){logger[_0xe486('0xf')]('CloudProvider,\x20%s,\x20%s',_0x2d0712,'request\x20sent');logger[_0xe486('0x10')](_0xe486('0x11'),_0x2d0712,_0xe486('0x12'),JSON[_0xe486('0x13')](_0x42c4b3));if(_0x42c4b3[_0xe486('0x14')]){if(_0x42c4b3[_0xe486('0x14')][_0xe486('0x15')]===0x1f4){logger[_0xe486('0x14')](_0xe486('0x16'),_0x2d0712,_0x42c4b3['error']['message']);return _0x2114a5(_0x42c4b3[_0xe486('0x14')][_0xe486('0x17')]);}logger[_0xe486('0x14')]('CloudProvider,\x20%s,\x20%s',_0x2d0712,_0x42c4b3['error'][_0xe486('0x17')]);return _0x8a85c7(_0x42c4b3['error'][_0xe486('0x17')]);}else{logger[_0xe486('0xf')](_0xe486('0x16'),_0x2d0712,_0xe486('0x12'));_0x8a85c7(_0x42c4b3['result']['message']);}})[_0xe486('0x18')](function(_0x21fca9){logger['error'](_0xe486('0x16'),_0x2d0712,_0x21fca9);_0x2114a5(_0x21fca9);});});}
\ No newline at end of file
index b91642f..a2aa916 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb5=['update','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x178548,_0x247ed6){var _0x7fac10=function(_0x2e8045){while(--_0x2e8045){_0x178548['push'](_0x178548['shift']());}};_0x7fac10(++_0x247ed6);}(_0xbdb5,0x122));var _0x5bdb=function(_0x3411d9,_0x5b99c0){_0x3411d9=_0x3411d9-0x0;var _0x2dac66=_0xbdb5[_0x3411d9];return _0x2dac66;};'use strict';var multer=require(_0x5bdb('0x0'));var util=require(_0x5bdb('0x1'));var path=require(_0x5bdb('0x2'));var timeout=require(_0x5bdb('0x3'));var express=require('express');var router=express[_0x5bdb('0x4')]();var fs_extra=require(_0x5bdb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5bdb('0x6'));var config=require(_0x5bdb('0x7'));var controller=require('./cloudProvider.controller');router[_0x5bdb('0x8')]('/',auth[_0x5bdb('0x9')](),controller[_0x5bdb('0xa')]);router[_0x5bdb('0x8')](_0x5bdb('0xb'),auth[_0x5bdb('0x9')](),controller[_0x5bdb('0xc')]);router[_0x5bdb('0xd')]('/',auth['isAuthenticated'](),controller[_0x5bdb('0xe')]);router[_0x5bdb('0xf')](_0x5bdb('0xb'),auth['isAuthenticated'](),controller[_0x5bdb('0x10')]);router['delete'](_0x5bdb('0xb'),auth['isAuthenticated'](),controller[_0x5bdb('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xf244=['put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','index','get','show','create'];(function(_0x48d0c9,_0x5b26ac){var _0xcfaa34=function(_0x45edfc){while(--_0x45edfc){_0x48d0c9['push'](_0x48d0c9['shift']());}};_0xcfaa34(++_0x5b26ac);}(_0xf244,0xae));var _0x4f24=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xf244[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0x4f24('0x0'));var util=require(_0x4f24('0x1'));var path=require(_0x4f24('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f24('0x3'));var router=express[_0x4f24('0x4')]();var fs_extra=require(_0x4f24('0x5'));var auth=require(_0x4f24('0x6'));var interaction=require(_0x4f24('0x7'));var config=require(_0x4f24('0x8'));var controller=require(_0x4f24('0x9'));router['get']('/',auth[_0x4f24('0xa')](),controller[_0x4f24('0xb')]);router[_0x4f24('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x4f24('0xd')]);router['post']('/',auth[_0x4f24('0xa')](),controller[_0x4f24('0xe')]);router[_0x4f24('0xf')](_0x4f24('0x10'),auth[_0x4f24('0xa')](),controller[_0x4f24('0x11')]);router[_0x4f24('0x12')](_0x4f24('0x10'),auth[_0x4f24('0xa')](),controller[_0x4f24('0x13')]);module[_0x4f24('0x14')]=router;
\ No newline at end of file
index 45170a4..4c1f984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x247a=['sequelize','STRING'];(function(_0x3ad951,_0x107473){var _0x5047cf=function(_0x411460){while(--_0x411460){_0x3ad951['push'](_0x3ad951['shift']());}};_0x5047cf(++_0x107473);}(_0x247a,0x162));var _0xa247=function(_0x463697,_0xccfdc4){_0x463697=_0x463697-0x0;var _0x33cfe1=_0x247a[_0x463697];return _0x33cfe1;};'use strict';var Sequelize=require(_0xa247('0x0'));module['exports']={'name':{'type':Sequelize[_0xa247('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa247('0x1')]},'companyId':{'type':Sequelize[_0xa247('0x1')]},'website':{'type':Sequelize[_0xa247('0x1')]},'phone':{'type':Sequelize[_0xa247('0x1')]},'fax':{'type':Sequelize[_0xa247('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xa247('0x1')]},'city':{'type':Sequelize[_0xa247('0x1')]},'country':{'type':Sequelize[_0xa247('0x1')]},'email':{'type':Sequelize[_0xa247('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa247('0x1')]},'sStreet':{'type':Sequelize[_0xa247('0x1')]},'sPostalCode':{'type':Sequelize[_0xa247('0x1')]},'sCity':{'type':Sequelize[_0xa247('0x1')]},'sCountry':{'type':Sequelize[_0xa247('0x1')]},'description':{'type':Sequelize[_0xa247('0x1')]}};
\ No newline at end of file
+var _0x34c6=['STRING','name','sequelize'];(function(_0x2b51a9,_0x5b9092){var _0x2de139=function(_0x5076b3){while(--_0x5076b3){_0x2b51a9['push'](_0x2b51a9['shift']());}};_0x2de139(++_0x5b9092);}(_0x34c6,0x1cd));var _0x634c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34c6[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x634c('0x0'));module['exports']={'name':{'type':Sequelize[_0x634c('0x1')],'unique':_0x634c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x634c('0x1')]},'companyId':{'type':Sequelize[_0x634c('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x634c('0x1')]},'type':{'type':Sequelize[_0x634c('0x1')]},'street':{'type':Sequelize[_0x634c('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x634c('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x634c('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x634c('0x1')]},'sStreet':{'type':Sequelize[_0x634c('0x1')]},'sPostalCode':{'type':Sequelize[_0x634c('0x1')]},'sCity':{'type':Sequelize[_0x634c('0x1')]},'sCountry':{'type':Sequelize[_0x634c('0x1')]},'description':{'type':Sequelize[_0x634c('0x1')]}};
\ No newline at end of file
index aa028f5..2b10f81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ba=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','addContacts','CmContact','ids','omit','getContacts','findOne','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Companies','then','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find'];(function(_0x2c73c0,_0x54e3b5){var _0x593fee=function(_0x48ad81){while(--_0x48ad81){_0x2c73c0['push'](_0x2c73c0['shift']());}};_0x593fee(++_0x54e3b5);}(_0x49ba,0xc0));var _0xa49b=function(_0x308488,_0x6f7741){_0x308488=_0x308488-0x0;var _0x5451a9=_0x49ba[_0x308488];return _0x5451a9;};'use strict';var emlformat=require(_0xa49b('0x0'));var rimraf=require(_0xa49b('0x1'));var zipdir=require(_0xa49b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa49b('0x3'));var moment=require(_0xa49b('0x4'));var BPromise=require(_0xa49b('0x5'));var Mustache=require('mustache');var util=require(_0xa49b('0x6'));var path=require(_0xa49b('0x7'));var sox=require(_0xa49b('0x8'));var csv=require(_0xa49b('0x9'));var ejs=require(_0xa49b('0xa'));var fs=require('fs');var fs_extra=require(_0xa49b('0xb'));var _=require('lodash');var squel=require(_0xa49b('0xc'));var crypto=require(_0xa49b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa49b('0xe'));var Papa=require(_0xa49b('0xf'));var Redis=require(_0xa49b('0x10'));var authService=require(_0xa49b('0x11'));var qs=require(_0xa49b('0x12'));var as=require(_0xa49b('0x13'));var hardwareService=require(_0xa49b('0x14'));var logger=require(_0xa49b('0x15'))(_0xa49b('0x16'));var utils=require(_0xa49b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa49b('0x18'));var db=require(_0xa49b('0x19'))['db'];function respondWithStatusCode(_0x5bc76a,_0x5550ae){_0x5550ae=_0x5550ae||0xcc;return function(_0x2b1223){if(_0x2b1223){return _0x5bc76a[_0xa49b('0x1a')](_0x5550ae);}return _0x5bc76a['status'](_0x5550ae)[_0xa49b('0x1b')]();};}function respondWithResult(_0xc55014,_0xbcf66){_0xbcf66=_0xbcf66||0xc8;return function(_0x5d19ac){if(_0x5d19ac){return _0xc55014[_0xa49b('0x1c')](_0xbcf66)[_0xa49b('0x1d')](_0x5d19ac);}};}function respondWithFilteredResult(_0x2ba9d7,_0x4f4363){return function(_0x3bcae3){if(_0x3bcae3){var _0x3c207a=typeof _0x4f4363[_0xa49b('0x1e')]===_0xa49b('0x1f')&&typeof _0x4f4363[_0xa49b('0x20')]===_0xa49b('0x1f');var _0x1e0591=_0x3bcae3[_0xa49b('0x21')];var _0x5d1222=_0x3c207a?0x0:_0x4f4363['offset'];var _0x31bce3=_0x3c207a?_0x3bcae3[_0xa49b('0x21')]:_0x4f4363[_0xa49b('0x1e')]+_0x4f4363[_0xa49b('0x20')];var _0x1a440d;if(_0x31bce3>=_0x1e0591){_0x31bce3=_0x1e0591;_0x1a440d=0xc8;}else{_0x1a440d=0xce;}_0x2ba9d7[_0xa49b('0x1c')](_0x1a440d);return _0x2ba9d7[_0xa49b('0x22')](_0xa49b('0x23'),_0x5d1222+'-'+_0x31bce3+'/'+_0x1e0591)[_0xa49b('0x1d')](_0x3bcae3);}return null;};}function patchUpdates(_0x49a2db){return function(_0x52e356){try{jsonpatch[_0xa49b('0x24')](_0x52e356,_0x49a2db,!![]);}catch(_0x53027b){return BPromise['reject'](_0x53027b);}return _0x52e356[_0xa49b('0x25')]();};}function saveUpdates(_0x334947,_0x3cf010){return function(_0x1d3a17){if(_0x1d3a17){return _0x1d3a17[_0xa49b('0x26')](_0x334947)['then'](function(_0x5dbfba){return _0x5dbfba;});}return null;};}function removeEntity(_0x512c51,_0x3279ad){return function(_0x1ade1e){if(_0x1ade1e){return _0x1ade1e[_0xa49b('0x27')]()['then'](function(){var _0x35500b=_0x1ade1e[_0xa49b('0x28')]({'plain':!![]});var _0x4ab1f2=_0xa49b('0x29');return db['UserProfileResource'][_0xa49b('0x27')]({'where':{'type':_0x4ab1f2,'resourceId':_0x35500b['id']}})[_0xa49b('0x2a')](function(){return _0x1ade1e;});})[_0xa49b('0x2a')](function(){_0x512c51[_0xa49b('0x1c')](0xcc)[_0xa49b('0x1b')]();});}};}function handleEntityNotFound(_0x1c757a,_0x10b30d){return function(_0x2d11c4){if(!_0x2d11c4){_0x1c757a['sendStatus'](0x194);}return _0x2d11c4;};}function handleError(_0x3cab7f,_0x5c4e47){_0x5c4e47=_0x5c4e47||0x1f4;return function(_0x5bc66c){logger[_0xa49b('0x2b')](_0x5bc66c[_0xa49b('0x2c')]);if(_0x5bc66c[_0xa49b('0x2d')]){delete _0x5bc66c[_0xa49b('0x2d')];}_0x3cab7f[_0xa49b('0x1c')](_0x5c4e47)[_0xa49b('0x2e')](_0x5bc66c);};}exports[_0xa49b('0x2f')]=function(_0x3de112,_0x2051c8){var _0x46a0ee={},_0x3a6a8a={},_0x2fd5dd={'count':0x0,'rows':[]};return db[_0xa49b('0x30')][_0xa49b('0x31')]()[_0xa49b('0x2a')](function(_0x241ee5){_0x3a6a8a[_0xa49b('0x32')]=_[_0xa49b('0x33')](_0x241ee5);_0x3a6a8a[_0xa49b('0x34')]=_[_0xa49b('0x33')](_0x3de112[_0xa49b('0x34')]);_0x3a6a8a[_0xa49b('0x35')]=_[_0xa49b('0x36')](_0x3a6a8a['model'],_0x3a6a8a[_0xa49b('0x34')]);_0x46a0ee[_0xa49b('0x37')]=_[_0xa49b('0x36')](_0x3a6a8a['model'],qs[_0xa49b('0x38')](_0x3de112[_0xa49b('0x34')]['fields']));_0x46a0ee[_0xa49b('0x37')]=_0x46a0ee[_0xa49b('0x37')][_0xa49b('0x39')]?_0x46a0ee[_0xa49b('0x37')]:_0x3a6a8a[_0xa49b('0x32')];if(!_0x3de112[_0xa49b('0x34')][_0xa49b('0x3a')](_0xa49b('0x3b'))){_0x46a0ee[_0xa49b('0x20')]=qs[_0xa49b('0x20')](_0x3de112[_0xa49b('0x34')][_0xa49b('0x20')]);_0x46a0ee[_0xa49b('0x1e')]=qs[_0xa49b('0x1e')](_0x3de112['query'][_0xa49b('0x1e')]);}_0x46a0ee['order']=qs[_0xa49b('0x3c')](_0x3de112[_0xa49b('0x34')][_0xa49b('0x3c')]);_0x46a0ee[_0xa49b('0x3d')]=qs['filters'](_[_0xa49b('0x3e')](_0x3de112[_0xa49b('0x34')],_0x3a6a8a[_0xa49b('0x35')]),_0x241ee5);if(_0x3de112[_0xa49b('0x34')][_0xa49b('0x3f')]){_0x46a0ee[_0xa49b('0x3d')]=_[_0xa49b('0x40')](_0x46a0ee[_0xa49b('0x3d')],{'$or':_['map'](_0x46a0ee['attributes'],function(_0x592f43){var _0x2c7686={};_0x2c7686[_0x592f43]={'$like':'%'+_0x3de112['query'][_0xa49b('0x3f')]+'%'};return _0x2c7686;})});}_0x46a0ee=_[_0xa49b('0x40')]({},_0x46a0ee,_0x3de112[_0xa49b('0x41')]);var _0x4f078f={'where':_0x46a0ee[_0xa49b('0x3d')]};return db[_0xa49b('0x30')][_0xa49b('0x21')](_0x4f078f)[_0xa49b('0x2a')](function(_0x462536){_0x2fd5dd[_0xa49b('0x21')]=_0x462536;if(_0x3de112[_0xa49b('0x34')]['includeAll']){_0x46a0ee[_0xa49b('0x42')]=[{'all':!![]}];}return db[_0xa49b('0x30')][_0xa49b('0x43')](_0x46a0ee);})[_0xa49b('0x2a')](function(_0x3af918){_0x2fd5dd[_0xa49b('0x44')]=_0x3af918;return _0x2fd5dd;})[_0xa49b('0x2a')](respondWithFilteredResult(_0x2051c8,_0x46a0ee))[_0xa49b('0x45')](handleError(_0x2051c8,null));})[_0xa49b('0x45')](handleError(_0x2051c8,null));};exports[_0xa49b('0x46')]=function(_0x5679c0,_0x38a044){var _0x17eaa0={'raw':![],'where':{'id':_0x5679c0[_0xa49b('0x47')]['id']}},_0xc7f4df={};_0xc7f4df[_0xa49b('0x32')]=_[_0xa49b('0x33')](db['CmCompany'][_0xa49b('0x48')]);_0xc7f4df[_0xa49b('0x34')]=_[_0xa49b('0x33')](_0x5679c0['query']);_0xc7f4df[_0xa49b('0x35')]=_[_0xa49b('0x36')](_0xc7f4df[_0xa49b('0x32')],_0xc7f4df[_0xa49b('0x34')]);_0x17eaa0[_0xa49b('0x37')]=_[_0xa49b('0x36')](_0xc7f4df[_0xa49b('0x32')],qs[_0xa49b('0x38')](_0x5679c0[_0xa49b('0x34')][_0xa49b('0x38')]));_0x17eaa0[_0xa49b('0x37')]=_0x17eaa0[_0xa49b('0x37')][_0xa49b('0x39')]?_0x17eaa0[_0xa49b('0x37')]:_0xc7f4df[_0xa49b('0x32')];if(_0x5679c0[_0xa49b('0x34')][_0xa49b('0x49')]){_0x17eaa0[_0xa49b('0x42')]=[{'all':!![]}];}_0x17eaa0=_['merge']({},_0x17eaa0,_0x5679c0[_0xa49b('0x41')]);return db[_0xa49b('0x30')][_0xa49b('0x4a')](_0x17eaa0)[_0xa49b('0x2a')](handleEntityNotFound(_0x38a044,null))['then'](respondWithResult(_0x38a044,null))[_0xa49b('0x45')](handleError(_0x38a044,null));};exports[_0xa49b('0x4b')]=function(_0x39cb1a,_0x52bb8d){return db[_0xa49b('0x30')][_0xa49b('0x4b')](_0x39cb1a[_0xa49b('0x4c')],{})[_0xa49b('0x2a')](function(_0x17902e){var _0x25af1f=_0x39cb1a[_0xa49b('0x4d')]['get']({'plain':!![]});if(!_0x25af1f)throw new Error(_0xa49b('0x4e'));if(_0x25af1f['role']===_0xa49b('0x4d')){var _0x4b7e2d=_0x17902e[_0xa49b('0x28')]({'plain':!![]});var _0x448d51=_0xa49b('0x29');return db['UserProfileSection'][_0xa49b('0x4a')]({'where':{'name':_0x448d51,'userProfileId':_0x25af1f[_0xa49b('0x4f')]},'raw':!![]})[_0xa49b('0x2a')](function(_0x8e328b){if(_0x8e328b&&_0x8e328b[_0xa49b('0x50')]===0x0){return db[_0xa49b('0x51')][_0xa49b('0x4b')]({'name':_0x4b7e2d[_0xa49b('0x2d')],'resourceId':_0x4b7e2d['id'],'type':_0x8e328b[_0xa49b('0x2d')],'sectionId':_0x8e328b['id']},{})['then'](function(){return _0x17902e;});}else{return _0x17902e;}})[_0xa49b('0x45')](function(_0x278d58){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x278d58);throw _0x278d58;});}return _0x17902e;})[_0xa49b('0x2a')](respondWithResult(_0x52bb8d,0xc9))[_0xa49b('0x45')](handleError(_0x52bb8d,null));};exports[_0xa49b('0x26')]=function(_0x2a6314,_0x4632cc){if(_0x2a6314[_0xa49b('0x4c')]['id']){delete _0x2a6314['body']['id'];}return db[_0xa49b('0x30')]['find']({'where':{'id':_0x2a6314[_0xa49b('0x47')]['id']}})['then'](handleEntityNotFound(_0x4632cc,null))['then'](saveUpdates(_0x2a6314[_0xa49b('0x4c')],null))[_0xa49b('0x2a')](respondWithResult(_0x4632cc,null))[_0xa49b('0x45')](handleError(_0x4632cc,null));};exports[_0xa49b('0x27')]=function(_0x11ec0b,_0x553803){return db['CmCompany']['find']({'where':{'id':_0x11ec0b[_0xa49b('0x47')]['id']}})[_0xa49b('0x2a')](handleEntityNotFound(_0x553803,null))[_0xa49b('0x2a')](removeEntity(_0x553803,null))[_0xa49b('0x45')](handleError(_0x553803,null));};exports[_0xa49b('0x31')]=function(_0x24b8a6,_0x2b7551){return db[_0xa49b('0x30')][_0xa49b('0x31')]()[_0xa49b('0x2a')](respondWithResult(_0x2b7551,null))[_0xa49b('0x45')](handleError(_0x2b7551,null));};exports[_0xa49b('0x52')]=function(_0x5d912f,_0x31bc4f,_0x8e3f25){return db[_0xa49b('0x53')]['find']({'where':{'id':_0x5d912f[_0xa49b('0x47')]['id']}})['then'](handleEntityNotFound(_0x31bc4f,null))[_0xa49b('0x2a')](function(_0x4beadb){if(_0x4beadb){return _0x4beadb[_0xa49b('0x52')](_0x5d912f[_0xa49b('0x4c')][_0xa49b('0x54')],_[_0xa49b('0x55')](_0x5d912f[_0xa49b('0x4c')],['ids','id'])||{});}})[_0xa49b('0x2a')](respondWithResult(_0x31bc4f,null))[_0xa49b('0x45')](handleError(_0x31bc4f,null));};exports[_0xa49b('0x56')]=function(_0x3399d6,_0x26e638,_0x20614d){var _0x31bd98={};var _0x494f73={};var _0x35c4e6;var _0xb2b176;return db['CmCompany'][_0xa49b('0x57')]({'where':{'id':_0x3399d6[_0xa49b('0x47')]['id']}})[_0xa49b('0x2a')](handleEntityNotFound(_0x26e638,null))['then'](function(_0x8f9204){if(_0x8f9204){_0x35c4e6=_0x8f9204;_0x494f73[_0xa49b('0x32')]=_[_0xa49b('0x33')](db[_0xa49b('0x53')]['rawAttributes']);_0x494f73['query']=_[_0xa49b('0x33')](_0x3399d6[_0xa49b('0x34')]);_0x494f73[_0xa49b('0x35')]=_[_0xa49b('0x36')](_0x494f73[_0xa49b('0x32')],_0x494f73[_0xa49b('0x34')]);_0x31bd98['attributes']=_[_0xa49b('0x36')](_0x494f73[_0xa49b('0x32')],qs[_0xa49b('0x38')](_0x3399d6[_0xa49b('0x34')][_0xa49b('0x38')]));_0x31bd98[_0xa49b('0x37')]=_0x31bd98['attributes']['length']?_0x31bd98['attributes']:_0x494f73[_0xa49b('0x32')];_0x31bd98['order']=qs[_0xa49b('0x3c')](_0x3399d6[_0xa49b('0x34')]['sort']);_0x31bd98[_0xa49b('0x3d')]=qs[_0xa49b('0x35')](_['pick'](_0x3399d6['query'],_0x494f73[_0xa49b('0x35')]));if(_0x3399d6[_0xa49b('0x34')]['filter']){_0x31bd98[_0xa49b('0x3d')]=_[_0xa49b('0x40')](_0x31bd98[_0xa49b('0x3d')],{'$or':_[_0xa49b('0x58')](_0x31bd98[_0xa49b('0x37')],function(_0x3f2c5d){var _0x31b819={};_0x31b819[_0x3f2c5d]={'$like':'%'+_0x3399d6[_0xa49b('0x34')][_0xa49b('0x3f')]+'%'};return _0x31b819;})});}_0x31bd98=_['merge']({},_0x31bd98,_0x3399d6[_0xa49b('0x41')]);return _0x35c4e6['getContacts'](_0x31bd98);}})[_0xa49b('0x2a')](function(_0x23d26b){if(_0x23d26b){_0xb2b176=_0x23d26b['length'];if(!_0x3399d6[_0xa49b('0x34')][_0xa49b('0x3a')](_0xa49b('0x3b'))){_0x31bd98[_0xa49b('0x20')]=qs[_0xa49b('0x20')](_0x3399d6[_0xa49b('0x34')]['limit']);_0x31bd98[_0xa49b('0x1e')]=qs[_0xa49b('0x1e')](_0x3399d6[_0xa49b('0x34')][_0xa49b('0x1e')]);}return _0x35c4e6[_0xa49b('0x56')](_0x31bd98);}})[_0xa49b('0x2a')](function(_0x3eb1e9){if(_0x3eb1e9){return _0x3eb1e9?{'count':_0xb2b176,'rows':_0x3eb1e9}:null;}})['then'](respondWithResult(_0x26e638,null))['catch'](handleError(_0x26e638,null));};
\ No newline at end of file
+var _0x18b0=['filter','where','map','merge','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','addContacts','ids','omit','getContacts','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','get','Companies','UserProfileResource','then','end','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick'];(function(_0x52abc2,_0x2bb94f){var _0x209212=function(_0x176429){while(--_0x176429){_0x52abc2['push'](_0x52abc2['shift']());}};_0x209212(++_0x2bb94f);}(_0x18b0,0x72));var _0x018b=function(_0x5cc6c5,_0x2d8c9b){_0x5cc6c5=_0x5cc6c5-0x0;var _0x28f833=_0x18b0[_0x5cc6c5];return _0x28f833;};'use strict';var emlformat=require(_0x018b('0x0'));var rimraf=require(_0x018b('0x1'));var zipdir=require(_0x018b('0x2'));var jsonpatch=require(_0x018b('0x3'));var rp=require(_0x018b('0x4'));var moment=require('moment');var BPromise=require(_0x018b('0x5'));var Mustache=require('mustache');var util=require(_0x018b('0x6'));var path=require(_0x018b('0x7'));var sox=require('sox');var csv=require(_0x018b('0x8'));var ejs=require(_0x018b('0x9'));var fs=require('fs');var fs_extra=require(_0x018b('0xa'));var _=require(_0x018b('0xb'));var squel=require(_0x018b('0xc'));var crypto=require('crypto');var jsforce=require(_0x018b('0xd'));var deskjs=require(_0x018b('0xe'));var toCsv=require(_0x018b('0x8'));var querystring=require(_0x018b('0xf'));var Papa=require(_0x018b('0x10'));var Redis=require(_0x018b('0x11'));var authService=require(_0x018b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x018b('0x13'));var hardwareService=require(_0x018b('0x14'));var logger=require(_0x018b('0x15'))(_0x018b('0x16'));var utils=require('../../config/utils');var config=require(_0x018b('0x17'));var licenseUtil=require(_0x018b('0x18'));var db=require(_0x018b('0x19'))['db'];function respondWithStatusCode(_0x36de1a,_0x4ad865){_0x4ad865=_0x4ad865||0xcc;return function(_0x25ec6b){if(_0x25ec6b){return _0x36de1a[_0x018b('0x1a')](_0x4ad865);}return _0x36de1a['status'](_0x4ad865)['end']();};}function respondWithResult(_0x48c092,_0x2b6a68){_0x2b6a68=_0x2b6a68||0xc8;return function(_0x4b22d8){if(_0x4b22d8){return _0x48c092[_0x018b('0x1b')](_0x2b6a68)[_0x018b('0x1c')](_0x4b22d8);}};}function respondWithFilteredResult(_0x261763,_0x56202a){return function(_0x534844){if(_0x534844){var _0x3f939e=typeof _0x56202a[_0x018b('0x1d')]==='undefined'&&typeof _0x56202a[_0x018b('0x1e')]===_0x018b('0x1f');var _0x5906e4=_0x534844[_0x018b('0x20')];var _0x8af20d=_0x3f939e?0x0:_0x56202a['offset'];var _0x1514bd=_0x3f939e?_0x534844[_0x018b('0x20')]:_0x56202a[_0x018b('0x1d')]+_0x56202a[_0x018b('0x1e')];var _0x4921a1;if(_0x1514bd>=_0x5906e4){_0x1514bd=_0x5906e4;_0x4921a1=0xc8;}else{_0x4921a1=0xce;}_0x261763[_0x018b('0x1b')](_0x4921a1);return _0x261763[_0x018b('0x21')](_0x018b('0x22'),_0x8af20d+'-'+_0x1514bd+'/'+_0x5906e4)['json'](_0x534844);}return null;};}function patchUpdates(_0x1600e7){return function(_0x5821be){try{jsonpatch[_0x018b('0x23')](_0x5821be,_0x1600e7,!![]);}catch(_0x310cf9){return BPromise['reject'](_0x310cf9);}return _0x5821be['save']();};}function saveUpdates(_0x309bed,_0x39ed47){return function(_0x3d4842){if(_0x3d4842){return _0x3d4842[_0x018b('0x24')](_0x309bed)['then'](function(_0x1986e1){return _0x1986e1;});}return null;};}function removeEntity(_0x10283d,_0x3256d1){return function(_0x22c418){if(_0x22c418){return _0x22c418[_0x018b('0x25')]()['then'](function(){var _0x4a2f42=_0x22c418[_0x018b('0x26')]({'plain':!![]});var _0x5ccd8e=_0x018b('0x27');return db[_0x018b('0x28')][_0x018b('0x25')]({'where':{'type':_0x5ccd8e,'resourceId':_0x4a2f42['id']}})[_0x018b('0x29')](function(){return _0x22c418;});})[_0x018b('0x29')](function(){_0x10283d['status'](0xcc)[_0x018b('0x2a')]();});}};}function handleEntityNotFound(_0x2782e2,_0x2f9bc2){return function(_0x5079d5){if(!_0x5079d5){_0x2782e2[_0x018b('0x1a')](0x194);}return _0x5079d5;};}function handleError(_0x411109,_0x176354){_0x176354=_0x176354||0x1f4;return function(_0x4b916a){logger['error'](_0x4b916a[_0x018b('0x2b')]);if(_0x4b916a[_0x018b('0x2c')]){delete _0x4b916a['name'];}_0x411109[_0x018b('0x1b')](_0x176354)[_0x018b('0x2d')](_0x4b916a);};}exports[_0x018b('0x2e')]=function(_0x531365,_0xad6948){var _0x57410e={},_0x57a912={},_0x2d5343={'count':0x0,'rows':[]};return db[_0x018b('0x2f')][_0x018b('0x30')]()[_0x018b('0x29')](function(_0x9e79dc){_0x57a912[_0x018b('0x31')]=_[_0x018b('0x32')](_0x9e79dc);_0x57a912[_0x018b('0x33')]=_[_0x018b('0x32')](_0x531365['query']);_0x57a912[_0x018b('0x34')]=_[_0x018b('0x35')](_0x57a912[_0x018b('0x31')],_0x57a912['query']);_0x57410e['attributes']=_[_0x018b('0x35')](_0x57a912[_0x018b('0x31')],qs[_0x018b('0x36')](_0x531365[_0x018b('0x33')]['fields']));_0x57410e['attributes']=_0x57410e[_0x018b('0x37')][_0x018b('0x38')]?_0x57410e['attributes']:_0x57a912[_0x018b('0x31')];if(!_0x531365[_0x018b('0x33')]['hasOwnProperty']('nolimit')){_0x57410e[_0x018b('0x1e')]=qs[_0x018b('0x1e')](_0x531365[_0x018b('0x33')]['limit']);_0x57410e['offset']=qs['offset'](_0x531365['query']['offset']);}_0x57410e[_0x018b('0x39')]=qs[_0x018b('0x3a')](_0x531365[_0x018b('0x33')][_0x018b('0x3a')]);_0x57410e['where']=qs[_0x018b('0x34')](_[_0x018b('0x3b')](_0x531365[_0x018b('0x33')],_0x57a912[_0x018b('0x34')]),_0x9e79dc);if(_0x531365[_0x018b('0x33')][_0x018b('0x3c')]){_0x57410e[_0x018b('0x3d')]=_['merge'](_0x57410e['where'],{'$or':_[_0x018b('0x3e')](_0x57410e[_0x018b('0x37')],function(_0x472864){var _0x23101c={};_0x23101c[_0x472864]={'$like':'%'+_0x531365[_0x018b('0x33')][_0x018b('0x3c')]+'%'};return _0x23101c;})});}_0x57410e=_[_0x018b('0x3f')]({},_0x57410e,_0x531365['options']);var _0x32c6c8={'where':_0x57410e[_0x018b('0x3d')]};return db[_0x018b('0x2f')][_0x018b('0x20')](_0x32c6c8)['then'](function(_0x24ffea){_0x2d5343[_0x018b('0x20')]=_0x24ffea;if(_0x531365[_0x018b('0x33')][_0x018b('0x40')]){_0x57410e['include']=[{'all':!![]}];}return db[_0x018b('0x2f')][_0x018b('0x41')](_0x57410e);})[_0x018b('0x29')](function(_0x4f7ac3){_0x2d5343[_0x018b('0x42')]=_0x4f7ac3;return _0x2d5343;})[_0x018b('0x29')](respondWithFilteredResult(_0xad6948,_0x57410e))[_0x018b('0x43')](handleError(_0xad6948,null));})[_0x018b('0x43')](handleError(_0xad6948,null));};exports[_0x018b('0x44')]=function(_0x23c381,_0xf5b59a){var _0x149581={'raw':![],'where':{'id':_0x23c381['params']['id']}},_0x3587e7={};_0x3587e7['model']=_[_0x018b('0x32')](db[_0x018b('0x2f')][_0x018b('0x45')]);_0x3587e7[_0x018b('0x33')]=_[_0x018b('0x32')](_0x23c381[_0x018b('0x33')]);_0x3587e7[_0x018b('0x34')]=_[_0x018b('0x35')](_0x3587e7[_0x018b('0x31')],_0x3587e7[_0x018b('0x33')]);_0x149581[_0x018b('0x37')]=_[_0x018b('0x35')](_0x3587e7['model'],qs[_0x018b('0x36')](_0x23c381[_0x018b('0x33')][_0x018b('0x36')]));_0x149581[_0x018b('0x37')]=_0x149581['attributes']['length']?_0x149581[_0x018b('0x37')]:_0x3587e7['model'];if(_0x23c381['query'][_0x018b('0x40')]){_0x149581[_0x018b('0x46')]=[{'all':!![]}];}_0x149581=_['merge']({},_0x149581,_0x23c381[_0x018b('0x47')]);return db['CmCompany'][_0x018b('0x48')](_0x149581)[_0x018b('0x29')](handleEntityNotFound(_0xf5b59a,null))[_0x018b('0x29')](respondWithResult(_0xf5b59a,null))['catch'](handleError(_0xf5b59a,null));};exports['create']=function(_0x453e95,_0x17faba){return db[_0x018b('0x2f')][_0x018b('0x49')](_0x453e95[_0x018b('0x4a')],{})[_0x018b('0x29')](function(_0x290a4d){var _0x356d47=_0x453e95[_0x018b('0x4b')]['get']({'plain':!![]});if(!_0x356d47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x356d47['role']===_0x018b('0x4b')){var _0x407902=_0x290a4d[_0x018b('0x26')]({'plain':!![]});var _0x22b7f5=_0x018b('0x27');return db[_0x018b('0x4c')][_0x018b('0x48')]({'where':{'name':_0x22b7f5,'userProfileId':_0x356d47[_0x018b('0x4d')]},'raw':!![]})[_0x018b('0x29')](function(_0x2cd65f){if(_0x2cd65f&&_0x2cd65f['autoAssociation']===0x0){return db[_0x018b('0x28')]['create']({'name':_0x407902['name'],'resourceId':_0x407902['id'],'type':_0x2cd65f[_0x018b('0x2c')],'sectionId':_0x2cd65f['id']},{})['then'](function(){return _0x290a4d;});}else{return _0x290a4d;}})['catch'](function(_0x359207){logger[_0x018b('0x4e')](_0x018b('0x4f'),_0x359207);throw _0x359207;});}return _0x290a4d;})['then'](respondWithResult(_0x17faba,0xc9))[_0x018b('0x43')](handleError(_0x17faba,null));};exports['update']=function(_0xa520dc,_0x5e9390){if(_0xa520dc['body']['id']){delete _0xa520dc[_0x018b('0x4a')]['id'];}return db[_0x018b('0x2f')][_0x018b('0x48')]({'where':{'id':_0xa520dc[_0x018b('0x50')]['id']}})[_0x018b('0x29')](handleEntityNotFound(_0x5e9390,null))[_0x018b('0x29')](saveUpdates(_0xa520dc[_0x018b('0x4a')],null))['then'](respondWithResult(_0x5e9390,null))[_0x018b('0x43')](handleError(_0x5e9390,null));};exports['destroy']=function(_0x393a28,_0x42d70f){return db[_0x018b('0x2f')][_0x018b('0x48')]({'where':{'id':_0x393a28[_0x018b('0x50')]['id']}})[_0x018b('0x29')](handleEntityNotFound(_0x42d70f,null))[_0x018b('0x29')](removeEntity(_0x42d70f,null))[_0x018b('0x43')](handleError(_0x42d70f,null));};exports['describe']=function(_0x202db2,_0x573e54){return db[_0x018b('0x2f')]['describe']()[_0x018b('0x29')](respondWithResult(_0x573e54,null))[_0x018b('0x43')](handleError(_0x573e54,null));};exports['addContacts']=function(_0x135b04,_0x6f43d6,_0x594e19){return db[_0x018b('0x51')][_0x018b('0x48')]({'where':{'id':_0x135b04[_0x018b('0x50')]['id']}})[_0x018b('0x29')](handleEntityNotFound(_0x6f43d6,null))[_0x018b('0x29')](function(_0x4789b2){if(_0x4789b2){return _0x4789b2[_0x018b('0x52')](_0x135b04[_0x018b('0x4a')][_0x018b('0x53')],_[_0x018b('0x54')](_0x135b04['body'],['ids','id'])||{});}})[_0x018b('0x29')](respondWithResult(_0x6f43d6,null))['catch'](handleError(_0x6f43d6,null));};exports['getContacts']=function(_0xd92c96,_0xce5778,_0x43c7ee){var _0xa17b28={};var _0x333081={};var _0x59edc3;var _0x4b8dd1;return db[_0x018b('0x2f')]['findOne']({'where':{'id':_0xd92c96[_0x018b('0x50')]['id']}})[_0x018b('0x29')](handleEntityNotFound(_0xce5778,null))['then'](function(_0x40b29f){if(_0x40b29f){_0x59edc3=_0x40b29f;_0x333081[_0x018b('0x31')]=_[_0x018b('0x32')](db['CmContact'][_0x018b('0x45')]);_0x333081[_0x018b('0x33')]=_[_0x018b('0x32')](_0xd92c96['query']);_0x333081['filters']=_['intersection'](_0x333081['model'],_0x333081[_0x018b('0x33')]);_0xa17b28[_0x018b('0x37')]=_[_0x018b('0x35')](_0x333081[_0x018b('0x31')],qs[_0x018b('0x36')](_0xd92c96[_0x018b('0x33')][_0x018b('0x36')]));_0xa17b28[_0x018b('0x37')]=_0xa17b28['attributes'][_0x018b('0x38')]?_0xa17b28[_0x018b('0x37')]:_0x333081[_0x018b('0x31')];_0xa17b28[_0x018b('0x39')]=qs[_0x018b('0x3a')](_0xd92c96[_0x018b('0x33')]['sort']);_0xa17b28['where']=qs['filters'](_[_0x018b('0x3b')](_0xd92c96[_0x018b('0x33')],_0x333081['filters']));if(_0xd92c96[_0x018b('0x33')][_0x018b('0x3c')]){_0xa17b28['where']=_[_0x018b('0x3f')](_0xa17b28[_0x018b('0x3d')],{'$or':_[_0x018b('0x3e')](_0xa17b28[_0x018b('0x37')],function(_0x31f627){var _0x16c7d5={};_0x16c7d5[_0x31f627]={'$like':'%'+_0xd92c96['query'][_0x018b('0x3c')]+'%'};return _0x16c7d5;})});}_0xa17b28=_[_0x018b('0x3f')]({},_0xa17b28,_0xd92c96[_0x018b('0x47')]);return _0x59edc3[_0x018b('0x55')](_0xa17b28);}})[_0x018b('0x29')](function(_0x2ed1aa){if(_0x2ed1aa){_0x4b8dd1=_0x2ed1aa[_0x018b('0x38')];if(!_0xd92c96[_0x018b('0x33')][_0x018b('0x56')]('nolimit')){_0xa17b28[_0x018b('0x1e')]=qs[_0x018b('0x1e')](_0xd92c96[_0x018b('0x33')][_0x018b('0x1e')]);_0xa17b28[_0x018b('0x1d')]=qs[_0x018b('0x1d')](_0xd92c96[_0x018b('0x33')][_0x018b('0x1d')]);}return _0x59edc3['getContacts'](_0xa17b28);}})[_0x018b('0x29')](function(_0x365b2e){if(_0x365b2e){return _0x365b2e?{'count':_0x4b8dd1,'rows':_0x365b2e}:null;}})[_0x018b('0x29')](respondWithResult(_0xce5778,null))[_0x018b('0x43')](handleError(_0xce5778,null));};
\ No newline at end of file
index f386ff7..b808293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc546=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0xa87796,_0x2f96da){var _0x324722=function(_0x299126){while(--_0x299126){_0xa87796['push'](_0xa87796['shift']());}};_0x324722(++_0x2f96da);}(_0xc546,0x177));var _0x6c54=function(_0x1f632f,_0x30cd1b){_0x1f632f=_0x1f632f-0x0;var _0x78dd9=_0xc546[_0x1f632f];return _0x78dd9;};'use strict';var _=require(_0x6c54('0x0'));var util=require(_0x6c54('0x1'));var logger=require(_0x6c54('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c54('0x3'));var rp=require(_0x6c54('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6c54('0x5'));module[_0x6c54('0x6')]=function(_0x2b28c6,_0x13fd4e){return _0x2b28c6[_0x6c54('0x7')](_0x6c54('0x8'),attributes,{'tableName':_0x6c54('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a2b=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','../../config/logger'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4a2b,0x1d5));var _0xb4a2=function(_0x33e20e,_0x36a759){_0x33e20e=_0x33e20e-0x0;var _0x1578a6=_0x4a2b[_0x33e20e];return _0x1578a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb4a2('0x0'))(_0xb4a2('0x1'));var moment=require(_0xb4a2('0x2'));var BPromise=require(_0xb4a2('0x3'));var rp=require(_0xb4a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4a2('0x5'));var config=require(_0xb4a2('0x6'));var attributes=require(_0xb4a2('0x7'));module[_0xb4a2('0x8')]=function(_0x1a4083,_0x2a2c0b){return _0x1a4083['define'](_0xb4a2('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0651817..a4f7269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f91=['lodash','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x3f9e45,_0x2d9fde){var _0x2635bf=function(_0x485103){while(--_0x485103){_0x3f9e45['push'](_0x3f9e45['shift']());}};_0x2635bf(++_0x2d9fde);}(_0x5f91,0xa8));var _0x15f9=function(_0x2ce0cf,_0x4a995a){_0x2ce0cf=_0x2ce0cf-0x0;var _0x2ae65f=_0x5f91[_0x2ce0cf];return _0x2ae65f;};'use strict';var _=require(_0x15f9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x15f9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15f9('0x2'));var db=require(_0x15f9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x15f9('0x4'))('rpc');var config=require(_0x15f9('0x5'));var jayson=require(_0x15f9('0x6'));var client=jayson[_0x15f9('0x7')][_0x15f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x277504,_0x595cf7,_0x2732f0){return new BPromise(function(_0x5f0591,_0x44213f){return client[_0x15f9('0x9')](_0x277504,_0x2732f0)['then'](function(_0x5c9675){logger[_0x15f9('0xa')](_0x15f9('0xb'),_0x595cf7,'request\x20sent');logger[_0x15f9('0xc')](_0x15f9('0xd'),_0x595cf7,_0x15f9('0xe'),JSON[_0x15f9('0xf')](_0x5c9675));if(_0x5c9675['error']){if(_0x5c9675[_0x15f9('0x10')][_0x15f9('0x11')]===0x1f4){logger[_0x15f9('0x10')](_0x15f9('0xb'),_0x595cf7,_0x5c9675[_0x15f9('0x10')][_0x15f9('0x12')]);return _0x44213f(_0x5c9675[_0x15f9('0x10')][_0x15f9('0x12')]);}logger[_0x15f9('0x10')]('CmCompany,\x20%s,\x20%s',_0x595cf7,_0x5c9675[_0x15f9('0x10')]['message']);return _0x5f0591(_0x5c9675[_0x15f9('0x10')][_0x15f9('0x12')]);}else{logger[_0x15f9('0xa')](_0x15f9('0xb'),_0x595cf7,_0x15f9('0xe'));_0x5f0591(_0x5c9675[_0x15f9('0x13')][_0x15f9('0x12')]);}})[_0x15f9('0x14')](function(_0x1ed611){logger[_0x15f9('0x10')](_0x15f9('0xb'),_0x595cf7,_0x1ed611);_0x44213f(_0x1ed611);});});}
\ No newline at end of file
+var _0x94d6=['CmCompany,\x20%s,\x20%s','message','result','catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code'];(function(_0xf8ba57,_0x36376d){var _0x933806=function(_0x4b379f){while(--_0x4b379f){_0xf8ba57['push'](_0xf8ba57['shift']());}};_0x933806(++_0x36376d);}(_0x94d6,0x76));var _0x694d=function(_0x47688b,_0x564582){_0x47688b=_0x47688b-0x0;var _0x5cfcce=_0x94d6[_0x47688b];return _0x5cfcce;};'use strict';var _=require('lodash');var util=require(_0x694d('0x0'));var moment=require(_0x694d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x694d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x694d('0x3'));var logger=require(_0x694d('0x4'))('rpc');var config=require(_0x694d('0x5'));var jayson=require(_0x694d('0x6'));var client=jayson[_0x694d('0x7')][_0x694d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43c6bb,_0x10c38c,_0x37e94e){return new BPromise(function(_0x5c7ed6,_0x4a3b0f){return client['request'](_0x43c6bb,_0x37e94e)[_0x694d('0x9')](function(_0x305d4d){logger[_0x694d('0xa')]('CmCompany,\x20%s,\x20%s',_0x10c38c,_0x694d('0xb'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x10c38c,'request\x20sent',JSON[_0x694d('0xc')](_0x305d4d));if(_0x305d4d[_0x694d('0xd')]){if(_0x305d4d['error'][_0x694d('0xe')]===0x1f4){logger['error'](_0x694d('0xf'),_0x10c38c,_0x305d4d['error'][_0x694d('0x10')]);return _0x4a3b0f(_0x305d4d[_0x694d('0xd')][_0x694d('0x10')]);}logger[_0x694d('0xd')](_0x694d('0xf'),_0x10c38c,_0x305d4d['error'][_0x694d('0x10')]);return _0x5c7ed6(_0x305d4d[_0x694d('0xd')][_0x694d('0x10')]);}else{logger[_0x694d('0xa')](_0x694d('0xf'),_0x10c38c,_0x694d('0xb'));_0x5c7ed6(_0x305d4d[_0x694d('0x11')]['message']);}})[_0x694d('0x12')](function(_0x20d0ea){logger[_0x694d('0xd')]('CmCompany,\x20%s,\x20%s',_0x10c38c,_0x20d0ea);_0x4a3b0f(_0x20d0ea);});});}
\ No newline at end of file
index ddcb009..7099b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0x896e,0x6e));var _0xe896=function(_0x34a9d1,_0x42a7b1){_0x34a9d1=_0x34a9d1-0x0;var _0x493de9=_0x896e[_0x34a9d1];return _0x493de9;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe896('0x2')]();var fs_extra=require(_0xe896('0x3'));var auth=require(_0xe896('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe896('0x5'));var controller=require(_0xe896('0x6'));router[_0xe896('0x7')]('/',auth[_0xe896('0x8')](),controller[_0xe896('0x9')]);router[_0xe896('0x7')](_0xe896('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe896('0x7')](_0xe896('0xb'),auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0x7')](_0xe896('0xd'),auth['isAuthenticated'](),controller[_0xe896('0xe')]);router[_0xe896('0xf')]('/',auth['isAuthenticated'](),controller[_0xe896('0x10')]);router[_0xe896('0xf')]('/:id/contacts',auth[_0xe896('0x8')](),controller[_0xe896('0x11')]);router[_0xe896('0x12')]('/:id',auth[_0xe896('0x8')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0x8')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router;
\ No newline at end of file
+var _0x7a08=['/:id','show','/:id/contacts','getContacts','post','create','put','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x458078,_0x3313d0){var _0x3b7366=function(_0x491f63){while(--_0x491f63){_0x458078['push'](_0x458078['shift']());}};_0x3b7366(++_0x3313d0);}(_0x7a08,0x15f));var _0x87a0=function(_0x2252be,_0x1bceeb){_0x2252be=_0x2252be-0x0;var _0x3dd367=_0x7a08[_0x2252be];return _0x3dd367;};'use strict';var multer=require(_0x87a0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x87a0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x87a0('0x2'));var interaction=require(_0x87a0('0x3'));var config=require(_0x87a0('0x4'));var controller=require('./cmCompany.controller');router[_0x87a0('0x5')]('/',auth[_0x87a0('0x6')](),controller['index']);router['get'](_0x87a0('0x7'),auth['isAuthenticated'](),controller[_0x87a0('0x8')]);router[_0x87a0('0x5')](_0x87a0('0x9'),auth[_0x87a0('0x6')](),controller[_0x87a0('0xa')]);router['get'](_0x87a0('0xb'),auth[_0x87a0('0x6')](),controller[_0x87a0('0xc')]);router[_0x87a0('0xd')]('/',auth['isAuthenticated'](),controller[_0x87a0('0xe')]);router[_0x87a0('0xd')](_0x87a0('0xb'),auth[_0x87a0('0x6')](),controller['addContacts']);router[_0x87a0('0xf')](_0x87a0('0x9'),auth[_0x87a0('0x6')](),controller[_0x87a0('0x10')]);router[_0x87a0('0x11')]('/:id',auth[_0x87a0('0x6')](),controller[_0x87a0('0x12')]);module[_0x87a0('0x13')]=router;
\ No newline at end of file
index c8726f7..bf17daf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc2=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','DATE'];(function(_0x22d138,_0x1fc968){var _0x25d611=function(_0x574d76){while(--_0x574d76){_0x22d138['push'](_0x22d138['shift']());}};_0x25d611(++_0x1fc968);}(_0x1cc2,0xda));var _0x21cc=function(_0xb7ed0,_0x3d1de9){_0xb7ed0=_0xb7ed0-0x0;var _0x543681=_0x1cc2[_0xb7ed0];return _0x543681;};'use strict';var _=require(_0x21cc('0x0'));var Sequelize=require(_0x21cc('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x21cc('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x21cc('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x21cc('0x2')]},'city':{'type':Sequelize[_0x21cc('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x21cc('0x2')]},'description':{'type':Sequelize[_0x21cc('0x3')]},'phone':{'type':Sequelize[_0x21cc('0x2')]},'mobile':{'type':Sequelize[_0x21cc('0x2')]},'fax':{'type':Sequelize[_0x21cc('0x2')]},'email':{'type':Sequelize[_0x21cc('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x21cc('0x2')]},'fb_data':{'type':Sequelize[_0x21cc('0x2')]},'twitter':{'type':Sequelize[_0x21cc('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x21cc('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x21cc('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x21cc('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x21cc('0x5')],'defaultValue':Sequelize[_0x21cc('0x6')]}};
\ No newline at end of file
+var _0x09a8=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x2d90cc,_0x45bb4e){var _0x227a99=function(_0x3bab2c){while(--_0x3bab2c){_0x2d90cc['push'](_0x2d90cc['shift']());}};_0x227a99(++_0x45bb4e);}(_0x09a8,0x81));var _0x809a=function(_0x213f2c,_0x2e7438){_0x213f2c=_0x213f2c-0x0;var _0x1527de=_0x09a8[_0x213f2c];return _0x1527de;};'use strict';var _=require(_0x809a('0x0'));var Sequelize=require(_0x809a('0x1'));module[_0x809a('0x2')]={'firstName':{'type':Sequelize[_0x809a('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x809a('0x3')]},'street':{'type':Sequelize[_0x809a('0x3')]},'postalCode':{'type':Sequelize[_0x809a('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x809a('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x809a('0x4')]},'phone':{'type':Sequelize[_0x809a('0x3')]},'mobile':{'type':Sequelize[_0x809a('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x809a('0x3')]},'url':{'type':Sequelize[_0x809a('0x3')]},'facebook':{'type':Sequelize[_0x809a('0x3')]},'fb_data':{'type':Sequelize[_0x809a('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x809a('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x809a('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x809a('0x3')]},'UserId':{'type':Sequelize[_0x809a('0x5')]},'priority':{'type':Sequelize[_0x809a('0x5')](0x2)[_0x809a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x809a('0x7')],'defaultValue':Sequelize[_0x809a('0x8')]}};
\ No newline at end of file
index ba5a928..e520d55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe49=['-createdAt','resolve','channel','includes','Invalid\x20channel','toLowerCase','parse','range','isValid','Invalid\x20createdAt\x20filter','uniqueid','callerid','starttime','endtime','note','createdAt','userDisposition','UserId','fullname','findAndCountAll','Website','Account','closedAt','key','browserName','customerIp','customerPort','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','externalUrl','threadId','Owner','flatten','reverse','slice','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','end','status','json','limit','undefined','offset','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','CmContact','describe','keys','length','push','CmCustomField','findOne','trimStart','all','cf_','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','sqlOperator','conditions','find','Tag','value','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','forEach','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','user','agent','some','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','c.firstName','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','startsWith','displayName','findAll','columnName','alias','custom','values','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','duplicates','spread','show','$and','cf_%d','omit','format','cm_contacts','setFields','toParam','getTags','rawAttributes','options','getHoppers','CmHopper','pick','includeAll','include','getHopperHistories','ContactId','CmHopperFinal','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','upload','createReadStream','meta','import','binding','phone','firstName','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','voice'];(function(_0x10cc81,_0x172700){var _0x3bbe1e=function(_0x319ed2){while(--_0x319ed2){_0x10cc81['push'](_0x10cc81['shift']());}};_0x3bbe1e(++_0x172700);}(_0xfe49,0x148));var _0x9fe4=function(_0x1bbc2d,_0x4bc3fa){_0x1bbc2d=_0x1bbc2d-0x0;var _0x3b395b=_0xfe49[_0x1bbc2d];return _0x3b395b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fe4('0x0'));var zipdir=require(_0x9fe4('0x1'));var jsonpatch=require(_0x9fe4('0x2'));var rp=require(_0x9fe4('0x3'));var moment=require(_0x9fe4('0x4'));var BPromise=require(_0x9fe4('0x5'));var Mustache=require('mustache');var util=require(_0x9fe4('0x6'));var path=require(_0x9fe4('0x7'));var sox=require(_0x9fe4('0x8'));var csv=require(_0x9fe4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fe4('0xa'));var squel=require(_0x9fe4('0xb'));var crypto=require(_0x9fe4('0xc'));var jsforce=require(_0x9fe4('0xd'));var deskjs=require(_0x9fe4('0xe'));var toCsv=require(_0x9fe4('0x9'));var querystring=require('querystring');var Papa=require(_0x9fe4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9fe4('0x10'));var as=require(_0x9fe4('0x11'));var hardwareService=require(_0x9fe4('0x12'));var logger=require(_0x9fe4('0x13'))(_0x9fe4('0x14'));var utils=require(_0x9fe4('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9fe4('0x16'))['db'];config['redis']=_[_0x9fe4('0x17')](config[_0x9fe4('0x18')],{'host':_0x9fe4('0x19'),'port':0x18eb});var socket=require(_0x9fe4('0x1a'))(new Redis(config[_0x9fe4('0x18')]));require(_0x9fe4('0x1b'))[_0x9fe4('0x1c')](socket);function respondWithStatusCode(_0x3fd21a,_0x37c190){_0x37c190=_0x37c190||0xcc;return function(_0x9f8027){if(_0x9f8027){return _0x3fd21a[_0x9fe4('0x1d')](_0x37c190);}return _0x3fd21a['status'](_0x37c190)[_0x9fe4('0x1e')]();};}function respondWithResult(_0x132d85,_0x516aff){_0x516aff=_0x516aff||0xc8;return function(_0x2d2978){if(_0x2d2978){return _0x132d85[_0x9fe4('0x1f')](_0x516aff)[_0x9fe4('0x20')](_0x2d2978);}};}function respondWithFilteredResult(_0x2eae5d,_0x3a7d12){return function(_0x50ec9e){if(_0x50ec9e){var _0x8098e4=typeof _0x3a7d12['offset']==='undefined'&&typeof _0x3a7d12[_0x9fe4('0x21')]===_0x9fe4('0x22');var _0x748b8=_0x50ec9e['count'];var _0x2fa1bb=_0x8098e4?0x0:_0x3a7d12[_0x9fe4('0x23')];var _0x4ee56b=_0x8098e4?_0x50ec9e[_0x9fe4('0x24')]:_0x3a7d12['offset']+_0x3a7d12[_0x9fe4('0x21')];var _0x23e9fd;if(_0x4ee56b>=_0x748b8){_0x4ee56b=_0x748b8;_0x23e9fd=0xc8;}else{_0x23e9fd=0xce;}_0x2eae5d[_0x9fe4('0x1f')](_0x23e9fd);return _0x2eae5d[_0x9fe4('0x25')](_0x9fe4('0x26'),_0x2fa1bb+'-'+_0x4ee56b+'/'+_0x748b8)['json'](_0x50ec9e);}return null;};}function patchUpdates(_0x45a9cd){return function(_0x3c247d){try{jsonpatch['apply'](_0x3c247d,_0x45a9cd,!![]);}catch(_0xc03da0){return BPromise[_0x9fe4('0x27')](_0xc03da0);}return _0x3c247d['save']();};}function saveUpdates(_0x11e0f5,_0x3ea8cc){return function(_0x295664){if(_0x295664){return _0x295664[_0x9fe4('0x28')](_0x11e0f5)[_0x9fe4('0x29')](function(_0x5bffda){return _0x5bffda;});}return null;};}function removeEntity(_0x574daf,_0x55bae1){return function(_0xf77905){if(_0xf77905){return _0xf77905[_0x9fe4('0x2a')]()[_0x9fe4('0x29')](function(){_0x574daf[_0x9fe4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2892ef,_0x1fc5f5){return function(_0x4547c3){if(!_0x4547c3){_0x2892ef[_0x9fe4('0x1d')](0x194);}return _0x4547c3;};}function handleError(_0x169797,_0x32ef2b){_0x32ef2b=_0x32ef2b||0x1f4;return function(_0x4bc08c){logger[_0x9fe4('0x2b')](_0x4bc08c[_0x9fe4('0x2c')]);if(_0x4bc08c['name']){delete _0x4bc08c[_0x9fe4('0x2d')];}_0x169797['status'](_0x32ef2b)[_0x9fe4('0x2e')](_0x4bc08c);};}exports[_0x9fe4('0x2f')]=function(_0x5a9bcc,_0x584ef3){var _0x88f00b={},_0x120ec6={},_0x192142={'count':0x0,'rows':[]};return db[_0x9fe4('0x30')][_0x9fe4('0x31')]()['then'](function(_0x121f8d){var _0x6d66a4=[];for(var _0xb75e8=0x0;_0xb75e8<Object[_0x9fe4('0x32')](_0x121f8d)[_0x9fe4('0x33')];_0xb75e8++){var _0x132faa=Object[_0x9fe4('0x32')](_0x121f8d)[_0xb75e8];if(_['startsWith'](_0x132faa,'cf_')){_0x6d66a4[_0x9fe4('0x34')](db[_0x9fe4('0x35')][_0x9fe4('0x36')]({'where':{'id':_[_0x9fe4('0x37')](_0x132faa,'cf_')},'raw':!![]}));}}return BPromise[_0x9fe4('0x38')](_0x6d66a4)[_0x9fe4('0x29')](function(_0x3ba4fd){for(var _0x1d7cc2=0x0;_0x1d7cc2<_0x3ba4fd['length'];_0x1d7cc2++){if(_0x3ba4fd[_0x1d7cc2]){var _0x2166bd=_0x9fe4('0x39')+_0x3ba4fd[_0x1d7cc2]['id'];var _0x2f52b0=_0x121f8d[_0x2166bd];_0x2f52b0[_0x9fe4('0x3a')]=_0x3ba4fd[_0x1d7cc2][_0x9fe4('0x3b')];}}return _0x121f8d;});})[_0x9fe4('0x29')](function(_0x4784bc){_0x120ec6[_0x9fe4('0x3c')]=_[_0x9fe4('0x32')](_0x4784bc);_0x120ec6[_0x9fe4('0x3d')]=_[_0x9fe4('0x32')](_0x5a9bcc[_0x9fe4('0x3d')]);_0x120ec6[_0x9fe4('0x3e')]=_[_0x9fe4('0x3f')](_0x120ec6[_0x9fe4('0x3c')],_0x120ec6[_0x9fe4('0x3d')]);_0x88f00b[_0x9fe4('0x40')]=_[_0x9fe4('0x3f')](_0x120ec6[_0x9fe4('0x3c')],qs[_0x9fe4('0x41')](_0x5a9bcc[_0x9fe4('0x3d')]['fields']));_0x88f00b[_0x9fe4('0x40')]=_0x88f00b['attributes']['length']?_0x88f00b['attributes']:_0x120ec6[_0x9fe4('0x3c')];if(!_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x42')](_0x9fe4('0x43'))){_0x88f00b['limit']=qs[_0x9fe4('0x21')](_0x5a9bcc[_0x9fe4('0x3d')]['limit']);_0x88f00b['offset']=qs['offset'](_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x23')]);}_0x88f00b[_0x9fe4('0x44')]=qs[_0x9fe4('0x45')](_0x5a9bcc['query'][_0x9fe4('0x45')]);_0x88f00b[_0x9fe4('0x46')]=qs[_0x9fe4('0x3e')](_['pick'](_0x5a9bcc[_0x9fe4('0x3d')],_0x120ec6[_0x9fe4('0x3e')]),_0x4784bc);var _0x10a35e=[];var _0x2a4b60=squel[_0x9fe4('0x47')]()[_0x9fe4('0x48')]('id')[_0x9fe4('0x48')](_0x9fe4('0x2d'))[_0x9fe4('0x48')](_0x9fe4('0x49'))[_0x9fe4('0x4a')]('tools_tags');var _0x30434f=squel[_0x9fe4('0x47')]()[_0x9fe4('0x4a')]('cm_contacts','c')[_0x9fe4('0x4b')](_0x9fe4('0x4c'),'uc',_0x9fe4('0x4d'))[_0x9fe4('0x4b')](_0x9fe4('0x4e'),'ct',_0x9fe4('0x4f'))[_0x9fe4('0x4b')](_0x9fe4('0x50'),'t',_0x9fe4('0x51'))[_0x9fe4('0x46')](_0x9fe4('0x52'));var _0x1f761c=squel['expr']();var _0x4c807f=[];var _0x2bb796=squel[_0x9fe4('0x53')]();var _0x205ec6;if(_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x54')]){_0x205ec6=as['parseSearch'](_0x5a9bcc[_0x9fe4('0x3d')]['search']);var _0x131550=_0x205ec6[_0x9fe4('0x55')];for(var _0x201ce6=0x0;_0x201ce6<_0x205ec6['conditions']['length'];_0x201ce6++){var _0x523ab7=_0x205ec6[_0x9fe4('0x56')][_0x201ce6];var _0x2bd065='c';var _0x28d274=_(_0x4784bc)[_0x9fe4('0x32')]()[_0x9fe4('0x57')](function(_0x53d268){return _0x53d268===_0x523ab7['field'];});if(_0x28d274)_0x28d274=_0x4784bc[_0x523ab7['field']];if(!_0x28d274){if(_0x523ab7[_0x9fe4('0x48')]===_0x9fe4('0x58')){var _0x2096db=_0x523ab7[_0x9fe4('0x59')]['split'](',')[_0x9fe4('0x5a')](function(_0x3c776e){return Number(_0x3c776e);});_0x2096db['forEach'](function(_0x56d773){_0x2bb796['or'](_0x9fe4('0x5b'),'%,'+_0x56d773+',%');});_0x4c807f=_['union'](_0x4c807f,_0x2096db);}else if(_0x523ab7['field']===_0x9fe4('0x5c')){_0x1f761c[_0x9fe4('0x5d')](_0x9fe4('0x5e'),_0x523ab7[_0x9fe4('0x59')]);}}else{if(_0x523ab7[_0x9fe4('0x48')]===_0x9fe4('0x5f')||_0x28d274[_0x9fe4('0x3a')]===_0x9fe4('0x60'))_0x523ab7[_0x9fe4('0x61')]=_0x9fe4('0x62');var _0x2bcfb4=as[_0x9fe4('0x63')](_0x2bd065,_0x28d274['type'],_0x523ab7);_0x1f761c[_0x131550](_0x2bcfb4[_0x9fe4('0x64')],_0x2bcfb4[_0x9fe4('0x59')][_0x9fe4('0x65')],_0x2bcfb4['value'][_0x9fe4('0x1e')]);}}}else{var _0x330fc9=_(Object['keys'](_0x5a9bcc['query']))[_0x9fe4('0x5a')](function(_0x27107b){return _0x4784bc[_0x9fe4('0x42')](_0x27107b)?_0x27107b:undefined;})[_0x9fe4('0x66')](function(_0x5da7fb){return!_[_0x9fe4('0x67')](_0x5da7fb);})[_0x9fe4('0x59')]();if(_0x5a9bcc['query']['Contact'])_0x330fc9[_0x9fe4('0x34')](_0x9fe4('0x68'));if(!_[_0x9fe4('0x69')](_0x330fc9)){_0x330fc9['forEach'](function(_0x232ab8){if(_0x232ab8===_0x9fe4('0x6a')){_0x30434f[_0x9fe4('0x46')](_0x9fe4('0x6b'),[]['concat'](_0x5a9bcc[_0x9fe4('0x3d')][_0x232ab8]));}else if(_0x232ab8===_0x9fe4('0x68')){var _0x1b7eec='%'+_0x5a9bcc[_0x9fe4('0x3d')][_0x232ab8]+'%';_0x30434f[_0x9fe4('0x46')](_0x9fe4('0x6c'),_0x1b7eec);}else{_0x30434f[_0x9fe4('0x46')]('c.'+_0x232ab8+_0x9fe4('0x6d'),_0x5a9bcc[_0x9fe4('0x3d')][_0x232ab8]);}});}if(_0x5a9bcc['query']['tag']){_0x4c807f=_[_0x9fe4('0x6e')](_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x6f')])?_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x6f')]:new Array(_0x5a9bcc[_0x9fe4('0x3d')]['tag']);_0x4c807f[_0x9fe4('0x70')](function(_0x2b57fd){_0x2bb796['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b57fd+',%');});}if(_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x66')]){var _0x566ad4=_0x5a9bcc['query'][_0x9fe4('0x66')][_0x9fe4('0x71')]('\x5c','\x5c\x5c')[_0x9fe4('0x71')](/'/g,'\x27\x27');if(_0x566ad4[_0x9fe4('0x72')]('\x20')['length']>0x1){_0x1f761c['or'](_0x9fe4('0x73'),qs[_0x9fe4('0x74')](_0x566ad4),null);}else{if(qs[_0x9fe4('0x75')](_0x566ad4)){_0x1f761c['or'](_0x9fe4('0x76'),_0x566ad4+'%');_0x1f761c['or'](_0x9fe4('0x77'),_0x566ad4+'%');_0x1f761c['or']('c.mobile\x20LIKE\x20?',_0x566ad4+'%');_0x1f761c['or'](_0x9fe4('0x78'),_0x566ad4+'%');}else if(qs['isEmail'](_0x566ad4)){_0x1f761c['or']('c.email\x20LIKE\x20?',_0x566ad4+'%');}else{_0x1f761c['or'](_0x9fe4('0x79'),'%'+_0x566ad4+'%');_0x1f761c['or']('c.lastName\x20LIKE\x20?','%'+_0x566ad4+'%');_0x1f761c['or']('c.email\x20LIKE\x20?','%'+_0x566ad4+'%');}}}}_0x30434f['where'](_0x1f761c);_0x30434f['group'](_0x9fe4('0x7a'));var _0x4fc80c={'type':db[_0x9fe4('0x7b')][_0x9fe4('0x7c')][_0x9fe4('0x7d')],'raw':!![]};var _0x449987=_0x30434f[_0x9fe4('0x7e')]()[_0x9fe4('0x48')](_0x9fe4('0x7a'));if(_0x88f00b[_0x9fe4('0x44')]){_0x88f00b[_0x9fe4('0x44')][_0x9fe4('0x70')](function(_0x42d5e1){_0x30434f[_0x9fe4('0x44')]('c.'+_0x42d5e1[0x0],_0x42d5e1[0x1]===_0x9fe4('0x7f')?![]:!![]);});}if(!_[_0x9fe4('0x69')](_0x4c807f)){_0x30434f[_0x9fe4('0x80')](_0x2bb796);_0x449987[_0x9fe4('0x46')](_0x9fe4('0x81'),_0x4c807f);}BPromise['resolve']()[_0x9fe4('0x29')](function(){if(!_0x205ec6)return;if(_0x5a9bcc[_0x9fe4('0x82')]['role']!==_0x9fe4('0x83'))return;if(!_[_0x9fe4('0x84')](_0x205ec6[_0x9fe4('0x56')],[_0x9fe4('0x48'),_0x9fe4('0x5c')])){return _0x5a9bcc[_0x9fe4('0x82')][_0x9fe4('0x85')]({'attributes':['id'],'raw':!![]})[_0x9fe4('0x29')](function(_0x50156a){if(_[_0x9fe4('0x69')](_0x50156a)){_0x449987[_0x9fe4('0x46')](_0x9fe4('0x86'));_0x30434f[_0x9fe4('0x46')](_0x9fe4('0x86'));}else{_0x449987[_0x9fe4('0x46')](_0x9fe4('0x6b'),_['map'](_0x50156a,'id'));_0x30434f[_0x9fe4('0x46')]('c.ListId\x20IN\x20?',_[_0x9fe4('0x5a')](_0x50156a,'id'));}});}})[_0x9fe4('0x29')](function(){if(_0x5a9bcc['user'][_0x9fe4('0x87')]===_0x9fe4('0x83')&&!_0x205ec6&&!_0x5a9bcc[_0x9fe4('0x3d')][_0x9fe4('0x6a')])return[];return db[_0x9fe4('0x88')][_0x9fe4('0x3d')](_0x449987['toString'](),_0x4fc80c);})[_0x9fe4('0x29')](function(_0x4a6ac1){_0x192142[_0x9fe4('0x24')]=_0x4a6ac1[_0x9fe4('0x33')];if(_0x192142[_0x9fe4('0x24')]===0x0)return[];return db['sequelize'][_0x9fe4('0x3d')](_0x2a4b60[_0x9fe4('0x89')](),_0x4fc80c)[_0x9fe4('0x29')](function(_0x153ebc){_0x10a35e=_[_0x9fe4('0x8a')](_0x153ebc,'id');_0x4fc80c=_[_0x9fe4('0x8b')](_0x4fc80c,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a9bcc['query'][_0x9fe4('0x41')]){_0x88f00b[_0x9fe4('0x40')][_0x9fe4('0x70')](function(_0x667ebf){_0x30434f['field']('c.'+_0x667ebf);});}else{_0x30434f[_0x9fe4('0x48')]('c.id');_0x30434f[_0x9fe4('0x48')](_0x9fe4('0x8c'));_0x30434f[_0x9fe4('0x48')]('c.lastName');_0x30434f[_0x9fe4('0x48')]('c.phone');_0x30434f[_0x9fe4('0x48')]('c.mobile');_0x30434f['field']('c.fax');_0x30434f['field'](_0x9fe4('0x8d'));_0x30434f[_0x9fe4('0x48')](_0x9fe4('0x8e'));_0x30434f['field'](_0x9fe4('0x8f'));_0x30434f[_0x9fe4('0x48')](_0x9fe4('0x90'));_0x30434f[_0x9fe4('0x48')](_0x9fe4('0x91'));_0x30434f['field'](_0x9fe4('0x92'),_0x9fe4('0x93'));}if(_0x88f00b[_0x9fe4('0x21')])_0x30434f[_0x9fe4('0x21')](_0x88f00b['limit']);if(_0x88f00b[_0x9fe4('0x23')])_0x30434f['offset'](_0x88f00b[_0x9fe4('0x23')]);return db[_0x9fe4('0x88')][_0x9fe4('0x3d')](_0x30434f[_0x9fe4('0x89')](),_0x4fc80c);});})[_0x9fe4('0x29')](function(_0x337315){_0x337315[_0x9fe4('0x70')](function(_0x55026e){if(_0x55026e[_0x9fe4('0x93')]){_0x55026e[_0x9fe4('0x94')]=[];_0x55026e[_0x9fe4('0x93')][_0x9fe4('0x72')](',')[_0x9fe4('0x70')](function(_0x11e9e1){_0x55026e[_0x9fe4('0x94')][_0x9fe4('0x34')](_0x10a35e[_0x11e9e1]);});}delete _0x55026e[_0x9fe4('0x93')];});_0x192142[_0x9fe4('0x95')]=_0x337315;return _0x192142;})[_0x9fe4('0x29')](respondWithFilteredResult(_0x584ef3,_0x88f00b));})[_0x9fe4('0x96')](handleError(_0x584ef3,null));};exports[_0x9fe4('0x2a')]=function(_0x3f4405,_0x338d02){return db[_0x9fe4('0x30')][_0x9fe4('0x57')]({'where':{'id':_0x3f4405[_0x9fe4('0x97')]['id']}})['then'](handleEntityNotFound(_0x338d02,null))[_0x9fe4('0x29')](removeEntity(_0x338d02,null))[_0x9fe4('0x96')](handleError(_0x338d02,null));};exports[_0x9fe4('0x31')]=function(_0x3346c3,_0x1f47a8){return db[_0x9fe4('0x30')][_0x9fe4('0x31')]()['then'](function(_0x131ad3){delete _0x131ad3['tags'];for(var _0x66e959=0x0;_0x66e959<Object[_0x9fe4('0x32')](_0x131ad3)[_0x9fe4('0x33')];_0x66e959++){var _0x39c79d=Object[_0x9fe4('0x32')](_0x131ad3)[_0x66e959];if(!_[_0x9fe4('0x98')](_0x39c79d,_0x9fe4('0x39'))){_0x131ad3[_0x39c79d]['columnName']=_0x39c79d;_0x131ad3[_0x39c79d][_0x9fe4('0x99')]=_0x39c79d;}}return _0x131ad3;})[_0x9fe4('0x29')](function(_0x10e662){var _0x1d6c7c={'where':{'$or':[{'ListId':_0x3346c3[_0x9fe4('0x3d')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x9fe4('0x35')][_0x9fe4('0x9a')](_0x1d6c7c)[_0x9fe4('0x29')](function(_0x583b11){for(var _0x2875e7=0x0;_0x2875e7<_0x583b11[_0x9fe4('0x33')];_0x2875e7++){var _0x3dd469=_0x9fe4('0x39')+_0x583b11[_0x2875e7]['id'];_0x10e662[_0x3dd469][_0x9fe4('0x9b')]=_0x3dd469;_0x10e662[_0x3dd469][_0x9fe4('0x99')]=_0x583b11[_0x2875e7][_0x9fe4('0x9c')];_0x10e662[_0x3dd469][_0x9fe4('0x9d')]={'type':_0x583b11[_0x2875e7][_0x9fe4('0x3b')],'values':_0x583b11[_0x2875e7][_0x9fe4('0x9e')]};}Object[_0x9fe4('0x32')](_0x10e662)[_0x9fe4('0x70')](function(_0x48ea06){if(!_0x10e662[_0x48ea06]['hasOwnProperty'](_0x9fe4('0x9b'))){delete _0x10e662[_0x48ea06];}});return _0x10e662;});})[_0x9fe4('0x29')](respondWithResult(_0x1f47a8,null))[_0x9fe4('0x96')](handleError(_0x1f47a8,null));};exports[_0x9fe4('0x8b')]=function(_0x3f1dbd,_0x52e8df){var _0x11cc1b;var _0x501348;var _0x24557b;if(_0x3f1dbd[_0x9fe4('0x9f')]['id']){delete _0x3f1dbd['body']['id'];}return db[_0x9fe4('0x30')][_0x9fe4('0x9a')]({'where':{'id':[_0x3f1dbd[_0x9fe4('0x9f')]['to'],_0x3f1dbd[_0x9fe4('0x9f')][_0x9fe4('0x4a')]]}})[_0x9fe4('0x29')](function(_0x3fe7a0){if(_0x3fe7a0){if(_0x3fe7a0[_0x9fe4('0x33')]!==0x2){return null;}_0x3fe7a0[0x0]=_0x3fe7a0[0x0]['get']({'plain':!![]});_0x3fe7a0[0x1]=_0x3fe7a0[0x1][_0x9fe4('0xa0')]({'plain':!![]});delete _0x3fe7a0[0x0]['id'];delete _0x3fe7a0[0x1]['id'];return _[_0x9fe4('0xa1')](_0x3fe7a0[0x0],_0x3fe7a0[0x1],function(_0x5e02f6,_0x240bed){if(Array[_0x9fe4('0x6e')](_0x240bed)&&!_0x240bed['length']){return _0x5e02f6;}else if(!_0x240bed){return _0x5e02f6;}});}})[_0x9fe4('0x29')](handleEntityNotFound(_0x52e8df,null))[_0x9fe4('0x29')](function(_0x2f1326){if(_0x2f1326){if(_0x2f1326[_0x9fe4('0xa2')]&&_[_0x9fe4('0x6e')](_0x2f1326['tags'])){_0x2f1326[_0x9fe4('0xa2')]=_0x2f1326[_0x9fe4('0xa2')][_0x9fe4('0xa3')]();}logger[_0x9fe4('0xa4')](_0x9fe4('0xa5'),_0x3f1dbd[_0x9fe4('0x9f')]['to'],_0x3f1dbd[_0x9fe4('0x9f')]['from']);return db['CmHopper'][_0x9fe4('0x2a')]({'where':{'ContactId':[_0x3f1dbd[_0x9fe4('0x9f')]['to'],_0x3f1dbd[_0x9fe4('0x9f')]['from']]}})['then'](function(_0x5a476d){logger[_0x9fe4('0xa4')](_0x9fe4('0xa6'),_0x5a476d);return db[_0x9fe4('0xa7')][_0x9fe4('0x2a')]({'where':{'ContactId':[_0x3f1dbd[_0x9fe4('0x9f')]['to'],_0x3f1dbd[_0x9fe4('0x9f')][_0x9fe4('0x4a')]]}})[_0x9fe4('0x29')](function(_0x417786){logger[_0x9fe4('0xa4')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x417786);return db[_0x9fe4('0x30')][_0x9fe4('0xa8')](_0x2f1326);});});}})[_0x9fe4('0x29')](function(_0x34f6fd){if(_0x34f6fd){_0x11cc1b=_0x34f6fd;_0x501348={'ContactId':_0x11cc1b['id']};_0x24557b={'where':{'ContactId':[_0x3f1dbd[_0x9fe4('0x9f')]['to'],_0x3f1dbd['body']['from']]}};return db[_0x9fe4('0xa9')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xaa')]['update'](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xab')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xac')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xad')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xac')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xad')]['update'](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xae')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db['SmsMessage'][_0x9fe4('0x28')](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xaf')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xb0')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xb1')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xb2')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db['CmHopperFinal'][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xb3')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xb4')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xb5')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xb6')]['update'](_0x501348,_0x24557b);}})['then'](function(){if(_0x11cc1b){return db[_0x9fe4('0xb7')]['update'](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xb8')]['update'](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db['OpenchannelQueueReport'][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xb9')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xba')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db['WhatsappInteraction'][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xbb')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0xbc')][_0x9fe4('0x28')](_0x501348,_0x24557b);}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return db[_0x9fe4('0x30')][_0x9fe4('0x2a')]({'where':{'id':[_0x3f1dbd[_0x9fe4('0x9f')]['to'],_0x3f1dbd[_0x9fe4('0x9f')][_0x9fe4('0x4a')]]}});}})[_0x9fe4('0x29')](function(){if(_0x11cc1b){return _0x11cc1b;}})[_0x9fe4('0x29')](respondWithResult(_0x52e8df,null))['catch'](handleError(_0x52e8df,null));};exports['create']=function(_0x492702,_0x5c4026){return db[_0x9fe4('0x30')][_0x9fe4('0x31')]()[_0x9fe4('0x29')](function(_0x4322de){if(_0x492702[_0x9fe4('0x9f')][_0x9fe4('0xa2')]&&_[_0x9fe4('0x6e')](_0x492702['body'][_0x9fe4('0xa2')])){if(_0x492702[_0x9fe4('0x9f')]['tags']['length']){_0x492702[_0x9fe4('0x9f')][_0x9fe4('0xa2')]=_0x492702[_0x9fe4('0x9f')][_0x9fe4('0xa2')][_0x9fe4('0xa3')](';')+';';}else{_0x492702['body']['tags']=null;}}else{_0x492702['body'][_0x9fe4('0xa2')]=null;}return db[_0x9fe4('0x30')][_0x9fe4('0xa8')](_0x492702[_0x9fe4('0x9f')],{'fields':_['keys'](_0x4322de),'raw':!![]});})[_0x9fe4('0x29')](respondWithResult(_0x5c4026,0xc9))[_0x9fe4('0x96')](handleError(_0x5c4026,null));};exports['bulkCreate']=function(_0x1427dc,_0x1c506d){var _0x3bd226=[];var _0x44ebbc=0x0;var _0x9e5412=0x0;var _0x463a82=0x0;return db['CmContact']['describe']()['then'](function(_0x565b9f){return BPromise['each'](_0x1427dc[_0x9fe4('0x9f')],function(_0x567ce8){var _0x1572d3={'where':{'$or':[]},'defaults':_0x567ce8,'fields':_[_0x9fe4('0x32')](_0x565b9f),'raw':!![]};if(_0x567ce8[_0x9fe4('0xbd')]){for(var _0x25060d=0x0;_0x25060d<_0x567ce8['duplicates'][_0x9fe4('0x33')];_0x25060d++){var _0x43dd8c={};_0x43dd8c[_0x567ce8[_0x9fe4('0xbd')][_0x25060d]]=_0x567ce8[_0x567ce8[_0x9fe4('0xbd')][_0x25060d]];_0x1572d3[_0x9fe4('0x46')]['$or'][_0x9fe4('0x34')](_0x43dd8c);}_0x1572d3[_0x9fe4('0x46')][_0x9fe4('0x6a')]=_0x567ce8[_0x9fe4('0x6a')];}return db[_0x9fe4('0x30')]['findOrCreate'](_0x1572d3)[_0x9fe4('0xbe')](function(_0x16b20f,_0x52c7b6){if(_0x52c7b6){_0x44ebbc++;}else{_0x463a82++;}})[_0x9fe4('0x96')](function(_0x32013e){console[_0x9fe4('0x2b')](_0x32013e);_0x9e5412++;});});})[_0x9fe4('0x29')](function(_0x45e5c1){if(_0x45e5c1){return{'success':_0x44ebbc,'failure':_0x9e5412,'duplicates':_0x463a82};}})[_0x9fe4('0x29')](respondWithResult(_0x1c506d,0xc9))[_0x9fe4('0x96')](handleError(_0x1c506d,null));};exports[_0x9fe4('0xbf')]=function(_0x208f26,_0x69db07,_0x4eb8d6){var _0x5d3a06;return db[_0x9fe4('0x30')][_0x9fe4('0x31')]()[_0x9fe4('0x29')](function(_0x4d437d){return db[_0x9fe4('0x30')][_0x9fe4('0x57')]({'where':{'id':_0x208f26[_0x9fe4('0x97')]['id']},'include':[{'model':db[_0x9fe4('0x58')],'as':'Tags','attributes':['id',_0x9fe4('0x2d'),_0x9fe4('0x49')],'required':_0x208f26[_0x9fe4('0x3d')][_0x9fe4('0x6f')]?!![]:![]}],'attributes':_[_0x9fe4('0x32')](_0x4d437d)});})[_0x9fe4('0x29')](function(_0x878813){_0x5d3a06=_0x878813[_0x9fe4('0xa0')]({'plain':!![]});var _0x3d76d5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x878813&&_0x878813['ListId']){if(_0x878813[_0x9fe4('0x6a')]){_0x3d76d5['where'][_0x9fe4('0xc0')]['push']({'ListId':{'$ne':_0x878813['ListId']}});}}return db[_0x9fe4('0x35')][_0x9fe4('0x9a')](_0x3d76d5);})[_0x9fe4('0x29')](function(_0x3248fe){return _['omit'](_0x5d3a06,_[_0x9fe4('0x5a')](_0x3248fe,function(_0x547c91){return util['format'](_0x9fe4('0xc1'),_0x547c91['id']);}));})['then'](handleEntityNotFound(_0x69db07,null))[_0x9fe4('0x29')](respondWithResult(_0x69db07,null))[_0x9fe4('0x96')](handleError(_0x69db07,null));};exports[_0x9fe4('0x28')]=function(_0xc4e819,_0x1726f6){var _0x10bf1a;if(_0xc4e819[_0x9fe4('0x9f')]['id']){delete _0xc4e819[_0x9fe4('0x9f')]['id'];}return db[_0x9fe4('0x30')][_0x9fe4('0x57')]({'where':{'id':_0xc4e819[_0x9fe4('0x97')]['id']}})[_0x9fe4('0x29')](handleEntityNotFound(_0x1726f6,null))['then'](saveUpdates(_0xc4e819[_0x9fe4('0x9f')],null))[_0x9fe4('0x29')](function(_0x3494c8){_0x10bf1a=_0x3494c8;var _0x556545={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3494c8&&_0x3494c8['ListId']){if(_0x3494c8[_0x9fe4('0x6a')]){_0x556545[_0x9fe4('0x46')][_0x9fe4('0xc0')][_0x9fe4('0x34')]({'ListId':{'$ne':_0x3494c8[_0x9fe4('0x6a')]}});}}return db['CmCustomField'][_0x9fe4('0x9a')](_0x556545);})['then'](function(_0x85a084){if(_0x85a084){return _[_0x9fe4('0xc2')](_['pickBy'](_0xc4e819['body'],function(_0x1b6b6e,_0x110554){return _[_0x9fe4('0x98')](_0x110554,_0x9fe4('0x39'));}),_[_0x9fe4('0x5a')](_0x85a084,function(_0x17b2cd){return util[_0x9fe4('0xc3')]('cf_%d',_0x17b2cd['id']);}));}})[_0x9fe4('0x29')](function(_0x2b5919){if(_0x2b5919&&!_[_0x9fe4('0x69')](_0x2b5919)){var _0x51a4ee=squel['update']()['table'](_0x9fe4('0xc4'))[_0x9fe4('0xc5')](_0x2b5919)[_0x9fe4('0x46')]('id\x20=\x20?',_0xc4e819[_0x9fe4('0x97')]['id'])[_0x9fe4('0xc6')]();return db['sequelize']['query'](_0x51a4ee[_0x9fe4('0x64')],{'replacements':_0x51a4ee[_0x9fe4('0x9e')]});}})[_0x9fe4('0x29')](function(){if(_0xc4e819[_0x9fe4('0x9f')]['phone']&&_0x10bf1a){return db['CmHopper'][_0x9fe4('0x28')]({'phone':_0xc4e819[_0x9fe4('0x9f')]['phone']},{'where':{'ContactId':_0x10bf1a['id']}});}})[_0x9fe4('0x29')](function(){return _0x10bf1a;})['then'](respondWithResult(_0x1726f6,null))[_0x9fe4('0x96')](handleError(_0x1726f6,null));};exports[_0x9fe4('0xc7')]=function(_0x10715c,_0x299812,_0x4f1b22){var _0x3350eb={};var _0x52b61b={};var _0x5d190b;var _0x7650a6;return db['CmContact'][_0x9fe4('0x36')]({'where':{'id':_0x10715c['params']['id']}})['then'](handleEntityNotFound(_0x299812,null))['then'](function(_0x204591){if(_0x204591){_0x5d190b=_0x204591;_0x52b61b[_0x9fe4('0x3c')]=_[_0x9fe4('0x32')](db[_0x9fe4('0x58')][_0x9fe4('0xc8')]);_0x52b61b[_0x9fe4('0x3d')]=_['keys'](_0x10715c[_0x9fe4('0x3d')]);_0x52b61b[_0x9fe4('0x3e')]=_[_0x9fe4('0x3f')](_0x52b61b[_0x9fe4('0x3c')],_0x52b61b[_0x9fe4('0x3d')]);_0x3350eb[_0x9fe4('0x40')]=_[_0x9fe4('0x3f')](_0x52b61b['model'],qs[_0x9fe4('0x41')](_0x10715c[_0x9fe4('0x3d')]['fields']));_0x3350eb[_0x9fe4('0x40')]=_0x3350eb[_0x9fe4('0x40')][_0x9fe4('0x33')]?_0x3350eb[_0x9fe4('0x40')]:_0x52b61b['model'];_0x3350eb[_0x9fe4('0x44')]=qs[_0x9fe4('0x45')](_0x10715c['query']['sort']);_0x3350eb[_0x9fe4('0x46')]=qs[_0x9fe4('0x3e')](_['pick'](_0x10715c[_0x9fe4('0x3d')],_0x52b61b['filters']));if(_0x10715c[_0x9fe4('0x3d')]['filter']){_0x3350eb[_0x9fe4('0x46')]=_[_0x9fe4('0x8b')](_0x3350eb['where'],{'$or':_[_0x9fe4('0x5a')](_0x3350eb[_0x9fe4('0x40')],function(_0x381806){var _0x1140cb={};_0x1140cb[_0x381806]={'$like':'%'+_0x10715c[_0x9fe4('0x3d')][_0x9fe4('0x66')]+'%'};return _0x1140cb;})});}_0x3350eb=_[_0x9fe4('0x8b')]({},_0x3350eb,_0x10715c[_0x9fe4('0xc9')]);return _0x5d190b[_0x9fe4('0xc7')](_0x3350eb);}})['then'](function(_0xa2cb4b){if(_0xa2cb4b){_0x7650a6=_0xa2cb4b[_0x9fe4('0x33')];if(!_0x10715c['query'][_0x9fe4('0x42')](_0x9fe4('0x43'))){_0x3350eb['limit']=qs[_0x9fe4('0x21')](_0x10715c['query'][_0x9fe4('0x21')]);_0x3350eb[_0x9fe4('0x23')]=qs[_0x9fe4('0x23')](_0x10715c[_0x9fe4('0x3d')][_0x9fe4('0x23')]);}return _0x5d190b[_0x9fe4('0xc7')](_0x3350eb);}})[_0x9fe4('0x29')](function(_0xddab82){if(_0xddab82){return _0xddab82?{'count':_0x7650a6,'rows':_0xddab82}:null;}})[_0x9fe4('0x29')](respondWithResult(_0x299812,null))[_0x9fe4('0x96')](handleError(_0x299812,null));};exports['setTags']=function(_0x5c89fd,_0x359d2b,_0x2f9fe){if(_0x5c89fd['body']['id']){delete _0x5c89fd[_0x9fe4('0x9f')]['id'];}return db['CmContact'][_0x9fe4('0x36')]({'where':{'id':_0x5c89fd[_0x9fe4('0x97')]['id']}})[_0x9fe4('0x29')](handleEntityNotFound(_0x359d2b,null))[_0x9fe4('0x29')](function(_0x41a5b2){if(_0x41a5b2){return _0x41a5b2['setTags'](_0x5c89fd[_0x9fe4('0x9f')]['ids']||[]);}return null;})['then'](respondWithResult(_0x359d2b,null))[_0x9fe4('0x96')](handleError(_0x359d2b,null));};exports[_0x9fe4('0xca')]=function(_0x4e966c,_0x3cd96c,_0x1b5b8d){var _0x5a94cc={'raw':![],'where':{}};var _0x473de1={};var _0x40e595={'count':0x0,'rows':[]};return db[_0x9fe4('0x30')][_0x9fe4('0x36')]({'where':{'id':_0x4e966c[_0x9fe4('0x97')]['id']}})['then'](handleEntityNotFound(_0x3cd96c,null))[_0x9fe4('0x29')](function(_0x3db842){if(_0x3db842){_0x473de1[_0x9fe4('0x3c')]=_[_0x9fe4('0x32')](db[_0x9fe4('0xcb')][_0x9fe4('0xc8')]);_0x473de1[_0x9fe4('0x3d')]=_[_0x9fe4('0x32')](_0x4e966c['query']);_0x473de1[_0x9fe4('0x3e')]=_[_0x9fe4('0x3f')](_0x473de1[_0x9fe4('0x3c')],_0x473de1[_0x9fe4('0x3d')]);_0x5a94cc['attributes']=_[_0x9fe4('0x3f')](_0x473de1[_0x9fe4('0x3c')],qs[_0x9fe4('0x41')](_0x4e966c[_0x9fe4('0x3d')]['fields']));_0x5a94cc[_0x9fe4('0x40')]=_0x5a94cc['attributes'][_0x9fe4('0x33')]?_0x5a94cc[_0x9fe4('0x40')]:_0x473de1['model'];if(!_0x4e966c[_0x9fe4('0x3d')][_0x9fe4('0x42')](_0x9fe4('0x43'))){_0x5a94cc[_0x9fe4('0x21')]=qs['limit'](_0x4e966c[_0x9fe4('0x3d')]['limit']);_0x5a94cc[_0x9fe4('0x23')]=qs[_0x9fe4('0x23')](_0x4e966c[_0x9fe4('0x3d')][_0x9fe4('0x23')]);}_0x5a94cc['order']=qs[_0x9fe4('0x45')](_0x4e966c['query'][_0x9fe4('0x45')]);_0x5a94cc['where']=qs['filters'](_[_0x9fe4('0xcc')](_0x4e966c[_0x9fe4('0x3d')],_0x473de1['filters']));_0x5a94cc[_0x9fe4('0x46')]['ContactId']=_0x3db842['id'];if(_0x4e966c[_0x9fe4('0x3d')][_0x9fe4('0x66')]){_0x5a94cc[_0x9fe4('0x46')]=_[_0x9fe4('0x8b')](_0x5a94cc['where'],{'$or':_['map'](_0x5a94cc['attributes'],function(_0x147568){var _0x14022d={};_0x14022d[_0x147568]={'$like':'%'+_0x4e966c['query'][_0x9fe4('0x66')]+'%'};return _0x14022d;})});}_0x5a94cc=_['merge']({},_0x5a94cc,_0x4e966c[_0x9fe4('0xc9')]);return db[_0x9fe4('0xcb')][_0x9fe4('0x24')]({'where':_0x5a94cc[_0x9fe4('0x46')]})[_0x9fe4('0x29')](function(_0x4f78f8){_0x40e595[_0x9fe4('0x24')]=_0x4f78f8;if(_0x4e966c[_0x9fe4('0x3d')][_0x9fe4('0xcd')]){_0x5a94cc[_0x9fe4('0xce')]=[{'all':!![]}];}return db['CmHopper'][_0x9fe4('0x9a')](_0x5a94cc);})[_0x9fe4('0x29')](function(_0x5a1536){_0x40e595[_0x9fe4('0x95')]=_0x5a1536;return _0x40e595;});}})[_0x9fe4('0x29')](respondWithFilteredResult(_0x3cd96c,_0x5a94cc))[_0x9fe4('0x96')](handleError(_0x3cd96c,null));};exports[_0x9fe4('0xcf')]=function(_0xfb4025,_0x30f76d,_0x7d69bb){var _0x37ddaf={'raw':!![],'where':{}};var _0x3d224e={};var _0x36d681={'count':0x0,'rows':[]};return db['CmContact']['findOne']({'where':{'id':_0xfb4025[_0x9fe4('0x97')]['id']}})[_0x9fe4('0x29')](handleEntityNotFound(_0x30f76d,null))['then'](function(_0x162955){if(_0x162955){_0x3d224e['model']=_[_0x9fe4('0x32')](db[_0x9fe4('0xb3')]['rawAttributes']);_0x3d224e['query']=_['keys'](_0xfb4025[_0x9fe4('0x3d')]);_0x3d224e[_0x9fe4('0x3e')]=_[_0x9fe4('0x3f')](_0x3d224e['model'],_0x3d224e['query']);_0x37ddaf['attributes']=_[_0x9fe4('0x3f')](_0x3d224e[_0x9fe4('0x3c')],qs[_0x9fe4('0x41')](_0xfb4025[_0x9fe4('0x3d')][_0x9fe4('0x41')]));_0x37ddaf[_0x9fe4('0x40')]=_0x37ddaf[_0x9fe4('0x40')][_0x9fe4('0x33')]?_0x37ddaf[_0x9fe4('0x40')]:_0x3d224e[_0x9fe4('0x3c')];if(!_0xfb4025[_0x9fe4('0x3d')][_0x9fe4('0x42')](_0x9fe4('0x43'))){_0x37ddaf['limit']=qs['limit'](_0xfb4025[_0x9fe4('0x3d')]['limit']);_0x37ddaf[_0x9fe4('0x23')]=qs[_0x9fe4('0x23')](_0xfb4025[_0x9fe4('0x3d')][_0x9fe4('0x23')]);}_0x37ddaf[_0x9fe4('0x44')]=qs['sort'](_0xfb4025[_0x9fe4('0x3d')][_0x9fe4('0x45')]);_0x37ddaf[_0x9fe4('0x46')]=qs[_0x9fe4('0x3e')](_[_0x9fe4('0xcc')](_0xfb4025[_0x9fe4('0x3d')],_0x3d224e['filters']));_0x37ddaf[_0x9fe4('0x46')][_0x9fe4('0xd0')]=_0x162955['id'];if(_0xfb4025[_0x9fe4('0x3d')][_0x9fe4('0x66')]){_0x37ddaf['where']=_[_0x9fe4('0x8b')](_0x37ddaf[_0x9fe4('0x46')],{'$or':_[_0x9fe4('0x5a')](_0x37ddaf[_0x9fe4('0x40')],function(_0x496e95){var _0x2ae03c={};_0x2ae03c[_0x496e95]={'$like':'%'+_0xfb4025['query'][_0x9fe4('0x66')]+'%'};return _0x2ae03c;})});}_0x37ddaf=_[_0x9fe4('0x8b')]({},_0x37ddaf,_0xfb4025[_0x9fe4('0xc9')]);return db[_0x9fe4('0xb3')]['count']({'where':_0x37ddaf[_0x9fe4('0x46')]})[_0x9fe4('0x29')](function(_0x9bf6e4){_0x36d681[_0x9fe4('0x24')]=_0x9bf6e4;if(_0xfb4025['query'][_0x9fe4('0xcd')]){_0x37ddaf['include']=[{'all':!![]}];}return db[_0x9fe4('0xb3')][_0x9fe4('0x9a')](_0x37ddaf);})[_0x9fe4('0x29')](function(_0x11dc2b){_0x36d681['rows']=_0x11dc2b;return _0x36d681;});}})[_0x9fe4('0x29')](respondWithFilteredResult(_0x30f76d,_0x37ddaf))[_0x9fe4('0x96')](handleError(_0x30f76d,null));};exports['getHopperFinals']=function(_0x160a6b,_0x46cc45,_0x22691a){var _0x27686b={'raw':!![],'where':{}};var _0xaa72f9={};var _0x58d88e={'count':0x0,'rows':[]};return db[_0x9fe4('0x30')]['findOne']({'where':{'id':_0x160a6b[_0x9fe4('0x97')]['id']}})['then'](handleEntityNotFound(_0x46cc45,null))[_0x9fe4('0x29')](function(_0x3abecd){if(_0x3abecd){_0xaa72f9['model']=_[_0x9fe4('0x32')](db[_0x9fe4('0xd1')][_0x9fe4('0xc8')]);_0xaa72f9[_0x9fe4('0x3d')]=_[_0x9fe4('0x32')](_0x160a6b[_0x9fe4('0x3d')]);_0xaa72f9[_0x9fe4('0x3e')]=_[_0x9fe4('0x3f')](_0xaa72f9[_0x9fe4('0x3c')],_0xaa72f9[_0x9fe4('0x3d')]);_0x27686b[_0x9fe4('0x40')]=_[_0x9fe4('0x3f')](_0xaa72f9[_0x9fe4('0x3c')],qs[_0x9fe4('0x41')](_0x160a6b[_0x9fe4('0x3d')][_0x9fe4('0x41')]));_0x27686b[_0x9fe4('0x40')]=_0x27686b[_0x9fe4('0x40')][_0x9fe4('0x33')]?_0x27686b[_0x9fe4('0x40')]:_0xaa72f9[_0x9fe4('0x3c')];if(!_0x160a6b[_0x9fe4('0x3d')][_0x9fe4('0x42')](_0x9fe4('0x43'))){_0x27686b[_0x9fe4('0x21')]=qs['limit'](_0x160a6b['query'][_0x9fe4('0x21')]);_0x27686b['offset']=qs[_0x9fe4('0x23')](_0x160a6b['query'][_0x9fe4('0x23')]);}_0x27686b[_0x9fe4('0x44')]=qs[_0x9fe4('0x45')](_0x160a6b[_0x9fe4('0x3d')][_0x9fe4('0x45')]);_0x27686b[_0x9fe4('0x46')]=qs[_0x9fe4('0x3e')](_[_0x9fe4('0xcc')](_0x160a6b[_0x9fe4('0x3d')],_0xaa72f9['filters']));_0x27686b[_0x9fe4('0x46')][_0x9fe4('0xd0')]=_0x3abecd['id'];if(_0x160a6b['query'][_0x9fe4('0x66')]){_0x27686b[_0x9fe4('0x46')]=_['merge'](_0x27686b[_0x9fe4('0x46')],{'$or':_['map'](_0x27686b['attributes'],function(_0x2e348a){var _0x338bca={};_0x338bca[_0x2e348a]={'$like':'%'+_0x160a6b['query']['filter']+'%'};return _0x338bca;})});}_0x27686b=_[_0x9fe4('0x8b')]({},_0x27686b,_0x160a6b[_0x9fe4('0xc9')]);return db['CmHopperFinal'][_0x9fe4('0x24')]({'where':_0x27686b['where']})[_0x9fe4('0x29')](function(_0x46982f){_0x58d88e['count']=_0x46982f;if(_0x160a6b[_0x9fe4('0x3d')][_0x9fe4('0xcd')]){_0x27686b[_0x9fe4('0xce')]=[{'all':!![]}];}return db[_0x9fe4('0xd1')][_0x9fe4('0x9a')](_0x27686b);})[_0x9fe4('0x29')](function(_0x5309c1){_0x58d88e[_0x9fe4('0x95')]=_0x5309c1;return _0x58d88e;});}})[_0x9fe4('0x29')](respondWithFilteredResult(_0x46cc45,_0x27686b))[_0x9fe4('0x96')](handleError(_0x46cc45,null));};exports[_0x9fe4('0xd2')]=function(_0x5314c9,_0xe85c75,_0x35dc91){var _0x162fbe={'raw':!![],'where':{}};var _0xf953af={};var _0x369728={'count':0x0,'rows':[]};return db['CmContact'][_0x9fe4('0x36')]({'where':{'id':_0x5314c9[_0x9fe4('0x97')]['id']}})[_0x9fe4('0x29')](handleEntityNotFound(_0xe85c75,null))['then'](function(_0x26fb27){if(_0x26fb27){_0xf953af[_0x9fe4('0x3c')]=_['keys'](db[_0x9fe4('0xba')]['rawAttributes']);_0xf953af[_0x9fe4('0x3d')]=_['keys'](_0x5314c9[_0x9fe4('0x3d')]);_0xf953af[_0x9fe4('0x3e')]=_[_0x9fe4('0x3f')](_0xf953af['model'],_0xf953af[_0x9fe4('0x3d')]);_0x162fbe[_0x9fe4('0x40')]=_[_0x9fe4('0x3f')](_0xf953af[_0x9fe4('0x3c')],qs[_0x9fe4('0x41')](_0x5314c9[_0x9fe4('0x3d')][_0x9fe4('0x41')]));_0x162fbe[_0x9fe4('0x40')]=_0x162fbe[_0x9fe4('0x40')][_0x9fe4('0x33')]?_0x162fbe[_0x9fe4('0x40')]:_0xf953af['model'];if(!_0x5314c9['query'][_0x9fe4('0x42')]('nolimit')){_0x162fbe[_0x9fe4('0x21')]=qs[_0x9fe4('0x21')](_0x5314c9['query'][_0x9fe4('0x21')]);_0x162fbe[_0x9fe4('0x23')]=qs['offset'](_0x5314c9[_0x9fe4('0x3d')]['offset']);}_0x162fbe['order']=qs[_0x9fe4('0x45')](_0x5314c9[_0x9fe4('0x3d')]['sort']);_0x162fbe[_0x9fe4('0x46')]=qs[_0x9fe4('0x3e')](_[_0x9fe4('0xcc')](_0x5314c9[_0x9fe4('0x3d')],_0xf953af['filters']));_0x162fbe[_0x9fe4('0x46')][_0x9fe4('0xd0')]=_0x26fb27['id'];if(_0x5314c9[_0x9fe4('0x3d')]['filter']){_0x162fbe[_0x9fe4('0x46')]=_['merge'](_0x162fbe[_0x9fe4('0x46')],{'$or':_[_0x9fe4('0x5a')](_0x162fbe['attributes'],function(_0x4b360e){var _0x491f88={};_0x491f88[_0x4b360e]={'$like':'%'+_0x5314c9[_0x9fe4('0x3d')][_0x9fe4('0x66')]+'%'};return _0x491f88;})});}_0x162fbe=_[_0x9fe4('0x8b')]({},_0x162fbe,_0x5314c9['options']);return db[_0x9fe4('0xba')]['count']({'where':_0x162fbe[_0x9fe4('0x46')]})[_0x9fe4('0x29')](function(_0x2169e0){_0x369728[_0x9fe4('0x24')]=_0x2169e0;if(_0x5314c9[_0x9fe4('0x3d')][_0x9fe4('0xcd')]){_0x162fbe['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x9fe4('0x9a')](_0x162fbe);})['then'](function(_0x151092){_0x369728[_0x9fe4('0x95')]=_0x151092;return _0x369728;});}})['then'](respondWithFilteredResult(_0xe85c75,_0x162fbe))[_0x9fe4('0x96')](handleError(_0xe85c75,null));};exports[_0x9fe4('0xd3')]=function(_0x567cbc,_0x442872,_0x131f10){try{if(!_0x567cbc['body'][_0x9fe4('0x6a')]){throw new Error(_0x9fe4('0xd4'));}if(!_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xd5')]){throw new Error(_0x9fe4('0xd6'));}if(!_0x567cbc[_0x9fe4('0x9f')]['binding_values']){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xd7')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3f1b42=_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xd5')][_0x9fe4('0x72')](',');var _0x31a346=_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xd8')][_0x9fe4('0x72')](',');if(!_0x3f1b42[_0x9fe4('0x33')]||!_0x31a346[_0x9fe4('0x33')]||_0x3f1b42[_0x9fe4('0x33')]!==_0x31a346[_0x9fe4('0x33')]){throw new Error(_0x9fe4('0xd9'));}_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0x41')]=_['zipObject'](_0x3f1b42,_0x31a346);if(!_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0x41')]['phone']){throw new Error(_0x9fe4('0xda'));}if(!_0x567cbc['body'][_0x9fe4('0x41')]['firstName']){throw new Error(_0x9fe4('0xdb'));}var _0x438a7e=path[_0x9fe4('0xa3')](config['root'],_0x9fe4('0xdc'),_0x567cbc[_0x9fe4('0xdd')][_0x9fe4('0xde')]);fs[_0x9fe4('0xdf')](_0x438a7e,parseInt(_0x9fe4('0xe0'),0x8));var _0x169ddc=require(_0x9fe4('0xe1'))[_0x9fe4('0xe2')](path['join'](__dirname,_0x9fe4('0xe3')),[_0x438a7e,_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xd5')],_0x567cbc['body'][_0x9fe4('0xd8')],_0x567cbc['body'][_0x9fe4('0x6a')],_0x567cbc[_0x9fe4('0x9f')]['CompanyId'],_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xbd')],_0x567cbc[_0x9fe4('0x9f')][_0x9fe4('0xd7')]]);return _0x442872[_0x9fe4('0x1f')](0xc8)['json']({'message':_0x9fe4('0xe4'),'pid':_0x169ddc[_0x9fe4('0xe5')]});}catch(_0xe60e1c){return _0x442872[_0x9fe4('0x1f')](0x1f4)[_0x9fe4('0x2e')](_0xe60e1c);}};exports[_0x9fe4('0xe6')]=function(_0x490830,_0x257105,_0x5626f9){var _0x8bf425=fs[_0x9fe4('0xe7')](_0x490830[_0x9fe4('0xdd')][_0x9fe4('0x7')]);Papa['parse'](_0x8bf425,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4ce508){return _0x257105[_0x9fe4('0x1f')](0xc8)[_0x9fe4('0x20')]({'file':_0x490830[_0x9fe4('0xdd')],'fields':_0x4ce508[_0x9fe4('0xe8')][_0x9fe4('0x41')]});}});};exports[_0x9fe4('0xe9')]=function(_0x425d60,_0x4b40b0,_0x1380fe){return db[_0x9fe4('0x5c')][_0x9fe4('0x9a')]({'raw':!![],'attributes':['id'],'where':{'role':_0x9fe4('0x83')}})[_0x9fe4('0x29')](function(_0x1884ea){var _0x4a14ee=![];if(!_0x425d60[_0x9fe4('0x9f')][_0x9fe4('0x6a')]){throw new Error(_0x9fe4('0xd4'));}if(!_0x425d60['body'][_0x9fe4('0xea')][_0x9fe4('0xeb')]){throw new Error(_0x9fe4('0xda'));}if(!_0x425d60['body'][_0x9fe4('0xea')][_0x9fe4('0xec')]){throw new Error(_0x9fe4('0xdb'));}if(!_0x425d60[_0x9fe4('0x9f')][_0x9fe4('0xd7')]){throw new Error(_0x9fe4('0xed'));}var _0x284405=require(_0x9fe4('0xe1'))[_0x9fe4('0xe2')](path['join'](__dirname,_0x9fe4('0xee')),[_0x425d60['params']['id'],JSON[_0x9fe4('0xef')](_0x425d60[_0x9fe4('0x9f')]),JSON[_0x9fe4('0xef')](_0x1884ea)]);_0x284405['on'](_0x9fe4('0xf0'),function(_0x5df60b){_0x4a14ee=!![];return _0x4b40b0[_0x9fe4('0x1f')](0xc8)[_0x9fe4('0x20')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x284405['pid']});});_0x284405['on'](_0x9fe4('0xf1'),function(_0x45c1f7){if(_0x45c1f7&&!_0x4a14ee){return _0x4b40b0[_0x9fe4('0x1f')](0x1f4)[_0x9fe4('0x20')]({'message':_0x9fe4('0xf2'),'pid':_0x284405['pid']});}});})[_0x9fe4('0x96')](handleError(_0x4b40b0,null));};exports[_0x9fe4('0xf3')]=function(_0xb0356d,_0x50f727){var _0x48c60b=[_0x9fe4('0xf4'),'chat',_0x9fe4('0xf5'),_0x9fe4('0xf6'),_0x9fe4('0xf7'),_0x9fe4('0xf8'),_0x9fe4('0xf9')];var _0x118953={'offset':0x0,'order':qs[_0x9fe4('0x45')](_0x9fe4('0xfa'))},_0x3546d3={'count':0x0,'rows':[]};Promise[_0x9fe4('0xfb')]()[_0x9fe4('0x29')](function(){if(_0xb0356d['query'][_0x9fe4('0xfc')]){if(!_[_0x9fe4('0xfd')](_0x48c60b,_0xb0356d[_0x9fe4('0x3d')]['channel']['toLowerCase']())){throw new Error(_0x9fe4('0xfe'));}_0x48c60b=[_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0xfc')][_0x9fe4('0xff')]()];}if(_0xb0356d[_0x9fe4('0x3d')]['range']){try{var _0x1e1d31=JSON[_0x9fe4('0x100')](_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0x101')]);if(!moment(_0x1e1d31[_0x9fe4('0x4a')])[_0x9fe4('0x102')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x1e1d31['to'])[_0x9fe4('0x102')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x3cdc0d){throw new Error(_0x9fe4('0x103'));}}if(!_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0x42')](_0x9fe4('0x43'))){_0x118953['limit']=qs[_0x9fe4('0x21')](_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0x21')]||0xa);_0x118953['offset']=qs[_0x9fe4('0x23')](_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0x23')]);}var _0x44ebbe=_0x48c60b[_0x9fe4('0x5a')](function(_0x14523f){if(_0x14523f==='voice'){var _0x8e669c={'attributes':['id',_0x9fe4('0x104'),'type','source','destination',_0x9fe4('0x105'),_0x9fe4('0x106'),_0x9fe4('0x107'),'duration',_0x9fe4('0x108'),_0x9fe4('0x109'),_0x9fe4('0x10a'),'userSecondDisposition','userThirdDisposition',_0x9fe4('0x10b')],'where':{'ContactId':_0xb0356d[_0x9fe4('0x97')]['id']},'include':[{'model':db[_0x9fe4('0x5c')],'as':_0x9fe4('0x5c'),'attributes':['id',_0x9fe4('0x2d'),_0x9fe4('0x10c'),_0x9fe4('0x9c')]}],'order':[[_0x9fe4('0x109'),_0x9fe4('0x7f')]]};if(_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0x101')]){_0x8e669c['where']['createdAt']={'$gte':_0x1e1d31[_0x9fe4('0x4a')],'$lte':_0x1e1d31['to']};}return db[_0x9fe4('0xb5')][_0x9fe4('0x10d')](_0x8e669c)[_0x9fe4('0x29')](function(_0x546f0a){_0x3546d3['count']+=_0x546f0a[_0x9fe4('0x24')];return _[_0x9fe4('0x5a')](_0x546f0a[_0x9fe4('0x95')],function(_0xe2e47b){var _0x2b4607=_0xe2e47b[_0x9fe4('0xa0')]({'plain':!![]});_0x2b4607[_0x9fe4('0xfc')]=_0x14523f;if(_0x2b4607[_0x9fe4('0x5c')]){_0x2b4607[_0x9fe4('0x5c')]={'id':_0x2b4607[_0x9fe4('0x5c')]['id'],'name':_0x2b4607[_0x9fe4('0x5c')]['name'],'fullname':_0x2b4607[_0x9fe4('0x5c')][_0x9fe4('0x10c')],'alias':_0x2b4607['User']['alias']};}return _0x2b4607;});});}else{var _0x1e279a=_['startCase'](_0x14523f)+(_0x14523f==='chat'?_0x9fe4('0x10e'):_0x9fe4('0x10f'));var _0x406b6e={'attributes':['id','closed',_0x9fe4('0x110'),_0x9fe4('0x109'),_0x9fe4('0x108'),'disposition','secondDisposition','thirdDisposition',_0x9fe4('0x10b'),_0x1e279a+'Id'],'where':{'ContactId':_0xb0356d[_0x9fe4('0x97')]['id']},'include':[{'model':db[_0x1e279a],'as':'Account','attributes':['id',_0x9fe4('0x2d'),_0x9fe4('0x111')]},{'model':db[_0x9fe4('0x5c')],'as':'Owner','attributes':['id',_0x9fe4('0x2d'),'fullname']},{'model':db[_0x9fe4('0x58')],'as':_0x9fe4('0x94'),'attributes':['id',_0x9fe4('0x2d'),_0x9fe4('0x49')],'through':{'attributes':[]}}],'order':[[_0x9fe4('0x109'),_0x9fe4('0x7f')]]};if(_0xb0356d[_0x9fe4('0x3d')][_0x9fe4('0x101')]){_0x406b6e['where']['createdAt']={'$gte':_0x1e1d31[_0x9fe4('0x4a')],'$lte':_0x1e1d31['to']};}switch(_0x14523f){case'chat':_0x406b6e[_0x9fe4('0x40')][_0x9fe4('0x34')](_0x9fe4('0x112'),_0x9fe4('0x113'),_0x9fe4('0x114'),_0x9fe4('0x115'),'osName',_0x9fe4('0x116'),_0x9fe4('0x117'),_0x9fe4('0x118'),_0x9fe4('0x119'));break;case _0x9fe4('0xf4'):_0x406b6e[_0x9fe4('0x40')]['push'](_0x9fe4('0x11a'),'substatus');break;case'openchannel':_0x406b6e[_0x9fe4('0x40')]['push'](_0x9fe4('0x11b'),_0x9fe4('0x11c'));break;}return db[_['startCase'](_0x14523f)+'Interaction'][_0x9fe4('0x10d')](_0x406b6e)[_0x9fe4('0x29')](function(_0xbb53f3){_0x3546d3[_0x9fe4('0x24')]+=_0xbb53f3[_0x9fe4('0x24')];return _[_0x9fe4('0x5a')](_0xbb53f3[_0x9fe4('0x95')],function(_0x216de9){var _0x33a007=_0x216de9[_0x9fe4('0xa0')]({'plain':!![]});_0x33a007[_0x9fe4('0xfc')]=_0x14523f;if(_0x33a007[_0x9fe4('0x11d')]){_0x33a007['Owner']={'id':_0x33a007[_0x9fe4('0x11d')]['id'],'name':_0x33a007[_0x9fe4('0x11d')][_0x9fe4('0x2d')],'fullname':_0x33a007[_0x9fe4('0x11d')][_0x9fe4('0x10c')]};}return _0x33a007;});});}});return Promise[_0x9fe4('0x38')](_0x44ebbe);})[_0x9fe4('0x29')](function(_0x2fbe9a){return _(_0x2fbe9a)[_0x9fe4('0x11e')]()['sortBy'](_0x9fe4('0x109'))[_0x9fe4('0x11f')]()[_0x9fe4('0x59')]();})[_0x9fe4('0x29')](function(_0x44a3f8){_0x3546d3[_0x9fe4('0x95')]=_0x118953[_0x9fe4('0x21')]?_0x44a3f8[_0x9fe4('0x120')](_0x118953['offset'],_0x118953['offset']+_0x118953[_0x9fe4('0x21')]):_0x44a3f8;return _0x3546d3;})['then'](respondWithFilteredResult(_0x50f727,_0x118953))[_0x9fe4('0x96')](handleError(_0x50f727,null));};
\ No newline at end of file
+var _0x6fe8=['keyBy','c.firstName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','destroy','CmContact','params','catch','tags','columnName','displayName','findAll','values','merge','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','join','bulkCreate','duplicates','findOrCreate','show','$and','cf_%d','pickBy','startsWith','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','include','getHopperHistories','includeAll','CmHopperFinal','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','No\x20phone\x20column\x20specified','firstName','root','server/files/tmp','file','filename','0777','../../components/import/cm/csv','CompanyId','pid','upload','createReadStream','parse','meta','import','binding','No\x20firstName\x20column\x20specified','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','child_process','fork','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','chat','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','uniqueid','destination','starttime','endtime','duration','note','userDisposition','UserId','alias','createdAt','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','customerIp','customerPort','osName','ratingType','ratingValue','referer','mail','substatus','threadId','Interaction','Owner','flatten','sortBy','slice','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','describe','keys','length','cf_','push','CmCustomField','findOne','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','from','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','find','Tag','value','split','map','forEach','union','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','buildExpression','text','start','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','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.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','agent','some','conditions','User','user','getLists','c.ListId\x20IS\x20NULL','role','ListId','sequelize','toString'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6fe8,0x1c1));var _0x86fe=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0x6fe8[_0x8854f2];return _0x38505d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86fe('0x0'));var zipdir=require(_0x86fe('0x1'));var jsonpatch=require(_0x86fe('0x2'));var rp=require(_0x86fe('0x3'));var moment=require(_0x86fe('0x4'));var BPromise=require(_0x86fe('0x5'));var Mustache=require(_0x86fe('0x6'));var util=require(_0x86fe('0x7'));var path=require(_0x86fe('0x8'));var sox=require(_0x86fe('0x9'));var csv=require(_0x86fe('0xa'));var ejs=require(_0x86fe('0xb'));var fs=require('fs');var fs_extra=require(_0x86fe('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x86fe('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x86fe('0xa'));var querystring=require('querystring');var Papa=require(_0x86fe('0xe'));var Redis=require(_0x86fe('0xf'));var authService=require(_0x86fe('0x10'));var qs=require(_0x86fe('0x11'));var as=require(_0x86fe('0x12'));var hardwareService=require(_0x86fe('0x13'));var logger=require(_0x86fe('0x14'))('api');var utils=require(_0x86fe('0x15'));var config=require(_0x86fe('0x16'));var licenseUtil=require(_0x86fe('0x17'));var db=require(_0x86fe('0x18'))['db'];config[_0x86fe('0x19')]=_[_0x86fe('0x1a')](config[_0x86fe('0x19')],{'host':_0x86fe('0x1b'),'port':0x18eb});var socket=require(_0x86fe('0x1c'))(new Redis(config[_0x86fe('0x19')]));require(_0x86fe('0x1d'))[_0x86fe('0x1e')](socket);function respondWithStatusCode(_0x14a5ed,_0x30cb70){_0x30cb70=_0x30cb70||0xcc;return function(_0x2aea38){if(_0x2aea38){return _0x14a5ed[_0x86fe('0x1f')](_0x30cb70);}return _0x14a5ed[_0x86fe('0x20')](_0x30cb70)[_0x86fe('0x21')]();};}function respondWithResult(_0x1a3f0d,_0xd9662){_0xd9662=_0xd9662||0xc8;return function(_0x3ec940){if(_0x3ec940){return _0x1a3f0d['status'](_0xd9662)[_0x86fe('0x22')](_0x3ec940);}};}function respondWithFilteredResult(_0x39b5ec,_0x5b10a8){return function(_0x54bc64){if(_0x54bc64){var _0x59b014=typeof _0x5b10a8[_0x86fe('0x23')]===_0x86fe('0x24')&&typeof _0x5b10a8[_0x86fe('0x25')]===_0x86fe('0x24');var _0x8f4be4=_0x54bc64[_0x86fe('0x26')];var _0x216310=_0x59b014?0x0:_0x5b10a8[_0x86fe('0x23')];var _0x5ab9f9=_0x59b014?_0x54bc64['count']:_0x5b10a8[_0x86fe('0x23')]+_0x5b10a8['limit'];var _0xa937fd;if(_0x5ab9f9>=_0x8f4be4){_0x5ab9f9=_0x8f4be4;_0xa937fd=0xc8;}else{_0xa937fd=0xce;}_0x39b5ec[_0x86fe('0x20')](_0xa937fd);return _0x39b5ec[_0x86fe('0x27')](_0x86fe('0x28'),_0x216310+'-'+_0x5ab9f9+'/'+_0x8f4be4)[_0x86fe('0x22')](_0x54bc64);}return null;};}function patchUpdates(_0x580d29){return function(_0x3f0716){try{jsonpatch[_0x86fe('0x29')](_0x3f0716,_0x580d29,!![]);}catch(_0x3d2f71){return BPromise[_0x86fe('0x2a')](_0x3d2f71);}return _0x3f0716['save']();};}function saveUpdates(_0xcfd548,_0x208170){return function(_0x7a0dc9){if(_0x7a0dc9){return _0x7a0dc9[_0x86fe('0x2b')](_0xcfd548)[_0x86fe('0x2c')](function(_0x15593f){return _0x15593f;});}return null;};}function removeEntity(_0x2a6e1f,_0x6b91b){return function(_0x170231){if(_0x170231){return _0x170231['destroy']()[_0x86fe('0x2c')](function(){_0x2a6e1f[_0x86fe('0x20')](0xcc)[_0x86fe('0x21')]();});}};}function handleEntityNotFound(_0x1976d9,_0x3c9e2d){return function(_0x1f2eb0){if(!_0x1f2eb0){_0x1976d9['sendStatus'](0x194);}return _0x1f2eb0;};}function handleError(_0x58b6ff,_0x4d96fb){_0x4d96fb=_0x4d96fb||0x1f4;return function(_0x4b4b14){logger[_0x86fe('0x2d')](_0x4b4b14[_0x86fe('0x2e')]);if(_0x4b4b14['name']){delete _0x4b4b14[_0x86fe('0x2f')];}_0x58b6ff[_0x86fe('0x20')](_0x4d96fb)[_0x86fe('0x30')](_0x4b4b14);};}exports[_0x86fe('0x31')]=function(_0x5cbbea,_0x3bee77){var _0x397e3a={},_0x1f2a6e={},_0x20eaac={'count':0x0,'rows':[]};return db['CmContact'][_0x86fe('0x32')]()[_0x86fe('0x2c')](function(_0x1c4f68){var _0x1a8ed3=[];for(var _0x4f91f3=0x0;_0x4f91f3<Object[_0x86fe('0x33')](_0x1c4f68)[_0x86fe('0x34')];_0x4f91f3++){var _0x532a0e=Object[_0x86fe('0x33')](_0x1c4f68)[_0x4f91f3];if(_['startsWith'](_0x532a0e,_0x86fe('0x35'))){_0x1a8ed3[_0x86fe('0x36')](db[_0x86fe('0x37')][_0x86fe('0x38')]({'where':{'id':_['trimStart'](_0x532a0e,'cf_')},'raw':!![]}));}}return BPromise[_0x86fe('0x39')](_0x1a8ed3)['then'](function(_0x1ba769){for(var _0x472ccd=0x0;_0x472ccd<_0x1ba769[_0x86fe('0x34')];_0x472ccd++){if(_0x1ba769[_0x472ccd]){var _0x1e39bd=_0x86fe('0x35')+_0x1ba769[_0x472ccd]['id'];var _0x5b8bcf=_0x1c4f68[_0x1e39bd];_0x5b8bcf[_0x86fe('0x3a')]=_0x1ba769[_0x472ccd][_0x86fe('0x3b')];}}return _0x1c4f68;});})[_0x86fe('0x2c')](function(_0x43f810){_0x1f2a6e[_0x86fe('0x3c')]=_[_0x86fe('0x33')](_0x43f810);_0x1f2a6e['query']=_[_0x86fe('0x33')](_0x5cbbea[_0x86fe('0x3d')]);_0x1f2a6e[_0x86fe('0x3e')]=_[_0x86fe('0x3f')](_0x1f2a6e[_0x86fe('0x3c')],_0x1f2a6e[_0x86fe('0x3d')]);_0x397e3a[_0x86fe('0x40')]=_[_0x86fe('0x3f')](_0x1f2a6e[_0x86fe('0x3c')],qs[_0x86fe('0x41')](_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x41')]));_0x397e3a[_0x86fe('0x40')]=_0x397e3a['attributes'][_0x86fe('0x34')]?_0x397e3a[_0x86fe('0x40')]:_0x1f2a6e[_0x86fe('0x3c')];if(!_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x42')](_0x86fe('0x43'))){_0x397e3a['limit']=qs[_0x86fe('0x25')](_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x25')]);_0x397e3a[_0x86fe('0x23')]=qs['offset'](_0x5cbbea[_0x86fe('0x3d')]['offset']);}_0x397e3a[_0x86fe('0x44')]=qs[_0x86fe('0x45')](_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x45')]);_0x397e3a[_0x86fe('0x46')]=qs[_0x86fe('0x3e')](_[_0x86fe('0x47')](_0x5cbbea[_0x86fe('0x3d')],_0x1f2a6e[_0x86fe('0x3e')]),_0x43f810);var _0x45af13=[];var _0x45a692=squel[_0x86fe('0x48')]()[_0x86fe('0x49')]('id')[_0x86fe('0x49')](_0x86fe('0x2f'))[_0x86fe('0x49')](_0x86fe('0x4a'))['from'](_0x86fe('0x4b'));var _0x2f3550=squel['select']()[_0x86fe('0x4c')](_0x86fe('0x4d'),'c')['left_join'](_0x86fe('0x4e'),'uc',_0x86fe('0x4f'))[_0x86fe('0x50')](_0x86fe('0x51'),'ct','ct.CmContactId\x20=\x20c.id')[_0x86fe('0x50')](_0x86fe('0x4b'),'t',_0x86fe('0x52'))[_0x86fe('0x46')](_0x86fe('0x53'));var _0x459271=squel[_0x86fe('0x54')]();var _0x7b5f4f=[];var _0x8b1fc7=squel[_0x86fe('0x54')]();var _0x3f7d70;if(_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x55')]){_0x3f7d70=as['parseSearch'](_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x55')]);var _0x516183=_0x3f7d70['sqlOperator'];for(var _0x3d3670=0x0;_0x3d3670<_0x3f7d70['conditions'][_0x86fe('0x34')];_0x3d3670++){var _0x5e9cea=_0x3f7d70['conditions'][_0x3d3670];var _0x59bfe8='c';var _0x5c2f60=_(_0x43f810)['keys']()[_0x86fe('0x56')](function(_0x12a647){return _0x12a647===_0x5e9cea[_0x86fe('0x49')];});if(_0x5c2f60)_0x5c2f60=_0x43f810[_0x5e9cea['field']];if(!_0x5c2f60){if(_0x5e9cea[_0x86fe('0x49')]===_0x86fe('0x57')){var _0x520389=_0x5e9cea[_0x86fe('0x58')][_0x86fe('0x59')](',')[_0x86fe('0x5a')](function(_0x37dde0){return Number(_0x37dde0);});_0x520389[_0x86fe('0x5b')](function(_0x311d85){_0x8b1fc7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x311d85+',%');});_0x7b5f4f=_[_0x86fe('0x5c')](_0x7b5f4f,_0x520389);}else if(_0x5e9cea['field']==='User'){_0x459271['and'](_0x86fe('0x5d'),_0x5e9cea[_0x86fe('0x58')]);}}else{if(_0x5e9cea[_0x86fe('0x49')]===_0x86fe('0x5e')||_0x5c2f60['fieldType']===_0x86fe('0x5f'))_0x5e9cea['castTo']=_0x86fe('0x60');var _0x311934=as[_0x86fe('0x61')](_0x59bfe8,_0x5c2f60[_0x86fe('0x3b')],_0x5e9cea);_0x459271[_0x516183](_0x311934[_0x86fe('0x62')],_0x311934[_0x86fe('0x58')][_0x86fe('0x63')],_0x311934[_0x86fe('0x58')]['end']);}}}else{var _0xaa1081=_(Object['keys'](_0x5cbbea['query']))['map'](function(_0x5500ce){return _0x43f810[_0x86fe('0x42')](_0x5500ce)?_0x5500ce:undefined;})[_0x86fe('0x64')](function(_0x5e3d51){return!_[_0x86fe('0x65')](_0x5e3d51);})[_0x86fe('0x58')]();if(_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x66')])_0xaa1081[_0x86fe('0x36')](_0x86fe('0x66'));if(!_[_0x86fe('0x67')](_0xaa1081)){_0xaa1081['forEach'](function(_0xe47763){if(_0xe47763==='ListId'){_0x2f3550['where'](_0x86fe('0x68'),[][_0x86fe('0x69')](_0x5cbbea[_0x86fe('0x3d')][_0xe47763]));}else if(_0xe47763==='Contact'){var _0x4369c4='%'+_0x5cbbea[_0x86fe('0x3d')][_0xe47763]+'%';_0x2f3550['where'](_0x86fe('0x6a'),_0x4369c4);}else{_0x2f3550['where']('c.'+_0xe47763+_0x86fe('0x6b'),_0x5cbbea['query'][_0xe47763]);}});}if(_0x5cbbea[_0x86fe('0x3d')]['tag']){_0x7b5f4f=_[_0x86fe('0x6c')](_0x5cbbea['query'][_0x86fe('0x6d')])?_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x6d')]:new Array(_0x5cbbea['query'][_0x86fe('0x6d')]);_0x7b5f4f['forEach'](function(_0x2f8fbe){_0x8b1fc7['or'](_0x86fe('0x6e'),'%,'+_0x2f8fbe+',%');});}if(_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x64')]){var _0x4aebff=_0x5cbbea['query']['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x4aebff[_0x86fe('0x59')]('\x20')['length']>0x1){_0x459271['or'](_0x86fe('0x6f'),qs[_0x86fe('0x70')](_0x4aebff),null);}else{if(qs[_0x86fe('0x71')](_0x4aebff)){_0x459271['or'](_0x86fe('0x72'),_0x4aebff+'%');_0x459271['or'](_0x86fe('0x73'),_0x4aebff+'%');_0x459271['or'](_0x86fe('0x74'),_0x4aebff+'%');_0x459271['or'](_0x86fe('0x75'),_0x4aebff+'%');}else if(qs[_0x86fe('0x76')](_0x4aebff)){_0x459271['or']('c.email\x20LIKE\x20?',_0x4aebff+'%');}else{_0x459271['or'](_0x86fe('0x77'),'%'+_0x4aebff+'%');_0x459271['or'](_0x86fe('0x78'),'%'+_0x4aebff+'%');_0x459271['or'](_0x86fe('0x79'),'%'+_0x4aebff+'%');}}}}_0x2f3550[_0x86fe('0x46')](_0x459271);_0x2f3550[_0x86fe('0x7a')](_0x86fe('0x7b'));var _0xaab5e9={'type':db[_0x86fe('0x7c')][_0x86fe('0x7d')][_0x86fe('0x7e')],'raw':!![]};var _0x3b04fb=_0x2f3550[_0x86fe('0x7f')]()[_0x86fe('0x49')](_0x86fe('0x7b'));if(_0x397e3a['order']){_0x397e3a['order'][_0x86fe('0x5b')](function(_0x478adf){_0x2f3550[_0x86fe('0x44')]('c.'+_0x478adf[0x0],_0x478adf[0x1]===_0x86fe('0x80')?![]:!![]);});}if(!_[_0x86fe('0x67')](_0x7b5f4f)){_0x2f3550[_0x86fe('0x81')](_0x8b1fc7);_0x3b04fb['where'](_0x86fe('0x82'),_0x7b5f4f);}BPromise[_0x86fe('0x83')]()[_0x86fe('0x2c')](function(){if(!_0x3f7d70)return;if(_0x5cbbea['user']['role']!==_0x86fe('0x84'))return;if(!_[_0x86fe('0x85')](_0x3f7d70[_0x86fe('0x86')],['field',_0x86fe('0x87')])){return _0x5cbbea[_0x86fe('0x88')][_0x86fe('0x89')]({'attributes':['id'],'raw':!![]})[_0x86fe('0x2c')](function(_0x11eae0){if(_['isEmpty'](_0x11eae0)){_0x3b04fb['where'](_0x86fe('0x8a'));_0x2f3550[_0x86fe('0x46')](_0x86fe('0x8a'));}else{_0x3b04fb[_0x86fe('0x46')](_0x86fe('0x68'),_[_0x86fe('0x5a')](_0x11eae0,'id'));_0x2f3550[_0x86fe('0x46')](_0x86fe('0x68'),_[_0x86fe('0x5a')](_0x11eae0,'id'));}});}})[_0x86fe('0x2c')](function(){if(_0x5cbbea[_0x86fe('0x88')][_0x86fe('0x8b')]===_0x86fe('0x84')&&!_0x3f7d70&&!_0x5cbbea[_0x86fe('0x3d')][_0x86fe('0x8c')])return[];return db[_0x86fe('0x8d')][_0x86fe('0x3d')](_0x3b04fb['toString'](),_0xaab5e9);})['then'](function(_0x2ab453){_0x20eaac[_0x86fe('0x26')]=_0x2ab453['length'];if(_0x20eaac['count']===0x0)return[];return db[_0x86fe('0x8d')][_0x86fe('0x3d')](_0x45a692[_0x86fe('0x8e')](),_0xaab5e9)[_0x86fe('0x2c')](function(_0x25c827){_0x45af13=_[_0x86fe('0x8f')](_0x25c827,'id');_0xaab5e9=_['merge'](_0xaab5e9,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5cbbea[_0x86fe('0x3d')]['fields']){_0x397e3a[_0x86fe('0x40')]['forEach'](function(_0xca943d){_0x2f3550[_0x86fe('0x49')]('c.'+_0xca943d);});}else{_0x2f3550['field'](_0x86fe('0x7b'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x90'));_0x2f3550['field']('c.lastName');_0x2f3550[_0x86fe('0x49')](_0x86fe('0x91'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x92'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x93'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x94'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x95'));_0x2f3550['field']('c.createdAt');_0x2f3550[_0x86fe('0x49')](_0x86fe('0x96'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x97'));_0x2f3550[_0x86fe('0x49')](_0x86fe('0x98'),_0x86fe('0x99'));}if(_0x397e3a[_0x86fe('0x25')])_0x2f3550[_0x86fe('0x25')](_0x397e3a['limit']);if(_0x397e3a[_0x86fe('0x23')])_0x2f3550[_0x86fe('0x23')](_0x397e3a[_0x86fe('0x23')]);return db[_0x86fe('0x8d')][_0x86fe('0x3d')](_0x2f3550['toString'](),_0xaab5e9);});})[_0x86fe('0x2c')](function(_0x5039fa){_0x5039fa['forEach'](function(_0x2d22f7){if(_0x2d22f7['TagIds']){_0x2d22f7[_0x86fe('0x9a')]=[];_0x2d22f7[_0x86fe('0x99')][_0x86fe('0x59')](',')[_0x86fe('0x5b')](function(_0x3cd31c){_0x2d22f7[_0x86fe('0x9a')][_0x86fe('0x36')](_0x45af13[_0x3cd31c]);});}delete _0x2d22f7[_0x86fe('0x99')];});_0x20eaac[_0x86fe('0x9b')]=_0x5039fa;return _0x20eaac;})[_0x86fe('0x2c')](respondWithFilteredResult(_0x3bee77,_0x397e3a));})['catch'](handleError(_0x3bee77,null));};exports[_0x86fe('0x9c')]=function(_0x430581,_0x5e7554){return db[_0x86fe('0x9d')][_0x86fe('0x56')]({'where':{'id':_0x430581[_0x86fe('0x9e')]['id']}})[_0x86fe('0x2c')](handleEntityNotFound(_0x5e7554,null))[_0x86fe('0x2c')](removeEntity(_0x5e7554,null))[_0x86fe('0x9f')](handleError(_0x5e7554,null));};exports[_0x86fe('0x32')]=function(_0x588949,_0x3f8649){return db['CmContact']['describe']()[_0x86fe('0x2c')](function(_0x489e30){delete _0x489e30[_0x86fe('0xa0')];for(var _0x2877a9=0x0;_0x2877a9<Object['keys'](_0x489e30)['length'];_0x2877a9++){var _0x3b4998=Object[_0x86fe('0x33')](_0x489e30)[_0x2877a9];if(!_['startsWith'](_0x3b4998,_0x86fe('0x35'))){_0x489e30[_0x3b4998][_0x86fe('0xa1')]=_0x3b4998;_0x489e30[_0x3b4998][_0x86fe('0xa2')]=_0x3b4998;}}return _0x489e30;})['then'](function(_0x27ebff){var _0x12ae79={'where':{'$or':[{'ListId':_0x588949[_0x86fe('0x3d')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x86fe('0x37')][_0x86fe('0xa3')](_0x12ae79)[_0x86fe('0x2c')](function(_0x167c56){for(var _0x16e0b2=0x0;_0x16e0b2<_0x167c56[_0x86fe('0x34')];_0x16e0b2++){var _0xb5f6ff='cf_'+_0x167c56[_0x16e0b2]['id'];_0x27ebff[_0xb5f6ff][_0x86fe('0xa1')]=_0xb5f6ff;_0x27ebff[_0xb5f6ff][_0x86fe('0xa2')]=_0x167c56[_0x16e0b2]['alias'];_0x27ebff[_0xb5f6ff]['custom']={'type':_0x167c56[_0x16e0b2][_0x86fe('0x3b')],'values':_0x167c56[_0x16e0b2][_0x86fe('0xa4')]};}Object[_0x86fe('0x33')](_0x27ebff)['forEach'](function(_0x36aa44){if(!_0x27ebff[_0x36aa44][_0x86fe('0x42')](_0x86fe('0xa1'))){delete _0x27ebff[_0x36aa44];}});return _0x27ebff;});})[_0x86fe('0x2c')](respondWithResult(_0x3f8649,null))['catch'](handleError(_0x3f8649,null));};exports[_0x86fe('0xa5')]=function(_0x57848f,_0x265fad){var _0x3f2135;var _0x2ef61f;var _0x3ec820;if(_0x57848f[_0x86fe('0xa6')]['id']){delete _0x57848f[_0x86fe('0xa6')]['id'];}return db[_0x86fe('0x9d')]['findAll']({'where':{'id':[_0x57848f['body']['to'],_0x57848f[_0x86fe('0xa6')][_0x86fe('0x4c')]]}})['then'](function(_0x594b85){if(_0x594b85){if(_0x594b85[_0x86fe('0x34')]!==0x2){return null;}_0x594b85[0x0]=_0x594b85[0x0][_0x86fe('0xa7')]({'plain':!![]});_0x594b85[0x1]=_0x594b85[0x1][_0x86fe('0xa7')]({'plain':!![]});delete _0x594b85[0x0]['id'];delete _0x594b85[0x1]['id'];return _[_0x86fe('0xa8')](_0x594b85[0x0],_0x594b85[0x1],function(_0x3f46f6,_0x59d49e){if(Array['isArray'](_0x59d49e)&&!_0x59d49e[_0x86fe('0x34')]){return _0x3f46f6;}else if(!_0x59d49e){return _0x3f46f6;}});}})[_0x86fe('0x2c')](handleEntityNotFound(_0x265fad,null))['then'](function(_0x330815){if(_0x330815){if(_0x330815[_0x86fe('0xa0')]&&_[_0x86fe('0x6c')](_0x330815[_0x86fe('0xa0')])){_0x330815[_0x86fe('0xa0')]=_0x330815[_0x86fe('0xa0')]['join']();}logger[_0x86fe('0xa9')](_0x86fe('0xaa'),_0x57848f['body']['to'],_0x57848f['body'][_0x86fe('0x4c')]);return db[_0x86fe('0xab')][_0x86fe('0x9c')]({'where':{'ContactId':[_0x57848f[_0x86fe('0xa6')]['to'],_0x57848f[_0x86fe('0xa6')]['from']]}})['then'](function(_0x32588d){logger[_0x86fe('0xa9')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x32588d);return db[_0x86fe('0xac')][_0x86fe('0x9c')]({'where':{'ContactId':[_0x57848f['body']['to'],_0x57848f[_0x86fe('0xa6')][_0x86fe('0x4c')]]}})['then'](function(_0xe07f5d){logger[_0x86fe('0xa9')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0xe07f5d);return db[_0x86fe('0x9d')][_0x86fe('0xad')](_0x330815);});});}})[_0x86fe('0x2c')](function(_0x142dd0){if(_0x142dd0){_0x3f2135=_0x142dd0;_0x2ef61f={'ContactId':_0x3f2135['id']};_0x3ec820={'where':{'ContactId':[_0x57848f[_0x86fe('0xa6')]['to'],_0x57848f[_0x86fe('0xa6')][_0x86fe('0x4c')]]}};return db[_0x86fe('0xae')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xaf')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb0')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb1')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb2')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb1')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb2')]['update'](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db['SmsInteraction']['update'](_0x2ef61f,_0x3ec820);}})['then'](function(){if(_0x3f2135){return db['SmsMessage'][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb3')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db['FaxMessage'][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})['then'](function(){if(_0x3f2135){return db[_0x86fe('0xb4')]['update'](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb5')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db['CmHopperFinal']['update'](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb6')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db['ReportAgentPreview'][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})['then'](function(){if(_0x3f2135){return db[_0x86fe('0xb7')]['update'](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb8')]['update'](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db['FaxQueueReport'][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xb9')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xba')]['update'](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xbb')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db['JscriptySessionReport'][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})['then'](function(){if(_0x3f2135){return db[_0x86fe('0xbc')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})['then'](function(){if(_0x3f2135){return db[_0x86fe('0xbd')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return db[_0x86fe('0xbe')][_0x86fe('0x2b')](_0x2ef61f,_0x3ec820);}})['then'](function(){if(_0x3f2135){return db['CmContact'][_0x86fe('0x9c')]({'where':{'id':[_0x57848f[_0x86fe('0xa6')]['to'],_0x57848f[_0x86fe('0xa6')][_0x86fe('0x4c')]]}});}})[_0x86fe('0x2c')](function(){if(_0x3f2135){return _0x3f2135;}})['then'](respondWithResult(_0x265fad,null))[_0x86fe('0x9f')](handleError(_0x265fad,null));};exports[_0x86fe('0xad')]=function(_0x1289e0,_0x493065){return db[_0x86fe('0x9d')][_0x86fe('0x32')]()['then'](function(_0x37ff62){if(_0x1289e0['body'][_0x86fe('0xa0')]&&_['isArray'](_0x1289e0[_0x86fe('0xa6')][_0x86fe('0xa0')])){if(_0x1289e0[_0x86fe('0xa6')]['tags']['length']){_0x1289e0[_0x86fe('0xa6')][_0x86fe('0xa0')]=_0x1289e0['body']['tags'][_0x86fe('0xbf')](';')+';';}else{_0x1289e0[_0x86fe('0xa6')]['tags']=null;}}else{_0x1289e0['body'][_0x86fe('0xa0')]=null;}return db[_0x86fe('0x9d')]['create'](_0x1289e0[_0x86fe('0xa6')],{'fields':_['keys'](_0x37ff62),'raw':!![]});})[_0x86fe('0x2c')](respondWithResult(_0x493065,0xc9))[_0x86fe('0x9f')](handleError(_0x493065,null));};exports[_0x86fe('0xc0')]=function(_0x17e366,_0x3ed4e0){var _0x4c6fb5=[];var _0x39b057=0x0;var _0x39b651=0x0;var _0x59d458=0x0;return db[_0x86fe('0x9d')][_0x86fe('0x32')]()[_0x86fe('0x2c')](function(_0xa79edb){return BPromise['each'](_0x17e366[_0x86fe('0xa6')],function(_0x4d97e4){var _0x1617ec={'where':{'$or':[]},'defaults':_0x4d97e4,'fields':_[_0x86fe('0x33')](_0xa79edb),'raw':!![]};if(_0x4d97e4[_0x86fe('0xc1')]){for(var _0x20b9d2=0x0;_0x20b9d2<_0x4d97e4[_0x86fe('0xc1')][_0x86fe('0x34')];_0x20b9d2++){var _0x37c30f={};_0x37c30f[_0x4d97e4['duplicates'][_0x20b9d2]]=_0x4d97e4[_0x4d97e4[_0x86fe('0xc1')][_0x20b9d2]];_0x1617ec[_0x86fe('0x46')]['$or'][_0x86fe('0x36')](_0x37c30f);}_0x1617ec['where']['ListId']=_0x4d97e4[_0x86fe('0x8c')];}return db['CmContact'][_0x86fe('0xc2')](_0x1617ec)['spread'](function(_0x3d4173,_0x47e34a){if(_0x47e34a){_0x39b057++;}else{_0x59d458++;}})['catch'](function(_0xc58320){console['error'](_0xc58320);_0x39b651++;});});})[_0x86fe('0x2c')](function(_0x344af4){if(_0x344af4){return{'success':_0x39b057,'failure':_0x39b651,'duplicates':_0x59d458};}})['then'](respondWithResult(_0x3ed4e0,0xc9))[_0x86fe('0x9f')](handleError(_0x3ed4e0,null));};exports[_0x86fe('0xc3')]=function(_0x1b6257,_0x5a9d92,_0x3a84e3){var _0x2ff01c;return db[_0x86fe('0x9d')][_0x86fe('0x32')]()[_0x86fe('0x2c')](function(_0x15a473){return db[_0x86fe('0x9d')][_0x86fe('0x56')]({'where':{'id':_0x1b6257[_0x86fe('0x9e')]['id']},'include':[{'model':db[_0x86fe('0x57')],'as':_0x86fe('0x9a'),'attributes':['id','name',_0x86fe('0x4a')],'required':_0x1b6257['query'][_0x86fe('0x6d')]?!![]:![]}],'attributes':_[_0x86fe('0x33')](_0x15a473)});})[_0x86fe('0x2c')](function(_0x357d4f){_0x2ff01c=_0x357d4f[_0x86fe('0xa7')]({'plain':!![]});var _0x3f9be7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x357d4f&&_0x357d4f[_0x86fe('0x8c')]){if(_0x357d4f[_0x86fe('0x8c')]){_0x3f9be7[_0x86fe('0x46')][_0x86fe('0xc4')][_0x86fe('0x36')]({'ListId':{'$ne':_0x357d4f[_0x86fe('0x8c')]}});}}return db[_0x86fe('0x37')][_0x86fe('0xa3')](_0x3f9be7);})['then'](function(_0xece3b3){return _['omit'](_0x2ff01c,_['map'](_0xece3b3,function(_0x572982){return util['format'](_0x86fe('0xc5'),_0x572982['id']);}));})[_0x86fe('0x2c')](handleEntityNotFound(_0x5a9d92,null))[_0x86fe('0x2c')](respondWithResult(_0x5a9d92,null))[_0x86fe('0x9f')](handleError(_0x5a9d92,null));};exports[_0x86fe('0x2b')]=function(_0x3fb714,_0x2535e7){var _0x3e2e4b;if(_0x3fb714['body']['id']){delete _0x3fb714['body']['id'];}return db['CmContact']['find']({'where':{'id':_0x3fb714[_0x86fe('0x9e')]['id']}})['then'](handleEntityNotFound(_0x2535e7,null))['then'](saveUpdates(_0x3fb714[_0x86fe('0xa6')],null))[_0x86fe('0x2c')](function(_0x3432e0){_0x3e2e4b=_0x3432e0;var _0x3f00a1={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3432e0&&_0x3432e0['ListId']){if(_0x3432e0[_0x86fe('0x8c')]){_0x3f00a1[_0x86fe('0x46')]['$and']['push']({'ListId':{'$ne':_0x3432e0['ListId']}});}}return db['CmCustomField'][_0x86fe('0xa3')](_0x3f00a1);})[_0x86fe('0x2c')](function(_0x479db4){if(_0x479db4){return _['omit'](_[_0x86fe('0xc6')](_0x3fb714[_0x86fe('0xa6')],function(_0x5b1be4,_0x4f2aaa){return _[_0x86fe('0xc7')](_0x4f2aaa,_0x86fe('0x35'));}),_[_0x86fe('0x5a')](_0x479db4,function(_0x38fddc){return util['format']('cf_%d',_0x38fddc['id']);}));}})[_0x86fe('0x2c')](function(_0x4f1e76){if(_0x4f1e76&&!_[_0x86fe('0x67')](_0x4f1e76)){var _0x3c0329=squel[_0x86fe('0x2b')]()[_0x86fe('0xc8')](_0x86fe('0x4d'))[_0x86fe('0xc9')](_0x4f1e76)[_0x86fe('0x46')](_0x86fe('0xca'),_0x3fb714['params']['id'])[_0x86fe('0xcb')]();return db['sequelize'][_0x86fe('0x3d')](_0x3c0329[_0x86fe('0x62')],{'replacements':_0x3c0329[_0x86fe('0xa4')]});}})[_0x86fe('0x2c')](function(){if(_0x3fb714[_0x86fe('0xa6')][_0x86fe('0xcc')]&&_0x3e2e4b){return db[_0x86fe('0xab')][_0x86fe('0x2b')]({'phone':_0x3fb714[_0x86fe('0xa6')][_0x86fe('0xcc')]},{'where':{'ContactId':_0x3e2e4b['id']}});}})['then'](function(){return _0x3e2e4b;})[_0x86fe('0x2c')](respondWithResult(_0x2535e7,null))[_0x86fe('0x9f')](handleError(_0x2535e7,null));};exports[_0x86fe('0xcd')]=function(_0xa8eb41,_0xc4025,_0x52da71){var _0x513c45={};var _0x1518ae={};var _0x2051d7;var _0x5857bf;return db['CmContact'][_0x86fe('0x38')]({'where':{'id':_0xa8eb41[_0x86fe('0x9e')]['id']}})['then'](handleEntityNotFound(_0xc4025,null))['then'](function(_0xbdfe78){if(_0xbdfe78){_0x2051d7=_0xbdfe78;_0x1518ae[_0x86fe('0x3c')]=_['keys'](db[_0x86fe('0x57')][_0x86fe('0xce')]);_0x1518ae[_0x86fe('0x3d')]=_[_0x86fe('0x33')](_0xa8eb41[_0x86fe('0x3d')]);_0x1518ae[_0x86fe('0x3e')]=_[_0x86fe('0x3f')](_0x1518ae[_0x86fe('0x3c')],_0x1518ae[_0x86fe('0x3d')]);_0x513c45[_0x86fe('0x40')]=_['intersection'](_0x1518ae['model'],qs[_0x86fe('0x41')](_0xa8eb41[_0x86fe('0x3d')][_0x86fe('0x41')]));_0x513c45['attributes']=_0x513c45[_0x86fe('0x40')][_0x86fe('0x34')]?_0x513c45[_0x86fe('0x40')]:_0x1518ae[_0x86fe('0x3c')];_0x513c45[_0x86fe('0x44')]=qs['sort'](_0xa8eb41[_0x86fe('0x3d')][_0x86fe('0x45')]);_0x513c45[_0x86fe('0x46')]=qs[_0x86fe('0x3e')](_[_0x86fe('0x47')](_0xa8eb41[_0x86fe('0x3d')],_0x1518ae['filters']));if(_0xa8eb41[_0x86fe('0x3d')][_0x86fe('0x64')]){_0x513c45[_0x86fe('0x46')]=_['merge'](_0x513c45[_0x86fe('0x46')],{'$or':_[_0x86fe('0x5a')](_0x513c45[_0x86fe('0x40')],function(_0x3ffc4f){var _0x136fa7={};_0x136fa7[_0x3ffc4f]={'$like':'%'+_0xa8eb41[_0x86fe('0x3d')][_0x86fe('0x64')]+'%'};return _0x136fa7;})});}_0x513c45=_[_0x86fe('0xa5')]({},_0x513c45,_0xa8eb41[_0x86fe('0xcf')]);return _0x2051d7['getTags'](_0x513c45);}})[_0x86fe('0x2c')](function(_0x183e7b){if(_0x183e7b){_0x5857bf=_0x183e7b[_0x86fe('0x34')];if(!_0xa8eb41['query'][_0x86fe('0x42')](_0x86fe('0x43'))){_0x513c45[_0x86fe('0x25')]=qs[_0x86fe('0x25')](_0xa8eb41[_0x86fe('0x3d')][_0x86fe('0x25')]);_0x513c45[_0x86fe('0x23')]=qs[_0x86fe('0x23')](_0xa8eb41[_0x86fe('0x3d')][_0x86fe('0x23')]);}return _0x2051d7[_0x86fe('0xcd')](_0x513c45);}})['then'](function(_0x1756b9){if(_0x1756b9){return _0x1756b9?{'count':_0x5857bf,'rows':_0x1756b9}:null;}})[_0x86fe('0x2c')](respondWithResult(_0xc4025,null))[_0x86fe('0x9f')](handleError(_0xc4025,null));};exports[_0x86fe('0xd0')]=function(_0x273cf2,_0x40a294,_0x331ec6){if(_0x273cf2[_0x86fe('0xa6')]['id']){delete _0x273cf2[_0x86fe('0xa6')]['id'];}return db[_0x86fe('0x9d')][_0x86fe('0x38')]({'where':{'id':_0x273cf2[_0x86fe('0x9e')]['id']}})[_0x86fe('0x2c')](handleEntityNotFound(_0x40a294,null))[_0x86fe('0x2c')](function(_0x3f6e1f){if(_0x3f6e1f){return _0x3f6e1f[_0x86fe('0xd0')](_0x273cf2[_0x86fe('0xa6')][_0x86fe('0xd1')]||[]);}return null;})[_0x86fe('0x2c')](respondWithResult(_0x40a294,null))['catch'](handleError(_0x40a294,null));};exports[_0x86fe('0xd2')]=function(_0x49df55,_0xadb749,_0x3dc8a0){var _0x45f0b8={'raw':![],'where':{}};var _0x1c78a7={};var _0x48ee88={'count':0x0,'rows':[]};return db[_0x86fe('0x9d')][_0x86fe('0x38')]({'where':{'id':_0x49df55[_0x86fe('0x9e')]['id']}})[_0x86fe('0x2c')](handleEntityNotFound(_0xadb749,null))[_0x86fe('0x2c')](function(_0x3961a6){if(_0x3961a6){_0x1c78a7[_0x86fe('0x3c')]=_['keys'](db[_0x86fe('0xab')][_0x86fe('0xce')]);_0x1c78a7['query']=_['keys'](_0x49df55[_0x86fe('0x3d')]);_0x1c78a7[_0x86fe('0x3e')]=_[_0x86fe('0x3f')](_0x1c78a7[_0x86fe('0x3c')],_0x1c78a7[_0x86fe('0x3d')]);_0x45f0b8[_0x86fe('0x40')]=_[_0x86fe('0x3f')](_0x1c78a7[_0x86fe('0x3c')],qs[_0x86fe('0x41')](_0x49df55['query'][_0x86fe('0x41')]));_0x45f0b8[_0x86fe('0x40')]=_0x45f0b8[_0x86fe('0x40')]['length']?_0x45f0b8[_0x86fe('0x40')]:_0x1c78a7[_0x86fe('0x3c')];if(!_0x49df55[_0x86fe('0x3d')][_0x86fe('0x42')](_0x86fe('0x43'))){_0x45f0b8['limit']=qs['limit'](_0x49df55[_0x86fe('0x3d')][_0x86fe('0x25')]);_0x45f0b8[_0x86fe('0x23')]=qs[_0x86fe('0x23')](_0x49df55[_0x86fe('0x3d')]['offset']);}_0x45f0b8[_0x86fe('0x44')]=qs[_0x86fe('0x45')](_0x49df55[_0x86fe('0x3d')][_0x86fe('0x45')]);_0x45f0b8[_0x86fe('0x46')]=qs[_0x86fe('0x3e')](_[_0x86fe('0x47')](_0x49df55['query'],_0x1c78a7[_0x86fe('0x3e')]));_0x45f0b8[_0x86fe('0x46')][_0x86fe('0xd3')]=_0x3961a6['id'];if(_0x49df55[_0x86fe('0x3d')][_0x86fe('0x64')]){_0x45f0b8[_0x86fe('0x46')]=_[_0x86fe('0xa5')](_0x45f0b8['where'],{'$or':_[_0x86fe('0x5a')](_0x45f0b8[_0x86fe('0x40')],function(_0x5dffe9){var _0x2bd6cf={};_0x2bd6cf[_0x5dffe9]={'$like':'%'+_0x49df55[_0x86fe('0x3d')][_0x86fe('0x64')]+'%'};return _0x2bd6cf;})});}_0x45f0b8=_['merge']({},_0x45f0b8,_0x49df55[_0x86fe('0xcf')]);return db['CmHopper'][_0x86fe('0x26')]({'where':_0x45f0b8['where']})['then'](function(_0x3a544d){_0x48ee88['count']=_0x3a544d;if(_0x49df55[_0x86fe('0x3d')]['includeAll']){_0x45f0b8[_0x86fe('0xd4')]=[{'all':!![]}];}return db[_0x86fe('0xab')]['findAll'](_0x45f0b8);})['then'](function(_0x4a97b8){_0x48ee88['rows']=_0x4a97b8;return _0x48ee88;});}})[_0x86fe('0x2c')](respondWithFilteredResult(_0xadb749,_0x45f0b8))['catch'](handleError(_0xadb749,null));};exports[_0x86fe('0xd5')]=function(_0x3458c7,_0x56031e,_0x30d998){var _0x7f6d29={'raw':!![],'where':{}};var _0x18999d={};var _0x250148={'count':0x0,'rows':[]};return db[_0x86fe('0x9d')]['findOne']({'where':{'id':_0x3458c7[_0x86fe('0x9e')]['id']}})['then'](handleEntityNotFound(_0x56031e,null))[_0x86fe('0x2c')](function(_0x1f4bdc){if(_0x1f4bdc){_0x18999d[_0x86fe('0x3c')]=_[_0x86fe('0x33')](db[_0x86fe('0xb6')][_0x86fe('0xce')]);_0x18999d['query']=_[_0x86fe('0x33')](_0x3458c7[_0x86fe('0x3d')]);_0x18999d[_0x86fe('0x3e')]=_[_0x86fe('0x3f')](_0x18999d[_0x86fe('0x3c')],_0x18999d[_0x86fe('0x3d')]);_0x7f6d29['attributes']=_['intersection'](_0x18999d[_0x86fe('0x3c')],qs[_0x86fe('0x41')](_0x3458c7[_0x86fe('0x3d')][_0x86fe('0x41')]));_0x7f6d29[_0x86fe('0x40')]=_0x7f6d29[_0x86fe('0x40')][_0x86fe('0x34')]?_0x7f6d29[_0x86fe('0x40')]:_0x18999d['model'];if(!_0x3458c7[_0x86fe('0x3d')]['hasOwnProperty'](_0x86fe('0x43'))){_0x7f6d29[_0x86fe('0x25')]=qs[_0x86fe('0x25')](_0x3458c7['query'][_0x86fe('0x25')]);_0x7f6d29[_0x86fe('0x23')]=qs[_0x86fe('0x23')](_0x3458c7['query'][_0x86fe('0x23')]);}_0x7f6d29[_0x86fe('0x44')]=qs[_0x86fe('0x45')](_0x3458c7['query'][_0x86fe('0x45')]);_0x7f6d29[_0x86fe('0x46')]=qs[_0x86fe('0x3e')](_[_0x86fe('0x47')](_0x3458c7['query'],_0x18999d[_0x86fe('0x3e')]));_0x7f6d29[_0x86fe('0x46')]['ContactId']=_0x1f4bdc['id'];if(_0x3458c7['query']['filter']){_0x7f6d29[_0x86fe('0x46')]=_[_0x86fe('0xa5')](_0x7f6d29[_0x86fe('0x46')],{'$or':_['map'](_0x7f6d29[_0x86fe('0x40')],function(_0x4daaef){var _0x501c42={};_0x501c42[_0x4daaef]={'$like':'%'+_0x3458c7[_0x86fe('0x3d')][_0x86fe('0x64')]+'%'};return _0x501c42;})});}_0x7f6d29=_[_0x86fe('0xa5')]({},_0x7f6d29,_0x3458c7[_0x86fe('0xcf')]);return db[_0x86fe('0xb6')][_0x86fe('0x26')]({'where':_0x7f6d29['where']})[_0x86fe('0x2c')](function(_0x1b81fc){_0x250148[_0x86fe('0x26')]=_0x1b81fc;if(_0x3458c7['query'][_0x86fe('0xd6')]){_0x7f6d29['include']=[{'all':!![]}];}return db[_0x86fe('0xb6')][_0x86fe('0xa3')](_0x7f6d29);})[_0x86fe('0x2c')](function(_0x51b32a){_0x250148[_0x86fe('0x9b')]=_0x51b32a;return _0x250148;});}})[_0x86fe('0x2c')](respondWithFilteredResult(_0x56031e,_0x7f6d29))[_0x86fe('0x9f')](handleError(_0x56031e,null));};exports['getHopperFinals']=function(_0x401751,_0xa03d55,_0x4003cb){var _0x3c9f43={'raw':!![],'where':{}};var _0x516342={};var _0x1ff68f={'count':0x0,'rows':[]};return db[_0x86fe('0x9d')][_0x86fe('0x38')]({'where':{'id':_0x401751[_0x86fe('0x9e')]['id']}})['then'](handleEntityNotFound(_0xa03d55,null))['then'](function(_0xad7ed0){if(_0xad7ed0){_0x516342[_0x86fe('0x3c')]=_[_0x86fe('0x33')](db['CmHopperFinal']['rawAttributes']);_0x516342[_0x86fe('0x3d')]=_[_0x86fe('0x33')](_0x401751['query']);_0x516342[_0x86fe('0x3e')]=_[_0x86fe('0x3f')](_0x516342['model'],_0x516342[_0x86fe('0x3d')]);_0x3c9f43[_0x86fe('0x40')]=_[_0x86fe('0x3f')](_0x516342[_0x86fe('0x3c')],qs[_0x86fe('0x41')](_0x401751[_0x86fe('0x3d')]['fields']));_0x3c9f43[_0x86fe('0x40')]=_0x3c9f43[_0x86fe('0x40')][_0x86fe('0x34')]?_0x3c9f43[_0x86fe('0x40')]:_0x516342[_0x86fe('0x3c')];if(!_0x401751[_0x86fe('0x3d')][_0x86fe('0x42')](_0x86fe('0x43'))){_0x3c9f43[_0x86fe('0x25')]=qs['limit'](_0x401751[_0x86fe('0x3d')]['limit']);_0x3c9f43[_0x86fe('0x23')]=qs['offset'](_0x401751['query'][_0x86fe('0x23')]);}_0x3c9f43['order']=qs['sort'](_0x401751[_0x86fe('0x3d')][_0x86fe('0x45')]);_0x3c9f43[_0x86fe('0x46')]=qs['filters'](_[_0x86fe('0x47')](_0x401751['query'],_0x516342[_0x86fe('0x3e')]));_0x3c9f43[_0x86fe('0x46')][_0x86fe('0xd3')]=_0xad7ed0['id'];if(_0x401751[_0x86fe('0x3d')][_0x86fe('0x64')]){_0x3c9f43[_0x86fe('0x46')]=_[_0x86fe('0xa5')](_0x3c9f43[_0x86fe('0x46')],{'$or':_['map'](_0x3c9f43['attributes'],function(_0x5dc179){var _0x3ef04f={};_0x3ef04f[_0x5dc179]={'$like':'%'+_0x401751[_0x86fe('0x3d')][_0x86fe('0x64')]+'%'};return _0x3ef04f;})});}_0x3c9f43=_[_0x86fe('0xa5')]({},_0x3c9f43,_0x401751[_0x86fe('0xcf')]);return db[_0x86fe('0xd7')][_0x86fe('0x26')]({'where':_0x3c9f43[_0x86fe('0x46')]})[_0x86fe('0x2c')](function(_0x4f8557){_0x1ff68f[_0x86fe('0x26')]=_0x4f8557;if(_0x401751['query']['includeAll']){_0x3c9f43[_0x86fe('0xd4')]=[{'all':!![]}];}return db[_0x86fe('0xd7')][_0x86fe('0xa3')](_0x3c9f43);})[_0x86fe('0x2c')](function(_0x21c172){_0x1ff68f['rows']=_0x21c172;return _0x1ff68f;});}})[_0x86fe('0x2c')](respondWithFilteredResult(_0xa03d55,_0x3c9f43))[_0x86fe('0x9f')](handleError(_0xa03d55,null));};exports[_0x86fe('0xd8')]=function(_0xdb0040,_0x114bdb,_0x262a63){var _0x20019b={'raw':!![],'where':{}};var _0x336380={};var _0x105e9d={'count':0x0,'rows':[]};return db[_0x86fe('0x9d')]['findOne']({'where':{'id':_0xdb0040[_0x86fe('0x9e')]['id']}})[_0x86fe('0x2c')](handleEntityNotFound(_0x114bdb,null))[_0x86fe('0x2c')](function(_0x1b0b5c){if(_0x1b0b5c){_0x336380[_0x86fe('0x3c')]=_[_0x86fe('0x33')](db[_0x86fe('0xd9')][_0x86fe('0xce')]);_0x336380['query']=_[_0x86fe('0x33')](_0xdb0040[_0x86fe('0x3d')]);_0x336380['filters']=_[_0x86fe('0x3f')](_0x336380[_0x86fe('0x3c')],_0x336380[_0x86fe('0x3d')]);_0x20019b[_0x86fe('0x40')]=_[_0x86fe('0x3f')](_0x336380[_0x86fe('0x3c')],qs[_0x86fe('0x41')](_0xdb0040['query'][_0x86fe('0x41')]));_0x20019b[_0x86fe('0x40')]=_0x20019b[_0x86fe('0x40')]['length']?_0x20019b[_0x86fe('0x40')]:_0x336380['model'];if(!_0xdb0040[_0x86fe('0x3d')]['hasOwnProperty'](_0x86fe('0x43'))){_0x20019b[_0x86fe('0x25')]=qs[_0x86fe('0x25')](_0xdb0040[_0x86fe('0x3d')][_0x86fe('0x25')]);_0x20019b[_0x86fe('0x23')]=qs[_0x86fe('0x23')](_0xdb0040[_0x86fe('0x3d')]['offset']);}_0x20019b['order']=qs['sort'](_0xdb0040[_0x86fe('0x3d')][_0x86fe('0x45')]);_0x20019b['where']=qs[_0x86fe('0x3e')](_['pick'](_0xdb0040['query'],_0x336380[_0x86fe('0x3e')]));_0x20019b[_0x86fe('0x46')]['ContactId']=_0x1b0b5c['id'];if(_0xdb0040[_0x86fe('0x3d')][_0x86fe('0x64')]){_0x20019b['where']=_[_0x86fe('0xa5')](_0x20019b['where'],{'$or':_['map'](_0x20019b[_0x86fe('0x40')],function(_0x4bade3){var _0x18b96e={};_0x18b96e[_0x4bade3]={'$like':'%'+_0xdb0040[_0x86fe('0x3d')]['filter']+'%'};return _0x18b96e;})});}_0x20019b=_[_0x86fe('0xa5')]({},_0x20019b,_0xdb0040[_0x86fe('0xcf')]);return db['JscriptySessionReport'][_0x86fe('0x26')]({'where':_0x20019b[_0x86fe('0x46')]})[_0x86fe('0x2c')](function(_0x4fafdf){_0x105e9d[_0x86fe('0x26')]=_0x4fafdf;if(_0xdb0040['query'][_0x86fe('0xd6')]){_0x20019b['include']=[{'all':!![]}];}return db[_0x86fe('0xd9')][_0x86fe('0xa3')](_0x20019b);})[_0x86fe('0x2c')](function(_0x325b70){_0x105e9d[_0x86fe('0x9b')]=_0x325b70;return _0x105e9d;});}})[_0x86fe('0x2c')](respondWithFilteredResult(_0x114bdb,_0x20019b))[_0x86fe('0x9f')](handleError(_0x114bdb,null));};exports[_0x86fe('0xda')]=function(_0x22d6b5,_0x16bbe9,_0x2ded19){try{if(!_0x22d6b5[_0x86fe('0xa6')]['ListId']){throw new Error(_0x86fe('0xdb'));}if(!_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0xdc')]){throw new Error(_0x86fe('0xdd'));}if(!_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0xde')]){throw new Error(_0x86fe('0xdf'));}if(!_0x22d6b5['body'][_0x86fe('0xe0')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x36e0f6=_0x22d6b5['body'][_0x86fe('0xdc')][_0x86fe('0x59')](',');var _0x29cea0=_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0xde')][_0x86fe('0x59')](',');if(!_0x36e0f6[_0x86fe('0x34')]||!_0x29cea0[_0x86fe('0x34')]||_0x36e0f6[_0x86fe('0x34')]!==_0x29cea0[_0x86fe('0x34')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0x41')]=_['zipObject'](_0x36e0f6,_0x29cea0);if(!_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0x41')]['phone']){throw new Error(_0x86fe('0xe1'));}if(!_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0x41')][_0x86fe('0xe2')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x468415=path[_0x86fe('0xbf')](config[_0x86fe('0xe3')],_0x86fe('0xe4'),_0x22d6b5[_0x86fe('0xe5')][_0x86fe('0xe6')]);fs['chmodSync'](_0x468415,parseInt(_0x86fe('0xe7'),0x8));var _0xc80c60=require('child_process')['fork'](path['join'](__dirname,_0x86fe('0xe8')),[_0x468415,_0x22d6b5[_0x86fe('0xa6')]['binding_keys'],_0x22d6b5[_0x86fe('0xa6')]['binding_values'],_0x22d6b5['body'][_0x86fe('0x8c')],_0x22d6b5['body'][_0x86fe('0xe9')],_0x22d6b5[_0x86fe('0xa6')][_0x86fe('0xc1')],_0x22d6b5['body'][_0x86fe('0xe0')]]);return _0x16bbe9['status'](0xc8)[_0x86fe('0x22')]({'message':'File\x20uploaded\x20correctly!','pid':_0xc80c60[_0x86fe('0xea')]});}catch(_0xebea86){return _0x16bbe9[_0x86fe('0x20')](0x1f4)[_0x86fe('0x30')](_0xebea86);}};exports[_0x86fe('0xeb')]=function(_0x444a18,_0x70bbe5,_0x52b74d){var _0xa57468=fs[_0x86fe('0xec')](_0x444a18[_0x86fe('0xe5')][_0x86fe('0x8')]);Papa[_0x86fe('0xed')](_0xa57468,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x329bbd){return _0x70bbe5['status'](0xc8)['json']({'file':_0x444a18[_0x86fe('0xe5')],'fields':_0x329bbd[_0x86fe('0xee')][_0x86fe('0x41')]});}});};exports[_0x86fe('0xef')]=function(_0xf7f40,_0x29cd94,_0x34a4c9){return db[_0x86fe('0x87')][_0x86fe('0xa3')]({'raw':!![],'attributes':['id'],'where':{'role':_0x86fe('0x84')}})[_0x86fe('0x2c')](function(_0x5e4dd){var _0x22e12c=![];if(!_0xf7f40['body'][_0x86fe('0x8c')]){throw new Error('No\x20ListId\x20specified');}if(!_0xf7f40['body']['binding'][_0x86fe('0xcc')]){throw new Error(_0x86fe('0xe1'));}if(!_0xf7f40[_0x86fe('0xa6')][_0x86fe('0xf0')][_0x86fe('0xe2')]){throw new Error(_0x86fe('0xf1'));}if(!_0xf7f40[_0x86fe('0xa6')][_0x86fe('0xe0')]){throw new Error(_0x86fe('0xf2'));}var _0x38f2a3=require(_0x86fe('0xf3'))[_0x86fe('0xf4')](path[_0x86fe('0xbf')](__dirname,_0x86fe('0xf5')),[_0xf7f40[_0x86fe('0x9e')]['id'],JSON['stringify'](_0xf7f40[_0x86fe('0xa6')]),JSON[_0x86fe('0xf6')](_0x5e4dd)]);_0x38f2a3['on']('message',function(_0x2028f2){_0x22e12c=!![];return _0x29cd94[_0x86fe('0x20')](0xc8)['json']({'message':_0x86fe('0xf7'),'pid':_0x38f2a3['pid']});});_0x38f2a3['on']('exit',function(_0x3175bc){if(_0x3175bc&&!_0x22e12c){return _0x29cd94[_0x86fe('0x20')](0x1f4)['json']({'message':_0x86fe('0xf8'),'pid':_0x38f2a3['pid']});}});})['catch'](handleError(_0x29cd94,null));};exports[_0x86fe('0xf9')]=function(_0x3d698d,_0x2fda49){var _0x157712=['mail',_0x86fe('0xfa'),'sms',_0x86fe('0xfb'),_0x86fe('0xfc'),_0x86fe('0xfd'),_0x86fe('0xfe')];var _0x11c4b4={'offset':0x0,'order':qs[_0x86fe('0x45')](_0x86fe('0xff'))},_0x396d6e={'count':0x0,'rows':[]};Promise[_0x86fe('0x83')]()[_0x86fe('0x2c')](function(){if(_0x3d698d[_0x86fe('0x3d')][_0x86fe('0x100')]){if(!_[_0x86fe('0x101')](_0x157712,_0x3d698d[_0x86fe('0x3d')][_0x86fe('0x100')][_0x86fe('0x102')]())){throw new Error(_0x86fe('0x103'));}_0x157712=[_0x3d698d['query'][_0x86fe('0x100')][_0x86fe('0x102')]()];}if(_0x3d698d['query'][_0x86fe('0x104')]){try{var _0x55ae72=JSON[_0x86fe('0xed')](_0x3d698d[_0x86fe('0x3d')][_0x86fe('0x104')]);if(!moment(_0x55ae72['from'])[_0x86fe('0x105')]()){throw new Error(_0x86fe('0x106'));}if(!moment(_0x55ae72['to'])[_0x86fe('0x105')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x4514e6){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x3d698d[_0x86fe('0x3d')][_0x86fe('0x42')]('nolimit')){_0x11c4b4[_0x86fe('0x25')]=qs[_0x86fe('0x25')](_0x3d698d[_0x86fe('0x3d')]['limit']||0xa);_0x11c4b4[_0x86fe('0x23')]=qs[_0x86fe('0x23')](_0x3d698d[_0x86fe('0x3d')]['offset']);}var _0x311c6f=_0x157712[_0x86fe('0x5a')](function(_0x12a095){if(_0x12a095===_0x86fe('0xfe')){var _0x35e2c4={'attributes':['id',_0x86fe('0x107'),'type','source',_0x86fe('0x108'),'callerid',_0x86fe('0x109'),_0x86fe('0x10a'),_0x86fe('0x10b'),_0x86fe('0x10c'),'createdAt',_0x86fe('0x10d'),'userSecondDisposition','userThirdDisposition',_0x86fe('0x10e')],'where':{'ContactId':_0x3d698d[_0x86fe('0x9e')]['id']},'include':[{'model':db[_0x86fe('0x87')],'as':_0x86fe('0x87'),'attributes':['id','name','fullname',_0x86fe('0x10f')]}],'order':[[_0x86fe('0x110'),'DESC']]};if(_0x3d698d[_0x86fe('0x3d')][_0x86fe('0x104')]){_0x35e2c4['where'][_0x86fe('0x110')]={'$gte':_0x55ae72['from'],'$lte':_0x55ae72['to']};}return db[_0x86fe('0xb7')][_0x86fe('0x111')](_0x35e2c4)[_0x86fe('0x2c')](function(_0xa616b2){_0x396d6e[_0x86fe('0x26')]+=_0xa616b2[_0x86fe('0x26')];return _[_0x86fe('0x5a')](_0xa616b2[_0x86fe('0x9b')],function(_0x1d8016){var _0x195fcb=_0x1d8016[_0x86fe('0xa7')]({'plain':!![]});_0x195fcb['channel']=_0x12a095;if(_0x195fcb[_0x86fe('0x87')]){_0x195fcb[_0x86fe('0x87')]={'id':_0x195fcb[_0x86fe('0x87')]['id'],'name':_0x195fcb[_0x86fe('0x87')][_0x86fe('0x2f')],'fullname':_0x195fcb[_0x86fe('0x87')][_0x86fe('0x112')],'alias':_0x195fcb[_0x86fe('0x87')][_0x86fe('0x10f')]};}return _0x195fcb;});});}else{var _0x569026=_[_0x86fe('0x113')](_0x12a095)+(_0x12a095==='chat'?_0x86fe('0x114'):_0x86fe('0x115'));var _0x454a32={'attributes':['id',_0x86fe('0x116'),_0x86fe('0x117'),_0x86fe('0x110'),_0x86fe('0x10c'),_0x86fe('0x118'),'secondDisposition',_0x86fe('0x119'),_0x86fe('0x10e'),_0x569026+'Id'],'where':{'ContactId':_0x3d698d[_0x86fe('0x9e')]['id']},'include':[{'model':db[_0x569026],'as':'Account','attributes':['id',_0x86fe('0x2f'),'key']},{'model':db[_0x86fe('0x87')],'as':'Owner','attributes':['id',_0x86fe('0x2f'),_0x86fe('0x112')]},{'model':db[_0x86fe('0x57')],'as':_0x86fe('0x9a'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[[_0x86fe('0x110'),_0x86fe('0x80')]]};if(_0x3d698d[_0x86fe('0x3d')][_0x86fe('0x104')]){_0x454a32[_0x86fe('0x46')][_0x86fe('0x110')]={'$gte':_0x55ae72[_0x86fe('0x4c')],'$lte':_0x55ae72['to']};}switch(_0x12a095){case _0x86fe('0xfa'):_0x454a32[_0x86fe('0x40')][_0x86fe('0x36')]('browserName',_0x86fe('0x11a'),_0x86fe('0x11b'),'deviceModel',_0x86fe('0x11c'),'ratingMessage',_0x86fe('0x11d'),_0x86fe('0x11e'),_0x86fe('0x11f'));break;case _0x86fe('0x120'):_0x454a32['attributes'][_0x86fe('0x36')]('subject',_0x86fe('0x121'));break;case _0x86fe('0xfb'):_0x454a32[_0x86fe('0x40')][_0x86fe('0x36')]('externalUrl',_0x86fe('0x122'));break;}return db[_[_0x86fe('0x113')](_0x12a095)+_0x86fe('0x123')][_0x86fe('0x111')](_0x454a32)[_0x86fe('0x2c')](function(_0x1ea42b){_0x396d6e['count']+=_0x1ea42b[_0x86fe('0x26')];return _[_0x86fe('0x5a')](_0x1ea42b['rows'],function(_0x41d818){var _0x59ab22=_0x41d818[_0x86fe('0xa7')]({'plain':!![]});_0x59ab22['channel']=_0x12a095;if(_0x59ab22[_0x86fe('0x124')]){_0x59ab22[_0x86fe('0x124')]={'id':_0x59ab22[_0x86fe('0x124')]['id'],'name':_0x59ab22[_0x86fe('0x124')]['name'],'fullname':_0x59ab22[_0x86fe('0x124')][_0x86fe('0x112')]};}return _0x59ab22;});});}});return Promise[_0x86fe('0x39')](_0x311c6f);})[_0x86fe('0x2c')](function(_0x54f66d){return _(_0x54f66d)[_0x86fe('0x125')]()[_0x86fe('0x126')](_0x86fe('0x110'))['reverse']()[_0x86fe('0x58')]();})[_0x86fe('0x2c')](function(_0x1a571a){_0x396d6e[_0x86fe('0x9b')]=_0x11c4b4[_0x86fe('0x25')]?_0x1a571a[_0x86fe('0x127')](_0x11c4b4[_0x86fe('0x23')],_0x11c4b4[_0x86fe('0x23')]+_0x11c4b4[_0x86fe('0x25')]):_0x1a571a;return _0x396d6e;})[_0x86fe('0x2c')](respondWithFilteredResult(_0x2fda49,_0x11c4b4))['catch'](handleError(_0x2fda49,null));};
\ No newline at end of file
index 871e6f6..9fa76d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f60=['hook','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x643943,_0x3c75ab){var _0x4dd404=function(_0xf9de7b){while(--_0xf9de7b){_0x643943['push'](_0x643943['shift']());}};_0x4dd404(++_0x3c75ab);}(_0x3f60,0xb0));var _0x03f6=function(_0x27f5de,_0x577080){_0x27f5de=_0x27f5de-0x0;var _0x484149=_0x3f60[_0x27f5de];return _0x484149;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x03f6('0x0')](0x0);var events={'afterCreate':_0x03f6('0x1'),'afterUpdate':_0x03f6('0x2'),'afterDestroy':_0x03f6('0x3')};function emitEvent(_0x324c65){return function(_0x456e67,_0x45813c,_0x2c00df){CmContactEvents[_0x03f6('0x4')](_0x324c65+':'+_0x456e67['id'],_0x456e67);CmContactEvents[_0x03f6('0x4')](_0x324c65,_0x456e67);_0x2c00df(null);};}for(var e in events){if(events[_0x03f6('0x5')](e)){var event=events[e];CmContact[_0x03f6('0x6')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0xa98f=['exports','events','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x3c2ee4,_0x32558f){var _0x3f6362=function(_0x38dab8){while(--_0x38dab8){_0x3c2ee4['push'](_0x3c2ee4['shift']());}};_0x3f6362(++_0x32558f);}(_0xa98f,0x6a));var _0xfa98=function(_0x26bcff,_0x1bf100){_0x26bcff=_0x26bcff-0x0;var _0xb14b0d=_0xa98f[_0x26bcff];return _0xb14b0d;};'use strict';var EventEmitter=require(_0xfa98('0x0'));var CmContact=require(_0xfa98('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa98('0x2'),'afterDestroy':'remove'};function emitEvent(_0x50be03){return function(_0x370168,_0x1b0860,_0x259d68){CmContactEvents[_0xfa98('0x3')](_0x50be03+':'+_0x370168['id'],_0x370168);CmContactEvents['emit'](_0x50be03,_0x370168);_0x259d68(null);};}for(var e in events){if(events[_0xfa98('0x4')](e)){var event=events[e];CmContact[_0xfa98('0x5')](e,emitEvent(event));}}module[_0xfa98('0x6')]=CmContactEvents;
\ No newline at end of file
index 90fac7a..4e65e6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc782=['YYYY-MM-DD\x20HH:mm:ss','catch','CmHopperFinal','then','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','scheduledat','cmContact','\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','length','always','onlyIfOpen','outbound','BlackLists','cmContact,\x20%s,\x20%s','message','Campaign','CmHopperBlack','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','fax','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','findOne','isNil','cmContact,\x20afterCreate\x20','CmHopper','create','ListId','priority','format','callbackUniqueid'];(function(_0x113bcf,_0x39c7d1){var _0x1bff1d=function(_0x1f62d9){while(--_0x1f62d9){_0x113bcf['push'](_0x113bcf['shift']());}};_0x1bff1d(++_0x39c7d1);}(_0xc782,0x130));var _0x2c78=function(_0x5e6fe1,_0x8f80ad){_0x5e6fe1=_0x5e6fe1-0x0;var _0x5a6018=_0xc782[_0x5e6fe1];return _0x5a6018;};'use strict';var _=require(_0x2c78('0x0'));var util=require('util');var logger=require(_0x2c78('0x1'))(_0x2c78('0x2'));var moment=require(_0x2c78('0x3'));var BPromise=require(_0x2c78('0x4'));var rp=require(_0x2c78('0x5'));var fs=require('fs');var path=require(_0x2c78('0x6'));var rimraf=require(_0x2c78('0x7'));var config=require(_0x2c78('0x8'));var attributes=require(_0x2c78('0x9'));module[_0x2c78('0xa')]=function(_0x5bbcc0,_0x5a8fe0){return _0x5bbcc0[_0x2c78('0xb')](_0x2c78('0xc'),attributes,{'tableName':_0x2c78('0xd'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x2c78('0xe')]},{'name':_0x2c78('0xf'),'fields':[_0x2c78('0x10'),'lastName',_0x2c78('0xe'),_0x2c78('0x11'),_0x2c78('0x12'),'email'],'type':_0x2c78('0x13')}],'timestamps':!![],'charset':_0x2c78('0x14'),'collate':_0x2c78('0x15'),'hooks':{'afterCreate':function(_0x3b1f28,_0x4c6d0b,_0x30c84a){var _0x2014ba=_0x5bbcc0[_0x2c78('0x16')];var _0x20ee2d=_0x3b1f28[_0x2c78('0x17')]({'plain':!![]});function _0x37293c(){return function(_0x16de0e){logger[_0x2c78('0x18')]('cmContact',_0x2c78('0x19'),util[_0x2c78('0x1a')](_0x16de0e,{'showHidden':![],'depth':null}));};}var _0x26e48f=function(_0x354f27){return new BPromise(function(_0x3fde23,_0x1c82c3){_0x2014ba['CmHopper'][_0x2c78('0x1b')]({'where':{'phone':_0x20ee2d[_0x2c78('0xe')],'VoiceQueueId':_0x354f27['id']}})['then'](function(_0x604df2){if(!_[_0x2c78('0x1c')](_0x604df2)){throw new Error(_0x2c78('0x1d')+_0x20ee2d[_0x2c78('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x354f27['id']);}return _0x2014ba[_0x2c78('0x1e')][_0x2c78('0x1f')]({'phone':_0x20ee2d['phone'],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d[_0x2c78('0x20')],'priority':_0x20ee2d['priority']?_0x20ee2d[_0x2c78('0x21')]:0x2,'scheduledat':_0x20ee2d['scheduledat']?_0x20ee2d['scheduledat']:moment()[_0x2c78('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x20ee2d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x20ee2d[_0x2c78('0x23')]?_0x20ee2d[_0x2c78('0x23')]:undefined,'callbackat':_0x20ee2d[_0x2c78('0x23')]?moment()[_0x2c78('0x22')](_0x2c78('0x24')):undefined,'VoiceQueueId':_0x354f27['id']});})[_0x2c78('0x25')](function(_0x2f11e8){_0x1c82c3(_0x2f11e8);});});};var _0x20a4e2=function(_0x14e5b1){return new BPromise(function(_0x125a75,_0x2d43a5){_0x2014ba[_0x2c78('0x1e')][_0x2c78('0x1b')]({'where':{'phone':_0x20ee2d[_0x2c78('0xe')],'VoiceQueueId':_0x14e5b1['id']}})['then'](function(_0x2343dd){if(!_[_0x2c78('0x1c')](_0x2343dd)){throw new Error(_0x2c78('0x1d')+_0x20ee2d['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x14e5b1['id']);}return _0x2014ba[_0x2c78('0x26')][_0x2c78('0x1b')]({'where':{'calleridnum':_0x20ee2d['phone'],'VoiceQueueId':_0x14e5b1['id']}});})[_0x2c78('0x27')](function(_0x15535f){if(!_[_0x2c78('0x1c')](_0x15535f)){throw new Error(_0x2c78('0x28')+_0x20ee2d[_0x2c78('0xe')]+_0x2c78('0x29')+_0x14e5b1['id']);}return _0x2014ba[_0x2c78('0x1e')]['create']({'phone':_0x20ee2d[_0x2c78('0xe')],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d[_0x2c78('0x20')],'priority':_0x20ee2d[_0x2c78('0x21')]?_0x20ee2d[_0x2c78('0x21')]:0x2,'scheduledat':_0x20ee2d[_0x2c78('0x2a')]?_0x20ee2d[_0x2c78('0x2a')]:moment()[_0x2c78('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x20ee2d[_0x2c78('0x23')]?!![]:![],'callbackuniqueid':_0x20ee2d['callbackUniqueid']?_0x20ee2d[_0x2c78('0x23')]:undefined,'callbackat':_0x20ee2d[_0x2c78('0x23')]?moment()[_0x2c78('0x22')](_0x2c78('0x24')):undefined,'VoiceQueueId':_0x14e5b1['id']});})[_0x2c78('0x25')](function(_0x5e5a6a){_0x2d43a5(_0x5e5a6a);});});};function _0x174b38(){return function(_0x3d4733){logger[_0x2c78('0x18')](_0x2c78('0x2b'),_0x2c78('0x19'),util['inspect'](_0x3d4733,{'showHidden':![],'depth':null}));};}var _0x4aaeff=function(_0x43f521){return new BPromise(function(_0x44e245,_0x25f59d){_0x2014ba[_0x2c78('0x1e')][_0x2c78('0x1b')]({'where':{'phone':_0x20ee2d[_0x2c78('0xe')],'CampaignId':_0x43f521['id']}})[_0x2c78('0x27')](function(_0x2cfdd8){if(!_['isNil'](_0x2cfdd8)){throw new Error(_0x2c78('0x1d')+_0x20ee2d['phone']+_0x2c78('0x2c')+_0x43f521['id']);}return _0x2014ba[_0x2c78('0x1e')][_0x2c78('0x1f')]({'phone':_0x20ee2d['phone'],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d[_0x2c78('0x20')],'priority':_0x20ee2d[_0x2c78('0x21')]?_0x20ee2d['priority']:0x2,'scheduledat':_0x20ee2d[_0x2c78('0x2a')]?_0x20ee2d['scheduledat']:moment()[_0x2c78('0x22')](_0x2c78('0x24')),'callback':_0x20ee2d[_0x2c78('0x23')]?!![]:![],'callbackuniqueid':_0x20ee2d[_0x2c78('0x23')]?_0x20ee2d[_0x2c78('0x23')]:undefined,'callbackat':_0x20ee2d['callbackUniqueid']?moment()[_0x2c78('0x22')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x43f521['id']});})[_0x2c78('0x25')](function(_0x4e76e1){_0x25f59d(_0x4e76e1);});});};var _0x11ba96=function(_0x890fe4){return new BPromise(function(_0x275d98,_0xa69482){_0x2014ba['CmHopper']['findOne']({'where':{'phone':_0x20ee2d[_0x2c78('0xe')],'CampaignId':_0x890fe4['id']}})['then'](function(_0x5beb87){if(!_[_0x2c78('0x1c')](_0x5beb87)){throw new Error(_0x2c78('0x1d')+_0x20ee2d[_0x2c78('0xe')]+_0x2c78('0x2d')+_0x890fe4['id']);}return _0x2014ba['CmHopperFinal'][_0x2c78('0x1b')]({'where':{'calleridnum':_0x20ee2d['phone'],'CampaignId':_0x890fe4['id']}});})[_0x2c78('0x27')](function(_0x10d619){if(!_['isNil'](_0x10d619)){throw new Error(_0x2c78('0x28')+_0x20ee2d[_0x2c78('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x890fe4['id']);}return _0x2014ba['CmHopper'][_0x2c78('0x1f')]({'phone':_0x20ee2d['phone'],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d['ListId'],'priority':_0x20ee2d[_0x2c78('0x21')]?_0x20ee2d[_0x2c78('0x21')]:0x2,'scheduledat':_0x20ee2d[_0x2c78('0x2a')]?_0x20ee2d[_0x2c78('0x2a')]:moment()[_0x2c78('0x22')](_0x2c78('0x24')),'callback':_0x20ee2d['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x20ee2d[_0x2c78('0x23')]?_0x20ee2d[_0x2c78('0x23')]:undefined,'callbackat':_0x20ee2d['callbackUniqueid']?moment()['format'](_0x2c78('0x24')):undefined,'CampaignId':_0x890fe4['id']});})['catch'](function(_0x57585d){_0xa69482(_0x57585d);});});};if(_0x20ee2d[_0x2c78('0x20')]){_0x2014ba[_0x2c78('0x2e')][_0x2c78('0x2f')]({'where':{'type':'outbound'},'attributes':['id',_0x2c78('0x30')],'include':[{'model':_0x2014ba[_0x2c78('0x31')],'as':_0x2c78('0x32'),'where':{'id':_0x20ee2d['ListId']}}]})[_0x2c78('0x27')](function(_0x545930){if(_0x545930){var _0xb2fb86=[];for(var _0x23fa9f=0x0,_0x5d1920;_0x23fa9f<_0x545930[_0x2c78('0x33')];_0x23fa9f+=0x1){_0x5d1920=_0x545930[_0x23fa9f][_0x2c78('0x17')]({'plain':!![]});switch(_0x5d1920[_0x2c78('0x30')]){case _0x2c78('0x34'):_0x20a4e2(_0x5d1920)[_0x2c78('0x25')](_0x37293c());break;case _0x2c78('0x35'):_0x26e48f(_0x5d1920)[_0x2c78('0x25')](_0x37293c());break;default:_0x2014ba[_0x2c78('0x1e')][_0x2c78('0x1f')]({'phone':_0x20ee2d[_0x2c78('0xe')],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d['ListId'],'scheduledat':_0x20ee2d[_0x2c78('0x2a')]?_0x20ee2d[_0x2c78('0x2a')]:moment()[_0x2c78('0x22')](_0x2c78('0x24')),'priority':_0x20ee2d[_0x2c78('0x21')]?_0x20ee2d['priority']:0x2,'callback':_0x20ee2d[_0x2c78('0x23')]?!![]:![],'callbackuniqueid':_0x20ee2d[_0x2c78('0x23')]?_0x20ee2d[_0x2c78('0x23')]:undefined,'callbackat':_0x20ee2d['callbackUniqueid']?moment()['format'](_0x2c78('0x24')):undefined,'VoiceQueueId':_0x5d1920['id']})['catch'](_0x37293c());}}}})[_0x2c78('0x27')](function(){return _0x2014ba[_0x2c78('0x2e')][_0x2c78('0x2f')]({'where':{'type':_0x2c78('0x36')},'attributes':['id'],'include':[{'model':_0x2014ba[_0x2c78('0x31')],'as':_0x2c78('0x37'),'where':{'id':_0x20ee2d[_0x2c78('0x20')]}}]})[_0x2c78('0x27')](function(_0x517994){if(_0x517994){var _0x1f0d1b=[];for(var _0x16ea4c=0x0,_0x3adc25;_0x16ea4c<_0x517994[_0x2c78('0x33')];_0x16ea4c+=0x1){_0x3adc25=_0x517994[_0x16ea4c][_0x2c78('0x17')]({'plain':!![]});_0x2014ba['CmHopperBlack'][_0x2c78('0x1f')]({'phone':_0x20ee2d[_0x2c78('0xe')],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d[_0x2c78('0x20')],'VoiceQueueId':_0x3adc25['id']})[_0x2c78('0x25')](function(_0x534ba8){logger['error'](_0x2c78('0x38'),'afterCreate',_0x534ba8[_0x2c78('0x39')]);});}}});})['then'](function(){return _0x2014ba[_0x2c78('0x3a')][_0x2c78('0x2f')]({'attributes':['id',_0x2c78('0x30')],'include':[{'model':_0x2014ba['CmList'],'as':_0x2c78('0x32'),'where':{'id':_0x20ee2d['ListId']}}]})[_0x2c78('0x27')](function(_0x1f56de){if(_0x1f56de){var _0x232c61=[];for(var _0x3531fc=0x0,_0x26ca10;_0x3531fc<_0x1f56de[_0x2c78('0x33')];_0x3531fc+=0x1){_0x26ca10=_0x1f56de[_0x3531fc][_0x2c78('0x17')]({'plain':!![]});switch(_0x26ca10['dialCheckDuplicateType']){case _0x2c78('0x34'):_0x11ba96(_0x26ca10)[_0x2c78('0x25')](_0x174b38());break;case'onlyIfOpen':_0x4aaeff(_0x26ca10)[_0x2c78('0x25')](_0x174b38());break;default:_0x2014ba['CmHopper'][_0x2c78('0x1f')]({'phone':_0x20ee2d[_0x2c78('0xe')],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d['ListId'],'scheduledat':_0x20ee2d[_0x2c78('0x2a')]?_0x20ee2d['scheduledat']:moment()[_0x2c78('0x22')](_0x2c78('0x24')),'priority':_0x20ee2d[_0x2c78('0x21')]?_0x20ee2d[_0x2c78('0x21')]:0x2,'callback':_0x20ee2d[_0x2c78('0x23')]?!![]:![],'callbackuniqueid':_0x20ee2d[_0x2c78('0x23')]?_0x20ee2d['callbackUniqueid']:undefined,'callbackat':_0x20ee2d[_0x2c78('0x23')]?moment()['format'](_0x2c78('0x24')):undefined,'CampaignId':_0x26ca10['id']})[_0x2c78('0x25')](_0x174b38());}}}});})['then'](function(){return _0x2014ba[_0x2c78('0x3a')][_0x2c78('0x2f')]({'attributes':['id'],'include':[{'model':_0x2014ba[_0x2c78('0x31')],'as':_0x2c78('0x37'),'where':{'id':_0x20ee2d[_0x2c78('0x20')]}}]})['then'](function(_0x3728cc){if(_0x3728cc){var _0x8db44=[];for(var _0x3e921f=0x0,_0x3bc71d;_0x3e921f<_0x3728cc[_0x2c78('0x33')];_0x3e921f+=0x1){_0x3bc71d=_0x3728cc[_0x3e921f][_0x2c78('0x17')]({'plain':!![]});_0x2014ba[_0x2c78('0x3b')][_0x2c78('0x1f')]({'phone':_0x20ee2d['phone'],'ContactId':_0x20ee2d['id'],'ListId':_0x20ee2d[_0x2c78('0x20')],'CampaignId':_0x3bc71d['id']})[_0x2c78('0x25')](function(_0x326ad4){logger[_0x2c78('0x18')](_0x2c78('0x38'),_0x2c78('0x19'),_0x326ad4[_0x2c78('0x39')]);});}}});})[_0x2c78('0x27')](function(){_0x30c84a();})[_0x2c78('0x25')](function(_0x46ec50){logger[_0x2c78('0x18')]('cmContact,\x20%s,\x20%s','afterCreate',_0x46ec50[_0x2c78('0x39')]);_0x30c84a(_0x46ec50);});}else{_0x30c84a(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x23a03a,_0x56439d,_0xe1fd13){var _0x208c9f=_0x5bbcc0[_0x2c78('0x16')];var _0x3ac08d=_0x23a03a[_0x2c78('0x17')]({'plain':!![]});return _0x208c9f[_0x2c78('0x1e')][_0x2c78('0x2f')]({'raw':!![],'where':{'ListId':_0x3ac08d[_0x2c78('0x20')],'ContactId':_0x3ac08d['id']}})['then'](function(_0x479b1b){if(!_[_0x2c78('0x3c')](_0x479b1b)){var _0x3a2b41=[];for(var _0xd48db8=0x0;_0xd48db8<_0x479b1b['length'];_0xd48db8+=0x1){var _0x259eae=_0x208c9f[_0x2c78('0x1e')][_0x2c78('0x3d')]({'where':{'ListId':_0x479b1b[_0xd48db8][_0x2c78('0x20')],'ContactId':_0x479b1b[_0xd48db8][_0x2c78('0x3e')],'VoiceQueueId':_0x479b1b[_0xd48db8][_0x2c78('0x3f')],'CampaignId':_0x479b1b[_0xd48db8][_0x2c78('0x40')]}});_0x3a2b41[_0x2c78('0x41')](_0x259eae);}return BPromise[_0x2c78('0x42')](_0x3a2b41);}})['then'](function(_0x1cc789){logger[_0x2c78('0x43')]('[CmContact][afterDestroy][Succesfull]',util[_0x2c78('0x1a')](_0x1cc789,{'showHidden':![],'depth':null}));_0xe1fd13();})[_0x2c78('0x25')](function(_0x3daf15){logger[_0x2c78('0x18')]('[CmContact][afterDestroy][Error]',util[_0x2c78('0x1a')](_0x3daf15,{'showHidden':![],'depth':null}));_0xe1fd13(_0x3daf15);});}}});};
\ No newline at end of file
+var _0x11b2=['priority','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','catch','VoiceQueue','findAll','outbound','get','dialCheckDuplicateType','always','onlyIfOpen','CmList','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Campaign','Lists','List\x20not\x20found','models','isEmpty','VoiceQueueId','CampaignId','all','info','[CmContact][afterDestroy][Succesfull]','inspect','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmContact.attributes','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','cmContact','afterCreate','CmHopper','findOne','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId'];(function(_0x4f3cf6,_0x1d8c0b){var _0x26309f=function(_0x5031c5){while(--_0x5031c5){_0x4f3cf6['push'](_0x4f3cf6['shift']());}};_0x26309f(++_0x1d8c0b);}(_0x11b2,0xf1));var _0x211b=function(_0x243c16,_0x4947c6){_0x243c16=_0x243c16-0x0;var _0x1f8256=_0x11b2[_0x243c16];return _0x1f8256;};'use strict';var _=require(_0x211b('0x0'));var util=require(_0x211b('0x1'));var logger=require(_0x211b('0x2'))(_0x211b('0x3'));var moment=require(_0x211b('0x4'));var BPromise=require(_0x211b('0x5'));var rp=require(_0x211b('0x6'));var fs=require('fs');var path=require(_0x211b('0x7'));var rimraf=require(_0x211b('0x8'));var config=require('../../config/environment');var attributes=require(_0x211b('0x9'));module[_0x211b('0xa')]=function(_0x1983cc,_0x4a6d95){return _0x1983cc[_0x211b('0xb')](_0x211b('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x211b('0xd'),'fields':[_0x211b('0xd')]},{'name':_0x211b('0xe'),'fields':[_0x211b('0xf'),_0x211b('0x10'),_0x211b('0xd'),'mobile',_0x211b('0x11'),_0x211b('0x12')],'type':_0x211b('0x13')}],'timestamps':!![],'charset':_0x211b('0x14'),'collate':_0x211b('0x15'),'hooks':{'afterCreate':function(_0x4cd8bd,_0x3b6a82,_0x23ab65){var _0xe0af8f=_0x1983cc['models'];var _0x32a2a7=_0x4cd8bd['get']({'plain':!![]});function _0x1c3b32(){return function(_0x18bac7){logger['error'](_0x211b('0x16'),_0x211b('0x17'),util['inspect'](_0x18bac7,{'showHidden':![],'depth':null}));};}var _0x3cfc61=function(_0x254655){return new BPromise(function(_0x575a88,_0x4d7fa0){_0xe0af8f[_0x211b('0x18')][_0x211b('0x19')]({'where':{'phone':_0x32a2a7[_0x211b('0xd')],'VoiceQueueId':_0x254655['id']}})['then'](function(_0x45b4b3){if(!_[_0x211b('0x1a')](_0x45b4b3)){throw new Error(_0x211b('0x1b')+_0x32a2a7[_0x211b('0xd')]+_0x211b('0x1c')+_0x254655['id']);}return _0xe0af8f[_0x211b('0x18')][_0x211b('0x1d')]({'phone':_0x32a2a7[_0x211b('0xd')],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7[_0x211b('0x1e')],'priority':_0x32a2a7[_0x211b('0x1f')]?_0x32a2a7[_0x211b('0x1f')]:0x2,'scheduledat':_0x32a2a7[_0x211b('0x20')]?_0x32a2a7[_0x211b('0x20')]:moment()[_0x211b('0x21')](_0x211b('0x22')),'callback':_0x32a2a7[_0x211b('0x23')]?!![]:![],'callbackuniqueid':_0x32a2a7[_0x211b('0x23')]?_0x32a2a7['callbackUniqueid']:undefined,'callbackat':_0x32a2a7[_0x211b('0x23')]?moment()[_0x211b('0x21')](_0x211b('0x22')):undefined,'VoiceQueueId':_0x254655['id']});})['catch'](function(_0x4ff680){_0x4d7fa0(_0x4ff680);});});};var _0x585134=function(_0x2532df){return new BPromise(function(_0x2486e7,_0x366980){_0xe0af8f[_0x211b('0x18')]['findOne']({'where':{'phone':_0x32a2a7[_0x211b('0xd')],'VoiceQueueId':_0x2532df['id']}})[_0x211b('0x24')](function(_0x26944e){if(!_[_0x211b('0x1a')](_0x26944e)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32a2a7[_0x211b('0xd')]+_0x211b('0x25')+_0x2532df['id']);}return _0xe0af8f['CmHopperFinal'][_0x211b('0x19')]({'where':{'calleridnum':_0x32a2a7[_0x211b('0xd')],'VoiceQueueId':_0x2532df['id']}});})[_0x211b('0x24')](function(_0x523ed8){if(!_[_0x211b('0x1a')](_0x523ed8)){throw new Error(_0x211b('0x26')+_0x32a2a7[_0x211b('0xd')]+_0x211b('0x27')+_0x2532df['id']);}return _0xe0af8f['CmHopper'][_0x211b('0x1d')]({'phone':_0x32a2a7[_0x211b('0xd')],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7[_0x211b('0x1e')],'priority':_0x32a2a7[_0x211b('0x1f')]?_0x32a2a7[_0x211b('0x1f')]:0x2,'scheduledat':_0x32a2a7['scheduledat']?_0x32a2a7['scheduledat']:moment()['format'](_0x211b('0x22')),'callback':_0x32a2a7[_0x211b('0x23')]?!![]:![],'callbackuniqueid':_0x32a2a7[_0x211b('0x23')]?_0x32a2a7[_0x211b('0x23')]:undefined,'callbackat':_0x32a2a7[_0x211b('0x23')]?moment()[_0x211b('0x21')](_0x211b('0x22')):undefined,'VoiceQueueId':_0x2532df['id']});})['catch'](function(_0x5a87c0){_0x366980(_0x5a87c0);});});};function _0x567d37(){return function(_0x41b2bb){logger[_0x211b('0x28')](_0x211b('0x16'),'afterCreate',util['inspect'](_0x41b2bb,{'showHidden':![],'depth':null}));};}var _0x47f671=function(_0x762c0e){return new BPromise(function(_0x563cc6,_0x351e33){_0xe0af8f[_0x211b('0x18')][_0x211b('0x19')]({'where':{'phone':_0x32a2a7[_0x211b('0xd')],'CampaignId':_0x762c0e['id']}})[_0x211b('0x24')](function(_0x12e018){if(!_[_0x211b('0x1a')](_0x12e018)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32a2a7[_0x211b('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x762c0e['id']);}return _0xe0af8f[_0x211b('0x18')][_0x211b('0x1d')]({'phone':_0x32a2a7['phone'],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7[_0x211b('0x1e')],'priority':_0x32a2a7['priority']?_0x32a2a7['priority']:0x2,'scheduledat':_0x32a2a7[_0x211b('0x20')]?_0x32a2a7[_0x211b('0x20')]:moment()['format'](_0x211b('0x22')),'callback':_0x32a2a7[_0x211b('0x23')]?!![]:![],'callbackuniqueid':_0x32a2a7['callbackUniqueid']?_0x32a2a7['callbackUniqueid']:undefined,'callbackat':_0x32a2a7['callbackUniqueid']?moment()[_0x211b('0x21')](_0x211b('0x22')):undefined,'CampaignId':_0x762c0e['id']});})['catch'](function(_0x4d0f5c){_0x351e33(_0x4d0f5c);});});};var _0x5df549=function(_0x497903){return new BPromise(function(_0x1176d9,_0x315e6c){_0xe0af8f['CmHopper'][_0x211b('0x19')]({'where':{'phone':_0x32a2a7[_0x211b('0xd')],'CampaignId':_0x497903['id']}})[_0x211b('0x24')](function(_0x378288){if(!_['isNil'](_0x378288)){throw new Error('cmContact,\x20afterCreate\x20'+_0x32a2a7[_0x211b('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x497903['id']);}return _0xe0af8f[_0x211b('0x29')][_0x211b('0x19')]({'where':{'calleridnum':_0x32a2a7[_0x211b('0xd')],'CampaignId':_0x497903['id']}});})[_0x211b('0x24')](function(_0x638a63){if(!_[_0x211b('0x1a')](_0x638a63)){throw new Error(_0x211b('0x26')+_0x32a2a7[_0x211b('0xd')]+_0x211b('0x2a')+_0x497903['id']);}return _0xe0af8f[_0x211b('0x18')]['create']({'phone':_0x32a2a7[_0x211b('0xd')],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7[_0x211b('0x1e')],'priority':_0x32a2a7[_0x211b('0x1f')]?_0x32a2a7[_0x211b('0x1f')]:0x2,'scheduledat':_0x32a2a7[_0x211b('0x20')]?_0x32a2a7[_0x211b('0x20')]:moment()[_0x211b('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x32a2a7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32a2a7['callbackUniqueid']?_0x32a2a7['callbackUniqueid']:undefined,'callbackat':_0x32a2a7[_0x211b('0x23')]?moment()[_0x211b('0x21')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x497903['id']});})[_0x211b('0x2b')](function(_0x12337b){_0x315e6c(_0x12337b);});});};if(_0x32a2a7[_0x211b('0x1e')]){_0xe0af8f[_0x211b('0x2c')][_0x211b('0x2d')]({'where':{'type':_0x211b('0x2e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0xe0af8f['CmList'],'as':'Lists','where':{'id':_0x32a2a7[_0x211b('0x1e')]}}]})['then'](function(_0x146b0a){if(_0x146b0a){var _0x3ed02=[];for(var _0x4675a1=0x0,_0x2edd3b;_0x4675a1<_0x146b0a['length'];_0x4675a1+=0x1){_0x2edd3b=_0x146b0a[_0x4675a1][_0x211b('0x2f')]({'plain':!![]});switch(_0x2edd3b[_0x211b('0x30')]){case _0x211b('0x31'):_0x585134(_0x2edd3b)[_0x211b('0x2b')](_0x1c3b32());break;case _0x211b('0x32'):_0x3cfc61(_0x2edd3b)[_0x211b('0x2b')](_0x1c3b32());break;default:_0xe0af8f[_0x211b('0x18')]['create']({'phone':_0x32a2a7['phone'],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7['ListId'],'scheduledat':_0x32a2a7[_0x211b('0x20')]?_0x32a2a7[_0x211b('0x20')]:moment()[_0x211b('0x21')](_0x211b('0x22')),'priority':_0x32a2a7[_0x211b('0x1f')]?_0x32a2a7[_0x211b('0x1f')]:0x2,'callback':_0x32a2a7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x32a2a7[_0x211b('0x23')]?_0x32a2a7[_0x211b('0x23')]:undefined,'callbackat':_0x32a2a7[_0x211b('0x23')]?moment()['format'](_0x211b('0x22')):undefined,'VoiceQueueId':_0x2edd3b['id']})['catch'](_0x1c3b32());}}}})[_0x211b('0x24')](function(){return _0xe0af8f[_0x211b('0x2c')][_0x211b('0x2d')]({'where':{'type':_0x211b('0x2e')},'attributes':['id'],'include':[{'model':_0xe0af8f[_0x211b('0x33')],'as':_0x211b('0x34'),'where':{'id':_0x32a2a7['ListId']}}]})[_0x211b('0x24')](function(_0x31aaf9){if(_0x31aaf9){var _0x42ae57=[];for(var _0x550180=0x0,_0x2cc18f;_0x550180<_0x31aaf9[_0x211b('0x35')];_0x550180+=0x1){_0x2cc18f=_0x31aaf9[_0x550180][_0x211b('0x2f')]({'plain':!![]});_0xe0af8f[_0x211b('0x36')][_0x211b('0x1d')]({'phone':_0x32a2a7['phone'],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7['ListId'],'VoiceQueueId':_0x2cc18f['id']})['catch'](function(_0x279c78){logger[_0x211b('0x28')](_0x211b('0x37'),'afterCreate',_0x279c78[_0x211b('0x38')]);});}}});})[_0x211b('0x24')](function(){return _0xe0af8f[_0x211b('0x39')][_0x211b('0x2d')]({'attributes':['id',_0x211b('0x30')],'include':[{'model':_0xe0af8f[_0x211b('0x33')],'as':_0x211b('0x3a'),'where':{'id':_0x32a2a7[_0x211b('0x1e')]}}]})[_0x211b('0x24')](function(_0x309dca){if(_0x309dca){var _0x4e9381=[];for(var _0x5b31e3=0x0,_0x1e2f0e;_0x5b31e3<_0x309dca[_0x211b('0x35')];_0x5b31e3+=0x1){_0x1e2f0e=_0x309dca[_0x5b31e3]['get']({'plain':!![]});switch(_0x1e2f0e[_0x211b('0x30')]){case _0x211b('0x31'):_0x5df549(_0x1e2f0e)[_0x211b('0x2b')](_0x567d37());break;case'onlyIfOpen':_0x47f671(_0x1e2f0e)[_0x211b('0x2b')](_0x567d37());break;default:_0xe0af8f[_0x211b('0x18')]['create']({'phone':_0x32a2a7['phone'],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7[_0x211b('0x1e')],'scheduledat':_0x32a2a7[_0x211b('0x20')]?_0x32a2a7[_0x211b('0x20')]:moment()[_0x211b('0x21')](_0x211b('0x22')),'priority':_0x32a2a7[_0x211b('0x1f')]?_0x32a2a7[_0x211b('0x1f')]:0x2,'callback':_0x32a2a7[_0x211b('0x23')]?!![]:![],'callbackuniqueid':_0x32a2a7['callbackUniqueid']?_0x32a2a7[_0x211b('0x23')]:undefined,'callbackat':_0x32a2a7[_0x211b('0x23')]?moment()['format'](_0x211b('0x22')):undefined,'CampaignId':_0x1e2f0e['id']})[_0x211b('0x2b')](_0x567d37());}}}});})[_0x211b('0x24')](function(){return _0xe0af8f[_0x211b('0x39')][_0x211b('0x2d')]({'attributes':['id'],'include':[{'model':_0xe0af8f[_0x211b('0x33')],'as':_0x211b('0x34'),'where':{'id':_0x32a2a7['ListId']}}]})[_0x211b('0x24')](function(_0x26cf75){if(_0x26cf75){var _0x204a2b=[];for(var _0x353e32=0x0,_0x27c688;_0x353e32<_0x26cf75[_0x211b('0x35')];_0x353e32+=0x1){_0x27c688=_0x26cf75[_0x353e32][_0x211b('0x2f')]({'plain':!![]});_0xe0af8f[_0x211b('0x36')][_0x211b('0x1d')]({'phone':_0x32a2a7[_0x211b('0xd')],'ContactId':_0x32a2a7['id'],'ListId':_0x32a2a7[_0x211b('0x1e')],'CampaignId':_0x27c688['id']})[_0x211b('0x2b')](function(_0x3e90e2){logger['error'](_0x211b('0x37'),_0x211b('0x17'),_0x3e90e2[_0x211b('0x38')]);});}}});})[_0x211b('0x24')](function(){_0x23ab65();})['catch'](function(_0x1b2f9c){logger['error'](_0x211b('0x37'),_0x211b('0x17'),_0x1b2f9c['message']);_0x23ab65(_0x1b2f9c);});}else{_0x23ab65(new Error(_0x211b('0x3b')));}},'afterDestroy':function(_0x50a963,_0x19392c,_0x3950be){var _0x322748=_0x1983cc[_0x211b('0x3c')];var _0x459426=_0x50a963[_0x211b('0x2f')]({'plain':!![]});return _0x322748['CmHopper'][_0x211b('0x2d')]({'raw':!![],'where':{'ListId':_0x459426['ListId'],'ContactId':_0x459426['id']}})['then'](function(_0x5b9771){if(!_[_0x211b('0x3d')](_0x5b9771)){var _0x5dd291=[];for(var _0x58fab7=0x0;_0x58fab7<_0x5b9771[_0x211b('0x35')];_0x58fab7+=0x1){var _0x283dfa=_0x322748[_0x211b('0x18')]['destroy']({'where':{'ListId':_0x5b9771[_0x58fab7]['ListId'],'ContactId':_0x5b9771[_0x58fab7]['ContactId'],'VoiceQueueId':_0x5b9771[_0x58fab7][_0x211b('0x3e')],'CampaignId':_0x5b9771[_0x58fab7][_0x211b('0x3f')]}});_0x5dd291['push'](_0x283dfa);}return BPromise[_0x211b('0x40')](_0x5dd291);}})[_0x211b('0x24')](function(_0x1bcd08){logger[_0x211b('0x41')](_0x211b('0x42'),util[_0x211b('0x43')](_0x1bcd08,{'showHidden':![],'depth':null}));_0x3950be();})['catch'](function(_0x576d0f){logger[_0x211b('0x28')]('[CmContact][afterDestroy][Error]',util[_0x211b('0x43')](_0x576d0f,{'showHidden':![],'depth':null}));_0x3950be(_0x576d0f);});}}});};
\ No newline at end of file
index 5c2311c..ee10aeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab4=['http','redis','localhost','./cmContact.socket','register','request','info','CmContact,\x20%s,\x20%s','debug','CmContact,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','raw','attributes','limit','include','map','model','then','create','body','keys','length','startsWith','cf_','update','cm_contacts','set','where','toString','sequelize','query','CreateCmContact','lodash','util','bluebird','randomstring','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x8af54b,_0x280be5){var _0x27d8f0=function(_0x559734){while(--_0x559734){_0x8af54b['push'](_0x8af54b['shift']());}};_0x27d8f0(++_0x280be5);}(_0x1ab4,0x168));var _0x41ab=function(_0x431a53,_0x5269ea){_0x431a53=_0x431a53-0x0;var _0x3fd95e=_0x1ab4[_0x431a53];return _0x3fd95e;};'use strict';var _=require(_0x41ab('0x0'));var util=require(_0x41ab('0x1'));var moment=require('moment');var BPromise=require(_0x41ab('0x2'));var rs=require(_0x41ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0x41ab('0x4'));var db=require(_0x41ab('0x5'))['db'];var utils=require(_0x41ab('0x6'));var logger=require(_0x41ab('0x7'))(_0x41ab('0x8'));var config=require(_0x41ab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x41ab('0xa')][_0x41ab('0xb')]({'port':0x232a});config[_0x41ab('0xc')]=_['defaults'](config['redis'],{'host':_0x41ab('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41ab('0xc')]));require(_0x41ab('0xe'))[_0x41ab('0xf')](socket);function respondWithRpcPromise(_0x2b1861,_0x4bdeda,_0x5ca075){return new BPromise(function(_0x397565,_0x1661ef){return client[_0x41ab('0x10')](_0x2b1861,_0x5ca075)['then'](function(_0x538e1b){logger[_0x41ab('0x11')](_0x41ab('0x12'),_0x4bdeda,'request\x20sent');logger[_0x41ab('0x13')](_0x41ab('0x14'),_0x4bdeda,_0x41ab('0x15'),JSON[_0x41ab('0x16')](_0x538e1b));if(_0x538e1b[_0x41ab('0x17')]){if(_0x538e1b[_0x41ab('0x17')][_0x41ab('0x18')]===0x1f4){logger[_0x41ab('0x17')](_0x41ab('0x12'),_0x4bdeda,_0x538e1b[_0x41ab('0x17')][_0x41ab('0x19')]);return _0x1661ef(_0x538e1b[_0x41ab('0x17')]['message']);}logger['error']('CmContact,\x20%s,\x20%s',_0x4bdeda,_0x538e1b[_0x41ab('0x17')][_0x41ab('0x19')]);return _0x397565(_0x538e1b[_0x41ab('0x17')][_0x41ab('0x19')]);}else{logger['info'](_0x41ab('0x12'),_0x4bdeda,'request\x20sent');_0x397565(_0x538e1b[_0x41ab('0x1a')][_0x41ab('0x19')]);}})[_0x41ab('0x1b')](function(_0x1a732b){logger[_0x41ab('0x17')](_0x41ab('0x12'),_0x4bdeda,_0x1a732b);_0x1661ef(_0x1a732b);});});}exports[_0x41ab('0x1c')]=function(_0x3f4a50){var _0x3fab89=this;return new Promise(function(_0x4659db,_0x4f57c5){return db[_0x41ab('0x1d')][_0x41ab('0x1e')]({'raw':_0x3f4a50[_0x41ab('0x1f')]?_0x3f4a50[_0x41ab('0x1f')][_0x41ab('0x20')]===undefined?!![]:![]:!![],'where':_0x3f4a50[_0x41ab('0x1f')]?_0x3f4a50['options']['where']||null:null,'attributes':_0x3f4a50[_0x41ab('0x1f')]?_0x3f4a50[_0x41ab('0x1f')][_0x41ab('0x21')]||null:null,'limit':_0x3f4a50[_0x41ab('0x1f')]?_0x3f4a50[_0x41ab('0x1f')][_0x41ab('0x22')]||null:null,'include':_0x3f4a50['options']?_0x3f4a50[_0x41ab('0x1f')][_0x41ab('0x23')]?_[_0x41ab('0x24')](_0x3f4a50[_0x41ab('0x1f')][_0x41ab('0x23')],function(_0x4ff002){return{'model':db[_0x4ff002[_0x41ab('0x25')]],'as':_0x4ff002['as'],'attributes':_0x4ff002[_0x41ab('0x21')],'include':_0x4ff002[_0x41ab('0x23')]?_['map'](_0x4ff002['include'],function(_0x38aac5){return{'model':db[_0x38aac5[_0x41ab('0x25')]],'as':_0x38aac5['as'],'attributes':_0x38aac5[_0x41ab('0x21')],'include':_0x38aac5[_0x41ab('0x23')]?_[_0x41ab('0x24')](_0x38aac5[_0x41ab('0x23')],function(_0x5ed3c2){return{'model':db[_0x5ed3c2['model']],'as':_0x5ed3c2['as'],'attributes':_0x5ed3c2['attributes']};}):[]};}):[]};}):[]:[]})[_0x41ab('0x26')](function(_0x42f309){logger[_0x41ab('0x11')](_0x41ab('0x1c'),_0x3f4a50);logger[_0x41ab('0x13')](_0x41ab('0x1c'),_0x3f4a50,JSON[_0x41ab('0x16')](_0x42f309));_0x4659db(_0x42f309);})[_0x41ab('0x1b')](function(_0x38b1b5){logger['error']('GetCmContact',_0x38b1b5[_0x41ab('0x19')],_0x3f4a50);_0x4f57c5(_0x3fab89[_0x41ab('0x17')](0x1f4,_0x38b1b5[_0x41ab('0x19')]));});});};exports['CreateCmContact']=function(_0x19aa3e){var _0x5bd5e8=this;return new Promise(function(_0x45bf3d,_0x25c46c){return db[_0x41ab('0x1d')][_0x41ab('0x27')](_0x19aa3e[_0x41ab('0x28')],{'raw':_0x19aa3e['options']?_0x19aa3e[_0x41ab('0x1f')][_0x41ab('0x20')]===undefined?!![]:![]:!![]})[_0x41ab('0x26')](function(_0x258474){var _0x408d60;for(var _0x259f6e=0x0;_0x259f6e<Object[_0x41ab('0x29')](_0x19aa3e[_0x41ab('0x28')])[_0x41ab('0x2a')];_0x259f6e++){var _0x5415b2=Object[_0x41ab('0x29')](_0x19aa3e['body'])[_0x259f6e];if(_0x5415b2[_0x41ab('0x2b')](_0x41ab('0x2c'))){_0x408d60=squel[_0x41ab('0x2d')]()['table'](_0x41ab('0x2e'))[_0x41ab('0x2f')](_0x5415b2,_0x19aa3e['body'][_0x5415b2])[_0x41ab('0x30')]('id\x20=\x20?',_0x258474['id'])[_0x41ab('0x31')]();break;}}if(!_0x408d60)return _0x258474;return db[_0x41ab('0x32')][_0x41ab('0x33')](_0x408d60)[_0x41ab('0x26')](function(){return _0x258474;});})[_0x41ab('0x26')](function(_0x399a59){logger[_0x41ab('0x11')](_0x41ab('0x34'),_0x19aa3e);logger[_0x41ab('0x13')](_0x41ab('0x34'),_0x19aa3e,JSON[_0x41ab('0x16')](_0x399a59));_0x45bf3d(_0x399a59);})[_0x41ab('0x1b')](function(_0x1a3425){logger['error'](_0x41ab('0x34'),_0x1a3425['message'],_0x19aa3e);_0x25c46c(_0x5bd5e8[_0x41ab('0x17')](0x1f4,_0x1a3425[_0x41ab('0x19')]));});});};
\ No newline at end of file
+var _0x8621=['sequelize','query','catch','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','request\x20sent','debug','error','code','message','CmContact,\x20%s,\x20%s','result','GetCmContact','CmContact','findAll','options','raw','attributes','limit','include','map','model','stringify','CreateCmContact','create','body','length','cf_','table','set','where','id\x20=\x20?','toString'];(function(_0x1343e4,_0xaba5a0){var _0x3977f2=function(_0x49c0e6){while(--_0x49c0e6){_0x1343e4['push'](_0x1343e4['shift']());}};_0x3977f2(++_0xaba5a0);}(_0x8621,0x1b3));var _0x1862=function(_0x474311,_0x3d3455){_0x474311=_0x474311-0x0;var _0x46a9ac=_0x8621[_0x474311];return _0x46a9ac;};'use strict';var _=require(_0x1862('0x0'));var util=require(_0x1862('0x1'));var moment=require(_0x1862('0x2'));var BPromise=require(_0x1862('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1862('0x4'));var squel=require(_0x1862('0x5'));var db=require(_0x1862('0x6'))['db'];var utils=require(_0x1862('0x7'));var logger=require(_0x1862('0x8'))(_0x1862('0x9'));var config=require(_0x1862('0xa'));var jayson=require(_0x1862('0xb'));var client=jayson[_0x1862('0xc')][_0x1862('0xd')]({'port':0x232a});config['redis']=_[_0x1862('0xe')](config[_0x1862('0xf')],{'host':_0x1862('0x10'),'port':0x18eb});var socket=require(_0x1862('0x11'))(new Redis(config[_0x1862('0xf')]));require(_0x1862('0x12'))[_0x1862('0x13')](socket);function respondWithRpcPromise(_0x3944ee,_0x358899,_0x311c22){return new BPromise(function(_0x189085,_0xda871){return client[_0x1862('0x14')](_0x3944ee,_0x311c22)[_0x1862('0x15')](function(_0xb8b9ff){logger[_0x1862('0x16')]('CmContact,\x20%s,\x20%s',_0x358899,_0x1862('0x17'));logger[_0x1862('0x18')]('CmContact,\x20%s,\x20%s,\x20%s',_0x358899,'request\x20sent',JSON['stringify'](_0xb8b9ff));if(_0xb8b9ff[_0x1862('0x19')]){if(_0xb8b9ff[_0x1862('0x19')][_0x1862('0x1a')]===0x1f4){logger[_0x1862('0x19')]('CmContact,\x20%s,\x20%s',_0x358899,_0xb8b9ff[_0x1862('0x19')][_0x1862('0x1b')]);return _0xda871(_0xb8b9ff[_0x1862('0x19')][_0x1862('0x1b')]);}logger[_0x1862('0x19')](_0x1862('0x1c'),_0x358899,_0xb8b9ff[_0x1862('0x19')][_0x1862('0x1b')]);return _0x189085(_0xb8b9ff['error'][_0x1862('0x1b')]);}else{logger[_0x1862('0x16')](_0x1862('0x1c'),_0x358899,_0x1862('0x17'));_0x189085(_0xb8b9ff[_0x1862('0x1d')][_0x1862('0x1b')]);}})['catch'](function(_0x336e05){logger[_0x1862('0x19')](_0x1862('0x1c'),_0x358899,_0x336e05);_0xda871(_0x336e05);});});}exports[_0x1862('0x1e')]=function(_0x2a10b9){var _0x381069=this;return new Promise(function(_0x33aa8e,_0x4ff2e3){return db[_0x1862('0x1f')][_0x1862('0x20')]({'raw':_0x2a10b9[_0x1862('0x21')]?_0x2a10b9[_0x1862('0x21')][_0x1862('0x22')]===undefined?!![]:![]:!![],'where':_0x2a10b9[_0x1862('0x21')]?_0x2a10b9[_0x1862('0x21')]['where']||null:null,'attributes':_0x2a10b9[_0x1862('0x21')]?_0x2a10b9[_0x1862('0x21')][_0x1862('0x23')]||null:null,'limit':_0x2a10b9['options']?_0x2a10b9[_0x1862('0x21')][_0x1862('0x24')]||null:null,'include':_0x2a10b9[_0x1862('0x21')]?_0x2a10b9['options'][_0x1862('0x25')]?_[_0x1862('0x26')](_0x2a10b9[_0x1862('0x21')]['include'],function(_0x457a3d){return{'model':db[_0x457a3d[_0x1862('0x27')]],'as':_0x457a3d['as'],'attributes':_0x457a3d[_0x1862('0x23')],'include':_0x457a3d[_0x1862('0x25')]?_[_0x1862('0x26')](_0x457a3d[_0x1862('0x25')],function(_0x5307d8){return{'model':db[_0x5307d8[_0x1862('0x27')]],'as':_0x5307d8['as'],'attributes':_0x5307d8[_0x1862('0x23')],'include':_0x5307d8[_0x1862('0x25')]?_[_0x1862('0x26')](_0x5307d8[_0x1862('0x25')],function(_0x2d8dfe){return{'model':db[_0x2d8dfe[_0x1862('0x27')]],'as':_0x2d8dfe['as'],'attributes':_0x2d8dfe[_0x1862('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2112da){logger[_0x1862('0x16')](_0x1862('0x1e'),_0x2a10b9);logger[_0x1862('0x18')]('GetCmContact',_0x2a10b9,JSON[_0x1862('0x28')](_0x2112da));_0x33aa8e(_0x2112da);})['catch'](function(_0x4f9372){logger[_0x1862('0x19')](_0x1862('0x1e'),_0x4f9372[_0x1862('0x1b')],_0x2a10b9);_0x4ff2e3(_0x381069[_0x1862('0x19')](0x1f4,_0x4f9372[_0x1862('0x1b')]));});});};exports[_0x1862('0x29')]=function(_0x1b76ff){var _0x11fbfb=this;return new Promise(function(_0x656e1f,_0xfe1f83){return db[_0x1862('0x1f')][_0x1862('0x2a')](_0x1b76ff[_0x1862('0x2b')],{'raw':_0x1b76ff[_0x1862('0x21')]?_0x1b76ff['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x335e6f){var _0xd361be;for(var _0x152bbd=0x0;_0x152bbd<Object['keys'](_0x1b76ff[_0x1862('0x2b')])[_0x1862('0x2c')];_0x152bbd++){var _0x232375=Object['keys'](_0x1b76ff[_0x1862('0x2b')])[_0x152bbd];if(_0x232375['startsWith'](_0x1862('0x2d'))){_0xd361be=squel['update']()[_0x1862('0x2e')]('cm_contacts')[_0x1862('0x2f')](_0x232375,_0x1b76ff[_0x1862('0x2b')][_0x232375])[_0x1862('0x30')](_0x1862('0x31'),_0x335e6f['id'])[_0x1862('0x32')]();break;}}if(!_0xd361be)return _0x335e6f;return db[_0x1862('0x33')][_0x1862('0x34')](_0xd361be)[_0x1862('0x15')](function(){return _0x335e6f;});})['then'](function(_0x34b177){logger[_0x1862('0x16')]('CreateCmContact',_0x1b76ff);logger[_0x1862('0x18')](_0x1862('0x29'),_0x1b76ff,JSON[_0x1862('0x28')](_0x34b177));_0x656e1f(_0x34b177);})[_0x1862('0x35')](function(_0x628ebf){logger[_0x1862('0x19')](_0x1862('0x29'),_0x628ebf[_0x1862('0x1b')],_0x1b76ff);_0xfe1f83(_0x11fbfb['error'](0x1f4,_0x628ebf[_0x1862('0x1b')]));});});};
\ No newline at end of file
index dfce47b..03ab275 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 8478aea..a20bf5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49d7=['originalname','replace','%s-%s%s','basename','extname','now','/csv','single','file','server/files/tmp','format','/upload','upload','/upload/:id','import','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root'];(function(_0x165130,_0x37b671){var _0x7c6cf7=function(_0x4312b9){while(--_0x4312b9){_0x165130['push'](_0x165130['shift']());}};_0x7c6cf7(++_0x37b671);}(_0x49d7,0xe7));var _0x749d=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x49d7[_0x4dab14];return _0xf41aa;};'use strict';var multer=require(_0x749d('0x0'));var util=require('util');var path=require(_0x749d('0x1'));var timeout=require(_0x749d('0x2'));var express=require(_0x749d('0x3'));var router=express[_0x749d('0x4')]();var fs_extra=require(_0x749d('0x5'));var auth=require(_0x749d('0x6'));var interaction=require(_0x749d('0x7'));var config=require(_0x749d('0x8'));var controller=require('./cmContact.controller');router[_0x749d('0x9')]('/',auth['isAuthenticated'](),controller[_0x749d('0xa')]);router['get'](_0x749d('0xb'),auth[_0x749d('0xc')](),controller['describe']);router[_0x749d('0x9')](_0x749d('0xd'),auth['isAuthenticated'](),controller[_0x749d('0xe')]);router[_0x749d('0x9')]('/:id/tags',auth[_0x749d('0xc')](),controller[_0x749d('0xf')]);router[_0x749d('0x9')](_0x749d('0x10'),auth[_0x749d('0xc')](),controller[_0x749d('0x11')]);router[_0x749d('0x9')](_0x749d('0x12'),auth[_0x749d('0xc')](),controller[_0x749d('0x13')]);router[_0x749d('0x9')](_0x749d('0x14'),auth['isAuthenticated'](),controller[_0x749d('0x15')]);router[_0x749d('0x9')](_0x749d('0x16'),auth[_0x749d('0xc')](),controller[_0x749d('0x17')]);router[_0x749d('0x9')]('/:id/journey',auth[_0x749d('0xc')](),controller['getJourney']);router[_0x749d('0x18')](_0x749d('0x19'),auth[_0x749d('0xc')](),controller[_0x749d('0x1a')]);router[_0x749d('0x18')]('/',auth['isAuthenticated'](),controller[_0x749d('0x1b')]);router[_0x749d('0x18')](_0x749d('0x1c'),auth['isAuthenticated'](),controller[_0x749d('0x1d')]);router[_0x749d('0x18')]('/:id/tags',auth[_0x749d('0xc')](),controller[_0x749d('0x1e')]);var upload=multer({'storage':multer[_0x749d('0x1f')]({'destination':function(_0x3b6316,_0x555d9e,_0x23839b){_0x23839b(null,path[_0x749d('0x20')](config[_0x749d('0x21')],'server/files/tmp'));},'filename':function(_0x37f266,_0x5e8473,_0x5c99da){_0x5e8473['originalname']=_0x5e8473[_0x749d('0x22')][_0x749d('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c99da(null,util['format'](_0x749d('0x24'),path[_0x749d('0x25')](_0x5e8473['originalname'],path[_0x749d('0x26')](_0x5e8473[_0x749d('0x22')])),Date[_0x749d('0x27')](),path[_0x749d('0x26')](_0x5e8473[_0x749d('0x22')])));}})});router[_0x749d('0x18')](_0x749d('0x28'),upload[_0x749d('0x29')](_0x749d('0x2a')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x749d('0x1f')]({'destination':function(_0x3fb3d4,_0x1fe566,_0x223487){_0x223487(null,path['join'](config[_0x749d('0x21')],_0x749d('0x2b')));},'filename':function(_0x4d6c18,_0x3cd08b,_0x1a2f99){_0x3cd08b[_0x749d('0x22')]=_0x3cd08b[_0x749d('0x22')][_0x749d('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a2f99(null,util[_0x749d('0x2c')](_0x749d('0x24'),path[_0x749d('0x25')](_0x3cd08b[_0x749d('0x22')],path[_0x749d('0x26')](_0x3cd08b[_0x749d('0x22')])),Date[_0x749d('0x27')](),path[_0x749d('0x26')](_0x3cd08b[_0x749d('0x22')])));}})});router[_0x749d('0x18')](_0x749d('0x2d'),upload['single']('file'),controller[_0x749d('0x2e')]);router[_0x749d('0x18')](_0x749d('0x2f'),auth[_0x749d('0xc')](),controller[_0x749d('0x30')]);router[_0x749d('0x31')](_0x749d('0xd'),auth[_0x749d('0xc')](),controller[_0x749d('0x32')]);router[_0x749d('0x33')](_0x749d('0xd'),auth[_0x749d('0xc')](),controller[_0x749d('0x34')]);module['exports']=router;
\ No newline at end of file
+var _0xe99b=['/upload/:id','import','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmContact.controller','get','index','/describe','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','/create_many','/:id/tags','setTags','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','diskStorage','/upload','upload'];(function(_0x3d3b8f,_0x34e273){var _0x1cbdff=function(_0x17f7f5){while(--_0x17f7f5){_0x3d3b8f['push'](_0x3d3b8f['shift']());}};_0x1cbdff(++_0x34e273);}(_0xe99b,0x196));var _0xbe99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe99b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbe99('0x0'));var util=require(_0xbe99('0x1'));var path=require('path');var timeout=require(_0xbe99('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbe99('0x3'));var auth=require(_0xbe99('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbe99('0x5'));var controller=require(_0xbe99('0x6'));router[_0xbe99('0x7')]('/',auth['isAuthenticated'](),controller[_0xbe99('0x8')]);router['get'](_0xbe99('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xbe99('0xa'),auth[_0xbe99('0xb')](),controller[_0xbe99('0xc')]);router[_0xbe99('0x7')]('/:id/tags',auth[_0xbe99('0xb')](),controller['getTags']);router[_0xbe99('0x7')](_0xbe99('0xd'),auth[_0xbe99('0xb')](),controller[_0xbe99('0xe')]);router[_0xbe99('0x7')](_0xbe99('0xf'),auth[_0xbe99('0xb')](),controller[_0xbe99('0x10')]);router[_0xbe99('0x7')]('/:id/hopper_finals',auth[_0xbe99('0xb')](),controller[_0xbe99('0x11')]);router[_0xbe99('0x7')]('/:id/jscripty_sessions',auth[_0xbe99('0xb')](),controller[_0xbe99('0x12')]);router[_0xbe99('0x7')](_0xbe99('0x13'),auth[_0xbe99('0xb')](),controller[_0xbe99('0x14')]);router[_0xbe99('0x15')](_0xbe99('0x16'),auth[_0xbe99('0xb')](),controller[_0xbe99('0x17')]);router['post']('/',auth[_0xbe99('0xb')](),controller['create']);router[_0xbe99('0x15')](_0xbe99('0x18'),auth[_0xbe99('0xb')](),controller['bulkCreate']);router[_0xbe99('0x15')](_0xbe99('0x19'),auth[_0xbe99('0xb')](),controller[_0xbe99('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2043d2,_0x30a7fb,_0xed1454){_0xed1454(null,path[_0xbe99('0x1b')](config[_0xbe99('0x1c')],_0xbe99('0x1d')));},'filename':function(_0x560e14,_0x3ac68f,_0x101910){_0x3ac68f['originalname']=_0x3ac68f[_0xbe99('0x1e')][_0xbe99('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x101910(null,util[_0xbe99('0x20')](_0xbe99('0x21'),path[_0xbe99('0x22')](_0x3ac68f[_0xbe99('0x1e')],path[_0xbe99('0x23')](_0x3ac68f[_0xbe99('0x1e')])),Date[_0xbe99('0x24')](),path[_0xbe99('0x23')](_0x3ac68f[_0xbe99('0x1e')])));}})});router[_0xbe99('0x15')](_0xbe99('0x25'),upload[_0xbe99('0x26')](_0xbe99('0x27')),controller[_0xbe99('0x28')]);var upload=multer({'storage':multer[_0xbe99('0x29')]({'destination':function(_0x512c5d,_0x2ae376,_0x5991db){_0x5991db(null,path['join'](config['root'],'server/files/tmp'));},'filename':function(_0x34f8d9,_0x360f68,_0x38658d){_0x360f68['originalname']=_0x360f68[_0xbe99('0x1e')][_0xbe99('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38658d(null,util[_0xbe99('0x20')]('%s-%s%s',path[_0xbe99('0x22')](_0x360f68[_0xbe99('0x1e')],path[_0xbe99('0x23')](_0x360f68[_0xbe99('0x1e')])),Date[_0xbe99('0x24')](),path[_0xbe99('0x23')](_0x360f68[_0xbe99('0x1e')])));}})});router[_0xbe99('0x15')](_0xbe99('0x2a'),upload['single'](_0xbe99('0x27')),controller[_0xbe99('0x2b')]);router['post'](_0xbe99('0x2c'),auth['isAuthenticated'](),controller[_0xbe99('0x2d')]);router['put'](_0xbe99('0xa'),auth['isAuthenticated'](),controller[_0xbe99('0x2e')]);router[_0xbe99('0x2f')](_0xbe99('0xa'),auth[_0xbe99('0xb')](),controller[_0xbe99('0x30')]);module[_0xbe99('0x31')]=router;
\ No newline at end of file
index 29ed862..9c4305f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x345d=['sequelize','lodash','VIRTUAL','getDataValue','alias','setDataValue','STRING','type','parse','stringify','values','BOOLEAN','voice'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x345d,0x82));var _0xd345=function(_0x570c9b,_0x121183){_0x570c9b=_0x570c9b-0x0;var _0x1c3fd3=_0x345d[_0x570c9b];return _0x1c3fd3;};'use strict';var Sequelize=require(_0xd345('0x0'));var _=require(_0xd345('0x1'));module['exports']={'name':{'type':Sequelize[_0xd345('0x2')],'get':function(_0x58784a){return this[_0xd345('0x3')](_0xd345('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x17683a){this[_0xd345('0x5')](_0xd345('0x4'),_0x17683a?_0x17683a:this[_0xd345('0x3')]('name'));}},'type':{'type':Sequelize[_0xd345('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this['getDataValue'](_0xd345('0x7'))==='select'){return JSON[_0xd345('0x8')](this[_0xd345('0x3')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0xe2b267){if(Array['isArray'](_0xe2b267)){this['setDataValue']('values',JSON[_0xd345('0x9')](_0xe2b267));}else{this[_0xd345('0x5')](_0xd345('0xa'),_0xe2b267);}}},'required':{'type':Sequelize[_0xd345('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xd345('0xc'))}};
\ No newline at end of file
+var _0x890c=['voice','sequelize','lodash','getDataValue','alias','STRING','setDataValue','name','TEXT','type','values','isArray','BOOLEAN'];(function(_0x3d1779,_0x25f3ab){var _0x37664b=function(_0x2a16af){while(--_0x2a16af){_0x3d1779['push'](_0x3d1779['shift']());}};_0x37664b(++_0x25f3ab);}(_0x890c,0x1e2));var _0xc890=function(_0x1e1e72,_0x2fda56){_0x1e1e72=_0x1e1e72-0x0;var _0x183ee0=_0x890c[_0x1e1e72];return _0x183ee0;};'use strict';var Sequelize=require(_0xc890('0x0'));var _=require(_0xc890('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x129cc3){return this[_0xc890('0x2')](_0xc890('0x3'));}},'alias':{'type':Sequelize[_0xc890('0x4')],'allowNull':![],'set':function(_0x59a3e8){this[_0xc890('0x5')](_0xc890('0x3'),_0x59a3e8?_0x59a3e8:this[_0xc890('0x2')](_0xc890('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0xc890('0x7')]('long'),'get':function(){if(this[_0xc890('0x2')](_0xc890('0x8'))==='select'){return JSON['parse'](this[_0xc890('0x2')](_0xc890('0x9')));}else{return this[_0xc890('0x2')](_0xc890('0x9'));}},'set':function(_0x3a746e){if(Array[_0xc890('0xa')](_0x3a746e)){this[_0xc890('0x5')](_0xc890('0x9'),JSON['stringify'](_0x3a746e));}else{this[_0xc890('0x5')](_0xc890('0x9'),_0x3a746e);}}},'required':{'type':Sequelize[_0xc890('0xb')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc890('0xb')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xc890('0xc'))}};
\ No newline at end of file
index 1ebe8ff..d0d721a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7bf=['rimraf','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','findAll','rows','catch','show','params','keys','length','include','options','find','body','create','sequelize','transaction','Sequelize','TEXT','number','BOOLEAN','defaultValue','queryInterface','cf_%d','eml-format'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7bf,0x14b));var _0xfa7b=function(_0x31df10,_0x312458){_0x31df10=_0x31df10-0x0;var _0x3ce6e8=_0xa7bf[_0x31df10];return _0x3ce6e8;};'use strict';var emlformat=require(_0xfa7b('0x0'));var rimraf=require(_0xfa7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa7b('0x2'));var BPromise=require(_0xfa7b('0x3'));var Mustache=require(_0xfa7b('0x4'));var util=require(_0xfa7b('0x5'));var path=require(_0xfa7b('0x6'));var sox=require(_0xfa7b('0x7'));var csv=require(_0xfa7b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa7b('0x9'));var _=require(_0xfa7b('0xa'));var squel=require(_0xfa7b('0xb'));var crypto=require(_0xfa7b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfa7b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfa7b('0xe'));var Papa=require(_0xfa7b('0xf'));var Redis=require(_0xfa7b('0x10'));var authService=require(_0xfa7b('0x11'));var qs=require(_0xfa7b('0x12'));var as=require(_0xfa7b('0x13'));var hardwareService=require(_0xfa7b('0x14'));var logger=require('../../config/logger')(_0xfa7b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfa7b('0x16'));var db=require(_0xfa7b('0x17'))['db'];function respondWithStatusCode(_0x18033b,_0x475ee3){_0x475ee3=_0x475ee3||0xcc;return function(_0x2f69e9){if(_0x2f69e9){return _0x18033b[_0xfa7b('0x18')](_0x475ee3);}return _0x18033b[_0xfa7b('0x19')](_0x475ee3)['end']();};}function respondWithResult(_0x29bcb2,_0x408cfe){_0x408cfe=_0x408cfe||0xc8;return function(_0x31163e){if(_0x31163e){return _0x29bcb2[_0xfa7b('0x19')](_0x408cfe)['json'](_0x31163e);}};}function respondWithFilteredResult(_0x589f8f,_0x198c1e){return function(_0x5b5c83){if(_0x5b5c83){var _0x397b0d=typeof _0x198c1e[_0xfa7b('0x1a')]===_0xfa7b('0x1b')&&typeof _0x198c1e[_0xfa7b('0x1c')]==='undefined';var _0x4a800c=_0x5b5c83[_0xfa7b('0x1d')];var _0x49760f=_0x397b0d?0x0:_0x198c1e[_0xfa7b('0x1a')];var _0x3d2a59=_0x397b0d?_0x5b5c83[_0xfa7b('0x1d')]:_0x198c1e[_0xfa7b('0x1a')]+_0x198c1e[_0xfa7b('0x1c')];var _0x30a5d3;if(_0x3d2a59>=_0x4a800c){_0x3d2a59=_0x4a800c;_0x30a5d3=0xc8;}else{_0x30a5d3=0xce;}_0x589f8f[_0xfa7b('0x19')](_0x30a5d3);return _0x589f8f[_0xfa7b('0x1e')](_0xfa7b('0x1f'),_0x49760f+'-'+_0x3d2a59+'/'+_0x4a800c)[_0xfa7b('0x20')](_0x5b5c83);}return null;};}function patchUpdates(_0x2390c1){return function(_0x1e876e){try{jsonpatch[_0xfa7b('0x21')](_0x1e876e,_0x2390c1,!![]);}catch(_0x29125e){return BPromise[_0xfa7b('0x22')](_0x29125e);}return _0x1e876e[_0xfa7b('0x23')]();};}function saveUpdates(_0x15e509,_0x5d982f){return function(_0x1eb771){if(_0x1eb771){return _0x1eb771[_0xfa7b('0x24')](_0x15e509)[_0xfa7b('0x25')](function(_0x49bc35){return _0x49bc35;});}return null;};}function removeEntity(_0x423274,_0x4789cf){return function(_0xe33bec){if(_0xe33bec){return _0xe33bec[_0xfa7b('0x26')]()['then'](function(){_0x423274['status'](0xcc)[_0xfa7b('0x27')]();});}};}function handleEntityNotFound(_0x25f882,_0x141524){return function(_0xb4187b){if(!_0xb4187b){_0x25f882[_0xfa7b('0x18')](0x194);}return _0xb4187b;};}function handleError(_0x276aaf,_0x4a65d5){_0x4a65d5=_0x4a65d5||0x1f4;return function(_0x392dee){logger[_0xfa7b('0x28')](_0x392dee[_0xfa7b('0x29')]);if(_0x392dee[_0xfa7b('0x2a')]){delete _0x392dee[_0xfa7b('0x2a')];}_0x276aaf[_0xfa7b('0x19')](_0x4a65d5)[_0xfa7b('0x2b')](_0x392dee);};}exports[_0xfa7b('0x2c')]=function(_0x39e5c4,_0x47d445){var _0x490db2={},_0x5cdfc8={},_0x83c9a7={'count':0x0,'rows':[]};var _0x1c2e02=_[_0xfa7b('0x2d')](db[_0xfa7b('0x2e')][_0xfa7b('0x2f')],function(_0x521061){return{'name':_0x521061[_0xfa7b('0x30')],'type':_0x521061[_0xfa7b('0x31')]['key']};});_0x5cdfc8[_0xfa7b('0x32')]=_['differenceBy'](_[_0xfa7b('0x2d')](_0x1c2e02,_0xfa7b('0x2a')),['name']);_0x5cdfc8[_0xfa7b('0x33')]=_['keys'](_0x39e5c4['query']);_0x5cdfc8[_0xfa7b('0x34')]=_[_0xfa7b('0x35')](_0x5cdfc8[_0xfa7b('0x32')],_0x5cdfc8[_0xfa7b('0x33')]);_0x490db2[_0xfa7b('0x36')]=_[_0xfa7b('0x35')](_0x5cdfc8['model'],qs['fields'](_0x39e5c4[_0xfa7b('0x33')][_0xfa7b('0x37')]));_0x490db2[_0xfa7b('0x36')]=_0x490db2[_0xfa7b('0x36')]['length']?_0x490db2[_0xfa7b('0x36')]:_0x5cdfc8['model'];if(!_0x39e5c4[_0xfa7b('0x33')]['hasOwnProperty'](_0xfa7b('0x38'))){_0x490db2[_0xfa7b('0x1c')]=qs[_0xfa7b('0x1c')](_0x39e5c4[_0xfa7b('0x33')][_0xfa7b('0x1c')]);_0x490db2['offset']=qs[_0xfa7b('0x1a')](_0x39e5c4[_0xfa7b('0x33')]['offset']);}_0x490db2[_0xfa7b('0x39')]=qs[_0xfa7b('0x3a')](_0x39e5c4['query'][_0xfa7b('0x3a')]);_0x490db2[_0xfa7b('0x3b')]=qs['filters'](_['pick'](_0x39e5c4[_0xfa7b('0x33')],_0x5cdfc8[_0xfa7b('0x34')]),_0x1c2e02);if(_0x39e5c4[_0xfa7b('0x33')]['filter']){_0x490db2[_0xfa7b('0x3b')]=_[_0xfa7b('0x3c')](_0x490db2[_0xfa7b('0x3b')],{'$or':_[_0xfa7b('0x2d')](_0x1c2e02,function(_0x11a47a){if(_0x11a47a[_0xfa7b('0x31')]!=='VIRTUAL'){var _0x24cc0e={};_0x24cc0e[_0x11a47a[_0xfa7b('0x2a')]]={'$like':'%'+_0x39e5c4['query'][_0xfa7b('0x3d')]+'%'};return _0x24cc0e;}})});}_0x490db2=_[_0xfa7b('0x3c')]({},_0x490db2,_0x39e5c4['options']);var _0xf23ce0={'where':_0x490db2['where']};return db['CmCustomField'][_0xfa7b('0x1d')](_0xf23ce0)[_0xfa7b('0x25')](function(_0x59558b){_0x83c9a7[_0xfa7b('0x1d')]=_0x59558b;if(_0x39e5c4['query']['includeAll']){_0x490db2['include']=[{'all':!![]}];}return db['CmCustomField'][_0xfa7b('0x3e')](_0x490db2);})['then'](function(_0x2c9519){_0x83c9a7[_0xfa7b('0x3f')]=_0x2c9519;return _0x83c9a7;})[_0xfa7b('0x25')](respondWithFilteredResult(_0x47d445,_0x490db2))[_0xfa7b('0x40')](handleError(_0x47d445,null));};exports[_0xfa7b('0x41')]=function(_0x4bbde1,_0x7c54ce){var _0x5255a6={'raw':!![],'where':{'id':_0x4bbde1[_0xfa7b('0x42')]['id']}},_0x3ff069={};_0x3ff069['model']=_[_0xfa7b('0x43')](db[_0xfa7b('0x2e')]['rawAttributes']);_0x3ff069[_0xfa7b('0x33')]=_['keys'](_0x4bbde1['query']);_0x3ff069['filters']=_[_0xfa7b('0x35')](_0x3ff069[_0xfa7b('0x32')],_0x3ff069[_0xfa7b('0x33')]);_0x5255a6['attributes']=_[_0xfa7b('0x35')](_0x3ff069[_0xfa7b('0x32')],qs[_0xfa7b('0x37')](_0x4bbde1[_0xfa7b('0x33')][_0xfa7b('0x37')]));_0x5255a6[_0xfa7b('0x36')]=_0x5255a6[_0xfa7b('0x36')][_0xfa7b('0x44')]?_0x5255a6[_0xfa7b('0x36')]:_0x3ff069[_0xfa7b('0x32')];if(_0x4bbde1[_0xfa7b('0x33')]['includeAll']){_0x5255a6[_0xfa7b('0x45')]=[{'all':!![]}];}_0x5255a6=_[_0xfa7b('0x3c')]({},_0x5255a6,_0x4bbde1[_0xfa7b('0x46')]);return db[_0xfa7b('0x2e')][_0xfa7b('0x47')](_0x5255a6)[_0xfa7b('0x25')](handleEntityNotFound(_0x7c54ce,null))[_0xfa7b('0x25')](respondWithResult(_0x7c54ce,null))[_0xfa7b('0x40')](handleError(_0x7c54ce,null));};exports['update']=function(_0x1e8cbf,_0x38bce6){if(_0x1e8cbf['body']['id']){delete _0x1e8cbf[_0xfa7b('0x48')]['id'];}return db['CmCustomField'][_0xfa7b('0x47')]({'where':{'id':_0x1e8cbf[_0xfa7b('0x42')]['id']}})[_0xfa7b('0x25')](handleEntityNotFound(_0x38bce6,null))['then'](saveUpdates(_0x1e8cbf[_0xfa7b('0x48')],null))[_0xfa7b('0x25')](respondWithResult(_0x38bce6,null))[_0xfa7b('0x40')](handleError(_0x38bce6,null));};exports[_0xfa7b('0x26')]=function(_0x1b2bd9,_0x459a76){return db[_0xfa7b('0x2e')][_0xfa7b('0x47')]({'where':{'id':_0x1b2bd9[_0xfa7b('0x42')]['id']}})[_0xfa7b('0x25')](handleEntityNotFound(_0x459a76,null))['then'](removeEntity(_0x459a76,null))['catch'](handleError(_0x459a76,null));};exports[_0xfa7b('0x49')]=function(_0x5d234d,_0x3cba43){var _0x25d56b;return db[_0xfa7b('0x4a')][_0xfa7b('0x4b')](function(_0x3d9f68){return db['CmCustomField'][_0xfa7b('0x49')](_0x5d234d[_0xfa7b('0x48')],{'transaction':_0x3d9f68})[_0xfa7b('0x25')](function(_0x3b117e){_0x25d56b=_0x3b117e;var _0x5b7ada={'type':db[_0xfa7b('0x4c')][_0xfa7b('0x4d')],'transaction':_0x3d9f68};switch(_0x5d234d['body'][_0xfa7b('0x31')]){case'text':_0x5b7ada['type']=db[_0xfa7b('0x4c')]['TEXT'];break;case _0xfa7b('0x4e'):_0x5b7ada[_0xfa7b('0x31')]=db[_0xfa7b('0x4c')]['INTEGER'];break;case'switch':_0x5b7ada['type']=db[_0xfa7b('0x4c')][_0xfa7b('0x4f')];_0x5b7ada[_0xfa7b('0x50')]=![];break;default:}return db[_0xfa7b('0x4a')][_0xfa7b('0x51')]['addColumn']('cm_contacts',util['format'](_0xfa7b('0x52'),_0x25d56b['id']),_0x5b7ada);})['then'](function(){return _0x25d56b;});})[_0xfa7b('0x25')](respondWithResult(_0x3cba43,0xc9))[_0xfa7b('0x40')](handleError(_0x3cba43,null));};
\ No newline at end of file
+var _0xb635=['findAll','rows','catch','show','find','body','params','create','transaction','TEXT','type','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','CmCustomField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','then','includeAll','include'];(function(_0x44e5f6,_0x1cdb43){var _0x350e0e=function(_0x329ed1){while(--_0x329ed1){_0x44e5f6['push'](_0x44e5f6['shift']());}};_0x350e0e(++_0x1cdb43);}(_0xb635,0x11b));var _0x5b63=function(_0x13877f,_0x2605d3){_0x13877f=_0x13877f-0x0;var _0x5827fa=_0xb635[_0x13877f];return _0x5827fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b63('0x0'));var zipdir=require(_0x5b63('0x1'));var jsonpatch=require(_0x5b63('0x2'));var rp=require(_0x5b63('0x3'));var moment=require(_0x5b63('0x4'));var BPromise=require(_0x5b63('0x5'));var Mustache=require(_0x5b63('0x6'));var util=require('util');var path=require(_0x5b63('0x7'));var sox=require(_0x5b63('0x8'));var csv=require('to-csv');var ejs=require(_0x5b63('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5b63('0xa'));var squel=require(_0x5b63('0xb'));var crypto=require(_0x5b63('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5b63('0xd'));var toCsv=require(_0x5b63('0xe'));var querystring=require('querystring');var Papa=require(_0x5b63('0xf'));var Redis=require(_0x5b63('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5b63('0x11'));var hardwareService=require(_0x5b63('0x12'));var logger=require(_0x5b63('0x13'))(_0x5b63('0x14'));var utils=require(_0x5b63('0x15'));var config=require(_0x5b63('0x16'));var licenseUtil=require(_0x5b63('0x17'));var db=require(_0x5b63('0x18'))['db'];function respondWithStatusCode(_0x2d2800,_0x3ed48a){_0x3ed48a=_0x3ed48a||0xcc;return function(_0x39419f){if(_0x39419f){return _0x2d2800['sendStatus'](_0x3ed48a);}return _0x2d2800[_0x5b63('0x19')](_0x3ed48a)[_0x5b63('0x1a')]();};}function respondWithResult(_0x499cd9,_0x636744){_0x636744=_0x636744||0xc8;return function(_0x13d153){if(_0x13d153){return _0x499cd9[_0x5b63('0x19')](_0x636744)[_0x5b63('0x1b')](_0x13d153);}};}function respondWithFilteredResult(_0x43bc21,_0x269969){return function(_0x4ce577){if(_0x4ce577){var _0x135b96=typeof _0x269969[_0x5b63('0x1c')]===_0x5b63('0x1d')&&typeof _0x269969['limit']==='undefined';var _0x3c28a2=_0x4ce577[_0x5b63('0x1e')];var _0x10e9bf=_0x135b96?0x0:_0x269969[_0x5b63('0x1c')];var _0x4bb73a=_0x135b96?_0x4ce577[_0x5b63('0x1e')]:_0x269969[_0x5b63('0x1c')]+_0x269969[_0x5b63('0x1f')];var _0x3d6e5a;if(_0x4bb73a>=_0x3c28a2){_0x4bb73a=_0x3c28a2;_0x3d6e5a=0xc8;}else{_0x3d6e5a=0xce;}_0x43bc21[_0x5b63('0x19')](_0x3d6e5a);return _0x43bc21[_0x5b63('0x20')](_0x5b63('0x21'),_0x10e9bf+'-'+_0x4bb73a+'/'+_0x3c28a2)[_0x5b63('0x1b')](_0x4ce577);}return null;};}function patchUpdates(_0x1e311e){return function(_0x1722ab){try{jsonpatch[_0x5b63('0x22')](_0x1722ab,_0x1e311e,!![]);}catch(_0x436142){return BPromise[_0x5b63('0x23')](_0x436142);}return _0x1722ab[_0x5b63('0x24')]();};}function saveUpdates(_0x3d586a,_0x1e242e){return function(_0x285eef){if(_0x285eef){return _0x285eef[_0x5b63('0x25')](_0x3d586a)['then'](function(_0x163a74){return _0x163a74;});}return null;};}function removeEntity(_0x4ee936,_0x3be8f8){return function(_0x5431bb){if(_0x5431bb){return _0x5431bb[_0x5b63('0x26')]()['then'](function(){_0x4ee936[_0x5b63('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x351c43,_0x37ff88){return function(_0x17dd05){if(!_0x17dd05){_0x351c43[_0x5b63('0x27')](0x194);}return _0x17dd05;};}function handleError(_0x554c16,_0x4894cf){_0x4894cf=_0x4894cf||0x1f4;return function(_0x929e74){logger[_0x5b63('0x28')](_0x929e74['stack']);if(_0x929e74[_0x5b63('0x29')]){delete _0x929e74[_0x5b63('0x29')];}_0x554c16['status'](_0x4894cf)['send'](_0x929e74);};}exports['index']=function(_0x7c5d74,_0x1f68ca){var _0x3bcbbb={},_0x150335={},_0x2fa652={'count':0x0,'rows':[]};var _0x268548=_['map'](db[_0x5b63('0x2a')][_0x5b63('0x2b')],function(_0x81cd5e){return{'name':_0x81cd5e[_0x5b63('0x2c')],'type':_0x81cd5e['type'][_0x5b63('0x2d')]};});_0x150335[_0x5b63('0x2e')]=_['differenceBy'](_['map'](_0x268548,_0x5b63('0x29')),[_0x5b63('0x29')]);_0x150335[_0x5b63('0x2f')]=_[_0x5b63('0x30')](_0x7c5d74[_0x5b63('0x2f')]);_0x150335[_0x5b63('0x31')]=_[_0x5b63('0x32')](_0x150335[_0x5b63('0x2e')],_0x150335[_0x5b63('0x2f')]);_0x3bcbbb['attributes']=_['intersection'](_0x150335['model'],qs[_0x5b63('0x33')](_0x7c5d74['query'][_0x5b63('0x33')]));_0x3bcbbb[_0x5b63('0x34')]=_0x3bcbbb[_0x5b63('0x34')][_0x5b63('0x35')]?_0x3bcbbb['attributes']:_0x150335[_0x5b63('0x2e')];if(!_0x7c5d74[_0x5b63('0x2f')][_0x5b63('0x36')]('nolimit')){_0x3bcbbb[_0x5b63('0x1f')]=qs[_0x5b63('0x1f')](_0x7c5d74[_0x5b63('0x2f')][_0x5b63('0x1f')]);_0x3bcbbb[_0x5b63('0x1c')]=qs[_0x5b63('0x1c')](_0x7c5d74[_0x5b63('0x2f')][_0x5b63('0x1c')]);}_0x3bcbbb[_0x5b63('0x37')]=qs[_0x5b63('0x38')](_0x7c5d74['query'][_0x5b63('0x38')]);_0x3bcbbb[_0x5b63('0x39')]=qs[_0x5b63('0x31')](_['pick'](_0x7c5d74[_0x5b63('0x2f')],_0x150335['filters']),_0x268548);if(_0x7c5d74[_0x5b63('0x2f')][_0x5b63('0x3a')]){_0x3bcbbb[_0x5b63('0x39')]=_[_0x5b63('0x3b')](_0x3bcbbb[_0x5b63('0x39')],{'$or':_[_0x5b63('0x3c')](_0x268548,function(_0x3907b4){if(_0x3907b4['type']!==_0x5b63('0x3d')){var _0x16c132={};_0x16c132[_0x3907b4[_0x5b63('0x29')]]={'$like':'%'+_0x7c5d74[_0x5b63('0x2f')]['filter']+'%'};return _0x16c132;}})});}_0x3bcbbb=_[_0x5b63('0x3b')]({},_0x3bcbbb,_0x7c5d74['options']);var _0x5a54c3={'where':_0x3bcbbb[_0x5b63('0x39')]};return db[_0x5b63('0x2a')][_0x5b63('0x1e')](_0x5a54c3)[_0x5b63('0x3e')](function(_0x13d9a6){_0x2fa652[_0x5b63('0x1e')]=_0x13d9a6;if(_0x7c5d74[_0x5b63('0x2f')][_0x5b63('0x3f')]){_0x3bcbbb[_0x5b63('0x40')]=[{'all':!![]}];}return db[_0x5b63('0x2a')][_0x5b63('0x41')](_0x3bcbbb);})[_0x5b63('0x3e')](function(_0x5075c6){_0x2fa652[_0x5b63('0x42')]=_0x5075c6;return _0x2fa652;})[_0x5b63('0x3e')](respondWithFilteredResult(_0x1f68ca,_0x3bcbbb))[_0x5b63('0x43')](handleError(_0x1f68ca,null));};exports[_0x5b63('0x44')]=function(_0x1cec4a,_0x51cd9d){var _0x564732={'raw':!![],'where':{'id':_0x1cec4a['params']['id']}},_0x2b890a={};_0x2b890a[_0x5b63('0x2e')]=_['keys'](db[_0x5b63('0x2a')][_0x5b63('0x2b')]);_0x2b890a['query']=_[_0x5b63('0x30')](_0x1cec4a[_0x5b63('0x2f')]);_0x2b890a[_0x5b63('0x31')]=_[_0x5b63('0x32')](_0x2b890a[_0x5b63('0x2e')],_0x2b890a[_0x5b63('0x2f')]);_0x564732[_0x5b63('0x34')]=_[_0x5b63('0x32')](_0x2b890a[_0x5b63('0x2e')],qs['fields'](_0x1cec4a['query'][_0x5b63('0x33')]));_0x564732['attributes']=_0x564732[_0x5b63('0x34')][_0x5b63('0x35')]?_0x564732['attributes']:_0x2b890a[_0x5b63('0x2e')];if(_0x1cec4a[_0x5b63('0x2f')][_0x5b63('0x3f')]){_0x564732[_0x5b63('0x40')]=[{'all':!![]}];}_0x564732=_[_0x5b63('0x3b')]({},_0x564732,_0x1cec4a['options']);return db['CmCustomField'][_0x5b63('0x45')](_0x564732)['then'](handleEntityNotFound(_0x51cd9d,null))[_0x5b63('0x3e')](respondWithResult(_0x51cd9d,null))[_0x5b63('0x43')](handleError(_0x51cd9d,null));};exports['update']=function(_0x5c4da5,_0x254b2c){if(_0x5c4da5[_0x5b63('0x46')]['id']){delete _0x5c4da5[_0x5b63('0x46')]['id'];}return db[_0x5b63('0x2a')][_0x5b63('0x45')]({'where':{'id':_0x5c4da5[_0x5b63('0x47')]['id']}})[_0x5b63('0x3e')](handleEntityNotFound(_0x254b2c,null))[_0x5b63('0x3e')](saveUpdates(_0x5c4da5[_0x5b63('0x46')],null))[_0x5b63('0x3e')](respondWithResult(_0x254b2c,null))[_0x5b63('0x43')](handleError(_0x254b2c,null));};exports[_0x5b63('0x26')]=function(_0x43c64a,_0x25c55b){return db[_0x5b63('0x2a')][_0x5b63('0x45')]({'where':{'id':_0x43c64a[_0x5b63('0x47')]['id']}})['then'](handleEntityNotFound(_0x25c55b,null))[_0x5b63('0x3e')](removeEntity(_0x25c55b,null))[_0x5b63('0x43')](handleError(_0x25c55b,null));};exports[_0x5b63('0x48')]=function(_0x490759,_0x598c57){var _0x143684;return db['sequelize'][_0x5b63('0x49')](function(_0xddb19e){return db[_0x5b63('0x2a')][_0x5b63('0x48')](_0x490759['body'],{'transaction':_0xddb19e})['then'](function(_0x5b6d45){_0x143684=_0x5b6d45;var _0x20254b={'type':db['Sequelize'][_0x5b63('0x4a')],'transaction':_0xddb19e};switch(_0x490759[_0x5b63('0x46')][_0x5b63('0x4b')]){case _0x5b63('0x4c'):_0x20254b[_0x5b63('0x4b')]=db[_0x5b63('0x4d')]['TEXT'];break;case _0x5b63('0x4e'):_0x20254b[_0x5b63('0x4b')]=db[_0x5b63('0x4d')][_0x5b63('0x4f')];break;case _0x5b63('0x50'):_0x20254b[_0x5b63('0x4b')]=db[_0x5b63('0x4d')][_0x5b63('0x51')];_0x20254b[_0x5b63('0x52')]=![];break;default:}return db[_0x5b63('0x53')]['queryInterface']['addColumn'](_0x5b63('0x54'),util[_0x5b63('0x55')](_0x5b63('0x56'),_0x143684['id']),_0x20254b);})[_0x5b63('0x3e')](function(){return _0x143684;});})[_0x5b63('0x3e')](respondWithResult(_0x598c57,0xc9))['catch'](handleError(_0x598c57,null));};
\ No newline at end of file
index a0d18c9..d90c923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ea0=['rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird','path'];(function(_0x25cabb,_0x46f3a8){var _0x284423=function(_0x4ff79f){while(--_0x4ff79f){_0x25cabb['push'](_0x25cabb['shift']());}};_0x284423(++_0x46f3a8);}(_0x1ea0,0xf6));var _0x01ea=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1ea0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x01ea('0x0'));var util=require(_0x01ea('0x1'));var logger=require('../../config/logger')(_0x01ea('0x2'));var moment=require(_0x01ea('0x3'));var BPromise=require(_0x01ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01ea('0x5'));var rimraf=require(_0x01ea('0x6'));var config=require(_0x01ea('0x7'));var attributes=require(_0x01ea('0x8'));module['exports']=function(_0x1857d7,_0x20a427){return _0x1857d7[_0x01ea('0x9')](_0x01ea('0xa'),attributes,{'tableName':_0x01ea('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaac0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','cm_custom_fields','lodash','util'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xaac0,0x106));var _0x0aac=function(_0x2d8f05,_0x3cfe31){_0x2d8f05=_0x2d8f05-0x0;var _0x25254c=_0xaac0[_0x2d8f05];return _0x25254c;};'use strict';var _=require(_0x0aac('0x0'));var util=require(_0x0aac('0x1'));var logger=require(_0x0aac('0x2'))(_0x0aac('0x3'));var moment=require(_0x0aac('0x4'));var BPromise=require(_0x0aac('0x5'));var rp=require(_0x0aac('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0aac('0x7'));var config=require(_0x0aac('0x8'));var attributes=require(_0x0aac('0x9'));module['exports']=function(_0x5653e8,_0x52f6e7){return _0x5653e8['define']('CmCustomField',attributes,{'tableName':_0x0aac('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4309279..eeb9b59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa96e=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0xa96e,0x127));var _0xea96=function(_0x21bb7b,_0x3284c3){_0x21bb7b=_0x21bb7b-0x0;var _0x1e05bf=_0xa96e[_0x21bb7b];return _0x1e05bf;};'use strict';var _=require(_0xea96('0x0'));var util=require('util');var moment=require(_0xea96('0x1'));var BPromise=require(_0xea96('0x2'));var rs=require(_0xea96('0x3'));var fs=require('fs');var Redis=require(_0xea96('0x4'));var db=require(_0xea96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xea96('0x6'))('rpc');var config=require(_0xea96('0x7'));var jayson=require(_0xea96('0x8'));var client=jayson[_0xea96('0x9')][_0xea96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46bd01,_0x26dbb7,_0x52d260){return new BPromise(function(_0x5dec21,_0xb63e06){return client[_0xea96('0xb')](_0x46bd01,_0x52d260)['then'](function(_0x5f0dd1){logger[_0xea96('0xc')](_0xea96('0xd'),_0x26dbb7,_0xea96('0xe'));logger[_0xea96('0xf')](_0xea96('0x10'),_0x26dbb7,_0xea96('0xe'),JSON[_0xea96('0x11')](_0x5f0dd1));if(_0x5f0dd1['error']){if(_0x5f0dd1[_0xea96('0x12')][_0xea96('0x13')]===0x1f4){logger['error'](_0xea96('0xd'),_0x26dbb7,_0x5f0dd1[_0xea96('0x12')][_0xea96('0x14')]);return _0xb63e06(_0x5f0dd1[_0xea96('0x12')][_0xea96('0x14')]);}logger[_0xea96('0x12')](_0xea96('0xd'),_0x26dbb7,_0x5f0dd1['error'][_0xea96('0x14')]);return _0x5dec21(_0x5f0dd1[_0xea96('0x12')]['message']);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x26dbb7,_0xea96('0xe'));_0x5dec21(_0x5f0dd1[_0xea96('0x15')][_0xea96('0x14')]);}})[_0xea96('0x16')](function(_0x666305){logger[_0xea96('0x12')](_0xea96('0xd'),_0x26dbb7,_0x666305);_0xb63e06(_0x666305);});});}
\ No newline at end of file
+var _0x8bfd=['http','request','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','CmCustomField,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2f861c,_0x548dd1){var _0x12cff7=function(_0x205175){while(--_0x205175){_0x2f861c['push'](_0x2f861c['shift']());}};_0x12cff7(++_0x548dd1);}(_0x8bfd,0xdb));var _0xd8bf=function(_0x5dac46,_0x28e9dc){_0x5dac46=_0x5dac46-0x0;var _0x51095c=_0x8bfd[_0x5dac46];return _0x51095c;};'use strict';var _=require('lodash');var util=require(_0xd8bf('0x0'));var moment=require(_0xd8bf('0x1'));var BPromise=require(_0xd8bf('0x2'));var rs=require(_0xd8bf('0x3'));var fs=require('fs');var Redis=require(_0xd8bf('0x4'));var db=require(_0xd8bf('0x5'))['db'];var utils=require(_0xd8bf('0x6'));var logger=require('../../config/logger')(_0xd8bf('0x7'));var config=require(_0xd8bf('0x8'));var jayson=require(_0xd8bf('0x9'));var client=jayson[_0xd8bf('0xa')][_0xd8bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x86ca3b,_0x4288e2,_0x9b05f7){return new BPromise(function(_0xda50b,_0x1799d2){return client[_0xd8bf('0xc')](_0x86ca3b,_0x9b05f7)[_0xd8bf('0xd')](function(_0x251f32){logger[_0xd8bf('0xe')]('CmCustomField,\x20%s,\x20%s',_0x4288e2,_0xd8bf('0xf'));logger[_0xd8bf('0x10')](_0xd8bf('0x11'),_0x4288e2,_0xd8bf('0xf'),JSON['stringify'](_0x251f32));if(_0x251f32[_0xd8bf('0x12')]){if(_0x251f32[_0xd8bf('0x12')]['code']===0x1f4){logger[_0xd8bf('0x12')](_0xd8bf('0x13'),_0x4288e2,_0x251f32[_0xd8bf('0x12')]['message']);return _0x1799d2(_0x251f32[_0xd8bf('0x12')][_0xd8bf('0x14')]);}logger[_0xd8bf('0x12')]('CmCustomField,\x20%s,\x20%s',_0x4288e2,_0x251f32['error']['message']);return _0xda50b(_0x251f32[_0xd8bf('0x12')][_0xd8bf('0x14')]);}else{logger[_0xd8bf('0xe')]('CmCustomField,\x20%s,\x20%s',_0x4288e2,'request\x20sent');_0xda50b(_0x251f32[_0xd8bf('0x15')][_0xd8bf('0x14')]);}})[_0xd8bf('0x16')](function(_0x5578a7){logger[_0xd8bf('0x12')](_0xd8bf('0x13'),_0x4288e2,_0x5578a7);_0x1799d2(_0x5578a7);});});}
\ No newline at end of file
index 3267a6b..3a0d974 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee4=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x321f4a,_0x841f18){var _0x4fc623=function(_0x1f9332){while(--_0x1f9332){_0x321f4a['push'](_0x321f4a['shift']());}};_0x4fc623(++_0x841f18);}(_0x7ee4,0xbc));var _0x47ee=function(_0x2b6235,_0xadfbcf){_0x2b6235=_0x2b6235-0x0;var _0x4cee7f=_0x7ee4[_0x2b6235];return _0x4cee7f;};'use strict';var multer=require(_0x47ee('0x0'));var util=require(_0x47ee('0x1'));var path=require('path');var timeout=require(_0x47ee('0x2'));var express=require(_0x47ee('0x3'));var router=express['Router']();var fs_extra=require(_0x47ee('0x4'));var auth=require(_0x47ee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x47ee('0x6'));var controller=require('./cmCustomField.controller');router[_0x47ee('0x7')]('/',auth[_0x47ee('0x8')](),controller[_0x47ee('0x9')]);router[_0x47ee('0x7')](_0x47ee('0xa'),auth[_0x47ee('0x8')](),controller[_0x47ee('0xb')]);router[_0x47ee('0xc')]('/',auth['isAuthenticated'](),controller[_0x47ee('0xd')]);router[_0x47ee('0xe')](_0x47ee('0xa'),auth[_0x47ee('0x8')](),controller[_0x47ee('0xf')]);router[_0x47ee('0x10')](_0x47ee('0xa'),auth['isAuthenticated'](),controller[_0x47ee('0x11')]);module[_0x47ee('0x12')]=router;
\ No newline at end of file
+var _0xd383=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x44cfab,_0x4b0618){var _0x2e5aa9=function(_0x2e5c91){while(--_0x2e5c91){_0x44cfab['push'](_0x44cfab['shift']());}};_0x2e5aa9(++_0x4b0618);}(_0xd383,0x1c4));var _0x3d38=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xd383[_0x2aecb2];return _0x3ebb80;};'use strict';var multer=require(_0x3d38('0x0'));var util=require(_0x3d38('0x1'));var path=require(_0x3d38('0x2'));var timeout=require(_0x3d38('0x3'));var express=require(_0x3d38('0x4'));var router=express[_0x3d38('0x5')]();var fs_extra=require(_0x3d38('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3d38('0x7'));var config=require(_0x3d38('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3d38('0x9')]);router[_0x3d38('0xa')](_0x3d38('0xb'),auth[_0x3d38('0xc')](),controller['show']);router[_0x3d38('0xd')]('/',auth[_0x3d38('0xc')](),controller[_0x3d38('0xe')]);router['put'](_0x3d38('0xb'),auth[_0x3d38('0xc')](),controller[_0x3d38('0xf')]);router[_0x3d38('0x10')]('/:id',auth[_0x3d38('0xc')](),controller[_0x3d38('0x11')]);module[_0x3d38('0x12')]=router;
\ No newline at end of file
index a940fbb..b07e830 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5e7=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','BOOLEAN','contactListQueue','moment','sequelize','exports'];(function(_0x2b2c3f,_0x4a630d){var _0x11703d=function(_0x45c6e1){while(--_0x45c6e1){_0x2b2c3f['push'](_0x2b2c3f['shift']());}};_0x11703d(++_0x4a630d);}(_0xd5e7,0x1e1));var _0x7d5e=function(_0x20c7f0,_0x401ee8){_0x20c7f0=_0x20c7f0-0x0;var _0x1040b6=_0xd5e7[_0x20c7f0];return _0x1040b6;};'use strict';var moment=require(_0x7d5e('0x0'));var Sequelize=require(_0x7d5e('0x1'));module[_0x7d5e('0x2')]={'phone':{'type':Sequelize[_0x7d5e('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x7d5e('0x4')],'defaultValue':moment()[_0x7d5e('0x5')](_0x7d5e('0x6'))},'countbusyretry':{'type':Sequelize[_0x7d5e('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7d5e('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7d5e('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7d5e('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7d5e('0x4')]},'priority':{'type':Sequelize[_0x7d5e('0x7')](0x2)[_0x7d5e('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x7d5e('0x9')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x7d5e('0x7')],'unique':_0x7d5e('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7d5e('0xa')},'UserId':{'type':Sequelize[_0x7d5e('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x7d5e('0x7')],'unique':_0x7d5e('0xa')},'CampaignId':{'type':Sequelize[_0x7d5e('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7d5e('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7d5e('0x7')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xa300=['BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x9bfd98,_0x4ca203){var _0x30e1c1=function(_0x325d87){while(--_0x325d87){_0x9bfd98['push'](_0x9bfd98['shift']());}};_0x30e1c1(++_0x4ca203);}(_0xa300,0xc0));var _0x0a30=function(_0x103c9c,_0x40d175){_0x103c9c=_0x103c9c-0x0;var _0x5a5b5f=_0xa300[_0x103c9c];return _0x5a5b5f;};'use strict';var moment=require(_0x0a30('0x0'));var Sequelize=require(_0x0a30('0x1'));module[_0x0a30('0x2')]={'phone':{'type':Sequelize[_0x0a30('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x0a30('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x0a30('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0a30('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0a30('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0a30('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0a30('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0a30('0x4')]},'priority':{'type':Sequelize[_0x0a30('0x5')](0x2)[_0x0a30('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0a30('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0a30('0x5')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x0a30('0x5')],'unique':_0x0a30('0x8')},'UserId':{'type':Sequelize[_0x0a30('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x0a30('0x5')],'unique':_0x0a30('0x8')},'CampaignId':{'type':Sequelize[_0x0a30('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x0a30('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0a30('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0a30('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 1c6d7e5..547e897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bd6=['$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$like','$iLike','$notILike','$contains','$any','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmHopper','includeAll','include','rows','catch','show','params','create','body','find','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','updatedAt','state','deleted','campaign','membername','UserId','user','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','CmContact','dialOrderByScheduledAt','sequelize','transaction','format','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','findOne','scheduledat','LOCK','Contact','CmCompany','CmList','VoiceQueue','Queue','dialActive','getOpenContacts','getVoiceQueues','outbound','preview','isNumber','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','concat','$and','$or'];(function(_0x58b882,_0x3b28c2){var _0x2bf184=function(_0x5d97e3){while(--_0x5d97e3){_0x58b882['push'](_0x58b882['shift']());}};_0x2bf184(++_0x3b28c2);}(_0x8bd6,0xf0));var _0x68bd=function(_0x118395,_0x202258){_0x118395=_0x118395-0x0;var _0x5ccecd=_0x8bd6[_0x118395];return _0x5ccecd;};'use strict';var emlformat=require(_0x68bd('0x0'));var rimraf=require(_0x68bd('0x1'));var zipdir=require(_0x68bd('0x2'));var jsonpatch=require(_0x68bd('0x3'));var rp=require('request-promise');var moment=require(_0x68bd('0x4'));var BPromise=require(_0x68bd('0x5'));var Mustache=require('mustache');var util=require(_0x68bd('0x6'));var path=require('path');var sox=require(_0x68bd('0x7'));var csv=require('to-csv');var ejs=require(_0x68bd('0x8'));var fs=require('fs');var fs_extra=require(_0x68bd('0x9'));var _=require('lodash');var squel=require(_0x68bd('0xa'));var crypto=require(_0x68bd('0xb'));var jsforce=require(_0x68bd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x68bd('0xd'));var querystring=require(_0x68bd('0xe'));var Papa=require(_0x68bd('0xf'));var Redis=require(_0x68bd('0x10'));var authService=require(_0x68bd('0x11'));var qs=require(_0x68bd('0x12'));var as=require(_0x68bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x68bd('0x14'))(_0x68bd('0x15'));var utils=require('../../config/utils');var config=require(_0x68bd('0x16'));var licenseUtil=require(_0x68bd('0x17'));var db=require(_0x68bd('0x18'))['db'];function respondWithStatusCode(_0x59810b,_0x53d53f){_0x53d53f=_0x53d53f||0xcc;return function(_0x48bea1){if(_0x48bea1){return _0x59810b[_0x68bd('0x19')](_0x53d53f);}return _0x59810b['status'](_0x53d53f)['end']();};}function respondWithResult(_0x333039,_0x5bbdc9){_0x5bbdc9=_0x5bbdc9||0xc8;return function(_0x3a7d57){if(_0x3a7d57){return _0x333039[_0x68bd('0x1a')](_0x5bbdc9)[_0x68bd('0x1b')](_0x3a7d57);}};}function respondWithFilteredResult(_0x5c0cbc,_0x44e59d){return function(_0x46f4b2){if(_0x46f4b2){var _0x396118=typeof _0x44e59d[_0x68bd('0x1c')]===_0x68bd('0x1d')&&typeof _0x44e59d[_0x68bd('0x1e')]===_0x68bd('0x1d');var _0x1c8dcc=_0x46f4b2[_0x68bd('0x1f')];var _0x1c8642=_0x396118?0x0:_0x44e59d[_0x68bd('0x1c')];var _0x125016=_0x396118?_0x46f4b2[_0x68bd('0x1f')]:_0x44e59d[_0x68bd('0x1c')]+_0x44e59d['limit'];var _0x352d1e;if(_0x125016>=_0x1c8dcc){_0x125016=_0x1c8dcc;_0x352d1e=0xc8;}else{_0x352d1e=0xce;}_0x5c0cbc['status'](_0x352d1e);return _0x5c0cbc[_0x68bd('0x20')](_0x68bd('0x21'),_0x1c8642+'-'+_0x125016+'/'+_0x1c8dcc)[_0x68bd('0x1b')](_0x46f4b2);}return null;};}function patchUpdates(_0x40dc12){return function(_0x2ce493){try{jsonpatch[_0x68bd('0x22')](_0x2ce493,_0x40dc12,!![]);}catch(_0x19f194){return BPromise[_0x68bd('0x23')](_0x19f194);}return _0x2ce493[_0x68bd('0x24')]();};}function saveUpdates(_0x167af4,_0xfa5d0d){return function(_0x16e28c){if(_0x16e28c){return _0x16e28c[_0x68bd('0x25')](_0x167af4)[_0x68bd('0x26')](function(_0x2306fa){return _0x2306fa;});}return null;};}function removeEntity(_0x3eb7f4,_0x5443f9){return function(_0xc61a53){if(_0xc61a53){return _0xc61a53[_0x68bd('0x27')]()[_0x68bd('0x26')](function(){_0x3eb7f4['status'](0xcc)[_0x68bd('0x28')]();});}};}function handleEntityNotFound(_0x10c9c7,_0x2a81fe){return function(_0x29f08d){if(!_0x29f08d){_0x10c9c7[_0x68bd('0x19')](0x194);}return _0x29f08d;};}function handleError(_0x89068f,_0x5d6a31){_0x5d6a31=_0x5d6a31||0x1f4;return function(_0x37c92b){logger[_0x68bd('0x29')](_0x37c92b[_0x68bd('0x2a')]);if(_0x37c92b[_0x68bd('0x2b')]){delete _0x37c92b[_0x68bd('0x2b')];}_0x89068f[_0x68bd('0x1a')](_0x5d6a31)[_0x68bd('0x2c')](_0x37c92b);};}exports[_0x68bd('0x2d')]=function(_0x41cb67,_0x58391e){var _0x5d8517={},_0x43e088={},_0x4d325a={'count':0x0,'rows':[]};var _0x5cf70f=_[_0x68bd('0x2e')](db['CmHopper'][_0x68bd('0x2f')],function(_0x330ff9){return{'name':_0x330ff9[_0x68bd('0x30')],'type':_0x330ff9[_0x68bd('0x31')]['key']};});_0x43e088['model']=_[_0x68bd('0x2e')](_0x5cf70f,_0x68bd('0x2b'));_0x43e088['query']=_[_0x68bd('0x32')](_0x41cb67[_0x68bd('0x33')]);_0x43e088[_0x68bd('0x34')]=_[_0x68bd('0x35')](_0x43e088[_0x68bd('0x36')],_0x43e088['query']);_0x43e088[_0x68bd('0x34')]=_[_0x68bd('0x37')](_0x43e088[_0x68bd('0x34')],[_0x68bd('0x38'),_0x68bd('0x39'),_0x68bd('0x3a'),_0x68bd('0x3b'),_0x68bd('0x3c'),'$lte',_0x68bd('0x3d'),_0x68bd('0x3e'),_0x68bd('0x3f'),'$between',_0x68bd('0x40'),'$in','$notIn',_0x68bd('0x41'),'$notLike',_0x68bd('0x42'),_0x68bd('0x43'),_0x68bd('0x41'),'$overlap',_0x68bd('0x44'),'$contained',_0x68bd('0x45')]);_0x5d8517[_0x68bd('0x46')]=_[_0x68bd('0x35')](_0x43e088[_0x68bd('0x36')],qs[_0x68bd('0x47')](_0x41cb67[_0x68bd('0x33')][_0x68bd('0x47')]));_0x5d8517['attributes']=_0x5d8517[_0x68bd('0x46')][_0x68bd('0x48')]?_0x5d8517['attributes']:_0x43e088[_0x68bd('0x36')];if(!_0x41cb67[_0x68bd('0x33')]['hasOwnProperty'](_0x68bd('0x49'))){_0x5d8517['limit']=qs[_0x68bd('0x1e')](_0x41cb67['query'][_0x68bd('0x1e')]);_0x5d8517[_0x68bd('0x1c')]=qs['offset'](_0x41cb67[_0x68bd('0x33')]['offset']);}_0x5d8517['order']=qs[_0x68bd('0x4a')](_0x41cb67[_0x68bd('0x33')]['sort']);_0x5d8517[_0x68bd('0x4b')]=qs[_0x68bd('0x34')](_[_0x68bd('0x4c')](_0x41cb67[_0x68bd('0x33')],_0x43e088[_0x68bd('0x34')]),_0x5cf70f);if(_0x41cb67['query'][_0x68bd('0x4d')]){_0x5d8517[_0x68bd('0x4b')]=_[_0x68bd('0x4e')](_0x5d8517[_0x68bd('0x4b')],{'$or':_[_0x68bd('0x2e')](_0x5cf70f,function(_0x6e00b6){if(_0x6e00b6[_0x68bd('0x31')]!==_0x68bd('0x4f')){var _0x570e65={};_0x570e65[_0x6e00b6[_0x68bd('0x2b')]]={'$like':'%'+_0x41cb67[_0x68bd('0x33')][_0x68bd('0x4d')]+'%'};return _0x570e65;}})});}_0x5d8517=_[_0x68bd('0x4e')]({},_0x5d8517,_0x41cb67[_0x68bd('0x50')]);var _0x764851={'where':_0x5d8517[_0x68bd('0x4b')]};return db[_0x68bd('0x51')]['count'](_0x764851)[_0x68bd('0x26')](function(_0x539bbe){_0x4d325a[_0x68bd('0x1f')]=_0x539bbe;if(_0x41cb67[_0x68bd('0x33')][_0x68bd('0x52')]){_0x5d8517[_0x68bd('0x53')]=[{'all':!![]}];}return db[_0x68bd('0x51')]['findAll'](_0x5d8517);})['then'](function(_0x81c28f){_0x4d325a[_0x68bd('0x54')]=_0x81c28f;return _0x4d325a;})[_0x68bd('0x26')](respondWithFilteredResult(_0x58391e,_0x5d8517))[_0x68bd('0x55')](handleError(_0x58391e,null));};exports[_0x68bd('0x56')]=function(_0x3687ab,_0x1f481f){var _0x126fe4={'raw':!![],'where':{'id':_0x3687ab[_0x68bd('0x57')]['id']}},_0x31e97c={};_0x31e97c[_0x68bd('0x36')]=_[_0x68bd('0x32')](db['CmHopper']['rawAttributes']);_0x31e97c[_0x68bd('0x33')]=_[_0x68bd('0x32')](_0x3687ab[_0x68bd('0x33')]);_0x31e97c['filters']=_[_0x68bd('0x35')](_0x31e97c[_0x68bd('0x36')],_0x31e97c['query']);_0x126fe4[_0x68bd('0x46')]=_['intersection'](_0x31e97c['model'],qs[_0x68bd('0x47')](_0x3687ab[_0x68bd('0x33')][_0x68bd('0x47')]));_0x126fe4['attributes']=_0x126fe4[_0x68bd('0x46')][_0x68bd('0x48')]?_0x126fe4[_0x68bd('0x46')]:_0x31e97c[_0x68bd('0x36')];if(_0x3687ab[_0x68bd('0x33')][_0x68bd('0x52')]){_0x126fe4[_0x68bd('0x53')]=[{'all':!![]}];}_0x126fe4=_['merge']({},_0x126fe4,_0x3687ab[_0x68bd('0x50')]);return db[_0x68bd('0x51')]['find'](_0x126fe4)[_0x68bd('0x26')](handleEntityNotFound(_0x1f481f,null))[_0x68bd('0x26')](respondWithResult(_0x1f481f,null))[_0x68bd('0x55')](handleError(_0x1f481f,null));};exports[_0x68bd('0x58')]=function(_0x1c2900,_0x3bdfaa){return db[_0x68bd('0x51')][_0x68bd('0x58')](_0x1c2900[_0x68bd('0x59')],{})[_0x68bd('0x26')](respondWithResult(_0x3bdfaa,0xc9))[_0x68bd('0x55')](handleError(_0x3bdfaa,null));};exports[_0x68bd('0x25')]=function(_0x4db9a1,_0xaa7b4e){if(_0x4db9a1[_0x68bd('0x59')]['id']){delete _0x4db9a1[_0x68bd('0x59')]['id'];}return db[_0x68bd('0x51')][_0x68bd('0x5a')]({'where':{'id':_0x4db9a1[_0x68bd('0x57')]['id']}})['then'](handleEntityNotFound(_0xaa7b4e,null))['then'](saveUpdates(_0x4db9a1['body'],null))[_0x68bd('0x26')](respondWithResult(_0xaa7b4e,null))[_0x68bd('0x55')](handleError(_0xaa7b4e,null));};exports['describe']=function(_0x4bade5,_0xeac3da){return db[_0x68bd('0x51')][_0x68bd('0x5b')]()[_0x68bd('0x26')](respondWithResult(_0xeac3da,null))['catch'](handleError(_0xeac3da,null));};exports[_0x68bd('0x27')]=function(_0x1e6f32,_0xc0d1c9){var _0x37c67d;return db['CmHopper'][_0x68bd('0x5a')]({'where':{'id':_0x1e6f32[_0x68bd('0x57')]['id']}})['then'](handleEntityNotFound(_0xc0d1c9,null))['then'](function(_0x2874b5){if(_0x2874b5){return _0x2874b5['destroy']()['then'](function(_0xbe3c99){return _0xbe3c99;});}})[_0x68bd('0x26')](function(_0x36d343){_0x37c67d=_0x36d343;if(_0x36d343){if(_0x36d343[_0x68bd('0x5c')]||_0x36d343[_0x68bd('0x5d')]){return db[_0x36d343[_0x68bd('0x5c')]?'VoiceQueue':_0x68bd('0x5e')]['find']({'where':{'id':_0x36d343[_0x68bd('0x5c')]?_0x36d343['VoiceQueueId']:_0x36d343['CampaignId']},'attributes':['id',_0x68bd('0x2b')],'raw':!![]});}}})[_0x68bd('0x26')](function(_0x4637d2){var _0x483eb5={};if(_0x4637d2){_[_0x68bd('0x4e')](_0x483eb5,_[_0x68bd('0x5f')](_0x37c67d[_0x68bd('0x60')],[_0x68bd('0x61'),_0x68bd('0x62'),'id']));_0x483eb5[_0x68bd('0x63')]=0x15;_0x483eb5['statedesc']=_0x68bd('0x64');_0x483eb5[_0x68bd('0x65')]=_0x4637d2[_0x68bd('0x2b')];_0x483eb5[_0x68bd('0x66')]=_0x1e6f32['user'][_0x68bd('0x2b')];_0x483eb5[_0x68bd('0x67')]=_0x1e6f32[_0x68bd('0x68')]['id'];_0x483eb5[_0x68bd('0x64')]=!![];_0x483eb5[_0x68bd('0x69')]=moment()['format'](_0x68bd('0x6a'));_0x483eb5[_0x68bd('0x6b')]=_0x37c67d[_0x68bd('0x6c')];_0x483eb5[_0x68bd('0x6d')]=_0x37c67d['VoiceQueueId']?_0x68bd('0x6e'):_0x68bd('0x6f');return db['CmContact'][_0x68bd('0x5a')]({'where':{'id':_0x483eb5[_0x68bd('0x70')]},'attributes':[_0x68bd('0x71'),_0x68bd('0x72')]})[_0x68bd('0x26')](function(_0x30d452){if(!_[_0x68bd('0x73')](_0xc0d1c9)&&!_['isNil'](_0x30d452[_0x68bd('0x71')])){_0x483eb5[_0x68bd('0x74')]=_0x30d452[_0x68bd('0x71')];if(!_[_0x68bd('0x73')](_0x30d452[_0x68bd('0x72')])){_0x483eb5['calleridname']+='\x20'+_0x30d452['lastName'];}}})[_0x68bd('0x75')](function(){return db[_0x68bd('0x76')][_0x68bd('0x58')](_0x483eb5);});}})[_0x68bd('0x26')](function(){return _0xc0d1c9[_0x68bd('0x1a')](0xcc)[_0x68bd('0x28')]();})[_0x68bd('0x55')](handleError(_0xc0d1c9,null));};exports[_0x68bd('0x77')]=function(_0x323308,_0x594be6,_0x16dd09){var _0x49c38a=[];return db[_0x68bd('0x78')][_0x68bd('0x5b')]()[_0x68bd('0x26')](function(_0x4f7e00){_0x49c38a=_[_0x68bd('0x32')](_0x4f7e00);return _0x323308[_0x68bd('0x68')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x68bd('0x79')],'raw':!![]});})['then'](function(_0x163719){if(_0x163719&&_0x163719['length']){return db[_0x68bd('0x7a')][_0x68bd('0x7b')](function(_0x300607){var _0x5b81df={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x68bd('0x7c')](_0x68bd('0x6a'))},'VoiceQueueId':{'$in':_[_0x68bd('0x2e')](_0x163719,'id')},'$or':[{'UserId':null},{'UserId':_0x323308[_0x68bd('0x68')]['id']}]};var _0x30df33=[];if(_0x323308[_0x68bd('0x59')]['direction']&&_0x323308[_0x68bd('0x59')][_0x68bd('0x7d')]===_0x68bd('0x7e')){if(!_[_0x68bd('0x7f')](_0x323308[_0x68bd('0x59')]['hopperIds'])){_0x5b81df['id']={'$in':_0x323308[_0x68bd('0x59')][_0x68bd('0x80')]};}_0x30df33=[[_0x68bd('0x81'),_0x68bd('0x82')],[_0x68bd('0x83'),_0x163719[0x0][_0x68bd('0x79')]===_0x68bd('0x82')?'DESC':_0x68bd('0x82')],db['sequelize'][_0x68bd('0x84')](_0x68bd('0x85')),['id',_0x68bd('0x86')]];}else{if(!_[_0x68bd('0x7f')](_0x323308[_0x68bd('0x59')][_0x68bd('0x80')])){_0x5b81df['id']={'$notIn':_0x323308[_0x68bd('0x59')]['hopperIds']};}_0x30df33=[[_0x68bd('0x81'),_0x68bd('0x86')],[_0x68bd('0x83'),_0x163719[0x0]['dialOrderByScheduledAt']],db[_0x68bd('0x7a')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x68bd('0x82')]];}return db[_0x68bd('0x51')][_0x68bd('0x87')]({'attributes':['id',_0x68bd('0x88')],'where':_0x5b81df,'order':_0x30df33,'transaction':_0x300607,'lock':_0x300607[_0x68bd('0x89')]['UPDATE'],'include':[{'model':db[_0x68bd('0x78')],'as':_0x68bd('0x8a'),'attributes':_0x49c38a,'include':[{'model':db[_0x68bd('0x8b')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x68bd('0x8c')],'as':'List','attributes':['id',_0x68bd('0x2b')]},{'model':db[_0x68bd('0x8d')],'as':_0x68bd('0x8e'),'attributes':['id','name',_0x68bd('0x8f')]}]})['then'](function(_0x56a319){if(_0x56a319){return _0x56a319['update']({'UserId':_0x323308['user']['id']},{'transaction':_0x300607});}});});}})[_0x68bd('0x26')](handleEntityNotFound(_0x594be6,null))['then'](respondWithResult(_0x594be6,null))['catch'](handleError(_0x594be6,null));};exports[_0x68bd('0x90')]=function(_0x2d7ff,_0xfbf24d,_0x3f34be){return _0x2d7ff['user'][_0x68bd('0x91')]({'where':{'type':_0x68bd('0x92'),'dialActive':!![],'dialMethod':_0x68bd('0x93')},'attributes':['id'],'raw':!![]})[_0x68bd('0x26')](function(_0x4e9cc1){if(_0x4e9cc1&&_0x4e9cc1[_0x68bd('0x48')]){return db[_0x68bd('0x51')][_0x68bd('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x68bd('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x68bd('0x2e')](_0x4e9cc1,'id')},'$or':[{'UserId':null},{'UserId':_0x2d7ff[_0x68bd('0x68')]['id']}]}});}return 0x0;})[_0x68bd('0x26')](function(_0x2d37d7){if(!_['isNil'](_0x2d37d7)&&_[_0x68bd('0x94')](_0x2d37d7)){return _0xfbf24d['status'](0xc8)['json']({'contacts':_0x2d37d7});}else{logger[_0x68bd('0x29')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x68bd('0x90'),0x194,'entity\x20not\x20found');_0xfbf24d[_0x68bd('0x19')](0x194);}})[_0x68bd('0x55')](handleError(_0xfbf24d,null));};
\ No newline at end of file
+var _0x7bcf=['includeAll','include','CmHopper','findAll','rows','catch','show','fields','options','body','update','find','describe','destroy','params','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','statedesc','campaign','user','deleted','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','create','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','sequelize','format','direction','prev','hopperIds','priority','scheduledAt','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','Queue','dialActive','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','apply','save','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','concat','$and','$or','$lt','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notILike','$overlap','$contains','$contained','$any','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge'];(function(_0x3a30a9,_0x24c97e){var _0x28ef02=function(_0x17e614){while(--_0x17e614){_0x3a30a9['push'](_0x3a30a9['shift']());}};_0x28ef02(++_0x24c97e);}(_0x7bcf,0xd5));var _0xf7bc=function(_0x404e53,_0x289091){_0x404e53=_0x404e53-0x0;var _0x1abf58=_0x7bcf[_0x404e53];return _0x1abf58;};'use strict';var emlformat=require(_0xf7bc('0x0'));var rimraf=require(_0xf7bc('0x1'));var zipdir=require(_0xf7bc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7bc('0x3'));var moment=require(_0xf7bc('0x4'));var BPromise=require(_0xf7bc('0x5'));var Mustache=require('mustache');var util=require(_0xf7bc('0x6'));var path=require(_0xf7bc('0x7'));var sox=require(_0xf7bc('0x8'));var csv=require(_0xf7bc('0x9'));var ejs=require(_0xf7bc('0xa'));var fs=require('fs');var fs_extra=require(_0xf7bc('0xb'));var _=require(_0xf7bc('0xc'));var squel=require('squel');var crypto=require(_0xf7bc('0xd'));var jsforce=require(_0xf7bc('0xe'));var deskjs=require(_0xf7bc('0xf'));var toCsv=require(_0xf7bc('0x9'));var querystring=require(_0xf7bc('0x10'));var Papa=require(_0xf7bc('0x11'));var Redis=require('ioredis');var authService=require(_0xf7bc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf7bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7bc('0x14'))(_0xf7bc('0x15'));var utils=require('../../config/utils');var config=require(_0xf7bc('0x16'));var licenseUtil=require(_0xf7bc('0x17'));var db=require(_0xf7bc('0x18'))['db'];function respondWithStatusCode(_0x5100ae,_0xc83f4){_0xc83f4=_0xc83f4||0xcc;return function(_0x2389f7){if(_0x2389f7){return _0x5100ae[_0xf7bc('0x19')](_0xc83f4);}return _0x5100ae['status'](_0xc83f4)[_0xf7bc('0x1a')]();};}function respondWithResult(_0x53b605,_0x12c7b9){_0x12c7b9=_0x12c7b9||0xc8;return function(_0x20963e){if(_0x20963e){return _0x53b605['status'](_0x12c7b9)[_0xf7bc('0x1b')](_0x20963e);}};}function respondWithFilteredResult(_0x4f5684,_0x25ac10){return function(_0x1ea6c3){if(_0x1ea6c3){var _0x31c3c0=typeof _0x25ac10[_0xf7bc('0x1c')]===_0xf7bc('0x1d')&&typeof _0x25ac10['limit']===_0xf7bc('0x1d');var _0x40ba29=_0x1ea6c3[_0xf7bc('0x1e')];var _0x278714=_0x31c3c0?0x0:_0x25ac10[_0xf7bc('0x1c')];var _0x282603=_0x31c3c0?_0x1ea6c3[_0xf7bc('0x1e')]:_0x25ac10['offset']+_0x25ac10['limit'];var _0x10659c;if(_0x282603>=_0x40ba29){_0x282603=_0x40ba29;_0x10659c=0xc8;}else{_0x10659c=0xce;}_0x4f5684[_0xf7bc('0x1f')](_0x10659c);return _0x4f5684[_0xf7bc('0x20')]('Content-Range',_0x278714+'-'+_0x282603+'/'+_0x40ba29)[_0xf7bc('0x1b')](_0x1ea6c3);}return null;};}function patchUpdates(_0x25568b){return function(_0x46f2c4){try{jsonpatch[_0xf7bc('0x21')](_0x46f2c4,_0x25568b,!![]);}catch(_0x1f4001){return BPromise['reject'](_0x1f4001);}return _0x46f2c4[_0xf7bc('0x22')]();};}function saveUpdates(_0x32042d,_0x4787ed){return function(_0x59dade){if(_0x59dade){return _0x59dade['update'](_0x32042d)[_0xf7bc('0x23')](function(_0x40fea0){return _0x40fea0;});}return null;};}function removeEntity(_0x2de1f2,_0x48d3f2){return function(_0x444112){if(_0x444112){return _0x444112['destroy']()[_0xf7bc('0x23')](function(){_0x2de1f2[_0xf7bc('0x1f')](0xcc)[_0xf7bc('0x1a')]();});}};}function handleEntityNotFound(_0x5562f7,_0x21e86e){return function(_0xda59d0){if(!_0xda59d0){_0x5562f7['sendStatus'](0x194);}return _0xda59d0;};}function handleError(_0x5e5fbb,_0x3c00c8){_0x3c00c8=_0x3c00c8||0x1f4;return function(_0x41d6b1){logger[_0xf7bc('0x24')](_0x41d6b1[_0xf7bc('0x25')]);if(_0x41d6b1[_0xf7bc('0x26')]){delete _0x41d6b1[_0xf7bc('0x26')];}_0x5e5fbb[_0xf7bc('0x1f')](_0x3c00c8)[_0xf7bc('0x27')](_0x41d6b1);};}exports[_0xf7bc('0x28')]=function(_0x52eaae,_0x345988){var _0xbb6864={},_0x2a4859={},_0x51e3fe={'count':0x0,'rows':[]};var _0xd0c548=_['map'](db['CmHopper'][_0xf7bc('0x29')],function(_0x3a259a){return{'name':_0x3a259a[_0xf7bc('0x2a')],'type':_0x3a259a[_0xf7bc('0x2b')][_0xf7bc('0x2c')]};});_0x2a4859[_0xf7bc('0x2d')]=_[_0xf7bc('0x2e')](_0xd0c548,'name');_0x2a4859[_0xf7bc('0x2f')]=_[_0xf7bc('0x30')](_0x52eaae[_0xf7bc('0x2f')]);_0x2a4859[_0xf7bc('0x31')]=_[_0xf7bc('0x32')](_0x2a4859[_0xf7bc('0x2d')],_0x2a4859['query']);_0x2a4859[_0xf7bc('0x31')]=_[_0xf7bc('0x33')](_0x2a4859[_0xf7bc('0x31')],[_0xf7bc('0x34'),_0xf7bc('0x35'),'$gt','$gte',_0xf7bc('0x36'),'$lte',_0xf7bc('0x37'),_0xf7bc('0x38'),'$not',_0xf7bc('0x39'),_0xf7bc('0x3a'),_0xf7bc('0x3b'),_0xf7bc('0x3c'),_0xf7bc('0x3d'),'$notLike','$iLike',_0xf7bc('0x3e'),_0xf7bc('0x3d'),_0xf7bc('0x3f'),_0xf7bc('0x40'),_0xf7bc('0x41'),_0xf7bc('0x42')]);_0xbb6864[_0xf7bc('0x43')]=_[_0xf7bc('0x32')](_0x2a4859[_0xf7bc('0x2d')],qs['fields'](_0x52eaae[_0xf7bc('0x2f')]['fields']));_0xbb6864['attributes']=_0xbb6864[_0xf7bc('0x43')][_0xf7bc('0x44')]?_0xbb6864[_0xf7bc('0x43')]:_0x2a4859['model'];if(!_0x52eaae[_0xf7bc('0x2f')][_0xf7bc('0x45')](_0xf7bc('0x46'))){_0xbb6864[_0xf7bc('0x47')]=qs['limit'](_0x52eaae['query']['limit']);_0xbb6864[_0xf7bc('0x1c')]=qs['offset'](_0x52eaae['query']['offset']);}_0xbb6864[_0xf7bc('0x48')]=qs[_0xf7bc('0x49')](_0x52eaae[_0xf7bc('0x2f')][_0xf7bc('0x49')]);_0xbb6864[_0xf7bc('0x4a')]=qs[_0xf7bc('0x31')](_['pick'](_0x52eaae['query'],_0x2a4859[_0xf7bc('0x31')]),_0xd0c548);if(_0x52eaae[_0xf7bc('0x2f')][_0xf7bc('0x4b')]){_0xbb6864[_0xf7bc('0x4a')]=_[_0xf7bc('0x4c')](_0xbb6864['where'],{'$or':_[_0xf7bc('0x2e')](_0xd0c548,function(_0x46711c){if(_0x46711c[_0xf7bc('0x2b')]!=='VIRTUAL'){var _0xe0140e={};_0xe0140e[_0x46711c[_0xf7bc('0x26')]]={'$like':'%'+_0x52eaae[_0xf7bc('0x2f')]['filter']+'%'};return _0xe0140e;}})});}_0xbb6864=_[_0xf7bc('0x4c')]({},_0xbb6864,_0x52eaae['options']);var _0x1ce66c={'where':_0xbb6864['where']};return db['CmHopper'][_0xf7bc('0x1e')](_0x1ce66c)[_0xf7bc('0x23')](function(_0x326959){_0x51e3fe[_0xf7bc('0x1e')]=_0x326959;if(_0x52eaae[_0xf7bc('0x2f')][_0xf7bc('0x4d')]){_0xbb6864[_0xf7bc('0x4e')]=[{'all':!![]}];}return db[_0xf7bc('0x4f')][_0xf7bc('0x50')](_0xbb6864);})[_0xf7bc('0x23')](function(_0xca02e2){_0x51e3fe[_0xf7bc('0x51')]=_0xca02e2;return _0x51e3fe;})[_0xf7bc('0x23')](respondWithFilteredResult(_0x345988,_0xbb6864))[_0xf7bc('0x52')](handleError(_0x345988,null));};exports[_0xf7bc('0x53')]=function(_0x58ddc8,_0x52d4f8){var _0x83231a={'raw':!![],'where':{'id':_0x58ddc8['params']['id']}},_0x323533={};_0x323533['model']=_[_0xf7bc('0x30')](db[_0xf7bc('0x4f')]['rawAttributes']);_0x323533['query']=_[_0xf7bc('0x30')](_0x58ddc8['query']);_0x323533[_0xf7bc('0x31')]=_[_0xf7bc('0x32')](_0x323533[_0xf7bc('0x2d')],_0x323533[_0xf7bc('0x2f')]);_0x83231a[_0xf7bc('0x43')]=_['intersection'](_0x323533['model'],qs[_0xf7bc('0x54')](_0x58ddc8[_0xf7bc('0x2f')][_0xf7bc('0x54')]));_0x83231a['attributes']=_0x83231a[_0xf7bc('0x43')][_0xf7bc('0x44')]?_0x83231a[_0xf7bc('0x43')]:_0x323533[_0xf7bc('0x2d')];if(_0x58ddc8[_0xf7bc('0x2f')][_0xf7bc('0x4d')]){_0x83231a[_0xf7bc('0x4e')]=[{'all':!![]}];}_0x83231a=_[_0xf7bc('0x4c')]({},_0x83231a,_0x58ddc8[_0xf7bc('0x55')]);return db[_0xf7bc('0x4f')]['find'](_0x83231a)['then'](handleEntityNotFound(_0x52d4f8,null))['then'](respondWithResult(_0x52d4f8,null))[_0xf7bc('0x52')](handleError(_0x52d4f8,null));};exports['create']=function(_0xf406a2,_0x4a6530){return db['CmHopper']['create'](_0xf406a2[_0xf7bc('0x56')],{})[_0xf7bc('0x23')](respondWithResult(_0x4a6530,0xc9))['catch'](handleError(_0x4a6530,null));};exports[_0xf7bc('0x57')]=function(_0x4b71ef,_0x402efd){if(_0x4b71ef[_0xf7bc('0x56')]['id']){delete _0x4b71ef[_0xf7bc('0x56')]['id'];}return db[_0xf7bc('0x4f')][_0xf7bc('0x58')]({'where':{'id':_0x4b71ef['params']['id']}})['then'](handleEntityNotFound(_0x402efd,null))[_0xf7bc('0x23')](saveUpdates(_0x4b71ef[_0xf7bc('0x56')],null))['then'](respondWithResult(_0x402efd,null))[_0xf7bc('0x52')](handleError(_0x402efd,null));};exports[_0xf7bc('0x59')]=function(_0x59be3f,_0x315574){return db[_0xf7bc('0x4f')]['describe']()[_0xf7bc('0x23')](respondWithResult(_0x315574,null))[_0xf7bc('0x52')](handleError(_0x315574,null));};exports[_0xf7bc('0x5a')]=function(_0x401f4d,_0x1d59ac){var _0xe9fec0;return db[_0xf7bc('0x4f')][_0xf7bc('0x58')]({'where':{'id':_0x401f4d[_0xf7bc('0x5b')]['id']}})[_0xf7bc('0x23')](handleEntityNotFound(_0x1d59ac,null))[_0xf7bc('0x23')](function(_0x45e4ab){if(_0x45e4ab){return _0x45e4ab['destroy']()[_0xf7bc('0x23')](function(_0x59bc8a){return _0x59bc8a;});}})[_0xf7bc('0x23')](function(_0x4eefd4){_0xe9fec0=_0x4eefd4;if(_0x4eefd4){if(_0x4eefd4[_0xf7bc('0x5c')]||_0x4eefd4[_0xf7bc('0x5d')]){return db[_0x4eefd4[_0xf7bc('0x5c')]?_0xf7bc('0x5e'):_0xf7bc('0x5f')][_0xf7bc('0x58')]({'where':{'id':_0x4eefd4[_0xf7bc('0x5c')]?_0x4eefd4[_0xf7bc('0x5c')]:_0x4eefd4[_0xf7bc('0x5d')]},'attributes':['id',_0xf7bc('0x26')],'raw':!![]});}}})[_0xf7bc('0x23')](function(_0x447f43){var _0xf00364={};if(_0x447f43){_[_0xf7bc('0x4c')](_0xf00364,_[_0xf7bc('0x60')](_0xe9fec0[_0xf7bc('0x61')],[_0xf7bc('0x62'),'updatedAt','id']));_0xf00364['state']=0x15;_0xf00364[_0xf7bc('0x63')]='deleted';_0xf00364[_0xf7bc('0x64')]=_0x447f43['name'];_0xf00364['membername']=_0x401f4d[_0xf7bc('0x65')][_0xf7bc('0x26')];_0xf00364['UserId']=_0x401f4d['user']['id'];_0xf00364[_0xf7bc('0x66')]=!![];_0xf00364['deletedat']=moment()['format'](_0xf7bc('0x67'));_0xf00364[_0xf7bc('0x68')]=_0xe9fec0[_0xf7bc('0x69')];_0xf00364['campaigntype']=_0xe9fec0[_0xf7bc('0x5c')]?'queue':_0xf7bc('0x6a');return db[_0xf7bc('0x6b')]['find']({'where':{'id':_0xf00364[_0xf7bc('0x6c')]},'attributes':[_0xf7bc('0x6d'),_0xf7bc('0x6e')]})['then'](function(_0x52eece){if(!_[_0xf7bc('0x6f')](_0x1d59ac)&&!_[_0xf7bc('0x6f')](_0x52eece[_0xf7bc('0x6d')])){_0xf00364[_0xf7bc('0x70')]=_0x52eece[_0xf7bc('0x6d')];if(!_[_0xf7bc('0x6f')](_0x52eece[_0xf7bc('0x6e')])){_0xf00364[_0xf7bc('0x70')]+='\x20'+_0x52eece[_0xf7bc('0x6e')];}}})[_0xf7bc('0x71')](function(){return db[_0xf7bc('0x72')][_0xf7bc('0x73')](_0xf00364);});}})['then'](function(){return _0x1d59ac[_0xf7bc('0x1f')](0xcc)[_0xf7bc('0x1a')]();})[_0xf7bc('0x52')](handleError(_0x1d59ac,null));};exports[_0xf7bc('0x74')]=function(_0x37276e,_0x3c0418,_0x545d9a){var _0x59f92f=[];return db[_0xf7bc('0x6b')][_0xf7bc('0x59')]()['then'](function(_0x3371f3){_0x59f92f=_[_0xf7bc('0x30')](_0x3371f3);return _0x37276e['user'][_0xf7bc('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xf7bc('0x76')},'attributes':['id',_0xf7bc('0x77')],'raw':!![]});})[_0xf7bc('0x23')](function(_0x4bcb28){if(_0x4bcb28&&_0x4bcb28[_0xf7bc('0x44')]){return db[_0xf7bc('0x78')]['transaction'](function(_0x4a4300){var _0x57b22a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xf7bc('0x79')](_0xf7bc('0x67'))},'VoiceQueueId':{'$in':_[_0xf7bc('0x2e')](_0x4bcb28,'id')},'$or':[{'UserId':null},{'UserId':_0x37276e['user']['id']}]};var _0x3a037a=[];if(_0x37276e[_0xf7bc('0x56')]['direction']&&_0x37276e[_0xf7bc('0x56')][_0xf7bc('0x7a')]===_0xf7bc('0x7b')){if(!_['isEmpty'](_0x37276e['body'][_0xf7bc('0x7c')])){_0x57b22a['id']={'$in':_0x37276e['body'][_0xf7bc('0x7c')]};}_0x3a037a=[[_0xf7bc('0x7d'),'ASC'],[_0xf7bc('0x7e'),_0x4bcb28[0x0]['dialOrderByScheduledAt']===_0xf7bc('0x7f')?_0xf7bc('0x80'):_0xf7bc('0x7f')],db[_0xf7bc('0x78')][_0xf7bc('0x81')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xf7bc('0x80')]];}else{if(!_['isEmpty'](_0x37276e[_0xf7bc('0x56')][_0xf7bc('0x7c')])){_0x57b22a['id']={'$notIn':_0x37276e[_0xf7bc('0x56')][_0xf7bc('0x7c')]};}_0x3a037a=[[_0xf7bc('0x7d'),_0xf7bc('0x80')],[_0xf7bc('0x7e'),_0x4bcb28[0x0]['dialOrderByScheduledAt']],db[_0xf7bc('0x78')][_0xf7bc('0x81')](_0xf7bc('0x82')),['id','ASC']];}return db[_0xf7bc('0x4f')][_0xf7bc('0x83')]({'attributes':['id',_0xf7bc('0x84')],'where':_0x57b22a,'order':_0x3a037a,'transaction':_0x4a4300,'lock':_0x4a4300[_0xf7bc('0x85')][_0xf7bc('0x86')],'include':[{'model':db[_0xf7bc('0x6b')],'as':_0xf7bc('0x87'),'attributes':_0x59f92f,'include':[{'model':db['CmCompany'],'as':_0xf7bc('0x88'),'attributes':['id',_0xf7bc('0x26')]}]},{'model':db[_0xf7bc('0x89')],'as':'List','attributes':['id',_0xf7bc('0x26')]},{'model':db[_0xf7bc('0x5e')],'as':_0xf7bc('0x8a'),'attributes':['id',_0xf7bc('0x26'),_0xf7bc('0x8b')]}]})['then'](function(_0xef7649){if(_0xef7649){return _0xef7649['update']({'UserId':_0x37276e['user']['id']},{'transaction':_0x4a4300});}});});}})['then'](handleEntityNotFound(_0x3c0418,null))[_0xf7bc('0x23')](respondWithResult(_0x3c0418,null))['catch'](handleError(_0x3c0418,null));};exports[_0xf7bc('0x8c')]=function(_0x11b451,_0x520534,_0x17abe3){return _0x11b451[_0xf7bc('0x65')][_0xf7bc('0x75')]({'where':{'type':_0xf7bc('0x8d'),'dialActive':!![],'dialMethod':_0xf7bc('0x76')},'attributes':['id'],'raw':!![]})[_0xf7bc('0x23')](function(_0x4d1319){if(_0x4d1319&&_0x4d1319[_0xf7bc('0x44')]){return db[_0xf7bc('0x4f')][_0xf7bc('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4d1319,'id')},'$or':[{'UserId':null},{'UserId':_0x11b451[_0xf7bc('0x65')]['id']}]}});}return 0x0;})[_0xf7bc('0x23')](function(_0x598f50){if(!_[_0xf7bc('0x6f')](_0x598f50)&&_[_0xf7bc('0x8e')](_0x598f50)){return _0x520534[_0xf7bc('0x1f')](0xc8)[_0xf7bc('0x1b')]({'contacts':_0x598f50});}else{logger[_0xf7bc('0x24')](_0xf7bc('0x8f'),_0xf7bc('0x8c'),0x194,_0xf7bc('0x90'));_0x520534[_0xf7bc('0x19')](0x194);}})[_0xf7bc('0x52')](handleError(_0x520534,null));};
\ No newline at end of file
index 52ee660..5c11118 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','cm_hopper','scheduledat','phone','priority','lodash'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xabce,0x103));var _0xeabc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabce[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./cmHopper.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('CmHopper',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]},{'name':'phone','fields':[_0xeabc('0xb')]},{'name':_0xeabc('0xc'),'fields':[_0xeabc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x90b1,0x1bb));var _0x190b=function(_0x42334c,_0x379771){_0x42334c=_0x42334c-0x0;var _0x4feed7=_0x90b1[_0x42334c];return _0x4feed7;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index d19489c..83eb5cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba23=['User','name','voicePause','length','UserId','push','includes','all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','GetCmHopperPreview','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','limit','order','LOCK','UPDATE','Contact','keys'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0xba23,0x1bc));var _0x3ba2=function(_0x515dfb,_0x410149){_0x515dfb=_0x515dfb-0x0;var _0x5bdff9=_0xba23[_0x515dfb];return _0x5bdff9;};'use strict';var _=require(_0x3ba2('0x0'));var util=require('util');var moment=require(_0x3ba2('0x1'));var BPromise=require(_0x3ba2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ba2('0x3'))['db'];var utils=require(_0x3ba2('0x4'));var logger=require(_0x3ba2('0x5'))(_0x3ba2('0x6'));var config=require(_0x3ba2('0x7'));var jayson=require(_0x3ba2('0x8'));var client=jayson[_0x3ba2('0x9')][_0x3ba2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f2ed8,_0x1c12a0,_0x154108){return new BPromise(function(_0x48fd47,_0x14aec6){return client[_0x3ba2('0xb')](_0x3f2ed8,_0x154108)['then'](function(_0x4d23f5){logger['info'](_0x3ba2('0xc'),_0x1c12a0,_0x3ba2('0xd'));logger[_0x3ba2('0xe')](_0x3ba2('0xf'),_0x1c12a0,_0x3ba2('0xd'),JSON[_0x3ba2('0x10')](_0x4d23f5));if(_0x4d23f5[_0x3ba2('0x11')]){if(_0x4d23f5[_0x3ba2('0x11')][_0x3ba2('0x12')]===0x1f4){logger[_0x3ba2('0x11')](_0x3ba2('0xc'),_0x1c12a0,_0x4d23f5[_0x3ba2('0x11')][_0x3ba2('0x13')]);return _0x14aec6(_0x4d23f5[_0x3ba2('0x11')][_0x3ba2('0x13')]);}logger[_0x3ba2('0x11')](_0x3ba2('0xc'),_0x1c12a0,_0x4d23f5[_0x3ba2('0x11')]['message']);return _0x48fd47(_0x4d23f5['error'][_0x3ba2('0x13')]);}else{logger[_0x3ba2('0x14')]('CmHopper,\x20%s,\x20%s',_0x1c12a0,'request\x20sent');_0x48fd47(_0x4d23f5['result'][_0x3ba2('0x13')]);}})[_0x3ba2('0x15')](function(_0x3cd661){logger[_0x3ba2('0x11')](_0x3ba2('0xc'),_0x1c12a0,_0x3cd661);_0x14aec6(_0x3cd661);});});}exports['GetCmHopper']=function(_0x100e7d){var _0x3447eb=this;return new Promise(function(_0x4539ec,_0x1f82a3){return db[_0x3ba2('0x16')][_0x3ba2('0x17')]({'raw':_0x100e7d[_0x3ba2('0x18')]?_0x100e7d[_0x3ba2('0x18')][_0x3ba2('0x19')]===undefined?!![]:![]:!![],'where':_0x100e7d['options']?_0x100e7d[_0x3ba2('0x18')][_0x3ba2('0x1a')]||null:null,'attributes':_0x100e7d[_0x3ba2('0x18')]?_0x100e7d[_0x3ba2('0x18')][_0x3ba2('0x1b')]||null:null,'limit':_0x100e7d[_0x3ba2('0x18')]?_0x100e7d[_0x3ba2('0x18')]['limit']||null:null,'include':_0x100e7d[_0x3ba2('0x18')]?_0x100e7d[_0x3ba2('0x18')]['include']?_['map'](_0x100e7d['options'][_0x3ba2('0x1c')],function(_0x1be151){return{'model':db[_0x1be151['model']],'as':_0x1be151['as'],'attributes':_0x1be151[_0x3ba2('0x1b')],'include':_0x1be151['include']?_['map'](_0x1be151[_0x3ba2('0x1c')],function(_0x275ce2){return{'model':db[_0x275ce2['model']],'as':_0x275ce2['as'],'attributes':_0x275ce2[_0x3ba2('0x1b')],'include':_0x275ce2['include']?_[_0x3ba2('0x1d')](_0x275ce2[_0x3ba2('0x1c')],function(_0x12f5aa){return{'model':db[_0x12f5aa[_0x3ba2('0x1e')]],'as':_0x12f5aa['as'],'attributes':_0x12f5aa[_0x3ba2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3ba2('0x1f')](function(_0x28389d){logger['info'](_0x3ba2('0x20'),_0x100e7d);logger[_0x3ba2('0xe')]('GetCmHopper',_0x100e7d,JSON['stringify'](_0x28389d));_0x4539ec(_0x28389d);})[_0x3ba2('0x15')](function(_0x429202){logger[_0x3ba2('0x11')](_0x3ba2('0x20'),_0x429202['message'],_0x100e7d);_0x1f82a3(_0x3447eb[_0x3ba2('0x11')](0x1f4,_0x429202[_0x3ba2('0x13')]));});});};exports[_0x3ba2('0x21')]=function(_0x3b0ab8){var _0x34c20e=this;return new Promise(function(_0x4ee365,_0x2b2bd0){return db[_0x3ba2('0x16')][_0x3ba2('0x22')]({'raw':_0x3b0ab8[_0x3ba2('0x18')]?_0x3b0ab8[_0x3ba2('0x18')][_0x3ba2('0x19')]===undefined?!![]:![]:!![],'where':_0x3b0ab8[_0x3ba2('0x18')]?_0x3b0ab8[_0x3ba2('0x18')][_0x3ba2('0x1a')]||null:null,'attributes':_0x3b0ab8[_0x3ba2('0x18')]?_0x3b0ab8[_0x3ba2('0x18')][_0x3ba2('0x1b')]||null:null,'include':_0x3b0ab8[_0x3ba2('0x18')]?_0x3b0ab8[_0x3ba2('0x18')]['include']?_[_0x3ba2('0x1d')](_0x3b0ab8[_0x3ba2('0x18')][_0x3ba2('0x1c')],function(_0x3706da){return{'model':db[_0x3706da[_0x3ba2('0x1e')]],'as':_0x3706da['as'],'attributes':_0x3706da[_0x3ba2('0x1b')],'include':_0x3706da[_0x3ba2('0x1c')]?_[_0x3ba2('0x1d')](_0x3706da[_0x3ba2('0x1c')],function(_0x210765){return{'model':db[_0x210765[_0x3ba2('0x1e')]],'as':_0x210765['as'],'attributes':_0x210765[_0x3ba2('0x1b')],'include':_0x210765[_0x3ba2('0x1c')]?_[_0x3ba2('0x1d')](_0x210765['include'],function(_0x4cf630){return{'model':db[_0x4cf630['model']],'as':_0x4cf630['as'],'attributes':_0x4cf630[_0x3ba2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4963d2){logger[_0x3ba2('0x14')](_0x3ba2('0x21'),_0x3b0ab8);logger['debug']('ShowCmHopper',_0x3b0ab8,JSON[_0x3ba2('0x10')](_0x4963d2));_0x4ee365(_0x4963d2);})[_0x3ba2('0x15')](function(_0x3e5e8f){logger[_0x3ba2('0x11')]('ShowCmHopper',_0x3e5e8f[_0x3ba2('0x13')],_0x3b0ab8);_0x2b2bd0(_0x34c20e[_0x3ba2('0x11')](0x1f4,_0x3e5e8f[_0x3ba2('0x13')]));});});};exports[_0x3ba2('0x23')]=function(_0x363b30){var _0x3488df=this;return new Promise(function(_0x47c08c,_0x2e8daf){return db[_0x3ba2('0x16')][_0x3ba2('0x24')](_0x363b30[_0x3ba2('0x25')],{'raw':_0x363b30[_0x3ba2('0x18')]?_0x363b30[_0x3ba2('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x3ba2('0x1f')](function(_0x21e8fe){logger['info'](_0x3ba2('0x23'),_0x363b30);logger[_0x3ba2('0xe')](_0x3ba2('0x23'),_0x363b30,JSON[_0x3ba2('0x10')](_0x21e8fe));_0x47c08c(_0x21e8fe);})[_0x3ba2('0x15')](function(_0x328ead){logger[_0x3ba2('0x11')](_0x3ba2('0x23'),_0x328ead[_0x3ba2('0x13')],_0x363b30);_0x2e8daf(_0x3488df['error'](0x1f4,_0x328ead[_0x3ba2('0x13')]));});});};exports[_0x3ba2('0x26')]=function(_0x5af952){var _0x48c5d3=this;return new Promise(function(_0x4a2783,_0x2e57d9){return db[_0x3ba2('0x16')][_0x3ba2('0x27')](_0x5af952[_0x3ba2('0x25')],{'raw':_0x5af952['options']?_0x5af952['options'][_0x3ba2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5af952['options']?_0x5af952[_0x3ba2('0x18')][_0x3ba2('0x1a')]||null:null,'attributes':_0x5af952['options']?_0x5af952[_0x3ba2('0x18')][_0x3ba2('0x1b')]||null:null,'limit':_0x5af952[_0x3ba2('0x18')]?_0x5af952['options']['limit']||null:null})['then'](function(_0x4bcfcb){logger[_0x3ba2('0x14')]('UpdateCmHopper',_0x5af952);logger['debug'](_0x3ba2('0x26'),_0x5af952,JSON[_0x3ba2('0x10')](_0x4bcfcb));_0x4a2783(_0x4bcfcb);})[_0x3ba2('0x15')](function(_0x4be3c2){logger[_0x3ba2('0x11')](_0x3ba2('0x26'),_0x4be3c2[_0x3ba2('0x13')],_0x5af952);_0x2e57d9(_0x48c5d3[_0x3ba2('0x11')](0x1f4,_0x4be3c2[_0x3ba2('0x13')]));});});};exports['DestroyCmHopper']=function(_0x42e52f){var _0x338378=this;return new Promise(function(_0x24b99f,_0x394aa7){return db[_0x3ba2('0x16')][_0x3ba2('0x28')]({'where':_0x42e52f[_0x3ba2('0x18')]?_0x42e52f[_0x3ba2('0x18')][_0x3ba2('0x1a')]||null:null})[_0x3ba2('0x1f')](function(_0x4157bc){logger[_0x3ba2('0x14')](_0x3ba2('0x29'),_0x42e52f);logger[_0x3ba2('0xe')](_0x3ba2('0x29'),_0x42e52f,JSON['stringify'](_0x4157bc));_0x24b99f(_0x4157bc);})[_0x3ba2('0x15')](function(_0x4682f6){logger[_0x3ba2('0x11')](_0x3ba2('0x29'),_0x4682f6['message'],_0x42e52f);_0x394aa7(_0x338378['error'](0x1f4,_0x4682f6[_0x3ba2('0x13')]));});});};exports[_0x3ba2('0x2a')]=function(_0x5b93b7){var _0x4b8c36=this;return new Promise(function(_0x1e0c81,_0x336314){return db[_0x3ba2('0x2b')][_0x3ba2('0x2c')]()['then'](function(_0x2b0f8c){return db[_0x3ba2('0x2d')][_0x3ba2('0x2e')](function(_0x52bda4){return db[_0x3ba2('0x16')]['findAll']({'where':_0x5b93b7[_0x3ba2('0x18')]?_0x5b93b7[_0x3ba2('0x18')]['where']||null:null,'attributes':_0x5b93b7[_0x3ba2('0x18')]?_0x5b93b7[_0x3ba2('0x18')][_0x3ba2('0x1b')]||null:null,'limit':_0x5b93b7[_0x3ba2('0x18')]?_0x5b93b7['options'][_0x3ba2('0x2f')]||null:null,'order':_0x5b93b7[_0x3ba2('0x18')]?_0x5b93b7[_0x3ba2('0x18')][_0x3ba2('0x30')]||null:null,'transaction':_0x52bda4,'lock':_0x52bda4[_0x3ba2('0x31')][_0x3ba2('0x32')],'include':[{'model':db[_0x3ba2('0x2b')],'as':_0x3ba2('0x33'),'attributes':_[_0x3ba2('0x34')](_0x2b0f8c)},{'model':db[_0x3ba2('0x35')],'as':'Agent','attributes':['id',_0x3ba2('0x36'),_0x3ba2('0x37')]}]})[_0x3ba2('0x1f')](function(_0x29d3bd){var _0x38980a=[];var _0x4d02bf=[];for(var _0x3a4dc5=0x0;_0x3a4dc5<_0x29d3bd[_0x3ba2('0x38')];_0x3a4dc5+=0x1){var _0x5b80a2=_0x29d3bd[_0x3a4dc5][_0x3ba2('0x39')];if(_0x5b80a2===null){_0x38980a[_0x3ba2('0x3a')](_0x29d3bd[_0x3a4dc5][_0x3ba2('0x27')](_0x5b93b7[_0x3ba2('0x25')],{'transaction':_0x52bda4}));}else if(!_0x4d02bf[_0x3ba2('0x3b')](_0x5b80a2)){_0x4d02bf[_0x3ba2('0x3a')](_0x5b80a2);_0x38980a[_0x3ba2('0x3a')](_0x29d3bd[_0x3a4dc5]['update'](_0x5b93b7[_0x3ba2('0x25')],{'transaction':_0x52bda4}));}}return BPromise[_0x3ba2('0x3c')](_0x38980a);});})[_0x3ba2('0x1f')](function(_0x2256ed){logger[_0x3ba2('0x14')](_0x3ba2('0x2a'),_0x5b93b7);logger[_0x3ba2('0xe')](_0x3ba2('0x2a'),_0x5b93b7,JSON[_0x3ba2('0x10')](_0x2256ed));_0x1e0c81(_0x2256ed);})[_0x3ba2('0x15')](function(_0x129d5c){logger[_0x3ba2('0x11')](_0x3ba2('0x2a'),_0x129d5c['message'],_0x5b93b7);_0x336314(_0x4b8c36[_0x3ba2('0x11')](0x1f4,_0x129d5c[_0x3ba2('0x13')]));});});});};exports[_0x3ba2('0x3d')]=function(_0x59432b){var _0x8401e6=this;return new Promise(function(_0xf8e0f6,_0x978f60){return db[_0x3ba2('0x2d')][_0x3ba2('0x2e')](function(_0x3c7e48){return db['CmHopperFinal'][_0x3ba2('0x24')](_0x59432b['body'],{'raw':_0x59432b[_0x3ba2('0x18')]?_0x59432b[_0x3ba2('0x18')][_0x3ba2('0x19')]===undefined?!![]:![]:!![],'transaction':_0x3c7e48})[_0x3ba2('0x1f')](function(){return db[_0x3ba2('0x16')][_0x3ba2('0x28')]({'where':_0x59432b[_0x3ba2('0x18')]?_0x59432b[_0x3ba2('0x18')][_0x3ba2('0x1a')]||null:null,'transaction':_0x3c7e48});});})[_0x3ba2('0x1f')](function(_0x251906){logger['info'](_0x3ba2('0x3d'),_0x59432b);logger[_0x3ba2('0xe')](_0x3ba2('0x3d'),_0x59432b,JSON[_0x3ba2('0x10')](_0x251906));_0xf8e0f6(_0x251906);})['catch'](function(_0x24eaa2){logger[_0x3ba2('0x11')]('MoveContactManagedDialer',_0x24eaa2['message'],_0x59432b);_0x978f60(_0x8401e6[_0x3ba2('0x11')](0x1f4,_0x24eaa2[_0x3ba2('0x13')]));});});};exports[_0x3ba2('0x3e')]=function(_0x198d60){var _0x59dad7=this;return new Promise(function(_0x5c6904,_0x4a5422){return db[_0x3ba2('0x16')][_0x3ba2('0x17')]({'raw':_0x198d60[_0x3ba2('0x18')]?_0x198d60['options'][_0x3ba2('0x19')]===undefined?!![]:![]:!![],'where':_0x198d60['options']?_0x198d60['options'][_0x3ba2('0x1a')]||null:null,'attributes':[[db[_0x3ba2('0x2d')]['fn'](_0x3ba2('0x3f'),db[_0x3ba2('0x2d')]['fn']('IF',db[_0x3ba2('0x2d')][_0x3ba2('0x40')](_0x3ba2('0x41')+util[_0x3ba2('0x42')](_0x3ba2('0x43'),moment()['format'](_0x3ba2('0x44')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x3450be){logger['info'](_0x3ba2('0x3e'),_0x198d60);logger[_0x3ba2('0xe')](_0x3ba2('0x3e'),_0x198d60,JSON[_0x3ba2('0x10')](_0x3450be));_0x5c6904(_0x3450be);})[_0x3ba2('0x15')](function(_0x51bfc4){logger[_0x3ba2('0x11')](_0x3ba2('0x3e'),_0x51bfc4[_0x3ba2('0x13')],_0x198d60);_0x4a5422(_0x59dad7[_0x3ba2('0x11')](0x1f4,_0x51bfc4[_0x3ba2('0x13')]));});});};exports['GetContactRecallMe']=function(_0x31319e){var _0x23cc37=this;return new Promise(function(_0x4be314,_0x432044){return db[_0x3ba2('0x2b')][_0x3ba2('0x2c')]()[_0x3ba2('0x1f')](function(_0x209239){return db[_0x3ba2('0x2d')][_0x3ba2('0x2e')](function(_0x32ba18){return db['CmHopper'][_0x3ba2('0x17')]({'where':_0x31319e[_0x3ba2('0x18')]?_0x31319e[_0x3ba2('0x18')][_0x3ba2('0x1a')]||null:null,'attributes':_0x31319e[_0x3ba2('0x18')]?_0x31319e[_0x3ba2('0x18')][_0x3ba2('0x1b')]||null:null,'limit':0x1,'order':_0x31319e[_0x3ba2('0x18')]?_0x31319e[_0x3ba2('0x18')][_0x3ba2('0x30')]||null:null,'group':db['CmHopper']['UserId'],'transaction':_0x32ba18,'lock':_0x32ba18[_0x3ba2('0x31')][_0x3ba2('0x32')],'include':_0x31319e[_0x3ba2('0x18')]?_0x31319e['options'][_0x3ba2('0x1c')]?_[_0x3ba2('0x1d')](_0x31319e[_0x3ba2('0x18')][_0x3ba2('0x1c')],function(_0x142900){return{'model':db[_0x142900['model']],'as':_0x142900['as'],'attributes':_0x142900['attributes'],'include':_0x142900[_0x3ba2('0x1c')]?_[_0x3ba2('0x1d')](_0x142900[_0x3ba2('0x1c')],function(_0x48bd45){return{'model':db[_0x48bd45[_0x3ba2('0x1e')]],'as':_0x48bd45['as'],'attributes':_0x48bd45[_0x3ba2('0x1b')],'include':_0x48bd45['include']?_['map'](_0x48bd45[_0x3ba2('0x1c')],function(_0x45361b){return{'model':db[_0x45361b['model']],'as':_0x45361b['as'],'attributes':_0x45361b[_0x3ba2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3497a4){var _0x14f97d=[];for(var _0x5453b1=0x0;_0x5453b1<_0x3497a4[_0x3ba2('0x38')];_0x5453b1+=0x1){_0x14f97d['push'](_0x3497a4[_0x5453b1][_0x3ba2('0x27')](_0x31319e['body'],{'transaction':_0x32ba18}));}return BPromise[_0x3ba2('0x3c')](_0x14f97d);});})[_0x3ba2('0x1f')](function(_0xf625b1){logger['info'](_0x3ba2('0x45'),_0x31319e);logger[_0x3ba2('0xe')](_0x3ba2('0x45'),_0x31319e,JSON[_0x3ba2('0x10')](_0xf625b1));_0x4be314(_0xf625b1);})[_0x3ba2('0x15')](function(_0x39d55a){logger[_0x3ba2('0x11')]('GetContactRecallMe',_0x39d55a[_0x3ba2('0x13')],_0x31319e);_0x432044(_0x23cc37[_0x3ba2('0x11')](0x1f4,_0x39d55a[_0x3ba2('0x13')]));});});});};exports[_0x3ba2('0x46')]=function(_0x5c473b){var _0x279b5f=this;return new Promise(function(_0x5c5c81,_0x1101c2){db['CmContact'][_0x3ba2('0x2c')]()[_0x3ba2('0x1f')](function(_0x535565){return db['CmHopper']['findAll']({'raw':_0x5c473b['options']?_0x5c473b['options'][_0x3ba2('0x19')]===undefined?!![]:![]:!![],'where':_0x5c473b[_0x3ba2('0x18')]?_0x5c473b[_0x3ba2('0x18')]['where']||null:null,'attributes':_0x5c473b['options']?_0x5c473b[_0x3ba2('0x18')][_0x3ba2('0x1b')]||null:null,'limit':_0x5c473b[_0x3ba2('0x18')]?_0x5c473b['options'][_0x3ba2('0x2f')]||null:null,'include':_0x5c473b[_0x3ba2('0x18')]?_0x5c473b[_0x3ba2('0x18')]['include']?_[_0x3ba2('0x1d')](_0x5c473b['options']['include'],function(_0x18204d){return{'model':db[_0x18204d[_0x3ba2('0x1e')]],'as':_0x18204d['as'],'attributes':_0x18204d['as']==='Contact'?_[_0x3ba2('0x34')](_0x535565):_0x18204d[_0x3ba2('0x1b')],'include':_0x18204d['include']?_[_0x3ba2('0x1d')](_0x18204d['include'],function(_0x15127b){return{'model':db[_0x15127b['model']],'as':_0x15127b['as'],'attributes':_0x15127b[_0x3ba2('0x1b')],'include':_0x15127b[_0x3ba2('0x1c')]?_[_0x3ba2('0x1d')](_0x15127b[_0x3ba2('0x1c')],function(_0x53f9d0){return{'model':db[_0x53f9d0[_0x3ba2('0x1e')]],'as':_0x53f9d0['as'],'attributes':_0x53f9d0['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ba2('0x1f')](function(_0x5c8681){logger[_0x3ba2('0x14')](_0x3ba2('0x20'),_0x5c473b);logger[_0x3ba2('0xe')]('GetCmHopper',_0x5c473b,JSON['stringify'](_0x5c8681));_0x5c5c81(_0x5c8681);})[_0x3ba2('0x15')](function(_0x473abc){logger[_0x3ba2('0x11')]('GetCmHopper',_0x473abc['message'],_0x5c473b);_0x1101c2(_0x279b5f[_0x3ba2('0x11')](0x1f4,_0x473abc['message']));});});});};
\ No newline at end of file
+var _0x8106=['findAll','options','raw','where','attributes','include','map','model','info','ShowCmHopper','find','then','body','CreateCmHopper','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','limit','UPDATE','CmContact','Contact','keys','User','name','voicePause','length','UserId','includes','push','all','transaction','create','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper'];(function(_0x5eca85,_0x1c0fd4){var _0xf73ae3=function(_0x5608a4){while(--_0x5608a4){_0x5eca85['push'](_0x5eca85['shift']());}};_0xf73ae3(++_0x1c0fd4);}(_0x8106,0x14a));var _0x6810=function(_0x415b6a,_0x5f3ab2){_0x415b6a=_0x415b6a-0x0;var _0x548658=_0x8106[_0x415b6a];return _0x548658;};'use strict';var _=require(_0x6810('0x0'));var util=require(_0x6810('0x1'));var moment=require(_0x6810('0x2'));var BPromise=require(_0x6810('0x3'));var rs=require(_0x6810('0x4'));var fs=require('fs');var Redis=require(_0x6810('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6810('0x6'))(_0x6810('0x7'));var config=require(_0x6810('0x8'));var jayson=require(_0x6810('0x9'));var client=jayson[_0x6810('0xa')][_0x6810('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49bc54,_0x274cb1,_0x5f1bfe){return new BPromise(function(_0x1cd2e4,_0x4ec685){return client[_0x6810('0xc')](_0x49bc54,_0x5f1bfe)['then'](function(_0x58f428){logger['info'](_0x6810('0xd'),_0x274cb1,_0x6810('0xe'));logger[_0x6810('0xf')](_0x6810('0x10'),_0x274cb1,_0x6810('0xe'),JSON[_0x6810('0x11')](_0x58f428));if(_0x58f428[_0x6810('0x12')]){if(_0x58f428['error'][_0x6810('0x13')]===0x1f4){logger[_0x6810('0x12')]('CmHopper,\x20%s,\x20%s',_0x274cb1,_0x58f428[_0x6810('0x12')][_0x6810('0x14')]);return _0x4ec685(_0x58f428[_0x6810('0x12')][_0x6810('0x14')]);}logger['error'](_0x6810('0xd'),_0x274cb1,_0x58f428['error'][_0x6810('0x14')]);return _0x1cd2e4(_0x58f428[_0x6810('0x12')][_0x6810('0x14')]);}else{logger['info'](_0x6810('0xd'),_0x274cb1,_0x6810('0xe'));_0x1cd2e4(_0x58f428[_0x6810('0x15')][_0x6810('0x14')]);}})[_0x6810('0x16')](function(_0x5c520d){logger['error'](_0x6810('0xd'),_0x274cb1,_0x5c520d);_0x4ec685(_0x5c520d);});});}exports[_0x6810('0x17')]=function(_0x240953){var _0x1e408c=this;return new Promise(function(_0x479727,_0x19c672){return db[_0x6810('0x18')][_0x6810('0x19')]({'raw':_0x240953[_0x6810('0x1a')]?_0x240953[_0x6810('0x1a')][_0x6810('0x1b')]===undefined?!![]:![]:!![],'where':_0x240953[_0x6810('0x1a')]?_0x240953[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':_0x240953[_0x6810('0x1a')]?_0x240953['options'][_0x6810('0x1d')]||null:null,'limit':_0x240953[_0x6810('0x1a')]?_0x240953[_0x6810('0x1a')]['limit']||null:null,'include':_0x240953['options']?_0x240953[_0x6810('0x1a')][_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x240953[_0x6810('0x1a')][_0x6810('0x1e')],function(_0x28d8c6){return{'model':db[_0x28d8c6['model']],'as':_0x28d8c6['as'],'attributes':_0x28d8c6[_0x6810('0x1d')],'include':_0x28d8c6[_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x28d8c6[_0x6810('0x1e')],function(_0x38cc09){return{'model':db[_0x38cc09[_0x6810('0x20')]],'as':_0x38cc09['as'],'attributes':_0x38cc09['attributes'],'include':_0x38cc09[_0x6810('0x1e')]?_['map'](_0x38cc09[_0x6810('0x1e')],function(_0x4ad798){return{'model':db[_0x4ad798[_0x6810('0x20')]],'as':_0x4ad798['as'],'attributes':_0x4ad798[_0x6810('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b45a0){logger[_0x6810('0x21')](_0x6810('0x17'),_0x240953);logger[_0x6810('0xf')]('GetCmHopper',_0x240953,JSON[_0x6810('0x11')](_0x4b45a0));_0x479727(_0x4b45a0);})['catch'](function(_0x549a5d){logger[_0x6810('0x12')](_0x6810('0x17'),_0x549a5d[_0x6810('0x14')],_0x240953);_0x19c672(_0x1e408c[_0x6810('0x12')](0x1f4,_0x549a5d[_0x6810('0x14')]));});});};exports[_0x6810('0x22')]=function(_0x3d8f1b){var _0x283267=this;return new Promise(function(_0x4991e1,_0x238671){return db[_0x6810('0x18')][_0x6810('0x23')]({'raw':_0x3d8f1b[_0x6810('0x1a')]?_0x3d8f1b[_0x6810('0x1a')][_0x6810('0x1b')]===undefined?!![]:![]:!![],'where':_0x3d8f1b[_0x6810('0x1a')]?_0x3d8f1b[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':_0x3d8f1b['options']?_0x3d8f1b[_0x6810('0x1a')]['attributes']||null:null,'include':_0x3d8f1b['options']?_0x3d8f1b[_0x6810('0x1a')][_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x3d8f1b[_0x6810('0x1a')][_0x6810('0x1e')],function(_0x35f56b){return{'model':db[_0x35f56b[_0x6810('0x20')]],'as':_0x35f56b['as'],'attributes':_0x35f56b['attributes'],'include':_0x35f56b[_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x35f56b[_0x6810('0x1e')],function(_0x4e140f){return{'model':db[_0x4e140f[_0x6810('0x20')]],'as':_0x4e140f['as'],'attributes':_0x4e140f[_0x6810('0x1d')],'include':_0x4e140f[_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x4e140f[_0x6810('0x1e')],function(_0x4353da){return{'model':db[_0x4353da[_0x6810('0x20')]],'as':_0x4353da['as'],'attributes':_0x4353da[_0x6810('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6810('0x24')](function(_0x242c23){logger[_0x6810('0x21')](_0x6810('0x22'),_0x3d8f1b);logger[_0x6810('0xf')](_0x6810('0x22'),_0x3d8f1b,JSON['stringify'](_0x242c23));_0x4991e1(_0x242c23);})[_0x6810('0x16')](function(_0x3ae833){logger['error'](_0x6810('0x22'),_0x3ae833[_0x6810('0x14')],_0x3d8f1b);_0x238671(_0x283267[_0x6810('0x12')](0x1f4,_0x3ae833[_0x6810('0x14')]));});});};exports['CreateCmHopper']=function(_0x560ee8){var _0x43a984=this;return new Promise(function(_0x3e60e3,_0x4d8a34){return db['CmHopper']['create'](_0x560ee8[_0x6810('0x25')],{'raw':_0x560ee8[_0x6810('0x1a')]?_0x560ee8[_0x6810('0x1a')][_0x6810('0x1b')]===undefined?!![]:![]:!![]})[_0x6810('0x24')](function(_0x55982f){logger[_0x6810('0x21')](_0x6810('0x26'),_0x560ee8);logger[_0x6810('0xf')]('CreateCmHopper',_0x560ee8,JSON[_0x6810('0x11')](_0x55982f));_0x3e60e3(_0x55982f);})['catch'](function(_0x55329e){logger[_0x6810('0x12')](_0x6810('0x26'),_0x55329e[_0x6810('0x14')],_0x560ee8);_0x4d8a34(_0x43a984[_0x6810('0x12')](0x1f4,_0x55329e[_0x6810('0x14')]));});});};exports[_0x6810('0x27')]=function(_0x434f9a){var _0x4c56ba=this;return new Promise(function(_0x2bf637,_0x55b5f5){return db[_0x6810('0x18')][_0x6810('0x28')](_0x434f9a['body'],{'raw':_0x434f9a[_0x6810('0x1a')]?_0x434f9a[_0x6810('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x434f9a[_0x6810('0x1a')]?_0x434f9a[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':_0x434f9a[_0x6810('0x1a')]?_0x434f9a[_0x6810('0x1a')][_0x6810('0x1d')]||null:null,'limit':_0x434f9a[_0x6810('0x1a')]?_0x434f9a['options']['limit']||null:null})[_0x6810('0x24')](function(_0x252c36){logger[_0x6810('0x21')](_0x6810('0x27'),_0x434f9a);logger[_0x6810('0xf')](_0x6810('0x27'),_0x434f9a,JSON[_0x6810('0x11')](_0x252c36));_0x2bf637(_0x252c36);})[_0x6810('0x16')](function(_0x1dcc2b){logger['error'](_0x6810('0x27'),_0x1dcc2b[_0x6810('0x14')],_0x434f9a);_0x55b5f5(_0x4c56ba[_0x6810('0x12')](0x1f4,_0x1dcc2b['message']));});});};exports['DestroyCmHopper']=function(_0x38ec17){var _0xec6ccf=this;return new Promise(function(_0x2d6f40,_0x2cde65){return db[_0x6810('0x18')][_0x6810('0x29')]({'where':_0x38ec17[_0x6810('0x1a')]?_0x38ec17[_0x6810('0x1a')][_0x6810('0x1c')]||null:null})[_0x6810('0x24')](function(_0x10c03f){logger[_0x6810('0x21')](_0x6810('0x2a'),_0x38ec17);logger[_0x6810('0xf')](_0x6810('0x2a'),_0x38ec17,JSON['stringify'](_0x10c03f));_0x2d6f40(_0x10c03f);})[_0x6810('0x16')](function(_0x6ef5c4){logger[_0x6810('0x12')](_0x6810('0x2a'),_0x6ef5c4[_0x6810('0x14')],_0x38ec17);_0x2cde65(_0xec6ccf[_0x6810('0x12')](0x1f4,_0x6ef5c4['message']));});});};exports[_0x6810('0x2b')]=function(_0x1e7bd6){var _0x50688b=this;return new Promise(function(_0x452740,_0x13c937){return db['CmContact'][_0x6810('0x2c')]()['then'](function(_0x37c1b2){return db[_0x6810('0x2d')]['transaction'](function(_0x234386){return db[_0x6810('0x18')]['findAll']({'where':_0x1e7bd6[_0x6810('0x1a')]?_0x1e7bd6[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':_0x1e7bd6[_0x6810('0x1a')]?_0x1e7bd6[_0x6810('0x1a')]['attributes']||null:null,'limit':_0x1e7bd6[_0x6810('0x1a')]?_0x1e7bd6['options'][_0x6810('0x2e')]||null:null,'order':_0x1e7bd6[_0x6810('0x1a')]?_0x1e7bd6[_0x6810('0x1a')]['order']||null:null,'transaction':_0x234386,'lock':_0x234386['LOCK'][_0x6810('0x2f')],'include':[{'model':db[_0x6810('0x30')],'as':_0x6810('0x31'),'attributes':_[_0x6810('0x32')](_0x37c1b2)},{'model':db[_0x6810('0x33')],'as':'Agent','attributes':['id',_0x6810('0x34'),_0x6810('0x35')]}]})['then'](function(_0xf8673c){var _0x3c1075=[];var _0xe69938=[];for(var _0x2cfd84=0x0;_0x2cfd84<_0xf8673c[_0x6810('0x36')];_0x2cfd84+=0x1){var _0x48cf6d=_0xf8673c[_0x2cfd84][_0x6810('0x37')];if(_0x48cf6d===null){_0x3c1075['push'](_0xf8673c[_0x2cfd84][_0x6810('0x28')](_0x1e7bd6['body'],{'transaction':_0x234386}));}else if(!_0xe69938[_0x6810('0x38')](_0x48cf6d)){_0xe69938[_0x6810('0x39')](_0x48cf6d);_0x3c1075[_0x6810('0x39')](_0xf8673c[_0x2cfd84][_0x6810('0x28')](_0x1e7bd6['body'],{'transaction':_0x234386}));}}return BPromise[_0x6810('0x3a')](_0x3c1075);});})[_0x6810('0x24')](function(_0x10f683){logger[_0x6810('0x21')](_0x6810('0x2b'),_0x1e7bd6);logger[_0x6810('0xf')]('GetContactDialer',_0x1e7bd6,JSON['stringify'](_0x10f683));_0x452740(_0x10f683);})[_0x6810('0x16')](function(_0x43ddb4){logger[_0x6810('0x12')](_0x6810('0x2b'),_0x43ddb4['message'],_0x1e7bd6);_0x13c937(_0x50688b[_0x6810('0x12')](0x1f4,_0x43ddb4[_0x6810('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x26a002){var _0x4d3f54=this;return new Promise(function(_0x165d47,_0x4f2746){return db[_0x6810('0x2d')][_0x6810('0x3b')](function(_0x4d5a10){return db['CmHopperFinal'][_0x6810('0x3c')](_0x26a002['body'],{'raw':_0x26a002[_0x6810('0x1a')]?_0x26a002[_0x6810('0x1a')][_0x6810('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x4d5a10})[_0x6810('0x24')](function(){return db[_0x6810('0x18')][_0x6810('0x29')]({'where':_0x26a002[_0x6810('0x1a')]?_0x26a002['options'][_0x6810('0x1c')]||null:null,'transaction':_0x4d5a10});});})[_0x6810('0x24')](function(_0x34c58d){logger['info'](_0x6810('0x3d'),_0x26a002);logger[_0x6810('0xf')]('MoveContactManagedDialer',_0x26a002,JSON[_0x6810('0x11')](_0x34c58d));_0x165d47(_0x34c58d);})[_0x6810('0x16')](function(_0x2e47b2){logger[_0x6810('0x12')](_0x6810('0x3d'),_0x2e47b2[_0x6810('0x14')],_0x26a002);_0x4f2746(_0x4d3f54[_0x6810('0x12')](0x1f4,_0x2e47b2[_0x6810('0x14')]));});});};exports[_0x6810('0x3e')]=function(_0x467aeb){var _0x35ce28=this;return new Promise(function(_0x1a88a9,_0x20360d){return db[_0x6810('0x18')][_0x6810('0x19')]({'raw':_0x467aeb[_0x6810('0x1a')]?_0x467aeb[_0x6810('0x1a')][_0x6810('0x1b')]===undefined?!![]:![]:!![],'where':_0x467aeb['options']?_0x467aeb[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':[[db[_0x6810('0x2d')]['fn'](_0x6810('0x3f'),db['sequelize']['fn']('IF',db[_0x6810('0x2d')][_0x6810('0x40')](_0x6810('0x41')+util['format']('\x22%s\x22',moment()['format'](_0x6810('0x42')))+_0x6810('0x43')))),_0x6810('0x44')]]})[_0x6810('0x24')](function(_0x3c882f){logger[_0x6810('0x21')](_0x6810('0x3e'),_0x467aeb);logger[_0x6810('0xf')]('CountReScheduled',_0x467aeb,JSON[_0x6810('0x11')](_0x3c882f));_0x1a88a9(_0x3c882f);})[_0x6810('0x16')](function(_0x4a6a9a){logger[_0x6810('0x12')](_0x6810('0x3e'),_0x4a6a9a[_0x6810('0x14')],_0x467aeb);_0x20360d(_0x35ce28['error'](0x1f4,_0x4a6a9a[_0x6810('0x14')]));});});};exports[_0x6810('0x45')]=function(_0x1625b6){var _0x468d10=this;return new Promise(function(_0x573cf8,_0x3e4686){return db[_0x6810('0x30')][_0x6810('0x2c')]()['then'](function(_0x2cce6c){return db[_0x6810('0x2d')]['transaction'](function(_0x40268f){return db[_0x6810('0x18')][_0x6810('0x19')]({'where':_0x1625b6[_0x6810('0x1a')]?_0x1625b6[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':_0x1625b6[_0x6810('0x1a')]?_0x1625b6[_0x6810('0x1a')][_0x6810('0x1d')]||null:null,'limit':0x1,'order':_0x1625b6['options']?_0x1625b6['options']['order']||null:null,'group':db[_0x6810('0x18')][_0x6810('0x37')],'transaction':_0x40268f,'lock':_0x40268f['LOCK'][_0x6810('0x2f')],'include':_0x1625b6['options']?_0x1625b6['options'][_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x1625b6[_0x6810('0x1a')]['include'],function(_0x3f700e){return{'model':db[_0x3f700e[_0x6810('0x20')]],'as':_0x3f700e['as'],'attributes':_0x3f700e[_0x6810('0x1d')],'include':_0x3f700e[_0x6810('0x1e')]?_['map'](_0x3f700e[_0x6810('0x1e')],function(_0x3fe4f2){return{'model':db[_0x3fe4f2[_0x6810('0x20')]],'as':_0x3fe4f2['as'],'attributes':_0x3fe4f2[_0x6810('0x1d')],'include':_0x3fe4f2[_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x3fe4f2[_0x6810('0x1e')],function(_0x3d4442){return{'model':db[_0x3d4442['model']],'as':_0x3d4442['as'],'attributes':_0x3d4442[_0x6810('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6810('0x24')](function(_0x4ce735){var _0x3d94ba=[];for(var _0x53e4fb=0x0;_0x53e4fb<_0x4ce735[_0x6810('0x36')];_0x53e4fb+=0x1){_0x3d94ba[_0x6810('0x39')](_0x4ce735[_0x53e4fb][_0x6810('0x28')](_0x1625b6[_0x6810('0x25')],{'transaction':_0x40268f}));}return BPromise[_0x6810('0x3a')](_0x3d94ba);});})[_0x6810('0x24')](function(_0x569396){logger[_0x6810('0x21')]('GetContactRecallMe',_0x1625b6);logger[_0x6810('0xf')](_0x6810('0x45'),_0x1625b6,JSON['stringify'](_0x569396));_0x573cf8(_0x569396);})['catch'](function(_0x40020b){logger[_0x6810('0x12')]('GetContactRecallMe',_0x40020b[_0x6810('0x14')],_0x1625b6);_0x3e4686(_0x468d10[_0x6810('0x12')](0x1f4,_0x40020b[_0x6810('0x14')]));});});});};exports[_0x6810('0x46')]=function(_0x5d9356){var _0x12a848=this;return new Promise(function(_0x554a02,_0x35a398){db[_0x6810('0x30')][_0x6810('0x2c')]()['then'](function(_0x1f3a04){return db['CmHopper'][_0x6810('0x19')]({'raw':_0x5d9356[_0x6810('0x1a')]?_0x5d9356[_0x6810('0x1a')][_0x6810('0x1b')]===undefined?!![]:![]:!![],'where':_0x5d9356[_0x6810('0x1a')]?_0x5d9356[_0x6810('0x1a')][_0x6810('0x1c')]||null:null,'attributes':_0x5d9356[_0x6810('0x1a')]?_0x5d9356[_0x6810('0x1a')][_0x6810('0x1d')]||null:null,'limit':_0x5d9356[_0x6810('0x1a')]?_0x5d9356[_0x6810('0x1a')][_0x6810('0x2e')]||null:null,'include':_0x5d9356['options']?_0x5d9356['options'][_0x6810('0x1e')]?_[_0x6810('0x1f')](_0x5d9356[_0x6810('0x1a')][_0x6810('0x1e')],function(_0x1ef3a3){return{'model':db[_0x1ef3a3[_0x6810('0x20')]],'as':_0x1ef3a3['as'],'attributes':_0x1ef3a3['as']===_0x6810('0x31')?_[_0x6810('0x32')](_0x1f3a04):_0x1ef3a3['attributes'],'include':_0x1ef3a3['include']?_[_0x6810('0x1f')](_0x1ef3a3[_0x6810('0x1e')],function(_0x35f8c8){return{'model':db[_0x35f8c8[_0x6810('0x20')]],'as':_0x35f8c8['as'],'attributes':_0x35f8c8[_0x6810('0x1d')],'include':_0x35f8c8['include']?_[_0x6810('0x1f')](_0x35f8c8[_0x6810('0x1e')],function(_0x420fb9){return{'model':db[_0x420fb9['model']],'as':_0x420fb9['as'],'attributes':_0x420fb9[_0x6810('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6810('0x24')](function(_0x52106f){logger[_0x6810('0x21')](_0x6810('0x17'),_0x5d9356);logger[_0x6810('0xf')]('GetCmHopper',_0x5d9356,JSON[_0x6810('0x11')](_0x52106f));_0x554a02(_0x52106f);})[_0x6810('0x16')](function(_0x229e7b){logger[_0x6810('0x12')](_0x6810('0x17'),_0x229e7b[_0x6810('0x14')],_0x5d9356);_0x35a398(_0x12a848['error'](0x1f4,_0x229e7b['message']));});});});};
\ No newline at end of file
index 477f47a..3a09f41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5d8=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','isAuthenticated','/describe','describe','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','delete','destroy'];(function(_0x230ba4,_0x14f937){var _0x2d872a=function(_0x44459f){while(--_0x44459f){_0x230ba4['push'](_0x230ba4['shift']());}};_0x2d872a(++_0x14f937);}(_0xb5d8,0xd9));var _0x8b5d=function(_0x51da15,_0x265676){_0x51da15=_0x51da15-0x0;var _0x5629e0=_0xb5d8[_0x51da15];return _0x5629e0;};'use strict';var multer=require(_0x8b5d('0x0'));var util=require(_0x8b5d('0x1'));var path=require('path');var timeout=require(_0x8b5d('0x2'));var express=require(_0x8b5d('0x3'));var router=express[_0x8b5d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8b5d('0x5'));var interaction=require(_0x8b5d('0x6'));var config=require(_0x8b5d('0x7'));var controller=require(_0x8b5d('0x8'));router['get']('/',auth[_0x8b5d('0x9')](),controller['index']);router['get'](_0x8b5d('0xa'),auth['isAuthenticated'](),controller[_0x8b5d('0xb')]);router['get']('/opencontacts',auth['isAuthenticated'](),controller[_0x8b5d('0xc')]);router['get'](_0x8b5d('0xd'),auth['isAuthenticated'](),controller[_0x8b5d('0xe')]);router[_0x8b5d('0xf')]('/',auth[_0x8b5d('0x9')](),controller[_0x8b5d('0x10')]);router[_0x8b5d('0xf')](_0x8b5d('0x11'),auth['isAuthenticated'](),controller[_0x8b5d('0x12')]);router[_0x8b5d('0x13')](_0x8b5d('0xd'),auth[_0x8b5d('0x9')](),controller[_0x8b5d('0x14')]);router[_0x8b5d('0x15')](_0x8b5d('0xd'),auth[_0x8b5d('0x9')](),controller[_0x8b5d('0x16')]);module[_0x8b5d('0x17')]=router;
\ No newline at end of file
+var _0x4108=['getPreview','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopper.controller','isAuthenticated','get','/describe','describe','/opencontacts','getOpenContacts','/:id','show','create','post','/preview'];(function(_0xc7d364,_0x46b60a){var _0x57b946=function(_0x5f0b20){while(--_0x5f0b20){_0xc7d364['push'](_0xc7d364['shift']());}};_0x57b946(++_0x46b60a);}(_0x4108,0x69));var _0x8410=function(_0x1c3997,_0x19d42d){_0x1c3997=_0x1c3997-0x0;var _0x119bb6=_0x4108[_0x1c3997];return _0x119bb6;};'use strict';var multer=require('multer');var util=require(_0x8410('0x0'));var path=require(_0x8410('0x1'));var timeout=require(_0x8410('0x2'));var express=require(_0x8410('0x3'));var router=express[_0x8410('0x4')]();var fs_extra=require(_0x8410('0x5'));var auth=require(_0x8410('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8410('0x7'));var controller=require(_0x8410('0x8'));router['get']('/',auth[_0x8410('0x9')](),controller['index']);router[_0x8410('0xa')](_0x8410('0xb'),auth[_0x8410('0x9')](),controller[_0x8410('0xc')]);router[_0x8410('0xa')](_0x8410('0xd'),auth[_0x8410('0x9')](),controller[_0x8410('0xe')]);router[_0x8410('0xa')](_0x8410('0xf'),auth[_0x8410('0x9')](),controller[_0x8410('0x10')]);router['post']('/',auth[_0x8410('0x9')](),controller[_0x8410('0x11')]);router[_0x8410('0x12')](_0x8410('0x13'),auth[_0x8410('0x9')](),controller[_0x8410('0x14')]);router['put'](_0x8410('0xf'),auth['isAuthenticated'](),controller[_0x8410('0x15')]);router[_0x8410('0x16')](_0x8410('0xf'),auth[_0x8410('0x9')](),controller[_0x8410('0x17')]);module[_0x8410('0x18')]=router;
\ No newline at end of file
index 0f7a5b5..08b218a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cff=['moment','sequelize','STRING','contactListQueue','INTEGER'];(function(_0x442020,_0x271171){var _0x3d954f=function(_0x4862c2){while(--_0x4862c2){_0x442020['push'](_0x442020['shift']());}};_0x3d954f(++_0x271171);}(_0x4cff,0x14a));var _0xf4cf=function(_0x24ac0a,_0x137a37){_0x24ac0a=_0x24ac0a-0x0;var _0x495692=_0x4cff[_0x24ac0a];return _0x495692;};'use strict';var moment=require(_0xf4cf('0x0'));var Sequelize=require(_0xf4cf('0x1'));module['exports']={'phone':{'type':Sequelize[_0xf4cf('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xf4cf('0x3')},'ListId':{'type':Sequelize[_0xf4cf('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xf4cf('0x4')],'unique':_0xf4cf('0x3')}};
\ No newline at end of file
+var _0x8569=['contactListQueue','exports','STRING','INTEGER'];(function(_0x177e15,_0x27cdf7){var _0x4855e8=function(_0x2b9095){while(--_0x2b9095){_0x177e15['push'](_0x177e15['shift']());}};_0x4855e8(++_0x27cdf7);}(_0x8569,0x14d));var _0x9856=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x8569[_0x3718b7];return _0xf8c91e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x9856('0x0')]={'phone':{'type':Sequelize[_0x9856('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x9856('0x2')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x9856('0x2')],'unique':_0x9856('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x9856('0x3')}};
\ No newline at end of file
index 34758cc..ecd8eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5ad=['fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','then','destroy','error','name','send','index','CmHopperBlack','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs'];(function(_0x41cf69,_0x15a021){var _0x2d5890=function(_0xa3f0c0){while(--_0xa3f0c0){_0x41cf69['push'](_0x41cf69['shift']());}};_0x2d5890(++_0x15a021);}(_0xa5ad,0x1ab));var _0xda5a=function(_0x500f5d,_0x5433a3){_0x500f5d=_0x500f5d-0x0;var _0x1f7498=_0xa5ad[_0x500f5d];return _0x1f7498;};'use strict';var emlformat=require(_0xda5a('0x0'));var rimraf=require(_0xda5a('0x1'));var zipdir=require(_0xda5a('0x2'));var jsonpatch=require(_0xda5a('0x3'));var rp=require(_0xda5a('0x4'));var moment=require('moment');var BPromise=require(_0xda5a('0x5'));var Mustache=require('mustache');var util=require(_0xda5a('0x6'));var path=require(_0xda5a('0x7'));var sox=require(_0xda5a('0x8'));var csv=require(_0xda5a('0x9'));var ejs=require(_0xda5a('0xa'));var fs=require('fs');var fs_extra=require(_0xda5a('0xb'));var _=require(_0xda5a('0xc'));var squel=require(_0xda5a('0xd'));var crypto=require(_0xda5a('0xe'));var jsforce=require(_0xda5a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xda5a('0x9'));var querystring=require('querystring');var Papa=require(_0xda5a('0x10'));var Redis=require('ioredis');var authService=require(_0xda5a('0x11'));var qs=require(_0xda5a('0x12'));var as=require(_0xda5a('0x13'));var hardwareService=require(_0xda5a('0x14'));var logger=require(_0xda5a('0x15'))(_0xda5a('0x16'));var utils=require(_0xda5a('0x17'));var config=require(_0xda5a('0x18'));var licenseUtil=require(_0xda5a('0x19'));var db=require(_0xda5a('0x1a'))['db'];function respondWithStatusCode(_0xa12d33,_0x1ee81a){_0x1ee81a=_0x1ee81a||0xcc;return function(_0x519473){if(_0x519473){return _0xa12d33[_0xda5a('0x1b')](_0x1ee81a);}return _0xa12d33[_0xda5a('0x1c')](_0x1ee81a)[_0xda5a('0x1d')]();};}function respondWithResult(_0x50e5c0,_0x12bc13){_0x12bc13=_0x12bc13||0xc8;return function(_0x2fa134){if(_0x2fa134){return _0x50e5c0[_0xda5a('0x1c')](_0x12bc13)[_0xda5a('0x1e')](_0x2fa134);}};}function respondWithFilteredResult(_0x16a252,_0x104f2f){return function(_0x570c3e){if(_0x570c3e){var _0x396afa=typeof _0x104f2f[_0xda5a('0x1f')]===_0xda5a('0x20')&&typeof _0x104f2f['limit']==='undefined';var _0x5c2273=_0x570c3e['count'];var _0x182839=_0x396afa?0x0:_0x104f2f[_0xda5a('0x1f')];var _0x247a6a=_0x396afa?_0x570c3e[_0xda5a('0x21')]:_0x104f2f[_0xda5a('0x1f')]+_0x104f2f[_0xda5a('0x22')];var _0x2bba69;if(_0x247a6a>=_0x5c2273){_0x247a6a=_0x5c2273;_0x2bba69=0xc8;}else{_0x2bba69=0xce;}_0x16a252[_0xda5a('0x1c')](_0x2bba69);return _0x16a252['set']('Content-Range',_0x182839+'-'+_0x247a6a+'/'+_0x5c2273)[_0xda5a('0x1e')](_0x570c3e);}return null;};}function patchUpdates(_0x81800c){return function(_0x134b75){try{jsonpatch['apply'](_0x134b75,_0x81800c,!![]);}catch(_0x54c63d){return BPromise[_0xda5a('0x23')](_0x54c63d);}return _0x134b75[_0xda5a('0x24')]();};}function saveUpdates(_0x576b74,_0x49c895){return function(_0x2337f9){if(_0x2337f9){return _0x2337f9['update'](_0x576b74)[_0xda5a('0x25')](function(_0xf98e8d){return _0xf98e8d;});}return null;};}function removeEntity(_0x54f72e,_0x365b91){return function(_0x291427){if(_0x291427){return _0x291427[_0xda5a('0x26')]()[_0xda5a('0x25')](function(){_0x54f72e[_0xda5a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f5edd,_0x46dbab){return function(_0x381226){if(!_0x381226){_0x3f5edd[_0xda5a('0x1b')](0x194);}return _0x381226;};}function handleError(_0x1722ea,_0x406937){_0x406937=_0x406937||0x1f4;return function(_0x3f0d77){logger[_0xda5a('0x27')](_0x3f0d77['stack']);if(_0x3f0d77[_0xda5a('0x28')]){delete _0x3f0d77[_0xda5a('0x28')];}_0x1722ea[_0xda5a('0x1c')](_0x406937)[_0xda5a('0x29')](_0x3f0d77);};}exports[_0xda5a('0x2a')]=function(_0xbe9e82,_0x245eaf){var _0x3f8dd3={},_0x2fcb03={},_0x3a3c00={'count':0x0,'rows':[]};var _0x397ac0=_['map'](db[_0xda5a('0x2b')]['rawAttributes'],function(_0x457dc1){return{'name':_0x457dc1[_0xda5a('0x2c')],'type':_0x457dc1['type'][_0xda5a('0x2d')]};});_0x2fcb03[_0xda5a('0x2e')]=_[_0xda5a('0x2f')](_0x397ac0,'name');_0x2fcb03[_0xda5a('0x30')]=_[_0xda5a('0x31')](_0xbe9e82[_0xda5a('0x30')]);_0x2fcb03[_0xda5a('0x32')]=_['intersection'](_0x2fcb03[_0xda5a('0x2e')],_0x2fcb03[_0xda5a('0x30')]);_0x3f8dd3[_0xda5a('0x33')]=_[_0xda5a('0x34')](_0x2fcb03[_0xda5a('0x2e')],qs[_0xda5a('0x35')](_0xbe9e82[_0xda5a('0x30')][_0xda5a('0x35')]));_0x3f8dd3[_0xda5a('0x33')]=_0x3f8dd3[_0xda5a('0x33')]['length']?_0x3f8dd3[_0xda5a('0x33')]:_0x2fcb03[_0xda5a('0x2e')];if(!_0xbe9e82[_0xda5a('0x30')][_0xda5a('0x36')]('nolimit')){_0x3f8dd3['limit']=qs[_0xda5a('0x22')](_0xbe9e82[_0xda5a('0x30')][_0xda5a('0x22')]);_0x3f8dd3[_0xda5a('0x1f')]=qs[_0xda5a('0x1f')](_0xbe9e82['query'][_0xda5a('0x1f')]);}_0x3f8dd3['order']=qs['sort'](_0xbe9e82['query'][_0xda5a('0x37')]);_0x3f8dd3[_0xda5a('0x38')]=qs[_0xda5a('0x32')](_[_0xda5a('0x39')](_0xbe9e82[_0xda5a('0x30')],_0x2fcb03[_0xda5a('0x32')]),_0x397ac0);if(_0xbe9e82[_0xda5a('0x30')][_0xda5a('0x3a')]){_0x3f8dd3[_0xda5a('0x38')]=_[_0xda5a('0x3b')](_0x3f8dd3['where'],{'$or':_[_0xda5a('0x2f')](_0x397ac0,function(_0x4a9206){if(_0x4a9206['type']!==_0xda5a('0x3c')){var _0x4b62e8={};_0x4b62e8[_0x4a9206[_0xda5a('0x28')]]={'$like':'%'+_0xbe9e82[_0xda5a('0x30')][_0xda5a('0x3a')]+'%'};return _0x4b62e8;}})});}_0x3f8dd3=_[_0xda5a('0x3b')]({},_0x3f8dd3,_0xbe9e82[_0xda5a('0x3d')]);var _0x5b9813={'where':_0x3f8dd3['where']};return db[_0xda5a('0x2b')][_0xda5a('0x21')](_0x5b9813)[_0xda5a('0x25')](function(_0x41d00f){_0x3a3c00[_0xda5a('0x21')]=_0x41d00f;if(_0xbe9e82[_0xda5a('0x30')][_0xda5a('0x3e')]){_0x3f8dd3[_0xda5a('0x3f')]=[{'all':!![]}];}return db[_0xda5a('0x2b')][_0xda5a('0x40')](_0x3f8dd3);})[_0xda5a('0x25')](function(_0x851b61){_0x3a3c00['rows']=_0x851b61;return _0x3a3c00;})['then'](respondWithFilteredResult(_0x245eaf,_0x3f8dd3))[_0xda5a('0x41')](handleError(_0x245eaf,null));};exports[_0xda5a('0x42')]=function(_0x1ec119,_0x47d36e){var _0x2c0ecc={'raw':!![],'where':{'id':_0x1ec119[_0xda5a('0x43')]['id']}},_0x27669f={};_0x27669f[_0xda5a('0x2e')]=_[_0xda5a('0x31')](db[_0xda5a('0x2b')][_0xda5a('0x44')]);_0x27669f[_0xda5a('0x30')]=_[_0xda5a('0x31')](_0x1ec119['query']);_0x27669f[_0xda5a('0x32')]=_[_0xda5a('0x34')](_0x27669f[_0xda5a('0x2e')],_0x27669f[_0xda5a('0x30')]);_0x2c0ecc[_0xda5a('0x33')]=_[_0xda5a('0x34')](_0x27669f[_0xda5a('0x2e')],qs[_0xda5a('0x35')](_0x1ec119[_0xda5a('0x30')][_0xda5a('0x35')]));_0x2c0ecc['attributes']=_0x2c0ecc[_0xda5a('0x33')][_0xda5a('0x45')]?_0x2c0ecc[_0xda5a('0x33')]:_0x27669f['model'];if(_0x1ec119[_0xda5a('0x30')][_0xda5a('0x3e')]){_0x2c0ecc[_0xda5a('0x3f')]=[{'all':!![]}];}_0x2c0ecc=_[_0xda5a('0x3b')]({},_0x2c0ecc,_0x1ec119['options']);return db['CmHopperBlack'][_0xda5a('0x46')](_0x2c0ecc)[_0xda5a('0x25')](handleEntityNotFound(_0x47d36e,null))[_0xda5a('0x25')](respondWithResult(_0x47d36e,null))['catch'](handleError(_0x47d36e,null));};exports['update']=function(_0x2f61fd,_0x577e33){if(_0x2f61fd[_0xda5a('0x47')]['id']){delete _0x2f61fd['body']['id'];}return db[_0xda5a('0x2b')][_0xda5a('0x46')]({'where':{'id':_0x2f61fd[_0xda5a('0x43')]['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x577e33,null))[_0xda5a('0x25')](saveUpdates(_0x2f61fd[_0xda5a('0x47')],null))[_0xda5a('0x25')](respondWithResult(_0x577e33,null))[_0xda5a('0x41')](handleError(_0x577e33,null));};exports[_0xda5a('0x26')]=function(_0x1ceba3,_0x166261){return db[_0xda5a('0x2b')][_0xda5a('0x46')]({'where':{'id':_0x1ceba3[_0xda5a('0x43')]['id']}})[_0xda5a('0x25')](handleEntityNotFound(_0x166261,null))['then'](removeEntity(_0x166261,null))[_0xda5a('0x41')](handleError(_0x166261,null));};exports['describe']=function(_0x14bc4a,_0xbdda3b){return db[_0xda5a('0x2b')][_0xda5a('0x48')]()[_0xda5a('0x25')](respondWithResult(_0xbdda3b,null))[_0xda5a('0x41')](handleError(_0xbdda3b,null));};
\ No newline at end of file
+var _0xa02f=['lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','include','findAll','rows','catch','show','params','keys','body','find','describe','eml-format','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xa02f,0xdb));var _0xfa02=function(_0x363286,_0x3c2e2a){_0x363286=_0x363286-0x0;var _0x182c3e=_0xa02f[_0x363286];return _0x182c3e;};'use strict';var emlformat=require(_0xfa02('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfa02('0x1'));var moment=require(_0xfa02('0x2'));var BPromise=require(_0xfa02('0x3'));var Mustache=require(_0xfa02('0x4'));var util=require('util');var path=require(_0xfa02('0x5'));var sox=require(_0xfa02('0x6'));var csv=require('to-csv');var ejs=require(_0xfa02('0x7'));var fs=require('fs');var fs_extra=require(_0xfa02('0x8'));var _=require(_0xfa02('0x9'));var squel=require(_0xfa02('0xa'));var crypto=require(_0xfa02('0xb'));var jsforce=require(_0xfa02('0xc'));var deskjs=require(_0xfa02('0xd'));var toCsv=require(_0xfa02('0xe'));var querystring=require('querystring');var Papa=require(_0xfa02('0xf'));var Redis=require('ioredis');var authService=require(_0xfa02('0x10'));var qs=require(_0xfa02('0x11'));var as=require(_0xfa02('0x12'));var hardwareService=require(_0xfa02('0x13'));var logger=require(_0xfa02('0x14'))(_0xfa02('0x15'));var utils=require('../../config/utils');var config=require(_0xfa02('0x16'));var licenseUtil=require(_0xfa02('0x17'));var db=require(_0xfa02('0x18'))['db'];function respondWithStatusCode(_0xb27f42,_0x3b254f){_0x3b254f=_0x3b254f||0xcc;return function(_0x4aee29){if(_0x4aee29){return _0xb27f42['sendStatus'](_0x3b254f);}return _0xb27f42[_0xfa02('0x19')](_0x3b254f)['end']();};}function respondWithResult(_0x20a1dd,_0x30a7c6){_0x30a7c6=_0x30a7c6||0xc8;return function(_0x3b92f0){if(_0x3b92f0){return _0x20a1dd[_0xfa02('0x19')](_0x30a7c6)[_0xfa02('0x1a')](_0x3b92f0);}};}function respondWithFilteredResult(_0x226afa,_0x22e05e){return function(_0x1acb92){if(_0x1acb92){var _0x5c70f2=typeof _0x22e05e[_0xfa02('0x1b')]==='undefined'&&typeof _0x22e05e[_0xfa02('0x1c')]===_0xfa02('0x1d');var _0x542ed6=_0x1acb92[_0xfa02('0x1e')];var _0x44a542=_0x5c70f2?0x0:_0x22e05e[_0xfa02('0x1b')];var _0x4d699c=_0x5c70f2?_0x1acb92[_0xfa02('0x1e')]:_0x22e05e['offset']+_0x22e05e[_0xfa02('0x1c')];var _0x5120fe;if(_0x4d699c>=_0x542ed6){_0x4d699c=_0x542ed6;_0x5120fe=0xc8;}else{_0x5120fe=0xce;}_0x226afa[_0xfa02('0x19')](_0x5120fe);return _0x226afa[_0xfa02('0x1f')]('Content-Range',_0x44a542+'-'+_0x4d699c+'/'+_0x542ed6)[_0xfa02('0x1a')](_0x1acb92);}return null;};}function patchUpdates(_0x46365f){return function(_0x230dae){try{jsonpatch[_0xfa02('0x20')](_0x230dae,_0x46365f,!![]);}catch(_0x24c2fd){return BPromise[_0xfa02('0x21')](_0x24c2fd);}return _0x230dae[_0xfa02('0x22')]();};}function saveUpdates(_0x138880,_0x5f2c62){return function(_0x613e53){if(_0x613e53){return _0x613e53[_0xfa02('0x23')](_0x138880)[_0xfa02('0x24')](function(_0x18bbdc){return _0x18bbdc;});}return null;};}function removeEntity(_0x56306d,_0x1d905b){return function(_0x3e9c5e){if(_0x3e9c5e){return _0x3e9c5e[_0xfa02('0x25')]()[_0xfa02('0x24')](function(){_0x56306d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x465022,_0x3e89f4){return function(_0x55d12e){if(!_0x55d12e){_0x465022[_0xfa02('0x26')](0x194);}return _0x55d12e;};}function handleError(_0x2172ed,_0x331565){_0x331565=_0x331565||0x1f4;return function(_0x304565){logger[_0xfa02('0x27')](_0x304565[_0xfa02('0x28')]);if(_0x304565[_0xfa02('0x29')]){delete _0x304565[_0xfa02('0x29')];}_0x2172ed[_0xfa02('0x19')](_0x331565)['send'](_0x304565);};}exports[_0xfa02('0x2a')]=function(_0x2b79c0,_0x362a63){var _0x28af63={},_0x3b8582={},_0x1f5702={'count':0x0,'rows':[]};var _0x1e9ead=_[_0xfa02('0x2b')](db['CmHopperBlack'][_0xfa02('0x2c')],function(_0x11d720){return{'name':_0x11d720[_0xfa02('0x2d')],'type':_0x11d720[_0xfa02('0x2e')][_0xfa02('0x2f')]};});_0x3b8582['model']=_[_0xfa02('0x2b')](_0x1e9ead,_0xfa02('0x29'));_0x3b8582[_0xfa02('0x30')]=_['keys'](_0x2b79c0[_0xfa02('0x30')]);_0x3b8582[_0xfa02('0x31')]=_[_0xfa02('0x32')](_0x3b8582[_0xfa02('0x33')],_0x3b8582[_0xfa02('0x30')]);_0x28af63[_0xfa02('0x34')]=_[_0xfa02('0x32')](_0x3b8582['model'],qs['fields'](_0x2b79c0['query'][_0xfa02('0x35')]));_0x28af63[_0xfa02('0x34')]=_0x28af63[_0xfa02('0x34')][_0xfa02('0x36')]?_0x28af63[_0xfa02('0x34')]:_0x3b8582[_0xfa02('0x33')];if(!_0x2b79c0[_0xfa02('0x30')][_0xfa02('0x37')](_0xfa02('0x38'))){_0x28af63['limit']=qs[_0xfa02('0x1c')](_0x2b79c0[_0xfa02('0x30')][_0xfa02('0x1c')]);_0x28af63[_0xfa02('0x1b')]=qs['offset'](_0x2b79c0[_0xfa02('0x30')][_0xfa02('0x1b')]);}_0x28af63[_0xfa02('0x39')]=qs[_0xfa02('0x3a')](_0x2b79c0[_0xfa02('0x30')][_0xfa02('0x3a')]);_0x28af63[_0xfa02('0x3b')]=qs[_0xfa02('0x31')](_[_0xfa02('0x3c')](_0x2b79c0[_0xfa02('0x30')],_0x3b8582[_0xfa02('0x31')]),_0x1e9ead);if(_0x2b79c0[_0xfa02('0x30')][_0xfa02('0x3d')]){_0x28af63[_0xfa02('0x3b')]=_[_0xfa02('0x3e')](_0x28af63[_0xfa02('0x3b')],{'$or':_[_0xfa02('0x2b')](_0x1e9ead,function(_0x464ec5){if(_0x464ec5[_0xfa02('0x2e')]!==_0xfa02('0x3f')){var _0xe103fa={};_0xe103fa[_0x464ec5['name']]={'$like':'%'+_0x2b79c0[_0xfa02('0x30')][_0xfa02('0x3d')]+'%'};return _0xe103fa;}})});}_0x28af63=_[_0xfa02('0x3e')]({},_0x28af63,_0x2b79c0[_0xfa02('0x40')]);var _0x3a3a8d={'where':_0x28af63[_0xfa02('0x3b')]};return db[_0xfa02('0x41')]['count'](_0x3a3a8d)['then'](function(_0x124941){_0x1f5702[_0xfa02('0x1e')]=_0x124941;if(_0x2b79c0['query']['includeAll']){_0x28af63[_0xfa02('0x42')]=[{'all':!![]}];}return db[_0xfa02('0x41')][_0xfa02('0x43')](_0x28af63);})[_0xfa02('0x24')](function(_0x448e7b){_0x1f5702[_0xfa02('0x44')]=_0x448e7b;return _0x1f5702;})[_0xfa02('0x24')](respondWithFilteredResult(_0x362a63,_0x28af63))[_0xfa02('0x45')](handleError(_0x362a63,null));};exports[_0xfa02('0x46')]=function(_0x4ee345,_0xf13aed){var _0x46ed9e={'raw':!![],'where':{'id':_0x4ee345[_0xfa02('0x47')]['id']}},_0x522c3f={};_0x522c3f[_0xfa02('0x33')]=_[_0xfa02('0x48')](db[_0xfa02('0x41')][_0xfa02('0x2c')]);_0x522c3f[_0xfa02('0x30')]=_[_0xfa02('0x48')](_0x4ee345['query']);_0x522c3f[_0xfa02('0x31')]=_[_0xfa02('0x32')](_0x522c3f['model'],_0x522c3f[_0xfa02('0x30')]);_0x46ed9e[_0xfa02('0x34')]=_[_0xfa02('0x32')](_0x522c3f['model'],qs['fields'](_0x4ee345[_0xfa02('0x30')]['fields']));_0x46ed9e[_0xfa02('0x34')]=_0x46ed9e[_0xfa02('0x34')][_0xfa02('0x36')]?_0x46ed9e[_0xfa02('0x34')]:_0x522c3f[_0xfa02('0x33')];if(_0x4ee345[_0xfa02('0x30')]['includeAll']){_0x46ed9e[_0xfa02('0x42')]=[{'all':!![]}];}_0x46ed9e=_[_0xfa02('0x3e')]({},_0x46ed9e,_0x4ee345[_0xfa02('0x40')]);return db[_0xfa02('0x41')]['find'](_0x46ed9e)[_0xfa02('0x24')](handleEntityNotFound(_0xf13aed,null))['then'](respondWithResult(_0xf13aed,null))[_0xfa02('0x45')](handleError(_0xf13aed,null));};exports['update']=function(_0x237a9f,_0x2f2e51){if(_0x237a9f[_0xfa02('0x49')]['id']){delete _0x237a9f[_0xfa02('0x49')]['id'];}return db[_0xfa02('0x41')][_0xfa02('0x4a')]({'where':{'id':_0x237a9f[_0xfa02('0x47')]['id']}})[_0xfa02('0x24')](handleEntityNotFound(_0x2f2e51,null))[_0xfa02('0x24')](saveUpdates(_0x237a9f[_0xfa02('0x49')],null))['then'](respondWithResult(_0x2f2e51,null))[_0xfa02('0x45')](handleError(_0x2f2e51,null));};exports[_0xfa02('0x25')]=function(_0xf9b98b,_0xe75c1f){return db['CmHopperBlack'][_0xfa02('0x4a')]({'where':{'id':_0xf9b98b[_0xfa02('0x47')]['id']}})['then'](handleEntityNotFound(_0xe75c1f,null))[_0xfa02('0x24')](removeEntity(_0xe75c1f,null))[_0xfa02('0x45')](handleError(_0xe75c1f,null));};exports[_0xfa02('0x4b')]=function(_0x34424c,_0x4ebf0d){return db[_0xfa02('0x41')]['describe']()[_0xfa02('0x24')](respondWithResult(_0x4ebf0d,null))[_0xfa02('0x45')](handleError(_0x4ebf0d,null));};
\ No newline at end of file
index 48e19a5..6e19cfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2e=['exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x9b2e,0x7c));var _0xe9b2=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9b2e[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xe9b2('0x0'));var util=require(_0xe9b2('0x1'));var logger=require(_0xe9b2('0x2'))(_0xe9b2('0x3'));var moment=require(_0xe9b2('0x4'));var BPromise=require(_0xe9b2('0x5'));var rp=require(_0xe9b2('0x6'));var fs=require('fs');var path=require(_0xe9b2('0x7'));var rimraf=require(_0xe9b2('0x8'));var config=require(_0xe9b2('0x9'));var attributes=require(_0xe9b2('0xa'));module[_0xe9b2('0xb')]=function(_0x13c6e1,_0x23f03e){return _0x13c6e1[_0xe9b2('0xc')](_0xe9b2('0xd'),attributes,{'tableName':_0xe9b2('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6e1=['../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','lodash','util'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xa6e1,0x13d));var _0x1a6e=function(_0x30b1ea,_0x32a686){_0x30b1ea=_0x30b1ea-0x0;var _0x4661b1=_0xa6e1[_0x30b1ea];return _0x4661b1;};'use strict';var _=require(_0x1a6e('0x0'));var util=require(_0x1a6e('0x1'));var logger=require(_0x1a6e('0x2'))(_0x1a6e('0x3'));var moment=require(_0x1a6e('0x4'));var BPromise=require('bluebird');var rp=require(_0x1a6e('0x5'));var fs=require('fs');var path=require(_0x1a6e('0x6'));var rimraf=require('rimraf');var config=require(_0x1a6e('0x7'));var attributes=require(_0x1a6e('0x8'));module['exports']=function(_0x1c7875,_0x1ed115){return _0x1c7875[_0x1a6e('0x9')](_0x1a6e('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 01b838d..a819285 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdf1=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','DestroyCmHopperBlack','stringify','lodash','util','moment'];(function(_0x3a376f,_0x4694fb){var _0x2cc9ae=function(_0x3efd74){while(--_0x3efd74){_0x3a376f['push'](_0x3a376f['shift']());}};_0x2cc9ae(++_0x4694fb);}(_0xfdf1,0x16f));var _0x1fdf=function(_0x2ab154,_0x45d19d){_0x2ab154=_0x2ab154-0x0;var _0xe8afe3=_0xfdf1[_0x2ab154];return _0xe8afe3;};'use strict';var _=require(_0x1fdf('0x0'));var util=require(_0x1fdf('0x1'));var moment=require(_0x1fdf('0x2'));var BPromise=require(_0x1fdf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fdf('0x4'));var db=require(_0x1fdf('0x5'))['db'];var utils=require(_0x1fdf('0x6'));var logger=require(_0x1fdf('0x7'))('rpc');var config=require(_0x1fdf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1fdf('0x9')][_0x1fdf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b3f,_0x1d60be,_0x259bad){return new BPromise(function(_0x38d6ca,_0x4bed11){return client['request'](_0x5a5b3f,_0x259bad)[_0x1fdf('0xb')](function(_0x379ac7){logger[_0x1fdf('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1d60be,_0x1fdf('0xd'));logger[_0x1fdf('0xe')](_0x1fdf('0xf'),_0x1d60be,_0x1fdf('0xd'),JSON['stringify'](_0x379ac7));if(_0x379ac7[_0x1fdf('0x10')]){if(_0x379ac7[_0x1fdf('0x10')][_0x1fdf('0x11')]===0x1f4){logger[_0x1fdf('0x10')](_0x1fdf('0x12'),_0x1d60be,_0x379ac7[_0x1fdf('0x10')][_0x1fdf('0x13')]);return _0x4bed11(_0x379ac7['error'][_0x1fdf('0x13')]);}logger[_0x1fdf('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x1d60be,_0x379ac7[_0x1fdf('0x10')][_0x1fdf('0x13')]);return _0x38d6ca(_0x379ac7[_0x1fdf('0x10')][_0x1fdf('0x13')]);}else{logger[_0x1fdf('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1d60be,_0x1fdf('0xd'));_0x38d6ca(_0x379ac7[_0x1fdf('0x14')][_0x1fdf('0x13')]);}})[_0x1fdf('0x15')](function(_0x30c441){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1d60be,_0x30c441);_0x4bed11(_0x30c441);});});}exports[_0x1fdf('0x16')]=function(_0xcde756){var _0x5711a6=this;return new Promise(function(_0x3a08d3,_0x219000){return db['CmHopperBlack'][_0x1fdf('0x17')]({'raw':_0xcde756[_0x1fdf('0x18')]?_0xcde756[_0x1fdf('0x18')][_0x1fdf('0x19')]===undefined?!![]:![]:!![],'where':_0xcde756[_0x1fdf('0x18')]?_0xcde756[_0x1fdf('0x18')][_0x1fdf('0x1a')]||null:null,'attributes':_0xcde756['options']?_0xcde756[_0x1fdf('0x18')][_0x1fdf('0x1b')]||null:null,'limit':_0xcde756[_0x1fdf('0x18')]?_0xcde756['options'][_0x1fdf('0x1c')]||null:null,'include':_0xcde756[_0x1fdf('0x18')]?_0xcde756[_0x1fdf('0x18')][_0x1fdf('0x1d')]?_[_0x1fdf('0x1e')](_0xcde756[_0x1fdf('0x18')][_0x1fdf('0x1d')],function(_0x286411){return{'model':db[_0x286411[_0x1fdf('0x1f')]],'as':_0x286411['as'],'attributes':_0x286411[_0x1fdf('0x1b')],'include':_0x286411[_0x1fdf('0x1d')]?_['map'](_0x286411['include'],function(_0x27c060){return{'model':db[_0x27c060[_0x1fdf('0x1f')]],'as':_0x27c060['as'],'attributes':_0x27c060['attributes'],'include':_0x27c060['include']?_[_0x1fdf('0x1e')](_0x27c060[_0x1fdf('0x1d')],function(_0x2c1184){return{'model':db[_0x2c1184[_0x1fdf('0x1f')]],'as':_0x2c1184['as'],'attributes':_0x2c1184[_0x1fdf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1fdf('0xb')](function(_0x362b7e){logger[_0x1fdf('0xc')](_0x1fdf('0x16'),_0xcde756);logger[_0x1fdf('0xe')](_0x1fdf('0x16'),_0xcde756,JSON['stringify'](_0x362b7e));_0x3a08d3(_0x362b7e);})[_0x1fdf('0x15')](function(_0x136142){logger[_0x1fdf('0x10')]('GetCmHopperBlack',_0x136142[_0x1fdf('0x13')],_0xcde756);_0x219000(_0x5711a6[_0x1fdf('0x10')](0x1f4,_0x136142['message']));});});};exports[_0x1fdf('0x20')]=function(_0x1225ca){var _0x44d7c1=this;return new Promise(function(_0x1f5327,_0x5d28d2){return db[_0x1fdf('0x21')][_0x1fdf('0x22')](_0x1225ca['body'],{'raw':_0x1225ca[_0x1fdf('0x18')]?_0x1225ca[_0x1fdf('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1225ca['options']?_0x1225ca[_0x1fdf('0x18')][_0x1fdf('0x1a')]||null:null,'attributes':_0x1225ca[_0x1fdf('0x18')]?_0x1225ca[_0x1fdf('0x18')][_0x1fdf('0x1b')]||null:null,'limit':_0x1225ca[_0x1fdf('0x18')]?_0x1225ca[_0x1fdf('0x18')]['limit']||null:null})[_0x1fdf('0xb')](function(_0x58c36b){logger[_0x1fdf('0xc')](_0x1fdf('0x20'),_0x1225ca);logger[_0x1fdf('0xe')](_0x1fdf('0x20'),_0x1225ca,JSON['stringify'](_0x58c36b));_0x1f5327(_0x58c36b);})['catch'](function(_0x575ffe){logger[_0x1fdf('0x10')]('UpdateCmHopperBlack',_0x575ffe[_0x1fdf('0x13')],_0x1225ca);_0x5d28d2(_0x44d7c1[_0x1fdf('0x10')](0x1f4,_0x575ffe[_0x1fdf('0x13')]));});});};exports[_0x1fdf('0x23')]=function(_0xa89393){var _0x51d845=this;return new Promise(function(_0x2b933b,_0x56b9b9){return db[_0x1fdf('0x21')]['destroy']({'where':_0xa89393[_0x1fdf('0x18')]?_0xa89393[_0x1fdf('0x18')][_0x1fdf('0x1a')]||null:null})['then'](function(_0xdacad3){logger[_0x1fdf('0xc')]('DestroyCmHopperBlack',_0xa89393);logger[_0x1fdf('0xe')](_0x1fdf('0x23'),_0xa89393,JSON[_0x1fdf('0x24')](_0xdacad3));_0x2b933b(_0xdacad3);})[_0x1fdf('0x15')](function(_0x1a7213){logger[_0x1fdf('0x10')](_0x1fdf('0x23'),_0x1a7213['message'],_0xa89393);_0x56b9b9(_0x51d845['error'](0x1f4,_0x1a7213[_0x1fdf('0x13')]));});});};
\ No newline at end of file
+var _0xa4ef=['rpc','client','http','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','map','include','model','attributes','then','UpdateCmHopperBlack','update','body','limit','destroy','DestroyCmHopperBlack','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa4ef,0x190));var _0xfa4e=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa4ef[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xfa4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa4e('0x1'));var rs=require(_0xfa4e('0x2'));var fs=require('fs');var Redis=require(_0xfa4e('0x3'));var db=require(_0xfa4e('0x4'))['db'];var utils=require(_0xfa4e('0x5'));var logger=require(_0xfa4e('0x6'))(_0xfa4e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfa4e('0x8')][_0xfa4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x151ff1,_0x3e53b5,_0x1184af){return new BPromise(function(_0x2440b0,_0x4b806f){return client['request'](_0x151ff1,_0x1184af)['then'](function(_0x2d1372){logger['info'](_0xfa4e('0xa'),_0x3e53b5,_0xfa4e('0xb'));logger[_0xfa4e('0xc')](_0xfa4e('0xd'),_0x3e53b5,_0xfa4e('0xb'),JSON[_0xfa4e('0xe')](_0x2d1372));if(_0x2d1372[_0xfa4e('0xf')]){if(_0x2d1372['error']['code']===0x1f4){logger[_0xfa4e('0xf')]('CmHopperBlack,\x20%s,\x20%s',_0x3e53b5,_0x2d1372[_0xfa4e('0xf')][_0xfa4e('0x10')]);return _0x4b806f(_0x2d1372['error'][_0xfa4e('0x10')]);}logger['error'](_0xfa4e('0xa'),_0x3e53b5,_0x2d1372['error'][_0xfa4e('0x10')]);return _0x2440b0(_0x2d1372[_0xfa4e('0xf')]['message']);}else{logger[_0xfa4e('0x11')](_0xfa4e('0xa'),_0x3e53b5,'request\x20sent');_0x2440b0(_0x2d1372[_0xfa4e('0x12')][_0xfa4e('0x10')]);}})[_0xfa4e('0x13')](function(_0x2397b8){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x3e53b5,_0x2397b8);_0x4b806f(_0x2397b8);});});}exports[_0xfa4e('0x14')]=function(_0x6384c0){var _0x471b09=this;return new Promise(function(_0x382d84,_0x5a7b7c){return db[_0xfa4e('0x15')][_0xfa4e('0x16')]({'raw':_0x6384c0[_0xfa4e('0x17')]?_0x6384c0[_0xfa4e('0x17')][_0xfa4e('0x18')]===undefined?!![]:![]:!![],'where':_0x6384c0['options']?_0x6384c0['options'][_0xfa4e('0x19')]||null:null,'attributes':_0x6384c0[_0xfa4e('0x17')]?_0x6384c0['options']['attributes']||null:null,'limit':_0x6384c0[_0xfa4e('0x17')]?_0x6384c0[_0xfa4e('0x17')]['limit']||null:null,'include':_0x6384c0['options']?_0x6384c0['options']['include']?_[_0xfa4e('0x1a')](_0x6384c0[_0xfa4e('0x17')][_0xfa4e('0x1b')],function(_0x501733){return{'model':db[_0x501733[_0xfa4e('0x1c')]],'as':_0x501733['as'],'attributes':_0x501733[_0xfa4e('0x1d')],'include':_0x501733[_0xfa4e('0x1b')]?_[_0xfa4e('0x1a')](_0x501733[_0xfa4e('0x1b')],function(_0x10438e){return{'model':db[_0x10438e[_0xfa4e('0x1c')]],'as':_0x10438e['as'],'attributes':_0x10438e[_0xfa4e('0x1d')],'include':_0x10438e[_0xfa4e('0x1b')]?_[_0xfa4e('0x1a')](_0x10438e[_0xfa4e('0x1b')],function(_0x57b00b){return{'model':db[_0x57b00b[_0xfa4e('0x1c')]],'as':_0x57b00b['as'],'attributes':_0x57b00b[_0xfa4e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfa4e('0x1e')](function(_0x170cf8){logger[_0xfa4e('0x11')](_0xfa4e('0x14'),_0x6384c0);logger['debug'](_0xfa4e('0x14'),_0x6384c0,JSON[_0xfa4e('0xe')](_0x170cf8));_0x382d84(_0x170cf8);})['catch'](function(_0x23486e){logger[_0xfa4e('0xf')]('GetCmHopperBlack',_0x23486e[_0xfa4e('0x10')],_0x6384c0);_0x5a7b7c(_0x471b09[_0xfa4e('0xf')](0x1f4,_0x23486e[_0xfa4e('0x10')]));});});};exports[_0xfa4e('0x1f')]=function(_0x573bcc){var _0x31ace3=this;return new Promise(function(_0x33ddb2,_0x3db136){return db[_0xfa4e('0x15')][_0xfa4e('0x20')](_0x573bcc[_0xfa4e('0x21')],{'raw':_0x573bcc[_0xfa4e('0x17')]?_0x573bcc[_0xfa4e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x573bcc[_0xfa4e('0x17')]?_0x573bcc[_0xfa4e('0x17')][_0xfa4e('0x19')]||null:null,'attributes':_0x573bcc[_0xfa4e('0x17')]?_0x573bcc[_0xfa4e('0x17')][_0xfa4e('0x1d')]||null:null,'limit':_0x573bcc[_0xfa4e('0x17')]?_0x573bcc[_0xfa4e('0x17')][_0xfa4e('0x22')]||null:null})[_0xfa4e('0x1e')](function(_0xc0a29f){logger['info'](_0xfa4e('0x1f'),_0x573bcc);logger[_0xfa4e('0xc')](_0xfa4e('0x1f'),_0x573bcc,JSON['stringify'](_0xc0a29f));_0x33ddb2(_0xc0a29f);})[_0xfa4e('0x13')](function(_0x5c3fda){logger['error'](_0xfa4e('0x1f'),_0x5c3fda[_0xfa4e('0x10')],_0x573bcc);_0x3db136(_0x31ace3[_0xfa4e('0xf')](0x1f4,_0x5c3fda[_0xfa4e('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x5ec494){var _0x1a1800=this;return new Promise(function(_0x2f18f3,_0x43c050){return db[_0xfa4e('0x15')][_0xfa4e('0x23')]({'where':_0x5ec494[_0xfa4e('0x17')]?_0x5ec494[_0xfa4e('0x17')][_0xfa4e('0x19')]||null:null})[_0xfa4e('0x1e')](function(_0x178d70){logger[_0xfa4e('0x11')]('DestroyCmHopperBlack',_0x5ec494);logger[_0xfa4e('0xc')](_0xfa4e('0x24'),_0x5ec494,JSON['stringify'](_0x178d70));_0x2f18f3(_0x178d70);})[_0xfa4e('0x13')](function(_0x5e9329){logger[_0xfa4e('0xf')](_0xfa4e('0x24'),_0x5e9329['message'],_0x5ec494);_0x43c050(_0x1a1800['error'](0x1f4,_0x5e9329[_0xfa4e('0x10')]));});});};
\ No newline at end of file
index 4a70107..5490c7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x253358,_0x497f28){var _0x1487bf=function(_0x5a89d3){while(--_0x5a89d3){_0x253358['push'](_0x253358['shift']());}};_0x1487bf(++_0x497f28);}(_0x2a07,0x74));var _0x72a0=function(_0x1a151a,_0x44325f){_0x1a151a=_0x1a151a-0x0;var _0x3ce862=_0x2a07[_0x1a151a];return _0x3ce862;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var fs_extra=require(_0x72a0('0x5'));var auth=require(_0x72a0('0x6'));var interaction=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var controller=require(_0x72a0('0x9'));router[_0x72a0('0xa')]('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0xc')]);router[_0x72a0('0xa')](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0xe')]);router[_0x72a0('0xa')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x10')]);router['put'](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller['update']);router[_0x72a0('0x11')](_0x72a0('0xf'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);module[_0x72a0('0x13')]=router;
\ No newline at end of file
+var _0x81c6=['delete','util','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','/:id','update'];(function(_0x28250b,_0x1adcfd){var _0x3c2e96=function(_0x4961f4){while(--_0x4961f4){_0x28250b['push'](_0x28250b['shift']());}};_0x3c2e96(++_0x1adcfd);}(_0x81c6,0x1d5));var _0x681c=function(_0x4e1ecc,_0x4497cf){_0x4e1ecc=_0x4e1ecc-0x0;var _0x5d9775=_0x81c6[_0x4e1ecc];return _0x5d9775;};'use strict';var multer=require('multer');var util=require(_0x681c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x681c('0x1')]();var fs_extra=require(_0x681c('0x2'));var auth=require(_0x681c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x681c('0x4'));var controller=require(_0x681c('0x5'));router[_0x681c('0x6')]('/',auth[_0x681c('0x7')](),controller['index']);router[_0x681c('0x6')](_0x681c('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x681c('0x6')](_0x681c('0x9'),auth[_0x681c('0x7')](),controller['show']);router['put'](_0x681c('0x9'),auth['isAuthenticated'](),controller[_0x681c('0xa')]);router[_0x681c('0xb')](_0x681c('0x9'),auth[_0x681c('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index e205bb5..9249772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ce=['endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING'];(function(_0x2cb68e,_0x5c05f6){var _0x6ad908=function(_0x170c31){while(--_0x170c31){_0x2cb68e['push'](_0x2cb68e['shift']());}};_0x6ad908(++_0x5c05f6);}(_0x77ce,0x118));var _0xe77c=function(_0x492d04,_0x1d4574){_0x492d04=_0x492d04-0x0;var _0x57d954=_0x77ce[_0x492d04];return _0x57d954;};'use strict';var Sequelize=require(_0xe77c('0x0'));var moment=require(_0xe77c('0x1'));module[_0xe77c('0x2')]={'state':{'type':Sequelize[_0xe77c('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe77c('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe77c('0x5')]},'originatecalleridnum':{'type':Sequelize[_0xe77c('0x5')]},'originatecalleridname':{'type':Sequelize[_0xe77c('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe77c('0x4')]},'responsetime':{'type':Sequelize[_0xe77c('0x4')]},'answertime':{'type':Sequelize[_0xe77c('0x4')]},'droptime':{'type':Sequelize[_0xe77c('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xe77c('0x5')]},'campaigntype':{'type':Sequelize[_0xe77c('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xe77c('0x5')]},'disposition':{'type':Sequelize[_0xe77c('0x5')]},'secondDisposition':{'type':Sequelize[_0xe77c('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe77c('0x5')]},'dispositionat':{'type':Sequelize[_0xe77c('0x4')],'set':function(_0x9b8a39){var _0x1cdf14=this['getDataValue'](_0xe77c('0x6'));if(_0x1cdf14&&_0x9b8a39){this[_0xe77c('0x7')](_0xe77c('0x8'),moment(_0x9b8a39)[_0xe77c('0x9')](moment(_0x1cdf14),_0xe77c('0xa')));}return this['setDataValue'](_0xe77c('0xb'),_0x9b8a39);}},'amd':{'type':Sequelize[_0xe77c('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe77c('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe77c('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe77c('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe77c('0x4')]},'callback':{'type':Sequelize[_0xe77c('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe77c('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe77c('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe77c('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe77c('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe77c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf5fd=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE','INTEGER','setDataValue','followuptime'];(function(_0x48360c,_0x252e4b){var _0x1ecf4e=function(_0x4397b0){while(--_0x4397b0){_0x48360c['push'](_0x48360c['shift']());}};_0x1ecf4e(++_0x252e4b);}(_0xf5fd,0x9d));var _0xdf5f=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xf5fd[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0xdf5f('0x0'));var moment=require(_0xdf5f('0x1'));module[_0xdf5f('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xdf5f('0x3')]},'scheduledat':{'type':Sequelize[_0xdf5f('0x4')]},'countbusyretry':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdf5f('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xdf5f('0x3')]},'originatecalleridname':{'type':Sequelize[_0xdf5f('0x3')]},'calleridnum':{'type':Sequelize[_0xdf5f('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xdf5f('0x4')]},'responsetime':{'type':Sequelize[_0xdf5f('0x4')]},'answertime':{'type':Sequelize[_0xdf5f('0x4')]},'droptime':{'type':Sequelize[_0xdf5f('0x4')]},'endtime':{'type':Sequelize[_0xdf5f('0x4')]},'ringtime':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdf5f('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xdf5f('0x3')]},'membername':{'type':Sequelize[_0xdf5f('0x3')]},'reason':{'type':Sequelize[_0xdf5f('0x3')]},'disposition':{'type':Sequelize[_0xdf5f('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdf5f('0x3')]},'dispositionat':{'type':Sequelize[_0xdf5f('0x4')],'set':function(_0x4d7927){var _0x1251fa=this['getDataValue']('endtime');if(_0x1251fa&&_0x4d7927){this[_0xdf5f('0x6')](_0xdf5f('0x7'),moment(_0x4d7927)['diff'](moment(_0x1251fa),_0xdf5f('0x8')));}return this[_0xdf5f('0x6')](_0xdf5f('0x9'),_0x4d7927);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdf5f('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdf5f('0x4')]},'callback':{'type':Sequelize[_0xdf5f('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdf5f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdf5f('0x4')]},'deleted':{'type':Sequelize[_0xdf5f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdf5f('0x4')]},'recallme':{'type':Sequelize[_0xdf5f('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xdf5f('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdf5f('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index f942550..aaf62e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','state\x20=\x204','moveContactsIvrCampaignHopperFinal','into','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','group','checkContactHopper','findOne','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','describe','update','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','answeringMachine','countContactsIvrCampaignHopperFinal','congestionContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','phone','NOW()'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0x5d17,0x114));var _0x75d1=function(_0x465351,_0x115a2c){_0x465351=_0x465351-0x0;var _0x19f941=_0x5d17[_0x465351];return _0x19f941;};'use strict';var emlformat=require(_0x75d1('0x0'));var rimraf=require(_0x75d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x75d1('0x2'));var moment=require(_0x75d1('0x3'));var BPromise=require(_0x75d1('0x4'));var Mustache=require('mustache');var util=require(_0x75d1('0x5'));var path=require(_0x75d1('0x6'));var sox=require(_0x75d1('0x7'));var csv=require(_0x75d1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75d1('0x9'));var _=require(_0x75d1('0xa'));var squel=require(_0x75d1('0xb'));var crypto=require(_0x75d1('0xc'));var jsforce=require(_0x75d1('0xd'));var deskjs=require(_0x75d1('0xe'));var toCsv=require(_0x75d1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x75d1('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75d1('0x10'));var hardwareService=require(_0x75d1('0x11'));var logger=require('../../config/logger')(_0x75d1('0x12'));var utils=require(_0x75d1('0x13'));var config=require(_0x75d1('0x14'));var licenseUtil=require(_0x75d1('0x15'));var db=require(_0x75d1('0x16'))['db'];function respondWithStatusCode(_0xd089cf,_0x49667a){_0x49667a=_0x49667a||0xcc;return function(_0x19e825){if(_0x19e825){return _0xd089cf[_0x75d1('0x17')](_0x49667a);}return _0xd089cf[_0x75d1('0x18')](_0x49667a)[_0x75d1('0x19')]();};}function respondWithResult(_0x49d723,_0x553697){_0x553697=_0x553697||0xc8;return function(_0x55b8a0){if(_0x55b8a0){return _0x49d723[_0x75d1('0x18')](_0x553697)[_0x75d1('0x1a')](_0x55b8a0);}};}function respondWithFilteredResult(_0x2fd022,_0x52e649){return function(_0x1f9620){if(_0x1f9620){var _0x3fff9b=typeof _0x52e649[_0x75d1('0x1b')]===_0x75d1('0x1c')&&typeof _0x52e649[_0x75d1('0x1d')]===_0x75d1('0x1c');var _0x2845bc=_0x1f9620[_0x75d1('0x1e')];var _0x1bc5de=_0x3fff9b?0x0:_0x52e649[_0x75d1('0x1b')];var _0x2c2a6d=_0x3fff9b?_0x1f9620['count']:_0x52e649['offset']+_0x52e649[_0x75d1('0x1d')];var _0x42b7ac;if(_0x2c2a6d>=_0x2845bc){_0x2c2a6d=_0x2845bc;_0x42b7ac=0xc8;}else{_0x42b7ac=0xce;}_0x2fd022['status'](_0x42b7ac);return _0x2fd022[_0x75d1('0x1f')](_0x75d1('0x20'),_0x1bc5de+'-'+_0x2c2a6d+'/'+_0x2845bc)[_0x75d1('0x1a')](_0x1f9620);}return null;};}function patchUpdates(_0xf6cc70){return function(_0xa42dbe){try{jsonpatch[_0x75d1('0x21')](_0xa42dbe,_0xf6cc70,!![]);}catch(_0x51d3b0){return BPromise[_0x75d1('0x22')](_0x51d3b0);}return _0xa42dbe[_0x75d1('0x23')]();};}function saveUpdates(_0x501cc7,_0x1cb58c){return function(_0x641ea4){if(_0x641ea4){return _0x641ea4['update'](_0x501cc7)[_0x75d1('0x24')](function(_0x5e70ec){return _0x5e70ec;});}return null;};}function removeEntity(_0x3a85c0,_0xc256af){return function(_0x345cf5){if(_0x345cf5){return _0x345cf5['destroy']()['then'](function(){_0x3a85c0[_0x75d1('0x18')](0xcc)[_0x75d1('0x19')]();});}};}function handleEntityNotFound(_0x315ce5,_0x18184b){return function(_0x51d043){if(!_0x51d043){_0x315ce5[_0x75d1('0x17')](0x194);}return _0x51d043;};}function handleError(_0x2b5848,_0x367238){_0x367238=_0x367238||0x1f4;return function(_0x51138e){logger['error'](_0x51138e['stack']);if(_0x51138e[_0x75d1('0x25')]){delete _0x51138e[_0x75d1('0x25')];}_0x2b5848[_0x75d1('0x18')](_0x367238)[_0x75d1('0x26')](_0x51138e);};}exports[_0x75d1('0x27')]=function(_0x519ceb,_0x4d292e){var _0x410e16={},_0x197f52={},_0x4967b5={'count':0x0,'rows':[]};var _0x2408b6=_['map'](db[_0x75d1('0x28')][_0x75d1('0x29')],function(_0x91e7c9){return{'name':_0x91e7c9[_0x75d1('0x2a')],'type':_0x91e7c9[_0x75d1('0x2b')]['key']};});_0x197f52[_0x75d1('0x2c')]=_[_0x75d1('0x2d')](_0x2408b6,_0x75d1('0x25'));_0x197f52[_0x75d1('0x2e')]=_['keys'](_0x519ceb[_0x75d1('0x2e')]);_0x197f52['filters']=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],_0x197f52['query']);_0x410e16[_0x75d1('0x30')]=_[_0x75d1('0x2f')](_0x197f52[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x519ceb[_0x75d1('0x2e')]['fields']));_0x410e16[_0x75d1('0x30')]=_0x410e16[_0x75d1('0x30')][_0x75d1('0x32')]?_0x410e16[_0x75d1('0x30')]:_0x197f52['model'];if(!_0x519ceb['query']['hasOwnProperty'](_0x75d1('0x33'))){_0x410e16[_0x75d1('0x1d')]=qs[_0x75d1('0x1d')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1d')]);_0x410e16[_0x75d1('0x1b')]=qs[_0x75d1('0x1b')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x1b')]);}_0x410e16['order']=qs[_0x75d1('0x34')](_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x34')]);_0x410e16[_0x75d1('0x35')]=qs[_0x75d1('0x36')](_['pick'](_0x519ceb['query'],_0x197f52['filters']),_0x2408b6);if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x37')]){_0x410e16[_0x75d1('0x35')]=_[_0x75d1('0x38')](_0x410e16[_0x75d1('0x35')],{'$or':_[_0x75d1('0x2d')](_0x2408b6,function(_0x48f9f3){if(_0x48f9f3['type']!=='VIRTUAL'){var _0x3f2569={};_0x3f2569[_0x48f9f3['name']]={'$like':'%'+_0x519ceb['query'][_0x75d1('0x37')]+'%'};return _0x3f2569;}})});}_0x410e16=_[_0x75d1('0x38')]({},_0x410e16,_0x519ceb[_0x75d1('0x39')]);var _0x46854c={'where':_0x410e16['where']};return db[_0x75d1('0x28')][_0x75d1('0x1e')](_0x46854c)[_0x75d1('0x24')](function(_0x3d4137){_0x4967b5[_0x75d1('0x1e')]=_0x3d4137;if(_0x519ceb[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x410e16[_0x75d1('0x3b')]=[{'all':!![]}];}return db[_0x75d1('0x28')][_0x75d1('0x3c')](_0x410e16);})[_0x75d1('0x24')](function(_0x93922f){_0x4967b5[_0x75d1('0x3d')]=_0x93922f;return _0x4967b5;})[_0x75d1('0x24')](respondWithFilteredResult(_0x4d292e,_0x410e16))[_0x75d1('0x3e')](handleError(_0x4d292e,null));};exports[_0x75d1('0x3f')]=function(_0x25f689,_0x2ad3ef){var _0x42c18c={'raw':!![],'where':{'id':_0x25f689[_0x75d1('0x40')]['id']}},_0x2384aa={};_0x2384aa[_0x75d1('0x2c')]=_['keys'](db['CmHopperFinal'][_0x75d1('0x29')]);_0x2384aa[_0x75d1('0x2e')]=_[_0x75d1('0x41')](_0x25f689[_0x75d1('0x2e')]);_0x2384aa['filters']=_[_0x75d1('0x2f')](_0x2384aa[_0x75d1('0x2c')],_0x2384aa[_0x75d1('0x2e')]);_0x42c18c[_0x75d1('0x30')]=_['intersection'](_0x2384aa[_0x75d1('0x2c')],qs[_0x75d1('0x31')](_0x25f689[_0x75d1('0x2e')][_0x75d1('0x31')]));_0x42c18c['attributes']=_0x42c18c[_0x75d1('0x30')]['length']?_0x42c18c[_0x75d1('0x30')]:_0x2384aa[_0x75d1('0x2c')];if(_0x25f689[_0x75d1('0x2e')][_0x75d1('0x3a')]){_0x42c18c[_0x75d1('0x3b')]=[{'all':!![]}];}_0x42c18c=_[_0x75d1('0x38')]({},_0x42c18c,_0x25f689['options']);return db[_0x75d1('0x28')]['find'](_0x42c18c)['then'](handleEntityNotFound(_0x2ad3ef,null))[_0x75d1('0x24')](respondWithResult(_0x2ad3ef,null))[_0x75d1('0x3e')](handleError(_0x2ad3ef,null));};exports[_0x75d1('0x42')]=function(_0x12bd67,_0x16f744){return db[_0x75d1('0x28')][_0x75d1('0x42')]()['then'](respondWithResult(_0x16f744,null))['catch'](handleError(_0x16f744,null));};exports[_0x75d1('0x43')]=function(_0x8ce3d2,_0x50def3){if(_0x8ce3d2[_0x75d1('0x44')][_0x75d1('0x45')]){delete _0x8ce3d2[_0x75d1('0x44')]['uniqueid'];}return db[_0x75d1('0x28')][_0x75d1('0x46')]({'where':{'uniqueid':_0x8ce3d2[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x50def3,null))[_0x75d1('0x24')](saveUpdates(_0x8ce3d2[_0x75d1('0x44')],null))[_0x75d1('0x24')](respondWithResult(_0x50def3,null))['catch'](handleError(_0x50def3,null));};exports[_0x75d1('0x47')]=function(_0x382195,_0x16b3c0,_0x395e0b){return db[_0x75d1('0x28')][_0x75d1('0x3c')]({'raw':![],'where':{'VoiceQueueId':_0x382195[_0x75d1('0x40')]['id']},'attributes':[[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')]['literal'](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x51')))),'congestionContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),_0x75d1('0x55')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),_0x75d1('0x57')],[db['sequelize']['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})['then'](handleEntityNotFound(_0x16b3c0,null))[_0x75d1('0x24')](respondWithResult(_0x16b3c0,null))[_0x75d1('0x3e')](handleError(_0x16b3c0,null));};exports[_0x75d1('0x59')]=function(_0x16cc70,_0x5d2219,_0x22ce12){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x16cc70[_0x75d1('0x40')]['id']},'attributes':[[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize']['literal'](_0x75d1('0x4a')))),_0x75d1('0x4b')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x4c')))),_0x75d1('0x4d')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x4f')))),_0x75d1('0x50')],[db[_0x75d1('0x49')]['fn']('COUNT',db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x51')))),_0x75d1('0x5a')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x52')))),_0x75d1('0x53')],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0x75d1('0x4e')](_0x75d1('0x54')))),'abandonedContacts'],[db[_0x75d1('0x49')]['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db[_0x75d1('0x49')][_0x75d1('0x4e')](_0x75d1('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x75d1('0x48'),db[_0x75d1('0x49')]['fn']('IF',db['sequelize'][_0x75d1('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x75d1('0x58')]]})[_0x75d1('0x24')](handleEntityNotFound(_0x5d2219,null))[_0x75d1('0x24')](respondWithResult(_0x5d2219,null))['catch'](handleError(_0x5d2219,null));};exports[_0x75d1('0x5b')]=function(_0x1f9ac2,_0x290587,_0x1baaca){return db[_0x75d1('0x5c')]['find']({'where':{'id':_0x1f9ac2['params']['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x290587,null))['then'](function(_0x3f15f3){var _0xf29a9f;if(_0x3f15f3){_0xf29a9f=squel[_0x75d1('0x5d')]()['into']('cm_hopper')[_0x75d1('0x5e')](['phone',_0x75d1('0x5f'),_0x75d1('0x60'),_0x75d1('0x61'),'VoiceQueueId',_0x75d1('0x62'),_0x75d1('0x63')],squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x66'),_0x75d1('0x67'))[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')](_0x75d1('0x69'),_0x75d1('0x60'))[_0x75d1('0x65')](_0x75d1('0x6a'),'ListId')['field'](_0x75d1('0x6b'),_0x75d1('0x6c'))['field'](_0x75d1('0x68'),'createdAt')['field']('NOW()',_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2['params']['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x1f9ac2[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()['field']('phone')['from'](_0x75d1('0x74'))[_0x75d1('0x35')](_0x75d1('0x6f'),_0x1f9ac2[_0x75d1('0x40')]['id'][_0x75d1('0x70')]()))[_0x75d1('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x75d1('0x64')]()[_0x75d1('0x65')]('calleridnum')[_0x75d1('0x6d')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x1f9ac2[_0x75d1('0x40')]['id']['toString']())['where'](_0x75d1('0x75')))['group'](_0x75d1('0x60')))[_0x75d1('0x70')]();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0xf29a9f);}return[];})[_0x75d1('0x24')](respondWithResult(_0x290587,null))[_0x75d1('0x3e')](handleError(_0x290587,null));};exports[_0x75d1('0x76')]=function(_0x217347,_0x51b682,_0x195a0a){return db['Campaign'][_0x75d1('0x46')]({'where':{'id':_0x217347[_0x75d1('0x40')]['id']}})[_0x75d1('0x24')](handleEntityNotFound(_0x51b682,null))['then'](function(_0x10bc92){var _0x150735;if(_0x10bc92){_0x150735=squel[_0x75d1('0x5d')]()[_0x75d1('0x77')](_0x75d1('0x74'))[_0x75d1('0x5e')]([_0x75d1('0x67'),'scheduledAt',_0x75d1('0x60'),_0x75d1('0x61'),_0x75d1('0x78'),_0x75d1('0x62'),_0x75d1('0x63')],squel['select']()['field'](_0x75d1('0x66'),'phone')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x5f'))[_0x75d1('0x65')]('ANY_VALUE(ContactId)','ContactId')[_0x75d1('0x65')](_0x75d1('0x6a'),_0x75d1('0x61'))[_0x75d1('0x65')](_0x75d1('0x79'),'CampaignId')[_0x75d1('0x65')](_0x75d1('0x68'),'createdAt')[_0x75d1('0x65')](_0x75d1('0x68'),_0x75d1('0x63'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')]('CampaignId\x20=\x20?',_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')](_0x75d1('0x71'),_0x217347[_0x75d1('0x44')][_0x75d1('0x72')]['toString']())[_0x75d1('0x35')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x75d1('0x35')](_0x75d1('0x73'),squel[_0x75d1('0x64')]()[_0x75d1('0x65')](_0x75d1('0x67'))[_0x75d1('0x6d')]('cm_hopper')[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id']['toString']()))[_0x75d1('0x35')](_0x75d1('0x73'),squel['select']()[_0x75d1('0x65')](_0x75d1('0x7b'))[_0x75d1('0x6d')](_0x75d1('0x6e'))[_0x75d1('0x35')](_0x75d1('0x7a'),_0x217347[_0x75d1('0x40')]['id'][_0x75d1('0x70')]())[_0x75d1('0x35')]('state\x20=\x204'))[_0x75d1('0x7c')](_0x75d1('0x60')))['toString']();return db[_0x75d1('0x49')][_0x75d1('0x2e')](_0x150735);}return[];})['then'](respondWithResult(_0x51b682,null))['catch'](handleError(_0x51b682,null));};exports[_0x75d1('0x7d')]=function(_0x44a017,_0x4d8e5d,_0x1f3a7e){return db['CmHopper'][_0x75d1('0x7e')]({'where':{'VoiceQueueId':_0x44a017['body'][_0x75d1('0x6c')],'CampaignId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x78')],'ContactId':_0x44a017[_0x75d1('0x44')][_0x75d1('0x60')]}})[_0x75d1('0x24')](handleEntityNotFound(_0x4d8e5d,null))[_0x75d1('0x24')](function(_0x205e82){if(_0x205e82){return _0x205e82;}return null;})[_0x75d1('0x24')](respondWithResult(_0x4d8e5d,null))[_0x75d1('0x3e')](handleError(_0x4d8e5d,null));};
\ No newline at end of file
+var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x4f1ee6,_0x3a0ac1){var _0x331ef3=function(_0x2ca0dd){while(--_0x2ca0dd){_0x4f1ee6['push'](_0x4f1ee6['shift']());}};_0x331ef3(++_0x3a0ac1);}(_0x781d,0x14a));var _0xd781=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x781d[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));};
\ No newline at end of file
index efe11c6..a3db09e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91da=['cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','moment','request-promise','rimraf','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x91da,0x161));var _0xa91d=function(_0x48e0ff,_0x3a8676){_0x48e0ff=_0x48e0ff-0x0;var _0x322c42=_0x91da[_0x48e0ff];return _0x322c42;};'use strict';var _=require('lodash');var util=require(_0xa91d('0x0'));var logger=require(_0xa91d('0x1'))('api');var moment=require(_0xa91d('0x2'));var BPromise=require('bluebird');var rp=require(_0xa91d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa91d('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xa91d('0x5')]=function(_0x239637,_0x21db32){return _0x239637[_0xa91d('0x6')]('CmHopperFinal',attributes,{'tableName':_0xa91d('0x7'),'paranoid':![],'indexes':[{'name':_0xa91d('0x8'),'fields':[_0xa91d('0x8')]},{'name':_0xa91d('0x9'),'fields':[_0xa91d('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x590f=['cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmHopperFinal'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x590f,0x1ed));var _0xf590=function(_0x430c1d,_0x347b74){_0x430c1d=_0x430c1d-0x0;var _0xe7f819=_0x590f[_0x430c1d];return _0xe7f819;};'use strict';var _=require(_0xf590('0x0'));var util=require(_0xf590('0x1'));var logger=require('../../config/logger')(_0xf590('0x2'));var moment=require(_0xf590('0x3'));var BPromise=require(_0xf590('0x4'));var rp=require(_0xf590('0x5'));var fs=require('fs');var path=require(_0xf590('0x6'));var rimraf=require(_0xf590('0x7'));var config=require(_0xf590('0x8'));var attributes=require('./cmHopperFinal.attributes');module[_0xf590('0x9')]=function(_0x1902f6,_0x1bdef6){return _0x1902f6['define'](_0xf590('0xa'),attributes,{'tableName':_0xf590('0xb'),'paranoid':![],'indexes':[{'name':_0xf590('0xc'),'fields':[_0xf590('0xc')]},{'name':_0xf590('0xd'),'fields':[_0xf590('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 6a43cdd..cc5ab57 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(_0x652c98,_0x5d5e1e){var _0x3a2753=function(_0x29c01f){while(--_0x29c01f){_0x652c98['push'](_0x652c98['shift']());}};_0x3a2753(++_0x5d5e1e);}(_0xb10b,0x12a));var _0xbb10=function(_0x1be1f6,_0x5e7089){_0x1be1f6=_0x1be1f6-0x0;var _0x2bd577=_0xb10b[_0x1be1f6];return _0x2bd577;};'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(_0x25f8e5,_0x46bf8a){var _0x5885f5=function(_0x53dcd8){while(--_0x53dcd8){_0x25f8e5['push'](_0x25f8e5['shift']());}};_0x5885f5(++_0x46bf8a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5dcbf0,_0x101d9d){_0x5dcbf0=_0x5dcbf0-0x0;var _0xcf87aa=_0xb10b[_0x5dcbf0];return _0xcf87aa;};'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 77d9728..8299550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f40=['../../components/interaction/service','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','checkContactHopper','update','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x25523d,_0x14b1a1){var _0x442f91=function(_0x3c1188){while(--_0x3c1188){_0x25523d['push'](_0x25523d['shift']());}};_0x442f91(++_0x14b1a1);}(_0x9f40,0x9b));var _0x09f4=function(_0x35ca57,_0x444f3a){_0x35ca57=_0x35ca57-0x0;var _0x204381=_0x9f40[_0x35ca57];return _0x204381;};'use strict';var multer=require('multer');var util=require(_0x09f4('0x0'));var path=require('path');var timeout=require(_0x09f4('0x1'));var express=require(_0x09f4('0x2'));var router=express[_0x09f4('0x3')]();var fs_extra=require(_0x09f4('0x4'));var auth=require(_0x09f4('0x5'));var interaction=require(_0x09f4('0x6'));var config=require('../../config/environment');var controller=require(_0x09f4('0x7'));router[_0x09f4('0x8')]('/',auth[_0x09f4('0x9')](),controller[_0x09f4('0xa')]);router[_0x09f4('0x8')](_0x09f4('0xb'),auth[_0x09f4('0x9')](),controller[_0x09f4('0xc')]);router[_0x09f4('0x8')](_0x09f4('0xd'),auth[_0x09f4('0x9')](),controller[_0x09f4('0xe')]);router[_0x09f4('0x8')]('/voice/queue/countAttributes/:id',auth[_0x09f4('0x9')](),controller[_0x09f4('0xf')]);router['get']('/campaign/countAttributes/:id',auth[_0x09f4('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x09f4('0x10'),auth['isAuthenticated'](),controller[_0x09f4('0x11')]);router['post'](_0x09f4('0x12'),auth[_0x09f4('0x9')](),controller[_0x09f4('0x13')]);router[_0x09f4('0x14')]('/checkContactHopper',auth[_0x09f4('0x9')](),controller[_0x09f4('0x15')]);router['put'](_0x09f4('0xd'),auth[_0x09f4('0x9')](),controller[_0x09f4('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x1abc=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer'];(function(_0x32dbd3,_0x2702c2){var _0x39fe0a=function(_0x24738c){while(--_0x24738c){_0x32dbd3['push'](_0x32dbd3['shift']());}};_0x39fe0a(++_0x2702c2);}(_0x1abc,0x107));var _0xc1ab=function(_0x3db791,_0xc96e9b){_0x3db791=_0x3db791-0x0;var _0x4d4eb0=_0x1abc[_0x3db791];return _0x4d4eb0;};'use strict';var multer=require(_0xc1ab('0x0'));var util=require(_0xc1ab('0x1'));var path=require(_0xc1ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xc1ab('0x3'));var router=express[_0xc1ab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc1ab('0x5'));var interaction=require(_0xc1ab('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0xc1ab('0x7')]('/',auth[_0xc1ab('0x8')](),controller[_0xc1ab('0x9')]);router[_0xc1ab('0x7')](_0xc1ab('0xa'),auth[_0xc1ab('0x8')](),controller[_0xc1ab('0xb')]);router[_0xc1ab('0x7')](_0xc1ab('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xc1ab('0x7')]('/voice/queue/countAttributes/:id',auth[_0xc1ab('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router['get'](_0xc1ab('0xd'),auth['isAuthenticated'](),controller[_0xc1ab('0xe')]);router[_0xc1ab('0xf')]('/voice/queue/moveContacts/:id',auth[_0xc1ab('0x8')](),controller[_0xc1ab('0x10')]);router[_0xc1ab('0xf')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc1ab('0xf')](_0xc1ab('0x11'),auth['isAuthenticated'](),controller[_0xc1ab('0x12')]);router[_0xc1ab('0x13')](_0xc1ab('0xc'),auth[_0xc1ab('0x8')](),controller[_0xc1ab('0x14')]);module[_0xc1ab('0x15')]=router;
\ No newline at end of file
index a386aa3..fa7c4c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c2f=['INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c2f,0x1f3));var _0xf1c2=function(_0x42a572,_0x580f6c){_0x42a572=_0x42a572-0x0;var _0x3dc541=_0x1c2f[_0x42a572];return _0x3dc541;};'use strict';var Sequelize=require(_0xf1c2('0x0'));module['exports']={'state':{'type':Sequelize[_0xf1c2('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xf1c2('0x2')]},'scheduledat':{'type':Sequelize[_0xf1c2('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf1c2('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xf1c2('0x2')]},'originatecalleridname':{'type':Sequelize[_0xf1c2('0x2')]},'calleridnum':{'type':Sequelize[_0xf1c2('0x2')]},'calleridname':{'type':Sequelize[_0xf1c2('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf1c2('0x3')]},'answertime':{'type':Sequelize[_0xf1c2('0x3')]},'droptime':{'type':Sequelize[_0xf1c2('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf1c2('0x2')]},'campaign':{'type':Sequelize[_0xf1c2('0x2')]},'campaigntype':{'type':Sequelize[_0xf1c2('0x2')]},'membername':{'type':Sequelize[_0xf1c2('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xf1c2('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf1c2('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xf1c2('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf1c2('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf1c2('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf1c2('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xafa2=['STRING','BOOLEAN','sequelize','exports','INTEGER','DATE'];(function(_0x20d874,_0x345eb4){var _0xd7fdd8=function(_0xe36ee1){while(--_0xe36ee1){_0x20d874['push'](_0x20d874['shift']());}};_0xd7fdd8(++_0x345eb4);}(_0xafa2,0xe6));var _0x2afa=function(_0x4dfe2b,_0x55cff9){_0x4dfe2b=_0x4dfe2b-0x0;var _0x45c04c=_0xafa2[_0x4dfe2b];return _0x45c04c;};'use strict';var Sequelize=require(_0x2afa('0x0'));module[_0x2afa('0x1')]={'state':{'type':Sequelize[_0x2afa('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x2afa('0x3')]},'countbusyretry':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x2afa('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x2afa('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2afa('0x4')]},'starttime':{'type':Sequelize[_0x2afa('0x3')]},'responsetime':{'type':Sequelize[_0x2afa('0x3')]},'answertime':{'type':Sequelize[_0x2afa('0x3')]},'droptime':{'type':Sequelize[_0x2afa('0x3')]},'endtime':{'type':Sequelize[_0x2afa('0x3')]},'ringtime':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2afa('0x4')]},'campaign':{'type':Sequelize[_0x2afa('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2afa('0x4')]},'reason':{'type':Sequelize[_0x2afa('0x4')]},'amd':{'type':Sequelize[_0x2afa('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x2afa('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x2afa('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2afa('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2afa('0x3')]},'recallme':{'type':Sequelize[_0x2afa('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2afa('0x3')]},'edited':{'type':Sequelize[_0x2afa('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2afa('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4093ccc..68b639c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa866=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','findAll','rows','show','params','keys','intersection','find','create','body','describe','catch','update','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x1c633e,_0x27493c){var _0x2a3fcf=function(_0x291288){while(--_0x291288){_0x1c633e['push'](_0x1c633e['shift']());}};_0x2a3fcf(++_0x27493c);}(_0xa866,0x8e));var _0x6a86=function(_0x2c7e3f,_0x47ba45){_0x2c7e3f=_0x2c7e3f-0x0;var _0x5d4bbd=_0xa866[_0x2c7e3f];return _0x5d4bbd;};'use strict';var emlformat=require(_0x6a86('0x0'));var rimraf=require(_0x6a86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6a86('0x2'));var rp=require(_0x6a86('0x3'));var moment=require(_0x6a86('0x4'));var BPromise=require(_0x6a86('0x5'));var Mustache=require(_0x6a86('0x6'));var util=require(_0x6a86('0x7'));var path=require(_0x6a86('0x8'));var sox=require(_0x6a86('0x9'));var csv=require(_0x6a86('0xa'));var ejs=require(_0x6a86('0xb'));var fs=require('fs');var fs_extra=require(_0x6a86('0xc'));var _=require(_0x6a86('0xd'));var squel=require(_0x6a86('0xe'));var crypto=require(_0x6a86('0xf'));var jsforce=require(_0x6a86('0x10'));var deskjs=require(_0x6a86('0x11'));var toCsv=require(_0x6a86('0xa'));var querystring=require(_0x6a86('0x12'));var Papa=require(_0x6a86('0x13'));var Redis=require(_0x6a86('0x14'));var authService=require(_0x6a86('0x15'));var qs=require(_0x6a86('0x16'));var as=require(_0x6a86('0x17'));var hardwareService=require(_0x6a86('0x18'));var logger=require(_0x6a86('0x19'))(_0x6a86('0x1a'));var utils=require('../../config/utils');var config=require(_0x6a86('0x1b'));var licenseUtil=require(_0x6a86('0x1c'));var db=require(_0x6a86('0x1d'))['db'];function respondWithStatusCode(_0xd2d0c5,_0x37e848){_0x37e848=_0x37e848||0xcc;return function(_0x5166d3){if(_0x5166d3){return _0xd2d0c5[_0x6a86('0x1e')](_0x37e848);}return _0xd2d0c5['status'](_0x37e848)['end']();};}function respondWithResult(_0x55e7ac,_0x12178f){_0x12178f=_0x12178f||0xc8;return function(_0x7d9120){if(_0x7d9120){return _0x55e7ac[_0x6a86('0x1f')](_0x12178f)[_0x6a86('0x20')](_0x7d9120);}};}function respondWithFilteredResult(_0x568695,_0x4dfac5){return function(_0x2278ad){if(_0x2278ad){var _0x57ff52=typeof _0x4dfac5[_0x6a86('0x21')]==='undefined'&&typeof _0x4dfac5[_0x6a86('0x22')]===_0x6a86('0x23');var _0x2bba4a=_0x2278ad[_0x6a86('0x24')];var _0x5d74a1=_0x57ff52?0x0:_0x4dfac5[_0x6a86('0x21')];var _0x1ba087=_0x57ff52?_0x2278ad[_0x6a86('0x24')]:_0x4dfac5['offset']+_0x4dfac5['limit'];var _0x1c6e86;if(_0x1ba087>=_0x2bba4a){_0x1ba087=_0x2bba4a;_0x1c6e86=0xc8;}else{_0x1c6e86=0xce;}_0x568695[_0x6a86('0x1f')](_0x1c6e86);return _0x568695[_0x6a86('0x25')](_0x6a86('0x26'),_0x5d74a1+'-'+_0x1ba087+'/'+_0x2bba4a)[_0x6a86('0x20')](_0x2278ad);}return null;};}function patchUpdates(_0x4d5fbb){return function(_0x11e793){try{jsonpatch[_0x6a86('0x27')](_0x11e793,_0x4d5fbb,!![]);}catch(_0x1a41d5){return BPromise[_0x6a86('0x28')](_0x1a41d5);}return _0x11e793['save']();};}function saveUpdates(_0x496483,_0x21b7b8){return function(_0xd89152){if(_0xd89152){return _0xd89152['update'](_0x496483)[_0x6a86('0x29')](function(_0x46b572){return _0x46b572;});}return null;};}function removeEntity(_0x498f30,_0x1980ff){return function(_0x41cba4){if(_0x41cba4){return _0x41cba4[_0x6a86('0x2a')]()[_0x6a86('0x29')](function(){_0x498f30['status'](0xcc)[_0x6a86('0x2b')]();});}};}function handleEntityNotFound(_0x2d2a3b,_0x522e89){return function(_0x449b8b){if(!_0x449b8b){_0x2d2a3b[_0x6a86('0x1e')](0x194);}return _0x449b8b;};}function handleError(_0x2e20e9,_0x3972b4){_0x3972b4=_0x3972b4||0x1f4;return function(_0x50d02d){logger[_0x6a86('0x2c')](_0x50d02d[_0x6a86('0x2d')]);if(_0x50d02d[_0x6a86('0x2e')]){delete _0x50d02d[_0x6a86('0x2e')];}_0x2e20e9[_0x6a86('0x1f')](_0x3972b4)[_0x6a86('0x2f')](_0x50d02d);};}exports[_0x6a86('0x30')]=function(_0x365476,_0x4f9466){var _0x50078e={},_0x25b948={},_0x4b66f4={'count':0x0,'rows':[]};var _0x7de529=_[_0x6a86('0x31')](db[_0x6a86('0x32')][_0x6a86('0x33')],function(_0x47e64e){return{'name':_0x47e64e['fieldName'],'type':_0x47e64e[_0x6a86('0x34')]['key']};});_0x25b948['model']=_[_0x6a86('0x31')](_0x7de529,'name');_0x25b948[_0x6a86('0x35')]=_['keys'](_0x365476[_0x6a86('0x35')]);_0x25b948[_0x6a86('0x36')]=_['intersection'](_0x25b948[_0x6a86('0x37')],_0x25b948[_0x6a86('0x35')]);_0x50078e[_0x6a86('0x38')]=_['intersection'](_0x25b948[_0x6a86('0x37')],qs[_0x6a86('0x39')](_0x365476['query'][_0x6a86('0x39')]));_0x50078e[_0x6a86('0x38')]=_0x50078e['attributes'][_0x6a86('0x3a')]?_0x50078e[_0x6a86('0x38')]:_0x25b948[_0x6a86('0x37')];if(!_0x365476[_0x6a86('0x35')][_0x6a86('0x3b')](_0x6a86('0x3c'))){_0x50078e[_0x6a86('0x22')]=qs[_0x6a86('0x22')](_0x365476[_0x6a86('0x35')][_0x6a86('0x22')]);_0x50078e[_0x6a86('0x21')]=qs[_0x6a86('0x21')](_0x365476['query'][_0x6a86('0x21')]);}_0x50078e[_0x6a86('0x3d')]=qs[_0x6a86('0x3e')](_0x365476[_0x6a86('0x35')]['sort']);_0x50078e[_0x6a86('0x3f')]=qs[_0x6a86('0x36')](_[_0x6a86('0x40')](_0x365476[_0x6a86('0x35')],_0x25b948[_0x6a86('0x36')]),_0x7de529);if(_0x365476[_0x6a86('0x35')]['filter']){_0x50078e['where']=_[_0x6a86('0x41')](_0x50078e['where'],{'$or':_[_0x6a86('0x31')](_0x7de529,function(_0x58cd2b){if(_0x58cd2b[_0x6a86('0x34')]!=='VIRTUAL'){var _0x28b05f={};_0x28b05f[_0x58cd2b[_0x6a86('0x2e')]]={'$like':'%'+_0x365476[_0x6a86('0x35')]['filter']+'%'};return _0x28b05f;}})});}_0x50078e=_[_0x6a86('0x41')]({},_0x50078e,_0x365476[_0x6a86('0x42')]);var _0x548e60={'where':_0x50078e[_0x6a86('0x3f')]};return db[_0x6a86('0x32')][_0x6a86('0x24')](_0x548e60)[_0x6a86('0x29')](function(_0x170847){_0x4b66f4[_0x6a86('0x24')]=_0x170847;if(_0x365476[_0x6a86('0x35')][_0x6a86('0x43')]){_0x50078e['include']=[{'all':!![]}];}return db[_0x6a86('0x32')][_0x6a86('0x44')](_0x50078e);})['then'](function(_0x4fbe21){_0x4b66f4[_0x6a86('0x45')]=_0x4fbe21;return _0x4b66f4;})[_0x6a86('0x29')](respondWithFilteredResult(_0x4f9466,_0x50078e))['catch'](handleError(_0x4f9466,null));};exports[_0x6a86('0x46')]=function(_0x27f511,_0x10edee){var _0x284fa9={'raw':!![],'where':{'id':_0x27f511[_0x6a86('0x47')]['id']}},_0x298696={};_0x298696['model']=_[_0x6a86('0x48')](db[_0x6a86('0x32')][_0x6a86('0x33')]);_0x298696[_0x6a86('0x35')]=_[_0x6a86('0x48')](_0x27f511[_0x6a86('0x35')]);_0x298696[_0x6a86('0x36')]=_[_0x6a86('0x49')](_0x298696[_0x6a86('0x37')],_0x298696[_0x6a86('0x35')]);_0x284fa9[_0x6a86('0x38')]=_[_0x6a86('0x49')](_0x298696[_0x6a86('0x37')],qs[_0x6a86('0x39')](_0x27f511['query'][_0x6a86('0x39')]));_0x284fa9[_0x6a86('0x38')]=_0x284fa9[_0x6a86('0x38')]['length']?_0x284fa9[_0x6a86('0x38')]:_0x298696[_0x6a86('0x37')];if(_0x27f511['query'][_0x6a86('0x43')]){_0x284fa9['include']=[{'all':!![]}];}_0x284fa9=_[_0x6a86('0x41')]({},_0x284fa9,_0x27f511[_0x6a86('0x42')]);return db[_0x6a86('0x32')][_0x6a86('0x4a')](_0x284fa9)['then'](handleEntityNotFound(_0x10edee,null))[_0x6a86('0x29')](respondWithResult(_0x10edee,null))['catch'](handleError(_0x10edee,null));};exports[_0x6a86('0x4b')]=function(_0x4b291a,_0x20917c){return db[_0x6a86('0x32')][_0x6a86('0x4b')](_0x4b291a[_0x6a86('0x4c')],{})[_0x6a86('0x29')](respondWithResult(_0x20917c,0xc9))['catch'](handleError(_0x20917c,null));};exports[_0x6a86('0x4d')]=function(_0x25e718,_0x23ab3d){return db[_0x6a86('0x32')][_0x6a86('0x4d')]()[_0x6a86('0x29')](respondWithResult(_0x23ab3d,null))[_0x6a86('0x4e')](handleError(_0x23ab3d,null));};exports[_0x6a86('0x4f')]=function(_0x54f27f,_0xd8e898){if(_0x54f27f['body'][_0x6a86('0x50')]){delete _0x54f27f[_0x6a86('0x4c')][_0x6a86('0x50')];}return db[_0x6a86('0x32')][_0x6a86('0x4a')]({'where':{'uniqueid':_0x54f27f['params']['id']}})[_0x6a86('0x29')](handleEntityNotFound(_0xd8e898,null))[_0x6a86('0x29')](saveUpdates(_0x54f27f['body'],null))[_0x6a86('0x29')](respondWithResult(_0xd8e898,null))[_0x6a86('0x4e')](handleError(_0xd8e898,null));};
\ No newline at end of file
+var _0xd284=['count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','CmHopperHistory','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','create','describe','uniqueid','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x11ee4e,_0x549084){var _0x433ed4=function(_0x415f3e){while(--_0x415f3e){_0x11ee4e['push'](_0x11ee4e['shift']());}};_0x433ed4(++_0x549084);}(_0xd284,0x156));var _0x4d28=function(_0x5ce33f,_0x28f690){_0x5ce33f=_0x5ce33f-0x0;var _0x581170=_0xd284[_0x5ce33f];return _0x581170;};'use strict';var emlformat=require(_0x4d28('0x0'));var rimraf=require(_0x4d28('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d28('0x2'));var rp=require(_0x4d28('0x3'));var moment=require(_0x4d28('0x4'));var BPromise=require(_0x4d28('0x5'));var Mustache=require(_0x4d28('0x6'));var util=require(_0x4d28('0x7'));var path=require('path');var sox=require(_0x4d28('0x8'));var csv=require('to-csv');var ejs=require(_0x4d28('0x9'));var fs=require('fs');var fs_extra=require(_0x4d28('0xa'));var _=require(_0x4d28('0xb'));var squel=require('squel');var crypto=require(_0x4d28('0xc'));var jsforce=require(_0x4d28('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4d28('0xe'));var querystring=require(_0x4d28('0xf'));var Papa=require(_0x4d28('0x10'));var Redis=require(_0x4d28('0x11'));var authService=require(_0x4d28('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4d28('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4d28('0x14'));var config=require(_0x4d28('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4d28('0x16'))['db'];function respondWithStatusCode(_0x438a71,_0x2f1860){_0x2f1860=_0x2f1860||0xcc;return function(_0x55485c){if(_0x55485c){return _0x438a71[_0x4d28('0x17')](_0x2f1860);}return _0x438a71[_0x4d28('0x18')](_0x2f1860)[_0x4d28('0x19')]();};}function respondWithResult(_0xcc9957,_0xfaf551){_0xfaf551=_0xfaf551||0xc8;return function(_0x434aa8){if(_0x434aa8){return _0xcc9957['status'](_0xfaf551)['json'](_0x434aa8);}};}function respondWithFilteredResult(_0x2f53e6,_0x46563e){return function(_0x26387a){if(_0x26387a){var _0x791fee=typeof _0x46563e[_0x4d28('0x1a')]===_0x4d28('0x1b')&&typeof _0x46563e['limit']===_0x4d28('0x1b');var _0xcb1b22=_0x26387a[_0x4d28('0x1c')];var _0x2a03c7=_0x791fee?0x0:_0x46563e[_0x4d28('0x1a')];var _0x540c27=_0x791fee?_0x26387a['count']:_0x46563e[_0x4d28('0x1a')]+_0x46563e['limit'];var _0x29914d;if(_0x540c27>=_0xcb1b22){_0x540c27=_0xcb1b22;_0x29914d=0xc8;}else{_0x29914d=0xce;}_0x2f53e6[_0x4d28('0x18')](_0x29914d);return _0x2f53e6['set'](_0x4d28('0x1d'),_0x2a03c7+'-'+_0x540c27+'/'+_0xcb1b22)[_0x4d28('0x1e')](_0x26387a);}return null;};}function patchUpdates(_0x109cb1){return function(_0x3e0bab){try{jsonpatch[_0x4d28('0x1f')](_0x3e0bab,_0x109cb1,!![]);}catch(_0x5e606e){return BPromise[_0x4d28('0x20')](_0x5e606e);}return _0x3e0bab[_0x4d28('0x21')]();};}function saveUpdates(_0x19b7f2,_0x2e6f29){return function(_0x47b469){if(_0x47b469){return _0x47b469[_0x4d28('0x22')](_0x19b7f2)[_0x4d28('0x23')](function(_0x489fbe){return _0x489fbe;});}return null;};}function removeEntity(_0x5c4d1e,_0x1f1f0a){return function(_0x256b86){if(_0x256b86){return _0x256b86[_0x4d28('0x24')]()['then'](function(){_0x5c4d1e[_0x4d28('0x18')](0xcc)[_0x4d28('0x19')]();});}};}function handleEntityNotFound(_0x5e1d11,_0x562c1d){return function(_0x2320f8){if(!_0x2320f8){_0x5e1d11[_0x4d28('0x17')](0x194);}return _0x2320f8;};}function handleError(_0x43ec37,_0x361281){_0x361281=_0x361281||0x1f4;return function(_0x43b19a){logger['error'](_0x43b19a['stack']);if(_0x43b19a[_0x4d28('0x25')]){delete _0x43b19a[_0x4d28('0x25')];}_0x43ec37[_0x4d28('0x18')](_0x361281)[_0x4d28('0x26')](_0x43b19a);};}exports[_0x4d28('0x27')]=function(_0x17fe24,_0x55f233){var _0x439792={},_0x243c97={},_0x3bb96f={'count':0x0,'rows':[]};var _0x32334c=_[_0x4d28('0x28')](db[_0x4d28('0x29')]['rawAttributes'],function(_0x2331d7){return{'name':_0x2331d7[_0x4d28('0x2a')],'type':_0x2331d7[_0x4d28('0x2b')]['key']};});_0x243c97[_0x4d28('0x2c')]=_['map'](_0x32334c,_0x4d28('0x25'));_0x243c97[_0x4d28('0x2d')]=_[_0x4d28('0x2e')](_0x17fe24[_0x4d28('0x2d')]);_0x243c97[_0x4d28('0x2f')]=_[_0x4d28('0x30')](_0x243c97[_0x4d28('0x2c')],_0x243c97['query']);_0x439792[_0x4d28('0x31')]=_['intersection'](_0x243c97['model'],qs[_0x4d28('0x32')](_0x17fe24[_0x4d28('0x2d')]['fields']));_0x439792[_0x4d28('0x31')]=_0x439792['attributes']['length']?_0x439792[_0x4d28('0x31')]:_0x243c97['model'];if(!_0x17fe24[_0x4d28('0x2d')][_0x4d28('0x33')](_0x4d28('0x34'))){_0x439792[_0x4d28('0x35')]=qs['limit'](_0x17fe24['query'][_0x4d28('0x35')]);_0x439792['offset']=qs[_0x4d28('0x1a')](_0x17fe24[_0x4d28('0x2d')][_0x4d28('0x1a')]);}_0x439792[_0x4d28('0x36')]=qs['sort'](_0x17fe24['query'][_0x4d28('0x37')]);_0x439792['where']=qs[_0x4d28('0x2f')](_[_0x4d28('0x38')](_0x17fe24[_0x4d28('0x2d')],_0x243c97['filters']),_0x32334c);if(_0x17fe24[_0x4d28('0x2d')][_0x4d28('0x39')]){_0x439792[_0x4d28('0x3a')]=_[_0x4d28('0x3b')](_0x439792[_0x4d28('0x3a')],{'$or':_[_0x4d28('0x28')](_0x32334c,function(_0x121868){if(_0x121868[_0x4d28('0x2b')]!==_0x4d28('0x3c')){var _0x59f13d={};_0x59f13d[_0x121868[_0x4d28('0x25')]]={'$like':'%'+_0x17fe24[_0x4d28('0x2d')][_0x4d28('0x39')]+'%'};return _0x59f13d;}})});}_0x439792=_[_0x4d28('0x3b')]({},_0x439792,_0x17fe24[_0x4d28('0x3d')]);var _0x32aa88={'where':_0x439792[_0x4d28('0x3a')]};return db[_0x4d28('0x29')][_0x4d28('0x1c')](_0x32aa88)[_0x4d28('0x23')](function(_0x3e2a62){_0x3bb96f['count']=_0x3e2a62;if(_0x17fe24['query'][_0x4d28('0x3e')]){_0x439792[_0x4d28('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x4d28('0x40')](_0x439792);})[_0x4d28('0x23')](function(_0x325b3f){_0x3bb96f[_0x4d28('0x41')]=_0x325b3f;return _0x3bb96f;})['then'](respondWithFilteredResult(_0x55f233,_0x439792))[_0x4d28('0x42')](handleError(_0x55f233,null));};exports['show']=function(_0x5079bf,_0x52799f){var _0x2a1c96={'raw':!![],'where':{'id':_0x5079bf[_0x4d28('0x43')]['id']}},_0x27dc8a={};_0x27dc8a['model']=_[_0x4d28('0x2e')](db['CmHopperHistory'][_0x4d28('0x44')]);_0x27dc8a[_0x4d28('0x2d')]=_[_0x4d28('0x2e')](_0x5079bf[_0x4d28('0x2d')]);_0x27dc8a[_0x4d28('0x2f')]=_[_0x4d28('0x30')](_0x27dc8a[_0x4d28('0x2c')],_0x27dc8a['query']);_0x2a1c96['attributes']=_[_0x4d28('0x30')](_0x27dc8a[_0x4d28('0x2c')],qs[_0x4d28('0x32')](_0x5079bf[_0x4d28('0x2d')]['fields']));_0x2a1c96[_0x4d28('0x31')]=_0x2a1c96[_0x4d28('0x31')][_0x4d28('0x45')]?_0x2a1c96[_0x4d28('0x31')]:_0x27dc8a['model'];if(_0x5079bf[_0x4d28('0x2d')][_0x4d28('0x3e')]){_0x2a1c96[_0x4d28('0x3f')]=[{'all':!![]}];}_0x2a1c96=_[_0x4d28('0x3b')]({},_0x2a1c96,_0x5079bf[_0x4d28('0x3d')]);return db[_0x4d28('0x29')]['find'](_0x2a1c96)[_0x4d28('0x23')](handleEntityNotFound(_0x52799f,null))[_0x4d28('0x23')](respondWithResult(_0x52799f,null))[_0x4d28('0x42')](handleError(_0x52799f,null));};exports[_0x4d28('0x46')]=function(_0x13a7a1,_0x3126f4){return db[_0x4d28('0x29')]['create'](_0x13a7a1['body'],{})[_0x4d28('0x23')](respondWithResult(_0x3126f4,0xc9))[_0x4d28('0x42')](handleError(_0x3126f4,null));};exports[_0x4d28('0x47')]=function(_0x52e586,_0x400de0){return db[_0x4d28('0x29')][_0x4d28('0x47')]()['then'](respondWithResult(_0x400de0,null))[_0x4d28('0x42')](handleError(_0x400de0,null));};exports[_0x4d28('0x22')]=function(_0xb39479,_0x1c3eeb){if(_0xb39479['body']['uniqueid']){delete _0xb39479['body'][_0x4d28('0x48')];}return db[_0x4d28('0x29')]['find']({'where':{'uniqueid':_0xb39479[_0x4d28('0x43')]['id']}})[_0x4d28('0x23')](handleEntityNotFound(_0x1c3eeb,null))[_0x4d28('0x23')](saveUpdates(_0xb39479[_0x4d28('0x49')],null))[_0x4d28('0x23')](respondWithResult(_0x1c3eeb,null))[_0x4d28('0x42')](handleError(_0x1c3eeb,null));};
\ No newline at end of file
index 946b3ca..dcb8639 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7382=['CmHopperHistory','endtime','uniqueid','util','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x36da68,_0x5622fd){var _0x4eb8ee=function(_0x4cc3b7){while(--_0x4cc3b7){_0x36da68['push'](_0x36da68['shift']());}};_0x4eb8ee(++_0x5622fd);}(_0x7382,0x111));var _0x2738=function(_0x1bacac,_0x39d59d){_0x1bacac=_0x1bacac-0x0;var _0x5793ab=_0x7382[_0x1bacac];return _0x5793ab;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2738('0x1'));var rimraf=require(_0x2738('0x2'));var config=require(_0x2738('0x3'));var attributes=require(_0x2738('0x4'));module[_0x2738('0x5')]=function(_0x5bb77c,_0x1958d2){return _0x5bb77c[_0x2738('0x6')](_0x2738('0x7'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x2738('0x8'),'fields':[_0x2738('0x8')]},{'name':_0x2738('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3f9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','cm_hopper_history','endtime','uniqueid','lodash','util','api'];(function(_0x4586c5,_0x15d104){var _0x2c9f52=function(_0xb667ed){while(--_0xb667ed){_0x4586c5['push'](_0x4586c5['shift']());}};_0x2c9f52(++_0x15d104);}(_0xf3f9,0x1de));var _0x9f3f=function(_0x329875,_0x60911f){_0x329875=_0x329875-0x0;var _0x117f85=_0xf3f9[_0x329875];return _0x117f85;};'use strict';var _=require(_0x9f3f('0x0'));var util=require(_0x9f3f('0x1'));var logger=require('../../config/logger')(_0x9f3f('0x2'));var moment=require(_0x9f3f('0x3'));var BPromise=require(_0x9f3f('0x4'));var rp=require(_0x9f3f('0x5'));var fs=require('fs');var path=require(_0x9f3f('0x6'));var rimraf=require(_0x9f3f('0x7'));var config=require(_0x9f3f('0x8'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0xc4516a,_0x566b08){return _0xc4516a[_0x9f3f('0x9')]('CmHopperHistory',attributes,{'tableName':_0x9f3f('0xa'),'paranoid':![],'indexes':[{'name':_0x9f3f('0xb'),'fields':[_0x9f3f('0xb')]},{'name':'uniqueid','fields':[_0x9f3f('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0972115..775f221 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32e3=['body','options','raw','info','catch','AvgHandleTime','findAll','where','COUNT','col','predictiveIntervalTotalCalls','sequelize','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','CreateCmHopperHistory','CmHopperHistory','create'];(function(_0x263d7d,_0x4fe765){var _0x510b6d=function(_0x5e2f98){while(--_0x5e2f98){_0x263d7d['push'](_0x263d7d['shift']());}};_0x510b6d(++_0x4fe765);}(_0x32e3,0x104));var _0x332e=function(_0x4cd41d,_0x105b86){_0x4cd41d=_0x4cd41d-0x0;var _0x48e136=_0x32e3[_0x4cd41d];return _0x48e136;};'use strict';var _=require('lodash');var util=require(_0x332e('0x0'));var moment=require(_0x332e('0x1'));var BPromise=require(_0x332e('0x2'));var rs=require(_0x332e('0x3'));var fs=require('fs');var Redis=require(_0x332e('0x4'));var db=require(_0x332e('0x5'))['db'];var utils=require(_0x332e('0x6'));var logger=require('../../config/logger')(_0x332e('0x7'));var config=require(_0x332e('0x8'));var jayson=require(_0x332e('0x9'));var client=jayson[_0x332e('0xa')][_0x332e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c1ee8,_0x2d4489,_0x575f38){return new BPromise(function(_0x25fa7d,_0x4a134a){return client[_0x332e('0xc')](_0x2c1ee8,_0x575f38)[_0x332e('0xd')](function(_0x33f3d9){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x2d4489,_0x332e('0xe'));logger[_0x332e('0xf')](_0x332e('0x10'),_0x2d4489,_0x332e('0xe'),JSON[_0x332e('0x11')](_0x33f3d9));if(_0x33f3d9[_0x332e('0x12')]){if(_0x33f3d9[_0x332e('0x12')]['code']===0x1f4){logger[_0x332e('0x12')](_0x332e('0x13'),_0x2d4489,_0x33f3d9['error']['message']);return _0x4a134a(_0x33f3d9['error'][_0x332e('0x14')]);}logger[_0x332e('0x12')](_0x332e('0x13'),_0x2d4489,_0x33f3d9[_0x332e('0x12')][_0x332e('0x14')]);return _0x25fa7d(_0x33f3d9[_0x332e('0x12')][_0x332e('0x14')]);}else{logger['info'](_0x332e('0x13'),_0x2d4489,'request\x20sent');_0x25fa7d(_0x33f3d9['result']['message']);}})['catch'](function(_0x6108e7){logger[_0x332e('0x12')](_0x332e('0x13'),_0x2d4489,_0x6108e7);_0x4a134a(_0x6108e7);});});}exports[_0x332e('0x15')]=function(_0x40cba8){var _0x3c8f4c=this;return new Promise(function(_0x1c953a,_0x35b8db){return db[_0x332e('0x16')][_0x332e('0x17')](_0x40cba8[_0x332e('0x18')],{'raw':_0x40cba8[_0x332e('0x19')]?_0x40cba8[_0x332e('0x19')][_0x332e('0x1a')]===undefined?!![]:![]:!![]})[_0x332e('0xd')](function(_0x44471d){logger[_0x332e('0x1b')](_0x332e('0x15'),_0x40cba8);logger['debug'](_0x332e('0x15'),_0x40cba8,JSON['stringify'](_0x44471d));_0x1c953a(_0x44471d);})[_0x332e('0x1c')](function(_0x397674){logger['error'](_0x332e('0x15'),_0x397674[_0x332e('0x14')],_0x40cba8);_0x35b8db(_0x3c8f4c[_0x332e('0x12')](0x1f4,_0x397674[_0x332e('0x14')]));});});};exports[_0x332e('0x1d')]=function(_0x4d6e41){var _0x3e4e2c=this;return new Promise(function(_0x4cd82f,_0x49e7a1){return db[_0x332e('0x16')][_0x332e('0x1e')]({'raw':_0x4d6e41['options']?_0x4d6e41[_0x332e('0x19')][_0x332e('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d6e41[_0x332e('0x19')]?_0x4d6e41[_0x332e('0x19')][_0x332e('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x332e('0x20'),db['sequelize'][_0x332e('0x21')]('id')),_0x332e('0x22')],[db['sequelize']['fn'](_0x332e('0x20'),db['sequelize']['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x25')))),_0x332e('0x26')],[db[_0x332e('0x23')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x332e('0x23')]['literal'](_0x332e('0x27')))),_0x332e('0x28')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x29')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x332e('0x23')]['fn'](_0x332e('0x2a'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x332e('0x2b')],[db[_0x332e('0x23')]['fn'](_0x332e('0x2a'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x2c')))),_0x332e('0x2d')]]})[_0x332e('0xd')](function(_0x97935e){logger[_0x332e('0x1b')](_0x332e('0x1d'),_0x4d6e41);logger[_0x332e('0xf')](_0x332e('0x1d'),_0x4d6e41,JSON[_0x332e('0x11')](_0x97935e));_0x4cd82f(_0x97935e);})[_0x332e('0x1c')](function(_0x4ae50c){logger['error'](_0x332e('0x1d'),_0x4ae50c['message'],_0x4d6e41);_0x49e7a1(_0x3e4e2c['error'](0x1f4,_0x4ae50c[_0x332e('0x14')]));});});};exports[_0x332e('0x2e')]=function(_0x4287a3){var _0x5d4d10=this;return new Promise(function(_0x2c5ee8,_0x5114e7){return db['CmHopperHistory'][_0x332e('0x1e')]({'raw':_0x4287a3['options']?_0x4287a3[_0x332e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4287a3['options']?_0x4287a3[_0x332e('0x19')][_0x332e('0x1f')]||null:null,'attributes':[[_0x332e('0x2f'),_0x332e('0x30')],[db[_0x332e('0x23')]['fn']('COUNT',db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x31')))),'outboundNoSuchCallsDay'],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')]['literal'](_0x332e('0x32')))),_0x332e('0x33')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db['sequelize']['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x25')))),'outboundAnswerCallsDay'],[db['sequelize']['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x332e('0x34')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x35')))),_0x332e('0x36')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db['sequelize']['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x332e('0x37')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db['sequelize']['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x38')))),_0x332e('0x39')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db['sequelize']['literal'](_0x332e('0x3a')))),_0x332e('0x3b')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db['sequelize'][_0x332e('0x24')](_0x332e('0x3c')))),_0x332e('0x3d')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db['sequelize'][_0x332e('0x24')](_0x332e('0x3e')))),_0x332e('0x3f')],[db['sequelize']['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')]['literal'](_0x332e('0x40')))),_0x332e('0x41')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')]('`state`\x20=\x2016,\x201,\x20null'))),_0x332e('0x42')],[db[_0x332e('0x23')]['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db['sequelize'][_0x332e('0x24')]('`state`\x20=\x2020,\x201,\x20null'))),_0x332e('0x41')],[db['sequelize']['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x332e('0x43')]],'group':[_0x332e('0x2f')]})[_0x332e('0xd')](function(_0x17a2a0){logger[_0x332e('0x1b')](_0x332e('0x2e'),_0x4287a3);logger['debug'](_0x332e('0x2e'),_0x4287a3,JSON[_0x332e('0x11')](_0x17a2a0));_0x2c5ee8(_0x17a2a0);})['catch'](function(_0x4721e6){logger[_0x332e('0x12')](_0x332e('0x2e'),_0x4721e6[_0x332e('0x14')],_0x4287a3);_0x5114e7(_0x5d4d10[_0x332e('0x12')](0x1f4,_0x4721e6[_0x332e('0x14')]));});});};exports[_0x332e('0x44')]=function(_0x51f85c){var _0x33076f=this;return new Promise(function(_0x2d278b,_0x3e3d2d){return db[_0x332e('0x16')]['findAll']({'raw':_0x51f85c[_0x332e('0x19')]?_0x51f85c[_0x332e('0x19')][_0x332e('0x1a')]===undefined?!![]:![]:!![],'where':_0x51f85c[_0x332e('0x19')]?_0x51f85c[_0x332e('0x19')]['where']||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0x332e('0x20'),db[_0x332e('0x23')][_0x332e('0x21')]('id')),_0x332e('0x45')],[db['sequelize']['fn'](_0x332e('0x20'),db[_0x332e('0x23')]['fn']('IF',db[_0x332e('0x23')][_0x332e('0x24')](_0x332e('0x25')))),_0x332e('0x46')]],'group':[_0x332e('0x2f')]})[_0x332e('0xd')](function(_0x120674){logger['info'](_0x332e('0x44'),_0x51f85c);logger[_0x332e('0xf')]('GetCampaignHopperHistory',_0x51f85c,JSON[_0x332e('0x11')](_0x120674));_0x2d278b(_0x120674);})[_0x332e('0x1c')](function(_0x3da0ea){logger[_0x332e('0x12')](_0x332e('0x44'),_0x3da0ea['message'],_0x51f85c);_0x3e3d2d(_0x33076f['error'](0x1f4,_0x3da0ea[_0x332e('0x14')]));});});};
\ No newline at end of file
+var _0x29c1=['literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','catch','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','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','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','create','body','options','raw','CmHopperHistory','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls'];(function(_0x146bff,_0x48fbc3){var _0x4fd8fb=function(_0x3da885){while(--_0x3da885){_0x146bff['push'](_0x146bff['shift']());}};_0x4fd8fb(++_0x48fbc3);}(_0x29c1,0x72));var _0x129c=function(_0x48486f,_0x38c610){_0x48486f=_0x48486f-0x0;var _0x488b16=_0x29c1[_0x48486f];return _0x488b16;};'use strict';var _=require('lodash');var util=require(_0x129c('0x0'));var moment=require(_0x129c('0x1'));var BPromise=require(_0x129c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x129c('0x3'));var db=require(_0x129c('0x4'))['db'];var utils=require(_0x129c('0x5'));var logger=require(_0x129c('0x6'))(_0x129c('0x7'));var config=require(_0x129c('0x8'));var jayson=require(_0x129c('0x9'));var client=jayson['client'][_0x129c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e146e,_0x327481,_0x203e50){return new BPromise(function(_0x4955f4,_0x303ad7){return client[_0x129c('0xb')](_0x1e146e,_0x203e50)[_0x129c('0xc')](function(_0x59d810){logger[_0x129c('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x327481,_0x129c('0xe'));logger[_0x129c('0xf')](_0x129c('0x10'),_0x327481,_0x129c('0xe'),JSON[_0x129c('0x11')](_0x59d810));if(_0x59d810[_0x129c('0x12')]){if(_0x59d810[_0x129c('0x12')][_0x129c('0x13')]===0x1f4){logger[_0x129c('0x12')](_0x129c('0x14'),_0x327481,_0x59d810[_0x129c('0x12')][_0x129c('0x15')]);return _0x303ad7(_0x59d810[_0x129c('0x12')][_0x129c('0x15')]);}logger[_0x129c('0x12')](_0x129c('0x14'),_0x327481,_0x59d810[_0x129c('0x12')]['message']);return _0x4955f4(_0x59d810[_0x129c('0x12')][_0x129c('0x15')]);}else{logger[_0x129c('0xd')](_0x129c('0x14'),_0x327481,_0x129c('0xe'));_0x4955f4(_0x59d810[_0x129c('0x16')][_0x129c('0x15')]);}})['catch'](function(_0x37c4e9){logger[_0x129c('0x12')](_0x129c('0x14'),_0x327481,_0x37c4e9);_0x303ad7(_0x37c4e9);});});}exports[_0x129c('0x17')]=function(_0x5dfb8e){var _0x3423f2=this;return new Promise(function(_0x22610e,_0x4a0836){return db['CmHopperHistory'][_0x129c('0x18')](_0x5dfb8e[_0x129c('0x19')],{'raw':_0x5dfb8e['options']?_0x5dfb8e[_0x129c('0x1a')][_0x129c('0x1b')]===undefined?!![]:![]:!![]})[_0x129c('0xc')](function(_0xafe3ad){logger[_0x129c('0xd')](_0x129c('0x17'),_0x5dfb8e);logger[_0x129c('0xf')](_0x129c('0x17'),_0x5dfb8e,JSON[_0x129c('0x11')](_0xafe3ad));_0x22610e(_0xafe3ad);})['catch'](function(_0x10ae7d){logger[_0x129c('0x12')](_0x129c('0x17'),_0x10ae7d[_0x129c('0x15')],_0x5dfb8e);_0x4a0836(_0x3423f2[_0x129c('0x12')](0x1f4,_0x10ae7d[_0x129c('0x15')]));});});};exports['AvgHandleTime']=function(_0x492771){var _0x3ef9e7=this;return new Promise(function(_0x3b3020,_0xff129c){return db[_0x129c('0x1c')][_0x129c('0x1d')]({'raw':_0x492771[_0x129c('0x1a')]?_0x492771['options'][_0x129c('0x1b')]===undefined?!![]:![]:!![],'where':_0x492771[_0x129c('0x1a')]?_0x492771[_0x129c('0x1a')]['where']||null:null,'attributes':[[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')][_0x129c('0x20')]('id')),_0x129c('0x21')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')]['literal'](_0x129c('0x22')))),_0x129c('0x23')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x129c('0x1e')]['fn']('AVG',db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x27')))),_0x129c('0x28')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x29'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x2a')))),_0x129c('0x2b')]]})['then'](function(_0x3ff148){logger[_0x129c('0xd')](_0x129c('0x2c'),_0x492771);logger[_0x129c('0xf')](_0x129c('0x2c'),_0x492771,JSON[_0x129c('0x11')](_0x3ff148));_0x3b3020(_0x3ff148);})['catch'](function(_0x44b3b4){logger[_0x129c('0x12')](_0x129c('0x2c'),_0x44b3b4['message'],_0x492771);_0xff129c(_0x3ef9e7[_0x129c('0x12')](0x1f4,_0x44b3b4[_0x129c('0x15')]));});});};exports[_0x129c('0x2d')]=function(_0x3e20bf){var _0x364af3=this;return new Promise(function(_0x47780b,_0x30920a){return db[_0x129c('0x1c')][_0x129c('0x1d')]({'raw':_0x3e20bf[_0x129c('0x1a')]?_0x3e20bf[_0x129c('0x1a')][_0x129c('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e20bf[_0x129c('0x1a')]?_0x3e20bf[_0x129c('0x1a')][_0x129c('0x2e')]||null:null,'attributes':[['campaign',_0x129c('0x2f')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db['sequelize']['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x30')))),'outboundNoSuchCallsDay'],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db['sequelize']['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x31')))),_0x129c('0x32')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x33')))),_0x129c('0x34')],[db['sequelize']['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')]['literal'](_0x129c('0x35')))),_0x129c('0x36')],[db['sequelize']['fn']('COUNT',db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x37')))),_0x129c('0x38')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x129c('0x39')))),_0x129c('0x3a')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db['sequelize']['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')]('`state`\x20=\x2012,\x201,\x20null'))),_0x129c('0x3b')],[db['sequelize']['fn'](_0x129c('0x1f'),db['sequelize']['fn']('IF',db[_0x129c('0x1e')]['literal'](_0x129c('0x3c')))),_0x129c('0x3d')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db['sequelize']['fn']('IF',db[_0x129c('0x1e')]['literal'](_0x129c('0x3e')))),_0x129c('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')]('`state`\x20=\x2018,\x201,\x20null'))),_0x129c('0x40')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x129c('0x24')](_0x129c('0x41')))),_0x129c('0x42')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x43')))),_0x129c('0x40')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db['sequelize'][_0x129c('0x24')](_0x129c('0x44')))),_0x129c('0x45')]],'group':[_0x129c('0x46')]})['then'](function(_0x2ea56d){logger[_0x129c('0xd')]('GetVoiceQueueHopperHistory',_0x3e20bf);logger['debug']('GetVoiceQueueHopperHistory',_0x3e20bf,JSON[_0x129c('0x11')](_0x2ea56d));_0x47780b(_0x2ea56d);})[_0x129c('0x47')](function(_0x4cc3f2){logger[_0x129c('0x12')]('GetVoiceQueueHopperHistory',_0x4cc3f2[_0x129c('0x15')],_0x3e20bf);_0x30920a(_0x364af3[_0x129c('0x12')](0x1f4,_0x4cc3f2[_0x129c('0x15')]));});});};exports[_0x129c('0x48')]=function(_0x78331b){var _0x413063=this;return new Promise(function(_0x75e6b8,_0x4c8cfd){return db[_0x129c('0x1c')][_0x129c('0x1d')]({'raw':_0x78331b[_0x129c('0x1a')]?_0x78331b[_0x129c('0x1a')][_0x129c('0x1b')]===undefined?!![]:![]:!![],'where':_0x78331b[_0x129c('0x1a')]?_0x78331b[_0x129c('0x1a')][_0x129c('0x2e')]||null:null,'attributes':[[_0x129c('0x46'),'name'],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')][_0x129c('0x20')]('id')),_0x129c('0x49')],[db[_0x129c('0x1e')]['fn'](_0x129c('0x1f'),db[_0x129c('0x1e')]['fn']('IF',db[_0x129c('0x1e')][_0x129c('0x24')](_0x129c('0x22')))),_0x129c('0x4a')]],'group':['campaign']})['then'](function(_0x3f60ae){logger[_0x129c('0xd')](_0x129c('0x48'),_0x78331b);logger[_0x129c('0xf')](_0x129c('0x48'),_0x78331b,JSON[_0x129c('0x11')](_0x3f60ae));_0x75e6b8(_0x3f60ae);})[_0x129c('0x47')](function(_0x3c51db){logger[_0x129c('0x12')](_0x129c('0x48'),_0x3c51db[_0x129c('0x15')],_0x78331b);_0x4c8cfd(_0x413063[_0x129c('0x12')](0x1f4,_0x3c51db[_0x129c('0x15')]));});});};
\ No newline at end of file
index d409bbd..c17c917 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa439=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','multer','util'];(function(_0x1b8fe6,_0x218bb9){var _0x569bc=function(_0x31a64a){while(--_0x31a64a){_0x1b8fe6['push'](_0x1b8fe6['shift']());}};_0x569bc(++_0x218bb9);}(_0xa439,0xfa));var _0x9a43=function(_0x5f4ed1,_0x4ee239){_0x5f4ed1=_0x5f4ed1-0x0;var _0xb898ca=_0xa439[_0x5f4ed1];return _0xb898ca;};'use strict';var multer=require(_0x9a43('0x0'));var util=require(_0x9a43('0x1'));var path=require(_0x9a43('0x2'));var timeout=require(_0x9a43('0x3'));var express=require(_0x9a43('0x4'));var router=express['Router']();var fs_extra=require(_0x9a43('0x5'));var auth=require(_0x9a43('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9a43('0x7'));var controller=require(_0x9a43('0x8'));router[_0x9a43('0x9')]('/',auth[_0x9a43('0xa')](),controller[_0x9a43('0xb')]);router[_0x9a43('0x9')](_0x9a43('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9a43('0x9')](_0x9a43('0xd'),auth[_0x9a43('0xa')](),controller[_0x9a43('0xe')]);router['post']('/',auth[_0x9a43('0xa')](),controller[_0x9a43('0xf')]);router[_0x9a43('0x10')](_0x9a43('0xd'),auth[_0x9a43('0xa')](),controller[_0x9a43('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x849f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4c2ea0,_0x40fe9e){var _0xcf8096=function(_0xebf35e){while(--_0xebf35e){_0x4c2ea0['push'](_0x4c2ea0['shift']());}};_0xcf8096(++_0x40fe9e);}(_0x849f,0x181));var _0xf849=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x849f[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xf849('0x0'));var util=require(_0xf849('0x1'));var path=require(_0xf849('0x2'));var timeout=require(_0xf849('0x3'));var express=require(_0xf849('0x4'));var router=express[_0xf849('0x5')]();var fs_extra=require(_0xf849('0x6'));var auth=require(_0xf849('0x7'));var interaction=require(_0xf849('0x8'));var config=require(_0xf849('0x9'));var controller=require(_0xf849('0xa'));router['get']('/',auth[_0xf849('0xb')](),controller[_0xf849('0xc')]);router['get'](_0xf849('0xd'),auth[_0xf849('0xb')](),controller[_0xf849('0xe')]);router[_0xf849('0xf')](_0xf849('0x10'),auth[_0xf849('0xb')](),controller[_0xf849('0x11')]);router[_0xf849('0x12')]('/',auth[_0xf849('0xb')](),controller[_0xf849('0x13')]);router[_0xf849('0x14')](_0xf849('0x10'),auth[_0xf849('0xb')](),controller[_0xf849('0x15')]);module[_0xf849('0x16')]=router;
\ No newline at end of file
index ecbde2a..693b028 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc17=['exports','name','STRING','sequelize'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x2c6810,_0x23c079){_0x2c6810=_0x2c6810-0x0;var _0x213881=_0xbc17[_0x2c6810];return _0x213881;};'use strict';var Sequelize=require(_0x7bc1('0x0'));module[_0x7bc1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7bc1('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7bc1('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6aa7=['name','sequelize','STRING'];(function(_0x118767,_0x1930e2){var _0x2cf1a8=function(_0x28fd15){while(--_0x28fd15){_0x118767['push'](_0x118767['shift']());}};_0x2cf1a8(++_0x1930e2);}(_0x6aa7,0x178));var _0x76aa=function(_0x20ab6c,_0x3390f6){_0x20ab6c=_0x20ab6c-0x0;var _0x31ae1d=_0x6aa7[_0x20ab6c];return _0x31ae1d;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}};
\ No newline at end of file
index a2efaca..6d60906 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x423d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','Lists','UserProfileResource','end','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','rows','catch','show','params','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','error','body','describe','ListId','Disposition','getDispositions','findOne','hasOwnProperty','filter','includeAll','removeDispositions','addContacts','CmContact','tags','isArray','join','push','ids','success','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Content-type','text/csv','/tmp/list_%d_%s.csv','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring'];(function(_0x48e72b,_0x5514cd){var _0x120ffe=function(_0x50d904){while(--_0x50d904){_0x48e72b['push'](_0x48e72b['shift']());}};_0x120ffe(++_0x5514cd);}(_0x423d,0x10c));var _0xd423=function(_0x40722d,_0x467184){_0x40722d=_0x40722d-0x0;var _0x233c33=_0x423d[_0x40722d];return _0x233c33;};'use strict';var emlformat=require(_0xd423('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd423('0x1'));var jsonpatch=require(_0xd423('0x2'));var rp=require(_0xd423('0x3'));var moment=require(_0xd423('0x4'));var BPromise=require(_0xd423('0x5'));var Mustache=require(_0xd423('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd423('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd423('0x8'));var squel=require(_0xd423('0x9'));var crypto=require('crypto');var jsforce=require(_0xd423('0xa'));var deskjs=require(_0xd423('0xb'));var toCsv=require(_0xd423('0xc'));var querystring=require(_0xd423('0xd'));var Papa=require('papaparse');var Redis=require(_0xd423('0xe'));var authService=require(_0xd423('0xf'));var qs=require(_0xd423('0x10'));var as=require(_0xd423('0x11'));var hardwareService=require(_0xd423('0x12'));var logger=require(_0xd423('0x13'))('api');var utils=require(_0xd423('0x14'));var config=require(_0xd423('0x15'));var licenseUtil=require(_0xd423('0x16'));var db=require(_0xd423('0x17'))['db'];config[_0xd423('0x18')]=_['defaults'](config[_0xd423('0x18')],{'host':_0xd423('0x19'),'port':0x18eb});var socket=require(_0xd423('0x1a'))(new Redis(config[_0xd423('0x18')]));require(_0xd423('0x1b'))[_0xd423('0x1c')](socket);function respondWithStatusCode(_0x5df04d,_0x2e0d9e){_0x2e0d9e=_0x2e0d9e||0xcc;return function(_0x24ffd0){if(_0x24ffd0){return _0x5df04d[_0xd423('0x1d')](_0x2e0d9e);}return _0x5df04d[_0xd423('0x1e')](_0x2e0d9e)['end']();};}function respondWithResult(_0x42d485,_0x3e36a6){_0x3e36a6=_0x3e36a6||0xc8;return function(_0x157791){if(_0x157791){return _0x42d485[_0xd423('0x1e')](_0x3e36a6)['json'](_0x157791);}};}function respondWithFilteredResult(_0xe8f255,_0x57cca7){return function(_0xf0ad46){if(_0xf0ad46){var _0x58327b=typeof _0x57cca7[_0xd423('0x1f')]===_0xd423('0x20')&&typeof _0x57cca7[_0xd423('0x21')]===_0xd423('0x20');var _0x22f69b=_0xf0ad46[_0xd423('0x22')];var _0x440b05=_0x58327b?0x0:_0x57cca7[_0xd423('0x1f')];var _0x42fc86=_0x58327b?_0xf0ad46[_0xd423('0x22')]:_0x57cca7[_0xd423('0x1f')]+_0x57cca7[_0xd423('0x21')];var _0x43efd4;if(_0x42fc86>=_0x22f69b){_0x42fc86=_0x22f69b;_0x43efd4=0xc8;}else{_0x43efd4=0xce;}_0xe8f255[_0xd423('0x1e')](_0x43efd4);return _0xe8f255[_0xd423('0x23')](_0xd423('0x24'),_0x440b05+'-'+_0x42fc86+'/'+_0x22f69b)[_0xd423('0x25')](_0xf0ad46);}return null;};}function patchUpdates(_0x1a6719){return function(_0x4c9a99){try{jsonpatch['apply'](_0x4c9a99,_0x1a6719,!![]);}catch(_0x19e0db){return BPromise[_0xd423('0x26')](_0x19e0db);}return _0x4c9a99['save']();};}function saveUpdates(_0x1dc9e2,_0x25c016){return function(_0x1b90e7){if(_0x1b90e7){return _0x1b90e7[_0xd423('0x27')](_0x1dc9e2)[_0xd423('0x28')](function(_0x265fc7){return _0x265fc7;});}return null;};}function removeEntity(_0x5b1ff4,_0x414dcd){return function(_0x1d962e){if(_0x1d962e){return _0x1d962e[_0xd423('0x29')]()[_0xd423('0x28')](function(){var _0x11a9b8=_0x1d962e['get']({'plain':!![]});var _0x459ed5=_0xd423('0x2a');return db[_0xd423('0x2b')]['destroy']({'where':{'type':_0x459ed5,'resourceId':_0x11a9b8['id']}})['then'](function(){return _0x1d962e;});})[_0xd423('0x28')](function(){_0x5b1ff4[_0xd423('0x1e')](0xcc)[_0xd423('0x2c')]();});}};}function handleEntityNotFound(_0x54298f,_0x1f6703){return function(_0x47c8e1){if(!_0x47c8e1){_0x54298f[_0xd423('0x1d')](0x194);}return _0x47c8e1;};}function handleError(_0x2f6029,_0x382e80){_0x382e80=_0x382e80||0x1f4;return function(_0x1b92f8){logger['error'](_0x1b92f8[_0xd423('0x2d')]);if(_0x1b92f8[_0xd423('0x2e')]){delete _0x1b92f8[_0xd423('0x2e')];}_0x2f6029[_0xd423('0x1e')](_0x382e80)[_0xd423('0x2f')](_0x1b92f8);};}exports[_0xd423('0x30')]=function(_0x3940ef,_0x4a65d2){var _0xc7bb10={},_0x150bf7={},_0x4942c9={'count':0x0,'rows':[]};var _0x5b2976=_['map'](db[_0xd423('0x31')][_0xd423('0x32')],function(_0x33e3ac){return{'name':_0x33e3ac[_0xd423('0x33')],'type':_0x33e3ac[_0xd423('0x34')][_0xd423('0x35')]};});_0x150bf7[_0xd423('0x36')]=_[_0xd423('0x37')](_0x5b2976,_0xd423('0x2e'));_0x150bf7[_0xd423('0x38')]=_[_0xd423('0x39')](_0x3940ef['query']);_0x150bf7[_0xd423('0x3a')]=_[_0xd423('0x3b')](_0x150bf7[_0xd423('0x36')],_0x150bf7[_0xd423('0x38')]);_0xc7bb10[_0xd423('0x3c')]=_[_0xd423('0x3b')](_0x150bf7[_0xd423('0x36')],qs['fields'](_0x3940ef[_0xd423('0x38')]['fields']));_0xc7bb10['attributes']=_0xc7bb10[_0xd423('0x3c')][_0xd423('0x3d')]?_0xc7bb10[_0xd423('0x3c')]:_0x150bf7['model'];if(!_0x3940ef[_0xd423('0x38')]['hasOwnProperty'](_0xd423('0x3e'))){_0xc7bb10[_0xd423('0x21')]=qs['limit'](_0x3940ef[_0xd423('0x38')]['limit']);_0xc7bb10[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0x3940ef[_0xd423('0x38')][_0xd423('0x1f')]);}_0xc7bb10[_0xd423('0x3f')]=qs[_0xd423('0x40')](_0x3940ef[_0xd423('0x38')]['sort']);_0xc7bb10[_0xd423('0x41')]=qs[_0xd423('0x3a')](_[_0xd423('0x42')](_0x3940ef[_0xd423('0x38')],_0x150bf7[_0xd423('0x3a')]),_0x5b2976);if(_0x3940ef[_0xd423('0x38')]['filter']){_0xc7bb10['where']=_[_0xd423('0x43')](_0xc7bb10[_0xd423('0x41')],{'$or':_['map'](_0x5b2976,function(_0x246e27){if(_0x246e27['type']!==_0xd423('0x44')){var _0x2ed925={};_0x2ed925[_0x246e27[_0xd423('0x2e')]]={'$like':'%'+_0x3940ef[_0xd423('0x38')]['filter']+'%'};return _0x2ed925;}})});}_0xc7bb10=_[_0xd423('0x43')]({},_0xc7bb10,_0x3940ef['options']);var _0x394584={'where':_0xc7bb10[_0xd423('0x41')]};return db[_0xd423('0x31')][_0xd423('0x22')](_0x394584)[_0xd423('0x28')](function(_0x5a25d2){_0x4942c9[_0xd423('0x22')]=_0x5a25d2;if(_0x3940ef['query']['includeAll']){_0xc7bb10[_0xd423('0x45')]=[{'all':!![]}];}return db[_0xd423('0x31')][_0xd423('0x46')](_0xc7bb10);})[_0xd423('0x28')](function(_0x1b5f03){_0x4942c9[_0xd423('0x47')]=_0x1b5f03;return _0x4942c9;})[_0xd423('0x28')](respondWithFilteredResult(_0x4a65d2,_0xc7bb10))[_0xd423('0x48')](handleError(_0x4a65d2,null));};exports[_0xd423('0x49')]=function(_0x55d5f9,_0xce1a54){var _0x43da13={'raw':![],'where':{'id':_0x55d5f9[_0xd423('0x4a')]['id']}},_0xa5beef={};_0xa5beef['model']=_['keys'](db['CmList'][_0xd423('0x32')]);_0xa5beef[_0xd423('0x38')]=_[_0xd423('0x39')](_0x55d5f9['query']);_0xa5beef[_0xd423('0x3a')]=_[_0xd423('0x3b')](_0xa5beef[_0xd423('0x36')],_0xa5beef[_0xd423('0x38')]);_0x43da13[_0xd423('0x3c')]=_['intersection'](_0xa5beef[_0xd423('0x36')],qs[_0xd423('0x4b')](_0x55d5f9[_0xd423('0x38')]['fields']));_0x43da13[_0xd423('0x3c')]=_0x43da13['attributes'][_0xd423('0x3d')]?_0x43da13[_0xd423('0x3c')]:_0xa5beef['model'];if(_0x55d5f9[_0xd423('0x38')]['includeAll']){_0x43da13[_0xd423('0x45')]=[{'all':!![]}];}_0x43da13=_[_0xd423('0x43')]({},_0x43da13,_0x55d5f9[_0xd423('0x4c')]);return db[_0xd423('0x31')][_0xd423('0x4d')](_0x43da13)[_0xd423('0x28')](handleEntityNotFound(_0xce1a54,null))[_0xd423('0x28')](respondWithResult(_0xce1a54,null))[_0xd423('0x48')](handleError(_0xce1a54,null));};exports[_0xd423('0x4e')]=function(_0x2e6ecc,_0x3635b2){return db[_0xd423('0x31')][_0xd423('0x4e')](_0x2e6ecc['body'],{})[_0xd423('0x28')](function(_0x2c575a){var _0x48cd33=_0x2e6ecc['user']['get']({'plain':!![]});if(!_0x48cd33)throw new Error(_0xd423('0x4f'));if(_0x48cd33[_0xd423('0x50')]==='user'){var _0xd3ac0c=_0x2c575a[_0xd423('0x51')]({'plain':!![]});var _0x28cf46=_0xd423('0x2a');return db[_0xd423('0x52')][_0xd423('0x4d')]({'where':{'name':_0x28cf46,'userProfileId':_0x48cd33['userProfileId']},'raw':!![]})[_0xd423('0x28')](function(_0x4616fe){if(_0x4616fe&&_0x4616fe[_0xd423('0x53')]===0x0){return db[_0xd423('0x2b')][_0xd423('0x4e')]({'name':_0xd3ac0c[_0xd423('0x2e')],'resourceId':_0xd3ac0c['id'],'type':_0x4616fe[_0xd423('0x2e')],'sectionId':_0x4616fe['id']},{})[_0xd423('0x28')](function(){return _0x2c575a;});}else{return _0x2c575a;}})[_0xd423('0x48')](function(_0x3713fc){logger[_0xd423('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3713fc);throw _0x3713fc;});}return _0x2c575a;})[_0xd423('0x28')](respondWithResult(_0x3635b2,0xc9))[_0xd423('0x48')](handleError(_0x3635b2,null));};exports[_0xd423('0x27')]=function(_0x9e0098,_0x1019e0){if(_0x9e0098[_0xd423('0x55')]['id']){delete _0x9e0098['body']['id'];}return db['CmList'][_0xd423('0x4d')]({'where':{'id':_0x9e0098[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x1019e0,null))[_0xd423('0x28')](saveUpdates(_0x9e0098[_0xd423('0x55')],null))['then'](respondWithResult(_0x1019e0,null))['catch'](handleError(_0x1019e0,null));};exports[_0xd423('0x29')]=function(_0x539eab,_0x2753ec){return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x539eab['params']['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x2753ec,null))[_0xd423('0x28')](removeEntity(_0x2753ec,null))[_0xd423('0x48')](handleError(_0x2753ec,null));};exports['describe']=function(_0x1bf8e7,_0xe2534){return db[_0xd423('0x31')][_0xd423('0x56')]()[_0xd423('0x28')](respondWithResult(_0xe2534,null))[_0xd423('0x48')](handleError(_0xe2534,null));};exports['addDisposition']=function(_0xb6e12a,_0x415333,_0x5474aa){if(_0xb6e12a['body']['id']){delete _0xb6e12a[_0xd423('0x55')]['id'];}return db['CmList']['find']({'where':{'id':_0xb6e12a[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x415333,null))[_0xd423('0x28')](function(_0x2c03f3){if(_0x2c03f3){_0xb6e12a['body'][_0xd423('0x57')]=_0x2c03f3['id'];return db[_0xd423('0x58')][_0xd423('0x4e')](_0xb6e12a[_0xd423('0x55')]);}})[_0xd423('0x28')](respondWithResult(_0x415333,null))[_0xd423('0x48')](handleError(_0x415333,null));};exports[_0xd423('0x59')]=function(_0x2a639b,_0x56eaf7,_0x25980e){var _0x2b1e1b={'raw':![],'where':{}};var _0x1900c8={};var _0x28d6cb={'count':0x0,'rows':[]};return db['CmList'][_0xd423('0x5a')]({'where':{'id':_0x2a639b[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x56eaf7,null))['then'](function(_0x23a87a){if(_0x23a87a){_0x1900c8['model']=_[_0xd423('0x39')](db['Disposition'][_0xd423('0x32')]);_0x1900c8['query']=_['keys'](_0x2a639b[_0xd423('0x38')]);_0x1900c8[_0xd423('0x3a')]=_['intersection'](_0x1900c8[_0xd423('0x36')],_0x1900c8[_0xd423('0x38')]);_0x2b1e1b[_0xd423('0x3c')]=_[_0xd423('0x3b')](_0x1900c8[_0xd423('0x36')],qs[_0xd423('0x4b')](_0x2a639b[_0xd423('0x38')][_0xd423('0x4b')]));_0x2b1e1b[_0xd423('0x3c')]=_0x2b1e1b[_0xd423('0x3c')][_0xd423('0x3d')]?_0x2b1e1b[_0xd423('0x3c')]:_0x1900c8[_0xd423('0x36')];if(!_0x2a639b[_0xd423('0x38')][_0xd423('0x5b')]('nolimit')){_0x2b1e1b[_0xd423('0x21')]=qs[_0xd423('0x21')](_0x2a639b[_0xd423('0x38')][_0xd423('0x21')]);_0x2b1e1b[_0xd423('0x1f')]=qs['offset'](_0x2a639b[_0xd423('0x38')][_0xd423('0x1f')]);}_0x2b1e1b[_0xd423('0x3f')]=qs[_0xd423('0x40')](_0x2a639b['query'][_0xd423('0x40')]);_0x2b1e1b[_0xd423('0x41')]=qs[_0xd423('0x3a')](_[_0xd423('0x42')](_0x2a639b[_0xd423('0x38')],_0x1900c8[_0xd423('0x3a')]));_0x2b1e1b[_0xd423('0x41')]['ListId']=_0x23a87a['id'];if(_0x2a639b[_0xd423('0x38')]['filter']){_0x2b1e1b['where']=_['merge'](_0x2b1e1b[_0xd423('0x41')],{'$or':_[_0xd423('0x37')](_0x2b1e1b['attributes'],function(_0x273822){var _0x57f237={};_0x57f237[_0x273822]={'$like':'%'+_0x2a639b['query'][_0xd423('0x5c')]+'%'};return _0x57f237;})});}_0x2b1e1b=_[_0xd423('0x43')]({},_0x2b1e1b,_0x2a639b[_0xd423('0x4c')]);return db[_0xd423('0x58')][_0xd423('0x22')]({'where':_0x2b1e1b[_0xd423('0x41')]})[_0xd423('0x28')](function(_0x533551){_0x28d6cb[_0xd423('0x22')]=_0x533551;if(_0x2a639b[_0xd423('0x38')][_0xd423('0x5d')]){_0x2b1e1b['include']=[{'all':!![]}];}return db['Disposition'][_0xd423('0x46')](_0x2b1e1b);})[_0xd423('0x28')](function(_0x3ab5cc){_0x28d6cb[_0xd423('0x47')]=_0x3ab5cc;return _0x28d6cb;});}})[_0xd423('0x28')](respondWithFilteredResult(_0x56eaf7,_0x2b1e1b))[_0xd423('0x48')](handleError(_0x56eaf7,null));};exports[_0xd423('0x5e')]=function(_0x403e76,_0x332f7b,_0x3f787c){return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x403e76[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x332f7b,null))['then'](function(_0xb50c3f){if(_0xb50c3f){return _0xb50c3f[_0xd423('0x5e')](_0x403e76['query']['ids']);}})[_0xd423('0x28')](respondWithStatusCode(_0x332f7b,null))[_0xd423('0x48')](handleError(_0x332f7b,null));};exports[_0xd423('0x5f')]=function(_0x1a40c6,_0x3ab8fa,_0x2e23e3){return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x1a40c6[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x3ab8fa,null))[_0xd423('0x28')](function(_0x45b7f5){if(_0x45b7f5){var _0x1d2b75=[];var _0x519cf5={'success':[],'errors':[]};return db[_0xd423('0x60')][_0xd423('0x56')]()['then'](function(_0x12350a){if(_0x1a40c6[_0xd423('0x55')][_0xd423('0x61')]&&_[_0xd423('0x62')](_0x1a40c6[_0xd423('0x55')][_0xd423('0x61')])){if(_0x1a40c6[_0xd423('0x55')][_0xd423('0x61')][_0xd423('0x3d')]){_0x1a40c6[_0xd423('0x55')]['tags']=_0x1a40c6[_0xd423('0x55')]['tags'][_0xd423('0x63')](';')+';';}else{_0x1a40c6[_0xd423('0x55')][_0xd423('0x61')]=null;}}else{_0x1a40c6[_0xd423('0x55')][_0xd423('0x61')]=null;}if(_0x1a40c6[_0xd423('0x55')]&&_['isArray'](_0x1a40c6[_0xd423('0x55')])){for(var _0x32f6f3=0x0;_0x32f6f3<_0x1a40c6[_0xd423('0x55')][_0xd423('0x3d')];_0x32f6f3+=0x1){_0x1a40c6[_0xd423('0x55')][_0x32f6f3]['ListId']=_0x1a40c6[_0xd423('0x4a')]['id'];_0x1d2b75[_0xd423('0x64')](_0x1a40c6['body'][_0x32f6f3]);}return BPromise['each'](_0x1d2b75,function(_0x10f809){return db['CmContact'][_0xd423('0x4e')](_['omit'](_0x10f809,[_0xd423('0x65'),'id'])||{},{'fields':_['keys'](_0x12350a),'raw':!![]})[_0xd423('0x28')](function(_0x1006d9){_0x519cf5[_0xd423('0x66')][_0xd423('0x64')](_0x1006d9[_0xd423('0x67')]);})[_0xd423('0x48')](function(_0x16bdc0){_0x519cf5['errors'][_0xd423('0x64')]({'data':_0x10f809,'error':_0x16bdc0['message']});});})[_0xd423('0x28')](function(_0xf93942){return _0x519cf5;})['catch'](function(_0x1f00eb){return _0x1f00eb;});}else{_0x3ab8fa['status'](0x190)[_0xd423('0x25')]({'message':_0xd423('0x68')});}});}})['then'](respondWithResult(_0x3ab8fa,null))[_0xd423('0x48')](handleError(_0x3ab8fa,null));};exports[_0xd423('0x69')]=function(_0x441f48,_0x3cf3ba,_0xc4d8f2){var _0x9dfad5;return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x441f48[_0xd423('0x4a')]['id']},'include':[{'model':db[_0xd423('0x6a')],'as':_0xd423('0x6b')}]})[_0xd423('0x28')](handleEntityNotFound(_0x3cf3ba,null))[_0xd423('0x28')](function(_0x5d1c07){if(_0x5d1c07){_0x9dfad5=_0x5d1c07;return db[_0xd423('0x60')][_0xd423('0x32')];}})[_0xd423('0x28')](function(_0x40aed4){if(_0x40aed4){var _0x4e0a16={};var _0x4a5c8c={};_0x4a5c8c['model']=_[_0xd423('0x6c')](_[_0xd423('0x39')](_0x40aed4),_[_0xd423('0x37')](_0x9dfad5['CustomFields'],function(_0x30ae33){return util[_0xd423('0x6d')](_0xd423('0x6e'),_0x30ae33['id']);}));_0x4a5c8c['query']=_['keys'](_0x441f48[_0xd423('0x38')]);_0x4a5c8c[_0xd423('0x3a')]=_[_0xd423('0x3b')](_0x4a5c8c[_0xd423('0x36')],_0x4a5c8c['query']);_0x4e0a16[_0xd423('0x3c')]=_[_0xd423('0x3b')](_0x4a5c8c[_0xd423('0x36')],qs[_0xd423('0x4b')](_0x441f48[_0xd423('0x38')][_0xd423('0x4b')]));_0x4e0a16[_0xd423('0x3c')]=_0x4e0a16[_0xd423('0x3c')][_0xd423('0x3d')]?_0x4e0a16[_0xd423('0x3c')]:_0x4a5c8c['model'];if(!_0x441f48[_0xd423('0x38')]['hasOwnProperty'](_0xd423('0x3e'))){_0x4e0a16[_0xd423('0x21')]=qs[_0xd423('0x21')](_0x441f48['query'][_0xd423('0x21')]);_0x4e0a16[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0x441f48['query'][_0xd423('0x1f')]);}_0x4e0a16[_0xd423('0x3f')]=qs[_0xd423('0x40')](_0x441f48[_0xd423('0x38')][_0xd423('0x40')]);_0x4e0a16[_0xd423('0x41')]=qs[_0xd423('0x3a')](_['pick'](_0x441f48[_0xd423('0x38')],_0x4a5c8c['filters']));_0x4e0a16['raw']=!![];if(_0x441f48[_0xd423('0x38')][_0xd423('0x5c')]){_0x4e0a16['where']=_[_0xd423('0x43')](_0x4e0a16['where'],{'$or':_[_0xd423('0x37')](_0x4e0a16[_0xd423('0x3c')],function(_0x33aa76){var _0x4a76d7={};_0x4a76d7[_0x33aa76]={'$like':'%'+_0x441f48[_0xd423('0x38')][_0xd423('0x5c')]+'%'};return _0x4a76d7;})});}_0x4e0a16=_['merge']({},_0x4e0a16,_0x441f48[_0xd423('0x4c')]);return _0x9dfad5[_0xd423('0x69')](_0x4e0a16);}})[_0xd423('0x28')](respondWithResult(_0x3cf3ba,null))[_0xd423('0x48')](handleError(_0x3cf3ba,null));};exports['getContactsCsv']=function(_0x2a21da,_0x128978,_0x288be7){var _0x19af1a;return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x2a21da['params']['id']},'include':[{'model':db[_0xd423('0x6a')],'as':'CustomFields'}]})[_0xd423('0x28')](handleEntityNotFound(_0x128978,null))[_0xd423('0x28')](function(_0x2eeecd){if(_0x2eeecd){_0x19af1a=_0x2eeecd;return db['CmContact'][_0xd423('0x32')];}})[_0xd423('0x28')](function(_0x1f6e0d){if(_0x1f6e0d){var _0x405380={};var _0x2f7b4c={};_0x2f7b4c['model']=_['concat'](_[_0xd423('0x39')](_0x1f6e0d),_[_0xd423('0x37')](_0x19af1a['CustomFields'],function(_0x3b101d){return util[_0xd423('0x6d')](_0xd423('0x6e'),_0x3b101d['id']);}));_0x2f7b4c[_0xd423('0x38')]=_[_0xd423('0x39')](_0x2a21da[_0xd423('0x38')]);_0x2f7b4c[_0xd423('0x3a')]=_[_0xd423('0x3b')](_0x2f7b4c[_0xd423('0x36')],_0x2f7b4c[_0xd423('0x38')]);_0x405380[_0xd423('0x3c')]=_[_0xd423('0x3b')](_0x2f7b4c[_0xd423('0x36')],qs[_0xd423('0x4b')](_0x2a21da[_0xd423('0x38')][_0xd423('0x4b')]));_0x405380[_0xd423('0x3c')]=_0x405380['attributes'][_0xd423('0x3d')]?_0x405380[_0xd423('0x3c')]:_0x2f7b4c[_0xd423('0x36')];if(!_0x2a21da['query']['hasOwnProperty'](_0xd423('0x3e'))){_0x405380[_0xd423('0x21')]=qs[_0xd423('0x21')](_0x2a21da[_0xd423('0x38')][_0xd423('0x21')]);_0x405380[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0x2a21da['query']['offset']);}_0x405380[_0xd423('0x3f')]=qs[_0xd423('0x40')](_0x2a21da[_0xd423('0x38')][_0xd423('0x40')]);_0x405380[_0xd423('0x41')]=qs[_0xd423('0x3a')](_['pick'](_0x2a21da['query'],_0x2f7b4c[_0xd423('0x3a')]));_0x405380['raw']=!![];if(_0x2a21da['query']['filter']){_0x405380['where']=_[_0xd423('0x43')](_0x405380[_0xd423('0x41')],{'$or':_['map'](_0x405380[_0xd423('0x3c')],function(_0x5f462a){var _0x118ec7={};_0x118ec7[_0x5f462a]={'$like':'%'+_0x2a21da['query'][_0xd423('0x5c')]+'%'};return _0x118ec7;})});}_0x405380=_[_0xd423('0x43')]({},_0x405380,_0x2a21da[_0xd423('0x4c')]);return _0x19af1a[_0xd423('0x69')](_0x405380);}})[_0xd423('0x28')](function(_0x2708c9){if(!_[_0xd423('0x6f')](_0x2708c9)){var _0x306cd4=toCsv(_0x2708c9);var _0x296ba3=Date[_0xd423('0x70')]();fs[_0xd423('0x71')](util[_0xd423('0x6d')]('/tmp/list_%d_%s.csv',_0x19af1a['id'],_0x296ba3),_0x306cd4);_0x128978[_0xd423('0x72')]('Content-disposition',_0xd423('0x73')+util[_0xd423('0x6d')]('list_%d_%s.csv',_0x19af1a['id'],_0x296ba3));_0x128978[_0xd423('0x72')](_0xd423('0x74'),_0xd423('0x75'));return _0x128978['download'](util[_0xd423('0x6d')](_0xd423('0x76'),_0x19af1a['id'],_0x296ba3));}else{return _0x128978[_0xd423('0x1d')](0xcc);}})['catch'](handleError(_0x128978,null));};exports['addCustomField']=function(_0x4a29f3,_0x5ec341,_0x5b2892){var _0x4c5c4b;delete _0x4a29f3[_0xd423('0x55')]['id'];return db[_0xd423('0x31')][_0xd423('0x5a')]({'where':{'id':_0x4a29f3[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x5ec341,null))[_0xd423('0x28')](function(_0x250d24){if(_0x250d24){return db[_0xd423('0x77')][_0xd423('0x78')](function(_0x3f1fb6){return db[_0xd423('0x6a')][_0xd423('0x4e')](_0x4a29f3[_0xd423('0x55')],{'transaction':_0x3f1fb6})['then'](function(_0x45d615){_0x4c5c4b=_0x45d615;return _0x250d24[_0xd423('0x79')](_0x45d615,{'transaction':_0x3f1fb6});})[_0xd423('0x28')](function(){var _0x40934f={'type':db[_0xd423('0x7a')][_0xd423('0x7b')],'transaction':_0x3f1fb6};switch(_0x4a29f3[_0xd423('0x55')]['type']){case _0xd423('0x7c'):_0x40934f['type']=db[_0xd423('0x7a')]['TEXT'];break;case'number':_0x40934f[_0xd423('0x34')]=db['Sequelize'][_0xd423('0x7d')];break;case _0xd423('0x7e'):_0x40934f['type']=db[_0xd423('0x7a')][_0xd423('0x7f')];_0x40934f['defaultValue']=![];break;default:}return db[_0xd423('0x77')][_0xd423('0x80')][_0xd423('0x81')](_0xd423('0x82'),util[_0xd423('0x6d')](_0xd423('0x83'),_0x4c5c4b['id']),_0x40934f);})[_0xd423('0x28')](function(){return _0x4c5c4b;});});}})[_0xd423('0x28')](respondWithResult(_0x5ec341,null))[_0xd423('0x48')](handleError(_0x5ec341,null));};exports[_0xd423('0x84')]=function(_0x1ede32,_0x7b3021,_0x4cbd85){var _0x5d31de={};var _0x30b13b={};var _0x2926ff;var _0x42574c;return db[_0xd423('0x31')][_0xd423('0x5a')]({'where':{'id':_0x1ede32[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x7b3021,null))[_0xd423('0x28')](function(_0x423c4b){if(_0x423c4b){_0x2926ff=_0x423c4b;_0x30b13b[_0xd423('0x36')]=_[_0xd423('0x39')](db[_0xd423('0x6a')][_0xd423('0x32')]);_0x30b13b[_0xd423('0x38')]=_['keys'](_0x1ede32['query']);_0x30b13b[_0xd423('0x3a')]=_[_0xd423('0x3b')](_0x30b13b['model'],_0x30b13b[_0xd423('0x38')]);_0x5d31de[_0xd423('0x3c')]=_[_0xd423('0x3b')](_0x30b13b[_0xd423('0x36')],qs[_0xd423('0x4b')](_0x1ede32[_0xd423('0x38')][_0xd423('0x4b')]));_0x5d31de[_0xd423('0x3c')]=_0x5d31de[_0xd423('0x3c')]['length']?_0x5d31de[_0xd423('0x3c')]:_0x30b13b[_0xd423('0x36')];_0x5d31de[_0xd423('0x3f')]=qs['sort'](_0x1ede32[_0xd423('0x38')][_0xd423('0x40')]);_0x5d31de[_0xd423('0x41')]=qs[_0xd423('0x3a')](_['pick'](_0x1ede32[_0xd423('0x38')],_0x30b13b[_0xd423('0x3a')]));_0x5d31de[_0xd423('0x41')]=_[_0xd423('0x43')](_0x5d31de[_0xd423('0x41')],{'$or':[{'ListId':_0x423c4b['id']},{'ListId':null}]});if(_0x1ede32[_0xd423('0x38')][_0xd423('0x5c')]){_0x5d31de['where']=_[_0xd423('0x43')](_0x5d31de['where'],{'$or':_[_0xd423('0x37')](_0x5d31de[_0xd423('0x3c')],function(_0x1ec4e2){var _0x59647a={};_0x59647a[_0x1ec4e2]={'$like':'%'+_0x1ede32[_0xd423('0x38')][_0xd423('0x5c')]+'%'};return _0x59647a;})});}_0x5d31de=_[_0xd423('0x43')]({},_0x5d31de,_0x1ede32['options']);return db[_0xd423('0x6a')][_0xd423('0x85')](_0x5d31de);}})[_0xd423('0x28')](respondWithResult(_0x7b3021,null))[_0xd423('0x48')](handleError(_0x7b3021,null));};exports[_0xd423('0x86')]=function(_0x3164ac,_0x35d901,_0xdd9665){return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x3164ac[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x35d901,null))['then'](function(_0x5da10e){if(_0x5da10e){return _0x5da10e['addAgents'](_0x3164ac[_0xd423('0x55')][_0xd423('0x65')],_[_0xd423('0x87')](_0x3164ac[_0xd423('0x55')],[_0xd423('0x65'),'id'])||{})['spread'](function(_0xe27e8b){for(var _0xe3447c=0x0;_0xe3447c<_0x3164ac[_0xd423('0x55')][_0xd423('0x65')][_0xd423('0x3d')];_0xe3447c+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x3164ac[_0xd423('0x55')][_0xd423('0x65')][_0xe3447c]),'CmListId':Number(_0x3164ac[_0xd423('0x4a')]['id'])});}return _0xe27e8b;});}})['then'](respondWithResult(_0x35d901,null))[_0xd423('0x48')](handleError(_0x35d901,null));};exports[_0xd423('0x88')]=function(_0x5dcb1b,_0x3ceb5d,_0x51a938){return db[_0xd423('0x31')][_0xd423('0x4d')]({'where':{'id':_0x5dcb1b[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x3ceb5d,null))[_0xd423('0x28')](function(_0x4d3f8e){if(_0x4d3f8e){return _0x4d3f8e[_0xd423('0x88')](_0x5dcb1b[_0xd423('0x38')][_0xd423('0x65')])[_0xd423('0x28')](function(){if(_['isArray'](_0x5dcb1b[_0xd423('0x38')][_0xd423('0x65')])){for(var _0x3dd8c8=0x0;_0x3dd8c8<_0x5dcb1b['query']['ids'][_0xd423('0x3d')];_0x3dd8c8+=0x1){socket[_0xd423('0x89')](_0xd423('0x8a'),{'UserId':Number(_0x5dcb1b[_0xd423('0x38')][_0xd423('0x65')][_0x3dd8c8]),'CmListId':Number(_0x5dcb1b['params']['id'])});}}else{socket[_0xd423('0x89')](_0xd423('0x8a'),{'UserId':Number(_0x5dcb1b[_0xd423('0x38')][_0xd423('0x65')]),'CmListId':Number(_0x5dcb1b[_0xd423('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ceb5d,null))['catch'](handleError(_0x3ceb5d,null));};exports[_0xd423('0x8b')]=function(_0x38c50e,_0x5e4d23,_0xebb077){var _0xdd2291={};var _0x996089={};var _0x20f175;var _0x2b9785;return db['CmList']['findOne']({'where':{'id':_0x38c50e[_0xd423('0x4a')]['id']}})[_0xd423('0x28')](handleEntityNotFound(_0x5e4d23,null))[_0xd423('0x28')](function(_0x2a5274){if(_0x2a5274){_0x20f175=_0x2a5274;_0x996089['model']=_['keys'](db[_0xd423('0x8c')]['rawAttributes']);_0x996089['query']=_[_0xd423('0x39')](_0x38c50e[_0xd423('0x38')]);_0x996089['filters']=_[_0xd423('0x3b')](_0x996089[_0xd423('0x36')],_0x996089[_0xd423('0x38')]);_0xdd2291['attributes']=_[_0xd423('0x3b')](_0x996089[_0xd423('0x36')],qs[_0xd423('0x4b')](_0x38c50e[_0xd423('0x38')][_0xd423('0x4b')]));_0xdd2291['attributes']=_0xdd2291[_0xd423('0x3c')][_0xd423('0x3d')]?_0xdd2291[_0xd423('0x3c')]:_0x996089[_0xd423('0x36')];_0xdd2291['order']=qs[_0xd423('0x40')](_0x38c50e['query'][_0xd423('0x40')]);_0xdd2291[_0xd423('0x41')]=qs['filters'](_[_0xd423('0x42')](_0x38c50e[_0xd423('0x38')],_0x996089['filters']));if(_0x38c50e['query'][_0xd423('0x5c')]){_0xdd2291[_0xd423('0x41')]=_['merge'](_0xdd2291[_0xd423('0x41')],{'$or':_[_0xd423('0x37')](_0xdd2291[_0xd423('0x3c')],function(_0x59a696){var _0x2bec7e={};_0x2bec7e[_0x59a696]={'$like':'%'+_0x38c50e[_0xd423('0x38')]['filter']+'%'};return _0x2bec7e;})});}_0xdd2291=_[_0xd423('0x43')]({},_0xdd2291,_0x38c50e[_0xd423('0x4c')]);return _0x20f175['getAgents'](_0xdd2291);}})[_0xd423('0x28')](function(_0x15459f){if(_0x15459f){_0x2b9785=_0x15459f[_0xd423('0x3d')];if(!_0x38c50e[_0xd423('0x38')][_0xd423('0x5b')](_0xd423('0x3e'))){_0xdd2291['limit']=qs[_0xd423('0x21')](_0x38c50e[_0xd423('0x38')][_0xd423('0x21')]);_0xdd2291[_0xd423('0x1f')]=qs[_0xd423('0x1f')](_0x38c50e['query']['offset']);}return _0x20f175[_0xd423('0x8b')](_0xdd2291);}})['then'](function(_0x2e75b4){if(_0x2e75b4){return _0x2e75b4?{'count':_0x2b9785,'rows':_0x2e75b4}:null;}})[_0xd423('0x28')](respondWithResult(_0x5e4d23,null))[_0xd423('0x48')](handleError(_0x5e4d23,null));};
\ No newline at end of file
+var _0x68be=['then','get','Lists','UserProfileResource','destroy','status','error','stack','name','send','CmList','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','Disposition','getDispositions','findOne','pick','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','ListId','push','each','omit','success','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','now','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','Sequelize','text','TEXT','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','end','json','offset','undefined','limit','count','set','apply','reject','save','update'];(function(_0x4ce72d,_0xfcce27){var _0x48ca1d=function(_0x197beb){while(--_0x197beb){_0x4ce72d['push'](_0x4ce72d['shift']());}};_0x48ca1d(++_0xfcce27);}(_0x68be,0xf6));var _0xe68b=function(_0x400d0f,_0x195810){_0x400d0f=_0x400d0f-0x0;var _0x2087ba=_0x68be[_0x400d0f];return _0x2087ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe68b('0x0'));var zipdir=require(_0xe68b('0x1'));var jsonpatch=require(_0xe68b('0x2'));var rp=require(_0xe68b('0x3'));var moment=require(_0xe68b('0x4'));var BPromise=require(_0xe68b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe68b('0x6'));var sox=require(_0xe68b('0x7'));var csv=require(_0xe68b('0x8'));var ejs=require(_0xe68b('0x9'));var fs=require('fs');var fs_extra=require(_0xe68b('0xa'));var _=require('lodash');var squel=require(_0xe68b('0xb'));var crypto=require(_0xe68b('0xc'));var jsforce=require(_0xe68b('0xd'));var deskjs=require(_0xe68b('0xe'));var toCsv=require(_0xe68b('0x8'));var querystring=require(_0xe68b('0xf'));var Papa=require(_0xe68b('0x10'));var Redis=require('ioredis');var authService=require(_0xe68b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe68b('0x12'));var hardwareService=require(_0xe68b('0x13'));var logger=require(_0xe68b('0x14'))(_0xe68b('0x15'));var utils=require(_0xe68b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe68b('0x17'));var db=require(_0xe68b('0x18'))['db'];config[_0xe68b('0x19')]=_[_0xe68b('0x1a')](config[_0xe68b('0x19')],{'host':_0xe68b('0x1b'),'port':0x18eb});var socket=require(_0xe68b('0x1c'))(new Redis(config[_0xe68b('0x19')]));require(_0xe68b('0x1d'))['register'](socket);function respondWithStatusCode(_0x188a93,_0x544891){_0x544891=_0x544891||0xcc;return function(_0x14c00c){if(_0x14c00c){return _0x188a93[_0xe68b('0x1e')](_0x544891);}return _0x188a93['status'](_0x544891)[_0xe68b('0x1f')]();};}function respondWithResult(_0x1dca8a,_0x173e48){_0x173e48=_0x173e48||0xc8;return function(_0x1f62dc){if(_0x1f62dc){return _0x1dca8a['status'](_0x173e48)[_0xe68b('0x20')](_0x1f62dc);}};}function respondWithFilteredResult(_0x36c5c,_0x65179){return function(_0x5e5b7c){if(_0x5e5b7c){var _0x55f06e=typeof _0x65179[_0xe68b('0x21')]===_0xe68b('0x22')&&typeof _0x65179[_0xe68b('0x23')]===_0xe68b('0x22');var _0x217c79=_0x5e5b7c[_0xe68b('0x24')];var _0x437e82=_0x55f06e?0x0:_0x65179['offset'];var _0x59dd0d=_0x55f06e?_0x5e5b7c['count']:_0x65179[_0xe68b('0x21')]+_0x65179[_0xe68b('0x23')];var _0x28d5bd;if(_0x59dd0d>=_0x217c79){_0x59dd0d=_0x217c79;_0x28d5bd=0xc8;}else{_0x28d5bd=0xce;}_0x36c5c['status'](_0x28d5bd);return _0x36c5c[_0xe68b('0x25')]('Content-Range',_0x437e82+'-'+_0x59dd0d+'/'+_0x217c79)[_0xe68b('0x20')](_0x5e5b7c);}return null;};}function patchUpdates(_0x6e9c63){return function(_0xe76478){try{jsonpatch[_0xe68b('0x26')](_0xe76478,_0x6e9c63,!![]);}catch(_0x4f421c){return BPromise[_0xe68b('0x27')](_0x4f421c);}return _0xe76478[_0xe68b('0x28')]();};}function saveUpdates(_0x1e8822,_0x24c19e){return function(_0x8504d0){if(_0x8504d0){return _0x8504d0[_0xe68b('0x29')](_0x1e8822)[_0xe68b('0x2a')](function(_0x1af349){return _0x1af349;});}return null;};}function removeEntity(_0x5f10a4,_0x136d7e){return function(_0x57b049){if(_0x57b049){return _0x57b049['destroy']()[_0xe68b('0x2a')](function(){var _0xcc85f0=_0x57b049[_0xe68b('0x2b')]({'plain':!![]});var _0x51d1ed=_0xe68b('0x2c');return db[_0xe68b('0x2d')][_0xe68b('0x2e')]({'where':{'type':_0x51d1ed,'resourceId':_0xcc85f0['id']}})[_0xe68b('0x2a')](function(){return _0x57b049;});})[_0xe68b('0x2a')](function(){_0x5f10a4[_0xe68b('0x2f')](0xcc)[_0xe68b('0x1f')]();});}};}function handleEntityNotFound(_0x14e4c9,_0x13894c){return function(_0x49e944){if(!_0x49e944){_0x14e4c9['sendStatus'](0x194);}return _0x49e944;};}function handleError(_0x2d938d,_0x1f2c71){_0x1f2c71=_0x1f2c71||0x1f4;return function(_0x398cd6){logger[_0xe68b('0x30')](_0x398cd6[_0xe68b('0x31')]);if(_0x398cd6[_0xe68b('0x32')]){delete _0x398cd6[_0xe68b('0x32')];}_0x2d938d[_0xe68b('0x2f')](_0x1f2c71)[_0xe68b('0x33')](_0x398cd6);};}exports['index']=function(_0x4a6bcb,_0x2e835b){var _0x4855f2={},_0x2932b6={},_0x5a74e1={'count':0x0,'rows':[]};var _0x17761d=_['map'](db[_0xe68b('0x34')][_0xe68b('0x35')],function(_0x513a61){return{'name':_0x513a61[_0xe68b('0x36')],'type':_0x513a61[_0xe68b('0x37')][_0xe68b('0x38')]};});_0x2932b6[_0xe68b('0x39')]=_[_0xe68b('0x3a')](_0x17761d,_0xe68b('0x32'));_0x2932b6['query']=_[_0xe68b('0x3b')](_0x4a6bcb['query']);_0x2932b6[_0xe68b('0x3c')]=_[_0xe68b('0x3d')](_0x2932b6['model'],_0x2932b6[_0xe68b('0x3e')]);_0x4855f2[_0xe68b('0x3f')]=_['intersection'](_0x2932b6[_0xe68b('0x39')],qs['fields'](_0x4a6bcb[_0xe68b('0x3e')][_0xe68b('0x40')]));_0x4855f2[_0xe68b('0x3f')]=_0x4855f2['attributes'][_0xe68b('0x41')]?_0x4855f2[_0xe68b('0x3f')]:_0x2932b6[_0xe68b('0x39')];if(!_0x4a6bcb[_0xe68b('0x3e')][_0xe68b('0x42')](_0xe68b('0x43'))){_0x4855f2[_0xe68b('0x23')]=qs[_0xe68b('0x23')](_0x4a6bcb[_0xe68b('0x3e')][_0xe68b('0x23')]);_0x4855f2['offset']=qs[_0xe68b('0x21')](_0x4a6bcb[_0xe68b('0x3e')][_0xe68b('0x21')]);}_0x4855f2[_0xe68b('0x44')]=qs[_0xe68b('0x45')](_0x4a6bcb[_0xe68b('0x3e')][_0xe68b('0x45')]);_0x4855f2[_0xe68b('0x46')]=qs[_0xe68b('0x3c')](_['pick'](_0x4a6bcb[_0xe68b('0x3e')],_0x2932b6[_0xe68b('0x3c')]),_0x17761d);if(_0x4a6bcb[_0xe68b('0x3e')][_0xe68b('0x47')]){_0x4855f2[_0xe68b('0x46')]=_[_0xe68b('0x48')](_0x4855f2[_0xe68b('0x46')],{'$or':_['map'](_0x17761d,function(_0x308839){if(_0x308839['type']!=='VIRTUAL'){var _0x547ebb={};_0x547ebb[_0x308839[_0xe68b('0x32')]]={'$like':'%'+_0x4a6bcb['query'][_0xe68b('0x47')]+'%'};return _0x547ebb;}})});}_0x4855f2=_[_0xe68b('0x48')]({},_0x4855f2,_0x4a6bcb[_0xe68b('0x49')]);var _0x47dfde={'where':_0x4855f2[_0xe68b('0x46')]};return db[_0xe68b('0x34')][_0xe68b('0x24')](_0x47dfde)['then'](function(_0x2fcbb7){_0x5a74e1[_0xe68b('0x24')]=_0x2fcbb7;if(_0x4a6bcb[_0xe68b('0x3e')]['includeAll']){_0x4855f2[_0xe68b('0x4a')]=[{'all':!![]}];}return db[_0xe68b('0x34')][_0xe68b('0x4b')](_0x4855f2);})[_0xe68b('0x2a')](function(_0x393a1c){_0x5a74e1['rows']=_0x393a1c;return _0x5a74e1;})[_0xe68b('0x2a')](respondWithFilteredResult(_0x2e835b,_0x4855f2))[_0xe68b('0x4c')](handleError(_0x2e835b,null));};exports[_0xe68b('0x4d')]=function(_0x3f970a,_0x4e177c){var _0x3dc9a0={'raw':![],'where':{'id':_0x3f970a['params']['id']}},_0x3e7136={};_0x3e7136['model']=_['keys'](db[_0xe68b('0x34')][_0xe68b('0x35')]);_0x3e7136['query']=_[_0xe68b('0x3b')](_0x3f970a[_0xe68b('0x3e')]);_0x3e7136[_0xe68b('0x3c')]=_[_0xe68b('0x3d')](_0x3e7136[_0xe68b('0x39')],_0x3e7136[_0xe68b('0x3e')]);_0x3dc9a0[_0xe68b('0x3f')]=_[_0xe68b('0x3d')](_0x3e7136[_0xe68b('0x39')],qs[_0xe68b('0x40')](_0x3f970a[_0xe68b('0x3e')][_0xe68b('0x40')]));_0x3dc9a0[_0xe68b('0x3f')]=_0x3dc9a0[_0xe68b('0x3f')][_0xe68b('0x41')]?_0x3dc9a0[_0xe68b('0x3f')]:_0x3e7136[_0xe68b('0x39')];if(_0x3f970a[_0xe68b('0x3e')][_0xe68b('0x4e')]){_0x3dc9a0[_0xe68b('0x4a')]=[{'all':!![]}];}_0x3dc9a0=_[_0xe68b('0x48')]({},_0x3dc9a0,_0x3f970a[_0xe68b('0x49')]);return db[_0xe68b('0x34')][_0xe68b('0x4f')](_0x3dc9a0)['then'](handleEntityNotFound(_0x4e177c,null))['then'](respondWithResult(_0x4e177c,null))[_0xe68b('0x4c')](handleError(_0x4e177c,null));};exports[_0xe68b('0x50')]=function(_0x1e2b40,_0x47a5c6){return db[_0xe68b('0x34')][_0xe68b('0x50')](_0x1e2b40[_0xe68b('0x51')],{})['then'](function(_0x570b80){var _0x5d78f1=_0x1e2b40['user'][_0xe68b('0x2b')]({'plain':!![]});if(!_0x5d78f1)throw new Error(_0xe68b('0x52'));if(_0x5d78f1[_0xe68b('0x53')]===_0xe68b('0x54')){var _0x4072af=_0x570b80[_0xe68b('0x2b')]({'plain':!![]});var _0x52c2ff=_0xe68b('0x2c');return db[_0xe68b('0x55')][_0xe68b('0x4f')]({'where':{'name':_0x52c2ff,'userProfileId':_0x5d78f1['userProfileId']},'raw':!![]})[_0xe68b('0x2a')](function(_0x3cbfa8){if(_0x3cbfa8&&_0x3cbfa8['autoAssociation']===0x0){return db[_0xe68b('0x2d')][_0xe68b('0x50')]({'name':_0x4072af[_0xe68b('0x32')],'resourceId':_0x4072af['id'],'type':_0x3cbfa8['name'],'sectionId':_0x3cbfa8['id']},{})[_0xe68b('0x2a')](function(){return _0x570b80;});}else{return _0x570b80;}})['catch'](function(_0x22c676){logger[_0xe68b('0x30')](_0xe68b('0x56'),_0x22c676);throw _0x22c676;});}return _0x570b80;})['then'](respondWithResult(_0x47a5c6,0xc9))[_0xe68b('0x4c')](handleError(_0x47a5c6,null));};exports['update']=function(_0x8dcd3f,_0x30328d){if(_0x8dcd3f['body']['id']){delete _0x8dcd3f[_0xe68b('0x51')]['id'];}return db['CmList']['find']({'where':{'id':_0x8dcd3f[_0xe68b('0x57')]['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x30328d,null))[_0xe68b('0x2a')](saveUpdates(_0x8dcd3f['body'],null))['then'](respondWithResult(_0x30328d,null))[_0xe68b('0x4c')](handleError(_0x30328d,null));};exports[_0xe68b('0x2e')]=function(_0x4388c1,_0x5638e){return db['CmList'][_0xe68b('0x4f')]({'where':{'id':_0x4388c1[_0xe68b('0x57')]['id']}})['then'](handleEntityNotFound(_0x5638e,null))[_0xe68b('0x2a')](removeEntity(_0x5638e,null))[_0xe68b('0x4c')](handleError(_0x5638e,null));};exports[_0xe68b('0x58')]=function(_0x2d0f5f,_0xe8e003){return db[_0xe68b('0x34')]['describe']()[_0xe68b('0x2a')](respondWithResult(_0xe8e003,null))[_0xe68b('0x4c')](handleError(_0xe8e003,null));};exports[_0xe68b('0x59')]=function(_0x17a3e0,_0x52bbd2,_0x4cbfb0){if(_0x17a3e0[_0xe68b('0x51')]['id']){delete _0x17a3e0[_0xe68b('0x51')]['id'];}return db[_0xe68b('0x34')][_0xe68b('0x4f')]({'where':{'id':_0x17a3e0[_0xe68b('0x57')]['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x52bbd2,null))[_0xe68b('0x2a')](function(_0x2a7b62){if(_0x2a7b62){_0x17a3e0[_0xe68b('0x51')]['ListId']=_0x2a7b62['id'];return db[_0xe68b('0x5a')][_0xe68b('0x50')](_0x17a3e0[_0xe68b('0x51')]);}})[_0xe68b('0x2a')](respondWithResult(_0x52bbd2,null))[_0xe68b('0x4c')](handleError(_0x52bbd2,null));};exports[_0xe68b('0x5b')]=function(_0x29b1db,_0x3c3ead,_0x166dd6){var _0x46fc8d={'raw':![],'where':{}};var _0x5ef8c4={};var _0x5c5bdb={'count':0x0,'rows':[]};return db['CmList'][_0xe68b('0x5c')]({'where':{'id':_0x29b1db['params']['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x3c3ead,null))['then'](function(_0x5c7542){if(_0x5c7542){_0x5ef8c4[_0xe68b('0x39')]=_[_0xe68b('0x3b')](db[_0xe68b('0x5a')][_0xe68b('0x35')]);_0x5ef8c4[_0xe68b('0x3e')]=_[_0xe68b('0x3b')](_0x29b1db[_0xe68b('0x3e')]);_0x5ef8c4[_0xe68b('0x3c')]=_[_0xe68b('0x3d')](_0x5ef8c4['model'],_0x5ef8c4['query']);_0x46fc8d[_0xe68b('0x3f')]=_[_0xe68b('0x3d')](_0x5ef8c4[_0xe68b('0x39')],qs[_0xe68b('0x40')](_0x29b1db[_0xe68b('0x3e')]['fields']));_0x46fc8d['attributes']=_0x46fc8d[_0xe68b('0x3f')][_0xe68b('0x41')]?_0x46fc8d[_0xe68b('0x3f')]:_0x5ef8c4[_0xe68b('0x39')];if(!_0x29b1db[_0xe68b('0x3e')][_0xe68b('0x42')](_0xe68b('0x43'))){_0x46fc8d[_0xe68b('0x23')]=qs[_0xe68b('0x23')](_0x29b1db[_0xe68b('0x3e')][_0xe68b('0x23')]);_0x46fc8d['offset']=qs['offset'](_0x29b1db[_0xe68b('0x3e')]['offset']);}_0x46fc8d['order']=qs[_0xe68b('0x45')](_0x29b1db[_0xe68b('0x3e')][_0xe68b('0x45')]);_0x46fc8d[_0xe68b('0x46')]=qs[_0xe68b('0x3c')](_[_0xe68b('0x5d')](_0x29b1db[_0xe68b('0x3e')],_0x5ef8c4[_0xe68b('0x3c')]));_0x46fc8d[_0xe68b('0x46')]['ListId']=_0x5c7542['id'];if(_0x29b1db[_0xe68b('0x3e')][_0xe68b('0x47')]){_0x46fc8d['where']=_[_0xe68b('0x48')](_0x46fc8d['where'],{'$or':_[_0xe68b('0x3a')](_0x46fc8d[_0xe68b('0x3f')],function(_0x32147d){var _0x1a11b3={};_0x1a11b3[_0x32147d]={'$like':'%'+_0x29b1db[_0xe68b('0x3e')][_0xe68b('0x47')]+'%'};return _0x1a11b3;})});}_0x46fc8d=_[_0xe68b('0x48')]({},_0x46fc8d,_0x29b1db['options']);return db[_0xe68b('0x5a')]['count']({'where':_0x46fc8d[_0xe68b('0x46')]})[_0xe68b('0x2a')](function(_0x5e45ab){_0x5c5bdb[_0xe68b('0x24')]=_0x5e45ab;if(_0x29b1db[_0xe68b('0x3e')][_0xe68b('0x4e')]){_0x46fc8d[_0xe68b('0x4a')]=[{'all':!![]}];}return db[_0xe68b('0x5a')]['findAll'](_0x46fc8d);})[_0xe68b('0x2a')](function(_0x5ea9e3){_0x5c5bdb[_0xe68b('0x5e')]=_0x5ea9e3;return _0x5c5bdb;});}})[_0xe68b('0x2a')](respondWithFilteredResult(_0x3c3ead,_0x46fc8d))[_0xe68b('0x4c')](handleError(_0x3c3ead,null));};exports[_0xe68b('0x5f')]=function(_0x42f345,_0x1f853d,_0x2790df){return db['CmList'][_0xe68b('0x4f')]({'where':{'id':_0x42f345['params']['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x1f853d,null))[_0xe68b('0x2a')](function(_0x24216a){if(_0x24216a){return _0x24216a[_0xe68b('0x5f')](_0x42f345[_0xe68b('0x3e')][_0xe68b('0x60')]);}})[_0xe68b('0x2a')](respondWithStatusCode(_0x1f853d,null))[_0xe68b('0x4c')](handleError(_0x1f853d,null));};exports[_0xe68b('0x61')]=function(_0x3c3c4a,_0x292d84,_0x3e81ed){return db[_0xe68b('0x34')]['find']({'where':{'id':_0x3c3c4a[_0xe68b('0x57')]['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x292d84,null))[_0xe68b('0x2a')](function(_0x455e8d){if(_0x455e8d){var _0x24bd15=[];var _0x56a904={'success':[],'errors':[]};return db[_0xe68b('0x62')]['describe']()[_0xe68b('0x2a')](function(_0x2eb57f){if(_0x3c3c4a[_0xe68b('0x51')][_0xe68b('0x63')]&&_[_0xe68b('0x64')](_0x3c3c4a[_0xe68b('0x51')][_0xe68b('0x63')])){if(_0x3c3c4a[_0xe68b('0x51')][_0xe68b('0x63')][_0xe68b('0x41')]){_0x3c3c4a[_0xe68b('0x51')][_0xe68b('0x63')]=_0x3c3c4a['body'][_0xe68b('0x63')][_0xe68b('0x65')](';')+';';}else{_0x3c3c4a[_0xe68b('0x51')]['tags']=null;}}else{_0x3c3c4a[_0xe68b('0x51')][_0xe68b('0x63')]=null;}if(_0x3c3c4a[_0xe68b('0x51')]&&_[_0xe68b('0x64')](_0x3c3c4a['body'])){for(var _0x29e9a6=0x0;_0x29e9a6<_0x3c3c4a[_0xe68b('0x51')][_0xe68b('0x41')];_0x29e9a6+=0x1){_0x3c3c4a[_0xe68b('0x51')][_0x29e9a6][_0xe68b('0x66')]=_0x3c3c4a[_0xe68b('0x57')]['id'];_0x24bd15[_0xe68b('0x67')](_0x3c3c4a[_0xe68b('0x51')][_0x29e9a6]);}return BPromise[_0xe68b('0x68')](_0x24bd15,function(_0x589189){return db[_0xe68b('0x62')][_0xe68b('0x50')](_[_0xe68b('0x69')](_0x589189,[_0xe68b('0x60'),'id'])||{},{'fields':_[_0xe68b('0x3b')](_0x2eb57f),'raw':!![]})['then'](function(_0x150746){_0x56a904[_0xe68b('0x6a')][_0xe68b('0x67')](_0x150746['dataValues']);})['catch'](function(_0x2d885e){_0x56a904['errors'][_0xe68b('0x67')]({'data':_0x589189,'error':_0x2d885e['message']});});})[_0xe68b('0x2a')](function(_0x259f18){return _0x56a904;})['catch'](function(_0x4f4a92){return _0x4f4a92;});}else{_0x292d84['status'](0x190)[_0xe68b('0x20')]({'message':_0xe68b('0x6b')});}});}})[_0xe68b('0x2a')](respondWithResult(_0x292d84,null))[_0xe68b('0x4c')](handleError(_0x292d84,null));};exports[_0xe68b('0x6c')]=function(_0xee3bd,_0x9fb02f,_0x588e45){var _0x37e586;return db[_0xe68b('0x34')][_0xe68b('0x4f')]({'where':{'id':_0xee3bd[_0xe68b('0x57')]['id']},'include':[{'model':db[_0xe68b('0x6d')],'as':_0xe68b('0x6e')}]})[_0xe68b('0x2a')](handleEntityNotFound(_0x9fb02f,null))['then'](function(_0x3daeaf){if(_0x3daeaf){_0x37e586=_0x3daeaf;return db[_0xe68b('0x62')][_0xe68b('0x35')];}})['then'](function(_0x5f2bee){if(_0x5f2bee){var _0x4f730a={};var _0x508bde={};_0x508bde[_0xe68b('0x39')]=_[_0xe68b('0x6f')](_['keys'](_0x5f2bee),_[_0xe68b('0x3a')](_0x37e586[_0xe68b('0x6e')],function(_0x2c81f4){return util['format'](_0xe68b('0x70'),_0x2c81f4['id']);}));_0x508bde[_0xe68b('0x3e')]=_[_0xe68b('0x3b')](_0xee3bd['query']);_0x508bde[_0xe68b('0x3c')]=_[_0xe68b('0x3d')](_0x508bde[_0xe68b('0x39')],_0x508bde[_0xe68b('0x3e')]);_0x4f730a[_0xe68b('0x3f')]=_[_0xe68b('0x3d')](_0x508bde[_0xe68b('0x39')],qs[_0xe68b('0x40')](_0xee3bd['query'][_0xe68b('0x40')]));_0x4f730a[_0xe68b('0x3f')]=_0x4f730a[_0xe68b('0x3f')]['length']?_0x4f730a['attributes']:_0x508bde['model'];if(!_0xee3bd[_0xe68b('0x3e')]['hasOwnProperty'](_0xe68b('0x43'))){_0x4f730a[_0xe68b('0x23')]=qs['limit'](_0xee3bd[_0xe68b('0x3e')][_0xe68b('0x23')]);_0x4f730a['offset']=qs['offset'](_0xee3bd[_0xe68b('0x3e')][_0xe68b('0x21')]);}_0x4f730a[_0xe68b('0x44')]=qs['sort'](_0xee3bd[_0xe68b('0x3e')]['sort']);_0x4f730a['where']=qs[_0xe68b('0x3c')](_['pick'](_0xee3bd[_0xe68b('0x3e')],_0x508bde[_0xe68b('0x3c')]));_0x4f730a[_0xe68b('0x71')]=!![];if(_0xee3bd[_0xe68b('0x3e')][_0xe68b('0x47')]){_0x4f730a['where']=_[_0xe68b('0x48')](_0x4f730a['where'],{'$or':_[_0xe68b('0x3a')](_0x4f730a[_0xe68b('0x3f')],function(_0x18eb5b){var _0x38bba5={};_0x38bba5[_0x18eb5b]={'$like':'%'+_0xee3bd['query'][_0xe68b('0x47')]+'%'};return _0x38bba5;})});}_0x4f730a=_[_0xe68b('0x48')]({},_0x4f730a,_0xee3bd[_0xe68b('0x49')]);return _0x37e586[_0xe68b('0x6c')](_0x4f730a);}})[_0xe68b('0x2a')](respondWithResult(_0x9fb02f,null))[_0xe68b('0x4c')](handleError(_0x9fb02f,null));};exports[_0xe68b('0x72')]=function(_0x3c7dcb,_0x28ccdd,_0x576bab){var _0x59db5e;return db[_0xe68b('0x34')]['find']({'where':{'id':_0x3c7dcb[_0xe68b('0x57')]['id']},'include':[{'model':db[_0xe68b('0x6d')],'as':_0xe68b('0x6e')}]})[_0xe68b('0x2a')](handleEntityNotFound(_0x28ccdd,null))['then'](function(_0xf69c0e){if(_0xf69c0e){_0x59db5e=_0xf69c0e;return db[_0xe68b('0x62')][_0xe68b('0x35')];}})[_0xe68b('0x2a')](function(_0x4a697f){if(_0x4a697f){var _0x548e30={};var _0x41fc20={};_0x41fc20['model']=_[_0xe68b('0x6f')](_[_0xe68b('0x3b')](_0x4a697f),_[_0xe68b('0x3a')](_0x59db5e[_0xe68b('0x6e')],function(_0xff293a){return util[_0xe68b('0x73')](_0xe68b('0x70'),_0xff293a['id']);}));_0x41fc20[_0xe68b('0x3e')]=_[_0xe68b('0x3b')](_0x3c7dcb[_0xe68b('0x3e')]);_0x41fc20[_0xe68b('0x3c')]=_[_0xe68b('0x3d')](_0x41fc20[_0xe68b('0x39')],_0x41fc20[_0xe68b('0x3e')]);_0x548e30[_0xe68b('0x3f')]=_[_0xe68b('0x3d')](_0x41fc20[_0xe68b('0x39')],qs['fields'](_0x3c7dcb[_0xe68b('0x3e')]['fields']));_0x548e30['attributes']=_0x548e30[_0xe68b('0x3f')][_0xe68b('0x41')]?_0x548e30[_0xe68b('0x3f')]:_0x41fc20[_0xe68b('0x39')];if(!_0x3c7dcb[_0xe68b('0x3e')][_0xe68b('0x42')](_0xe68b('0x43'))){_0x548e30[_0xe68b('0x23')]=qs['limit'](_0x3c7dcb[_0xe68b('0x3e')]['limit']);_0x548e30['offset']=qs['offset'](_0x3c7dcb[_0xe68b('0x3e')][_0xe68b('0x21')]);}_0x548e30[_0xe68b('0x44')]=qs['sort'](_0x3c7dcb['query']['sort']);_0x548e30[_0xe68b('0x46')]=qs[_0xe68b('0x3c')](_[_0xe68b('0x5d')](_0x3c7dcb['query'],_0x41fc20[_0xe68b('0x3c')]));_0x548e30[_0xe68b('0x71')]=!![];if(_0x3c7dcb[_0xe68b('0x3e')][_0xe68b('0x47')]){_0x548e30[_0xe68b('0x46')]=_[_0xe68b('0x48')](_0x548e30[_0xe68b('0x46')],{'$or':_['map'](_0x548e30['attributes'],function(_0x4d1825){var _0x36904b={};_0x36904b[_0x4d1825]={'$like':'%'+_0x3c7dcb[_0xe68b('0x3e')]['filter']+'%'};return _0x36904b;})});}_0x548e30=_['merge']({},_0x548e30,_0x3c7dcb[_0xe68b('0x49')]);return _0x59db5e['getContacts'](_0x548e30);}})[_0xe68b('0x2a')](function(_0x3f2cec){if(!_['isEmpty'](_0x3f2cec)){var _0xe3748b=toCsv(_0x3f2cec);var _0x33a6fc=Date[_0xe68b('0x74')]();fs['writeFileSync'](util['format'](_0xe68b('0x75'),_0x59db5e['id'],_0x33a6fc),_0xe3748b);_0x28ccdd[_0xe68b('0x76')]('Content-disposition',_0xe68b('0x77')+util['format'](_0xe68b('0x78'),_0x59db5e['id'],_0x33a6fc));_0x28ccdd[_0xe68b('0x76')](_0xe68b('0x79'),_0xe68b('0x7a'));return _0x28ccdd['download'](util['format']('/tmp/list_%d_%s.csv',_0x59db5e['id'],_0x33a6fc));}else{return _0x28ccdd[_0xe68b('0x1e')](0xcc);}})['catch'](handleError(_0x28ccdd,null));};exports[_0xe68b('0x7b')]=function(_0x2e8e85,_0x60bd02,_0x561fd1){var _0x298df4;delete _0x2e8e85[_0xe68b('0x51')]['id'];return db[_0xe68b('0x34')][_0xe68b('0x5c')]({'where':{'id':_0x2e8e85['params']['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x60bd02,null))['then'](function(_0x4b439a){if(_0x4b439a){return db[_0xe68b('0x7c')]['transaction'](function(_0x588a5d){return db[_0xe68b('0x6d')][_0xe68b('0x50')](_0x2e8e85[_0xe68b('0x51')],{'transaction':_0x588a5d})[_0xe68b('0x2a')](function(_0x5cc8f6){_0x298df4=_0x5cc8f6;return _0x4b439a['addCustomFields'](_0x5cc8f6,{'transaction':_0x588a5d});})[_0xe68b('0x2a')](function(){var _0x4418e8={'type':db[_0xe68b('0x7d')]['TEXT'],'transaction':_0x588a5d};switch(_0x2e8e85[_0xe68b('0x51')][_0xe68b('0x37')]){case _0xe68b('0x7e'):_0x4418e8[_0xe68b('0x37')]=db[_0xe68b('0x7d')][_0xe68b('0x7f')];break;case'number':_0x4418e8[_0xe68b('0x37')]=db['Sequelize']['INTEGER'];break;case _0xe68b('0x80'):_0x4418e8[_0xe68b('0x37')]=db[_0xe68b('0x7d')][_0xe68b('0x81')];_0x4418e8[_0xe68b('0x82')]=![];break;default:}return db[_0xe68b('0x7c')][_0xe68b('0x83')][_0xe68b('0x84')](_0xe68b('0x85'),util['format']('cf_%s',_0x298df4['id']),_0x4418e8);})[_0xe68b('0x2a')](function(){return _0x298df4;});});}})['then'](respondWithResult(_0x60bd02,null))[_0xe68b('0x4c')](handleError(_0x60bd02,null));};exports[_0xe68b('0x86')]=function(_0x5546a0,_0x1cbace,_0x49cd58){var _0x4d61a1={};var _0x467fd6={};var _0x494d67;var _0x23c1ef;return db[_0xe68b('0x34')]['findOne']({'where':{'id':_0x5546a0[_0xe68b('0x57')]['id']}})['then'](handleEntityNotFound(_0x1cbace,null))[_0xe68b('0x2a')](function(_0x4908ae){if(_0x4908ae){_0x494d67=_0x4908ae;_0x467fd6[_0xe68b('0x39')]=_['keys'](db[_0xe68b('0x6d')]['rawAttributes']);_0x467fd6['query']=_[_0xe68b('0x3b')](_0x5546a0[_0xe68b('0x3e')]);_0x467fd6[_0xe68b('0x3c')]=_[_0xe68b('0x3d')](_0x467fd6['model'],_0x467fd6[_0xe68b('0x3e')]);_0x4d61a1[_0xe68b('0x3f')]=_['intersection'](_0x467fd6[_0xe68b('0x39')],qs[_0xe68b('0x40')](_0x5546a0[_0xe68b('0x3e')][_0xe68b('0x40')]));_0x4d61a1[_0xe68b('0x3f')]=_0x4d61a1[_0xe68b('0x3f')][_0xe68b('0x41')]?_0x4d61a1[_0xe68b('0x3f')]:_0x467fd6[_0xe68b('0x39')];_0x4d61a1[_0xe68b('0x44')]=qs[_0xe68b('0x45')](_0x5546a0['query'][_0xe68b('0x45')]);_0x4d61a1[_0xe68b('0x46')]=qs[_0xe68b('0x3c')](_[_0xe68b('0x5d')](_0x5546a0[_0xe68b('0x3e')],_0x467fd6[_0xe68b('0x3c')]));_0x4d61a1[_0xe68b('0x46')]=_[_0xe68b('0x48')](_0x4d61a1[_0xe68b('0x46')],{'$or':[{'ListId':_0x4908ae['id']},{'ListId':null}]});if(_0x5546a0[_0xe68b('0x3e')][_0xe68b('0x47')]){_0x4d61a1[_0xe68b('0x46')]=_[_0xe68b('0x48')](_0x4d61a1[_0xe68b('0x46')],{'$or':_[_0xe68b('0x3a')](_0x4d61a1[_0xe68b('0x3f')],function(_0x1dba9b){var _0x125b3f={};_0x125b3f[_0x1dba9b]={'$like':'%'+_0x5546a0[_0xe68b('0x3e')][_0xe68b('0x47')]+'%'};return _0x125b3f;})});}_0x4d61a1=_[_0xe68b('0x48')]({},_0x4d61a1,_0x5546a0[_0xe68b('0x49')]);return db[_0xe68b('0x6d')][_0xe68b('0x87')](_0x4d61a1);}})[_0xe68b('0x2a')](respondWithResult(_0x1cbace,null))[_0xe68b('0x4c')](handleError(_0x1cbace,null));};exports[_0xe68b('0x88')]=function(_0x3014e7,_0x4bb507,_0x3d7b7b){return db[_0xe68b('0x34')][_0xe68b('0x4f')]({'where':{'id':_0x3014e7['params']['id']}})['then'](handleEntityNotFound(_0x4bb507,null))['then'](function(_0x421bd2){if(_0x421bd2){return _0x421bd2[_0xe68b('0x88')](_0x3014e7[_0xe68b('0x51')][_0xe68b('0x60')],_['omit'](_0x3014e7[_0xe68b('0x51')],['ids','id'])||{})[_0xe68b('0x89')](function(_0x4491bb){for(var _0x15a98c=0x0;_0x15a98c<_0x3014e7[_0xe68b('0x51')][_0xe68b('0x60')][_0xe68b('0x41')];_0x15a98c+=0x1){socket['emit'](_0xe68b('0x8a'),{'UserId':Number(_0x3014e7[_0xe68b('0x51')][_0xe68b('0x60')][_0x15a98c]),'CmListId':Number(_0x3014e7[_0xe68b('0x57')]['id'])});}return _0x4491bb;});}})[_0xe68b('0x2a')](respondWithResult(_0x4bb507,null))['catch'](handleError(_0x4bb507,null));};exports['removeAgents']=function(_0x2cd16d,_0x4b3108,_0x59e01d){return db[_0xe68b('0x34')][_0xe68b('0x4f')]({'where':{'id':_0x2cd16d[_0xe68b('0x57')]['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x4b3108,null))['then'](function(_0x3fd4d3){if(_0x3fd4d3){return _0x3fd4d3[_0xe68b('0x8b')](_0x2cd16d[_0xe68b('0x3e')]['ids'])[_0xe68b('0x2a')](function(){if(_[_0xe68b('0x64')](_0x2cd16d['query'][_0xe68b('0x60')])){for(var _0x2ca5c6=0x0;_0x2ca5c6<_0x2cd16d['query'][_0xe68b('0x60')][_0xe68b('0x41')];_0x2ca5c6+=0x1){socket[_0xe68b('0x8c')]('userCmList:remove',{'UserId':Number(_0x2cd16d[_0xe68b('0x3e')][_0xe68b('0x60')][_0x2ca5c6]),'CmListId':Number(_0x2cd16d[_0xe68b('0x57')]['id'])});}}else{socket[_0xe68b('0x8c')](_0xe68b('0x8d'),{'UserId':Number(_0x2cd16d[_0xe68b('0x3e')][_0xe68b('0x60')]),'CmListId':Number(_0x2cd16d[_0xe68b('0x57')]['id'])});}});}})[_0xe68b('0x2a')](respondWithStatusCode(_0x4b3108,null))[_0xe68b('0x4c')](handleError(_0x4b3108,null));};exports[_0xe68b('0x8e')]=function(_0x2c8ee9,_0x24b18c,_0x5b1f93){var _0x5cee61={};var _0x567e7e={};var _0x425393;var _0x11c710;return db[_0xe68b('0x34')][_0xe68b('0x5c')]({'where':{'id':_0x2c8ee9[_0xe68b('0x57')]['id']}})[_0xe68b('0x2a')](handleEntityNotFound(_0x24b18c,null))[_0xe68b('0x2a')](function(_0x4fe49e){if(_0x4fe49e){_0x425393=_0x4fe49e;_0x567e7e[_0xe68b('0x39')]=_[_0xe68b('0x3b')](db[_0xe68b('0x8f')]['rawAttributes']);_0x567e7e[_0xe68b('0x3e')]=_['keys'](_0x2c8ee9[_0xe68b('0x3e')]);_0x567e7e['filters']=_[_0xe68b('0x3d')](_0x567e7e[_0xe68b('0x39')],_0x567e7e[_0xe68b('0x3e')]);_0x5cee61[_0xe68b('0x3f')]=_[_0xe68b('0x3d')](_0x567e7e[_0xe68b('0x39')],qs[_0xe68b('0x40')](_0x2c8ee9[_0xe68b('0x3e')][_0xe68b('0x40')]));_0x5cee61[_0xe68b('0x3f')]=_0x5cee61[_0xe68b('0x3f')][_0xe68b('0x41')]?_0x5cee61[_0xe68b('0x3f')]:_0x567e7e['model'];_0x5cee61[_0xe68b('0x44')]=qs[_0xe68b('0x45')](_0x2c8ee9[_0xe68b('0x3e')][_0xe68b('0x45')]);_0x5cee61['where']=qs[_0xe68b('0x3c')](_[_0xe68b('0x5d')](_0x2c8ee9[_0xe68b('0x3e')],_0x567e7e[_0xe68b('0x3c')]));if(_0x2c8ee9['query'][_0xe68b('0x47')]){_0x5cee61[_0xe68b('0x46')]=_[_0xe68b('0x48')](_0x5cee61['where'],{'$or':_['map'](_0x5cee61[_0xe68b('0x3f')],function(_0x724ebf){var _0x13060d={};_0x13060d[_0x724ebf]={'$like':'%'+_0x2c8ee9['query'][_0xe68b('0x47')]+'%'};return _0x13060d;})});}_0x5cee61=_[_0xe68b('0x48')]({},_0x5cee61,_0x2c8ee9[_0xe68b('0x49')]);return _0x425393[_0xe68b('0x8e')](_0x5cee61);}})[_0xe68b('0x2a')](function(_0x18eedd){if(_0x18eedd){_0x11c710=_0x18eedd[_0xe68b('0x41')];if(!_0x2c8ee9[_0xe68b('0x3e')][_0xe68b('0x42')](_0xe68b('0x43'))){_0x5cee61[_0xe68b('0x23')]=qs[_0xe68b('0x23')](_0x2c8ee9[_0xe68b('0x3e')][_0xe68b('0x23')]);_0x5cee61['offset']=qs[_0xe68b('0x21')](_0x2c8ee9[_0xe68b('0x3e')][_0xe68b('0x21')]);}return _0x425393[_0xe68b('0x8e')](_0x5cee61);}})[_0xe68b('0x2a')](function(_0x38f1d1){if(_0x38f1d1){return _0x38f1d1?{'count':_0x11c710,'rows':_0x38f1d1}:null;}})[_0xe68b('0x2a')](respondWithResult(_0x24b18c,null))['catch'](handleError(_0x24b18c,null));};
\ No newline at end of file
index cd8add8..8c2a65d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe14b,0x93));var _0xbe14=function(_0x48d5da,_0x2c85e4){_0x48d5da=_0x48d5da-0x0;var _0x5ab43b=_0xe14b[_0x48d5da];return _0x5ab43b;};'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
+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(_0x1c1244,_0x115639){_0x1c1244=_0x1c1244-0x0;var _0x3627ab=_0xe14b[_0x1c1244];return _0x3627ab;};'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 25f6caf..e239a9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','lodash','api','moment','bluebird'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xa75b,0x170));var _0xba75=function(_0x3b458a,_0x560793){_0x3b458a=_0x3b458a-0x0;var _0x318125=_0xa75b[_0x3b458a];return _0x318125;};'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
+var _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','define','CmList','cm_lists','lodash'];(function(_0x23b741,_0x4263e7){var _0x4a5f08=function(_0x11cef2){while(--_0x11cef2){_0x23b741['push'](_0x23b741['shift']());}};_0x4a5f08(++_0x4263e7);}(_0xda55,0x6d));var _0x5da5=function(_0x291b7e,_0x1d92d6){_0x291b7e=_0x291b7e-0x0;var _0x502780=_0xda55[_0x291b7e];return _0x502780;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5ace9e0..6cfda67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23fd=['client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x23fd,0x121));var _0xd23f=function(_0x32dfdb,_0x5b9400){_0x32dfdb=_0x32dfdb-0x0;var _0xec9630=_0x23fd[_0x32dfdb];return _0xec9630;};'use strict';var _=require(_0xd23f('0x0'));var util=require(_0xd23f('0x1'));var moment=require(_0xd23f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd23f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd23f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd23f('0x5'))(_0xd23f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd23f('0x7'));var client=jayson[_0xd23f('0x8')][_0xd23f('0x9')]({'port':0x232a});config[_0xd23f('0xa')]=_[_0xd23f('0xb')](config[_0xd23f('0xa')],{'host':_0xd23f('0xc'),'port':0x18eb});var socket=require(_0xd23f('0xd'))(new Redis(config[_0xd23f('0xa')]));require(_0xd23f('0xe'))[_0xd23f('0xf')](socket);function respondWithRpcPromise(_0x17b0f1,_0x587fd9,_0x46efe8){return new BPromise(function(_0x4cad32,_0x9358d7){return client[_0xd23f('0x10')](_0x17b0f1,_0x46efe8)[_0xd23f('0x11')](function(_0x2233eb){logger['info'](_0xd23f('0x12'),_0x587fd9,'request\x20sent');logger[_0xd23f('0x13')](_0xd23f('0x14'),_0x587fd9,_0xd23f('0x15'),JSON[_0xd23f('0x16')](_0x2233eb));if(_0x2233eb['error']){if(_0x2233eb[_0xd23f('0x17')][_0xd23f('0x18')]===0x1f4){logger[_0xd23f('0x17')](_0xd23f('0x12'),_0x587fd9,_0x2233eb[_0xd23f('0x17')][_0xd23f('0x19')]);return _0x9358d7(_0x2233eb[_0xd23f('0x17')][_0xd23f('0x19')]);}logger[_0xd23f('0x17')](_0xd23f('0x12'),_0x587fd9,_0x2233eb[_0xd23f('0x17')][_0xd23f('0x19')]);return _0x4cad32(_0x2233eb[_0xd23f('0x17')][_0xd23f('0x19')]);}else{logger[_0xd23f('0x1a')](_0xd23f('0x12'),_0x587fd9,_0xd23f('0x15'));_0x4cad32(_0x2233eb['result'][_0xd23f('0x19')]);}})['catch'](function(_0x104bdd){logger[_0xd23f('0x17')]('CmList,\x20%s,\x20%s',_0x587fd9,_0x104bdd);_0x9358d7(_0x104bdd);});});}
\ No newline at end of file
+var _0xc89a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xc89a,0x1b7));var _0xac89=function(_0x5c96b7,_0x3ee933){_0x5c96b7=_0x5c96b7-0x0;var _0x5e7415=_0xc89a[_0x5c96b7];return _0x5e7415;};'use strict';var _=require('lodash');var util=require(_0xac89('0x0'));var moment=require(_0xac89('0x1'));var BPromise=require(_0xac89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac89('0x3'));var db=require(_0xac89('0x4'))['db'];var utils=require(_0xac89('0x5'));var logger=require('../../config/logger')(_0xac89('0x6'));var config=require(_0xac89('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xac89('0x8')][_0xac89('0x9')]({'port':0x232a});config[_0xac89('0xa')]=_[_0xac89('0xb')](config[_0xac89('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xac89('0xc'))(new Redis(config[_0xac89('0xa')]));require(_0xac89('0xd'))[_0xac89('0xe')](socket);function respondWithRpcPromise(_0x1d15cf,_0x512644,_0xae35ce){return new BPromise(function(_0x460680,_0x297286){return client[_0xac89('0xf')](_0x1d15cf,_0xae35ce)['then'](function(_0x52a88b){logger['info'](_0xac89('0x10'),_0x512644,_0xac89('0x11'));logger[_0xac89('0x12')](_0xac89('0x13'),_0x512644,_0xac89('0x11'),JSON[_0xac89('0x14')](_0x52a88b));if(_0x52a88b['error']){if(_0x52a88b[_0xac89('0x15')]['code']===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x512644,_0x52a88b['error'][_0xac89('0x16')]);return _0x297286(_0x52a88b[_0xac89('0x15')][_0xac89('0x16')]);}logger[_0xac89('0x15')](_0xac89('0x10'),_0x512644,_0x52a88b[_0xac89('0x15')][_0xac89('0x16')]);return _0x460680(_0x52a88b[_0xac89('0x15')][_0xac89('0x16')]);}else{logger[_0xac89('0x17')](_0xac89('0x10'),_0x512644,'request\x20sent');_0x460680(_0x52a88b[_0xac89('0x18')]['message']);}})[_0xac89('0x19')](function(_0x273d49){logger[_0xac89('0x15')]('CmList,\x20%s,\x20%s',_0x512644,_0x273d49);_0x297286(_0x273d49);});});}
\ No newline at end of file
index 06d383c..fc1cb4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x815a=['./cmList.events','save','remove','update','removeListener','register','length','cmList:'];(function(_0x4e2db8,_0x145135){var _0x4231f6=function(_0x4f583c){while(--_0x4f583c){_0x4e2db8['push'](_0x4e2db8['shift']());}};_0x4231f6(++_0x145135);}(_0x815a,0x170));var _0xa815=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x815a[_0x36dfbd];return _0x4ecad9;};'use strict';var CmListEvents=require(_0xa815('0x0'));var events=[_0xa815('0x1'),_0xa815('0x2'),_0xa815('0x3')];function createListener(_0x3af0fa,_0x382281){return function(_0x44dc44){_0x382281['emit'](_0x3af0fa,_0x44dc44);};}function removeListener(_0x2c5c93,_0x2ca4d2){return function(){CmListEvents[_0xa815('0x4')](_0x2c5c93,_0x2ca4d2);};}exports[_0xa815('0x5')]=function(_0x567876){for(var _0x2785b0=0x0,_0x210b21=events[_0xa815('0x6')];_0x2785b0<_0x210b21;_0x2785b0++){var _0x32477c=events[_0x2785b0];var _0x8edc8d=createListener(_0xa815('0x7')+_0x32477c,_0x567876);CmListEvents['on'](_0x32477c,_0x8edc8d);}};
\ No newline at end of file
+var _0xe8e7=['cmList:','./cmList.events','save','remove','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe8e7,0x161));var _0x7e8e=function(_0x4b5bfa,_0x5b91b5){_0x4b5bfa=_0x4b5bfa-0x0;var _0x1fa4ff=_0xe8e7[_0x4b5bfa];return _0x1fa4ff;};'use strict';var CmListEvents=require(_0x7e8e('0x0'));var events=[_0x7e8e('0x1'),_0x7e8e('0x2'),_0x7e8e('0x3')];function createListener(_0x4c5835,_0x42446a){return function(_0xf31630){_0x42446a[_0x7e8e('0x4')](_0x4c5835,_0xf31630);};}function removeListener(_0x5843d7,_0x3d6b04){return function(){CmListEvents[_0x7e8e('0x5')](_0x5843d7,_0x3d6b04);};}exports[_0x7e8e('0x6')]=function(_0x89d2){for(var _0x53d88e=0x0,_0x32c48d=events['length'];_0x53d88e<_0x32c48d;_0x53d88e++){var _0x4a8708=events[_0x53d88e];var _0x3fe47=createListener(_0x7e8e('0x7')+_0x4a8708,_0x89d2);CmListEvents['on'](_0x4a8708,_0x3fe47);}};
\ No newline at end of file
index 0b9ec5a..e84fd7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02fd=['path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','create','addDisposition','/:id/contacts','addContacts','/:id/fields','addAgents','put','update','delete','removeDispositions','/:id/users','removeAgents','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x02fd,0x1b1));var _0xd02f=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x02fd[_0x15c421];return _0x5e5ed5;};'use strict';var multer=require('multer');var util=require(_0xd02f('0x0'));var path=require(_0xd02f('0x1'));var timeout=require(_0xd02f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd02f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd02f('0x4'));var config=require(_0xd02f('0x5'));var controller=require(_0xd02f('0x6'));router[_0xd02f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd02f('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd02f('0x8')]);router[_0xd02f('0x7')](_0xd02f('0x9'),auth[_0xd02f('0xa')](),controller[_0xd02f('0xb')]);router[_0xd02f('0x7')](_0xd02f('0xc'),auth[_0xd02f('0xa')](),controller['getDispositions']);router[_0xd02f('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller['getContacts']);router[_0xd02f('0x7')](_0xd02f('0xd'),auth[_0xd02f('0xa')](),controller[_0xd02f('0xe')]);router[_0xd02f('0x7')]('/:id/fields',auth[_0xd02f('0xa')](),controller[_0xd02f('0xf')]);router[_0xd02f('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xd02f('0x10')]);router[_0xd02f('0x11')]('/',auth['isAuthenticated'](),controller[_0xd02f('0x12')]);router[_0xd02f('0x11')](_0xd02f('0xc'),auth['isAuthenticated'](),controller[_0xd02f('0x13')]);router[_0xd02f('0x11')](_0xd02f('0x14'),auth[_0xd02f('0xa')](),controller[_0xd02f('0x15')]);router[_0xd02f('0x11')](_0xd02f('0x16'),auth['isAuthenticated'](),controller['addCustomField']);router[_0xd02f('0x11')]('/:id/users',auth[_0xd02f('0xa')](),controller[_0xd02f('0x17')]);router[_0xd02f('0x18')](_0xd02f('0x9'),auth[_0xd02f('0xa')](),controller[_0xd02f('0x19')]);router['delete'](_0xd02f('0x9'),auth[_0xd02f('0xa')](),controller['destroy']);router[_0xd02f('0x1a')]('/:id/dispositions',auth[_0xd02f('0xa')](),controller[_0xd02f('0x1b')]);router[_0xd02f('0x1a')](_0xd02f('0x1c'),auth[_0xd02f('0xa')](),controller[_0xd02f('0x1d')]);module[_0xd02f('0x1e')]=router;
\ No newline at end of file
+var _0x0e95=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','/:id/dispositions','addDisposition','addCustomField','put','/:id','update','destroy','delete','removeDispositions','/:id/users','removeAgents','exports','path'];(function(_0x489412,_0x29a8bd){var _0x3e0efc=function(_0x3446f9){while(--_0x3446f9){_0x489412['push'](_0x489412['shift']());}};_0x3e0efc(++_0x29a8bd);}(_0x0e95,0x180));var _0x50e9=function(_0x29203b,_0x213a4e){_0x29203b=_0x29203b-0x0;var _0x155ee6=_0x0e95[_0x29203b];return _0x155ee6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x50e9('0x0'));var timeout=require(_0x50e9('0x1'));var express=require('express');var router=express[_0x50e9('0x2')]();var fs_extra=require(_0x50e9('0x3'));var auth=require(_0x50e9('0x4'));var interaction=require(_0x50e9('0x5'));var config=require(_0x50e9('0x6'));var controller=require(_0x50e9('0x7'));router[_0x50e9('0x8')]('/',auth[_0x50e9('0x9')](),controller[_0x50e9('0xa')]);router['get'](_0x50e9('0xb'),auth[_0x50e9('0x9')](),controller[_0x50e9('0xc')]);router[_0x50e9('0x8')]('/:id',auth[_0x50e9('0x9')](),controller[_0x50e9('0xd')]);router[_0x50e9('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x50e9('0xe')]);router[_0x50e9('0x8')](_0x50e9('0xf'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x10')]);router[_0x50e9('0x8')](_0x50e9('0x11'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x12')]);router['get'](_0x50e9('0x13'),auth['isAuthenticated'](),controller[_0x50e9('0x14')]);router['get']('/:id/users',auth[_0x50e9('0x9')](),controller['getAgents']);router[_0x50e9('0x15')]('/',auth['isAuthenticated'](),controller[_0x50e9('0x16')]);router[_0x50e9('0x15')](_0x50e9('0x17'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x18')]);router[_0x50e9('0x15')](_0x50e9('0xf'),auth[_0x50e9('0x9')](),controller['addContacts']);router[_0x50e9('0x15')](_0x50e9('0x13'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x19')]);router[_0x50e9('0x15')]('/:id/users',auth[_0x50e9('0x9')](),controller['addAgents']);router[_0x50e9('0x1a')](_0x50e9('0x1b'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x1c')]);router['delete'](_0x50e9('0x1b'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x1d')]);router[_0x50e9('0x1e')](_0x50e9('0x17'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x1f')]);router[_0x50e9('0x1e')](_0x50e9('0x20'),auth[_0x50e9('0x9')](),controller[_0x50e9('0x21')]);module[_0x50e9('0x22')]=router;
\ No newline at end of file
index 75243b7..eb7590e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7eb=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xd7eb,0x66));var _0xbd7e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xd7eb[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require(_0xbd7e('0x0'));module[_0xbd7e('0x1')]={'name':{'type':Sequelize[_0xbd7e('0x2')],'get':function(_0x2ccbc2){return this[_0xbd7e('0x3')](_0xbd7e('0x4'));}},'field':{'type':Sequelize[_0xbd7e('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x3446=['exports','field','STRING','sequelize'];(function(_0x38eef7,_0xbf9a1c){var _0xef6a54=function(_0x51b978){while(--_0x51b978){_0x38eef7['push'](_0x38eef7['shift']());}};_0xef6a54(++_0xbf9a1c);}(_0x3446,0x163));var _0x6344=function(_0x15db01,_0x9e5282){_0x15db01=_0x15db01-0x0;var _0x2ae8d9=_0x3446[_0x15db01];return _0x2ae8d9;};'use strict';var Sequelize=require(_0x6344('0x0'));module[_0x6344('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x493100){return this['getDataValue'](_0x6344('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x6344('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x6344('0x3')],'allowNull':![]}};
\ No newline at end of file
index 4847910..e04b770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x35555d,_0xe36793){var _0x1a7609=function(_0x599e9a){while(--_0x599e9a){_0x35555d['push'](_0x35555d['shift']());}};_0x1a7609(++_0xe36793);}(_0x7a54,0x106));var _0x47a5=function(_0x2a1965,_0x5b39d3){_0x2a1965=_0x2a1965-0x0;var _0x40b7e6=_0x7a54[_0x2a1965];return _0x40b7e6;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4a9846,_0x309459){var _0x8c8c10=function(_0x38d4ab){while(--_0x38d4ab){_0x4a9846['push'](_0x4a9846['shift']());}};_0x8c8c10(++_0x309459);}(_0x7a54,0x106));var _0x47a5=function(_0xa8924,_0x3443c9){_0xa8924=_0xa8924-0x0;var _0x153d5a=_0x7a54[_0xa8924];return _0x153d5a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index 0edcfaf..86cb953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x673d=['../../config/logger','api','bluebird','path','./condition.attributes','exports','Condition','tools_conditions','lodash','util'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x673d,0xda));var _0xd673=function(_0x43f9fd,_0x3bb23c){_0x43f9fd=_0x43f9fd-0x0;var _0x15360e=_0x673d[_0x43f9fd];return _0x15360e;};'use strict';var _=require(_0xd673('0x0'));var util=require(_0xd673('0x1'));var logger=require(_0xd673('0x2'))(_0xd673('0x3'));var moment=require('moment');var BPromise=require(_0xd673('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd673('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd673('0x6'));module[_0xd673('0x7')]=function(_0x2fb0e8,_0x33392b){return _0x2fb0e8['define'](_0xd673('0x8'),attributes,{'tableName':_0xd673('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e05=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','lodash'];(function(_0x2f9984,_0x571593){var _0x158a6e=function(_0x58dc20){while(--_0x58dc20){_0x2f9984['push'](_0x2f9984['shift']());}};_0x158a6e(++_0x571593);}(_0x4e05,0x10f));var _0x54e0=function(_0x38ea38,_0x58f0e0){_0x38ea38=_0x38ea38-0x0;var _0x2a5b36=_0x4e05[_0x38ea38];return _0x2a5b36;};'use strict';var _=require(_0x54e0('0x0'));var util=require('util');var logger=require(_0x54e0('0x1'))(_0x54e0('0x2'));var moment=require('moment');var BPromise=require(_0x54e0('0x3'));var rp=require(_0x54e0('0x4'));var fs=require('fs');var path=require(_0x54e0('0x5'));var rimraf=require('rimraf');var config=require(_0x54e0('0x6'));var attributes=require('./condition.attributes');module['exports']=function(_0x6cc7f,_0x1443cd){return _0x6cc7f[_0x54e0('0x7')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 65eac2e..f6a97dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbf8=['error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4628c6,_0x212c5e){var _0x181ddc=function(_0x36280a){while(--_0x36280a){_0x4628c6['push'](_0x4628c6['shift']());}};_0x181ddc(++_0x212c5e);}(_0xcbf8,0x18c));var _0x8cbf=function(_0x4dbc46,_0x576c7c){_0x4dbc46=_0x4dbc46-0x0;var _0x54fa06=_0xcbf8[_0x4dbc46];return _0x54fa06;};'use strict';var _=require(_0x8cbf('0x0'));var util=require(_0x8cbf('0x1'));var moment=require(_0x8cbf('0x2'));var BPromise=require(_0x8cbf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8cbf('0x4'));var db=require(_0x8cbf('0x5'))['db'];var utils=require(_0x8cbf('0x6'));var logger=require(_0x8cbf('0x7'))(_0x8cbf('0x8'));var config=require(_0x8cbf('0x9'));var jayson=require(_0x8cbf('0xa'));var client=jayson[_0x8cbf('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x457c5c,_0xcc63bf,_0x3396f3){return new BPromise(function(_0x50b196,_0x5505f5){return client[_0x8cbf('0xc')](_0x457c5c,_0x3396f3)['then'](function(_0x296a18){logger['info'](_0x8cbf('0xd'),_0xcc63bf,_0x8cbf('0xe'));logger[_0x8cbf('0xf')](_0x8cbf('0x10'),_0xcc63bf,_0x8cbf('0xe'),JSON[_0x8cbf('0x11')](_0x296a18));if(_0x296a18['error']){if(_0x296a18[_0x8cbf('0x12')][_0x8cbf('0x13')]===0x1f4){logger[_0x8cbf('0x12')](_0x8cbf('0xd'),_0xcc63bf,_0x296a18[_0x8cbf('0x12')][_0x8cbf('0x14')]);return _0x5505f5(_0x296a18['error'][_0x8cbf('0x14')]);}logger[_0x8cbf('0x12')](_0x8cbf('0xd'),_0xcc63bf,_0x296a18[_0x8cbf('0x12')][_0x8cbf('0x14')]);return _0x50b196(_0x296a18[_0x8cbf('0x12')][_0x8cbf('0x14')]);}else{logger['info'](_0x8cbf('0xd'),_0xcc63bf,'request\x20sent');_0x50b196(_0x296a18[_0x8cbf('0x15')][_0x8cbf('0x14')]);}})[_0x8cbf('0x16')](function(_0x212222){logger[_0x8cbf('0x12')](_0x8cbf('0xd'),_0xcc63bf,_0x212222);_0x5505f5(_0x212222);});});}
\ No newline at end of file
+var _0xc43e=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x32738a,_0x2f4dcd){var _0x404c12=function(_0x2958cb){while(--_0x2958cb){_0x32738a['push'](_0x32738a['shift']());}};_0x404c12(++_0x2f4dcd);}(_0xc43e,0xd2));var _0xec43=function(_0x4db706,_0x4f0b84){_0x4db706=_0x4db706-0x0;var _0x396387=_0xc43e[_0x4db706];return _0x396387;};'use strict';var _=require(_0xec43('0x0'));var util=require('util');var moment=require(_0xec43('0x1'));var BPromise=require('bluebird');var rs=require(_0xec43('0x2'));var fs=require('fs');var Redis=require(_0xec43('0x3'));var db=require(_0xec43('0x4'))['db'];var utils=require(_0xec43('0x5'));var logger=require(_0xec43('0x6'))(_0xec43('0x7'));var config=require(_0xec43('0x8'));var jayson=require(_0xec43('0x9'));var client=jayson[_0xec43('0xa')][_0xec43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4973cf,_0x1bc027,_0x36faf4){return new BPromise(function(_0x2ba23c,_0xc508a){return client[_0xec43('0xc')](_0x4973cf,_0x36faf4)['then'](function(_0x29ca7a){logger['info'](_0xec43('0xd'),_0x1bc027,'request\x20sent');logger[_0xec43('0xe')](_0xec43('0xf'),_0x1bc027,_0xec43('0x10'),JSON[_0xec43('0x11')](_0x29ca7a));if(_0x29ca7a[_0xec43('0x12')]){if(_0x29ca7a[_0xec43('0x12')][_0xec43('0x13')]===0x1f4){logger[_0xec43('0x12')](_0xec43('0xd'),_0x1bc027,_0x29ca7a[_0xec43('0x12')][_0xec43('0x14')]);return _0xc508a(_0x29ca7a[_0xec43('0x12')]['message']);}logger[_0xec43('0x12')]('Condition,\x20%s,\x20%s',_0x1bc027,_0x29ca7a['error'][_0xec43('0x14')]);return _0x2ba23c(_0x29ca7a[_0xec43('0x12')][_0xec43('0x14')]);}else{logger['info'](_0xec43('0xd'),_0x1bc027,'request\x20sent');_0x2ba23c(_0x29ca7a[_0xec43('0x15')]['message']);}})[_0xec43('0x16')](function(_0x5e925c){logger[_0xec43('0x12')](_0xec43('0xd'),_0x1bc027,_0x5e925c);_0xc508a(_0x5e925c);});});}
\ No newline at end of file
index 739ca98..44e394b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a0e=['delete','destroy','util','path','express','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a0e,0x199));var _0xe7a0=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7a0e[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require('multer');var util=require(_0xe7a0('0x0'));var path=require(_0xe7a0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe7a0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe7a0('0x3'));var controller=require(_0xe7a0('0x4'));router[_0xe7a0('0x5')](_0xe7a0('0x6'),auth[_0xe7a0('0x7')](),controller[_0xe7a0('0x8')]);router[_0xe7a0('0x9')](_0xe7a0('0x6'),auth[_0xe7a0('0x7')](),controller[_0xe7a0('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0x1f33=['isAuthenticated','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x1f33,0xd2));var _0x31f3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1f33[_0x3e5086];return _0xfeb102;};'use strict';var multer=require(_0x31f3('0x0'));var util=require(_0x31f3('0x1'));var path=require('path');var timeout=require(_0x31f3('0x2'));var express=require(_0x31f3('0x3'));var router=express[_0x31f3('0x4')]();var fs_extra=require(_0x31f3('0x5'));var auth=require(_0x31f3('0x6'));var interaction=require(_0x31f3('0x7'));var config=require(_0x31f3('0x8'));var controller=require('./condition.controller');router['put'](_0x31f3('0x9'),auth[_0x31f3('0xa')](),controller['update']);router['delete'](_0x31f3('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 3fbba9a..d311a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['name','exports','STRING'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x45ebb3,_0x216bbe){var _0x16f48c=function(_0x289c42){while(--_0x289c42){_0x45ebb3['push'](_0x45ebb3['shift']());}};_0x16f48c(++_0x216bbe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 0985f74..142d794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6829=['attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','name','send','index','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','Dashboard','include','rows','show','params','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','options','omit','createdAt','updatedAt','attrUrl','attrs','https://','custom','attrPath','value','clock'];(function(_0x59ee9c,_0x43f62d){var _0x44a2a8=function(_0x5b2c33){while(--_0x5b2c33){_0x59ee9c['push'](_0x59ee9c['shift']());}};_0x44a2a8(++_0x43f62d);}(_0x6829,0x178));var _0x9682=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x6829[_0x36eaaa];return _0x461349;};'use strict';var emlformat=require(_0x9682('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9682('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9682('0x2'));var moment=require(_0x9682('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9682('0x4'));var util=require(_0x9682('0x5'));var path=require('path');var sox=require(_0x9682('0x6'));var csv=require(_0x9682('0x7'));var ejs=require(_0x9682('0x8'));var fs=require('fs');var fs_extra=require(_0x9682('0x9'));var _=require('lodash');var squel=require(_0x9682('0xa'));var crypto=require('crypto');var jsforce=require(_0x9682('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9682('0x7'));var querystring=require(_0x9682('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9682('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x9682('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9682('0xf'))(_0x9682('0x10'));var utils=require('../../config/utils');var config=require(_0x9682('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9682('0x12'))['db'];config[_0x9682('0x13')]=_[_0x9682('0x14')](config[_0x9682('0x13')],{'host':_0x9682('0x15'),'port':0x18eb});var socket=require(_0x9682('0x16'))(new Redis(config['redis']));require(_0x9682('0x17'))['register'](socket);function respondWithStatusCode(_0x6f5fdb,_0x198aae){_0x198aae=_0x198aae||0xcc;return function(_0x2c38c1){if(_0x2c38c1){return _0x6f5fdb[_0x9682('0x18')](_0x198aae);}return _0x6f5fdb[_0x9682('0x19')](_0x198aae)[_0x9682('0x1a')]();};}function respondWithResult(_0x2261d5,_0x3d88d8){_0x3d88d8=_0x3d88d8||0xc8;return function(_0x54186a){if(_0x54186a){return _0x2261d5['status'](_0x3d88d8)[_0x9682('0x1b')](_0x54186a);}};}function respondWithFilteredResult(_0x5509ff,_0x5b6036){return function(_0x1a198f){if(_0x1a198f){var _0x207ca8=typeof _0x5b6036[_0x9682('0x1c')]===_0x9682('0x1d')&&typeof _0x5b6036[_0x9682('0x1e')]===_0x9682('0x1d');var _0x42403d=_0x1a198f[_0x9682('0x1f')];var _0x82de1f=_0x207ca8?0x0:_0x5b6036[_0x9682('0x1c')];var _0x45d73c=_0x207ca8?_0x1a198f[_0x9682('0x1f')]:_0x5b6036['offset']+_0x5b6036[_0x9682('0x1e')];var _0x4edf37;if(_0x45d73c>=_0x42403d){_0x45d73c=_0x42403d;_0x4edf37=0xc8;}else{_0x4edf37=0xce;}_0x5509ff[_0x9682('0x19')](_0x4edf37);return _0x5509ff[_0x9682('0x20')](_0x9682('0x21'),_0x82de1f+'-'+_0x45d73c+'/'+_0x42403d)[_0x9682('0x1b')](_0x1a198f);}return null;};}function patchUpdates(_0x9dc862){return function(_0xcc6536){try{jsonpatch[_0x9682('0x22')](_0xcc6536,_0x9dc862,!![]);}catch(_0x2fe505){return BPromise[_0x9682('0x23')](_0x2fe505);}return _0xcc6536['save']();};}function saveUpdates(_0xd8e610,_0x5bda7a){return function(_0x1ac6d6){if(_0x1ac6d6){return _0x1ac6d6[_0x9682('0x24')](_0xd8e610)[_0x9682('0x25')](function(_0x276e55){return _0x276e55;});}return null;};}function removeEntity(_0xafd451,_0x53ed29){return function(_0x5b7614){if(_0x5b7614){return _0x5b7614[_0x9682('0x26')]()[_0x9682('0x25')](function(){var _0xa3a2e5=_0x5b7614[_0x9682('0x27')]({'plain':!![]});var _0x3db48b='CustomDashboards';return db[_0x9682('0x28')][_0x9682('0x26')]({'where':{'type':_0x3db48b,'resourceId':_0xa3a2e5['id']}})[_0x9682('0x25')](function(){return _0x5b7614;});})['then'](function(){_0xafd451['status'](0xcc)[_0x9682('0x1a')]();});}};}function handleEntityNotFound(_0x54a95d,_0x94e0da){return function(_0x2b93cc){if(!_0x2b93cc){_0x54a95d[_0x9682('0x18')](0x194);}return _0x2b93cc;};}function handleError(_0x5af4a2,_0x18d1b5){_0x18d1b5=_0x18d1b5||0x1f4;return function(_0x33fa4a){logger['error'](_0x33fa4a['stack']);if(_0x33fa4a[_0x9682('0x29')]){delete _0x33fa4a[_0x9682('0x29')];}_0x5af4a2['status'](_0x18d1b5)[_0x9682('0x2a')](_0x33fa4a);};}exports[_0x9682('0x2b')]=function(_0x581e9a,_0x11a162){var _0x29e10a={},_0x5c629a={},_0x335f39={'count':0x0,'rows':[]};var _0x40476a=_['map'](db['Dashboard']['rawAttributes'],function(_0x397d1c){return{'name':_0x397d1c['fieldName'],'type':_0x397d1c[_0x9682('0x2c')][_0x9682('0x2d')]};});_0x5c629a[_0x9682('0x2e')]=_[_0x9682('0x2f')](_0x40476a,_0x9682('0x29'));_0x5c629a[_0x9682('0x30')]=_[_0x9682('0x31')](_0x581e9a['query']);_0x5c629a['filters']=_[_0x9682('0x32')](_0x5c629a[_0x9682('0x2e')],_0x5c629a[_0x9682('0x30')]);_0x29e10a[_0x9682('0x33')]=_['intersection'](_0x5c629a[_0x9682('0x2e')],qs[_0x9682('0x34')](_0x581e9a[_0x9682('0x30')][_0x9682('0x34')]));_0x29e10a[_0x9682('0x33')]=_0x29e10a[_0x9682('0x33')]['length']?_0x29e10a['attributes']:_0x5c629a[_0x9682('0x2e')];if(!_0x581e9a['query'][_0x9682('0x35')]('nolimit')){_0x29e10a[_0x9682('0x1e')]=qs[_0x9682('0x1e')](_0x581e9a['query'][_0x9682('0x1e')]);_0x29e10a['offset']=qs[_0x9682('0x1c')](_0x581e9a[_0x9682('0x30')][_0x9682('0x1c')]);}_0x29e10a['order']=qs[_0x9682('0x36')](_0x581e9a[_0x9682('0x30')][_0x9682('0x36')]);_0x29e10a[_0x9682('0x37')]=qs['filters'](_[_0x9682('0x38')](_0x581e9a[_0x9682('0x30')],_0x5c629a[_0x9682('0x39')]),_0x40476a);if(_0x581e9a[_0x9682('0x30')][_0x9682('0x3a')]){_0x29e10a[_0x9682('0x37')]=_[_0x9682('0x3b')](_0x29e10a[_0x9682('0x37')],{'$or':_[_0x9682('0x2f')](_0x40476a,function(_0x524158){if(_0x524158[_0x9682('0x2c')]!=='VIRTUAL'){var _0x5a2ffc={};_0x5a2ffc[_0x524158[_0x9682('0x29')]]={'$like':'%'+_0x581e9a['query'][_0x9682('0x3a')]+'%'};return _0x5a2ffc;}})});}_0x29e10a=_[_0x9682('0x3b')]({},_0x29e10a,_0x581e9a['options']);var _0x385d7f={'where':_0x29e10a[_0x9682('0x37')]};return db[_0x9682('0x3c')][_0x9682('0x1f')](_0x385d7f)[_0x9682('0x25')](function(_0x2ecd9b){_0x335f39[_0x9682('0x1f')]=_0x2ecd9b;if(_0x581e9a[_0x9682('0x30')]['includeAll']){_0x29e10a[_0x9682('0x3d')]=[{'all':!![]}];}return db[_0x9682('0x3c')]['findAll'](_0x29e10a);})[_0x9682('0x25')](function(_0x93abb0){_0x335f39[_0x9682('0x3e')]=_0x93abb0;return _0x335f39;})[_0x9682('0x25')](respondWithFilteredResult(_0x11a162,_0x29e10a))['catch'](handleError(_0x11a162,null));};exports[_0x9682('0x3f')]=function(_0x236d88,_0x405cc6){var _0x2a7e77={'raw':![],'where':{'id':_0x236d88[_0x9682('0x40')]['id']}},_0x1d2c8e={};_0x1d2c8e[_0x9682('0x2e')]=_[_0x9682('0x31')](db['Dashboard'][_0x9682('0x41')]);_0x1d2c8e[_0x9682('0x30')]=_[_0x9682('0x31')](_0x236d88[_0x9682('0x30')]);_0x1d2c8e['filters']=_[_0x9682('0x32')](_0x1d2c8e['model'],_0x1d2c8e[_0x9682('0x30')]);_0x2a7e77[_0x9682('0x33')]=_[_0x9682('0x32')](_0x1d2c8e['model'],qs[_0x9682('0x34')](_0x236d88[_0x9682('0x30')][_0x9682('0x34')]));_0x2a7e77[_0x9682('0x33')]=_0x2a7e77[_0x9682('0x33')][_0x9682('0x42')]?_0x2a7e77[_0x9682('0x33')]:_0x1d2c8e[_0x9682('0x2e')];if(_0x236d88['query']['includeAll']){_0x2a7e77[_0x9682('0x3d')]=[{'all':!![]}];}_0x2a7e77=_[_0x9682('0x3b')]({},_0x2a7e77,_0x236d88['options']);return db['Dashboard'][_0x9682('0x43')](_0x2a7e77)['then'](handleEntityNotFound(_0x405cc6,null))[_0x9682('0x25')](respondWithResult(_0x405cc6,null))[_0x9682('0x44')](handleError(_0x405cc6,null));};exports['create']=function(_0x1fe0bf,_0x2e5635){return db[_0x9682('0x3c')][_0x9682('0x45')](_0x1fe0bf[_0x9682('0x46')],{})[_0x9682('0x25')](function(_0x4d401e){var _0x42d6a3=_0x1fe0bf[_0x9682('0x47')]['get']({'plain':!![]});if(!_0x42d6a3)throw new Error(_0x9682('0x48'));if(_0x42d6a3['role']===_0x9682('0x47')){var _0x4db1fc=_0x4d401e[_0x9682('0x27')]({'plain':!![]});var _0x270716=_0x9682('0x49');return db[_0x9682('0x4a')][_0x9682('0x43')]({'where':{'name':_0x270716,'userProfileId':_0x42d6a3[_0x9682('0x4b')]},'raw':!![]})[_0x9682('0x25')](function(_0x2426ab){if(_0x2426ab&&_0x2426ab[_0x9682('0x4c')]===0x0){return db[_0x9682('0x28')][_0x9682('0x45')]({'name':_0x4db1fc[_0x9682('0x29')],'resourceId':_0x4db1fc['id'],'type':_0x2426ab[_0x9682('0x29')],'sectionId':_0x2426ab['id']},{})[_0x9682('0x25')](function(){return _0x4d401e;});}else{return _0x4d401e;}})['catch'](function(_0x45d463){logger[_0x9682('0x4d')](_0x9682('0x4e'),_0x45d463);throw _0x45d463;});}return _0x4d401e;})[_0x9682('0x25')](respondWithResult(_0x2e5635,0xc9))[_0x9682('0x44')](handleError(_0x2e5635,null));};exports[_0x9682('0x4f')]=function(_0x3a7ef0,_0xc4c64e){var _0x35cfc7={'where':{'id':_0x3a7ef0[_0x9682('0x40')]['id']}},_0x324929={};_0x324929[_0x9682('0x2e')]=_[_0x9682('0x31')](db[_0x9682('0x3c')][_0x9682('0x41')]);_0x35cfc7['attributes']=_[_0x9682('0x32')](_0x324929[_0x9682('0x2e')],qs['fields'](_0x3a7ef0[_0x9682('0x30')][_0x9682('0x34')]));_0x35cfc7['attributes']=_0x35cfc7['attributes'][_0x9682('0x42')]?_0x35cfc7[_0x9682('0x33')]:_0x324929[_0x9682('0x2e')];if(_0x3a7ef0[_0x9682('0x30')][_0x9682('0x50')]){_0x35cfc7[_0x9682('0x3d')]=[{'all':!![]}];}_0x35cfc7=_[_0x9682('0x3b')]({},_0x35cfc7,_0x3a7ef0[_0x9682('0x51')]);return db[_0x9682('0x3c')][_0x9682('0x43')](_0x35cfc7)[_0x9682('0x25')](handleEntityNotFound(_0xc4c64e,null))[_0x9682('0x25')](function(_0x363c2c){if(_0x363c2c){var _0x4a4f0a=_0x363c2c[_0x9682('0x27')]({'plain':!![]});_0x4a4f0a=qs[_0x9682('0x52')](_0x4a4f0a,['id','createdAt','updatedAt']);_0x3a7ef0[_0x9682('0x46')]=_['omit'](_0x3a7ef0['body'],['id',_0x9682('0x53'),_0x9682('0x54')]);return db['Dashboard'][_0x9682('0x45')](_['merge'](_0x4a4f0a,_0x3a7ef0['body']),{'include':_0x3a7ef0['query'][_0x9682('0x50')]?[{'all':!![]}]:undefined})[_0x9682('0x25')](function(_0x361556){var _0xc047c3=_0x3a7ef0[_0x9682('0x47')][_0x9682('0x27')]({'plain':!![]});if(!_0xc047c3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc047c3['role']===_0x9682('0x47')){var _0xc182df=_0x361556['get']({'plain':!![]});var _0x3c4c8d='CustomDashboards';return db[_0x9682('0x4a')][_0x9682('0x43')]({'where':{'name':_0x3c4c8d,'userProfileId':_0xc047c3[_0x9682('0x4b')]},'raw':!![]})[_0x9682('0x25')](function(_0x3d45b3){if(_0x3d45b3&&_0x3d45b3[_0x9682('0x4c')]===0x0){return db[_0x9682('0x28')][_0x9682('0x45')]({'name':_0xc182df[_0x9682('0x29')],'resourceId':_0xc182df['id'],'type':_0x3d45b3[_0x9682('0x29')],'sectionId':_0x3d45b3['id']},{})['then'](function(){return _0x361556;});}else{return _0x361556;}})['catch'](function(_0x296730){logger[_0x9682('0x4d')](_0x9682('0x4e'),_0x296730);throw _0x296730;});}return _0x361556;});}})[_0x9682('0x25')](respondWithResult(_0xc4c64e,0xc9))[_0x9682('0x44')](handleError(_0xc4c64e,null));};exports[_0x9682('0x24')]=function(_0x567963,_0x39e4b6){if(_0x567963[_0x9682('0x46')]['id']){delete _0x567963[_0x9682('0x46')]['id'];}return db['Dashboard'][_0x9682('0x43')]({'where':{'id':_0x567963['params']['id']}})[_0x9682('0x25')](handleEntityNotFound(_0x39e4b6,null))[_0x9682('0x25')](saveUpdates(_0x567963[_0x9682('0x46')],null))[_0x9682('0x25')](respondWithResult(_0x39e4b6,null))[_0x9682('0x44')](handleError(_0x39e4b6,null));};exports[_0x9682('0x26')]=function(_0x1409f9,_0x4b5e31){return db[_0x9682('0x3c')][_0x9682('0x43')]({'where':{'id':_0x1409f9[_0x9682('0x40')]['id']}})[_0x9682('0x25')](handleEntityNotFound(_0x4b5e31,null))['then'](removeEntity(_0x4b5e31,null))['catch'](handleError(_0x4b5e31,null));};function widgetAttributes(_0xe0b02c){try{switch(_0xe0b02c['type']){case'iframe':return[{'name':_0x9682('0x55'),'value':_0xe0b02c['attrUrl']||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c[_0x9682('0x56')][0x0]['value']:undefined)||_0x9682('0x57')}];case _0x9682('0x58'):return[{'name':'attrPath','value':_0xe0b02c[_0x9682('0x59')]||(_0xe0b02c['attrs']&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c[_0x9682('0x56')][0x0][_0x9682('0x5a')]:undefined)||''}];case _0x9682('0x5b'):return[{'name':_0x9682('0x5c'),'value':_0xe0b02c[_0x9682('0x5c')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c[_0x9682('0x56')][0x0]['value']:undefined)||_0x9682('0x5d')},{'name':_0x9682('0x5e'),'value':_0xe0b02c[_0x9682('0x5e')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c['attrs'][0x1]?_0xe0b02c[_0x9682('0x56')][0x1][_0x9682('0x5a')]:undefined)||_0x9682('0x5f')},{'name':'attrFontSize','value':_0xe0b02c[_0x9682('0x60')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x2]?_0xe0b02c['attrs'][0x2]['value']:undefined)||0xc}];case _0x9682('0x61'):return[{'name':_0x9682('0x62'),'value':_0xe0b02c[_0x9682('0x62')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c[_0x9682('0x56')][0x0]['value']:undefined)||_0x9682('0x63')},{'name':_0x9682('0x64'),'value':_0xe0b02c[_0x9682('0x64')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x1]?_0xe0b02c[_0x9682('0x56')][0x1][_0x9682('0x5a')]:undefined)||[]},{'name':_0x9682('0x60'),'value':_0xe0b02c[_0x9682('0x60')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c['attrs'][0x2]?_0xe0b02c[_0x9682('0x56')][0x2]['value']:undefined)||0x14}];case _0x9682('0x65'):case _0x9682('0x66'):return[{'name':_0x9682('0x67'),'value':_0xe0b02c[_0x9682('0x67')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c['attrs'][0x0][_0x9682('0x5a')]:undefined)||_0x9682('0x63')},{'name':'attrSerie2','value':_0xe0b02c[_0x9682('0x68')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x1]?_0xe0b02c[_0x9682('0x56')][0x1][_0x9682('0x5a')]:undefined)||null},{'name':'attrSerie3','value':_0xe0b02c[_0x9682('0x69')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x2]?_0xe0b02c['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0xe0b02c[_0x9682('0x64')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c['attrs'][0x3]?_0xe0b02c[_0x9682('0x56')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x9682('0x6a'),'type':_0xe0b02c[_0x9682('0x6b')]||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c[_0x9682('0x56')][0x0][_0x9682('0x2c')]:undefined)||null,'value':_0xe0b02c['attrReport']||(_0xe0b02c['attrs']&&_0xe0b02c[_0x9682('0x56')][0x0]?_0xe0b02c[_0x9682('0x56')][0x0][_0x9682('0x5a')]:undefined)||null},{'name':_0x9682('0x6c'),'value':_0xe0b02c['attrRefresh']||(_0xe0b02c[_0x9682('0x56')]&&_0xe0b02c['attrs'][0x1]?_0xe0b02c['attrs'][0x1][_0x9682('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x2c7b7c){logger['error'](_0x9682('0x6d'),JSON[_0x9682('0x6e')](_0x2c7b7c));return[];}}exports[_0x9682('0x6f')]=function(_0x1caa77,_0x40062e,_0xacfaa0){if(_0x1caa77[_0x9682('0x46')]['id']){delete _0x1caa77['body']['id'];}return db[_0x9682('0x3c')][_0x9682('0x43')]({'where':{'id':_0x1caa77[_0x9682('0x40')]['id']}})[_0x9682('0x25')](handleEntityNotFound(_0x40062e,null))[_0x9682('0x25')](function(_0x505164){if(_0x505164){_0x1caa77[_0x9682('0x46')][_0x9682('0x70')]=_0x505164['id'];_0x1caa77[_0x9682('0x46')][_0x9682('0x56')]=widgetAttributes(_0x1caa77[_0x9682('0x46')]);return db[_0x9682('0x71')][_0x9682('0x45')](_0x1caa77[_0x9682('0x46')]);}})[_0x9682('0x25')](respondWithResult(_0x40062e,null))[_0x9682('0x44')](handleError(_0x40062e,null));};exports[_0x9682('0x72')]=function(_0x562999,_0x18ce9d,_0x37f5f2){var _0x11cef3={};var _0x347319={};var _0x1201e0;var _0x3f1e47;return db[_0x9682('0x3c')][_0x9682('0x73')]({'where':{'id':_0x562999['params']['id']}})[_0x9682('0x25')](handleEntityNotFound(_0x18ce9d,null))[_0x9682('0x25')](function(_0x3b9ee2){if(_0x3b9ee2){_0x1201e0=_0x3b9ee2;_0x347319['model']=_[_0x9682('0x31')](db[_0x9682('0x71')][_0x9682('0x41')]);_0x347319['query']=_[_0x9682('0x31')](_0x562999[_0x9682('0x30')]);_0x347319[_0x9682('0x39')]=_[_0x9682('0x32')](_0x347319[_0x9682('0x2e')],_0x347319['query']);_0x11cef3[_0x9682('0x33')]=_[_0x9682('0x32')](_0x347319[_0x9682('0x2e')],qs[_0x9682('0x34')](_0x562999['query'][_0x9682('0x34')]));_0x11cef3[_0x9682('0x33')]=_0x11cef3['attributes'][_0x9682('0x42')]?_0x11cef3[_0x9682('0x33')]:_0x347319['model'];_0x11cef3[_0x9682('0x74')]=qs[_0x9682('0x36')](_0x562999['query'][_0x9682('0x36')]);_0x11cef3[_0x9682('0x37')]=qs[_0x9682('0x39')](_[_0x9682('0x38')](_0x562999[_0x9682('0x30')],_0x347319[_0x9682('0x39')]));if(_0x562999[_0x9682('0x30')][_0x9682('0x3a')]){_0x11cef3['where']=_[_0x9682('0x3b')](_0x11cef3[_0x9682('0x37')],{'$or':_['map'](_0x11cef3['attributes'],function(_0x225de7){var _0x1b3992={};_0x1b3992[_0x225de7]={'$like':'%'+_0x562999[_0x9682('0x30')][_0x9682('0x3a')]+'%'};return _0x1b3992;})});}_0x11cef3=_[_0x9682('0x3b')]({},_0x11cef3,_0x562999['options']);return _0x1201e0['getItems'](_0x11cef3);}})[_0x9682('0x25')](function(_0x213e10){if(_0x213e10){_0x3f1e47=_0x213e10['length'];if(!_0x562999['query'][_0x9682('0x35')]('nolimit')){_0x11cef3[_0x9682('0x1e')]=qs[_0x9682('0x1e')](_0x562999[_0x9682('0x30')][_0x9682('0x1e')]);_0x11cef3['offset']=qs[_0x9682('0x1c')](_0x562999[_0x9682('0x30')][_0x9682('0x1c')]);}return _0x1201e0[_0x9682('0x72')](_0x11cef3);}})[_0x9682('0x25')](function(_0x3ea493){if(_0x3ea493){return _0x3ea493?{'count':_0x3f1e47,'rows':_0x3ea493}:null;}})[_0x9682('0x25')](respondWithResult(_0x18ce9d,null))['catch'](handleError(_0x18ce9d,null));};
\ No newline at end of file
+var _0xa065=['attrReport','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','end','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','CustomDashboards','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Dashboard','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','includeAll','role','update','iframe','attrUrl','attrs','value','custom','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie2','attrSerie3','web-report','reportType'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa065,0x1d7));var _0x5a06=function(_0x4530d8,_0x4969ce){_0x4530d8=_0x4530d8-0x0;var _0x49cd95=_0xa065[_0x4530d8];return _0x49cd95;};'use strict';var emlformat=require(_0x5a06('0x0'));var rimraf=require(_0x5a06('0x1'));var zipdir=require(_0x5a06('0x2'));var jsonpatch=require(_0x5a06('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5a06('0x4'));var Mustache=require('mustache');var util=require(_0x5a06('0x5'));var path=require('path');var sox=require(_0x5a06('0x6'));var csv=require(_0x5a06('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a06('0x8'));var _=require(_0x5a06('0x9'));var squel=require(_0x5a06('0xa'));var crypto=require(_0x5a06('0xb'));var jsforce=require(_0x5a06('0xc'));var deskjs=require(_0x5a06('0xd'));var toCsv=require(_0x5a06('0x7'));var querystring=require(_0x5a06('0xe'));var Papa=require(_0x5a06('0xf'));var Redis=require('ioredis');var authService=require(_0x5a06('0x10'));var qs=require(_0x5a06('0x11'));var as=require(_0x5a06('0x12'));var hardwareService=require(_0x5a06('0x13'));var logger=require(_0x5a06('0x14'))('api');var utils=require(_0x5a06('0x15'));var config=require(_0x5a06('0x16'));var licenseUtil=require(_0x5a06('0x17'));var db=require('../../mysqldb')['db'];config[_0x5a06('0x18')]=_['defaults'](config[_0x5a06('0x18')],{'host':_0x5a06('0x19'),'port':0x18eb});var socket=require(_0x5a06('0x1a'))(new Redis(config[_0x5a06('0x18')]));require(_0x5a06('0x1b'))[_0x5a06('0x1c')](socket);function respondWithStatusCode(_0x898d48,_0x439445){_0x439445=_0x439445||0xcc;return function(_0x5a37ae){if(_0x5a37ae){return _0x898d48['sendStatus'](_0x439445);}return _0x898d48['status'](_0x439445)[_0x5a06('0x1d')]();};}function respondWithResult(_0x4541be,_0x7ad12a){_0x7ad12a=_0x7ad12a||0xc8;return function(_0x1e3405){if(_0x1e3405){return _0x4541be[_0x5a06('0x1e')](_0x7ad12a)[_0x5a06('0x1f')](_0x1e3405);}};}function respondWithFilteredResult(_0x47d511,_0xc99ab5){return function(_0x62b54a){if(_0x62b54a){var _0x18ac5c=typeof _0xc99ab5[_0x5a06('0x20')]===_0x5a06('0x21')&&typeof _0xc99ab5[_0x5a06('0x22')]==='undefined';var _0x3fd4be=_0x62b54a[_0x5a06('0x23')];var _0x4a7d36=_0x18ac5c?0x0:_0xc99ab5[_0x5a06('0x20')];var _0x3dd060=_0x18ac5c?_0x62b54a['count']:_0xc99ab5[_0x5a06('0x20')]+_0xc99ab5['limit'];var _0x5487de;if(_0x3dd060>=_0x3fd4be){_0x3dd060=_0x3fd4be;_0x5487de=0xc8;}else{_0x5487de=0xce;}_0x47d511[_0x5a06('0x1e')](_0x5487de);return _0x47d511[_0x5a06('0x24')]('Content-Range',_0x4a7d36+'-'+_0x3dd060+'/'+_0x3fd4be)[_0x5a06('0x1f')](_0x62b54a);}return null;};}function patchUpdates(_0x365b08){return function(_0x14418c){try{jsonpatch[_0x5a06('0x25')](_0x14418c,_0x365b08,!![]);}catch(_0x54a971){return BPromise['reject'](_0x54a971);}return _0x14418c[_0x5a06('0x26')]();};}function saveUpdates(_0x14b2b7,_0x30b627){return function(_0x56c313){if(_0x56c313){return _0x56c313['update'](_0x14b2b7)[_0x5a06('0x27')](function(_0x4ebde9){return _0x4ebde9;});}return null;};}function removeEntity(_0x16c26d,_0x315c50){return function(_0x1fa0d6){if(_0x1fa0d6){return _0x1fa0d6[_0x5a06('0x28')]()[_0x5a06('0x27')](function(){var _0x1f0d22=_0x1fa0d6[_0x5a06('0x29')]({'plain':!![]});var _0x509a10=_0x5a06('0x2a');return db['UserProfileResource'][_0x5a06('0x28')]({'where':{'type':_0x509a10,'resourceId':_0x1f0d22['id']}})[_0x5a06('0x27')](function(){return _0x1fa0d6;});})[_0x5a06('0x27')](function(){_0x16c26d[_0x5a06('0x1e')](0xcc)[_0x5a06('0x1d')]();});}};}function handleEntityNotFound(_0x44008e,_0x4b119f){return function(_0x1ebb63){if(!_0x1ebb63){_0x44008e[_0x5a06('0x2b')](0x194);}return _0x1ebb63;};}function handleError(_0x534445,_0x57692f){_0x57692f=_0x57692f||0x1f4;return function(_0x1e443b){logger[_0x5a06('0x2c')](_0x1e443b[_0x5a06('0x2d')]);if(_0x1e443b['name']){delete _0x1e443b[_0x5a06('0x2e')];}_0x534445[_0x5a06('0x1e')](_0x57692f)[_0x5a06('0x2f')](_0x1e443b);};}exports['index']=function(_0x4d9a9c,_0x3ec7af){var _0x100649={},_0x405a1f={},_0x2592d4={'count':0x0,'rows':[]};var _0x1fde33=_[_0x5a06('0x30')](db['Dashboard'][_0x5a06('0x31')],function(_0x34899d){return{'name':_0x34899d[_0x5a06('0x32')],'type':_0x34899d[_0x5a06('0x33')][_0x5a06('0x34')]};});_0x405a1f[_0x5a06('0x35')]=_[_0x5a06('0x30')](_0x1fde33,_0x5a06('0x2e'));_0x405a1f[_0x5a06('0x36')]=_[_0x5a06('0x37')](_0x4d9a9c[_0x5a06('0x36')]);_0x405a1f[_0x5a06('0x38')]=_[_0x5a06('0x39')](_0x405a1f['model'],_0x405a1f[_0x5a06('0x36')]);_0x100649[_0x5a06('0x3a')]=_[_0x5a06('0x39')](_0x405a1f[_0x5a06('0x35')],qs['fields'](_0x4d9a9c['query'][_0x5a06('0x3b')]));_0x100649[_0x5a06('0x3a')]=_0x100649[_0x5a06('0x3a')][_0x5a06('0x3c')]?_0x100649[_0x5a06('0x3a')]:_0x405a1f['model'];if(!_0x4d9a9c[_0x5a06('0x36')][_0x5a06('0x3d')](_0x5a06('0x3e'))){_0x100649[_0x5a06('0x22')]=qs[_0x5a06('0x22')](_0x4d9a9c[_0x5a06('0x36')][_0x5a06('0x22')]);_0x100649[_0x5a06('0x20')]=qs[_0x5a06('0x20')](_0x4d9a9c[_0x5a06('0x36')][_0x5a06('0x20')]);}_0x100649['order']=qs[_0x5a06('0x3f')](_0x4d9a9c['query'][_0x5a06('0x3f')]);_0x100649[_0x5a06('0x40')]=qs['filters'](_[_0x5a06('0x41')](_0x4d9a9c[_0x5a06('0x36')],_0x405a1f[_0x5a06('0x38')]),_0x1fde33);if(_0x4d9a9c[_0x5a06('0x36')][_0x5a06('0x42')]){_0x100649['where']=_[_0x5a06('0x43')](_0x100649[_0x5a06('0x40')],{'$or':_['map'](_0x1fde33,function(_0x8abc9c){if(_0x8abc9c['type']!==_0x5a06('0x44')){var _0x552a49={};_0x552a49[_0x8abc9c[_0x5a06('0x2e')]]={'$like':'%'+_0x4d9a9c[_0x5a06('0x36')][_0x5a06('0x42')]+'%'};return _0x552a49;}})});}_0x100649=_[_0x5a06('0x43')]({},_0x100649,_0x4d9a9c[_0x5a06('0x45')]);var _0x1f44e4={'where':_0x100649['where']};return db[_0x5a06('0x46')][_0x5a06('0x23')](_0x1f44e4)[_0x5a06('0x27')](function(_0xac3f8f){_0x2592d4[_0x5a06('0x23')]=_0xac3f8f;if(_0x4d9a9c[_0x5a06('0x36')]['includeAll']){_0x100649['include']=[{'all':!![]}];}return db[_0x5a06('0x46')][_0x5a06('0x47')](_0x100649);})[_0x5a06('0x27')](function(_0x40182c){_0x2592d4[_0x5a06('0x48')]=_0x40182c;return _0x2592d4;})[_0x5a06('0x27')](respondWithFilteredResult(_0x3ec7af,_0x100649))['catch'](handleError(_0x3ec7af,null));};exports[_0x5a06('0x49')]=function(_0x13d69b,_0xd9f72d){var _0x3b11f9={'raw':![],'where':{'id':_0x13d69b[_0x5a06('0x4a')]['id']}},_0x521e71={};_0x521e71[_0x5a06('0x35')]=_[_0x5a06('0x37')](db[_0x5a06('0x46')][_0x5a06('0x31')]);_0x521e71['query']=_['keys'](_0x13d69b[_0x5a06('0x36')]);_0x521e71[_0x5a06('0x38')]=_[_0x5a06('0x39')](_0x521e71[_0x5a06('0x35')],_0x521e71[_0x5a06('0x36')]);_0x3b11f9[_0x5a06('0x3a')]=_['intersection'](_0x521e71[_0x5a06('0x35')],qs[_0x5a06('0x3b')](_0x13d69b['query'][_0x5a06('0x3b')]));_0x3b11f9[_0x5a06('0x3a')]=_0x3b11f9[_0x5a06('0x3a')][_0x5a06('0x3c')]?_0x3b11f9['attributes']:_0x521e71['model'];if(_0x13d69b[_0x5a06('0x36')]['includeAll']){_0x3b11f9['include']=[{'all':!![]}];}_0x3b11f9=_['merge']({},_0x3b11f9,_0x13d69b[_0x5a06('0x45')]);return db[_0x5a06('0x46')][_0x5a06('0x4b')](_0x3b11f9)['then'](handleEntityNotFound(_0xd9f72d,null))[_0x5a06('0x27')](respondWithResult(_0xd9f72d,null))[_0x5a06('0x4c')](handleError(_0xd9f72d,null));};exports[_0x5a06('0x4d')]=function(_0x2dabd1,_0x31d5ff){return db[_0x5a06('0x46')]['create'](_0x2dabd1[_0x5a06('0x4e')],{})[_0x5a06('0x27')](function(_0x266571){var _0x3c581e=_0x2dabd1['user']['get']({'plain':!![]});if(!_0x3c581e)throw new Error(_0x5a06('0x4f'));if(_0x3c581e['role']===_0x5a06('0x50')){var _0x20a475=_0x266571[_0x5a06('0x29')]({'plain':!![]});var _0x12a4bf='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x12a4bf,'userProfileId':_0x3c581e[_0x5a06('0x51')]},'raw':!![]})[_0x5a06('0x27')](function(_0x56f466){if(_0x56f466&&_0x56f466['autoAssociation']===0x0){return db[_0x5a06('0x52')]['create']({'name':_0x20a475['name'],'resourceId':_0x20a475['id'],'type':_0x56f466[_0x5a06('0x2e')],'sectionId':_0x56f466['id']},{})[_0x5a06('0x27')](function(){return _0x266571;});}else{return _0x266571;}})[_0x5a06('0x4c')](function(_0x443c6e){logger[_0x5a06('0x2c')](_0x5a06('0x53'),_0x443c6e);throw _0x443c6e;});}return _0x266571;})['then'](respondWithResult(_0x31d5ff,0xc9))[_0x5a06('0x4c')](handleError(_0x31d5ff,null));};exports[_0x5a06('0x54')]=function(_0x49a7d7,_0x3d3378){var _0x7c2841={'where':{'id':_0x49a7d7[_0x5a06('0x4a')]['id']}},_0x29ed6a={};_0x29ed6a[_0x5a06('0x35')]=_['keys'](db[_0x5a06('0x46')][_0x5a06('0x31')]);_0x7c2841[_0x5a06('0x3a')]=_['intersection'](_0x29ed6a[_0x5a06('0x35')],qs[_0x5a06('0x3b')](_0x49a7d7[_0x5a06('0x36')][_0x5a06('0x3b')]));_0x7c2841['attributes']=_0x7c2841[_0x5a06('0x3a')][_0x5a06('0x3c')]?_0x7c2841[_0x5a06('0x3a')]:_0x29ed6a[_0x5a06('0x35')];if(_0x49a7d7[_0x5a06('0x36')]['includeAll']){_0x7c2841[_0x5a06('0x55')]=[{'all':!![]}];}_0x7c2841=_['merge']({},_0x7c2841,_0x49a7d7['options']);return db['Dashboard'][_0x5a06('0x4b')](_0x7c2841)['then'](handleEntityNotFound(_0x3d3378,null))['then'](function(_0x31b042){if(_0x31b042){var _0x1fcda3=_0x31b042['get']({'plain':!![]});_0x1fcda3=qs[_0x5a06('0x56')](_0x1fcda3,['id',_0x5a06('0x57'),_0x5a06('0x58')]);_0x49a7d7[_0x5a06('0x4e')]=_[_0x5a06('0x56')](_0x49a7d7[_0x5a06('0x4e')],['id','createdAt','updatedAt']);return db[_0x5a06('0x46')]['create'](_[_0x5a06('0x43')](_0x1fcda3,_0x49a7d7[_0x5a06('0x4e')]),{'include':_0x49a7d7[_0x5a06('0x36')][_0x5a06('0x59')]?[{'all':!![]}]:undefined})[_0x5a06('0x27')](function(_0x6c3fc5){var _0x5dd4a3=_0x49a7d7[_0x5a06('0x50')][_0x5a06('0x29')]({'plain':!![]});if(!_0x5dd4a3)throw new Error(_0x5a06('0x4f'));if(_0x5dd4a3[_0x5a06('0x5a')]==='user'){var _0x3d37b0=_0x6c3fc5[_0x5a06('0x29')]({'plain':!![]});var _0xabba5=_0x5a06('0x2a');return db['UserProfileSection'][_0x5a06('0x4b')]({'where':{'name':_0xabba5,'userProfileId':_0x5dd4a3[_0x5a06('0x51')]},'raw':!![]})[_0x5a06('0x27')](function(_0x251558){if(_0x251558&&_0x251558['autoAssociation']===0x0){return db[_0x5a06('0x52')][_0x5a06('0x4d')]({'name':_0x3d37b0[_0x5a06('0x2e')],'resourceId':_0x3d37b0['id'],'type':_0x251558[_0x5a06('0x2e')],'sectionId':_0x251558['id']},{})[_0x5a06('0x27')](function(){return _0x6c3fc5;});}else{return _0x6c3fc5;}})[_0x5a06('0x4c')](function(_0x5dcc26){logger[_0x5a06('0x2c')](_0x5a06('0x53'),_0x5dcc26);throw _0x5dcc26;});}return _0x6c3fc5;});}})[_0x5a06('0x27')](respondWithResult(_0x3d3378,0xc9))['catch'](handleError(_0x3d3378,null));};exports[_0x5a06('0x5b')]=function(_0x28719c,_0x427ecd){if(_0x28719c[_0x5a06('0x4e')]['id']){delete _0x28719c['body']['id'];}return db['Dashboard'][_0x5a06('0x4b')]({'where':{'id':_0x28719c[_0x5a06('0x4a')]['id']}})[_0x5a06('0x27')](handleEntityNotFound(_0x427ecd,null))[_0x5a06('0x27')](saveUpdates(_0x28719c[_0x5a06('0x4e')],null))[_0x5a06('0x27')](respondWithResult(_0x427ecd,null))[_0x5a06('0x4c')](handleError(_0x427ecd,null));};exports[_0x5a06('0x28')]=function(_0x5b20d1,_0x154902){return db[_0x5a06('0x46')]['find']({'where':{'id':_0x5b20d1[_0x5a06('0x4a')]['id']}})[_0x5a06('0x27')](handleEntityNotFound(_0x154902,null))[_0x5a06('0x27')](removeEntity(_0x154902,null))[_0x5a06('0x4c')](handleError(_0x154902,null));};function widgetAttributes(_0x5d85e0){try{switch(_0x5d85e0[_0x5a06('0x33')]){case _0x5a06('0x5c'):return[{'name':'attrUrl','value':_0x5d85e0[_0x5a06('0x5d')]||(_0x5d85e0['attrs']&&_0x5d85e0[_0x5a06('0x5e')][0x0]?_0x5d85e0[_0x5a06('0x5e')][0x0][_0x5a06('0x5f')]:undefined)||'https://'}];case _0x5a06('0x60'):return[{'name':'attrPath','value':_0x5d85e0['attrPath']||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x0]?_0x5d85e0[_0x5a06('0x5e')][0x0][_0x5a06('0x5f')]:undefined)||''}];case'clock':return[{'name':_0x5a06('0x61'),'value':_0x5d85e0[_0x5a06('0x61')]||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0['attrs'][0x0]?_0x5d85e0['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x5d85e0[_0x5a06('0x62')]||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x1]?_0x5d85e0[_0x5a06('0x5e')][0x1][_0x5a06('0x5f')]:undefined)||'0.00'},{'name':_0x5a06('0x63'),'value':_0x5d85e0[_0x5a06('0x63')]||(_0x5d85e0['attrs']&&_0x5d85e0[_0x5a06('0x5e')][0x2]?_0x5d85e0['attrs'][0x2][_0x5a06('0x5f')]:undefined)||0xc}];case _0x5a06('0x64'):return[{'name':_0x5a06('0x65'),'value':_0x5d85e0['attrMetric']||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x0]?_0x5d85e0[_0x5a06('0x5e')][0x0][_0x5a06('0x5f')]:undefined)||_0x5a06('0x66')},{'name':_0x5a06('0x67'),'value':_0x5d85e0[_0x5a06('0x67')]||(_0x5d85e0['attrs']&&_0x5d85e0[_0x5a06('0x5e')][0x1]?_0x5d85e0[_0x5a06('0x5e')][0x1][_0x5a06('0x5f')]:undefined)||[]},{'name':_0x5a06('0x63'),'value':_0x5d85e0[_0x5a06('0x63')]||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x2]?_0x5d85e0['attrs'][0x2][_0x5a06('0x5f')]:undefined)||0x14}];case _0x5a06('0x68'):case'pie-chart':return[{'name':'attrSerie1','value':_0x5d85e0['attrSerie1']||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x0]?_0x5d85e0[_0x5a06('0x5e')][0x0][_0x5a06('0x5f')]:undefined)||'total'},{'name':'attrSerie2','value':_0x5d85e0[_0x5a06('0x69')]||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x1]?_0x5d85e0[_0x5a06('0x5e')][0x1][_0x5a06('0x5f')]:undefined)||null},{'name':_0x5a06('0x6a'),'value':_0x5d85e0[_0x5a06('0x6a')]||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0['attrs'][0x2]?_0x5d85e0[_0x5a06('0x5e')][0x2][_0x5a06('0x5f')]:undefined)||null},{'name':_0x5a06('0x67'),'value':_0x5d85e0[_0x5a06('0x67')]||(_0x5d85e0['attrs']&&_0x5d85e0['attrs'][0x3]?_0x5d85e0[_0x5a06('0x5e')][0x3][_0x5a06('0x5f')]:undefined)||[]}];case _0x5a06('0x6b'):return[{'name':'attrReport','type':_0x5d85e0[_0x5a06('0x6c')]||(_0x5d85e0['attrs']&&_0x5d85e0['attrs'][0x0]?_0x5d85e0['attrs'][0x0][_0x5a06('0x33')]:undefined)||null,'value':_0x5d85e0[_0x5a06('0x6d')]||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0['attrs'][0x0]?_0x5d85e0[_0x5a06('0x5e')][0x0][_0x5a06('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x5d85e0['attrRefresh']||(_0x5d85e0[_0x5a06('0x5e')]&&_0x5d85e0[_0x5a06('0x5e')][0x1]?_0x5d85e0[_0x5a06('0x5e')][0x1][_0x5a06('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x27ec8f){logger['error'](_0x5a06('0x6e'),JSON[_0x5a06('0x6f')](_0x27ec8f));return[];}}exports[_0x5a06('0x70')]=function(_0x1cdada,_0x473ebe,_0x2e2cea){if(_0x1cdada[_0x5a06('0x4e')]['id']){delete _0x1cdada[_0x5a06('0x4e')]['id'];}return db[_0x5a06('0x46')]['find']({'where':{'id':_0x1cdada['params']['id']}})[_0x5a06('0x27')](handleEntityNotFound(_0x473ebe,null))[_0x5a06('0x27')](function(_0x23fab9){if(_0x23fab9){_0x1cdada[_0x5a06('0x4e')]['DashboardId']=_0x23fab9['id'];_0x1cdada[_0x5a06('0x4e')][_0x5a06('0x5e')]=widgetAttributes(_0x1cdada['body']);return db[_0x5a06('0x71')]['create'](_0x1cdada[_0x5a06('0x4e')]);}})[_0x5a06('0x27')](respondWithResult(_0x473ebe,null))[_0x5a06('0x4c')](handleError(_0x473ebe,null));};exports['getItems']=function(_0x3db2b6,_0x58d047,_0x49e3a7){var _0x489f26={};var _0x465320={};var _0x421654;var _0x303eca;return db['Dashboard'][_0x5a06('0x72')]({'where':{'id':_0x3db2b6[_0x5a06('0x4a')]['id']}})['then'](handleEntityNotFound(_0x58d047,null))[_0x5a06('0x27')](function(_0x440912){if(_0x440912){_0x421654=_0x440912;_0x465320[_0x5a06('0x35')]=_['keys'](db[_0x5a06('0x71')][_0x5a06('0x31')]);_0x465320[_0x5a06('0x36')]=_[_0x5a06('0x37')](_0x3db2b6[_0x5a06('0x36')]);_0x465320[_0x5a06('0x38')]=_[_0x5a06('0x39')](_0x465320[_0x5a06('0x35')],_0x465320[_0x5a06('0x36')]);_0x489f26['attributes']=_[_0x5a06('0x39')](_0x465320[_0x5a06('0x35')],qs[_0x5a06('0x3b')](_0x3db2b6[_0x5a06('0x36')][_0x5a06('0x3b')]));_0x489f26['attributes']=_0x489f26[_0x5a06('0x3a')][_0x5a06('0x3c')]?_0x489f26[_0x5a06('0x3a')]:_0x465320['model'];_0x489f26['order']=qs['sort'](_0x3db2b6['query']['sort']);_0x489f26[_0x5a06('0x40')]=qs[_0x5a06('0x38')](_['pick'](_0x3db2b6[_0x5a06('0x36')],_0x465320[_0x5a06('0x38')]));if(_0x3db2b6['query'][_0x5a06('0x42')]){_0x489f26['where']=_[_0x5a06('0x43')](_0x489f26[_0x5a06('0x40')],{'$or':_[_0x5a06('0x30')](_0x489f26[_0x5a06('0x3a')],function(_0x29a147){var _0x4bb462={};_0x4bb462[_0x29a147]={'$like':'%'+_0x3db2b6[_0x5a06('0x36')]['filter']+'%'};return _0x4bb462;})});}_0x489f26=_[_0x5a06('0x43')]({},_0x489f26,_0x3db2b6[_0x5a06('0x45')]);return _0x421654['getItems'](_0x489f26);}})[_0x5a06('0x27')](function(_0x1b45f8){if(_0x1b45f8){_0x303eca=_0x1b45f8[_0x5a06('0x3c')];if(!_0x3db2b6['query'][_0x5a06('0x3d')](_0x5a06('0x3e'))){_0x489f26[_0x5a06('0x22')]=qs[_0x5a06('0x22')](_0x3db2b6['query']['limit']);_0x489f26[_0x5a06('0x20')]=qs[_0x5a06('0x20')](_0x3db2b6[_0x5a06('0x36')][_0x5a06('0x20')]);}return _0x421654[_0x5a06('0x73')](_0x489f26);}})[_0x5a06('0x27')](function(_0x5e269a){if(_0x5e269a){return _0x5e269a?{'count':_0x303eca,'rows':_0x5e269a}:null;}})[_0x5a06('0x27')](respondWithResult(_0x58d047,null))[_0x5a06('0x4c')](handleError(_0x58d047,null));};
\ No newline at end of file
index 1b0a29d..e2d89c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe085=['hasOwnProperty','exports','events','../../mysqldb','Dashboard','setMaxListeners','update','remove','emit'];(function(_0x3ece3d,_0x58b2a6){var _0x54d262=function(_0x3f7313){while(--_0x3f7313){_0x3ece3d['push'](_0x3ece3d['shift']());}};_0x54d262(++_0x58b2a6);}(_0xe085,0x16a));var _0x5e08=function(_0x1febfb,_0x326b20){_0x1febfb=_0x1febfb-0x0;var _0x231a6f=_0xe085[_0x1febfb];return _0x231a6f;};'use strict';var EventEmitter=require(_0x5e08('0x0'));var Dashboard=require(_0x5e08('0x1'))['db'][_0x5e08('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5e08('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e08('0x4'),'afterDestroy':_0x5e08('0x5')};function emitEvent(_0x3b8329){return function(_0x65a4f6,_0x5c7c63,_0x31a169){DashboardEvents[_0x5e08('0x6')](_0x3b8329+':'+_0x65a4f6['id'],_0x65a4f6);DashboardEvents['emit'](_0x3b8329,_0x65a4f6);_0x31a169(null);};}for(var e in events){if(events[_0x5e08('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x5e08('0x8')]=DashboardEvents;
\ No newline at end of file
+var _0xe635=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x61970c,_0x261833){var _0x1efc8a=function(_0x4c1493){while(--_0x4c1493){_0x61970c['push'](_0x61970c['shift']());}};_0x1efc8a(++_0x261833);}(_0xe635,0x1be));var _0x5e63=function(_0x45e828,_0x3ed13b){_0x45e828=_0x45e828-0x0;var _0x33dbff=_0xe635[_0x45e828];return _0x33dbff;};'use strict';var EventEmitter=require(_0x5e63('0x0'));var Dashboard=require(_0x5e63('0x1'))['db'][_0x5e63('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5e63('0x3')](0x0);var events={'afterCreate':_0x5e63('0x4'),'afterUpdate':_0x5e63('0x5'),'afterDestroy':_0x5e63('0x6')};function emitEvent(_0x585c30){return function(_0x56a8b5,_0x352338,_0x30e8d1){DashboardEvents[_0x5e63('0x7')](_0x585c30+':'+_0x56a8b5['id'],_0x56a8b5);DashboardEvents[_0x5e63('0x7')](_0x585c30,_0x56a8b5);_0x30e8d1(null);};}for(var e in events){if(events[_0x5e63('0x8')](e)){var event=events[e];Dashboard[_0x5e63('0x9')](e,emitEvent(event));}}module[_0x5e63('0xa')]=DashboardEvents;
\ No newline at end of file
index 1e0da06..8462380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0495=['./dashboard.attributes','exports','define','Dashboard','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0xabb4d5,_0x107432){var _0x4740e5=function(_0x23a55c){while(--_0x23a55c){_0xabb4d5['push'](_0xabb4d5['shift']());}};_0x4740e5(++_0x107432);}(_0x0495,0x126));var _0x5049=function(_0x2975b8,_0xfd2820){_0x2975b8=_0x2975b8-0x0;var _0x7665d9=_0x0495[_0x2975b8];return _0x7665d9;};'use strict';var _=require('lodash');var util=require(_0x5049('0x0'));var logger=require('../../config/logger')(_0x5049('0x1'));var moment=require(_0x5049('0x2'));var BPromise=require(_0x5049('0x3'));var rp=require(_0x5049('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5049('0x5'));var attributes=require(_0x5049('0x6'));module[_0x5049('0x7')]=function(_0x341649,_0xeb95ea){return _0x341649[_0x5049('0x8')](_0x5049('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf756=['api','moment','request-promise','path','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util'];(function(_0x8b0748,_0x43c70c){var _0xcce85e=function(_0x5214e5){while(--_0x5214e5){_0x8b0748['push'](_0x8b0748['shift']());}};_0xcce85e(++_0x43c70c);}(_0xf756,0x1ae));var _0x6f75=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xf756[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x6f75('0x0'));var util=require(_0x6f75('0x1'));var logger=require('../../config/logger')(_0x6f75('0x2'));var moment=require(_0x6f75('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f75('0x4'));var fs=require('fs');var path=require(_0x6f75('0x5'));var rimraf=require('rimraf');var config=require(_0x6f75('0x6'));var attributes=require(_0x6f75('0x7'));module[_0x6f75('0x8')]=function(_0x29d6fc,_0x34bf25){return _0x29d6fc[_0x6f75('0x9')](_0x6f75('0xa'),attributes,{'tableName':_0x6f75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5548a01..921ed2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b22=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird'];(function(_0xd57744,_0x181401){var _0x3936cb=function(_0x3afb1e){while(--_0x3afb1e){_0xd57744['push'](_0xd57744['shift']());}};_0x3936cb(++_0x181401);}(_0x9b22,0xb3));var _0x29b2=function(_0x5ca660,_0x565deb){_0x5ca660=_0x5ca660-0x0;var _0x234e6c=_0x9b22[_0x5ca660];return _0x234e6c;};'use strict';var _=require(_0x29b2('0x0'));var util=require(_0x29b2('0x1'));var moment=require('moment');var BPromise=require(_0x29b2('0x2'));var rs=require(_0x29b2('0x3'));var fs=require('fs');var Redis=require(_0x29b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29b2('0x5'))(_0x29b2('0x6'));var config=require(_0x29b2('0x7'));var jayson=require(_0x29b2('0x8'));var client=jayson[_0x29b2('0x9')]['http']({'port':0x232a});config[_0x29b2('0xa')]=_[_0x29b2('0xb')](config['redis'],{'host':_0x29b2('0xc'),'port':0x18eb});var socket=require(_0x29b2('0xd'))(new Redis(config[_0x29b2('0xa')]));require(_0x29b2('0xe'))[_0x29b2('0xf')](socket);function respondWithRpcPromise(_0x450530,_0x31653e,_0x5cd313){return new BPromise(function(_0x49a5cf,_0x2d396b){return client['request'](_0x450530,_0x5cd313)['then'](function(_0x383e87){logger[_0x29b2('0x10')](_0x29b2('0x11'),_0x31653e,'request\x20sent');logger[_0x29b2('0x12')](_0x29b2('0x13'),_0x31653e,_0x29b2('0x14'),JSON['stringify'](_0x383e87));if(_0x383e87['error']){if(_0x383e87[_0x29b2('0x15')][_0x29b2('0x16')]===0x1f4){logger['error'](_0x29b2('0x11'),_0x31653e,_0x383e87[_0x29b2('0x15')][_0x29b2('0x17')]);return _0x2d396b(_0x383e87[_0x29b2('0x15')]['message']);}logger['error'](_0x29b2('0x11'),_0x31653e,_0x383e87[_0x29b2('0x15')]['message']);return _0x49a5cf(_0x383e87[_0x29b2('0x15')]['message']);}else{logger[_0x29b2('0x10')](_0x29b2('0x11'),_0x31653e,_0x29b2('0x14'));_0x49a5cf(_0x383e87[_0x29b2('0x18')]['message']);}})[_0x29b2('0x19')](function(_0x326576){logger[_0x29b2('0x15')]('Dashboard,\x20%s,\x20%s',_0x31653e,_0x326576);_0x2d396b(_0x326576);});});}
\ No newline at end of file
+var _0xd3eb=['then','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x43316d,_0x5ebd8f){var _0x52d343=function(_0x231e52){while(--_0x231e52){_0x43316d['push'](_0x43316d['shift']());}};_0x52d343(++_0x5ebd8f);}(_0xd3eb,0x1f1));var _0xbd3e=function(_0x3fb166,_0x4eb985){_0x3fb166=_0x3fb166-0x0;var _0x5e91be=_0xd3eb[_0x3fb166];return _0x5e91be;};'use strict';var _=require('lodash');var util=require(_0xbd3e('0x0'));var moment=require(_0xbd3e('0x1'));var BPromise=require(_0xbd3e('0x2'));var rs=require(_0xbd3e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd3e('0x4'));var logger=require(_0xbd3e('0x5'))(_0xbd3e('0x6'));var config=require('../../config/environment');var jayson=require(_0xbd3e('0x7'));var client=jayson[_0xbd3e('0x8')][_0xbd3e('0x9')]({'port':0x232a});config[_0xbd3e('0xa')]=_[_0xbd3e('0xb')](config[_0xbd3e('0xa')],{'host':_0xbd3e('0xc'),'port':0x18eb});var socket=require(_0xbd3e('0xd'))(new Redis(config['redis']));require('./dashboard.socket')[_0xbd3e('0xe')](socket);function respondWithRpcPromise(_0x1c320c,_0x480370,_0x204420){return new BPromise(function(_0x2d15d3,_0x5463c6){return client[_0xbd3e('0xf')](_0x1c320c,_0x204420)[_0xbd3e('0x10')](function(_0x176133){logger['info']('Dashboard,\x20%s,\x20%s',_0x480370,_0xbd3e('0x11'));logger['debug'](_0xbd3e('0x12'),_0x480370,_0xbd3e('0x11'),JSON[_0xbd3e('0x13')](_0x176133));if(_0x176133[_0xbd3e('0x14')]){if(_0x176133['error'][_0xbd3e('0x15')]===0x1f4){logger[_0xbd3e('0x14')](_0xbd3e('0x16'),_0x480370,_0x176133[_0xbd3e('0x14')][_0xbd3e('0x17')]);return _0x5463c6(_0x176133[_0xbd3e('0x14')][_0xbd3e('0x17')]);}logger['error'](_0xbd3e('0x16'),_0x480370,_0x176133[_0xbd3e('0x14')][_0xbd3e('0x17')]);return _0x2d15d3(_0x176133[_0xbd3e('0x14')][_0xbd3e('0x17')]);}else{logger[_0xbd3e('0x18')]('Dashboard,\x20%s,\x20%s',_0x480370,_0xbd3e('0x11'));_0x2d15d3(_0x176133[_0xbd3e('0x19')][_0xbd3e('0x17')]);}})[_0xbd3e('0x1a')](function(_0x5de6b8){logger[_0xbd3e('0x14')](_0xbd3e('0x16'),_0x480370,_0x5de6b8);_0x5463c6(_0x5de6b8);});});}
\ No newline at end of file
index 2bcd1c3..34aa0eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ab6=['emit','register','length','dashboard:','./dashboard.events','save','remove','update'];(function(_0x5c03cc,_0x2a31b9){var _0x500d3d=function(_0x70a36a){while(--_0x70a36a){_0x5c03cc['push'](_0x5c03cc['shift']());}};_0x500d3d(++_0x2a31b9);}(_0x3ab6,0x184));var _0x63ab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ab6[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require(_0x63ab('0x0'));var events=[_0x63ab('0x1'),_0x63ab('0x2'),_0x63ab('0x3')];function createListener(_0x12fc7a,_0x3a32c3){return function(_0x57f0d3){_0x3a32c3[_0x63ab('0x4')](_0x12fc7a,_0x57f0d3);};}function removeListener(_0x35fad3,_0x254ea9){return function(){DashboardEvents['removeListener'](_0x35fad3,_0x254ea9);};}exports[_0x63ab('0x5')]=function(_0x24ebb9){for(var _0x445540=0x0,_0x101256=events[_0x63ab('0x6')];_0x445540<_0x101256;_0x445540++){var _0x17003b=events[_0x445540];var _0x2dcff8=createListener(_0x63ab('0x7')+_0x17003b,_0x24ebb9);DashboardEvents['on'](_0x17003b,_0x2dcff8);}};
\ No newline at end of file
+var _0x1304=['register','length','./dashboard.events','save','remove','update'];(function(_0x31cbf0,_0x1e6918){var _0x4cd473=function(_0x21e687){while(--_0x21e687){_0x31cbf0['push'](_0x31cbf0['shift']());}};_0x4cd473(++_0x1e6918);}(_0x1304,0x1a6));var _0x4130=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1304[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardEvents=require(_0x4130('0x0'));var events=[_0x4130('0x1'),_0x4130('0x2'),_0x4130('0x3')];function createListener(_0x2c4030,_0x155178){return function(_0x30ae7e){_0x155178['emit'](_0x2c4030,_0x30ae7e);};}function removeListener(_0x234573,_0x5cca44){return function(){DashboardEvents['removeListener'](_0x234573,_0x5cca44);};}exports[_0x4130('0x4')]=function(_0x425ccd){for(var _0x17877b=0x0,_0x421291=events[_0x4130('0x5')];_0x17877b<_0x421291;_0x17877b++){var _0x3f4d12=events[_0x17877b];var _0x1f2a2c=createListener('dashboard:'+_0x3f4d12,_0x425ccd);DashboardEvents['on'](_0x3f4d12,_0x1f2a2c);}};
\ No newline at end of file
index dc0e077..e642b2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ea3=['../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','/:id','/:id/items','getItems','post','/:id/clone','clone','addItem','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x84963c,_0x4bc233){var _0x8bd8d1=function(_0x456d03){while(--_0x456d03){_0x84963c['push'](_0x84963c['shift']());}};_0x8bd8d1(++_0x4bc233);}(_0x7ea3,0x10c));var _0x37ea=function(_0x5dbaa7,_0x1f6d4a){_0x5dbaa7=_0x5dbaa7-0x0;var _0x481319=_0x7ea3[_0x5dbaa7];return _0x481319;};'use strict';var multer=require(_0x37ea('0x0'));var util=require(_0x37ea('0x1'));var path=require(_0x37ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x37ea('0x3'));var router=express[_0x37ea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x37ea('0x5'));var config=require('../../config/environment');var controller=require(_0x37ea('0x6'));router[_0x37ea('0x7')]('/',auth[_0x37ea('0x8')](),controller[_0x37ea('0x9')]);router[_0x37ea('0x7')](_0x37ea('0xa'),auth[_0x37ea('0x8')](),controller['show']);router[_0x37ea('0x7')](_0x37ea('0xb'),auth[_0x37ea('0x8')](),controller[_0x37ea('0xc')]);router[_0x37ea('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x37ea('0xd')](_0x37ea('0xe'),auth[_0x37ea('0x8')](),controller[_0x37ea('0xf')]);router[_0x37ea('0xd')](_0x37ea('0xb'),auth['isAuthenticated'](),controller[_0x37ea('0x10')]);router['put'](_0x37ea('0xa'),auth[_0x37ea('0x8')](),controller[_0x37ea('0x11')]);router[_0x37ea('0x12')](_0x37ea('0xa'),auth['isAuthenticated'](),controller[_0x37ea('0x13')]);module[_0x37ea('0x14')]=router;
\ No newline at end of file
+var _0x3c74=['fs-extra','../../components/interaction/service','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','post','create','clone','addItem','put','/:id','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x50f37f,_0x613d39){var _0x1f496a=function(_0x2c88de){while(--_0x2c88de){_0x50f37f['push'](_0x50f37f['shift']());}};_0x1f496a(++_0x613d39);}(_0x3c74,0x1b1));var _0x43c7=function(_0xc1fc74,_0x14ccd5){_0xc1fc74=_0xc1fc74-0x0;var _0x382107=_0x3c74[_0xc1fc74];return _0x382107;};'use strict';var multer=require(_0x43c7('0x0'));var util=require(_0x43c7('0x1'));var path=require(_0x43c7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x43c7('0x3')]();var fs_extra=require(_0x43c7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43c7('0x5'));var config=require('../../config/environment');var controller=require(_0x43c7('0x6'));router[_0x43c7('0x7')]('/',auth[_0x43c7('0x8')](),controller[_0x43c7('0x9')]);router[_0x43c7('0x7')]('/:id',auth[_0x43c7('0x8')](),controller[_0x43c7('0xa')]);router[_0x43c7('0x7')](_0x43c7('0xb'),auth[_0x43c7('0x8')](),controller[_0x43c7('0xc')]);router[_0x43c7('0xd')]('/',auth[_0x43c7('0x8')](),controller[_0x43c7('0xe')]);router[_0x43c7('0xd')]('/:id/clone',auth[_0x43c7('0x8')](),controller[_0x43c7('0xf')]);router['post']('/:id/items',auth[_0x43c7('0x8')](),controller[_0x43c7('0x10')]);router[_0x43c7('0x11')](_0x43c7('0x12'),auth[_0x43c7('0x8')](),controller[_0x43c7('0x13')]);router[_0x43c7('0x14')]('/:id',auth[_0x43c7('0x8')](),controller[_0x43c7('0x15')]);module[_0x43c7('0x16')]=router;
\ No newline at end of file
index d125940..3bb8737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c60=['attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x4852c4,_0x314710){var _0x1458b4=function(_0xbc78dd){while(--_0xbc78dd){_0x4852c4['push'](_0x4852c4['shift']());}};_0x1458b4(++_0x314710);}(_0x4c60,0xc1));var _0x04c6=function(_0xbf4cf7,_0x293f64){_0xbf4cf7=_0xbf4cf7-0x0;var _0x28ec8b=_0x4c60[_0xbf4cf7];return _0x28ec8b;};'use strict';var Sequelize=require(_0x04c6('0x0'));var squel=require(_0x04c6('0x1'));var _=require(_0x04c6('0x2'));module[_0x04c6('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x04c6('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x04c6('0x5')));}catch(_0xc6e772){return[];}},'set':function(_0x2054da){try{this[_0x04c6('0x6')](_0x04c6('0x5'),JSON[_0x04c6('0x7')](_0x2054da));}catch(_0x8f9b13){this['setDataValue'](_0x04c6('0x5'),JSON[_0x04c6('0x7')]([]));}}},'sizeX':{'type':Sequelize[_0x04c6('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x04c6('0x8')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x04c6('0x9'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x04c6('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x04c6('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0x2a07=['setDataValue','stringify','INTEGER','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x2a07,0x74));var _0x72a0=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x2a07[_0x324e86];return _0x592846;};'use strict';var Sequelize=require(_0x72a0('0x0'));var squel=require(_0x72a0('0x1'));var _=require(_0x72a0('0x2'));module[_0x72a0('0x3')]={'title':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x72a0('0x5')](_0x72a0('0x6')),'get':function(){try{return JSON[_0x72a0('0x7')](this[_0x72a0('0x8')](_0x72a0('0x9')));}catch(_0xce74c){return[];}},'set':function(_0x3ccf6d){try{this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')](_0x3ccf6d));}catch(_0x21c819){this[_0x72a0('0xa')](_0x72a0('0x9'),JSON[_0x72a0('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x72a0('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x72a0('0xc')]},'background':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x72a0('0x4')],'allowNull':![],'defaultValue':_0x72a0('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x72a0('0x4')]},'titleFontSize':{'type':Sequelize[_0x72a0('0xc')],'defaultValue':0xc}};
\ No newline at end of file
index ca089fd..d3f3925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde84=['name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','options','find','catch','attrUrl','value','https://','custom','attrPath','attrs','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./dashboardItem.socket','register','sendStatus','end','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','error','stack'];(function(_0x3e65f2,_0x410e3b){var _0x33f71e=function(_0x376569){while(--_0x376569){_0x3e65f2['push'](_0x3e65f2['shift']());}};_0x33f71e(++_0x410e3b);}(_0xde84,0x84));var _0x4de8=function(_0x312372,_0x131d2f){_0x312372=_0x312372-0x0;var _0x5966eb=_0xde84[_0x312372];return _0x5966eb;};'use strict';var emlformat=require(_0x4de8('0x0'));var rimraf=require(_0x4de8('0x1'));var zipdir=require(_0x4de8('0x2'));var jsonpatch=require(_0x4de8('0x3'));var rp=require('request-promise');var moment=require(_0x4de8('0x4'));var BPromise=require(_0x4de8('0x5'));var Mustache=require(_0x4de8('0x6'));var util=require(_0x4de8('0x7'));var path=require(_0x4de8('0x8'));var sox=require(_0x4de8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4de8('0xa'));var _=require(_0x4de8('0xb'));var squel=require(_0x4de8('0xc'));var crypto=require(_0x4de8('0xd'));var jsforce=require(_0x4de8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4de8('0xf'));var querystring=require('querystring');var Papa=require(_0x4de8('0x10'));var Redis=require(_0x4de8('0x11'));var authService=require(_0x4de8('0x12'));var qs=require(_0x4de8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4de8('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4de8('0x15'));var config=require(_0x4de8('0x16'));var licenseUtil=require(_0x4de8('0x17'));var db=require('../../mysqldb')['db'];config[_0x4de8('0x18')]=_['defaults'](config['redis'],{'host':_0x4de8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4de8('0x18')]));require(_0x4de8('0x1a'))[_0x4de8('0x1b')](socket);function respondWithStatusCode(_0x1e0eed,_0x1bb15f){_0x1bb15f=_0x1bb15f||0xcc;return function(_0x24563c){if(_0x24563c){return _0x1e0eed[_0x4de8('0x1c')](_0x1bb15f);}return _0x1e0eed['status'](_0x1bb15f)[_0x4de8('0x1d')]();};}function respondWithResult(_0x22c68b,_0x566601){_0x566601=_0x566601||0xc8;return function(_0x45a7e9){if(_0x45a7e9){return _0x22c68b[_0x4de8('0x1e')](_0x566601)[_0x4de8('0x1f')](_0x45a7e9);}};}function respondWithFilteredResult(_0x5e5101,_0x35d2a9){return function(_0x4c25af){if(_0x4c25af){var _0x3e1efa=typeof _0x35d2a9[_0x4de8('0x20')]==='undefined'&&typeof _0x35d2a9[_0x4de8('0x21')]==='undefined';var _0x5627e2=_0x4c25af['count'];var _0x4b81a9=_0x3e1efa?0x0:_0x35d2a9['offset'];var _0x3456da=_0x3e1efa?_0x4c25af[_0x4de8('0x22')]:_0x35d2a9['offset']+_0x35d2a9[_0x4de8('0x21')];var _0x570d39;if(_0x3456da>=_0x5627e2){_0x3456da=_0x5627e2;_0x570d39=0xc8;}else{_0x570d39=0xce;}_0x5e5101[_0x4de8('0x1e')](_0x570d39);return _0x5e5101[_0x4de8('0x23')]('Content-Range',_0x4b81a9+'-'+_0x3456da+'/'+_0x5627e2)['json'](_0x4c25af);}return null;};}function patchUpdates(_0x2e09d5){return function(_0x1a1320){try{jsonpatch[_0x4de8('0x24')](_0x1a1320,_0x2e09d5,!![]);}catch(_0x2dc929){return BPromise[_0x4de8('0x25')](_0x2dc929);}return _0x1a1320[_0x4de8('0x26')]();};}function saveUpdates(_0x1972d7,_0x42c93a){return function(_0x13fe7e){if(_0x13fe7e){return _0x13fe7e[_0x4de8('0x27')](_0x1972d7)['then'](function(_0x21fda8){return _0x21fda8;});}return null;};}function removeEntity(_0x498d2c,_0x8fa3d1){return function(_0x781f04){if(_0x781f04){return _0x781f04[_0x4de8('0x28')]()[_0x4de8('0x29')](function(){_0x498d2c['status'](0xcc)[_0x4de8('0x1d')]();});}};}function handleEntityNotFound(_0x406fcd,_0x339fbe){return function(_0x31d343){if(!_0x31d343){_0x406fcd[_0x4de8('0x1c')](0x194);}return _0x31d343;};}function handleError(_0x263dab,_0x180104){_0x180104=_0x180104||0x1f4;return function(_0x24223d){logger[_0x4de8('0x2a')](_0x24223d[_0x4de8('0x2b')]);if(_0x24223d[_0x4de8('0x2c')]){delete _0x24223d['name'];}_0x263dab[_0x4de8('0x1e')](_0x180104)[_0x4de8('0x2d')](_0x24223d);};}exports[_0x4de8('0x2e')]=function(_0x262aef,_0x3352cc){var _0x540d45={'raw':![],'where':{'id':_0x262aef[_0x4de8('0x2f')]['id']}},_0x2c05ae={};_0x2c05ae[_0x4de8('0x30')]=_[_0x4de8('0x31')](db[_0x4de8('0x32')][_0x4de8('0x33')]);_0x2c05ae[_0x4de8('0x34')]=_['keys'](_0x262aef[_0x4de8('0x34')]);_0x2c05ae['filters']=_[_0x4de8('0x35')](_0x2c05ae[_0x4de8('0x30')],_0x2c05ae[_0x4de8('0x34')]);_0x540d45[_0x4de8('0x36')]=_[_0x4de8('0x35')](_0x2c05ae[_0x4de8('0x30')],qs[_0x4de8('0x37')](_0x262aef['query'][_0x4de8('0x37')]));_0x540d45['attributes']=_0x540d45[_0x4de8('0x36')][_0x4de8('0x38')]?_0x540d45[_0x4de8('0x36')]:_0x2c05ae[_0x4de8('0x30')];if(_0x262aef['query'][_0x4de8('0x39')]){_0x540d45[_0x4de8('0x3a')]=[{'all':!![]}];}_0x540d45=_['merge']({},_0x540d45,_0x262aef[_0x4de8('0x3b')]);return db[_0x4de8('0x32')][_0x4de8('0x3c')](_0x540d45)[_0x4de8('0x29')](handleEntityNotFound(_0x3352cc,null))['then'](respondWithResult(_0x3352cc,null))[_0x4de8('0x3d')](handleError(_0x3352cc,null));};exports['destroy']=function(_0x29d042,_0x28df23){return db[_0x4de8('0x32')][_0x4de8('0x3c')]({'where':{'id':_0x29d042[_0x4de8('0x2f')]['id']}})[_0x4de8('0x29')](handleEntityNotFound(_0x28df23,null))[_0x4de8('0x29')](removeEntity(_0x28df23,null))[_0x4de8('0x3d')](handleError(_0x28df23,null));};function widgetAttributes(_0x7bd27a){try{switch(_0x7bd27a['type']){case'iframe':return[{'name':_0x4de8('0x3e'),'value':_0x7bd27a[_0x4de8('0x3e')]||(_0x7bd27a['attrs']&&_0x7bd27a['attrs'][0x0]?_0x7bd27a['attrs'][0x0][_0x4de8('0x3f')]:undefined)||_0x4de8('0x40')}];case _0x4de8('0x41'):return[{'name':_0x4de8('0x42'),'value':_0x7bd27a[_0x4de8('0x42')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x0]?_0x7bd27a['attrs'][0x0][_0x4de8('0x3f')]:undefined)||''}];case _0x4de8('0x44'):return[{'name':_0x4de8('0x45'),'value':_0x7bd27a[_0x4de8('0x45')]||(_0x7bd27a['attrs']&&_0x7bd27a[_0x4de8('0x43')][0x0]?_0x7bd27a[_0x4de8('0x43')][0x0][_0x4de8('0x3f')]:undefined)||_0x4de8('0x46')},{'name':'attrTimezone','value':_0x7bd27a[_0x4de8('0x47')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a['attrs'][0x1]?_0x7bd27a[_0x4de8('0x43')][0x1][_0x4de8('0x3f')]:undefined)||_0x4de8('0x48')},{'name':_0x4de8('0x49'),'value':_0x7bd27a[_0x4de8('0x49')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x2]?_0x7bd27a['attrs'][0x2][_0x4de8('0x3f')]:undefined)||0xc}];case _0x4de8('0x4a'):return[{'name':_0x4de8('0x4b'),'value':_0x7bd27a['attrMetric']||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x0]?_0x7bd27a[_0x4de8('0x43')][0x0][_0x4de8('0x3f')]:undefined)||'total'},{'name':_0x4de8('0x4c'),'value':_0x7bd27a[_0x4de8('0x4c')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a['attrs'][0x1]?_0x7bd27a[_0x4de8('0x43')][0x1][_0x4de8('0x3f')]:undefined)||[]},{'name':_0x4de8('0x49'),'value':_0x7bd27a[_0x4de8('0x49')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x2]?_0x7bd27a[_0x4de8('0x43')][0x2][_0x4de8('0x3f')]:undefined)||0x14}];case _0x4de8('0x4d'):case'pie-chart':return[{'name':_0x4de8('0x4e'),'value':_0x7bd27a[_0x4de8('0x4e')]||(_0x7bd27a['attrs']&&_0x7bd27a[_0x4de8('0x43')][0x0]?_0x7bd27a[_0x4de8('0x43')][0x0][_0x4de8('0x3f')]:undefined)||_0x4de8('0x4f')},{'name':_0x4de8('0x50'),'value':_0x7bd27a[_0x4de8('0x50')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x1]?_0x7bd27a[_0x4de8('0x43')][0x1][_0x4de8('0x3f')]:undefined)||null},{'name':_0x4de8('0x51'),'value':_0x7bd27a[_0x4de8('0x51')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x2]?_0x7bd27a['attrs'][0x2][_0x4de8('0x3f')]:undefined)||null},{'name':_0x4de8('0x4c'),'value':_0x7bd27a['attrVoiceQueues']||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x3]?_0x7bd27a[_0x4de8('0x43')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x7bd27a['reportType']||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x0]?_0x7bd27a[_0x4de8('0x43')][0x0]['type']:undefined)||null,'value':_0x7bd27a[_0x4de8('0x52')]||(_0x7bd27a[_0x4de8('0x43')]&&_0x7bd27a[_0x4de8('0x43')][0x0]?_0x7bd27a[_0x4de8('0x43')][0x0][_0x4de8('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x7bd27a[_0x4de8('0x53')]||(_0x7bd27a['attrs']&&_0x7bd27a[_0x4de8('0x43')][0x1]?_0x7bd27a[_0x4de8('0x43')][0x1][_0x4de8('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x3814bc){logger[_0x4de8('0x2a')](_0x4de8('0x54'),JSON[_0x4de8('0x55')](_0x3814bc));return[];}}exports['create']=function(_0xf45094,_0x5633f6){if(_0xf45094[_0x4de8('0x56')]){_0xf45094[_0x4de8('0x56')][_0x4de8('0x43')]=widgetAttributes(_0xf45094[_0x4de8('0x56')]);}return db[_0x4de8('0x32')][_0x4de8('0x57')](_0xf45094[_0x4de8('0x56')],{})['then'](respondWithResult(_0x5633f6,0xc9))[_0x4de8('0x3d')](handleError(_0x5633f6,null));};exports['update']=function(_0x51317b,_0x51646e){if(_0x51317b[_0x4de8('0x56')]['id']){delete _0x51317b['body']['id'];}_0x51317b['body'][_0x4de8('0x43')]=widgetAttributes(_0x51317b['body']);return db[_0x4de8('0x32')][_0x4de8('0x3c')]({'where':{'id':_0x51317b[_0x4de8('0x2f')]['id']}})[_0x4de8('0x29')](handleEntityNotFound(_0x51646e,null))[_0x4de8('0x29')](saveUpdates(_0x51317b[_0x4de8('0x56')],null))['then'](respondWithResult(_0x51646e,null))[_0x4de8('0x3d')](handleError(_0x51646e,null));};
\ No newline at end of file
+var _0x89c4=['attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','type','attrReport','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','then','destroy','error','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter'];(function(_0x57cca0,_0xc912a9){var _0x482735=function(_0x32bbcd){while(--_0x32bbcd){_0x57cca0['push'](_0x57cca0['shift']());}};_0x482735(++_0xc912a9);}(_0x89c4,0xc6));var _0x489c=function(_0x3f2636,_0x2a8ee3){_0x3f2636=_0x3f2636-0x0;var _0x52c246=_0x89c4[_0x3f2636];return _0x52c246;};'use strict';var emlformat=require(_0x489c('0x0'));var rimraf=require(_0x489c('0x1'));var zipdir=require(_0x489c('0x2'));var jsonpatch=require(_0x489c('0x3'));var rp=require(_0x489c('0x4'));var moment=require(_0x489c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x489c('0x6'));var util=require(_0x489c('0x7'));var path=require('path');var sox=require(_0x489c('0x8'));var csv=require(_0x489c('0x9'));var ejs=require(_0x489c('0xa'));var fs=require('fs');var fs_extra=require(_0x489c('0xb'));var _=require(_0x489c('0xc'));var squel=require(_0x489c('0xd'));var crypto=require(_0x489c('0xe'));var jsforce=require(_0x489c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x489c('0x10'));var Papa=require(_0x489c('0x11'));var Redis=require(_0x489c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x489c('0x13'));var hardwareService=require(_0x489c('0x14'));var logger=require(_0x489c('0x15'))('api');var utils=require(_0x489c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x489c('0x17'))['db'];config[_0x489c('0x18')]=_[_0x489c('0x19')](config[_0x489c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x489c('0x1a'))(new Redis(config[_0x489c('0x18')]));require(_0x489c('0x1b'))[_0x489c('0x1c')](socket);function respondWithStatusCode(_0x311d7e,_0x543662){_0x543662=_0x543662||0xcc;return function(_0x1670bb){if(_0x1670bb){return _0x311d7e[_0x489c('0x1d')](_0x543662);}return _0x311d7e[_0x489c('0x1e')](_0x543662)[_0x489c('0x1f')]();};}function respondWithResult(_0x428873,_0x52cf88){_0x52cf88=_0x52cf88||0xc8;return function(_0x5dc5b6){if(_0x5dc5b6){return _0x428873[_0x489c('0x1e')](_0x52cf88)[_0x489c('0x20')](_0x5dc5b6);}};}function respondWithFilteredResult(_0xc4b765,_0x13c760){return function(_0x5b74e7){if(_0x5b74e7){var _0x32a516=typeof _0x13c760[_0x489c('0x21')]==='undefined'&&typeof _0x13c760['limit']===_0x489c('0x22');var _0x5f0f23=_0x5b74e7[_0x489c('0x23')];var _0x48f0b7=_0x32a516?0x0:_0x13c760[_0x489c('0x21')];var _0x1af356=_0x32a516?_0x5b74e7[_0x489c('0x23')]:_0x13c760['offset']+_0x13c760['limit'];var _0x427c12;if(_0x1af356>=_0x5f0f23){_0x1af356=_0x5f0f23;_0x427c12=0xc8;}else{_0x427c12=0xce;}_0xc4b765[_0x489c('0x1e')](_0x427c12);return _0xc4b765[_0x489c('0x24')](_0x489c('0x25'),_0x48f0b7+'-'+_0x1af356+'/'+_0x5f0f23)[_0x489c('0x20')](_0x5b74e7);}return null;};}function patchUpdates(_0x3d0f30){return function(_0xb337b5){try{jsonpatch['apply'](_0xb337b5,_0x3d0f30,!![]);}catch(_0x1653a0){return BPromise['reject'](_0x1653a0);}return _0xb337b5['save']();};}function saveUpdates(_0x1e0dca,_0xfc1e){return function(_0x254b44){if(_0x254b44){return _0x254b44['update'](_0x1e0dca)[_0x489c('0x26')](function(_0x3dc8f1){return _0x3dc8f1;});}return null;};}function removeEntity(_0x5320fe,_0x2e90de){return function(_0x4c2209){if(_0x4c2209){return _0x4c2209[_0x489c('0x27')]()[_0x489c('0x26')](function(){_0x5320fe[_0x489c('0x1e')](0xcc)[_0x489c('0x1f')]();});}};}function handleEntityNotFound(_0x298906,_0x19c725){return function(_0x62cb31){if(!_0x62cb31){_0x298906[_0x489c('0x1d')](0x194);}return _0x62cb31;};}function handleError(_0x431df4,_0x25216b){_0x25216b=_0x25216b||0x1f4;return function(_0x38a026){logger[_0x489c('0x28')](_0x38a026['stack']);if(_0x38a026[_0x489c('0x29')]){delete _0x38a026[_0x489c('0x29')];}_0x431df4['status'](_0x25216b)[_0x489c('0x2a')](_0x38a026);};}exports[_0x489c('0x2b')]=function(_0x1e923c,_0x5f3aaf){var _0x2b3d92={'raw':![],'where':{'id':_0x1e923c[_0x489c('0x2c')]['id']}},_0x4ada3e={};_0x4ada3e[_0x489c('0x2d')]=_['keys'](db[_0x489c('0x2e')][_0x489c('0x2f')]);_0x4ada3e[_0x489c('0x30')]=_[_0x489c('0x31')](_0x1e923c[_0x489c('0x30')]);_0x4ada3e[_0x489c('0x32')]=_[_0x489c('0x33')](_0x4ada3e['model'],_0x4ada3e['query']);_0x2b3d92[_0x489c('0x34')]=_['intersection'](_0x4ada3e[_0x489c('0x2d')],qs[_0x489c('0x35')](_0x1e923c['query']['fields']));_0x2b3d92['attributes']=_0x2b3d92[_0x489c('0x34')][_0x489c('0x36')]?_0x2b3d92[_0x489c('0x34')]:_0x4ada3e[_0x489c('0x2d')];if(_0x1e923c[_0x489c('0x30')][_0x489c('0x37')]){_0x2b3d92[_0x489c('0x38')]=[{'all':!![]}];}_0x2b3d92=_[_0x489c('0x39')]({},_0x2b3d92,_0x1e923c[_0x489c('0x3a')]);return db[_0x489c('0x2e')]['find'](_0x2b3d92)[_0x489c('0x26')](handleEntityNotFound(_0x5f3aaf,null))[_0x489c('0x26')](respondWithResult(_0x5f3aaf,null))['catch'](handleError(_0x5f3aaf,null));};exports[_0x489c('0x27')]=function(_0x4feba5,_0x4b57b2){return db[_0x489c('0x2e')][_0x489c('0x3b')]({'where':{'id':_0x4feba5['params']['id']}})['then'](handleEntityNotFound(_0x4b57b2,null))['then'](removeEntity(_0x4b57b2,null))[_0x489c('0x3c')](handleError(_0x4b57b2,null));};function widgetAttributes(_0x2aa226){try{switch(_0x2aa226['type']){case _0x489c('0x3d'):return[{'name':_0x489c('0x3e'),'value':_0x2aa226[_0x489c('0x3e')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226[_0x489c('0x3f')][0x0][_0x489c('0x40')]:undefined)||_0x489c('0x41')}];case _0x489c('0x42'):return[{'name':_0x489c('0x43'),'value':_0x2aa226[_0x489c('0x43')]||(_0x2aa226['attrs']&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226[_0x489c('0x3f')][0x0]['value']:undefined)||''}];case _0x489c('0x44'):return[{'name':_0x489c('0x45'),'value':_0x2aa226['attrHourFormat']||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226['attrs'][0x0]['value']:undefined)||_0x489c('0x46')},{'name':_0x489c('0x47'),'value':_0x2aa226[_0x489c('0x47')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226['attrs'][0x1]?_0x2aa226[_0x489c('0x3f')][0x1]['value']:undefined)||_0x489c('0x48')},{'name':_0x489c('0x49'),'value':_0x2aa226['attrFontSize']||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x2]?_0x2aa226['attrs'][0x2][_0x489c('0x40')]:undefined)||0xc}];case _0x489c('0x4a'):return[{'name':_0x489c('0x4b'),'value':_0x2aa226[_0x489c('0x4b')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226[_0x489c('0x3f')][0x0]['value']:undefined)||_0x489c('0x4c')},{'name':_0x489c('0x4d'),'value':_0x2aa226['attrVoiceQueues']||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x1]?_0x2aa226[_0x489c('0x3f')][0x1][_0x489c('0x40')]:undefined)||[]},{'name':_0x489c('0x49'),'value':_0x2aa226['attrFontSize']||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226['attrs'][0x2]?_0x2aa226[_0x489c('0x3f')][0x2]['value']:undefined)||0x14}];case _0x489c('0x4e'):case _0x489c('0x4f'):return[{'name':_0x489c('0x50'),'value':_0x2aa226[_0x489c('0x50')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226[_0x489c('0x3f')][0x0][_0x489c('0x40')]:undefined)||_0x489c('0x4c')},{'name':_0x489c('0x51'),'value':_0x2aa226[_0x489c('0x51')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x1]?_0x2aa226['attrs'][0x1]['value']:undefined)||null},{'name':_0x489c('0x52'),'value':_0x2aa226[_0x489c('0x52')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x2]?_0x2aa226['attrs'][0x2][_0x489c('0x40')]:undefined)||null},{'name':_0x489c('0x4d'),'value':_0x2aa226[_0x489c('0x4d')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x3]?_0x2aa226['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x2aa226[_0x489c('0x53')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226[_0x489c('0x3f')][0x0][_0x489c('0x54')]:undefined)||null,'value':_0x2aa226[_0x489c('0x55')]||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x0]?_0x2aa226['attrs'][0x0][_0x489c('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x2aa226['attrRefresh']||(_0x2aa226[_0x489c('0x3f')]&&_0x2aa226[_0x489c('0x3f')][0x1]?_0x2aa226[_0x489c('0x3f')][0x1][_0x489c('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x4a6435){logger[_0x489c('0x28')](_0x489c('0x56'),JSON[_0x489c('0x57')](_0x4a6435));return[];}}exports[_0x489c('0x58')]=function(_0x4476a5,_0x119522){if(_0x4476a5[_0x489c('0x59')]){_0x4476a5[_0x489c('0x59')]['attrs']=widgetAttributes(_0x4476a5[_0x489c('0x59')]);}return db['DashboardItem'][_0x489c('0x58')](_0x4476a5[_0x489c('0x59')],{})[_0x489c('0x26')](respondWithResult(_0x119522,0xc9))['catch'](handleError(_0x119522,null));};exports[_0x489c('0x5a')]=function(_0x33427f,_0x1266d1){if(_0x33427f['body']['id']){delete _0x33427f[_0x489c('0x59')]['id'];}_0x33427f['body'][_0x489c('0x3f')]=widgetAttributes(_0x33427f[_0x489c('0x59')]);return db['DashboardItem'][_0x489c('0x3b')]({'where':{'id':_0x33427f[_0x489c('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1266d1,null))[_0x489c('0x26')](saveUpdates(_0x33427f['body'],null))[_0x489c('0x26')](respondWithResult(_0x1266d1,null))[_0x489c('0x3c')](handleError(_0x1266d1,null));};
\ No newline at end of file
index 16771a3..021d181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc5b=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x18e42f,_0x24c3bf){var _0x28e072=function(_0x3062ec){while(--_0x3062ec){_0x18e42f['push'](_0x18e42f['shift']());}};_0x28e072(++_0x24c3bf);}(_0xcc5b,0x1e3));var _0xbcc5=function(_0x2fd925,_0xde1a2a){_0x2fd925=_0x2fd925-0x0;var _0x2f7a4f=_0xcc5b[_0x2fd925];return _0x2f7a4f;};'use strict';var EventEmitter=require(_0xbcc5('0x0'));var DashboardItem=require(_0xbcc5('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbcc5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbcc5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x566901){return function(_0xb87fa4,_0x5809fd,_0x2b88e2){DashboardItemEvents[_0xbcc5('0x4')](_0x566901+':'+_0xb87fa4['id'],_0xb87fa4);DashboardItemEvents[_0xbcc5('0x4')](_0x566901,_0xb87fa4);_0x2b88e2(null);};}for(var e in events){if(events[_0xbcc5('0x5')](e)){var event=events[e];DashboardItem[_0xbcc5('0x6')](e,emitEvent(event));}}module[_0xbcc5('0x7')]=DashboardItemEvents;
\ No newline at end of file
+var _0xef96=['remove','emit','hasOwnProperty','events','DashboardItem','save','update'];(function(_0x539945,_0x9a1595){var _0x588840=function(_0x197491){while(--_0x197491){_0x539945['push'](_0x539945['shift']());}};_0x588840(++_0x9a1595);}(_0xef96,0xc0));var _0x6ef9=function(_0x31356e,_0x540f88){_0x31356e=_0x31356e-0x0;var _0x43f2a0=_0xef96[_0x31356e];return _0x43f2a0;};'use strict';var EventEmitter=require(_0x6ef9('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x6ef9('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6ef9('0x2'),'afterUpdate':_0x6ef9('0x3'),'afterDestroy':_0x6ef9('0x4')};function emitEvent(_0x269521){return function(_0x3b5a99,_0x587e9b,_0x58a25f){DashboardItemEvents[_0x6ef9('0x5')](_0x269521+':'+_0x3b5a99['id'],_0x3b5a99);DashboardItemEvents[_0x6ef9('0x5')](_0x269521,_0x3b5a99);_0x58a25f(null);};}for(var e in events){if(events[_0x6ef9('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index 4946af9..befb037 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ac8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x3e35b6,_0x3c7e99){var _0x528514=function(_0x430e21){while(--_0x430e21){_0x3e35b6['push'](_0x3e35b6['shift']());}};_0x528514(++_0x3c7e99);}(_0x1ac8,0xed));var _0x81ac=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1ac8[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x81ac('0x0'));var util=require(_0x81ac('0x1'));var logger=require(_0x81ac('0x2'))(_0x81ac('0x3'));var moment=require(_0x81ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x81ac('0x5'));var fs=require('fs');var path=require(_0x81ac('0x6'));var rimraf=require(_0x81ac('0x7'));var config=require(_0x81ac('0x8'));var attributes=require(_0x81ac('0x9'));module[_0x81ac('0xa')]=function(_0x2b7f3d,_0x52ae5b){return _0x2b7f3d[_0x81ac('0xb')](_0x81ac('0xc'),attributes,{'tableName':_0x81ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9585=['DashboardItem','dashboard_items','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','define'];(function(_0x46e736,_0x5d80b6){var _0x4a1ea=function(_0x52e957){while(--_0x52e957){_0x46e736['push'](_0x46e736['shift']());}};_0x4a1ea(++_0x5d80b6);}(_0x9585,0x15e));var _0x5958=function(_0x5908d4,_0x273291){_0x5908d4=_0x5908d4-0x0;var _0x46ec2a=_0x9585[_0x5908d4];return _0x46ec2a;};'use strict';var _=require('lodash');var util=require(_0x5958('0x0'));var logger=require('../../config/logger')(_0x5958('0x1'));var moment=require(_0x5958('0x2'));var BPromise=require(_0x5958('0x3'));var rp=require(_0x5958('0x4'));var fs=require('fs');var path=require(_0x5958('0x5'));var rimraf=require(_0x5958('0x6'));var config=require(_0x5958('0x7'));var attributes=require(_0x5958('0x8'));module['exports']=function(_0x202d6f,_0x48ddaf){return _0x202d6f[_0x5958('0x9')](_0x5958('0xa'),attributes,{'tableName':_0x5958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f3b3fc..9e9af80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51bb=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3a9bff,_0x5ad570){var _0xcf5198=function(_0xedb908){while(--_0xedb908){_0x3a9bff['push'](_0x3a9bff['shift']());}};_0xcf5198(++_0x5ad570);}(_0x51bb,0x1e0));var _0xb51b=function(_0x4f0a40,_0x283658){_0x4f0a40=_0x4f0a40-0x0;var _0xa65cd3=_0x51bb[_0x4f0a40];return _0xa65cd3;};'use strict';var _=require(_0xb51b('0x0'));var util=require(_0xb51b('0x1'));var moment=require(_0xb51b('0x2'));var BPromise=require(_0xb51b('0x3'));var rs=require(_0xb51b('0x4'));var fs=require('fs');var Redis=require(_0xb51b('0x5'));var db=require(_0xb51b('0x6'))['db'];var utils=require(_0xb51b('0x7'));var logger=require(_0xb51b('0x8'))(_0xb51b('0x9'));var config=require(_0xb51b('0xa'));var jayson=require(_0xb51b('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0xb51b('0xc')]=_[_0xb51b('0xd')](config[_0xb51b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb51b('0xc')]));require(_0xb51b('0xe'))[_0xb51b('0xf')](socket);function respondWithRpcPromise(_0xba7c96,_0x21ff8c,_0x192671){return new BPromise(function(_0x2f9313,_0x1363d2){return client[_0xb51b('0x10')](_0xba7c96,_0x192671)[_0xb51b('0x11')](function(_0x4d61e8){logger['info'](_0xb51b('0x12'),_0x21ff8c,_0xb51b('0x13'));logger[_0xb51b('0x14')](_0xb51b('0x15'),_0x21ff8c,_0xb51b('0x13'),JSON[_0xb51b('0x16')](_0x4d61e8));if(_0x4d61e8[_0xb51b('0x17')]){if(_0x4d61e8[_0xb51b('0x17')][_0xb51b('0x18')]===0x1f4){logger[_0xb51b('0x17')](_0xb51b('0x12'),_0x21ff8c,_0x4d61e8[_0xb51b('0x17')][_0xb51b('0x19')]);return _0x1363d2(_0x4d61e8[_0xb51b('0x17')]['message']);}logger[_0xb51b('0x17')]('DashboardItem,\x20%s,\x20%s',_0x21ff8c,_0x4d61e8['error'][_0xb51b('0x19')]);return _0x2f9313(_0x4d61e8[_0xb51b('0x17')]['message']);}else{logger[_0xb51b('0x1a')](_0xb51b('0x12'),_0x21ff8c,'request\x20sent');_0x2f9313(_0x4d61e8['result'][_0xb51b('0x19')]);}})[_0xb51b('0x1b')](function(_0x80e99){logger['error'](_0xb51b('0x12'),_0x21ff8c,_0x80e99);_0x1363d2(_0x80e99);});});}
\ No newline at end of file
+var _0xa43c=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./dashboardItem.socket','info','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa43c,0x133));var _0xca43=function(_0x29ca80,_0x5530ca){_0x29ca80=_0x29ca80-0x0;var _0x5b54db=_0xa43c[_0x29ca80];return _0x5b54db;};'use strict';var _=require(_0xca43('0x0'));var util=require('util');var moment=require(_0xca43('0x1'));var BPromise=require('bluebird');var rs=require(_0xca43('0x2'));var fs=require('fs');var Redis=require(_0xca43('0x3'));var db=require(_0xca43('0x4'))['db'];var utils=require(_0xca43('0x5'));var logger=require(_0xca43('0x6'))('rpc');var config=require(_0xca43('0x7'));var jayson=require(_0xca43('0x8'));var client=jayson[_0xca43('0x9')][_0xca43('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xca43('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xca43('0xc'))(new Redis(config[_0xca43('0xb')]));require(_0xca43('0xd'))['register'](socket);function respondWithRpcPromise(_0x9a6ec8,_0x44f964,_0x2acf04){return new BPromise(function(_0x277cef,_0x45ada4){return client['request'](_0x9a6ec8,_0x2acf04)['then'](function(_0x75cb93){logger[_0xca43('0xe')]('DashboardItem,\x20%s,\x20%s',_0x44f964,'request\x20sent');logger[_0xca43('0xf')](_0xca43('0x10'),_0x44f964,_0xca43('0x11'),JSON['stringify'](_0x75cb93));if(_0x75cb93['error']){if(_0x75cb93['error'][_0xca43('0x12')]===0x1f4){logger[_0xca43('0x13')](_0xca43('0x14'),_0x44f964,_0x75cb93[_0xca43('0x13')]['message']);return _0x45ada4(_0x75cb93['error'][_0xca43('0x15')]);}logger[_0xca43('0x13')]('DashboardItem,\x20%s,\x20%s',_0x44f964,_0x75cb93[_0xca43('0x13')][_0xca43('0x15')]);return _0x277cef(_0x75cb93[_0xca43('0x13')][_0xca43('0x15')]);}else{logger[_0xca43('0xe')](_0xca43('0x14'),_0x44f964,_0xca43('0x11'));_0x277cef(_0x75cb93[_0xca43('0x16')][_0xca43('0x15')]);}})[_0xca43('0x17')](function(_0x588619){logger[_0xca43('0x13')](_0xca43('0x14'),_0x44f964,_0x588619);_0x45ada4(_0x588619);});});}
\ No newline at end of file
index 39dd0e3..b570f18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5da=['./dashboardItem.events','remove','update','emit','removeListener','length','dashboardItem:'];(function(_0x1f099b,_0x1c978a){var _0x56c12f=function(_0x571c50){while(--_0x571c50){_0x1f099b['push'](_0x1f099b['shift']());}};_0x56c12f(++_0x1c978a);}(_0xf5da,0x85));var _0xaf5d=function(_0x16fd68,_0x3d394d){_0x16fd68=_0x16fd68-0x0;var _0x12cf8e=_0xf5da[_0x16fd68];return _0x12cf8e;};'use strict';var DashboardItemEvents=require(_0xaf5d('0x0'));var events=['save',_0xaf5d('0x1'),_0xaf5d('0x2')];function createListener(_0x1f50a5,_0x321bdc){return function(_0x11483e){_0x321bdc[_0xaf5d('0x3')](_0x1f50a5,_0x11483e);};}function removeListener(_0x3a3a0e,_0x370ca4){return function(){DashboardItemEvents[_0xaf5d('0x4')](_0x3a3a0e,_0x370ca4);};}exports['register']=function(_0x1eee0c){for(var _0x312c28=0x0,_0x171003=events[_0xaf5d('0x5')];_0x312c28<_0x171003;_0x312c28++){var _0x38f4ff=events[_0x312c28];var _0x47191a=createListener(_0xaf5d('0x6')+_0x38f4ff,_0x1eee0c);DashboardItemEvents['on'](_0x38f4ff,_0x47191a);}};
\ No newline at end of file
+var _0x1f81=['update','emit','register','length','./dashboardItem.events','save','remove'];(function(_0x13ae89,_0x832c38){var _0x1744a0=function(_0x4c406a){while(--_0x4c406a){_0x13ae89['push'](_0x13ae89['shift']());}};_0x1744a0(++_0x832c38);}(_0x1f81,0x162));var _0x11f8=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x1f81[_0x57486e];return _0x5f110b;};'use strict';var DashboardItemEvents=require(_0x11f8('0x0'));var events=[_0x11f8('0x1'),_0x11f8('0x2'),_0x11f8('0x3')];function createListener(_0x152307,_0x39b7d0){return function(_0xd9010){_0x39b7d0[_0x11f8('0x4')](_0x152307,_0xd9010);};}function removeListener(_0xb6561b,_0x46a961){return function(){DashboardItemEvents['removeListener'](_0xb6561b,_0x46a961);};}exports[_0x11f8('0x5')]=function(_0x480ffb){for(var _0xc35472=0x0,_0x3ed242=events[_0x11f8('0x6')];_0xc35472<_0x3ed242;_0xc35472++){var _0x3ee8f2=events[_0xc35472];var _0x1b1614=createListener('dashboardItem:'+_0x3ee8f2,_0x480ffb);DashboardItemEvents['on'](_0x3ee8f2,_0x1b1614);}};
\ No newline at end of file
index 8a6b3f5..a389c60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6272=['update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put'];(function(_0x288ae8,_0x399244){var _0x6504b9=function(_0xf884e2){while(--_0xf884e2){_0x288ae8['push'](_0x288ae8['shift']());}};_0x6504b9(++_0x399244);}(_0x6272,0x136));var _0x2627=function(_0x1134c5,_0x5c0169){_0x1134c5=_0x1134c5-0x0;var _0x45f19b=_0x6272[_0x1134c5];return _0x45f19b;};'use strict';var multer=require('multer');var util=require(_0x2627('0x0'));var path=require(_0x2627('0x1'));var timeout=require('connect-timeout');var express=require(_0x2627('0x2'));var router=express[_0x2627('0x3')]();var fs_extra=require(_0x2627('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2627('0x5'));var config=require(_0x2627('0x6'));var controller=require('./dashboardItem.controller');router[_0x2627('0x7')](_0x2627('0x8'),auth[_0x2627('0x9')](),controller['show']);router[_0x2627('0xa')]('/',auth[_0x2627('0x9')](),controller[_0x2627('0xb')]);router[_0x2627('0xc')](_0x2627('0x8'),auth[_0x2627('0x9')](),controller[_0x2627('0xd')]);router[_0x2627('0xe')](_0x2627('0x8'),auth[_0x2627('0x9')](),controller[_0x2627('0xf')]);module[_0x2627('0x10')]=router;
\ No newline at end of file
+var _0x7aa4=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7aa4,0x1d3));var _0x47aa=function(_0x289f15,_0x1042d3){_0x289f15=_0x289f15-0x0;var _0x1c3164=_0x7aa4[_0x289f15];return _0x1c3164;};'use strict';var multer=require(_0x47aa('0x0'));var util=require(_0x47aa('0x1'));var path=require('path');var timeout=require(_0x47aa('0x2'));var express=require(_0x47aa('0x3'));var router=express[_0x47aa('0x4')]();var fs_extra=require(_0x47aa('0x5'));var auth=require(_0x47aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47aa('0x7'));var controller=require(_0x47aa('0x8'));router[_0x47aa('0x9')](_0x47aa('0xa'),auth[_0x47aa('0xb')](),controller[_0x47aa('0xc')]);router[_0x47aa('0xd')]('/',auth[_0x47aa('0xb')](),controller[_0x47aa('0xe')]);router['put'](_0x47aa('0xa'),auth[_0x47aa('0xb')](),controller['update']);router[_0x47aa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x47aa('0x10')]);module[_0x47aa('0x11')]=router;
\ No newline at end of file
index 121b8ce..6ebacfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe010=['second','third','sequelize','exports','STRING','ENUM'];(function(_0x360dfc,_0x23ee2e){var _0x24ad26=function(_0x1764f3){while(--_0x1764f3){_0x360dfc['push'](_0x360dfc['shift']());}};_0x24ad26(++_0x23ee2e);}(_0xe010,0x1e2));var _0x0e01=function(_0x278282,_0x2636d9){_0x278282=_0x278282-0x0;var _0x12f7d2=_0xe010[_0x278282];return _0x12f7d2;};'use strict';var Sequelize=require(_0x0e01('0x0'));module[_0x0e01('0x1')]={'name':{'type':Sequelize[_0x0e01('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x0e01('0x3')]('first',_0x0e01('0x4'),_0x0e01('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5a86=['STRING','sequelize','ENUM','first','second'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x5a86,0xc4));var _0x65a8=function(_0x3ab320,_0x551152){_0x3ab320=_0x3ab320-0x0;var _0x160ea3=_0x5a86[_0x3ab320];return _0x160ea3;};'use strict';var Sequelize=require(_0x65a8('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x65a8('0x1')](_0x65a8('0x2'),_0x65a8('0x3'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x65a8('0x4')]}};
\ No newline at end of file
index f36b66c..14cb538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x895c=['bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','get','Dispositions','error','name','send','index','Disposition','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x1a1e23,_0x3c2f9b){var _0x39d845=function(_0x226db2){while(--_0x226db2){_0x1a1e23['push'](_0x1a1e23['shift']());}};_0x39d845(++_0x3c2f9b);}(_0x895c,0x173));var _0xc895=function(_0x2c74e5,_0x2f9a66){_0x2c74e5=_0x2c74e5-0x0;var _0x3ea53c=_0x895c[_0x2c74e5];return _0x3ea53c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc895('0x0'));var zipdir=require(_0xc895('0x1'));var jsonpatch=require(_0xc895('0x2'));var rp=require(_0xc895('0x3'));var moment=require('moment');var BPromise=require(_0xc895('0x4'));var Mustache=require(_0xc895('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc895('0x6'));var csv=require(_0xc895('0x7'));var ejs=require(_0xc895('0x8'));var fs=require('fs');var fs_extra=require(_0xc895('0x9'));var _=require(_0xc895('0xa'));var squel=require('squel');var crypto=require(_0xc895('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc895('0xc'));var toCsv=require(_0xc895('0x7'));var querystring=require(_0xc895('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc895('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc895('0xf'));var logger=require(_0xc895('0x10'))(_0xc895('0x11'));var utils=require(_0xc895('0x12'));var config=require(_0xc895('0x13'));var licenseUtil=require(_0xc895('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f2797,_0x452e00){_0x452e00=_0x452e00||0xcc;return function(_0x26b9ed){if(_0x26b9ed){return _0x4f2797[_0xc895('0x15')](_0x452e00);}return _0x4f2797[_0xc895('0x16')](_0x452e00)[_0xc895('0x17')]();};}function respondWithResult(_0x4d4fea,_0x4219d5){_0x4219d5=_0x4219d5||0xc8;return function(_0xc626ee){if(_0xc626ee){return _0x4d4fea[_0xc895('0x16')](_0x4219d5)[_0xc895('0x18')](_0xc626ee);}};}function respondWithFilteredResult(_0x4a7ca3,_0x3272c1){return function(_0x34b804){if(_0x34b804){var _0x3933b8=typeof _0x3272c1[_0xc895('0x19')]===_0xc895('0x1a')&&typeof _0x3272c1[_0xc895('0x1b')]===_0xc895('0x1a');var _0x5d77db=_0x34b804[_0xc895('0x1c')];var _0x18a547=_0x3933b8?0x0:_0x3272c1[_0xc895('0x19')];var _0x3234dd=_0x3933b8?_0x34b804[_0xc895('0x1c')]:_0x3272c1[_0xc895('0x19')]+_0x3272c1[_0xc895('0x1b')];var _0x586c6a;if(_0x3234dd>=_0x5d77db){_0x3234dd=_0x5d77db;_0x586c6a=0xc8;}else{_0x586c6a=0xce;}_0x4a7ca3[_0xc895('0x16')](_0x586c6a);return _0x4a7ca3[_0xc895('0x1d')]('Content-Range',_0x18a547+'-'+_0x3234dd+'/'+_0x5d77db)[_0xc895('0x18')](_0x34b804);}return null;};}function patchUpdates(_0x1dba01){return function(_0x159b08){try{jsonpatch[_0xc895('0x1e')](_0x159b08,_0x1dba01,!![]);}catch(_0x5b613b){return BPromise[_0xc895('0x1f')](_0x5b613b);}return _0x159b08['save']();};}function saveUpdates(_0x2e86f8,_0x250533){return function(_0x14cb6d){if(_0x14cb6d){return _0x14cb6d[_0xc895('0x20')](_0x2e86f8)[_0xc895('0x21')](function(_0xec82f0){return _0xec82f0;});}return null;};}function removeEntity(_0x48bd50,_0x4c7a95){return function(_0x56fc97){if(_0x56fc97){return _0x56fc97[_0xc895('0x22')]()[_0xc895('0x21')](function(){var _0x649a85=_0x56fc97[_0xc895('0x23')]({'plain':!![]});var _0x4a05f3=_0xc895('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x4a05f3,'resourceId':_0x649a85['id']}})[_0xc895('0x21')](function(){return _0x56fc97;});})[_0xc895('0x21')](function(){_0x48bd50['status'](0xcc)[_0xc895('0x17')]();});}};}function handleEntityNotFound(_0x3e21e4,_0x55a1da){return function(_0x3b55d0){if(!_0x3b55d0){_0x3e21e4[_0xc895('0x15')](0x194);}return _0x3b55d0;};}function handleError(_0x3ab02f,_0x429355){_0x429355=_0x429355||0x1f4;return function(_0x1554ac){logger[_0xc895('0x25')](_0x1554ac['stack']);if(_0x1554ac['name']){delete _0x1554ac[_0xc895('0x26')];}_0x3ab02f[_0xc895('0x16')](_0x429355)[_0xc895('0x27')](_0x1554ac);};}exports[_0xc895('0x28')]=function(_0xe26752,_0x18ecbc){var _0x2d87e8={},_0x49ad8f={},_0x231cdf={'count':0x0,'rows':[]};var _0x131f8b=_['map'](db[_0xc895('0x29')]['rawAttributes'],function(_0x251132){return{'name':_0x251132[_0xc895('0x2a')],'type':_0x251132[_0xc895('0x2b')][_0xc895('0x2c')]};});_0x49ad8f[_0xc895('0x2d')]=_[_0xc895('0x2e')](_0x131f8b,_0xc895('0x26'));_0x49ad8f[_0xc895('0x2f')]=_['keys'](_0xe26752[_0xc895('0x2f')]);_0x49ad8f[_0xc895('0x30')]=_[_0xc895('0x31')](_0x49ad8f[_0xc895('0x2d')],_0x49ad8f['query']);_0x2d87e8[_0xc895('0x32')]=_['intersection'](_0x49ad8f[_0xc895('0x2d')],qs[_0xc895('0x33')](_0xe26752[_0xc895('0x2f')][_0xc895('0x33')]));_0x2d87e8[_0xc895('0x32')]=_0x2d87e8[_0xc895('0x32')][_0xc895('0x34')]?_0x2d87e8[_0xc895('0x32')]:_0x49ad8f[_0xc895('0x2d')];if(!_0xe26752[_0xc895('0x2f')][_0xc895('0x35')]('nolimit')){_0x2d87e8[_0xc895('0x1b')]=qs['limit'](_0xe26752[_0xc895('0x2f')][_0xc895('0x1b')]);_0x2d87e8[_0xc895('0x19')]=qs[_0xc895('0x19')](_0xe26752['query']['offset']);}_0x2d87e8['order']=qs['sort'](_0xe26752[_0xc895('0x2f')]['sort']);_0x2d87e8[_0xc895('0x36')]=qs[_0xc895('0x30')](_[_0xc895('0x37')](_0xe26752[_0xc895('0x2f')],_0x49ad8f[_0xc895('0x30')]),_0x131f8b);if(_0xe26752['query'][_0xc895('0x38')]){_0x2d87e8[_0xc895('0x36')]=_[_0xc895('0x39')](_0x2d87e8[_0xc895('0x36')],{'$or':_[_0xc895('0x2e')](_0x131f8b,function(_0x2ae452){if(_0x2ae452['type']!==_0xc895('0x3a')){var _0x43d772={};_0x43d772[_0x2ae452[_0xc895('0x26')]]={'$like':'%'+_0xe26752[_0xc895('0x2f')][_0xc895('0x38')]+'%'};return _0x43d772;}})});}_0x2d87e8=_[_0xc895('0x39')]({},_0x2d87e8,_0xe26752[_0xc895('0x3b')]);var _0x213bb2={'where':_0x2d87e8[_0xc895('0x36')]};return db[_0xc895('0x29')][_0xc895('0x1c')](_0x213bb2)[_0xc895('0x21')](function(_0x57124d){_0x231cdf[_0xc895('0x1c')]=_0x57124d;if(_0xe26752[_0xc895('0x2f')][_0xc895('0x3c')]){_0x2d87e8[_0xc895('0x3d')]=[{'all':!![]}];}return db[_0xc895('0x29')]['findAll'](_0x2d87e8);})[_0xc895('0x21')](function(_0x547c0a){_0x231cdf[_0xc895('0x3e')]=_0x547c0a;return _0x231cdf;})[_0xc895('0x21')](respondWithFilteredResult(_0x18ecbc,_0x2d87e8))[_0xc895('0x3f')](handleError(_0x18ecbc,null));};exports[_0xc895('0x40')]=function(_0x63886f,_0x571955){var _0x40e277={'raw':!![],'where':{'id':_0x63886f[_0xc895('0x41')]['id']}},_0x198862={};_0x198862[_0xc895('0x2d')]=_['keys'](db[_0xc895('0x29')]['rawAttributes']);_0x198862[_0xc895('0x2f')]=_[_0xc895('0x42')](_0x63886f[_0xc895('0x2f')]);_0x198862[_0xc895('0x30')]=_['intersection'](_0x198862[_0xc895('0x2d')],_0x198862[_0xc895('0x2f')]);_0x40e277[_0xc895('0x32')]=_[_0xc895('0x31')](_0x198862['model'],qs['fields'](_0x63886f['query']['fields']));_0x40e277['attributes']=_0x40e277[_0xc895('0x32')][_0xc895('0x34')]?_0x40e277[_0xc895('0x32')]:_0x198862['model'];if(_0x63886f[_0xc895('0x2f')][_0xc895('0x3c')]){_0x40e277[_0xc895('0x3d')]=[{'all':!![]}];}_0x40e277=_[_0xc895('0x39')]({},_0x40e277,_0x63886f[_0xc895('0x3b')]);return db[_0xc895('0x29')][_0xc895('0x43')](_0x40e277)['then'](handleEntityNotFound(_0x571955,null))['then'](respondWithResult(_0x571955,null))['catch'](handleError(_0x571955,null));};exports[_0xc895('0x44')]=function(_0x469b83,_0x4f1215){return db[_0xc895('0x29')][_0xc895('0x44')](_0x469b83[_0xc895('0x45')],{})[_0xc895('0x21')](function(_0x52a8fb){var _0x1adf0b=_0x469b83[_0xc895('0x46')]['get']({'plain':!![]});if(!_0x1adf0b)throw new Error(_0xc895('0x47'));if(_0x1adf0b[_0xc895('0x48')]===_0xc895('0x46')){var _0xf0ba33=_0x52a8fb[_0xc895('0x23')]({'plain':!![]});var _0x482918=_0xc895('0x24');return db[_0xc895('0x49')]['find']({'where':{'name':_0x482918,'userProfileId':_0x1adf0b['userProfileId']},'raw':!![]})['then'](function(_0xe2338){if(_0xe2338&&_0xe2338[_0xc895('0x4a')]===0x0){return db['UserProfileResource'][_0xc895('0x44')]({'name':_0xf0ba33['name'],'resourceId':_0xf0ba33['id'],'type':_0xe2338[_0xc895('0x26')],'sectionId':_0xe2338['id']},{})[_0xc895('0x21')](function(){return _0x52a8fb;});}else{return _0x52a8fb;}})['catch'](function(_0x3c99a1){logger[_0xc895('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c99a1);throw _0x3c99a1;});}return _0x52a8fb;})[_0xc895('0x21')](respondWithResult(_0x4f1215,0xc9))[_0xc895('0x3f')](handleError(_0x4f1215,null));};exports[_0xc895('0x20')]=function(_0x357b1b,_0x37b456){if(_0x357b1b[_0xc895('0x45')]['id']){delete _0x357b1b['body']['id'];}return db['Disposition'][_0xc895('0x43')]({'where':{'id':_0x357b1b[_0xc895('0x41')]['id']}})[_0xc895('0x21')](handleEntityNotFound(_0x37b456,null))[_0xc895('0x21')](saveUpdates(_0x357b1b[_0xc895('0x45')],null))[_0xc895('0x21')](respondWithResult(_0x37b456,null))[_0xc895('0x3f')](handleError(_0x37b456,null));};exports[_0xc895('0x22')]=function(_0x23f4de,_0x337f71){return db['Disposition']['find']({'where':{'id':_0x23f4de[_0xc895('0x41')]['id']}})[_0xc895('0x21')](handleEntityNotFound(_0x337f71,null))['then'](removeEntity(_0x337f71,null))[_0xc895('0x3f')](handleError(_0x337f71,null));};
\ No newline at end of file
+var _0xa6c6=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5c604c,_0x3c638f){var _0x565a0e=function(_0x363a79){while(--_0x363a79){_0x5c604c['push'](_0x5c604c['shift']());}};_0x565a0e(++_0x3c638f);}(_0xa6c6,0x12e));var _0x6a6c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa6c6[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x6a6c('0x0'));var rimraf=require(_0x6a6c('0x1'));var zipdir=require(_0x6a6c('0x2'));var jsonpatch=require(_0x6a6c('0x3'));var rp=require(_0x6a6c('0x4'));var moment=require(_0x6a6c('0x5'));var BPromise=require(_0x6a6c('0x6'));var Mustache=require(_0x6a6c('0x7'));var util=require(_0x6a6c('0x8'));var path=require(_0x6a6c('0x9'));var sox=require(_0x6a6c('0xa'));var csv=require(_0x6a6c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a6c('0xc'));var _=require(_0x6a6c('0xd'));var squel=require(_0x6a6c('0xe'));var crypto=require('crypto');var jsforce=require(_0x6a6c('0xf'));var deskjs=require(_0x6a6c('0x10'));var toCsv=require(_0x6a6c('0xb'));var querystring=require('querystring');var Papa=require(_0x6a6c('0x11'));var Redis=require(_0x6a6c('0x12'));var authService=require(_0x6a6c('0x13'));var qs=require(_0x6a6c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a6c('0x15'))(_0x6a6c('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6a6c('0x17'));var db=require(_0x6a6c('0x18'))['db'];function respondWithStatusCode(_0xa7b681,_0x41b08e){_0x41b08e=_0x41b08e||0xcc;return function(_0x343acb){if(_0x343acb){return _0xa7b681[_0x6a6c('0x19')](_0x41b08e);}return _0xa7b681[_0x6a6c('0x1a')](_0x41b08e)[_0x6a6c('0x1b')]();};}function respondWithResult(_0x2a9d83,_0x1535cd){_0x1535cd=_0x1535cd||0xc8;return function(_0x286ef2){if(_0x286ef2){return _0x2a9d83[_0x6a6c('0x1a')](_0x1535cd)[_0x6a6c('0x1c')](_0x286ef2);}};}function respondWithFilteredResult(_0x110c4d,_0x4eddb5){return function(_0x36a719){if(_0x36a719){var _0x387521=typeof _0x4eddb5[_0x6a6c('0x1d')]==='undefined'&&typeof _0x4eddb5[_0x6a6c('0x1e')]===_0x6a6c('0x1f');var _0x271009=_0x36a719[_0x6a6c('0x20')];var _0x41b93c=_0x387521?0x0:_0x4eddb5[_0x6a6c('0x1d')];var _0x2d412e=_0x387521?_0x36a719[_0x6a6c('0x20')]:_0x4eddb5[_0x6a6c('0x1d')]+_0x4eddb5[_0x6a6c('0x1e')];var _0x5800c2;if(_0x2d412e>=_0x271009){_0x2d412e=_0x271009;_0x5800c2=0xc8;}else{_0x5800c2=0xce;}_0x110c4d[_0x6a6c('0x1a')](_0x5800c2);return _0x110c4d[_0x6a6c('0x21')](_0x6a6c('0x22'),_0x41b93c+'-'+_0x2d412e+'/'+_0x271009)[_0x6a6c('0x1c')](_0x36a719);}return null;};}function patchUpdates(_0x51f9c5){return function(_0x192f72){try{jsonpatch[_0x6a6c('0x23')](_0x192f72,_0x51f9c5,!![]);}catch(_0x16751d){return BPromise[_0x6a6c('0x24')](_0x16751d);}return _0x192f72[_0x6a6c('0x25')]();};}function saveUpdates(_0x25a991,_0x1b1b78){return function(_0x910d27){if(_0x910d27){return _0x910d27[_0x6a6c('0x26')](_0x25a991)[_0x6a6c('0x27')](function(_0x4be258){return _0x4be258;});}return null;};}function removeEntity(_0x239b0c,_0x3d0521){return function(_0x40da5d){if(_0x40da5d){return _0x40da5d[_0x6a6c('0x28')]()[_0x6a6c('0x27')](function(){var _0x2ed564=_0x40da5d[_0x6a6c('0x29')]({'plain':!![]});var _0x518587=_0x6a6c('0x2a');return db[_0x6a6c('0x2b')][_0x6a6c('0x28')]({'where':{'type':_0x518587,'resourceId':_0x2ed564['id']}})[_0x6a6c('0x27')](function(){return _0x40da5d;});})['then'](function(){_0x239b0c[_0x6a6c('0x1a')](0xcc)[_0x6a6c('0x1b')]();});}};}function handleEntityNotFound(_0x426b08,_0x5e800a){return function(_0x12b08c){if(!_0x12b08c){_0x426b08['sendStatus'](0x194);}return _0x12b08c;};}function handleError(_0x586302,_0x559219){_0x559219=_0x559219||0x1f4;return function(_0xc7ffa4){logger[_0x6a6c('0x2c')](_0xc7ffa4[_0x6a6c('0x2d')]);if(_0xc7ffa4[_0x6a6c('0x2e')]){delete _0xc7ffa4[_0x6a6c('0x2e')];}_0x586302[_0x6a6c('0x1a')](_0x559219)[_0x6a6c('0x2f')](_0xc7ffa4);};}exports[_0x6a6c('0x30')]=function(_0x55ca65,_0x164818){var _0xeb4a3f={},_0x58e345={},_0x167ff2={'count':0x0,'rows':[]};var _0x113b10=_[_0x6a6c('0x31')](db[_0x6a6c('0x32')][_0x6a6c('0x33')],function(_0x3a1f61){return{'name':_0x3a1f61['fieldName'],'type':_0x3a1f61[_0x6a6c('0x34')][_0x6a6c('0x35')]};});_0x58e345[_0x6a6c('0x36')]=_['map'](_0x113b10,_0x6a6c('0x2e'));_0x58e345[_0x6a6c('0x37')]=_[_0x6a6c('0x38')](_0x55ca65['query']);_0x58e345[_0x6a6c('0x39')]=_[_0x6a6c('0x3a')](_0x58e345[_0x6a6c('0x36')],_0x58e345[_0x6a6c('0x37')]);_0xeb4a3f[_0x6a6c('0x3b')]=_[_0x6a6c('0x3a')](_0x58e345[_0x6a6c('0x36')],qs[_0x6a6c('0x3c')](_0x55ca65[_0x6a6c('0x37')][_0x6a6c('0x3c')]));_0xeb4a3f[_0x6a6c('0x3b')]=_0xeb4a3f[_0x6a6c('0x3b')][_0x6a6c('0x3d')]?_0xeb4a3f['attributes']:_0x58e345[_0x6a6c('0x36')];if(!_0x55ca65[_0x6a6c('0x37')][_0x6a6c('0x3e')](_0x6a6c('0x3f'))){_0xeb4a3f[_0x6a6c('0x1e')]=qs[_0x6a6c('0x1e')](_0x55ca65['query']['limit']);_0xeb4a3f[_0x6a6c('0x1d')]=qs[_0x6a6c('0x1d')](_0x55ca65[_0x6a6c('0x37')][_0x6a6c('0x1d')]);}_0xeb4a3f[_0x6a6c('0x40')]=qs[_0x6a6c('0x41')](_0x55ca65['query'][_0x6a6c('0x41')]);_0xeb4a3f[_0x6a6c('0x42')]=qs[_0x6a6c('0x39')](_['pick'](_0x55ca65[_0x6a6c('0x37')],_0x58e345['filters']),_0x113b10);if(_0x55ca65[_0x6a6c('0x37')][_0x6a6c('0x43')]){_0xeb4a3f[_0x6a6c('0x42')]=_[_0x6a6c('0x44')](_0xeb4a3f[_0x6a6c('0x42')],{'$or':_[_0x6a6c('0x31')](_0x113b10,function(_0x278b5b){if(_0x278b5b['type']!=='VIRTUAL'){var _0x349cd7={};_0x349cd7[_0x278b5b[_0x6a6c('0x2e')]]={'$like':'%'+_0x55ca65[_0x6a6c('0x37')][_0x6a6c('0x43')]+'%'};return _0x349cd7;}})});}_0xeb4a3f=_[_0x6a6c('0x44')]({},_0xeb4a3f,_0x55ca65[_0x6a6c('0x45')]);var _0x430540={'where':_0xeb4a3f['where']};return db[_0x6a6c('0x32')][_0x6a6c('0x20')](_0x430540)['then'](function(_0xcadb83){_0x167ff2['count']=_0xcadb83;if(_0x55ca65[_0x6a6c('0x37')][_0x6a6c('0x46')]){_0xeb4a3f[_0x6a6c('0x47')]=[{'all':!![]}];}return db[_0x6a6c('0x32')][_0x6a6c('0x48')](_0xeb4a3f);})[_0x6a6c('0x27')](function(_0x3abc99){_0x167ff2['rows']=_0x3abc99;return _0x167ff2;})[_0x6a6c('0x27')](respondWithFilteredResult(_0x164818,_0xeb4a3f))[_0x6a6c('0x49')](handleError(_0x164818,null));};exports['show']=function(_0xb07936,_0x448c4f){var _0x2a3200={'raw':!![],'where':{'id':_0xb07936[_0x6a6c('0x4a')]['id']}},_0x251724={};_0x251724[_0x6a6c('0x36')]=_[_0x6a6c('0x38')](db['Disposition'][_0x6a6c('0x33')]);_0x251724['query']=_[_0x6a6c('0x38')](_0xb07936[_0x6a6c('0x37')]);_0x251724[_0x6a6c('0x39')]=_['intersection'](_0x251724[_0x6a6c('0x36')],_0x251724[_0x6a6c('0x37')]);_0x2a3200[_0x6a6c('0x3b')]=_[_0x6a6c('0x3a')](_0x251724[_0x6a6c('0x36')],qs['fields'](_0xb07936[_0x6a6c('0x37')][_0x6a6c('0x3c')]));_0x2a3200['attributes']=_0x2a3200['attributes']['length']?_0x2a3200['attributes']:_0x251724['model'];if(_0xb07936[_0x6a6c('0x37')][_0x6a6c('0x46')]){_0x2a3200[_0x6a6c('0x47')]=[{'all':!![]}];}_0x2a3200=_[_0x6a6c('0x44')]({},_0x2a3200,_0xb07936['options']);return db[_0x6a6c('0x32')][_0x6a6c('0x4b')](_0x2a3200)[_0x6a6c('0x27')](handleEntityNotFound(_0x448c4f,null))[_0x6a6c('0x27')](respondWithResult(_0x448c4f,null))[_0x6a6c('0x49')](handleError(_0x448c4f,null));};exports['create']=function(_0x2115e9,_0x31e0dc){return db[_0x6a6c('0x32')][_0x6a6c('0x4c')](_0x2115e9[_0x6a6c('0x4d')],{})[_0x6a6c('0x27')](function(_0x15764d){var _0x562fee=_0x2115e9[_0x6a6c('0x4e')][_0x6a6c('0x29')]({'plain':!![]});if(!_0x562fee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x562fee['role']===_0x6a6c('0x4e')){var _0x5750f9=_0x15764d[_0x6a6c('0x29')]({'plain':!![]});var _0x4a1f50=_0x6a6c('0x2a');return db[_0x6a6c('0x4f')][_0x6a6c('0x4b')]({'where':{'name':_0x4a1f50,'userProfileId':_0x562fee[_0x6a6c('0x50')]},'raw':!![]})['then'](function(_0x132c5c){if(_0x132c5c&&_0x132c5c[_0x6a6c('0x51')]===0x0){return db[_0x6a6c('0x2b')][_0x6a6c('0x4c')]({'name':_0x5750f9[_0x6a6c('0x2e')],'resourceId':_0x5750f9['id'],'type':_0x132c5c[_0x6a6c('0x2e')],'sectionId':_0x132c5c['id']},{})[_0x6a6c('0x27')](function(){return _0x15764d;});}else{return _0x15764d;}})['catch'](function(_0x5142ff){logger[_0x6a6c('0x2c')](_0x6a6c('0x52'),_0x5142ff);throw _0x5142ff;});}return _0x15764d;})[_0x6a6c('0x27')](respondWithResult(_0x31e0dc,0xc9))[_0x6a6c('0x49')](handleError(_0x31e0dc,null));};exports[_0x6a6c('0x26')]=function(_0x2e4d5d,_0x540642){if(_0x2e4d5d['body']['id']){delete _0x2e4d5d['body']['id'];}return db[_0x6a6c('0x32')]['find']({'where':{'id':_0x2e4d5d[_0x6a6c('0x4a')]['id']}})[_0x6a6c('0x27')](handleEntityNotFound(_0x540642,null))[_0x6a6c('0x27')](saveUpdates(_0x2e4d5d['body'],null))[_0x6a6c('0x27')](respondWithResult(_0x540642,null))[_0x6a6c('0x49')](handleError(_0x540642,null));};exports[_0x6a6c('0x28')]=function(_0x20a29a,_0x5990a0){return db[_0x6a6c('0x32')][_0x6a6c('0x4b')]({'where':{'id':_0x20a29a[_0x6a6c('0x4a')]['id']}})[_0x6a6c('0x27')](handleEntityNotFound(_0x5990a0,null))[_0x6a6c('0x27')](removeEntity(_0x5990a0,null))['catch'](handleError(_0x5990a0,null));};
\ No newline at end of file
index fea94dd..9a17bca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a07=['FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment','rimraf','../../config/environment','./disposition.attributes','exports','define','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId'];(function(_0x3b0323,_0x2aa6bd){var _0x1cc44e=function(_0x2a05d5){while(--_0x2a05d5){_0x3b0323['push'](_0x3b0323['shift']());}};_0x1cc44e(++_0x2aa6bd);}(_0x4a07,0xd4));var _0x74a0=function(_0x21636f,_0x1da759){_0x21636f=_0x21636f-0x0;var _0x3bccda=_0x4a07[_0x21636f];return _0x3bccda;};'use strict';var _=require(_0x74a0('0x0'));var util=require('util');var logger=require(_0x74a0('0x1'))('api');var moment=require(_0x74a0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x74a0('0x3'));var config=require(_0x74a0('0x4'));var attributes=require(_0x74a0('0x5'));module[_0x74a0('0x6')]=function(_0x280359,_0x11d90e){return _0x280359[_0x74a0('0x7')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x74a0('0x8'),'fields':[_0x74a0('0x9'),_0x74a0('0xa')]},{'unique':!![],'name':_0x74a0('0xb'),'fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0x74a0('0xc'),'fields':[_0x74a0('0x9'),_0x74a0('0xd')]},{'unique':!![],'name':_0x74a0('0xe'),'fields':[_0x74a0('0x9'),_0x74a0('0xf')]},{'unique':!![],'name':'name_fax','fields':[_0x74a0('0x9'),_0x74a0('0x10')]},{'unique':!![],'name':'name_openchannel','fields':[_0x74a0('0x9'),'OpenchannelAccountId']},{'unique':!![],'name':_0x74a0('0x11'),'fields':[_0x74a0('0x9'),_0x74a0('0x12')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4cf=['ListId','name_mail','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name'];(function(_0x340aa4,_0x4a1789){var _0x492b4d=function(_0x16d1d3){while(--_0x16d1d3){_0x340aa4['push'](_0x340aa4['shift']());}};_0x492b4d(++_0x4a1789);}(_0xb4cf,0x1a7));var _0xfb4c=function(_0x5a89d6,_0x2d49c0){_0x5a89d6=_0x5a89d6-0x0;var _0x18c237=_0xb4cf[_0x5a89d6];return _0x18c237;};'use strict';var _=require(_0xfb4c('0x0'));var util=require('util');var logger=require(_0xfb4c('0x1'))(_0xfb4c('0x2'));var moment=require('moment');var BPromise=require(_0xfb4c('0x3'));var rp=require(_0xfb4c('0x4'));var fs=require('fs');var path=require(_0xfb4c('0x5'));var rimraf=require(_0xfb4c('0x6'));var config=require(_0xfb4c('0x7'));var attributes=require(_0xfb4c('0x8'));module['exports']=function(_0x2d51bf,_0x3aae8b){return _0x2d51bf[_0xfb4c('0x9')](_0xfb4c('0xa'),attributes,{'tableName':_0xfb4c('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfb4c('0xc'),'fields':[_0xfb4c('0xd'),_0xfb4c('0xe')]},{'unique':!![],'name':'name_chat','fields':['name','ChatWebsiteId']},{'unique':!![],'name':_0xfb4c('0xf'),'fields':[_0xfb4c('0xd'),_0xfb4c('0x10')]},{'unique':!![],'name':_0xfb4c('0x11'),'fields':[_0xfb4c('0xd'),_0xfb4c('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0xfb4c('0xd'),_0xfb4c('0x13')]},{'unique':!![],'name':_0xfb4c('0x14'),'fields':[_0xfb4c('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0xfb4c('0x15'),'fields':[_0xfb4c('0xd'),_0xfb4c('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
index 53cd9b9..0d52daa 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(_0x458581,_0x14e465){var _0x2b3f80=function(_0x4219d9){while(--_0x4219d9){_0x458581['push'](_0x458581['shift']());}};_0x2b3f80(++_0x14e465);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x128819,_0x379234){var _0x56c72e=function(_0x12a0e9){while(--_0x12a0e9){_0x128819['push'](_0x128819['shift']());}};_0x56c72e(++_0x379234);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 06fcbd8..73289b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6705=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer'];(function(_0x12eb66,_0x5cd435){var _0x483b0f=function(_0x4a532c){while(--_0x4a532c){_0x12eb66['push'](_0x12eb66['shift']());}};_0x483b0f(++_0x5cd435);}(_0x6705,0xfb));var _0x5670=function(_0x72dd95,_0xddfb44){_0x72dd95=_0x72dd95-0x0;var _0x1188ab=_0x6705[_0x72dd95];return _0x1188ab;};'use strict';var multer=require(_0x5670('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5670('0x1'));var express=require(_0x5670('0x2'));var router=express[_0x5670('0x3')]();var fs_extra=require(_0x5670('0x4'));var auth=require(_0x5670('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5670('0x6'));var controller=require(_0x5670('0x7'));router[_0x5670('0x8')]('/',auth['isAuthenticated'](),controller[_0x5670('0x9')]);router['get'](_0x5670('0xa'),auth[_0x5670('0xb')](),controller[_0x5670('0xc')]);router[_0x5670('0xd')]('/',auth[_0x5670('0xb')](),controller[_0x5670('0xe')]);router['put'](_0x5670('0xa'),auth['isAuthenticated'](),controller[_0x5670('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5670('0x10')]);module[_0x5670('0x11')]=router;
\ No newline at end of file
+var _0x6f75=['post','create','put','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x455633,_0x3e63ef){var _0x3daa1b=function(_0x14d6d8){while(--_0x14d6d8){_0x455633['push'](_0x455633['shift']());}};_0x3daa1b(++_0x3e63ef);}(_0x6f75,0xc4));var _0x56f7=function(_0x93151,_0x1f7757){_0x93151=_0x93151-0x0;var _0x5011e2=_0x6f75[_0x93151];return _0x5011e2;};'use strict';var multer=require(_0x56f7('0x0'));var util=require('util');var path=require(_0x56f7('0x1'));var timeout=require(_0x56f7('0x2'));var express=require(_0x56f7('0x3'));var router=express[_0x56f7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x56f7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x56f7('0x6'));var controller=require('./disposition.controller');router[_0x56f7('0x7')]('/',auth[_0x56f7('0x8')](),controller[_0x56f7('0x9')]);router['get'](_0x56f7('0xa'),auth[_0x56f7('0x8')](),controller[_0x56f7('0xb')]);router[_0x56f7('0xc')]('/',auth['isAuthenticated'](),controller[_0x56f7('0xd')]);router[_0x56f7('0xe')](_0x56f7('0xa'),auth[_0x56f7('0x8')](),controller['update']);router[_0x56f7('0xf')](_0x56f7('0xa'),auth[_0x56f7('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 28eaea3..f5fb3c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1a4=['7200','v17,v27,v29','IAX','DADHI','KHOMP','SIP','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','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','4800','9600','12000','14400'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xb1a4,0x12e));var _0x4b1a=function(_0x1a565d,_0x4df16b){_0x1a565d=_0x1a565d-0x0;var _0x1148cc=_0xb1a4[_0x1a565d];return _0x1148cc;};'use strict';var Sequelize=require(_0x4b1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b1a('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4b1a('0x1')]},'ecm':{'type':Sequelize[_0x4b1a('0x2')](_0x4b1a('0x3'),'no'),'defaultValue':_0x4b1a('0x3')},'headerinfo':{'type':Sequelize[_0x4b1a('0x1')],'defaultValue':_0x4b1a('0x4')},'localstationid':{'type':Sequelize[_0x4b1a('0x1')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x4b1a('0x2')](_0x4b1a('0x5'),_0x4b1a('0x6'),'7200',_0x4b1a('0x7'),_0x4b1a('0x8'),_0x4b1a('0x9')),'defaultValue':_0x4b1a('0x6')},'maxrate':{'type':Sequelize[_0x4b1a('0x2')](_0x4b1a('0x5'),_0x4b1a('0x6'),_0x4b1a('0xa'),_0x4b1a('0x7'),_0x4b1a('0x8'),_0x4b1a('0x9')),'defaultValue':_0x4b1a('0x9')},'modem':{'type':Sequelize[_0x4b1a('0x1')],'defaultValue':_0x4b1a('0xb')},'gateway':{'type':Sequelize[_0x4b1a('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP',_0x4b1a('0xc'),_0x4b1a('0xd'),_0x4b1a('0xe')),'defaultValue':_0x4b1a('0xf')},'key':{'type':Sequelize[_0x4b1a('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4b1a('0x10')],'defaultValue':function(){return _0x4b1a('0x11');}},'notificationSound':{'type':Sequelize[_0x4b1a('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4b1a('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4b1a('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4b1a('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4b1a('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4b1a('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4b1a('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4b1a('0x13')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4b1a('0x12')],'defaultValue':![],'comment':_0x4b1a('0x14'),'set':function(_0x471cd9){if(!_0x471cd9)this['setDataValue'](_0x4b1a('0x15'),null);this[_0x4b1a('0x16')](_0x4b1a('0x17'),_0x471cd9);}}};
\ No newline at end of file
+var _0x62b6=['7200','12000','14400','4800','2400','9600','INTEGER','SIP','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x62b6,0x19c));var _0x662b=function(_0x5e1b98,_0x45dd16){_0x5e1b98=_0x5e1b98-0x0;var _0x586364=_0x62b6[_0x5e1b98];return _0x586364;};'use strict';var Sequelize=require(_0x662b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x662b('0x1')]},'ecm':{'type':Sequelize[_0x662b('0x2')](_0x662b('0x3'),'no'),'defaultValue':_0x662b('0x3')},'headerinfo':{'type':Sequelize[_0x662b('0x1')],'defaultValue':_0x662b('0x4')},'localstationid':{'type':Sequelize[_0x662b('0x1')],'unique':_0x662b('0x5')},'minrate':{'type':Sequelize[_0x662b('0x2')]('2400','4800',_0x662b('0x6'),'9600',_0x662b('0x7'),_0x662b('0x8')),'defaultValue':_0x662b('0x9')},'maxrate':{'type':Sequelize[_0x662b('0x2')](_0x662b('0xa'),'4800',_0x662b('0x6'),_0x662b('0xb'),_0x662b('0x7'),_0x662b('0x8')),'defaultValue':_0x662b('0x8')},'modem':{'type':Sequelize[_0x662b('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x662b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x662b('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x662b('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x662b('0xd'),'IAX',_0x662b('0xe'),_0x662b('0xf')),'defaultValue':_0x662b('0xd')},'key':{'type':Sequelize[_0x662b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x662b('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x662b('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x662b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x662b('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x662b('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x662b('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x662b('0x11')],'defaultValue':![],'comment':_0x662b('0x12'),'set':function(_0x201a15){if(!_0x201a15)this[_0x662b('0x13')](_0x662b('0x14'),null);this['setDataValue'](_0x662b('0x15'),_0x201a15);}}};
\ No newline at end of file
index 00529c7..f1a6463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd911=['sort','where','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','mandatoryDispositionPause','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','userProfileId','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','length','nolimit','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','omit','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','findOne','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','faxdetect','headerinfo','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','filename','Messages','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','register','jayson/promise','client','http','request','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','FaxAccounts','UserProfileResource','destroy','stack','name','index','Pause','FaxAccount','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd911,0x13c));var _0x1d91=function(_0x3071ab,_0x574a59){_0x3071ab=_0x3071ab-0x0;var _0x2f458c=_0xd911[_0x3071ab];return _0x2f458c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d91('0x0'));var zipdir=require(_0x1d91('0x1'));var jsonpatch=require(_0x1d91('0x2'));var rp=require(_0x1d91('0x3'));var moment=require(_0x1d91('0x4'));var BPromise=require(_0x1d91('0x5'));var Mustache=require(_0x1d91('0x6'));var util=require(_0x1d91('0x7'));var path=require(_0x1d91('0x8'));var sox=require(_0x1d91('0x9'));var csv=require(_0x1d91('0xa'));var ejs=require(_0x1d91('0xb'));var fs=require('fs');var fs_extra=require(_0x1d91('0xc'));var _=require(_0x1d91('0xd'));var squel=require(_0x1d91('0xe'));var crypto=require(_0x1d91('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1d91('0x10'));var toCsv=require(_0x1d91('0xa'));var querystring=require(_0x1d91('0x11'));var Papa=require(_0x1d91('0x12'));var Redis=require(_0x1d91('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1d91('0x14'));var as=require(_0x1d91('0x15'));var hardwareService=require(_0x1d91('0x16'));var logger=require(_0x1d91('0x17'))(_0x1d91('0x18'));var utils=require('../../config/utils');var config=require(_0x1d91('0x19'));var licenseUtil=require(_0x1d91('0x1a'));var db=require('../../mysqldb')['db'];config[_0x1d91('0x1b')]=_[_0x1d91('0x1c')](config[_0x1d91('0x1b')],{'host':_0x1d91('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d91('0x1b')]));require('./faxAccount.socket')[_0x1d91('0x1e')](socket);var jayson=require(_0x1d91('0x1f'));var client=jayson[_0x1d91('0x20')][_0x1d91('0x21')]({'port':0x232c});var client9002=jayson[_0x1d91('0x20')][_0x1d91('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x248fd3,_0x568b28,_0x2f11e8,_0x2d764c){return new BPromise(function(_0xe89739,_0x25ebad){var _0x30f6f2=_0x2d764c||client;return _0x30f6f2[_0x1d91('0x22')](_0x248fd3,_0x2f11e8)['then'](function(_0x5cfa7d){logger[_0x1d91('0x23')]('FaxAccount,\x20%s,\x20%s',_0x568b28,_0x1d91('0x24'));logger[_0x1d91('0x25')](_0x1d91('0x26'),_0x568b28,'request\x20sent',JSON[_0x1d91('0x27')](_0x5cfa7d));if(_0x5cfa7d[_0x1d91('0x28')]){if(_0x5cfa7d[_0x1d91('0x28')][_0x1d91('0x29')]===0x1f4){logger[_0x1d91('0x28')](_0x1d91('0x2a'),_0x568b28,_0x5cfa7d['error']['message']);return _0x25ebad(_0x5cfa7d[_0x1d91('0x28')][_0x1d91('0x2b')]);}logger['error'](_0x1d91('0x2a'),_0x568b28,_0x5cfa7d[_0x1d91('0x28')][_0x1d91('0x2b')]);return _0xe89739(_0x5cfa7d[_0x1d91('0x28')][_0x1d91('0x2b')]);}else{logger[_0x1d91('0x23')](_0x1d91('0x2a'),_0x568b28,_0x1d91('0x24'));_0xe89739(_0x5cfa7d[_0x1d91('0x2c')][_0x1d91('0x2b')]);}})['catch'](function(_0x44ccbf){logger[_0x1d91('0x28')]('FaxAccount,\x20%s,\x20%s',_0x568b28,_0x44ccbf);_0x25ebad(_0x44ccbf);});});}function respondWithStatusCode(_0x2b2d74,_0x41ec3a){_0x41ec3a=_0x41ec3a||0xcc;return function(_0x3590d9){if(_0x3590d9){return _0x2b2d74[_0x1d91('0x2d')](_0x41ec3a);}return _0x2b2d74['status'](_0x41ec3a)['end']();};}function respondWithResult(_0x91c189,_0x1a42f0){_0x1a42f0=_0x1a42f0||0xc8;return function(_0x5d7151){if(_0x5d7151){return _0x91c189[_0x1d91('0x2e')](_0x1a42f0)[_0x1d91('0x2f')](_0x5d7151);}};}function respondWithFilteredResult(_0x2d50ca,_0xf3a0ae){return function(_0x3bf5c6){if(_0x3bf5c6){var _0x5582b7=typeof _0xf3a0ae[_0x1d91('0x30')]===_0x1d91('0x31')&&typeof _0xf3a0ae[_0x1d91('0x32')]===_0x1d91('0x31');var _0x1989ef=_0x3bf5c6['count'];var _0x2cd21f=_0x5582b7?0x0:_0xf3a0ae['offset'];var _0x1bb335=_0x5582b7?_0x3bf5c6['count']:_0xf3a0ae[_0x1d91('0x30')]+_0xf3a0ae[_0x1d91('0x32')];var _0x4bf894;if(_0x1bb335>=_0x1989ef){_0x1bb335=_0x1989ef;_0x4bf894=0xc8;}else{_0x4bf894=0xce;}_0x2d50ca[_0x1d91('0x2e')](_0x4bf894);return _0x2d50ca[_0x1d91('0x33')](_0x1d91('0x34'),_0x2cd21f+'-'+_0x1bb335+'/'+_0x1989ef)['json'](_0x3bf5c6);}return null;};}function patchUpdates(_0x1fc9ac){return function(_0x54db2d){try{jsonpatch[_0x1d91('0x35')](_0x54db2d,_0x1fc9ac,!![]);}catch(_0x487952){return BPromise['reject'](_0x487952);}return _0x54db2d[_0x1d91('0x36')]();};}function saveUpdates(_0x4cb554,_0x4399d6){return function(_0x356402){if(_0x356402){return _0x356402[_0x1d91('0x37')](_0x4cb554)['then'](function(_0x9793e){return _0x9793e;});}return null;};}function removeEntity(_0x2460bd,_0x446e6f){return function(_0x37bfed){if(_0x37bfed){return _0x37bfed['destroy']()[_0x1d91('0x38')](function(){var _0x843880=_0x37bfed['get']({'plain':!![]});var _0x2ce433=_0x1d91('0x39');return db[_0x1d91('0x3a')][_0x1d91('0x3b')]({'where':{'type':_0x2ce433,'resourceId':_0x843880['id']}})[_0x1d91('0x38')](function(){return _0x37bfed;});})[_0x1d91('0x38')](function(){_0x2460bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36d276,_0x47c189){return function(_0x1cb4ce){if(!_0x1cb4ce){_0x36d276['sendStatus'](0x194);}return _0x1cb4ce;};}function handleError(_0x3677fe,_0x3a77c6){_0x3a77c6=_0x3a77c6||0x1f4;return function(_0x5dfb88){logger[_0x1d91('0x28')](_0x5dfb88[_0x1d91('0x3c')]);if(_0x5dfb88[_0x1d91('0x3d')]){delete _0x5dfb88[_0x1d91('0x3d')];}_0x3677fe['status'](_0x3a77c6)['send'](_0x5dfb88);};}exports[_0x1d91('0x3e')]=function(_0x320c78,_0x4942a7){var _0x4526b2={'include':[{'model':db[_0x1d91('0x3f')],'as':'mandatoryDispositionPause'}]},_0xc0c035={},_0x54c69e={'count':0x0,'rows':[]};var _0x326b51=_['map'](db[_0x1d91('0x40')][_0x1d91('0x41')],function(_0x97fec9){return{'name':_0x97fec9[_0x1d91('0x42')],'type':_0x97fec9[_0x1d91('0x43')]['key']};});_0xc0c035['model']=_[_0x1d91('0x44')](_0x326b51,_0x1d91('0x3d'));_0xc0c035[_0x1d91('0x45')]=_[_0x1d91('0x46')](_0x320c78[_0x1d91('0x45')]);_0xc0c035[_0x1d91('0x47')]=_[_0x1d91('0x48')](_0xc0c035[_0x1d91('0x49')],_0xc0c035[_0x1d91('0x45')]);_0x4526b2[_0x1d91('0x4a')]=_[_0x1d91('0x48')](_0xc0c035[_0x1d91('0x49')],qs[_0x1d91('0x4b')](_0x320c78[_0x1d91('0x45')][_0x1d91('0x4b')]));_0x4526b2[_0x1d91('0x4a')]=_0x4526b2[_0x1d91('0x4a')]['length']?_0x4526b2[_0x1d91('0x4a')]:_0xc0c035['model'];if(!_0x320c78[_0x1d91('0x45')][_0x1d91('0x4c')]('nolimit')){_0x4526b2[_0x1d91('0x32')]=qs[_0x1d91('0x32')](_0x320c78[_0x1d91('0x45')]['limit']);_0x4526b2['offset']=qs[_0x1d91('0x30')](_0x320c78[_0x1d91('0x45')][_0x1d91('0x30')]);}_0x4526b2[_0x1d91('0x4d')]=qs['sort'](_0x320c78['query'][_0x1d91('0x4e')]);_0x4526b2[_0x1d91('0x4f')]=qs[_0x1d91('0x47')](_[_0x1d91('0x50')](_0x320c78['query'],_0xc0c035[_0x1d91('0x47')]),_0x326b51);if(_0x320c78[_0x1d91('0x45')]['filter']){_0x4526b2[_0x1d91('0x4f')]=_[_0x1d91('0x51')](_0x4526b2[_0x1d91('0x4f')],{'$or':_[_0x1d91('0x44')](_0x326b51,function(_0x50bd14){if(_0x50bd14[_0x1d91('0x43')]!==_0x1d91('0x52')){var _0x5ce1a6={};_0x5ce1a6[_0x50bd14['name']]={'$like':'%'+_0x320c78[_0x1d91('0x45')][_0x1d91('0x53')]+'%'};return _0x5ce1a6;}})});}_0x4526b2=_[_0x1d91('0x51')]({},_0x4526b2,_0x320c78['options']);var _0x3d4d11={'where':_0x4526b2['where']};return db['FaxAccount']['count'](_0x3d4d11)[_0x1d91('0x38')](function(_0x338c8c){_0x54c69e[_0x1d91('0x54')]=_0x338c8c;if(_0x320c78['query'][_0x1d91('0x55')]){_0x4526b2[_0x1d91('0x56')]=[{'all':!![]}];}return db[_0x1d91('0x40')][_0x1d91('0x57')](_0x4526b2);})['then'](function(_0x256f28){_0x54c69e[_0x1d91('0x58')]=_0x256f28;return _0x54c69e;})[_0x1d91('0x38')](respondWithFilteredResult(_0x4942a7,_0x4526b2))['catch'](handleError(_0x4942a7,null));};exports[_0x1d91('0x59')]=function(_0x5ee931,_0xb74e8c){var _0x2222af={'raw':![],'where':{'id':_0x5ee931['params']['id']},'include':[{'model':db[_0x1d91('0x3f')],'as':_0x1d91('0x5a')}]},_0x3f3789={};_0x3f3789['model']=_[_0x1d91('0x46')](db['FaxAccount'][_0x1d91('0x41')]);_0x3f3789[_0x1d91('0x45')]=_[_0x1d91('0x46')](_0x5ee931[_0x1d91('0x45')]);_0x3f3789[_0x1d91('0x47')]=_[_0x1d91('0x48')](_0x3f3789[_0x1d91('0x49')],_0x3f3789[_0x1d91('0x45')]);_0x2222af[_0x1d91('0x4a')]=_[_0x1d91('0x48')](_0x3f3789[_0x1d91('0x49')],qs[_0x1d91('0x4b')](_0x5ee931[_0x1d91('0x45')][_0x1d91('0x4b')]));_0x2222af[_0x1d91('0x4a')]=_0x2222af['attributes']['length']?_0x2222af[_0x1d91('0x4a')]:_0x3f3789[_0x1d91('0x49')];if(_0x5ee931[_0x1d91('0x45')][_0x1d91('0x55')]){_0x2222af[_0x1d91('0x56')]=[{'all':!![]}];}_0x2222af=_[_0x1d91('0x51')]({},_0x2222af,_0x5ee931[_0x1d91('0x5b')]);return db['FaxAccount'][_0x1d91('0x5c')](_0x2222af)[_0x1d91('0x38')](handleEntityNotFound(_0xb74e8c,null))[_0x1d91('0x38')](respondWithResult(_0xb74e8c,null))[_0x1d91('0x5d')](handleError(_0xb74e8c,null));};exports[_0x1d91('0x5e')]=function(_0x4d0391,_0x365947){return db[_0x1d91('0x40')]['create'](_0x4d0391[_0x1d91('0x5f')],{})['then'](function(_0x33f445){var _0x5179ed=_0x4d0391['user']['get']({'plain':!![]});if(!_0x5179ed)throw new Error(_0x1d91('0x60'));if(_0x5179ed[_0x1d91('0x61')]===_0x1d91('0x62')){var _0x484394=_0x33f445[_0x1d91('0x63')]({'plain':!![]});var _0x57c2c6=_0x1d91('0x39');return db['UserProfileSection'][_0x1d91('0x5c')]({'where':{'name':_0x57c2c6,'userProfileId':_0x5179ed[_0x1d91('0x64')]},'raw':!![]})[_0x1d91('0x38')](function(_0x1b3f02){if(_0x1b3f02&&_0x1b3f02['autoAssociation']===0x0){return db[_0x1d91('0x3a')][_0x1d91('0x5e')]({'name':_0x484394[_0x1d91('0x3d')],'resourceId':_0x484394['id'],'type':_0x1b3f02[_0x1d91('0x3d')],'sectionId':_0x1b3f02['id']},{})[_0x1d91('0x38')](function(){return _0x33f445;});}else{return _0x33f445;}})[_0x1d91('0x5d')](function(_0xc54371){logger[_0x1d91('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc54371);throw _0xc54371;});}return _0x33f445;})[_0x1d91('0x38')](respondWithResult(_0x365947,0xc9))['catch'](handleError(_0x365947,null));};exports[_0x1d91('0x37')]=function(_0x338d4f,_0x260416){if(_0x338d4f[_0x1d91('0x5f')]['id']){delete _0x338d4f[_0x1d91('0x5f')]['id'];}return db[_0x1d91('0x40')][_0x1d91('0x5c')]({'where':{'id':_0x338d4f[_0x1d91('0x65')]['id']},'include':[{'model':db[_0x1d91('0x3f')],'as':_0x1d91('0x5a')}]})[_0x1d91('0x38')](handleEntityNotFound(_0x260416,null))[_0x1d91('0x38')](saveUpdates(_0x338d4f[_0x1d91('0x5f')],null))[_0x1d91('0x38')](respondWithResult(_0x260416,null))[_0x1d91('0x5d')](handleError(_0x260416,null));};exports['destroy']=function(_0x456887,_0x1cd972){return db[_0x1d91('0x40')][_0x1d91('0x5c')]({'where':{'id':_0x456887['params']['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x1cd972,null))[_0x1d91('0x38')](removeEntity(_0x1cd972,null))[_0x1d91('0x5d')](handleError(_0x1cd972,null));};exports[_0x1d91('0x66')]=function(_0x754a7d,_0x5ef34d){return db[_0x1d91('0x40')]['describe']()[_0x1d91('0x38')](respondWithResult(_0x5ef34d,null))[_0x1d91('0x5d')](handleError(_0x5ef34d,null));};exports[_0x1d91('0x67')]=function(_0x3318a1,_0x71ee46,_0x1f5360){if(_0x3318a1[_0x1d91('0x5f')]['id']){delete _0x3318a1['body']['id'];}return db[_0x1d91('0x40')][_0x1d91('0x5c')]({'where':{'id':_0x3318a1['params']['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x71ee46,null))[_0x1d91('0x38')](function(_0x5b0105){if(_0x5b0105){_0x3318a1[_0x1d91('0x5f')][_0x1d91('0x68')]=_0x5b0105['id'];return db[_0x1d91('0x69')][_0x1d91('0x5e')](_0x3318a1[_0x1d91('0x5f')]);}})[_0x1d91('0x38')](respondWithResult(_0x71ee46,null))['catch'](handleError(_0x71ee46,null));};exports[_0x1d91('0x6a')]=function(_0x1be320,_0x594b3a,_0x27cca9){var _0x5373e0={'raw':![],'where':{}};var _0x5f10f9={};var _0x1d27f1={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x1be320[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x594b3a,null))[_0x1d91('0x38')](function(_0x901201){if(_0x901201){_0x5f10f9[_0x1d91('0x49')]=_[_0x1d91('0x46')](db[_0x1d91('0x69')][_0x1d91('0x41')]);_0x5f10f9['query']=_[_0x1d91('0x46')](_0x1be320[_0x1d91('0x45')]);_0x5f10f9['filters']=_['intersection'](_0x5f10f9['model'],_0x5f10f9['query']);_0x5373e0['attributes']=_[_0x1d91('0x48')](_0x5f10f9['model'],qs[_0x1d91('0x4b')](_0x1be320[_0x1d91('0x45')][_0x1d91('0x4b')]));_0x5373e0[_0x1d91('0x4a')]=_0x5373e0[_0x1d91('0x4a')][_0x1d91('0x6b')]?_0x5373e0['attributes']:_0x5f10f9['model'];if(!_0x1be320[_0x1d91('0x45')]['hasOwnProperty'](_0x1d91('0x6c'))){_0x5373e0[_0x1d91('0x32')]=qs[_0x1d91('0x32')](_0x1be320['query'][_0x1d91('0x32')]);_0x5373e0[_0x1d91('0x30')]=qs[_0x1d91('0x30')](_0x1be320[_0x1d91('0x45')][_0x1d91('0x30')]);}_0x5373e0['order']=qs[_0x1d91('0x4e')](_0x1be320['query'][_0x1d91('0x4e')]);_0x5373e0['where']=qs['filters'](_[_0x1d91('0x50')](_0x1be320[_0x1d91('0x45')],_0x5f10f9[_0x1d91('0x47')]));_0x5373e0[_0x1d91('0x4f')][_0x1d91('0x68')]=_0x901201['id'];if(_0x1be320[_0x1d91('0x45')][_0x1d91('0x53')]){_0x5373e0[_0x1d91('0x4f')]=_[_0x1d91('0x51')](_0x5373e0[_0x1d91('0x4f')],{'$or':_[_0x1d91('0x44')](_0x5373e0[_0x1d91('0x4a')],function(_0x2a093d){var _0x400cf5={};_0x400cf5[_0x2a093d]={'$like':'%'+_0x1be320[_0x1d91('0x45')][_0x1d91('0x53')]+'%'};return _0x400cf5;})});}_0x5373e0=_['merge']({},_0x5373e0,_0x1be320['options']);return db[_0x1d91('0x69')][_0x1d91('0x54')]({'where':_0x5373e0['where']})['then'](function(_0xefdb0e){_0x1d27f1[_0x1d91('0x54')]=_0xefdb0e;if(_0x1be320['query'][_0x1d91('0x55')]){_0x5373e0[_0x1d91('0x56')]=[{'all':!![]}];}return db[_0x1d91('0x69')]['findAll'](_0x5373e0);})[_0x1d91('0x38')](function(_0x28cff7){_0x1d27f1['rows']=_0x28cff7;return _0x1d27f1;});}})[_0x1d91('0x38')](respondWithFilteredResult(_0x594b3a,_0x5373e0))['catch'](handleError(_0x594b3a,null));};exports[_0x1d91('0x6d')]=function(_0x50671d,_0x2b7a57,_0x44231d){return db[_0x1d91('0x40')]['find']({'where':{'id':_0x50671d[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x2b7a57,null))[_0x1d91('0x38')](function(_0x4a8123){if(_0x4a8123){return _0x4a8123[_0x1d91('0x6d')](_0x50671d[_0x1d91('0x45')][_0x1d91('0x6e')]);}})['then'](respondWithStatusCode(_0x2b7a57,null))[_0x1d91('0x5d')](handleError(_0x2b7a57,null));};exports['addAnswer']=function(_0x177ede,_0x2153e7,_0xdb7f01){if(_0x177ede['body']['id']){delete _0x177ede[_0x1d91('0x5f')]['id'];}return db[_0x1d91('0x40')][_0x1d91('0x5c')]({'where':{'id':_0x177ede['params']['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x2153e7,null))['then'](function(_0x3137ca){if(_0x3137ca){_0x177ede[_0x1d91('0x5f')][_0x1d91('0x68')]=_0x3137ca['id'];return db['CannedAnswer'][_0x1d91('0x5e')](_0x177ede[_0x1d91('0x5f')]);}})[_0x1d91('0x38')](respondWithResult(_0x2153e7,null))[_0x1d91('0x5d')](handleError(_0x2153e7,null));};exports[_0x1d91('0x6f')]=function(_0x51831b,_0x17bfda,_0x5e967f){var _0x478bdc={'raw':![],'where':{}};var _0x4f9ff3={};var _0x394b6a={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x51831b[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x17bfda,null))[_0x1d91('0x38')](function(_0x381393){if(_0x381393){_0x4f9ff3[_0x1d91('0x49')]=_[_0x1d91('0x46')](db['CannedAnswer']['rawAttributes']);_0x4f9ff3[_0x1d91('0x45')]=_['keys'](_0x51831b[_0x1d91('0x45')]);_0x4f9ff3[_0x1d91('0x47')]=_[_0x1d91('0x48')](_0x4f9ff3[_0x1d91('0x49')],_0x4f9ff3['query']);_0x478bdc[_0x1d91('0x4a')]=_[_0x1d91('0x48')](_0x4f9ff3[_0x1d91('0x49')],qs['fields'](_0x51831b[_0x1d91('0x45')]['fields']));_0x478bdc[_0x1d91('0x4a')]=_0x478bdc[_0x1d91('0x4a')]['length']?_0x478bdc[_0x1d91('0x4a')]:_0x4f9ff3[_0x1d91('0x49')];if(!_0x51831b[_0x1d91('0x45')]['hasOwnProperty'](_0x1d91('0x6c'))){_0x478bdc['limit']=qs[_0x1d91('0x32')](_0x51831b['query'][_0x1d91('0x32')]);_0x478bdc['offset']=qs[_0x1d91('0x30')](_0x51831b[_0x1d91('0x45')]['offset']);}_0x478bdc[_0x1d91('0x4d')]=qs[_0x1d91('0x4e')](_0x51831b[_0x1d91('0x45')][_0x1d91('0x4e')]);_0x478bdc[_0x1d91('0x4f')]=qs[_0x1d91('0x47')](_[_0x1d91('0x50')](_0x51831b[_0x1d91('0x45')],_0x4f9ff3[_0x1d91('0x47')]));_0x478bdc[_0x1d91('0x4f')][_0x1d91('0x68')]=_0x381393['id'];if(_0x51831b['query']['filter']){_0x478bdc[_0x1d91('0x4f')]=_[_0x1d91('0x51')](_0x478bdc[_0x1d91('0x4f')],{'$or':_[_0x1d91('0x44')](_0x478bdc[_0x1d91('0x4a')],function(_0x543431){var _0x2ac06c={};_0x2ac06c[_0x543431]={'$like':'%'+_0x51831b['query'][_0x1d91('0x53')]+'%'};return _0x2ac06c;})});}_0x478bdc=_[_0x1d91('0x51')]({},_0x478bdc,_0x51831b[_0x1d91('0x5b')]);return db[_0x1d91('0x70')]['count']({'where':_0x478bdc[_0x1d91('0x4f')]})['then'](function(_0x166c35){_0x394b6a[_0x1d91('0x54')]=_0x166c35;if(_0x51831b[_0x1d91('0x45')]['includeAll']){_0x478bdc[_0x1d91('0x56')]=[{'all':!![]}];}return db[_0x1d91('0x70')][_0x1d91('0x57')](_0x478bdc);})['then'](function(_0x268d91){_0x394b6a[_0x1d91('0x58')]=_0x268d91;return _0x394b6a;});}})['then'](respondWithFilteredResult(_0x17bfda,_0x478bdc))[_0x1d91('0x5d')](handleError(_0x17bfda,null));};exports['removeAnswers']=function(_0x3b3f36,_0x4043fb,_0x4ebb04){return db[_0x1d91('0x40')][_0x1d91('0x5c')]({'where':{'id':_0x3b3f36[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x4043fb,null))[_0x1d91('0x38')](function(_0x3289af){if(_0x3289af){return _0x3289af[_0x1d91('0x71')](_0x3b3f36[_0x1d91('0x45')][_0x1d91('0x6e')]);}})[_0x1d91('0x38')](respondWithStatusCode(_0x4043fb,null))[_0x1d91('0x5d')](handleError(_0x4043fb,null));};exports['addInteraction']=function(_0x33319d,_0x381f63,_0x5b37a8){return db['FaxInteraction'][_0x1d91('0x5c')]({'where':{'id':_0x33319d[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x381f63,null))['then'](function(_0x437680){if(_0x437680){return _0x437680['addInteraction'](_0x33319d['body'][_0x1d91('0x6e')],_[_0x1d91('0x72')](_0x33319d[_0x1d91('0x5f')],[_0x1d91('0x6e'),'id'])||{});}})[_0x1d91('0x38')](respondWithResult(_0x381f63,null))[_0x1d91('0x5d')](handleError(_0x381f63,null));};exports['getInteractions']=function(_0xecb7c1,_0x206f11,_0x382fcc){var _0x2170b8={'raw':![],'where':{}};var _0x34c83d={};var _0x48189d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0xecb7c1[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x206f11,null))[_0x1d91('0x38')](function(_0x1f1460){if(_0x1f1460){_0x34c83d['model']=_[_0x1d91('0x46')](db['FaxInteraction']['rawAttributes']);_0x34c83d[_0x1d91('0x45')]=_['keys'](_0xecb7c1['query']);_0x34c83d['filters']=_[_0x1d91('0x48')](_0x34c83d[_0x1d91('0x49')],_0x34c83d['query']);_0x2170b8[_0x1d91('0x4a')]=_['intersection'](_0x34c83d['model'],qs[_0x1d91('0x4b')](_0xecb7c1[_0x1d91('0x45')][_0x1d91('0x4b')]));_0x2170b8[_0x1d91('0x4a')]=_0x2170b8['attributes'][_0x1d91('0x6b')]?_0x2170b8[_0x1d91('0x4a')]:_0x34c83d['model'];if(!_0xecb7c1[_0x1d91('0x45')][_0x1d91('0x4c')](_0x1d91('0x6c'))){_0x2170b8['limit']=qs[_0x1d91('0x32')](_0xecb7c1[_0x1d91('0x45')][_0x1d91('0x32')]);_0x2170b8[_0x1d91('0x30')]=qs[_0x1d91('0x30')](_0xecb7c1[_0x1d91('0x45')][_0x1d91('0x30')]);}_0x2170b8[_0x1d91('0x4d')]=qs[_0x1d91('0x4e')](_0xecb7c1[_0x1d91('0x45')]['sort']);_0x2170b8['where']=qs[_0x1d91('0x47')](_[_0x1d91('0x50')](_0xecb7c1[_0x1d91('0x45')],_0x34c83d[_0x1d91('0x47')]));_0x2170b8[_0x1d91('0x4f')][_0x1d91('0x68')]=_0x1f1460['id'];if(_0xecb7c1['query'][_0x1d91('0x53')]){_0x2170b8['where']=_[_0x1d91('0x51')](_0x2170b8[_0x1d91('0x4f')],{'$or':_[_0x1d91('0x44')](_0x2170b8[_0x1d91('0x4a')],function(_0x455cea){var _0x21f5d8={};_0x21f5d8[_0x455cea]={'$like':'%'+_0xecb7c1[_0x1d91('0x45')]['filter']+'%'};return _0x21f5d8;})});}_0x2170b8=_['merge']({},_0x2170b8,_0xecb7c1[_0x1d91('0x5b')]);return db[_0x1d91('0x73')]['count']({'where':_0x2170b8['where']})[_0x1d91('0x38')](function(_0x4d6280){_0x48189d[_0x1d91('0x54')]=_0x4d6280;if(_0xecb7c1[_0x1d91('0x45')][_0x1d91('0x55')]){_0x2170b8[_0x1d91('0x56')]=[{'model':db[_0x1d91('0x74')],'as':_0x1d91('0x75'),'required':![]},{'model':db[_0x1d91('0x76')],'as':_0x1d91('0x77'),'attributes':['name',_0x1d91('0x78'),_0x1d91('0x79')],'required':![]},{'model':db[_0x1d91('0x7a')],'as':_0x1d91('0x7b'),'attributes':['id','name',_0x1d91('0x7c')],'where':_0xecb7c1[_0x1d91('0x45')][_0x1d91('0x7d')]?{'id':_0xecb7c1[_0x1d91('0x45')]['tag']}:undefined,'required':_0xecb7c1['query'][_0x1d91('0x7d')]?!![]:![]}];}return db['FaxInteraction'][_0x1d91('0x57')](_0x2170b8);})[_0x1d91('0x38')](function(_0x1c5a14){_0x48189d[_0x1d91('0x58')]=_0x1c5a14;return _0x48189d;});}})[_0x1d91('0x38')](respondWithFilteredResult(_0x206f11,_0x2170b8))[_0x1d91('0x5d')](handleError(_0x206f11,null));};exports[_0x1d91('0x7e')]=function(_0x519c88,_0x4dfa03,_0x541025){return db[_0x1d91('0x40')][_0x1d91('0x7f')]({'where':{'id':_0x519c88[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x4dfa03,null))[_0x1d91('0x38')](function(_0x20b457){if(_0x20b457){return db[_0x1d91('0x80')][_0x1d91('0x81')](function(_0x14064c){return db['FaxApplication'][_0x1d91('0x3b')]({'where':{'FaxAccountId':_0x519c88[_0x1d91('0x65')]['id']},'transaction':_0x14064c})[_0x1d91('0x38')](function(_0x20df70){var _0x37c67c=_['map'](_0x519c88[_0x1d91('0x5f')],function(_0x164c51){_0x164c51[_0x1d91('0x68')]=_0x519c88[_0x1d91('0x65')]['id'];return _0x164c51;});return db['FaxApplication']['bulkCreate'](_0x37c67c,{'transaction':_0x14064c});});})['then'](function(){return db[_0x1d91('0x82')][_0x1d91('0x83')]({'where':{'FaxAccountId':_0x519c88[_0x1d91('0x65')]['id']},'order':_0x1d91('0x84')});});}})['then'](respondWithResult(_0x4dfa03,null))[_0x1d91('0x5d')](handleError(_0x4dfa03,null));};exports[_0x1d91('0x85')]=function(_0x2630b3,_0x4ebde2,_0x3112f4){var _0x353f6d={};var _0x16e3dc={};var _0x475471;var _0x5ebb5b;return db[_0x1d91('0x40')][_0x1d91('0x7f')]({'where':{'id':_0x2630b3['params']['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x4ebde2,null))[_0x1d91('0x38')](function(_0x16fef2){if(_0x16fef2){_0x475471=_0x16fef2;_0x16e3dc['model']=_[_0x1d91('0x46')](db['FaxApplication'][_0x1d91('0x41')]);_0x16e3dc['query']=_[_0x1d91('0x46')](_0x2630b3[_0x1d91('0x45')]);_0x16e3dc[_0x1d91('0x47')]=_[_0x1d91('0x48')](_0x16e3dc[_0x1d91('0x49')],_0x16e3dc[_0x1d91('0x45')]);_0x353f6d[_0x1d91('0x4a')]=_[_0x1d91('0x48')](_0x16e3dc['model'],qs[_0x1d91('0x4b')](_0x2630b3[_0x1d91('0x45')][_0x1d91('0x4b')]));_0x353f6d[_0x1d91('0x4a')]=_0x353f6d[_0x1d91('0x4a')][_0x1d91('0x6b')]?_0x353f6d[_0x1d91('0x4a')]:_0x16e3dc[_0x1d91('0x49')];_0x353f6d['order']=qs['sort'](_0x2630b3['query'][_0x1d91('0x4e')]);_0x353f6d['where']=qs[_0x1d91('0x47')](_[_0x1d91('0x50')](_0x2630b3[_0x1d91('0x45')],_0x16e3dc[_0x1d91('0x47')]));if(_0x2630b3[_0x1d91('0x45')][_0x1d91('0x53')]){_0x353f6d[_0x1d91('0x4f')]=_[_0x1d91('0x51')](_0x353f6d[_0x1d91('0x4f')],{'$or':_['map'](_0x353f6d[_0x1d91('0x4a')],function(_0x4e6677){var _0x579cd8={};_0x579cd8[_0x4e6677]={'$like':'%'+_0x2630b3['query'][_0x1d91('0x53')]+'%'};return _0x579cd8;})});}_0x353f6d=_['merge']({},_0x353f6d,_0x2630b3[_0x1d91('0x5b')]);return _0x475471[_0x1d91('0x85')](_0x353f6d);}})[_0x1d91('0x38')](function(_0x382a76){if(_0x382a76){_0x5ebb5b=_0x382a76['length'];if(!_0x2630b3['query'][_0x1d91('0x4c')](_0x1d91('0x6c'))){_0x353f6d[_0x1d91('0x32')]=qs[_0x1d91('0x32')](_0x2630b3[_0x1d91('0x45')][_0x1d91('0x32')]);_0x353f6d['offset']=qs['offset'](_0x2630b3['query'][_0x1d91('0x30')]);}return _0x475471['getApplications'](_0x353f6d);}})['then'](function(_0x5bddc4){if(_0x5bddc4){return _0x5bddc4?{'count':_0x5ebb5b,'rows':_0x5bddc4}:null;}})['then'](respondWithResult(_0x4ebde2,null))[_0x1d91('0x5d')](handleError(_0x4ebde2,null));};function Extension(_0x1e93d1,_0x5ecd08,_0x586e31,_0x5e27a0){this[_0x1d91('0x86')]=_0x1d91('0x87');this[_0x1d91('0x88')]=_0x1e93d1['localstationid'];this[_0x1d91('0x89')]=_0x5e27a0;this[_0x1d91('0x43')]=_0x1d91('0x8a');this[_0x1d91('0x8b')]=_0x1d91('0x8c');this[_0x1d91('0x68')]=_0x1e93d1['id'];this[_0x1d91('0x84')]=_0x5ecd08;this[_0x1d91('0x8d')]=_0x586e31;}function createExtensionsReciveFax(_0x45a903){var _0x25e797=0x1;var _0x3e145c=[];_0x3e145c['push'](new Extension(_0x45a903,_0x25e797,'','Answer'));_0x25e797+=0x1;_0x3e145c[_0x1d91('0x8e')](new Extension(_0x45a903,_0x25e797,_0x1d91('0x8f'),_0x1d91('0x90')));_0x25e797+=0x1;for(var _0x104a15 in _0x45a903){if(_0x45a903[_0x1d91('0x4c')](_0x104a15)&&(_0x104a15===_0x1d91('0x91')||_0x104a15===_0x1d91('0x92')||_0x104a15===_0x1d91('0x93')||_0x104a15===_0x1d91('0x94')||_0x104a15===_0x1d91('0x95')||_0x104a15==='maxrate'||_0x104a15==='minrate'||_0x104a15===_0x1d91('0x96')||_0x104a15===_0x1d91('0x97'))){_0x3e145c[_0x1d91('0x8e')](new Extension(_0x45a903,_0x25e797,_0x1d91('0x98')+_0x104a15+')='+_0x45a903[_0x104a15],_0x1d91('0x90')));_0x25e797+=0x1;}}_0x3e145c[_0x1d91('0x8e')](new Extension(_0x45a903,_0x25e797,'6',_0x1d91('0x99')));_0x25e797+=0x1;_0x3e145c[_0x1d91('0x8e')](new Extension(_0x45a903,_0x25e797,'/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',_0x1d91('0x9a')));_0x25e797=0x0;return _0x3e145c;}exports[_0x1d91('0x9b')]=function(_0x464d73,_0x205a90,_0x46aacd){var _0x10f392;return db[_0x1d91('0x80')][_0x1d91('0x81')](function(_0x4cb1d2){return db['FaxAccount'][_0x1d91('0x5e')](_0x464d73[_0x1d91('0x5f')],{'transaction':_0x4cb1d2})[_0x1d91('0x38')](function(_0x1edb50){_0x10f392=_0x1edb50[_0x1d91('0x63')]({'plain':!![]});return db[_0x1d91('0x9c')][_0x1d91('0x9d')](createExtensionsReciveFax(_0x10f392),{'transaction':_0x4cb1d2});});})[_0x1d91('0x38')](function(){return _0x10f392;})['then'](respondWithResult(_0x205a90,null))['catch'](handleError(_0x205a90,null));};exports['updateAccountApplications']=function(_0x108dc5,_0x2e6945,_0x103578){var _0x2a4346;return db[_0x1d91('0x80')][_0x1d91('0x81')](function(_0x4d297d){return db[_0x1d91('0x40')][_0x1d91('0x37')](_0x108dc5[_0x1d91('0x5f')],{'where':{'id':_0x108dc5[_0x1d91('0x5f')]['id']},'transaction':_0x4d297d})[_0x1d91('0x38')](function(_0xd7560b){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x108dc5[_0x1d91('0x5f')]['id']},'transaction':_0x4d297d})[_0x1d91('0x38')](function(_0x4b79c5){return db[_0x1d91('0x9c')][_0x1d91('0x9d')](createExtensionsReciveFax(_[_0x1d91('0x72')](_0x108dc5[_0x1d91('0x5f')],['tech',_0x1d91('0x9e'),_0x1d91('0x9f'),_0x1d91('0xa0'),_0x1d91('0xa1'),_0x1d91('0xa2')])),{'transaction':_0x4d297d});});});})[_0x1d91('0x38')](function(){return db['FaxAccount'][_0x1d91('0xa3')](_0x108dc5['body']['id']);})[_0x1d91('0x38')](respondWithResult(_0x2e6945,null))['catch'](handleError(_0x2e6945,null));};exports[_0x1d91('0xa4')]=function(_0x38d578,_0x47d252,_0x4fd708){var _0x16b453={'raw':!![],'where':{}};var _0x20634c={};var _0x48eb1d={'count':0x0,'rows':[]};return db[_0x1d91('0x40')][_0x1d91('0x7f')]({'where':{'id':_0x38d578['params']['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x47d252,null))[_0x1d91('0x38')](function(_0xb0c01e){if(_0xb0c01e){_0x20634c[_0x1d91('0x49')]=_[_0x1d91('0x46')](db[_0x1d91('0xa5')][_0x1d91('0x41')]);_0x20634c[_0x1d91('0x45')]=_[_0x1d91('0x46')](_0x38d578[_0x1d91('0x45')]);_0x20634c[_0x1d91('0x47')]=_['intersection'](_0x20634c[_0x1d91('0x49')],_0x20634c[_0x1d91('0x45')]);_0x16b453[_0x1d91('0x4a')]=_[_0x1d91('0x48')](_0x20634c['model'],qs[_0x1d91('0x4b')](_0x38d578['query']['fields']));_0x16b453[_0x1d91('0x4a')]=_0x16b453[_0x1d91('0x4a')][_0x1d91('0x6b')]?_0x16b453['attributes']:_0x20634c[_0x1d91('0x49')];if(!_0x38d578[_0x1d91('0x45')]['hasOwnProperty'](_0x1d91('0x6c'))){_0x16b453[_0x1d91('0x32')]=qs[_0x1d91('0x32')](_0x38d578[_0x1d91('0x45')]['limit']);_0x16b453['offset']=qs[_0x1d91('0x30')](_0x38d578[_0x1d91('0x45')][_0x1d91('0x30')]);}_0x16b453[_0x1d91('0x4d')]=qs[_0x1d91('0x4e')](_0x38d578[_0x1d91('0x45')][_0x1d91('0x4e')]);_0x16b453[_0x1d91('0x4f')]=qs[_0x1d91('0x47')](_[_0x1d91('0x50')](_0x38d578[_0x1d91('0x45')],_0x20634c[_0x1d91('0x47')]));_0x16b453['where'][_0x1d91('0x68')]=_0xb0c01e['id'];if(_0x38d578[_0x1d91('0x45')]['filter']){_0x16b453['where']=_[_0x1d91('0x51')](_0x16b453[_0x1d91('0x4f')],{'$or':_['map'](_0x16b453[_0x1d91('0x4a')],function(_0x3aae5e){var _0x57c8dc={};_0x57c8dc[_0x3aae5e]={'$like':'%'+_0x38d578[_0x1d91('0x45')][_0x1d91('0x53')]+'%'};return _0x57c8dc;})});}if(_0x38d578['query'][_0x1d91('0xa6')]){var _0x44a876=_0x38d578[_0x1d91('0x45')][_0x1d91('0xa6')][_0x1d91('0xa7')](',');var _0x1c6083={};_0x1c6083[_0x44a876[0x0]]={'$gte':moment(_0x44a876[0x1])[_0x1d91('0xa8')](_0x1d91('0xa9'))};_0x16b453[_0x1d91('0x4f')]=_[_0x1d91('0x51')](_0x16b453[_0x1d91('0x4f')],_0x1c6083);}_0x16b453=_[_0x1d91('0x51')]({},_0x16b453,_0x38d578[_0x1d91('0x5b')]);return db[_0x1d91('0xa5')][_0x1d91('0x54')]({'where':_0x16b453[_0x1d91('0x4f')]})[_0x1d91('0x38')](function(_0x46749a){_0x48eb1d['count']=_0x46749a;if(_0x38d578[_0x1d91('0x45')][_0x1d91('0x55')]){_0x16b453[_0x1d91('0x56')]=[{'all':!![]}];}return db[_0x1d91('0xa5')]['findAll'](_0x16b453);})[_0x1d91('0x38')](function(_0x4f642b){_0x48eb1d['rows']=_0x4f642b;return _0x48eb1d;});}})[_0x1d91('0x38')](respondWithFilteredResult(_0x47d252,_0x16b453))[_0x1d91('0x5d')](handleError(_0x47d252,null));};exports[_0x1d91('0xaa')]=function(_0x589130,_0x1804ff,_0x443a5f){var _0x3fcdd7,_0x5868d6={},_0x44594d;if(_0x589130['body']['to']){_0x44594d=_0x589130[_0x1d91('0x5f')]['to'][0x0];}return db[_0x1d91('0x40')]['find']({'where':{'id':_0x589130[_0x1d91('0x65')]['id']},'include':[{'model':db[_0x1d91('0xab')],'as':_0x1d91('0xac'),'include':[{'model':db[_0x1d91('0x74')],'as':_0x1d91('0xad'),'where':{'fax':_0x44594d},'limit':0x1,'order':[[_0x1d91('0xa0'),_0x1d91('0xae')]]}]}]})[_0x1d91('0x38')](handleEntityNotFound(_0x1804ff,null))['then'](function(_0xa6a745){_0x3fcdd7=_0xa6a745;if(_0x589130['body'][_0x1d91('0xaf')]&&_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][_0x1d91('0x6b')]){for(var _0x115ad5=0x0;_0x115ad5<_0x589130[_0x1d91('0x5f')]['attachments']['length'];_0x115ad5+=0x1){_0x589130[_0x1d91('0x5f')]['attachments'][_0x115ad5]={'filename':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][_0x115ad5]['name'],'id':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][_0x115ad5]['id'],'path':path[_0x1d91('0xb0')](config[_0x1d91('0xb1')],_0x1d91('0xb2'),_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][_0x115ad5]['basename'])};}}return respondWithRpcPromise(_0x1d91('0xb3'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x589130['params']['id'])?undefined:_0x589130[_0x1d91('0x65')]['id'],'path':_[_0x1d91('0xb4')](_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0][_0x1d91('0x8')])?undefined:_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0][_0x1d91('0x8')],'fax':_[_0x1d91('0xb4')](_0x589130[_0x1d91('0x5f')]['to'][0x0])?undefined:_0x589130[_0x1d91('0x5f')]['to'][0x0]},client9002);})[_0x1d91('0x38')](function(){if(_0x3fcdd7){if(_[_0x1d91('0xb4')](_0x589130['body']['from'])){_0x589130[_0x1d91('0x5f')][_0x1d91('0xb5')]=util['format']('\x22%s\x22\x20<%s>',_0x3fcdd7[_0x1d91('0x3d')],_0x3fcdd7[_0x1d91('0xb6')]);}if(_0x3fcdd7['List']){if(_0x3fcdd7[_0x1d91('0xac')][_0x1d91('0xad')][_0x1d91('0x6b')]){return _0x3fcdd7['List']['Contacts'][0x0];}else{return db[_0x1d91('0x74')]['create'](_['defaults'](_0x589130['body'],{'firstName':_0x589130[_0x1d91('0x5f')]['to'][0x0],'phone':_0x589130[_0x1d91('0x5f')]['to'][0x0],'fax':_0x589130['body']['to'][0x0],'ListId':_0x3fcdd7[_0x1d91('0xa2')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x1d91('0x38')](function(_0x51dd06){if(_0x51dd06){return db[_0x1d91('0x73')][_0x1d91('0x5c')]({'where':{'ContactId':_0x51dd06['id'],'closed':![],'FaxAccountId':_0x3fcdd7['id']}})[_0x1d91('0x38')](function(_0x273450){if(_0x273450){return[_0x273450,![]];}return db[_0x1d91('0x73')][_0x1d91('0x5e')]({'UserId':_0x589130[_0x1d91('0x62')]['id'],'ContactId':_0x51dd06['id'],'FaxAccountId':_0x3fcdd7['id'],'fax':_0x589130[_0x1d91('0x5f')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x589130[_0x1d91('0x5f')],{'read':![],'body':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0][_0x1d91('0xb7')],'FaxAccountId':_0x3fcdd7['id'],'UserId':_0x589130[_0x1d91('0x62')]['id'],'ContactId':_0x51dd06['id'],'AttachmentId':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0]['id']})]},{'include':[{'model':db[_0x1d91('0xa5')],'as':_0x1d91('0xb8')}]})[_0x1d91('0x38')](function(_0x2a7e2f){return[_0x2a7e2f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1d91('0xb9')](function(_0x3038fe,_0x210342){if(_0x210342){return _0x3038fe;}return db[_0x1d91('0xa5')][_0x1d91('0x5e')]({'direction':_0x1d91('0xba'),'read':![],'body':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0][_0x1d91('0xb7')],'FaxAccountId':_0x3fcdd7['id'],'FaxInteractionId':_0x3038fe['id'],'UserId':_0x589130[_0x1d91('0x62')]['id'],'ContactId':_0x3038fe[_0x1d91('0xbb')],'AttachmentId':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0]['id']})[_0x1d91('0x38')](function(_0x56c36a){_0x3038fe[_0x1d91('0xbc')][_0x1d91('0xb8')]=[];_0x3038fe[_0x1d91('0xbc')][_0x1d91('0xb8')][_0x1d91('0x8e')](_0x56c36a[_0x1d91('0xbc')]);return _0x3038fe;});})['then'](function(_0x2a576e){respondWithRpcPromise(_0x1d91('0xbd'),_0x1d91('0xbd'),{'FaxAccountId':_['isNil'](_0x589130['params']['id'])?undefined:_0x589130[_0x1d91('0x65')]['id'],'path':_[_0x1d91('0xb4')](_0x589130[_0x1d91('0x5f')]['attachments'][0x0][_0x1d91('0x8')])?undefined:_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0][_0x1d91('0x8')],'fax':_[_0x1d91('0xb4')](_0x589130[_0x1d91('0x5f')]['to'][0x0])?undefined:_0x589130[_0x1d91('0x5f')]['to'][0x0],'AttachmentId':_0x589130[_0x1d91('0x5f')][_0x1d91('0xaf')][0x0]['id']},client9002)[_0x1d91('0x38')](function(_0x3c5fbf){logger['info']('SendFaxRpc,\x20%s',_0x3c5fbf);})[_0x1d91('0x5d')](function(_0x3fde24){logger['info'](_0x1d91('0xbe'),_0x3fde24);});return _0x2a576e;})[_0x1d91('0x38')](respondWithResult(_0x1804ff,null))[_0x1d91('0x5d')](handleError(_0x1804ff,null));};exports[_0x1d91('0xbf')]=function(_0x35ba59,_0x5bcf25,_0x281d8c){return db[_0x1d91('0x40')][_0x1d91('0x5c')]({'where':{'id':_0x35ba59[_0x1d91('0x65')]['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x5bcf25,null))['then'](function(_0x1c9902){if(_0x1c9902){return _0x1c9902[_0x1d91('0xbf')](_0x35ba59[_0x1d91('0x5f')][_0x1d91('0x6e')],_[_0x1d91('0x72')](_0x35ba59['body'],['ids','id'])||{})[_0x1d91('0xb9')](function(_0x29ed1d){for(var _0x22e409=0x0;_0x22e409<_0x35ba59[_0x1d91('0x5f')]['ids'][_0x1d91('0x6b')];_0x22e409+=0x1){socket[_0x1d91('0xc0')](_0x1d91('0xc1'),{'UserId':Number(_0x35ba59['body']['ids'][_0x22e409]),'FaxAccountId':Number(_0x35ba59[_0x1d91('0x65')]['id'])});}return _0x29ed1d;});}})[_0x1d91('0x38')](respondWithResult(_0x5bcf25,null))[_0x1d91('0x5d')](handleError(_0x5bcf25,null));};exports['removeAgents']=function(_0x2db7ba,_0x238a1b,_0x379c67){return db['FaxAccount'][_0x1d91('0x5c')]({'where':{'id':_0x2db7ba['params']['id']}})[_0x1d91('0x38')](handleEntityNotFound(_0x238a1b,null))['then'](function(_0x3e5ea2){if(_0x3e5ea2){return _0x3e5ea2[_0x1d91('0xc2')](_0x2db7ba[_0x1d91('0x45')]['ids'])[_0x1d91('0x38')](function(){if(_['isArray'](_0x2db7ba['query']['ids'])){for(var _0x229c27=0x0;_0x229c27<_0x2db7ba[_0x1d91('0x45')][_0x1d91('0x6e')][_0x1d91('0x6b')];_0x229c27+=0x1){socket[_0x1d91('0xc0')](_0x1d91('0xc3'),{'UserId':Number(_0x2db7ba[_0x1d91('0x45')][_0x1d91('0x6e')][_0x229c27]),'FaxAccountId':Number(_0x2db7ba[_0x1d91('0x65')]['id'])});}}else{socket[_0x1d91('0xc0')](_0x1d91('0xc3'),{'UserId':Number(_0x2db7ba[_0x1d91('0x45')][_0x1d91('0x6e')]),'FaxAccountId':Number(_0x2db7ba[_0x1d91('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x238a1b,null))[_0x1d91('0x5d')](handleError(_0x238a1b,null));};exports[_0x1d91('0xc4')]=function(_0x52db29,_0x34f09e,_0x238e1c){var _0x468404={};var _0xd2ed98={};var _0x58f8eb;var _0x3ca7cd;return db['FaxAccount'][_0x1d91('0x7f')]({'where':{'id':_0x52db29[_0x1d91('0x65')]['id']}})['then'](handleEntityNotFound(_0x34f09e,null))['then'](function(_0xb043e9){if(_0xb043e9){_0x58f8eb=_0xb043e9;_0xd2ed98[_0x1d91('0x49')]=_[_0x1d91('0x46')](db[_0x1d91('0x76')]['rawAttributes']);_0xd2ed98[_0x1d91('0x45')]=_[_0x1d91('0x46')](_0x52db29[_0x1d91('0x45')]);_0xd2ed98[_0x1d91('0x47')]=_[_0x1d91('0x48')](_0xd2ed98['model'],_0xd2ed98['query']);_0x468404[_0x1d91('0x4a')]=_[_0x1d91('0x48')](_0xd2ed98[_0x1d91('0x49')],qs[_0x1d91('0x4b')](_0x52db29['query'][_0x1d91('0x4b')]));_0x468404[_0x1d91('0x4a')]=_0x468404['attributes']['length']?_0x468404[_0x1d91('0x4a')]:_0xd2ed98[_0x1d91('0x49')];_0x468404['order']=qs[_0x1d91('0x4e')](_0x52db29[_0x1d91('0x45')][_0x1d91('0x4e')]);_0x468404[_0x1d91('0x4f')]=qs['filters'](_[_0x1d91('0x50')](_0x52db29[_0x1d91('0x45')],_0xd2ed98[_0x1d91('0x47')]));if(_0x52db29[_0x1d91('0x45')][_0x1d91('0x53')]){_0x468404['where']=_[_0x1d91('0x51')](_0x468404[_0x1d91('0x4f')],{'$or':_['map'](_0x468404[_0x1d91('0x4a')],function(_0x458cc2){var _0x4cb2b8={};_0x4cb2b8[_0x458cc2]={'$like':'%'+_0x52db29['query'][_0x1d91('0x53')]+'%'};return _0x4cb2b8;})});}_0x468404=_['merge']({},_0x468404,_0x52db29['options']);return _0x58f8eb['getAgents'](_0x468404);}})[_0x1d91('0x38')](function(_0x480aa4){if(_0x480aa4){_0x3ca7cd=_0x480aa4[_0x1d91('0x6b')];if(!_0x52db29[_0x1d91('0x45')]['hasOwnProperty'](_0x1d91('0x6c'))){_0x468404['limit']=qs[_0x1d91('0x32')](_0x52db29[_0x1d91('0x45')][_0x1d91('0x32')]);_0x468404[_0x1d91('0x30')]=qs[_0x1d91('0x30')](_0x52db29[_0x1d91('0x45')][_0x1d91('0x30')]);}return _0x58f8eb[_0x1d91('0xc4')](_0x468404);}})[_0x1d91('0x38')](function(_0x2b202b){if(_0x2b202b){return _0x2b202b?{'count':_0x3ca7cd,'rows':_0x2b202b}:null;}})['then'](respondWithResult(_0x34f09e,null))[_0x1d91('0x5d')](handleError(_0x34f09e,null));};
\ No newline at end of file
+var _0x4dbc=['DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','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/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','UserProfileResource','then','end','stack','name','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','rows','show','params','Pause','keys','options','create','body','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','Disposition','getDispositions','FaxAccountId','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','type','system','Fax\x20Extension','appdata','Answer','ecm','gateway','maxrate','minrate','FAXOPT(','push','Wait','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','CmContact','Contacts'];(function(_0x13488c,_0x569d67){var _0x366716=function(_0x26804b){while(--_0x26804b){_0x13488c['push'](_0x13488c['shift']());}};_0x366716(++_0x569d67);}(_0x4dbc,0x1ab));var _0xc4db=function(_0x2df48f,_0x4129c1){_0x2df48f=_0x2df48f-0x0;var _0x1b7ad9=_0x4dbc[_0x2df48f];return _0x1b7ad9;};'use strict';var emlformat=require(_0xc4db('0x0'));var rimraf=require(_0xc4db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc4db('0x2'));var rp=require('request-promise');var moment=require(_0xc4db('0x3'));var BPromise=require(_0xc4db('0x4'));var Mustache=require(_0xc4db('0x5'));var util=require(_0xc4db('0x6'));var path=require(_0xc4db('0x7'));var sox=require('sox');var csv=require(_0xc4db('0x8'));var ejs=require(_0xc4db('0x9'));var fs=require('fs');var fs_extra=require(_0xc4db('0xa'));var _=require(_0xc4db('0xb'));var squel=require(_0xc4db('0xc'));var crypto=require(_0xc4db('0xd'));var jsforce=require(_0xc4db('0xe'));var deskjs=require(_0xc4db('0xf'));var toCsv=require(_0xc4db('0x8'));var querystring=require('querystring');var Papa=require(_0xc4db('0x10'));var Redis=require(_0xc4db('0x11'));var authService=require(_0xc4db('0x12'));var qs=require(_0xc4db('0x13'));var as=require(_0xc4db('0x14'));var hardwareService=require(_0xc4db('0x15'));var logger=require(_0xc4db('0x16'))(_0xc4db('0x17'));var utils=require(_0xc4db('0x18'));var config=require(_0xc4db('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4db('0x1a'))['db'];config[_0xc4db('0x1b')]=_[_0xc4db('0x1c')](config[_0xc4db('0x1b')],{'host':_0xc4db('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc4db('0x1e'))[_0xc4db('0x1f')](socket);var jayson=require(_0xc4db('0x20'));var client=jayson[_0xc4db('0x21')][_0xc4db('0x22')]({'port':0x232c});var client9002=jayson[_0xc4db('0x21')][_0xc4db('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x49024c,_0x3e39f8,_0x4f3e14,_0x55c9df){return new BPromise(function(_0xfb7051,_0x5e80df){var _0x125512=_0x55c9df||client;return _0x125512[_0xc4db('0x23')](_0x49024c,_0x4f3e14)['then'](function(_0x4c7d7a){logger[_0xc4db('0x24')](_0xc4db('0x25'),_0x3e39f8,_0xc4db('0x26'));logger[_0xc4db('0x27')](_0xc4db('0x28'),_0x3e39f8,'request\x20sent',JSON[_0xc4db('0x29')](_0x4c7d7a));if(_0x4c7d7a[_0xc4db('0x2a')]){if(_0x4c7d7a['error']['code']===0x1f4){logger[_0xc4db('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x3e39f8,_0x4c7d7a[_0xc4db('0x2a')]['message']);return _0x5e80df(_0x4c7d7a[_0xc4db('0x2a')][_0xc4db('0x2b')]);}logger['error'](_0xc4db('0x25'),_0x3e39f8,_0x4c7d7a[_0xc4db('0x2a')][_0xc4db('0x2b')]);return _0xfb7051(_0x4c7d7a['error'][_0xc4db('0x2b')]);}else{logger[_0xc4db('0x24')](_0xc4db('0x25'),_0x3e39f8,_0xc4db('0x26'));_0xfb7051(_0x4c7d7a[_0xc4db('0x2c')]['message']);}})[_0xc4db('0x2d')](function(_0xd65eba){logger[_0xc4db('0x2a')](_0xc4db('0x25'),_0x3e39f8,_0xd65eba);_0x5e80df(_0xd65eba);});});}function respondWithStatusCode(_0x262de1,_0x3552d4){_0x3552d4=_0x3552d4||0xcc;return function(_0x419f7a){if(_0x419f7a){return _0x262de1[_0xc4db('0x2e')](_0x3552d4);}return _0x262de1[_0xc4db('0x2f')](_0x3552d4)['end']();};}function respondWithResult(_0xf7fbf8,_0x2a196c){_0x2a196c=_0x2a196c||0xc8;return function(_0x477c0b){if(_0x477c0b){return _0xf7fbf8[_0xc4db('0x2f')](_0x2a196c)[_0xc4db('0x30')](_0x477c0b);}};}function respondWithFilteredResult(_0x5e345a,_0x29f5d3){return function(_0x25995e){if(_0x25995e){var _0x12b7b8=typeof _0x29f5d3['offset']===_0xc4db('0x31')&&typeof _0x29f5d3[_0xc4db('0x32')]===_0xc4db('0x31');var _0x416df4=_0x25995e[_0xc4db('0x33')];var _0x5a9f6c=_0x12b7b8?0x0:_0x29f5d3[_0xc4db('0x34')];var _0x4c5e41=_0x12b7b8?_0x25995e[_0xc4db('0x33')]:_0x29f5d3[_0xc4db('0x34')]+_0x29f5d3['limit'];var _0x3b6cce;if(_0x4c5e41>=_0x416df4){_0x4c5e41=_0x416df4;_0x3b6cce=0xc8;}else{_0x3b6cce=0xce;}_0x5e345a['status'](_0x3b6cce);return _0x5e345a[_0xc4db('0x35')]('Content-Range',_0x5a9f6c+'-'+_0x4c5e41+'/'+_0x416df4)['json'](_0x25995e);}return null;};}function patchUpdates(_0x578c64){return function(_0x1fac7f){try{jsonpatch[_0xc4db('0x36')](_0x1fac7f,_0x578c64,!![]);}catch(_0x4d52dc){return BPromise[_0xc4db('0x37')](_0x4d52dc);}return _0x1fac7f[_0xc4db('0x38')]();};}function saveUpdates(_0x37a0c1,_0x22253b){return function(_0x1e6fcc){if(_0x1e6fcc){return _0x1e6fcc[_0xc4db('0x39')](_0x37a0c1)['then'](function(_0x2229a0){return _0x2229a0;});}return null;};}function removeEntity(_0x43310b,_0xafb460){return function(_0x1c40ac){if(_0x1c40ac){return _0x1c40ac[_0xc4db('0x3a')]()['then'](function(){var _0xe5a6d=_0x1c40ac[_0xc4db('0x3b')]({'plain':!![]});var _0x4faea1='FaxAccounts';return db[_0xc4db('0x3c')][_0xc4db('0x3a')]({'where':{'type':_0x4faea1,'resourceId':_0xe5a6d['id']}})['then'](function(){return _0x1c40ac;});})[_0xc4db('0x3d')](function(){_0x43310b['status'](0xcc)[_0xc4db('0x3e')]();});}};}function handleEntityNotFound(_0x3059be,_0x2d1f5f){return function(_0x4adc0f){if(!_0x4adc0f){_0x3059be['sendStatus'](0x194);}return _0x4adc0f;};}function handleError(_0x23629e,_0x648c57){_0x648c57=_0x648c57||0x1f4;return function(_0x3cdcbf){logger[_0xc4db('0x2a')](_0x3cdcbf[_0xc4db('0x3f')]);if(_0x3cdcbf[_0xc4db('0x40')]){delete _0x3cdcbf[_0xc4db('0x40')];}_0x23629e['status'](_0x648c57)['send'](_0x3cdcbf);};}exports[_0xc4db('0x41')]=function(_0x134bb2,_0x2ec9ee){var _0x29b310={'include':[{'model':db['Pause'],'as':_0xc4db('0x42')}]},_0x59f025={},_0x3260b2={'count':0x0,'rows':[]};var _0x5700cf=_[_0xc4db('0x43')](db[_0xc4db('0x44')][_0xc4db('0x45')],function(_0x56b4c8){return{'name':_0x56b4c8[_0xc4db('0x46')],'type':_0x56b4c8['type'][_0xc4db('0x47')]};});_0x59f025['model']=_[_0xc4db('0x43')](_0x5700cf,_0xc4db('0x40'));_0x59f025['query']=_['keys'](_0x134bb2[_0xc4db('0x48')]);_0x59f025[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x59f025[_0xc4db('0x4b')],_0x59f025['query']);_0x29b310[_0xc4db('0x4c')]=_[_0xc4db('0x4a')](_0x59f025[_0xc4db('0x4b')],qs[_0xc4db('0x4d')](_0x134bb2['query'][_0xc4db('0x4d')]));_0x29b310[_0xc4db('0x4c')]=_0x29b310[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0x29b310['attributes']:_0x59f025[_0xc4db('0x4b')];if(!_0x134bb2[_0xc4db('0x48')][_0xc4db('0x4f')](_0xc4db('0x50'))){_0x29b310[_0xc4db('0x32')]=qs[_0xc4db('0x32')](_0x134bb2[_0xc4db('0x48')][_0xc4db('0x32')]);_0x29b310[_0xc4db('0x34')]=qs[_0xc4db('0x34')](_0x134bb2[_0xc4db('0x48')][_0xc4db('0x34')]);}_0x29b310[_0xc4db('0x51')]=qs[_0xc4db('0x52')](_0x134bb2[_0xc4db('0x48')][_0xc4db('0x52')]);_0x29b310['where']=qs[_0xc4db('0x49')](_[_0xc4db('0x53')](_0x134bb2['query'],_0x59f025[_0xc4db('0x49')]),_0x5700cf);if(_0x134bb2[_0xc4db('0x48')]['filter']){_0x29b310[_0xc4db('0x54')]=_['merge'](_0x29b310[_0xc4db('0x54')],{'$or':_[_0xc4db('0x43')](_0x5700cf,function(_0x245afc){if(_0x245afc['type']!==_0xc4db('0x55')){var _0x494516={};_0x494516[_0x245afc['name']]={'$like':'%'+_0x134bb2['query'][_0xc4db('0x56')]+'%'};return _0x494516;}})});}_0x29b310=_[_0xc4db('0x57')]({},_0x29b310,_0x134bb2['options']);var _0x1d2b2b={'where':_0x29b310[_0xc4db('0x54')]};return db[_0xc4db('0x44')][_0xc4db('0x33')](_0x1d2b2b)[_0xc4db('0x3d')](function(_0x51f57b){_0x3260b2[_0xc4db('0x33')]=_0x51f57b;if(_0x134bb2[_0xc4db('0x48')][_0xc4db('0x58')]){_0x29b310[_0xc4db('0x59')]=[{'all':!![]}];}return db[_0xc4db('0x44')]['findAll'](_0x29b310);})[_0xc4db('0x3d')](function(_0x558ebc){_0x3260b2[_0xc4db('0x5a')]=_0x558ebc;return _0x3260b2;})[_0xc4db('0x3d')](respondWithFilteredResult(_0x2ec9ee,_0x29b310))[_0xc4db('0x2d')](handleError(_0x2ec9ee,null));};exports[_0xc4db('0x5b')]=function(_0x29ab8d,_0x55d748){var _0x46cfaf={'raw':![],'where':{'id':_0x29ab8d[_0xc4db('0x5c')]['id']},'include':[{'model':db[_0xc4db('0x5d')],'as':_0xc4db('0x42')}]},_0x341e07={};_0x341e07['model']=_['keys'](db[_0xc4db('0x44')]['rawAttributes']);_0x341e07[_0xc4db('0x48')]=_[_0xc4db('0x5e')](_0x29ab8d['query']);_0x341e07[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x341e07['model'],_0x341e07[_0xc4db('0x48')]);_0x46cfaf[_0xc4db('0x4c')]=_[_0xc4db('0x4a')](_0x341e07[_0xc4db('0x4b')],qs[_0xc4db('0x4d')](_0x29ab8d['query'][_0xc4db('0x4d')]));_0x46cfaf[_0xc4db('0x4c')]=_0x46cfaf[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0x46cfaf[_0xc4db('0x4c')]:_0x341e07[_0xc4db('0x4b')];if(_0x29ab8d[_0xc4db('0x48')][_0xc4db('0x58')]){_0x46cfaf[_0xc4db('0x59')]=[{'all':!![]}];}_0x46cfaf=_[_0xc4db('0x57')]({},_0x46cfaf,_0x29ab8d[_0xc4db('0x5f')]);return db[_0xc4db('0x44')]['find'](_0x46cfaf)[_0xc4db('0x3d')](handleEntityNotFound(_0x55d748,null))['then'](respondWithResult(_0x55d748,null))[_0xc4db('0x2d')](handleError(_0x55d748,null));};exports[_0xc4db('0x60')]=function(_0x4882ec,_0x4f7c08){return db[_0xc4db('0x44')][_0xc4db('0x60')](_0x4882ec[_0xc4db('0x61')],{})[_0xc4db('0x3d')](function(_0x3ea1b6){var _0x923f8f=_0x4882ec['user'][_0xc4db('0x3b')]({'plain':!![]});if(!_0x923f8f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x923f8f[_0xc4db('0x62')]===_0xc4db('0x63')){var _0x17cad5=_0x3ea1b6[_0xc4db('0x3b')]({'plain':!![]});var _0x231277=_0xc4db('0x64');return db[_0xc4db('0x65')]['find']({'where':{'name':_0x231277,'userProfileId':_0x923f8f[_0xc4db('0x66')]},'raw':!![]})[_0xc4db('0x3d')](function(_0x3ebe34){if(_0x3ebe34&&_0x3ebe34[_0xc4db('0x67')]===0x0){return db[_0xc4db('0x3c')]['create']({'name':_0x17cad5[_0xc4db('0x40')],'resourceId':_0x17cad5['id'],'type':_0x3ebe34[_0xc4db('0x40')],'sectionId':_0x3ebe34['id']},{})[_0xc4db('0x3d')](function(){return _0x3ea1b6;});}else{return _0x3ea1b6;}})['catch'](function(_0x5d5299){logger['error'](_0xc4db('0x68'),_0x5d5299);throw _0x5d5299;});}return _0x3ea1b6;})['then'](respondWithResult(_0x4f7c08,0xc9))['catch'](handleError(_0x4f7c08,null));};exports[_0xc4db('0x39')]=function(_0x5bcae0,_0x2aee33){if(_0x5bcae0[_0xc4db('0x61')]['id']){delete _0x5bcae0[_0xc4db('0x61')]['id'];}return db[_0xc4db('0x44')][_0xc4db('0x69')]({'where':{'id':_0x5bcae0[_0xc4db('0x5c')]['id']},'include':[{'model':db[_0xc4db('0x5d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2aee33,null))['then'](saveUpdates(_0x5bcae0[_0xc4db('0x61')],null))['then'](respondWithResult(_0x2aee33,null))[_0xc4db('0x2d')](handleError(_0x2aee33,null));};exports[_0xc4db('0x3a')]=function(_0x3ac7be,_0x26c7f5){return db['FaxAccount'][_0xc4db('0x69')]({'where':{'id':_0x3ac7be[_0xc4db('0x5c')]['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x26c7f5,null))[_0xc4db('0x3d')](removeEntity(_0x26c7f5,null))[_0xc4db('0x2d')](handleError(_0x26c7f5,null));};exports[_0xc4db('0x6a')]=function(_0x2970b0,_0x2b91ce){return db[_0xc4db('0x44')][_0xc4db('0x6a')]()['then'](respondWithResult(_0x2b91ce,null))[_0xc4db('0x2d')](handleError(_0x2b91ce,null));};exports[_0xc4db('0x6b')]=function(_0x16f556,_0x73f3b8,_0x408f87){if(_0x16f556[_0xc4db('0x61')]['id']){delete _0x16f556['body']['id'];}return db[_0xc4db('0x44')][_0xc4db('0x69')]({'where':{'id':_0x16f556[_0xc4db('0x5c')]['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x73f3b8,null))['then'](function(_0x5e38cd){if(_0x5e38cd){_0x16f556[_0xc4db('0x61')]['FaxAccountId']=_0x5e38cd['id'];return db[_0xc4db('0x6c')][_0xc4db('0x60')](_0x16f556[_0xc4db('0x61')]);}})[_0xc4db('0x3d')](respondWithResult(_0x73f3b8,null))[_0xc4db('0x2d')](handleError(_0x73f3b8,null));};exports[_0xc4db('0x6d')]=function(_0x95fb4a,_0x2f1d8f,_0x483582){var _0x355762={'raw':![],'where':{}};var _0x126a1c={};var _0x29f4de={'count':0x0,'rows':[]};return db[_0xc4db('0x44')]['findOne']({'where':{'id':_0x95fb4a['params']['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x2f1d8f,null))[_0xc4db('0x3d')](function(_0x22ea1f){if(_0x22ea1f){_0x126a1c[_0xc4db('0x4b')]=_[_0xc4db('0x5e')](db['Disposition'][_0xc4db('0x45')]);_0x126a1c[_0xc4db('0x48')]=_['keys'](_0x95fb4a[_0xc4db('0x48')]);_0x126a1c['filters']=_['intersection'](_0x126a1c['model'],_0x126a1c[_0xc4db('0x48')]);_0x355762[_0xc4db('0x4c')]=_[_0xc4db('0x4a')](_0x126a1c[_0xc4db('0x4b')],qs['fields'](_0x95fb4a[_0xc4db('0x48')][_0xc4db('0x4d')]));_0x355762[_0xc4db('0x4c')]=_0x355762[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0x355762[_0xc4db('0x4c')]:_0x126a1c['model'];if(!_0x95fb4a['query'][_0xc4db('0x4f')](_0xc4db('0x50'))){_0x355762[_0xc4db('0x32')]=qs[_0xc4db('0x32')](_0x95fb4a[_0xc4db('0x48')][_0xc4db('0x32')]);_0x355762[_0xc4db('0x34')]=qs['offset'](_0x95fb4a['query'][_0xc4db('0x34')]);}_0x355762['order']=qs['sort'](_0x95fb4a['query'][_0xc4db('0x52')]);_0x355762[_0xc4db('0x54')]=qs['filters'](_[_0xc4db('0x53')](_0x95fb4a[_0xc4db('0x48')],_0x126a1c['filters']));_0x355762[_0xc4db('0x54')][_0xc4db('0x6e')]=_0x22ea1f['id'];if(_0x95fb4a['query'][_0xc4db('0x56')]){_0x355762[_0xc4db('0x54')]=_['merge'](_0x355762[_0xc4db('0x54')],{'$or':_['map'](_0x355762[_0xc4db('0x4c')],function(_0x296b14){var _0x868e94={};_0x868e94[_0x296b14]={'$like':'%'+_0x95fb4a[_0xc4db('0x48')][_0xc4db('0x56')]+'%'};return _0x868e94;})});}_0x355762=_[_0xc4db('0x57')]({},_0x355762,_0x95fb4a[_0xc4db('0x5f')]);return db[_0xc4db('0x6c')][_0xc4db('0x33')]({'where':_0x355762[_0xc4db('0x54')]})[_0xc4db('0x3d')](function(_0x1086cb){_0x29f4de[_0xc4db('0x33')]=_0x1086cb;if(_0x95fb4a[_0xc4db('0x48')][_0xc4db('0x58')]){_0x355762['include']=[{'all':!![]}];}return db[_0xc4db('0x6c')][_0xc4db('0x6f')](_0x355762);})[_0xc4db('0x3d')](function(_0x142fa5){_0x29f4de['rows']=_0x142fa5;return _0x29f4de;});}})['then'](respondWithFilteredResult(_0x2f1d8f,_0x355762))[_0xc4db('0x2d')](handleError(_0x2f1d8f,null));};exports['removeDispositions']=function(_0x546dc8,_0x4955fd,_0x23dee9){return db[_0xc4db('0x44')][_0xc4db('0x69')]({'where':{'id':_0x546dc8['params']['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x4955fd,null))[_0xc4db('0x3d')](function(_0x477fd5){if(_0x477fd5){return _0x477fd5[_0xc4db('0x70')](_0x546dc8[_0xc4db('0x48')][_0xc4db('0x71')]);}})[_0xc4db('0x3d')](respondWithStatusCode(_0x4955fd,null))[_0xc4db('0x2d')](handleError(_0x4955fd,null));};exports[_0xc4db('0x72')]=function(_0x510987,_0x27c1c2,_0x249123){if(_0x510987['body']['id']){delete _0x510987[_0xc4db('0x61')]['id'];}return db['FaxAccount'][_0xc4db('0x69')]({'where':{'id':_0x510987[_0xc4db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27c1c2,null))[_0xc4db('0x3d')](function(_0xf1f4f3){if(_0xf1f4f3){_0x510987[_0xc4db('0x61')][_0xc4db('0x6e')]=_0xf1f4f3['id'];return db['CannedAnswer']['create'](_0x510987[_0xc4db('0x61')]);}})['then'](respondWithResult(_0x27c1c2,null))[_0xc4db('0x2d')](handleError(_0x27c1c2,null));};exports[_0xc4db('0x73')]=function(_0x32c44d,_0x28c8fc,_0x18419b){var _0x55cb7d={'raw':![],'where':{}};var _0x451a54={};var _0x187714={'count':0x0,'rows':[]};return db[_0xc4db('0x44')][_0xc4db('0x74')]({'where':{'id':_0x32c44d[_0xc4db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x28c8fc,null))[_0xc4db('0x3d')](function(_0x2a67e1){if(_0x2a67e1){_0x451a54[_0xc4db('0x4b')]=_[_0xc4db('0x5e')](db['CannedAnswer'][_0xc4db('0x45')]);_0x451a54[_0xc4db('0x48')]=_[_0xc4db('0x5e')](_0x32c44d['query']);_0x451a54[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x451a54['model'],_0x451a54[_0xc4db('0x48')]);_0x55cb7d[_0xc4db('0x4c')]=_[_0xc4db('0x4a')](_0x451a54['model'],qs[_0xc4db('0x4d')](_0x32c44d[_0xc4db('0x48')][_0xc4db('0x4d')]));_0x55cb7d[_0xc4db('0x4c')]=_0x55cb7d[_0xc4db('0x4c')]['length']?_0x55cb7d[_0xc4db('0x4c')]:_0x451a54[_0xc4db('0x4b')];if(!_0x32c44d[_0xc4db('0x48')]['hasOwnProperty'](_0xc4db('0x50'))){_0x55cb7d[_0xc4db('0x32')]=qs[_0xc4db('0x32')](_0x32c44d[_0xc4db('0x48')][_0xc4db('0x32')]);_0x55cb7d[_0xc4db('0x34')]=qs[_0xc4db('0x34')](_0x32c44d[_0xc4db('0x48')]['offset']);}_0x55cb7d[_0xc4db('0x51')]=qs[_0xc4db('0x52')](_0x32c44d[_0xc4db('0x48')]['sort']);_0x55cb7d[_0xc4db('0x54')]=qs[_0xc4db('0x49')](_['pick'](_0x32c44d[_0xc4db('0x48')],_0x451a54[_0xc4db('0x49')]));_0x55cb7d[_0xc4db('0x54')][_0xc4db('0x6e')]=_0x2a67e1['id'];if(_0x32c44d['query']['filter']){_0x55cb7d['where']=_['merge'](_0x55cb7d[_0xc4db('0x54')],{'$or':_[_0xc4db('0x43')](_0x55cb7d[_0xc4db('0x4c')],function(_0x146418){var _0x3af3eb={};_0x3af3eb[_0x146418]={'$like':'%'+_0x32c44d[_0xc4db('0x48')][_0xc4db('0x56')]+'%'};return _0x3af3eb;})});}_0x55cb7d=_['merge']({},_0x55cb7d,_0x32c44d['options']);return db[_0xc4db('0x75')][_0xc4db('0x33')]({'where':_0x55cb7d[_0xc4db('0x54')]})[_0xc4db('0x3d')](function(_0x2203ef){_0x187714[_0xc4db('0x33')]=_0x2203ef;if(_0x32c44d[_0xc4db('0x48')][_0xc4db('0x58')]){_0x55cb7d[_0xc4db('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc4db('0x6f')](_0x55cb7d);})[_0xc4db('0x3d')](function(_0x3a6494){_0x187714['rows']=_0x3a6494;return _0x187714;});}})['then'](respondWithFilteredResult(_0x28c8fc,_0x55cb7d))[_0xc4db('0x2d')](handleError(_0x28c8fc,null));};exports['removeAnswers']=function(_0x27d2a2,_0x5eeb29,_0x2c1493){return db[_0xc4db('0x44')][_0xc4db('0x69')]({'where':{'id':_0x27d2a2['params']['id']}})['then'](handleEntityNotFound(_0x5eeb29,null))[_0xc4db('0x3d')](function(_0x192be6){if(_0x192be6){return _0x192be6[_0xc4db('0x76')](_0x27d2a2[_0xc4db('0x48')]['ids']);}})[_0xc4db('0x3d')](respondWithStatusCode(_0x5eeb29,null))[_0xc4db('0x2d')](handleError(_0x5eeb29,null));};exports[_0xc4db('0x77')]=function(_0x27c936,_0x5e3395,_0x33b1cd){return db[_0xc4db('0x78')][_0xc4db('0x69')]({'where':{'id':_0x27c936[_0xc4db('0x5c')]['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x5e3395,null))[_0xc4db('0x3d')](function(_0x4f0a7e){if(_0x4f0a7e){return _0x4f0a7e[_0xc4db('0x77')](_0x27c936[_0xc4db('0x61')]['ids'],_[_0xc4db('0x79')](_0x27c936['body'],[_0xc4db('0x71'),'id'])||{});}})[_0xc4db('0x3d')](respondWithResult(_0x5e3395,null))[_0xc4db('0x2d')](handleError(_0x5e3395,null));};exports[_0xc4db('0x7a')]=function(_0x3e5cd4,_0x32b4a0,_0x1f8651){var _0x215b74={'raw':![],'where':{}};var _0x3bd39c={};var _0x17f3ec={'count':0x0,'rows':[]};return db[_0xc4db('0x44')][_0xc4db('0x74')]({'where':{'id':_0x3e5cd4['params']['id']}})['then'](handleEntityNotFound(_0x32b4a0,null))[_0xc4db('0x3d')](function(_0x1a5a54){if(_0x1a5a54){_0x3bd39c[_0xc4db('0x4b')]=_[_0xc4db('0x5e')](db['FaxInteraction']['rawAttributes']);_0x3bd39c[_0xc4db('0x48')]=_['keys'](_0x3e5cd4['query']);_0x3bd39c[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x3bd39c[_0xc4db('0x4b')],_0x3bd39c[_0xc4db('0x48')]);_0x215b74[_0xc4db('0x4c')]=_['intersection'](_0x3bd39c['model'],qs[_0xc4db('0x4d')](_0x3e5cd4[_0xc4db('0x48')]['fields']));_0x215b74[_0xc4db('0x4c')]=_0x215b74[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0x215b74[_0xc4db('0x4c')]:_0x3bd39c[_0xc4db('0x4b')];if(!_0x3e5cd4[_0xc4db('0x48')]['hasOwnProperty'](_0xc4db('0x50'))){_0x215b74['limit']=qs['limit'](_0x3e5cd4[_0xc4db('0x48')][_0xc4db('0x32')]);_0x215b74[_0xc4db('0x34')]=qs[_0xc4db('0x34')](_0x3e5cd4[_0xc4db('0x48')]['offset']);}_0x215b74[_0xc4db('0x51')]=qs[_0xc4db('0x52')](_0x3e5cd4['query'][_0xc4db('0x52')]);_0x215b74[_0xc4db('0x54')]=qs['filters'](_[_0xc4db('0x53')](_0x3e5cd4[_0xc4db('0x48')],_0x3bd39c[_0xc4db('0x49')]));_0x215b74[_0xc4db('0x54')][_0xc4db('0x6e')]=_0x1a5a54['id'];if(_0x3e5cd4['query']['filter']){_0x215b74[_0xc4db('0x54')]=_[_0xc4db('0x57')](_0x215b74['where'],{'$or':_['map'](_0x215b74[_0xc4db('0x4c')],function(_0x21f033){var _0x8ff5d3={};_0x8ff5d3[_0x21f033]={'$like':'%'+_0x3e5cd4[_0xc4db('0x48')][_0xc4db('0x56')]+'%'};return _0x8ff5d3;})});}_0x215b74=_[_0xc4db('0x57')]({},_0x215b74,_0x3e5cd4[_0xc4db('0x5f')]);return db[_0xc4db('0x78')][_0xc4db('0x33')]({'where':_0x215b74[_0xc4db('0x54')]})['then'](function(_0x3580f2){_0x17f3ec[_0xc4db('0x33')]=_0x3580f2;if(_0x3e5cd4['query'][_0xc4db('0x58')]){_0x215b74['include']=[{'model':db['CmContact'],'as':_0xc4db('0x7b'),'required':![]},{'model':db['User'],'as':_0xc4db('0x7c'),'attributes':[_0xc4db('0x40'),_0xc4db('0x7d'),_0xc4db('0x7e')],'required':![]},{'model':db['Tag'],'as':_0xc4db('0x7f'),'attributes':['id','name',_0xc4db('0x80')],'where':_0x3e5cd4[_0xc4db('0x48')][_0xc4db('0x81')]?{'id':_0x3e5cd4[_0xc4db('0x48')][_0xc4db('0x81')]}:undefined,'required':_0x3e5cd4[_0xc4db('0x48')][_0xc4db('0x81')]?!![]:![]}];}return db[_0xc4db('0x78')][_0xc4db('0x6f')](_0x215b74);})[_0xc4db('0x3d')](function(_0x58075c){_0x17f3ec[_0xc4db('0x5a')]=_0x58075c;return _0x17f3ec;});}})['then'](respondWithFilteredResult(_0x32b4a0,_0x215b74))[_0xc4db('0x2d')](handleError(_0x32b4a0,null));};exports['addApplications']=function(_0x4a3d95,_0x130e9a,_0x2008a2){return db[_0xc4db('0x44')]['findOne']({'where':{'id':_0x4a3d95['params']['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x130e9a,null))['then'](function(_0x4cfe02){if(_0x4cfe02){return db[_0xc4db('0x82')][_0xc4db('0x83')](function(_0x4e91c3){return db[_0xc4db('0x84')]['destroy']({'where':{'FaxAccountId':_0x4a3d95[_0xc4db('0x5c')]['id']},'transaction':_0x4e91c3})[_0xc4db('0x3d')](function(_0x2a379){var _0x4ea846=_[_0xc4db('0x43')](_0x4a3d95['body'],function(_0x54641a){_0x54641a['FaxAccountId']=_0x4a3d95[_0xc4db('0x5c')]['id'];return _0x54641a;});return db[_0xc4db('0x84')][_0xc4db('0x85')](_0x4ea846,{'transaction':_0x4e91c3});});})[_0xc4db('0x3d')](function(){return db['FaxApplication'][_0xc4db('0x86')]({'where':{'FaxAccountId':_0x4a3d95[_0xc4db('0x5c')]['id']},'order':_0xc4db('0x87')});});}})[_0xc4db('0x3d')](respondWithResult(_0x130e9a,null))[_0xc4db('0x2d')](handleError(_0x130e9a,null));};exports[_0xc4db('0x88')]=function(_0x148fda,_0x477871,_0x26a0af){var _0x3d1104={};var _0x16594d={};var _0xf69802;var _0x6edb63;return db[_0xc4db('0x44')][_0xc4db('0x74')]({'where':{'id':_0x148fda[_0xc4db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x477871,null))['then'](function(_0x506094){if(_0x506094){_0xf69802=_0x506094;_0x16594d[_0xc4db('0x4b')]=_['keys'](db['FaxApplication'][_0xc4db('0x45')]);_0x16594d['query']=_['keys'](_0x148fda[_0xc4db('0x48')]);_0x16594d[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0x16594d[_0xc4db('0x4b')],_0x16594d[_0xc4db('0x48')]);_0x3d1104[_0xc4db('0x4c')]=_[_0xc4db('0x4a')](_0x16594d[_0xc4db('0x4b')],qs[_0xc4db('0x4d')](_0x148fda['query'][_0xc4db('0x4d')]));_0x3d1104[_0xc4db('0x4c')]=_0x3d1104[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0x3d1104['attributes']:_0x16594d[_0xc4db('0x4b')];_0x3d1104[_0xc4db('0x51')]=qs['sort'](_0x148fda[_0xc4db('0x48')][_0xc4db('0x52')]);_0x3d1104['where']=qs['filters'](_['pick'](_0x148fda[_0xc4db('0x48')],_0x16594d[_0xc4db('0x49')]));if(_0x148fda[_0xc4db('0x48')][_0xc4db('0x56')]){_0x3d1104[_0xc4db('0x54')]=_[_0xc4db('0x57')](_0x3d1104[_0xc4db('0x54')],{'$or':_['map'](_0x3d1104[_0xc4db('0x4c')],function(_0x482c8c){var _0x249d82={};_0x249d82[_0x482c8c]={'$like':'%'+_0x148fda['query'][_0xc4db('0x56')]+'%'};return _0x249d82;})});}_0x3d1104=_[_0xc4db('0x57')]({},_0x3d1104,_0x148fda[_0xc4db('0x5f')]);return _0xf69802['getApplications'](_0x3d1104);}})[_0xc4db('0x3d')](function(_0x54fe63){if(_0x54fe63){_0x6edb63=_0x54fe63['length'];if(!_0x148fda['query'][_0xc4db('0x4f')](_0xc4db('0x50'))){_0x3d1104[_0xc4db('0x32')]=qs['limit'](_0x148fda[_0xc4db('0x48')]['limit']);_0x3d1104[_0xc4db('0x34')]=qs['offset'](_0x148fda['query'][_0xc4db('0x34')]);}return _0xf69802[_0xc4db('0x88')](_0x3d1104);}})[_0xc4db('0x3d')](function(_0x231b96){if(_0x231b96){return _0x231b96?{'count':_0x6edb63,'rows':_0x231b96}:null;}})[_0xc4db('0x3d')](respondWithResult(_0x477871,null))[_0xc4db('0x2d')](handleError(_0x477871,null));};function Extension(_0x577f86,_0x32e99d,_0x4f9417,_0x129be2){this[_0xc4db('0x89')]=_0xc4db('0x8a');this[_0xc4db('0x8b')]=_0x577f86[_0xc4db('0x8c')];this[_0xc4db('0x8d')]=_0x129be2;this[_0xc4db('0x8e')]=_0xc4db('0x8f');this['description']=_0xc4db('0x90');this['FaxAccountId']=_0x577f86['id'];this['priority']=_0x32e99d;this[_0xc4db('0x91')]=_0x4f9417;}function createExtensionsReciveFax(_0x1da264){var _0x499f86=0x1;var _0x21633b=[];_0x21633b['push'](new Extension(_0x1da264,_0x499f86,'',_0xc4db('0x92')));_0x499f86+=0x1;_0x21633b['push'](new Extension(_0x1da264,_0x499f86,'CDR(type)=inbound-fax','Set'));_0x499f86+=0x1;for(var _0x32c3f0 in _0x1da264){if(_0x1da264[_0xc4db('0x4f')](_0x32c3f0)&&(_0x32c3f0===_0xc4db('0x93')||_0x32c3f0==='localstationid'||_0x32c3f0===_0xc4db('0x94')||_0x32c3f0==='faxdetect'||_0x32c3f0==='headerinfo'||_0x32c3f0===_0xc4db('0x95')||_0x32c3f0===_0xc4db('0x96')||_0x32c3f0==='modem'||_0x32c3f0==='t38timeout')){_0x21633b['push'](new Extension(_0x1da264,_0x499f86,_0xc4db('0x97')+_0x32c3f0+')='+_0x1da264[_0x32c3f0],'Set'));_0x499f86+=0x1;}}_0x21633b[_0xc4db('0x98')](new Extension(_0x1da264,_0x499f86,'6',_0xc4db('0x99')));_0x499f86+=0x1;_0x21633b[_0xc4db('0x98')](new Extension(_0x1da264,_0x499f86,'/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',_0xc4db('0x9a')));_0x499f86=0x0;return _0x21633b;}exports[_0xc4db('0x9b')]=function(_0x23336f,_0x54745f,_0x3d9401){var _0xecc876;return db['sequelize']['transaction'](function(_0x5b6a2f){return db[_0xc4db('0x44')]['create'](_0x23336f[_0xc4db('0x61')],{'transaction':_0x5b6a2f})[_0xc4db('0x3d')](function(_0x187122){_0xecc876=_0x187122[_0xc4db('0x3b')]({'plain':!![]});return db['VoiceExtension'][_0xc4db('0x85')](createExtensionsReciveFax(_0xecc876),{'transaction':_0x5b6a2f});});})[_0xc4db('0x3d')](function(){return _0xecc876;})['then'](respondWithResult(_0x54745f,null))['catch'](handleError(_0x54745f,null));};exports['updateAccountApplications']=function(_0x79d71,_0xbe3f9b,_0xdeaf29){var _0x1f1e55;return db[_0xc4db('0x82')][_0xc4db('0x83')](function(_0x242541){return db[_0xc4db('0x44')][_0xc4db('0x39')](_0x79d71[_0xc4db('0x61')],{'where':{'id':_0x79d71[_0xc4db('0x61')]['id']},'transaction':_0x242541})['then'](function(_0x3282b2){return db[_0xc4db('0x9c')][_0xc4db('0x3a')]({'where':{'FaxAccountId':_0x79d71['body']['id']},'transaction':_0x242541})[_0xc4db('0x3d')](function(_0x5c4d2f){return db[_0xc4db('0x9c')][_0xc4db('0x85')](createExtensionsReciveFax(_[_0xc4db('0x79')](_0x79d71['body'],[_0xc4db('0x9d'),_0xc4db('0x47'),_0xc4db('0x9e'),_0xc4db('0x9f'),_0xc4db('0xa0'),_0xc4db('0xa1')])),{'transaction':_0x242541});});});})[_0xc4db('0x3d')](function(){return db[_0xc4db('0x44')][_0xc4db('0xa2')](_0x79d71[_0xc4db('0x61')]['id']);})[_0xc4db('0x3d')](respondWithResult(_0xbe3f9b,null))[_0xc4db('0x2d')](handleError(_0xbe3f9b,null));};exports['getMessages']=function(_0x1cb355,_0x470143,_0x3c8ee5){var _0x37f3c9={'raw':!![],'where':{}};var _0x469570={};var _0x106a46={'count':0x0,'rows':[]};return db[_0xc4db('0x44')][_0xc4db('0x74')]({'where':{'id':_0x1cb355[_0xc4db('0x5c')]['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x470143,null))[_0xc4db('0x3d')](function(_0x3a5915){if(_0x3a5915){_0x469570[_0xc4db('0x4b')]=_['keys'](db[_0xc4db('0xa3')][_0xc4db('0x45')]);_0x469570[_0xc4db('0x48')]=_['keys'](_0x1cb355['query']);_0x469570[_0xc4db('0x49')]=_['intersection'](_0x469570[_0xc4db('0x4b')],_0x469570[_0xc4db('0x48')]);_0x37f3c9[_0xc4db('0x4c')]=_['intersection'](_0x469570[_0xc4db('0x4b')],qs[_0xc4db('0x4d')](_0x1cb355[_0xc4db('0x48')][_0xc4db('0x4d')]));_0x37f3c9[_0xc4db('0x4c')]=_0x37f3c9[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0x37f3c9[_0xc4db('0x4c')]:_0x469570[_0xc4db('0x4b')];if(!_0x1cb355[_0xc4db('0x48')][_0xc4db('0x4f')](_0xc4db('0x50'))){_0x37f3c9[_0xc4db('0x32')]=qs[_0xc4db('0x32')](_0x1cb355[_0xc4db('0x48')][_0xc4db('0x32')]);_0x37f3c9[_0xc4db('0x34')]=qs['offset'](_0x1cb355[_0xc4db('0x48')][_0xc4db('0x34')]);}_0x37f3c9[_0xc4db('0x51')]=qs[_0xc4db('0x52')](_0x1cb355['query'][_0xc4db('0x52')]);_0x37f3c9[_0xc4db('0x54')]=qs[_0xc4db('0x49')](_[_0xc4db('0x53')](_0x1cb355[_0xc4db('0x48')],_0x469570[_0xc4db('0x49')]));_0x37f3c9['where'][_0xc4db('0x6e')]=_0x3a5915['id'];if(_0x1cb355[_0xc4db('0x48')]['filter']){_0x37f3c9[_0xc4db('0x54')]=_['merge'](_0x37f3c9[_0xc4db('0x54')],{'$or':_[_0xc4db('0x43')](_0x37f3c9['attributes'],function(_0x1b2682){var _0x45d9bf={};_0x45d9bf[_0x1b2682]={'$like':'%'+_0x1cb355[_0xc4db('0x48')][_0xc4db('0x56')]+'%'};return _0x45d9bf;})});}if(_0x1cb355[_0xc4db('0x48')][_0xc4db('0xa4')]){var _0x46c08a=_0x1cb355[_0xc4db('0x48')]['$gte'][_0xc4db('0xa5')](',');var _0x10d3cb={};_0x10d3cb[_0x46c08a[0x0]]={'$gte':moment(_0x46c08a[0x1])[_0xc4db('0xa6')](_0xc4db('0xa7'))};_0x37f3c9[_0xc4db('0x54')]=_['merge'](_0x37f3c9['where'],_0x10d3cb);}_0x37f3c9=_['merge']({},_0x37f3c9,_0x1cb355[_0xc4db('0x5f')]);return db[_0xc4db('0xa3')][_0xc4db('0x33')]({'where':_0x37f3c9[_0xc4db('0x54')]})[_0xc4db('0x3d')](function(_0x552f42){_0x106a46['count']=_0x552f42;if(_0x1cb355[_0xc4db('0x48')][_0xc4db('0x58')]){_0x37f3c9[_0xc4db('0x59')]=[{'all':!![]}];}return db[_0xc4db('0xa3')][_0xc4db('0x6f')](_0x37f3c9);})['then'](function(_0x4acfa8){_0x106a46['rows']=_0x4acfa8;return _0x106a46;});}})[_0xc4db('0x3d')](respondWithFilteredResult(_0x470143,_0x37f3c9))[_0xc4db('0x2d')](handleError(_0x470143,null));};exports[_0xc4db('0xa8')]=function(_0x4f9d00,_0x13f9a6,_0x261446){var _0x23a1c0,_0x5d7586={},_0x75dfba;if(_0x4f9d00[_0xc4db('0x61')]['to']){_0x75dfba=_0x4f9d00['body']['to'][0x0];}return db[_0xc4db('0x44')][_0xc4db('0x69')]({'where':{'id':_0x4f9d00[_0xc4db('0x5c')]['id']},'include':[{'model':db[_0xc4db('0xa9')],'as':_0xc4db('0xaa'),'include':[{'model':db[_0xc4db('0xab')],'as':_0xc4db('0xac'),'where':{'fax':_0x75dfba},'limit':0x1,'order':[['updatedAt',_0xc4db('0xad')]]}]}]})[_0xc4db('0x3d')](handleEntityNotFound(_0x13f9a6,null))[_0xc4db('0x3d')](function(_0x1073ff){_0x23a1c0=_0x1073ff;if(_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')]&&_0x4f9d00[_0xc4db('0x61')]['attachments'][_0xc4db('0x4e')]){for(var _0x94506b=0x0;_0x94506b<_0x4f9d00[_0xc4db('0x61')]['attachments']['length'];_0x94506b+=0x1){_0x4f9d00[_0xc4db('0x61')]['attachments'][_0x94506b]={'filename':_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][_0x94506b][_0xc4db('0x40')],'id':_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][_0x94506b]['id'],'path':path[_0xc4db('0xaf')](config[_0xc4db('0xb0')],'server/files/attachments',_0x4f9d00[_0xc4db('0x61')]['attachments'][_0x94506b][_0xc4db('0xb1')])};}}return respondWithRpcPromise(_0xc4db('0xb2'),_0xc4db('0xb2'),{'FaxAccountId':_[_0xc4db('0xb3')](_0x4f9d00['params']['id'])?undefined:_0x4f9d00['params']['id'],'path':_[_0xc4db('0xb3')](_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0][_0xc4db('0x7')])?undefined:_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0]['path'],'fax':_[_0xc4db('0xb3')](_0x4f9d00[_0xc4db('0x61')]['to'][0x0])?undefined:_0x4f9d00[_0xc4db('0x61')]['to'][0x0]},client9002);})[_0xc4db('0x3d')](function(){if(_0x23a1c0){if(_[_0xc4db('0xb3')](_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xb4')])){_0x4f9d00[_0xc4db('0x61')]['from']=util[_0xc4db('0xa6')](_0xc4db('0xb5'),_0x23a1c0[_0xc4db('0x40')],_0x23a1c0[_0xc4db('0xb6')]);}if(_0x23a1c0['List']){if(_0x23a1c0[_0xc4db('0xaa')][_0xc4db('0xac')][_0xc4db('0x4e')]){return _0x23a1c0[_0xc4db('0xaa')][_0xc4db('0xac')][0x0];}else{return db['CmContact']['create'](_[_0xc4db('0x1c')](_0x4f9d00[_0xc4db('0x61')],{'firstName':_0x4f9d00[_0xc4db('0x61')]['to'][0x0],'phone':_0x4f9d00[_0xc4db('0x61')]['to'][0x0],'fax':_0x4f9d00[_0xc4db('0x61')]['to'][0x0],'ListId':_0x23a1c0['ListId']}));}}else{throw new Error(_0xc4db('0xb7'));}}else{throw new Error(_0xc4db('0xb8'));}})[_0xc4db('0x3d')](function(_0x169f79){if(_0x169f79){return db[_0xc4db('0x78')][_0xc4db('0x69')]({'where':{'ContactId':_0x169f79['id'],'closed':![],'FaxAccountId':_0x23a1c0['id']}})[_0xc4db('0x3d')](function(_0x346ae0){if(_0x346ae0){return[_0x346ae0,![]];}return db['FaxInteraction']['create']({'UserId':_0x4f9d00['user']['id'],'ContactId':_0x169f79['id'],'FaxAccountId':_0x23a1c0['id'],'fax':_0x4f9d00['body']['to'][0x0],'firstMsgDirection':_0xc4db('0xb9'),'Messages':[_[_0xc4db('0x57')](_0x4f9d00[_0xc4db('0x61')],{'read':![],'body':_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0][_0xc4db('0xba')],'FaxAccountId':_0x23a1c0['id'],'UserId':_0x4f9d00['user']['id'],'ContactId':_0x169f79['id'],'AttachmentId':_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0]['id']})]},{'include':[{'model':db[_0xc4db('0xa3')],'as':_0xc4db('0xbb')}]})[_0xc4db('0x3d')](function(_0x997709){return[_0x997709,!![]];});});}else{throw new Error(_0xc4db('0xbc'));}})['spread'](function(_0x43a3e7,_0xf6de9b){if(_0xf6de9b){return _0x43a3e7;}return db[_0xc4db('0xa3')][_0xc4db('0x60')]({'direction':_0xc4db('0xb9'),'read':![],'body':_0x4f9d00['body'][_0xc4db('0xae')][0x0][_0xc4db('0xba')],'FaxAccountId':_0x23a1c0['id'],'FaxInteractionId':_0x43a3e7['id'],'UserId':_0x4f9d00[_0xc4db('0x63')]['id'],'ContactId':_0x43a3e7[_0xc4db('0xbd')],'AttachmentId':_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0]['id']})[_0xc4db('0x3d')](function(_0x248956){_0x43a3e7[_0xc4db('0xbe')][_0xc4db('0xbb')]=[];_0x43a3e7[_0xc4db('0xbe')][_0xc4db('0xbb')]['push'](_0x248956[_0xc4db('0xbe')]);return _0x43a3e7;});})[_0xc4db('0x3d')](function(_0x5e2e5d){respondWithRpcPromise(_0xc4db('0xbf'),_0xc4db('0xbf'),{'FaxAccountId':_[_0xc4db('0xb3')](_0x4f9d00['params']['id'])?undefined:_0x4f9d00['params']['id'],'path':_[_0xc4db('0xb3')](_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0][_0xc4db('0x7')])?undefined:_0x4f9d00['body'][_0xc4db('0xae')][0x0][_0xc4db('0x7')],'fax':_['isNil'](_0x4f9d00['body']['to'][0x0])?undefined:_0x4f9d00['body']['to'][0x0],'AttachmentId':_0x4f9d00[_0xc4db('0x61')][_0xc4db('0xae')][0x0]['id']},client9002)[_0xc4db('0x3d')](function(_0x214767){logger[_0xc4db('0x24')](_0xc4db('0xc0'),_0x214767);})[_0xc4db('0x2d')](function(_0x52471c){logger[_0xc4db('0x24')]('SendFaxRpc,\x20%s',_0x52471c);});return _0x5e2e5d;})[_0xc4db('0x3d')](respondWithResult(_0x13f9a6,null))[_0xc4db('0x2d')](handleError(_0x13f9a6,null));};exports['addAgents']=function(_0x5f5a9e,_0x4ff59d,_0x4fa9f6){return db['FaxAccount']['find']({'where':{'id':_0x5f5a9e['params']['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x4ff59d,null))[_0xc4db('0x3d')](function(_0x81eb77){if(_0x81eb77){return _0x81eb77[_0xc4db('0xc1')](_0x5f5a9e[_0xc4db('0x61')]['ids'],_[_0xc4db('0x79')](_0x5f5a9e[_0xc4db('0x61')],[_0xc4db('0x71'),'id'])||{})['spread'](function(_0x193f0f){for(var _0x3e384b=0x0;_0x3e384b<_0x5f5a9e['body'][_0xc4db('0x71')][_0xc4db('0x4e')];_0x3e384b+=0x1){socket[_0xc4db('0xc2')](_0xc4db('0xc3'),{'UserId':Number(_0x5f5a9e[_0xc4db('0x61')][_0xc4db('0x71')][_0x3e384b]),'FaxAccountId':Number(_0x5f5a9e[_0xc4db('0x5c')]['id'])});}return _0x193f0f;});}})[_0xc4db('0x3d')](respondWithResult(_0x4ff59d,null))[_0xc4db('0x2d')](handleError(_0x4ff59d,null));};exports[_0xc4db('0xc4')]=function(_0x430f66,_0x598a2f,_0x2b805e){return db[_0xc4db('0x44')][_0xc4db('0x69')]({'where':{'id':_0x430f66[_0xc4db('0x5c')]['id']}})[_0xc4db('0x3d')](handleEntityNotFound(_0x598a2f,null))[_0xc4db('0x3d')](function(_0x251b86){if(_0x251b86){return _0x251b86['removeAgents'](_0x430f66['query']['ids'])[_0xc4db('0x3d')](function(){if(_[_0xc4db('0xc5')](_0x430f66['query'][_0xc4db('0x71')])){for(var _0x181496=0x0;_0x181496<_0x430f66[_0xc4db('0x48')][_0xc4db('0x71')][_0xc4db('0x4e')];_0x181496+=0x1){socket[_0xc4db('0xc2')](_0xc4db('0xc6'),{'UserId':Number(_0x430f66['query'][_0xc4db('0x71')][_0x181496]),'FaxAccountId':Number(_0x430f66[_0xc4db('0x5c')]['id'])});}}else{socket[_0xc4db('0xc2')](_0xc4db('0xc6'),{'UserId':Number(_0x430f66['query'][_0xc4db('0x71')]),'FaxAccountId':Number(_0x430f66[_0xc4db('0x5c')]['id'])});}});}})[_0xc4db('0x3d')](respondWithStatusCode(_0x598a2f,null))['catch'](handleError(_0x598a2f,null));};exports[_0xc4db('0xc7')]=function(_0x52c0e2,_0x29b469,_0x578822){var _0xf72764={};var _0xdee12a={};var _0x300930;var _0x57ff03;return db[_0xc4db('0x44')]['findOne']({'where':{'id':_0x52c0e2[_0xc4db('0x5c')]['id']}})['then'](handleEntityNotFound(_0x29b469,null))[_0xc4db('0x3d')](function(_0x349758){if(_0x349758){_0x300930=_0x349758;_0xdee12a[_0xc4db('0x4b')]=_[_0xc4db('0x5e')](db['User'][_0xc4db('0x45')]);_0xdee12a[_0xc4db('0x48')]=_[_0xc4db('0x5e')](_0x52c0e2['query']);_0xdee12a[_0xc4db('0x49')]=_[_0xc4db('0x4a')](_0xdee12a[_0xc4db('0x4b')],_0xdee12a['query']);_0xf72764[_0xc4db('0x4c')]=_[_0xc4db('0x4a')](_0xdee12a['model'],qs[_0xc4db('0x4d')](_0x52c0e2[_0xc4db('0x48')]['fields']));_0xf72764['attributes']=_0xf72764[_0xc4db('0x4c')][_0xc4db('0x4e')]?_0xf72764[_0xc4db('0x4c')]:_0xdee12a['model'];_0xf72764['order']=qs['sort'](_0x52c0e2[_0xc4db('0x48')]['sort']);_0xf72764[_0xc4db('0x54')]=qs[_0xc4db('0x49')](_[_0xc4db('0x53')](_0x52c0e2[_0xc4db('0x48')],_0xdee12a['filters']));if(_0x52c0e2['query']['filter']){_0xf72764[_0xc4db('0x54')]=_[_0xc4db('0x57')](_0xf72764[_0xc4db('0x54')],{'$or':_[_0xc4db('0x43')](_0xf72764[_0xc4db('0x4c')],function(_0x56dd69){var _0x275d3d={};_0x275d3d[_0x56dd69]={'$like':'%'+_0x52c0e2[_0xc4db('0x48')][_0xc4db('0x56')]+'%'};return _0x275d3d;})});}_0xf72764=_[_0xc4db('0x57')]({},_0xf72764,_0x52c0e2[_0xc4db('0x5f')]);return _0x300930[_0xc4db('0xc7')](_0xf72764);}})[_0xc4db('0x3d')](function(_0x53bb41){if(_0x53bb41){_0x57ff03=_0x53bb41[_0xc4db('0x4e')];if(!_0x52c0e2[_0xc4db('0x48')][_0xc4db('0x4f')](_0xc4db('0x50'))){_0xf72764['limit']=qs['limit'](_0x52c0e2[_0xc4db('0x48')]['limit']);_0xf72764[_0xc4db('0x34')]=qs['offset'](_0x52c0e2[_0xc4db('0x48')][_0xc4db('0x34')]);}return _0x300930[_0xc4db('0xc7')](_0xf72764);}})['then'](function(_0x2c7201){if(_0x2c7201){return _0x2c7201?{'count':_0x57ff03,'rows':_0x2c7201}:null;}})[_0xc4db('0x3d')](respondWithResult(_0x29b469,null))[_0xc4db('0x2d')](handleError(_0x29b469,null));};
\ No newline at end of file
index 798482f..2bc8fa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc610=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit'];(function(_0x16bc8d,_0x3d95f1){var _0x34397d=function(_0x3a96d5){while(--_0x3a96d5){_0x16bc8d['push'](_0x16bc8d['shift']());}};_0x34397d(++_0x3d95f1);}(_0xc610,0x1d9));var _0x0c61=function(_0xe3f0b0,_0x43edc9){_0xe3f0b0=_0xe3f0b0-0x0;var _0x3a839e=_0xc610[_0xe3f0b0];return _0x3a839e;};'use strict';var EventEmitter=require(_0x0c61('0x0'));var FaxAccount=require(_0x0c61('0x1'))['db'][_0x0c61('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0c61('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0c61('0x4'),'afterDestroy':_0x0c61('0x5')};function emitEvent(_0x340ebc){return function(_0x3c48bd,_0x4a13b0,_0x3ae37c){FaxAccountEvents['emit'](_0x340ebc+':'+_0x3c48bd['id'],_0x3c48bd);FaxAccountEvents[_0x0c61('0x6')](_0x340ebc,_0x3c48bd);_0x3ae37c(null);};}for(var e in events){if(events[_0x0c61('0x7')](e)){var event=events[e];FaxAccount[_0x0c61('0x8')](e,emitEvent(event));}}module[_0x0c61('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0x22be=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x43f109,_0x2b5531){var _0x3e68ac=function(_0x3626fd){while(--_0x3626fd){_0x43f109['push'](_0x43f109['shift']());}};_0x3e68ac(++_0x2b5531);}(_0x22be,0x15c));var _0xe22b=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x22be[_0x40b3f2];return _0x4ce90c;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xe22b('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe22b('0x1')](0x0);var events={'afterCreate':_0xe22b('0x2'),'afterUpdate':_0xe22b('0x3'),'afterDestroy':_0xe22b('0x4')};function emitEvent(_0x2a7e74){return function(_0x53eedb,_0x3ad50e,_0xf07650){FaxAccountEvents[_0xe22b('0x5')](_0x2a7e74+':'+_0x53eedb['id'],_0x53eedb);FaxAccountEvents[_0xe22b('0x5')](_0x2a7e74,_0x53eedb);_0xf07650(null);};}for(var e in events){if(events[_0xe22b('0x6')](e)){var event=events[e];FaxAccount[_0xe22b('0x7')](e,emitEvent(event));}}module[_0xe22b('0x8')]=FaxAccountEvents;
\ No newline at end of file
index 5890d7a..8abd7f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x011b=['api','moment','bluebird','request-promise','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger'];(function(_0x51b19b,_0x5015d2){var _0x1a3cd6=function(_0x495134){while(--_0x495134){_0x51b19b['push'](_0x51b19b['shift']());}};_0x1a3cd6(++_0x5015d2);}(_0x011b,0xda));var _0xb011=function(_0x4b1604,_0x4f9b75){_0x4b1604=_0x4b1604-0x0;var _0x4e2367=_0x011b[_0x4b1604];return _0x4e2367;};'use strict';var _=require(_0xb011('0x0'));var util=require(_0xb011('0x1'));var logger=require(_0xb011('0x2'))(_0xb011('0x3'));var moment=require(_0xb011('0x4'));var BPromise=require(_0xb011('0x5'));var rp=require(_0xb011('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb011('0x7'));var attributes=require(_0xb011('0x8'));module[_0xb011('0x9')]=function(_0x3d4e43,_0x1f9634){return _0x3d4e43[_0xb011('0xa')](_0xb011('0xb'),attributes,{'tableName':_0xb011('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb7e=['./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x45a12f,_0x28af8e){var _0xfee28a=function(_0x11df1e){while(--_0x11df1e){_0x45a12f['push'](_0x45a12f['shift']());}};_0xfee28a(++_0x28af8e);}(_0xfb7e,0xc8));var _0xefb7=function(_0x420f39,_0x3f0304){_0x420f39=_0x420f39-0x0;var _0x543fdb=_0xfb7e[_0x420f39];return _0x543fdb;};'use strict';var _=require('lodash');var util=require(_0xefb7('0x0'));var logger=require(_0xefb7('0x1'))(_0xefb7('0x2'));var moment=require(_0xefb7('0x3'));var BPromise=require(_0xefb7('0x4'));var rp=require(_0xefb7('0x5'));var fs=require('fs');var path=require(_0xefb7('0x6'));var rimraf=require('rimraf');var config=require(_0xefb7('0x7'));var attributes=require(_0xefb7('0x8'));module[_0xefb7('0x9')]=function(_0x2de802,_0xf3f690){return _0x2de802[_0xefb7('0xa')](_0xefb7('0xb'),attributes,{'tableName':_0xefb7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16f1929..85b856f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76d4=['interaction','FaxMessage','ContactId','UserId','unshift','name','waitForTheAssignedAgent','Start','startRouting','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','info','result','catch','FaxAccount','options','where','attributes','limit','include','map','model','GetFaxAccount','debug','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','FaxApplication','Applications','get','list','applications','orderBy','Contacts','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','*,*,*,*','created'];(function(_0x10327a,_0x27357c){var _0x5d3c6b=function(_0x22584a){while(--_0x22584a){_0x10327a['push'](_0x10327a['shift']());}};_0x5d3c6b(++_0x27357c);}(_0x76d4,0x15d));var _0x476d=function(_0x21cd1d,_0x3ec220){_0x21cd1d=_0x21cd1d-0x0;var _0x512046=_0x76d4[_0x21cd1d];return _0x512046;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x476d('0x0'));var BPromise=require('bluebird');var rs=require(_0x476d('0x1'));var fs=require('fs');var Redis=require(_0x476d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x476d('0x3'));var config=require(_0x476d('0x4'));var jayson=require(_0x476d('0x5'));var client=jayson[_0x476d('0x6')][_0x476d('0x7')]({'port':0x232c});config[_0x476d('0x8')]=_['defaults'](config['redis'],{'host':_0x476d('0x9'),'port':0x18eb});var socket=require(_0x476d('0xa'))(new Redis(config['redis']));require(_0x476d('0xb'))[_0x476d('0xc')](socket);function respondWithRpcPromise(_0x424a17,_0x524e79,_0x2c9c74){return new BPromise(function(_0x2b6a83,_0x67d118){return client[_0x476d('0xd')](_0x424a17,_0x2c9c74)[_0x476d('0xe')](function(_0x27f9a4){logger['info']('FaxAccount,\x20%s,\x20%s',_0x524e79,_0x476d('0xf'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x524e79,_0x476d('0xf'),JSON[_0x476d('0x10')](_0x27f9a4));if(_0x27f9a4[_0x476d('0x11')]){if(_0x27f9a4[_0x476d('0x11')]['code']===0x1f4){logger[_0x476d('0x11')](_0x476d('0x12'),_0x524e79,_0x27f9a4[_0x476d('0x11')][_0x476d('0x13')]);return _0x67d118(_0x27f9a4[_0x476d('0x11')][_0x476d('0x13')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x524e79,_0x27f9a4[_0x476d('0x11')]['message']);return _0x2b6a83(_0x27f9a4[_0x476d('0x11')][_0x476d('0x13')]);}else{logger[_0x476d('0x14')](_0x476d('0x12'),_0x524e79,_0x476d('0xf'));_0x2b6a83(_0x27f9a4[_0x476d('0x15')]['message']);}})[_0x476d('0x16')](function(_0xa21767){logger[_0x476d('0x11')](_0x476d('0x12'),_0x524e79,_0xa21767);_0x67d118(_0xa21767);});});}exports['GetFaxAccount']=function(_0xf5bec7){var _0x1fd42f=this;return new Promise(function(_0x234c86,_0x452888){return db[_0x476d('0x17')]['findAll']({'raw':_0xf5bec7[_0x476d('0x18')]?_0xf5bec7[_0x476d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xf5bec7['options']?_0xf5bec7[_0x476d('0x18')][_0x476d('0x19')]||null:null,'attributes':_0xf5bec7[_0x476d('0x18')]?_0xf5bec7[_0x476d('0x18')][_0x476d('0x1a')]||null:null,'limit':_0xf5bec7['options']?_0xf5bec7[_0x476d('0x18')][_0x476d('0x1b')]||null:null,'include':_0xf5bec7[_0x476d('0x18')]?_0xf5bec7[_0x476d('0x18')][_0x476d('0x1c')]?_[_0x476d('0x1d')](_0xf5bec7[_0x476d('0x18')]['include'],function(_0x5aa9a5){return{'model':db[_0x5aa9a5['model']],'as':_0x5aa9a5['as'],'attributes':_0x5aa9a5['attributes'],'include':_0x5aa9a5[_0x476d('0x1c')]?_[_0x476d('0x1d')](_0x5aa9a5[_0x476d('0x1c')],function(_0x1683d4){return{'model':db[_0x1683d4[_0x476d('0x1e')]],'as':_0x1683d4['as'],'attributes':_0x1683d4[_0x476d('0x1a')],'include':_0x1683d4[_0x476d('0x1c')]?_['map'](_0x1683d4[_0x476d('0x1c')],function(_0x9e9dc8){return{'model':db[_0x9e9dc8['model']],'as':_0x9e9dc8['as'],'attributes':_0x9e9dc8[_0x476d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29e2bc){logger['info'](_0x476d('0x1f'),_0xf5bec7);logger[_0x476d('0x20')]('GetFaxAccount',_0xf5bec7,JSON['stringify'](_0x29e2bc));_0x234c86(_0x29e2bc);})['catch'](function(_0x296088){logger[_0x476d('0x11')](_0x476d('0x1f'),_0x296088[_0x476d('0x13')],_0xf5bec7);_0x452888(_0x1fd42f[_0x476d('0x11')](0x1f4,_0x296088['message']));});});};exports['NotifyFaxAccount']=function(_0x4596f6,_0x168fa8,_0x3eec7c){var _0x494b4b=this;return new Promise(function(_0x1a28f5,_0x57f0ae){var _0x4e91ad={'body':_0x4596f6[_0x476d('0x21')],'channel':_0x476d('0x22')};var _0x337c06=[];var _0x18fe85=[];var _0xb4ce06={};return db[_0x476d('0x23')][_0x476d('0x24')]()['then'](function(_0x3cd27d){if(!_0x3cd27d){throw new db[(_0x476d('0x25'))][(_0x476d('0x26'))](_0x476d('0x27'));}_0x337c06=_[_0x476d('0x28')](_[_0x476d('0x29')](_0x3cd27d),[_0x476d('0x2a'),_0x476d('0x2b')]);_0x18fe85=_['difference'](_['keys'](_0x3cd27d),[_0x476d('0x2a'),_0x476d('0x2b'),_0x476d('0x2c'),_0x476d('0x2d')]);if(_0x4596f6['body']['id']){delete _0x4596f6['body']['id'];}if(_[_0x476d('0x2e')](_0x4596f6[_0x476d('0x21')][_0x476d('0x2f')])){throw new db[(_0x476d('0x25'))][(_0x476d('0x26'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x4596f6[_0x476d('0x21')][_0x476d('0x21')])||_0x4596f6['body'][_0x476d('0x21')]===''){throw new db[(_0x476d('0x25'))]['ValidationError'](_0x476d('0x30'));}if(_['isNil'](_0x4596f6[_0x476d('0x21')][_0x476d('0x31')])){throw new db['Sequelize'][(_0x476d('0x26'))](_0x476d('0x32')+_0x18fe85);}if(!_[_0x476d('0x33')](_0x18fe85,_0x4596f6[_0x476d('0x21')][_0x476d('0x31')])){throw new db[(_0x476d('0x25'))][(_0x476d('0x26'))](_0x476d('0x34')+_0x18fe85);}_0xb4ce06[_0x4596f6[_0x476d('0x21')][_0x476d('0x31')]]=_0x4596f6[_0x476d('0x21')]['from'];})[_0x476d('0xe')](function(){return db[_0x476d('0x17')][_0x476d('0x35')]({'where':{'id':_0x4596f6[_0x476d('0x36')]['id']},'include':[{'model':db[_0x476d('0x37')],'as':_0x476d('0x38'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0xb4ce06,'limit':0x1,'order':[[_0x476d('0x2b'),_0x476d('0x39')]]}]},{'model':db[_0x476d('0x3a')],'as':_0x476d('0x3b')}]});})['then'](function(_0x5aa2f9){if(_0x5aa2f9&&_0x5aa2f9[_0x476d('0x38')]){var _0x27183d=_0x5aa2f9[_0x476d('0x3c')]({'plain':!![]});_0x4e91ad[_0x476d('0x36')]=_0x27183d;_0x4e91ad['applications']=_0x27183d[_0x476d('0x3b')];_0x4e91ad[_0x476d('0x3d')]=_0x27183d[_0x476d('0x38')];_0x4e91ad[_0x476d('0x3e')]=_[_0x476d('0x3f')](_0x4e91ad[_0x476d('0x3e')],['priority'],['asc']);if(_0x4e91ad['account'][_0x476d('0x3b')]){delete _0x4e91ad[_0x476d('0x36')][_0x476d('0x3b')];}if(_0x4e91ad[_0x476d('0x36')][_0x476d('0x38')]&&_0x4e91ad[_0x476d('0x36')][_0x476d('0x38')][_0x476d('0x40')][_0x476d('0x41')]){return _0x4e91ad['account'][_0x476d('0x38')][_0x476d('0x40')][0x0];}var _0x184ea2=_[_0x476d('0x42')](_0x4596f6[_0x476d('0x21')],{'firstName':_0x4596f6[_0x476d('0x21')][_0x476d('0x2f')],'ListId':_0x27183d[_0x476d('0x2d')]});_0x184ea2[_0x4596f6[_0x476d('0x21')]['mapKey']]=_0x4596f6[_0x476d('0x21')][_0x476d('0x2f')];return db['CmContact'][_0x476d('0x43')](_0x184ea2,{'fields':_0x337c06,'raw':!![]});}})['then'](function(_0x291883){_0x4e91ad[_0x476d('0x44')]=_0x291883;if(_0x291883){var _0x456281={'ContactId':_0x291883['id'],'FaxAccountId':_0x4596f6[_0x476d('0x36')]['id'],'fax':_0x291883[_0x476d('0x22')]};return db[_0x476d('0x45')][_0x476d('0x35')]({'where':{'ContactId':_0x291883['id'],'closed':![],'FaxAccountId':_0x4596f6[_0x476d('0x36')]['id']}})['then'](function(_0x317cd7){if(_0x317cd7){return[_0x317cd7,![]];}return db[_0x476d('0x45')]['create'](_0x456281)[_0x476d('0xe')](function(_0x4f5f5c){return[_0x4f5f5c,!![]];});});}else{throw new Error(_0x476d('0x46'));}})['spread'](function(_0x3f8383,_0x48470d){var _0x175b23=_0x3f8383[_0x476d('0x3c')]({'plain':!![]});if(_0x48470d){if(_0x4e91ad[_0x476d('0x36')][_0x476d('0x47')]){_0x4e91ad[_0x476d('0x3e')][_0x476d('0x48')]({'id':0x0,'priority':_0x4e91ad['applications']['length']+0x1,'app':_0x476d('0x49'),'appdata':'unmanaged','interval':_0x476d('0x4a')});}_0x175b23[_0x476d('0x4b')]=!![];}else{_0x175b23[_0x476d('0x4b')]=![];}_0x4e91ad[_0x476d('0x4c')]=_0x175b23;return db[_0x476d('0x4d')]['create']({'body':_0x4596f6[_0x476d('0x21')]['body'],'FaxAccountId':_0x4596f6[_0x476d('0x36')]['id'],'FaxInteractionId':_0x3f8383['id'],'direction':'in','ContactId':_0x3f8383[_0x476d('0x4e')],'AttachmentId':_0x4596f6[_0x476d('0x21')]['AttachmentId']});})[_0x476d('0xe')](function(_0x2a552a){_0x4e91ad[_0x476d('0x13')]=_0x2a552a;if(_0x4e91ad[_0x476d('0x4c')]['UserId']){return db['User'][_0x476d('0x35')]({'attributes':['id','name'],'where':{'id':_0x4e91ad[_0x476d('0x4c')][_0x476d('0x4f')]}})[_0x476d('0xe')](function(_0x5b3941){if(_0x5b3941){_0x4e91ad[_0x476d('0x3e')][_0x476d('0x50')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b3941[_0x476d('0x51')]+','+(_0x4e91ad['account'][_0x476d('0x52')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x476d('0x53'),_0x476d('0x54'),_0x4e91ad);});}return respondWithRpcPromise(_0x476d('0x53'),_0x476d('0x54'),_0x4e91ad);})[_0x476d('0xe')](function(_0x5eab0f){_0x1a28f5(_0x5eab0f);})[_0x476d('0x16')](function(_0x556bec){_0x57f0ae(_0x494b4b['error'](0x1f4,_0x556bec['message']));});});};
\ No newline at end of file
+var _0x757f=['*,*,*,*','Start','startRouting','lodash','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','NotifyFaxAccount','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','CmContact','Contacts','DESC','FaxApplication','account','Applications','list','applications','orderBy','priority','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','unmanaged','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','unshift','agent','name','waitForTheAssignedAgent'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0x757f,0xaf));var _0xf757=function(_0x263204,_0x19286b){_0x263204=_0x263204-0x0;var _0xed3987=_0x757f[_0x263204];return _0xed3987;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('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(_0xf757('0x3'))('rpc');var config=require(_0xf757('0x4'));var jayson=require(_0xf757('0x5'));var client=jayson['client'][_0xf757('0x6')]({'port':0x232c});config['redis']=_[_0xf757('0x7')](config[_0xf757('0x8')],{'host':_0xf757('0x9'),'port':0x18eb});var socket=require(_0xf757('0xa'))(new Redis(config['redis']));require(_0xf757('0xb'))['register'](socket);function respondWithRpcPromise(_0x34cbc7,_0x40e71f,_0x2823e1){return new BPromise(function(_0x4d1ef7,_0x4907f6){return client['request'](_0x34cbc7,_0x2823e1)[_0xf757('0xc')](function(_0x287852){logger[_0xf757('0xd')](_0xf757('0xe'),_0x40e71f,_0xf757('0xf'));logger['debug'](_0xf757('0x10'),_0x40e71f,_0xf757('0xf'),JSON[_0xf757('0x11')](_0x287852));if(_0x287852[_0xf757('0x12')]){if(_0x287852[_0xf757('0x12')]['code']===0x1f4){logger[_0xf757('0x12')](_0xf757('0xe'),_0x40e71f,_0x287852['error'][_0xf757('0x13')]);return _0x4907f6(_0x287852[_0xf757('0x12')][_0xf757('0x13')]);}logger['error'](_0xf757('0xe'),_0x40e71f,_0x287852[_0xf757('0x12')][_0xf757('0x13')]);return _0x4d1ef7(_0x287852['error'][_0xf757('0x13')]);}else{logger['info'](_0xf757('0xe'),_0x40e71f,_0xf757('0xf'));_0x4d1ef7(_0x287852[_0xf757('0x14')][_0xf757('0x13')]);}})[_0xf757('0x15')](function(_0x1cd7d7){logger[_0xf757('0x12')](_0xf757('0xe'),_0x40e71f,_0x1cd7d7);_0x4907f6(_0x1cd7d7);});});}exports[_0xf757('0x16')]=function(_0xa3a299){var _0x4abd98=this;return new Promise(function(_0x51eb7f,_0xf36bef){return db[_0xf757('0x17')][_0xf757('0x18')]({'raw':_0xa3a299[_0xf757('0x19')]?_0xa3a299[_0xf757('0x19')][_0xf757('0x1a')]===undefined?!![]:![]:!![],'where':_0xa3a299[_0xf757('0x19')]?_0xa3a299[_0xf757('0x19')][_0xf757('0x1b')]||null:null,'attributes':_0xa3a299[_0xf757('0x19')]?_0xa3a299['options'][_0xf757('0x1c')]||null:null,'limit':_0xa3a299[_0xf757('0x19')]?_0xa3a299[_0xf757('0x19')][_0xf757('0x1d')]||null:null,'include':_0xa3a299[_0xf757('0x19')]?_0xa3a299[_0xf757('0x19')][_0xf757('0x1e')]?_[_0xf757('0x1f')](_0xa3a299[_0xf757('0x19')][_0xf757('0x1e')],function(_0x3e1ee1){return{'model':db[_0x3e1ee1[_0xf757('0x20')]],'as':_0x3e1ee1['as'],'attributes':_0x3e1ee1[_0xf757('0x1c')],'include':_0x3e1ee1[_0xf757('0x1e')]?_[_0xf757('0x1f')](_0x3e1ee1[_0xf757('0x1e')],function(_0x5048b3){return{'model':db[_0x5048b3['model']],'as':_0x5048b3['as'],'attributes':_0x5048b3[_0xf757('0x1c')],'include':_0x5048b3[_0xf757('0x1e')]?_[_0xf757('0x1f')](_0x5048b3[_0xf757('0x1e')],function(_0x2268da){return{'model':db[_0x2268da[_0xf757('0x20')]],'as':_0x2268da['as'],'attributes':_0x2268da[_0xf757('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf757('0xc')](function(_0x55df34){logger[_0xf757('0xd')]('GetFaxAccount',_0xa3a299);logger[_0xf757('0x21')]('GetFaxAccount',_0xa3a299,JSON[_0xf757('0x11')](_0x55df34));_0x51eb7f(_0x55df34);})['catch'](function(_0x36510c){logger[_0xf757('0x12')](_0xf757('0x16'),_0x36510c[_0xf757('0x13')],_0xa3a299);_0xf36bef(_0x4abd98[_0xf757('0x12')](0x1f4,_0x36510c[_0xf757('0x13')]));});});};exports[_0xf757('0x22')]=function(_0x54c028,_0x17d838,_0x18149f){var _0x206446=this;return new Promise(function(_0x4c5c90,_0x1609bb){var _0x34c865={'body':_0x54c028['body'],'channel':'fax'};var _0x4fa4e7=[];var _0x281abd=[];var _0x41a63c={};return db['CmContact'][_0xf757('0x23')]()['then'](function(_0x74d67c){if(!_0x74d67c){throw new db[(_0xf757('0x24'))][(_0xf757('0x25'))](_0xf757('0x26'));}_0x4fa4e7=_[_0xf757('0x27')](_[_0xf757('0x28')](_0x74d67c),[_0xf757('0x29'),_0xf757('0x2a')]);_0x281abd=_['difference'](_[_0xf757('0x28')](_0x74d67c),[_0xf757('0x29'),_0xf757('0x2a'),'CompanyId',_0xf757('0x2b')]);if(_0x54c028['body']['id']){delete _0x54c028[_0xf757('0x2c')]['id'];}if(_[_0xf757('0x2d')](_0x54c028[_0xf757('0x2c')][_0xf757('0x2e')])){throw new db[(_0xf757('0x24'))][(_0xf757('0x25'))]('from\x20is\x20mandatory');}if(_[_0xf757('0x2d')](_0x54c028[_0xf757('0x2c')]['body'])||_0x54c028[_0xf757('0x2c')]['body']===''){throw new db[(_0xf757('0x24'))][(_0xf757('0x25'))](_0xf757('0x2f'));}if(_[_0xf757('0x2d')](_0x54c028['body'][_0xf757('0x30')])){throw new db[(_0xf757('0x24'))][(_0xf757('0x25'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x281abd);}if(!_[_0xf757('0x31')](_0x281abd,_0x54c028[_0xf757('0x2c')][_0xf757('0x30')])){throw new db[(_0xf757('0x24'))][(_0xf757('0x25'))](_0xf757('0x32')+_0x281abd);}_0x41a63c[_0x54c028['body']['mapKey']]=_0x54c028[_0xf757('0x2c')][_0xf757('0x2e')];})[_0xf757('0xc')](function(){return db[_0xf757('0x17')][_0xf757('0x33')]({'where':{'id':_0x54c028['account']['id']},'include':[{'model':db['CmList'],'as':_0xf757('0x34'),'include':[{'model':db[_0xf757('0x35')],'as':_0xf757('0x36'),'where':_0x41a63c,'limit':0x1,'order':[[_0xf757('0x2a'),_0xf757('0x37')]]}]},{'model':db[_0xf757('0x38')],'as':'Applications'}]});})[_0xf757('0xc')](function(_0x3298dc){if(_0x3298dc&&_0x3298dc['List']){var _0xaf8043=_0x3298dc['get']({'plain':!![]});_0x34c865[_0xf757('0x39')]=_0xaf8043;_0x34c865['applications']=_0xaf8043[_0xf757('0x3a')];_0x34c865[_0xf757('0x3b')]=_0xaf8043[_0xf757('0x34')];_0x34c865[_0xf757('0x3c')]=_[_0xf757('0x3d')](_0x34c865[_0xf757('0x3c')],[_0xf757('0x3e')],['asc']);if(_0x34c865[_0xf757('0x39')][_0xf757('0x3a')]){delete _0x34c865[_0xf757('0x39')]['Applications'];}if(_0x34c865[_0xf757('0x39')][_0xf757('0x34')]&&_0x34c865[_0xf757('0x39')]['List'][_0xf757('0x36')][_0xf757('0x3f')]){return _0x34c865[_0xf757('0x39')][_0xf757('0x34')][_0xf757('0x36')][0x0];}var _0x20d93a=_[_0xf757('0x7')](_0x54c028[_0xf757('0x2c')],{'firstName':_0x54c028[_0xf757('0x2c')][_0xf757('0x2e')],'ListId':_0xaf8043[_0xf757('0x2b')]});_0x20d93a[_0x54c028['body'][_0xf757('0x30')]]=_0x54c028['body'][_0xf757('0x2e')];return db[_0xf757('0x35')][_0xf757('0x40')](_0x20d93a,{'fields':_0x4fa4e7,'raw':!![]});}})[_0xf757('0xc')](function(_0x303429){_0x34c865[_0xf757('0x41')]=_0x303429;if(_0x303429){var _0x29b241={'ContactId':_0x303429['id'],'FaxAccountId':_0x54c028[_0xf757('0x39')]['id'],'fax':_0x303429['fax']};return db[_0xf757('0x42')][_0xf757('0x33')]({'where':{'ContactId':_0x303429['id'],'closed':![],'FaxAccountId':_0x54c028[_0xf757('0x39')]['id']}})[_0xf757('0xc')](function(_0x348ab0){if(_0x348ab0){return[_0x348ab0,![]];}return db[_0xf757('0x42')][_0xf757('0x40')](_0x29b241)[_0xf757('0xc')](function(_0x543b6c){return[_0x543b6c,!![]];});});}else{throw new Error(_0xf757('0x43'));}})[_0xf757('0x44')](function(_0x403d05,_0x3bea02){var _0x4d3483=_0x403d05[_0xf757('0x45')]({'plain':!![]});if(_0x3bea02){if(_0x34c865['account'][_0xf757('0x46')]){_0x34c865['applications'][_0xf757('0x47')]({'id':0x0,'priority':_0x34c865[_0xf757('0x3c')][_0xf757('0x3f')]+0x1,'app':'close','appdata':_0xf757('0x48'),'interval':'*,*,*,*'});}_0x4d3483[_0xf757('0x49')]=!![];}else{_0x4d3483[_0xf757('0x49')]=![];}_0x34c865['interaction']=_0x4d3483;return db[_0xf757('0x4a')][_0xf757('0x40')]({'body':_0x54c028['body'][_0xf757('0x2c')],'FaxAccountId':_0x54c028[_0xf757('0x39')]['id'],'FaxInteractionId':_0x403d05['id'],'direction':'in','ContactId':_0x403d05[_0xf757('0x4b')],'AttachmentId':_0x54c028[_0xf757('0x2c')][_0xf757('0x4c')]});})[_0xf757('0xc')](function(_0x279fe7){_0x34c865['message']=_0x279fe7;if(_0x34c865[_0xf757('0x4d')][_0xf757('0x4e')]){return db['User'][_0xf757('0x33')]({'attributes':['id','name'],'where':{'id':_0x34c865[_0xf757('0x4d')]['UserId']}})[_0xf757('0xc')](function(_0x202b07){if(_0x202b07){_0x34c865[_0xf757('0x3c')][_0xf757('0x4f')]({'id':0x0,'priority':0x0,'app':_0xf757('0x50'),'appdata':_0x202b07[_0xf757('0x51')]+','+(_0x34c865[_0xf757('0x39')][_0xf757('0x52')]||0xa),'interval':_0xf757('0x53')});}return respondWithRpcPromise(_0xf757('0x54'),_0xf757('0x55'),_0x34c865);});}return respondWithRpcPromise('Start',_0xf757('0x55'),_0x34c865);})['then'](function(_0x45a36e){_0x4c5c90(_0x45a36e);})[_0xf757('0x15')](function(_0x12e77f){_0x1609bb(_0x206446[_0xf757('0x12')](0x1f4,_0x12e77f['message']));});});};
\ No newline at end of file
index a82adf9..2ef9f39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67d3=['save','remove','faxAccount:','./faxAccount.events'];(function(_0x312cbf,_0x2a7414){var _0x12dbb9=function(_0x3f3298){while(--_0x3f3298){_0x312cbf['push'](_0x312cbf['shift']());}};_0x12dbb9(++_0x2a7414);}(_0x67d3,0x1b3));var _0x367d=function(_0x4c7e61,_0x5bdb5c){_0x4c7e61=_0x4c7e61-0x0;var _0x432e54=_0x67d3[_0x4c7e61];return _0x432e54;};'use strict';var FaxAccountEvents=require(_0x367d('0x0'));var events=[_0x367d('0x1'),_0x367d('0x2'),'update'];function createListener(_0x1727a2,_0x48459e){return function(_0x1d8b52){_0x48459e['emit'](_0x1727a2,_0x1d8b52);};}function removeListener(_0x14419f,_0xc3bea2){return function(){FaxAccountEvents['removeListener'](_0x14419f,_0xc3bea2);};}exports['register']=function(_0x5ba28c){for(var _0x3bfa06=0x0,_0x332cec=events['length'];_0x3bfa06<_0x332cec;_0x3bfa06++){var _0x1e244d=events[_0x3bfa06];var _0x59082b=createListener(_0x367d('0x3')+_0x1e244d,_0x5ba28c);FaxAccountEvents['on'](_0x1e244d,_0x59082b);}};
\ No newline at end of file
+var _0x054a=['update','removeListener','register','length','faxAccount:','save','remove'];(function(_0x17a73d,_0xf85b44){var _0x476ff2=function(_0x311773){while(--_0x311773){_0x17a73d['push'](_0x17a73d['shift']());}};_0x476ff2(++_0xf85b44);}(_0x054a,0x7c));var _0xa054=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x054a[_0x14add3];return _0x4a174f;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xa054('0x0'),_0xa054('0x1'),_0xa054('0x2')];function createListener(_0x357b4c,_0x7e9a1e){return function(_0x2d90ea){_0x7e9a1e['emit'](_0x357b4c,_0x2d90ea);};}function removeListener(_0x699fa4,_0x1484d2){return function(){FaxAccountEvents[_0xa054('0x3')](_0x699fa4,_0x1484d2);};}exports[_0xa054('0x4')]=function(_0x42ae94){for(var _0xb4d677=0x0,_0x13b211=events[_0xa054('0x5')];_0xb4d677<_0x13b211;_0xb4d677++){var _0x33ba2d=events[_0xb4d677];var _0x48de56=createListener(_0xa054('0x6')+_0x33ba2d,_0x42ae94);FaxAccountEvents['on'](_0x33ba2d,_0x48de56);}};
\ No newline at end of file
index 2b02077..e2091d0 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(_0x148ad8,_0x1b3a24){var _0x137b12=function(_0x388c0f){while(--_0x388c0f){_0x148ad8['push'](_0x148ad8['shift']());}};_0x137b12(++_0x1b3a24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x30cf9e,_0xf2c7fc){var _0x23539e=function(_0x45e7a2){while(--_0x45e7a2){_0x30cf9e['push'](_0x30cf9e['shift']());}};_0x23539e(++_0xf2c7fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'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 eb67bf2..c2aae4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06e1=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x45f2e1,_0x48b816){var _0x461542=function(_0x3ec96e){while(--_0x3ec96e){_0x45f2e1['push'](_0x45f2e1['shift']());}};_0x461542(++_0x48b816);}(_0x06e1,0x151));var _0x106e=function(_0x4ae76c,_0x334943){_0x4ae76c=_0x4ae76c-0x0;var _0x5ebfea=_0x06e1[_0x4ae76c];return _0x5ebfea;};'use strict';var Sequelize=require(_0x106e('0x0'));module[_0x106e('0x1')]={'priority':{'type':Sequelize[_0x106e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x106e('0x3')],'allowNull':![],'defaultValue':_0x106e('0x4')},'appdata':{'type':Sequelize[_0x106e('0x5')]()},'description':{'type':Sequelize[_0x106e('0x3')]},'interval':{'type':Sequelize[_0x106e('0x3')],'defaultValue':_0x106e('0x6')}};
\ No newline at end of file
+var _0x2f62=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x2f62,0x182));var _0x22f6=function(_0x40c650,_0x5d4ed1){_0x40c650=_0x40c650-0x0;var _0x19d601=_0x2f62[_0x40c650];return _0x19d601;};'use strict';var Sequelize=require(_0x22f6('0x0'));module[_0x22f6('0x1')]={'priority':{'type':Sequelize[_0x22f6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x22f6('0x3')],'allowNull':![],'defaultValue':_0x22f6('0x4')},'appdata':{'type':Sequelize[_0x22f6('0x5')]()},'description':{'type':Sequelize[_0x22f6('0x3')]},'interval':{'type':Sequelize[_0x22f6('0x3')],'defaultValue':_0x22f6('0x6')}};
\ No newline at end of file
index f0c18de..e63192c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d4d=['json','offset','undefined','limit','count','reject','update','then','destroy','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x5261b3,_0x2ffbcc){var _0x491a5b=function(_0x3c0b45){while(--_0x3c0b45){_0x5261b3['push'](_0x5261b3['shift']());}};_0x491a5b(++_0x2ffbcc);}(_0x0d4d,0x74));var _0xd0d4=function(_0xff1de9,_0x15171d){_0xff1de9=_0xff1de9-0x0;var _0x25f9dd=_0x0d4d[_0xff1de9];return _0x25f9dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd0d4('0x0'));var zipdir=require(_0xd0d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0d4('0x2'));var moment=require(_0xd0d4('0x3'));var BPromise=require(_0xd0d4('0x4'));var Mustache=require(_0xd0d4('0x5'));var util=require(_0xd0d4('0x6'));var path=require('path');var sox=require(_0xd0d4('0x7'));var csv=require(_0xd0d4('0x8'));var ejs=require(_0xd0d4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd0d4('0xa'));var squel=require(_0xd0d4('0xb'));var crypto=require(_0xd0d4('0xc'));var jsforce=require(_0xd0d4('0xd'));var deskjs=require(_0xd0d4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd0d4('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd0d4('0x10'));var qs=require(_0xd0d4('0x11'));var as=require(_0xd0d4('0x12'));var hardwareService=require(_0xd0d4('0x13'));var logger=require(_0xd0d4('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd0d4('0x15'));var licenseUtil=require(_0xd0d4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8a2273,_0x35654c){_0x35654c=_0x35654c||0xcc;return function(_0x2e5124){if(_0x2e5124){return _0x8a2273[_0xd0d4('0x17')](_0x35654c);}return _0x8a2273[_0xd0d4('0x18')](_0x35654c)[_0xd0d4('0x19')]();};}function respondWithResult(_0x2c9979,_0x1a08ef){_0x1a08ef=_0x1a08ef||0xc8;return function(_0x579c17){if(_0x579c17){return _0x2c9979[_0xd0d4('0x18')](_0x1a08ef)[_0xd0d4('0x1a')](_0x579c17);}};}function respondWithFilteredResult(_0x1cc813,_0x2c8184){return function(_0x139b98){if(_0x139b98){var _0x38e916=typeof _0x2c8184[_0xd0d4('0x1b')]===_0xd0d4('0x1c')&&typeof _0x2c8184[_0xd0d4('0x1d')]===_0xd0d4('0x1c');var _0x567276=_0x139b98[_0xd0d4('0x1e')];var _0x3ed595=_0x38e916?0x0:_0x2c8184[_0xd0d4('0x1b')];var _0x127601=_0x38e916?_0x139b98['count']:_0x2c8184[_0xd0d4('0x1b')]+_0x2c8184[_0xd0d4('0x1d')];var _0x4f52ee;if(_0x127601>=_0x567276){_0x127601=_0x567276;_0x4f52ee=0xc8;}else{_0x4f52ee=0xce;}_0x1cc813[_0xd0d4('0x18')](_0x4f52ee);return _0x1cc813['set']('Content-Range',_0x3ed595+'-'+_0x127601+'/'+_0x567276)[_0xd0d4('0x1a')](_0x139b98);}return null;};}function patchUpdates(_0x1716e0){return function(_0x33fc88){try{jsonpatch['apply'](_0x33fc88,_0x1716e0,!![]);}catch(_0x51544a){return BPromise[_0xd0d4('0x1f')](_0x51544a);}return _0x33fc88['save']();};}function saveUpdates(_0x155d44,_0x15ba60){return function(_0x3fdc8c){if(_0x3fdc8c){return _0x3fdc8c[_0xd0d4('0x20')](_0x155d44)[_0xd0d4('0x21')](function(_0x56fceb){return _0x56fceb;});}return null;};}function removeEntity(_0x604040,_0x4d01f2){return function(_0x2fc01d){if(_0x2fc01d){return _0x2fc01d[_0xd0d4('0x22')]()['then'](function(){_0x604040[_0xd0d4('0x18')](0xcc)[_0xd0d4('0x19')]();});}};}function handleEntityNotFound(_0x3f3abb,_0x16a897){return function(_0xc76b71){if(!_0xc76b71){_0x3f3abb['sendStatus'](0x194);}return _0xc76b71;};}function handleError(_0xe8c18b,_0xb1a1a9){_0xb1a1a9=_0xb1a1a9||0x1f4;return function(_0x539589){logger[_0xd0d4('0x23')](_0x539589[_0xd0d4('0x24')]);if(_0x539589[_0xd0d4('0x25')]){delete _0x539589[_0xd0d4('0x25')];}_0xe8c18b['status'](_0xb1a1a9)[_0xd0d4('0x26')](_0x539589);};}exports[_0xd0d4('0x27')]=function(_0x27103a,_0x57d5ac){var _0x52f70d={},_0x5d3e41={},_0x1cad0f={'count':0x0,'rows':[]};var _0x3afb78=_[_0xd0d4('0x28')](db[_0xd0d4('0x29')]['rawAttributes'],function(_0x4f3fd5){return{'name':_0x4f3fd5[_0xd0d4('0x2a')],'type':_0x4f3fd5[_0xd0d4('0x2b')][_0xd0d4('0x2c')]};});_0x5d3e41[_0xd0d4('0x2d')]=_[_0xd0d4('0x28')](_0x3afb78,'name');_0x5d3e41[_0xd0d4('0x2e')]=_[_0xd0d4('0x2f')](_0x27103a[_0xd0d4('0x2e')]);_0x5d3e41[_0xd0d4('0x30')]=_['intersection'](_0x5d3e41[_0xd0d4('0x2d')],_0x5d3e41[_0xd0d4('0x2e')]);_0x52f70d[_0xd0d4('0x31')]=_[_0xd0d4('0x32')](_0x5d3e41[_0xd0d4('0x2d')],qs[_0xd0d4('0x33')](_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x33')]));_0x52f70d[_0xd0d4('0x31')]=_0x52f70d['attributes'][_0xd0d4('0x34')]?_0x52f70d[_0xd0d4('0x31')]:_0x5d3e41['model'];if(!_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x35')](_0xd0d4('0x36'))){_0x52f70d[_0xd0d4('0x1d')]=qs[_0xd0d4('0x1d')](_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x1d')]);_0x52f70d['offset']=qs['offset'](_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x1b')]);}_0x52f70d[_0xd0d4('0x37')]=qs[_0xd0d4('0x38')](_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x38')]);_0x52f70d[_0xd0d4('0x39')]=qs[_0xd0d4('0x30')](_['pick'](_0x27103a['query'],_0x5d3e41[_0xd0d4('0x30')]),_0x3afb78);if(_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x3a')]){_0x52f70d[_0xd0d4('0x39')]=_[_0xd0d4('0x3b')](_0x52f70d['where'],{'$or':_[_0xd0d4('0x28')](_0x3afb78,function(_0x265ab9){if(_0x265ab9['type']!=='VIRTUAL'){var _0x2fa926={};_0x2fa926[_0x265ab9['name']]={'$like':'%'+_0x27103a[_0xd0d4('0x2e')][_0xd0d4('0x3a')]+'%'};return _0x2fa926;}})});}_0x52f70d=_[_0xd0d4('0x3b')]({},_0x52f70d,_0x27103a[_0xd0d4('0x3c')]);var _0x308093={'where':_0x52f70d['where']};return db['FaxApplication'][_0xd0d4('0x1e')](_0x308093)[_0xd0d4('0x21')](function(_0x35ca67){_0x1cad0f[_0xd0d4('0x1e')]=_0x35ca67;if(_0x27103a[_0xd0d4('0x2e')]['includeAll']){_0x52f70d[_0xd0d4('0x3d')]=[{'all':!![]}];}return db[_0xd0d4('0x29')][_0xd0d4('0x3e')](_0x52f70d);})['then'](function(_0xfca8ac){_0x1cad0f[_0xd0d4('0x3f')]=_0xfca8ac;return _0x1cad0f;})[_0xd0d4('0x21')](respondWithFilteredResult(_0x57d5ac,_0x52f70d))[_0xd0d4('0x40')](handleError(_0x57d5ac,null));};exports['show']=function(_0x48b63d,_0x4169de){var _0x176c67={'raw':!![],'where':{'id':_0x48b63d[_0xd0d4('0x41')]['id']}},_0x3036a3={};_0x3036a3[_0xd0d4('0x2d')]=_['keys'](db[_0xd0d4('0x29')][_0xd0d4('0x42')]);_0x3036a3[_0xd0d4('0x2e')]=_['keys'](_0x48b63d[_0xd0d4('0x2e')]);_0x3036a3[_0xd0d4('0x30')]=_[_0xd0d4('0x32')](_0x3036a3[_0xd0d4('0x2d')],_0x3036a3['query']);_0x176c67['attributes']=_['intersection'](_0x3036a3[_0xd0d4('0x2d')],qs[_0xd0d4('0x33')](_0x48b63d[_0xd0d4('0x2e')][_0xd0d4('0x33')]));_0x176c67[_0xd0d4('0x31')]=_0x176c67['attributes'][_0xd0d4('0x34')]?_0x176c67['attributes']:_0x3036a3[_0xd0d4('0x2d')];if(_0x48b63d[_0xd0d4('0x2e')][_0xd0d4('0x43')]){_0x176c67[_0xd0d4('0x3d')]=[{'all':!![]}];}_0x176c67=_[_0xd0d4('0x3b')]({},_0x176c67,_0x48b63d[_0xd0d4('0x3c')]);return db[_0xd0d4('0x29')][_0xd0d4('0x44')](_0x176c67)['then'](handleEntityNotFound(_0x4169de,null))['then'](respondWithResult(_0x4169de,null))[_0xd0d4('0x40')](handleError(_0x4169de,null));};exports[_0xd0d4('0x45')]=function(_0x57c6e3,_0x55ba63){return db[_0xd0d4('0x29')]['create'](_0x57c6e3[_0xd0d4('0x46')],{})['then'](respondWithResult(_0x55ba63,0xc9))[_0xd0d4('0x40')](handleError(_0x55ba63,null));};exports[_0xd0d4('0x20')]=function(_0x32b10b,_0x434f08){if(_0x32b10b['body']['id']){delete _0x32b10b[_0xd0d4('0x46')]['id'];}return db[_0xd0d4('0x29')][_0xd0d4('0x44')]({'where':{'id':_0x32b10b[_0xd0d4('0x41')]['id']}})[_0xd0d4('0x21')](handleEntityNotFound(_0x434f08,null))[_0xd0d4('0x21')](saveUpdates(_0x32b10b[_0xd0d4('0x46')],null))[_0xd0d4('0x21')](respondWithResult(_0x434f08,null))[_0xd0d4('0x40')](handleError(_0x434f08,null));};exports[_0xd0d4('0x22')]=function(_0x1383b2,_0x25df0a){return db[_0xd0d4('0x29')][_0xd0d4('0x44')]({'where':{'id':_0x1383b2[_0xd0d4('0x41')]['id']}})[_0xd0d4('0x21')](handleEntityNotFound(_0x25df0a,null))[_0xd0d4('0x21')](removeEntity(_0x25df0a,null))[_0xd0d4('0x40')](handleError(_0x25df0a,null));};
\ No newline at end of file
+var _0xd5f2=['intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','length','find','catch','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','key','keys','query','filters'];(function(_0xe23811,_0x43e709){var _0x23c5f1=function(_0x15a0c6){while(--_0x15a0c6){_0xe23811['push'](_0xe23811['shift']());}};_0x23c5f1(++_0x43e709);}(_0xd5f2,0x101));var _0x2d5f=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xd5f2[_0x2e4e19];return _0x9ba20b;};'use strict';var emlformat=require(_0x2d5f('0x0'));var rimraf=require(_0x2d5f('0x1'));var zipdir=require(_0x2d5f('0x2'));var jsonpatch=require(_0x2d5f('0x3'));var rp=require(_0x2d5f('0x4'));var moment=require('moment');var BPromise=require(_0x2d5f('0x5'));var Mustache=require(_0x2d5f('0x6'));var util=require(_0x2d5f('0x7'));var path=require(_0x2d5f('0x8'));var sox=require(_0x2d5f('0x9'));var csv=require(_0x2d5f('0xa'));var ejs=require(_0x2d5f('0xb'));var fs=require('fs');var fs_extra=require(_0x2d5f('0xc'));var _=require('lodash');var squel=require(_0x2d5f('0xd'));var crypto=require(_0x2d5f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2d5f('0xf'));var toCsv=require(_0x2d5f('0xa'));var querystring=require(_0x2d5f('0x10'));var Papa=require(_0x2d5f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d5f('0x12'));var as=require(_0x2d5f('0x13'));var hardwareService=require(_0x2d5f('0x14'));var logger=require(_0x2d5f('0x15'))(_0x2d5f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2d5f('0x17'));var db=require(_0x2d5f('0x18'))['db'];function respondWithStatusCode(_0x2db99c,_0x1828a6){_0x1828a6=_0x1828a6||0xcc;return function(_0x3a67bc){if(_0x3a67bc){return _0x2db99c[_0x2d5f('0x19')](_0x1828a6);}return _0x2db99c[_0x2d5f('0x1a')](_0x1828a6)[_0x2d5f('0x1b')]();};}function respondWithResult(_0x1c2ee2,_0x513145){_0x513145=_0x513145||0xc8;return function(_0x4dc298){if(_0x4dc298){return _0x1c2ee2[_0x2d5f('0x1a')](_0x513145)[_0x2d5f('0x1c')](_0x4dc298);}};}function respondWithFilteredResult(_0x481095,_0x3b34ef){return function(_0x2a5711){if(_0x2a5711){var _0x595b9e=typeof _0x3b34ef[_0x2d5f('0x1d')]==='undefined'&&typeof _0x3b34ef['limit']===_0x2d5f('0x1e');var _0x2d21d1=_0x2a5711[_0x2d5f('0x1f')];var _0x4bbe79=_0x595b9e?0x0:_0x3b34ef[_0x2d5f('0x1d')];var _0x44b64b=_0x595b9e?_0x2a5711[_0x2d5f('0x1f')]:_0x3b34ef[_0x2d5f('0x1d')]+_0x3b34ef['limit'];var _0x1a12d2;if(_0x44b64b>=_0x2d21d1){_0x44b64b=_0x2d21d1;_0x1a12d2=0xc8;}else{_0x1a12d2=0xce;}_0x481095[_0x2d5f('0x1a')](_0x1a12d2);return _0x481095[_0x2d5f('0x20')](_0x2d5f('0x21'),_0x4bbe79+'-'+_0x44b64b+'/'+_0x2d21d1)['json'](_0x2a5711);}return null;};}function patchUpdates(_0x3dda7c){return function(_0x21b073){try{jsonpatch[_0x2d5f('0x22')](_0x21b073,_0x3dda7c,!![]);}catch(_0x41171b){return BPromise['reject'](_0x41171b);}return _0x21b073[_0x2d5f('0x23')]();};}function saveUpdates(_0x4069f1,_0x1bca8d){return function(_0x4f2e84){if(_0x4f2e84){return _0x4f2e84['update'](_0x4069f1)[_0x2d5f('0x24')](function(_0x933c7e){return _0x933c7e;});}return null;};}function removeEntity(_0x515773,_0x5da672){return function(_0x398564){if(_0x398564){return _0x398564[_0x2d5f('0x25')]()[_0x2d5f('0x24')](function(){_0x515773[_0x2d5f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b6dc7,_0x5caec8){return function(_0x3c1cfd){if(!_0x3c1cfd){_0x5b6dc7['sendStatus'](0x194);}return _0x3c1cfd;};}function handleError(_0x27942d,_0x1591d7){_0x1591d7=_0x1591d7||0x1f4;return function(_0x2afe23){logger[_0x2d5f('0x26')](_0x2afe23[_0x2d5f('0x27')]);if(_0x2afe23[_0x2d5f('0x28')]){delete _0x2afe23[_0x2d5f('0x28')];}_0x27942d['status'](_0x1591d7)[_0x2d5f('0x29')](_0x2afe23);};}exports[_0x2d5f('0x2a')]=function(_0xdb22df,_0x516e71){var _0x1a1a18={},_0x5bfae6={},_0x5a9690={'count':0x0,'rows':[]};var _0x2efacc=_[_0x2d5f('0x2b')](db[_0x2d5f('0x2c')][_0x2d5f('0x2d')],function(_0x2b9ccc){return{'name':_0x2b9ccc['fieldName'],'type':_0x2b9ccc[_0x2d5f('0x2e')][_0x2d5f('0x2f')]};});_0x5bfae6['model']=_['map'](_0x2efacc,'name');_0x5bfae6['query']=_[_0x2d5f('0x30')](_0xdb22df[_0x2d5f('0x31')]);_0x5bfae6[_0x2d5f('0x32')]=_[_0x2d5f('0x33')](_0x5bfae6[_0x2d5f('0x34')],_0x5bfae6[_0x2d5f('0x31')]);_0x1a1a18[_0x2d5f('0x35')]=_[_0x2d5f('0x33')](_0x5bfae6[_0x2d5f('0x34')],qs[_0x2d5f('0x36')](_0xdb22df[_0x2d5f('0x31')][_0x2d5f('0x36')]));_0x1a1a18['attributes']=_0x1a1a18[_0x2d5f('0x35')]['length']?_0x1a1a18[_0x2d5f('0x35')]:_0x5bfae6[_0x2d5f('0x34')];if(!_0xdb22df['query'][_0x2d5f('0x37')](_0x2d5f('0x38'))){_0x1a1a18['limit']=qs['limit'](_0xdb22df[_0x2d5f('0x31')][_0x2d5f('0x39')]);_0x1a1a18[_0x2d5f('0x1d')]=qs[_0x2d5f('0x1d')](_0xdb22df['query']['offset']);}_0x1a1a18[_0x2d5f('0x3a')]=qs[_0x2d5f('0x3b')](_0xdb22df[_0x2d5f('0x31')][_0x2d5f('0x3b')]);_0x1a1a18[_0x2d5f('0x3c')]=qs['filters'](_[_0x2d5f('0x3d')](_0xdb22df[_0x2d5f('0x31')],_0x5bfae6[_0x2d5f('0x32')]),_0x2efacc);if(_0xdb22df['query'][_0x2d5f('0x3e')]){_0x1a1a18[_0x2d5f('0x3c')]=_[_0x2d5f('0x3f')](_0x1a1a18[_0x2d5f('0x3c')],{'$or':_[_0x2d5f('0x2b')](_0x2efacc,function(_0x30093b){if(_0x30093b[_0x2d5f('0x2e')]!==_0x2d5f('0x40')){var _0x387b57={};_0x387b57[_0x30093b[_0x2d5f('0x28')]]={'$like':'%'+_0xdb22df[_0x2d5f('0x31')]['filter']+'%'};return _0x387b57;}})});}_0x1a1a18=_['merge']({},_0x1a1a18,_0xdb22df[_0x2d5f('0x41')]);var _0x46dfcd={'where':_0x1a1a18[_0x2d5f('0x3c')]};return db[_0x2d5f('0x2c')]['count'](_0x46dfcd)[_0x2d5f('0x24')](function(_0x3c0901){_0x5a9690['count']=_0x3c0901;if(_0xdb22df['query'][_0x2d5f('0x42')]){_0x1a1a18[_0x2d5f('0x43')]=[{'all':!![]}];}return db[_0x2d5f('0x2c')][_0x2d5f('0x44')](_0x1a1a18);})['then'](function(_0x3bec5a){_0x5a9690[_0x2d5f('0x45')]=_0x3bec5a;return _0x5a9690;})[_0x2d5f('0x24')](respondWithFilteredResult(_0x516e71,_0x1a1a18))['catch'](handleError(_0x516e71,null));};exports['show']=function(_0x4ff0d6,_0x13208f){var _0x4bffdf={'raw':!![],'where':{'id':_0x4ff0d6['params']['id']}},_0x1c6cb7={};_0x1c6cb7['model']=_[_0x2d5f('0x30')](db[_0x2d5f('0x2c')][_0x2d5f('0x2d')]);_0x1c6cb7[_0x2d5f('0x31')]=_[_0x2d5f('0x30')](_0x4ff0d6[_0x2d5f('0x31')]);_0x1c6cb7[_0x2d5f('0x32')]=_[_0x2d5f('0x33')](_0x1c6cb7[_0x2d5f('0x34')],_0x1c6cb7[_0x2d5f('0x31')]);_0x4bffdf[_0x2d5f('0x35')]=_['intersection'](_0x1c6cb7['model'],qs[_0x2d5f('0x36')](_0x4ff0d6[_0x2d5f('0x31')][_0x2d5f('0x36')]));_0x4bffdf[_0x2d5f('0x35')]=_0x4bffdf['attributes'][_0x2d5f('0x46')]?_0x4bffdf[_0x2d5f('0x35')]:_0x1c6cb7['model'];if(_0x4ff0d6[_0x2d5f('0x31')][_0x2d5f('0x42')]){_0x4bffdf[_0x2d5f('0x43')]=[{'all':!![]}];}_0x4bffdf=_[_0x2d5f('0x3f')]({},_0x4bffdf,_0x4ff0d6['options']);return db[_0x2d5f('0x2c')][_0x2d5f('0x47')](_0x4bffdf)[_0x2d5f('0x24')](handleEntityNotFound(_0x13208f,null))['then'](respondWithResult(_0x13208f,null))[_0x2d5f('0x48')](handleError(_0x13208f,null));};exports[_0x2d5f('0x49')]=function(_0x168fa0,_0x2c95e0){return db[_0x2d5f('0x2c')]['create'](_0x168fa0[_0x2d5f('0x4a')],{})[_0x2d5f('0x24')](respondWithResult(_0x2c95e0,0xc9))[_0x2d5f('0x48')](handleError(_0x2c95e0,null));};exports[_0x2d5f('0x4b')]=function(_0x31c58c,_0x4be4be){if(_0x31c58c[_0x2d5f('0x4a')]['id']){delete _0x31c58c[_0x2d5f('0x4a')]['id'];}return db[_0x2d5f('0x2c')]['find']({'where':{'id':_0x31c58c[_0x2d5f('0x4c')]['id']}})[_0x2d5f('0x24')](handleEntityNotFound(_0x4be4be,null))['then'](saveUpdates(_0x31c58c[_0x2d5f('0x4a')],null))[_0x2d5f('0x24')](respondWithResult(_0x4be4be,null))[_0x2d5f('0x48')](handleError(_0x4be4be,null));};exports[_0x2d5f('0x25')]=function(_0x451fb6,_0x51263f){return db[_0x2d5f('0x2c')]['find']({'where':{'id':_0x451fb6[_0x2d5f('0x4c')]['id']}})[_0x2d5f('0x24')](handleEntityNotFound(_0x51263f,null))[_0x2d5f('0x24')](removeEntity(_0x51263f,null))[_0x2d5f('0x48')](handleError(_0x51263f,null));};
\ No newline at end of file
index a2b4a52..f017a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8356=['request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','util','../../config/logger','api','moment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8356,0x8b));var _0x6835=function(_0xc0cbf,_0x22f493){_0xc0cbf=_0xc0cbf-0x0;var _0x24a0ac=_0x8356[_0xc0cbf];return _0x24a0ac;};'use strict';var _=require('lodash');var util=require(_0x6835('0x0'));var logger=require(_0x6835('0x1'))(_0x6835('0x2'));var moment=require(_0x6835('0x3'));var BPromise=require('bluebird');var rp=require(_0x6835('0x4'));var fs=require('fs');var path=require(_0x6835('0x5'));var rimraf=require(_0x6835('0x6'));var config=require(_0x6835('0x7'));var attributes=require(_0x6835('0x8'));module[_0x6835('0x9')]=function(_0x47573e,_0x256315){return _0x47573e[_0x6835('0xa')]('FaxApplication',attributes,{'tableName':_0x6835('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6835('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0e81=['api','moment','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e81,0x1af));var _0x10e8=function(_0x4976eb,_0x4b09d1){_0x4976eb=_0x4976eb-0x0;var _0x5dd7b2=_0x0e81[_0x4976eb];return _0x5dd7b2;};'use strict';var _=require(_0x10e8('0x0'));var util=require(_0x10e8('0x1'));var logger=require(_0x10e8('0x2'))(_0x10e8('0x3'));var moment=require(_0x10e8('0x4'));var BPromise=require('bluebird');var rp=require(_0x10e8('0x5'));var fs=require('fs');var path=require(_0x10e8('0x6'));var rimraf=require(_0x10e8('0x7'));var config=require(_0x10e8('0x8'));var attributes=require(_0x10e8('0x9'));module[_0x10e8('0xa')]=function(_0xfa06a1,_0x44bb71){return _0xfa06a1['define'](_0x10e8('0xb'),attributes,{'tableName':_0x10e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x10e8('0xd')});};
\ No newline at end of file
index 13f7bee..47fe65d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1737=['FaxApplication','update','options','raw','where','attributes','limit','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','UpdateFaxApplication'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x1737,0x147));var _0x7173=function(_0xeaec2f,_0x3e1f29){_0xeaec2f=_0xeaec2f-0x0;var _0xc69a94=_0x1737[_0xeaec2f];return _0xc69a94;};'use strict';var _=require(_0x7173('0x0'));var util=require(_0x7173('0x1'));var moment=require('moment');var BPromise=require(_0x7173('0x2'));var rs=require(_0x7173('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7173('0x4'))['db'];var utils=require(_0x7173('0x5'));var logger=require('../../config/logger')(_0x7173('0x6'));var config=require('../../config/environment');var jayson=require(_0x7173('0x7'));var client=jayson[_0x7173('0x8')][_0x7173('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3029ee,_0x2e3a78,_0x3e1f34){return new BPromise(function(_0x3c97f9,_0x2e9520){return client['request'](_0x3029ee,_0x3e1f34)[_0x7173('0xa')](function(_0x104bfa){logger[_0x7173('0xb')](_0x7173('0xc'),_0x2e3a78,'request\x20sent');logger[_0x7173('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2e3a78,_0x7173('0xe'),JSON[_0x7173('0xf')](_0x104bfa));if(_0x104bfa[_0x7173('0x10')]){if(_0x104bfa['error'][_0x7173('0x11')]===0x1f4){logger[_0x7173('0x10')](_0x7173('0xc'),_0x2e3a78,_0x104bfa['error'][_0x7173('0x12')]);return _0x2e9520(_0x104bfa[_0x7173('0x10')][_0x7173('0x12')]);}logger[_0x7173('0x10')](_0x7173('0xc'),_0x2e3a78,_0x104bfa['error']['message']);return _0x3c97f9(_0x104bfa['error'][_0x7173('0x12')]);}else{logger[_0x7173('0xb')](_0x7173('0xc'),_0x2e3a78,_0x7173('0xe'));_0x3c97f9(_0x104bfa[_0x7173('0x13')][_0x7173('0x12')]);}})['catch'](function(_0x351eb6){logger['error'](_0x7173('0xc'),_0x2e3a78,_0x351eb6);_0x2e9520(_0x351eb6);});});}exports[_0x7173('0x14')]=function(_0x8fbc82){var _0x39a7ae=this;return new Promise(function(_0x460d81,_0x1ea347){return db[_0x7173('0x15')][_0x7173('0x16')](_0x8fbc82['body'],{'raw':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x19')]||null:null,'attributes':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x1a')]||null:null,'limit':_0x8fbc82[_0x7173('0x17')]?_0x8fbc82[_0x7173('0x17')][_0x7173('0x1b')]||null:null})['then'](function(_0x5e6373){logger['info']('UpdateFaxApplication',_0x8fbc82);logger[_0x7173('0xd')](_0x7173('0x14'),_0x8fbc82,JSON[_0x7173('0xf')](_0x5e6373));_0x460d81(_0x5e6373);})[_0x7173('0x1c')](function(_0x4cd687){logger[_0x7173('0x10')]('UpdateFaxApplication',_0x4cd687[_0x7173('0x12')],_0x8fbc82);_0x1ea347(_0x39a7ae['error'](0x1f4,_0x4cd687['message']));});});};
\ No newline at end of file
+var _0x0f42=['error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify'];(function(_0x5cedbc,_0x48fc4d){var _0x5d73a0=function(_0x2aa9b7){while(--_0x2aa9b7){_0x5cedbc['push'](_0x5cedbc['shift']());}};_0x5d73a0(++_0x48fc4d);}(_0x0f42,0x1de));var _0x20f4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0f42[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x20f4('0x0'));var util=require('util');var moment=require(_0x20f4('0x1'));var BPromise=require(_0x20f4('0x2'));var rs=require(_0x20f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x20f4('0x4'));var logger=require('../../config/logger')(_0x20f4('0x5'));var config=require(_0x20f4('0x6'));var jayson=require(_0x20f4('0x7'));var client=jayson[_0x20f4('0x8')][_0x20f4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d2fc0,_0x397059,_0x58abfb){return new BPromise(function(_0x221d9e,_0x517c5b){return client[_0x20f4('0xa')](_0x4d2fc0,_0x58abfb)[_0x20f4('0xb')](function(_0x262d3d){logger[_0x20f4('0xc')]('FaxApplication,\x20%s,\x20%s',_0x397059,_0x20f4('0xd'));logger['debug']('FaxApplication,\x20%s,\x20%s,\x20%s',_0x397059,_0x20f4('0xd'),JSON[_0x20f4('0xe')](_0x262d3d));if(_0x262d3d[_0x20f4('0xf')]){if(_0x262d3d['error'][_0x20f4('0x10')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x397059,_0x262d3d['error'][_0x20f4('0x11')]);return _0x517c5b(_0x262d3d['error'][_0x20f4('0x11')]);}logger[_0x20f4('0xf')]('FaxApplication,\x20%s,\x20%s',_0x397059,_0x262d3d[_0x20f4('0xf')][_0x20f4('0x11')]);return _0x221d9e(_0x262d3d[_0x20f4('0xf')]['message']);}else{logger[_0x20f4('0xc')](_0x20f4('0x12'),_0x397059,_0x20f4('0xd'));_0x221d9e(_0x262d3d[_0x20f4('0x13')][_0x20f4('0x11')]);}})[_0x20f4('0x14')](function(_0x4060b2){logger[_0x20f4('0xf')]('FaxApplication,\x20%s,\x20%s',_0x397059,_0x4060b2);_0x517c5b(_0x4060b2);});});}exports[_0x20f4('0x15')]=function(_0x148cbe){var _0x4f2ae4=this;return new Promise(function(_0x2af8eb,_0x194563){return db[_0x20f4('0x16')][_0x20f4('0x17')](_0x148cbe[_0x20f4('0x18')],{'raw':_0x148cbe[_0x20f4('0x19')]?_0x148cbe[_0x20f4('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x148cbe[_0x20f4('0x19')]?_0x148cbe['options'][_0x20f4('0x1a')]||null:null,'attributes':_0x148cbe[_0x20f4('0x19')]?_0x148cbe['options'][_0x20f4('0x1b')]||null:null,'limit':_0x148cbe[_0x20f4('0x19')]?_0x148cbe[_0x20f4('0x19')][_0x20f4('0x1c')]||null:null})[_0x20f4('0xb')](function(_0x143594){logger[_0x20f4('0xc')](_0x20f4('0x15'),_0x148cbe);logger['debug'](_0x20f4('0x15'),_0x148cbe,JSON[_0x20f4('0xe')](_0x143594));_0x2af8eb(_0x143594);})[_0x20f4('0x14')](function(_0x2c3406){logger[_0x20f4('0xf')](_0x20f4('0x15'),_0x2c3406[_0x20f4('0x11')],_0x148cbe);_0x194563(_0x4f2ae4[_0x20f4('0xf')](0x1f4,_0x2c3406[_0x20f4('0x11')]));});});};
\ No newline at end of file
index d9422c4..ff1587a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x2b04ad,_0x1eb795){var _0x527e6f=function(_0xd7195f){while(--_0xd7195f){_0x2b04ad['push'](_0x2b04ad['shift']());}};_0x527e6f(++_0x1eb795);}(_0xd4a2,0x173));var _0x2d4a=function(_0x498282,_0x59cf91){_0x498282=_0x498282-0x0;var _0x42c433=_0xd4a2[_0x498282];return _0x42c433;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router;
\ No newline at end of file
+var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x443176,_0x35fef7){_0x443176=_0x443176-0x0;var _0x3f3e02=_0x9ffd[_0x443176];return _0x3f3e02;};'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 03bec4d..441fb3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59d0=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x12dfac,_0x4e2e81){var _0x50b300=function(_0x258624){while(--_0x258624){_0x12dfac['push'](_0x12dfac['shift']());}};_0x50b300(++_0x4e2e81);}(_0x59d0,0x100));var _0x059d=function(_0x423ba1,_0x4b83a6){_0x423ba1=_0x423ba1-0x0;var _0x2db872=_0x59d0[_0x423ba1];return _0x2db872;};'use strict';var Sequelize=require(_0x059d('0x0'));module[_0x059d('0x1')]={'closed':{'type':Sequelize[_0x059d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x059d('0x3')]},'disposition':{'type':Sequelize[_0x059d('0x4')]},'secondDisposition':{'type':Sequelize[_0x059d('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x059d('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x059d('0x5')]('in',_0x059d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x059d('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x059d('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0xde0c=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xde0c,0x7b));var _0xcde0=function(_0x127705,_0x164d9a){_0x127705=_0x127705-0x0;var _0x5e6cb4=_0xde0c[_0x127705];return _0x5e6cb4;};'use strict';var Sequelize=require(_0xcde0('0x0'));module[_0xcde0('0x1')]={'closed':{'type':Sequelize[_0xcde0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcde0('0x3')]},'disposition':{'type':Sequelize[_0xcde0('0x4')]},'secondDisposition':{'type':Sequelize[_0xcde0('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcde0('0x4')]},'note':{'type':Sequelize[_0xcde0('0x4')]},'read1stAt':{'type':Sequelize[_0xcde0('0x3')]},'fax':{'type':Sequelize[_0xcde0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xcde0('0x5')]('in',_0xcde0('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcde0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcde0('0x5')]('in',_0xcde0('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 52240d4..150e738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8ae=['omit','spread','Tag','findAll','removeTags','unix','root','server','files','attachments','join','format','transcript-%d-%s.zip','Attachment','Messages','get','basename','createReadStream','pipe','resolve','download','log','err','unlinkSync','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','TagIds','forEach','Tags','push','catch','index','map','rawAttributes','fieldName','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','find','unreadMessages','value','`\x20=\x200','having','`\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','end','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','order','contactName','DESC','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','options','create','describe','addMessage','FaxMessage','ids','findOne','YYYY-MM-DD\x20HH:mm:ss','include','addTags'];(function(_0x28a005,_0x1ad66f){var _0x48eab1=function(_0x544fa0){while(--_0x544fa0){_0x28a005['push'](_0x28a005['shift']());}};_0x48eab1(++_0x1ad66f);}(_0xd8ae,0x1c8));var _0xed8a=function(_0x43ada9,_0x4ff637){_0x43ada9=_0x43ada9-0x0;var _0x1654cc=_0xd8ae[_0x43ada9];return _0x1654cc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed8a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed8a('0x1'));var rp=require(_0xed8a('0x2'));var moment=require(_0xed8a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed8a('0x4'));var path=require(_0xed8a('0x5'));var sox=require(_0xed8a('0x6'));var csv=require(_0xed8a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed8a('0x8'));var _=require(_0xed8a('0x9'));var squel=require('squel');var crypto=require(_0xed8a('0xa'));var jsforce=require(_0xed8a('0xb'));var deskjs=require(_0xed8a('0xc'));var toCsv=require(_0xed8a('0x7'));var querystring=require('querystring');var Papa=require(_0xed8a('0xd'));var Redis=require(_0xed8a('0xe'));var authService=require(_0xed8a('0xf'));var qs=require(_0xed8a('0x10'));var as=require(_0xed8a('0x11'));var hardwareService=require(_0xed8a('0x12'));var logger=require('../../config/logger')(_0xed8a('0x13'));var utils=require(_0xed8a('0x14'));var config=require(_0xed8a('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xed8a('0x16')]=_[_0xed8a('0x17')](config[_0xed8a('0x16')],{'host':_0xed8a('0x18'),'port':0x18eb});var socket=require(_0xed8a('0x19'))(new Redis(config['redis']));require(_0xed8a('0x1a'))[_0xed8a('0x1b')](socket);function respondWithStatusCode(_0x22c058,_0x4446b8){_0x4446b8=_0x4446b8||0xcc;return function(_0x21a346){if(_0x21a346){return _0x22c058[_0xed8a('0x1c')](_0x4446b8);}return _0x22c058['status'](_0x4446b8)['end']();};}function respondWithResult(_0x56cf0b,_0x587594){_0x587594=_0x587594||0xc8;return function(_0x5b9104){if(_0x5b9104){return _0x56cf0b[_0xed8a('0x1d')](_0x587594)['json'](_0x5b9104);}};}function respondWithFilteredResult(_0x1b2863,_0x244372){return function(_0x1165cf){if(_0x1165cf){var _0xfc837c=typeof _0x244372['offset']===_0xed8a('0x1e')&&typeof _0x244372[_0xed8a('0x1f')]===_0xed8a('0x1e');var _0x41ded0=_0x1165cf[_0xed8a('0x20')];var _0x457d83=_0xfc837c?0x0:_0x244372[_0xed8a('0x21')];var _0x56f88e=_0xfc837c?_0x1165cf[_0xed8a('0x20')]:_0x244372[_0xed8a('0x21')]+_0x244372[_0xed8a('0x1f')];var _0x151a2e;if(_0x56f88e>=_0x41ded0){_0x56f88e=_0x41ded0;_0x151a2e=0xc8;}else{_0x151a2e=0xce;}_0x1b2863[_0xed8a('0x1d')](_0x151a2e);return _0x1b2863[_0xed8a('0x22')](_0xed8a('0x23'),_0x457d83+'-'+_0x56f88e+'/'+_0x41ded0)[_0xed8a('0x24')](_0x1165cf);}return null;};}function patchUpdates(_0x697451){return function(_0x5be7f0){try{jsonpatch[_0xed8a('0x25')](_0x5be7f0,_0x697451,!![]);}catch(_0x103ab4){return BPromise[_0xed8a('0x26')](_0x103ab4);}return _0x5be7f0[_0xed8a('0x27')]();};}function saveUpdates(_0x4fb1e5,_0x58403d){return function(_0x5557a1){if(_0x5557a1){return _0x5557a1[_0xed8a('0x28')](_0x4fb1e5)[_0xed8a('0x29')](function(_0x419aa8){return _0x419aa8;});}return null;};}function removeEntity(_0x4d7329,_0x1b8863){return function(_0x9b2130){if(_0x9b2130){return _0x9b2130[_0xed8a('0x2a')]()[_0xed8a('0x29')](function(){_0x4d7329['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7c53,_0x2e4c12){return function(_0x88b317){if(!_0x88b317){_0x2c7c53[_0xed8a('0x1c')](0x194);}return _0x88b317;};}function handleError(_0x38601c,_0x1fd60f){_0x1fd60f=_0x1fd60f||0x1f4;return function(_0x292b14){logger[_0xed8a('0x2b')](_0x292b14[_0xed8a('0x2c')]);if(_0x292b14[_0xed8a('0x2d')]){delete _0x292b14[_0xed8a('0x2d')];}_0x38601c[_0xed8a('0x1d')](_0x1fd60f)[_0xed8a('0x2e')](_0x292b14);};}function getInteractionUsers(_0xa9201f,_0x141294){return new BPromise(function(_0x5d6c24,_0x99f964){try{if(_0x141294[_0xa9201f['id']]){_0xa9201f[_0xed8a('0x2f')]=_['map'](_0x141294[_0xa9201f['id']],function(_0x5a6a3e){return{'id':_0x5a6a3e['id'],'fullname':_0x5a6a3e[_0xed8a('0x30')]};});}}catch(_0x5437b4){_0x99f964(_0x5437b4);}_0x5d6c24(_0xa9201f);});}function getInteractionTags(_0x16ee05,_0x42aec9){return new BPromise(function(_0x12cb1e,_0x917d5a){try{if(_0x16ee05[_0xed8a('0x31')]){_0x16ee05['Tags']=[];_0x16ee05[_0xed8a('0x31')]['split'](',')[_0xed8a('0x32')](function(_0x5d3de7){_0x16ee05[_0xed8a('0x33')][_0xed8a('0x34')](_0x42aec9[_0x5d3de7]);});}delete _0x16ee05[_0xed8a('0x31')];}catch(_0x414191){_0x917d5a(_0x414191);}_0x12cb1e(_0x16ee05);});}function updateFaxInteraction(_0x7a41a3,_0x288e98,_0x2c2ec8){return new BPromise(function(_0x31f892,_0x1941de){return getInteractionUsers(_0x7a41a3,_0x2c2ec8)[_0xed8a('0x29')](function(_0x5bc7d7){return getInteractionTags(_0x5bc7d7,_0x288e98);})[_0xed8a('0x29')](function(_0x1aa98c){_0x31f892(_0x1aa98c);})[_0xed8a('0x35')](function(_0x5c919b){_0x1941de(_0x5c919b);});});}exports[_0xed8a('0x36')]=function(_0x216b49,_0x24b33a){var _0x19e669={},_0xd3a8dd={},_0x309b1f={'count':0x0,'rows':[]};var _0x3352ab=_[_0xed8a('0x37')](db['FaxInteraction'][_0xed8a('0x38')],function(_0x3396ab){return{'name':_0x3396ab[_0xed8a('0x39')],'type':_0x3396ab['type']['key']};});_0xd3a8dd[_0xed8a('0x3a')]=_[_0xed8a('0x37')](_0x3352ab,_0xed8a('0x2d'));_0xd3a8dd['query']=_[_0xed8a('0x3b')](_0x216b49[_0xed8a('0x3c')]);_0xd3a8dd[_0xed8a('0x3d')]=_['intersection'](_0xd3a8dd['model'],_0xd3a8dd[_0xed8a('0x3c')]);_0x19e669[_0xed8a('0x3e')]=_[_0xed8a('0x3f')](_0xd3a8dd['model'],qs[_0xed8a('0x40')](_0x216b49[_0xed8a('0x3c')][_0xed8a('0x40')]));_0x19e669[_0xed8a('0x3e')]=_0x19e669['attributes'][_0xed8a('0x41')]?_0x19e669[_0xed8a('0x3e')]:_0xd3a8dd['model'];if(!_0x216b49['query'][_0xed8a('0x42')](_0xed8a('0x43'))){_0x19e669['limit']=qs[_0xed8a('0x1f')](_0x216b49[_0xed8a('0x3c')]['limit']);_0x19e669[_0xed8a('0x21')]=qs[_0xed8a('0x21')](_0x216b49['query'][_0xed8a('0x21')]);}_0x19e669['order']=qs[_0xed8a('0x44')](_0x216b49['query'][_0xed8a('0x44')]);_0x19e669[_0xed8a('0x45')]=qs[_0xed8a('0x3d')](_[_0xed8a('0x46')](_0x216b49[_0xed8a('0x3c')],_0xd3a8dd[_0xed8a('0x3d')]),_0x3352ab);var _0x59a35c=[];var _0x562b30=squel[_0xed8a('0x47')]()[_0xed8a('0x48')]('id')[_0xed8a('0x48')]('name')[_0xed8a('0x48')](_0xed8a('0x49'))[_0xed8a('0x4a')](_0xed8a('0x4b'));var _0x52d6db=squel[_0xed8a('0x47')]()[_0xed8a('0x48')](_0xed8a('0x4c'))['field'](_0xed8a('0x4d'))['field'](_0xed8a('0x4e'))[_0xed8a('0x4a')](_0xed8a('0x4f'),'ui')[_0xed8a('0x50')](_0xed8a('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x1592d5=squel['select']()[_0xed8a('0x4a')](_0xed8a('0x52'),'i')[_0xed8a('0x50')](_0xed8a('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xed8a('0x50')]('users','o',_0xed8a('0x54'))[_0xed8a('0x50')](_0xed8a('0x55'),'a',_0xed8a('0x56'))['left_join'](_0xed8a('0x57'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xed8a('0x50')](_0xed8a('0x58'),'it',_0xed8a('0x59'))['left_join'](_0xed8a('0x4b'),'t',_0xed8a('0x5a'));var _0x47d009=squel[_0xed8a('0x5b')]();var _0x45090f=[];var _0x21f25e=squel['expr']();var _0x69aca5;if(_0x216b49[_0xed8a('0x3c')]['search']){_0x69aca5=as[_0xed8a('0x5c')](_0x216b49[_0xed8a('0x3c')][_0xed8a('0x5d')]);var _0x4b5280=_0x69aca5[_0xed8a('0x5e')];for(var _0x58715d=0x0;_0x58715d<_0x69aca5['conditions'][_0xed8a('0x41')];_0x58715d++){var _0xdc8449=_0x69aca5['conditions'][_0x58715d];var _0x5d9f79='i';var _0x50768b=_[_0xed8a('0x5f')](_0x3352ab,['name',_0xdc8449['field']]);if(!_0x50768b){switch(_0xdc8449[_0xed8a('0x48')]){case _0xed8a('0x60'):if(_0xdc8449[_0xed8a('0x61')]==0x1){_0x1592d5['having']('`'+_0xdc8449['field']+_0xed8a('0x62'));}else{_0x1592d5[_0xed8a('0x63')]('`'+_0xdc8449['field']+_0xed8a('0x64'));}break;case _0xed8a('0x65'):if(_0xdc8449[_0xed8a('0x66')]===_0xed8a('0x67')){if(_0xdc8449['value'][_0xed8a('0x68')]('\x20')[_0xed8a('0x41')]>0x1){_0x47d009[_0x4b5280]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xdc8449[_0xed8a('0x61')]),null);}else{var _0x2327f2='%'+_0xdc8449[_0xed8a('0x61')]+'%';_0x47d009[_0x4b5280](_0xed8a('0x69'),_0x2327f2,_0x2327f2,_0x2327f2);}}else{_0x50768b=_[_0xed8a('0x5f')](_0x3352ab,[_0xed8a('0x2d'),'ContactId']);_0xdc8449[_0xed8a('0x48')]=_0xed8a('0x6a');_0x2c13d2=as[_0xed8a('0x6b')](_0x5d9f79,_0x50768b[_0xed8a('0x6c')],_0xdc8449);_0x47d009[_0x4b5280](_0x2c13d2[_0xed8a('0x6d')],_0x2c13d2['value'][_0xed8a('0x6e')],_0x2c13d2['value'][_0xed8a('0x6f')]);}break;case'Tag':var _0x23185d=_0xdc8449['value'][_0xed8a('0x68')](',')[_0xed8a('0x37')](function(_0x5725b9){return Number(_0x5725b9);});_0x23185d[_0xed8a('0x32')](function(_0x1773ba){_0x21f25e['or'](_0xed8a('0x70'),'%,'+_0x1773ba+',%');});_0x45090f=_[_0xed8a('0x71')](_0x45090f,_0x23185d);break;case _0xed8a('0x72'):if(_0xdc8449[_0xed8a('0x66')]==='$substring'){_0x47d009[_0x4b5280]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xdc8449[_0xed8a('0x61')]+'%',null);}else{_0x50768b=_['find'](_0x3352ab,['name',_0xed8a('0x73')]);_0xdc8449[_0xed8a('0x48')]=_0xed8a('0x73');_0x2c13d2=as[_0xed8a('0x6b')](_0x5d9f79,_0x50768b['type'],_0xdc8449);_0x47d009[_0x4b5280](_0x2c13d2[_0xed8a('0x6d')],_0x2c13d2[_0xed8a('0x61')][_0xed8a('0x6e')],_0x2c13d2['value'][_0xed8a('0x6f')]);}break;case _0xed8a('0x74'):_0x2c13d2=as[_0xed8a('0x6b')]('me',null,_0xdc8449);_0x47d009[_0x4b5280](_0x2c13d2[_0xed8a('0x6d')],_0x2c13d2[_0xed8a('0x61')][_0xed8a('0x6e')],_0x2c13d2[_0xed8a('0x61')][_0xed8a('0x6f')]);break;}}else{var _0x2c13d2=as[_0xed8a('0x6b')](_0x5d9f79,_0x50768b[_0xed8a('0x6c')],_0xdc8449);_0x47d009[_0x4b5280](_0x2c13d2[_0xed8a('0x6d')],_0x2c13d2[_0xed8a('0x61')][_0xed8a('0x6e')],_0x2c13d2['value']['end']);}}}else{var _0x4e8629=_(_0x216b49[_0xed8a('0x3c')])[_0xed8a('0x3b')]()[_0xed8a('0x37')](function(_0x267ad5){return _[_0xed8a('0x75')](_0x3352ab,[_0xed8a('0x2d'),_0x267ad5])?_0x267ad5:undefined;})['compact']()[_0xed8a('0x61')]();if(!_[_0xed8a('0x76')](_0x4e8629)){_0x4e8629[_0xed8a('0x32')](function(_0x563d57){if(_0x563d57===_0xed8a('0x77')){_0x1592d5[_0xed8a('0x45')](_0xed8a('0x78'),[]['concat'](_0x216b49['query'][_0x563d57]));}else if(_0x563d57===_0xed8a('0x79')){var _0x2f2349=JSON[_0xed8a('0x7a')](_0x216b49[_0xed8a('0x3c')][_0x563d57])[_0xed8a('0x7b')];var _0x23947c=JSON[_0xed8a('0x7a')](_0x216b49[_0xed8a('0x3c')][_0x563d57])[_0xed8a('0x7c')];_0x1592d5['where'](_0xed8a('0x7d'),_0x2f2349,_0x23947c);}else{if(_0x216b49[_0xed8a('0x3c')][_0x563d57]===_0xed8a('0x7e')){_0x1592d5[_0xed8a('0x45')]('i.'+_0x563d57+_0xed8a('0x7f'));}else{_0x1592d5[_0xed8a('0x45')]('i.'+_0x563d57+'\x20=\x20?',_0x216b49[_0xed8a('0x3c')][_0x563d57]);}}});}if(_0x216b49['query'][_0xed8a('0x80')]){if(_0x216b49['query'][_0xed8a('0x80')]==0x1){_0x1592d5[_0xed8a('0x63')](_0xed8a('0x81'));}else{_0x1592d5['having'](_0xed8a('0x82'));}}if(_0x216b49['query'][_0xed8a('0x83')]){_0x45090f=_[_0xed8a('0x84')](_0x216b49[_0xed8a('0x3c')]['tag'])?_0x216b49['query'][_0xed8a('0x83')]:new Array(_0x216b49[_0xed8a('0x3c')][_0xed8a('0x83')]);_0x45090f[_0xed8a('0x32')](function(_0x380295){_0x21f25e['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x380295+',%');});}if(_0x216b49[_0xed8a('0x3c')][_0xed8a('0x85')]){var _0x7e8d48=_0x216b49[_0xed8a('0x3c')][_0xed8a('0x85')][_0xed8a('0x86')]('\x5c','\x5c\x5c')[_0xed8a('0x86')](/'/g,'\x27\x27');if(qs[_0xed8a('0x87')](_0x7e8d48)){_0x47d009['or'](_0xed8a('0x88'),_0x7e8d48+'%')['or'](_0xed8a('0x89'),_0x7e8d48+'%');}_0x47d009['or'](_0xed8a('0x8a'),_0x7e8d48+'%');}}_0x1592d5[_0xed8a('0x45')](_0x47d009);_0x1592d5[_0xed8a('0x8b')](_0xed8a('0x8c'));var _0x1a3d76={'type':db[_0xed8a('0x8d')][_0xed8a('0x8e')]['SELECT'],'raw':!![]};var _0x43995e=_0x1592d5[_0xed8a('0x8f')]();_0x43995e[_0xed8a('0x48')](_0xed8a('0x8c'));_0x43995e['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x19e669['order']){_0x19e669[_0xed8a('0x90')][_0xed8a('0x32')](function(_0x5f5105){var _0x6307e7=_0x5f5105[0x0]===_0xed8a('0x91')?_0x5f5105[0x0]:'i.'+_0x5f5105[0x0];_0x1592d5['order'](_0x6307e7,_0x5f5105[0x1]===_0xed8a('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x45090f)){_0x1592d5['having'](_0x21f25e);_0x43995e[_0xed8a('0x45')]('t.id\x20IN\x20?',_0x45090f);}BPromise['resolve']()[_0xed8a('0x29')](function(){if(!_0x69aca5){if(_0x216b49[_0xed8a('0x3c')][_0xed8a('0x77')])return;_0x43995e[_0xed8a('0x45')](_0xed8a('0x93'));_0x1592d5[_0xed8a('0x45')](_0xed8a('0x93'));return;}if(_0x216b49[_0xed8a('0x94')][_0xed8a('0x95')]!==_0xed8a('0x96'))return;return _0x216b49[_0xed8a('0x94')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xed8a('0x29')](function(_0x374316){if(_['isEmpty'](_0x374316)){_0x43995e[_0xed8a('0x45')](_0xed8a('0x97'));_0x1592d5[_0xed8a('0x45')](_0xed8a('0x97'));}else{_0x43995e[_0xed8a('0x45')](_0xed8a('0x78'),_[_0xed8a('0x37')](_0x374316,'id'));_0x1592d5[_0xed8a('0x45')]('i.FaxAccountId\x20IN\x20?',_[_0xed8a('0x37')](_0x374316,'id'));}});})[_0xed8a('0x29')](function(){if(_0x216b49['user']['role']===_0xed8a('0x96')&&!_0x69aca5&&!_0x216b49[_0xed8a('0x3c')]['FaxAccountId'])return[];return db[_0xed8a('0x98')][_0xed8a('0x3c')](_0x43995e[_0xed8a('0x99')](),_0x1a3d76);})['then'](function(_0x30b4e9){_0x309b1f[_0xed8a('0x20')]=_0x30b4e9[_0xed8a('0x41')];if(_0x309b1f[_0xed8a('0x20')]===0x0)return[];return db[_0xed8a('0x98')]['query'](_0x562b30[_0xed8a('0x99')](),_0x1a3d76)[_0xed8a('0x29')](function(_0x4f658e){_0x59a35c=_[_0xed8a('0x9a')](_0x4f658e,'id');_0x1a3d76=_[_0xed8a('0x9b')](_0x1a3d76,{'model':db[_0xed8a('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x216b49['query'][_0xed8a('0x40')]){_0x19e669[_0xed8a('0x3e')][_0xed8a('0x32')](function(_0x2bcba8){_0x1592d5[_0xed8a('0x48')]('i.'+_0x2bcba8);});}else{_0x1592d5[_0xed8a('0x48')](_0xed8a('0x9d'),_0xed8a('0x60'));_0x1592d5[_0xed8a('0x48')](_0xed8a('0x9e'),'Account.key');_0x1592d5[_0xed8a('0x48')](_0xed8a('0x9f'),_0xed8a('0xa0'));_0x1592d5[_0xed8a('0x48')](_0xed8a('0xa1'),'contactName');_0x1592d5[_0xed8a('0x48')](_0xed8a('0xa2'));_0x1592d5['field'](_0xed8a('0xa3'),_0xed8a('0xa4'));_0x1592d5['field']('c.lastName',_0xed8a('0xa5'));_0x1592d5[_0xed8a('0x48')]('c.email',_0xed8a('0xa6'));_0x1592d5[_0xed8a('0x48')](_0xed8a('0xa7'),'Contact.phone');_0x1592d5['field'](_0xed8a('0xa8'),_0xed8a('0xa9'));_0x1592d5[_0xed8a('0x48')]('c.fax',_0xed8a('0xaa'));_0x1592d5[_0xed8a('0x48')]('o.fullname',_0xed8a('0xab'));_0x1592d5[_0xed8a('0x48')]('o.internal',_0xed8a('0xac'));_0x1592d5['field'](_0xed8a('0xad'),_0xed8a('0x31'));}if(_0x19e669[_0xed8a('0x1f')])_0x1592d5[_0xed8a('0x1f')](_0x19e669[_0xed8a('0x1f')]);if(_0x19e669[_0xed8a('0x21')])_0x1592d5['offset'](_0x19e669[_0xed8a('0x21')]);return db[_0xed8a('0x98')][_0xed8a('0x3c')](_0x1592d5['toString'](),_0x1a3d76);})['then'](function(_0x2751db){if(_0x2751db[_0xed8a('0x41')]>0x0)_0x52d6db['where'](_0xed8a('0xae'),_[_0xed8a('0x37')](_0x2751db,'id'));return db[_0xed8a('0x98')][_0xed8a('0x3c')](_0x52d6db['toString'](),_0x1a3d76)[_0xed8a('0x29')](function(_0x2eda5f){var _0x358276=_[_0xed8a('0xaf')](_0x2eda5f,_0xed8a('0xb0'));var _0x808a0a=[];_0x2751db[_0xed8a('0x32')](function(_0x9cbca9){_0x808a0a[_0xed8a('0x34')](updateFaxInteraction(_0x9cbca9,_0x59a35c,_0x358276));});return BPromise[_0xed8a('0xb1')](_0x808a0a);});});})[_0xed8a('0x29')](function(_0x21be02){_0x309b1f[_0xed8a('0xb2')]=_0x21be02;return _0x309b1f;})[_0xed8a('0x29')](respondWithFilteredResult(_0x24b33a,_0x19e669))[_0xed8a('0x35')](handleError(_0x24b33a,null));};exports[_0xed8a('0xb3')]=function(_0xb2db1c,_0x137c2f){var _0xfa86f7={'raw':![],'where':{'id':_0xb2db1c[_0xed8a('0xb4')]['id']}},_0x15f67f={};_0x15f67f[_0xed8a('0x3a')]=_[_0xed8a('0x3b')](db['FaxInteraction'][_0xed8a('0x38')]);_0x15f67f[_0xed8a('0x3c')]=_[_0xed8a('0x3b')](_0xb2db1c[_0xed8a('0x3c')]);_0x15f67f[_0xed8a('0x3d')]=_[_0xed8a('0x3f')](_0x15f67f[_0xed8a('0x3a')],_0x15f67f[_0xed8a('0x3c')]);_0xfa86f7[_0xed8a('0x3e')]=_[_0xed8a('0x3f')](_0x15f67f['model'],qs[_0xed8a('0x40')](_0xb2db1c['query'][_0xed8a('0x40')]));_0xfa86f7[_0xed8a('0x3e')]=_0xfa86f7['attributes']['length']?_0xfa86f7[_0xed8a('0x3e')]:_0x15f67f[_0xed8a('0x3a')];if(_0xb2db1c[_0xed8a('0x3c')][_0xed8a('0xb5')]){_0xfa86f7['include']=[{'all':!![]}];}_0xfa86f7=_[_0xed8a('0x9b')]({},_0xfa86f7,_0xb2db1c[_0xed8a('0xb6')]);return db[_0xed8a('0x9c')][_0xed8a('0x5f')](_0xfa86f7)[_0xed8a('0x29')](handleEntityNotFound(_0x137c2f,null))['then'](respondWithResult(_0x137c2f,null))[_0xed8a('0x35')](handleError(_0x137c2f,null));};exports[_0xed8a('0xb7')]=function(_0x5a77c1,_0x152e0a){return db[_0xed8a('0x9c')]['create'](_0x5a77c1['body'],{})[_0xed8a('0x29')](respondWithResult(_0x152e0a,0xc9))[_0xed8a('0x35')](handleError(_0x152e0a,null));};exports[_0xed8a('0x28')]=function(_0x34cdf9,_0x3f886a){if(_0x34cdf9[_0xed8a('0x74')]['id']){delete _0x34cdf9['body']['id'];}return db[_0xed8a('0x9c')][_0xed8a('0x5f')]({'where':{'id':_0x34cdf9['params']['id']}})['then'](handleEntityNotFound(_0x3f886a,null))[_0xed8a('0x29')](saveUpdates(_0x34cdf9[_0xed8a('0x74')],null))['then'](respondWithResult(_0x3f886a,null))[_0xed8a('0x35')](handleError(_0x3f886a,null));};exports[_0xed8a('0x2a')]=function(_0x4a4a34,_0x47e48e){return db['FaxInteraction']['find']({'where':{'id':_0x4a4a34['params']['id']}})['then'](handleEntityNotFound(_0x47e48e,null))[_0xed8a('0x29')](removeEntity(_0x47e48e,null))[_0xed8a('0x35')](handleError(_0x47e48e,null));};exports[_0xed8a('0xb8')]=function(_0x9790ee,_0x412a94){return db[_0xed8a('0x9c')]['describe']()['then'](respondWithResult(_0x412a94,null))[_0xed8a('0x35')](handleError(_0x412a94,null));};exports[_0xed8a('0xb9')]=function(_0x5b5108,_0xfeaf17,_0x1ab48a){return db[_0xed8a('0xba')][_0xed8a('0x5f')]({'where':{'id':_0x5b5108['params']['id']}})[_0xed8a('0x29')](handleEntityNotFound(_0xfeaf17,null))[_0xed8a('0x29')](function(_0x4a544b){if(_0x4a544b){return _0x4a544b['addMessage'](_0x5b5108[_0xed8a('0x74')][_0xed8a('0xbb')],_['omit'](_0x5b5108['body'],[_0xed8a('0xbb'),'id'])||{});}})[_0xed8a('0x29')](respondWithResult(_0xfeaf17,null))['catch'](handleError(_0xfeaf17,null));};exports['getMessages']=function(_0xc09c53,_0x4e49f2,_0x58f24c){var _0x428ef5={'raw':![],'where':{}};var _0xbcaa5b={};var _0x407ad9={'count':0x0,'rows':[]};return db[_0xed8a('0x9c')][_0xed8a('0xbc')]({'where':{'id':_0xc09c53[_0xed8a('0xb4')]['id']}})[_0xed8a('0x29')](handleEntityNotFound(_0x4e49f2,null))[_0xed8a('0x29')](function(_0x4da83e){if(_0x4da83e){_0xbcaa5b[_0xed8a('0x3a')]=_[_0xed8a('0x3b')](db[_0xed8a('0xba')][_0xed8a('0x38')]);_0xbcaa5b['query']=_[_0xed8a('0x3b')](_0xc09c53['query']);_0xbcaa5b[_0xed8a('0x3d')]=_[_0xed8a('0x3f')](_0xbcaa5b[_0xed8a('0x3a')],_0xbcaa5b[_0xed8a('0x3c')]);_0x428ef5[_0xed8a('0x3e')]=_[_0xed8a('0x3f')](_0xbcaa5b[_0xed8a('0x3a')],qs['fields'](_0xc09c53['query'][_0xed8a('0x40')]));_0x428ef5[_0xed8a('0x3e')]=_0x428ef5['attributes']['length']?_0x428ef5['attributes']:_0xbcaa5b['model'];if(!_0xc09c53[_0xed8a('0x3c')][_0xed8a('0x42')](_0xed8a('0x43'))){_0x428ef5[_0xed8a('0x1f')]=qs[_0xed8a('0x1f')](_0xc09c53[_0xed8a('0x3c')][_0xed8a('0x1f')]);_0x428ef5['offset']=qs['offset'](_0xc09c53[_0xed8a('0x3c')][_0xed8a('0x21')]);}_0x428ef5[_0xed8a('0x90')]=qs[_0xed8a('0x44')](_0xc09c53[_0xed8a('0x3c')][_0xed8a('0x44')]);_0x428ef5[_0xed8a('0x45')]=qs[_0xed8a('0x3d')](_[_0xed8a('0x46')](_0xc09c53['query'],_0xbcaa5b[_0xed8a('0x3d')]));_0x428ef5[_0xed8a('0x45')][_0xed8a('0xb0')]=_0x4da83e['id'];if(_0xc09c53['query'][_0xed8a('0x85')]){_0x428ef5[_0xed8a('0x45')]=_[_0xed8a('0x9b')](_0x428ef5[_0xed8a('0x45')],{'$or':_[_0xed8a('0x37')](_0x428ef5[_0xed8a('0x3e')],function(_0x1e6155){var _0x33c2d7={};_0x33c2d7[_0x1e6155]={'$like':'%'+_0xc09c53[_0xed8a('0x3c')]['filter']+'%'};return _0x33c2d7;})});}if(_0xc09c53[_0xed8a('0x3c')][_0xed8a('0x7b')]){var _0x2ab4c6=_0xc09c53[_0xed8a('0x3c')][_0xed8a('0x7b')][_0xed8a('0x68')](',');var _0x5758f4={};_0x5758f4[_0x2ab4c6[0x0]]={'$gte':moment(_0x2ab4c6[0x1])['format'](_0xed8a('0xbd'))};_0x428ef5[_0xed8a('0x45')]=_[_0xed8a('0x9b')](_0x428ef5[_0xed8a('0x45')],_0x5758f4);}_0x428ef5=_[_0xed8a('0x9b')]({},_0x428ef5,_0xc09c53[_0xed8a('0xb6')]);return db[_0xed8a('0xba')][_0xed8a('0x20')]({'where':_0x428ef5[_0xed8a('0x45')]})[_0xed8a('0x29')](function(_0x3a9f7c){_0x407ad9[_0xed8a('0x20')]=_0x3a9f7c;if(_0xc09c53[_0xed8a('0x3c')]['includeAll']){_0x428ef5[_0xed8a('0xbe')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x428ef5);})[_0xed8a('0x29')](function(_0x2fe074){_0x407ad9[_0xed8a('0xb2')]=_0x2fe074;return _0x407ad9;});}})[_0xed8a('0x29')](respondWithFilteredResult(_0x4e49f2,_0x428ef5))['catch'](handleError(_0x4e49f2,null));};exports[_0xed8a('0xbf')]=function(_0x1b5303,_0x145172,_0x2160bc){return db['FaxInteraction']['find']({'where':{'id':_0x1b5303[_0xed8a('0xb4')]['id']}})[_0xed8a('0x29')](handleEntityNotFound(_0x145172,null))[_0xed8a('0x29')](function(_0x85dfab){if(_0x85dfab){return _0x85dfab['setTags'](_0x1b5303['body'][_0xed8a('0xbb')],_[_0xed8a('0xc0')](_0x1b5303[_0xed8a('0x74')],[_0xed8a('0xbb'),'id'])||{})[_0xed8a('0xc1')](function(){return db[_0xed8a('0xc2')][_0xed8a('0xc3')]({'attributes':['id',_0xed8a('0x2d'),_0xed8a('0x49')],'where':{'id':_0x1b5303[_0xed8a('0x74')][_0xed8a('0xbb')]}});})[_0xed8a('0x29')](function(_0x42afb7){socket['emit']('faxInteractionTags:save',{'id':Number(_0x1b5303[_0xed8a('0xb4')]['id']),'tags':_0x42afb7||[]});return{'id':Number(_0x1b5303[_0xed8a('0xb4')]['id']),'tags':_0x42afb7||[]};});}})['then'](respondWithResult(_0x145172,null))[_0xed8a('0x35')](handleError(_0x145172,null));};exports[_0xed8a('0xc4')]=function(_0x5434be,_0xddb2ba,_0x2a2117){return db['FaxInteraction'][_0xed8a('0x5f')]({'where':{'id':_0x5434be[_0xed8a('0xb4')]['id']}})[_0xed8a('0x29')](handleEntityNotFound(_0xddb2ba,null))[_0xed8a('0x29')](function(_0x56e40a){if(_0x56e40a){return _0x56e40a[_0xed8a('0xc4')](_0x5434be['query'][_0xed8a('0xbb')]);}})[_0xed8a('0x29')](respondWithStatusCode(_0xddb2ba,null))['catch'](handleError(_0xddb2ba,null));};exports['download']=function(_0x38c8d7,_0x334138){var _0x42a8f8=moment()[_0xed8a('0xc5')]()['toString']();var _0x1ecca2=path['join'](config[_0xed8a('0xc6')],_0xed8a('0xc7'),_0xed8a('0xc8'),'tmp');var _0x5eb0fe=path['join'](config[_0xed8a('0xc6')],_0xed8a('0xc7'),_0xed8a('0xc8'),_0xed8a('0xc9'));var _0x2cf733=path[_0xed8a('0xca')](_0x1ecca2,_0x42a8f8);var _0x46bfa0=util[_0xed8a('0xcb')](_0xed8a('0xcc'),_0x38c8d7[_0xed8a('0xb4')]['id'],_0x42a8f8);var _0x5840e1=path['join'](_0x1ecca2,_0x46bfa0);var _0x2d1d24=[];_0x2d1d24[_0xed8a('0x34')]({'model':db[_0xed8a('0xcd')],'as':_0xed8a('0xcd'),'raw':!![]});var _0x45b161=[{'model':db[_0xed8a('0xba')],'as':_0xed8a('0xce'),'attributes':['id',_0xed8a('0x74'),_0xed8a('0x79')],'include':_0x2d1d24}];return db[_0xed8a('0x9c')][_0xed8a('0x5f')]({'where':{'id':_0x38c8d7[_0xed8a('0xb4')]['id']},'include':_0x45b161})[_0xed8a('0x29')](handleEntityNotFound(_0x334138,null))['then'](function(_0x3dbadf){if(_0x3dbadf&&_0x3dbadf[_0xed8a('0xce')]){var _0x236701=_0x3dbadf[_0xed8a('0xcf')]({'plain':!![]});fs['mkdirSync'](_0x2cf733);for(var _0x3219a2=0x0;_0x3219a2<_0x236701[_0xed8a('0xce')][_0xed8a('0x41')];_0x3219a2++){var _0x39a2c2=_0x236701[_0xed8a('0xce')][_0x3219a2][_0xed8a('0xcd')];if(_0x39a2c2){var _0x35dd38=path['join'](_0x5eb0fe,_0x39a2c2[_0xed8a('0xd0')]);if(fs['existsSync'](_0x35dd38)){fs[_0xed8a('0xd1')](_0x35dd38)[_0xed8a('0xd2')](fs['createWriteStream'](path[_0xed8a('0xca')](_0x2cf733,_0x39a2c2[_0xed8a('0xd0')])));}}}return BPromise[_0xed8a('0xd3')]()['then'](function(){return new BPromise(function(_0x3ec906,_0x209456){zipdir(_0x2cf733,{'saveTo':_0x5840e1},function(_0x5aa041,_0x540ea0){if(_0x5aa041)return _0x209456(_0x5aa041);return _0x3ec906(_0x540ea0);});})['then'](function(){return new BPromise(function(_0x549794,_0x2b5d48){rimraf(_0x2cf733,function(_0x1acc62){if(_0x1acc62)_0x2b5d48(_0x1acc62);return _0x549794();});});})['then'](function(){return _0x334138[_0xed8a('0xd4')](_0x5840e1,_0x46bfa0,function(_0x2d4bcf){if(_0x2d4bcf){console[_0xed8a('0xd5')](_0xed8a('0xd6'),_0x2d4bcf);}else{fs[_0xed8a('0xd7')](_0x5840e1);}});});});}else{return _0x334138[_0xed8a('0x1c')](0xc8);}})[_0xed8a('0x35')](handleError(_0x334138,null));};
\ No newline at end of file
+var _0x4b0b=['./faxInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','destroy','stack','name','TagIds','split','forEach','push','then','index','map','FaxInteraction','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','FaxInteractionId','all','rows','rawAttributes','include','options','catch','update','params','describe','FaxMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','pipe','createWriteStream','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x4b0b,0x190));var _0xb4b0=function(_0x4ab29b,_0x360c6f){_0x4ab29b=_0x4ab29b-0x0;var _0x535e1b=_0x4b0b[_0x4ab29b];return _0x535e1b;};'use strict';var emlformat=require(_0xb4b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4b0('0x1'));var jsonpatch=require(_0xb4b0('0x2'));var rp=require('request-promise');var moment=require(_0xb4b0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb4b0('0x4'));var util=require(_0xb4b0('0x5'));var path=require(_0xb4b0('0x6'));var sox=require(_0xb4b0('0x7'));var csv=require(_0xb4b0('0x8'));var ejs=require(_0xb4b0('0x9'));var fs=require('fs');var fs_extra=require(_0xb4b0('0xa'));var _=require(_0xb4b0('0xb'));var squel=require(_0xb4b0('0xc'));var crypto=require('crypto');var jsforce=require(_0xb4b0('0xd'));var deskjs=require(_0xb4b0('0xe'));var toCsv=require(_0xb4b0('0x8'));var querystring=require(_0xb4b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xb4b0('0x10'));var authService=require(_0xb4b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb4b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb4b0('0x13'))(_0xb4b0('0x14'));var utils=require(_0xb4b0('0x15'));var config=require(_0xb4b0('0x16'));var licenseUtil=require(_0xb4b0('0x17'));var db=require(_0xb4b0('0x18'))['db'];config['redis']=_['defaults'](config[_0xb4b0('0x19')],{'host':_0xb4b0('0x1a'),'port':0x18eb});var socket=require(_0xb4b0('0x1b'))(new Redis(config[_0xb4b0('0x19')]));require(_0xb4b0('0x1c'))[_0xb4b0('0x1d')](socket);function respondWithStatusCode(_0x2e1f36,_0x240685){_0x240685=_0x240685||0xcc;return function(_0x5bd97a){if(_0x5bd97a){return _0x2e1f36[_0xb4b0('0x1e')](_0x240685);}return _0x2e1f36[_0xb4b0('0x1f')](_0x240685)[_0xb4b0('0x20')]();};}function respondWithResult(_0x47b859,_0xbd5fd4){_0xbd5fd4=_0xbd5fd4||0xc8;return function(_0x3b2cb8){if(_0x3b2cb8){return _0x47b859['status'](_0xbd5fd4)[_0xb4b0('0x21')](_0x3b2cb8);}};}function respondWithFilteredResult(_0x3c49e1,_0x45b2c0){return function(_0x5223e2){if(_0x5223e2){var _0x393a9e=typeof _0x45b2c0['offset']===_0xb4b0('0x22')&&typeof _0x45b2c0['limit']===_0xb4b0('0x22');var _0x3cb270=_0x5223e2[_0xb4b0('0x23')];var _0x15fe5a=_0x393a9e?0x0:_0x45b2c0[_0xb4b0('0x24')];var _0x2b2dc6=_0x393a9e?_0x5223e2[_0xb4b0('0x23')]:_0x45b2c0[_0xb4b0('0x24')]+_0x45b2c0['limit'];var _0x4b5bda;if(_0x2b2dc6>=_0x3cb270){_0x2b2dc6=_0x3cb270;_0x4b5bda=0xc8;}else{_0x4b5bda=0xce;}_0x3c49e1[_0xb4b0('0x1f')](_0x4b5bda);return _0x3c49e1[_0xb4b0('0x25')](_0xb4b0('0x26'),_0x15fe5a+'-'+_0x2b2dc6+'/'+_0x3cb270)[_0xb4b0('0x21')](_0x5223e2);}return null;};}function patchUpdates(_0x4d8340){return function(_0x571841){try{jsonpatch['apply'](_0x571841,_0x4d8340,!![]);}catch(_0x568c13){return BPromise[_0xb4b0('0x27')](_0x568c13);}return _0x571841[_0xb4b0('0x28')]();};}function saveUpdates(_0x2b6cc7,_0x3fcf6e){return function(_0x17b1d1){if(_0x17b1d1){return _0x17b1d1['update'](_0x2b6cc7)['then'](function(_0xba16ea){return _0xba16ea;});}return null;};}function removeEntity(_0x126830,_0x4d1c1b){return function(_0x3f37bb){if(_0x3f37bb){return _0x3f37bb[_0xb4b0('0x29')]()['then'](function(){_0x126830['status'](0xcc)[_0xb4b0('0x20')]();});}};}function handleEntityNotFound(_0x55155c,_0x33d774){return function(_0x5f207b){if(!_0x5f207b){_0x55155c[_0xb4b0('0x1e')](0x194);}return _0x5f207b;};}function handleError(_0x4c5c64,_0x1f15e9){_0x1f15e9=_0x1f15e9||0x1f4;return function(_0x53c189){logger['error'](_0x53c189[_0xb4b0('0x2a')]);if(_0x53c189[_0xb4b0('0x2b')]){delete _0x53c189[_0xb4b0('0x2b')];}_0x4c5c64[_0xb4b0('0x1f')](_0x1f15e9)['send'](_0x53c189);};}function getInteractionUsers(_0x2b19fd,_0x5bb93e){return new BPromise(function(_0x40de38,_0x4df83b){try{if(_0x5bb93e[_0x2b19fd['id']]){_0x2b19fd['Users']=_['map'](_0x5bb93e[_0x2b19fd['id']],function(_0x4d7b56){return{'id':_0x4d7b56['id'],'fullname':_0x4d7b56['fullname']};});}}catch(_0xd74337){_0x4df83b(_0xd74337);}_0x40de38(_0x2b19fd);});}function getInteractionTags(_0x389a21,_0x50c3f6){return new BPromise(function(_0x48cca6,_0x3bc259){try{if(_0x389a21[_0xb4b0('0x2c')]){_0x389a21['Tags']=[];_0x389a21[_0xb4b0('0x2c')][_0xb4b0('0x2d')](',')[_0xb4b0('0x2e')](function(_0x338d3f){_0x389a21['Tags'][_0xb4b0('0x2f')](_0x50c3f6[_0x338d3f]);});}delete _0x389a21[_0xb4b0('0x2c')];}catch(_0x4ac0e2){_0x3bc259(_0x4ac0e2);}_0x48cca6(_0x389a21);});}function updateFaxInteraction(_0x4691dc,_0x3d2546,_0x3acc8d){return new BPromise(function(_0x4a9c5c,_0x46db76){return getInteractionUsers(_0x4691dc,_0x3acc8d)[_0xb4b0('0x30')](function(_0xcdb0c2){return getInteractionTags(_0xcdb0c2,_0x3d2546);})[_0xb4b0('0x30')](function(_0x31885c){_0x4a9c5c(_0x31885c);})['catch'](function(_0x19e885){_0x46db76(_0x19e885);});});}exports[_0xb4b0('0x31')]=function(_0x49ad5e,_0x4c75b2){var _0x509f64={},_0x1725e5={},_0x903016={'count':0x0,'rows':[]};var _0xe46b33=_[_0xb4b0('0x32')](db[_0xb4b0('0x33')]['rawAttributes'],function(_0x109785){return{'name':_0x109785[_0xb4b0('0x34')],'type':_0x109785[_0xb4b0('0x35')]['key']};});_0x1725e5[_0xb4b0('0x36')]=_['map'](_0xe46b33,_0xb4b0('0x2b'));_0x1725e5[_0xb4b0('0x37')]=_[_0xb4b0('0x38')](_0x49ad5e[_0xb4b0('0x37')]);_0x1725e5[_0xb4b0('0x39')]=_[_0xb4b0('0x3a')](_0x1725e5[_0xb4b0('0x36')],_0x1725e5[_0xb4b0('0x37')]);_0x509f64['attributes']=_[_0xb4b0('0x3a')](_0x1725e5[_0xb4b0('0x36')],qs[_0xb4b0('0x3b')](_0x49ad5e['query'][_0xb4b0('0x3b')]));_0x509f64[_0xb4b0('0x3c')]=_0x509f64[_0xb4b0('0x3c')][_0xb4b0('0x3d')]?_0x509f64['attributes']:_0x1725e5[_0xb4b0('0x36')];if(!_0x49ad5e[_0xb4b0('0x37')]['hasOwnProperty'](_0xb4b0('0x3e'))){_0x509f64['limit']=qs[_0xb4b0('0x3f')](_0x49ad5e[_0xb4b0('0x37')]['limit']);_0x509f64['offset']=qs['offset'](_0x49ad5e[_0xb4b0('0x37')][_0xb4b0('0x24')]);}_0x509f64[_0xb4b0('0x40')]=qs[_0xb4b0('0x41')](_0x49ad5e['query'][_0xb4b0('0x41')]);_0x509f64[_0xb4b0('0x42')]=qs[_0xb4b0('0x39')](_[_0xb4b0('0x43')](_0x49ad5e[_0xb4b0('0x37')],_0x1725e5[_0xb4b0('0x39')]),_0xe46b33);var _0x57265c=[];var _0x37ce07=squel[_0xb4b0('0x44')]()[_0xb4b0('0x45')]('id')[_0xb4b0('0x45')](_0xb4b0('0x2b'))[_0xb4b0('0x45')](_0xb4b0('0x46'))[_0xb4b0('0x47')](_0xb4b0('0x48'));var _0x5ef419=squel[_0xb4b0('0x44')]()[_0xb4b0('0x45')](_0xb4b0('0x49'))['field'](_0xb4b0('0x4a'))[_0xb4b0('0x45')](_0xb4b0('0x4b'))['from']('user_has_fax_interactions','ui')[_0xb4b0('0x4c')]('users','u',_0xb4b0('0x4d'));var _0x40ccbe=squel[_0xb4b0('0x44')]()[_0xb4b0('0x47')](_0xb4b0('0x4e'),'i')['left_join'](_0xb4b0('0x4f'),'c',_0xb4b0('0x50'))[_0xb4b0('0x4c')](_0xb4b0('0x51'),'o',_0xb4b0('0x52'))['left_join'](_0xb4b0('0x53'),'a',_0xb4b0('0x54'))['left_join'](_0xb4b0('0x55'),'me',_0xb4b0('0x56'))['left_join'](_0xb4b0('0x57'),'it',_0xb4b0('0x58'))[_0xb4b0('0x4c')]('tools_tags','t',_0xb4b0('0x59'));var _0x2f85c7=squel[_0xb4b0('0x5a')]();var _0xa617d2=[];var _0xad3cb2=squel[_0xb4b0('0x5a')]();var _0x13d5e4;if(_0x49ad5e['query'][_0xb4b0('0x5b')]){_0x13d5e4=as[_0xb4b0('0x5c')](_0x49ad5e[_0xb4b0('0x37')][_0xb4b0('0x5b')]);var _0x406405=_0x13d5e4[_0xb4b0('0x5d')];for(var _0x1557c5=0x0;_0x1557c5<_0x13d5e4[_0xb4b0('0x5e')][_0xb4b0('0x3d')];_0x1557c5++){var _0x5de634=_0x13d5e4[_0xb4b0('0x5e')][_0x1557c5];var _0x5e04f2='i';var _0xc9315e=_[_0xb4b0('0x5f')](_0xe46b33,['name',_0x5de634[_0xb4b0('0x45')]]);if(!_0xc9315e){switch(_0x5de634['field']){case _0xb4b0('0x60'):if(_0x5de634[_0xb4b0('0x61')]==0x1){_0x40ccbe['having']('`'+_0x5de634['field']+_0xb4b0('0x62'));}else{_0x40ccbe[_0xb4b0('0x63')]('`'+_0x5de634[_0xb4b0('0x45')]+_0xb4b0('0x64'));}break;case _0xb4b0('0x65'):if(_0x5de634[_0xb4b0('0x66')]===_0xb4b0('0x67')){if(_0x5de634['value'][_0xb4b0('0x2d')]('\x20')[_0xb4b0('0x3d')]>0x1){_0x2f85c7[_0x406405]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb4b0('0x68')](_0x5de634[_0xb4b0('0x61')]),null);}else{var _0x5d6255='%'+_0x5de634[_0xb4b0('0x61')]+'%';_0x2f85c7[_0x406405](_0xb4b0('0x69'),_0x5d6255,_0x5d6255,_0x5d6255);}}else{_0xc9315e=_[_0xb4b0('0x5f')](_0xe46b33,[_0xb4b0('0x2b'),_0xb4b0('0x6a')]);_0x5de634[_0xb4b0('0x45')]=_0xb4b0('0x6a');_0x5025ba=as[_0xb4b0('0x6b')](_0x5e04f2,_0xc9315e['type'],_0x5de634);_0x2f85c7[_0x406405](_0x5025ba[_0xb4b0('0x6c')],_0x5025ba[_0xb4b0('0x61')][_0xb4b0('0x6d')],_0x5025ba[_0xb4b0('0x61')][_0xb4b0('0x20')]);}break;case'Tag':var _0x5ee9fc=_0x5de634[_0xb4b0('0x61')][_0xb4b0('0x2d')](',')[_0xb4b0('0x32')](function(_0x5ad4c9){return Number(_0x5ad4c9);});_0x5ee9fc[_0xb4b0('0x2e')](function(_0x2451db){_0xad3cb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2451db+',%');});_0xa617d2=_[_0xb4b0('0x6e')](_0xa617d2,_0x5ee9fc);break;case _0xb4b0('0x6f'):if(_0x5de634[_0xb4b0('0x66')]===_0xb4b0('0x67')){_0x2f85c7[_0x406405](_0xb4b0('0x70'),'%'+_0x5de634[_0xb4b0('0x61')]+'%',null);}else{_0xc9315e=_[_0xb4b0('0x5f')](_0xe46b33,[_0xb4b0('0x2b'),_0xb4b0('0x71')]);_0x5de634['field']=_0xb4b0('0x71');_0x5025ba=as['buildExpression'](_0x5e04f2,_0xc9315e[_0xb4b0('0x35')],_0x5de634);_0x2f85c7[_0x406405](_0x5025ba['text'],_0x5025ba[_0xb4b0('0x61')]['start'],_0x5025ba[_0xb4b0('0x61')]['end']);}break;case _0xb4b0('0x72'):_0x5025ba=as[_0xb4b0('0x6b')]('me',null,_0x5de634);_0x2f85c7[_0x406405](_0x5025ba[_0xb4b0('0x6c')],_0x5025ba[_0xb4b0('0x61')][_0xb4b0('0x6d')],_0x5025ba[_0xb4b0('0x61')][_0xb4b0('0x20')]);break;}}else{var _0x5025ba=as[_0xb4b0('0x6b')](_0x5e04f2,_0xc9315e[_0xb4b0('0x35')],_0x5de634);_0x2f85c7[_0x406405](_0x5025ba[_0xb4b0('0x6c')],_0x5025ba[_0xb4b0('0x61')][_0xb4b0('0x6d')],_0x5025ba[_0xb4b0('0x61')]['end']);}}}else{var _0x11c3e0=_(_0x49ad5e[_0xb4b0('0x37')])[_0xb4b0('0x38')]()[_0xb4b0('0x32')](function(_0x55a148){return _['some'](_0xe46b33,['name',_0x55a148])?_0x55a148:undefined;})[_0xb4b0('0x73')]()[_0xb4b0('0x61')]();if(!_[_0xb4b0('0x74')](_0x11c3e0)){_0x11c3e0[_0xb4b0('0x2e')](function(_0xd83e7a){if(_0xd83e7a===_0xb4b0('0x75')){_0x40ccbe[_0xb4b0('0x42')](_0xb4b0('0x76'),[][_0xb4b0('0x77')](_0x49ad5e[_0xb4b0('0x37')][_0xd83e7a]));}else if(_0xd83e7a===_0xb4b0('0x78')){var _0x5cf5ec=JSON[_0xb4b0('0x79')](_0x49ad5e[_0xb4b0('0x37')][_0xd83e7a])[_0xb4b0('0x7a')];var _0x40a100=JSON['parse'](_0x49ad5e[_0xb4b0('0x37')][_0xd83e7a])[_0xb4b0('0x7b')];_0x40ccbe[_0xb4b0('0x42')](_0xb4b0('0x7c'),_0x5cf5ec,_0x40a100);}else{if(_0x49ad5e['query'][_0xd83e7a]===_0xb4b0('0x7d')){_0x40ccbe['where']('i.'+_0xd83e7a+_0xb4b0('0x7e'));}else{_0x40ccbe['where']('i.'+_0xd83e7a+_0xb4b0('0x7f'),_0x49ad5e[_0xb4b0('0x37')][_0xd83e7a]);}}});}if(_0x49ad5e['query'][_0xb4b0('0x80')]){if(_0x49ad5e[_0xb4b0('0x37')]['read']==0x1){_0x40ccbe[_0xb4b0('0x63')]('`unreadMessages`\x20=\x200');}else{_0x40ccbe[_0xb4b0('0x63')](_0xb4b0('0x81'));}}if(_0x49ad5e[_0xb4b0('0x37')][_0xb4b0('0x82')]){_0xa617d2=_[_0xb4b0('0x83')](_0x49ad5e['query'][_0xb4b0('0x82')])?_0x49ad5e[_0xb4b0('0x37')][_0xb4b0('0x82')]:new Array(_0x49ad5e[_0xb4b0('0x37')]['tag']);_0xa617d2[_0xb4b0('0x2e')](function(_0x5196ca){_0xad3cb2['or'](_0xb4b0('0x84'),'%,'+_0x5196ca+',%');});}if(_0x49ad5e[_0xb4b0('0x37')][_0xb4b0('0x85')]){var _0x3edf0a=_0x49ad5e[_0xb4b0('0x37')]['filter'][_0xb4b0('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xb4b0('0x87')](_0x3edf0a)){_0x2f85c7['or'](_0xb4b0('0x88'),_0x3edf0a+'%')['or']('i.fax\x20LIKE\x20?',_0x3edf0a+'%');}_0x2f85c7['or'](_0xb4b0('0x89'),_0x3edf0a+'%');}}_0x40ccbe[_0xb4b0('0x42')](_0x2f85c7);_0x40ccbe[_0xb4b0('0x8a')](_0xb4b0('0x8b'));var _0x32044f={'type':db[_0xb4b0('0x8c')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1a4438=_0x40ccbe[_0xb4b0('0x8d')]();_0x1a4438[_0xb4b0('0x45')](_0xb4b0('0x8b'));_0x1a4438[_0xb4b0('0x45')](_0xb4b0('0x8e'),_0xb4b0('0x60'));if(_0x509f64['order']){_0x509f64[_0xb4b0('0x40')][_0xb4b0('0x2e')](function(_0x5bd1ec){var _0x5dc8ee=_0x5bd1ec[0x0]===_0xb4b0('0x8f')?_0x5bd1ec[0x0]:'i.'+_0x5bd1ec[0x0];_0x40ccbe['order'](_0x5dc8ee,_0x5bd1ec[0x1]==='DESC'?![]:!![]);});}if(!_[_0xb4b0('0x74')](_0xa617d2)){_0x40ccbe['having'](_0xad3cb2);_0x1a4438['where'](_0xb4b0('0x90'),_0xa617d2);}BPromise[_0xb4b0('0x91')]()['then'](function(){if(!_0x13d5e4){if(_0x49ad5e[_0xb4b0('0x37')]['FaxAccountId'])return;_0x1a4438[_0xb4b0('0x42')](_0xb4b0('0x92'));_0x40ccbe[_0xb4b0('0x42')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x49ad5e[_0xb4b0('0x93')][_0xb4b0('0x94')]!==_0xb4b0('0x95'))return;return _0x49ad5e['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xb4b0('0x30')](function(_0x596947){if(_[_0xb4b0('0x74')](_0x596947)){_0x1a4438[_0xb4b0('0x42')](_0xb4b0('0x96'));_0x40ccbe[_0xb4b0('0x42')](_0xb4b0('0x96'));}else{_0x1a4438[_0xb4b0('0x42')](_0xb4b0('0x76'),_[_0xb4b0('0x32')](_0x596947,'id'));_0x40ccbe[_0xb4b0('0x42')]('i.FaxAccountId\x20IN\x20?',_[_0xb4b0('0x32')](_0x596947,'id'));}});})[_0xb4b0('0x30')](function(){if(_0x49ad5e[_0xb4b0('0x93')][_0xb4b0('0x94')]===_0xb4b0('0x95')&&!_0x13d5e4&&!_0x49ad5e[_0xb4b0('0x37')]['FaxAccountId'])return[];return db[_0xb4b0('0x97')][_0xb4b0('0x37')](_0x1a4438[_0xb4b0('0x98')](),_0x32044f);})[_0xb4b0('0x30')](function(_0x5cbc0f){_0x903016[_0xb4b0('0x23')]=_0x5cbc0f[_0xb4b0('0x3d')];if(_0x903016[_0xb4b0('0x23')]===0x0)return[];return db[_0xb4b0('0x97')]['query'](_0x37ce07[_0xb4b0('0x98')](),_0x32044f)['then'](function(_0x2a92b9){_0x57265c=_[_0xb4b0('0x99')](_0x2a92b9,'id');_0x32044f=_[_0xb4b0('0x9a')](_0x32044f,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49ad5e[_0xb4b0('0x37')]['fields']){_0x509f64['attributes'][_0xb4b0('0x2e')](function(_0x4fe733){_0x40ccbe[_0xb4b0('0x45')]('i.'+_0x4fe733);});}else{_0x40ccbe['field'](_0xb4b0('0x8e'),'unreadMessages');_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0x9b'),'Account.key');_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0x9c'),'Account.mandatoryDisposition');_0x40ccbe[_0xb4b0('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');_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0x9d'));_0x40ccbe['field']('c.firstName',_0xb4b0('0x9e'));_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0x9f'),_0xb4b0('0xa0'));_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0xa1'),_0xb4b0('0xa2'));_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0xa3'),'Contact.phone');_0x40ccbe[_0xb4b0('0x45')]('c.mobile',_0xb4b0('0xa4'));_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0xa5'),'Contact.fax');_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0xa6'),_0xb4b0('0xa7'));_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0xa8'),_0xb4b0('0xa9'));_0x40ccbe[_0xb4b0('0x45')](_0xb4b0('0xaa'),'TagIds');}if(_0x509f64[_0xb4b0('0x3f')])_0x40ccbe[_0xb4b0('0x3f')](_0x509f64['limit']);if(_0x509f64[_0xb4b0('0x24')])_0x40ccbe[_0xb4b0('0x24')](_0x509f64[_0xb4b0('0x24')]);return db[_0xb4b0('0x97')]['query'](_0x40ccbe[_0xb4b0('0x98')](),_0x32044f);})['then'](function(_0x5cda9e){if(_0x5cda9e[_0xb4b0('0x3d')]>0x0)_0x5ef419[_0xb4b0('0x42')]('ui.FaxInteractionId\x20IN\x20?',_[_0xb4b0('0x32')](_0x5cda9e,'id'));return db[_0xb4b0('0x97')][_0xb4b0('0x37')](_0x5ef419[_0xb4b0('0x98')](),_0x32044f)['then'](function(_0x1efead){var _0x2925dd=_[_0xb4b0('0xab')](_0x1efead,_0xb4b0('0xac'));var _0x115527=[];_0x5cda9e[_0xb4b0('0x2e')](function(_0x25407f){_0x115527[_0xb4b0('0x2f')](updateFaxInteraction(_0x25407f,_0x57265c,_0x2925dd));});return BPromise[_0xb4b0('0xad')](_0x115527);});});})[_0xb4b0('0x30')](function(_0x301605){_0x903016[_0xb4b0('0xae')]=_0x301605;return _0x903016;})[_0xb4b0('0x30')](respondWithFilteredResult(_0x4c75b2,_0x509f64))['catch'](handleError(_0x4c75b2,null));};exports['show']=function(_0xd2c306,_0x1046e8){var _0xa3b6af={'raw':![],'where':{'id':_0xd2c306['params']['id']}},_0x444bd5={};_0x444bd5['model']=_[_0xb4b0('0x38')](db[_0xb4b0('0x33')][_0xb4b0('0xaf')]);_0x444bd5[_0xb4b0('0x37')]=_['keys'](_0xd2c306[_0xb4b0('0x37')]);_0x444bd5['filters']=_[_0xb4b0('0x3a')](_0x444bd5['model'],_0x444bd5[_0xb4b0('0x37')]);_0xa3b6af[_0xb4b0('0x3c')]=_[_0xb4b0('0x3a')](_0x444bd5[_0xb4b0('0x36')],qs[_0xb4b0('0x3b')](_0xd2c306['query'][_0xb4b0('0x3b')]));_0xa3b6af['attributes']=_0xa3b6af[_0xb4b0('0x3c')]['length']?_0xa3b6af[_0xb4b0('0x3c')]:_0x444bd5['model'];if(_0xd2c306[_0xb4b0('0x37')]['includeAll']){_0xa3b6af[_0xb4b0('0xb0')]=[{'all':!![]}];}_0xa3b6af=_['merge']({},_0xa3b6af,_0xd2c306[_0xb4b0('0xb1')]);return db['FaxInteraction']['find'](_0xa3b6af)[_0xb4b0('0x30')](handleEntityNotFound(_0x1046e8,null))['then'](respondWithResult(_0x1046e8,null))['catch'](handleError(_0x1046e8,null));};exports['create']=function(_0x1ec026,_0x45a1ce){return db['FaxInteraction']['create'](_0x1ec026[_0xb4b0('0x72')],{})[_0xb4b0('0x30')](respondWithResult(_0x45a1ce,0xc9))[_0xb4b0('0xb2')](handleError(_0x45a1ce,null));};exports[_0xb4b0('0xb3')]=function(_0xc81982,_0x48ee11){if(_0xc81982[_0xb4b0('0x72')]['id']){delete _0xc81982[_0xb4b0('0x72')]['id'];}return db['FaxInteraction'][_0xb4b0('0x5f')]({'where':{'id':_0xc81982[_0xb4b0('0xb4')]['id']}})[_0xb4b0('0x30')](handleEntityNotFound(_0x48ee11,null))[_0xb4b0('0x30')](saveUpdates(_0xc81982[_0xb4b0('0x72')],null))[_0xb4b0('0x30')](respondWithResult(_0x48ee11,null))[_0xb4b0('0xb2')](handleError(_0x48ee11,null));};exports[_0xb4b0('0x29')]=function(_0x50f6c9,_0x23a9c2){return db[_0xb4b0('0x33')][_0xb4b0('0x5f')]({'where':{'id':_0x50f6c9['params']['id']}})[_0xb4b0('0x30')](handleEntityNotFound(_0x23a9c2,null))[_0xb4b0('0x30')](removeEntity(_0x23a9c2,null))['catch'](handleError(_0x23a9c2,null));};exports[_0xb4b0('0xb5')]=function(_0x35666d,_0x1f0f68){return db['FaxInteraction'][_0xb4b0('0xb5')]()[_0xb4b0('0x30')](respondWithResult(_0x1f0f68,null))[_0xb4b0('0xb2')](handleError(_0x1f0f68,null));};exports['addMessage']=function(_0x493cd4,_0x3bc9f6,_0xf8d2cd){return db[_0xb4b0('0xb6')][_0xb4b0('0x5f')]({'where':{'id':_0x493cd4['params']['id']}})[_0xb4b0('0x30')](handleEntityNotFound(_0x3bc9f6,null))[_0xb4b0('0x30')](function(_0x22d3e7){if(_0x22d3e7){return _0x22d3e7[_0xb4b0('0xb7')](_0x493cd4[_0xb4b0('0x72')][_0xb4b0('0xb8')],_['omit'](_0x493cd4[_0xb4b0('0x72')],[_0xb4b0('0xb8'),'id'])||{});}})[_0xb4b0('0x30')](respondWithResult(_0x3bc9f6,null))[_0xb4b0('0xb2')](handleError(_0x3bc9f6,null));};exports[_0xb4b0('0xb9')]=function(_0x33cb83,_0x47cdaf,_0x394930){var _0x5269d9={'raw':![],'where':{}};var _0x4db3a2={};var _0x3f00a1={'count':0x0,'rows':[]};return db[_0xb4b0('0x33')][_0xb4b0('0xba')]({'where':{'id':_0x33cb83['params']['id']}})[_0xb4b0('0x30')](handleEntityNotFound(_0x47cdaf,null))[_0xb4b0('0x30')](function(_0x19cd95){if(_0x19cd95){_0x4db3a2[_0xb4b0('0x36')]=_['keys'](db['FaxMessage'][_0xb4b0('0xaf')]);_0x4db3a2[_0xb4b0('0x37')]=_[_0xb4b0('0x38')](_0x33cb83['query']);_0x4db3a2[_0xb4b0('0x39')]=_['intersection'](_0x4db3a2[_0xb4b0('0x36')],_0x4db3a2[_0xb4b0('0x37')]);_0x5269d9[_0xb4b0('0x3c')]=_['intersection'](_0x4db3a2[_0xb4b0('0x36')],qs['fields'](_0x33cb83[_0xb4b0('0x37')][_0xb4b0('0x3b')]));_0x5269d9[_0xb4b0('0x3c')]=_0x5269d9[_0xb4b0('0x3c')]['length']?_0x5269d9['attributes']:_0x4db3a2[_0xb4b0('0x36')];if(!_0x33cb83['query'][_0xb4b0('0xbb')](_0xb4b0('0x3e'))){_0x5269d9[_0xb4b0('0x3f')]=qs['limit'](_0x33cb83['query'][_0xb4b0('0x3f')]);_0x5269d9[_0xb4b0('0x24')]=qs[_0xb4b0('0x24')](_0x33cb83[_0xb4b0('0x37')][_0xb4b0('0x24')]);}_0x5269d9['order']=qs[_0xb4b0('0x41')](_0x33cb83[_0xb4b0('0x37')]['sort']);_0x5269d9['where']=qs[_0xb4b0('0x39')](_[_0xb4b0('0x43')](_0x33cb83[_0xb4b0('0x37')],_0x4db3a2[_0xb4b0('0x39')]));_0x5269d9[_0xb4b0('0x42')][_0xb4b0('0xac')]=_0x19cd95['id'];if(_0x33cb83[_0xb4b0('0x37')]['filter']){_0x5269d9['where']=_['merge'](_0x5269d9[_0xb4b0('0x42')],{'$or':_[_0xb4b0('0x32')](_0x5269d9[_0xb4b0('0x3c')],function(_0x22acb6){var _0x5870a7={};_0x5870a7[_0x22acb6]={'$like':'%'+_0x33cb83[_0xb4b0('0x37')][_0xb4b0('0x85')]+'%'};return _0x5870a7;})});}if(_0x33cb83['query'][_0xb4b0('0x7a')]){var _0x4a7e66=_0x33cb83['query']['$gte'][_0xb4b0('0x2d')](',');var _0x270626={};_0x270626[_0x4a7e66[0x0]]={'$gte':moment(_0x4a7e66[0x1])[_0xb4b0('0xbc')](_0xb4b0('0xbd'))};_0x5269d9[_0xb4b0('0x42')]=_[_0xb4b0('0x9a')](_0x5269d9['where'],_0x270626);}_0x5269d9=_[_0xb4b0('0x9a')]({},_0x5269d9,_0x33cb83[_0xb4b0('0xb1')]);return db[_0xb4b0('0xb6')]['count']({'where':_0x5269d9[_0xb4b0('0x42')]})['then'](function(_0x300c5d){_0x3f00a1[_0xb4b0('0x23')]=_0x300c5d;if(_0x33cb83[_0xb4b0('0x37')][_0xb4b0('0xbe')]){_0x5269d9['include']=[{'all':!![]}];}return db[_0xb4b0('0xb6')][_0xb4b0('0xbf')](_0x5269d9);})['then'](function(_0x252a64){_0x3f00a1[_0xb4b0('0xae')]=_0x252a64;return _0x3f00a1;});}})[_0xb4b0('0x30')](respondWithFilteredResult(_0x47cdaf,_0x5269d9))[_0xb4b0('0xb2')](handleError(_0x47cdaf,null));};exports['addTags']=function(_0x3ffa97,_0xf58f93,_0x44905e){return db[_0xb4b0('0x33')][_0xb4b0('0x5f')]({'where':{'id':_0x3ffa97[_0xb4b0('0xb4')]['id']}})['then'](handleEntityNotFound(_0xf58f93,null))['then'](function(_0x5d33a9){if(_0x5d33a9){return _0x5d33a9[_0xb4b0('0xc0')](_0x3ffa97[_0xb4b0('0x72')][_0xb4b0('0xb8')],_[_0xb4b0('0xc1')](_0x3ffa97[_0xb4b0('0x72')],[_0xb4b0('0xb8'),'id'])||{})[_0xb4b0('0xc2')](function(){return db['Tag'][_0xb4b0('0xbf')]({'attributes':['id',_0xb4b0('0x2b'),_0xb4b0('0x46')],'where':{'id':_0x3ffa97['body']['ids']}});})[_0xb4b0('0x30')](function(_0x30138a){socket[_0xb4b0('0xc3')](_0xb4b0('0xc4'),{'id':Number(_0x3ffa97['params']['id']),'tags':_0x30138a||[]});return{'id':Number(_0x3ffa97[_0xb4b0('0xb4')]['id']),'tags':_0x30138a||[]};});}})[_0xb4b0('0x30')](respondWithResult(_0xf58f93,null))[_0xb4b0('0xb2')](handleError(_0xf58f93,null));};exports[_0xb4b0('0xc5')]=function(_0x989e63,_0x499927,_0x55ecaa){return db['FaxInteraction'][_0xb4b0('0x5f')]({'where':{'id':_0x989e63[_0xb4b0('0xb4')]['id']}})['then'](handleEntityNotFound(_0x499927,null))[_0xb4b0('0x30')](function(_0x379f5e){if(_0x379f5e){return _0x379f5e[_0xb4b0('0xc5')](_0x989e63[_0xb4b0('0x37')][_0xb4b0('0xb8')]);}})[_0xb4b0('0x30')](respondWithStatusCode(_0x499927,null))['catch'](handleError(_0x499927,null));};exports[_0xb4b0('0xc6')]=function(_0x3c96e1,_0x8464aa){var _0x4862c1=moment()[_0xb4b0('0xc7')]()[_0xb4b0('0x98')]();var _0x48990d=path[_0xb4b0('0xc8')](config[_0xb4b0('0xc9')],_0xb4b0('0xca'),_0xb4b0('0xcb'),_0xb4b0('0xcc'));var _0x492b1f=path[_0xb4b0('0xc8')](config[_0xb4b0('0xc9')],'server',_0xb4b0('0xcb'),_0xb4b0('0xcd'));var _0x3bea98=path[_0xb4b0('0xc8')](_0x48990d,_0x4862c1);var _0x2229f4=util[_0xb4b0('0xbc')](_0xb4b0('0xce'),_0x3c96e1[_0xb4b0('0xb4')]['id'],_0x4862c1);var _0x30fd39=path[_0xb4b0('0xc8')](_0x48990d,_0x2229f4);var _0x2627ae=[];_0x2627ae[_0xb4b0('0x2f')]({'model':db[_0xb4b0('0xcf')],'as':_0xb4b0('0xcf'),'raw':!![]});var _0x472de6=[{'model':db[_0xb4b0('0xb6')],'as':_0xb4b0('0xd0'),'attributes':['id','body',_0xb4b0('0x78')],'include':_0x2627ae}];return db['FaxInteraction'][_0xb4b0('0x5f')]({'where':{'id':_0x3c96e1[_0xb4b0('0xb4')]['id']},'include':_0x472de6})['then'](handleEntityNotFound(_0x8464aa,null))['then'](function(_0x1fb39b){if(_0x1fb39b&&_0x1fb39b[_0xb4b0('0xd0')]){var _0x196a10=_0x1fb39b[_0xb4b0('0xd1')]({'plain':!![]});fs['mkdirSync'](_0x3bea98);for(var _0x13a585=0x0;_0x13a585<_0x196a10[_0xb4b0('0xd0')][_0xb4b0('0x3d')];_0x13a585++){var _0x4d53d1=_0x196a10[_0xb4b0('0xd0')][_0x13a585][_0xb4b0('0xcf')];if(_0x4d53d1){var _0x3bf971=path[_0xb4b0('0xc8')](_0x492b1f,_0x4d53d1[_0xb4b0('0xd2')]);if(fs[_0xb4b0('0xd3')](_0x3bf971)){fs['createReadStream'](_0x3bf971)[_0xb4b0('0xd4')](fs[_0xb4b0('0xd5')](path[_0xb4b0('0xc8')](_0x3bea98,_0x4d53d1[_0xb4b0('0xd2')])));}}}return BPromise[_0xb4b0('0x91')]()[_0xb4b0('0x30')](function(){return new BPromise(function(_0x2aa6d2,_0x5d4829){zipdir(_0x3bea98,{'saveTo':_0x30fd39},function(_0x432477,_0x2f6d48){if(_0x432477)return _0x5d4829(_0x432477);return _0x2aa6d2(_0x2f6d48);});})[_0xb4b0('0x30')](function(){return new BPromise(function(_0x17b980,_0x27ba7d){rimraf(_0x3bea98,function(_0x4f3b87){if(_0x4f3b87)_0x27ba7d(_0x4f3b87);return _0x17b980();});});})['then'](function(){return _0x8464aa[_0xb4b0('0xc6')](_0x30fd39,_0x2229f4,function(_0x24af61){if(_0x24af61){console['log']('err',_0x24af61);}else{fs['unlinkSync'](_0x30fd39);}});});});}else{return _0x8464aa[_0xb4b0('0x1e')](0xc8);}})['catch'](handleError(_0x8464aa,null));};
\ No newline at end of file
index 089822f..0711d78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f7=['getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','FaxInteraction','setMaxListeners','update','remove'];(function(_0x2b62d2,_0x3fce9b){var _0x22f790=function(_0x359734){while(--_0x359734){_0x2b62d2['push'](_0x2b62d2['shift']());}};_0x22f790(++_0x3fce9b);}(_0x73f7,0x16b));var _0x773f=function(_0x452f0e,_0x2fd0d4){_0x452f0e=_0x452f0e-0x0;var _0x323f96=_0x73f7[_0x452f0e];return _0x323f96;};'use strict';var EventEmitter=require(_0x773f('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x773f('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x773f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x773f('0x3'),'afterDestroy':_0x773f('0x4')};function emitEvent(_0x5b22fd){return function(_0x3c3c3d,_0xf4e147,_0x4713e7){_0x3c3c3d[_0x773f('0x5')]({'attributes':['id'],'raw':!![]})[_0x773f('0x6')](function(_0x30cdf6){_0x3c3c3d[_0x773f('0x7')]('Users',_0x30cdf6[_0x773f('0x8')](function(_0x4beca0){return{'id':_0x4beca0['id']};}));return FaxMessage[_0x773f('0x9')]({'where':{'FaxInteractionId':_0x3c3c3d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x773f('0x6')](function(_0x4545d2){_0x3c3c3d[_0x773f('0x7')](_0x773f('0xa'),_0x4545d2[_0x773f('0xb')]);FaxInteractionEvents[_0x773f('0xc')](_0x5b22fd+':'+_0x3c3c3d['id'],_0x3c3c3d);FaxInteractionEvents[_0x773f('0xc')](_0x5b22fd,_0x3c3c3d);_0x4713e7(null);})['catch'](_0x4713e7(null));};}for(var e in events){if(events[_0x773f('0xd')](e)){var event=events[e];FaxInteraction[_0x773f('0xe')](e,emitEvent(event));}}module[_0x773f('0xf')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x117c=['FaxMessage','setMaxListeners','update','remove','setDataValue','Users','map','findAll','then','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x117c,0xae));var _0xc117=function(_0x51b362,_0x2a3af3){_0x51b362=_0x51b362-0x0;var _0x18bd6=_0x117c[_0x51b362];return _0x18bd6;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xc117('0x0'))['db'][_0xc117('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xc117('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc117('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc117('0x4'),'afterDestroy':_0xc117('0x5')};function emitEvent(_0x58cca3){return function(_0x343b4b,_0x528820,_0x1d8205){_0x343b4b['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x396535){_0x343b4b[_0xc117('0x6')](_0xc117('0x7'),_0x396535[_0xc117('0x8')](function(_0x25d89c){return{'id':_0x25d89c['id']};}));return FaxMessage[_0xc117('0x9')]({'where':{'FaxInteractionId':_0x343b4b['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc117('0xa')](function(_0x29cf2){_0x343b4b[_0xc117('0x6')]('unreadMessages',_0x29cf2['length']);FaxInteractionEvents[_0xc117('0xb')](_0x58cca3+':'+_0x343b4b['id'],_0x343b4b);FaxInteractionEvents[_0xc117('0xb')](_0x58cca3,_0x343b4b);_0x1d8205(null);})[_0xc117('0xc')](_0x1d8205(null));};}for(var e in events){if(events[_0xc117('0xd')](e)){var event=events[e];FaxInteraction[_0xc117('0xe')](e,emitEvent(event));}}module[_0xc117('0xf')]=FaxInteractionEvents;
\ No newline at end of file
index ca69fbd..638d079 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b49=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed','closed'];(function(_0x2d086e,_0x5516c7){var _0x39bd87=function(_0x4c9997){while(--_0x4c9997){_0x2d086e['push'](_0x2d086e['shift']());}};_0x39bd87(++_0x5516c7);}(_0x0b49,0x69));var _0x90b4=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x0b49[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0x90b4('0x0'));var util=require(_0x90b4('0x1'));var logger=require(_0x90b4('0x2'))('api');var moment=require(_0x90b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x90b4('0x4'));var fs=require('fs');var path=require(_0x90b4('0x5'));var rimraf=require(_0x90b4('0x6'));var config=require(_0x90b4('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x90b4('0x8')]=function(_0x16d921,_0x31a4b7){return _0x16d921[_0x90b4('0x9')](_0x90b4('0xa'),attributes,{'tableName':_0x90b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1001fa,_0x4a0410,_0x183ab5){if(_0x1001fa[_0x90b4('0xc')](_0x90b4('0xd'))){_0x1001fa[_0x90b4('0xe')]=moment()[_0x90b4('0xf')](_0x90b4('0x10'));}_0x183ab5(null,_0x1001fa);}}});};
\ No newline at end of file
+var _0x264c=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x49536b,_0x2abe5d){var _0x30de59=function(_0xb848e3){while(--_0xb848e3){_0x49536b['push'](_0x49536b['shift']());}};_0x30de59(++_0x2abe5d);}(_0x264c,0x1a6));var _0xc264=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0x264c[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xc264('0x0'));var util=require('util');var logger=require(_0xc264('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc264('0x2'));var rp=require(_0xc264('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc264('0x4'));var config=require(_0xc264('0x5'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0xff9a8a,_0x47a0c6){return _0xff9a8a[_0xc264('0x6')](_0xc264('0x7'),attributes,{'tableName':_0xc264('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d9639,_0x401b06,_0x350662){if(_0x5d9639[_0xc264('0x9')](_0xc264('0xa'))){_0x5d9639[_0xc264('0xb')]=moment()[_0xc264('0xc')](_0xc264('0xd'));}_0x350662(null,_0x5d9639);}}});};
\ No newline at end of file
index 3e3ae0a..7e1f8ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x860e=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','result','catch','update','body','options','raw','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','lodash','util'];(function(_0x511bc3,_0x4dd5ea){var _0x264a10=function(_0x2e66ae){while(--_0x2e66ae){_0x511bc3['push'](_0x511bc3['shift']());}};_0x264a10(++_0x4dd5ea);}(_0x860e,0x1ab));var _0xe860=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x860e[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xe860('0x0'));var util=require(_0xe860('0x1'));var moment=require(_0xe860('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe860('0x3'));var db=require(_0xe860('0x4'))['db'];var utils=require(_0xe860('0x5'));var logger=require(_0xe860('0x6'))(_0xe860('0x7'));var config=require(_0xe860('0x8'));var jayson=require(_0xe860('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xe860('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe860('0xb'))(new Redis(config[_0xe860('0xa')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3cd3d4,_0x272428,_0x45d2ea){return new BPromise(function(_0x28c4a1,_0x5385db){return client[_0xe860('0xc')](_0x3cd3d4,_0x45d2ea)[_0xe860('0xd')](function(_0x39c581){logger[_0xe860('0xe')]('FaxInteraction,\x20%s,\x20%s',_0x272428,_0xe860('0xf'));logger[_0xe860('0x10')](_0xe860('0x11'),_0x272428,'request\x20sent',JSON[_0xe860('0x12')](_0x39c581));if(_0x39c581[_0xe860('0x13')]){if(_0x39c581['error'][_0xe860('0x14')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x272428,_0x39c581[_0xe860('0x13')][_0xe860('0x15')]);return _0x5385db(_0x39c581[_0xe860('0x13')][_0xe860('0x15')]);}logger[_0xe860('0x13')](_0xe860('0x16'),_0x272428,_0x39c581['error'][_0xe860('0x15')]);return _0x28c4a1(_0x39c581[_0xe860('0x13')][_0xe860('0x15')]);}else{logger[_0xe860('0xe')](_0xe860('0x16'),_0x272428,_0xe860('0xf'));_0x28c4a1(_0x39c581[_0xe860('0x17')][_0xe860('0x15')]);}})[_0xe860('0x18')](function(_0x14e85d){logger[_0xe860('0x13')](_0xe860('0x16'),_0x272428,_0x14e85d);_0x5385db(_0x14e85d);});});}exports['UpdateFaxInteraction']=function(_0x3981f0){var _0x43f32a=this;return new Promise(function(_0x43aa3a,_0x5d7c13){return db['FaxInteraction'][_0xe860('0x19')](_0x3981f0[_0xe860('0x1a')],{'raw':_0x3981f0['options']?_0x3981f0[_0xe860('0x1b')][_0xe860('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3981f0[_0xe860('0x1b')]?_0x3981f0[_0xe860('0x1b')][_0xe860('0x1d')]||null:null,'attributes':_0x3981f0['options']?_0x3981f0[_0xe860('0x1b')][_0xe860('0x1e')]||null:null,'limit':_0x3981f0[_0xe860('0x1b')]?_0x3981f0[_0xe860('0x1b')][_0xe860('0x1f')]||null:null})['then'](function(_0x49dee4){logger[_0xe860('0xe')](_0xe860('0x20'),_0x3981f0);logger[_0xe860('0x10')](_0xe860('0x20'),_0x3981f0,JSON['stringify'](_0x49dee4));_0x43aa3a(_0x49dee4);})[_0xe860('0x18')](function(_0x45b6e3){logger[_0xe860('0x13')](_0xe860('0x20'),_0x45b6e3[_0xe860('0x15')],_0x3981f0);_0x5d7c13(_0x43f32a[_0xe860('0x13')](0x1f4,_0x45b6e3[_0xe860('0x15')]));});});};exports[_0xe860('0x21')]=function(_0x5dcef3){return new Promise(function(_0x568c9f,_0x198d6b){return db['FaxInteraction']['find']({'where':_0x5dcef3[_0xe860('0x1b')]?_0x5dcef3[_0xe860('0x1b')][_0xe860('0x1d')]||null:null})[_0xe860('0xd')](function(_0x59410c){if(_0x59410c){return _0x59410c[_0xe860('0x22')](_0x5dcef3['body'][_0xe860('0x23')],_[_0xe860('0x24')](_0x5dcef3[_0xe860('0x1a')],[_0xe860('0x23'),'id'])||{});}})[_0xe860('0x25')](function(_0x23b6a2){logger['info'](_0xe860('0x26'),_0x5dcef3);logger[_0xe860('0x10')]('AddTags',_0x5dcef3,JSON[_0xe860('0x12')](_0x23b6a2));_0x568c9f(_0x23b6a2);})[_0xe860('0x18')](function(_0x531c04){logger[_0xe860('0x13')](_0xe860('0x26'),_0x531c04[_0xe860('0x15')],_0x5dcef3);_0x198d6b(_this[_0xe860('0x13')](0x1f4,_0x531c04[_0xe860('0x15')]));});});};
\ No newline at end of file
+var _0x5e65=['where','AddTagsToFaxInteraction','FaxInteraction','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','request','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','update','body','options','raw'];(function(_0x4b92b9,_0x1bd47d){var _0x157b9d=function(_0x41d8e4){while(--_0x41d8e4){_0x4b92b9['push'](_0x4b92b9['shift']());}};_0x157b9d(++_0x1bd47d);}(_0x5e65,0xf7));var _0x55e6=function(_0x2282cc,_0x2fb31f){_0x2282cc=_0x2282cc-0x0;var _0x5e34ee=_0x5e65[_0x2282cc];return _0x5e34ee;};'use strict';var _=require(_0x55e6('0x0'));var util=require(_0x55e6('0x1'));var moment=require(_0x55e6('0x2'));var BPromise=require(_0x55e6('0x3'));var rs=require(_0x55e6('0x4'));var fs=require('fs');var Redis=require(_0x55e6('0x5'));var db=require(_0x55e6('0x6'))['db'];var utils=require(_0x55e6('0x7'));var logger=require(_0x55e6('0x8'))('rpc');var config=require(_0x55e6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x55e6('0xa')]['http']({'port':0x232a});config[_0x55e6('0xb')]=_[_0x55e6('0xc')](config[_0x55e6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x55e6('0xd'))(new Redis(config['redis']));require(_0x55e6('0xe'))['register'](socket);function respondWithRpcPromise(_0x3ec452,_0x52cb7b,_0x1d1c37){return new BPromise(function(_0x1c457b,_0x4d6315){return client[_0x55e6('0xf')](_0x3ec452,_0x1d1c37)[_0x55e6('0x10')](function(_0x240121){logger[_0x55e6('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x52cb7b,_0x55e6('0x12'));logger[_0x55e6('0x13')](_0x55e6('0x14'),_0x52cb7b,_0x55e6('0x12'),JSON[_0x55e6('0x15')](_0x240121));if(_0x240121[_0x55e6('0x16')]){if(_0x240121[_0x55e6('0x16')][_0x55e6('0x17')]===0x1f4){logger[_0x55e6('0x16')](_0x55e6('0x18'),_0x52cb7b,_0x240121[_0x55e6('0x16')]['message']);return _0x4d6315(_0x240121['error'][_0x55e6('0x19')]);}logger[_0x55e6('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x52cb7b,_0x240121[_0x55e6('0x16')][_0x55e6('0x19')]);return _0x1c457b(_0x240121[_0x55e6('0x16')][_0x55e6('0x19')]);}else{logger['info'](_0x55e6('0x18'),_0x52cb7b,'request\x20sent');_0x1c457b(_0x240121[_0x55e6('0x1a')]['message']);}})[_0x55e6('0x1b')](function(_0xcfbdf7){logger[_0x55e6('0x16')](_0x55e6('0x18'),_0x52cb7b,_0xcfbdf7);_0x4d6315(_0xcfbdf7);});});}exports[_0x55e6('0x1c')]=function(_0x2c809f){var _0x149cbc=this;return new Promise(function(_0x3b0548,_0x4f1e12){return db['FaxInteraction'][_0x55e6('0x1d')](_0x2c809f[_0x55e6('0x1e')],{'raw':_0x2c809f[_0x55e6('0x1f')]?_0x2c809f['options'][_0x55e6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c809f[_0x55e6('0x1f')]?_0x2c809f[_0x55e6('0x1f')][_0x55e6('0x21')]||null:null,'attributes':_0x2c809f[_0x55e6('0x1f')]?_0x2c809f[_0x55e6('0x1f')]['attributes']||null:null,'limit':_0x2c809f[_0x55e6('0x1f')]?_0x2c809f[_0x55e6('0x1f')]['limit']||null:null})[_0x55e6('0x10')](function(_0x429010){logger['info']('UpdateFaxInteraction',_0x2c809f);logger[_0x55e6('0x13')](_0x55e6('0x1c'),_0x2c809f,JSON[_0x55e6('0x15')](_0x429010));_0x3b0548(_0x429010);})[_0x55e6('0x1b')](function(_0x5096a9){logger[_0x55e6('0x16')]('UpdateFaxInteraction',_0x5096a9['message'],_0x2c809f);_0x4f1e12(_0x149cbc['error'](0x1f4,_0x5096a9['message']));});});};exports[_0x55e6('0x22')]=function(_0x334447){return new Promise(function(_0x5c72eb,_0xf5fd7d){return db[_0x55e6('0x23')]['find']({'where':_0x334447['options']?_0x334447[_0x55e6('0x1f')][_0x55e6('0x21')]||null:null})[_0x55e6('0x10')](function(_0x13508f){if(_0x13508f){return _0x13508f[_0x55e6('0x24')](_0x334447[_0x55e6('0x1e')]['ids'],_[_0x55e6('0x25')](_0x334447[_0x55e6('0x1e')],['ids','id'])||{});}})[_0x55e6('0x26')](function(_0x2a8617){logger[_0x55e6('0x11')](_0x55e6('0x27'),_0x334447);logger['debug']('AddTags',_0x334447,JSON[_0x55e6('0x15')](_0x2a8617));_0x5c72eb(_0x2a8617);})['catch'](function(_0x2e3f32){logger['error'](_0x55e6('0x27'),_0x2e3f32[_0x55e6('0x19')],_0x334447);_0xf5fd7d(_this[_0x55e6('0x16')](0x1f4,_0x2e3f32[_0x55e6('0x19')]));});});};
\ No newline at end of file
index d1ed039..38e1640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf64b=['emit','length','faxInteraction:','./faxInteraction.events','remove','update'];(function(_0x128b23,_0x504677){var _0x503678=function(_0x33c608){while(--_0x33c608){_0x128b23['push'](_0x128b23['shift']());}};_0x503678(++_0x504677);}(_0xf64b,0x17d));var _0xbf64=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xf64b[_0x187ee1];return _0x388160;};'use strict';var FaxInteractionEvents=require(_0xbf64('0x0'));var events=['save',_0xbf64('0x1'),_0xbf64('0x2')];function createListener(_0x28c5dd,_0x2b38ce){return function(_0x42cabe){_0x2b38ce[_0xbf64('0x3')](_0x28c5dd,_0x42cabe);};}function removeListener(_0x1e7027,_0x2d3538){return function(){FaxInteractionEvents['removeListener'](_0x1e7027,_0x2d3538);};}exports['register']=function(_0x7895f9){for(var _0x5d1256=0x0,_0x327afb=events[_0xbf64('0x4')];_0x5d1256<_0x327afb;_0x5d1256++){var _0x263ea3=events[_0x5d1256];var _0x111fda=createListener(_0xbf64('0x5')+_0x263ea3,_0x7895f9);FaxInteractionEvents['on'](_0x263ea3,_0x111fda);}};
\ No newline at end of file
+var _0x7c21=['emit','removeListener','faxInteraction:','./faxInteraction.events','update'];(function(_0x5de893,_0x2f7b90){var _0x5602af=function(_0x35e097){while(--_0x35e097){_0x5de893['push'](_0x5de893['shift']());}};_0x5602af(++_0x2f7b90);}(_0x7c21,0x80));var _0x17c2=function(_0x5eee33,_0x584025){_0x5eee33=_0x5eee33-0x0;var _0x19f6ff=_0x7c21[_0x5eee33];return _0x19f6ff;};'use strict';var FaxInteractionEvents=require(_0x17c2('0x0'));var events=['save','remove',_0x17c2('0x1')];function createListener(_0x581f82,_0x23fe08){return function(_0x157cd3){_0x23fe08[_0x17c2('0x2')](_0x581f82,_0x157cd3);};}function removeListener(_0x522954,_0x2a3b2d){return function(){FaxInteractionEvents[_0x17c2('0x3')](_0x522954,_0x2a3b2d);};}exports['register']=function(_0x41513d){for(var _0x22ef4a=0x0,_0xc52106=events['length'];_0x22ef4a<_0xc52106;_0x22ef4a++){var _0x2b1d43=events[_0x22ef4a];var _0x4c4b24=createListener(_0x17c2('0x4')+_0x2b1d43,_0x41513d);FaxInteractionEvents['on'](_0x2b1d43,_0x4c4b24);}};
\ No newline at end of file
index 9e5d849..c2b8727 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfa=['describe','/:id','show','/:id/messages','download','post','/:id/tags','fax','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','index','/describe','isAuthenticated'];(function(_0x53415b,_0x95605){var _0x3cc127=function(_0x29134e){while(--_0x29134e){_0x53415b['push'](_0x53415b['shift']());}};_0x3cc127(++_0x95605);}(_0x3cfa,0x6d));var _0xa3cf=function(_0x5b426f,_0x522174){_0x5b426f=_0x5b426f-0x0;var _0x4376ba=_0x3cfa[_0x5b426f];return _0x4376ba;};'use strict';var multer=require('multer');var util=require(_0xa3cf('0x0'));var path=require('path');var timeout=require(_0xa3cf('0x1'));var express=require(_0xa3cf('0x2'));var router=express['Router']();var fs_extra=require(_0xa3cf('0x3'));var auth=require(_0xa3cf('0x4'));var interaction=require(_0xa3cf('0x5'));var config=require('../../config/environment');var controller=require(_0xa3cf('0x6'));router[_0xa3cf('0x7')]('/',auth['isAuthenticated'](),controller[_0xa3cf('0x8')]);router[_0xa3cf('0x7')](_0xa3cf('0x9'),auth[_0xa3cf('0xa')](),controller[_0xa3cf('0xb')]);router[_0xa3cf('0x7')](_0xa3cf('0xc'),auth[_0xa3cf('0xa')](),controller[_0xa3cf('0xd')]);router[_0xa3cf('0x7')](_0xa3cf('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0xa3cf('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xa3cf('0xf')]);router[_0xa3cf('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa3cf('0x10')](_0xa3cf('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0xa3cf('0x11'),auth[_0xa3cf('0xa')](),interaction['tracked'](_0xa3cf('0x12'),'faxinteraction:addtags'),controller['addTags']);router['put'](_0xa3cf('0xc'),auth[_0xa3cf('0xa')](),interaction['tracked'](_0xa3cf('0x12'),_0xa3cf('0x13')),controller[_0xa3cf('0x14')]);router[_0xa3cf('0x15')](_0xa3cf('0xc'),auth['isAuthenticated'](),interaction['tracked'](_0xa3cf('0x12'),_0xa3cf('0x16')),controller['destroy']);router['delete'](_0xa3cf('0x11'),auth[_0xa3cf('0xa')](),controller[_0xa3cf('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x0d9c=['put','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','download','post','create','addMessage','/:id/tags','faxinteraction:addtags','addTags'];(function(_0x2b0667,_0x49794b){var _0x46bee1=function(_0x3d6ae9){while(--_0x3d6ae9){_0x2b0667['push'](_0x2b0667['shift']());}};_0x46bee1(++_0x49794b);}(_0x0d9c,0x7c));var _0xc0d9=function(_0xc08f00,_0x28067f){_0xc08f00=_0xc08f00-0x0;var _0x8649f7=_0x0d9c[_0xc08f00];return _0x8649f7;};'use strict';var multer=require('multer');var util=require(_0xc0d9('0x0'));var path=require(_0xc0d9('0x1'));var timeout=require(_0xc0d9('0x2'));var express=require(_0xc0d9('0x3'));var router=express['Router']();var fs_extra=require(_0xc0d9('0x4'));var auth=require(_0xc0d9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc0d9('0x6'));var controller=require('./faxInteraction.controller');router[_0xc0d9('0x7')]('/',auth[_0xc0d9('0x8')](),controller[_0xc0d9('0x9')]);router[_0xc0d9('0x7')](_0xc0d9('0xa'),auth[_0xc0d9('0x8')](),controller[_0xc0d9('0xb')]);router[_0xc0d9('0x7')](_0xc0d9('0xc'),auth[_0xc0d9('0x8')](),controller['show']);router[_0xc0d9('0x7')](_0xc0d9('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xc0d9('0x7')]('/:id/download',auth[_0xc0d9('0x8')](),controller[_0xc0d9('0xe')]);router[_0xc0d9('0xf')]('/',auth[_0xc0d9('0x8')](),controller[_0xc0d9('0x10')]);router[_0xc0d9('0xf')]('/:id/messages',auth[_0xc0d9('0x8')](),controller[_0xc0d9('0x11')]);router[_0xc0d9('0xf')](_0xc0d9('0x12'),auth[_0xc0d9('0x8')](),interaction['tracked']('fax',_0xc0d9('0x13')),controller[_0xc0d9('0x14')]);router[_0xc0d9('0x15')]('/:id',auth[_0xc0d9('0x8')](),interaction[_0xc0d9('0x16')](_0xc0d9('0x17'),_0xc0d9('0x18')),controller[_0xc0d9('0x19')]);router[_0xc0d9('0x1a')](_0xc0d9('0xc'),auth[_0xc0d9('0x8')](),interaction[_0xc0d9('0x16')](_0xc0d9('0x17'),_0xc0d9('0x1b')),controller['destroy']);router['delete'](_0xc0d9('0x12'),auth[_0xc0d9('0x8')](),controller[_0xc0d9('0x1c')]);module['exports']=router;
\ No newline at end of file
index aa8ec1b..c5f8439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe31=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x4bbb2a,_0x577dad){var _0x35b2ae=function(_0x17185f){while(--_0x17185f){_0x4bbb2a['push'](_0x4bbb2a['shift']());}};_0x35b2ae(++_0x577dad);}(_0xbe31,0x83));var _0x1be3=function(_0x350258,_0x4e0a50){_0x350258=_0x350258-0x0;var _0x3714b3=_0xbe31[_0x350258];return _0x3714b3;};'use strict';var Sequelize=require('sequelize');module[_0x1be3('0x0')]={'body':{'type':Sequelize[_0x1be3('0x1')](_0x1be3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1be3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1be3('0x4')]('in',_0x1be3('0x5')),'defaultValue':_0x1be3('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1be3('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1be3('0x6')]}};
\ No newline at end of file
+var _0x5712=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x551f70,_0x21460e){var _0x1de80d=function(_0x140510){while(--_0x140510){_0x551f70['push'](_0x551f70['shift']());}};_0x1de80d(++_0x21460e);}(_0x5712,0x140));var _0x2571=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5712[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2571('0x0'));module[_0x2571('0x1')]={'body':{'type':Sequelize[_0x2571('0x2')](_0x2571('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x2571('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2571('0x5')]('in',_0x2571('0x6')),'defaultValue':_0x2571('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x2571('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x2571('0x7')]}};
\ No newline at end of file
index d5f0ba3..9cecd6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3480=['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','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','stack','name','send','index','FaxMessage','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','show','params','options','update','body','destroy','find','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','get','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','rimraf','zip-dir'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x3480,0x1bd));var _0x0348=function(_0xe9f2f7,_0x4871ae){_0xe9f2f7=_0xe9f2f7-0x0;var _0x3ecf06=_0x3480[_0xe9f2f7];return _0x3ecf06;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0348('0x0'));var zipdir=require(_0x0348('0x1'));var jsonpatch=require(_0x0348('0x2'));var rp=require(_0x0348('0x3'));var moment=require(_0x0348('0x4'));var BPromise=require(_0x0348('0x5'));var Mustache=require(_0x0348('0x6'));var util=require(_0x0348('0x7'));var path=require(_0x0348('0x8'));var sox=require('sox');var csv=require(_0x0348('0x9'));var ejs=require(_0x0348('0xa'));var fs=require('fs');var fs_extra=require(_0x0348('0xb'));var _=require(_0x0348('0xc'));var squel=require(_0x0348('0xd'));var crypto=require(_0x0348('0xe'));var jsforce=require(_0x0348('0xf'));var deskjs=require(_0x0348('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0348('0x11'));var Papa=require(_0x0348('0x12'));var Redis=require(_0x0348('0x13'));var authService=require(_0x0348('0x14'));var qs=require(_0x0348('0x15'));var as=require(_0x0348('0x16'));var hardwareService=require(_0x0348('0x17'));var logger=require(_0x0348('0x18'))('api');var utils=require(_0x0348('0x19'));var config=require(_0x0348('0x1a'));var licenseUtil=require(_0x0348('0x1b'));var db=require(_0x0348('0x1c'))['db'];config[_0x0348('0x1d')]=_[_0x0348('0x1e')](config['redis'],{'host':_0x0348('0x1f'),'port':0x18eb});var socket=require(_0x0348('0x20'))(new Redis(config[_0x0348('0x1d')]));require(_0x0348('0x21'))[_0x0348('0x22')](socket);var jayson=require(_0x0348('0x23'));var client=jayson[_0x0348('0x24')]['http']({'port':0x232c});var client9002=jayson[_0x0348('0x24')][_0x0348('0x25')]({'port':0x232a});function respondWithRpcPromise(_0x42e29b,_0xc2fcc9,_0x19f5a8,_0x474e18){return new BPromise(function(_0x2c3aaf,_0x4c5aa2){var _0x3a0273=_0x474e18||client;return _0x3a0273[_0x0348('0x26')](_0x42e29b,_0x19f5a8)[_0x0348('0x27')](function(_0x315a3e){logger[_0x0348('0x28')]('FaxMessage,\x20%s,\x20%s',_0xc2fcc9,_0x0348('0x29'));logger[_0x0348('0x2a')](_0x0348('0x2b'),_0xc2fcc9,_0x0348('0x29'),JSON[_0x0348('0x2c')](_0x315a3e));if(_0x315a3e[_0x0348('0x2d')]){if(_0x315a3e[_0x0348('0x2d')]['code']===0x1f4){logger[_0x0348('0x2d')](_0x0348('0x2e'),_0xc2fcc9,_0x315a3e[_0x0348('0x2d')][_0x0348('0x2f')]);return _0x4c5aa2(_0x315a3e[_0x0348('0x2d')][_0x0348('0x2f')]);}logger[_0x0348('0x2d')](_0x0348('0x2e'),_0xc2fcc9,_0x315a3e[_0x0348('0x2d')][_0x0348('0x2f')]);return _0x2c3aaf(_0x315a3e[_0x0348('0x2d')][_0x0348('0x2f')]);}else{logger[_0x0348('0x28')](_0x0348('0x2e'),_0xc2fcc9,_0x0348('0x29'));_0x2c3aaf(_0x315a3e[_0x0348('0x30')]['message']);}})[_0x0348('0x31')](function(_0x5935c8){logger[_0x0348('0x2d')](_0x0348('0x2e'),_0xc2fcc9,_0x5935c8);_0x4c5aa2(_0x5935c8);});});}function respondWithStatusCode(_0x13e094,_0x116caf){_0x116caf=_0x116caf||0xcc;return function(_0x37dc84){if(_0x37dc84){return _0x13e094['sendStatus'](_0x116caf);}return _0x13e094[_0x0348('0x32')](_0x116caf)[_0x0348('0x33')]();};}function respondWithResult(_0x344b6d,_0x39fef0){_0x39fef0=_0x39fef0||0xc8;return function(_0x5db69c){if(_0x5db69c){return _0x344b6d[_0x0348('0x32')](_0x39fef0)[_0x0348('0x34')](_0x5db69c);}};}function respondWithFilteredResult(_0x50b578,_0x53b064){return function(_0x4a3b3a){if(_0x4a3b3a){var _0x35eeee=typeof _0x53b064['offset']==='undefined'&&typeof _0x53b064[_0x0348('0x35')]===_0x0348('0x36');var _0x2d0718=_0x4a3b3a[_0x0348('0x37')];var _0x123fd9=_0x35eeee?0x0:_0x53b064[_0x0348('0x38')];var _0x292efb=_0x35eeee?_0x4a3b3a[_0x0348('0x37')]:_0x53b064[_0x0348('0x38')]+_0x53b064[_0x0348('0x35')];var _0x2a8cef;if(_0x292efb>=_0x2d0718){_0x292efb=_0x2d0718;_0x2a8cef=0xc8;}else{_0x2a8cef=0xce;}_0x50b578['status'](_0x2a8cef);return _0x50b578[_0x0348('0x39')](_0x0348('0x3a'),_0x123fd9+'-'+_0x292efb+'/'+_0x2d0718)['json'](_0x4a3b3a);}return null;};}function patchUpdates(_0x5a7688){return function(_0x26f4b6){try{jsonpatch[_0x0348('0x3b')](_0x26f4b6,_0x5a7688,!![]);}catch(_0x352517){return BPromise[_0x0348('0x3c')](_0x352517);}return _0x26f4b6[_0x0348('0x3d')]();};}function saveUpdates(_0xc3b909,_0xebc550){return function(_0xbc7798){if(_0xbc7798){return _0xbc7798['update'](_0xc3b909)[_0x0348('0x27')](function(_0x29e7f0){return _0x29e7f0;});}return null;};}function removeEntity(_0x56e1c1,_0x2c2e46){return function(_0x1621c7){if(_0x1621c7){return _0x1621c7['destroy']()[_0x0348('0x27')](function(){_0x56e1c1['status'](0xcc)[_0x0348('0x33')]();});}};}function handleEntityNotFound(_0x46d03a,_0x23431b){return function(_0x470d80){if(!_0x470d80){_0x46d03a['sendStatus'](0x194);}return _0x470d80;};}function handleError(_0x161b75,_0x480a20){_0x480a20=_0x480a20||0x1f4;return function(_0x537ecd){logger[_0x0348('0x2d')](_0x537ecd[_0x0348('0x3e')]);if(_0x537ecd[_0x0348('0x3f')]){delete _0x537ecd[_0x0348('0x3f')];}_0x161b75[_0x0348('0x32')](_0x480a20)[_0x0348('0x40')](_0x537ecd);};}exports[_0x0348('0x41')]=function(_0x1a70be,_0x27ca32){var _0x3f4057={},_0x1d2abf={},_0x5634f1={'count':0x0,'rows':[]};var _0x302b88=_['map'](db[_0x0348('0x42')]['rawAttributes'],function(_0xc87f5f){return{'name':_0xc87f5f[_0x0348('0x43')],'type':_0xc87f5f[_0x0348('0x44')][_0x0348('0x45')]};});_0x1d2abf[_0x0348('0x46')]=_[_0x0348('0x47')](_0x302b88,'name');_0x1d2abf[_0x0348('0x48')]=_[_0x0348('0x49')](_0x1a70be['query']);_0x1d2abf[_0x0348('0x4a')]=_[_0x0348('0x4b')](_0x1d2abf[_0x0348('0x46')],_0x1d2abf[_0x0348('0x48')]);_0x3f4057[_0x0348('0x4c')]=_['intersection'](_0x1d2abf[_0x0348('0x46')],qs[_0x0348('0x4d')](_0x1a70be['query'][_0x0348('0x4d')]));_0x3f4057[_0x0348('0x4c')]=_0x3f4057[_0x0348('0x4c')][_0x0348('0x4e')]?_0x3f4057['attributes']:_0x1d2abf['model'];if(!_0x1a70be[_0x0348('0x48')][_0x0348('0x4f')](_0x0348('0x50'))){_0x3f4057[_0x0348('0x35')]=qs[_0x0348('0x35')](_0x1a70be['query'][_0x0348('0x35')]);_0x3f4057[_0x0348('0x38')]=qs[_0x0348('0x38')](_0x1a70be['query'][_0x0348('0x38')]);}_0x3f4057['order']=qs[_0x0348('0x51')](_0x1a70be[_0x0348('0x48')][_0x0348('0x51')]);_0x3f4057[_0x0348('0x52')]=qs[_0x0348('0x4a')](_[_0x0348('0x53')](_0x1a70be[_0x0348('0x48')],_0x1d2abf[_0x0348('0x4a')]),_0x302b88);if(_0x1a70be[_0x0348('0x48')]['filter']){_0x3f4057[_0x0348('0x52')]=_[_0x0348('0x54')](_0x3f4057[_0x0348('0x52')],{'$or':_[_0x0348('0x47')](_0x302b88,function(_0x3437b4){if(_0x3437b4[_0x0348('0x44')]!=='VIRTUAL'){var _0x25deac={};_0x25deac[_0x3437b4['name']]={'$like':'%'+_0x1a70be[_0x0348('0x48')][_0x0348('0x55')]+'%'};return _0x25deac;}})});}_0x3f4057=_[_0x0348('0x54')]({},_0x3f4057,_0x1a70be['options']);var _0x2f92a5={'where':_0x3f4057[_0x0348('0x52')]};return db['FaxMessage'][_0x0348('0x37')](_0x2f92a5)[_0x0348('0x27')](function(_0x213ac5){_0x5634f1['count']=_0x213ac5;if(_0x1a70be[_0x0348('0x48')][_0x0348('0x56')]){_0x3f4057[_0x0348('0x57')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x3f4057);})['then'](function(_0x4e6d81){_0x5634f1['rows']=_0x4e6d81;return _0x5634f1;})[_0x0348('0x27')](respondWithFilteredResult(_0x27ca32,_0x3f4057))['catch'](handleError(_0x27ca32,null));};exports[_0x0348('0x58')]=function(_0x1432ae,_0x1235d8){var _0x526061={'raw':!![],'where':{'id':_0x1432ae[_0x0348('0x59')]['id']}},_0x24118a={};_0x24118a['model']=_[_0x0348('0x49')](db[_0x0348('0x42')]['rawAttributes']);_0x24118a[_0x0348('0x48')]=_[_0x0348('0x49')](_0x1432ae['query']);_0x24118a[_0x0348('0x4a')]=_['intersection'](_0x24118a[_0x0348('0x46')],_0x24118a[_0x0348('0x48')]);_0x526061[_0x0348('0x4c')]=_['intersection'](_0x24118a['model'],qs[_0x0348('0x4d')](_0x1432ae['query']['fields']));_0x526061[_0x0348('0x4c')]=_0x526061[_0x0348('0x4c')][_0x0348('0x4e')]?_0x526061[_0x0348('0x4c')]:_0x24118a['model'];if(_0x1432ae[_0x0348('0x48')]['includeAll']){_0x526061[_0x0348('0x57')]=[{'all':!![]}];}_0x526061=_['merge']({},_0x526061,_0x1432ae[_0x0348('0x5a')]);return db[_0x0348('0x42')]['find'](_0x526061)[_0x0348('0x27')](handleEntityNotFound(_0x1235d8,null))[_0x0348('0x27')](respondWithResult(_0x1235d8,null))[_0x0348('0x31')](handleError(_0x1235d8,null));};exports[_0x0348('0x5b')]=function(_0x4a12a4,_0x2d3bbb){if(_0x4a12a4[_0x0348('0x5c')]['id']){delete _0x4a12a4[_0x0348('0x5c')]['id'];}return db[_0x0348('0x42')]['find']({'where':{'id':_0x4a12a4[_0x0348('0x59')]['id']}})['then'](handleEntityNotFound(_0x2d3bbb,null))['then'](saveUpdates(_0x4a12a4[_0x0348('0x5c')],null))[_0x0348('0x27')](respondWithResult(_0x2d3bbb,null))['catch'](handleError(_0x2d3bbb,null));};exports[_0x0348('0x5d')]=function(_0x2ef113,_0x8f3930){return db[_0x0348('0x42')][_0x0348('0x5e')]({'where':{'id':_0x2ef113[_0x0348('0x59')]['id']}})[_0x0348('0x27')](handleEntityNotFound(_0x8f3930,null))[_0x0348('0x27')](removeEntity(_0x8f3930,null))[_0x0348('0x31')](handleError(_0x8f3930,null));};exports['describe']=function(_0x4c6fd5,_0xbe2ca4){return db[_0x0348('0x42')][_0x0348('0x5f')]()[_0x0348('0x27')](respondWithResult(_0xbe2ca4,null))[_0x0348('0x31')](handleError(_0xbe2ca4,null));};var interaction_log=require(_0x0348('0x18'))('fax-interactions');exports[_0x0348('0x60')]=function(_0x5bdee3,_0x38390a,_0x4f7fc0){var _0x5e5e3b={'agent':{},'channel':_0x0348('0x61')};if(_0x5bdee3[_0x0348('0x5c')]['id']){delete _0x5bdee3[_0x0348('0x5c')]['id'];}_0x5bdee3[_0x0348('0x5c')][_0x0348('0x62')]=!![];_0x5bdee3[_0x0348('0x5c')][_0x0348('0x63')]=moment()[_0x0348('0x64')](_0x0348('0x65'));_0x5bdee3[_0x0348('0x5c')][_0x0348('0x66')]=_0x5bdee3[_0x0348('0x5c')]['UserId']||_0x5bdee3[_0x0348('0x67')]['id'];_0x5e5e3b[_0x0348('0x68')]['id']=_0x5bdee3[_0x0348('0x5c')][_0x0348('0x66')];return db[_0x0348('0x42')][_0x0348('0x5e')]({'where':{'id':_0x5bdee3[_0x0348('0x59')]['id'],'UserId':null}})[_0x0348('0x27')](handleEntityNotFound(_0x38390a,null))[_0x0348('0x27')](saveUpdates(_0x5bdee3[_0x0348('0x5c')],null))[_0x0348('0x27')](function(_0x33e371){if(_0x33e371){_0x5e5e3b[_0x0348('0x2f')]=_0x33e371['get']({'plain':!![]});return db[_0x0348('0x69')][_0x0348('0x5e')]({'where':{'id':_0x33e371[_0x0348('0x6a')]}});}return null;})[_0x0348('0x27')](handleEntityNotFound(_0x38390a,null))[_0x0348('0x27')](function(_0x10b769){if(_0x10b769){return _0x10b769[_0x0348('0x5b')]({'UserId':_0x5bdee3['body'][_0x0348('0x66')],'read1stAt':_['isNil'](_0x10b769[_0x0348('0x6b')])?moment()[_0x0348('0x64')](_0x0348('0x65')):undefined});}return null;})['then'](function(_0x71470e){if(_0x71470e){_0x5e5e3b[_0x0348('0x6c')]=_0x71470e['get']({'plain':!![]});interaction_log[_0x0348('0x28')](_0x0348('0x6d'),_0x5bdee3[_0x0348('0x67')]['id'],_0x5bdee3[_0x0348('0x67')][_0x0348('0x3f')],_0x5bdee3['user'][_0x0348('0x6e')],_0x5e5e3b[_0x0348('0x6c')]['id'],_0x5bdee3['body']?JSON['stringify'](_0x5bdee3['body']):_0x0348('0x6f'));return respondWithRpcPromise(_0x0348('0x70'),_0x0348('0x71'),_0x5e5e3b);}return null;})['then'](function(_0x14c67a){var _0x5a1943='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14c67a['message'][_0x0348('0x72')];return db[_0x0348('0x73')][_0x0348('0x48')](_0x5a1943,{'type':db[_0x0348('0x74')][_0x0348('0x75')][_0x0348('0x76')],'raw':!![]})[_0x0348('0x27')](function(_0x3aaa7e){return _0x3aaa7e;});})[_0x0348('0x27')](function(_0x166ddb){if(_0x166ddb){_0x5e5e3b[_0x0348('0x2f')][_0x0348('0x77')]=_0x166ddb[0x0];if(!_0x5bdee3[_0x0348('0x5c')][_0x0348('0x66')])return;return db[_0x0348('0x78')]['find']({'where':{'id':_0x5bdee3[_0x0348('0x5c')][_0x0348('0x66')],'role':_0x0348('0x68')},'attributes':['id',_0x0348('0x3f'),_0x0348('0x79'),_0x0348('0x7a'),_0x0348('0x7b')],'raw':!![]});}return null;})[_0x0348('0x27')](function(_0x5ce40a){if(!_0x5ce40a)return null;_0x5e5e3b[_0x0348('0x2f')][_0x0348('0x68')]=_0x5ce40a;return _0x5e5e3b;})[_0x0348('0x27')](function(_0x5b8bf5){if(_0x5b8bf5){if(_0x5bdee3[_0x0348('0x5c')][_0x0348('0x7c')]){_0x5e5e3b[_0x0348('0x2f')]['interface']=util[_0x0348('0x64')](_0x0348('0x7d'),_0x5bdee3['user'][_0x0348('0x3f')]);_0x5e5e3b[_0x0348('0x2f')][_0x0348('0x7e')]=_0x5e5e3b[_0x0348('0x7e')];_0x5e5e3b[_0x0348('0x2f')][_0x0348('0x7f')]=_0x0348('0x60');return respondWithRpcPromise(_0x0348('0x80'),_0x0348('0x80'),{'event':_0x0348('0x81'),'message':_0x5e5e3b[_0x0348('0x2f')]},client9002)[_0x0348('0x27')](function(){return _0x5e5e3b;});}return _0x5e5e3b;}return null;})['then'](respondWithResult(_0x38390a,null))[_0x0348('0x31')](handleError(_0x38390a,null));};var interaction_log=require(_0x0348('0x18'))(_0x0348('0x82'));exports[_0x0348('0x3c')]=function(_0x363115,_0x10f748,_0x4915f3){var _0x15ccf3={'agent':{},'channel':_0x0348('0x61')};if(_0x363115[_0x0348('0x5c')]['id']){delete _0x363115[_0x0348('0x5c')]['id'];}_0x363115['body']['UserId']=_0x363115['body'][_0x0348('0x66')]||_0x363115[_0x0348('0x67')]['id'];_0x15ccf3[_0x0348('0x68')]['id']=_0x363115[_0x0348('0x5c')][_0x0348('0x66')];return db['FaxMessage'][_0x0348('0x5e')]({'where':{'id':_0x363115[_0x0348('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x10f748,null))[_0x0348('0x27')](function(_0xb38ae0){if(_0xb38ae0){_0x15ccf3[_0x0348('0x2f')]=_0xb38ae0[_0x0348('0x83')]({'plain':!![]});return db[_0x0348('0x69')][_0x0348('0x5e')]({'where':{'id':_0xb38ae0[_0x0348('0x6a')]}});}return null;})[_0x0348('0x27')](handleEntityNotFound(_0x10f748,null))[_0x0348('0x27')](function(_0x1f8b4a){if(_0x1f8b4a){_0x15ccf3['interaction']=_0x1f8b4a[_0x0348('0x83')]({'plain':!![]});interaction_log[_0x0348('0x28')](_0x0348('0x84'),_0x363115[_0x0348('0x67')]['id'],_0x363115[_0x0348('0x67')]['name'],_0x363115[_0x0348('0x67')]['role'],_0x15ccf3['interaction']['id'],_0x363115['body']?JSON[_0x0348('0x2c')](_0x363115[_0x0348('0x5c')]):'null');return respondWithRpcPromise(_0x0348('0x85'),'rejectMessage',_0x15ccf3);}return null;})['then'](function(_0x4362dc){var _0x275527=_0x0348('0x86')+_0x4362dc['message'][_0x0348('0x72')];return db[_0x0348('0x73')]['query'](_0x275527,{'type':db[_0x0348('0x74')][_0x0348('0x75')][_0x0348('0x76')],'raw':!![]})[_0x0348('0x27')](function(_0x1d0d86){return _0x1d0d86;});})['then'](function(_0x1a21c5){if(_0x1a21c5){_0x15ccf3[_0x0348('0x2f')][_0x0348('0x77')]=_0x1a21c5[0x0];if(!_0x363115[_0x0348('0x5c')][_0x0348('0x66')])return;return db[_0x0348('0x78')]['find']({'where':{'id':_0x363115[_0x0348('0x5c')][_0x0348('0x66')],'role':_0x0348('0x68')},'attributes':['id','name',_0x0348('0x79'),_0x0348('0x7a'),_0x0348('0x7b')],'raw':!![]});}return null;})['then'](function(_0x5d43db){if(!_0x5d43db)return null;_0x15ccf3[_0x0348('0x2f')]['agent']=_0x5d43db;return _0x15ccf3;})['then'](function(_0x4d6815){if(_0x4d6815){_0x4d6815[_0x0348('0x2f')]['interface']=util[_0x0348('0x64')]('SIP/%s',_0x363115[_0x0348('0x67')]['name']);_0x4d6815[_0x0348('0x2f')][_0x0348('0x7e')]=_0x15ccf3[_0x0348('0x7e')];_0x4d6815[_0x0348('0x2f')]['event']=_0x0348('0x3c');respondWithRpcPromise('EventManager',_0x0348('0x80'),{'event':'rejectmessage','message':_0x4d6815[_0x0348('0x2f')]},client9002);return _0x15ccf3;}return null;})[_0x0348('0x27')](respondWithResult(_0x10f748,null))[_0x0348('0x31')](handleError(_0x10f748,null));};exports['create']=function(_0xe60055,_0x317a43){var _0x5e4e6b;return db[_0x0348('0x42')][_0x0348('0x87')](_0xe60055['body'],{})['then'](function(_0xa0b9fa){_0x5e4e6b=_0xa0b9fa;return db[_0x0348('0x88')][_0x0348('0x89')]({'where':{'id':_0x5e4e6b[_0x0348('0x72')]}});})[_0x0348('0x27')](function(_0x185140){if(_[_0x0348('0x8a')](_0x185140)){return;}else{_0x5e4e6b[_0x0348('0x61')]=_0x185140[_0x0348('0x61')];return db[_0x0348('0x8b')]['findOne']({'where':{'id':_0x5e4e6b[_0x0348('0x8c')]}});}})[_0x0348('0x27')](function(_0x1d8920){return respondWithRpcPromise(_0x0348('0x8d'),_0x0348('0x8d'),{'FaxAccountId':_[_0x0348('0x8a')](_0xe60055[_0x0348('0x5c')])?undefined:_0xe60055[_0x0348('0x5c')][_0x0348('0x8e')],'path':_[_0x0348('0x8a')](_0x1d8920)?undefined:util['format'](_0x0348('0x8f'),_0x1d8920[_0x0348('0x90')]),'fax':_[_0x0348('0x8a')](_0x5e4e6b['fax'])?undefined:_0x5e4e6b[_0x0348('0x61')],'AttachmentId':_0x5e4e6b[_0x0348('0x8c')]},client9002);})['then'](respondWithResult(_0x317a43,0xc9))[_0x0348('0x31')](handleError(_0x317a43,null));};exports[_0x0348('0x91')]=function(_0x4336cd,_0x29c267){var _0x1f26f2=path['join'](config[_0x0348('0x92')],_0x0348('0x93'),_0x0348('0x94'),'attachments');return db[_0x0348('0x42')][_0x0348('0x5e')]({'where':{'id':_0x4336cd[_0x0348('0x59')]['id']},'include':[{'model':db[_0x0348('0x8b')],'as':_0x0348('0x8b')}]})[_0x0348('0x27')](handleEntityNotFound(_0x29c267,null))[_0x0348('0x27')](function(_0x46fd73){if(_0x46fd73){return _0x29c267[_0x0348('0x91')](path['join'](_0x1f26f2,_0x46fd73[_0x0348('0x8b')][_0x0348('0x90')]));}})['catch'](handleError(_0x29c267,null));};
\ No newline at end of file
+var _0x8cd6=['FaxInteraction','FaxInteractionId','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','SIP/%s','channel','event','EventManager','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','rejectmessage','create','CmContact','findOne','isNil','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','join','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','merge','includeAll','include','findAll','show','params','options','update','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get'];(function(_0x59ddd3,_0x21440c){var _0x49fb32=function(_0x35d5dd){while(--_0x35d5dd){_0x59ddd3['push'](_0x59ddd3['shift']());}};_0x49fb32(++_0x21440c);}(_0x8cd6,0xbe));var _0x68cd=function(_0x341a08,_0x52c3f1){_0x341a08=_0x341a08-0x0;var _0x4b7c31=_0x8cd6[_0x341a08];return _0x4b7c31;};'use strict';var emlformat=require(_0x68cd('0x0'));var rimraf=require(_0x68cd('0x1'));var zipdir=require(_0x68cd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x68cd('0x3'));var moment=require(_0x68cd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x68cd('0x5'));var util=require(_0x68cd('0x6'));var path=require(_0x68cd('0x7'));var sox=require(_0x68cd('0x8'));var csv=require(_0x68cd('0x9'));var ejs=require(_0x68cd('0xa'));var fs=require('fs');var fs_extra=require(_0x68cd('0xb'));var _=require(_0x68cd('0xc'));var squel=require('squel');var crypto=require(_0x68cd('0xd'));var jsforce=require(_0x68cd('0xe'));var deskjs=require(_0x68cd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x68cd('0x10'));var Papa=require(_0x68cd('0x11'));var Redis=require(_0x68cd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x68cd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68cd('0x14'));var logger=require('../../config/logger')(_0x68cd('0x15'));var utils=require(_0x68cd('0x16'));var config=require(_0x68cd('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x68cd('0x18'))['db'];config[_0x68cd('0x19')]=_[_0x68cd('0x1a')](config[_0x68cd('0x19')],{'host':_0x68cd('0x1b'),'port':0x18eb});var socket=require(_0x68cd('0x1c'))(new Redis(config[_0x68cd('0x19')]));require(_0x68cd('0x1d'))[_0x68cd('0x1e')](socket);var jayson=require(_0x68cd('0x1f'));var client=jayson[_0x68cd('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x68cd('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1fec43,_0x1bdb0d,_0x2a77e5,_0x4df732){return new BPromise(function(_0x52c87f,_0x40d627){var _0x117b57=_0x4df732||client;return _0x117b57[_0x68cd('0x22')](_0x1fec43,_0x2a77e5)['then'](function(_0x1f8258){logger[_0x68cd('0x23')](_0x68cd('0x24'),_0x1bdb0d,_0x68cd('0x25'));logger[_0x68cd('0x26')](_0x68cd('0x27'),_0x1bdb0d,'request\x20sent',JSON[_0x68cd('0x28')](_0x1f8258));if(_0x1f8258['error']){if(_0x1f8258[_0x68cd('0x29')][_0x68cd('0x2a')]===0x1f4){logger[_0x68cd('0x29')](_0x68cd('0x24'),_0x1bdb0d,_0x1f8258[_0x68cd('0x29')][_0x68cd('0x2b')]);return _0x40d627(_0x1f8258[_0x68cd('0x29')][_0x68cd('0x2b')]);}logger[_0x68cd('0x29')]('FaxMessage,\x20%s,\x20%s',_0x1bdb0d,_0x1f8258[_0x68cd('0x29')]['message']);return _0x52c87f(_0x1f8258[_0x68cd('0x29')][_0x68cd('0x2b')]);}else{logger[_0x68cd('0x23')](_0x68cd('0x24'),_0x1bdb0d,'request\x20sent');_0x52c87f(_0x1f8258[_0x68cd('0x2c')][_0x68cd('0x2b')]);}})[_0x68cd('0x2d')](function(_0x4babf8){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1bdb0d,_0x4babf8);_0x40d627(_0x4babf8);});});}function respondWithStatusCode(_0x3ea489,_0x299937){_0x299937=_0x299937||0xcc;return function(_0x3173f0){if(_0x3173f0){return _0x3ea489[_0x68cd('0x2e')](_0x299937);}return _0x3ea489[_0x68cd('0x2f')](_0x299937)[_0x68cd('0x30')]();};}function respondWithResult(_0xe8e65e,_0x3ea357){_0x3ea357=_0x3ea357||0xc8;return function(_0x1cdbf0){if(_0x1cdbf0){return _0xe8e65e['status'](_0x3ea357)[_0x68cd('0x31')](_0x1cdbf0);}};}function respondWithFilteredResult(_0x41d5f2,_0x399214){return function(_0x4e5345){if(_0x4e5345){var _0x1e1cb7=typeof _0x399214[_0x68cd('0x32')]===_0x68cd('0x33')&&typeof _0x399214[_0x68cd('0x34')]===_0x68cd('0x33');var _0x24fb50=_0x4e5345[_0x68cd('0x35')];var _0x216c2c=_0x1e1cb7?0x0:_0x399214[_0x68cd('0x32')];var _0x257a6b=_0x1e1cb7?_0x4e5345[_0x68cd('0x35')]:_0x399214[_0x68cd('0x32')]+_0x399214['limit'];var _0x215436;if(_0x257a6b>=_0x24fb50){_0x257a6b=_0x24fb50;_0x215436=0xc8;}else{_0x215436=0xce;}_0x41d5f2[_0x68cd('0x2f')](_0x215436);return _0x41d5f2[_0x68cd('0x36')]('Content-Range',_0x216c2c+'-'+_0x257a6b+'/'+_0x24fb50)['json'](_0x4e5345);}return null;};}function patchUpdates(_0x5d3fa8){return function(_0x2cbf55){try{jsonpatch[_0x68cd('0x37')](_0x2cbf55,_0x5d3fa8,!![]);}catch(_0x699472){return BPromise[_0x68cd('0x38')](_0x699472);}return _0x2cbf55['save']();};}function saveUpdates(_0x1a18d8,_0x58c65e){return function(_0x4d614d){if(_0x4d614d){return _0x4d614d['update'](_0x1a18d8)[_0x68cd('0x39')](function(_0x545ac8){return _0x545ac8;});}return null;};}function removeEntity(_0x10ceb1,_0x2f0ab2){return function(_0x52dff8){if(_0x52dff8){return _0x52dff8[_0x68cd('0x3a')]()[_0x68cd('0x39')](function(){_0x10ceb1[_0x68cd('0x2f')](0xcc)[_0x68cd('0x30')]();});}};}function handleEntityNotFound(_0x40e5b9,_0x2728b0){return function(_0x304664){if(!_0x304664){_0x40e5b9['sendStatus'](0x194);}return _0x304664;};}function handleError(_0x3233cc,_0x570f7e){_0x570f7e=_0x570f7e||0x1f4;return function(_0x272068){logger[_0x68cd('0x29')](_0x272068[_0x68cd('0x3b')]);if(_0x272068[_0x68cd('0x3c')]){delete _0x272068['name'];}_0x3233cc[_0x68cd('0x2f')](_0x570f7e)[_0x68cd('0x3d')](_0x272068);};}exports[_0x68cd('0x3e')]=function(_0x4bf06e,_0x161b76){var _0xe2645a={},_0x10b45f={},_0x2642b5={'count':0x0,'rows':[]};var _0x430f10=_[_0x68cd('0x3f')](db[_0x68cd('0x40')][_0x68cd('0x41')],function(_0x16b541){return{'name':_0x16b541[_0x68cd('0x42')],'type':_0x16b541[_0x68cd('0x43')][_0x68cd('0x44')]};});_0x10b45f['model']=_[_0x68cd('0x3f')](_0x430f10,_0x68cd('0x3c'));_0x10b45f[_0x68cd('0x45')]=_[_0x68cd('0x46')](_0x4bf06e['query']);_0x10b45f[_0x68cd('0x47')]=_[_0x68cd('0x48')](_0x10b45f[_0x68cd('0x49')],_0x10b45f[_0x68cd('0x45')]);_0xe2645a[_0x68cd('0x4a')]=_[_0x68cd('0x48')](_0x10b45f[_0x68cd('0x49')],qs[_0x68cd('0x4b')](_0x4bf06e[_0x68cd('0x45')][_0x68cd('0x4b')]));_0xe2645a[_0x68cd('0x4a')]=_0xe2645a[_0x68cd('0x4a')][_0x68cd('0x4c')]?_0xe2645a[_0x68cd('0x4a')]:_0x10b45f['model'];if(!_0x4bf06e['query']['hasOwnProperty']('nolimit')){_0xe2645a[_0x68cd('0x34')]=qs[_0x68cd('0x34')](_0x4bf06e['query'][_0x68cd('0x34')]);_0xe2645a['offset']=qs[_0x68cd('0x32')](_0x4bf06e[_0x68cd('0x45')][_0x68cd('0x32')]);}_0xe2645a[_0x68cd('0x4d')]=qs['sort'](_0x4bf06e[_0x68cd('0x45')][_0x68cd('0x4e')]);_0xe2645a['where']=qs[_0x68cd('0x47')](_[_0x68cd('0x4f')](_0x4bf06e[_0x68cd('0x45')],_0x10b45f[_0x68cd('0x47')]),_0x430f10);if(_0x4bf06e[_0x68cd('0x45')][_0x68cd('0x50')]){_0xe2645a[_0x68cd('0x51')]=_[_0x68cd('0x52')](_0xe2645a[_0x68cd('0x51')],{'$or':_[_0x68cd('0x3f')](_0x430f10,function(_0x4328b2){if(_0x4328b2[_0x68cd('0x43')]!=='VIRTUAL'){var _0x40b108={};_0x40b108[_0x4328b2[_0x68cd('0x3c')]]={'$like':'%'+_0x4bf06e[_0x68cd('0x45')][_0x68cd('0x50')]+'%'};return _0x40b108;}})});}_0xe2645a=_[_0x68cd('0x52')]({},_0xe2645a,_0x4bf06e['options']);var _0x2b1818={'where':_0xe2645a[_0x68cd('0x51')]};return db['FaxMessage']['count'](_0x2b1818)['then'](function(_0x14086b){_0x2642b5[_0x68cd('0x35')]=_0x14086b;if(_0x4bf06e[_0x68cd('0x45')][_0x68cd('0x53')]){_0xe2645a[_0x68cd('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0x68cd('0x55')](_0xe2645a);})[_0x68cd('0x39')](function(_0x543de3){_0x2642b5['rows']=_0x543de3;return _0x2642b5;})[_0x68cd('0x39')](respondWithFilteredResult(_0x161b76,_0xe2645a))['catch'](handleError(_0x161b76,null));};exports[_0x68cd('0x56')]=function(_0x4cd3f7,_0x352854){var _0x137619={'raw':!![],'where':{'id':_0x4cd3f7[_0x68cd('0x57')]['id']}},_0x540342={};_0x540342[_0x68cd('0x49')]=_[_0x68cd('0x46')](db[_0x68cd('0x40')][_0x68cd('0x41')]);_0x540342[_0x68cd('0x45')]=_[_0x68cd('0x46')](_0x4cd3f7['query']);_0x540342['filters']=_['intersection'](_0x540342[_0x68cd('0x49')],_0x540342['query']);_0x137619[_0x68cd('0x4a')]=_[_0x68cd('0x48')](_0x540342[_0x68cd('0x49')],qs['fields'](_0x4cd3f7[_0x68cd('0x45')][_0x68cd('0x4b')]));_0x137619[_0x68cd('0x4a')]=_0x137619[_0x68cd('0x4a')]['length']?_0x137619[_0x68cd('0x4a')]:_0x540342[_0x68cd('0x49')];if(_0x4cd3f7['query'][_0x68cd('0x53')]){_0x137619[_0x68cd('0x54')]=[{'all':!![]}];}_0x137619=_[_0x68cd('0x52')]({},_0x137619,_0x4cd3f7[_0x68cd('0x58')]);return db[_0x68cd('0x40')]['find'](_0x137619)[_0x68cd('0x39')](handleEntityNotFound(_0x352854,null))[_0x68cd('0x39')](respondWithResult(_0x352854,null))[_0x68cd('0x2d')](handleError(_0x352854,null));};exports[_0x68cd('0x59')]=function(_0x246e07,_0x58a9ea){if(_0x246e07['body']['id']){delete _0x246e07[_0x68cd('0x5a')]['id'];}return db[_0x68cd('0x40')][_0x68cd('0x5b')]({'where':{'id':_0x246e07[_0x68cd('0x57')]['id']}})[_0x68cd('0x39')](handleEntityNotFound(_0x58a9ea,null))[_0x68cd('0x39')](saveUpdates(_0x246e07[_0x68cd('0x5a')],null))[_0x68cd('0x39')](respondWithResult(_0x58a9ea,null))[_0x68cd('0x2d')](handleError(_0x58a9ea,null));};exports['destroy']=function(_0x3ca96c,_0x398fc9){return db['FaxMessage'][_0x68cd('0x5b')]({'where':{'id':_0x3ca96c[_0x68cd('0x57')]['id']}})[_0x68cd('0x39')](handleEntityNotFound(_0x398fc9,null))[_0x68cd('0x39')](removeEntity(_0x398fc9,null))[_0x68cd('0x2d')](handleError(_0x398fc9,null));};exports[_0x68cd('0x5c')]=function(_0x19016b,_0x1f7f08){return db['FaxMessage'][_0x68cd('0x5c')]()[_0x68cd('0x39')](respondWithResult(_0x1f7f08,null))[_0x68cd('0x2d')](handleError(_0x1f7f08,null));};var interaction_log=require(_0x68cd('0x5d'))('fax-interactions');exports[_0x68cd('0x5e')]=function(_0x2b4656,_0x537f85,_0x3ae39d){var _0x42215c={'agent':{},'channel':'fax'};if(_0x2b4656['body']['id']){delete _0x2b4656[_0x68cd('0x5a')]['id'];}_0x2b4656[_0x68cd('0x5a')][_0x68cd('0x5f')]=!![];_0x2b4656[_0x68cd('0x5a')][_0x68cd('0x60')]=moment()['format'](_0x68cd('0x61'));_0x2b4656[_0x68cd('0x5a')][_0x68cd('0x62')]=_0x2b4656[_0x68cd('0x5a')][_0x68cd('0x62')]||_0x2b4656[_0x68cd('0x63')]['id'];_0x42215c[_0x68cd('0x64')]['id']=_0x2b4656[_0x68cd('0x5a')][_0x68cd('0x62')];return db['FaxMessage'][_0x68cd('0x5b')]({'where':{'id':_0x2b4656[_0x68cd('0x57')]['id'],'UserId':null}})[_0x68cd('0x39')](handleEntityNotFound(_0x537f85,null))['then'](saveUpdates(_0x2b4656[_0x68cd('0x5a')],null))[_0x68cd('0x39')](function(_0x43501c){if(_0x43501c){_0x42215c[_0x68cd('0x2b')]=_0x43501c[_0x68cd('0x65')]({'plain':!![]});return db[_0x68cd('0x66')][_0x68cd('0x5b')]({'where':{'id':_0x43501c[_0x68cd('0x67')]}});}return null;})[_0x68cd('0x39')](handleEntityNotFound(_0x537f85,null))[_0x68cd('0x39')](function(_0xed40a3){if(_0xed40a3){return _0xed40a3[_0x68cd('0x59')]({'UserId':_0x2b4656[_0x68cd('0x5a')][_0x68cd('0x62')],'read1stAt':_['isNil'](_0xed40a3[_0x68cd('0x68')])?moment()[_0x68cd('0x69')](_0x68cd('0x61')):undefined});}return null;})[_0x68cd('0x39')](function(_0x544712){if(_0x544712){_0x42215c[_0x68cd('0x6a')]=_0x544712[_0x68cd('0x65')]({'plain':!![]});interaction_log[_0x68cd('0x23')](_0x68cd('0x6b'),_0x2b4656[_0x68cd('0x63')]['id'],_0x2b4656[_0x68cd('0x63')][_0x68cd('0x3c')],_0x2b4656[_0x68cd('0x63')][_0x68cd('0x6c')],_0x42215c[_0x68cd('0x6a')]['id'],_0x2b4656['body']?JSON[_0x68cd('0x28')](_0x2b4656[_0x68cd('0x5a')]):_0x68cd('0x6d'));return respondWithRpcPromise('AcceptMessage',_0x68cd('0x6e'),_0x42215c);}return null;})[_0x68cd('0x39')](function(_0x50d510){var _0x20709b=_0x68cd('0x6f')+_0x50d510[_0x68cd('0x2b')][_0x68cd('0x70')];return db[_0x68cd('0x71')][_0x68cd('0x45')](_0x20709b,{'type':db[_0x68cd('0x72')][_0x68cd('0x73')]['SELECT'],'raw':!![]})[_0x68cd('0x39')](function(_0x5d47e7){return _0x5d47e7;});})['then'](function(_0x5be938){if(_0x5be938){_0x42215c[_0x68cd('0x2b')][_0x68cd('0x74')]=_0x5be938[0x0];if(!_0x2b4656[_0x68cd('0x5a')]['UserId'])return;return db[_0x68cd('0x75')][_0x68cd('0x5b')]({'where':{'id':_0x2b4656['body'][_0x68cd('0x62')],'role':'agent'},'attributes':['id','name',_0x68cd('0x76'),_0x68cd('0x77'),_0x68cd('0x78')],'raw':!![]});}return null;})[_0x68cd('0x39')](function(_0x14f17e){if(!_0x14f17e)return null;_0x42215c[_0x68cd('0x2b')][_0x68cd('0x64')]=_0x14f17e;return _0x42215c;})[_0x68cd('0x39')](function(_0x3a1fb1){if(_0x3a1fb1){if(_0x2b4656['body']['manual']){_0x42215c['message']['interface']=util[_0x68cd('0x69')](_0x68cd('0x79'),_0x2b4656[_0x68cd('0x63')][_0x68cd('0x3c')]);_0x42215c[_0x68cd('0x2b')][_0x68cd('0x7a')]=_0x42215c[_0x68cd('0x7a')];_0x42215c[_0x68cd('0x2b')][_0x68cd('0x7b')]='accept';return respondWithRpcPromise(_0x68cd('0x7c'),_0x68cd('0x7c'),{'event':'acceptmessage','message':_0x42215c[_0x68cd('0x2b')]},client9002)[_0x68cd('0x39')](function(){return _0x42215c;});}return _0x42215c;}return null;})[_0x68cd('0x39')](respondWithResult(_0x537f85,null))[_0x68cd('0x2d')](handleError(_0x537f85,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x68cd('0x38')]=function(_0x361863,_0x594744,_0x3c04be){var _0x51ea71={'agent':{},'channel':_0x68cd('0x7d')};if(_0x361863[_0x68cd('0x5a')]['id']){delete _0x361863[_0x68cd('0x5a')]['id'];}_0x361863[_0x68cd('0x5a')][_0x68cd('0x62')]=_0x361863[_0x68cd('0x5a')][_0x68cd('0x62')]||_0x361863['user']['id'];_0x51ea71['agent']['id']=_0x361863['body'][_0x68cd('0x62')];return db[_0x68cd('0x40')][_0x68cd('0x5b')]({'where':{'id':_0x361863[_0x68cd('0x57')]['id'],'UserId':null}})[_0x68cd('0x39')](handleEntityNotFound(_0x594744,null))['then'](function(_0x2e71bf){if(_0x2e71bf){_0x51ea71[_0x68cd('0x2b')]=_0x2e71bf[_0x68cd('0x65')]({'plain':!![]});return db[_0x68cd('0x66')][_0x68cd('0x5b')]({'where':{'id':_0x2e71bf['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x594744,null))['then'](function(_0xb2f80a){if(_0xb2f80a){_0x51ea71[_0x68cd('0x6a')]=_0xb2f80a['get']({'plain':!![]});interaction_log[_0x68cd('0x23')](_0x68cd('0x7e'),_0x361863[_0x68cd('0x63')]['id'],_0x361863['user']['name'],_0x361863[_0x68cd('0x63')][_0x68cd('0x6c')],_0x51ea71['interaction']['id'],_0x361863[_0x68cd('0x5a')]?JSON[_0x68cd('0x28')](_0x361863['body']):_0x68cd('0x6d'));return respondWithRpcPromise(_0x68cd('0x7f'),_0x68cd('0x80'),_0x51ea71);}return null;})[_0x68cd('0x39')](function(_0x3c2067){var _0x4f9712=_0x68cd('0x6f')+_0x3c2067['message'][_0x68cd('0x70')];return db['sequelize'][_0x68cd('0x45')](_0x4f9712,{'type':db[_0x68cd('0x72')][_0x68cd('0x73')][_0x68cd('0x81')],'raw':!![]})[_0x68cd('0x39')](function(_0x2d00dd){return _0x2d00dd;});})['then'](function(_0x3ce00c){if(_0x3ce00c){_0x51ea71['message'][_0x68cd('0x74')]=_0x3ce00c[0x0];if(!_0x361863['body'][_0x68cd('0x62')])return;return db[_0x68cd('0x75')][_0x68cd('0x5b')]({'where':{'id':_0x361863['body'][_0x68cd('0x62')],'role':'agent'},'attributes':['id',_0x68cd('0x3c'),_0x68cd('0x76'),_0x68cd('0x77'),_0x68cd('0x78')],'raw':!![]});}return null;})['then'](function(_0x2f8b89){if(!_0x2f8b89)return null;_0x51ea71[_0x68cd('0x2b')][_0x68cd('0x64')]=_0x2f8b89;return _0x51ea71;})[_0x68cd('0x39')](function(_0x15d748){if(_0x15d748){_0x15d748[_0x68cd('0x2b')]['interface']=util[_0x68cd('0x69')]('SIP/%s',_0x361863[_0x68cd('0x63')][_0x68cd('0x3c')]);_0x15d748[_0x68cd('0x2b')][_0x68cd('0x7a')]=_0x51ea71[_0x68cd('0x7a')];_0x15d748['message'][_0x68cd('0x7b')]='reject';respondWithRpcPromise(_0x68cd('0x7c'),_0x68cd('0x7c'),{'event':_0x68cd('0x82'),'message':_0x15d748[_0x68cd('0x2b')]},client9002);return _0x51ea71;}return null;})[_0x68cd('0x39')](respondWithResult(_0x594744,null))[_0x68cd('0x2d')](handleError(_0x594744,null));};exports[_0x68cd('0x83')]=function(_0x391c23,_0x145ff6){var _0x1f92b5;return db['FaxMessage']['create'](_0x391c23[_0x68cd('0x5a')],{})[_0x68cd('0x39')](function(_0x42949c){_0x1f92b5=_0x42949c;return db[_0x68cd('0x84')][_0x68cd('0x85')]({'where':{'id':_0x1f92b5['ContactId']}});})[_0x68cd('0x39')](function(_0x658989){if(_[_0x68cd('0x86')](_0x658989)){return;}else{_0x1f92b5[_0x68cd('0x7d')]=_0x658989[_0x68cd('0x7d')];return db[_0x68cd('0x87')][_0x68cd('0x85')]({'where':{'id':_0x1f92b5[_0x68cd('0x88')]}});}})['then'](function(_0x4837a8){return respondWithRpcPromise('SendFax',_0x68cd('0x89'),{'FaxAccountId':_[_0x68cd('0x86')](_0x391c23['body'])?undefined:_0x391c23[_0x68cd('0x5a')]['FaxAccountId'],'path':_[_0x68cd('0x86')](_0x4837a8)?undefined:util['format'](_0x68cd('0x8a'),_0x4837a8[_0x68cd('0x8b')]),'fax':_['isNil'](_0x1f92b5[_0x68cd('0x7d')])?undefined:_0x1f92b5['fax'],'AttachmentId':_0x1f92b5['AttachmentId']},client9002);})[_0x68cd('0x39')](respondWithResult(_0x145ff6,0xc9))['catch'](handleError(_0x145ff6,null));};exports[_0x68cd('0x8c')]=function(_0x3c3d69,_0x1d168f){var _0x5751b4=path['join'](config[_0x68cd('0x8d')],_0x68cd('0x8e'),_0x68cd('0x8f'),_0x68cd('0x90'));return db[_0x68cd('0x40')][_0x68cd('0x5b')]({'where':{'id':_0x3c3d69['params']['id']},'include':[{'model':db[_0x68cd('0x87')],'as':'Attachment'}]})[_0x68cd('0x39')](handleEntityNotFound(_0x1d168f,null))[_0x68cd('0x39')](function(_0x398986){if(_0x398986){return _0x1d168f[_0x68cd('0x8c')](path[_0x68cd('0x91')](_0x5751b4,_0x398986[_0x68cd('0x87')][_0x68cd('0x8b')]));}})[_0x68cd('0x2d')](handleError(_0x1d168f,null));};
\ No newline at end of file
index 6206abc..feb1f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd906=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','FaxMessage'];(function(_0x9366d4,_0x51a60b){var _0x29addd=function(_0x19912b){while(--_0x19912b){_0x9366d4['push'](_0x9366d4['shift']());}};_0x29addd(++_0x51a60b);}(_0xd906,0x6b));var _0x6d90=function(_0x113c43,_0x475fc1){_0x113c43=_0x113c43-0x0;var _0x51fbae=_0xd906[_0x113c43];return _0x51fbae;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x6d90('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x6d90('0x1')](0x0);var events={'afterCreate':_0x6d90('0x2'),'afterUpdate':_0x6d90('0x3'),'afterDestroy':_0x6d90('0x4')};function emitEvent(_0x4d5bbd){return function(_0x2ae140,_0x431c1e,_0x132c67){FaxMessageEvents[_0x6d90('0x5')](_0x4d5bbd+':'+_0x2ae140['id'],_0x2ae140);FaxMessageEvents['emit'](_0x4d5bbd,_0x2ae140);_0x132c67(null);};}for(var e in events){if(events[_0x6d90('0x6')](e)){var event=events[e];FaxMessage[_0x6d90('0x7')](e,emitEvent(event));}}module[_0x6d90('0x8')]=FaxMessageEvents;
\ No newline at end of file
+var _0x4253=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x7ff3a6,_0xa9ca89){var _0x418450=function(_0x4eabe2){while(--_0x4eabe2){_0x7ff3a6['push'](_0x7ff3a6['shift']());}};_0x418450(++_0xa9ca89);}(_0x4253,0x14c));var _0x3425=function(_0x42844e,_0x1142f3){_0x42844e=_0x42844e-0x0;var _0x2800cb=_0x4253[_0x42844e];return _0x2800cb;};'use strict';var EventEmitter=require(_0x3425('0x0'));var FaxMessage=require(_0x3425('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3425('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3425('0x3'),'afterDestroy':_0x3425('0x4')};function emitEvent(_0x1f7ac0){return function(_0xaac4fd,_0x26365a,_0x4652f1){FaxMessageEvents[_0x3425('0x5')](_0x1f7ac0+':'+_0xaac4fd['id'],_0xaac4fd);FaxMessageEvents[_0x3425('0x5')](_0x1f7ac0,_0xaac4fd);_0x4652f1(null);};}for(var e in events){if(events[_0x3425('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x3425('0x7')]=FaxMessageEvents;
\ No newline at end of file
index 4aef597..1075543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d62=['util','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','direction','toLowerCase','out','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3245e7,_0x452e02){var _0x1a452b=function(_0x586c7b){while(--_0x586c7b){_0x3245e7['push'](_0x3245e7['shift']());}};_0x1a452b(++_0x452e02);}(_0x9d62,0x118));var _0x29d6=function(_0x9fb5f2,_0x4d3901){_0x9fb5f2=_0x9fb5f2-0x0;var _0x540d23=_0x9d62[_0x9fb5f2];return _0x540d23;};'use strict';var _=require('lodash');var util=require(_0x29d6('0x0'));var logger=require('../../config/logger')(_0x29d6('0x1'));var moment=require(_0x29d6('0x2'));var BPromise=require(_0x29d6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x29d6('0x4'));var rimraf=require(_0x29d6('0x5'));var config=require(_0x29d6('0x6'));var attributes=require(_0x29d6('0x7'));module['exports']=function(_0xeaaad5,_0x1fe143){return _0xeaaad5[_0x29d6('0x8')](_0x29d6('0x9'),attributes,{'tableName':_0x29d6('0xa'),'paranoid':![],'indexes':[{'name':_0x29d6('0xb'),'fields':[_0x29d6('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3cce8c,_0x1e4d69,_0x427b03){var _0x5da869=_0xeaaad5[_0x29d6('0xd')];var _0x40b9a0=_0x3cce8c[_0x29d6('0xe')]({'plain':!![]});if(_0x40b9a0[_0x29d6('0xf')][_0x29d6('0x10')]()==='in'||_0x40b9a0[_0x29d6('0xf')][_0x29d6('0x10')]()===_0x29d6('0x11')&&!_0x40b9a0['secret']&&!_['isNil'](_0x40b9a0[_0x29d6('0x12')])){_0x5da869[_0x29d6('0x13')][_0x29d6('0x14')]({'where':{'id':_0x40b9a0[_0x29d6('0x15')]}})[_0x29d6('0x16')](function(_0x2ce0bf){if(_0x2ce0bf){_0x2ce0bf['update']({'lastMsgAt':_0x40b9a0[_0x29d6('0x17')],'lastMsgDirection':_0x40b9a0[_0x29d6('0xf')]['toLowerCase']()});}})[_0x29d6('0x18')](function(_0x45eb84){console[_0x29d6('0x19')](_0x45eb84);});}_0x427b03();}},'charset':_0x29d6('0x1a'),'collate':_0x29d6('0x1b')});};
\ No newline at end of file
+var _0xc237=['update','catch','error','utf8mb4','utf8mb4_unicode_ci','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','findOne','FaxInteractionId','then'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0xc237,0x157));var _0x7c23=function(_0x3037d2,_0x70eac9){_0x3037d2=_0x3037d2-0x0;var _0x2b770c=_0xc237[_0x3037d2];return _0x2b770c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7c23('0x0'));var moment=require(_0x7c23('0x1'));var BPromise=require('bluebird');var rp=require(_0x7c23('0x2'));var fs=require('fs');var path=require(_0x7c23('0x3'));var rimraf=require('rimraf');var config=require(_0x7c23('0x4'));var attributes=require(_0x7c23('0x5'));module[_0x7c23('0x6')]=function(_0x4dd4b2,_0x27f147){return _0x4dd4b2['define'](_0x7c23('0x7'),attributes,{'tableName':_0x7c23('0x8'),'paranoid':![],'indexes':[{'name':_0x7c23('0x9'),'fields':[_0x7c23('0xa')],'type':_0x7c23('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1469a4,_0x39d77a,_0x1399e2){var _0x4077b1=_0x4dd4b2['models'];var _0x55c3ed=_0x1469a4[_0x7c23('0xc')]({'plain':!![]});if(_0x55c3ed[_0x7c23('0xd')][_0x7c23('0xe')]()==='in'||_0x55c3ed[_0x7c23('0xd')]['toLowerCase']()===_0x7c23('0xf')&&!_0x55c3ed['secret']&&!_[_0x7c23('0x10')](_0x55c3ed[_0x7c23('0x11')])){_0x4077b1['FaxInteraction'][_0x7c23('0x12')]({'where':{'id':_0x55c3ed[_0x7c23('0x13')]}})[_0x7c23('0x14')](function(_0x1c296d){if(_0x1c296d){_0x1c296d[_0x7c23('0x15')]({'lastMsgAt':_0x55c3ed['createdAt'],'lastMsgDirection':_0x55c3ed[_0x7c23('0xd')][_0x7c23('0xe')]()});}})[_0x7c23('0x16')](function(_0x1c3e49){console[_0x7c23('0x17')](_0x1c3e49);});}_0x1399e2();}},'charset':_0x7c23('0x18'),'collate':_0x7c23('0x19')});};
\ No newline at end of file
index 9b7868a..2a2e46c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x141480,_0x26f326){var _0x2c0e5e=function(_0x405b34){while(--_0x405b34){_0x141480['push'](_0x141480['shift']());}};_0x2c0e5e(++_0x26f326);}(_0x032e,0x124));var _0xe032=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x032e[_0x14add3];return _0x4a174f;};'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
+var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fd1,0x155));var _0x15fd=function(_0x4a3900,_0x3339ee){_0x4a3900=_0x4a3900-0x0;var _0x341723=_0x5fd1[_0x4a3900];return _0x341723;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});};
\ No newline at end of file
index 589e4e2..a818ef3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66be=['emit','removeListener','register','faxMessage:','./faxMessage.events','update'];(function(_0x35f2bb,_0x57cf1b){var _0x68ee51=function(_0x4df34a){while(--_0x4df34a){_0x35f2bb['push'](_0x35f2bb['shift']());}};_0x68ee51(++_0x57cf1b);}(_0x66be,0x1e4));var _0xe66b=function(_0x5818b2,_0x3a60e7){_0x5818b2=_0x5818b2-0x0;var _0x58cd50=_0x66be[_0x5818b2];return _0x58cd50;};'use strict';var FaxMessageEvents=require(_0xe66b('0x0'));var events=['save','remove',_0xe66b('0x1')];function createListener(_0x3dab98,_0x13cd15){return function(_0x2e9981){_0x13cd15[_0xe66b('0x2')](_0x3dab98,_0x2e9981);};}function removeListener(_0x487685,_0x4a4768){return function(){FaxMessageEvents[_0xe66b('0x3')](_0x487685,_0x4a4768);};}exports[_0xe66b('0x4')]=function(_0x223543){for(var _0x29a719=0x0,_0x386695=events['length'];_0x29a719<_0x386695;_0x29a719++){var _0x249588=events[_0x29a719];var _0x1420f7=createListener(_0xe66b('0x5')+_0x249588,_0x223543);FaxMessageEvents['on'](_0x249588,_0x1420f7);}};
\ No newline at end of file
+var _0x4934=['register','faxMessage:','./faxMessage.events','emit','removeListener'];(function(_0xeaab14,_0x53836e){var _0x474c61=function(_0x13d0f0){while(--_0x13d0f0){_0xeaab14['push'](_0xeaab14['shift']());}};_0x474c61(++_0x53836e);}(_0x4934,0x147));var _0x4493=function(_0x3dd19d,_0x439323){_0x3dd19d=_0x3dd19d-0x0;var _0x2028b3=_0x4934[_0x3dd19d];return _0x2028b3;};'use strict';var FaxMessageEvents=require(_0x4493('0x0'));var events=['save','remove','update'];function createListener(_0x1ca16c,_0x2b645a){return function(_0x4a3d1e){_0x2b645a[_0x4493('0x1')](_0x1ca16c,_0x4a3d1e);};}function removeListener(_0x161bd4,_0x3baaae){return function(){FaxMessageEvents[_0x4493('0x2')](_0x161bd4,_0x3baaae);};}exports[_0x4493('0x3')]=function(_0x37e5a3){for(var _0x39c4e2=0x0,_0x5ad527=events['length'];_0x39c4e2<_0x5ad527;_0x39c4e2++){var _0x3681fd=events[_0x39c4e2];var _0x276662=createListener(_0x4493('0x4')+_0x3681fd,_0x37e5a3);FaxMessageEvents['on'](_0x3681fd,_0x276662);}};
\ No newline at end of file
index 19c7cf7..86bd453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x702d=['get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','post','tracked','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1703cd,_0x3c8ade){var _0x13ed83=function(_0x222f97){while(--_0x222f97){_0x1703cd['push'](_0x1703cd['shift']());}};_0x13ed83(++_0x3c8ade);}(_0x702d,0x147));var _0xd702=function(_0x17187f,_0xa130bc){_0x17187f=_0x17187f-0x0;var _0x52a06b=_0x702d[_0x17187f];return _0x52a06b;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var fs_extra=require(_0xd702('0x5'));var auth=require(_0xd702('0x6'));var interaction=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var controller=require('./faxMessage.controller');router[_0xd702('0x9')]('/',auth['isAuthenticated'](),controller[_0xd702('0xa')]);router[_0xd702('0x9')](_0xd702('0xb'),auth['isAuthenticated'](),controller[_0xd702('0xc')]);router['get'](_0xd702('0xd'),auth[_0xd702('0xe')](),controller[_0xd702('0xf')]);router[_0xd702('0x9')](_0xd702('0x10'),auth[_0xd702('0xe')](),controller[_0xd702('0x11')]);router[_0xd702('0x12')]('/',auth[_0xd702('0xe')](),interaction[_0xd702('0x13')]('fax','faxmessage:create'),controller[_0xd702('0x14')]);router[_0xd702('0x15')](_0xd702('0xd'),auth['isAuthenticated'](),controller[_0xd702('0x16')]);router[_0xd702('0x15')](_0xd702('0x17'),auth[_0xd702('0xe')](),controller[_0xd702('0x18')]);router[_0xd702('0x15')]('/:id/reject',auth[_0xd702('0xe')](),controller[_0xd702('0x19')]);router['delete'](_0xd702('0xd'),auth['isAuthenticated'](),controller[_0xd702('0x1a')]);module[_0xd702('0x1b')]=router;
\ No newline at end of file
+var _0x9bde=['index','/describe','isAuthenticated','describe','/:id','show','download','post','fax','faxmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get'];(function(_0x17d8ee,_0x146eee){var _0xa6adda=function(_0x56f75b){while(--_0x56f75b){_0x17d8ee['push'](_0x17d8ee['shift']());}};_0xa6adda(++_0x146eee);}(_0x9bde,0xe1));var _0xe9bd=function(_0x528498,_0x43803a){_0x528498=_0x528498-0x0;var _0x4f5b04=_0x9bde[_0x528498];return _0x4f5b04;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xe9bd('0xf')]);router[_0xe9bd('0x10')]('/',auth[_0xe9bd('0xb')](),interaction['tracked'](_0xe9bd('0x11'),_0xe9bd('0x12')),controller[_0xe9bd('0x13')]);router[_0xe9bd('0x14')]('/:id',auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x14')](_0xe9bd('0x15'),auth[_0xe9bd('0xb')](),controller['accept']);router['put'](_0xe9bd('0x16'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x17')]);router[_0xe9bd('0x18')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x19')]);module['exports']=router;
\ No newline at end of file
index 4605433..d44dee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd6e=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x5e302e,_0x317f71){var _0x3822a1=function(_0x148f8f){while(--_0x148f8f){_0x5e302e['push'](_0x5e302e['shift']());}};_0x3822a1(++_0x317f71);}(_0xfd6e,0x183));var _0xefd6=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd6e[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xefd6('0x0'));module[_0xefd6('0x1')]={'name':{'type':Sequelize[_0xefd6('0x2')],'unique':_0xefd6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefd6('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xefd6('0x4')](_0xefd6('0x5'),_0xefd6('0x6'),_0xefd6('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5e2f=['exports','STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x26bb26,_0x11a89c){var _0x9b5702=function(_0x124078){while(--_0x124078){_0x26bb26['push'](_0x26bb26['shift']());}};_0x9b5702(++_0x11a89c);}(_0x5e2f,0x133));var _0xf5e2=function(_0x359664,_0x38c240){_0x359664=_0x359664-0x0;var _0x5d6f33=_0x5e2f[_0x359664];return _0x5d6f33;};'use strict';var Sequelize=require(_0xf5e2('0x0'));module[_0xf5e2('0x1')]={'name':{'type':Sequelize[_0xf5e2('0x2')],'unique':_0xf5e2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf5e2('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf5e2('0x5')]('rrmemory','beepall',_0xf5e2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 732a934..a8c8706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c17=['online','voicePause','interface','sequelize','each','findOrCreate','emit','userFaxQueue:save','field','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','all','union','removeTeams','removeAgents','forEach','userFaxQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','destroy','then','get','UserProfileResource','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','catch','attributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxQueues','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','UserId','faxPause','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents'];(function(_0x5c76f5,_0xf2a68){var _0x548079=function(_0xfd543a){while(--_0xfd543a){_0x5c76f5['push'](_0x5c76f5['shift']());}};_0x548079(++_0xf2a68);}(_0x5c17,0x1b2));var _0x75c1=function(_0x2c0cec,_0x4e3f2a){_0x2c0cec=_0x2c0cec-0x0;var _0x5cfdde=_0x5c17[_0x2c0cec];return _0x5cfdde;};'use strict';var emlformat=require(_0x75c1('0x0'));var rimraf=require(_0x75c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x75c1('0x2'));var rp=require(_0x75c1('0x3'));var moment=require(_0x75c1('0x4'));var BPromise=require(_0x75c1('0x5'));var Mustache=require(_0x75c1('0x6'));var util=require('util');var path=require(_0x75c1('0x7'));var sox=require(_0x75c1('0x8'));var csv=require(_0x75c1('0x9'));var ejs=require(_0x75c1('0xa'));var fs=require('fs');var fs_extra=require(_0x75c1('0xb'));var _=require(_0x75c1('0xc'));var squel=require(_0x75c1('0xd'));var crypto=require(_0x75c1('0xe'));var jsforce=require(_0x75c1('0xf'));var deskjs=require(_0x75c1('0x10'));var toCsv=require(_0x75c1('0x9'));var querystring=require('querystring');var Papa=require(_0x75c1('0x11'));var Redis=require(_0x75c1('0x12'));var authService=require(_0x75c1('0x13'));var qs=require(_0x75c1('0x14'));var as=require(_0x75c1('0x15'));var hardwareService=require(_0x75c1('0x16'));var logger=require('../../config/logger')(_0x75c1('0x17'));var utils=require(_0x75c1('0x18'));var config=require(_0x75c1('0x19'));var licenseUtil=require(_0x75c1('0x1a'));var db=require(_0x75c1('0x1b'))['db'];config[_0x75c1('0x1c')]=_[_0x75c1('0x1d')](config[_0x75c1('0x1c')],{'host':_0x75c1('0x1e'),'port':0x18eb});var socket=require(_0x75c1('0x1f'))(new Redis(config[_0x75c1('0x1c')]));require(_0x75c1('0x20'))['register'](socket);function respondWithStatusCode(_0x30d9a8,_0x565ba8){_0x565ba8=_0x565ba8||0xcc;return function(_0x1db2c8){if(_0x1db2c8){return _0x30d9a8[_0x75c1('0x21')](_0x565ba8);}return _0x30d9a8[_0x75c1('0x22')](_0x565ba8)[_0x75c1('0x23')]();};}function respondWithResult(_0xf0bd16,_0x475532){_0x475532=_0x475532||0xc8;return function(_0x451115){if(_0x451115){return _0xf0bd16[_0x75c1('0x22')](_0x475532)[_0x75c1('0x24')](_0x451115);}};}function respondWithFilteredResult(_0x5085c4,_0x11b44d){return function(_0x2cde73){if(_0x2cde73){var _0x1d324e=typeof _0x11b44d[_0x75c1('0x25')]==='undefined'&&typeof _0x11b44d[_0x75c1('0x26')]===_0x75c1('0x27');var _0x53eea2=_0x2cde73[_0x75c1('0x28')];var _0x34c100=_0x1d324e?0x0:_0x11b44d[_0x75c1('0x25')];var _0x1ca22c=_0x1d324e?_0x2cde73[_0x75c1('0x28')]:_0x11b44d[_0x75c1('0x25')]+_0x11b44d[_0x75c1('0x26')];var _0x198b3a;if(_0x1ca22c>=_0x53eea2){_0x1ca22c=_0x53eea2;_0x198b3a=0xc8;}else{_0x198b3a=0xce;}_0x5085c4[_0x75c1('0x22')](_0x198b3a);return _0x5085c4['set']('Content-Range',_0x34c100+'-'+_0x1ca22c+'/'+_0x53eea2)['json'](_0x2cde73);}return null;};}function patchUpdates(_0x1d3830){return function(_0x551e91){try{jsonpatch['apply'](_0x551e91,_0x1d3830,!![]);}catch(_0x20da8d){return BPromise[_0x75c1('0x29')](_0x20da8d);}return _0x551e91[_0x75c1('0x2a')]();};}function saveUpdates(_0x31cf8d,_0x28df7e){return function(_0x5a5925){if(_0x5a5925){return _0x5a5925[_0x75c1('0x2b')](_0x31cf8d)['then'](function(_0x390d9e){return _0x390d9e;});}return null;};}function removeEntity(_0x213040,_0x4869e7){return function(_0x303d26){if(_0x303d26){return _0x303d26[_0x75c1('0x2c')]()[_0x75c1('0x2d')](function(){var _0x4f09ef=_0x303d26[_0x75c1('0x2e')]({'plain':!![]});var _0x324df2='FaxQueues';return db[_0x75c1('0x2f')][_0x75c1('0x2c')]({'where':{'type':_0x324df2,'resourceId':_0x4f09ef['id']}})[_0x75c1('0x2d')](function(){return _0x303d26;});})['then'](function(){_0x213040[_0x75c1('0x22')](0xcc)[_0x75c1('0x23')]();});}};}function handleEntityNotFound(_0x2700aa,_0x430a4e){return function(_0xc79e06){if(!_0xc79e06){_0x2700aa['sendStatus'](0x194);}return _0xc79e06;};}function handleError(_0x3260c5,_0x1e9517){_0x1e9517=_0x1e9517||0x1f4;return function(_0x59398b){logger['error'](_0x59398b['stack']);if(_0x59398b[_0x75c1('0x30')]){delete _0x59398b[_0x75c1('0x30')];}_0x3260c5[_0x75c1('0x22')](_0x1e9517)['send'](_0x59398b);};}exports[_0x75c1('0x31')]=function(_0x1ffbd3,_0x4dd243){var _0x3f3ab9={},_0x431835={},_0x2ca283={'count':0x0,'rows':[]};var _0x450437=_[_0x75c1('0x32')](db['FaxQueue'][_0x75c1('0x33')],function(_0x53d43a){return{'name':_0x53d43a[_0x75c1('0x34')],'type':_0x53d43a[_0x75c1('0x35')][_0x75c1('0x36')]};});_0x431835[_0x75c1('0x37')]=_['map'](_0x450437,_0x75c1('0x30'));_0x431835[_0x75c1('0x38')]=_[_0x75c1('0x39')](_0x1ffbd3['query']);_0x431835[_0x75c1('0x3a')]=_[_0x75c1('0x3b')](_0x431835['model'],_0x431835['query']);_0x3f3ab9['attributes']=_[_0x75c1('0x3b')](_0x431835['model'],qs[_0x75c1('0x3c')](_0x1ffbd3[_0x75c1('0x38')][_0x75c1('0x3c')]));_0x3f3ab9['attributes']=_0x3f3ab9['attributes']['length']?_0x3f3ab9['attributes']:_0x431835['model'];if(!_0x1ffbd3[_0x75c1('0x38')][_0x75c1('0x3d')](_0x75c1('0x3e'))){_0x3f3ab9[_0x75c1('0x26')]=qs['limit'](_0x1ffbd3[_0x75c1('0x38')][_0x75c1('0x26')]);_0x3f3ab9['offset']=qs[_0x75c1('0x25')](_0x1ffbd3[_0x75c1('0x38')][_0x75c1('0x25')]);}_0x3f3ab9[_0x75c1('0x3f')]=qs[_0x75c1('0x40')](_0x1ffbd3['query']['sort']);_0x3f3ab9['where']=qs[_0x75c1('0x3a')](_[_0x75c1('0x41')](_0x1ffbd3[_0x75c1('0x38')],_0x431835['filters']),_0x450437);if(_0x1ffbd3['query'][_0x75c1('0x42')]){_0x3f3ab9[_0x75c1('0x43')]=_[_0x75c1('0x44')](_0x3f3ab9[_0x75c1('0x43')],{'$or':_['map'](_0x450437,function(_0x8a2558){if(_0x8a2558[_0x75c1('0x35')]!==_0x75c1('0x45')){var _0x5971e9={};_0x5971e9[_0x8a2558[_0x75c1('0x30')]]={'$like':'%'+_0x1ffbd3['query'][_0x75c1('0x42')]+'%'};return _0x5971e9;}})});}_0x3f3ab9=_['merge']({},_0x3f3ab9,_0x1ffbd3[_0x75c1('0x46')]);var _0x288b5c={'where':_0x3f3ab9[_0x75c1('0x43')]};return db[_0x75c1('0x47')][_0x75c1('0x28')](_0x288b5c)[_0x75c1('0x2d')](function(_0xbe70ad){_0x2ca283[_0x75c1('0x28')]=_0xbe70ad;if(_0x1ffbd3[_0x75c1('0x38')][_0x75c1('0x48')]){_0x3f3ab9[_0x75c1('0x49')]=[{'all':!![]}];}return db['FaxQueue'][_0x75c1('0x4a')](_0x3f3ab9);})[_0x75c1('0x2d')](function(_0xa0fa06){_0x2ca283['rows']=_0xa0fa06;return _0x2ca283;})[_0x75c1('0x2d')](respondWithFilteredResult(_0x4dd243,_0x3f3ab9))[_0x75c1('0x4b')](handleError(_0x4dd243,null));};exports['show']=function(_0x43c688,_0x79d493){var _0x2c1f8f={'raw':!![],'where':{'id':_0x43c688['params']['id']}},_0x12e027={};_0x12e027[_0x75c1('0x37')]=_[_0x75c1('0x39')](db[_0x75c1('0x47')][_0x75c1('0x33')]);_0x12e027['query']=_[_0x75c1('0x39')](_0x43c688[_0x75c1('0x38')]);_0x12e027[_0x75c1('0x3a')]=_[_0x75c1('0x3b')](_0x12e027['model'],_0x12e027['query']);_0x2c1f8f[_0x75c1('0x4c')]=_[_0x75c1('0x3b')](_0x12e027[_0x75c1('0x37')],qs[_0x75c1('0x3c')](_0x43c688['query'][_0x75c1('0x3c')]));_0x2c1f8f[_0x75c1('0x4c')]=_0x2c1f8f['attributes'][_0x75c1('0x4d')]?_0x2c1f8f[_0x75c1('0x4c')]:_0x12e027['model'];if(_0x43c688['query'][_0x75c1('0x48')]){_0x2c1f8f[_0x75c1('0x49')]=[{'all':!![]}];}_0x2c1f8f=_[_0x75c1('0x44')]({},_0x2c1f8f,_0x43c688[_0x75c1('0x46')]);return db['FaxQueue'][_0x75c1('0x4e')](_0x2c1f8f)[_0x75c1('0x2d')](handleEntityNotFound(_0x79d493,null))[_0x75c1('0x2d')](respondWithResult(_0x79d493,null))[_0x75c1('0x4b')](handleError(_0x79d493,null));};exports[_0x75c1('0x4f')]=function(_0x14985d,_0x4de56d){return db[_0x75c1('0x47')]['create'](_0x14985d['body'],{})[_0x75c1('0x2d')](function(_0x377541){var _0x33959d=_0x14985d[_0x75c1('0x50')][_0x75c1('0x2e')]({'plain':!![]});if(!_0x33959d)throw new Error(_0x75c1('0x51'));if(_0x33959d['role']===_0x75c1('0x50')){var _0x2e7d24=_0x377541[_0x75c1('0x2e')]({'plain':!![]});var _0xa2b5fb=_0x75c1('0x52');return db[_0x75c1('0x53')][_0x75c1('0x4e')]({'where':{'name':_0xa2b5fb,'userProfileId':_0x33959d['userProfileId']},'raw':!![]})['then'](function(_0x49e8d5){if(_0x49e8d5&&_0x49e8d5[_0x75c1('0x54')]===0x0){return db[_0x75c1('0x2f')][_0x75c1('0x4f')]({'name':_0x2e7d24[_0x75c1('0x30')],'resourceId':_0x2e7d24['id'],'type':_0x49e8d5[_0x75c1('0x30')],'sectionId':_0x49e8d5['id']},{})['then'](function(){return _0x377541;});}else{return _0x377541;}})[_0x75c1('0x4b')](function(_0x328a7e){logger[_0x75c1('0x55')](_0x75c1('0x56'),_0x328a7e);throw _0x328a7e;});}return _0x377541;})['then'](respondWithResult(_0x4de56d,0xc9))[_0x75c1('0x4b')](handleError(_0x4de56d,null));};exports['update']=function(_0x8b6393,_0xad1e5b){if(_0x8b6393[_0x75c1('0x57')]['id']){delete _0x8b6393[_0x75c1('0x57')]['id'];}return db[_0x75c1('0x47')][_0x75c1('0x4e')]({'where':{'id':_0x8b6393['params']['id']}})[_0x75c1('0x2d')](handleEntityNotFound(_0xad1e5b,null))['then'](saveUpdates(_0x8b6393[_0x75c1('0x57')],null))[_0x75c1('0x2d')](respondWithResult(_0xad1e5b,null))[_0x75c1('0x4b')](handleError(_0xad1e5b,null));};exports[_0x75c1('0x2c')]=function(_0x52915f,_0x51044a){return db['FaxQueue'][_0x75c1('0x4e')]({'where':{'id':_0x52915f[_0x75c1('0x58')]['id']}})[_0x75c1('0x2d')](handleEntityNotFound(_0x51044a,null))['then'](removeEntity(_0x51044a,null))[_0x75c1('0x4b')](handleError(_0x51044a,null));};exports[_0x75c1('0x59')]=function(_0x373263,_0x380c4a){return db['FaxQueue'][_0x75c1('0x59')]()[_0x75c1('0x2d')](respondWithResult(_0x380c4a,null))[_0x75c1('0x4b')](handleError(_0x380c4a,null));};exports[_0x75c1('0x5a')]=function(_0x9e8d90,_0xe3eb2c,_0x2f5681){var _0x4077b8={'raw':!![],'where':{}},_0x4c757d={},_0x559a5e;return db[_0x75c1('0x47')][_0x75c1('0x5b')]({'where':{'id':_0x9e8d90[_0x75c1('0x58')]['id']}})[_0x75c1('0x2d')](handleEntityNotFound(_0xe3eb2c,null))[_0x75c1('0x2d')](function(_0x5c549b){if(_0x5c549b){_0x559a5e=_0x5c549b['get']({'plain':!![]});_0x4c757d[_0x75c1('0x37')]=_[_0x75c1('0x39')](db[_0x75c1('0x5c')]['rawAttributes']);_0x4c757d['query']=_[_0x75c1('0x39')](_0x9e8d90['query']);_0x4c757d[_0x75c1('0x3a')]=_[_0x75c1('0x3b')](_0x4c757d[_0x75c1('0x37')],_0x4c757d[_0x75c1('0x38')]);_0x4077b8[_0x75c1('0x4c')]=_['intersection'](_0x4c757d['model'],qs[_0x75c1('0x3c')](_0x9e8d90[_0x75c1('0x38')]['fields']));_0x4077b8['attributes']=_0x4077b8['attributes'][_0x75c1('0x4d')]?_0x4077b8[_0x75c1('0x4c')]:_0x4c757d[_0x75c1('0x37')];if(!_0x9e8d90[_0x75c1('0x38')][_0x75c1('0x3d')]('nolimit')){_0x4077b8[_0x75c1('0x26')]=qs[_0x75c1('0x26')](_0x9e8d90['query'][_0x75c1('0x26')]);_0x4077b8[_0x75c1('0x25')]=qs[_0x75c1('0x25')](_0x9e8d90[_0x75c1('0x38')][_0x75c1('0x25')]);}_0x4077b8['order']=qs[_0x75c1('0x40')](_0x9e8d90[_0x75c1('0x38')][_0x75c1('0x40')]);_0x4077b8[_0x75c1('0x43')]=qs[_0x75c1('0x3a')](_[_0x75c1('0x41')](_0x9e8d90['query'],_0x4c757d[_0x75c1('0x3a')]));_0x4077b8[_0x75c1('0x43')][_0x75c1('0x5d')]=_0x5c549b['id'];if(_0x9e8d90[_0x75c1('0x38')][_0x75c1('0x42')]){_0x4077b8[_0x75c1('0x43')]=_[_0x75c1('0x44')](_0x4077b8[_0x75c1('0x43')],{'$or':_[_0x75c1('0x32')](_0x4077b8[_0x75c1('0x4c')],function(_0x274e11){var _0xdc2eb3={};_0xdc2eb3[_0x274e11]={'$like':'%'+_0x9e8d90['query']['filter']+'%'};return _0xdc2eb3;})});}_0x4077b8=_[_0x75c1('0x44')]({},_0x4077b8,_0x9e8d90['options']);return db['UserFaxQueue'][_0x75c1('0x4a')](_0x4077b8);}})[_0x75c1('0x2d')](function(_0x301d9f){if(_0x301d9f){return db[_0x75c1('0x5e')]['findAndCountAll']({'where':{'id':_['map'](_0x301d9f,_0x75c1('0x5f')),'role':'agent'},'attributes':['id',_0x75c1('0x30'),_0x75c1('0x60'),'updatedAt',_0x75c1('0x61')]});}})['then'](function(_0xc3e5c6){if(_0xc3e5c6){return{'count':_0xc3e5c6[_0x75c1('0x28')],'rows':_[_0x75c1('0x32')](_0xc3e5c6['rows'],function(_0x388309){return{'membername':_0x388309[_0x75c1('0x30')],'UserId':_0x388309['id'],'queue_name':_0x559a5e['name'],'FaxQueueId':_0x559a5e['id'],'interface':util[_0x75c1('0x62')](_0x75c1('0x63'),_0x75c1('0x64'),_0x388309[_0x75c1('0x30')]),'penalty':0x0,'paused':_0x388309[_0x75c1('0x60')],'createdAt':_0x388309[_0x75c1('0x61')],'updatedAt':_0x388309['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x75c1('0x2d')](respondWithFilteredResult(_0xe3eb2c,_0x4077b8))[_0x75c1('0x4b')](handleError(_0xe3eb2c,null));};exports[_0x75c1('0x65')]=function(_0x155bef,_0x59024e,_0x242e45){var _0x2701ae={};var _0x526180={};var _0x411a25;var _0x28f7d1;return db[_0x75c1('0x47')][_0x75c1('0x5b')]({'where':{'id':_0x155bef[_0x75c1('0x58')]['id']}})[_0x75c1('0x2d')](handleEntityNotFound(_0x59024e,null))[_0x75c1('0x2d')](function(_0xd54808){if(_0xd54808){_0x411a25=_0xd54808;_0x526180['model']=_['keys'](db[_0x75c1('0x66')][_0x75c1('0x33')]);_0x526180['query']=_[_0x75c1('0x39')](_0x155bef[_0x75c1('0x38')]);_0x526180[_0x75c1('0x3a')]=_[_0x75c1('0x3b')](_0x526180[_0x75c1('0x37')],_0x526180[_0x75c1('0x38')]);_0x2701ae[_0x75c1('0x4c')]=_[_0x75c1('0x3b')](_0x526180[_0x75c1('0x37')],qs['fields'](_0x155bef[_0x75c1('0x38')]['fields']));_0x2701ae[_0x75c1('0x4c')]=_0x2701ae[_0x75c1('0x4c')][_0x75c1('0x4d')]?_0x2701ae[_0x75c1('0x4c')]:_0x526180['model'];_0x2701ae[_0x75c1('0x3f')]=qs['sort'](_0x155bef['query'][_0x75c1('0x40')]);_0x2701ae[_0x75c1('0x43')]=qs[_0x75c1('0x3a')](_[_0x75c1('0x41')](_0x155bef[_0x75c1('0x38')],_0x526180[_0x75c1('0x3a')]));if(_0x155bef[_0x75c1('0x38')][_0x75c1('0x42')]){_0x2701ae[_0x75c1('0x43')]=_[_0x75c1('0x44')](_0x2701ae[_0x75c1('0x43')],{'$or':_[_0x75c1('0x32')](_0x2701ae[_0x75c1('0x4c')],function(_0x2c3871){var _0x20f0fd={};_0x20f0fd[_0x2c3871]={'$like':'%'+_0x155bef['query'][_0x75c1('0x42')]+'%'};return _0x20f0fd;})});}_0x2701ae=_[_0x75c1('0x44')]({},_0x2701ae,_0x155bef[_0x75c1('0x46')]);return _0x411a25['getTeams'](_0x2701ae);}})[_0x75c1('0x2d')](function(_0x43e2b7){if(_0x43e2b7){_0x28f7d1=_0x43e2b7[_0x75c1('0x4d')];if(!_0x155bef['query'][_0x75c1('0x3d')](_0x75c1('0x3e'))){_0x2701ae[_0x75c1('0x26')]=qs[_0x75c1('0x26')](_0x155bef[_0x75c1('0x38')][_0x75c1('0x26')]);_0x2701ae['offset']=qs[_0x75c1('0x25')](_0x155bef[_0x75c1('0x38')][_0x75c1('0x25')]);}return _0x411a25[_0x75c1('0x65')](_0x2701ae);}})['then'](function(_0x3d38f3){if(_0x3d38f3){return _0x3d38f3?{'count':_0x28f7d1,'rows':_0x3d38f3}:null;}})[_0x75c1('0x2d')](respondWithResult(_0x59024e,null))[_0x75c1('0x4b')](handleError(_0x59024e,null));};exports[_0x75c1('0x67')]=function(_0x10db73,_0x5a5e54,_0x415fba){var _0x311e2c=_0x10db73[_0x75c1('0x57')][_0x75c1('0x68')];return db['Team'][_0x75c1('0x4a')]({'where':{'id':_0x311e2c},'attributes':['id'],'include':[{'model':db[_0x75c1('0x5e')],'as':_0x75c1('0x69'),'attributes':['id','name',_0x75c1('0x6a'),_0x75c1('0x6b'),_0x75c1('0x6c')],'raw':!![]}]})[_0x75c1('0x2d')](function(_0x16a940){if(_0x16a940){var _0x2b8846=_['flatMap'](_0x16a940,function(_0x4b9092){var _0x7bfe19=_0x4b9092[_0x75c1('0x2e')]({'plain':!![]});return _0x7bfe19['Agents'];});return db['FaxQueue'][_0x75c1('0x4e')]({'where':{'id':_0x10db73[_0x75c1('0x58')]['id']}})['then'](function(_0x5385e3){return db[_0x75c1('0x6d')]['transaction'](function(_0x412b34){return _0x5385e3['addTeams'](_0x311e2c,{'transaction':_0x412b34})['then'](function(){return BPromise[_0x75c1('0x6e')](_0x2b8846,function(_0x1d4f45){return db[_0x75c1('0x5c')][_0x75c1('0x6f')]({'where':{'UserId':_0x1d4f45['id'],'FaxQueueId':_0x10db73[_0x75c1('0x58')]['id']},'transaction':_0x412b34});});})[_0x75c1('0x2d')](function(){_0x2b8846['forEach'](function(_0xb82c89){socket[_0x75c1('0x70')](_0x75c1('0x71'),{'UserId':_0xb82c89['id'],'FaxQueueId':_0x5385e3['id']});});});});});}})[_0x75c1('0x2d')](respondWithStatusCode(_0x5a5e54,null))[_0x75c1('0x4b')](handleError(_0x5a5e54,null));};exports['removeTeams']=function(_0x112f18,_0x4b6ea8,_0x2d36e7){return db[_0x75c1('0x66')][_0x75c1('0x4a')]({'where':{'id':_0x112f18[_0x75c1('0x38')][_0x75c1('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x75c1('0x69'),'attributes':['id'],'raw':!![]}]})[_0x75c1('0x2d')](handleEntityNotFound(_0x4b6ea8,null))[_0x75c1('0x2d')](function(_0x1c422a){var _0x17e4b7=_[_0x75c1('0x32')](_0x1c422a,'id');var _0x5583a5=[];var _0x342e2c=[];var _0xc7fbf2=squel['select']();_0xc7fbf2[_0x75c1('0x72')]('tq.TeamId')[_0x75c1('0x73')](_0x75c1('0x74'),'tq')[_0x75c1('0x75')](_0x75c1('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x75c1('0x43')](_0x75c1('0x77'),_0x112f18['params']['id']);for(var _0x331a0e=0x0;_0x331a0e<_0x1c422a[_0x75c1('0x4d')];_0x331a0e+=0x1){let _0x4ceab3=_0x1c422a[_0x331a0e];for(var _0x2ed46a=0x0;_0x2ed46a<_0x4ceab3['Agents'][_0x75c1('0x4d')];_0x2ed46a+=0x1){let _0x624eed=_0x4ceab3[_0x75c1('0x69')][_0x2ed46a];var _0x3a135d=_0xc7fbf2[_0x75c1('0x78')]();_0x3a135d['where'](_0x75c1('0x79'),_0x624eed['id']);_0x342e2c['push'](db['sequelize'][_0x75c1('0x38')](_0x3a135d['toString'](),{'type':db[_0x75c1('0x6d')][_0x75c1('0x7a')][_0x75c1('0x7b')]})[_0x75c1('0x2d')](function(_0x51049a){if(_0x51049a['length']===0x1){return _0x624eed['id'];}else{var _0x94449b=_[_0x75c1('0x7c')](_[_0x75c1('0x32')](_0x51049a,'TeamId'),function(_0x3d2d57){return _['includes'](_0x17e4b7,_0x3d2d57);});if(_0x94449b){return _0x624eed['id'];}}}));}}return BPromise[_0x75c1('0x7d')](_0x342e2c)[_0x75c1('0x2d')](function(_0x561752){_0x5583a5=_(_0x5583a5)[_0x75c1('0x7e')](_0x561752)['compact']()['value']();return db[_0x75c1('0x47')][_0x75c1('0x4e')]({'where':{'id':_0x112f18[_0x75c1('0x58')]['id']}})[_0x75c1('0x2d')](function(_0x55ba31){return db[_0x75c1('0x6d')]['transaction'](function(_0x1815a0){return _0x55ba31[_0x75c1('0x7f')](_0x112f18[_0x75c1('0x38')][_0x75c1('0x68')],{'transaction':_0x1815a0})[_0x75c1('0x2d')](function(){if(!_['isEmpty'](_0x5583a5)){return _0x55ba31[_0x75c1('0x80')](_0x5583a5,{'transaction':_0x1815a0});}})[_0x75c1('0x2d')](function(){_0x5583a5[_0x75c1('0x81')](function(_0x1bd5de){socket[_0x75c1('0x70')](_0x75c1('0x82'),{'UserId':_0x1bd5de,'FaxQueueId':_0x55ba31['id']});});});});});});})['then'](respondWithStatusCode(_0x4b6ea8,null))['catch'](handleError(_0x4b6ea8,null));};exports['addAgents']=function(_0x45bd19,_0x38b95e,_0x428015){return db['FaxQueue'][_0x75c1('0x4e')]({'where':{'id':_0x45bd19[_0x75c1('0x58')]['id']}})['then'](handleEntityNotFound(_0x38b95e,null))['then'](function(_0xaf5b33){if(_0xaf5b33){return _0xaf5b33['addAgents'](_0x45bd19[_0x75c1('0x57')][_0x75c1('0x68')],_[_0x75c1('0x83')](_0x45bd19[_0x75c1('0x57')],[_0x75c1('0x68'),'id'])||{})[_0x75c1('0x84')](function(_0x860498){for(var _0x17948c=0x0;_0x17948c<_0x45bd19['body'][_0x75c1('0x68')][_0x75c1('0x4d')];_0x17948c+=0x1){socket[_0x75c1('0x70')](_0x75c1('0x71'),{'UserId':Number(_0x45bd19['body']['ids'][_0x17948c]),'FaxQueueId':Number(_0x45bd19[_0x75c1('0x58')]['id'])});}return _0x860498;});}})['then'](respondWithResult(_0x38b95e,null))[_0x75c1('0x4b')](handleError(_0x38b95e,null));};exports[_0x75c1('0x80')]=function(_0x53c70f,_0x39bbd3,_0xead42a){return db[_0x75c1('0x47')][_0x75c1('0x4e')]({'where':{'id':_0x53c70f['params']['id']}})[_0x75c1('0x2d')](handleEntityNotFound(_0x39bbd3,null))['then'](function(_0x4e0fdb){if(_0x4e0fdb){return _0x4e0fdb[_0x75c1('0x80')](_0x53c70f[_0x75c1('0x38')][_0x75c1('0x68')])[_0x75c1('0x2d')](function(){if(_[_0x75c1('0x85')](_0x53c70f[_0x75c1('0x38')][_0x75c1('0x68')])){for(var _0x4ae17b=0x0;_0x4ae17b<_0x53c70f['query'][_0x75c1('0x68')][_0x75c1('0x4d')];_0x4ae17b+=0x1){socket[_0x75c1('0x70')](_0x75c1('0x82'),{'UserId':Number(_0x53c70f[_0x75c1('0x38')]['ids'][_0x4ae17b]),'FaxQueueId':Number(_0x53c70f[_0x75c1('0x58')]['id'])});}}else{socket[_0x75c1('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x53c70f[_0x75c1('0x38')][_0x75c1('0x68')]),'FaxQueueId':Number(_0x53c70f[_0x75c1('0x58')]['id'])});}});}})[_0x75c1('0x2d')](respondWithStatusCode(_0x39bbd3,null))[_0x75c1('0x4b')](handleError(_0x39bbd3,null));};exports[_0x75c1('0x86')]=function(_0x1b5492,_0xccb4b0,_0x2ce61b){var _0x67075c={};var _0x16e4b7={};var _0x29f257;var _0x359cee;return db['FaxQueue']['findOne']({'where':{'id':_0x1b5492[_0x75c1('0x58')]['id']}})['then'](handleEntityNotFound(_0xccb4b0,null))[_0x75c1('0x2d')](function(_0x432c3c){if(_0x432c3c){_0x29f257=_0x432c3c;_0x16e4b7[_0x75c1('0x37')]=_['keys'](db[_0x75c1('0x5e')][_0x75c1('0x33')]);_0x16e4b7[_0x75c1('0x38')]=_[_0x75c1('0x39')](_0x1b5492['query']);_0x16e4b7[_0x75c1('0x3a')]=_[_0x75c1('0x3b')](_0x16e4b7[_0x75c1('0x37')],_0x16e4b7[_0x75c1('0x38')]);_0x67075c[_0x75c1('0x4c')]=_[_0x75c1('0x3b')](_0x16e4b7[_0x75c1('0x37')],qs[_0x75c1('0x3c')](_0x1b5492[_0x75c1('0x38')][_0x75c1('0x3c')]));_0x67075c[_0x75c1('0x4c')]=_0x67075c[_0x75c1('0x4c')][_0x75c1('0x4d')]?_0x67075c[_0x75c1('0x4c')]:_0x16e4b7[_0x75c1('0x37')];_0x67075c[_0x75c1('0x3f')]=qs[_0x75c1('0x40')](_0x1b5492[_0x75c1('0x38')][_0x75c1('0x40')]);_0x67075c[_0x75c1('0x43')]=qs[_0x75c1('0x3a')](_[_0x75c1('0x41')](_0x1b5492[_0x75c1('0x38')],_0x16e4b7[_0x75c1('0x3a')]));if(_0x1b5492[_0x75c1('0x38')][_0x75c1('0x42')]){_0x67075c['where']=_[_0x75c1('0x44')](_0x67075c[_0x75c1('0x43')],{'$or':_[_0x75c1('0x32')](_0x67075c[_0x75c1('0x4c')],function(_0x27038f){var _0x4b4f77={};_0x4b4f77[_0x27038f]={'$like':'%'+_0x1b5492[_0x75c1('0x38')][_0x75c1('0x42')]+'%'};return _0x4b4f77;})});}_0x67075c=_['merge']({},_0x67075c,_0x1b5492[_0x75c1('0x46')]);return _0x29f257['getAgents'](_0x67075c);}})[_0x75c1('0x2d')](function(_0x2f19f8){if(_0x2f19f8){_0x359cee=_0x2f19f8[_0x75c1('0x4d')];if(!_0x1b5492[_0x75c1('0x38')]['hasOwnProperty'](_0x75c1('0x3e'))){_0x67075c[_0x75c1('0x26')]=qs[_0x75c1('0x26')](_0x1b5492[_0x75c1('0x38')][_0x75c1('0x26')]);_0x67075c[_0x75c1('0x25')]=qs[_0x75c1('0x25')](_0x1b5492['query'][_0x75c1('0x25')]);}return _0x29f257['getAgents'](_0x67075c);}})['then'](function(_0x475743){if(_0x475743){return _0x475743?{'count':_0x359cee,'rows':_0x475743}:null;}})[_0x75c1('0x2d')](respondWithResult(_0xccb4b0,null))[_0x75c1('0x4b')](handleError(_0xccb4b0,null));};
\ No newline at end of file
+var _0x23cc=['faxPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','transaction','findOrCreate','emit','userFaxQueue:save','removeTeams','Agents','field','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','get','FaxQueues','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','UserFaxQueue','order','User','findAndCountAll'];(function(_0x27348d,_0x317ac7){var _0x11bb3b=function(_0x8944b2){while(--_0x8944b2){_0x27348d['push'](_0x27348d['shift']());}};_0x11bb3b(++_0x317ac7);}(_0x23cc,0x1d5));var _0xc23c=function(_0x4ffa46,_0x81e57b){_0x4ffa46=_0x4ffa46-0x0;var _0x413ff3=_0x23cc[_0x4ffa46];return _0x413ff3;};'use strict';var emlformat=require(_0xc23c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc23c('0x1'));var jsonpatch=require(_0xc23c('0x2'));var rp=require('request-promise');var moment=require(_0xc23c('0x3'));var BPromise=require(_0xc23c('0x4'));var Mustache=require('mustache');var util=require(_0xc23c('0x5'));var path=require(_0xc23c('0x6'));var sox=require(_0xc23c('0x7'));var csv=require(_0xc23c('0x8'));var ejs=require(_0xc23c('0x9'));var fs=require('fs');var fs_extra=require(_0xc23c('0xa'));var _=require(_0xc23c('0xb'));var squel=require(_0xc23c('0xc'));var crypto=require('crypto');var jsforce=require(_0xc23c('0xd'));var deskjs=require(_0xc23c('0xe'));var toCsv=require(_0xc23c('0x8'));var querystring=require(_0xc23c('0xf'));var Papa=require(_0xc23c('0x10'));var Redis=require(_0xc23c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc23c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc23c('0x13'));var logger=require(_0xc23c('0x14'))(_0xc23c('0x15'));var utils=require(_0xc23c('0x16'));var config=require(_0xc23c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc23c('0x18'))['db'];config['redis']=_[_0xc23c('0x19')](config['redis'],{'host':_0xc23c('0x1a'),'port':0x18eb});var socket=require(_0xc23c('0x1b'))(new Redis(config[_0xc23c('0x1c')]));require(_0xc23c('0x1d'))[_0xc23c('0x1e')](socket);function respondWithStatusCode(_0x396f1d,_0xa442a8){_0xa442a8=_0xa442a8||0xcc;return function(_0x105ec2){if(_0x105ec2){return _0x396f1d[_0xc23c('0x1f')](_0xa442a8);}return _0x396f1d[_0xc23c('0x20')](_0xa442a8)[_0xc23c('0x21')]();};}function respondWithResult(_0x5207f1,_0x4f0cd2){_0x4f0cd2=_0x4f0cd2||0xc8;return function(_0x477ce1){if(_0x477ce1){return _0x5207f1[_0xc23c('0x20')](_0x4f0cd2)[_0xc23c('0x22')](_0x477ce1);}};}function respondWithFilteredResult(_0x1ab2a6,_0x3fa42c){return function(_0x563079){if(_0x563079){var _0x1fd128=typeof _0x3fa42c[_0xc23c('0x23')]===_0xc23c('0x24')&&typeof _0x3fa42c['limit']==='undefined';var _0x11d484=_0x563079[_0xc23c('0x25')];var _0x5001df=_0x1fd128?0x0:_0x3fa42c['offset'];var _0x5a8a90=_0x1fd128?_0x563079[_0xc23c('0x25')]:_0x3fa42c[_0xc23c('0x23')]+_0x3fa42c[_0xc23c('0x26')];var _0x364c10;if(_0x5a8a90>=_0x11d484){_0x5a8a90=_0x11d484;_0x364c10=0xc8;}else{_0x364c10=0xce;}_0x1ab2a6['status'](_0x364c10);return _0x1ab2a6['set'](_0xc23c('0x27'),_0x5001df+'-'+_0x5a8a90+'/'+_0x11d484)[_0xc23c('0x22')](_0x563079);}return null;};}function patchUpdates(_0x33c602){return function(_0x26f973){try{jsonpatch['apply'](_0x26f973,_0x33c602,!![]);}catch(_0x5b3534){return BPromise['reject'](_0x5b3534);}return _0x26f973[_0xc23c('0x28')]();};}function saveUpdates(_0x4d47ca,_0x1e6ca7){return function(_0x443129){if(_0x443129){return _0x443129[_0xc23c('0x29')](_0x4d47ca)[_0xc23c('0x2a')](function(_0x1885da){return _0x1885da;});}return null;};}function removeEntity(_0x6d42a5,_0x51d049){return function(_0x572c03){if(_0x572c03){return _0x572c03[_0xc23c('0x2b')]()[_0xc23c('0x2a')](function(){var _0x16c8dc=_0x572c03[_0xc23c('0x2c')]({'plain':!![]});var _0x596d5e=_0xc23c('0x2d');return db['UserProfileResource'][_0xc23c('0x2b')]({'where':{'type':_0x596d5e,'resourceId':_0x16c8dc['id']}})[_0xc23c('0x2a')](function(){return _0x572c03;});})['then'](function(){_0x6d42a5[_0xc23c('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ebcc,_0x38c743){return function(_0x52a615){if(!_0x52a615){_0x43ebcc[_0xc23c('0x1f')](0x194);}return _0x52a615;};}function handleError(_0x26b442,_0x524206){_0x524206=_0x524206||0x1f4;return function(_0x48c8e3){logger[_0xc23c('0x2e')](_0x48c8e3[_0xc23c('0x2f')]);if(_0x48c8e3[_0xc23c('0x30')]){delete _0x48c8e3[_0xc23c('0x30')];}_0x26b442['status'](_0x524206)[_0xc23c('0x31')](_0x48c8e3);};}exports[_0xc23c('0x32')]=function(_0x6f7c86,_0x539290){var _0x59dd32={},_0x5bbbe5={},_0x3b88c3={'count':0x0,'rows':[]};var _0x596fe5=_[_0xc23c('0x33')](db[_0xc23c('0x34')][_0xc23c('0x35')],function(_0x3ecf13){return{'name':_0x3ecf13[_0xc23c('0x36')],'type':_0x3ecf13[_0xc23c('0x37')]['key']};});_0x5bbbe5[_0xc23c('0x38')]=_[_0xc23c('0x33')](_0x596fe5,_0xc23c('0x30'));_0x5bbbe5[_0xc23c('0x39')]=_[_0xc23c('0x3a')](_0x6f7c86[_0xc23c('0x39')]);_0x5bbbe5['filters']=_[_0xc23c('0x3b')](_0x5bbbe5[_0xc23c('0x38')],_0x5bbbe5[_0xc23c('0x39')]);_0x59dd32[_0xc23c('0x3c')]=_['intersection'](_0x5bbbe5[_0xc23c('0x38')],qs[_0xc23c('0x3d')](_0x6f7c86[_0xc23c('0x39')]['fields']));_0x59dd32[_0xc23c('0x3c')]=_0x59dd32['attributes']['length']?_0x59dd32[_0xc23c('0x3c')]:_0x5bbbe5[_0xc23c('0x38')];if(!_0x6f7c86[_0xc23c('0x39')][_0xc23c('0x3e')](_0xc23c('0x3f'))){_0x59dd32[_0xc23c('0x26')]=qs[_0xc23c('0x26')](_0x6f7c86['query'][_0xc23c('0x26')]);_0x59dd32['offset']=qs[_0xc23c('0x23')](_0x6f7c86['query'][_0xc23c('0x23')]);}_0x59dd32['order']=qs[_0xc23c('0x40')](_0x6f7c86[_0xc23c('0x39')]['sort']);_0x59dd32['where']=qs[_0xc23c('0x41')](_[_0xc23c('0x42')](_0x6f7c86['query'],_0x5bbbe5[_0xc23c('0x41')]),_0x596fe5);if(_0x6f7c86['query']['filter']){_0x59dd32[_0xc23c('0x43')]=_[_0xc23c('0x44')](_0x59dd32[_0xc23c('0x43')],{'$or':_[_0xc23c('0x33')](_0x596fe5,function(_0x42cddb){if(_0x42cddb[_0xc23c('0x37')]!==_0xc23c('0x45')){var _0xbf2111={};_0xbf2111[_0x42cddb[_0xc23c('0x30')]]={'$like':'%'+_0x6f7c86[_0xc23c('0x39')][_0xc23c('0x46')]+'%'};return _0xbf2111;}})});}_0x59dd32=_[_0xc23c('0x44')]({},_0x59dd32,_0x6f7c86[_0xc23c('0x47')]);var _0x4c4829={'where':_0x59dd32[_0xc23c('0x43')]};return db[_0xc23c('0x34')][_0xc23c('0x25')](_0x4c4829)['then'](function(_0x175a18){_0x3b88c3[_0xc23c('0x25')]=_0x175a18;if(_0x6f7c86['query'][_0xc23c('0x48')]){_0x59dd32['include']=[{'all':!![]}];}return db[_0xc23c('0x34')][_0xc23c('0x49')](_0x59dd32);})['then'](function(_0x444990){_0x3b88c3['rows']=_0x444990;return _0x3b88c3;})[_0xc23c('0x2a')](respondWithFilteredResult(_0x539290,_0x59dd32))[_0xc23c('0x4a')](handleError(_0x539290,null));};exports['show']=function(_0x1744f2,_0x3e64a7){var _0x15b5cb={'raw':!![],'where':{'id':_0x1744f2[_0xc23c('0x4b')]['id']}},_0x293bec={};_0x293bec['model']=_['keys'](db['FaxQueue'][_0xc23c('0x35')]);_0x293bec[_0xc23c('0x39')]=_[_0xc23c('0x3a')](_0x1744f2[_0xc23c('0x39')]);_0x293bec[_0xc23c('0x41')]=_[_0xc23c('0x3b')](_0x293bec[_0xc23c('0x38')],_0x293bec['query']);_0x15b5cb[_0xc23c('0x3c')]=_[_0xc23c('0x3b')](_0x293bec[_0xc23c('0x38')],qs['fields'](_0x1744f2[_0xc23c('0x39')][_0xc23c('0x3d')]));_0x15b5cb[_0xc23c('0x3c')]=_0x15b5cb[_0xc23c('0x3c')][_0xc23c('0x4c')]?_0x15b5cb[_0xc23c('0x3c')]:_0x293bec[_0xc23c('0x38')];if(_0x1744f2['query']['includeAll']){_0x15b5cb['include']=[{'all':!![]}];}_0x15b5cb=_[_0xc23c('0x44')]({},_0x15b5cb,_0x1744f2[_0xc23c('0x47')]);return db['FaxQueue'][_0xc23c('0x4d')](_0x15b5cb)['then'](handleEntityNotFound(_0x3e64a7,null))[_0xc23c('0x2a')](respondWithResult(_0x3e64a7,null))['catch'](handleError(_0x3e64a7,null));};exports[_0xc23c('0x4e')]=function(_0x27ad80,_0x4f66bf){return db['FaxQueue'][_0xc23c('0x4e')](_0x27ad80[_0xc23c('0x4f')],{})[_0xc23c('0x2a')](function(_0x51dfb7){var _0x2b1181=_0x27ad80[_0xc23c('0x50')][_0xc23c('0x2c')]({'plain':!![]});if(!_0x2b1181)throw new Error(_0xc23c('0x51'));if(_0x2b1181[_0xc23c('0x52')]==='user'){var _0x18002a=_0x51dfb7['get']({'plain':!![]});var _0x1f2369=_0xc23c('0x2d');return db[_0xc23c('0x53')][_0xc23c('0x4d')]({'where':{'name':_0x1f2369,'userProfileId':_0x2b1181[_0xc23c('0x54')]},'raw':!![]})[_0xc23c('0x2a')](function(_0x32cfb6){if(_0x32cfb6&&_0x32cfb6['autoAssociation']===0x0){return db['UserProfileResource'][_0xc23c('0x4e')]({'name':_0x18002a[_0xc23c('0x30')],'resourceId':_0x18002a['id'],'type':_0x32cfb6[_0xc23c('0x30')],'sectionId':_0x32cfb6['id']},{})['then'](function(){return _0x51dfb7;});}else{return _0x51dfb7;}})[_0xc23c('0x4a')](function(_0x427045){logger[_0xc23c('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x427045);throw _0x427045;});}return _0x51dfb7;})['then'](respondWithResult(_0x4f66bf,0xc9))[_0xc23c('0x4a')](handleError(_0x4f66bf,null));};exports[_0xc23c('0x29')]=function(_0x367900,_0x2e8406){if(_0x367900[_0xc23c('0x4f')]['id']){delete _0x367900[_0xc23c('0x4f')]['id'];}return db['FaxQueue'][_0xc23c('0x4d')]({'where':{'id':_0x367900[_0xc23c('0x4b')]['id']}})[_0xc23c('0x2a')](handleEntityNotFound(_0x2e8406,null))[_0xc23c('0x2a')](saveUpdates(_0x367900[_0xc23c('0x4f')],null))[_0xc23c('0x2a')](respondWithResult(_0x2e8406,null))[_0xc23c('0x4a')](handleError(_0x2e8406,null));};exports[_0xc23c('0x2b')]=function(_0x191432,_0x4c59a3){return db[_0xc23c('0x34')][_0xc23c('0x4d')]({'where':{'id':_0x191432['params']['id']}})['then'](handleEntityNotFound(_0x4c59a3,null))[_0xc23c('0x2a')](removeEntity(_0x4c59a3,null))[_0xc23c('0x4a')](handleError(_0x4c59a3,null));};exports[_0xc23c('0x55')]=function(_0x3d52fb,_0x4bb350){return db[_0xc23c('0x34')]['describe']()[_0xc23c('0x2a')](respondWithResult(_0x4bb350,null))[_0xc23c('0x4a')](handleError(_0x4bb350,null));};exports[_0xc23c('0x56')]=function(_0x5f0662,_0x32785a,_0x1e23fc){var _0x1e862c={'raw':!![],'where':{}},_0x2defa2={},_0x7120b8;return db[_0xc23c('0x34')]['findOne']({'where':{'id':_0x5f0662[_0xc23c('0x4b')]['id']}})[_0xc23c('0x2a')](handleEntityNotFound(_0x32785a,null))[_0xc23c('0x2a')](function(_0x5df364){if(_0x5df364){_0x7120b8=_0x5df364[_0xc23c('0x2c')]({'plain':!![]});_0x2defa2[_0xc23c('0x38')]=_[_0xc23c('0x3a')](db[_0xc23c('0x57')]['rawAttributes']);_0x2defa2[_0xc23c('0x39')]=_['keys'](_0x5f0662[_0xc23c('0x39')]);_0x2defa2[_0xc23c('0x41')]=_[_0xc23c('0x3b')](_0x2defa2[_0xc23c('0x38')],_0x2defa2[_0xc23c('0x39')]);_0x1e862c[_0xc23c('0x3c')]=_[_0xc23c('0x3b')](_0x2defa2[_0xc23c('0x38')],qs['fields'](_0x5f0662[_0xc23c('0x39')][_0xc23c('0x3d')]));_0x1e862c[_0xc23c('0x3c')]=_0x1e862c[_0xc23c('0x3c')][_0xc23c('0x4c')]?_0x1e862c[_0xc23c('0x3c')]:_0x2defa2[_0xc23c('0x38')];if(!_0x5f0662[_0xc23c('0x39')][_0xc23c('0x3e')](_0xc23c('0x3f'))){_0x1e862c['limit']=qs['limit'](_0x5f0662['query'][_0xc23c('0x26')]);_0x1e862c[_0xc23c('0x23')]=qs[_0xc23c('0x23')](_0x5f0662[_0xc23c('0x39')]['offset']);}_0x1e862c[_0xc23c('0x58')]=qs['sort'](_0x5f0662[_0xc23c('0x39')][_0xc23c('0x40')]);_0x1e862c[_0xc23c('0x43')]=qs[_0xc23c('0x41')](_['pick'](_0x5f0662[_0xc23c('0x39')],_0x2defa2['filters']));_0x1e862c[_0xc23c('0x43')]['FaxQueueId']=_0x5df364['id'];if(_0x5f0662[_0xc23c('0x39')]['filter']){_0x1e862c[_0xc23c('0x43')]=_[_0xc23c('0x44')](_0x1e862c[_0xc23c('0x43')],{'$or':_[_0xc23c('0x33')](_0x1e862c['attributes'],function(_0x5f5770){var _0x5801da={};_0x5801da[_0x5f5770]={'$like':'%'+_0x5f0662[_0xc23c('0x39')][_0xc23c('0x46')]+'%'};return _0x5801da;})});}_0x1e862c=_['merge']({},_0x1e862c,_0x5f0662[_0xc23c('0x47')]);return db[_0xc23c('0x57')][_0xc23c('0x49')](_0x1e862c);}})['then'](function(_0x49a0bd){if(_0x49a0bd){return db[_0xc23c('0x59')][_0xc23c('0x5a')]({'where':{'id':_['map'](_0x49a0bd,'UserId'),'role':'agent'},'attributes':['id',_0xc23c('0x30'),_0xc23c('0x5b'),_0xc23c('0x5c'),_0xc23c('0x5d')]});}})[_0xc23c('0x2a')](function(_0x334278){if(_0x334278){return{'count':_0x334278[_0xc23c('0x25')],'rows':_['map'](_0x334278[_0xc23c('0x5e')],function(_0x3dc52a){return{'membername':_0x3dc52a[_0xc23c('0x30')],'UserId':_0x3dc52a['id'],'queue_name':_0x7120b8[_0xc23c('0x30')],'FaxQueueId':_0x7120b8['id'],'interface':util[_0xc23c('0x5f')](_0xc23c('0x60'),'SIP',_0x3dc52a[_0xc23c('0x30')]),'penalty':0x0,'paused':_0x3dc52a[_0xc23c('0x5b')],'createdAt':_0x3dc52a[_0xc23c('0x5d')],'updatedAt':_0x3dc52a[_0xc23c('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc23c('0x2a')](respondWithFilteredResult(_0x32785a,_0x1e862c))['catch'](handleError(_0x32785a,null));};exports[_0xc23c('0x61')]=function(_0x526f40,_0x44cb48,_0x501d65){var _0x3a7365={};var _0x30faa5={};var _0x26fbe8;var _0x4137eb;return db[_0xc23c('0x34')][_0xc23c('0x62')]({'where':{'id':_0x526f40[_0xc23c('0x4b')]['id']}})[_0xc23c('0x2a')](handleEntityNotFound(_0x44cb48,null))['then'](function(_0x25bfbe){if(_0x25bfbe){_0x26fbe8=_0x25bfbe;_0x30faa5[_0xc23c('0x38')]=_[_0xc23c('0x3a')](db[_0xc23c('0x63')]['rawAttributes']);_0x30faa5['query']=_[_0xc23c('0x3a')](_0x526f40[_0xc23c('0x39')]);_0x30faa5[_0xc23c('0x41')]=_[_0xc23c('0x3b')](_0x30faa5[_0xc23c('0x38')],_0x30faa5[_0xc23c('0x39')]);_0x3a7365['attributes']=_[_0xc23c('0x3b')](_0x30faa5['model'],qs[_0xc23c('0x3d')](_0x526f40[_0xc23c('0x39')]['fields']));_0x3a7365[_0xc23c('0x3c')]=_0x3a7365['attributes']['length']?_0x3a7365[_0xc23c('0x3c')]:_0x30faa5[_0xc23c('0x38')];_0x3a7365[_0xc23c('0x58')]=qs[_0xc23c('0x40')](_0x526f40[_0xc23c('0x39')][_0xc23c('0x40')]);_0x3a7365[_0xc23c('0x43')]=qs[_0xc23c('0x41')](_['pick'](_0x526f40[_0xc23c('0x39')],_0x30faa5[_0xc23c('0x41')]));if(_0x526f40['query'][_0xc23c('0x46')]){_0x3a7365['where']=_['merge'](_0x3a7365[_0xc23c('0x43')],{'$or':_['map'](_0x3a7365[_0xc23c('0x3c')],function(_0xeab1d6){var _0x26a9fa={};_0x26a9fa[_0xeab1d6]={'$like':'%'+_0x526f40['query'][_0xc23c('0x46')]+'%'};return _0x26a9fa;})});}_0x3a7365=_[_0xc23c('0x44')]({},_0x3a7365,_0x526f40[_0xc23c('0x47')]);return _0x26fbe8[_0xc23c('0x61')](_0x3a7365);}})[_0xc23c('0x2a')](function(_0x1b4109){if(_0x1b4109){_0x4137eb=_0x1b4109['length'];if(!_0x526f40[_0xc23c('0x39')]['hasOwnProperty'](_0xc23c('0x3f'))){_0x3a7365[_0xc23c('0x26')]=qs[_0xc23c('0x26')](_0x526f40[_0xc23c('0x39')][_0xc23c('0x26')]);_0x3a7365[_0xc23c('0x23')]=qs[_0xc23c('0x23')](_0x526f40[_0xc23c('0x39')][_0xc23c('0x23')]);}return _0x26fbe8['getTeams'](_0x3a7365);}})[_0xc23c('0x2a')](function(_0x1b3946){if(_0x1b3946){return _0x1b3946?{'count':_0x4137eb,'rows':_0x1b3946}:null;}})[_0xc23c('0x2a')](respondWithResult(_0x44cb48,null))[_0xc23c('0x4a')](handleError(_0x44cb48,null));};exports[_0xc23c('0x64')]=function(_0x270edb,_0x3c47ed,_0x5b84e0){var _0x397d97=_0x270edb[_0xc23c('0x4f')][_0xc23c('0x65')];return db[_0xc23c('0x63')][_0xc23c('0x49')]({'where':{'id':_0x397d97},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0xc23c('0x66'),_0xc23c('0x67'),_0xc23c('0x68')],'raw':!![]}]})[_0xc23c('0x2a')](function(_0x227b1d){if(_0x227b1d){var _0x1e143f=_[_0xc23c('0x69')](_0x227b1d,function(_0x6d5c3c){var _0x46d882=_0x6d5c3c[_0xc23c('0x2c')]({'plain':!![]});return _0x46d882['Agents'];});return db['FaxQueue'][_0xc23c('0x4d')]({'where':{'id':_0x270edb[_0xc23c('0x4b')]['id']}})[_0xc23c('0x2a')](function(_0x22f6cb){return db['sequelize'][_0xc23c('0x6a')](function(_0x36d914){return _0x22f6cb[_0xc23c('0x64')](_0x397d97,{'transaction':_0x36d914})[_0xc23c('0x2a')](function(){return BPromise['each'](_0x1e143f,function(_0x23f3cf){return db[_0xc23c('0x57')][_0xc23c('0x6b')]({'where':{'UserId':_0x23f3cf['id'],'FaxQueueId':_0x270edb['params']['id']},'transaction':_0x36d914});});})[_0xc23c('0x2a')](function(){_0x1e143f['forEach'](function(_0x41fd33){socket[_0xc23c('0x6c')](_0xc23c('0x6d'),{'UserId':_0x41fd33['id'],'FaxQueueId':_0x22f6cb['id']});});});});});}})[_0xc23c('0x2a')](respondWithStatusCode(_0x3c47ed,null))[_0xc23c('0x4a')](handleError(_0x3c47ed,null));};exports[_0xc23c('0x6e')]=function(_0x6c611,_0x4e243d,_0x43b315){return db[_0xc23c('0x63')]['findAll']({'where':{'id':_0x6c611[_0xc23c('0x39')][_0xc23c('0x65')]},'attributes':['id'],'include':[{'model':db[_0xc23c('0x59')],'as':_0xc23c('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xc23c('0x2a')](handleEntityNotFound(_0x4e243d,null))[_0xc23c('0x2a')](function(_0x3393c5){var _0x347048=_['map'](_0x3393c5,'id');var _0x541202=[];var _0x2c7b8a=[];var _0x45f401=squel['select']();_0x45f401[_0xc23c('0x70')]('tq.TeamId')[_0xc23c('0x71')](_0xc23c('0x72'),'tq')[_0xc23c('0x73')](_0xc23c('0x74'),'ut',_0xc23c('0x75'))['where'](_0xc23c('0x76'),_0x6c611[_0xc23c('0x4b')]['id']);for(var _0x114be9=0x0;_0x114be9<_0x3393c5[_0xc23c('0x4c')];_0x114be9+=0x1){let _0x1ef0fa=_0x3393c5[_0x114be9];for(var _0x392e62=0x0;_0x392e62<_0x1ef0fa[_0xc23c('0x6f')]['length'];_0x392e62+=0x1){let _0x4a4d7d=_0x1ef0fa['Agents'][_0x392e62];var _0x301732=_0x45f401[_0xc23c('0x77')]();_0x301732[_0xc23c('0x43')](_0xc23c('0x78'),_0x4a4d7d['id']);_0x2c7b8a['push'](db[_0xc23c('0x79')]['query'](_0x301732[_0xc23c('0x7a')](),{'type':db[_0xc23c('0x79')][_0xc23c('0x7b')][_0xc23c('0x7c')]})['then'](function(_0x7bc4a5){if(_0x7bc4a5['length']===0x1){return _0x4a4d7d['id'];}else{var _0xf70a79=_['every'](_[_0xc23c('0x33')](_0x7bc4a5,_0xc23c('0x7d')),function(_0x51c3d6){return _[_0xc23c('0x7e')](_0x347048,_0x51c3d6);});if(_0xf70a79){return _0x4a4d7d['id'];}}}));}}return BPromise[_0xc23c('0x7f')](_0x2c7b8a)[_0xc23c('0x2a')](function(_0x11cc2b){_0x541202=_(_0x541202)[_0xc23c('0x80')](_0x11cc2b)[_0xc23c('0x81')]()[_0xc23c('0x82')]();return db[_0xc23c('0x34')][_0xc23c('0x4d')]({'where':{'id':_0x6c611['params']['id']}})[_0xc23c('0x2a')](function(_0x56cd01){return db[_0xc23c('0x79')][_0xc23c('0x6a')](function(_0x361b7c){return _0x56cd01[_0xc23c('0x6e')](_0x6c611[_0xc23c('0x39')]['ids'],{'transaction':_0x361b7c})['then'](function(){if(!_[_0xc23c('0x83')](_0x541202)){return _0x56cd01['removeAgents'](_0x541202,{'transaction':_0x361b7c});}})[_0xc23c('0x2a')](function(){_0x541202[_0xc23c('0x84')](function(_0x2af29d){socket[_0xc23c('0x6c')](_0xc23c('0x85'),{'UserId':_0x2af29d,'FaxQueueId':_0x56cd01['id']});});});});});});})[_0xc23c('0x2a')](respondWithStatusCode(_0x4e243d,null))[_0xc23c('0x4a')](handleError(_0x4e243d,null));};exports[_0xc23c('0x86')]=function(_0x5a1573,_0x3d9965,_0x2b8f74){return db['FaxQueue'][_0xc23c('0x4d')]({'where':{'id':_0x5a1573[_0xc23c('0x4b')]['id']}})[_0xc23c('0x2a')](handleEntityNotFound(_0x3d9965,null))['then'](function(_0x5a6244){if(_0x5a6244){return _0x5a6244[_0xc23c('0x86')](_0x5a1573['body']['ids'],_[_0xc23c('0x87')](_0x5a1573['body'],['ids','id'])||{})[_0xc23c('0x88')](function(_0x5c432b){for(var _0x41fb0b=0x0;_0x41fb0b<_0x5a1573[_0xc23c('0x4f')][_0xc23c('0x65')][_0xc23c('0x4c')];_0x41fb0b+=0x1){socket[_0xc23c('0x6c')]('userFaxQueue:save',{'UserId':Number(_0x5a1573[_0xc23c('0x4f')][_0xc23c('0x65')][_0x41fb0b]),'FaxQueueId':Number(_0x5a1573['params']['id'])});}return _0x5c432b;});}})[_0xc23c('0x2a')](respondWithResult(_0x3d9965,null))[_0xc23c('0x4a')](handleError(_0x3d9965,null));};exports[_0xc23c('0x89')]=function(_0x356b6e,_0x22322a,_0x4b9014){return db[_0xc23c('0x34')][_0xc23c('0x4d')]({'where':{'id':_0x356b6e[_0xc23c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22322a,null))[_0xc23c('0x2a')](function(_0x9a6dfd){if(_0x9a6dfd){return _0x9a6dfd[_0xc23c('0x89')](_0x356b6e[_0xc23c('0x39')]['ids'])[_0xc23c('0x2a')](function(){if(_[_0xc23c('0x8a')](_0x356b6e[_0xc23c('0x39')]['ids'])){for(var _0x35fce7=0x0;_0x35fce7<_0x356b6e[_0xc23c('0x39')][_0xc23c('0x65')]['length'];_0x35fce7+=0x1){socket[_0xc23c('0x6c')](_0xc23c('0x85'),{'UserId':Number(_0x356b6e[_0xc23c('0x39')][_0xc23c('0x65')][_0x35fce7]),'FaxQueueId':Number(_0x356b6e[_0xc23c('0x4b')]['id'])});}}else{socket[_0xc23c('0x6c')](_0xc23c('0x85'),{'UserId':Number(_0x356b6e[_0xc23c('0x39')][_0xc23c('0x65')]),'FaxQueueId':Number(_0x356b6e['params']['id'])});}});}})[_0xc23c('0x2a')](respondWithStatusCode(_0x22322a,null))[_0xc23c('0x4a')](handleError(_0x22322a,null));};exports['getAgents']=function(_0x5e7b09,_0x3d36bc,_0x154daa){var _0x372553={};var _0x519195={};var _0x5e9409;var _0x5aa58d;return db[_0xc23c('0x34')]['findOne']({'where':{'id':_0x5e7b09[_0xc23c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d36bc,null))[_0xc23c('0x2a')](function(_0x276814){if(_0x276814){_0x5e9409=_0x276814;_0x519195[_0xc23c('0x38')]=_['keys'](db['User']['rawAttributes']);_0x519195['query']=_[_0xc23c('0x3a')](_0x5e7b09[_0xc23c('0x39')]);_0x519195[_0xc23c('0x41')]=_['intersection'](_0x519195[_0xc23c('0x38')],_0x519195[_0xc23c('0x39')]);_0x372553[_0xc23c('0x3c')]=_[_0xc23c('0x3b')](_0x519195[_0xc23c('0x38')],qs['fields'](_0x5e7b09[_0xc23c('0x39')][_0xc23c('0x3d')]));_0x372553['attributes']=_0x372553[_0xc23c('0x3c')]['length']?_0x372553['attributes']:_0x519195[_0xc23c('0x38')];_0x372553[_0xc23c('0x58')]=qs[_0xc23c('0x40')](_0x5e7b09[_0xc23c('0x39')]['sort']);_0x372553[_0xc23c('0x43')]=qs[_0xc23c('0x41')](_[_0xc23c('0x42')](_0x5e7b09['query'],_0x519195[_0xc23c('0x41')]));if(_0x5e7b09['query'][_0xc23c('0x46')]){_0x372553[_0xc23c('0x43')]=_[_0xc23c('0x44')](_0x372553[_0xc23c('0x43')],{'$or':_['map'](_0x372553['attributes'],function(_0x2d515a){var _0x3d669c={};_0x3d669c[_0x2d515a]={'$like':'%'+_0x5e7b09[_0xc23c('0x39')][_0xc23c('0x46')]+'%'};return _0x3d669c;})});}_0x372553=_[_0xc23c('0x44')]({},_0x372553,_0x5e7b09[_0xc23c('0x47')]);return _0x5e9409[_0xc23c('0x8b')](_0x372553);}})[_0xc23c('0x2a')](function(_0x2b75c8){if(_0x2b75c8){_0x5aa58d=_0x2b75c8[_0xc23c('0x4c')];if(!_0x5e7b09[_0xc23c('0x39')][_0xc23c('0x3e')]('nolimit')){_0x372553[_0xc23c('0x26')]=qs[_0xc23c('0x26')](_0x5e7b09[_0xc23c('0x39')][_0xc23c('0x26')]);_0x372553[_0xc23c('0x23')]=qs[_0xc23c('0x23')](_0x5e7b09[_0xc23c('0x39')]['offset']);}return _0x5e9409[_0xc23c('0x8b')](_0x372553);}})[_0xc23c('0x2a')](function(_0x39f343){if(_0x39f343){return _0x39f343?{'count':_0x5aa58d,'rows':_0x39f343}:null;}})[_0xc23c('0x2a')](respondWithResult(_0x3d36bc,null))['catch'](handleError(_0x3d36bc,null));};
\ No newline at end of file
index c85eb05..15a6a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a69=['hasOwnProperty','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','update','remove','emit'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x1a69,0xc9));var _0x91a6=function(_0x34ffa3,_0x18d78d){_0x34ffa3=_0x34ffa3-0x0;var _0xafb565=_0x1a69[_0x34ffa3];return _0xafb565;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x91a6('0x0'))['db'][_0x91a6('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x91a6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x91a6('0x3'),'afterDestroy':_0x91a6('0x4')};function emitEvent(_0x4b6e18){return function(_0x190004,_0x24e1ec,_0x3b6ffc){FaxQueueEvents[_0x91a6('0x5')](_0x4b6e18+':'+_0x190004['id'],_0x190004);FaxQueueEvents[_0x91a6('0x5')](_0x4b6e18,_0x190004);_0x3b6ffc(null);};}for(var e in events){if(events[_0x91a6('0x6')](e)){var event=events[e];FaxQueue[_0x91a6('0x7')](e,emitEvent(event));}}module[_0x91a6('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0xa667=['FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x379c56,_0x46af3a){var _0x3450f5=function(_0x1b0b20){while(--_0x1b0b20){_0x379c56['push'](_0x379c56['shift']());}};_0x3450f5(++_0x46af3a);}(_0xa667,0x6b));var _0x7a66=function(_0x20042e,_0x152f1c){_0x20042e=_0x20042e-0x0;var _0x4f52c5=_0xa667[_0x20042e];return _0x4f52c5;};'use strict';var EventEmitter=require(_0x7a66('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x7a66('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7a66('0x2')](0x0);var events={'afterCreate':_0x7a66('0x3'),'afterUpdate':'update','afterDestroy':_0x7a66('0x4')};function emitEvent(_0x4a8deb){return function(_0x9b60a7,_0x57d6bd,_0x41f9be){FaxQueueEvents[_0x7a66('0x5')](_0x4a8deb+':'+_0x9b60a7['id'],_0x9b60a7);FaxQueueEvents[_0x7a66('0x5')](_0x4a8deb,_0x9b60a7);_0x41f9be(null);};}for(var e in events){if(events[_0x7a66('0x6')](e)){var event=events[e];FaxQueue[_0x7a66('0x7')](e,emitEvent(event));}}module[_0x7a66('0x8')]=FaxQueueEvents;
\ No newline at end of file
index fb8f216..fba27db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e56=['define','FaxQueue','util','api','moment','request-promise','path','../../config/environment','./faxQueue.attributes','exports'];(function(_0x4b8b80,_0x474380){var _0x7b93f1=function(_0x1292ef){while(--_0x1292ef){_0x4b8b80['push'](_0x4b8b80['shift']());}};_0x7b93f1(++_0x474380);}(_0x4e56,0xa2));var _0x64e5=function(_0x35c86f,_0x399bc4){_0x35c86f=_0x35c86f-0x0;var _0x28c841=_0x4e56[_0x35c86f];return _0x28c841;};'use strict';var _=require('lodash');var util=require(_0x64e5('0x0'));var logger=require('../../config/logger')(_0x64e5('0x1'));var moment=require(_0x64e5('0x2'));var BPromise=require('bluebird');var rp=require(_0x64e5('0x3'));var fs=require('fs');var path=require(_0x64e5('0x4'));var rimraf=require('rimraf');var config=require(_0x64e5('0x5'));var attributes=require(_0x64e5('0x6'));module[_0x64e5('0x7')]=function(_0x5dd7e,_0x5180c1){return _0x5dd7e[_0x64e5('0x8')](_0x64e5('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8c7=['moment','request-promise','path','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','../../config/logger'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xf8c7,0x1cc));var _0x7f8c=function(_0x30814d,_0x1fc5c1){_0x30814d=_0x30814d-0x0;var _0x21aca4=_0xf8c7[_0x30814d];return _0x21aca4;};'use strict';var _=require('lodash');var util=require(_0x7f8c('0x0'));var logger=require(_0x7f8c('0x1'))('api');var moment=require(_0x7f8c('0x2'));var BPromise=require('bluebird');var rp=require(_0x7f8c('0x3'));var fs=require('fs');var path=require(_0x7f8c('0x4'));var rimraf=require('rimraf');var config=require(_0x7f8c('0x5'));var attributes=require(_0x7f8c('0x6'));module[_0x7f8c('0x7')]=function(_0x5bed32,_0x2d587b){return _0x5bed32[_0x7f8c('0x8')](_0x7f8c('0x9'),attributes,{'tableName':_0x7f8c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d133d4..87800cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5f=['localhost','socket.io-emitter','./faxQueue.socket','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','find','ShowFaxQueue','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x48adbc,_0x2fbff8){var _0x60fe7e=function(_0x599ef7){while(--_0x599ef7){_0x48adbc['push'](_0x48adbc['shift']());}};_0x60fe7e(++_0x2fbff8);}(_0x7e5f,0x1d5));var _0xf7e5=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7e5f[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0xf7e5('0x0'));var util=require('util');var moment=require(_0xf7e5('0x1'));var BPromise=require(_0xf7e5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7e5('0x3'));var db=require(_0xf7e5('0x4'))['db'];var utils=require(_0xf7e5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf7e5('0x6'));var jayson=require(_0xf7e5('0x7'));var client=jayson[_0xf7e5('0x8')][_0xf7e5('0x9')]({'port':0x232a});config[_0xf7e5('0xa')]=_['defaults'](config[_0xf7e5('0xa')],{'host':_0xf7e5('0xb'),'port':0x18eb});var socket=require(_0xf7e5('0xc'))(new Redis(config[_0xf7e5('0xa')]));require(_0xf7e5('0xd'))[_0xf7e5('0xe')](socket);function respondWithRpcPromise(_0x355c4a,_0x21c77c,_0x4902bc){return new BPromise(function(_0x4fa06d,_0xf5ee75){return client['request'](_0x355c4a,_0x4902bc)[_0xf7e5('0xf')](function(_0x52b709){logger[_0xf7e5('0x10')]('FaxQueue,\x20%s,\x20%s',_0x21c77c,_0xf7e5('0x11'));logger[_0xf7e5('0x12')](_0xf7e5('0x13'),_0x21c77c,_0xf7e5('0x11'),JSON[_0xf7e5('0x14')](_0x52b709));if(_0x52b709[_0xf7e5('0x15')]){if(_0x52b709[_0xf7e5('0x15')][_0xf7e5('0x16')]===0x1f4){logger['error'](_0xf7e5('0x17'),_0x21c77c,_0x52b709[_0xf7e5('0x15')][_0xf7e5('0x18')]);return _0xf5ee75(_0x52b709[_0xf7e5('0x15')]['message']);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x21c77c,_0x52b709['error']['message']);return _0x4fa06d(_0x52b709[_0xf7e5('0x15')][_0xf7e5('0x18')]);}else{logger[_0xf7e5('0x10')](_0xf7e5('0x17'),_0x21c77c,_0xf7e5('0x11'));_0x4fa06d(_0x52b709[_0xf7e5('0x19')][_0xf7e5('0x18')]);}})[_0xf7e5('0x1a')](function(_0x486bce){logger['error']('FaxQueue,\x20%s,\x20%s',_0x21c77c,_0x486bce);_0xf5ee75(_0x486bce);});});}exports[_0xf7e5('0x1b')]=function(_0x475b10){var _0x52e534=this;return new Promise(function(_0x44538c,_0x5f5104){return db[_0xf7e5('0x1c')][_0xf7e5('0x1d')]({'raw':_0x475b10['options']?_0x475b10[_0xf7e5('0x1e')][_0xf7e5('0x1f')]===undefined?!![]:![]:!![],'where':_0x475b10[_0xf7e5('0x1e')]?_0x475b10['options'][_0xf7e5('0x20')]||null:null,'attributes':_0x475b10['options']?_0x475b10['options'][_0xf7e5('0x21')]||null:null,'limit':_0x475b10[_0xf7e5('0x1e')]?_0x475b10[_0xf7e5('0x1e')][_0xf7e5('0x22')]||null:null,'include':_0x475b10[_0xf7e5('0x1e')]?_0x475b10[_0xf7e5('0x1e')]['include']?_['map'](_0x475b10['options'][_0xf7e5('0x23')],function(_0x6c5e41){return{'model':db[_0x6c5e41[_0xf7e5('0x24')]],'as':_0x6c5e41['as'],'attributes':_0x6c5e41[_0xf7e5('0x21')],'include':_0x6c5e41[_0xf7e5('0x23')]?_[_0xf7e5('0x25')](_0x6c5e41[_0xf7e5('0x23')],function(_0x20f496){return{'model':db[_0x20f496[_0xf7e5('0x24')]],'as':_0x20f496['as'],'attributes':_0x20f496[_0xf7e5('0x21')],'include':_0x20f496[_0xf7e5('0x23')]?_['map'](_0x20f496[_0xf7e5('0x23')],function(_0x241295){return{'model':db[_0x241295['model']],'as':_0x241295['as'],'attributes':_0x241295[_0xf7e5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf7e5('0xf')](function(_0x17330f){logger[_0xf7e5('0x10')](_0xf7e5('0x1b'),_0x475b10);logger[_0xf7e5('0x12')]('GetFaxQueue',_0x475b10,JSON[_0xf7e5('0x14')](_0x17330f));_0x44538c(_0x17330f);})[_0xf7e5('0x1a')](function(_0x45e72c){logger[_0xf7e5('0x15')](_0xf7e5('0x1b'),_0x45e72c[_0xf7e5('0x18')],_0x475b10);_0x5f5104(_0x52e534[_0xf7e5('0x15')](0x1f4,_0x45e72c[_0xf7e5('0x18')]));});});};exports['ShowFaxQueue']=function(_0x151475){var _0x29f4e2=this;return new Promise(function(_0x8cae28,_0x31c621){return db[_0xf7e5('0x1c')][_0xf7e5('0x26')]({'raw':_0x151475[_0xf7e5('0x1e')]?_0x151475['options'][_0xf7e5('0x1f')]===undefined?!![]:![]:!![],'where':_0x151475['options']?_0x151475[_0xf7e5('0x1e')][_0xf7e5('0x20')]||null:null,'attributes':_0x151475[_0xf7e5('0x1e')]?_0x151475[_0xf7e5('0x1e')]['attributes']||null:null,'include':_0x151475[_0xf7e5('0x1e')]?_0x151475[_0xf7e5('0x1e')][_0xf7e5('0x23')]?_[_0xf7e5('0x25')](_0x151475[_0xf7e5('0x1e')]['include'],function(_0x1be62f){return{'model':db[_0x1be62f['model']],'as':_0x1be62f['as'],'attributes':_0x1be62f['attributes'],'include':_0x1be62f[_0xf7e5('0x23')]?_[_0xf7e5('0x25')](_0x1be62f[_0xf7e5('0x23')],function(_0x37d4c7){return{'model':db[_0x37d4c7[_0xf7e5('0x24')]],'as':_0x37d4c7['as'],'attributes':_0x37d4c7[_0xf7e5('0x21')],'include':_0x37d4c7[_0xf7e5('0x23')]?_[_0xf7e5('0x25')](_0x37d4c7[_0xf7e5('0x23')],function(_0x2fac3b){return{'model':db[_0x2fac3b[_0xf7e5('0x24')]],'as':_0x2fac3b['as'],'attributes':_0x2fac3b[_0xf7e5('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf7e5('0xf')](function(_0x186310){logger[_0xf7e5('0x10')](_0xf7e5('0x27'),_0x151475);logger[_0xf7e5('0x12')]('ShowFaxQueue',_0x151475,JSON[_0xf7e5('0x14')](_0x186310));_0x8cae28(_0x186310);})[_0xf7e5('0x1a')](function(_0x5bcc16){logger[_0xf7e5('0x15')](_0xf7e5('0x27'),_0x5bcc16['message'],_0x151475);_0x31c621(_0x29f4e2[_0xf7e5('0x15')](0x1f4,_0x5bcc16[_0xf7e5('0x18')]));});});};
\ No newline at end of file
+var _0x05a6=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','attributes','map','include','model','stringify','ShowFaxQueue','find','where','lodash','util'];(function(_0x4eb269,_0x3cd1b6){var _0x1597b8=function(_0x527f9d){while(--_0x527f9d){_0x4eb269['push'](_0x4eb269['shift']());}};_0x1597b8(++_0x3cd1b6);}(_0x05a6,0x1d2));var _0x605a=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x05a6[_0x504df1];return _0x1063b5;};'use strict';var _=require(_0x605a('0x0'));var util=require(_0x605a('0x1'));var moment=require(_0x605a('0x2'));var BPromise=require('bluebird');var rs=require(_0x605a('0x3'));var fs=require('fs');var Redis=require(_0x605a('0x4'));var db=require(_0x605a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x605a('0x6'));var config=require(_0x605a('0x7'));var jayson=require(_0x605a('0x8'));var client=jayson[_0x605a('0x9')]['http']({'port':0x232a});config[_0x605a('0xa')]=_[_0x605a('0xb')](config[_0x605a('0xa')],{'host':_0x605a('0xc'),'port':0x18eb});var socket=require(_0x605a('0xd'))(new Redis(config[_0x605a('0xa')]));require(_0x605a('0xe'))[_0x605a('0xf')](socket);function respondWithRpcPromise(_0x29f35b,_0x1d2a7d,_0x57480e){return new BPromise(function(_0x11f334,_0x346254){return client[_0x605a('0x10')](_0x29f35b,_0x57480e)[_0x605a('0x11')](function(_0x220d90){logger[_0x605a('0x12')](_0x605a('0x13'),_0x1d2a7d,'request\x20sent');logger[_0x605a('0x14')](_0x605a('0x15'),_0x1d2a7d,'request\x20sent',JSON['stringify'](_0x220d90));if(_0x220d90['error']){if(_0x220d90[_0x605a('0x16')][_0x605a('0x17')]===0x1f4){logger[_0x605a('0x16')](_0x605a('0x13'),_0x1d2a7d,_0x220d90[_0x605a('0x16')]['message']);return _0x346254(_0x220d90[_0x605a('0x16')][_0x605a('0x18')]);}logger[_0x605a('0x16')](_0x605a('0x13'),_0x1d2a7d,_0x220d90['error'][_0x605a('0x18')]);return _0x11f334(_0x220d90['error'][_0x605a('0x18')]);}else{logger[_0x605a('0x12')]('FaxQueue,\x20%s,\x20%s',_0x1d2a7d,'request\x20sent');_0x11f334(_0x220d90[_0x605a('0x19')]['message']);}})[_0x605a('0x1a')](function(_0x51d9e0){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1d2a7d,_0x51d9e0);_0x346254(_0x51d9e0);});});}exports[_0x605a('0x1b')]=function(_0x16ddc1){var _0x5ca224=this;return new Promise(function(_0xee58c3,_0x1239a3){return db[_0x605a('0x1c')][_0x605a('0x1d')]({'raw':_0x16ddc1[_0x605a('0x1e')]?_0x16ddc1[_0x605a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x16ddc1[_0x605a('0x1e')]?_0x16ddc1[_0x605a('0x1e')]['where']||null:null,'attributes':_0x16ddc1['options']?_0x16ddc1['options'][_0x605a('0x1f')]||null:null,'limit':_0x16ddc1[_0x605a('0x1e')]?_0x16ddc1['options']['limit']||null:null,'include':_0x16ddc1[_0x605a('0x1e')]?_0x16ddc1[_0x605a('0x1e')]['include']?_[_0x605a('0x20')](_0x16ddc1[_0x605a('0x1e')][_0x605a('0x21')],function(_0x369ae2){return{'model':db[_0x369ae2['model']],'as':_0x369ae2['as'],'attributes':_0x369ae2[_0x605a('0x1f')],'include':_0x369ae2['include']?_[_0x605a('0x20')](_0x369ae2['include'],function(_0x5c3439){return{'model':db[_0x5c3439[_0x605a('0x22')]],'as':_0x5c3439['as'],'attributes':_0x5c3439[_0x605a('0x1f')],'include':_0x5c3439['include']?_[_0x605a('0x20')](_0x5c3439[_0x605a('0x21')],function(_0xbf91ae){return{'model':db[_0xbf91ae[_0x605a('0x22')]],'as':_0xbf91ae['as'],'attributes':_0xbf91ae[_0x605a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x605a('0x11')](function(_0x5bb3a7){logger[_0x605a('0x12')](_0x605a('0x1b'),_0x16ddc1);logger[_0x605a('0x14')](_0x605a('0x1b'),_0x16ddc1,JSON[_0x605a('0x23')](_0x5bb3a7));_0xee58c3(_0x5bb3a7);})['catch'](function(_0x4e5fe3){logger[_0x605a('0x16')](_0x605a('0x1b'),_0x4e5fe3['message'],_0x16ddc1);_0x1239a3(_0x5ca224[_0x605a('0x16')](0x1f4,_0x4e5fe3[_0x605a('0x18')]));});});};exports[_0x605a('0x24')]=function(_0x49d04f){var _0x408e0d=this;return new Promise(function(_0x20922f,_0x428a8f){return db[_0x605a('0x1c')][_0x605a('0x25')]({'raw':_0x49d04f[_0x605a('0x1e')]?_0x49d04f['options']['raw']===undefined?!![]:![]:!![],'where':_0x49d04f['options']?_0x49d04f[_0x605a('0x1e')][_0x605a('0x26')]||null:null,'attributes':_0x49d04f['options']?_0x49d04f[_0x605a('0x1e')][_0x605a('0x1f')]||null:null,'include':_0x49d04f[_0x605a('0x1e')]?_0x49d04f[_0x605a('0x1e')][_0x605a('0x21')]?_[_0x605a('0x20')](_0x49d04f[_0x605a('0x1e')][_0x605a('0x21')],function(_0x2984ca){return{'model':db[_0x2984ca[_0x605a('0x22')]],'as':_0x2984ca['as'],'attributes':_0x2984ca[_0x605a('0x1f')],'include':_0x2984ca['include']?_[_0x605a('0x20')](_0x2984ca[_0x605a('0x21')],function(_0x592926){return{'model':db[_0x592926[_0x605a('0x22')]],'as':_0x592926['as'],'attributes':_0x592926['attributes'],'include':_0x592926[_0x605a('0x21')]?_[_0x605a('0x20')](_0x592926[_0x605a('0x21')],function(_0x3b7df0){return{'model':db[_0x3b7df0[_0x605a('0x22')]],'as':_0x3b7df0['as'],'attributes':_0x3b7df0[_0x605a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x605a('0x11')](function(_0x26ed3f){logger[_0x605a('0x12')](_0x605a('0x24'),_0x49d04f);logger['debug']('ShowFaxQueue',_0x49d04f,JSON['stringify'](_0x26ed3f));_0x20922f(_0x26ed3f);})[_0x605a('0x1a')](function(_0x4f7fd2){logger[_0x605a('0x16')](_0x605a('0x24'),_0x4f7fd2[_0x605a('0x18')],_0x49d04f);_0x428a8f(_0x408e0d[_0x605a('0x16')](0x1f4,_0x4f7fd2['message']));});});};
\ No newline at end of file
index 507022e..6e98db0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7126=['faxQueue:','./faxQueue.events','save','remove','update','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7126,0xb9));var _0x6712=function(_0x58ec58,_0x474a4c){_0x58ec58=_0x58ec58-0x0;var _0xd19910=_0x7126[_0x58ec58];return _0xd19910;};'use strict';var FaxQueueEvents=require(_0x6712('0x0'));var events=[_0x6712('0x1'),_0x6712('0x2'),_0x6712('0x3')];function createListener(_0x255baa,_0x4bb5b0){return function(_0x5f0c1f){_0x4bb5b0['emit'](_0x255baa,_0x5f0c1f);};}function removeListener(_0xfc25b0,_0x576e75){return function(){FaxQueueEvents[_0x6712('0x4')](_0xfc25b0,_0x576e75);};}exports[_0x6712('0x5')]=function(_0x299ec4){for(var _0x1edbda=0x0,_0x411392=events[_0x6712('0x6')];_0x1edbda<_0x411392;_0x1edbda++){var _0x43f9e8=events[_0x1edbda];var _0x1a0cd8=createListener(_0x6712('0x7')+_0x43f9e8,_0x299ec4);FaxQueueEvents['on'](_0x43f9e8,_0x1a0cd8);}};
\ No newline at end of file
+var _0x975f=['faxQueue:','./faxQueue.events','save','emit','removeListener','length'];(function(_0x79bc3f,_0x5ad385){var _0x245b13=function(_0x3a8894){while(--_0x3a8894){_0x79bc3f['push'](_0x79bc3f['shift']());}};_0x245b13(++_0x5ad385);}(_0x975f,0x109));var _0xf975=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x975f[_0x4e0026];return _0x3f8ee7;};'use strict';var FaxQueueEvents=require(_0xf975('0x0'));var events=[_0xf975('0x1'),'remove','update'];function createListener(_0x3d087b,_0x274f21){return function(_0x556f63){_0x274f21[_0xf975('0x2')](_0x3d087b,_0x556f63);};}function removeListener(_0x2d047c,_0x26c58b){return function(){FaxQueueEvents[_0xf975('0x3')](_0x2d047c,_0x26c58b);};}exports['register']=function(_0x356f71){for(var _0x5a9aca=0x0,_0x36f6cf=events[_0xf975('0x4')];_0x5a9aca<_0x36f6cf;_0x5a9aca++){var _0x51a37c=events[_0x5a9aca];var _0x194d30=createListener(_0xf975('0x5')+_0x51a37c,_0x356f71);FaxQueueEvents['on'](_0x51a37c,_0x194d30);}};
\ No newline at end of file
index 970468d..9d1b39e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x50fea0,_0x30d45d){var _0x228021=function(_0x3de6fe){while(--_0x3de6fe){_0x50fea0['push'](_0x50fea0['shift']());}};_0x228021(++_0x30d45d);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x80dc0,_0x3df64e){_0x80dc0=_0x80dc0-0x0;var _0x250d29=_0xaf1b[_0x80dc0];return _0x250d29;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['get'](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x11')]);router['get'](_0xbaf1('0x12'),auth[_0xbaf1('0xc')](),controller['getMembers']);router[_0xbaf1('0xb')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x13')]);router[_0xbaf1('0xb')](_0xbaf1('0x14'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbaf1('0x16')]);router[_0xbaf1('0x17')](_0xbaf1('0x18'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x19')]);router[_0xbaf1('0x17')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1a')]);router[_0xbaf1('0x1b')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1c')]);router[_0xbaf1('0x1d')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller['destroy']);router[_0xbaf1('0x1d')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1e')]);router[_0xbaf1('0x1d')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1f')]);module['exports']=router;
\ No newline at end of file
+var _0xe5af=['util','path','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents'];(function(_0x4e8b6b,_0x19978f){var _0x20c664=function(_0x628deb){while(--_0x628deb){_0x4e8b6b['push'](_0x4e8b6b['shift']());}};_0x20c664(++_0x19978f);}(_0xe5af,0x9c));var _0xfe5a=function(_0x22dbb2,_0x5394d3){_0x22dbb2=_0x22dbb2-0x0;var _0x84deb1=_0xe5af[_0x22dbb2];return _0x84deb1;};'use strict';var multer=require('multer');var util=require(_0xfe5a('0x0'));var path=require(_0xfe5a('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe5a('0x2'));var router=express[_0xfe5a('0x3')]();var fs_extra=require(_0xfe5a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfe5a('0x5'));var config=require('../../config/environment');var controller=require('./faxQueue.controller');router[_0xfe5a('0x6')]('/',auth[_0xfe5a('0x7')](),controller['index']);router['get'](_0xfe5a('0x8'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x9')]);router[_0xfe5a('0x6')]('/:id',auth[_0xfe5a('0x7')](),controller['show']);router['get'](_0xfe5a('0xa'),auth[_0xfe5a('0x7')](),controller['getMembers']);router[_0xfe5a('0x6')](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xc')]);router[_0xfe5a('0x6')]('/:id/users',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xd')]);router[_0xfe5a('0xe')]('/',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0xf')]);router['post'](_0xfe5a('0xb'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x10')]);router[_0xfe5a('0xe')](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x12')]);router[_0xfe5a('0x13')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x15')]);router[_0xfe5a('0x16')](_0xfe5a('0x14'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x17')]);router[_0xfe5a('0x16')]('/:id/teams',auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x18')]);router['delete'](_0xfe5a('0x11'),auth[_0xfe5a('0x7')](),controller[_0xfe5a('0x19')]);module['exports']=router;
\ No newline at end of file
index 1c66bad..833e949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b2e=['STRING','DATE','exports'];(function(_0x134198,_0x3e8614){var _0x44fd50=function(_0x2683e6){while(--_0x2683e6){_0x134198['push'](_0x134198['shift']());}};_0x44fd50(++_0x3e8614);}(_0x4b2e,0xcb));var _0xe4b2=function(_0xe47c8b,_0x29aef7){_0xe47c8b=_0xe47c8b-0x0;var _0x39876e=_0x4b2e[_0xe47c8b];return _0x39876e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe4b2('0x0')]={'uniqueid':{'type':Sequelize[_0xe4b2('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe4b2('0x1')]},'joinAt':{'type':Sequelize[_0xe4b2('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe4b2('0x2')]},'exitAt':{'type':Sequelize[_0xe4b2('0x2')]},'reason':{'type':Sequelize[_0xe4b2('0x1')]}};
\ No newline at end of file
+var _0x691a=['sequelize','exports','STRING','DATE','moment'];(function(_0x35035e,_0x26bc1d){var _0x3a042f=function(_0x38d4e3){while(--_0x38d4e3){_0x35035e['push'](_0x35035e['shift']());}};_0x3a042f(++_0x26bc1d);}(_0x691a,0x1df));var _0xa691=function(_0x1b748c,_0x730c57){_0x1b748c=_0x1b748c-0x0;var _0x56cf69=_0x691a[_0x1b748c];return _0x56cf69;};'use strict';var moment=require(_0xa691('0x0'));var Sequelize=require(_0xa691('0x1'));module[_0xa691('0x2')]={'uniqueid':{'type':Sequelize[_0xa691('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa691('0x3')]},'joinAt':{'type':Sequelize[_0xa691('0x4')]},'leaveAt':{'type':Sequelize[_0xa691('0x4')]},'acceptAt':{'type':Sequelize[_0xa691('0x4')]},'exitAt':{'type':Sequelize[_0xa691('0x4')]},'reason':{'type':Sequelize[_0xa691('0x3')]}};
\ No newline at end of file
index e1688d2..a5e7ef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x534d=['error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','pick','merge','where','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x534d,0x79));var _0xd534=function(_0x38b33c,_0x13bf9a){_0x38b33c=_0x38b33c-0x0;var _0x3e2f77=_0x534d[_0x38b33c];return _0x3e2f77;};'use strict';var emlformat=require(_0xd534('0x0'));var rimraf=require(_0xd534('0x1'));var zipdir=require(_0xd534('0x2'));var jsonpatch=require(_0xd534('0x3'));var rp=require(_0xd534('0x4'));var moment=require(_0xd534('0x5'));var BPromise=require(_0xd534('0x6'));var Mustache=require(_0xd534('0x7'));var util=require(_0xd534('0x8'));var path=require(_0xd534('0x9'));var sox=require(_0xd534('0xa'));var csv=require(_0xd534('0xb'));var ejs=require(_0xd534('0xc'));var fs=require('fs');var fs_extra=require(_0xd534('0xd'));var _=require(_0xd534('0xe'));var squel=require(_0xd534('0xf'));var crypto=require(_0xd534('0x10'));var jsforce=require(_0xd534('0x11'));var deskjs=require(_0xd534('0x12'));var toCsv=require('to-csv');var querystring=require(_0xd534('0x13'));var Papa=require(_0xd534('0x14'));var Redis=require(_0xd534('0x15'));var authService=require(_0xd534('0x16'));var qs=require(_0xd534('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd534('0x18'));var logger=require(_0xd534('0x19'))(_0xd534('0x1a'));var utils=require(_0xd534('0x1b'));var config=require(_0xd534('0x1c'));var licenseUtil=require(_0xd534('0x1d'));var db=require(_0xd534('0x1e'))['db'];function respondWithStatusCode(_0xc019db,_0x568e0e){_0x568e0e=_0x568e0e||0xcc;return function(_0x518e7d){if(_0x518e7d){return _0xc019db[_0xd534('0x1f')](_0x568e0e);}return _0xc019db[_0xd534('0x20')](_0x568e0e)[_0xd534('0x21')]();};}function respondWithResult(_0x187e0,_0x290b75){_0x290b75=_0x290b75||0xc8;return function(_0x9ecc7d){if(_0x9ecc7d){return _0x187e0[_0xd534('0x20')](_0x290b75)[_0xd534('0x22')](_0x9ecc7d);}};}function respondWithFilteredResult(_0x340dee,_0x1ec85f){return function(_0x502c61){if(_0x502c61){var _0x51e8b2=typeof _0x1ec85f[_0xd534('0x23')]===_0xd534('0x24')&&typeof _0x1ec85f[_0xd534('0x25')]==='undefined';var _0x4f7f45=_0x502c61[_0xd534('0x26')];var _0x477b62=_0x51e8b2?0x0:_0x1ec85f[_0xd534('0x23')];var _0xb097fd=_0x51e8b2?_0x502c61['count']:_0x1ec85f['offset']+_0x1ec85f[_0xd534('0x25')];var _0x65672f;if(_0xb097fd>=_0x4f7f45){_0xb097fd=_0x4f7f45;_0x65672f=0xc8;}else{_0x65672f=0xce;}_0x340dee['status'](_0x65672f);return _0x340dee['set'](_0xd534('0x27'),_0x477b62+'-'+_0xb097fd+'/'+_0x4f7f45)['json'](_0x502c61);}return null;};}function patchUpdates(_0x3c0f39){return function(_0x419e08){try{jsonpatch[_0xd534('0x28')](_0x419e08,_0x3c0f39,!![]);}catch(_0x4464d3){return BPromise[_0xd534('0x29')](_0x4464d3);}return _0x419e08['save']();};}function saveUpdates(_0x59f5d7,_0x25a176){return function(_0x533c13){if(_0x533c13){return _0x533c13[_0xd534('0x2a')](_0x59f5d7)[_0xd534('0x2b')](function(_0x4d139f){return _0x4d139f;});}return null;};}function removeEntity(_0x3138f6,_0x38681b){return function(_0x3c030e){if(_0x3c030e){return _0x3c030e[_0xd534('0x2c')]()['then'](function(){_0x3138f6['status'](0xcc)[_0xd534('0x21')]();});}};}function handleEntityNotFound(_0x269b31,_0x1028b8){return function(_0x4ec7bf){if(!_0x4ec7bf){_0x269b31[_0xd534('0x1f')](0x194);}return _0x4ec7bf;};}function handleError(_0x27d291,_0x46818d){_0x46818d=_0x46818d||0x1f4;return function(_0x4c509d){logger[_0xd534('0x2d')](_0x4c509d[_0xd534('0x2e')]);if(_0x4c509d['name']){delete _0x4c509d[_0xd534('0x2f')];}_0x27d291[_0xd534('0x20')](_0x46818d)[_0xd534('0x30')](_0x4c509d);};}exports[_0xd534('0x31')]=function(_0x2bf346,_0x36ee41){var _0x4d5bbb={},_0xf3da75={},_0x35037c={'count':0x0,'rows':[]};var _0xb08730=_[_0xd534('0x32')](db[_0xd534('0x33')][_0xd534('0x34')],function(_0x2d525e){return{'name':_0x2d525e[_0xd534('0x35')],'type':_0x2d525e[_0xd534('0x36')][_0xd534('0x37')]};});_0xf3da75[_0xd534('0x38')]=_[_0xd534('0x32')](_0xb08730,'name');_0xf3da75[_0xd534('0x39')]=_[_0xd534('0x3a')](_0x2bf346['query']);_0xf3da75[_0xd534('0x3b')]=_[_0xd534('0x3c')](_0xf3da75['model'],_0xf3da75['query']);_0x4d5bbb['attributes']=_[_0xd534('0x3c')](_0xf3da75[_0xd534('0x38')],qs['fields'](_0x2bf346[_0xd534('0x39')][_0xd534('0x3d')]));_0x4d5bbb[_0xd534('0x3e')]=_0x4d5bbb['attributes'][_0xd534('0x3f')]?_0x4d5bbb[_0xd534('0x3e')]:_0xf3da75[_0xd534('0x38')];if(!_0x2bf346['query'][_0xd534('0x40')](_0xd534('0x41'))){_0x4d5bbb[_0xd534('0x25')]=qs['limit'](_0x2bf346[_0xd534('0x39')][_0xd534('0x25')]);_0x4d5bbb['offset']=qs[_0xd534('0x23')](_0x2bf346[_0xd534('0x39')][_0xd534('0x23')]);}_0x4d5bbb[_0xd534('0x42')]=qs['sort'](_0x2bf346[_0xd534('0x39')]['sort']);_0x4d5bbb['where']=qs['filters'](_[_0xd534('0x43')](_0x2bf346[_0xd534('0x39')],_0xf3da75[_0xd534('0x3b')]),_0xb08730);if(_0x2bf346[_0xd534('0x39')]['filter']){_0x4d5bbb['where']=_[_0xd534('0x44')](_0x4d5bbb[_0xd534('0x45')],{'$or':_[_0xd534('0x32')](_0xb08730,function(_0x1f588d){if(_0x1f588d[_0xd534('0x36')]!==_0xd534('0x46')){var _0x4b8d09={};_0x4b8d09[_0x1f588d[_0xd534('0x2f')]]={'$like':'%'+_0x2bf346['query'][_0xd534('0x47')]+'%'};return _0x4b8d09;}})});}_0x4d5bbb=_[_0xd534('0x44')]({},_0x4d5bbb,_0x2bf346[_0xd534('0x48')]);var _0x3bb78f={'where':_0x4d5bbb[_0xd534('0x45')]};return db['FaxQueueReport'][_0xd534('0x26')](_0x3bb78f)['then'](function(_0x351e1b){_0x35037c[_0xd534('0x26')]=_0x351e1b;if(_0x2bf346[_0xd534('0x39')][_0xd534('0x49')]){_0x4d5bbb[_0xd534('0x4a')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x4d5bbb);})[_0xd534('0x2b')](function(_0x2b9de4){_0x35037c[_0xd534('0x4b')]=_0x2b9de4;return _0x35037c;})[_0xd534('0x2b')](respondWithFilteredResult(_0x36ee41,_0x4d5bbb))[_0xd534('0x4c')](handleError(_0x36ee41,null));};exports[_0xd534('0x4d')]=function(_0x1ee0fa,_0xc8b67d){var _0x5b2eb3={'raw':!![],'where':{'id':_0x1ee0fa[_0xd534('0x4e')]['id']}},_0x1e8595={};_0x1e8595[_0xd534('0x38')]=_['keys'](db['FaxQueueReport'][_0xd534('0x34')]);_0x1e8595[_0xd534('0x39')]=_['keys'](_0x1ee0fa[_0xd534('0x39')]);_0x1e8595['filters']=_[_0xd534('0x3c')](_0x1e8595[_0xd534('0x38')],_0x1e8595[_0xd534('0x39')]);_0x5b2eb3['attributes']=_[_0xd534('0x3c')](_0x1e8595[_0xd534('0x38')],qs[_0xd534('0x3d')](_0x1ee0fa[_0xd534('0x39')][_0xd534('0x3d')]));_0x5b2eb3[_0xd534('0x3e')]=_0x5b2eb3[_0xd534('0x3e')][_0xd534('0x3f')]?_0x5b2eb3[_0xd534('0x3e')]:_0x1e8595[_0xd534('0x38')];if(_0x1ee0fa['query']['includeAll']){_0x5b2eb3['include']=[{'all':!![]}];}_0x5b2eb3=_[_0xd534('0x44')]({},_0x5b2eb3,_0x1ee0fa[_0xd534('0x48')]);return db[_0xd534('0x33')][_0xd534('0x4f')](_0x5b2eb3)[_0xd534('0x2b')](handleEntityNotFound(_0xc8b67d,null))[_0xd534('0x2b')](respondWithResult(_0xc8b67d,null))['catch'](handleError(_0xc8b67d,null));};exports[_0xd534('0x50')]=function(_0x4c4560,_0x3eb0d1){return db[_0xd534('0x33')]['create'](_0x4c4560[_0xd534('0x51')],{})[_0xd534('0x2b')](respondWithResult(_0x3eb0d1,0xc9))[_0xd534('0x4c')](handleError(_0x3eb0d1,null));};exports[_0xd534('0x2a')]=function(_0x495f17,_0xb3c1cb){if(_0x495f17[_0xd534('0x51')]['id']){delete _0x495f17[_0xd534('0x51')]['id'];}return db[_0xd534('0x33')][_0xd534('0x4f')]({'where':{'id':_0x495f17[_0xd534('0x4e')]['id']}})[_0xd534('0x2b')](handleEntityNotFound(_0xb3c1cb,null))['then'](saveUpdates(_0x495f17['body'],null))[_0xd534('0x2b')](respondWithResult(_0xb3c1cb,null))[_0xd534('0x4c')](handleError(_0xb3c1cb,null));};exports['destroy']=function(_0x494667,_0x56b2ee){return db[_0xd534('0x33')]['find']({'where':{'id':_0x494667[_0xd534('0x4e')]['id']}})[_0xd534('0x2b')](handleEntityNotFound(_0x56b2ee,null))[_0xd534('0x2b')](removeEntity(_0x56b2ee,null))[_0xd534('0x4c')](handleError(_0x56b2ee,null));};exports['describe']=function(_0x17b1bc,_0x400472){return db[_0xd534('0x33')][_0xd534('0x52')]()[_0xd534('0x2b')](respondWithResult(_0x400472,null))[_0xd534('0x4c')](handleError(_0x400472,null));};
\ No newline at end of file
+var _0x41bb=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','FaxQueueReport','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0xf157bf,_0x1c3d7b){var _0x5f0aca=function(_0x2f36b1){while(--_0x2f36b1){_0xf157bf['push'](_0xf157bf['shift']());}};_0x5f0aca(++_0x1c3d7b);}(_0x41bb,0xc5));var _0xb41b=function(_0xb2e7dd,_0x299a0d){_0xb2e7dd=_0xb2e7dd-0x0;var _0x2d7f6f=_0x41bb[_0xb2e7dd];return _0x2d7f6f;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require(_0xb41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb41b('0x2'));var rp=require('request-promise');var moment=require(_0xb41b('0x3'));var BPromise=require(_0xb41b('0x4'));var Mustache=require(_0xb41b('0x5'));var util=require(_0xb41b('0x6'));var path=require('path');var sox=require(_0xb41b('0x7'));var csv=require(_0xb41b('0x8'));var ejs=require(_0xb41b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x8'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var as=require(_0xb41b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb41b('0x12'))('api');var utils=require(_0xb41b('0x13'));var config=require(_0xb41b('0x14'));var licenseUtil=require(_0xb41b('0x15'));var db=require(_0xb41b('0x16'))['db'];function respondWithStatusCode(_0x2066d5,_0x5f1ea4){_0x5f1ea4=_0x5f1ea4||0xcc;return function(_0x353ba3){if(_0x353ba3){return _0x2066d5[_0xb41b('0x17')](_0x5f1ea4);}return _0x2066d5[_0xb41b('0x18')](_0x5f1ea4)[_0xb41b('0x19')]();};}function respondWithResult(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xc8;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['status'](_0x4e8603)[_0xb41b('0x1a')](_0x4e7f11);}};}function respondWithFilteredResult(_0xdc5fb0,_0x143a81){return function(_0x338920){if(_0x338920){var _0x29ea51=typeof _0x143a81['offset']===_0xb41b('0x1b')&&typeof _0x143a81[_0xb41b('0x1c')]===_0xb41b('0x1b');var _0xcf0728=_0x338920[_0xb41b('0x1d')];var _0x47154d=_0x29ea51?0x0:_0x143a81[_0xb41b('0x1e')];var _0x5df8c2=_0x29ea51?_0x338920['count']:_0x143a81['offset']+_0x143a81[_0xb41b('0x1c')];var _0x503e86;if(_0x5df8c2>=_0xcf0728){_0x5df8c2=_0xcf0728;_0x503e86=0xc8;}else{_0x503e86=0xce;}_0xdc5fb0[_0xb41b('0x18')](_0x503e86);return _0xdc5fb0[_0xb41b('0x1f')](_0xb41b('0x20'),_0x47154d+'-'+_0x5df8c2+'/'+_0xcf0728)['json'](_0x338920);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x21')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x22')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x23')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x24')](_0x42dccb)[_0xb41b('0x25')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x25')](function(){_0x583741[_0xb41b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed3c7e,_0x4a7992){return function(_0x2d0f27){if(!_0x2d0f27){_0xed3c7e[_0xb41b('0x17')](0x194);}return _0x2d0f27;};}function handleError(_0x53e3a2,_0x3af2c){_0x3af2c=_0x3af2c||0x1f4;return function(_0x4265b8){logger['error'](_0x4265b8['stack']);if(_0x4265b8[_0xb41b('0x26')]){delete _0x4265b8[_0xb41b('0x26')];}_0x53e3a2[_0xb41b('0x18')](_0x3af2c)[_0xb41b('0x27')](_0x4265b8);};}exports[_0xb41b('0x28')]=function(_0x181cbd,_0x253efb){var _0x545395={},_0x26ef96={},_0xb68029={'count':0x0,'rows':[]};var _0x5069aa=_[_0xb41b('0x29')](db['FaxQueueReport'][_0xb41b('0x2a')],function(_0x31d4cd){return{'name':_0x31d4cd['fieldName'],'type':_0x31d4cd[_0xb41b('0x2b')]['key']};});_0x26ef96[_0xb41b('0x2c')]=_[_0xb41b('0x29')](_0x5069aa,'name');_0x26ef96[_0xb41b('0x2d')]=_[_0xb41b('0x2e')](_0x181cbd[_0xb41b('0x2d')]);_0x26ef96[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],_0x26ef96[_0xb41b('0x2d')]);_0x545395[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],qs['fields'](_0x181cbd[_0xb41b('0x2d')]['fields']));_0x545395['attributes']=_0x545395[_0xb41b('0x31')][_0xb41b('0x32')]?_0x545395[_0xb41b('0x31')]:_0x26ef96[_0xb41b('0x2c')];if(!_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x33')](_0xb41b('0x34'))){_0x545395[_0xb41b('0x1c')]=qs[_0xb41b('0x1c')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1c')]);_0x545395['offset']=qs[_0xb41b('0x1e')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1e')]);}_0x545395[_0xb41b('0x35')]=qs[_0xb41b('0x36')](_0x181cbd[_0xb41b('0x2d')]['sort']);_0x545395['where']=qs[_0xb41b('0x2f')](_[_0xb41b('0x37')](_0x181cbd['query'],_0x26ef96[_0xb41b('0x2f')]),_0x5069aa);if(_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]){_0x545395[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x545395['where'],{'$or':_[_0xb41b('0x29')](_0x5069aa,function(_0x5775d3){if(_0x5775d3[_0xb41b('0x2b')]!==_0xb41b('0x3b')){var _0x799d6={};_0x799d6[_0x5775d3[_0xb41b('0x26')]]={'$like':'%'+_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]+'%'};return _0x799d6;}})});}_0x545395=_[_0xb41b('0x3a')]({},_0x545395,_0x181cbd[_0xb41b('0x3c')]);var _0x2b0721={'where':_0x545395['where']};return db['FaxQueueReport']['count'](_0x2b0721)[_0xb41b('0x25')](function(_0x5147ce){_0xb68029['count']=_0x5147ce;if(_0x181cbd[_0xb41b('0x2d')]['includeAll']){_0x545395[_0xb41b('0x3d')]=[{'all':!![]}];}return db[_0xb41b('0x3e')][_0xb41b('0x3f')](_0x545395);})[_0xb41b('0x25')](function(_0x4fa390){_0xb68029[_0xb41b('0x40')]=_0x4fa390;return _0xb68029;})[_0xb41b('0x25')](respondWithFilteredResult(_0x253efb,_0x545395))['catch'](handleError(_0x253efb,null));};exports[_0xb41b('0x41')]=function(_0xa70324,_0x3f181c){var _0x174d6c={'raw':!![],'where':{'id':_0xa70324[_0xb41b('0x42')]['id']}},_0x47bab5={};_0x47bab5['model']=_[_0xb41b('0x2e')](db[_0xb41b('0x3e')][_0xb41b('0x2a')]);_0x47bab5['query']=_['keys'](_0xa70324[_0xb41b('0x2d')]);_0x47bab5[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x47bab5[_0xb41b('0x2c')],_0x47bab5[_0xb41b('0x2d')]);_0x174d6c[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x47bab5['model'],qs['fields'](_0xa70324[_0xb41b('0x2d')]['fields']));_0x174d6c[_0xb41b('0x31')]=_0x174d6c['attributes'][_0xb41b('0x32')]?_0x174d6c['attributes']:_0x47bab5[_0xb41b('0x2c')];if(_0xa70324['query'][_0xb41b('0x43')]){_0x174d6c[_0xb41b('0x3d')]=[{'all':!![]}];}_0x174d6c=_[_0xb41b('0x3a')]({},_0x174d6c,_0xa70324[_0xb41b('0x3c')]);return db['FaxQueueReport'][_0xb41b('0x44')](_0x174d6c)[_0xb41b('0x25')](handleEntityNotFound(_0x3f181c,null))['then'](respondWithResult(_0x3f181c,null))[_0xb41b('0x45')](handleError(_0x3f181c,null));};exports['create']=function(_0x5cc658,_0x5733d0){return db['FaxQueueReport'][_0xb41b('0x46')](_0x5cc658[_0xb41b('0x47')],{})[_0xb41b('0x25')](respondWithResult(_0x5733d0,0xc9))[_0xb41b('0x45')](handleError(_0x5733d0,null));};exports[_0xb41b('0x24')]=function(_0x349a6c,_0x34d076){if(_0x349a6c[_0xb41b('0x47')]['id']){delete _0x349a6c[_0xb41b('0x47')]['id'];}return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x349a6c[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x34d076,null))[_0xb41b('0x25')](saveUpdates(_0x349a6c[_0xb41b('0x47')],null))[_0xb41b('0x25')](respondWithResult(_0x34d076,null))['catch'](handleError(_0x34d076,null));};exports[_0xb41b('0x48')]=function(_0x5e041d,_0x4a7aa3){return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x5e041d[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x4a7aa3,null))[_0xb41b('0x25')](removeEntity(_0x4a7aa3,null))[_0xb41b('0x45')](handleError(_0x4a7aa3,null));};exports[_0xb41b('0x49')]=function(_0x23d6c6,_0x2befc7){return db[_0xb41b('0x3e')][_0xb41b('0x49')]()[_0xb41b('0x25')](respondWithResult(_0x2befc7,null))[_0xb41b('0x45')](handleError(_0x2befc7,null));};
\ No newline at end of file
index 929dff5..2ed9af9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x3d8207,_0x323d6e){var _0x17bf61=function(_0x536ac8){while(--_0x536ac8){_0x3d8207['push'](_0x3d8207['shift']());}};_0x17bf61(++_0x323d6e);}(_0xe14b,0x93));var _0xbe14=function(_0x502c6f,_0x1a1528){_0x502c6f=_0x502c6f-0x0;var _0x591ec6=_0xe14b[_0x502c6f];return _0x591ec6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash'];(function(_0x5872bf,_0x2731cf){var _0x236c1d=function(_0x575885){while(--_0x575885){_0x5872bf['push'](_0x5872bf['shift']());}};_0x236c1d(++_0x2731cf);}(_0xf494,0x1c6));var _0x4f49=function(_0x9031ba,_0x5a3773){_0x9031ba=_0x9031ba-0x0;var _0xc624ed=_0xf494[_0x9031ba];return _0xc624ed;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x4f49('0xc'),'fields':[_0x4f49('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 84a02e9..60de161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x761f=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis'];(function(_0x48b99c,_0x5b2d9d){var _0x5a52de=function(_0x1da2ab){while(--_0x1da2ab){_0x48b99c['push'](_0x48b99c['shift']());}};_0x5a52de(++_0x5b2d9d);}(_0x761f,0xf3));var _0xf761=function(_0x4d7a61,_0x3fb6e6){_0x4d7a61=_0x4d7a61-0x0;var _0x186f73=_0x761f[_0x4d7a61];return _0x186f73;};'use strict';var _=require('lodash');var util=require(_0xf761('0x0'));var moment=require(_0xf761('0x1'));var BPromise=require(_0xf761('0x2'));var rs=require(_0xf761('0x3'));var fs=require('fs');var Redis=require(_0xf761('0x4'));var db=require(_0xf761('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf761('0x6'));var config=require(_0xf761('0x7'));var jayson=require(_0xf761('0x8'));var client=jayson[_0xf761('0x9')][_0xf761('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2d53,_0x5d1418,_0x373779){return new BPromise(function(_0xea32c7,_0x1286ab){return client[_0xf761('0xb')](_0x3a2d53,_0x373779)[_0xf761('0xc')](function(_0x555185){logger[_0xf761('0xd')](_0xf761('0xe'),_0x5d1418,_0xf761('0xf'));logger[_0xf761('0x10')](_0xf761('0x11'),_0x5d1418,_0xf761('0xf'),JSON[_0xf761('0x12')](_0x555185));if(_0x555185['error']){if(_0x555185['error']['code']===0x1f4){logger[_0xf761('0x13')](_0xf761('0xe'),_0x5d1418,_0x555185[_0xf761('0x13')][_0xf761('0x14')]);return _0x1286ab(_0x555185[_0xf761('0x13')][_0xf761('0x14')]);}logger[_0xf761('0x13')](_0xf761('0xe'),_0x5d1418,_0x555185[_0xf761('0x13')][_0xf761('0x14')]);return _0xea32c7(_0x555185[_0xf761('0x13')][_0xf761('0x14')]);}else{logger[_0xf761('0xd')](_0xf761('0xe'),_0x5d1418,_0xf761('0xf'));_0xea32c7(_0x555185[_0xf761('0x15')][_0xf761('0x14')]);}})[_0xf761('0x16')](function(_0x29487c){logger[_0xf761('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x5d1418,_0x29487c);_0x1286ab(_0x29487c);});});}exports[_0xf761('0x17')]=function(_0x24ad03){var _0x55b188=this;return new Promise(function(_0x2171e6,_0x5c19e1){return db[_0xf761('0x18')]['create'](_0x24ad03['body'],{'raw':_0x24ad03[_0xf761('0x19')]?_0x24ad03[_0xf761('0x19')][_0xf761('0x1a')]===undefined?!![]:![]:!![]})[_0xf761('0xc')](function(_0x4d62ce){logger[_0xf761('0xd')](_0xf761('0x17'),_0x24ad03);logger['debug'](_0xf761('0x17'),_0x24ad03,JSON[_0xf761('0x12')](_0x4d62ce));_0x2171e6(_0x4d62ce);})[_0xf761('0x16')](function(_0x9df7c7){logger[_0xf761('0x13')](_0xf761('0x17'),_0x9df7c7['message'],_0x24ad03);_0x5c19e1(_0x55b188[_0xf761('0x13')](0x1f4,_0x9df7c7[_0xf761('0x14')]));});});};exports[_0xf761('0x1b')]=function(_0x114eff){var _0x26d228=this;return new Promise(function(_0xc471a6,_0x2f5bd7){return db['FaxQueueReport'][_0xf761('0x1c')](_0x114eff['body'],{'raw':_0x114eff[_0xf761('0x19')]?_0x114eff[_0xf761('0x19')][_0xf761('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x114eff[_0xf761('0x19')]?_0x114eff[_0xf761('0x19')]['where']||null:null,'attributes':_0x114eff[_0xf761('0x19')]?_0x114eff[_0xf761('0x19')][_0xf761('0x1d')]||null:null,'limit':_0x114eff[_0xf761('0x19')]?_0x114eff[_0xf761('0x19')][_0xf761('0x1e')]||null:null})[_0xf761('0xc')](function(_0x31d7fb){logger[_0xf761('0xd')](_0xf761('0x1b'),_0x114eff);logger['debug'](_0xf761('0x1b'),_0x114eff,JSON['stringify'](_0x31d7fb));_0xc471a6(_0x31d7fb);})['catch'](function(_0x14e621){logger['error'](_0xf761('0x1b'),_0x14e621['message'],_0x114eff);_0x2f5bd7(_0x26d228[_0xf761('0x13')](0x1f4,_0x14e621[_0xf761('0x14')]));});});};
\ No newline at end of file
+var _0x8d27=['then','debug','UpdateFaxQueueReport','update','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8d27,0xdf));var _0x78d2=function(_0x521d30,_0x3e6377){_0x521d30=_0x521d30-0x0;var _0x5b79de=_0x8d27[_0x521d30];return _0x5b79de;};'use strict';var _=require('lodash');var util=require(_0x78d2('0x0'));var moment=require(_0x78d2('0x1'));var BPromise=require(_0x78d2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78d2('0x3'));var db=require(_0x78d2('0x4'))['db'];var utils=require(_0x78d2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x78d2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x78d2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18222b,_0x5ea90e,_0x340e55){return new BPromise(function(_0x132c4c,_0x4ac4c7){return client[_0x78d2('0x8')](_0x18222b,_0x340e55)['then'](function(_0x4e8db9){logger[_0x78d2('0x9')](_0x78d2('0xa'),_0x5ea90e,_0x78d2('0xb'));logger['debug'](_0x78d2('0xc'),_0x5ea90e,_0x78d2('0xb'),JSON[_0x78d2('0xd')](_0x4e8db9));if(_0x4e8db9[_0x78d2('0xe')]){if(_0x4e8db9[_0x78d2('0xe')][_0x78d2('0xf')]===0x1f4){logger[_0x78d2('0xe')](_0x78d2('0xa'),_0x5ea90e,_0x4e8db9[_0x78d2('0xe')][_0x78d2('0x10')]);return _0x4ac4c7(_0x4e8db9[_0x78d2('0xe')][_0x78d2('0x10')]);}logger['error'](_0x78d2('0xa'),_0x5ea90e,_0x4e8db9[_0x78d2('0xe')][_0x78d2('0x10')]);return _0x132c4c(_0x4e8db9[_0x78d2('0xe')][_0x78d2('0x10')]);}else{logger[_0x78d2('0x9')]('FaxQueueReport,\x20%s,\x20%s',_0x5ea90e,_0x78d2('0xb'));_0x132c4c(_0x4e8db9[_0x78d2('0x11')][_0x78d2('0x10')]);}})[_0x78d2('0x12')](function(_0x5d3cb4){logger[_0x78d2('0xe')](_0x78d2('0xa'),_0x5ea90e,_0x5d3cb4);_0x4ac4c7(_0x5d3cb4);});});}exports[_0x78d2('0x13')]=function(_0x1ba552){var _0x3d500b=this;return new Promise(function(_0x2f12d5,_0x5a523b){return db[_0x78d2('0x14')][_0x78d2('0x15')](_0x1ba552[_0x78d2('0x16')],{'raw':_0x1ba552[_0x78d2('0x17')]?_0x1ba552['options'][_0x78d2('0x18')]===undefined?!![]:![]:!![]})[_0x78d2('0x19')](function(_0x3a6259){logger[_0x78d2('0x9')](_0x78d2('0x13'),_0x1ba552);logger[_0x78d2('0x1a')](_0x78d2('0x13'),_0x1ba552,JSON['stringify'](_0x3a6259));_0x2f12d5(_0x3a6259);})[_0x78d2('0x12')](function(_0x35786f){logger[_0x78d2('0xe')](_0x78d2('0x13'),_0x35786f[_0x78d2('0x10')],_0x1ba552);_0x5a523b(_0x3d500b[_0x78d2('0xe')](0x1f4,_0x35786f[_0x78d2('0x10')]));});});};exports[_0x78d2('0x1b')]=function(_0x14b1f4){var _0x50131f=this;return new Promise(function(_0x1dbc53,_0x52cd31){return db[_0x78d2('0x14')][_0x78d2('0x1c')](_0x14b1f4[_0x78d2('0x16')],{'raw':_0x14b1f4['options']?_0x14b1f4[_0x78d2('0x17')][_0x78d2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14b1f4[_0x78d2('0x17')]?_0x14b1f4[_0x78d2('0x17')]['where']||null:null,'attributes':_0x14b1f4['options']?_0x14b1f4[_0x78d2('0x17')][_0x78d2('0x1d')]||null:null,'limit':_0x14b1f4[_0x78d2('0x17')]?_0x14b1f4['options'][_0x78d2('0x1e')]||null:null})[_0x78d2('0x19')](function(_0x571729){logger[_0x78d2('0x9')](_0x78d2('0x1b'),_0x14b1f4);logger['debug'](_0x78d2('0x1b'),_0x14b1f4,JSON['stringify'](_0x571729));_0x1dbc53(_0x571729);})[_0x78d2('0x12')](function(_0xb071c5){logger[_0x78d2('0xe')](_0x78d2('0x1b'),_0xb071c5[_0x78d2('0x10')],_0x14b1f4);_0x52cd31(_0x50131f[_0x78d2('0xe')](0x1f4,_0xb071c5['message']));});});};
\ No newline at end of file
index 4da5cec..bafdc75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe665=['isAuthenticated','/describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./faxQueueReport.controller','get'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe665,0x117));var _0x5e66=function(_0x12957f,_0x38dfb7){_0x12957f=_0x12957f-0x0;var _0x36b849=_0xe665[_0x12957f];return _0x36b849;};'use strict';var multer=require(_0x5e66('0x0'));var util=require(_0x5e66('0x1'));var path=require(_0x5e66('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e66('0x3'));var router=express[_0x5e66('0x4')]();var fs_extra=require(_0x5e66('0x5'));var auth=require(_0x5e66('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5e66('0x7'));router[_0x5e66('0x8')]('/',auth[_0x5e66('0x9')](),controller['index']);router[_0x5e66('0x8')](_0x5e66('0xa'),auth[_0x5e66('0x9')](),controller['describe']);router[_0x5e66('0x8')](_0x5e66('0xb'),auth[_0x5e66('0x9')](),controller[_0x5e66('0xc')]);router['post']('/',auth[_0x5e66('0x9')](),controller[_0x5e66('0xd')]);router['put'](_0x5e66('0xb'),auth[_0x5e66('0x9')](),controller[_0x5e66('0xe')]);router[_0x5e66('0xf')](_0x5e66('0xb'),auth[_0x5e66('0x9')](),controller[_0x5e66('0x10')]);module[_0x5e66('0x11')]=router;
\ No newline at end of file
+var _0xf85b=['index','/describe','describe','get','/:id','show','post','create','put','update','destroy','exports','util','path','express','../../components/auth/service','../../config/environment','./faxQueueReport.controller','isAuthenticated'];(function(_0x343a12,_0x2bbfcd){var _0x5f1e0b=function(_0x85c39d){while(--_0x85c39d){_0x343a12['push'](_0x343a12['shift']());}};_0x5f1e0b(++_0x2bbfcd);}(_0xf85b,0xa4));var _0xbf85=function(_0x2d5914,_0xafc57a){_0x2d5914=_0x2d5914-0x0;var _0x2abec0=_0xf85b[_0x2d5914];return _0x2abec0;};'use strict';var multer=require('multer');var util=require(_0xbf85('0x0'));var path=require(_0xbf85('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf85('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbf85('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbf85('0x4'));var controller=require(_0xbf85('0x5'));router['get']('/',auth[_0xbf85('0x6')](),controller[_0xbf85('0x7')]);router['get'](_0xbf85('0x8'),auth[_0xbf85('0x6')](),controller[_0xbf85('0x9')]);router[_0xbf85('0xa')](_0xbf85('0xb'),auth[_0xbf85('0x6')](),controller[_0xbf85('0xc')]);router[_0xbf85('0xd')]('/',auth[_0xbf85('0x6')](),controller[_0xbf85('0xe')]);router[_0xbf85('0xf')](_0xbf85('0xb'),auth['isAuthenticated'](),controller[_0xbf85('0x10')]);router['delete'](_0xbf85('0xb'),auth[_0xbf85('0x6')](),controller[_0xbf85('0x11')]);module[_0xbf85('0x12')]=router;
\ No newline at end of file
index 5abbefd..ae9e565 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1d1b1f,_0x338af4){var _0x32ee5c=function(_0x5d7d41){while(--_0x5d7d41){_0x1d1b1f['push'](_0x1d1b1f['shift']());}};_0x32ee5c(++_0x338af4);}(_0xaa88,0x137));var _0x8aa8=function(_0xae01dd,_0xbd8a3c){_0xae01dd=_0xae01dd-0x0;var _0x8c26df=_0xaa88[_0xae01dd];return _0x8c26df;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x23e142,_0x2009bc){var _0x3bd538=function(_0x2becbb){while(--_0x2becbb){_0x23e142['push'](_0x23e142['shift']());}};_0x3bd538(++_0x2009bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x7b286c,_0x1d2ee0){_0x7b286c=_0x7b286c-0x0;var _0x17b878=_0xedd9[_0x7b286c];return _0x17b878;};'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 eafd6ca..20d220d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d10=['body','params','describe','eml-format','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create'];(function(_0x69394d,_0x24473a){var _0x56e048=function(_0x4031cb){while(--_0x4031cb){_0x69394d['push'](_0x69394d['shift']());}};_0x56e048(++_0x24473a);}(_0x3d10,0x9f));var _0x03d1=function(_0x4afac5,_0x1ab4ed){_0x4afac5=_0x4afac5-0x0;var _0x2404b3=_0x3d10[_0x4afac5];return _0x2404b3;};'use strict';var emlformat=require(_0x03d1('0x0'));var rimraf=require(_0x03d1('0x1'));var zipdir=require(_0x03d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x03d1('0x3'));var Mustache=require('mustache');var util=require(_0x03d1('0x4'));var path=require(_0x03d1('0x5'));var sox=require('sox');var csv=require(_0x03d1('0x6'));var ejs=require(_0x03d1('0x7'));var fs=require('fs');var fs_extra=require(_0x03d1('0x8'));var _=require(_0x03d1('0x9'));var squel=require(_0x03d1('0xa'));var crypto=require('crypto');var jsforce=require(_0x03d1('0xb'));var deskjs=require(_0x03d1('0xc'));var toCsv=require(_0x03d1('0x6'));var querystring=require(_0x03d1('0xd'));var Papa=require('papaparse');var Redis=require(_0x03d1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x03d1('0xf'));var as=require(_0x03d1('0x10'));var hardwareService=require(_0x03d1('0x11'));var logger=require(_0x03d1('0x12'))(_0x03d1('0x13'));var utils=require(_0x03d1('0x14'));var config=require(_0x03d1('0x15'));var licenseUtil=require(_0x03d1('0x16'));var db=require(_0x03d1('0x17'))['db'];function respondWithStatusCode(_0x2858e6,_0xae38d9){_0xae38d9=_0xae38d9||0xcc;return function(_0x40075c){if(_0x40075c){return _0x2858e6[_0x03d1('0x18')](_0xae38d9);}return _0x2858e6['status'](_0xae38d9)[_0x03d1('0x19')]();};}function respondWithResult(_0x2f51c3,_0x3b5102){_0x3b5102=_0x3b5102||0xc8;return function(_0x2c7f2e){if(_0x2c7f2e){return _0x2f51c3[_0x03d1('0x1a')](_0x3b5102)[_0x03d1('0x1b')](_0x2c7f2e);}};}function respondWithFilteredResult(_0x19ff7a,_0x2fefb1){return function(_0x264080){if(_0x264080){var _0x3e9670=typeof _0x2fefb1[_0x03d1('0x1c')]===_0x03d1('0x1d')&&typeof _0x2fefb1['limit']==='undefined';var _0x573764=_0x264080[_0x03d1('0x1e')];var _0x3b78bf=_0x3e9670?0x0:_0x2fefb1[_0x03d1('0x1c')];var _0x2a47d0=_0x3e9670?_0x264080[_0x03d1('0x1e')]:_0x2fefb1['offset']+_0x2fefb1[_0x03d1('0x1f')];var _0x24a4b3;if(_0x2a47d0>=_0x573764){_0x2a47d0=_0x573764;_0x24a4b3=0xc8;}else{_0x24a4b3=0xce;}_0x19ff7a[_0x03d1('0x1a')](_0x24a4b3);return _0x19ff7a[_0x03d1('0x20')](_0x03d1('0x21'),_0x3b78bf+'-'+_0x2a47d0+'/'+_0x573764)[_0x03d1('0x1b')](_0x264080);}return null;};}function patchUpdates(_0x2deb7d){return function(_0x2c1814){try{jsonpatch[_0x03d1('0x22')](_0x2c1814,_0x2deb7d,!![]);}catch(_0x2b18c8){return BPromise[_0x03d1('0x23')](_0x2b18c8);}return _0x2c1814[_0x03d1('0x24')]();};}function saveUpdates(_0x34a0f0,_0x203580){return function(_0x212f34){if(_0x212f34){return _0x212f34[_0x03d1('0x25')](_0x34a0f0)[_0x03d1('0x26')](function(_0x1fceb2){return _0x1fceb2;});}return null;};}function removeEntity(_0x292628,_0x169893){return function(_0x59d5ed){if(_0x59d5ed){return _0x59d5ed[_0x03d1('0x27')]()[_0x03d1('0x26')](function(){_0x292628[_0x03d1('0x1a')](0xcc)[_0x03d1('0x19')]();});}};}function handleEntityNotFound(_0x3145e8,_0x334dba){return function(_0x1ef861){if(!_0x1ef861){_0x3145e8[_0x03d1('0x18')](0x194);}return _0x1ef861;};}function handleError(_0x2fa90d,_0x59a7ea){_0x59a7ea=_0x59a7ea||0x1f4;return function(_0x36356f){logger[_0x03d1('0x28')](_0x36356f[_0x03d1('0x29')]);if(_0x36356f[_0x03d1('0x2a')]){delete _0x36356f['name'];}_0x2fa90d[_0x03d1('0x1a')](_0x59a7ea)['send'](_0x36356f);};}exports[_0x03d1('0x2b')]=function(_0xafb976,_0x2e6e4d){var _0x51f713={},_0xe99619={},_0x212394={'count':0x0,'rows':[]};var _0x2a0b0e=_[_0x03d1('0x2c')](db[_0x03d1('0x2d')][_0x03d1('0x2e')],function(_0x4a7789){return{'name':_0x4a7789[_0x03d1('0x2f')],'type':_0x4a7789[_0x03d1('0x30')]['key']};});_0xe99619[_0x03d1('0x31')]=_[_0x03d1('0x2c')](_0x2a0b0e,'name');_0xe99619[_0x03d1('0x32')]=_[_0x03d1('0x33')](_0xafb976['query']);_0xe99619[_0x03d1('0x34')]=_['intersection'](_0xe99619[_0x03d1('0x31')],_0xe99619['query']);_0x51f713['attributes']=_[_0x03d1('0x35')](_0xe99619[_0x03d1('0x31')],qs[_0x03d1('0x36')](_0xafb976[_0x03d1('0x32')][_0x03d1('0x36')]));_0x51f713[_0x03d1('0x37')]=_0x51f713[_0x03d1('0x37')][_0x03d1('0x38')]?_0x51f713['attributes']:_0xe99619[_0x03d1('0x31')];if(!_0xafb976[_0x03d1('0x32')][_0x03d1('0x39')](_0x03d1('0x3a'))){_0x51f713[_0x03d1('0x1f')]=qs[_0x03d1('0x1f')](_0xafb976['query']['limit']);_0x51f713[_0x03d1('0x1c')]=qs[_0x03d1('0x1c')](_0xafb976[_0x03d1('0x32')]['offset']);}_0x51f713[_0x03d1('0x3b')]=qs['sort'](_0xafb976[_0x03d1('0x32')][_0x03d1('0x3c')]);_0x51f713['where']=qs['filters'](_[_0x03d1('0x3d')](_0xafb976[_0x03d1('0x32')],_0xe99619[_0x03d1('0x34')]),_0x2a0b0e);if(_0xafb976[_0x03d1('0x32')][_0x03d1('0x3e')]){_0x51f713[_0x03d1('0x3f')]=_['merge'](_0x51f713['where'],{'$or':_['map'](_0x2a0b0e,function(_0x3ed16a){if(_0x3ed16a[_0x03d1('0x30')]!==_0x03d1('0x40')){var _0x55822a={};_0x55822a[_0x3ed16a[_0x03d1('0x2a')]]={'$like':'%'+_0xafb976[_0x03d1('0x32')][_0x03d1('0x3e')]+'%'};return _0x55822a;}})});}_0x51f713=_[_0x03d1('0x41')]({},_0x51f713,_0xafb976[_0x03d1('0x42')]);var _0x124bca={'where':_0x51f713[_0x03d1('0x3f')]};return db[_0x03d1('0x2d')][_0x03d1('0x1e')](_0x124bca)[_0x03d1('0x26')](function(_0x4a8748){_0x212394[_0x03d1('0x1e')]=_0x4a8748;if(_0xafb976[_0x03d1('0x32')][_0x03d1('0x43')]){_0x51f713[_0x03d1('0x44')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x03d1('0x45')](_0x51f713);})[_0x03d1('0x26')](function(_0xd6fe9){_0x212394[_0x03d1('0x46')]=_0xd6fe9;return _0x212394;})['then'](respondWithFilteredResult(_0x2e6e4d,_0x51f713))[_0x03d1('0x47')](handleError(_0x2e6e4d,null));};exports[_0x03d1('0x48')]=function(_0x24b442,_0x4697d0){var _0x5c98c8={'raw':!![],'where':{'id':_0x24b442['params']['id']}},_0x58fdd7={};_0x58fdd7[_0x03d1('0x31')]=_[_0x03d1('0x33')](db[_0x03d1('0x2d')]['rawAttributes']);_0x58fdd7['query']=_['keys'](_0x24b442['query']);_0x58fdd7['filters']=_[_0x03d1('0x35')](_0x58fdd7['model'],_0x58fdd7[_0x03d1('0x32')]);_0x5c98c8[_0x03d1('0x37')]=_['intersection'](_0x58fdd7['model'],qs[_0x03d1('0x36')](_0x24b442[_0x03d1('0x32')][_0x03d1('0x36')]));_0x5c98c8[_0x03d1('0x37')]=_0x5c98c8[_0x03d1('0x37')][_0x03d1('0x38')]?_0x5c98c8['attributes']:_0x58fdd7['model'];if(_0x24b442[_0x03d1('0x32')]['includeAll']){_0x5c98c8[_0x03d1('0x44')]=[{'all':!![]}];}_0x5c98c8=_[_0x03d1('0x41')]({},_0x5c98c8,_0x24b442[_0x03d1('0x42')]);return db[_0x03d1('0x2d')][_0x03d1('0x49')](_0x5c98c8)['then'](handleEntityNotFound(_0x4697d0,null))[_0x03d1('0x26')](respondWithResult(_0x4697d0,null))['catch'](handleError(_0x4697d0,null));};exports['create']=function(_0x1ac57e,_0x3660cd){return db['FaxTransferReport'][_0x03d1('0x4a')](_0x1ac57e[_0x03d1('0x4b')],{})[_0x03d1('0x26')](respondWithResult(_0x3660cd,0xc9))[_0x03d1('0x47')](handleError(_0x3660cd,null));};exports[_0x03d1('0x25')]=function(_0x3c7455,_0x110884){if(_0x3c7455[_0x03d1('0x4b')]['id']){delete _0x3c7455[_0x03d1('0x4b')]['id'];}return db[_0x03d1('0x2d')][_0x03d1('0x49')]({'where':{'id':_0x3c7455['params']['id']}})[_0x03d1('0x26')](handleEntityNotFound(_0x110884,null))[_0x03d1('0x26')](saveUpdates(_0x3c7455[_0x03d1('0x4b')],null))['then'](respondWithResult(_0x110884,null))[_0x03d1('0x47')](handleError(_0x110884,null));};exports[_0x03d1('0x27')]=function(_0xaee95,_0x48299a){return db[_0x03d1('0x2d')][_0x03d1('0x49')]({'where':{'id':_0xaee95[_0x03d1('0x4c')]['id']}})[_0x03d1('0x26')](handleEntityNotFound(_0x48299a,null))[_0x03d1('0x26')](removeEntity(_0x48299a,null))[_0x03d1('0x47')](handleError(_0x48299a,null));};exports['describe']=function(_0x4c6cd8,_0x57c19b){return db[_0x03d1('0x2d')][_0x03d1('0x4d')]()['then'](respondWithResult(_0x57c19b,null))['catch'](handleError(_0x57c19b,null));};
\ No newline at end of file
+var _0xf7b2=['rows','catch','params','keys','FaxTransferReport','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','apply','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1f207e,_0x496c96){var _0x413bef=function(_0x132f78){while(--_0x132f78){_0x1f207e['push'](_0x1f207e['shift']());}};_0x413bef(++_0x496c96);}(_0xf7b2,0x129));var _0x2f7b=function(_0x4159f3,_0x1a7679){_0x4159f3=_0x4159f3-0x0;var _0x1c53be=_0xf7b2[_0x4159f3];return _0x1c53be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f7b('0x0'));var zipdir=require(_0x2f7b('0x1'));var jsonpatch=require(_0x2f7b('0x2'));var rp=require('request-promise');var moment=require(_0x2f7b('0x3'));var BPromise=require(_0x2f7b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2f7b('0x5'));var sox=require(_0x2f7b('0x6'));var csv=require(_0x2f7b('0x7'));var ejs=require(_0x2f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x2f7b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2f7b('0xa'));var jsforce=require(_0x2f7b('0xb'));var deskjs=require(_0x2f7b('0xc'));var toCsv=require(_0x2f7b('0x7'));var querystring=require(_0x2f7b('0xd'));var Papa=require(_0x2f7b('0xe'));var Redis=require(_0x2f7b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2f7b('0x10'));var hardwareService=require(_0x2f7b('0x11'));var logger=require(_0x2f7b('0x12'))('api');var utils=require(_0x2f7b('0x13'));var config=require(_0x2f7b('0x14'));var licenseUtil=require(_0x2f7b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bfb03,_0x1b560f){_0x1b560f=_0x1b560f||0xcc;return function(_0x50d7d3){if(_0x50d7d3){return _0x4bfb03[_0x2f7b('0x16')](_0x1b560f);}return _0x4bfb03[_0x2f7b('0x17')](_0x1b560f)[_0x2f7b('0x18')]();};}function respondWithResult(_0x334007,_0x51892e){_0x51892e=_0x51892e||0xc8;return function(_0x2a2ddc){if(_0x2a2ddc){return _0x334007[_0x2f7b('0x17')](_0x51892e)[_0x2f7b('0x19')](_0x2a2ddc);}};}function respondWithFilteredResult(_0x1e9d63,_0x1992e9){return function(_0x15c865){if(_0x15c865){var _0x17ca43=typeof _0x1992e9['offset']===_0x2f7b('0x1a')&&typeof _0x1992e9['limit']===_0x2f7b('0x1a');var _0x2629e3=_0x15c865[_0x2f7b('0x1b')];var _0x59c75f=_0x17ca43?0x0:_0x1992e9[_0x2f7b('0x1c')];var _0x13acd4=_0x17ca43?_0x15c865[_0x2f7b('0x1b')]:_0x1992e9[_0x2f7b('0x1c')]+_0x1992e9['limit'];var _0x35c402;if(_0x13acd4>=_0x2629e3){_0x13acd4=_0x2629e3;_0x35c402=0xc8;}else{_0x35c402=0xce;}_0x1e9d63['status'](_0x35c402);return _0x1e9d63[_0x2f7b('0x1d')]('Content-Range',_0x59c75f+'-'+_0x13acd4+'/'+_0x2629e3)[_0x2f7b('0x19')](_0x15c865);}return null;};}function patchUpdates(_0x15ac88){return function(_0x5c946a){try{jsonpatch[_0x2f7b('0x1e')](_0x5c946a,_0x15ac88,!![]);}catch(_0x18a3ec){return BPromise['reject'](_0x18a3ec);}return _0x5c946a[_0x2f7b('0x1f')]();};}function saveUpdates(_0x10aa4a,_0x33c20d){return function(_0x536ce0){if(_0x536ce0){return _0x536ce0[_0x2f7b('0x20')](_0x10aa4a)['then'](function(_0x5d45dc){return _0x5d45dc;});}return null;};}function removeEntity(_0x227d15,_0x37e225){return function(_0x52c7a9){if(_0x52c7a9){return _0x52c7a9[_0x2f7b('0x21')]()[_0x2f7b('0x22')](function(){_0x227d15[_0x2f7b('0x17')](0xcc)[_0x2f7b('0x18')]();});}};}function handleEntityNotFound(_0x23e011,_0x127ab0){return function(_0x45c590){if(!_0x45c590){_0x23e011[_0x2f7b('0x16')](0x194);}return _0x45c590;};}function handleError(_0x5071ab,_0x47ac83){_0x47ac83=_0x47ac83||0x1f4;return function(_0x5b716d){logger['error'](_0x5b716d[_0x2f7b('0x23')]);if(_0x5b716d[_0x2f7b('0x24')]){delete _0x5b716d[_0x2f7b('0x24')];}_0x5071ab[_0x2f7b('0x17')](_0x47ac83)[_0x2f7b('0x25')](_0x5b716d);};}exports[_0x2f7b('0x26')]=function(_0x291d52,_0x2519c9){var _0x5f3fe8={},_0x12912d={},_0x41f221={'count':0x0,'rows':[]};var _0x16a767=_['map'](db['FaxTransferReport'][_0x2f7b('0x27')],function(_0x5cb3d3){return{'name':_0x5cb3d3[_0x2f7b('0x28')],'type':_0x5cb3d3[_0x2f7b('0x29')][_0x2f7b('0x2a')]};});_0x12912d[_0x2f7b('0x2b')]=_[_0x2f7b('0x2c')](_0x16a767,'name');_0x12912d[_0x2f7b('0x2d')]=_['keys'](_0x291d52['query']);_0x12912d['filters']=_['intersection'](_0x12912d[_0x2f7b('0x2b')],_0x12912d[_0x2f7b('0x2d')]);_0x5f3fe8[_0x2f7b('0x2e')]=_[_0x2f7b('0x2f')](_0x12912d[_0x2f7b('0x2b')],qs[_0x2f7b('0x30')](_0x291d52[_0x2f7b('0x2d')][_0x2f7b('0x30')]));_0x5f3fe8[_0x2f7b('0x2e')]=_0x5f3fe8[_0x2f7b('0x2e')][_0x2f7b('0x31')]?_0x5f3fe8[_0x2f7b('0x2e')]:_0x12912d[_0x2f7b('0x2b')];if(!_0x291d52[_0x2f7b('0x2d')]['hasOwnProperty']('nolimit')){_0x5f3fe8[_0x2f7b('0x32')]=qs[_0x2f7b('0x32')](_0x291d52[_0x2f7b('0x2d')][_0x2f7b('0x32')]);_0x5f3fe8[_0x2f7b('0x1c')]=qs['offset'](_0x291d52[_0x2f7b('0x2d')][_0x2f7b('0x1c')]);}_0x5f3fe8[_0x2f7b('0x33')]=qs[_0x2f7b('0x34')](_0x291d52[_0x2f7b('0x2d')][_0x2f7b('0x34')]);_0x5f3fe8[_0x2f7b('0x35')]=qs[_0x2f7b('0x36')](_[_0x2f7b('0x37')](_0x291d52[_0x2f7b('0x2d')],_0x12912d[_0x2f7b('0x36')]),_0x16a767);if(_0x291d52['query'][_0x2f7b('0x38')]){_0x5f3fe8[_0x2f7b('0x35')]=_[_0x2f7b('0x39')](_0x5f3fe8[_0x2f7b('0x35')],{'$or':_['map'](_0x16a767,function(_0x2f8948){if(_0x2f8948['type']!==_0x2f7b('0x3a')){var _0x15e35f={};_0x15e35f[_0x2f8948[_0x2f7b('0x24')]]={'$like':'%'+_0x291d52[_0x2f7b('0x2d')][_0x2f7b('0x38')]+'%'};return _0x15e35f;}})});}_0x5f3fe8=_[_0x2f7b('0x39')]({},_0x5f3fe8,_0x291d52[_0x2f7b('0x3b')]);var _0x19f5a1={'where':_0x5f3fe8[_0x2f7b('0x35')]};return db['FaxTransferReport']['count'](_0x19f5a1)['then'](function(_0x53de0f){_0x41f221[_0x2f7b('0x1b')]=_0x53de0f;if(_0x291d52[_0x2f7b('0x2d')][_0x2f7b('0x3c')]){_0x5f3fe8[_0x2f7b('0x3d')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x2f7b('0x3e')](_0x5f3fe8);})['then'](function(_0x522ce7){_0x41f221[_0x2f7b('0x3f')]=_0x522ce7;return _0x41f221;})[_0x2f7b('0x22')](respondWithFilteredResult(_0x2519c9,_0x5f3fe8))[_0x2f7b('0x40')](handleError(_0x2519c9,null));};exports['show']=function(_0x52be99,_0x4ee003){var _0x454f04={'raw':!![],'where':{'id':_0x52be99[_0x2f7b('0x41')]['id']}},_0x597c03={};_0x597c03['model']=_[_0x2f7b('0x42')](db[_0x2f7b('0x43')][_0x2f7b('0x27')]);_0x597c03[_0x2f7b('0x2d')]=_[_0x2f7b('0x42')](_0x52be99['query']);_0x597c03[_0x2f7b('0x36')]=_[_0x2f7b('0x2f')](_0x597c03[_0x2f7b('0x2b')],_0x597c03['query']);_0x454f04[_0x2f7b('0x2e')]=_[_0x2f7b('0x2f')](_0x597c03[_0x2f7b('0x2b')],qs['fields'](_0x52be99[_0x2f7b('0x2d')][_0x2f7b('0x30')]));_0x454f04[_0x2f7b('0x2e')]=_0x454f04['attributes'][_0x2f7b('0x31')]?_0x454f04[_0x2f7b('0x2e')]:_0x597c03[_0x2f7b('0x2b')];if(_0x52be99['query']['includeAll']){_0x454f04['include']=[{'all':!![]}];}_0x454f04=_[_0x2f7b('0x39')]({},_0x454f04,_0x52be99[_0x2f7b('0x3b')]);return db[_0x2f7b('0x43')]['find'](_0x454f04)[_0x2f7b('0x22')](handleEntityNotFound(_0x4ee003,null))['then'](respondWithResult(_0x4ee003,null))[_0x2f7b('0x40')](handleError(_0x4ee003,null));};exports[_0x2f7b('0x44')]=function(_0x22076e,_0xa09cb1){return db[_0x2f7b('0x43')][_0x2f7b('0x44')](_0x22076e[_0x2f7b('0x45')],{})['then'](respondWithResult(_0xa09cb1,0xc9))['catch'](handleError(_0xa09cb1,null));};exports[_0x2f7b('0x20')]=function(_0x34b13f,_0x3e2f0e){if(_0x34b13f[_0x2f7b('0x45')]['id']){delete _0x34b13f[_0x2f7b('0x45')]['id'];}return db[_0x2f7b('0x43')][_0x2f7b('0x46')]({'where':{'id':_0x34b13f[_0x2f7b('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e2f0e,null))[_0x2f7b('0x22')](saveUpdates(_0x34b13f['body'],null))[_0x2f7b('0x22')](respondWithResult(_0x3e2f0e,null))[_0x2f7b('0x40')](handleError(_0x3e2f0e,null));};exports['destroy']=function(_0xdacea4,_0xc13b67){return db[_0x2f7b('0x43')][_0x2f7b('0x46')]({'where':{'id':_0xdacea4['params']['id']}})[_0x2f7b('0x22')](handleEntityNotFound(_0xc13b67,null))['then'](removeEntity(_0xc13b67,null))['catch'](handleError(_0xc13b67,null));};exports[_0x2f7b('0x47')]=function(_0x337858,_0x2d8484){return db[_0x2f7b('0x43')][_0x2f7b('0x47')]()['then'](respondWithResult(_0x2d8484,null))['catch'](handleError(_0x2d8484,null));};
\ No newline at end of file
index af40685..13a5f10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2ed=['FaxTransferReport','uniqueid','util','api','moment','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x25ba47,_0x51e785){var _0x1aafb8=function(_0x336fe8){while(--_0x336fe8){_0x25ba47['push'](_0x25ba47['shift']());}};_0x1aafb8(++_0x51e785);}(_0xb2ed,0x120));var _0xdb2e=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0xb2ed[_0x1d3577];return _0x277d9a;};'use strict';var _=require('lodash');var util=require(_0xdb2e('0x0'));var logger=require('../../config/logger')(_0xdb2e('0x1'));var moment=require(_0xdb2e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb2e('0x3'));var rimraf=require(_0xdb2e('0x4'));var config=require(_0xdb2e('0x5'));var attributes=require(_0xdb2e('0x6'));module[_0xdb2e('0x7')]=function(_0xb4834c,_0x256bfc){return _0xb4834c[_0xdb2e('0x8')](_0xdb2e('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0xdb2e('0xa'),'fields':[_0xdb2e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1c4=['../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x55527b,_0x293c9a){var _0xd2577b=function(_0x23c7f3){while(--_0x23c7f3){_0x55527b['push'](_0x55527b['shift']());}};_0xd2577b(++_0x293c9a);}(_0xf1c4,0x15b));var _0x4f1c=function(_0x5515c5,_0xf0b6dc){_0x5515c5=_0x5515c5-0x0;var _0x55d5ff=_0xf1c4[_0x5515c5];return _0x55d5ff;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f1c('0x0'))(_0x4f1c('0x1'));var moment=require(_0x4f1c('0x2'));var BPromise=require('bluebird');var rp=require(_0x4f1c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f1c('0x4'));var config=require(_0x4f1c('0x5'));var attributes=require(_0x4f1c('0x6'));module[_0x4f1c('0x7')]=function(_0x5582a1,_0x51582e){return _0x5582a1[_0x4f1c('0x8')](_0x4f1c('0x9'),attributes,{'tableName':_0x4f1c('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index b122ea0..f7da529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb83=['FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5dedf5,_0x20c96e){var _0x4a30f0=function(_0x4ec00b){while(--_0x4ec00b){_0x5dedf5['push'](_0x5dedf5['shift']());}};_0x4a30f0(++_0x20c96e);}(_0xfb83,0x191));var _0x3fb8=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xfb83[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0x3fb8('0x0'));var moment=require(_0x3fb8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fb8('0x2'));var db=require(_0x3fb8('0x3'))['db'];var utils=require(_0x3fb8('0x4'));var logger=require(_0x3fb8('0x5'))(_0x3fb8('0x6'));var config=require(_0x3fb8('0x7'));var jayson=require(_0x3fb8('0x8'));var client=jayson[_0x3fb8('0x9')][_0x3fb8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40f80c,_0x307858,_0x9986f5){return new BPromise(function(_0xf3eaab,_0x2369e3){return client[_0x3fb8('0xb')](_0x40f80c,_0x9986f5)[_0x3fb8('0xc')](function(_0x5cf329){logger['info'](_0x3fb8('0xd'),_0x307858,'request\x20sent');logger[_0x3fb8('0xe')](_0x3fb8('0xf'),_0x307858,_0x3fb8('0x10'),JSON['stringify'](_0x5cf329));if(_0x5cf329[_0x3fb8('0x11')]){if(_0x5cf329[_0x3fb8('0x11')][_0x3fb8('0x12')]===0x1f4){logger[_0x3fb8('0x11')](_0x3fb8('0xd'),_0x307858,_0x5cf329['error'][_0x3fb8('0x13')]);return _0x2369e3(_0x5cf329['error'][_0x3fb8('0x13')]);}logger[_0x3fb8('0x11')](_0x3fb8('0xd'),_0x307858,_0x5cf329[_0x3fb8('0x11')][_0x3fb8('0x13')]);return _0xf3eaab(_0x5cf329[_0x3fb8('0x11')][_0x3fb8('0x13')]);}else{logger[_0x3fb8('0x14')](_0x3fb8('0xd'),_0x307858,_0x3fb8('0x10'));_0xf3eaab(_0x5cf329[_0x3fb8('0x15')][_0x3fb8('0x13')]);}})[_0x3fb8('0x16')](function(_0x5bdcde){logger['error'](_0x3fb8('0xd'),_0x307858,_0x5bdcde);_0x2369e3(_0x5bdcde);});});}
\ No newline at end of file
+var _0x5d89=['../../config/environment','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4dd245,_0x24e516){var _0x1d86e2=function(_0x5f56f1){while(--_0x5f56f1){_0x4dd245['push'](_0x4dd245['shift']());}};_0x1d86e2(++_0x24e516);}(_0x5d89,0x9e));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x95d8('0x0'));var util=require(_0x95d8('0x1'));var moment=require(_0x95d8('0x2'));var BPromise=require(_0x95d8('0x3'));var rs=require(_0x95d8('0x4'));var fs=require('fs');var Redis=require(_0x95d8('0x5'));var db=require(_0x95d8('0x6'))['db'];var utils=require(_0x95d8('0x7'));var logger=require(_0x95d8('0x8'))(_0x95d8('0x9'));var config=require(_0x95d8('0xa'));var jayson=require(_0x95d8('0xb'));var client=jayson['client'][_0x95d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3eb32c,_0x51df70,_0xfe7c8f){return new BPromise(function(_0x22c3a1,_0x3503e0){return client[_0x95d8('0xd')](_0x3eb32c,_0xfe7c8f)['then'](function(_0x2c133d){logger[_0x95d8('0xe')](_0x95d8('0xf'),_0x51df70,_0x95d8('0x10'));logger['debug'](_0x95d8('0x11'),_0x51df70,_0x95d8('0x10'),JSON[_0x95d8('0x12')](_0x2c133d));if(_0x2c133d[_0x95d8('0x13')]){if(_0x2c133d['error'][_0x95d8('0x14')]===0x1f4){logger[_0x95d8('0x13')](_0x95d8('0xf'),_0x51df70,_0x2c133d[_0x95d8('0x13')][_0x95d8('0x15')]);return _0x3503e0(_0x2c133d[_0x95d8('0x13')][_0x95d8('0x15')]);}logger[_0x95d8('0x13')](_0x95d8('0xf'),_0x51df70,_0x2c133d[_0x95d8('0x13')]['message']);return _0x22c3a1(_0x2c133d[_0x95d8('0x13')][_0x95d8('0x15')]);}else{logger[_0x95d8('0xe')](_0x95d8('0xf'),_0x51df70,'request\x20sent');_0x22c3a1(_0x2c133d[_0x95d8('0x16')][_0x95d8('0x15')]);}})[_0x95d8('0x17')](function(_0x545fcf){logger[_0x95d8('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x51df70,_0x545fcf);_0x3503e0(_0x545fcf);});});}
\ No newline at end of file
index ea4ca36..feaf522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b52=['update','delete','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','post','create'];(function(_0x52e161,_0x99a43d){var _0x4a990f=function(_0x5f2678){while(--_0x5f2678){_0x52e161['push'](_0x52e161['shift']());}};_0x4a990f(++_0x99a43d);}(_0x7b52,0x1f2));var _0x27b5=function(_0xd4d4aa,_0x5db1f0){_0xd4d4aa=_0xd4d4aa-0x0;var _0x3f2237=_0x7b52[_0xd4d4aa];return _0x3f2237;};'use strict';var multer=require('multer');var util=require(_0x27b5('0x0'));var path=require(_0x27b5('0x1'));var timeout=require(_0x27b5('0x2'));var express=require(_0x27b5('0x3'));var router=express[_0x27b5('0x4')]();var fs_extra=require(_0x27b5('0x5'));var auth=require(_0x27b5('0x6'));var interaction=require(_0x27b5('0x7'));var config=require(_0x27b5('0x8'));var controller=require(_0x27b5('0x9'));router[_0x27b5('0xa')]('/',auth[_0x27b5('0xb')](),controller['index']);router[_0x27b5('0xa')]('/describe',auth[_0x27b5('0xb')](),controller[_0x27b5('0xc')]);router['get']('/:id',auth[_0x27b5('0xb')](),controller['show']);router[_0x27b5('0xd')]('/',auth[_0x27b5('0xb')](),controller[_0x27b5('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x27b5('0xf')]);router[_0x27b5('0x10')](_0x27b5('0x11'),auth[_0x27b5('0xb')](),controller[_0x27b5('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x736d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','multer','connect-timeout','express','Router'];(function(_0x4aee8c,_0x388558){var _0x504f51=function(_0x25681b){while(--_0x25681b){_0x4aee8c['push'](_0x4aee8c['shift']());}};_0x504f51(++_0x388558);}(_0x736d,0x95));var _0xd736=function(_0x12dffa,_0x1b054c){_0x12dffa=_0x12dffa-0x0;var _0x493dd2=_0x736d[_0x12dffa];return _0x493dd2;};'use strict';var multer=require(_0xd736('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd736('0x1'));var express=require(_0xd736('0x2'));var router=express[_0xd736('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd736('0x4'));var interaction=require(_0xd736('0x5'));var config=require(_0xd736('0x6'));var controller=require(_0xd736('0x7'));router[_0xd736('0x8')]('/',auth[_0xd736('0x9')](),controller['index']);router[_0xd736('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd736('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd736('0xa')]);router[_0xd736('0xb')]('/',auth[_0xd736('0x9')](),controller['create']);router[_0xd736('0xc')](_0xd736('0xd'),auth[_0xd736('0x9')](),controller[_0xd736('0xe')]);router[_0xd736('0xf')](_0xd736('0xd'),auth[_0xd736('0x9')](),controller[_0xd736('0x10')]);module['exports']=router;
\ No newline at end of file
index 6fd4105..fcde070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x971b=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x157571,_0x388342){var _0x1ce04c=function(_0x38b8b1){while(--_0x38b8b1){_0x157571['push'](_0x157571['shift']());}};_0x1ce04c(++_0x388342);}(_0x971b,0x81));var _0xb971=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0x971b[_0x38080e];return _0x4e4c87;};'use strict';var multer=require(_0xb971('0x0'));var util=require(_0xb971('0x1'));var path=require(_0xb971('0x2'));var timeout=require('connect-timeout');var express=require(_0xb971('0x3'));var router=express[_0xb971('0x4')]();var fs_extra=require(_0xb971('0x5'));var auth=require(_0xb971('0x6'));var interaction=require(_0xb971('0x7'));var config=require(_0xb971('0x8'));var controller=require(_0xb971('0x9'));router['get']('/',auth[_0xb971('0xa')](),controller[_0xb971('0xb')]);router[_0xb971('0xc')]('/:id',auth[_0xb971('0xa')](),controller[_0xb971('0xd')]);router['get'](_0xb971('0xe'),auth[_0xb971('0xa')](),controller[_0xb971('0xf')]);router[_0xb971('0xc')]('/:id/fields',auth[_0xb971('0xa')](),controller[_0xb971('0x10')]);router[_0xb971('0x11')]('/',auth['isAuthenticated'](),controller[_0xb971('0x12')]);router[_0xb971('0x11')]('/:id/configurations',auth[_0xb971('0xa')](),controller[_0xb971('0x13')]);router[_0xb971('0x14')](_0xb971('0x15'),auth['isAuthenticated'](),controller[_0xb971('0x16')]);router[_0xb971('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xb971('0x18')]);module[_0xb971('0x19')]=router;
\ No newline at end of file
+var _0x1ac4=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','/:id','update','delete'];(function(_0x58c519,_0x5a5e28){var _0x18342f=function(_0x4c5c9e){while(--_0x4c5c9e){_0x58c519['push'](_0x58c519['shift']());}};_0x18342f(++_0x5a5e28);}(_0x1ac4,0x17c));var _0x41ac=function(_0x11d56f,_0x5451fa){_0x11d56f=_0x11d56f-0x0;var _0x38c4ff=_0x1ac4[_0x11d56f];return _0x38c4ff;};'use strict';var multer=require(_0x41ac('0x0'));var util=require(_0x41ac('0x1'));var path=require(_0x41ac('0x2'));var timeout=require(_0x41ac('0x3'));var express=require(_0x41ac('0x4'));var router=express[_0x41ac('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x41ac('0x6'));var interaction=require(_0x41ac('0x7'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0x41ac('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x41ac('0x9')](),controller[_0x41ac('0xa')]);router[_0x41ac('0x8')](_0x41ac('0xb'),auth[_0x41ac('0x9')](),controller[_0x41ac('0xc')]);router[_0x41ac('0x8')]('/:id/fields',auth[_0x41ac('0x9')](),controller[_0x41ac('0xd')]);router[_0x41ac('0xe')]('/',auth[_0x41ac('0x9')](),controller[_0x41ac('0xf')]);router['post'](_0x41ac('0xb'),auth[_0x41ac('0x9')](),controller[_0x41ac('0x10')]);router['put'](_0x41ac('0x11'),auth[_0x41ac('0x9')](),controller[_0x41ac('0x12')]);router[_0x41ac('0x13')](_0x41ac('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index fe549b4..2ec6f53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc10=['integrationTab','newTab','sequelize','exports','STRING','ENUM'];(function(_0x461886,_0x4fc171){var _0x295e0a=function(_0x451524){while(--_0x451524){_0x461886['push'](_0x461886['shift']());}};_0x295e0a(++_0x4fc171);}(_0xfc10,0x158));var _0x0fc1=function(_0x4fb290,_0x2908ff){_0x4fb290=_0x4fb290-0x0;var _0x214675=_0xfc10[_0x4fb290];return _0x214675;};'use strict';var Sequelize=require(_0x0fc1('0x0'));module[_0x0fc1('0x1')]={'name':{'type':Sequelize[_0x0fc1('0x2')]},'description':{'type':Sequelize[_0x0fc1('0x2')]},'username':{'type':Sequelize[_0x0fc1('0x2')]},'remoteUri':{'type':Sequelize[_0x0fc1('0x2')]},'authType':{'type':Sequelize[_0x0fc1('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x0fc1('0x2')]},'consumerKey':{'type':Sequelize[_0x0fc1('0x2')]},'consumerSecret':{'type':Sequelize[_0x0fc1('0x2')]},'token':{'type':Sequelize[_0x0fc1('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0fc1('0x3')](_0x0fc1('0x4'),_0x0fc1('0x5')),'defaultValue':_0x0fc1('0x4')}};
\ No newline at end of file
+var _0x967e=['STRING','ENUM','basic','integrationTab','newTab','exports'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0x967e,0xd7));var _0xe967=function(_0x9cd515,_0x480f86){_0x9cd515=_0x9cd515-0x0;var _0x499606=_0x967e[_0x9cd515];return _0x499606;};'use strict';var Sequelize=require('sequelize');module[_0xe967('0x0')]={'name':{'type':Sequelize[_0xe967('0x1')]},'description':{'type':Sequelize[_0xe967('0x1')]},'username':{'type':Sequelize[_0xe967('0x1')]},'remoteUri':{'type':Sequelize[_0xe967('0x1')]},'authType':{'type':Sequelize[_0xe967('0x2')](_0xe967('0x3')),'defaultValue':_0xe967('0x3')},'password':{'type':Sequelize[_0xe967('0x1')]},'consumerKey':{'type':Sequelize[_0xe967('0x1')]},'consumerSecret':{'type':Sequelize[_0xe967('0x1')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe967('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe967('0x2')](_0xe967('0x4'),_0xe967('0x5')),'defaultValue':_0xe967('0x4')}};
\ No newline at end of file
index d114008..054df6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe499=['crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','status','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','DeskConfiguration','length','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','format','application/json','headers','Authorization','Basic\x20%s','%s:%s','password','toString','concat','_embedded','entries','active','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe499,0x1b0));var _0x9e49=function(_0xce8183,_0x567545){_0xce8183=_0xce8183-0x0;var _0x27c555=_0xe499[_0xce8183];return _0x27c555;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e49('0x0'));var zipdir=require(_0x9e49('0x1'));var jsonpatch=require(_0x9e49('0x2'));var rp=require(_0x9e49('0x3'));var moment=require(_0x9e49('0x4'));var BPromise=require(_0x9e49('0x5'));var Mustache=require('mustache');var util=require(_0x9e49('0x6'));var path=require(_0x9e49('0x7'));var sox=require('sox');var csv=require(_0x9e49('0x8'));var ejs=require(_0x9e49('0x9'));var fs=require('fs');var fs_extra=require(_0x9e49('0xa'));var _=require('lodash');var squel=require(_0x9e49('0xb'));var crypto=require(_0x9e49('0xc'));var jsforce=require(_0x9e49('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9e49('0x8'));var querystring=require('querystring');var Papa=require(_0x9e49('0xe'));var Redis=require(_0x9e49('0xf'));var authService=require(_0x9e49('0x10'));var qs=require(_0x9e49('0x11'));var as=require(_0x9e49('0x12'));var hardwareService=require(_0x9e49('0x13'));var logger=require(_0x9e49('0x14'))('api');var utils=require(_0x9e49('0x15'));var config=require(_0x9e49('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e49('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5727bd,_0x3a0e17){_0x3a0e17=_0x3a0e17||0xcc;return function(_0x2433f6){if(_0x2433f6){return _0x5727bd[_0x9e49('0x18')](_0x3a0e17);}return _0x5727bd['status'](_0x3a0e17)[_0x9e49('0x19')]();};}function respondWithResult(_0x3f9403,_0x3a4178){_0x3a4178=_0x3a4178||0xc8;return function(_0x39de94){if(_0x39de94){return _0x3f9403['status'](_0x3a4178)[_0x9e49('0x1a')](_0x39de94);}};}function respondWithFilteredResult(_0x5304ee,_0xd2a46f){return function(_0x93845d){if(_0x93845d){var _0x159f44=typeof _0xd2a46f[_0x9e49('0x1b')]===_0x9e49('0x1c')&&typeof _0xd2a46f['limit']===_0x9e49('0x1c');var _0x4888f4=_0x93845d[_0x9e49('0x1d')];var _0x2e8540=_0x159f44?0x0:_0xd2a46f['offset'];var _0x54ce54=_0x159f44?_0x93845d[_0x9e49('0x1d')]:_0xd2a46f['offset']+_0xd2a46f[_0x9e49('0x1e')];var _0x155e2b;if(_0x54ce54>=_0x4888f4){_0x54ce54=_0x4888f4;_0x155e2b=0xc8;}else{_0x155e2b=0xce;}_0x5304ee['status'](_0x155e2b);return _0x5304ee[_0x9e49('0x1f')](_0x9e49('0x20'),_0x2e8540+'-'+_0x54ce54+'/'+_0x4888f4)[_0x9e49('0x1a')](_0x93845d);}return null;};}function patchUpdates(_0x35373e){return function(_0x5845d3){try{jsonpatch[_0x9e49('0x21')](_0x5845d3,_0x35373e,!![]);}catch(_0x3cf9b3){return BPromise['reject'](_0x3cf9b3);}return _0x5845d3['save']();};}function saveUpdates(_0x3b2dd5,_0x4fc8fe){return function(_0x470c24){if(_0x470c24){return _0x470c24[_0x9e49('0x22')](_0x3b2dd5)[_0x9e49('0x23')](function(_0x5df2c3){return _0x5df2c3;});}return null;};}function removeEntity(_0x33b598,_0x3d2904){return function(_0x38db24){if(_0x38db24){return _0x38db24[_0x9e49('0x24')]()[_0x9e49('0x23')](function(){_0x33b598[_0x9e49('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217f90,_0x3e9253){return function(_0x1e476b){if(!_0x1e476b){_0x217f90[_0x9e49('0x18')](0x194);}return _0x1e476b;};}function handleError(_0x336ce8,_0x495e35){_0x495e35=_0x495e35||0x1f4;return function(_0x3808d1){logger['error'](_0x3808d1[_0x9e49('0x26')]);if(_0x3808d1[_0x9e49('0x27')]){delete _0x3808d1[_0x9e49('0x27')];}_0x336ce8['status'](_0x495e35)[_0x9e49('0x28')](_0x3808d1);};}exports[_0x9e49('0x29')]=function(_0x5b87bb,_0x31077a){var _0x3be6ba={},_0x44417e={},_0x50ad16={'count':0x0,'rows':[]};var _0x25229a=_[_0x9e49('0x2a')](db[_0x9e49('0x2b')][_0x9e49('0x2c')],function(_0x1e3d36){return{'name':_0x1e3d36[_0x9e49('0x2d')],'type':_0x1e3d36[_0x9e49('0x2e')][_0x9e49('0x2f')]};});_0x44417e[_0x9e49('0x30')]=_[_0x9e49('0x2a')](_0x25229a,'name');_0x44417e['query']=_[_0x9e49('0x31')](_0x5b87bb[_0x9e49('0x32')]);_0x44417e[_0x9e49('0x33')]=_['intersection'](_0x44417e[_0x9e49('0x30')],_0x44417e[_0x9e49('0x32')]);_0x3be6ba[_0x9e49('0x34')]=_[_0x9e49('0x35')](_0x44417e[_0x9e49('0x30')],qs['fields'](_0x5b87bb[_0x9e49('0x32')][_0x9e49('0x36')]));_0x3be6ba[_0x9e49('0x34')]=_0x3be6ba[_0x9e49('0x34')]['length']?_0x3be6ba['attributes']:_0x44417e[_0x9e49('0x30')];if(!_0x5b87bb[_0x9e49('0x32')][_0x9e49('0x37')](_0x9e49('0x38'))){_0x3be6ba[_0x9e49('0x1e')]=qs[_0x9e49('0x1e')](_0x5b87bb[_0x9e49('0x32')][_0x9e49('0x1e')]);_0x3be6ba['offset']=qs[_0x9e49('0x1b')](_0x5b87bb[_0x9e49('0x32')]['offset']);}_0x3be6ba['order']=qs[_0x9e49('0x39')](_0x5b87bb['query'][_0x9e49('0x39')]);_0x3be6ba['where']=qs[_0x9e49('0x33')](_[_0x9e49('0x3a')](_0x5b87bb[_0x9e49('0x32')],_0x44417e['filters']),_0x25229a);if(_0x5b87bb[_0x9e49('0x32')][_0x9e49('0x3b')]){_0x3be6ba['where']=_['merge'](_0x3be6ba[_0x9e49('0x3c')],{'$or':_[_0x9e49('0x2a')](_0x25229a,function(_0x51fccf){if(_0x51fccf[_0x9e49('0x2e')]!=='VIRTUAL'){var _0x407361={};_0x407361[_0x51fccf['name']]={'$like':'%'+_0x5b87bb[_0x9e49('0x32')][_0x9e49('0x3b')]+'%'};return _0x407361;}})});}_0x3be6ba=_[_0x9e49('0x3d')]({},_0x3be6ba,_0x5b87bb[_0x9e49('0x3e')]);var _0x1d104e={'where':_0x3be6ba[_0x9e49('0x3c')]};return db['DeskAccount']['count'](_0x1d104e)[_0x9e49('0x23')](function(_0x1e0d5d){_0x50ad16['count']=_0x1e0d5d;if(_0x5b87bb[_0x9e49('0x32')][_0x9e49('0x3f')]){_0x3be6ba[_0x9e49('0x40')]=[{'all':!![]}];}return db[_0x9e49('0x2b')]['findAll'](_0x3be6ba);})[_0x9e49('0x23')](function(_0x60d452){_0x50ad16[_0x9e49('0x41')]=_0x60d452;return _0x50ad16;})[_0x9e49('0x23')](respondWithFilteredResult(_0x31077a,_0x3be6ba))[_0x9e49('0x42')](handleError(_0x31077a,null));};exports[_0x9e49('0x43')]=function(_0xdc1301,_0xa19381){var _0xdeb399={'raw':![],'where':{'id':_0xdc1301[_0x9e49('0x44')]['id']}},_0x246818={};_0x246818[_0x9e49('0x30')]=_[_0x9e49('0x31')](db[_0x9e49('0x2b')][_0x9e49('0x2c')]);_0x246818[_0x9e49('0x32')]=_[_0x9e49('0x31')](_0xdc1301[_0x9e49('0x32')]);_0x246818['filters']=_[_0x9e49('0x35')](_0x246818[_0x9e49('0x30')],_0x246818[_0x9e49('0x32')]);_0xdeb399[_0x9e49('0x34')]=_[_0x9e49('0x35')](_0x246818[_0x9e49('0x30')],qs[_0x9e49('0x36')](_0xdc1301[_0x9e49('0x32')][_0x9e49('0x36')]));_0xdeb399[_0x9e49('0x34')]=_0xdeb399[_0x9e49('0x34')]['length']?_0xdeb399[_0x9e49('0x34')]:_0x246818['model'];if(_0xdc1301['query'][_0x9e49('0x3f')]){_0xdeb399[_0x9e49('0x40')]=[{'all':!![]}];}_0xdeb399=_['merge']({},_0xdeb399,_0xdc1301[_0x9e49('0x3e')]);return db[_0x9e49('0x2b')][_0x9e49('0x45')](_0xdeb399)[_0x9e49('0x23')](handleEntityNotFound(_0xa19381,null))[_0x9e49('0x23')](respondWithResult(_0xa19381,null))[_0x9e49('0x42')](handleError(_0xa19381,null));};exports[_0x9e49('0x46')]=function(_0x471f56,_0x3fe439){return db[_0x9e49('0x2b')][_0x9e49('0x46')](_0x471f56['body'],{})[_0x9e49('0x23')](respondWithResult(_0x3fe439,0xc9))[_0x9e49('0x42')](handleError(_0x3fe439,null));};exports[_0x9e49('0x22')]=function(_0x5c29cc,_0xc11123){if(_0x5c29cc[_0x9e49('0x47')]['id']){delete _0x5c29cc['body']['id'];}return db[_0x9e49('0x2b')][_0x9e49('0x45')]({'where':{'id':_0x5c29cc[_0x9e49('0x44')]['id']}})[_0x9e49('0x23')](handleEntityNotFound(_0xc11123,null))[_0x9e49('0x23')](saveUpdates(_0x5c29cc[_0x9e49('0x47')],null))[_0x9e49('0x23')](respondWithResult(_0xc11123,null))[_0x9e49('0x42')](handleError(_0xc11123,null));};exports[_0x9e49('0x24')]=function(_0x3767e5,_0x4b6491){return db[_0x9e49('0x2b')]['find']({'where':{'id':_0x3767e5[_0x9e49('0x44')]['id']}})[_0x9e49('0x23')](handleEntityNotFound(_0x4b6491,null))[_0x9e49('0x23')](removeEntity(_0x4b6491,null))['catch'](handleError(_0x4b6491,null));};exports[_0x9e49('0x48')]=function(_0x6f520c,_0x98370f,_0x5d61da){var _0x22a239={};var _0x3978bb={};var _0x1ac765;var _0x41bb6c;return db['DeskAccount'][_0x9e49('0x49')]({'where':{'id':_0x6f520c[_0x9e49('0x44')]['id']}})['then'](handleEntityNotFound(_0x98370f,null))[_0x9e49('0x23')](function(_0xeaa6ac){if(_0xeaa6ac){_0x1ac765=_0xeaa6ac;_0x3978bb[_0x9e49('0x30')]=_[_0x9e49('0x31')](db[_0x9e49('0x4a')][_0x9e49('0x2c')]);_0x3978bb[_0x9e49('0x32')]=_[_0x9e49('0x31')](_0x6f520c[_0x9e49('0x32')]);_0x3978bb['filters']=_['intersection'](_0x3978bb[_0x9e49('0x30')],_0x3978bb['query']);_0x22a239[_0x9e49('0x34')]=_['intersection'](_0x3978bb['model'],qs['fields'](_0x6f520c[_0x9e49('0x32')][_0x9e49('0x36')]));_0x22a239[_0x9e49('0x34')]=_0x22a239[_0x9e49('0x34')][_0x9e49('0x4b')]?_0x22a239[_0x9e49('0x34')]:_0x3978bb[_0x9e49('0x30')];_0x22a239[_0x9e49('0x4c')]=qs['sort'](_0x6f520c[_0x9e49('0x32')][_0x9e49('0x39')]);_0x22a239[_0x9e49('0x3c')]=qs[_0x9e49('0x33')](_[_0x9e49('0x3a')](_0x6f520c[_0x9e49('0x32')],_0x3978bb[_0x9e49('0x33')]));if(_0x6f520c[_0x9e49('0x32')]['filter']){_0x22a239[_0x9e49('0x3c')]=_[_0x9e49('0x3d')](_0x22a239['where'],{'$or':_[_0x9e49('0x2a')](_0x22a239[_0x9e49('0x34')],function(_0x4509e6){var _0x41db69={};_0x41db69[_0x4509e6]={'$like':'%'+_0x6f520c[_0x9e49('0x32')][_0x9e49('0x3b')]+'%'};return _0x41db69;})});}_0x22a239=_[_0x9e49('0x3d')]({},_0x22a239,_0x6f520c['options']);return _0x1ac765[_0x9e49('0x48')](_0x22a239);}})[_0x9e49('0x23')](function(_0x32571d){if(_0x32571d){_0x41bb6c=_0x32571d[_0x9e49('0x4b')];if(!_0x6f520c[_0x9e49('0x32')]['hasOwnProperty']('nolimit')){_0x22a239[_0x9e49('0x1e')]=qs[_0x9e49('0x1e')](_0x6f520c['query'][_0x9e49('0x1e')]);_0x22a239[_0x9e49('0x1b')]=qs[_0x9e49('0x1b')](_0x6f520c['query']['offset']);}return _0x1ac765[_0x9e49('0x48')](_0x22a239);}})['then'](function(_0x130421){if(_0x130421){return _0x130421?{'count':_0x41bb6c,'rows':_0x130421}:null;}})[_0x9e49('0x23')](respondWithResult(_0x98370f,null))[_0x9e49('0x42')](handleError(_0x98370f,null));};exports[_0x9e49('0x4d')]=function(_0x530f7b,_0x47aefd,_0x5566ea){if(_0x530f7b[_0x9e49('0x47')]['id']){delete _0x530f7b[_0x9e49('0x47')]['id'];}return db[_0x9e49('0x2b')]['findOne']({'where':{'id':_0x530f7b['params']['id']}})[_0x9e49('0x23')](handleEntityNotFound(_0x47aefd,null))[_0x9e49('0x23')](function(_0x4e05df){if(_0x4e05df){_0x530f7b[_0x9e49('0x47')]['AccountId']=_0x4e05df['id'];_0x530f7b[_0x9e49('0x47')][_0x9e49('0x4e')]=integrations[_0x9e49('0x4f')](_0x530f7b[_0x9e49('0x47')][_0x9e49('0x50')],_0x530f7b[_0x9e49('0x47')][_0x9e49('0x2e')]);_0x530f7b[_0x9e49('0x47')][_0x9e49('0x51')]=integrations[_0x9e49('0x52')](_0x530f7b['body'][_0x9e49('0x50')],_0x530f7b[_0x9e49('0x47')][_0x9e49('0x2e')]);return db['DeskConfiguration'][_0x9e49('0x46')](_0x530f7b[_0x9e49('0x47')],{'include':[{'model':db['DeskField'],'as':_0x9e49('0x4e')},{'model':db[_0x9e49('0x53')],'as':_0x9e49('0x51')}]});}return null;})[_0x9e49('0x23')](respondWithResult(_0x47aefd,null))[_0x9e49('0x42')](handleError(_0x47aefd,null));};exports[_0x9e49('0x54')]=function(_0x49537d,_0x1976ca,_0x2b6e88){var _0x4c8882=[{'name':_0x9e49('0x55'),'label':_0x9e49('0x55'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x51686b='';return db[_0x9e49('0x2b')]['findOne']({'where':{'id':_0x49537d[_0x9e49('0x44')]['id']},'attributes':['id',_0x9e49('0x56'),_0x9e49('0x57'),_0x9e49('0x58'),'password',_0x9e49('0x59'),_0x9e49('0x5a'),_0x9e49('0x5b'),_0x9e49('0x5c')]})[_0x9e49('0x23')](handleEntityNotFound(_0x1976ca,null))['then'](function(_0x5af380){if(_0x5af380){_0x51686b=_0x5af380['remoteUri'];var _0x3c7cd9=_0x51686b['slice'](-0x1);if(_0x3c7cd9==='/'){_0x51686b=_0x51686b[_0x9e49('0x5d')](0x0,_0x51686b[_0x9e49('0x5e')](_0x3c7cd9));}var _0x2b7430={'method':'GET','uri':util[_0x9e49('0x5f')]('%s/custom_fields',_0x51686b),'headers':{'Content-Type':_0x9e49('0x60'),'Accept':_0x9e49('0x60')},'json':!![]};if(_0x5af380[_0x9e49('0x57')]==='basic'){_0x2b7430[_0x9e49('0x61')][_0x9e49('0x62')]=util[_0x9e49('0x5f')](_0x9e49('0x63'),new Buffer(util[_0x9e49('0x5f')](_0x9e49('0x64'),_0x5af380[_0x9e49('0x58')],_0x5af380[_0x9e49('0x65')]))[_0x9e49('0x66')]('base64'));}return rp(_0x2b7430)[_0x9e49('0x23')](function(_0x271886){return _0x4c8882[_0x9e49('0x67')](_['map'](_0x271886[_0x9e49('0x68')][_0x9e49('0x69')],function(_0x1628e2){return{'id':_0x1628e2[_0x9e49('0x27')],'name':_0x1628e2['name'],'type':_0x1628e2['type'],'active':_0x1628e2[_0x9e49('0x6a')],'label':_0x1628e2['label'],'custom':!![]};}));});}})[_0x9e49('0x23')](function(_0x7106d3){return{'count':_0x7106d3[_0x9e49('0x4b')],'rows':_0x7106d3};})[_0x9e49('0x23')](respondWithResult(_0x1976ca,null))[_0x9e49('0x42')](function(_0x3df480){var _0x35f05f=_0x49537d[_0x9e49('0x32')][_0x9e49('0x6b')]?0x1f4:_0x3df480[_0x9e49('0x6c')]||0x1f4;logger[_0x9e49('0x6d')](_0x9e49('0x6e'),_0x9e49('0x54'),_0x35f05f,JSON['stringify'](_0x3df480));delete _0x3df480[_0x9e49('0x27')];if(_0x35f05f===0x191){_0x35f05f=0x190;}_0x1976ca[_0x9e49('0x25')](_0x35f05f)[_0x9e49('0x28')](_0x49537d[_0x9e49('0x32')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3df480[_0x9e49('0x6c')]}:_0x3df480);});};
\ No newline at end of file
+var _0x686d=['path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','options','includeAll','DeskAccount','findAll','rows','catch','show','params','include','create','body','find','getConfigurations','DeskConfiguration','sort','pick','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x237171,_0xe9722a){var _0x3407a1=function(_0x4e8f3d){while(--_0x4e8f3d){_0x237171['push'](_0x237171['shift']());}};_0x3407a1(++_0xe9722a);}(_0x686d,0x1bc));var _0xd686=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0x686d[_0x2bc3f4];return _0x14ac53;};'use strict';var emlformat=require(_0xd686('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd686('0x1'));var jsonpatch=require(_0xd686('0x2'));var rp=require(_0xd686('0x3'));var moment=require(_0xd686('0x4'));var BPromise=require(_0xd686('0x5'));var Mustache=require(_0xd686('0x6'));var util=require(_0xd686('0x7'));var path=require(_0xd686('0x8'));var sox=require(_0xd686('0x9'));var csv=require('to-csv');var ejs=require(_0xd686('0xa'));var fs=require('fs');var fs_extra=require(_0xd686('0xb'));var _=require(_0xd686('0xc'));var squel=require(_0xd686('0xd'));var crypto=require('crypto');var jsforce=require(_0xd686('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd686('0xf'));var querystring=require('querystring');var Papa=require(_0xd686('0x10'));var Redis=require(_0xd686('0x11'));var authService=require(_0xd686('0x12'));var qs=require(_0xd686('0x13'));var as=require(_0xd686('0x14'));var hardwareService=require(_0xd686('0x15'));var logger=require('../../config/logger')(_0xd686('0x16'));var utils=require(_0xd686('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd686('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2a64e6,_0x1c7549){_0x1c7549=_0x1c7549||0xcc;return function(_0x2cc24f){if(_0x2cc24f){return _0x2a64e6[_0xd686('0x19')](_0x1c7549);}return _0x2a64e6[_0xd686('0x1a')](_0x1c7549)[_0xd686('0x1b')]();};}function respondWithResult(_0x555da1,_0x822476){_0x822476=_0x822476||0xc8;return function(_0x5dd026){if(_0x5dd026){return _0x555da1['status'](_0x822476)[_0xd686('0x1c')](_0x5dd026);}};}function respondWithFilteredResult(_0x3d1446,_0x5a2c26){return function(_0x4b976e){if(_0x4b976e){var _0x11b0ba=typeof _0x5a2c26[_0xd686('0x1d')]===_0xd686('0x1e')&&typeof _0x5a2c26[_0xd686('0x1f')]==='undefined';var _0x3c4a74=_0x4b976e[_0xd686('0x20')];var _0x27540e=_0x11b0ba?0x0:_0x5a2c26[_0xd686('0x1d')];var _0x3edf78=_0x11b0ba?_0x4b976e[_0xd686('0x20')]:_0x5a2c26[_0xd686('0x1d')]+_0x5a2c26[_0xd686('0x1f')];var _0x3d914d;if(_0x3edf78>=_0x3c4a74){_0x3edf78=_0x3c4a74;_0x3d914d=0xc8;}else{_0x3d914d=0xce;}_0x3d1446['status'](_0x3d914d);return _0x3d1446[_0xd686('0x21')](_0xd686('0x22'),_0x27540e+'-'+_0x3edf78+'/'+_0x3c4a74)[_0xd686('0x1c')](_0x4b976e);}return null;};}function patchUpdates(_0x5cdf65){return function(_0x2f75ad){try{jsonpatch[_0xd686('0x23')](_0x2f75ad,_0x5cdf65,!![]);}catch(_0x8d27da){return BPromise['reject'](_0x8d27da);}return _0x2f75ad[_0xd686('0x24')]();};}function saveUpdates(_0x5f4b88,_0x1c47a2){return function(_0xa8bcd2){if(_0xa8bcd2){return _0xa8bcd2['update'](_0x5f4b88)['then'](function(_0xf3c389){return _0xf3c389;});}return null;};}function removeEntity(_0x2ef6e1,_0x3f8491){return function(_0x53526c){if(_0x53526c){return _0x53526c[_0xd686('0x25')]()[_0xd686('0x26')](function(){_0x2ef6e1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4200ec,_0x1a6bf7){return function(_0x443789){if(!_0x443789){_0x4200ec[_0xd686('0x19')](0x194);}return _0x443789;};}function handleError(_0x141516,_0x1dab66){_0x1dab66=_0x1dab66||0x1f4;return function(_0x2ccdc8){logger[_0xd686('0x27')](_0x2ccdc8['stack']);if(_0x2ccdc8[_0xd686('0x28')]){delete _0x2ccdc8[_0xd686('0x28')];}_0x141516[_0xd686('0x1a')](_0x1dab66)[_0xd686('0x29')](_0x2ccdc8);};}exports[_0xd686('0x2a')]=function(_0x2f8040,_0x2b47f0){var _0x5f5a7e={},_0xd4ffe8={},_0x233b1f={'count':0x0,'rows':[]};var _0x358e9c=_[_0xd686('0x2b')](db['DeskAccount'][_0xd686('0x2c')],function(_0x379127){return{'name':_0x379127[_0xd686('0x2d')],'type':_0x379127[_0xd686('0x2e')]['key']};});_0xd4ffe8[_0xd686('0x2f')]=_[_0xd686('0x2b')](_0x358e9c,_0xd686('0x28'));_0xd4ffe8[_0xd686('0x30')]=_[_0xd686('0x31')](_0x2f8040[_0xd686('0x30')]);_0xd4ffe8[_0xd686('0x32')]=_['intersection'](_0xd4ffe8[_0xd686('0x2f')],_0xd4ffe8['query']);_0x5f5a7e['attributes']=_[_0xd686('0x33')](_0xd4ffe8['model'],qs[_0xd686('0x34')](_0x2f8040[_0xd686('0x30')][_0xd686('0x34')]));_0x5f5a7e[_0xd686('0x35')]=_0x5f5a7e['attributes'][_0xd686('0x36')]?_0x5f5a7e[_0xd686('0x35')]:_0xd4ffe8[_0xd686('0x2f')];if(!_0x2f8040[_0xd686('0x30')][_0xd686('0x37')]('nolimit')){_0x5f5a7e['limit']=qs['limit'](_0x2f8040[_0xd686('0x30')][_0xd686('0x1f')]);_0x5f5a7e[_0xd686('0x1d')]=qs[_0xd686('0x1d')](_0x2f8040[_0xd686('0x30')]['offset']);}_0x5f5a7e[_0xd686('0x38')]=qs['sort'](_0x2f8040[_0xd686('0x30')]['sort']);_0x5f5a7e[_0xd686('0x39')]=qs[_0xd686('0x32')](_['pick'](_0x2f8040[_0xd686('0x30')],_0xd4ffe8['filters']),_0x358e9c);if(_0x2f8040[_0xd686('0x30')][_0xd686('0x3a')]){_0x5f5a7e['where']=_[_0xd686('0x3b')](_0x5f5a7e[_0xd686('0x39')],{'$or':_['map'](_0x358e9c,function(_0x5699f8){if(_0x5699f8['type']!=='VIRTUAL'){var _0x2213fe={};_0x2213fe[_0x5699f8[_0xd686('0x28')]]={'$like':'%'+_0x2f8040[_0xd686('0x30')][_0xd686('0x3a')]+'%'};return _0x2213fe;}})});}_0x5f5a7e=_['merge']({},_0x5f5a7e,_0x2f8040[_0xd686('0x3c')]);var _0xc5e0da={'where':_0x5f5a7e['where']};return db['DeskAccount'][_0xd686('0x20')](_0xc5e0da)['then'](function(_0xb86a89){_0x233b1f[_0xd686('0x20')]=_0xb86a89;if(_0x2f8040[_0xd686('0x30')][_0xd686('0x3d')]){_0x5f5a7e['include']=[{'all':!![]}];}return db[_0xd686('0x3e')][_0xd686('0x3f')](_0x5f5a7e);})['then'](function(_0x8794b6){_0x233b1f[_0xd686('0x40')]=_0x8794b6;return _0x233b1f;})[_0xd686('0x26')](respondWithFilteredResult(_0x2b47f0,_0x5f5a7e))[_0xd686('0x41')](handleError(_0x2b47f0,null));};exports[_0xd686('0x42')]=function(_0x822ca0,_0x4ef99c){var _0x50becf={'raw':![],'where':{'id':_0x822ca0[_0xd686('0x43')]['id']}},_0x194612={};_0x194612[_0xd686('0x2f')]=_[_0xd686('0x31')](db[_0xd686('0x3e')]['rawAttributes']);_0x194612[_0xd686('0x30')]=_[_0xd686('0x31')](_0x822ca0[_0xd686('0x30')]);_0x194612[_0xd686('0x32')]=_[_0xd686('0x33')](_0x194612[_0xd686('0x2f')],_0x194612[_0xd686('0x30')]);_0x50becf[_0xd686('0x35')]=_[_0xd686('0x33')](_0x194612[_0xd686('0x2f')],qs[_0xd686('0x34')](_0x822ca0[_0xd686('0x30')][_0xd686('0x34')]));_0x50becf[_0xd686('0x35')]=_0x50becf[_0xd686('0x35')][_0xd686('0x36')]?_0x50becf[_0xd686('0x35')]:_0x194612[_0xd686('0x2f')];if(_0x822ca0[_0xd686('0x30')][_0xd686('0x3d')]){_0x50becf[_0xd686('0x44')]=[{'all':!![]}];}_0x50becf=_[_0xd686('0x3b')]({},_0x50becf,_0x822ca0['options']);return db[_0xd686('0x3e')]['find'](_0x50becf)[_0xd686('0x26')](handleEntityNotFound(_0x4ef99c,null))[_0xd686('0x26')](respondWithResult(_0x4ef99c,null))['catch'](handleError(_0x4ef99c,null));};exports[_0xd686('0x45')]=function(_0x45f931,_0x153166){return db['DeskAccount'][_0xd686('0x45')](_0x45f931[_0xd686('0x46')],{})[_0xd686('0x26')](respondWithResult(_0x153166,0xc9))[_0xd686('0x41')](handleError(_0x153166,null));};exports['update']=function(_0x51ab80,_0x4a0a4f){if(_0x51ab80[_0xd686('0x46')]['id']){delete _0x51ab80[_0xd686('0x46')]['id'];}return db['DeskAccount'][_0xd686('0x47')]({'where':{'id':_0x51ab80[_0xd686('0x43')]['id']}})[_0xd686('0x26')](handleEntityNotFound(_0x4a0a4f,null))['then'](saveUpdates(_0x51ab80[_0xd686('0x46')],null))[_0xd686('0x26')](respondWithResult(_0x4a0a4f,null))[_0xd686('0x41')](handleError(_0x4a0a4f,null));};exports[_0xd686('0x25')]=function(_0x146bfd,_0x5b36cd){return db[_0xd686('0x3e')]['find']({'where':{'id':_0x146bfd[_0xd686('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b36cd,null))['then'](removeEntity(_0x5b36cd,null))[_0xd686('0x41')](handleError(_0x5b36cd,null));};exports[_0xd686('0x48')]=function(_0x599c4f,_0xc3b045,_0x396dd4){var _0x45a721={};var _0x1a6600={};var _0x5011d3;var _0x5029d8;return db['DeskAccount']['findOne']({'where':{'id':_0x599c4f[_0xd686('0x43')]['id']}})['then'](handleEntityNotFound(_0xc3b045,null))['then'](function(_0x113238){if(_0x113238){_0x5011d3=_0x113238;_0x1a6600[_0xd686('0x2f')]=_[_0xd686('0x31')](db[_0xd686('0x49')][_0xd686('0x2c')]);_0x1a6600[_0xd686('0x30')]=_[_0xd686('0x31')](_0x599c4f['query']);_0x1a6600[_0xd686('0x32')]=_['intersection'](_0x1a6600['model'],_0x1a6600[_0xd686('0x30')]);_0x45a721[_0xd686('0x35')]=_[_0xd686('0x33')](_0x1a6600['model'],qs[_0xd686('0x34')](_0x599c4f['query']['fields']));_0x45a721[_0xd686('0x35')]=_0x45a721[_0xd686('0x35')]['length']?_0x45a721['attributes']:_0x1a6600['model'];_0x45a721[_0xd686('0x38')]=qs[_0xd686('0x4a')](_0x599c4f[_0xd686('0x30')]['sort']);_0x45a721[_0xd686('0x39')]=qs[_0xd686('0x32')](_[_0xd686('0x4b')](_0x599c4f['query'],_0x1a6600['filters']));if(_0x599c4f[_0xd686('0x30')][_0xd686('0x3a')]){_0x45a721[_0xd686('0x39')]=_['merge'](_0x45a721[_0xd686('0x39')],{'$or':_[_0xd686('0x2b')](_0x45a721['attributes'],function(_0x47171a){var _0xa5893b={};_0xa5893b[_0x47171a]={'$like':'%'+_0x599c4f[_0xd686('0x30')][_0xd686('0x3a')]+'%'};return _0xa5893b;})});}_0x45a721=_['merge']({},_0x45a721,_0x599c4f[_0xd686('0x3c')]);return _0x5011d3[_0xd686('0x48')](_0x45a721);}})[_0xd686('0x26')](function(_0x13587b){if(_0x13587b){_0x5029d8=_0x13587b[_0xd686('0x36')];if(!_0x599c4f[_0xd686('0x30')][_0xd686('0x37')](_0xd686('0x4c'))){_0x45a721[_0xd686('0x1f')]=qs[_0xd686('0x1f')](_0x599c4f[_0xd686('0x30')]['limit']);_0x45a721[_0xd686('0x1d')]=qs[_0xd686('0x1d')](_0x599c4f['query']['offset']);}return _0x5011d3[_0xd686('0x48')](_0x45a721);}})[_0xd686('0x26')](function(_0x2e9ebe){if(_0x2e9ebe){return _0x2e9ebe?{'count':_0x5029d8,'rows':_0x2e9ebe}:null;}})[_0xd686('0x26')](respondWithResult(_0xc3b045,null))[_0xd686('0x41')](handleError(_0xc3b045,null));};exports['addConfiguration']=function(_0x1a2ca1,_0x3c8d39,_0x243a06){if(_0x1a2ca1[_0xd686('0x46')]['id']){delete _0x1a2ca1['body']['id'];}return db[_0xd686('0x3e')][_0xd686('0x4d')]({'where':{'id':_0x1a2ca1[_0xd686('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c8d39,null))[_0xd686('0x26')](function(_0x38538f){if(_0x38538f){_0x1a2ca1[_0xd686('0x46')][_0xd686('0x4e')]=_0x38538f['id'];_0x1a2ca1['body'][_0xd686('0x4f')]=integrations[_0xd686('0x50')](_0x1a2ca1[_0xd686('0x46')][_0xd686('0x51')],_0x1a2ca1['body'][_0xd686('0x2e')]);_0x1a2ca1[_0xd686('0x46')][_0xd686('0x52')]=integrations['getDescriptions'](_0x1a2ca1['body'][_0xd686('0x51')],_0x1a2ca1[_0xd686('0x46')][_0xd686('0x2e')]);return db[_0xd686('0x49')][_0xd686('0x45')](_0x1a2ca1['body'],{'include':[{'model':db[_0xd686('0x53')],'as':_0xd686('0x4f')},{'model':db[_0xd686('0x53')],'as':_0xd686('0x52')}]});}return null;})['then'](respondWithResult(_0x3c8d39,null))[_0xd686('0x41')](handleError(_0x3c8d39,null));};exports['getFields']=function(_0x4a357f,_0xd37b1c,_0x173fb2){var _0x57d149=[{'name':'priority','label':_0xd686('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x41e94f='';return db[_0xd686('0x3e')][_0xd686('0x4d')]({'where':{'id':_0x4a357f[_0xd686('0x43')]['id']},'attributes':['id',_0xd686('0x55'),_0xd686('0x56'),_0xd686('0x57'),_0xd686('0x58'),_0xd686('0x59'),_0xd686('0x5a'),_0xd686('0x5b'),_0xd686('0x5c')]})['then'](handleEntityNotFound(_0xd37b1c,null))[_0xd686('0x26')](function(_0x12e3f0){if(_0x12e3f0){_0x41e94f=_0x12e3f0['remoteUri'];var _0x5103a2=_0x41e94f[_0xd686('0x5d')](-0x1);if(_0x5103a2==='/'){_0x41e94f=_0x41e94f['substring'](0x0,_0x41e94f[_0xd686('0x5e')](_0x5103a2));}var _0x16782e={'method':_0xd686('0x5f'),'uri':util[_0xd686('0x60')]('%s/custom_fields',_0x41e94f),'headers':{'Content-Type':_0xd686('0x61'),'Accept':_0xd686('0x61')},'json':!![]};if(_0x12e3f0[_0xd686('0x56')]===_0xd686('0x62')){_0x16782e['headers'][_0xd686('0x63')]=util['format'](_0xd686('0x64'),new Buffer(util[_0xd686('0x60')](_0xd686('0x65'),_0x12e3f0['username'],_0x12e3f0[_0xd686('0x58')]))[_0xd686('0x66')](_0xd686('0x67')));}return rp(_0x16782e)[_0xd686('0x26')](function(_0x2e72ae){return _0x57d149[_0xd686('0x68')](_[_0xd686('0x2b')](_0x2e72ae[_0xd686('0x69')][_0xd686('0x6a')],function(_0x3b9ee1){return{'id':_0x3b9ee1[_0xd686('0x28')],'name':_0x3b9ee1['name'],'type':_0x3b9ee1[_0xd686('0x2e')],'active':_0x3b9ee1[_0xd686('0x6b')],'label':_0x3b9ee1[_0xd686('0x6c')],'custom':!![]};}));});}})[_0xd686('0x26')](function(_0x4d9340){return{'count':_0x4d9340[_0xd686('0x36')],'rows':_0x4d9340};})['then'](respondWithResult(_0xd37b1c,null))['catch'](function(_0x34df24){var _0x553e7d=_0x4a357f['query'][_0xd686('0x6d')]?0x1f4:_0x34df24[_0xd686('0x6e')]||0x1f4;logger[_0xd686('0x27')](_0xd686('0x6f'),'getFields',_0x553e7d,JSON[_0xd686('0x70')](_0x34df24));delete _0x34df24[_0xd686('0x28')];if(_0x553e7d===0x191){_0x553e7d=0x190;}_0xd37b1c['status'](_0x553e7d)['send'](_0x4a357f[_0xd686('0x30')][_0xd686('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x34df24[_0xd686('0x6e')]}:_0x34df24);});};
\ No newline at end of file
index 2360a1f..cff2bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84d9=['int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount'];(function(_0x34e148,_0x3b91c1){var _0x15ed0c=function(_0x289596){while(--_0x289596){_0x34e148['push'](_0x34e148['shift']());}};_0x15ed0c(++_0x3b91c1);}(_0x84d9,0x12d));var _0x984d=function(_0x20366e,_0x4e9109){_0x20366e=_0x20366e-0x0;var _0x582c3a=_0x84d9[_0x20366e];return _0x582c3a;};'use strict';var _=require(_0x984d('0x0'));var util=require(_0x984d('0x1'));var logger=require(_0x984d('0x2'))(_0x984d('0x3'));var moment=require(_0x984d('0x4'));var BPromise=require(_0x984d('0x5'));var rp=require(_0x984d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x984d('0x7'));var config=require(_0x984d('0x8'));var attributes=require(_0x984d('0x9'));var integrations=require(_0x984d('0xa'));module[_0x984d('0xb')]=function(_0x46e1f8,_0xbf41cc){return _0x46e1f8[_0x984d('0xc')](_0x984d('0xd'),attributes,{'tableName':_0x984d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe0a7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','define','int_desk_accounts','lodash'];(function(_0x605439,_0x2bf4ca){var _0x4375ca=function(_0x5bbffd){while(--_0x5bbffd){_0x605439['push'](_0x605439['shift']());}};_0x4375ca(++_0x2bf4ca);}(_0xe0a7,0x12a));var _0x7e0a=function(_0x4173ef,_0x4e40f0){_0x4173ef=_0x4173ef-0x0;var _0x34d752=_0xe0a7[_0x4173ef];return _0x34d752;};'use strict';var _=require(_0x7e0a('0x0'));var util=require(_0x7e0a('0x1'));var logger=require(_0x7e0a('0x2'))(_0x7e0a('0x3'));var moment=require(_0x7e0a('0x4'));var BPromise=require(_0x7e0a('0x5'));var rp=require(_0x7e0a('0x6'));var fs=require('fs');var path=require(_0x7e0a('0x7'));var rimraf=require(_0x7e0a('0x8'));var config=require(_0x7e0a('0x9'));var attributes=require(_0x7e0a('0xa'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x321afd,_0x5e4947){return _0x321afd[_0x7e0a('0xb')]('DeskAccount',attributes,{'tableName':_0x7e0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2bcfd72..7d260f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x735d=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','stringify'];(function(_0x2d9043,_0x4d3914){var _0x30dbbe=function(_0x5433b6){while(--_0x5433b6){_0x2d9043['push'](_0x2d9043['shift']());}};_0x30dbbe(++_0x4d3914);}(_0x735d,0x15e));var _0xd735=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x735d[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0xd735('0x0'));var util=require(_0xd735('0x1'));var moment=require(_0xd735('0x2'));var BPromise=require('bluebird');var rs=require(_0xd735('0x3'));var fs=require('fs');var Redis=require(_0xd735('0x4'));var db=require(_0xd735('0x5'))['db'];var utils=require(_0xd735('0x6'));var logger=require(_0xd735('0x7'))(_0xd735('0x8'));var config=require(_0xd735('0x9'));var jayson=require(_0xd735('0xa'));var client=jayson[_0xd735('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353d7f,_0x251420,_0x8e964b){return new BPromise(function(_0x5e250c,_0x232d07){return client['request'](_0x353d7f,_0x8e964b)[_0xd735('0xc')](function(_0x56fa88){logger['info'](_0xd735('0xd'),_0x251420,_0xd735('0xe'));logger[_0xd735('0xf')](_0xd735('0x10'),_0x251420,'request\x20sent',JSON['stringify'](_0x56fa88));if(_0x56fa88[_0xd735('0x11')]){if(_0x56fa88[_0xd735('0x11')][_0xd735('0x12')]===0x1f4){logger[_0xd735('0x11')]('DeskAccount,\x20%s,\x20%s',_0x251420,_0x56fa88['error'][_0xd735('0x13')]);return _0x232d07(_0x56fa88[_0xd735('0x11')][_0xd735('0x13')]);}logger[_0xd735('0x11')](_0xd735('0xd'),_0x251420,_0x56fa88[_0xd735('0x11')][_0xd735('0x13')]);return _0x5e250c(_0x56fa88['error'][_0xd735('0x13')]);}else{logger[_0xd735('0x14')]('DeskAccount,\x20%s,\x20%s',_0x251420,_0xd735('0xe'));_0x5e250c(_0x56fa88['result'][_0xd735('0x13')]);}})[_0xd735('0x15')](function(_0x1c816c){logger[_0xd735('0x11')]('DeskAccount,\x20%s,\x20%s',_0x251420,_0x1c816c);_0x232d07(_0x1c816c);});});}exports['GetDeskAccount']=function(_0x63424f){var _0x2dcd9c=this;return new Promise(function(_0x3effef,_0x13a46d){return db['DeskAccount'][_0xd735('0x16')]({'raw':_0x63424f[_0xd735('0x17')]?_0x63424f[_0xd735('0x17')][_0xd735('0x18')]===undefined?!![]:![]:!![],'where':_0x63424f[_0xd735('0x17')]?_0x63424f['options'][_0xd735('0x19')]||null:null,'attributes':_0x63424f[_0xd735('0x17')]?_0x63424f[_0xd735('0x17')][_0xd735('0x1a')]||null:null,'limit':_0x63424f[_0xd735('0x17')]?_0x63424f[_0xd735('0x17')][_0xd735('0x1b')]||null:null,'include':_0x63424f[_0xd735('0x17')]?_0x63424f[_0xd735('0x17')][_0xd735('0x1c')]?_[_0xd735('0x1d')](_0x63424f[_0xd735('0x17')][_0xd735('0x1c')],function(_0x2a005d){return{'model':db[_0x2a005d['model']],'as':_0x2a005d['as'],'attributes':_0x2a005d[_0xd735('0x1a')],'include':_0x2a005d['include']?_[_0xd735('0x1d')](_0x2a005d[_0xd735('0x1c')],function(_0x2e01d4){return{'model':db[_0x2e01d4[_0xd735('0x1e')]],'as':_0x2e01d4['as'],'attributes':_0x2e01d4[_0xd735('0x1a')],'include':_0x2e01d4[_0xd735('0x1c')]?_[_0xd735('0x1d')](_0x2e01d4[_0xd735('0x1c')],function(_0x13b9de){return{'model':db[_0x13b9de['model']],'as':_0x13b9de['as'],'attributes':_0x13b9de[_0xd735('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd735('0xc')](function(_0x4f748a){logger[_0xd735('0x14')]('GetDeskAccount',_0x63424f);logger[_0xd735('0xf')](_0xd735('0x1f'),_0x63424f,JSON['stringify'](_0x4f748a));_0x3effef(_0x4f748a);})[_0xd735('0x15')](function(_0x2a4c1d){logger[_0xd735('0x11')](_0xd735('0x1f'),_0x2a4c1d[_0xd735('0x13')],_0x63424f);_0x13a46d(_0x2dcd9c['error'](0x1f4,_0x2a4c1d[_0xd735('0x13')]));});});};exports[_0xd735('0x20')]=function(_0x3d9dc3){var _0x2dadeb=this;return new Promise(function(_0x32a206,_0x57cd98){return db['DeskAccount'][_0xd735('0x21')]({'raw':_0x3d9dc3['options']?_0x3d9dc3[_0xd735('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3d9dc3[_0xd735('0x17')]?_0x3d9dc3[_0xd735('0x17')][_0xd735('0x19')]||null:null,'attributes':_0x3d9dc3[_0xd735('0x17')]?_0x3d9dc3[_0xd735('0x17')]['attributes']||null:null,'include':_0x3d9dc3['options']?_0x3d9dc3[_0xd735('0x17')]['include']?_[_0xd735('0x1d')](_0x3d9dc3[_0xd735('0x17')][_0xd735('0x1c')],function(_0x20ed3b){return{'model':db[_0x20ed3b[_0xd735('0x1e')]],'as':_0x20ed3b['as'],'attributes':_0x20ed3b[_0xd735('0x1a')],'include':_0x20ed3b[_0xd735('0x1c')]?_[_0xd735('0x1d')](_0x20ed3b[_0xd735('0x1c')],function(_0xbf581b){return{'model':db[_0xbf581b['model']],'as':_0xbf581b['as'],'attributes':_0xbf581b[_0xd735('0x1a')],'include':_0xbf581b[_0xd735('0x1c')]?_[_0xd735('0x1d')](_0xbf581b[_0xd735('0x1c')],function(_0x1030b1){return{'model':db[_0x1030b1['model']],'as':_0x1030b1['as'],'attributes':_0x1030b1[_0xd735('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e1762){logger[_0xd735('0x14')](_0xd735('0x20'),_0x3d9dc3);logger[_0xd735('0xf')](_0xd735('0x20'),_0x3d9dc3,JSON[_0xd735('0x22')](_0x2e1762));_0x32a206(_0x2e1762);})[_0xd735('0x15')](function(_0x3f7cac){logger[_0xd735('0x11')]('ShowDeskAccount',_0x3f7cac[_0xd735('0x13')],_0x3d9dc3);_0x57cd98(_0x2dadeb['error'](0x1f4,_0x3f7cac[_0xd735('0x13')]));});});};
\ No newline at end of file
+var _0x5715=['http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','DeskAccount,\x20%s,\x20%s','message','result','findAll','options','raw','where','limit','include','attributes','map','model','GetDeskAccount','ShowDeskAccount','DeskAccount','find','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x59b777,_0x5e104b){var _0x58d54f=function(_0x44b797){while(--_0x44b797){_0x59b777['push'](_0x59b777['shift']());}};_0x58d54f(++_0x5e104b);}(_0x5715,0x14d));var _0x5571=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0x5715[_0x4843f9];return _0x193c6a;};'use strict';var _=require('lodash');var util=require(_0x5571('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5571('0x1'));var db=require(_0x5571('0x2'))['db'];var utils=require(_0x5571('0x3'));var logger=require(_0x5571('0x4'))('rpc');var config=require(_0x5571('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x5571('0x6')][_0x5571('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x406e86,_0x2f82bb,_0x229d78){return new BPromise(function(_0x5ed271,_0x4813b0){return client[_0x5571('0x8')](_0x406e86,_0x229d78)[_0x5571('0x9')](function(_0x407264){logger[_0x5571('0xa')]('DeskAccount,\x20%s,\x20%s',_0x2f82bb,_0x5571('0xb'));logger[_0x5571('0xc')](_0x5571('0xd'),_0x2f82bb,'request\x20sent',JSON[_0x5571('0xe')](_0x407264));if(_0x407264['error']){if(_0x407264['error'][_0x5571('0xf')]===0x1f4){logger[_0x5571('0x10')](_0x5571('0x11'),_0x2f82bb,_0x407264[_0x5571('0x10')]['message']);return _0x4813b0(_0x407264[_0x5571('0x10')][_0x5571('0x12')]);}logger[_0x5571('0x10')](_0x5571('0x11'),_0x2f82bb,_0x407264[_0x5571('0x10')]['message']);return _0x5ed271(_0x407264[_0x5571('0x10')][_0x5571('0x12')]);}else{logger[_0x5571('0xa')](_0x5571('0x11'),_0x2f82bb,_0x5571('0xb'));_0x5ed271(_0x407264[_0x5571('0x13')]['message']);}})['catch'](function(_0x29261a){logger[_0x5571('0x10')]('DeskAccount,\x20%s,\x20%s',_0x2f82bb,_0x29261a);_0x4813b0(_0x29261a);});});}exports['GetDeskAccount']=function(_0x30054b){var _0x27dcd8=this;return new Promise(function(_0x55f7e7,_0x5cfef7){return db['DeskAccount'][_0x5571('0x14')]({'raw':_0x30054b[_0x5571('0x15')]?_0x30054b[_0x5571('0x15')][_0x5571('0x16')]===undefined?!![]:![]:!![],'where':_0x30054b[_0x5571('0x15')]?_0x30054b[_0x5571('0x15')][_0x5571('0x17')]||null:null,'attributes':_0x30054b['options']?_0x30054b['options']['attributes']||null:null,'limit':_0x30054b['options']?_0x30054b[_0x5571('0x15')][_0x5571('0x18')]||null:null,'include':_0x30054b['options']?_0x30054b[_0x5571('0x15')][_0x5571('0x19')]?_['map'](_0x30054b[_0x5571('0x15')][_0x5571('0x19')],function(_0x3401ac){return{'model':db[_0x3401ac['model']],'as':_0x3401ac['as'],'attributes':_0x3401ac[_0x5571('0x1a')],'include':_0x3401ac['include']?_[_0x5571('0x1b')](_0x3401ac[_0x5571('0x19')],function(_0xf2ae56){return{'model':db[_0xf2ae56[_0x5571('0x1c')]],'as':_0xf2ae56['as'],'attributes':_0xf2ae56[_0x5571('0x1a')],'include':_0xf2ae56[_0x5571('0x19')]?_[_0x5571('0x1b')](_0xf2ae56[_0x5571('0x19')],function(_0x116f25){return{'model':db[_0x116f25[_0x5571('0x1c')]],'as':_0x116f25['as'],'attributes':_0x116f25['attributes']};}):[]};}):[]};}):[]:[]})[_0x5571('0x9')](function(_0x4927d9){logger['info']('GetDeskAccount',_0x30054b);logger[_0x5571('0xc')](_0x5571('0x1d'),_0x30054b,JSON[_0x5571('0xe')](_0x4927d9));_0x55f7e7(_0x4927d9);})['catch'](function(_0x1059ca){logger['error'](_0x5571('0x1d'),_0x1059ca[_0x5571('0x12')],_0x30054b);_0x5cfef7(_0x27dcd8[_0x5571('0x10')](0x1f4,_0x1059ca[_0x5571('0x12')]));});});};exports[_0x5571('0x1e')]=function(_0x5807f1){var _0x459584=this;return new Promise(function(_0x2fa612,_0x4c2de4){return db[_0x5571('0x1f')][_0x5571('0x20')]({'raw':_0x5807f1['options']?_0x5807f1[_0x5571('0x15')][_0x5571('0x16')]===undefined?!![]:![]:!![],'where':_0x5807f1[_0x5571('0x15')]?_0x5807f1[_0x5571('0x15')][_0x5571('0x17')]||null:null,'attributes':_0x5807f1['options']?_0x5807f1['options']['attributes']||null:null,'include':_0x5807f1[_0x5571('0x15')]?_0x5807f1[_0x5571('0x15')][_0x5571('0x19')]?_['map'](_0x5807f1['options']['include'],function(_0x3900e){return{'model':db[_0x3900e[_0x5571('0x1c')]],'as':_0x3900e['as'],'attributes':_0x3900e[_0x5571('0x1a')],'include':_0x3900e[_0x5571('0x19')]?_[_0x5571('0x1b')](_0x3900e[_0x5571('0x19')],function(_0x2f4608){return{'model':db[_0x2f4608[_0x5571('0x1c')]],'as':_0x2f4608['as'],'attributes':_0x2f4608['attributes'],'include':_0x2f4608[_0x5571('0x19')]?_[_0x5571('0x1b')](_0x2f4608['include'],function(_0x47a69c){return{'model':db[_0x47a69c['model']],'as':_0x47a69c['as'],'attributes':_0x47a69c[_0x5571('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5571('0x9')](function(_0x148a9d){logger[_0x5571('0xa')](_0x5571('0x1e'),_0x5807f1);logger['debug'](_0x5571('0x1e'),_0x5807f1,JSON['stringify'](_0x148a9d));_0x2fa612(_0x148a9d);})[_0x5571('0x21')](function(_0x22cb4f){logger['error']('ShowDeskAccount',_0x22cb4f[_0x5571('0x12')],_0x5807f1);_0x4c2de4(_0x459584[_0x5571('0x10')](0x1f4,_0x22cb4f[_0x5571('0x12')]));});});};
\ No newline at end of file
index 67b867f..3ed04c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x31953c,_0x3a8ab2){var _0x1b5b88=function(_0x517771){while(--_0x517771){_0x31953c['push'](_0x31953c['shift']());}};_0x1b5b88(++_0x3a8ab2);}(_0xedd9,0xfc));var _0x9edd=function(_0x372059,_0x2715e1){_0x372059=_0x372059-0x0;var _0x4a0a9d=_0xedd9[_0x372059];return _0x4a0a9d;};'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
+var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x55e83f,_0x3a8b52){var _0x4df82c=function(_0x185f64){while(--_0x185f64){_0x55e83f['push'](_0x55e83f['shift']());}};_0x4df82c(++_0x3a8b52);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
index 8f9b4b7..4dbf620 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2b1=['STRING','exports'];(function(_0x58ce3c,_0x247cfb){var _0x5e9cb2=function(_0x5a2341){while(--_0x5a2341){_0x58ce3c['push'](_0x58ce3c['shift']());}};_0x5e9cb2(++_0x247cfb);}(_0xf2b1,0x1d3));var _0x1f2b=function(_0x197065,_0x2e79d0){_0x197065=_0x197065-0x0;var _0x3d9404=_0xf2b1[_0x197065];return _0x3d9404;};'use strict';var Sequelize=require('sequelize');module[_0x1f2b('0x0')]={'name':{'type':Sequelize[_0x1f2b('0x1')]},'description':{'type':Sequelize[_0x1f2b('0x1')]}};
\ No newline at end of file
+var _0x070b=['exports','STRING','sequelize'];(function(_0x14c0e0,_0x3ad847){var _0x4cbd72=function(_0x401e2e){while(--_0x401e2e){_0x14c0e0['push'](_0x14c0e0['shift']());}};_0x4cbd72(++_0x3ad847);}(_0x070b,0x80));var _0xb070=function(_0x2e9df9,_0x2b7f59){_0x2e9df9=_0x2e9df9-0x0;var _0x17dd96=_0x070b[_0x2e9df9];return _0x17dd96;};'use strict';var Sequelize=require(_0xb070('0x0'));module[_0xb070('0x1')]={'name':{'type':Sequelize[_0xb070('0x2')]},'description':{'type':Sequelize[_0xb070('0x2')]}};
\ No newline at end of file
index f882fb6..3ee9735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18ba=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','filter','where','merge','options','DeskConfiguration','includeAll','include','findAll','catch','show','params','keys','find','create','body','getFields','findOne','DeskField','order','hasOwnProperty','getSubjects','pick','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x362960,_0x18f6ed){var _0x1cbb9a=function(_0x18233f){while(--_0x18233f){_0x362960['push'](_0x362960['shift']());}};_0x1cbb9a(++_0x18f6ed);}(_0x18ba,0x91));var _0xa18b=function(_0x49d662,_0x4a6c27){_0x49d662=_0x49d662-0x0;var _0xca9472=_0x18ba[_0x49d662];return _0xca9472;};'use strict';var emlformat=require(_0xa18b('0x0'));var rimraf=require(_0xa18b('0x1'));var zipdir=require(_0xa18b('0x2'));var jsonpatch=require(_0xa18b('0x3'));var rp=require(_0xa18b('0x4'));var moment=require('moment');var BPromise=require(_0xa18b('0x5'));var Mustache=require(_0xa18b('0x6'));var util=require(_0xa18b('0x7'));var path=require(_0xa18b('0x8'));var sox=require(_0xa18b('0x9'));var csv=require('to-csv');var ejs=require(_0xa18b('0xa'));var fs=require('fs');var fs_extra=require(_0xa18b('0xb'));var _=require(_0xa18b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa18b('0xd'));var deskjs=require(_0xa18b('0xe'));var toCsv=require(_0xa18b('0xf'));var querystring=require(_0xa18b('0x10'));var Papa=require(_0xa18b('0x11'));var Redis=require(_0xa18b('0x12'));var authService=require(_0xa18b('0x13'));var qs=require(_0xa18b('0x14'));var as=require(_0xa18b('0x15'));var hardwareService=require(_0xa18b('0x16'));var logger=require(_0xa18b('0x17'))(_0xa18b('0x18'));var utils=require(_0xa18b('0x19'));var config=require(_0xa18b('0x1a'));var licenseUtil=require(_0xa18b('0x1b'));var db=require(_0xa18b('0x1c'))['db'];function respondWithStatusCode(_0x4b98d2,_0x23a23e){_0x23a23e=_0x23a23e||0xcc;return function(_0x2368f6){if(_0x2368f6){return _0x4b98d2[_0xa18b('0x1d')](_0x23a23e);}return _0x4b98d2[_0xa18b('0x1e')](_0x23a23e)[_0xa18b('0x1f')]();};}function respondWithResult(_0x29abe9,_0x30bc7f){_0x30bc7f=_0x30bc7f||0xc8;return function(_0x2c4153){if(_0x2c4153){return _0x29abe9[_0xa18b('0x1e')](_0x30bc7f)[_0xa18b('0x20')](_0x2c4153);}};}function respondWithFilteredResult(_0x179e1d,_0x562286){return function(_0x2a672d){if(_0x2a672d){var _0x20b7e6=typeof _0x562286['offset']==='undefined'&&typeof _0x562286['limit']===_0xa18b('0x21');var _0x43e2d4=_0x2a672d[_0xa18b('0x22')];var _0x443f58=_0x20b7e6?0x0:_0x562286[_0xa18b('0x23')];var _0x1e5f97=_0x20b7e6?_0x2a672d[_0xa18b('0x22')]:_0x562286[_0xa18b('0x23')]+_0x562286['limit'];var _0x272248;if(_0x1e5f97>=_0x43e2d4){_0x1e5f97=_0x43e2d4;_0x272248=0xc8;}else{_0x272248=0xce;}_0x179e1d[_0xa18b('0x1e')](_0x272248);return _0x179e1d[_0xa18b('0x24')](_0xa18b('0x25'),_0x443f58+'-'+_0x1e5f97+'/'+_0x43e2d4)[_0xa18b('0x20')](_0x2a672d);}return null;};}function patchUpdates(_0x5ab306){return function(_0x38b061){try{jsonpatch[_0xa18b('0x26')](_0x38b061,_0x5ab306,!![]);}catch(_0x2a25ee){return BPromise['reject'](_0x2a25ee);}return _0x38b061[_0xa18b('0x27')]();};}function saveUpdates(_0x49c38b,_0x32826b){return function(_0x269090){if(_0x269090){return _0x269090[_0xa18b('0x28')](_0x49c38b)[_0xa18b('0x29')](function(_0x3644d6){return _0x3644d6;});}return null;};}function removeEntity(_0x56a381,_0x24c48a){return function(_0x214a87){if(_0x214a87){return _0x214a87[_0xa18b('0x2a')]()['then'](function(){_0x56a381['status'](0xcc)[_0xa18b('0x1f')]();});}};}function handleEntityNotFound(_0x26e88d,_0x5d8945){return function(_0x5b6095){if(!_0x5b6095){_0x26e88d[_0xa18b('0x1d')](0x194);}return _0x5b6095;};}function handleError(_0x59a531,_0xad2e7){_0xad2e7=_0xad2e7||0x1f4;return function(_0x24dfe1){logger[_0xa18b('0x2b')](_0x24dfe1[_0xa18b('0x2c')]);if(_0x24dfe1[_0xa18b('0x2d')]){delete _0x24dfe1[_0xa18b('0x2d')];}_0x59a531[_0xa18b('0x1e')](_0xad2e7)[_0xa18b('0x2e')](_0x24dfe1);};}exports['index']=function(_0x5b1668,_0x60e880){var _0x5b8950={},_0x318782={},_0xc96892={'count':0x0,'rows':[]};var _0x104f7b=_[_0xa18b('0x2f')](db['DeskConfiguration'][_0xa18b('0x30')],function(_0xd75a07){return{'name':_0xd75a07[_0xa18b('0x31')],'type':_0xd75a07['type']['key']};});_0x318782[_0xa18b('0x32')]=_[_0xa18b('0x2f')](_0x104f7b,'name');_0x318782[_0xa18b('0x33')]=_['keys'](_0x5b1668[_0xa18b('0x33')]);_0x318782[_0xa18b('0x34')]=_['intersection'](_0x318782[_0xa18b('0x32')],_0x318782[_0xa18b('0x33')]);_0x5b8950['attributes']=_[_0xa18b('0x35')](_0x318782[_0xa18b('0x32')],qs[_0xa18b('0x36')](_0x5b1668[_0xa18b('0x33')][_0xa18b('0x36')]));_0x5b8950[_0xa18b('0x37')]=_0x5b8950[_0xa18b('0x37')][_0xa18b('0x38')]?_0x5b8950[_0xa18b('0x37')]:_0x318782[_0xa18b('0x32')];if(!_0x5b1668[_0xa18b('0x33')]['hasOwnProperty'](_0xa18b('0x39'))){_0x5b8950['limit']=qs['limit'](_0x5b1668['query'][_0xa18b('0x3a')]);_0x5b8950[_0xa18b('0x23')]=qs['offset'](_0x5b1668[_0xa18b('0x33')][_0xa18b('0x23')]);}_0x5b8950['order']=qs[_0xa18b('0x3b')](_0x5b1668[_0xa18b('0x33')][_0xa18b('0x3b')]);_0x5b8950['where']=qs['filters'](_['pick'](_0x5b1668['query'],_0x318782['filters']),_0x104f7b);if(_0x5b1668[_0xa18b('0x33')][_0xa18b('0x3c')]){_0x5b8950[_0xa18b('0x3d')]=_[_0xa18b('0x3e')](_0x5b8950[_0xa18b('0x3d')],{'$or':_[_0xa18b('0x2f')](_0x104f7b,function(_0x45db63){if(_0x45db63['type']!=='VIRTUAL'){var _0x3e7476={};_0x3e7476[_0x45db63[_0xa18b('0x2d')]]={'$like':'%'+_0x5b1668['query'][_0xa18b('0x3c')]+'%'};return _0x3e7476;}})});}_0x5b8950=_[_0xa18b('0x3e')]({},_0x5b8950,_0x5b1668[_0xa18b('0x3f')]);var _0x59fbbb={'where':_0x5b8950[_0xa18b('0x3d')]};return db[_0xa18b('0x40')][_0xa18b('0x22')](_0x59fbbb)[_0xa18b('0x29')](function(_0xf47fbb){_0xc96892[_0xa18b('0x22')]=_0xf47fbb;if(_0x5b1668[_0xa18b('0x33')][_0xa18b('0x41')]){_0x5b8950[_0xa18b('0x42')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xa18b('0x43')](_0x5b8950);})['then'](function(_0x1f0ca3){_0xc96892['rows']=_0x1f0ca3;return _0xc96892;})[_0xa18b('0x29')](respondWithFilteredResult(_0x60e880,_0x5b8950))[_0xa18b('0x44')](handleError(_0x60e880,null));};exports[_0xa18b('0x45')]=function(_0x2685e7,_0x44461a){var _0x166c76={'raw':![],'where':{'id':_0x2685e7[_0xa18b('0x46')]['id']}},_0x5bc30d={};_0x5bc30d[_0xa18b('0x32')]=_[_0xa18b('0x47')](db[_0xa18b('0x40')]['rawAttributes']);_0x5bc30d[_0xa18b('0x33')]=_['keys'](_0x2685e7[_0xa18b('0x33')]);_0x5bc30d[_0xa18b('0x34')]=_[_0xa18b('0x35')](_0x5bc30d[_0xa18b('0x32')],_0x5bc30d[_0xa18b('0x33')]);_0x166c76[_0xa18b('0x37')]=_[_0xa18b('0x35')](_0x5bc30d['model'],qs['fields'](_0x2685e7[_0xa18b('0x33')][_0xa18b('0x36')]));_0x166c76[_0xa18b('0x37')]=_0x166c76[_0xa18b('0x37')][_0xa18b('0x38')]?_0x166c76[_0xa18b('0x37')]:_0x5bc30d[_0xa18b('0x32')];if(_0x2685e7[_0xa18b('0x33')][_0xa18b('0x41')]){_0x166c76[_0xa18b('0x42')]=[{'all':!![]}];}_0x166c76=_[_0xa18b('0x3e')]({},_0x166c76,_0x2685e7[_0xa18b('0x3f')]);return db['DeskConfiguration'][_0xa18b('0x48')](_0x166c76)[_0xa18b('0x29')](handleEntityNotFound(_0x44461a,null))[_0xa18b('0x29')](respondWithResult(_0x44461a,null))[_0xa18b('0x44')](handleError(_0x44461a,null));};exports['create']=function(_0x411739,_0xb9b5d){return db[_0xa18b('0x40')][_0xa18b('0x49')](_0x411739['body'],{})[_0xa18b('0x29')](respondWithResult(_0xb9b5d,0xc9))[_0xa18b('0x44')](handleError(_0xb9b5d,null));};exports[_0xa18b('0x28')]=function(_0x32b20d,_0x577f47){if(_0x32b20d[_0xa18b('0x4a')]['id']){delete _0x32b20d['body']['id'];}return db[_0xa18b('0x40')][_0xa18b('0x48')]({'where':{'id':_0x32b20d['params']['id']}})[_0xa18b('0x29')](handleEntityNotFound(_0x577f47,null))[_0xa18b('0x29')](saveUpdates(_0x32b20d[_0xa18b('0x4a')],null))[_0xa18b('0x29')](respondWithResult(_0x577f47,null))['catch'](handleError(_0x577f47,null));};exports[_0xa18b('0x2a')]=function(_0xb2a8ce,_0x453044){return db[_0xa18b('0x40')]['find']({'where':{'id':_0xb2a8ce['params']['id']}})[_0xa18b('0x29')](handleEntityNotFound(_0x453044,null))['then'](removeEntity(_0x453044,null))['catch'](handleError(_0x453044,null));};exports[_0xa18b('0x4b')]=function(_0x2a55da,_0x20bdcb,_0x41add9){var _0x44037d={};var _0xc8fa20={};var _0x54282b;var _0x9a7ccf;return db[_0xa18b('0x40')][_0xa18b('0x4c')]({'where':{'id':_0x2a55da['params']['id']}})[_0xa18b('0x29')](handleEntityNotFound(_0x20bdcb,null))['then'](function(_0x56f729){if(_0x56f729){_0x54282b=_0x56f729;_0xc8fa20['model']=_['keys'](db[_0xa18b('0x4d')][_0xa18b('0x30')]);_0xc8fa20[_0xa18b('0x33')]=_[_0xa18b('0x47')](_0x2a55da[_0xa18b('0x33')]);_0xc8fa20['filters']=_[_0xa18b('0x35')](_0xc8fa20[_0xa18b('0x32')],_0xc8fa20['query']);_0x44037d[_0xa18b('0x37')]=_[_0xa18b('0x35')](_0xc8fa20[_0xa18b('0x32')],qs[_0xa18b('0x36')](_0x2a55da['query'][_0xa18b('0x36')]));_0x44037d[_0xa18b('0x37')]=_0x44037d[_0xa18b('0x37')][_0xa18b('0x38')]?_0x44037d[_0xa18b('0x37')]:_0xc8fa20[_0xa18b('0x32')];_0x44037d[_0xa18b('0x4e')]=qs['sort'](_0x2a55da['query'][_0xa18b('0x3b')]);_0x44037d['where']=qs[_0xa18b('0x34')](_['pick'](_0x2a55da['query'],_0xc8fa20['filters']));if(_0x2a55da[_0xa18b('0x33')][_0xa18b('0x3c')]){_0x44037d[_0xa18b('0x3d')]=_['merge'](_0x44037d['where'],{'$or':_['map'](_0x44037d[_0xa18b('0x37')],function(_0x498315){var _0x329d3a={};_0x329d3a[_0x498315]={'$like':'%'+_0x2a55da['query'][_0xa18b('0x3c')]+'%'};return _0x329d3a;})});}_0x44037d=_['merge']({},_0x44037d,_0x2a55da[_0xa18b('0x3f')]);return _0x54282b[_0xa18b('0x4b')](_0x44037d);}})[_0xa18b('0x29')](function(_0x7a7c1e){if(_0x7a7c1e){_0x9a7ccf=_0x7a7c1e[_0xa18b('0x38')];if(!_0x2a55da[_0xa18b('0x33')][_0xa18b('0x4f')](_0xa18b('0x39'))){_0x44037d[_0xa18b('0x3a')]=qs['limit'](_0x2a55da[_0xa18b('0x33')][_0xa18b('0x3a')]);_0x44037d[_0xa18b('0x23')]=qs[_0xa18b('0x23')](_0x2a55da['query'][_0xa18b('0x23')]);}return _0x54282b[_0xa18b('0x4b')](_0x44037d);}})[_0xa18b('0x29')](function(_0x5c51fc){if(_0x5c51fc){return _0x5c51fc?{'count':_0x9a7ccf,'rows':_0x5c51fc}:null;}})['then'](respondWithResult(_0x20bdcb,null))[_0xa18b('0x44')](handleError(_0x20bdcb,null));};exports[_0xa18b('0x50')]=function(_0x513d88,_0x39ed19,_0x265879){var _0x5893aa={};var _0x2cb1fc={};var _0x108bd4;var _0xde8c3f;return db[_0xa18b('0x40')][_0xa18b('0x4c')]({'where':{'id':_0x513d88[_0xa18b('0x46')]['id']}})[_0xa18b('0x29')](handleEntityNotFound(_0x39ed19,null))[_0xa18b('0x29')](function(_0xa9a49e){if(_0xa9a49e){_0x108bd4=_0xa9a49e;_0x2cb1fc[_0xa18b('0x32')]=_[_0xa18b('0x47')](db[_0xa18b('0x4d')]['rawAttributes']);_0x2cb1fc[_0xa18b('0x33')]=_[_0xa18b('0x47')](_0x513d88[_0xa18b('0x33')]);_0x2cb1fc[_0xa18b('0x34')]=_['intersection'](_0x2cb1fc[_0xa18b('0x32')],_0x2cb1fc[_0xa18b('0x33')]);_0x5893aa[_0xa18b('0x37')]=_[_0xa18b('0x35')](_0x2cb1fc[_0xa18b('0x32')],qs[_0xa18b('0x36')](_0x513d88[_0xa18b('0x33')]['fields']));_0x5893aa[_0xa18b('0x37')]=_0x5893aa['attributes'][_0xa18b('0x38')]?_0x5893aa[_0xa18b('0x37')]:_0x2cb1fc[_0xa18b('0x32')];_0x5893aa[_0xa18b('0x4e')]=qs[_0xa18b('0x3b')](_0x513d88['query'][_0xa18b('0x3b')]);_0x5893aa['where']=qs['filters'](_[_0xa18b('0x51')](_0x513d88[_0xa18b('0x33')],_0x2cb1fc[_0xa18b('0x34')]));if(_0x513d88['query'][_0xa18b('0x3c')]){_0x5893aa[_0xa18b('0x3d')]=_[_0xa18b('0x3e')](_0x5893aa['where'],{'$or':_['map'](_0x5893aa[_0xa18b('0x37')],function(_0x1ce66a){var _0x9bed99={};_0x9bed99[_0x1ce66a]={'$like':'%'+_0x513d88[_0xa18b('0x33')][_0xa18b('0x3c')]+'%'};return _0x9bed99;})});}_0x5893aa=_[_0xa18b('0x3e')]({},_0x5893aa,_0x513d88[_0xa18b('0x3f')]);return _0x108bd4[_0xa18b('0x50')](_0x5893aa);}})['then'](function(_0x5cdd55){if(_0x5cdd55){_0xde8c3f=_0x5cdd55['length'];if(!_0x513d88[_0xa18b('0x33')][_0xa18b('0x4f')](_0xa18b('0x39'))){_0x5893aa[_0xa18b('0x3a')]=qs[_0xa18b('0x3a')](_0x513d88[_0xa18b('0x33')][_0xa18b('0x3a')]);_0x5893aa[_0xa18b('0x23')]=qs[_0xa18b('0x23')](_0x513d88[_0xa18b('0x33')][_0xa18b('0x23')]);}return _0x108bd4['getSubjects'](_0x5893aa);}})['then'](function(_0x50309a){if(_0x50309a){return _0x50309a?{'count':_0xde8c3f,'rows':_0x50309a}:null;}})[_0xa18b('0x29')](respondWithResult(_0x39ed19,null))['catch'](handleError(_0x39ed19,null));};exports[_0xa18b('0x52')]=function(_0x4b44ec,_0x56a7a0,_0x17b667){var _0x431387={};var _0x192641={};var _0x43b8a3;var _0x2d90bf;return db[_0xa18b('0x40')][_0xa18b('0x4c')]({'where':{'id':_0x4b44ec[_0xa18b('0x46')]['id']}})[_0xa18b('0x29')](handleEntityNotFound(_0x56a7a0,null))['then'](function(_0x3245ee){if(_0x3245ee){_0x43b8a3=_0x3245ee;_0x192641[_0xa18b('0x32')]=_[_0xa18b('0x47')](db['DeskField'][_0xa18b('0x30')]);_0x192641[_0xa18b('0x33')]=_[_0xa18b('0x47')](_0x4b44ec[_0xa18b('0x33')]);_0x192641[_0xa18b('0x34')]=_[_0xa18b('0x35')](_0x192641[_0xa18b('0x32')],_0x192641[_0xa18b('0x33')]);_0x431387['attributes']=_['intersection'](_0x192641[_0xa18b('0x32')],qs[_0xa18b('0x36')](_0x4b44ec[_0xa18b('0x33')]['fields']));_0x431387[_0xa18b('0x37')]=_0x431387['attributes'][_0xa18b('0x38')]?_0x431387['attributes']:_0x192641['model'];_0x431387[_0xa18b('0x4e')]=qs[_0xa18b('0x3b')](_0x4b44ec['query'][_0xa18b('0x3b')]);_0x431387[_0xa18b('0x3d')]=qs['filters'](_['pick'](_0x4b44ec['query'],_0x192641['filters']));if(_0x4b44ec['query'][_0xa18b('0x3c')]){_0x431387[_0xa18b('0x3d')]=_[_0xa18b('0x3e')](_0x431387['where'],{'$or':_[_0xa18b('0x2f')](_0x431387[_0xa18b('0x37')],function(_0x3468ac){var _0x5d73b8={};_0x5d73b8[_0x3468ac]={'$like':'%'+_0x4b44ec[_0xa18b('0x33')][_0xa18b('0x3c')]+'%'};return _0x5d73b8;})});}_0x431387=_[_0xa18b('0x3e')]({},_0x431387,_0x4b44ec[_0xa18b('0x3f')]);return _0x43b8a3['getDescriptions'](_0x431387);}})['then'](function(_0x524aec){if(_0x524aec){_0x2d90bf=_0x524aec[_0xa18b('0x38')];if(!_0x4b44ec['query']['hasOwnProperty'](_0xa18b('0x39'))){_0x431387[_0xa18b('0x3a')]=qs[_0xa18b('0x3a')](_0x4b44ec[_0xa18b('0x33')]['limit']);_0x431387[_0xa18b('0x23')]=qs['offset'](_0x4b44ec[_0xa18b('0x33')][_0xa18b('0x23')]);}return _0x43b8a3[_0xa18b('0x52')](_0x431387);}})[_0xa18b('0x29')](function(_0x4b4e9c){if(_0x4b4e9c){return _0x4b4e9c?{'count':_0x2d90bf,'rows':_0x4b4e9c}:null;}})[_0xa18b('0x29')](respondWithResult(_0x56a7a0,null))['catch'](handleError(_0x56a7a0,null));};exports[_0xa18b('0x53')]=function(_0x4d09ef,_0x20d319,_0x1ed717){var _0x488e53={};var _0xa5bc21={};var _0x504487;var _0x1b4976;return db[_0xa18b('0x40')][_0xa18b('0x4c')]({'where':{'id':_0x4d09ef[_0xa18b('0x46')]['id']}})['then'](handleEntityNotFound(_0x20d319,null))[_0xa18b('0x29')](function(_0x18b22d){if(_0x18b22d){_0x504487=_0x18b22d;_0xa5bc21[_0xa18b('0x32')]=_[_0xa18b('0x47')](db['Tag'][_0xa18b('0x30')]);_0xa5bc21[_0xa18b('0x33')]=_[_0xa18b('0x47')](_0x4d09ef[_0xa18b('0x33')]);_0xa5bc21[_0xa18b('0x34')]=_['intersection'](_0xa5bc21[_0xa18b('0x32')],_0xa5bc21[_0xa18b('0x33')]);_0x488e53['attributes']=_[_0xa18b('0x35')](_0xa5bc21[_0xa18b('0x32')],qs['fields'](_0x4d09ef['query'][_0xa18b('0x36')]));_0x488e53['attributes']=_0x488e53['attributes'][_0xa18b('0x38')]?_0x488e53[_0xa18b('0x37')]:_0xa5bc21[_0xa18b('0x32')];_0x488e53[_0xa18b('0x4e')]=qs[_0xa18b('0x3b')](_0x4d09ef[_0xa18b('0x33')][_0xa18b('0x3b')]);_0x488e53['where']=qs[_0xa18b('0x34')](_[_0xa18b('0x51')](_0x4d09ef['query'],_0xa5bc21[_0xa18b('0x34')]));if(_0x4d09ef[_0xa18b('0x33')][_0xa18b('0x3c')]){_0x488e53['where']=_[_0xa18b('0x3e')](_0x488e53[_0xa18b('0x3d')],{'$or':_['map'](_0x488e53['attributes'],function(_0x27286d){var _0x3c65c8={};_0x3c65c8[_0x27286d]={'$like':'%'+_0x4d09ef[_0xa18b('0x33')][_0xa18b('0x3c')]+'%'};return _0x3c65c8;})});}_0x488e53=_['merge']({},_0x488e53,_0x4d09ef[_0xa18b('0x3f')]);return _0x504487[_0xa18b('0x53')](_0x488e53);}})[_0xa18b('0x29')](function(_0x1cba91){if(_0x1cba91){_0x1b4976=_0x1cba91[_0xa18b('0x38')];if(!_0x4d09ef[_0xa18b('0x33')]['hasOwnProperty'](_0xa18b('0x39'))){_0x488e53['limit']=qs[_0xa18b('0x3a')](_0x4d09ef[_0xa18b('0x33')][_0xa18b('0x3a')]);_0x488e53['offset']=qs[_0xa18b('0x23')](_0x4d09ef[_0xa18b('0x33')]['offset']);}return _0x504487['getTags'](_0x488e53);}})[_0xa18b('0x29')](function(_0x2117f8){if(_0x2117f8){return _0x2117f8?{'count':_0x1b4976,'rows':_0x2117f8}:null;}})['then'](respondWithResult(_0x20d319,null))[_0xa18b('0x44')](handleError(_0x20d319,null));};exports[_0xa18b('0x54')]=function(_0x5841af,_0x23214c,_0x2ccd90){if(_0x5841af[_0xa18b('0x4a')]['id']){delete _0x5841af['body']['id'];}return db[_0xa18b('0x40')]['findOne']({'where':{'id':_0x5841af[_0xa18b('0x46')]['id']}})[_0xa18b('0x29')](handleEntityNotFound(_0x23214c,null))[_0xa18b('0x29')](function(_0x2c02d6){if(_0x2c02d6){return _0x2c02d6[_0xa18b('0x54')](_0x5841af[_0xa18b('0x4a')][_0xa18b('0x55')]||[]);}return null;})[_0xa18b('0x29')](respondWithResult(_0x23214c,null))[_0xa18b('0x44')](handleError(_0x23214c,null));};
\ No newline at end of file
+var _0x7c23=['send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x5a6280,_0x3d15ae){var _0x187e44=function(_0x51a781){while(--_0x51a781){_0x5a6280['push'](_0x5a6280['shift']());}};_0x187e44(++_0x3d15ae);}(_0x7c23,0x1d2));var _0x37c2=function(_0x418734,_0x445660){_0x418734=_0x418734-0x0;var _0x2d9b4e=_0x7c23[_0x418734];return _0x2d9b4e;};'use strict';var emlformat=require(_0x37c2('0x0'));var rimraf=require(_0x37c2('0x1'));var zipdir=require(_0x37c2('0x2'));var jsonpatch=require(_0x37c2('0x3'));var rp=require(_0x37c2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37c2('0x5'));var util=require(_0x37c2('0x6'));var path=require(_0x37c2('0x7'));var sox=require(_0x37c2('0x8'));var csv=require(_0x37c2('0x9'));var ejs=require(_0x37c2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37c2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x37c2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x37c2('0x9'));var querystring=require(_0x37c2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x37c2('0xe'));var qs=require(_0x37c2('0xf'));var as=require(_0x37c2('0x10'));var hardwareService=require(_0x37c2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x37c2('0x12'));var config=require(_0x37c2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x37c2('0x14'))['db'];function respondWithStatusCode(_0x29f6fd,_0x125337){_0x125337=_0x125337||0xcc;return function(_0x37e580){if(_0x37e580){return _0x29f6fd['sendStatus'](_0x125337);}return _0x29f6fd[_0x37c2('0x15')](_0x125337)[_0x37c2('0x16')]();};}function respondWithResult(_0x1ff373,_0x458988){_0x458988=_0x458988||0xc8;return function(_0x422ba3){if(_0x422ba3){return _0x1ff373[_0x37c2('0x15')](_0x458988)[_0x37c2('0x17')](_0x422ba3);}};}function respondWithFilteredResult(_0x499f9b,_0x53235e){return function(_0x48e739){if(_0x48e739){var _0xd379b2=typeof _0x53235e[_0x37c2('0x18')]===_0x37c2('0x19')&&typeof _0x53235e['limit']===_0x37c2('0x19');var _0x2d5f4d=_0x48e739[_0x37c2('0x1a')];var _0x7a6108=_0xd379b2?0x0:_0x53235e[_0x37c2('0x18')];var _0x511413=_0xd379b2?_0x48e739[_0x37c2('0x1a')]:_0x53235e[_0x37c2('0x18')]+_0x53235e['limit'];var _0x1d9955;if(_0x511413>=_0x2d5f4d){_0x511413=_0x2d5f4d;_0x1d9955=0xc8;}else{_0x1d9955=0xce;}_0x499f9b[_0x37c2('0x15')](_0x1d9955);return _0x499f9b['set'](_0x37c2('0x1b'),_0x7a6108+'-'+_0x511413+'/'+_0x2d5f4d)['json'](_0x48e739);}return null;};}function patchUpdates(_0x430f46){return function(_0x4d5388){try{jsonpatch[_0x37c2('0x1c')](_0x4d5388,_0x430f46,!![]);}catch(_0xf36c3d){return BPromise[_0x37c2('0x1d')](_0xf36c3d);}return _0x4d5388[_0x37c2('0x1e')]();};}function saveUpdates(_0x31d204,_0x1dcc4b){return function(_0x59455e){if(_0x59455e){return _0x59455e[_0x37c2('0x1f')](_0x31d204)[_0x37c2('0x20')](function(_0x1a51a5){return _0x1a51a5;});}return null;};}function removeEntity(_0x4a70f2,_0x4c87cc){return function(_0x105d2f){if(_0x105d2f){return _0x105d2f[_0x37c2('0x21')]()[_0x37c2('0x20')](function(){_0x4a70f2[_0x37c2('0x15')](0xcc)[_0x37c2('0x16')]();});}};}function handleEntityNotFound(_0x4bd824,_0x32a812){return function(_0x1d1eb3){if(!_0x1d1eb3){_0x4bd824[_0x37c2('0x22')](0x194);}return _0x1d1eb3;};}function handleError(_0x546797,_0x1faa01){_0x1faa01=_0x1faa01||0x1f4;return function(_0x14a520){logger[_0x37c2('0x23')](_0x14a520[_0x37c2('0x24')]);if(_0x14a520[_0x37c2('0x25')]){delete _0x14a520[_0x37c2('0x25')];}_0x546797[_0x37c2('0x15')](_0x1faa01)[_0x37c2('0x26')](_0x14a520);};}exports[_0x37c2('0x27')]=function(_0x1cefa3,_0x5786ea){var _0x17eaa3={},_0xbfb7a6={},_0x404b39={'count':0x0,'rows':[]};var _0x1335f8=_[_0x37c2('0x28')](db[_0x37c2('0x29')][_0x37c2('0x2a')],function(_0x317ced){return{'name':_0x317ced[_0x37c2('0x2b')],'type':_0x317ced[_0x37c2('0x2c')][_0x37c2('0x2d')]};});_0xbfb7a6[_0x37c2('0x2e')]=_[_0x37c2('0x28')](_0x1335f8,_0x37c2('0x25'));_0xbfb7a6[_0x37c2('0x2f')]=_[_0x37c2('0x30')](_0x1cefa3['query']);_0xbfb7a6[_0x37c2('0x31')]=_[_0x37c2('0x32')](_0xbfb7a6[_0x37c2('0x2e')],_0xbfb7a6['query']);_0x17eaa3[_0x37c2('0x33')]=_[_0x37c2('0x32')](_0xbfb7a6[_0x37c2('0x2e')],qs['fields'](_0x1cefa3[_0x37c2('0x2f')][_0x37c2('0x34')]));_0x17eaa3[_0x37c2('0x33')]=_0x17eaa3[_0x37c2('0x33')][_0x37c2('0x35')]?_0x17eaa3[_0x37c2('0x33')]:_0xbfb7a6[_0x37c2('0x2e')];if(!_0x1cefa3[_0x37c2('0x2f')]['hasOwnProperty'](_0x37c2('0x36'))){_0x17eaa3['limit']=qs[_0x37c2('0x37')](_0x1cefa3['query'][_0x37c2('0x37')]);_0x17eaa3[_0x37c2('0x18')]=qs[_0x37c2('0x18')](_0x1cefa3[_0x37c2('0x2f')][_0x37c2('0x18')]);}_0x17eaa3[_0x37c2('0x38')]=qs['sort'](_0x1cefa3[_0x37c2('0x2f')][_0x37c2('0x39')]);_0x17eaa3[_0x37c2('0x3a')]=qs[_0x37c2('0x31')](_[_0x37c2('0x3b')](_0x1cefa3['query'],_0xbfb7a6[_0x37c2('0x31')]),_0x1335f8);if(_0x1cefa3['query'][_0x37c2('0x3c')]){_0x17eaa3['where']=_['merge'](_0x17eaa3['where'],{'$or':_['map'](_0x1335f8,function(_0x2071d4){if(_0x2071d4[_0x37c2('0x2c')]!==_0x37c2('0x3d')){var _0xa66a4={};_0xa66a4[_0x2071d4['name']]={'$like':'%'+_0x1cefa3[_0x37c2('0x2f')][_0x37c2('0x3c')]+'%'};return _0xa66a4;}})});}_0x17eaa3=_[_0x37c2('0x3e')]({},_0x17eaa3,_0x1cefa3[_0x37c2('0x3f')]);var _0x54c0e5={'where':_0x17eaa3[_0x37c2('0x3a')]};return db[_0x37c2('0x29')][_0x37c2('0x1a')](_0x54c0e5)[_0x37c2('0x20')](function(_0xbe942c){_0x404b39[_0x37c2('0x1a')]=_0xbe942c;if(_0x1cefa3[_0x37c2('0x2f')][_0x37c2('0x40')]){_0x17eaa3[_0x37c2('0x41')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x37c2('0x42')](_0x17eaa3);})[_0x37c2('0x20')](function(_0x562906){_0x404b39[_0x37c2('0x43')]=_0x562906;return _0x404b39;})['then'](respondWithFilteredResult(_0x5786ea,_0x17eaa3))[_0x37c2('0x44')](handleError(_0x5786ea,null));};exports[_0x37c2('0x45')]=function(_0x158c9b,_0x3a2655){var _0x4ccfc9={'raw':![],'where':{'id':_0x158c9b['params']['id']}},_0x28099c={};_0x28099c[_0x37c2('0x2e')]=_[_0x37c2('0x30')](db[_0x37c2('0x29')]['rawAttributes']);_0x28099c['query']=_['keys'](_0x158c9b[_0x37c2('0x2f')]);_0x28099c[_0x37c2('0x31')]=_[_0x37c2('0x32')](_0x28099c[_0x37c2('0x2e')],_0x28099c['query']);_0x4ccfc9[_0x37c2('0x33')]=_[_0x37c2('0x32')](_0x28099c[_0x37c2('0x2e')],qs[_0x37c2('0x34')](_0x158c9b[_0x37c2('0x2f')]['fields']));_0x4ccfc9['attributes']=_0x4ccfc9[_0x37c2('0x33')]['length']?_0x4ccfc9[_0x37c2('0x33')]:_0x28099c[_0x37c2('0x2e')];if(_0x158c9b[_0x37c2('0x2f')][_0x37c2('0x40')]){_0x4ccfc9[_0x37c2('0x41')]=[{'all':!![]}];}_0x4ccfc9=_['merge']({},_0x4ccfc9,_0x158c9b[_0x37c2('0x3f')]);return db[_0x37c2('0x29')][_0x37c2('0x46')](_0x4ccfc9)['then'](handleEntityNotFound(_0x3a2655,null))['then'](respondWithResult(_0x3a2655,null))[_0x37c2('0x44')](handleError(_0x3a2655,null));};exports[_0x37c2('0x47')]=function(_0x63c0fe,_0x31eb1e){return db[_0x37c2('0x29')][_0x37c2('0x47')](_0x63c0fe['body'],{})['then'](respondWithResult(_0x31eb1e,0xc9))[_0x37c2('0x44')](handleError(_0x31eb1e,null));};exports[_0x37c2('0x1f')]=function(_0xf45662,_0x2c7c51){if(_0xf45662['body']['id']){delete _0xf45662[_0x37c2('0x48')]['id'];}return db[_0x37c2('0x29')][_0x37c2('0x46')]({'where':{'id':_0xf45662['params']['id']}})[_0x37c2('0x20')](handleEntityNotFound(_0x2c7c51,null))['then'](saveUpdates(_0xf45662[_0x37c2('0x48')],null))[_0x37c2('0x20')](respondWithResult(_0x2c7c51,null))['catch'](handleError(_0x2c7c51,null));};exports[_0x37c2('0x21')]=function(_0x1fd9d8,_0x26afb7){return db['DeskConfiguration']['find']({'where':{'id':_0x1fd9d8[_0x37c2('0x49')]['id']}})[_0x37c2('0x20')](handleEntityNotFound(_0x26afb7,null))[_0x37c2('0x20')](removeEntity(_0x26afb7,null))[_0x37c2('0x44')](handleError(_0x26afb7,null));};exports[_0x37c2('0x4a')]=function(_0x3af707,_0x36166a,_0x179e21){var _0x357830={};var _0x4e7531={};var _0x233137;var _0x450085;return db[_0x37c2('0x29')][_0x37c2('0x4b')]({'where':{'id':_0x3af707[_0x37c2('0x49')]['id']}})[_0x37c2('0x20')](handleEntityNotFound(_0x36166a,null))[_0x37c2('0x20')](function(_0x2d1ac3){if(_0x2d1ac3){_0x233137=_0x2d1ac3;_0x4e7531[_0x37c2('0x2e')]=_[_0x37c2('0x30')](db['DeskField']['rawAttributes']);_0x4e7531[_0x37c2('0x2f')]=_[_0x37c2('0x30')](_0x3af707['query']);_0x4e7531[_0x37c2('0x31')]=_['intersection'](_0x4e7531[_0x37c2('0x2e')],_0x4e7531[_0x37c2('0x2f')]);_0x357830[_0x37c2('0x33')]=_[_0x37c2('0x32')](_0x4e7531[_0x37c2('0x2e')],qs[_0x37c2('0x34')](_0x3af707[_0x37c2('0x2f')][_0x37c2('0x34')]));_0x357830[_0x37c2('0x33')]=_0x357830[_0x37c2('0x33')][_0x37c2('0x35')]?_0x357830[_0x37c2('0x33')]:_0x4e7531[_0x37c2('0x2e')];_0x357830[_0x37c2('0x38')]=qs[_0x37c2('0x39')](_0x3af707['query'][_0x37c2('0x39')]);_0x357830['where']=qs[_0x37c2('0x31')](_[_0x37c2('0x3b')](_0x3af707[_0x37c2('0x2f')],_0x4e7531[_0x37c2('0x31')]));if(_0x3af707[_0x37c2('0x2f')][_0x37c2('0x3c')]){_0x357830[_0x37c2('0x3a')]=_[_0x37c2('0x3e')](_0x357830[_0x37c2('0x3a')],{'$or':_[_0x37c2('0x28')](_0x357830[_0x37c2('0x33')],function(_0x217849){var _0x430382={};_0x430382[_0x217849]={'$like':'%'+_0x3af707[_0x37c2('0x2f')][_0x37c2('0x3c')]+'%'};return _0x430382;})});}_0x357830=_[_0x37c2('0x3e')]({},_0x357830,_0x3af707['options']);return _0x233137['getFields'](_0x357830);}})[_0x37c2('0x20')](function(_0x2db278){if(_0x2db278){_0x450085=_0x2db278[_0x37c2('0x35')];if(!_0x3af707[_0x37c2('0x2f')][_0x37c2('0x4c')](_0x37c2('0x36'))){_0x357830[_0x37c2('0x37')]=qs[_0x37c2('0x37')](_0x3af707[_0x37c2('0x2f')][_0x37c2('0x37')]);_0x357830[_0x37c2('0x18')]=qs[_0x37c2('0x18')](_0x3af707[_0x37c2('0x2f')][_0x37c2('0x18')]);}return _0x233137[_0x37c2('0x4a')](_0x357830);}})[_0x37c2('0x20')](function(_0x9f3435){if(_0x9f3435){return _0x9f3435?{'count':_0x450085,'rows':_0x9f3435}:null;}})['then'](respondWithResult(_0x36166a,null))['catch'](handleError(_0x36166a,null));};exports[_0x37c2('0x4d')]=function(_0x1f99f6,_0x43454c,_0x5cdd77){var _0x2ea467={};var _0x1c9942={};var _0xbfedc6;var _0x455daa;return db[_0x37c2('0x29')]['findOne']({'where':{'id':_0x1f99f6[_0x37c2('0x49')]['id']}})[_0x37c2('0x20')](handleEntityNotFound(_0x43454c,null))[_0x37c2('0x20')](function(_0x29a704){if(_0x29a704){_0xbfedc6=_0x29a704;_0x1c9942[_0x37c2('0x2e')]=_['keys'](db[_0x37c2('0x4e')][_0x37c2('0x2a')]);_0x1c9942[_0x37c2('0x2f')]=_[_0x37c2('0x30')](_0x1f99f6[_0x37c2('0x2f')]);_0x1c9942[_0x37c2('0x31')]=_[_0x37c2('0x32')](_0x1c9942['model'],_0x1c9942['query']);_0x2ea467['attributes']=_[_0x37c2('0x32')](_0x1c9942['model'],qs[_0x37c2('0x34')](_0x1f99f6[_0x37c2('0x2f')][_0x37c2('0x34')]));_0x2ea467[_0x37c2('0x33')]=_0x2ea467[_0x37c2('0x33')][_0x37c2('0x35')]?_0x2ea467[_0x37c2('0x33')]:_0x1c9942[_0x37c2('0x2e')];_0x2ea467[_0x37c2('0x38')]=qs[_0x37c2('0x39')](_0x1f99f6[_0x37c2('0x2f')]['sort']);_0x2ea467[_0x37c2('0x3a')]=qs[_0x37c2('0x31')](_[_0x37c2('0x3b')](_0x1f99f6[_0x37c2('0x2f')],_0x1c9942['filters']));if(_0x1f99f6[_0x37c2('0x2f')]['filter']){_0x2ea467[_0x37c2('0x3a')]=_[_0x37c2('0x3e')](_0x2ea467[_0x37c2('0x3a')],{'$or':_[_0x37c2('0x28')](_0x2ea467[_0x37c2('0x33')],function(_0x3200ff){var _0x512853={};_0x512853[_0x3200ff]={'$like':'%'+_0x1f99f6[_0x37c2('0x2f')][_0x37c2('0x3c')]+'%'};return _0x512853;})});}_0x2ea467=_[_0x37c2('0x3e')]({},_0x2ea467,_0x1f99f6[_0x37c2('0x3f')]);return _0xbfedc6[_0x37c2('0x4d')](_0x2ea467);}})[_0x37c2('0x20')](function(_0x139c25){if(_0x139c25){_0x455daa=_0x139c25[_0x37c2('0x35')];if(!_0x1f99f6[_0x37c2('0x2f')][_0x37c2('0x4c')](_0x37c2('0x36'))){_0x2ea467['limit']=qs[_0x37c2('0x37')](_0x1f99f6[_0x37c2('0x2f')][_0x37c2('0x37')]);_0x2ea467[_0x37c2('0x18')]=qs['offset'](_0x1f99f6[_0x37c2('0x2f')][_0x37c2('0x18')]);}return _0xbfedc6[_0x37c2('0x4d')](_0x2ea467);}})[_0x37c2('0x20')](function(_0x3b1b9e){if(_0x3b1b9e){return _0x3b1b9e?{'count':_0x455daa,'rows':_0x3b1b9e}:null;}})[_0x37c2('0x20')](respondWithResult(_0x43454c,null))['catch'](handleError(_0x43454c,null));};exports[_0x37c2('0x4f')]=function(_0x6f3c2d,_0x25dc07,_0x275bb7){var _0xf313bf={};var _0x10eb82={};var _0x4e28df;var _0x702a76;return db['DeskConfiguration']['findOne']({'where':{'id':_0x6f3c2d[_0x37c2('0x49')]['id']}})[_0x37c2('0x20')](handleEntityNotFound(_0x25dc07,null))[_0x37c2('0x20')](function(_0x28f4ed){if(_0x28f4ed){_0x4e28df=_0x28f4ed;_0x10eb82[_0x37c2('0x2e')]=_['keys'](db[_0x37c2('0x4e')]['rawAttributes']);_0x10eb82[_0x37c2('0x2f')]=_[_0x37c2('0x30')](_0x6f3c2d['query']);_0x10eb82[_0x37c2('0x31')]=_['intersection'](_0x10eb82[_0x37c2('0x2e')],_0x10eb82[_0x37c2('0x2f')]);_0xf313bf[_0x37c2('0x33')]=_[_0x37c2('0x32')](_0x10eb82[_0x37c2('0x2e')],qs[_0x37c2('0x34')](_0x6f3c2d[_0x37c2('0x2f')][_0x37c2('0x34')]));_0xf313bf['attributes']=_0xf313bf['attributes'][_0x37c2('0x35')]?_0xf313bf[_0x37c2('0x33')]:_0x10eb82[_0x37c2('0x2e')];_0xf313bf[_0x37c2('0x38')]=qs[_0x37c2('0x39')](_0x6f3c2d[_0x37c2('0x2f')]['sort']);_0xf313bf[_0x37c2('0x3a')]=qs['filters'](_[_0x37c2('0x3b')](_0x6f3c2d[_0x37c2('0x2f')],_0x10eb82[_0x37c2('0x31')]));if(_0x6f3c2d[_0x37c2('0x2f')][_0x37c2('0x3c')]){_0xf313bf[_0x37c2('0x3a')]=_[_0x37c2('0x3e')](_0xf313bf[_0x37c2('0x3a')],{'$or':_['map'](_0xf313bf[_0x37c2('0x33')],function(_0x583023){var _0x1eea50={};_0x1eea50[_0x583023]={'$like':'%'+_0x6f3c2d['query']['filter']+'%'};return _0x1eea50;})});}_0xf313bf=_[_0x37c2('0x3e')]({},_0xf313bf,_0x6f3c2d[_0x37c2('0x3f')]);return _0x4e28df['getDescriptions'](_0xf313bf);}})[_0x37c2('0x20')](function(_0x2dc038){if(_0x2dc038){_0x702a76=_0x2dc038[_0x37c2('0x35')];if(!_0x6f3c2d['query'][_0x37c2('0x4c')](_0x37c2('0x36'))){_0xf313bf['limit']=qs[_0x37c2('0x37')](_0x6f3c2d[_0x37c2('0x2f')][_0x37c2('0x37')]);_0xf313bf['offset']=qs[_0x37c2('0x18')](_0x6f3c2d[_0x37c2('0x2f')][_0x37c2('0x18')]);}return _0x4e28df[_0x37c2('0x4f')](_0xf313bf);}})[_0x37c2('0x20')](function(_0x508b74){if(_0x508b74){return _0x508b74?{'count':_0x702a76,'rows':_0x508b74}:null;}})[_0x37c2('0x20')](respondWithResult(_0x25dc07,null))[_0x37c2('0x44')](handleError(_0x25dc07,null));};exports['getTags']=function(_0x5ad2cc,_0x4b7d6f,_0x46f7b1){var _0x29abf4={};var _0x57e7b2={};var _0x2564f6;var _0x2cafe1;return db[_0x37c2('0x29')][_0x37c2('0x4b')]({'where':{'id':_0x5ad2cc[_0x37c2('0x49')]['id']}})[_0x37c2('0x20')](handleEntityNotFound(_0x4b7d6f,null))[_0x37c2('0x20')](function(_0x3dba96){if(_0x3dba96){_0x2564f6=_0x3dba96;_0x57e7b2[_0x37c2('0x2e')]=_[_0x37c2('0x30')](db[_0x37c2('0x50')][_0x37c2('0x2a')]);_0x57e7b2[_0x37c2('0x2f')]=_[_0x37c2('0x30')](_0x5ad2cc[_0x37c2('0x2f')]);_0x57e7b2[_0x37c2('0x31')]=_[_0x37c2('0x32')](_0x57e7b2['model'],_0x57e7b2[_0x37c2('0x2f')]);_0x29abf4[_0x37c2('0x33')]=_[_0x37c2('0x32')](_0x57e7b2[_0x37c2('0x2e')],qs[_0x37c2('0x34')](_0x5ad2cc[_0x37c2('0x2f')][_0x37c2('0x34')]));_0x29abf4[_0x37c2('0x33')]=_0x29abf4[_0x37c2('0x33')]['length']?_0x29abf4[_0x37c2('0x33')]:_0x57e7b2[_0x37c2('0x2e')];_0x29abf4[_0x37c2('0x38')]=qs[_0x37c2('0x39')](_0x5ad2cc[_0x37c2('0x2f')][_0x37c2('0x39')]);_0x29abf4['where']=qs[_0x37c2('0x31')](_[_0x37c2('0x3b')](_0x5ad2cc[_0x37c2('0x2f')],_0x57e7b2[_0x37c2('0x31')]));if(_0x5ad2cc[_0x37c2('0x2f')]['filter']){_0x29abf4[_0x37c2('0x3a')]=_[_0x37c2('0x3e')](_0x29abf4[_0x37c2('0x3a')],{'$or':_[_0x37c2('0x28')](_0x29abf4['attributes'],function(_0x2e2c84){var _0x492557={};_0x492557[_0x2e2c84]={'$like':'%'+_0x5ad2cc[_0x37c2('0x2f')][_0x37c2('0x3c')]+'%'};return _0x492557;})});}_0x29abf4=_[_0x37c2('0x3e')]({},_0x29abf4,_0x5ad2cc[_0x37c2('0x3f')]);return _0x2564f6[_0x37c2('0x51')](_0x29abf4);}})[_0x37c2('0x20')](function(_0x34bc8f){if(_0x34bc8f){_0x2cafe1=_0x34bc8f[_0x37c2('0x35')];if(!_0x5ad2cc[_0x37c2('0x2f')][_0x37c2('0x4c')]('nolimit')){_0x29abf4[_0x37c2('0x37')]=qs['limit'](_0x5ad2cc[_0x37c2('0x2f')][_0x37c2('0x37')]);_0x29abf4[_0x37c2('0x18')]=qs['offset'](_0x5ad2cc[_0x37c2('0x2f')][_0x37c2('0x18')]);}return _0x2564f6['getTags'](_0x29abf4);}})[_0x37c2('0x20')](function(_0x2c1970){if(_0x2c1970){return _0x2c1970?{'count':_0x2cafe1,'rows':_0x2c1970}:null;}})[_0x37c2('0x20')](respondWithResult(_0x4b7d6f,null))['catch'](handleError(_0x4b7d6f,null));};exports['setTags']=function(_0x411665,_0x5e65cb,_0x114415){if(_0x411665['body']['id']){delete _0x411665[_0x37c2('0x48')]['id'];}return db[_0x37c2('0x29')][_0x37c2('0x4b')]({'where':{'id':_0x411665[_0x37c2('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e65cb,null))[_0x37c2('0x20')](function(_0x1b6727){if(_0x1b6727){return _0x1b6727[_0x37c2('0x52')](_0x411665[_0x37c2('0x48')][_0x37c2('0x53')]||[]);}return null;})[_0x37c2('0x20')](respondWithResult(_0x5e65cb,null))[_0x37c2('0x44')](handleError(_0x5e65cb,null));};
\ No newline at end of file
index 1790b44..af6378d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cef=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','util','../../config/logger'];(function(_0x18f005,_0x475e37){var _0x3276be=function(_0x3a95e6){while(--_0x3a95e6){_0x18f005['push'](_0x18f005['shift']());}};_0x3276be(++_0x475e37);}(_0x3cef,0xe2));var _0xf3ce=function(_0x29fc1b,_0x4f1346){_0x29fc1b=_0x29fc1b-0x0;var _0x4f5015=_0x3cef[_0x29fc1b];return _0x4f5015;};'use strict';var _=require('lodash');var util=require(_0xf3ce('0x0'));var logger=require(_0xf3ce('0x1'))('api');var moment=require(_0xf3ce('0x2'));var BPromise=require(_0xf3ce('0x3'));var rp=require(_0xf3ce('0x4'));var fs=require('fs');var path=require(_0xf3ce('0x5'));var rimraf=require(_0xf3ce('0x6'));var config=require(_0xf3ce('0x7'));var attributes=require(_0xf3ce('0x8'));module[_0xf3ce('0x9')]=function(_0x52aa27,_0x1da434){return _0x52aa27[_0xf3ce('0xa')]('DeskConfiguration',attributes,{'tableName':_0xf3ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc97f=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5728e4,_0x52dfcc){var _0x7ca0ac=function(_0x50539a){while(--_0x50539a){_0x5728e4['push'](_0x5728e4['shift']());}};_0x7ca0ac(++_0x52dfcc);}(_0xc97f,0x102));var _0xfc97=function(_0x50b625,_0x1aaf3b){_0x50b625=_0x50b625-0x0;var _0x56e014=_0xc97f[_0x50b625];return _0x56e014;};'use strict';var _=require(_0xfc97('0x0'));var util=require('util');var logger=require(_0xfc97('0x1'))(_0xfc97('0x2'));var moment=require(_0xfc97('0x3'));var BPromise=require(_0xfc97('0x4'));var rp=require(_0xfc97('0x5'));var fs=require('fs');var path=require(_0xfc97('0x6'));var rimraf=require(_0xfc97('0x7'));var config=require(_0xfc97('0x8'));var attributes=require(_0xfc97('0x9'));module[_0xfc97('0xa')]=function(_0x10c0db,_0x44704f){return _0x10c0db[_0xfc97('0xb')](_0xfc97('0xc'),attributes,{'tableName':_0xfc97('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5adfbad..7dab196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0257=['rpc','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x156b75,_0x2778d7){var _0x472179=function(_0x4fddb7){while(--_0x4fddb7){_0x156b75['push'](_0x156b75['shift']());}};_0x472179(++_0x2778d7);}(_0x0257,0x1db));var _0x7025=function(_0x4df667,_0x2d80ea){_0x4df667=_0x4df667-0x0;var _0x24ff9d=_0x0257[_0x4df667];return _0x24ff9d;};'use strict';var _=require('lodash');var util=require(_0x7025('0x0'));var moment=require(_0x7025('0x1'));var BPromise=require(_0x7025('0x2'));var rs=require(_0x7025('0x3'));var fs=require('fs');var Redis=require(_0x7025('0x4'));var db=require(_0x7025('0x5'))['db'];var utils=require(_0x7025('0x6'));var logger=require(_0x7025('0x7'))(_0x7025('0x8'));var config=require('../../config/environment');var jayson=require(_0x7025('0x9'));var client=jayson[_0x7025('0xa')][_0x7025('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44dc85,_0x33251b,_0xd2a516){return new BPromise(function(_0x494e48,_0xa74928){return client[_0x7025('0xc')](_0x44dc85,_0xd2a516)[_0x7025('0xd')](function(_0x5dbd09){logger['info'](_0x7025('0xe'),_0x33251b,_0x7025('0xf'));logger[_0x7025('0x10')](_0x7025('0x11'),_0x33251b,_0x7025('0xf'),JSON['stringify'](_0x5dbd09));if(_0x5dbd09[_0x7025('0x12')]){if(_0x5dbd09[_0x7025('0x12')][_0x7025('0x13')]===0x1f4){logger[_0x7025('0x12')](_0x7025('0xe'),_0x33251b,_0x5dbd09[_0x7025('0x12')][_0x7025('0x14')]);return _0xa74928(_0x5dbd09[_0x7025('0x12')][_0x7025('0x14')]);}logger[_0x7025('0x12')](_0x7025('0xe'),_0x33251b,_0x5dbd09[_0x7025('0x12')][_0x7025('0x14')]);return _0x494e48(_0x5dbd09['error'][_0x7025('0x14')]);}else{logger['info'](_0x7025('0xe'),_0x33251b,_0x7025('0xf'));_0x494e48(_0x5dbd09[_0x7025('0x15')]['message']);}})[_0x7025('0x16')](function(_0x4aca38){logger[_0x7025('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x33251b,_0x4aca38);_0xa74928(_0x4aca38);});});}
\ No newline at end of file
+var _0xd959=['info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x24bf49,_0x265dc9){var _0x11160a=function(_0x1ade4b){while(--_0x1ade4b){_0x24bf49['push'](_0x24bf49['shift']());}};_0x11160a(++_0x265dc9);}(_0xd959,0x94));var _0x9d95=function(_0x56147a,_0x4713c7){_0x56147a=_0x56147a-0x0;var _0x5537d0=_0xd959[_0x56147a];return _0x5537d0;};'use strict';var _=require(_0x9d95('0x0'));var util=require(_0x9d95('0x1'));var moment=require(_0x9d95('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d95('0x3'));var fs=require('fs');var Redis=require(_0x9d95('0x4'));var db=require(_0x9d95('0x5'))['db'];var utils=require(_0x9d95('0x6'));var logger=require(_0x9d95('0x7'))('rpc');var config=require(_0x9d95('0x8'));var jayson=require(_0x9d95('0x9'));var client=jayson[_0x9d95('0xa')][_0x9d95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5cd4ff,_0x3b9ddc,_0x300ffe){return new BPromise(function(_0x22af66,_0x561877){return client[_0x9d95('0xc')](_0x5cd4ff,_0x300ffe)['then'](function(_0x156d8a){logger[_0x9d95('0xd')](_0x9d95('0xe'),_0x3b9ddc,_0x9d95('0xf'));logger[_0x9d95('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3b9ddc,_0x9d95('0xf'),JSON[_0x9d95('0x11')](_0x156d8a));if(_0x156d8a['error']){if(_0x156d8a[_0x9d95('0x12')][_0x9d95('0x13')]===0x1f4){logger['error'](_0x9d95('0xe'),_0x3b9ddc,_0x156d8a[_0x9d95('0x12')][_0x9d95('0x14')]);return _0x561877(_0x156d8a[_0x9d95('0x12')]['message']);}logger[_0x9d95('0x12')](_0x9d95('0xe'),_0x3b9ddc,_0x156d8a['error'][_0x9d95('0x14')]);return _0x22af66(_0x156d8a[_0x9d95('0x12')][_0x9d95('0x14')]);}else{logger['info'](_0x9d95('0xe'),_0x3b9ddc,'request\x20sent');_0x22af66(_0x156d8a[_0x9d95('0x15')][_0x9d95('0x14')]);}})[_0x9d95('0x16')](function(_0x581647){logger[_0x9d95('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x3b9ddc,_0x581647);_0x561877(_0x581647);});});}
\ No newline at end of file
index 4986e3e..2a7206e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7792=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','/:id','isAuthenticated','show','create','put','update'];(function(_0xefb553,_0x93f724){var _0x2e5e72=function(_0x105161){while(--_0x105161){_0xefb553['push'](_0xefb553['shift']());}};_0x2e5e72(++_0x93f724);}(_0x7792,0x131));var _0x2779=function(_0x4289ed,_0x2c7b8f){_0x4289ed=_0x4289ed-0x0;var _0x2f5317=_0x7792[_0x4289ed];return _0x2f5317;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2779('0x0'));var timeout=require(_0x2779('0x1'));var express=require(_0x2779('0x2'));var router=express[_0x2779('0x3')]();var fs_extra=require(_0x2779('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2779('0x5'));var config=require(_0x2779('0x6'));var controller=require(_0x2779('0x7'));router[_0x2779('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2779('0x8')](_0x2779('0x9'),auth[_0x2779('0xa')](),controller[_0x2779('0xb')]);router['post']('/',auth[_0x2779('0xa')](),controller[_0x2779('0xc')]);router[_0x2779('0xd')](_0x2779('0x9'),auth[_0x2779('0xa')](),controller[_0x2779('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2779('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xa547=['/:id','post','create','put','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xa547,0xb0));var _0x7a54=function(_0x3feca4,_0xda09bc){_0x3feca4=_0x3feca4-0x0;var _0x4a8f83=_0xa547[_0x3feca4];return _0x4a8f83;};'use strict';var multer=require('multer');var util=require(_0x7a54('0x0'));var path=require('path');var timeout=require(_0x7a54('0x1'));var express=require('express');var router=express[_0x7a54('0x2')]();var fs_extra=require(_0x7a54('0x3'));var auth=require(_0x7a54('0x4'));var interaction=require(_0x7a54('0x5'));var config=require(_0x7a54('0x6'));var controller=require(_0x7a54('0x7'));router['get']('/',auth[_0x7a54('0x8')](),controller[_0x7a54('0x9')]);router[_0x7a54('0xa')](_0x7a54('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7a54('0xc')]('/',auth[_0x7a54('0x8')](),controller[_0x7a54('0xd')]);router[_0x7a54('0xe')](_0x7a54('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7a54('0xb'),auth[_0x7a54('0x8')](),controller[_0x7a54('0xf')]);module[_0x7a54('0x10')]=router;
\ No newline at end of file
index 5f74135..cc4c37d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x805a=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','picklist','STRING'];(function(_0x935c45,_0xe85a2c){var _0x5fc6d4=function(_0x13f83b){while(--_0x13f83b){_0x935c45['push'](_0x935c45['shift']());}};_0x5fc6d4(++_0xe85a2c);}(_0x805a,0x6e));var _0xa805=function(_0x20d4e7,_0x5f29f7){_0x20d4e7=_0x20d4e7-0x0;var _0x125131=_0x805a[_0x20d4e7];return _0x125131;};'use strict';var Sequelize=require(_0xa805('0x0'));module[_0xa805('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa805('0x2'),_0xa805('0x3'),_0xa805('0x4'),'keyValue',_0xa805('0x5')),'defaultValue':_0xa805('0x2')},'content':{'type':Sequelize[_0xa805('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa805('0x7')](_0xa805('0x2'),_0xa805('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xa805('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa805('0x6')]},'customField':{'type':Sequelize[_0xa805('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa805('0x6')]}};
\ No newline at end of file
+var _0x48df=['ENUM','string','STRING','sequelize','exports','variable','picklist'];(function(_0x217c2e,_0x358f06){var _0x22b7d8=function(_0x111c48){while(--_0x111c48){_0x217c2e['push'](_0x217c2e['shift']());}};_0x22b7d8(++_0x358f06);}(_0x48df,0x81));var _0xf48d=function(_0x5951e8,_0x42b9a7){_0x5951e8=_0x5951e8-0x0;var _0x20a1f5=_0x48df[_0x5951e8];return _0x20a1f5;};'use strict';var Sequelize=require(_0xf48d('0x0'));module[_0xf48d('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf48d('0x2'),'customVariable','keyValue',_0xf48d('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf48d('0x4')](_0xf48d('0x5'),_0xf48d('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xf48d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf48d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f4cc9ff..1b54b5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaee=['body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','DeskField','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','create'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xaaee,0x132));var _0xeaae=function(_0x486a51,_0x49f483){_0x486a51=_0x486a51-0x0;var _0x4a87ae=_0xaaee[_0x486a51];return _0x4a87ae;};'use strict';var emlformat=require(_0xeaae('0x0'));var rimraf=require(_0xeaae('0x1'));var zipdir=require(_0xeaae('0x2'));var jsonpatch=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var moment=require('moment');var BPromise=require(_0xeaae('0x5'));var Mustache=require(_0xeaae('0x6'));var util=require(_0xeaae('0x7'));var path=require(_0xeaae('0x8'));var sox=require(_0xeaae('0x9'));var csv=require(_0xeaae('0xa'));var ejs=require(_0xeaae('0xb'));var fs=require('fs');var fs_extra=require(_0xeaae('0xc'));var _=require(_0xeaae('0xd'));var squel=require(_0xeaae('0xe'));var crypto=require(_0xeaae('0xf'));var jsforce=require(_0xeaae('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xeaae('0xa'));var querystring=require(_0xeaae('0x11'));var Papa=require('papaparse');var Redis=require(_0xeaae('0x12'));var authService=require(_0xeaae('0x13'));var qs=require(_0xeaae('0x14'));var as=require(_0xeaae('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xeaae('0x16'));var utils=require(_0xeaae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xeaae('0x18'));var db=require(_0xeaae('0x19'))['db'];function respondWithStatusCode(_0x3a7d86,_0x33d335){_0x33d335=_0x33d335||0xcc;return function(_0x4c49ac){if(_0x4c49ac){return _0x3a7d86[_0xeaae('0x1a')](_0x33d335);}return _0x3a7d86['status'](_0x33d335)[_0xeaae('0x1b')]();};}function respondWithResult(_0x1aadc8,_0x415a90){_0x415a90=_0x415a90||0xc8;return function(_0x35a31d){if(_0x35a31d){return _0x1aadc8[_0xeaae('0x1c')](_0x415a90)[_0xeaae('0x1d')](_0x35a31d);}};}function respondWithFilteredResult(_0x2df25d,_0xb8269e){return function(_0x236e00){if(_0x236e00){var _0x39bada=typeof _0xb8269e[_0xeaae('0x1e')]===_0xeaae('0x1f')&&typeof _0xb8269e[_0xeaae('0x20')]==='undefined';var _0x32ec1e=_0x236e00['count'];var _0x3ace1f=_0x39bada?0x0:_0xb8269e[_0xeaae('0x1e')];var _0x2b4fd3=_0x39bada?_0x236e00[_0xeaae('0x21')]:_0xb8269e[_0xeaae('0x1e')]+_0xb8269e[_0xeaae('0x20')];var _0xeb2ecf;if(_0x2b4fd3>=_0x32ec1e){_0x2b4fd3=_0x32ec1e;_0xeb2ecf=0xc8;}else{_0xeb2ecf=0xce;}_0x2df25d['status'](_0xeb2ecf);return _0x2df25d[_0xeaae('0x22')](_0xeaae('0x23'),_0x3ace1f+'-'+_0x2b4fd3+'/'+_0x32ec1e)[_0xeaae('0x1d')](_0x236e00);}return null;};}function patchUpdates(_0x5ced54){return function(_0x318486){try{jsonpatch[_0xeaae('0x24')](_0x318486,_0x5ced54,!![]);}catch(_0x57f8f9){return BPromise[_0xeaae('0x25')](_0x57f8f9);}return _0x318486[_0xeaae('0x26')]();};}function saveUpdates(_0x4cfe90,_0x3da7c3){return function(_0x5b69c1){if(_0x5b69c1){return _0x5b69c1[_0xeaae('0x27')](_0x4cfe90)[_0xeaae('0x28')](function(_0x2b7b6f){return _0x2b7b6f;});}return null;};}function removeEntity(_0x1203e2,_0x5970df){return function(_0x445b35){if(_0x445b35){return _0x445b35[_0xeaae('0x29')]()[_0xeaae('0x28')](function(){_0x1203e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4129ed,_0x305c15){return function(_0x2d0ff4){if(!_0x2d0ff4){_0x4129ed[_0xeaae('0x1a')](0x194);}return _0x2d0ff4;};}function handleError(_0xc8a233,_0x534520){_0x534520=_0x534520||0x1f4;return function(_0x162311){logger[_0xeaae('0x2a')](_0x162311['stack']);if(_0x162311[_0xeaae('0x2b')]){delete _0x162311[_0xeaae('0x2b')];}_0xc8a233[_0xeaae('0x1c')](_0x534520)[_0xeaae('0x2c')](_0x162311);};}exports['index']=function(_0x3ec714,_0x135dc3){var _0x3e1fb1={},_0x4db82c={},_0x14fce9={'count':0x0,'rows':[]};var _0x2b95b0=_[_0xeaae('0x2d')](db[_0xeaae('0x2e')][_0xeaae('0x2f')],function(_0x47f796){return{'name':_0x47f796[_0xeaae('0x30')],'type':_0x47f796[_0xeaae('0x31')]['key']};});_0x4db82c[_0xeaae('0x32')]=_['map'](_0x2b95b0,_0xeaae('0x2b'));_0x4db82c['query']=_[_0xeaae('0x33')](_0x3ec714[_0xeaae('0x34')]);_0x4db82c['filters']=_[_0xeaae('0x35')](_0x4db82c[_0xeaae('0x32')],_0x4db82c[_0xeaae('0x34')]);_0x3e1fb1[_0xeaae('0x36')]=_['intersection'](_0x4db82c[_0xeaae('0x32')],qs[_0xeaae('0x37')](_0x3ec714['query']['fields']));_0x3e1fb1[_0xeaae('0x36')]=_0x3e1fb1[_0xeaae('0x36')][_0xeaae('0x38')]?_0x3e1fb1['attributes']:_0x4db82c[_0xeaae('0x32')];if(!_0x3ec714[_0xeaae('0x34')][_0xeaae('0x39')](_0xeaae('0x3a'))){_0x3e1fb1[_0xeaae('0x20')]=qs[_0xeaae('0x20')](_0x3ec714['query'][_0xeaae('0x20')]);_0x3e1fb1['offset']=qs[_0xeaae('0x1e')](_0x3ec714[_0xeaae('0x34')]['offset']);}_0x3e1fb1[_0xeaae('0x3b')]=qs[_0xeaae('0x3c')](_0x3ec714[_0xeaae('0x34')]['sort']);_0x3e1fb1[_0xeaae('0x3d')]=qs[_0xeaae('0x3e')](_[_0xeaae('0x3f')](_0x3ec714[_0xeaae('0x34')],_0x4db82c[_0xeaae('0x3e')]),_0x2b95b0);if(_0x3ec714[_0xeaae('0x34')][_0xeaae('0x40')]){_0x3e1fb1['where']=_[_0xeaae('0x41')](_0x3e1fb1[_0xeaae('0x3d')],{'$or':_[_0xeaae('0x2d')](_0x2b95b0,function(_0x43b7f1){if(_0x43b7f1[_0xeaae('0x31')]!==_0xeaae('0x42')){var _0x5e1dff={};_0x5e1dff[_0x43b7f1['name']]={'$like':'%'+_0x3ec714[_0xeaae('0x34')][_0xeaae('0x40')]+'%'};return _0x5e1dff;}})});}_0x3e1fb1=_[_0xeaae('0x41')]({},_0x3e1fb1,_0x3ec714[_0xeaae('0x43')]);var _0x13ef63={'where':_0x3e1fb1[_0xeaae('0x3d')]};return db[_0xeaae('0x2e')][_0xeaae('0x21')](_0x13ef63)[_0xeaae('0x28')](function(_0x52ae4c){_0x14fce9[_0xeaae('0x21')]=_0x52ae4c;if(_0x3ec714['query'][_0xeaae('0x44')]){_0x3e1fb1[_0xeaae('0x45')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x3e1fb1);})[_0xeaae('0x28')](function(_0x3411d5){_0x14fce9['rows']=_0x3411d5;return _0x14fce9;})['then'](respondWithFilteredResult(_0x135dc3,_0x3e1fb1))[_0xeaae('0x46')](handleError(_0x135dc3,null));};exports[_0xeaae('0x47')]=function(_0x3fff07,_0x2b8ba8){var _0x1a9556={'raw':!![],'where':{'id':_0x3fff07['params']['id']}},_0x6d5547={};_0x6d5547[_0xeaae('0x32')]=_['keys'](db[_0xeaae('0x2e')][_0xeaae('0x2f')]);_0x6d5547[_0xeaae('0x34')]=_[_0xeaae('0x33')](_0x3fff07['query']);_0x6d5547[_0xeaae('0x3e')]=_[_0xeaae('0x35')](_0x6d5547['model'],_0x6d5547['query']);_0x1a9556['attributes']=_['intersection'](_0x6d5547['model'],qs[_0xeaae('0x37')](_0x3fff07[_0xeaae('0x34')][_0xeaae('0x37')]));_0x1a9556['attributes']=_0x1a9556['attributes'][_0xeaae('0x38')]?_0x1a9556[_0xeaae('0x36')]:_0x6d5547[_0xeaae('0x32')];if(_0x3fff07[_0xeaae('0x34')][_0xeaae('0x44')]){_0x1a9556[_0xeaae('0x45')]=[{'all':!![]}];}_0x1a9556=_[_0xeaae('0x41')]({},_0x1a9556,_0x3fff07[_0xeaae('0x43')]);return db[_0xeaae('0x2e')][_0xeaae('0x48')](_0x1a9556)[_0xeaae('0x28')](handleEntityNotFound(_0x2b8ba8,null))[_0xeaae('0x28')](respondWithResult(_0x2b8ba8,null))['catch'](handleError(_0x2b8ba8,null));};exports[_0xeaae('0x49')]=function(_0x83e558,_0x3e1819){return db[_0xeaae('0x2e')][_0xeaae('0x49')](_0x83e558['body'],{})[_0xeaae('0x28')](respondWithResult(_0x3e1819,0xc9))[_0xeaae('0x46')](handleError(_0x3e1819,null));};exports[_0xeaae('0x27')]=function(_0x6b0fd6,_0x293de8){if(_0x6b0fd6[_0xeaae('0x4a')]['id']){delete _0x6b0fd6[_0xeaae('0x4a')]['id'];}return db['DeskField'][_0xeaae('0x48')]({'where':{'id':_0x6b0fd6[_0xeaae('0x4b')]['id']}})['then'](handleEntityNotFound(_0x293de8,null))['then'](saveUpdates(_0x6b0fd6[_0xeaae('0x4a')],null))['then'](respondWithResult(_0x293de8,null))[_0xeaae('0x46')](handleError(_0x293de8,null));};exports['destroy']=function(_0x15e933,_0x29b244){return db[_0xeaae('0x2e')][_0xeaae('0x48')]({'where':{'id':_0x15e933[_0xeaae('0x4b')]['id']}})[_0xeaae('0x28')](handleEntityNotFound(_0x29b244,null))[_0xeaae('0x28')](removeEntity(_0x29b244,null))[_0xeaae('0x46')](handleError(_0x29b244,null));};
\ No newline at end of file
+var _0xf426=['where','pick','VIRTUAL','merge','includeAll','DeskField','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','update','then','destroy','end','sendStatus','error','stack','name','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf426,0x168));var _0x6f42=function(_0xaf52f9,_0x3608bc){_0xaf52f9=_0xaf52f9-0x0;var _0xd9e03e=_0xf426[_0xaf52f9];return _0xd9e03e;};'use strict';var emlformat=require(_0x6f42('0x0'));var rimraf=require(_0x6f42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f42('0x2'));var rp=require(_0x6f42('0x3'));var moment=require('moment');var BPromise=require(_0x6f42('0x4'));var Mustache=require(_0x6f42('0x5'));var util=require(_0x6f42('0x6'));var path=require(_0x6f42('0x7'));var sox=require(_0x6f42('0x8'));var csv=require(_0x6f42('0x9'));var ejs=require(_0x6f42('0xa'));var fs=require('fs');var fs_extra=require(_0x6f42('0xb'));var _=require(_0x6f42('0xc'));var squel=require('squel');var crypto=require(_0x6f42('0xd'));var jsforce=require(_0x6f42('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6f42('0x9'));var querystring=require(_0x6f42('0xf'));var Papa=require(_0x6f42('0x10'));var Redis=require(_0x6f42('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6f42('0x12'));var as=require(_0x6f42('0x13'));var hardwareService=require(_0x6f42('0x14'));var logger=require(_0x6f42('0x15'))(_0x6f42('0x16'));var utils=require(_0x6f42('0x17'));var config=require(_0x6f42('0x18'));var licenseUtil=require(_0x6f42('0x19'));var db=require(_0x6f42('0x1a'))['db'];function respondWithStatusCode(_0x577ee8,_0x3415b0){_0x3415b0=_0x3415b0||0xcc;return function(_0x2c7897){if(_0x2c7897){return _0x577ee8['sendStatus'](_0x3415b0);}return _0x577ee8[_0x6f42('0x1b')](_0x3415b0)['end']();};}function respondWithResult(_0x5d3d48,_0x3ce5ed){_0x3ce5ed=_0x3ce5ed||0xc8;return function(_0x278f61){if(_0x278f61){return _0x5d3d48[_0x6f42('0x1b')](_0x3ce5ed)[_0x6f42('0x1c')](_0x278f61);}};}function respondWithFilteredResult(_0x38d7ea,_0x273fca){return function(_0x2856ce){if(_0x2856ce){var _0x2f4722=typeof _0x273fca[_0x6f42('0x1d')]===_0x6f42('0x1e')&&typeof _0x273fca[_0x6f42('0x1f')]===_0x6f42('0x1e');var _0xe8a0bf=_0x2856ce[_0x6f42('0x20')];var _0x4fc4e7=_0x2f4722?0x0:_0x273fca[_0x6f42('0x1d')];var _0x1db6d0=_0x2f4722?_0x2856ce[_0x6f42('0x20')]:_0x273fca[_0x6f42('0x1d')]+_0x273fca[_0x6f42('0x1f')];var _0x2765dc;if(_0x1db6d0>=_0xe8a0bf){_0x1db6d0=_0xe8a0bf;_0x2765dc=0xc8;}else{_0x2765dc=0xce;}_0x38d7ea['status'](_0x2765dc);return _0x38d7ea['set']('Content-Range',_0x4fc4e7+'-'+_0x1db6d0+'/'+_0xe8a0bf)[_0x6f42('0x1c')](_0x2856ce);}return null;};}function patchUpdates(_0x346884){return function(_0x42d158){try{jsonpatch['apply'](_0x42d158,_0x346884,!![]);}catch(_0x5cb3e7){return BPromise['reject'](_0x5cb3e7);}return _0x42d158['save']();};}function saveUpdates(_0x379f60,_0x2e9f37){return function(_0x18be2f){if(_0x18be2f){return _0x18be2f[_0x6f42('0x21')](_0x379f60)[_0x6f42('0x22')](function(_0x12135c){return _0x12135c;});}return null;};}function removeEntity(_0x48837b,_0x3c8bc3){return function(_0x317818){if(_0x317818){return _0x317818[_0x6f42('0x23')]()[_0x6f42('0x22')](function(){_0x48837b[_0x6f42('0x1b')](0xcc)[_0x6f42('0x24')]();});}};}function handleEntityNotFound(_0x52f3f8,_0x486519){return function(_0x4dfdbf){if(!_0x4dfdbf){_0x52f3f8[_0x6f42('0x25')](0x194);}return _0x4dfdbf;};}function handleError(_0x3a2d42,_0x2a88cd){_0x2a88cd=_0x2a88cd||0x1f4;return function(_0x397742){logger[_0x6f42('0x26')](_0x397742[_0x6f42('0x27')]);if(_0x397742['name']){delete _0x397742[_0x6f42('0x28')];}_0x3a2d42[_0x6f42('0x1b')](_0x2a88cd)['send'](_0x397742);};}exports['index']=function(_0x32e6a6,_0x1a77a7){var _0x22fe3d={},_0x56dc33={},_0x548381={'count':0x0,'rows':[]};var _0x26069e=_['map'](db['DeskField'][_0x6f42('0x29')],function(_0x2e0d7e){return{'name':_0x2e0d7e['fieldName'],'type':_0x2e0d7e[_0x6f42('0x2a')][_0x6f42('0x2b')]};});_0x56dc33[_0x6f42('0x2c')]=_['map'](_0x26069e,'name');_0x56dc33['query']=_[_0x6f42('0x2d')](_0x32e6a6[_0x6f42('0x2e')]);_0x56dc33[_0x6f42('0x2f')]=_[_0x6f42('0x30')](_0x56dc33[_0x6f42('0x2c')],_0x56dc33['query']);_0x22fe3d['attributes']=_[_0x6f42('0x30')](_0x56dc33['model'],qs['fields'](_0x32e6a6[_0x6f42('0x2e')][_0x6f42('0x31')]));_0x22fe3d[_0x6f42('0x32')]=_0x22fe3d[_0x6f42('0x32')][_0x6f42('0x33')]?_0x22fe3d['attributes']:_0x56dc33[_0x6f42('0x2c')];if(!_0x32e6a6[_0x6f42('0x2e')]['hasOwnProperty'](_0x6f42('0x34'))){_0x22fe3d[_0x6f42('0x1f')]=qs['limit'](_0x32e6a6[_0x6f42('0x2e')]['limit']);_0x22fe3d[_0x6f42('0x1d')]=qs[_0x6f42('0x1d')](_0x32e6a6[_0x6f42('0x2e')]['offset']);}_0x22fe3d['order']=qs[_0x6f42('0x35')](_0x32e6a6[_0x6f42('0x2e')][_0x6f42('0x35')]);_0x22fe3d[_0x6f42('0x36')]=qs[_0x6f42('0x2f')](_[_0x6f42('0x37')](_0x32e6a6[_0x6f42('0x2e')],_0x56dc33[_0x6f42('0x2f')]),_0x26069e);if(_0x32e6a6['query']['filter']){_0x22fe3d[_0x6f42('0x36')]=_['merge'](_0x22fe3d[_0x6f42('0x36')],{'$or':_['map'](_0x26069e,function(_0x5b1c31){if(_0x5b1c31[_0x6f42('0x2a')]!==_0x6f42('0x38')){var _0x5b9ab8={};_0x5b9ab8[_0x5b1c31[_0x6f42('0x28')]]={'$like':'%'+_0x32e6a6[_0x6f42('0x2e')]['filter']+'%'};return _0x5b9ab8;}})});}_0x22fe3d=_[_0x6f42('0x39')]({},_0x22fe3d,_0x32e6a6['options']);var _0x124f90={'where':_0x22fe3d[_0x6f42('0x36')]};return db['DeskField'][_0x6f42('0x20')](_0x124f90)['then'](function(_0x311849){_0x548381[_0x6f42('0x20')]=_0x311849;if(_0x32e6a6['query'][_0x6f42('0x3a')]){_0x22fe3d['include']=[{'all':!![]}];}return db[_0x6f42('0x3b')][_0x6f42('0x3c')](_0x22fe3d);})[_0x6f42('0x22')](function(_0xd610c8){_0x548381[_0x6f42('0x3d')]=_0xd610c8;return _0x548381;})[_0x6f42('0x22')](respondWithFilteredResult(_0x1a77a7,_0x22fe3d))[_0x6f42('0x3e')](handleError(_0x1a77a7,null));};exports[_0x6f42('0x3f')]=function(_0x55956f,_0x11a392){var _0x437eb7={'raw':!![],'where':{'id':_0x55956f[_0x6f42('0x40')]['id']}},_0x7ec6c1={};_0x7ec6c1[_0x6f42('0x2c')]=_['keys'](db[_0x6f42('0x3b')][_0x6f42('0x29')]);_0x7ec6c1['query']=_['keys'](_0x55956f[_0x6f42('0x2e')]);_0x7ec6c1['filters']=_[_0x6f42('0x30')](_0x7ec6c1[_0x6f42('0x2c')],_0x7ec6c1['query']);_0x437eb7[_0x6f42('0x32')]=_[_0x6f42('0x30')](_0x7ec6c1['model'],qs[_0x6f42('0x31')](_0x55956f[_0x6f42('0x2e')][_0x6f42('0x31')]));_0x437eb7['attributes']=_0x437eb7['attributes'][_0x6f42('0x33')]?_0x437eb7[_0x6f42('0x32')]:_0x7ec6c1[_0x6f42('0x2c')];if(_0x55956f[_0x6f42('0x2e')][_0x6f42('0x3a')]){_0x437eb7['include']=[{'all':!![]}];}_0x437eb7=_[_0x6f42('0x39')]({},_0x437eb7,_0x55956f[_0x6f42('0x41')]);return db[_0x6f42('0x3b')][_0x6f42('0x42')](_0x437eb7)[_0x6f42('0x22')](handleEntityNotFound(_0x11a392,null))[_0x6f42('0x22')](respondWithResult(_0x11a392,null))[_0x6f42('0x3e')](handleError(_0x11a392,null));};exports[_0x6f42('0x43')]=function(_0x467ab2,_0x2b09a1){return db[_0x6f42('0x3b')]['create'](_0x467ab2['body'],{})[_0x6f42('0x22')](respondWithResult(_0x2b09a1,0xc9))[_0x6f42('0x3e')](handleError(_0x2b09a1,null));};exports[_0x6f42('0x21')]=function(_0x5ac976,_0x52bed3){if(_0x5ac976[_0x6f42('0x44')]['id']){delete _0x5ac976[_0x6f42('0x44')]['id'];}return db[_0x6f42('0x3b')]['find']({'where':{'id':_0x5ac976[_0x6f42('0x40')]['id']}})[_0x6f42('0x22')](handleEntityNotFound(_0x52bed3,null))[_0x6f42('0x22')](saveUpdates(_0x5ac976['body'],null))[_0x6f42('0x22')](respondWithResult(_0x52bed3,null))['catch'](handleError(_0x52bed3,null));};exports['destroy']=function(_0x22da22,_0x3e7664){return db['DeskField'][_0x6f42('0x42')]({'where':{'id':_0x22da22[_0x6f42('0x40')]['id']}})[_0x6f42('0x22')](handleEntityNotFound(_0x3e7664,null))[_0x6f42('0x22')](removeEntity(_0x3e7664,null))[_0x6f42('0x3e')](handleError(_0x3e7664,null));};
\ No newline at end of file
index 9c92d53..e98f18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1670=['util','moment','bluebird','request-promise','path','../../config/environment','exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId'];(function(_0x1c1564,_0x9bca63){var _0x1f72c0=function(_0x293b6c){while(--_0x293b6c){_0x1c1564['push'](_0x1c1564['shift']());}};_0x1f72c0(++_0x9bca63);}(_0x1670,0x180));var _0x0167=function(_0x1f5ab3,_0x2d2473){_0x1f5ab3=_0x1f5ab3-0x0;var _0x2bd0d7=_0x1670[_0x1f5ab3];return _0x2bd0d7;};'use strict';var _=require('lodash');var util=require(_0x0167('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0167('0x1'));var BPromise=require(_0x0167('0x2'));var rp=require(_0x0167('0x3'));var fs=require('fs');var path=require(_0x0167('0x4'));var rimraf=require('rimraf');var config=require(_0x0167('0x5'));var attributes=require('./intDeskField.attributes');module[_0x0167('0x6')]=function(_0xa7fd60,_0xeb676e){return _0xa7fd60[_0x0167('0x7')](_0x0167('0x8'),attributes,{'tableName':_0x0167('0x9'),'paranoid':![],'indexes':[{'name':_0x0167('0xa'),'fields':['idField',_0x0167('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb94=['request-promise','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','idField','lodash','util','../../config/logger','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcb94,0x146));var _0x4cb9=function(_0x3da61c,_0x224cc5){_0x3da61c=_0x3da61c-0x0;var _0x44aa5e=_0xcb94[_0x3da61c];return _0x44aa5e;};'use strict';var _=require(_0x4cb9('0x0'));var util=require(_0x4cb9('0x1'));var logger=require(_0x4cb9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4cb9('0x3'));var rp=require(_0x4cb9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4cb9('0x5'));var attributes=require(_0x4cb9('0x6'));module[_0x4cb9('0x7')]=function(_0x2e32ea,_0x27817a){return _0x2e32ea['define'](_0x4cb9('0x8'),attributes,{'tableName':_0x4cb9('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x4cb9('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 655a682..3e21513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c7f=['jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1a05f0,_0x4befcf){var _0x36a9d7=function(_0x4cab0d){while(--_0x4cab0d){_0x1a05f0['push'](_0x1a05f0['shift']());}};_0x36a9d7(++_0x4befcf);}(_0x6c7f,0x131));var _0xf6c7=function(_0x2905dc,_0x5321a7){_0x2905dc=_0x2905dc-0x0;var _0x41513e=_0x6c7f[_0x2905dc];return _0x41513e;};'use strict';var _=require(_0xf6c7('0x0'));var util=require(_0xf6c7('0x1'));var moment=require(_0xf6c7('0x2'));var BPromise=require(_0xf6c7('0x3'));var rs=require(_0xf6c7('0x4'));var fs=require('fs');var Redis=require(_0xf6c7('0x5'));var db=require(_0xf6c7('0x6'))['db'];var utils=require(_0xf6c7('0x7'));var logger=require('../../config/logger')(_0xf6c7('0x8'));var config=require(_0xf6c7('0x9'));var jayson=require(_0xf6c7('0xa'));var client=jayson[_0xf6c7('0xb')][_0xf6c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35c67c,_0x51ca7f,_0x5254ad){return new BPromise(function(_0x1a79ea,_0x15e316){return client['request'](_0x35c67c,_0x5254ad)[_0xf6c7('0xd')](function(_0x508456){logger[_0xf6c7('0xe')](_0xf6c7('0xf'),_0x51ca7f,_0xf6c7('0x10'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x51ca7f,'request\x20sent',JSON[_0xf6c7('0x11')](_0x508456));if(_0x508456[_0xf6c7('0x12')]){if(_0x508456[_0xf6c7('0x12')]['code']===0x1f4){logger['error'](_0xf6c7('0xf'),_0x51ca7f,_0x508456[_0xf6c7('0x12')]['message']);return _0x15e316(_0x508456[_0xf6c7('0x12')][_0xf6c7('0x13')]);}logger['error'](_0xf6c7('0xf'),_0x51ca7f,_0x508456[_0xf6c7('0x12')][_0xf6c7('0x13')]);return _0x1a79ea(_0x508456[_0xf6c7('0x12')]['message']);}else{logger[_0xf6c7('0xe')](_0xf6c7('0xf'),_0x51ca7f,'request\x20sent');_0x1a79ea(_0x508456['result'][_0xf6c7('0x13')]);}})[_0xf6c7('0x14')](function(_0x12fb6d){logger[_0xf6c7('0x12')](_0xf6c7('0xf'),_0x51ca7f,_0x12fb6d);_0x15e316(_0x12fb6d);});});}
\ No newline at end of file
+var _0x9563=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x18dfea,_0x43d571){var _0x5222e3=function(_0x3484ae){while(--_0x3484ae){_0x18dfea['push'](_0x18dfea['shift']());}};_0x5222e3(++_0x43d571);}(_0x9563,0xb5));var _0x3956=function(_0x4c8ba3,_0x597132){_0x4c8ba3=_0x4c8ba3-0x0;var _0x3aca65=_0x9563[_0x4c8ba3];return _0x3aca65;};'use strict';var _=require(_0x3956('0x0'));var util=require('util');var moment=require(_0x3956('0x1'));var BPromise=require(_0x3956('0x2'));var rs=require(_0x3956('0x3'));var fs=require('fs');var Redis=require(_0x3956('0x4'));var db=require(_0x3956('0x5'))['db'];var utils=require(_0x3956('0x6'));var logger=require('../../config/logger')(_0x3956('0x7'));var config=require(_0x3956('0x8'));var jayson=require(_0x3956('0x9'));var client=jayson['client'][_0x3956('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cb03f,_0x4e7241,_0xbc7bcf){return new BPromise(function(_0x3a9dd7,_0x3d71eb){return client[_0x3956('0xb')](_0x5cb03f,_0xbc7bcf)[_0x3956('0xc')](function(_0x243b3a){logger[_0x3956('0xd')](_0x3956('0xe'),_0x4e7241,_0x3956('0xf'));logger[_0x3956('0x10')](_0x3956('0x11'),_0x4e7241,'request\x20sent',JSON[_0x3956('0x12')](_0x243b3a));if(_0x243b3a['error']){if(_0x243b3a[_0x3956('0x13')][_0x3956('0x14')]===0x1f4){logger[_0x3956('0x13')](_0x3956('0xe'),_0x4e7241,_0x243b3a[_0x3956('0x13')][_0x3956('0x15')]);return _0x3d71eb(_0x243b3a[_0x3956('0x13')][_0x3956('0x15')]);}logger[_0x3956('0x13')]('DeskField,\x20%s,\x20%s',_0x4e7241,_0x243b3a['error'][_0x3956('0x15')]);return _0x3a9dd7(_0x243b3a['error'][_0x3956('0x15')]);}else{logger[_0x3956('0xd')]('DeskField,\x20%s,\x20%s',_0x4e7241,_0x3956('0xf'));_0x3a9dd7(_0x243b3a['result'][_0x3956('0x15')]);}})['catch'](function(_0x3523e8){logger[_0x3956('0x13')](_0x3956('0xe'),_0x4e7241,_0x3523e8);_0x3d71eb(_0x3523e8);});});}
\ No newline at end of file
index 02a9aa7..a1a72e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c1=['express','fs-extra','../../components/auth/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','update','delete','destroy','exports','util','path'];(function(_0x49f7f0,_0x1249c7){var _0x2d9d1b=function(_0x4a59b2){while(--_0x4a59b2){_0x49f7f0['push'](_0x49f7f0['shift']());}};_0x2d9d1b(++_0x1249c7);}(_0x47c1,0x1f2));var _0x147c=function(_0x2e5418,_0x5b4baa){_0x2e5418=_0x2e5418-0x0;var _0x54ceb4=_0x47c1[_0x2e5418];return _0x54ceb4;};'use strict';var multer=require('multer');var util=require(_0x147c('0x0'));var path=require(_0x147c('0x1'));var timeout=require('connect-timeout');var express=require(_0x147c('0x2'));var router=express['Router']();var fs_extra=require(_0x147c('0x3'));var auth=require(_0x147c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x147c('0x5'));router[_0x147c('0x6')]('/',auth[_0x147c('0x7')](),controller[_0x147c('0x8')]);router[_0x147c('0x6')](_0x147c('0x9'),auth[_0x147c('0x7')](),controller[_0x147c('0xa')]);router[_0x147c('0x6')](_0x147c('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x147c('0x6')](_0x147c('0xc'),auth[_0x147c('0x7')](),controller[_0x147c('0xd')]);router['post']('/',auth[_0x147c('0x7')](),controller[_0x147c('0xe')]);router[_0x147c('0xf')](_0x147c('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x147c('0x9'),auth[_0x147c('0x7')](),controller[_0x147c('0x10')]);router[_0x147c('0x11')](_0x147c('0x9'),auth['isAuthenticated'](),controller[_0x147c('0x12')]);module[_0x147c('0x13')]=router;
\ No newline at end of file
+var _0xf1c1=['get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','/:id','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xf1c1,0xb4));var _0x1f1c=function(_0x29622b,_0x44d6b8){_0x29622b=_0x29622b-0x0;var _0x252568=_0xf1c1[_0x29622b];return _0x252568;};'use strict';var multer=require(_0x1f1c('0x0'));var util=require(_0x1f1c('0x1'));var path=require('path');var timeout=require(_0x1f1c('0x2'));var express=require(_0x1f1c('0x3'));var router=express[_0x1f1c('0x4')]();var fs_extra=require(_0x1f1c('0x5'));var auth=require(_0x1f1c('0x6'));var interaction=require(_0x1f1c('0x7'));var config=require('../../config/environment');var controller=require(_0x1f1c('0x8'));router[_0x1f1c('0x9')]('/',auth[_0x1f1c('0xa')](),controller[_0x1f1c('0xb')]);router[_0x1f1c('0x9')]('/:id',auth[_0x1f1c('0xa')](),controller[_0x1f1c('0xc')]);router['get'](_0x1f1c('0xd'),auth[_0x1f1c('0xa')](),controller[_0x1f1c('0xe')]);router[_0x1f1c('0x9')](_0x1f1c('0xf'),auth[_0x1f1c('0xa')](),controller['getFields']);router['post']('/',auth[_0x1f1c('0xa')](),controller['create']);router[_0x1f1c('0x10')]('/:id/configurations',auth[_0x1f1c('0xa')](),controller[_0x1f1c('0x11')]);router['put'](_0x1f1c('0x12'),auth[_0x1f1c('0xa')](),controller['update']);router[_0x1f1c('0x13')]('/:id',auth[_0x1f1c('0xa')](),controller[_0x1f1c('0x14')]);module['exports']=router;
\ No newline at end of file
index a194dbc..356d1bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc434=['sequelize','exports','STRING'];(function(_0xce94e3,_0x112f55){var _0x347f05=function(_0xf8f9ba){while(--_0xf8f9ba){_0xce94e3['push'](_0xce94e3['shift']());}};_0x347f05(++_0x112f55);}(_0xc434,0x16b));var _0x4c43=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xc434[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x4c43('0x0'));module[_0x4c43('0x1')]={'name':{'type':Sequelize[_0x4c43('0x2')]},'username':{'type':Sequelize[_0x4c43('0x2')]},'password':{'type':Sequelize[_0x4c43('0x2')]},'remoteUri':{'type':Sequelize[_0x4c43('0x2')]},'tenantId':{'type':Sequelize[_0x4c43('0x2')]},'clientId':{'type':Sequelize[_0x4c43('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x4c43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4c43('0x2')]}};
\ No newline at end of file
+var _0xb910=['sequelize','STRING'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xb910,0x1b2));var _0x0b91=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb910[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x0b91('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b91('0x1')]},'username':{'type':Sequelize[_0x0b91('0x1')]},'password':{'type':Sequelize[_0x0b91('0x1')]},'remoteUri':{'type':Sequelize[_0x0b91('0x1')]},'tenantId':{'type':Sequelize[_0x0b91('0x1')]},'clientId':{'type':Sequelize[_0x0b91('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x0b91('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x0b91('0x1')]}};
\ No newline at end of file
index 7dc8495..0d6287c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e6=['moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','type','Dynamics365Account','includeAll','include','findAll','rows','show','params','keys','rawAttributes','fields','options','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','pick','filter','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','Subjects','Dynamics365Field','ticketType','incident','title','description','customerid','ownerid','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridtype','owneridyominame','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','/oauth2/token','password','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','remove','includes','forEach','@odata.type','push','isNil','all','StringAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','UserLocalizedLabel','Label','Value','LogicalName','DisplayName','OptionSet','TrueOption','true','FalseOption','false',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','zip-dir','request-promise'];(function(_0x54cfcf,_0x3ecf5b){var _0x1c2060=function(_0x484a41){while(--_0x484a41){_0x54cfcf['push'](_0x54cfcf['shift']());}};_0x1c2060(++_0x3ecf5b);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x3d9564,_0x1463d6){_0x3d9564=_0x3d9564-0x0;var _0xc1202e=_0xa3e6[_0x3d9564];return _0xc1202e;};'use strict';var emlformat=require(_0x6a3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a3e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a3e('0x2'));var moment=require(_0x6a3e('0x3'));var BPromise=require(_0x6a3e('0x4'));var Mustache=require('mustache');var util=require(_0x6a3e('0x5'));var path=require('path');var sox=require(_0x6a3e('0x6'));var csv=require(_0x6a3e('0x7'));var ejs=require(_0x6a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x6a3e('0x9'));var _=require(_0x6a3e('0xa'));var squel=require('squel');var crypto=require(_0x6a3e('0xb'));var jsforce=require(_0x6a3e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a3e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6a3e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6a3e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6a3e('0x10'))(_0x6a3e('0x11'));var utils=require(_0x6a3e('0x12'));var config=require(_0x6a3e('0x13'));var licenseUtil=require(_0x6a3e('0x14'));var db=require(_0x6a3e('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x27e169,_0x385c29){_0x385c29=_0x385c29||0xcc;return function(_0x1a1893){if(_0x1a1893){return _0x27e169[_0x6a3e('0x16')](_0x385c29);}return _0x27e169[_0x6a3e('0x17')](_0x385c29)[_0x6a3e('0x18')]();};}function respondWithResult(_0x222f7c,_0x4bd05f){_0x4bd05f=_0x4bd05f||0xc8;return function(_0x2e911b){if(_0x2e911b){return _0x222f7c[_0x6a3e('0x17')](_0x4bd05f)[_0x6a3e('0x19')](_0x2e911b);}};}function respondWithFilteredResult(_0x2a62a8,_0x500ccd){return function(_0x462b8d){if(_0x462b8d){var _0x24666d=typeof _0x500ccd['offset']==='undefined'&&typeof _0x500ccd['limit']==='undefined';var _0x48adf6=_0x462b8d[_0x6a3e('0x1a')];var _0x467e2c=_0x24666d?0x0:_0x500ccd[_0x6a3e('0x1b')];var _0x701d04=_0x24666d?_0x462b8d[_0x6a3e('0x1a')]:_0x500ccd[_0x6a3e('0x1b')]+_0x500ccd[_0x6a3e('0x1c')];var _0x2f2150;if(_0x701d04>=_0x48adf6){_0x701d04=_0x48adf6;_0x2f2150=0xc8;}else{_0x2f2150=0xce;}_0x2a62a8['status'](_0x2f2150);return _0x2a62a8[_0x6a3e('0x1d')]('Content-Range',_0x467e2c+'-'+_0x701d04+'/'+_0x48adf6)[_0x6a3e('0x19')](_0x462b8d);}return null;};}function patchUpdates(_0x5ae73b){return function(_0x16c5e4){try{jsonpatch[_0x6a3e('0x1e')](_0x16c5e4,_0x5ae73b,!![]);}catch(_0x6fd39a){return BPromise[_0x6a3e('0x1f')](_0x6fd39a);}return _0x16c5e4['save']();};}function saveUpdates(_0x4f7507,_0x215ac1){return function(_0x2d811f){if(_0x2d811f){return _0x2d811f[_0x6a3e('0x20')](_0x4f7507)[_0x6a3e('0x21')](function(_0x4e5a25){return _0x4e5a25;});}return null;};}function removeEntity(_0x1ae966,_0x21b5aa){return function(_0x4436ac){if(_0x4436ac){return _0x4436ac[_0x6a3e('0x22')]()[_0x6a3e('0x21')](function(){_0x1ae966[_0x6a3e('0x17')](0xcc)[_0x6a3e('0x18')]();});}};}function handleEntityNotFound(_0x83e681,_0x25fc14){return function(_0x18de92){if(!_0x18de92){_0x83e681['sendStatus'](0x194);}return _0x18de92;};}function handleError(_0x4ec834,_0x150992){_0x150992=_0x150992||0x1f4;return function(_0x6cc7c4){logger[_0x6a3e('0x23')](_0x6cc7c4[_0x6a3e('0x24')]);if(_0x6cc7c4[_0x6a3e('0x25')]){delete _0x6cc7c4[_0x6a3e('0x25')];}_0x4ec834[_0x6a3e('0x17')](_0x150992)[_0x6a3e('0x26')](_0x6cc7c4);};}exports[_0x6a3e('0x27')]=function(_0x436169,_0x3a831b){var _0x508a55={},_0x4eec67={},_0x2a2b2a={'count':0x0,'rows':[]};var _0x4cda7d=_[_0x6a3e('0x28')](db['Dynamics365Account']['rawAttributes'],function(_0x1c0f4b){return{'name':_0x1c0f4b[_0x6a3e('0x29')],'type':_0x1c0f4b['type']['key']};});_0x4eec67[_0x6a3e('0x2a')]=_[_0x6a3e('0x28')](_0x4cda7d,_0x6a3e('0x25'));_0x4eec67[_0x6a3e('0x2b')]=_['keys'](_0x436169['query']);_0x4eec67[_0x6a3e('0x2c')]=_[_0x6a3e('0x2d')](_0x4eec67[_0x6a3e('0x2a')],_0x4eec67[_0x6a3e('0x2b')]);_0x508a55['attributes']=_[_0x6a3e('0x2d')](_0x4eec67[_0x6a3e('0x2a')],qs['fields'](_0x436169['query']['fields']));_0x508a55[_0x6a3e('0x2e')]=_0x508a55[_0x6a3e('0x2e')][_0x6a3e('0x2f')]?_0x508a55[_0x6a3e('0x2e')]:_0x4eec67[_0x6a3e('0x2a')];if(!_0x436169[_0x6a3e('0x2b')][_0x6a3e('0x30')](_0x6a3e('0x31'))){_0x508a55[_0x6a3e('0x1c')]=qs[_0x6a3e('0x1c')](_0x436169[_0x6a3e('0x2b')][_0x6a3e('0x1c')]);_0x508a55[_0x6a3e('0x1b')]=qs[_0x6a3e('0x1b')](_0x436169[_0x6a3e('0x2b')]['offset']);}_0x508a55[_0x6a3e('0x32')]=qs[_0x6a3e('0x33')](_0x436169[_0x6a3e('0x2b')]['sort']);_0x508a55[_0x6a3e('0x34')]=qs[_0x6a3e('0x2c')](_['pick'](_0x436169[_0x6a3e('0x2b')],_0x4eec67[_0x6a3e('0x2c')]),_0x4cda7d);if(_0x436169[_0x6a3e('0x2b')]['filter']){_0x508a55[_0x6a3e('0x34')]=_[_0x6a3e('0x35')](_0x508a55[_0x6a3e('0x34')],{'$or':_[_0x6a3e('0x28')](_0x4cda7d,function(_0x18a50f){if(_0x18a50f[_0x6a3e('0x36')]!=='VIRTUAL'){var _0x3931c3={};_0x3931c3[_0x18a50f['name']]={'$like':'%'+_0x436169['query']['filter']+'%'};return _0x3931c3;}})});}_0x508a55=_[_0x6a3e('0x35')]({},_0x508a55,_0x436169['options']);var _0x1a6b68={'where':_0x508a55[_0x6a3e('0x34')]};return db[_0x6a3e('0x37')][_0x6a3e('0x1a')](_0x1a6b68)[_0x6a3e('0x21')](function(_0x36944d){_0x2a2b2a['count']=_0x36944d;if(_0x436169['query'][_0x6a3e('0x38')]){_0x508a55[_0x6a3e('0x39')]=[{'all':!![]}];}return db[_0x6a3e('0x37')][_0x6a3e('0x3a')](_0x508a55);})[_0x6a3e('0x21')](function(_0x57f40b){_0x2a2b2a[_0x6a3e('0x3b')]=_0x57f40b;return _0x2a2b2a;})[_0x6a3e('0x21')](respondWithFilteredResult(_0x3a831b,_0x508a55))['catch'](handleError(_0x3a831b,null));};exports[_0x6a3e('0x3c')]=function(_0x417f8a,_0x35c836){var _0x53ad48={'raw':![],'where':{'id':_0x417f8a[_0x6a3e('0x3d')]['id']}},_0xda81a4={};_0xda81a4[_0x6a3e('0x2a')]=_[_0x6a3e('0x3e')](db[_0x6a3e('0x37')][_0x6a3e('0x3f')]);_0xda81a4['query']=_[_0x6a3e('0x3e')](_0x417f8a[_0x6a3e('0x2b')]);_0xda81a4[_0x6a3e('0x2c')]=_['intersection'](_0xda81a4[_0x6a3e('0x2a')],_0xda81a4['query']);_0x53ad48['attributes']=_[_0x6a3e('0x2d')](_0xda81a4[_0x6a3e('0x2a')],qs[_0x6a3e('0x40')](_0x417f8a['query']['fields']));_0x53ad48[_0x6a3e('0x2e')]=_0x53ad48[_0x6a3e('0x2e')][_0x6a3e('0x2f')]?_0x53ad48[_0x6a3e('0x2e')]:_0xda81a4[_0x6a3e('0x2a')];if(_0x417f8a[_0x6a3e('0x2b')]['includeAll']){_0x53ad48[_0x6a3e('0x39')]=[{'all':!![]}];}_0x53ad48=_[_0x6a3e('0x35')]({},_0x53ad48,_0x417f8a[_0x6a3e('0x41')]);return db[_0x6a3e('0x37')][_0x6a3e('0x42')](_0x53ad48)[_0x6a3e('0x21')](handleEntityNotFound(_0x35c836,null))[_0x6a3e('0x21')](respondWithResult(_0x35c836,null))[_0x6a3e('0x43')](handleError(_0x35c836,null));};exports[_0x6a3e('0x44')]=function(_0x4d36e2,_0x40a09d){return db[_0x6a3e('0x37')]['create'](_0x4d36e2[_0x6a3e('0x45')],{})['then'](respondWithResult(_0x40a09d,0xc9))[_0x6a3e('0x43')](handleError(_0x40a09d,null));};exports[_0x6a3e('0x20')]=function(_0x28a3e9,_0x4f288d){if(_0x28a3e9[_0x6a3e('0x45')]['id']){delete _0x28a3e9[_0x6a3e('0x45')]['id'];}return db['Dynamics365Account']['find']({'where':{'id':_0x28a3e9['params']['id']}})[_0x6a3e('0x21')](handleEntityNotFound(_0x4f288d,null))[_0x6a3e('0x21')](saveUpdates(_0x28a3e9[_0x6a3e('0x45')],null))[_0x6a3e('0x21')](respondWithResult(_0x4f288d,null))[_0x6a3e('0x43')](handleError(_0x4f288d,null));};exports[_0x6a3e('0x22')]=function(_0x404473,_0x1ce964){return db[_0x6a3e('0x37')][_0x6a3e('0x42')]({'where':{'id':_0x404473[_0x6a3e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1ce964,null))[_0x6a3e('0x21')](removeEntity(_0x1ce964,null))[_0x6a3e('0x43')](handleError(_0x1ce964,null));};exports[_0x6a3e('0x46')]=function(_0x21ba7b,_0x23ea98,_0x4e7879){var _0x8e463={};var _0x4d1882={};var _0x1afa0a;var _0x37b0c8;return db[_0x6a3e('0x37')][_0x6a3e('0x47')]({'where':{'id':_0x21ba7b[_0x6a3e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x23ea98,null))['then'](function(_0x562bf9){if(_0x562bf9){_0x1afa0a=_0x562bf9;_0x4d1882[_0x6a3e('0x2a')]=_[_0x6a3e('0x3e')](db[_0x6a3e('0x48')][_0x6a3e('0x3f')]);_0x4d1882[_0x6a3e('0x2b')]=_[_0x6a3e('0x3e')](_0x21ba7b['query']);_0x4d1882[_0x6a3e('0x2c')]=_['intersection'](_0x4d1882['model'],_0x4d1882['query']);_0x8e463[_0x6a3e('0x2e')]=_[_0x6a3e('0x2d')](_0x4d1882['model'],qs[_0x6a3e('0x40')](_0x21ba7b[_0x6a3e('0x2b')]['fields']));_0x8e463[_0x6a3e('0x2e')]=_0x8e463[_0x6a3e('0x2e')][_0x6a3e('0x2f')]?_0x8e463[_0x6a3e('0x2e')]:_0x4d1882[_0x6a3e('0x2a')];_0x8e463['order']=qs[_0x6a3e('0x33')](_0x21ba7b[_0x6a3e('0x2b')]['sort']);_0x8e463[_0x6a3e('0x34')]=qs[_0x6a3e('0x2c')](_[_0x6a3e('0x49')](_0x21ba7b[_0x6a3e('0x2b')],_0x4d1882[_0x6a3e('0x2c')]));if(_0x21ba7b[_0x6a3e('0x2b')][_0x6a3e('0x4a')]){_0x8e463[_0x6a3e('0x34')]=_[_0x6a3e('0x35')](_0x8e463[_0x6a3e('0x34')],{'$or':_[_0x6a3e('0x28')](_0x8e463['attributes'],function(_0x2870be){var _0x2dcb70={};_0x2dcb70[_0x2870be]={'$like':'%'+_0x21ba7b[_0x6a3e('0x2b')]['filter']+'%'};return _0x2dcb70;})});}_0x8e463=_[_0x6a3e('0x35')]({},_0x8e463,_0x21ba7b[_0x6a3e('0x41')]);return _0x1afa0a[_0x6a3e('0x46')](_0x8e463);}})[_0x6a3e('0x21')](function(_0x582ad9){if(_0x582ad9){_0x37b0c8=_0x582ad9[_0x6a3e('0x2f')];if(!_0x21ba7b['query'][_0x6a3e('0x30')]('nolimit')){_0x8e463[_0x6a3e('0x1c')]=qs[_0x6a3e('0x1c')](_0x21ba7b[_0x6a3e('0x2b')][_0x6a3e('0x1c')]);_0x8e463[_0x6a3e('0x1b')]=qs[_0x6a3e('0x1b')](_0x21ba7b[_0x6a3e('0x2b')][_0x6a3e('0x1b')]);}return _0x1afa0a[_0x6a3e('0x46')](_0x8e463);}})['then'](function(_0x3a5f9d){if(_0x3a5f9d){return _0x3a5f9d?{'count':_0x37b0c8,'rows':_0x3a5f9d}:null;}})[_0x6a3e('0x21')](respondWithResult(_0x23ea98,null))[_0x6a3e('0x43')](handleError(_0x23ea98,null));};exports[_0x6a3e('0x4b')]=function(_0x145655,_0x3a4a29,_0x1da682){if(_0x145655[_0x6a3e('0x45')]['id']){delete _0x145655[_0x6a3e('0x45')]['id'];}return db[_0x6a3e('0x37')][_0x6a3e('0x47')]({'where':{'id':_0x145655[_0x6a3e('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3a4a29,null))[_0x6a3e('0x21')](function(_0x40213e){if(_0x40213e){_0x145655[_0x6a3e('0x45')]['AccountId']=_0x40213e['id'];_0x145655[_0x6a3e('0x45')]['Subjects']=integrations[_0x6a3e('0x4c')](_0x145655[_0x6a3e('0x45')]['channel'],_0x145655[_0x6a3e('0x45')][_0x6a3e('0x36')]);_0x145655['body'][_0x6a3e('0x4d')]=integrations[_0x6a3e('0x4e')](_0x145655[_0x6a3e('0x45')][_0x6a3e('0x4f')],_0x145655[_0x6a3e('0x45')]['type']);return db[_0x6a3e('0x48')]['create'](_0x145655[_0x6a3e('0x45')],{'include':[{'model':db['Dynamics365Field'],'as':_0x6a3e('0x50')},{'model':db[_0x6a3e('0x51')],'as':_0x6a3e('0x4d')}]});}return null;})[_0x6a3e('0x21')](respondWithResult(_0x3a4a29,null))['catch'](handleError(_0x3a4a29,null));};exports['getFields']=function(_0x18718f,_0x309e1c,_0x48edbf){var _0x2704f0=_0x18718f[_0x6a3e('0x2b')][_0x6a3e('0x52')];var _0x7b8d96=_0x2704f0===_0x6a3e('0x53')?'Incident':'PhoneCall';var _0x4429f1='';var _0x385ef1='';var _0x1ba563='';var _0x924f01='';var _0x1c8923='';var _0xb5afbb='';var _0x5511be='';var _0x22883c='';var _0x3457fd=[_0x6a3e('0x54'),_0x6a3e('0x55'),_0x6a3e('0x56'),_0x6a3e('0x57'),'caseorigincode','subject',_0x6a3e('0x58'),_0x6a3e('0x59'),_0x6a3e('0x5a'),_0x6a3e('0x5b')];var _0x28af16=[_0x6a3e('0x5c'),_0x6a3e('0x5d'),_0x6a3e('0x5e'),_0x6a3e('0x5f'),'contactidname',_0x6a3e('0x60'),_0x6a3e('0x61'),_0x6a3e('0x62'),_0x6a3e('0x63'),_0x6a3e('0x64'),_0x6a3e('0x65'),_0x6a3e('0x66'),_0x6a3e('0x67'),'createdonbehalfbyname',_0x6a3e('0x68'),'customeridname','customeridtype',_0x6a3e('0x69'),_0x6a3e('0x6a'),_0x6a3e('0x6b'),'entityimage_timestamp',_0x6a3e('0x6c'),_0x6a3e('0x6d'),_0x6a3e('0x6e'),_0x6a3e('0x6f'),_0x6a3e('0x70'),_0x6a3e('0x71'),_0x6a3e('0x72'),_0x6a3e('0x73'),_0x6a3e('0x74'),'masteridname',_0x6a3e('0x75'),_0x6a3e('0x76'),_0x6a3e('0x77'),_0x6a3e('0x78'),_0x6a3e('0x79'),_0x6a3e('0x7a'),_0x6a3e('0x7b'),_0x6a3e('0x7c'),_0x6a3e('0x7d'),_0x6a3e('0x7e'),_0x6a3e('0x7f'),'overriddencreatedon','owneridname',_0x6a3e('0x80'),_0x6a3e('0x81'),'parentcaseidname','primarycontactidname',_0x6a3e('0x82'),'prioritycodename',_0x6a3e('0x83'),_0x6a3e('0x84'),_0x6a3e('0x85'),_0x6a3e('0x86'),_0x6a3e('0x87'),'responsiblecontactidname',_0x6a3e('0x88'),'sentimentvalue',_0x6a3e('0x89'),_0x6a3e('0x8a'),_0x6a3e('0x8b'),_0x6a3e('0x8c'),'statuscode','subjectidname',_0x6a3e('0x8d'),_0x6a3e('0x8e'),_0x6a3e('0x8f'),_0x6a3e('0x90'),'utcconversiontimezonecode',_0x6a3e('0x91')];var _0x3554be=_0x3457fd[_0x6a3e('0x92')](_0x28af16);return db['Dynamics365Account'][_0x6a3e('0x47')]({'where':{'id':_0x18718f[_0x6a3e('0x3d')]['id']},'attributes':['id',_0x6a3e('0x93'),'password','remoteUri',_0x6a3e('0x94'),_0x6a3e('0x95'),_0x6a3e('0x96')]})['then'](handleEntityNotFound(_0x309e1c,null))[_0x6a3e('0x21')](function(_0x15441e){if(_0x15441e){_0x22883c=_0x15441e['remoteUri'];var _0x3f86e9=_0x22883c[_0x6a3e('0x97')](-0x1);if(_0x3f86e9==='/'){_0x22883c=_0x22883c[_0x6a3e('0x98')](0x0,_0x22883c[_0x6a3e('0x99')](_0x3f86e9));}_0x5511be=util['format']('%s/api/data/v9.0/',_0x22883c);var _0x4ef96a={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x15441e[_0x6a3e('0x94')]+_0x6a3e('0x9a'),'form':{'client_id':_0x15441e[_0x6a3e('0x95')],'resource':_0x22883c,'username':_0x15441e[_0x6a3e('0x93')],'password':_0x15441e[_0x6a3e('0x9b')],'grant_type':'password','client_secret':_0x15441e[_0x6a3e('0x96')]},'json':!![]};return rp(_0x4ef96a);}})[_0x6a3e('0x21')](function(_0x54e6f7){_0xb5afbb=_0x54e6f7['access_token'];var _0x48b49a={'method':'GET','uri':encodeURI(_0x5511be+_0x6a3e('0x9c')+_0x7b8d96+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xb5afbb,'If-None-Match':null,'OData-Version':_0x6a3e('0x9d')},'json':!![]};return rp(_0x48b49a);})[_0x6a3e('0x21')](function(_0x1e4b20){var _0x546de8=_0x1e4b20[_0x6a3e('0x9e')][0x0];var _0x29a546=_0x546de8[_0x6a3e('0x9f')];var _0x2e8dfd={'method':_0x6a3e('0xa0'),'uri':_0x5511be+_0x6a3e('0xa1')+_0x29a546+_0x6a3e('0xa2'),'headers':{'Authorization':_0x6a3e('0xa3')+_0xb5afbb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2e8dfd);})[_0x6a3e('0x21')](function(_0x9a6302){_0x4429f1=_0x9a6302;_0x385ef1=_0x4429f1['Attributes'];_0x385ef1=_[_0x6a3e('0xa4')](_0x385ef1,function(_0x3a59be){return!_0x3554be[_0x6a3e('0xa5')](_0x3a59be['LogicalName']);});var _0x20e765=[];var _0x3ce92a=[];_0x385ef1[_0x6a3e('0xa6')](function(_0xb6760f){if(_0xb6760f[_0x6a3e('0xa7')]){var _0xb8f9bc=_0xb6760f[_0x6a3e('0xa7')][_0x6a3e('0x98')](_0xb6760f[_0x6a3e('0xa7')]['lastIndexOf']('.')+0x1);if(_0xb8f9bc==='PicklistAttributeMetadata'){_0x20e765[_0x6a3e('0xa8')](getSelectList(_0x5511be,_0x2704f0,_0x3ce92a,_0x4429f1[_0x6a3e('0x9f')],_0xb6760f[_0x6a3e('0x9f')],_0xb5afbb));}}});return Promise['all'](_0x20e765);})[_0x6a3e('0x21')](function(_0x4cef57){_0x1ba563=_0x4cef57[0x0];var _0xe105c5=[];var _0x51ded2=[];_0x385ef1[_0x6a3e('0xa6')](function(_0x4ae71b){if(!_[_0x6a3e('0xa9')](_0x4ae71b[_0x6a3e('0xa7')])){var _0x3177e4=_0x4ae71b['@odata.type'][_0x6a3e('0x98')](_0x4ae71b['@odata.type'][_0x6a3e('0x99')]('.')+0x1);if(_0x3177e4==='BooleanAttributeMetadata'){_0xe105c5[_0x6a3e('0xa8')](getBooleanList(_0x5511be,_0x2704f0,_0x51ded2,_0x4429f1[_0x6a3e('0x9f')],_0x4ae71b[_0x6a3e('0x9f')],_0xb5afbb));}}});return Promise[_0x6a3e('0xaa')](_0xe105c5);})[_0x6a3e('0x21')](function(_0x1c391c){_0x924f01=_0x1c391c[0x0];var _0x12aee6=[];var _0x49f701=[];_0x385ef1[_0x6a3e('0xa6')](function(_0xb4cb8c){if(_0xb4cb8c['@odata.type']){var _0x14cced=_0xb4cb8c[_0x6a3e('0xa7')][_0x6a3e('0x98')](_0xb4cb8c[_0x6a3e('0xa7')][_0x6a3e('0x99')]('.')+0x1);if(_0x14cced===_0x6a3e('0xab')||_0x14cced==='DoubleAttributeMetadata'||_0x14cced===_0x6a3e('0xac')||_0x14cced==='IntegerAttributeMetadata'||_0x14cced==='MemoAttributeMetadata'||_0x14cced===_0x6a3e('0xad')||_0x14cced===_0x6a3e('0xae')||_0x14cced===_0x6a3e('0xaf')||_0x14cced==='StateAttributeMetadata'||_0x14cced==='DecimalAttributeMetadata'){_0x12aee6[_0x6a3e('0xa8')](getInputList(_0x5511be,_0x2704f0,_0x14cced,_0x49f701,_0x4429f1['MetadataId'],_0xb4cb8c['MetadataId'],_0xb5afbb));}}});return Promise['all'](_0x12aee6);})[_0x6a3e('0x21')](function(_0x229cfd){_0x1c8923=_0x229cfd[0x0];var _0x2f85c1=_0x1ba563[_0x6a3e('0x92')](_0x924f01)['concat'](_0x1c8923);var _0x266f3d={'count':_0x2f85c1[_0x6a3e('0x2f')],'rows':_0x2f85c1};return _0x266f3d;})[_0x6a3e('0x21')](respondWithResult(_0x309e1c,null))['catch'](function(_0x3faf57){var _0x4f27f3=_0x18718f[_0x6a3e('0x2b')]['test']?0x1f4:_0x3faf57[_0x6a3e('0xb0')]||0x1f4;logger['error'](_0x3faf57[_0x6a3e('0x24')]);delete _0x3faf57[_0x6a3e('0x25')];if(_0x4f27f3===0x191){_0x4f27f3=0x190;}_0x309e1c[_0x6a3e('0x17')](_0x4f27f3)[_0x6a3e('0x26')](_0x18718f[_0x6a3e('0x2b')]['test']?{'message':_0x6a3e('0xb1'),'statusCode':_0x3faf57[_0x6a3e('0xb0')]}:_0x3faf57);});};function getSelectList(_0x3c4195,_0x143c5b,_0x2419cd,_0x2ae05e,_0x36b49b,_0x433225){var _0xdc1471={'method':_0x6a3e('0xa0'),'uri':_0x3c4195+_0x6a3e('0xa1')+_0x2ae05e+')/Attributes('+_0x36b49b+_0x6a3e('0xb2')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x433225,'If-None-Match':null,'OData-Version':_0x6a3e('0x9d')},'json':!![]};return rp(_0xdc1471)['then'](function(_0x5d71ce){var _0x4cc04b=[];var _0x38519a=_0x5d71ce['OptionSet'][_0x6a3e('0xb3')];_0x38519a[_0x6a3e('0xa6')](function(_0x23562d){_0x4cc04b[_0x6a3e('0xa8')]({'name':_0x23562d['Label'][_0x6a3e('0xb4')][_0x6a3e('0xb5')],'value':String(_0x23562d[_0x6a3e('0xb6')])});});var _0x2cd621={'id':_0x143c5b+'_'+_0x5d71ce[_0x6a3e('0xb7')],'name':_0x5d71ce[_0x6a3e('0xb8')]['UserLocalizedLabel'][_0x6a3e('0xb5')],'custom':![],'options':_0x4cc04b};_0x2419cd[_0x6a3e('0xa8')](_0x2cd621);return _0x2419cd;});}function getBooleanList(_0x577697,_0x5220fc,_0x45eb22,_0x298378,_0x38f50f,_0x16c61c){var _0x2c9027={'method':_0x6a3e('0xa0'),'uri':_0x577697+_0x6a3e('0xa1')+_0x298378+')/Attributes('+_0x38f50f+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x6a3e('0xa3')+_0x16c61c,'If-None-Match':null,'OData-Version':_0x6a3e('0x9d')},'json':!![]};return rp(_0x2c9027)['then'](function(_0x7a96c){var _0x14c887=[];_0x14c887['push']({'name':_0x7a96c[_0x6a3e('0xb9')][_0x6a3e('0xba')][_0x6a3e('0xb5')]['UserLocalizedLabel'][_0x6a3e('0xb5')],'value':_0x6a3e('0xbb')},{'name':_0x7a96c[_0x6a3e('0xb9')][_0x6a3e('0xbc')][_0x6a3e('0xb5')][_0x6a3e('0xb4')][_0x6a3e('0xb5')],'value':_0x6a3e('0xbd')});var _0x53aba2={'id':_0x5220fc+'_'+_0x7a96c['LogicalName'],'name':_0x7a96c[_0x6a3e('0xb8')][_0x6a3e('0xb4')]['Label'],'custom':![],'options':_0x14c887};_0x45eb22[_0x6a3e('0xa8')](_0x53aba2);return _0x45eb22;});}function getInputList(_0xb23f44,_0x334d28,_0x47b34c,_0x4088db,_0x512871,_0x579e32,_0x3ef55e){var _0x26e835={'method':_0x6a3e('0xa0'),'uri':_0xb23f44+'EntityDefinitions('+_0x512871+_0x6a3e('0xbe')+_0x579e32+_0x6a3e('0xbf')+_0x47b34c+_0x6a3e('0xc0'),'headers':{'Authorization':'Bearer\x20'+_0x3ef55e,'If-None-Match':null,'OData-Version':_0x6a3e('0x9d')},'json':!![]};return rp(_0x26e835)['then'](function(_0x998658){var _0x1bfc90={'id':_0x334d28+'_'+_0x998658[_0x6a3e('0xb7')],'name':_0x998658[_0x6a3e('0xb8')][_0x6a3e('0xb4')]?_0x998658[_0x6a3e('0xb8')][_0x6a3e('0xb4')]['Label']:_0x998658[_0x6a3e('0xb7')],'custom':![],'options':[]};_0x4088db[_0x6a3e('0xa8')](_0x1bfc90);return _0x4088db;});}
\ No newline at end of file
+var _0x5fd1=['body','getConfigurations','Dynamics365Configuration','pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','getFields','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','merge','VIRTUAL','filter','where','Dynamics365Account','includeAll','findAll','rows','catch','show','params','options','find','create'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5fd1,0x155));var _0x15fd=function(_0x242a61,_0x2f1583){_0x242a61=_0x242a61-0x0;var _0x329084=_0x5fd1[_0x242a61];return _0x329084;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];var integrations=require(_0x15fd('0x16'));function respondWithStatusCode(_0x346ab1,_0x2660db){_0x2660db=_0x2660db||0xcc;return function(_0x459fa4){if(_0x459fa4){return _0x346ab1['sendStatus'](_0x2660db);}return _0x346ab1['status'](_0x2660db)['end']();};}function respondWithResult(_0x3fda60,_0x135a15){_0x135a15=_0x135a15||0xc8;return function(_0x624e9b){if(_0x624e9b){return _0x3fda60[_0x15fd('0x17')](_0x135a15)[_0x15fd('0x18')](_0x624e9b);}};}function respondWithFilteredResult(_0x2ffa03,_0x2c5375){return function(_0x44a63a){if(_0x44a63a){var _0x5aae13=typeof _0x2c5375['offset']===_0x15fd('0x19')&&typeof _0x2c5375['limit']===_0x15fd('0x19');var _0x579ee2=_0x44a63a[_0x15fd('0x1a')];var _0x318f47=_0x5aae13?0x0:_0x2c5375[_0x15fd('0x1b')];var _0x49ceac=_0x5aae13?_0x44a63a[_0x15fd('0x1a')]:_0x2c5375[_0x15fd('0x1b')]+_0x2c5375[_0x15fd('0x1c')];var _0x229f8a;if(_0x49ceac>=_0x579ee2){_0x49ceac=_0x579ee2;_0x229f8a=0xc8;}else{_0x229f8a=0xce;}_0x2ffa03[_0x15fd('0x17')](_0x229f8a);return _0x2ffa03[_0x15fd('0x1d')](_0x15fd('0x1e'),_0x318f47+'-'+_0x49ceac+'/'+_0x579ee2)[_0x15fd('0x18')](_0x44a63a);}return null;};}function patchUpdates(_0x1b8b9f){return function(_0x1eab55){try{jsonpatch[_0x15fd('0x1f')](_0x1eab55,_0x1b8b9f,!![]);}catch(_0x484db6){return BPromise['reject'](_0x484db6);}return _0x1eab55[_0x15fd('0x20')]();};}function saveUpdates(_0x36b21e,_0x252a1c){return function(_0x118a2b){if(_0x118a2b){return _0x118a2b[_0x15fd('0x21')](_0x36b21e)[_0x15fd('0x22')](function(_0x2073da){return _0x2073da;});}return null;};}function removeEntity(_0x50d493,_0x40d43){return function(_0x2d19ac){if(_0x2d19ac){return _0x2d19ac[_0x15fd('0x23')]()['then'](function(){_0x50d493[_0x15fd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d1835,_0x1fc24f){return function(_0x21601d){if(!_0x21601d){_0x3d1835['sendStatus'](0x194);}return _0x21601d;};}function handleError(_0x16b87c,_0x1cbf2c){_0x1cbf2c=_0x1cbf2c||0x1f4;return function(_0x24c541){logger['error'](_0x24c541[_0x15fd('0x24')]);if(_0x24c541['name']){delete _0x24c541[_0x15fd('0x25')];}_0x16b87c[_0x15fd('0x17')](_0x1cbf2c)[_0x15fd('0x26')](_0x24c541);};}exports[_0x15fd('0x27')]=function(_0x233ed3,_0x6c213b){var _0x218034={},_0xe650a3={},_0x4590a1={'count':0x0,'rows':[]};var _0x160226=_[_0x15fd('0x28')](db['Dynamics365Account'][_0x15fd('0x29')],function(_0x2fe61e){return{'name':_0x2fe61e['fieldName'],'type':_0x2fe61e[_0x15fd('0x2a')][_0x15fd('0x2b')]};});_0xe650a3['model']=_[_0x15fd('0x28')](_0x160226,_0x15fd('0x25'));_0xe650a3['query']=_[_0x15fd('0x2c')](_0x233ed3[_0x15fd('0x2d')]);_0xe650a3[_0x15fd('0x2e')]=_[_0x15fd('0x2f')](_0xe650a3[_0x15fd('0x30')],_0xe650a3[_0x15fd('0x2d')]);_0x218034['attributes']=_[_0x15fd('0x2f')](_0xe650a3[_0x15fd('0x30')],qs[_0x15fd('0x31')](_0x233ed3[_0x15fd('0x2d')]['fields']));_0x218034[_0x15fd('0x32')]=_0x218034[_0x15fd('0x32')][_0x15fd('0x33')]?_0x218034[_0x15fd('0x32')]:_0xe650a3[_0x15fd('0x30')];if(!_0x233ed3[_0x15fd('0x2d')]['hasOwnProperty'](_0x15fd('0x34'))){_0x218034[_0x15fd('0x1c')]=qs['limit'](_0x233ed3[_0x15fd('0x2d')][_0x15fd('0x1c')]);_0x218034[_0x15fd('0x1b')]=qs['offset'](_0x233ed3[_0x15fd('0x2d')][_0x15fd('0x1b')]);}_0x218034[_0x15fd('0x35')]=qs[_0x15fd('0x36')](_0x233ed3[_0x15fd('0x2d')][_0x15fd('0x36')]);_0x218034['where']=qs['filters'](_['pick'](_0x233ed3[_0x15fd('0x2d')],_0xe650a3[_0x15fd('0x2e')]),_0x160226);if(_0x233ed3[_0x15fd('0x2d')]['filter']){_0x218034['where']=_[_0x15fd('0x37')](_0x218034['where'],{'$or':_['map'](_0x160226,function(_0x4c1aa8){if(_0x4c1aa8[_0x15fd('0x2a')]!==_0x15fd('0x38')){var _0x217300={};_0x217300[_0x4c1aa8['name']]={'$like':'%'+_0x233ed3[_0x15fd('0x2d')][_0x15fd('0x39')]+'%'};return _0x217300;}})});}_0x218034=_[_0x15fd('0x37')]({},_0x218034,_0x233ed3['options']);var _0x1d693e={'where':_0x218034[_0x15fd('0x3a')]};return db[_0x15fd('0x3b')][_0x15fd('0x1a')](_0x1d693e)[_0x15fd('0x22')](function(_0x46b8f4){_0x4590a1[_0x15fd('0x1a')]=_0x46b8f4;if(_0x233ed3[_0x15fd('0x2d')][_0x15fd('0x3c')]){_0x218034['include']=[{'all':!![]}];}return db[_0x15fd('0x3b')][_0x15fd('0x3d')](_0x218034);})[_0x15fd('0x22')](function(_0x304736){_0x4590a1[_0x15fd('0x3e')]=_0x304736;return _0x4590a1;})[_0x15fd('0x22')](respondWithFilteredResult(_0x6c213b,_0x218034))[_0x15fd('0x3f')](handleError(_0x6c213b,null));};exports[_0x15fd('0x40')]=function(_0x343ce6,_0x104eef){var _0x2eb6b6={'raw':![],'where':{'id':_0x343ce6[_0x15fd('0x41')]['id']}},_0x145eab={};_0x145eab[_0x15fd('0x30')]=_[_0x15fd('0x2c')](db['Dynamics365Account'][_0x15fd('0x29')]);_0x145eab[_0x15fd('0x2d')]=_[_0x15fd('0x2c')](_0x343ce6[_0x15fd('0x2d')]);_0x145eab[_0x15fd('0x2e')]=_[_0x15fd('0x2f')](_0x145eab[_0x15fd('0x30')],_0x145eab[_0x15fd('0x2d')]);_0x2eb6b6['attributes']=_['intersection'](_0x145eab[_0x15fd('0x30')],qs['fields'](_0x343ce6[_0x15fd('0x2d')][_0x15fd('0x31')]));_0x2eb6b6['attributes']=_0x2eb6b6[_0x15fd('0x32')][_0x15fd('0x33')]?_0x2eb6b6[_0x15fd('0x32')]:_0x145eab[_0x15fd('0x30')];if(_0x343ce6[_0x15fd('0x2d')][_0x15fd('0x3c')]){_0x2eb6b6['include']=[{'all':!![]}];}_0x2eb6b6=_[_0x15fd('0x37')]({},_0x2eb6b6,_0x343ce6[_0x15fd('0x42')]);return db[_0x15fd('0x3b')][_0x15fd('0x43')](_0x2eb6b6)[_0x15fd('0x22')](handleEntityNotFound(_0x104eef,null))[_0x15fd('0x22')](respondWithResult(_0x104eef,null))[_0x15fd('0x3f')](handleError(_0x104eef,null));};exports[_0x15fd('0x44')]=function(_0x24cb44,_0x1d3beb){return db[_0x15fd('0x3b')][_0x15fd('0x44')](_0x24cb44['body'],{})[_0x15fd('0x22')](respondWithResult(_0x1d3beb,0xc9))['catch'](handleError(_0x1d3beb,null));};exports[_0x15fd('0x21')]=function(_0x34c250,_0xeb1e06){if(_0x34c250['body']['id']){delete _0x34c250[_0x15fd('0x45')]['id'];}return db[_0x15fd('0x3b')][_0x15fd('0x43')]({'where':{'id':_0x34c250[_0x15fd('0x41')]['id']}})['then'](handleEntityNotFound(_0xeb1e06,null))[_0x15fd('0x22')](saveUpdates(_0x34c250[_0x15fd('0x45')],null))[_0x15fd('0x22')](respondWithResult(_0xeb1e06,null))[_0x15fd('0x3f')](handleError(_0xeb1e06,null));};exports['destroy']=function(_0x56c6be,_0x322623){return db['Dynamics365Account']['find']({'where':{'id':_0x56c6be['params']['id']}})[_0x15fd('0x22')](handleEntityNotFound(_0x322623,null))[_0x15fd('0x22')](removeEntity(_0x322623,null))[_0x15fd('0x3f')](handleError(_0x322623,null));};exports[_0x15fd('0x46')]=function(_0x292174,_0x33a128,_0x595501){var _0xbe7dc3={};var _0x22cc14={};var _0xbb16ef;var _0x516b25;return db[_0x15fd('0x3b')]['findOne']({'where':{'id':_0x292174[_0x15fd('0x41')]['id']}})[_0x15fd('0x22')](handleEntityNotFound(_0x33a128,null))[_0x15fd('0x22')](function(_0x42d4de){if(_0x42d4de){_0xbb16ef=_0x42d4de;_0x22cc14[_0x15fd('0x30')]=_[_0x15fd('0x2c')](db[_0x15fd('0x47')][_0x15fd('0x29')]);_0x22cc14[_0x15fd('0x2d')]=_[_0x15fd('0x2c')](_0x292174[_0x15fd('0x2d')]);_0x22cc14[_0x15fd('0x2e')]=_[_0x15fd('0x2f')](_0x22cc14['model'],_0x22cc14[_0x15fd('0x2d')]);_0xbe7dc3['attributes']=_[_0x15fd('0x2f')](_0x22cc14['model'],qs[_0x15fd('0x31')](_0x292174[_0x15fd('0x2d')][_0x15fd('0x31')]));_0xbe7dc3['attributes']=_0xbe7dc3['attributes'][_0x15fd('0x33')]?_0xbe7dc3[_0x15fd('0x32')]:_0x22cc14[_0x15fd('0x30')];_0xbe7dc3[_0x15fd('0x35')]=qs['sort'](_0x292174[_0x15fd('0x2d')][_0x15fd('0x36')]);_0xbe7dc3[_0x15fd('0x3a')]=qs[_0x15fd('0x2e')](_[_0x15fd('0x48')](_0x292174[_0x15fd('0x2d')],_0x22cc14['filters']));if(_0x292174[_0x15fd('0x2d')][_0x15fd('0x39')]){_0xbe7dc3[_0x15fd('0x3a')]=_[_0x15fd('0x37')](_0xbe7dc3[_0x15fd('0x3a')],{'$or':_[_0x15fd('0x28')](_0xbe7dc3['attributes'],function(_0x4f2a17){var _0x149b20={};_0x149b20[_0x4f2a17]={'$like':'%'+_0x292174[_0x15fd('0x2d')]['filter']+'%'};return _0x149b20;})});}_0xbe7dc3=_[_0x15fd('0x37')]({},_0xbe7dc3,_0x292174[_0x15fd('0x42')]);return _0xbb16ef['getConfigurations'](_0xbe7dc3);}})[_0x15fd('0x22')](function(_0x4626ac){if(_0x4626ac){_0x516b25=_0x4626ac[_0x15fd('0x33')];if(!_0x292174['query'][_0x15fd('0x49')](_0x15fd('0x34'))){_0xbe7dc3[_0x15fd('0x1c')]=qs[_0x15fd('0x1c')](_0x292174[_0x15fd('0x2d')][_0x15fd('0x1c')]);_0xbe7dc3[_0x15fd('0x1b')]=qs[_0x15fd('0x1b')](_0x292174[_0x15fd('0x2d')][_0x15fd('0x1b')]);}return _0xbb16ef['getConfigurations'](_0xbe7dc3);}})[_0x15fd('0x22')](function(_0x3a26c8){if(_0x3a26c8){return _0x3a26c8?{'count':_0x516b25,'rows':_0x3a26c8}:null;}})['then'](respondWithResult(_0x33a128,null))['catch'](handleError(_0x33a128,null));};exports[_0x15fd('0x4a')]=function(_0x39e6ee,_0x2bd6ef,_0x105f03){if(_0x39e6ee[_0x15fd('0x45')]['id']){delete _0x39e6ee[_0x15fd('0x45')]['id'];}return db['Dynamics365Account'][_0x15fd('0x4b')]({'where':{'id':_0x39e6ee[_0x15fd('0x41')]['id']}})[_0x15fd('0x22')](handleEntityNotFound(_0x2bd6ef,null))[_0x15fd('0x22')](function(_0x7b4413){if(_0x7b4413){_0x39e6ee[_0x15fd('0x45')][_0x15fd('0x4c')]=_0x7b4413['id'];_0x39e6ee[_0x15fd('0x45')][_0x15fd('0x4d')]=integrations[_0x15fd('0x4e')](_0x39e6ee[_0x15fd('0x45')]['channel'],_0x39e6ee['body'][_0x15fd('0x2a')]);_0x39e6ee[_0x15fd('0x45')][_0x15fd('0x4f')]=integrations[_0x15fd('0x50')](_0x39e6ee[_0x15fd('0x45')][_0x15fd('0x51')],_0x39e6ee[_0x15fd('0x45')]['type']);return db[_0x15fd('0x47')]['create'](_0x39e6ee[_0x15fd('0x45')],{'include':[{'model':db['Dynamics365Field'],'as':_0x15fd('0x4d')},{'model':db['Dynamics365Field'],'as':_0x15fd('0x4f')}]});}return null;})[_0x15fd('0x22')](respondWithResult(_0x2bd6ef,null))[_0x15fd('0x3f')](handleError(_0x2bd6ef,null));};exports[_0x15fd('0x52')]=function(_0x2e3c9a,_0x1e3bf7,_0xb910a4){var _0x29c0bf=_0x2e3c9a[_0x15fd('0x2d')]['ticketType'];var _0x4efb15=_0x29c0bf===_0x15fd('0x53')?_0x15fd('0x54'):_0x15fd('0x55');var _0x4a8659='';var _0x2614b6='';var _0x36bc03='';var _0x333528='';var _0x56cf8c='';var _0x3bf85b='';var _0x317db9='';var _0x58b433='';var _0xb8b2e0=['title',_0x15fd('0x56'),_0x15fd('0x57'),_0x15fd('0x58'),_0x15fd('0x59'),_0x15fd('0x5a'),'phonenumber',_0x15fd('0x5b'),'directioncode',_0x15fd('0x5c')];var _0x4a165f=[_0x15fd('0x5d'),_0x15fd('0x5e'),'actualserviceunits',_0x15fd('0x5f'),_0x15fd('0x60'),'contactidyominame','contractdetailidname',_0x15fd('0x61'),'createdbyexternalpartyname',_0x15fd('0x62'),_0x15fd('0x63'),_0x15fd('0x64'),_0x15fd('0x65'),_0x15fd('0x66'),'createdonbehalfbyyominame',_0x15fd('0x67'),_0x15fd('0x68'),'customeridyominame',_0x15fd('0x69'),_0x15fd('0x6a'),_0x15fd('0x6b'),_0x15fd('0x6c'),_0x15fd('0x6d'),_0x15fd('0x6e'),_0x15fd('0x6f'),_0x15fd('0x70'),_0x15fd('0x71'),_0x15fd('0x72'),_0x15fd('0x73'),_0x15fd('0x74'),_0x15fd('0x75'),_0x15fd('0x76'),'modifiedbyexternalpartyyominame',_0x15fd('0x77'),'modifiedbyyominame',_0x15fd('0x78'),_0x15fd('0x79'),_0x15fd('0x7a'),_0x15fd('0x7b'),'msdyn_iotalertname',_0x15fd('0x7c'),_0x15fd('0x7d'),_0x15fd('0x7e'),_0x15fd('0x7f'),'owneridtype',_0x15fd('0x80'),_0x15fd('0x81'),'primarycontactidname',_0x15fd('0x82'),_0x15fd('0x83'),_0x15fd('0x84'),'productserialnumber',_0x15fd('0x85'),_0x15fd('0x86'),_0x15fd('0x87'),_0x15fd('0x88'),_0x15fd('0x89'),_0x15fd('0x8a'),_0x15fd('0x8b'),_0x15fd('0x8c'),_0x15fd('0x8d'),_0x15fd('0x8e'),_0x15fd('0x8f'),_0x15fd('0x90'),'ticketnumber',_0x15fd('0x91'),_0x15fd('0x92'),_0x15fd('0x93'),_0x15fd('0x94'),_0x15fd('0x95')];var _0x5f2682=_0xb8b2e0['concat'](_0x4a165f);return db[_0x15fd('0x3b')][_0x15fd('0x4b')]({'where':{'id':_0x2e3c9a[_0x15fd('0x41')]['id']},'attributes':['id',_0x15fd('0x96'),_0x15fd('0x97'),_0x15fd('0x98'),_0x15fd('0x99'),_0x15fd('0x9a'),_0x15fd('0x9b')]})['then'](handleEntityNotFound(_0x1e3bf7,null))[_0x15fd('0x22')](function(_0x23d547){if(_0x23d547){_0x58b433=_0x23d547['remoteUri'];var _0x27c68e=_0x58b433[_0x15fd('0x9c')](-0x1);if(_0x27c68e==='/'){_0x58b433=_0x58b433[_0x15fd('0x9d')](0x0,_0x58b433[_0x15fd('0x9e')](_0x27c68e));}_0x317db9=util['format'](_0x15fd('0x9f'),_0x58b433);var _0x2928b0={'method':'POST','uri':_0x15fd('0xa0')+_0x23d547[_0x15fd('0x99')]+_0x15fd('0xa1'),'form':{'client_id':_0x23d547['clientId'],'resource':_0x58b433,'username':_0x23d547[_0x15fd('0x96')],'password':_0x23d547[_0x15fd('0x97')],'grant_type':_0x15fd('0x97'),'client_secret':_0x23d547[_0x15fd('0x9b')]},'json':!![]};return rp(_0x2928b0);}})[_0x15fd('0x22')](function(_0x906e41){_0x3bf85b=_0x906e41[_0x15fd('0xa2')];var _0x3d548f={'method':'GET','uri':encodeURI(_0x317db9+_0x15fd('0xa3')+_0x4efb15+'\x27'),'headers':{'Authorization':_0x15fd('0xa4')+_0x3bf85b,'If-None-Match':null,'OData-Version':_0x15fd('0xa5')},'json':!![]};return rp(_0x3d548f);})[_0x15fd('0x22')](function(_0x1b1fee){var _0xb3339a=_0x1b1fee[_0x15fd('0xa6')][0x0];var _0x939bfd=_0xb3339a[_0x15fd('0xa7')];var _0x264a98={'method':_0x15fd('0xa8'),'uri':_0x317db9+_0x15fd('0xa9')+_0x939bfd+_0x15fd('0xaa'),'headers':{'Authorization':_0x15fd('0xa4')+_0x3bf85b,'If-None-Match':null,'OData-Version':_0x15fd('0xa5')},'json':!![]};return rp(_0x264a98);})[_0x15fd('0x22')](function(_0xa2d3e9){_0x4a8659=_0xa2d3e9;_0x2614b6=_0x4a8659[_0x15fd('0xab')];_0x2614b6=_[_0x15fd('0xac')](_0x2614b6,function(_0x178dac){return!_0x5f2682[_0x15fd('0xad')](_0x178dac[_0x15fd('0xae')]);});var _0x3c5f21=[];var _0x1014e1=[];_0x2614b6[_0x15fd('0xaf')](function(_0x104b18){if(_0x104b18['@odata.type']){var _0x2217eb=_0x104b18[_0x15fd('0xb0')]['substring'](_0x104b18[_0x15fd('0xb0')][_0x15fd('0x9e')]('.')+0x1);if(_0x2217eb===_0x15fd('0xb1')){_0x3c5f21[_0x15fd('0xb2')](getSelectList(_0x317db9,_0x29c0bf,_0x1014e1,_0x4a8659['MetadataId'],_0x104b18['MetadataId'],_0x3bf85b));}}});return Promise[_0x15fd('0xb3')](_0x3c5f21);})['then'](function(_0x3f4d0d){_0x36bc03=_0x3f4d0d[0x0];var _0x3e47fe=[];var _0x33b3c8=[];_0x2614b6[_0x15fd('0xaf')](function(_0xad8c8c){if(!_[_0x15fd('0xb4')](_0xad8c8c[_0x15fd('0xb0')])){var _0x500bff=_0xad8c8c['@odata.type'][_0x15fd('0x9d')](_0xad8c8c[_0x15fd('0xb0')][_0x15fd('0x9e')]('.')+0x1);if(_0x500bff===_0x15fd('0xb5')){_0x3e47fe[_0x15fd('0xb2')](getBooleanList(_0x317db9,_0x29c0bf,_0x33b3c8,_0x4a8659[_0x15fd('0xa7')],_0xad8c8c['MetadataId'],_0x3bf85b));}}});return Promise['all'](_0x3e47fe);})[_0x15fd('0x22')](function(_0x190a30){_0x333528=_0x190a30[0x0];var _0x196619=[];var _0xfc8f62=[];_0x2614b6[_0x15fd('0xaf')](function(_0x17e8c5){if(_0x17e8c5['@odata.type']){var _0x188e6b=_0x17e8c5['@odata.type'][_0x15fd('0x9d')](_0x17e8c5[_0x15fd('0xb0')][_0x15fd('0x9e')]('.')+0x1);if(_0x188e6b===_0x15fd('0xb6')||_0x188e6b==='DoubleAttributeMetadata'||_0x188e6b===_0x15fd('0xb7')||_0x188e6b==='IntegerAttributeMetadata'||_0x188e6b===_0x15fd('0xb8')||_0x188e6b==='DateTimeAttributeMetadata'||_0x188e6b==='StatusAttributeMetadata'||_0x188e6b===_0x15fd('0xb9')||_0x188e6b===_0x15fd('0xba')||_0x188e6b===_0x15fd('0xbb')){_0x196619[_0x15fd('0xb2')](getInputList(_0x317db9,_0x29c0bf,_0x188e6b,_0xfc8f62,_0x4a8659[_0x15fd('0xa7')],_0x17e8c5[_0x15fd('0xa7')],_0x3bf85b));}}});return Promise['all'](_0x196619);})[_0x15fd('0x22')](function(_0x5efa86){_0x56cf8c=_0x5efa86[0x0];var _0xb1845f=_0x36bc03[_0x15fd('0xbc')](_0x333528)[_0x15fd('0xbc')](_0x56cf8c);var _0x4079d3={'count':_0xb1845f[_0x15fd('0x33')],'rows':_0xb1845f};return _0x4079d3;})[_0x15fd('0x22')](respondWithResult(_0x1e3bf7,null))[_0x15fd('0x3f')](function(_0x2d17ae){var _0x102c3d=_0x2e3c9a[_0x15fd('0x2d')][_0x15fd('0xbd')]?0x1f4:_0x2d17ae[_0x15fd('0xbe')]||0x1f4;logger['error'](_0x2d17ae[_0x15fd('0x24')]);delete _0x2d17ae[_0x15fd('0x25')];if(_0x102c3d===0x191){_0x102c3d=0x190;}_0x1e3bf7[_0x15fd('0x17')](_0x102c3d)[_0x15fd('0x26')](_0x2e3c9a[_0x15fd('0x2d')][_0x15fd('0xbd')]?{'message':'Wrong\x20credentials','statusCode':_0x2d17ae['statusCode']}:_0x2d17ae);});};function getSelectList(_0x30304a,_0x470960,_0x31216d,_0xc9a733,_0x5d87c0,_0x5ed070){var _0x1abaa7={'method':_0x15fd('0xa8'),'uri':_0x30304a+_0x15fd('0xa9')+_0xc9a733+')/Attributes('+_0x5d87c0+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x15fd('0xbf'),'headers':{'Authorization':_0x15fd('0xa4')+_0x5ed070,'If-None-Match':null,'OData-Version':_0x15fd('0xa5')},'json':!![]};return rp(_0x1abaa7)[_0x15fd('0x22')](function(_0x47a7bc){var _0x458750=[];var _0x399a59=_0x47a7bc[_0x15fd('0xc0')][_0x15fd('0xc1')];_0x399a59[_0x15fd('0xaf')](function(_0x5d397f){_0x458750['push']({'name':_0x5d397f[_0x15fd('0xc2')][_0x15fd('0xc3')][_0x15fd('0xc2')],'value':String(_0x5d397f[_0x15fd('0xc4')])});});var _0x17daaf={'id':_0x470960+'_'+_0x47a7bc[_0x15fd('0xae')],'name':_0x47a7bc[_0x15fd('0xc5')]['UserLocalizedLabel'][_0x15fd('0xc2')],'custom':![],'options':_0x458750};_0x31216d['push'](_0x17daaf);return _0x31216d;});}function getBooleanList(_0x5a872f,_0x11aa1f,_0x15f531,_0x5cd3ef,_0x30227e,_0x2f223c){var _0x3d9efb={'method':'GET','uri':_0x5a872f+_0x15fd('0xa9')+_0x5cd3ef+_0x15fd('0xc6')+_0x30227e+_0x15fd('0xc7'),'headers':{'Authorization':_0x15fd('0xa4')+_0x2f223c,'If-None-Match':null,'OData-Version':_0x15fd('0xa5')},'json':!![]};return rp(_0x3d9efb)[_0x15fd('0x22')](function(_0x1380f3){var _0x2c3376=[];_0x2c3376[_0x15fd('0xb2')]({'name':_0x1380f3[_0x15fd('0xc0')][_0x15fd('0xc8')]['Label'][_0x15fd('0xc3')]['Label'],'value':_0x15fd('0xc9')},{'name':_0x1380f3[_0x15fd('0xc0')][_0x15fd('0xca')][_0x15fd('0xc2')][_0x15fd('0xc3')][_0x15fd('0xc2')],'value':_0x15fd('0xcb')});var _0x42584f={'id':_0x11aa1f+'_'+_0x1380f3[_0x15fd('0xae')],'name':_0x1380f3[_0x15fd('0xc5')][_0x15fd('0xc3')]['Label'],'custom':![],'options':_0x2c3376};_0x15f531['push'](_0x42584f);return _0x15f531;});}function getInputList(_0x38ff20,_0x40914d,_0xca68f0,_0x31e56c,_0x2cec23,_0x56dae9,_0x4c4919){var _0x2d354d={'method':_0x15fd('0xa8'),'uri':_0x38ff20+_0x15fd('0xa9')+_0x2cec23+_0x15fd('0xc6')+_0x56dae9+')/Microsoft.Dynamics.CRM.'+_0xca68f0+_0x15fd('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x4c4919,'If-None-Match':null,'OData-Version':_0x15fd('0xa5')},'json':!![]};return rp(_0x2d354d)['then'](function(_0x29d5d7){var _0x348b7b={'id':_0x40914d+'_'+_0x29d5d7[_0x15fd('0xae')],'name':_0x29d5d7[_0x15fd('0xc5')][_0x15fd('0xc3')]?_0x29d5d7[_0x15fd('0xc5')]['UserLocalizedLabel']['Label']:_0x29d5d7[_0x15fd('0xae')],'custom':![],'options':[]};_0x31e56c[_0x15fd('0xb2')](_0x348b7b);return _0x31e56c;});}
\ No newline at end of file
index 172e5ea..43cde0e 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(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_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 _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x224f6f,_0x57a3b7){var _0x1a02bf=function(_0xbda821){while(--_0xbda821){_0x224f6f['push'](_0x224f6f['shift']());}};_0x1a02bf(++_0x57a3b7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xcb91[_0x1abeb2];return _0x48da20;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 025748c..b954005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d46=['rpc','../../config/environment','jayson/promise','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','findAll','raw','options','attributes','include','map','debug','ShowDynamics365Account','find','where','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x1ad926,_0x3e1fed){var _0x1b81dc=function(_0x506f83){while(--_0x506f83){_0x1ad926['push'](_0x1ad926['shift']());}};_0x1b81dc(++_0x3e1fed);}(_0x5d46,0x1e9));var _0x65d4=function(_0x5b015,_0x341440){_0x5b015=_0x5b015-0x0;var _0x561eb4=_0x5d46[_0x5b015];return _0x561eb4;};'use strict';var _=require(_0x65d4('0x0'));var util=require('util');var moment=require(_0x65d4('0x1'));var BPromise=require('bluebird');var rs=require(_0x65d4('0x2'));var fs=require('fs');var Redis=require(_0x65d4('0x3'));var db=require(_0x65d4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65d4('0x5'))(_0x65d4('0x6'));var config=require(_0x65d4('0x7'));var jayson=require(_0x65d4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3da59,_0x5e5f17,_0x77ebea){return new BPromise(function(_0x401b41,_0x11fa34){return client[_0x65d4('0x9')](_0x3da59,_0x77ebea)[_0x65d4('0xa')](function(_0x1590b8){logger[_0x65d4('0xb')](_0x65d4('0xc'),_0x5e5f17,_0x65d4('0xd'));logger['debug'](_0x65d4('0xe'),_0x5e5f17,_0x65d4('0xd'),JSON[_0x65d4('0xf')](_0x1590b8));if(_0x1590b8[_0x65d4('0x10')]){if(_0x1590b8['error'][_0x65d4('0x11')]===0x1f4){logger['error'](_0x65d4('0xc'),_0x5e5f17,_0x1590b8['error'][_0x65d4('0x12')]);return _0x11fa34(_0x1590b8[_0x65d4('0x10')][_0x65d4('0x12')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x5e5f17,_0x1590b8[_0x65d4('0x10')][_0x65d4('0x12')]);return _0x401b41(_0x1590b8[_0x65d4('0x10')][_0x65d4('0x12')]);}else{logger[_0x65d4('0xb')](_0x65d4('0xc'),_0x5e5f17,_0x65d4('0xd'));_0x401b41(_0x1590b8['result']['message']);}})[_0x65d4('0x13')](function(_0x23eb1b){logger[_0x65d4('0x10')](_0x65d4('0xc'),_0x5e5f17,_0x23eb1b);_0x11fa34(_0x23eb1b);});});}exports[_0x65d4('0x14')]=function(_0x17845a){var _0x138aad=this;return new Promise(function(_0x57b9f9,_0x429f96){return db[_0x65d4('0x15')][_0x65d4('0x16')]({'raw':_0x17845a['options']?_0x17845a['options'][_0x65d4('0x17')]===undefined?!![]:![]:!![],'where':_0x17845a['options']?_0x17845a[_0x65d4('0x18')]['where']||null:null,'attributes':_0x17845a['options']?_0x17845a[_0x65d4('0x18')][_0x65d4('0x19')]||null:null,'limit':_0x17845a[_0x65d4('0x18')]?_0x17845a[_0x65d4('0x18')]['limit']||null:null,'include':_0x17845a[_0x65d4('0x18')]?_0x17845a[_0x65d4('0x18')][_0x65d4('0x1a')]?_[_0x65d4('0x1b')](_0x17845a[_0x65d4('0x18')][_0x65d4('0x1a')],function(_0x4a9585){return{'model':db[_0x4a9585['model']],'as':_0x4a9585['as'],'attributes':_0x4a9585['attributes'],'include':_0x4a9585['include']?_[_0x65d4('0x1b')](_0x4a9585[_0x65d4('0x1a')],function(_0x46d0a5){return{'model':db[_0x46d0a5['model']],'as':_0x46d0a5['as'],'attributes':_0x46d0a5[_0x65d4('0x19')],'include':_0x46d0a5[_0x65d4('0x1a')]?_[_0x65d4('0x1b')](_0x46d0a5['include'],function(_0x3570a3){return{'model':db[_0x3570a3['model']],'as':_0x3570a3['as'],'attributes':_0x3570a3[_0x65d4('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34885f){logger[_0x65d4('0xb')](_0x65d4('0x14'),_0x17845a);logger[_0x65d4('0x1c')](_0x65d4('0x14'),_0x17845a,JSON[_0x65d4('0xf')](_0x34885f));_0x57b9f9(_0x34885f);})[_0x65d4('0x13')](function(_0x467a8f){logger[_0x65d4('0x10')](_0x65d4('0x14'),_0x467a8f['message'],_0x17845a);_0x429f96(_0x138aad[_0x65d4('0x10')](0x1f4,_0x467a8f[_0x65d4('0x12')]));});});};exports[_0x65d4('0x1d')]=function(_0x48c72a){var _0x559ea9=this;return new Promise(function(_0x402a21,_0x3131a3){return db['Dynamics365Account'][_0x65d4('0x1e')]({'raw':_0x48c72a['options']?_0x48c72a[_0x65d4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x48c72a[_0x65d4('0x18')]?_0x48c72a[_0x65d4('0x18')][_0x65d4('0x1f')]||null:null,'attributes':_0x48c72a['options']?_0x48c72a['options'][_0x65d4('0x19')]||null:null,'include':_0x48c72a[_0x65d4('0x18')]?_0x48c72a['options']['include']?_[_0x65d4('0x1b')](_0x48c72a[_0x65d4('0x18')][_0x65d4('0x1a')],function(_0x1d35d4){return{'model':db[_0x1d35d4[_0x65d4('0x20')]],'as':_0x1d35d4['as'],'attributes':_0x1d35d4['attributes'],'include':_0x1d35d4[_0x65d4('0x1a')]?_[_0x65d4('0x1b')](_0x1d35d4[_0x65d4('0x1a')],function(_0x22efc2){return{'model':db[_0x22efc2[_0x65d4('0x20')]],'as':_0x22efc2['as'],'attributes':_0x22efc2[_0x65d4('0x19')],'include':_0x22efc2[_0x65d4('0x1a')]?_[_0x65d4('0x1b')](_0x22efc2[_0x65d4('0x1a')],function(_0x215070){return{'model':db[_0x215070[_0x65d4('0x20')]],'as':_0x215070['as'],'attributes':_0x215070[_0x65d4('0x19')]};}):[]};}):[]};}):[]:[]})[_0x65d4('0xa')](function(_0x1eaa6){logger[_0x65d4('0xb')](_0x65d4('0x1d'),_0x48c72a);logger['debug'](_0x65d4('0x1d'),_0x48c72a,JSON[_0x65d4('0xf')](_0x1eaa6));_0x402a21(_0x1eaa6);})[_0x65d4('0x13')](function(_0xcd6708){logger[_0x65d4('0x10')]('ShowDynamics365Account',_0xcd6708[_0x65d4('0x12')],_0x48c72a);_0x3131a3(_0x559ea9['error'](0x1f4,_0xcd6708[_0x65d4('0x12')]));});});};
\ No newline at end of file
+var _0xbc4b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','then','Dynamics365Account','find','ShowDynamics365Account','lodash','util','moment','bluebird','ioredis'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0xbc4b,0xd3));var _0xbbc4=function(_0x2241aa,_0x1e04d6){_0x2241aa=_0x2241aa-0x0;var _0x55f6a7=_0xbc4b[_0x2241aa];return _0x55f6a7;};'use strict';var _=require(_0xbbc4('0x0'));var util=require(_0xbbc4('0x1'));var moment=require(_0xbbc4('0x2'));var BPromise=require(_0xbbc4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbc4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbc4('0x5'))(_0xbbc4('0x6'));var config=require(_0xbbc4('0x7'));var jayson=require(_0xbbc4('0x8'));var client=jayson[_0xbbc4('0x9')][_0xbbc4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x764be1,_0x32be07,_0x4120b2){return new BPromise(function(_0x3ca196,_0x2d2be0){return client['request'](_0x764be1,_0x4120b2)['then'](function(_0x739936){logger[_0xbbc4('0xb')](_0xbbc4('0xc'),_0x32be07,'request\x20sent');logger[_0xbbc4('0xd')](_0xbbc4('0xe'),_0x32be07,_0xbbc4('0xf'),JSON[_0xbbc4('0x10')](_0x739936));if(_0x739936['error']){if(_0x739936[_0xbbc4('0x11')][_0xbbc4('0x12')]===0x1f4){logger[_0xbbc4('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x32be07,_0x739936['error']['message']);return _0x2d2be0(_0x739936[_0xbbc4('0x11')]['message']);}logger['error'](_0xbbc4('0xc'),_0x32be07,_0x739936[_0xbbc4('0x11')][_0xbbc4('0x13')]);return _0x3ca196(_0x739936[_0xbbc4('0x11')][_0xbbc4('0x13')]);}else{logger[_0xbbc4('0xb')](_0xbbc4('0xc'),_0x32be07,'request\x20sent');_0x3ca196(_0x739936[_0xbbc4('0x14')]['message']);}})[_0xbbc4('0x15')](function(_0x3c14fe){logger[_0xbbc4('0x11')](_0xbbc4('0xc'),_0x32be07,_0x3c14fe);_0x2d2be0(_0x3c14fe);});});}exports[_0xbbc4('0x16')]=function(_0x43d3d0){var _0x58cb76=this;return new Promise(function(_0xc78289,_0x2abed7){return db['Dynamics365Account'][_0xbbc4('0x17')]({'raw':_0x43d3d0[_0xbbc4('0x18')]?_0x43d3d0[_0xbbc4('0x18')][_0xbbc4('0x19')]===undefined?!![]:![]:!![],'where':_0x43d3d0[_0xbbc4('0x18')]?_0x43d3d0[_0xbbc4('0x18')][_0xbbc4('0x1a')]||null:null,'attributes':_0x43d3d0[_0xbbc4('0x18')]?_0x43d3d0[_0xbbc4('0x18')][_0xbbc4('0x1b')]||null:null,'limit':_0x43d3d0[_0xbbc4('0x18')]?_0x43d3d0['options'][_0xbbc4('0x1c')]||null:null,'include':_0x43d3d0[_0xbbc4('0x18')]?_0x43d3d0[_0xbbc4('0x18')]['include']?_[_0xbbc4('0x1d')](_0x43d3d0[_0xbbc4('0x18')][_0xbbc4('0x1e')],function(_0x54d64e){return{'model':db[_0x54d64e[_0xbbc4('0x1f')]],'as':_0x54d64e['as'],'attributes':_0x54d64e[_0xbbc4('0x1b')],'include':_0x54d64e[_0xbbc4('0x1e')]?_[_0xbbc4('0x1d')](_0x54d64e[_0xbbc4('0x1e')],function(_0x35c5a4){return{'model':db[_0x35c5a4[_0xbbc4('0x1f')]],'as':_0x35c5a4['as'],'attributes':_0x35c5a4[_0xbbc4('0x1b')],'include':_0x35c5a4['include']?_['map'](_0x35c5a4[_0xbbc4('0x1e')],function(_0x183410){return{'model':db[_0x183410['model']],'as':_0x183410['as'],'attributes':_0x183410[_0xbbc4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbbc4('0x20')](function(_0x3210da){logger[_0xbbc4('0xb')](_0xbbc4('0x16'),_0x43d3d0);logger[_0xbbc4('0xd')](_0xbbc4('0x16'),_0x43d3d0,JSON[_0xbbc4('0x10')](_0x3210da));_0xc78289(_0x3210da);})[_0xbbc4('0x15')](function(_0x331e0d){logger[_0xbbc4('0x11')](_0xbbc4('0x16'),_0x331e0d[_0xbbc4('0x13')],_0x43d3d0);_0x2abed7(_0x58cb76['error'](0x1f4,_0x331e0d[_0xbbc4('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x1f4acd){var _0x4a09fe=this;return new Promise(function(_0x45ea8c,_0x10e49f){return db[_0xbbc4('0x21')][_0xbbc4('0x22')]({'raw':_0x1f4acd[_0xbbc4('0x18')]?_0x1f4acd['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f4acd[_0xbbc4('0x18')]?_0x1f4acd[_0xbbc4('0x18')][_0xbbc4('0x1a')]||null:null,'attributes':_0x1f4acd[_0xbbc4('0x18')]?_0x1f4acd[_0xbbc4('0x18')][_0xbbc4('0x1b')]||null:null,'include':_0x1f4acd[_0xbbc4('0x18')]?_0x1f4acd[_0xbbc4('0x18')][_0xbbc4('0x1e')]?_['map'](_0x1f4acd[_0xbbc4('0x18')][_0xbbc4('0x1e')],function(_0x360d61){return{'model':db[_0x360d61[_0xbbc4('0x1f')]],'as':_0x360d61['as'],'attributes':_0x360d61[_0xbbc4('0x1b')],'include':_0x360d61['include']?_[_0xbbc4('0x1d')](_0x360d61[_0xbbc4('0x1e')],function(_0x1a920d){return{'model':db[_0x1a920d[_0xbbc4('0x1f')]],'as':_0x1a920d['as'],'attributes':_0x1a920d['attributes'],'include':_0x1a920d[_0xbbc4('0x1e')]?_[_0xbbc4('0x1d')](_0x1a920d[_0xbbc4('0x1e')],function(_0x8bcb80){return{'model':db[_0x8bcb80[_0xbbc4('0x1f')]],'as':_0x8bcb80['as'],'attributes':_0x8bcb80['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbc4('0x20')](function(_0x4720e7){logger[_0xbbc4('0xb')](_0xbbc4('0x23'),_0x1f4acd);logger[_0xbbc4('0xd')](_0xbbc4('0x23'),_0x1f4acd,JSON[_0xbbc4('0x10')](_0x4720e7));_0x45ea8c(_0x4720e7);})['catch'](function(_0x522d8b){logger[_0xbbc4('0x11')](_0xbbc4('0x23'),_0x522d8b['message'],_0x1f4acd);_0x10e49f(_0x4a09fe[_0xbbc4('0x11')](0x1f4,_0x522d8b['message']));});});};
\ No newline at end of file
index 2164fbf..5f0cff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31df=['create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x73eea3,_0x4f2f07){var _0x429c65=function(_0x524361){while(--_0x524361){_0x73eea3['push'](_0x73eea3['shift']());}};_0x429c65(++_0x4f2f07);}(_0x31df,0x13d));var _0xf31d=function(_0x374aeb,_0x3eef46){_0x374aeb=_0x374aeb-0x0;var _0x1eaa7e=_0x31df[_0x374aeb];return _0x1eaa7e;};'use strict';var multer=require(_0xf31d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf31d('0x1'));var express=require(_0xf31d('0x2'));var router=express[_0xf31d('0x3')]();var fs_extra=require(_0xf31d('0x4'));var auth=require(_0xf31d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf31d('0x6'));var controller=require(_0xf31d('0x7'));router[_0xf31d('0x8')]('/',auth[_0xf31d('0x9')](),controller[_0xf31d('0xa')]);router[_0xf31d('0x8')](_0xf31d('0xb'),auth[_0xf31d('0x9')](),controller[_0xf31d('0xc')]);router[_0xf31d('0x8')]('/:id/fields',auth[_0xf31d('0x9')](),controller[_0xf31d('0xd')]);router[_0xf31d('0x8')](_0xf31d('0xe'),auth[_0xf31d('0x9')](),controller[_0xf31d('0xf')]);router[_0xf31d('0x8')](_0xf31d('0x10'),auth[_0xf31d('0x9')](),controller[_0xf31d('0x11')]);router[_0xf31d('0x12')]('/',auth[_0xf31d('0x9')](),controller[_0xf31d('0x13')]);router[_0xf31d('0x14')](_0xf31d('0xb'),auth[_0xf31d('0x9')](),controller[_0xf31d('0x15')]);router[_0xf31d('0x16')](_0xf31d('0xb'),auth[_0xf31d('0x9')](),controller['destroy']);module[_0xf31d('0x17')]=router;
\ No newline at end of file
+var _0x0c19=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','post','create','put'];(function(_0x15e950,_0x1db756){var _0x3425e5=function(_0x1fa0f4){while(--_0x1fa0f4){_0x15e950['push'](_0x15e950['shift']());}};_0x3425e5(++_0x1db756);}(_0x0c19,0xf5));var _0x90c1=function(_0x4ee754,_0x2256dc){_0x4ee754=_0x4ee754-0x0;var _0x283289=_0x0c19[_0x4ee754];return _0x283289;};'use strict';var multer=require(_0x90c1('0x0'));var util=require(_0x90c1('0x1'));var path=require(_0x90c1('0x2'));var timeout=require(_0x90c1('0x3'));var express=require(_0x90c1('0x4'));var router=express[_0x90c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x90c1('0x6'));var interaction=require(_0x90c1('0x7'));var config=require(_0x90c1('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0x90c1('0x9')]('/',auth[_0x90c1('0xa')](),controller['index']);router[_0x90c1('0x9')](_0x90c1('0xb'),auth[_0x90c1('0xa')](),controller[_0x90c1('0xc')]);router[_0x90c1('0x9')](_0x90c1('0xd'),auth[_0x90c1('0xa')](),controller['getFields']);router[_0x90c1('0x9')](_0x90c1('0xe'),auth['isAuthenticated'](),controller[_0x90c1('0xf')]);router['get']('/:id/descriptions',auth[_0x90c1('0xa')](),controller['getDescriptions']);router[_0x90c1('0x10')]('/',auth[_0x90c1('0xa')](),controller[_0x90c1('0x11')]);router[_0x90c1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x90c1('0x13')]);router[_0x90c1('0x14')](_0x90c1('0xb'),auth[_0x90c1('0xa')](),controller['destroy']);module[_0x90c1('0x15')]=router;
\ No newline at end of file
index c73f73d..771136b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ea=['sequelize','STRING','incident','phonecall'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x78ea,0x6c));var _0xa78e=function(_0x20b1f9,_0x1abe8a){_0x20b1f9=_0x20b1f9-0x0;var _0x578891=_0x78ea[_0x20b1f9];return _0x578891;};'use strict';var Sequelize=require(_0xa78e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa78e('0x1')]},'description':{'type':Sequelize[_0xa78e('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xa78e('0x2'),_0xa78e('0x3')),'defaultValue':_0xa78e('0x2')}};
\ No newline at end of file
+var _0x81bf=['incident','phonecall','sequelize','STRING'];(function(_0x3bdf86,_0x395e10){var _0xad3f66=function(_0x29377e){while(--_0x29377e){_0x3bdf86['push'](_0x3bdf86['shift']());}};_0xad3f66(++_0x395e10);}(_0x81bf,0xb6));var _0xf81b=function(_0x26012,_0x5cf856){_0x26012=_0x26012-0x0;var _0x35bb2d=_0x81bf[_0x26012];return _0x35bb2d;};'use strict';var Sequelize=require(_0xf81b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf81b('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0xf81b('0x2'),_0xf81b('0x3')),'defaultValue':_0xf81b('0x2')}};
\ No newline at end of file
index da2c67c..1215077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4040=['length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','find','create','body','getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x5a07d4,_0x501d6c){var _0xacb3e3=function(_0x104c4e){while(--_0x104c4e){_0x5a07d4['push'](_0x5a07d4['shift']());}};_0xacb3e3(++_0x501d6c);}(_0x4040,0x10e));var _0x0404=function(_0x507d23,_0x1190c6){_0x507d23=_0x507d23-0x0;var _0x5eef1c=_0x4040[_0x507d23];return _0x5eef1c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0404('0x0'));var jsonpatch=require(_0x0404('0x1'));var rp=require(_0x0404('0x2'));var moment=require(_0x0404('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0404('0x4'));var util=require(_0x0404('0x5'));var path=require('path');var sox=require(_0x0404('0x6'));var csv=require(_0x0404('0x7'));var ejs=require(_0x0404('0x8'));var fs=require('fs');var fs_extra=require(_0x0404('0x9'));var _=require(_0x0404('0xa'));var squel=require(_0x0404('0xb'));var crypto=require(_0x0404('0xc'));var jsforce=require(_0x0404('0xd'));var deskjs=require(_0x0404('0xe'));var toCsv=require(_0x0404('0x7'));var querystring=require('querystring');var Papa=require(_0x0404('0xf'));var Redis=require(_0x0404('0x10'));var authService=require(_0x0404('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0404('0x12'));var hardwareService=require(_0x0404('0x13'));var logger=require('../../config/logger')(_0x0404('0x14'));var utils=require('../../config/utils');var config=require(_0x0404('0x15'));var licenseUtil=require(_0x0404('0x16'));var db=require(_0x0404('0x17'))['db'];function respondWithStatusCode(_0x5c1522,_0x540bca){_0x540bca=_0x540bca||0xcc;return function(_0x3399d4){if(_0x3399d4){return _0x5c1522[_0x0404('0x18')](_0x540bca);}return _0x5c1522[_0x0404('0x19')](_0x540bca)[_0x0404('0x1a')]();};}function respondWithResult(_0xaa9881,_0x4bb24a){_0x4bb24a=_0x4bb24a||0xc8;return function(_0x4110a9){if(_0x4110a9){return _0xaa9881['status'](_0x4bb24a)['json'](_0x4110a9);}};}function respondWithFilteredResult(_0x5d594d,_0x3fd6dc){return function(_0x51d7cb){if(_0x51d7cb){var _0x1e0d16=typeof _0x3fd6dc[_0x0404('0x1b')]===_0x0404('0x1c')&&typeof _0x3fd6dc['limit']===_0x0404('0x1c');var _0x1451e6=_0x51d7cb[_0x0404('0x1d')];var _0x496db9=_0x1e0d16?0x0:_0x3fd6dc[_0x0404('0x1b')];var _0x21562a=_0x1e0d16?_0x51d7cb[_0x0404('0x1d')]:_0x3fd6dc[_0x0404('0x1b')]+_0x3fd6dc[_0x0404('0x1e')];var _0x675079;if(_0x21562a>=_0x1451e6){_0x21562a=_0x1451e6;_0x675079=0xc8;}else{_0x675079=0xce;}_0x5d594d[_0x0404('0x19')](_0x675079);return _0x5d594d[_0x0404('0x1f')](_0x0404('0x20'),_0x496db9+'-'+_0x21562a+'/'+_0x1451e6)[_0x0404('0x21')](_0x51d7cb);}return null;};}function patchUpdates(_0x269933){return function(_0x109638){try{jsonpatch[_0x0404('0x22')](_0x109638,_0x269933,!![]);}catch(_0x43adb4){return BPromise[_0x0404('0x23')](_0x43adb4);}return _0x109638[_0x0404('0x24')]();};}function saveUpdates(_0x4ed9c0,_0x5d1bad){return function(_0xa7e313){if(_0xa7e313){return _0xa7e313[_0x0404('0x25')](_0x4ed9c0)[_0x0404('0x26')](function(_0x4cbff1){return _0x4cbff1;});}return null;};}function removeEntity(_0x1e6072,_0x63d0c5){return function(_0x180d88){if(_0x180d88){return _0x180d88[_0x0404('0x27')]()[_0x0404('0x26')](function(){_0x1e6072[_0x0404('0x19')](0xcc)[_0x0404('0x1a')]();});}};}function handleEntityNotFound(_0x36344a,_0x5bfcba){return function(_0x31b7c9){if(!_0x31b7c9){_0x36344a['sendStatus'](0x194);}return _0x31b7c9;};}function handleError(_0x23e27f,_0x2469e2){_0x2469e2=_0x2469e2||0x1f4;return function(_0x3f1d2d){logger[_0x0404('0x28')](_0x3f1d2d[_0x0404('0x29')]);if(_0x3f1d2d[_0x0404('0x2a')]){delete _0x3f1d2d['name'];}_0x23e27f['status'](_0x2469e2)[_0x0404('0x2b')](_0x3f1d2d);};}exports[_0x0404('0x2c')]=function(_0x1e6f59,_0x2b183b){var _0x243282={},_0x58e0ed={},_0x23a291={'count':0x0,'rows':[]};var _0x20dbe9=_[_0x0404('0x2d')](db[_0x0404('0x2e')][_0x0404('0x2f')],function(_0x4c9709){return{'name':_0x4c9709[_0x0404('0x30')],'type':_0x4c9709[_0x0404('0x31')][_0x0404('0x32')]};});_0x58e0ed[_0x0404('0x33')]=_[_0x0404('0x2d')](_0x20dbe9,_0x0404('0x2a'));_0x58e0ed[_0x0404('0x34')]=_[_0x0404('0x35')](_0x1e6f59['query']);_0x58e0ed[_0x0404('0x36')]=_[_0x0404('0x37')](_0x58e0ed['model'],_0x58e0ed[_0x0404('0x34')]);_0x243282['attributes']=_[_0x0404('0x37')](_0x58e0ed['model'],qs[_0x0404('0x38')](_0x1e6f59[_0x0404('0x34')][_0x0404('0x38')]));_0x243282[_0x0404('0x39')]=_0x243282[_0x0404('0x39')][_0x0404('0x3a')]?_0x243282[_0x0404('0x39')]:_0x58e0ed[_0x0404('0x33')];if(!_0x1e6f59['query']['hasOwnProperty'](_0x0404('0x3b'))){_0x243282[_0x0404('0x1e')]=qs[_0x0404('0x1e')](_0x1e6f59['query']['limit']);_0x243282[_0x0404('0x1b')]=qs[_0x0404('0x1b')](_0x1e6f59[_0x0404('0x34')][_0x0404('0x1b')]);}_0x243282[_0x0404('0x3c')]=qs[_0x0404('0x3d')](_0x1e6f59[_0x0404('0x34')][_0x0404('0x3d')]);_0x243282['where']=qs[_0x0404('0x36')](_[_0x0404('0x3e')](_0x1e6f59[_0x0404('0x34')],_0x58e0ed[_0x0404('0x36')]),_0x20dbe9);if(_0x1e6f59[_0x0404('0x34')]['filter']){_0x243282[_0x0404('0x3f')]=_[_0x0404('0x40')](_0x243282[_0x0404('0x3f')],{'$or':_['map'](_0x20dbe9,function(_0x4cad10){if(_0x4cad10[_0x0404('0x31')]!==_0x0404('0x41')){var _0x5c3e1d={};_0x5c3e1d[_0x4cad10['name']]={'$like':'%'+_0x1e6f59[_0x0404('0x34')][_0x0404('0x42')]+'%'};return _0x5c3e1d;}})});}_0x243282=_['merge']({},_0x243282,_0x1e6f59[_0x0404('0x43')]);var _0x3eaddd={'where':_0x243282[_0x0404('0x3f')]};return db[_0x0404('0x2e')][_0x0404('0x1d')](_0x3eaddd)[_0x0404('0x26')](function(_0x205cd7){_0x23a291[_0x0404('0x1d')]=_0x205cd7;if(_0x1e6f59[_0x0404('0x34')][_0x0404('0x44')]){_0x243282['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x0404('0x45')](_0x243282);})['then'](function(_0x3c47cd){_0x23a291[_0x0404('0x46')]=_0x3c47cd;return _0x23a291;})[_0x0404('0x26')](respondWithFilteredResult(_0x2b183b,_0x243282))[_0x0404('0x47')](handleError(_0x2b183b,null));};exports['show']=function(_0x23ebc7,_0x1d59ba){var _0x2ac53b={'raw':![],'where':{'id':_0x23ebc7[_0x0404('0x48')]['id']}},_0x5b2c05={};_0x5b2c05['model']=_[_0x0404('0x35')](db[_0x0404('0x2e')]['rawAttributes']);_0x5b2c05[_0x0404('0x34')]=_[_0x0404('0x35')](_0x23ebc7['query']);_0x5b2c05[_0x0404('0x36')]=_['intersection'](_0x5b2c05['model'],_0x5b2c05[_0x0404('0x34')]);_0x2ac53b[_0x0404('0x39')]=_[_0x0404('0x37')](_0x5b2c05[_0x0404('0x33')],qs[_0x0404('0x38')](_0x23ebc7[_0x0404('0x34')]['fields']));_0x2ac53b[_0x0404('0x39')]=_0x2ac53b[_0x0404('0x39')][_0x0404('0x3a')]?_0x2ac53b['attributes']:_0x5b2c05[_0x0404('0x33')];if(_0x23ebc7[_0x0404('0x34')]['includeAll']){_0x2ac53b['include']=[{'all':!![]}];}_0x2ac53b=_[_0x0404('0x40')]({},_0x2ac53b,_0x23ebc7[_0x0404('0x43')]);return db[_0x0404('0x2e')][_0x0404('0x49')](_0x2ac53b)['then'](handleEntityNotFound(_0x1d59ba,null))['then'](respondWithResult(_0x1d59ba,null))[_0x0404('0x47')](handleError(_0x1d59ba,null));};exports[_0x0404('0x4a')]=function(_0x3d710e,_0x247cc0){return db[_0x0404('0x2e')]['create'](_0x3d710e[_0x0404('0x4b')],{})[_0x0404('0x26')](respondWithResult(_0x247cc0,0xc9))[_0x0404('0x47')](handleError(_0x247cc0,null));};exports['update']=function(_0x449302,_0x502da1){if(_0x449302[_0x0404('0x4b')]['id']){delete _0x449302['body']['id'];}return db[_0x0404('0x2e')][_0x0404('0x49')]({'where':{'id':_0x449302[_0x0404('0x48')]['id']}})[_0x0404('0x26')](handleEntityNotFound(_0x502da1,null))['then'](saveUpdates(_0x449302[_0x0404('0x4b')],null))[_0x0404('0x26')](respondWithResult(_0x502da1,null))[_0x0404('0x47')](handleError(_0x502da1,null));};exports[_0x0404('0x27')]=function(_0x436337,_0x1b0f3f){return db[_0x0404('0x2e')][_0x0404('0x49')]({'where':{'id':_0x436337['params']['id']}})['then'](handleEntityNotFound(_0x1b0f3f,null))[_0x0404('0x26')](removeEntity(_0x1b0f3f,null))[_0x0404('0x47')](handleError(_0x1b0f3f,null));};exports[_0x0404('0x4c')]=function(_0xa51d0,_0x131219,_0x57edd0){var _0x48c9c4={};var _0x42fe84={};var _0x137673;var _0x1eab71;return db['Dynamics365Configuration'][_0x0404('0x4d')]({'where':{'id':_0xa51d0[_0x0404('0x48')]['id']}})[_0x0404('0x26')](handleEntityNotFound(_0x131219,null))[_0x0404('0x26')](function(_0x336f95){if(_0x336f95){_0x137673=_0x336f95;_0x42fe84['model']=_[_0x0404('0x35')](db[_0x0404('0x4e')][_0x0404('0x2f')]);_0x42fe84[_0x0404('0x34')]=_[_0x0404('0x35')](_0xa51d0[_0x0404('0x34')]);_0x42fe84[_0x0404('0x36')]=_[_0x0404('0x37')](_0x42fe84['model'],_0x42fe84[_0x0404('0x34')]);_0x48c9c4['attributes']=_[_0x0404('0x37')](_0x42fe84[_0x0404('0x33')],qs[_0x0404('0x38')](_0xa51d0[_0x0404('0x34')][_0x0404('0x38')]));_0x48c9c4[_0x0404('0x39')]=_0x48c9c4[_0x0404('0x39')]['length']?_0x48c9c4[_0x0404('0x39')]:_0x42fe84['model'];_0x48c9c4[_0x0404('0x3c')]=qs[_0x0404('0x3d')](_0xa51d0[_0x0404('0x34')]['sort']);_0x48c9c4[_0x0404('0x3f')]=qs[_0x0404('0x36')](_[_0x0404('0x3e')](_0xa51d0[_0x0404('0x34')],_0x42fe84[_0x0404('0x36')]));if(_0xa51d0['query'][_0x0404('0x42')]){_0x48c9c4['where']=_[_0x0404('0x40')](_0x48c9c4[_0x0404('0x3f')],{'$or':_[_0x0404('0x2d')](_0x48c9c4[_0x0404('0x39')],function(_0x5b6409){var _0x58a748={};_0x58a748[_0x5b6409]={'$like':'%'+_0xa51d0[_0x0404('0x34')]['filter']+'%'};return _0x58a748;})});}_0x48c9c4=_[_0x0404('0x40')]({},_0x48c9c4,_0xa51d0[_0x0404('0x43')]);return _0x137673[_0x0404('0x4c')](_0x48c9c4);}})[_0x0404('0x26')](function(_0x320cc8){if(_0x320cc8){_0x1eab71=_0x320cc8[_0x0404('0x3a')];if(!_0xa51d0[_0x0404('0x34')][_0x0404('0x4f')]('nolimit')){_0x48c9c4[_0x0404('0x1e')]=qs['limit'](_0xa51d0[_0x0404('0x34')][_0x0404('0x1e')]);_0x48c9c4[_0x0404('0x1b')]=qs['offset'](_0xa51d0[_0x0404('0x34')]['offset']);}return _0x137673[_0x0404('0x4c')](_0x48c9c4);}})['then'](function(_0x3786ab){if(_0x3786ab){return _0x3786ab?{'count':_0x1eab71,'rows':_0x3786ab}:null;}})[_0x0404('0x26')](respondWithResult(_0x131219,null))[_0x0404('0x47')](handleError(_0x131219,null));};exports[_0x0404('0x50')]=function(_0x3a737e,_0x566397,_0xb9e0cd){var _0x13f1b2={};var _0x2a7ba8={};var _0x384470;var _0x255e04;return db[_0x0404('0x2e')]['findOne']({'where':{'id':_0x3a737e['params']['id']}})[_0x0404('0x26')](handleEntityNotFound(_0x566397,null))['then'](function(_0xbf32ac){if(_0xbf32ac){_0x384470=_0xbf32ac;_0x2a7ba8[_0x0404('0x33')]=_[_0x0404('0x35')](db[_0x0404('0x4e')]['rawAttributes']);_0x2a7ba8['query']=_[_0x0404('0x35')](_0x3a737e[_0x0404('0x34')]);_0x2a7ba8[_0x0404('0x36')]=_[_0x0404('0x37')](_0x2a7ba8['model'],_0x2a7ba8[_0x0404('0x34')]);_0x13f1b2[_0x0404('0x39')]=_[_0x0404('0x37')](_0x2a7ba8['model'],qs[_0x0404('0x38')](_0x3a737e['query']['fields']));_0x13f1b2[_0x0404('0x39')]=_0x13f1b2[_0x0404('0x39')]['length']?_0x13f1b2[_0x0404('0x39')]:_0x2a7ba8[_0x0404('0x33')];_0x13f1b2[_0x0404('0x3c')]=qs[_0x0404('0x3d')](_0x3a737e[_0x0404('0x34')][_0x0404('0x3d')]);_0x13f1b2['where']=qs[_0x0404('0x36')](_['pick'](_0x3a737e[_0x0404('0x34')],_0x2a7ba8[_0x0404('0x36')]));if(_0x3a737e[_0x0404('0x34')][_0x0404('0x42')]){_0x13f1b2[_0x0404('0x3f')]=_[_0x0404('0x40')](_0x13f1b2[_0x0404('0x3f')],{'$or':_[_0x0404('0x2d')](_0x13f1b2['attributes'],function(_0x12c37b){var _0x6af865={};_0x6af865[_0x12c37b]={'$like':'%'+_0x3a737e[_0x0404('0x34')][_0x0404('0x42')]+'%'};return _0x6af865;})});}_0x13f1b2=_[_0x0404('0x40')]({},_0x13f1b2,_0x3a737e[_0x0404('0x43')]);return _0x384470[_0x0404('0x50')](_0x13f1b2);}})[_0x0404('0x26')](function(_0x501de0){if(_0x501de0){_0x255e04=_0x501de0['length'];if(!_0x3a737e[_0x0404('0x34')]['hasOwnProperty'](_0x0404('0x3b'))){_0x13f1b2[_0x0404('0x1e')]=qs[_0x0404('0x1e')](_0x3a737e[_0x0404('0x34')][_0x0404('0x1e')]);_0x13f1b2[_0x0404('0x1b')]=qs[_0x0404('0x1b')](_0x3a737e[_0x0404('0x34')][_0x0404('0x1b')]);}return _0x384470[_0x0404('0x50')](_0x13f1b2);}})[_0x0404('0x26')](function(_0x1b3929){if(_0x1b3929){return _0x1b3929?{'count':_0x255e04,'rows':_0x1b3929}:null;}})[_0x0404('0x26')](respondWithResult(_0x566397,null))[_0x0404('0x47')](handleError(_0x566397,null));};exports[_0x0404('0x51')]=function(_0x39e1fa,_0x466f90,_0x3d91ec){var _0x233b20={};var _0x37adb3={};var _0x35af53;var _0xb16dc7;return db[_0x0404('0x2e')][_0x0404('0x4d')]({'where':{'id':_0x39e1fa['params']['id']}})[_0x0404('0x26')](handleEntityNotFound(_0x466f90,null))[_0x0404('0x26')](function(_0x2b8a69){if(_0x2b8a69){_0x35af53=_0x2b8a69;_0x37adb3[_0x0404('0x33')]=_[_0x0404('0x35')](db[_0x0404('0x4e')]['rawAttributes']);_0x37adb3[_0x0404('0x34')]=_[_0x0404('0x35')](_0x39e1fa[_0x0404('0x34')]);_0x37adb3[_0x0404('0x36')]=_[_0x0404('0x37')](_0x37adb3[_0x0404('0x33')],_0x37adb3['query']);_0x233b20[_0x0404('0x39')]=_[_0x0404('0x37')](_0x37adb3['model'],qs[_0x0404('0x38')](_0x39e1fa[_0x0404('0x34')]['fields']));_0x233b20[_0x0404('0x39')]=_0x233b20[_0x0404('0x39')][_0x0404('0x3a')]?_0x233b20[_0x0404('0x39')]:_0x37adb3['model'];_0x233b20[_0x0404('0x3c')]=qs[_0x0404('0x3d')](_0x39e1fa[_0x0404('0x34')][_0x0404('0x3d')]);_0x233b20[_0x0404('0x3f')]=qs[_0x0404('0x36')](_[_0x0404('0x3e')](_0x39e1fa[_0x0404('0x34')],_0x37adb3['filters']));if(_0x39e1fa[_0x0404('0x34')][_0x0404('0x42')]){_0x233b20[_0x0404('0x3f')]=_[_0x0404('0x40')](_0x233b20[_0x0404('0x3f')],{'$or':_['map'](_0x233b20[_0x0404('0x39')],function(_0x486342){var _0x533234={};_0x533234[_0x486342]={'$like':'%'+_0x39e1fa['query'][_0x0404('0x42')]+'%'};return _0x533234;})});}_0x233b20=_['merge']({},_0x233b20,_0x39e1fa[_0x0404('0x43')]);return _0x35af53[_0x0404('0x51')](_0x233b20);}})[_0x0404('0x26')](function(_0x126ceb){if(_0x126ceb){_0xb16dc7=_0x126ceb[_0x0404('0x3a')];if(!_0x39e1fa[_0x0404('0x34')][_0x0404('0x4f')]('nolimit')){_0x233b20[_0x0404('0x1e')]=qs['limit'](_0x39e1fa[_0x0404('0x34')][_0x0404('0x1e')]);_0x233b20['offset']=qs[_0x0404('0x1b')](_0x39e1fa['query'][_0x0404('0x1b')]);}return _0x35af53[_0x0404('0x51')](_0x233b20);}})[_0x0404('0x26')](function(_0x1cc4d8){if(_0x1cc4d8){return _0x1cc4d8?{'count':_0xb16dc7,'rows':_0x1cc4d8}:null;}})[_0x0404('0x26')](respondWithResult(_0x466f90,null))[_0x0404('0x47')](handleError(_0x466f90,null));};
\ No newline at end of file
+var _0xeb46=['where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','catch','getFields','getSubjects','findOne','Dynamics365Field','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','Dynamics365Configuration','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xeb46,0x15b));var _0x6eb4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb46[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6eb4('0x0'));var rimraf=require(_0x6eb4('0x1'));var zipdir=require(_0x6eb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6eb4('0x3'));var moment=require('moment');var BPromise=require(_0x6eb4('0x4'));var Mustache=require(_0x6eb4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6eb4('0x6'));var csv=require(_0x6eb4('0x7'));var ejs=require(_0x6eb4('0x8'));var fs=require('fs');var fs_extra=require(_0x6eb4('0x9'));var _=require(_0x6eb4('0xa'));var squel=require(_0x6eb4('0xb'));var crypto=require('crypto');var jsforce=require(_0x6eb4('0xc'));var deskjs=require(_0x6eb4('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6eb4('0xe'));var Papa=require(_0x6eb4('0xf'));var Redis=require(_0x6eb4('0x10'));var authService=require(_0x6eb4('0x11'));var qs=require(_0x6eb4('0x12'));var as=require(_0x6eb4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6eb4('0x14'));var utils=require('../../config/utils');var config=require(_0x6eb4('0x15'));var licenseUtil=require(_0x6eb4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a5755,_0x298dd4){_0x298dd4=_0x298dd4||0xcc;return function(_0x2d21ca){if(_0x2d21ca){return _0x3a5755['sendStatus'](_0x298dd4);}return _0x3a5755[_0x6eb4('0x17')](_0x298dd4)[_0x6eb4('0x18')]();};}function respondWithResult(_0x173e74,_0x1e4c0f){_0x1e4c0f=_0x1e4c0f||0xc8;return function(_0x5769b5){if(_0x5769b5){return _0x173e74['status'](_0x1e4c0f)[_0x6eb4('0x19')](_0x5769b5);}};}function respondWithFilteredResult(_0x5845a3,_0x680c9a){return function(_0xfa69f1){if(_0xfa69f1){var _0xe71787=typeof _0x680c9a[_0x6eb4('0x1a')]===_0x6eb4('0x1b')&&typeof _0x680c9a[_0x6eb4('0x1c')]===_0x6eb4('0x1b');var _0x32c8ea=_0xfa69f1[_0x6eb4('0x1d')];var _0x40a397=_0xe71787?0x0:_0x680c9a[_0x6eb4('0x1a')];var _0x37bffd=_0xe71787?_0xfa69f1['count']:_0x680c9a[_0x6eb4('0x1a')]+_0x680c9a['limit'];var _0x337cf5;if(_0x37bffd>=_0x32c8ea){_0x37bffd=_0x32c8ea;_0x337cf5=0xc8;}else{_0x337cf5=0xce;}_0x5845a3['status'](_0x337cf5);return _0x5845a3[_0x6eb4('0x1e')](_0x6eb4('0x1f'),_0x40a397+'-'+_0x37bffd+'/'+_0x32c8ea)[_0x6eb4('0x19')](_0xfa69f1);}return null;};}function patchUpdates(_0x464e0e){return function(_0x244bdc){try{jsonpatch[_0x6eb4('0x20')](_0x244bdc,_0x464e0e,!![]);}catch(_0x696159){return BPromise[_0x6eb4('0x21')](_0x696159);}return _0x244bdc[_0x6eb4('0x22')]();};}function saveUpdates(_0x1ee470,_0x213bdb){return function(_0x4d5ace){if(_0x4d5ace){return _0x4d5ace[_0x6eb4('0x23')](_0x1ee470)[_0x6eb4('0x24')](function(_0x41a148){return _0x41a148;});}return null;};}function removeEntity(_0x36e297,_0x2e02c4){return function(_0x594af1){if(_0x594af1){return _0x594af1[_0x6eb4('0x25')]()['then'](function(){_0x36e297[_0x6eb4('0x17')](0xcc)[_0x6eb4('0x18')]();});}};}function handleEntityNotFound(_0x38c6df,_0x141a56){return function(_0x3646ea){if(!_0x3646ea){_0x38c6df[_0x6eb4('0x26')](0x194);}return _0x3646ea;};}function handleError(_0x38c413,_0x333451){_0x333451=_0x333451||0x1f4;return function(_0x1a0ee4){logger[_0x6eb4('0x27')](_0x1a0ee4[_0x6eb4('0x28')]);if(_0x1a0ee4[_0x6eb4('0x29')]){delete _0x1a0ee4[_0x6eb4('0x29')];}_0x38c413['status'](_0x333451)[_0x6eb4('0x2a')](_0x1a0ee4);};}exports['index']=function(_0x18dc9a,_0x33baf5){var _0x1d2d65={},_0x3518a2={},_0x1725a0={'count':0x0,'rows':[]};var _0x4f04ec=_[_0x6eb4('0x2b')](db[_0x6eb4('0x2c')]['rawAttributes'],function(_0x53a452){return{'name':_0x53a452[_0x6eb4('0x2d')],'type':_0x53a452['type'][_0x6eb4('0x2e')]};});_0x3518a2[_0x6eb4('0x2f')]=_[_0x6eb4('0x2b')](_0x4f04ec,_0x6eb4('0x29'));_0x3518a2[_0x6eb4('0x30')]=_[_0x6eb4('0x31')](_0x18dc9a['query']);_0x3518a2[_0x6eb4('0x32')]=_['intersection'](_0x3518a2[_0x6eb4('0x2f')],_0x3518a2['query']);_0x1d2d65[_0x6eb4('0x33')]=_[_0x6eb4('0x34')](_0x3518a2[_0x6eb4('0x2f')],qs[_0x6eb4('0x35')](_0x18dc9a['query']['fields']));_0x1d2d65[_0x6eb4('0x33')]=_0x1d2d65[_0x6eb4('0x33')][_0x6eb4('0x36')]?_0x1d2d65[_0x6eb4('0x33')]:_0x3518a2[_0x6eb4('0x2f')];if(!_0x18dc9a[_0x6eb4('0x30')]['hasOwnProperty'](_0x6eb4('0x37'))){_0x1d2d65[_0x6eb4('0x1c')]=qs[_0x6eb4('0x1c')](_0x18dc9a[_0x6eb4('0x30')][_0x6eb4('0x1c')]);_0x1d2d65[_0x6eb4('0x1a')]=qs['offset'](_0x18dc9a[_0x6eb4('0x30')][_0x6eb4('0x1a')]);}_0x1d2d65[_0x6eb4('0x38')]=qs[_0x6eb4('0x39')](_0x18dc9a[_0x6eb4('0x30')][_0x6eb4('0x39')]);_0x1d2d65[_0x6eb4('0x3a')]=qs[_0x6eb4('0x32')](_[_0x6eb4('0x3b')](_0x18dc9a['query'],_0x3518a2['filters']),_0x4f04ec);if(_0x18dc9a['query'][_0x6eb4('0x3c')]){_0x1d2d65[_0x6eb4('0x3a')]=_[_0x6eb4('0x3d')](_0x1d2d65[_0x6eb4('0x3a')],{'$or':_[_0x6eb4('0x2b')](_0x4f04ec,function(_0xba364c){if(_0xba364c[_0x6eb4('0x3e')]!==_0x6eb4('0x3f')){var _0x561ab2={};_0x561ab2[_0xba364c[_0x6eb4('0x29')]]={'$like':'%'+_0x18dc9a[_0x6eb4('0x30')][_0x6eb4('0x3c')]+'%'};return _0x561ab2;}})});}_0x1d2d65=_[_0x6eb4('0x3d')]({},_0x1d2d65,_0x18dc9a[_0x6eb4('0x40')]);var _0x4d6725={'where':_0x1d2d65[_0x6eb4('0x3a')]};return db['Dynamics365Configuration'][_0x6eb4('0x1d')](_0x4d6725)['then'](function(_0xf0ad95){_0x1725a0['count']=_0xf0ad95;if(_0x18dc9a[_0x6eb4('0x30')][_0x6eb4('0x41')]){_0x1d2d65[_0x6eb4('0x42')]=[{'all':!![]}];}return db[_0x6eb4('0x2c')]['findAll'](_0x1d2d65);})['then'](function(_0x2e507e){_0x1725a0[_0x6eb4('0x43')]=_0x2e507e;return _0x1725a0;})['then'](respondWithFilteredResult(_0x33baf5,_0x1d2d65))['catch'](handleError(_0x33baf5,null));};exports[_0x6eb4('0x44')]=function(_0x4d91a8,_0x5c4849){var _0x1b8295={'raw':![],'where':{'id':_0x4d91a8[_0x6eb4('0x45')]['id']}},_0x17d29e={};_0x17d29e[_0x6eb4('0x2f')]=_[_0x6eb4('0x31')](db[_0x6eb4('0x2c')][_0x6eb4('0x46')]);_0x17d29e[_0x6eb4('0x30')]=_[_0x6eb4('0x31')](_0x4d91a8[_0x6eb4('0x30')]);_0x17d29e[_0x6eb4('0x32')]=_[_0x6eb4('0x34')](_0x17d29e[_0x6eb4('0x2f')],_0x17d29e[_0x6eb4('0x30')]);_0x1b8295[_0x6eb4('0x33')]=_[_0x6eb4('0x34')](_0x17d29e[_0x6eb4('0x2f')],qs[_0x6eb4('0x35')](_0x4d91a8['query']['fields']));_0x1b8295[_0x6eb4('0x33')]=_0x1b8295[_0x6eb4('0x33')][_0x6eb4('0x36')]?_0x1b8295[_0x6eb4('0x33')]:_0x17d29e[_0x6eb4('0x2f')];if(_0x4d91a8['query'][_0x6eb4('0x41')]){_0x1b8295[_0x6eb4('0x42')]=[{'all':!![]}];}_0x1b8295=_[_0x6eb4('0x3d')]({},_0x1b8295,_0x4d91a8[_0x6eb4('0x40')]);return db['Dynamics365Configuration'][_0x6eb4('0x47')](_0x1b8295)[_0x6eb4('0x24')](handleEntityNotFound(_0x5c4849,null))[_0x6eb4('0x24')](respondWithResult(_0x5c4849,null))['catch'](handleError(_0x5c4849,null));};exports[_0x6eb4('0x48')]=function(_0x203aa5,_0x59abb3){return db['Dynamics365Configuration'][_0x6eb4('0x48')](_0x203aa5[_0x6eb4('0x49')],{})[_0x6eb4('0x24')](respondWithResult(_0x59abb3,0xc9))[_0x6eb4('0x4a')](handleError(_0x59abb3,null));};exports[_0x6eb4('0x23')]=function(_0x33c663,_0x35e550){if(_0x33c663['body']['id']){delete _0x33c663[_0x6eb4('0x49')]['id'];}return db[_0x6eb4('0x2c')]['find']({'where':{'id':_0x33c663[_0x6eb4('0x45')]['id']}})[_0x6eb4('0x24')](handleEntityNotFound(_0x35e550,null))[_0x6eb4('0x24')](saveUpdates(_0x33c663[_0x6eb4('0x49')],null))[_0x6eb4('0x24')](respondWithResult(_0x35e550,null))[_0x6eb4('0x4a')](handleError(_0x35e550,null));};exports[_0x6eb4('0x25')]=function(_0x9d0d4a,_0x4d9dfe){return db[_0x6eb4('0x2c')][_0x6eb4('0x47')]({'where':{'id':_0x9d0d4a[_0x6eb4('0x45')]['id']}})[_0x6eb4('0x24')](handleEntityNotFound(_0x4d9dfe,null))[_0x6eb4('0x24')](removeEntity(_0x4d9dfe,null))['catch'](handleError(_0x4d9dfe,null));};exports[_0x6eb4('0x4b')]=function(_0x536fe5,_0x2c3e7d,_0x3287b1){var _0xa5c3e0={};var _0x23d396={};var _0x4a4758;var _0x1b3e37;return db[_0x6eb4('0x2c')]['findOne']({'where':{'id':_0x536fe5['params']['id']}})[_0x6eb4('0x24')](handleEntityNotFound(_0x2c3e7d,null))['then'](function(_0x5ab614){if(_0x5ab614){_0x4a4758=_0x5ab614;_0x23d396[_0x6eb4('0x2f')]=_[_0x6eb4('0x31')](db['Dynamics365Field'][_0x6eb4('0x46')]);_0x23d396[_0x6eb4('0x30')]=_['keys'](_0x536fe5[_0x6eb4('0x30')]);_0x23d396[_0x6eb4('0x32')]=_[_0x6eb4('0x34')](_0x23d396['model'],_0x23d396[_0x6eb4('0x30')]);_0xa5c3e0[_0x6eb4('0x33')]=_['intersection'](_0x23d396[_0x6eb4('0x2f')],qs[_0x6eb4('0x35')](_0x536fe5[_0x6eb4('0x30')][_0x6eb4('0x35')]));_0xa5c3e0['attributes']=_0xa5c3e0[_0x6eb4('0x33')][_0x6eb4('0x36')]?_0xa5c3e0[_0x6eb4('0x33')]:_0x23d396[_0x6eb4('0x2f')];_0xa5c3e0[_0x6eb4('0x38')]=qs[_0x6eb4('0x39')](_0x536fe5[_0x6eb4('0x30')][_0x6eb4('0x39')]);_0xa5c3e0[_0x6eb4('0x3a')]=qs['filters'](_[_0x6eb4('0x3b')](_0x536fe5['query'],_0x23d396['filters']));if(_0x536fe5['query'][_0x6eb4('0x3c')]){_0xa5c3e0[_0x6eb4('0x3a')]=_[_0x6eb4('0x3d')](_0xa5c3e0[_0x6eb4('0x3a')],{'$or':_[_0x6eb4('0x2b')](_0xa5c3e0[_0x6eb4('0x33')],function(_0x5df163){var _0x468630={};_0x468630[_0x5df163]={'$like':'%'+_0x536fe5['query'][_0x6eb4('0x3c')]+'%'};return _0x468630;})});}_0xa5c3e0=_['merge']({},_0xa5c3e0,_0x536fe5[_0x6eb4('0x40')]);return _0x4a4758[_0x6eb4('0x4b')](_0xa5c3e0);}})[_0x6eb4('0x24')](function(_0x18cb17){if(_0x18cb17){_0x1b3e37=_0x18cb17[_0x6eb4('0x36')];if(!_0x536fe5[_0x6eb4('0x30')]['hasOwnProperty'](_0x6eb4('0x37'))){_0xa5c3e0[_0x6eb4('0x1c')]=qs[_0x6eb4('0x1c')](_0x536fe5[_0x6eb4('0x30')][_0x6eb4('0x1c')]);_0xa5c3e0[_0x6eb4('0x1a')]=qs[_0x6eb4('0x1a')](_0x536fe5['query'][_0x6eb4('0x1a')]);}return _0x4a4758[_0x6eb4('0x4b')](_0xa5c3e0);}})[_0x6eb4('0x24')](function(_0x58a05b){if(_0x58a05b){return _0x58a05b?{'count':_0x1b3e37,'rows':_0x58a05b}:null;}})[_0x6eb4('0x24')](respondWithResult(_0x2c3e7d,null))[_0x6eb4('0x4a')](handleError(_0x2c3e7d,null));};exports[_0x6eb4('0x4c')]=function(_0x22a21c,_0x29ab05,_0x3d670a){var _0x377de6={};var _0x18c0af={};var _0x44a2ff;var _0x26da2b;return db[_0x6eb4('0x2c')][_0x6eb4('0x4d')]({'where':{'id':_0x22a21c[_0x6eb4('0x45')]['id']}})['then'](handleEntityNotFound(_0x29ab05,null))[_0x6eb4('0x24')](function(_0x166d33){if(_0x166d33){_0x44a2ff=_0x166d33;_0x18c0af['model']=_[_0x6eb4('0x31')](db[_0x6eb4('0x4e')][_0x6eb4('0x46')]);_0x18c0af['query']=_['keys'](_0x22a21c[_0x6eb4('0x30')]);_0x18c0af['filters']=_['intersection'](_0x18c0af[_0x6eb4('0x2f')],_0x18c0af['query']);_0x377de6[_0x6eb4('0x33')]=_['intersection'](_0x18c0af[_0x6eb4('0x2f')],qs[_0x6eb4('0x35')](_0x22a21c[_0x6eb4('0x30')][_0x6eb4('0x35')]));_0x377de6[_0x6eb4('0x33')]=_0x377de6['attributes'][_0x6eb4('0x36')]?_0x377de6['attributes']:_0x18c0af[_0x6eb4('0x2f')];_0x377de6[_0x6eb4('0x38')]=qs[_0x6eb4('0x39')](_0x22a21c['query']['sort']);_0x377de6['where']=qs[_0x6eb4('0x32')](_[_0x6eb4('0x3b')](_0x22a21c[_0x6eb4('0x30')],_0x18c0af[_0x6eb4('0x32')]));if(_0x22a21c['query'][_0x6eb4('0x3c')]){_0x377de6[_0x6eb4('0x3a')]=_[_0x6eb4('0x3d')](_0x377de6[_0x6eb4('0x3a')],{'$or':_[_0x6eb4('0x2b')](_0x377de6[_0x6eb4('0x33')],function(_0xe80d5c){var _0x32f522={};_0x32f522[_0xe80d5c]={'$like':'%'+_0x22a21c[_0x6eb4('0x30')][_0x6eb4('0x3c')]+'%'};return _0x32f522;})});}_0x377de6=_[_0x6eb4('0x3d')]({},_0x377de6,_0x22a21c[_0x6eb4('0x40')]);return _0x44a2ff[_0x6eb4('0x4c')](_0x377de6);}})['then'](function(_0x312b03){if(_0x312b03){_0x26da2b=_0x312b03[_0x6eb4('0x36')];if(!_0x22a21c[_0x6eb4('0x30')][_0x6eb4('0x4f')]('nolimit')){_0x377de6['limit']=qs['limit'](_0x22a21c[_0x6eb4('0x30')][_0x6eb4('0x1c')]);_0x377de6[_0x6eb4('0x1a')]=qs[_0x6eb4('0x1a')](_0x22a21c[_0x6eb4('0x30')][_0x6eb4('0x1a')]);}return _0x44a2ff['getSubjects'](_0x377de6);}})[_0x6eb4('0x24')](function(_0x3331f2){if(_0x3331f2){return _0x3331f2?{'count':_0x26da2b,'rows':_0x3331f2}:null;}})[_0x6eb4('0x24')](respondWithResult(_0x29ab05,null))[_0x6eb4('0x4a')](handleError(_0x29ab05,null));};exports[_0x6eb4('0x50')]=function(_0x474fff,_0x5bf6c3,_0x358481){var _0x29709c={};var _0xc29fab={};var _0x282af8;var _0x3690bd;return db['Dynamics365Configuration'][_0x6eb4('0x4d')]({'where':{'id':_0x474fff[_0x6eb4('0x45')]['id']}})[_0x6eb4('0x24')](handleEntityNotFound(_0x5bf6c3,null))['then'](function(_0x305d2b){if(_0x305d2b){_0x282af8=_0x305d2b;_0xc29fab[_0x6eb4('0x2f')]=_[_0x6eb4('0x31')](db[_0x6eb4('0x4e')][_0x6eb4('0x46')]);_0xc29fab[_0x6eb4('0x30')]=_[_0x6eb4('0x31')](_0x474fff['query']);_0xc29fab[_0x6eb4('0x32')]=_[_0x6eb4('0x34')](_0xc29fab['model'],_0xc29fab[_0x6eb4('0x30')]);_0x29709c[_0x6eb4('0x33')]=_[_0x6eb4('0x34')](_0xc29fab[_0x6eb4('0x2f')],qs[_0x6eb4('0x35')](_0x474fff[_0x6eb4('0x30')][_0x6eb4('0x35')]));_0x29709c[_0x6eb4('0x33')]=_0x29709c[_0x6eb4('0x33')][_0x6eb4('0x36')]?_0x29709c[_0x6eb4('0x33')]:_0xc29fab['model'];_0x29709c[_0x6eb4('0x38')]=qs[_0x6eb4('0x39')](_0x474fff['query'][_0x6eb4('0x39')]);_0x29709c['where']=qs['filters'](_[_0x6eb4('0x3b')](_0x474fff['query'],_0xc29fab[_0x6eb4('0x32')]));if(_0x474fff[_0x6eb4('0x30')][_0x6eb4('0x3c')]){_0x29709c['where']=_[_0x6eb4('0x3d')](_0x29709c[_0x6eb4('0x3a')],{'$or':_[_0x6eb4('0x2b')](_0x29709c['attributes'],function(_0x314655){var _0x182262={};_0x182262[_0x314655]={'$like':'%'+_0x474fff[_0x6eb4('0x30')][_0x6eb4('0x3c')]+'%'};return _0x182262;})});}_0x29709c=_['merge']({},_0x29709c,_0x474fff[_0x6eb4('0x40')]);return _0x282af8[_0x6eb4('0x50')](_0x29709c);}})['then'](function(_0x35ecf9){if(_0x35ecf9){_0x3690bd=_0x35ecf9['length'];if(!_0x474fff[_0x6eb4('0x30')][_0x6eb4('0x4f')](_0x6eb4('0x37'))){_0x29709c[_0x6eb4('0x1c')]=qs[_0x6eb4('0x1c')](_0x474fff[_0x6eb4('0x30')][_0x6eb4('0x1c')]);_0x29709c[_0x6eb4('0x1a')]=qs['offset'](_0x474fff[_0x6eb4('0x30')][_0x6eb4('0x1a')]);}return _0x282af8[_0x6eb4('0x50')](_0x29709c);}})[_0x6eb4('0x24')](function(_0x5ccb8a){if(_0x5ccb8a){return _0x5ccb8a?{'count':_0x3690bd,'rows':_0x5ccb8a}:null;}})[_0x6eb4('0x24')](respondWithResult(_0x5bf6c3,null))['catch'](handleError(_0x5bf6c3,null));};
\ No newline at end of file
index 62abd18..6ba8849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','../../config/logger','api','moment','bluebird'];(function(_0x870bbb,_0x150783){var _0x286d46=function(_0x33b524){while(--_0x33b524){_0x870bbb['push'](_0x870bbb['shift']());}};_0x286d46(++_0x150783);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x3be2a0,_0x30d5af){var _0x130828=function(_0x5c8b85){while(--_0x5c8b85){_0x3be2a0['push'](_0x3be2a0['shift']());}};_0x130828(++_0x30d5af);}(_0x3e74,0x175));var _0x43e7=function(_0x51a7f8,_0x299835){_0x51a7f8=_0x51a7f8-0x0;var _0x8cb5bd=_0x3e74[_0x51a7f8];return _0x8cb5bd;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4300ce0..33cdcf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4ef=['request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x332f0c,_0x5a2094){var _0x358da8=function(_0x42bf8e){while(--_0x42bf8e){_0x332f0c['push'](_0x332f0c['shift']());}};_0x358da8(++_0x5a2094);}(_0xd4ef,0x1ef));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd4e('0x0'));var util=require(_0xfd4e('0x1'));var moment=require(_0xfd4e('0x2'));var BPromise=require(_0xfd4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd4e('0x5'));var logger=require(_0xfd4e('0x6'))(_0xfd4e('0x7'));var config=require(_0xfd4e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd4e('0x9')][_0xfd4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34185e,_0x4a10a6,_0x29ad59){return new BPromise(function(_0x4f1615,_0x170b99){return client[_0xfd4e('0xb')](_0x34185e,_0x29ad59)['then'](function(_0x4147a7){logger[_0xfd4e('0xc')](_0xfd4e('0xd'),_0x4a10a6,_0xfd4e('0xe'));logger['debug'](_0xfd4e('0xf'),_0x4a10a6,'request\x20sent',JSON[_0xfd4e('0x10')](_0x4147a7));if(_0x4147a7[_0xfd4e('0x11')]){if(_0x4147a7['error'][_0xfd4e('0x12')]===0x1f4){logger['error'](_0xfd4e('0xd'),_0x4a10a6,_0x4147a7[_0xfd4e('0x11')][_0xfd4e('0x13')]);return _0x170b99(_0x4147a7[_0xfd4e('0x11')][_0xfd4e('0x13')]);}logger[_0xfd4e('0x11')](_0xfd4e('0xd'),_0x4a10a6,_0x4147a7[_0xfd4e('0x11')][_0xfd4e('0x13')]);return _0x4f1615(_0x4147a7[_0xfd4e('0x11')][_0xfd4e('0x13')]);}else{logger[_0xfd4e('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4a10a6,_0xfd4e('0xe'));_0x4f1615(_0x4147a7[_0xfd4e('0x14')]['message']);}})[_0xfd4e('0x15')](function(_0x5ddfb0){logger['error'](_0xfd4e('0xd'),_0x4a10a6,_0x5ddfb0);_0x170b99(_0x5ddfb0);});});}
\ No newline at end of file
+var _0xddbc=['client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xddbc,0xb8));var _0xcddb=function(_0xcd7832,_0x1b7264){_0xcd7832=_0xcd7832-0x0;var _0x1680ad=_0xddbc[_0xcd7832];return _0x1680ad;};'use strict';var _=require('lodash');var util=require(_0xcddb('0x0'));var moment=require(_0xcddb('0x1'));var BPromise=require('bluebird');var rs=require(_0xcddb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcddb('0x3'));var logger=require('../../config/logger')(_0xcddb('0x4'));var config=require(_0xcddb('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xcddb('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x96c92a,_0x54c585,_0x50c5bc){return new BPromise(function(_0x21c085,_0xba4bcc){return client[_0xcddb('0x7')](_0x96c92a,_0x50c5bc)[_0xcddb('0x8')](function(_0x5a8059){logger[_0xcddb('0x9')](_0xcddb('0xa'),_0x54c585,_0xcddb('0xb'));logger[_0xcddb('0xc')](_0xcddb('0xd'),_0x54c585,'request\x20sent',JSON[_0xcddb('0xe')](_0x5a8059));if(_0x5a8059[_0xcddb('0xf')]){if(_0x5a8059[_0xcddb('0xf')][_0xcddb('0x10')]===0x1f4){logger['error'](_0xcddb('0xa'),_0x54c585,_0x5a8059[_0xcddb('0xf')][_0xcddb('0x11')]);return _0xba4bcc(_0x5a8059[_0xcddb('0xf')][_0xcddb('0x11')]);}logger['error'](_0xcddb('0xa'),_0x54c585,_0x5a8059[_0xcddb('0xf')]['message']);return _0x21c085(_0x5a8059[_0xcddb('0xf')]['message']);}else{logger[_0xcddb('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x54c585,_0xcddb('0xb'));_0x21c085(_0x5a8059['result'][_0xcddb('0x11')]);}})[_0xcddb('0x12')](function(_0x17011e){logger[_0xcddb('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x54c585,_0x17011e);_0xba4bcc(_0x17011e);});});}
\ No newline at end of file
index 8599b37..3523543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b1=['/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x417774,_0x1b95e6){var _0x10015d=function(_0x2526b3){while(--_0x2526b3){_0x417774['push'](_0x417774['shift']());}};_0x10015d(++_0x1b95e6);}(_0xb6b1,0x15c));var _0x1b6b=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0xb6b1[_0x478c8a];return _0x3b6b3e;};'use strict';var multer=require(_0x1b6b('0x0'));var util=require(_0x1b6b('0x1'));var path=require(_0x1b6b('0x2'));var timeout=require(_0x1b6b('0x3'));var express=require(_0x1b6b('0x4'));var router=express[_0x1b6b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1b6b('0x6'));var interaction=require(_0x1b6b('0x7'));var config=require(_0x1b6b('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x1b6b('0x9')]('/',auth[_0x1b6b('0xa')](),controller[_0x1b6b('0xb')]);router[_0x1b6b('0x9')](_0x1b6b('0xc'),auth[_0x1b6b('0xa')](),controller['show']);router[_0x1b6b('0xd')]('/',auth['isAuthenticated'](),controller[_0x1b6b('0xe')]);router[_0x1b6b('0xf')](_0x1b6b('0xc'),auth[_0x1b6b('0xa')](),controller['update']);router[_0x1b6b('0x10')](_0x1b6b('0xc'),auth[_0x1b6b('0xa')](),controller['destroy']);module[_0x1b6b('0x11')]=router;
\ No newline at end of file
+var _0x167f=['path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports'];(function(_0x54cba8,_0x3e5114){var _0x324d1f=function(_0x473dc5){while(--_0x473dc5){_0x54cba8['push'](_0x54cba8['shift']());}};_0x324d1f(++_0x3e5114);}(_0x167f,0x1a0));var _0xf167=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0x167f[_0x479b99];return _0x1e7eb7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf167('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf167('0x1')]();var fs_extra=require(_0xf167('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xf167('0x3'));var config=require(_0xf167('0x4'));var controller=require(_0xf167('0x5'));router[_0xf167('0x6')]('/',auth[_0xf167('0x7')](),controller[_0xf167('0x8')]);router['get'](_0xf167('0x9'),auth[_0xf167('0x7')](),controller['show']);router[_0xf167('0xa')]('/',auth[_0xf167('0x7')](),controller[_0xf167('0xb')]);router[_0xf167('0xc')](_0xf167('0x9'),auth[_0xf167('0x7')](),controller['update']);router[_0xf167('0xd')](_0xf167('0x9'),auth['isAuthenticated'](),controller[_0xf167('0xe')]);module[_0xf167('0xf')]=router;
\ No newline at end of file
index caafcb4..d20694b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43b1=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x43b1,0x195));var _0x143b=function(_0x42b025,_0x45a093){_0x42b025=_0x42b025-0x0;var _0x57d38e=_0x43b1[_0x42b025];return _0x57d38e;};'use strict';var Sequelize=require(_0x143b('0x0'));module[_0x143b('0x1')]={'type':{'type':Sequelize[_0x143b('0x2')](_0x143b('0x3'),_0x143b('0x4'),_0x143b('0x5'),_0x143b('0x6'),'picklist'),'defaultValue':_0x143b('0x3')},'content':{'type':Sequelize[_0x143b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x143b('0x2')](_0x143b('0x3'),_0x143b('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x143b('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x143b('0x7')]},'customField':{'type':Sequelize[_0x143b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcab0=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports'];(function(_0x2c96c0,_0x490d48){var _0x30c3a9=function(_0x45c563){while(--_0x45c563){_0x2c96c0['push'](_0x2c96c0['shift']());}};_0x30c3a9(++_0x490d48);}(_0xcab0,0x198));var _0x0cab=function(_0x29f1ac,_0xddd834){_0x29f1ac=_0x29f1ac-0x0;var _0x43f68c=_0xcab0[_0x29f1ac];return _0x43f68c;};'use strict';var Sequelize=require(_0x0cab('0x0'));module[_0x0cab('0x1')]={'type':{'type':Sequelize[_0x0cab('0x2')](_0x0cab('0x3'),'variable',_0x0cab('0x4'),_0x0cab('0x5'),_0x0cab('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0cab('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0cab('0x2')](_0x0cab('0x3'),_0x0cab('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0x0cab('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0cab('0x7')]},'customField':{'type':Sequelize[_0x0cab('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cab('0x7')]}};
\ No newline at end of file
index 4e5fd86..1afa709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc49b=['rows','catch','show','params','keys','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include'];(function(_0xf9286a,_0x495e5b){var _0x1de149=function(_0x338c92){while(--_0x338c92){_0xf9286a['push'](_0xf9286a['shift']());}};_0x1de149(++_0x495e5b);}(_0xc49b,0xea));var _0xbc49=function(_0x1bfc87,_0x3ce263){_0x1bfc87=_0x1bfc87-0x0;var _0x55e028=_0xc49b[_0x1bfc87];return _0x55e028;};'use strict';var emlformat=require(_0xbc49('0x0'));var rimraf=require(_0xbc49('0x1'));var zipdir=require(_0xbc49('0x2'));var jsonpatch=require(_0xbc49('0x3'));var rp=require(_0xbc49('0x4'));var moment=require('moment');var BPromise=require(_0xbc49('0x5'));var Mustache=require('mustache');var util=require(_0xbc49('0x6'));var path=require(_0xbc49('0x7'));var sox=require(_0xbc49('0x8'));var csv=require(_0xbc49('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc49('0xa'));var squel=require(_0xbc49('0xb'));var crypto=require(_0xbc49('0xc'));var jsforce=require(_0xbc49('0xd'));var deskjs=require(_0xbc49('0xe'));var toCsv=require(_0xbc49('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbc49('0xf'));var authService=require(_0xbc49('0x10'));var qs=require(_0xbc49('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbc49('0x12'));var logger=require('../../config/logger')(_0xbc49('0x13'));var utils=require(_0xbc49('0x14'));var config=require(_0xbc49('0x15'));var licenseUtil=require(_0xbc49('0x16'));var db=require(_0xbc49('0x17'))['db'];function respondWithStatusCode(_0x2f9162,_0x2cd552){_0x2cd552=_0x2cd552||0xcc;return function(_0x2cb75c){if(_0x2cb75c){return _0x2f9162[_0xbc49('0x18')](_0x2cd552);}return _0x2f9162[_0xbc49('0x19')](_0x2cd552)[_0xbc49('0x1a')]();};}function respondWithResult(_0x5815a3,_0x5107dc){_0x5107dc=_0x5107dc||0xc8;return function(_0xebeaed){if(_0xebeaed){return _0x5815a3[_0xbc49('0x19')](_0x5107dc)[_0xbc49('0x1b')](_0xebeaed);}};}function respondWithFilteredResult(_0x2c8d44,_0x388af7){return function(_0x4be08d){if(_0x4be08d){var _0x381c1f=typeof _0x388af7[_0xbc49('0x1c')]===_0xbc49('0x1d')&&typeof _0x388af7[_0xbc49('0x1e')]===_0xbc49('0x1d');var _0x5ca108=_0x4be08d[_0xbc49('0x1f')];var _0x1e57af=_0x381c1f?0x0:_0x388af7[_0xbc49('0x1c')];var _0x26be37=_0x381c1f?_0x4be08d[_0xbc49('0x1f')]:_0x388af7[_0xbc49('0x1c')]+_0x388af7[_0xbc49('0x1e')];var _0x1e2f26;if(_0x26be37>=_0x5ca108){_0x26be37=_0x5ca108;_0x1e2f26=0xc8;}else{_0x1e2f26=0xce;}_0x2c8d44['status'](_0x1e2f26);return _0x2c8d44[_0xbc49('0x20')](_0xbc49('0x21'),_0x1e57af+'-'+_0x26be37+'/'+_0x5ca108)[_0xbc49('0x1b')](_0x4be08d);}return null;};}function patchUpdates(_0xc5723e){return function(_0x54531a){try{jsonpatch['apply'](_0x54531a,_0xc5723e,!![]);}catch(_0x2eadc4){return BPromise[_0xbc49('0x22')](_0x2eadc4);}return _0x54531a['save']();};}function saveUpdates(_0x2a7a19,_0x578cf2){return function(_0x1dc481){if(_0x1dc481){return _0x1dc481['update'](_0x2a7a19)[_0xbc49('0x23')](function(_0x536a80){return _0x536a80;});}return null;};}function removeEntity(_0x384db2,_0x2985fa){return function(_0x2a7859){if(_0x2a7859){return _0x2a7859[_0xbc49('0x24')]()[_0xbc49('0x23')](function(){_0x384db2[_0xbc49('0x19')](0xcc)[_0xbc49('0x1a')]();});}};}function handleEntityNotFound(_0x35c1e3,_0x210a4a){return function(_0x2cf12f){if(!_0x2cf12f){_0x35c1e3[_0xbc49('0x18')](0x194);}return _0x2cf12f;};}function handleError(_0x3b4440,_0x554fe1){_0x554fe1=_0x554fe1||0x1f4;return function(_0x210785){logger[_0xbc49('0x25')](_0x210785[_0xbc49('0x26')]);if(_0x210785[_0xbc49('0x27')]){delete _0x210785[_0xbc49('0x27')];}_0x3b4440[_0xbc49('0x19')](_0x554fe1)[_0xbc49('0x28')](_0x210785);};}exports[_0xbc49('0x29')]=function(_0x8ec7da,_0x1926e0){var _0x33ba96={},_0x3f8e50={},_0x5ba4db={'count':0x0,'rows':[]};var _0x5426dd=_[_0xbc49('0x2a')](db[_0xbc49('0x2b')][_0xbc49('0x2c')],function(_0x19ae09){return{'name':_0x19ae09[_0xbc49('0x2d')],'type':_0x19ae09[_0xbc49('0x2e')][_0xbc49('0x2f')]};});_0x3f8e50[_0xbc49('0x30')]=_[_0xbc49('0x2a')](_0x5426dd,_0xbc49('0x27'));_0x3f8e50[_0xbc49('0x31')]=_['keys'](_0x8ec7da[_0xbc49('0x31')]);_0x3f8e50[_0xbc49('0x32')]=_[_0xbc49('0x33')](_0x3f8e50[_0xbc49('0x30')],_0x3f8e50[_0xbc49('0x31')]);_0x33ba96[_0xbc49('0x34')]=_[_0xbc49('0x33')](_0x3f8e50['model'],qs[_0xbc49('0x35')](_0x8ec7da[_0xbc49('0x31')][_0xbc49('0x35')]));_0x33ba96[_0xbc49('0x34')]=_0x33ba96[_0xbc49('0x34')][_0xbc49('0x36')]?_0x33ba96[_0xbc49('0x34')]:_0x3f8e50[_0xbc49('0x30')];if(!_0x8ec7da[_0xbc49('0x31')][_0xbc49('0x37')](_0xbc49('0x38'))){_0x33ba96['limit']=qs[_0xbc49('0x1e')](_0x8ec7da[_0xbc49('0x31')][_0xbc49('0x1e')]);_0x33ba96['offset']=qs[_0xbc49('0x1c')](_0x8ec7da['query'][_0xbc49('0x1c')]);}_0x33ba96[_0xbc49('0x39')]=qs[_0xbc49('0x3a')](_0x8ec7da[_0xbc49('0x31')][_0xbc49('0x3a')]);_0x33ba96[_0xbc49('0x3b')]=qs[_0xbc49('0x32')](_[_0xbc49('0x3c')](_0x8ec7da[_0xbc49('0x31')],_0x3f8e50[_0xbc49('0x32')]),_0x5426dd);if(_0x8ec7da[_0xbc49('0x31')][_0xbc49('0x3d')]){_0x33ba96[_0xbc49('0x3b')]=_[_0xbc49('0x3e')](_0x33ba96['where'],{'$or':_[_0xbc49('0x2a')](_0x5426dd,function(_0x4f7697){if(_0x4f7697[_0xbc49('0x2e')]!==_0xbc49('0x3f')){var _0x1f579f={};_0x1f579f[_0x4f7697['name']]={'$like':'%'+_0x8ec7da[_0xbc49('0x31')][_0xbc49('0x3d')]+'%'};return _0x1f579f;}})});}_0x33ba96=_[_0xbc49('0x3e')]({},_0x33ba96,_0x8ec7da[_0xbc49('0x40')]);var _0x37c4f4={'where':_0x33ba96[_0xbc49('0x3b')]};return db[_0xbc49('0x2b')][_0xbc49('0x1f')](_0x37c4f4)[_0xbc49('0x23')](function(_0x45d2f1){_0x5ba4db[_0xbc49('0x1f')]=_0x45d2f1;if(_0x8ec7da['query']['includeAll']){_0x33ba96[_0xbc49('0x41')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x33ba96);})[_0xbc49('0x23')](function(_0x19d641){_0x5ba4db[_0xbc49('0x42')]=_0x19d641;return _0x5ba4db;})[_0xbc49('0x23')](respondWithFilteredResult(_0x1926e0,_0x33ba96))[_0xbc49('0x43')](handleError(_0x1926e0,null));};exports[_0xbc49('0x44')]=function(_0x1224aa,_0x4e765b){var _0x4b0164={'raw':!![],'where':{'id':_0x1224aa[_0xbc49('0x45')]['id']}},_0x2bebb8={};_0x2bebb8[_0xbc49('0x30')]=_[_0xbc49('0x46')](db[_0xbc49('0x2b')][_0xbc49('0x2c')]);_0x2bebb8[_0xbc49('0x31')]=_[_0xbc49('0x46')](_0x1224aa[_0xbc49('0x31')]);_0x2bebb8[_0xbc49('0x32')]=_[_0xbc49('0x33')](_0x2bebb8[_0xbc49('0x30')],_0x2bebb8['query']);_0x4b0164['attributes']=_[_0xbc49('0x33')](_0x2bebb8[_0xbc49('0x30')],qs[_0xbc49('0x35')](_0x1224aa[_0xbc49('0x31')][_0xbc49('0x35')]));_0x4b0164[_0xbc49('0x34')]=_0x4b0164[_0xbc49('0x34')][_0xbc49('0x36')]?_0x4b0164[_0xbc49('0x34')]:_0x2bebb8[_0xbc49('0x30')];if(_0x1224aa[_0xbc49('0x31')]['includeAll']){_0x4b0164[_0xbc49('0x41')]=[{'all':!![]}];}_0x4b0164=_[_0xbc49('0x3e')]({},_0x4b0164,_0x1224aa['options']);return db[_0xbc49('0x2b')]['find'](_0x4b0164)['then'](handleEntityNotFound(_0x4e765b,null))[_0xbc49('0x23')](respondWithResult(_0x4e765b,null))[_0xbc49('0x43')](handleError(_0x4e765b,null));};exports[_0xbc49('0x47')]=function(_0x2536b0,_0x1e95fe){return db['Dynamics365Field'][_0xbc49('0x47')](_0x2536b0['body'],{})[_0xbc49('0x23')](respondWithResult(_0x1e95fe,0xc9))[_0xbc49('0x43')](handleError(_0x1e95fe,null));};exports[_0xbc49('0x48')]=function(_0xe0f0fd,_0x244a30){if(_0xe0f0fd[_0xbc49('0x49')]['id']){delete _0xe0f0fd['body']['id'];}return db[_0xbc49('0x2b')]['find']({'where':{'id':_0xe0f0fd[_0xbc49('0x45')]['id']}})[_0xbc49('0x23')](handleEntityNotFound(_0x244a30,null))[_0xbc49('0x23')](saveUpdates(_0xe0f0fd[_0xbc49('0x49')],null))[_0xbc49('0x23')](respondWithResult(_0x244a30,null))[_0xbc49('0x43')](handleError(_0x244a30,null));};exports[_0xbc49('0x24')]=function(_0x3d3fbf,_0x380b11){return db[_0xbc49('0x2b')][_0xbc49('0x4a')]({'where':{'id':_0x3d3fbf[_0xbc49('0x45')]['id']}})[_0xbc49('0x23')](handleEntityNotFound(_0x380b11,null))[_0xbc49('0x23')](removeEntity(_0x380b11,null))[_0xbc49('0x43')](handleError(_0x380b11,null));};
\ No newline at end of file
+var _0x7a99=['Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','findAll','rows','catch','show','params','length','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a99,0x1cb));var _0x97a9=function(_0x918112,_0x37ef10){_0x918112=_0x918112-0x0;var _0x5b5641=_0x7a99[_0x918112];return _0x5b5641;};'use strict';var emlformat=require(_0x97a9('0x0'));var rimraf=require(_0x97a9('0x1'));var zipdir=require(_0x97a9('0x2'));var jsonpatch=require(_0x97a9('0x3'));var rp=require(_0x97a9('0x4'));var moment=require(_0x97a9('0x5'));var BPromise=require(_0x97a9('0x6'));var Mustache=require(_0x97a9('0x7'));var util=require(_0x97a9('0x8'));var path=require(_0x97a9('0x9'));var sox=require(_0x97a9('0xa'));var csv=require(_0x97a9('0xb'));var ejs=require(_0x97a9('0xc'));var fs=require('fs');var fs_extra=require(_0x97a9('0xd'));var _=require(_0x97a9('0xe'));var squel=require(_0x97a9('0xf'));var crypto=require(_0x97a9('0x10'));var jsforce=require(_0x97a9('0x11'));var deskjs=require(_0x97a9('0x12'));var toCsv=require('to-csv');var querystring=require(_0x97a9('0x13'));var Papa=require(_0x97a9('0x14'));var Redis=require(_0x97a9('0x15'));var authService=require(_0x97a9('0x16'));var qs=require(_0x97a9('0x17'));var as=require(_0x97a9('0x18'));var hardwareService=require(_0x97a9('0x19'));var logger=require(_0x97a9('0x1a'))(_0x97a9('0x1b'));var utils=require(_0x97a9('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0x97a9('0x1d'));var db=require(_0x97a9('0x1e'))['db'];function respondWithStatusCode(_0x4e7abf,_0x91efea){_0x91efea=_0x91efea||0xcc;return function(_0x23979a){if(_0x23979a){return _0x4e7abf[_0x97a9('0x1f')](_0x91efea);}return _0x4e7abf[_0x97a9('0x20')](_0x91efea)[_0x97a9('0x21')]();};}function respondWithResult(_0x9d5ceb,_0x38af71){_0x38af71=_0x38af71||0xc8;return function(_0x2be0b4){if(_0x2be0b4){return _0x9d5ceb[_0x97a9('0x20')](_0x38af71)[_0x97a9('0x22')](_0x2be0b4);}};}function respondWithFilteredResult(_0x7e40ea,_0x4e3cd){return function(_0xadf009){if(_0xadf009){var _0x107284=typeof _0x4e3cd[_0x97a9('0x23')]===_0x97a9('0x24')&&typeof _0x4e3cd['limit']===_0x97a9('0x24');var _0x1975d6=_0xadf009[_0x97a9('0x25')];var _0x249544=_0x107284?0x0:_0x4e3cd[_0x97a9('0x23')];var _0x4b8cec=_0x107284?_0xadf009[_0x97a9('0x25')]:_0x4e3cd[_0x97a9('0x23')]+_0x4e3cd['limit'];var _0xf1b060;if(_0x4b8cec>=_0x1975d6){_0x4b8cec=_0x1975d6;_0xf1b060=0xc8;}else{_0xf1b060=0xce;}_0x7e40ea['status'](_0xf1b060);return _0x7e40ea[_0x97a9('0x26')](_0x97a9('0x27'),_0x249544+'-'+_0x4b8cec+'/'+_0x1975d6)[_0x97a9('0x22')](_0xadf009);}return null;};}function patchUpdates(_0x43b9c1){return function(_0x32121a){try{jsonpatch[_0x97a9('0x28')](_0x32121a,_0x43b9c1,!![]);}catch(_0x2c920b){return BPromise[_0x97a9('0x29')](_0x2c920b);}return _0x32121a[_0x97a9('0x2a')]();};}function saveUpdates(_0x3318e5,_0x272712){return function(_0x4fc796){if(_0x4fc796){return _0x4fc796[_0x97a9('0x2b')](_0x3318e5)['then'](function(_0x550486){return _0x550486;});}return null;};}function removeEntity(_0x7db33a,_0xa580f3){return function(_0x44e0f5){if(_0x44e0f5){return _0x44e0f5[_0x97a9('0x2c')]()['then'](function(){_0x7db33a[_0x97a9('0x20')](0xcc)[_0x97a9('0x21')]();});}};}function handleEntityNotFound(_0x5ec06f,_0x2fa2f6){return function(_0x33aac2){if(!_0x33aac2){_0x5ec06f['sendStatus'](0x194);}return _0x33aac2;};}function handleError(_0x25aae1,_0x23df5f){_0x23df5f=_0x23df5f||0x1f4;return function(_0x17d783){logger['error'](_0x17d783[_0x97a9('0x2d')]);if(_0x17d783[_0x97a9('0x2e')]){delete _0x17d783[_0x97a9('0x2e')];}_0x25aae1[_0x97a9('0x20')](_0x23df5f)[_0x97a9('0x2f')](_0x17d783);};}exports[_0x97a9('0x30')]=function(_0x11569c,_0x48c0ce){var _0x4c1ff7={},_0x5985fa={},_0x44f987={'count':0x0,'rows':[]};var _0x49a475=_[_0x97a9('0x31')](db[_0x97a9('0x32')][_0x97a9('0x33')],function(_0x336f38){return{'name':_0x336f38['fieldName'],'type':_0x336f38[_0x97a9('0x34')][_0x97a9('0x35')]};});_0x5985fa[_0x97a9('0x36')]=_[_0x97a9('0x31')](_0x49a475,_0x97a9('0x2e'));_0x5985fa[_0x97a9('0x37')]=_[_0x97a9('0x38')](_0x11569c['query']);_0x5985fa['filters']=_[_0x97a9('0x39')](_0x5985fa['model'],_0x5985fa[_0x97a9('0x37')]);_0x4c1ff7[_0x97a9('0x3a')]=_[_0x97a9('0x39')](_0x5985fa[_0x97a9('0x36')],qs[_0x97a9('0x3b')](_0x11569c[_0x97a9('0x37')][_0x97a9('0x3b')]));_0x4c1ff7[_0x97a9('0x3a')]=_0x4c1ff7[_0x97a9('0x3a')]['length']?_0x4c1ff7[_0x97a9('0x3a')]:_0x5985fa['model'];if(!_0x11569c[_0x97a9('0x37')][_0x97a9('0x3c')](_0x97a9('0x3d'))){_0x4c1ff7[_0x97a9('0x3e')]=qs[_0x97a9('0x3e')](_0x11569c[_0x97a9('0x37')]['limit']);_0x4c1ff7[_0x97a9('0x23')]=qs[_0x97a9('0x23')](_0x11569c[_0x97a9('0x37')]['offset']);}_0x4c1ff7[_0x97a9('0x3f')]=qs[_0x97a9('0x40')](_0x11569c[_0x97a9('0x37')][_0x97a9('0x40')]);_0x4c1ff7[_0x97a9('0x41')]=qs[_0x97a9('0x42')](_[_0x97a9('0x43')](_0x11569c[_0x97a9('0x37')],_0x5985fa[_0x97a9('0x42')]),_0x49a475);if(_0x11569c['query'][_0x97a9('0x44')]){_0x4c1ff7[_0x97a9('0x41')]=_[_0x97a9('0x45')](_0x4c1ff7['where'],{'$or':_['map'](_0x49a475,function(_0x2731ca){if(_0x2731ca[_0x97a9('0x34')]!==_0x97a9('0x46')){var _0x2cb9cb={};_0x2cb9cb[_0x2731ca[_0x97a9('0x2e')]]={'$like':'%'+_0x11569c['query']['filter']+'%'};return _0x2cb9cb;}})});}_0x4c1ff7=_[_0x97a9('0x45')]({},_0x4c1ff7,_0x11569c[_0x97a9('0x47')]);var _0x3a079c={'where':_0x4c1ff7[_0x97a9('0x41')]};return db['Dynamics365Field'][_0x97a9('0x25')](_0x3a079c)[_0x97a9('0x48')](function(_0x341af9){_0x44f987['count']=_0x341af9;if(_0x11569c[_0x97a9('0x37')]['includeAll']){_0x4c1ff7['include']=[{'all':!![]}];}return db[_0x97a9('0x32')][_0x97a9('0x49')](_0x4c1ff7);})['then'](function(_0x2dab7e){_0x44f987[_0x97a9('0x4a')]=_0x2dab7e;return _0x44f987;})['then'](respondWithFilteredResult(_0x48c0ce,_0x4c1ff7))[_0x97a9('0x4b')](handleError(_0x48c0ce,null));};exports[_0x97a9('0x4c')]=function(_0x2893aa,_0x3e95dc){var _0x1cbeac={'raw':!![],'where':{'id':_0x2893aa[_0x97a9('0x4d')]['id']}},_0x5dd772={};_0x5dd772['model']=_[_0x97a9('0x38')](db[_0x97a9('0x32')]['rawAttributes']);_0x5dd772['query']=_['keys'](_0x2893aa[_0x97a9('0x37')]);_0x5dd772[_0x97a9('0x42')]=_['intersection'](_0x5dd772[_0x97a9('0x36')],_0x5dd772[_0x97a9('0x37')]);_0x1cbeac[_0x97a9('0x3a')]=_['intersection'](_0x5dd772['model'],qs[_0x97a9('0x3b')](_0x2893aa[_0x97a9('0x37')]['fields']));_0x1cbeac[_0x97a9('0x3a')]=_0x1cbeac[_0x97a9('0x3a')][_0x97a9('0x4e')]?_0x1cbeac[_0x97a9('0x3a')]:_0x5dd772[_0x97a9('0x36')];if(_0x2893aa[_0x97a9('0x37')]['includeAll']){_0x1cbeac[_0x97a9('0x4f')]=[{'all':!![]}];}_0x1cbeac=_['merge']({},_0x1cbeac,_0x2893aa[_0x97a9('0x47')]);return db[_0x97a9('0x32')]['find'](_0x1cbeac)['then'](handleEntityNotFound(_0x3e95dc,null))[_0x97a9('0x48')](respondWithResult(_0x3e95dc,null))['catch'](handleError(_0x3e95dc,null));};exports[_0x97a9('0x50')]=function(_0x3505cc,_0x40134b){return db['Dynamics365Field']['create'](_0x3505cc['body'],{})[_0x97a9('0x48')](respondWithResult(_0x40134b,0xc9))[_0x97a9('0x4b')](handleError(_0x40134b,null));};exports['update']=function(_0x31ff86,_0x42649e){if(_0x31ff86[_0x97a9('0x51')]['id']){delete _0x31ff86[_0x97a9('0x51')]['id'];}return db['Dynamics365Field'][_0x97a9('0x52')]({'where':{'id':_0x31ff86[_0x97a9('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42649e,null))[_0x97a9('0x48')](saveUpdates(_0x31ff86['body'],null))['then'](respondWithResult(_0x42649e,null))['catch'](handleError(_0x42649e,null));};exports[_0x97a9('0x2c')]=function(_0x177080,_0x4af778){return db[_0x97a9('0x32')][_0x97a9('0x52')]({'where':{'id':_0x177080[_0x97a9('0x4d')]['id']}})[_0x97a9('0x48')](handleEntityNotFound(_0x4af778,null))['then'](removeEntity(_0x4af778,null))['catch'](handleError(_0x4af778,null));};
\ No newline at end of file
index d73f779..3fc89f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe58d=['FieldId','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','dynamics365_unique_index','idField'];(function(_0x32adea,_0x2d2af2){var _0x14078c=function(_0x109cc1){while(--_0x109cc1){_0x32adea['push'](_0x32adea['shift']());}};_0x14078c(++_0x2d2af2);}(_0xe58d,0xdd));var _0xde58=function(_0x34ab14,_0x228d49){_0x34ab14=_0x34ab14-0x0;var _0x52c36b=_0xe58d[_0x34ab14];return _0x52c36b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xde58('0x0'))('api');var moment=require(_0xde58('0x1'));var BPromise=require(_0xde58('0x2'));var rp=require(_0xde58('0x3'));var fs=require('fs');var path=require(_0xde58('0x4'));var rimraf=require(_0xde58('0x5'));var config=require(_0xde58('0x6'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x20f394,_0x48aab5){return _0x20f394[_0xde58('0x7')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xde58('0x8'),'fields':[_0xde58('0x9'),_0xde58('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f71=['idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','Dynamics365Field','dynamics365_unique_index'];(function(_0x511d90,_0x324ea3){var _0x4bed88=function(_0x45d756){while(--_0x45d756){_0x511d90['push'](_0x511d90['shift']());}};_0x4bed88(++_0x324ea3);}(_0x9f71,0xaa));var _0x19f7=function(_0xafa225,_0xd29c03){_0xafa225=_0xafa225-0x0;var _0x4f546a=_0x9f71[_0xafa225];return _0x4f546a;};'use strict';var _=require('lodash');var util=require(_0x19f7('0x0'));var logger=require('../../config/logger')(_0x19f7('0x1'));var moment=require(_0x19f7('0x2'));var BPromise=require(_0x19f7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x19f7('0x4'));var rimraf=require(_0x19f7('0x5'));var config=require(_0x19f7('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0x19f7('0x7')]=function(_0x2b81ae,_0x3db085){return _0x2b81ae['define'](_0x19f7('0x8'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x19f7('0x9'),'fields':[_0x19f7('0xa'),_0x19f7('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 2059508..e758539 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x907d=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x57b913,_0x48b176){var _0x466aaa=function(_0x4df7aa){while(--_0x4df7aa){_0x57b913['push'](_0x57b913['shift']());}};_0x466aaa(++_0x48b176);}(_0x907d,0x182));var _0xd907=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0x907d[_0x264d4d];return _0xc917e2;};'use strict';var _=require(_0xd907('0x0'));var util=require(_0xd907('0x1'));var moment=require(_0xd907('0x2'));var BPromise=require(_0xd907('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd907('0x4'));var db=require(_0xd907('0x5'))['db'];var utils=require(_0xd907('0x6'));var logger=require(_0xd907('0x7'))(_0xd907('0x8'));var config=require(_0xd907('0x9'));var jayson=require(_0xd907('0xa'));var client=jayson[_0xd907('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40db4a,_0x1af6b1,_0x269099){return new BPromise(function(_0x262d7f,_0x1c2ebd){return client[_0xd907('0xc')](_0x40db4a,_0x269099)[_0xd907('0xd')](function(_0x51e78b){logger[_0xd907('0xe')](_0xd907('0xf'),_0x1af6b1,_0xd907('0x10'));logger[_0xd907('0x11')](_0xd907('0x12'),_0x1af6b1,_0xd907('0x10'),JSON['stringify'](_0x51e78b));if(_0x51e78b[_0xd907('0x13')]){if(_0x51e78b[_0xd907('0x13')][_0xd907('0x14')]===0x1f4){logger[_0xd907('0x13')](_0xd907('0xf'),_0x1af6b1,_0x51e78b[_0xd907('0x13')][_0xd907('0x15')]);return _0x1c2ebd(_0x51e78b[_0xd907('0x13')][_0xd907('0x15')]);}logger[_0xd907('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x1af6b1,_0x51e78b['error'][_0xd907('0x15')]);return _0x262d7f(_0x51e78b[_0xd907('0x13')][_0xd907('0x15')]);}else{logger[_0xd907('0xe')](_0xd907('0xf'),_0x1af6b1,_0xd907('0x10'));_0x262d7f(_0x51e78b[_0xd907('0x16')][_0xd907('0x15')]);}})[_0xd907('0x17')](function(_0x19271d){logger[_0xd907('0x13')](_0xd907('0xf'),_0x1af6b1,_0x19271d);_0x1c2ebd(_0x19271d);});});}
\ No newline at end of file
+var _0x2691=['../../config/logger','../../config/environment','jayson/promise','client','http','request','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x2691,0x1f3));var _0x1269=function(_0x4899e1,_0x470826){_0x4899e1=_0x4899e1-0x0;var _0x27d71e=_0x2691[_0x4899e1];return _0x27d71e;};'use strict';var _=require(_0x1269('0x0'));var util=require(_0x1269('0x1'));var moment=require(_0x1269('0x2'));var BPromise=require(_0x1269('0x3'));var rs=require(_0x1269('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1269('0x5'))['db'];var utils=require(_0x1269('0x6'));var logger=require(_0x1269('0x7'))('rpc');var config=require(_0x1269('0x8'));var jayson=require(_0x1269('0x9'));var client=jayson[_0x1269('0xa')][_0x1269('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ba3d5,_0x353fea,_0x1e4ed5){return new BPromise(function(_0x19702c,_0x4632c1){return client[_0x1269('0xc')](_0x4ba3d5,_0x1e4ed5)['then'](function(_0x23afb2){logger['info'](_0x1269('0xd'),_0x353fea,_0x1269('0xe'));logger[_0x1269('0xf')](_0x1269('0x10'),_0x353fea,_0x1269('0xe'),JSON[_0x1269('0x11')](_0x23afb2));if(_0x23afb2[_0x1269('0x12')]){if(_0x23afb2['error'][_0x1269('0x13')]===0x1f4){logger[_0x1269('0x12')](_0x1269('0xd'),_0x353fea,_0x23afb2[_0x1269('0x12')]['message']);return _0x4632c1(_0x23afb2[_0x1269('0x12')][_0x1269('0x14')]);}logger[_0x1269('0x12')](_0x1269('0xd'),_0x353fea,_0x23afb2[_0x1269('0x12')][_0x1269('0x14')]);return _0x19702c(_0x23afb2[_0x1269('0x12')][_0x1269('0x14')]);}else{logger['info'](_0x1269('0xd'),_0x353fea,_0x1269('0xe'));_0x19702c(_0x23afb2[_0x1269('0x15')][_0x1269('0x14')]);}})['catch'](function(_0x105b79){logger['error'](_0x1269('0xd'),_0x353fea,_0x105b79);_0x4632c1(_0x105b79);});});}
\ No newline at end of file
index 983160f..bbbcbaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28e0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','exports','path','connect-timeout'];(function(_0x38d394,_0xe577e3){var _0x1a5437=function(_0x4753ec){while(--_0x4753ec){_0x38d394['push'](_0x38d394['shift']());}};_0x1a5437(++_0xe577e3);}(_0x28e0,0xae));var _0x028e=function(_0x15e30c,_0x581414){_0x15e30c=_0x15e30c-0x0;var _0x117a37=_0x28e0[_0x15e30c];return _0x117a37;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x028e('0x0'));var timeout=require(_0x028e('0x1'));var express=require(_0x028e('0x2'));var router=express[_0x028e('0x3')]();var fs_extra=require(_0x028e('0x4'));var auth=require(_0x028e('0x5'));var interaction=require(_0x028e('0x6'));var config=require(_0x028e('0x7'));var controller=require(_0x028e('0x8'));router[_0x028e('0x9')]('/',auth[_0x028e('0xa')](),controller['index']);router[_0x028e('0x9')](_0x028e('0xb'),auth[_0x028e('0xa')](),controller[_0x028e('0xc')]);router[_0x028e('0x9')](_0x028e('0xd'),auth[_0x028e('0xa')](),controller[_0x028e('0xe')]);router[_0x028e('0x9')](_0x028e('0xf'),auth[_0x028e('0xa')](),controller['getFields']);router[_0x028e('0x10')]('/',auth[_0x028e('0xa')](),controller[_0x028e('0x11')]);router[_0x028e('0x10')](_0x028e('0xd'),auth[_0x028e('0xa')](),controller['addConfiguration']);router[_0x028e('0x12')](_0x028e('0xb'),auth[_0x028e('0xa')](),controller[_0x028e('0x13')]);router[_0x028e('0x14')](_0x028e('0xb'),auth[_0x028e('0xa')](),controller['destroy']);module[_0x028e('0x15')]=router;
\ No newline at end of file
+var _0x6044=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','create','post','/:id/configurations','addConfiguration','put','update','delete'];(function(_0x1b72f2,_0x22a6cd){var _0x565936=function(_0x1926e2){while(--_0x1926e2){_0x1b72f2['push'](_0x1b72f2['shift']());}};_0x565936(++_0x22a6cd);}(_0x6044,0xff));var _0x4604=function(_0x4294f9,_0x3f35cd){_0x4294f9=_0x4294f9-0x0;var _0x5826f4=_0x6044[_0x4294f9];return _0x5826f4;};'use strict';var multer=require(_0x4604('0x0'));var util=require(_0x4604('0x1'));var path=require('path');var timeout=require(_0x4604('0x2'));var express=require('express');var router=express[_0x4604('0x3')]();var fs_extra=require(_0x4604('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4604('0x5'));var controller=require(_0x4604('0x6'));router[_0x4604('0x7')]('/',auth[_0x4604('0x8')](),controller[_0x4604('0x9')]);router[_0x4604('0x7')](_0x4604('0xa'),auth[_0x4604('0x8')](),controller[_0x4604('0xb')]);router[_0x4604('0x7')]('/:id/configurations',auth[_0x4604('0x8')](),controller[_0x4604('0xc')]);router['get']('/:id/fields',auth[_0x4604('0x8')](),controller[_0x4604('0xd')]);router['post']('/',auth[_0x4604('0x8')](),controller[_0x4604('0xe')]);router[_0x4604('0xf')](_0x4604('0x10'),auth[_0x4604('0x8')](),controller[_0x4604('0x11')]);router[_0x4604('0x12')](_0x4604('0xa'),auth[_0x4604('0x8')](),controller[_0x4604('0x13')]);router[_0x4604('0x14')](_0x4604('0xa'),auth[_0x4604('0x8')](),controller[_0x4604('0x15')]);module[_0x4604('0x16')]=router;
\ No newline at end of file
index f57e473..4e82314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7d1=['sequelize','exports','STRING','username','remoteUri'];(function(_0x7b575e,_0x12dc3e){var _0x5a03e3=function(_0x5e25ff){while(--_0x5e25ff){_0x7b575e['push'](_0x7b575e['shift']());}};_0x5a03e3(++_0x12dc3e);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x197570,_0x5632eb){_0x197570=_0x197570-0x0;var _0x169a97=_0xd7d1[_0x197570];return _0x169a97;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'name':{'type':Sequelize[_0x1d7d('0x2')]},'description':{'type':Sequelize[_0x1d7d('0x2')]},'username':{'type':Sequelize[_0x1d7d('0x2')],'unique':_0x1d7d('0x3')},'apiKey':{'type':Sequelize[_0x1d7d('0x2')]},'remoteUri':{'type':Sequelize[_0x1d7d('0x2')],'unique':_0x1d7d('0x4')},'serverUrl':{'type':Sequelize[_0x1d7d('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x1967=['STRING','username','remoteUri','exports'];(function(_0x1c9093,_0x31eb87){var _0x32dd36=function(_0x36da2d){while(--_0x36da2d){_0x1c9093['push'](_0x1c9093['shift']());}};_0x32dd36(++_0x31eb87);}(_0x1967,0x173));var _0x7196=function(_0x3c6963,_0x233c3c){_0x3c6963=_0x3c6963-0x0;var _0x82c1f6=_0x1967[_0x3c6963];return _0x82c1f6;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'apiKey':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]}};
\ No newline at end of file
index 5761291..7a94ba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8721=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','index','FreshdeskAccount','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','include','create','body','find','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','%s/%s','api/v2/ticket_fields','format','toString','subject','agent','description','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x35035e,_0x26bc1d){var _0x3a042f=function(_0x38d4e3){while(--_0x38d4e3){_0x35035e['push'](_0x35035e['shift']());}};_0x3a042f(++_0x26bc1d);}(_0x8721,0xd9));var _0x1872=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0x8721[_0x235482];return _0x5f5bea;};'use strict';var emlformat=require(_0x1872('0x0'));var rimraf=require(_0x1872('0x1'));var zipdir=require(_0x1872('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1872('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1872('0x4'));var sox=require(_0x1872('0x5'));var csv=require(_0x1872('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1872('0x7'));var squel=require(_0x1872('0x8'));var crypto=require(_0x1872('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1872('0xa'));var toCsv=require(_0x1872('0x6'));var querystring=require(_0x1872('0xb'));var Papa=require(_0x1872('0xc'));var Redis=require(_0x1872('0xd'));var authService=require(_0x1872('0xe'));var qs=require(_0x1872('0xf'));var as=require(_0x1872('0x10'));var hardwareService=require(_0x1872('0x11'));var logger=require(_0x1872('0x12'))(_0x1872('0x13'));var utils=require('../../config/utils');var config=require(_0x1872('0x14'));var licenseUtil=require(_0x1872('0x15'));var db=require(_0x1872('0x16'))['db'];var integrations=require(_0x1872('0x17'));function respondWithStatusCode(_0x5122df,_0x412663){_0x412663=_0x412663||0xcc;return function(_0x1a8e90){if(_0x1a8e90){return _0x5122df[_0x1872('0x18')](_0x412663);}return _0x5122df[_0x1872('0x19')](_0x412663)['end']();};}function respondWithResult(_0x4df475,_0xe47f69){_0xe47f69=_0xe47f69||0xc8;return function(_0x9e92ef){if(_0x9e92ef){return _0x4df475[_0x1872('0x19')](_0xe47f69)[_0x1872('0x1a')](_0x9e92ef);}};}function respondWithFilteredResult(_0x1ffc89,_0x5662e6){return function(_0x4be58a){if(_0x4be58a){var _0x4d5d5d=typeof _0x5662e6[_0x1872('0x1b')]===_0x1872('0x1c')&&typeof _0x5662e6[_0x1872('0x1d')]==='undefined';var _0xd4204d=_0x4be58a['count'];var _0x444306=_0x4d5d5d?0x0:_0x5662e6[_0x1872('0x1b')];var _0x32147c=_0x4d5d5d?_0x4be58a['count']:_0x5662e6[_0x1872('0x1b')]+_0x5662e6['limit'];var _0x82b55e;if(_0x32147c>=_0xd4204d){_0x32147c=_0xd4204d;_0x82b55e=0xc8;}else{_0x82b55e=0xce;}_0x1ffc89[_0x1872('0x19')](_0x82b55e);return _0x1ffc89[_0x1872('0x1e')](_0x1872('0x1f'),_0x444306+'-'+_0x32147c+'/'+_0xd4204d)[_0x1872('0x1a')](_0x4be58a);}return null;};}function patchUpdates(_0x506a44){return function(_0x3e4ee7){try{jsonpatch[_0x1872('0x20')](_0x3e4ee7,_0x506a44,!![]);}catch(_0x1d0e89){return BPromise[_0x1872('0x21')](_0x1d0e89);}return _0x3e4ee7[_0x1872('0x22')]();};}function saveUpdates(_0x3142f8,_0x1fc33f){return function(_0x1acbc2){if(_0x1acbc2){return _0x1acbc2[_0x1872('0x23')](_0x3142f8)['then'](function(_0x54e059){return _0x54e059;});}return null;};}function removeEntity(_0x5f29f5,_0x42e0e4){return function(_0x3a9ca2){if(_0x3a9ca2){return _0x3a9ca2[_0x1872('0x24')]()[_0x1872('0x25')](function(){_0x5f29f5['status'](0xcc)[_0x1872('0x26')]();});}};}function handleEntityNotFound(_0x2ac6b8,_0x126ab4){return function(_0x588fc1){if(!_0x588fc1){_0x2ac6b8[_0x1872('0x18')](0x194);}return _0x588fc1;};}function handleError(_0x576efa,_0x43e178){_0x43e178=_0x43e178||0x1f4;return function(_0x8d964a){logger[_0x1872('0x27')](_0x8d964a['stack']);if(_0x8d964a[_0x1872('0x28')]){delete _0x8d964a[_0x1872('0x28')];}_0x576efa['status'](_0x43e178)['send'](_0x8d964a);};}exports[_0x1872('0x29')]=function(_0x5bab21,_0x5469e7){var _0x333961={},_0x5b1ef0={},_0x3f2779={'count':0x0,'rows':[]};var _0x7c1b35=_['map'](db[_0x1872('0x2a')][_0x1872('0x2b')],function(_0x30ad4f){return{'name':_0x30ad4f['fieldName'],'type':_0x30ad4f[_0x1872('0x2c')][_0x1872('0x2d')]};});_0x5b1ef0[_0x1872('0x2e')]=_[_0x1872('0x2f')](_0x7c1b35,_0x1872('0x28'));_0x5b1ef0['query']=_[_0x1872('0x30')](_0x5bab21[_0x1872('0x31')]);_0x5b1ef0[_0x1872('0x32')]=_[_0x1872('0x33')](_0x5b1ef0[_0x1872('0x2e')],_0x5b1ef0[_0x1872('0x31')]);_0x333961['attributes']=_[_0x1872('0x33')](_0x5b1ef0[_0x1872('0x2e')],qs[_0x1872('0x34')](_0x5bab21[_0x1872('0x31')][_0x1872('0x34')]));_0x333961[_0x1872('0x35')]=_0x333961[_0x1872('0x35')][_0x1872('0x36')]?_0x333961['attributes']:_0x5b1ef0['model'];if(!_0x5bab21[_0x1872('0x31')][_0x1872('0x37')](_0x1872('0x38'))){_0x333961[_0x1872('0x1d')]=qs[_0x1872('0x1d')](_0x5bab21[_0x1872('0x31')]['limit']);_0x333961[_0x1872('0x1b')]=qs[_0x1872('0x1b')](_0x5bab21['query']['offset']);}_0x333961['order']=qs[_0x1872('0x39')](_0x5bab21[_0x1872('0x31')][_0x1872('0x39')]);_0x333961['where']=qs[_0x1872('0x32')](_[_0x1872('0x3a')](_0x5bab21[_0x1872('0x31')],_0x5b1ef0[_0x1872('0x32')]),_0x7c1b35);if(_0x5bab21[_0x1872('0x31')][_0x1872('0x3b')]){_0x333961['where']=_[_0x1872('0x3c')](_0x333961[_0x1872('0x3d')],{'$or':_[_0x1872('0x2f')](_0x7c1b35,function(_0x3bd1da){if(_0x3bd1da[_0x1872('0x2c')]!==_0x1872('0x3e')){var _0x224d46={};_0x224d46[_0x3bd1da[_0x1872('0x28')]]={'$like':'%'+_0x5bab21['query'][_0x1872('0x3b')]+'%'};return _0x224d46;}})});}_0x333961=_[_0x1872('0x3c')]({},_0x333961,_0x5bab21[_0x1872('0x3f')]);var _0x4c3e9e={'where':_0x333961[_0x1872('0x3d')]};return db[_0x1872('0x2a')]['count'](_0x4c3e9e)[_0x1872('0x25')](function(_0x18a711){_0x3f2779[_0x1872('0x40')]=_0x18a711;if(_0x5bab21[_0x1872('0x31')][_0x1872('0x41')]){_0x333961['include']=[{'all':!![]}];}return db[_0x1872('0x2a')][_0x1872('0x42')](_0x333961);})[_0x1872('0x25')](function(_0x4b2dae){_0x3f2779[_0x1872('0x43')]=_0x4b2dae;return _0x3f2779;})[_0x1872('0x25')](respondWithFilteredResult(_0x5469e7,_0x333961))[_0x1872('0x44')](handleError(_0x5469e7,null));};exports[_0x1872('0x45')]=function(_0x38b60e,_0xbd6e46){var _0x857b68={'raw':![],'where':{'id':_0x38b60e[_0x1872('0x46')]['id']}},_0x300806={};_0x300806['model']=_[_0x1872('0x30')](db[_0x1872('0x2a')][_0x1872('0x2b')]);_0x300806[_0x1872('0x31')]=_[_0x1872('0x30')](_0x38b60e[_0x1872('0x31')]);_0x300806[_0x1872('0x32')]=_['intersection'](_0x300806['model'],_0x300806[_0x1872('0x31')]);_0x857b68[_0x1872('0x35')]=_[_0x1872('0x33')](_0x300806[_0x1872('0x2e')],qs['fields'](_0x38b60e['query']['fields']));_0x857b68['attributes']=_0x857b68[_0x1872('0x35')]['length']?_0x857b68[_0x1872('0x35')]:_0x300806[_0x1872('0x2e')];if(_0x38b60e['query'][_0x1872('0x41')]){_0x857b68[_0x1872('0x47')]=[{'all':!![]}];}_0x857b68=_['merge']({},_0x857b68,_0x38b60e[_0x1872('0x3f')]);return db[_0x1872('0x2a')]['find'](_0x857b68)[_0x1872('0x25')](handleEntityNotFound(_0xbd6e46,null))[_0x1872('0x25')](respondWithResult(_0xbd6e46,null))[_0x1872('0x44')](handleError(_0xbd6e46,null));};exports[_0x1872('0x48')]=function(_0x392f26,_0x2a6341){return db[_0x1872('0x2a')][_0x1872('0x48')](_0x392f26['body'],{})['then'](respondWithResult(_0x2a6341,0xc9))[_0x1872('0x44')](handleError(_0x2a6341,null));};exports[_0x1872('0x23')]=function(_0x3e985e,_0x5e70a6){if(_0x3e985e[_0x1872('0x49')]['id']){delete _0x3e985e[_0x1872('0x49')]['id'];}return db[_0x1872('0x2a')][_0x1872('0x4a')]({'where':{'id':_0x3e985e[_0x1872('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e70a6,null))[_0x1872('0x25')](saveUpdates(_0x3e985e[_0x1872('0x49')],null))[_0x1872('0x25')](respondWithResult(_0x5e70a6,null))[_0x1872('0x44')](handleError(_0x5e70a6,null));};exports[_0x1872('0x24')]=function(_0x5b6c04,_0x3a6edb){return db[_0x1872('0x2a')][_0x1872('0x4a')]({'where':{'id':_0x5b6c04[_0x1872('0x46')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x3a6edb,null))[_0x1872('0x25')](removeEntity(_0x3a6edb,null))[_0x1872('0x44')](handleError(_0x3a6edb,null));};exports[_0x1872('0x4b')]=function(_0x3528b6,_0x5f4ae9,_0xbdf0c6){var _0x183f7b={};var _0x3d4143={};var _0x17a80b;var _0x340570;return db[_0x1872('0x2a')][_0x1872('0x4c')]({'where':{'id':_0x3528b6['params']['id']}})['then'](handleEntityNotFound(_0x5f4ae9,null))[_0x1872('0x25')](function(_0x3145b1){if(_0x3145b1){_0x17a80b=_0x3145b1;_0x3d4143[_0x1872('0x2e')]=_['keys'](db[_0x1872('0x4d')][_0x1872('0x2b')]);_0x3d4143[_0x1872('0x31')]=_[_0x1872('0x30')](_0x3528b6[_0x1872('0x31')]);_0x3d4143[_0x1872('0x32')]=_[_0x1872('0x33')](_0x3d4143[_0x1872('0x2e')],_0x3d4143['query']);_0x183f7b[_0x1872('0x35')]=_['intersection'](_0x3d4143[_0x1872('0x2e')],qs[_0x1872('0x34')](_0x3528b6[_0x1872('0x31')]['fields']));_0x183f7b[_0x1872('0x35')]=_0x183f7b['attributes'][_0x1872('0x36')]?_0x183f7b['attributes']:_0x3d4143['model'];_0x183f7b[_0x1872('0x4e')]=qs[_0x1872('0x39')](_0x3528b6[_0x1872('0x31')][_0x1872('0x39')]);_0x183f7b['where']=qs[_0x1872('0x32')](_[_0x1872('0x3a')](_0x3528b6[_0x1872('0x31')],_0x3d4143[_0x1872('0x32')]));if(_0x3528b6[_0x1872('0x31')][_0x1872('0x3b')]){_0x183f7b[_0x1872('0x3d')]=_[_0x1872('0x3c')](_0x183f7b[_0x1872('0x3d')],{'$or':_[_0x1872('0x2f')](_0x183f7b[_0x1872('0x35')],function(_0x101ada){var _0x7d4201={};_0x7d4201[_0x101ada]={'$like':'%'+_0x3528b6[_0x1872('0x31')][_0x1872('0x3b')]+'%'};return _0x7d4201;})});}_0x183f7b=_[_0x1872('0x3c')]({},_0x183f7b,_0x3528b6[_0x1872('0x3f')]);return _0x17a80b[_0x1872('0x4b')](_0x183f7b);}})[_0x1872('0x25')](function(_0x1c3a86){if(_0x1c3a86){_0x340570=_0x1c3a86[_0x1872('0x36')];if(!_0x3528b6[_0x1872('0x31')][_0x1872('0x37')]('nolimit')){_0x183f7b[_0x1872('0x1d')]=qs['limit'](_0x3528b6[_0x1872('0x31')]['limit']);_0x183f7b['offset']=qs[_0x1872('0x1b')](_0x3528b6[_0x1872('0x31')][_0x1872('0x1b')]);}return _0x17a80b[_0x1872('0x4b')](_0x183f7b);}})[_0x1872('0x25')](function(_0x51c0d9){if(_0x51c0d9){return _0x51c0d9?{'count':_0x340570,'rows':_0x51c0d9}:null;}})[_0x1872('0x25')](respondWithResult(_0x5f4ae9,null))[_0x1872('0x44')](handleError(_0x5f4ae9,null));};exports[_0x1872('0x4f')]=function(_0x2cc5fd,_0x30596c,_0x59bd34){if(_0x2cc5fd[_0x1872('0x49')]['id']){delete _0x2cc5fd['body']['id'];}return db[_0x1872('0x2a')][_0x1872('0x4c')]({'where':{'id':_0x2cc5fd[_0x1872('0x46')]['id']}})[_0x1872('0x25')](handleEntityNotFound(_0x30596c,null))[_0x1872('0x25')](function(_0x36d3ee){if(_0x36d3ee){_0x2cc5fd[_0x1872('0x49')][_0x1872('0x50')]=_0x36d3ee['id'];_0x2cc5fd['body'][_0x1872('0x51')]=integrations[_0x1872('0x52')](_0x2cc5fd['body'][_0x1872('0x53')],_0x2cc5fd['body'][_0x1872('0x2c')]);_0x2cc5fd['body'][_0x1872('0x54')]=integrations[_0x1872('0x55')](_0x2cc5fd[_0x1872('0x49')]['channel'],_0x2cc5fd['body']['type']);return db[_0x1872('0x4d')][_0x1872('0x48')](_0x2cc5fd['body'],{'include':[{'model':db[_0x1872('0x56')],'as':_0x1872('0x51')},{'model':db[_0x1872('0x56')],'as':_0x1872('0x54')}]});}return null;})[_0x1872('0x25')](respondWithResult(_0x30596c,null))[_0x1872('0x44')](handleError(_0x30596c,null));};exports['getFields']=function(_0x1897fe,_0x2af635,_0x454a2f){var _0x2742b9='';return db[_0x1872('0x2a')][_0x1872('0x4c')]({'where':{'id':_0x1897fe[_0x1872('0x46')]['id']},'attributes':['id',_0x1872('0x57'),_0x1872('0x58')]})[_0x1872('0x25')](handleEntityNotFound(_0x2af635,null))[_0x1872('0x25')](function(_0x311fbc){if(_0x311fbc){_0x2742b9=_0x311fbc[_0x1872('0x57')];var _0xc8c0d3=_0x2742b9[_0x1872('0x59')](-0x1);if(_0xc8c0d3==='/'){_0x2742b9=_0x2742b9[_0x1872('0x5a')](0x0,_0x2742b9[_0x1872('0x5b')](_0xc8c0d3));}return rp({'method':'GET','uri':util['format'](_0x1872('0x5c'),_0x2742b9,_0x1872('0x5d')),'headers':{'Authorization':util[_0x1872('0x5e')]('Basic\x20%s',new Buffer(util[_0x1872('0x5e')]('%s:X',_0x311fbc['apiKey']))[_0x1872('0x5f')]('base64'))},'json':!![]});}})[_0x1872('0x25')](function(_0x5c057e){if(_0x5c057e){var _0x236b66=['requester',_0x1872('0x60'),_0x1872('0x61'),_0x1872('0x62'),_0x1872('0x19'),_0x1872('0x63'),_0x1872('0x64'),_0x1872('0x65'),_0x1872('0x66'),_0x1872('0x64'),'company'];_[_0x1872('0x67')](_0x5c057e,function(_0x9f53bc){return _0x236b66[_0x1872('0x68')](_0x9f53bc[_0x1872('0x28')])||!_0x9f53bc[_0x1872('0x69')]&&_0x9f53bc[_0x1872('0x2c')]!==_0x1872('0x6a')&&_0x9f53bc[_0x1872('0x2c')]!==_0x1872('0x6b');});return{'count':_0x5c057e[_0x1872('0x36')],'rows':_[_0x1872('0x2f')](_0x5c057e,function(_0xa39f0b){return{'id':_0xa39f0b[_0x1872('0x28')],'name':_0xa39f0b[_0x1872('0x6c')],'custom':!_0xa39f0b['default'],'options':_0xa39f0b['choices']?_['map'](_0xa39f0b[_0x1872('0x6d')],function(_0x5d5a72){return{'name':_[_0x1872('0x6e')](_0x5d5a72),'value':_0x5d5a72};}):[]};})};}})[_0x1872('0x25')](respondWithResult(_0x2af635,null))[_0x1872('0x44')](function(_0x57df91){var _0x5f5cae=_0x1897fe[_0x1872('0x31')][_0x1872('0x6f')]?0x1f4:_0x57df91[_0x1872('0x70')]||0x1f4;logger['error'](_0x1872('0x71'),'getFields',_0x5f5cae,JSON[_0x1872('0x72')](_0x57df91));delete _0x57df91[_0x1872('0x28')];if(_0x5f5cae===0x191){_0x5f5cae=0x190;}_0x2af635[_0x1872('0x19')](_0x5f5cae)[_0x1872('0x73')](_0x1897fe['query']['test']?{'message':_0x1872('0x74'),'statusCode':_0x57df91[_0x1872('0x70')]}:_0x57df91);});};
\ No newline at end of file
+var _0x6ce9=['moment','mustache','util','path','sox','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','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','options','create','body','params','find','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','Subjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir'];(function(_0x4a7529,_0xba0830){var _0x254252=function(_0x53cbea){while(--_0x53cbea){_0x4a7529['push'](_0x4a7529['shift']());}};_0x254252(++_0xba0830);}(_0x6ce9,0x76));var _0x96ce=function(_0x3be140,_0x2b6f73){_0x3be140=_0x3be140-0x0;var _0x3989da=_0x6ce9[_0x3be140];return _0x3989da;};'use strict';var emlformat=require(_0x96ce('0x0'));var rimraf=require(_0x96ce('0x1'));var zipdir=require(_0x96ce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96ce('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x96ce('0x4'));var util=require(_0x96ce('0x5'));var path=require(_0x96ce('0x6'));var sox=require(_0x96ce('0x7'));var csv=require('to-csv');var ejs=require(_0x96ce('0x8'));var fs=require('fs');var fs_extra=require(_0x96ce('0x9'));var _=require(_0x96ce('0xa'));var squel=require('squel');var crypto=require(_0x96ce('0xb'));var jsforce=require(_0x96ce('0xc'));var deskjs=require(_0x96ce('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x96ce('0xe'));var Redis=require(_0x96ce('0xf'));var authService=require(_0x96ce('0x10'));var qs=require(_0x96ce('0x11'));var as=require(_0x96ce('0x12'));var hardwareService=require(_0x96ce('0x13'));var logger=require(_0x96ce('0x14'))(_0x96ce('0x15'));var utils=require(_0x96ce('0x16'));var config=require(_0x96ce('0x17'));var licenseUtil=require(_0x96ce('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x96ce('0x19'));function respondWithStatusCode(_0xb2a714,_0xa3c20e){_0xa3c20e=_0xa3c20e||0xcc;return function(_0x4e24e2){if(_0x4e24e2){return _0xb2a714[_0x96ce('0x1a')](_0xa3c20e);}return _0xb2a714[_0x96ce('0x1b')](_0xa3c20e)[_0x96ce('0x1c')]();};}function respondWithResult(_0x715161,_0x402431){_0x402431=_0x402431||0xc8;return function(_0x79e56d){if(_0x79e56d){return _0x715161[_0x96ce('0x1b')](_0x402431)[_0x96ce('0x1d')](_0x79e56d);}};}function respondWithFilteredResult(_0x329d7a,_0xc3f97f){return function(_0x1515ea){if(_0x1515ea){var _0x35b727=typeof _0xc3f97f[_0x96ce('0x1e')]===_0x96ce('0x1f')&&typeof _0xc3f97f[_0x96ce('0x20')]==='undefined';var _0x4d238c=_0x1515ea[_0x96ce('0x21')];var _0x2e6234=_0x35b727?0x0:_0xc3f97f[_0x96ce('0x1e')];var _0x219a4b=_0x35b727?_0x1515ea[_0x96ce('0x21')]:_0xc3f97f[_0x96ce('0x1e')]+_0xc3f97f[_0x96ce('0x20')];var _0x3d8991;if(_0x219a4b>=_0x4d238c){_0x219a4b=_0x4d238c;_0x3d8991=0xc8;}else{_0x3d8991=0xce;}_0x329d7a[_0x96ce('0x1b')](_0x3d8991);return _0x329d7a[_0x96ce('0x22')]('Content-Range',_0x2e6234+'-'+_0x219a4b+'/'+_0x4d238c)[_0x96ce('0x1d')](_0x1515ea);}return null;};}function patchUpdates(_0x162d2d){return function(_0xdd16e6){try{jsonpatch[_0x96ce('0x23')](_0xdd16e6,_0x162d2d,!![]);}catch(_0x2c52f3){return BPromise[_0x96ce('0x24')](_0x2c52f3);}return _0xdd16e6[_0x96ce('0x25')]();};}function saveUpdates(_0x5014bb,_0x5c39a2){return function(_0x3a097f){if(_0x3a097f){return _0x3a097f[_0x96ce('0x26')](_0x5014bb)['then'](function(_0x4f320d){return _0x4f320d;});}return null;};}function removeEntity(_0x58196f,_0x495b9f){return function(_0x2acfe3){if(_0x2acfe3){return _0x2acfe3[_0x96ce('0x27')]()[_0x96ce('0x28')](function(){_0x58196f[_0x96ce('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c74e8,_0x439e43){return function(_0x2426fa){if(!_0x2426fa){_0x2c74e8['sendStatus'](0x194);}return _0x2426fa;};}function handleError(_0x45d90e,_0x4670f1){_0x4670f1=_0x4670f1||0x1f4;return function(_0x400b7b){logger[_0x96ce('0x29')](_0x400b7b[_0x96ce('0x2a')]);if(_0x400b7b['name']){delete _0x400b7b[_0x96ce('0x2b')];}_0x45d90e[_0x96ce('0x1b')](_0x4670f1)[_0x96ce('0x2c')](_0x400b7b);};}exports[_0x96ce('0x2d')]=function(_0x58e166,_0x4164b1){var _0xc2ec89={},_0x32cd87={},_0x5b89fb={'count':0x0,'rows':[]};var _0x408bf5=_[_0x96ce('0x2e')](db[_0x96ce('0x2f')][_0x96ce('0x30')],function(_0xb4eba9){return{'name':_0xb4eba9[_0x96ce('0x31')],'type':_0xb4eba9[_0x96ce('0x32')][_0x96ce('0x33')]};});_0x32cd87[_0x96ce('0x34')]=_['map'](_0x408bf5,_0x96ce('0x2b'));_0x32cd87[_0x96ce('0x35')]=_[_0x96ce('0x36')](_0x58e166[_0x96ce('0x35')]);_0x32cd87[_0x96ce('0x37')]=_[_0x96ce('0x38')](_0x32cd87[_0x96ce('0x34')],_0x32cd87['query']);_0xc2ec89[_0x96ce('0x39')]=_[_0x96ce('0x38')](_0x32cd87[_0x96ce('0x34')],qs[_0x96ce('0x3a')](_0x58e166[_0x96ce('0x35')][_0x96ce('0x3a')]));_0xc2ec89[_0x96ce('0x39')]=_0xc2ec89[_0x96ce('0x39')][_0x96ce('0x3b')]?_0xc2ec89[_0x96ce('0x39')]:_0x32cd87[_0x96ce('0x34')];if(!_0x58e166[_0x96ce('0x35')]['hasOwnProperty'](_0x96ce('0x3c'))){_0xc2ec89[_0x96ce('0x20')]=qs[_0x96ce('0x20')](_0x58e166['query']['limit']);_0xc2ec89[_0x96ce('0x1e')]=qs[_0x96ce('0x1e')](_0x58e166[_0x96ce('0x35')]['offset']);}_0xc2ec89[_0x96ce('0x3d')]=qs[_0x96ce('0x3e')](_0x58e166[_0x96ce('0x35')][_0x96ce('0x3e')]);_0xc2ec89[_0x96ce('0x3f')]=qs['filters'](_[_0x96ce('0x40')](_0x58e166[_0x96ce('0x35')],_0x32cd87[_0x96ce('0x37')]),_0x408bf5);if(_0x58e166[_0x96ce('0x35')]['filter']){_0xc2ec89[_0x96ce('0x3f')]=_[_0x96ce('0x41')](_0xc2ec89[_0x96ce('0x3f')],{'$or':_['map'](_0x408bf5,function(_0x171de1){if(_0x171de1[_0x96ce('0x32')]!=='VIRTUAL'){var _0x23572f={};_0x23572f[_0x171de1[_0x96ce('0x2b')]]={'$like':'%'+_0x58e166[_0x96ce('0x35')][_0x96ce('0x42')]+'%'};return _0x23572f;}})});}_0xc2ec89=_['merge']({},_0xc2ec89,_0x58e166['options']);var _0xc8b99e={'where':_0xc2ec89['where']};return db[_0x96ce('0x2f')][_0x96ce('0x21')](_0xc8b99e)['then'](function(_0x32af48){_0x5b89fb[_0x96ce('0x21')]=_0x32af48;if(_0x58e166['query'][_0x96ce('0x43')]){_0xc2ec89[_0x96ce('0x44')]=[{'all':!![]}];}return db[_0x96ce('0x2f')][_0x96ce('0x45')](_0xc2ec89);})['then'](function(_0xed3c3e){_0x5b89fb[_0x96ce('0x46')]=_0xed3c3e;return _0x5b89fb;})[_0x96ce('0x28')](respondWithFilteredResult(_0x4164b1,_0xc2ec89))[_0x96ce('0x47')](handleError(_0x4164b1,null));};exports[_0x96ce('0x48')]=function(_0x38ed74,_0x22c30c){var _0x3d57a9={'raw':![],'where':{'id':_0x38ed74['params']['id']}},_0x247d18={};_0x247d18[_0x96ce('0x34')]=_['keys'](db[_0x96ce('0x2f')][_0x96ce('0x30')]);_0x247d18[_0x96ce('0x35')]=_[_0x96ce('0x36')](_0x38ed74['query']);_0x247d18['filters']=_[_0x96ce('0x38')](_0x247d18[_0x96ce('0x34')],_0x247d18[_0x96ce('0x35')]);_0x3d57a9[_0x96ce('0x39')]=_['intersection'](_0x247d18['model'],qs[_0x96ce('0x3a')](_0x38ed74[_0x96ce('0x35')][_0x96ce('0x3a')]));_0x3d57a9[_0x96ce('0x39')]=_0x3d57a9[_0x96ce('0x39')][_0x96ce('0x3b')]?_0x3d57a9[_0x96ce('0x39')]:_0x247d18['model'];if(_0x38ed74[_0x96ce('0x35')]['includeAll']){_0x3d57a9[_0x96ce('0x44')]=[{'all':!![]}];}_0x3d57a9=_['merge']({},_0x3d57a9,_0x38ed74[_0x96ce('0x49')]);return db[_0x96ce('0x2f')]['find'](_0x3d57a9)[_0x96ce('0x28')](handleEntityNotFound(_0x22c30c,null))['then'](respondWithResult(_0x22c30c,null))['catch'](handleError(_0x22c30c,null));};exports[_0x96ce('0x4a')]=function(_0x33fd96,_0x164138){return db[_0x96ce('0x2f')][_0x96ce('0x4a')](_0x33fd96[_0x96ce('0x4b')],{})['then'](respondWithResult(_0x164138,0xc9))[_0x96ce('0x47')](handleError(_0x164138,null));};exports[_0x96ce('0x26')]=function(_0x2021aa,_0x49c300){if(_0x2021aa['body']['id']){delete _0x2021aa[_0x96ce('0x4b')]['id'];}return db[_0x96ce('0x2f')]['find']({'where':{'id':_0x2021aa[_0x96ce('0x4c')]['id']}})[_0x96ce('0x28')](handleEntityNotFound(_0x49c300,null))['then'](saveUpdates(_0x2021aa[_0x96ce('0x4b')],null))[_0x96ce('0x28')](respondWithResult(_0x49c300,null))[_0x96ce('0x47')](handleError(_0x49c300,null));};exports['destroy']=function(_0x2b8dc4,_0x59807a){return db[_0x96ce('0x2f')][_0x96ce('0x4d')]({'where':{'id':_0x2b8dc4['params']['id']}})[_0x96ce('0x28')](handleEntityNotFound(_0x59807a,null))['then'](removeEntity(_0x59807a,null))[_0x96ce('0x47')](handleError(_0x59807a,null));};exports[_0x96ce('0x4e')]=function(_0x151dd8,_0x9a206c,_0x1c9fd1){var _0x114f22={};var _0xea666d={};var _0x4f9243;var _0x194d06;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x151dd8[_0x96ce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x9a206c,null))[_0x96ce('0x28')](function(_0x27a7a8){if(_0x27a7a8){_0x4f9243=_0x27a7a8;_0xea666d[_0x96ce('0x34')]=_['keys'](db[_0x96ce('0x4f')]['rawAttributes']);_0xea666d[_0x96ce('0x35')]=_[_0x96ce('0x36')](_0x151dd8[_0x96ce('0x35')]);_0xea666d[_0x96ce('0x37')]=_[_0x96ce('0x38')](_0xea666d[_0x96ce('0x34')],_0xea666d[_0x96ce('0x35')]);_0x114f22[_0x96ce('0x39')]=_[_0x96ce('0x38')](_0xea666d['model'],qs[_0x96ce('0x3a')](_0x151dd8[_0x96ce('0x35')][_0x96ce('0x3a')]));_0x114f22[_0x96ce('0x39')]=_0x114f22['attributes']['length']?_0x114f22[_0x96ce('0x39')]:_0xea666d[_0x96ce('0x34')];_0x114f22[_0x96ce('0x3d')]=qs[_0x96ce('0x3e')](_0x151dd8[_0x96ce('0x35')]['sort']);_0x114f22[_0x96ce('0x3f')]=qs[_0x96ce('0x37')](_[_0x96ce('0x40')](_0x151dd8[_0x96ce('0x35')],_0xea666d[_0x96ce('0x37')]));if(_0x151dd8[_0x96ce('0x35')][_0x96ce('0x42')]){_0x114f22[_0x96ce('0x3f')]=_[_0x96ce('0x41')](_0x114f22[_0x96ce('0x3f')],{'$or':_[_0x96ce('0x2e')](_0x114f22[_0x96ce('0x39')],function(_0x5195ab){var _0x3458b8={};_0x3458b8[_0x5195ab]={'$like':'%'+_0x151dd8[_0x96ce('0x35')][_0x96ce('0x42')]+'%'};return _0x3458b8;})});}_0x114f22=_[_0x96ce('0x41')]({},_0x114f22,_0x151dd8[_0x96ce('0x49')]);return _0x4f9243[_0x96ce('0x4e')](_0x114f22);}})[_0x96ce('0x28')](function(_0x4cb0eb){if(_0x4cb0eb){_0x194d06=_0x4cb0eb[_0x96ce('0x3b')];if(!_0x151dd8[_0x96ce('0x35')][_0x96ce('0x50')](_0x96ce('0x3c'))){_0x114f22[_0x96ce('0x20')]=qs[_0x96ce('0x20')](_0x151dd8[_0x96ce('0x35')][_0x96ce('0x20')]);_0x114f22[_0x96ce('0x1e')]=qs['offset'](_0x151dd8[_0x96ce('0x35')][_0x96ce('0x1e')]);}return _0x4f9243[_0x96ce('0x4e')](_0x114f22);}})[_0x96ce('0x28')](function(_0x2271cd){if(_0x2271cd){return _0x2271cd?{'count':_0x194d06,'rows':_0x2271cd}:null;}})['then'](respondWithResult(_0x9a206c,null))[_0x96ce('0x47')](handleError(_0x9a206c,null));};exports[_0x96ce('0x51')]=function(_0x30cbc0,_0x1e2ead,_0xa042ca){if(_0x30cbc0[_0x96ce('0x4b')]['id']){delete _0x30cbc0['body']['id'];}return db[_0x96ce('0x2f')][_0x96ce('0x52')]({'where':{'id':_0x30cbc0[_0x96ce('0x4c')]['id']}})[_0x96ce('0x28')](handleEntityNotFound(_0x1e2ead,null))[_0x96ce('0x28')](function(_0x4187d1){if(_0x4187d1){_0x30cbc0[_0x96ce('0x4b')]['AccountId']=_0x4187d1['id'];_0x30cbc0[_0x96ce('0x4b')][_0x96ce('0x53')]=integrations['getSubjects'](_0x30cbc0[_0x96ce('0x4b')][_0x96ce('0x54')],_0x30cbc0['body'][_0x96ce('0x32')]);_0x30cbc0[_0x96ce('0x4b')][_0x96ce('0x55')]=integrations['getDescriptions'](_0x30cbc0['body'][_0x96ce('0x54')],_0x30cbc0['body'][_0x96ce('0x32')]);return db[_0x96ce('0x4f')][_0x96ce('0x4a')](_0x30cbc0[_0x96ce('0x4b')],{'include':[{'model':db[_0x96ce('0x56')],'as':_0x96ce('0x53')},{'model':db[_0x96ce('0x56')],'as':_0x96ce('0x55')}]});}return null;})[_0x96ce('0x28')](respondWithResult(_0x1e2ead,null))['catch'](handleError(_0x1e2ead,null));};exports[_0x96ce('0x57')]=function(_0x2d4222,_0x3f78ec,_0x475c13){var _0x512594='';return db[_0x96ce('0x2f')][_0x96ce('0x52')]({'where':{'id':_0x2d4222[_0x96ce('0x4c')]['id']},'attributes':['id',_0x96ce('0x58'),_0x96ce('0x59')]})[_0x96ce('0x28')](handleEntityNotFound(_0x3f78ec,null))['then'](function(_0x150701){if(_0x150701){_0x512594=_0x150701['remoteUri'];var _0x368d49=_0x512594[_0x96ce('0x5a')](-0x1);if(_0x368d49==='/'){_0x512594=_0x512594['substring'](0x0,_0x512594[_0x96ce('0x5b')](_0x368d49));}return rp({'method':_0x96ce('0x5c'),'uri':util[_0x96ce('0x5d')](_0x96ce('0x5e'),_0x512594,_0x96ce('0x5f')),'headers':{'Authorization':util[_0x96ce('0x5d')](_0x96ce('0x60'),new Buffer(util[_0x96ce('0x5d')](_0x96ce('0x61'),_0x150701[_0x96ce('0x59')]))[_0x96ce('0x62')](_0x96ce('0x63')))},'json':!![]});}})['then'](function(_0x4422ff){if(_0x4422ff){var _0xa46830=[_0x96ce('0x64'),_0x96ce('0x65'),'agent',_0x96ce('0x66'),_0x96ce('0x1b'),_0x96ce('0x67'),_0x96ce('0x68'),_0x96ce('0x69'),_0x96ce('0x6a'),'group',_0x96ce('0x6b')];_[_0x96ce('0x6c')](_0x4422ff,function(_0xa1c507){return _0xa46830[_0x96ce('0x6d')](_0xa1c507[_0x96ce('0x2b')])||!_0xa1c507[_0x96ce('0x6e')]&&_0xa1c507[_0x96ce('0x32')]!==_0x96ce('0x6f')&&_0xa1c507[_0x96ce('0x32')]!==_0x96ce('0x70');});return{'count':_0x4422ff[_0x96ce('0x3b')],'rows':_[_0x96ce('0x2e')](_0x4422ff,function(_0x488362){return{'id':_0x488362[_0x96ce('0x2b')],'name':_0x488362[_0x96ce('0x71')],'custom':!_0x488362[_0x96ce('0x6e')],'options':_0x488362['choices']?_[_0x96ce('0x2e')](_0x488362[_0x96ce('0x72')],function(_0x5ecb14){return{'name':_[_0x96ce('0x73')](_0x5ecb14),'value':_0x5ecb14};}):[]};})};}})[_0x96ce('0x28')](respondWithResult(_0x3f78ec,null))[_0x96ce('0x47')](function(_0x3e9b4e){var _0x552468=_0x2d4222['query'][_0x96ce('0x74')]?0x1f4:_0x3e9b4e['statusCode']||0x1f4;logger[_0x96ce('0x29')](_0x96ce('0x75'),'getFields',_0x552468,JSON[_0x96ce('0x76')](_0x3e9b4e));delete _0x3e9b4e[_0x96ce('0x2b')];if(_0x552468===0x191){_0x552468=0x190;}_0x3f78ec['status'](_0x552468)[_0x96ce('0x2c')](_0x2d4222['query'][_0x96ce('0x74')]?{'message':_0x96ce('0x77'),'statusCode':_0x3e9b4e[_0x96ce('0x78')]}:_0x3e9b4e);});};
\ No newline at end of file
index c3ea1f0..1dd8626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa91f=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api'];(function(_0x52ad0e,_0x134b99){var _0x3ee4fa=function(_0x407fc3){while(--_0x407fc3){_0x52ad0e['push'](_0x52ad0e['shift']());}};_0x3ee4fa(++_0x134b99);}(_0xa91f,0x1bc));var _0xfa91=function(_0x25dd4a,_0x255598){_0x25dd4a=_0x25dd4a-0x0;var _0x11837c=_0xa91f[_0x25dd4a];return _0x11837c;};'use strict';var _=require(_0xfa91('0x0'));var util=require(_0xfa91('0x1'));var logger=require(_0xfa91('0x2'))(_0xfa91('0x3'));var moment=require('moment');var BPromise=require(_0xfa91('0x4'));var rp=require(_0xfa91('0x5'));var fs=require('fs');var path=require(_0xfa91('0x6'));var rimraf=require(_0xfa91('0x7'));var config=require(_0xfa91('0x8'));var attributes=require(_0xfa91('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xfa91('0xa')]=function(_0x218588,_0x215035){return _0x218588[_0xfa91('0xb')](_0xfa91('0xc'),attributes,{'tableName':_0xfa91('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5df8=['../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x2a5f58,_0x718b86){var _0x1ef4aa=function(_0x4aad4f){while(--_0x4aad4f){_0x2a5f58['push'](_0x2a5f58['shift']());}};_0x1ef4aa(++_0x718b86);}(_0x5df8,0x1f2));var _0x85df=function(_0x3a135e,_0x3432c2){_0x3a135e=_0x3a135e-0x0;var _0x2f599b=_0x5df8[_0x3a135e];return _0x2f599b;};'use strict';var _=require(_0x85df('0x0'));var util=require(_0x85df('0x1'));var logger=require(_0x85df('0x2'))(_0x85df('0x3'));var moment=require('moment');var BPromise=require(_0x85df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x85df('0x5'));var rimraf=require(_0x85df('0x6'));var config=require(_0x85df('0x7'));var attributes=require(_0x85df('0x8'));var integrations=require(_0x85df('0x9'));module[_0x85df('0xa')]=function(_0xf6d80b,_0x414abb){return _0xf6d80b['define'](_0x85df('0xb'),attributes,{'tableName':_0x85df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4705cc9..bc2f3e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc452=['http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4a0fca,_0x3157bf){var _0x38385e=function(_0xc8c025){while(--_0xc8c025){_0x4a0fca['push'](_0x4a0fca['shift']());}};_0x38385e(++_0x3157bf);}(_0xc452,0x154));var _0x2c45=function(_0x1e2643,_0x82c64b){_0x1e2643=_0x1e2643-0x0;var _0x1dde54=_0xc452[_0x1e2643];return _0x1dde54;};'use strict';var _=require('lodash');var util=require(_0x2c45('0x0'));var moment=require('moment');var BPromise=require(_0x2c45('0x1'));var rs=require(_0x2c45('0x2'));var fs=require('fs');var Redis=require(_0x2c45('0x3'));var db=require(_0x2c45('0x4'))['db'];var utils=require(_0x2c45('0x5'));var logger=require(_0x2c45('0x6'))(_0x2c45('0x7'));var config=require('../../config/environment');var jayson=require(_0x2c45('0x8'));var client=jayson[_0x2c45('0x9')][_0x2c45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x573bfe,_0xe9867e,_0x2b6bd4){return new BPromise(function(_0x3d7630,_0x1cc451){return client[_0x2c45('0xb')](_0x573bfe,_0x2b6bd4)[_0x2c45('0xc')](function(_0x477ca8){logger[_0x2c45('0xd')](_0x2c45('0xe'),_0xe9867e,_0x2c45('0xf'));logger[_0x2c45('0x10')](_0x2c45('0x11'),_0xe9867e,_0x2c45('0xf'),JSON[_0x2c45('0x12')](_0x477ca8));if(_0x477ca8[_0x2c45('0x13')]){if(_0x477ca8[_0x2c45('0x13')]['code']===0x1f4){logger['error'](_0x2c45('0xe'),_0xe9867e,_0x477ca8['error'][_0x2c45('0x14')]);return _0x1cc451(_0x477ca8[_0x2c45('0x13')][_0x2c45('0x14')]);}logger[_0x2c45('0x13')](_0x2c45('0xe'),_0xe9867e,_0x477ca8[_0x2c45('0x13')][_0x2c45('0x14')]);return _0x3d7630(_0x477ca8[_0x2c45('0x13')][_0x2c45('0x14')]);}else{logger['info'](_0x2c45('0xe'),_0xe9867e,'request\x20sent');_0x3d7630(_0x477ca8['result'][_0x2c45('0x14')]);}})[_0x2c45('0x15')](function(_0x21b5fc){logger[_0x2c45('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0xe9867e,_0x21b5fc);_0x1cc451(_0x21b5fc);});});}exports[_0x2c45('0x16')]=function(_0x20d8e2){var _0x13983b=this;return new Promise(function(_0x2b7880,_0x1a8a33){return db[_0x2c45('0x17')][_0x2c45('0x18')]({'raw':_0x20d8e2[_0x2c45('0x19')]?_0x20d8e2[_0x2c45('0x19')][_0x2c45('0x1a')]===undefined?!![]:![]:!![],'where':_0x20d8e2[_0x2c45('0x19')]?_0x20d8e2[_0x2c45('0x19')][_0x2c45('0x1b')]||null:null,'attributes':_0x20d8e2[_0x2c45('0x19')]?_0x20d8e2[_0x2c45('0x19')][_0x2c45('0x1c')]||null:null,'limit':_0x20d8e2[_0x2c45('0x19')]?_0x20d8e2[_0x2c45('0x19')][_0x2c45('0x1d')]||null:null,'include':_0x20d8e2[_0x2c45('0x19')]?_0x20d8e2['options'][_0x2c45('0x1e')]?_[_0x2c45('0x1f')](_0x20d8e2[_0x2c45('0x19')][_0x2c45('0x1e')],function(_0x1d2f2b){return{'model':db[_0x1d2f2b[_0x2c45('0x20')]],'as':_0x1d2f2b['as'],'attributes':_0x1d2f2b[_0x2c45('0x1c')],'include':_0x1d2f2b['include']?_['map'](_0x1d2f2b['include'],function(_0x4b7be0){return{'model':db[_0x4b7be0[_0x2c45('0x20')]],'as':_0x4b7be0['as'],'attributes':_0x4b7be0[_0x2c45('0x1c')],'include':_0x4b7be0['include']?_['map'](_0x4b7be0[_0x2c45('0x1e')],function(_0x235b87){return{'model':db[_0x235b87[_0x2c45('0x20')]],'as':_0x235b87['as'],'attributes':_0x235b87[_0x2c45('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2c45('0xc')](function(_0xbd0bce){logger[_0x2c45('0xd')](_0x2c45('0x16'),_0x20d8e2);logger[_0x2c45('0x10')](_0x2c45('0x16'),_0x20d8e2,JSON['stringify'](_0xbd0bce));_0x2b7880(_0xbd0bce);})[_0x2c45('0x15')](function(_0x3ace6a){logger[_0x2c45('0x13')](_0x2c45('0x16'),_0x3ace6a[_0x2c45('0x14')],_0x20d8e2);_0x1a8a33(_0x13983b[_0x2c45('0x13')](0x1f4,_0x3ace6a[_0x2c45('0x14')]));});});};exports[_0x2c45('0x21')]=function(_0x50214a){var _0x4e561c=this;return new Promise(function(_0x3c1175,_0x1e3ea4){return db[_0x2c45('0x17')][_0x2c45('0x22')]({'raw':_0x50214a['options']?_0x50214a[_0x2c45('0x19')][_0x2c45('0x1a')]===undefined?!![]:![]:!![],'where':_0x50214a['options']?_0x50214a[_0x2c45('0x19')]['where']||null:null,'attributes':_0x50214a[_0x2c45('0x19')]?_0x50214a['options'][_0x2c45('0x1c')]||null:null,'include':_0x50214a[_0x2c45('0x19')]?_0x50214a[_0x2c45('0x19')][_0x2c45('0x1e')]?_[_0x2c45('0x1f')](_0x50214a[_0x2c45('0x19')][_0x2c45('0x1e')],function(_0x32bb2f){return{'model':db[_0x32bb2f[_0x2c45('0x20')]],'as':_0x32bb2f['as'],'attributes':_0x32bb2f['attributes'],'include':_0x32bb2f[_0x2c45('0x1e')]?_[_0x2c45('0x1f')](_0x32bb2f[_0x2c45('0x1e')],function(_0x1549e4){return{'model':db[_0x1549e4[_0x2c45('0x20')]],'as':_0x1549e4['as'],'attributes':_0x1549e4['attributes'],'include':_0x1549e4[_0x2c45('0x1e')]?_['map'](_0x1549e4[_0x2c45('0x1e')],function(_0x3a6211){return{'model':db[_0x3a6211[_0x2c45('0x20')]],'as':_0x3a6211['as'],'attributes':_0x3a6211[_0x2c45('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dee8d){logger[_0x2c45('0xd')](_0x2c45('0x21'),_0x50214a);logger[_0x2c45('0x10')](_0x2c45('0x21'),_0x50214a,JSON[_0x2c45('0x12')](_0x3dee8d));_0x3c1175(_0x3dee8d);})[_0x2c45('0x15')](function(_0x46eb41){logger['error']('ShowFreshdeskAccount',_0x46eb41['message'],_0x50214a);_0x1e3ea4(_0x4e561c['error'](0x1f4,_0x46eb41['message']));});});};
\ No newline at end of file
+var _0x0c97=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','options','attributes','limit','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','raw','where','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0c97,0x64));var _0x70c9=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0x0c97[_0x4eb6ec];return _0x58881b;};'use strict';var _=require('lodash');var util=require(_0x70c9('0x0'));var moment=require('moment');var BPromise=require(_0x70c9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70c9('0x2'));var db=require(_0x70c9('0x3'))['db'];var utils=require(_0x70c9('0x4'));var logger=require(_0x70c9('0x5'))(_0x70c9('0x6'));var config=require(_0x70c9('0x7'));var jayson=require(_0x70c9('0x8'));var client=jayson[_0x70c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x344715,_0x309e95,_0x40ebb4){return new BPromise(function(_0x37c3ee,_0x328a3a){return client[_0x70c9('0xa')](_0x344715,_0x40ebb4)[_0x70c9('0xb')](function(_0x1a484a){logger[_0x70c9('0xc')](_0x70c9('0xd'),_0x309e95,'request\x20sent');logger[_0x70c9('0xe')](_0x70c9('0xf'),_0x309e95,_0x70c9('0x10'),JSON[_0x70c9('0x11')](_0x1a484a));if(_0x1a484a[_0x70c9('0x12')]){if(_0x1a484a[_0x70c9('0x12')][_0x70c9('0x13')]===0x1f4){logger[_0x70c9('0x12')](_0x70c9('0xd'),_0x309e95,_0x1a484a[_0x70c9('0x12')][_0x70c9('0x14')]);return _0x328a3a(_0x1a484a[_0x70c9('0x12')][_0x70c9('0x14')]);}logger[_0x70c9('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x309e95,_0x1a484a[_0x70c9('0x12')][_0x70c9('0x14')]);return _0x37c3ee(_0x1a484a[_0x70c9('0x12')][_0x70c9('0x14')]);}else{logger[_0x70c9('0xc')](_0x70c9('0xd'),_0x309e95,'request\x20sent');_0x37c3ee(_0x1a484a[_0x70c9('0x15')][_0x70c9('0x14')]);}})[_0x70c9('0x16')](function(_0x8020bf){logger[_0x70c9('0x12')](_0x70c9('0xd'),_0x309e95,_0x8020bf);_0x328a3a(_0x8020bf);});});}exports['GetFreshdeskAccount']=function(_0x4637cc){var _0x52fd3b=this;return new Promise(function(_0x4c491e,_0x3bccdc){return db[_0x70c9('0x17')]['findAll']({'raw':_0x4637cc['options']?_0x4637cc['options']['raw']===undefined?!![]:![]:!![],'where':_0x4637cc[_0x70c9('0x18')]?_0x4637cc[_0x70c9('0x18')]['where']||null:null,'attributes':_0x4637cc['options']?_0x4637cc[_0x70c9('0x18')][_0x70c9('0x19')]||null:null,'limit':_0x4637cc['options']?_0x4637cc[_0x70c9('0x18')][_0x70c9('0x1a')]||null:null,'include':_0x4637cc['options']?_0x4637cc[_0x70c9('0x18')][_0x70c9('0x1b')]?_['map'](_0x4637cc[_0x70c9('0x18')][_0x70c9('0x1b')],function(_0x1ee443){return{'model':db[_0x1ee443[_0x70c9('0x1c')]],'as':_0x1ee443['as'],'attributes':_0x1ee443[_0x70c9('0x19')],'include':_0x1ee443[_0x70c9('0x1b')]?_[_0x70c9('0x1d')](_0x1ee443[_0x70c9('0x1b')],function(_0x16d97c){return{'model':db[_0x16d97c[_0x70c9('0x1c')]],'as':_0x16d97c['as'],'attributes':_0x16d97c[_0x70c9('0x19')],'include':_0x16d97c['include']?_[_0x70c9('0x1d')](_0x16d97c[_0x70c9('0x1b')],function(_0x174219){return{'model':db[_0x174219[_0x70c9('0x1c')]],'as':_0x174219['as'],'attributes':_0x174219['attributes']};}):[]};}):[]};}):[]:[]})[_0x70c9('0xb')](function(_0x5e3a28){logger[_0x70c9('0xc')]('GetFreshdeskAccount',_0x4637cc);logger['debug'](_0x70c9('0x1e'),_0x4637cc,JSON[_0x70c9('0x11')](_0x5e3a28));_0x4c491e(_0x5e3a28);})[_0x70c9('0x16')](function(_0x5bb2cf){logger[_0x70c9('0x12')](_0x70c9('0x1e'),_0x5bb2cf[_0x70c9('0x14')],_0x4637cc);_0x3bccdc(_0x52fd3b[_0x70c9('0x12')](0x1f4,_0x5bb2cf[_0x70c9('0x14')]));});});};exports[_0x70c9('0x1f')]=function(_0x120fcc){var _0x102625=this;return new Promise(function(_0x119489,_0x4cfe5e){return db[_0x70c9('0x17')][_0x70c9('0x20')]({'raw':_0x120fcc[_0x70c9('0x18')]?_0x120fcc['options'][_0x70c9('0x21')]===undefined?!![]:![]:!![],'where':_0x120fcc[_0x70c9('0x18')]?_0x120fcc['options'][_0x70c9('0x22')]||null:null,'attributes':_0x120fcc['options']?_0x120fcc[_0x70c9('0x18')][_0x70c9('0x19')]||null:null,'include':_0x120fcc['options']?_0x120fcc['options'][_0x70c9('0x1b')]?_['map'](_0x120fcc['options']['include'],function(_0x3e1185){return{'model':db[_0x3e1185[_0x70c9('0x1c')]],'as':_0x3e1185['as'],'attributes':_0x3e1185['attributes'],'include':_0x3e1185[_0x70c9('0x1b')]?_[_0x70c9('0x1d')](_0x3e1185['include'],function(_0x286e83){return{'model':db[_0x286e83[_0x70c9('0x1c')]],'as':_0x286e83['as'],'attributes':_0x286e83[_0x70c9('0x19')],'include':_0x286e83[_0x70c9('0x1b')]?_[_0x70c9('0x1d')](_0x286e83[_0x70c9('0x1b')],function(_0x1c07bd){return{'model':db[_0x1c07bd[_0x70c9('0x1c')]],'as':_0x1c07bd['as'],'attributes':_0x1c07bd[_0x70c9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x70c9('0xb')](function(_0x3b5f50){logger[_0x70c9('0xc')](_0x70c9('0x1f'),_0x120fcc);logger[_0x70c9('0xe')](_0x70c9('0x1f'),_0x120fcc,JSON[_0x70c9('0x11')](_0x3b5f50));_0x119489(_0x3b5f50);})[_0x70c9('0x16')](function(_0x540611){logger['error']('ShowFreshdeskAccount',_0x540611[_0x70c9('0x14')],_0x120fcc);_0x4cfe5e(_0x102625[_0x70c9('0x12')](0x1f4,_0x540611[_0x70c9('0x14')]));});});};
\ No newline at end of file
index 51a50b8..ddb9879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8fd=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','setTags','put','update','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x35e8ea,_0x307b2a){var _0x5b3e3a=function(_0x3f0f69){while(--_0x3f0f69){_0x35e8ea['push'](_0x35e8ea['shift']());}};_0x5b3e3a(++_0x307b2a);}(_0xe8fd,0x73));var _0xde8f=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xe8fd[_0x1deb03];return _0x189fe7;};'use strict';var multer=require(_0xde8f('0x0'));var util=require(_0xde8f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xde8f('0x2'));var router=express[_0xde8f('0x3')]();var fs_extra=require(_0xde8f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde8f('0x5'));var config=require(_0xde8f('0x6'));var controller=require(_0xde8f('0x7'));router[_0xde8f('0x8')]('/',auth[_0xde8f('0x9')](),controller['index']);router[_0xde8f('0x8')](_0xde8f('0xa'),auth['isAuthenticated'](),controller[_0xde8f('0xb')]);router['get'](_0xde8f('0xc'),auth['isAuthenticated'](),controller[_0xde8f('0xd')]);router[_0xde8f('0x8')](_0xde8f('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xde8f('0x8')](_0xde8f('0xf'),auth[_0xde8f('0x9')](),controller['getDescriptions']);router['get'](_0xde8f('0x10'),auth[_0xde8f('0x9')](),controller[_0xde8f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xde8f('0x12')]('/:id/tags',auth['isAuthenticated'](),controller[_0xde8f('0x13')]);router[_0xde8f('0x14')](_0xde8f('0xa'),auth[_0xde8f('0x9')](),controller[_0xde8f('0x15')]);router['delete'](_0xde8f('0xa'),auth[_0xde8f('0x9')](),controller[_0xde8f('0x16')]);module[_0xde8f('0x17')]=router;
\ No newline at end of file
+var _0x4945=['create','post','/:id/tags','setTags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x17981e,_0x314461){var _0x1a8b78=function(_0x5f4d13){while(--_0x5f4d13){_0x17981e['push'](_0x17981e['shift']());}};_0x1a8b78(++_0x314461);}(_0x4945,0x131));var _0x5494=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4945[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x5494('0x0'));var util=require(_0x5494('0x1'));var path=require(_0x5494('0x2'));var timeout=require(_0x5494('0x3'));var express=require(_0x5494('0x4'));var router=express[_0x5494('0x5')]();var fs_extra=require(_0x5494('0x6'));var auth=require(_0x5494('0x7'));var interaction=require(_0x5494('0x8'));var config=require(_0x5494('0x9'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x5494('0xa')]('/',auth[_0x5494('0xb')](),controller[_0x5494('0xc')]);router[_0x5494('0xa')](_0x5494('0xd'),auth['isAuthenticated'](),controller[_0x5494('0xe')]);router[_0x5494('0xa')](_0x5494('0xf'),auth[_0x5494('0xb')](),controller['getFields']);router[_0x5494('0xa')](_0x5494('0x10'),auth[_0x5494('0xb')](),controller[_0x5494('0x11')]);router[_0x5494('0xa')]('/:id/descriptions',auth[_0x5494('0xb')](),controller[_0x5494('0x12')]);router[_0x5494('0xa')]('/:id/tags',auth[_0x5494('0xb')](),controller['getTags']);router['post']('/',auth[_0x5494('0xb')](),controller[_0x5494('0x13')]);router[_0x5494('0x14')](_0x5494('0x15'),auth['isAuthenticated'](),controller[_0x5494('0x16')]);router[_0x5494('0x17')](_0x5494('0xd'),auth[_0x5494('0xb')](),controller[_0x5494('0x18')]);router[_0x5494('0x19')](_0x5494('0xd'),auth[_0x5494('0xb')](),controller['destroy']);module[_0x5494('0x1a')]=router;
\ No newline at end of file
index 0501084..fd848b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ce8=['sequelize','STRING'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0ce8,0x1b2));var _0x80ce=function(_0x9d9e77,_0x65b01){_0x9d9e77=_0x9d9e77-0x0;var _0x2b312e=_0x0ce8[_0x9d9e77];return _0x2b312e;};'use strict';var Sequelize=require(_0x80ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x80ce('0x1')]},'description':{'type':Sequelize[_0x80ce('0x1')]}};
\ No newline at end of file
+var _0x1f67=['sequelize','exports','STRING'];(function(_0x11a55c,_0x4eced9){var _0x26c390=function(_0x5b0662){while(--_0x5b0662){_0x11a55c['push'](_0x11a55c['shift']());}};_0x26c390(++_0x4eced9);}(_0x1f67,0x11a));var _0x71f6=function(_0x536c47,_0x2ed3a4){_0x536c47=_0x536c47-0x0;var _0xb89735=_0x1f67[_0x536c47];return _0xb89735;};'use strict';var Sequelize=require(_0x71f6('0x0'));module[_0x71f6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x71f6('0x2')]}};
\ No newline at end of file
index 90a9e3f..6b74f47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d47=['query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','filter','options','includeAll','include','FreshdeskConfiguration','findAll','rows','show','params','find','catch','create','body','findOne','order','getFields','getSubjects','FreshdeskField','hasOwnProperty','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','rawAttributes','key','model','map'];(function(_0x8ae4,_0x4eaf07){var _0x5529c2=function(_0xe79fe9){while(--_0xe79fe9){_0x8ae4['push'](_0x8ae4['shift']());}};_0x5529c2(++_0x4eaf07);}(_0x3d47,0x1bd));var _0x73d4=function(_0x1e6423,_0xabb0a7){_0x1e6423=_0x1e6423-0x0;var _0x5942c4=_0x3d47[_0x1e6423];return _0x5942c4;};'use strict';var emlformat=require(_0x73d4('0x0'));var rimraf=require(_0x73d4('0x1'));var zipdir=require(_0x73d4('0x2'));var jsonpatch=require(_0x73d4('0x3'));var rp=require(_0x73d4('0x4'));var moment=require(_0x73d4('0x5'));var BPromise=require(_0x73d4('0x6'));var Mustache=require(_0x73d4('0x7'));var util=require(_0x73d4('0x8'));var path=require('path');var sox=require(_0x73d4('0x9'));var csv=require(_0x73d4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73d4('0xb'));var _=require('lodash');var squel=require(_0x73d4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x73d4('0xd'));var toCsv=require(_0x73d4('0xa'));var querystring=require(_0x73d4('0xe'));var Papa=require(_0x73d4('0xf'));var Redis=require('ioredis');var authService=require(_0x73d4('0x10'));var qs=require(_0x73d4('0x11'));var as=require(_0x73d4('0x12'));var hardwareService=require(_0x73d4('0x13'));var logger=require(_0x73d4('0x14'))(_0x73d4('0x15'));var utils=require(_0x73d4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x73d4('0x17'));var db=require(_0x73d4('0x18'))['db'];function respondWithStatusCode(_0x28b953,_0x20893c){_0x20893c=_0x20893c||0xcc;return function(_0x30750b){if(_0x30750b){return _0x28b953[_0x73d4('0x19')](_0x20893c);}return _0x28b953[_0x73d4('0x1a')](_0x20893c)[_0x73d4('0x1b')]();};}function respondWithResult(_0x5c1bef,_0xdded7b){_0xdded7b=_0xdded7b||0xc8;return function(_0x263e5c){if(_0x263e5c){return _0x5c1bef[_0x73d4('0x1a')](_0xdded7b)[_0x73d4('0x1c')](_0x263e5c);}};}function respondWithFilteredResult(_0x58760a,_0x554e4d){return function(_0x16c937){if(_0x16c937){var _0x5e6233=typeof _0x554e4d[_0x73d4('0x1d')]===_0x73d4('0x1e')&&typeof _0x554e4d[_0x73d4('0x1f')]===_0x73d4('0x1e');var _0x367753=_0x16c937[_0x73d4('0x20')];var _0x39ed94=_0x5e6233?0x0:_0x554e4d['offset'];var _0x3dd571=_0x5e6233?_0x16c937[_0x73d4('0x20')]:_0x554e4d[_0x73d4('0x1d')]+_0x554e4d[_0x73d4('0x1f')];var _0x32cef0;if(_0x3dd571>=_0x367753){_0x3dd571=_0x367753;_0x32cef0=0xc8;}else{_0x32cef0=0xce;}_0x58760a[_0x73d4('0x1a')](_0x32cef0);return _0x58760a[_0x73d4('0x21')](_0x73d4('0x22'),_0x39ed94+'-'+_0x3dd571+'/'+_0x367753)[_0x73d4('0x1c')](_0x16c937);}return null;};}function patchUpdates(_0x17937d){return function(_0x30f019){try{jsonpatch[_0x73d4('0x23')](_0x30f019,_0x17937d,!![]);}catch(_0x4ad838){return BPromise['reject'](_0x4ad838);}return _0x30f019['save']();};}function saveUpdates(_0x3a36d7,_0x57d1d0){return function(_0x57097f){if(_0x57097f){return _0x57097f[_0x73d4('0x24')](_0x3a36d7)[_0x73d4('0x25')](function(_0x18b3e6){return _0x18b3e6;});}return null;};}function removeEntity(_0x4709b9,_0x9f0432){return function(_0x518c93){if(_0x518c93){return _0x518c93[_0x73d4('0x26')]()[_0x73d4('0x25')](function(){_0x4709b9[_0x73d4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf97a27,_0x3a49fb){return function(_0x4453a7){if(!_0x4453a7){_0xf97a27[_0x73d4('0x19')](0x194);}return _0x4453a7;};}function handleError(_0x176bfd,_0x521490){_0x521490=_0x521490||0x1f4;return function(_0x49e955){logger[_0x73d4('0x27')](_0x49e955[_0x73d4('0x28')]);if(_0x49e955[_0x73d4('0x29')]){delete _0x49e955[_0x73d4('0x29')];}_0x176bfd[_0x73d4('0x1a')](_0x521490)[_0x73d4('0x2a')](_0x49e955);};}exports['index']=function(_0x4cdb15,_0x2271ef){var _0x426b33={},_0x1e5bd4={},_0x1cc85a={'count':0x0,'rows':[]};var _0x4cdc57=_['map'](db['FreshdeskConfiguration'][_0x73d4('0x2b')],function(_0x2489f5){return{'name':_0x2489f5['fieldName'],'type':_0x2489f5['type'][_0x73d4('0x2c')]};});_0x1e5bd4[_0x73d4('0x2d')]=_[_0x73d4('0x2e')](_0x4cdc57,_0x73d4('0x29'));_0x1e5bd4[_0x73d4('0x2f')]=_[_0x73d4('0x30')](_0x4cdb15['query']);_0x1e5bd4[_0x73d4('0x31')]=_[_0x73d4('0x32')](_0x1e5bd4[_0x73d4('0x2d')],_0x1e5bd4[_0x73d4('0x2f')]);_0x426b33[_0x73d4('0x33')]=_[_0x73d4('0x32')](_0x1e5bd4[_0x73d4('0x2d')],qs[_0x73d4('0x34')](_0x4cdb15[_0x73d4('0x2f')][_0x73d4('0x34')]));_0x426b33[_0x73d4('0x33')]=_0x426b33['attributes'][_0x73d4('0x35')]?_0x426b33[_0x73d4('0x33')]:_0x1e5bd4[_0x73d4('0x2d')];if(!_0x4cdb15[_0x73d4('0x2f')]['hasOwnProperty'](_0x73d4('0x36'))){_0x426b33[_0x73d4('0x1f')]=qs[_0x73d4('0x1f')](_0x4cdb15[_0x73d4('0x2f')]['limit']);_0x426b33[_0x73d4('0x1d')]=qs[_0x73d4('0x1d')](_0x4cdb15['query'][_0x73d4('0x1d')]);}_0x426b33['order']=qs['sort'](_0x4cdb15[_0x73d4('0x2f')][_0x73d4('0x37')]);_0x426b33[_0x73d4('0x38')]=qs['filters'](_[_0x73d4('0x39')](_0x4cdb15[_0x73d4('0x2f')],_0x1e5bd4['filters']),_0x4cdc57);if(_0x4cdb15['query']['filter']){_0x426b33[_0x73d4('0x38')]=_[_0x73d4('0x3a')](_0x426b33[_0x73d4('0x38')],{'$or':_[_0x73d4('0x2e')](_0x4cdc57,function(_0x5e5425){if(_0x5e5425[_0x73d4('0x3b')]!=='VIRTUAL'){var _0x233e26={};_0x233e26[_0x5e5425[_0x73d4('0x29')]]={'$like':'%'+_0x4cdb15['query'][_0x73d4('0x3c')]+'%'};return _0x233e26;}})});}_0x426b33=_[_0x73d4('0x3a')]({},_0x426b33,_0x4cdb15[_0x73d4('0x3d')]);var _0x142b06={'where':_0x426b33[_0x73d4('0x38')]};return db['FreshdeskConfiguration'][_0x73d4('0x20')](_0x142b06)[_0x73d4('0x25')](function(_0x5f1ed6){_0x1cc85a[_0x73d4('0x20')]=_0x5f1ed6;if(_0x4cdb15[_0x73d4('0x2f')][_0x73d4('0x3e')]){_0x426b33[_0x73d4('0x3f')]=[{'all':!![]}];}return db[_0x73d4('0x40')][_0x73d4('0x41')](_0x426b33);})[_0x73d4('0x25')](function(_0x4e747a){_0x1cc85a[_0x73d4('0x42')]=_0x4e747a;return _0x1cc85a;})[_0x73d4('0x25')](respondWithFilteredResult(_0x2271ef,_0x426b33))['catch'](handleError(_0x2271ef,null));};exports[_0x73d4('0x43')]=function(_0x59c9d9,_0x460c78){var _0x77d8e5={'raw':![],'where':{'id':_0x59c9d9[_0x73d4('0x44')]['id']}},_0x1966dd={};_0x1966dd['model']=_[_0x73d4('0x30')](db[_0x73d4('0x40')]['rawAttributes']);_0x1966dd[_0x73d4('0x2f')]=_[_0x73d4('0x30')](_0x59c9d9['query']);_0x1966dd['filters']=_[_0x73d4('0x32')](_0x1966dd[_0x73d4('0x2d')],_0x1966dd[_0x73d4('0x2f')]);_0x77d8e5[_0x73d4('0x33')]=_[_0x73d4('0x32')](_0x1966dd[_0x73d4('0x2d')],qs['fields'](_0x59c9d9[_0x73d4('0x2f')][_0x73d4('0x34')]));_0x77d8e5[_0x73d4('0x33')]=_0x77d8e5[_0x73d4('0x33')][_0x73d4('0x35')]?_0x77d8e5[_0x73d4('0x33')]:_0x1966dd[_0x73d4('0x2d')];if(_0x59c9d9[_0x73d4('0x2f')][_0x73d4('0x3e')]){_0x77d8e5[_0x73d4('0x3f')]=[{'all':!![]}];}_0x77d8e5=_['merge']({},_0x77d8e5,_0x59c9d9[_0x73d4('0x3d')]);return db[_0x73d4('0x40')][_0x73d4('0x45')](_0x77d8e5)[_0x73d4('0x25')](handleEntityNotFound(_0x460c78,null))[_0x73d4('0x25')](respondWithResult(_0x460c78,null))[_0x73d4('0x46')](handleError(_0x460c78,null));};exports[_0x73d4('0x47')]=function(_0x575bab,_0x256582){return db[_0x73d4('0x40')][_0x73d4('0x47')](_0x575bab['body'],{})['then'](respondWithResult(_0x256582,0xc9))[_0x73d4('0x46')](handleError(_0x256582,null));};exports[_0x73d4('0x24')]=function(_0x5513b0,_0x7b66d8){if(_0x5513b0[_0x73d4('0x48')]['id']){delete _0x5513b0[_0x73d4('0x48')]['id'];}return db[_0x73d4('0x40')][_0x73d4('0x45')]({'where':{'id':_0x5513b0[_0x73d4('0x44')]['id']}})[_0x73d4('0x25')](handleEntityNotFound(_0x7b66d8,null))[_0x73d4('0x25')](saveUpdates(_0x5513b0[_0x73d4('0x48')],null))[_0x73d4('0x25')](respondWithResult(_0x7b66d8,null))[_0x73d4('0x46')](handleError(_0x7b66d8,null));};exports['destroy']=function(_0x4527d0,_0x595ddc){return db[_0x73d4('0x40')]['find']({'where':{'id':_0x4527d0[_0x73d4('0x44')]['id']}})[_0x73d4('0x25')](handleEntityNotFound(_0x595ddc,null))[_0x73d4('0x25')](removeEntity(_0x595ddc,null))[_0x73d4('0x46')](handleError(_0x595ddc,null));};exports['getFields']=function(_0x531450,_0x32aef3,_0x3c47da){var _0x339fc9={};var _0x3da2e3={};var _0x13b833;var _0x2bd980;return db[_0x73d4('0x40')][_0x73d4('0x49')]({'where':{'id':_0x531450[_0x73d4('0x44')]['id']}})[_0x73d4('0x25')](handleEntityNotFound(_0x32aef3,null))[_0x73d4('0x25')](function(_0x46b69d){if(_0x46b69d){_0x13b833=_0x46b69d;_0x3da2e3[_0x73d4('0x2d')]=_['keys'](db['FreshdeskField'][_0x73d4('0x2b')]);_0x3da2e3[_0x73d4('0x2f')]=_[_0x73d4('0x30')](_0x531450[_0x73d4('0x2f')]);_0x3da2e3[_0x73d4('0x31')]=_[_0x73d4('0x32')](_0x3da2e3[_0x73d4('0x2d')],_0x3da2e3[_0x73d4('0x2f')]);_0x339fc9[_0x73d4('0x33')]=_[_0x73d4('0x32')](_0x3da2e3[_0x73d4('0x2d')],qs[_0x73d4('0x34')](_0x531450['query'][_0x73d4('0x34')]));_0x339fc9[_0x73d4('0x33')]=_0x339fc9[_0x73d4('0x33')][_0x73d4('0x35')]?_0x339fc9[_0x73d4('0x33')]:_0x3da2e3[_0x73d4('0x2d')];_0x339fc9[_0x73d4('0x4a')]=qs[_0x73d4('0x37')](_0x531450['query'][_0x73d4('0x37')]);_0x339fc9['where']=qs[_0x73d4('0x31')](_[_0x73d4('0x39')](_0x531450[_0x73d4('0x2f')],_0x3da2e3[_0x73d4('0x31')]));if(_0x531450[_0x73d4('0x2f')]['filter']){_0x339fc9['where']=_[_0x73d4('0x3a')](_0x339fc9[_0x73d4('0x38')],{'$or':_[_0x73d4('0x2e')](_0x339fc9[_0x73d4('0x33')],function(_0x44d8ad){var _0xa13796={};_0xa13796[_0x44d8ad]={'$like':'%'+_0x531450['query'][_0x73d4('0x3c')]+'%'};return _0xa13796;})});}_0x339fc9=_[_0x73d4('0x3a')]({},_0x339fc9,_0x531450[_0x73d4('0x3d')]);return _0x13b833[_0x73d4('0x4b')](_0x339fc9);}})[_0x73d4('0x25')](function(_0x43cf7e){if(_0x43cf7e){_0x2bd980=_0x43cf7e['length'];if(!_0x531450[_0x73d4('0x2f')]['hasOwnProperty'](_0x73d4('0x36'))){_0x339fc9[_0x73d4('0x1f')]=qs[_0x73d4('0x1f')](_0x531450['query'][_0x73d4('0x1f')]);_0x339fc9['offset']=qs[_0x73d4('0x1d')](_0x531450['query']['offset']);}return _0x13b833['getFields'](_0x339fc9);}})[_0x73d4('0x25')](function(_0x112b20){if(_0x112b20){return _0x112b20?{'count':_0x2bd980,'rows':_0x112b20}:null;}})['then'](respondWithResult(_0x32aef3,null))[_0x73d4('0x46')](handleError(_0x32aef3,null));};exports[_0x73d4('0x4c')]=function(_0x7be5f9,_0x4a1f41,_0x2a33a2){var _0x47c238={};var _0x32a635={};var _0x4084bc;var _0x50994e;return db[_0x73d4('0x40')][_0x73d4('0x49')]({'where':{'id':_0x7be5f9[_0x73d4('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a1f41,null))['then'](function(_0x1646d5){if(_0x1646d5){_0x4084bc=_0x1646d5;_0x32a635[_0x73d4('0x2d')]=_[_0x73d4('0x30')](db[_0x73d4('0x4d')][_0x73d4('0x2b')]);_0x32a635[_0x73d4('0x2f')]=_['keys'](_0x7be5f9[_0x73d4('0x2f')]);_0x32a635[_0x73d4('0x31')]=_[_0x73d4('0x32')](_0x32a635[_0x73d4('0x2d')],_0x32a635['query']);_0x47c238[_0x73d4('0x33')]=_[_0x73d4('0x32')](_0x32a635[_0x73d4('0x2d')],qs['fields'](_0x7be5f9[_0x73d4('0x2f')][_0x73d4('0x34')]));_0x47c238[_0x73d4('0x33')]=_0x47c238[_0x73d4('0x33')][_0x73d4('0x35')]?_0x47c238[_0x73d4('0x33')]:_0x32a635[_0x73d4('0x2d')];_0x47c238[_0x73d4('0x4a')]=qs[_0x73d4('0x37')](_0x7be5f9[_0x73d4('0x2f')][_0x73d4('0x37')]);_0x47c238['where']=qs[_0x73d4('0x31')](_['pick'](_0x7be5f9[_0x73d4('0x2f')],_0x32a635[_0x73d4('0x31')]));if(_0x7be5f9['query'][_0x73d4('0x3c')]){_0x47c238['where']=_[_0x73d4('0x3a')](_0x47c238['where'],{'$or':_[_0x73d4('0x2e')](_0x47c238[_0x73d4('0x33')],function(_0xb08623){var _0x511b56={};_0x511b56[_0xb08623]={'$like':'%'+_0x7be5f9['query'][_0x73d4('0x3c')]+'%'};return _0x511b56;})});}_0x47c238=_[_0x73d4('0x3a')]({},_0x47c238,_0x7be5f9[_0x73d4('0x3d')]);return _0x4084bc['getSubjects'](_0x47c238);}})[_0x73d4('0x25')](function(_0x5cf5eb){if(_0x5cf5eb){_0x50994e=_0x5cf5eb[_0x73d4('0x35')];if(!_0x7be5f9[_0x73d4('0x2f')][_0x73d4('0x4e')]('nolimit')){_0x47c238[_0x73d4('0x1f')]=qs[_0x73d4('0x1f')](_0x7be5f9[_0x73d4('0x2f')][_0x73d4('0x1f')]);_0x47c238[_0x73d4('0x1d')]=qs[_0x73d4('0x1d')](_0x7be5f9['query'][_0x73d4('0x1d')]);}return _0x4084bc[_0x73d4('0x4c')](_0x47c238);}})[_0x73d4('0x25')](function(_0x196d90){if(_0x196d90){return _0x196d90?{'count':_0x50994e,'rows':_0x196d90}:null;}})[_0x73d4('0x25')](respondWithResult(_0x4a1f41,null))['catch'](handleError(_0x4a1f41,null));};exports['getDescriptions']=function(_0x3baa7e,_0x1578de,_0xe6db08){var _0x21e78a={};var _0x266afb={};var _0x18f631;var _0x4393d4;return db[_0x73d4('0x40')]['findOne']({'where':{'id':_0x3baa7e[_0x73d4('0x44')]['id']}})[_0x73d4('0x25')](handleEntityNotFound(_0x1578de,null))[_0x73d4('0x25')](function(_0x4208db){if(_0x4208db){_0x18f631=_0x4208db;_0x266afb['model']=_[_0x73d4('0x30')](db[_0x73d4('0x4d')][_0x73d4('0x2b')]);_0x266afb[_0x73d4('0x2f')]=_['keys'](_0x3baa7e[_0x73d4('0x2f')]);_0x266afb[_0x73d4('0x31')]=_[_0x73d4('0x32')](_0x266afb[_0x73d4('0x2d')],_0x266afb['query']);_0x21e78a[_0x73d4('0x33')]=_[_0x73d4('0x32')](_0x266afb['model'],qs[_0x73d4('0x34')](_0x3baa7e[_0x73d4('0x2f')]['fields']));_0x21e78a[_0x73d4('0x33')]=_0x21e78a[_0x73d4('0x33')]['length']?_0x21e78a['attributes']:_0x266afb[_0x73d4('0x2d')];_0x21e78a[_0x73d4('0x4a')]=qs[_0x73d4('0x37')](_0x3baa7e[_0x73d4('0x2f')][_0x73d4('0x37')]);_0x21e78a['where']=qs[_0x73d4('0x31')](_[_0x73d4('0x39')](_0x3baa7e[_0x73d4('0x2f')],_0x266afb['filters']));if(_0x3baa7e[_0x73d4('0x2f')]['filter']){_0x21e78a[_0x73d4('0x38')]=_['merge'](_0x21e78a[_0x73d4('0x38')],{'$or':_[_0x73d4('0x2e')](_0x21e78a[_0x73d4('0x33')],function(_0x558a57){var _0xb2815b={};_0xb2815b[_0x558a57]={'$like':'%'+_0x3baa7e['query']['filter']+'%'};return _0xb2815b;})});}_0x21e78a=_[_0x73d4('0x3a')]({},_0x21e78a,_0x3baa7e[_0x73d4('0x3d')]);return _0x18f631['getDescriptions'](_0x21e78a);}})['then'](function(_0x3bf92f){if(_0x3bf92f){_0x4393d4=_0x3bf92f['length'];if(!_0x3baa7e[_0x73d4('0x2f')][_0x73d4('0x4e')](_0x73d4('0x36'))){_0x21e78a[_0x73d4('0x1f')]=qs['limit'](_0x3baa7e[_0x73d4('0x2f')][_0x73d4('0x1f')]);_0x21e78a[_0x73d4('0x1d')]=qs[_0x73d4('0x1d')](_0x3baa7e[_0x73d4('0x2f')]['offset']);}return _0x18f631[_0x73d4('0x4f')](_0x21e78a);}})[_0x73d4('0x25')](function(_0x37e910){if(_0x37e910){return _0x37e910?{'count':_0x4393d4,'rows':_0x37e910}:null;}})[_0x73d4('0x25')](respondWithResult(_0x1578de,null))[_0x73d4('0x46')](handleError(_0x1578de,null));};exports[_0x73d4('0x50')]=function(_0xd4ccec,_0x150590,_0x317947){var _0x3ace9e={};var _0x4c25fc={};var _0x3e40c7;var _0x1e007e;return db[_0x73d4('0x40')][_0x73d4('0x49')]({'where':{'id':_0xd4ccec[_0x73d4('0x44')]['id']}})[_0x73d4('0x25')](handleEntityNotFound(_0x150590,null))[_0x73d4('0x25')](function(_0x18ab3b){if(_0x18ab3b){_0x3e40c7=_0x18ab3b;_0x4c25fc[_0x73d4('0x2d')]=_[_0x73d4('0x30')](db['Tag'][_0x73d4('0x2b')]);_0x4c25fc[_0x73d4('0x2f')]=_['keys'](_0xd4ccec[_0x73d4('0x2f')]);_0x4c25fc[_0x73d4('0x31')]=_[_0x73d4('0x32')](_0x4c25fc[_0x73d4('0x2d')],_0x4c25fc['query']);_0x3ace9e[_0x73d4('0x33')]=_['intersection'](_0x4c25fc[_0x73d4('0x2d')],qs[_0x73d4('0x34')](_0xd4ccec[_0x73d4('0x2f')][_0x73d4('0x34')]));_0x3ace9e['attributes']=_0x3ace9e['attributes'][_0x73d4('0x35')]?_0x3ace9e['attributes']:_0x4c25fc[_0x73d4('0x2d')];_0x3ace9e[_0x73d4('0x4a')]=qs[_0x73d4('0x37')](_0xd4ccec[_0x73d4('0x2f')][_0x73d4('0x37')]);_0x3ace9e[_0x73d4('0x38')]=qs[_0x73d4('0x31')](_[_0x73d4('0x39')](_0xd4ccec[_0x73d4('0x2f')],_0x4c25fc['filters']));if(_0xd4ccec[_0x73d4('0x2f')][_0x73d4('0x3c')]){_0x3ace9e['where']=_['merge'](_0x3ace9e[_0x73d4('0x38')],{'$or':_[_0x73d4('0x2e')](_0x3ace9e[_0x73d4('0x33')],function(_0x42b0d2){var _0x5bc1fd={};_0x5bc1fd[_0x42b0d2]={'$like':'%'+_0xd4ccec['query'][_0x73d4('0x3c')]+'%'};return _0x5bc1fd;})});}_0x3ace9e=_[_0x73d4('0x3a')]({},_0x3ace9e,_0xd4ccec['options']);return _0x3e40c7['getTags'](_0x3ace9e);}})[_0x73d4('0x25')](function(_0x4d7506){if(_0x4d7506){_0x1e007e=_0x4d7506[_0x73d4('0x35')];if(!_0xd4ccec[_0x73d4('0x2f')][_0x73d4('0x4e')](_0x73d4('0x36'))){_0x3ace9e[_0x73d4('0x1f')]=qs[_0x73d4('0x1f')](_0xd4ccec[_0x73d4('0x2f')][_0x73d4('0x1f')]);_0x3ace9e[_0x73d4('0x1d')]=qs[_0x73d4('0x1d')](_0xd4ccec['query'][_0x73d4('0x1d')]);}return _0x3e40c7['getTags'](_0x3ace9e);}})[_0x73d4('0x25')](function(_0xfcf500){if(_0xfcf500){return _0xfcf500?{'count':_0x1e007e,'rows':_0xfcf500}:null;}})[_0x73d4('0x25')](respondWithResult(_0x150590,null))[_0x73d4('0x46')](handleError(_0x150590,null));};exports[_0x73d4('0x51')]=function(_0x5b284d,_0x4564fa,_0x1a5ccb){if(_0x5b284d['body']['id']){delete _0x5b284d['body']['id'];}return db[_0x73d4('0x40')][_0x73d4('0x49')]({'where':{'id':_0x5b284d['params']['id']}})[_0x73d4('0x25')](handleEntityNotFound(_0x4564fa,null))[_0x73d4('0x25')](function(_0x3a1eba){if(_0x3a1eba){return _0x3a1eba[_0x73d4('0x51')](_0x5b284d[_0x73d4('0x48')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4564fa,null))[_0x73d4('0x46')](handleError(_0x4564fa,null));};
\ No newline at end of file
+var _0x6984=['stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','include','FreshdeskConfiguration','findAll','rows','catch','show','params','fields','includeAll','create','body','getFields','findOne','order','getSubjects','getDescriptions','FreshdeskField','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../config/environment','status','json','offset','limit','undefined','count','set','reject','save','update','end'];(function(_0x22bcdc,_0x5e01fa){var _0x439547=function(_0x3ca99d){while(--_0x3ca99d){_0x22bcdc['push'](_0x22bcdc['shift']());}};_0x439547(++_0x5e01fa);}(_0x6984,0x1d3));var _0x4698=function(_0x35a545,_0x52d777){_0x35a545=_0x35a545-0x0;var _0x4783c3=_0x6984[_0x35a545];return _0x4783c3;};'use strict';var emlformat=require(_0x4698('0x0'));var rimraf=require(_0x4698('0x1'));var zipdir=require(_0x4698('0x2'));var jsonpatch=require(_0x4698('0x3'));var rp=require(_0x4698('0x4'));var moment=require(_0x4698('0x5'));var BPromise=require(_0x4698('0x6'));var Mustache=require(_0x4698('0x7'));var util=require('util');var path=require(_0x4698('0x8'));var sox=require(_0x4698('0x9'));var csv=require(_0x4698('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4698('0xb'));var _=require('lodash');var squel=require(_0x4698('0xc'));var crypto=require(_0x4698('0xd'));var jsforce=require(_0x4698('0xe'));var deskjs=require(_0x4698('0xf'));var toCsv=require(_0x4698('0xa'));var querystring=require(_0x4698('0x10'));var Papa=require(_0x4698('0x11'));var Redis=require(_0x4698('0x12'));var authService=require(_0x4698('0x13'));var qs=require(_0x4698('0x14'));var as=require(_0x4698('0x15'));var hardwareService=require(_0x4698('0x16'));var logger=require('../../config/logger')(_0x4698('0x17'));var utils=require(_0x4698('0x18'));var config=require(_0x4698('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5689ae,_0x463508){_0x463508=_0x463508||0xcc;return function(_0x1bf2ec){if(_0x1bf2ec){return _0x5689ae['sendStatus'](_0x463508);}return _0x5689ae[_0x4698('0x1a')](_0x463508)['end']();};}function respondWithResult(_0x6c3e8b,_0x512e18){_0x512e18=_0x512e18||0xc8;return function(_0x4be570){if(_0x4be570){return _0x6c3e8b[_0x4698('0x1a')](_0x512e18)[_0x4698('0x1b')](_0x4be570);}};}function respondWithFilteredResult(_0x5941fb,_0xbb7aec){return function(_0x1f330f){if(_0x1f330f){var _0x4955ce=typeof _0xbb7aec[_0x4698('0x1c')]==='undefined'&&typeof _0xbb7aec[_0x4698('0x1d')]===_0x4698('0x1e');var _0x177a50=_0x1f330f[_0x4698('0x1f')];var _0x514770=_0x4955ce?0x0:_0xbb7aec[_0x4698('0x1c')];var _0x4d3913=_0x4955ce?_0x1f330f[_0x4698('0x1f')]:_0xbb7aec[_0x4698('0x1c')]+_0xbb7aec[_0x4698('0x1d')];var _0x5392c7;if(_0x4d3913>=_0x177a50){_0x4d3913=_0x177a50;_0x5392c7=0xc8;}else{_0x5392c7=0xce;}_0x5941fb[_0x4698('0x1a')](_0x5392c7);return _0x5941fb[_0x4698('0x20')]('Content-Range',_0x514770+'-'+_0x4d3913+'/'+_0x177a50)[_0x4698('0x1b')](_0x1f330f);}return null;};}function patchUpdates(_0x325fd8){return function(_0x2c5e91){try{jsonpatch['apply'](_0x2c5e91,_0x325fd8,!![]);}catch(_0x5f101a){return BPromise[_0x4698('0x21')](_0x5f101a);}return _0x2c5e91[_0x4698('0x22')]();};}function saveUpdates(_0x459f81,_0x2a18f1){return function(_0x10b3a8){if(_0x10b3a8){return _0x10b3a8[_0x4698('0x23')](_0x459f81)['then'](function(_0x4525b7){return _0x4525b7;});}return null;};}function removeEntity(_0x55ef77,_0x237462){return function(_0x1112da){if(_0x1112da){return _0x1112da['destroy']()['then'](function(){_0x55ef77['status'](0xcc)[_0x4698('0x24')]();});}};}function handleEntityNotFound(_0x5ced0b,_0x487ffe){return function(_0x188099){if(!_0x188099){_0x5ced0b['sendStatus'](0x194);}return _0x188099;};}function handleError(_0x5d4460,_0x25a98a){_0x25a98a=_0x25a98a||0x1f4;return function(_0x4e59ee){logger['error'](_0x4e59ee[_0x4698('0x25')]);if(_0x4e59ee[_0x4698('0x26')]){delete _0x4e59ee[_0x4698('0x26')];}_0x5d4460[_0x4698('0x1a')](_0x25a98a)[_0x4698('0x27')](_0x4e59ee);};}exports[_0x4698('0x28')]=function(_0x4316eb,_0x7e6ce3){var _0x1968a3={},_0x3c27fb={},_0x28e502={'count':0x0,'rows':[]};var _0x37a9fc=_[_0x4698('0x29')](db['FreshdeskConfiguration'][_0x4698('0x2a')],function(_0x57f0fe){return{'name':_0x57f0fe[_0x4698('0x2b')],'type':_0x57f0fe[_0x4698('0x2c')][_0x4698('0x2d')]};});_0x3c27fb['model']=_[_0x4698('0x29')](_0x37a9fc,_0x4698('0x26'));_0x3c27fb['query']=_[_0x4698('0x2e')](_0x4316eb[_0x4698('0x2f')]);_0x3c27fb[_0x4698('0x30')]=_[_0x4698('0x31')](_0x3c27fb[_0x4698('0x32')],_0x3c27fb['query']);_0x1968a3['attributes']=_[_0x4698('0x31')](_0x3c27fb['model'],qs['fields'](_0x4316eb['query']['fields']));_0x1968a3[_0x4698('0x33')]=_0x1968a3['attributes'][_0x4698('0x34')]?_0x1968a3[_0x4698('0x33')]:_0x3c27fb[_0x4698('0x32')];if(!_0x4316eb['query'][_0x4698('0x35')](_0x4698('0x36'))){_0x1968a3[_0x4698('0x1d')]=qs[_0x4698('0x1d')](_0x4316eb[_0x4698('0x2f')][_0x4698('0x1d')]);_0x1968a3[_0x4698('0x1c')]=qs[_0x4698('0x1c')](_0x4316eb[_0x4698('0x2f')][_0x4698('0x1c')]);}_0x1968a3['order']=qs[_0x4698('0x37')](_0x4316eb[_0x4698('0x2f')][_0x4698('0x37')]);_0x1968a3[_0x4698('0x38')]=qs[_0x4698('0x30')](_[_0x4698('0x39')](_0x4316eb[_0x4698('0x2f')],_0x3c27fb[_0x4698('0x30')]),_0x37a9fc);if(_0x4316eb['query'][_0x4698('0x3a')]){_0x1968a3[_0x4698('0x38')]=_[_0x4698('0x3b')](_0x1968a3[_0x4698('0x38')],{'$or':_[_0x4698('0x29')](_0x37a9fc,function(_0x204f37){if(_0x204f37[_0x4698('0x2c')]!==_0x4698('0x3c')){var _0x224b91={};_0x224b91[_0x204f37[_0x4698('0x26')]]={'$like':'%'+_0x4316eb[_0x4698('0x2f')][_0x4698('0x3a')]+'%'};return _0x224b91;}})});}_0x1968a3=_[_0x4698('0x3b')]({},_0x1968a3,_0x4316eb[_0x4698('0x3d')]);var _0x3f471c={'where':_0x1968a3['where']};return db['FreshdeskConfiguration'][_0x4698('0x1f')](_0x3f471c)[_0x4698('0x3e')](function(_0x563193){_0x28e502[_0x4698('0x1f')]=_0x563193;if(_0x4316eb[_0x4698('0x2f')]['includeAll']){_0x1968a3[_0x4698('0x3f')]=[{'all':!![]}];}return db[_0x4698('0x40')][_0x4698('0x41')](_0x1968a3);})[_0x4698('0x3e')](function(_0x2d7737){_0x28e502[_0x4698('0x42')]=_0x2d7737;return _0x28e502;})[_0x4698('0x3e')](respondWithFilteredResult(_0x7e6ce3,_0x1968a3))[_0x4698('0x43')](handleError(_0x7e6ce3,null));};exports[_0x4698('0x44')]=function(_0x27fa52,_0x5de830){var _0x3105ac={'raw':![],'where':{'id':_0x27fa52[_0x4698('0x45')]['id']}},_0x1ced12={};_0x1ced12['model']=_[_0x4698('0x2e')](db[_0x4698('0x40')]['rawAttributes']);_0x1ced12[_0x4698('0x2f')]=_[_0x4698('0x2e')](_0x27fa52[_0x4698('0x2f')]);_0x1ced12[_0x4698('0x30')]=_['intersection'](_0x1ced12[_0x4698('0x32')],_0x1ced12[_0x4698('0x2f')]);_0x3105ac[_0x4698('0x33')]=_['intersection'](_0x1ced12[_0x4698('0x32')],qs[_0x4698('0x46')](_0x27fa52[_0x4698('0x2f')][_0x4698('0x46')]));_0x3105ac[_0x4698('0x33')]=_0x3105ac[_0x4698('0x33')][_0x4698('0x34')]?_0x3105ac[_0x4698('0x33')]:_0x1ced12[_0x4698('0x32')];if(_0x27fa52[_0x4698('0x2f')][_0x4698('0x47')]){_0x3105ac[_0x4698('0x3f')]=[{'all':!![]}];}_0x3105ac=_[_0x4698('0x3b')]({},_0x3105ac,_0x27fa52[_0x4698('0x3d')]);return db[_0x4698('0x40')]['find'](_0x3105ac)[_0x4698('0x3e')](handleEntityNotFound(_0x5de830,null))[_0x4698('0x3e')](respondWithResult(_0x5de830,null))[_0x4698('0x43')](handleError(_0x5de830,null));};exports[_0x4698('0x48')]=function(_0x20abe4,_0x458ff0){return db[_0x4698('0x40')]['create'](_0x20abe4[_0x4698('0x49')],{})[_0x4698('0x3e')](respondWithResult(_0x458ff0,0xc9))[_0x4698('0x43')](handleError(_0x458ff0,null));};exports[_0x4698('0x23')]=function(_0x6b27f5,_0x499260){if(_0x6b27f5[_0x4698('0x49')]['id']){delete _0x6b27f5['body']['id'];}return db[_0x4698('0x40')]['find']({'where':{'id':_0x6b27f5['params']['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0x499260,null))[_0x4698('0x3e')](saveUpdates(_0x6b27f5['body'],null))[_0x4698('0x3e')](respondWithResult(_0x499260,null))[_0x4698('0x43')](handleError(_0x499260,null));};exports['destroy']=function(_0xf11e8d,_0x5392b2){return db[_0x4698('0x40')]['find']({'where':{'id':_0xf11e8d[_0x4698('0x45')]['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0x5392b2,null))[_0x4698('0x3e')](removeEntity(_0x5392b2,null))[_0x4698('0x43')](handleError(_0x5392b2,null));};exports[_0x4698('0x4a')]=function(_0x43e017,_0x3ccc46,_0x20d8cd){var _0x3804b8={};var _0x3af6be={};var _0x5e2482;var _0x2365ad;return db['FreshdeskConfiguration'][_0x4698('0x4b')]({'where':{'id':_0x43e017[_0x4698('0x45')]['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0x3ccc46,null))[_0x4698('0x3e')](function(_0x276fa5){if(_0x276fa5){_0x5e2482=_0x276fa5;_0x3af6be['model']=_[_0x4698('0x2e')](db['FreshdeskField'][_0x4698('0x2a')]);_0x3af6be[_0x4698('0x2f')]=_[_0x4698('0x2e')](_0x43e017[_0x4698('0x2f')]);_0x3af6be[_0x4698('0x30')]=_[_0x4698('0x31')](_0x3af6be['model'],_0x3af6be['query']);_0x3804b8[_0x4698('0x33')]=_[_0x4698('0x31')](_0x3af6be[_0x4698('0x32')],qs[_0x4698('0x46')](_0x43e017[_0x4698('0x2f')][_0x4698('0x46')]));_0x3804b8[_0x4698('0x33')]=_0x3804b8[_0x4698('0x33')]['length']?_0x3804b8[_0x4698('0x33')]:_0x3af6be['model'];_0x3804b8[_0x4698('0x4c')]=qs[_0x4698('0x37')](_0x43e017[_0x4698('0x2f')][_0x4698('0x37')]);_0x3804b8[_0x4698('0x38')]=qs[_0x4698('0x30')](_[_0x4698('0x39')](_0x43e017[_0x4698('0x2f')],_0x3af6be['filters']));if(_0x43e017[_0x4698('0x2f')][_0x4698('0x3a')]){_0x3804b8['where']=_[_0x4698('0x3b')](_0x3804b8[_0x4698('0x38')],{'$or':_[_0x4698('0x29')](_0x3804b8[_0x4698('0x33')],function(_0x3584b2){var _0xf5f348={};_0xf5f348[_0x3584b2]={'$like':'%'+_0x43e017[_0x4698('0x2f')][_0x4698('0x3a')]+'%'};return _0xf5f348;})});}_0x3804b8=_['merge']({},_0x3804b8,_0x43e017[_0x4698('0x3d')]);return _0x5e2482[_0x4698('0x4a')](_0x3804b8);}})[_0x4698('0x3e')](function(_0x159afb){if(_0x159afb){_0x2365ad=_0x159afb[_0x4698('0x34')];if(!_0x43e017[_0x4698('0x2f')]['hasOwnProperty'](_0x4698('0x36'))){_0x3804b8['limit']=qs[_0x4698('0x1d')](_0x43e017['query']['limit']);_0x3804b8[_0x4698('0x1c')]=qs[_0x4698('0x1c')](_0x43e017[_0x4698('0x2f')][_0x4698('0x1c')]);}return _0x5e2482['getFields'](_0x3804b8);}})[_0x4698('0x3e')](function(_0x5d8e54){if(_0x5d8e54){return _0x5d8e54?{'count':_0x2365ad,'rows':_0x5d8e54}:null;}})[_0x4698('0x3e')](respondWithResult(_0x3ccc46,null))[_0x4698('0x43')](handleError(_0x3ccc46,null));};exports[_0x4698('0x4d')]=function(_0x5e9f07,_0x260f63,_0x3f04bc){var _0x33d341={};var _0x1f7940={};var _0x468d9e;var _0x33dda8;return db[_0x4698('0x40')]['findOne']({'where':{'id':_0x5e9f07['params']['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0x260f63,null))[_0x4698('0x3e')](function(_0x18a9bd){if(_0x18a9bd){_0x468d9e=_0x18a9bd;_0x1f7940[_0x4698('0x32')]=_['keys'](db['FreshdeskField'][_0x4698('0x2a')]);_0x1f7940[_0x4698('0x2f')]=_[_0x4698('0x2e')](_0x5e9f07[_0x4698('0x2f')]);_0x1f7940[_0x4698('0x30')]=_[_0x4698('0x31')](_0x1f7940['model'],_0x1f7940[_0x4698('0x2f')]);_0x33d341['attributes']=_[_0x4698('0x31')](_0x1f7940[_0x4698('0x32')],qs[_0x4698('0x46')](_0x5e9f07[_0x4698('0x2f')]['fields']));_0x33d341[_0x4698('0x33')]=_0x33d341[_0x4698('0x33')][_0x4698('0x34')]?_0x33d341['attributes']:_0x1f7940[_0x4698('0x32')];_0x33d341[_0x4698('0x4c')]=qs[_0x4698('0x37')](_0x5e9f07[_0x4698('0x2f')][_0x4698('0x37')]);_0x33d341[_0x4698('0x38')]=qs[_0x4698('0x30')](_[_0x4698('0x39')](_0x5e9f07['query'],_0x1f7940[_0x4698('0x30')]));if(_0x5e9f07[_0x4698('0x2f')][_0x4698('0x3a')]){_0x33d341[_0x4698('0x38')]=_[_0x4698('0x3b')](_0x33d341[_0x4698('0x38')],{'$or':_[_0x4698('0x29')](_0x33d341[_0x4698('0x33')],function(_0x31d734){var _0x4e6fa8={};_0x4e6fa8[_0x31d734]={'$like':'%'+_0x5e9f07[_0x4698('0x2f')][_0x4698('0x3a')]+'%'};return _0x4e6fa8;})});}_0x33d341=_[_0x4698('0x3b')]({},_0x33d341,_0x5e9f07['options']);return _0x468d9e['getSubjects'](_0x33d341);}})[_0x4698('0x3e')](function(_0x1e0842){if(_0x1e0842){_0x33dda8=_0x1e0842[_0x4698('0x34')];if(!_0x5e9f07[_0x4698('0x2f')][_0x4698('0x35')](_0x4698('0x36'))){_0x33d341[_0x4698('0x1d')]=qs['limit'](_0x5e9f07[_0x4698('0x2f')]['limit']);_0x33d341[_0x4698('0x1c')]=qs['offset'](_0x5e9f07['query'][_0x4698('0x1c')]);}return _0x468d9e['getSubjects'](_0x33d341);}})[_0x4698('0x3e')](function(_0x1229ff){if(_0x1229ff){return _0x1229ff?{'count':_0x33dda8,'rows':_0x1229ff}:null;}})['then'](respondWithResult(_0x260f63,null))['catch'](handleError(_0x260f63,null));};exports[_0x4698('0x4e')]=function(_0xc90645,_0x5b2061,_0x5365ea){var _0x336e4b={};var _0x5b8473={};var _0x1c690f;var _0x5284fd;return db[_0x4698('0x40')][_0x4698('0x4b')]({'where':{'id':_0xc90645[_0x4698('0x45')]['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0x5b2061,null))[_0x4698('0x3e')](function(_0x188c69){if(_0x188c69){_0x1c690f=_0x188c69;_0x5b8473['model']=_[_0x4698('0x2e')](db[_0x4698('0x4f')][_0x4698('0x2a')]);_0x5b8473[_0x4698('0x2f')]=_[_0x4698('0x2e')](_0xc90645[_0x4698('0x2f')]);_0x5b8473[_0x4698('0x30')]=_[_0x4698('0x31')](_0x5b8473[_0x4698('0x32')],_0x5b8473['query']);_0x336e4b[_0x4698('0x33')]=_['intersection'](_0x5b8473['model'],qs[_0x4698('0x46')](_0xc90645['query'][_0x4698('0x46')]));_0x336e4b[_0x4698('0x33')]=_0x336e4b[_0x4698('0x33')][_0x4698('0x34')]?_0x336e4b[_0x4698('0x33')]:_0x5b8473['model'];_0x336e4b['order']=qs[_0x4698('0x37')](_0xc90645[_0x4698('0x2f')][_0x4698('0x37')]);_0x336e4b[_0x4698('0x38')]=qs[_0x4698('0x30')](_[_0x4698('0x39')](_0xc90645[_0x4698('0x2f')],_0x5b8473['filters']));if(_0xc90645[_0x4698('0x2f')]['filter']){_0x336e4b['where']=_[_0x4698('0x3b')](_0x336e4b[_0x4698('0x38')],{'$or':_[_0x4698('0x29')](_0x336e4b[_0x4698('0x33')],function(_0x434b05){var _0x2071b8={};_0x2071b8[_0x434b05]={'$like':'%'+_0xc90645[_0x4698('0x2f')][_0x4698('0x3a')]+'%'};return _0x2071b8;})});}_0x336e4b=_['merge']({},_0x336e4b,_0xc90645[_0x4698('0x3d')]);return _0x1c690f[_0x4698('0x4e')](_0x336e4b);}})[_0x4698('0x3e')](function(_0x52ad05){if(_0x52ad05){_0x5284fd=_0x52ad05[_0x4698('0x34')];if(!_0xc90645[_0x4698('0x2f')][_0x4698('0x35')](_0x4698('0x36'))){_0x336e4b[_0x4698('0x1d')]=qs[_0x4698('0x1d')](_0xc90645[_0x4698('0x2f')][_0x4698('0x1d')]);_0x336e4b[_0x4698('0x1c')]=qs[_0x4698('0x1c')](_0xc90645[_0x4698('0x2f')][_0x4698('0x1c')]);}return _0x1c690f[_0x4698('0x4e')](_0x336e4b);}})[_0x4698('0x3e')](function(_0x208d3f){if(_0x208d3f){return _0x208d3f?{'count':_0x5284fd,'rows':_0x208d3f}:null;}})[_0x4698('0x3e')](respondWithResult(_0x5b2061,null))[_0x4698('0x43')](handleError(_0x5b2061,null));};exports[_0x4698('0x50')]=function(_0x3d0f94,_0xae7c29,_0x170ff2){var _0x5bfebb={};var _0x385530={};var _0x43f354;var _0x2912c4;return db[_0x4698('0x40')]['findOne']({'where':{'id':_0x3d0f94[_0x4698('0x45')]['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0xae7c29,null))['then'](function(_0x5b83cb){if(_0x5b83cb){_0x43f354=_0x5b83cb;_0x385530[_0x4698('0x32')]=_[_0x4698('0x2e')](db[_0x4698('0x51')][_0x4698('0x2a')]);_0x385530['query']=_[_0x4698('0x2e')](_0x3d0f94[_0x4698('0x2f')]);_0x385530[_0x4698('0x30')]=_[_0x4698('0x31')](_0x385530[_0x4698('0x32')],_0x385530['query']);_0x5bfebb[_0x4698('0x33')]=_[_0x4698('0x31')](_0x385530[_0x4698('0x32')],qs[_0x4698('0x46')](_0x3d0f94[_0x4698('0x2f')][_0x4698('0x46')]));_0x5bfebb[_0x4698('0x33')]=_0x5bfebb['attributes'][_0x4698('0x34')]?_0x5bfebb['attributes']:_0x385530[_0x4698('0x32')];_0x5bfebb[_0x4698('0x4c')]=qs[_0x4698('0x37')](_0x3d0f94[_0x4698('0x2f')][_0x4698('0x37')]);_0x5bfebb['where']=qs[_0x4698('0x30')](_[_0x4698('0x39')](_0x3d0f94[_0x4698('0x2f')],_0x385530[_0x4698('0x30')]));if(_0x3d0f94['query'][_0x4698('0x3a')]){_0x5bfebb['where']=_[_0x4698('0x3b')](_0x5bfebb['where'],{'$or':_['map'](_0x5bfebb[_0x4698('0x33')],function(_0x981eb2){var _0x5ec8df={};_0x5ec8df[_0x981eb2]={'$like':'%'+_0x3d0f94[_0x4698('0x2f')][_0x4698('0x3a')]+'%'};return _0x5ec8df;})});}_0x5bfebb=_[_0x4698('0x3b')]({},_0x5bfebb,_0x3d0f94[_0x4698('0x3d')]);return _0x43f354[_0x4698('0x50')](_0x5bfebb);}})[_0x4698('0x3e')](function(_0x339e4a){if(_0x339e4a){_0x2912c4=_0x339e4a[_0x4698('0x34')];if(!_0x3d0f94[_0x4698('0x2f')][_0x4698('0x35')](_0x4698('0x36'))){_0x5bfebb['limit']=qs['limit'](_0x3d0f94[_0x4698('0x2f')][_0x4698('0x1d')]);_0x5bfebb[_0x4698('0x1c')]=qs['offset'](_0x3d0f94[_0x4698('0x2f')]['offset']);}return _0x43f354[_0x4698('0x50')](_0x5bfebb);}})[_0x4698('0x3e')](function(_0x232ad8){if(_0x232ad8){return _0x232ad8?{'count':_0x2912c4,'rows':_0x232ad8}:null;}})[_0x4698('0x3e')](respondWithResult(_0xae7c29,null))[_0x4698('0x43')](handleError(_0xae7c29,null));};exports['setTags']=function(_0x18c963,_0x5409ae,_0x47e7c6){if(_0x18c963[_0x4698('0x49')]['id']){delete _0x18c963['body']['id'];}return db[_0x4698('0x40')][_0x4698('0x4b')]({'where':{'id':_0x18c963[_0x4698('0x45')]['id']}})[_0x4698('0x3e')](handleEntityNotFound(_0x5409ae,null))[_0x4698('0x3e')](function(_0x17455a){if(_0x17455a){return _0x17455a[_0x4698('0x52')](_0x18c963[_0x4698('0x49')][_0x4698('0x53')]||[]);}return null;})[_0x4698('0x3e')](respondWithResult(_0x5409ae,null))[_0x4698('0x43')](handleError(_0x5409ae,null));};
\ No newline at end of file
index 6d77485..5a268aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff4=['rimraf','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x299100,_0x36369d){var _0x2b9c4f=function(_0x80e717){while(--_0x80e717){_0x299100['push'](_0x299100['shift']());}};_0x2b9c4f(++_0x36369d);}(_0x8ff4,0x1bc));var _0x48ff=function(_0xd06a8b,_0x3ce43e){_0xd06a8b=_0xd06a8b-0x0;var _0xe9b203=_0x8ff4[_0xd06a8b];return _0xe9b203;};'use strict';var _=require(_0x48ff('0x0'));var util=require(_0x48ff('0x1'));var logger=require(_0x48ff('0x2'))(_0x48ff('0x3'));var moment=require(_0x48ff('0x4'));var BPromise=require('bluebird');var rp=require(_0x48ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48ff('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x120cf8,_0xe69c20){return _0x120cf8[_0x48ff('0x7')](_0x48ff('0x8'),attributes,{'tableName':_0x48ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe566=['rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x5abb9c,_0x32f2eb){var _0x33916e=function(_0x1f45ef){while(--_0x1f45ef){_0x5abb9c['push'](_0x5abb9c['shift']());}};_0x33916e(++_0x32f2eb);}(_0xe566,0x10b));var _0x6e56=function(_0xf70d3e,_0xee693e){_0xf70d3e=_0xf70d3e-0x0;var _0x3fd69e=_0xe566[_0xf70d3e];return _0x3fd69e;};'use strict';var _=require(_0x6e56('0x0'));var util=require(_0x6e56('0x1'));var logger=require(_0x6e56('0x2'))(_0x6e56('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e56('0x4'));var fs=require('fs');var path=require(_0x6e56('0x5'));var rimraf=require(_0x6e56('0x6'));var config=require(_0x6e56('0x7'));var attributes=require(_0x6e56('0x8'));module[_0x6e56('0x9')]=function(_0x24eef7,_0x5a719c){return _0x24eef7[_0x6e56('0xa')](_0x6e56('0xb'),attributes,{'tableName':_0x6e56('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cce0347..d4f5801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbacf=['jayson/promise','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2c3201,_0x1f76ff){var _0x564fc4=function(_0x424493){while(--_0x424493){_0x2c3201['push'](_0x2c3201['shift']());}};_0x564fc4(++_0x1f76ff);}(_0xbacf,0xe7));var _0xfbac=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xbacf[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xfbac('0x0'));var util=require(_0xfbac('0x1'));var moment=require(_0xfbac('0x2'));var BPromise=require(_0xfbac('0x3'));var rs=require(_0xfbac('0x4'));var fs=require('fs');var Redis=require(_0xfbac('0x5'));var db=require(_0xfbac('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbac('0x7'))(_0xfbac('0x8'));var config=require('../../config/environment');var jayson=require(_0xfbac('0x9'));var client=jayson[_0xfbac('0xa')][_0xfbac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x480484,_0x2151ea,_0x59bfab){return new BPromise(function(_0x1d1590,_0x46a148){return client['request'](_0x480484,_0x59bfab)[_0xfbac('0xc')](function(_0x168e62){logger[_0xfbac('0xd')](_0xfbac('0xe'),_0x2151ea,'request\x20sent');logger[_0xfbac('0xf')](_0xfbac('0x10'),_0x2151ea,_0xfbac('0x11'),JSON[_0xfbac('0x12')](_0x168e62));if(_0x168e62[_0xfbac('0x13')]){if(_0x168e62[_0xfbac('0x13')][_0xfbac('0x14')]===0x1f4){logger[_0xfbac('0x13')](_0xfbac('0xe'),_0x2151ea,_0x168e62[_0xfbac('0x13')][_0xfbac('0x15')]);return _0x46a148(_0x168e62[_0xfbac('0x13')][_0xfbac('0x15')]);}logger[_0xfbac('0x13')](_0xfbac('0xe'),_0x2151ea,_0x168e62[_0xfbac('0x13')][_0xfbac('0x15')]);return _0x1d1590(_0x168e62[_0xfbac('0x13')][_0xfbac('0x15')]);}else{logger['info'](_0xfbac('0xe'),_0x2151ea,'request\x20sent');_0x1d1590(_0x168e62[_0xfbac('0x16')][_0xfbac('0x15')]);}})[_0xfbac('0x17')](function(_0x92f633){logger['error'](_0xfbac('0xe'),_0x2151ea,_0x92f633);_0x46a148(_0x92f633);});});}
\ No newline at end of file
+var _0xc648=['stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x32ca50,_0x1de287){var _0xfb9649=function(_0x41ef9e){while(--_0x41ef9e){_0x32ca50['push'](_0x32ca50['shift']());}};_0xfb9649(++_0x1de287);}(_0xc648,0x131));var _0x8c64=function(_0x11a0d8,_0x3f2d73){_0x11a0d8=_0x11a0d8-0x0;var _0x50c719=_0xc648[_0x11a0d8];return _0x50c719;};'use strict';var _=require(_0x8c64('0x0'));var util=require(_0x8c64('0x1'));var moment=require('moment');var BPromise=require(_0x8c64('0x2'));var rs=require(_0x8c64('0x3'));var fs=require('fs');var Redis=require(_0x8c64('0x4'));var db=require(_0x8c64('0x5'))['db'];var utils=require(_0x8c64('0x6'));var logger=require(_0x8c64('0x7'))(_0x8c64('0x8'));var config=require(_0x8c64('0x9'));var jayson=require(_0x8c64('0xa'));var client=jayson['client'][_0x8c64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bd408,_0x3ecac3,_0x5d5d34){return new BPromise(function(_0x403c99,_0x5df10f){return client[_0x8c64('0xc')](_0x5bd408,_0x5d5d34)[_0x8c64('0xd')](function(_0x4bab8a){logger[_0x8c64('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ecac3,_0x8c64('0xf'));logger['debug'](_0x8c64('0x10'),_0x3ecac3,_0x8c64('0xf'),JSON[_0x8c64('0x11')](_0x4bab8a));if(_0x4bab8a[_0x8c64('0x12')]){if(_0x4bab8a[_0x8c64('0x12')]['code']===0x1f4){logger[_0x8c64('0x12')](_0x8c64('0x13'),_0x3ecac3,_0x4bab8a[_0x8c64('0x12')][_0x8c64('0x14')]);return _0x5df10f(_0x4bab8a[_0x8c64('0x12')][_0x8c64('0x14')]);}logger[_0x8c64('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3ecac3,_0x4bab8a[_0x8c64('0x12')][_0x8c64('0x14')]);return _0x403c99(_0x4bab8a[_0x8c64('0x12')]['message']);}else{logger[_0x8c64('0xe')](_0x8c64('0x13'),_0x3ecac3,'request\x20sent');_0x403c99(_0x4bab8a[_0x8c64('0x15')][_0x8c64('0x14')]);}})[_0x8c64('0x16')](function(_0x54753c){logger[_0x8c64('0x12')](_0x8c64('0x13'),_0x3ecac3,_0x54753c);_0x5df10f(_0x54753c);});});}
\ No newline at end of file
index 87ac1fa..7e2c447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3139=['./intFreshdeskField.controller','get','isAuthenticated','show','create','put','/:id','update','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33c693,_0x5cbd81){var _0x474b1a=function(_0x1ffed2){while(--_0x1ffed2){_0x33c693['push'](_0x33c693['shift']());}};_0x474b1a(++_0x5cbd81);}(_0x3139,0x108));var _0x9313=function(_0x4e60fc,_0xd7bcb3){_0x4e60fc=_0x4e60fc-0x0;var _0x466b3b=_0x3139[_0x4e60fc];return _0x466b3b;};'use strict';var multer=require(_0x9313('0x0'));var util=require(_0x9313('0x1'));var path=require(_0x9313('0x2'));var timeout=require(_0x9313('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9313('0x4'));var auth=require(_0x9313('0x5'));var interaction=require(_0x9313('0x6'));var config=require(_0x9313('0x7'));var controller=require(_0x9313('0x8'));router[_0x9313('0x9')]('/',auth[_0x9313('0xa')](),controller['index']);router[_0x9313('0x9')]('/:id',auth[_0x9313('0xa')](),controller[_0x9313('0xb')]);router['post']('/',auth[_0x9313('0xa')](),controller[_0x9313('0xc')]);router[_0x9313('0xd')](_0x9313('0xe'),auth[_0x9313('0xa')](),controller[_0x9313('0xf')]);router['delete'](_0x9313('0xe'),auth[_0x9313('0xa')](),controller[_0x9313('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x29d9=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service'];(function(_0x7ff50b,_0x399dc0){var _0x43e570=function(_0x16b092){while(--_0x16b092){_0x7ff50b['push'](_0x7ff50b['shift']());}};_0x43e570(++_0x399dc0);}(_0x29d9,0x163));var _0x929d=function(_0x4fc14e,_0x3e8fe8){_0x4fc14e=_0x4fc14e-0x0;var _0x1eb64d=_0x29d9[_0x4fc14e];return _0x1eb64d;};'use strict';var multer=require(_0x929d('0x0'));var util=require('util');var path=require(_0x929d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x929d('0x2')]();var fs_extra=require(_0x929d('0x3'));var auth=require(_0x929d('0x4'));var interaction=require(_0x929d('0x5'));var config=require(_0x929d('0x6'));var controller=require(_0x929d('0x7'));router[_0x929d('0x8')]('/',auth[_0x929d('0x9')](),controller['index']);router['get'](_0x929d('0xa'),auth[_0x929d('0x9')](),controller[_0x929d('0xb')]);router[_0x929d('0xc')]('/',auth[_0x929d('0x9')](),controller[_0x929d('0xd')]);router[_0x929d('0xe')](_0x929d('0xa'),auth[_0x929d('0x9')](),controller[_0x929d('0xf')]);router['delete']('/:id',auth[_0x929d('0x9')](),controller[_0x929d('0x10')]);module[_0x929d('0x11')]=router;
\ No newline at end of file
index e79baef..06e1317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x721a=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x721a,0x117));var _0xa721=function(_0x1f8d0f,_0x3ca300){_0x1f8d0f=_0x1f8d0f-0x0;var _0xfe40a6=_0x721a[_0x1f8d0f];return _0xfe40a6;};'use strict';var Sequelize=require(_0xa721('0x0'));module[_0xa721('0x1')]={'type':{'type':Sequelize[_0xa721('0x2')](_0xa721('0x3'),_0xa721('0x4'),_0xa721('0x5'),'keyValue',_0xa721('0x6')),'defaultValue':_0xa721('0x3')},'content':{'type':Sequelize[_0xa721('0x7')]},'key':{'type':Sequelize[_0xa721('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xa721('0x3'),_0xa721('0x4'),_0xa721('0x5'))},'keyContent':{'type':Sequelize[_0xa721('0x7')]},'idField':{'type':Sequelize[_0xa721('0x7')]},'nameField':{'type':Sequelize[_0xa721('0x7')]},'customField':{'type':Sequelize[_0xa721('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa721('0x7')]}};
\ No newline at end of file
+var _0x2fde=['picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','keyValue'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2fde,0xc1));var _0xe2fd=function(_0x431388,_0x236094){_0x431388=_0x431388-0x0;var _0x2beee2=_0x2fde[_0x431388];return _0x2beee2;};'use strict';var Sequelize=require(_0xe2fd('0x0'));module[_0xe2fd('0x1')]={'type':{'type':Sequelize[_0xe2fd('0x2')](_0xe2fd('0x3'),'variable','customVariable',_0xe2fd('0x4'),_0xe2fd('0x5')),'defaultValue':_0xe2fd('0x3')},'content':{'type':Sequelize[_0xe2fd('0x6')]},'key':{'type':Sequelize[_0xe2fd('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe2fd('0x3'),_0xe2fd('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xe2fd('0x6')]},'idField':{'type':Sequelize[_0xe2fd('0x6')]},'nameField':{'type':Sequelize[_0xe2fd('0x6')]},'customField':{'type':Sequelize[_0xe2fd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 93b9034..c9e9283 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus','name','status','send','index','map','FreshdeskField','rawAttributes','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','then','catch','params','find'];(function(_0x428ec7,_0x552c32){var _0x9ffea7=function(_0x4ce1ad){while(--_0x4ce1ad){_0x428ec7['push'](_0x428ec7['shift']());}};_0x9ffea7(++_0x552c32);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1721a3,_0x4e3d37){_0x1721a3=_0x1721a3-0x0;var _0x115967=_0xb43b[_0x1721a3];return _0x115967;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={},_0x539730={},_0x2ad6da={'count':0x0,'rows':[]};var _0x56fe33=_[_0xbb43('0x2a')](db[_0xbb43('0x2b')][_0xbb43('0x2c')],function(_0x1880cd){return{'name':_0x1880cd['fieldName'],'type':_0x1880cd[_0xbb43('0x2d')]['key']};});_0x539730['model']=_['map'](_0x56fe33,_0xbb43('0x26'));_0x539730['query']=_[_0xbb43('0x2e')](_0x40b04b[_0xbb43('0x2f')]);_0x539730[_0xbb43('0x30')]=_['intersection'](_0x539730[_0xbb43('0x31')],_0x539730[_0xbb43('0x2f')]);_0x473828[_0xbb43('0x32')]=_[_0xbb43('0x33')](_0x539730[_0xbb43('0x31')],qs[_0xbb43('0x34')](_0x40b04b[_0xbb43('0x2f')][_0xbb43('0x34')]));_0x473828['attributes']=_0x473828[_0xbb43('0x32')][_0xbb43('0x35')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x31')];if(!_0x40b04b[_0xbb43('0x2f')][_0xbb43('0x36')](_0xbb43('0x37'))){_0x473828[_0xbb43('0x1d')]=qs[_0xbb43('0x1d')](_0x40b04b[_0xbb43('0x2f')][_0xbb43('0x1d')]);_0x473828[_0xbb43('0x1c')]=qs[_0xbb43('0x1c')](_0x40b04b[_0xbb43('0x2f')][_0xbb43('0x1c')]);}_0x473828[_0xbb43('0x38')]=qs['sort'](_0x40b04b[_0xbb43('0x2f')][_0xbb43('0x39')]);_0x473828['where']=qs[_0xbb43('0x30')](_[_0xbb43('0x3a')](_0x40b04b[_0xbb43('0x2f')],_0x539730['filters']),_0x56fe33);if(_0x40b04b['query']['filter']){_0x473828[_0xbb43('0x3b')]=_[_0xbb43('0x3c')](_0x473828['where'],{'$or':_['map'](_0x56fe33,function(_0x2aa381){if(_0x2aa381[_0xbb43('0x2d')]!==_0xbb43('0x3d')){var _0x37afbb={};_0x37afbb[_0x2aa381[_0xbb43('0x26')]]={'$like':'%'+_0x40b04b['query'][_0xbb43('0x3e')]+'%'};return _0x37afbb;}})});}_0x473828=_[_0xbb43('0x3c')]({},_0x473828,_0x40b04b[_0xbb43('0x3f')]);var _0x3340aa={'where':_0x473828[_0xbb43('0x3b')]};return db['FreshdeskField'][_0xbb43('0x1b')](_0x3340aa)['then'](function(_0x1c076f){_0x2ad6da[_0xbb43('0x1b')]=_0x1c076f;if(_0x40b04b['query'][_0xbb43('0x40')]){_0x473828['include']=[{'all':!![]}];}return db[_0xbb43('0x2b')][_0xbb43('0x41')](_0x473828);})[_0xbb43('0x42')](function(_0xb84ece){_0x2ad6da['rows']=_0xb84ece;return _0x2ad6da;})[_0xbb43('0x42')](respondWithFilteredResult(_0x21d386,_0x473828))[_0xbb43('0x43')](handleError(_0x21d386,null));};exports['show']=function(_0x3443f8,_0x5198a2){var _0x42b965={'raw':!![],'where':{'id':_0x3443f8[_0xbb43('0x44')]['id']}},_0x14285d={};_0x14285d[_0xbb43('0x31')]=_[_0xbb43('0x2e')](db[_0xbb43('0x2b')]['rawAttributes']);_0x14285d[_0xbb43('0x2f')]=_['keys'](_0x3443f8[_0xbb43('0x2f')]);_0x14285d[_0xbb43('0x30')]=_[_0xbb43('0x33')](_0x14285d[_0xbb43('0x31')],_0x14285d['query']);_0x42b965[_0xbb43('0x32')]=_[_0xbb43('0x33')](_0x14285d[_0xbb43('0x31')],qs[_0xbb43('0x34')](_0x3443f8[_0xbb43('0x2f')][_0xbb43('0x34')]));_0x42b965[_0xbb43('0x32')]=_0x42b965[_0xbb43('0x32')]['length']?_0x42b965[_0xbb43('0x32')]:_0x14285d[_0xbb43('0x31')];if(_0x3443f8['query'][_0xbb43('0x40')]){_0x42b965['include']=[{'all':!![]}];}_0x42b965=_['merge']({},_0x42b965,_0x3443f8['options']);return db['FreshdeskField'][_0xbb43('0x45')](_0x42b965)['then'](handleEntityNotFound(_0x5198a2,null))[_0xbb43('0x42')](respondWithResult(_0x5198a2,null))['catch'](handleError(_0x5198a2,null));};exports[_0xbb43('0x46')]=function(_0x39b6ae,_0x1f3fb4){return db['FreshdeskField'][_0xbb43('0x46')](_0x39b6ae['body'],{})[_0xbb43('0x42')](respondWithResult(_0x1f3fb4,0xc9))[_0xbb43('0x43')](handleError(_0x1f3fb4,null));};exports[_0xbb43('0x23')]=function(_0x29840e,_0x417ad9){if(_0x29840e[_0xbb43('0x47')]['id']){delete _0x29840e[_0xbb43('0x47')]['id'];}return db['FreshdeskField'][_0xbb43('0x45')]({'where':{'id':_0x29840e[_0xbb43('0x44')]['id']}})[_0xbb43('0x42')](handleEntityNotFound(_0x417ad9,null))[_0xbb43('0x42')](saveUpdates(_0x29840e['body'],null))[_0xbb43('0x42')](respondWithResult(_0x417ad9,null))[_0xbb43('0x43')](handleError(_0x417ad9,null));};exports[_0xbb43('0x24')]=function(_0xb1883e,_0x4b7712){return db[_0xbb43('0x2b')][_0xbb43('0x45')]({'where':{'id':_0xb1883e[_0xbb43('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b7712,null))[_0xbb43('0x42')](removeEntity(_0x4b7712,null))[_0xbb43('0x43')](handleError(_0x4b7712,null));};
\ No newline at end of file
+var _0x765e=['sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','error','stack','index','map','FreshdeskField','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','order'];(function(_0x455adc,_0x512901){var _0x2b05d1=function(_0x41d18b){while(--_0x41d18b){_0x455adc['push'](_0x455adc['shift']());}};_0x2b05d1(++_0x512901);}(_0x765e,0x131));var _0xe765=function(_0x27d56d,_0x5b629a){_0x27d56d=_0x27d56d-0x0;var _0x5d23ed=_0x765e[_0x27d56d];return _0x5d23ed;};'use strict';var emlformat=require(_0xe765('0x0'));var rimraf=require(_0xe765('0x1'));var zipdir=require(_0xe765('0x2'));var jsonpatch=require(_0xe765('0x3'));var rp=require(_0xe765('0x4'));var moment=require(_0xe765('0x5'));var BPromise=require(_0xe765('0x6'));var Mustache=require(_0xe765('0x7'));var util=require(_0xe765('0x8'));var path=require(_0xe765('0x9'));var sox=require(_0xe765('0xa'));var csv=require(_0xe765('0xb'));var ejs=require(_0xe765('0xc'));var fs=require('fs');var fs_extra=require(_0xe765('0xd'));var _=require(_0xe765('0xe'));var squel=require('squel');var crypto=require(_0xe765('0xf'));var jsforce=require(_0xe765('0x10'));var deskjs=require(_0xe765('0x11'));var toCsv=require(_0xe765('0xb'));var querystring=require(_0xe765('0x12'));var Papa=require(_0xe765('0x13'));var Redis=require(_0xe765('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xe765('0x15'));var as=require(_0xe765('0x16'));var hardwareService=require(_0xe765('0x17'));var logger=require('../../config/logger')(_0xe765('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe765('0x19'))['db'];function respondWithStatusCode(_0x18177f,_0x9411a0){_0x9411a0=_0x9411a0||0xcc;return function(_0x27456b){if(_0x27456b){return _0x18177f[_0xe765('0x1a')](_0x9411a0);}return _0x18177f['status'](_0x9411a0)[_0xe765('0x1b')]();};}function respondWithResult(_0x3a26d8,_0x395312){_0x395312=_0x395312||0xc8;return function(_0x58dc37){if(_0x58dc37){return _0x3a26d8[_0xe765('0x1c')](_0x395312)['json'](_0x58dc37);}};}function respondWithFilteredResult(_0x50e2ab,_0x2f673b){return function(_0x1b1cfe){if(_0x1b1cfe){var _0x3c887b=typeof _0x2f673b['offset']===_0xe765('0x1d')&&typeof _0x2f673b[_0xe765('0x1e')]===_0xe765('0x1d');var _0x1db3ca=_0x1b1cfe[_0xe765('0x1f')];var _0xf93371=_0x3c887b?0x0:_0x2f673b[_0xe765('0x20')];var _0x2a95a9=_0x3c887b?_0x1b1cfe[_0xe765('0x1f')]:_0x2f673b['offset']+_0x2f673b[_0xe765('0x1e')];var _0x56905c;if(_0x2a95a9>=_0x1db3ca){_0x2a95a9=_0x1db3ca;_0x56905c=0xc8;}else{_0x56905c=0xce;}_0x50e2ab[_0xe765('0x1c')](_0x56905c);return _0x50e2ab[_0xe765('0x21')]('Content-Range',_0xf93371+'-'+_0x2a95a9+'/'+_0x1db3ca)[_0xe765('0x22')](_0x1b1cfe);}return null;};}function patchUpdates(_0x59118f){return function(_0x1c73c8){try{jsonpatch[_0xe765('0x23')](_0x1c73c8,_0x59118f,!![]);}catch(_0x1efb96){return BPromise['reject'](_0x1efb96);}return _0x1c73c8['save']();};}function saveUpdates(_0x4b789b,_0x1c6de4){return function(_0x2a4427){if(_0x2a4427){return _0x2a4427[_0xe765('0x24')](_0x4b789b)[_0xe765('0x25')](function(_0x54b59c){return _0x54b59c;});}return null;};}function removeEntity(_0x50cfcb,_0x18ba77){return function(_0x2e2a34){if(_0x2e2a34){return _0x2e2a34[_0xe765('0x26')]()[_0xe765('0x25')](function(){_0x50cfcb[_0xe765('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aacbc,_0x5464b4){return function(_0x2b1f66){if(!_0x2b1f66){_0x1aacbc[_0xe765('0x1a')](0x194);}return _0x2b1f66;};}function handleError(_0xd877f3,_0x357f4e){_0x357f4e=_0x357f4e||0x1f4;return function(_0x40492d){logger[_0xe765('0x27')](_0x40492d[_0xe765('0x28')]);if(_0x40492d['name']){delete _0x40492d['name'];}_0xd877f3[_0xe765('0x1c')](_0x357f4e)['send'](_0x40492d);};}exports[_0xe765('0x29')]=function(_0x3f7493,_0x2fcbc9){var _0x64ffd4={},_0x1a8c01={},_0x4fce2c={'count':0x0,'rows':[]};var _0x43349b=_[_0xe765('0x2a')](db[_0xe765('0x2b')]['rawAttributes'],function(_0x5947c1){return{'name':_0x5947c1[_0xe765('0x2c')],'type':_0x5947c1['type'][_0xe765('0x2d')]};});_0x1a8c01[_0xe765('0x2e')]=_[_0xe765('0x2a')](_0x43349b,_0xe765('0x2f'));_0x1a8c01[_0xe765('0x30')]=_['keys'](_0x3f7493['query']);_0x1a8c01[_0xe765('0x31')]=_[_0xe765('0x32')](_0x1a8c01[_0xe765('0x2e')],_0x1a8c01[_0xe765('0x30')]);_0x64ffd4[_0xe765('0x33')]=_['intersection'](_0x1a8c01['model'],qs[_0xe765('0x34')](_0x3f7493['query'][_0xe765('0x34')]));_0x64ffd4[_0xe765('0x33')]=_0x64ffd4[_0xe765('0x33')][_0xe765('0x35')]?_0x64ffd4[_0xe765('0x33')]:_0x1a8c01[_0xe765('0x2e')];if(!_0x3f7493[_0xe765('0x30')]['hasOwnProperty']('nolimit')){_0x64ffd4['limit']=qs[_0xe765('0x1e')](_0x3f7493[_0xe765('0x30')][_0xe765('0x1e')]);_0x64ffd4[_0xe765('0x20')]=qs['offset'](_0x3f7493[_0xe765('0x30')][_0xe765('0x20')]);}_0x64ffd4[_0xe765('0x36')]=qs[_0xe765('0x37')](_0x3f7493['query'][_0xe765('0x37')]);_0x64ffd4['where']=qs[_0xe765('0x31')](_[_0xe765('0x38')](_0x3f7493[_0xe765('0x30')],_0x1a8c01[_0xe765('0x31')]),_0x43349b);if(_0x3f7493[_0xe765('0x30')][_0xe765('0x39')]){_0x64ffd4[_0xe765('0x3a')]=_[_0xe765('0x3b')](_0x64ffd4[_0xe765('0x3a')],{'$or':_[_0xe765('0x2a')](_0x43349b,function(_0x5e21ae){if(_0x5e21ae[_0xe765('0x3c')]!==_0xe765('0x3d')){var _0x11b459={};_0x11b459[_0x5e21ae['name']]={'$like':'%'+_0x3f7493['query']['filter']+'%'};return _0x11b459;}})});}_0x64ffd4=_[_0xe765('0x3b')]({},_0x64ffd4,_0x3f7493['options']);var _0x1f0db1={'where':_0x64ffd4[_0xe765('0x3a')]};return db[_0xe765('0x2b')][_0xe765('0x1f')](_0x1f0db1)['then'](function(_0x363f59){_0x4fce2c[_0xe765('0x1f')]=_0x363f59;if(_0x3f7493[_0xe765('0x30')][_0xe765('0x3e')]){_0x64ffd4[_0xe765('0x3f')]=[{'all':!![]}];}return db[_0xe765('0x2b')][_0xe765('0x40')](_0x64ffd4);})[_0xe765('0x25')](function(_0xb92246){_0x4fce2c[_0xe765('0x41')]=_0xb92246;return _0x4fce2c;})['then'](respondWithFilteredResult(_0x2fcbc9,_0x64ffd4))[_0xe765('0x42')](handleError(_0x2fcbc9,null));};exports['show']=function(_0x1248ea,_0x1d2b24){var _0x4d2814={'raw':!![],'where':{'id':_0x1248ea['params']['id']}},_0x3977e5={};_0x3977e5['model']=_['keys'](db[_0xe765('0x2b')][_0xe765('0x43')]);_0x3977e5[_0xe765('0x30')]=_['keys'](_0x1248ea[_0xe765('0x30')]);_0x3977e5[_0xe765('0x31')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],_0x3977e5[_0xe765('0x30')]);_0x4d2814[_0xe765('0x33')]=_[_0xe765('0x32')](_0x3977e5[_0xe765('0x2e')],qs[_0xe765('0x34')](_0x1248ea['query'][_0xe765('0x34')]));_0x4d2814['attributes']=_0x4d2814['attributes'][_0xe765('0x35')]?_0x4d2814['attributes']:_0x3977e5[_0xe765('0x2e')];if(_0x1248ea[_0xe765('0x30')][_0xe765('0x3e')]){_0x4d2814['include']=[{'all':!![]}];}_0x4d2814=_[_0xe765('0x3b')]({},_0x4d2814,_0x1248ea['options']);return db[_0xe765('0x2b')][_0xe765('0x44')](_0x4d2814)[_0xe765('0x25')](handleEntityNotFound(_0x1d2b24,null))['then'](respondWithResult(_0x1d2b24,null))[_0xe765('0x42')](handleError(_0x1d2b24,null));};exports[_0xe765('0x45')]=function(_0x115f16,_0x2d360e){return db['FreshdeskField']['create'](_0x115f16['body'],{})[_0xe765('0x25')](respondWithResult(_0x2d360e,0xc9))[_0xe765('0x42')](handleError(_0x2d360e,null));};exports[_0xe765('0x24')]=function(_0x58310d,_0x14834c){if(_0x58310d['body']['id']){delete _0x58310d[_0xe765('0x46')]['id'];}return db[_0xe765('0x2b')][_0xe765('0x44')]({'where':{'id':_0x58310d[_0xe765('0x47')]['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14834c,null))[_0xe765('0x25')](saveUpdates(_0x58310d['body'],null))[_0xe765('0x25')](respondWithResult(_0x14834c,null))[_0xe765('0x42')](handleError(_0x14834c,null));};exports[_0xe765('0x26')]=function(_0x1214a8,_0x14c3b5){return db[_0xe765('0x2b')]['find']({'where':{'id':_0x1214a8['params']['id']}})[_0xe765('0x25')](handleEntityNotFound(_0x14c3b5,null))[_0xe765('0x25')](removeEntity(_0x14c3b5,null))[_0xe765('0x42')](handleError(_0x14c3b5,null));};
\ No newline at end of file
index 9e311d3..7d3ac88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc800=['idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','freshdesk_unique_index'];(function(_0x4ccd42,_0x581b7f){var _0x37df3a=function(_0x38158a){while(--_0x38158a){_0x4ccd42['push'](_0x4ccd42['shift']());}};_0x37df3a(++_0x581b7f);}(_0xc800,0x1b4));var _0x0c80=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xc800[_0x166742];return _0xb7814a;};'use strict';var _=require(_0x0c80('0x0'));var util=require(_0x0c80('0x1'));var logger=require('../../config/logger')(_0x0c80('0x2'));var moment=require(_0x0c80('0x3'));var BPromise=require(_0x0c80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c80('0x5'));var rimraf=require(_0x0c80('0x6'));var config=require(_0x0c80('0x7'));var attributes=require(_0x0c80('0x8'));module['exports']=function(_0x299f3b,_0x55ba02){return _0x299f3b[_0x0c80('0x9')](_0x0c80('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x0c80('0xb'),'fields':[_0x0c80('0xc'),_0x0c80('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5da1=['moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','api'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5da1,0xbf));var _0x15da=function(_0x15dc0e,_0x20d1df){_0x15dc0e=_0x15dc0e-0x0;var _0x11eb57=_0x5da1[_0x15dc0e];return _0x11eb57;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x15da('0x0'));var moment=require(_0x15da('0x1'));var BPromise=require(_0x15da('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15da('0x3'));var rimraf=require('rimraf');var config=require(_0x15da('0x4'));var attributes=require(_0x15da('0x5'));module['exports']=function(_0x261900,_0x4054bd){return _0x261900[_0x15da('0x6')](_0x15da('0x7'),attributes,{'tableName':_0x15da('0x8'),'paranoid':![],'indexes':[{'name':_0x15da('0x9'),'fields':[_0x15da('0xa'),_0x15da('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 52f371a..bd58201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd062=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0xd062,0x1ed));var _0x2d06=function(_0x4a5e78,_0x27f592){_0x4a5e78=_0x4a5e78-0x0;var _0x2a6fb8=_0xd062[_0x4a5e78];return _0x2a6fb8;};'use strict';var _=require(_0x2d06('0x0'));var util=require('util');var moment=require(_0x2d06('0x1'));var BPromise=require(_0x2d06('0x2'));var rs=require(_0x2d06('0x3'));var fs=require('fs');var Redis=require(_0x2d06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2d06('0x5'))(_0x2d06('0x6'));var config=require('../../config/environment');var jayson=require(_0x2d06('0x7'));var client=jayson[_0x2d06('0x8')][_0x2d06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4953de,_0x18fc05,_0x2ab7c9){return new BPromise(function(_0x4462bc,_0x52c8b2){return client[_0x2d06('0xa')](_0x4953de,_0x2ab7c9)[_0x2d06('0xb')](function(_0x5ce23f){logger[_0x2d06('0xc')](_0x2d06('0xd'),_0x18fc05,_0x2d06('0xe'));logger[_0x2d06('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x18fc05,_0x2d06('0xe'),JSON[_0x2d06('0x10')](_0x5ce23f));if(_0x5ce23f['error']){if(_0x5ce23f[_0x2d06('0x11')][_0x2d06('0x12')]===0x1f4){logger[_0x2d06('0x11')](_0x2d06('0xd'),_0x18fc05,_0x5ce23f[_0x2d06('0x11')][_0x2d06('0x13')]);return _0x52c8b2(_0x5ce23f[_0x2d06('0x11')][_0x2d06('0x13')]);}logger[_0x2d06('0x11')](_0x2d06('0xd'),_0x18fc05,_0x5ce23f[_0x2d06('0x11')][_0x2d06('0x13')]);return _0x4462bc(_0x5ce23f[_0x2d06('0x11')]['message']);}else{logger[_0x2d06('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x18fc05,_0x2d06('0xe'));_0x4462bc(_0x5ce23f[_0x2d06('0x14')]['message']);}})['catch'](function(_0x51450b){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x18fc05,_0x51450b);_0x52c8b2(_0x51450b);});});}
\ No newline at end of file
+var _0x2bb3=['../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x7868fc,_0x3730cf){var _0x364665=function(_0x1a04eb){while(--_0x1a04eb){_0x7868fc['push'](_0x7868fc['shift']());}};_0x364665(++_0x3730cf);}(_0x2bb3,0x12d));var _0x32bb=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x2bb3[_0x468b0f];return _0x3e74d9;};'use strict';var _=require(_0x32bb('0x0'));var util=require(_0x32bb('0x1'));var moment=require(_0x32bb('0x2'));var BPromise=require(_0x32bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32bb('0x4'))['db'];var utils=require(_0x32bb('0x5'));var logger=require('../../config/logger')(_0x32bb('0x6'));var config=require(_0x32bb('0x7'));var jayson=require(_0x32bb('0x8'));var client=jayson[_0x32bb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b821a,_0x1e8cee,_0x16a402){return new BPromise(function(_0x6808e7,_0x53815f){return client[_0x32bb('0xa')](_0x4b821a,_0x16a402)[_0x32bb('0xb')](function(_0x3ea674){logger[_0x32bb('0xc')](_0x32bb('0xd'),_0x1e8cee,_0x32bb('0xe'));logger[_0x32bb('0xf')](_0x32bb('0x10'),_0x1e8cee,_0x32bb('0xe'),JSON[_0x32bb('0x11')](_0x3ea674));if(_0x3ea674[_0x32bb('0x12')]){if(_0x3ea674[_0x32bb('0x12')][_0x32bb('0x13')]===0x1f4){logger[_0x32bb('0x12')](_0x32bb('0xd'),_0x1e8cee,_0x3ea674[_0x32bb('0x12')][_0x32bb('0x14')]);return _0x53815f(_0x3ea674[_0x32bb('0x12')][_0x32bb('0x14')]);}logger[_0x32bb('0x12')](_0x32bb('0xd'),_0x1e8cee,_0x3ea674['error'][_0x32bb('0x14')]);return _0x6808e7(_0x3ea674[_0x32bb('0x12')][_0x32bb('0x14')]);}else{logger[_0x32bb('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x1e8cee,_0x32bb('0xe'));_0x6808e7(_0x3ea674[_0x32bb('0x15')]['message']);}})['catch'](function(_0xdcf3e1){logger[_0x32bb('0x12')](_0x32bb('0xd'),_0x1e8cee,_0xdcf3e1);_0x53815f(_0xdcf3e1);});});}
\ No newline at end of file
index ca71971..29d64ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeffd=['/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xeffd,0x6b));var _0xdeff=function(_0x4b935b,_0x5b9f05){_0x4b935b=_0x4b935b-0x0;var _0x265040=_0xeffd[_0x4b935b];return _0x265040;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id/configurations',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/fields',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0x12')]);router[_0xdeff('0x11')](_0xdeff('0x13'),auth[_0xdeff('0xb')](),controller['addConfiguration']);router[_0xdeff('0x14')](_0xdeff('0xd'),auth['isAuthenticated'](),controller[_0xdeff('0x15')]);router['delete']('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0x16')]);module[_0xdeff('0x17')]=router;
\ No newline at end of file
+var _0xc788=['getConfigurations','post','addConfiguration','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x27ca5c,_0x2b7c67){var _0x3f8ce4=function(_0x45b040){while(--_0x45b040){_0x27ca5c['push'](_0x27ca5c['shift']());}};_0x3f8ce4(++_0x2b7c67);}(_0xc788,0xc4));var _0x8c78=function(_0x4a2ba2,_0x5901b9){_0x4a2ba2=_0x4a2ba2-0x0;var _0x1d09fd=_0xc788[_0x4a2ba2];return _0x1d09fd;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/fields',auth[_0x8c78('0x9')](),controller['getFields']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),controller['create']);router[_0x8c78('0xf')](_0x8c78('0xd'),auth['isAuthenticated'](),controller[_0x8c78('0x10')]);router['put']('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x11')]);router[_0x8c78('0x12')](_0x8c78('0xb'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x13')]);module[_0x8c78('0x14')]=router;
\ No newline at end of file
index a611fdd..0fc0d0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0adf=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x4f0c02,_0x26a90f){_0x4f0c02=_0x4f0c02-0x0;var _0x55cbea=_0x0adf[_0x4f0c02];return _0x55cbea;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'name':{'type':Sequelize[_0xf0ad('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x3')},'apiKey':{'type':Sequelize[_0xf0ad('0x2')]},'remoteUri':{'type':Sequelize[_0xf0ad('0x2')],'unique':_0xf0ad('0x4')},'serverUrl':{'type':Sequelize[_0xf0ad('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x1a37=['sequelize','exports','STRING','username','remoteUri'];(function(_0x57ae71,_0x4f793f){var _0xdab35d=function(_0x5d88db){while(--_0x5d88db){_0x57ae71['push'](_0x57ae71['shift']());}};_0xdab35d(++_0x4f793f);}(_0x1a37,0xb4));var _0x71a3=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x1a37[_0x1992f1];return _0x413dfe;};'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
index d5d7005..8398df4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54b2=['key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','FreshsalesAccount','findAll','rows','catch','show','params','keys','create','body','find','destroy','FreshsalesConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','findOne','remoteUri','apiKey','username','slice','lastIndexOf','GET','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x3db4d4,_0x5bae35){var _0x25dbf0=function(_0x15099d){while(--_0x15099d){_0x3db4d4['push'](_0x3db4d4['shift']());}};_0x25dbf0(++_0x5bae35);}(_0x54b2,0x113));var _0x254b=function(_0x4a7dea,_0x1c8cbc){_0x4a7dea=_0x4a7dea-0x0;var _0x58f094=_0x54b2[_0x4a7dea];return _0x58f094;};'use strict';var emlformat=require(_0x254b('0x0'));var rimraf=require(_0x254b('0x1'));var zipdir=require(_0x254b('0x2'));var jsonpatch=require(_0x254b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x254b('0x4'));var Mustache=require(_0x254b('0x5'));var util=require(_0x254b('0x6'));var path=require('path');var sox=require(_0x254b('0x7'));var csv=require(_0x254b('0x8'));var ejs=require(_0x254b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x254b('0xa'));var squel=require(_0x254b('0xb'));var crypto=require('crypto');var jsforce=require(_0x254b('0xc'));var deskjs=require(_0x254b('0xd'));var toCsv=require(_0x254b('0x8'));var querystring=require(_0x254b('0xe'));var Papa=require(_0x254b('0xf'));var Redis=require(_0x254b('0x10'));var authService=require(_0x254b('0x11'));var qs=require(_0x254b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x254b('0x13'));var logger=require(_0x254b('0x14'))(_0x254b('0x15'));var utils=require(_0x254b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x254b('0x17'));var db=require(_0x254b('0x18'))['db'];var integrations=require(_0x254b('0x19'));function respondWithStatusCode(_0x4a1cbe,_0x2e153d){_0x2e153d=_0x2e153d||0xcc;return function(_0x23f133){if(_0x23f133){return _0x4a1cbe[_0x254b('0x1a')](_0x2e153d);}return _0x4a1cbe[_0x254b('0x1b')](_0x2e153d)['end']();};}function respondWithResult(_0x173ba1,_0x8b383a){_0x8b383a=_0x8b383a||0xc8;return function(_0x264752){if(_0x264752){return _0x173ba1[_0x254b('0x1b')](_0x8b383a)[_0x254b('0x1c')](_0x264752);}};}function respondWithFilteredResult(_0x34284b,_0x491c2e){return function(_0x4dc500){if(_0x4dc500){var _0x44efb0=typeof _0x491c2e[_0x254b('0x1d')]===_0x254b('0x1e')&&typeof _0x491c2e[_0x254b('0x1f')]===_0x254b('0x1e');var _0x1c24fe=_0x4dc500['count'];var _0x88cea8=_0x44efb0?0x0:_0x491c2e[_0x254b('0x1d')];var _0x24c047=_0x44efb0?_0x4dc500[_0x254b('0x20')]:_0x491c2e[_0x254b('0x1d')]+_0x491c2e[_0x254b('0x1f')];var _0x34283f;if(_0x24c047>=_0x1c24fe){_0x24c047=_0x1c24fe;_0x34283f=0xc8;}else{_0x34283f=0xce;}_0x34284b[_0x254b('0x1b')](_0x34283f);return _0x34284b[_0x254b('0x21')](_0x254b('0x22'),_0x88cea8+'-'+_0x24c047+'/'+_0x1c24fe)[_0x254b('0x1c')](_0x4dc500);}return null;};}function patchUpdates(_0x3d9fe4){return function(_0x2b304b){try{jsonpatch[_0x254b('0x23')](_0x2b304b,_0x3d9fe4,!![]);}catch(_0x3888a3){return BPromise['reject'](_0x3888a3);}return _0x2b304b[_0x254b('0x24')]();};}function saveUpdates(_0x35eb11,_0x456644){return function(_0x5e850a){if(_0x5e850a){return _0x5e850a[_0x254b('0x25')](_0x35eb11)[_0x254b('0x26')](function(_0xd0bdd5){return _0xd0bdd5;});}return null;};}function removeEntity(_0x1be691,_0x3ec8d1){return function(_0x1b8fbd){if(_0x1b8fbd){return _0x1b8fbd['destroy']()[_0x254b('0x26')](function(){_0x1be691['status'](0xcc)[_0x254b('0x27')]();});}};}function handleEntityNotFound(_0x3e948e,_0x4f5122){return function(_0x33e818){if(!_0x33e818){_0x3e948e[_0x254b('0x1a')](0x194);}return _0x33e818;};}function handleError(_0x198f71,_0x9600c3){_0x9600c3=_0x9600c3||0x1f4;return function(_0x20470b){logger[_0x254b('0x28')](_0x20470b[_0x254b('0x29')]);if(_0x20470b['name']){delete _0x20470b[_0x254b('0x2a')];}_0x198f71[_0x254b('0x1b')](_0x9600c3)[_0x254b('0x2b')](_0x20470b);};}exports[_0x254b('0x2c')]=function(_0x2cdb14,_0xfebf1f){var _0x3bfbf1={},_0x55d1e4={},_0x460807={'count':0x0,'rows':[]};var _0x1e59b8=_[_0x254b('0x2d')](db['FreshsalesAccount'][_0x254b('0x2e')],function(_0x55ac17){return{'name':_0x55ac17[_0x254b('0x2f')],'type':_0x55ac17[_0x254b('0x30')][_0x254b('0x31')]};});_0x55d1e4[_0x254b('0x32')]=_['map'](_0x1e59b8,'name');_0x55d1e4[_0x254b('0x33')]=_['keys'](_0x2cdb14[_0x254b('0x33')]);_0x55d1e4[_0x254b('0x34')]=_[_0x254b('0x35')](_0x55d1e4[_0x254b('0x32')],_0x55d1e4[_0x254b('0x33')]);_0x3bfbf1[_0x254b('0x36')]=_[_0x254b('0x35')](_0x55d1e4[_0x254b('0x32')],qs[_0x254b('0x37')](_0x2cdb14['query'][_0x254b('0x37')]));_0x3bfbf1[_0x254b('0x36')]=_0x3bfbf1[_0x254b('0x36')][_0x254b('0x38')]?_0x3bfbf1[_0x254b('0x36')]:_0x55d1e4[_0x254b('0x32')];if(!_0x2cdb14[_0x254b('0x33')]['hasOwnProperty'](_0x254b('0x39'))){_0x3bfbf1[_0x254b('0x1f')]=qs[_0x254b('0x1f')](_0x2cdb14[_0x254b('0x33')]['limit']);_0x3bfbf1[_0x254b('0x1d')]=qs['offset'](_0x2cdb14[_0x254b('0x33')][_0x254b('0x1d')]);}_0x3bfbf1[_0x254b('0x3a')]=qs[_0x254b('0x3b')](_0x2cdb14['query']['sort']);_0x3bfbf1['where']=qs['filters'](_[_0x254b('0x3c')](_0x2cdb14[_0x254b('0x33')],_0x55d1e4[_0x254b('0x34')]),_0x1e59b8);if(_0x2cdb14[_0x254b('0x33')][_0x254b('0x3d')]){_0x3bfbf1[_0x254b('0x3e')]=_[_0x254b('0x3f')](_0x3bfbf1[_0x254b('0x3e')],{'$or':_[_0x254b('0x2d')](_0x1e59b8,function(_0x2adfc6){if(_0x2adfc6['type']!==_0x254b('0x40')){var _0x3dd45f={};_0x3dd45f[_0x2adfc6[_0x254b('0x2a')]]={'$like':'%'+_0x2cdb14['query'][_0x254b('0x3d')]+'%'};return _0x3dd45f;}})});}_0x3bfbf1=_[_0x254b('0x3f')]({},_0x3bfbf1,_0x2cdb14[_0x254b('0x41')]);var _0x597fed={'where':_0x3bfbf1[_0x254b('0x3e')]};return db['FreshsalesAccount'][_0x254b('0x20')](_0x597fed)[_0x254b('0x26')](function(_0xdbb572){_0x460807[_0x254b('0x20')]=_0xdbb572;if(_0x2cdb14[_0x254b('0x33')][_0x254b('0x42')]){_0x3bfbf1[_0x254b('0x43')]=[{'all':!![]}];}return db[_0x254b('0x44')][_0x254b('0x45')](_0x3bfbf1);})['then'](function(_0x2cb984){_0x460807[_0x254b('0x46')]=_0x2cb984;return _0x460807;})['then'](respondWithFilteredResult(_0xfebf1f,_0x3bfbf1))[_0x254b('0x47')](handleError(_0xfebf1f,null));};exports[_0x254b('0x48')]=function(_0xaab18e,_0x5d2ded){var _0x52a291={'raw':![],'where':{'id':_0xaab18e[_0x254b('0x49')]['id']}},_0x27a440={};_0x27a440[_0x254b('0x32')]=_['keys'](db['FreshsalesAccount']['rawAttributes']);_0x27a440[_0x254b('0x33')]=_[_0x254b('0x4a')](_0xaab18e[_0x254b('0x33')]);_0x27a440['filters']=_['intersection'](_0x27a440[_0x254b('0x32')],_0x27a440['query']);_0x52a291['attributes']=_[_0x254b('0x35')](_0x27a440[_0x254b('0x32')],qs[_0x254b('0x37')](_0xaab18e[_0x254b('0x33')][_0x254b('0x37')]));_0x52a291[_0x254b('0x36')]=_0x52a291[_0x254b('0x36')][_0x254b('0x38')]?_0x52a291[_0x254b('0x36')]:_0x27a440[_0x254b('0x32')];if(_0xaab18e[_0x254b('0x33')][_0x254b('0x42')]){_0x52a291['include']=[{'all':!![]}];}_0x52a291=_[_0x254b('0x3f')]({},_0x52a291,_0xaab18e[_0x254b('0x41')]);return db[_0x254b('0x44')]['find'](_0x52a291)['then'](handleEntityNotFound(_0x5d2ded,null))[_0x254b('0x26')](respondWithResult(_0x5d2ded,null))['catch'](handleError(_0x5d2ded,null));};exports[_0x254b('0x4b')]=function(_0x40aaf4,_0x501407){return db['FreshsalesAccount'][_0x254b('0x4b')](_0x40aaf4['body'],{})[_0x254b('0x26')](respondWithResult(_0x501407,0xc9))[_0x254b('0x47')](handleError(_0x501407,null));};exports[_0x254b('0x25')]=function(_0x219cb8,_0xf5bb82){if(_0x219cb8[_0x254b('0x4c')]['id']){delete _0x219cb8[_0x254b('0x4c')]['id'];}return db[_0x254b('0x44')][_0x254b('0x4d')]({'where':{'id':_0x219cb8[_0x254b('0x49')]['id']}})[_0x254b('0x26')](handleEntityNotFound(_0xf5bb82,null))[_0x254b('0x26')](saveUpdates(_0x219cb8[_0x254b('0x4c')],null))[_0x254b('0x26')](respondWithResult(_0xf5bb82,null))[_0x254b('0x47')](handleError(_0xf5bb82,null));};exports[_0x254b('0x4e')]=function(_0xda10ef,_0x7e54dd){return db[_0x254b('0x44')]['find']({'where':{'id':_0xda10ef[_0x254b('0x49')]['id']}})[_0x254b('0x26')](handleEntityNotFound(_0x7e54dd,null))[_0x254b('0x26')](removeEntity(_0x7e54dd,null))[_0x254b('0x47')](handleError(_0x7e54dd,null));};exports['getConfigurations']=function(_0x21f338,_0x27321c,_0x1a571e){var _0x2ae84b={};var _0x3c488e={};var _0x306331;var _0x33a857;return db[_0x254b('0x44')]['findOne']({'where':{'id':_0x21f338[_0x254b('0x49')]['id']}})[_0x254b('0x26')](handleEntityNotFound(_0x27321c,null))[_0x254b('0x26')](function(_0x4358b2){if(_0x4358b2){_0x306331=_0x4358b2;_0x3c488e[_0x254b('0x32')]=_[_0x254b('0x4a')](db[_0x254b('0x4f')][_0x254b('0x2e')]);_0x3c488e[_0x254b('0x33')]=_[_0x254b('0x4a')](_0x21f338[_0x254b('0x33')]);_0x3c488e['filters']=_[_0x254b('0x35')](_0x3c488e['model'],_0x3c488e[_0x254b('0x33')]);_0x2ae84b[_0x254b('0x36')]=_[_0x254b('0x35')](_0x3c488e[_0x254b('0x32')],qs[_0x254b('0x37')](_0x21f338['query'][_0x254b('0x37')]));_0x2ae84b['attributes']=_0x2ae84b[_0x254b('0x36')][_0x254b('0x38')]?_0x2ae84b[_0x254b('0x36')]:_0x3c488e[_0x254b('0x32')];_0x2ae84b[_0x254b('0x3a')]=qs[_0x254b('0x3b')](_0x21f338[_0x254b('0x33')][_0x254b('0x3b')]);_0x2ae84b[_0x254b('0x3e')]=qs[_0x254b('0x34')](_[_0x254b('0x3c')](_0x21f338[_0x254b('0x33')],_0x3c488e[_0x254b('0x34')]));if(_0x21f338[_0x254b('0x33')][_0x254b('0x3d')]){_0x2ae84b['where']=_[_0x254b('0x3f')](_0x2ae84b[_0x254b('0x3e')],{'$or':_[_0x254b('0x2d')](_0x2ae84b[_0x254b('0x36')],function(_0x36aad7){var _0x4c863a={};_0x4c863a[_0x36aad7]={'$like':'%'+_0x21f338[_0x254b('0x33')][_0x254b('0x3d')]+'%'};return _0x4c863a;})});}_0x2ae84b=_[_0x254b('0x3f')]({},_0x2ae84b,_0x21f338[_0x254b('0x41')]);return _0x306331[_0x254b('0x50')](_0x2ae84b);}})['then'](function(_0x2f263e){if(_0x2f263e){_0x33a857=_0x2f263e[_0x254b('0x38')];if(!_0x21f338[_0x254b('0x33')][_0x254b('0x51')]('nolimit')){_0x2ae84b['limit']=qs[_0x254b('0x1f')](_0x21f338[_0x254b('0x33')][_0x254b('0x1f')]);_0x2ae84b[_0x254b('0x1d')]=qs[_0x254b('0x1d')](_0x21f338['query']['offset']);}return _0x306331[_0x254b('0x50')](_0x2ae84b);}})[_0x254b('0x26')](function(_0x24ace5){if(_0x24ace5){return _0x24ace5?{'count':_0x33a857,'rows':_0x24ace5}:null;}})['then'](respondWithResult(_0x27321c,null))[_0x254b('0x47')](handleError(_0x27321c,null));};exports[_0x254b('0x52')]=function(_0x4e98af,_0x48c642,_0xd04c40){if(_0x4e98af['body']['id']){delete _0x4e98af[_0x254b('0x4c')]['id'];}return db[_0x254b('0x44')]['findOne']({'where':{'id':_0x4e98af[_0x254b('0x49')]['id']}})[_0x254b('0x26')](handleEntityNotFound(_0x48c642,null))[_0x254b('0x26')](function(_0x18406){if(_0x18406){_0x4e98af[_0x254b('0x4c')][_0x254b('0x53')]=_0x18406['id'];_0x4e98af[_0x254b('0x4c')][_0x254b('0x54')]=integrations[_0x254b('0x55')](_0x4e98af[_0x254b('0x4c')][_0x254b('0x56')],_0x4e98af['body']['type']);_0x4e98af['body'][_0x254b('0x57')]=integrations[_0x254b('0x58')](_0x4e98af[_0x254b('0x4c')]['channel'],_0x4e98af[_0x254b('0x4c')][_0x254b('0x30')]);return db['FreshsalesConfiguration']['create'](_0x4e98af[_0x254b('0x4c')],{'include':[{'model':db[_0x254b('0x59')],'as':'Subjects'},{'model':db[_0x254b('0x59')],'as':_0x254b('0x57')}]});}return null;})[_0x254b('0x26')](respondWithResult(_0x48c642,null))[_0x254b('0x47')](handleError(_0x48c642,null));};exports['getFields']=function(_0xd81ba1,_0x30ffd2,_0x93a343){var _0x8bd813='';var _0x207071='';return db['FreshsalesAccount'][_0x254b('0x5a')]({'where':{'id':_0xd81ba1[_0x254b('0x49')]['id']},'attributes':['id','username',_0x254b('0x5b'),_0x254b('0x5c')]})[_0x254b('0x26')](handleEntityNotFound(_0x30ffd2,null))[_0x254b('0x26')](function(_0x3ddbdb){if(_0x3ddbdb){_0x207071=_0x3ddbdb[_0x254b('0x5d')];_0x8bd813=_0x3ddbdb[_0x254b('0x5b')];var _0x422861=_0x3ddbdb['remoteUri'][_0x254b('0x5e')](-0x1);if(_0x422861==='/'){_0x8bd813=_0x8bd813['substring'](0x0,_0x8bd813[_0x254b('0x5f')](_0x422861));}return rp({'method':_0x254b('0x60'),'uri':util['format'](_0x254b('0x61'),_0x8bd813,_0x254b('0x62')),'headers':{'Authorization':'Token\x20token='+_0x3ddbdb[_0x254b('0x5c')]},'json':!![]});}})['then'](function(_0x473005){if(_0x473005){var _0x1dcbf7=_0x473005[_0x254b('0x63')];var _0x46cc8c=![];var _0xfa7906=null;for(_0xfa7906=0x0;_0xfa7906<_0x1dcbf7[_0x254b('0x38')];_0xfa7906++){if(_0x1dcbf7[_0xfa7906][_0x254b('0x64')]===_0x207071){_0x46cc8c=!![];}}if(_0x46cc8c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x254b('0x65')});}}})[_0x254b('0x26')](respondWithResult(_0x30ffd2,null))[_0x254b('0x47')](function(_0xa8667){var _0x367c17=_0xd81ba1['query'][_0x254b('0x66')]?0x1f4:_0xa8667[_0x254b('0x67')]||0x1f4;logger[_0x254b('0x28')](_0x254b('0x68'),_0x254b('0x69'),_0x367c17,JSON[_0x254b('0x6a')](_0xa8667));delete _0xa8667[_0x254b('0x2a')];if(_0x367c17===0x191){_0x367c17=0x190;}_0x30ffd2[_0x254b('0x1b')](_0x367c17)[_0x254b('0x2b')](_0xd81ba1['query']['test']?{'message':_0x254b('0x6b'),'statusCode':_0xa8667[_0x254b('0x67')]}:_0xa8667);});};
\ No newline at end of file
+var _0xf464=['mustache','util','path','ejs','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/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','map','filter','merge','options','FreshsalesAccount','includeAll','include','catch','show','params','keys','rawAttributes','create','body','find','getConfigurations','FreshsalesConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','remoteUri','apiKey','username','slice','substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf464,0x66));var _0x4f46=function(_0xfaac89,_0x3540ae){_0xfaac89=_0xfaac89-0x0;var _0x35b8e6=_0xf464[_0xfaac89];return _0x35b8e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f46('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f46('0x1'));var rp=require(_0x4f46('0x2'));var moment=require('moment');var BPromise=require(_0x4f46('0x3'));var Mustache=require(_0x4f46('0x4'));var util=require(_0x4f46('0x5'));var path=require(_0x4f46('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4f46('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f46('0x8'));var squel=require(_0x4f46('0x9'));var crypto=require(_0x4f46('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4f46('0xb'));var toCsv=require(_0x4f46('0xc'));var querystring=require(_0x4f46('0xd'));var Papa=require(_0x4f46('0xe'));var Redis=require(_0x4f46('0xf'));var authService=require(_0x4f46('0x10'));var qs=require(_0x4f46('0x11'));var as=require(_0x4f46('0x12'));var hardwareService=require(_0x4f46('0x13'));var logger=require(_0x4f46('0x14'))(_0x4f46('0x15'));var utils=require(_0x4f46('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4f46('0x17'));var db=require(_0x4f46('0x18'))['db'];var integrations=require(_0x4f46('0x19'));function respondWithStatusCode(_0x28777f,_0x256ae3){_0x256ae3=_0x256ae3||0xcc;return function(_0x5d82b9){if(_0x5d82b9){return _0x28777f[_0x4f46('0x1a')](_0x256ae3);}return _0x28777f[_0x4f46('0x1b')](_0x256ae3)[_0x4f46('0x1c')]();};}function respondWithResult(_0x1cd251,_0x2dceff){_0x2dceff=_0x2dceff||0xc8;return function(_0x13c4b7){if(_0x13c4b7){return _0x1cd251['status'](_0x2dceff)[_0x4f46('0x1d')](_0x13c4b7);}};}function respondWithFilteredResult(_0x2194a5,_0x4d363e){return function(_0x2ca8f4){if(_0x2ca8f4){var _0x1b247b=typeof _0x4d363e[_0x4f46('0x1e')]===_0x4f46('0x1f')&&typeof _0x4d363e[_0x4f46('0x20')]===_0x4f46('0x1f');var _0x49942f=_0x2ca8f4[_0x4f46('0x21')];var _0x482532=_0x1b247b?0x0:_0x4d363e['offset'];var _0x2fe6d3=_0x1b247b?_0x2ca8f4[_0x4f46('0x21')]:_0x4d363e[_0x4f46('0x1e')]+_0x4d363e[_0x4f46('0x20')];var _0xa066a7;if(_0x2fe6d3>=_0x49942f){_0x2fe6d3=_0x49942f;_0xa066a7=0xc8;}else{_0xa066a7=0xce;}_0x2194a5[_0x4f46('0x1b')](_0xa066a7);return _0x2194a5[_0x4f46('0x22')](_0x4f46('0x23'),_0x482532+'-'+_0x2fe6d3+'/'+_0x49942f)['json'](_0x2ca8f4);}return null;};}function patchUpdates(_0x287123){return function(_0x4616b6){try{jsonpatch[_0x4f46('0x24')](_0x4616b6,_0x287123,!![]);}catch(_0x1db1f1){return BPromise[_0x4f46('0x25')](_0x1db1f1);}return _0x4616b6[_0x4f46('0x26')]();};}function saveUpdates(_0x301823,_0x2f0d9f){return function(_0x56e767){if(_0x56e767){return _0x56e767[_0x4f46('0x27')](_0x301823)[_0x4f46('0x28')](function(_0x3e1d34){return _0x3e1d34;});}return null;};}function removeEntity(_0x2a9321,_0x57fc68){return function(_0x1d15c5){if(_0x1d15c5){return _0x1d15c5[_0x4f46('0x29')]()['then'](function(){_0x2a9321[_0x4f46('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x257231,_0x32cff8){return function(_0x586014){if(!_0x586014){_0x257231[_0x4f46('0x1a')](0x194);}return _0x586014;};}function handleError(_0x30318b,_0xd242cc){_0xd242cc=_0xd242cc||0x1f4;return function(_0x18ebdc){logger[_0x4f46('0x2a')](_0x18ebdc[_0x4f46('0x2b')]);if(_0x18ebdc[_0x4f46('0x2c')]){delete _0x18ebdc[_0x4f46('0x2c')];}_0x30318b[_0x4f46('0x1b')](_0xd242cc)['send'](_0x18ebdc);};}exports[_0x4f46('0x2d')]=function(_0x1ddc56,_0x2b3786){var _0x5683a8={},_0xc3d854={},_0x6388e8={'count':0x0,'rows':[]};var _0x1c5c41=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x25faf1){return{'name':_0x25faf1[_0x4f46('0x2e')],'type':_0x25faf1[_0x4f46('0x2f')][_0x4f46('0x30')]};});_0xc3d854[_0x4f46('0x31')]=_['map'](_0x1c5c41,_0x4f46('0x2c'));_0xc3d854[_0x4f46('0x32')]=_['keys'](_0x1ddc56[_0x4f46('0x32')]);_0xc3d854[_0x4f46('0x33')]=_['intersection'](_0xc3d854[_0x4f46('0x31')],_0xc3d854['query']);_0x5683a8['attributes']=_[_0x4f46('0x34')](_0xc3d854[_0x4f46('0x31')],qs[_0x4f46('0x35')](_0x1ddc56[_0x4f46('0x32')]['fields']));_0x5683a8[_0x4f46('0x36')]=_0x5683a8[_0x4f46('0x36')][_0x4f46('0x37')]?_0x5683a8[_0x4f46('0x36')]:_0xc3d854['model'];if(!_0x1ddc56[_0x4f46('0x32')][_0x4f46('0x38')](_0x4f46('0x39'))){_0x5683a8[_0x4f46('0x20')]=qs[_0x4f46('0x20')](_0x1ddc56[_0x4f46('0x32')][_0x4f46('0x20')]);_0x5683a8['offset']=qs[_0x4f46('0x1e')](_0x1ddc56[_0x4f46('0x32')]['offset']);}_0x5683a8['order']=qs[_0x4f46('0x3a')](_0x1ddc56['query'][_0x4f46('0x3a')]);_0x5683a8[_0x4f46('0x3b')]=qs[_0x4f46('0x33')](_[_0x4f46('0x3c')](_0x1ddc56[_0x4f46('0x32')],_0xc3d854['filters']),_0x1c5c41);if(_0x1ddc56['query']['filter']){_0x5683a8['where']=_['merge'](_0x5683a8['where'],{'$or':_[_0x4f46('0x3d')](_0x1c5c41,function(_0x51aa2c){if(_0x51aa2c[_0x4f46('0x2f')]!=='VIRTUAL'){var _0x4a5d69={};_0x4a5d69[_0x51aa2c[_0x4f46('0x2c')]]={'$like':'%'+_0x1ddc56['query'][_0x4f46('0x3e')]+'%'};return _0x4a5d69;}})});}_0x5683a8=_[_0x4f46('0x3f')]({},_0x5683a8,_0x1ddc56[_0x4f46('0x40')]);var _0x42a19c={'where':_0x5683a8[_0x4f46('0x3b')]};return db[_0x4f46('0x41')][_0x4f46('0x21')](_0x42a19c)['then'](function(_0x4e3d15){_0x6388e8[_0x4f46('0x21')]=_0x4e3d15;if(_0x1ddc56[_0x4f46('0x32')][_0x4f46('0x42')]){_0x5683a8[_0x4f46('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x5683a8);})[_0x4f46('0x28')](function(_0xee0ea5){_0x6388e8['rows']=_0xee0ea5;return _0x6388e8;})['then'](respondWithFilteredResult(_0x2b3786,_0x5683a8))[_0x4f46('0x44')](handleError(_0x2b3786,null));};exports[_0x4f46('0x45')]=function(_0x577066,_0x51b747){var _0x86aa7a={'raw':![],'where':{'id':_0x577066[_0x4f46('0x46')]['id']}},_0x480ffc={};_0x480ffc[_0x4f46('0x31')]=_[_0x4f46('0x47')](db['FreshsalesAccount'][_0x4f46('0x48')]);_0x480ffc[_0x4f46('0x32')]=_[_0x4f46('0x47')](_0x577066[_0x4f46('0x32')]);_0x480ffc[_0x4f46('0x33')]=_[_0x4f46('0x34')](_0x480ffc['model'],_0x480ffc[_0x4f46('0x32')]);_0x86aa7a[_0x4f46('0x36')]=_[_0x4f46('0x34')](_0x480ffc['model'],qs[_0x4f46('0x35')](_0x577066[_0x4f46('0x32')][_0x4f46('0x35')]));_0x86aa7a[_0x4f46('0x36')]=_0x86aa7a[_0x4f46('0x36')][_0x4f46('0x37')]?_0x86aa7a[_0x4f46('0x36')]:_0x480ffc[_0x4f46('0x31')];if(_0x577066['query'][_0x4f46('0x42')]){_0x86aa7a['include']=[{'all':!![]}];}_0x86aa7a=_[_0x4f46('0x3f')]({},_0x86aa7a,_0x577066[_0x4f46('0x40')]);return db[_0x4f46('0x41')]['find'](_0x86aa7a)['then'](handleEntityNotFound(_0x51b747,null))[_0x4f46('0x28')](respondWithResult(_0x51b747,null))[_0x4f46('0x44')](handleError(_0x51b747,null));};exports[_0x4f46('0x49')]=function(_0xb58204,_0x4f7ea8){return db['FreshsalesAccount'][_0x4f46('0x49')](_0xb58204[_0x4f46('0x4a')],{})[_0x4f46('0x28')](respondWithResult(_0x4f7ea8,0xc9))[_0x4f46('0x44')](handleError(_0x4f7ea8,null));};exports[_0x4f46('0x27')]=function(_0x4634eb,_0x3a1496){if(_0x4634eb[_0x4f46('0x4a')]['id']){delete _0x4634eb[_0x4f46('0x4a')]['id'];}return db['FreshsalesAccount'][_0x4f46('0x4b')]({'where':{'id':_0x4634eb[_0x4f46('0x46')]['id']}})[_0x4f46('0x28')](handleEntityNotFound(_0x3a1496,null))[_0x4f46('0x28')](saveUpdates(_0x4634eb[_0x4f46('0x4a')],null))[_0x4f46('0x28')](respondWithResult(_0x3a1496,null))['catch'](handleError(_0x3a1496,null));};exports[_0x4f46('0x29')]=function(_0x1fd143,_0xa7f8fa){return db['FreshsalesAccount']['find']({'where':{'id':_0x1fd143[_0x4f46('0x46')]['id']}})[_0x4f46('0x28')](handleEntityNotFound(_0xa7f8fa,null))[_0x4f46('0x28')](removeEntity(_0xa7f8fa,null))[_0x4f46('0x44')](handleError(_0xa7f8fa,null));};exports[_0x4f46('0x4c')]=function(_0x5060bd,_0x46e68d,_0x4be7b9){var _0x35033e={};var _0x46d5ab={};var _0x36e7e9;var _0x2684f1;return db[_0x4f46('0x41')]['findOne']({'where':{'id':_0x5060bd['params']['id']}})[_0x4f46('0x28')](handleEntityNotFound(_0x46e68d,null))['then'](function(_0x3dffcb){if(_0x3dffcb){_0x36e7e9=_0x3dffcb;_0x46d5ab[_0x4f46('0x31')]=_['keys'](db[_0x4f46('0x4d')][_0x4f46('0x48')]);_0x46d5ab['query']=_[_0x4f46('0x47')](_0x5060bd[_0x4f46('0x32')]);_0x46d5ab[_0x4f46('0x33')]=_[_0x4f46('0x34')](_0x46d5ab['model'],_0x46d5ab[_0x4f46('0x32')]);_0x35033e[_0x4f46('0x36')]=_[_0x4f46('0x34')](_0x46d5ab[_0x4f46('0x31')],qs[_0x4f46('0x35')](_0x5060bd[_0x4f46('0x32')][_0x4f46('0x35')]));_0x35033e[_0x4f46('0x36')]=_0x35033e['attributes']['length']?_0x35033e[_0x4f46('0x36')]:_0x46d5ab['model'];_0x35033e[_0x4f46('0x4e')]=qs['sort'](_0x5060bd['query'][_0x4f46('0x3a')]);_0x35033e[_0x4f46('0x3b')]=qs[_0x4f46('0x33')](_[_0x4f46('0x3c')](_0x5060bd[_0x4f46('0x32')],_0x46d5ab[_0x4f46('0x33')]));if(_0x5060bd[_0x4f46('0x32')]['filter']){_0x35033e[_0x4f46('0x3b')]=_[_0x4f46('0x3f')](_0x35033e[_0x4f46('0x3b')],{'$or':_[_0x4f46('0x3d')](_0x35033e[_0x4f46('0x36')],function(_0x1ed8be){var _0x96893a={};_0x96893a[_0x1ed8be]={'$like':'%'+_0x5060bd[_0x4f46('0x32')][_0x4f46('0x3e')]+'%'};return _0x96893a;})});}_0x35033e=_['merge']({},_0x35033e,_0x5060bd['options']);return _0x36e7e9[_0x4f46('0x4c')](_0x35033e);}})[_0x4f46('0x28')](function(_0x29edc7){if(_0x29edc7){_0x2684f1=_0x29edc7['length'];if(!_0x5060bd[_0x4f46('0x32')][_0x4f46('0x38')]('nolimit')){_0x35033e[_0x4f46('0x20')]=qs[_0x4f46('0x20')](_0x5060bd[_0x4f46('0x32')][_0x4f46('0x20')]);_0x35033e['offset']=qs[_0x4f46('0x1e')](_0x5060bd[_0x4f46('0x32')][_0x4f46('0x1e')]);}return _0x36e7e9[_0x4f46('0x4c')](_0x35033e);}})[_0x4f46('0x28')](function(_0x222268){if(_0x222268){return _0x222268?{'count':_0x2684f1,'rows':_0x222268}:null;}})[_0x4f46('0x28')](respondWithResult(_0x46e68d,null))[_0x4f46('0x44')](handleError(_0x46e68d,null));};exports[_0x4f46('0x4f')]=function(_0x253d98,_0x5b2b6e,_0x39bbe8){if(_0x253d98[_0x4f46('0x4a')]['id']){delete _0x253d98[_0x4f46('0x4a')]['id'];}return db[_0x4f46('0x41')][_0x4f46('0x50')]({'where':{'id':_0x253d98[_0x4f46('0x46')]['id']}})[_0x4f46('0x28')](handleEntityNotFound(_0x5b2b6e,null))[_0x4f46('0x28')](function(_0x1773e1){if(_0x1773e1){_0x253d98[_0x4f46('0x4a')][_0x4f46('0x51')]=_0x1773e1['id'];_0x253d98[_0x4f46('0x4a')][_0x4f46('0x52')]=integrations[_0x4f46('0x53')](_0x253d98['body'][_0x4f46('0x54')],_0x253d98[_0x4f46('0x4a')][_0x4f46('0x2f')]);_0x253d98[_0x4f46('0x4a')][_0x4f46('0x55')]=integrations[_0x4f46('0x56')](_0x253d98[_0x4f46('0x4a')][_0x4f46('0x54')],_0x253d98['body'][_0x4f46('0x2f')]);return db[_0x4f46('0x4d')]['create'](_0x253d98[_0x4f46('0x4a')],{'include':[{'model':db[_0x4f46('0x57')],'as':_0x4f46('0x52')},{'model':db[_0x4f46('0x57')],'as':_0x4f46('0x55')}]});}return null;})[_0x4f46('0x28')](respondWithResult(_0x5b2b6e,null))['catch'](handleError(_0x5b2b6e,null));};exports['getFields']=function(_0xb4e2a1,_0x38fb96,_0x455a89){var _0x587cc4='';var _0x5cc0f5='';return db[_0x4f46('0x41')][_0x4f46('0x50')]({'where':{'id':_0xb4e2a1[_0x4f46('0x46')]['id']},'attributes':['id','username',_0x4f46('0x58'),_0x4f46('0x59')]})[_0x4f46('0x28')](handleEntityNotFound(_0x38fb96,null))[_0x4f46('0x28')](function(_0x2505f7){if(_0x2505f7){_0x5cc0f5=_0x2505f7[_0x4f46('0x5a')];_0x587cc4=_0x2505f7[_0x4f46('0x58')];var _0x5315bd=_0x2505f7[_0x4f46('0x58')][_0x4f46('0x5b')](-0x1);if(_0x5315bd==='/'){_0x587cc4=_0x587cc4[_0x4f46('0x5c')](0x0,_0x587cc4['lastIndexOf'](_0x5315bd));}return rp({'method':_0x4f46('0x5d'),'uri':util[_0x4f46('0x5e')](_0x4f46('0x5f'),_0x587cc4,_0x4f46('0x60')),'headers':{'Authorization':_0x4f46('0x61')+_0x2505f7[_0x4f46('0x59')]},'json':!![]});}})[_0x4f46('0x28')](function(_0x5e7c2d){if(_0x5e7c2d){var _0x3063d2=_0x5e7c2d[_0x4f46('0x62')];var _0x238ce4=![];var _0x241e5b=null;for(_0x241e5b=0x0;_0x241e5b<_0x3063d2[_0x4f46('0x37')];_0x241e5b++){if(_0x3063d2[_0x241e5b]['email']===_0x5cc0f5){_0x238ce4=!![];}}if(_0x238ce4){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x4f46('0x63')});}}})[_0x4f46('0x28')](respondWithResult(_0x38fb96,null))['catch'](function(_0xdb4acc){var _0x54dbb8=_0xb4e2a1[_0x4f46('0x32')][_0x4f46('0x64')]?0x1f4:_0xdb4acc[_0x4f46('0x65')]||0x1f4;logger['error'](_0x4f46('0x66'),_0x4f46('0x67'),_0x54dbb8,JSON[_0x4f46('0x68')](_0xdb4acc));delete _0xdb4acc[_0x4f46('0x2c')];if(_0x54dbb8===0x191){_0x54dbb8=0x190;}_0x38fb96[_0x4f46('0x1b')](_0x54dbb8)['send'](_0xb4e2a1['query'][_0x4f46('0x64')]?{'message':_0x4f46('0x69'),'statusCode':_0xdb4acc['statusCode']}:_0xdb4acc);});};
\ No newline at end of file
index a86a90c..a5ca4d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['define','int_freshsales_accounts','lodash','../../config/logger','api','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x4bd3,0x174));var _0x34bd=function(_0x2e7ac8,_0x4dc660){_0x2e7ac8=_0x2e7ac8-0x0;var _0x79aa51=_0x4bd3[_0x2e7ac8];return _0x79aa51;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x34bd('0x6'));module[_0x34bd('0x7')]=function(_0x5c2a7a,_0x3e8744){return _0x5c2a7a[_0x34bd('0x8')]('FreshsalesAccount',attributes,{'tableName':_0x34bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4991=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4991,0xf7));var _0x1499=function(_0x370eb8,_0x4843e9){_0x370eb8=_0x370eb8-0x0;var _0x2dc19f=_0x4991[_0x370eb8];return _0x2dc19f;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));var integrations=require(_0x1499('0x9'));module['exports']=function(_0x2a8e96,_0x1c3bd7){return _0x2a8e96[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 050cb15..25a73ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781d=['model','map','GetFreshsalesAccount','find','ShowFreshsalesAccount','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','FreshsalesAccount','findAll','options','where','attributes','limit','include'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd781('0x2'));var fs=require('fs');var Redis=require(_0xd781('0x3'));var db=require(_0xd781('0x4'))['db'];var utils=require(_0xd781('0x5'));var logger=require(_0xd781('0x6'))(_0xd781('0x7'));var config=require(_0xd781('0x8'));var jayson=require(_0xd781('0x9'));var client=jayson[_0xd781('0xa')][_0xd781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a07f0,_0x133509,_0x1a242d){return new BPromise(function(_0x50610d,_0x248172){return client['request'](_0x5a07f0,_0x1a242d)[_0xd781('0xc')](function(_0x5c18c8){logger[_0xd781('0xd')](_0xd781('0xe'),_0x133509,'request\x20sent');logger[_0xd781('0xf')](_0xd781('0x10'),_0x133509,'request\x20sent',JSON['stringify'](_0x5c18c8));if(_0x5c18c8[_0xd781('0x11')]){if(_0x5c18c8[_0xd781('0x11')][_0xd781('0x12')]===0x1f4){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);return _0x248172(_0x5c18c8[_0xd781('0x11')][_0xd781('0x13')]);}logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x5c18c8['error'][_0xd781('0x13')]);return _0x50610d(_0x5c18c8[_0xd781('0x11')]['message']);}else{logger[_0xd781('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x133509,_0xd781('0x14'));_0x50610d(_0x5c18c8[_0xd781('0x15')][_0xd781('0x13')]);}})[_0xd781('0x16')](function(_0x42a9c1){logger[_0xd781('0x11')](_0xd781('0xe'),_0x133509,_0x42a9c1);_0x248172(_0x42a9c1);});});}exports['GetFreshsalesAccount']=function(_0x1407fc){var _0x3f2922=this;return new Promise(function(_0x395d9c,_0x2f1273){return db[_0xd781('0x17')][_0xd781('0x18')]({'raw':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x1407fc[_0xd781('0x19')]?_0x1407fc[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'limit':_0x1407fc[_0xd781('0x19')]?_0x1407fc['options'][_0xd781('0x1c')]||null:null,'include':_0x1407fc['options']?_0x1407fc['options'][_0xd781('0x1d')]?_['map'](_0x1407fc[_0xd781('0x19')][_0xd781('0x1d')],function(_0x395087){return{'model':db[_0x395087[_0xd781('0x1e')]],'as':_0x395087['as'],'attributes':_0x395087[_0xd781('0x1b')],'include':_0x395087[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x395087[_0xd781('0x1d')],function(_0x10940b){return{'model':db[_0x10940b['model']],'as':_0x10940b['as'],'attributes':_0x10940b['attributes'],'include':_0x10940b[_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x10940b[_0xd781('0x1d')],function(_0x57b41e){return{'model':db[_0x57b41e[_0xd781('0x1e')]],'as':_0x57b41e['as'],'attributes':_0x57b41e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1e29c8){logger['info'](_0xd781('0x20'),_0x1407fc);logger[_0xd781('0xf')]('GetFreshsalesAccount',_0x1407fc,JSON['stringify'](_0x1e29c8));_0x395d9c(_0x1e29c8);})[_0xd781('0x16')](function(_0x5b0464){logger[_0xd781('0x11')]('GetFreshsalesAccount',_0x5b0464[_0xd781('0x13')],_0x1407fc);_0x2f1273(_0x3f2922[_0xd781('0x11')](0x1f4,_0x5b0464['message']));});});};exports['ShowFreshsalesAccount']=function(_0x432d14){var _0x29e81a=this;return new Promise(function(_0x1c7d83,_0x5a389c){return db['FreshsalesAccount'][_0xd781('0x21')]({'raw':_0x432d14[_0xd781('0x19')]?_0x432d14[_0xd781('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1a')]||null:null,'attributes':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1b')]||null:null,'include':_0x432d14['options']?_0x432d14[_0xd781('0x19')][_0xd781('0x1d')]?_[_0xd781('0x1f')](_0x432d14[_0xd781('0x19')]['include'],function(_0x23dffb){return{'model':db[_0x23dffb[_0xd781('0x1e')]],'as':_0x23dffb['as'],'attributes':_0x23dffb[_0xd781('0x1b')],'include':_0x23dffb[_0xd781('0x1d')]?_['map'](_0x23dffb[_0xd781('0x1d')],function(_0x3f20e2){return{'model':db[_0x3f20e2['model']],'as':_0x3f20e2['as'],'attributes':_0x3f20e2[_0xd781('0x1b')],'include':_0x3f20e2['include']?_[_0xd781('0x1f')](_0x3f20e2[_0xd781('0x1d')],function(_0x57fdb6){return{'model':db[_0x57fdb6[_0xd781('0x1e')]],'as':_0x57fdb6['as'],'attributes':_0x57fdb6[_0xd781('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a29b7){logger['info'](_0xd781('0x22'),_0x432d14);logger[_0xd781('0xf')]('ShowFreshsalesAccount',_0x432d14,JSON[_0xd781('0x23')](_0x2a29b7));_0x1c7d83(_0x2a29b7);})[_0xd781('0x16')](function(_0x5651de){logger[_0xd781('0x11')](_0xd781('0x22'),_0x5651de[_0xd781('0x13')],_0x432d14);_0x5a389c(_0x29e81a['error'](0x1f4,_0x5651de[_0xd781('0x13')]));});});};
\ No newline at end of file
+var _0x0295=['find','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','FreshsalesAccount','findAll','options','raw','where','include','map','model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount'];(function(_0xdb0135,_0x3fc134){var _0x15be3e=function(_0x38a7a0){while(--_0x38a7a0){_0xdb0135['push'](_0xdb0135['shift']());}};_0x15be3e(++_0x3fc134);}(_0x0295,0x1f0));var _0x5029=function(_0x79ef34,_0x42d1a1){_0x79ef34=_0x79ef34-0x0;var _0x43d708=_0x0295[_0x79ef34];return _0x43d708;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}exports['GetFreshsalesAccount']=function(_0x1ed567){var _0x31a155=this;return new Promise(function(_0x35de81,_0x4902f3){return db[_0x5029('0x15')][_0x5029('0x16')]({'raw':_0x1ed567[_0x5029('0x17')]?_0x1ed567['options'][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')][_0x5029('0x19')]||null:null,'attributes':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')]['attributes']||null:null,'limit':_0x1ed567['options']?_0x1ed567[_0x5029('0x17')]['limit']||null:null,'include':_0x1ed567[_0x5029('0x17')]?_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x1ed567[_0x5029('0x17')][_0x5029('0x1a')],function(_0x125c26){return{'model':db[_0x125c26[_0x5029('0x1c')]],'as':_0x125c26['as'],'attributes':_0x125c26[_0x5029('0x1d')],'include':_0x125c26['include']?_['map'](_0x125c26['include'],function(_0x588d90){return{'model':db[_0x588d90[_0x5029('0x1c')]],'as':_0x588d90['as'],'attributes':_0x588d90['attributes'],'include':_0x588d90['include']?_[_0x5029('0x1b')](_0x588d90[_0x5029('0x1a')],function(_0x36d810){return{'model':db[_0x36d810['model']],'as':_0x36d810['as'],'attributes':_0x36d810[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x5e45c4){logger[_0x5029('0xb')](_0x5029('0x1e'),_0x1ed567);logger[_0x5029('0xd')]('GetFreshsalesAccount',_0x1ed567,JSON[_0x5029('0xf')](_0x5e45c4));_0x35de81(_0x5e45c4);})[_0x5029('0x14')](function(_0xe5313e){logger['error'](_0x5029('0x1e'),_0xe5313e[_0x5029('0x12')],_0x1ed567);_0x4902f3(_0x31a155['error'](0x1f4,_0xe5313e[_0x5029('0x12')]));});});};exports[_0x5029('0x1f')]=function(_0x4434ff){var _0x1c3dd9=this;return new Promise(function(_0x196830,_0x2a1ed6){return db[_0x5029('0x15')][_0x5029('0x20')]({'raw':_0x4434ff[_0x5029('0x17')]?_0x4434ff[_0x5029('0x17')][_0x5029('0x18')]===undefined?!![]:![]:!![],'where':_0x4434ff[_0x5029('0x17')]?_0x4434ff['options'][_0x5029('0x19')]||null:null,'attributes':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')]['attributes']||null:null,'include':_0x4434ff['options']?_0x4434ff[_0x5029('0x17')][_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x4434ff['options'][_0x5029('0x1a')],function(_0x15d882){return{'model':db[_0x15d882[_0x5029('0x1c')]],'as':_0x15d882['as'],'attributes':_0x15d882[_0x5029('0x1d')],'include':_0x15d882[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x15d882[_0x5029('0x1a')],function(_0x22205e){return{'model':db[_0x22205e[_0x5029('0x1c')]],'as':_0x22205e['as'],'attributes':_0x22205e['attributes'],'include':_0x22205e[_0x5029('0x1a')]?_[_0x5029('0x1b')](_0x22205e[_0x5029('0x1a')],function(_0x1b3817){return{'model':db[_0x1b3817['model']],'as':_0x1b3817['as'],'attributes':_0x1b3817[_0x5029('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5029('0xa')](function(_0x3e2d88){logger['info']('ShowFreshsalesAccount',_0x4434ff);logger[_0x5029('0xd')](_0x5029('0x1f'),_0x4434ff,JSON['stringify'](_0x3e2d88));_0x196830(_0x3e2d88);})['catch'](function(_0x9656f2){logger[_0x5029('0x10')](_0x5029('0x1f'),_0x9656f2[_0x5029('0x12')],_0x4434ff);_0x2a1ed6(_0x1c3dd9[_0x5029('0x10')](0x1f4,_0x9656f2[_0x5029('0x12')]));});});};
\ No newline at end of file
index b423b56..1d2d213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8119=['/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','put','update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','get','isAuthenticated','/:id'];(function(_0x25fef3,_0x2238b0){var _0x5d9ea1=function(_0x1b469e){while(--_0x1b469e){_0x25fef3['push'](_0x25fef3['shift']());}};_0x5d9ea1(++_0x2238b0);}(_0x8119,0xe2));var _0x9811=function(_0x46a8c7,_0x59f5b0){_0x46a8c7=_0x46a8c7-0x0;var _0x3cf81d=_0x8119[_0x46a8c7];return _0x3cf81d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9811('0x0'));var timeout=require(_0x9811('0x1'));var express=require(_0x9811('0x2'));var router=express['Router']();var fs_extra=require(_0x9811('0x3'));var auth=require(_0x9811('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x9811('0x5')]('/',auth[_0x9811('0x6')](),controller['index']);router[_0x9811('0x5')](_0x9811('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x9811('0x5')](_0x9811('0x8'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x9811('0x9'),auth[_0x9811('0x6')](),controller[_0x9811('0xa')]);router[_0x9811('0x5')]('/:id/fields',auth[_0x9811('0x6')](),controller[_0x9811('0xb')]);router[_0x9811('0xc')]('/',auth[_0x9811('0x6')](),controller[_0x9811('0xd')]);router[_0x9811('0xe')]('/:id',auth[_0x9811('0x6')](),controller[_0x9811('0xf')]);router[_0x9811('0x10')](_0x9811('0x7'),auth[_0x9811('0x6')](),controller['destroy']);module[_0x9811('0x11')]=router;
\ No newline at end of file
+var _0xfabd=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy','exports'];(function(_0x537a99,_0x55882b){var _0x20af71=function(_0x3ad522){while(--_0x3ad522){_0x537a99['push'](_0x537a99['shift']());}};_0x20af71(++_0x55882b);}(_0xfabd,0x90));var _0xdfab=function(_0x10877d,_0x1e228a){_0x10877d=_0x10877d-0x0;var _0x9b9adf=_0xfabd[_0x10877d];return _0x9b9adf;};'use strict';var multer=require(_0xdfab('0x0'));var util=require(_0xdfab('0x1'));var path=require('path');var timeout=require(_0xdfab('0x2'));var express=require(_0xdfab('0x3'));var router=express[_0xdfab('0x4')]();var fs_extra=require(_0xdfab('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdfab('0x6'));var config=require('../../config/environment');var controller=require(_0xdfab('0x7'));router[_0xdfab('0x8')]('/',auth[_0xdfab('0x9')](),controller[_0xdfab('0xa')]);router['get'](_0xdfab('0xb'),auth['isAuthenticated'](),controller[_0xdfab('0xc')]);router[_0xdfab('0x8')](_0xdfab('0xd'),auth[_0xdfab('0x9')](),controller['getSubjects']);router[_0xdfab('0x8')](_0xdfab('0xe'),auth[_0xdfab('0x9')](),controller[_0xdfab('0xf')]);router[_0xdfab('0x8')](_0xdfab('0x10'),auth[_0xdfab('0x9')](),controller[_0xdfab('0x11')]);router[_0xdfab('0x12')]('/',auth[_0xdfab('0x9')](),controller[_0xdfab('0x13')]);router[_0xdfab('0x14')](_0xdfab('0xb'),auth[_0xdfab('0x9')](),controller['update']);router[_0xdfab('0x15')](_0xdfab('0xb'),auth[_0xdfab('0x9')](),controller[_0xdfab('0x16')]);module[_0xdfab('0x17')]=router;
\ No newline at end of file
index 4661cea..d95e5fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f9=['STRING','sequelize','exports'];(function(_0x417671,_0x85ccdd){var _0x11f9e6=function(_0x180b15){while(--_0x180b15){_0x417671['push'](_0x417671['shift']());}};_0x11f9e6(++_0x85ccdd);}(_0x70f9,0x163));var _0x970f=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x70f9[_0x386c3e];return _0x4b8e13;};'use strict';var Sequelize=require(_0x970f('0x0'));module[_0x970f('0x1')]={'name':{'type':Sequelize[_0x970f('0x2')]},'description':{'type':Sequelize[_0x970f('0x2')]}};
\ No newline at end of file
+var _0xed96=['STRING'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xed96,0x1bc));var _0x6ed9=function(_0xab39a,_0x9d1016){_0xab39a=_0xab39a-0x0;var _0x17bbe2=_0xed96[_0xab39a];return _0x17bbe2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6ed9('0x0')]},'description':{'type':Sequelize[_0x6ed9('0x0')]}};
\ No newline at end of file
index 4b75034..1e4cbe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5aa9=['undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','FreshsalesConfiguration','rawAttributes','fieldName','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','keys','options','find','create','body','params','getSubjects','FreshsalesField','getDescriptions','findOne','getFields','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x2fc0ef,_0x2b4bda){var _0x3fd3c3=function(_0x7dd9da){while(--_0x7dd9da){_0x2fc0ef['push'](_0x2fc0ef['shift']());}};_0x3fd3c3(++_0x2b4bda);}(_0x5aa9,0x1c2));var _0x95aa=function(_0x5141a2,_0x3d81e5){_0x5141a2=_0x5141a2-0x0;var _0x9d6b28=_0x5aa9[_0x5141a2];return _0x9d6b28;};'use strict';var emlformat=require(_0x95aa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95aa('0x1'));var jsonpatch=require(_0x95aa('0x2'));var rp=require('request-promise');var moment=require(_0x95aa('0x3'));var BPromise=require(_0x95aa('0x4'));var Mustache=require(_0x95aa('0x5'));var util=require(_0x95aa('0x6'));var path=require(_0x95aa('0x7'));var sox=require('sox');var csv=require(_0x95aa('0x8'));var ejs=require(_0x95aa('0x9'));var fs=require('fs');var fs_extra=require(_0x95aa('0xa'));var _=require(_0x95aa('0xb'));var squel=require(_0x95aa('0xc'));var crypto=require(_0x95aa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x95aa('0xe'));var toCsv=require('to-csv');var querystring=require(_0x95aa('0xf'));var Papa=require(_0x95aa('0x10'));var Redis=require(_0x95aa('0x11'));var authService=require(_0x95aa('0x12'));var qs=require(_0x95aa('0x13'));var as=require(_0x95aa('0x14'));var hardwareService=require(_0x95aa('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x95aa('0x16'));var config=require(_0x95aa('0x17'));var licenseUtil=require(_0x95aa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x43419f,_0x38fec5){_0x38fec5=_0x38fec5||0xcc;return function(_0x2aad74){if(_0x2aad74){return _0x43419f[_0x95aa('0x19')](_0x38fec5);}return _0x43419f[_0x95aa('0x1a')](_0x38fec5)[_0x95aa('0x1b')]();};}function respondWithResult(_0xf13ae4,_0x118e33){_0x118e33=_0x118e33||0xc8;return function(_0x1474fe){if(_0x1474fe){return _0xf13ae4[_0x95aa('0x1a')](_0x118e33)[_0x95aa('0x1c')](_0x1474fe);}};}function respondWithFilteredResult(_0x3ded18,_0x360185){return function(_0x4b1034){if(_0x4b1034){var _0x3a6a42=typeof _0x360185[_0x95aa('0x1d')]===_0x95aa('0x1e')&&typeof _0x360185[_0x95aa('0x1f')]===_0x95aa('0x1e');var _0x171f1e=_0x4b1034['count'];var _0x4f71ff=_0x3a6a42?0x0:_0x360185[_0x95aa('0x1d')];var _0x220386=_0x3a6a42?_0x4b1034[_0x95aa('0x20')]:_0x360185['offset']+_0x360185[_0x95aa('0x1f')];var _0x16c923;if(_0x220386>=_0x171f1e){_0x220386=_0x171f1e;_0x16c923=0xc8;}else{_0x16c923=0xce;}_0x3ded18['status'](_0x16c923);return _0x3ded18[_0x95aa('0x21')](_0x95aa('0x22'),_0x4f71ff+'-'+_0x220386+'/'+_0x171f1e)[_0x95aa('0x1c')](_0x4b1034);}return null;};}function patchUpdates(_0x2b2118){return function(_0x2619ad){try{jsonpatch['apply'](_0x2619ad,_0x2b2118,!![]);}catch(_0x16803f){return BPromise['reject'](_0x16803f);}return _0x2619ad[_0x95aa('0x23')]();};}function saveUpdates(_0xdb823c,_0x2d963c){return function(_0x43f0c7){if(_0x43f0c7){return _0x43f0c7[_0x95aa('0x24')](_0xdb823c)[_0x95aa('0x25')](function(_0x3bde4d){return _0x3bde4d;});}return null;};}function removeEntity(_0x8b7e2c,_0x1553e0){return function(_0xb57563){if(_0xb57563){return _0xb57563[_0x95aa('0x26')]()[_0x95aa('0x25')](function(){_0x8b7e2c[_0x95aa('0x1a')](0xcc)[_0x95aa('0x1b')]();});}};}function handleEntityNotFound(_0x39e0a3,_0x1baec2){return function(_0x4ebc70){if(!_0x4ebc70){_0x39e0a3[_0x95aa('0x19')](0x194);}return _0x4ebc70;};}function handleError(_0x157b04,_0x26ef76){_0x26ef76=_0x26ef76||0x1f4;return function(_0x3b8f34){logger[_0x95aa('0x27')](_0x3b8f34[_0x95aa('0x28')]);if(_0x3b8f34[_0x95aa('0x29')]){delete _0x3b8f34['name'];}_0x157b04[_0x95aa('0x1a')](_0x26ef76)[_0x95aa('0x2a')](_0x3b8f34);};}exports['index']=function(_0x3ebf98,_0x205136){var _0x3f4d78={},_0x430297={},_0x25ecdf={'count':0x0,'rows':[]};var _0x5668d0=_['map'](db[_0x95aa('0x2b')][_0x95aa('0x2c')],function(_0xb3e04c){return{'name':_0xb3e04c[_0x95aa('0x2d')],'type':_0xb3e04c['type'][_0x95aa('0x2e')]};});_0x430297['model']=_[_0x95aa('0x2f')](_0x5668d0,'name');_0x430297[_0x95aa('0x30')]=_['keys'](_0x3ebf98[_0x95aa('0x30')]);_0x430297['filters']=_[_0x95aa('0x31')](_0x430297[_0x95aa('0x32')],_0x430297[_0x95aa('0x30')]);_0x3f4d78[_0x95aa('0x33')]=_[_0x95aa('0x31')](_0x430297['model'],qs[_0x95aa('0x34')](_0x3ebf98['query'][_0x95aa('0x34')]));_0x3f4d78['attributes']=_0x3f4d78['attributes'][_0x95aa('0x35')]?_0x3f4d78[_0x95aa('0x33')]:_0x430297[_0x95aa('0x32')];if(!_0x3ebf98[_0x95aa('0x30')][_0x95aa('0x36')](_0x95aa('0x37'))){_0x3f4d78[_0x95aa('0x1f')]=qs[_0x95aa('0x1f')](_0x3ebf98[_0x95aa('0x30')][_0x95aa('0x1f')]);_0x3f4d78[_0x95aa('0x1d')]=qs[_0x95aa('0x1d')](_0x3ebf98['query'][_0x95aa('0x1d')]);}_0x3f4d78[_0x95aa('0x38')]=qs[_0x95aa('0x39')](_0x3ebf98['query'][_0x95aa('0x39')]);_0x3f4d78[_0x95aa('0x3a')]=qs[_0x95aa('0x3b')](_[_0x95aa('0x3c')](_0x3ebf98['query'],_0x430297[_0x95aa('0x3b')]),_0x5668d0);if(_0x3ebf98[_0x95aa('0x30')][_0x95aa('0x3d')]){_0x3f4d78[_0x95aa('0x3a')]=_[_0x95aa('0x3e')](_0x3f4d78['where'],{'$or':_[_0x95aa('0x2f')](_0x5668d0,function(_0x51fd75){if(_0x51fd75[_0x95aa('0x3f')]!==_0x95aa('0x40')){var _0x456483={};_0x456483[_0x51fd75['name']]={'$like':'%'+_0x3ebf98[_0x95aa('0x30')][_0x95aa('0x3d')]+'%'};return _0x456483;}})});}_0x3f4d78=_[_0x95aa('0x3e')]({},_0x3f4d78,_0x3ebf98['options']);var _0xc0eb44={'where':_0x3f4d78[_0x95aa('0x3a')]};return db['FreshsalesConfiguration'][_0x95aa('0x20')](_0xc0eb44)[_0x95aa('0x25')](function(_0x22fd3d){_0x25ecdf['count']=_0x22fd3d;if(_0x3ebf98[_0x95aa('0x30')]['includeAll']){_0x3f4d78[_0x95aa('0x41')]=[{'all':!![]}];}return db[_0x95aa('0x2b')][_0x95aa('0x42')](_0x3f4d78);})[_0x95aa('0x25')](function(_0x1482e8){_0x25ecdf[_0x95aa('0x43')]=_0x1482e8;return _0x25ecdf;})[_0x95aa('0x25')](respondWithFilteredResult(_0x205136,_0x3f4d78))[_0x95aa('0x44')](handleError(_0x205136,null));};exports['show']=function(_0xc77ffd,_0x5f239b){var _0x31777a={'raw':![],'where':{'id':_0xc77ffd['params']['id']}},_0x2c11bc={};_0x2c11bc[_0x95aa('0x32')]=_[_0x95aa('0x45')](db[_0x95aa('0x2b')]['rawAttributes']);_0x2c11bc[_0x95aa('0x30')]=_[_0x95aa('0x45')](_0xc77ffd['query']);_0x2c11bc[_0x95aa('0x3b')]=_[_0x95aa('0x31')](_0x2c11bc[_0x95aa('0x32')],_0x2c11bc[_0x95aa('0x30')]);_0x31777a[_0x95aa('0x33')]=_[_0x95aa('0x31')](_0x2c11bc[_0x95aa('0x32')],qs[_0x95aa('0x34')](_0xc77ffd[_0x95aa('0x30')]['fields']));_0x31777a[_0x95aa('0x33')]=_0x31777a[_0x95aa('0x33')]['length']?_0x31777a[_0x95aa('0x33')]:_0x2c11bc['model'];if(_0xc77ffd[_0x95aa('0x30')]['includeAll']){_0x31777a[_0x95aa('0x41')]=[{'all':!![]}];}_0x31777a=_[_0x95aa('0x3e')]({},_0x31777a,_0xc77ffd[_0x95aa('0x46')]);return db[_0x95aa('0x2b')][_0x95aa('0x47')](_0x31777a)['then'](handleEntityNotFound(_0x5f239b,null))[_0x95aa('0x25')](respondWithResult(_0x5f239b,null))[_0x95aa('0x44')](handleError(_0x5f239b,null));};exports[_0x95aa('0x48')]=function(_0x1d6afe,_0x56de0b){return db[_0x95aa('0x2b')][_0x95aa('0x48')](_0x1d6afe[_0x95aa('0x49')],{})[_0x95aa('0x25')](respondWithResult(_0x56de0b,0xc9))[_0x95aa('0x44')](handleError(_0x56de0b,null));};exports[_0x95aa('0x24')]=function(_0x522f9e,_0x4ccd7b){if(_0x522f9e[_0x95aa('0x49')]['id']){delete _0x522f9e['body']['id'];}return db[_0x95aa('0x2b')]['find']({'where':{'id':_0x522f9e[_0x95aa('0x4a')]['id']}})[_0x95aa('0x25')](handleEntityNotFound(_0x4ccd7b,null))[_0x95aa('0x25')](saveUpdates(_0x522f9e[_0x95aa('0x49')],null))['then'](respondWithResult(_0x4ccd7b,null))[_0x95aa('0x44')](handleError(_0x4ccd7b,null));};exports[_0x95aa('0x26')]=function(_0x3a2d6c,_0xae6e10){return db[_0x95aa('0x2b')]['find']({'where':{'id':_0x3a2d6c[_0x95aa('0x4a')]['id']}})[_0x95aa('0x25')](handleEntityNotFound(_0xae6e10,null))[_0x95aa('0x25')](removeEntity(_0xae6e10,null))['catch'](handleError(_0xae6e10,null));};exports[_0x95aa('0x4b')]=function(_0x1d81c2,_0x7c718f,_0x38659b){var _0x17f356={};var _0x45683a={};var _0x4f19ca;var _0x197678;return db[_0x95aa('0x2b')]['findOne']({'where':{'id':_0x1d81c2[_0x95aa('0x4a')]['id']}})[_0x95aa('0x25')](handleEntityNotFound(_0x7c718f,null))[_0x95aa('0x25')](function(_0x353976){if(_0x353976){_0x4f19ca=_0x353976;_0x45683a[_0x95aa('0x32')]=_['keys'](db[_0x95aa('0x4c')][_0x95aa('0x2c')]);_0x45683a[_0x95aa('0x30')]=_[_0x95aa('0x45')](_0x1d81c2[_0x95aa('0x30')]);_0x45683a[_0x95aa('0x3b')]=_['intersection'](_0x45683a[_0x95aa('0x32')],_0x45683a['query']);_0x17f356['attributes']=_[_0x95aa('0x31')](_0x45683a[_0x95aa('0x32')],qs['fields'](_0x1d81c2[_0x95aa('0x30')][_0x95aa('0x34')]));_0x17f356[_0x95aa('0x33')]=_0x17f356[_0x95aa('0x33')][_0x95aa('0x35')]?_0x17f356[_0x95aa('0x33')]:_0x45683a['model'];_0x17f356[_0x95aa('0x38')]=qs[_0x95aa('0x39')](_0x1d81c2[_0x95aa('0x30')][_0x95aa('0x39')]);_0x17f356[_0x95aa('0x3a')]=qs['filters'](_['pick'](_0x1d81c2[_0x95aa('0x30')],_0x45683a[_0x95aa('0x3b')]));if(_0x1d81c2['query'][_0x95aa('0x3d')]){_0x17f356[_0x95aa('0x3a')]=_[_0x95aa('0x3e')](_0x17f356[_0x95aa('0x3a')],{'$or':_[_0x95aa('0x2f')](_0x17f356['attributes'],function(_0x1ce200){var _0x20e9d4={};_0x20e9d4[_0x1ce200]={'$like':'%'+_0x1d81c2[_0x95aa('0x30')][_0x95aa('0x3d')]+'%'};return _0x20e9d4;})});}_0x17f356=_['merge']({},_0x17f356,_0x1d81c2[_0x95aa('0x46')]);return _0x4f19ca[_0x95aa('0x4b')](_0x17f356);}})['then'](function(_0x588f63){if(_0x588f63){_0x197678=_0x588f63[_0x95aa('0x35')];if(!_0x1d81c2[_0x95aa('0x30')][_0x95aa('0x36')]('nolimit')){_0x17f356[_0x95aa('0x1f')]=qs['limit'](_0x1d81c2[_0x95aa('0x30')][_0x95aa('0x1f')]);_0x17f356['offset']=qs['offset'](_0x1d81c2[_0x95aa('0x30')][_0x95aa('0x1d')]);}return _0x4f19ca[_0x95aa('0x4b')](_0x17f356);}})[_0x95aa('0x25')](function(_0xe1e316){if(_0xe1e316){return _0xe1e316?{'count':_0x197678,'rows':_0xe1e316}:null;}})[_0x95aa('0x25')](respondWithResult(_0x7c718f,null))[_0x95aa('0x44')](handleError(_0x7c718f,null));};exports[_0x95aa('0x4d')]=function(_0x3a4b5c,_0x5dfc6b,_0x4e6886){var _0x481213={};var _0x24540c={};var _0x5cf83d;var _0x4e4686;return db[_0x95aa('0x2b')][_0x95aa('0x4e')]({'where':{'id':_0x3a4b5c['params']['id']}})['then'](handleEntityNotFound(_0x5dfc6b,null))[_0x95aa('0x25')](function(_0x201b48){if(_0x201b48){_0x5cf83d=_0x201b48;_0x24540c['model']=_[_0x95aa('0x45')](db[_0x95aa('0x4c')]['rawAttributes']);_0x24540c[_0x95aa('0x30')]=_[_0x95aa('0x45')](_0x3a4b5c[_0x95aa('0x30')]);_0x24540c[_0x95aa('0x3b')]=_['intersection'](_0x24540c[_0x95aa('0x32')],_0x24540c[_0x95aa('0x30')]);_0x481213[_0x95aa('0x33')]=_[_0x95aa('0x31')](_0x24540c['model'],qs[_0x95aa('0x34')](_0x3a4b5c[_0x95aa('0x30')][_0x95aa('0x34')]));_0x481213[_0x95aa('0x33')]=_0x481213['attributes'][_0x95aa('0x35')]?_0x481213[_0x95aa('0x33')]:_0x24540c[_0x95aa('0x32')];_0x481213[_0x95aa('0x38')]=qs[_0x95aa('0x39')](_0x3a4b5c['query']['sort']);_0x481213[_0x95aa('0x3a')]=qs[_0x95aa('0x3b')](_[_0x95aa('0x3c')](_0x3a4b5c[_0x95aa('0x30')],_0x24540c[_0x95aa('0x3b')]));if(_0x3a4b5c[_0x95aa('0x30')]['filter']){_0x481213[_0x95aa('0x3a')]=_[_0x95aa('0x3e')](_0x481213[_0x95aa('0x3a')],{'$or':_[_0x95aa('0x2f')](_0x481213[_0x95aa('0x33')],function(_0x2c43a5){var _0x1f4f2d={};_0x1f4f2d[_0x2c43a5]={'$like':'%'+_0x3a4b5c['query'][_0x95aa('0x3d')]+'%'};return _0x1f4f2d;})});}_0x481213=_[_0x95aa('0x3e')]({},_0x481213,_0x3a4b5c[_0x95aa('0x46')]);return _0x5cf83d[_0x95aa('0x4d')](_0x481213);}})[_0x95aa('0x25')](function(_0x25ddcb){if(_0x25ddcb){_0x4e4686=_0x25ddcb[_0x95aa('0x35')];if(!_0x3a4b5c[_0x95aa('0x30')][_0x95aa('0x36')](_0x95aa('0x37'))){_0x481213[_0x95aa('0x1f')]=qs[_0x95aa('0x1f')](_0x3a4b5c[_0x95aa('0x30')]['limit']);_0x481213[_0x95aa('0x1d')]=qs[_0x95aa('0x1d')](_0x3a4b5c[_0x95aa('0x30')]['offset']);}return _0x5cf83d[_0x95aa('0x4d')](_0x481213);}})[_0x95aa('0x25')](function(_0x47cb31){if(_0x47cb31){return _0x47cb31?{'count':_0x4e4686,'rows':_0x47cb31}:null;}})[_0x95aa('0x25')](respondWithResult(_0x5dfc6b,null))[_0x95aa('0x44')](handleError(_0x5dfc6b,null));};exports[_0x95aa('0x4f')]=function(_0x2b04fd,_0x4fc8f1,_0x560291){var _0x41af55={};var _0x5285d8={};var _0x2e5d1d;var _0x49d6fd;return db[_0x95aa('0x2b')][_0x95aa('0x4e')]({'where':{'id':_0x2b04fd[_0x95aa('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fc8f1,null))[_0x95aa('0x25')](function(_0x5609ba){if(_0x5609ba){_0x2e5d1d=_0x5609ba;_0x5285d8[_0x95aa('0x32')]=_[_0x95aa('0x45')](db['FreshsalesField'][_0x95aa('0x2c')]);_0x5285d8[_0x95aa('0x30')]=_[_0x95aa('0x45')](_0x2b04fd[_0x95aa('0x30')]);_0x5285d8[_0x95aa('0x3b')]=_['intersection'](_0x5285d8[_0x95aa('0x32')],_0x5285d8['query']);_0x41af55[_0x95aa('0x33')]=_[_0x95aa('0x31')](_0x5285d8[_0x95aa('0x32')],qs[_0x95aa('0x34')](_0x2b04fd[_0x95aa('0x30')][_0x95aa('0x34')]));_0x41af55['attributes']=_0x41af55[_0x95aa('0x33')]['length']?_0x41af55[_0x95aa('0x33')]:_0x5285d8[_0x95aa('0x32')];_0x41af55[_0x95aa('0x38')]=qs[_0x95aa('0x39')](_0x2b04fd['query'][_0x95aa('0x39')]);_0x41af55[_0x95aa('0x3a')]=qs[_0x95aa('0x3b')](_[_0x95aa('0x3c')](_0x2b04fd[_0x95aa('0x30')],_0x5285d8[_0x95aa('0x3b')]));if(_0x2b04fd[_0x95aa('0x30')][_0x95aa('0x3d')]){_0x41af55['where']=_[_0x95aa('0x3e')](_0x41af55[_0x95aa('0x3a')],{'$or':_[_0x95aa('0x2f')](_0x41af55['attributes'],function(_0x836f38){var _0xbc0683={};_0xbc0683[_0x836f38]={'$like':'%'+_0x2b04fd[_0x95aa('0x30')][_0x95aa('0x3d')]+'%'};return _0xbc0683;})});}_0x41af55=_[_0x95aa('0x3e')]({},_0x41af55,_0x2b04fd['options']);return _0x2e5d1d[_0x95aa('0x4f')](_0x41af55);}})['then'](function(_0x577056){if(_0x577056){_0x49d6fd=_0x577056['length'];if(!_0x2b04fd['query'][_0x95aa('0x36')](_0x95aa('0x37'))){_0x41af55[_0x95aa('0x1f')]=qs[_0x95aa('0x1f')](_0x2b04fd[_0x95aa('0x30')]['limit']);_0x41af55[_0x95aa('0x1d')]=qs[_0x95aa('0x1d')](_0x2b04fd[_0x95aa('0x30')][_0x95aa('0x1d')]);}return _0x2e5d1d['getFields'](_0x41af55);}})['then'](function(_0x39ab21){if(_0x39ab21){return _0x39ab21?{'count':_0x49d6fd,'rows':_0x39ab21}:null;}})[_0x95aa('0x25')](respondWithResult(_0x4fc8f1,null))[_0x95aa('0x44')](handleError(_0x4fc8f1,null));};
\ No newline at end of file
+var _0x5f25=['where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','findOne','getDescriptions','getFields','FreshsalesField','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter'];(function(_0x5bd11b,_0x48800d){var _0x1ad6ba=function(_0x5b4f07){while(--_0x5b4f07){_0x5bd11b['push'](_0x5bd11b['shift']());}};_0x1ad6ba(++_0x48800d);}(_0x5f25,0xfa));var _0x55f2=function(_0x39cdb8,_0x15ee98){_0x39cdb8=_0x39cdb8-0x0;var _0x44bbc9=_0x5f25[_0x39cdb8];return _0x44bbc9;};'use strict';var emlformat=require(_0x55f2('0x0'));var rimraf=require(_0x55f2('0x1'));var zipdir=require(_0x55f2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x55f2('0x3'));var BPromise=require(_0x55f2('0x4'));var Mustache=require('mustache');var util=require(_0x55f2('0x5'));var path=require(_0x55f2('0x6'));var sox=require(_0x55f2('0x7'));var csv=require(_0x55f2('0x8'));var ejs=require(_0x55f2('0x9'));var fs=require('fs');var fs_extra=require(_0x55f2('0xa'));var _=require(_0x55f2('0xb'));var squel=require('squel');var crypto=require(_0x55f2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x55f2('0xd'));var Papa=require(_0x55f2('0xe'));var Redis=require(_0x55f2('0xf'));var authService=require(_0x55f2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x55f2('0x11'));var logger=require(_0x55f2('0x12'))(_0x55f2('0x13'));var utils=require('../../config/utils');var config=require(_0x55f2('0x14'));var licenseUtil=require(_0x55f2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2509ed,_0x36276f){_0x36276f=_0x36276f||0xcc;return function(_0x5c0f70){if(_0x5c0f70){return _0x2509ed[_0x55f2('0x16')](_0x36276f);}return _0x2509ed[_0x55f2('0x17')](_0x36276f)[_0x55f2('0x18')]();};}function respondWithResult(_0xc24ba0,_0x23d4f9){_0x23d4f9=_0x23d4f9||0xc8;return function(_0x1cf9c3){if(_0x1cf9c3){return _0xc24ba0['status'](_0x23d4f9)['json'](_0x1cf9c3);}};}function respondWithFilteredResult(_0x421dc9,_0x7281c5){return function(_0x5e95a4){if(_0x5e95a4){var _0x1a5c2a=typeof _0x7281c5[_0x55f2('0x19')]===_0x55f2('0x1a')&&typeof _0x7281c5[_0x55f2('0x1b')]===_0x55f2('0x1a');var _0x37b070=_0x5e95a4[_0x55f2('0x1c')];var _0x419a18=_0x1a5c2a?0x0:_0x7281c5[_0x55f2('0x19')];var _0x202b6b=_0x1a5c2a?_0x5e95a4[_0x55f2('0x1c')]:_0x7281c5[_0x55f2('0x19')]+_0x7281c5[_0x55f2('0x1b')];var _0x13c133;if(_0x202b6b>=_0x37b070){_0x202b6b=_0x37b070;_0x13c133=0xc8;}else{_0x13c133=0xce;}_0x421dc9[_0x55f2('0x17')](_0x13c133);return _0x421dc9[_0x55f2('0x1d')]('Content-Range',_0x419a18+'-'+_0x202b6b+'/'+_0x37b070)[_0x55f2('0x1e')](_0x5e95a4);}return null;};}function patchUpdates(_0x5ce6d5){return function(_0x557327){try{jsonpatch[_0x55f2('0x1f')](_0x557327,_0x5ce6d5,!![]);}catch(_0x48f374){return BPromise[_0x55f2('0x20')](_0x48f374);}return _0x557327[_0x55f2('0x21')]();};}function saveUpdates(_0x1474dc,_0x3e6a63){return function(_0x4f2a95){if(_0x4f2a95){return _0x4f2a95[_0x55f2('0x22')](_0x1474dc)['then'](function(_0x3eb145){return _0x3eb145;});}return null;};}function removeEntity(_0x118eba,_0x2ce775){return function(_0xa8169a){if(_0xa8169a){return _0xa8169a[_0x55f2('0x23')]()[_0x55f2('0x24')](function(){_0x118eba[_0x55f2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195bfe,_0x152d63){return function(_0x1d5927){if(!_0x1d5927){_0x195bfe[_0x55f2('0x16')](0x194);}return _0x1d5927;};}function handleError(_0x648b23,_0x2d3ef6){_0x2d3ef6=_0x2d3ef6||0x1f4;return function(_0x28cd5c){logger['error'](_0x28cd5c[_0x55f2('0x25')]);if(_0x28cd5c[_0x55f2('0x26')]){delete _0x28cd5c[_0x55f2('0x26')];}_0x648b23[_0x55f2('0x17')](_0x2d3ef6)[_0x55f2('0x27')](_0x28cd5c);};}exports[_0x55f2('0x28')]=function(_0x278fa0,_0x4f9e9b){var _0x3d29e7={},_0x39fb89={},_0x1dd931={'count':0x0,'rows':[]};var _0x3ba0ab=_['map'](db[_0x55f2('0x29')][_0x55f2('0x2a')],function(_0x359759){return{'name':_0x359759[_0x55f2('0x2b')],'type':_0x359759[_0x55f2('0x2c')][_0x55f2('0x2d')]};});_0x39fb89[_0x55f2('0x2e')]=_['map'](_0x3ba0ab,_0x55f2('0x26'));_0x39fb89['query']=_['keys'](_0x278fa0[_0x55f2('0x2f')]);_0x39fb89[_0x55f2('0x30')]=_['intersection'](_0x39fb89[_0x55f2('0x2e')],_0x39fb89[_0x55f2('0x2f')]);_0x3d29e7[_0x55f2('0x31')]=_[_0x55f2('0x32')](_0x39fb89[_0x55f2('0x2e')],qs[_0x55f2('0x33')](_0x278fa0[_0x55f2('0x2f')][_0x55f2('0x33')]));_0x3d29e7['attributes']=_0x3d29e7[_0x55f2('0x31')][_0x55f2('0x34')]?_0x3d29e7[_0x55f2('0x31')]:_0x39fb89[_0x55f2('0x2e')];if(!_0x278fa0[_0x55f2('0x2f')][_0x55f2('0x35')]('nolimit')){_0x3d29e7[_0x55f2('0x1b')]=qs[_0x55f2('0x1b')](_0x278fa0[_0x55f2('0x2f')][_0x55f2('0x1b')]);_0x3d29e7[_0x55f2('0x19')]=qs[_0x55f2('0x19')](_0x278fa0[_0x55f2('0x2f')][_0x55f2('0x19')]);}_0x3d29e7[_0x55f2('0x36')]=qs[_0x55f2('0x37')](_0x278fa0['query']['sort']);_0x3d29e7['where']=qs['filters'](_[_0x55f2('0x38')](_0x278fa0[_0x55f2('0x2f')],_0x39fb89[_0x55f2('0x30')]),_0x3ba0ab);if(_0x278fa0[_0x55f2('0x2f')][_0x55f2('0x39')]){_0x3d29e7[_0x55f2('0x3a')]=_[_0x55f2('0x3b')](_0x3d29e7[_0x55f2('0x3a')],{'$or':_[_0x55f2('0x3c')](_0x3ba0ab,function(_0x2fd3bc){if(_0x2fd3bc[_0x55f2('0x2c')]!==_0x55f2('0x3d')){var _0x270b1f={};_0x270b1f[_0x2fd3bc[_0x55f2('0x26')]]={'$like':'%'+_0x278fa0['query'][_0x55f2('0x39')]+'%'};return _0x270b1f;}})});}_0x3d29e7=_[_0x55f2('0x3b')]({},_0x3d29e7,_0x278fa0[_0x55f2('0x3e')]);var _0x5d17e9={'where':_0x3d29e7[_0x55f2('0x3a')]};return db['FreshsalesConfiguration'][_0x55f2('0x1c')](_0x5d17e9)[_0x55f2('0x24')](function(_0x3376d5){_0x1dd931[_0x55f2('0x1c')]=_0x3376d5;if(_0x278fa0['query'][_0x55f2('0x3f')]){_0x3d29e7[_0x55f2('0x40')]=[{'all':!![]}];}return db[_0x55f2('0x29')][_0x55f2('0x41')](_0x3d29e7);})['then'](function(_0x125b45){_0x1dd931[_0x55f2('0x42')]=_0x125b45;return _0x1dd931;})[_0x55f2('0x24')](respondWithFilteredResult(_0x4f9e9b,_0x3d29e7))['catch'](handleError(_0x4f9e9b,null));};exports['show']=function(_0x35ed56,_0x26c607){var _0x4e2124={'raw':![],'where':{'id':_0x35ed56[_0x55f2('0x43')]['id']}},_0x4eb5cf={};_0x4eb5cf['model']=_['keys'](db[_0x55f2('0x29')][_0x55f2('0x2a')]);_0x4eb5cf[_0x55f2('0x2f')]=_[_0x55f2('0x44')](_0x35ed56[_0x55f2('0x2f')]);_0x4eb5cf[_0x55f2('0x30')]=_[_0x55f2('0x32')](_0x4eb5cf['model'],_0x4eb5cf['query']);_0x4e2124[_0x55f2('0x31')]=_[_0x55f2('0x32')](_0x4eb5cf[_0x55f2('0x2e')],qs[_0x55f2('0x33')](_0x35ed56[_0x55f2('0x2f')][_0x55f2('0x33')]));_0x4e2124['attributes']=_0x4e2124[_0x55f2('0x31')][_0x55f2('0x34')]?_0x4e2124[_0x55f2('0x31')]:_0x4eb5cf['model'];if(_0x35ed56[_0x55f2('0x2f')][_0x55f2('0x3f')]){_0x4e2124[_0x55f2('0x40')]=[{'all':!![]}];}_0x4e2124=_[_0x55f2('0x3b')]({},_0x4e2124,_0x35ed56[_0x55f2('0x3e')]);return db['FreshsalesConfiguration'][_0x55f2('0x45')](_0x4e2124)[_0x55f2('0x24')](handleEntityNotFound(_0x26c607,null))[_0x55f2('0x24')](respondWithResult(_0x26c607,null))[_0x55f2('0x46')](handleError(_0x26c607,null));};exports[_0x55f2('0x47')]=function(_0x36e5e9,_0x31fcf7){return db[_0x55f2('0x29')][_0x55f2('0x47')](_0x36e5e9['body'],{})[_0x55f2('0x24')](respondWithResult(_0x31fcf7,0xc9))[_0x55f2('0x46')](handleError(_0x31fcf7,null));};exports[_0x55f2('0x22')]=function(_0x421b94,_0x21a5a4){if(_0x421b94[_0x55f2('0x48')]['id']){delete _0x421b94[_0x55f2('0x48')]['id'];}return db['FreshsalesConfiguration'][_0x55f2('0x45')]({'where':{'id':_0x421b94[_0x55f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x21a5a4,null))['then'](saveUpdates(_0x421b94[_0x55f2('0x48')],null))[_0x55f2('0x24')](respondWithResult(_0x21a5a4,null))[_0x55f2('0x46')](handleError(_0x21a5a4,null));};exports['destroy']=function(_0xbec0c3,_0x25a6a5){return db[_0x55f2('0x29')][_0x55f2('0x45')]({'where':{'id':_0xbec0c3[_0x55f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x25a6a5,null))[_0x55f2('0x24')](removeEntity(_0x25a6a5,null))[_0x55f2('0x46')](handleError(_0x25a6a5,null));};exports['getSubjects']=function(_0x440aca,_0x319c1b,_0x5938f3){var _0x1cd27a={};var _0x388273={};var _0x3cd038;var _0x243d80;return db['FreshsalesConfiguration'][_0x55f2('0x49')]({'where':{'id':_0x440aca[_0x55f2('0x43')]['id']}})[_0x55f2('0x24')](handleEntityNotFound(_0x319c1b,null))[_0x55f2('0x24')](function(_0x78a5a5){if(_0x78a5a5){_0x3cd038=_0x78a5a5;_0x388273[_0x55f2('0x2e')]=_[_0x55f2('0x44')](db['FreshsalesField'][_0x55f2('0x2a')]);_0x388273[_0x55f2('0x2f')]=_[_0x55f2('0x44')](_0x440aca[_0x55f2('0x2f')]);_0x388273['filters']=_['intersection'](_0x388273[_0x55f2('0x2e')],_0x388273[_0x55f2('0x2f')]);_0x1cd27a[_0x55f2('0x31')]=_[_0x55f2('0x32')](_0x388273[_0x55f2('0x2e')],qs[_0x55f2('0x33')](_0x440aca['query'][_0x55f2('0x33')]));_0x1cd27a['attributes']=_0x1cd27a[_0x55f2('0x31')][_0x55f2('0x34')]?_0x1cd27a[_0x55f2('0x31')]:_0x388273[_0x55f2('0x2e')];_0x1cd27a['order']=qs[_0x55f2('0x37')](_0x440aca[_0x55f2('0x2f')][_0x55f2('0x37')]);_0x1cd27a[_0x55f2('0x3a')]=qs[_0x55f2('0x30')](_[_0x55f2('0x38')](_0x440aca[_0x55f2('0x2f')],_0x388273[_0x55f2('0x30')]));if(_0x440aca[_0x55f2('0x2f')][_0x55f2('0x39')]){_0x1cd27a[_0x55f2('0x3a')]=_['merge'](_0x1cd27a['where'],{'$or':_[_0x55f2('0x3c')](_0x1cd27a[_0x55f2('0x31')],function(_0x43e22f){var _0x2fb337={};_0x2fb337[_0x43e22f]={'$like':'%'+_0x440aca[_0x55f2('0x2f')][_0x55f2('0x39')]+'%'};return _0x2fb337;})});}_0x1cd27a=_[_0x55f2('0x3b')]({},_0x1cd27a,_0x440aca['options']);return _0x3cd038['getSubjects'](_0x1cd27a);}})[_0x55f2('0x24')](function(_0x9c803d){if(_0x9c803d){_0x243d80=_0x9c803d['length'];if(!_0x440aca['query'][_0x55f2('0x35')]('nolimit')){_0x1cd27a[_0x55f2('0x1b')]=qs['limit'](_0x440aca[_0x55f2('0x2f')]['limit']);_0x1cd27a[_0x55f2('0x19')]=qs[_0x55f2('0x19')](_0x440aca[_0x55f2('0x2f')][_0x55f2('0x19')]);}return _0x3cd038['getSubjects'](_0x1cd27a);}})['then'](function(_0x41da40){if(_0x41da40){return _0x41da40?{'count':_0x243d80,'rows':_0x41da40}:null;}})[_0x55f2('0x24')](respondWithResult(_0x319c1b,null))['catch'](handleError(_0x319c1b,null));};exports[_0x55f2('0x4a')]=function(_0x2cf910,_0x463b29,_0x5b8eb3){var _0x227c19={};var _0x45453f={};var _0x16cc77;var _0x5ca2d3;return db[_0x55f2('0x29')][_0x55f2('0x49')]({'where':{'id':_0x2cf910[_0x55f2('0x43')]['id']}})[_0x55f2('0x24')](handleEntityNotFound(_0x463b29,null))[_0x55f2('0x24')](function(_0x3cf859){if(_0x3cf859){_0x16cc77=_0x3cf859;_0x45453f['model']=_[_0x55f2('0x44')](db['FreshsalesField'][_0x55f2('0x2a')]);_0x45453f[_0x55f2('0x2f')]=_[_0x55f2('0x44')](_0x2cf910[_0x55f2('0x2f')]);_0x45453f[_0x55f2('0x30')]=_['intersection'](_0x45453f[_0x55f2('0x2e')],_0x45453f[_0x55f2('0x2f')]);_0x227c19[_0x55f2('0x31')]=_[_0x55f2('0x32')](_0x45453f[_0x55f2('0x2e')],qs[_0x55f2('0x33')](_0x2cf910['query']['fields']));_0x227c19[_0x55f2('0x31')]=_0x227c19[_0x55f2('0x31')][_0x55f2('0x34')]?_0x227c19[_0x55f2('0x31')]:_0x45453f['model'];_0x227c19['order']=qs[_0x55f2('0x37')](_0x2cf910[_0x55f2('0x2f')][_0x55f2('0x37')]);_0x227c19['where']=qs['filters'](_['pick'](_0x2cf910[_0x55f2('0x2f')],_0x45453f[_0x55f2('0x30')]));if(_0x2cf910[_0x55f2('0x2f')][_0x55f2('0x39')]){_0x227c19['where']=_['merge'](_0x227c19[_0x55f2('0x3a')],{'$or':_[_0x55f2('0x3c')](_0x227c19[_0x55f2('0x31')],function(_0x14dcdf){var _0x369812={};_0x369812[_0x14dcdf]={'$like':'%'+_0x2cf910[_0x55f2('0x2f')][_0x55f2('0x39')]+'%'};return _0x369812;})});}_0x227c19=_['merge']({},_0x227c19,_0x2cf910[_0x55f2('0x3e')]);return _0x16cc77[_0x55f2('0x4a')](_0x227c19);}})[_0x55f2('0x24')](function(_0x3e94d7){if(_0x3e94d7){_0x5ca2d3=_0x3e94d7[_0x55f2('0x34')];if(!_0x2cf910[_0x55f2('0x2f')][_0x55f2('0x35')]('nolimit')){_0x227c19[_0x55f2('0x1b')]=qs[_0x55f2('0x1b')](_0x2cf910['query'][_0x55f2('0x1b')]);_0x227c19[_0x55f2('0x19')]=qs[_0x55f2('0x19')](_0x2cf910[_0x55f2('0x2f')]['offset']);}return _0x16cc77['getDescriptions'](_0x227c19);}})['then'](function(_0x7cd6bd){if(_0x7cd6bd){return _0x7cd6bd?{'count':_0x5ca2d3,'rows':_0x7cd6bd}:null;}})[_0x55f2('0x24')](respondWithResult(_0x463b29,null))[_0x55f2('0x46')](handleError(_0x463b29,null));};exports[_0x55f2('0x4b')]=function(_0x119ac5,_0x170d62,_0x4ddb70){var _0x120a30={};var _0x14fa3a={};var _0x584e38;var _0x3f8378;return db[_0x55f2('0x29')][_0x55f2('0x49')]({'where':{'id':_0x119ac5[_0x55f2('0x43')]['id']}})['then'](handleEntityNotFound(_0x170d62,null))[_0x55f2('0x24')](function(_0x531876){if(_0x531876){_0x584e38=_0x531876;_0x14fa3a[_0x55f2('0x2e')]=_[_0x55f2('0x44')](db[_0x55f2('0x4c')][_0x55f2('0x2a')]);_0x14fa3a[_0x55f2('0x2f')]=_[_0x55f2('0x44')](_0x119ac5['query']);_0x14fa3a['filters']=_[_0x55f2('0x32')](_0x14fa3a['model'],_0x14fa3a[_0x55f2('0x2f')]);_0x120a30[_0x55f2('0x31')]=_['intersection'](_0x14fa3a['model'],qs['fields'](_0x119ac5[_0x55f2('0x2f')][_0x55f2('0x33')]));_0x120a30['attributes']=_0x120a30[_0x55f2('0x31')][_0x55f2('0x34')]?_0x120a30[_0x55f2('0x31')]:_0x14fa3a['model'];_0x120a30['order']=qs['sort'](_0x119ac5[_0x55f2('0x2f')][_0x55f2('0x37')]);_0x120a30['where']=qs[_0x55f2('0x30')](_['pick'](_0x119ac5['query'],_0x14fa3a[_0x55f2('0x30')]));if(_0x119ac5[_0x55f2('0x2f')][_0x55f2('0x39')]){_0x120a30['where']=_[_0x55f2('0x3b')](_0x120a30[_0x55f2('0x3a')],{'$or':_[_0x55f2('0x3c')](_0x120a30[_0x55f2('0x31')],function(_0x1d68c6){var _0xd91571={};_0xd91571[_0x1d68c6]={'$like':'%'+_0x119ac5[_0x55f2('0x2f')][_0x55f2('0x39')]+'%'};return _0xd91571;})});}_0x120a30=_[_0x55f2('0x3b')]({},_0x120a30,_0x119ac5[_0x55f2('0x3e')]);return _0x584e38[_0x55f2('0x4b')](_0x120a30);}})[_0x55f2('0x24')](function(_0x3f36f9){if(_0x3f36f9){_0x3f8378=_0x3f36f9[_0x55f2('0x34')];if(!_0x119ac5['query'][_0x55f2('0x35')]('nolimit')){_0x120a30['limit']=qs[_0x55f2('0x1b')](_0x119ac5[_0x55f2('0x2f')]['limit']);_0x120a30[_0x55f2('0x19')]=qs[_0x55f2('0x19')](_0x119ac5['query'][_0x55f2('0x19')]);}return _0x584e38[_0x55f2('0x4b')](_0x120a30);}})['then'](function(_0x11ed26){if(_0x11ed26){return _0x11ed26?{'count':_0x3f8378,'rows':_0x11ed26}:null;}})['then'](respondWithResult(_0x170d62,null))[_0x55f2('0x46')](handleError(_0x170d62,null));};
\ No newline at end of file
index 8b160a6..7c470d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0833=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x0833,0x113));var _0x3083=function(_0x405787,_0xdf605c){_0x405787=_0x405787-0x0;var _0x3aa71f=_0x0833[_0x405787];return _0x3aa71f;};'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(_0x3083('0x5'));var fs=require('fs');var path=require(_0x3083('0x6'));var rimraf=require(_0x3083('0x7'));var config=require(_0x3083('0x8'));var attributes=require(_0x3083('0x9'));module[_0x3083('0xa')]=function(_0x20ccd1,_0x2de1f0){return _0x20ccd1['define']('FreshsalesConfiguration',attributes,{'tableName':_0x3083('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0201=['./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0x0201,0xdf));var _0x1020=function(_0x17301a,_0x530ead){_0x17301a=_0x17301a-0x0;var _0x216082=_0x0201[_0x17301a];return _0x216082;};'use strict';var _=require(_0x1020('0x0'));var util=require(_0x1020('0x1'));var logger=require(_0x1020('0x2'))('api');var moment=require(_0x1020('0x3'));var BPromise=require('bluebird');var rp=require(_0x1020('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1020('0x5'));var config=require(_0x1020('0x6'));var attributes=require(_0x1020('0x7'));module[_0x1020('0x8')]=function(_0x28b46e,_0xc9e6c0){return _0x28b46e['define']('FreshsalesConfiguration',attributes,{'tableName':_0x1020('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 761628d..8353e38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6095=['result','catch','lodash','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent'];(function(_0x1eb1b2,_0x26b6b7){var _0x2f520a=function(_0x493622){while(--_0x493622){_0x1eb1b2['push'](_0x1eb1b2['shift']());}};_0x2f520a(++_0x26b6b7);}(_0x6095,0xde));var _0x5609=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x6095[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x5609('0x0'));var util=require('util');var moment=require(_0x5609('0x1'));var BPromise=require('bluebird');var rs=require(_0x5609('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5609('0x3'));var logger=require('../../config/logger')(_0x5609('0x4'));var config=require(_0x5609('0x5'));var jayson=require(_0x5609('0x6'));var client=jayson[_0x5609('0x7')][_0x5609('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48b3a6,_0x4d884e,_0x1f5aad){return new BPromise(function(_0x187cb4,_0xe5922e){return client[_0x5609('0x9')](_0x48b3a6,_0x1f5aad)['then'](function(_0x37ecc9){logger[_0x5609('0xa')](_0x5609('0xb'),_0x4d884e,'request\x20sent');logger[_0x5609('0xc')](_0x5609('0xd'),_0x4d884e,'request\x20sent',JSON['stringify'](_0x37ecc9));if(_0x37ecc9[_0x5609('0xe')]){if(_0x37ecc9[_0x5609('0xe')][_0x5609('0xf')]===0x1f4){logger[_0x5609('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d884e,_0x37ecc9['error'][_0x5609('0x10')]);return _0xe5922e(_0x37ecc9['error'][_0x5609('0x10')]);}logger[_0x5609('0xe')](_0x5609('0xb'),_0x4d884e,_0x37ecc9[_0x5609('0xe')][_0x5609('0x10')]);return _0x187cb4(_0x37ecc9['error'][_0x5609('0x10')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d884e,_0x5609('0x11'));_0x187cb4(_0x37ecc9[_0x5609('0x12')][_0x5609('0x10')]);}})[_0x5609('0x13')](function(_0x39d9bb){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4d884e,_0x39d9bb);_0xe5922e(_0x39d9bb);});});}
\ No newline at end of file
+var _0xdf39=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x1da398,_0x170497){var _0x3ad972=function(_0x1350de){while(--_0x1350de){_0x1da398['push'](_0x1da398['shift']());}};_0x3ad972(++_0x170497);}(_0xdf39,0x159));var _0x9df3=function(_0x4f4f3d,_0x2cc448){_0x4f4f3d=_0x4f4f3d-0x0;var _0x4ac4a3=_0xdf39[_0x4f4f3d];return _0x4ac4a3;};'use strict';var _=require(_0x9df3('0x0'));var util=require(_0x9df3('0x1'));var moment=require(_0x9df3('0x2'));var BPromise=require(_0x9df3('0x3'));var rs=require(_0x9df3('0x4'));var fs=require('fs');var Redis=require(_0x9df3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9df3('0x6'));var logger=require(_0x9df3('0x7'))(_0x9df3('0x8'));var config=require(_0x9df3('0x9'));var jayson=require(_0x9df3('0xa'));var client=jayson[_0x9df3('0xb')][_0x9df3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x305f2b,_0x228eda,_0x4076b0){return new BPromise(function(_0x149005,_0x38e51b){return client[_0x9df3('0xd')](_0x305f2b,_0x4076b0)[_0x9df3('0xe')](function(_0x513c14){logger[_0x9df3('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x228eda,_0x9df3('0x10'));logger[_0x9df3('0x11')](_0x9df3('0x12'),_0x228eda,_0x9df3('0x10'),JSON[_0x9df3('0x13')](_0x513c14));if(_0x513c14[_0x9df3('0x14')]){if(_0x513c14[_0x9df3('0x14')][_0x9df3('0x15')]===0x1f4){logger[_0x9df3('0x14')](_0x9df3('0x16'),_0x228eda,_0x513c14[_0x9df3('0x14')]['message']);return _0x38e51b(_0x513c14[_0x9df3('0x14')][_0x9df3('0x17')]);}logger[_0x9df3('0x14')](_0x9df3('0x16'),_0x228eda,_0x513c14[_0x9df3('0x14')][_0x9df3('0x17')]);return _0x149005(_0x513c14[_0x9df3('0x14')][_0x9df3('0x17')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x228eda,_0x9df3('0x10'));_0x149005(_0x513c14[_0x9df3('0x18')][_0x9df3('0x17')]);}})['catch'](function(_0xcf82b0){logger[_0x9df3('0x14')](_0x9df3('0x16'),_0x228eda,_0xcf82b0);_0x38e51b(_0xcf82b0);});});}
\ No newline at end of file
index 130144e..35f0f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63eb=['./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x63eb,0x90));var _0xb63e=function(_0x294f4d,_0x374007){_0x294f4d=_0x294f4d-0x0;var _0x21f1be=_0x63eb[_0x294f4d];return _0x21f1be;};'use strict';var multer=require(_0xb63e('0x0'));var util=require(_0xb63e('0x1'));var path=require(_0xb63e('0x2'));var timeout=require(_0xb63e('0x3'));var express=require(_0xb63e('0x4'));var router=express[_0xb63e('0x5')]();var fs_extra=require(_0xb63e('0x6'));var auth=require(_0xb63e('0x7'));var interaction=require(_0xb63e('0x8'));var config=require(_0xb63e('0x9'));var controller=require(_0xb63e('0xa'));router[_0xb63e('0xb')]('/',auth[_0xb63e('0xc')](),controller[_0xb63e('0xd')]);router[_0xb63e('0xb')](_0xb63e('0xe'),auth[_0xb63e('0xc')](),controller[_0xb63e('0xf')]);router[_0xb63e('0x10')]('/',auth[_0xb63e('0xc')](),controller[_0xb63e('0x11')]);router['put'](_0xb63e('0xe'),auth['isAuthenticated'](),controller[_0xb63e('0x12')]);router[_0xb63e('0x13')](_0xb63e('0xe'),auth['isAuthenticated'](),controller[_0xb63e('0x14')]);module[_0xb63e('0x15')]=router;
\ No newline at end of file
+var _0xc576=['connect-timeout','express','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','get','/:id','show','create','update','delete','destroy','exports','multer','util','path'];(function(_0x446b17,_0xc400cf){var _0x2621cd=function(_0x4307b2){while(--_0x4307b2){_0x446b17['push'](_0x446b17['shift']());}};_0x2621cd(++_0xc400cf);}(_0xc576,0x1ea));var _0x6c57=function(_0x424bd3,_0x8760d8){_0x424bd3=_0x424bd3-0x0;var _0x1fdade=_0xc576[_0x424bd3];return _0x1fdade;};'use strict';var multer=require(_0x6c57('0x0'));var util=require(_0x6c57('0x1'));var path=require(_0x6c57('0x2'));var timeout=require(_0x6c57('0x3'));var express=require(_0x6c57('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6c57('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6c57('0x6'));var controller=require(_0x6c57('0x7'));router['get']('/',auth[_0x6c57('0x8')](),controller['index']);router[_0x6c57('0x9')](_0x6c57('0xa'),auth['isAuthenticated'](),controller[_0x6c57('0xb')]);router['post']('/',auth[_0x6c57('0x8')](),controller[_0x6c57('0xc')]);router['put'](_0x6c57('0xa'),auth[_0x6c57('0x8')](),controller[_0x6c57('0xd')]);router[_0x6c57('0xe')]('/:id',auth[_0x6c57('0x8')](),controller[_0x6c57('0xf')]);module[_0x6c57('0x10')]=router;
\ No newline at end of file
index 1a39b1d..6685353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc9d=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x39bc03,_0x29f7c2){var _0x2f22f7=function(_0x4bd0e9){while(--_0x4bd0e9){_0x39bc03['push'](_0x39bc03['shift']());}};_0x2f22f7(++_0x29f7c2);}(_0xfc9d,0x1de));var _0xdfc9=function(_0x461f4c,_0x4c293d){_0x461f4c=_0x461f4c-0x0;var _0x299260=_0xfc9d[_0x461f4c];return _0x299260;};'use strict';var Sequelize=require(_0xdfc9('0x0'));module[_0xdfc9('0x1')]={'type':{'type':Sequelize[_0xdfc9('0x2')](_0xdfc9('0x3'),_0xdfc9('0x4'),_0xdfc9('0x5'),'keyValue',_0xdfc9('0x6')),'defaultValue':_0xdfc9('0x3')},'content':{'type':Sequelize[_0xdfc9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xdfc9('0x2')]('string',_0xdfc9('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xdfc9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xdfc9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdfc9('0x7')]}};
\ No newline at end of file
+var _0xb891=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize','ENUM'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb891,0x166));var _0x1b89=function(_0x571833,_0x5383e8){_0x571833=_0x571833-0x0;var _0x38bc03=_0xb891[_0x571833];return _0x38bc03;};'use strict';var Sequelize=require(_0x1b89('0x0'));module['exports']={'type':{'type':Sequelize[_0x1b89('0x1')]('string','variable',_0x1b89('0x2'),_0x1b89('0x3'),_0x1b89('0x4')),'defaultValue':_0x1b89('0x5')},'content':{'type':Sequelize[_0x1b89('0x6')]},'key':{'type':Sequelize[_0x1b89('0x6')]},'keyType':{'type':Sequelize[_0x1b89('0x1')](_0x1b89('0x5'),'variable',_0x1b89('0x2'))},'keyContent':{'type':Sequelize[_0x1b89('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1b89('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1b89('0x6')]}};
\ No newline at end of file
index 182c100..eb25b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf16d=['include','findAll','show','params','includeAll','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','reject','then','destroy','sendStatus','error','send','index','FreshsalesField','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','VIRTUAL'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0xf16d,0x169));var _0xdf16=function(_0xfe977e,_0x3cb4bd){_0xfe977e=_0xfe977e-0x0;var _0x1b1e1e=_0xf16d[_0xfe977e];return _0x1b1e1e;};'use strict';var emlformat=require(_0xdf16('0x0'));var rimraf=require(_0xdf16('0x1'));var zipdir=require(_0xdf16('0x2'));var jsonpatch=require(_0xdf16('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdf16('0x4'));var util=require(_0xdf16('0x5'));var path=require('path');var sox=require(_0xdf16('0x6'));var csv=require('to-csv');var ejs=require(_0xdf16('0x7'));var fs=require('fs');var fs_extra=require(_0xdf16('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf16('0x9'));var deskjs=require(_0xdf16('0xa'));var toCsv=require(_0xdf16('0xb'));var querystring=require(_0xdf16('0xc'));var Papa=require(_0xdf16('0xd'));var Redis=require('ioredis');var authService=require(_0xdf16('0xe'));var qs=require(_0xdf16('0xf'));var as=require(_0xdf16('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf16('0x11'))(_0xdf16('0x12'));var utils=require(_0xdf16('0x13'));var config=require(_0xdf16('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf16('0x15'))['db'];function respondWithStatusCode(_0x3f4135,_0x58b06f){_0x58b06f=_0x58b06f||0xcc;return function(_0x4f8e5e){if(_0x4f8e5e){return _0x3f4135['sendStatus'](_0x58b06f);}return _0x3f4135[_0xdf16('0x16')](_0x58b06f)[_0xdf16('0x17')]();};}function respondWithResult(_0x59cd65,_0x12b5ce){_0x12b5ce=_0x12b5ce||0xc8;return function(_0x2c5cd0){if(_0x2c5cd0){return _0x59cd65[_0xdf16('0x16')](_0x12b5ce)[_0xdf16('0x18')](_0x2c5cd0);}};}function respondWithFilteredResult(_0x407c7b,_0x1f83ab){return function(_0x491f5f){if(_0x491f5f){var _0x3eabcc=typeof _0x1f83ab[_0xdf16('0x19')]===_0xdf16('0x1a')&&typeof _0x1f83ab['limit']===_0xdf16('0x1a');var _0x3a96df=_0x491f5f[_0xdf16('0x1b')];var _0x1bd5df=_0x3eabcc?0x0:_0x1f83ab['offset'];var _0x5716f9=_0x3eabcc?_0x491f5f['count']:_0x1f83ab[_0xdf16('0x19')]+_0x1f83ab['limit'];var _0x5f023f;if(_0x5716f9>=_0x3a96df){_0x5716f9=_0x3a96df;_0x5f023f=0xc8;}else{_0x5f023f=0xce;}_0x407c7b[_0xdf16('0x16')](_0x5f023f);return _0x407c7b['set'](_0xdf16('0x1c'),_0x1bd5df+'-'+_0x5716f9+'/'+_0x3a96df)['json'](_0x491f5f);}return null;};}function patchUpdates(_0x1dddb9){return function(_0x250984){try{jsonpatch['apply'](_0x250984,_0x1dddb9,!![]);}catch(_0x36c8c0){return BPromise[_0xdf16('0x1d')](_0x36c8c0);}return _0x250984['save']();};}function saveUpdates(_0x5b77a7,_0x3aa28f){return function(_0x13780f){if(_0x13780f){return _0x13780f['update'](_0x5b77a7)[_0xdf16('0x1e')](function(_0x26ca2f){return _0x26ca2f;});}return null;};}function removeEntity(_0x22d1d9,_0x2d06f7){return function(_0x4873cf){if(_0x4873cf){return _0x4873cf[_0xdf16('0x1f')]()[_0xdf16('0x1e')](function(){_0x22d1d9['status'](0xcc)[_0xdf16('0x17')]();});}};}function handleEntityNotFound(_0x15621c,_0x56f3f7){return function(_0x512413){if(!_0x512413){_0x15621c[_0xdf16('0x20')](0x194);}return _0x512413;};}function handleError(_0x14b61d,_0x234159){_0x234159=_0x234159||0x1f4;return function(_0x41932b){logger[_0xdf16('0x21')](_0x41932b['stack']);if(_0x41932b['name']){delete _0x41932b['name'];}_0x14b61d['status'](_0x234159)[_0xdf16('0x22')](_0x41932b);};}exports[_0xdf16('0x23')]=function(_0x1da4d6,_0x33bf5a){var _0x89151c={},_0x41f024={},_0x299faa={'count':0x0,'rows':[]};var _0x164c1a=_['map'](db[_0xdf16('0x24')][_0xdf16('0x25')],function(_0x501aa5){return{'name':_0x501aa5[_0xdf16('0x26')],'type':_0x501aa5['type'][_0xdf16('0x27')]};});_0x41f024[_0xdf16('0x28')]=_['map'](_0x164c1a,_0xdf16('0x29'));_0x41f024[_0xdf16('0x2a')]=_[_0xdf16('0x2b')](_0x1da4d6[_0xdf16('0x2a')]);_0x41f024[_0xdf16('0x2c')]=_[_0xdf16('0x2d')](_0x41f024[_0xdf16('0x28')],_0x41f024[_0xdf16('0x2a')]);_0x89151c[_0xdf16('0x2e')]=_[_0xdf16('0x2d')](_0x41f024['model'],qs['fields'](_0x1da4d6['query'][_0xdf16('0x2f')]));_0x89151c['attributes']=_0x89151c[_0xdf16('0x2e')][_0xdf16('0x30')]?_0x89151c[_0xdf16('0x2e')]:_0x41f024[_0xdf16('0x28')];if(!_0x1da4d6['query'][_0xdf16('0x31')]('nolimit')){_0x89151c['limit']=qs[_0xdf16('0x32')](_0x1da4d6['query'][_0xdf16('0x32')]);_0x89151c['offset']=qs[_0xdf16('0x19')](_0x1da4d6['query'][_0xdf16('0x19')]);}_0x89151c[_0xdf16('0x33')]=qs[_0xdf16('0x34')](_0x1da4d6[_0xdf16('0x2a')][_0xdf16('0x34')]);_0x89151c[_0xdf16('0x35')]=qs[_0xdf16('0x2c')](_['pick'](_0x1da4d6[_0xdf16('0x2a')],_0x41f024[_0xdf16('0x2c')]),_0x164c1a);if(_0x1da4d6['query'][_0xdf16('0x36')]){_0x89151c[_0xdf16('0x35')]=_[_0xdf16('0x37')](_0x89151c[_0xdf16('0x35')],{'$or':_[_0xdf16('0x38')](_0x164c1a,function(_0x36ed02){if(_0x36ed02[_0xdf16('0x39')]!==_0xdf16('0x3a')){var _0x36559b={};_0x36559b[_0x36ed02['name']]={'$like':'%'+_0x1da4d6[_0xdf16('0x2a')][_0xdf16('0x36')]+'%'};return _0x36559b;}})});}_0x89151c=_['merge']({},_0x89151c,_0x1da4d6['options']);var _0x2fcc71={'where':_0x89151c[_0xdf16('0x35')]};return db[_0xdf16('0x24')][_0xdf16('0x1b')](_0x2fcc71)[_0xdf16('0x1e')](function(_0x1c5ad2){_0x299faa['count']=_0x1c5ad2;if(_0x1da4d6[_0xdf16('0x2a')]['includeAll']){_0x89151c[_0xdf16('0x3b')]=[{'all':!![]}];}return db[_0xdf16('0x24')][_0xdf16('0x3c')](_0x89151c);})[_0xdf16('0x1e')](function(_0x89f6b8){_0x299faa['rows']=_0x89f6b8;return _0x299faa;})['then'](respondWithFilteredResult(_0x33bf5a,_0x89151c))['catch'](handleError(_0x33bf5a,null));};exports[_0xdf16('0x3d')]=function(_0x48a70a,_0x439048){var _0x4d3c40={'raw':!![],'where':{'id':_0x48a70a[_0xdf16('0x3e')]['id']}},_0x454b29={};_0x454b29[_0xdf16('0x28')]=_[_0xdf16('0x2b')](db[_0xdf16('0x24')][_0xdf16('0x25')]);_0x454b29[_0xdf16('0x2a')]=_[_0xdf16('0x2b')](_0x48a70a['query']);_0x454b29[_0xdf16('0x2c')]=_['intersection'](_0x454b29[_0xdf16('0x28')],_0x454b29[_0xdf16('0x2a')]);_0x4d3c40['attributes']=_['intersection'](_0x454b29['model'],qs['fields'](_0x48a70a['query'][_0xdf16('0x2f')]));_0x4d3c40[_0xdf16('0x2e')]=_0x4d3c40[_0xdf16('0x2e')][_0xdf16('0x30')]?_0x4d3c40['attributes']:_0x454b29[_0xdf16('0x28')];if(_0x48a70a[_0xdf16('0x2a')][_0xdf16('0x3f')]){_0x4d3c40[_0xdf16('0x3b')]=[{'all':!![]}];}_0x4d3c40=_[_0xdf16('0x37')]({},_0x4d3c40,_0x48a70a[_0xdf16('0x40')]);return db[_0xdf16('0x24')][_0xdf16('0x41')](_0x4d3c40)[_0xdf16('0x1e')](handleEntityNotFound(_0x439048,null))[_0xdf16('0x1e')](respondWithResult(_0x439048,null))[_0xdf16('0x42')](handleError(_0x439048,null));};exports[_0xdf16('0x43')]=function(_0x2b6db9,_0x5bd512){return db[_0xdf16('0x24')][_0xdf16('0x43')](_0x2b6db9[_0xdf16('0x44')],{})[_0xdf16('0x1e')](respondWithResult(_0x5bd512,0xc9))[_0xdf16('0x42')](handleError(_0x5bd512,null));};exports[_0xdf16('0x45')]=function(_0x4597ec,_0x3453fc){if(_0x4597ec['body']['id']){delete _0x4597ec['body']['id'];}return db[_0xdf16('0x24')][_0xdf16('0x41')]({'where':{'id':_0x4597ec[_0xdf16('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3453fc,null))['then'](saveUpdates(_0x4597ec['body'],null))[_0xdf16('0x1e')](respondWithResult(_0x3453fc,null))['catch'](handleError(_0x3453fc,null));};exports[_0xdf16('0x1f')]=function(_0x80a54e,_0x1aa822){return db[_0xdf16('0x24')][_0xdf16('0x41')]({'where':{'id':_0x80a54e[_0xdf16('0x3e')]['id']}})[_0xdf16('0x1e')](handleEntityNotFound(_0x1aa822,null))[_0xdf16('0x1e')](removeEntity(_0x1aa822,null))['catch'](handleError(_0x1aa822,null));};
\ No newline at end of file
+var _0xc841=['sendStatus','status','end','limit','undefined','offset','set','Content-Range','apply','save','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','FreshsalesField','count','includeAll','include','findAll','catch','params','find','create','update','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0xc56bbc,_0x13f0d5){var _0x388d21=function(_0x42d135){while(--_0x42d135){_0xc56bbc['push'](_0xc56bbc['shift']());}};_0x388d21(++_0x13f0d5);}(_0xc841,0xc5));var _0x1c84=function(_0x424bb3,_0x39fb28){_0x424bb3=_0x424bb3-0x0;var _0x2f70f2=_0xc841[_0x424bb3];return _0x2f70f2;};'use strict';var emlformat=require(_0x1c84('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c84('0x1'));var jsonpatch=require(_0x1c84('0x2'));var rp=require(_0x1c84('0x3'));var moment=require(_0x1c84('0x4'));var BPromise=require(_0x1c84('0x5'));var Mustache=require(_0x1c84('0x6'));var util=require(_0x1c84('0x7'));var path=require(_0x1c84('0x8'));var sox=require(_0x1c84('0x9'));var csv=require(_0x1c84('0xa'));var ejs=require(_0x1c84('0xb'));var fs=require('fs');var fs_extra=require(_0x1c84('0xc'));var _=require(_0x1c84('0xd'));var squel=require(_0x1c84('0xe'));var crypto=require('crypto');var jsforce=require(_0x1c84('0xf'));var deskjs=require(_0x1c84('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1c84('0x11'));var Papa=require(_0x1c84('0x12'));var Redis=require(_0x1c84('0x13'));var authService=require(_0x1c84('0x14'));var qs=require(_0x1c84('0x15'));var as=require(_0x1c84('0x16'));var hardwareService=require(_0x1c84('0x17'));var logger=require(_0x1c84('0x18'))(_0x1c84('0x19'));var utils=require('../../config/utils');var config=require(_0x1c84('0x1a'));var licenseUtil=require(_0x1c84('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a2e90,_0x359d0a){_0x359d0a=_0x359d0a||0xcc;return function(_0x4ec6b0){if(_0x4ec6b0){return _0x4a2e90[_0x1c84('0x1c')](_0x359d0a);}return _0x4a2e90[_0x1c84('0x1d')](_0x359d0a)[_0x1c84('0x1e')]();};}function respondWithResult(_0x3b0802,_0x20b100){_0x20b100=_0x20b100||0xc8;return function(_0x77fe7f){if(_0x77fe7f){return _0x3b0802[_0x1c84('0x1d')](_0x20b100)['json'](_0x77fe7f);}};}function respondWithFilteredResult(_0x2c8965,_0x5971eb){return function(_0x49ef79){if(_0x49ef79){var _0x1affb8=typeof _0x5971eb['offset']==='undefined'&&typeof _0x5971eb[_0x1c84('0x1f')]===_0x1c84('0x20');var _0x4217bb=_0x49ef79['count'];var _0x5779f4=_0x1affb8?0x0:_0x5971eb[_0x1c84('0x21')];var _0x1979c5=_0x1affb8?_0x49ef79['count']:_0x5971eb[_0x1c84('0x21')]+_0x5971eb[_0x1c84('0x1f')];var _0x5bedfa;if(_0x1979c5>=_0x4217bb){_0x1979c5=_0x4217bb;_0x5bedfa=0xc8;}else{_0x5bedfa=0xce;}_0x2c8965[_0x1c84('0x1d')](_0x5bedfa);return _0x2c8965[_0x1c84('0x22')](_0x1c84('0x23'),_0x5779f4+'-'+_0x1979c5+'/'+_0x4217bb)['json'](_0x49ef79);}return null;};}function patchUpdates(_0x47bfa8){return function(_0x53052){try{jsonpatch[_0x1c84('0x24')](_0x53052,_0x47bfa8,!![]);}catch(_0x33331d){return BPromise['reject'](_0x33331d);}return _0x53052[_0x1c84('0x25')]();};}function saveUpdates(_0x54c1a8,_0x5f8097){return function(_0x3e6d6c){if(_0x3e6d6c){return _0x3e6d6c['update'](_0x54c1a8)['then'](function(_0x26c3f3){return _0x26c3f3;});}return null;};}function removeEntity(_0xc5578a,_0x118b5a){return function(_0xe3bf81){if(_0xe3bf81){return _0xe3bf81['destroy']()[_0x1c84('0x26')](function(){_0xc5578a['status'](0xcc)[_0x1c84('0x1e')]();});}};}function handleEntityNotFound(_0xe0e184,_0x3e0988){return function(_0x1f2b58){if(!_0x1f2b58){_0xe0e184[_0x1c84('0x1c')](0x194);}return _0x1f2b58;};}function handleError(_0x4a96d0,_0x5c0f5e){_0x5c0f5e=_0x5c0f5e||0x1f4;return function(_0x5f0ef9){logger[_0x1c84('0x27')](_0x5f0ef9[_0x1c84('0x28')]);if(_0x5f0ef9[_0x1c84('0x29')]){delete _0x5f0ef9[_0x1c84('0x29')];}_0x4a96d0['status'](_0x5c0f5e)[_0x1c84('0x2a')](_0x5f0ef9);};}exports['index']=function(_0x28e110,_0x304a7b){var _0xabbba7={},_0x2e1a9c={},_0xc9ee7e={'count':0x0,'rows':[]};var _0x56e5f2=_[_0x1c84('0x2b')](db['FreshsalesField'][_0x1c84('0x2c')],function(_0x45b068){return{'name':_0x45b068[_0x1c84('0x2d')],'type':_0x45b068['type'][_0x1c84('0x2e')]};});_0x2e1a9c[_0x1c84('0x2f')]=_[_0x1c84('0x2b')](_0x56e5f2,_0x1c84('0x29'));_0x2e1a9c['query']=_[_0x1c84('0x30')](_0x28e110[_0x1c84('0x31')]);_0x2e1a9c[_0x1c84('0x32')]=_[_0x1c84('0x33')](_0x2e1a9c[_0x1c84('0x2f')],_0x2e1a9c['query']);_0xabbba7[_0x1c84('0x34')]=_[_0x1c84('0x33')](_0x2e1a9c[_0x1c84('0x2f')],qs[_0x1c84('0x35')](_0x28e110['query'][_0x1c84('0x35')]));_0xabbba7[_0x1c84('0x34')]=_0xabbba7[_0x1c84('0x34')][_0x1c84('0x36')]?_0xabbba7[_0x1c84('0x34')]:_0x2e1a9c['model'];if(!_0x28e110[_0x1c84('0x31')][_0x1c84('0x37')]('nolimit')){_0xabbba7[_0x1c84('0x1f')]=qs[_0x1c84('0x1f')](_0x28e110[_0x1c84('0x31')][_0x1c84('0x1f')]);_0xabbba7['offset']=qs[_0x1c84('0x21')](_0x28e110[_0x1c84('0x31')]['offset']);}_0xabbba7[_0x1c84('0x38')]=qs['sort'](_0x28e110[_0x1c84('0x31')][_0x1c84('0x39')]);_0xabbba7[_0x1c84('0x3a')]=qs[_0x1c84('0x32')](_[_0x1c84('0x3b')](_0x28e110['query'],_0x2e1a9c[_0x1c84('0x32')]),_0x56e5f2);if(_0x28e110[_0x1c84('0x31')][_0x1c84('0x3c')]){_0xabbba7[_0x1c84('0x3a')]=_[_0x1c84('0x3d')](_0xabbba7[_0x1c84('0x3a')],{'$or':_[_0x1c84('0x2b')](_0x56e5f2,function(_0x14df8f){if(_0x14df8f['type']!=='VIRTUAL'){var _0x4606b8={};_0x4606b8[_0x14df8f[_0x1c84('0x29')]]={'$like':'%'+_0x28e110[_0x1c84('0x31')][_0x1c84('0x3c')]+'%'};return _0x4606b8;}})});}_0xabbba7=_[_0x1c84('0x3d')]({},_0xabbba7,_0x28e110[_0x1c84('0x3e')]);var _0x806d11={'where':_0xabbba7[_0x1c84('0x3a')]};return db[_0x1c84('0x3f')][_0x1c84('0x40')](_0x806d11)[_0x1c84('0x26')](function(_0x545e44){_0xc9ee7e[_0x1c84('0x40')]=_0x545e44;if(_0x28e110[_0x1c84('0x31')][_0x1c84('0x41')]){_0xabbba7[_0x1c84('0x42')]=[{'all':!![]}];}return db['FreshsalesField'][_0x1c84('0x43')](_0xabbba7);})['then'](function(_0x37125f){_0xc9ee7e['rows']=_0x37125f;return _0xc9ee7e;})[_0x1c84('0x26')](respondWithFilteredResult(_0x304a7b,_0xabbba7))[_0x1c84('0x44')](handleError(_0x304a7b,null));};exports['show']=function(_0x37f307,_0x4aa6fe){var _0x3eed23={'raw':!![],'where':{'id':_0x37f307[_0x1c84('0x45')]['id']}},_0x1c3528={};_0x1c3528[_0x1c84('0x2f')]=_[_0x1c84('0x30')](db['FreshsalesField'][_0x1c84('0x2c')]);_0x1c3528['query']=_[_0x1c84('0x30')](_0x37f307[_0x1c84('0x31')]);_0x1c3528[_0x1c84('0x32')]=_[_0x1c84('0x33')](_0x1c3528[_0x1c84('0x2f')],_0x1c3528['query']);_0x3eed23[_0x1c84('0x34')]=_['intersection'](_0x1c3528['model'],qs[_0x1c84('0x35')](_0x37f307['query'][_0x1c84('0x35')]));_0x3eed23[_0x1c84('0x34')]=_0x3eed23[_0x1c84('0x34')][_0x1c84('0x36')]?_0x3eed23[_0x1c84('0x34')]:_0x1c3528['model'];if(_0x37f307['query'][_0x1c84('0x41')]){_0x3eed23[_0x1c84('0x42')]=[{'all':!![]}];}_0x3eed23=_[_0x1c84('0x3d')]({},_0x3eed23,_0x37f307[_0x1c84('0x3e')]);return db[_0x1c84('0x3f')][_0x1c84('0x46')](_0x3eed23)[_0x1c84('0x26')](handleEntityNotFound(_0x4aa6fe,null))[_0x1c84('0x26')](respondWithResult(_0x4aa6fe,null))[_0x1c84('0x44')](handleError(_0x4aa6fe,null));};exports[_0x1c84('0x47')]=function(_0x2d77c0,_0x49bfc5){return db['FreshsalesField'][_0x1c84('0x47')](_0x2d77c0['body'],{})[_0x1c84('0x26')](respondWithResult(_0x49bfc5,0xc9))['catch'](handleError(_0x49bfc5,null));};exports[_0x1c84('0x48')]=function(_0x40b658,_0x2552aa){if(_0x40b658[_0x1c84('0x49')]['id']){delete _0x40b658[_0x1c84('0x49')]['id'];}return db[_0x1c84('0x3f')][_0x1c84('0x46')]({'where':{'id':_0x40b658[_0x1c84('0x45')]['id']}})[_0x1c84('0x26')](handleEntityNotFound(_0x2552aa,null))[_0x1c84('0x26')](saveUpdates(_0x40b658[_0x1c84('0x49')],null))[_0x1c84('0x26')](respondWithResult(_0x2552aa,null))[_0x1c84('0x44')](handleError(_0x2552aa,null));};exports[_0x1c84('0x4a')]=function(_0x38a6f0,_0x15a8e6){return db['FreshsalesField'][_0x1c84('0x46')]({'where':{'id':_0x38a6f0[_0x1c84('0x45')]['id']}})[_0x1c84('0x26')](handleEntityNotFound(_0x15a8e6,null))[_0x1c84('0x26')](removeEntity(_0x15a8e6,null))['catch'](handleError(_0x15a8e6,null));};
\ No newline at end of file
index ce78f7e..afc165b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd301=['int_freshsales_fields','idField','FieldId','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd301,0x145));var _0x1d30=function(_0x324496,_0x3a4cdd){_0x324496=_0x324496-0x0;var _0x899545=_0xd301[_0x324496];return _0x899545;};'use strict';var _=require(_0x1d30('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1d30('0x1'));var BPromise=require(_0x1d30('0x2'));var rp=require(_0x1d30('0x3'));var fs=require('fs');var path=require(_0x1d30('0x4'));var rimraf=require(_0x1d30('0x5'));var config=require(_0x1d30('0x6'));var attributes=require(_0x1d30('0x7'));module[_0x1d30('0x8')]=function(_0x19f202,_0x4ad474){return _0x19f202[_0x1d30('0x9')](_0x1d30('0xa'),attributes,{'tableName':_0x1d30('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x1d30('0xc'),_0x1d30('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6302=['freshsales_unique_index','util','../../config/logger','api','moment','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0x6302,0x109));var _0x2630=function(_0x3ae069,_0x510266){_0x3ae069=_0x3ae069-0x0;var _0x3d1eed=_0x6302[_0x3ae069];return _0x3d1eed;};'use strict';var _=require('lodash');var util=require(_0x2630('0x0'));var logger=require(_0x2630('0x1'))(_0x2630('0x2'));var moment=require(_0x2630('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2630('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2630('0x5'));module[_0x2630('0x6')]=function(_0x434d82,_0x1a9f2b){return _0x434d82[_0x2630('0x7')](_0x2630('0x8'),attributes,{'tableName':_0x2630('0x9'),'paranoid':![],'indexes':[{'name':_0x2630('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 495aea1..202730e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x5d86fa,_0x20203f){var _0x473702=function(_0x202ad1){while(--_0x202ad1){_0x5d86fa['push'](_0x5d86fa['shift']());}};_0x473702(++_0x20203f);}(_0x2675,0x75));var _0x5267=function(_0x4aaed9,_0x34382f){_0x4aaed9=_0x4aaed9-0x0;var _0x8bf05c=_0x2675[_0x4aaed9];return _0x8bf05c;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});}
\ No newline at end of file
+var _0xafc4=['error','code','message','request\x20sent','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x401433,_0x1f9f2e){var _0x3bbc84=function(_0x5b6957){while(--_0x5b6957){_0x401433['push'](_0x401433['shift']());}};_0x3bbc84(++_0x1f9f2e);}(_0xafc4,0x69));var _0x4afc=function(_0x27d9f3,_0x1833f1){_0x27d9f3=_0x27d9f3-0x0;var _0x596e72=_0xafc4[_0x27d9f3];return _0x596e72;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var moment=require(_0x4afc('0x1'));var BPromise=require('bluebird');var rs=require(_0x4afc('0x2'));var fs=require('fs');var Redis=require(_0x4afc('0x3'));var db=require(_0x4afc('0x4'))['db'];var utils=require(_0x4afc('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4afc('0x6'));var client=jayson[_0x4afc('0x7')][_0x4afc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bb281,_0xc828d9,_0xaf053d){return new BPromise(function(_0x5e1e29,_0x31e165){return client[_0x4afc('0x9')](_0x1bb281,_0xaf053d)[_0x4afc('0xa')](function(_0x1e6bf5){logger[_0x4afc('0xb')](_0x4afc('0xc'),_0xc828d9,'request\x20sent');logger['debug'](_0x4afc('0xd'),_0xc828d9,'request\x20sent',JSON[_0x4afc('0xe')](_0x1e6bf5));if(_0x1e6bf5[_0x4afc('0xf')]){if(_0x1e6bf5['error'][_0x4afc('0x10')]===0x1f4){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x31e165(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}logger[_0x4afc('0xf')]('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);return _0x5e1e29(_0x1e6bf5[_0x4afc('0xf')][_0x4afc('0x11')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0xc828d9,_0x4afc('0x12'));_0x5e1e29(_0x1e6bf5['result'][_0x4afc('0x11')]);}})[_0x4afc('0x13')](function(_0x2b928b){logger[_0x4afc('0xf')](_0x4afc('0xc'),_0xc828d9,_0x2b928b);_0x31e165(_0x2b928b);});});}
\ No newline at end of file
index 79f9138..3692eab 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(_0x5a3ab6,_0x1e2825){var _0x274bb6=function(_0x1de5ce){while(--_0x1de5ce){_0x5a3ab6['push'](_0x5a3ab6['shift']());}};_0x274bb6(++_0x1e2825);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x167400,_0xd7b075){var _0x4fb7c9=function(_0x39aff2){while(--_0x39aff2){_0x167400['push'](_0x167400['shift']());}};_0x4fb7c9(++_0xd7b075);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index a3d316f..b1e862d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bab=['exports','STRING','username','integrationTab','newTab','sequelize'];(function(_0x1964b4,_0x5796f4){var _0x509a77=function(_0x247257){while(--_0x247257){_0x1964b4['push'](_0x1964b4['shift']());}};_0x509a77(++_0x5796f4);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x6bab[_0x3430aa];return _0x2ac5c;};'use strict';var Sequelize=require(_0xb6ba('0x0'));module[_0xb6ba('0x1')]={'name':{'type':Sequelize[_0xb6ba('0x2')]},'description':{'type':Sequelize[_0xb6ba('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb6ba('0x3')},'remoteUri':{'type':Sequelize[_0xb6ba('0x2')]},'password':{'type':Sequelize[_0xb6ba('0x2')]},'clientId':{'type':Sequelize[_0xb6ba('0x2')]},'clientSecret':{'type':Sequelize[_0xb6ba('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb6ba('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xb6ba('0x4'),_0xb6ba('0x5')),'defaultValue':_0xb6ba('0x4')}};
\ No newline at end of file
+var _0x1a62=['ENUM','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0x1a62,0x176));var _0x21a6=function(_0x2d3b9c,_0x523dc1){_0x2d3b9c=_0x2d3b9c-0x0;var _0x1b7bf0=_0x1a62[_0x2d3b9c];return _0x1b7bf0;};'use strict';var Sequelize=require(_0x21a6('0x0'));module[_0x21a6('0x1')]={'name':{'type':Sequelize[_0x21a6('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x21a6('0x2')],'unique':_0x21a6('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x21a6('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x21a6('0x2')]},'serverUrl':{'type':Sequelize[_0x21a6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x21a6('0x4')](_0x21a6('0x5'),_0x21a6('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index a6cf1e5..ab733bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3af4=['../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','name','index','map','SalesforceAccount','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','SalesforceConfiguration','order','sort','Subjects','getSubjects','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','login','concat','isNil','ticketType','sobject','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','boolean','email','textarea','includes','label','picklistValues','True','true','False','false','test','statusCode','error','stringify','send','rimraf','zip-dir','request-promise','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb'];(function(_0x4e2e40,_0xe0400e){var _0x2acea7=function(_0x555eff){while(--_0x555eff){_0x4e2e40['push'](_0x4e2e40['shift']());}};_0x2acea7(++_0xe0400e);}(_0x3af4,0xd2));var _0x43af=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x3af4[_0x23b655];return _0x364b32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43af('0x0'));var zipdir=require(_0x43af('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x43af('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x43af('0x3'));var path=require(_0x43af('0x4'));var sox=require(_0x43af('0x5'));var csv=require(_0x43af('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43af('0x7'));var _=require('lodash');var squel=require(_0x43af('0x8'));var crypto=require(_0x43af('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x43af('0xa'));var toCsv=require(_0x43af('0x6'));var querystring=require(_0x43af('0xb'));var Papa=require(_0x43af('0xc'));var Redis=require(_0x43af('0xd'));var authService=require(_0x43af('0xe'));var qs=require(_0x43af('0xf'));var as=require(_0x43af('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x43af('0x11'));var utils=require(_0x43af('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x43af('0x13'))['db'];var integrations=require(_0x43af('0x14'));function respondWithStatusCode(_0x8a8c2e,_0x49384b){_0x49384b=_0x49384b||0xcc;return function(_0x1757e5){if(_0x1757e5){return _0x8a8c2e[_0x43af('0x15')](_0x49384b);}return _0x8a8c2e[_0x43af('0x16')](_0x49384b)[_0x43af('0x17')]();};}function respondWithResult(_0x274953,_0x1e19a4){_0x1e19a4=_0x1e19a4||0xc8;return function(_0x1e262b){if(_0x1e262b){return _0x274953['status'](_0x1e19a4)[_0x43af('0x18')](_0x1e262b);}};}function respondWithFilteredResult(_0x595d49,_0x3a1d3d){return function(_0x5007b2){if(_0x5007b2){var _0x1a924b=typeof _0x3a1d3d[_0x43af('0x19')]===_0x43af('0x1a')&&typeof _0x3a1d3d[_0x43af('0x1b')]===_0x43af('0x1a');var _0x2dc1c5=_0x5007b2[_0x43af('0x1c')];var _0x15973a=_0x1a924b?0x0:_0x3a1d3d[_0x43af('0x19')];var _0x4fa75a=_0x1a924b?_0x5007b2[_0x43af('0x1c')]:_0x3a1d3d['offset']+_0x3a1d3d[_0x43af('0x1b')];var _0x4e4cd5;if(_0x4fa75a>=_0x2dc1c5){_0x4fa75a=_0x2dc1c5;_0x4e4cd5=0xc8;}else{_0x4e4cd5=0xce;}_0x595d49['status'](_0x4e4cd5);return _0x595d49[_0x43af('0x1d')](_0x43af('0x1e'),_0x15973a+'-'+_0x4fa75a+'/'+_0x2dc1c5)[_0x43af('0x18')](_0x5007b2);}return null;};}function patchUpdates(_0x209885){return function(_0x231883){try{jsonpatch[_0x43af('0x1f')](_0x231883,_0x209885,!![]);}catch(_0xe88667){return BPromise['reject'](_0xe88667);}return _0x231883['save']();};}function saveUpdates(_0x56671b,_0x3258b7){return function(_0x5b4752){if(_0x5b4752){return _0x5b4752[_0x43af('0x20')](_0x56671b)[_0x43af('0x21')](function(_0x5ee2dc){return _0x5ee2dc;});}return null;};}function removeEntity(_0x3f45b8,_0x1a9154){return function(_0x2bd458){if(_0x2bd458){return _0x2bd458[_0x43af('0x22')]()[_0x43af('0x21')](function(){_0x3f45b8[_0x43af('0x16')](0xcc)[_0x43af('0x17')]();});}};}function handleEntityNotFound(_0x101748,_0xf0ff92){return function(_0xba4871){if(!_0xba4871){_0x101748[_0x43af('0x15')](0x194);}return _0xba4871;};}function handleError(_0x5ddd68,_0xe3bd18){_0xe3bd18=_0xe3bd18||0x1f4;return function(_0x1cacfd){logger['error'](_0x1cacfd['stack']);if(_0x1cacfd[_0x43af('0x23')]){delete _0x1cacfd[_0x43af('0x23')];}_0x5ddd68[_0x43af('0x16')](_0xe3bd18)['send'](_0x1cacfd);};}exports[_0x43af('0x24')]=function(_0x133ef7,_0x2978b8){var _0x44efec={},_0x4c91e4={},_0x36a78d={'count':0x0,'rows':[]};var _0x122c5b=_[_0x43af('0x25')](db[_0x43af('0x26')][_0x43af('0x27')],function(_0x504afe){return{'name':_0x504afe[_0x43af('0x28')],'type':_0x504afe['type']['key']};});_0x4c91e4[_0x43af('0x29')]=_[_0x43af('0x25')](_0x122c5b,_0x43af('0x23'));_0x4c91e4['query']=_[_0x43af('0x2a')](_0x133ef7[_0x43af('0x2b')]);_0x4c91e4[_0x43af('0x2c')]=_[_0x43af('0x2d')](_0x4c91e4['model'],_0x4c91e4[_0x43af('0x2b')]);_0x44efec[_0x43af('0x2e')]=_['intersection'](_0x4c91e4[_0x43af('0x29')],qs[_0x43af('0x2f')](_0x133ef7['query'][_0x43af('0x2f')]));_0x44efec[_0x43af('0x2e')]=_0x44efec[_0x43af('0x2e')]['length']?_0x44efec['attributes']:_0x4c91e4[_0x43af('0x29')];if(!_0x133ef7[_0x43af('0x2b')][_0x43af('0x30')](_0x43af('0x31'))){_0x44efec[_0x43af('0x1b')]=qs[_0x43af('0x1b')](_0x133ef7[_0x43af('0x2b')][_0x43af('0x1b')]);_0x44efec[_0x43af('0x19')]=qs[_0x43af('0x19')](_0x133ef7[_0x43af('0x2b')][_0x43af('0x19')]);}_0x44efec['order']=qs['sort'](_0x133ef7[_0x43af('0x2b')]['sort']);_0x44efec[_0x43af('0x32')]=qs[_0x43af('0x2c')](_[_0x43af('0x33')](_0x133ef7[_0x43af('0x2b')],_0x4c91e4[_0x43af('0x2c')]),_0x122c5b);if(_0x133ef7[_0x43af('0x2b')][_0x43af('0x34')]){_0x44efec['where']=_[_0x43af('0x35')](_0x44efec['where'],{'$or':_['map'](_0x122c5b,function(_0x5d66d1){if(_0x5d66d1[_0x43af('0x36')]!==_0x43af('0x37')){var _0x2fd032={};_0x2fd032[_0x5d66d1[_0x43af('0x23')]]={'$like':'%'+_0x133ef7[_0x43af('0x2b')]['filter']+'%'};return _0x2fd032;}})});}_0x44efec=_['merge']({},_0x44efec,_0x133ef7[_0x43af('0x38')]);var _0x5b179e={'where':_0x44efec['where']};return db[_0x43af('0x26')][_0x43af('0x1c')](_0x5b179e)[_0x43af('0x21')](function(_0x299f15){_0x36a78d['count']=_0x299f15;if(_0x133ef7['query'][_0x43af('0x39')]){_0x44efec[_0x43af('0x3a')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x43af('0x3b')](_0x44efec);})[_0x43af('0x21')](function(_0x2ca510){_0x36a78d[_0x43af('0x3c')]=_0x2ca510;return _0x36a78d;})[_0x43af('0x21')](respondWithFilteredResult(_0x2978b8,_0x44efec))['catch'](handleError(_0x2978b8,null));};exports[_0x43af('0x3d')]=function(_0x59840c,_0x407e91){var _0x36039d={'raw':![],'where':{'id':_0x59840c[_0x43af('0x3e')]['id']}},_0x489e3f={};_0x489e3f[_0x43af('0x29')]=_[_0x43af('0x2a')](db[_0x43af('0x26')][_0x43af('0x27')]);_0x489e3f[_0x43af('0x2b')]=_[_0x43af('0x2a')](_0x59840c['query']);_0x489e3f[_0x43af('0x2c')]=_[_0x43af('0x2d')](_0x489e3f[_0x43af('0x29')],_0x489e3f[_0x43af('0x2b')]);_0x36039d[_0x43af('0x2e')]=_['intersection'](_0x489e3f[_0x43af('0x29')],qs['fields'](_0x59840c[_0x43af('0x2b')]['fields']));_0x36039d[_0x43af('0x2e')]=_0x36039d['attributes'][_0x43af('0x3f')]?_0x36039d[_0x43af('0x2e')]:_0x489e3f['model'];if(_0x59840c[_0x43af('0x2b')][_0x43af('0x39')]){_0x36039d[_0x43af('0x3a')]=[{'all':!![]}];}_0x36039d=_[_0x43af('0x35')]({},_0x36039d,_0x59840c['options']);return db[_0x43af('0x26')][_0x43af('0x40')](_0x36039d)[_0x43af('0x21')](handleEntityNotFound(_0x407e91,null))[_0x43af('0x21')](respondWithResult(_0x407e91,null))[_0x43af('0x41')](handleError(_0x407e91,null));};exports[_0x43af('0x42')]=function(_0x55f922,_0x3a3f15){return db[_0x43af('0x26')][_0x43af('0x42')](_0x55f922['body'],{})['then'](respondWithResult(_0x3a3f15,0xc9))['catch'](handleError(_0x3a3f15,null));};exports[_0x43af('0x20')]=function(_0x3dd11e,_0x101fe1){if(_0x3dd11e[_0x43af('0x43')]['id']){delete _0x3dd11e['body']['id'];}return db[_0x43af('0x26')][_0x43af('0x40')]({'where':{'id':_0x3dd11e[_0x43af('0x3e')]['id']}})[_0x43af('0x21')](handleEntityNotFound(_0x101fe1,null))['then'](saveUpdates(_0x3dd11e[_0x43af('0x43')],null))[_0x43af('0x21')](respondWithResult(_0x101fe1,null))['catch'](handleError(_0x101fe1,null));};exports[_0x43af('0x22')]=function(_0xd273f1,_0x1f8d72){return db[_0x43af('0x26')][_0x43af('0x40')]({'where':{'id':_0xd273f1[_0x43af('0x3e')]['id']}})[_0x43af('0x21')](handleEntityNotFound(_0x1f8d72,null))[_0x43af('0x21')](removeEntity(_0x1f8d72,null))[_0x43af('0x41')](handleError(_0x1f8d72,null));};exports[_0x43af('0x44')]=function(_0x4e579d,_0x2511da,_0x1bc3a0){var _0x3c68d3={};var _0x322994={};var _0x23e6e5;var _0xc6e822;return db['SalesforceAccount'][_0x43af('0x45')]({'where':{'id':_0x4e579d[_0x43af('0x3e')]['id']}})[_0x43af('0x21')](handleEntityNotFound(_0x2511da,null))['then'](function(_0x44ec6d){if(_0x44ec6d){_0x23e6e5=_0x44ec6d;_0x322994['model']=_[_0x43af('0x2a')](db[_0x43af('0x46')]['rawAttributes']);_0x322994[_0x43af('0x2b')]=_[_0x43af('0x2a')](_0x4e579d['query']);_0x322994[_0x43af('0x2c')]=_[_0x43af('0x2d')](_0x322994[_0x43af('0x29')],_0x322994['query']);_0x3c68d3[_0x43af('0x2e')]=_[_0x43af('0x2d')](_0x322994[_0x43af('0x29')],qs['fields'](_0x4e579d[_0x43af('0x2b')][_0x43af('0x2f')]));_0x3c68d3['attributes']=_0x3c68d3[_0x43af('0x2e')][_0x43af('0x3f')]?_0x3c68d3[_0x43af('0x2e')]:_0x322994[_0x43af('0x29')];_0x3c68d3[_0x43af('0x47')]=qs[_0x43af('0x48')](_0x4e579d[_0x43af('0x2b')]['sort']);_0x3c68d3[_0x43af('0x32')]=qs[_0x43af('0x2c')](_['pick'](_0x4e579d[_0x43af('0x2b')],_0x322994[_0x43af('0x2c')]));if(_0x4e579d[_0x43af('0x2b')][_0x43af('0x34')]){_0x3c68d3['where']=_[_0x43af('0x35')](_0x3c68d3[_0x43af('0x32')],{'$or':_[_0x43af('0x25')](_0x3c68d3[_0x43af('0x2e')],function(_0xf4b8c5){var _0x4bc44c={};_0x4bc44c[_0xf4b8c5]={'$like':'%'+_0x4e579d[_0x43af('0x2b')][_0x43af('0x34')]+'%'};return _0x4bc44c;})});}_0x3c68d3=_[_0x43af('0x35')]({},_0x3c68d3,_0x4e579d[_0x43af('0x38')]);return _0x23e6e5[_0x43af('0x44')](_0x3c68d3);}})[_0x43af('0x21')](function(_0x3fab5d){if(_0x3fab5d){_0xc6e822=_0x3fab5d[_0x43af('0x3f')];if(!_0x4e579d[_0x43af('0x2b')][_0x43af('0x30')](_0x43af('0x31'))){_0x3c68d3[_0x43af('0x1b')]=qs[_0x43af('0x1b')](_0x4e579d[_0x43af('0x2b')][_0x43af('0x1b')]);_0x3c68d3[_0x43af('0x19')]=qs[_0x43af('0x19')](_0x4e579d['query'][_0x43af('0x19')]);}return _0x23e6e5[_0x43af('0x44')](_0x3c68d3);}})['then'](function(_0x52bb59){if(_0x52bb59){return _0x52bb59?{'count':_0xc6e822,'rows':_0x52bb59}:null;}})['then'](respondWithResult(_0x2511da,null))['catch'](handleError(_0x2511da,null));};exports['addConfiguration']=function(_0x1a3d7b,_0x3ebe23,_0x421ad2){if(_0x1a3d7b[_0x43af('0x43')]['id']){delete _0x1a3d7b[_0x43af('0x43')]['id'];}return db[_0x43af('0x26')][_0x43af('0x45')]({'where':{'id':_0x1a3d7b[_0x43af('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ebe23,null))[_0x43af('0x21')](function(_0x53e0c4){if(_0x53e0c4){_0x1a3d7b['body']['AccountId']=_0x53e0c4['id'];_0x1a3d7b[_0x43af('0x43')][_0x43af('0x49')]=integrations[_0x43af('0x4a')](_0x1a3d7b[_0x43af('0x43')]['channel'],_0x1a3d7b[_0x43af('0x43')][_0x43af('0x36')]);_0x1a3d7b[_0x43af('0x43')][_0x43af('0x4b')]=integrations[_0x43af('0x4c')](_0x1a3d7b['body']['channel'],_0x1a3d7b[_0x43af('0x43')]['type']);return db['SalesforceConfiguration'][_0x43af('0x42')](_0x1a3d7b[_0x43af('0x43')],{'include':[{'model':db[_0x43af('0x4d')],'as':_0x43af('0x49')},{'model':db['SalesforceField'],'as':_0x43af('0x4b')}]});}return null;})[_0x43af('0x21')](respondWithResult(_0x3ebe23,null))[_0x43af('0x41')](handleError(_0x3ebe23,null));};exports[_0x43af('0x4e')]=function(_0x3fdc7e,_0x248ba6,_0x32c8c5){var _0x2911cd;var _0x42b494='';var _0x2118ff=_0x43af('0x4f');return db[_0x43af('0x26')][_0x43af('0x45')]({'where':{'id':_0x3fdc7e[_0x43af('0x3e')]['id']},'attributes':['id',_0x43af('0x50'),_0x43af('0x51'),_0x43af('0x52'),_0x43af('0x53'),_0x43af('0x54'),_0x43af('0x55')]})[_0x43af('0x21')](handleEntityNotFound(_0x248ba6,null))['then'](function(_0x2d4624){if(_0x2d4624){_0x42b494=_0x2d4624[_0x43af('0x50')];var _0xade8a6=_0x42b494[_0x43af('0x56')](-0x1);if(_0xade8a6==='/'){_0x42b494=_0x42b494[_0x43af('0x57')](0x0,_0x42b494['lastIndexOf'](_0xade8a6));}_0x2911cd=new jsforce['Connection']({'oauth2':{'loginUrl':_0x42b494,'clientId':_0x2d4624[_0x43af('0x51')],'clientSecret':_0x2d4624['clientSecret']}});return _0x2911cd[_0x43af('0x58')](_0x2d4624[_0x43af('0x53')],_0x2d4624[_0x43af('0x54')][_0x43af('0x59')](_0x2d4624[_0x43af('0x55')]));}})[_0x43af('0x21')](function(_0x1b8b22){if(_0x1b8b22){if(!_[_0x43af('0x5a')](_0x3fdc7e[_0x43af('0x2b')]['ticketType'])){_0x2118ff=_0x3fdc7e[_0x43af('0x2b')][_0x43af('0x5b')];}return _0x2911cd[_0x43af('0x5c')](_0x2118ff)['describe']();}})[_0x43af('0x21')](function(_0x1f51f7){var _0x248362=['OwnerId',_0x43af('0x5d'),_0x43af('0x5e'),_0x43af('0x5f'),_0x43af('0x60'),_0x43af('0x61')];var _0x5924dd=['string',_0x43af('0x62'),_0x43af('0x63'),_0x43af('0x64'),_0x43af('0x65'),_0x43af('0x66'),'phone'];if(_0x1f51f7){_['remove'](_0x1f51f7['fields'],function(_0xb80854){return _0x248362[_0x43af('0x67')](_0xb80854['name'])||!_0x5924dd[_0x43af('0x67')](_0xb80854[_0x43af('0x36')]);});return{'count':_0x1f51f7['fields'][_0x43af('0x3f')],'rows':_[_0x43af('0x25')](_0x1f51f7[_0x43af('0x2f')],function(_0x2a5987){return{'id':_0x2a5987[_0x43af('0x23')],'name':_0x2a5987[_0x43af('0x68')],'custom':_0x2a5987['custom'],'options':_0x2a5987[_0x43af('0x69')][_0x43af('0x3f')]>0x0?_['map'](_0x2a5987[_0x43af('0x69')],function(_0x3eb425){return{'name':_0x3eb425[_0x43af('0x68')],'value':_0x3eb425['value']};}):_0x2a5987[_0x43af('0x36')]==_0x43af('0x64')?[{'name':_0x43af('0x6a'),'value':_0x43af('0x6b')},{'name':_0x43af('0x6c'),'value':_0x43af('0x6d')}]:[]};})};}})['then'](respondWithResult(_0x248ba6,null))[_0x43af('0x41')](function(_0x5222cf){var _0x36e13f=_0x3fdc7e[_0x43af('0x2b')][_0x43af('0x6e')]?0x1f4:_0x5222cf[_0x43af('0x6f')]||0x1f4;logger[_0x43af('0x70')]('getFields,\x20%s,\x20%s,\x20%s',_0x43af('0x4e'),_0x36e13f,JSON[_0x43af('0x71')](_0x5222cf));delete _0x5222cf['name'];if(_0x36e13f===0x191){_0x36e13f=0x190;}_0x248ba6[_0x43af('0x16')](_0x36e13f)[_0x43af('0x72')](_0x3fdc7e[_0x43af('0x2b')][_0x43af('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x5222cf[_0x43af('0x6f')]}:_0x5222cf);});};
\ No newline at end of file
+var _0x98af=['mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','intersection','find','create','body','destroy','findOne','SalesforceConfiguration','order','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','username','password','securityToken','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','remove','includes','custom','picklistValues','label','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x560d98,_0x1a422d){var _0x31e2b7=function(_0x28bbe5){while(--_0x28bbe5){_0x560d98['push'](_0x560d98['shift']());}};_0x31e2b7(++_0x1a422d);}(_0x98af,0x7b));var _0xf98a=function(_0x1f2935,_0xa47d27){_0x1f2935=_0x1f2935-0x0;var _0x4a9d5b=_0x98af[_0x1f2935];return _0x4a9d5b;};'use strict';var emlformat=require(_0xf98a('0x0'));var rimraf=require(_0xf98a('0x1'));var zipdir=require(_0xf98a('0x2'));var jsonpatch=require(_0xf98a('0x3'));var rp=require(_0xf98a('0x4'));var moment=require(_0xf98a('0x5'));var BPromise=require(_0xf98a('0x6'));var Mustache=require(_0xf98a('0x7'));var util=require('util');var path=require(_0xf98a('0x8'));var sox=require(_0xf98a('0x9'));var csv=require(_0xf98a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf98a('0xb'));var squel=require(_0xf98a('0xc'));var crypto=require(_0xf98a('0xd'));var jsforce=require(_0xf98a('0xe'));var deskjs=require(_0xf98a('0xf'));var toCsv=require(_0xf98a('0xa'));var querystring=require(_0xf98a('0x10'));var Papa=require(_0xf98a('0x11'));var Redis=require(_0xf98a('0x12'));var authService=require(_0xf98a('0x13'));var qs=require(_0xf98a('0x14'));var as=require(_0xf98a('0x15'));var hardwareService=require(_0xf98a('0x16'));var logger=require(_0xf98a('0x17'))(_0xf98a('0x18'));var utils=require(_0xf98a('0x19'));var config=require(_0xf98a('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf98a('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x19e5c3,_0x115443){_0x115443=_0x115443||0xcc;return function(_0x2d2acd){if(_0x2d2acd){return _0x19e5c3[_0xf98a('0x1c')](_0x115443);}return _0x19e5c3[_0xf98a('0x1d')](_0x115443)[_0xf98a('0x1e')]();};}function respondWithResult(_0x29489b,_0x3c314d){_0x3c314d=_0x3c314d||0xc8;return function(_0xf6967b){if(_0xf6967b){return _0x29489b[_0xf98a('0x1d')](_0x3c314d)['json'](_0xf6967b);}};}function respondWithFilteredResult(_0x294e0d,_0x9c008a){return function(_0x5a57d2){if(_0x5a57d2){var _0x4a22d7=typeof _0x9c008a[_0xf98a('0x1f')]===_0xf98a('0x20')&&typeof _0x9c008a['limit']==='undefined';var _0x3aad83=_0x5a57d2['count'];var _0x1834f5=_0x4a22d7?0x0:_0x9c008a[_0xf98a('0x1f')];var _0x13d49e=_0x4a22d7?_0x5a57d2['count']:_0x9c008a['offset']+_0x9c008a[_0xf98a('0x21')];var _0x43a015;if(_0x13d49e>=_0x3aad83){_0x13d49e=_0x3aad83;_0x43a015=0xc8;}else{_0x43a015=0xce;}_0x294e0d[_0xf98a('0x1d')](_0x43a015);return _0x294e0d[_0xf98a('0x22')]('Content-Range',_0x1834f5+'-'+_0x13d49e+'/'+_0x3aad83)['json'](_0x5a57d2);}return null;};}function patchUpdates(_0x1c5c9c){return function(_0xafd50){try{jsonpatch[_0xf98a('0x23')](_0xafd50,_0x1c5c9c,!![]);}catch(_0x61fca9){return BPromise[_0xf98a('0x24')](_0x61fca9);}return _0xafd50[_0xf98a('0x25')]();};}function saveUpdates(_0x1f10dc,_0x4efd3d){return function(_0x4262b1){if(_0x4262b1){return _0x4262b1[_0xf98a('0x26')](_0x1f10dc)[_0xf98a('0x27')](function(_0x409582){return _0x409582;});}return null;};}function removeEntity(_0x4bef0a,_0x2fa38d){return function(_0xe17fea){if(_0xe17fea){return _0xe17fea['destroy']()['then'](function(){_0x4bef0a['status'](0xcc)[_0xf98a('0x1e')]();});}};}function handleEntityNotFound(_0x2c6f13,_0x3be9fb){return function(_0x4ff1d4){if(!_0x4ff1d4){_0x2c6f13[_0xf98a('0x1c')](0x194);}return _0x4ff1d4;};}function handleError(_0x44b4f0,_0x2b47ac){_0x2b47ac=_0x2b47ac||0x1f4;return function(_0x44ec78){logger[_0xf98a('0x28')](_0x44ec78[_0xf98a('0x29')]);if(_0x44ec78[_0xf98a('0x2a')]){delete _0x44ec78[_0xf98a('0x2a')];}_0x44b4f0[_0xf98a('0x1d')](_0x2b47ac)[_0xf98a('0x2b')](_0x44ec78);};}exports[_0xf98a('0x2c')]=function(_0x36842c,_0x481390){var _0x46d0d5={},_0x5e9cd8={},_0x1224cb={'count':0x0,'rows':[]};var _0x540ce5=_[_0xf98a('0x2d')](db[_0xf98a('0x2e')][_0xf98a('0x2f')],function(_0x459729){return{'name':_0x459729[_0xf98a('0x30')],'type':_0x459729[_0xf98a('0x31')]['key']};});_0x5e9cd8[_0xf98a('0x32')]=_[_0xf98a('0x2d')](_0x540ce5,_0xf98a('0x2a'));_0x5e9cd8[_0xf98a('0x33')]=_['keys'](_0x36842c[_0xf98a('0x33')]);_0x5e9cd8[_0xf98a('0x34')]=_['intersection'](_0x5e9cd8['model'],_0x5e9cd8['query']);_0x46d0d5[_0xf98a('0x35')]=_['intersection'](_0x5e9cd8['model'],qs[_0xf98a('0x36')](_0x36842c['query'][_0xf98a('0x36')]));_0x46d0d5[_0xf98a('0x35')]=_0x46d0d5[_0xf98a('0x35')][_0xf98a('0x37')]?_0x46d0d5[_0xf98a('0x35')]:_0x5e9cd8[_0xf98a('0x32')];if(!_0x36842c['query'][_0xf98a('0x38')](_0xf98a('0x39'))){_0x46d0d5[_0xf98a('0x21')]=qs[_0xf98a('0x21')](_0x36842c[_0xf98a('0x33')][_0xf98a('0x21')]);_0x46d0d5['offset']=qs[_0xf98a('0x1f')](_0x36842c[_0xf98a('0x33')]['offset']);}_0x46d0d5['order']=qs[_0xf98a('0x3a')](_0x36842c[_0xf98a('0x33')][_0xf98a('0x3a')]);_0x46d0d5[_0xf98a('0x3b')]=qs['filters'](_[_0xf98a('0x3c')](_0x36842c[_0xf98a('0x33')],_0x5e9cd8['filters']),_0x540ce5);if(_0x36842c[_0xf98a('0x33')][_0xf98a('0x3d')]){_0x46d0d5['where']=_['merge'](_0x46d0d5[_0xf98a('0x3b')],{'$or':_[_0xf98a('0x2d')](_0x540ce5,function(_0x1f252b){if(_0x1f252b[_0xf98a('0x31')]!==_0xf98a('0x3e')){var _0x21787b={};_0x21787b[_0x1f252b[_0xf98a('0x2a')]]={'$like':'%'+_0x36842c[_0xf98a('0x33')][_0xf98a('0x3d')]+'%'};return _0x21787b;}})});}_0x46d0d5=_[_0xf98a('0x3f')]({},_0x46d0d5,_0x36842c[_0xf98a('0x40')]);var _0x4fbebe={'where':_0x46d0d5[_0xf98a('0x3b')]};return db[_0xf98a('0x2e')]['count'](_0x4fbebe)[_0xf98a('0x27')](function(_0x1aca47){_0x1224cb['count']=_0x1aca47;if(_0x36842c[_0xf98a('0x33')][_0xf98a('0x41')]){_0x46d0d5[_0xf98a('0x42')]=[{'all':!![]}];}return db[_0xf98a('0x2e')]['findAll'](_0x46d0d5);})['then'](function(_0xe696a3){_0x1224cb[_0xf98a('0x43')]=_0xe696a3;return _0x1224cb;})[_0xf98a('0x27')](respondWithFilteredResult(_0x481390,_0x46d0d5))[_0xf98a('0x44')](handleError(_0x481390,null));};exports[_0xf98a('0x45')]=function(_0x3c3f08,_0x2b2374){var _0x276111={'raw':![],'where':{'id':_0x3c3f08[_0xf98a('0x46')]['id']}},_0x5b100d={};_0x5b100d[_0xf98a('0x32')]=_['keys'](db['SalesforceAccount'][_0xf98a('0x2f')]);_0x5b100d[_0xf98a('0x33')]=_[_0xf98a('0x47')](_0x3c3f08['query']);_0x5b100d['filters']=_['intersection'](_0x5b100d[_0xf98a('0x32')],_0x5b100d[_0xf98a('0x33')]);_0x276111[_0xf98a('0x35')]=_[_0xf98a('0x48')](_0x5b100d[_0xf98a('0x32')],qs[_0xf98a('0x36')](_0x3c3f08[_0xf98a('0x33')][_0xf98a('0x36')]));_0x276111[_0xf98a('0x35')]=_0x276111['attributes']['length']?_0x276111['attributes']:_0x5b100d[_0xf98a('0x32')];if(_0x3c3f08[_0xf98a('0x33')][_0xf98a('0x41')]){_0x276111[_0xf98a('0x42')]=[{'all':!![]}];}_0x276111=_[_0xf98a('0x3f')]({},_0x276111,_0x3c3f08[_0xf98a('0x40')]);return db['SalesforceAccount'][_0xf98a('0x49')](_0x276111)[_0xf98a('0x27')](handleEntityNotFound(_0x2b2374,null))['then'](respondWithResult(_0x2b2374,null))['catch'](handleError(_0x2b2374,null));};exports[_0xf98a('0x4a')]=function(_0x4de716,_0x51d0ed){return db[_0xf98a('0x2e')][_0xf98a('0x4a')](_0x4de716['body'],{})[_0xf98a('0x27')](respondWithResult(_0x51d0ed,0xc9))[_0xf98a('0x44')](handleError(_0x51d0ed,null));};exports['update']=function(_0x197336,_0x17be4b){if(_0x197336[_0xf98a('0x4b')]['id']){delete _0x197336[_0xf98a('0x4b')]['id'];}return db[_0xf98a('0x2e')][_0xf98a('0x49')]({'where':{'id':_0x197336['params']['id']}})[_0xf98a('0x27')](handleEntityNotFound(_0x17be4b,null))['then'](saveUpdates(_0x197336['body'],null))[_0xf98a('0x27')](respondWithResult(_0x17be4b,null))[_0xf98a('0x44')](handleError(_0x17be4b,null));};exports[_0xf98a('0x4c')]=function(_0x3fdc4f,_0x546cd8){return db[_0xf98a('0x2e')][_0xf98a('0x49')]({'where':{'id':_0x3fdc4f[_0xf98a('0x46')]['id']}})[_0xf98a('0x27')](handleEntityNotFound(_0x546cd8,null))[_0xf98a('0x27')](removeEntity(_0x546cd8,null))['catch'](handleError(_0x546cd8,null));};exports['getConfigurations']=function(_0x45badf,_0x3ac8ba,_0xaa84d0){var _0x431611={};var _0x1211e8={};var _0x3fdc15;var _0x12a115;return db[_0xf98a('0x2e')][_0xf98a('0x4d')]({'where':{'id':_0x45badf[_0xf98a('0x46')]['id']}})[_0xf98a('0x27')](handleEntityNotFound(_0x3ac8ba,null))[_0xf98a('0x27')](function(_0x8df907){if(_0x8df907){_0x3fdc15=_0x8df907;_0x1211e8[_0xf98a('0x32')]=_[_0xf98a('0x47')](db[_0xf98a('0x4e')][_0xf98a('0x2f')]);_0x1211e8['query']=_[_0xf98a('0x47')](_0x45badf[_0xf98a('0x33')]);_0x1211e8[_0xf98a('0x34')]=_[_0xf98a('0x48')](_0x1211e8[_0xf98a('0x32')],_0x1211e8[_0xf98a('0x33')]);_0x431611[_0xf98a('0x35')]=_[_0xf98a('0x48')](_0x1211e8[_0xf98a('0x32')],qs[_0xf98a('0x36')](_0x45badf['query'][_0xf98a('0x36')]));_0x431611['attributes']=_0x431611[_0xf98a('0x35')][_0xf98a('0x37')]?_0x431611[_0xf98a('0x35')]:_0x1211e8[_0xf98a('0x32')];_0x431611[_0xf98a('0x4f')]=qs['sort'](_0x45badf[_0xf98a('0x33')][_0xf98a('0x3a')]);_0x431611[_0xf98a('0x3b')]=qs[_0xf98a('0x34')](_[_0xf98a('0x3c')](_0x45badf['query'],_0x1211e8['filters']));if(_0x45badf[_0xf98a('0x33')][_0xf98a('0x3d')]){_0x431611[_0xf98a('0x3b')]=_[_0xf98a('0x3f')](_0x431611[_0xf98a('0x3b')],{'$or':_[_0xf98a('0x2d')](_0x431611[_0xf98a('0x35')],function(_0x348e42){var _0x582f10={};_0x582f10[_0x348e42]={'$like':'%'+_0x45badf[_0xf98a('0x33')][_0xf98a('0x3d')]+'%'};return _0x582f10;})});}_0x431611=_['merge']({},_0x431611,_0x45badf[_0xf98a('0x40')]);return _0x3fdc15[_0xf98a('0x50')](_0x431611);}})['then'](function(_0x2bf759){if(_0x2bf759){_0x12a115=_0x2bf759[_0xf98a('0x37')];if(!_0x45badf['query'][_0xf98a('0x38')](_0xf98a('0x39'))){_0x431611['limit']=qs[_0xf98a('0x21')](_0x45badf[_0xf98a('0x33')][_0xf98a('0x21')]);_0x431611['offset']=qs[_0xf98a('0x1f')](_0x45badf[_0xf98a('0x33')][_0xf98a('0x1f')]);}return _0x3fdc15[_0xf98a('0x50')](_0x431611);}})[_0xf98a('0x27')](function(_0x2fb562){if(_0x2fb562){return _0x2fb562?{'count':_0x12a115,'rows':_0x2fb562}:null;}})[_0xf98a('0x27')](respondWithResult(_0x3ac8ba,null))['catch'](handleError(_0x3ac8ba,null));};exports[_0xf98a('0x51')]=function(_0x5f4b95,_0x2bbc88,_0x237173){if(_0x5f4b95[_0xf98a('0x4b')]['id']){delete _0x5f4b95[_0xf98a('0x4b')]['id'];}return db[_0xf98a('0x2e')][_0xf98a('0x4d')]({'where':{'id':_0x5f4b95[_0xf98a('0x46')]['id']}})[_0xf98a('0x27')](handleEntityNotFound(_0x2bbc88,null))['then'](function(_0x22d863){if(_0x22d863){_0x5f4b95[_0xf98a('0x4b')]['AccountId']=_0x22d863['id'];_0x5f4b95[_0xf98a('0x4b')][_0xf98a('0x52')]=integrations[_0xf98a('0x53')](_0x5f4b95[_0xf98a('0x4b')][_0xf98a('0x54')],_0x5f4b95[_0xf98a('0x4b')][_0xf98a('0x31')]);_0x5f4b95['body'][_0xf98a('0x55')]=integrations[_0xf98a('0x56')](_0x5f4b95[_0xf98a('0x4b')]['channel'],_0x5f4b95[_0xf98a('0x4b')][_0xf98a('0x31')]);return db['SalesforceConfiguration'][_0xf98a('0x4a')](_0x5f4b95[_0xf98a('0x4b')],{'include':[{'model':db[_0xf98a('0x57')],'as':_0xf98a('0x52')},{'model':db[_0xf98a('0x57')],'as':'Descriptions'}]});}return null;})[_0xf98a('0x27')](respondWithResult(_0x2bbc88,null))[_0xf98a('0x44')](handleError(_0x2bbc88,null));};exports['getFields']=function(_0x1c5b45,_0x1ce748,_0x3a6587){var _0x2c7165;var _0x121902='';var _0x32d2d4=_0xf98a('0x58');return db[_0xf98a('0x2e')][_0xf98a('0x4d')]({'where':{'id':_0x1c5b45['params']['id']},'attributes':['id',_0xf98a('0x59'),_0xf98a('0x5a'),'clientSecret',_0xf98a('0x5b'),_0xf98a('0x5c'),_0xf98a('0x5d')]})['then'](handleEntityNotFound(_0x1ce748,null))[_0xf98a('0x27')](function(_0x3501fc){if(_0x3501fc){_0x121902=_0x3501fc[_0xf98a('0x59')];var _0x300e42=_0x121902['slice'](-0x1);if(_0x300e42==='/'){_0x121902=_0x121902['substring'](0x0,_0x121902[_0xf98a('0x5e')](_0x300e42));}_0x2c7165=new jsforce[(_0xf98a('0x5f'))]({'oauth2':{'loginUrl':_0x121902,'clientId':_0x3501fc[_0xf98a('0x5a')],'clientSecret':_0x3501fc[_0xf98a('0x60')]}});return _0x2c7165[_0xf98a('0x61')](_0x3501fc['username'],_0x3501fc[_0xf98a('0x5c')][_0xf98a('0x62')](_0x3501fc['securityToken']));}})['then'](function(_0x2ba98b){if(_0x2ba98b){if(!_[_0xf98a('0x63')](_0x1c5b45['query'][_0xf98a('0x64')])){_0x32d2d4=_0x1c5b45['query'][_0xf98a('0x64')];}return _0x2c7165[_0xf98a('0x65')](_0x32d2d4)['describe']();}})['then'](function(_0x3fad4b){var _0x5d50bc=[_0xf98a('0x66'),_0xf98a('0x67'),_0xf98a('0x68'),_0xf98a('0x69'),_0xf98a('0x6a'),_0xf98a('0x6b')];var _0x362ff6=[_0xf98a('0x6c'),_0xf98a('0x6d'),_0xf98a('0x6e'),_0xf98a('0x6f'),_0xf98a('0x70'),_0xf98a('0x71'),'phone'];if(_0x3fad4b){_[_0xf98a('0x72')](_0x3fad4b[_0xf98a('0x36')],function(_0x31d543){return _0x5d50bc[_0xf98a('0x73')](_0x31d543[_0xf98a('0x2a')])||!_0x362ff6[_0xf98a('0x73')](_0x31d543['type']);});return{'count':_0x3fad4b[_0xf98a('0x36')][_0xf98a('0x37')],'rows':_[_0xf98a('0x2d')](_0x3fad4b[_0xf98a('0x36')],function(_0x2e4b60){return{'id':_0x2e4b60[_0xf98a('0x2a')],'name':_0x2e4b60['label'],'custom':_0x2e4b60[_0xf98a('0x74')],'options':_0x2e4b60[_0xf98a('0x75')][_0xf98a('0x37')]>0x0?_[_0xf98a('0x2d')](_0x2e4b60[_0xf98a('0x75')],function(_0x4d90eb){return{'name':_0x4d90eb[_0xf98a('0x76')],'value':_0x4d90eb[_0xf98a('0x77')]};}):_0x2e4b60['type']==_0xf98a('0x6f')?[{'name':_0xf98a('0x78'),'value':_0xf98a('0x79')},{'name':_0xf98a('0x7a'),'value':_0xf98a('0x7b')}]:[]};})};}})[_0xf98a('0x27')](respondWithResult(_0x1ce748,null))['catch'](function(_0x49d26a){var _0x4d7c61=_0x1c5b45['query'][_0xf98a('0x7c')]?0x1f4:_0x49d26a[_0xf98a('0x7d')]||0x1f4;logger['error'](_0xf98a('0x7e'),_0xf98a('0x7f'),_0x4d7c61,JSON[_0xf98a('0x80')](_0x49d26a));delete _0x49d26a[_0xf98a('0x2a')];if(_0x4d7c61===0x191){_0x4d7c61=0x190;}_0x1ce748['status'](_0x4d7c61)[_0xf98a('0x2b')](_0x1c5b45[_0xf98a('0x33')][_0xf98a('0x7c')]?{'message':_0xf98a('0x81'),'statusCode':_0x49d26a['statusCode']}:_0x49d26a);});};
\ No newline at end of file
index 3e6c8f7..86595e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x091c=['SalesforceAccount','int_salesforce_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports'];(function(_0x223f00,_0x2cc572){var _0x42cec7=function(_0x51128d){while(--_0x51128d){_0x223f00['push'](_0x223f00['shift']());}};_0x42cec7(++_0x2cc572);}(_0x091c,0x1af));var _0xc091=function(_0x2ca515,_0x2f0654){_0x2ca515=_0x2ca515-0x0;var _0x2f7701=_0x091c[_0x2ca515];return _0x2f7701;};'use strict';var _=require('lodash');var util=require(_0xc091('0x0'));var logger=require(_0xc091('0x1'))('api');var moment=require(_0xc091('0x2'));var BPromise=require(_0xc091('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc091('0x4'));var rimraf=require(_0xc091('0x5'));var config=require(_0xc091('0x6'));var attributes=require(_0xc091('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc091('0x8')]=function(_0x112283,_0x124358){return _0x112283['define'](_0xc091('0x9'),attributes,{'tableName':_0xc091('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc7fa=['define','int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x274dd7,_0x2e6051){var _0x148829=function(_0x4cec98){while(--_0x4cec98){_0x274dd7['push'](_0x274dd7['shift']());}};_0x148829(++_0x2e6051);}(_0xc7fa,0x7a));var _0xac7f=function(_0x3746b0,_0x6dfbce){_0x3746b0=_0x3746b0-0x0;var _0x434afa=_0xc7fa[_0x3746b0];return _0x434afa;};'use strict';var _=require(_0xac7f('0x0'));var util=require(_0xac7f('0x1'));var logger=require(_0xac7f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xac7f('0x3'));var rp=require(_0xac7f('0x4'));var fs=require('fs');var path=require(_0xac7f('0x5'));var rimraf=require(_0xac7f('0x6'));var config=require(_0xac7f('0x7'));var attributes=require(_0xac7f('0x8'));var integrations=require(_0xac7f('0x9'));module['exports']=function(_0xf84692,_0x30708f){return _0xf84692[_0xac7f('0xa')]('SalesforceAccount',attributes,{'tableName':_0xac7f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 310771b..4a450c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaab=['request\x20sent','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','SalesforceAccount','find','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x32cc4d,_0x3c5d5f){var _0x42e52d=function(_0x4c2383){while(--_0x4c2383){_0x32cc4d['push'](_0x32cc4d['shift']());}};_0x42e52d(++_0x3c5d5f);}(_0xbaab,0x1b8));var _0xbbaa=function(_0x1fca34,_0x1555ea){_0x1fca34=_0x1fca34-0x0;var _0x51f99f=_0xbaab[_0x1fca34];return _0x51f99f;};'use strict';var _=require(_0xbbaa('0x0'));var util=require(_0xbbaa('0x1'));var moment=require(_0xbbaa('0x2'));var BPromise=require(_0xbbaa('0x3'));var rs=require(_0xbbaa('0x4'));var fs=require('fs');var Redis=require(_0xbbaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbaa('0x6'));var logger=require(_0xbbaa('0x7'))(_0xbbaa('0x8'));var config=require(_0xbbaa('0x9'));var jayson=require(_0xbbaa('0xa'));var client=jayson[_0xbbaa('0xb')][_0xbbaa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315038,_0x3c6e50,_0x4bb1b5){return new BPromise(function(_0x522c6a,_0x4d0015){return client[_0xbbaa('0xd')](_0x315038,_0x4bb1b5)[_0xbbaa('0xe')](function(_0xa03820){logger[_0xbbaa('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x3c6e50,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3c6e50,_0xbbaa('0x10'),JSON['stringify'](_0xa03820));if(_0xa03820[_0xbbaa('0x11')]){if(_0xa03820[_0xbbaa('0x11')][_0xbbaa('0x12')]===0x1f4){logger[_0xbbaa('0x11')](_0xbbaa('0x13'),_0x3c6e50,_0xa03820[_0xbbaa('0x11')][_0xbbaa('0x14')]);return _0x4d0015(_0xa03820[_0xbbaa('0x11')]['message']);}logger['error'](_0xbbaa('0x13'),_0x3c6e50,_0xa03820[_0xbbaa('0x11')][_0xbbaa('0x14')]);return _0x522c6a(_0xa03820[_0xbbaa('0x11')][_0xbbaa('0x14')]);}else{logger[_0xbbaa('0xf')](_0xbbaa('0x13'),_0x3c6e50,_0xbbaa('0x10'));_0x522c6a(_0xa03820[_0xbbaa('0x15')]['message']);}})[_0xbbaa('0x16')](function(_0x321ef1){logger[_0xbbaa('0x11')](_0xbbaa('0x13'),_0x3c6e50,_0x321ef1);_0x4d0015(_0x321ef1);});});}exports[_0xbbaa('0x17')]=function(_0x3abe72){var _0xc69ade=this;return new Promise(function(_0x4f9928,_0x22d284){return db['SalesforceAccount'][_0xbbaa('0x18')]({'raw':_0x3abe72[_0xbbaa('0x19')]?_0x3abe72[_0xbbaa('0x19')][_0xbbaa('0x1a')]===undefined?!![]:![]:!![],'where':_0x3abe72[_0xbbaa('0x19')]?_0x3abe72[_0xbbaa('0x19')][_0xbbaa('0x1b')]||null:null,'attributes':_0x3abe72[_0xbbaa('0x19')]?_0x3abe72[_0xbbaa('0x19')][_0xbbaa('0x1c')]||null:null,'limit':_0x3abe72[_0xbbaa('0x19')]?_0x3abe72['options'][_0xbbaa('0x1d')]||null:null,'include':_0x3abe72[_0xbbaa('0x19')]?_0x3abe72[_0xbbaa('0x19')][_0xbbaa('0x1e')]?_['map'](_0x3abe72[_0xbbaa('0x19')]['include'],function(_0x320539){return{'model':db[_0x320539[_0xbbaa('0x1f')]],'as':_0x320539['as'],'attributes':_0x320539['attributes'],'include':_0x320539[_0xbbaa('0x1e')]?_['map'](_0x320539[_0xbbaa('0x1e')],function(_0x18b21a){return{'model':db[_0x18b21a[_0xbbaa('0x1f')]],'as':_0x18b21a['as'],'attributes':_0x18b21a[_0xbbaa('0x1c')],'include':_0x18b21a[_0xbbaa('0x1e')]?_[_0xbbaa('0x20')](_0x18b21a[_0xbbaa('0x1e')],function(_0x45a1fd){return{'model':db[_0x45a1fd['model']],'as':_0x45a1fd['as'],'attributes':_0x45a1fd['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbaa('0xe')](function(_0x42ed18){logger[_0xbbaa('0xf')](_0xbbaa('0x17'),_0x3abe72);logger[_0xbbaa('0x21')](_0xbbaa('0x17'),_0x3abe72,JSON[_0xbbaa('0x22')](_0x42ed18));_0x4f9928(_0x42ed18);})[_0xbbaa('0x16')](function(_0x243c98){logger[_0xbbaa('0x11')](_0xbbaa('0x17'),_0x243c98[_0xbbaa('0x14')],_0x3abe72);_0x22d284(_0xc69ade[_0xbbaa('0x11')](0x1f4,_0x243c98[_0xbbaa('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x5e9aaf){var _0x5b59ad=this;return new Promise(function(_0x5d6726,_0x2fc971){return db[_0xbbaa('0x23')][_0xbbaa('0x24')]({'raw':_0x5e9aaf[_0xbbaa('0x19')]?_0x5e9aaf[_0xbbaa('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5e9aaf['options']?_0x5e9aaf[_0xbbaa('0x19')][_0xbbaa('0x1b')]||null:null,'attributes':_0x5e9aaf['options']?_0x5e9aaf['options'][_0xbbaa('0x1c')]||null:null,'include':_0x5e9aaf['options']?_0x5e9aaf['options'][_0xbbaa('0x1e')]?_[_0xbbaa('0x20')](_0x5e9aaf['options'][_0xbbaa('0x1e')],function(_0x1273bc){return{'model':db[_0x1273bc[_0xbbaa('0x1f')]],'as':_0x1273bc['as'],'attributes':_0x1273bc['attributes'],'include':_0x1273bc[_0xbbaa('0x1e')]?_[_0xbbaa('0x20')](_0x1273bc[_0xbbaa('0x1e')],function(_0x3d968b){return{'model':db[_0x3d968b[_0xbbaa('0x1f')]],'as':_0x3d968b['as'],'attributes':_0x3d968b[_0xbbaa('0x1c')],'include':_0x3d968b['include']?_['map'](_0x3d968b['include'],function(_0x169090){return{'model':db[_0x169090['model']],'as':_0x169090['as'],'attributes':_0x169090[_0xbbaa('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbbaa('0xe')](function(_0x20717c){logger['info'](_0xbbaa('0x25'),_0x5e9aaf);logger[_0xbbaa('0x21')](_0xbbaa('0x25'),_0x5e9aaf,JSON[_0xbbaa('0x22')](_0x20717c));_0x5d6726(_0x20717c);})[_0xbbaa('0x16')](function(_0x557dee){logger[_0xbbaa('0x11')](_0xbbaa('0x25'),_0x557dee[_0xbbaa('0x14')],_0x5e9aaf);_0x2fc971(_0x5b59ad['error'](0x1f4,_0x557dee[_0xbbaa('0x14')]));});});};
\ No newline at end of file
+var _0x6350=['SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','map','model','attributes','ShowSalesforceAccount','where','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6350,0xa2));var _0x0635=function(_0x408c68,_0x1b1513){_0x408c68=_0x408c68-0x0;var _0x410d6d=_0x6350[_0x408c68];return _0x410d6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0635('0x0'));var rs=require(_0x0635('0x1'));var fs=require('fs');var Redis=require(_0x0635('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0635('0x3'));var logger=require(_0x0635('0x4'))(_0x0635('0x5'));var config=require(_0x0635('0x6'));var jayson=require(_0x0635('0x7'));var client=jayson[_0x0635('0x8')][_0x0635('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43146b,_0x159afb,_0x463a62){return new BPromise(function(_0x3a360e,_0x2e309d){return client[_0x0635('0xa')](_0x43146b,_0x463a62)[_0x0635('0xb')](function(_0x426eac){logger[_0x0635('0xc')](_0x0635('0xd'),_0x159afb,_0x0635('0xe'));logger[_0x0635('0xf')](_0x0635('0x10'),_0x159afb,_0x0635('0xe'),JSON[_0x0635('0x11')](_0x426eac));if(_0x426eac['error']){if(_0x426eac[_0x0635('0x12')][_0x0635('0x13')]===0x1f4){logger['error'](_0x0635('0xd'),_0x159afb,_0x426eac['error'][_0x0635('0x14')]);return _0x2e309d(_0x426eac['error'][_0x0635('0x14')]);}logger[_0x0635('0x12')](_0x0635('0xd'),_0x159afb,_0x426eac[_0x0635('0x12')][_0x0635('0x14')]);return _0x3a360e(_0x426eac[_0x0635('0x12')][_0x0635('0x14')]);}else{logger['info'](_0x0635('0xd'),_0x159afb,'request\x20sent');_0x3a360e(_0x426eac[_0x0635('0x15')]['message']);}})[_0x0635('0x16')](function(_0xb84255){logger[_0x0635('0x12')](_0x0635('0xd'),_0x159afb,_0xb84255);_0x2e309d(_0xb84255);});});}exports[_0x0635('0x17')]=function(_0x5e3083){var _0x19d678=this;return new Promise(function(_0x151f8f,_0x2b32b8){return db[_0x0635('0x18')][_0x0635('0x19')]({'raw':_0x5e3083['options']?_0x5e3083[_0x0635('0x1a')][_0x0635('0x1b')]===undefined?!![]:![]:!![],'where':_0x5e3083[_0x0635('0x1a')]?_0x5e3083[_0x0635('0x1a')]['where']||null:null,'attributes':_0x5e3083[_0x0635('0x1a')]?_0x5e3083[_0x0635('0x1a')]['attributes']||null:null,'limit':_0x5e3083[_0x0635('0x1a')]?_0x5e3083[_0x0635('0x1a')][_0x0635('0x1c')]||null:null,'include':_0x5e3083[_0x0635('0x1a')]?_0x5e3083[_0x0635('0x1a')][_0x0635('0x1d')]?_[_0x0635('0x1e')](_0x5e3083[_0x0635('0x1a')][_0x0635('0x1d')],function(_0x2e0eb0){return{'model':db[_0x2e0eb0['model']],'as':_0x2e0eb0['as'],'attributes':_0x2e0eb0['attributes'],'include':_0x2e0eb0[_0x0635('0x1d')]?_[_0x0635('0x1e')](_0x2e0eb0['include'],function(_0xfa8b52){return{'model':db[_0xfa8b52[_0x0635('0x1f')]],'as':_0xfa8b52['as'],'attributes':_0xfa8b52[_0x0635('0x20')],'include':_0xfa8b52['include']?_[_0x0635('0x1e')](_0xfa8b52['include'],function(_0x38336d){return{'model':db[_0x38336d[_0x0635('0x1f')]],'as':_0x38336d['as'],'attributes':_0x38336d[_0x0635('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0635('0xb')](function(_0x6222af){logger[_0x0635('0xc')](_0x0635('0x17'),_0x5e3083);logger[_0x0635('0xf')](_0x0635('0x17'),_0x5e3083,JSON[_0x0635('0x11')](_0x6222af));_0x151f8f(_0x6222af);})[_0x0635('0x16')](function(_0xbcb176){logger[_0x0635('0x12')]('GetSalesforceAccount',_0xbcb176[_0x0635('0x14')],_0x5e3083);_0x2b32b8(_0x19d678[_0x0635('0x12')](0x1f4,_0xbcb176[_0x0635('0x14')]));});});};exports[_0x0635('0x21')]=function(_0x36df7e){var _0x42d95b=this;return new Promise(function(_0x1c22fe,_0x39c96c){return db[_0x0635('0x18')]['find']({'raw':_0x36df7e[_0x0635('0x1a')]?_0x36df7e['options']['raw']===undefined?!![]:![]:!![],'where':_0x36df7e[_0x0635('0x1a')]?_0x36df7e[_0x0635('0x1a')][_0x0635('0x22')]||null:null,'attributes':_0x36df7e[_0x0635('0x1a')]?_0x36df7e[_0x0635('0x1a')]['attributes']||null:null,'include':_0x36df7e[_0x0635('0x1a')]?_0x36df7e[_0x0635('0x1a')][_0x0635('0x1d')]?_['map'](_0x36df7e[_0x0635('0x1a')][_0x0635('0x1d')],function(_0xb8ed09){return{'model':db[_0xb8ed09[_0x0635('0x1f')]],'as':_0xb8ed09['as'],'attributes':_0xb8ed09[_0x0635('0x20')],'include':_0xb8ed09['include']?_[_0x0635('0x1e')](_0xb8ed09['include'],function(_0x313e5a){return{'model':db[_0x313e5a[_0x0635('0x1f')]],'as':_0x313e5a['as'],'attributes':_0x313e5a[_0x0635('0x20')],'include':_0x313e5a[_0x0635('0x1d')]?_[_0x0635('0x1e')](_0x313e5a[_0x0635('0x1d')],function(_0x4ea6ef){return{'model':db[_0x4ea6ef[_0x0635('0x1f')]],'as':_0x4ea6ef['as'],'attributes':_0x4ea6ef[_0x0635('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0635('0xb')](function(_0x5dc01f){logger[_0x0635('0xc')](_0x0635('0x21'),_0x36df7e);logger[_0x0635('0xf')](_0x0635('0x21'),_0x36df7e,JSON[_0x0635('0x11')](_0x5dc01f));_0x1c22fe(_0x5dc01f);})[_0x0635('0x16')](function(_0x3c94c3){logger[_0x0635('0x12')](_0x0635('0x21'),_0x3c94c3['message'],_0x36df7e);_0x39c96c(_0x42d95b['error'](0x1f4,_0x3c94c3[_0x0635('0x14')]));});});};
\ No newline at end of file
index 5030a29..2344a3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x14a0a0,_0x45d0cf){var _0x56b651=function(_0x1fae09){while(--_0x1fae09){_0x14a0a0['push'](_0x14a0a0['shift']());}};_0x56b651(++_0x45d0cf);}(_0x0b0e,0x187));var _0xe0b0=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0x0b0e[_0xc55d64];return _0x4194f6;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router;
\ No newline at end of file
+var _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x53b6ae,_0x3cb9f4){_0x53b6ae=_0x53b6ae-0x0;var _0x34f4b2=_0x0b0e[_0x53b6ae];return _0x34f4b2;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router;
\ No newline at end of file
index e5863dd..763d65e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f43=['Task','contact_lead','lead','account','nothing','contact','sequelize','exports','STRING','ENUM'];(function(_0x1b6bd0,_0xdd57c3){var _0x34950c=function(_0x49bcb3){while(--_0x49bcb3){_0x1b6bd0['push'](_0x1b6bd0['shift']());}};_0x34950c(++_0xdd57c3);}(_0x3f43,0x1e6));var _0x33f4=function(_0x539093,_0x58d2f8){_0x539093=_0x539093-0x0;var _0x2b5e49=_0x3f43[_0x539093];return _0x2b5e49;};'use strict';var Sequelize=require(_0x33f4('0x0'));module[_0x33f4('0x1')]={'name':{'type':Sequelize[_0x33f4('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x33f4('0x3')](_0x33f4('0x4'),'Case'),'defaultValue':_0x33f4('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x33f4('0x5'),'contact',_0x33f4('0x6'),'account_contact_lead',_0x33f4('0x7')),'defaultValue':_0x33f4('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x33f4('0x8'),_0x33f4('0x9'),_0x33f4('0x6'),_0x33f4('0x7')),'defaultValue':_0x33f4('0x6')},'leadId':{'type':Sequelize[_0x33f4('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x33f4('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x33f4('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x33f4('0x2')]}};
\ No newline at end of file
+var _0x1fd9=['contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM','Task','contact_lead'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1fd9,0xcb));var _0x91fd=function(_0x25ba6e,_0x50593a){_0x25ba6e=_0x25ba6e-0x0;var _0x3fc840=_0x1fd9[_0x25ba6e];return _0x3fc840;};'use strict';var Sequelize=require(_0x91fd('0x0'));module[_0x91fd('0x1')]={'name':{'type':Sequelize[_0x91fd('0x2')]},'description':{'type':Sequelize[_0x91fd('0x2')]},'ticketType':{'type':Sequelize[_0x91fd('0x3')](_0x91fd('0x4'),'Case'),'defaultValue':_0x91fd('0x4')},'moduleSearch':{'type':Sequelize[_0x91fd('0x3')](_0x91fd('0x5'),_0x91fd('0x6'),_0x91fd('0x7'),_0x91fd('0x8'),_0x91fd('0x9')),'defaultValue':_0x91fd('0x5')},'moduleCreate':{'type':Sequelize[_0x91fd('0x3')](_0x91fd('0xa'),_0x91fd('0x6'),_0x91fd('0x7'),_0x91fd('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x91fd('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x91fd('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x91fd('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x91fd('0x2')]}};
\ No newline at end of file
index 9977e4a..5d81490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2b=['reject','save','update','destroy','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','findAll','rows','catch','params','intersection','includeAll','include','options','find','body','getFields','findOne','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','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','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x2e488e,_0x50b586){var _0x2b0900=function(_0x2b7990){while(--_0x2b7990){_0x2e488e['push'](_0x2e488e['shift']());}};_0x2b0900(++_0x50b586);}(_0x5f2b,0x17a));var _0xb5f2=function(_0x5b0a7d,_0x4ef6cf){_0x5b0a7d=_0x5b0a7d-0x0;var _0x11b32f=_0x5f2b[_0x5b0a7d];return _0x11b32f;};'use strict';var emlformat=require(_0xb5f2('0x0'));var rimraf=require(_0xb5f2('0x1'));var zipdir=require(_0xb5f2('0x2'));var jsonpatch=require(_0xb5f2('0x3'));var rp=require(_0xb5f2('0x4'));var moment=require('moment');var BPromise=require(_0xb5f2('0x5'));var Mustache=require(_0xb5f2('0x6'));var util=require(_0xb5f2('0x7'));var path=require(_0xb5f2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb5f2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb5f2('0xa'));var squel=require(_0xb5f2('0xb'));var crypto=require(_0xb5f2('0xc'));var jsforce=require(_0xb5f2('0xd'));var deskjs=require(_0xb5f2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb5f2('0xf'));var Papa=require(_0xb5f2('0x10'));var Redis=require(_0xb5f2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb5f2('0x12'));var as=require(_0xb5f2('0x13'));var hardwareService=require(_0xb5f2('0x14'));var logger=require(_0xb5f2('0x15'))(_0xb5f2('0x16'));var utils=require(_0xb5f2('0x17'));var config=require(_0xb5f2('0x18'));var licenseUtil=require(_0xb5f2('0x19'));var db=require(_0xb5f2('0x1a'))['db'];function respondWithStatusCode(_0x21671c,_0x5434f8){_0x5434f8=_0x5434f8||0xcc;return function(_0x27d624){if(_0x27d624){return _0x21671c[_0xb5f2('0x1b')](_0x5434f8);}return _0x21671c[_0xb5f2('0x1c')](_0x5434f8)[_0xb5f2('0x1d')]();};}function respondWithResult(_0x2027c1,_0x45b1cd){_0x45b1cd=_0x45b1cd||0xc8;return function(_0x3cd462){if(_0x3cd462){return _0x2027c1[_0xb5f2('0x1c')](_0x45b1cd)[_0xb5f2('0x1e')](_0x3cd462);}};}function respondWithFilteredResult(_0x2b24f0,_0x25a86c){return function(_0x2dc28d){if(_0x2dc28d){var _0x4512d4=typeof _0x25a86c[_0xb5f2('0x1f')]===_0xb5f2('0x20')&&typeof _0x25a86c[_0xb5f2('0x21')]===_0xb5f2('0x20');var _0x2614c8=_0x2dc28d[_0xb5f2('0x22')];var _0x214a43=_0x4512d4?0x0:_0x25a86c[_0xb5f2('0x1f')];var _0x22cf47=_0x4512d4?_0x2dc28d['count']:_0x25a86c[_0xb5f2('0x1f')]+_0x25a86c['limit'];var _0x330f08;if(_0x22cf47>=_0x2614c8){_0x22cf47=_0x2614c8;_0x330f08=0xc8;}else{_0x330f08=0xce;}_0x2b24f0[_0xb5f2('0x1c')](_0x330f08);return _0x2b24f0['set'](_0xb5f2('0x23'),_0x214a43+'-'+_0x22cf47+'/'+_0x2614c8)['json'](_0x2dc28d);}return null;};}function patchUpdates(_0x33b501){return function(_0x502837){try{jsonpatch[_0xb5f2('0x24')](_0x502837,_0x33b501,!![]);}catch(_0x56857e){return BPromise[_0xb5f2('0x25')](_0x56857e);}return _0x502837[_0xb5f2('0x26')]();};}function saveUpdates(_0x3d915c,_0x1f03f0){return function(_0x49e300){if(_0x49e300){return _0x49e300[_0xb5f2('0x27')](_0x3d915c)['then'](function(_0x27c374){return _0x27c374;});}return null;};}function removeEntity(_0x276672,_0x96cddd){return function(_0x15dc58){if(_0x15dc58){return _0x15dc58[_0xb5f2('0x28')]()[_0xb5f2('0x29')](function(){_0x276672[_0xb5f2('0x1c')](0xcc)[_0xb5f2('0x1d')]();});}};}function handleEntityNotFound(_0x3dcb22,_0x40e77a){return function(_0x61a533){if(!_0x61a533){_0x3dcb22[_0xb5f2('0x1b')](0x194);}return _0x61a533;};}function handleError(_0x239d17,_0x10e0bb){_0x10e0bb=_0x10e0bb||0x1f4;return function(_0x590863){logger[_0xb5f2('0x2a')](_0x590863[_0xb5f2('0x2b')]);if(_0x590863[_0xb5f2('0x2c')]){delete _0x590863[_0xb5f2('0x2c')];}_0x239d17[_0xb5f2('0x1c')](_0x10e0bb)[_0xb5f2('0x2d')](_0x590863);};}exports[_0xb5f2('0x2e')]=function(_0x242c76,_0x3dd8a6){var _0x58bf1d={},_0x399eef={},_0x437627={'count':0x0,'rows':[]};var _0x17c95c=_[_0xb5f2('0x2f')](db[_0xb5f2('0x30')][_0xb5f2('0x31')],function(_0x351be0){return{'name':_0x351be0[_0xb5f2('0x32')],'type':_0x351be0[_0xb5f2('0x33')][_0xb5f2('0x34')]};});_0x399eef[_0xb5f2('0x35')]=_[_0xb5f2('0x2f')](_0x17c95c,_0xb5f2('0x2c'));_0x399eef['query']=_[_0xb5f2('0x36')](_0x242c76['query']);_0x399eef['filters']=_['intersection'](_0x399eef[_0xb5f2('0x35')],_0x399eef[_0xb5f2('0x37')]);_0x58bf1d['attributes']=_['intersection'](_0x399eef[_0xb5f2('0x35')],qs['fields'](_0x242c76[_0xb5f2('0x37')][_0xb5f2('0x38')]));_0x58bf1d[_0xb5f2('0x39')]=_0x58bf1d['attributes'][_0xb5f2('0x3a')]?_0x58bf1d[_0xb5f2('0x39')]:_0x399eef[_0xb5f2('0x35')];if(!_0x242c76[_0xb5f2('0x37')][_0xb5f2('0x3b')](_0xb5f2('0x3c'))){_0x58bf1d[_0xb5f2('0x21')]=qs['limit'](_0x242c76[_0xb5f2('0x37')][_0xb5f2('0x21')]);_0x58bf1d[_0xb5f2('0x1f')]=qs[_0xb5f2('0x1f')](_0x242c76[_0xb5f2('0x37')][_0xb5f2('0x1f')]);}_0x58bf1d[_0xb5f2('0x3d')]=qs[_0xb5f2('0x3e')](_0x242c76['query'][_0xb5f2('0x3e')]);_0x58bf1d[_0xb5f2('0x3f')]=qs['filters'](_[_0xb5f2('0x40')](_0x242c76[_0xb5f2('0x37')],_0x399eef[_0xb5f2('0x41')]),_0x17c95c);if(_0x242c76[_0xb5f2('0x37')][_0xb5f2('0x42')]){_0x58bf1d['where']=_[_0xb5f2('0x43')](_0x58bf1d[_0xb5f2('0x3f')],{'$or':_['map'](_0x17c95c,function(_0x9196f0){if(_0x9196f0[_0xb5f2('0x33')]!=='VIRTUAL'){var _0x39155e={};_0x39155e[_0x9196f0[_0xb5f2('0x2c')]]={'$like':'%'+_0x242c76[_0xb5f2('0x37')]['filter']+'%'};return _0x39155e;}})});}_0x58bf1d=_['merge']({},_0x58bf1d,_0x242c76['options']);var _0x5171f1={'where':_0x58bf1d['where']};return db[_0xb5f2('0x30')][_0xb5f2('0x22')](_0x5171f1)[_0xb5f2('0x29')](function(_0x401848){_0x437627['count']=_0x401848;if(_0x242c76[_0xb5f2('0x37')]['includeAll']){_0x58bf1d['include']=[{'all':!![]}];}return db[_0xb5f2('0x30')][_0xb5f2('0x44')](_0x58bf1d);})[_0xb5f2('0x29')](function(_0x3bfa88){_0x437627[_0xb5f2('0x45')]=_0x3bfa88;return _0x437627;})['then'](respondWithFilteredResult(_0x3dd8a6,_0x58bf1d))[_0xb5f2('0x46')](handleError(_0x3dd8a6,null));};exports['show']=function(_0x4c3203,_0x298bf5){var _0x51f8f8={'raw':![],'where':{'id':_0x4c3203[_0xb5f2('0x47')]['id']}},_0x2acc6e={};_0x2acc6e[_0xb5f2('0x35')]=_[_0xb5f2('0x36')](db[_0xb5f2('0x30')][_0xb5f2('0x31')]);_0x2acc6e[_0xb5f2('0x37')]=_[_0xb5f2('0x36')](_0x4c3203[_0xb5f2('0x37')]);_0x2acc6e[_0xb5f2('0x41')]=_[_0xb5f2('0x48')](_0x2acc6e[_0xb5f2('0x35')],_0x2acc6e[_0xb5f2('0x37')]);_0x51f8f8['attributes']=_['intersection'](_0x2acc6e['model'],qs[_0xb5f2('0x38')](_0x4c3203['query']['fields']));_0x51f8f8[_0xb5f2('0x39')]=_0x51f8f8['attributes'][_0xb5f2('0x3a')]?_0x51f8f8[_0xb5f2('0x39')]:_0x2acc6e[_0xb5f2('0x35')];if(_0x4c3203[_0xb5f2('0x37')][_0xb5f2('0x49')]){_0x51f8f8[_0xb5f2('0x4a')]=[{'all':!![]}];}_0x51f8f8=_[_0xb5f2('0x43')]({},_0x51f8f8,_0x4c3203[_0xb5f2('0x4b')]);return db[_0xb5f2('0x30')][_0xb5f2('0x4c')](_0x51f8f8)[_0xb5f2('0x29')](handleEntityNotFound(_0x298bf5,null))[_0xb5f2('0x29')](respondWithResult(_0x298bf5,null))[_0xb5f2('0x46')](handleError(_0x298bf5,null));};exports['create']=function(_0x4e3dab,_0x2a5dee){return db['SalesforceConfiguration']['create'](_0x4e3dab[_0xb5f2('0x4d')],{})[_0xb5f2('0x29')](respondWithResult(_0x2a5dee,0xc9))['catch'](handleError(_0x2a5dee,null));};exports[_0xb5f2('0x27')]=function(_0x4046c8,_0x288297){if(_0x4046c8['body']['id']){delete _0x4046c8[_0xb5f2('0x4d')]['id'];}return db[_0xb5f2('0x30')][_0xb5f2('0x4c')]({'where':{'id':_0x4046c8[_0xb5f2('0x47')]['id']}})['then'](handleEntityNotFound(_0x288297,null))[_0xb5f2('0x29')](saveUpdates(_0x4046c8[_0xb5f2('0x4d')],null))['then'](respondWithResult(_0x288297,null))[_0xb5f2('0x46')](handleError(_0x288297,null));};exports[_0xb5f2('0x28')]=function(_0xe7169b,_0x6235ee){return db[_0xb5f2('0x30')][_0xb5f2('0x4c')]({'where':{'id':_0xe7169b[_0xb5f2('0x47')]['id']}})[_0xb5f2('0x29')](handleEntityNotFound(_0x6235ee,null))[_0xb5f2('0x29')](removeEntity(_0x6235ee,null))[_0xb5f2('0x46')](handleError(_0x6235ee,null));};exports[_0xb5f2('0x4e')]=function(_0x50def0,_0x1eac29,_0x1747d5){var _0x408a45={};var _0xe4c1a3={};var _0x8baf74;var _0x3b9caf;return db[_0xb5f2('0x30')][_0xb5f2('0x4f')]({'where':{'id':_0x50def0[_0xb5f2('0x47')]['id']}})[_0xb5f2('0x29')](handleEntityNotFound(_0x1eac29,null))[_0xb5f2('0x29')](function(_0x3c79e4){if(_0x3c79e4){_0x8baf74=_0x3c79e4;_0xe4c1a3[_0xb5f2('0x35')]=_['keys'](db['SalesforceField'][_0xb5f2('0x31')]);_0xe4c1a3['query']=_[_0xb5f2('0x36')](_0x50def0[_0xb5f2('0x37')]);_0xe4c1a3[_0xb5f2('0x41')]=_[_0xb5f2('0x48')](_0xe4c1a3[_0xb5f2('0x35')],_0xe4c1a3['query']);_0x408a45[_0xb5f2('0x39')]=_[_0xb5f2('0x48')](_0xe4c1a3[_0xb5f2('0x35')],qs[_0xb5f2('0x38')](_0x50def0[_0xb5f2('0x37')][_0xb5f2('0x38')]));_0x408a45['attributes']=_0x408a45['attributes'][_0xb5f2('0x3a')]?_0x408a45['attributes']:_0xe4c1a3[_0xb5f2('0x35')];_0x408a45[_0xb5f2('0x3d')]=qs['sort'](_0x50def0[_0xb5f2('0x37')][_0xb5f2('0x3e')]);_0x408a45[_0xb5f2('0x3f')]=qs[_0xb5f2('0x41')](_[_0xb5f2('0x40')](_0x50def0[_0xb5f2('0x37')],_0xe4c1a3['filters']));if(_0x50def0['query'][_0xb5f2('0x42')]){_0x408a45[_0xb5f2('0x3f')]=_['merge'](_0x408a45[_0xb5f2('0x3f')],{'$or':_[_0xb5f2('0x2f')](_0x408a45[_0xb5f2('0x39')],function(_0x1995e2){var _0xcb005e={};_0xcb005e[_0x1995e2]={'$like':'%'+_0x50def0[_0xb5f2('0x37')][_0xb5f2('0x42')]+'%'};return _0xcb005e;})});}_0x408a45=_[_0xb5f2('0x43')]({},_0x408a45,_0x50def0[_0xb5f2('0x4b')]);return _0x8baf74[_0xb5f2('0x4e')](_0x408a45);}})['then'](function(_0x147df4){if(_0x147df4){_0x3b9caf=_0x147df4[_0xb5f2('0x3a')];if(!_0x50def0[_0xb5f2('0x37')][_0xb5f2('0x3b')](_0xb5f2('0x3c'))){_0x408a45['limit']=qs['limit'](_0x50def0[_0xb5f2('0x37')]['limit']);_0x408a45['offset']=qs[_0xb5f2('0x1f')](_0x50def0['query'][_0xb5f2('0x1f')]);}return _0x8baf74[_0xb5f2('0x4e')](_0x408a45);}})[_0xb5f2('0x29')](function(_0x26bf2d){if(_0x26bf2d){return _0x26bf2d?{'count':_0x3b9caf,'rows':_0x26bf2d}:null;}})['then'](respondWithResult(_0x1eac29,null))['catch'](handleError(_0x1eac29,null));};exports[_0xb5f2('0x50')]=function(_0x5d6520,_0x41b96f,_0x54dc54){var _0x299c7c={};var _0x30eb22={};var _0x14613f;var _0x28f6f1;return db[_0xb5f2('0x30')]['findOne']({'where':{'id':_0x5d6520['params']['id']}})[_0xb5f2('0x29')](handleEntityNotFound(_0x41b96f,null))[_0xb5f2('0x29')](function(_0x3a6763){if(_0x3a6763){_0x14613f=_0x3a6763;_0x30eb22[_0xb5f2('0x35')]=_['keys'](db[_0xb5f2('0x51')][_0xb5f2('0x31')]);_0x30eb22['query']=_['keys'](_0x5d6520[_0xb5f2('0x37')]);_0x30eb22['filters']=_[_0xb5f2('0x48')](_0x30eb22[_0xb5f2('0x35')],_0x30eb22[_0xb5f2('0x37')]);_0x299c7c[_0xb5f2('0x39')]=_[_0xb5f2('0x48')](_0x30eb22[_0xb5f2('0x35')],qs[_0xb5f2('0x38')](_0x5d6520[_0xb5f2('0x37')]['fields']));_0x299c7c[_0xb5f2('0x39')]=_0x299c7c[_0xb5f2('0x39')][_0xb5f2('0x3a')]?_0x299c7c[_0xb5f2('0x39')]:_0x30eb22[_0xb5f2('0x35')];_0x299c7c[_0xb5f2('0x3d')]=qs['sort'](_0x5d6520['query'][_0xb5f2('0x3e')]);_0x299c7c[_0xb5f2('0x3f')]=qs['filters'](_[_0xb5f2('0x40')](_0x5d6520['query'],_0x30eb22[_0xb5f2('0x41')]));if(_0x5d6520['query'][_0xb5f2('0x42')]){_0x299c7c[_0xb5f2('0x3f')]=_[_0xb5f2('0x43')](_0x299c7c[_0xb5f2('0x3f')],{'$or':_[_0xb5f2('0x2f')](_0x299c7c[_0xb5f2('0x39')],function(_0x4174d3){var _0xe9811f={};_0xe9811f[_0x4174d3]={'$like':'%'+_0x5d6520[_0xb5f2('0x37')]['filter']+'%'};return _0xe9811f;})});}_0x299c7c=_[_0xb5f2('0x43')]({},_0x299c7c,_0x5d6520[_0xb5f2('0x4b')]);return _0x14613f[_0xb5f2('0x50')](_0x299c7c);}})[_0xb5f2('0x29')](function(_0x35322f){if(_0x35322f){_0x28f6f1=_0x35322f[_0xb5f2('0x3a')];if(!_0x5d6520[_0xb5f2('0x37')][_0xb5f2('0x3b')](_0xb5f2('0x3c'))){_0x299c7c[_0xb5f2('0x21')]=qs[_0xb5f2('0x21')](_0x5d6520[_0xb5f2('0x37')][_0xb5f2('0x21')]);_0x299c7c[_0xb5f2('0x1f')]=qs['offset'](_0x5d6520['query'][_0xb5f2('0x1f')]);}return _0x14613f[_0xb5f2('0x50')](_0x299c7c);}})[_0xb5f2('0x29')](function(_0x388369){if(_0x388369){return _0x388369?{'count':_0x28f6f1,'rows':_0x388369}:null;}})[_0xb5f2('0x29')](respondWithResult(_0x41b96f,null))[_0xb5f2('0x46')](handleError(_0x41b96f,null));};exports[_0xb5f2('0x52')]=function(_0x3a422b,_0x3343a6,_0x4f5053){var _0x5c5209={};var _0x5a7394={};var _0x178b37;var _0x438190;return db[_0xb5f2('0x30')]['findOne']({'where':{'id':_0x3a422b['params']['id']}})[_0xb5f2('0x29')](handleEntityNotFound(_0x3343a6,null))[_0xb5f2('0x29')](function(_0x2c6d99){if(_0x2c6d99){_0x178b37=_0x2c6d99;_0x5a7394[_0xb5f2('0x35')]=_['keys'](db[_0xb5f2('0x51')][_0xb5f2('0x31')]);_0x5a7394[_0xb5f2('0x37')]=_['keys'](_0x3a422b[_0xb5f2('0x37')]);_0x5a7394[_0xb5f2('0x41')]=_[_0xb5f2('0x48')](_0x5a7394['model'],_0x5a7394['query']);_0x5c5209['attributes']=_[_0xb5f2('0x48')](_0x5a7394[_0xb5f2('0x35')],qs['fields'](_0x3a422b[_0xb5f2('0x37')][_0xb5f2('0x38')]));_0x5c5209['attributes']=_0x5c5209[_0xb5f2('0x39')][_0xb5f2('0x3a')]?_0x5c5209[_0xb5f2('0x39')]:_0x5a7394[_0xb5f2('0x35')];_0x5c5209[_0xb5f2('0x3d')]=qs[_0xb5f2('0x3e')](_0x3a422b[_0xb5f2('0x37')][_0xb5f2('0x3e')]);_0x5c5209['where']=qs[_0xb5f2('0x41')](_[_0xb5f2('0x40')](_0x3a422b[_0xb5f2('0x37')],_0x5a7394['filters']));if(_0x3a422b[_0xb5f2('0x37')][_0xb5f2('0x42')]){_0x5c5209[_0xb5f2('0x3f')]=_[_0xb5f2('0x43')](_0x5c5209['where'],{'$or':_[_0xb5f2('0x2f')](_0x5c5209[_0xb5f2('0x39')],function(_0x4fed63){var _0x2dfdbb={};_0x2dfdbb[_0x4fed63]={'$like':'%'+_0x3a422b[_0xb5f2('0x37')][_0xb5f2('0x42')]+'%'};return _0x2dfdbb;})});}_0x5c5209=_[_0xb5f2('0x43')]({},_0x5c5209,_0x3a422b[_0xb5f2('0x4b')]);return _0x178b37[_0xb5f2('0x52')](_0x5c5209);}})['then'](function(_0x1dde8f){if(_0x1dde8f){_0x438190=_0x1dde8f[_0xb5f2('0x3a')];if(!_0x3a422b[_0xb5f2('0x37')][_0xb5f2('0x3b')](_0xb5f2('0x3c'))){_0x5c5209[_0xb5f2('0x21')]=qs[_0xb5f2('0x21')](_0x3a422b[_0xb5f2('0x37')]['limit']);_0x5c5209['offset']=qs[_0xb5f2('0x1f')](_0x3a422b[_0xb5f2('0x37')]['offset']);}return _0x178b37[_0xb5f2('0x52')](_0x5c5209);}})[_0xb5f2('0x29')](function(_0x5b0aef){if(_0x5b0aef){return _0x5b0aef?{'count':_0x438190,'rows':_0x5b0aef}:null;}})[_0xb5f2('0x29')](respondWithResult(_0x3343a6,null))[_0xb5f2('0x46')](handleError(_0x3343a6,null));};
\ No newline at end of file
+var _0xc9b4=['zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','apply','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','find','create','body','findOne','order','getFields','length','getSubjects','getDescriptions','SalesforceField','eml-format','rimraf'];(function(_0x715b2f,_0x15887e){var _0x13c691=function(_0x4aa359){while(--_0x4aa359){_0x715b2f['push'](_0x715b2f['shift']());}};_0x13c691(++_0x15887e);}(_0xc9b4,0xa2));var _0x4c9b=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0xc9b4[_0x26bf51];return _0x503415;};'use strict';var emlformat=require(_0x4c9b('0x0'));var rimraf=require(_0x4c9b('0x1'));var zipdir=require(_0x4c9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4c9b('0x3'));var moment=require(_0x4c9b('0x4'));var BPromise=require(_0x4c9b('0x5'));var Mustache=require('mustache');var util=require(_0x4c9b('0x6'));var path=require(_0x4c9b('0x7'));var sox=require(_0x4c9b('0x8'));var csv=require(_0x4c9b('0x9'));var ejs=require(_0x4c9b('0xa'));var fs=require('fs');var fs_extra=require(_0x4c9b('0xb'));var _=require(_0x4c9b('0xc'));var squel=require(_0x4c9b('0xd'));var crypto=require(_0x4c9b('0xe'));var jsforce=require(_0x4c9b('0xf'));var deskjs=require(_0x4c9b('0x10'));var toCsv=require(_0x4c9b('0x9'));var querystring=require(_0x4c9b('0x11'));var Papa=require(_0x4c9b('0x12'));var Redis=require(_0x4c9b('0x13'));var authService=require(_0x4c9b('0x14'));var qs=require(_0x4c9b('0x15'));var as=require(_0x4c9b('0x16'));var hardwareService=require(_0x4c9b('0x17'));var logger=require(_0x4c9b('0x18'))(_0x4c9b('0x19'));var utils=require('../../config/utils');var config=require(_0x4c9b('0x1a'));var licenseUtil=require(_0x4c9b('0x1b'));var db=require(_0x4c9b('0x1c'))['db'];function respondWithStatusCode(_0x40cee2,_0x192fd3){_0x192fd3=_0x192fd3||0xcc;return function(_0x3047ef){if(_0x3047ef){return _0x40cee2[_0x4c9b('0x1d')](_0x192fd3);}return _0x40cee2[_0x4c9b('0x1e')](_0x192fd3)[_0x4c9b('0x1f')]();};}function respondWithResult(_0x4f19b5,_0x10392a){_0x10392a=_0x10392a||0xc8;return function(_0xa2d236){if(_0xa2d236){return _0x4f19b5[_0x4c9b('0x1e')](_0x10392a)[_0x4c9b('0x20')](_0xa2d236);}};}function respondWithFilteredResult(_0x5ad81d,_0x4439c4){return function(_0x2c215b){if(_0x2c215b){var _0x1bd38b=typeof _0x4439c4['offset']===_0x4c9b('0x21')&&typeof _0x4439c4[_0x4c9b('0x22')]===_0x4c9b('0x21');var _0x1a3774=_0x2c215b['count'];var _0x2a50fe=_0x1bd38b?0x0:_0x4439c4[_0x4c9b('0x23')];var _0xa438ed=_0x1bd38b?_0x2c215b['count']:_0x4439c4[_0x4c9b('0x23')]+_0x4439c4[_0x4c9b('0x22')];var _0x2aea6b;if(_0xa438ed>=_0x1a3774){_0xa438ed=_0x1a3774;_0x2aea6b=0xc8;}else{_0x2aea6b=0xce;}_0x5ad81d[_0x4c9b('0x1e')](_0x2aea6b);return _0x5ad81d[_0x4c9b('0x24')]('Content-Range',_0x2a50fe+'-'+_0xa438ed+'/'+_0x1a3774)[_0x4c9b('0x20')](_0x2c215b);}return null;};}function patchUpdates(_0x357210){return function(_0x237db6){try{jsonpatch[_0x4c9b('0x25')](_0x237db6,_0x357210,!![]);}catch(_0x4a00b0){return BPromise['reject'](_0x4a00b0);}return _0x237db6['save']();};}function saveUpdates(_0x348ab6,_0x352c9b){return function(_0x4edaf2){if(_0x4edaf2){return _0x4edaf2[_0x4c9b('0x26')](_0x348ab6)[_0x4c9b('0x27')](function(_0x1e2fc9){return _0x1e2fc9;});}return null;};}function removeEntity(_0x54fd33,_0x428167){return function(_0x46eee8){if(_0x46eee8){return _0x46eee8[_0x4c9b('0x28')]()['then'](function(){_0x54fd33[_0x4c9b('0x1e')](0xcc)[_0x4c9b('0x1f')]();});}};}function handleEntityNotFound(_0x525e81,_0x51e7b1){return function(_0x100f75){if(!_0x100f75){_0x525e81['sendStatus'](0x194);}return _0x100f75;};}function handleError(_0x555385,_0x26ff4c){_0x26ff4c=_0x26ff4c||0x1f4;return function(_0x47930d){logger[_0x4c9b('0x29')](_0x47930d[_0x4c9b('0x2a')]);if(_0x47930d[_0x4c9b('0x2b')]){delete _0x47930d[_0x4c9b('0x2b')];}_0x555385['status'](_0x26ff4c)['send'](_0x47930d);};}exports[_0x4c9b('0x2c')]=function(_0x4ebac3,_0x29189d){var _0x2089d3={},_0x1fc9df={},_0x469da3={'count':0x0,'rows':[]};var _0x3dc6bb=_[_0x4c9b('0x2d')](db[_0x4c9b('0x2e')][_0x4c9b('0x2f')],function(_0x4e1f5a){return{'name':_0x4e1f5a['fieldName'],'type':_0x4e1f5a[_0x4c9b('0x30')][_0x4c9b('0x31')]};});_0x1fc9df[_0x4c9b('0x32')]=_[_0x4c9b('0x2d')](_0x3dc6bb,_0x4c9b('0x2b'));_0x1fc9df[_0x4c9b('0x33')]=_[_0x4c9b('0x34')](_0x4ebac3[_0x4c9b('0x33')]);_0x1fc9df[_0x4c9b('0x35')]=_[_0x4c9b('0x36')](_0x1fc9df[_0x4c9b('0x32')],_0x1fc9df[_0x4c9b('0x33')]);_0x2089d3[_0x4c9b('0x37')]=_[_0x4c9b('0x36')](_0x1fc9df['model'],qs[_0x4c9b('0x38')](_0x4ebac3[_0x4c9b('0x33')][_0x4c9b('0x38')]));_0x2089d3[_0x4c9b('0x37')]=_0x2089d3[_0x4c9b('0x37')]['length']?_0x2089d3[_0x4c9b('0x37')]:_0x1fc9df['model'];if(!_0x4ebac3[_0x4c9b('0x33')][_0x4c9b('0x39')](_0x4c9b('0x3a'))){_0x2089d3['limit']=qs[_0x4c9b('0x22')](_0x4ebac3[_0x4c9b('0x33')]['limit']);_0x2089d3[_0x4c9b('0x23')]=qs['offset'](_0x4ebac3[_0x4c9b('0x33')][_0x4c9b('0x23')]);}_0x2089d3['order']=qs[_0x4c9b('0x3b')](_0x4ebac3['query']['sort']);_0x2089d3[_0x4c9b('0x3c')]=qs[_0x4c9b('0x35')](_[_0x4c9b('0x3d')](_0x4ebac3['query'],_0x1fc9df[_0x4c9b('0x35')]),_0x3dc6bb);if(_0x4ebac3[_0x4c9b('0x33')][_0x4c9b('0x3e')]){_0x2089d3[_0x4c9b('0x3c')]=_[_0x4c9b('0x3f')](_0x2089d3[_0x4c9b('0x3c')],{'$or':_['map'](_0x3dc6bb,function(_0x41fced){if(_0x41fced[_0x4c9b('0x30')]!==_0x4c9b('0x40')){var _0x2da683={};_0x2da683[_0x41fced['name']]={'$like':'%'+_0x4ebac3['query'][_0x4c9b('0x3e')]+'%'};return _0x2da683;}})});}_0x2089d3=_[_0x4c9b('0x3f')]({},_0x2089d3,_0x4ebac3[_0x4c9b('0x41')]);var _0x2231e4={'where':_0x2089d3['where']};return db['SalesforceConfiguration'][_0x4c9b('0x42')](_0x2231e4)[_0x4c9b('0x27')](function(_0x26e0d5){_0x469da3['count']=_0x26e0d5;if(_0x4ebac3['query']['includeAll']){_0x2089d3[_0x4c9b('0x43')]=[{'all':!![]}];}return db[_0x4c9b('0x2e')]['findAll'](_0x2089d3);})[_0x4c9b('0x27')](function(_0x487378){_0x469da3[_0x4c9b('0x44')]=_0x487378;return _0x469da3;})[_0x4c9b('0x27')](respondWithFilteredResult(_0x29189d,_0x2089d3))[_0x4c9b('0x45')](handleError(_0x29189d,null));};exports[_0x4c9b('0x46')]=function(_0x20214d,_0xde5ed6){var _0x603c0={'raw':![],'where':{'id':_0x20214d[_0x4c9b('0x47')]['id']}},_0x4eaa5d={};_0x4eaa5d['model']=_[_0x4c9b('0x34')](db[_0x4c9b('0x2e')][_0x4c9b('0x2f')]);_0x4eaa5d[_0x4c9b('0x33')]=_[_0x4c9b('0x34')](_0x20214d['query']);_0x4eaa5d['filters']=_[_0x4c9b('0x36')](_0x4eaa5d['model'],_0x4eaa5d[_0x4c9b('0x33')]);_0x603c0[_0x4c9b('0x37')]=_[_0x4c9b('0x36')](_0x4eaa5d[_0x4c9b('0x32')],qs['fields'](_0x20214d[_0x4c9b('0x33')]['fields']));_0x603c0[_0x4c9b('0x37')]=_0x603c0[_0x4c9b('0x37')]['length']?_0x603c0[_0x4c9b('0x37')]:_0x4eaa5d[_0x4c9b('0x32')];if(_0x20214d[_0x4c9b('0x33')]['includeAll']){_0x603c0['include']=[{'all':!![]}];}_0x603c0=_[_0x4c9b('0x3f')]({},_0x603c0,_0x20214d[_0x4c9b('0x41')]);return db[_0x4c9b('0x2e')][_0x4c9b('0x48')](_0x603c0)[_0x4c9b('0x27')](handleEntityNotFound(_0xde5ed6,null))['then'](respondWithResult(_0xde5ed6,null))[_0x4c9b('0x45')](handleError(_0xde5ed6,null));};exports[_0x4c9b('0x49')]=function(_0x4b34c6,_0x120db3){return db[_0x4c9b('0x2e')][_0x4c9b('0x49')](_0x4b34c6[_0x4c9b('0x4a')],{})[_0x4c9b('0x27')](respondWithResult(_0x120db3,0xc9))['catch'](handleError(_0x120db3,null));};exports[_0x4c9b('0x26')]=function(_0x5d900c,_0x4b876c){if(_0x5d900c[_0x4c9b('0x4a')]['id']){delete _0x5d900c[_0x4c9b('0x4a')]['id'];}return db[_0x4c9b('0x2e')][_0x4c9b('0x48')]({'where':{'id':_0x5d900c[_0x4c9b('0x47')]['id']}})[_0x4c9b('0x27')](handleEntityNotFound(_0x4b876c,null))[_0x4c9b('0x27')](saveUpdates(_0x5d900c[_0x4c9b('0x4a')],null))[_0x4c9b('0x27')](respondWithResult(_0x4b876c,null))[_0x4c9b('0x45')](handleError(_0x4b876c,null));};exports[_0x4c9b('0x28')]=function(_0x37dcea,_0x5e1d15){return db['SalesforceConfiguration'][_0x4c9b('0x48')]({'where':{'id':_0x37dcea[_0x4c9b('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e1d15,null))[_0x4c9b('0x27')](removeEntity(_0x5e1d15,null))[_0x4c9b('0x45')](handleError(_0x5e1d15,null));};exports['getFields']=function(_0x77b5a1,_0x19e453,_0x58bbac){var _0x441d3a={};var _0x106ad0={};var _0x3d4de5;var _0x55b8ae;return db[_0x4c9b('0x2e')][_0x4c9b('0x4b')]({'where':{'id':_0x77b5a1[_0x4c9b('0x47')]['id']}})[_0x4c9b('0x27')](handleEntityNotFound(_0x19e453,null))[_0x4c9b('0x27')](function(_0x1c7bb5){if(_0x1c7bb5){_0x3d4de5=_0x1c7bb5;_0x106ad0[_0x4c9b('0x32')]=_[_0x4c9b('0x34')](db['SalesforceField']['rawAttributes']);_0x106ad0[_0x4c9b('0x33')]=_[_0x4c9b('0x34')](_0x77b5a1[_0x4c9b('0x33')]);_0x106ad0[_0x4c9b('0x35')]=_[_0x4c9b('0x36')](_0x106ad0[_0x4c9b('0x32')],_0x106ad0[_0x4c9b('0x33')]);_0x441d3a[_0x4c9b('0x37')]=_[_0x4c9b('0x36')](_0x106ad0['model'],qs[_0x4c9b('0x38')](_0x77b5a1[_0x4c9b('0x33')][_0x4c9b('0x38')]));_0x441d3a[_0x4c9b('0x37')]=_0x441d3a[_0x4c9b('0x37')]['length']?_0x441d3a[_0x4c9b('0x37')]:_0x106ad0[_0x4c9b('0x32')];_0x441d3a[_0x4c9b('0x4c')]=qs[_0x4c9b('0x3b')](_0x77b5a1[_0x4c9b('0x33')][_0x4c9b('0x3b')]);_0x441d3a[_0x4c9b('0x3c')]=qs[_0x4c9b('0x35')](_[_0x4c9b('0x3d')](_0x77b5a1[_0x4c9b('0x33')],_0x106ad0[_0x4c9b('0x35')]));if(_0x77b5a1[_0x4c9b('0x33')][_0x4c9b('0x3e')]){_0x441d3a[_0x4c9b('0x3c')]=_[_0x4c9b('0x3f')](_0x441d3a[_0x4c9b('0x3c')],{'$or':_[_0x4c9b('0x2d')](_0x441d3a[_0x4c9b('0x37')],function(_0x219ff1){var _0x56091c={};_0x56091c[_0x219ff1]={'$like':'%'+_0x77b5a1[_0x4c9b('0x33')][_0x4c9b('0x3e')]+'%'};return _0x56091c;})});}_0x441d3a=_[_0x4c9b('0x3f')]({},_0x441d3a,_0x77b5a1[_0x4c9b('0x41')]);return _0x3d4de5[_0x4c9b('0x4d')](_0x441d3a);}})[_0x4c9b('0x27')](function(_0x7079ad){if(_0x7079ad){_0x55b8ae=_0x7079ad[_0x4c9b('0x4e')];if(!_0x77b5a1[_0x4c9b('0x33')][_0x4c9b('0x39')]('nolimit')){_0x441d3a[_0x4c9b('0x22')]=qs[_0x4c9b('0x22')](_0x77b5a1['query'][_0x4c9b('0x22')]);_0x441d3a[_0x4c9b('0x23')]=qs[_0x4c9b('0x23')](_0x77b5a1[_0x4c9b('0x33')]['offset']);}return _0x3d4de5[_0x4c9b('0x4d')](_0x441d3a);}})['then'](function(_0x323f4b){if(_0x323f4b){return _0x323f4b?{'count':_0x55b8ae,'rows':_0x323f4b}:null;}})[_0x4c9b('0x27')](respondWithResult(_0x19e453,null))[_0x4c9b('0x45')](handleError(_0x19e453,null));};exports['getSubjects']=function(_0x2a0b24,_0x4b6140,_0x47c717){var _0xbe47d3={};var _0x1ae0a6={};var _0x3f3b9f;var _0x34c53d;return db[_0x4c9b('0x2e')][_0x4c9b('0x4b')]({'where':{'id':_0x2a0b24['params']['id']}})['then'](handleEntityNotFound(_0x4b6140,null))[_0x4c9b('0x27')](function(_0x56a179){if(_0x56a179){_0x3f3b9f=_0x56a179;_0x1ae0a6[_0x4c9b('0x32')]=_['keys'](db['SalesforceField'][_0x4c9b('0x2f')]);_0x1ae0a6[_0x4c9b('0x33')]=_[_0x4c9b('0x34')](_0x2a0b24[_0x4c9b('0x33')]);_0x1ae0a6[_0x4c9b('0x35')]=_[_0x4c9b('0x36')](_0x1ae0a6[_0x4c9b('0x32')],_0x1ae0a6['query']);_0xbe47d3[_0x4c9b('0x37')]=_[_0x4c9b('0x36')](_0x1ae0a6[_0x4c9b('0x32')],qs[_0x4c9b('0x38')](_0x2a0b24['query'][_0x4c9b('0x38')]));_0xbe47d3['attributes']=_0xbe47d3['attributes'][_0x4c9b('0x4e')]?_0xbe47d3[_0x4c9b('0x37')]:_0x1ae0a6[_0x4c9b('0x32')];_0xbe47d3['order']=qs[_0x4c9b('0x3b')](_0x2a0b24[_0x4c9b('0x33')]['sort']);_0xbe47d3[_0x4c9b('0x3c')]=qs[_0x4c9b('0x35')](_[_0x4c9b('0x3d')](_0x2a0b24[_0x4c9b('0x33')],_0x1ae0a6[_0x4c9b('0x35')]));if(_0x2a0b24['query'][_0x4c9b('0x3e')]){_0xbe47d3['where']=_[_0x4c9b('0x3f')](_0xbe47d3[_0x4c9b('0x3c')],{'$or':_[_0x4c9b('0x2d')](_0xbe47d3['attributes'],function(_0x558757){var _0x19dd64={};_0x19dd64[_0x558757]={'$like':'%'+_0x2a0b24[_0x4c9b('0x33')][_0x4c9b('0x3e')]+'%'};return _0x19dd64;})});}_0xbe47d3=_[_0x4c9b('0x3f')]({},_0xbe47d3,_0x2a0b24[_0x4c9b('0x41')]);return _0x3f3b9f[_0x4c9b('0x4f')](_0xbe47d3);}})['then'](function(_0x31f75d){if(_0x31f75d){_0x34c53d=_0x31f75d[_0x4c9b('0x4e')];if(!_0x2a0b24[_0x4c9b('0x33')][_0x4c9b('0x39')](_0x4c9b('0x3a'))){_0xbe47d3['limit']=qs['limit'](_0x2a0b24['query']['limit']);_0xbe47d3[_0x4c9b('0x23')]=qs[_0x4c9b('0x23')](_0x2a0b24[_0x4c9b('0x33')]['offset']);}return _0x3f3b9f['getSubjects'](_0xbe47d3);}})[_0x4c9b('0x27')](function(_0x23e245){if(_0x23e245){return _0x23e245?{'count':_0x34c53d,'rows':_0x23e245}:null;}})[_0x4c9b('0x27')](respondWithResult(_0x4b6140,null))[_0x4c9b('0x45')](handleError(_0x4b6140,null));};exports[_0x4c9b('0x50')]=function(_0x13dbd1,_0xecdf04,_0x4b0ce5){var _0x12b3d1={};var _0x5498c8={};var _0x4c689f;var _0x51fba7;return db['SalesforceConfiguration'][_0x4c9b('0x4b')]({'where':{'id':_0x13dbd1[_0x4c9b('0x47')]['id']}})['then'](handleEntityNotFound(_0xecdf04,null))[_0x4c9b('0x27')](function(_0x1bc3f8){if(_0x1bc3f8){_0x4c689f=_0x1bc3f8;_0x5498c8[_0x4c9b('0x32')]=_[_0x4c9b('0x34')](db[_0x4c9b('0x51')]['rawAttributes']);_0x5498c8[_0x4c9b('0x33')]=_[_0x4c9b('0x34')](_0x13dbd1[_0x4c9b('0x33')]);_0x5498c8[_0x4c9b('0x35')]=_[_0x4c9b('0x36')](_0x5498c8[_0x4c9b('0x32')],_0x5498c8[_0x4c9b('0x33')]);_0x12b3d1[_0x4c9b('0x37')]=_[_0x4c9b('0x36')](_0x5498c8[_0x4c9b('0x32')],qs[_0x4c9b('0x38')](_0x13dbd1[_0x4c9b('0x33')][_0x4c9b('0x38')]));_0x12b3d1['attributes']=_0x12b3d1[_0x4c9b('0x37')]['length']?_0x12b3d1['attributes']:_0x5498c8['model'];_0x12b3d1['order']=qs[_0x4c9b('0x3b')](_0x13dbd1[_0x4c9b('0x33')][_0x4c9b('0x3b')]);_0x12b3d1[_0x4c9b('0x3c')]=qs[_0x4c9b('0x35')](_[_0x4c9b('0x3d')](_0x13dbd1['query'],_0x5498c8['filters']));if(_0x13dbd1['query'][_0x4c9b('0x3e')]){_0x12b3d1['where']=_['merge'](_0x12b3d1[_0x4c9b('0x3c')],{'$or':_['map'](_0x12b3d1[_0x4c9b('0x37')],function(_0x5f5850){var _0x3fe97e={};_0x3fe97e[_0x5f5850]={'$like':'%'+_0x13dbd1['query'][_0x4c9b('0x3e')]+'%'};return _0x3fe97e;})});}_0x12b3d1=_[_0x4c9b('0x3f')]({},_0x12b3d1,_0x13dbd1[_0x4c9b('0x41')]);return _0x4c689f[_0x4c9b('0x50')](_0x12b3d1);}})[_0x4c9b('0x27')](function(_0x4d3d54){if(_0x4d3d54){_0x51fba7=_0x4d3d54[_0x4c9b('0x4e')];if(!_0x13dbd1[_0x4c9b('0x33')]['hasOwnProperty'](_0x4c9b('0x3a'))){_0x12b3d1[_0x4c9b('0x22')]=qs[_0x4c9b('0x22')](_0x13dbd1['query']['limit']);_0x12b3d1[_0x4c9b('0x23')]=qs[_0x4c9b('0x23')](_0x13dbd1[_0x4c9b('0x33')][_0x4c9b('0x23')]);}return _0x4c689f[_0x4c9b('0x50')](_0x12b3d1);}})[_0x4c9b('0x27')](function(_0x1b2fc0){if(_0x1b2fc0){return _0x1b2fc0?{'count':_0x51fba7,'rows':_0x1b2fc0}:null;}})['then'](respondWithResult(_0xecdf04,null))['catch'](handleError(_0xecdf04,null));};
\ No newline at end of file
index 3f71987..d256a20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55eb=['request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','util','../../config/logger','api','moment','bluebird'];(function(_0x1cf1c6,_0x5e8bf5){var _0x4f1d6f=function(_0x51ca5e){while(--_0x51ca5e){_0x1cf1c6['push'](_0x1cf1c6['shift']());}};_0x4f1d6f(++_0x5e8bf5);}(_0x55eb,0x163));var _0xb55e=function(_0x414149,_0xc3b0e5){_0x414149=_0x414149-0x0;var _0x3eb2c3=_0x55eb[_0x414149];return _0x3eb2c3;};'use strict';var _=require('lodash');var util=require(_0xb55e('0x0'));var logger=require(_0xb55e('0x1'))(_0xb55e('0x2'));var moment=require(_0xb55e('0x3'));var BPromise=require(_0xb55e('0x4'));var rp=require(_0xb55e('0x5'));var fs=require('fs');var path=require(_0xb55e('0x6'));var rimraf=require(_0xb55e('0x7'));var config=require('../../config/environment');var attributes=require(_0xb55e('0x8'));module[_0xb55e('0x9')]=function(_0x5b4ee6,_0x273d69){return _0x5b4ee6[_0xb55e('0xa')](_0xb55e('0xb'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb699=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0xa42c74,_0x2170ed){var _0x1076d1=function(_0x534bf9){while(--_0x534bf9){_0xa42c74['push'](_0xa42c74['shift']());}};_0x1076d1(++_0x2170ed);}(_0xb699,0x152));var _0x9b69=function(_0x1e472c,_0x42556d){_0x1e472c=_0x1e472c-0x0;var _0x529266=_0xb699[_0x1e472c];return _0x529266;};'use strict';var _=require(_0x9b69('0x0'));var util=require(_0x9b69('0x1'));var logger=require('../../config/logger')(_0x9b69('0x2'));var moment=require(_0x9b69('0x3'));var BPromise=require(_0x9b69('0x4'));var rp=require(_0x9b69('0x5'));var fs=require('fs');var path=require(_0x9b69('0x6'));var rimraf=require(_0x9b69('0x7'));var config=require(_0x9b69('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x9b69('0x9')]=function(_0x215ea5,_0x3517bc){return _0x215ea5['define'](_0x9b69('0xa'),attributes,{'tableName':_0x9b69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a57401..aa2da62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd49c=['rpc','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','lodash','util','randomstring','../../mysqldb','../../config/logger'];(function(_0x44d797,_0x276017){var _0x4005c2=function(_0x3d3b5b){while(--_0x3d3b5b){_0x44d797['push'](_0x44d797['shift']());}};_0x4005c2(++_0x276017);}(_0xd49c,0x1c3));var _0xcd49=function(_0x48e03a,_0x2f2757){_0x48e03a=_0x48e03a-0x0;var _0x53bdce=_0xd49c[_0x48e03a];return _0x53bdce;};'use strict';var _=require(_0xcd49('0x0'));var util=require(_0xcd49('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd49('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd49('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd49('0x4'))(_0xcd49('0x5'));var config=require('../../config/environment');var jayson=require(_0xcd49('0x6'));var client=jayson[_0xcd49('0x7')][_0xcd49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53abae,_0x2fb48e,_0xc173cd){return new BPromise(function(_0x24e60f,_0xefcea9){return client[_0xcd49('0x9')](_0x53abae,_0xc173cd)[_0xcd49('0xa')](function(_0x315e14){logger[_0xcd49('0xb')](_0xcd49('0xc'),_0x2fb48e,'request\x20sent');logger[_0xcd49('0xd')](_0xcd49('0xe'),_0x2fb48e,'request\x20sent',JSON[_0xcd49('0xf')](_0x315e14));if(_0x315e14[_0xcd49('0x10')]){if(_0x315e14[_0xcd49('0x10')]['code']===0x1f4){logger[_0xcd49('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2fb48e,_0x315e14[_0xcd49('0x10')][_0xcd49('0x11')]);return _0xefcea9(_0x315e14[_0xcd49('0x10')]['message']);}logger[_0xcd49('0x10')](_0xcd49('0xc'),_0x2fb48e,_0x315e14['error'][_0xcd49('0x11')]);return _0x24e60f(_0x315e14[_0xcd49('0x10')]['message']);}else{logger['info'](_0xcd49('0xc'),_0x2fb48e,_0xcd49('0x12'));_0x24e60f(_0x315e14['result'][_0xcd49('0x11')]);}})['catch'](function(_0x340b47){logger['error'](_0xcd49('0xc'),_0x2fb48e,_0x340b47);_0xefcea9(_0x340b47);});});}
\ No newline at end of file
+var _0x8443=['error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x8443,0xd5));var _0x3844=function(_0x3fde79,_0x11e979){_0x3fde79=_0x3fde79-0x0;var _0x4f4edb=_0x8443[_0x3fde79];return _0x4f4edb;};'use strict';var _=require(_0x3844('0x0'));var util=require(_0x3844('0x1'));var moment=require(_0x3844('0x2'));var BPromise=require('bluebird');var rs=require(_0x3844('0x3'));var fs=require('fs');var Redis=require(_0x3844('0x4'));var db=require(_0x3844('0x5'))['db'];var utils=require(_0x3844('0x6'));var logger=require(_0x3844('0x7'))(_0x3844('0x8'));var config=require(_0x3844('0x9'));var jayson=require(_0x3844('0xa'));var client=jayson[_0x3844('0xb')][_0x3844('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cd4f3,_0x2979c3,_0x5db0f8){return new BPromise(function(_0x4e0078,_0x83e9e2){return client[_0x3844('0xd')](_0x4cd4f3,_0x5db0f8)['then'](function(_0x56f393){logger[_0x3844('0xe')](_0x3844('0xf'),_0x2979c3,_0x3844('0x10'));logger[_0x3844('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x2979c3,_0x3844('0x10'),JSON['stringify'](_0x56f393));if(_0x56f393[_0x3844('0x12')]){if(_0x56f393['error']['code']===0x1f4){logger[_0x3844('0x12')](_0x3844('0xf'),_0x2979c3,_0x56f393['error'][_0x3844('0x13')]);return _0x83e9e2(_0x56f393[_0x3844('0x12')][_0x3844('0x13')]);}logger['error'](_0x3844('0xf'),_0x2979c3,_0x56f393[_0x3844('0x12')]['message']);return _0x4e0078(_0x56f393[_0x3844('0x12')][_0x3844('0x13')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x2979c3,_0x3844('0x10'));_0x4e0078(_0x56f393[_0x3844('0x14')][_0x3844('0x13')]);}})['catch'](function(_0x1a8d2e){logger['error'](_0x3844('0xf'),_0x2979c3,_0x1a8d2e);_0x83e9e2(_0x1a8d2e);});});}
\ No newline at end of file
index fba79bc..018f796 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45c8=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intSalesforceField.controller','isAuthenticated','index','get','/:id'];(function(_0xf9a860,_0x19eb67){var _0x26de69=function(_0x51a2b8){while(--_0x51a2b8){_0xf9a860['push'](_0xf9a860['shift']());}};_0x26de69(++_0x19eb67);}(_0x45c8,0x1d0));var _0x845c=function(_0x26d3a6,_0x61d8c1){_0x26d3a6=_0x26d3a6-0x0;var _0x3a4c2a=_0x45c8[_0x26d3a6];return _0x3a4c2a;};'use strict';var multer=require(_0x845c('0x0'));var util=require('util');var path=require(_0x845c('0x1'));var timeout=require(_0x845c('0x2'));var express=require(_0x845c('0x3'));var router=express[_0x845c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x845c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x845c('0x6'));router['get']('/',auth[_0x845c('0x7')](),controller[_0x845c('0x8')]);router[_0x845c('0x9')](_0x845c('0xa'),auth[_0x845c('0x7')](),controller[_0x845c('0xb')]);router[_0x845c('0xc')]('/',auth[_0x845c('0x7')](),controller[_0x845c('0xd')]);router[_0x845c('0xe')](_0x845c('0xa'),auth[_0x845c('0x7')](),controller[_0x845c('0xf')]);router[_0x845c('0x10')](_0x845c('0xa'),auth[_0x845c('0x7')](),controller[_0x845c('0x11')]);module[_0x845c('0x12')]=router;
\ No newline at end of file
+var _0x38cd=['express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x38cd,0x12c));var _0xd38c=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x38cd[_0x277107];return _0x1da046;};'use strict';var multer=require(_0xd38c('0x0'));var util=require(_0xd38c('0x1'));var path=require(_0xd38c('0x2'));var timeout=require(_0xd38c('0x3'));var express=require(_0xd38c('0x4'));var router=express[_0xd38c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd38c('0x6'));var interaction=require(_0xd38c('0x7'));var config=require('../../config/environment');var controller=require(_0xd38c('0x8'));router[_0xd38c('0x9')]('/',auth[_0xd38c('0xa')](),controller[_0xd38c('0xb')]);router['get']('/:id',auth[_0xd38c('0xa')](),controller[_0xd38c('0xc')]);router[_0xd38c('0xd')]('/',auth[_0xd38c('0xa')](),controller['create']);router[_0xd38c('0xe')](_0xd38c('0xf'),auth[_0xd38c('0xa')](),controller[_0xd38c('0x10')]);router[_0xd38c('0x11')](_0xd38c('0xf'),auth[_0xd38c('0xa')](),controller['destroy']);module[_0xd38c('0x12')]=router;
\ No newline at end of file
index 9768408..c3e2b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x138a=['STRING','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x138a,0x1f1));var _0xa138=function(_0x1216bf,_0x2b0866){_0x1216bf=_0x1216bf-0x0;var _0x9ddc50=_0x138a[_0x1216bf];return _0x9ddc50;};'use strict';var Sequelize=require(_0xa138('0x0'));module[_0xa138('0x1')]={'type':{'type':Sequelize[_0xa138('0x2')](_0xa138('0x3'),_0xa138('0x4'),_0xa138('0x5'),'keyValue',_0xa138('0x6')),'defaultValue':_0xa138('0x3')},'content':{'type':Sequelize[_0xa138('0x7')]},'key':{'type':Sequelize[_0xa138('0x7')]},'keyType':{'type':Sequelize[_0xa138('0x2')](_0xa138('0x3'),_0xa138('0x4'),_0xa138('0x5'))},'keyContent':{'type':Sequelize[_0xa138('0x7')]},'idField':{'type':Sequelize[_0xa138('0x7')]},'variableName':{'type':Sequelize[_0xa138('0x7')]}};
\ No newline at end of file
+var _0x46df=['string','variable','customVariable','STRING','sequelize','ENUM'];(function(_0x3938f8,_0xb38f19){var _0x411c1f=function(_0x5bcdf3){while(--_0x5bcdf3){_0x3938f8['push'](_0x3938f8['shift']());}};_0x411c1f(++_0xb38f19);}(_0x46df,0x1ba));var _0xf46d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x46df[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0xf46d('0x0'));module['exports']={'type':{'type':Sequelize[_0xf46d('0x1')](_0xf46d('0x2'),_0xf46d('0x3'),_0xf46d('0x4'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf46d('0x5')]},'keyType':{'type':Sequelize[_0xf46d('0x1')]('string','variable',_0xf46d('0x4'))},'keyContent':{'type':Sequelize[_0xf46d('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4d29f1e..e3443fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa02f=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','fs-extra','lodash'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xa02f,0xcf));var _0xfa02=function(_0x442174,_0x2e591f){_0x442174=_0x442174-0x0;var _0x225768=_0xa02f[_0x442174];return _0x225768;};'use strict';var emlformat=require(_0xfa02('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa02('0x1'));var rp=require(_0xfa02('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa02('0x3'));var util=require(_0xfa02('0x4'));var path=require(_0xfa02('0x5'));var sox=require(_0xfa02('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa02('0x7'));var _=require(_0xfa02('0x8'));var squel=require(_0xfa02('0x9'));var crypto=require(_0xfa02('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfa02('0xb'));var toCsv=require(_0xfa02('0xc'));var querystring=require(_0xfa02('0xd'));var Papa=require(_0xfa02('0xe'));var Redis=require(_0xfa02('0xf'));var authService=require(_0xfa02('0x10'));var qs=require(_0xfa02('0x11'));var as=require(_0xfa02('0x12'));var hardwareService=require(_0xfa02('0x13'));var logger=require('../../config/logger')(_0xfa02('0x14'));var utils=require('../../config/utils');var config=require(_0xfa02('0x15'));var licenseUtil=require(_0xfa02('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1023c7,_0x311e1f){_0x311e1f=_0x311e1f||0xcc;return function(_0x423231){if(_0x423231){return _0x1023c7['sendStatus'](_0x311e1f);}return _0x1023c7[_0xfa02('0x17')](_0x311e1f)[_0xfa02('0x18')]();};}function respondWithResult(_0x5b853e,_0x3a54ec){_0x3a54ec=_0x3a54ec||0xc8;return function(_0x251cd4){if(_0x251cd4){return _0x5b853e[_0xfa02('0x17')](_0x3a54ec)[_0xfa02('0x19')](_0x251cd4);}};}function respondWithFilteredResult(_0x36b86c,_0x828fc8){return function(_0x430647){if(_0x430647){var _0x34490e=typeof _0x828fc8[_0xfa02('0x1a')]===_0xfa02('0x1b')&&typeof _0x828fc8[_0xfa02('0x1c')]===_0xfa02('0x1b');var _0x1c9373=_0x430647[_0xfa02('0x1d')];var _0x536b8f=_0x34490e?0x0:_0x828fc8[_0xfa02('0x1a')];var _0x5a836c=_0x34490e?_0x430647[_0xfa02('0x1d')]:_0x828fc8[_0xfa02('0x1a')]+_0x828fc8[_0xfa02('0x1c')];var _0x365c4f;if(_0x5a836c>=_0x1c9373){_0x5a836c=_0x1c9373;_0x365c4f=0xc8;}else{_0x365c4f=0xce;}_0x36b86c[_0xfa02('0x17')](_0x365c4f);return _0x36b86c[_0xfa02('0x1e')](_0xfa02('0x1f'),_0x536b8f+'-'+_0x5a836c+'/'+_0x1c9373)[_0xfa02('0x19')](_0x430647);}return null;};}function patchUpdates(_0xb45a6){return function(_0xd7fda1){try{jsonpatch['apply'](_0xd7fda1,_0xb45a6,!![]);}catch(_0x19ad3e){return BPromise[_0xfa02('0x20')](_0x19ad3e);}return _0xd7fda1[_0xfa02('0x21')]();};}function saveUpdates(_0x8f2d8c,_0x4b14c5){return function(_0x55d186){if(_0x55d186){return _0x55d186[_0xfa02('0x22')](_0x8f2d8c)[_0xfa02('0x23')](function(_0x5ca8d6){return _0x5ca8d6;});}return null;};}function removeEntity(_0x2a0ea2,_0xfe785){return function(_0x365210){if(_0x365210){return _0x365210[_0xfa02('0x24')]()[_0xfa02('0x23')](function(){_0x2a0ea2['status'](0xcc)[_0xfa02('0x18')]();});}};}function handleEntityNotFound(_0x33a7ee,_0x4ae07a){return function(_0x37d627){if(!_0x37d627){_0x33a7ee[_0xfa02('0x25')](0x194);}return _0x37d627;};}function handleError(_0x478a05,_0x2406eb){_0x2406eb=_0x2406eb||0x1f4;return function(_0xee82ed){logger[_0xfa02('0x26')](_0xee82ed[_0xfa02('0x27')]);if(_0xee82ed[_0xfa02('0x28')]){delete _0xee82ed[_0xfa02('0x28')];}_0x478a05[_0xfa02('0x17')](_0x2406eb)['send'](_0xee82ed);};}exports[_0xfa02('0x29')]=function(_0x41e368,_0x27b174){var _0x406ad2={},_0x2c4f30={},_0x48e88b={'count':0x0,'rows':[]};var _0x3ace50=_[_0xfa02('0x2a')](db[_0xfa02('0x2b')][_0xfa02('0x2c')],function(_0x75d6fc){return{'name':_0x75d6fc[_0xfa02('0x2d')],'type':_0x75d6fc[_0xfa02('0x2e')]['key']};});_0x2c4f30[_0xfa02('0x2f')]=_[_0xfa02('0x2a')](_0x3ace50,_0xfa02('0x28'));_0x2c4f30[_0xfa02('0x30')]=_[_0xfa02('0x31')](_0x41e368[_0xfa02('0x30')]);_0x2c4f30[_0xfa02('0x32')]=_[_0xfa02('0x33')](_0x2c4f30[_0xfa02('0x2f')],_0x2c4f30[_0xfa02('0x30')]);_0x406ad2[_0xfa02('0x34')]=_[_0xfa02('0x33')](_0x2c4f30[_0xfa02('0x2f')],qs['fields'](_0x41e368[_0xfa02('0x30')]['fields']));_0x406ad2[_0xfa02('0x34')]=_0x406ad2[_0xfa02('0x34')]['length']?_0x406ad2[_0xfa02('0x34')]:_0x2c4f30[_0xfa02('0x2f')];if(!_0x41e368[_0xfa02('0x30')][_0xfa02('0x35')](_0xfa02('0x36'))){_0x406ad2[_0xfa02('0x1c')]=qs['limit'](_0x41e368[_0xfa02('0x30')]['limit']);_0x406ad2[_0xfa02('0x1a')]=qs['offset'](_0x41e368['query'][_0xfa02('0x1a')]);}_0x406ad2['order']=qs[_0xfa02('0x37')](_0x41e368[_0xfa02('0x30')]['sort']);_0x406ad2[_0xfa02('0x38')]=qs[_0xfa02('0x32')](_[_0xfa02('0x39')](_0x41e368[_0xfa02('0x30')],_0x2c4f30[_0xfa02('0x32')]),_0x3ace50);if(_0x41e368[_0xfa02('0x30')][_0xfa02('0x3a')]){_0x406ad2['where']=_[_0xfa02('0x3b')](_0x406ad2['where'],{'$or':_[_0xfa02('0x2a')](_0x3ace50,function(_0x28b463){if(_0x28b463[_0xfa02('0x2e')]!==_0xfa02('0x3c')){var _0x176115={};_0x176115[_0x28b463[_0xfa02('0x28')]]={'$like':'%'+_0x41e368[_0xfa02('0x30')][_0xfa02('0x3a')]+'%'};return _0x176115;}})});}_0x406ad2=_[_0xfa02('0x3b')]({},_0x406ad2,_0x41e368[_0xfa02('0x3d')]);var _0x3d7464={'where':_0x406ad2[_0xfa02('0x38')]};return db[_0xfa02('0x2b')][_0xfa02('0x1d')](_0x3d7464)[_0xfa02('0x23')](function(_0x3064d7){_0x48e88b[_0xfa02('0x1d')]=_0x3064d7;if(_0x41e368['query'][_0xfa02('0x3e')]){_0x406ad2[_0xfa02('0x3f')]=[{'all':!![]}];}return db[_0xfa02('0x2b')][_0xfa02('0x40')](_0x406ad2);})[_0xfa02('0x23')](function(_0x19c49e){_0x48e88b[_0xfa02('0x41')]=_0x19c49e;return _0x48e88b;})[_0xfa02('0x23')](respondWithFilteredResult(_0x27b174,_0x406ad2))[_0xfa02('0x42')](handleError(_0x27b174,null));};exports['show']=function(_0x3e7169,_0x167003){var _0x26ca58={'raw':!![],'where':{'id':_0x3e7169[_0xfa02('0x43')]['id']}},_0x48a3ec={};_0x48a3ec[_0xfa02('0x2f')]=_[_0xfa02('0x31')](db['SalesforceField']['rawAttributes']);_0x48a3ec[_0xfa02('0x30')]=_['keys'](_0x3e7169[_0xfa02('0x30')]);_0x48a3ec[_0xfa02('0x32')]=_[_0xfa02('0x33')](_0x48a3ec['model'],_0x48a3ec['query']);_0x26ca58[_0xfa02('0x34')]=_['intersection'](_0x48a3ec[_0xfa02('0x2f')],qs[_0xfa02('0x44')](_0x3e7169[_0xfa02('0x30')][_0xfa02('0x44')]));_0x26ca58['attributes']=_0x26ca58[_0xfa02('0x34')]['length']?_0x26ca58['attributes']:_0x48a3ec[_0xfa02('0x2f')];if(_0x3e7169[_0xfa02('0x30')][_0xfa02('0x3e')]){_0x26ca58[_0xfa02('0x3f')]=[{'all':!![]}];}_0x26ca58=_[_0xfa02('0x3b')]({},_0x26ca58,_0x3e7169['options']);return db['SalesforceField'][_0xfa02('0x45')](_0x26ca58)[_0xfa02('0x23')](handleEntityNotFound(_0x167003,null))['then'](respondWithResult(_0x167003,null))[_0xfa02('0x42')](handleError(_0x167003,null));};exports[_0xfa02('0x46')]=function(_0xdad6ec,_0x4431bd){return db['SalesforceField']['create'](_0xdad6ec[_0xfa02('0x47')],{})['then'](respondWithResult(_0x4431bd,0xc9))[_0xfa02('0x42')](handleError(_0x4431bd,null));};exports[_0xfa02('0x22')]=function(_0x5bc2eb,_0x9f5cc9){if(_0x5bc2eb[_0xfa02('0x47')]['id']){delete _0x5bc2eb[_0xfa02('0x47')]['id'];}return db[_0xfa02('0x2b')][_0xfa02('0x45')]({'where':{'id':_0x5bc2eb[_0xfa02('0x43')]['id']}})[_0xfa02('0x23')](handleEntityNotFound(_0x9f5cc9,null))[_0xfa02('0x23')](saveUpdates(_0x5bc2eb[_0xfa02('0x47')],null))['then'](respondWithResult(_0x9f5cc9,null))[_0xfa02('0x42')](handleError(_0x9f5cc9,null));};exports['destroy']=function(_0x5661c5,_0x1918d6){return db[_0xfa02('0x2b')][_0xfa02('0x45')]({'where':{'id':_0x5661c5['params']['id']}})[_0xfa02('0x23')](handleEntityNotFound(_0x1918d6,null))[_0xfa02('0x23')](removeEntity(_0x1918d6,null))[_0xfa02('0x42')](handleError(_0x1918d6,null));};
\ No newline at end of file
+var _0x742d=['options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','status','end','offset','limit','count','json','reject','save','update','then','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x742d,0x1cf));var _0xd742=function(_0x50a808,_0x344972){_0x50a808=_0x50a808-0x0;var _0x5834bc=_0x742d[_0x50a808];return _0x5834bc;};'use strict';var emlformat=require(_0xd742('0x0'));var rimraf=require(_0xd742('0x1'));var zipdir=require(_0xd742('0x2'));var jsonpatch=require(_0xd742('0x3'));var rp=require(_0xd742('0x4'));var moment=require(_0xd742('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd742('0x6'));var util=require('util');var path=require(_0xd742('0x7'));var sox=require(_0xd742('0x8'));var csv=require('to-csv');var ejs=require(_0xd742('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd742('0xa'));var squel=require(_0xd742('0xb'));var crypto=require(_0xd742('0xc'));var jsforce=require(_0xd742('0xd'));var deskjs=require(_0xd742('0xe'));var toCsv=require(_0xd742('0xf'));var querystring=require(_0xd742('0x10'));var Papa=require(_0xd742('0x11'));var Redis=require(_0xd742('0x12'));var authService=require(_0xd742('0x13'));var qs=require(_0xd742('0x14'));var as=require(_0xd742('0x15'));var hardwareService=require(_0xd742('0x16'));var logger=require(_0xd742('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd742('0x18'));var db=require(_0xd742('0x19'))['db'];function respondWithStatusCode(_0x3456c0,_0x37828c){_0x37828c=_0x37828c||0xcc;return function(_0x4f73b2){if(_0x4f73b2){return _0x3456c0['sendStatus'](_0x37828c);}return _0x3456c0[_0xd742('0x1a')](_0x37828c)[_0xd742('0x1b')]();};}function respondWithResult(_0x24d782,_0x56fc7d){_0x56fc7d=_0x56fc7d||0xc8;return function(_0x42f3ce){if(_0x42f3ce){return _0x24d782[_0xd742('0x1a')](_0x56fc7d)['json'](_0x42f3ce);}};}function respondWithFilteredResult(_0x213455,_0x4b6d46){return function(_0x4c94dc){if(_0x4c94dc){var _0x23fb44=typeof _0x4b6d46[_0xd742('0x1c')]==='undefined'&&typeof _0x4b6d46[_0xd742('0x1d')]==='undefined';var _0x117b71=_0x4c94dc[_0xd742('0x1e')];var _0x66f4dd=_0x23fb44?0x0:_0x4b6d46[_0xd742('0x1c')];var _0x406846=_0x23fb44?_0x4c94dc[_0xd742('0x1e')]:_0x4b6d46['offset']+_0x4b6d46['limit'];var _0x4c69d1;if(_0x406846>=_0x117b71){_0x406846=_0x117b71;_0x4c69d1=0xc8;}else{_0x4c69d1=0xce;}_0x213455['status'](_0x4c69d1);return _0x213455['set']('Content-Range',_0x66f4dd+'-'+_0x406846+'/'+_0x117b71)[_0xd742('0x1f')](_0x4c94dc);}return null;};}function patchUpdates(_0x1e40c8){return function(_0x2d02aa){try{jsonpatch['apply'](_0x2d02aa,_0x1e40c8,!![]);}catch(_0x25fa2b){return BPromise[_0xd742('0x20')](_0x25fa2b);}return _0x2d02aa[_0xd742('0x21')]();};}function saveUpdates(_0x4255c5,_0x851e89){return function(_0x3ba34c){if(_0x3ba34c){return _0x3ba34c[_0xd742('0x22')](_0x4255c5)['then'](function(_0x9004c2){return _0x9004c2;});}return null;};}function removeEntity(_0x2fec09,_0x291e4d){return function(_0x59dc79){if(_0x59dc79){return _0x59dc79['destroy']()[_0xd742('0x23')](function(){_0x2fec09[_0xd742('0x1a')](0xcc)[_0xd742('0x1b')]();});}};}function handleEntityNotFound(_0x278fb1,_0x5f544c){return function(_0x866518){if(!_0x866518){_0x278fb1[_0xd742('0x24')](0x194);}return _0x866518;};}function handleError(_0xab1615,_0x1f2cf3){_0x1f2cf3=_0x1f2cf3||0x1f4;return function(_0x2c389c){logger[_0xd742('0x25')](_0x2c389c[_0xd742('0x26')]);if(_0x2c389c[_0xd742('0x27')]){delete _0x2c389c[_0xd742('0x27')];}_0xab1615[_0xd742('0x1a')](_0x1f2cf3)[_0xd742('0x28')](_0x2c389c);};}exports['index']=function(_0x164c7e,_0x5144ea){var _0x764180={},_0x5bfc73={},_0x538fba={'count':0x0,'rows':[]};var _0x176bda=_[_0xd742('0x29')](db[_0xd742('0x2a')][_0xd742('0x2b')],function(_0x133a5e){return{'name':_0x133a5e[_0xd742('0x2c')],'type':_0x133a5e['type'][_0xd742('0x2d')]};});_0x5bfc73[_0xd742('0x2e')]=_[_0xd742('0x29')](_0x176bda,_0xd742('0x27'));_0x5bfc73[_0xd742('0x2f')]=_['keys'](_0x164c7e['query']);_0x5bfc73['filters']=_['intersection'](_0x5bfc73[_0xd742('0x2e')],_0x5bfc73[_0xd742('0x2f')]);_0x764180['attributes']=_[_0xd742('0x30')](_0x5bfc73[_0xd742('0x2e')],qs[_0xd742('0x31')](_0x164c7e[_0xd742('0x2f')][_0xd742('0x31')]));_0x764180['attributes']=_0x764180[_0xd742('0x32')][_0xd742('0x33')]?_0x764180[_0xd742('0x32')]:_0x5bfc73['model'];if(!_0x164c7e[_0xd742('0x2f')][_0xd742('0x34')](_0xd742('0x35'))){_0x764180[_0xd742('0x1d')]=qs[_0xd742('0x1d')](_0x164c7e['query'][_0xd742('0x1d')]);_0x764180[_0xd742('0x1c')]=qs['offset'](_0x164c7e[_0xd742('0x2f')][_0xd742('0x1c')]);}_0x764180[_0xd742('0x36')]=qs[_0xd742('0x37')](_0x164c7e[_0xd742('0x2f')]['sort']);_0x764180[_0xd742('0x38')]=qs[_0xd742('0x39')](_[_0xd742('0x3a')](_0x164c7e[_0xd742('0x2f')],_0x5bfc73[_0xd742('0x39')]),_0x176bda);if(_0x164c7e[_0xd742('0x2f')][_0xd742('0x3b')]){_0x764180[_0xd742('0x38')]=_[_0xd742('0x3c')](_0x764180[_0xd742('0x38')],{'$or':_['map'](_0x176bda,function(_0x34e04e){if(_0x34e04e['type']!==_0xd742('0x3d')){var _0x52fac2={};_0x52fac2[_0x34e04e[_0xd742('0x27')]]={'$like':'%'+_0x164c7e['query'][_0xd742('0x3b')]+'%'};return _0x52fac2;}})});}_0x764180=_['merge']({},_0x764180,_0x164c7e[_0xd742('0x3e')]);var _0xc99223={'where':_0x764180['where']};return db[_0xd742('0x2a')][_0xd742('0x1e')](_0xc99223)[_0xd742('0x23')](function(_0x465e71){_0x538fba[_0xd742('0x1e')]=_0x465e71;if(_0x164c7e[_0xd742('0x2f')]['includeAll']){_0x764180[_0xd742('0x3f')]=[{'all':!![]}];}return db[_0xd742('0x2a')][_0xd742('0x40')](_0x764180);})[_0xd742('0x23')](function(_0x3cfbb4){_0x538fba[_0xd742('0x41')]=_0x3cfbb4;return _0x538fba;})[_0xd742('0x23')](respondWithFilteredResult(_0x5144ea,_0x764180))[_0xd742('0x42')](handleError(_0x5144ea,null));};exports[_0xd742('0x43')]=function(_0x354a6a,_0x4c4b6f){var _0x280191={'raw':!![],'where':{'id':_0x354a6a[_0xd742('0x44')]['id']}},_0x397920={};_0x397920['model']=_[_0xd742('0x45')](db[_0xd742('0x2a')]['rawAttributes']);_0x397920['query']=_['keys'](_0x354a6a['query']);_0x397920[_0xd742('0x39')]=_[_0xd742('0x30')](_0x397920[_0xd742('0x2e')],_0x397920['query']);_0x280191['attributes']=_['intersection'](_0x397920[_0xd742('0x2e')],qs[_0xd742('0x31')](_0x354a6a[_0xd742('0x2f')][_0xd742('0x31')]));_0x280191['attributes']=_0x280191[_0xd742('0x32')]['length']?_0x280191['attributes']:_0x397920[_0xd742('0x2e')];if(_0x354a6a[_0xd742('0x2f')][_0xd742('0x46')]){_0x280191[_0xd742('0x3f')]=[{'all':!![]}];}_0x280191=_['merge']({},_0x280191,_0x354a6a[_0xd742('0x3e')]);return db[_0xd742('0x2a')][_0xd742('0x47')](_0x280191)['then'](handleEntityNotFound(_0x4c4b6f,null))['then'](respondWithResult(_0x4c4b6f,null))['catch'](handleError(_0x4c4b6f,null));};exports[_0xd742('0x48')]=function(_0x939a18,_0xbbfbe1){return db['SalesforceField'][_0xd742('0x48')](_0x939a18[_0xd742('0x49')],{})[_0xd742('0x23')](respondWithResult(_0xbbfbe1,0xc9))['catch'](handleError(_0xbbfbe1,null));};exports[_0xd742('0x22')]=function(_0x4c34d8,_0x262da8){if(_0x4c34d8['body']['id']){delete _0x4c34d8[_0xd742('0x49')]['id'];}return db[_0xd742('0x2a')][_0xd742('0x47')]({'where':{'id':_0x4c34d8[_0xd742('0x44')]['id']}})['then'](handleEntityNotFound(_0x262da8,null))[_0xd742('0x23')](saveUpdates(_0x4c34d8[_0xd742('0x49')],null))[_0xd742('0x23')](respondWithResult(_0x262da8,null))[_0xd742('0x42')](handleError(_0x262da8,null));};exports[_0xd742('0x4a')]=function(_0x163e9b,_0x533cdc){return db['SalesforceField'][_0xd742('0x47')]({'where':{'id':_0x163e9b['params']['id']}})['then'](handleEntityNotFound(_0x533cdc,null))[_0xd742('0x23')](removeEntity(_0x533cdc,null))[_0xd742('0x42')](handleError(_0x533cdc,null));};
\ No newline at end of file
index b7c2a28..9217618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5906=['salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0x5906,0xd5));var _0x6590=function(_0x161165,_0x40e238){_0x161165=_0x161165-0x0;var _0x245aed=_0x5906[_0x161165];return _0x245aed;};'use strict';var _=require(_0x6590('0x0'));var util=require('util');var logger=require(_0x6590('0x1'))(_0x6590('0x2'));var moment=require(_0x6590('0x3'));var BPromise=require(_0x6590('0x4'));var rp=require(_0x6590('0x5'));var fs=require('fs');var path=require(_0x6590('0x6'));var rimraf=require('rimraf');var config=require(_0x6590('0x7'));var attributes=require(_0x6590('0x8'));module[_0x6590('0x9')]=function(_0x5083fe,_0x1e0d80){return _0x5083fe['define'](_0x6590('0xa'),attributes,{'tableName':_0x6590('0xb'),'paranoid':![],'indexes':[{'name':_0x6590('0xc'),'fields':[_0x6590('0xd'),_0x6590('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa32b=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','api','request-promise','path'];(function(_0x4858bc,_0x176641){var _0x5f2e11=function(_0x45866b){while(--_0x45866b){_0x4858bc['push'](_0x4858bc['shift']());}};_0x5f2e11(++_0x176641);}(_0xa32b,0x168));var _0xba32=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xa32b[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xba32('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba32('0x2'));var fs=require('fs');var path=require(_0xba32('0x3'));var rimraf=require('rimraf');var config=require(_0xba32('0x4'));var attributes=require(_0xba32('0x5'));module[_0xba32('0x6')]=function(_0x1d8d5c,_0x389295){return _0x1d8d5c[_0xba32('0x7')](_0xba32('0x8'),attributes,{'tableName':_0xba32('0x9'),'paranoid':![],'indexes':[{'name':_0xba32('0xa'),'fields':[_0xba32('0xb'),_0xba32('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 394fa9b..2a6c7d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c55=['SalesforceField,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x18c22e,_0x443a33){var _0x49e9dd=function(_0xa87cc6){while(--_0xa87cc6){_0x18c22e['push'](_0x18c22e['shift']());}};_0x49e9dd(++_0x443a33);}(_0x3c55,0xdf));var _0x53c5=function(_0x23374b,_0x1249e6){_0x23374b=_0x23374b-0x0;var _0x3b9262=_0x3c55[_0x23374b];return _0x3b9262;};'use strict';var _=require('lodash');var util=require(_0x53c5('0x0'));var moment=require(_0x53c5('0x1'));var BPromise=require(_0x53c5('0x2'));var rs=require(_0x53c5('0x3'));var fs=require('fs');var Redis=require(_0x53c5('0x4'));var db=require(_0x53c5('0x5'))['db'];var utils=require(_0x53c5('0x6'));var logger=require(_0x53c5('0x7'))('rpc');var config=require(_0x53c5('0x8'));var jayson=require(_0x53c5('0x9'));var client=jayson[_0x53c5('0xa')][_0x53c5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43f464,_0x3e7525,_0x366d0e){return new BPromise(function(_0x46b7cd,_0x34b06a){return client[_0x53c5('0xc')](_0x43f464,_0x366d0e)[_0x53c5('0xd')](function(_0x1eafca){logger[_0x53c5('0xe')]('SalesforceField,\x20%s,\x20%s',_0x3e7525,_0x53c5('0xf'));logger[_0x53c5('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3e7525,_0x53c5('0xf'),JSON[_0x53c5('0x11')](_0x1eafca));if(_0x1eafca[_0x53c5('0x12')]){if(_0x1eafca[_0x53c5('0x12')]['code']===0x1f4){logger[_0x53c5('0x12')](_0x53c5('0x13'),_0x3e7525,_0x1eafca['error']['message']);return _0x34b06a(_0x1eafca[_0x53c5('0x12')][_0x53c5('0x14')]);}logger['error'](_0x53c5('0x13'),_0x3e7525,_0x1eafca['error']['message']);return _0x46b7cd(_0x1eafca[_0x53c5('0x12')][_0x53c5('0x14')]);}else{logger[_0x53c5('0xe')](_0x53c5('0x13'),_0x3e7525,_0x53c5('0xf'));_0x46b7cd(_0x1eafca['result'][_0x53c5('0x14')]);}})[_0x53c5('0x15')](function(_0x29b7f7){logger[_0x53c5('0x12')](_0x53c5('0x13'),_0x3e7525,_0x29b7f7);_0x34b06a(_0x29b7f7);});});}
\ No newline at end of file
+var _0xe34b=['../../config/environment','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4fb318,_0x400df2){var _0x17da2d=function(_0x21f4be){while(--_0x21f4be){_0x4fb318['push'](_0x4fb318['shift']());}};_0x17da2d(++_0x400df2);}(_0xe34b,0xbf));var _0xbe34=function(_0x1283d4,_0x36b6f1){_0x1283d4=_0x1283d4-0x0;var _0x433643=_0xe34b[_0x1283d4];return _0x433643;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe34('0x0'));var BPromise=require(_0xbe34('0x1'));var rs=require(_0xbe34('0x2'));var fs=require('fs');var Redis=require(_0xbe34('0x3'));var db=require(_0xbe34('0x4'))['db'];var utils=require(_0xbe34('0x5'));var logger=require('../../config/logger')(_0xbe34('0x6'));var config=require(_0xbe34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbe34('0x8')][_0xbe34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d2684,_0x20c14b,_0x50a689){return new BPromise(function(_0x27e221,_0x502685){return client[_0xbe34('0xa')](_0x7d2684,_0x50a689)[_0xbe34('0xb')](function(_0x284ed3){logger[_0xbe34('0xc')](_0xbe34('0xd'),_0x20c14b,'request\x20sent');logger[_0xbe34('0xe')](_0xbe34('0xf'),_0x20c14b,'request\x20sent',JSON['stringify'](_0x284ed3));if(_0x284ed3[_0xbe34('0x10')]){if(_0x284ed3[_0xbe34('0x10')][_0xbe34('0x11')]===0x1f4){logger[_0xbe34('0x10')]('SalesforceField,\x20%s,\x20%s',_0x20c14b,_0x284ed3['error'][_0xbe34('0x12')]);return _0x502685(_0x284ed3[_0xbe34('0x10')]['message']);}logger[_0xbe34('0x10')](_0xbe34('0xd'),_0x20c14b,_0x284ed3[_0xbe34('0x10')][_0xbe34('0x12')]);return _0x27e221(_0x284ed3[_0xbe34('0x10')]['message']);}else{logger[_0xbe34('0xc')]('SalesforceField,\x20%s,\x20%s',_0x20c14b,_0xbe34('0x13'));_0x27e221(_0x284ed3[_0xbe34('0x14')][_0xbe34('0x12')]);}})[_0xbe34('0x15')](function(_0x55d228){logger[_0xbe34('0x10')]('SalesforceField,\x20%s,\x20%s',_0x20c14b,_0x55d228);_0x502685(_0x55d228);});});}
\ No newline at end of file
index 80b5575..a059c13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc831=['getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','/:id','isAuthenticated','show','get','/:id/configurations'];(function(_0x49bb63,_0x48e41f){var _0x43cf32=function(_0x37e2a0){while(--_0x37e2a0){_0x49bb63['push'](_0x49bb63['shift']());}};_0x43cf32(++_0x48e41f);}(_0xc831,0x103));var _0x1c83=function(_0x5aeed6,_0x143430){_0x5aeed6=_0x5aeed6-0x0;var _0x2c1fb3=_0xc831[_0x5aeed6];return _0x2c1fb3;};'use strict';var multer=require('multer');var util=require(_0x1c83('0x0'));var path=require(_0x1c83('0x1'));var timeout=require(_0x1c83('0x2'));var express=require(_0x1c83('0x3'));var router=express[_0x1c83('0x4')]();var fs_extra=require(_0x1c83('0x5'));var auth=require(_0x1c83('0x6'));var interaction=require(_0x1c83('0x7'));var config=require(_0x1c83('0x8'));var controller=require(_0x1c83('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1c83('0xa')]);router['get'](_0x1c83('0xb'),auth[_0x1c83('0xc')](),controller[_0x1c83('0xd')]);router[_0x1c83('0xe')](_0x1c83('0xf'),auth['isAuthenticated'](),controller[_0x1c83('0x10')]);router[_0x1c83('0xe')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1c83('0x11')]);router[_0x1c83('0x12')]('/',auth[_0x1c83('0xc')](),controller['create']);router[_0x1c83('0x12')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1c83('0x13')]);router[_0x1c83('0x14')](_0x1c83('0xb'),auth[_0x1c83('0xc')](),controller[_0x1c83('0x15')]);router[_0x1c83('0x16')](_0x1c83('0xb'),auth['isAuthenticated'](),controller[_0x1c83('0x17')]);module[_0x1c83('0x18')]=router;
\ No newline at end of file
+var _0xf6ec=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','/:id','update','destroy','exports'];(function(_0x36e684,_0x30dbdf){var _0x41ad1f=function(_0x5e2b1b){while(--_0x5e2b1b){_0x36e684['push'](_0x36e684['shift']());}};_0x41ad1f(++_0x30dbdf);}(_0xf6ec,0x198));var _0xcf6e=function(_0x17355f,_0x574831){_0x17355f=_0x17355f-0x0;var _0x3888ab=_0xf6ec[_0x17355f];return _0x3888ab;};'use strict';var multer=require('multer');var util=require(_0xcf6e('0x0'));var path=require(_0xcf6e('0x1'));var timeout=require(_0xcf6e('0x2'));var express=require('express');var router=express[_0xcf6e('0x3')]();var fs_extra=require(_0xcf6e('0x4'));var auth=require(_0xcf6e('0x5'));var interaction=require(_0xcf6e('0x6'));var config=require(_0xcf6e('0x7'));var controller=require(_0xcf6e('0x8'));router[_0xcf6e('0x9')]('/',auth[_0xcf6e('0xa')](),controller[_0xcf6e('0xb')]);router[_0xcf6e('0x9')]('/:id',auth[_0xcf6e('0xa')](),controller[_0xcf6e('0xc')]);router[_0xcf6e('0x9')]('/:id/configurations',auth[_0xcf6e('0xa')](),controller[_0xcf6e('0xd')]);router['get'](_0xcf6e('0xe'),auth[_0xcf6e('0xa')](),controller[_0xcf6e('0xf')]);router[_0xcf6e('0x10')]('/',auth['isAuthenticated'](),controller[_0xcf6e('0x11')]);router[_0xcf6e('0x10')](_0xcf6e('0x12'),auth[_0xcf6e('0xa')](),controller['addConfiguration']);router[_0xcf6e('0x13')](_0xcf6e('0x14'),auth[_0xcf6e('0xa')](),controller[_0xcf6e('0x15')]);router['delete'](_0xcf6e('0x14'),auth[_0xcf6e('0xa')](),controller[_0xcf6e('0x16')]);module[_0xcf6e('0x17')]=router;
\ No newline at end of file
index aa0e966..6153a98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb908=['STRING','username','sequelize','exports'];(function(_0x4d5d28,_0x26bd9b){var _0x2026b1=function(_0x1fe42c){while(--_0x1fe42c){_0x4d5d28['push'](_0x4d5d28['shift']());}};_0x2026b1(++_0x26bd9b);}(_0xb908,0x8a));var _0x8b90=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xb908[_0x4327fe];return _0x138651;};'use strict';var Sequelize=require(_0x8b90('0x0'));module[_0x8b90('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8b90('0x2')],'unique':_0x8b90('0x3')},'password':{'type':Sequelize[_0x8b90('0x2')]},'email':{'type':Sequelize[_0x8b90('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xf5ab=['STRING','sequelize','exports'];(function(_0x3272ea,_0x1e5457){var _0x355315=function(_0x4674ec){while(--_0x4674ec){_0x3272ea['push'](_0x3272ea['shift']());}};_0x355315(++_0x1e5457);}(_0xf5ab,0x1f3));var _0xbf5a=function(_0x5aa66f,_0x22cb46){_0x5aa66f=_0x5aa66f-0x0;var _0x43d204=_0xf5ab[_0x5aa66f];return _0x43d204;};'use strict';var Sequelize=require(_0xbf5a('0x0'));module[_0xbf5a('0x1')]={'name':{'type':Sequelize[_0xbf5a('0x2')]},'description':{'type':Sequelize[_0xbf5a('0x2')]},'username':{'type':Sequelize[_0xbf5a('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xbf5a('0x2')]},'email':{'type':Sequelize[_0xbf5a('0x2')]},'remoteUri':{'type':Sequelize[_0xbf5a('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xbf5a('0x2')],'allowNull':![]}};
\ No newline at end of file
index 43d9c8e..efb1dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a36=['approval_set','work_notes','short_description','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','category','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','internalType','label','push','all','includes','concat','test','stack','send','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','ServicenowAccount','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','findOne','rawAttributes','pick','getConfigurations','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason','knowledge','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','active','business_service','priority','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id'];(function(_0x478fa5,_0x554af8){var _0x461735=function(_0x92fb17){while(--_0x92fb17){_0x478fa5['push'](_0x478fa5['shift']());}};_0x461735(++_0x554af8);}(_0x4a36,0x1a9));var _0x64a3=function(_0x4614f0,_0x19808f){_0x4614f0=_0x4614f0-0x0;var _0x421c7e=_0x4a36[_0x4614f0];return _0x421c7e;};'use strict';var emlformat=require(_0x64a3('0x0'));var rimraf=require(_0x64a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64a3('0x2'));var rp=require(_0x64a3('0x3'));var moment=require(_0x64a3('0x4'));var BPromise=require(_0x64a3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x64a3('0x6'));var sox=require(_0x64a3('0x7'));var csv=require('to-csv');var ejs=require(_0x64a3('0x8'));var fs=require('fs');var fs_extra=require(_0x64a3('0x9'));var _=require('lodash');var squel=require(_0x64a3('0xa'));var crypto=require(_0x64a3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x64a3('0xc'));var toCsv=require(_0x64a3('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x64a3('0xe'));var authService=require(_0x64a3('0xf'));var qs=require(_0x64a3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64a3('0x11'));var logger=require(_0x64a3('0x12'))(_0x64a3('0x13'));var utils=require(_0x64a3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x64a3('0x15'));var db=require(_0x64a3('0x16'))['db'];var integrations=require(_0x64a3('0x17'));function respondWithStatusCode(_0x4e0948,_0x2cc1d9){_0x2cc1d9=_0x2cc1d9||0xcc;return function(_0x9d9eff){if(_0x9d9eff){return _0x4e0948[_0x64a3('0x18')](_0x2cc1d9);}return _0x4e0948[_0x64a3('0x19')](_0x2cc1d9)[_0x64a3('0x1a')]();};}function respondWithResult(_0x414453,_0x69cbc5){_0x69cbc5=_0x69cbc5||0xc8;return function(_0x29edbd){if(_0x29edbd){return _0x414453[_0x64a3('0x19')](_0x69cbc5)[_0x64a3('0x1b')](_0x29edbd);}};}function respondWithFilteredResult(_0x51ba51,_0x468099){return function(_0x54823c){if(_0x54823c){var _0x19e357=typeof _0x468099[_0x64a3('0x1c')]==='undefined'&&typeof _0x468099[_0x64a3('0x1d')]===_0x64a3('0x1e');var _0x2bcd4c=_0x54823c[_0x64a3('0x1f')];var _0x510075=_0x19e357?0x0:_0x468099['offset'];var _0x406c7c=_0x19e357?_0x54823c[_0x64a3('0x1f')]:_0x468099['offset']+_0x468099[_0x64a3('0x1d')];var _0x112131;if(_0x406c7c>=_0x2bcd4c){_0x406c7c=_0x2bcd4c;_0x112131=0xc8;}else{_0x112131=0xce;}_0x51ba51[_0x64a3('0x19')](_0x112131);return _0x51ba51[_0x64a3('0x20')](_0x64a3('0x21'),_0x510075+'-'+_0x406c7c+'/'+_0x2bcd4c)[_0x64a3('0x1b')](_0x54823c);}return null;};}function patchUpdates(_0x322834){return function(_0x16c5b0){try{jsonpatch[_0x64a3('0x22')](_0x16c5b0,_0x322834,!![]);}catch(_0x19f95){return BPromise[_0x64a3('0x23')](_0x19f95);}return _0x16c5b0['save']();};}function saveUpdates(_0x2f923c,_0x1ee55f){return function(_0x4eb28d){if(_0x4eb28d){return _0x4eb28d[_0x64a3('0x24')](_0x2f923c)[_0x64a3('0x25')](function(_0x49c2db){return _0x49c2db;});}return null;};}function removeEntity(_0x57120d,_0x2f9148){return function(_0x3f84c1){if(_0x3f84c1){return _0x3f84c1[_0x64a3('0x26')]()[_0x64a3('0x25')](function(){_0x57120d[_0x64a3('0x19')](0xcc)[_0x64a3('0x1a')]();});}};}function handleEntityNotFound(_0x56f5d5,_0x96dc76){return function(_0x5379bb){if(!_0x5379bb){_0x56f5d5[_0x64a3('0x18')](0x194);}return _0x5379bb;};}function handleError(_0x5d46d5,_0x890339){_0x890339=_0x890339||0x1f4;return function(_0x14418c){logger[_0x64a3('0x27')](_0x14418c['stack']);if(_0x14418c[_0x64a3('0x28')]){delete _0x14418c[_0x64a3('0x28')];}_0x5d46d5[_0x64a3('0x19')](_0x890339)['send'](_0x14418c);};}exports[_0x64a3('0x29')]=function(_0x3af49e,_0x408dad){var _0x5ca123={},_0x34e91c={},_0x51715c={'count':0x0,'rows':[]};var _0x48a658=_['map'](db[_0x64a3('0x2a')]['rawAttributes'],function(_0x13cffb){return{'name':_0x13cffb['fieldName'],'type':_0x13cffb[_0x64a3('0x2b')]['key']};});_0x34e91c[_0x64a3('0x2c')]=_[_0x64a3('0x2d')](_0x48a658,_0x64a3('0x28'));_0x34e91c[_0x64a3('0x2e')]=_[_0x64a3('0x2f')](_0x3af49e[_0x64a3('0x2e')]);_0x34e91c[_0x64a3('0x30')]=_[_0x64a3('0x31')](_0x34e91c[_0x64a3('0x2c')],_0x34e91c[_0x64a3('0x2e')]);_0x5ca123[_0x64a3('0x32')]=_['intersection'](_0x34e91c['model'],qs[_0x64a3('0x33')](_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x33')]));_0x5ca123['attributes']=_0x5ca123[_0x64a3('0x32')]['length']?_0x5ca123[_0x64a3('0x32')]:_0x34e91c[_0x64a3('0x2c')];if(!_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x34')](_0x64a3('0x35'))){_0x5ca123['limit']=qs['limit'](_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x1d')]);_0x5ca123['offset']=qs[_0x64a3('0x1c')](_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x1c')]);}_0x5ca123[_0x64a3('0x36')]=qs[_0x64a3('0x37')](_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x37')]);_0x5ca123[_0x64a3('0x38')]=qs[_0x64a3('0x30')](_['pick'](_0x3af49e[_0x64a3('0x2e')],_0x34e91c[_0x64a3('0x30')]),_0x48a658);if(_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x39')]){_0x5ca123[_0x64a3('0x38')]=_['merge'](_0x5ca123['where'],{'$or':_[_0x64a3('0x2d')](_0x48a658,function(_0x1810fc){if(_0x1810fc['type']!==_0x64a3('0x3a')){var _0x426fed={};_0x426fed[_0x1810fc[_0x64a3('0x28')]]={'$like':'%'+_0x3af49e['query'][_0x64a3('0x39')]+'%'};return _0x426fed;}})});}_0x5ca123=_[_0x64a3('0x3b')]({},_0x5ca123,_0x3af49e[_0x64a3('0x3c')]);var _0x37c8b3={'where':_0x5ca123['where']};return db[_0x64a3('0x2a')][_0x64a3('0x1f')](_0x37c8b3)[_0x64a3('0x25')](function(_0x2f43c3){_0x51715c[_0x64a3('0x1f')]=_0x2f43c3;if(_0x3af49e[_0x64a3('0x2e')][_0x64a3('0x3d')]){_0x5ca123['include']=[{'all':!![]}];}return db[_0x64a3('0x2a')][_0x64a3('0x3e')](_0x5ca123);})['then'](function(_0x2554d2){_0x51715c[_0x64a3('0x3f')]=_0x2554d2;return _0x51715c;})[_0x64a3('0x25')](respondWithFilteredResult(_0x408dad,_0x5ca123))[_0x64a3('0x40')](handleError(_0x408dad,null));};exports[_0x64a3('0x41')]=function(_0x2da601,_0x235d36){var _0x1b0c0a={'raw':![],'where':{'id':_0x2da601['params']['id']}},_0x2d1115={};_0x2d1115[_0x64a3('0x2c')]=_[_0x64a3('0x2f')](db[_0x64a3('0x2a')]['rawAttributes']);_0x2d1115['query']=_[_0x64a3('0x2f')](_0x2da601[_0x64a3('0x2e')]);_0x2d1115[_0x64a3('0x30')]=_[_0x64a3('0x31')](_0x2d1115[_0x64a3('0x2c')],_0x2d1115[_0x64a3('0x2e')]);_0x1b0c0a['attributes']=_[_0x64a3('0x31')](_0x2d1115['model'],qs['fields'](_0x2da601[_0x64a3('0x2e')][_0x64a3('0x33')]));_0x1b0c0a['attributes']=_0x1b0c0a['attributes'][_0x64a3('0x42')]?_0x1b0c0a[_0x64a3('0x32')]:_0x2d1115[_0x64a3('0x2c')];if(_0x2da601['query'][_0x64a3('0x3d')]){_0x1b0c0a[_0x64a3('0x43')]=[{'all':!![]}];}_0x1b0c0a=_['merge']({},_0x1b0c0a,_0x2da601[_0x64a3('0x3c')]);return db[_0x64a3('0x2a')][_0x64a3('0x44')](_0x1b0c0a)['then'](handleEntityNotFound(_0x235d36,null))[_0x64a3('0x25')](respondWithResult(_0x235d36,null))[_0x64a3('0x40')](handleError(_0x235d36,null));};exports[_0x64a3('0x45')]=function(_0x2dd47b,_0x13d2f6){return db[_0x64a3('0x2a')][_0x64a3('0x45')](_0x2dd47b[_0x64a3('0x46')],{})['then'](respondWithResult(_0x13d2f6,0xc9))['catch'](handleError(_0x13d2f6,null));};exports[_0x64a3('0x24')]=function(_0x222a06,_0x12a49d){if(_0x222a06[_0x64a3('0x46')]['id']){delete _0x222a06[_0x64a3('0x46')]['id'];}return db[_0x64a3('0x2a')]['find']({'where':{'id':_0x222a06[_0x64a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x12a49d,null))[_0x64a3('0x25')](saveUpdates(_0x222a06[_0x64a3('0x46')],null))[_0x64a3('0x25')](respondWithResult(_0x12a49d,null))[_0x64a3('0x40')](handleError(_0x12a49d,null));};exports[_0x64a3('0x26')]=function(_0x544de4,_0x15aada){return db[_0x64a3('0x2a')]['find']({'where':{'id':_0x544de4[_0x64a3('0x47')]['id']}})[_0x64a3('0x25')](handleEntityNotFound(_0x15aada,null))[_0x64a3('0x25')](removeEntity(_0x15aada,null))['catch'](handleError(_0x15aada,null));};exports['getConfigurations']=function(_0x40f266,_0x2b7c6c,_0x4ae51b){var _0x139642={};var _0x29cede={};var _0x369da4;var _0x30de68;return db[_0x64a3('0x2a')][_0x64a3('0x48')]({'where':{'id':_0x40f266[_0x64a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b7c6c,null))[_0x64a3('0x25')](function(_0x27d7f2){if(_0x27d7f2){_0x369da4=_0x27d7f2;_0x29cede[_0x64a3('0x2c')]=_[_0x64a3('0x2f')](db['ServicenowConfiguration'][_0x64a3('0x49')]);_0x29cede[_0x64a3('0x2e')]=_[_0x64a3('0x2f')](_0x40f266['query']);_0x29cede['filters']=_[_0x64a3('0x31')](_0x29cede['model'],_0x29cede[_0x64a3('0x2e')]);_0x139642[_0x64a3('0x32')]=_[_0x64a3('0x31')](_0x29cede[_0x64a3('0x2c')],qs[_0x64a3('0x33')](_0x40f266['query'][_0x64a3('0x33')]));_0x139642[_0x64a3('0x32')]=_0x139642[_0x64a3('0x32')]['length']?_0x139642[_0x64a3('0x32')]:_0x29cede['model'];_0x139642['order']=qs[_0x64a3('0x37')](_0x40f266['query'][_0x64a3('0x37')]);_0x139642[_0x64a3('0x38')]=qs[_0x64a3('0x30')](_[_0x64a3('0x4a')](_0x40f266[_0x64a3('0x2e')],_0x29cede[_0x64a3('0x30')]));if(_0x40f266[_0x64a3('0x2e')][_0x64a3('0x39')]){_0x139642[_0x64a3('0x38')]=_[_0x64a3('0x3b')](_0x139642[_0x64a3('0x38')],{'$or':_[_0x64a3('0x2d')](_0x139642[_0x64a3('0x32')],function(_0xf2cc9a){var _0x32c03c={};_0x32c03c[_0xf2cc9a]={'$like':'%'+_0x40f266[_0x64a3('0x2e')][_0x64a3('0x39')]+'%'};return _0x32c03c;})});}_0x139642=_['merge']({},_0x139642,_0x40f266['options']);return _0x369da4[_0x64a3('0x4b')](_0x139642);}})['then'](function(_0x456321){if(_0x456321){_0x30de68=_0x456321[_0x64a3('0x42')];if(!_0x40f266['query'][_0x64a3('0x34')]('nolimit')){_0x139642[_0x64a3('0x1d')]=qs['limit'](_0x40f266['query'][_0x64a3('0x1d')]);_0x139642['offset']=qs['offset'](_0x40f266[_0x64a3('0x2e')]['offset']);}return _0x369da4[_0x64a3('0x4b')](_0x139642);}})['then'](function(_0x235666){if(_0x235666){return _0x235666?{'count':_0x30de68,'rows':_0x235666}:null;}})[_0x64a3('0x25')](respondWithResult(_0x2b7c6c,null))[_0x64a3('0x40')](handleError(_0x2b7c6c,null));};exports['addConfiguration']=function(_0x15691e,_0x163c1f,_0x10be8a){if(_0x15691e[_0x64a3('0x46')]['id']){delete _0x15691e[_0x64a3('0x46')]['id'];}return db['ServicenowAccount'][_0x64a3('0x48')]({'where':{'id':_0x15691e[_0x64a3('0x47')]['id']}})['then'](handleEntityNotFound(_0x163c1f,null))[_0x64a3('0x25')](function(_0x1432f2){if(_0x1432f2){_0x15691e['body'][_0x64a3('0x4c')]=_0x1432f2['id'];_0x15691e[_0x64a3('0x46')][_0x64a3('0x4d')]=integrations['getSubjects'](_0x15691e[_0x64a3('0x46')][_0x64a3('0x4e')],_0x15691e[_0x64a3('0x46')]['type']);_0x15691e[_0x64a3('0x46')][_0x64a3('0x4f')]=integrations[_0x64a3('0x50')](_0x15691e[_0x64a3('0x46')][_0x64a3('0x4e')],_0x15691e[_0x64a3('0x46')][_0x64a3('0x2b')]);return db[_0x64a3('0x51')]['create'](_0x15691e[_0x64a3('0x46')],{'include':[{'model':db[_0x64a3('0x52')],'as':_0x64a3('0x4d')},{'model':db[_0x64a3('0x52')],'as':_0x64a3('0x4f')}]});}return null;})[_0x64a3('0x25')](respondWithResult(_0x163c1f,null))[_0x64a3('0x40')](handleError(_0x163c1f,null));};exports[_0x64a3('0x53')]=function(_0x28269c,_0x1bb625,_0x286041){var _0x224f1f=['made_sla',_0x64a3('0x54'),_0x64a3('0x55'),'subcategory',_0x64a3('0x56'),_0x64a3('0x57'),_0x64a3('0x58'),_0x64a3('0x59'),'category'];var _0x40422c=[_0x64a3('0x5a'),'made_sla',_0x64a3('0x5b'),'watch_list',_0x64a3('0x5c'),_0x64a3('0x5d'),_0x64a3('0x5e'),_0x64a3('0x54'),_0x64a3('0x5f'),_0x64a3('0x60'),'resolved_by',_0x64a3('0x61'),_0x64a3('0x62'),_0x64a3('0x63'),_0x64a3('0x64'),_0x64a3('0x65'),_0x64a3('0x66'),_0x64a3('0x67'),_0x64a3('0x55'),_0x64a3('0x36'),'calendar_stc',_0x64a3('0x68'),_0x64a3('0x69'),_0x64a3('0x6a'),'impact',_0x64a3('0x6b'),'work_notes_list',_0x64a3('0x6c'),_0x64a3('0x6d'),'sys_domain_path','rfc',_0x64a3('0x6e'),_0x64a3('0x6f'),_0x64a3('0x70'),_0x64a3('0x71'),'group_list',_0x64a3('0x72'),_0x64a3('0x73'),_0x64a3('0x74'),_0x64a3('0x75'),_0x64a3('0x76'),'subcategory',_0x64a3('0x77'),_0x64a3('0x78'),_0x64a3('0x56'),'correlation_display',_0x64a3('0x79'),_0x64a3('0x7a'),_0x64a3('0x7b'),_0x64a3('0x7c'),_0x64a3('0x7d'),'description',_0x64a3('0x7e'),_0x64a3('0x57'),'sys_class_name',_0x64a3('0x7f'),'closed_by',_0x64a3('0x80'),_0x64a3('0x81'),_0x64a3('0x82'),_0x64a3('0x83'),_0x64a3('0x84'),'incident_state',_0x64a3('0x85'),_0x64a3('0x86'),_0x64a3('0x87'),_0x64a3('0x88'),_0x64a3('0x89'),_0x64a3('0x8a'),_0x64a3('0x59'),_0x64a3('0x8b'),'sla_due','approval',_0x64a3('0x8c'),_0x64a3('0x8d'),_0x64a3('0x8e'),_0x64a3('0x8f'),'sys_tags',_0x64a3('0x90'),_0x64a3('0x91'),'correlation_id','location',_0x64a3('0x92')];var _0x1ae93d='';var _0xd4c8a6='';var _0x2d27ff=[];var _0x1156aa='';var _0x2b2a0a='';var _0x348f58=[];var _0x5d2a21='';var _0x133da2='';var _0x54aa00={};var _0x1b0569='';return db[_0x64a3('0x2a')][_0x64a3('0x48')]({'where':{'id':_0x28269c[_0x64a3('0x47')]['id']},'attributes':['id',_0x64a3('0x93'),_0x64a3('0x94'),'email',_0x64a3('0x95'),_0x64a3('0x96')]})[_0x64a3('0x25')](handleEntityNotFound(_0x1bb625,null))[_0x64a3('0x25')](function(_0x4e5dbd){if(_0x4e5dbd){_0x1b0569=_0x4e5dbd[_0x64a3('0x95')];var _0x4fb19a=_0x1b0569[_0x64a3('0x97')](-0x1);if(_0x4fb19a==='/'){_0x1b0569=_0x1b0569[_0x64a3('0x98')](0x0,_0x1b0569[_0x64a3('0x99')](_0x4fb19a));}_0x133da2=util['format'](_0x64a3('0x9a'),_0x1b0569);_0x5d2a21=util[_0x64a3('0x9b')](_0x64a3('0x9c'),_0x1b0569);_0x54aa00={'user':_0x4e5dbd[_0x64a3('0x93')],'pass':_0x4e5dbd[_0x64a3('0x94')]};var _0x14ef5f={'method':_0x64a3('0x9d'),'uri':_0x133da2+_0x64a3('0x9e'),'auth':_0x54aa00,'json':!![]};return rp(_0x14ef5f);}})['then'](function(_0x5841ea){if(_0x5841ea[_0x64a3('0x9f')]['length']>0x0){_0x1ae93d=_0x5841ea[_0x64a3('0x9f')];}console[_0x64a3('0xa0')]('incident\x20table\x20objects',_0x1ae93d);_0x348f58=[];_0xd4c8a6=Object[_0x64a3('0xa1')]([],_0x1ae93d);_[_0x64a3('0xa2')](_0xd4c8a6,function(_0x452f1e){return!_0x224f1f['includes'](_0x452f1e[_0x64a3('0x28')]);});_0xd4c8a6['forEach'](function(_0x4ba6b3){var _0x30d41b=createFieldObject(_0x5d2a21,_0x54aa00,_0x4ba6b3[_0x64a3('0xa3')],_0x4ba6b3[_0x64a3('0x28')],_0x4ba6b3[_0x64a3('0xa4')],![]);_0x348f58[_0x64a3('0xa5')](_0x30d41b);});return Promise[_0x64a3('0xa6')](_0x348f58);})['then'](function(_0x2830b8){_0x2d27ff=_0x2830b8;_0x1156aa=Object['assign']([],_0x1ae93d);console['log']('TCL:\x20_object',_0x1ae93d);_[_0x64a3('0xa2')](_0x1156aa,function(_0x3db5e5){return _0x40422c[_0x64a3('0xa7')](_0x3db5e5['name']);});console[_0x64a3('0xa0')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x1156aa);_0x348f58=[];_0x1156aa['forEach'](function(_0x5a32c3){var _0x1dbd40=createFieldObject(_0x5d2a21,_0x54aa00,_0x5a32c3[_0x64a3('0xa3')],_0x5a32c3[_0x64a3('0x28')],_0x5a32c3[_0x64a3('0xa4')],!![]);_0x348f58[_0x64a3('0xa5')](_0x1dbd40);});return Promise[_0x64a3('0xa6')](_0x348f58);})[_0x64a3('0x25')](function(_0x14f0f9){_0x2b2a0a=_0x14f0f9;var _0x39ec10=_0x2d27ff[_0x64a3('0xa8')](_0x2b2a0a);return{'count':_0x39ec10[_0x64a3('0x42')],'rows':_0x39ec10};})[_0x64a3('0x25')](respondWithResult(_0x1bb625,null))[_0x64a3('0x40')](function(_0x25bc9b){console['log']('ServiceNow\x20error:\x20'+_0x25bc9b);var _0xa1a251=_0x28269c[_0x64a3('0x2e')][_0x64a3('0xa9')]?0x1f4:_0x25bc9b['statusCode']||0x1f4;logger[_0x64a3('0x27')](_0x25bc9b[_0x64a3('0xaa')]);delete _0x25bc9b[_0x64a3('0x28')];if(_0xa1a251===0x191){_0xa1a251=0x190;}_0x1bb625[_0x64a3('0x19')](_0xa1a251)[_0x64a3('0xab')](_0x28269c[_0x64a3('0x2e')]['test']?{'message':_0x64a3('0xac'),'statusCode':_0x25bc9b[_0x64a3('0xad')]}:_0x25bc9b);});};function createFieldObject(_0x232544,_0x3602ce,_0x9bbf14,_0x8d8b15,_0x3e9558,_0x34c7ba){return new Promise(function(_0x1c60bd,_0x344862){var _0x1c2025={'id':_0x8d8b15,'name':_0x3e9558,'custom':_0x34c7ba};if(_0x9bbf14===_0x64a3('0xae')){_0x1c2025[_0x64a3('0x3c')]=[{'name':_0x64a3('0xaf'),'value':_0x64a3('0xb0')},{'name':_0x64a3('0xb1'),'value':_0x64a3('0xb2')}];_0x1c60bd(_0x1c2025);}else{var _0x232daa={'method':_0x64a3('0x9d'),'uri':_0x232544+_0x64a3('0xb3')+_0x8d8b15,'auth':_0x3602ce,'json':!![]};return rp(_0x232daa)[_0x64a3('0x25')](function(_0x52920a){var _0x54b1db=[];if(_0x52920a[_0x64a3('0x9f')][_0x64a3('0x42')]>0x0){_0x52920a[_0x64a3('0x9f')]['forEach'](function(_0x2ea09c){if(_0x2ea09c['inactive']===_0x64a3('0xb2')){var _0x4534c6={'name':_0x2ea09c[_0x64a3('0xa4')],'value':_0x2ea09c[_0x64a3('0xb4')]};_0x54b1db[_0x64a3('0xa5')](_0x4534c6);}});}_0x1c2025[_0x64a3('0x3c')]=_0x54b1db;if(_0x1c2025[_0x64a3('0x3c')][_0x64a3('0x42')]>0x0){_0x1c60bd(_0x1c2025);}else{if(_0x34c7ba==![]){_0x1c60bd();}else{_0x1c60bd(_0x1c2025);}}});}});}
\ No newline at end of file
+var _0x74f3=['close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','impact','active','business_service','priority','sys_domain_path','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','caller_id','approval_set','subcategory','short_description','delivery_task','work_start','business_stc','additional_assignee_list','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','sla_due','due_date','reopen_count','escalation','location','password','email','serverUrl','slice','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','stack','Wrong\x20credentials','True','true','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','error','name','send','index','map','ServicenowAccount','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','options','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','filter','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge'];(function(_0x1e43be,_0x3f0eea){var _0xcc6ced=function(_0x1c86ff){while(--_0x1c86ff){_0x1e43be['push'](_0x1e43be['shift']());}};_0xcc6ced(++_0x3f0eea);}(_0x74f3,0x1b5));var _0x374f=function(_0x3ca368,_0xbca363){_0x3ca368=_0x3ca368-0x0;var _0x557fb9=_0x74f3[_0x3ca368];return _0x557fb9;};'use strict';var emlformat=require(_0x374f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x374f('0x1'));var jsonpatch=require(_0x374f('0x2'));var rp=require('request-promise');var moment=require(_0x374f('0x3'));var BPromise=require(_0x374f('0x4'));var Mustache=require(_0x374f('0x5'));var util=require(_0x374f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x374f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x374f('0x8'));var crypto=require(_0x374f('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x374f('0xa'));var toCsv=require(_0x374f('0x7'));var querystring=require(_0x374f('0xb'));var Papa=require(_0x374f('0xc'));var Redis=require('ioredis');var authService=require(_0x374f('0xd'));var qs=require(_0x374f('0xe'));var as=require(_0x374f('0xf'));var hardwareService=require(_0x374f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x374f('0x11'));var config=require(_0x374f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x374f('0x13'))['db'];var integrations=require(_0x374f('0x14'));function respondWithStatusCode(_0xd58104,_0x4a33fd){_0x4a33fd=_0x4a33fd||0xcc;return function(_0x4378de){if(_0x4378de){return _0xd58104[_0x374f('0x15')](_0x4a33fd);}return _0xd58104['status'](_0x4a33fd)[_0x374f('0x16')]();};}function respondWithResult(_0x48855e,_0x321d2f){_0x321d2f=_0x321d2f||0xc8;return function(_0x47d4ab){if(_0x47d4ab){return _0x48855e[_0x374f('0x17')](_0x321d2f)[_0x374f('0x18')](_0x47d4ab);}};}function respondWithFilteredResult(_0x3f4404,_0x381457){return function(_0xc30fe5){if(_0xc30fe5){var _0x58ac9c=typeof _0x381457[_0x374f('0x19')]===_0x374f('0x1a')&&typeof _0x381457[_0x374f('0x1b')]===_0x374f('0x1a');var _0x379a69=_0xc30fe5[_0x374f('0x1c')];var _0x4b14b4=_0x58ac9c?0x0:_0x381457[_0x374f('0x19')];var _0x343157=_0x58ac9c?_0xc30fe5[_0x374f('0x1c')]:_0x381457['offset']+_0x381457[_0x374f('0x1b')];var _0x352a0f;if(_0x343157>=_0x379a69){_0x343157=_0x379a69;_0x352a0f=0xc8;}else{_0x352a0f=0xce;}_0x3f4404[_0x374f('0x17')](_0x352a0f);return _0x3f4404[_0x374f('0x1d')](_0x374f('0x1e'),_0x4b14b4+'-'+_0x343157+'/'+_0x379a69)['json'](_0xc30fe5);}return null;};}function patchUpdates(_0x292604){return function(_0x55eed4){try{jsonpatch[_0x374f('0x1f')](_0x55eed4,_0x292604,!![]);}catch(_0x53818c){return BPromise[_0x374f('0x20')](_0x53818c);}return _0x55eed4['save']();};}function saveUpdates(_0x517b81,_0x11bb7b){return function(_0x360e44){if(_0x360e44){return _0x360e44['update'](_0x517b81)[_0x374f('0x21')](function(_0x33578b){return _0x33578b;});}return null;};}function removeEntity(_0x4d9895,_0x1198c5){return function(_0x186678){if(_0x186678){return _0x186678['destroy']()[_0x374f('0x21')](function(){_0x4d9895[_0x374f('0x17')](0xcc)[_0x374f('0x16')]();});}};}function handleEntityNotFound(_0x120be3,_0x2d0b58){return function(_0x231988){if(!_0x231988){_0x120be3['sendStatus'](0x194);}return _0x231988;};}function handleError(_0x3a0374,_0x341eb3){_0x341eb3=_0x341eb3||0x1f4;return function(_0x170cca){logger[_0x374f('0x22')](_0x170cca['stack']);if(_0x170cca[_0x374f('0x23')]){delete _0x170cca[_0x374f('0x23')];}_0x3a0374[_0x374f('0x17')](_0x341eb3)[_0x374f('0x24')](_0x170cca);};}exports[_0x374f('0x25')]=function(_0x5f3b05,_0x1f8759){var _0x4fa808={},_0x25ee65={},_0x3f82e2={'count':0x0,'rows':[]};var _0x1be98f=_[_0x374f('0x26')](db[_0x374f('0x27')]['rawAttributes'],function(_0xfc2621){return{'name':_0xfc2621[_0x374f('0x28')],'type':_0xfc2621[_0x374f('0x29')]['key']};});_0x25ee65[_0x374f('0x2a')]=_[_0x374f('0x26')](_0x1be98f,_0x374f('0x23'));_0x25ee65[_0x374f('0x2b')]=_[_0x374f('0x2c')](_0x5f3b05[_0x374f('0x2b')]);_0x25ee65['filters']=_['intersection'](_0x25ee65[_0x374f('0x2a')],_0x25ee65[_0x374f('0x2b')]);_0x4fa808[_0x374f('0x2d')]=_[_0x374f('0x2e')](_0x25ee65[_0x374f('0x2a')],qs['fields'](_0x5f3b05['query'][_0x374f('0x2f')]));_0x4fa808[_0x374f('0x2d')]=_0x4fa808['attributes'][_0x374f('0x30')]?_0x4fa808[_0x374f('0x2d')]:_0x25ee65['model'];if(!_0x5f3b05[_0x374f('0x2b')][_0x374f('0x31')](_0x374f('0x32'))){_0x4fa808[_0x374f('0x1b')]=qs[_0x374f('0x1b')](_0x5f3b05[_0x374f('0x2b')][_0x374f('0x1b')]);_0x4fa808[_0x374f('0x19')]=qs[_0x374f('0x19')](_0x5f3b05[_0x374f('0x2b')][_0x374f('0x19')]);}_0x4fa808[_0x374f('0x33')]=qs[_0x374f('0x34')](_0x5f3b05[_0x374f('0x2b')][_0x374f('0x34')]);_0x4fa808[_0x374f('0x35')]=qs['filters'](_[_0x374f('0x36')](_0x5f3b05[_0x374f('0x2b')],_0x25ee65['filters']),_0x1be98f);if(_0x5f3b05[_0x374f('0x2b')]['filter']){_0x4fa808[_0x374f('0x35')]=_[_0x374f('0x37')](_0x4fa808[_0x374f('0x35')],{'$or':_[_0x374f('0x26')](_0x1be98f,function(_0x541be8){if(_0x541be8['type']!==_0x374f('0x38')){var _0x35e8c6={};_0x35e8c6[_0x541be8['name']]={'$like':'%'+_0x5f3b05[_0x374f('0x2b')]['filter']+'%'};return _0x35e8c6;}})});}_0x4fa808=_[_0x374f('0x37')]({},_0x4fa808,_0x5f3b05['options']);var _0x3fd277={'where':_0x4fa808['where']};return db[_0x374f('0x27')][_0x374f('0x1c')](_0x3fd277)['then'](function(_0x1ff6c4){_0x3f82e2['count']=_0x1ff6c4;if(_0x5f3b05[_0x374f('0x2b')][_0x374f('0x39')]){_0x4fa808[_0x374f('0x3a')]=[{'all':!![]}];}return db[_0x374f('0x27')][_0x374f('0x3b')](_0x4fa808);})[_0x374f('0x21')](function(_0xf2d836){_0x3f82e2[_0x374f('0x3c')]=_0xf2d836;return _0x3f82e2;})[_0x374f('0x21')](respondWithFilteredResult(_0x1f8759,_0x4fa808))[_0x374f('0x3d')](handleError(_0x1f8759,null));};exports[_0x374f('0x3e')]=function(_0x339c4c,_0x3432b1){var _0x4912d2={'raw':![],'where':{'id':_0x339c4c[_0x374f('0x3f')]['id']}},_0x1672f5={};_0x1672f5[_0x374f('0x2a')]=_[_0x374f('0x2c')](db[_0x374f('0x27')][_0x374f('0x40')]);_0x1672f5['query']=_[_0x374f('0x2c')](_0x339c4c[_0x374f('0x2b')]);_0x1672f5[_0x374f('0x41')]=_[_0x374f('0x2e')](_0x1672f5[_0x374f('0x2a')],_0x1672f5[_0x374f('0x2b')]);_0x4912d2[_0x374f('0x2d')]=_[_0x374f('0x2e')](_0x1672f5[_0x374f('0x2a')],qs[_0x374f('0x2f')](_0x339c4c['query']['fields']));_0x4912d2[_0x374f('0x2d')]=_0x4912d2[_0x374f('0x2d')]['length']?_0x4912d2[_0x374f('0x2d')]:_0x1672f5[_0x374f('0x2a')];if(_0x339c4c[_0x374f('0x2b')][_0x374f('0x39')]){_0x4912d2[_0x374f('0x3a')]=[{'all':!![]}];}_0x4912d2=_[_0x374f('0x37')]({},_0x4912d2,_0x339c4c[_0x374f('0x42')]);return db[_0x374f('0x27')][_0x374f('0x43')](_0x4912d2)['then'](handleEntityNotFound(_0x3432b1,null))[_0x374f('0x21')](respondWithResult(_0x3432b1,null))[_0x374f('0x3d')](handleError(_0x3432b1,null));};exports[_0x374f('0x44')]=function(_0x3c52e9,_0x3efd20){return db[_0x374f('0x27')][_0x374f('0x44')](_0x3c52e9[_0x374f('0x45')],{})[_0x374f('0x21')](respondWithResult(_0x3efd20,0xc9))['catch'](handleError(_0x3efd20,null));};exports['update']=function(_0x1ec2b9,_0x5a2898){if(_0x1ec2b9['body']['id']){delete _0x1ec2b9[_0x374f('0x45')]['id'];}return db[_0x374f('0x27')][_0x374f('0x43')]({'where':{'id':_0x1ec2b9[_0x374f('0x3f')]['id']}})[_0x374f('0x21')](handleEntityNotFound(_0x5a2898,null))[_0x374f('0x21')](saveUpdates(_0x1ec2b9[_0x374f('0x45')],null))['then'](respondWithResult(_0x5a2898,null))[_0x374f('0x3d')](handleError(_0x5a2898,null));};exports[_0x374f('0x46')]=function(_0xc61cfd,_0xd96d35){return db['ServicenowAccount'][_0x374f('0x43')]({'where':{'id':_0xc61cfd[_0x374f('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd96d35,null))[_0x374f('0x21')](removeEntity(_0xd96d35,null))[_0x374f('0x3d')](handleError(_0xd96d35,null));};exports[_0x374f('0x47')]=function(_0x5baa85,_0x448fea,_0x37aafc){var _0x331ea1={};var _0x5a2f63={};var _0x17e97a;var _0xa8753a;return db[_0x374f('0x27')][_0x374f('0x48')]({'where':{'id':_0x5baa85[_0x374f('0x3f')]['id']}})[_0x374f('0x21')](handleEntityNotFound(_0x448fea,null))[_0x374f('0x21')](function(_0x3f97bf){if(_0x3f97bf){_0x17e97a=_0x3f97bf;_0x5a2f63[_0x374f('0x2a')]=_[_0x374f('0x2c')](db[_0x374f('0x49')][_0x374f('0x40')]);_0x5a2f63[_0x374f('0x2b')]=_[_0x374f('0x2c')](_0x5baa85[_0x374f('0x2b')]);_0x5a2f63['filters']=_[_0x374f('0x2e')](_0x5a2f63['model'],_0x5a2f63[_0x374f('0x2b')]);_0x331ea1[_0x374f('0x2d')]=_['intersection'](_0x5a2f63[_0x374f('0x2a')],qs[_0x374f('0x2f')](_0x5baa85['query'][_0x374f('0x2f')]));_0x331ea1[_0x374f('0x2d')]=_0x331ea1[_0x374f('0x2d')][_0x374f('0x30')]?_0x331ea1[_0x374f('0x2d')]:_0x5a2f63[_0x374f('0x2a')];_0x331ea1[_0x374f('0x33')]=qs[_0x374f('0x34')](_0x5baa85['query'][_0x374f('0x34')]);_0x331ea1[_0x374f('0x35')]=qs[_0x374f('0x41')](_[_0x374f('0x36')](_0x5baa85[_0x374f('0x2b')],_0x5a2f63['filters']));if(_0x5baa85['query'][_0x374f('0x4a')]){_0x331ea1['where']=_[_0x374f('0x37')](_0x331ea1['where'],{'$or':_[_0x374f('0x26')](_0x331ea1['attributes'],function(_0x115c2b){var _0x4064ae={};_0x4064ae[_0x115c2b]={'$like':'%'+_0x5baa85[_0x374f('0x2b')][_0x374f('0x4a')]+'%'};return _0x4064ae;})});}_0x331ea1=_[_0x374f('0x37')]({},_0x331ea1,_0x5baa85['options']);return _0x17e97a[_0x374f('0x47')](_0x331ea1);}})[_0x374f('0x21')](function(_0x5a5165){if(_0x5a5165){_0xa8753a=_0x5a5165[_0x374f('0x30')];if(!_0x5baa85['query']['hasOwnProperty'](_0x374f('0x32'))){_0x331ea1[_0x374f('0x1b')]=qs[_0x374f('0x1b')](_0x5baa85[_0x374f('0x2b')][_0x374f('0x1b')]);_0x331ea1[_0x374f('0x19')]=qs[_0x374f('0x19')](_0x5baa85[_0x374f('0x2b')][_0x374f('0x19')]);}return _0x17e97a[_0x374f('0x47')](_0x331ea1);}})[_0x374f('0x21')](function(_0x30bf71){if(_0x30bf71){return _0x30bf71?{'count':_0xa8753a,'rows':_0x30bf71}:null;}})[_0x374f('0x21')](respondWithResult(_0x448fea,null))[_0x374f('0x3d')](handleError(_0x448fea,null));};exports[_0x374f('0x4b')]=function(_0x5bc289,_0x4cfa45,_0x856afb){if(_0x5bc289[_0x374f('0x45')]['id']){delete _0x5bc289['body']['id'];}return db[_0x374f('0x27')][_0x374f('0x48')]({'where':{'id':_0x5bc289[_0x374f('0x3f')]['id']}})[_0x374f('0x21')](handleEntityNotFound(_0x4cfa45,null))['then'](function(_0x2abba9){if(_0x2abba9){_0x5bc289[_0x374f('0x45')][_0x374f('0x4c')]=_0x2abba9['id'];_0x5bc289[_0x374f('0x45')][_0x374f('0x4d')]=integrations['getSubjects'](_0x5bc289['body'][_0x374f('0x4e')],_0x5bc289[_0x374f('0x45')][_0x374f('0x29')]);_0x5bc289[_0x374f('0x45')][_0x374f('0x4f')]=integrations[_0x374f('0x50')](_0x5bc289[_0x374f('0x45')][_0x374f('0x4e')],_0x5bc289[_0x374f('0x45')][_0x374f('0x29')]);return db[_0x374f('0x49')]['create'](_0x5bc289[_0x374f('0x45')],{'include':[{'model':db[_0x374f('0x51')],'as':_0x374f('0x4d')},{'model':db[_0x374f('0x51')],'as':_0x374f('0x4f')}]});}return null;})[_0x374f('0x21')](respondWithResult(_0x4cfa45,null))[_0x374f('0x3d')](handleError(_0x4cfa45,null));};exports['getFields']=function(_0x5d109c,_0x3bf3ec,_0x36655a){var _0x5c3bbc=[_0x374f('0x52'),_0x374f('0x53'),_0x374f('0x54'),'subcategory',_0x374f('0x55'),_0x374f('0x56'),'incident_state',_0x374f('0x57'),_0x374f('0x58')];var _0x13854d=[_0x374f('0x59'),'made_sla',_0x374f('0x5a'),_0x374f('0x5b'),_0x374f('0x5c'),'sys_updated_on',_0x374f('0x5d'),_0x374f('0x53'),'approval_history',_0x374f('0x5e'),_0x374f('0x5f'),'sys_updated_by',_0x374f('0x60'),_0x374f('0x61'),_0x374f('0x62'),_0x374f('0x63'),_0x374f('0x64'),_0x374f('0x65'),_0x374f('0x54'),_0x374f('0x33'),_0x374f('0x66'),'closed_at',_0x374f('0x67'),'delivery_plan',_0x374f('0x68'),_0x374f('0x69'),'work_notes_list',_0x374f('0x6a'),_0x374f('0x6b'),_0x374f('0x6c'),'rfc',_0x374f('0x6d'),_0x374f('0x6e'),_0x374f('0x6f'),_0x374f('0x70'),_0x374f('0x71'),'work_end',_0x374f('0x72'),'resolved_at',_0x374f('0x73'),_0x374f('0x74'),_0x374f('0x75'),'work_notes',_0x374f('0x76'),_0x374f('0x55'),'correlation_display',_0x374f('0x77'),_0x374f('0x78'),'assignment_group',_0x374f('0x79'),_0x374f('0x7a'),'description','calendar_duration',_0x374f('0x56'),'sys_class_name',_0x374f('0x7b'),_0x374f('0x7c'),_0x374f('0x7d'),_0x374f('0x7e'),_0x374f('0x7f'),_0x374f('0x80'),_0x374f('0x81'),_0x374f('0x82'),_0x374f('0x83'),_0x374f('0x84'),_0x374f('0x85'),_0x374f('0x86'),_0x374f('0x87'),'assigned_to',_0x374f('0x57'),'comments',_0x374f('0x88'),'approval','comments_and_work_notes',_0x374f('0x89'),'sys_mod_count',_0x374f('0x8a'),'sys_tags',_0x374f('0x8b'),'upon_approval','correlation_id',_0x374f('0x8c'),_0x374f('0x58')];var _0xeae61e='';var _0x204709='';var _0x58ce9f=[];var _0xf2263f='';var _0x4aadd6='';var _0x4719a1=[];var _0x2421d8='';var _0x316894='';var _0x9343be={};var _0x24575f='';return db[_0x374f('0x27')][_0x374f('0x48')]({'where':{'id':_0x5d109c[_0x374f('0x3f')]['id']},'attributes':['id','username',_0x374f('0x8d'),_0x374f('0x8e'),'remoteUri',_0x374f('0x8f')]})[_0x374f('0x21')](handleEntityNotFound(_0x3bf3ec,null))[_0x374f('0x21')](function(_0x5bd302){if(_0x5bd302){_0x24575f=_0x5bd302['remoteUri'];var _0x1edd16=_0x24575f[_0x374f('0x90')](-0x1);if(_0x1edd16==='/'){_0x24575f=_0x24575f['substring'](0x0,_0x24575f[_0x374f('0x91')](_0x1edd16));}_0x316894=util['format'](_0x374f('0x92'),_0x24575f);_0x2421d8=util['format'](_0x374f('0x93'),_0x24575f);_0x9343be={'user':_0x5bd302[_0x374f('0x94')],'pass':_0x5bd302[_0x374f('0x8d')]};var _0xad8592={'method':_0x374f('0x95'),'uri':_0x316894+_0x374f('0x96'),'auth':_0x9343be,'json':!![]};return rp(_0xad8592);}})[_0x374f('0x21')](function(_0x24b441){if(_0x24b441[_0x374f('0x97')][_0x374f('0x30')]>0x0){_0xeae61e=_0x24b441[_0x374f('0x97')];}console[_0x374f('0x98')](_0x374f('0x99'),_0xeae61e);_0x4719a1=[];_0x204709=Object[_0x374f('0x9a')]([],_0xeae61e);_[_0x374f('0x9b')](_0x204709,function(_0x2a4fe4){return!_0x5c3bbc['includes'](_0x2a4fe4[_0x374f('0x23')]);});_0x204709[_0x374f('0x9c')](function(_0x175f65){var _0x14d5e1=createFieldObject(_0x2421d8,_0x9343be,_0x175f65['internalType'],_0x175f65[_0x374f('0x23')],_0x175f65[_0x374f('0x9d')],![]);_0x4719a1[_0x374f('0x9e')](_0x14d5e1);});return Promise[_0x374f('0x9f')](_0x4719a1);})['then'](function(_0x1b4d6a){_0x58ce9f=_0x1b4d6a;_0xf2263f=Object[_0x374f('0x9a')]([],_0xeae61e);console[_0x374f('0x98')](_0x374f('0xa0'),_0xeae61e);_[_0x374f('0x9b')](_0xf2263f,function(_0x43c3d4){return _0x13854d['includes'](_0x43c3d4[_0x374f('0x23')]);});console['log'](_0x374f('0xa1'),_0xf2263f);_0x4719a1=[];_0xf2263f[_0x374f('0x9c')](function(_0x19aebf){var _0x6361dd=createFieldObject(_0x2421d8,_0x9343be,_0x19aebf['internalType'],_0x19aebf[_0x374f('0x23')],_0x19aebf[_0x374f('0x9d')],!![]);_0x4719a1[_0x374f('0x9e')](_0x6361dd);});return Promise[_0x374f('0x9f')](_0x4719a1);})[_0x374f('0x21')](function(_0x343f69){_0x4aadd6=_0x343f69;var _0x103e49=_0x58ce9f[_0x374f('0xa2')](_0x4aadd6);return{'count':_0x103e49[_0x374f('0x30')],'rows':_0x103e49};})[_0x374f('0x21')](respondWithResult(_0x3bf3ec,null))['catch'](function(_0x459aee){console['log'](_0x374f('0xa3')+_0x459aee);var _0x7cb3c=_0x5d109c[_0x374f('0x2b')][_0x374f('0xa4')]?0x1f4:_0x459aee[_0x374f('0xa5')]||0x1f4;logger[_0x374f('0x22')](_0x459aee[_0x374f('0xa6')]);delete _0x459aee[_0x374f('0x23')];if(_0x7cb3c===0x191){_0x7cb3c=0x190;}_0x3bf3ec[_0x374f('0x17')](_0x7cb3c)['send'](_0x5d109c[_0x374f('0x2b')]['test']?{'message':_0x374f('0xa7'),'statusCode':_0x459aee[_0x374f('0xa5')]}:_0x459aee);});};function createFieldObject(_0x115952,_0x26a4aa,_0x4e95b9,_0x204aa8,_0x2e04ca,_0xebca45){return new Promise(function(_0x583338,_0x16f746){var _0x3dee78={'id':_0x204aa8,'name':_0x2e04ca,'custom':_0xebca45};if(_0x4e95b9==='boolean'){_0x3dee78['options']=[{'name':_0x374f('0xa8'),'value':_0x374f('0xa9')},{'name':'False','value':_0x374f('0xaa')}];_0x583338(_0x3dee78);}else{var _0x5d66e4={'method':_0x374f('0x95'),'uri':_0x115952+_0x374f('0xab')+_0x204aa8,'auth':_0x26a4aa,'json':!![]};return rp(_0x5d66e4)[_0x374f('0x21')](function(_0x554a6a){var _0x5bace3=[];if(_0x554a6a[_0x374f('0x97')][_0x374f('0x30')]>0x0){_0x554a6a[_0x374f('0x97')][_0x374f('0x9c')](function(_0x5ee244){if(_0x5ee244[_0x374f('0xac')]==='false'){var _0x3b58d4={'name':_0x5ee244[_0x374f('0x9d')],'value':_0x5ee244[_0x374f('0xad')]};_0x5bace3['push'](_0x3b58d4);}});}_0x3dee78[_0x374f('0x42')]=_0x5bace3;if(_0x3dee78[_0x374f('0x42')]['length']>0x0){_0x583338(_0x3dee78);}else{if(_0xebca45==![]){_0x583338();}else{_0x583338(_0x3dee78);}}});}});}
\ No newline at end of file
index 9586ae6..bf07d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x4e46fd,_0x5993bb){var _0x4dc5cf=function(_0xb9c857){while(--_0xb9c857){_0x4e46fd['push'](_0x4e46fd['shift']());}};_0x4dc5cf(++_0x5993bb);}(_0x5fab,0x177));var _0xb5fa=function(_0x20ebb9,_0x3535bb){_0x20ebb9=_0x20ebb9-0x0;var _0x1ec31d=_0x5fab[_0x20ebb9];return _0x1ec31d;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2bd8=['bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0x544c8e,_0x45b8cf){var _0xbf8baa=function(_0x44e20a){while(--_0x44e20a){_0x544c8e['push'](_0x544c8e['shift']());}};_0xbf8baa(++_0x45b8cf);}(_0x2bd8,0x130));var _0x82bd=function(_0x16c622,_0x5d7b6d){_0x16c622=_0x16c622-0x0;var _0x83bd85=_0x2bd8[_0x16c622];return _0x83bd85;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));var integrations=require(_0x82bd('0x9'));module[_0x82bd('0xa')]=function(_0x5ceb60,_0x19dbb1){return _0x5ceb60[_0x82bd('0xb')](_0x82bd('0xc'),attributes,{'tableName':_0x82bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fac9d08..0c30cd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb69d=['message','GetServicenowAccount','options','raw','where','attributes','include','model','map','catch','ShowServicenowAccount','ServicenowAccount','stringify','util','moment','randomstring','ioredis','../../mysqldb','http','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','ServicenowAccount,\x20%s,\x20%s'];(function(_0x544490,_0x31c10d){var _0x126307=function(_0x18e068){while(--_0x18e068){_0x544490['push'](_0x544490['shift']());}};_0x126307(++_0x31c10d);}(_0xb69d,0x15f));var _0xdb69=function(_0x28cdfd,_0x2c81fe){_0x28cdfd=_0x28cdfd-0x0;var _0x143f2f=_0xb69d[_0x28cdfd];return _0x143f2f;};'use strict';var _=require('lodash');var util=require(_0xdb69('0x0'));var moment=require(_0xdb69('0x1'));var BPromise=require('bluebird');var rs=require(_0xdb69('0x2'));var fs=require('fs');var Redis=require(_0xdb69('0x3'));var db=require(_0xdb69('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdb69('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2d0ce2,_0x29d0a2,_0x32020f){return new BPromise(function(_0x12af13,_0x2fef48){return client['request'](_0x2d0ce2,_0x32020f)[_0xdb69('0x6')](function(_0x5426f7){logger[_0xdb69('0x7')]('ServicenowAccount,\x20%s,\x20%s',_0x29d0a2,_0xdb69('0x8'));logger[_0xdb69('0x9')](_0xdb69('0xa'),_0x29d0a2,_0xdb69('0x8'),JSON['stringify'](_0x5426f7));if(_0x5426f7['error']){if(_0x5426f7['error']['code']===0x1f4){logger[_0xdb69('0xb')](_0xdb69('0xc'),_0x29d0a2,_0x5426f7[_0xdb69('0xb')]['message']);return _0x2fef48(_0x5426f7[_0xdb69('0xb')][_0xdb69('0xd')]);}logger[_0xdb69('0xb')](_0xdb69('0xc'),_0x29d0a2,_0x5426f7[_0xdb69('0xb')]['message']);return _0x12af13(_0x5426f7['error'][_0xdb69('0xd')]);}else{logger[_0xdb69('0x7')](_0xdb69('0xc'),_0x29d0a2,_0xdb69('0x8'));_0x12af13(_0x5426f7['result']['message']);}})['catch'](function(_0x1d7613){logger[_0xdb69('0xb')](_0xdb69('0xc'),_0x29d0a2,_0x1d7613);_0x2fef48(_0x1d7613);});});}exports[_0xdb69('0xe')]=function(_0x11b79b){var _0x3eef18=this;return new Promise(function(_0x2a2675,_0x1ab78a){return db['ServicenowAccount']['findAll']({'raw':_0x11b79b['options']?_0x11b79b[_0xdb69('0xf')][_0xdb69('0x10')]===undefined?!![]:![]:!![],'where':_0x11b79b['options']?_0x11b79b[_0xdb69('0xf')][_0xdb69('0x11')]||null:null,'attributes':_0x11b79b[_0xdb69('0xf')]?_0x11b79b[_0xdb69('0xf')][_0xdb69('0x12')]||null:null,'limit':_0x11b79b['options']?_0x11b79b[_0xdb69('0xf')]['limit']||null:null,'include':_0x11b79b['options']?_0x11b79b['options'][_0xdb69('0x13')]?_['map'](_0x11b79b[_0xdb69('0xf')][_0xdb69('0x13')],function(_0x2bdacd){return{'model':db[_0x2bdacd[_0xdb69('0x14')]],'as':_0x2bdacd['as'],'attributes':_0x2bdacd['attributes'],'include':_0x2bdacd[_0xdb69('0x13')]?_['map'](_0x2bdacd[_0xdb69('0x13')],function(_0x4e5846){return{'model':db[_0x4e5846[_0xdb69('0x14')]],'as':_0x4e5846['as'],'attributes':_0x4e5846[_0xdb69('0x12')],'include':_0x4e5846['include']?_[_0xdb69('0x15')](_0x4e5846['include'],function(_0x233c22){return{'model':db[_0x233c22[_0xdb69('0x14')]],'as':_0x233c22['as'],'attributes':_0x233c22[_0xdb69('0x12')]};}):[]};}):[]};}):[]:[]})[_0xdb69('0x6')](function(_0x11007d){logger[_0xdb69('0x7')](_0xdb69('0xe'),_0x11b79b);logger[_0xdb69('0x9')](_0xdb69('0xe'),_0x11b79b,JSON['stringify'](_0x11007d));_0x2a2675(_0x11007d);})[_0xdb69('0x16')](function(_0x12efa9){logger['error']('GetServicenowAccount',_0x12efa9[_0xdb69('0xd')],_0x11b79b);_0x1ab78a(_0x3eef18['error'](0x1f4,_0x12efa9['message']));});});};exports[_0xdb69('0x17')]=function(_0x35fd32){var _0x370816=this;return new Promise(function(_0x19657d,_0x350b7b){return db[_0xdb69('0x18')]['find']({'raw':_0x35fd32['options']?_0x35fd32[_0xdb69('0xf')][_0xdb69('0x10')]===undefined?!![]:![]:!![],'where':_0x35fd32['options']?_0x35fd32[_0xdb69('0xf')][_0xdb69('0x11')]||null:null,'attributes':_0x35fd32['options']?_0x35fd32[_0xdb69('0xf')][_0xdb69('0x12')]||null:null,'include':_0x35fd32['options']?_0x35fd32[_0xdb69('0xf')][_0xdb69('0x13')]?_['map'](_0x35fd32[_0xdb69('0xf')][_0xdb69('0x13')],function(_0x3ff174){return{'model':db[_0x3ff174[_0xdb69('0x14')]],'as':_0x3ff174['as'],'attributes':_0x3ff174[_0xdb69('0x12')],'include':_0x3ff174[_0xdb69('0x13')]?_[_0xdb69('0x15')](_0x3ff174['include'],function(_0x18fc85){return{'model':db[_0x18fc85['model']],'as':_0x18fc85['as'],'attributes':_0x18fc85['attributes'],'include':_0x18fc85['include']?_[_0xdb69('0x15')](_0x18fc85[_0xdb69('0x13')],function(_0x1e71c8){return{'model':db[_0x1e71c8[_0xdb69('0x14')]],'as':_0x1e71c8['as'],'attributes':_0x1e71c8[_0xdb69('0x12')]};}):[]};}):[]};}):[]:[]})[_0xdb69('0x6')](function(_0x155db6){logger['info'](_0xdb69('0x17'),_0x35fd32);logger[_0xdb69('0x9')](_0xdb69('0x17'),_0x35fd32,JSON[_0xdb69('0x19')](_0x155db6));_0x19657d(_0x155db6);})[_0xdb69('0x16')](function(_0x3e893d){logger[_0xdb69('0xb')]('ShowServicenowAccount',_0x3e893d[_0xdb69('0xd')],_0x35fd32);_0x350b7b(_0x370816[_0xdb69('0xb')](0x1f4,_0x3e893d[_0xdb69('0xd')]));});});};
\ No newline at end of file
+var _0x5c81=['GetServicenowAccount','ServicenowAccount','findAll','options','attributes','limit','include','map','model','debug','ShowServicenowAccount','where','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch'];(function(_0x2cfb22,_0x3d6102){var _0x387b93=function(_0x10dc28){while(--_0x10dc28){_0x2cfb22['push'](_0x2cfb22['shift']());}};_0x387b93(++_0x3d6102);}(_0x5c81,0x104));var _0x15c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5c81[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x15c8('0x0'));var moment=require('moment');var BPromise=require(_0x15c8('0x1'));var rs=require(_0x15c8('0x2'));var fs=require('fs');var Redis=require(_0x15c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x15c8('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x15c8('0x5'));var client=jayson[_0x15c8('0x6')][_0x15c8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16acb1,_0x5393f4,_0x30e464){return new BPromise(function(_0x325349,_0x4f147a){return client['request'](_0x16acb1,_0x30e464)[_0x15c8('0x8')](function(_0x3cc43f){logger[_0x15c8('0x9')]('ServicenowAccount,\x20%s,\x20%s',_0x5393f4,_0x15c8('0xa'));logger['debug'](_0x15c8('0xb'),_0x5393f4,_0x15c8('0xa'),JSON[_0x15c8('0xc')](_0x3cc43f));if(_0x3cc43f[_0x15c8('0xd')]){if(_0x3cc43f[_0x15c8('0xd')][_0x15c8('0xe')]===0x1f4){logger[_0x15c8('0xd')](_0x15c8('0xf'),_0x5393f4,_0x3cc43f[_0x15c8('0xd')][_0x15c8('0x10')]);return _0x4f147a(_0x3cc43f[_0x15c8('0xd')][_0x15c8('0x10')]);}logger[_0x15c8('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x5393f4,_0x3cc43f[_0x15c8('0xd')][_0x15c8('0x10')]);return _0x325349(_0x3cc43f[_0x15c8('0xd')]['message']);}else{logger[_0x15c8('0x9')](_0x15c8('0xf'),_0x5393f4,'request\x20sent');_0x325349(_0x3cc43f[_0x15c8('0x11')][_0x15c8('0x10')]);}})[_0x15c8('0x12')](function(_0x1e386e){logger['error'](_0x15c8('0xf'),_0x5393f4,_0x1e386e);_0x4f147a(_0x1e386e);});});}exports[_0x15c8('0x13')]=function(_0x4f8585){var _0x5be4ba=this;return new Promise(function(_0x345578,_0x42f189){return db[_0x15c8('0x14')][_0x15c8('0x15')]({'raw':_0x4f8585[_0x15c8('0x16')]?_0x4f8585['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f8585['options']?_0x4f8585[_0x15c8('0x16')]['where']||null:null,'attributes':_0x4f8585[_0x15c8('0x16')]?_0x4f8585[_0x15c8('0x16')][_0x15c8('0x17')]||null:null,'limit':_0x4f8585['options']?_0x4f8585[_0x15c8('0x16')][_0x15c8('0x18')]||null:null,'include':_0x4f8585[_0x15c8('0x16')]?_0x4f8585[_0x15c8('0x16')][_0x15c8('0x19')]?_[_0x15c8('0x1a')](_0x4f8585[_0x15c8('0x16')]['include'],function(_0x565353){return{'model':db[_0x565353[_0x15c8('0x1b')]],'as':_0x565353['as'],'attributes':_0x565353[_0x15c8('0x17')],'include':_0x565353['include']?_[_0x15c8('0x1a')](_0x565353[_0x15c8('0x19')],function(_0xad3d51){return{'model':db[_0xad3d51[_0x15c8('0x1b')]],'as':_0xad3d51['as'],'attributes':_0xad3d51[_0x15c8('0x17')],'include':_0xad3d51[_0x15c8('0x19')]?_['map'](_0xad3d51[_0x15c8('0x19')],function(_0x25c44c){return{'model':db[_0x25c44c[_0x15c8('0x1b')]],'as':_0x25c44c['as'],'attributes':_0x25c44c[_0x15c8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x15c8('0x8')](function(_0x53cc16){logger[_0x15c8('0x9')](_0x15c8('0x13'),_0x4f8585);logger[_0x15c8('0x1c')](_0x15c8('0x13'),_0x4f8585,JSON[_0x15c8('0xc')](_0x53cc16));_0x345578(_0x53cc16);})[_0x15c8('0x12')](function(_0x569103){logger['error'](_0x15c8('0x13'),_0x569103[_0x15c8('0x10')],_0x4f8585);_0x42f189(_0x5be4ba[_0x15c8('0xd')](0x1f4,_0x569103['message']));});});};exports[_0x15c8('0x1d')]=function(_0x1d6fdb){var _0x1407f7=this;return new Promise(function(_0x45964c,_0x1ea575){return db['ServicenowAccount']['find']({'raw':_0x1d6fdb[_0x15c8('0x16')]?_0x1d6fdb[_0x15c8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d6fdb[_0x15c8('0x16')]?_0x1d6fdb[_0x15c8('0x16')][_0x15c8('0x1e')]||null:null,'attributes':_0x1d6fdb[_0x15c8('0x16')]?_0x1d6fdb[_0x15c8('0x16')]['attributes']||null:null,'include':_0x1d6fdb[_0x15c8('0x16')]?_0x1d6fdb[_0x15c8('0x16')][_0x15c8('0x19')]?_[_0x15c8('0x1a')](_0x1d6fdb[_0x15c8('0x16')][_0x15c8('0x19')],function(_0x231ce0){return{'model':db[_0x231ce0[_0x15c8('0x1b')]],'as':_0x231ce0['as'],'attributes':_0x231ce0[_0x15c8('0x17')],'include':_0x231ce0[_0x15c8('0x19')]?_[_0x15c8('0x1a')](_0x231ce0[_0x15c8('0x19')],function(_0x4a942b){return{'model':db[_0x4a942b[_0x15c8('0x1b')]],'as':_0x4a942b['as'],'attributes':_0x4a942b[_0x15c8('0x17')],'include':_0x4a942b[_0x15c8('0x19')]?_['map'](_0x4a942b[_0x15c8('0x19')],function(_0x51dde7){return{'model':db[_0x51dde7[_0x15c8('0x1b')]],'as':_0x51dde7['as'],'attributes':_0x51dde7[_0x15c8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x15c8('0x8')](function(_0x425a87){logger[_0x15c8('0x9')](_0x15c8('0x1d'),_0x1d6fdb);logger[_0x15c8('0x1c')](_0x15c8('0x1d'),_0x1d6fdb,JSON[_0x15c8('0xc')](_0x425a87));_0x45964c(_0x425a87);})[_0x15c8('0x12')](function(_0x307d42){logger['error'](_0x15c8('0x1d'),_0x307d42['message'],_0x1d6fdb);_0x1ea575(_0x1407f7[_0x15c8('0xd')](0x1f4,_0x307d42[_0x15c8('0x10')]));});});};
\ No newline at end of file
index c39a962..b3a4f91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14aa=['/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','create','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x14aa,0x74));var _0xa14a=function(_0x5630d8,_0x5e6a72){_0x5630d8=_0x5630d8-0x0;var _0x208aec=_0x14aa[_0x5630d8];return _0x208aec;};'use strict';var multer=require('multer');var util=require(_0xa14a('0x0'));var path=require(_0xa14a('0x1'));var timeout=require(_0xa14a('0x2'));var express=require('express');var router=express[_0xa14a('0x3')]();var fs_extra=require(_0xa14a('0x4'));var auth=require(_0xa14a('0x5'));var interaction=require(_0xa14a('0x6'));var config=require(_0xa14a('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xa14a('0x8')]('/',auth['isAuthenticated'](),controller[_0xa14a('0x9')]);router[_0xa14a('0x8')](_0xa14a('0xa'),auth[_0xa14a('0xb')](),controller['show']);router[_0xa14a('0x8')](_0xa14a('0xc'),auth[_0xa14a('0xb')](),controller[_0xa14a('0xd')]);router[_0xa14a('0x8')](_0xa14a('0xe'),auth[_0xa14a('0xb')](),controller['getSubjects']);router['get'](_0xa14a('0xf'),auth[_0xa14a('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0xa14a('0xb')](),controller[_0xa14a('0x10')]);router['put'](_0xa14a('0xa'),auth[_0xa14a('0xb')](),controller['update']);router['delete'](_0xa14a('0xa'),auth[_0xa14a('0xb')](),controller['destroy']);module[_0xa14a('0x11')]=router;
\ No newline at end of file
+var _0x5ddd=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ddd,0x101));var _0xd5dd=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0x5ddd[_0x4db46b];return _0x565be8;};'use strict';var multer=require(_0xd5dd('0x0'));var util=require('util');var path=require(_0xd5dd('0x1'));var timeout=require(_0xd5dd('0x2'));var express=require(_0xd5dd('0x3'));var router=express[_0xd5dd('0x4')]();var fs_extra=require(_0xd5dd('0x5'));var auth=require(_0xd5dd('0x6'));var interaction=require(_0xd5dd('0x7'));var config=require(_0xd5dd('0x8'));var controller=require(_0xd5dd('0x9'));router[_0xd5dd('0xa')]('/',auth[_0xd5dd('0xb')](),controller[_0xd5dd('0xc')]);router[_0xd5dd('0xa')](_0xd5dd('0xd'),auth[_0xd5dd('0xb')](),controller[_0xd5dd('0xe')]);router[_0xd5dd('0xa')](_0xd5dd('0xf'),auth[_0xd5dd('0xb')](),controller[_0xd5dd('0x10')]);router['get'](_0xd5dd('0x11'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xd5dd('0xa')](_0xd5dd('0x12'),auth[_0xd5dd('0xb')](),controller[_0xd5dd('0x13')]);router['post']('/',auth[_0xd5dd('0xb')](),controller['create']);router['put'](_0xd5dd('0xd'),auth[_0xd5dd('0xb')](),controller['update']);router['delete'](_0xd5dd('0xd'),auth['isAuthenticated'](),controller[_0xd5dd('0x14')]);module['exports']=router;
\ No newline at end of file
index 2ac51f6..068baf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4162=['exports','STRING','sequelize'];(function(_0x3448f6,_0x2b21e5){var _0x562390=function(_0x36a55c){while(--_0x36a55c){_0x3448f6['push'](_0x3448f6['shift']());}};_0x562390(++_0x2b21e5);}(_0x4162,0x95));var _0x2416=function(_0x4a6b57,_0x261d94){_0x4a6b57=_0x4a6b57-0x0;var _0x3a98da=_0x4162[_0x4a6b57];return _0x3a98da;};'use strict';var Sequelize=require(_0x2416('0x0'));module[_0x2416('0x1')]={'name':{'type':Sequelize[_0x2416('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x07d8=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07d8,0x122));var _0x807d=function(_0xecb5e3,_0x37fbc8){_0xecb5e3=_0xecb5e3-0x0;var _0x2f41d9=_0x07d8[_0xecb5e3];return _0x2f41d9;};'use strict';var Sequelize=require('sequelize');module[_0x807d('0x0')]={'name':{'type':Sequelize[_0x807d('0x1')]},'description':{'type':Sequelize[_0x807d('0x1')]}};
\ No newline at end of file
index 4e2ac57..4010be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbafb=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/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','save','then','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','merge','find','catch','create','body','destroy','getFields','findOne','ServicenowField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x4a266c,_0x1e7b29){var _0x430feb=function(_0x4042ac){while(--_0x4042ac){_0x4a266c['push'](_0x4a266c['shift']());}};_0x430feb(++_0x1e7b29);}(_0xbafb,0x1ab));var _0xbbaf=function(_0x2e8166,_0x35f0b8){_0x2e8166=_0x2e8166-0x0;var _0x4cb1c2=_0xbafb[_0x2e8166];return _0x4cb1c2;};'use strict';var emlformat=require(_0xbbaf('0x0'));var rimraf=require(_0xbbaf('0x1'));var zipdir=require(_0xbbaf('0x2'));var jsonpatch=require(_0xbbaf('0x3'));var rp=require(_0xbbaf('0x4'));var moment=require(_0xbbaf('0x5'));var BPromise=require(_0xbbaf('0x6'));var Mustache=require(_0xbbaf('0x7'));var util=require(_0xbbaf('0x8'));var path=require(_0xbbaf('0x9'));var sox=require(_0xbbaf('0xa'));var csv=require(_0xbbaf('0xb'));var ejs=require(_0xbbaf('0xc'));var fs=require('fs');var fs_extra=require(_0xbbaf('0xd'));var _=require(_0xbbaf('0xe'));var squel=require(_0xbbaf('0xf'));var crypto=require(_0xbbaf('0x10'));var jsforce=require(_0xbbaf('0x11'));var deskjs=require(_0xbbaf('0x12'));var toCsv=require(_0xbbaf('0xb'));var querystring=require(_0xbbaf('0x13'));var Papa=require(_0xbbaf('0x14'));var Redis=require(_0xbbaf('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xbbaf('0x16'));var as=require(_0xbbaf('0x17'));var hardwareService=require(_0xbbaf('0x18'));var logger=require(_0xbbaf('0x19'))(_0xbbaf('0x1a'));var utils=require(_0xbbaf('0x1b'));var config=require(_0xbbaf('0x1c'));var licenseUtil=require(_0xbbaf('0x1d'));var db=require(_0xbbaf('0x1e'))['db'];function respondWithStatusCode(_0x134bbb,_0x2f80cc){_0x2f80cc=_0x2f80cc||0xcc;return function(_0x22e1d7){if(_0x22e1d7){return _0x134bbb[_0xbbaf('0x1f')](_0x2f80cc);}return _0x134bbb[_0xbbaf('0x20')](_0x2f80cc)[_0xbbaf('0x21')]();};}function respondWithResult(_0x2202af,_0x1011c4){_0x1011c4=_0x1011c4||0xc8;return function(_0xc20a98){if(_0xc20a98){return _0x2202af[_0xbbaf('0x20')](_0x1011c4)[_0xbbaf('0x22')](_0xc20a98);}};}function respondWithFilteredResult(_0x5c93ed,_0x9bb38d){return function(_0x100d01){if(_0x100d01){var _0x5d07cd=typeof _0x9bb38d[_0xbbaf('0x23')]===_0xbbaf('0x24')&&typeof _0x9bb38d[_0xbbaf('0x25')]===_0xbbaf('0x24');var _0x1f6a0e=_0x100d01[_0xbbaf('0x26')];var _0x584d1f=_0x5d07cd?0x0:_0x9bb38d['offset'];var _0x301d84=_0x5d07cd?_0x100d01['count']:_0x9bb38d[_0xbbaf('0x23')]+_0x9bb38d[_0xbbaf('0x25')];var _0x9e21a3;if(_0x301d84>=_0x1f6a0e){_0x301d84=_0x1f6a0e;_0x9e21a3=0xc8;}else{_0x9e21a3=0xce;}_0x5c93ed['status'](_0x9e21a3);return _0x5c93ed['set'](_0xbbaf('0x27'),_0x584d1f+'-'+_0x301d84+'/'+_0x1f6a0e)['json'](_0x100d01);}return null;};}function patchUpdates(_0x3a65a9){return function(_0x51346e){try{jsonpatch[_0xbbaf('0x28')](_0x51346e,_0x3a65a9,!![]);}catch(_0x3beb5f){return BPromise['reject'](_0x3beb5f);}return _0x51346e[_0xbbaf('0x29')]();};}function saveUpdates(_0x5079ef,_0x21463d){return function(_0x5efe1c){if(_0x5efe1c){return _0x5efe1c['update'](_0x5079ef)['then'](function(_0x259753){return _0x259753;});}return null;};}function removeEntity(_0x59542a,_0x30d8d9){return function(_0x2d65ae){if(_0x2d65ae){return _0x2d65ae['destroy']()[_0xbbaf('0x2a')](function(){_0x59542a[_0xbbaf('0x20')](0xcc)[_0xbbaf('0x21')]();});}};}function handleEntityNotFound(_0x1249ea,_0x3c707d){return function(_0x3e70c9){if(!_0x3e70c9){_0x1249ea[_0xbbaf('0x1f')](0x194);}return _0x3e70c9;};}function handleError(_0x20efd6,_0x11e9ff){_0x11e9ff=_0x11e9ff||0x1f4;return function(_0x265d3f){logger['error'](_0x265d3f[_0xbbaf('0x2b')]);if(_0x265d3f[_0xbbaf('0x2c')]){delete _0x265d3f[_0xbbaf('0x2c')];}_0x20efd6[_0xbbaf('0x20')](_0x11e9ff)[_0xbbaf('0x2d')](_0x265d3f);};}exports[_0xbbaf('0x2e')]=function(_0x4f2217,_0x448016){var _0x19b8be={},_0x21a8af={},_0x253d41={'count':0x0,'rows':[]};var _0x31fb5d=_[_0xbbaf('0x2f')](db[_0xbbaf('0x30')][_0xbbaf('0x31')],function(_0x27ef85){return{'name':_0x27ef85['fieldName'],'type':_0x27ef85[_0xbbaf('0x32')][_0xbbaf('0x33')]};});_0x21a8af[_0xbbaf('0x34')]=_[_0xbbaf('0x2f')](_0x31fb5d,_0xbbaf('0x2c'));_0x21a8af[_0xbbaf('0x35')]=_['keys'](_0x4f2217[_0xbbaf('0x35')]);_0x21a8af[_0xbbaf('0x36')]=_[_0xbbaf('0x37')](_0x21a8af[_0xbbaf('0x34')],_0x21a8af[_0xbbaf('0x35')]);_0x19b8be[_0xbbaf('0x38')]=_['intersection'](_0x21a8af[_0xbbaf('0x34')],qs[_0xbbaf('0x39')](_0x4f2217['query'][_0xbbaf('0x39')]));_0x19b8be[_0xbbaf('0x38')]=_0x19b8be[_0xbbaf('0x38')][_0xbbaf('0x3a')]?_0x19b8be[_0xbbaf('0x38')]:_0x21a8af[_0xbbaf('0x34')];if(!_0x4f2217[_0xbbaf('0x35')][_0xbbaf('0x3b')]('nolimit')){_0x19b8be[_0xbbaf('0x25')]=qs[_0xbbaf('0x25')](_0x4f2217[_0xbbaf('0x35')][_0xbbaf('0x25')]);_0x19b8be[_0xbbaf('0x23')]=qs[_0xbbaf('0x23')](_0x4f2217[_0xbbaf('0x35')]['offset']);}_0x19b8be[_0xbbaf('0x3c')]=qs[_0xbbaf('0x3d')](_0x4f2217[_0xbbaf('0x35')][_0xbbaf('0x3d')]);_0x19b8be['where']=qs[_0xbbaf('0x36')](_[_0xbbaf('0x3e')](_0x4f2217[_0xbbaf('0x35')],_0x21a8af[_0xbbaf('0x36')]),_0x31fb5d);if(_0x4f2217[_0xbbaf('0x35')][_0xbbaf('0x3f')]){_0x19b8be['where']=_['merge'](_0x19b8be[_0xbbaf('0x40')],{'$or':_[_0xbbaf('0x2f')](_0x31fb5d,function(_0x2b9a5d){if(_0x2b9a5d[_0xbbaf('0x32')]!==_0xbbaf('0x41')){var _0x56c99b={};_0x56c99b[_0x2b9a5d['name']]={'$like':'%'+_0x4f2217[_0xbbaf('0x35')][_0xbbaf('0x3f')]+'%'};return _0x56c99b;}})});}_0x19b8be=_['merge']({},_0x19b8be,_0x4f2217[_0xbbaf('0x42')]);var _0x397793={'where':_0x19b8be[_0xbbaf('0x40')]};return db['ServicenowConfiguration']['count'](_0x397793)[_0xbbaf('0x2a')](function(_0x5cd2fb){_0x253d41[_0xbbaf('0x26')]=_0x5cd2fb;if(_0x4f2217[_0xbbaf('0x35')][_0xbbaf('0x43')]){_0x19b8be['include']=[{'all':!![]}];}return db[_0xbbaf('0x30')][_0xbbaf('0x44')](_0x19b8be);})['then'](function(_0x17857c){_0x253d41[_0xbbaf('0x45')]=_0x17857c;return _0x253d41;})[_0xbbaf('0x2a')](respondWithFilteredResult(_0x448016,_0x19b8be))['catch'](handleError(_0x448016,null));};exports[_0xbbaf('0x46')]=function(_0x1709be,_0x4b490f){var _0x3569c9={'raw':![],'where':{'id':_0x1709be[_0xbbaf('0x47')]['id']}},_0x58a7d5={};_0x58a7d5[_0xbbaf('0x34')]=_[_0xbbaf('0x48')](db['ServicenowConfiguration'][_0xbbaf('0x31')]);_0x58a7d5[_0xbbaf('0x35')]=_[_0xbbaf('0x48')](_0x1709be['query']);_0x58a7d5[_0xbbaf('0x36')]=_[_0xbbaf('0x37')](_0x58a7d5[_0xbbaf('0x34')],_0x58a7d5[_0xbbaf('0x35')]);_0x3569c9['attributes']=_[_0xbbaf('0x37')](_0x58a7d5[_0xbbaf('0x34')],qs[_0xbbaf('0x39')](_0x1709be[_0xbbaf('0x35')][_0xbbaf('0x39')]));_0x3569c9['attributes']=_0x3569c9[_0xbbaf('0x38')]['length']?_0x3569c9['attributes']:_0x58a7d5[_0xbbaf('0x34')];if(_0x1709be['query']['includeAll']){_0x3569c9[_0xbbaf('0x49')]=[{'all':!![]}];}_0x3569c9=_[_0xbbaf('0x4a')]({},_0x3569c9,_0x1709be[_0xbbaf('0x42')]);return db[_0xbbaf('0x30')][_0xbbaf('0x4b')](_0x3569c9)[_0xbbaf('0x2a')](handleEntityNotFound(_0x4b490f,null))[_0xbbaf('0x2a')](respondWithResult(_0x4b490f,null))[_0xbbaf('0x4c')](handleError(_0x4b490f,null));};exports[_0xbbaf('0x4d')]=function(_0x3424df,_0x508b1f){return db[_0xbbaf('0x30')][_0xbbaf('0x4d')](_0x3424df[_0xbbaf('0x4e')],{})[_0xbbaf('0x2a')](respondWithResult(_0x508b1f,0xc9))['catch'](handleError(_0x508b1f,null));};exports['update']=function(_0xed736a,_0x4de496){if(_0xed736a[_0xbbaf('0x4e')]['id']){delete _0xed736a[_0xbbaf('0x4e')]['id'];}return db[_0xbbaf('0x30')]['find']({'where':{'id':_0xed736a['params']['id']}})[_0xbbaf('0x2a')](handleEntityNotFound(_0x4de496,null))['then'](saveUpdates(_0xed736a[_0xbbaf('0x4e')],null))['then'](respondWithResult(_0x4de496,null))['catch'](handleError(_0x4de496,null));};exports[_0xbbaf('0x4f')]=function(_0x3a20d6,_0x3ec1c9){return db[_0xbbaf('0x30')][_0xbbaf('0x4b')]({'where':{'id':_0x3a20d6[_0xbbaf('0x47')]['id']}})[_0xbbaf('0x2a')](handleEntityNotFound(_0x3ec1c9,null))['then'](removeEntity(_0x3ec1c9,null))[_0xbbaf('0x4c')](handleError(_0x3ec1c9,null));};exports[_0xbbaf('0x50')]=function(_0x25eac7,_0x43d687,_0x5d713f){var _0x449526={};var _0x2aa2ee={};var _0x4d3e53;var _0x53fe5f;return db['ServicenowConfiguration'][_0xbbaf('0x51')]({'where':{'id':_0x25eac7[_0xbbaf('0x47')]['id']}})[_0xbbaf('0x2a')](handleEntityNotFound(_0x43d687,null))[_0xbbaf('0x2a')](function(_0x7aa059){if(_0x7aa059){_0x4d3e53=_0x7aa059;_0x2aa2ee[_0xbbaf('0x34')]=_[_0xbbaf('0x48')](db[_0xbbaf('0x52')][_0xbbaf('0x31')]);_0x2aa2ee[_0xbbaf('0x35')]=_[_0xbbaf('0x48')](_0x25eac7[_0xbbaf('0x35')]);_0x2aa2ee[_0xbbaf('0x36')]=_[_0xbbaf('0x37')](_0x2aa2ee[_0xbbaf('0x34')],_0x2aa2ee[_0xbbaf('0x35')]);_0x449526[_0xbbaf('0x38')]=_[_0xbbaf('0x37')](_0x2aa2ee[_0xbbaf('0x34')],qs['fields'](_0x25eac7[_0xbbaf('0x35')][_0xbbaf('0x39')]));_0x449526[_0xbbaf('0x38')]=_0x449526[_0xbbaf('0x38')][_0xbbaf('0x3a')]?_0x449526[_0xbbaf('0x38')]:_0x2aa2ee[_0xbbaf('0x34')];_0x449526['order']=qs['sort'](_0x25eac7[_0xbbaf('0x35')][_0xbbaf('0x3d')]);_0x449526[_0xbbaf('0x40')]=qs[_0xbbaf('0x36')](_[_0xbbaf('0x3e')](_0x25eac7[_0xbbaf('0x35')],_0x2aa2ee['filters']));if(_0x25eac7[_0xbbaf('0x35')][_0xbbaf('0x3f')]){_0x449526[_0xbbaf('0x40')]=_[_0xbbaf('0x4a')](_0x449526[_0xbbaf('0x40')],{'$or':_[_0xbbaf('0x2f')](_0x449526['attributes'],function(_0x370f48){var _0x256bf3={};_0x256bf3[_0x370f48]={'$like':'%'+_0x25eac7[_0xbbaf('0x35')]['filter']+'%'};return _0x256bf3;})});}_0x449526=_['merge']({},_0x449526,_0x25eac7['options']);return _0x4d3e53[_0xbbaf('0x50')](_0x449526);}})[_0xbbaf('0x2a')](function(_0x5be407){if(_0x5be407){_0x53fe5f=_0x5be407[_0xbbaf('0x3a')];if(!_0x25eac7[_0xbbaf('0x35')][_0xbbaf('0x3b')]('nolimit')){_0x449526['limit']=qs[_0xbbaf('0x25')](_0x25eac7[_0xbbaf('0x35')]['limit']);_0x449526['offset']=qs[_0xbbaf('0x23')](_0x25eac7['query']['offset']);}return _0x4d3e53[_0xbbaf('0x50')](_0x449526);}})[_0xbbaf('0x2a')](function(_0x37b3c3){if(_0x37b3c3){return _0x37b3c3?{'count':_0x53fe5f,'rows':_0x37b3c3}:null;}})[_0xbbaf('0x2a')](respondWithResult(_0x43d687,null))[_0xbbaf('0x4c')](handleError(_0x43d687,null));};exports[_0xbbaf('0x53')]=function(_0x33a8cf,_0x5421b7,_0x18c7bc){var _0x4ba723={};var _0x2a78ca={};var _0x1271a6;var _0x43e660;return db[_0xbbaf('0x30')][_0xbbaf('0x51')]({'where':{'id':_0x33a8cf[_0xbbaf('0x47')]['id']}})[_0xbbaf('0x2a')](handleEntityNotFound(_0x5421b7,null))[_0xbbaf('0x2a')](function(_0x26d81d){if(_0x26d81d){_0x1271a6=_0x26d81d;_0x2a78ca['model']=_[_0xbbaf('0x48')](db[_0xbbaf('0x52')][_0xbbaf('0x31')]);_0x2a78ca['query']=_[_0xbbaf('0x48')](_0x33a8cf[_0xbbaf('0x35')]);_0x2a78ca[_0xbbaf('0x36')]=_[_0xbbaf('0x37')](_0x2a78ca['model'],_0x2a78ca[_0xbbaf('0x35')]);_0x4ba723[_0xbbaf('0x38')]=_[_0xbbaf('0x37')](_0x2a78ca['model'],qs[_0xbbaf('0x39')](_0x33a8cf[_0xbbaf('0x35')]['fields']));_0x4ba723['attributes']=_0x4ba723['attributes']['length']?_0x4ba723['attributes']:_0x2a78ca['model'];_0x4ba723[_0xbbaf('0x3c')]=qs[_0xbbaf('0x3d')](_0x33a8cf[_0xbbaf('0x35')][_0xbbaf('0x3d')]);_0x4ba723['where']=qs[_0xbbaf('0x36')](_[_0xbbaf('0x3e')](_0x33a8cf[_0xbbaf('0x35')],_0x2a78ca[_0xbbaf('0x36')]));if(_0x33a8cf[_0xbbaf('0x35')][_0xbbaf('0x3f')]){_0x4ba723[_0xbbaf('0x40')]=_['merge'](_0x4ba723[_0xbbaf('0x40')],{'$or':_[_0xbbaf('0x2f')](_0x4ba723[_0xbbaf('0x38')],function(_0x2f5b76){var _0xc39ce3={};_0xc39ce3[_0x2f5b76]={'$like':'%'+_0x33a8cf[_0xbbaf('0x35')][_0xbbaf('0x3f')]+'%'};return _0xc39ce3;})});}_0x4ba723=_[_0xbbaf('0x4a')]({},_0x4ba723,_0x33a8cf[_0xbbaf('0x42')]);return _0x1271a6[_0xbbaf('0x53')](_0x4ba723);}})[_0xbbaf('0x2a')](function(_0x1a26f6){if(_0x1a26f6){_0x43e660=_0x1a26f6[_0xbbaf('0x3a')];if(!_0x33a8cf[_0xbbaf('0x35')][_0xbbaf('0x3b')](_0xbbaf('0x54'))){_0x4ba723['limit']=qs[_0xbbaf('0x25')](_0x33a8cf['query'][_0xbbaf('0x25')]);_0x4ba723[_0xbbaf('0x23')]=qs[_0xbbaf('0x23')](_0x33a8cf[_0xbbaf('0x35')][_0xbbaf('0x23')]);}return _0x1271a6[_0xbbaf('0x53')](_0x4ba723);}})[_0xbbaf('0x2a')](function(_0x298ea7){if(_0x298ea7){return _0x298ea7?{'count':_0x43e660,'rows':_0x298ea7}:null;}})[_0xbbaf('0x2a')](respondWithResult(_0x5421b7,null))[_0xbbaf('0x4c')](handleError(_0x5421b7,null));};exports[_0xbbaf('0x55')]=function(_0x5ad519,_0x5f0db8,_0x2a42ff){var _0x33868f={};var _0x2f8d49={};var _0x573944;var _0x24480f;return db[_0xbbaf('0x30')][_0xbbaf('0x51')]({'where':{'id':_0x5ad519[_0xbbaf('0x47')]['id']}})[_0xbbaf('0x2a')](handleEntityNotFound(_0x5f0db8,null))[_0xbbaf('0x2a')](function(_0x23e7f5){if(_0x23e7f5){_0x573944=_0x23e7f5;_0x2f8d49[_0xbbaf('0x34')]=_[_0xbbaf('0x48')](db[_0xbbaf('0x52')][_0xbbaf('0x31')]);_0x2f8d49[_0xbbaf('0x35')]=_[_0xbbaf('0x48')](_0x5ad519[_0xbbaf('0x35')]);_0x2f8d49[_0xbbaf('0x36')]=_[_0xbbaf('0x37')](_0x2f8d49[_0xbbaf('0x34')],_0x2f8d49[_0xbbaf('0x35')]);_0x33868f[_0xbbaf('0x38')]=_[_0xbbaf('0x37')](_0x2f8d49[_0xbbaf('0x34')],qs[_0xbbaf('0x39')](_0x5ad519['query'][_0xbbaf('0x39')]));_0x33868f[_0xbbaf('0x38')]=_0x33868f[_0xbbaf('0x38')][_0xbbaf('0x3a')]?_0x33868f[_0xbbaf('0x38')]:_0x2f8d49[_0xbbaf('0x34')];_0x33868f[_0xbbaf('0x3c')]=qs[_0xbbaf('0x3d')](_0x5ad519[_0xbbaf('0x35')][_0xbbaf('0x3d')]);_0x33868f[_0xbbaf('0x40')]=qs[_0xbbaf('0x36')](_['pick'](_0x5ad519[_0xbbaf('0x35')],_0x2f8d49[_0xbbaf('0x36')]));if(_0x5ad519[_0xbbaf('0x35')][_0xbbaf('0x3f')]){_0x33868f[_0xbbaf('0x40')]=_['merge'](_0x33868f[_0xbbaf('0x40')],{'$or':_[_0xbbaf('0x2f')](_0x33868f[_0xbbaf('0x38')],function(_0x574d55){var _0x34ec42={};_0x34ec42[_0x574d55]={'$like':'%'+_0x5ad519[_0xbbaf('0x35')][_0xbbaf('0x3f')]+'%'};return _0x34ec42;})});}_0x33868f=_[_0xbbaf('0x4a')]({},_0x33868f,_0x5ad519[_0xbbaf('0x42')]);return _0x573944[_0xbbaf('0x55')](_0x33868f);}})[_0xbbaf('0x2a')](function(_0x562080){if(_0x562080){_0x24480f=_0x562080[_0xbbaf('0x3a')];if(!_0x5ad519[_0xbbaf('0x35')][_0xbbaf('0x3b')](_0xbbaf('0x54'))){_0x33868f[_0xbbaf('0x25')]=qs[_0xbbaf('0x25')](_0x5ad519[_0xbbaf('0x35')]['limit']);_0x33868f[_0xbbaf('0x23')]=qs['offset'](_0x5ad519[_0xbbaf('0x35')]['offset']);}return _0x573944['getDescriptions'](_0x33868f);}})[_0xbbaf('0x2a')](function(_0x5a55fb){if(_0x5a55fb){return _0x5a55fb?{'count':_0x24480f,'rows':_0x5a55fb}:null;}})[_0xbbaf('0x2a')](respondWithResult(_0x5f0db8,null))[_0xbbaf('0x4c')](handleError(_0x5f0db8,null));};
\ No newline at end of file
+var _0x73ab=['order','sort','where','pick','merge','filter','options','ServicenowConfiguration','includeAll','include','catch','show','params','fields','length','find','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit'];(function(_0x1455e5,_0x732446){var _0x53b75f=function(_0x324236){while(--_0x324236){_0x1455e5['push'](_0x1455e5['shift']());}};_0x53b75f(++_0x732446);}(_0x73ab,0x113));var _0xb73a=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x73ab[_0x3c22e0];return _0x215811;};'use strict';var emlformat=require(_0xb73a('0x0'));var rimraf=require(_0xb73a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb73a('0x2'));var rp=require('request-promise');var moment=require(_0xb73a('0x3'));var BPromise=require(_0xb73a('0x4'));var Mustache=require(_0xb73a('0x5'));var util=require(_0xb73a('0x6'));var path=require(_0xb73a('0x7'));var sox=require(_0xb73a('0x8'));var csv=require(_0xb73a('0x9'));var ejs=require(_0xb73a('0xa'));var fs=require('fs');var fs_extra=require(_0xb73a('0xb'));var _=require(_0xb73a('0xc'));var squel=require(_0xb73a('0xd'));var crypto=require(_0xb73a('0xe'));var jsforce=require(_0xb73a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb73a('0x9'));var querystring=require(_0xb73a('0x10'));var Papa=require(_0xb73a('0x11'));var Redis=require(_0xb73a('0x12'));var authService=require(_0xb73a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb73a('0x14'));var hardwareService=require(_0xb73a('0x15'));var logger=require(_0xb73a('0x16'))(_0xb73a('0x17'));var utils=require(_0xb73a('0x18'));var config=require(_0xb73a('0x19'));var licenseUtil=require(_0xb73a('0x1a'));var db=require(_0xb73a('0x1b'))['db'];function respondWithStatusCode(_0x11f02d,_0x510b57){_0x510b57=_0x510b57||0xcc;return function(_0x5da2dd){if(_0x5da2dd){return _0x11f02d[_0xb73a('0x1c')](_0x510b57);}return _0x11f02d[_0xb73a('0x1d')](_0x510b57)[_0xb73a('0x1e')]();};}function respondWithResult(_0x20fb1f,_0x411ea9){_0x411ea9=_0x411ea9||0xc8;return function(_0xce9c6c){if(_0xce9c6c){return _0x20fb1f[_0xb73a('0x1d')](_0x411ea9)[_0xb73a('0x1f')](_0xce9c6c);}};}function respondWithFilteredResult(_0x4b9dfb,_0x3e62c0){return function(_0x2ff02c){if(_0x2ff02c){var _0x21f9e8=typeof _0x3e62c0[_0xb73a('0x20')]==='undefined'&&typeof _0x3e62c0[_0xb73a('0x21')]===_0xb73a('0x22');var _0x171be7=_0x2ff02c[_0xb73a('0x23')];var _0xe7e06a=_0x21f9e8?0x0:_0x3e62c0[_0xb73a('0x20')];var _0x200e65=_0x21f9e8?_0x2ff02c[_0xb73a('0x23')]:_0x3e62c0['offset']+_0x3e62c0[_0xb73a('0x21')];var _0x22aa85;if(_0x200e65>=_0x171be7){_0x200e65=_0x171be7;_0x22aa85=0xc8;}else{_0x22aa85=0xce;}_0x4b9dfb[_0xb73a('0x1d')](_0x22aa85);return _0x4b9dfb[_0xb73a('0x24')]('Content-Range',_0xe7e06a+'-'+_0x200e65+'/'+_0x171be7)[_0xb73a('0x1f')](_0x2ff02c);}return null;};}function patchUpdates(_0x3a2dab){return function(_0x184bf7){try{jsonpatch[_0xb73a('0x25')](_0x184bf7,_0x3a2dab,!![]);}catch(_0x1df380){return BPromise[_0xb73a('0x26')](_0x1df380);}return _0x184bf7[_0xb73a('0x27')]();};}function saveUpdates(_0x107c4d,_0x220708){return function(_0x4d53a6){if(_0x4d53a6){return _0x4d53a6[_0xb73a('0x28')](_0x107c4d)['then'](function(_0x510bf1){return _0x510bf1;});}return null;};}function removeEntity(_0x53b327,_0x25b8ef){return function(_0x1d025d){if(_0x1d025d){return _0x1d025d[_0xb73a('0x29')]()[_0xb73a('0x2a')](function(){_0x53b327[_0xb73a('0x1d')](0xcc)[_0xb73a('0x1e')]();});}};}function handleEntityNotFound(_0x11b9f6,_0x144976){return function(_0x470898){if(!_0x470898){_0x11b9f6['sendStatus'](0x194);}return _0x470898;};}function handleError(_0x540b56,_0xd506cf){_0xd506cf=_0xd506cf||0x1f4;return function(_0x1e6f7b){logger[_0xb73a('0x2b')](_0x1e6f7b[_0xb73a('0x2c')]);if(_0x1e6f7b[_0xb73a('0x2d')]){delete _0x1e6f7b['name'];}_0x540b56[_0xb73a('0x1d')](_0xd506cf)[_0xb73a('0x2e')](_0x1e6f7b);};}exports[_0xb73a('0x2f')]=function(_0x2f548f,_0x47dc38){var _0x1f9ea4={},_0x42efee={},_0x866709={'count':0x0,'rows':[]};var _0x285beb=_[_0xb73a('0x30')](db['ServicenowConfiguration'][_0xb73a('0x31')],function(_0x212f77){return{'name':_0x212f77[_0xb73a('0x32')],'type':_0x212f77[_0xb73a('0x33')][_0xb73a('0x34')]};});_0x42efee['model']=_[_0xb73a('0x30')](_0x285beb,_0xb73a('0x2d'));_0x42efee[_0xb73a('0x35')]=_[_0xb73a('0x36')](_0x2f548f['query']);_0x42efee[_0xb73a('0x37')]=_[_0xb73a('0x38')](_0x42efee[_0xb73a('0x39')],_0x42efee['query']);_0x1f9ea4[_0xb73a('0x3a')]=_[_0xb73a('0x38')](_0x42efee[_0xb73a('0x39')],qs['fields'](_0x2f548f[_0xb73a('0x35')]['fields']));_0x1f9ea4[_0xb73a('0x3a')]=_0x1f9ea4[_0xb73a('0x3a')]['length']?_0x1f9ea4[_0xb73a('0x3a')]:_0x42efee['model'];if(!_0x2f548f[_0xb73a('0x35')][_0xb73a('0x3b')](_0xb73a('0x3c'))){_0x1f9ea4['limit']=qs[_0xb73a('0x21')](_0x2f548f[_0xb73a('0x35')][_0xb73a('0x21')]);_0x1f9ea4[_0xb73a('0x20')]=qs[_0xb73a('0x20')](_0x2f548f[_0xb73a('0x35')][_0xb73a('0x20')]);}_0x1f9ea4[_0xb73a('0x3d')]=qs[_0xb73a('0x3e')](_0x2f548f[_0xb73a('0x35')]['sort']);_0x1f9ea4[_0xb73a('0x3f')]=qs['filters'](_[_0xb73a('0x40')](_0x2f548f[_0xb73a('0x35')],_0x42efee[_0xb73a('0x37')]),_0x285beb);if(_0x2f548f[_0xb73a('0x35')]['filter']){_0x1f9ea4[_0xb73a('0x3f')]=_[_0xb73a('0x41')](_0x1f9ea4[_0xb73a('0x3f')],{'$or':_[_0xb73a('0x30')](_0x285beb,function(_0x3d1a01){if(_0x3d1a01[_0xb73a('0x33')]!=='VIRTUAL'){var _0x51047c={};_0x51047c[_0x3d1a01[_0xb73a('0x2d')]]={'$like':'%'+_0x2f548f[_0xb73a('0x35')][_0xb73a('0x42')]+'%'};return _0x51047c;}})});}_0x1f9ea4=_[_0xb73a('0x41')]({},_0x1f9ea4,_0x2f548f[_0xb73a('0x43')]);var _0x585785={'where':_0x1f9ea4[_0xb73a('0x3f')]};return db[_0xb73a('0x44')][_0xb73a('0x23')](_0x585785)[_0xb73a('0x2a')](function(_0x43f2fb){_0x866709['count']=_0x43f2fb;if(_0x2f548f[_0xb73a('0x35')][_0xb73a('0x45')]){_0x1f9ea4[_0xb73a('0x46')]=[{'all':!![]}];}return db[_0xb73a('0x44')]['findAll'](_0x1f9ea4);})[_0xb73a('0x2a')](function(_0x3e29f6){_0x866709['rows']=_0x3e29f6;return _0x866709;})[_0xb73a('0x2a')](respondWithFilteredResult(_0x47dc38,_0x1f9ea4))[_0xb73a('0x47')](handleError(_0x47dc38,null));};exports[_0xb73a('0x48')]=function(_0x513f86,_0xd8357b){var _0x3c37b7={'raw':![],'where':{'id':_0x513f86[_0xb73a('0x49')]['id']}},_0x23b2d9={};_0x23b2d9[_0xb73a('0x39')]=_[_0xb73a('0x36')](db[_0xb73a('0x44')][_0xb73a('0x31')]);_0x23b2d9[_0xb73a('0x35')]=_[_0xb73a('0x36')](_0x513f86[_0xb73a('0x35')]);_0x23b2d9[_0xb73a('0x37')]=_[_0xb73a('0x38')](_0x23b2d9[_0xb73a('0x39')],_0x23b2d9['query']);_0x3c37b7[_0xb73a('0x3a')]=_['intersection'](_0x23b2d9[_0xb73a('0x39')],qs[_0xb73a('0x4a')](_0x513f86[_0xb73a('0x35')][_0xb73a('0x4a')]));_0x3c37b7[_0xb73a('0x3a')]=_0x3c37b7[_0xb73a('0x3a')][_0xb73a('0x4b')]?_0x3c37b7[_0xb73a('0x3a')]:_0x23b2d9[_0xb73a('0x39')];if(_0x513f86['query']['includeAll']){_0x3c37b7[_0xb73a('0x46')]=[{'all':!![]}];}_0x3c37b7=_[_0xb73a('0x41')]({},_0x3c37b7,_0x513f86[_0xb73a('0x43')]);return db[_0xb73a('0x44')][_0xb73a('0x4c')](_0x3c37b7)['then'](handleEntityNotFound(_0xd8357b,null))[_0xb73a('0x2a')](respondWithResult(_0xd8357b,null))['catch'](handleError(_0xd8357b,null));};exports['create']=function(_0x153dac,_0x578f85){return db[_0xb73a('0x44')][_0xb73a('0x4d')](_0x153dac[_0xb73a('0x4e')],{})[_0xb73a('0x2a')](respondWithResult(_0x578f85,0xc9))[_0xb73a('0x47')](handleError(_0x578f85,null));};exports[_0xb73a('0x28')]=function(_0x4b1861,_0x1b1769){if(_0x4b1861[_0xb73a('0x4e')]['id']){delete _0x4b1861[_0xb73a('0x4e')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x4b1861['params']['id']}})[_0xb73a('0x2a')](handleEntityNotFound(_0x1b1769,null))[_0xb73a('0x2a')](saveUpdates(_0x4b1861['body'],null))[_0xb73a('0x2a')](respondWithResult(_0x1b1769,null))[_0xb73a('0x47')](handleError(_0x1b1769,null));};exports[_0xb73a('0x29')]=function(_0xed4ede,_0x58cbf5){return db[_0xb73a('0x44')][_0xb73a('0x4c')]({'where':{'id':_0xed4ede[_0xb73a('0x49')]['id']}})[_0xb73a('0x2a')](handleEntityNotFound(_0x58cbf5,null))[_0xb73a('0x2a')](removeEntity(_0x58cbf5,null))[_0xb73a('0x47')](handleError(_0x58cbf5,null));};exports['getFields']=function(_0xf6f79c,_0x3adc6d,_0x5609fc){var _0x54922e={};var _0x24b05e={};var _0x5567cc;var _0x57ac2e;return db[_0xb73a('0x44')][_0xb73a('0x4f')]({'where':{'id':_0xf6f79c[_0xb73a('0x49')]['id']}})['then'](handleEntityNotFound(_0x3adc6d,null))[_0xb73a('0x2a')](function(_0x24e3dc){if(_0x24e3dc){_0x5567cc=_0x24e3dc;_0x24b05e['model']=_[_0xb73a('0x36')](db[_0xb73a('0x50')][_0xb73a('0x31')]);_0x24b05e['query']=_[_0xb73a('0x36')](_0xf6f79c[_0xb73a('0x35')]);_0x24b05e[_0xb73a('0x37')]=_[_0xb73a('0x38')](_0x24b05e[_0xb73a('0x39')],_0x24b05e[_0xb73a('0x35')]);_0x54922e['attributes']=_[_0xb73a('0x38')](_0x24b05e[_0xb73a('0x39')],qs[_0xb73a('0x4a')](_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x4a')]));_0x54922e[_0xb73a('0x3a')]=_0x54922e[_0xb73a('0x3a')]['length']?_0x54922e[_0xb73a('0x3a')]:_0x24b05e[_0xb73a('0x39')];_0x54922e['order']=qs['sort'](_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x3e')]);_0x54922e[_0xb73a('0x3f')]=qs['filters'](_[_0xb73a('0x40')](_0xf6f79c['query'],_0x24b05e[_0xb73a('0x37')]));if(_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x42')]){_0x54922e['where']=_[_0xb73a('0x41')](_0x54922e[_0xb73a('0x3f')],{'$or':_[_0xb73a('0x30')](_0x54922e[_0xb73a('0x3a')],function(_0xd7e3f6){var _0x5b93df={};_0x5b93df[_0xd7e3f6]={'$like':'%'+_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x42')]+'%'};return _0x5b93df;})});}_0x54922e=_['merge']({},_0x54922e,_0xf6f79c['options']);return _0x5567cc[_0xb73a('0x51')](_0x54922e);}})['then'](function(_0x69a8fb){if(_0x69a8fb){_0x57ac2e=_0x69a8fb[_0xb73a('0x4b')];if(!_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x3b')](_0xb73a('0x3c'))){_0x54922e[_0xb73a('0x21')]=qs['limit'](_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x21')]);_0x54922e[_0xb73a('0x20')]=qs[_0xb73a('0x20')](_0xf6f79c[_0xb73a('0x35')][_0xb73a('0x20')]);}return _0x5567cc[_0xb73a('0x51')](_0x54922e);}})[_0xb73a('0x2a')](function(_0x16d04f){if(_0x16d04f){return _0x16d04f?{'count':_0x57ac2e,'rows':_0x16d04f}:null;}})[_0xb73a('0x2a')](respondWithResult(_0x3adc6d,null))['catch'](handleError(_0x3adc6d,null));};exports[_0xb73a('0x52')]=function(_0x1fdd9f,_0x46aa91,_0x8a9a6b){var _0x27ea63={};var _0x525b52={};var _0x301a19;var _0xc294e2;return db[_0xb73a('0x44')][_0xb73a('0x4f')]({'where':{'id':_0x1fdd9f[_0xb73a('0x49')]['id']}})[_0xb73a('0x2a')](handleEntityNotFound(_0x46aa91,null))['then'](function(_0x30e0f0){if(_0x30e0f0){_0x301a19=_0x30e0f0;_0x525b52[_0xb73a('0x39')]=_[_0xb73a('0x36')](db[_0xb73a('0x50')]['rawAttributes']);_0x525b52[_0xb73a('0x35')]=_[_0xb73a('0x36')](_0x1fdd9f[_0xb73a('0x35')]);_0x525b52[_0xb73a('0x37')]=_[_0xb73a('0x38')](_0x525b52[_0xb73a('0x39')],_0x525b52['query']);_0x27ea63[_0xb73a('0x3a')]=_[_0xb73a('0x38')](_0x525b52[_0xb73a('0x39')],qs[_0xb73a('0x4a')](_0x1fdd9f[_0xb73a('0x35')]['fields']));_0x27ea63[_0xb73a('0x3a')]=_0x27ea63[_0xb73a('0x3a')][_0xb73a('0x4b')]?_0x27ea63['attributes']:_0x525b52[_0xb73a('0x39')];_0x27ea63[_0xb73a('0x3d')]=qs['sort'](_0x1fdd9f['query'][_0xb73a('0x3e')]);_0x27ea63[_0xb73a('0x3f')]=qs[_0xb73a('0x37')](_[_0xb73a('0x40')](_0x1fdd9f['query'],_0x525b52[_0xb73a('0x37')]));if(_0x1fdd9f[_0xb73a('0x35')][_0xb73a('0x42')]){_0x27ea63[_0xb73a('0x3f')]=_[_0xb73a('0x41')](_0x27ea63[_0xb73a('0x3f')],{'$or':_[_0xb73a('0x30')](_0x27ea63[_0xb73a('0x3a')],function(_0x3bdf3a){var _0x1e1590={};_0x1e1590[_0x3bdf3a]={'$like':'%'+_0x1fdd9f['query'][_0xb73a('0x42')]+'%'};return _0x1e1590;})});}_0x27ea63=_['merge']({},_0x27ea63,_0x1fdd9f[_0xb73a('0x43')]);return _0x301a19['getSubjects'](_0x27ea63);}})[_0xb73a('0x2a')](function(_0x64fac5){if(_0x64fac5){_0xc294e2=_0x64fac5[_0xb73a('0x4b')];if(!_0x1fdd9f[_0xb73a('0x35')]['hasOwnProperty']('nolimit')){_0x27ea63[_0xb73a('0x21')]=qs[_0xb73a('0x21')](_0x1fdd9f['query'][_0xb73a('0x21')]);_0x27ea63[_0xb73a('0x20')]=qs[_0xb73a('0x20')](_0x1fdd9f[_0xb73a('0x35')][_0xb73a('0x20')]);}return _0x301a19['getSubjects'](_0x27ea63);}})[_0xb73a('0x2a')](function(_0xa37fda){if(_0xa37fda){return _0xa37fda?{'count':_0xc294e2,'rows':_0xa37fda}:null;}})['then'](respondWithResult(_0x46aa91,null))[_0xb73a('0x47')](handleError(_0x46aa91,null));};exports[_0xb73a('0x53')]=function(_0x3a8f8d,_0x2fa983,_0x12aca4){var _0xf60c30={};var _0x3761b4={};var _0x46c839;var _0x4c0794;return db['ServicenowConfiguration'][_0xb73a('0x4f')]({'where':{'id':_0x3a8f8d[_0xb73a('0x49')]['id']}})[_0xb73a('0x2a')](handleEntityNotFound(_0x2fa983,null))['then'](function(_0x50f254){if(_0x50f254){_0x46c839=_0x50f254;_0x3761b4[_0xb73a('0x39')]=_[_0xb73a('0x36')](db['ServicenowField'][_0xb73a('0x31')]);_0x3761b4[_0xb73a('0x35')]=_['keys'](_0x3a8f8d[_0xb73a('0x35')]);_0x3761b4[_0xb73a('0x37')]=_[_0xb73a('0x38')](_0x3761b4[_0xb73a('0x39')],_0x3761b4[_0xb73a('0x35')]);_0xf60c30[_0xb73a('0x3a')]=_[_0xb73a('0x38')](_0x3761b4[_0xb73a('0x39')],qs[_0xb73a('0x4a')](_0x3a8f8d['query'][_0xb73a('0x4a')]));_0xf60c30['attributes']=_0xf60c30[_0xb73a('0x3a')]['length']?_0xf60c30['attributes']:_0x3761b4[_0xb73a('0x39')];_0xf60c30['order']=qs[_0xb73a('0x3e')](_0x3a8f8d[_0xb73a('0x35')][_0xb73a('0x3e')]);_0xf60c30[_0xb73a('0x3f')]=qs[_0xb73a('0x37')](_[_0xb73a('0x40')](_0x3a8f8d['query'],_0x3761b4[_0xb73a('0x37')]));if(_0x3a8f8d[_0xb73a('0x35')][_0xb73a('0x42')]){_0xf60c30[_0xb73a('0x3f')]=_['merge'](_0xf60c30[_0xb73a('0x3f')],{'$or':_[_0xb73a('0x30')](_0xf60c30[_0xb73a('0x3a')],function(_0x50e3f4){var _0xdae1af={};_0xdae1af[_0x50e3f4]={'$like':'%'+_0x3a8f8d[_0xb73a('0x35')][_0xb73a('0x42')]+'%'};return _0xdae1af;})});}_0xf60c30=_[_0xb73a('0x41')]({},_0xf60c30,_0x3a8f8d[_0xb73a('0x43')]);return _0x46c839[_0xb73a('0x53')](_0xf60c30);}})[_0xb73a('0x2a')](function(_0x3acf23){if(_0x3acf23){_0x4c0794=_0x3acf23[_0xb73a('0x4b')];if(!_0x3a8f8d[_0xb73a('0x35')][_0xb73a('0x3b')]('nolimit')){_0xf60c30[_0xb73a('0x21')]=qs['limit'](_0x3a8f8d[_0xb73a('0x35')][_0xb73a('0x21')]);_0xf60c30['offset']=qs['offset'](_0x3a8f8d[_0xb73a('0x35')][_0xb73a('0x20')]);}return _0x46c839[_0xb73a('0x53')](_0xf60c30);}})[_0xb73a('0x2a')](function(_0xf80a8){if(_0xf80a8){return _0xf80a8?{'count':_0x4c0794,'rows':_0xf80a8}:null;}})[_0xb73a('0x2a')](respondWithResult(_0x2fa983,null))[_0xb73a('0x47')](handleError(_0x2fa983,null));};
\ No newline at end of file
index fb4dc19..fedcbda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x723c=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration'];(function(_0x900a62,_0x52889d){var _0x1f537a=function(_0x26b331){while(--_0x26b331){_0x900a62['push'](_0x900a62['shift']());}};_0x1f537a(++_0x52889d);}(_0x723c,0x1ad));var _0xc723=function(_0x50fab1,_0x2e83e8){_0x50fab1=_0x50fab1-0x0;var _0xf6da0d=_0x723c[_0x50fab1];return _0xf6da0d;};'use strict';var _=require('lodash');var util=require(_0xc723('0x0'));var logger=require(_0xc723('0x1'))('api');var moment=require(_0xc723('0x2'));var BPromise=require('bluebird');var rp=require(_0xc723('0x3'));var fs=require('fs');var path=require(_0xc723('0x4'));var rimraf=require(_0xc723('0x5'));var config=require(_0xc723('0x6'));var attributes=require(_0xc723('0x7'));module[_0xc723('0x8')]=function(_0xa08b3,_0x4eb5ff){return _0xa08b3[_0xc723('0x9')](_0xc723('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x40ac=['api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger'];(function(_0xf84a59,_0x1092b0){var _0x54cb4c=function(_0xa7d3c){while(--_0xa7d3c){_0xf84a59['push'](_0xf84a59['shift']());}};_0x54cb4c(++_0x1092b0);}(_0x40ac,0x1de));var _0xc40a=function(_0x53a1be,_0x42dff2){_0x53a1be=_0x53a1be-0x0;var _0x38ae84=_0x40ac[_0x53a1be];return _0x38ae84;};'use strict';var _=require(_0xc40a('0x0'));var util=require('util');var logger=require(_0xc40a('0x1'))(_0xc40a('0x2'));var moment=require(_0xc40a('0x3'));var BPromise=require(_0xc40a('0x4'));var rp=require(_0xc40a('0x5'));var fs=require('fs');var path=require(_0xc40a('0x6'));var rimraf=require(_0xc40a('0x7'));var config=require('../../config/environment');var attributes=require(_0xc40a('0x8'));module[_0xc40a('0x9')]=function(_0xd6d891,_0x5e179f){return _0xd6d891['define'](_0xc40a('0xa'),attributes,{'tableName':_0xc40a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c86bb0d..869af23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa105=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x10c2d3,_0x2f5914){var _0x5a0b13=function(_0x412864){while(--_0x412864){_0x10c2d3['push'](_0x10c2d3['shift']());}};_0x5a0b13(++_0x2f5914);}(_0xa105,0xd8));var _0x5a10=function(_0x36c347,_0x175bd5){_0x36c347=_0x36c347-0x0;var _0x5d1286=_0xa105[_0x36c347];return _0x5d1286;};'use strict';var _=require(_0x5a10('0x0'));var util=require('util');var moment=require(_0x5a10('0x1'));var BPromise=require(_0x5a10('0x2'));var rs=require(_0x5a10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a10('0x4'))['db'];var utils=require(_0x5a10('0x5'));var logger=require(_0x5a10('0x6'))(_0x5a10('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a10('0x8'));var client=jayson[_0x5a10('0x9')][_0x5a10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x70d28,_0x3c19f0,_0x34f4b2){return new BPromise(function(_0x15e9ab,_0x31c58f){return client[_0x5a10('0xb')](_0x70d28,_0x34f4b2)[_0x5a10('0xc')](function(_0x1eb5c1){logger[_0x5a10('0xd')](_0x5a10('0xe'),_0x3c19f0,_0x5a10('0xf'));logger[_0x5a10('0x10')](_0x5a10('0x11'),_0x3c19f0,_0x5a10('0xf'),JSON['stringify'](_0x1eb5c1));if(_0x1eb5c1[_0x5a10('0x12')]){if(_0x1eb5c1[_0x5a10('0x12')][_0x5a10('0x13')]===0x1f4){logger[_0x5a10('0x12')](_0x5a10('0xe'),_0x3c19f0,_0x1eb5c1[_0x5a10('0x12')][_0x5a10('0x14')]);return _0x31c58f(_0x1eb5c1[_0x5a10('0x12')][_0x5a10('0x14')]);}logger[_0x5a10('0x12')](_0x5a10('0xe'),_0x3c19f0,_0x1eb5c1[_0x5a10('0x12')][_0x5a10('0x14')]);return _0x15e9ab(_0x1eb5c1[_0x5a10('0x12')]['message']);}else{logger[_0x5a10('0xd')](_0x5a10('0xe'),_0x3c19f0,_0x5a10('0xf'));_0x15e9ab(_0x1eb5c1['result']['message']);}})[_0x5a10('0x15')](function(_0x27f5f2){logger[_0x5a10('0x12')](_0x5a10('0xe'),_0x3c19f0,_0x27f5f2);_0x31c58f(_0x27f5f2);});});}
\ No newline at end of file
+var _0xa82b=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa82b,0x18d));var _0xba82=function(_0x2af009,_0x5432ee){_0x2af009=_0x2af009-0x0;var _0x46d15f=_0xa82b[_0x2af009];return _0x46d15f;};'use strict';var _=require(_0xba82('0x0'));var util=require(_0xba82('0x1'));var moment=require(_0xba82('0x2'));var BPromise=require(_0xba82('0x3'));var rs=require(_0xba82('0x4'));var fs=require('fs');var Redis=require(_0xba82('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba82('0x6'));var logger=require(_0xba82('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xba82('0x8'));var client=jayson[_0xba82('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23942b,_0x10bcc8,_0x7f99a7){return new BPromise(function(_0x3ec723,_0x2c68cc){return client[_0xba82('0xa')](_0x23942b,_0x7f99a7)[_0xba82('0xb')](function(_0x4d76a2){logger[_0xba82('0xc')](_0xba82('0xd'),_0x10bcc8,_0xba82('0xe'));logger[_0xba82('0xf')](_0xba82('0x10'),_0x10bcc8,_0xba82('0xe'),JSON['stringify'](_0x4d76a2));if(_0x4d76a2[_0xba82('0x11')]){if(_0x4d76a2[_0xba82('0x11')][_0xba82('0x12')]===0x1f4){logger[_0xba82('0x11')](_0xba82('0xd'),_0x10bcc8,_0x4d76a2[_0xba82('0x11')]['message']);return _0x2c68cc(_0x4d76a2[_0xba82('0x11')][_0xba82('0x13')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x10bcc8,_0x4d76a2[_0xba82('0x11')][_0xba82('0x13')]);return _0x3ec723(_0x4d76a2[_0xba82('0x11')][_0xba82('0x13')]);}else{logger[_0xba82('0xc')](_0xba82('0xd'),_0x10bcc8,_0xba82('0xe'));_0x3ec723(_0x4d76a2[_0xba82('0x14')]['message']);}})[_0xba82('0x15')](function(_0x4ed1b6){logger[_0xba82('0x11')](_0xba82('0xd'),_0x10bcc8,_0x4ed1b6);_0x2c68cc(_0x4ed1b6);});});}
\ No newline at end of file
index 9567bd9..d7eb33d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1805=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','put','delete'];(function(_0x332998,_0x2d99c7){var _0x460be7=function(_0x1a4d24){while(--_0x1a4d24){_0x332998['push'](_0x332998['shift']());}};_0x460be7(++_0x2d99c7);}(_0x1805,0xf0));var _0x5180=function(_0x15b249,_0x54ae07){_0x15b249=_0x15b249-0x0;var _0x2184aa=_0x1805[_0x15b249];return _0x2184aa;};'use strict';var multer=require(_0x5180('0x0'));var util=require(_0x5180('0x1'));var path=require(_0x5180('0x2'));var timeout=require('connect-timeout');var express=require(_0x5180('0x3'));var router=express[_0x5180('0x4')]();var fs_extra=require(_0x5180('0x5'));var auth=require(_0x5180('0x6'));var interaction=require(_0x5180('0x7'));var config=require(_0x5180('0x8'));var controller=require(_0x5180('0x9'));router[_0x5180('0xa')]('/',auth[_0x5180('0xb')](),controller['index']);router[_0x5180('0xa')](_0x5180('0xc'),auth[_0x5180('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5180('0xd')](_0x5180('0xc'),auth[_0x5180('0xb')](),controller['update']);router[_0x5180('0xe')]('/:id',auth[_0x5180('0xb')](),controller[_0x5180('0xf')]);module[_0x5180('0x10')]=router;
\ No newline at end of file
+var _0x194e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','multer','util'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x194e,0x1ca));var _0xe194=function(_0x4e7be0,_0x1914b2){_0x4e7be0=_0x4e7be0-0x0;var _0x41978e=_0x194e[_0x4e7be0];return _0x41978e;};'use strict';var multer=require(_0xe194('0x0'));var util=require(_0xe194('0x1'));var path=require(_0xe194('0x2'));var timeout=require(_0xe194('0x3'));var express=require(_0xe194('0x4'));var router=express[_0xe194('0x5')]();var fs_extra=require(_0xe194('0x6'));var auth=require(_0xe194('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe194('0x8'));var controller=require(_0xe194('0x9'));router[_0xe194('0xa')]('/',auth[_0xe194('0xb')](),controller[_0xe194('0xc')]);router[_0xe194('0xa')](_0xe194('0xd'),auth['isAuthenticated'](),controller[_0xe194('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe194('0xf')]);router[_0xe194('0x10')]('/:id',auth[_0xe194('0xb')](),controller['update']);router[_0xe194('0x11')](_0xe194('0xd'),auth[_0xe194('0xb')](),controller[_0xe194('0x12')]);module[_0xe194('0x13')]=router;
\ No newline at end of file
index 413f477..d2e47e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f11=['string','customVariable','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3aa88e,_0x4f2dc8){var _0x3bbdee=function(_0x459c2d){while(--_0x459c2d){_0x3aa88e['push'](_0x3aa88e['shift']());}};_0x3bbdee(++_0x4f2dc8);}(_0x6f11,0x9f));var _0x16f1=function(_0x830c49,_0x4bb035){_0x830c49=_0x830c49-0x0;var _0x56b989=_0x6f11[_0x830c49];return _0x56b989;};'use strict';var Sequelize=require(_0x16f1('0x0'));module[_0x16f1('0x1')]={'type':{'type':Sequelize[_0x16f1('0x2')](_0x16f1('0x3'),'variable',_0x16f1('0x4'),'keyValue',_0x16f1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x16f1('0x6')]},'key':{'type':Sequelize[_0x16f1('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x16f1('0x7'),_0x16f1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x16f1('0x6')]},'nameField':{'type':Sequelize[_0x16f1('0x6')]},'customField':{'type':Sequelize[_0x16f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x16f1('0x6')]}};
\ No newline at end of file
+var _0x5ada=['STRING','sequelize','ENUM','variable','customVariable','keyValue','string'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x5ada,0x1d6));var _0xa5ad=function(_0x511d5c,_0x4d44a0){_0x511d5c=_0x511d5c-0x0;var _0x128d3b=_0x5ada[_0x511d5c];return _0x128d3b;};'use strict';var Sequelize=require(_0xa5ad('0x0'));module['exports']={'type':{'type':Sequelize[_0xa5ad('0x1')]('string',_0xa5ad('0x2'),_0xa5ad('0x3'),_0xa5ad('0x4'),'picklist'),'defaultValue':_0xa5ad('0x5')},'content':{'type':Sequelize[_0xa5ad('0x6')]},'key':{'type':Sequelize[_0xa5ad('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa5ad('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xa5ad('0x6')]},'idField':{'type':Sequelize[_0xa5ad('0x6')]},'nameField':{'type':Sequelize[_0xa5ad('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5ad('0x6')]}};
\ No newline at end of file
index 3a4cc76..de77999 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd0=['length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','type','key','model','query','intersection','fields','attributes'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x4fd0,0xa7));var _0x04fd=function(_0xac8055,_0x5ababb){_0xac8055=_0xac8055-0x0;var _0x2d5608=_0x4fd0[_0xac8055];return _0x2d5608;};'use strict';var emlformat=require(_0x04fd('0x0'));var rimraf=require(_0x04fd('0x1'));var zipdir=require(_0x04fd('0x2'));var jsonpatch=require(_0x04fd('0x3'));var rp=require(_0x04fd('0x4'));var moment=require('moment');var BPromise=require(_0x04fd('0x5'));var Mustache=require(_0x04fd('0x6'));var util=require(_0x04fd('0x7'));var path=require(_0x04fd('0x8'));var sox=require(_0x04fd('0x9'));var csv=require(_0x04fd('0xa'));var ejs=require(_0x04fd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x04fd('0xc'));var crypto=require(_0x04fd('0xd'));var jsforce=require(_0x04fd('0xe'));var deskjs=require(_0x04fd('0xf'));var toCsv=require(_0x04fd('0xa'));var querystring=require(_0x04fd('0x10'));var Papa=require(_0x04fd('0x11'));var Redis=require('ioredis');var authService=require(_0x04fd('0x12'));var qs=require(_0x04fd('0x13'));var as=require(_0x04fd('0x14'));var hardwareService=require(_0x04fd('0x15'));var logger=require(_0x04fd('0x16'))(_0x04fd('0x17'));var utils=require('../../config/utils');var config=require(_0x04fd('0x18'));var licenseUtil=require(_0x04fd('0x19'));var db=require(_0x04fd('0x1a'))['db'];function respondWithStatusCode(_0x2e7c79,_0xa7b83a){_0xa7b83a=_0xa7b83a||0xcc;return function(_0x25e9ae){if(_0x25e9ae){return _0x2e7c79[_0x04fd('0x1b')](_0xa7b83a);}return _0x2e7c79[_0x04fd('0x1c')](_0xa7b83a)['end']();};}function respondWithResult(_0x5a811c,_0x140bd3){_0x140bd3=_0x140bd3||0xc8;return function(_0x33a507){if(_0x33a507){return _0x5a811c['status'](_0x140bd3)[_0x04fd('0x1d')](_0x33a507);}};}function respondWithFilteredResult(_0xb1b75,_0xcc6432){return function(_0x567d6e){if(_0x567d6e){var _0x150308=typeof _0xcc6432['offset']===_0x04fd('0x1e')&&typeof _0xcc6432[_0x04fd('0x1f')]==='undefined';var _0x36be7c=_0x567d6e[_0x04fd('0x20')];var _0x3c67c1=_0x150308?0x0:_0xcc6432['offset'];var _0x556a36=_0x150308?_0x567d6e['count']:_0xcc6432[_0x04fd('0x21')]+_0xcc6432['limit'];var _0x229729;if(_0x556a36>=_0x36be7c){_0x556a36=_0x36be7c;_0x229729=0xc8;}else{_0x229729=0xce;}_0xb1b75[_0x04fd('0x1c')](_0x229729);return _0xb1b75[_0x04fd('0x22')](_0x04fd('0x23'),_0x3c67c1+'-'+_0x556a36+'/'+_0x36be7c)[_0x04fd('0x1d')](_0x567d6e);}return null;};}function patchUpdates(_0x1214e9){return function(_0x1f7193){try{jsonpatch[_0x04fd('0x24')](_0x1f7193,_0x1214e9,!![]);}catch(_0x38767f){return BPromise['reject'](_0x38767f);}return _0x1f7193['save']();};}function saveUpdates(_0x37d3b2,_0x31ff5e){return function(_0x3c0430){if(_0x3c0430){return _0x3c0430[_0x04fd('0x25')](_0x37d3b2)[_0x04fd('0x26')](function(_0x4aaf4b){return _0x4aaf4b;});}return null;};}function removeEntity(_0xcfed02,_0x5a5ed4){return function(_0x349092){if(_0x349092){return _0x349092[_0x04fd('0x27')]()[_0x04fd('0x26')](function(){_0xcfed02[_0x04fd('0x1c')](0xcc)[_0x04fd('0x28')]();});}};}function handleEntityNotFound(_0x2b39f7,_0x11ea6a){return function(_0x1bc879){if(!_0x1bc879){_0x2b39f7['sendStatus'](0x194);}return _0x1bc879;};}function handleError(_0x508d33,_0x24653e){_0x24653e=_0x24653e||0x1f4;return function(_0x3608c8){logger[_0x04fd('0x29')](_0x3608c8['stack']);if(_0x3608c8[_0x04fd('0x2a')]){delete _0x3608c8[_0x04fd('0x2a')];}_0x508d33[_0x04fd('0x1c')](_0x24653e)[_0x04fd('0x2b')](_0x3608c8);};}exports[_0x04fd('0x2c')]=function(_0x3187d0,_0x351770){var _0x3e1de9={},_0x2022cd={},_0x477a33={'count':0x0,'rows':[]};var _0x44bbcf=_[_0x04fd('0x2d')](db[_0x04fd('0x2e')][_0x04fd('0x2f')],function(_0x530b19){return{'name':_0x530b19['fieldName'],'type':_0x530b19[_0x04fd('0x30')][_0x04fd('0x31')]};});_0x2022cd[_0x04fd('0x32')]=_[_0x04fd('0x2d')](_0x44bbcf,_0x04fd('0x2a'));_0x2022cd[_0x04fd('0x33')]=_['keys'](_0x3187d0['query']);_0x2022cd['filters']=_[_0x04fd('0x34')](_0x2022cd[_0x04fd('0x32')],_0x2022cd['query']);_0x3e1de9['attributes']=_[_0x04fd('0x34')](_0x2022cd[_0x04fd('0x32')],qs[_0x04fd('0x35')](_0x3187d0['query'][_0x04fd('0x35')]));_0x3e1de9[_0x04fd('0x36')]=_0x3e1de9[_0x04fd('0x36')][_0x04fd('0x37')]?_0x3e1de9['attributes']:_0x2022cd['model'];if(!_0x3187d0['query'][_0x04fd('0x38')](_0x04fd('0x39'))){_0x3e1de9['limit']=qs[_0x04fd('0x1f')](_0x3187d0['query'][_0x04fd('0x1f')]);_0x3e1de9[_0x04fd('0x21')]=qs[_0x04fd('0x21')](_0x3187d0[_0x04fd('0x33')][_0x04fd('0x21')]);}_0x3e1de9[_0x04fd('0x3a')]=qs['sort'](_0x3187d0[_0x04fd('0x33')][_0x04fd('0x3b')]);_0x3e1de9[_0x04fd('0x3c')]=qs[_0x04fd('0x3d')](_['pick'](_0x3187d0['query'],_0x2022cd[_0x04fd('0x3d')]),_0x44bbcf);if(_0x3187d0[_0x04fd('0x33')]['filter']){_0x3e1de9[_0x04fd('0x3c')]=_['merge'](_0x3e1de9['where'],{'$or':_[_0x04fd('0x2d')](_0x44bbcf,function(_0x18ad5b){if(_0x18ad5b[_0x04fd('0x30')]!==_0x04fd('0x3e')){var _0x3a1ad9={};_0x3a1ad9[_0x18ad5b['name']]={'$like':'%'+_0x3187d0['query']['filter']+'%'};return _0x3a1ad9;}})});}_0x3e1de9=_[_0x04fd('0x3f')]({},_0x3e1de9,_0x3187d0[_0x04fd('0x40')]);var _0x7b421b={'where':_0x3e1de9[_0x04fd('0x3c')]};return db[_0x04fd('0x2e')][_0x04fd('0x20')](_0x7b421b)[_0x04fd('0x26')](function(_0x31b76b){_0x477a33[_0x04fd('0x20')]=_0x31b76b;if(_0x3187d0[_0x04fd('0x33')][_0x04fd('0x41')]){_0x3e1de9[_0x04fd('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0x04fd('0x43')](_0x3e1de9);})[_0x04fd('0x26')](function(_0xa326fe){_0x477a33[_0x04fd('0x44')]=_0xa326fe;return _0x477a33;})[_0x04fd('0x26')](respondWithFilteredResult(_0x351770,_0x3e1de9))[_0x04fd('0x45')](handleError(_0x351770,null));};exports['show']=function(_0x3e0fb9,_0x124936){var _0x756a14={'raw':!![],'where':{'id':_0x3e0fb9[_0x04fd('0x46')]['id']}},_0x5e5484={};_0x5e5484[_0x04fd('0x32')]=_[_0x04fd('0x47')](db[_0x04fd('0x2e')][_0x04fd('0x2f')]);_0x5e5484[_0x04fd('0x33')]=_[_0x04fd('0x47')](_0x3e0fb9['query']);_0x5e5484[_0x04fd('0x3d')]=_[_0x04fd('0x34')](_0x5e5484[_0x04fd('0x32')],_0x5e5484['query']);_0x756a14[_0x04fd('0x36')]=_[_0x04fd('0x34')](_0x5e5484['model'],qs[_0x04fd('0x35')](_0x3e0fb9['query']['fields']));_0x756a14[_0x04fd('0x36')]=_0x756a14[_0x04fd('0x36')][_0x04fd('0x37')]?_0x756a14[_0x04fd('0x36')]:_0x5e5484[_0x04fd('0x32')];if(_0x3e0fb9['query'][_0x04fd('0x41')]){_0x756a14[_0x04fd('0x42')]=[{'all':!![]}];}_0x756a14=_[_0x04fd('0x3f')]({},_0x756a14,_0x3e0fb9[_0x04fd('0x40')]);return db['ServicenowField'][_0x04fd('0x48')](_0x756a14)[_0x04fd('0x26')](handleEntityNotFound(_0x124936,null))[_0x04fd('0x26')](respondWithResult(_0x124936,null))[_0x04fd('0x45')](handleError(_0x124936,null));};exports['create']=function(_0x93f6b6,_0x42e2a3){return db['ServicenowField']['create'](_0x93f6b6[_0x04fd('0x49')],{})[_0x04fd('0x26')](respondWithResult(_0x42e2a3,0xc9))[_0x04fd('0x45')](handleError(_0x42e2a3,null));};exports['update']=function(_0x35c44c,_0x22072f){if(_0x35c44c['body']['id']){delete _0x35c44c[_0x04fd('0x49')]['id'];}return db[_0x04fd('0x2e')][_0x04fd('0x48')]({'where':{'id':_0x35c44c[_0x04fd('0x46')]['id']}})[_0x04fd('0x26')](handleEntityNotFound(_0x22072f,null))[_0x04fd('0x26')](saveUpdates(_0x35c44c[_0x04fd('0x49')],null))['then'](respondWithResult(_0x22072f,null))[_0x04fd('0x45')](handleError(_0x22072f,null));};exports[_0x04fd('0x27')]=function(_0x1b53bb,_0x2b05cd){return db[_0x04fd('0x2e')][_0x04fd('0x48')]({'where':{'id':_0x1b53bb[_0x04fd('0x46')]['id']}})[_0x04fd('0x26')](handleEntityNotFound(_0x2b05cd,null))[_0x04fd('0x26')](removeEntity(_0x2b05cd,null))[_0x04fd('0x45')](handleError(_0x2b05cd,null));};
\ No newline at end of file
+var _0x4219=['length','includeAll','include','merge','options','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','update','then','destroy','name','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','findAll','catch','show','params'];(function(_0x204794,_0x343447){var _0x45d8da=function(_0x153105){while(--_0x153105){_0x204794['push'](_0x204794['shift']());}};_0x45d8da(++_0x343447);}(_0x4219,0x1ab));var _0x9421=function(_0x1a0bc3,_0x2fd122){_0x1a0bc3=_0x1a0bc3-0x0;var _0x501471=_0x4219[_0x1a0bc3];return _0x501471;};'use strict';var emlformat=require(_0x9421('0x0'));var rimraf=require(_0x9421('0x1'));var zipdir=require(_0x9421('0x2'));var jsonpatch=require(_0x9421('0x3'));var rp=require(_0x9421('0x4'));var moment=require('moment');var BPromise=require(_0x9421('0x5'));var Mustache=require(_0x9421('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9421('0x7'));var csv=require(_0x9421('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9421('0x9'));var _=require(_0x9421('0xa'));var squel=require(_0x9421('0xb'));var crypto=require(_0x9421('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9421('0xd'));var toCsv=require(_0x9421('0x8'));var querystring=require(_0x9421('0xe'));var Papa=require(_0x9421('0xf'));var Redis=require(_0x9421('0x10'));var authService=require(_0x9421('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9421('0x12'));var hardwareService=require(_0x9421('0x13'));var logger=require(_0x9421('0x14'))(_0x9421('0x15'));var utils=require(_0x9421('0x16'));var config=require(_0x9421('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3725eb,_0x4d691c){_0x4d691c=_0x4d691c||0xcc;return function(_0x1ac7de){if(_0x1ac7de){return _0x3725eb[_0x9421('0x18')](_0x4d691c);}return _0x3725eb[_0x9421('0x19')](_0x4d691c)[_0x9421('0x1a')]();};}function respondWithResult(_0x508533,_0x2cdcd4){_0x2cdcd4=_0x2cdcd4||0xc8;return function(_0x5a1afd){if(_0x5a1afd){return _0x508533[_0x9421('0x19')](_0x2cdcd4)[_0x9421('0x1b')](_0x5a1afd);}};}function respondWithFilteredResult(_0x57464d,_0x4adb04){return function(_0x4f25af){if(_0x4f25af){var _0x2d573c=typeof _0x4adb04['offset']===_0x9421('0x1c')&&typeof _0x4adb04['limit']==='undefined';var _0x51f920=_0x4f25af[_0x9421('0x1d')];var _0x35ca20=_0x2d573c?0x0:_0x4adb04[_0x9421('0x1e')];var _0x50f1a3=_0x2d573c?_0x4f25af['count']:_0x4adb04[_0x9421('0x1e')]+_0x4adb04['limit'];var _0x4c8f6f;if(_0x50f1a3>=_0x51f920){_0x50f1a3=_0x51f920;_0x4c8f6f=0xc8;}else{_0x4c8f6f=0xce;}_0x57464d['status'](_0x4c8f6f);return _0x57464d[_0x9421('0x1f')](_0x9421('0x20'),_0x35ca20+'-'+_0x50f1a3+'/'+_0x51f920)['json'](_0x4f25af);}return null;};}function patchUpdates(_0x425b12){return function(_0x12bc48){try{jsonpatch['apply'](_0x12bc48,_0x425b12,!![]);}catch(_0x1b3a9f){return BPromise['reject'](_0x1b3a9f);}return _0x12bc48[_0x9421('0x21')]();};}function saveUpdates(_0x3d3f43,_0x206bdd){return function(_0x538fb5){if(_0x538fb5){return _0x538fb5[_0x9421('0x22')](_0x3d3f43)[_0x9421('0x23')](function(_0x1fed0a){return _0x1fed0a;});}return null;};}function removeEntity(_0x14d935,_0x544a29){return function(_0x7c76ca){if(_0x7c76ca){return _0x7c76ca[_0x9421('0x24')]()[_0x9421('0x23')](function(){_0x14d935[_0x9421('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3eb7ee,_0x54b8c0){return function(_0x191781){if(!_0x191781){_0x3eb7ee[_0x9421('0x18')](0x194);}return _0x191781;};}function handleError(_0x49ab30,_0x4b6e57){_0x4b6e57=_0x4b6e57||0x1f4;return function(_0x5f3abe){logger['error'](_0x5f3abe['stack']);if(_0x5f3abe[_0x9421('0x25')]){delete _0x5f3abe[_0x9421('0x25')];}_0x49ab30[_0x9421('0x19')](_0x4b6e57)['send'](_0x5f3abe);};}exports['index']=function(_0x43c082,_0x7170d4){var _0x3877ee={},_0x1e3523={},_0x3a2d8b={'count':0x0,'rows':[]};var _0x1a86eb=_[_0x9421('0x26')](db[_0x9421('0x27')][_0x9421('0x28')],function(_0x5580a7){return{'name':_0x5580a7[_0x9421('0x29')],'type':_0x5580a7[_0x9421('0x2a')][_0x9421('0x2b')]};});_0x1e3523[_0x9421('0x2c')]=_[_0x9421('0x26')](_0x1a86eb,_0x9421('0x25'));_0x1e3523[_0x9421('0x2d')]=_[_0x9421('0x2e')](_0x43c082[_0x9421('0x2d')]);_0x1e3523[_0x9421('0x2f')]=_[_0x9421('0x30')](_0x1e3523['model'],_0x1e3523[_0x9421('0x2d')]);_0x3877ee[_0x9421('0x31')]=_[_0x9421('0x30')](_0x1e3523['model'],qs['fields'](_0x43c082[_0x9421('0x2d')][_0x9421('0x32')]));_0x3877ee[_0x9421('0x31')]=_0x3877ee[_0x9421('0x31')]['length']?_0x3877ee['attributes']:_0x1e3523[_0x9421('0x2c')];if(!_0x43c082[_0x9421('0x2d')][_0x9421('0x33')](_0x9421('0x34'))){_0x3877ee['limit']=qs[_0x9421('0x35')](_0x43c082[_0x9421('0x2d')]['limit']);_0x3877ee[_0x9421('0x1e')]=qs['offset'](_0x43c082['query']['offset']);}_0x3877ee['order']=qs[_0x9421('0x36')](_0x43c082['query'][_0x9421('0x36')]);_0x3877ee[_0x9421('0x37')]=qs[_0x9421('0x2f')](_[_0x9421('0x38')](_0x43c082[_0x9421('0x2d')],_0x1e3523['filters']),_0x1a86eb);if(_0x43c082[_0x9421('0x2d')][_0x9421('0x39')]){_0x3877ee[_0x9421('0x37')]=_['merge'](_0x3877ee['where'],{'$or':_[_0x9421('0x26')](_0x1a86eb,function(_0x539530){if(_0x539530[_0x9421('0x2a')]!==_0x9421('0x3a')){var _0x2c444c={};_0x2c444c[_0x539530[_0x9421('0x25')]]={'$like':'%'+_0x43c082[_0x9421('0x2d')][_0x9421('0x39')]+'%'};return _0x2c444c;}})});}_0x3877ee=_['merge']({},_0x3877ee,_0x43c082['options']);var _0x37a05e={'where':_0x3877ee[_0x9421('0x37')]};return db[_0x9421('0x27')][_0x9421('0x1d')](_0x37a05e)[_0x9421('0x23')](function(_0x62d83c){_0x3a2d8b[_0x9421('0x1d')]=_0x62d83c;if(_0x43c082['query']['includeAll']){_0x3877ee['include']=[{'all':!![]}];}return db[_0x9421('0x27')][_0x9421('0x3b')](_0x3877ee);})[_0x9421('0x23')](function(_0x55c09d){_0x3a2d8b['rows']=_0x55c09d;return _0x3a2d8b;})[_0x9421('0x23')](respondWithFilteredResult(_0x7170d4,_0x3877ee))[_0x9421('0x3c')](handleError(_0x7170d4,null));};exports[_0x9421('0x3d')]=function(_0x3923d1,_0x23508f){var _0xb14c88={'raw':!![],'where':{'id':_0x3923d1[_0x9421('0x3e')]['id']}},_0x25d54e={};_0x25d54e[_0x9421('0x2c')]=_[_0x9421('0x2e')](db[_0x9421('0x27')][_0x9421('0x28')]);_0x25d54e[_0x9421('0x2d')]=_[_0x9421('0x2e')](_0x3923d1[_0x9421('0x2d')]);_0x25d54e['filters']=_[_0x9421('0x30')](_0x25d54e['model'],_0x25d54e[_0x9421('0x2d')]);_0xb14c88['attributes']=_[_0x9421('0x30')](_0x25d54e[_0x9421('0x2c')],qs[_0x9421('0x32')](_0x3923d1[_0x9421('0x2d')][_0x9421('0x32')]));_0xb14c88['attributes']=_0xb14c88['attributes'][_0x9421('0x3f')]?_0xb14c88[_0x9421('0x31')]:_0x25d54e[_0x9421('0x2c')];if(_0x3923d1['query'][_0x9421('0x40')]){_0xb14c88[_0x9421('0x41')]=[{'all':!![]}];}_0xb14c88=_[_0x9421('0x42')]({},_0xb14c88,_0x3923d1[_0x9421('0x43')]);return db['ServicenowField']['find'](_0xb14c88)[_0x9421('0x23')](handleEntityNotFound(_0x23508f,null))[_0x9421('0x23')](respondWithResult(_0x23508f,null))[_0x9421('0x3c')](handleError(_0x23508f,null));};exports[_0x9421('0x44')]=function(_0x19c41c,_0x2e3109){return db[_0x9421('0x27')][_0x9421('0x44')](_0x19c41c[_0x9421('0x45')],{})[_0x9421('0x23')](respondWithResult(_0x2e3109,0xc9))['catch'](handleError(_0x2e3109,null));};exports[_0x9421('0x22')]=function(_0x4422c3,_0x144643){if(_0x4422c3[_0x9421('0x45')]['id']){delete _0x4422c3['body']['id'];}return db[_0x9421('0x27')]['find']({'where':{'id':_0x4422c3['params']['id']}})[_0x9421('0x23')](handleEntityNotFound(_0x144643,null))['then'](saveUpdates(_0x4422c3[_0x9421('0x45')],null))[_0x9421('0x23')](respondWithResult(_0x144643,null))[_0x9421('0x3c')](handleError(_0x144643,null));};exports['destroy']=function(_0x608bdc,_0xa69749){return db[_0x9421('0x27')]['find']({'where':{'id':_0x608bdc['params']['id']}})['then'](handleEntityNotFound(_0xa69749,null))[_0x9421('0x23')](removeEntity(_0xa69749,null))[_0x9421('0x3c')](handleError(_0xa69749,null));};
\ No newline at end of file
index be42877..535638c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1dd4=['idField','FieldId','lodash','api','bluebird','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index'];(function(_0x521862,_0x45930d){var _0x401508=function(_0x465762){while(--_0x465762){_0x521862['push'](_0x521862['shift']());}};_0x401508(++_0x45930d);}(_0x1dd4,0x1e3));var _0x41dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x41dd('0x1'));var moment=require('moment');var BPromise=require(_0x41dd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41dd('0x3'));var rimraf=require(_0x41dd('0x4'));var config=require('../../config/environment');var attributes=require(_0x41dd('0x5'));module[_0x41dd('0x6')]=function(_0x7ad602,_0x353b66){return _0x7ad602[_0x41dd('0x7')](_0x41dd('0x8'),attributes,{'tableName':_0x41dd('0x9'),'paranoid':![],'indexes':[{'name':_0x41dd('0xa'),'fields':[_0x41dd('0xb'),_0x41dd('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe744=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x2b6453,_0xbaeaf){var _0x3fa2dc=function(_0x5225a1){while(--_0x5225a1){_0x2b6453['push'](_0x2b6453['shift']());}};_0x3fa2dc(++_0xbaeaf);}(_0xe744,0x140));var _0x4e74=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe744[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4e74('0x0'));var util=require(_0x4e74('0x1'));var logger=require(_0x4e74('0x2'))(_0x4e74('0x3'));var moment=require(_0x4e74('0x4'));var BPromise=require(_0x4e74('0x5'));var rp=require(_0x4e74('0x6'));var fs=require('fs');var path=require(_0x4e74('0x7'));var rimraf=require('rimraf');var config=require(_0x4e74('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x4e74('0x9')]=function(_0x49e77e,_0x24b30a){return _0x49e77e['define'](_0x4e74('0xa'),attributes,{'tableName':_0x4e74('0xb'),'paranoid':![],'indexes':[{'name':_0x4e74('0xc'),'fields':[_0x4e74('0xd'),_0x4e74('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index b3a339e..7b496cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x125df5,_0x406825){var _0x2d1258=function(_0x29b583){while(--_0x29b583){_0x125df5['push'](_0x125df5['shift']());}};_0x2d1258(++_0x406825);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2c7995,_0x527e77){_0x2c7995=_0x2c7995-0x0;var _0x4e0134=_0xb43b[_0x2c7995];return _0x4e0134;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
+var _0x9bde=['code','message','ServicenowField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x391b24,_0x4eca67){var _0x1da5ea=function(_0x32220b){while(--_0x32220b){_0x391b24['push'](_0x391b24['shift']());}};_0x1da5ea(++_0x4eca67);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1679f3,_0x2bb93e){_0x1679f3=_0x1679f3-0x0;var _0xef27f0=_0x9bde[_0x1679f3];return _0xef27f0;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('ServicenowField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('ServicenowField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
index 385e40d..0f83d70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xc97e1,_0x14726c){var _0x33869b=function(_0x3cef48){while(--_0x3cef48){_0xc97e1['push'](_0xc97e1['shift']());}};_0x33869b(++_0x14726c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _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(_0x5cdd19,_0x2226c9){var _0x101108=function(_0x3c0084){while(--_0x3c0084){_0x5cdd19['push'](_0x5cdd19['shift']());}};_0x101108(++_0x2226c9);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 955d4e6..80bb085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x6a288a,_0x4e0832){var _0x4fe73f=function(_0x226369){while(--_0x226369){_0x6a288a['push'](_0x6a288a['shift']());}};_0x4fe73f(++_0x4e0832);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x20af64,_0x188e9d){var _0xe96fc2=function(_0x5e73a7){while(--_0x5e73a7){_0x20af64['push'](_0x20af64['shift']());}};_0xe96fc2(++_0x188e9d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 ab89434..5d54250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba63=['Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','format','stringify','module_fields','remove','includes','label','endsWith','values','value','test','statusCode','error'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xba63,0xed));var _0x3ba6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xba63[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ba6('0x0'));var zipdir=require(_0x3ba6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3ba6('0x2'));var BPromise=require(_0x3ba6('0x3'));var Mustache=require(_0x3ba6('0x4'));var util=require(_0x3ba6('0x5'));var path=require(_0x3ba6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3ba6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3ba6('0x8'));var squel=require(_0x3ba6('0x9'));var crypto=require(_0x3ba6('0xa'));var jsforce=require(_0x3ba6('0xb'));var deskjs=require(_0x3ba6('0xc'));var toCsv=require(_0x3ba6('0xd'));var querystring=require(_0x3ba6('0xe'));var Papa=require('papaparse');var Redis=require(_0x3ba6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3ba6('0x10'));var hardwareService=require(_0x3ba6('0x11'));var logger=require(_0x3ba6('0x12'))(_0x3ba6('0x13'));var utils=require(_0x3ba6('0x14'));var config=require(_0x3ba6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3ba6('0x16'));function respondWithStatusCode(_0x235538,_0x1b229f){_0x1b229f=_0x1b229f||0xcc;return function(_0x580d55){if(_0x580d55){return _0x235538[_0x3ba6('0x17')](_0x1b229f);}return _0x235538['status'](_0x1b229f)[_0x3ba6('0x18')]();};}function respondWithResult(_0x5e53c3,_0x491f88){_0x491f88=_0x491f88||0xc8;return function(_0x5965b4){if(_0x5965b4){return _0x5e53c3['status'](_0x491f88)['json'](_0x5965b4);}};}function respondWithFilteredResult(_0x3da03e,_0x1d81dd){return function(_0x80cff1){if(_0x80cff1){var _0x5ac79f=typeof _0x1d81dd[_0x3ba6('0x19')]==='undefined'&&typeof _0x1d81dd['limit']===_0x3ba6('0x1a');var _0x1b71b3=_0x80cff1[_0x3ba6('0x1b')];var _0x320dee=_0x5ac79f?0x0:_0x1d81dd[_0x3ba6('0x19')];var _0x10247b=_0x5ac79f?_0x80cff1[_0x3ba6('0x1b')]:_0x1d81dd[_0x3ba6('0x19')]+_0x1d81dd[_0x3ba6('0x1c')];var _0x40b9f1;if(_0x10247b>=_0x1b71b3){_0x10247b=_0x1b71b3;_0x40b9f1=0xc8;}else{_0x40b9f1=0xce;}_0x3da03e[_0x3ba6('0x1d')](_0x40b9f1);return _0x3da03e[_0x3ba6('0x1e')](_0x3ba6('0x1f'),_0x320dee+'-'+_0x10247b+'/'+_0x1b71b3)[_0x3ba6('0x20')](_0x80cff1);}return null;};}function patchUpdates(_0x426afc){return function(_0x10ba61){try{jsonpatch[_0x3ba6('0x21')](_0x10ba61,_0x426afc,!![]);}catch(_0x2f77c6){return BPromise[_0x3ba6('0x22')](_0x2f77c6);}return _0x10ba61[_0x3ba6('0x23')]();};}function saveUpdates(_0x1b4be3,_0x485410){return function(_0x5a7540){if(_0x5a7540){return _0x5a7540[_0x3ba6('0x24')](_0x1b4be3)['then'](function(_0x2db99c){return _0x2db99c;});}return null;};}function removeEntity(_0x4945bc,_0x139e9e){return function(_0x47a5f1){if(_0x47a5f1){return _0x47a5f1['destroy']()[_0x3ba6('0x25')](function(){_0x4945bc['status'](0xcc)[_0x3ba6('0x18')]();});}};}function handleEntityNotFound(_0x3e7388,_0x5b50ee){return function(_0x3a9eb1){if(!_0x3a9eb1){_0x3e7388[_0x3ba6('0x17')](0x194);}return _0x3a9eb1;};}function handleError(_0x42be30,_0x33f4bf){_0x33f4bf=_0x33f4bf||0x1f4;return function(_0x2e6a99){logger['error'](_0x2e6a99[_0x3ba6('0x26')]);if(_0x2e6a99['name']){delete _0x2e6a99[_0x3ba6('0x27')];}_0x42be30['status'](_0x33f4bf)[_0x3ba6('0x28')](_0x2e6a99);};}exports[_0x3ba6('0x29')]=function(_0x3c0a8d,_0x2e11f1){var _0x575ab1={},_0x487cf5={},_0x54442d={'count':0x0,'rows':[]};var _0x513c48=_['map'](db[_0x3ba6('0x2a')][_0x3ba6('0x2b')],function(_0xf7cbce){return{'name':_0xf7cbce[_0x3ba6('0x2c')],'type':_0xf7cbce['type'][_0x3ba6('0x2d')]};});_0x487cf5[_0x3ba6('0x2e')]=_[_0x3ba6('0x2f')](_0x513c48,'name');_0x487cf5[_0x3ba6('0x30')]=_['keys'](_0x3c0a8d[_0x3ba6('0x30')]);_0x487cf5[_0x3ba6('0x31')]=_[_0x3ba6('0x32')](_0x487cf5[_0x3ba6('0x2e')],_0x487cf5[_0x3ba6('0x30')]);_0x575ab1[_0x3ba6('0x33')]=_[_0x3ba6('0x32')](_0x487cf5[_0x3ba6('0x2e')],qs['fields'](_0x3c0a8d[_0x3ba6('0x30')][_0x3ba6('0x34')]));_0x575ab1[_0x3ba6('0x33')]=_0x575ab1[_0x3ba6('0x33')][_0x3ba6('0x35')]?_0x575ab1['attributes']:_0x487cf5[_0x3ba6('0x2e')];if(!_0x3c0a8d[_0x3ba6('0x30')]['hasOwnProperty'](_0x3ba6('0x36'))){_0x575ab1[_0x3ba6('0x1c')]=qs[_0x3ba6('0x1c')](_0x3c0a8d[_0x3ba6('0x30')]['limit']);_0x575ab1['offset']=qs[_0x3ba6('0x19')](_0x3c0a8d[_0x3ba6('0x30')][_0x3ba6('0x19')]);}_0x575ab1[_0x3ba6('0x37')]=qs[_0x3ba6('0x38')](_0x3c0a8d['query'][_0x3ba6('0x38')]);_0x575ab1[_0x3ba6('0x39')]=qs[_0x3ba6('0x31')](_['pick'](_0x3c0a8d[_0x3ba6('0x30')],_0x487cf5[_0x3ba6('0x31')]),_0x513c48);if(_0x3c0a8d[_0x3ba6('0x30')][_0x3ba6('0x3a')]){_0x575ab1[_0x3ba6('0x39')]=_[_0x3ba6('0x3b')](_0x575ab1['where'],{'$or':_[_0x3ba6('0x2f')](_0x513c48,function(_0x3cb2e6){if(_0x3cb2e6[_0x3ba6('0x3c')]!==_0x3ba6('0x3d')){var _0x5b6b18={};_0x5b6b18[_0x3cb2e6[_0x3ba6('0x27')]]={'$like':'%'+_0x3c0a8d['query'][_0x3ba6('0x3a')]+'%'};return _0x5b6b18;}})});}_0x575ab1=_[_0x3ba6('0x3b')]({},_0x575ab1,_0x3c0a8d[_0x3ba6('0x3e')]);var _0x35efb9={'where':_0x575ab1[_0x3ba6('0x39')]};return db['SugarcrmAccount']['count'](_0x35efb9)[_0x3ba6('0x25')](function(_0x2bd8f3){_0x54442d[_0x3ba6('0x1b')]=_0x2bd8f3;if(_0x3c0a8d[_0x3ba6('0x30')][_0x3ba6('0x3f')]){_0x575ab1[_0x3ba6('0x40')]=[{'all':!![]}];}return db[_0x3ba6('0x2a')][_0x3ba6('0x41')](_0x575ab1);})[_0x3ba6('0x25')](function(_0x5516d8){_0x54442d['rows']=_0x5516d8;return _0x54442d;})[_0x3ba6('0x25')](respondWithFilteredResult(_0x2e11f1,_0x575ab1))[_0x3ba6('0x42')](handleError(_0x2e11f1,null));};exports[_0x3ba6('0x43')]=function(_0x54d9d2,_0x434232){var _0x525a2f={'raw':![],'where':{'id':_0x54d9d2[_0x3ba6('0x44')]['id']}},_0x1aad68={};_0x1aad68['model']=_[_0x3ba6('0x45')](db['SugarcrmAccount'][_0x3ba6('0x2b')]);_0x1aad68[_0x3ba6('0x30')]=_['keys'](_0x54d9d2['query']);_0x1aad68[_0x3ba6('0x31')]=_[_0x3ba6('0x32')](_0x1aad68['model'],_0x1aad68[_0x3ba6('0x30')]);_0x525a2f[_0x3ba6('0x33')]=_[_0x3ba6('0x32')](_0x1aad68[_0x3ba6('0x2e')],qs[_0x3ba6('0x34')](_0x54d9d2[_0x3ba6('0x30')][_0x3ba6('0x34')]));_0x525a2f[_0x3ba6('0x33')]=_0x525a2f[_0x3ba6('0x33')][_0x3ba6('0x35')]?_0x525a2f[_0x3ba6('0x33')]:_0x1aad68[_0x3ba6('0x2e')];if(_0x54d9d2[_0x3ba6('0x30')]['includeAll']){_0x525a2f[_0x3ba6('0x40')]=[{'all':!![]}];}_0x525a2f=_[_0x3ba6('0x3b')]({},_0x525a2f,_0x54d9d2['options']);return db['SugarcrmAccount'][_0x3ba6('0x46')](_0x525a2f)[_0x3ba6('0x25')](handleEntityNotFound(_0x434232,null))[_0x3ba6('0x25')](respondWithResult(_0x434232,null))[_0x3ba6('0x42')](handleError(_0x434232,null));};exports[_0x3ba6('0x47')]=function(_0x596e4e,_0xdc1f96){return db[_0x3ba6('0x2a')]['create'](_0x596e4e['body'],{})[_0x3ba6('0x25')](respondWithResult(_0xdc1f96,0xc9))['catch'](handleError(_0xdc1f96,null));};exports[_0x3ba6('0x24')]=function(_0x1b6c76,_0x1251c9){if(_0x1b6c76['body']['id']){delete _0x1b6c76[_0x3ba6('0x48')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x1b6c76[_0x3ba6('0x44')]['id']}})['then'](handleEntityNotFound(_0x1251c9,null))[_0x3ba6('0x25')](saveUpdates(_0x1b6c76[_0x3ba6('0x48')],null))['then'](respondWithResult(_0x1251c9,null))['catch'](handleError(_0x1251c9,null));};exports[_0x3ba6('0x49')]=function(_0x1e57f2,_0x14c03e){return db[_0x3ba6('0x2a')][_0x3ba6('0x46')]({'where':{'id':_0x1e57f2[_0x3ba6('0x44')]['id']}})[_0x3ba6('0x25')](handleEntityNotFound(_0x14c03e,null))[_0x3ba6('0x25')](removeEntity(_0x14c03e,null))['catch'](handleError(_0x14c03e,null));};exports[_0x3ba6('0x4a')]=function(_0x3839d8,_0x22bb11,_0x5521ad){var _0x2769ce={};var _0x527363={};var _0x1528cc;var _0x3b38a8;return db[_0x3ba6('0x2a')][_0x3ba6('0x4b')]({'where':{'id':_0x3839d8[_0x3ba6('0x44')]['id']}})[_0x3ba6('0x25')](handleEntityNotFound(_0x22bb11,null))[_0x3ba6('0x25')](function(_0x24fe47){if(_0x24fe47){_0x1528cc=_0x24fe47;_0x527363[_0x3ba6('0x2e')]=_[_0x3ba6('0x45')](db[_0x3ba6('0x4c')]['rawAttributes']);_0x527363[_0x3ba6('0x30')]=_[_0x3ba6('0x45')](_0x3839d8[_0x3ba6('0x30')]);_0x527363['filters']=_[_0x3ba6('0x32')](_0x527363[_0x3ba6('0x2e')],_0x527363['query']);_0x2769ce[_0x3ba6('0x33')]=_[_0x3ba6('0x32')](_0x527363['model'],qs[_0x3ba6('0x34')](_0x3839d8[_0x3ba6('0x30')][_0x3ba6('0x34')]));_0x2769ce['attributes']=_0x2769ce['attributes'][_0x3ba6('0x35')]?_0x2769ce[_0x3ba6('0x33')]:_0x527363[_0x3ba6('0x2e')];_0x2769ce[_0x3ba6('0x37')]=qs[_0x3ba6('0x38')](_0x3839d8[_0x3ba6('0x30')]['sort']);_0x2769ce[_0x3ba6('0x39')]=qs[_0x3ba6('0x31')](_[_0x3ba6('0x4d')](_0x3839d8['query'],_0x527363[_0x3ba6('0x31')]));if(_0x3839d8[_0x3ba6('0x30')][_0x3ba6('0x3a')]){_0x2769ce['where']=_[_0x3ba6('0x3b')](_0x2769ce[_0x3ba6('0x39')],{'$or':_['map'](_0x2769ce[_0x3ba6('0x33')],function(_0x39008e){var _0x5cace8={};_0x5cace8[_0x39008e]={'$like':'%'+_0x3839d8[_0x3ba6('0x30')][_0x3ba6('0x3a')]+'%'};return _0x5cace8;})});}_0x2769ce=_[_0x3ba6('0x3b')]({},_0x2769ce,_0x3839d8[_0x3ba6('0x3e')]);return _0x1528cc[_0x3ba6('0x4a')](_0x2769ce);}})['then'](function(_0x2fff59){if(_0x2fff59){_0x3b38a8=_0x2fff59[_0x3ba6('0x35')];if(!_0x3839d8[_0x3ba6('0x30')][_0x3ba6('0x4e')](_0x3ba6('0x36'))){_0x2769ce['limit']=qs['limit'](_0x3839d8['query'][_0x3ba6('0x1c')]);_0x2769ce[_0x3ba6('0x19')]=qs[_0x3ba6('0x19')](_0x3839d8[_0x3ba6('0x30')]['offset']);}return _0x1528cc['getConfigurations'](_0x2769ce);}})[_0x3ba6('0x25')](function(_0x4ccffd){if(_0x4ccffd){return _0x4ccffd?{'count':_0x3b38a8,'rows':_0x4ccffd}:null;}})[_0x3ba6('0x25')](respondWithResult(_0x22bb11,null))[_0x3ba6('0x42')](handleError(_0x22bb11,null));};exports['addConfiguration']=function(_0x83e5be,_0x45b937,_0x223d3c){if(_0x83e5be['body']['id']){delete _0x83e5be[_0x3ba6('0x48')]['id'];}return db['SugarcrmAccount'][_0x3ba6('0x4b')]({'where':{'id':_0x83e5be['params']['id']}})[_0x3ba6('0x25')](handleEntityNotFound(_0x45b937,null))['then'](function(_0x2d9832){if(_0x2d9832){_0x83e5be[_0x3ba6('0x48')][_0x3ba6('0x4f')]=_0x2d9832['id'];_0x83e5be[_0x3ba6('0x48')][_0x3ba6('0x50')]=integrations[_0x3ba6('0x51')](_0x83e5be[_0x3ba6('0x48')][_0x3ba6('0x52')],_0x83e5be['body']['type']);_0x83e5be[_0x3ba6('0x48')][_0x3ba6('0x53')]=integrations[_0x3ba6('0x54')](_0x83e5be['body'][_0x3ba6('0x52')],_0x83e5be[_0x3ba6('0x48')]['type']);return db[_0x3ba6('0x4c')][_0x3ba6('0x47')](_0x83e5be[_0x3ba6('0x48')],{'include':[{'model':db[_0x3ba6('0x55')],'as':'Subjects'},{'model':db[_0x3ba6('0x55')],'as':_0x3ba6('0x53')}]});}return null;})[_0x3ba6('0x25')](respondWithResult(_0x45b937,null))[_0x3ba6('0x42')](handleError(_0x45b937,null));};exports[_0x3ba6('0x56')]=function(_0x2bede9,_0x728cc5,_0x4ef78e){var _0x2d9f54='';var _0x394182=['id',_0x3ba6('0x27'),_0x3ba6('0x57'),_0x3ba6('0x58'),'description',_0x3ba6('0x59'),_0x3ba6('0x5a'),_0x3ba6('0x5b'),_0x3ba6('0x5c'),'parent_type','parent_name',_0x3ba6('0x5d')];return db[_0x3ba6('0x2a')]['findOne']({'where':{'id':_0x2bede9['params']['id']},'attributes':['id',_0x3ba6('0x5e'),_0x3ba6('0x5f'),'remoteUri']})['then'](handleEntityNotFound(_0x728cc5,null))['then'](function(_0x22725b){if(_0x22725b){_0x2d9f54=_0x22725b['remoteUri'];var _0x1da4ac=_0x2d9f54['slice'](-0x1);if(_0x1da4ac==='/'){_0x2d9f54=_0x2d9f54[_0x3ba6('0x60')](0x0,_0x2d9f54[_0x3ba6('0x61')](_0x1da4ac));}return rp({'method':_0x3ba6('0x62'),'uri':util['format'](_0x3ba6('0x63'),_0x2d9f54,_0x3ba6('0x64')),'json':!![],'form':{'method':'login','input_type':_0x3ba6('0x65'),'response_type':_0x3ba6('0x65'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x22725b[_0x3ba6('0x5e')],'password':_0x22725b[_0x3ba6('0x5f')],'encryption':_0x3ba6('0x66')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x2d1014){if(_0x2d1014&&_0x2d1014[_0x3ba6('0x27')]!==_0x3ba6('0x67')&&_0x2d1014['name']!==_0x3ba6('0x68')){return rp({'method':_0x3ba6('0x62'),'uri':util[_0x3ba6('0x69')]('%s%s',_0x2d9f54,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x3ba6('0x65'),'response_type':_0x3ba6('0x65'),'rest_data':JSON[_0x3ba6('0x6a')]({'session':_0x2d1014['id'],'module_name':'Calls'})}})[_0x3ba6('0x25')](function(_0x162438){if(_0x162438){var _0x1f2aea=_['values'](_0x162438[_0x3ba6('0x6b')]);_[_0x3ba6('0x6c')](_0x1f2aea,function(_0xc46e8b){return _0x394182[_0x3ba6('0x6d')](_0xc46e8b[_0x3ba6('0x27')]);});return{'count':_0x1f2aea[_0x3ba6('0x35')],'rows':_[_0x3ba6('0x2f')](_0x1f2aea,function(_0x1c9b54){return{'id':_0x1c9b54[_0x3ba6('0x27')],'name':_0x1c9b54[_0x3ba6('0x6e')],'custom':_[_0x3ba6('0x6f')](_0x1c9b54[_0x3ba6('0x27')],'_c')?!![]:![],'options':_0x1c9b54[_0x3ba6('0x3e')]?_[_0x3ba6('0x2f')](_[_0x3ba6('0x70')](_0x1c9b54[_0x3ba6('0x3e')]),function(_0x363f69){return{'name':_0x363f69[_0x3ba6('0x71')],'value':_0x363f69[_0x3ba6('0x27')]};}):[]};})};}})[_0x3ba6('0x25')](respondWithResult(_0x728cc5,null))[_0x3ba6('0x42')](function(_0x464cc0){var _0x45952b=_0x2bede9[_0x3ba6('0x30')][_0x3ba6('0x72')]?0x1f4:_0x464cc0[_0x3ba6('0x73')]||0x1f4;logger[_0x3ba6('0x74')]('getFields,\x20%s,\x20%s,\x20%s',_0x3ba6('0x56'),_0x45952b,JSON['stringify'](_0x464cc0));delete _0x464cc0[_0x3ba6('0x27')];if(_0x45952b===0x191){_0x45952b=0x190;}_0x728cc5[_0x3ba6('0x1d')](_0x45952b)[_0x3ba6('0x28')](_0x2bede9[_0x3ba6('0x30')][_0x3ba6('0x72')]?{'message':_0x3ba6('0x75'),'statusCode':_0x464cc0['statusCode']}:_0x464cc0);});}else{var _0x4daf0b=0x1f4;_0x728cc5[_0x3ba6('0x1d')](_0x4daf0b)[_0x3ba6('0x28')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x51a9=['date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','include','find','create','body','update','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','assigned_user_id','created_by','description'];(function(_0x10bd38,_0x5aea21){var _0x6ac95e=function(_0x50cbaa){while(--_0x50cbaa){_0x10bd38['push'](_0x10bd38['shift']());}};_0x6ac95e(++_0x5aea21);}(_0x51a9,0x10b));var _0x951a=function(_0x4199d0,_0x24c705){_0x4199d0=_0x4199d0-0x0;var _0xb0f6d=_0x51a9[_0x4199d0];return _0xb0f6d;};'use strict';var emlformat=require(_0x951a('0x0'));var rimraf=require(_0x951a('0x1'));var zipdir=require(_0x951a('0x2'));var jsonpatch=require(_0x951a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x951a('0x4'));var util=require('util');var path=require(_0x951a('0x5'));var sox=require(_0x951a('0x6'));var csv=require(_0x951a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x951a('0x8'));var _=require(_0x951a('0x9'));var squel=require(_0x951a('0xa'));var crypto=require('crypto');var jsforce=require(_0x951a('0xb'));var deskjs=require(_0x951a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x951a('0xd'));var authService=require(_0x951a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x951a('0xf'));var logger=require(_0x951a('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x951a('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x951a('0x12'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5ed5ec,_0x436147){_0x436147=_0x436147||0xcc;return function(_0x576103){if(_0x576103){return _0x5ed5ec[_0x951a('0x13')](_0x436147);}return _0x5ed5ec[_0x951a('0x14')](_0x436147)[_0x951a('0x15')]();};}function respondWithResult(_0x47fcae,_0x5ed040){_0x5ed040=_0x5ed040||0xc8;return function(_0x3b9fe4){if(_0x3b9fe4){return _0x47fcae['status'](_0x5ed040)[_0x951a('0x16')](_0x3b9fe4);}};}function respondWithFilteredResult(_0x4e3b78,_0x469df4){return function(_0x1f04bd){if(_0x1f04bd){var _0x2a1d39=typeof _0x469df4[_0x951a('0x17')]==='undefined'&&typeof _0x469df4[_0x951a('0x18')]===_0x951a('0x19');var _0x49b439=_0x1f04bd[_0x951a('0x1a')];var _0x38e817=_0x2a1d39?0x0:_0x469df4[_0x951a('0x17')];var _0x57f6e1=_0x2a1d39?_0x1f04bd[_0x951a('0x1a')]:_0x469df4['offset']+_0x469df4[_0x951a('0x18')];var _0x1b63ef;if(_0x57f6e1>=_0x49b439){_0x57f6e1=_0x49b439;_0x1b63ef=0xc8;}else{_0x1b63ef=0xce;}_0x4e3b78[_0x951a('0x14')](_0x1b63ef);return _0x4e3b78[_0x951a('0x1b')]('Content-Range',_0x38e817+'-'+_0x57f6e1+'/'+_0x49b439)['json'](_0x1f04bd);}return null;};}function patchUpdates(_0x1385fd){return function(_0xb30940){try{jsonpatch[_0x951a('0x1c')](_0xb30940,_0x1385fd,!![]);}catch(_0x53f99a){return BPromise[_0x951a('0x1d')](_0x53f99a);}return _0xb30940[_0x951a('0x1e')]();};}function saveUpdates(_0x1085fe,_0x55f044){return function(_0x4cf4df){if(_0x4cf4df){return _0x4cf4df['update'](_0x1085fe)[_0x951a('0x1f')](function(_0x181180){return _0x181180;});}return null;};}function removeEntity(_0x3b9bce,_0x4ca933){return function(_0x3435ad){if(_0x3435ad){return _0x3435ad['destroy']()['then'](function(){_0x3b9bce[_0x951a('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f227,_0x42128d){return function(_0x290d2d){if(!_0x290d2d){_0x16f227['sendStatus'](0x194);}return _0x290d2d;};}function handleError(_0x45a53c,_0x267c2f){_0x267c2f=_0x267c2f||0x1f4;return function(_0x32216e){logger[_0x951a('0x20')](_0x32216e[_0x951a('0x21')]);if(_0x32216e[_0x951a('0x22')]){delete _0x32216e[_0x951a('0x22')];}_0x45a53c[_0x951a('0x14')](_0x267c2f)[_0x951a('0x23')](_0x32216e);};}exports[_0x951a('0x24')]=function(_0x33ff7a,_0x3f1fe8){var _0x22bef6={},_0x12410f={},_0x1ed677={'count':0x0,'rows':[]};var _0x38ee70=_[_0x951a('0x25')](db[_0x951a('0x26')][_0x951a('0x27')],function(_0x124f28){return{'name':_0x124f28['fieldName'],'type':_0x124f28[_0x951a('0x28')][_0x951a('0x29')]};});_0x12410f['model']=_[_0x951a('0x25')](_0x38ee70,_0x951a('0x22'));_0x12410f[_0x951a('0x2a')]=_['keys'](_0x33ff7a[_0x951a('0x2a')]);_0x12410f[_0x951a('0x2b')]=_[_0x951a('0x2c')](_0x12410f['model'],_0x12410f[_0x951a('0x2a')]);_0x22bef6['attributes']=_[_0x951a('0x2c')](_0x12410f[_0x951a('0x2d')],qs[_0x951a('0x2e')](_0x33ff7a['query']['fields']));_0x22bef6[_0x951a('0x2f')]=_0x22bef6['attributes'][_0x951a('0x30')]?_0x22bef6[_0x951a('0x2f')]:_0x12410f['model'];if(!_0x33ff7a[_0x951a('0x2a')]['hasOwnProperty'](_0x951a('0x31'))){_0x22bef6[_0x951a('0x18')]=qs[_0x951a('0x18')](_0x33ff7a[_0x951a('0x2a')][_0x951a('0x18')]);_0x22bef6[_0x951a('0x17')]=qs[_0x951a('0x17')](_0x33ff7a[_0x951a('0x2a')][_0x951a('0x17')]);}_0x22bef6[_0x951a('0x32')]=qs[_0x951a('0x33')](_0x33ff7a[_0x951a('0x2a')][_0x951a('0x33')]);_0x22bef6[_0x951a('0x34')]=qs['filters'](_[_0x951a('0x35')](_0x33ff7a[_0x951a('0x2a')],_0x12410f[_0x951a('0x2b')]),_0x38ee70);if(_0x33ff7a[_0x951a('0x2a')][_0x951a('0x36')]){_0x22bef6[_0x951a('0x34')]=_[_0x951a('0x37')](_0x22bef6['where'],{'$or':_[_0x951a('0x25')](_0x38ee70,function(_0x5ed2e0){if(_0x5ed2e0[_0x951a('0x28')]!==_0x951a('0x38')){var _0x4b1690={};_0x4b1690[_0x5ed2e0['name']]={'$like':'%'+_0x33ff7a['query'][_0x951a('0x36')]+'%'};return _0x4b1690;}})});}_0x22bef6=_[_0x951a('0x37')]({},_0x22bef6,_0x33ff7a[_0x951a('0x39')]);var _0x4865e5={'where':_0x22bef6[_0x951a('0x34')]};return db[_0x951a('0x26')][_0x951a('0x1a')](_0x4865e5)[_0x951a('0x1f')](function(_0x397489){_0x1ed677[_0x951a('0x1a')]=_0x397489;if(_0x33ff7a[_0x951a('0x2a')][_0x951a('0x3a')]){_0x22bef6['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x951a('0x3b')](_0x22bef6);})[_0x951a('0x1f')](function(_0x337afa){_0x1ed677[_0x951a('0x3c')]=_0x337afa;return _0x1ed677;})['then'](respondWithFilteredResult(_0x3f1fe8,_0x22bef6))[_0x951a('0x3d')](handleError(_0x3f1fe8,null));};exports['show']=function(_0x34979f,_0x4f6208){var _0x50f06e={'raw':![],'where':{'id':_0x34979f[_0x951a('0x3e')]['id']}},_0x2e9554={};_0x2e9554[_0x951a('0x2d')]=_[_0x951a('0x3f')](db[_0x951a('0x26')][_0x951a('0x27')]);_0x2e9554[_0x951a('0x2a')]=_[_0x951a('0x3f')](_0x34979f[_0x951a('0x2a')]);_0x2e9554['filters']=_[_0x951a('0x2c')](_0x2e9554['model'],_0x2e9554[_0x951a('0x2a')]);_0x50f06e[_0x951a('0x2f')]=_[_0x951a('0x2c')](_0x2e9554[_0x951a('0x2d')],qs[_0x951a('0x2e')](_0x34979f[_0x951a('0x2a')][_0x951a('0x2e')]));_0x50f06e[_0x951a('0x2f')]=_0x50f06e[_0x951a('0x2f')][_0x951a('0x30')]?_0x50f06e[_0x951a('0x2f')]:_0x2e9554[_0x951a('0x2d')];if(_0x34979f['query'][_0x951a('0x3a')]){_0x50f06e[_0x951a('0x40')]=[{'all':!![]}];}_0x50f06e=_[_0x951a('0x37')]({},_0x50f06e,_0x34979f[_0x951a('0x39')]);return db['SugarcrmAccount'][_0x951a('0x41')](_0x50f06e)['then'](handleEntityNotFound(_0x4f6208,null))[_0x951a('0x1f')](respondWithResult(_0x4f6208,null))[_0x951a('0x3d')](handleError(_0x4f6208,null));};exports[_0x951a('0x42')]=function(_0x29bf32,_0x3470a2){return db['SugarcrmAccount'][_0x951a('0x42')](_0x29bf32[_0x951a('0x43')],{})[_0x951a('0x1f')](respondWithResult(_0x3470a2,0xc9))[_0x951a('0x3d')](handleError(_0x3470a2,null));};exports[_0x951a('0x44')]=function(_0x403177,_0x25b308){if(_0x403177[_0x951a('0x43')]['id']){delete _0x403177[_0x951a('0x43')]['id'];}return db[_0x951a('0x26')][_0x951a('0x41')]({'where':{'id':_0x403177[_0x951a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x25b308,null))[_0x951a('0x1f')](saveUpdates(_0x403177[_0x951a('0x43')],null))[_0x951a('0x1f')](respondWithResult(_0x25b308,null))['catch'](handleError(_0x25b308,null));};exports['destroy']=function(_0x5896b9,_0x1a9851){return db[_0x951a('0x26')][_0x951a('0x41')]({'where':{'id':_0x5896b9[_0x951a('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1a9851,null))[_0x951a('0x1f')](removeEntity(_0x1a9851,null))[_0x951a('0x3d')](handleError(_0x1a9851,null));};exports[_0x951a('0x45')]=function(_0x8ac9a4,_0x229443,_0x58b77a){var _0xf75d85={};var _0xb9ead8={};var _0x186c13;var _0x81be1d;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x8ac9a4[_0x951a('0x3e')]['id']}})[_0x951a('0x1f')](handleEntityNotFound(_0x229443,null))[_0x951a('0x1f')](function(_0x839c95){if(_0x839c95){_0x186c13=_0x839c95;_0xb9ead8[_0x951a('0x2d')]=_[_0x951a('0x3f')](db['SugarcrmConfiguration']['rawAttributes']);_0xb9ead8[_0x951a('0x2a')]=_[_0x951a('0x3f')](_0x8ac9a4[_0x951a('0x2a')]);_0xb9ead8[_0x951a('0x2b')]=_[_0x951a('0x2c')](_0xb9ead8[_0x951a('0x2d')],_0xb9ead8[_0x951a('0x2a')]);_0xf75d85[_0x951a('0x2f')]=_[_0x951a('0x2c')](_0xb9ead8['model'],qs['fields'](_0x8ac9a4[_0x951a('0x2a')]['fields']));_0xf75d85['attributes']=_0xf75d85[_0x951a('0x2f')][_0x951a('0x30')]?_0xf75d85[_0x951a('0x2f')]:_0xb9ead8['model'];_0xf75d85['order']=qs[_0x951a('0x33')](_0x8ac9a4[_0x951a('0x2a')][_0x951a('0x33')]);_0xf75d85[_0x951a('0x34')]=qs[_0x951a('0x2b')](_[_0x951a('0x35')](_0x8ac9a4['query'],_0xb9ead8[_0x951a('0x2b')]));if(_0x8ac9a4['query'][_0x951a('0x36')]){_0xf75d85[_0x951a('0x34')]=_[_0x951a('0x37')](_0xf75d85[_0x951a('0x34')],{'$or':_[_0x951a('0x25')](_0xf75d85[_0x951a('0x2f')],function(_0x56bb06){var _0x561ddd={};_0x561ddd[_0x56bb06]={'$like':'%'+_0x8ac9a4[_0x951a('0x2a')]['filter']+'%'};return _0x561ddd;})});}_0xf75d85=_['merge']({},_0xf75d85,_0x8ac9a4['options']);return _0x186c13[_0x951a('0x45')](_0xf75d85);}})[_0x951a('0x1f')](function(_0x244e80){if(_0x244e80){_0x81be1d=_0x244e80[_0x951a('0x30')];if(!_0x8ac9a4[_0x951a('0x2a')][_0x951a('0x46')](_0x951a('0x31'))){_0xf75d85[_0x951a('0x18')]=qs[_0x951a('0x18')](_0x8ac9a4[_0x951a('0x2a')][_0x951a('0x18')]);_0xf75d85[_0x951a('0x17')]=qs['offset'](_0x8ac9a4['query'][_0x951a('0x17')]);}return _0x186c13[_0x951a('0x45')](_0xf75d85);}})[_0x951a('0x1f')](function(_0x2f571c){if(_0x2f571c){return _0x2f571c?{'count':_0x81be1d,'rows':_0x2f571c}:null;}})['then'](respondWithResult(_0x229443,null))['catch'](handleError(_0x229443,null));};exports[_0x951a('0x47')]=function(_0x3360ec,_0x1b2ef8,_0x421391){if(_0x3360ec[_0x951a('0x43')]['id']){delete _0x3360ec[_0x951a('0x43')]['id'];}return db[_0x951a('0x26')]['findOne']({'where':{'id':_0x3360ec[_0x951a('0x3e')]['id']}})[_0x951a('0x1f')](handleEntityNotFound(_0x1b2ef8,null))[_0x951a('0x1f')](function(_0xa286a){if(_0xa286a){_0x3360ec[_0x951a('0x43')][_0x951a('0x48')]=_0xa286a['id'];_0x3360ec[_0x951a('0x43')][_0x951a('0x49')]=integrations['getSubjects'](_0x3360ec[_0x951a('0x43')]['channel'],_0x3360ec['body'][_0x951a('0x28')]);_0x3360ec[_0x951a('0x43')][_0x951a('0x4a')]=integrations[_0x951a('0x4b')](_0x3360ec[_0x951a('0x43')]['channel'],_0x3360ec[_0x951a('0x43')][_0x951a('0x28')]);return db[_0x951a('0x4c')]['create'](_0x3360ec[_0x951a('0x43')],{'include':[{'model':db[_0x951a('0x4d')],'as':_0x951a('0x49')},{'model':db[_0x951a('0x4d')],'as':_0x951a('0x4a')}]});}return null;})[_0x951a('0x1f')](respondWithResult(_0x1b2ef8,null))[_0x951a('0x3d')](handleError(_0x1b2ef8,null));};exports['getFields']=function(_0x2a5877,_0xb1e1f1,_0x582135){var _0x5eb7d0='';var _0x4aa253=['id',_0x951a('0x22'),_0x951a('0x4e'),_0x951a('0x4f'),_0x951a('0x50'),_0x951a('0x51'),_0x951a('0x52'),_0x951a('0x53'),_0x951a('0x54'),_0x951a('0x55'),_0x951a('0x56'),_0x951a('0x57')];return db[_0x951a('0x26')][_0x951a('0x58')]({'where':{'id':_0x2a5877[_0x951a('0x3e')]['id']},'attributes':['id',_0x951a('0x59'),_0x951a('0x5a'),_0x951a('0x5b')]})['then'](handleEntityNotFound(_0xb1e1f1,null))[_0x951a('0x1f')](function(_0x495aa2){if(_0x495aa2){_0x5eb7d0=_0x495aa2[_0x951a('0x5b')];var _0x1b33d6=_0x5eb7d0[_0x951a('0x5c')](-0x1);if(_0x1b33d6==='/'){_0x5eb7d0=_0x5eb7d0[_0x951a('0x5d')](0x0,_0x5eb7d0[_0x951a('0x5e')](_0x1b33d6));}return rp({'method':_0x951a('0x5f'),'uri':util['format'](_0x951a('0x60'),_0x5eb7d0,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x951a('0x61'),'input_type':_0x951a('0x62'),'response_type':_0x951a('0x62'),'rest_data':JSON[_0x951a('0x63')]({'user_auth':{'user_name':_0x495aa2[_0x951a('0x59')],'password':_0x495aa2[_0x951a('0x5a')],'encryption':_0x951a('0x64')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x27a18b){if(_0x27a18b&&_0x27a18b[_0x951a('0x22')]!==_0x951a('0x65')&&_0x27a18b[_0x951a('0x22')]!==_0x951a('0x66')){return rp({'method':'POST','uri':util['format'](_0x951a('0x60'),_0x5eb7d0,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x951a('0x67'),'input_type':'JSON','response_type':_0x951a('0x62'),'rest_data':JSON['stringify']({'session':_0x27a18b['id'],'module_name':_0x951a('0x68')})}})['then'](function(_0x170921){if(_0x170921){var _0x3563a9=_[_0x951a('0x69')](_0x170921[_0x951a('0x6a')]);_['remove'](_0x3563a9,function(_0x25792a){return _0x4aa253[_0x951a('0x6b')](_0x25792a[_0x951a('0x22')]);});return{'count':_0x3563a9[_0x951a('0x30')],'rows':_[_0x951a('0x25')](_0x3563a9,function(_0x20e992){return{'id':_0x20e992[_0x951a('0x22')],'name':_0x20e992[_0x951a('0x6c')],'custom':_[_0x951a('0x6d')](_0x20e992['name'],'_c')?!![]:![],'options':_0x20e992[_0x951a('0x39')]?_[_0x951a('0x25')](_[_0x951a('0x69')](_0x20e992[_0x951a('0x39')]),function(_0x130353){return{'name':_0x130353[_0x951a('0x6e')],'value':_0x130353[_0x951a('0x22')]};}):[]};})};}})['then'](respondWithResult(_0xb1e1f1,null))[_0x951a('0x3d')](function(_0x368274){var _0x1b9c9c=_0x2a5877[_0x951a('0x2a')][_0x951a('0x6f')]?0x1f4:_0x368274['statusCode']||0x1f4;logger['error'](_0x951a('0x70'),_0x951a('0x71'),_0x1b9c9c,JSON[_0x951a('0x63')](_0x368274));delete _0x368274['name'];if(_0x1b9c9c===0x191){_0x1b9c9c=0x190;}_0xb1e1f1['status'](_0x1b9c9c)[_0x951a('0x23')](_0x2a5877[_0x951a('0x2a')][_0x951a('0x6f')]?{'message':_0x951a('0x72'),'statusCode':_0x368274[_0x951a('0x73')]}:_0x368274);});}else{var _0x3e1a3d=0x1f4;_0xb1e1f1['status'](_0x3e1a3d)[_0x951a('0x23')]({'message':_0x951a('0x72'),'statusCode':0x190});}});};
\ No newline at end of file
index 81b0824..dfbf462 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7757=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x499aab,_0x79ef10){var _0x1174b1=function(_0x2625eb){while(--_0x2625eb){_0x499aab['push'](_0x499aab['shift']());}};_0x1174b1(++_0x79ef10);}(_0x7757,0x12b));var _0x7775=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x7757[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x7775('0x0'));var logger=require(_0x7775('0x1'))(_0x7775('0x2'));var moment=require(_0x7775('0x3'));var BPromise=require(_0x7775('0x4'));var rp=require(_0x7775('0x5'));var fs=require('fs');var path=require(_0x7775('0x6'));var rimraf=require(_0x7775('0x7'));var config=require('../../config/environment');var attributes=require(_0x7775('0x8'));var integrations=require(_0x7775('0x9'));module['exports']=function(_0x433ca8,_0xee7bdf){return _0x433ca8[_0x7775('0xa')](_0x7775('0xb'),attributes,{'tableName':_0x7775('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f48=['rimraf','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x4af23c,_0x50e294){var _0x194b63=function(_0x44f871){while(--_0x44f871){_0x4af23c['push'](_0x4af23c['shift']());}};_0x194b63(++_0x50e294);}(_0x3f48,0x17c));var _0x83f4=function(_0xeb1d70,_0x554bcc){_0xeb1d70=_0xeb1d70-0x0;var _0x391f38=_0x3f48[_0xeb1d70];return _0x391f38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x83f4('0x0'))(_0x83f4('0x1'));var moment=require(_0x83f4('0x2'));var BPromise=require(_0x83f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x83f4('0x4'));var rimraf=require(_0x83f4('0x5'));var config=require('../../config/environment');var attributes=require(_0x83f4('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x83f4('0x7')]=function(_0x6cca1b,_0x3898cf){return _0x6cca1b[_0x83f4('0x8')](_0x83f4('0x9'),attributes,{'tableName':_0x83f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a19de95..89a2dde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1e6=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSugarcrmAccount','options','raw','attributes','limit','include','map','model','info','stringify','SugarcrmAccount','find','ShowSugarcrmAccount','util','moment'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xc1e6,0x1ed));var _0x6c1e=function(_0x2b9e7b,_0x2bc62b){_0x2b9e7b=_0x2b9e7b-0x0;var _0x371601=_0xc1e6[_0x2b9e7b];return _0x371601;};'use strict';var _=require('lodash');var util=require(_0x6c1e('0x0'));var moment=require(_0x6c1e('0x1'));var BPromise=require(_0x6c1e('0x2'));var rs=require(_0x6c1e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1e('0x4'))['db'];var utils=require(_0x6c1e('0x5'));var logger=require(_0x6c1e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1e('0x7'));var client=jayson[_0x6c1e('0x8')][_0x6c1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b5e31,_0x495d0b,_0x15e161){return new BPromise(function(_0x147ccb,_0x1661c2){return client[_0x6c1e('0xa')](_0x5b5e31,_0x15e161)[_0x6c1e('0xb')](function(_0x669bde){logger['info'](_0x6c1e('0xc'),_0x495d0b,_0x6c1e('0xd'));logger[_0x6c1e('0xe')](_0x6c1e('0xf'),_0x495d0b,_0x6c1e('0xd'),JSON['stringify'](_0x669bde));if(_0x669bde[_0x6c1e('0x10')]){if(_0x669bde[_0x6c1e('0x10')][_0x6c1e('0x11')]===0x1f4){logger[_0x6c1e('0x10')](_0x6c1e('0xc'),_0x495d0b,_0x669bde[_0x6c1e('0x10')]['message']);return _0x1661c2(_0x669bde[_0x6c1e('0x10')][_0x6c1e('0x12')]);}logger[_0x6c1e('0x10')](_0x6c1e('0xc'),_0x495d0b,_0x669bde[_0x6c1e('0x10')][_0x6c1e('0x12')]);return _0x147ccb(_0x669bde[_0x6c1e('0x10')]['message']);}else{logger['info'](_0x6c1e('0xc'),_0x495d0b,'request\x20sent');_0x147ccb(_0x669bde['result'][_0x6c1e('0x12')]);}})[_0x6c1e('0x13')](function(_0x34bc94){logger[_0x6c1e('0x10')](_0x6c1e('0xc'),_0x495d0b,_0x34bc94);_0x1661c2(_0x34bc94);});});}exports[_0x6c1e('0x14')]=function(_0x449319){var _0x37fa36=this;return new Promise(function(_0x26ff3f,_0x39e140){return db['SugarcrmAccount']['findAll']({'raw':_0x449319[_0x6c1e('0x15')]?_0x449319[_0x6c1e('0x15')][_0x6c1e('0x16')]===undefined?!![]:![]:!![],'where':_0x449319['options']?_0x449319[_0x6c1e('0x15')]['where']||null:null,'attributes':_0x449319['options']?_0x449319['options'][_0x6c1e('0x17')]||null:null,'limit':_0x449319[_0x6c1e('0x15')]?_0x449319[_0x6c1e('0x15')][_0x6c1e('0x18')]||null:null,'include':_0x449319[_0x6c1e('0x15')]?_0x449319[_0x6c1e('0x15')][_0x6c1e('0x19')]?_[_0x6c1e('0x1a')](_0x449319['options'][_0x6c1e('0x19')],function(_0xca4ed0){return{'model':db[_0xca4ed0['model']],'as':_0xca4ed0['as'],'attributes':_0xca4ed0[_0x6c1e('0x17')],'include':_0xca4ed0[_0x6c1e('0x19')]?_['map'](_0xca4ed0[_0x6c1e('0x19')],function(_0x1a9f86){return{'model':db[_0x1a9f86[_0x6c1e('0x1b')]],'as':_0x1a9f86['as'],'attributes':_0x1a9f86['attributes'],'include':_0x1a9f86[_0x6c1e('0x19')]?_[_0x6c1e('0x1a')](_0x1a9f86[_0x6c1e('0x19')],function(_0x179db7){return{'model':db[_0x179db7[_0x6c1e('0x1b')]],'as':_0x179db7['as'],'attributes':_0x179db7[_0x6c1e('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x304609){logger[_0x6c1e('0x1c')](_0x6c1e('0x14'),_0x449319);logger[_0x6c1e('0xe')](_0x6c1e('0x14'),_0x449319,JSON[_0x6c1e('0x1d')](_0x304609));_0x26ff3f(_0x304609);})['catch'](function(_0x256a1c){logger[_0x6c1e('0x10')](_0x6c1e('0x14'),_0x256a1c[_0x6c1e('0x12')],_0x449319);_0x39e140(_0x37fa36[_0x6c1e('0x10')](0x1f4,_0x256a1c[_0x6c1e('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2f2772){var _0xae258a=this;return new Promise(function(_0x2102db,_0xac4ab4){return db[_0x6c1e('0x1e')][_0x6c1e('0x1f')]({'raw':_0x2f2772[_0x6c1e('0x15')]?_0x2f2772[_0x6c1e('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2f2772[_0x6c1e('0x15')]?_0x2f2772[_0x6c1e('0x15')]['where']||null:null,'attributes':_0x2f2772[_0x6c1e('0x15')]?_0x2f2772[_0x6c1e('0x15')][_0x6c1e('0x17')]||null:null,'include':_0x2f2772[_0x6c1e('0x15')]?_0x2f2772[_0x6c1e('0x15')][_0x6c1e('0x19')]?_[_0x6c1e('0x1a')](_0x2f2772['options'][_0x6c1e('0x19')],function(_0x181b9c){return{'model':db[_0x181b9c['model']],'as':_0x181b9c['as'],'attributes':_0x181b9c[_0x6c1e('0x17')],'include':_0x181b9c[_0x6c1e('0x19')]?_[_0x6c1e('0x1a')](_0x181b9c[_0x6c1e('0x19')],function(_0x1cb2d9){return{'model':db[_0x1cb2d9[_0x6c1e('0x1b')]],'as':_0x1cb2d9['as'],'attributes':_0x1cb2d9['attributes'],'include':_0x1cb2d9[_0x6c1e('0x19')]?_[_0x6c1e('0x1a')](_0x1cb2d9[_0x6c1e('0x19')],function(_0x4d9f8f){return{'model':db[_0x4d9f8f[_0x6c1e('0x1b')]],'as':_0x4d9f8f['as'],'attributes':_0x4d9f8f[_0x6c1e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6c1e('0xb')](function(_0x597691){logger[_0x6c1e('0x1c')]('ShowSugarcrmAccount',_0x2f2772);logger[_0x6c1e('0xe')](_0x6c1e('0x20'),_0x2f2772,JSON[_0x6c1e('0x1d')](_0x597691));_0x2102db(_0x597691);})['catch'](function(_0x3eb41b){logger['error'](_0x6c1e('0x20'),_0x3eb41b[_0x6c1e('0x12')],_0x2f2772);_0xac4ab4(_0xae258a['error'](0x1f4,_0x3eb41b[_0x6c1e('0x12')]));});});};
\ No newline at end of file
+var _0xe5f7=['attributes','limit','include','map','model','GetSugarcrmAccount','find','info','ShowSugarcrmAccount','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','SugarcrmAccount','raw','options','where'];(function(_0x51bda1,_0x44f80d){var _0x1ce08c=function(_0x5b788e){while(--_0x5b788e){_0x51bda1['push'](_0x51bda1['shift']());}};_0x1ce08c(++_0x44f80d);}(_0xe5f7,0x180));var _0x7e5f=function(_0x52c0b2,_0x4ab850){_0x52c0b2=_0x52c0b2-0x0;var _0x4d5993=_0xe5f7[_0x52c0b2];return _0x4d5993;};'use strict';var _=require(_0x7e5f('0x0'));var util=require(_0x7e5f('0x1'));var moment=require(_0x7e5f('0x2'));var BPromise=require(_0x7e5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e5f('0x4'))['db'];var utils=require(_0x7e5f('0x5'));var logger=require('../../config/logger')(_0x7e5f('0x6'));var config=require(_0x7e5f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7e5f('0x8')][_0x7e5f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d506b,_0x5b7f38,_0x3f53ed){return new BPromise(function(_0x533746,_0x3d1006){return client['request'](_0x4d506b,_0x3f53ed)[_0x7e5f('0xa')](function(_0x3660e1){logger['info'](_0x7e5f('0xb'),_0x5b7f38,_0x7e5f('0xc'));logger[_0x7e5f('0xd')](_0x7e5f('0xe'),_0x5b7f38,_0x7e5f('0xc'),JSON['stringify'](_0x3660e1));if(_0x3660e1[_0x7e5f('0xf')]){if(_0x3660e1[_0x7e5f('0xf')][_0x7e5f('0x10')]===0x1f4){logger[_0x7e5f('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x5b7f38,_0x3660e1[_0x7e5f('0xf')][_0x7e5f('0x11')]);return _0x3d1006(_0x3660e1[_0x7e5f('0xf')]['message']);}logger[_0x7e5f('0xf')](_0x7e5f('0xb'),_0x5b7f38,_0x3660e1[_0x7e5f('0xf')][_0x7e5f('0x11')]);return _0x533746(_0x3660e1[_0x7e5f('0xf')][_0x7e5f('0x11')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x5b7f38,_0x7e5f('0xc'));_0x533746(_0x3660e1[_0x7e5f('0x12')]['message']);}})[_0x7e5f('0x13')](function(_0x480327){logger['error'](_0x7e5f('0xb'),_0x5b7f38,_0x480327);_0x3d1006(_0x480327);});});}exports['GetSugarcrmAccount']=function(_0x4de5da){var _0xcd12db=this;return new Promise(function(_0x4bc95e,_0x194db1){return db[_0x7e5f('0x14')]['findAll']({'raw':_0x4de5da['options']?_0x4de5da['options'][_0x7e5f('0x15')]===undefined?!![]:![]:!![],'where':_0x4de5da[_0x7e5f('0x16')]?_0x4de5da[_0x7e5f('0x16')][_0x7e5f('0x17')]||null:null,'attributes':_0x4de5da[_0x7e5f('0x16')]?_0x4de5da[_0x7e5f('0x16')][_0x7e5f('0x18')]||null:null,'limit':_0x4de5da['options']?_0x4de5da[_0x7e5f('0x16')][_0x7e5f('0x19')]||null:null,'include':_0x4de5da[_0x7e5f('0x16')]?_0x4de5da['options'][_0x7e5f('0x1a')]?_[_0x7e5f('0x1b')](_0x4de5da[_0x7e5f('0x16')][_0x7e5f('0x1a')],function(_0x38359d){return{'model':db[_0x38359d[_0x7e5f('0x1c')]],'as':_0x38359d['as'],'attributes':_0x38359d[_0x7e5f('0x18')],'include':_0x38359d[_0x7e5f('0x1a')]?_[_0x7e5f('0x1b')](_0x38359d['include'],function(_0x245b70){return{'model':db[_0x245b70[_0x7e5f('0x1c')]],'as':_0x245b70['as'],'attributes':_0x245b70[_0x7e5f('0x18')],'include':_0x245b70[_0x7e5f('0x1a')]?_['map'](_0x245b70[_0x7e5f('0x1a')],function(_0x1079d9){return{'model':db[_0x1079d9['model']],'as':_0x1079d9['as'],'attributes':_0x1079d9[_0x7e5f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e5f('0xa')](function(_0x2f1612){logger['info'](_0x7e5f('0x1d'),_0x4de5da);logger[_0x7e5f('0xd')](_0x7e5f('0x1d'),_0x4de5da,JSON['stringify'](_0x2f1612));_0x4bc95e(_0x2f1612);})[_0x7e5f('0x13')](function(_0x5c04af){logger['error'](_0x7e5f('0x1d'),_0x5c04af[_0x7e5f('0x11')],_0x4de5da);_0x194db1(_0xcd12db['error'](0x1f4,_0x5c04af[_0x7e5f('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0xfa0ee0){var _0x52bc9e=this;return new Promise(function(_0x220197,_0x4c56f8){return db['SugarcrmAccount'][_0x7e5f('0x1e')]({'raw':_0xfa0ee0[_0x7e5f('0x16')]?_0xfa0ee0[_0x7e5f('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xfa0ee0[_0x7e5f('0x16')]?_0xfa0ee0[_0x7e5f('0x16')][_0x7e5f('0x17')]||null:null,'attributes':_0xfa0ee0[_0x7e5f('0x16')]?_0xfa0ee0['options'][_0x7e5f('0x18')]||null:null,'include':_0xfa0ee0['options']?_0xfa0ee0[_0x7e5f('0x16')][_0x7e5f('0x1a')]?_[_0x7e5f('0x1b')](_0xfa0ee0[_0x7e5f('0x16')][_0x7e5f('0x1a')],function(_0x1c84d5){return{'model':db[_0x1c84d5['model']],'as':_0x1c84d5['as'],'attributes':_0x1c84d5[_0x7e5f('0x18')],'include':_0x1c84d5[_0x7e5f('0x1a')]?_['map'](_0x1c84d5[_0x7e5f('0x1a')],function(_0x23eaf7){return{'model':db[_0x23eaf7[_0x7e5f('0x1c')]],'as':_0x23eaf7['as'],'attributes':_0x23eaf7[_0x7e5f('0x18')],'include':_0x23eaf7['include']?_[_0x7e5f('0x1b')](_0x23eaf7[_0x7e5f('0x1a')],function(_0x4a64ca){return{'model':db[_0x4a64ca['model']],'as':_0x4a64ca['as'],'attributes':_0x4a64ca[_0x7e5f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e5f('0xa')](function(_0x2be5db){logger[_0x7e5f('0x1f')](_0x7e5f('0x20'),_0xfa0ee0);logger[_0x7e5f('0xd')](_0x7e5f('0x20'),_0xfa0ee0,JSON[_0x7e5f('0x21')](_0x2be5db));_0x220197(_0x2be5db);})[_0x7e5f('0x13')](function(_0x3c198e){logger[_0x7e5f('0xf')](_0x7e5f('0x20'),_0x3c198e[_0x7e5f('0x11')],_0xfa0ee0);_0x4c56f8(_0x52bc9e[_0x7e5f('0xf')](0x1f4,_0x3c198e[_0x7e5f('0x11')]));});});};
\ No newline at end of file
index d104a28..f9d3000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd19=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','path'];(function(_0x53c918,_0x543915){var _0x302843=function(_0x410487){while(--_0x410487){_0x53c918['push'](_0x53c918['shift']());}};_0x302843(++_0x543915);}(_0xbd19,0xcd));var _0x9bd1=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xbd19[_0x616290];return _0x453879;};'use strict';var multer=require('multer');var util=require(_0x9bd1('0x0'));var path=require(_0x9bd1('0x1'));var timeout=require(_0x9bd1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9bd1('0x3'));var auth=require(_0x9bd1('0x4'));var interaction=require(_0x9bd1('0x5'));var config=require(_0x9bd1('0x6'));var controller=require(_0x9bd1('0x7'));router[_0x9bd1('0x8')]('/',auth[_0x9bd1('0x9')](),controller[_0x9bd1('0xa')]);router[_0x9bd1('0x8')](_0x9bd1('0xb'),auth[_0x9bd1('0x9')](),controller['show']);router[_0x9bd1('0x8')](_0x9bd1('0xc'),auth['isAuthenticated'](),controller[_0x9bd1('0xd')]);router['get'](_0x9bd1('0xe'),auth[_0x9bd1('0x9')](),controller['getSubjects']);router['get'](_0x9bd1('0xf'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0x10')]);router['post']('/',auth[_0x9bd1('0x9')](),controller[_0x9bd1('0x11')]);router[_0x9bd1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9bd1('0x13')]);router[_0x9bd1('0x14')](_0x9bd1('0xb'),auth[_0x9bd1('0x9')](),controller[_0x9bd1('0x15')]);module[_0x9bd1('0x16')]=router;
\ No newline at end of file
+var _0x3d2f=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x52aa8e,_0x47039c){var _0x9ddec=function(_0x1100a7){while(--_0x1100a7){_0x52aa8e['push'](_0x52aa8e['shift']());}};_0x9ddec(++_0x47039c);}(_0x3d2f,0x187));var _0xf3d2=function(_0x218b1e,_0x1bc20e){_0x218b1e=_0x218b1e-0x0;var _0xc5f70f=_0x3d2f[_0x218b1e];return _0xc5f70f;};'use strict';var multer=require('multer');var util=require(_0xf3d2('0x0'));var path=require(_0xf3d2('0x1'));var timeout=require('connect-timeout');var express=require(_0xf3d2('0x2'));var router=express['Router']();var fs_extra=require(_0xf3d2('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf3d2('0x4'));var config=require(_0xf3d2('0x5'));var controller=require(_0xf3d2('0x6'));router[_0xf3d2('0x7')]('/',auth[_0xf3d2('0x8')](),controller[_0xf3d2('0x9')]);router[_0xf3d2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf3d2('0xa')]);router[_0xf3d2('0x7')]('/:id/fields',auth[_0xf3d2('0x8')](),controller[_0xf3d2('0xb')]);router[_0xf3d2('0x7')](_0xf3d2('0xc'),auth[_0xf3d2('0x8')](),controller[_0xf3d2('0xd')]);router[_0xf3d2('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf3d2('0xe')]);router[_0xf3d2('0xf')]('/',auth[_0xf3d2('0x8')](),controller[_0xf3d2('0x10')]);router[_0xf3d2('0x11')](_0xf3d2('0x12'),auth['isAuthenticated'](),controller[_0xf3d2('0x13')]);router[_0xf3d2('0x14')](_0xf3d2('0x12'),auth[_0xf3d2('0x8')](),controller[_0xf3d2('0x15')]);module[_0xf3d2('0x16')]=router;
\ No newline at end of file
index 0caa91f..652feb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x248f=['STRING','sequelize','exports'];(function(_0x429c0c,_0x560f5b){var _0x45c8a5=function(_0xf23261){while(--_0xf23261){_0x429c0c['push'](_0x429c0c['shift']());}};_0x45c8a5(++_0x560f5b);}(_0x248f,0x10f));var _0xf248=function(_0x1dbbe4,_0x38f65c){_0x1dbbe4=_0x1dbbe4-0x0;var _0x148de1=_0x248f[_0x1dbbe4];return _0x148de1;};'use strict';var Sequelize=require(_0xf248('0x0'));module[_0xf248('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf248('0x2')]}};
\ No newline at end of file
+var _0x35fe=['exports','STRING','sequelize'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x35fe,0x6b));var _0xe35f=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0x35fe[_0x30faec];return _0x29484f;};'use strict';var Sequelize=require(_0xe35f('0x0'));module[_0xe35f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe35f('0x2')]}};
\ No newline at end of file
index 18b2a33..da3df7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9999=['eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','SugarcrmField','filter','getFields','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions'];(function(_0x23be51,_0xc02a1b){var _0x47a26d=function(_0xa92395){while(--_0xa92395){_0x23be51['push'](_0x23be51['shift']());}};_0x47a26d(++_0xc02a1b);}(_0x9999,0xe7));var _0x9999=function(_0x558e03,_0x477deb){_0x558e03=_0x558e03-0x0;var _0x431bdb=_0x9999[_0x558e03];return _0x431bdb;};'use strict';var emlformat=require(_0x9999('0x0'));var rimraf=require(_0x9999('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9999('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9999('0x3'));var util=require(_0x9999('0x4'));var path=require('path');var sox=require(_0x9999('0x5'));var csv=require(_0x9999('0x6'));var ejs=require(_0x9999('0x7'));var fs=require('fs');var fs_extra=require(_0x9999('0x8'));var _=require(_0x9999('0x9'));var squel=require(_0x9999('0xa'));var crypto=require(_0x9999('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9999('0xc'));var toCsv=require(_0x9999('0x6'));var querystring=require(_0x9999('0xd'));var Papa=require(_0x9999('0xe'));var Redis=require(_0x9999('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9999('0x10'));var hardwareService=require(_0x9999('0x11'));var logger=require(_0x9999('0x12'))(_0x9999('0x13'));var utils=require(_0x9999('0x14'));var config=require(_0x9999('0x15'));var licenseUtil=require(_0x9999('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58ec09,_0x465219){_0x465219=_0x465219||0xcc;return function(_0x4e3d94){if(_0x4e3d94){return _0x58ec09[_0x9999('0x17')](_0x465219);}return _0x58ec09[_0x9999('0x18')](_0x465219)[_0x9999('0x19')]();};}function respondWithResult(_0x4b49f6,_0x317f68){_0x317f68=_0x317f68||0xc8;return function(_0x2f6339){if(_0x2f6339){return _0x4b49f6[_0x9999('0x18')](_0x317f68)[_0x9999('0x1a')](_0x2f6339);}};}function respondWithFilteredResult(_0x310cbf,_0x254abc){return function(_0x25b157){if(_0x25b157){var _0x29a14f=typeof _0x254abc[_0x9999('0x1b')]==='undefined'&&typeof _0x254abc[_0x9999('0x1c')]==='undefined';var _0x29033e=_0x25b157[_0x9999('0x1d')];var _0x311d30=_0x29a14f?0x0:_0x254abc['offset'];var _0x439e16=_0x29a14f?_0x25b157[_0x9999('0x1d')]:_0x254abc[_0x9999('0x1b')]+_0x254abc[_0x9999('0x1c')];var _0x54d64;if(_0x439e16>=_0x29033e){_0x439e16=_0x29033e;_0x54d64=0xc8;}else{_0x54d64=0xce;}_0x310cbf['status'](_0x54d64);return _0x310cbf['set'](_0x9999('0x1e'),_0x311d30+'-'+_0x439e16+'/'+_0x29033e)[_0x9999('0x1a')](_0x25b157);}return null;};}function patchUpdates(_0x2a96d8){return function(_0x412c63){try{jsonpatch[_0x9999('0x1f')](_0x412c63,_0x2a96d8,!![]);}catch(_0x1b658b){return BPromise[_0x9999('0x20')](_0x1b658b);}return _0x412c63['save']();};}function saveUpdates(_0x43fc36,_0x54de54){return function(_0x1ecb44){if(_0x1ecb44){return _0x1ecb44[_0x9999('0x21')](_0x43fc36)[_0x9999('0x22')](function(_0x4d5365){return _0x4d5365;});}return null;};}function removeEntity(_0x5bcde0,_0x1c7c8c){return function(_0x2a92b){if(_0x2a92b){return _0x2a92b['destroy']()[_0x9999('0x22')](function(){_0x5bcde0[_0x9999('0x18')](0xcc)[_0x9999('0x19')]();});}};}function handleEntityNotFound(_0x169408,_0x147dde){return function(_0x47f8f6){if(!_0x47f8f6){_0x169408['sendStatus'](0x194);}return _0x47f8f6;};}function handleError(_0x3ac8ea,_0x19bfe4){_0x19bfe4=_0x19bfe4||0x1f4;return function(_0x1cad5c){logger[_0x9999('0x23')](_0x1cad5c[_0x9999('0x24')]);if(_0x1cad5c[_0x9999('0x25')]){delete _0x1cad5c[_0x9999('0x25')];}_0x3ac8ea['status'](_0x19bfe4)[_0x9999('0x26')](_0x1cad5c);};}exports['index']=function(_0x496859,_0x5aa22d){var _0x1d54a2={},_0x4e7f41={},_0x2090ba={'count':0x0,'rows':[]};var _0x243a9b=_[_0x9999('0x27')](db[_0x9999('0x28')][_0x9999('0x29')],function(_0x1eaaad){return{'name':_0x1eaaad[_0x9999('0x2a')],'type':_0x1eaaad['type'][_0x9999('0x2b')]};});_0x4e7f41[_0x9999('0x2c')]=_[_0x9999('0x27')](_0x243a9b,'name');_0x4e7f41[_0x9999('0x2d')]=_[_0x9999('0x2e')](_0x496859[_0x9999('0x2d')]);_0x4e7f41[_0x9999('0x2f')]=_['intersection'](_0x4e7f41['model'],_0x4e7f41[_0x9999('0x2d')]);_0x1d54a2[_0x9999('0x30')]=_[_0x9999('0x31')](_0x4e7f41[_0x9999('0x2c')],qs[_0x9999('0x32')](_0x496859['query']['fields']));_0x1d54a2[_0x9999('0x30')]=_0x1d54a2[_0x9999('0x30')]['length']?_0x1d54a2[_0x9999('0x30')]:_0x4e7f41[_0x9999('0x2c')];if(!_0x496859['query']['hasOwnProperty']('nolimit')){_0x1d54a2[_0x9999('0x1c')]=qs['limit'](_0x496859[_0x9999('0x2d')]['limit']);_0x1d54a2[_0x9999('0x1b')]=qs['offset'](_0x496859[_0x9999('0x2d')][_0x9999('0x1b')]);}_0x1d54a2[_0x9999('0x33')]=qs['sort'](_0x496859[_0x9999('0x2d')][_0x9999('0x34')]);_0x1d54a2['where']=qs[_0x9999('0x2f')](_[_0x9999('0x35')](_0x496859['query'],_0x4e7f41[_0x9999('0x2f')]),_0x243a9b);if(_0x496859[_0x9999('0x2d')]['filter']){_0x1d54a2[_0x9999('0x36')]=_['merge'](_0x1d54a2['where'],{'$or':_[_0x9999('0x27')](_0x243a9b,function(_0x4ab89b){if(_0x4ab89b[_0x9999('0x37')]!==_0x9999('0x38')){var _0x4485a6={};_0x4485a6[_0x4ab89b[_0x9999('0x25')]]={'$like':'%'+_0x496859[_0x9999('0x2d')]['filter']+'%'};return _0x4485a6;}})});}_0x1d54a2=_[_0x9999('0x39')]({},_0x1d54a2,_0x496859[_0x9999('0x3a')]);var _0x4e504d={'where':_0x1d54a2[_0x9999('0x36')]};return db[_0x9999('0x28')]['count'](_0x4e504d)['then'](function(_0x5d7de7){_0x2090ba['count']=_0x5d7de7;if(_0x496859['query'][_0x9999('0x3b')]){_0x1d54a2[_0x9999('0x3c')]=[{'all':!![]}];}return db[_0x9999('0x28')][_0x9999('0x3d')](_0x1d54a2);})[_0x9999('0x22')](function(_0x12ac7c){_0x2090ba[_0x9999('0x3e')]=_0x12ac7c;return _0x2090ba;})[_0x9999('0x22')](respondWithFilteredResult(_0x5aa22d,_0x1d54a2))[_0x9999('0x3f')](handleError(_0x5aa22d,null));};exports['show']=function(_0x603c84,_0x4cfd17){var _0x4db274={'raw':![],'where':{'id':_0x603c84[_0x9999('0x40')]['id']}},_0x23c6fe={};_0x23c6fe[_0x9999('0x2c')]=_[_0x9999('0x2e')](db[_0x9999('0x28')]['rawAttributes']);_0x23c6fe[_0x9999('0x2d')]=_[_0x9999('0x2e')](_0x603c84[_0x9999('0x2d')]);_0x23c6fe[_0x9999('0x2f')]=_['intersection'](_0x23c6fe[_0x9999('0x2c')],_0x23c6fe[_0x9999('0x2d')]);_0x4db274[_0x9999('0x30')]=_['intersection'](_0x23c6fe[_0x9999('0x2c')],qs[_0x9999('0x32')](_0x603c84[_0x9999('0x2d')][_0x9999('0x32')]));_0x4db274['attributes']=_0x4db274[_0x9999('0x30')][_0x9999('0x41')]?_0x4db274[_0x9999('0x30')]:_0x23c6fe[_0x9999('0x2c')];if(_0x603c84['query'][_0x9999('0x3b')]){_0x4db274['include']=[{'all':!![]}];}_0x4db274=_['merge']({},_0x4db274,_0x603c84[_0x9999('0x3a')]);return db[_0x9999('0x28')]['find'](_0x4db274)[_0x9999('0x22')](handleEntityNotFound(_0x4cfd17,null))[_0x9999('0x22')](respondWithResult(_0x4cfd17,null))['catch'](handleError(_0x4cfd17,null));};exports['create']=function(_0x438b31,_0x20ea2d){return db[_0x9999('0x28')][_0x9999('0x42')](_0x438b31[_0x9999('0x43')],{})[_0x9999('0x22')](respondWithResult(_0x20ea2d,0xc9))[_0x9999('0x3f')](handleError(_0x20ea2d,null));};exports['update']=function(_0x283bc8,_0x145f6f){if(_0x283bc8['body']['id']){delete _0x283bc8['body']['id'];}return db[_0x9999('0x28')]['find']({'where':{'id':_0x283bc8[_0x9999('0x40')]['id']}})[_0x9999('0x22')](handleEntityNotFound(_0x145f6f,null))[_0x9999('0x22')](saveUpdates(_0x283bc8[_0x9999('0x43')],null))[_0x9999('0x22')](respondWithResult(_0x145f6f,null))['catch'](handleError(_0x145f6f,null));};exports[_0x9999('0x44')]=function(_0x17ad9b,_0x11221b){return db[_0x9999('0x28')]['find']({'where':{'id':_0x17ad9b['params']['id']}})[_0x9999('0x22')](handleEntityNotFound(_0x11221b,null))[_0x9999('0x22')](removeEntity(_0x11221b,null))[_0x9999('0x3f')](handleError(_0x11221b,null));};exports['getFields']=function(_0x29ccd7,_0x2ad951,_0x47ede6){var _0x29ca26={};var _0x1790b9={};var _0x4540cb;var _0x6e3dde;return db[_0x9999('0x28')]['findOne']({'where':{'id':_0x29ccd7[_0x9999('0x40')]['id']}})[_0x9999('0x22')](handleEntityNotFound(_0x2ad951,null))[_0x9999('0x22')](function(_0x520e18){if(_0x520e18){_0x4540cb=_0x520e18;_0x1790b9[_0x9999('0x2c')]=_[_0x9999('0x2e')](db[_0x9999('0x45')][_0x9999('0x29')]);_0x1790b9[_0x9999('0x2d')]=_[_0x9999('0x2e')](_0x29ccd7[_0x9999('0x2d')]);_0x1790b9['filters']=_[_0x9999('0x31')](_0x1790b9[_0x9999('0x2c')],_0x1790b9[_0x9999('0x2d')]);_0x29ca26[_0x9999('0x30')]=_[_0x9999('0x31')](_0x1790b9[_0x9999('0x2c')],qs[_0x9999('0x32')](_0x29ccd7[_0x9999('0x2d')][_0x9999('0x32')]));_0x29ca26['attributes']=_0x29ca26['attributes'][_0x9999('0x41')]?_0x29ca26[_0x9999('0x30')]:_0x1790b9[_0x9999('0x2c')];_0x29ca26[_0x9999('0x33')]=qs['sort'](_0x29ccd7['query']['sort']);_0x29ca26[_0x9999('0x36')]=qs['filters'](_[_0x9999('0x35')](_0x29ccd7[_0x9999('0x2d')],_0x1790b9['filters']));if(_0x29ccd7[_0x9999('0x2d')][_0x9999('0x46')]){_0x29ca26[_0x9999('0x36')]=_[_0x9999('0x39')](_0x29ca26[_0x9999('0x36')],{'$or':_[_0x9999('0x27')](_0x29ca26['attributes'],function(_0x235dee){var _0x503493={};_0x503493[_0x235dee]={'$like':'%'+_0x29ccd7[_0x9999('0x2d')][_0x9999('0x46')]+'%'};return _0x503493;})});}_0x29ca26=_[_0x9999('0x39')]({},_0x29ca26,_0x29ccd7['options']);return _0x4540cb[_0x9999('0x47')](_0x29ca26);}})['then'](function(_0x5b034a){if(_0x5b034a){_0x6e3dde=_0x5b034a[_0x9999('0x41')];if(!_0x29ccd7['query'][_0x9999('0x48')](_0x9999('0x49'))){_0x29ca26[_0x9999('0x1c')]=qs[_0x9999('0x1c')](_0x29ccd7['query'][_0x9999('0x1c')]);_0x29ca26['offset']=qs[_0x9999('0x1b')](_0x29ccd7['query'][_0x9999('0x1b')]);}return _0x4540cb[_0x9999('0x47')](_0x29ca26);}})[_0x9999('0x22')](function(_0x30ead3){if(_0x30ead3){return _0x30ead3?{'count':_0x6e3dde,'rows':_0x30ead3}:null;}})[_0x9999('0x22')](respondWithResult(_0x2ad951,null))[_0x9999('0x3f')](handleError(_0x2ad951,null));};exports[_0x9999('0x4a')]=function(_0xded7f1,_0x11b271,_0x3ea49a){var _0x404283={};var _0x11ff2a={};var _0xaac9fd;var _0x29af5e;return db['SugarcrmConfiguration'][_0x9999('0x4b')]({'where':{'id':_0xded7f1[_0x9999('0x40')]['id']}})['then'](handleEntityNotFound(_0x11b271,null))[_0x9999('0x22')](function(_0x302300){if(_0x302300){_0xaac9fd=_0x302300;_0x11ff2a[_0x9999('0x2c')]=_[_0x9999('0x2e')](db['SugarcrmField']['rawAttributes']);_0x11ff2a['query']=_['keys'](_0xded7f1[_0x9999('0x2d')]);_0x11ff2a[_0x9999('0x2f')]=_[_0x9999('0x31')](_0x11ff2a[_0x9999('0x2c')],_0x11ff2a[_0x9999('0x2d')]);_0x404283[_0x9999('0x30')]=_[_0x9999('0x31')](_0x11ff2a['model'],qs[_0x9999('0x32')](_0xded7f1[_0x9999('0x2d')][_0x9999('0x32')]));_0x404283[_0x9999('0x30')]=_0x404283['attributes']['length']?_0x404283[_0x9999('0x30')]:_0x11ff2a[_0x9999('0x2c')];_0x404283[_0x9999('0x33')]=qs[_0x9999('0x34')](_0xded7f1[_0x9999('0x2d')]['sort']);_0x404283[_0x9999('0x36')]=qs[_0x9999('0x2f')](_['pick'](_0xded7f1[_0x9999('0x2d')],_0x11ff2a['filters']));if(_0xded7f1[_0x9999('0x2d')][_0x9999('0x46')]){_0x404283['where']=_[_0x9999('0x39')](_0x404283[_0x9999('0x36')],{'$or':_[_0x9999('0x27')](_0x404283['attributes'],function(_0xb6d4f8){var _0x5e1736={};_0x5e1736[_0xb6d4f8]={'$like':'%'+_0xded7f1[_0x9999('0x2d')][_0x9999('0x46')]+'%'};return _0x5e1736;})});}_0x404283=_[_0x9999('0x39')]({},_0x404283,_0xded7f1[_0x9999('0x3a')]);return _0xaac9fd[_0x9999('0x4a')](_0x404283);}})[_0x9999('0x22')](function(_0x2913eb){if(_0x2913eb){_0x29af5e=_0x2913eb[_0x9999('0x41')];if(!_0xded7f1['query']['hasOwnProperty']('nolimit')){_0x404283[_0x9999('0x1c')]=qs[_0x9999('0x1c')](_0xded7f1['query'][_0x9999('0x1c')]);_0x404283[_0x9999('0x1b')]=qs[_0x9999('0x1b')](_0xded7f1['query'][_0x9999('0x1b')]);}return _0xaac9fd[_0x9999('0x4a')](_0x404283);}})[_0x9999('0x22')](function(_0x1f61b9){if(_0x1f61b9){return _0x1f61b9?{'count':_0x29af5e,'rows':_0x1f61b9}:null;}})[_0x9999('0x22')](respondWithResult(_0x11b271,null))[_0x9999('0x3f')](handleError(_0x11b271,null));};exports[_0x9999('0x4c')]=function(_0x5c1ac7,_0x1fdcc4,_0x2aea47){var _0x565706={};var _0x1e5e44={};var _0x456b9b;var _0x150ce1;return db[_0x9999('0x28')][_0x9999('0x4b')]({'where':{'id':_0x5c1ac7[_0x9999('0x40')]['id']}})['then'](handleEntityNotFound(_0x1fdcc4,null))[_0x9999('0x22')](function(_0x133318){if(_0x133318){_0x456b9b=_0x133318;_0x1e5e44['model']=_[_0x9999('0x2e')](db[_0x9999('0x45')]['rawAttributes']);_0x1e5e44[_0x9999('0x2d')]=_[_0x9999('0x2e')](_0x5c1ac7[_0x9999('0x2d')]);_0x1e5e44['filters']=_[_0x9999('0x31')](_0x1e5e44[_0x9999('0x2c')],_0x1e5e44[_0x9999('0x2d')]);_0x565706[_0x9999('0x30')]=_[_0x9999('0x31')](_0x1e5e44[_0x9999('0x2c')],qs[_0x9999('0x32')](_0x5c1ac7[_0x9999('0x2d')]['fields']));_0x565706[_0x9999('0x30')]=_0x565706[_0x9999('0x30')][_0x9999('0x41')]?_0x565706['attributes']:_0x1e5e44[_0x9999('0x2c')];_0x565706[_0x9999('0x33')]=qs[_0x9999('0x34')](_0x5c1ac7['query'][_0x9999('0x34')]);_0x565706['where']=qs[_0x9999('0x2f')](_[_0x9999('0x35')](_0x5c1ac7[_0x9999('0x2d')],_0x1e5e44['filters']));if(_0x5c1ac7[_0x9999('0x2d')][_0x9999('0x46')]){_0x565706[_0x9999('0x36')]=_[_0x9999('0x39')](_0x565706[_0x9999('0x36')],{'$or':_[_0x9999('0x27')](_0x565706['attributes'],function(_0x34eff6){var _0x359cad={};_0x359cad[_0x34eff6]={'$like':'%'+_0x5c1ac7[_0x9999('0x2d')][_0x9999('0x46')]+'%'};return _0x359cad;})});}_0x565706=_['merge']({},_0x565706,_0x5c1ac7[_0x9999('0x3a')]);return _0x456b9b[_0x9999('0x4c')](_0x565706);}})[_0x9999('0x22')](function(_0x2df22d){if(_0x2df22d){_0x150ce1=_0x2df22d[_0x9999('0x41')];if(!_0x5c1ac7['query'][_0x9999('0x48')](_0x9999('0x49'))){_0x565706[_0x9999('0x1c')]=qs[_0x9999('0x1c')](_0x5c1ac7[_0x9999('0x2d')][_0x9999('0x1c')]);_0x565706[_0x9999('0x1b')]=qs['offset'](_0x5c1ac7[_0x9999('0x2d')][_0x9999('0x1b')]);}return _0x456b9b[_0x9999('0x4c')](_0x565706);}})[_0x9999('0x22')](function(_0x3a0560){if(_0x3a0560){return _0x3a0560?{'count':_0x150ce1,'rows':_0x3a0560}:null;}})[_0x9999('0x22')](respondWithResult(_0x1fdcc4,null))[_0x9999('0x3f')](handleError(_0x1fdcc4,null));};
\ No newline at end of file
+var _0xaef8=['map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','findAll','rows','catch','params','keys','intersection','include','find','body','getFields','findOne','SugarcrmField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','key','model'];(function(_0x1ded25,_0x26be3d){var _0x8ec99f=function(_0x3017ac){while(--_0x3017ac){_0x1ded25['push'](_0x1ded25['shift']());}};_0x8ec99f(++_0x26be3d);}(_0xaef8,0x158));var _0x8aef=function(_0x352fc9,_0x59fadc){_0x352fc9=_0x352fc9-0x0;var _0x36b574=_0xaef8[_0x352fc9];return _0x36b574;};'use strict';var emlformat=require(_0x8aef('0x0'));var rimraf=require(_0x8aef('0x1'));var zipdir=require(_0x8aef('0x2'));var jsonpatch=require(_0x8aef('0x3'));var rp=require('request-promise');var moment=require(_0x8aef('0x4'));var BPromise=require(_0x8aef('0x5'));var Mustache=require('mustache');var util=require(_0x8aef('0x6'));var path=require(_0x8aef('0x7'));var sox=require(_0x8aef('0x8'));var csv=require('to-csv');var ejs=require(_0x8aef('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8aef('0xa'));var crypto=require(_0x8aef('0xb'));var jsforce=require(_0x8aef('0xc'));var deskjs=require(_0x8aef('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8aef('0xe'));var Papa=require(_0x8aef('0xf'));var Redis=require('ioredis');var authService=require(_0x8aef('0x10'));var qs=require(_0x8aef('0x11'));var as=require(_0x8aef('0x12'));var hardwareService=require(_0x8aef('0x13'));var logger=require(_0x8aef('0x14'))('api');var utils=require(_0x8aef('0x15'));var config=require(_0x8aef('0x16'));var licenseUtil=require(_0x8aef('0x17'));var db=require(_0x8aef('0x18'))['db'];function respondWithStatusCode(_0x535de5,_0x35861f){_0x35861f=_0x35861f||0xcc;return function(_0x4a489d){if(_0x4a489d){return _0x535de5[_0x8aef('0x19')](_0x35861f);}return _0x535de5[_0x8aef('0x1a')](_0x35861f)[_0x8aef('0x1b')]();};}function respondWithResult(_0x16677a,_0x4c10c0){_0x4c10c0=_0x4c10c0||0xc8;return function(_0x1cea48){if(_0x1cea48){return _0x16677a[_0x8aef('0x1a')](_0x4c10c0)[_0x8aef('0x1c')](_0x1cea48);}};}function respondWithFilteredResult(_0x1a7f88,_0x125bc4){return function(_0x3bfd6b){if(_0x3bfd6b){var _0x120699=typeof _0x125bc4[_0x8aef('0x1d')]==='undefined'&&typeof _0x125bc4['limit']===_0x8aef('0x1e');var _0xfe53f=_0x3bfd6b[_0x8aef('0x1f')];var _0x4b1459=_0x120699?0x0:_0x125bc4[_0x8aef('0x1d')];var _0x2d4462=_0x120699?_0x3bfd6b[_0x8aef('0x1f')]:_0x125bc4[_0x8aef('0x1d')]+_0x125bc4[_0x8aef('0x20')];var _0x1ddf67;if(_0x2d4462>=_0xfe53f){_0x2d4462=_0xfe53f;_0x1ddf67=0xc8;}else{_0x1ddf67=0xce;}_0x1a7f88['status'](_0x1ddf67);return _0x1a7f88['set']('Content-Range',_0x4b1459+'-'+_0x2d4462+'/'+_0xfe53f)[_0x8aef('0x1c')](_0x3bfd6b);}return null;};}function patchUpdates(_0x3ba342){return function(_0x4815d3){try{jsonpatch[_0x8aef('0x21')](_0x4815d3,_0x3ba342,!![]);}catch(_0x5729c5){return BPromise[_0x8aef('0x22')](_0x5729c5);}return _0x4815d3[_0x8aef('0x23')]();};}function saveUpdates(_0x1a469e,_0x2c6ccb){return function(_0x35507c){if(_0x35507c){return _0x35507c[_0x8aef('0x24')](_0x1a469e)[_0x8aef('0x25')](function(_0x35adc8){return _0x35adc8;});}return null;};}function removeEntity(_0x1673dc,_0x4c7344){return function(_0x30063d){if(_0x30063d){return _0x30063d['destroy']()[_0x8aef('0x25')](function(){_0x1673dc[_0x8aef('0x1a')](0xcc)[_0x8aef('0x1b')]();});}};}function handleEntityNotFound(_0x25d696,_0x57123b){return function(_0x549e3b){if(!_0x549e3b){_0x25d696[_0x8aef('0x19')](0x194);}return _0x549e3b;};}function handleError(_0x2d5a6a,_0x37f40a){_0x37f40a=_0x37f40a||0x1f4;return function(_0x2da8d9){logger['error'](_0x2da8d9[_0x8aef('0x26')]);if(_0x2da8d9['name']){delete _0x2da8d9[_0x8aef('0x27')];}_0x2d5a6a[_0x8aef('0x1a')](_0x37f40a)[_0x8aef('0x28')](_0x2da8d9);};}exports['index']=function(_0x2ffdf0,_0x4dfc9d){var _0x58d9d8={},_0x5ccc32={},_0x18095b={'count':0x0,'rows':[]};var _0x31f9bc=_['map'](db['SugarcrmConfiguration'][_0x8aef('0x29')],function(_0x3306da){return{'name':_0x3306da[_0x8aef('0x2a')],'type':_0x3306da[_0x8aef('0x2b')][_0x8aef('0x2c')]};});_0x5ccc32[_0x8aef('0x2d')]=_[_0x8aef('0x2e')](_0x31f9bc,_0x8aef('0x27'));_0x5ccc32[_0x8aef('0x2f')]=_['keys'](_0x2ffdf0[_0x8aef('0x2f')]);_0x5ccc32[_0x8aef('0x30')]=_['intersection'](_0x5ccc32[_0x8aef('0x2d')],_0x5ccc32['query']);_0x58d9d8[_0x8aef('0x31')]=_['intersection'](_0x5ccc32[_0x8aef('0x2d')],qs[_0x8aef('0x32')](_0x2ffdf0[_0x8aef('0x2f')][_0x8aef('0x32')]));_0x58d9d8[_0x8aef('0x31')]=_0x58d9d8[_0x8aef('0x31')][_0x8aef('0x33')]?_0x58d9d8['attributes']:_0x5ccc32[_0x8aef('0x2d')];if(!_0x2ffdf0[_0x8aef('0x2f')][_0x8aef('0x34')](_0x8aef('0x35'))){_0x58d9d8['limit']=qs[_0x8aef('0x20')](_0x2ffdf0[_0x8aef('0x2f')]['limit']);_0x58d9d8['offset']=qs[_0x8aef('0x1d')](_0x2ffdf0[_0x8aef('0x2f')]['offset']);}_0x58d9d8[_0x8aef('0x36')]=qs['sort'](_0x2ffdf0[_0x8aef('0x2f')][_0x8aef('0x37')]);_0x58d9d8[_0x8aef('0x38')]=qs[_0x8aef('0x30')](_['pick'](_0x2ffdf0['query'],_0x5ccc32[_0x8aef('0x30')]),_0x31f9bc);if(_0x2ffdf0[_0x8aef('0x2f')][_0x8aef('0x39')]){_0x58d9d8[_0x8aef('0x38')]=_[_0x8aef('0x3a')](_0x58d9d8[_0x8aef('0x38')],{'$or':_[_0x8aef('0x2e')](_0x31f9bc,function(_0x539df6){if(_0x539df6[_0x8aef('0x2b')]!==_0x8aef('0x3b')){var _0xd22b80={};_0xd22b80[_0x539df6[_0x8aef('0x27')]]={'$like':'%'+_0x2ffdf0[_0x8aef('0x2f')]['filter']+'%'};return _0xd22b80;}})});}_0x58d9d8=_[_0x8aef('0x3a')]({},_0x58d9d8,_0x2ffdf0[_0x8aef('0x3c')]);var _0x46e35d={'where':_0x58d9d8['where']};return db[_0x8aef('0x3d')][_0x8aef('0x1f')](_0x46e35d)[_0x8aef('0x25')](function(_0x3c7272){_0x18095b[_0x8aef('0x1f')]=_0x3c7272;if(_0x2ffdf0['query'][_0x8aef('0x3e')]){_0x58d9d8['include']=[{'all':!![]}];}return db[_0x8aef('0x3d')][_0x8aef('0x3f')](_0x58d9d8);})['then'](function(_0x23e572){_0x18095b[_0x8aef('0x40')]=_0x23e572;return _0x18095b;})[_0x8aef('0x25')](respondWithFilteredResult(_0x4dfc9d,_0x58d9d8))[_0x8aef('0x41')](handleError(_0x4dfc9d,null));};exports['show']=function(_0x48ca9b,_0x3d0e91){var _0x2a769e={'raw':![],'where':{'id':_0x48ca9b[_0x8aef('0x42')]['id']}},_0x3a6a96={};_0x3a6a96[_0x8aef('0x2d')]=_[_0x8aef('0x43')](db[_0x8aef('0x3d')]['rawAttributes']);_0x3a6a96[_0x8aef('0x2f')]=_['keys'](_0x48ca9b[_0x8aef('0x2f')]);_0x3a6a96[_0x8aef('0x30')]=_[_0x8aef('0x44')](_0x3a6a96[_0x8aef('0x2d')],_0x3a6a96[_0x8aef('0x2f')]);_0x2a769e[_0x8aef('0x31')]=_[_0x8aef('0x44')](_0x3a6a96[_0x8aef('0x2d')],qs[_0x8aef('0x32')](_0x48ca9b[_0x8aef('0x2f')][_0x8aef('0x32')]));_0x2a769e['attributes']=_0x2a769e['attributes'][_0x8aef('0x33')]?_0x2a769e[_0x8aef('0x31')]:_0x3a6a96[_0x8aef('0x2d')];if(_0x48ca9b[_0x8aef('0x2f')][_0x8aef('0x3e')]){_0x2a769e[_0x8aef('0x45')]=[{'all':!![]}];}_0x2a769e=_['merge']({},_0x2a769e,_0x48ca9b[_0x8aef('0x3c')]);return db[_0x8aef('0x3d')][_0x8aef('0x46')](_0x2a769e)[_0x8aef('0x25')](handleEntityNotFound(_0x3d0e91,null))[_0x8aef('0x25')](respondWithResult(_0x3d0e91,null))[_0x8aef('0x41')](handleError(_0x3d0e91,null));};exports['create']=function(_0x12ecea,_0x1aa026){return db[_0x8aef('0x3d')]['create'](_0x12ecea[_0x8aef('0x47')],{})[_0x8aef('0x25')](respondWithResult(_0x1aa026,0xc9))[_0x8aef('0x41')](handleError(_0x1aa026,null));};exports['update']=function(_0x1ecd50,_0x497ed1){if(_0x1ecd50[_0x8aef('0x47')]['id']){delete _0x1ecd50[_0x8aef('0x47')]['id'];}return db[_0x8aef('0x3d')][_0x8aef('0x46')]({'where':{'id':_0x1ecd50[_0x8aef('0x42')]['id']}})['then'](handleEntityNotFound(_0x497ed1,null))[_0x8aef('0x25')](saveUpdates(_0x1ecd50[_0x8aef('0x47')],null))['then'](respondWithResult(_0x497ed1,null))[_0x8aef('0x41')](handleError(_0x497ed1,null));};exports['destroy']=function(_0x4edbbe,_0x531362){return db[_0x8aef('0x3d')]['find']({'where':{'id':_0x4edbbe[_0x8aef('0x42')]['id']}})[_0x8aef('0x25')](handleEntityNotFound(_0x531362,null))[_0x8aef('0x25')](removeEntity(_0x531362,null))[_0x8aef('0x41')](handleError(_0x531362,null));};exports[_0x8aef('0x48')]=function(_0x43d833,_0x4c516b,_0x34d4d8){var _0x388390={};var _0x6f1a2f={};var _0x1b5587;var _0x51fb88;return db[_0x8aef('0x3d')][_0x8aef('0x49')]({'where':{'id':_0x43d833[_0x8aef('0x42')]['id']}})[_0x8aef('0x25')](handleEntityNotFound(_0x4c516b,null))['then'](function(_0x428c6b){if(_0x428c6b){_0x1b5587=_0x428c6b;_0x6f1a2f[_0x8aef('0x2d')]=_[_0x8aef('0x43')](db[_0x8aef('0x4a')]['rawAttributes']);_0x6f1a2f['query']=_['keys'](_0x43d833['query']);_0x6f1a2f[_0x8aef('0x30')]=_[_0x8aef('0x44')](_0x6f1a2f[_0x8aef('0x2d')],_0x6f1a2f[_0x8aef('0x2f')]);_0x388390[_0x8aef('0x31')]=_[_0x8aef('0x44')](_0x6f1a2f['model'],qs['fields'](_0x43d833[_0x8aef('0x2f')][_0x8aef('0x32')]));_0x388390[_0x8aef('0x31')]=_0x388390[_0x8aef('0x31')][_0x8aef('0x33')]?_0x388390['attributes']:_0x6f1a2f[_0x8aef('0x2d')];_0x388390[_0x8aef('0x36')]=qs[_0x8aef('0x37')](_0x43d833['query'][_0x8aef('0x37')]);_0x388390[_0x8aef('0x38')]=qs[_0x8aef('0x30')](_['pick'](_0x43d833[_0x8aef('0x2f')],_0x6f1a2f[_0x8aef('0x30')]));if(_0x43d833[_0x8aef('0x2f')][_0x8aef('0x39')]){_0x388390['where']=_['merge'](_0x388390[_0x8aef('0x38')],{'$or':_[_0x8aef('0x2e')](_0x388390[_0x8aef('0x31')],function(_0x4fdd81){var _0x212087={};_0x212087[_0x4fdd81]={'$like':'%'+_0x43d833[_0x8aef('0x2f')][_0x8aef('0x39')]+'%'};return _0x212087;})});}_0x388390=_['merge']({},_0x388390,_0x43d833['options']);return _0x1b5587[_0x8aef('0x48')](_0x388390);}})['then'](function(_0x390137){if(_0x390137){_0x51fb88=_0x390137['length'];if(!_0x43d833[_0x8aef('0x2f')][_0x8aef('0x34')](_0x8aef('0x35'))){_0x388390[_0x8aef('0x20')]=qs[_0x8aef('0x20')](_0x43d833[_0x8aef('0x2f')][_0x8aef('0x20')]);_0x388390[_0x8aef('0x1d')]=qs[_0x8aef('0x1d')](_0x43d833[_0x8aef('0x2f')][_0x8aef('0x1d')]);}return _0x1b5587['getFields'](_0x388390);}})[_0x8aef('0x25')](function(_0x4baf5f){if(_0x4baf5f){return _0x4baf5f?{'count':_0x51fb88,'rows':_0x4baf5f}:null;}})[_0x8aef('0x25')](respondWithResult(_0x4c516b,null))[_0x8aef('0x41')](handleError(_0x4c516b,null));};exports['getSubjects']=function(_0x5520b6,_0x15f119,_0x1b1adc){var _0x4d5000={};var _0x1744dd={};var _0x5a0020;var _0x2e4289;return db[_0x8aef('0x3d')][_0x8aef('0x49')]({'where':{'id':_0x5520b6[_0x8aef('0x42')]['id']}})[_0x8aef('0x25')](handleEntityNotFound(_0x15f119,null))[_0x8aef('0x25')](function(_0x22396e){if(_0x22396e){_0x5a0020=_0x22396e;_0x1744dd[_0x8aef('0x2d')]=_['keys'](db[_0x8aef('0x4a')][_0x8aef('0x29')]);_0x1744dd['query']=_['keys'](_0x5520b6[_0x8aef('0x2f')]);_0x1744dd[_0x8aef('0x30')]=_[_0x8aef('0x44')](_0x1744dd[_0x8aef('0x2d')],_0x1744dd[_0x8aef('0x2f')]);_0x4d5000['attributes']=_[_0x8aef('0x44')](_0x1744dd['model'],qs[_0x8aef('0x32')](_0x5520b6['query']['fields']));_0x4d5000[_0x8aef('0x31')]=_0x4d5000['attributes']['length']?_0x4d5000[_0x8aef('0x31')]:_0x1744dd[_0x8aef('0x2d')];_0x4d5000[_0x8aef('0x36')]=qs['sort'](_0x5520b6['query'][_0x8aef('0x37')]);_0x4d5000['where']=qs[_0x8aef('0x30')](_[_0x8aef('0x4b')](_0x5520b6['query'],_0x1744dd[_0x8aef('0x30')]));if(_0x5520b6['query']['filter']){_0x4d5000[_0x8aef('0x38')]=_[_0x8aef('0x3a')](_0x4d5000[_0x8aef('0x38')],{'$or':_[_0x8aef('0x2e')](_0x4d5000[_0x8aef('0x31')],function(_0x1ca286){var _0xd6f634={};_0xd6f634[_0x1ca286]={'$like':'%'+_0x5520b6[_0x8aef('0x2f')][_0x8aef('0x39')]+'%'};return _0xd6f634;})});}_0x4d5000=_[_0x8aef('0x3a')]({},_0x4d5000,_0x5520b6[_0x8aef('0x3c')]);return _0x5a0020[_0x8aef('0x4c')](_0x4d5000);}})[_0x8aef('0x25')](function(_0x3d8d25){if(_0x3d8d25){_0x2e4289=_0x3d8d25[_0x8aef('0x33')];if(!_0x5520b6[_0x8aef('0x2f')]['hasOwnProperty']('nolimit')){_0x4d5000[_0x8aef('0x20')]=qs[_0x8aef('0x20')](_0x5520b6[_0x8aef('0x2f')][_0x8aef('0x20')]);_0x4d5000[_0x8aef('0x1d')]=qs['offset'](_0x5520b6[_0x8aef('0x2f')][_0x8aef('0x1d')]);}return _0x5a0020['getSubjects'](_0x4d5000);}})[_0x8aef('0x25')](function(_0x45570d){if(_0x45570d){return _0x45570d?{'count':_0x2e4289,'rows':_0x45570d}:null;}})[_0x8aef('0x25')](respondWithResult(_0x15f119,null))['catch'](handleError(_0x15f119,null));};exports[_0x8aef('0x4d')]=function(_0x43e9eb,_0x364488,_0x37a4ce){var _0x4330ac={};var _0x1a9d19={};var _0xd1830f;var _0x3e3e99;return db[_0x8aef('0x3d')][_0x8aef('0x49')]({'where':{'id':_0x43e9eb['params']['id']}})[_0x8aef('0x25')](handleEntityNotFound(_0x364488,null))['then'](function(_0xc44db5){if(_0xc44db5){_0xd1830f=_0xc44db5;_0x1a9d19['model']=_['keys'](db['SugarcrmField'][_0x8aef('0x29')]);_0x1a9d19[_0x8aef('0x2f')]=_[_0x8aef('0x43')](_0x43e9eb['query']);_0x1a9d19[_0x8aef('0x30')]=_[_0x8aef('0x44')](_0x1a9d19['model'],_0x1a9d19[_0x8aef('0x2f')]);_0x4330ac[_0x8aef('0x31')]=_[_0x8aef('0x44')](_0x1a9d19[_0x8aef('0x2d')],qs[_0x8aef('0x32')](_0x43e9eb[_0x8aef('0x2f')][_0x8aef('0x32')]));_0x4330ac[_0x8aef('0x31')]=_0x4330ac[_0x8aef('0x31')][_0x8aef('0x33')]?_0x4330ac[_0x8aef('0x31')]:_0x1a9d19['model'];_0x4330ac['order']=qs['sort'](_0x43e9eb[_0x8aef('0x2f')][_0x8aef('0x37')]);_0x4330ac[_0x8aef('0x38')]=qs[_0x8aef('0x30')](_['pick'](_0x43e9eb[_0x8aef('0x2f')],_0x1a9d19['filters']));if(_0x43e9eb[_0x8aef('0x2f')][_0x8aef('0x39')]){_0x4330ac[_0x8aef('0x38')]=_[_0x8aef('0x3a')](_0x4330ac[_0x8aef('0x38')],{'$or':_['map'](_0x4330ac[_0x8aef('0x31')],function(_0x144ed1){var _0xf9cace={};_0xf9cace[_0x144ed1]={'$like':'%'+_0x43e9eb['query'][_0x8aef('0x39')]+'%'};return _0xf9cace;})});}_0x4330ac=_['merge']({},_0x4330ac,_0x43e9eb[_0x8aef('0x3c')]);return _0xd1830f[_0x8aef('0x4d')](_0x4330ac);}})[_0x8aef('0x25')](function(_0x33e494){if(_0x33e494){_0x3e3e99=_0x33e494['length'];if(!_0x43e9eb[_0x8aef('0x2f')][_0x8aef('0x34')](_0x8aef('0x35'))){_0x4330ac['limit']=qs[_0x8aef('0x20')](_0x43e9eb['query'][_0x8aef('0x20')]);_0x4330ac[_0x8aef('0x1d')]=qs[_0x8aef('0x1d')](_0x43e9eb[_0x8aef('0x2f')][_0x8aef('0x1d')]);}return _0xd1830f[_0x8aef('0x4d')](_0x4330ac);}})[_0x8aef('0x25')](function(_0x212589){if(_0x212589){return _0x212589?{'count':_0x3e3e99,'rows':_0x212589}:null;}})[_0x8aef('0x25')](respondWithResult(_0x364488,null))[_0x8aef('0x41')](handleError(_0x364488,null));};
\ No newline at end of file
index 19245e5..89710de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a09=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x561b25,_0x312a13){var _0x5c66fb=function(_0x23a0c0){while(--_0x23a0c0){_0x561b25['push'](_0x561b25['shift']());}};_0x5c66fb(++_0x312a13);}(_0x1a09,0x1d2));var _0x91a0=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x1a09[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x91a0('0x0'));var util=require(_0x91a0('0x1'));var logger=require(_0x91a0('0x2'))(_0x91a0('0x3'));var moment=require('moment');var BPromise=require(_0x91a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91a0('0x5'));var rimraf=require('rimraf');var config=require(_0x91a0('0x6'));var attributes=require(_0x91a0('0x7'));module[_0x91a0('0x8')]=function(_0x21f08f,_0x17c762){return _0x21f08f[_0x91a0('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x91a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf8f0=['define','SugarcrmConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x3c68c8,_0x29ec74){var _0x44569c=function(_0x439ca2){while(--_0x439ca2){_0x3c68c8['push'](_0x3c68c8['shift']());}};_0x44569c(++_0x29ec74);}(_0xf8f0,0xb8));var _0x0f8f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf8f0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x0f8f('0x0'));var logger=require(_0x0f8f('0x1'))(_0x0f8f('0x2'));var moment=require(_0x0f8f('0x3'));var BPromise=require(_0x0f8f('0x4'));var rp=require(_0x0f8f('0x5'));var fs=require('fs');var path=require(_0x0f8f('0x6'));var rimraf=require(_0x0f8f('0x7'));var config=require(_0x0f8f('0x8'));var attributes=require(_0x0f8f('0x9'));module[_0x0f8f('0xa')]=function(_0x47b24b,_0x5f4f6e){return _0x47b24b[_0x0f8f('0xb')](_0x0f8f('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8d4fea..67591a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43a0=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x43a0,0x1e4));var _0x043a=function(_0x20317d,_0x156ede){_0x20317d=_0x20317d-0x0;var _0x316d8f=_0x43a0[_0x20317d];return _0x316d8f;};'use strict';var _=require(_0x043a('0x0'));var util=require(_0x043a('0x1'));var moment=require(_0x043a('0x2'));var BPromise=require('bluebird');var rs=require(_0x043a('0x3'));var fs=require('fs');var Redis=require(_0x043a('0x4'));var db=require(_0x043a('0x5'))['db'];var utils=require(_0x043a('0x6'));var logger=require(_0x043a('0x7'))(_0x043a('0x8'));var config=require(_0x043a('0x9'));var jayson=require(_0x043a('0xa'));var client=jayson['client'][_0x043a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e5369,_0x17b5d9,_0x48eeaf){return new BPromise(function(_0x5ed05d,_0x45c5c5){return client[_0x043a('0xc')](_0x2e5369,_0x48eeaf)[_0x043a('0xd')](function(_0x3dae9b){logger['info'](_0x043a('0xe'),_0x17b5d9,'request\x20sent');logger[_0x043a('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x17b5d9,_0x043a('0x10'),JSON[_0x043a('0x11')](_0x3dae9b));if(_0x3dae9b['error']){if(_0x3dae9b[_0x043a('0x12')][_0x043a('0x13')]===0x1f4){logger['error'](_0x043a('0xe'),_0x17b5d9,_0x3dae9b['error'][_0x043a('0x14')]);return _0x45c5c5(_0x3dae9b[_0x043a('0x12')]['message']);}logger[_0x043a('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x17b5d9,_0x3dae9b[_0x043a('0x12')][_0x043a('0x14')]);return _0x5ed05d(_0x3dae9b[_0x043a('0x12')][_0x043a('0x14')]);}else{logger['info'](_0x043a('0xe'),_0x17b5d9,'request\x20sent');_0x5ed05d(_0x3dae9b[_0x043a('0x15')][_0x043a('0x14')]);}})[_0x043a('0x16')](function(_0x31e7f7){logger[_0x043a('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x17b5d9,_0x31e7f7);_0x45c5c5(_0x31e7f7);});});}
\ No newline at end of file
+var _0x5e61=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4e6243,_0x37ec06){var _0x211fbc=function(_0x171e0a){while(--_0x171e0a){_0x4e6243['push'](_0x4e6243['shift']());}};_0x211fbc(++_0x37ec06);}(_0x5e61,0xd2));var _0x15e6=function(_0x12e182,_0x516306){_0x12e182=_0x12e182-0x0;var _0x42984b=_0x5e61[_0x12e182];return _0x42984b;};'use strict';var _=require(_0x15e6('0x0'));var util=require(_0x15e6('0x1'));var moment=require(_0x15e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x15e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15e6('0x4'))['db'];var utils=require(_0x15e6('0x5'));var logger=require(_0x15e6('0x6'))(_0x15e6('0x7'));var config=require(_0x15e6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x15e6('0x9')][_0x15e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4958da,_0xe6d05d,_0x2e077a){return new BPromise(function(_0x5512d2,_0x21f8f6){return client[_0x15e6('0xb')](_0x4958da,_0x2e077a)[_0x15e6('0xc')](function(_0x14b6b4){logger[_0x15e6('0xd')](_0x15e6('0xe'),_0xe6d05d,_0x15e6('0xf'));logger['debug'](_0x15e6('0x10'),_0xe6d05d,'request\x20sent',JSON[_0x15e6('0x11')](_0x14b6b4));if(_0x14b6b4[_0x15e6('0x12')]){if(_0x14b6b4['error'][_0x15e6('0x13')]===0x1f4){logger[_0x15e6('0x12')](_0x15e6('0xe'),_0xe6d05d,_0x14b6b4[_0x15e6('0x12')]['message']);return _0x21f8f6(_0x14b6b4[_0x15e6('0x12')][_0x15e6('0x14')]);}logger[_0x15e6('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xe6d05d,_0x14b6b4['error'][_0x15e6('0x14')]);return _0x5512d2(_0x14b6b4['error'][_0x15e6('0x14')]);}else{logger[_0x15e6('0xd')](_0x15e6('0xe'),_0xe6d05d,_0x15e6('0xf'));_0x5512d2(_0x14b6b4[_0x15e6('0x15')][_0x15e6('0x14')]);}})[_0x15e6('0x16')](function(_0x5f36ac){logger[_0x15e6('0x12')](_0x15e6('0xe'),_0xe6d05d,_0x5f36ac);_0x21f8f6(_0x5f36ac);});});}
\ No newline at end of file
index c23b9b0..0c5bc6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd328=['index','/:id','show','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xd328,0x67));var _0x8d32=function(_0xfa214e,_0x63a4a6){_0xfa214e=_0xfa214e-0x0;var _0x1cd6c3=_0xd328[_0xfa214e];return _0x1cd6c3;};'use strict';var multer=require(_0x8d32('0x0'));var util=require(_0x8d32('0x1'));var path=require('path');var timeout=require(_0x8d32('0x2'));var express=require(_0x8d32('0x3'));var router=express[_0x8d32('0x4')]();var fs_extra=require(_0x8d32('0x5'));var auth=require(_0x8d32('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8d32('0x7'));var controller=require(_0x8d32('0x8'));router[_0x8d32('0x9')]('/',auth[_0x8d32('0xa')](),controller[_0x8d32('0xb')]);router[_0x8d32('0x9')](_0x8d32('0xc'),auth[_0x8d32('0xa')](),controller[_0x8d32('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8d32('0xe')]);router[_0x8d32('0xf')](_0x8d32('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x8d32('0x10')](_0x8d32('0xc'),auth[_0x8d32('0xa')](),controller[_0x8d32('0x11')]);module[_0x8d32('0x12')]=router;
\ No newline at end of file
+var _0xc8f2=['index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x3a5b9f,_0x599f46){var _0x4e9b72=function(_0x20ac03){while(--_0x20ac03){_0x3a5b9f['push'](_0x3a5b9f['shift']());}};_0x4e9b72(++_0x599f46);}(_0xc8f2,0xf0));var _0x2c8f=function(_0x530e6a,_0x53782f){_0x530e6a=_0x530e6a-0x0;var _0x176c75=_0xc8f2[_0x530e6a];return _0x176c75;};'use strict';var multer=require('multer');var util=require(_0x2c8f('0x0'));var path=require(_0x2c8f('0x1'));var timeout=require(_0x2c8f('0x2'));var express=require(_0x2c8f('0x3'));var router=express[_0x2c8f('0x4')]();var fs_extra=require(_0x2c8f('0x5'));var auth=require(_0x2c8f('0x6'));var interaction=require(_0x2c8f('0x7'));var config=require(_0x2c8f('0x8'));var controller=require(_0x2c8f('0x9'));router[_0x2c8f('0xa')]('/',auth[_0x2c8f('0xb')](),controller[_0x2c8f('0xc')]);router['get'](_0x2c8f('0xd'),auth[_0x2c8f('0xb')](),controller[_0x2c8f('0xe')]);router[_0x2c8f('0xf')]('/',auth[_0x2c8f('0xb')](),controller[_0x2c8f('0x10')]);router[_0x2c8f('0x11')]('/:id',auth[_0x2c8f('0xb')](),controller['update']);router[_0x2c8f('0x12')]('/:id',auth[_0x2c8f('0xb')](),controller[_0x2c8f('0x13')]);module[_0x2c8f('0x14')]=router;
\ No newline at end of file
index 623af5b..299f851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d47=['variable','picklist','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x505707,_0x539e74){var _0x3253b1=function(_0x2dfa5a){while(--_0x2dfa5a){_0x505707['push'](_0x505707['shift']());}};_0x3253b1(++_0x539e74);}(_0x1d47,0xb4));var _0x71d4=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x1d47[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x71d4('0x0'));module[_0x71d4('0x1')]={'type':{'type':Sequelize[_0x71d4('0x2')](_0x71d4('0x3'),_0x71d4('0x4'),'customVariable','keyValue',_0x71d4('0x5')),'defaultValue':_0x71d4('0x3')},'content':{'type':Sequelize[_0x71d4('0x6')]},'key':{'type':Sequelize[_0x71d4('0x6')]},'keyType':{'type':Sequelize[_0x71d4('0x2')]('string',_0x71d4('0x4'),_0x71d4('0x7'))},'keyContent':{'type':Sequelize[_0x71d4('0x6')]},'idField':{'type':Sequelize[_0x71d4('0x6')]},'nameField':{'type':Sequelize[_0x71d4('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71d4('0x6')]}};
\ No newline at end of file
+var _0x37b7=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x37b7,0x1ae));var _0x737b=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x37b7[_0x2f9467];return _0x39894c;};'use strict';var Sequelize=require(_0x737b('0x0'));module[_0x737b('0x1')]={'type':{'type':Sequelize[_0x737b('0x2')](_0x737b('0x3'),_0x737b('0x4'),_0x737b('0x5'),_0x737b('0x6'),_0x737b('0x7')),'defaultValue':_0x737b('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x737b('0x8')]},'keyType':{'type':Sequelize[_0x737b('0x2')](_0x737b('0x3'),'variable',_0x737b('0x5'))},'keyContent':{'type':Sequelize[_0x737b('0x8')]},'idField':{'type':Sequelize[_0x737b('0x8')]},'nameField':{'type':Sequelize[_0x737b('0x8')]},'customField':{'type':Sequelize[_0x737b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x737b('0x8')]}};
\ No newline at end of file
index 7cc5c18..e11bf5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1859=['stack','name','send','map','SugarcrmField','rawAttributes','fieldName','type','key','model','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','merge','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','destroy','error'];(function(_0x39e9b9,_0x1490f9){var _0x23dd9a=function(_0x138d07){while(--_0x138d07){_0x39e9b9['push'](_0x39e9b9['shift']());}};_0x23dd9a(++_0x1490f9);}(_0x1859,0x1f2));var _0x9185=function(_0x5fb3cb,_0xe4f69d){_0x5fb3cb=_0x5fb3cb-0x0;var _0x42e125=_0x1859[_0x5fb3cb];return _0x42e125;};'use strict';var emlformat=require(_0x9185('0x0'));var rimraf=require(_0x9185('0x1'));var zipdir=require(_0x9185('0x2'));var jsonpatch=require(_0x9185('0x3'));var rp=require(_0x9185('0x4'));var moment=require('moment');var BPromise=require(_0x9185('0x5'));var Mustache=require(_0x9185('0x6'));var util=require(_0x9185('0x7'));var path=require(_0x9185('0x8'));var sox=require(_0x9185('0x9'));var csv=require(_0x9185('0xa'));var ejs=require(_0x9185('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9185('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9185('0xd'));var deskjs=require(_0x9185('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9185('0xf'));var Papa=require(_0x9185('0x10'));var Redis=require(_0x9185('0x11'));var authService=require(_0x9185('0x12'));var qs=require(_0x9185('0x13'));var as=require(_0x9185('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9185('0x15'))(_0x9185('0x16'));var utils=require(_0x9185('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9185('0x18'));var db=require(_0x9185('0x19'))['db'];function respondWithStatusCode(_0x3ae782,_0x39855b){_0x39855b=_0x39855b||0xcc;return function(_0xadb7b1){if(_0xadb7b1){return _0x3ae782[_0x9185('0x1a')](_0x39855b);}return _0x3ae782[_0x9185('0x1b')](_0x39855b)[_0x9185('0x1c')]();};}function respondWithResult(_0x1abf4b,_0x3dc4d5){_0x3dc4d5=_0x3dc4d5||0xc8;return function(_0x2ff91b){if(_0x2ff91b){return _0x1abf4b['status'](_0x3dc4d5)['json'](_0x2ff91b);}};}function respondWithFilteredResult(_0x4159bf,_0x24322b){return function(_0x2e6415){if(_0x2e6415){var _0xa3cdb2=typeof _0x24322b[_0x9185('0x1d')]===_0x9185('0x1e')&&typeof _0x24322b[_0x9185('0x1f')]===_0x9185('0x1e');var _0x4a5fa3=_0x2e6415[_0x9185('0x20')];var _0x32a515=_0xa3cdb2?0x0:_0x24322b['offset'];var _0x39f521=_0xa3cdb2?_0x2e6415[_0x9185('0x20')]:_0x24322b[_0x9185('0x1d')]+_0x24322b[_0x9185('0x1f')];var _0x4078b9;if(_0x39f521>=_0x4a5fa3){_0x39f521=_0x4a5fa3;_0x4078b9=0xc8;}else{_0x4078b9=0xce;}_0x4159bf[_0x9185('0x1b')](_0x4078b9);return _0x4159bf[_0x9185('0x21')]('Content-Range',_0x32a515+'-'+_0x39f521+'/'+_0x4a5fa3)[_0x9185('0x22')](_0x2e6415);}return null;};}function patchUpdates(_0x469869){return function(_0x205178){try{jsonpatch[_0x9185('0x23')](_0x205178,_0x469869,!![]);}catch(_0x416b79){return BPromise[_0x9185('0x24')](_0x416b79);}return _0x205178[_0x9185('0x25')]();};}function saveUpdates(_0x20d06b,_0x235e53){return function(_0x911c5a){if(_0x911c5a){return _0x911c5a['update'](_0x20d06b)[_0x9185('0x26')](function(_0x186523){return _0x186523;});}return null;};}function removeEntity(_0x185ee9,_0x5951c0){return function(_0x503876){if(_0x503876){return _0x503876[_0x9185('0x27')]()['then'](function(){_0x185ee9[_0x9185('0x1b')](0xcc)[_0x9185('0x1c')]();});}};}function handleEntityNotFound(_0xdea2d2,_0x4d6625){return function(_0x24745){if(!_0x24745){_0xdea2d2[_0x9185('0x1a')](0x194);}return _0x24745;};}function handleError(_0x5d1151,_0x226672){_0x226672=_0x226672||0x1f4;return function(_0x5a7d15){logger[_0x9185('0x28')](_0x5a7d15[_0x9185('0x29')]);if(_0x5a7d15[_0x9185('0x2a')]){delete _0x5a7d15[_0x9185('0x2a')];}_0x5d1151['status'](_0x226672)[_0x9185('0x2b')](_0x5a7d15);};}exports['index']=function(_0xe18d0b,_0x549209){var _0x3da3a7={},_0x4a6da8={},_0x39a2f0={'count':0x0,'rows':[]};var _0x54f62e=_[_0x9185('0x2c')](db[_0x9185('0x2d')][_0x9185('0x2e')],function(_0x57ee0f){return{'name':_0x57ee0f[_0x9185('0x2f')],'type':_0x57ee0f[_0x9185('0x30')][_0x9185('0x31')]};});_0x4a6da8[_0x9185('0x32')]=_[_0x9185('0x2c')](_0x54f62e,_0x9185('0x2a'));_0x4a6da8['query']=_['keys'](_0xe18d0b['query']);_0x4a6da8[_0x9185('0x33')]=_['intersection'](_0x4a6da8[_0x9185('0x32')],_0x4a6da8[_0x9185('0x34')]);_0x3da3a7[_0x9185('0x35')]=_['intersection'](_0x4a6da8[_0x9185('0x32')],qs[_0x9185('0x36')](_0xe18d0b[_0x9185('0x34')][_0x9185('0x36')]));_0x3da3a7[_0x9185('0x35')]=_0x3da3a7[_0x9185('0x35')][_0x9185('0x37')]?_0x3da3a7[_0x9185('0x35')]:_0x4a6da8[_0x9185('0x32')];if(!_0xe18d0b[_0x9185('0x34')][_0x9185('0x38')](_0x9185('0x39'))){_0x3da3a7['limit']=qs['limit'](_0xe18d0b[_0x9185('0x34')]['limit']);_0x3da3a7[_0x9185('0x1d')]=qs['offset'](_0xe18d0b['query'][_0x9185('0x1d')]);}_0x3da3a7[_0x9185('0x3a')]=qs[_0x9185('0x3b')](_0xe18d0b[_0x9185('0x34')][_0x9185('0x3b')]);_0x3da3a7[_0x9185('0x3c')]=qs[_0x9185('0x33')](_['pick'](_0xe18d0b['query'],_0x4a6da8[_0x9185('0x33')]),_0x54f62e);if(_0xe18d0b[_0x9185('0x34')][_0x9185('0x3d')]){_0x3da3a7[_0x9185('0x3c')]=_['merge'](_0x3da3a7['where'],{'$or':_[_0x9185('0x2c')](_0x54f62e,function(_0x477847){if(_0x477847['type']!==_0x9185('0x3e')){var _0x4b88f9={};_0x4b88f9[_0x477847[_0x9185('0x2a')]]={'$like':'%'+_0xe18d0b[_0x9185('0x34')]['filter']+'%'};return _0x4b88f9;}})});}_0x3da3a7=_['merge']({},_0x3da3a7,_0xe18d0b[_0x9185('0x3f')]);var _0x53b677={'where':_0x3da3a7[_0x9185('0x3c')]};return db[_0x9185('0x2d')][_0x9185('0x20')](_0x53b677)['then'](function(_0x9a3d24){_0x39a2f0[_0x9185('0x20')]=_0x9a3d24;if(_0xe18d0b[_0x9185('0x34')][_0x9185('0x40')]){_0x3da3a7[_0x9185('0x41')]=[{'all':!![]}];}return db['SugarcrmField'][_0x9185('0x42')](_0x3da3a7);})[_0x9185('0x26')](function(_0x3e0057){_0x39a2f0[_0x9185('0x43')]=_0x3e0057;return _0x39a2f0;})[_0x9185('0x26')](respondWithFilteredResult(_0x549209,_0x3da3a7))['catch'](handleError(_0x549209,null));};exports[_0x9185('0x44')]=function(_0x2adffc,_0x4f5d63){var _0xb96a98={'raw':!![],'where':{'id':_0x2adffc[_0x9185('0x45')]['id']}},_0x19466d={};_0x19466d['model']=_[_0x9185('0x46')](db['SugarcrmField']['rawAttributes']);_0x19466d[_0x9185('0x34')]=_[_0x9185('0x46')](_0x2adffc['query']);_0x19466d[_0x9185('0x33')]=_[_0x9185('0x47')](_0x19466d[_0x9185('0x32')],_0x19466d['query']);_0xb96a98[_0x9185('0x35')]=_[_0x9185('0x47')](_0x19466d[_0x9185('0x32')],qs[_0x9185('0x36')](_0x2adffc[_0x9185('0x34')]['fields']));_0xb96a98[_0x9185('0x35')]=_0xb96a98['attributes']['length']?_0xb96a98[_0x9185('0x35')]:_0x19466d['model'];if(_0x2adffc['query'][_0x9185('0x40')]){_0xb96a98[_0x9185('0x41')]=[{'all':!![]}];}_0xb96a98=_[_0x9185('0x48')]({},_0xb96a98,_0x2adffc[_0x9185('0x3f')]);return db[_0x9185('0x2d')][_0x9185('0x49')](_0xb96a98)['then'](handleEntityNotFound(_0x4f5d63,null))[_0x9185('0x26')](respondWithResult(_0x4f5d63,null))['catch'](handleError(_0x4f5d63,null));};exports[_0x9185('0x4a')]=function(_0x44b4bc,_0x4e14bf){return db['SugarcrmField']['create'](_0x44b4bc[_0x9185('0x4b')],{})['then'](respondWithResult(_0x4e14bf,0xc9))['catch'](handleError(_0x4e14bf,null));};exports['update']=function(_0x2d776d,_0x46d942){if(_0x2d776d[_0x9185('0x4b')]['id']){delete _0x2d776d['body']['id'];}return db[_0x9185('0x2d')][_0x9185('0x49')]({'where':{'id':_0x2d776d[_0x9185('0x45')]['id']}})[_0x9185('0x26')](handleEntityNotFound(_0x46d942,null))[_0x9185('0x26')](saveUpdates(_0x2d776d[_0x9185('0x4b')],null))['then'](respondWithResult(_0x46d942,null))[_0x9185('0x4c')](handleError(_0x46d942,null));};exports[_0x9185('0x27')]=function(_0x28706e,_0x1899cc){return db[_0x9185('0x2d')]['find']({'where':{'id':_0x28706e[_0x9185('0x45')]['id']}})[_0x9185('0x26')](handleEntityNotFound(_0x1899cc,null))['then'](removeEntity(_0x1899cc,null))['catch'](handleError(_0x1899cc,null));};
\ No newline at end of file
+var _0x82f8=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','error','stack','name','send','index','SugarcrmField','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x46b849,_0x16bb99){var _0x12fd75=function(_0x31cd23){while(--_0x31cd23){_0x46b849['push'](_0x46b849['shift']());}};_0x12fd75(++_0x16bb99);}(_0x82f8,0x85));var _0x882f=function(_0x36378c,_0x58b328){_0x36378c=_0x36378c-0x0;var _0x1bcb7f=_0x82f8[_0x36378c];return _0x1bcb7f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x882f('0x0'));var zipdir=require(_0x882f('0x1'));var jsonpatch=require(_0x882f('0x2'));var rp=require(_0x882f('0x3'));var moment=require(_0x882f('0x4'));var BPromise=require(_0x882f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x882f('0x6'));var sox=require('sox');var csv=require(_0x882f('0x7'));var ejs=require(_0x882f('0x8'));var fs=require('fs');var fs_extra=require(_0x882f('0x9'));var _=require(_0x882f('0xa'));var squel=require(_0x882f('0xb'));var crypto=require('crypto');var jsforce=require(_0x882f('0xc'));var deskjs=require(_0x882f('0xd'));var toCsv=require(_0x882f('0x7'));var querystring=require(_0x882f('0xe'));var Papa=require(_0x882f('0xf'));var Redis=require(_0x882f('0x10'));var authService=require(_0x882f('0x11'));var qs=require(_0x882f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x882f('0x13'))(_0x882f('0x14'));var utils=require(_0x882f('0x15'));var config=require(_0x882f('0x16'));var licenseUtil=require(_0x882f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12e0b5,_0x3c5e20){_0x3c5e20=_0x3c5e20||0xcc;return function(_0x517074){if(_0x517074){return _0x12e0b5['sendStatus'](_0x3c5e20);}return _0x12e0b5[_0x882f('0x18')](_0x3c5e20)[_0x882f('0x19')]();};}function respondWithResult(_0x1a8bb6,_0x1a346e){_0x1a346e=_0x1a346e||0xc8;return function(_0x1e7e95){if(_0x1e7e95){return _0x1a8bb6[_0x882f('0x18')](_0x1a346e)[_0x882f('0x1a')](_0x1e7e95);}};}function respondWithFilteredResult(_0x418039,_0x105b7c){return function(_0x47e0d0){if(_0x47e0d0){var _0x18774a=typeof _0x105b7c['offset']===_0x882f('0x1b')&&typeof _0x105b7c[_0x882f('0x1c')]===_0x882f('0x1b');var _0x372979=_0x47e0d0[_0x882f('0x1d')];var _0x278ee7=_0x18774a?0x0:_0x105b7c['offset'];var _0x21d297=_0x18774a?_0x47e0d0[_0x882f('0x1d')]:_0x105b7c[_0x882f('0x1e')]+_0x105b7c[_0x882f('0x1c')];var _0x13879a;if(_0x21d297>=_0x372979){_0x21d297=_0x372979;_0x13879a=0xc8;}else{_0x13879a=0xce;}_0x418039[_0x882f('0x18')](_0x13879a);return _0x418039['set'](_0x882f('0x1f'),_0x278ee7+'-'+_0x21d297+'/'+_0x372979)[_0x882f('0x1a')](_0x47e0d0);}return null;};}function patchUpdates(_0x38b014){return function(_0x2f7ea7){try{jsonpatch[_0x882f('0x20')](_0x2f7ea7,_0x38b014,!![]);}catch(_0x456d6f){return BPromise[_0x882f('0x21')](_0x456d6f);}return _0x2f7ea7['save']();};}function saveUpdates(_0x5e82ce,_0x23b830){return function(_0x23c15c){if(_0x23c15c){return _0x23c15c[_0x882f('0x22')](_0x5e82ce)[_0x882f('0x23')](function(_0x1a91e3){return _0x1a91e3;});}return null;};}function removeEntity(_0x3601af,_0x223160){return function(_0xe2be45){if(_0xe2be45){return _0xe2be45['destroy']()['then'](function(){_0x3601af[_0x882f('0x18')](0xcc)[_0x882f('0x19')]();});}};}function handleEntityNotFound(_0x5ba340,_0x28e3e0){return function(_0x3e6ea1){if(!_0x3e6ea1){_0x5ba340['sendStatus'](0x194);}return _0x3e6ea1;};}function handleError(_0x297caf,_0x1c8736){_0x1c8736=_0x1c8736||0x1f4;return function(_0x5676d8){logger[_0x882f('0x24')](_0x5676d8[_0x882f('0x25')]);if(_0x5676d8['name']){delete _0x5676d8[_0x882f('0x26')];}_0x297caf[_0x882f('0x18')](_0x1c8736)[_0x882f('0x27')](_0x5676d8);};}exports[_0x882f('0x28')]=function(_0x2050c9,_0x31b115){var _0x15c2f5={},_0x538f48={},_0x43ad9d={'count':0x0,'rows':[]};var _0x5148b5=_['map'](db[_0x882f('0x29')][_0x882f('0x2a')],function(_0x14bf92){return{'name':_0x14bf92['fieldName'],'type':_0x14bf92[_0x882f('0x2b')]['key']};});_0x538f48[_0x882f('0x2c')]=_[_0x882f('0x2d')](_0x5148b5,_0x882f('0x26'));_0x538f48[_0x882f('0x2e')]=_['keys'](_0x2050c9[_0x882f('0x2e')]);_0x538f48[_0x882f('0x2f')]=_[_0x882f('0x30')](_0x538f48[_0x882f('0x2c')],_0x538f48[_0x882f('0x2e')]);_0x15c2f5['attributes']=_[_0x882f('0x30')](_0x538f48[_0x882f('0x2c')],qs[_0x882f('0x31')](_0x2050c9[_0x882f('0x2e')][_0x882f('0x31')]));_0x15c2f5[_0x882f('0x32')]=_0x15c2f5[_0x882f('0x32')][_0x882f('0x33')]?_0x15c2f5[_0x882f('0x32')]:_0x538f48[_0x882f('0x2c')];if(!_0x2050c9[_0x882f('0x2e')][_0x882f('0x34')](_0x882f('0x35'))){_0x15c2f5['limit']=qs['limit'](_0x2050c9[_0x882f('0x2e')][_0x882f('0x1c')]);_0x15c2f5[_0x882f('0x1e')]=qs['offset'](_0x2050c9[_0x882f('0x2e')]['offset']);}_0x15c2f5[_0x882f('0x36')]=qs[_0x882f('0x37')](_0x2050c9['query'][_0x882f('0x37')]);_0x15c2f5['where']=qs[_0x882f('0x2f')](_[_0x882f('0x38')](_0x2050c9[_0x882f('0x2e')],_0x538f48[_0x882f('0x2f')]),_0x5148b5);if(_0x2050c9[_0x882f('0x2e')][_0x882f('0x39')]){_0x15c2f5[_0x882f('0x3a')]=_[_0x882f('0x3b')](_0x15c2f5['where'],{'$or':_[_0x882f('0x2d')](_0x5148b5,function(_0x161910){if(_0x161910[_0x882f('0x2b')]!==_0x882f('0x3c')){var _0x5114ae={};_0x5114ae[_0x161910[_0x882f('0x26')]]={'$like':'%'+_0x2050c9[_0x882f('0x2e')][_0x882f('0x39')]+'%'};return _0x5114ae;}})});}_0x15c2f5=_['merge']({},_0x15c2f5,_0x2050c9[_0x882f('0x3d')]);var _0x18f150={'where':_0x15c2f5[_0x882f('0x3a')]};return db[_0x882f('0x29')][_0x882f('0x1d')](_0x18f150)['then'](function(_0x19a7eb){_0x43ad9d[_0x882f('0x1d')]=_0x19a7eb;if(_0x2050c9[_0x882f('0x2e')][_0x882f('0x3e')]){_0x15c2f5[_0x882f('0x3f')]=[{'all':!![]}];}return db[_0x882f('0x29')][_0x882f('0x40')](_0x15c2f5);})[_0x882f('0x23')](function(_0x2cf457){_0x43ad9d[_0x882f('0x41')]=_0x2cf457;return _0x43ad9d;})[_0x882f('0x23')](respondWithFilteredResult(_0x31b115,_0x15c2f5))[_0x882f('0x42')](handleError(_0x31b115,null));};exports[_0x882f('0x43')]=function(_0x49932c,_0x14e767){var _0x3ea54c={'raw':!![],'where':{'id':_0x49932c[_0x882f('0x44')]['id']}},_0x3a5888={};_0x3a5888['model']=_[_0x882f('0x45')](db[_0x882f('0x29')][_0x882f('0x2a')]);_0x3a5888['query']=_[_0x882f('0x45')](_0x49932c[_0x882f('0x2e')]);_0x3a5888['filters']=_[_0x882f('0x30')](_0x3a5888[_0x882f('0x2c')],_0x3a5888[_0x882f('0x2e')]);_0x3ea54c['attributes']=_[_0x882f('0x30')](_0x3a5888['model'],qs[_0x882f('0x31')](_0x49932c[_0x882f('0x2e')][_0x882f('0x31')]));_0x3ea54c[_0x882f('0x32')]=_0x3ea54c[_0x882f('0x32')][_0x882f('0x33')]?_0x3ea54c[_0x882f('0x32')]:_0x3a5888['model'];if(_0x49932c[_0x882f('0x2e')][_0x882f('0x3e')]){_0x3ea54c[_0x882f('0x3f')]=[{'all':!![]}];}_0x3ea54c=_[_0x882f('0x3b')]({},_0x3ea54c,_0x49932c[_0x882f('0x3d')]);return db['SugarcrmField'][_0x882f('0x46')](_0x3ea54c)['then'](handleEntityNotFound(_0x14e767,null))[_0x882f('0x23')](respondWithResult(_0x14e767,null))[_0x882f('0x42')](handleError(_0x14e767,null));};exports[_0x882f('0x47')]=function(_0x3c4cc8,_0x40fbc9){return db['SugarcrmField']['create'](_0x3c4cc8['body'],{})[_0x882f('0x23')](respondWithResult(_0x40fbc9,0xc9))['catch'](handleError(_0x40fbc9,null));};exports[_0x882f('0x22')]=function(_0x1342f2,_0x18ea2a){if(_0x1342f2['body']['id']){delete _0x1342f2[_0x882f('0x48')]['id'];}return db['SugarcrmField'][_0x882f('0x46')]({'where':{'id':_0x1342f2[_0x882f('0x44')]['id']}})[_0x882f('0x23')](handleEntityNotFound(_0x18ea2a,null))[_0x882f('0x23')](saveUpdates(_0x1342f2[_0x882f('0x48')],null))['then'](respondWithResult(_0x18ea2a,null))[_0x882f('0x42')](handleError(_0x18ea2a,null));};exports[_0x882f('0x49')]=function(_0x37567c,_0x4dc063){return db['SugarcrmField'][_0x882f('0x46')]({'where':{'id':_0x37567c[_0x882f('0x44')]['id']}})[_0x882f('0x23')](handleEntityNotFound(_0x4dc063,null))[_0x882f('0x23')](removeEntity(_0x4dc063,null))[_0x882f('0x42')](handleError(_0x4dc063,null));};
\ No newline at end of file
index ca3bf41..29df74d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e0=['./intSugarcrmField.attributes','exports','define','idField','lodash','../../config/logger','api','moment','bluebird'];(function(_0x10e660,_0x311794){var _0x1ff2a2=function(_0x2dd65a){while(--_0x2dd65a){_0x10e660['push'](_0x10e660['shift']());}};_0x1ff2a2(++_0x311794);}(_0xa3e0,0x79));var _0x0a3e=function(_0x4e93ad,_0x47cc05){_0x4e93ad=_0x4e93ad-0x0;var _0x21ca84=_0xa3e0[_0x4e93ad];return _0x21ca84;};'use strict';var _=require(_0x0a3e('0x0'));var util=require('util');var logger=require(_0x0a3e('0x1'))(_0x0a3e('0x2'));var moment=require(_0x0a3e('0x3'));var BPromise=require(_0x0a3e('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(_0x0a3e('0x5'));module[_0x0a3e('0x6')]=function(_0xf4f595,_0x7bbac9){return _0xf4f595[_0x0a3e('0x7')]('SugarcrmField',attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x0a3e('0x8'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7744=['api','moment','request-promise','path','rimraf','../../config/environment','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x337fe4,_0x55b31f){var _0x5cffc6=function(_0x3a8a04){while(--_0x3a8a04){_0x337fe4['push'](_0x337fe4['shift']());}};_0x5cffc6(++_0x55b31f);}(_0x7744,0x1c6));var _0x4774=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0x7744[_0x426711];return _0x592991;};'use strict';var _=require(_0x4774('0x0'));var util=require('util');var logger=require(_0x4774('0x1'))(_0x4774('0x2'));var moment=require(_0x4774('0x3'));var BPromise=require('bluebird');var rp=require(_0x4774('0x4'));var fs=require('fs');var path=require(_0x4774('0x5'));var rimraf=require(_0x4774('0x6'));var config=require(_0x4774('0x7'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0xc67ff6,_0x239055){return _0xc67ff6['define']('SugarcrmField',attributes,{'tableName':_0x4774('0x8'),'paranoid':![],'indexes':[{'name':_0x4774('0x9'),'fields':[_0x4774('0xa'),_0x4774('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f056a94..028844d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1030=['../../mysqldb','rpc','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x7978a5,_0x5a4e10){var _0x5a7ad3=function(_0x45b8f2){while(--_0x45b8f2){_0x7978a5['push'](_0x7978a5['shift']());}};_0x5a7ad3(++_0x5a4e10);}(_0x1030,0x69));var _0x0103=function(_0x48fa63,_0x64aa0e){_0x48fa63=_0x48fa63-0x0;var _0x4ff127=_0x1030[_0x48fa63];return _0x4ff127;};'use strict';var _=require(_0x0103('0x0'));var util=require(_0x0103('0x1'));var moment=require('moment');var BPromise=require(_0x0103('0x2'));var rs=require(_0x0103('0x3'));var fs=require('fs');var Redis=require(_0x0103('0x4'));var db=require(_0x0103('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0103('0x6'));var config=require('../../config/environment');var jayson=require(_0x0103('0x7'));var client=jayson[_0x0103('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d3602,_0x449393,_0x4c7a38){return new BPromise(function(_0x1a2ec6,_0x40cb1b){return client[_0x0103('0x9')](_0x5d3602,_0x4c7a38)[_0x0103('0xa')](function(_0x5dfbb9){logger[_0x0103('0xb')](_0x0103('0xc'),_0x449393,_0x0103('0xd'));logger[_0x0103('0xe')](_0x0103('0xf'),_0x449393,'request\x20sent',JSON[_0x0103('0x10')](_0x5dfbb9));if(_0x5dfbb9[_0x0103('0x11')]){if(_0x5dfbb9[_0x0103('0x11')][_0x0103('0x12')]===0x1f4){logger['error'](_0x0103('0xc'),_0x449393,_0x5dfbb9[_0x0103('0x11')][_0x0103('0x13')]);return _0x40cb1b(_0x5dfbb9[_0x0103('0x11')][_0x0103('0x13')]);}logger[_0x0103('0x11')](_0x0103('0xc'),_0x449393,_0x5dfbb9['error'][_0x0103('0x13')]);return _0x1a2ec6(_0x5dfbb9[_0x0103('0x11')][_0x0103('0x13')]);}else{logger[_0x0103('0xb')](_0x0103('0xc'),_0x449393,_0x0103('0xd'));_0x1a2ec6(_0x5dfbb9[_0x0103('0x14')][_0x0103('0x13')]);}})[_0x0103('0x15')](function(_0x1ab6b1){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x449393,_0x1ab6b1);_0x40cb1b(_0x1ab6b1);});});}
\ No newline at end of file
+var _0x5d91=['moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x5d91,0x1b7));var _0x15d9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5d91[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x15d9('0x0'));var moment=require(_0x15d9('0x1'));var BPromise=require('bluebird');var rs=require(_0x15d9('0x2'));var fs=require('fs');var Redis=require(_0x15d9('0x3'));var db=require(_0x15d9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x15d9('0x5'));var config=require(_0x15d9('0x6'));var jayson=require(_0x15d9('0x7'));var client=jayson[_0x15d9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141c6d,_0x486c81,_0x1273fc){return new BPromise(function(_0x481f11,_0x3f9846){return client[_0x15d9('0x9')](_0x141c6d,_0x1273fc)[_0x15d9('0xa')](function(_0x21f30c){logger[_0x15d9('0xb')](_0x15d9('0xc'),_0x486c81,_0x15d9('0xd'));logger[_0x15d9('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x486c81,'request\x20sent',JSON['stringify'](_0x21f30c));if(_0x21f30c[_0x15d9('0xf')]){if(_0x21f30c[_0x15d9('0xf')][_0x15d9('0x10')]===0x1f4){logger[_0x15d9('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x486c81,_0x21f30c['error'][_0x15d9('0x11')]);return _0x3f9846(_0x21f30c[_0x15d9('0xf')]['message']);}logger[_0x15d9('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x486c81,_0x21f30c[_0x15d9('0xf')][_0x15d9('0x11')]);return _0x481f11(_0x21f30c[_0x15d9('0xf')][_0x15d9('0x11')]);}else{logger[_0x15d9('0xb')]('SugarcrmField,\x20%s,\x20%s',_0x486c81,_0x15d9('0xd'));_0x481f11(_0x21f30c[_0x15d9('0x12')][_0x15d9('0x11')]);}})[_0x15d9('0x13')](function(_0x943004){logger[_0x15d9('0xf')](_0x15d9('0xc'),_0x486c81,_0x943004);_0x3f9846(_0x943004);});});}
\ No newline at end of file
index ad0a82b..190b129 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbed7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0xe23713,_0x419a1b){var _0x1ac7ce=function(_0x2f51c2){while(--_0x2f51c2){_0xe23713['push'](_0xe23713['shift']());}};_0x1ac7ce(++_0x419a1b);}(_0xbed7,0x14b));var _0x7bed=function(_0x48d269,_0x426d6f){_0x48d269=_0x48d269-0x0;var _0x360598=_0xbed7[_0x48d269];return _0x360598;};'use strict';var multer=require(_0x7bed('0x0'));var util=require(_0x7bed('0x1'));var path=require(_0x7bed('0x2'));var timeout=require(_0x7bed('0x3'));var express=require(_0x7bed('0x4'));var router=express['Router']();var fs_extra=require(_0x7bed('0x5'));var auth=require(_0x7bed('0x6'));var interaction=require(_0x7bed('0x7'));var config=require(_0x7bed('0x8'));var controller=require(_0x7bed('0x9'));router[_0x7bed('0xa')]('/',auth[_0x7bed('0xb')](),controller[_0x7bed('0xc')]);router[_0x7bed('0xa')]('/:id',auth[_0x7bed('0xb')](),controller[_0x7bed('0xd')]);router['get'](_0x7bed('0xe'),auth[_0x7bed('0xb')](),controller['getConfigurations']);router[_0x7bed('0xa')](_0x7bed('0xf'),auth['isAuthenticated'](),controller[_0x7bed('0x10')]);router[_0x7bed('0x11')]('/',auth[_0x7bed('0xb')](),controller[_0x7bed('0x12')]);router['post'](_0x7bed('0xe'),auth[_0x7bed('0xb')](),controller[_0x7bed('0x13')]);router[_0x7bed('0x14')](_0x7bed('0x15'),auth[_0x7bed('0xb')](),controller['update']);router[_0x7bed('0x16')](_0x7bed('0x15'),auth[_0x7bed('0xb')](),controller[_0x7bed('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xb07f=['./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44171e,_0x260c65){var _0x25535c=function(_0x68fcde){while(--_0x68fcde){_0x44171e['push'](_0x44171e['shift']());}};_0x25535c(++_0x260c65);}(_0xb07f,0x109));var _0xfb07=function(_0x552787,_0x222c5c){_0x552787=_0x552787-0x0;var _0x25954f=_0xb07f[_0x552787];return _0x25954f;};'use strict';var multer=require(_0xfb07('0x0'));var util=require(_0xfb07('0x1'));var path=require(_0xfb07('0x2'));var timeout=require(_0xfb07('0x3'));var express=require(_0xfb07('0x4'));var router=express[_0xfb07('0x5')]();var fs_extra=require(_0xfb07('0x6'));var auth=require(_0xfb07('0x7'));var interaction=require(_0xfb07('0x8'));var config=require(_0xfb07('0x9'));var controller=require(_0xfb07('0xa'));router['get']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0xc')]);router[_0xfb07('0xd')](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0xf')]);router[_0xfb07('0xd')](_0xfb07('0x10'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x11')]);router[_0xfb07('0xd')](_0xfb07('0x12'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xfb07('0xb')](),controller[_0xfb07('0x13')]);router['post'](_0xfb07('0x10'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x14')]);router[_0xfb07('0x15')](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x16')]);router['delete'](_0xfb07('0xe'),auth[_0xfb07('0xb')](),controller[_0xfb07('0x17')]);module[_0xfb07('0x18')]=router;
\ No newline at end of file
index 29301bd..7343157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc50f=['exports','STRING','HelpDesk'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc50f,0x66));var _0xfc50=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc50f[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xfc50('0x0')]={'name':{'type':Sequelize[_0xfc50('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfc50('0x1')]},'username':{'type':Sequelize[_0xfc50('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfc50('0x1')],'allowNull':![],'defaultValue':_0xfc50('0x2')},'remoteUri':{'type':Sequelize[_0xfc50('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xfbd1=['STRING','HelpDesk','exports'];(function(_0x3c2b2e,_0x3e6e53){var _0x27a338=function(_0x40d29d){while(--_0x40d29d){_0x3c2b2e['push'](_0x3c2b2e['shift']());}};_0x27a338(++_0x3e6e53);}(_0xfbd1,0x1df));var _0x1fbd=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0xfbd1[_0x431ff8];return _0x84ccd4;};'use strict';var Sequelize=require('sequelize');module[_0x1fbd('0x0')]={'name':{'type':Sequelize[_0x1fbd('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1fbd('0x1')]},'username':{'type':Sequelize[_0x1fbd('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1fbd('0x1')],'allowNull':![],'defaultValue':_0x1fbd('0x2')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1fbd('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x1fbd('0x1')],'allowNull':![]}};
\ No newline at end of file
index 57eee23..4860757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0435=['remoteUri','serverUrl','username','accessKey','slice','substring','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','result','GET','describe','sessionName','autogenerated','owner','remove','editable','false','startsWith','cf_','label','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','VtigerAccount','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','keys','length','create','body','find','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','description','moduleName'];(function(_0x310043,_0x435e95){var _0x43283d=function(_0x247ab8){while(--_0x247ab8){_0x310043['push'](_0x310043['shift']());}};_0x43283d(++_0x435e95);}(_0x0435,0x17c));var _0x5043=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x0435[_0x1e6e4e];return _0x3d746b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5043('0x0'));var jsonpatch=require(_0x5043('0x1'));var rp=require(_0x5043('0x2'));var moment=require(_0x5043('0x3'));var BPromise=require(_0x5043('0x4'));var Mustache=require(_0x5043('0x5'));var util=require(_0x5043('0x6'));var path=require('path');var sox=require(_0x5043('0x7'));var csv=require(_0x5043('0x8'));var ejs=require(_0x5043('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5043('0xa'));var crypto=require(_0x5043('0xb'));var jsforce=require(_0x5043('0xc'));var deskjs=require(_0x5043('0xd'));var toCsv=require(_0x5043('0x8'));var querystring=require(_0x5043('0xe'));var Papa=require(_0x5043('0xf'));var Redis=require(_0x5043('0x10'));var authService=require(_0x5043('0x11'));var qs=require(_0x5043('0x12'));var as=require(_0x5043('0x13'));var hardwareService=require(_0x5043('0x14'));var logger=require(_0x5043('0x15'))(_0x5043('0x16'));var utils=require(_0x5043('0x17'));var config=require(_0x5043('0x18'));var licenseUtil=require(_0x5043('0x19'));var db=require(_0x5043('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x46f530,_0xd223c8){_0xd223c8=_0xd223c8||0xcc;return function(_0x2a4991){if(_0x2a4991){return _0x46f530[_0x5043('0x1b')](_0xd223c8);}return _0x46f530[_0x5043('0x1c')](_0xd223c8)['end']();};}function respondWithResult(_0x17ed58,_0x402d47){_0x402d47=_0x402d47||0xc8;return function(_0x113b56){if(_0x113b56){return _0x17ed58[_0x5043('0x1c')](_0x402d47)['json'](_0x113b56);}};}function respondWithFilteredResult(_0x3632b2,_0xda4381){return function(_0x16f648){if(_0x16f648){var _0x534d39=typeof _0xda4381[_0x5043('0x1d')]==='undefined'&&typeof _0xda4381[_0x5043('0x1e')]===_0x5043('0x1f');var _0x97f863=_0x16f648[_0x5043('0x20')];var _0x499481=_0x534d39?0x0:_0xda4381['offset'];var _0x26c942=_0x534d39?_0x16f648[_0x5043('0x20')]:_0xda4381[_0x5043('0x1d')]+_0xda4381[_0x5043('0x1e')];var _0xd5812;if(_0x26c942>=_0x97f863){_0x26c942=_0x97f863;_0xd5812=0xc8;}else{_0xd5812=0xce;}_0x3632b2[_0x5043('0x1c')](_0xd5812);return _0x3632b2[_0x5043('0x21')](_0x5043('0x22'),_0x499481+'-'+_0x26c942+'/'+_0x97f863)['json'](_0x16f648);}return null;};}function patchUpdates(_0x4fd39f){return function(_0x4d8fe1){try{jsonpatch[_0x5043('0x23')](_0x4d8fe1,_0x4fd39f,!![]);}catch(_0x1af94f){return BPromise[_0x5043('0x24')](_0x1af94f);}return _0x4d8fe1['save']();};}function saveUpdates(_0x420c4b,_0x10dbd8){return function(_0x2019ef){if(_0x2019ef){return _0x2019ef[_0x5043('0x25')](_0x420c4b)[_0x5043('0x26')](function(_0x5ae8d2){return _0x5ae8d2;});}return null;};}function removeEntity(_0x535582,_0x249f04){return function(_0x561dbc){if(_0x561dbc){return _0x561dbc[_0x5043('0x27')]()[_0x5043('0x26')](function(){_0x535582[_0x5043('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a31f4,_0x53e749){return function(_0x226903){if(!_0x226903){_0x3a31f4[_0x5043('0x1b')](0x194);}return _0x226903;};}function handleError(_0x27a50f,_0x1e4672){_0x1e4672=_0x1e4672||0x1f4;return function(_0x5565d4){logger[_0x5043('0x28')](_0x5565d4['stack']);if(_0x5565d4[_0x5043('0x29')]){delete _0x5565d4['name'];}_0x27a50f['status'](_0x1e4672)['send'](_0x5565d4);};}exports[_0x5043('0x2a')]=function(_0x1d9305,_0x37c3f8){var _0x44eec3={},_0x21388f={},_0x300019={'count':0x0,'rows':[]};var _0x38af90=_['map'](db[_0x5043('0x2b')][_0x5043('0x2c')],function(_0x1e4aa7){return{'name':_0x1e4aa7['fieldName'],'type':_0x1e4aa7[_0x5043('0x2d')][_0x5043('0x2e')]};});_0x21388f['model']=_['map'](_0x38af90,'name');_0x21388f[_0x5043('0x2f')]=_['keys'](_0x1d9305[_0x5043('0x2f')]);_0x21388f[_0x5043('0x30')]=_[_0x5043('0x31')](_0x21388f[_0x5043('0x32')],_0x21388f[_0x5043('0x2f')]);_0x44eec3[_0x5043('0x33')]=_[_0x5043('0x31')](_0x21388f['model'],qs[_0x5043('0x34')](_0x1d9305[_0x5043('0x2f')][_0x5043('0x34')]));_0x44eec3['attributes']=_0x44eec3['attributes']['length']?_0x44eec3['attributes']:_0x21388f['model'];if(!_0x1d9305[_0x5043('0x2f')][_0x5043('0x35')](_0x5043('0x36'))){_0x44eec3[_0x5043('0x1e')]=qs[_0x5043('0x1e')](_0x1d9305[_0x5043('0x2f')][_0x5043('0x1e')]);_0x44eec3[_0x5043('0x1d')]=qs[_0x5043('0x1d')](_0x1d9305[_0x5043('0x2f')][_0x5043('0x1d')]);}_0x44eec3[_0x5043('0x37')]=qs[_0x5043('0x38')](_0x1d9305[_0x5043('0x2f')][_0x5043('0x38')]);_0x44eec3[_0x5043('0x39')]=qs[_0x5043('0x30')](_['pick'](_0x1d9305[_0x5043('0x2f')],_0x21388f[_0x5043('0x30')]),_0x38af90);if(_0x1d9305['query'][_0x5043('0x3a')]){_0x44eec3[_0x5043('0x39')]=_['merge'](_0x44eec3[_0x5043('0x39')],{'$or':_[_0x5043('0x3b')](_0x38af90,function(_0x289570){if(_0x289570[_0x5043('0x2d')]!==_0x5043('0x3c')){var _0x411c95={};_0x411c95[_0x289570[_0x5043('0x29')]]={'$like':'%'+_0x1d9305['query'][_0x5043('0x3a')]+'%'};return _0x411c95;}})});}_0x44eec3=_[_0x5043('0x3d')]({},_0x44eec3,_0x1d9305[_0x5043('0x3e')]);var _0x45f6de={'where':_0x44eec3[_0x5043('0x39')]};return db['VtigerAccount']['count'](_0x45f6de)[_0x5043('0x26')](function(_0x39cc3){_0x300019[_0x5043('0x20')]=_0x39cc3;if(_0x1d9305[_0x5043('0x2f')][_0x5043('0x3f')]){_0x44eec3[_0x5043('0x40')]=[{'all':!![]}];}return db[_0x5043('0x2b')][_0x5043('0x41')](_0x44eec3);})[_0x5043('0x26')](function(_0x1a9843){_0x300019['rows']=_0x1a9843;return _0x300019;})['then'](respondWithFilteredResult(_0x37c3f8,_0x44eec3))[_0x5043('0x42')](handleError(_0x37c3f8,null));};exports['show']=function(_0xc8ab07,_0x4f1708){var _0x2bb9ec={'raw':![],'where':{'id':_0xc8ab07[_0x5043('0x43')]['id']}},_0x36b773={};_0x36b773[_0x5043('0x32')]=_[_0x5043('0x44')](db[_0x5043('0x2b')]['rawAttributes']);_0x36b773['query']=_[_0x5043('0x44')](_0xc8ab07['query']);_0x36b773['filters']=_[_0x5043('0x31')](_0x36b773[_0x5043('0x32')],_0x36b773[_0x5043('0x2f')]);_0x2bb9ec[_0x5043('0x33')]=_['intersection'](_0x36b773['model'],qs[_0x5043('0x34')](_0xc8ab07[_0x5043('0x2f')][_0x5043('0x34')]));_0x2bb9ec['attributes']=_0x2bb9ec['attributes'][_0x5043('0x45')]?_0x2bb9ec[_0x5043('0x33')]:_0x36b773[_0x5043('0x32')];if(_0xc8ab07['query'][_0x5043('0x3f')]){_0x2bb9ec[_0x5043('0x40')]=[{'all':!![]}];}_0x2bb9ec=_[_0x5043('0x3d')]({},_0x2bb9ec,_0xc8ab07['options']);return db[_0x5043('0x2b')]['find'](_0x2bb9ec)[_0x5043('0x26')](handleEntityNotFound(_0x4f1708,null))[_0x5043('0x26')](respondWithResult(_0x4f1708,null))[_0x5043('0x42')](handleError(_0x4f1708,null));};exports[_0x5043('0x46')]=function(_0x4df89d,_0x538136){return db[_0x5043('0x2b')][_0x5043('0x46')](_0x4df89d['body'],{})[_0x5043('0x26')](respondWithResult(_0x538136,0xc9))['catch'](handleError(_0x538136,null));};exports[_0x5043('0x25')]=function(_0x19ff26,_0x109861){if(_0x19ff26[_0x5043('0x47')]['id']){delete _0x19ff26[_0x5043('0x47')]['id'];}return db[_0x5043('0x2b')][_0x5043('0x48')]({'where':{'id':_0x19ff26[_0x5043('0x43')]['id']}})[_0x5043('0x26')](handleEntityNotFound(_0x109861,null))['then'](saveUpdates(_0x19ff26['body'],null))['then'](respondWithResult(_0x109861,null))['catch'](handleError(_0x109861,null));};exports[_0x5043('0x27')]=function(_0x433a6a,_0x54827d){return db[_0x5043('0x2b')]['find']({'where':{'id':_0x433a6a['params']['id']}})[_0x5043('0x26')](handleEntityNotFound(_0x54827d,null))[_0x5043('0x26')](removeEntity(_0x54827d,null))[_0x5043('0x42')](handleError(_0x54827d,null));};exports[_0x5043('0x49')]=function(_0x129b0e,_0x2d0e29,_0x45d971){var _0x58a5c6={};var _0x5bbcde={};var _0x25e35b;var _0x3c48b4;return db['VtigerAccount'][_0x5043('0x4a')]({'where':{'id':_0x129b0e['params']['id']}})[_0x5043('0x26')](handleEntityNotFound(_0x2d0e29,null))['then'](function(_0x3b9bc8){if(_0x3b9bc8){_0x25e35b=_0x3b9bc8;_0x5bbcde[_0x5043('0x32')]=_[_0x5043('0x44')](db[_0x5043('0x4b')][_0x5043('0x2c')]);_0x5bbcde[_0x5043('0x2f')]=_[_0x5043('0x44')](_0x129b0e[_0x5043('0x2f')]);_0x5bbcde[_0x5043('0x30')]=_['intersection'](_0x5bbcde['model'],_0x5bbcde['query']);_0x58a5c6[_0x5043('0x33')]=_[_0x5043('0x31')](_0x5bbcde[_0x5043('0x32')],qs[_0x5043('0x34')](_0x129b0e[_0x5043('0x2f')]['fields']));_0x58a5c6[_0x5043('0x33')]=_0x58a5c6[_0x5043('0x33')]['length']?_0x58a5c6[_0x5043('0x33')]:_0x5bbcde[_0x5043('0x32')];_0x58a5c6[_0x5043('0x37')]=qs[_0x5043('0x38')](_0x129b0e[_0x5043('0x2f')][_0x5043('0x38')]);_0x58a5c6['where']=qs[_0x5043('0x30')](_['pick'](_0x129b0e[_0x5043('0x2f')],_0x5bbcde[_0x5043('0x30')]));if(_0x129b0e['query'][_0x5043('0x3a')]){_0x58a5c6[_0x5043('0x39')]=_[_0x5043('0x3d')](_0x58a5c6[_0x5043('0x39')],{'$or':_['map'](_0x58a5c6['attributes'],function(_0x320d92){var _0xf5a26c={};_0xf5a26c[_0x320d92]={'$like':'%'+_0x129b0e[_0x5043('0x2f')]['filter']+'%'};return _0xf5a26c;})});}_0x58a5c6=_['merge']({},_0x58a5c6,_0x129b0e[_0x5043('0x3e')]);return _0x25e35b[_0x5043('0x49')](_0x58a5c6);}})[_0x5043('0x26')](function(_0x56de2b){if(_0x56de2b){_0x3c48b4=_0x56de2b[_0x5043('0x45')];if(!_0x129b0e[_0x5043('0x2f')][_0x5043('0x35')](_0x5043('0x36'))){_0x58a5c6[_0x5043('0x1e')]=qs[_0x5043('0x1e')](_0x129b0e[_0x5043('0x2f')][_0x5043('0x1e')]);_0x58a5c6[_0x5043('0x1d')]=qs[_0x5043('0x1d')](_0x129b0e[_0x5043('0x2f')][_0x5043('0x1d')]);}return _0x25e35b['getConfigurations'](_0x58a5c6);}})[_0x5043('0x26')](function(_0x5e2893){if(_0x5e2893){return _0x5e2893?{'count':_0x3c48b4,'rows':_0x5e2893}:null;}})['then'](respondWithResult(_0x2d0e29,null))[_0x5043('0x42')](handleError(_0x2d0e29,null));};exports[_0x5043('0x4c')]=function(_0x35e46b,_0x31f8f6,_0x3402e1){if(_0x35e46b['body']['id']){delete _0x35e46b[_0x5043('0x47')]['id'];}return db['VtigerAccount'][_0x5043('0x4a')]({'where':{'id':_0x35e46b[_0x5043('0x43')]['id']}})['then'](handleEntityNotFound(_0x31f8f6,null))['then'](function(_0x3301d8){if(_0x3301d8){_0x35e46b[_0x5043('0x47')][_0x5043('0x4d')]=_0x3301d8['id'];_0x35e46b[_0x5043('0x47')][_0x5043('0x4e')]=integrations[_0x5043('0x4f')](_0x35e46b[_0x5043('0x47')][_0x5043('0x50')],_0x35e46b[_0x5043('0x47')][_0x5043('0x2d')]);_0x35e46b[_0x5043('0x47')][_0x5043('0x51')]=integrations[_0x5043('0x52')](_0x35e46b[_0x5043('0x47')][_0x5043('0x50')],_0x35e46b[_0x5043('0x47')][_0x5043('0x2d')]);return db[_0x5043('0x4b')][_0x5043('0x46')](_0x35e46b['body'],{'include':[{'model':db[_0x5043('0x53')],'as':_0x5043('0x4e')},{'model':db[_0x5043('0x53')],'as':_0x5043('0x51')}]});}return null;})[_0x5043('0x26')](respondWithResult(_0x31f8f6,null))[_0x5043('0x42')](handleError(_0x31f8f6,null));};var md5=require(_0x5043('0x54'));exports[_0x5043('0x55')]=function(_0x516fa3,_0xaf7d9f,_0x5ec66a){var _0x32428d=null;var _0x58d167=null;var _0x4571cf=null;var _0x4d2291=null;var _0x15fd32='';return db[_0x5043('0x2b')][_0x5043('0x4a')]({'where':{'id':_0x516fa3[_0x5043('0x43')]['id']},'attributes':['id','name','username',_0x5043('0x56'),_0x5043('0x57'),_0x5043('0x58'),_0x5043('0x59'),'accessKey']})['then'](handleEntityNotFound(_0xaf7d9f,null))[_0x5043('0x26')](function(_0x2c64a5){if(_0x2c64a5){_0x32428d=_0x2c64a5[_0x5043('0x5a')];_0x58d167=_0x2c64a5[_0x5043('0x5b')];_0x4571cf=_0x2c64a5[_0x5043('0x57')];_0x15fd32=_0x2c64a5['remoteUri'];var _0x4a23b9=_0x15fd32[_0x5043('0x5c')](-0x1);if(_0x4a23b9==='/'){_0x15fd32=_0x15fd32[_0x5043('0x5d')](0x0,_0x15fd32[_0x5043('0x5e')](_0x4a23b9));}_0x4d2291=util['format'](_0x5043('0x5f'),_0x15fd32);var _0x47f6e8={'method':'GET','uri':_0x4d2291,'qs':{'operation':_0x5043('0x60'),'username':_0x2c64a5[_0x5043('0x5a')]},'json':!![]};return rp(_0x47f6e8);}})['then'](function(_0x1319ae){if(_0x1319ae[_0x5043('0x61')]){var _0x4e7889={'method':_0x5043('0x62'),'uri':_0x4d2291,'form':{'operation':_0x5043('0x63'),'username':_0x32428d,'accessKey':md5(_0x1319ae[_0x5043('0x64')]['token']+_0x58d167)},'json':!![]};return rp(_0x4e7889);}})[_0x5043('0x26')](function(_0x3027c5){if(_0x3027c5[_0x5043('0x61')]){var _0x147318={'method':_0x5043('0x65'),'uri':_0x4d2291,'qs':{'operation':_0x5043('0x66'),'username':_0x32428d,'sessionName':_0x3027c5[_0x5043('0x64')][_0x5043('0x67')],'elementType':_0x4571cf},'json':!![]};return rp(_0x147318);}})[_0x5043('0x26')](function(_0x443a1f){if(_0x443a1f[_0x5043('0x61')]){var _0xa2e5f4=[_0x5043('0x68'),'reference',_0x5043('0x69')];_[_0x5043('0x6a')](_0x443a1f[_0x5043('0x64')][_0x5043('0x34')],function(_0x1f7005){return _0xa2e5f4['includes'](_0x1f7005[_0x5043('0x2d')]['name']);});_[_0x5043('0x6a')](_0x443a1f['result'][_0x5043('0x34')],function(_0x2eb20f){return _0x2eb20f[_0x5043('0x6b')]===_0x5043('0x6c');});return{'count':_0x443a1f[_0x5043('0x64')]['fields'][_0x5043('0x45')],'rows':_[_0x5043('0x3b')](_0x443a1f[_0x5043('0x64')][_0x5043('0x34')],function(_0x43ceeb){return{'id':_0x43ceeb[_0x5043('0x29')],'name':_0x43ceeb['label'],'custom':_[_0x5043('0x6d')](_0x43ceeb[_0x5043('0x29')],_0x5043('0x6e'))?!![]:![],'options':_0x43ceeb['type'][_0x5043('0x29')]==='picklist'&&_0x43ceeb[_0x5043('0x2d')]['picklistValues']['length']>0x0?_[_0x5043('0x3b')](_0x43ceeb['type']['picklistValues'],function(_0x4bae77){return{'name':_0x4bae77[_0x5043('0x6f')],'value':_0x4bae77['value']};}):[]};})};}})['then'](respondWithResult(_0xaf7d9f,null))[_0x5043('0x42')](function(_0x11a041){console[_0x5043('0x70')]('vTiger\x20error:\x20'+_0x11a041);var _0x39d74c=_0x516fa3['query'][_0x5043('0x71')]?0x1f4:_0x11a041[_0x5043('0x72')]||0x1f4;logger[_0x5043('0x28')](_0x5043('0x73'),_0x5043('0x55'),_0x39d74c,JSON[_0x5043('0x74')](_0x11a041));delete _0x11a041[_0x5043('0x29')];if(_0x39d74c===0x191){_0x39d74c=0x190;}_0xaf7d9f[_0x5043('0x1c')](_0x39d74c)['send'](_0x516fa3[_0x5043('0x2f')][_0x5043('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x11a041[_0x5043('0x72')]}:_0x11a041);});};
\ No newline at end of file
+var _0x44c1=['getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','format','GET','getchallenge','success','POST','result','describe','sessionName','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','set','save','then','sendStatus','error','stack','name','send','index','map','VtigerAccount','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','keys','rawAttributes','find','create','body','update','destroy','getConfigurations','findOne','options','hasOwnProperty','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5'];(function(_0x3cde2e,_0x1d3514){var _0x39cae4=function(_0x405ff2){while(--_0x405ff2){_0x3cde2e['push'](_0x3cde2e['shift']());}};_0x39cae4(++_0x1d3514);}(_0x44c1,0x17a));var _0x144c=function(_0x31ad86,_0x2fce0e){_0x31ad86=_0x31ad86-0x0;var _0x5e3989=_0x44c1[_0x31ad86];return _0x5e3989;};'use strict';var emlformat=require(_0x144c('0x0'));var rimraf=require(_0x144c('0x1'));var zipdir=require(_0x144c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x144c('0x3'));var moment=require(_0x144c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x144c('0x5'));var util=require('util');var path=require(_0x144c('0x6'));var sox=require(_0x144c('0x7'));var csv=require(_0x144c('0x8'));var ejs=require(_0x144c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x144c('0xa'));var squel=require(_0x144c('0xb'));var crypto=require('crypto');var jsforce=require(_0x144c('0xc'));var deskjs=require(_0x144c('0xd'));var toCsv=require(_0x144c('0x8'));var querystring=require(_0x144c('0xe'));var Papa=require(_0x144c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x144c('0x10'));var as=require(_0x144c('0x11'));var hardwareService=require(_0x144c('0x12'));var logger=require(_0x144c('0x13'))(_0x144c('0x14'));var utils=require(_0x144c('0x15'));var config=require(_0x144c('0x16'));var licenseUtil=require(_0x144c('0x17'));var db=require(_0x144c('0x18'))['db'];var integrations=require(_0x144c('0x19'));function respondWithStatusCode(_0x302001,_0x4f29a0){_0x4f29a0=_0x4f29a0||0xcc;return function(_0x52c6d3){if(_0x52c6d3){return _0x302001['sendStatus'](_0x4f29a0);}return _0x302001['status'](_0x4f29a0)[_0x144c('0x1a')]();};}function respondWithResult(_0x5b241d,_0x36c2cd){_0x36c2cd=_0x36c2cd||0xc8;return function(_0x443619){if(_0x443619){return _0x5b241d[_0x144c('0x1b')](_0x36c2cd)[_0x144c('0x1c')](_0x443619);}};}function respondWithFilteredResult(_0x57fb39,_0x272413){return function(_0x571bda){if(_0x571bda){var _0x22b22f=typeof _0x272413[_0x144c('0x1d')]==='undefined'&&typeof _0x272413[_0x144c('0x1e')]===_0x144c('0x1f');var _0x41347d=_0x571bda[_0x144c('0x20')];var _0x12d1f8=_0x22b22f?0x0:_0x272413['offset'];var _0x4f7075=_0x22b22f?_0x571bda['count']:_0x272413[_0x144c('0x1d')]+_0x272413[_0x144c('0x1e')];var _0x515365;if(_0x4f7075>=_0x41347d){_0x4f7075=_0x41347d;_0x515365=0xc8;}else{_0x515365=0xce;}_0x57fb39[_0x144c('0x1b')](_0x515365);return _0x57fb39[_0x144c('0x21')]('Content-Range',_0x12d1f8+'-'+_0x4f7075+'/'+_0x41347d)[_0x144c('0x1c')](_0x571bda);}return null;};}function patchUpdates(_0x17f833){return function(_0x279a5e){try{jsonpatch['apply'](_0x279a5e,_0x17f833,!![]);}catch(_0xbe4410){return BPromise['reject'](_0xbe4410);}return _0x279a5e[_0x144c('0x22')]();};}function saveUpdates(_0x815dfa,_0x47d077){return function(_0x1cafe7){if(_0x1cafe7){return _0x1cafe7['update'](_0x815dfa)['then'](function(_0x3c593d){return _0x3c593d;});}return null;};}function removeEntity(_0x57e7af,_0xeef782){return function(_0x5c8915){if(_0x5c8915){return _0x5c8915['destroy']()[_0x144c('0x23')](function(){_0x57e7af['status'](0xcc)[_0x144c('0x1a')]();});}};}function handleEntityNotFound(_0xf1d525,_0x321b39){return function(_0x587008){if(!_0x587008){_0xf1d525[_0x144c('0x24')](0x194);}return _0x587008;};}function handleError(_0x136d26,_0x14b366){_0x14b366=_0x14b366||0x1f4;return function(_0x4e60ed){logger[_0x144c('0x25')](_0x4e60ed[_0x144c('0x26')]);if(_0x4e60ed[_0x144c('0x27')]){delete _0x4e60ed[_0x144c('0x27')];}_0x136d26[_0x144c('0x1b')](_0x14b366)[_0x144c('0x28')](_0x4e60ed);};}exports[_0x144c('0x29')]=function(_0x2829d1,_0x260078){var _0xd0aca8={},_0x1840e4={},_0x1be174={'count':0x0,'rows':[]};var _0x473b43=_[_0x144c('0x2a')](db[_0x144c('0x2b')]['rawAttributes'],function(_0x686604){return{'name':_0x686604['fieldName'],'type':_0x686604[_0x144c('0x2c')][_0x144c('0x2d')]};});_0x1840e4[_0x144c('0x2e')]=_[_0x144c('0x2a')](_0x473b43,_0x144c('0x27'));_0x1840e4[_0x144c('0x2f')]=_['keys'](_0x2829d1[_0x144c('0x2f')]);_0x1840e4[_0x144c('0x30')]=_[_0x144c('0x31')](_0x1840e4[_0x144c('0x2e')],_0x1840e4['query']);_0xd0aca8[_0x144c('0x32')]=_[_0x144c('0x31')](_0x1840e4['model'],qs[_0x144c('0x33')](_0x2829d1['query'][_0x144c('0x33')]));_0xd0aca8[_0x144c('0x32')]=_0xd0aca8[_0x144c('0x32')][_0x144c('0x34')]?_0xd0aca8[_0x144c('0x32')]:_0x1840e4[_0x144c('0x2e')];if(!_0x2829d1[_0x144c('0x2f')]['hasOwnProperty'](_0x144c('0x35'))){_0xd0aca8[_0x144c('0x1e')]=qs[_0x144c('0x1e')](_0x2829d1[_0x144c('0x2f')][_0x144c('0x1e')]);_0xd0aca8['offset']=qs[_0x144c('0x1d')](_0x2829d1[_0x144c('0x2f')][_0x144c('0x1d')]);}_0xd0aca8[_0x144c('0x36')]=qs[_0x144c('0x37')](_0x2829d1['query'][_0x144c('0x37')]);_0xd0aca8[_0x144c('0x38')]=qs[_0x144c('0x30')](_[_0x144c('0x39')](_0x2829d1[_0x144c('0x2f')],_0x1840e4[_0x144c('0x30')]),_0x473b43);if(_0x2829d1[_0x144c('0x2f')][_0x144c('0x3a')]){_0xd0aca8[_0x144c('0x38')]=_[_0x144c('0x3b')](_0xd0aca8[_0x144c('0x38')],{'$or':_[_0x144c('0x2a')](_0x473b43,function(_0xb45275){if(_0xb45275[_0x144c('0x2c')]!==_0x144c('0x3c')){var _0x584cda={};_0x584cda[_0xb45275[_0x144c('0x27')]]={'$like':'%'+_0x2829d1[_0x144c('0x2f')][_0x144c('0x3a')]+'%'};return _0x584cda;}})});}_0xd0aca8=_[_0x144c('0x3b')]({},_0xd0aca8,_0x2829d1['options']);var _0x4da270={'where':_0xd0aca8[_0x144c('0x38')]};return db[_0x144c('0x2b')][_0x144c('0x20')](_0x4da270)['then'](function(_0x2d0ea3){_0x1be174[_0x144c('0x20')]=_0x2d0ea3;if(_0x2829d1['query'][_0x144c('0x3d')]){_0xd0aca8[_0x144c('0x3e')]=[{'all':!![]}];}return db[_0x144c('0x2b')][_0x144c('0x3f')](_0xd0aca8);})[_0x144c('0x23')](function(_0x782c1c){_0x1be174['rows']=_0x782c1c;return _0x1be174;})[_0x144c('0x23')](respondWithFilteredResult(_0x260078,_0xd0aca8))[_0x144c('0x40')](handleError(_0x260078,null));};exports['show']=function(_0x2ab32b,_0x893953){var _0x555c00={'raw':![],'where':{'id':_0x2ab32b[_0x144c('0x41')]['id']}},_0x2b946e={};_0x2b946e['model']=_[_0x144c('0x42')](db[_0x144c('0x2b')][_0x144c('0x43')]);_0x2b946e[_0x144c('0x2f')]=_['keys'](_0x2ab32b[_0x144c('0x2f')]);_0x2b946e[_0x144c('0x30')]=_[_0x144c('0x31')](_0x2b946e['model'],_0x2b946e[_0x144c('0x2f')]);_0x555c00['attributes']=_['intersection'](_0x2b946e[_0x144c('0x2e')],qs['fields'](_0x2ab32b['query']['fields']));_0x555c00['attributes']=_0x555c00[_0x144c('0x32')][_0x144c('0x34')]?_0x555c00[_0x144c('0x32')]:_0x2b946e[_0x144c('0x2e')];if(_0x2ab32b[_0x144c('0x2f')][_0x144c('0x3d')]){_0x555c00['include']=[{'all':!![]}];}_0x555c00=_[_0x144c('0x3b')]({},_0x555c00,_0x2ab32b['options']);return db[_0x144c('0x2b')][_0x144c('0x44')](_0x555c00)[_0x144c('0x23')](handleEntityNotFound(_0x893953,null))[_0x144c('0x23')](respondWithResult(_0x893953,null))[_0x144c('0x40')](handleError(_0x893953,null));};exports[_0x144c('0x45')]=function(_0x9ba570,_0x2148ca){return db['VtigerAccount'][_0x144c('0x45')](_0x9ba570[_0x144c('0x46')],{})[_0x144c('0x23')](respondWithResult(_0x2148ca,0xc9))[_0x144c('0x40')](handleError(_0x2148ca,null));};exports[_0x144c('0x47')]=function(_0x38c938,_0x40a065){if(_0x38c938[_0x144c('0x46')]['id']){delete _0x38c938[_0x144c('0x46')]['id'];}return db['VtigerAccount'][_0x144c('0x44')]({'where':{'id':_0x38c938[_0x144c('0x41')]['id']}})[_0x144c('0x23')](handleEntityNotFound(_0x40a065,null))[_0x144c('0x23')](saveUpdates(_0x38c938['body'],null))[_0x144c('0x23')](respondWithResult(_0x40a065,null))[_0x144c('0x40')](handleError(_0x40a065,null));};exports[_0x144c('0x48')]=function(_0x580ce5,_0x14ce67){return db['VtigerAccount'][_0x144c('0x44')]({'where':{'id':_0x580ce5[_0x144c('0x41')]['id']}})[_0x144c('0x23')](handleEntityNotFound(_0x14ce67,null))[_0x144c('0x23')](removeEntity(_0x14ce67,null))[_0x144c('0x40')](handleError(_0x14ce67,null));};exports[_0x144c('0x49')]=function(_0x3fc66a,_0x1f913c,_0x1bbeb6){var _0x363ba2={};var _0x3e30d4={};var _0xeea423;var _0xcd3586;return db[_0x144c('0x2b')][_0x144c('0x4a')]({'where':{'id':_0x3fc66a[_0x144c('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f913c,null))[_0x144c('0x23')](function(_0x2d618a){if(_0x2d618a){_0xeea423=_0x2d618a;_0x3e30d4['model']=_[_0x144c('0x42')](db['VtigerConfiguration']['rawAttributes']);_0x3e30d4[_0x144c('0x2f')]=_[_0x144c('0x42')](_0x3fc66a[_0x144c('0x2f')]);_0x3e30d4[_0x144c('0x30')]=_['intersection'](_0x3e30d4['model'],_0x3e30d4[_0x144c('0x2f')]);_0x363ba2[_0x144c('0x32')]=_['intersection'](_0x3e30d4[_0x144c('0x2e')],qs[_0x144c('0x33')](_0x3fc66a[_0x144c('0x2f')][_0x144c('0x33')]));_0x363ba2[_0x144c('0x32')]=_0x363ba2[_0x144c('0x32')][_0x144c('0x34')]?_0x363ba2[_0x144c('0x32')]:_0x3e30d4[_0x144c('0x2e')];_0x363ba2[_0x144c('0x36')]=qs[_0x144c('0x37')](_0x3fc66a[_0x144c('0x2f')][_0x144c('0x37')]);_0x363ba2[_0x144c('0x38')]=qs['filters'](_[_0x144c('0x39')](_0x3fc66a[_0x144c('0x2f')],_0x3e30d4[_0x144c('0x30')]));if(_0x3fc66a[_0x144c('0x2f')][_0x144c('0x3a')]){_0x363ba2[_0x144c('0x38')]=_[_0x144c('0x3b')](_0x363ba2[_0x144c('0x38')],{'$or':_[_0x144c('0x2a')](_0x363ba2['attributes'],function(_0x341f0f){var _0xa7d37b={};_0xa7d37b[_0x341f0f]={'$like':'%'+_0x3fc66a[_0x144c('0x2f')][_0x144c('0x3a')]+'%'};return _0xa7d37b;})});}_0x363ba2=_[_0x144c('0x3b')]({},_0x363ba2,_0x3fc66a[_0x144c('0x4b')]);return _0xeea423['getConfigurations'](_0x363ba2);}})[_0x144c('0x23')](function(_0x3a0141){if(_0x3a0141){_0xcd3586=_0x3a0141[_0x144c('0x34')];if(!_0x3fc66a[_0x144c('0x2f')][_0x144c('0x4c')](_0x144c('0x35'))){_0x363ba2[_0x144c('0x1e')]=qs[_0x144c('0x1e')](_0x3fc66a['query'][_0x144c('0x1e')]);_0x363ba2[_0x144c('0x1d')]=qs[_0x144c('0x1d')](_0x3fc66a[_0x144c('0x2f')][_0x144c('0x1d')]);}return _0xeea423[_0x144c('0x49')](_0x363ba2);}})[_0x144c('0x23')](function(_0x145fdb){if(_0x145fdb){return _0x145fdb?{'count':_0xcd3586,'rows':_0x145fdb}:null;}})[_0x144c('0x23')](respondWithResult(_0x1f913c,null))[_0x144c('0x40')](handleError(_0x1f913c,null));};exports['addConfiguration']=function(_0xd73bda,_0x1ae555,_0x19e3b3){if(_0xd73bda[_0x144c('0x46')]['id']){delete _0xd73bda[_0x144c('0x46')]['id'];}return db[_0x144c('0x2b')][_0x144c('0x4a')]({'where':{'id':_0xd73bda[_0x144c('0x41')]['id']}})[_0x144c('0x23')](handleEntityNotFound(_0x1ae555,null))[_0x144c('0x23')](function(_0x34fc13){if(_0x34fc13){_0xd73bda['body'][_0x144c('0x4d')]=_0x34fc13['id'];_0xd73bda[_0x144c('0x46')]['Subjects']=integrations[_0x144c('0x4e')](_0xd73bda['body'][_0x144c('0x4f')],_0xd73bda[_0x144c('0x46')][_0x144c('0x2c')]);_0xd73bda['body'][_0x144c('0x50')]=integrations[_0x144c('0x51')](_0xd73bda[_0x144c('0x46')]['channel'],_0xd73bda[_0x144c('0x46')][_0x144c('0x2c')]);return db[_0x144c('0x52')][_0x144c('0x45')](_0xd73bda[_0x144c('0x46')],{'include':[{'model':db[_0x144c('0x53')],'as':_0x144c('0x54')},{'model':db[_0x144c('0x53')],'as':_0x144c('0x50')}]});}return null;})[_0x144c('0x23')](respondWithResult(_0x1ae555,null))[_0x144c('0x40')](handleError(_0x1ae555,null));};var md5=require(_0x144c('0x55'));exports[_0x144c('0x56')]=function(_0x7b5db1,_0x50493b,_0x4f5cb1){var _0x5b2599=null;var _0x2bbf28=null;var _0x411932=null;var _0x1e115f=null;var _0x2f8d8d='';return db['VtigerAccount'][_0x144c('0x4a')]({'where':{'id':_0x7b5db1[_0x144c('0x41')]['id']},'attributes':['id',_0x144c('0x27'),_0x144c('0x57'),_0x144c('0x58'),_0x144c('0x59'),'remoteUri',_0x144c('0x5a'),_0x144c('0x5b')]})[_0x144c('0x23')](handleEntityNotFound(_0x50493b,null))['then'](function(_0x2e9162){if(_0x2e9162){_0x5b2599=_0x2e9162[_0x144c('0x57')];_0x2bbf28=_0x2e9162[_0x144c('0x5b')];_0x411932=_0x2e9162['moduleName'];_0x2f8d8d=_0x2e9162[_0x144c('0x5c')];var _0xa005c1=_0x2f8d8d[_0x144c('0x5d')](-0x1);if(_0xa005c1==='/'){_0x2f8d8d=_0x2f8d8d[_0x144c('0x5e')](0x0,_0x2f8d8d['lastIndexOf'](_0xa005c1));}_0x1e115f=util[_0x144c('0x5f')]('%s/webservice.php',_0x2f8d8d);var _0x228873={'method':_0x144c('0x60'),'uri':_0x1e115f,'qs':{'operation':_0x144c('0x61'),'username':_0x2e9162[_0x144c('0x57')]},'json':!![]};return rp(_0x228873);}})[_0x144c('0x23')](function(_0x57835e){if(_0x57835e[_0x144c('0x62')]){var _0x77e8b4={'method':_0x144c('0x63'),'uri':_0x1e115f,'form':{'operation':'login','username':_0x5b2599,'accessKey':md5(_0x57835e[_0x144c('0x64')]['token']+_0x2bbf28)},'json':!![]};return rp(_0x77e8b4);}})['then'](function(_0x2c1755){if(_0x2c1755[_0x144c('0x62')]){var _0x5b386a={'method':_0x144c('0x60'),'uri':_0x1e115f,'qs':{'operation':_0x144c('0x65'),'username':_0x5b2599,'sessionName':_0x2c1755[_0x144c('0x64')][_0x144c('0x66')],'elementType':_0x411932},'json':!![]};return rp(_0x5b386a);}})[_0x144c('0x23')](function(_0x1846ac){if(_0x1846ac[_0x144c('0x62')]){var _0x589f15=['autogenerated','reference','owner'];_[_0x144c('0x67')](_0x1846ac[_0x144c('0x64')][_0x144c('0x33')],function(_0x12ae9b){return _0x589f15['includes'](_0x12ae9b[_0x144c('0x2c')][_0x144c('0x27')]);});_[_0x144c('0x67')](_0x1846ac['result'][_0x144c('0x33')],function(_0x46fdfe){return _0x46fdfe[_0x144c('0x68')]===_0x144c('0x69');});return{'count':_0x1846ac['result'][_0x144c('0x33')][_0x144c('0x34')],'rows':_['map'](_0x1846ac['result']['fields'],function(_0xc7c75){return{'id':_0xc7c75[_0x144c('0x27')],'name':_0xc7c75[_0x144c('0x6a')],'custom':_[_0x144c('0x6b')](_0xc7c75['name'],_0x144c('0x6c'))?!![]:![],'options':_0xc7c75[_0x144c('0x2c')][_0x144c('0x27')]===_0x144c('0x6d')&&_0xc7c75[_0x144c('0x2c')][_0x144c('0x6e')][_0x144c('0x34')]>0x0?_[_0x144c('0x2a')](_0xc7c75[_0x144c('0x2c')][_0x144c('0x6e')],function(_0x347f1c){return{'name':_0x347f1c[_0x144c('0x6a')],'value':_0x347f1c[_0x144c('0x6f')]};}):[]};})};}})[_0x144c('0x23')](respondWithResult(_0x50493b,null))['catch'](function(_0x52624a){console[_0x144c('0x70')](_0x144c('0x71')+_0x52624a);var _0x42ef3e=_0x7b5db1[_0x144c('0x2f')]['test']?0x1f4:_0x52624a['statusCode']||0x1f4;logger[_0x144c('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x144c('0x56'),_0x42ef3e,JSON['stringify'](_0x52624a));delete _0x52624a[_0x144c('0x27')];if(_0x42ef3e===0x191){_0x42ef3e=0x190;}_0x50493b['status'](_0x42ef3e)[_0x144c('0x28')](_0x7b5db1[_0x144c('0x2f')]['test']?{'message':_0x144c('0x72'),'statusCode':_0x52624a[_0x144c('0x73')]}:_0x52624a);});};
\ No newline at end of file
index 8a930fd..387977b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda24=['rimraf','../../config/environment','./intVtigerAccount.attributes','define','int_vtiger_accounts','lodash','moment','request-promise','path'];(function(_0x49e3a4,_0x263356){var _0x1e36a5=function(_0x5d427a){while(--_0x5d427a){_0x49e3a4['push'](_0x49e3a4['shift']());}};_0x1e36a5(++_0x263356);}(_0xda24,0x1f4));var _0x4da2=function(_0x585b83,_0x25d403){_0x585b83=_0x585b83-0x0;var _0x2faa24=_0xda24[_0x585b83];return _0x2faa24;};'use strict';var _=require(_0x4da2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x4da2('0x1'));var BPromise=require('bluebird');var rp=require(_0x4da2('0x2'));var fs=require('fs');var path=require(_0x4da2('0x3'));var rimraf=require(_0x4da2('0x4'));var config=require(_0x4da2('0x5'));var attributes=require(_0x4da2('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x554055,_0x489ae2){return _0x554055[_0x4da2('0x7')]('VtigerAccount',attributes,{'tableName':_0x4da2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6634=['lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','int_vtiger_accounts'];(function(_0x1c47d7,_0x58b64c){var _0x15f013=function(_0x13ccb3){while(--_0x13ccb3){_0x1c47d7['push'](_0x1c47d7['shift']());}};_0x15f013(++_0x58b64c);}(_0x6634,0x1ea));var _0x4663=function(_0x4f1a18,_0x5e26cd){_0x4f1a18=_0x4f1a18-0x0;var _0x158bd7=_0x6634[_0x4f1a18];return _0x158bd7;};'use strict';var _=require(_0x4663('0x0'));var util=require(_0x4663('0x1'));var logger=require(_0x4663('0x2'))(_0x4663('0x3'));var moment=require('moment');var BPromise=require(_0x4663('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4663('0x5'));var rimraf=require(_0x4663('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x4663('0x7')]=function(_0x5bdab3,_0x4ddbdc){return _0x5bdab3[_0x4663('0x8')]('VtigerAccount',attributes,{'tableName':_0x4663('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb2679f..5a51ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['findAll','options','attributes','include','map','model','then','catch','ShowVtigerAccount','find','raw','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount'];(function(_0x57fcf5,_0x471abc){var _0x83a451=function(_0x57ed9e){while(--_0x57ed9e){_0x57fcf5['push'](_0x57fcf5['shift']());}};_0x83a451(++_0x471abc);}(_0x351d,0x90));var _0xd351=function(_0x36db25,_0x260ca3){_0x36db25=_0x36db25-0x0;var _0xfdc90c=_0x351d[_0x36db25];return _0xfdc90c;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var moment=require(_0xd351('0x1'));var BPromise=require(_0xd351('0x2'));var rs=require(_0xd351('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd351('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd351('0x5'))(_0xd351('0x6'));var config=require('../../config/environment');var jayson=require(_0xd351('0x7'));var client=jayson[_0xd351('0x8')][_0xd351('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5318b2,_0x16b3f7,_0x235aa0){return new BPromise(function(_0x4e1b06,_0x2e9a2a){return client[_0xd351('0xa')](_0x5318b2,_0x235aa0)['then'](function(_0x586c60){logger[_0xd351('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'));logger[_0xd351('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x16b3f7,_0xd351('0xc'),JSON[_0xd351('0xe')](_0x586c60));if(_0x586c60['error']){if(_0x586c60[_0xd351('0xf')]['code']===0x1f4){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);return _0x2e9a2a(_0x586c60[_0xd351('0xf')]['message']);}logger[_0xd351('0xf')](_0xd351('0x10'),_0x16b3f7,_0x586c60['error'][_0xd351('0x11')]);return _0x4e1b06(_0x586c60[_0xd351('0xf')][_0xd351('0x11')]);}else{logger[_0xd351('0xb')](_0xd351('0x10'),_0x16b3f7,'request\x20sent');_0x4e1b06(_0x586c60[_0xd351('0x12')]['message']);}})['catch'](function(_0x2c6708){logger['error'](_0xd351('0x10'),_0x16b3f7,_0x2c6708);_0x2e9a2a(_0x2c6708);});});}exports[_0xd351('0x13')]=function(_0x4e0164){var _0x4c6693=this;return new Promise(function(_0x1e1a3c,_0x2bfc53){return db[_0xd351('0x14')][_0xd351('0x15')]({'raw':_0x4e0164['options']?_0x4e0164[_0xd351('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4e0164['options']?_0x4e0164[_0xd351('0x16')]['where']||null:null,'attributes':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')][_0xd351('0x17')]||null:null,'limit':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')]['limit']||null:null,'include':_0x4e0164[_0xd351('0x16')]?_0x4e0164[_0xd351('0x16')][_0xd351('0x18')]?_['map'](_0x4e0164[_0xd351('0x16')][_0xd351('0x18')],function(_0x365bbc){return{'model':db[_0x365bbc['model']],'as':_0x365bbc['as'],'attributes':_0x365bbc[_0xd351('0x17')],'include':_0x365bbc[_0xd351('0x18')]?_[_0xd351('0x19')](_0x365bbc[_0xd351('0x18')],function(_0x489c9a){return{'model':db[_0x489c9a[_0xd351('0x1a')]],'as':_0x489c9a['as'],'attributes':_0x489c9a['attributes'],'include':_0x489c9a[_0xd351('0x18')]?_[_0xd351('0x19')](_0x489c9a['include'],function(_0x2648d0){return{'model':db[_0x2648d0['model']],'as':_0x2648d0['as'],'attributes':_0x2648d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd351('0x1b')](function(_0x560be9){logger['info'](_0xd351('0x13'),_0x4e0164);logger['debug'](_0xd351('0x13'),_0x4e0164,JSON[_0xd351('0xe')](_0x560be9));_0x1e1a3c(_0x560be9);})[_0xd351('0x1c')](function(_0x4d3f48){logger[_0xd351('0xf')]('GetVtigerAccount',_0x4d3f48[_0xd351('0x11')],_0x4e0164);_0x2bfc53(_0x4c6693['error'](0x1f4,_0x4d3f48['message']));});});};exports[_0xd351('0x1d')]=function(_0x38c82f){var _0x3f9ef3=this;return new Promise(function(_0x33b43d,_0x48aa96){return db[_0xd351('0x14')][_0xd351('0x1e')]({'raw':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x1f')]===undefined?!![]:![]:!![],'where':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x20')]||null:null,'attributes':_0x38c82f[_0xd351('0x16')]?_0x38c82f['options'][_0xd351('0x17')]||null:null,'include':_0x38c82f[_0xd351('0x16')]?_0x38c82f[_0xd351('0x16')][_0xd351('0x18')]?_['map'](_0x38c82f[_0xd351('0x16')][_0xd351('0x18')],function(_0x3d5b7f){return{'model':db[_0x3d5b7f[_0xd351('0x1a')]],'as':_0x3d5b7f['as'],'attributes':_0x3d5b7f[_0xd351('0x17')],'include':_0x3d5b7f[_0xd351('0x18')]?_[_0xd351('0x19')](_0x3d5b7f[_0xd351('0x18')],function(_0x238663){return{'model':db[_0x238663['model']],'as':_0x238663['as'],'attributes':_0x238663['attributes'],'include':_0x238663[_0xd351('0x18')]?_[_0xd351('0x19')](_0x238663[_0xd351('0x18')],function(_0x2907b7){return{'model':db[_0x2907b7[_0xd351('0x1a')]],'as':_0x2907b7['as'],'attributes':_0x2907b7[_0xd351('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47e2fa){logger[_0xd351('0xb')]('ShowVtigerAccount',_0x38c82f);logger[_0xd351('0xd')](_0xd351('0x1d'),_0x38c82f,JSON[_0xd351('0xe')](_0x47e2fa));_0x33b43d(_0x47e2fa);})[_0xd351('0x1c')](function(_0x33307){logger[_0xd351('0xf')](_0xd351('0x1d'),_0x33307[_0xd351('0x11')],_0x38c82f);_0x48aa96(_0x3f9ef3[_0xd351('0xf')](0x1f4,_0x33307[_0xd351('0x11')]));});});};
\ No newline at end of file
+var _0xefda=['options','raw','attributes','include','map','model','ShowVtigerAccount','VtigerAccount','find','where','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','GetVtigerAccount','findAll'];(function(_0x2b6842,_0x2c2e3d){var _0x5af24d=function(_0x3f5086){while(--_0x3f5086){_0x2b6842['push'](_0x2b6842['shift']());}};_0x5af24d(++_0x2c2e3d);}(_0xefda,0x96));var _0xaefd=function(_0x25e782,_0x55d2dd){_0x25e782=_0x25e782-0x0;var _0x10871f=_0xefda[_0x25e782];return _0x10871f;};'use strict';var _=require(_0xaefd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaefd('0x1'));var rs=require(_0xaefd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaefd('0x3'))['db'];var utils=require(_0xaefd('0x4'));var logger=require(_0xaefd('0x5'))(_0xaefd('0x6'));var config=require(_0xaefd('0x7'));var jayson=require(_0xaefd('0x8'));var client=jayson['client'][_0xaefd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9736,_0x24d10c,_0x1d76f3){return new BPromise(function(_0x4ce248,_0x15193c){return client[_0xaefd('0xa')](_0x3b9736,_0x1d76f3)[_0xaefd('0xb')](function(_0x4d44ed){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x24d10c,_0xaefd('0xc'));logger[_0xaefd('0xd')](_0xaefd('0xe'),_0x24d10c,_0xaefd('0xc'),JSON[_0xaefd('0xf')](_0x4d44ed));if(_0x4d44ed[_0xaefd('0x10')]){if(_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x11')]===0x1f4){logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')]['message']);return _0x15193c(_0x4d44ed[_0xaefd('0x10')]['message']);}logger[_0xaefd('0x10')](_0xaefd('0x12'),_0x24d10c,_0x4d44ed[_0xaefd('0x10')][_0xaefd('0x13')]);return _0x4ce248(_0x4d44ed['error'][_0xaefd('0x13')]);}else{logger[_0xaefd('0x14')](_0xaefd('0x12'),_0x24d10c,_0xaefd('0xc'));_0x4ce248(_0x4d44ed[_0xaefd('0x15')][_0xaefd('0x13')]);}})[_0xaefd('0x16')](function(_0x23d736){logger['error'](_0xaefd('0x12'),_0x24d10c,_0x23d736);_0x15193c(_0x23d736);});});}exports[_0xaefd('0x17')]=function(_0x9748f4){var _0x1737a1=this;return new Promise(function(_0x2db61b,_0x244956){return db['VtigerAccount'][_0xaefd('0x18')]({'raw':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['where']||null:null,'attributes':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'limit':_0x9748f4[_0xaefd('0x19')]?_0x9748f4[_0xaefd('0x19')]['limit']||null:null,'include':_0x9748f4['options']?_0x9748f4['options'][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x9748f4[_0xaefd('0x19')]['include'],function(_0x23060f){return{'model':db[_0x23060f['model']],'as':_0x23060f['as'],'attributes':_0x23060f[_0xaefd('0x1b')],'include':_0x23060f[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x23060f['include'],function(_0x435413){return{'model':db[_0x435413[_0xaefd('0x1e')]],'as':_0x435413['as'],'attributes':_0x435413[_0xaefd('0x1b')],'include':_0x435413[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x435413['include'],function(_0x2fe27e){return{'model':db[_0x2fe27e['model']],'as':_0x2fe27e['as'],'attributes':_0x2fe27e[_0xaefd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x5470bd){logger[_0xaefd('0x14')](_0xaefd('0x17'),_0x9748f4);logger['debug'](_0xaefd('0x17'),_0x9748f4,JSON[_0xaefd('0xf')](_0x5470bd));_0x2db61b(_0x5470bd);})[_0xaefd('0x16')](function(_0x4c0898){logger[_0xaefd('0x10')]('GetVtigerAccount',_0x4c0898[_0xaefd('0x13')],_0x9748f4);_0x244956(_0x1737a1['error'](0x1f4,_0x4c0898['message']));});});};exports[_0xaefd('0x1f')]=function(_0x1b470c){var _0x4a032d=this;return new Promise(function(_0x578378,_0x4ee0c1){return db[_0xaefd('0x20')][_0xaefd('0x21')]({'raw':_0x1b470c['options']?_0x1b470c['options'][_0xaefd('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x22')]||null:null,'attributes':_0x1b470c['options']?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1b')]||null:null,'include':_0x1b470c[_0xaefd('0x19')]?_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1b470c[_0xaefd('0x19')][_0xaefd('0x1c')],function(_0x3e3fe2){return{'model':db[_0x3e3fe2[_0xaefd('0x1e')]],'as':_0x3e3fe2['as'],'attributes':_0x3e3fe2[_0xaefd('0x1b')],'include':_0x3e3fe2[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x3e3fe2[_0xaefd('0x1c')],function(_0x1ffec4){return{'model':db[_0x1ffec4[_0xaefd('0x1e')]],'as':_0x1ffec4['as'],'attributes':_0x1ffec4['attributes'],'include':_0x1ffec4[_0xaefd('0x1c')]?_[_0xaefd('0x1d')](_0x1ffec4[_0xaefd('0x1c')],function(_0x59aec9){return{'model':db[_0x59aec9[_0xaefd('0x1e')]],'as':_0x59aec9['as'],'attributes':_0x59aec9['attributes']};}):[]};}):[]};}):[]:[]})[_0xaefd('0xb')](function(_0x3498d9){logger[_0xaefd('0x14')](_0xaefd('0x1f'),_0x1b470c);logger[_0xaefd('0xd')](_0xaefd('0x1f'),_0x1b470c,JSON[_0xaefd('0xf')](_0x3498d9));_0x578378(_0x3498d9);})[_0xaefd('0x16')](function(_0x407bea){logger[_0xaefd('0x10')](_0xaefd('0x1f'),_0x407bea[_0xaefd('0x13')],_0x1b470c);_0x4ee0c1(_0x4a032d[_0xaefd('0x10')](0x1f4,_0x407bea[_0xaefd('0x13')]));});});};
\ No newline at end of file
index d54e354..b6aa063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdea5=['../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','/:id','update','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x42f50b,_0x3d5fa7){var _0x454ece=function(_0x34e2a6){while(--_0x34e2a6){_0x42f50b['push'](_0x42f50b['shift']());}};_0x454ece(++_0x3d5fa7);}(_0xdea5,0xae));var _0x5dea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdea5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5dea('0x0'));var util=require(_0x5dea('0x1'));var path=require(_0x5dea('0x2'));var timeout=require('connect-timeout');var express=require(_0x5dea('0x3'));var router=express[_0x5dea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5dea('0x5'));var config=require(_0x5dea('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x5dea('0x7')]('/',auth[_0x5dea('0x8')](),controller['index']);router['get']('/:id',auth[_0x5dea('0x8')](),controller[_0x5dea('0x9')]);router[_0x5dea('0x7')](_0x5dea('0xa'),auth[_0x5dea('0x8')](),controller[_0x5dea('0xb')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x5dea('0xc')]);router[_0x5dea('0x7')]('/:id/descriptions',auth[_0x5dea('0x8')](),controller[_0x5dea('0xd')]);router[_0x5dea('0xe')]('/',auth[_0x5dea('0x8')](),controller[_0x5dea('0xf')]);router[_0x5dea('0x10')](_0x5dea('0x11'),auth[_0x5dea('0x8')](),controller[_0x5dea('0x12')]);router['delete']('/:id',auth[_0x5dea('0x8')](),controller['destroy']);module[_0x5dea('0x13')]=router;
\ No newline at end of file
+var _0x07b4=['delete','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update'];(function(_0x22ea66,_0x30123a){var _0x529757=function(_0x2340e){while(--_0x2340e){_0x22ea66['push'](_0x22ea66['shift']());}};_0x529757(++_0x30123a);}(_0x07b4,0x16a));var _0x407b=function(_0x4e5591,_0x47630b){_0x4e5591=_0x4e5591-0x0;var _0x31fa15=_0x07b4[_0x4e5591];return _0x31fa15;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x407b('0x0'));var timeout=require(_0x407b('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x407b('0x2'));var auth=require(_0x407b('0x3'));var interaction=require(_0x407b('0x4'));var config=require('../../config/environment');var controller=require(_0x407b('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x407b('0x6')]);router[_0x407b('0x7')](_0x407b('0x8'),auth['isAuthenticated'](),controller[_0x407b('0x9')]);router['get'](_0x407b('0xa'),auth[_0x407b('0xb')](),controller['getFields']);router[_0x407b('0x7')](_0x407b('0xc'),auth[_0x407b('0xb')](),controller[_0x407b('0xd')]);router['get'](_0x407b('0xe'),auth[_0x407b('0xb')](),controller[_0x407b('0xf')]);router[_0x407b('0x10')]('/',auth[_0x407b('0xb')](),controller['create']);router['put']('/:id',auth[_0x407b('0xb')](),controller[_0x407b('0x11')]);router[_0x407b('0x12')](_0x407b('0x8'),auth[_0x407b('0xb')](),controller['destroy']);module[_0x407b('0x13')]=router;
\ No newline at end of file
index c0b1f52..0b8d9dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x305b=['exports','STRING'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0x305b,0xfe));var _0xb305=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x305b[_0x4b2cc6];return _0x3e0b08;};'use strict';var Sequelize=require('sequelize');module[_0xb305('0x0')]={'name':{'type':Sequelize[_0xb305('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1f8d=['exports','STRING','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1f8d,0x16d));var _0xd1f8=function(_0x42b088,_0x27c453){_0x42b088=_0x42b088-0x0;var _0x1aa2dd=_0x1f8d[_0x42b088];return _0x1aa2dd;};'use strict';var Sequelize=require(_0xd1f8('0x0'));module[_0xd1f8('0x1')]={'name':{'type':Sequelize[_0xd1f8('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7b4a68f..5be9ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e6=['update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','VtigerField','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save'];(function(_0x4be338,_0x390655){var _0x568f6a=function(_0x128636){while(--_0x128636){_0x4be338['push'](_0x4be338['shift']());}};_0x568f6a(++_0x390655);}(_0x64e6,0xcd));var _0x664e=function(_0x2b7f56,_0x41bc7d){_0x2b7f56=_0x2b7f56-0x0;var _0x36896d=_0x64e6[_0x2b7f56];return _0x36896d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x664e('0x0'));var zipdir=require(_0x664e('0x1'));var jsonpatch=require(_0x664e('0x2'));var rp=require(_0x664e('0x3'));var moment=require('moment');var BPromise=require(_0x664e('0x4'));var Mustache=require(_0x664e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x664e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x664e('0x7'));var _=require(_0x664e('0x8'));var squel=require('squel');var crypto=require(_0x664e('0x9'));var jsforce=require(_0x664e('0xa'));var deskjs=require(_0x664e('0xb'));var toCsv=require(_0x664e('0x6'));var querystring=require(_0x664e('0xc'));var Papa=require(_0x664e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x664e('0xe'));var as=require(_0x664e('0xf'));var hardwareService=require(_0x664e('0x10'));var logger=require(_0x664e('0x11'))(_0x664e('0x12'));var utils=require(_0x664e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x664e('0x14'));var db=require(_0x664e('0x15'))['db'];function respondWithStatusCode(_0x5650b5,_0x11002b){_0x11002b=_0x11002b||0xcc;return function(_0x599cec){if(_0x599cec){return _0x5650b5[_0x664e('0x16')](_0x11002b);}return _0x5650b5[_0x664e('0x17')](_0x11002b)[_0x664e('0x18')]();};}function respondWithResult(_0x55d989,_0x243848){_0x243848=_0x243848||0xc8;return function(_0x4837bd){if(_0x4837bd){return _0x55d989[_0x664e('0x17')](_0x243848)[_0x664e('0x19')](_0x4837bd);}};}function respondWithFilteredResult(_0x6f8b76,_0x103dfc){return function(_0x3f5b28){if(_0x3f5b28){var _0x2fc3f5=typeof _0x103dfc[_0x664e('0x1a')]===_0x664e('0x1b')&&typeof _0x103dfc['limit']===_0x664e('0x1b');var _0x3c0009=_0x3f5b28['count'];var _0x3e55cc=_0x2fc3f5?0x0:_0x103dfc['offset'];var _0x2766f0=_0x2fc3f5?_0x3f5b28[_0x664e('0x1c')]:_0x103dfc[_0x664e('0x1a')]+_0x103dfc[_0x664e('0x1d')];var _0x13af09;if(_0x2766f0>=_0x3c0009){_0x2766f0=_0x3c0009;_0x13af09=0xc8;}else{_0x13af09=0xce;}_0x6f8b76['status'](_0x13af09);return _0x6f8b76[_0x664e('0x1e')](_0x664e('0x1f'),_0x3e55cc+'-'+_0x2766f0+'/'+_0x3c0009)['json'](_0x3f5b28);}return null;};}function patchUpdates(_0x1a6a64){return function(_0x5975ce){try{jsonpatch[_0x664e('0x20')](_0x5975ce,_0x1a6a64,!![]);}catch(_0x398f7d){return BPromise[_0x664e('0x21')](_0x398f7d);}return _0x5975ce[_0x664e('0x22')]();};}function saveUpdates(_0x5596de,_0x6ce3d8){return function(_0x356de4){if(_0x356de4){return _0x356de4[_0x664e('0x23')](_0x5596de)[_0x664e('0x24')](function(_0x2be563){return _0x2be563;});}return null;};}function removeEntity(_0x5cecb8,_0x411ed8){return function(_0x41d0c5){if(_0x41d0c5){return _0x41d0c5[_0x664e('0x25')]()[_0x664e('0x24')](function(){_0x5cecb8[_0x664e('0x17')](0xcc)[_0x664e('0x18')]();});}};}function handleEntityNotFound(_0x540a60,_0x62a545){return function(_0x2aa309){if(!_0x2aa309){_0x540a60[_0x664e('0x16')](0x194);}return _0x2aa309;};}function handleError(_0x1ac58e,_0x3b0713){_0x3b0713=_0x3b0713||0x1f4;return function(_0x58c1b1){logger[_0x664e('0x26')](_0x58c1b1[_0x664e('0x27')]);if(_0x58c1b1['name']){delete _0x58c1b1[_0x664e('0x28')];}_0x1ac58e['status'](_0x3b0713)['send'](_0x58c1b1);};}exports[_0x664e('0x29')]=function(_0x311c49,_0x154d48){var _0x52c830={},_0xa86fd0={},_0x16112a={'count':0x0,'rows':[]};var _0x59d8ed=_[_0x664e('0x2a')](db['VtigerConfiguration'][_0x664e('0x2b')],function(_0x1fc1fa){return{'name':_0x1fc1fa[_0x664e('0x2c')],'type':_0x1fc1fa[_0x664e('0x2d')][_0x664e('0x2e')]};});_0xa86fd0['model']=_['map'](_0x59d8ed,'name');_0xa86fd0[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x311c49[_0x664e('0x2f')]);_0xa86fd0[_0x664e('0x31')]=_['intersection'](_0xa86fd0[_0x664e('0x32')],_0xa86fd0['query']);_0x52c830[_0x664e('0x33')]=_[_0x664e('0x34')](_0xa86fd0[_0x664e('0x32')],qs[_0x664e('0x35')](_0x311c49['query'][_0x664e('0x35')]));_0x52c830[_0x664e('0x33')]=_0x52c830['attributes'][_0x664e('0x36')]?_0x52c830[_0x664e('0x33')]:_0xa86fd0[_0x664e('0x32')];if(!_0x311c49['query']['hasOwnProperty']('nolimit')){_0x52c830[_0x664e('0x1d')]=qs['limit'](_0x311c49['query'][_0x664e('0x1d')]);_0x52c830[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x311c49[_0x664e('0x2f')][_0x664e('0x1a')]);}_0x52c830[_0x664e('0x37')]=qs[_0x664e('0x38')](_0x311c49[_0x664e('0x2f')]['sort']);_0x52c830[_0x664e('0x39')]=qs[_0x664e('0x31')](_[_0x664e('0x3a')](_0x311c49[_0x664e('0x2f')],_0xa86fd0['filters']),_0x59d8ed);if(_0x311c49[_0x664e('0x2f')][_0x664e('0x3b')]){_0x52c830[_0x664e('0x39')]=_[_0x664e('0x3c')](_0x52c830[_0x664e('0x39')],{'$or':_[_0x664e('0x2a')](_0x59d8ed,function(_0x4ba05a){if(_0x4ba05a['type']!==_0x664e('0x3d')){var _0x3935cb={};_0x3935cb[_0x4ba05a[_0x664e('0x28')]]={'$like':'%'+_0x311c49['query'][_0x664e('0x3b')]+'%'};return _0x3935cb;}})});}_0x52c830=_[_0x664e('0x3c')]({},_0x52c830,_0x311c49[_0x664e('0x3e')]);var _0x277bd7={'where':_0x52c830['where']};return db[_0x664e('0x3f')][_0x664e('0x1c')](_0x277bd7)[_0x664e('0x24')](function(_0x1fc130){_0x16112a[_0x664e('0x1c')]=_0x1fc130;if(_0x311c49[_0x664e('0x2f')][_0x664e('0x40')]){_0x52c830[_0x664e('0x41')]=[{'all':!![]}];}return db[_0x664e('0x3f')][_0x664e('0x42')](_0x52c830);})[_0x664e('0x24')](function(_0x2bcffa){_0x16112a[_0x664e('0x43')]=_0x2bcffa;return _0x16112a;})['then'](respondWithFilteredResult(_0x154d48,_0x52c830))[_0x664e('0x44')](handleError(_0x154d48,null));};exports[_0x664e('0x45')]=function(_0x55b4de,_0x3979e6){var _0x198704={'raw':![],'where':{'id':_0x55b4de[_0x664e('0x46')]['id']}},_0x2c75e9={};_0x2c75e9[_0x664e('0x32')]=_[_0x664e('0x30')](db[_0x664e('0x3f')][_0x664e('0x2b')]);_0x2c75e9[_0x664e('0x2f')]=_['keys'](_0x55b4de[_0x664e('0x2f')]);_0x2c75e9['filters']=_[_0x664e('0x34')](_0x2c75e9[_0x664e('0x32')],_0x2c75e9['query']);_0x198704[_0x664e('0x33')]=_[_0x664e('0x34')](_0x2c75e9[_0x664e('0x32')],qs[_0x664e('0x35')](_0x55b4de[_0x664e('0x2f')]['fields']));_0x198704[_0x664e('0x33')]=_0x198704['attributes'][_0x664e('0x36')]?_0x198704[_0x664e('0x33')]:_0x2c75e9[_0x664e('0x32')];if(_0x55b4de[_0x664e('0x2f')][_0x664e('0x40')]){_0x198704[_0x664e('0x41')]=[{'all':!![]}];}_0x198704=_[_0x664e('0x3c')]({},_0x198704,_0x55b4de[_0x664e('0x3e')]);return db[_0x664e('0x3f')][_0x664e('0x47')](_0x198704)[_0x664e('0x24')](handleEntityNotFound(_0x3979e6,null))[_0x664e('0x24')](respondWithResult(_0x3979e6,null))[_0x664e('0x44')](handleError(_0x3979e6,null));};exports[_0x664e('0x48')]=function(_0x5ab54f,_0x148a2e){return db['VtigerConfiguration'][_0x664e('0x48')](_0x5ab54f[_0x664e('0x49')],{})['then'](respondWithResult(_0x148a2e,0xc9))['catch'](handleError(_0x148a2e,null));};exports['update']=function(_0x2131ab,_0x15fd98){if(_0x2131ab[_0x664e('0x49')]['id']){delete _0x2131ab[_0x664e('0x49')]['id'];}return db[_0x664e('0x3f')][_0x664e('0x47')]({'where':{'id':_0x2131ab[_0x664e('0x46')]['id']}})['then'](handleEntityNotFound(_0x15fd98,null))['then'](saveUpdates(_0x2131ab[_0x664e('0x49')],null))['then'](respondWithResult(_0x15fd98,null))[_0x664e('0x44')](handleError(_0x15fd98,null));};exports[_0x664e('0x25')]=function(_0x42a862,_0x14a72b){return db['VtigerConfiguration']['find']({'where':{'id':_0x42a862[_0x664e('0x46')]['id']}})[_0x664e('0x24')](handleEntityNotFound(_0x14a72b,null))[_0x664e('0x24')](removeEntity(_0x14a72b,null))[_0x664e('0x44')](handleError(_0x14a72b,null));};exports[_0x664e('0x4a')]=function(_0x3875d4,_0x47b499,_0x39c386){var _0x1a05c2={};var _0x21081c={};var _0x3d4ee3;var _0x1e3ca4;return db[_0x664e('0x3f')][_0x664e('0x4b')]({'where':{'id':_0x3875d4[_0x664e('0x46')]['id']}})['then'](handleEntityNotFound(_0x47b499,null))[_0x664e('0x24')](function(_0xf81749){if(_0xf81749){_0x3d4ee3=_0xf81749;_0x21081c['model']=_[_0x664e('0x30')](db['VtigerField'][_0x664e('0x2b')]);_0x21081c[_0x664e('0x2f')]=_[_0x664e('0x30')](_0x3875d4[_0x664e('0x2f')]);_0x21081c[_0x664e('0x31')]=_[_0x664e('0x34')](_0x21081c[_0x664e('0x32')],_0x21081c['query']);_0x1a05c2[_0x664e('0x33')]=_[_0x664e('0x34')](_0x21081c['model'],qs['fields'](_0x3875d4['query'][_0x664e('0x35')]));_0x1a05c2['attributes']=_0x1a05c2[_0x664e('0x33')]['length']?_0x1a05c2[_0x664e('0x33')]:_0x21081c[_0x664e('0x32')];_0x1a05c2[_0x664e('0x37')]=qs[_0x664e('0x38')](_0x3875d4[_0x664e('0x2f')][_0x664e('0x38')]);_0x1a05c2['where']=qs[_0x664e('0x31')](_[_0x664e('0x3a')](_0x3875d4[_0x664e('0x2f')],_0x21081c[_0x664e('0x31')]));if(_0x3875d4[_0x664e('0x2f')][_0x664e('0x3b')]){_0x1a05c2[_0x664e('0x39')]=_[_0x664e('0x3c')](_0x1a05c2['where'],{'$or':_[_0x664e('0x2a')](_0x1a05c2[_0x664e('0x33')],function(_0x23070c){var _0x25a103={};_0x25a103[_0x23070c]={'$like':'%'+_0x3875d4[_0x664e('0x2f')][_0x664e('0x3b')]+'%'};return _0x25a103;})});}_0x1a05c2=_[_0x664e('0x3c')]({},_0x1a05c2,_0x3875d4[_0x664e('0x3e')]);return _0x3d4ee3[_0x664e('0x4a')](_0x1a05c2);}})['then'](function(_0x27127b){if(_0x27127b){_0x1e3ca4=_0x27127b[_0x664e('0x36')];if(!_0x3875d4[_0x664e('0x2f')][_0x664e('0x4c')]('nolimit')){_0x1a05c2[_0x664e('0x1d')]=qs[_0x664e('0x1d')](_0x3875d4[_0x664e('0x2f')][_0x664e('0x1d')]);_0x1a05c2[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x3875d4[_0x664e('0x2f')]['offset']);}return _0x3d4ee3[_0x664e('0x4a')](_0x1a05c2);}})[_0x664e('0x24')](function(_0x387503){if(_0x387503){return _0x387503?{'count':_0x1e3ca4,'rows':_0x387503}:null;}})[_0x664e('0x24')](respondWithResult(_0x47b499,null))[_0x664e('0x44')](handleError(_0x47b499,null));};exports[_0x664e('0x4d')]=function(_0x2f03c1,_0x2ccd02,_0xadea2a){var _0x3e55fd={};var _0x35c9fc={};var _0x4a7bf0;var _0x43825a;return db[_0x664e('0x3f')][_0x664e('0x4b')]({'where':{'id':_0x2f03c1[_0x664e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ccd02,null))['then'](function(_0x1930f9){if(_0x1930f9){_0x4a7bf0=_0x1930f9;_0x35c9fc[_0x664e('0x32')]=_[_0x664e('0x30')](db[_0x664e('0x4e')][_0x664e('0x2b')]);_0x35c9fc[_0x664e('0x2f')]=_['keys'](_0x2f03c1[_0x664e('0x2f')]);_0x35c9fc[_0x664e('0x31')]=_[_0x664e('0x34')](_0x35c9fc['model'],_0x35c9fc[_0x664e('0x2f')]);_0x3e55fd[_0x664e('0x33')]=_[_0x664e('0x34')](_0x35c9fc[_0x664e('0x32')],qs['fields'](_0x2f03c1['query'][_0x664e('0x35')]));_0x3e55fd[_0x664e('0x33')]=_0x3e55fd[_0x664e('0x33')][_0x664e('0x36')]?_0x3e55fd['attributes']:_0x35c9fc['model'];_0x3e55fd[_0x664e('0x37')]=qs[_0x664e('0x38')](_0x2f03c1[_0x664e('0x2f')][_0x664e('0x38')]);_0x3e55fd[_0x664e('0x39')]=qs[_0x664e('0x31')](_['pick'](_0x2f03c1[_0x664e('0x2f')],_0x35c9fc['filters']));if(_0x2f03c1['query'][_0x664e('0x3b')]){_0x3e55fd['where']=_[_0x664e('0x3c')](_0x3e55fd[_0x664e('0x39')],{'$or':_['map'](_0x3e55fd['attributes'],function(_0x3e7515){var _0x2364b6={};_0x2364b6[_0x3e7515]={'$like':'%'+_0x2f03c1[_0x664e('0x2f')]['filter']+'%'};return _0x2364b6;})});}_0x3e55fd=_['merge']({},_0x3e55fd,_0x2f03c1[_0x664e('0x3e')]);return _0x4a7bf0['getSubjects'](_0x3e55fd);}})[_0x664e('0x24')](function(_0x221f8c){if(_0x221f8c){_0x43825a=_0x221f8c[_0x664e('0x36')];if(!_0x2f03c1['query'][_0x664e('0x4c')]('nolimit')){_0x3e55fd[_0x664e('0x1d')]=qs[_0x664e('0x1d')](_0x2f03c1['query'][_0x664e('0x1d')]);_0x3e55fd[_0x664e('0x1a')]=qs['offset'](_0x2f03c1['query'][_0x664e('0x1a')]);}return _0x4a7bf0[_0x664e('0x4d')](_0x3e55fd);}})[_0x664e('0x24')](function(_0x11c7be){if(_0x11c7be){return _0x11c7be?{'count':_0x43825a,'rows':_0x11c7be}:null;}})[_0x664e('0x24')](respondWithResult(_0x2ccd02,null))[_0x664e('0x44')](handleError(_0x2ccd02,null));};exports[_0x664e('0x4f')]=function(_0x573ce3,_0x1a658c,_0x2b1e25){var _0x130109={};var _0x680a75={};var _0x563231;var _0x329f84;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x573ce3['params']['id']}})[_0x664e('0x24')](handleEntityNotFound(_0x1a658c,null))[_0x664e('0x24')](function(_0x26be27){if(_0x26be27){_0x563231=_0x26be27;_0x680a75['model']=_['keys'](db['VtigerField'][_0x664e('0x2b')]);_0x680a75[_0x664e('0x2f')]=_['keys'](_0x573ce3[_0x664e('0x2f')]);_0x680a75[_0x664e('0x31')]=_[_0x664e('0x34')](_0x680a75[_0x664e('0x32')],_0x680a75[_0x664e('0x2f')]);_0x130109['attributes']=_['intersection'](_0x680a75['model'],qs['fields'](_0x573ce3[_0x664e('0x2f')]['fields']));_0x130109[_0x664e('0x33')]=_0x130109['attributes']['length']?_0x130109[_0x664e('0x33')]:_0x680a75[_0x664e('0x32')];_0x130109[_0x664e('0x37')]=qs['sort'](_0x573ce3['query'][_0x664e('0x38')]);_0x130109[_0x664e('0x39')]=qs[_0x664e('0x31')](_[_0x664e('0x3a')](_0x573ce3[_0x664e('0x2f')],_0x680a75[_0x664e('0x31')]));if(_0x573ce3[_0x664e('0x2f')][_0x664e('0x3b')]){_0x130109['where']=_[_0x664e('0x3c')](_0x130109[_0x664e('0x39')],{'$or':_['map'](_0x130109['attributes'],function(_0x2b1f2c){var _0x3a5297={};_0x3a5297[_0x2b1f2c]={'$like':'%'+_0x573ce3[_0x664e('0x2f')]['filter']+'%'};return _0x3a5297;})});}_0x130109=_[_0x664e('0x3c')]({},_0x130109,_0x573ce3[_0x664e('0x3e')]);return _0x563231[_0x664e('0x4f')](_0x130109);}})[_0x664e('0x24')](function(_0xc02448){if(_0xc02448){_0x329f84=_0xc02448[_0x664e('0x36')];if(!_0x573ce3[_0x664e('0x2f')]['hasOwnProperty']('nolimit')){_0x130109['limit']=qs['limit'](_0x573ce3[_0x664e('0x2f')][_0x664e('0x1d')]);_0x130109[_0x664e('0x1a')]=qs[_0x664e('0x1a')](_0x573ce3[_0x664e('0x2f')][_0x664e('0x1a')]);}return _0x563231[_0x664e('0x4f')](_0x130109);}})['then'](function(_0x1dd2b3){if(_0x1dd2b3){return _0x1dd2b3?{'count':_0x329f84,'rows':_0x1dd2b3}:null;}})['then'](respondWithResult(_0x1a658c,null))['catch'](handleError(_0x1a658c,null));};
\ No newline at end of file
+var _0xbaa9=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','include','find','create','body','params','findOne','VtigerField','getFields','hasOwnProperty','getSubjects','getDescriptions','pick','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbaa9,0x188));var _0x9baa=function(_0x389a4b,_0x5970ee){_0x389a4b=_0x389a4b-0x0;var _0x327112=_0xbaa9[_0x389a4b];return _0x327112;};'use strict';var emlformat=require(_0x9baa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9baa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9baa('0x2'));var BPromise=require(_0x9baa('0x3'));var Mustache=require(_0x9baa('0x4'));var util=require(_0x9baa('0x5'));var path=require(_0x9baa('0x6'));var sox=require(_0x9baa('0x7'));var csv=require('to-csv');var ejs=require(_0x9baa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9baa('0x9'));var squel=require(_0x9baa('0xa'));var crypto=require(_0x9baa('0xb'));var jsforce=require(_0x9baa('0xc'));var deskjs=require(_0x9baa('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9baa('0xe'));var Papa=require(_0x9baa('0xf'));var Redis=require(_0x9baa('0x10'));var authService=require(_0x9baa('0x11'));var qs=require(_0x9baa('0x12'));var as=require(_0x9baa('0x13'));var hardwareService=require(_0x9baa('0x14'));var logger=require(_0x9baa('0x15'))('api');var utils=require(_0x9baa('0x16'));var config=require(_0x9baa('0x17'));var licenseUtil=require(_0x9baa('0x18'));var db=require(_0x9baa('0x19'))['db'];function respondWithStatusCode(_0x26625b,_0x23fafb){_0x23fafb=_0x23fafb||0xcc;return function(_0x476541){if(_0x476541){return _0x26625b[_0x9baa('0x1a')](_0x23fafb);}return _0x26625b[_0x9baa('0x1b')](_0x23fafb)[_0x9baa('0x1c')]();};}function respondWithResult(_0x328aed,_0x3ce189){_0x3ce189=_0x3ce189||0xc8;return function(_0x4800fe){if(_0x4800fe){return _0x328aed[_0x9baa('0x1b')](_0x3ce189)[_0x9baa('0x1d')](_0x4800fe);}};}function respondWithFilteredResult(_0x2bc692,_0x42e0c6){return function(_0x37b43d){if(_0x37b43d){var _0x30e514=typeof _0x42e0c6['offset']==='undefined'&&typeof _0x42e0c6[_0x9baa('0x1e')]===_0x9baa('0x1f');var _0x1e3a68=_0x37b43d[_0x9baa('0x20')];var _0xd18640=_0x30e514?0x0:_0x42e0c6['offset'];var _0x4e806e=_0x30e514?_0x37b43d[_0x9baa('0x20')]:_0x42e0c6[_0x9baa('0x21')]+_0x42e0c6[_0x9baa('0x1e')];var _0x119d80;if(_0x4e806e>=_0x1e3a68){_0x4e806e=_0x1e3a68;_0x119d80=0xc8;}else{_0x119d80=0xce;}_0x2bc692[_0x9baa('0x1b')](_0x119d80);return _0x2bc692[_0x9baa('0x22')](_0x9baa('0x23'),_0xd18640+'-'+_0x4e806e+'/'+_0x1e3a68)[_0x9baa('0x1d')](_0x37b43d);}return null;};}function patchUpdates(_0x15762e){return function(_0x346662){try{jsonpatch[_0x9baa('0x24')](_0x346662,_0x15762e,!![]);}catch(_0x570ca8){return BPromise['reject'](_0x570ca8);}return _0x346662['save']();};}function saveUpdates(_0x492e26,_0x278e34){return function(_0x5c8a80){if(_0x5c8a80){return _0x5c8a80[_0x9baa('0x25')](_0x492e26)[_0x9baa('0x26')](function(_0x193108){return _0x193108;});}return null;};}function removeEntity(_0x12772f,_0x1478ac){return function(_0x42a0b8){if(_0x42a0b8){return _0x42a0b8[_0x9baa('0x27')]()[_0x9baa('0x26')](function(){_0x12772f['status'](0xcc)[_0x9baa('0x1c')]();});}};}function handleEntityNotFound(_0x4efa7d,_0x245b0e){return function(_0x497217){if(!_0x497217){_0x4efa7d[_0x9baa('0x1a')](0x194);}return _0x497217;};}function handleError(_0x14adde,_0x561253){_0x561253=_0x561253||0x1f4;return function(_0x59ceb9){logger[_0x9baa('0x28')](_0x59ceb9[_0x9baa('0x29')]);if(_0x59ceb9[_0x9baa('0x2a')]){delete _0x59ceb9[_0x9baa('0x2a')];}_0x14adde[_0x9baa('0x1b')](_0x561253)[_0x9baa('0x2b')](_0x59ceb9);};}exports[_0x9baa('0x2c')]=function(_0x296151,_0x18ce3){var _0x41154a={},_0x5923d7={},_0x46a536={'count':0x0,'rows':[]};var _0x579e16=_['map'](db[_0x9baa('0x2d')][_0x9baa('0x2e')],function(_0xbb7a91){return{'name':_0xbb7a91[_0x9baa('0x2f')],'type':_0xbb7a91[_0x9baa('0x30')][_0x9baa('0x31')]};});_0x5923d7[_0x9baa('0x32')]=_[_0x9baa('0x33')](_0x579e16,_0x9baa('0x2a'));_0x5923d7[_0x9baa('0x34')]=_[_0x9baa('0x35')](_0x296151['query']);_0x5923d7[_0x9baa('0x36')]=_[_0x9baa('0x37')](_0x5923d7[_0x9baa('0x32')],_0x5923d7[_0x9baa('0x34')]);_0x41154a[_0x9baa('0x38')]=_['intersection'](_0x5923d7[_0x9baa('0x32')],qs[_0x9baa('0x39')](_0x296151[_0x9baa('0x34')]['fields']));_0x41154a[_0x9baa('0x38')]=_0x41154a[_0x9baa('0x38')][_0x9baa('0x3a')]?_0x41154a[_0x9baa('0x38')]:_0x5923d7['model'];if(!_0x296151[_0x9baa('0x34')]['hasOwnProperty'](_0x9baa('0x3b'))){_0x41154a[_0x9baa('0x1e')]=qs['limit'](_0x296151[_0x9baa('0x34')][_0x9baa('0x1e')]);_0x41154a[_0x9baa('0x21')]=qs[_0x9baa('0x21')](_0x296151['query'][_0x9baa('0x21')]);}_0x41154a[_0x9baa('0x3c')]=qs['sort'](_0x296151[_0x9baa('0x34')][_0x9baa('0x3d')]);_0x41154a[_0x9baa('0x3e')]=qs['filters'](_['pick'](_0x296151[_0x9baa('0x34')],_0x5923d7[_0x9baa('0x36')]),_0x579e16);if(_0x296151[_0x9baa('0x34')][_0x9baa('0x3f')]){_0x41154a[_0x9baa('0x3e')]=_[_0x9baa('0x40')](_0x41154a[_0x9baa('0x3e')],{'$or':_[_0x9baa('0x33')](_0x579e16,function(_0x52ac4e){if(_0x52ac4e[_0x9baa('0x30')]!==_0x9baa('0x41')){var _0xb6c456={};_0xb6c456[_0x52ac4e[_0x9baa('0x2a')]]={'$like':'%'+_0x296151[_0x9baa('0x34')][_0x9baa('0x3f')]+'%'};return _0xb6c456;}})});}_0x41154a=_[_0x9baa('0x40')]({},_0x41154a,_0x296151[_0x9baa('0x42')]);var _0xd967e5={'where':_0x41154a['where']};return db[_0x9baa('0x2d')][_0x9baa('0x20')](_0xd967e5)[_0x9baa('0x26')](function(_0x363680){_0x46a536[_0x9baa('0x20')]=_0x363680;if(_0x296151['query'][_0x9baa('0x43')]){_0x41154a['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x41154a);})[_0x9baa('0x26')](function(_0x3ac8dc){_0x46a536[_0x9baa('0x44')]=_0x3ac8dc;return _0x46a536;})[_0x9baa('0x26')](respondWithFilteredResult(_0x18ce3,_0x41154a))[_0x9baa('0x45')](handleError(_0x18ce3,null));};exports['show']=function(_0x7e537,_0x31412c){var _0x55e8c6={'raw':![],'where':{'id':_0x7e537['params']['id']}},_0x585dff={};_0x585dff[_0x9baa('0x32')]=_[_0x9baa('0x35')](db['VtigerConfiguration'][_0x9baa('0x2e')]);_0x585dff['query']=_['keys'](_0x7e537[_0x9baa('0x34')]);_0x585dff[_0x9baa('0x36')]=_['intersection'](_0x585dff[_0x9baa('0x32')],_0x585dff[_0x9baa('0x34')]);_0x55e8c6['attributes']=_[_0x9baa('0x37')](_0x585dff[_0x9baa('0x32')],qs[_0x9baa('0x39')](_0x7e537[_0x9baa('0x34')][_0x9baa('0x39')]));_0x55e8c6[_0x9baa('0x38')]=_0x55e8c6[_0x9baa('0x38')][_0x9baa('0x3a')]?_0x55e8c6[_0x9baa('0x38')]:_0x585dff[_0x9baa('0x32')];if(_0x7e537[_0x9baa('0x34')][_0x9baa('0x43')]){_0x55e8c6[_0x9baa('0x46')]=[{'all':!![]}];}_0x55e8c6=_[_0x9baa('0x40')]({},_0x55e8c6,_0x7e537['options']);return db[_0x9baa('0x2d')][_0x9baa('0x47')](_0x55e8c6)[_0x9baa('0x26')](handleEntityNotFound(_0x31412c,null))[_0x9baa('0x26')](respondWithResult(_0x31412c,null))[_0x9baa('0x45')](handleError(_0x31412c,null));};exports[_0x9baa('0x48')]=function(_0x3af066,_0x8b08ea){return db[_0x9baa('0x2d')][_0x9baa('0x48')](_0x3af066[_0x9baa('0x49')],{})[_0x9baa('0x26')](respondWithResult(_0x8b08ea,0xc9))[_0x9baa('0x45')](handleError(_0x8b08ea,null));};exports[_0x9baa('0x25')]=function(_0x19bb77,_0x56528d){if(_0x19bb77[_0x9baa('0x49')]['id']){delete _0x19bb77[_0x9baa('0x49')]['id'];}return db['VtigerConfiguration'][_0x9baa('0x47')]({'where':{'id':_0x19bb77['params']['id']}})['then'](handleEntityNotFound(_0x56528d,null))[_0x9baa('0x26')](saveUpdates(_0x19bb77[_0x9baa('0x49')],null))[_0x9baa('0x26')](respondWithResult(_0x56528d,null))[_0x9baa('0x45')](handleError(_0x56528d,null));};exports[_0x9baa('0x27')]=function(_0x399705,_0xca4af8){return db['VtigerConfiguration'][_0x9baa('0x47')]({'where':{'id':_0x399705[_0x9baa('0x4a')]['id']}})[_0x9baa('0x26')](handleEntityNotFound(_0xca4af8,null))[_0x9baa('0x26')](removeEntity(_0xca4af8,null))[_0x9baa('0x45')](handleError(_0xca4af8,null));};exports['getFields']=function(_0x2f8ee7,_0x5f1ed3,_0xa66eb9){var _0x3b6213={};var _0xc3e5e8={};var _0x54d5a7;var _0x286504;return db['VtigerConfiguration'][_0x9baa('0x4b')]({'where':{'id':_0x2f8ee7['params']['id']}})[_0x9baa('0x26')](handleEntityNotFound(_0x5f1ed3,null))['then'](function(_0x4619b4){if(_0x4619b4){_0x54d5a7=_0x4619b4;_0xc3e5e8['model']=_[_0x9baa('0x35')](db[_0x9baa('0x4c')][_0x9baa('0x2e')]);_0xc3e5e8[_0x9baa('0x34')]=_[_0x9baa('0x35')](_0x2f8ee7[_0x9baa('0x34')]);_0xc3e5e8[_0x9baa('0x36')]=_[_0x9baa('0x37')](_0xc3e5e8['model'],_0xc3e5e8[_0x9baa('0x34')]);_0x3b6213[_0x9baa('0x38')]=_[_0x9baa('0x37')](_0xc3e5e8[_0x9baa('0x32')],qs[_0x9baa('0x39')](_0x2f8ee7['query'][_0x9baa('0x39')]));_0x3b6213['attributes']=_0x3b6213['attributes'][_0x9baa('0x3a')]?_0x3b6213[_0x9baa('0x38')]:_0xc3e5e8[_0x9baa('0x32')];_0x3b6213['order']=qs[_0x9baa('0x3d')](_0x2f8ee7[_0x9baa('0x34')]['sort']);_0x3b6213[_0x9baa('0x3e')]=qs[_0x9baa('0x36')](_['pick'](_0x2f8ee7[_0x9baa('0x34')],_0xc3e5e8[_0x9baa('0x36')]));if(_0x2f8ee7[_0x9baa('0x34')][_0x9baa('0x3f')]){_0x3b6213[_0x9baa('0x3e')]=_[_0x9baa('0x40')](_0x3b6213[_0x9baa('0x3e')],{'$or':_[_0x9baa('0x33')](_0x3b6213[_0x9baa('0x38')],function(_0xa774ba){var _0xfb6baf={};_0xfb6baf[_0xa774ba]={'$like':'%'+_0x2f8ee7[_0x9baa('0x34')][_0x9baa('0x3f')]+'%'};return _0xfb6baf;})});}_0x3b6213=_['merge']({},_0x3b6213,_0x2f8ee7[_0x9baa('0x42')]);return _0x54d5a7[_0x9baa('0x4d')](_0x3b6213);}})[_0x9baa('0x26')](function(_0x4dfab0){if(_0x4dfab0){_0x286504=_0x4dfab0[_0x9baa('0x3a')];if(!_0x2f8ee7[_0x9baa('0x34')][_0x9baa('0x4e')](_0x9baa('0x3b'))){_0x3b6213[_0x9baa('0x1e')]=qs[_0x9baa('0x1e')](_0x2f8ee7[_0x9baa('0x34')][_0x9baa('0x1e')]);_0x3b6213[_0x9baa('0x21')]=qs[_0x9baa('0x21')](_0x2f8ee7[_0x9baa('0x34')][_0x9baa('0x21')]);}return _0x54d5a7[_0x9baa('0x4d')](_0x3b6213);}})[_0x9baa('0x26')](function(_0x259721){if(_0x259721){return _0x259721?{'count':_0x286504,'rows':_0x259721}:null;}})['then'](respondWithResult(_0x5f1ed3,null))[_0x9baa('0x45')](handleError(_0x5f1ed3,null));};exports[_0x9baa('0x4f')]=function(_0x2595ec,_0x375b87,_0x30cd35){var _0x564b16={};var _0x5a564e={};var _0x1ccccb;var _0x2f5764;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x2595ec[_0x9baa('0x4a')]['id']}})[_0x9baa('0x26')](handleEntityNotFound(_0x375b87,null))[_0x9baa('0x26')](function(_0x2a94f5){if(_0x2a94f5){_0x1ccccb=_0x2a94f5;_0x5a564e[_0x9baa('0x32')]=_['keys'](db[_0x9baa('0x4c')][_0x9baa('0x2e')]);_0x5a564e['query']=_['keys'](_0x2595ec[_0x9baa('0x34')]);_0x5a564e[_0x9baa('0x36')]=_[_0x9baa('0x37')](_0x5a564e[_0x9baa('0x32')],_0x5a564e[_0x9baa('0x34')]);_0x564b16[_0x9baa('0x38')]=_['intersection'](_0x5a564e['model'],qs['fields'](_0x2595ec[_0x9baa('0x34')][_0x9baa('0x39')]));_0x564b16[_0x9baa('0x38')]=_0x564b16['attributes']['length']?_0x564b16[_0x9baa('0x38')]:_0x5a564e[_0x9baa('0x32')];_0x564b16[_0x9baa('0x3c')]=qs[_0x9baa('0x3d')](_0x2595ec['query']['sort']);_0x564b16[_0x9baa('0x3e')]=qs[_0x9baa('0x36')](_['pick'](_0x2595ec[_0x9baa('0x34')],_0x5a564e['filters']));if(_0x2595ec[_0x9baa('0x34')][_0x9baa('0x3f')]){_0x564b16[_0x9baa('0x3e')]=_[_0x9baa('0x40')](_0x564b16[_0x9baa('0x3e')],{'$or':_[_0x9baa('0x33')](_0x564b16['attributes'],function(_0x575b18){var _0x475522={};_0x475522[_0x575b18]={'$like':'%'+_0x2595ec[_0x9baa('0x34')][_0x9baa('0x3f')]+'%'};return _0x475522;})});}_0x564b16=_[_0x9baa('0x40')]({},_0x564b16,_0x2595ec['options']);return _0x1ccccb[_0x9baa('0x4f')](_0x564b16);}})[_0x9baa('0x26')](function(_0x3fed8d){if(_0x3fed8d){_0x2f5764=_0x3fed8d[_0x9baa('0x3a')];if(!_0x2595ec[_0x9baa('0x34')]['hasOwnProperty'](_0x9baa('0x3b'))){_0x564b16['limit']=qs[_0x9baa('0x1e')](_0x2595ec[_0x9baa('0x34')][_0x9baa('0x1e')]);_0x564b16[_0x9baa('0x21')]=qs['offset'](_0x2595ec[_0x9baa('0x34')][_0x9baa('0x21')]);}return _0x1ccccb[_0x9baa('0x4f')](_0x564b16);}})['then'](function(_0x3aac5b){if(_0x3aac5b){return _0x3aac5b?{'count':_0x2f5764,'rows':_0x3aac5b}:null;}})[_0x9baa('0x26')](respondWithResult(_0x375b87,null))['catch'](handleError(_0x375b87,null));};exports[_0x9baa('0x50')]=function(_0x140221,_0x12f6bf,_0x5cd0e8){var _0x1728a9={};var _0x141fc6={};var _0x28fc5e;var _0x11d4aa;return db[_0x9baa('0x2d')][_0x9baa('0x4b')]({'where':{'id':_0x140221[_0x9baa('0x4a')]['id']}})[_0x9baa('0x26')](handleEntityNotFound(_0x12f6bf,null))[_0x9baa('0x26')](function(_0xfb24ef){if(_0xfb24ef){_0x28fc5e=_0xfb24ef;_0x141fc6[_0x9baa('0x32')]=_['keys'](db[_0x9baa('0x4c')]['rawAttributes']);_0x141fc6[_0x9baa('0x34')]=_['keys'](_0x140221[_0x9baa('0x34')]);_0x141fc6[_0x9baa('0x36')]=_[_0x9baa('0x37')](_0x141fc6[_0x9baa('0x32')],_0x141fc6[_0x9baa('0x34')]);_0x1728a9[_0x9baa('0x38')]=_[_0x9baa('0x37')](_0x141fc6[_0x9baa('0x32')],qs['fields'](_0x140221[_0x9baa('0x34')][_0x9baa('0x39')]));_0x1728a9[_0x9baa('0x38')]=_0x1728a9['attributes'][_0x9baa('0x3a')]?_0x1728a9['attributes']:_0x141fc6['model'];_0x1728a9[_0x9baa('0x3c')]=qs[_0x9baa('0x3d')](_0x140221[_0x9baa('0x34')][_0x9baa('0x3d')]);_0x1728a9[_0x9baa('0x3e')]=qs[_0x9baa('0x36')](_[_0x9baa('0x51')](_0x140221[_0x9baa('0x34')],_0x141fc6['filters']));if(_0x140221[_0x9baa('0x34')][_0x9baa('0x3f')]){_0x1728a9[_0x9baa('0x3e')]=_[_0x9baa('0x40')](_0x1728a9['where'],{'$or':_['map'](_0x1728a9[_0x9baa('0x38')],function(_0x290363){var _0x47ea4c={};_0x47ea4c[_0x290363]={'$like':'%'+_0x140221[_0x9baa('0x34')][_0x9baa('0x3f')]+'%'};return _0x47ea4c;})});}_0x1728a9=_[_0x9baa('0x40')]({},_0x1728a9,_0x140221[_0x9baa('0x42')]);return _0x28fc5e[_0x9baa('0x50')](_0x1728a9);}})[_0x9baa('0x26')](function(_0x14def2){if(_0x14def2){_0x11d4aa=_0x14def2['length'];if(!_0x140221[_0x9baa('0x34')][_0x9baa('0x4e')](_0x9baa('0x3b'))){_0x1728a9[_0x9baa('0x1e')]=qs[_0x9baa('0x1e')](_0x140221[_0x9baa('0x34')][_0x9baa('0x1e')]);_0x1728a9[_0x9baa('0x21')]=qs[_0x9baa('0x21')](_0x140221[_0x9baa('0x34')][_0x9baa('0x21')]);}return _0x28fc5e[_0x9baa('0x50')](_0x1728a9);}})['then'](function(_0x560ec1){if(_0x560ec1){return _0x560ec1?{'count':_0x11d4aa,'rows':_0x560ec1}:null;}})[_0x9baa('0x26')](respondWithResult(_0x12f6bf,null))['catch'](handleError(_0x12f6bf,null));};
\ No newline at end of file
index 65e8897..c22aee1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ce0=['VtigerConfiguration','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define'];(function(_0x142c9e,_0x141cd7){var _0x6d03b6=function(_0x588b23){while(--_0x588b23){_0x142c9e['push'](_0x142c9e['shift']());}};_0x6d03b6(++_0x141cd7);}(_0x5ce0,0x155));var _0x05ce=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0x5ce0[_0x7dbd65];return _0x33d551;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x05ce('0x0'))('api');var moment=require(_0x05ce('0x1'));var BPromise=require('bluebird');var rp=require(_0x05ce('0x2'));var fs=require('fs');var path=require(_0x05ce('0x3'));var rimraf=require(_0x05ce('0x4'));var config=require(_0x05ce('0x5'));var attributes=require(_0x05ce('0x6'));module[_0x05ce('0x7')]=function(_0x21e279,_0x4572fb){return _0x21e279[_0x05ce('0x8')](_0x05ce('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa2ec=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x163ebb,_0x12848e){var _0x24675d=function(_0x2ad7d0){while(--_0x2ad7d0){_0x163ebb['push'](_0x163ebb['shift']());}};_0x24675d(++_0x12848e);}(_0xa2ec,0xed));var _0xca2e=function(_0x4864ea,_0x7764ed){_0x4864ea=_0x4864ea-0x0;var _0x12e74f=_0xa2ec[_0x4864ea];return _0x12e74f;};'use strict';var _=require(_0xca2e('0x0'));var util=require(_0xca2e('0x1'));var logger=require(_0xca2e('0x2'))(_0xca2e('0x3'));var moment=require(_0xca2e('0x4'));var BPromise=require(_0xca2e('0x5'));var rp=require(_0xca2e('0x6'));var fs=require('fs');var path=require(_0xca2e('0x7'));var rimraf=require('rimraf');var config=require(_0xca2e('0x8'));var attributes=require(_0xca2e('0x9'));module[_0xca2e('0xa')]=function(_0x3c6812,_0x54ccb8){return _0x3c6812[_0xca2e('0xb')](_0xca2e('0xc'),attributes,{'tableName':_0xca2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8d020cc..8ccaf30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f1c=['catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent'];(function(_0x2c8f98,_0x2a8009){var _0x5e1a16=function(_0x171cd3){while(--_0x171cd3){_0x2c8f98['push'](_0x2c8f98['shift']());}};_0x5e1a16(++_0x2a8009);}(_0x9f1c,0x17d));var _0xc9f1=function(_0x52106f,_0x202244){_0x52106f=_0x52106f-0x0;var _0x430652=_0x9f1c[_0x52106f];return _0x430652;};'use strict';var _=require(_0xc9f1('0x0'));var util=require('util');var moment=require(_0xc9f1('0x1'));var BPromise=require('bluebird');var rs=require(_0xc9f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc9f1('0x3'))['db'];var utils=require(_0xc9f1('0x4'));var logger=require(_0xc9f1('0x5'))(_0xc9f1('0x6'));var config=require(_0xc9f1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c3b53,_0x1b11c0,_0x3f5000){return new BPromise(function(_0x214d46,_0x36451a){return client[_0xc9f1('0x9')](_0x5c3b53,_0x3f5000)[_0xc9f1('0xa')](function(_0x578209){logger[_0xc9f1('0xb')](_0xc9f1('0xc'),_0x1b11c0,'request\x20sent');logger[_0xc9f1('0xd')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1b11c0,'request\x20sent',JSON[_0xc9f1('0xe')](_0x578209));if(_0x578209[_0xc9f1('0xf')]){if(_0x578209[_0xc9f1('0xf')][_0xc9f1('0x10')]===0x1f4){logger[_0xc9f1('0xf')](_0xc9f1('0xc'),_0x1b11c0,_0x578209['error'][_0xc9f1('0x11')]);return _0x36451a(_0x578209[_0xc9f1('0xf')][_0xc9f1('0x11')]);}logger[_0xc9f1('0xf')](_0xc9f1('0xc'),_0x1b11c0,_0x578209[_0xc9f1('0xf')]['message']);return _0x214d46(_0x578209['error']['message']);}else{logger[_0xc9f1('0xb')](_0xc9f1('0xc'),_0x1b11c0,_0xc9f1('0x12'));_0x214d46(_0x578209['result']['message']);}})[_0xc9f1('0x13')](function(_0x381498){logger[_0xc9f1('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x1b11c0,_0x381498);_0x36451a(_0x381498);});});}
\ No newline at end of file
+var _0x3980=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0x3980,0x189));var _0x0398=function(_0x4b48b5,_0x2d78ec){_0x4b48b5=_0x4b48b5-0x0;var _0x21e2cb=_0x3980[_0x4b48b5];return _0x21e2cb;};'use strict';var _=require(_0x0398('0x0'));var util=require(_0x0398('0x1'));var moment=require(_0x0398('0x2'));var BPromise=require(_0x0398('0x3'));var rs=require(_0x0398('0x4'));var fs=require('fs');var Redis=require(_0x0398('0x5'));var db=require(_0x0398('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0398('0x7'));var config=require(_0x0398('0x8'));var jayson=require(_0x0398('0x9'));var client=jayson['client'][_0x0398('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2613a9,_0x3d9f94,_0x3b6552){return new BPromise(function(_0x170674,_0x2adcdc){return client[_0x0398('0xb')](_0x2613a9,_0x3b6552)[_0x0398('0xc')](function(_0x5684c1){logger[_0x0398('0xd')](_0x0398('0xe'),_0x3d9f94,_0x0398('0xf'));logger[_0x0398('0x10')](_0x0398('0x11'),_0x3d9f94,_0x0398('0xf'),JSON[_0x0398('0x12')](_0x5684c1));if(_0x5684c1[_0x0398('0x13')]){if(_0x5684c1[_0x0398('0x13')][_0x0398('0x14')]===0x1f4){logger[_0x0398('0x13')](_0x0398('0xe'),_0x3d9f94,_0x5684c1[_0x0398('0x13')][_0x0398('0x15')]);return _0x2adcdc(_0x5684c1[_0x0398('0x13')][_0x0398('0x15')]);}logger[_0x0398('0x13')](_0x0398('0xe'),_0x3d9f94,_0x5684c1[_0x0398('0x13')][_0x0398('0x15')]);return _0x170674(_0x5684c1[_0x0398('0x13')]['message']);}else{logger[_0x0398('0xd')](_0x0398('0xe'),_0x3d9f94,'request\x20sent');_0x170674(_0x5684c1[_0x0398('0x16')][_0x0398('0x15')]);}})[_0x0398('0x17')](function(_0x3a7841){logger[_0x0398('0x13')](_0x0398('0xe'),_0x3d9f94,_0x3a7841);_0x2adcdc(_0x3a7841);});});}
\ No newline at end of file
index 3113fd6..fecacf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bec=['util','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','get','/:id','isAuthenticated','show','post','create','update','delete','exports','multer'];(function(_0x1ee2a1,_0x465e4e){var _0x390f66=function(_0x1e328e){while(--_0x1e328e){_0x1ee2a1['push'](_0x1ee2a1['shift']());}};_0x390f66(++_0x465e4e);}(_0x7bec,0xa9));var _0xc7be=function(_0x428941,_0x30eea5){_0x428941=_0x428941-0x0;var _0x6c25f=_0x7bec[_0x428941];return _0x6c25f;};'use strict';var multer=require(_0xc7be('0x0'));var util=require(_0xc7be('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7be('0x2'));var router=express['Router']();var fs_extra=require(_0xc7be('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc7be('0x4'));var config=require(_0xc7be('0x5'));var controller=require(_0xc7be('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc7be('0x7')]);router[_0xc7be('0x8')](_0xc7be('0x9'),auth[_0xc7be('0xa')](),controller[_0xc7be('0xb')]);router[_0xc7be('0xc')]('/',auth[_0xc7be('0xa')](),controller[_0xc7be('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc7be('0xe')]);router[_0xc7be('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xc7be('0x10')]=router;
\ No newline at end of file
+var _0x72ef=['destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x2a7323,_0xef43e0){var _0x570915=function(_0x3fb93d){while(--_0x3fb93d){_0x2a7323['push'](_0x2a7323['shift']());}};_0x570915(++_0xef43e0);}(_0x72ef,0x9a));var _0xf72e=function(_0xec084e,_0x4028c0){_0xec084e=_0xec084e-0x0;var _0x383eef=_0x72ef[_0xec084e];return _0x383eef;};'use strict';var multer=require('multer');var util=require(_0xf72e('0x0'));var path=require(_0xf72e('0x1'));var timeout=require(_0xf72e('0x2'));var express=require('express');var router=express[_0xf72e('0x3')]();var fs_extra=require(_0xf72e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf72e('0x5'));var config=require(_0xf72e('0x6'));var controller=require(_0xf72e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf72e('0x8')]);router['get'](_0xf72e('0x9'),auth[_0xf72e('0xa')](),controller[_0xf72e('0xb')]);router[_0xf72e('0xc')]('/',auth[_0xf72e('0xa')](),controller[_0xf72e('0xd')]);router[_0xf72e('0xe')](_0xf72e('0x9'),auth['isAuthenticated'](),controller[_0xf72e('0xf')]);router[_0xf72e('0x10')](_0xf72e('0x9'),auth[_0xf72e('0xa')](),controller[_0xf72e('0x11')]);module[_0xf72e('0x12')]=router;
\ No newline at end of file
index 83232f8..fb432a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0032=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x250e29,_0x5f2ecc){var _0x5a36af=function(_0x185acf){while(--_0x185acf){_0x250e29['push'](_0x250e29['shift']());}};_0x5a36af(++_0x5f2ecc);}(_0x0032,0xbb));var _0x2003=function(_0x183f92,_0x13326f){_0x183f92=_0x183f92-0x0;var _0x2be6f2=_0x0032[_0x183f92];return _0x2be6f2;};'use strict';var Sequelize=require(_0x2003('0x0'));module[_0x2003('0x1')]={'type':{'type':Sequelize[_0x2003('0x2')](_0x2003('0x3'),_0x2003('0x4'),_0x2003('0x5'),_0x2003('0x6'),_0x2003('0x7')),'defaultValue':_0x2003('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2003('0x8')]},'keyType':{'type':Sequelize[_0x2003('0x2')](_0x2003('0x3'),'variable',_0x2003('0x5'))},'keyContent':{'type':Sequelize[_0x2003('0x8')]},'idField':{'type':Sequelize[_0x2003('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2003('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2003('0x8')]}};
\ No newline at end of file
+var _0xe121=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xe121,0x1e2));var _0x1e12=function(_0x2dcbc0,_0x11625c){_0x2dcbc0=_0x2dcbc0-0x0;var _0xc28841=_0xe121[_0x2dcbc0];return _0xc28841;};'use strict';var Sequelize=require(_0x1e12('0x0'));module['exports']={'type':{'type':Sequelize[_0x1e12('0x1')]('string',_0x1e12('0x2'),_0x1e12('0x3'),_0x1e12('0x4'),_0x1e12('0x5')),'defaultValue':_0x1e12('0x6')},'content':{'type':Sequelize[_0x1e12('0x7')]},'key':{'type':Sequelize[_0x1e12('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x1e12('0x7')]},'idField':{'type':Sequelize[_0x1e12('0x7')]},'nameField':{'type':Sequelize[_0x1e12('0x7')]},'customField':{'type':Sequelize[_0x1e12('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5f93849..14a3469 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf7d=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','json','apply','reject','save','update','destroy','then','error','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xcf7d,0x130));var _0xdcf7=function(_0xba87cb,_0x1de0b4){_0xba87cb=_0xba87cb-0x0;var _0x4dffef=_0xcf7d[_0xba87cb];return _0x4dffef;};'use strict';var emlformat=require(_0xdcf7('0x0'));var rimraf=require(_0xdcf7('0x1'));var zipdir=require(_0xdcf7('0x2'));var jsonpatch=require(_0xdcf7('0x3'));var rp=require('request-promise');var moment=require(_0xdcf7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdcf7('0x5'));var util=require(_0xdcf7('0x6'));var path=require('path');var sox=require(_0xdcf7('0x7'));var csv=require(_0xdcf7('0x8'));var ejs=require(_0xdcf7('0x9'));var fs=require('fs');var fs_extra=require(_0xdcf7('0xa'));var _=require(_0xdcf7('0xb'));var squel=require(_0xdcf7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdcf7('0xd'));var toCsv=require(_0xdcf7('0x8'));var querystring=require(_0xdcf7('0xe'));var Papa=require('papaparse');var Redis=require(_0xdcf7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdcf7('0x10'));var hardwareService=require(_0xdcf7('0x11'));var logger=require('../../config/logger')(_0xdcf7('0x12'));var utils=require(_0xdcf7('0x13'));var config=require(_0xdcf7('0x14'));var licenseUtil=require(_0xdcf7('0x15'));var db=require(_0xdcf7('0x16'))['db'];function respondWithStatusCode(_0x5e8104,_0x3ff2d2){_0x3ff2d2=_0x3ff2d2||0xcc;return function(_0x2ef107){if(_0x2ef107){return _0x5e8104[_0xdcf7('0x17')](_0x3ff2d2);}return _0x5e8104[_0xdcf7('0x18')](_0x3ff2d2)[_0xdcf7('0x19')]();};}function respondWithResult(_0x44e425,_0x12f103){_0x12f103=_0x12f103||0xc8;return function(_0x387f65){if(_0x387f65){return _0x44e425[_0xdcf7('0x18')](_0x12f103)['json'](_0x387f65);}};}function respondWithFilteredResult(_0x571647,_0x4a7cfd){return function(_0x18e1e9){if(_0x18e1e9){var _0x4ebcaf=typeof _0x4a7cfd[_0xdcf7('0x1a')]===_0xdcf7('0x1b')&&typeof _0x4a7cfd['limit']===_0xdcf7('0x1b');var _0xb4590e=_0x18e1e9[_0xdcf7('0x1c')];var _0x1f9940=_0x4ebcaf?0x0:_0x4a7cfd[_0xdcf7('0x1a')];var _0x167174=_0x4ebcaf?_0x18e1e9['count']:_0x4a7cfd['offset']+_0x4a7cfd[_0xdcf7('0x1d')];var _0x49be8d;if(_0x167174>=_0xb4590e){_0x167174=_0xb4590e;_0x49be8d=0xc8;}else{_0x49be8d=0xce;}_0x571647[_0xdcf7('0x18')](_0x49be8d);return _0x571647['set']('Content-Range',_0x1f9940+'-'+_0x167174+'/'+_0xb4590e)[_0xdcf7('0x1e')](_0x18e1e9);}return null;};}function patchUpdates(_0x369283){return function(_0x23b73c){try{jsonpatch[_0xdcf7('0x1f')](_0x23b73c,_0x369283,!![]);}catch(_0x28aaca){return BPromise[_0xdcf7('0x20')](_0x28aaca);}return _0x23b73c[_0xdcf7('0x21')]();};}function saveUpdates(_0x235f8d,_0x206a43){return function(_0x2b544e){if(_0x2b544e){return _0x2b544e[_0xdcf7('0x22')](_0x235f8d)['then'](function(_0x4d817b){return _0x4d817b;});}return null;};}function removeEntity(_0x130f71,_0x24353e){return function(_0x29b63f){if(_0x29b63f){return _0x29b63f[_0xdcf7('0x23')]()[_0xdcf7('0x24')](function(){_0x130f71[_0xdcf7('0x18')](0xcc)[_0xdcf7('0x19')]();});}};}function handleEntityNotFound(_0x4deef0,_0x2a1480){return function(_0x4aa609){if(!_0x4aa609){_0x4deef0[_0xdcf7('0x17')](0x194);}return _0x4aa609;};}function handleError(_0x5b5ad7,_0x1880ff){_0x1880ff=_0x1880ff||0x1f4;return function(_0x21ae87){logger[_0xdcf7('0x25')](_0x21ae87['stack']);if(_0x21ae87[_0xdcf7('0x26')]){delete _0x21ae87[_0xdcf7('0x26')];}_0x5b5ad7[_0xdcf7('0x18')](_0x1880ff)[_0xdcf7('0x27')](_0x21ae87);};}exports['index']=function(_0x15bf2a,_0x4d53e7){var _0x11d850={},_0x192f22={},_0x22d9a3={'count':0x0,'rows':[]};var _0x172590=_[_0xdcf7('0x28')](db[_0xdcf7('0x29')][_0xdcf7('0x2a')],function(_0x42c6bb){return{'name':_0x42c6bb[_0xdcf7('0x2b')],'type':_0x42c6bb[_0xdcf7('0x2c')][_0xdcf7('0x2d')]};});_0x192f22[_0xdcf7('0x2e')]=_[_0xdcf7('0x28')](_0x172590,_0xdcf7('0x26'));_0x192f22[_0xdcf7('0x2f')]=_[_0xdcf7('0x30')](_0x15bf2a[_0xdcf7('0x2f')]);_0x192f22['filters']=_['intersection'](_0x192f22[_0xdcf7('0x2e')],_0x192f22['query']);_0x11d850['attributes']=_[_0xdcf7('0x31')](_0x192f22[_0xdcf7('0x2e')],qs['fields'](_0x15bf2a['query'][_0xdcf7('0x32')]));_0x11d850[_0xdcf7('0x33')]=_0x11d850[_0xdcf7('0x33')]['length']?_0x11d850[_0xdcf7('0x33')]:_0x192f22['model'];if(!_0x15bf2a[_0xdcf7('0x2f')][_0xdcf7('0x34')](_0xdcf7('0x35'))){_0x11d850[_0xdcf7('0x1d')]=qs[_0xdcf7('0x1d')](_0x15bf2a[_0xdcf7('0x2f')][_0xdcf7('0x1d')]);_0x11d850[_0xdcf7('0x1a')]=qs[_0xdcf7('0x1a')](_0x15bf2a[_0xdcf7('0x2f')]['offset']);}_0x11d850[_0xdcf7('0x36')]=qs[_0xdcf7('0x37')](_0x15bf2a[_0xdcf7('0x2f')][_0xdcf7('0x37')]);_0x11d850[_0xdcf7('0x38')]=qs[_0xdcf7('0x39')](_[_0xdcf7('0x3a')](_0x15bf2a[_0xdcf7('0x2f')],_0x192f22['filters']),_0x172590);if(_0x15bf2a[_0xdcf7('0x2f')][_0xdcf7('0x3b')]){_0x11d850[_0xdcf7('0x38')]=_[_0xdcf7('0x3c')](_0x11d850[_0xdcf7('0x38')],{'$or':_['map'](_0x172590,function(_0x51a315){if(_0x51a315['type']!==_0xdcf7('0x3d')){var _0x16c9f9={};_0x16c9f9[_0x51a315['name']]={'$like':'%'+_0x15bf2a[_0xdcf7('0x2f')][_0xdcf7('0x3b')]+'%'};return _0x16c9f9;}})});}_0x11d850=_['merge']({},_0x11d850,_0x15bf2a[_0xdcf7('0x3e')]);var _0x1f1e43={'where':_0x11d850['where']};return db[_0xdcf7('0x29')][_0xdcf7('0x1c')](_0x1f1e43)[_0xdcf7('0x24')](function(_0x2a2f1a){_0x22d9a3[_0xdcf7('0x1c')]=_0x2a2f1a;if(_0x15bf2a[_0xdcf7('0x2f')][_0xdcf7('0x3f')]){_0x11d850[_0xdcf7('0x40')]=[{'all':!![]}];}return db[_0xdcf7('0x29')][_0xdcf7('0x41')](_0x11d850);})['then'](function(_0x16427f){_0x22d9a3[_0xdcf7('0x42')]=_0x16427f;return _0x22d9a3;})[_0xdcf7('0x24')](respondWithFilteredResult(_0x4d53e7,_0x11d850))[_0xdcf7('0x43')](handleError(_0x4d53e7,null));};exports['show']=function(_0x4c90c7,_0x507aae){var _0x4809c6={'raw':!![],'where':{'id':_0x4c90c7[_0xdcf7('0x44')]['id']}},_0x1155df={};_0x1155df[_0xdcf7('0x2e')]=_[_0xdcf7('0x30')](db['VtigerField'][_0xdcf7('0x2a')]);_0x1155df[_0xdcf7('0x2f')]=_['keys'](_0x4c90c7[_0xdcf7('0x2f')]);_0x1155df[_0xdcf7('0x39')]=_[_0xdcf7('0x31')](_0x1155df[_0xdcf7('0x2e')],_0x1155df[_0xdcf7('0x2f')]);_0x4809c6[_0xdcf7('0x33')]=_['intersection'](_0x1155df['model'],qs['fields'](_0x4c90c7[_0xdcf7('0x2f')][_0xdcf7('0x32')]));_0x4809c6[_0xdcf7('0x33')]=_0x4809c6[_0xdcf7('0x33')][_0xdcf7('0x45')]?_0x4809c6[_0xdcf7('0x33')]:_0x1155df[_0xdcf7('0x2e')];if(_0x4c90c7['query'][_0xdcf7('0x3f')]){_0x4809c6[_0xdcf7('0x40')]=[{'all':!![]}];}_0x4809c6=_[_0xdcf7('0x3c')]({},_0x4809c6,_0x4c90c7[_0xdcf7('0x3e')]);return db[_0xdcf7('0x29')][_0xdcf7('0x46')](_0x4809c6)[_0xdcf7('0x24')](handleEntityNotFound(_0x507aae,null))['then'](respondWithResult(_0x507aae,null))[_0xdcf7('0x43')](handleError(_0x507aae,null));};exports[_0xdcf7('0x47')]=function(_0x5a075c,_0x108097){return db[_0xdcf7('0x29')]['create'](_0x5a075c[_0xdcf7('0x48')],{})[_0xdcf7('0x24')](respondWithResult(_0x108097,0xc9))[_0xdcf7('0x43')](handleError(_0x108097,null));};exports[_0xdcf7('0x22')]=function(_0x40d3f8,_0xa4ed8){if(_0x40d3f8['body']['id']){delete _0x40d3f8[_0xdcf7('0x48')]['id'];}return db[_0xdcf7('0x29')]['find']({'where':{'id':_0x40d3f8['params']['id']}})[_0xdcf7('0x24')](handleEntityNotFound(_0xa4ed8,null))[_0xdcf7('0x24')](saveUpdates(_0x40d3f8[_0xdcf7('0x48')],null))[_0xdcf7('0x24')](respondWithResult(_0xa4ed8,null))[_0xdcf7('0x43')](handleError(_0xa4ed8,null));};exports[_0xdcf7('0x23')]=function(_0x5c45f2,_0x22ca00){return db[_0xdcf7('0x29')][_0xdcf7('0x46')]({'where':{'id':_0x5c45f2[_0xdcf7('0x44')]['id']}})[_0xdcf7('0x24')](handleEntityNotFound(_0x22ca00,null))[_0xdcf7('0x24')](removeEntity(_0x22ca00,null))[_0xdcf7('0x43')](handleError(_0x22ca00,null));};
\ No newline at end of file
+var _0x839d=['VtigerField','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','length','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','moment','path','sox','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','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','index'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x839d,0x141));var _0xd839=function(_0x204012,_0xeac996){_0x204012=_0x204012-0x0;var _0x5f14e1=_0x839d[_0x204012];return _0x5f14e1;};'use strict';var emlformat=require(_0xd839('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd839('0x1'));var jsonpatch=require(_0xd839('0x2'));var rp=require('request-promise');var moment=require(_0xd839('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd839('0x4'));var sox=require(_0xd839('0x5'));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(_0xd839('0x6'));var jsforce=require(_0xd839('0x7'));var deskjs=require(_0xd839('0x8'));var toCsv=require(_0xd839('0x9'));var querystring=require(_0xd839('0xa'));var Papa=require(_0xd839('0xb'));var Redis=require(_0xd839('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xd839('0xd'));var as=require(_0xd839('0xe'));var hardwareService=require(_0xd839('0xf'));var logger=require(_0xd839('0x10'))(_0xd839('0x11'));var utils=require(_0xd839('0x12'));var config=require(_0xd839('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xd839('0x14'))['db'];function respondWithStatusCode(_0x47e821,_0x3dd73e){_0x3dd73e=_0x3dd73e||0xcc;return function(_0x505018){if(_0x505018){return _0x47e821[_0xd839('0x15')](_0x3dd73e);}return _0x47e821[_0xd839('0x16')](_0x3dd73e)['end']();};}function respondWithResult(_0x416047,_0x4ead08){_0x4ead08=_0x4ead08||0xc8;return function(_0x426161){if(_0x426161){return _0x416047['status'](_0x4ead08)['json'](_0x426161);}};}function respondWithFilteredResult(_0x3f8a6e,_0x47ab69){return function(_0x3f7363){if(_0x3f7363){var _0x14a85c=typeof _0x47ab69[_0xd839('0x17')]==='undefined'&&typeof _0x47ab69[_0xd839('0x18')]==='undefined';var _0x32856d=_0x3f7363[_0xd839('0x19')];var _0x77d2b8=_0x14a85c?0x0:_0x47ab69[_0xd839('0x17')];var _0x3a4801=_0x14a85c?_0x3f7363[_0xd839('0x19')]:_0x47ab69[_0xd839('0x17')]+_0x47ab69[_0xd839('0x18')];var _0x236540;if(_0x3a4801>=_0x32856d){_0x3a4801=_0x32856d;_0x236540=0xc8;}else{_0x236540=0xce;}_0x3f8a6e[_0xd839('0x16')](_0x236540);return _0x3f8a6e[_0xd839('0x1a')](_0xd839('0x1b'),_0x77d2b8+'-'+_0x3a4801+'/'+_0x32856d)[_0xd839('0x1c')](_0x3f7363);}return null;};}function patchUpdates(_0x48adde){return function(_0x59313f){try{jsonpatch[_0xd839('0x1d')](_0x59313f,_0x48adde,!![]);}catch(_0x5cca21){return BPromise[_0xd839('0x1e')](_0x5cca21);}return _0x59313f[_0xd839('0x1f')]();};}function saveUpdates(_0xfb9455,_0x5b56a2){return function(_0x14e981){if(_0x14e981){return _0x14e981[_0xd839('0x20')](_0xfb9455)[_0xd839('0x21')](function(_0x32949d){return _0x32949d;});}return null;};}function removeEntity(_0x52993b,_0x1190b8){return function(_0x16a89d){if(_0x16a89d){return _0x16a89d['destroy']()['then'](function(){_0x52993b[_0xd839('0x16')](0xcc)[_0xd839('0x22')]();});}};}function handleEntityNotFound(_0x2bc404,_0x414c9f){return function(_0x5b3164){if(!_0x5b3164){_0x2bc404[_0xd839('0x15')](0x194);}return _0x5b3164;};}function handleError(_0x2f916b,_0x138e32){_0x138e32=_0x138e32||0x1f4;return function(_0x5a41c4){logger[_0xd839('0x23')](_0x5a41c4[_0xd839('0x24')]);if(_0x5a41c4[_0xd839('0x25')]){delete _0x5a41c4['name'];}_0x2f916b[_0xd839('0x16')](_0x138e32)['send'](_0x5a41c4);};}exports[_0xd839('0x26')]=function(_0x2990e3,_0x44fc85){var _0x4fddf5={},_0x3b9df7={},_0x1d96c3={'count':0x0,'rows':[]};var _0x17abfa=_['map'](db[_0xd839('0x27')][_0xd839('0x28')],function(_0x1efce6){return{'name':_0x1efce6[_0xd839('0x29')],'type':_0x1efce6[_0xd839('0x2a')][_0xd839('0x2b')]};});_0x3b9df7['model']=_['map'](_0x17abfa,_0xd839('0x25'));_0x3b9df7[_0xd839('0x2c')]=_['keys'](_0x2990e3[_0xd839('0x2c')]);_0x3b9df7[_0xd839('0x2d')]=_[_0xd839('0x2e')](_0x3b9df7[_0xd839('0x2f')],_0x3b9df7['query']);_0x4fddf5[_0xd839('0x30')]=_[_0xd839('0x2e')](_0x3b9df7['model'],qs[_0xd839('0x31')](_0x2990e3[_0xd839('0x2c')]['fields']));_0x4fddf5[_0xd839('0x30')]=_0x4fddf5[_0xd839('0x30')]['length']?_0x4fddf5[_0xd839('0x30')]:_0x3b9df7['model'];if(!_0x2990e3[_0xd839('0x2c')][_0xd839('0x32')](_0xd839('0x33'))){_0x4fddf5[_0xd839('0x18')]=qs[_0xd839('0x18')](_0x2990e3[_0xd839('0x2c')][_0xd839('0x18')]);_0x4fddf5['offset']=qs[_0xd839('0x17')](_0x2990e3[_0xd839('0x2c')]['offset']);}_0x4fddf5[_0xd839('0x34')]=qs[_0xd839('0x35')](_0x2990e3[_0xd839('0x2c')][_0xd839('0x35')]);_0x4fddf5['where']=qs[_0xd839('0x2d')](_['pick'](_0x2990e3[_0xd839('0x2c')],_0x3b9df7[_0xd839('0x2d')]),_0x17abfa);if(_0x2990e3['query'][_0xd839('0x36')]){_0x4fddf5[_0xd839('0x37')]=_[_0xd839('0x38')](_0x4fddf5[_0xd839('0x37')],{'$or':_[_0xd839('0x39')](_0x17abfa,function(_0x569cbe){if(_0x569cbe[_0xd839('0x2a')]!==_0xd839('0x3a')){var _0x45c6ab={};_0x45c6ab[_0x569cbe[_0xd839('0x25')]]={'$like':'%'+_0x2990e3[_0xd839('0x2c')][_0xd839('0x36')]+'%'};return _0x45c6ab;}})});}_0x4fddf5=_['merge']({},_0x4fddf5,_0x2990e3[_0xd839('0x3b')]);var _0x55db96={'where':_0x4fddf5[_0xd839('0x37')]};return db['VtigerField'][_0xd839('0x19')](_0x55db96)[_0xd839('0x21')](function(_0x381abb){_0x1d96c3[_0xd839('0x19')]=_0x381abb;if(_0x2990e3['query'][_0xd839('0x3c')]){_0x4fddf5[_0xd839('0x3d')]=[{'all':!![]}];}return db[_0xd839('0x27')][_0xd839('0x3e')](_0x4fddf5);})[_0xd839('0x21')](function(_0x9ee5c2){_0x1d96c3[_0xd839('0x3f')]=_0x9ee5c2;return _0x1d96c3;})['then'](respondWithFilteredResult(_0x44fc85,_0x4fddf5))['catch'](handleError(_0x44fc85,null));};exports[_0xd839('0x40')]=function(_0x22a935,_0x4c05d7){var _0x316ec6={'raw':!![],'where':{'id':_0x22a935['params']['id']}},_0x14c0b1={};_0x14c0b1[_0xd839('0x2f')]=_[_0xd839('0x41')](db[_0xd839('0x27')][_0xd839('0x28')]);_0x14c0b1[_0xd839('0x2c')]=_[_0xd839('0x41')](_0x22a935['query']);_0x14c0b1['filters']=_[_0xd839('0x2e')](_0x14c0b1[_0xd839('0x2f')],_0x14c0b1[_0xd839('0x2c')]);_0x316ec6[_0xd839('0x30')]=_[_0xd839('0x2e')](_0x14c0b1[_0xd839('0x2f')],qs[_0xd839('0x31')](_0x22a935[_0xd839('0x2c')]['fields']));_0x316ec6[_0xd839('0x30')]=_0x316ec6[_0xd839('0x30')][_0xd839('0x42')]?_0x316ec6[_0xd839('0x30')]:_0x14c0b1[_0xd839('0x2f')];if(_0x22a935[_0xd839('0x2c')][_0xd839('0x3c')]){_0x316ec6[_0xd839('0x3d')]=[{'all':!![]}];}_0x316ec6=_['merge']({},_0x316ec6,_0x22a935[_0xd839('0x3b')]);return db[_0xd839('0x27')][_0xd839('0x43')](_0x316ec6)[_0xd839('0x21')](handleEntityNotFound(_0x4c05d7,null))[_0xd839('0x21')](respondWithResult(_0x4c05d7,null))['catch'](handleError(_0x4c05d7,null));};exports[_0xd839('0x44')]=function(_0x3336fa,_0x240f2e){return db[_0xd839('0x27')][_0xd839('0x44')](_0x3336fa[_0xd839('0x45')],{})[_0xd839('0x21')](respondWithResult(_0x240f2e,0xc9))['catch'](handleError(_0x240f2e,null));};exports[_0xd839('0x20')]=function(_0x648905,_0x3b9bb5){if(_0x648905[_0xd839('0x45')]['id']){delete _0x648905[_0xd839('0x45')]['id'];}return db[_0xd839('0x27')]['find']({'where':{'id':_0x648905[_0xd839('0x46')]['id']}})['then'](handleEntityNotFound(_0x3b9bb5,null))[_0xd839('0x21')](saveUpdates(_0x648905[_0xd839('0x45')],null))[_0xd839('0x21')](respondWithResult(_0x3b9bb5,null))['catch'](handleError(_0x3b9bb5,null));};exports[_0xd839('0x47')]=function(_0x40b222,_0x1eaf45){return db['VtigerField']['find']({'where':{'id':_0x40b222['params']['id']}})['then'](handleEntityNotFound(_0x1eaf45,null))[_0xd839('0x21')](removeEntity(_0x1eaf45,null))['catch'](handleError(_0x1eaf45,null));};
\ No newline at end of file
index 0b77bac..78e7ab7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5c2=['vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x48d9c4,_0x26c211){var _0x3f2080=function(_0x479bc9){while(--_0x479bc9){_0x48d9c4['push'](_0x48d9c4['shift']());}};_0x3f2080(++_0x26c211);}(_0xd5c2,0xa7));var _0x2d5c=function(_0x33a8e3,_0x2fbd69){_0x33a8e3=_0x33a8e3-0x0;var _0x255050=_0xd5c2[_0x33a8e3];return _0x255050;};'use strict';var _=require(_0x2d5c('0x0'));var util=require(_0x2d5c('0x1'));var logger=require(_0x2d5c('0x2'))(_0x2d5c('0x3'));var moment=require(_0x2d5c('0x4'));var BPromise=require(_0x2d5c('0x5'));var rp=require(_0x2d5c('0x6'));var fs=require('fs');var path=require(_0x2d5c('0x7'));var rimraf=require(_0x2d5c('0x8'));var config=require(_0x2d5c('0x9'));var attributes=require(_0x2d5c('0xa'));module[_0x2d5c('0xb')]=function(_0x572930,_0xfed415){return _0x572930[_0x2d5c('0xc')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x2d5c('0xd'),'fields':['idField',_0x2d5c('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa01d=['moment','bluebird','request-promise','path','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','api'];(function(_0x29d16c,_0x4b8dc4){var _0x1960d5=function(_0x1b1e51){while(--_0x1b1e51){_0x29d16c['push'](_0x29d16c['shift']());}};_0x1960d5(++_0x4b8dc4);}(_0xa01d,0x8c));var _0xda01=function(_0x578fb7,_0x1008df){_0x578fb7=_0x578fb7-0x0;var _0x21171e=_0xa01d[_0x578fb7];return _0x21171e;};'use strict';var _=require('lodash');var util=require(_0xda01('0x0'));var logger=require(_0xda01('0x1'))(_0xda01('0x2'));var moment=require(_0xda01('0x3'));var BPromise=require(_0xda01('0x4'));var rp=require(_0xda01('0x5'));var fs=require('fs');var path=require(_0xda01('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module['exports']=function(_0xe22528,_0x2ddc19){return _0xe22528[_0xda01('0x7')](_0xda01('0x8'),attributes,{'tableName':_0xda01('0x9'),'paranoid':![],'indexes':[{'name':_0xda01('0xa'),'fields':[_0xda01('0xb'),_0xda01('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a8a5642..b85b45e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6060=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0xaa44a2,_0x18110a){var _0x5bc606=function(_0x4e34d5){while(--_0x4e34d5){_0xaa44a2['push'](_0xaa44a2['shift']());}};_0x5bc606(++_0x18110a);}(_0x6060,0xd0));var _0x0606=function(_0xa6b085,_0x7728a0){_0xa6b085=_0xa6b085-0x0;var _0x1a1e4c=_0x6060[_0xa6b085];return _0x1a1e4c;};'use strict';var _=require(_0x0606('0x0'));var util=require(_0x0606('0x1'));var moment=require(_0x0606('0x2'));var BPromise=require(_0x0606('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0606('0x4'))['db'];var utils=require(_0x0606('0x5'));var logger=require(_0x0606('0x6'))(_0x0606('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x204aac,_0x2889a4,_0x59bdeb){return new BPromise(function(_0x3c338b,_0x1b95d0){return client[_0x0606('0x8')](_0x204aac,_0x59bdeb)[_0x0606('0x9')](function(_0x530922){logger['info'](_0x0606('0xa'),_0x2889a4,_0x0606('0xb'));logger[_0x0606('0xc')](_0x0606('0xd'),_0x2889a4,_0x0606('0xb'),JSON[_0x0606('0xe')](_0x530922));if(_0x530922['error']){if(_0x530922[_0x0606('0xf')][_0x0606('0x10')]===0x1f4){logger[_0x0606('0xf')](_0x0606('0xa'),_0x2889a4,_0x530922[_0x0606('0xf')][_0x0606('0x11')]);return _0x1b95d0(_0x530922[_0x0606('0xf')][_0x0606('0x11')]);}logger[_0x0606('0xf')]('VtigerField,\x20%s,\x20%s',_0x2889a4,_0x530922[_0x0606('0xf')][_0x0606('0x11')]);return _0x3c338b(_0x530922[_0x0606('0xf')][_0x0606('0x11')]);}else{logger[_0x0606('0x12')](_0x0606('0xa'),_0x2889a4,_0x0606('0xb'));_0x3c338b(_0x530922[_0x0606('0x13')][_0x0606('0x11')]);}})[_0x0606('0x14')](function(_0x1190b1){logger[_0x0606('0xf')](_0x0606('0xa'),_0x2889a4,_0x1190b1);_0x1b95d0(_0x1190b1);});});}
\ No newline at end of file
+var _0x6d23=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VtigerField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils'];(function(_0x459a0a,_0x25c46f){var _0x4ab46c=function(_0x451a6a){while(--_0x451a6a){_0x459a0a['push'](_0x459a0a['shift']());}};_0x4ab46c(++_0x25c46f);}(_0x6d23,0x14f));var _0x36d2=function(_0x5a98a4,_0x5ac7a0){_0x5a98a4=_0x5a98a4-0x0;var _0x1d0c9d=_0x6d23[_0x5a98a4];return _0x1d0c9d;};'use strict';var _=require(_0x36d2('0x0'));var util=require(_0x36d2('0x1'));var moment=require(_0x36d2('0x2'));var BPromise=require('bluebird');var rs=require(_0x36d2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x36d2('0x4'));var logger=require(_0x36d2('0x5'))(_0x36d2('0x6'));var config=require(_0x36d2('0x7'));var jayson=require(_0x36d2('0x8'));var client=jayson[_0x36d2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x395acb,_0x440c50,_0x111f19){return new BPromise(function(_0x4e474c,_0x40dd8b){return client['request'](_0x395acb,_0x111f19)[_0x36d2('0xa')](function(_0x2c56b6){logger['info'](_0x36d2('0xb'),_0x440c50,_0x36d2('0xc'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x440c50,_0x36d2('0xc'),JSON[_0x36d2('0xd')](_0x2c56b6));if(_0x2c56b6['error']){if(_0x2c56b6[_0x36d2('0xe')][_0x36d2('0xf')]===0x1f4){logger['error'](_0x36d2('0xb'),_0x440c50,_0x2c56b6[_0x36d2('0xe')][_0x36d2('0x10')]);return _0x40dd8b(_0x2c56b6[_0x36d2('0xe')]['message']);}logger[_0x36d2('0xe')](_0x36d2('0xb'),_0x440c50,_0x2c56b6[_0x36d2('0xe')]['message']);return _0x4e474c(_0x2c56b6[_0x36d2('0xe')]['message']);}else{logger[_0x36d2('0x11')](_0x36d2('0xb'),_0x440c50,_0x36d2('0xc'));_0x4e474c(_0x2c56b6[_0x36d2('0x12')]['message']);}})[_0x36d2('0x13')](function(_0x30d0b9){logger[_0x36d2('0xe')]('VtigerField,\x20%s,\x20%s',_0x440c50,_0x30d0b9);_0x40dd8b(_0x30d0b9);});});}
\ No newline at end of file
index 5d6e2ce..3c6db15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacff=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get'];(function(_0x52bc0a,_0x5220df){var _0x4bb809=function(_0x59eae5){while(--_0x59eae5){_0x52bc0a['push'](_0x52bc0a['shift']());}};_0x4bb809(++_0x5220df);}(_0xacff,0x116));var _0xfacf=function(_0x12c2d1,_0x2d5304){_0x12c2d1=_0x12c2d1-0x0;var _0x5e808c=_0xacff[_0x12c2d1];return _0x5e808c;};'use strict';var multer=require('multer');var util=require(_0xfacf('0x0'));var path=require(_0xfacf('0x1'));var timeout=require(_0xfacf('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfacf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfacf('0x4'));var config=require(_0xfacf('0x5'));var controller=require(_0xfacf('0x6'));router[_0xfacf('0x7')]('/',auth[_0xfacf('0x8')](),controller[_0xfacf('0x9')]);router['get'](_0xfacf('0xa'),auth['isAuthenticated'](),controller[_0xfacf('0xb')]);router['get'](_0xfacf('0xc'),auth[_0xfacf('0x8')](),controller[_0xfacf('0xd')]);router[_0xfacf('0x7')](_0xfacf('0xe'),auth[_0xfacf('0x8')](),controller[_0xfacf('0xf')]);router[_0xfacf('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xfacf('0xc'),auth[_0xfacf('0x8')](),controller[_0xfacf('0x11')]);router[_0xfacf('0x12')]('/:id',auth[_0xfacf('0x8')](),controller[_0xfacf('0x13')]);router[_0xfacf('0x14')](_0xfacf('0xa'),auth[_0xfacf('0x8')](),controller[_0xfacf('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xdbce=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xdbce,0x1f1));var _0xedbc=function(_0x38ed27,_0xeb9a8a){_0x38ed27=_0x38ed27-0x0;var _0x2646fb=_0xdbce[_0x38ed27];return _0x2646fb;};'use strict';var multer=require(_0xedbc('0x0'));var util=require('util');var path=require(_0xedbc('0x1'));var timeout=require('connect-timeout');var express=require(_0xedbc('0x2'));var router=express[_0xedbc('0x3')]();var fs_extra=require(_0xedbc('0x4'));var auth=require(_0xedbc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xedbc('0x6'));router[_0xedbc('0x7')]('/',auth[_0xedbc('0x8')](),controller[_0xedbc('0x9')]);router[_0xedbc('0x7')](_0xedbc('0xa'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xb')]);router['get'](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xd')]);router[_0xedbc('0x7')](_0xedbc('0xe'),auth[_0xedbc('0x8')](),controller[_0xedbc('0xf')]);router[_0xedbc('0x10')]('/',auth[_0xedbc('0x8')](),controller[_0xedbc('0x11')]);router[_0xedbc('0x10')](_0xedbc('0xc'),auth[_0xedbc('0x8')](),controller[_0xedbc('0x12')]);router[_0xedbc('0x13')](_0xedbc('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xedbc('0xa'),auth[_0xedbc('0x8')](),controller[_0xedbc('0x14')]);module[_0xedbc('0x15')]=router;
\ No newline at end of file
index d27b0e3..87bde10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b6e=['exports','STRING','username','ENUM','password','token','integrationTab','newTab','sequelize'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x5b6e,0x14c));var _0xe5b6=function(_0x1fc3f8,_0x484a7a){_0x1fc3f8=_0x1fc3f8-0x0;var _0x56dae3=_0x5b6e[_0x1fc3f8];return _0x56dae3;};'use strict';var Sequelize=require(_0xe5b6('0x0'));module[_0xe5b6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe5b6('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xe5b6('0x3')},'password':{'type':Sequelize[_0xe5b6('0x2')]},'token':{'type':Sequelize[_0xe5b6('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xe5b6('0x4')](_0xe5b6('0x5'),_0xe5b6('0x6')),'defaultValue':_0xe5b6('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe5b6('0x4')](_0xe5b6('0x7'),_0xe5b6('0x8')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x565e=['STRING','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize'];(function(_0x8ec6b4,_0x31ef52){var _0x52c0d0=function(_0x17cadc){while(--_0x17cadc){_0x8ec6b4['push'](_0x8ec6b4['shift']());}};_0x52c0d0(++_0x31ef52);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe565('0x0'));module['exports']={'name':{'type':Sequelize[_0xe565('0x1')]},'description':{'type':Sequelize[_0xe565('0x1')]},'username':{'type':Sequelize[_0xe565('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xe565('0x1')]},'remoteUri':{'type':Sequelize[_0xe565('0x1')],'unique':_0xe565('0x2')},'authType':{'type':Sequelize[_0xe565('0x3')](_0xe565('0x4'),_0xe565('0x5')),'defaultValue':_0xe565('0x4')},'serverUrl':{'type':Sequelize[_0xe565('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xe565('0x3')](_0xe565('0x6'),_0xe565('0x7')),'defaultValue':_0xe565('0x6')}};
\ No newline at end of file
index ef033e9..f4f5874 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44a3=['save','update','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../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'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x44a3,0x1a9));var _0x344a=function(_0x3e2f39,_0x52276d){_0x3e2f39=_0x3e2f39-0x0;var _0x1f915c=_0x44a3[_0x3e2f39];return _0x1f915c;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4a69ea,_0x304b70){_0x304b70=_0x304b70||0xcc;return function(_0x2ad7eb){if(_0x2ad7eb){return _0x4a69ea[_0x344a('0x17')](_0x304b70);}return _0x4a69ea[_0x344a('0x18')](_0x304b70)[_0x344a('0x19')]();};}function respondWithResult(_0x133ad4,_0x4ee562){_0x4ee562=_0x4ee562||0xc8;return function(_0x4032d7){if(_0x4032d7){return _0x133ad4[_0x344a('0x18')](_0x4ee562)[_0x344a('0x1a')](_0x4032d7);}};}function respondWithFilteredResult(_0x6e1639,_0x58c8cd){return function(_0x54a643){if(_0x54a643){var _0x3609ce=typeof _0x58c8cd[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x58c8cd[_0x344a('0x1d')]==='undefined';var _0x397de6=_0x54a643[_0x344a('0x1e')];var _0x49b55f=_0x3609ce?0x0:_0x58c8cd[_0x344a('0x1b')];var _0x274016=_0x3609ce?_0x54a643[_0x344a('0x1e')]:_0x58c8cd[_0x344a('0x1b')]+_0x58c8cd[_0x344a('0x1d')];var _0x43fa0f;if(_0x274016>=_0x397de6){_0x274016=_0x397de6;_0x43fa0f=0xc8;}else{_0x43fa0f=0xce;}_0x6e1639[_0x344a('0x18')](_0x43fa0f);return _0x6e1639[_0x344a('0x1f')](_0x344a('0x20'),_0x49b55f+'-'+_0x274016+'/'+_0x397de6)[_0x344a('0x1a')](_0x54a643);}return null;};}function patchUpdates(_0x4b3552){return function(_0x16c0fe){try{jsonpatch[_0x344a('0x21')](_0x16c0fe,_0x4b3552,!![]);}catch(_0xe0bdd4){return BPromise[_0x344a('0x22')](_0xe0bdd4);}return _0x16c0fe[_0x344a('0x23')]();};}function saveUpdates(_0x80ae12,_0x185303){return function(_0x976bcf){if(_0x976bcf){return _0x976bcf[_0x344a('0x24')](_0x80ae12)[_0x344a('0x25')](function(_0x90070c){return _0x90070c;});}return null;};}function removeEntity(_0x3b2ab9,_0x5ce9da){return function(_0x266fce){if(_0x266fce){return _0x266fce['destroy']()[_0x344a('0x25')](function(){_0x3b2ab9['status'](0xcc)[_0x344a('0x19')]();});}};}function handleEntityNotFound(_0x484f97,_0x36c920){return function(_0x8bf0b0){if(!_0x8bf0b0){_0x484f97[_0x344a('0x17')](0x194);}return _0x8bf0b0;};}function handleError(_0x16d404,_0x26f059){_0x26f059=_0x26f059||0x1f4;return function(_0x28749b){logger[_0x344a('0x26')](_0x28749b[_0x344a('0x27')]);if(_0x28749b['name']){delete _0x28749b[_0x344a('0x28')];}_0x16d404[_0x344a('0x18')](_0x26f059)[_0x344a('0x29')](_0x28749b);};}exports[_0x344a('0x2a')]=function(_0x14bd54,_0x2d72c9){var _0x5b877d={},_0x3d25fe={},_0x49bbf8={'count':0x0,'rows':[]};var _0x593cf6=_[_0x344a('0x2b')](db[_0x344a('0x2c')][_0x344a('0x2d')],function(_0x4803db){return{'name':_0x4803db['fieldName'],'type':_0x4803db['type'][_0x344a('0x2e')]};});_0x3d25fe[_0x344a('0x2f')]=_[_0x344a('0x2b')](_0x593cf6,'name');_0x3d25fe[_0x344a('0x30')]=_[_0x344a('0x31')](_0x14bd54[_0x344a('0x30')]);_0x3d25fe[_0x344a('0x32')]=_[_0x344a('0x33')](_0x3d25fe[_0x344a('0x2f')],_0x3d25fe[_0x344a('0x30')]);_0x5b877d['attributes']=_[_0x344a('0x33')](_0x3d25fe['model'],qs['fields'](_0x14bd54['query'][_0x344a('0x34')]));_0x5b877d[_0x344a('0x35')]=_0x5b877d[_0x344a('0x35')][_0x344a('0x36')]?_0x5b877d[_0x344a('0x35')]:_0x3d25fe[_0x344a('0x2f')];if(!_0x14bd54['query'][_0x344a('0x37')](_0x344a('0x38'))){_0x5b877d[_0x344a('0x1d')]=qs['limit'](_0x14bd54[_0x344a('0x30')][_0x344a('0x1d')]);_0x5b877d[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0x14bd54[_0x344a('0x30')]['offset']);}_0x5b877d[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x14bd54[_0x344a('0x30')][_0x344a('0x3a')]);_0x5b877d[_0x344a('0x3b')]=qs['filters'](_[_0x344a('0x3c')](_0x14bd54[_0x344a('0x30')],_0x3d25fe[_0x344a('0x32')]),_0x593cf6);if(_0x14bd54[_0x344a('0x30')][_0x344a('0x3d')]){_0x5b877d['where']=_[_0x344a('0x3e')](_0x5b877d[_0x344a('0x3b')],{'$or':_[_0x344a('0x2b')](_0x593cf6,function(_0x3356fb){if(_0x3356fb[_0x344a('0x3f')]!==_0x344a('0x40')){var _0x335a0a={};_0x335a0a[_0x3356fb[_0x344a('0x28')]]={'$like':'%'+_0x14bd54['query'][_0x344a('0x3d')]+'%'};return _0x335a0a;}})});}_0x5b877d=_[_0x344a('0x3e')]({},_0x5b877d,_0x14bd54[_0x344a('0x41')]);var _0x28bad9={'where':_0x5b877d[_0x344a('0x3b')]};return db['ZendeskAccount'][_0x344a('0x1e')](_0x28bad9)[_0x344a('0x25')](function(_0x7a33d7){_0x49bbf8[_0x344a('0x1e')]=_0x7a33d7;if(_0x14bd54[_0x344a('0x30')][_0x344a('0x42')]){_0x5b877d[_0x344a('0x43')]=[{'all':!![]}];}return db[_0x344a('0x2c')][_0x344a('0x44')](_0x5b877d);})['then'](function(_0x115a9c){_0x49bbf8[_0x344a('0x45')]=_0x115a9c;return _0x49bbf8;})[_0x344a('0x25')](respondWithFilteredResult(_0x2d72c9,_0x5b877d))[_0x344a('0x46')](handleError(_0x2d72c9,null));};exports['show']=function(_0x32bfa6,_0x3069ca){var _0x2b0ee9={'raw':![],'where':{'id':_0x32bfa6[_0x344a('0x47')]['id']}},_0x41f25b={};_0x41f25b[_0x344a('0x2f')]=_[_0x344a('0x31')](db[_0x344a('0x2c')][_0x344a('0x2d')]);_0x41f25b[_0x344a('0x30')]=_[_0x344a('0x31')](_0x32bfa6['query']);_0x41f25b[_0x344a('0x32')]=_[_0x344a('0x33')](_0x41f25b['model'],_0x41f25b[_0x344a('0x30')]);_0x2b0ee9[_0x344a('0x35')]=_['intersection'](_0x41f25b[_0x344a('0x2f')],qs[_0x344a('0x34')](_0x32bfa6['query'][_0x344a('0x34')]));_0x2b0ee9[_0x344a('0x35')]=_0x2b0ee9[_0x344a('0x35')]['length']?_0x2b0ee9[_0x344a('0x35')]:_0x41f25b['model'];if(_0x32bfa6[_0x344a('0x30')][_0x344a('0x42')]){_0x2b0ee9[_0x344a('0x43')]=[{'all':!![]}];}_0x2b0ee9=_[_0x344a('0x3e')]({},_0x2b0ee9,_0x32bfa6['options']);return db['ZendeskAccount'][_0x344a('0x48')](_0x2b0ee9)[_0x344a('0x25')](handleEntityNotFound(_0x3069ca,null))[_0x344a('0x25')](respondWithResult(_0x3069ca,null))[_0x344a('0x46')](handleError(_0x3069ca,null));};exports[_0x344a('0x49')]=function(_0xa3c8f0,_0x44962b){return db[_0x344a('0x2c')][_0x344a('0x49')](_0xa3c8f0[_0x344a('0x4a')],{})['then'](respondWithResult(_0x44962b,0xc9))[_0x344a('0x46')](handleError(_0x44962b,null));};exports[_0x344a('0x24')]=function(_0x6fad37,_0xbad7ca){if(_0x6fad37['body']['id']){delete _0x6fad37[_0x344a('0x4a')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x6fad37[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0xbad7ca,null))['then'](saveUpdates(_0x6fad37[_0x344a('0x4a')],null))[_0x344a('0x25')](respondWithResult(_0xbad7ca,null))[_0x344a('0x46')](handleError(_0xbad7ca,null));};exports[_0x344a('0x4b')]=function(_0x51e411,_0x225fce){return db[_0x344a('0x2c')][_0x344a('0x48')]({'where':{'id':_0x51e411[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x225fce,null))[_0x344a('0x25')](removeEntity(_0x225fce,null))[_0x344a('0x46')](handleError(_0x225fce,null));};exports[_0x344a('0x4c')]=function(_0x292357,_0x1911d0,_0x5e0885){var _0x15928a={};var _0x47ce9c={};var _0x1b7f6c;var _0xb744c6;return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x292357[_0x344a('0x47')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x1911d0,null))[_0x344a('0x25')](function(_0x14921e){if(_0x14921e){_0x1b7f6c=_0x14921e;_0x47ce9c[_0x344a('0x2f')]=_[_0x344a('0x31')](db[_0x344a('0x4d')][_0x344a('0x2d')]);_0x47ce9c[_0x344a('0x30')]=_['keys'](_0x292357[_0x344a('0x30')]);_0x47ce9c[_0x344a('0x32')]=_[_0x344a('0x33')](_0x47ce9c[_0x344a('0x2f')],_0x47ce9c[_0x344a('0x30')]);_0x15928a['attributes']=_[_0x344a('0x33')](_0x47ce9c[_0x344a('0x2f')],qs[_0x344a('0x34')](_0x292357[_0x344a('0x30')]['fields']));_0x15928a[_0x344a('0x35')]=_0x15928a[_0x344a('0x35')]['length']?_0x15928a[_0x344a('0x35')]:_0x47ce9c[_0x344a('0x2f')];_0x15928a[_0x344a('0x39')]=qs[_0x344a('0x3a')](_0x292357[_0x344a('0x30')][_0x344a('0x3a')]);_0x15928a[_0x344a('0x3b')]=qs['filters'](_['pick'](_0x292357['query'],_0x47ce9c[_0x344a('0x32')]));if(_0x292357[_0x344a('0x30')][_0x344a('0x3d')]){_0x15928a[_0x344a('0x3b')]=_['merge'](_0x15928a[_0x344a('0x3b')],{'$or':_['map'](_0x15928a['attributes'],function(_0x57241e){var _0x56b562={};_0x56b562[_0x57241e]={'$like':'%'+_0x292357[_0x344a('0x30')][_0x344a('0x3d')]+'%'};return _0x56b562;})});}_0x15928a=_[_0x344a('0x3e')]({},_0x15928a,_0x292357[_0x344a('0x41')]);return _0x1b7f6c['getConfigurations'](_0x15928a);}})['then'](function(_0x56e76e){if(_0x56e76e){_0xb744c6=_0x56e76e[_0x344a('0x36')];if(!_0x292357[_0x344a('0x30')][_0x344a('0x37')](_0x344a('0x38'))){_0x15928a[_0x344a('0x1d')]=qs['limit'](_0x292357[_0x344a('0x30')][_0x344a('0x1d')]);_0x15928a[_0x344a('0x1b')]=qs['offset'](_0x292357[_0x344a('0x30')]['offset']);}return _0x1b7f6c['getConfigurations'](_0x15928a);}})[_0x344a('0x25')](function(_0x532bcf){if(_0x532bcf){return _0x532bcf?{'count':_0xb744c6,'rows':_0x532bcf}:null;}})['then'](respondWithResult(_0x1911d0,null))[_0x344a('0x46')](handleError(_0x1911d0,null));};exports[_0x344a('0x4e')]=function(_0x4f2e35,_0x1bf894,_0x5808f2){if(_0x4f2e35[_0x344a('0x4a')]['id']){delete _0x4f2e35[_0x344a('0x4a')]['id'];}return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x4f2e35['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x1bf894,null))[_0x344a('0x25')](function(_0xb4ddd7){if(_0xb4ddd7){_0x4f2e35[_0x344a('0x4a')]['AccountId']=_0xb4ddd7['id'];_0x4f2e35['body'][_0x344a('0x4f')]=integrations[_0x344a('0x50')](_0x4f2e35[_0x344a('0x4a')]['channel'],_0x4f2e35[_0x344a('0x4a')][_0x344a('0x3f')]);_0x4f2e35['body'][_0x344a('0x51')]=integrations['getDescriptions'](_0x4f2e35[_0x344a('0x4a')]['channel'],_0x4f2e35['body']['type']);return db[_0x344a('0x4d')][_0x344a('0x49')](_0x4f2e35[_0x344a('0x4a')],{'include':[{'model':db[_0x344a('0x52')],'as':_0x344a('0x4f')},{'model':db[_0x344a('0x52')],'as':'Descriptions'}]});}return null;})[_0x344a('0x25')](respondWithResult(_0x1bf894,null))[_0x344a('0x46')](handleError(_0x1bf894,null));};exports[_0x344a('0x53')]=function(_0x1c4284,_0x26688e,_0x523774){var _0x23a761='';return db[_0x344a('0x2c')]['findOne']({'where':{'id':_0x1c4284[_0x344a('0x47')]['id']},'attributes':['id',_0x344a('0x54'),_0x344a('0x55'),_0x344a('0x56'),'authType',_0x344a('0x57')]})[_0x344a('0x25')](handleEntityNotFound(_0x26688e,null))[_0x344a('0x25')](function(_0x42e1c0){if(_0x42e1c0){_0x23a761=_0x42e1c0[_0x344a('0x57')];var _0x421a09=_0x23a761[_0x344a('0x58')](-0x1);if(_0x421a09==='/'){_0x23a761=_0x23a761[_0x344a('0x59')](0x0,_0x23a761['lastIndexOf'](_0x421a09));}var _0x33113e={'method':_0x344a('0x5a'),'uri':util[_0x344a('0x5b')](_0x344a('0x5c'),_0x23a761,_0x344a('0x5d')),'json':!![]};switch(_0x42e1c0[_0x344a('0x5e')]){case _0x344a('0x55'):_0x33113e[_0x344a('0x5f')]={'Authorization':util['format'](_0x344a('0x60'),new Buffer(util[_0x344a('0x5b')](_0x344a('0x61'),_0x42e1c0[_0x344a('0x54')],_0x42e1c0['password']))[_0x344a('0x62')](_0x344a('0x63')))};break;case _0x344a('0x56'):_0x33113e[_0x344a('0x5f')]={'Authorization':util[_0x344a('0x5b')](_0x344a('0x60'),new Buffer(util[_0x344a('0x5b')](_0x344a('0x64'),_0x42e1c0['username'],_0x42e1c0[_0x344a('0x56')]))[_0x344a('0x62')](_0x344a('0x63')))};break;default:throw new db[(_0x344a('0x65'))]['ValidationError'](_0x344a('0x66'));}return rp(_0x33113e);}})[_0x344a('0x25')](function(_0x1d0025){if(_0x1d0025){var _0x2ff11d=[_0x344a('0x67'),_0x344a('0x68'),'group',_0x344a('0x69')];_[_0x344a('0x6a')](_0x1d0025[_0x344a('0x5d')],function(_0x5584d5){return _0x2ff11d[_0x344a('0x6b')](_0x5584d5[_0x344a('0x3f')]);});return{'count':_0x1d0025[_0x344a('0x5d')][_0x344a('0x36')],'rows':_[_0x344a('0x2b')](_0x1d0025['ticket_fields'],function(_0x15aadb){return{'id':_0x15aadb['id'],'name':_0x15aadb[_0x344a('0x6c')]>0x7?_0x15aadb[_0x344a('0x6d')]:_0x15aadb['type'],'custom':_0x15aadb[_0x344a('0x6c')]>0x7?!![]:![],'options':_0x15aadb['system_field_options']?_0x15aadb['system_field_options']:_0x15aadb[_0x344a('0x6e')]?_0x15aadb[_0x344a('0x6e')]:[]};})};}})[_0x344a('0x25')](respondWithResult(_0x26688e,null))[_0x344a('0x46')](function(_0x375c34){var _0x5e8df4=_0x1c4284[_0x344a('0x30')][_0x344a('0x6f')]?0x1f4:_0x375c34['statusCode']||0x1f4;logger[_0x344a('0x26')](_0x344a('0x70'),'getFields',_0x5e8df4,JSON['stringify'](_0x375c34));delete _0x375c34[_0x344a('0x28')];if(_0x5e8df4===0x191){_0x5e8df4=0x190;}_0x26688e[_0x344a('0x18')](_0x5e8df4)[_0x344a('0x29')](_0x1c4284[_0x344a('0x30')]['test']?{'message':_0x344a('0x71'),'statusCode':_0x375c34[_0x344a('0x72')]}:_0x375c34);});};
\ No newline at end of file
+var _0xe605=['password','token','authType','remoteUri','slice','GET','format','headers','Basic\x20%s','toString','base64','Sequelize','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','update','then','destroy','end','error','name','send','index','map','ZendeskAccount','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','getConfigurations','findOne','ZendeskConfiguration','rawAttributes','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username'];(function(_0x741427,_0x21fe4c){var _0x5e0a59=function(_0x2c4eb5){while(--_0x2c4eb5){_0x741427['push'](_0x741427['shift']());}};_0x5e0a59(++_0x21fe4c);}(_0xe605,0x92));var _0x5e60=function(_0x58dd5a,_0x4fa33e){_0x58dd5a=_0x58dd5a-0x0;var _0x3c989e=_0xe605[_0x58dd5a];return _0x3c989e;};'use strict';var emlformat=require(_0x5e60('0x0'));var rimraf=require(_0x5e60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e60('0x2'));var rp=require(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require(_0x5e60('0x5'));var Mustache=require(_0x5e60('0x6'));var util=require(_0x5e60('0x7'));var path=require(_0x5e60('0x8'));var sox=require(_0x5e60('0x9'));var csv=require(_0x5e60('0xa'));var ejs=require(_0x5e60('0xb'));var fs=require('fs');var fs_extra=require(_0x5e60('0xc'));var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var licenseUtil=require(_0x5e60('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5e60('0x19'));function respondWithStatusCode(_0x178782,_0x1f4e14){_0x1f4e14=_0x1f4e14||0xcc;return function(_0xe039de){if(_0xe039de){return _0x178782[_0x5e60('0x1a')](_0x1f4e14);}return _0x178782[_0x5e60('0x1b')](_0x1f4e14)['end']();};}function respondWithResult(_0x209adb,_0x45304f){_0x45304f=_0x45304f||0xc8;return function(_0x21e3c8){if(_0x21e3c8){return _0x209adb[_0x5e60('0x1b')](_0x45304f)['json'](_0x21e3c8);}};}function respondWithFilteredResult(_0x20af5f,_0x529ffe){return function(_0x1ffd77){if(_0x1ffd77){var _0x3bc7d8=typeof _0x529ffe['offset']===_0x5e60('0x1c')&&typeof _0x529ffe[_0x5e60('0x1d')]===_0x5e60('0x1c');var _0x43045a=_0x1ffd77['count'];var _0xdd0a71=_0x3bc7d8?0x0:_0x529ffe[_0x5e60('0x1e')];var _0x52cc15=_0x3bc7d8?_0x1ffd77[_0x5e60('0x1f')]:_0x529ffe[_0x5e60('0x1e')]+_0x529ffe[_0x5e60('0x1d')];var _0x311fef;if(_0x52cc15>=_0x43045a){_0x52cc15=_0x43045a;_0x311fef=0xc8;}else{_0x311fef=0xce;}_0x20af5f[_0x5e60('0x1b')](_0x311fef);return _0x20af5f[_0x5e60('0x20')](_0x5e60('0x21'),_0xdd0a71+'-'+_0x52cc15+'/'+_0x43045a)[_0x5e60('0x22')](_0x1ffd77);}return null;};}function patchUpdates(_0x3282e4){return function(_0x45f1a6){try{jsonpatch[_0x5e60('0x23')](_0x45f1a6,_0x3282e4,!![]);}catch(_0x578437){return BPromise[_0x5e60('0x24')](_0x578437);}return _0x45f1a6['save']();};}function saveUpdates(_0x376069,_0x1a44e5){return function(_0x2b0bae){if(_0x2b0bae){return _0x2b0bae[_0x5e60('0x25')](_0x376069)[_0x5e60('0x26')](function(_0x2a499e){return _0x2a499e;});}return null;};}function removeEntity(_0x2636f1,_0x5d2c03){return function(_0x18d527){if(_0x18d527){return _0x18d527[_0x5e60('0x27')]()[_0x5e60('0x26')](function(){_0x2636f1['status'](0xcc)[_0x5e60('0x28')]();});}};}function handleEntityNotFound(_0x56e3a5,_0x2d8aac){return function(_0x153459){if(!_0x153459){_0x56e3a5['sendStatus'](0x194);}return _0x153459;};}function handleError(_0x3bedea,_0x5712f7){_0x5712f7=_0x5712f7||0x1f4;return function(_0x23d187){logger[_0x5e60('0x29')](_0x23d187['stack']);if(_0x23d187[_0x5e60('0x2a')]){delete _0x23d187[_0x5e60('0x2a')];}_0x3bedea['status'](_0x5712f7)[_0x5e60('0x2b')](_0x23d187);};}exports[_0x5e60('0x2c')]=function(_0x52c97c,_0x5431a8){var _0x52f668={},_0xf25956={},_0x235cc7={'count':0x0,'rows':[]};var _0x2e8e9e=_[_0x5e60('0x2d')](db[_0x5e60('0x2e')]['rawAttributes'],function(_0x168ce6){return{'name':_0x168ce6[_0x5e60('0x2f')],'type':_0x168ce6['type'][_0x5e60('0x30')]};});_0xf25956['model']=_['map'](_0x2e8e9e,_0x5e60('0x2a'));_0xf25956[_0x5e60('0x31')]=_[_0x5e60('0x32')](_0x52c97c[_0x5e60('0x31')]);_0xf25956[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0xf25956[_0x5e60('0x35')],_0xf25956[_0x5e60('0x31')]);_0x52f668[_0x5e60('0x36')]=_[_0x5e60('0x34')](_0xf25956['model'],qs[_0x5e60('0x37')](_0x52c97c['query']['fields']));_0x52f668[_0x5e60('0x36')]=_0x52f668[_0x5e60('0x36')]['length']?_0x52f668[_0x5e60('0x36')]:_0xf25956['model'];if(!_0x52c97c[_0x5e60('0x31')][_0x5e60('0x38')](_0x5e60('0x39'))){_0x52f668[_0x5e60('0x1d')]=qs[_0x5e60('0x1d')](_0x52c97c[_0x5e60('0x31')][_0x5e60('0x1d')]);_0x52f668[_0x5e60('0x1e')]=qs['offset'](_0x52c97c[_0x5e60('0x31')][_0x5e60('0x1e')]);}_0x52f668[_0x5e60('0x3a')]=qs[_0x5e60('0x3b')](_0x52c97c[_0x5e60('0x31')][_0x5e60('0x3b')]);_0x52f668[_0x5e60('0x3c')]=qs['filters'](_[_0x5e60('0x3d')](_0x52c97c[_0x5e60('0x31')],_0xf25956['filters']),_0x2e8e9e);if(_0x52c97c['query'][_0x5e60('0x3e')]){_0x52f668[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x52f668[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2d')](_0x2e8e9e,function(_0x4d2cd0){if(_0x4d2cd0[_0x5e60('0x40')]!==_0x5e60('0x41')){var _0x415208={};_0x415208[_0x4d2cd0[_0x5e60('0x2a')]]={'$like':'%'+_0x52c97c[_0x5e60('0x31')][_0x5e60('0x3e')]+'%'};return _0x415208;}})});}_0x52f668=_[_0x5e60('0x3f')]({},_0x52f668,_0x52c97c['options']);var _0x401bf1={'where':_0x52f668[_0x5e60('0x3c')]};return db['ZendeskAccount']['count'](_0x401bf1)['then'](function(_0x15a97b){_0x235cc7[_0x5e60('0x1f')]=_0x15a97b;if(_0x52c97c[_0x5e60('0x31')][_0x5e60('0x42')]){_0x52f668['include']=[{'all':!![]}];}return db[_0x5e60('0x2e')][_0x5e60('0x43')](_0x52f668);})['then'](function(_0x5bda22){_0x235cc7[_0x5e60('0x44')]=_0x5bda22;return _0x235cc7;})[_0x5e60('0x26')](respondWithFilteredResult(_0x5431a8,_0x52f668))[_0x5e60('0x45')](handleError(_0x5431a8,null));};exports[_0x5e60('0x46')]=function(_0x39ab09,_0x3899ae){var _0x2522d2={'raw':![],'where':{'id':_0x39ab09[_0x5e60('0x47')]['id']}},_0x2812e1={};_0x2812e1['model']=_[_0x5e60('0x32')](db[_0x5e60('0x2e')]['rawAttributes']);_0x2812e1[_0x5e60('0x31')]=_[_0x5e60('0x32')](_0x39ab09[_0x5e60('0x31')]);_0x2812e1[_0x5e60('0x33')]=_[_0x5e60('0x34')](_0x2812e1['model'],_0x2812e1[_0x5e60('0x31')]);_0x2522d2[_0x5e60('0x36')]=_[_0x5e60('0x34')](_0x2812e1[_0x5e60('0x35')],qs['fields'](_0x39ab09['query']['fields']));_0x2522d2[_0x5e60('0x36')]=_0x2522d2[_0x5e60('0x36')][_0x5e60('0x48')]?_0x2522d2[_0x5e60('0x36')]:_0x2812e1[_0x5e60('0x35')];if(_0x39ab09[_0x5e60('0x31')]['includeAll']){_0x2522d2[_0x5e60('0x49')]=[{'all':!![]}];}_0x2522d2=_[_0x5e60('0x3f')]({},_0x2522d2,_0x39ab09[_0x5e60('0x4a')]);return db[_0x5e60('0x2e')][_0x5e60('0x4b')](_0x2522d2)[_0x5e60('0x26')](handleEntityNotFound(_0x3899ae,null))[_0x5e60('0x26')](respondWithResult(_0x3899ae,null))['catch'](handleError(_0x3899ae,null));};exports[_0x5e60('0x4c')]=function(_0x3ed45d,_0x21a116){return db[_0x5e60('0x2e')][_0x5e60('0x4c')](_0x3ed45d[_0x5e60('0x4d')],{})[_0x5e60('0x26')](respondWithResult(_0x21a116,0xc9))[_0x5e60('0x45')](handleError(_0x21a116,null));};exports[_0x5e60('0x25')]=function(_0x350d6d,_0xe5e675){if(_0x350d6d[_0x5e60('0x4d')]['id']){delete _0x350d6d[_0x5e60('0x4d')]['id'];}return db[_0x5e60('0x2e')][_0x5e60('0x4b')]({'where':{'id':_0x350d6d[_0x5e60('0x47')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0xe5e675,null))[_0x5e60('0x26')](saveUpdates(_0x350d6d['body'],null))['then'](respondWithResult(_0xe5e675,null))[_0x5e60('0x45')](handleError(_0xe5e675,null));};exports['destroy']=function(_0x3525d,_0x1d247e){return db[_0x5e60('0x2e')][_0x5e60('0x4b')]({'where':{'id':_0x3525d[_0x5e60('0x47')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x1d247e,null))['then'](removeEntity(_0x1d247e,null))['catch'](handleError(_0x1d247e,null));};exports[_0x5e60('0x4e')]=function(_0x1e4e41,_0x457c37,_0x4a2d67){var _0x594068={};var _0x31ced8={};var _0x46f3ba;var _0x179cc6;return db['ZendeskAccount'][_0x5e60('0x4f')]({'where':{'id':_0x1e4e41[_0x5e60('0x47')]['id']}})[_0x5e60('0x26')](handleEntityNotFound(_0x457c37,null))[_0x5e60('0x26')](function(_0x17d002){if(_0x17d002){_0x46f3ba=_0x17d002;_0x31ced8[_0x5e60('0x35')]=_['keys'](db[_0x5e60('0x50')][_0x5e60('0x51')]);_0x31ced8['query']=_[_0x5e60('0x32')](_0x1e4e41[_0x5e60('0x31')]);_0x31ced8[_0x5e60('0x33')]=_['intersection'](_0x31ced8[_0x5e60('0x35')],_0x31ced8[_0x5e60('0x31')]);_0x594068['attributes']=_[_0x5e60('0x34')](_0x31ced8[_0x5e60('0x35')],qs[_0x5e60('0x37')](_0x1e4e41[_0x5e60('0x31')]['fields']));_0x594068[_0x5e60('0x36')]=_0x594068[_0x5e60('0x36')]['length']?_0x594068[_0x5e60('0x36')]:_0x31ced8['model'];_0x594068[_0x5e60('0x3a')]=qs['sort'](_0x1e4e41[_0x5e60('0x31')][_0x5e60('0x3b')]);_0x594068['where']=qs[_0x5e60('0x33')](_['pick'](_0x1e4e41[_0x5e60('0x31')],_0x31ced8['filters']));if(_0x1e4e41[_0x5e60('0x31')]['filter']){_0x594068[_0x5e60('0x3c')]=_[_0x5e60('0x3f')](_0x594068[_0x5e60('0x3c')],{'$or':_[_0x5e60('0x2d')](_0x594068[_0x5e60('0x36')],function(_0x2b8343){var _0x3d1e35={};_0x3d1e35[_0x2b8343]={'$like':'%'+_0x1e4e41['query'][_0x5e60('0x3e')]+'%'};return _0x3d1e35;})});}_0x594068=_[_0x5e60('0x3f')]({},_0x594068,_0x1e4e41[_0x5e60('0x4a')]);return _0x46f3ba[_0x5e60('0x4e')](_0x594068);}})[_0x5e60('0x26')](function(_0x35aad7){if(_0x35aad7){_0x179cc6=_0x35aad7['length'];if(!_0x1e4e41['query']['hasOwnProperty'](_0x5e60('0x39'))){_0x594068[_0x5e60('0x1d')]=qs['limit'](_0x1e4e41[_0x5e60('0x31')][_0x5e60('0x1d')]);_0x594068['offset']=qs[_0x5e60('0x1e')](_0x1e4e41[_0x5e60('0x31')][_0x5e60('0x1e')]);}return _0x46f3ba[_0x5e60('0x4e')](_0x594068);}})[_0x5e60('0x26')](function(_0xcd2232){if(_0xcd2232){return _0xcd2232?{'count':_0x179cc6,'rows':_0xcd2232}:null;}})[_0x5e60('0x26')](respondWithResult(_0x457c37,null))[_0x5e60('0x45')](handleError(_0x457c37,null));};exports[_0x5e60('0x52')]=function(_0x406c3a,_0x157aad,_0x15921d){if(_0x406c3a[_0x5e60('0x4d')]['id']){delete _0x406c3a[_0x5e60('0x4d')]['id'];}return db[_0x5e60('0x2e')][_0x5e60('0x4f')]({'where':{'id':_0x406c3a[_0x5e60('0x47')]['id']}})['then'](handleEntityNotFound(_0x157aad,null))[_0x5e60('0x26')](function(_0x1706d6){if(_0x1706d6){_0x406c3a[_0x5e60('0x4d')]['AccountId']=_0x1706d6['id'];_0x406c3a[_0x5e60('0x4d')][_0x5e60('0x53')]=integrations['getSubjects'](_0x406c3a[_0x5e60('0x4d')][_0x5e60('0x54')],_0x406c3a['body'][_0x5e60('0x40')]);_0x406c3a[_0x5e60('0x4d')][_0x5e60('0x55')]=integrations[_0x5e60('0x56')](_0x406c3a[_0x5e60('0x4d')][_0x5e60('0x54')],_0x406c3a[_0x5e60('0x4d')][_0x5e60('0x40')]);return db[_0x5e60('0x50')]['create'](_0x406c3a[_0x5e60('0x4d')],{'include':[{'model':db[_0x5e60('0x57')],'as':_0x5e60('0x53')},{'model':db['ZendeskField'],'as':_0x5e60('0x55')}]});}return null;})[_0x5e60('0x26')](respondWithResult(_0x157aad,null))[_0x5e60('0x45')](handleError(_0x157aad,null));};exports[_0x5e60('0x58')]=function(_0x3e85fe,_0x559f8c,_0x4560e1){var _0x213c7e='';return db[_0x5e60('0x2e')]['findOne']({'where':{'id':_0x3e85fe['params']['id']},'attributes':['id',_0x5e60('0x59'),_0x5e60('0x5a'),_0x5e60('0x5b'),_0x5e60('0x5c'),_0x5e60('0x5d')]})[_0x5e60('0x26')](handleEntityNotFound(_0x559f8c,null))[_0x5e60('0x26')](function(_0x563e69){if(_0x563e69){_0x213c7e=_0x563e69[_0x5e60('0x5d')];var _0x199edd=_0x213c7e[_0x5e60('0x5e')](-0x1);if(_0x199edd==='/'){_0x213c7e=_0x213c7e['substring'](0x0,_0x213c7e['lastIndexOf'](_0x199edd));}var _0x447bd3={'method':_0x5e60('0x5f'),'uri':util[_0x5e60('0x60')]('%s/%s',_0x213c7e,'ticket_fields'),'json':!![]};switch(_0x563e69[_0x5e60('0x5c')]){case _0x5e60('0x5a'):_0x447bd3[_0x5e60('0x61')]={'Authorization':util[_0x5e60('0x60')](_0x5e60('0x62'),new Buffer(util[_0x5e60('0x60')]('%s:%s',_0x563e69[_0x5e60('0x59')],_0x563e69[_0x5e60('0x5a')]))[_0x5e60('0x63')](_0x5e60('0x64')))};break;case _0x5e60('0x5b'):_0x447bd3[_0x5e60('0x61')]={'Authorization':util[_0x5e60('0x60')](_0x5e60('0x62'),new Buffer(util[_0x5e60('0x60')]('%s/token:%s',_0x563e69[_0x5e60('0x59')],_0x563e69[_0x5e60('0x5b')]))['toString'](_0x5e60('0x64')))};break;default:throw new db[(_0x5e60('0x65'))]['ValidationError'](_0x5e60('0x66'));}return rp(_0x447bd3);}})[_0x5e60('0x26')](function(_0x391505){if(_0x391505){var _0x1b4aee=[_0x5e60('0x67'),_0x5e60('0x68'),'group',_0x5e60('0x69')];_[_0x5e60('0x6a')](_0x391505[_0x5e60('0x6b')],function(_0x222d94){return _0x1b4aee[_0x5e60('0x6c')](_0x222d94[_0x5e60('0x40')]);});return{'count':_0x391505[_0x5e60('0x6b')][_0x5e60('0x48')],'rows':_[_0x5e60('0x2d')](_0x391505['ticket_fields'],function(_0x10b77b){return{'id':_0x10b77b['id'],'name':_0x10b77b[_0x5e60('0x6d')]>0x7?_0x10b77b[_0x5e60('0x6e')]:_0x10b77b[_0x5e60('0x40')],'custom':_0x10b77b[_0x5e60('0x6d')]>0x7?!![]:![],'options':_0x10b77b[_0x5e60('0x6f')]?_0x10b77b[_0x5e60('0x6f')]:_0x10b77b[_0x5e60('0x70')]?_0x10b77b[_0x5e60('0x70')]:[]};})};}})[_0x5e60('0x26')](respondWithResult(_0x559f8c,null))['catch'](function(_0x5ab78f){var _0x5d2839=_0x3e85fe[_0x5e60('0x31')][_0x5e60('0x71')]?0x1f4:_0x5ab78f[_0x5e60('0x72')]||0x1f4;logger[_0x5e60('0x29')](_0x5e60('0x73'),_0x5e60('0x58'),_0x5d2839,JSON[_0x5e60('0x74')](_0x5ab78f));delete _0x5ab78f[_0x5e60('0x2a')];if(_0x5d2839===0x191){_0x5d2839=0x190;}_0x559f8c[_0x5e60('0x1b')](_0x5d2839)['send'](_0x3e85fe[_0x5e60('0x31')][_0x5e60('0x71')]?{'message':_0x5e60('0x75'),'statusCode':_0x5ab78f['statusCode']}:_0x5ab78f);});};
\ No newline at end of file
index d444ac1..3b2e792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17a8=['lodash','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x38ef1f,_0x405cf6){var _0x14f963=function(_0x5b7be6){while(--_0x5b7be6){_0x38ef1f['push'](_0x38ef1f['shift']());}};_0x14f963(++_0x405cf6);}(_0x17a8,0x1ee));var _0x817a=function(_0x33f1e2,_0x2111bb){_0x33f1e2=_0x33f1e2-0x0;var _0x581421=_0x17a8[_0x33f1e2];return _0x581421;};'use strict';var _=require(_0x817a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x817a('0x1'));var moment=require(_0x817a('0x2'));var BPromise=require('bluebird');var rp=require(_0x817a('0x3'));var fs=require('fs');var path=require(_0x817a('0x4'));var rimraf=require(_0x817a('0x5'));var config=require(_0x817a('0x6'));var attributes=require(_0x817a('0x7'));var integrations=require(_0x817a('0x8'));module[_0x817a('0x9')]=function(_0x4f9cce,_0x4d2b48){return _0x4f9cce[_0x817a('0xa')](_0x817a('0xb'),attributes,{'tableName':_0x817a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f48=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x511631,_0x5064b0){var _0x4f86b4=function(_0x163522){while(--_0x163522){_0x511631['push'](_0x511631['shift']());}};_0x4f86b4(++_0x5064b0);}(_0x0f48,0x165));var _0x80f4=function(_0x1fbf96,_0x1d1fb7){_0x1fbf96=_0x1fbf96-0x0;var _0x3017d7=_0x0f48[_0x1fbf96];return _0x3017d7;};'use strict';var _=require(_0x80f4('0x0'));var util=require(_0x80f4('0x1'));var logger=require('../../config/logger')(_0x80f4('0x2'));var moment=require(_0x80f4('0x3'));var BPromise=require(_0x80f4('0x4'));var rp=require(_0x80f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x80f4('0x6'));var attributes=require(_0x80f4('0x7'));var integrations=require(_0x80f4('0x8'));module[_0x80f4('0x9')]=function(_0x1c5e5b,_0x34800f){return _0x1c5e5b[_0x80f4('0xa')](_0x80f4('0xb'),attributes,{'tableName':_0x80f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e451a9..7cff0a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61de=['ZendeskAccount','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskAccount,\x20%s,\x20%s','catch','GetZendeskAccount'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x61de,0x18c));var _0xe61d=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x61de[_0x2555d0];return _0x3bb486;};'use strict';var _=require(_0xe61d('0x0'));var util=require(_0xe61d('0x1'));var moment=require(_0xe61d('0x2'));var BPromise=require(_0xe61d('0x3'));var rs=require(_0xe61d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe61d('0x5'));var logger=require(_0xe61d('0x6'))(_0xe61d('0x7'));var config=require(_0xe61d('0x8'));var jayson=require(_0xe61d('0x9'));var client=jayson[_0xe61d('0xa')][_0xe61d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x388d3d,_0x2e5708,_0x15315c){return new BPromise(function(_0x293a84,_0x4da4ac){return client['request'](_0x388d3d,_0x15315c)[_0xe61d('0xc')](function(_0x439f6c){logger[_0xe61d('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x2e5708,_0xe61d('0xe'));logger[_0xe61d('0xf')](_0xe61d('0x10'),_0x2e5708,_0xe61d('0xe'),JSON[_0xe61d('0x11')](_0x439f6c));if(_0x439f6c['error']){if(_0x439f6c[_0xe61d('0x12')][_0xe61d('0x13')]===0x1f4){logger[_0xe61d('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x2e5708,_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);return _0x4da4ac(_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);}logger['error'](_0xe61d('0x15'),_0x2e5708,_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);return _0x293a84(_0x439f6c[_0xe61d('0x12')][_0xe61d('0x14')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2e5708,_0xe61d('0xe'));_0x293a84(_0x439f6c['result']['message']);}})[_0xe61d('0x16')](function(_0x288d20){logger[_0xe61d('0x12')](_0xe61d('0x15'),_0x2e5708,_0x288d20);_0x4da4ac(_0x288d20);});});}exports[_0xe61d('0x17')]=function(_0x842b93){var _0x9323df=this;return new Promise(function(_0x3cf7ea,_0x5467ad){return db[_0xe61d('0x18')]['findAll']({'raw':_0x842b93[_0xe61d('0x19')]?_0x842b93['options'][_0xe61d('0x1a')]===undefined?!![]:![]:!![],'where':_0x842b93[_0xe61d('0x19')]?_0x842b93[_0xe61d('0x19')][_0xe61d('0x1b')]||null:null,'attributes':_0x842b93[_0xe61d('0x19')]?_0x842b93[_0xe61d('0x19')][_0xe61d('0x1c')]||null:null,'limit':_0x842b93[_0xe61d('0x19')]?_0x842b93['options'][_0xe61d('0x1d')]||null:null,'include':_0x842b93[_0xe61d('0x19')]?_0x842b93[_0xe61d('0x19')][_0xe61d('0x1e')]?_[_0xe61d('0x1f')](_0x842b93['options'][_0xe61d('0x1e')],function(_0x4226b5){return{'model':db[_0x4226b5[_0xe61d('0x20')]],'as':_0x4226b5['as'],'attributes':_0x4226b5[_0xe61d('0x1c')],'include':_0x4226b5[_0xe61d('0x1e')]?_[_0xe61d('0x1f')](_0x4226b5['include'],function(_0x2a83f6){return{'model':db[_0x2a83f6[_0xe61d('0x20')]],'as':_0x2a83f6['as'],'attributes':_0x2a83f6['attributes'],'include':_0x2a83f6[_0xe61d('0x1e')]?_[_0xe61d('0x1f')](_0x2a83f6[_0xe61d('0x1e')],function(_0x2a196a){return{'model':db[_0x2a196a[_0xe61d('0x20')]],'as':_0x2a196a['as'],'attributes':_0x2a196a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe61d('0xc')](function(_0x33c8fc){logger['info'](_0xe61d('0x17'),_0x842b93);logger[_0xe61d('0xf')](_0xe61d('0x17'),_0x842b93,JSON[_0xe61d('0x11')](_0x33c8fc));_0x3cf7ea(_0x33c8fc);})[_0xe61d('0x16')](function(_0x112de5){logger[_0xe61d('0x12')]('GetZendeskAccount',_0x112de5[_0xe61d('0x14')],_0x842b93);_0x5467ad(_0x9323df['error'](0x1f4,_0x112de5['message']));});});};exports[_0xe61d('0x21')]=function(_0x3a049c){var _0x5c1ed3=this;return new Promise(function(_0x4ff252,_0x22e2d3){return db[_0xe61d('0x18')][_0xe61d('0x22')]({'raw':_0x3a049c[_0xe61d('0x19')]?_0x3a049c['options'][_0xe61d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a049c[_0xe61d('0x19')]?_0x3a049c['options'][_0xe61d('0x1b')]||null:null,'attributes':_0x3a049c[_0xe61d('0x19')]?_0x3a049c[_0xe61d('0x19')]['attributes']||null:null,'include':_0x3a049c['options']?_0x3a049c[_0xe61d('0x19')][_0xe61d('0x1e')]?_['map'](_0x3a049c[_0xe61d('0x19')][_0xe61d('0x1e')],function(_0x21655c){return{'model':db[_0x21655c[_0xe61d('0x20')]],'as':_0x21655c['as'],'attributes':_0x21655c[_0xe61d('0x1c')],'include':_0x21655c['include']?_['map'](_0x21655c[_0xe61d('0x1e')],function(_0x2ce541){return{'model':db[_0x2ce541[_0xe61d('0x20')]],'as':_0x2ce541['as'],'attributes':_0x2ce541[_0xe61d('0x1c')],'include':_0x2ce541[_0xe61d('0x1e')]?_[_0xe61d('0x1f')](_0x2ce541['include'],function(_0xe903c2){return{'model':db[_0xe903c2[_0xe61d('0x20')]],'as':_0xe903c2['as'],'attributes':_0xe903c2[_0xe61d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe61d('0xc')](function(_0x379591){logger[_0xe61d('0xd')]('ShowZendeskAccount',_0x3a049c);logger[_0xe61d('0xf')](_0xe61d('0x21'),_0x3a049c,JSON[_0xe61d('0x11')](_0x379591));_0x4ff252(_0x379591);})[_0xe61d('0x16')](function(_0x2da706){logger[_0xe61d('0x12')](_0xe61d('0x21'),_0x2da706[_0xe61d('0x14')],_0x3a049c);_0x22e2d3(_0x5c1ed3[_0xe61d('0x12')](0x1f4,_0x2da706[_0xe61d('0x14')]));});});};
\ No newline at end of file
+var _0xd2d0=['request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','find','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e5545,_0x32dcb5){var _0x3b2859=function(_0x3b36f9){while(--_0x3b36f9){_0x3e5545['push'](_0x3e5545['shift']());}};_0x3b2859(++_0x32dcb5);}(_0xd2d0,0x80));var _0x0d2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2d0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0d2d('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d2d('0x1'));var db=require(_0x0d2d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d2d('0x3'))(_0x0d2d('0x4'));var config=require(_0x0d2d('0x5'));var jayson=require(_0x0d2d('0x6'));var client=jayson[_0x0d2d('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a46f0,_0xe2ecec,_0x4cca7d){return new BPromise(function(_0x40b538,_0x47ce30){return client[_0x0d2d('0x8')](_0x2a46f0,_0x4cca7d)[_0x0d2d('0x9')](function(_0x130dd0){logger[_0x0d2d('0xa')](_0x0d2d('0xb'),_0xe2ecec,_0x0d2d('0xc'));logger[_0x0d2d('0xd')](_0x0d2d('0xe'),_0xe2ecec,_0x0d2d('0xc'),JSON['stringify'](_0x130dd0));if(_0x130dd0['error']){if(_0x130dd0['error'][_0x0d2d('0xf')]===0x1f4){logger[_0x0d2d('0x10')](_0x0d2d('0xb'),_0xe2ecec,_0x130dd0[_0x0d2d('0x10')][_0x0d2d('0x11')]);return _0x47ce30(_0x130dd0[_0x0d2d('0x10')][_0x0d2d('0x11')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0xe2ecec,_0x130dd0[_0x0d2d('0x10')][_0x0d2d('0x11')]);return _0x40b538(_0x130dd0[_0x0d2d('0x10')][_0x0d2d('0x11')]);}else{logger['info'](_0x0d2d('0xb'),_0xe2ecec,'request\x20sent');_0x40b538(_0x130dd0[_0x0d2d('0x12')][_0x0d2d('0x11')]);}})[_0x0d2d('0x13')](function(_0x384751){logger[_0x0d2d('0x10')](_0x0d2d('0xb'),_0xe2ecec,_0x384751);_0x47ce30(_0x384751);});});}exports[_0x0d2d('0x14')]=function(_0x164374){var _0x590eda=this;return new Promise(function(_0x53685f,_0x5d95b2){return db[_0x0d2d('0x15')][_0x0d2d('0x16')]({'raw':_0x164374['options']?_0x164374['options'][_0x0d2d('0x17')]===undefined?!![]:![]:!![],'where':_0x164374[_0x0d2d('0x18')]?_0x164374['options'][_0x0d2d('0x19')]||null:null,'attributes':_0x164374[_0x0d2d('0x18')]?_0x164374[_0x0d2d('0x18')][_0x0d2d('0x1a')]||null:null,'limit':_0x164374[_0x0d2d('0x18')]?_0x164374[_0x0d2d('0x18')][_0x0d2d('0x1b')]||null:null,'include':_0x164374[_0x0d2d('0x18')]?_0x164374[_0x0d2d('0x18')][_0x0d2d('0x1c')]?_[_0x0d2d('0x1d')](_0x164374[_0x0d2d('0x18')]['include'],function(_0x10e481){return{'model':db[_0x10e481[_0x0d2d('0x1e')]],'as':_0x10e481['as'],'attributes':_0x10e481[_0x0d2d('0x1a')],'include':_0x10e481[_0x0d2d('0x1c')]?_[_0x0d2d('0x1d')](_0x10e481['include'],function(_0x89f135){return{'model':db[_0x89f135[_0x0d2d('0x1e')]],'as':_0x89f135['as'],'attributes':_0x89f135[_0x0d2d('0x1a')],'include':_0x89f135[_0x0d2d('0x1c')]?_[_0x0d2d('0x1d')](_0x89f135[_0x0d2d('0x1c')],function(_0x189d34){return{'model':db[_0x189d34[_0x0d2d('0x1e')]],'as':_0x189d34['as'],'attributes':_0x189d34[_0x0d2d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3096c5){logger[_0x0d2d('0xa')](_0x0d2d('0x14'),_0x164374);logger[_0x0d2d('0xd')](_0x0d2d('0x14'),_0x164374,JSON[_0x0d2d('0x1f')](_0x3096c5));_0x53685f(_0x3096c5);})[_0x0d2d('0x13')](function(_0x44c4be){logger[_0x0d2d('0x10')]('GetZendeskAccount',_0x44c4be['message'],_0x164374);_0x5d95b2(_0x590eda[_0x0d2d('0x10')](0x1f4,_0x44c4be['message']));});});};exports[_0x0d2d('0x20')]=function(_0xfd310d){var _0x2e65e8=this;return new Promise(function(_0x2d9b29,_0x45c6ae){return db['ZendeskAccount'][_0x0d2d('0x21')]({'raw':_0xfd310d[_0x0d2d('0x18')]?_0xfd310d[_0x0d2d('0x18')][_0x0d2d('0x17')]===undefined?!![]:![]:!![],'where':_0xfd310d[_0x0d2d('0x18')]?_0xfd310d[_0x0d2d('0x18')]['where']||null:null,'attributes':_0xfd310d[_0x0d2d('0x18')]?_0xfd310d[_0x0d2d('0x18')][_0x0d2d('0x1a')]||null:null,'include':_0xfd310d[_0x0d2d('0x18')]?_0xfd310d[_0x0d2d('0x18')][_0x0d2d('0x1c')]?_['map'](_0xfd310d['options']['include'],function(_0x41bc9b){return{'model':db[_0x41bc9b[_0x0d2d('0x1e')]],'as':_0x41bc9b['as'],'attributes':_0x41bc9b[_0x0d2d('0x1a')],'include':_0x41bc9b['include']?_[_0x0d2d('0x1d')](_0x41bc9b[_0x0d2d('0x1c')],function(_0x4245f4){return{'model':db[_0x4245f4[_0x0d2d('0x1e')]],'as':_0x4245f4['as'],'attributes':_0x4245f4[_0x0d2d('0x1a')],'include':_0x4245f4[_0x0d2d('0x1c')]?_[_0x0d2d('0x1d')](_0x4245f4['include'],function(_0x2f787d){return{'model':db[_0x2f787d[_0x0d2d('0x1e')]],'as':_0x2f787d['as'],'attributes':_0x2f787d[_0x0d2d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0d2d('0x9')](function(_0x32d980){logger[_0x0d2d('0xa')](_0x0d2d('0x20'),_0xfd310d);logger[_0x0d2d('0xd')](_0x0d2d('0x20'),_0xfd310d,JSON[_0x0d2d('0x1f')](_0x32d980));_0x2d9b29(_0x32d980);})[_0x0d2d('0x13')](function(_0x41ab14){logger[_0x0d2d('0x10')](_0x0d2d('0x20'),_0x41ab14['message'],_0xfd310d);_0x45c6ae(_0x2e65e8[_0x0d2d('0x10')](0x1f4,_0x41ab14[_0x0d2d('0x11')]));});});};
\ No newline at end of file
index 6a87b69..a87455b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x32b30e,_0x44385e){var _0xff0d9a=function(_0x421558){while(--_0x421558){_0x32b30e['push'](_0x32b30e['shift']());}};_0xff0d9a(++_0x44385e);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0xe5b5[_0x1098db];return _0x14f090;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router;
\ No newline at end of file
+var _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x4c0ba4,_0x1c9a10){var _0x5e1513=function(_0x4655f7){while(--_0x4655f7){_0x4c0ba4['push'](_0x4c0ba4['shift']());}};_0x5e1513(++_0x1c9a10);}(_0x91a7,0xe7));var _0x791a=function(_0xa1d6b8,_0x520df3){_0xa1d6b8=_0xa1d6b8-0x0;var _0x4ee62b=_0x91a7[_0xa1d6b8];return _0x4ee62b;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router;
\ No newline at end of file
index 2ae5dcf..1fbb4c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eef=['STRING','sequelize','exports'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x1eef,0x10c));var _0xf1ee=function(_0x3cba93,_0x5c2fd8){_0x3cba93=_0x3cba93-0x0;var _0x4a2991=_0x1eef[_0x3cba93];return _0x4a2991;};'use strict';var Sequelize=require(_0xf1ee('0x0'));module[_0xf1ee('0x1')]={'name':{'type':Sequelize[_0xf1ee('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3a4a=['sequelize','exports','STRING'];(function(_0xb7bb89,_0x1badeb){var _0x11f30e=function(_0x22c1ca){while(--_0x22c1ca){_0xb7bb89['push'](_0xb7bb89['shift']());}};_0x11f30e(++_0x1badeb);}(_0x3a4a,0x135));var _0xa3a4=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x3a4a[_0x15d18f];return _0xd12bf7;};'use strict';var Sequelize=require(_0xa3a4('0x0'));module[_0xa3a4('0x1')]={'name':{'type':Sequelize[_0xa3a4('0x2')]},'description':{'type':Sequelize[_0xa3a4('0x2')]}};
\ No newline at end of file
index cc90337..3b3780e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dbf=['getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','then','destroy','error','send','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','update','body','findOne','ZendeskField','getFields'];(function(_0x5c9be6,_0x5a9ecc){var _0xf6afb8=function(_0x405880){while(--_0x405880){_0x5c9be6['push'](_0x5c9be6['shift']());}};_0xf6afb8(++_0x5a9ecc);}(_0x9dbf,0x1f2));var _0xf9db=function(_0x1dfb11,_0x2f701f){_0x1dfb11=_0x1dfb11-0x0;var _0x239903=_0x9dbf[_0x1dfb11];return _0x239903;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf9db('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf9db('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf9db('0x2'));var Mustache=require(_0xf9db('0x3'));var util=require('util');var path=require(_0xf9db('0x4'));var sox=require(_0xf9db('0x5'));var csv=require(_0xf9db('0x6'));var ejs=require(_0xf9db('0x7'));var fs=require('fs');var fs_extra=require(_0xf9db('0x8'));var _=require(_0xf9db('0x9'));var squel=require(_0xf9db('0xa'));var crypto=require(_0xf9db('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf9db('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf9db('0xd'));var Papa=require(_0xf9db('0xe'));var Redis=require(_0xf9db('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf9db('0x10'));var hardwareService=require(_0xf9db('0x11'));var logger=require(_0xf9db('0x12'))(_0xf9db('0x13'));var utils=require(_0xf9db('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf9db('0x15'));var db=require(_0xf9db('0x16'))['db'];function respondWithStatusCode(_0xb922dc,_0x56b4cf){_0x56b4cf=_0x56b4cf||0xcc;return function(_0x4022f0){if(_0x4022f0){return _0xb922dc[_0xf9db('0x17')](_0x56b4cf);}return _0xb922dc[_0xf9db('0x18')](_0x56b4cf)[_0xf9db('0x19')]();};}function respondWithResult(_0x3eb835,_0x259996){_0x259996=_0x259996||0xc8;return function(_0x3858b3){if(_0x3858b3){return _0x3eb835[_0xf9db('0x18')](_0x259996)[_0xf9db('0x1a')](_0x3858b3);}};}function respondWithFilteredResult(_0x1b4ace,_0x515bd8){return function(_0x3c6df5){if(_0x3c6df5){var _0x306f66=typeof _0x515bd8[_0xf9db('0x1b')]==='undefined'&&typeof _0x515bd8[_0xf9db('0x1c')]==='undefined';var _0x29aede=_0x3c6df5[_0xf9db('0x1d')];var _0x35aaeb=_0x306f66?0x0:_0x515bd8[_0xf9db('0x1b')];var _0x333a6d=_0x306f66?_0x3c6df5[_0xf9db('0x1d')]:_0x515bd8[_0xf9db('0x1b')]+_0x515bd8[_0xf9db('0x1c')];var _0x2485a7;if(_0x333a6d>=_0x29aede){_0x333a6d=_0x29aede;_0x2485a7=0xc8;}else{_0x2485a7=0xce;}_0x1b4ace[_0xf9db('0x18')](_0x2485a7);return _0x1b4ace[_0xf9db('0x1e')](_0xf9db('0x1f'),_0x35aaeb+'-'+_0x333a6d+'/'+_0x29aede)['json'](_0x3c6df5);}return null;};}function patchUpdates(_0x3c11c0){return function(_0x50413d){try{jsonpatch['apply'](_0x50413d,_0x3c11c0,!![]);}catch(_0x1d62d2){return BPromise[_0xf9db('0x20')](_0x1d62d2);}return _0x50413d['save']();};}function saveUpdates(_0x33f454,_0x2e010b){return function(_0x5e445c){if(_0x5e445c){return _0x5e445c['update'](_0x33f454)[_0xf9db('0x21')](function(_0x3214c8){return _0x3214c8;});}return null;};}function removeEntity(_0x27f404,_0x4ed2e7){return function(_0x211806){if(_0x211806){return _0x211806[_0xf9db('0x22')]()[_0xf9db('0x21')](function(){_0x27f404[_0xf9db('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x483352,_0x3b9d8f){return function(_0x1e758f){if(!_0x1e758f){_0x483352['sendStatus'](0x194);}return _0x1e758f;};}function handleError(_0x4d5403,_0xfff709){_0xfff709=_0xfff709||0x1f4;return function(_0x418b75){logger[_0xf9db('0x23')](_0x418b75['stack']);if(_0x418b75['name']){delete _0x418b75['name'];}_0x4d5403[_0xf9db('0x18')](_0xfff709)[_0xf9db('0x24')](_0x418b75);};}exports['index']=function(_0x1b6493,_0x389fd3){var _0x46e898={},_0x5674e3={},_0x52dd23={'count':0x0,'rows':[]};var _0x1bb9da=_[_0xf9db('0x25')](db[_0xf9db('0x26')][_0xf9db('0x27')],function(_0x1ae49c){return{'name':_0x1ae49c[_0xf9db('0x28')],'type':_0x1ae49c[_0xf9db('0x29')][_0xf9db('0x2a')]};});_0x5674e3[_0xf9db('0x2b')]=_[_0xf9db('0x25')](_0x1bb9da,_0xf9db('0x2c'));_0x5674e3[_0xf9db('0x2d')]=_[_0xf9db('0x2e')](_0x1b6493['query']);_0x5674e3[_0xf9db('0x2f')]=_['intersection'](_0x5674e3['model'],_0x5674e3['query']);_0x46e898[_0xf9db('0x30')]=_['intersection'](_0x5674e3[_0xf9db('0x2b')],qs[_0xf9db('0x31')](_0x1b6493[_0xf9db('0x2d')][_0xf9db('0x31')]));_0x46e898[_0xf9db('0x30')]=_0x46e898[_0xf9db('0x30')][_0xf9db('0x32')]?_0x46e898[_0xf9db('0x30')]:_0x5674e3['model'];if(!_0x1b6493[_0xf9db('0x2d')][_0xf9db('0x33')](_0xf9db('0x34'))){_0x46e898[_0xf9db('0x1c')]=qs['limit'](_0x1b6493[_0xf9db('0x2d')]['limit']);_0x46e898['offset']=qs[_0xf9db('0x1b')](_0x1b6493[_0xf9db('0x2d')][_0xf9db('0x1b')]);}_0x46e898[_0xf9db('0x35')]=qs['sort'](_0x1b6493[_0xf9db('0x2d')][_0xf9db('0x36')]);_0x46e898[_0xf9db('0x37')]=qs[_0xf9db('0x2f')](_[_0xf9db('0x38')](_0x1b6493[_0xf9db('0x2d')],_0x5674e3['filters']),_0x1bb9da);if(_0x1b6493[_0xf9db('0x2d')]['filter']){_0x46e898['where']=_[_0xf9db('0x39')](_0x46e898['where'],{'$or':_['map'](_0x1bb9da,function(_0x53e5a3){if(_0x53e5a3[_0xf9db('0x29')]!==_0xf9db('0x3a')){var _0x5bc315={};_0x5bc315[_0x53e5a3[_0xf9db('0x2c')]]={'$like':'%'+_0x1b6493[_0xf9db('0x2d')][_0xf9db('0x3b')]+'%'};return _0x5bc315;}})});}_0x46e898=_['merge']({},_0x46e898,_0x1b6493['options']);var _0xbae336={'where':_0x46e898[_0xf9db('0x37')]};return db['ZendeskConfiguration'][_0xf9db('0x1d')](_0xbae336)['then'](function(_0x5244fe){_0x52dd23[_0xf9db('0x1d')]=_0x5244fe;if(_0x1b6493['query'][_0xf9db('0x3c')]){_0x46e898[_0xf9db('0x3d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xf9db('0x3e')](_0x46e898);})['then'](function(_0x205d29){_0x52dd23[_0xf9db('0x3f')]=_0x205d29;return _0x52dd23;})['then'](respondWithFilteredResult(_0x389fd3,_0x46e898))['catch'](handleError(_0x389fd3,null));};exports[_0xf9db('0x40')]=function(_0x48eaa9,_0x3554dd){var _0x9d3c74={'raw':![],'where':{'id':_0x48eaa9[_0xf9db('0x41')]['id']}},_0x54b755={};_0x54b755[_0xf9db('0x2b')]=_[_0xf9db('0x2e')](db['ZendeskConfiguration']['rawAttributes']);_0x54b755[_0xf9db('0x2d')]=_['keys'](_0x48eaa9[_0xf9db('0x2d')]);_0x54b755[_0xf9db('0x2f')]=_['intersection'](_0x54b755[_0xf9db('0x2b')],_0x54b755[_0xf9db('0x2d')]);_0x9d3c74[_0xf9db('0x30')]=_[_0xf9db('0x42')](_0x54b755[_0xf9db('0x2b')],qs[_0xf9db('0x31')](_0x48eaa9['query'][_0xf9db('0x31')]));_0x9d3c74[_0xf9db('0x30')]=_0x9d3c74[_0xf9db('0x30')]['length']?_0x9d3c74[_0xf9db('0x30')]:_0x54b755[_0xf9db('0x2b')];if(_0x48eaa9[_0xf9db('0x2d')][_0xf9db('0x3c')]){_0x9d3c74[_0xf9db('0x3d')]=[{'all':!![]}];}_0x9d3c74=_[_0xf9db('0x39')]({},_0x9d3c74,_0x48eaa9[_0xf9db('0x43')]);return db[_0xf9db('0x26')][_0xf9db('0x44')](_0x9d3c74)[_0xf9db('0x21')](handleEntityNotFound(_0x3554dd,null))[_0xf9db('0x21')](respondWithResult(_0x3554dd,null))[_0xf9db('0x45')](handleError(_0x3554dd,null));};exports[_0xf9db('0x46')]=function(_0x38f1fd,_0x27ada0){return db[_0xf9db('0x26')][_0xf9db('0x46')](_0x38f1fd['body'],{})[_0xf9db('0x21')](respondWithResult(_0x27ada0,0xc9))[_0xf9db('0x45')](handleError(_0x27ada0,null));};exports[_0xf9db('0x47')]=function(_0x24ab3f,_0x4afb24){if(_0x24ab3f[_0xf9db('0x48')]['id']){delete _0x24ab3f[_0xf9db('0x48')]['id'];}return db[_0xf9db('0x26')][_0xf9db('0x44')]({'where':{'id':_0x24ab3f[_0xf9db('0x41')]['id']}})[_0xf9db('0x21')](handleEntityNotFound(_0x4afb24,null))[_0xf9db('0x21')](saveUpdates(_0x24ab3f[_0xf9db('0x48')],null))['then'](respondWithResult(_0x4afb24,null))[_0xf9db('0x45')](handleError(_0x4afb24,null));};exports[_0xf9db('0x22')]=function(_0x46cc3d,_0x2cc452){return db[_0xf9db('0x26')][_0xf9db('0x44')]({'where':{'id':_0x46cc3d[_0xf9db('0x41')]['id']}})[_0xf9db('0x21')](handleEntityNotFound(_0x2cc452,null))[_0xf9db('0x21')](removeEntity(_0x2cc452,null))[_0xf9db('0x45')](handleError(_0x2cc452,null));};exports['getFields']=function(_0x4264d6,_0xc8167d,_0x400589){var _0x337d18={};var _0x4301c6={};var _0x564f75;var _0x2e2aab;return db[_0xf9db('0x26')][_0xf9db('0x49')]({'where':{'id':_0x4264d6[_0xf9db('0x41')]['id']}})[_0xf9db('0x21')](handleEntityNotFound(_0xc8167d,null))[_0xf9db('0x21')](function(_0x30894e){if(_0x30894e){_0x564f75=_0x30894e;_0x4301c6[_0xf9db('0x2b')]=_[_0xf9db('0x2e')](db[_0xf9db('0x4a')][_0xf9db('0x27')]);_0x4301c6['query']=_[_0xf9db('0x2e')](_0x4264d6[_0xf9db('0x2d')]);_0x4301c6['filters']=_[_0xf9db('0x42')](_0x4301c6[_0xf9db('0x2b')],_0x4301c6[_0xf9db('0x2d')]);_0x337d18['attributes']=_['intersection'](_0x4301c6[_0xf9db('0x2b')],qs['fields'](_0x4264d6[_0xf9db('0x2d')][_0xf9db('0x31')]));_0x337d18[_0xf9db('0x30')]=_0x337d18[_0xf9db('0x30')][_0xf9db('0x32')]?_0x337d18[_0xf9db('0x30')]:_0x4301c6[_0xf9db('0x2b')];_0x337d18[_0xf9db('0x35')]=qs[_0xf9db('0x36')](_0x4264d6['query'][_0xf9db('0x36')]);_0x337d18['where']=qs['filters'](_[_0xf9db('0x38')](_0x4264d6[_0xf9db('0x2d')],_0x4301c6['filters']));if(_0x4264d6[_0xf9db('0x2d')][_0xf9db('0x3b')]){_0x337d18[_0xf9db('0x37')]=_[_0xf9db('0x39')](_0x337d18['where'],{'$or':_[_0xf9db('0x25')](_0x337d18['attributes'],function(_0x2b8c71){var _0x21cca2={};_0x21cca2[_0x2b8c71]={'$like':'%'+_0x4264d6[_0xf9db('0x2d')]['filter']+'%'};return _0x21cca2;})});}_0x337d18=_[_0xf9db('0x39')]({},_0x337d18,_0x4264d6[_0xf9db('0x43')]);return _0x564f75[_0xf9db('0x4b')](_0x337d18);}})['then'](function(_0x108b4e){if(_0x108b4e){_0x2e2aab=_0x108b4e[_0xf9db('0x32')];if(!_0x4264d6[_0xf9db('0x2d')][_0xf9db('0x33')]('nolimit')){_0x337d18[_0xf9db('0x1c')]=qs[_0xf9db('0x1c')](_0x4264d6[_0xf9db('0x2d')][_0xf9db('0x1c')]);_0x337d18[_0xf9db('0x1b')]=qs[_0xf9db('0x1b')](_0x4264d6[_0xf9db('0x2d')][_0xf9db('0x1b')]);}return _0x564f75[_0xf9db('0x4b')](_0x337d18);}})[_0xf9db('0x21')](function(_0x15c790){if(_0x15c790){return _0x15c790?{'count':_0x2e2aab,'rows':_0x15c790}:null;}})['then'](respondWithResult(_0xc8167d,null))['catch'](handleError(_0xc8167d,null));};exports[_0xf9db('0x4c')]=function(_0x236181,_0xbc0554,_0x5108a7){var _0x4571ba={};var _0x3cdb67={};var _0xa2456a;var _0x23a2aa;return db[_0xf9db('0x26')][_0xf9db('0x49')]({'where':{'id':_0x236181[_0xf9db('0x41')]['id']}})[_0xf9db('0x21')](handleEntityNotFound(_0xbc0554,null))['then'](function(_0x45fba6){if(_0x45fba6){_0xa2456a=_0x45fba6;_0x3cdb67[_0xf9db('0x2b')]=_[_0xf9db('0x2e')](db['ZendeskField'][_0xf9db('0x27')]);_0x3cdb67['query']=_[_0xf9db('0x2e')](_0x236181[_0xf9db('0x2d')]);_0x3cdb67['filters']=_['intersection'](_0x3cdb67[_0xf9db('0x2b')],_0x3cdb67['query']);_0x4571ba[_0xf9db('0x30')]=_['intersection'](_0x3cdb67['model'],qs[_0xf9db('0x31')](_0x236181['query'][_0xf9db('0x31')]));_0x4571ba[_0xf9db('0x30')]=_0x4571ba[_0xf9db('0x30')][_0xf9db('0x32')]?_0x4571ba[_0xf9db('0x30')]:_0x3cdb67[_0xf9db('0x2b')];_0x4571ba[_0xf9db('0x35')]=qs['sort'](_0x236181[_0xf9db('0x2d')][_0xf9db('0x36')]);_0x4571ba[_0xf9db('0x37')]=qs[_0xf9db('0x2f')](_[_0xf9db('0x38')](_0x236181[_0xf9db('0x2d')],_0x3cdb67['filters']));if(_0x236181[_0xf9db('0x2d')][_0xf9db('0x3b')]){_0x4571ba[_0xf9db('0x37')]=_['merge'](_0x4571ba[_0xf9db('0x37')],{'$or':_[_0xf9db('0x25')](_0x4571ba['attributes'],function(_0x48b40e){var _0x2e227d={};_0x2e227d[_0x48b40e]={'$like':'%'+_0x236181[_0xf9db('0x2d')]['filter']+'%'};return _0x2e227d;})});}_0x4571ba=_[_0xf9db('0x39')]({},_0x4571ba,_0x236181[_0xf9db('0x43')]);return _0xa2456a[_0xf9db('0x4c')](_0x4571ba);}})[_0xf9db('0x21')](function(_0x5ba776){if(_0x5ba776){_0x23a2aa=_0x5ba776[_0xf9db('0x32')];if(!_0x236181['query'][_0xf9db('0x33')](_0xf9db('0x34'))){_0x4571ba[_0xf9db('0x1c')]=qs[_0xf9db('0x1c')](_0x236181['query'][_0xf9db('0x1c')]);_0x4571ba[_0xf9db('0x1b')]=qs[_0xf9db('0x1b')](_0x236181[_0xf9db('0x2d')][_0xf9db('0x1b')]);}return _0xa2456a[_0xf9db('0x4c')](_0x4571ba);}})[_0xf9db('0x21')](function(_0x4f6e8a){if(_0x4f6e8a){return _0x4f6e8a?{'count':_0x23a2aa,'rows':_0x4f6e8a}:null;}})[_0xf9db('0x21')](respondWithResult(_0xbc0554,null))[_0xf9db('0x45')](handleError(_0xbc0554,null));};exports[_0xf9db('0x4d')]=function(_0x147dbc,_0x1acb87,_0x32644d){var _0x583200={};var _0x5cc212={};var _0x377fa0;var _0x80f1db;return db[_0xf9db('0x26')][_0xf9db('0x49')]({'where':{'id':_0x147dbc[_0xf9db('0x41')]['id']}})[_0xf9db('0x21')](handleEntityNotFound(_0x1acb87,null))[_0xf9db('0x21')](function(_0x28c50b){if(_0x28c50b){_0x377fa0=_0x28c50b;_0x5cc212[_0xf9db('0x2b')]=_[_0xf9db('0x2e')](db[_0xf9db('0x4a')][_0xf9db('0x27')]);_0x5cc212[_0xf9db('0x2d')]=_['keys'](_0x147dbc[_0xf9db('0x2d')]);_0x5cc212['filters']=_[_0xf9db('0x42')](_0x5cc212[_0xf9db('0x2b')],_0x5cc212[_0xf9db('0x2d')]);_0x583200[_0xf9db('0x30')]=_[_0xf9db('0x42')](_0x5cc212['model'],qs['fields'](_0x147dbc[_0xf9db('0x2d')][_0xf9db('0x31')]));_0x583200[_0xf9db('0x30')]=_0x583200[_0xf9db('0x30')][_0xf9db('0x32')]?_0x583200[_0xf9db('0x30')]:_0x5cc212['model'];_0x583200[_0xf9db('0x35')]=qs[_0xf9db('0x36')](_0x147dbc['query'][_0xf9db('0x36')]);_0x583200[_0xf9db('0x37')]=qs['filters'](_[_0xf9db('0x38')](_0x147dbc['query'],_0x5cc212[_0xf9db('0x2f')]));if(_0x147dbc['query'][_0xf9db('0x3b')]){_0x583200[_0xf9db('0x37')]=_[_0xf9db('0x39')](_0x583200[_0xf9db('0x37')],{'$or':_[_0xf9db('0x25')](_0x583200['attributes'],function(_0x48a56e){var _0x4ed115={};_0x4ed115[_0x48a56e]={'$like':'%'+_0x147dbc['query'][_0xf9db('0x3b')]+'%'};return _0x4ed115;})});}_0x583200=_[_0xf9db('0x39')]({},_0x583200,_0x147dbc[_0xf9db('0x43')]);return _0x377fa0['getDescriptions'](_0x583200);}})[_0xf9db('0x21')](function(_0x34d631){if(_0x34d631){_0x80f1db=_0x34d631[_0xf9db('0x32')];if(!_0x147dbc['query'][_0xf9db('0x33')]('nolimit')){_0x583200[_0xf9db('0x1c')]=qs['limit'](_0x147dbc[_0xf9db('0x2d')]['limit']);_0x583200[_0xf9db('0x1b')]=qs[_0xf9db('0x1b')](_0x147dbc[_0xf9db('0x2d')][_0xf9db('0x1b')]);}return _0x377fa0[_0xf9db('0x4d')](_0x583200);}})[_0xf9db('0x21')](function(_0x1b7ad7){if(_0x1b7ad7){return _0x1b7ad7?{'count':_0x80f1db,'rows':_0x1b7ad7}:null;}})[_0xf9db('0x21')](respondWithResult(_0x1acb87,null))[_0xf9db('0x45')](handleError(_0x1acb87,null));};exports['getTags']=function(_0x4d21a3,_0x1f49c1,_0x1bedb5){var _0x16e5af={};var _0x366bf3={};var _0x84cdec;var _0xb70484;return db[_0xf9db('0x26')][_0xf9db('0x49')]({'where':{'id':_0x4d21a3[_0xf9db('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f49c1,null))['then'](function(_0x3b8523){if(_0x3b8523){_0x84cdec=_0x3b8523;_0x366bf3['model']=_[_0xf9db('0x2e')](db[_0xf9db('0x4e')][_0xf9db('0x27')]);_0x366bf3['query']=_[_0xf9db('0x2e')](_0x4d21a3[_0xf9db('0x2d')]);_0x366bf3[_0xf9db('0x2f')]=_[_0xf9db('0x42')](_0x366bf3[_0xf9db('0x2b')],_0x366bf3[_0xf9db('0x2d')]);_0x16e5af[_0xf9db('0x30')]=_[_0xf9db('0x42')](_0x366bf3[_0xf9db('0x2b')],qs[_0xf9db('0x31')](_0x4d21a3[_0xf9db('0x2d')][_0xf9db('0x31')]));_0x16e5af[_0xf9db('0x30')]=_0x16e5af[_0xf9db('0x30')]['length']?_0x16e5af[_0xf9db('0x30')]:_0x366bf3[_0xf9db('0x2b')];_0x16e5af[_0xf9db('0x35')]=qs[_0xf9db('0x36')](_0x4d21a3['query']['sort']);_0x16e5af[_0xf9db('0x37')]=qs[_0xf9db('0x2f')](_[_0xf9db('0x38')](_0x4d21a3[_0xf9db('0x2d')],_0x366bf3[_0xf9db('0x2f')]));if(_0x4d21a3[_0xf9db('0x2d')]['filter']){_0x16e5af[_0xf9db('0x37')]=_['merge'](_0x16e5af[_0xf9db('0x37')],{'$or':_[_0xf9db('0x25')](_0x16e5af[_0xf9db('0x30')],function(_0x553441){var _0x50ffcc={};_0x50ffcc[_0x553441]={'$like':'%'+_0x4d21a3[_0xf9db('0x2d')][_0xf9db('0x3b')]+'%'};return _0x50ffcc;})});}_0x16e5af=_[_0xf9db('0x39')]({},_0x16e5af,_0x4d21a3[_0xf9db('0x43')]);return _0x84cdec['getTags'](_0x16e5af);}})[_0xf9db('0x21')](function(_0x4c804c){if(_0x4c804c){_0xb70484=_0x4c804c[_0xf9db('0x32')];if(!_0x4d21a3[_0xf9db('0x2d')][_0xf9db('0x33')]('nolimit')){_0x16e5af['limit']=qs[_0xf9db('0x1c')](_0x4d21a3[_0xf9db('0x2d')][_0xf9db('0x1c')]);_0x16e5af[_0xf9db('0x1b')]=qs[_0xf9db('0x1b')](_0x4d21a3['query'][_0xf9db('0x1b')]);}return _0x84cdec[_0xf9db('0x4f')](_0x16e5af);}})['then'](function(_0x566cff){if(_0x566cff){return _0x566cff?{'count':_0xb70484,'rows':_0x566cff}:null;}})[_0xf9db('0x21')](respondWithResult(_0x1f49c1,null))[_0xf9db('0x45')](handleError(_0x1f49c1,null));};exports[_0xf9db('0x50')]=function(_0x2c057d,_0x5e0574,_0x372bd9){if(_0x2c057d[_0xf9db('0x48')]['id']){delete _0x2c057d[_0xf9db('0x48')]['id'];}return db[_0xf9db('0x26')][_0xf9db('0x49')]({'where':{'id':_0x2c057d[_0xf9db('0x41')]['id']}})[_0xf9db('0x21')](handleEntityNotFound(_0x5e0574,null))['then'](function(_0x541d7a){if(_0x541d7a){return _0x541d7a[_0xf9db('0x50')](_0x2c057d[_0xf9db('0x48')][_0xf9db('0x51')]||[]);}return null;})[_0xf9db('0x21')](respondWithResult(_0x5e0574,null))['catch'](handleError(_0x5e0574,null));};
\ No newline at end of file
+var _0xb6be=['length','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','send','index','map','ZendeskConfiguration','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','include','merge','options','find','create','update','body','getFields','findOne','keys','ZendeskField'];(function(_0x43e955,_0x3c48aa){var _0x471cc9=function(_0x36cc9f){while(--_0x36cc9f){_0x43e955['push'](_0x43e955['shift']());}};_0x471cc9(++_0x3c48aa);}(_0xb6be,0xbb));var _0xeb6b=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0xb6be[_0x3005d5];return _0x547c7e;};'use strict';var emlformat=require(_0xeb6b('0x0'));var rimraf=require(_0xeb6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb6b('0x2'));var rp=require(_0xeb6b('0x3'));var moment=require('moment');var BPromise=require(_0xeb6b('0x4'));var Mustache=require(_0xeb6b('0x5'));var util=require(_0xeb6b('0x6'));var path=require(_0xeb6b('0x7'));var sox=require(_0xeb6b('0x8'));var csv=require(_0xeb6b('0x9'));var ejs=require(_0xeb6b('0xa'));var fs=require('fs');var fs_extra=require(_0xeb6b('0xb'));var _=require(_0xeb6b('0xc'));var squel=require(_0xeb6b('0xd'));var crypto=require(_0xeb6b('0xe'));var jsforce=require(_0xeb6b('0xf'));var deskjs=require(_0xeb6b('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xeb6b('0x11'));var Redis=require(_0xeb6b('0x12'));var authService=require(_0xeb6b('0x13'));var qs=require(_0xeb6b('0x14'));var as=require(_0xeb6b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb6b('0x16'))(_0xeb6b('0x17'));var utils=require(_0xeb6b('0x18'));var config=require(_0xeb6b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xeb6b('0x1a'))['db'];function respondWithStatusCode(_0xbf88cf,_0x113a35){_0x113a35=_0x113a35||0xcc;return function(_0x3c9c4f){if(_0x3c9c4f){return _0xbf88cf[_0xeb6b('0x1b')](_0x113a35);}return _0xbf88cf['status'](_0x113a35)[_0xeb6b('0x1c')]();};}function respondWithResult(_0x5d8ab3,_0x181e78){_0x181e78=_0x181e78||0xc8;return function(_0x1994f5){if(_0x1994f5){return _0x5d8ab3[_0xeb6b('0x1d')](_0x181e78)['json'](_0x1994f5);}};}function respondWithFilteredResult(_0x1707b6,_0x42f395){return function(_0x46879f){if(_0x46879f){var _0x125c7c=typeof _0x42f395['offset']===_0xeb6b('0x1e')&&typeof _0x42f395[_0xeb6b('0x1f')]==='undefined';var _0x4dc015=_0x46879f[_0xeb6b('0x20')];var _0x29dcbc=_0x125c7c?0x0:_0x42f395[_0xeb6b('0x21')];var _0x466009=_0x125c7c?_0x46879f['count']:_0x42f395['offset']+_0x42f395[_0xeb6b('0x1f')];var _0x5559cc;if(_0x466009>=_0x4dc015){_0x466009=_0x4dc015;_0x5559cc=0xc8;}else{_0x5559cc=0xce;}_0x1707b6[_0xeb6b('0x1d')](_0x5559cc);return _0x1707b6[_0xeb6b('0x22')](_0xeb6b('0x23'),_0x29dcbc+'-'+_0x466009+'/'+_0x4dc015)[_0xeb6b('0x24')](_0x46879f);}return null;};}function patchUpdates(_0xa55732){return function(_0x1b5a80){try{jsonpatch[_0xeb6b('0x25')](_0x1b5a80,_0xa55732,!![]);}catch(_0x5788bd){return BPromise[_0xeb6b('0x26')](_0x5788bd);}return _0x1b5a80[_0xeb6b('0x27')]();};}function saveUpdates(_0x5c053d,_0x1f2355){return function(_0x22fc17){if(_0x22fc17){return _0x22fc17['update'](_0x5c053d)[_0xeb6b('0x28')](function(_0x1f3c75){return _0x1f3c75;});}return null;};}function removeEntity(_0x3467d9,_0x3b8a19){return function(_0x32a7fe){if(_0x32a7fe){return _0x32a7fe[_0xeb6b('0x29')]()[_0xeb6b('0x28')](function(){_0x3467d9[_0xeb6b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x435826,_0x149bea){return function(_0x572ebc){if(!_0x572ebc){_0x435826[_0xeb6b('0x1b')](0x194);}return _0x572ebc;};}function handleError(_0x4a9a80,_0x2c9f5f){_0x2c9f5f=_0x2c9f5f||0x1f4;return function(_0x42d164){logger[_0xeb6b('0x2a')](_0x42d164['stack']);if(_0x42d164['name']){delete _0x42d164['name'];}_0x4a9a80[_0xeb6b('0x1d')](_0x2c9f5f)[_0xeb6b('0x2b')](_0x42d164);};}exports[_0xeb6b('0x2c')]=function(_0x2d52f7,_0x232aa0){var _0x30895a={},_0x4fe22e={},_0x2d86dd={'count':0x0,'rows':[]};var _0x5bdbc9=_[_0xeb6b('0x2d')](db[_0xeb6b('0x2e')]['rawAttributes'],function(_0x474f90){return{'name':_0x474f90[_0xeb6b('0x2f')],'type':_0x474f90['type'][_0xeb6b('0x30')]};});_0x4fe22e[_0xeb6b('0x31')]=_[_0xeb6b('0x2d')](_0x5bdbc9,_0xeb6b('0x32'));_0x4fe22e[_0xeb6b('0x33')]=_['keys'](_0x2d52f7[_0xeb6b('0x33')]);_0x4fe22e[_0xeb6b('0x34')]=_[_0xeb6b('0x35')](_0x4fe22e[_0xeb6b('0x31')],_0x4fe22e['query']);_0x30895a[_0xeb6b('0x36')]=_[_0xeb6b('0x35')](_0x4fe22e[_0xeb6b('0x31')],qs[_0xeb6b('0x37')](_0x2d52f7[_0xeb6b('0x33')]['fields']));_0x30895a[_0xeb6b('0x36')]=_0x30895a[_0xeb6b('0x36')]['length']?_0x30895a[_0xeb6b('0x36')]:_0x4fe22e[_0xeb6b('0x31')];if(!_0x2d52f7[_0xeb6b('0x33')][_0xeb6b('0x38')](_0xeb6b('0x39'))){_0x30895a[_0xeb6b('0x1f')]=qs[_0xeb6b('0x1f')](_0x2d52f7[_0xeb6b('0x33')][_0xeb6b('0x1f')]);_0x30895a[_0xeb6b('0x21')]=qs[_0xeb6b('0x21')](_0x2d52f7[_0xeb6b('0x33')][_0xeb6b('0x21')]);}_0x30895a[_0xeb6b('0x3a')]=qs[_0xeb6b('0x3b')](_0x2d52f7[_0xeb6b('0x33')][_0xeb6b('0x3b')]);_0x30895a[_0xeb6b('0x3c')]=qs[_0xeb6b('0x34')](_[_0xeb6b('0x3d')](_0x2d52f7['query'],_0x4fe22e[_0xeb6b('0x34')]),_0x5bdbc9);if(_0x2d52f7[_0xeb6b('0x33')][_0xeb6b('0x3e')]){_0x30895a['where']=_['merge'](_0x30895a[_0xeb6b('0x3c')],{'$or':_[_0xeb6b('0x2d')](_0x5bdbc9,function(_0x33f6b5){if(_0x33f6b5[_0xeb6b('0x3f')]!==_0xeb6b('0x40')){var _0x4303ed={};_0x4303ed[_0x33f6b5['name']]={'$like':'%'+_0x2d52f7['query'][_0xeb6b('0x3e')]+'%'};return _0x4303ed;}})});}_0x30895a=_['merge']({},_0x30895a,_0x2d52f7['options']);var _0x398ae1={'where':_0x30895a[_0xeb6b('0x3c')]};return db[_0xeb6b('0x2e')][_0xeb6b('0x20')](_0x398ae1)[_0xeb6b('0x28')](function(_0x1a7705){_0x2d86dd[_0xeb6b('0x20')]=_0x1a7705;if(_0x2d52f7[_0xeb6b('0x33')][_0xeb6b('0x41')]){_0x30895a['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xeb6b('0x42')](_0x30895a);})['then'](function(_0x2a39e1){_0x2d86dd[_0xeb6b('0x43')]=_0x2a39e1;return _0x2d86dd;})[_0xeb6b('0x28')](respondWithFilteredResult(_0x232aa0,_0x30895a))[_0xeb6b('0x44')](handleError(_0x232aa0,null));};exports[_0xeb6b('0x45')]=function(_0x5a32b5,_0x23cbcf){var _0x54caea={'raw':![],'where':{'id':_0x5a32b5[_0xeb6b('0x46')]['id']}},_0x51b92a={};_0x51b92a[_0xeb6b('0x31')]=_['keys'](db[_0xeb6b('0x2e')][_0xeb6b('0x47')]);_0x51b92a[_0xeb6b('0x33')]=_['keys'](_0x5a32b5['query']);_0x51b92a['filters']=_[_0xeb6b('0x35')](_0x51b92a[_0xeb6b('0x31')],_0x51b92a[_0xeb6b('0x33')]);_0x54caea[_0xeb6b('0x36')]=_[_0xeb6b('0x35')](_0x51b92a[_0xeb6b('0x31')],qs[_0xeb6b('0x37')](_0x5a32b5[_0xeb6b('0x33')][_0xeb6b('0x37')]));_0x54caea[_0xeb6b('0x36')]=_0x54caea[_0xeb6b('0x36')]['length']?_0x54caea[_0xeb6b('0x36')]:_0x51b92a[_0xeb6b('0x31')];if(_0x5a32b5[_0xeb6b('0x33')][_0xeb6b('0x41')]){_0x54caea[_0xeb6b('0x48')]=[{'all':!![]}];}_0x54caea=_[_0xeb6b('0x49')]({},_0x54caea,_0x5a32b5[_0xeb6b('0x4a')]);return db[_0xeb6b('0x2e')][_0xeb6b('0x4b')](_0x54caea)[_0xeb6b('0x28')](handleEntityNotFound(_0x23cbcf,null))[_0xeb6b('0x28')](respondWithResult(_0x23cbcf,null))[_0xeb6b('0x44')](handleError(_0x23cbcf,null));};exports[_0xeb6b('0x4c')]=function(_0x447f5a,_0x13e678){return db[_0xeb6b('0x2e')]['create'](_0x447f5a['body'],{})[_0xeb6b('0x28')](respondWithResult(_0x13e678,0xc9))['catch'](handleError(_0x13e678,null));};exports[_0xeb6b('0x4d')]=function(_0x2fe9df,_0x2a7ef1){if(_0x2fe9df['body']['id']){delete _0x2fe9df['body']['id'];}return db[_0xeb6b('0x2e')][_0xeb6b('0x4b')]({'where':{'id':_0x2fe9df['params']['id']}})[_0xeb6b('0x28')](handleEntityNotFound(_0x2a7ef1,null))[_0xeb6b('0x28')](saveUpdates(_0x2fe9df[_0xeb6b('0x4e')],null))[_0xeb6b('0x28')](respondWithResult(_0x2a7ef1,null))['catch'](handleError(_0x2a7ef1,null));};exports[_0xeb6b('0x29')]=function(_0x279323,_0x57afdb){return db[_0xeb6b('0x2e')]['find']({'where':{'id':_0x279323[_0xeb6b('0x46')]['id']}})[_0xeb6b('0x28')](handleEntityNotFound(_0x57afdb,null))['then'](removeEntity(_0x57afdb,null))[_0xeb6b('0x44')](handleError(_0x57afdb,null));};exports[_0xeb6b('0x4f')]=function(_0x1cb89b,_0x55a5b0,_0x46f043){var _0x49f211={};var _0x11248f={};var _0x15b1ae;var _0x439d8e;return db[_0xeb6b('0x2e')][_0xeb6b('0x50')]({'where':{'id':_0x1cb89b['params']['id']}})[_0xeb6b('0x28')](handleEntityNotFound(_0x55a5b0,null))[_0xeb6b('0x28')](function(_0x188ea6){if(_0x188ea6){_0x15b1ae=_0x188ea6;_0x11248f['model']=_[_0xeb6b('0x51')](db[_0xeb6b('0x52')][_0xeb6b('0x47')]);_0x11248f[_0xeb6b('0x33')]=_['keys'](_0x1cb89b['query']);_0x11248f[_0xeb6b('0x34')]=_['intersection'](_0x11248f[_0xeb6b('0x31')],_0x11248f[_0xeb6b('0x33')]);_0x49f211[_0xeb6b('0x36')]=_['intersection'](_0x11248f[_0xeb6b('0x31')],qs['fields'](_0x1cb89b['query']['fields']));_0x49f211['attributes']=_0x49f211['attributes'][_0xeb6b('0x53')]?_0x49f211[_0xeb6b('0x36')]:_0x11248f['model'];_0x49f211[_0xeb6b('0x3a')]=qs[_0xeb6b('0x3b')](_0x1cb89b[_0xeb6b('0x33')][_0xeb6b('0x3b')]);_0x49f211[_0xeb6b('0x3c')]=qs['filters'](_[_0xeb6b('0x3d')](_0x1cb89b[_0xeb6b('0x33')],_0x11248f['filters']));if(_0x1cb89b[_0xeb6b('0x33')][_0xeb6b('0x3e')]){_0x49f211['where']=_[_0xeb6b('0x49')](_0x49f211[_0xeb6b('0x3c')],{'$or':_[_0xeb6b('0x2d')](_0x49f211[_0xeb6b('0x36')],function(_0x27bd23){var _0x143080={};_0x143080[_0x27bd23]={'$like':'%'+_0x1cb89b['query'][_0xeb6b('0x3e')]+'%'};return _0x143080;})});}_0x49f211=_[_0xeb6b('0x49')]({},_0x49f211,_0x1cb89b[_0xeb6b('0x4a')]);return _0x15b1ae[_0xeb6b('0x4f')](_0x49f211);}})[_0xeb6b('0x28')](function(_0xa52e2d){if(_0xa52e2d){_0x439d8e=_0xa52e2d['length'];if(!_0x1cb89b[_0xeb6b('0x33')][_0xeb6b('0x38')](_0xeb6b('0x39'))){_0x49f211[_0xeb6b('0x1f')]=qs[_0xeb6b('0x1f')](_0x1cb89b[_0xeb6b('0x33')][_0xeb6b('0x1f')]);_0x49f211[_0xeb6b('0x21')]=qs[_0xeb6b('0x21')](_0x1cb89b['query']['offset']);}return _0x15b1ae['getFields'](_0x49f211);}})[_0xeb6b('0x28')](function(_0x73aa5c){if(_0x73aa5c){return _0x73aa5c?{'count':_0x439d8e,'rows':_0x73aa5c}:null;}})[_0xeb6b('0x28')](respondWithResult(_0x55a5b0,null))[_0xeb6b('0x44')](handleError(_0x55a5b0,null));};exports[_0xeb6b('0x54')]=function(_0xab50e5,_0x511347,_0x62e1c2){var _0x4e0222={};var _0x3276f9={};var _0x124046;var _0x962490;return db['ZendeskConfiguration'][_0xeb6b('0x50')]({'where':{'id':_0xab50e5[_0xeb6b('0x46')]['id']}})[_0xeb6b('0x28')](handleEntityNotFound(_0x511347,null))[_0xeb6b('0x28')](function(_0x2dc8db){if(_0x2dc8db){_0x124046=_0x2dc8db;_0x3276f9[_0xeb6b('0x31')]=_['keys'](db[_0xeb6b('0x52')]['rawAttributes']);_0x3276f9[_0xeb6b('0x33')]=_[_0xeb6b('0x51')](_0xab50e5['query']);_0x3276f9[_0xeb6b('0x34')]=_[_0xeb6b('0x35')](_0x3276f9[_0xeb6b('0x31')],_0x3276f9[_0xeb6b('0x33')]);_0x4e0222[_0xeb6b('0x36')]=_[_0xeb6b('0x35')](_0x3276f9['model'],qs[_0xeb6b('0x37')](_0xab50e5[_0xeb6b('0x33')][_0xeb6b('0x37')]));_0x4e0222[_0xeb6b('0x36')]=_0x4e0222[_0xeb6b('0x36')][_0xeb6b('0x53')]?_0x4e0222[_0xeb6b('0x36')]:_0x3276f9[_0xeb6b('0x31')];_0x4e0222[_0xeb6b('0x3a')]=qs[_0xeb6b('0x3b')](_0xab50e5[_0xeb6b('0x33')][_0xeb6b('0x3b')]);_0x4e0222['where']=qs[_0xeb6b('0x34')](_[_0xeb6b('0x3d')](_0xab50e5['query'],_0x3276f9[_0xeb6b('0x34')]));if(_0xab50e5['query']['filter']){_0x4e0222[_0xeb6b('0x3c')]=_[_0xeb6b('0x49')](_0x4e0222[_0xeb6b('0x3c')],{'$or':_[_0xeb6b('0x2d')](_0x4e0222['attributes'],function(_0x5ed852){var _0x46dcba={};_0x46dcba[_0x5ed852]={'$like':'%'+_0xab50e5['query'][_0xeb6b('0x3e')]+'%'};return _0x46dcba;})});}_0x4e0222=_[_0xeb6b('0x49')]({},_0x4e0222,_0xab50e5[_0xeb6b('0x4a')]);return _0x124046[_0xeb6b('0x54')](_0x4e0222);}})[_0xeb6b('0x28')](function(_0x4b0e26){if(_0x4b0e26){_0x962490=_0x4b0e26[_0xeb6b('0x53')];if(!_0xab50e5[_0xeb6b('0x33')][_0xeb6b('0x38')](_0xeb6b('0x39'))){_0x4e0222[_0xeb6b('0x1f')]=qs['limit'](_0xab50e5[_0xeb6b('0x33')]['limit']);_0x4e0222[_0xeb6b('0x21')]=qs[_0xeb6b('0x21')](_0xab50e5[_0xeb6b('0x33')][_0xeb6b('0x21')]);}return _0x124046[_0xeb6b('0x54')](_0x4e0222);}})[_0xeb6b('0x28')](function(_0x24446b){if(_0x24446b){return _0x24446b?{'count':_0x962490,'rows':_0x24446b}:null;}})[_0xeb6b('0x28')](respondWithResult(_0x511347,null))[_0xeb6b('0x44')](handleError(_0x511347,null));};exports['getDescriptions']=function(_0x44fd94,_0x5776db,_0x1435a1){var _0x4648fe={};var _0x59aff2={};var _0xa2a46b;var _0x18d597;return db[_0xeb6b('0x2e')][_0xeb6b('0x50')]({'where':{'id':_0x44fd94['params']['id']}})['then'](handleEntityNotFound(_0x5776db,null))[_0xeb6b('0x28')](function(_0x587f29){if(_0x587f29){_0xa2a46b=_0x587f29;_0x59aff2['model']=_['keys'](db[_0xeb6b('0x52')]['rawAttributes']);_0x59aff2[_0xeb6b('0x33')]=_['keys'](_0x44fd94['query']);_0x59aff2[_0xeb6b('0x34')]=_['intersection'](_0x59aff2[_0xeb6b('0x31')],_0x59aff2[_0xeb6b('0x33')]);_0x4648fe[_0xeb6b('0x36')]=_[_0xeb6b('0x35')](_0x59aff2[_0xeb6b('0x31')],qs[_0xeb6b('0x37')](_0x44fd94[_0xeb6b('0x33')][_0xeb6b('0x37')]));_0x4648fe[_0xeb6b('0x36')]=_0x4648fe[_0xeb6b('0x36')][_0xeb6b('0x53')]?_0x4648fe['attributes']:_0x59aff2[_0xeb6b('0x31')];_0x4648fe[_0xeb6b('0x3a')]=qs[_0xeb6b('0x3b')](_0x44fd94['query'][_0xeb6b('0x3b')]);_0x4648fe[_0xeb6b('0x3c')]=qs[_0xeb6b('0x34')](_[_0xeb6b('0x3d')](_0x44fd94[_0xeb6b('0x33')],_0x59aff2[_0xeb6b('0x34')]));if(_0x44fd94[_0xeb6b('0x33')]['filter']){_0x4648fe[_0xeb6b('0x3c')]=_[_0xeb6b('0x49')](_0x4648fe[_0xeb6b('0x3c')],{'$or':_[_0xeb6b('0x2d')](_0x4648fe['attributes'],function(_0x119677){var _0x10cd8f={};_0x10cd8f[_0x119677]={'$like':'%'+_0x44fd94[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x10cd8f;})});}_0x4648fe=_[_0xeb6b('0x49')]({},_0x4648fe,_0x44fd94['options']);return _0xa2a46b[_0xeb6b('0x55')](_0x4648fe);}})[_0xeb6b('0x28')](function(_0x127d3c){if(_0x127d3c){_0x18d597=_0x127d3c[_0xeb6b('0x53')];if(!_0x44fd94[_0xeb6b('0x33')][_0xeb6b('0x38')](_0xeb6b('0x39'))){_0x4648fe['limit']=qs[_0xeb6b('0x1f')](_0x44fd94[_0xeb6b('0x33')][_0xeb6b('0x1f')]);_0x4648fe[_0xeb6b('0x21')]=qs['offset'](_0x44fd94['query'][_0xeb6b('0x21')]);}return _0xa2a46b['getDescriptions'](_0x4648fe);}})['then'](function(_0x37c55b){if(_0x37c55b){return _0x37c55b?{'count':_0x18d597,'rows':_0x37c55b}:null;}})[_0xeb6b('0x28')](respondWithResult(_0x5776db,null))[_0xeb6b('0x44')](handleError(_0x5776db,null));};exports['getTags']=function(_0x5ad9b4,_0x5f30a4,_0x3d2e7d){var _0x4fabbc={};var _0x1ae357={};var _0x11742b;var _0x1cb065;return db['ZendeskConfiguration'][_0xeb6b('0x50')]({'where':{'id':_0x5ad9b4[_0xeb6b('0x46')]['id']}})[_0xeb6b('0x28')](handleEntityNotFound(_0x5f30a4,null))[_0xeb6b('0x28')](function(_0x35ec25){if(_0x35ec25){_0x11742b=_0x35ec25;_0x1ae357[_0xeb6b('0x31')]=_[_0xeb6b('0x51')](db[_0xeb6b('0x56')][_0xeb6b('0x47')]);_0x1ae357[_0xeb6b('0x33')]=_[_0xeb6b('0x51')](_0x5ad9b4[_0xeb6b('0x33')]);_0x1ae357[_0xeb6b('0x34')]=_[_0xeb6b('0x35')](_0x1ae357[_0xeb6b('0x31')],_0x1ae357['query']);_0x4fabbc[_0xeb6b('0x36')]=_[_0xeb6b('0x35')](_0x1ae357[_0xeb6b('0x31')],qs[_0xeb6b('0x37')](_0x5ad9b4[_0xeb6b('0x33')][_0xeb6b('0x37')]));_0x4fabbc[_0xeb6b('0x36')]=_0x4fabbc[_0xeb6b('0x36')][_0xeb6b('0x53')]?_0x4fabbc['attributes']:_0x1ae357['model'];_0x4fabbc[_0xeb6b('0x3a')]=qs[_0xeb6b('0x3b')](_0x5ad9b4[_0xeb6b('0x33')][_0xeb6b('0x3b')]);_0x4fabbc['where']=qs[_0xeb6b('0x34')](_[_0xeb6b('0x3d')](_0x5ad9b4['query'],_0x1ae357[_0xeb6b('0x34')]));if(_0x5ad9b4[_0xeb6b('0x33')][_0xeb6b('0x3e')]){_0x4fabbc[_0xeb6b('0x3c')]=_[_0xeb6b('0x49')](_0x4fabbc[_0xeb6b('0x3c')],{'$or':_[_0xeb6b('0x2d')](_0x4fabbc['attributes'],function(_0x2ee2d2){var _0x15b451={};_0x15b451[_0x2ee2d2]={'$like':'%'+_0x5ad9b4[_0xeb6b('0x33')][_0xeb6b('0x3e')]+'%'};return _0x15b451;})});}_0x4fabbc=_[_0xeb6b('0x49')]({},_0x4fabbc,_0x5ad9b4[_0xeb6b('0x4a')]);return _0x11742b[_0xeb6b('0x57')](_0x4fabbc);}})['then'](function(_0x20e8fe){if(_0x20e8fe){_0x1cb065=_0x20e8fe['length'];if(!_0x5ad9b4[_0xeb6b('0x33')]['hasOwnProperty'](_0xeb6b('0x39'))){_0x4fabbc[_0xeb6b('0x1f')]=qs['limit'](_0x5ad9b4[_0xeb6b('0x33')][_0xeb6b('0x1f')]);_0x4fabbc[_0xeb6b('0x21')]=qs[_0xeb6b('0x21')](_0x5ad9b4[_0xeb6b('0x33')][_0xeb6b('0x21')]);}return _0x11742b[_0xeb6b('0x57')](_0x4fabbc);}})[_0xeb6b('0x28')](function(_0x14600e){if(_0x14600e){return _0x14600e?{'count':_0x1cb065,'rows':_0x14600e}:null;}})[_0xeb6b('0x28')](respondWithResult(_0x5f30a4,null))[_0xeb6b('0x44')](handleError(_0x5f30a4,null));};exports[_0xeb6b('0x58')]=function(_0xab86f9,_0x56c6ac,_0x4b705a){if(_0xab86f9['body']['id']){delete _0xab86f9[_0xeb6b('0x4e')]['id'];}return db[_0xeb6b('0x2e')][_0xeb6b('0x50')]({'where':{'id':_0xab86f9[_0xeb6b('0x46')]['id']}})[_0xeb6b('0x28')](handleEntityNotFound(_0x56c6ac,null))[_0xeb6b('0x28')](function(_0x5ac26c){if(_0x5ac26c){return _0x5ac26c[_0xeb6b('0x58')](_0xab86f9[_0xeb6b('0x4e')][_0xeb6b('0x59')]||[]);}return null;})[_0xeb6b('0x28')](respondWithResult(_0x56c6ac,null))[_0xeb6b('0x44')](handleError(_0x56c6ac,null));};
\ No newline at end of file
index eaec94b..3ba400e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['request-promise','path','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','../../config/logger','api','moment','bluebird'];(function(_0x2ccd5e,_0x3deb44){var _0x1a758e=function(_0x535991){while(--_0x535991){_0x2ccd5e['push'](_0x2ccd5e['shift']());}};_0x1a758e(++_0x3deb44);}(_0x34b7,0x196));var _0x734b=function(_0x784d87,_0x4f0284){_0x784d87=_0x784d87-0x0;var _0x22e453=_0x34b7[_0x784d87];return _0x22e453;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var moment=require(_0x734b('0x2'));var BPromise=require(_0x734b('0x3'));var rp=require(_0x734b('0x4'));var fs=require('fs');var path=require(_0x734b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x734b('0x6'));module[_0x734b('0x7')]=function(_0x2f3128,_0x34fd70){return _0x2f3128[_0x734b('0x8')](_0x734b('0x9'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0598=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','path','exports'];(function(_0x53e3fa,_0x50c5f2){var _0xe8584a=function(_0x1771a5){while(--_0x1771a5){_0x53e3fa['push'](_0x53e3fa['shift']());}};_0xe8584a(++_0x50c5f2);}(_0x0598,0x92));var _0x8059=function(_0x1c2bcd,_0x11b83e){_0x1c2bcd=_0x1c2bcd-0x0;var _0x1a1ceb=_0x0598[_0x1c2bcd];return _0x1a1ceb;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6234715..4a8c71c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf0a=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1cc0f8,_0x431296){var _0x1f9be1=function(_0x4d7ff4){while(--_0x4d7ff4){_0x1cc0f8['push'](_0x1cc0f8['shift']());}};_0x1f9be1(++_0x431296);}(_0xaf0a,0x128));var _0xaaf0=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xaf0a[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xaaf0('0x0'));var util=require('util');var moment=require(_0xaaf0('0x1'));var BPromise=require(_0xaaf0('0x2'));var rs=require(_0xaaf0('0x3'));var fs=require('fs');var Redis=require(_0xaaf0('0x4'));var db=require(_0xaaf0('0x5'))['db'];var utils=require(_0xaaf0('0x6'));var logger=require(_0xaaf0('0x7'))(_0xaaf0('0x8'));var config=require(_0xaaf0('0x9'));var jayson=require(_0xaaf0('0xa'));var client=jayson[_0xaaf0('0xb')][_0xaaf0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a0fc7,_0x2254f1,_0x58055c){return new BPromise(function(_0x14928d,_0x4aa455){return client[_0xaaf0('0xd')](_0x2a0fc7,_0x58055c)[_0xaaf0('0xe')](function(_0x540ba2){logger[_0xaaf0('0xf')](_0xaaf0('0x10'),_0x2254f1,_0xaaf0('0x11'));logger['debug'](_0xaaf0('0x12'),_0x2254f1,_0xaaf0('0x11'),JSON[_0xaaf0('0x13')](_0x540ba2));if(_0x540ba2[_0xaaf0('0x14')]){if(_0x540ba2[_0xaaf0('0x14')][_0xaaf0('0x15')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x2254f1,_0x540ba2[_0xaaf0('0x14')]['message']);return _0x4aa455(_0x540ba2['error']['message']);}logger[_0xaaf0('0x14')](_0xaaf0('0x10'),_0x2254f1,_0x540ba2[_0xaaf0('0x14')][_0xaaf0('0x16')]);return _0x14928d(_0x540ba2['error'][_0xaaf0('0x16')]);}else{logger['info'](_0xaaf0('0x10'),_0x2254f1,'request\x20sent');_0x14928d(_0x540ba2['result'][_0xaaf0('0x16')]);}})[_0xaaf0('0x17')](function(_0x30bdbe){logger[_0xaaf0('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2254f1,_0x30bdbe);_0x4aa455(_0x30bdbe);});});}
\ No newline at end of file
+var _0x7b9b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x413ad8,_0x302b59){var _0x16d8bb=function(_0x259d37){while(--_0x259d37){_0x413ad8['push'](_0x413ad8['shift']());}};_0x16d8bb(++_0x302b59);}(_0x7b9b,0xfa));var _0xb7b9=function(_0x310482,_0x52c7b0){_0x310482=_0x310482-0x0;var _0x38a29f=_0x7b9b[_0x310482];return _0x38a29f;};'use strict';var _=require(_0xb7b9('0x0'));var util=require('util');var moment=require(_0xb7b9('0x1'));var BPromise=require(_0xb7b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7b9('0x3'));var db=require(_0xb7b9('0x4'))['db'];var utils=require(_0xb7b9('0x5'));var logger=require(_0xb7b9('0x6'))(_0xb7b9('0x7'));var config=require('../../config/environment');var jayson=require(_0xb7b9('0x8'));var client=jayson[_0xb7b9('0x9')][_0xb7b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5693a6,_0x18b628,_0x3828cb){return new BPromise(function(_0x5edf2c,_0x149a7b){return client[_0xb7b9('0xb')](_0x5693a6,_0x3828cb)['then'](function(_0x311ac1){logger[_0xb7b9('0xc')](_0xb7b9('0xd'),_0x18b628,_0xb7b9('0xe'));logger[_0xb7b9('0xf')](_0xb7b9('0x10'),_0x18b628,_0xb7b9('0xe'),JSON[_0xb7b9('0x11')](_0x311ac1));if(_0x311ac1[_0xb7b9('0x12')]){if(_0x311ac1[_0xb7b9('0x12')][_0xb7b9('0x13')]===0x1f4){logger[_0xb7b9('0x12')](_0xb7b9('0xd'),_0x18b628,_0x311ac1[_0xb7b9('0x12')][_0xb7b9('0x14')]);return _0x149a7b(_0x311ac1[_0xb7b9('0x12')][_0xb7b9('0x14')]);}logger[_0xb7b9('0x12')](_0xb7b9('0xd'),_0x18b628,_0x311ac1['error'][_0xb7b9('0x14')]);return _0x5edf2c(_0x311ac1[_0xb7b9('0x12')]['message']);}else{logger[_0xb7b9('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x18b628,'request\x20sent');_0x5edf2c(_0x311ac1[_0xb7b9('0x15')][_0xb7b9('0x14')]);}})[_0xb7b9('0x16')](function(_0x3d504f){logger[_0xb7b9('0x12')](_0xb7b9('0xd'),_0x18b628,_0x3d504f);_0x149a7b(_0x3d504f);});});}
\ No newline at end of file
index 063409d..acdb5d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd80=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x308ff9,_0x3148cb){var _0x148225=function(_0x1c006b){while(--_0x1c006b){_0x308ff9['push'](_0x308ff9['shift']());}};_0x148225(++_0x3148cb);}(_0xbd80,0x13b));var _0x0bd8=function(_0x22cb0c,_0x80e6af){_0x22cb0c=_0x22cb0c-0x0;var _0x203ce2=_0xbd80[_0x22cb0c];return _0x203ce2;};'use strict';var multer=require(_0x0bd8('0x0'));var util=require('util');var path=require(_0x0bd8('0x1'));var timeout=require(_0x0bd8('0x2'));var express=require(_0x0bd8('0x3'));var router=express['Router']();var fs_extra=require(_0x0bd8('0x4'));var auth=require(_0x0bd8('0x5'));var interaction=require(_0x0bd8('0x6'));var config=require(_0x0bd8('0x7'));var controller=require(_0x0bd8('0x8'));router[_0x0bd8('0x9')]('/',auth[_0x0bd8('0xa')](),controller[_0x0bd8('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0bd8('0xc')]);router[_0x0bd8('0xd')]('/',auth[_0x0bd8('0xa')](),controller[_0x0bd8('0xe')]);router[_0x0bd8('0xf')](_0x0bd8('0x10'),auth[_0x0bd8('0xa')](),controller['update']);router[_0x0bd8('0x11')](_0x0bd8('0x10'),auth[_0x0bd8('0xa')](),controller[_0x0bd8('0x12')]);module[_0x0bd8('0x13')]=router;
\ No newline at end of file
+var _0xa283=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa283,0x1d8));var _0x3a28=function(_0x2adf6a,_0x132193){_0x2adf6a=_0x2adf6a-0x0;var _0x31f6b6=_0xa283[_0x2adf6a];return _0x31f6b6;};'use strict';var multer=require(_0x3a28('0x0'));var util=require(_0x3a28('0x1'));var path=require(_0x3a28('0x2'));var timeout=require(_0x3a28('0x3'));var express=require('express');var router=express[_0x3a28('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a28('0x5'));var interaction=require(_0x3a28('0x6'));var config=require(_0x3a28('0x7'));var controller=require(_0x3a28('0x8'));router[_0x3a28('0x9')]('/',auth[_0x3a28('0xa')](),controller[_0x3a28('0xb')]);router['get'](_0x3a28('0xc'),auth['isAuthenticated'](),controller[_0x3a28('0xd')]);router[_0x3a28('0xe')]('/',auth['isAuthenticated'](),controller[_0x3a28('0xf')]);router['put'](_0x3a28('0xc'),auth[_0x3a28('0xa')](),controller['update']);router[_0x3a28('0x10')](_0x3a28('0xc'),auth[_0x3a28('0xa')](),controller[_0x3a28('0x11')]);module[_0x3a28('0x12')]=router;
\ No newline at end of file
index 5341e91..ce1812a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd256=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x5a5681,_0x5427ac){var _0x4a563b=function(_0x2edda1){while(--_0x2edda1){_0x5a5681['push'](_0x5a5681['shift']());}};_0x4a563b(++_0x5427ac);}(_0xd256,0x134));var _0x6d25=function(_0x34c5a3,_0x5e5b13){_0x34c5a3=_0x34c5a3-0x0;var _0x1a3adf=_0xd256[_0x34c5a3];return _0x1a3adf;};'use strict';var Sequelize=require(_0x6d25('0x0'));module[_0x6d25('0x1')]={'type':{'type':Sequelize[_0x6d25('0x2')](_0x6d25('0x3'),_0x6d25('0x4'),_0x6d25('0x5'),'keyValue',_0x6d25('0x6')),'defaultValue':_0x6d25('0x3')},'content':{'type':Sequelize[_0x6d25('0x7')]},'key':{'type':Sequelize[_0x6d25('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x6d25('0x4'),_0x6d25('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6d25('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6d25('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d25('0x7')]}};
\ No newline at end of file
+var _0x9756=['picklist','string','variable','STRING','exports','customVariable','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9756,0x162));var _0x6975=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x9756[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require('sequelize');module[_0x6975('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x6975('0x1'),_0x6975('0x2'),_0x6975('0x3')),'defaultValue':_0x6975('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x6975('0x5'),_0x6975('0x1'))},'keyContent':{'type':Sequelize[_0x6975('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x6975('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6975('0x6')]}};
\ No newline at end of file
index c092e75..56fa61a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2504=['attributes','fields','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','ZendeskField','includeAll','findAll','rows','include','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','type','key','keys','query','intersection','model'];(function(_0x309ffc,_0x276601){var _0x189b16=function(_0x237722){while(--_0x237722){_0x309ffc['push'](_0x309ffc['shift']());}};_0x189b16(++_0x276601);}(_0x2504,0xee));var _0x4250=function(_0x27f780,_0x3fffb3){_0x27f780=_0x27f780-0x0;var _0x110b67=_0x2504[_0x27f780];return _0x110b67;};'use strict';var emlformat=require(_0x4250('0x0'));var rimraf=require(_0x4250('0x1'));var zipdir=require(_0x4250('0x2'));var jsonpatch=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var moment=require(_0x4250('0x5'));var BPromise=require(_0x4250('0x6'));var Mustache=require(_0x4250('0x7'));var util=require(_0x4250('0x8'));var path=require(_0x4250('0x9'));var sox=require(_0x4250('0xa'));var csv=require(_0x4250('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0xb'));var querystring=require(_0x4250('0x10'));var Papa=require('papaparse');var Redis=require(_0x4250('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x12'));var as=require(_0x4250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x15'));var licenseUtil=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x3c1e7e,_0x2a496b){_0x2a496b=_0x2a496b||0xcc;return function(_0x5d62a0){if(_0x5d62a0){return _0x3c1e7e[_0x4250('0x18')](_0x2a496b);}return _0x3c1e7e[_0x4250('0x19')](_0x2a496b)[_0x4250('0x1a')]();};}function respondWithResult(_0x2c8a75,_0xfa4d8a){_0xfa4d8a=_0xfa4d8a||0xc8;return function(_0x33f317){if(_0x33f317){return _0x2c8a75['status'](_0xfa4d8a)[_0x4250('0x1b')](_0x33f317);}};}function respondWithFilteredResult(_0x46ba15,_0x1b0c66){return function(_0x3cff02){if(_0x3cff02){var _0x2979cd=typeof _0x1b0c66[_0x4250('0x1c')]===_0x4250('0x1d')&&typeof _0x1b0c66['limit']===_0x4250('0x1d');var _0x35d232=_0x3cff02[_0x4250('0x1e')];var _0x17a8a9=_0x2979cd?0x0:_0x1b0c66[_0x4250('0x1c')];var _0x30e48c=_0x2979cd?_0x3cff02[_0x4250('0x1e')]:_0x1b0c66['offset']+_0x1b0c66[_0x4250('0x1f')];var _0x4f0154;if(_0x30e48c>=_0x35d232){_0x30e48c=_0x35d232;_0x4f0154=0xc8;}else{_0x4f0154=0xce;}_0x46ba15['status'](_0x4f0154);return _0x46ba15[_0x4250('0x20')](_0x4250('0x21'),_0x17a8a9+'-'+_0x30e48c+'/'+_0x35d232)[_0x4250('0x1b')](_0x3cff02);}return null;};}function patchUpdates(_0x42c331){return function(_0x242cf1){try{jsonpatch[_0x4250('0x22')](_0x242cf1,_0x42c331,!![]);}catch(_0x1ba772){return BPromise[_0x4250('0x23')](_0x1ba772);}return _0x242cf1[_0x4250('0x24')]();};}function saveUpdates(_0x3818c0,_0x728862){return function(_0x30e2ae){if(_0x30e2ae){return _0x30e2ae['update'](_0x3818c0)[_0x4250('0x25')](function(_0x171df4){return _0x171df4;});}return null;};}function removeEntity(_0x1feb98,_0x523053){return function(_0x5d1a74){if(_0x5d1a74){return _0x5d1a74[_0x4250('0x26')]()[_0x4250('0x25')](function(){_0x1feb98[_0x4250('0x19')](0xcc)[_0x4250('0x1a')]();});}};}function handleEntityNotFound(_0x328ffb,_0x5cb4fe){return function(_0x431d01){if(!_0x431d01){_0x328ffb[_0x4250('0x18')](0x194);}return _0x431d01;};}function handleError(_0x3f40dd,_0x559d06){_0x559d06=_0x559d06||0x1f4;return function(_0x5b155e){logger[_0x4250('0x27')](_0x5b155e['stack']);if(_0x5b155e[_0x4250('0x28')]){delete _0x5b155e[_0x4250('0x28')];}_0x3f40dd[_0x4250('0x19')](_0x559d06)[_0x4250('0x29')](_0x5b155e);};}exports[_0x4250('0x2a')]=function(_0x501c5f,_0x395926){var _0x11ca22={},_0x48252b={},_0x2e1c91={'count':0x0,'rows':[]};var _0x5654f5=_[_0x4250('0x2b')](db['ZendeskField']['rawAttributes'],function(_0xea7ccc){return{'name':_0xea7ccc['fieldName'],'type':_0xea7ccc[_0x4250('0x2c')][_0x4250('0x2d')]};});_0x48252b['model']=_[_0x4250('0x2b')](_0x5654f5,_0x4250('0x28'));_0x48252b['query']=_[_0x4250('0x2e')](_0x501c5f[_0x4250('0x2f')]);_0x48252b['filters']=_[_0x4250('0x30')](_0x48252b[_0x4250('0x31')],_0x48252b[_0x4250('0x2f')]);_0x11ca22[_0x4250('0x32')]=_[_0x4250('0x30')](_0x48252b[_0x4250('0x31')],qs[_0x4250('0x33')](_0x501c5f[_0x4250('0x2f')][_0x4250('0x33')]));_0x11ca22[_0x4250('0x32')]=_0x11ca22[_0x4250('0x32')][_0x4250('0x34')]?_0x11ca22[_0x4250('0x32')]:_0x48252b['model'];if(!_0x501c5f[_0x4250('0x2f')]['hasOwnProperty'](_0x4250('0x35'))){_0x11ca22[_0x4250('0x1f')]=qs['limit'](_0x501c5f[_0x4250('0x2f')][_0x4250('0x1f')]);_0x11ca22[_0x4250('0x1c')]=qs[_0x4250('0x1c')](_0x501c5f['query']['offset']);}_0x11ca22['order']=qs[_0x4250('0x36')](_0x501c5f[_0x4250('0x2f')]['sort']);_0x11ca22[_0x4250('0x37')]=qs[_0x4250('0x38')](_[_0x4250('0x39')](_0x501c5f[_0x4250('0x2f')],_0x48252b[_0x4250('0x38')]),_0x5654f5);if(_0x501c5f['query'][_0x4250('0x3a')]){_0x11ca22['where']=_['merge'](_0x11ca22[_0x4250('0x37')],{'$or':_['map'](_0x5654f5,function(_0xfddc4c){if(_0xfddc4c[_0x4250('0x2c')]!==_0x4250('0x3b')){var _0x571ca7={};_0x571ca7[_0xfddc4c[_0x4250('0x28')]]={'$like':'%'+_0x501c5f[_0x4250('0x2f')][_0x4250('0x3a')]+'%'};return _0x571ca7;}})});}_0x11ca22=_[_0x4250('0x3c')]({},_0x11ca22,_0x501c5f[_0x4250('0x3d')]);var _0x4c98f0={'where':_0x11ca22[_0x4250('0x37')]};return db[_0x4250('0x3e')][_0x4250('0x1e')](_0x4c98f0)[_0x4250('0x25')](function(_0x37df2a){_0x2e1c91[_0x4250('0x1e')]=_0x37df2a;if(_0x501c5f['query'][_0x4250('0x3f')]){_0x11ca22['include']=[{'all':!![]}];}return db[_0x4250('0x3e')][_0x4250('0x40')](_0x11ca22);})[_0x4250('0x25')](function(_0x2a10b9){_0x2e1c91[_0x4250('0x41')]=_0x2a10b9;return _0x2e1c91;})[_0x4250('0x25')](respondWithFilteredResult(_0x395926,_0x11ca22))['catch'](handleError(_0x395926,null));};exports['show']=function(_0x491849,_0x440f8c){var _0x2549c1={'raw':!![],'where':{'id':_0x491849['params']['id']}},_0x2e4a22={};_0x2e4a22[_0x4250('0x31')]=_[_0x4250('0x2e')](db[_0x4250('0x3e')]['rawAttributes']);_0x2e4a22[_0x4250('0x2f')]=_[_0x4250('0x2e')](_0x491849[_0x4250('0x2f')]);_0x2e4a22[_0x4250('0x38')]=_['intersection'](_0x2e4a22['model'],_0x2e4a22[_0x4250('0x2f')]);_0x2549c1[_0x4250('0x32')]=_[_0x4250('0x30')](_0x2e4a22[_0x4250('0x31')],qs[_0x4250('0x33')](_0x491849['query'][_0x4250('0x33')]));_0x2549c1['attributes']=_0x2549c1[_0x4250('0x32')][_0x4250('0x34')]?_0x2549c1[_0x4250('0x32')]:_0x2e4a22['model'];if(_0x491849[_0x4250('0x2f')][_0x4250('0x3f')]){_0x2549c1[_0x4250('0x42')]=[{'all':!![]}];}_0x2549c1=_['merge']({},_0x2549c1,_0x491849['options']);return db['ZendeskField'][_0x4250('0x43')](_0x2549c1)[_0x4250('0x25')](handleEntityNotFound(_0x440f8c,null))[_0x4250('0x25')](respondWithResult(_0x440f8c,null))[_0x4250('0x44')](handleError(_0x440f8c,null));};exports[_0x4250('0x45')]=function(_0x20e45c,_0x47b5aa){return db[_0x4250('0x3e')][_0x4250('0x45')](_0x20e45c[_0x4250('0x46')],{})['then'](respondWithResult(_0x47b5aa,0xc9))[_0x4250('0x44')](handleError(_0x47b5aa,null));};exports['update']=function(_0x5895ea,_0x2e0d9d){if(_0x5895ea[_0x4250('0x46')]['id']){delete _0x5895ea[_0x4250('0x46')]['id'];}return db[_0x4250('0x3e')][_0x4250('0x43')]({'where':{'id':_0x5895ea[_0x4250('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e0d9d,null))[_0x4250('0x25')](saveUpdates(_0x5895ea['body'],null))[_0x4250('0x25')](respondWithResult(_0x2e0d9d,null))[_0x4250('0x44')](handleError(_0x2e0d9d,null));};exports[_0x4250('0x26')]=function(_0x544048,_0x3bc2b0){return db[_0x4250('0x3e')]['find']({'where':{'id':_0x544048['params']['id']}})['then'](handleEntityNotFound(_0x3bc2b0,null))[_0x4250('0x25')](removeEntity(_0x3bc2b0,null))['catch'](handleError(_0x3bc2b0,null));};
\ No newline at end of file
+var _0x6c29=['where','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','merge','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','then','destroy','stack','name','send','index','map','ZendeskField','type','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0x6c29,0x1c1));var _0x96c2=function(_0x1c5142,_0x30ea72){_0x1c5142=_0x1c5142-0x0;var _0x1268cb=_0x6c29[_0x1c5142];return _0x1268cb;};'use strict';var emlformat=require(_0x96c2('0x0'));var rimraf=require(_0x96c2('0x1'));var zipdir=require(_0x96c2('0x2'));var jsonpatch=require(_0x96c2('0x3'));var rp=require(_0x96c2('0x4'));var moment=require(_0x96c2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96c2('0x6'));var path=require(_0x96c2('0x7'));var sox=require('sox');var csv=require(_0x96c2('0x8'));var ejs=require(_0x96c2('0x9'));var fs=require('fs');var fs_extra=require(_0x96c2('0xa'));var _=require(_0x96c2('0xb'));var squel=require(_0x96c2('0xc'));var crypto=require(_0x96c2('0xd'));var jsforce=require(_0x96c2('0xe'));var deskjs=require(_0x96c2('0xf'));var toCsv=require(_0x96c2('0x8'));var querystring=require(_0x96c2('0x10'));var Papa=require('papaparse');var Redis=require(_0x96c2('0x11'));var authService=require(_0x96c2('0x12'));var qs=require(_0x96c2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x96c2('0x14'))(_0x96c2('0x15'));var utils=require(_0x96c2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x96c2('0x17'));var db=require(_0x96c2('0x18'))['db'];function respondWithStatusCode(_0x110a0d,_0x605573){_0x605573=_0x605573||0xcc;return function(_0xa933c3){if(_0xa933c3){return _0x110a0d[_0x96c2('0x19')](_0x605573);}return _0x110a0d[_0x96c2('0x1a')](_0x605573)[_0x96c2('0x1b')]();};}function respondWithResult(_0x160433,_0x38f87e){_0x38f87e=_0x38f87e||0xc8;return function(_0x560947){if(_0x560947){return _0x160433[_0x96c2('0x1a')](_0x38f87e)['json'](_0x560947);}};}function respondWithFilteredResult(_0x4c7447,_0x420400){return function(_0x4bd8f9){if(_0x4bd8f9){var _0x3abc3c=typeof _0x420400[_0x96c2('0x1c')]==='undefined'&&typeof _0x420400[_0x96c2('0x1d')]===_0x96c2('0x1e');var _0x22e7ae=_0x4bd8f9[_0x96c2('0x1f')];var _0x3d38e3=_0x3abc3c?0x0:_0x420400['offset'];var _0x11da3c=_0x3abc3c?_0x4bd8f9[_0x96c2('0x1f')]:_0x420400[_0x96c2('0x1c')]+_0x420400[_0x96c2('0x1d')];var _0x4e1f88;if(_0x11da3c>=_0x22e7ae){_0x11da3c=_0x22e7ae;_0x4e1f88=0xc8;}else{_0x4e1f88=0xce;}_0x4c7447[_0x96c2('0x1a')](_0x4e1f88);return _0x4c7447['set']('Content-Range',_0x3d38e3+'-'+_0x11da3c+'/'+_0x22e7ae)[_0x96c2('0x20')](_0x4bd8f9);}return null;};}function patchUpdates(_0x5118a2){return function(_0x316b48){try{jsonpatch[_0x96c2('0x21')](_0x316b48,_0x5118a2,!![]);}catch(_0x3bd942){return BPromise[_0x96c2('0x22')](_0x3bd942);}return _0x316b48['save']();};}function saveUpdates(_0x2b490,_0x4e635c){return function(_0x266d80){if(_0x266d80){return _0x266d80['update'](_0x2b490)[_0x96c2('0x23')](function(_0x2fd538){return _0x2fd538;});}return null;};}function removeEntity(_0xd382d8,_0x100e7a){return function(_0x24c902){if(_0x24c902){return _0x24c902[_0x96c2('0x24')]()['then'](function(){_0xd382d8[_0x96c2('0x1a')](0xcc)[_0x96c2('0x1b')]();});}};}function handleEntityNotFound(_0x409359,_0x1d869d){return function(_0x39ab1a){if(!_0x39ab1a){_0x409359[_0x96c2('0x19')](0x194);}return _0x39ab1a;};}function handleError(_0x3de2a2,_0x1fd133){_0x1fd133=_0x1fd133||0x1f4;return function(_0x454b05){logger['error'](_0x454b05[_0x96c2('0x25')]);if(_0x454b05[_0x96c2('0x26')]){delete _0x454b05[_0x96c2('0x26')];}_0x3de2a2['status'](_0x1fd133)[_0x96c2('0x27')](_0x454b05);};}exports[_0x96c2('0x28')]=function(_0x2f2632,_0x5750b6){var _0x3a81de={},_0x27af38={},_0x53e30e={'count':0x0,'rows':[]};var _0x2865c7=_[_0x96c2('0x29')](db[_0x96c2('0x2a')]['rawAttributes'],function(_0x1f7627){return{'name':_0x1f7627['fieldName'],'type':_0x1f7627[_0x96c2('0x2b')]['key']};});_0x27af38['model']=_[_0x96c2('0x29')](_0x2865c7,_0x96c2('0x26'));_0x27af38[_0x96c2('0x2c')]=_['keys'](_0x2f2632[_0x96c2('0x2c')]);_0x27af38[_0x96c2('0x2d')]=_[_0x96c2('0x2e')](_0x27af38[_0x96c2('0x2f')],_0x27af38[_0x96c2('0x2c')]);_0x3a81de['attributes']=_[_0x96c2('0x2e')](_0x27af38[_0x96c2('0x2f')],qs[_0x96c2('0x30')](_0x2f2632[_0x96c2('0x2c')]['fields']));_0x3a81de[_0x96c2('0x31')]=_0x3a81de[_0x96c2('0x31')][_0x96c2('0x32')]?_0x3a81de[_0x96c2('0x31')]:_0x27af38['model'];if(!_0x2f2632[_0x96c2('0x2c')]['hasOwnProperty'](_0x96c2('0x33'))){_0x3a81de[_0x96c2('0x1d')]=qs[_0x96c2('0x1d')](_0x2f2632[_0x96c2('0x2c')]['limit']);_0x3a81de[_0x96c2('0x1c')]=qs[_0x96c2('0x1c')](_0x2f2632['query'][_0x96c2('0x1c')]);}_0x3a81de[_0x96c2('0x34')]=qs[_0x96c2('0x35')](_0x2f2632[_0x96c2('0x2c')][_0x96c2('0x35')]);_0x3a81de['where']=qs[_0x96c2('0x2d')](_[_0x96c2('0x36')](_0x2f2632[_0x96c2('0x2c')],_0x27af38[_0x96c2('0x2d')]),_0x2865c7);if(_0x2f2632[_0x96c2('0x2c')]['filter']){_0x3a81de[_0x96c2('0x37')]=_['merge'](_0x3a81de[_0x96c2('0x37')],{'$or':_[_0x96c2('0x29')](_0x2865c7,function(_0x20e5ef){if(_0x20e5ef['type']!=='VIRTUAL'){var _0xc80893={};_0xc80893[_0x20e5ef[_0x96c2('0x26')]]={'$like':'%'+_0x2f2632['query'][_0x96c2('0x38')]+'%'};return _0xc80893;}})});}_0x3a81de=_['merge']({},_0x3a81de,_0x2f2632[_0x96c2('0x39')]);var _0x32279b={'where':_0x3a81de[_0x96c2('0x37')]};return db[_0x96c2('0x2a')][_0x96c2('0x1f')](_0x32279b)['then'](function(_0x4d198c){_0x53e30e[_0x96c2('0x1f')]=_0x4d198c;if(_0x2f2632[_0x96c2('0x2c')][_0x96c2('0x3a')]){_0x3a81de['include']=[{'all':!![]}];}return db[_0x96c2('0x2a')][_0x96c2('0x3b')](_0x3a81de);})['then'](function(_0x27fb44){_0x53e30e[_0x96c2('0x3c')]=_0x27fb44;return _0x53e30e;})['then'](respondWithFilteredResult(_0x5750b6,_0x3a81de))[_0x96c2('0x3d')](handleError(_0x5750b6,null));};exports[_0x96c2('0x3e')]=function(_0x1850d2,_0x54f7d0){var _0x13765c={'raw':!![],'where':{'id':_0x1850d2[_0x96c2('0x3f')]['id']}},_0x5da876={};_0x5da876[_0x96c2('0x2f')]=_[_0x96c2('0x40')](db['ZendeskField'][_0x96c2('0x41')]);_0x5da876[_0x96c2('0x2c')]=_['keys'](_0x1850d2[_0x96c2('0x2c')]);_0x5da876[_0x96c2('0x2d')]=_[_0x96c2('0x2e')](_0x5da876[_0x96c2('0x2f')],_0x5da876['query']);_0x13765c[_0x96c2('0x31')]=_[_0x96c2('0x2e')](_0x5da876[_0x96c2('0x2f')],qs['fields'](_0x1850d2[_0x96c2('0x2c')][_0x96c2('0x30')]));_0x13765c[_0x96c2('0x31')]=_0x13765c[_0x96c2('0x31')]['length']?_0x13765c[_0x96c2('0x31')]:_0x5da876[_0x96c2('0x2f')];if(_0x1850d2[_0x96c2('0x2c')][_0x96c2('0x3a')]){_0x13765c[_0x96c2('0x42')]=[{'all':!![]}];}_0x13765c=_[_0x96c2('0x43')]({},_0x13765c,_0x1850d2[_0x96c2('0x39')]);return db[_0x96c2('0x2a')][_0x96c2('0x44')](_0x13765c)[_0x96c2('0x23')](handleEntityNotFound(_0x54f7d0,null))[_0x96c2('0x23')](respondWithResult(_0x54f7d0,null))[_0x96c2('0x3d')](handleError(_0x54f7d0,null));};exports[_0x96c2('0x45')]=function(_0x3f6198,_0x1f994e){return db[_0x96c2('0x2a')][_0x96c2('0x45')](_0x3f6198[_0x96c2('0x46')],{})[_0x96c2('0x23')](respondWithResult(_0x1f994e,0xc9))[_0x96c2('0x3d')](handleError(_0x1f994e,null));};exports[_0x96c2('0x47')]=function(_0x4b5e77,_0x319a79){if(_0x4b5e77[_0x96c2('0x46')]['id']){delete _0x4b5e77[_0x96c2('0x46')]['id'];}return db[_0x96c2('0x2a')][_0x96c2('0x44')]({'where':{'id':_0x4b5e77[_0x96c2('0x3f')]['id']}})[_0x96c2('0x23')](handleEntityNotFound(_0x319a79,null))[_0x96c2('0x23')](saveUpdates(_0x4b5e77[_0x96c2('0x46')],null))[_0x96c2('0x23')](respondWithResult(_0x319a79,null))[_0x96c2('0x3d')](handleError(_0x319a79,null));};exports[_0x96c2('0x24')]=function(_0x124bf1,_0x27ff5c){return db[_0x96c2('0x2a')]['find']({'where':{'id':_0x124bf1[_0x96c2('0x3f')]['id']}})[_0x96c2('0x23')](handleEntityNotFound(_0x27ff5c,null))[_0x96c2('0x23')](removeEntity(_0x27ff5c,null))[_0x96c2('0x3d')](handleError(_0x27ff5c,null));};
\ No newline at end of file
index 86ef183..d4c6a43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5152=['api','bluebird','request-promise','path','rimraf','./intZendeskField.attributes','define','ZendeskField','zendesk_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5152,0x19d));var _0x2515=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0x5152[_0xb24fad];return _0x173226;};'use strict';var _=require(_0x2515('0x0'));var util=require(_0x2515('0x1'));var logger=require(_0x2515('0x2'))(_0x2515('0x3'));var moment=require('moment');var BPromise=require(_0x2515('0x4'));var rp=require(_0x2515('0x5'));var fs=require('fs');var path=require(_0x2515('0x6'));var rimraf=require(_0x2515('0x7'));var config=require('../../config/environment');var attributes=require(_0x2515('0x8'));module['exports']=function(_0xfe8df3,_0x171467){return _0xfe8df3[_0x2515('0x9')](_0x2515('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x2515('0xb'),'fields':['idField',_0x2515('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x76f3=['../../config/environment','./intZendeskField.attributes','exports','int_zendesk_fields','zendesk_unique_index','idField','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x500717,_0x3f23fa){var _0x52ffa1=function(_0x15943b){while(--_0x15943b){_0x500717['push'](_0x500717['shift']());}};_0x52ffa1(++_0x3f23fa);}(_0x76f3,0x8a));var _0x376f=function(_0x580072,_0x5012ae){_0x580072=_0x580072-0x0;var _0x1e6cec=_0x76f3[_0x580072];return _0x1e6cec;};'use strict';var _=require(_0x376f('0x0'));var util=require('util');var logger=require(_0x376f('0x1'))('api');var moment=require(_0x376f('0x2'));var BPromise=require('bluebird');var rp=require(_0x376f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x376f('0x4'));var config=require(_0x376f('0x5'));var attributes=require(_0x376f('0x6'));module[_0x376f('0x7')]=function(_0x2a05c2,_0x9989e8){return _0x2a05c2['define']('ZendeskField',attributes,{'tableName':_0x376f('0x8'),'paranoid':![],'indexes':[{'name':_0x376f('0x9'),'fields':[_0x376f('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index e071ed2..576e80b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47f9=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','moment','bluebird','randomstring'];(function(_0x169996,_0x4b59b5){var _0x28d7e6=function(_0x5e3acd){while(--_0x5e3acd){_0x169996['push'](_0x169996['shift']());}};_0x28d7e6(++_0x4b59b5);}(_0x47f9,0xa4));var _0x947f=function(_0x3aac12,_0x5ce4a3){_0x3aac12=_0x3aac12-0x0;var _0x283857=_0x47f9[_0x3aac12];return _0x283857;};'use strict';var _=require(_0x947f('0x0'));var util=require('util');var moment=require(_0x947f('0x1'));var BPromise=require(_0x947f('0x2'));var rs=require(_0x947f('0x3'));var fs=require('fs');var Redis=require(_0x947f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x947f('0x5'));var logger=require(_0x947f('0x6'))(_0x947f('0x7'));var config=require(_0x947f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x947f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34065b,_0x4db3b3,_0x4499ff){return new BPromise(function(_0x26d708,_0x5566b8){return client[_0x947f('0xa')](_0x34065b,_0x4499ff)[_0x947f('0xb')](function(_0x5ac6a7){logger[_0x947f('0xc')](_0x947f('0xd'),_0x4db3b3,'request\x20sent');logger['debug'](_0x947f('0xe'),_0x4db3b3,'request\x20sent',JSON[_0x947f('0xf')](_0x5ac6a7));if(_0x5ac6a7['error']){if(_0x5ac6a7[_0x947f('0x10')][_0x947f('0x11')]===0x1f4){logger['error'](_0x947f('0xd'),_0x4db3b3,_0x5ac6a7[_0x947f('0x10')][_0x947f('0x12')]);return _0x5566b8(_0x5ac6a7[_0x947f('0x10')]['message']);}logger[_0x947f('0x10')](_0x947f('0xd'),_0x4db3b3,_0x5ac6a7[_0x947f('0x10')]['message']);return _0x26d708(_0x5ac6a7['error'][_0x947f('0x12')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x4db3b3,_0x947f('0x13'));_0x26d708(_0x5ac6a7['result'][_0x947f('0x12')]);}})[_0x947f('0x14')](function(_0x5330d1){logger[_0x947f('0x10')](_0x947f('0xd'),_0x4db3b3,_0x5330d1);_0x5566b8(_0x5330d1);});});}
\ No newline at end of file
+var _0x028e=['message','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s'];(function(_0x211119,_0x36b3a8){var _0x3f8326=function(_0x33ef41){while(--_0x33ef41){_0x211119['push'](_0x211119['shift']());}};_0x3f8326(++_0x36b3a8);}(_0x028e,0x1b9));var _0xe028=function(_0x17e6ab,_0x27519b){_0x17e6ab=_0x17e6ab-0x0;var _0x3b1aa7=_0x028e[_0x17e6ab];return _0x3b1aa7;};'use strict';var _=require('lodash');var util=require(_0xe028('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe028('0x1'));var fs=require('fs');var Redis=require(_0xe028('0x2'));var db=require(_0xe028('0x3'))['db'];var utils=require(_0xe028('0x4'));var logger=require(_0xe028('0x5'))(_0xe028('0x6'));var config=require('../../config/environment');var jayson=require(_0xe028('0x7'));var client=jayson[_0xe028('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b0e94,_0x1e9dad,_0x25e7c3){return new BPromise(function(_0x53fb6b,_0x169c27){return client[_0xe028('0x9')](_0x2b0e94,_0x25e7c3)[_0xe028('0xa')](function(_0x580889){logger[_0xe028('0xb')]('ZendeskField,\x20%s,\x20%s',_0x1e9dad,'request\x20sent');logger[_0xe028('0xc')](_0xe028('0xd'),_0x1e9dad,_0xe028('0xe'),JSON[_0xe028('0xf')](_0x580889));if(_0x580889[_0xe028('0x10')]){if(_0x580889[_0xe028('0x10')][_0xe028('0x11')]===0x1f4){logger[_0xe028('0x10')](_0xe028('0x12'),_0x1e9dad,_0x580889[_0xe028('0x10')][_0xe028('0x13')]);return _0x169c27(_0x580889['error'][_0xe028('0x13')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x1e9dad,_0x580889[_0xe028('0x10')][_0xe028('0x13')]);return _0x53fb6b(_0x580889[_0xe028('0x10')][_0xe028('0x13')]);}else{logger['info'](_0xe028('0x12'),_0x1e9dad,_0xe028('0xe'));_0x53fb6b(_0x580889['result'][_0xe028('0x13')]);}})['catch'](function(_0x55f084){logger[_0xe028('0x10')](_0xe028('0x12'),_0x1e9dad,_0x55f084);_0x169c27(_0x55f084);});});}
\ No newline at end of file
index af398ca..9a81a99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfbf=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x557453,_0x5d573a){var _0x2036dd=function(_0x3e28a0){while(--_0x3e28a0){_0x557453['push'](_0x557453['shift']());}};_0x2036dd(++_0x5d573a);}(_0xcfbf,0x1f1));var _0xfcfb=function(_0x4525e2,_0x474884){_0x4525e2=_0x4525e2-0x0;var _0x566cbb=_0xcfbf[_0x4525e2];return _0x566cbb;};'use strict';var multer=require('multer');var util=require(_0xfcfb('0x0'));var path=require(_0xfcfb('0x1'));var timeout=require(_0xfcfb('0x2'));var express=require(_0xfcfb('0x3'));var router=express[_0xfcfb('0x4')]();var fs_extra=require(_0xfcfb('0x5'));var auth=require(_0xfcfb('0x6'));var interaction=require(_0xfcfb('0x7'));var config=require('../../config/environment');var controller=require(_0xfcfb('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xfcfb('0x9')]);router[_0xfcfb('0xa')](_0xfcfb('0xb'),auth['isAuthenticated'](),controller[_0xfcfb('0xc')]);router[_0xfcfb('0xa')](_0xfcfb('0xd'),auth[_0xfcfb('0xe')](),controller[_0xfcfb('0xf')]);router[_0xfcfb('0xa')](_0xfcfb('0x10'),auth[_0xfcfb('0xe')](),controller[_0xfcfb('0x11')]);router[_0xfcfb('0x12')]('/',auth[_0xfcfb('0xe')](),controller[_0xfcfb('0x13')]);router[_0xfcfb('0x12')](_0xfcfb('0xd'),auth[_0xfcfb('0xe')](),controller[_0xfcfb('0x14')]);router[_0xfcfb('0x15')](_0xfcfb('0xb'),auth['isAuthenticated'](),controller[_0xfcfb('0x16')]);router['delete'](_0xfcfb('0xb'),auth[_0xfcfb('0xe')](),controller[_0xfcfb('0x17')]);module[_0xfcfb('0x18')]=router;
\ No newline at end of file
+var _0x1f13=['destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','show','/:id/fields','getFields','post','create','put','delete'];(function(_0x5d00cd,_0x40658e){var _0x114706=function(_0x503a4b){while(--_0x503a4b){_0x5d00cd['push'](_0x5d00cd['shift']());}};_0x114706(++_0x40658e);}(_0x1f13,0x1e7));var _0x31f1=function(_0x430f8d,_0x53ea42){_0x430f8d=_0x430f8d-0x0;var _0xe33af1=_0x1f13[_0x430f8d];return _0xe33af1;};'use strict';var multer=require(_0x31f1('0x0'));var util=require(_0x31f1('0x1'));var path=require(_0x31f1('0x2'));var timeout=require('connect-timeout');var express=require(_0x31f1('0x3'));var router=express[_0x31f1('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x31f1('0x5'));var interaction=require(_0x31f1('0x6'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x31f1('0x7')](),controller['index']);router[_0x31f1('0x8')](_0x31f1('0x9'),auth[_0x31f1('0x7')](),controller[_0x31f1('0xa')]);router[_0x31f1('0x8')]('/:id/configurations',auth[_0x31f1('0x7')](),controller['getConfigurations']);router[_0x31f1('0x8')](_0x31f1('0xb'),auth['isAuthenticated'](),controller[_0x31f1('0xc')]);router[_0x31f1('0xd')]('/',auth['isAuthenticated'](),controller[_0x31f1('0xe')]);router[_0x31f1('0xd')]('/:id/configurations',auth[_0x31f1('0x7')](),controller['addConfiguration']);router[_0x31f1('0xf')](_0x31f1('0x9'),auth[_0x31f1('0x7')](),controller['update']);router[_0x31f1('0x10')](_0x31f1('0x9'),auth['isAuthenticated'](),controller[_0x31f1('0x11')]);module['exports']=router;
\ No newline at end of file
index 4e730e0..dab9b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['exports','STRING'];(function(_0xf97093,_0x29d347){var _0xa300d2=function(_0x320509){while(--_0x320509){_0xf97093['push'](_0xf97093['shift']());}};_0xa300d2(++_0x29d347);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2b63dd,_0x516e33){_0x2b63dd=_0x2b63dd-0x0;var _0x3c2f97=_0x6f0d[_0x2b63dd];return _0x3c2f97;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'name':{'type':Sequelize[_0xd6f0('0x1')]},'description':{'type':Sequelize[_0xd6f0('0x1')]},'host':{'type':Sequelize[_0xd6f0('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xd6f0('0x1')]},'clientSecret':{'type':Sequelize[_0xd6f0('0x1')]},'serverUrl':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xd6f0('0x1')]},'refreshToken':{'type':Sequelize[_0xd6f0('0x1')]}};
\ No newline at end of file
+var _0xe14d=['exports','STRING','sequelize'];(function(_0x1b4e91,_0x59f7cb){var _0x1f150b=function(_0x326b19){while(--_0x326b19){_0x1b4e91['push'](_0x1b4e91['shift']());}};_0x1f150b(++_0x59f7cb);}(_0xe14d,0x1ee));var _0xde14=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xe14d[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'name':{'type':Sequelize[_0xde14('0x2')]},'description':{'type':Sequelize[_0xde14('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xde14('0x2')]},'clientId':{'type':Sequelize[_0xde14('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xde14('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xde14('0x2')]},'refreshToken':{'type':Sequelize[_0xde14('0x2')]}};
\ No newline at end of file
index edd7f8e..0a56cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff9=['AccountId','Subjects','getSubjects','channel','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','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','serverUrl','host','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Description','WhoId','Call_Duration','remove','system_mandatory','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','sendStatus','stack','name','map','ZohoAccount','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','options','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','filter','nolimit'];(function(_0x44443d,_0x28c941){var _0x5000d0=function(_0x3531a7){while(--_0x3531a7){_0x44443d['push'](_0x44443d['shift']());}};_0x5000d0(++_0x28c941);}(_0x8ff9,0xa8));var _0x98ff=function(_0x47e0d8,_0x4227d0){_0x47e0d8=_0x47e0d8-0x0;var _0x101799=_0x8ff9[_0x47e0d8];return _0x101799;};'use strict';var emlformat=require(_0x98ff('0x0'));var rimraf=require(_0x98ff('0x1'));var zipdir=require(_0x98ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x98ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x98ff('0x4'));var path=require(_0x98ff('0x5'));var sox=require(_0x98ff('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x98ff('0x7'));var _=require(_0x98ff('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98ff('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x98ff('0xa'));var querystring=require(_0x98ff('0xb'));var Papa=require(_0x98ff('0xc'));var Redis=require(_0x98ff('0xd'));var authService=require(_0x98ff('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x98ff('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x98ff('0x10'));var licenseUtil=require(_0x98ff('0x11'));var db=require(_0x98ff('0x12'))['db'];var integrations=require(_0x98ff('0x13'));function respondWithStatusCode(_0xecab99,_0x4fcdc0){_0x4fcdc0=_0x4fcdc0||0xcc;return function(_0x271c2e){if(_0x271c2e){return _0xecab99['sendStatus'](_0x4fcdc0);}return _0xecab99[_0x98ff('0x14')](_0x4fcdc0)[_0x98ff('0x15')]();};}function respondWithResult(_0x111050,_0x32635a){_0x32635a=_0x32635a||0xc8;return function(_0x27762e){if(_0x27762e){return _0x111050[_0x98ff('0x14')](_0x32635a)[_0x98ff('0x16')](_0x27762e);}};}function respondWithFilteredResult(_0x5679a1,_0x4dccaa){return function(_0xcc28dd){if(_0xcc28dd){var _0x46a438=typeof _0x4dccaa[_0x98ff('0x17')]===_0x98ff('0x18')&&typeof _0x4dccaa[_0x98ff('0x19')]===_0x98ff('0x18');var _0x4443b4=_0xcc28dd[_0x98ff('0x1a')];var _0x579c1d=_0x46a438?0x0:_0x4dccaa[_0x98ff('0x17')];var _0xcd4922=_0x46a438?_0xcc28dd[_0x98ff('0x1a')]:_0x4dccaa[_0x98ff('0x17')]+_0x4dccaa[_0x98ff('0x19')];var _0x36e9fe;if(_0xcd4922>=_0x4443b4){_0xcd4922=_0x4443b4;_0x36e9fe=0xc8;}else{_0x36e9fe=0xce;}_0x5679a1['status'](_0x36e9fe);return _0x5679a1['set'](_0x98ff('0x1b'),_0x579c1d+'-'+_0xcd4922+'/'+_0x4443b4)['json'](_0xcc28dd);}return null;};}function patchUpdates(_0x5bce3e){return function(_0x1b1bc8){try{jsonpatch['apply'](_0x1b1bc8,_0x5bce3e,!![]);}catch(_0x280091){return BPromise['reject'](_0x280091);}return _0x1b1bc8[_0x98ff('0x1c')]();};}function saveUpdates(_0x51c760,_0x71b2a5){return function(_0x4160a1){if(_0x4160a1){return _0x4160a1[_0x98ff('0x1d')](_0x51c760)[_0x98ff('0x1e')](function(_0x55dce6){return _0x55dce6;});}return null;};}function removeEntity(_0x20280c,_0x35d72f){return function(_0x4a7e04){if(_0x4a7e04){return _0x4a7e04[_0x98ff('0x1f')]()[_0x98ff('0x1e')](function(){_0x20280c[_0x98ff('0x14')](0xcc)[_0x98ff('0x15')]();});}};}function handleEntityNotFound(_0x548a04,_0xfb8f6a){return function(_0x1e20c9){if(!_0x1e20c9){_0x548a04[_0x98ff('0x20')](0x194);}return _0x1e20c9;};}function handleError(_0xc8e8a0,_0x37f3a8){_0x37f3a8=_0x37f3a8||0x1f4;return function(_0x55bec3){logger['error'](_0x55bec3[_0x98ff('0x21')]);if(_0x55bec3[_0x98ff('0x22')]){delete _0x55bec3[_0x98ff('0x22')];}_0xc8e8a0[_0x98ff('0x14')](_0x37f3a8)['send'](_0x55bec3);};}exports['index']=function(_0x33dcb5,_0x2e8946){var _0x382027={},_0x2b2bf9={},_0x1be396={'count':0x0,'rows':[]};var _0x478ae0=_[_0x98ff('0x23')](db[_0x98ff('0x24')]['rawAttributes'],function(_0x592ef9){return{'name':_0x592ef9['fieldName'],'type':_0x592ef9['type'][_0x98ff('0x25')]};});_0x2b2bf9[_0x98ff('0x26')]=_['map'](_0x478ae0,_0x98ff('0x22'));_0x2b2bf9[_0x98ff('0x27')]=_[_0x98ff('0x28')](_0x33dcb5[_0x98ff('0x27')]);_0x2b2bf9['filters']=_[_0x98ff('0x29')](_0x2b2bf9[_0x98ff('0x26')],_0x2b2bf9[_0x98ff('0x27')]);_0x382027[_0x98ff('0x2a')]=_[_0x98ff('0x29')](_0x2b2bf9[_0x98ff('0x26')],qs[_0x98ff('0x2b')](_0x33dcb5[_0x98ff('0x27')][_0x98ff('0x2b')]));_0x382027[_0x98ff('0x2a')]=_0x382027['attributes'][_0x98ff('0x2c')]?_0x382027[_0x98ff('0x2a')]:_0x2b2bf9[_0x98ff('0x26')];if(!_0x33dcb5['query'][_0x98ff('0x2d')]('nolimit')){_0x382027['limit']=qs[_0x98ff('0x19')](_0x33dcb5[_0x98ff('0x27')]['limit']);_0x382027[_0x98ff('0x17')]=qs[_0x98ff('0x17')](_0x33dcb5['query']['offset']);}_0x382027[_0x98ff('0x2e')]=qs[_0x98ff('0x2f')](_0x33dcb5[_0x98ff('0x27')][_0x98ff('0x2f')]);_0x382027[_0x98ff('0x30')]=qs[_0x98ff('0x31')](_[_0x98ff('0x32')](_0x33dcb5['query'],_0x2b2bf9[_0x98ff('0x31')]),_0x478ae0);if(_0x33dcb5['query']['filter']){_0x382027[_0x98ff('0x30')]=_[_0x98ff('0x33')](_0x382027[_0x98ff('0x30')],{'$or':_[_0x98ff('0x23')](_0x478ae0,function(_0x31c1c2){if(_0x31c1c2[_0x98ff('0x34')]!==_0x98ff('0x35')){var _0x2b2b85={};_0x2b2b85[_0x31c1c2['name']]={'$like':'%'+_0x33dcb5[_0x98ff('0x27')]['filter']+'%'};return _0x2b2b85;}})});}_0x382027=_[_0x98ff('0x33')]({},_0x382027,_0x33dcb5['options']);var _0x12220c={'where':_0x382027[_0x98ff('0x30')]};return db['ZohoAccount'][_0x98ff('0x1a')](_0x12220c)[_0x98ff('0x1e')](function(_0x152cb9){_0x1be396['count']=_0x152cb9;if(_0x33dcb5[_0x98ff('0x27')][_0x98ff('0x36')]){_0x382027[_0x98ff('0x37')]=[{'all':!![]}];}return db[_0x98ff('0x24')][_0x98ff('0x38')](_0x382027);})[_0x98ff('0x1e')](function(_0x4bcf76){_0x1be396[_0x98ff('0x39')]=_0x4bcf76;return _0x1be396;})[_0x98ff('0x1e')](respondWithFilteredResult(_0x2e8946,_0x382027))['catch'](handleError(_0x2e8946,null));};exports['show']=function(_0x32b012,_0x2c092b){var _0x3ca139={'raw':![],'where':{'id':_0x32b012[_0x98ff('0x3a')]['id']}},_0x560137={};_0x560137[_0x98ff('0x26')]=_['keys'](db[_0x98ff('0x24')][_0x98ff('0x3b')]);_0x560137['query']=_[_0x98ff('0x28')](_0x32b012[_0x98ff('0x27')]);_0x560137[_0x98ff('0x31')]=_[_0x98ff('0x29')](_0x560137[_0x98ff('0x26')],_0x560137[_0x98ff('0x27')]);_0x3ca139['attributes']=_[_0x98ff('0x29')](_0x560137[_0x98ff('0x26')],qs['fields'](_0x32b012[_0x98ff('0x27')][_0x98ff('0x2b')]));_0x3ca139[_0x98ff('0x2a')]=_0x3ca139['attributes'][_0x98ff('0x2c')]?_0x3ca139[_0x98ff('0x2a')]:_0x560137[_0x98ff('0x26')];if(_0x32b012[_0x98ff('0x27')][_0x98ff('0x36')]){_0x3ca139['include']=[{'all':!![]}];}_0x3ca139=_[_0x98ff('0x33')]({},_0x3ca139,_0x32b012[_0x98ff('0x3c')]);return db[_0x98ff('0x24')][_0x98ff('0x3d')](_0x3ca139)[_0x98ff('0x1e')](handleEntityNotFound(_0x2c092b,null))['then'](respondWithResult(_0x2c092b,null))[_0x98ff('0x3e')](handleError(_0x2c092b,null));};exports[_0x98ff('0x3f')]=function(_0x3d6f71,_0x4ca47a){return db[_0x98ff('0x24')][_0x98ff('0x3f')](_0x3d6f71['body'],{})[_0x98ff('0x1e')](respondWithResult(_0x4ca47a,0xc9))[_0x98ff('0x3e')](handleError(_0x4ca47a,null));};exports[_0x98ff('0x1d')]=function(_0x58a508,_0x3e73bb){if(_0x58a508[_0x98ff('0x40')]['id']){delete _0x58a508[_0x98ff('0x40')]['id'];}return db[_0x98ff('0x24')][_0x98ff('0x3d')]({'where':{'id':_0x58a508[_0x98ff('0x3a')]['id']}})[_0x98ff('0x1e')](handleEntityNotFound(_0x3e73bb,null))['then'](saveUpdates(_0x58a508[_0x98ff('0x40')],null))[_0x98ff('0x1e')](respondWithResult(_0x3e73bb,null))['catch'](handleError(_0x3e73bb,null));};exports[_0x98ff('0x1f')]=function(_0x19859a,_0x58dddb){return db[_0x98ff('0x24')][_0x98ff('0x3d')]({'where':{'id':_0x19859a['params']['id']}})['then'](handleEntityNotFound(_0x58dddb,null))['then'](removeEntity(_0x58dddb,null))['catch'](handleError(_0x58dddb,null));};exports[_0x98ff('0x41')]=function(_0x1a8db2,_0x53d616,_0x383473){var _0x1c6ce6={};var _0x4ea7ed={};var _0x1bef1c;var _0x1923b3;return db[_0x98ff('0x24')][_0x98ff('0x42')]({'where':{'id':_0x1a8db2[_0x98ff('0x3a')]['id']}})[_0x98ff('0x1e')](handleEntityNotFound(_0x53d616,null))[_0x98ff('0x1e')](function(_0x39e783){if(_0x39e783){_0x1bef1c=_0x39e783;_0x4ea7ed[_0x98ff('0x26')]=_[_0x98ff('0x28')](db[_0x98ff('0x43')]['rawAttributes']);_0x4ea7ed[_0x98ff('0x27')]=_['keys'](_0x1a8db2['query']);_0x4ea7ed[_0x98ff('0x31')]=_[_0x98ff('0x29')](_0x4ea7ed[_0x98ff('0x26')],_0x4ea7ed[_0x98ff('0x27')]);_0x1c6ce6[_0x98ff('0x2a')]=_['intersection'](_0x4ea7ed[_0x98ff('0x26')],qs[_0x98ff('0x2b')](_0x1a8db2[_0x98ff('0x27')][_0x98ff('0x2b')]));_0x1c6ce6[_0x98ff('0x2a')]=_0x1c6ce6['attributes'][_0x98ff('0x2c')]?_0x1c6ce6[_0x98ff('0x2a')]:_0x4ea7ed[_0x98ff('0x26')];_0x1c6ce6[_0x98ff('0x2e')]=qs[_0x98ff('0x2f')](_0x1a8db2[_0x98ff('0x27')][_0x98ff('0x2f')]);_0x1c6ce6[_0x98ff('0x30')]=qs[_0x98ff('0x31')](_['pick'](_0x1a8db2[_0x98ff('0x27')],_0x4ea7ed[_0x98ff('0x31')]));if(_0x1a8db2[_0x98ff('0x27')]['filter']){_0x1c6ce6[_0x98ff('0x30')]=_['merge'](_0x1c6ce6['where'],{'$or':_['map'](_0x1c6ce6['attributes'],function(_0x47a0fc){var _0x3be223={};_0x3be223[_0x47a0fc]={'$like':'%'+_0x1a8db2[_0x98ff('0x27')][_0x98ff('0x44')]+'%'};return _0x3be223;})});}_0x1c6ce6=_[_0x98ff('0x33')]({},_0x1c6ce6,_0x1a8db2['options']);return _0x1bef1c['getConfigurations'](_0x1c6ce6);}})[_0x98ff('0x1e')](function(_0x331ca5){if(_0x331ca5){_0x1923b3=_0x331ca5[_0x98ff('0x2c')];if(!_0x1a8db2[_0x98ff('0x27')][_0x98ff('0x2d')](_0x98ff('0x45'))){_0x1c6ce6['limit']=qs[_0x98ff('0x19')](_0x1a8db2[_0x98ff('0x27')]['limit']);_0x1c6ce6[_0x98ff('0x17')]=qs[_0x98ff('0x17')](_0x1a8db2[_0x98ff('0x27')]['offset']);}return _0x1bef1c[_0x98ff('0x41')](_0x1c6ce6);}})[_0x98ff('0x1e')](function(_0x395a63){if(_0x395a63){return _0x395a63?{'count':_0x1923b3,'rows':_0x395a63}:null;}})[_0x98ff('0x1e')](respondWithResult(_0x53d616,null))[_0x98ff('0x3e')](handleError(_0x53d616,null));};exports['addConfiguration']=function(_0x24e6d0,_0x1a5c52,_0x11c5c7){if(_0x24e6d0['body']['id']){delete _0x24e6d0[_0x98ff('0x40')]['id'];}return db[_0x98ff('0x24')]['findOne']({'where':{'id':_0x24e6d0[_0x98ff('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1a5c52,null))[_0x98ff('0x1e')](function(_0x2d808d){if(_0x2d808d){_0x24e6d0[_0x98ff('0x40')][_0x98ff('0x46')]=_0x2d808d['id'];_0x24e6d0['body'][_0x98ff('0x47')]=integrations[_0x98ff('0x48')](_0x24e6d0['body'][_0x98ff('0x49')],_0x24e6d0[_0x98ff('0x40')][_0x98ff('0x34')]);_0x24e6d0[_0x98ff('0x40')][_0x98ff('0x4a')]=integrations[_0x98ff('0x4b')](_0x24e6d0['body'][_0x98ff('0x49')],_0x24e6d0['body'][_0x98ff('0x34')]);return db['ZohoConfiguration'][_0x98ff('0x3f')](_0x24e6d0['body'],{'include':[{'model':db[_0x98ff('0x4c')],'as':_0x98ff('0x47')},{'model':db[_0x98ff('0x4c')],'as':'Descriptions'}]});}return null;})[_0x98ff('0x1e')](respondWithResult(_0x1a5c52,null))[_0x98ff('0x3e')](handleError(_0x1a5c52,null));};function getAccessToken(_0x1bc3a9){return new Promise(function(_0x4fe796,_0x3d2777){var _0x257247;switch(_0x1bc3a9[_0x98ff('0x4d')]){case'US':_0x257247=_0x98ff('0x4e');break;case'AU':_0x257247=_0x98ff('0x4f');break;case'EU':_0x257247=_0x98ff('0x50');break;case'IN':_0x257247=_0x98ff('0x51');break;case'CN':_0x257247=_0x98ff('0x52');break;default:_0x257247='https://accounts.zoho.eu';break;}var _0x48116e={'method':'POST','uri':_0x257247+_0x98ff('0x53'),'qs':{'refresh_token':_0x1bc3a9[_0x98ff('0x54')],'client_id':_0x1bc3a9[_0x98ff('0x55')],'client_secret':_0x1bc3a9[_0x98ff('0x56')],'grant_type':_0x98ff('0x57')},'json':!![]};return rp(_0x48116e)[_0x98ff('0x1e')](function(_0x400c28){if(_0x400c28[_0x98ff('0x58')]){_0x4fe796(_0x400c28[_0x98ff('0x58')]);}else{_0x3d2777(_0x98ff('0x59'));}})[_0x98ff('0x3e')](function(_0x3fe6ab){_0x3d2777(_0x3fe6ab);});});}exports['getFields']=function(_0xe5e41c,_0x25febb,_0x37a05d){var _0x5af1bc,_0x346091,_0x4aa28c,_0x4389b5,_0x2ebb96;return db['ZohoAccount'][_0x98ff('0x42')]({'where':{'id':_0xe5e41c[_0x98ff('0x3a')]['id']},'attributes':['id','host','zone','clientId',_0x98ff('0x56'),_0x98ff('0x5a'),'code',_0x98ff('0x54')]})[_0x98ff('0x1e')](handleEntityNotFound(_0x25febb,null))[_0x98ff('0x1e')](function(_0x2f1eb0){_0x2ebb96=_0x2f1eb0;_0x5af1bc=_0x2ebb96[_0x98ff('0x5b')];_0x346091=_0x5af1bc==='zoho.eu'?'eu':'com';_0x4aa28c=_0x2ebb96[_0x98ff('0x5a')];var _0x3b95d3=_0x4aa28c[_0x98ff('0x5c')](-0x1);if(_0x3b95d3==='/'||_0x3b95d3==='\x5c'||_0x3b95d3===':'){_0x4aa28c=_0x4aa28c[_0x98ff('0x5d')](0x0,_0x4aa28c[_0x98ff('0x5e')](_0x3b95d3));}if(!_0x2ebb96[_0x98ff('0x54')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x2ebb96);})[_0x98ff('0x1e')](function(_0x7b75a0){if(_0x7b75a0){return rp({'method':_0x98ff('0x5f'),'uri':util['format'](_0x98ff('0x60'),_0x346091),'qs':{'module':_0x98ff('0x61')},'headers':{'Authorization':_0x98ff('0x62')+_0x7b75a0},'json':!![]});}})[_0x98ff('0x1e')](function(_0x2ea555){if(_0x2ea555){if(_0x2ea555[_0x98ff('0x63')]&&_0x2ea555['response'][_0x98ff('0x64')]){throw new Error(_0x2ea555[_0x98ff('0x63')][_0x98ff('0x64')][_0x98ff('0x65')]);}var _0x2d90fd=[];var _0x2545d2=[];var _0x541b47=[_0x98ff('0x66'),'Subject',_0x98ff('0x67'),_0x98ff('0x68'),_0x98ff('0x69'),'Call_Result','Call_Start_Time','Call_Type'];_0x2545d2=_[_0x98ff('0x6a')](_0x2ea555['fields'],function(_0x590a83){return _0x541b47['includes'](_0x590a83['api_name']);});for(var _0x103420=0x0;_0x103420<_0x2545d2[_0x98ff('0x2c')];_0x103420++){if(_0x2545d2[_0x103420][_0x98ff('0x6b')]===![]){_0x2d90fd['push']({'id':_0x2545d2[_0x103420]['id'],'name':_0x2545d2[_0x103420]['display_label'],'custom':_0x2545d2[_0x103420][_0x98ff('0x6c')],'options':_0x2545d2[_0x103420][_0x98ff('0x6d')]===_0x98ff('0x6e')&&_0x2545d2[_0x103420][_0x98ff('0x6f')]['length']>-0x1?_[_0x98ff('0x23')](_0x2545d2[_0x103420][_0x98ff('0x6f')],function(_0x4065d4){return{'name':_0x4065d4,'value':_0x4065d4};}):[]});}}return{'count':_0x2d90fd[_0x98ff('0x2c')],'rows':_0x2d90fd};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x25febb,null))[_0x98ff('0x3e')](function(_0x518701){var _0x5be330=_0xe5e41c['query'][_0x98ff('0x70')]?0x1f4:_0x518701[_0x98ff('0x71')]||0x1f4;logger[_0x98ff('0x64')](_0x98ff('0x72'),_0x98ff('0x73'),_0x5be330,JSON[_0x98ff('0x74')](_0x518701));delete _0x518701['name'];if(_0x5be330===0x191){_0x5be330=0x190;}_0x25febb['status'](_0x5be330)[_0x98ff('0x75')](_0xe5e41c[_0x98ff('0x27')]['test']?{'message':_0x98ff('0x76'),'statusCode':_0x518701[_0x98ff('0x71')]}:_0x518701);});};
\ No newline at end of file
+var _0xc8c3=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','ZohoAccount','includeAll','include','findAll','rows','catch','params','options','create','body','find','getConfigurations','ZohoConfiguration','pick','map','addConfiguration','findOne','AccountId','getSubjects','Descriptions','channel','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','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','refreshToken','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','Call_Duration','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus'];(function(_0x44d869,_0x106ecf){var _0x2a3ae1=function(_0x48b720){while(--_0x48b720){_0x44d869['push'](_0x44d869['shift']());}};_0x2a3ae1(++_0x106ecf);}(_0xc8c3,0x168));var _0x3c8c=function(_0x90f34f,_0x404021){_0x90f34f=_0x90f34f-0x0;var _0x4b18cf=_0xc8c3[_0x90f34f];return _0x4b18cf;};'use strict';var emlformat=require(_0x3c8c('0x0'));var rimraf=require(_0x3c8c('0x1'));var zipdir=require(_0x3c8c('0x2'));var jsonpatch=require(_0x3c8c('0x3'));var rp=require(_0x3c8c('0x4'));var moment=require('moment');var BPromise=require(_0x3c8c('0x5'));var Mustache=require(_0x3c8c('0x6'));var util=require(_0x3c8c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3c8c('0x8'));var ejs=require(_0x3c8c('0x9'));var fs=require('fs');var fs_extra=require(_0x3c8c('0xa'));var _=require(_0x3c8c('0xb'));var squel=require(_0x3c8c('0xc'));var crypto=require(_0x3c8c('0xd'));var jsforce=require(_0x3c8c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3c8c('0x8'));var querystring=require(_0x3c8c('0xf'));var Papa=require(_0x3c8c('0x10'));var Redis=require(_0x3c8c('0x11'));var authService=require(_0x3c8c('0x12'));var qs=require(_0x3c8c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c8c('0x14'));var logger=require(_0x3c8c('0x15'))(_0x3c8c('0x16'));var utils=require(_0x3c8c('0x17'));var config=require(_0x3c8c('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x3c8c('0x19'));function respondWithStatusCode(_0x533c84,_0x1db456){_0x1db456=_0x1db456||0xcc;return function(_0x61a742){if(_0x61a742){return _0x533c84[_0x3c8c('0x1a')](_0x1db456);}return _0x533c84[_0x3c8c('0x1b')](_0x1db456)['end']();};}function respondWithResult(_0x5a9517,_0x4f7ad7){_0x4f7ad7=_0x4f7ad7||0xc8;return function(_0x4068b5){if(_0x4068b5){return _0x5a9517['status'](_0x4f7ad7)[_0x3c8c('0x1c')](_0x4068b5);}};}function respondWithFilteredResult(_0x1a6f72,_0x49eaa3){return function(_0x441910){if(_0x441910){var _0x59898d=typeof _0x49eaa3[_0x3c8c('0x1d')]===_0x3c8c('0x1e')&&typeof _0x49eaa3[_0x3c8c('0x1f')]===_0x3c8c('0x1e');var _0x524396=_0x441910[_0x3c8c('0x20')];var _0x479c86=_0x59898d?0x0:_0x49eaa3[_0x3c8c('0x1d')];var _0x3078ec=_0x59898d?_0x441910[_0x3c8c('0x20')]:_0x49eaa3[_0x3c8c('0x1d')]+_0x49eaa3['limit'];var _0x2d84ba;if(_0x3078ec>=_0x524396){_0x3078ec=_0x524396;_0x2d84ba=0xc8;}else{_0x2d84ba=0xce;}_0x1a6f72[_0x3c8c('0x1b')](_0x2d84ba);return _0x1a6f72[_0x3c8c('0x21')](_0x3c8c('0x22'),_0x479c86+'-'+_0x3078ec+'/'+_0x524396)[_0x3c8c('0x1c')](_0x441910);}return null;};}function patchUpdates(_0x22cf07){return function(_0x1cd918){try{jsonpatch[_0x3c8c('0x23')](_0x1cd918,_0x22cf07,!![]);}catch(_0x3c11a6){return BPromise[_0x3c8c('0x24')](_0x3c11a6);}return _0x1cd918['save']();};}function saveUpdates(_0x5706d1,_0x542426){return function(_0x2caec8){if(_0x2caec8){return _0x2caec8[_0x3c8c('0x25')](_0x5706d1)[_0x3c8c('0x26')](function(_0x76049b){return _0x76049b;});}return null;};}function removeEntity(_0x28bd69,_0x1822e6){return function(_0x3d4ee0){if(_0x3d4ee0){return _0x3d4ee0[_0x3c8c('0x27')]()['then'](function(){_0x28bd69['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a1648,_0x1c4d14){return function(_0x417051){if(!_0x417051){_0x3a1648[_0x3c8c('0x1a')](0x194);}return _0x417051;};}function handleError(_0x412e91,_0x56c4c3){_0x56c4c3=_0x56c4c3||0x1f4;return function(_0x555dfe){logger[_0x3c8c('0x28')](_0x555dfe[_0x3c8c('0x29')]);if(_0x555dfe['name']){delete _0x555dfe[_0x3c8c('0x2a')];}_0x412e91['status'](_0x56c4c3)['send'](_0x555dfe);};}exports['index']=function(_0x46faa3,_0x281ed3){var _0x23f2d1={},_0x5f0dd8={},_0x5c18c6={'count':0x0,'rows':[]};var _0x33f6a6=_['map'](db['ZohoAccount'][_0x3c8c('0x2b')],function(_0x36a48c){return{'name':_0x36a48c[_0x3c8c('0x2c')],'type':_0x36a48c[_0x3c8c('0x2d')]['key']};});_0x5f0dd8[_0x3c8c('0x2e')]=_['map'](_0x33f6a6,_0x3c8c('0x2a'));_0x5f0dd8[_0x3c8c('0x2f')]=_[_0x3c8c('0x30')](_0x46faa3[_0x3c8c('0x2f')]);_0x5f0dd8[_0x3c8c('0x31')]=_[_0x3c8c('0x32')](_0x5f0dd8[_0x3c8c('0x2e')],_0x5f0dd8['query']);_0x23f2d1[_0x3c8c('0x33')]=_[_0x3c8c('0x32')](_0x5f0dd8[_0x3c8c('0x2e')],qs['fields'](_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x34')]));_0x23f2d1[_0x3c8c('0x33')]=_0x23f2d1['attributes'][_0x3c8c('0x35')]?_0x23f2d1['attributes']:_0x5f0dd8[_0x3c8c('0x2e')];if(!_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x36')](_0x3c8c('0x37'))){_0x23f2d1['limit']=qs[_0x3c8c('0x1f')](_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x1f')]);_0x23f2d1['offset']=qs[_0x3c8c('0x1d')](_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x1d')]);}_0x23f2d1[_0x3c8c('0x38')]=qs[_0x3c8c('0x39')](_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x39')]);_0x23f2d1[_0x3c8c('0x3a')]=qs[_0x3c8c('0x31')](_['pick'](_0x46faa3[_0x3c8c('0x2f')],_0x5f0dd8[_0x3c8c('0x31')]),_0x33f6a6);if(_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x3b')]){_0x23f2d1['where']=_[_0x3c8c('0x3c')](_0x23f2d1['where'],{'$or':_['map'](_0x33f6a6,function(_0x3d03e3){if(_0x3d03e3[_0x3c8c('0x2d')]!==_0x3c8c('0x3d')){var _0x5494b0={};_0x5494b0[_0x3d03e3[_0x3c8c('0x2a')]]={'$like':'%'+_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x3b')]+'%'};return _0x5494b0;}})});}_0x23f2d1=_[_0x3c8c('0x3c')]({},_0x23f2d1,_0x46faa3['options']);var _0x41e777={'where':_0x23f2d1[_0x3c8c('0x3a')]};return db[_0x3c8c('0x3e')][_0x3c8c('0x20')](_0x41e777)[_0x3c8c('0x26')](function(_0x3c152f){_0x5c18c6[_0x3c8c('0x20')]=_0x3c152f;if(_0x46faa3[_0x3c8c('0x2f')][_0x3c8c('0x3f')]){_0x23f2d1[_0x3c8c('0x40')]=[{'all':!![]}];}return db[_0x3c8c('0x3e')][_0x3c8c('0x41')](_0x23f2d1);})[_0x3c8c('0x26')](function(_0x531fe7){_0x5c18c6[_0x3c8c('0x42')]=_0x531fe7;return _0x5c18c6;})[_0x3c8c('0x26')](respondWithFilteredResult(_0x281ed3,_0x23f2d1))[_0x3c8c('0x43')](handleError(_0x281ed3,null));};exports['show']=function(_0x3cf108,_0x258ffd){var _0x261967={'raw':![],'where':{'id':_0x3cf108[_0x3c8c('0x44')]['id']}},_0x5a68d9={};_0x5a68d9[_0x3c8c('0x2e')]=_[_0x3c8c('0x30')](db[_0x3c8c('0x3e')]['rawAttributes']);_0x5a68d9['query']=_[_0x3c8c('0x30')](_0x3cf108[_0x3c8c('0x2f')]);_0x5a68d9['filters']=_['intersection'](_0x5a68d9['model'],_0x5a68d9['query']);_0x261967[_0x3c8c('0x33')]=_['intersection'](_0x5a68d9['model'],qs[_0x3c8c('0x34')](_0x3cf108[_0x3c8c('0x2f')][_0x3c8c('0x34')]));_0x261967['attributes']=_0x261967[_0x3c8c('0x33')][_0x3c8c('0x35')]?_0x261967['attributes']:_0x5a68d9['model'];if(_0x3cf108[_0x3c8c('0x2f')][_0x3c8c('0x3f')]){_0x261967[_0x3c8c('0x40')]=[{'all':!![]}];}_0x261967=_[_0x3c8c('0x3c')]({},_0x261967,_0x3cf108[_0x3c8c('0x45')]);return db[_0x3c8c('0x3e')]['find'](_0x261967)[_0x3c8c('0x26')](handleEntityNotFound(_0x258ffd,null))[_0x3c8c('0x26')](respondWithResult(_0x258ffd,null))[_0x3c8c('0x43')](handleError(_0x258ffd,null));};exports[_0x3c8c('0x46')]=function(_0x127640,_0x91834e){return db[_0x3c8c('0x3e')][_0x3c8c('0x46')](_0x127640['body'],{})[_0x3c8c('0x26')](respondWithResult(_0x91834e,0xc9))[_0x3c8c('0x43')](handleError(_0x91834e,null));};exports[_0x3c8c('0x25')]=function(_0x3492ac,_0x3735f6){if(_0x3492ac[_0x3c8c('0x47')]['id']){delete _0x3492ac[_0x3c8c('0x47')]['id'];}return db[_0x3c8c('0x3e')][_0x3c8c('0x48')]({'where':{'id':_0x3492ac['params']['id']}})[_0x3c8c('0x26')](handleEntityNotFound(_0x3735f6,null))[_0x3c8c('0x26')](saveUpdates(_0x3492ac[_0x3c8c('0x47')],null))[_0x3c8c('0x26')](respondWithResult(_0x3735f6,null))['catch'](handleError(_0x3735f6,null));};exports[_0x3c8c('0x27')]=function(_0x681725,_0x5689c6){return db[_0x3c8c('0x3e')][_0x3c8c('0x48')]({'where':{'id':_0x681725[_0x3c8c('0x44')]['id']}})[_0x3c8c('0x26')](handleEntityNotFound(_0x5689c6,null))['then'](removeEntity(_0x5689c6,null))[_0x3c8c('0x43')](handleError(_0x5689c6,null));};exports[_0x3c8c('0x49')]=function(_0x4462ff,_0x4acfbe,_0x64f69){var _0x535e54={};var _0x4a7b9b={};var _0x57f322;var _0x171e60;return db[_0x3c8c('0x3e')]['findOne']({'where':{'id':_0x4462ff[_0x3c8c('0x44')]['id']}})[_0x3c8c('0x26')](handleEntityNotFound(_0x4acfbe,null))[_0x3c8c('0x26')](function(_0x56c594){if(_0x56c594){_0x57f322=_0x56c594;_0x4a7b9b[_0x3c8c('0x2e')]=_[_0x3c8c('0x30')](db[_0x3c8c('0x4a')][_0x3c8c('0x2b')]);_0x4a7b9b['query']=_[_0x3c8c('0x30')](_0x4462ff['query']);_0x4a7b9b[_0x3c8c('0x31')]=_[_0x3c8c('0x32')](_0x4a7b9b[_0x3c8c('0x2e')],_0x4a7b9b[_0x3c8c('0x2f')]);_0x535e54[_0x3c8c('0x33')]=_['intersection'](_0x4a7b9b[_0x3c8c('0x2e')],qs['fields'](_0x4462ff[_0x3c8c('0x2f')][_0x3c8c('0x34')]));_0x535e54[_0x3c8c('0x33')]=_0x535e54[_0x3c8c('0x33')][_0x3c8c('0x35')]?_0x535e54[_0x3c8c('0x33')]:_0x4a7b9b[_0x3c8c('0x2e')];_0x535e54['order']=qs['sort'](_0x4462ff[_0x3c8c('0x2f')][_0x3c8c('0x39')]);_0x535e54[_0x3c8c('0x3a')]=qs[_0x3c8c('0x31')](_[_0x3c8c('0x4b')](_0x4462ff[_0x3c8c('0x2f')],_0x4a7b9b['filters']));if(_0x4462ff[_0x3c8c('0x2f')][_0x3c8c('0x3b')]){_0x535e54[_0x3c8c('0x3a')]=_[_0x3c8c('0x3c')](_0x535e54['where'],{'$or':_[_0x3c8c('0x4c')](_0x535e54[_0x3c8c('0x33')],function(_0x207f11){var _0x48f885={};_0x48f885[_0x207f11]={'$like':'%'+_0x4462ff['query']['filter']+'%'};return _0x48f885;})});}_0x535e54=_[_0x3c8c('0x3c')]({},_0x535e54,_0x4462ff[_0x3c8c('0x45')]);return _0x57f322[_0x3c8c('0x49')](_0x535e54);}})['then'](function(_0x51ca08){if(_0x51ca08){_0x171e60=_0x51ca08[_0x3c8c('0x35')];if(!_0x4462ff[_0x3c8c('0x2f')][_0x3c8c('0x36')](_0x3c8c('0x37'))){_0x535e54['limit']=qs[_0x3c8c('0x1f')](_0x4462ff[_0x3c8c('0x2f')][_0x3c8c('0x1f')]);_0x535e54['offset']=qs['offset'](_0x4462ff[_0x3c8c('0x2f')]['offset']);}return _0x57f322[_0x3c8c('0x49')](_0x535e54);}})['then'](function(_0x2dc9f9){if(_0x2dc9f9){return _0x2dc9f9?{'count':_0x171e60,'rows':_0x2dc9f9}:null;}})['then'](respondWithResult(_0x4acfbe,null))[_0x3c8c('0x43')](handleError(_0x4acfbe,null));};exports[_0x3c8c('0x4d')]=function(_0xf3f939,_0x34d9ff,_0x30af83){if(_0xf3f939[_0x3c8c('0x47')]['id']){delete _0xf3f939['body']['id'];}return db[_0x3c8c('0x3e')][_0x3c8c('0x4e')]({'where':{'id':_0xf3f939[_0x3c8c('0x44')]['id']}})['then'](handleEntityNotFound(_0x34d9ff,null))['then'](function(_0x4f6c0f){if(_0x4f6c0f){_0xf3f939[_0x3c8c('0x47')][_0x3c8c('0x4f')]=_0x4f6c0f['id'];_0xf3f939[_0x3c8c('0x47')]['Subjects']=integrations[_0x3c8c('0x50')](_0xf3f939[_0x3c8c('0x47')]['channel'],_0xf3f939[_0x3c8c('0x47')][_0x3c8c('0x2d')]);_0xf3f939[_0x3c8c('0x47')][_0x3c8c('0x51')]=integrations['getDescriptions'](_0xf3f939[_0x3c8c('0x47')][_0x3c8c('0x52')],_0xf3f939[_0x3c8c('0x47')][_0x3c8c('0x2d')]);return db[_0x3c8c('0x4a')][_0x3c8c('0x46')](_0xf3f939[_0x3c8c('0x47')],{'include':[{'model':db[_0x3c8c('0x53')],'as':'Subjects'},{'model':db[_0x3c8c('0x53')],'as':_0x3c8c('0x51')}]});}return null;})[_0x3c8c('0x26')](respondWithResult(_0x34d9ff,null))['catch'](handleError(_0x34d9ff,null));};function getAccessToken(_0x15b6a6){return new Promise(function(_0x13ddc3,_0x2a9436){var _0x42b76e;switch(_0x15b6a6[_0x3c8c('0x54')]){case'US':_0x42b76e=_0x3c8c('0x55');break;case'AU':_0x42b76e=_0x3c8c('0x56');break;case'EU':_0x42b76e=_0x3c8c('0x57');break;case'IN':_0x42b76e=_0x3c8c('0x58');break;case'CN':_0x42b76e=_0x3c8c('0x59');break;default:_0x42b76e=_0x3c8c('0x57');break;}var _0x41ef72={'method':_0x3c8c('0x5a'),'uri':_0x42b76e+_0x3c8c('0x5b'),'qs':{'refresh_token':_0x15b6a6['refreshToken'],'client_id':_0x15b6a6[_0x3c8c('0x5c')],'client_secret':_0x15b6a6[_0x3c8c('0x5d')],'grant_type':_0x3c8c('0x5e')},'json':!![]};return rp(_0x41ef72)['then'](function(_0x2dec05){if(_0x2dec05['access_token']){_0x13ddc3(_0x2dec05[_0x3c8c('0x5f')]);}else{_0x2a9436(_0x3c8c('0x60'));}})[_0x3c8c('0x43')](function(_0x14fc9b){_0x2a9436(_0x14fc9b);});});}exports[_0x3c8c('0x61')]=function(_0x53b974,_0x13ad80,_0x2a4c4f){var _0xf996b1,_0x2b8920,_0x531c40,_0x55002e,_0x172707;return db[_0x3c8c('0x3e')][_0x3c8c('0x4e')]({'where':{'id':_0x53b974['params']['id']},'attributes':['id',_0x3c8c('0x62'),'zone',_0x3c8c('0x5c'),_0x3c8c('0x5d'),_0x3c8c('0x63'),_0x3c8c('0x64'),_0x3c8c('0x65')]})['then'](handleEntityNotFound(_0x13ad80,null))[_0x3c8c('0x26')](function(_0x13998d){_0x172707=_0x13998d;_0xf996b1=_0x172707[_0x3c8c('0x62')];_0x2b8920=_0xf996b1==='zoho.eu'?'eu':'com';_0x531c40=_0x172707[_0x3c8c('0x63')];var _0x492e50=_0x531c40['slice'](-0x1);if(_0x492e50==='/'||_0x492e50==='\x5c'||_0x492e50===':'){_0x531c40=_0x531c40[_0x3c8c('0x66')](0x0,_0x531c40[_0x3c8c('0x67')](_0x492e50));}if(!_0x172707[_0x3c8c('0x65')]){throw new Error(_0x3c8c('0x68'));}return getAccessToken(_0x172707);})[_0x3c8c('0x26')](function(_0x70a2b0){if(_0x70a2b0){return rp({'method':_0x3c8c('0x69'),'uri':util[_0x3c8c('0x6a')](_0x3c8c('0x6b'),_0x2b8920),'qs':{'module':_0x3c8c('0x6c')},'headers':{'Authorization':_0x3c8c('0x6d')+_0x70a2b0},'json':!![]});}})['then'](function(_0x768bd3){if(_0x768bd3){if(_0x768bd3[_0x3c8c('0x6e')]&&_0x768bd3['response']['error']){throw new Error(_0x768bd3[_0x3c8c('0x6e')][_0x3c8c('0x28')]['message']);}var _0x109472=[];var _0x488aca=[];var _0x33b269=['Owner',_0x3c8c('0x6f'),_0x3c8c('0x70'),'WhoId',_0x3c8c('0x71'),'Call_Result','Call_Start_Time',_0x3c8c('0x72')];_0x488aca=_[_0x3c8c('0x73')](_0x768bd3[_0x3c8c('0x34')],function(_0x3ac091){return _0x33b269[_0x3c8c('0x74')](_0x3ac091[_0x3c8c('0x75')]);});for(var _0x2243a8=0x0;_0x2243a8<_0x488aca['length'];_0x2243a8++){if(_0x488aca[_0x2243a8][_0x3c8c('0x76')]===![]){_0x109472[_0x3c8c('0x77')]({'id':_0x488aca[_0x2243a8]['id'],'name':_0x488aca[_0x2243a8][_0x3c8c('0x78')],'custom':_0x488aca[_0x2243a8]['custom_field'],'options':_0x488aca[_0x2243a8][_0x3c8c('0x79')]===_0x3c8c('0x7a')&&_0x488aca[_0x2243a8][_0x3c8c('0x7b')][_0x3c8c('0x35')]>-0x1?_[_0x3c8c('0x4c')](_0x488aca[_0x2243a8][_0x3c8c('0x7b')],function(_0x59ba0b){return{'name':_0x59ba0b,'value':_0x59ba0b};}):[]});}}return{'count':_0x109472[_0x3c8c('0x35')],'rows':_0x109472};}else{return{'count':0x0,'rows':[]};}})[_0x3c8c('0x26')](respondWithResult(_0x13ad80,null))[_0x3c8c('0x43')](function(_0x4c2a54){var _0x51e2ac=_0x53b974[_0x3c8c('0x2f')][_0x3c8c('0x7c')]?0x1f4:_0x4c2a54['statusCode']||0x1f4;logger[_0x3c8c('0x28')](_0x3c8c('0x7d'),_0x3c8c('0x61'),_0x51e2ac,JSON[_0x3c8c('0x7e')](_0x4c2a54));delete _0x4c2a54['name'];if(_0x51e2ac===0x191){_0x51e2ac=0x190;}_0x13ad80[_0x3c8c('0x1b')](_0x51e2ac)[_0x3c8c('0x7f')](_0x53b974[_0x3c8c('0x2f')][_0x3c8c('0x7c')]?{'message':_0x3c8c('0x80'),'statusCode':_0x4c2a54['statusCode']}:_0x4c2a54);});};
\ No newline at end of file
index e172c23..de89746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc137=['name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','error','format','slice','lastIndexOf','POST','catch','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x323195,_0x23f5ef){var _0x3ab5f2=function(_0x773cdc){while(--_0x773cdc){_0x323195['push'](_0x323195['shift']());}};_0x3ab5f2(++_0x23f5ef);}(_0xc137,0xff));var _0x7c13=function(_0x2ff4d1,_0x4bddc9){_0x2ff4d1=_0x2ff4d1-0x0;var _0x56b9fe=_0xc137[_0x2ff4d1];return _0x56b9fe;};'use strict';var _=require(_0x7c13('0x0'));var util=require(_0x7c13('0x1'));var logger=require(_0x7c13('0x2'))(_0x7c13('0x3'));var moment=require(_0x7c13('0x4'));var BPromise=require(_0x7c13('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7c13('0x6'));var attributes=require(_0x7c13('0x7'));var integrations=require(_0x7c13('0x8'));module[_0x7c13('0x9')]=function(_0x276976,_0x2d73f1){return _0x276976['define']('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa48b2b,_0x2c93d6,_0x489201){if(_0xa48b2b[_0x7c13('0xa')](_0x7c13('0xb'))||_0xa48b2b['changed'](_0x7c13('0xc'))||_0xa48b2b[_0x7c13('0xa')](_0x7c13('0xd'))||_0xa48b2b[_0x7c13('0xa')](_0x7c13('0xe'))||_0xa48b2b[_0x7c13('0xa')](_0x7c13('0xf'))||_0xa48b2b[_0x7c13('0xa')](_0x7c13('0x10'))){var _0x4658b0,_0x269c01;_0x4658b0=_0xa48b2b[_0x7c13('0xc')];var _0x27df9=_0x4658b0['slice'](-0x1);if(_0x27df9==='/'||_0x27df9==='\x5c'||_0x27df9===':'){_0x4658b0=_0x4658b0[_0x7c13('0x11')](0x0,_0x4658b0['lastIndexOf'](_0x27df9));}switch(_0xa48b2b[_0x7c13('0xb')]){case'US':_0x269c01=_0x7c13('0x12');break;case'AU':_0x269c01=_0x7c13('0x13');break;case'IN':_0x269c01=_0x7c13('0x14');break;case'CN':_0x269c01=_0x7c13('0x15');break;default:_0x269c01=_0x7c13('0x16');break;}var _0x2b9855={'method':'POST','uri':_0x269c01+_0x7c13('0x17'),'form':{'grant_type':_0x7c13('0x18'),'client_id':_0xa48b2b['clientId'],'client_secret':_0xa48b2b[_0x7c13('0xe')],'redirect_uri':_0xa48b2b[_0x7c13('0xc')],'code':_0xa48b2b['code']},'headers':{'Content-Type':_0x7c13('0x19')}};return rp(_0x2b9855)[_0x7c13('0x1a')](function(_0x1d84a6){var _0x2d1d9b=JSON[_0x7c13('0x1b')](_0x1d84a6);if(_0x2d1d9b[_0x7c13('0x1c')]){_0xa48b2b[_0x7c13('0x1d')]=_0x2d1d9b[_0x7c13('0x1c')];logger[_0x7c13('0x1e')](util['format'](_0x7c13('0x1f'),_0xa48b2b[_0x7c13('0x20')],_0xa48b2b['id']));}else{logger['error'](util['format'](_0x7c13('0x21'),_0xa48b2b[_0x7c13('0x20')],_0xa48b2b['id']),util[_0x7c13('0x22')](_0x2d1d9b,{'showHidden':![],'depth':null}));}return _0x489201(null,_0x2c93d6);})['catch'](function(_0x35d398){logger[_0x7c13('0x23')](util[_0x7c13('0x24')](_0x7c13('0x21'),_0xa48b2b[_0x7c13('0x20')],_0xa48b2b['id']),util[_0x7c13('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x489201(_0x35d398);});}else{return _0x489201(null,_0x2c93d6);}},'beforeUpdate':function(_0x2cd2c1,_0x10bf94,_0x3aa7c7){if(_0x2cd2c1[_0x7c13('0xa')](_0x7c13('0xb'))||_0x2cd2c1[_0x7c13('0xa')](_0x7c13('0xc'))||_0x2cd2c1['changed'](_0x7c13('0xd'))||_0x2cd2c1[_0x7c13('0xa')]('clientSecret')||_0x2cd2c1['changed'](_0x7c13('0xf'))||_0x2cd2c1['changed'](_0x7c13('0x10'))){var _0x23fe53,_0x2263f3;_0x23fe53=_0x2cd2c1['serverUrl'];var _0x1b970f=_0x23fe53[_0x7c13('0x25')](-0x1);if(_0x1b970f==='/'||_0x1b970f==='\x5c'||_0x1b970f===':'){_0x23fe53=_0x23fe53['substring'](0x0,_0x23fe53[_0x7c13('0x26')](_0x1b970f));}switch(_0x2cd2c1[_0x7c13('0xb')]){case'US':_0x2263f3=_0x7c13('0x12');break;case'AU':_0x2263f3=_0x7c13('0x13');break;case'IN':_0x2263f3=_0x7c13('0x14');break;case'CN':_0x2263f3=_0x7c13('0x15');break;default:_0x2263f3=_0x7c13('0x16');break;}var _0x80a1d3={'method':_0x7c13('0x27'),'uri':_0x2263f3+_0x7c13('0x17'),'form':{'grant_type':_0x7c13('0x18'),'client_id':_0x2cd2c1[_0x7c13('0xd')],'client_secret':_0x2cd2c1['clientSecret'],'redirect_uri':_0x2cd2c1[_0x7c13('0xc')],'code':_0x2cd2c1[_0x7c13('0xf')]},'headers':{'Content-Type':_0x7c13('0x19')}};return rp(_0x80a1d3)[_0x7c13('0x1a')](function(_0x1c98a4){var _0x545d79=JSON[_0x7c13('0x1b')](_0x1c98a4);if(_0x545d79[_0x7c13('0x1c')]){_0x2cd2c1[_0x7c13('0x1d')]=_0x545d79[_0x7c13('0x1c')];logger[_0x7c13('0x1e')](util[_0x7c13('0x24')](_0x7c13('0x1f'),_0x2cd2c1[_0x7c13('0x20')],_0x2cd2c1['id']));}else{logger[_0x7c13('0x23')](util[_0x7c13('0x24')](_0x7c13('0x21'),_0x2cd2c1[_0x7c13('0x20')],_0x2cd2c1['id']),util[_0x7c13('0x22')](_0x545d79,{'showHidden':![],'depth':null}));}return _0x3aa7c7(null,_0x10bf94);})[_0x7c13('0x28')](function(_0x3afa07){logger[_0x7c13('0x23')](util[_0x7c13('0x24')](_0x7c13('0x21'),_0x2cd2c1[_0x7c13('0x20')],_0x2cd2c1['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x3aa7c7(_0x3afa07);});}else{return _0x3aa7c7(null,_0x10bf94);}}}});};
\ No newline at end of file
+var _0xb098=['substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','clientSecret','serverUrl','application/x-www-form-urlencoded','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','https://accounts.zoho.com.cn','then','parse','name','lodash','util','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','code'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb098,0x1c4));var _0x8b09=function(_0x4adf05,_0xbec980){_0x4adf05=_0x4adf05-0x0;var _0x651a0f=_0xb098[_0x4adf05];return _0x651a0f;};'use strict';var _=require(_0x8b09('0x0'));var util=require(_0x8b09('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8b09('0x2'));var BPromise=require(_0x8b09('0x3'));var rp=require(_0x8b09('0x4'));var fs=require('fs');var path=require(_0x8b09('0x5'));var rimraf=require('rimraf');var config=require(_0x8b09('0x6'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8b09('0x7'));module[_0x8b09('0x8')]=function(_0x33f5e3,_0x3a92a7){return _0x33f5e3[_0x8b09('0x9')](_0x8b09('0xa'),attributes,{'tableName':_0x8b09('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x97f897,_0x3da1ec,_0x41b5e9){if(_0x97f897['changed'](_0x8b09('0xc'))||_0x97f897[_0x8b09('0xd')]('serverUrl')||_0x97f897[_0x8b09('0xd')](_0x8b09('0xe'))||_0x97f897[_0x8b09('0xd')]('clientSecret')||_0x97f897[_0x8b09('0xd')](_0x8b09('0xf'))||_0x97f897['changed']('host')){var _0x42ec86,_0x2a7915;_0x42ec86=_0x97f897['serverUrl'];var _0x471844=_0x42ec86['slice'](-0x1);if(_0x471844==='/'||_0x471844==='\x5c'||_0x471844===':'){_0x42ec86=_0x42ec86[_0x8b09('0x10')](0x0,_0x42ec86[_0x8b09('0x11')](_0x471844));}switch(_0x97f897[_0x8b09('0xc')]){case'US':_0x2a7915=_0x8b09('0x12');break;case'AU':_0x2a7915=_0x8b09('0x13');break;case'IN':_0x2a7915=_0x8b09('0x14');break;case'CN':_0x2a7915='https://accounts.zoho.com.cn';break;default:_0x2a7915=_0x8b09('0x15');break;}var _0x28178f={'method':_0x8b09('0x16'),'uri':_0x2a7915+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x97f897[_0x8b09('0xe')],'client_secret':_0x97f897[_0x8b09('0x17')],'redirect_uri':_0x97f897[_0x8b09('0x18')],'code':_0x97f897['code']},'headers':{'Content-Type':_0x8b09('0x19')}};return rp(_0x28178f)['then'](function(_0x3de7fa){var _0xf50a37=JSON['parse'](_0x3de7fa);if(_0xf50a37[_0x8b09('0x1a')]){_0x97f897['refreshToken']=_0xf50a37[_0x8b09('0x1a')];logger[_0x8b09('0x1b')](util[_0x8b09('0x1c')](_0x8b09('0x1d'),_0x97f897['name'],_0x97f897['id']));}else{logger[_0x8b09('0x1e')](util[_0x8b09('0x1c')](_0x8b09('0x1f'),_0x97f897['name'],_0x97f897['id']),util[_0x8b09('0x20')](_0xf50a37,{'showHidden':![],'depth':null}));}return _0x41b5e9(null,_0x3da1ec);})[_0x8b09('0x21')](function(_0xcad35d){logger[_0x8b09('0x1e')](util[_0x8b09('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x97f897['name'],_0x97f897['id']),util[_0x8b09('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x41b5e9(_0xcad35d);});}else{return _0x41b5e9(null,_0x3da1ec);}},'beforeUpdate':function(_0x3caaa5,_0x3a115b,_0x1dc5ed){if(_0x3caaa5['changed']('zone')||_0x3caaa5['changed']('serverUrl')||_0x3caaa5[_0x8b09('0xd')](_0x8b09('0xe'))||_0x3caaa5[_0x8b09('0xd')]('clientSecret')||_0x3caaa5[_0x8b09('0xd')]('code')||_0x3caaa5[_0x8b09('0xd')](_0x8b09('0x22'))){var _0x57afd9,_0x5f5cce;_0x57afd9=_0x3caaa5[_0x8b09('0x18')];var _0x46fbe1=_0x57afd9['slice'](-0x1);if(_0x46fbe1==='/'||_0x46fbe1==='\x5c'||_0x46fbe1===':'){_0x57afd9=_0x57afd9['substring'](0x0,_0x57afd9['lastIndexOf'](_0x46fbe1));}switch(_0x3caaa5[_0x8b09('0xc')]){case'US':_0x5f5cce=_0x8b09('0x12');break;case'AU':_0x5f5cce='https://accounts.zoho.com.au';break;case'IN':_0x5f5cce=_0x8b09('0x14');break;case'CN':_0x5f5cce=_0x8b09('0x23');break;default:_0x5f5cce=_0x8b09('0x15');break;}var _0x501605={'method':_0x8b09('0x16'),'uri':_0x5f5cce+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x3caaa5[_0x8b09('0xe')],'client_secret':_0x3caaa5[_0x8b09('0x17')],'redirect_uri':_0x3caaa5['serverUrl'],'code':_0x3caaa5[_0x8b09('0xf')]},'headers':{'Content-Type':_0x8b09('0x19')}};return rp(_0x501605)[_0x8b09('0x24')](function(_0x2b0d1b){var _0x3567ff=JSON[_0x8b09('0x25')](_0x2b0d1b);if(_0x3567ff[_0x8b09('0x1a')]){_0x3caaa5['refreshToken']=_0x3567ff[_0x8b09('0x1a')];logger[_0x8b09('0x1b')](util[_0x8b09('0x1c')](_0x8b09('0x1d'),_0x3caaa5[_0x8b09('0x26')],_0x3caaa5['id']));}else{logger[_0x8b09('0x1e')](util['format'](_0x8b09('0x1f'),_0x3caaa5[_0x8b09('0x26')],_0x3caaa5['id']),util[_0x8b09('0x20')](_0x3567ff,{'showHidden':![],'depth':null}));}return _0x1dc5ed(null,_0x3a115b);})[_0x8b09('0x21')](function(_0x717511){logger[_0x8b09('0x1e')](util[_0x8b09('0x1c')](_0x8b09('0x1f'),_0x3caaa5[_0x8b09('0x26')],_0x3caaa5['id']),util[_0x8b09('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x1dc5ed(_0x717511);});}else{return _0x1dc5ed(null,_0x3a115b);}}}});};
\ No newline at end of file
index e9b14d8..fb6107f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['GetZohoAccount','debug','ShowZohoAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','ZohoAccount','findAll','options','where','limit','include','map','model','attributes'];(function(_0x5eda84,_0x5f2ab1){var _0x38e7c2=function(_0x3d83af){while(--_0x3d83af){_0x5eda84['push'](_0x5eda84['shift']());}};_0x38e7c2(++_0x5f2ab1);}(_0x2a07,0x74));var _0x72a0=function(_0x501c00,_0x1dc98b){_0x501c00=_0x501c00-0x0;var _0x5ad836=_0x2a07[_0x501c00];return _0x5ad836;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var moment=require(_0x72a0('0x2'));var BPromise=require(_0x72a0('0x3'));var rs=require(_0x72a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72a0('0x5'))['db'];var utils=require(_0x72a0('0x6'));var logger=require(_0x72a0('0x7'))(_0x72a0('0x8'));var config=require(_0x72a0('0x9'));var jayson=require(_0x72a0('0xa'));var client=jayson[_0x72a0('0xb')][_0x72a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193e3b,_0x287b06,_0x21c819){return new BPromise(function(_0x2c04eb,_0x22270e){return client[_0x72a0('0xd')](_0x193e3b,_0x21c819)[_0x72a0('0xe')](function(_0x2bc45b){logger['info'](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));logger['debug'](_0x72a0('0x11'),_0x287b06,_0x72a0('0x10'),JSON[_0x72a0('0x12')](_0x2bc45b));if(_0x2bc45b[_0x72a0('0x13')]){if(_0x2bc45b[_0x72a0('0x13')]['code']===0x1f4){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);return _0x22270e(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}logger[_0x72a0('0x13')]('ZohoAccount,\x20%s,\x20%s',_0x287b06,_0x2bc45b['error'][_0x72a0('0x14')]);return _0x2c04eb(_0x2bc45b[_0x72a0('0x13')][_0x72a0('0x14')]);}else{logger[_0x72a0('0x15')](_0x72a0('0xf'),_0x287b06,_0x72a0('0x10'));_0x2c04eb(_0x2bc45b['result'][_0x72a0('0x14')]);}})[_0x72a0('0x16')](function(_0x16ac70){logger[_0x72a0('0x13')](_0x72a0('0xf'),_0x287b06,_0x16ac70);_0x22270e(_0x16ac70);});});}exports['GetZohoAccount']=function(_0x100d8f){var _0x42e9ec=this;return new Promise(function(_0x131b73,_0x5b63c8){return db[_0x72a0('0x17')][_0x72a0('0x18')]({'raw':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1a')]||null:null,'attributes':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')]['attributes']||null:null,'limit':_0x100d8f[_0x72a0('0x19')]?_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1b')]||null:null,'include':_0x100d8f[_0x72a0('0x19')]?_0x100d8f['options'][_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x100d8f[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x3022b0){return{'model':db[_0x3022b0[_0x72a0('0x1e')]],'as':_0x3022b0['as'],'attributes':_0x3022b0['attributes'],'include':_0x3022b0['include']?_[_0x72a0('0x1d')](_0x3022b0[_0x72a0('0x1c')],function(_0x123df4){return{'model':db[_0x123df4[_0x72a0('0x1e')]],'as':_0x123df4['as'],'attributes':_0x123df4[_0x72a0('0x1f')],'include':_0x123df4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x123df4[_0x72a0('0x1c')],function(_0xee99e2){return{'model':db[_0xee99e2[_0x72a0('0x1e')]],'as':_0xee99e2['as'],'attributes':_0xee99e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x553641){logger[_0x72a0('0x15')](_0x72a0('0x20'),_0x100d8f);logger[_0x72a0('0x21')](_0x72a0('0x20'),_0x100d8f,JSON[_0x72a0('0x12')](_0x553641));_0x131b73(_0x553641);})[_0x72a0('0x16')](function(_0x23c96a){logger[_0x72a0('0x13')]('GetZohoAccount',_0x23c96a[_0x72a0('0x14')],_0x100d8f);_0x5b63c8(_0x42e9ec[_0x72a0('0x13')](0x1f4,_0x23c96a[_0x72a0('0x14')]));});});};exports[_0x72a0('0x22')]=function(_0x13c04){var _0x19e783=this;return new Promise(function(_0x3a5e54,_0x592401){return db[_0x72a0('0x17')][_0x72a0('0x23')]({'raw':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x24')]===undefined?!![]:![]:!![],'where':_0x13c04[_0x72a0('0x19')]?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1a')]||null:null,'attributes':_0x13c04['options']?_0x13c04[_0x72a0('0x19')][_0x72a0('0x1f')]||null:null,'include':_0x13c04[_0x72a0('0x19')]?_0x13c04['options'][_0x72a0('0x1c')]?_['map'](_0x13c04[_0x72a0('0x19')][_0x72a0('0x1c')],function(_0x1d02c4){return{'model':db[_0x1d02c4[_0x72a0('0x1e')]],'as':_0x1d02c4['as'],'attributes':_0x1d02c4[_0x72a0('0x1f')],'include':_0x1d02c4[_0x72a0('0x1c')]?_[_0x72a0('0x1d')](_0x1d02c4[_0x72a0('0x1c')],function(_0x154c1e){return{'model':db[_0x154c1e[_0x72a0('0x1e')]],'as':_0x154c1e['as'],'attributes':_0x154c1e[_0x72a0('0x1f')],'include':_0x154c1e[_0x72a0('0x1c')]?_['map'](_0x154c1e[_0x72a0('0x1c')],function(_0x5eb8f1){return{'model':db[_0x5eb8f1[_0x72a0('0x1e')]],'as':_0x5eb8f1['as'],'attributes':_0x5eb8f1[_0x72a0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x72a0('0xe')](function(_0x1a9597){logger[_0x72a0('0x15')](_0x72a0('0x22'),_0x13c04);logger[_0x72a0('0x21')](_0x72a0('0x22'),_0x13c04,JSON[_0x72a0('0x12')](_0x1a9597));_0x3a5e54(_0x1a9597);})['catch'](function(_0x4a973a){logger[_0x72a0('0x13')](_0x72a0('0x22'),_0x4a973a[_0x72a0('0x14')],_0x13c04);_0x592401(_0x19e783[_0x72a0('0x13')](0x1f4,_0x4a973a[_0x72a0('0x14')]));});});};
\ No newline at end of file
+var _0xfa94=['rpc','../../config/environment','jayson/promise','client','http','request','info','ZohoAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','attributes','limit','include','map','model','then','ShowZohoAccount','find','where','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x427b8a,_0xe5e024){var _0x544857=function(_0x258390){while(--_0x258390){_0x427b8a['push'](_0x427b8a['shift']());}};_0x544857(++_0xe5e024);}(_0xfa94,0xef));var _0x4fa9=function(_0x381a28,_0x4eb359){_0x381a28=_0x381a28-0x0;var _0x5e572d=_0xfa94[_0x381a28];return _0x5e572d;};'use strict';var _=require(_0x4fa9('0x0'));var util=require('util');var moment=require(_0x4fa9('0x1'));var BPromise=require('bluebird');var rs=require(_0x4fa9('0x2'));var fs=require('fs');var Redis=require(_0x4fa9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fa9('0x4'));var logger=require(_0x4fa9('0x5'))(_0x4fa9('0x6'));var config=require(_0x4fa9('0x7'));var jayson=require(_0x4fa9('0x8'));var client=jayson[_0x4fa9('0x9')][_0x4fa9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56faa9,_0xd4dcad,_0x2fb0b3){return new BPromise(function(_0x48fe52,_0x500b64){return client[_0x4fa9('0xb')](_0x56faa9,_0x2fb0b3)['then'](function(_0x2049ea){logger[_0x4fa9('0xc')](_0x4fa9('0xd'),_0xd4dcad,'request\x20sent');logger[_0x4fa9('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xd4dcad,_0x4fa9('0xf'),JSON[_0x4fa9('0x10')](_0x2049ea));if(_0x2049ea['error']){if(_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x12')]===0x1f4){logger[_0x4fa9('0x11')]('ZohoAccount,\x20%s,\x20%s',_0xd4dcad,_0x2049ea[_0x4fa9('0x11')]['message']);return _0x500b64(_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x13')]);}logger['error'](_0x4fa9('0xd'),_0xd4dcad,_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x13')]);return _0x48fe52(_0x2049ea[_0x4fa9('0x11')][_0x4fa9('0x13')]);}else{logger[_0x4fa9('0xc')](_0x4fa9('0xd'),_0xd4dcad,_0x4fa9('0xf'));_0x48fe52(_0x2049ea[_0x4fa9('0x14')]['message']);}})[_0x4fa9('0x15')](function(_0x1a1117){logger['error']('ZohoAccount,\x20%s,\x20%s',_0xd4dcad,_0x1a1117);_0x500b64(_0x1a1117);});});}exports[_0x4fa9('0x16')]=function(_0x4f58bd){var _0x2fe920=this;return new Promise(function(_0x416e08,_0x50a0d9){return db[_0x4fa9('0x17')]['findAll']({'raw':_0x4f58bd[_0x4fa9('0x18')]?_0x4f58bd[_0x4fa9('0x18')][_0x4fa9('0x19')]===undefined?!![]:![]:!![],'where':_0x4f58bd[_0x4fa9('0x18')]?_0x4f58bd[_0x4fa9('0x18')]['where']||null:null,'attributes':_0x4f58bd[_0x4fa9('0x18')]?_0x4f58bd[_0x4fa9('0x18')][_0x4fa9('0x1a')]||null:null,'limit':_0x4f58bd['options']?_0x4f58bd[_0x4fa9('0x18')][_0x4fa9('0x1b')]||null:null,'include':_0x4f58bd[_0x4fa9('0x18')]?_0x4f58bd[_0x4fa9('0x18')][_0x4fa9('0x1c')]?_[_0x4fa9('0x1d')](_0x4f58bd[_0x4fa9('0x18')][_0x4fa9('0x1c')],function(_0x185806){return{'model':db[_0x185806[_0x4fa9('0x1e')]],'as':_0x185806['as'],'attributes':_0x185806[_0x4fa9('0x1a')],'include':_0x185806[_0x4fa9('0x1c')]?_[_0x4fa9('0x1d')](_0x185806[_0x4fa9('0x1c')],function(_0x1d00c9){return{'model':db[_0x1d00c9[_0x4fa9('0x1e')]],'as':_0x1d00c9['as'],'attributes':_0x1d00c9[_0x4fa9('0x1a')],'include':_0x1d00c9[_0x4fa9('0x1c')]?_[_0x4fa9('0x1d')](_0x1d00c9[_0x4fa9('0x1c')],function(_0x498a6f){return{'model':db[_0x498a6f[_0x4fa9('0x1e')]],'as':_0x498a6f['as'],'attributes':_0x498a6f[_0x4fa9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4fa9('0x1f')](function(_0xdeffbf){logger[_0x4fa9('0xc')](_0x4fa9('0x16'),_0x4f58bd);logger[_0x4fa9('0xe')]('GetZohoAccount',_0x4f58bd,JSON[_0x4fa9('0x10')](_0xdeffbf));_0x416e08(_0xdeffbf);})[_0x4fa9('0x15')](function(_0x13cf76){logger[_0x4fa9('0x11')](_0x4fa9('0x16'),_0x13cf76[_0x4fa9('0x13')],_0x4f58bd);_0x50a0d9(_0x2fe920[_0x4fa9('0x11')](0x1f4,_0x13cf76[_0x4fa9('0x13')]));});});};exports[_0x4fa9('0x20')]=function(_0x472173){var _0x1efb9d=this;return new Promise(function(_0x8aae26,_0x3b4b88){return db[_0x4fa9('0x17')][_0x4fa9('0x21')]({'raw':_0x472173[_0x4fa9('0x18')]?_0x472173[_0x4fa9('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x472173[_0x4fa9('0x18')]?_0x472173[_0x4fa9('0x18')][_0x4fa9('0x22')]||null:null,'attributes':_0x472173[_0x4fa9('0x18')]?_0x472173[_0x4fa9('0x18')][_0x4fa9('0x1a')]||null:null,'include':_0x472173['options']?_0x472173[_0x4fa9('0x18')][_0x4fa9('0x1c')]?_[_0x4fa9('0x1d')](_0x472173['options'][_0x4fa9('0x1c')],function(_0x4c14fd){return{'model':db[_0x4c14fd['model']],'as':_0x4c14fd['as'],'attributes':_0x4c14fd[_0x4fa9('0x1a')],'include':_0x4c14fd['include']?_[_0x4fa9('0x1d')](_0x4c14fd[_0x4fa9('0x1c')],function(_0x2e9e10){return{'model':db[_0x2e9e10[_0x4fa9('0x1e')]],'as':_0x2e9e10['as'],'attributes':_0x2e9e10['attributes'],'include':_0x2e9e10[_0x4fa9('0x1c')]?_[_0x4fa9('0x1d')](_0x2e9e10[_0x4fa9('0x1c')],function(_0x4c070e){return{'model':db[_0x4c070e[_0x4fa9('0x1e')]],'as':_0x4c070e['as'],'attributes':_0x4c070e[_0x4fa9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4fa9('0x1f')](function(_0x35393e){logger[_0x4fa9('0xc')](_0x4fa9('0x20'),_0x472173);logger[_0x4fa9('0xe')](_0x4fa9('0x20'),_0x472173,JSON[_0x4fa9('0x10')](_0x35393e));_0x8aae26(_0x35393e);})[_0x4fa9('0x15')](function(_0x2781d5){logger[_0x4fa9('0x11')]('ShowZohoAccount',_0x2781d5[_0x4fa9('0x13')],_0x472173);_0x3b4b88(_0x1efb9d['error'](0x1f4,_0x2781d5['message']));});});};
\ No newline at end of file
index a93b7a0..490c3e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5633=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x5633,0x7c));var _0x3563=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5633[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0x3563('0x0'));var util=require(_0x3563('0x1'));var path=require(_0x3563('0x2'));var timeout=require(_0x3563('0x3'));var express=require('express');var router=express[_0x3563('0x4')]();var fs_extra=require(_0x3563('0x5'));var auth=require(_0x3563('0x6'));var interaction=require(_0x3563('0x7'));var config=require('../../config/environment');var controller=require(_0x3563('0x8'));router[_0x3563('0x9')]('/',auth[_0x3563('0xa')](),controller[_0x3563('0xb')]);router['get'](_0x3563('0xc'),auth[_0x3563('0xa')](),controller[_0x3563('0xd')]);router[_0x3563('0x9')](_0x3563('0xe'),auth[_0x3563('0xa')](),controller[_0x3563('0xf')]);router['get'](_0x3563('0x10'),auth[_0x3563('0xa')](),controller[_0x3563('0x11')]);router[_0x3563('0x9')](_0x3563('0x12'),auth['isAuthenticated'](),controller[_0x3563('0x13')]);router[_0x3563('0x14')]('/',auth[_0x3563('0xa')](),controller[_0x3563('0x15')]);router[_0x3563('0x16')](_0x3563('0xc'),auth[_0x3563('0xa')](),controller['update']);router['delete'](_0x3563('0xc'),auth[_0x3563('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5c0b=['fs-extra','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5c0b,0x84));var _0xb5c0=function(_0x25b1e2,_0x14f5e2){_0x25b1e2=_0x25b1e2-0x0;var _0x4a5ff5=_0x5c0b[_0x25b1e2];return _0x4a5ff5;};'use strict';var multer=require(_0xb5c0('0x0'));var util=require(_0xb5c0('0x1'));var path=require(_0xb5c0('0x2'));var timeout=require(_0xb5c0('0x3'));var express=require(_0xb5c0('0x4'));var router=express[_0xb5c0('0x5')]();var fs_extra=require(_0xb5c0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5c0('0x7'));var controller=require(_0xb5c0('0x8'));router[_0xb5c0('0x9')]('/',auth[_0xb5c0('0xa')](),controller[_0xb5c0('0xb')]);router[_0xb5c0('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb5c0('0x9')](_0xb5c0('0xc'),auth[_0xb5c0('0xa')](),controller[_0xb5c0('0xd')]);router[_0xb5c0('0x9')](_0xb5c0('0xe'),auth['isAuthenticated'](),controller[_0xb5c0('0xf')]);router[_0xb5c0('0x9')](_0xb5c0('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0xb5c0('0xa')](),controller[_0xb5c0('0x11')]);router[_0xb5c0('0x12')](_0xb5c0('0x13'),auth[_0xb5c0('0xa')](),controller['update']);router[_0xb5c0('0x14')](_0xb5c0('0x13'),auth[_0xb5c0('0xa')](),controller[_0xb5c0('0x15')]);module[_0xb5c0('0x16')]=router;
\ No newline at end of file
index 827b7d8..6703a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757b=['exports','ENUM','contact','lead','contact_lead','sequelize'];(function(_0xbf48eb,_0x54fb10){var _0x306c75=function(_0x408cab){while(--_0x408cab){_0xbf48eb['push'](_0xbf48eb['shift']());}};_0x306c75(++_0x54fb10);}(_0x757b,0xa7));var _0xb757=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x757b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb757('0x0'));module[_0xb757('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xb757('0x2')]('lead',_0xb757('0x3'),'nothing'),'defaultValue':_0xb757('0x4')},'moduleSearch':{'type':Sequelize[_0xb757('0x2')](_0xb757('0x5'),_0xb757('0x3'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5859=['lead','contact','contact_lead','STRING','sequelize','exports','ENUM','nothing'];(function(_0x40b330,_0x42458b){var _0x27ae9a=function(_0xfeece7){while(--_0xfeece7){_0x40b330['push'](_0x40b330['shift']());}};_0x27ae9a(++_0x42458b);}(_0x5859,0x13c));var _0x9585=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x5859[_0x2db12b];return _0x20990b;};'use strict';var Sequelize=require(_0x9585('0x0'));module[_0x9585('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x9585('0x2')]('lead','contact',_0x9585('0x3')),'defaultValue':_0x9585('0x4')},'moduleSearch':{'type':Sequelize[_0x9585('0x2')]('contact_lead',_0x9585('0x5'),'lead'),'defaultValue':_0x9585('0x6')},'description':{'type':Sequelize[_0x9585('0x7')]}};
\ No newline at end of file
index 1b47c4c..cb0e344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23c1=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','map','VIRTUAL','options','where','findAll','catch','show','includeAll','include','create','body','find','params','getFields','ZohoField','pick','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','error','stack','name','index','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x23c1,0x6e));var _0x123c=function(_0x1fb31d,_0x12c5e2){_0x1fb31d=_0x1fb31d-0x0;var _0x32560d=_0x23c1[_0x1fb31d];return _0x32560d;};'use strict';var emlformat=require(_0x123c('0x0'));var rimraf=require(_0x123c('0x1'));var zipdir=require(_0x123c('0x2'));var jsonpatch=require(_0x123c('0x3'));var rp=require(_0x123c('0x4'));var moment=require('moment');var BPromise=require(_0x123c('0x5'));var Mustache=require('mustache');var util=require(_0x123c('0x6'));var path=require('path');var sox=require(_0x123c('0x7'));var csv=require(_0x123c('0x8'));var ejs=require(_0x123c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x123c('0xa'));var crypto=require(_0x123c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x123c('0x8'));var querystring=require('querystring');var Papa=require(_0x123c('0xc'));var Redis=require(_0x123c('0xd'));var authService=require(_0x123c('0xe'));var qs=require(_0x123c('0xf'));var as=require(_0x123c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x123c('0x11'))(_0x123c('0x12'));var utils=require(_0x123c('0x13'));var config=require(_0x123c('0x14'));var licenseUtil=require(_0x123c('0x15'));var db=require(_0x123c('0x16'))['db'];function respondWithStatusCode(_0x54797f,_0x9b5228){_0x9b5228=_0x9b5228||0xcc;return function(_0x54736e){if(_0x54736e){return _0x54797f[_0x123c('0x17')](_0x9b5228);}return _0x54797f[_0x123c('0x18')](_0x9b5228)[_0x123c('0x19')]();};}function respondWithResult(_0x9b0455,_0x379861){_0x379861=_0x379861||0xc8;return function(_0x424966){if(_0x424966){return _0x9b0455[_0x123c('0x18')](_0x379861)['json'](_0x424966);}};}function respondWithFilteredResult(_0x294ecf,_0x57ae65){return function(_0x34dc5d){if(_0x34dc5d){var _0x3df6cd=typeof _0x57ae65[_0x123c('0x1a')]===_0x123c('0x1b')&&typeof _0x57ae65[_0x123c('0x1c')]==='undefined';var _0x26b2c7=_0x34dc5d[_0x123c('0x1d')];var _0x6b0f2d=_0x3df6cd?0x0:_0x57ae65[_0x123c('0x1a')];var _0x5ec296=_0x3df6cd?_0x34dc5d[_0x123c('0x1d')]:_0x57ae65[_0x123c('0x1a')]+_0x57ae65['limit'];var _0x11e901;if(_0x5ec296>=_0x26b2c7){_0x5ec296=_0x26b2c7;_0x11e901=0xc8;}else{_0x11e901=0xce;}_0x294ecf[_0x123c('0x18')](_0x11e901);return _0x294ecf[_0x123c('0x1e')](_0x123c('0x1f'),_0x6b0f2d+'-'+_0x5ec296+'/'+_0x26b2c7)[_0x123c('0x20')](_0x34dc5d);}return null;};}function patchUpdates(_0x4715b3){return function(_0x27d4a6){try{jsonpatch[_0x123c('0x21')](_0x27d4a6,_0x4715b3,!![]);}catch(_0x1feec5){return BPromise['reject'](_0x1feec5);}return _0x27d4a6['save']();};}function saveUpdates(_0x514aea,_0x4aa7b1){return function(_0x2b0c36){if(_0x2b0c36){return _0x2b0c36[_0x123c('0x22')](_0x514aea)[_0x123c('0x23')](function(_0x5f3eed){return _0x5f3eed;});}return null;};}function removeEntity(_0x15d0cc,_0x20197e){return function(_0x1dcdda){if(_0x1dcdda){return _0x1dcdda[_0x123c('0x24')]()[_0x123c('0x23')](function(){_0x15d0cc[_0x123c('0x18')](0xcc)[_0x123c('0x19')]();});}};}function handleEntityNotFound(_0x489ddd,_0x559f0c){return function(_0x5e60c3){if(!_0x5e60c3){_0x489ddd[_0x123c('0x17')](0x194);}return _0x5e60c3;};}function handleError(_0x5892e4,_0x157870){_0x157870=_0x157870||0x1f4;return function(_0x270cef){logger[_0x123c('0x25')](_0x270cef[_0x123c('0x26')]);if(_0x270cef[_0x123c('0x27')]){delete _0x270cef[_0x123c('0x27')];}_0x5892e4[_0x123c('0x18')](_0x157870)['send'](_0x270cef);};}exports[_0x123c('0x28')]=function(_0x1517bd,_0xf9d5d5){var _0x478a0c={},_0x2cf26f={},_0x5bf595={'count':0x0,'rows':[]};var _0x16af3f=_['map'](db[_0x123c('0x29')][_0x123c('0x2a')],function(_0x3e1835){return{'name':_0x3e1835[_0x123c('0x2b')],'type':_0x3e1835[_0x123c('0x2c')][_0x123c('0x2d')]};});_0x2cf26f[_0x123c('0x2e')]=_['map'](_0x16af3f,_0x123c('0x27'));_0x2cf26f['query']=_[_0x123c('0x2f')](_0x1517bd[_0x123c('0x30')]);_0x2cf26f['filters']=_[_0x123c('0x31')](_0x2cf26f['model'],_0x2cf26f[_0x123c('0x30')]);_0x478a0c[_0x123c('0x32')]=_[_0x123c('0x31')](_0x2cf26f['model'],qs[_0x123c('0x33')](_0x1517bd['query'][_0x123c('0x33')]));_0x478a0c['attributes']=_0x478a0c[_0x123c('0x32')][_0x123c('0x34')]?_0x478a0c[_0x123c('0x32')]:_0x2cf26f[_0x123c('0x2e')];if(!_0x1517bd['query'][_0x123c('0x35')](_0x123c('0x36'))){_0x478a0c[_0x123c('0x1c')]=qs['limit'](_0x1517bd[_0x123c('0x30')][_0x123c('0x1c')]);_0x478a0c[_0x123c('0x1a')]=qs[_0x123c('0x1a')](_0x1517bd[_0x123c('0x30')][_0x123c('0x1a')]);}_0x478a0c[_0x123c('0x37')]=qs[_0x123c('0x38')](_0x1517bd['query'][_0x123c('0x38')]);_0x478a0c['where']=qs[_0x123c('0x39')](_['pick'](_0x1517bd[_0x123c('0x30')],_0x2cf26f[_0x123c('0x39')]),_0x16af3f);if(_0x1517bd[_0x123c('0x30')][_0x123c('0x3a')]){_0x478a0c['where']=_[_0x123c('0x3b')](_0x478a0c['where'],{'$or':_[_0x123c('0x3c')](_0x16af3f,function(_0xaa5cb7){if(_0xaa5cb7['type']!==_0x123c('0x3d')){var _0x259569={};_0x259569[_0xaa5cb7[_0x123c('0x27')]]={'$like':'%'+_0x1517bd[_0x123c('0x30')]['filter']+'%'};return _0x259569;}})});}_0x478a0c=_['merge']({},_0x478a0c,_0x1517bd[_0x123c('0x3e')]);var _0x414e5e={'where':_0x478a0c[_0x123c('0x3f')]};return db['ZohoConfiguration'][_0x123c('0x1d')](_0x414e5e)['then'](function(_0x534ef5){_0x5bf595['count']=_0x534ef5;if(_0x1517bd[_0x123c('0x30')]['includeAll']){_0x478a0c['include']=[{'all':!![]}];}return db[_0x123c('0x29')][_0x123c('0x40')](_0x478a0c);})[_0x123c('0x23')](function(_0x4b0b26){_0x5bf595['rows']=_0x4b0b26;return _0x5bf595;})[_0x123c('0x23')](respondWithFilteredResult(_0xf9d5d5,_0x478a0c))[_0x123c('0x41')](handleError(_0xf9d5d5,null));};exports[_0x123c('0x42')]=function(_0x15ac3a,_0x2fa7c1){var _0x11f2b8={'raw':![],'where':{'id':_0x15ac3a['params']['id']}},_0x4f523b={};_0x4f523b['model']=_[_0x123c('0x2f')](db[_0x123c('0x29')][_0x123c('0x2a')]);_0x4f523b['query']=_['keys'](_0x15ac3a[_0x123c('0x30')]);_0x4f523b[_0x123c('0x39')]=_['intersection'](_0x4f523b[_0x123c('0x2e')],_0x4f523b[_0x123c('0x30')]);_0x11f2b8['attributes']=_['intersection'](_0x4f523b[_0x123c('0x2e')],qs[_0x123c('0x33')](_0x15ac3a[_0x123c('0x30')]['fields']));_0x11f2b8[_0x123c('0x32')]=_0x11f2b8[_0x123c('0x32')]['length']?_0x11f2b8['attributes']:_0x4f523b[_0x123c('0x2e')];if(_0x15ac3a[_0x123c('0x30')][_0x123c('0x43')]){_0x11f2b8[_0x123c('0x44')]=[{'all':!![]}];}_0x11f2b8=_[_0x123c('0x3b')]({},_0x11f2b8,_0x15ac3a[_0x123c('0x3e')]);return db['ZohoConfiguration']['find'](_0x11f2b8)[_0x123c('0x23')](handleEntityNotFound(_0x2fa7c1,null))[_0x123c('0x23')](respondWithResult(_0x2fa7c1,null))[_0x123c('0x41')](handleError(_0x2fa7c1,null));};exports[_0x123c('0x45')]=function(_0x3cb51c,_0x5dbc2d){return db['ZohoConfiguration'][_0x123c('0x45')](_0x3cb51c[_0x123c('0x46')],{})[_0x123c('0x23')](respondWithResult(_0x5dbc2d,0xc9))[_0x123c('0x41')](handleError(_0x5dbc2d,null));};exports['update']=function(_0x18a3b5,_0x45ea1b){if(_0x18a3b5[_0x123c('0x46')]['id']){delete _0x18a3b5[_0x123c('0x46')]['id'];}return db[_0x123c('0x29')][_0x123c('0x47')]({'where':{'id':_0x18a3b5[_0x123c('0x48')]['id']}})['then'](handleEntityNotFound(_0x45ea1b,null))['then'](saveUpdates(_0x18a3b5[_0x123c('0x46')],null))[_0x123c('0x23')](respondWithResult(_0x45ea1b,null))[_0x123c('0x41')](handleError(_0x45ea1b,null));};exports[_0x123c('0x24')]=function(_0x307cf2,_0x41efd9){return db['ZohoConfiguration'][_0x123c('0x47')]({'where':{'id':_0x307cf2['params']['id']}})[_0x123c('0x23')](handleEntityNotFound(_0x41efd9,null))[_0x123c('0x23')](removeEntity(_0x41efd9,null))[_0x123c('0x41')](handleError(_0x41efd9,null));};exports[_0x123c('0x49')]=function(_0x368729,_0x48371e,_0x340a58){var _0x22ffa3={};var _0x1fcf67={};var _0x2c3057;var _0xea586d;return db[_0x123c('0x29')]['findOne']({'where':{'id':_0x368729[_0x123c('0x48')]['id']}})['then'](handleEntityNotFound(_0x48371e,null))[_0x123c('0x23')](function(_0xb5747a){if(_0xb5747a){_0x2c3057=_0xb5747a;_0x1fcf67[_0x123c('0x2e')]=_[_0x123c('0x2f')](db[_0x123c('0x4a')][_0x123c('0x2a')]);_0x1fcf67[_0x123c('0x30')]=_[_0x123c('0x2f')](_0x368729[_0x123c('0x30')]);_0x1fcf67[_0x123c('0x39')]=_[_0x123c('0x31')](_0x1fcf67[_0x123c('0x2e')],_0x1fcf67['query']);_0x22ffa3[_0x123c('0x32')]=_[_0x123c('0x31')](_0x1fcf67['model'],qs[_0x123c('0x33')](_0x368729[_0x123c('0x30')]['fields']));_0x22ffa3[_0x123c('0x32')]=_0x22ffa3[_0x123c('0x32')][_0x123c('0x34')]?_0x22ffa3['attributes']:_0x1fcf67[_0x123c('0x2e')];_0x22ffa3[_0x123c('0x37')]=qs[_0x123c('0x38')](_0x368729['query'][_0x123c('0x38')]);_0x22ffa3[_0x123c('0x3f')]=qs['filters'](_[_0x123c('0x4b')](_0x368729[_0x123c('0x30')],_0x1fcf67[_0x123c('0x39')]));if(_0x368729[_0x123c('0x30')][_0x123c('0x3a')]){_0x22ffa3['where']=_[_0x123c('0x3b')](_0x22ffa3['where'],{'$or':_[_0x123c('0x3c')](_0x22ffa3[_0x123c('0x32')],function(_0x29ba13){var _0x5d5a74={};_0x5d5a74[_0x29ba13]={'$like':'%'+_0x368729['query'][_0x123c('0x3a')]+'%'};return _0x5d5a74;})});}_0x22ffa3=_['merge']({},_0x22ffa3,_0x368729[_0x123c('0x3e')]);return _0x2c3057[_0x123c('0x49')](_0x22ffa3);}})['then'](function(_0x3093b0){if(_0x3093b0){_0xea586d=_0x3093b0['length'];if(!_0x368729[_0x123c('0x30')][_0x123c('0x35')](_0x123c('0x36'))){_0x22ffa3[_0x123c('0x1c')]=qs['limit'](_0x368729[_0x123c('0x30')][_0x123c('0x1c')]);_0x22ffa3[_0x123c('0x1a')]=qs[_0x123c('0x1a')](_0x368729[_0x123c('0x30')]['offset']);}return _0x2c3057[_0x123c('0x49')](_0x22ffa3);}})[_0x123c('0x23')](function(_0x2b1785){if(_0x2b1785){return _0x2b1785?{'count':_0xea586d,'rows':_0x2b1785}:null;}})[_0x123c('0x23')](respondWithResult(_0x48371e,null))[_0x123c('0x41')](handleError(_0x48371e,null));};exports[_0x123c('0x4c')]=function(_0x316510,_0x32e157,_0x7f98dc){var _0x28f3d2={};var _0xfdd28d={};var _0xf63c21;var _0x597ef9;return db['ZohoConfiguration'][_0x123c('0x4d')]({'where':{'id':_0x316510[_0x123c('0x48')]['id']}})[_0x123c('0x23')](handleEntityNotFound(_0x32e157,null))[_0x123c('0x23')](function(_0x2e7dcc){if(_0x2e7dcc){_0xf63c21=_0x2e7dcc;_0xfdd28d[_0x123c('0x2e')]=_['keys'](db['ZohoField']['rawAttributes']);_0xfdd28d[_0x123c('0x30')]=_['keys'](_0x316510[_0x123c('0x30')]);_0xfdd28d[_0x123c('0x39')]=_[_0x123c('0x31')](_0xfdd28d[_0x123c('0x2e')],_0xfdd28d[_0x123c('0x30')]);_0x28f3d2[_0x123c('0x32')]=_[_0x123c('0x31')](_0xfdd28d['model'],qs[_0x123c('0x33')](_0x316510['query'][_0x123c('0x33')]));_0x28f3d2[_0x123c('0x32')]=_0x28f3d2[_0x123c('0x32')][_0x123c('0x34')]?_0x28f3d2[_0x123c('0x32')]:_0xfdd28d[_0x123c('0x2e')];_0x28f3d2[_0x123c('0x37')]=qs['sort'](_0x316510[_0x123c('0x30')][_0x123c('0x38')]);_0x28f3d2[_0x123c('0x3f')]=qs['filters'](_['pick'](_0x316510[_0x123c('0x30')],_0xfdd28d[_0x123c('0x39')]));if(_0x316510[_0x123c('0x30')][_0x123c('0x3a')]){_0x28f3d2[_0x123c('0x3f')]=_[_0x123c('0x3b')](_0x28f3d2['where'],{'$or':_['map'](_0x28f3d2[_0x123c('0x32')],function(_0x571b7b){var _0x4084c2={};_0x4084c2[_0x571b7b]={'$like':'%'+_0x316510[_0x123c('0x30')][_0x123c('0x3a')]+'%'};return _0x4084c2;})});}_0x28f3d2=_[_0x123c('0x3b')]({},_0x28f3d2,_0x316510[_0x123c('0x3e')]);return _0xf63c21[_0x123c('0x4c')](_0x28f3d2);}})['then'](function(_0x3d940d){if(_0x3d940d){_0x597ef9=_0x3d940d['length'];if(!_0x316510['query']['hasOwnProperty'](_0x123c('0x36'))){_0x28f3d2[_0x123c('0x1c')]=qs['limit'](_0x316510[_0x123c('0x30')][_0x123c('0x1c')]);_0x28f3d2[_0x123c('0x1a')]=qs[_0x123c('0x1a')](_0x316510[_0x123c('0x30')][_0x123c('0x1a')]);}return _0xf63c21['getSubjects'](_0x28f3d2);}})[_0x123c('0x23')](function(_0x480fa0){if(_0x480fa0){return _0x480fa0?{'count':_0x597ef9,'rows':_0x480fa0}:null;}})[_0x123c('0x23')](respondWithResult(_0x32e157,null))[_0x123c('0x41')](handleError(_0x32e157,null));};exports['getDescriptions']=function(_0x597611,_0xdf9c59,_0x2eda8d){var _0x10e43e={};var _0x35b682={};var _0x9e868;var _0xaacbbe;return db[_0x123c('0x29')][_0x123c('0x4d')]({'where':{'id':_0x597611[_0x123c('0x48')]['id']}})[_0x123c('0x23')](handleEntityNotFound(_0xdf9c59,null))[_0x123c('0x23')](function(_0x5bc1b6){if(_0x5bc1b6){_0x9e868=_0x5bc1b6;_0x35b682['model']=_[_0x123c('0x2f')](db['ZohoField'][_0x123c('0x2a')]);_0x35b682['query']=_[_0x123c('0x2f')](_0x597611[_0x123c('0x30')]);_0x35b682[_0x123c('0x39')]=_[_0x123c('0x31')](_0x35b682[_0x123c('0x2e')],_0x35b682[_0x123c('0x30')]);_0x10e43e['attributes']=_['intersection'](_0x35b682['model'],qs[_0x123c('0x33')](_0x597611[_0x123c('0x30')]['fields']));_0x10e43e[_0x123c('0x32')]=_0x10e43e[_0x123c('0x32')][_0x123c('0x34')]?_0x10e43e[_0x123c('0x32')]:_0x35b682[_0x123c('0x2e')];_0x10e43e[_0x123c('0x37')]=qs['sort'](_0x597611[_0x123c('0x30')][_0x123c('0x38')]);_0x10e43e[_0x123c('0x3f')]=qs['filters'](_[_0x123c('0x4b')](_0x597611['query'],_0x35b682[_0x123c('0x39')]));if(_0x597611[_0x123c('0x30')][_0x123c('0x3a')]){_0x10e43e[_0x123c('0x3f')]=_[_0x123c('0x3b')](_0x10e43e[_0x123c('0x3f')],{'$or':_[_0x123c('0x3c')](_0x10e43e[_0x123c('0x32')],function(_0x2c3017){var _0x23aec0={};_0x23aec0[_0x2c3017]={'$like':'%'+_0x597611[_0x123c('0x30')]['filter']+'%'};return _0x23aec0;})});}_0x10e43e=_['merge']({},_0x10e43e,_0x597611[_0x123c('0x3e')]);return _0x9e868[_0x123c('0x4e')](_0x10e43e);}})['then'](function(_0x590107){if(_0x590107){_0xaacbbe=_0x590107['length'];if(!_0x597611['query'][_0x123c('0x35')](_0x123c('0x36'))){_0x10e43e['limit']=qs[_0x123c('0x1c')](_0x597611[_0x123c('0x30')][_0x123c('0x1c')]);_0x10e43e[_0x123c('0x1a')]=qs[_0x123c('0x1a')](_0x597611[_0x123c('0x30')][_0x123c('0x1a')]);}return _0x9e868['getDescriptions'](_0x10e43e);}})['then'](function(_0x1316f5){if(_0x1316f5){return _0x1316f5?{'count':_0xaacbbe,'rows':_0x1316f5}:null;}})[_0x123c('0x23')](respondWithResult(_0xdf9c59,null))['catch'](handleError(_0xdf9c59,null));};
\ No newline at end of file
+var _0x379f=['hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','rows','catch','params','includeAll','include','find','create','ZohoField','order','sort','pick','findOne','rawAttributes','fields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','length'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x379f,0x1f1));var _0xf379=function(_0x1fe7e3,_0x50e44f){_0x1fe7e3=_0x1fe7e3-0x0;var _0x4cf505=_0x379f[_0x1fe7e3];return _0x4cf505;};'use strict';var emlformat=require(_0xf379('0x0'));var rimraf=require(_0xf379('0x1'));var zipdir=require(_0xf379('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf379('0x3'));var moment=require(_0xf379('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf379('0x5'));var util=require(_0xf379('0x6'));var path=require('path');var sox=require(_0xf379('0x7'));var csv=require('to-csv');var ejs=require(_0xf379('0x8'));var fs=require('fs');var fs_extra=require(_0xf379('0x9'));var _=require(_0xf379('0xa'));var squel=require(_0xf379('0xb'));var crypto=require('crypto');var jsforce=require(_0xf379('0xc'));var deskjs=require(_0xf379('0xd'));var toCsv=require(_0xf379('0xe'));var querystring=require(_0xf379('0xf'));var Papa=require(_0xf379('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf379('0x11'));var as=require(_0xf379('0x12'));var hardwareService=require(_0xf379('0x13'));var logger=require(_0xf379('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xf379('0x15'));var licenseUtil=require(_0xf379('0x16'));var db=require(_0xf379('0x17'))['db'];function respondWithStatusCode(_0x4a733e,_0x141f7f){_0x141f7f=_0x141f7f||0xcc;return function(_0x3bf5ee){if(_0x3bf5ee){return _0x4a733e[_0xf379('0x18')](_0x141f7f);}return _0x4a733e[_0xf379('0x19')](_0x141f7f)[_0xf379('0x1a')]();};}function respondWithResult(_0x11b95d,_0x109ba4){_0x109ba4=_0x109ba4||0xc8;return function(_0x5c7925){if(_0x5c7925){return _0x11b95d[_0xf379('0x19')](_0x109ba4)['json'](_0x5c7925);}};}function respondWithFilteredResult(_0x3e1762,_0x2f9531){return function(_0x42492c){if(_0x42492c){var _0x13fd46=typeof _0x2f9531[_0xf379('0x1b')]===_0xf379('0x1c')&&typeof _0x2f9531[_0xf379('0x1d')]===_0xf379('0x1c');var _0x1b0d1c=_0x42492c[_0xf379('0x1e')];var _0xab7f33=_0x13fd46?0x0:_0x2f9531['offset'];var _0x16bf2a=_0x13fd46?_0x42492c[_0xf379('0x1e')]:_0x2f9531['offset']+_0x2f9531['limit'];var _0x7fdf4d;if(_0x16bf2a>=_0x1b0d1c){_0x16bf2a=_0x1b0d1c;_0x7fdf4d=0xc8;}else{_0x7fdf4d=0xce;}_0x3e1762[_0xf379('0x19')](_0x7fdf4d);return _0x3e1762[_0xf379('0x1f')](_0xf379('0x20'),_0xab7f33+'-'+_0x16bf2a+'/'+_0x1b0d1c)[_0xf379('0x21')](_0x42492c);}return null;};}function patchUpdates(_0x17cb4c){return function(_0x2d87ac){try{jsonpatch[_0xf379('0x22')](_0x2d87ac,_0x17cb4c,!![]);}catch(_0x5ee311){return BPromise[_0xf379('0x23')](_0x5ee311);}return _0x2d87ac[_0xf379('0x24')]();};}function saveUpdates(_0x2ae43f,_0x55b7a4){return function(_0x2de4e6){if(_0x2de4e6){return _0x2de4e6[_0xf379('0x25')](_0x2ae43f)[_0xf379('0x26')](function(_0x40b708){return _0x40b708;});}return null;};}function removeEntity(_0x25759c,_0x5338ca){return function(_0x355106){if(_0x355106){return _0x355106[_0xf379('0x27')]()[_0xf379('0x26')](function(){_0x25759c[_0xf379('0x19')](0xcc)[_0xf379('0x1a')]();});}};}function handleEntityNotFound(_0x2e6237,_0x2796fb){return function(_0x5d1704){if(!_0x5d1704){_0x2e6237['sendStatus'](0x194);}return _0x5d1704;};}function handleError(_0x3cbde0,_0xdcabb3){_0xdcabb3=_0xdcabb3||0x1f4;return function(_0x320e5c){logger[_0xf379('0x28')](_0x320e5c['stack']);if(_0x320e5c[_0xf379('0x29')]){delete _0x320e5c[_0xf379('0x29')];}_0x3cbde0[_0xf379('0x19')](_0xdcabb3)[_0xf379('0x2a')](_0x320e5c);};}exports[_0xf379('0x2b')]=function(_0x3e7d5e,_0x29871f){var _0x59798f={},_0x5a9c84={},_0x5017cc={'count':0x0,'rows':[]};var _0x177d11=_[_0xf379('0x2c')](db[_0xf379('0x2d')]['rawAttributes'],function(_0x2d9157){return{'name':_0x2d9157[_0xf379('0x2e')],'type':_0x2d9157[_0xf379('0x2f')][_0xf379('0x30')]};});_0x5a9c84[_0xf379('0x31')]=_[_0xf379('0x2c')](_0x177d11,_0xf379('0x29'));_0x5a9c84[_0xf379('0x32')]=_[_0xf379('0x33')](_0x3e7d5e[_0xf379('0x32')]);_0x5a9c84[_0xf379('0x34')]=_[_0xf379('0x35')](_0x5a9c84[_0xf379('0x31')],_0x5a9c84[_0xf379('0x32')]);_0x59798f[_0xf379('0x36')]=_[_0xf379('0x35')](_0x5a9c84[_0xf379('0x31')],qs['fields'](_0x3e7d5e[_0xf379('0x32')]['fields']));_0x59798f[_0xf379('0x36')]=_0x59798f[_0xf379('0x36')][_0xf379('0x37')]?_0x59798f['attributes']:_0x5a9c84[_0xf379('0x31')];if(!_0x3e7d5e[_0xf379('0x32')][_0xf379('0x38')](_0xf379('0x39'))){_0x59798f[_0xf379('0x1d')]=qs[_0xf379('0x1d')](_0x3e7d5e[_0xf379('0x32')]['limit']);_0x59798f[_0xf379('0x1b')]=qs[_0xf379('0x1b')](_0x3e7d5e[_0xf379('0x32')]['offset']);}_0x59798f['order']=qs['sort'](_0x3e7d5e['query']['sort']);_0x59798f[_0xf379('0x3a')]=qs[_0xf379('0x34')](_['pick'](_0x3e7d5e[_0xf379('0x32')],_0x5a9c84[_0xf379('0x34')]),_0x177d11);if(_0x3e7d5e[_0xf379('0x32')][_0xf379('0x3b')]){_0x59798f[_0xf379('0x3a')]=_[_0xf379('0x3c')](_0x59798f['where'],{'$or':_[_0xf379('0x2c')](_0x177d11,function(_0x421a25){if(_0x421a25['type']!==_0xf379('0x3d')){var _0x4e4777={};_0x4e4777[_0x421a25['name']]={'$like':'%'+_0x3e7d5e[_0xf379('0x32')][_0xf379('0x3b')]+'%'};return _0x4e4777;}})});}_0x59798f=_[_0xf379('0x3c')]({},_0x59798f,_0x3e7d5e[_0xf379('0x3e')]);var _0xf8bf6e={'where':_0x59798f[_0xf379('0x3a')]};return db['ZohoConfiguration']['count'](_0xf8bf6e)[_0xf379('0x26')](function(_0x20acd0){_0x5017cc['count']=_0x20acd0;if(_0x3e7d5e[_0xf379('0x32')]['includeAll']){_0x59798f['include']=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x59798f);})[_0xf379('0x26')](function(_0x571338){_0x5017cc[_0xf379('0x3f')]=_0x571338;return _0x5017cc;})[_0xf379('0x26')](respondWithFilteredResult(_0x29871f,_0x59798f))[_0xf379('0x40')](handleError(_0x29871f,null));};exports['show']=function(_0x562667,_0x2920ce){var _0x4434ef={'raw':![],'where':{'id':_0x562667[_0xf379('0x41')]['id']}},_0x12b6f8={};_0x12b6f8[_0xf379('0x31')]=_['keys'](db[_0xf379('0x2d')]['rawAttributes']);_0x12b6f8['query']=_[_0xf379('0x33')](_0x562667[_0xf379('0x32')]);_0x12b6f8[_0xf379('0x34')]=_[_0xf379('0x35')](_0x12b6f8[_0xf379('0x31')],_0x12b6f8[_0xf379('0x32')]);_0x4434ef[_0xf379('0x36')]=_[_0xf379('0x35')](_0x12b6f8[_0xf379('0x31')],qs['fields'](_0x562667[_0xf379('0x32')]['fields']));_0x4434ef[_0xf379('0x36')]=_0x4434ef['attributes']['length']?_0x4434ef[_0xf379('0x36')]:_0x12b6f8['model'];if(_0x562667['query'][_0xf379('0x42')]){_0x4434ef[_0xf379('0x43')]=[{'all':!![]}];}_0x4434ef=_[_0xf379('0x3c')]({},_0x4434ef,_0x562667[_0xf379('0x3e')]);return db[_0xf379('0x2d')][_0xf379('0x44')](_0x4434ef)[_0xf379('0x26')](handleEntityNotFound(_0x2920ce,null))[_0xf379('0x26')](respondWithResult(_0x2920ce,null))['catch'](handleError(_0x2920ce,null));};exports[_0xf379('0x45')]=function(_0x18dce7,_0x4af29e){return db['ZohoConfiguration'][_0xf379('0x45')](_0x18dce7['body'],{})[_0xf379('0x26')](respondWithResult(_0x4af29e,0xc9))[_0xf379('0x40')](handleError(_0x4af29e,null));};exports[_0xf379('0x25')]=function(_0x1a2c73,_0xd2776f){if(_0x1a2c73['body']['id']){delete _0x1a2c73['body']['id'];}return db['ZohoConfiguration'][_0xf379('0x44')]({'where':{'id':_0x1a2c73[_0xf379('0x41')]['id']}})[_0xf379('0x26')](handleEntityNotFound(_0xd2776f,null))['then'](saveUpdates(_0x1a2c73['body'],null))[_0xf379('0x26')](respondWithResult(_0xd2776f,null))[_0xf379('0x40')](handleError(_0xd2776f,null));};exports[_0xf379('0x27')]=function(_0x4c10bd,_0x224234){return db[_0xf379('0x2d')][_0xf379('0x44')]({'where':{'id':_0x4c10bd[_0xf379('0x41')]['id']}})['then'](handleEntityNotFound(_0x224234,null))[_0xf379('0x26')](removeEntity(_0x224234,null))['catch'](handleError(_0x224234,null));};exports['getFields']=function(_0x1e5c1f,_0x4ae6e1,_0x2a38b0){var _0xb4bf23={};var _0x16734d={};var _0x309b2e;var _0x272101;return db[_0xf379('0x2d')]['findOne']({'where':{'id':_0x1e5c1f[_0xf379('0x41')]['id']}})[_0xf379('0x26')](handleEntityNotFound(_0x4ae6e1,null))[_0xf379('0x26')](function(_0x295511){if(_0x295511){_0x309b2e=_0x295511;_0x16734d['model']=_[_0xf379('0x33')](db[_0xf379('0x46')]['rawAttributes']);_0x16734d['query']=_[_0xf379('0x33')](_0x1e5c1f[_0xf379('0x32')]);_0x16734d[_0xf379('0x34')]=_[_0xf379('0x35')](_0x16734d['model'],_0x16734d[_0xf379('0x32')]);_0xb4bf23['attributes']=_[_0xf379('0x35')](_0x16734d[_0xf379('0x31')],qs['fields'](_0x1e5c1f[_0xf379('0x32')]['fields']));_0xb4bf23[_0xf379('0x36')]=_0xb4bf23[_0xf379('0x36')][_0xf379('0x37')]?_0xb4bf23[_0xf379('0x36')]:_0x16734d[_0xf379('0x31')];_0xb4bf23[_0xf379('0x47')]=qs['sort'](_0x1e5c1f['query'][_0xf379('0x48')]);_0xb4bf23[_0xf379('0x3a')]=qs[_0xf379('0x34')](_[_0xf379('0x49')](_0x1e5c1f[_0xf379('0x32')],_0x16734d[_0xf379('0x34')]));if(_0x1e5c1f[_0xf379('0x32')][_0xf379('0x3b')]){_0xb4bf23[_0xf379('0x3a')]=_[_0xf379('0x3c')](_0xb4bf23[_0xf379('0x3a')],{'$or':_['map'](_0xb4bf23[_0xf379('0x36')],function(_0x27fa82){var _0x513992={};_0x513992[_0x27fa82]={'$like':'%'+_0x1e5c1f[_0xf379('0x32')][_0xf379('0x3b')]+'%'};return _0x513992;})});}_0xb4bf23=_['merge']({},_0xb4bf23,_0x1e5c1f['options']);return _0x309b2e['getFields'](_0xb4bf23);}})['then'](function(_0xe04d0c){if(_0xe04d0c){_0x272101=_0xe04d0c[_0xf379('0x37')];if(!_0x1e5c1f[_0xf379('0x32')]['hasOwnProperty']('nolimit')){_0xb4bf23[_0xf379('0x1d')]=qs[_0xf379('0x1d')](_0x1e5c1f['query'][_0xf379('0x1d')]);_0xb4bf23[_0xf379('0x1b')]=qs[_0xf379('0x1b')](_0x1e5c1f['query']['offset']);}return _0x309b2e['getFields'](_0xb4bf23);}})[_0xf379('0x26')](function(_0x452942){if(_0x452942){return _0x452942?{'count':_0x272101,'rows':_0x452942}:null;}})[_0xf379('0x26')](respondWithResult(_0x4ae6e1,null))[_0xf379('0x40')](handleError(_0x4ae6e1,null));};exports['getSubjects']=function(_0x462168,_0x521bee,_0x2d9966){var _0x5019fb={};var _0xb28546={};var _0x199cd8;var _0x263914;return db['ZohoConfiguration'][_0xf379('0x4a')]({'where':{'id':_0x462168[_0xf379('0x41')]['id']}})[_0xf379('0x26')](handleEntityNotFound(_0x521bee,null))['then'](function(_0x1f77ab){if(_0x1f77ab){_0x199cd8=_0x1f77ab;_0xb28546['model']=_[_0xf379('0x33')](db[_0xf379('0x46')][_0xf379('0x4b')]);_0xb28546['query']=_[_0xf379('0x33')](_0x462168[_0xf379('0x32')]);_0xb28546[_0xf379('0x34')]=_[_0xf379('0x35')](_0xb28546[_0xf379('0x31')],_0xb28546[_0xf379('0x32')]);_0x5019fb[_0xf379('0x36')]=_[_0xf379('0x35')](_0xb28546[_0xf379('0x31')],qs['fields'](_0x462168[_0xf379('0x32')][_0xf379('0x4c')]));_0x5019fb[_0xf379('0x36')]=_0x5019fb[_0xf379('0x36')]['length']?_0x5019fb[_0xf379('0x36')]:_0xb28546[_0xf379('0x31')];_0x5019fb['order']=qs[_0xf379('0x48')](_0x462168['query']['sort']);_0x5019fb[_0xf379('0x3a')]=qs[_0xf379('0x34')](_[_0xf379('0x49')](_0x462168[_0xf379('0x32')],_0xb28546[_0xf379('0x34')]));if(_0x462168[_0xf379('0x32')][_0xf379('0x3b')]){_0x5019fb['where']=_['merge'](_0x5019fb['where'],{'$or':_['map'](_0x5019fb['attributes'],function(_0x414cd8){var _0xfd74e6={};_0xfd74e6[_0x414cd8]={'$like':'%'+_0x462168[_0xf379('0x32')][_0xf379('0x3b')]+'%'};return _0xfd74e6;})});}_0x5019fb=_[_0xf379('0x3c')]({},_0x5019fb,_0x462168[_0xf379('0x3e')]);return _0x199cd8[_0xf379('0x4d')](_0x5019fb);}})[_0xf379('0x26')](function(_0x4eaa71){if(_0x4eaa71){_0x263914=_0x4eaa71[_0xf379('0x37')];if(!_0x462168[_0xf379('0x32')]['hasOwnProperty'](_0xf379('0x39'))){_0x5019fb[_0xf379('0x1d')]=qs[_0xf379('0x1d')](_0x462168[_0xf379('0x32')][_0xf379('0x1d')]);_0x5019fb[_0xf379('0x1b')]=qs[_0xf379('0x1b')](_0x462168['query'][_0xf379('0x1b')]);}return _0x199cd8['getSubjects'](_0x5019fb);}})[_0xf379('0x26')](function(_0x1eda8e){if(_0x1eda8e){return _0x1eda8e?{'count':_0x263914,'rows':_0x1eda8e}:null;}})[_0xf379('0x26')](respondWithResult(_0x521bee,null))[_0xf379('0x40')](handleError(_0x521bee,null));};exports[_0xf379('0x4e')]=function(_0x5c42f5,_0x23b77c,_0x31f948){var _0x5d6141={};var _0x35f6b3={};var _0x54bc54;var _0x2b3dda;return db[_0xf379('0x2d')]['findOne']({'where':{'id':_0x5c42f5['params']['id']}})[_0xf379('0x26')](handleEntityNotFound(_0x23b77c,null))['then'](function(_0x5f2ff4){if(_0x5f2ff4){_0x54bc54=_0x5f2ff4;_0x35f6b3[_0xf379('0x31')]=_[_0xf379('0x33')](db['ZohoField']['rawAttributes']);_0x35f6b3['query']=_[_0xf379('0x33')](_0x5c42f5[_0xf379('0x32')]);_0x35f6b3[_0xf379('0x34')]=_[_0xf379('0x35')](_0x35f6b3['model'],_0x35f6b3[_0xf379('0x32')]);_0x5d6141[_0xf379('0x36')]=_[_0xf379('0x35')](_0x35f6b3['model'],qs[_0xf379('0x4c')](_0x5c42f5[_0xf379('0x32')][_0xf379('0x4c')]));_0x5d6141[_0xf379('0x36')]=_0x5d6141[_0xf379('0x36')]['length']?_0x5d6141[_0xf379('0x36')]:_0x35f6b3['model'];_0x5d6141[_0xf379('0x47')]=qs[_0xf379('0x48')](_0x5c42f5['query'][_0xf379('0x48')]);_0x5d6141['where']=qs['filters'](_['pick'](_0x5c42f5[_0xf379('0x32')],_0x35f6b3[_0xf379('0x34')]));if(_0x5c42f5[_0xf379('0x32')]['filter']){_0x5d6141['where']=_[_0xf379('0x3c')](_0x5d6141[_0xf379('0x3a')],{'$or':_[_0xf379('0x2c')](_0x5d6141[_0xf379('0x36')],function(_0x14d0c6){var _0x174aba={};_0x174aba[_0x14d0c6]={'$like':'%'+_0x5c42f5[_0xf379('0x32')]['filter']+'%'};return _0x174aba;})});}_0x5d6141=_[_0xf379('0x3c')]({},_0x5d6141,_0x5c42f5[_0xf379('0x3e')]);return _0x54bc54[_0xf379('0x4e')](_0x5d6141);}})[_0xf379('0x26')](function(_0x279089){if(_0x279089){_0x2b3dda=_0x279089[_0xf379('0x37')];if(!_0x5c42f5[_0xf379('0x32')]['hasOwnProperty'](_0xf379('0x39'))){_0x5d6141[_0xf379('0x1d')]=qs[_0xf379('0x1d')](_0x5c42f5[_0xf379('0x32')]['limit']);_0x5d6141[_0xf379('0x1b')]=qs[_0xf379('0x1b')](_0x5c42f5[_0xf379('0x32')][_0xf379('0x1b')]);}return _0x54bc54[_0xf379('0x4e')](_0x5d6141);}})['then'](function(_0x1aeb5b){if(_0x1aeb5b){return _0x1aeb5b?{'count':_0x2b3dda,'rows':_0x1aeb5b}:null;}})['then'](respondWithResult(_0x23b77c,null))[_0xf379('0x40')](handleError(_0x23b77c,null));};
\ No newline at end of file
index a121199..1f06a5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc17=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash'];(function(_0x48c9f9,_0x11f9e2){var _0x573d80=function(_0x18b4ef){while(--_0x18b4ef){_0x48c9f9['push'](_0x48c9f9['shift']());}};_0x573d80(++_0x11f9e2);}(_0xcc17,0xc3));var _0x7cc1=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0xcc17[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require(_0x7cc1('0x0'));var util=require(_0x7cc1('0x1'));var logger=require(_0x7cc1('0x2'))(_0x7cc1('0x3'));var moment=require(_0x7cc1('0x4'));var BPromise=require(_0x7cc1('0x5'));var rp=require(_0x7cc1('0x6'));var fs=require('fs');var path=require(_0x7cc1('0x7'));var rimraf=require(_0x7cc1('0x8'));var config=require(_0x7cc1('0x9'));var attributes=require(_0x7cc1('0xa'));module[_0x7cc1('0xb')]=function(_0x35548d,_0x5696ca){return _0x35548d[_0x7cc1('0xc')](_0x7cc1('0xd'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x664b=['bluebird','request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','moment'];(function(_0x544169,_0x315b6c){var _0x118510=function(_0x332349){while(--_0x332349){_0x544169['push'](_0x544169['shift']());}};_0x118510(++_0x315b6c);}(_0x664b,0x148));var _0xb664=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x664b[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb664('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb664('0x1'));var BPromise=require(_0xb664('0x2'));var rp=require(_0xb664('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb664('0x4'));var config=require(_0xb664('0x5'));var attributes=require(_0xb664('0x6'));module[_0xb664('0x7')]=function(_0x1d9c11,_0x2ff858){return _0x1d9c11[_0xb664('0x8')](_0xb664('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5c684db..214b5d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aee=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0x7aee,0x155));var _0xe7ae=function(_0xcec9c8,_0x5683b4){_0xcec9c8=_0xcec9c8-0x0;var _0xac19f=_0x7aee[_0xcec9c8];return _0xac19f;};'use strict';var _=require('lodash');var util=require(_0xe7ae('0x0'));var moment=require(_0xe7ae('0x1'));var BPromise=require(_0xe7ae('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ae('0x3'));var db=require(_0xe7ae('0x4'))['db'];var utils=require(_0xe7ae('0x5'));var logger=require(_0xe7ae('0x6'))(_0xe7ae('0x7'));var config=require('../../config/environment');var jayson=require(_0xe7ae('0x8'));var client=jayson[_0xe7ae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17db22,_0x1e0da2,_0x742949){return new BPromise(function(_0xf6a596,_0x459f59){return client[_0xe7ae('0xa')](_0x17db22,_0x742949)[_0xe7ae('0xb')](function(_0x4cfbe9){logger[_0xe7ae('0xc')](_0xe7ae('0xd'),_0x1e0da2,_0xe7ae('0xe'));logger[_0xe7ae('0xf')](_0xe7ae('0x10'),_0x1e0da2,_0xe7ae('0xe'),JSON[_0xe7ae('0x11')](_0x4cfbe9));if(_0x4cfbe9[_0xe7ae('0x12')]){if(_0x4cfbe9[_0xe7ae('0x12')][_0xe7ae('0x13')]===0x1f4){logger[_0xe7ae('0x12')](_0xe7ae('0xd'),_0x1e0da2,_0x4cfbe9[_0xe7ae('0x12')][_0xe7ae('0x14')]);return _0x459f59(_0x4cfbe9[_0xe7ae('0x12')][_0xe7ae('0x14')]);}logger[_0xe7ae('0x12')](_0xe7ae('0xd'),_0x1e0da2,_0x4cfbe9['error']['message']);return _0xf6a596(_0x4cfbe9[_0xe7ae('0x12')]['message']);}else{logger[_0xe7ae('0xc')](_0xe7ae('0xd'),_0x1e0da2,_0xe7ae('0xe'));_0xf6a596(_0x4cfbe9[_0xe7ae('0x15')][_0xe7ae('0x14')]);}})[_0xe7ae('0x16')](function(_0x58a7cd){logger[_0xe7ae('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x1e0da2,_0x58a7cd);_0x459f59(_0x58a7cd);});});}
\ No newline at end of file
+var _0x38f5=['then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\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','client','request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x38f5,0x1bf));var _0x538f=function(_0x5011cd,_0x3d32f8){_0x5011cd=_0x5011cd-0x0;var _0x1553c0=_0x38f5[_0x5011cd];return _0x1553c0;};'use strict';var _=require(_0x538f('0x0'));var util=require(_0x538f('0x1'));var moment=require('moment');var BPromise=require(_0x538f('0x2'));var rs=require(_0x538f('0x3'));var fs=require('fs');var Redis=require(_0x538f('0x4'));var db=require(_0x538f('0x5'))['db'];var utils=require(_0x538f('0x6'));var logger=require(_0x538f('0x7'))(_0x538f('0x8'));var config=require(_0x538f('0x9'));var jayson=require(_0x538f('0xa'));var client=jayson[_0x538f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x465dcf,_0x356f75,_0x5048a5){return new BPromise(function(_0x12989b,_0x335479){return client[_0x538f('0xc')](_0x465dcf,_0x5048a5)[_0x538f('0xd')](function(_0x40c988){logger[_0x538f('0xe')](_0x538f('0xf'),_0x356f75,'request\x20sent');logger[_0x538f('0x10')](_0x538f('0x11'),_0x356f75,'request\x20sent',JSON[_0x538f('0x12')](_0x40c988));if(_0x40c988[_0x538f('0x13')]){if(_0x40c988[_0x538f('0x13')][_0x538f('0x14')]===0x1f4){logger[_0x538f('0x13')](_0x538f('0xf'),_0x356f75,_0x40c988[_0x538f('0x13')][_0x538f('0x15')]);return _0x335479(_0x40c988[_0x538f('0x13')]['message']);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x356f75,_0x40c988[_0x538f('0x13')][_0x538f('0x15')]);return _0x12989b(_0x40c988['error']['message']);}else{logger[_0x538f('0xe')](_0x538f('0xf'),_0x356f75,'request\x20sent');_0x12989b(_0x40c988[_0x538f('0x16')][_0x538f('0x15')]);}})['catch'](function(_0x232552){logger[_0x538f('0x13')](_0x538f('0xf'),_0x356f75,_0x232552);_0x335479(_0x232552);});});}
\ No newline at end of file
index 1934fcf..cff742f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4986=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x3adb2c,_0x5734f3){var _0x3e5ae4=function(_0x1fabec){while(--_0x1fabec){_0x3adb2c['push'](_0x3adb2c['shift']());}};_0x3e5ae4(++_0x5734f3);}(_0x4986,0xa2));var _0x6498=function(_0x14ef86,_0x8b76b2){_0x14ef86=_0x14ef86-0x0;var _0x4b3bb0=_0x4986[_0x14ef86];return _0x4b3bb0;};'use strict';var multer=require('multer');var util=require(_0x6498('0x0'));var path=require(_0x6498('0x1'));var timeout=require(_0x6498('0x2'));var express=require(_0x6498('0x3'));var router=express[_0x6498('0x4')]();var fs_extra=require(_0x6498('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6498('0x6'));var config=require(_0x6498('0x7'));var controller=require(_0x6498('0x8'));router[_0x6498('0x9')]('/',auth[_0x6498('0xa')](),controller['index']);router[_0x6498('0x9')](_0x6498('0xb'),auth[_0x6498('0xa')](),controller[_0x6498('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6498('0xd')]);router[_0x6498('0xe')]('/:id',auth[_0x6498('0xa')](),controller[_0x6498('0xf')]);router[_0x6498('0x10')](_0x6498('0xb'),auth['isAuthenticated'](),controller[_0x6498('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x770e=['put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intZohoField.controller','get','/:id','isAuthenticated','post','create'];(function(_0x546056,_0x47e2b8){var _0x12a2c3=function(_0x137571){while(--_0x137571){_0x546056['push'](_0x546056['shift']());}};_0x12a2c3(++_0x47e2b8);}(_0x770e,0x194));var _0xe770=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x770e[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0xe770('0x0'));var util=require('util');var path=require(_0xe770('0x1'));var timeout=require(_0xe770('0x2'));var express=require(_0xe770('0x3'));var router=express['Router']();var fs_extra=require(_0xe770('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe770('0x5'));var config=require('../../config/environment');var controller=require(_0xe770('0x6'));router[_0xe770('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe770('0x7')](_0xe770('0x8'),auth[_0xe770('0x9')](),controller['show']);router[_0xe770('0xa')]('/',auth[_0xe770('0x9')](),controller[_0xe770('0xb')]);router[_0xe770('0xc')](_0xe770('0x8'),auth[_0xe770('0x9')](),controller['update']);router[_0xe770('0xd')](_0xe770('0x8'),auth['isAuthenticated'](),controller[_0xe770('0xe')]);module[_0xe770('0xf')]=router;
\ No newline at end of file
index 19c0a8c..8ba098a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9da=['BOOLEAN','exports','ENUM','variable','keyValue','STRING','string','customVariable'];(function(_0x2456af,_0x571456){var _0x263b42=function(_0x39b701){while(--_0x39b701){_0x2456af['push'](_0x2456af['shift']());}};_0x263b42(++_0x571456);}(_0xd9da,0x81));var _0xad9d=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xd9da[_0x13e741];return _0x3f8bb3;};'use strict';var Sequelize=require('sequelize');module[_0xad9d('0x0')]={'type':{'type':Sequelize[_0xad9d('0x1')]('string',_0xad9d('0x2'),'customVariable',_0xad9d('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xad9d('0x4')]},'key':{'type':Sequelize[_0xad9d('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xad9d('0x5'),_0xad9d('0x2'),_0xad9d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xad9d('0x4')]},'nameField':{'type':Sequelize[_0xad9d('0x4')]},'customField':{'type':Sequelize[_0xad9d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xad9d('0x4')]}};
\ No newline at end of file
+var _0x2113=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x2b0a08,_0x351fca){var _0x51aac5=function(_0x2ccd0b){while(--_0x2ccd0b){_0x2b0a08['push'](_0x2b0a08['shift']());}};_0x51aac5(++_0x351fca);}(_0x2113,0x192));var _0x3211=function(_0x527b06,_0x419a8f){_0x527b06=_0x527b06-0x0;var _0x399e3b=_0x2113[_0x527b06];return _0x399e3b;};'use strict';var Sequelize=require(_0x3211('0x0'));module[_0x3211('0x1')]={'type':{'type':Sequelize[_0x3211('0x2')](_0x3211('0x3'),_0x3211('0x4'),_0x3211('0x5'),_0x3211('0x6'),_0x3211('0x7')),'defaultValue':_0x3211('0x3')},'content':{'type':Sequelize[_0x3211('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3211('0x2')](_0x3211('0x3'),_0x3211('0x4'),_0x3211('0x5'))},'keyContent':{'type':Sequelize[_0x3211('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3211('0x8')]}};
\ No newline at end of file
index 81601f0..52872ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eee=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','end','error','stack','name','map','ZohoField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','keys','length','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7eee,0x14c));var _0xe7ee=function(_0x47be9b,_0x2e25a8){_0x47be9b=_0x47be9b-0x0;var _0x1f21ed=_0x7eee[_0x47be9b];return _0x1f21ed;};'use strict';var emlformat=require(_0xe7ee('0x0'));var rimraf=require(_0xe7ee('0x1'));var zipdir=require(_0xe7ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7ee('0x3'));var moment=require(_0xe7ee('0x4'));var BPromise=require(_0xe7ee('0x5'));var Mustache=require(_0xe7ee('0x6'));var util=require(_0xe7ee('0x7'));var path=require('path');var sox=require(_0xe7ee('0x8'));var csv=require(_0xe7ee('0x9'));var ejs=require(_0xe7ee('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe7ee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe7ee('0xc'));var deskjs=require(_0xe7ee('0xd'));var toCsv=require(_0xe7ee('0x9'));var querystring=require('querystring');var Papa=require(_0xe7ee('0xe'));var Redis=require(_0xe7ee('0xf'));var authService=require(_0xe7ee('0x10'));var qs=require(_0xe7ee('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe7ee('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xe7ee('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5699ab,_0x7820ef){_0x7820ef=_0x7820ef||0xcc;return function(_0x1e8786){if(_0x1e8786){return _0x5699ab[_0xe7ee('0x14')](_0x7820ef);}return _0x5699ab[_0xe7ee('0x15')](_0x7820ef)['end']();};}function respondWithResult(_0x35d606,_0x450808){_0x450808=_0x450808||0xc8;return function(_0x144335){if(_0x144335){return _0x35d606['status'](_0x450808)[_0xe7ee('0x16')](_0x144335);}};}function respondWithFilteredResult(_0x53cdfb,_0x2e7999){return function(_0xb0638){if(_0xb0638){var _0x3615f5=typeof _0x2e7999[_0xe7ee('0x17')]===_0xe7ee('0x18')&&typeof _0x2e7999[_0xe7ee('0x19')]===_0xe7ee('0x18');var _0x5e4638=_0xb0638['count'];var _0x2d3198=_0x3615f5?0x0:_0x2e7999[_0xe7ee('0x17')];var _0x38b598=_0x3615f5?_0xb0638[_0xe7ee('0x1a')]:_0x2e7999[_0xe7ee('0x17')]+_0x2e7999['limit'];var _0x1a090e;if(_0x38b598>=_0x5e4638){_0x38b598=_0x5e4638;_0x1a090e=0xc8;}else{_0x1a090e=0xce;}_0x53cdfb[_0xe7ee('0x15')](_0x1a090e);return _0x53cdfb['set'](_0xe7ee('0x1b'),_0x2d3198+'-'+_0x38b598+'/'+_0x5e4638)['json'](_0xb0638);}return null;};}function patchUpdates(_0x14a514){return function(_0x3c11bf){try{jsonpatch[_0xe7ee('0x1c')](_0x3c11bf,_0x14a514,!![]);}catch(_0x5ed89d){return BPromise[_0xe7ee('0x1d')](_0x5ed89d);}return _0x3c11bf[_0xe7ee('0x1e')]();};}function saveUpdates(_0x11ae63,_0x22401b){return function(_0x3811dc){if(_0x3811dc){return _0x3811dc[_0xe7ee('0x1f')](_0x11ae63)['then'](function(_0x3095d3){return _0x3095d3;});}return null;};}function removeEntity(_0x530b3c,_0x2b0888){return function(_0xce11c8){if(_0xce11c8){return _0xce11c8['destroy']()['then'](function(){_0x530b3c[_0xe7ee('0x15')](0xcc)[_0xe7ee('0x20')]();});}};}function handleEntityNotFound(_0x5885d2,_0x2505b7){return function(_0x3f9af2){if(!_0x3f9af2){_0x5885d2[_0xe7ee('0x14')](0x194);}return _0x3f9af2;};}function handleError(_0x2a562e,_0x4c847a){_0x4c847a=_0x4c847a||0x1f4;return function(_0x3a7c5c){logger[_0xe7ee('0x21')](_0x3a7c5c[_0xe7ee('0x22')]);if(_0x3a7c5c[_0xe7ee('0x23')]){delete _0x3a7c5c[_0xe7ee('0x23')];}_0x2a562e['status'](_0x4c847a)['send'](_0x3a7c5c);};}exports['index']=function(_0x20cb05,_0x25ce52){var _0x1cc914={},_0x3a165c={},_0x3f20c8={'count':0x0,'rows':[]};var _0x38ca6d=_[_0xe7ee('0x24')](db[_0xe7ee('0x25')][_0xe7ee('0x26')],function(_0x736e4c){return{'name':_0x736e4c[_0xe7ee('0x27')],'type':_0x736e4c[_0xe7ee('0x28')][_0xe7ee('0x29')]};});_0x3a165c[_0xe7ee('0x2a')]=_[_0xe7ee('0x24')](_0x38ca6d,_0xe7ee('0x23'));_0x3a165c[_0xe7ee('0x2b')]=_['keys'](_0x20cb05['query']);_0x3a165c[_0xe7ee('0x2c')]=_[_0xe7ee('0x2d')](_0x3a165c['model'],_0x3a165c['query']);_0x1cc914[_0xe7ee('0x2e')]=_['intersection'](_0x3a165c['model'],qs[_0xe7ee('0x2f')](_0x20cb05[_0xe7ee('0x2b')][_0xe7ee('0x2f')]));_0x1cc914[_0xe7ee('0x2e')]=_0x1cc914[_0xe7ee('0x2e')]['length']?_0x1cc914['attributes']:_0x3a165c[_0xe7ee('0x2a')];if(!_0x20cb05[_0xe7ee('0x2b')][_0xe7ee('0x30')]('nolimit')){_0x1cc914[_0xe7ee('0x19')]=qs[_0xe7ee('0x19')](_0x20cb05[_0xe7ee('0x2b')]['limit']);_0x1cc914[_0xe7ee('0x17')]=qs[_0xe7ee('0x17')](_0x20cb05['query'][_0xe7ee('0x17')]);}_0x1cc914[_0xe7ee('0x31')]=qs[_0xe7ee('0x32')](_0x20cb05[_0xe7ee('0x2b')]['sort']);_0x1cc914[_0xe7ee('0x33')]=qs[_0xe7ee('0x2c')](_[_0xe7ee('0x34')](_0x20cb05['query'],_0x3a165c['filters']),_0x38ca6d);if(_0x20cb05[_0xe7ee('0x2b')][_0xe7ee('0x35')]){_0x1cc914[_0xe7ee('0x33')]=_[_0xe7ee('0x36')](_0x1cc914['where'],{'$or':_[_0xe7ee('0x24')](_0x38ca6d,function(_0x268ade){if(_0x268ade[_0xe7ee('0x28')]!==_0xe7ee('0x37')){var _0x3d6882={};_0x3d6882[_0x268ade[_0xe7ee('0x23')]]={'$like':'%'+_0x20cb05['query'][_0xe7ee('0x35')]+'%'};return _0x3d6882;}})});}_0x1cc914=_[_0xe7ee('0x36')]({},_0x1cc914,_0x20cb05[_0xe7ee('0x38')]);var _0x4c1844={'where':_0x1cc914[_0xe7ee('0x33')]};return db[_0xe7ee('0x25')][_0xe7ee('0x1a')](_0x4c1844)[_0xe7ee('0x39')](function(_0x67b047){_0x3f20c8[_0xe7ee('0x1a')]=_0x67b047;if(_0x20cb05[_0xe7ee('0x2b')][_0xe7ee('0x3a')]){_0x1cc914[_0xe7ee('0x3b')]=[{'all':!![]}];}return db[_0xe7ee('0x25')][_0xe7ee('0x3c')](_0x1cc914);})[_0xe7ee('0x39')](function(_0x53ebc7){_0x3f20c8[_0xe7ee('0x3d')]=_0x53ebc7;return _0x3f20c8;})[_0xe7ee('0x39')](respondWithFilteredResult(_0x25ce52,_0x1cc914))[_0xe7ee('0x3e')](handleError(_0x25ce52,null));};exports['show']=function(_0x275640,_0x4342fd){var _0x2b821c={'raw':!![],'where':{'id':_0x275640['params']['id']}},_0x4afe03={};_0x4afe03[_0xe7ee('0x2a')]=_[_0xe7ee('0x3f')](db[_0xe7ee('0x25')]['rawAttributes']);_0x4afe03['query']=_['keys'](_0x275640['query']);_0x4afe03[_0xe7ee('0x2c')]=_[_0xe7ee('0x2d')](_0x4afe03[_0xe7ee('0x2a')],_0x4afe03[_0xe7ee('0x2b')]);_0x2b821c[_0xe7ee('0x2e')]=_[_0xe7ee('0x2d')](_0x4afe03[_0xe7ee('0x2a')],qs[_0xe7ee('0x2f')](_0x275640[_0xe7ee('0x2b')][_0xe7ee('0x2f')]));_0x2b821c[_0xe7ee('0x2e')]=_0x2b821c[_0xe7ee('0x2e')][_0xe7ee('0x40')]?_0x2b821c['attributes']:_0x4afe03[_0xe7ee('0x2a')];if(_0x275640[_0xe7ee('0x2b')][_0xe7ee('0x3a')]){_0x2b821c[_0xe7ee('0x3b')]=[{'all':!![]}];}_0x2b821c=_['merge']({},_0x2b821c,_0x275640[_0xe7ee('0x38')]);return db[_0xe7ee('0x25')]['find'](_0x2b821c)['then'](handleEntityNotFound(_0x4342fd,null))[_0xe7ee('0x39')](respondWithResult(_0x4342fd,null))[_0xe7ee('0x3e')](handleError(_0x4342fd,null));};exports[_0xe7ee('0x41')]=function(_0x5d8f18,_0x497343){return db[_0xe7ee('0x25')]['create'](_0x5d8f18[_0xe7ee('0x42')],{})[_0xe7ee('0x39')](respondWithResult(_0x497343,0xc9))[_0xe7ee('0x3e')](handleError(_0x497343,null));};exports['update']=function(_0x4cadaa,_0x4452a6){if(_0x4cadaa[_0xe7ee('0x42')]['id']){delete _0x4cadaa['body']['id'];}return db[_0xe7ee('0x25')][_0xe7ee('0x43')]({'where':{'id':_0x4cadaa[_0xe7ee('0x44')]['id']}})[_0xe7ee('0x39')](handleEntityNotFound(_0x4452a6,null))[_0xe7ee('0x39')](saveUpdates(_0x4cadaa[_0xe7ee('0x42')],null))['then'](respondWithResult(_0x4452a6,null))[_0xe7ee('0x3e')](handleError(_0x4452a6,null));};exports['destroy']=function(_0x26e57b,_0x5a63c1){return db[_0xe7ee('0x25')]['find']({'where':{'id':_0x26e57b[_0xe7ee('0x44')]['id']}})[_0xe7ee('0x39')](handleEntityNotFound(_0x5a63c1,null))[_0xe7ee('0x39')](removeEntity(_0x5a63c1,null))['catch'](handleError(_0x5a63c1,null));};
\ No newline at end of file
+var _0x312b=['type','options','ZohoField','include','findAll','show','params','rawAttributes','includeAll','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','offset','undefined','limit','count','status','json','apply','reject','save','update','destroy','then','end','error','name','send','index','map','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x312b,0x1ab));var _0xb312=function(_0x421edb,_0x3d9e96){_0x421edb=_0x421edb-0x0;var _0x5ac1a4=_0x312b[_0x421edb];return _0x5ac1a4;};'use strict';var emlformat=require(_0xb312('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb312('0x1'));var jsonpatch=require(_0xb312('0x2'));var rp=require(_0xb312('0x3'));var moment=require(_0xb312('0x4'));var BPromise=require(_0xb312('0x5'));var Mustache=require(_0xb312('0x6'));var util=require(_0xb312('0x7'));var path=require(_0xb312('0x8'));var sox=require(_0xb312('0x9'));var csv=require(_0xb312('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb312('0xb'));var _=require(_0xb312('0xc'));var squel=require('squel');var crypto=require(_0xb312('0xd'));var jsforce=require(_0xb312('0xe'));var deskjs=require(_0xb312('0xf'));var toCsv=require(_0xb312('0xa'));var querystring=require('querystring');var Papa=require(_0xb312('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb312('0x11'));var as=require(_0xb312('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb312('0x13'))(_0xb312('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb312('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a064e,_0x2de5ad){_0x2de5ad=_0x2de5ad||0xcc;return function(_0x233e34){if(_0x233e34){return _0x2a064e[_0xb312('0x16')](_0x2de5ad);}return _0x2a064e['status'](_0x2de5ad)['end']();};}function respondWithResult(_0x2dc85a,_0x33b808){_0x33b808=_0x33b808||0xc8;return function(_0x475628){if(_0x475628){return _0x2dc85a['status'](_0x33b808)['json'](_0x475628);}};}function respondWithFilteredResult(_0x3781a3,_0x3918d1){return function(_0x212986){if(_0x212986){var _0x4f1cbd=typeof _0x3918d1[_0xb312('0x17')]===_0xb312('0x18')&&typeof _0x3918d1[_0xb312('0x19')]===_0xb312('0x18');var _0x3d5fe3=_0x212986[_0xb312('0x1a')];var _0xa3de0c=_0x4f1cbd?0x0:_0x3918d1['offset'];var _0x3ee589=_0x4f1cbd?_0x212986[_0xb312('0x1a')]:_0x3918d1[_0xb312('0x17')]+_0x3918d1[_0xb312('0x19')];var _0x151ed2;if(_0x3ee589>=_0x3d5fe3){_0x3ee589=_0x3d5fe3;_0x151ed2=0xc8;}else{_0x151ed2=0xce;}_0x3781a3[_0xb312('0x1b')](_0x151ed2);return _0x3781a3['set']('Content-Range',_0xa3de0c+'-'+_0x3ee589+'/'+_0x3d5fe3)[_0xb312('0x1c')](_0x212986);}return null;};}function patchUpdates(_0x2b678d){return function(_0x5e2c68){try{jsonpatch[_0xb312('0x1d')](_0x5e2c68,_0x2b678d,!![]);}catch(_0x415138){return BPromise[_0xb312('0x1e')](_0x415138);}return _0x5e2c68[_0xb312('0x1f')]();};}function saveUpdates(_0x483101,_0x489756){return function(_0x4af286){if(_0x4af286){return _0x4af286[_0xb312('0x20')](_0x483101)['then'](function(_0x1fa57e){return _0x1fa57e;});}return null;};}function removeEntity(_0x4c8bf5,_0x28421b){return function(_0x324497){if(_0x324497){return _0x324497[_0xb312('0x21')]()[_0xb312('0x22')](function(){_0x4c8bf5[_0xb312('0x1b')](0xcc)[_0xb312('0x23')]();});}};}function handleEntityNotFound(_0x204cf2,_0x4eb98d){return function(_0x4ec451){if(!_0x4ec451){_0x204cf2['sendStatus'](0x194);}return _0x4ec451;};}function handleError(_0x6329bd,_0x4310f4){_0x4310f4=_0x4310f4||0x1f4;return function(_0x3a0ec7){logger[_0xb312('0x24')](_0x3a0ec7['stack']);if(_0x3a0ec7[_0xb312('0x25')]){delete _0x3a0ec7[_0xb312('0x25')];}_0x6329bd[_0xb312('0x1b')](_0x4310f4)[_0xb312('0x26')](_0x3a0ec7);};}exports[_0xb312('0x27')]=function(_0x35f4d3,_0x1e73be){var _0x1c69ca={},_0x271822={},_0x10ff0d={'count':0x0,'rows':[]};var _0x365544=_[_0xb312('0x28')](db['ZohoField']['rawAttributes'],function(_0x5eddaa){return{'name':_0x5eddaa[_0xb312('0x29')],'type':_0x5eddaa['type']['key']};});_0x271822[_0xb312('0x2a')]=_[_0xb312('0x28')](_0x365544,_0xb312('0x25'));_0x271822[_0xb312('0x2b')]=_[_0xb312('0x2c')](_0x35f4d3[_0xb312('0x2b')]);_0x271822[_0xb312('0x2d')]=_['intersection'](_0x271822[_0xb312('0x2a')],_0x271822[_0xb312('0x2b')]);_0x1c69ca[_0xb312('0x2e')]=_[_0xb312('0x2f')](_0x271822['model'],qs[_0xb312('0x30')](_0x35f4d3[_0xb312('0x2b')][_0xb312('0x30')]));_0x1c69ca[_0xb312('0x2e')]=_0x1c69ca[_0xb312('0x2e')][_0xb312('0x31')]?_0x1c69ca[_0xb312('0x2e')]:_0x271822[_0xb312('0x2a')];if(!_0x35f4d3[_0xb312('0x2b')][_0xb312('0x32')](_0xb312('0x33'))){_0x1c69ca[_0xb312('0x19')]=qs[_0xb312('0x19')](_0x35f4d3['query']['limit']);_0x1c69ca['offset']=qs[_0xb312('0x17')](_0x35f4d3[_0xb312('0x2b')][_0xb312('0x17')]);}_0x1c69ca['order']=qs['sort'](_0x35f4d3['query'][_0xb312('0x34')]);_0x1c69ca['where']=qs[_0xb312('0x2d')](_['pick'](_0x35f4d3[_0xb312('0x2b')],_0x271822[_0xb312('0x2d')]),_0x365544);if(_0x35f4d3[_0xb312('0x2b')][_0xb312('0x35')]){_0x1c69ca[_0xb312('0x36')]=_[_0xb312('0x37')](_0x1c69ca[_0xb312('0x36')],{'$or':_['map'](_0x365544,function(_0x25fe07){if(_0x25fe07[_0xb312('0x38')]!=='VIRTUAL'){var _0x25f60a={};_0x25f60a[_0x25fe07[_0xb312('0x25')]]={'$like':'%'+_0x35f4d3['query']['filter']+'%'};return _0x25f60a;}})});}_0x1c69ca=_['merge']({},_0x1c69ca,_0x35f4d3[_0xb312('0x39')]);var _0xc5e722={'where':_0x1c69ca[_0xb312('0x36')]};return db[_0xb312('0x3a')][_0xb312('0x1a')](_0xc5e722)[_0xb312('0x22')](function(_0x1091c2){_0x10ff0d['count']=_0x1091c2;if(_0x35f4d3[_0xb312('0x2b')]['includeAll']){_0x1c69ca[_0xb312('0x3b')]=[{'all':!![]}];}return db[_0xb312('0x3a')][_0xb312('0x3c')](_0x1c69ca);})[_0xb312('0x22')](function(_0x4c464f){_0x10ff0d['rows']=_0x4c464f;return _0x10ff0d;})[_0xb312('0x22')](respondWithFilteredResult(_0x1e73be,_0x1c69ca))['catch'](handleError(_0x1e73be,null));};exports[_0xb312('0x3d')]=function(_0xb80efc,_0x1998d8){var _0x286bc4={'raw':!![],'where':{'id':_0xb80efc[_0xb312('0x3e')]['id']}},_0x57c5a1={};_0x57c5a1['model']=_[_0xb312('0x2c')](db[_0xb312('0x3a')][_0xb312('0x3f')]);_0x57c5a1[_0xb312('0x2b')]=_[_0xb312('0x2c')](_0xb80efc[_0xb312('0x2b')]);_0x57c5a1[_0xb312('0x2d')]=_['intersection'](_0x57c5a1['model'],_0x57c5a1['query']);_0x286bc4['attributes']=_[_0xb312('0x2f')](_0x57c5a1[_0xb312('0x2a')],qs[_0xb312('0x30')](_0xb80efc[_0xb312('0x2b')][_0xb312('0x30')]));_0x286bc4[_0xb312('0x2e')]=_0x286bc4['attributes']['length']?_0x286bc4[_0xb312('0x2e')]:_0x57c5a1['model'];if(_0xb80efc[_0xb312('0x2b')][_0xb312('0x40')]){_0x286bc4['include']=[{'all':!![]}];}_0x286bc4=_[_0xb312('0x37')]({},_0x286bc4,_0xb80efc['options']);return db[_0xb312('0x3a')]['find'](_0x286bc4)[_0xb312('0x22')](handleEntityNotFound(_0x1998d8,null))['then'](respondWithResult(_0x1998d8,null))[_0xb312('0x41')](handleError(_0x1998d8,null));};exports[_0xb312('0x42')]=function(_0x1b25ce,_0x5861db){return db['ZohoField'][_0xb312('0x42')](_0x1b25ce[_0xb312('0x43')],{})[_0xb312('0x22')](respondWithResult(_0x5861db,0xc9))['catch'](handleError(_0x5861db,null));};exports['update']=function(_0x19973d,_0x3faef3){if(_0x19973d['body']['id']){delete _0x19973d[_0xb312('0x43')]['id'];}return db['ZohoField'][_0xb312('0x44')]({'where':{'id':_0x19973d[_0xb312('0x3e')]['id']}})[_0xb312('0x22')](handleEntityNotFound(_0x3faef3,null))[_0xb312('0x22')](saveUpdates(_0x19973d[_0xb312('0x43')],null))[_0xb312('0x22')](respondWithResult(_0x3faef3,null))[_0xb312('0x41')](handleError(_0x3faef3,null));};exports[_0xb312('0x21')]=function(_0x486d2e,_0x13d08a){return db[_0xb312('0x3a')][_0xb312('0x44')]({'where':{'id':_0x486d2e[_0xb312('0x3e')]['id']}})['then'](handleEntityNotFound(_0x13d08a,null))[_0xb312('0x22')](removeEntity(_0x13d08a,null))[_0xb312('0x41')](handleError(_0x13d08a,null));};
\ No newline at end of file
index 7d4f237..4cec21b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['int_zoho_fields','idField','FieldId','lodash','util','api','moment','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x32b6,0x1d1));var _0x632b=function(_0x507436,_0x47d57d){_0x507436=_0x507436-0x0;var _0x383d9d=_0x32b6[_0x507436];return _0x383d9d;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var logger=require('../../config/logger')(_0x632b('0x2'));var moment=require(_0x632b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x632b('0x4'));var rimraf=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var attributes=require(_0x632b('0x7'));module[_0x632b('0x8')]=function(_0x122768,_0x24ceab){return _0x122768[_0x632b('0x9')](_0x632b('0xa'),attributes,{'tableName':_0x632b('0xb'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x632b('0xc'),_0x632b('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f2f=['bluebird','request-promise','path','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x428fc1,_0x426c55){var _0x5ce9a3=function(_0x17c807){while(--_0x17c807){_0x428fc1['push'](_0x428fc1['shift']());}};_0x5ce9a3(++_0x426c55);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23d426,_0x52b818){_0x23d426=_0x23d426-0x0;var _0x35f6f0=_0x5f2f[_0x23d426];return _0x35f6f0;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xf5f2('0xc'),'fields':[_0xf5f2('0xd'),_0xf5f2('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 092a283..cca5bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3f=['message','request\x20sent','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1717b0,_0xa93934){var _0x405899=function(_0x449e64){while(--_0x449e64){_0x1717b0['push'](_0x1717b0['shift']());}};_0x405899(++_0xa93934);}(_0xed3f,0x7c));var _0xfed3=function(_0x22e133,_0x527287){_0x22e133=_0x22e133-0x0;var _0x3455ca=_0xed3f[_0x22e133];return _0x3455ca;};'use strict';var _=require('lodash');var util=require(_0xfed3('0x0'));var moment=require(_0xfed3('0x1'));var BPromise=require('bluebird');var rs=require(_0xfed3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfed3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfed3('0x4'))(_0xfed3('0x5'));var config=require(_0xfed3('0x6'));var jayson=require(_0xfed3('0x7'));var client=jayson[_0xfed3('0x8')][_0xfed3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16ee94,_0x3c5867,_0xdef1da){return new BPromise(function(_0x468b40,_0x11438f){return client['request'](_0x16ee94,_0xdef1da)['then'](function(_0x2bbe7f){logger[_0xfed3('0xa')](_0xfed3('0xb'),_0x3c5867,'request\x20sent');logger['debug'](_0xfed3('0xc'),_0x3c5867,'request\x20sent',JSON[_0xfed3('0xd')](_0x2bbe7f));if(_0x2bbe7f[_0xfed3('0xe')]){if(_0x2bbe7f[_0xfed3('0xe')][_0xfed3('0xf')]===0x1f4){logger[_0xfed3('0xe')](_0xfed3('0xb'),_0x3c5867,_0x2bbe7f[_0xfed3('0xe')][_0xfed3('0x10')]);return _0x11438f(_0x2bbe7f[_0xfed3('0xe')][_0xfed3('0x10')]);}logger[_0xfed3('0xe')](_0xfed3('0xb'),_0x3c5867,_0x2bbe7f[_0xfed3('0xe')]['message']);return _0x468b40(_0x2bbe7f[_0xfed3('0xe')]['message']);}else{logger[_0xfed3('0xa')](_0xfed3('0xb'),_0x3c5867,_0xfed3('0x11'));_0x468b40(_0x2bbe7f[_0xfed3('0x12')][_0xfed3('0x10')]);}})[_0xfed3('0x13')](function(_0x2bc2ff){logger[_0xfed3('0xe')](_0xfed3('0xb'),_0x3c5867,_0x2bc2ff);_0x11438f(_0x2bc2ff);});});}
\ No newline at end of file
+var _0x693b=['../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1a0e6d,_0x5834d8){var _0x37c3ac=function(_0x262c18){while(--_0x262c18){_0x1a0e6d['push'](_0x1a0e6d['shift']());}};_0x37c3ac(++_0x5834d8);}(_0x693b,0x16a));var _0xb693=function(_0x2ff17c,_0x15f12b){_0x2ff17c=_0x2ff17c-0x0;var _0x506ef2=_0x693b[_0x2ff17c];return _0x506ef2;};'use strict';var _=require(_0xb693('0x0'));var util=require(_0xb693('0x1'));var moment=require(_0xb693('0x2'));var BPromise=require('bluebird');var rs=require(_0xb693('0x3'));var fs=require('fs');var Redis=require(_0xb693('0x4'));var db=require(_0xb693('0x5'))['db'];var utils=require(_0xb693('0x6'));var logger=require('../../config/logger')(_0xb693('0x7'));var config=require(_0xb693('0x8'));var jayson=require(_0xb693('0x9'));var client=jayson['client'][_0xb693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36d98d,_0x474073,_0x238f17){return new BPromise(function(_0x153aa7,_0x3cafc3){return client[_0xb693('0xb')](_0x36d98d,_0x238f17)[_0xb693('0xc')](function(_0x3547b2){logger[_0xb693('0xd')](_0xb693('0xe'),_0x474073,_0xb693('0xf'));logger[_0xb693('0x10')](_0xb693('0x11'),_0x474073,'request\x20sent',JSON[_0xb693('0x12')](_0x3547b2));if(_0x3547b2['error']){if(_0x3547b2[_0xb693('0x13')][_0xb693('0x14')]===0x1f4){logger[_0xb693('0x13')](_0xb693('0xe'),_0x474073,_0x3547b2[_0xb693('0x13')][_0xb693('0x15')]);return _0x3cafc3(_0x3547b2[_0xb693('0x13')][_0xb693('0x15')]);}logger[_0xb693('0x13')](_0xb693('0xe'),_0x474073,_0x3547b2['error']['message']);return _0x153aa7(_0x3547b2[_0xb693('0x13')][_0xb693('0x15')]);}else{logger[_0xb693('0xd')](_0xb693('0xe'),_0x474073,_0xb693('0xf'));_0x153aa7(_0x3547b2['result'][_0xb693('0x15')]);}})[_0xb693('0x16')](function(_0x2ff72d){logger[_0xb693('0x13')](_0xb693('0xe'),_0x474073,_0x2ff72d);_0x3cafc3(_0x2ff72d);});});}
\ No newline at end of file
index 2bb8917..1cbb550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3510c2,_0x396bf6){var _0x191fb0=function(_0x1e3f44){while(--_0x1e3f44){_0x3510c2['push'](_0x3510c2['shift']());}};_0x191fb0(++_0x396bf6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2a9ac9,_0x2ba5e0){var _0x40fa2d=function(_0x1223fa){while(--_0x1223fa){_0x2a9ac9['push'](_0x2a9ac9['shift']());}};_0x40fa2d(++_0x2ba5e0);}(_0x70e0,0x17b));var _0x070e=function(_0x56de83,_0x172557){_0x56de83=_0x56de83-0x0;var _0x54a3ea=_0x70e0[_0x56de83];return _0x54a3ea;};'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 5f35eaf..3758c9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4be5=['state','sequelize','exports','unique_name_and_version','STRING','app.js'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4be5,0xc1));var _0x54be=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x4be5[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x54be('0x0'));module[_0x54be('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x54be('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x54be('0x2')},'main':{'type':Sequelize[_0x54be('0x3')],'defaultValue':_0x54be('0x4')},'filename':{'type':Sequelize[_0x54be('0x3')]},'path':{'type':Sequelize[_0x54be('0x3')]},'type':{'type':Sequelize[_0x54be('0x3')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x54be('0x3')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x54be('0x3')],'unique':_0x54be('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x54be('0x3')]},'remoteUri':{'type':Sequelize[_0x54be('0x3')]},'link':{'type':Sequelize[_0x54be('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x8f7c=['state','sequelize','exports','STRING','app.js','INTEGER'];(function(_0x440591,_0x37d8bf){var _0x28507a=function(_0x16296f){while(--_0x16296f){_0x440591['push'](_0x440591['shift']());}};_0x28507a(++_0x37d8bf);}(_0x8f7c,0x133));var _0xc8f7=function(_0x3de80e,_0x5cabca){_0x3de80e=_0x3de80e-0x0;var _0x5629fd=_0x8f7c[_0x3de80e];return _0x5629fd;};'use strict';var Sequelize=require(_0xc8f7('0x0'));module[_0xc8f7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xc8f7('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xc8f7('0x2')],'defaultValue':_0xc8f7('0x3')},'filename':{'type':Sequelize[_0xc8f7('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xc8f7('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xc8f7('0x2')]},'logo':{'type':Sequelize[_0xc8f7('0x2')]},'state':{'type':Sequelize[_0xc8f7('0x2')],'unique':_0xc8f7('0x5')},'description':{'type':Sequelize[_0xc8f7('0x2')]},'title':{'type':Sequelize[_0xc8f7('0x2')]},'remoteUri':{'type':Sequelize[_0xc8f7('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index b0fc6fd..a7c4188 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4819,0xcd));var _0x9481=function(_0x4276aa,_0xbdba9b){_0x4276aa=_0x4276aa-0x0;var _0x2c49f8=_0x4819[_0x4276aa];return _0x2c49f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));};
\ No newline at end of file
+var _0x1a37=['stack','name','send','index','map','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x1a37,0xb4));var _0x71a3=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x1a37[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};
\ No newline at end of file
index b91c2f8..2242d94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x217b=['integrations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x95bf5d,_0x43839b){var _0x29a35f=function(_0x2e94d5){while(--_0x2e94d5){_0x95bf5d['push'](_0x95bf5d['shift']());}};_0x29a35f(++_0x43839b);}(_0x217b,0xc5));var _0xb217=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x217b[_0x31ced5];return _0x10d9e5;};'use strict';var _=require(_0xb217('0x0'));var util=require(_0xb217('0x1'));var logger=require(_0xb217('0x2'))(_0xb217('0x3'));var moment=require(_0xb217('0x4'));var BPromise=require(_0xb217('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb217('0x6'));var rimraf=require(_0xb217('0x7'));var config=require(_0xb217('0x8'));var attributes=require(_0xb217('0x9'));module[_0xb217('0xa')]=function(_0x3ba991,_0x3be347){return _0x3ba991[_0xb217('0xb')](_0xb217('0xc'),attributes,{'tableName':_0xb217('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a34=['lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./integration.attributes','define','Integration'];(function(_0x18b7e3,_0x129720){var _0x113be5=function(_0x468f85){while(--_0x468f85){_0x18b7e3['push'](_0x18b7e3['shift']());}};_0x113be5(++_0x129720);}(_0x0a34,0x17c));var _0x40a3=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x0a34[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x40a3('0x0'));var util=require(_0x40a3('0x1'));var logger=require(_0x40a3('0x2'))(_0x40a3('0x3'));var moment=require(_0x40a3('0x4'));var BPromise=require('bluebird');var rp=require(_0x40a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x40a3('0x6'));var attributes=require(_0x40a3('0x7'));module['exports']=function(_0x184007,_0xa71e31){return _0x184007[_0x40a3('0x8')](_0x40a3('0x9'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be9ea8f..f87194f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2d7859,_0x22d119){var _0x492f31=function(_0x32e2fc){while(--_0x32e2fc){_0x2d7859['push'](_0x2d7859['shift']());}};_0x492f31(++_0x22d119);}(_0x0295,0x1f0));var _0x5029=function(_0x25ada9,_0x5f0e07){_0x25ada9=_0x25ada9-0x0;var _0x59e1ab=_0x0295[_0x25ada9];return _0x59e1ab;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});}
\ No newline at end of file
+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(_0x750372,_0x50484d){var _0xdd9d49=function(_0x4ed136){while(--_0x4ed136){_0x750372['push'](_0x750372['shift']());}};_0xdd9d49(++_0x50484d);}(_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
index 7939fcd..f4f96fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0295,0x1f0));var _0x5029=function(_0x35d06e,_0x2e3503){_0x35d06e=_0x35d06e-0x0;var _0x9e9053=_0x0295[_0x35d06e];return _0x9e9053;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router;
\ No newline at end of file
+var _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2ffcc9,_0x1cf495){var _0x16c7a3=function(_0x51b6ca){while(--_0x51b6ca){_0x2ffcc9['push'](_0x2ffcc9['shift']());}};_0x16c7a3(++_0x1cf495);}(_0x955f,0x1eb));var _0xf955=function(_0x572afb,_0x470888){_0x572afb=_0x572afb-0x0;var _0x1fb1c2=_0x955f[_0x572afb];return _0x1fb1c2;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router;
\ No newline at end of file
index a1a5119..407ca63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8557=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8557,0x129));var _0x7855=function(_0x147c96,_0x309657){_0x147c96=_0x147c96-0x0;var _0x4ec711=_0x8557[_0x147c96];return _0x4ec711;};'use strict';var Sequelize=require(_0x7855('0x0'));module[_0x7855('0x1')]={'integration':{'type':Sequelize[_0x7855('0x2')]},'eventChannel':{'type':Sequelize[_0x7855('0x2')]},'exitStatus':{'type':Sequelize[_0x7855('0x2')]},'ticketId':{'type':Sequelize[_0x7855('0x2')]},'integrationId':{'type':Sequelize[_0x7855('0x3')]},'contacts':{'type':Sequelize[_0x7855('0x2')]},'uniqueid':{'type':Sequelize[_0x7855('0x2')]},'calleridnum':{'type':Sequelize[_0x7855('0x2')]},'calleridname':{'type':Sequelize[_0x7855('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7855('0x2')]},'membername':{'type':Sequelize[_0x7855('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7855('0x4')]},'holdtime':{'type':Sequelize[_0x7855('0x3')]},'agentcomplete':{'type':Sequelize[_0x7855('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7855('0x4')]},'talktime':{'type':Sequelize[_0x7855('0x3')]},'agentacw':{'type':Sequelize[_0x7855('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7855('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x7855('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7855('0x4')]},'lastevent':{'type':Sequelize[_0x7855('0x2')]},'channel':{'type':Sequelize[_0x7855('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x7855('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7855('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x7855('0x2')]},'accountcode':{'type':Sequelize[_0x7855('0x2')]},'context':{'type':Sequelize[_0x7855('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7855('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7855('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7855('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7855('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7855('0x2')]},'destlanguage':{'type':Sequelize[_0x7855('0x2')]},'destaccountcode':{'type':Sequelize[_0x7855('0x2')]},'destcontext':{'type':Sequelize[_0x7855('0x2')]},'destexten':{'type':Sequelize[_0x7855('0x2')]},'destpriority':{'type':Sequelize[_0x7855('0x2')]},'destuniqueid':{'type':Sequelize[_0x7855('0x2')]},'messageId':{'type':Sequelize[_0x7855('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x7855('0x2')]},'to':{'type':Sequelize[_0x7855('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x7855('0x6')]},'html':{'type':Sequelize[_0x7855('0x6')]},'text':{'type':Sequelize[_0x7855('0x6')]},'status':{'type':Sequelize[_0x7855('0x7')](_0x7855('0x8'),'SENDING','RECEIVED',_0x7855('0x9'))},'url':{'type':Sequelize[_0x7855('0x2')]},'app':{'type':Sequelize[_0x7855('0x2')]},'appdata':{'type':Sequelize[_0x7855('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x90ba=['FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','RECEIVED'];(function(_0x1eda0d,_0x3a7ba8){var _0x37848d=function(_0x93fe44){while(--_0x93fe44){_0x1eda0d['push'](_0x1eda0d['shift']());}};_0x37848d(++_0x3a7ba8);}(_0x90ba,0xe8));var _0xa90b=function(_0x34fb3d,_0x553d58){_0x34fb3d=_0x34fb3d-0x0;var _0x89649b=_0x90ba[_0x34fb3d];return _0x89649b;};'use strict';var Sequelize=require(_0xa90b('0x0'));module[_0xa90b('0x1')]={'integration':{'type':Sequelize[_0xa90b('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xa90b('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xa90b('0x3')]},'contacts':{'type':Sequelize[_0xa90b('0x2')]},'uniqueid':{'type':Sequelize[_0xa90b('0x2')]},'calleridnum':{'type':Sequelize[_0xa90b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa90b('0x2')]},'interface':{'type':Sequelize[_0xa90b('0x2')]},'membername':{'type':Sequelize[_0xa90b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xa90b('0x3')]},'agentcomplete':{'type':Sequelize[_0xa90b('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xa90b('0x5')]},'talktime':{'type':Sequelize[_0xa90b('0x3')]},'agentacw':{'type':Sequelize[_0xa90b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa90b('0x3')]},'reason':{'type':Sequelize[_0xa90b('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa90b('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xa90b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xa90b('0x2')]},'channel':{'type':Sequelize[_0xa90b('0x2')]},'channelstate':{'type':Sequelize[_0xa90b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa90b('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa90b('0x2')]},'connectedlinename':{'type':Sequelize[_0xa90b('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa90b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa90b('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa90b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xa90b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa90b('0x2')]},'destcalleridname':{'type':Sequelize[_0xa90b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa90b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xa90b('0x2')]},'destlanguage':{'type':Sequelize[_0xa90b('0x2')]},'destaccountcode':{'type':Sequelize[_0xa90b('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xa90b('0x2')]},'destuniqueid':{'type':Sequelize[_0xa90b('0x2')]},'messageId':{'type':Sequelize[_0xa90b('0x2')]},'inReplyTo':{'type':Sequelize[_0xa90b('0x2')]},'subject':{'type':Sequelize[_0xa90b('0x2')]},'from':{'type':Sequelize[_0xa90b('0x2')]},'to':{'type':Sequelize[_0xa90b('0x2')]},'cc':{'type':Sequelize[_0xa90b('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xa90b('0x6')]},'text':{'type':Sequelize[_0xa90b('0x6')]},'status':{'type':Sequelize[_0xa90b('0x7')](_0xa90b('0x8'),'SENDING',_0xa90b('0x9'),_0xa90b('0xa'))},'url':{'type':Sequelize[_0xa90b('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xa90b('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 2debdc9..49c9299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1093=['pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','intersection','include','find','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1093,0xa4));var _0x3109=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x1093[_0x55abd9];return _0x3e5669;};'use strict';var emlformat=require(_0x3109('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3109('0x1'));var rp=require(_0x3109('0x2'));var moment=require(_0x3109('0x3'));var BPromise=require(_0x3109('0x4'));var Mustache=require(_0x3109('0x5'));var util=require(_0x3109('0x6'));var path=require(_0x3109('0x7'));var sox=require(_0x3109('0x8'));var csv=require(_0x3109('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3109('0xa'));var _=require(_0x3109('0xb'));var squel=require('squel');var crypto=require(_0x3109('0xc'));var jsforce=require(_0x3109('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3109('0x9'));var querystring=require(_0x3109('0xe'));var Papa=require(_0x3109('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3109('0x10'));var as=require(_0x3109('0x11'));var hardwareService=require(_0x3109('0x12'));var logger=require(_0x3109('0x13'))(_0x3109('0x14'));var utils=require(_0x3109('0x15'));var config=require(_0x3109('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f785,_0x380e79){_0x380e79=_0x380e79||0xcc;return function(_0x38ca7f){if(_0x38ca7f){return _0x13f785['sendStatus'](_0x380e79);}return _0x13f785['status'](_0x380e79)[_0x3109('0x17')]();};}function respondWithResult(_0x490f57,_0x5e5348){_0x5e5348=_0x5e5348||0xc8;return function(_0x188b73){if(_0x188b73){return _0x490f57['status'](_0x5e5348)[_0x3109('0x18')](_0x188b73);}};}function respondWithFilteredResult(_0x113acf,_0x42d229){return function(_0x294bab){if(_0x294bab){var _0xd13c19=typeof _0x42d229[_0x3109('0x19')]==='undefined'&&typeof _0x42d229[_0x3109('0x1a')]===_0x3109('0x1b');var _0x37caf0=_0x294bab[_0x3109('0x1c')];var _0xf9acef=_0xd13c19?0x0:_0x42d229[_0x3109('0x19')];var _0x3c4fbd=_0xd13c19?_0x294bab['count']:_0x42d229[_0x3109('0x19')]+_0x42d229['limit'];var _0x2f6da8;if(_0x3c4fbd>=_0x37caf0){_0x3c4fbd=_0x37caf0;_0x2f6da8=0xc8;}else{_0x2f6da8=0xce;}_0x113acf[_0x3109('0x1d')](_0x2f6da8);return _0x113acf['set'](_0x3109('0x1e'),_0xf9acef+'-'+_0x3c4fbd+'/'+_0x37caf0)['json'](_0x294bab);}return null;};}function patchUpdates(_0x5c587c){return function(_0x4ec0e5){try{jsonpatch[_0x3109('0x1f')](_0x4ec0e5,_0x5c587c,!![]);}catch(_0x4f4648){return BPromise[_0x3109('0x20')](_0x4f4648);}return _0x4ec0e5[_0x3109('0x21')]();};}function saveUpdates(_0x277a95,_0x3d2c1d){return function(_0x473373){if(_0x473373){return _0x473373[_0x3109('0x22')](_0x277a95)[_0x3109('0x23')](function(_0x1e898a){return _0x1e898a;});}return null;};}function removeEntity(_0x1bb134,_0x53d6e8){return function(_0x19528b){if(_0x19528b){return _0x19528b[_0x3109('0x24')]()[_0x3109('0x23')](function(){_0x1bb134['status'](0xcc)[_0x3109('0x17')]();});}};}function handleEntityNotFound(_0x3611ef,_0x47b4ff){return function(_0x2ae201){if(!_0x2ae201){_0x3611ef[_0x3109('0x25')](0x194);}return _0x2ae201;};}function handleError(_0xd1c7be,_0x3f8b1a){_0x3f8b1a=_0x3f8b1a||0x1f4;return function(_0x2ec2b2){logger[_0x3109('0x26')](_0x2ec2b2['stack']);if(_0x2ec2b2[_0x3109('0x27')]){delete _0x2ec2b2[_0x3109('0x27')];}_0xd1c7be[_0x3109('0x1d')](_0x3f8b1a)[_0x3109('0x28')](_0x2ec2b2);};}exports[_0x3109('0x29')]=function(_0x2e93c2,_0x4c0324){var _0x5ea6ae={},_0x347688={},_0x40e042={'count':0x0,'rows':[]};var _0x59ae3b=_[_0x3109('0x2a')](db[_0x3109('0x2b')][_0x3109('0x2c')],function(_0x541238){return{'name':_0x541238['fieldName'],'type':_0x541238[_0x3109('0x2d')][_0x3109('0x2e')]};});_0x347688[_0x3109('0x2f')]=_[_0x3109('0x2a')](_0x59ae3b,_0x3109('0x27'));_0x347688[_0x3109('0x30')]=_[_0x3109('0x31')](_0x2e93c2[_0x3109('0x30')]);_0x347688[_0x3109('0x32')]=_['intersection'](_0x347688[_0x3109('0x2f')],_0x347688[_0x3109('0x30')]);_0x5ea6ae['attributes']=_['intersection'](_0x347688['model'],qs[_0x3109('0x33')](_0x2e93c2[_0x3109('0x30')]['fields']));_0x5ea6ae[_0x3109('0x34')]=_0x5ea6ae[_0x3109('0x34')][_0x3109('0x35')]?_0x5ea6ae[_0x3109('0x34')]:_0x347688['model'];if(!_0x2e93c2[_0x3109('0x30')][_0x3109('0x36')]('nolimit')){_0x5ea6ae[_0x3109('0x1a')]=qs[_0x3109('0x1a')](_0x2e93c2[_0x3109('0x30')][_0x3109('0x1a')]);_0x5ea6ae['offset']=qs[_0x3109('0x19')](_0x2e93c2['query'][_0x3109('0x19')]);}_0x5ea6ae[_0x3109('0x37')]=qs[_0x3109('0x38')](_0x2e93c2[_0x3109('0x30')][_0x3109('0x38')]);_0x5ea6ae[_0x3109('0x39')]=qs['filters'](_[_0x3109('0x3a')](_0x2e93c2[_0x3109('0x30')],_0x347688[_0x3109('0x32')]),_0x59ae3b);if(_0x2e93c2['query'][_0x3109('0x3b')]){_0x5ea6ae[_0x3109('0x39')]=_[_0x3109('0x3c')](_0x5ea6ae[_0x3109('0x39')],{'$or':_[_0x3109('0x2a')](_0x59ae3b,function(_0x202a9c){if(_0x202a9c[_0x3109('0x2d')]!==_0x3109('0x3d')){var _0x59a829={};_0x59a829[_0x202a9c[_0x3109('0x27')]]={'$like':'%'+_0x2e93c2[_0x3109('0x30')][_0x3109('0x3b')]+'%'};return _0x59a829;}})});}_0x5ea6ae=_[_0x3109('0x3c')]({},_0x5ea6ae,_0x2e93c2[_0x3109('0x3e')]);var _0x4953d5={'where':_0x5ea6ae[_0x3109('0x39')]};return db['IntegrationReport'][_0x3109('0x1c')](_0x4953d5)[_0x3109('0x23')](function(_0x1b34ea){_0x40e042[_0x3109('0x1c')]=_0x1b34ea;if(_0x2e93c2[_0x3109('0x30')][_0x3109('0x3f')]){_0x5ea6ae['include']=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x5ea6ae);})['then'](function(_0x42d925){_0x40e042[_0x3109('0x40')]=_0x42d925;return _0x40e042;})[_0x3109('0x23')](respondWithFilteredResult(_0x4c0324,_0x5ea6ae))[_0x3109('0x41')](handleError(_0x4c0324,null));};exports[_0x3109('0x42')]=function(_0x4723c8,_0x376c60){var _0x1200f4={'raw':![],'where':{'id':_0x4723c8['params']['id']}},_0x179a2d={};_0x179a2d[_0x3109('0x2f')]=_[_0x3109('0x31')](db[_0x3109('0x2b')][_0x3109('0x2c')]);_0x179a2d['query']=_[_0x3109('0x31')](_0x4723c8[_0x3109('0x30')]);_0x179a2d['filters']=_[_0x3109('0x43')](_0x179a2d['model'],_0x179a2d[_0x3109('0x30')]);_0x1200f4[_0x3109('0x34')]=_['intersection'](_0x179a2d['model'],qs['fields'](_0x4723c8['query'][_0x3109('0x33')]));_0x1200f4[_0x3109('0x34')]=_0x1200f4['attributes'][_0x3109('0x35')]?_0x1200f4['attributes']:_0x179a2d[_0x3109('0x2f')];if(_0x4723c8[_0x3109('0x30')][_0x3109('0x3f')]){_0x1200f4[_0x3109('0x44')]=[{'all':!![]}];}_0x1200f4=_[_0x3109('0x3c')]({},_0x1200f4,_0x4723c8['options']);return db[_0x3109('0x2b')][_0x3109('0x45')](_0x1200f4)[_0x3109('0x23')](handleEntityNotFound(_0x376c60,null))[_0x3109('0x23')](respondWithResult(_0x376c60,null))[_0x3109('0x41')](handleError(_0x376c60,null));};exports[_0x3109('0x46')]=function(_0x45af0f,_0x2964d7){return db[_0x3109('0x2b')]['create'](_0x45af0f[_0x3109('0x47')],{})[_0x3109('0x23')](respondWithResult(_0x2964d7,0xc9))['catch'](handleError(_0x2964d7,null));};exports['update']=function(_0x145bc7,_0x22775d){if(_0x145bc7[_0x3109('0x47')]['id']){delete _0x145bc7['body']['id'];}return db['IntegrationReport'][_0x3109('0x45')]({'where':{'id':_0x145bc7[_0x3109('0x48')]['id']}})['then'](handleEntityNotFound(_0x22775d,null))[_0x3109('0x23')](saveUpdates(_0x145bc7[_0x3109('0x47')],null))['then'](respondWithResult(_0x22775d,null))[_0x3109('0x41')](handleError(_0x22775d,null));};exports[_0x3109('0x24')]=function(_0x117bc9,_0x31fba7){return db['IntegrationReport'][_0x3109('0x45')]({'where':{'id':_0x117bc9[_0x3109('0x48')]['id']}})[_0x3109('0x23')](handleEntityNotFound(_0x31fba7,null))['then'](removeEntity(_0x31fba7,null))[_0x3109('0x41')](handleError(_0x31fba7,null));};exports[_0x3109('0x49')]=function(_0x429c87,_0x4984bf){return db['IntegrationReport'][_0x3109('0x49')]()[_0x3109('0x23')](respondWithResult(_0x4984bf,null))[_0x3109('0x41')](handleError(_0x4984bf,null));};
\ No newline at end of file
+var _0xcb03=['then','error','stack','name','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../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','count','limit','set','Content-Range','save','update'];(function(_0x1675dd,_0x4163d7){var _0x5bbfc1=function(_0x395294){while(--_0x395294){_0x1675dd['push'](_0x1675dd['shift']());}};_0x5bbfc1(++_0x4163d7);}(_0xcb03,0x6a));var _0x3cb0=function(_0x286444,_0x2343de){_0x286444=_0x286444-0x0;var _0x1b2f08=_0xcb03[_0x286444];return _0x1b2f08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3cb0('0x0'));var jsonpatch=require(_0x3cb0('0x1'));var rp=require(_0x3cb0('0x2'));var moment=require(_0x3cb0('0x3'));var BPromise=require(_0x3cb0('0x4'));var Mustache=require(_0x3cb0('0x5'));var util=require(_0x3cb0('0x6'));var path=require(_0x3cb0('0x7'));var sox=require(_0x3cb0('0x8'));var csv=require(_0x3cb0('0x9'));var ejs=require(_0x3cb0('0xa'));var fs=require('fs');var fs_extra=require(_0x3cb0('0xb'));var _=require(_0x3cb0('0xc'));var squel=require('squel');var crypto=require(_0x3cb0('0xd'));var jsforce=require(_0x3cb0('0xe'));var deskjs=require(_0x3cb0('0xf'));var toCsv=require(_0x3cb0('0x9'));var querystring=require(_0x3cb0('0x10'));var Papa=require(_0x3cb0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3cb0('0x12'));var as=require(_0x3cb0('0x13'));var hardwareService=require(_0x3cb0('0x14'));var logger=require(_0x3cb0('0x15'))(_0x3cb0('0x16'));var utils=require(_0x3cb0('0x17'));var config=require(_0x3cb0('0x18'));var licenseUtil=require(_0x3cb0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23b10c,_0x1fa73e){_0x1fa73e=_0x1fa73e||0xcc;return function(_0x3638ae){if(_0x3638ae){return _0x23b10c[_0x3cb0('0x1a')](_0x1fa73e);}return _0x23b10c[_0x3cb0('0x1b')](_0x1fa73e)[_0x3cb0('0x1c')]();};}function respondWithResult(_0xabb009,_0x59d89f){_0x59d89f=_0x59d89f||0xc8;return function(_0xa495e0){if(_0xa495e0){return _0xabb009['status'](_0x59d89f)[_0x3cb0('0x1d')](_0xa495e0);}};}function respondWithFilteredResult(_0x397725,_0x23a1cd){return function(_0x1b5538){if(_0x1b5538){var _0x4e91bf=typeof _0x23a1cd[_0x3cb0('0x1e')]===_0x3cb0('0x1f')&&typeof _0x23a1cd['limit']===_0x3cb0('0x1f');var _0x31eb0a=_0x1b5538[_0x3cb0('0x20')];var _0x41bf3d=_0x4e91bf?0x0:_0x23a1cd['offset'];var _0x1e8e38=_0x4e91bf?_0x1b5538[_0x3cb0('0x20')]:_0x23a1cd['offset']+_0x23a1cd[_0x3cb0('0x21')];var _0x50ba25;if(_0x1e8e38>=_0x31eb0a){_0x1e8e38=_0x31eb0a;_0x50ba25=0xc8;}else{_0x50ba25=0xce;}_0x397725[_0x3cb0('0x1b')](_0x50ba25);return _0x397725[_0x3cb0('0x22')](_0x3cb0('0x23'),_0x41bf3d+'-'+_0x1e8e38+'/'+_0x31eb0a)[_0x3cb0('0x1d')](_0x1b5538);}return null;};}function patchUpdates(_0x3474ed){return function(_0x324bec){try{jsonpatch['apply'](_0x324bec,_0x3474ed,!![]);}catch(_0x25414c){return BPromise['reject'](_0x25414c);}return _0x324bec[_0x3cb0('0x24')]();};}function saveUpdates(_0x2a833a,_0x1ebc1b){return function(_0x3225a9){if(_0x3225a9){return _0x3225a9[_0x3cb0('0x25')](_0x2a833a)[_0x3cb0('0x26')](function(_0x259937){return _0x259937;});}return null;};}function removeEntity(_0x1b35dc,_0x460878){return function(_0x38a681){if(_0x38a681){return _0x38a681['destroy']()[_0x3cb0('0x26')](function(){_0x1b35dc[_0x3cb0('0x1b')](0xcc)[_0x3cb0('0x1c')]();});}};}function handleEntityNotFound(_0xd8c9d9,_0x389263){return function(_0x446516){if(!_0x446516){_0xd8c9d9['sendStatus'](0x194);}return _0x446516;};}function handleError(_0x4d94cb,_0x2d92e5){_0x2d92e5=_0x2d92e5||0x1f4;return function(_0x4a4402){logger[_0x3cb0('0x27')](_0x4a4402[_0x3cb0('0x28')]);if(_0x4a4402[_0x3cb0('0x29')]){delete _0x4a4402['name'];}_0x4d94cb[_0x3cb0('0x1b')](_0x2d92e5)['send'](_0x4a4402);};}exports['index']=function(_0x5265ce,_0x2ea11b){var _0x4304c4={},_0x38a4a3={},_0x39b37d={'count':0x0,'rows':[]};var _0xdd660c=_[_0x3cb0('0x2a')](db[_0x3cb0('0x2b')][_0x3cb0('0x2c')],function(_0x2a22c0){return{'name':_0x2a22c0[_0x3cb0('0x2d')],'type':_0x2a22c0[_0x3cb0('0x2e')]['key']};});_0x38a4a3[_0x3cb0('0x2f')]=_[_0x3cb0('0x2a')](_0xdd660c,_0x3cb0('0x29'));_0x38a4a3[_0x3cb0('0x30')]=_[_0x3cb0('0x31')](_0x5265ce[_0x3cb0('0x30')]);_0x38a4a3['filters']=_[_0x3cb0('0x32')](_0x38a4a3[_0x3cb0('0x2f')],_0x38a4a3[_0x3cb0('0x30')]);_0x4304c4[_0x3cb0('0x33')]=_[_0x3cb0('0x32')](_0x38a4a3[_0x3cb0('0x2f')],qs[_0x3cb0('0x34')](_0x5265ce[_0x3cb0('0x30')][_0x3cb0('0x34')]));_0x4304c4[_0x3cb0('0x33')]=_0x4304c4[_0x3cb0('0x33')]['length']?_0x4304c4[_0x3cb0('0x33')]:_0x38a4a3[_0x3cb0('0x2f')];if(!_0x5265ce[_0x3cb0('0x30')][_0x3cb0('0x35')]('nolimit')){_0x4304c4[_0x3cb0('0x21')]=qs[_0x3cb0('0x21')](_0x5265ce[_0x3cb0('0x30')][_0x3cb0('0x21')]);_0x4304c4[_0x3cb0('0x1e')]=qs[_0x3cb0('0x1e')](_0x5265ce[_0x3cb0('0x30')][_0x3cb0('0x1e')]);}_0x4304c4['order']=qs[_0x3cb0('0x36')](_0x5265ce['query'][_0x3cb0('0x36')]);_0x4304c4[_0x3cb0('0x37')]=qs[_0x3cb0('0x38')](_['pick'](_0x5265ce[_0x3cb0('0x30')],_0x38a4a3[_0x3cb0('0x38')]),_0xdd660c);if(_0x5265ce['query']['filter']){_0x4304c4[_0x3cb0('0x37')]=_[_0x3cb0('0x39')](_0x4304c4['where'],{'$or':_[_0x3cb0('0x2a')](_0xdd660c,function(_0x5a7af5){if(_0x5a7af5[_0x3cb0('0x2e')]!==_0x3cb0('0x3a')){var _0x244cfd={};_0x244cfd[_0x5a7af5[_0x3cb0('0x29')]]={'$like':'%'+_0x5265ce[_0x3cb0('0x30')]['filter']+'%'};return _0x244cfd;}})});}_0x4304c4=_['merge']({},_0x4304c4,_0x5265ce[_0x3cb0('0x3b')]);var _0x4b4528={'where':_0x4304c4['where']};return db['IntegrationReport'][_0x3cb0('0x20')](_0x4b4528)[_0x3cb0('0x26')](function(_0x234397){_0x39b37d[_0x3cb0('0x20')]=_0x234397;if(_0x5265ce[_0x3cb0('0x30')][_0x3cb0('0x3c')]){_0x4304c4[_0x3cb0('0x3d')]=[{'all':!![]}];}return db[_0x3cb0('0x2b')][_0x3cb0('0x3e')](_0x4304c4);})[_0x3cb0('0x26')](function(_0x151268){_0x39b37d[_0x3cb0('0x3f')]=_0x151268;return _0x39b37d;})['then'](respondWithFilteredResult(_0x2ea11b,_0x4304c4))['catch'](handleError(_0x2ea11b,null));};exports['show']=function(_0x40fb53,_0x228557){var _0x508e88={'raw':![],'where':{'id':_0x40fb53[_0x3cb0('0x40')]['id']}},_0x3e2a65={};_0x3e2a65[_0x3cb0('0x2f')]=_['keys'](db[_0x3cb0('0x2b')]['rawAttributes']);_0x3e2a65[_0x3cb0('0x30')]=_[_0x3cb0('0x31')](_0x40fb53[_0x3cb0('0x30')]);_0x3e2a65[_0x3cb0('0x38')]=_[_0x3cb0('0x32')](_0x3e2a65[_0x3cb0('0x2f')],_0x3e2a65[_0x3cb0('0x30')]);_0x508e88[_0x3cb0('0x33')]=_[_0x3cb0('0x32')](_0x3e2a65[_0x3cb0('0x2f')],qs['fields'](_0x40fb53['query']['fields']));_0x508e88['attributes']=_0x508e88[_0x3cb0('0x33')][_0x3cb0('0x41')]?_0x508e88[_0x3cb0('0x33')]:_0x3e2a65[_0x3cb0('0x2f')];if(_0x40fb53['query'][_0x3cb0('0x3c')]){_0x508e88[_0x3cb0('0x3d')]=[{'all':!![]}];}_0x508e88=_[_0x3cb0('0x39')]({},_0x508e88,_0x40fb53[_0x3cb0('0x3b')]);return db[_0x3cb0('0x2b')][_0x3cb0('0x42')](_0x508e88)['then'](handleEntityNotFound(_0x228557,null))[_0x3cb0('0x26')](respondWithResult(_0x228557,null))[_0x3cb0('0x43')](handleError(_0x228557,null));};exports['create']=function(_0x1a4561,_0x4a106b){return db['IntegrationReport'][_0x3cb0('0x44')](_0x1a4561['body'],{})[_0x3cb0('0x26')](respondWithResult(_0x4a106b,0xc9))[_0x3cb0('0x43')](handleError(_0x4a106b,null));};exports['update']=function(_0x35e142,_0xb38dc3){if(_0x35e142[_0x3cb0('0x45')]['id']){delete _0x35e142['body']['id'];}return db[_0x3cb0('0x2b')][_0x3cb0('0x42')]({'where':{'id':_0x35e142[_0x3cb0('0x40')]['id']}})[_0x3cb0('0x26')](handleEntityNotFound(_0xb38dc3,null))[_0x3cb0('0x26')](saveUpdates(_0x35e142[_0x3cb0('0x45')],null))[_0x3cb0('0x26')](respondWithResult(_0xb38dc3,null))[_0x3cb0('0x43')](handleError(_0xb38dc3,null));};exports[_0x3cb0('0x46')]=function(_0x474ceb,_0x59482b){return db[_0x3cb0('0x2b')][_0x3cb0('0x42')]({'where':{'id':_0x474ceb[_0x3cb0('0x40')]['id']}})[_0x3cb0('0x26')](handleEntityNotFound(_0x59482b,null))[_0x3cb0('0x26')](removeEntity(_0x59482b,null))[_0x3cb0('0x43')](handleError(_0x59482b,null));};exports['describe']=function(_0x672bb5,_0x3af3d0){return db['IntegrationReport'][_0x3cb0('0x47')]()[_0x3cb0('0x26')](respondWithResult(_0x3af3d0,null))[_0x3cb0('0x43')](handleError(_0x3af3d0,null));};
\ No newline at end of file
index 629c791..4e32157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80f1=['report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','IntegrationReport'];(function(_0x47ff05,_0x2d59c1){var _0x3983e1=function(_0xa0bce8){while(--_0xa0bce8){_0x47ff05['push'](_0x47ff05['shift']());}};_0x3983e1(++_0x2d59c1);}(_0x80f1,0x12c));var _0x180f=function(_0xcb798d,_0x30aaf4){_0xcb798d=_0xcb798d-0x0;var _0x31b355=_0x80f1[_0xcb798d];return _0x31b355;};'use strict';var _=require(_0x180f('0x0'));var util=require(_0x180f('0x1'));var logger=require(_0x180f('0x2'))(_0x180f('0x3'));var moment=require('moment');var BPromise=require(_0x180f('0x4'));var rp=require(_0x180f('0x5'));var fs=require('fs');var path=require(_0x180f('0x6'));var rimraf=require(_0x180f('0x7'));var config=require(_0x180f('0x8'));var attributes=require('./integrationReport.attributes');module[_0x180f('0x9')]=function(_0x219891,_0x20e6fb){return _0x219891[_0x180f('0xa')](_0x180f('0xb'),attributes,{'tableName':_0x180f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4ff=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api'];(function(_0x10d0f0,_0x1eba3d){var _0x93e308=function(_0x388548){while(--_0x388548){_0x10d0f0['push'](_0x10d0f0['shift']());}};_0x93e308(++_0x1eba3d);}(_0xf4ff,0x1a0));var _0xff4f=function(_0x3d3736,_0x3529f8){_0x3d3736=_0x3d3736-0x0;var _0x81add8=_0xf4ff[_0x3d3736];return _0x81add8;};'use strict';var _=require(_0xff4f('0x0'));var util=require(_0xff4f('0x1'));var logger=require(_0xff4f('0x2'))(_0xff4f('0x3'));var moment=require(_0xff4f('0x4'));var BPromise=require(_0xff4f('0x5'));var rp=require(_0xff4f('0x6'));var fs=require('fs');var path=require(_0xff4f('0x7'));var rimraf=require(_0xff4f('0x8'));var config=require(_0xff4f('0x9'));var attributes=require('./integrationReport.attributes');module[_0xff4f('0xa')]=function(_0x2685a4,_0x118c7b){return _0x2685a4[_0xff4f('0xb')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df5106e..7feab84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xc2c7,0x134));var _0x7c2c=function(_0x57541c,_0x193094){_0x57541c=_0x57541c-0x0;var _0x3c0794=_0xc2c7[_0x57541c];return _0x3c0794;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
+var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0x687b,0x14a));var _0xb687=function(_0xb7202,_0x4aa500){_0xb7202=_0xb7202-0x0;var _0x6488bb=_0x687b[_0xb7202];return _0x6488bb;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}
\ No newline at end of file
index 34d5590..65f23ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe958=['addIntervals','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many'];(function(_0xe31fd,_0x4b6399){var _0x5715d0=function(_0x41bf1b){while(--_0x41bf1b){_0xe31fd['push'](_0xe31fd['shift']());}};_0x5715d0(++_0x4b6399);}(_0xe958,0x191));var _0x8e95=function(_0x45e681,_0x4a2b8d){_0x45e681=_0x45e681-0x0;var _0x1a4430=_0xe958[_0x45e681];return _0x1a4430;};'use strict';var multer=require('multer');var util=require(_0x8e95('0x0'));var path=require(_0x8e95('0x1'));var timeout=require(_0x8e95('0x2'));var express=require(_0x8e95('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e95('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8e95('0x5'));var controller=require(_0x8e95('0x6'));router[_0x8e95('0x7')]('/',auth[_0x8e95('0x8')](),controller[_0x8e95('0x9')]);router[_0x8e95('0x7')](_0x8e95('0xa'),auth[_0x8e95('0x8')](),controller['show']);router[_0x8e95('0x7')](_0x8e95('0xb'),auth[_0x8e95('0x8')](),controller[_0x8e95('0xc')]);router[_0x8e95('0xd')]('/',auth[_0x8e95('0x8')](),controller[_0x8e95('0xe')]);router[_0x8e95('0xd')]('/:id/sub_intervals',auth[_0x8e95('0x8')](),controller[_0x8e95('0xf')]);router[_0x8e95('0xd')](_0x8e95('0x10'),auth[_0x8e95('0x8')](),controller[_0x8e95('0x11')]);router[_0x8e95('0x12')](_0x8e95('0xa'),auth[_0x8e95('0x8')](),controller['update']);router[_0x8e95('0x13')](_0x8e95('0xa'),auth[_0x8e95('0x8')](),controller[_0x8e95('0x14')]);module[_0x8e95('0x15')]=router;
\ No newline at end of file
+var _0x28ff=['fs-extra','../../components/auth/service','../../config/environment','./interval.controller','index','get','/:id','show','/:id/sub_intervals','isAuthenticated','getIntervals','create','post','put','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x3772be,_0x1b2319){var _0x2ff6b9=function(_0x5401cf){while(--_0x5401cf){_0x3772be['push'](_0x3772be['shift']());}};_0x2ff6b9(++_0x1b2319);}(_0x28ff,0x7a));var _0xf28f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x28ff[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xf28f('0x0'));var path=require(_0xf28f('0x1'));var timeout=require(_0xf28f('0x2'));var express=require('express');var router=express[_0xf28f('0x3')]();var fs_extra=require(_0xf28f('0x4'));var auth=require(_0xf28f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf28f('0x6'));var controller=require(_0xf28f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf28f('0x8')]);router[_0xf28f('0x9')](_0xf28f('0xa'),auth['isAuthenticated'](),controller[_0xf28f('0xb')]);router['get'](_0xf28f('0xc'),auth[_0xf28f('0xd')](),controller[_0xf28f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf28f('0xf')]);router['post'](_0xf28f('0xc'),auth[_0xf28f('0xd')](),controller['addInterval']);router[_0xf28f('0x10')]('/:id/sub_intervals/create_many',auth[_0xf28f('0xd')](),controller['addIntervals']);router[_0xf28f('0x11')](_0xf28f('0xa'),auth[_0xf28f('0xd')](),controller[_0xf28f('0x12')]);router['delete'](_0xf28f('0xa'),auth[_0xf28f('0xd')](),controller[_0xf28f('0x13')]);module[_0xf28f('0x14')]=router;
\ No newline at end of file
index 968262a..8db12ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x346c=['STRING','sequelize','exports'];(function(_0x2629c0,_0x2289fa){var _0x476b1b=function(_0x3eed69){while(--_0x3eed69){_0x2629c0['push'](_0x2629c0['shift']());}};_0x476b1b(++_0x2289fa);}(_0x346c,0xbe));var _0xc346=function(_0xb00e3e,_0x476d2b){_0xb00e3e=_0xb00e3e-0x0;var _0x51922a=_0x346c[_0xb00e3e];return _0x51922a;};'use strict';var Sequelize=require(_0xc346('0x0'));module[_0xc346('0x1')]={'name':{'type':Sequelize[_0xc346('0x2')]},'description':{'type':Sequelize[_0xc346('0x2')]},'interval':{'type':Sequelize[_0xc346('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x0620=['STRING'];(function(_0x273b16,_0x2fbdfa){var _0x1e5a10=function(_0x173fe3){while(--_0x173fe3){_0x273b16['push'](_0x273b16['shift']());}};_0x1e5a10(++_0x2fbdfa);}(_0x0620,0x163));var _0x0062=function(_0x3659f9,_0x51d987){_0x3659f9=_0x3659f9-0x0;var _0x475db5=_0x0620[_0x3659f9];return _0x475db5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0062('0x0')]},'description':{'type':Sequelize[_0x0062('0x0')]},'interval':{'type':Sequelize[_0x0062('0x0')],'allowNull':!![]}};
\ No newline at end of file
index c93ab53..2b1c6c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc396=['keys','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','show','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','IntervalId','findAll','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','get','Intervals','error','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x54a3eb,_0xa80aeb){var _0x5df3ae=function(_0xd49950){while(--_0xd49950){_0x54a3eb['push'](_0x54a3eb['shift']());}};_0x5df3ae(++_0xa80aeb);}(_0xc396,0x81));var _0x6c39=function(_0x3c6c25,_0x485676){_0x3c6c25=_0x3c6c25-0x0;var _0x1f9c31=_0xc396[_0x3c6c25];return _0x1f9c31;};'use strict';var emlformat=require(_0x6c39('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c39('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6c39('0x2'));var BPromise=require(_0x6c39('0x3'));var Mustache=require(_0x6c39('0x4'));var util=require(_0x6c39('0x5'));var path=require('path');var sox=require(_0x6c39('0x6'));var csv=require(_0x6c39('0x7'));var ejs=require(_0x6c39('0x8'));var fs=require('fs');var fs_extra=require(_0x6c39('0x9'));var _=require(_0x6c39('0xa'));var squel=require(_0x6c39('0xb'));var crypto=require(_0x6c39('0xc'));var jsforce=require(_0x6c39('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6c39('0x7'));var querystring=require(_0x6c39('0xe'));var Papa=require(_0x6c39('0xf'));var Redis=require(_0x6c39('0x10'));var authService=require(_0x6c39('0x11'));var qs=require(_0x6c39('0x12'));var as=require(_0x6c39('0x13'));var hardwareService=require(_0x6c39('0x14'));var logger=require(_0x6c39('0x15'))(_0x6c39('0x16'));var utils=require(_0x6c39('0x17'));var config=require(_0x6c39('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c39('0x19'))['db'];var extensions=require(_0x6c39('0x1a'));function respondWithStatusCode(_0x14ee66,_0x3eb292){_0x3eb292=_0x3eb292||0xcc;return function(_0x14bda2){if(_0x14bda2){return _0x14ee66[_0x6c39('0x1b')](_0x3eb292);}return _0x14ee66[_0x6c39('0x1c')](_0x3eb292)[_0x6c39('0x1d')]();};}function respondWithResult(_0x490166,_0x5e07ae){_0x5e07ae=_0x5e07ae||0xc8;return function(_0x5ed4be){if(_0x5ed4be){return _0x490166[_0x6c39('0x1c')](_0x5e07ae)[_0x6c39('0x1e')](_0x5ed4be);}};}function respondWithFilteredResult(_0xcd6774,_0xb05409){return function(_0x2b0096){if(_0x2b0096){var _0xc9f52=typeof _0xb05409[_0x6c39('0x1f')]===_0x6c39('0x20')&&typeof _0xb05409[_0x6c39('0x21')]==='undefined';var _0x5acbb0=_0x2b0096[_0x6c39('0x22')];var _0x2f338f=_0xc9f52?0x0:_0xb05409[_0x6c39('0x1f')];var _0x160df4=_0xc9f52?_0x2b0096[_0x6c39('0x22')]:_0xb05409[_0x6c39('0x1f')]+_0xb05409['limit'];var _0x48d212;if(_0x160df4>=_0x5acbb0){_0x160df4=_0x5acbb0;_0x48d212=0xc8;}else{_0x48d212=0xce;}_0xcd6774[_0x6c39('0x1c')](_0x48d212);return _0xcd6774['set'](_0x6c39('0x23'),_0x2f338f+'-'+_0x160df4+'/'+_0x5acbb0)['json'](_0x2b0096);}return null;};}function patchUpdates(_0x273f24){return function(_0x3c0bfa){try{jsonpatch['apply'](_0x3c0bfa,_0x273f24,!![]);}catch(_0x4a9619){return BPromise[_0x6c39('0x24')](_0x4a9619);}return _0x3c0bfa[_0x6c39('0x25')]();};}function saveUpdates(_0x7999aa,_0x29244b){return function(_0x57f97b){if(_0x57f97b){return _0x57f97b[_0x6c39('0x26')](_0x7999aa)[_0x6c39('0x27')](function(_0x5d5902){return _0x5d5902;});}return null;};}function removeEntity(_0x104e75,_0x4cd5e3){return function(_0x5bed53){if(_0x5bed53){return _0x5bed53[_0x6c39('0x28')]()[_0x6c39('0x27')](function(){var _0x1d3369=_0x5bed53[_0x6c39('0x29')]({'plain':!![]});var _0x1a05e3=_0x6c39('0x2a');return db['UserProfileResource'][_0x6c39('0x28')]({'where':{'type':_0x1a05e3,'resourceId':_0x1d3369['id']}})[_0x6c39('0x27')](function(){return _0x5bed53;});})[_0x6c39('0x27')](function(){_0x104e75[_0x6c39('0x1c')](0xcc)[_0x6c39('0x1d')]();});}};}function handleEntityNotFound(_0x31fa15,_0x1db0d0){return function(_0x22bbeb){if(!_0x22bbeb){_0x31fa15[_0x6c39('0x1b')](0x194);}return _0x22bbeb;};}function handleError(_0x683c8b,_0x2356aa){_0x2356aa=_0x2356aa||0x1f4;return function(_0x1f39ee){logger[_0x6c39('0x2b')](_0x1f39ee['stack']);if(_0x1f39ee[_0x6c39('0x2c')]){delete _0x1f39ee[_0x6c39('0x2c')];}_0x683c8b[_0x6c39('0x1c')](_0x2356aa)[_0x6c39('0x2d')](_0x1f39ee);};}exports[_0x6c39('0x2e')]=function(_0x3e160d,_0x1577c4){var _0x24e407={},_0x114889={},_0x175f81={'count':0x0,'rows':[]};var _0x53e0c0=_['map'](db[_0x6c39('0x2f')][_0x6c39('0x30')],function(_0x4b9786){return{'name':_0x4b9786[_0x6c39('0x31')],'type':_0x4b9786[_0x6c39('0x32')][_0x6c39('0x33')]};});_0x114889[_0x6c39('0x34')]=_[_0x6c39('0x35')](_0x53e0c0,'name');_0x114889[_0x6c39('0x36')]=_[_0x6c39('0x37')](_0x3e160d['query']);_0x114889[_0x6c39('0x38')]=_[_0x6c39('0x39')](_0x114889[_0x6c39('0x34')],_0x114889[_0x6c39('0x36')]);_0x24e407[_0x6c39('0x3a')]=_[_0x6c39('0x39')](_0x114889[_0x6c39('0x34')],qs['fields'](_0x3e160d[_0x6c39('0x36')]['fields']));_0x24e407['attributes']=_0x24e407[_0x6c39('0x3a')][_0x6c39('0x3b')]?_0x24e407[_0x6c39('0x3a')]:_0x114889[_0x6c39('0x34')];if(!_0x3e160d['query']['hasOwnProperty'](_0x6c39('0x3c'))){_0x24e407[_0x6c39('0x21')]=qs[_0x6c39('0x21')](_0x3e160d[_0x6c39('0x36')][_0x6c39('0x21')]);_0x24e407[_0x6c39('0x1f')]=qs[_0x6c39('0x1f')](_0x3e160d['query']['offset']);}_0x24e407[_0x6c39('0x3d')]=qs[_0x6c39('0x3e')](_0x3e160d[_0x6c39('0x36')]['sort']);_0x24e407['where']=qs[_0x6c39('0x38')](_[_0x6c39('0x3f')](_0x3e160d[_0x6c39('0x36')],_0x114889[_0x6c39('0x38')]),_0x53e0c0);if(_0x3e160d[_0x6c39('0x36')][_0x6c39('0x40')]){_0x24e407[_0x6c39('0x41')]=_['merge'](_0x24e407[_0x6c39('0x41')],{'$or':_[_0x6c39('0x35')](_0x53e0c0,function(_0x2a8dcd){if(_0x2a8dcd['type']!==_0x6c39('0x42')){var _0x287aef={};_0x287aef[_0x2a8dcd['name']]={'$like':'%'+_0x3e160d['query'][_0x6c39('0x40')]+'%'};return _0x287aef;}})});}_0x24e407=_[_0x6c39('0x43')]({},_0x24e407,_0x3e160d[_0x6c39('0x44')]);var _0x20a650={'where':_0x24e407[_0x6c39('0x41')]};return db[_0x6c39('0x2f')][_0x6c39('0x22')](_0x20a650)[_0x6c39('0x27')](function(_0x416f3c){_0x175f81['count']=_0x416f3c;if(_0x3e160d['query']['includeAll']){_0x24e407[_0x6c39('0x45')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x24e407);})['then'](function(_0x36afe5){_0x175f81[_0x6c39('0x46')]=_0x36afe5;return _0x175f81;})[_0x6c39('0x27')](respondWithFilteredResult(_0x1577c4,_0x24e407))[_0x6c39('0x47')](handleError(_0x1577c4,null));};exports[_0x6c39('0x48')]=function(_0x3df670,_0x16e732){var _0x423a08={'raw':!![],'where':{'id':_0x3df670[_0x6c39('0x49')]['id']}},_0x4da258={};_0x4da258[_0x6c39('0x34')]=_[_0x6c39('0x37')](db[_0x6c39('0x2f')][_0x6c39('0x30')]);_0x4da258[_0x6c39('0x36')]=_[_0x6c39('0x37')](_0x3df670['query']);_0x4da258[_0x6c39('0x38')]=_[_0x6c39('0x39')](_0x4da258[_0x6c39('0x34')],_0x4da258[_0x6c39('0x36')]);_0x423a08[_0x6c39('0x3a')]=_[_0x6c39('0x39')](_0x4da258[_0x6c39('0x34')],qs[_0x6c39('0x4a')](_0x3df670['query'][_0x6c39('0x4a')]));_0x423a08[_0x6c39('0x3a')]=_0x423a08[_0x6c39('0x3a')][_0x6c39('0x3b')]?_0x423a08[_0x6c39('0x3a')]:_0x4da258[_0x6c39('0x34')];if(_0x3df670[_0x6c39('0x36')][_0x6c39('0x4b')]){_0x423a08[_0x6c39('0x45')]=[{'all':!![]}];}_0x423a08=_[_0x6c39('0x43')]({},_0x423a08,_0x3df670[_0x6c39('0x44')]);return db[_0x6c39('0x2f')][_0x6c39('0x4c')](_0x423a08)['then'](handleEntityNotFound(_0x16e732,null))[_0x6c39('0x27')](respondWithResult(_0x16e732,null))[_0x6c39('0x47')](handleError(_0x16e732,null));};exports['create']=function(_0x3f5f01,_0x30aa5f){return db[_0x6c39('0x2f')][_0x6c39('0x4d')](_0x3f5f01[_0x6c39('0x4e')],{})['then'](function(_0x2693fc){var _0x5dc26b=_0x3f5f01[_0x6c39('0x4f')]['get']({'plain':!![]});if(!_0x5dc26b)throw new Error(_0x6c39('0x50'));if(_0x5dc26b['role']===_0x6c39('0x4f')){var _0x5af4c5=_0x2693fc[_0x6c39('0x29')]({'plain':!![]});var _0x87c317='Intervals';return db['UserProfileSection'][_0x6c39('0x4c')]({'where':{'name':_0x87c317,'userProfileId':_0x5dc26b['userProfileId']},'raw':!![]})[_0x6c39('0x27')](function(_0x142d9d){if(_0x142d9d&&_0x142d9d[_0x6c39('0x51')]===0x0){return db['UserProfileResource'][_0x6c39('0x4d')]({'name':_0x5af4c5[_0x6c39('0x2c')],'resourceId':_0x5af4c5['id'],'type':_0x142d9d[_0x6c39('0x2c')],'sectionId':_0x142d9d['id']},{})[_0x6c39('0x27')](function(){return _0x2693fc;});}else{return _0x2693fc;}})[_0x6c39('0x47')](function(_0x335106){logger[_0x6c39('0x2b')](_0x6c39('0x52'),_0x335106);throw _0x335106;});}return _0x2693fc;})[_0x6c39('0x27')](respondWithResult(_0x30aa5f,0xc9))['catch'](handleError(_0x30aa5f,null));};exports[_0x6c39('0x26')]=function(_0xe0aa5,_0x60ec7f){if(_0xe0aa5[_0x6c39('0x4e')]['id']){delete _0xe0aa5['body']['id'];}return db[_0x6c39('0x2f')]['find']({'where':{'id':_0xe0aa5[_0x6c39('0x49')]['id']}})[_0x6c39('0x27')](handleEntityNotFound(_0x60ec7f,null))[_0x6c39('0x27')](saveUpdates(_0xe0aa5[_0x6c39('0x4e')],null))[_0x6c39('0x27')](respondWithResult(_0x60ec7f,null))['catch'](handleError(_0x60ec7f,null));};exports[_0x6c39('0x28')]=function(_0x3964d5,_0x5ca3d3){return db[_0x6c39('0x2f')]['find']({'where':{'id':_0x3964d5[_0x6c39('0x49')]['id']}})[_0x6c39('0x27')](handleEntityNotFound(_0x5ca3d3,null))[_0x6c39('0x27')](removeEntity(_0x5ca3d3,null))[_0x6c39('0x47')](handleError(_0x5ca3d3,null));};exports[_0x6c39('0x53')]=function(_0x31711b,_0x573d63,_0x491eb7){if(_0x31711b[_0x6c39('0x4e')]['id']){delete _0x31711b[_0x6c39('0x4e')]['id'];}return db[_0x6c39('0x2f')][_0x6c39('0x4c')]({'where':{'id':_0x31711b['params']['id']}})[_0x6c39('0x27')](handleEntityNotFound(_0x573d63,null))[_0x6c39('0x27')](function(_0x2d00bb){if(_0x2d00bb){_0x31711b[_0x6c39('0x4e')]['IntervalId']=_0x2d00bb['id'];return db['Interval'][_0x6c39('0x4d')](_0x31711b[_0x6c39('0x4e')]);}})[_0x6c39('0x27')](respondWithResult(_0x573d63,null))[_0x6c39('0x47')](handleError(_0x573d63,null));};exports[_0x6c39('0x54')]=function(_0x1ec825,_0x542c9b,_0x5e1ecc){var _0x3b86da={};var _0x562e7b={};var _0x207fe0;var _0x1f42f6;return db[_0x6c39('0x2f')][_0x6c39('0x55')]({'where':{'id':_0x1ec825[_0x6c39('0x49')]['id']}})[_0x6c39('0x27')](handleEntityNotFound(_0x542c9b,null))['then'](function(_0x38403f){if(_0x38403f){_0x207fe0=_0x38403f;_0x562e7b[_0x6c39('0x34')]=_[_0x6c39('0x37')](db['Interval'][_0x6c39('0x30')]);_0x562e7b[_0x6c39('0x36')]=_[_0x6c39('0x37')](_0x1ec825[_0x6c39('0x36')]);_0x562e7b[_0x6c39('0x38')]=_[_0x6c39('0x39')](_0x562e7b[_0x6c39('0x34')],_0x562e7b[_0x6c39('0x36')]);_0x3b86da[_0x6c39('0x3a')]=_['intersection'](_0x562e7b[_0x6c39('0x34')],qs[_0x6c39('0x4a')](_0x1ec825[_0x6c39('0x36')]['fields']));_0x3b86da[_0x6c39('0x3a')]=_0x3b86da[_0x6c39('0x3a')]['length']?_0x3b86da[_0x6c39('0x3a')]:_0x562e7b[_0x6c39('0x34')];_0x3b86da[_0x6c39('0x3d')]=qs['sort'](_0x1ec825['query'][_0x6c39('0x3e')]);_0x3b86da[_0x6c39('0x41')]=qs[_0x6c39('0x38')](_[_0x6c39('0x3f')](_0x1ec825[_0x6c39('0x36')],_0x562e7b[_0x6c39('0x38')]));if(_0x1ec825[_0x6c39('0x36')][_0x6c39('0x40')]){_0x3b86da[_0x6c39('0x41')]=_[_0x6c39('0x43')](_0x3b86da[_0x6c39('0x41')],{'$or':_[_0x6c39('0x35')](_0x3b86da['attributes'],function(_0x354e25){var _0x5bf92c={};_0x5bf92c[_0x354e25]={'$like':'%'+_0x1ec825['query']['filter']+'%'};return _0x5bf92c;})});}_0x3b86da=_[_0x6c39('0x43')]({},_0x3b86da,_0x1ec825[_0x6c39('0x44')]);return _0x207fe0[_0x6c39('0x54')](_0x3b86da);}})['then'](function(_0x245e79){if(_0x245e79){_0x1f42f6=_0x245e79[_0x6c39('0x3b')];if(!_0x1ec825[_0x6c39('0x36')][_0x6c39('0x56')](_0x6c39('0x3c'))){_0x3b86da[_0x6c39('0x21')]=qs[_0x6c39('0x21')](_0x1ec825[_0x6c39('0x36')][_0x6c39('0x21')]);_0x3b86da['offset']=qs[_0x6c39('0x1f')](_0x1ec825['query'][_0x6c39('0x1f')]);}return _0x207fe0[_0x6c39('0x54')](_0x3b86da);}})[_0x6c39('0x27')](function(_0x52fabf){if(_0x52fabf){return _0x52fabf?{'count':_0x1f42f6,'rows':_0x52fabf}:null;}})[_0x6c39('0x27')](respondWithResult(_0x542c9b,null))[_0x6c39('0x47')](handleError(_0x542c9b,null));};exports[_0x6c39('0x57')]=function(_0x1a5610,_0x1c6a51,_0x41b782){return db[_0x6c39('0x2f')]['findOne']({'where':{'id':_0x1a5610[_0x6c39('0x49')]['id']}})[_0x6c39('0x27')](handleEntityNotFound(_0x1c6a51,null))[_0x6c39('0x27')](function(_0x161d6f){if(_0x161d6f){return db[_0x6c39('0x58')][_0x6c39('0x59')](function(_0x10cc08){return db['Interval'][_0x6c39('0x28')]({'where':{'IntervalId':_0x1a5610[_0x6c39('0x49')]['id']},'transaction':_0x10cc08})[_0x6c39('0x27')](function(_0xd99a0){var _0x15eb65=_[_0x6c39('0x35')](_0x1a5610[_0x6c39('0x4e')],function(_0x37a6ea){delete _0x37a6ea['id'];_0x37a6ea[_0x6c39('0x5a')]=_0x1a5610['params']['id'];return _0x37a6ea;});return db['Interval']['bulkCreate'](_0x15eb65,{'transaction':_0x10cc08});});})[_0x6c39('0x27')](function(){return db['Interval'][_0x6c39('0x5b')]({'where':{'IntervalId':_0x1a5610[_0x6c39('0x49')]['id']}});});}})[_0x6c39('0x27')](respondWithResult(_0x1c6a51,null))['catch'](handleError(_0x1c6a51,null));};
\ No newline at end of file
+var _0x93a7=['params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','IntervalId','getIntervals','findOne','pick','merge','nolimit','addIntervals','sequelize','transaction','bulkCreate','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','name','send','index','map','Interval','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show'];(function(_0x30e768,_0x4e6d9d){var _0x5cc281=function(_0x12c6a3){while(--_0x12c6a3){_0x30e768['push'](_0x30e768['shift']());}};_0x5cc281(++_0x4e6d9d);}(_0x93a7,0x124));var _0x793a=function(_0x438117,_0x532a7d){_0x438117=_0x438117-0x0;var _0x285f68=_0x93a7[_0x438117];return _0x285f68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x793a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x793a('0x1'));var rp=require(_0x793a('0x2'));var moment=require(_0x793a('0x3'));var BPromise=require(_0x793a('0x4'));var Mustache=require(_0x793a('0x5'));var util=require('util');var path=require(_0x793a('0x6'));var sox=require(_0x793a('0x7'));var csv=require(_0x793a('0x8'));var ejs=require(_0x793a('0x9'));var fs=require('fs');var fs_extra=require(_0x793a('0xa'));var _=require(_0x793a('0xb'));var squel=require(_0x793a('0xc'));var crypto=require(_0x793a('0xd'));var jsforce=require(_0x793a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x793a('0x8'));var querystring=require(_0x793a('0xf'));var Papa=require('papaparse');var Redis=require(_0x793a('0x10'));var authService=require(_0x793a('0x11'));var qs=require(_0x793a('0x12'));var as=require(_0x793a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x793a('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x793a('0x15'));var licenseUtil=require(_0x793a('0x16'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x240595,_0x583f9e){_0x583f9e=_0x583f9e||0xcc;return function(_0x37708d){if(_0x37708d){return _0x240595[_0x793a('0x17')](_0x583f9e);}return _0x240595[_0x793a('0x18')](_0x583f9e)[_0x793a('0x19')]();};}function respondWithResult(_0x7a8da4,_0x4ef49b){_0x4ef49b=_0x4ef49b||0xc8;return function(_0x1a16d2){if(_0x1a16d2){return _0x7a8da4[_0x793a('0x18')](_0x4ef49b)[_0x793a('0x1a')](_0x1a16d2);}};}function respondWithFilteredResult(_0x2d9537,_0x35c23d){return function(_0xa3f80f){if(_0xa3f80f){var _0x508304=typeof _0x35c23d[_0x793a('0x1b')]===_0x793a('0x1c')&&typeof _0x35c23d[_0x793a('0x1d')]===_0x793a('0x1c');var _0x5a276f=_0xa3f80f[_0x793a('0x1e')];var _0x5c4161=_0x508304?0x0:_0x35c23d[_0x793a('0x1b')];var _0x5e9e8b=_0x508304?_0xa3f80f[_0x793a('0x1e')]:_0x35c23d['offset']+_0x35c23d[_0x793a('0x1d')];var _0x318943;if(_0x5e9e8b>=_0x5a276f){_0x5e9e8b=_0x5a276f;_0x318943=0xc8;}else{_0x318943=0xce;}_0x2d9537['status'](_0x318943);return _0x2d9537[_0x793a('0x1f')](_0x793a('0x20'),_0x5c4161+'-'+_0x5e9e8b+'/'+_0x5a276f)[_0x793a('0x1a')](_0xa3f80f);}return null;};}function patchUpdates(_0x417bf7){return function(_0xe057c4){try{jsonpatch[_0x793a('0x21')](_0xe057c4,_0x417bf7,!![]);}catch(_0x505006){return BPromise['reject'](_0x505006);}return _0xe057c4[_0x793a('0x22')]();};}function saveUpdates(_0x35eec8,_0x214293){return function(_0x46f1d2){if(_0x46f1d2){return _0x46f1d2[_0x793a('0x23')](_0x35eec8)[_0x793a('0x24')](function(_0x4e055c){return _0x4e055c;});}return null;};}function removeEntity(_0x3024a4,_0x56705f){return function(_0x40dea4){if(_0x40dea4){return _0x40dea4[_0x793a('0x25')]()[_0x793a('0x24')](function(){var _0x5e4a3b=_0x40dea4[_0x793a('0x26')]({'plain':!![]});var _0xf3c95c=_0x793a('0x27');return db[_0x793a('0x28')][_0x793a('0x25')]({'where':{'type':_0xf3c95c,'resourceId':_0x5e4a3b['id']}})[_0x793a('0x24')](function(){return _0x40dea4;});})['then'](function(){_0x3024a4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cf3ce,_0x3862d6){return function(_0x5c2085){if(!_0x5c2085){_0x2cf3ce[_0x793a('0x17')](0x194);}return _0x5c2085;};}function handleError(_0x358b94,_0x33c905){_0x33c905=_0x33c905||0x1f4;return function(_0x2e2677){logger['error'](_0x2e2677['stack']);if(_0x2e2677['name']){delete _0x2e2677[_0x793a('0x29')];}_0x358b94[_0x793a('0x18')](_0x33c905)[_0x793a('0x2a')](_0x2e2677);};}exports[_0x793a('0x2b')]=function(_0x17a3b7,_0x4b4ac5){var _0x1f8f6c={},_0x2a570a={},_0x51b716={'count':0x0,'rows':[]};var _0x1f14b0=_[_0x793a('0x2c')](db[_0x793a('0x2d')]['rawAttributes'],function(_0x596b80){return{'name':_0x596b80[_0x793a('0x2e')],'type':_0x596b80['type']['key']};});_0x2a570a[_0x793a('0x2f')]=_[_0x793a('0x2c')](_0x1f14b0,_0x793a('0x29'));_0x2a570a[_0x793a('0x30')]=_[_0x793a('0x31')](_0x17a3b7['query']);_0x2a570a['filters']=_[_0x793a('0x32')](_0x2a570a[_0x793a('0x2f')],_0x2a570a[_0x793a('0x30')]);_0x1f8f6c['attributes']=_[_0x793a('0x32')](_0x2a570a['model'],qs[_0x793a('0x33')](_0x17a3b7['query'][_0x793a('0x33')]));_0x1f8f6c['attributes']=_0x1f8f6c[_0x793a('0x34')][_0x793a('0x35')]?_0x1f8f6c[_0x793a('0x34')]:_0x2a570a[_0x793a('0x2f')];if(!_0x17a3b7['query'][_0x793a('0x36')]('nolimit')){_0x1f8f6c[_0x793a('0x1d')]=qs[_0x793a('0x1d')](_0x17a3b7[_0x793a('0x30')][_0x793a('0x1d')]);_0x1f8f6c['offset']=qs[_0x793a('0x1b')](_0x17a3b7[_0x793a('0x30')][_0x793a('0x1b')]);}_0x1f8f6c[_0x793a('0x37')]=qs['sort'](_0x17a3b7[_0x793a('0x30')][_0x793a('0x38')]);_0x1f8f6c['where']=qs[_0x793a('0x39')](_['pick'](_0x17a3b7[_0x793a('0x30')],_0x2a570a[_0x793a('0x39')]),_0x1f14b0);if(_0x17a3b7[_0x793a('0x30')]['filter']){_0x1f8f6c[_0x793a('0x3a')]=_['merge'](_0x1f8f6c[_0x793a('0x3a')],{'$or':_[_0x793a('0x2c')](_0x1f14b0,function(_0x458103){if(_0x458103[_0x793a('0x3b')]!==_0x793a('0x3c')){var _0x34640f={};_0x34640f[_0x458103[_0x793a('0x29')]]={'$like':'%'+_0x17a3b7[_0x793a('0x30')][_0x793a('0x3d')]+'%'};return _0x34640f;}})});}_0x1f8f6c=_['merge']({},_0x1f8f6c,_0x17a3b7[_0x793a('0x3e')]);var _0x2d5581={'where':_0x1f8f6c[_0x793a('0x3a')]};return db['Interval'][_0x793a('0x1e')](_0x2d5581)['then'](function(_0x4085b3){_0x51b716['count']=_0x4085b3;if(_0x17a3b7[_0x793a('0x30')][_0x793a('0x3f')]){_0x1f8f6c[_0x793a('0x40')]=[{'all':!![]}];}return db[_0x793a('0x2d')][_0x793a('0x41')](_0x1f8f6c);})[_0x793a('0x24')](function(_0x2c8502){_0x51b716[_0x793a('0x42')]=_0x2c8502;return _0x51b716;})[_0x793a('0x24')](respondWithFilteredResult(_0x4b4ac5,_0x1f8f6c))['catch'](handleError(_0x4b4ac5,null));};exports[_0x793a('0x43')]=function(_0xe01470,_0x63d1f7){var _0x106298={'raw':!![],'where':{'id':_0xe01470[_0x793a('0x44')]['id']}},_0x269b88={};_0x269b88[_0x793a('0x2f')]=_[_0x793a('0x31')](db[_0x793a('0x2d')][_0x793a('0x45')]);_0x269b88[_0x793a('0x30')]=_[_0x793a('0x31')](_0xe01470['query']);_0x269b88[_0x793a('0x39')]=_[_0x793a('0x32')](_0x269b88['model'],_0x269b88[_0x793a('0x30')]);_0x106298[_0x793a('0x34')]=_[_0x793a('0x32')](_0x269b88[_0x793a('0x2f')],qs[_0x793a('0x33')](_0xe01470[_0x793a('0x30')][_0x793a('0x33')]));_0x106298[_0x793a('0x34')]=_0x106298[_0x793a('0x34')][_0x793a('0x35')]?_0x106298['attributes']:_0x269b88[_0x793a('0x2f')];if(_0xe01470[_0x793a('0x30')][_0x793a('0x3f')]){_0x106298[_0x793a('0x40')]=[{'all':!![]}];}_0x106298=_['merge']({},_0x106298,_0xe01470[_0x793a('0x3e')]);return db[_0x793a('0x2d')]['find'](_0x106298)[_0x793a('0x24')](handleEntityNotFound(_0x63d1f7,null))[_0x793a('0x24')](respondWithResult(_0x63d1f7,null))[_0x793a('0x46')](handleError(_0x63d1f7,null));};exports['create']=function(_0x2f5cbd,_0x24da59){return db[_0x793a('0x2d')][_0x793a('0x47')](_0x2f5cbd[_0x793a('0x48')],{})[_0x793a('0x24')](function(_0x5a6bbf){var _0x127810=_0x2f5cbd[_0x793a('0x49')][_0x793a('0x26')]({'plain':!![]});if(!_0x127810)throw new Error(_0x793a('0x4a'));if(_0x127810[_0x793a('0x4b')]===_0x793a('0x49')){var _0x5591f3=_0x5a6bbf[_0x793a('0x26')]({'plain':!![]});var _0xd8165a=_0x793a('0x27');return db[_0x793a('0x4c')][_0x793a('0x4d')]({'where':{'name':_0xd8165a,'userProfileId':_0x127810['userProfileId']},'raw':!![]})[_0x793a('0x24')](function(_0x38443f){if(_0x38443f&&_0x38443f['autoAssociation']===0x0){return db[_0x793a('0x28')][_0x793a('0x47')]({'name':_0x5591f3[_0x793a('0x29')],'resourceId':_0x5591f3['id'],'type':_0x38443f['name'],'sectionId':_0x38443f['id']},{})[_0x793a('0x24')](function(){return _0x5a6bbf;});}else{return _0x5a6bbf;}})[_0x793a('0x46')](function(_0x2a5f86){logger[_0x793a('0x4e')](_0x793a('0x4f'),_0x2a5f86);throw _0x2a5f86;});}return _0x5a6bbf;})['then'](respondWithResult(_0x24da59,0xc9))[_0x793a('0x46')](handleError(_0x24da59,null));};exports[_0x793a('0x23')]=function(_0x4d32c3,_0x2a5e46){if(_0x4d32c3[_0x793a('0x48')]['id']){delete _0x4d32c3[_0x793a('0x48')]['id'];}return db['Interval'][_0x793a('0x4d')]({'where':{'id':_0x4d32c3[_0x793a('0x44')]['id']}})[_0x793a('0x24')](handleEntityNotFound(_0x2a5e46,null))[_0x793a('0x24')](saveUpdates(_0x4d32c3[_0x793a('0x48')],null))[_0x793a('0x24')](respondWithResult(_0x2a5e46,null))[_0x793a('0x46')](handleError(_0x2a5e46,null));};exports[_0x793a('0x25')]=function(_0x52eb23,_0x168988){return db[_0x793a('0x2d')]['find']({'where':{'id':_0x52eb23[_0x793a('0x44')]['id']}})['then'](handleEntityNotFound(_0x168988,null))[_0x793a('0x24')](removeEntity(_0x168988,null))['catch'](handleError(_0x168988,null));};exports['addInterval']=function(_0x5d1482,_0x15c685,_0x5e4f56){if(_0x5d1482[_0x793a('0x48')]['id']){delete _0x5d1482[_0x793a('0x48')]['id'];}return db['Interval']['find']({'where':{'id':_0x5d1482[_0x793a('0x44')]['id']}})[_0x793a('0x24')](handleEntityNotFound(_0x15c685,null))[_0x793a('0x24')](function(_0x3bb939){if(_0x3bb939){_0x5d1482[_0x793a('0x48')][_0x793a('0x50')]=_0x3bb939['id'];return db[_0x793a('0x2d')][_0x793a('0x47')](_0x5d1482['body']);}})[_0x793a('0x24')](respondWithResult(_0x15c685,null))[_0x793a('0x46')](handleError(_0x15c685,null));};exports[_0x793a('0x51')]=function(_0x31151e,_0x5dd4ec,_0x59286c){var _0x54f626={};var _0x56df86={};var _0x3c7e3f;var _0x44c2ec;return db[_0x793a('0x2d')][_0x793a('0x52')]({'where':{'id':_0x31151e[_0x793a('0x44')]['id']}})[_0x793a('0x24')](handleEntityNotFound(_0x5dd4ec,null))[_0x793a('0x24')](function(_0x36a1e5){if(_0x36a1e5){_0x3c7e3f=_0x36a1e5;_0x56df86[_0x793a('0x2f')]=_[_0x793a('0x31')](db[_0x793a('0x2d')]['rawAttributes']);_0x56df86[_0x793a('0x30')]=_[_0x793a('0x31')](_0x31151e['query']);_0x56df86[_0x793a('0x39')]=_[_0x793a('0x32')](_0x56df86[_0x793a('0x2f')],_0x56df86[_0x793a('0x30')]);_0x54f626[_0x793a('0x34')]=_['intersection'](_0x56df86[_0x793a('0x2f')],qs[_0x793a('0x33')](_0x31151e[_0x793a('0x30')][_0x793a('0x33')]));_0x54f626[_0x793a('0x34')]=_0x54f626[_0x793a('0x34')][_0x793a('0x35')]?_0x54f626[_0x793a('0x34')]:_0x56df86[_0x793a('0x2f')];_0x54f626[_0x793a('0x37')]=qs[_0x793a('0x38')](_0x31151e[_0x793a('0x30')][_0x793a('0x38')]);_0x54f626[_0x793a('0x3a')]=qs['filters'](_[_0x793a('0x53')](_0x31151e['query'],_0x56df86['filters']));if(_0x31151e[_0x793a('0x30')]['filter']){_0x54f626[_0x793a('0x3a')]=_[_0x793a('0x54')](_0x54f626['where'],{'$or':_['map'](_0x54f626[_0x793a('0x34')],function(_0x3e48c8){var _0x53d961={};_0x53d961[_0x3e48c8]={'$like':'%'+_0x31151e[_0x793a('0x30')][_0x793a('0x3d')]+'%'};return _0x53d961;})});}_0x54f626=_[_0x793a('0x54')]({},_0x54f626,_0x31151e[_0x793a('0x3e')]);return _0x3c7e3f['getIntervals'](_0x54f626);}})['then'](function(_0x2b8dc3){if(_0x2b8dc3){_0x44c2ec=_0x2b8dc3[_0x793a('0x35')];if(!_0x31151e[_0x793a('0x30')][_0x793a('0x36')](_0x793a('0x55'))){_0x54f626['limit']=qs[_0x793a('0x1d')](_0x31151e['query'][_0x793a('0x1d')]);_0x54f626[_0x793a('0x1b')]=qs[_0x793a('0x1b')](_0x31151e[_0x793a('0x30')]['offset']);}return _0x3c7e3f[_0x793a('0x51')](_0x54f626);}})[_0x793a('0x24')](function(_0x1d4aab){if(_0x1d4aab){return _0x1d4aab?{'count':_0x44c2ec,'rows':_0x1d4aab}:null;}})['then'](respondWithResult(_0x5dd4ec,null))['catch'](handleError(_0x5dd4ec,null));};exports[_0x793a('0x56')]=function(_0x3a985b,_0x499b3e,_0x1a6650){return db['Interval'][_0x793a('0x52')]({'where':{'id':_0x3a985b[_0x793a('0x44')]['id']}})[_0x793a('0x24')](handleEntityNotFound(_0x499b3e,null))['then'](function(_0x6d172f){if(_0x6d172f){return db[_0x793a('0x57')][_0x793a('0x58')](function(_0x5a992b){return db[_0x793a('0x2d')][_0x793a('0x25')]({'where':{'IntervalId':_0x3a985b[_0x793a('0x44')]['id']},'transaction':_0x5a992b})[_0x793a('0x24')](function(_0x50b51c){var _0x104129=_[_0x793a('0x2c')](_0x3a985b[_0x793a('0x48')],function(_0x24dd5e){delete _0x24dd5e['id'];_0x24dd5e[_0x793a('0x50')]=_0x3a985b[_0x793a('0x44')]['id'];return _0x24dd5e;});return db['Interval'][_0x793a('0x59')](_0x104129,{'transaction':_0x5a992b});});})[_0x793a('0x24')](function(){return db[_0x793a('0x2d')][_0x793a('0x41')]({'where':{'IntervalId':_0x3a985b[_0x793a('0x44')]['id']}});});}})[_0x793a('0x24')](respondWithResult(_0x499b3e,null))[_0x793a('0x46')](handleError(_0x499b3e,null));};
\ No newline at end of file
index f0baacd..20291fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb13e=['bluebird','path','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x2fd428,_0x90bafc){var _0x5e48e1=function(_0x29bcd8){while(--_0x29bcd8){_0x2fd428['push'](_0x2fd428['shift']());}};_0x5e48e1(++_0x90bafc);}(_0xb13e,0xa3));var _0xeb13=function(_0x1e6765,_0x39c381){_0x1e6765=_0x1e6765-0x0;var _0x23e45d=_0xb13e[_0x1e6765];return _0x23e45d;};'use strict';var _=require(_0xeb13('0x0'));var util=require(_0xeb13('0x1'));var logger=require(_0xeb13('0x2'))(_0xeb13('0x3'));var moment=require(_0xeb13('0x4'));var BPromise=require(_0xeb13('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb13('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb13('0x7'));var extensions=require(_0xeb13('0x8'));module[_0xeb13('0x9')]=function(_0x3c6c6b,_0x171b81){return _0x3c6c6b[_0xeb13('0xa')](_0xeb13('0xb'),attributes,{'tableName':_0xeb13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ca715,_0x32e719){extensions['rewrite'](_0x3c6c6b,_0x4ca715);},'afterBulkCreate':function(_0x38a3d9,_0x4aa539,_0x20c031){_0x20c031();extensions[_0xeb13('0xd')](_0x3c6c6b,_0x38a3d9[0x0]);},'afterUpdate':function(_0x1bad8d,_0x2f4798){extensions[_0xeb13('0xd')](_0x3c6c6b,_0x1bad8d);},'afterDestroy':function(_0x305321,_0x2099f2){extensions['rewrite'](_0x3c6c6b,_0x305321);}}});};
\ No newline at end of file
+var _0xf981=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2e5ca3,_0x5cd487){var _0x1944a1=function(_0x1c4401){while(--_0x1c4401){_0x2e5ca3['push'](_0x2e5ca3['shift']());}};_0x1944a1(++_0x5cd487);}(_0xf981,0xe6));var _0x1f98=function(_0x22816f,_0x58f7ac){_0x22816f=_0x22816f-0x0;var _0x4b24a7=_0xf981[_0x22816f];return _0x4b24a7;};'use strict';var _=require(_0x1f98('0x0'));var util=require(_0x1f98('0x1'));var logger=require(_0x1f98('0x2'))(_0x1f98('0x3'));var moment=require(_0x1f98('0x4'));var BPromise=require(_0x1f98('0x5'));var rp=require(_0x1f98('0x6'));var fs=require('fs');var path=require(_0x1f98('0x7'));var rimraf=require('rimraf');var config=require(_0x1f98('0x8'));var attributes=require(_0x1f98('0x9'));var extensions=require(_0x1f98('0xa'));module[_0x1f98('0xb')]=function(_0x285cdc,_0x4a4526){return _0x285cdc['define'](_0x1f98('0xc'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x23e6a6,_0x88053c){extensions[_0x1f98('0xd')](_0x285cdc,_0x23e6a6);},'afterBulkCreate':function(_0x31b037,_0x241afb,_0x48228a){_0x48228a();extensions[_0x1f98('0xd')](_0x285cdc,_0x31b037[0x0]);},'afterUpdate':function(_0x119656,_0x358d08){extensions[_0x1f98('0xd')](_0x285cdc,_0x119656);},'afterDestroy':function(_0x505bed,_0x38a632){extensions['rewrite'](_0x285cdc,_0x505bed);}}});};
\ No newline at end of file
index 471731f..b8f2762 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(_0xf2f332,_0x299fbf){var _0x56cce3=function(_0x5f37e0){while(--_0x5f37e0){_0xf2f332['push'](_0xf2f332['shift']());}};_0x56cce3(++_0x299fbf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'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(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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 2a87447..a083d38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0xf5232,_0x36ad9d){var _0x298303=function(_0x15a7a2){while(--_0x15a7a2){_0xf5232['push'](_0xf5232['shift']());}};_0x298303(++_0x36ad9d);}(_0x2ef3,0xba));var _0x32ef=function(_0x52b1d3,_0x594831){_0x52b1d3=_0x52b1d3-0x0;var _0x13cad6=_0x2ef3[_0x52b1d3];return _0x13cad6;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router;
\ No newline at end of file
+var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router;
\ No newline at end of file
index f982928..9f69fdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a07=['\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','base64','setEncoding','utf8','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','Report'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x3a07,0x140));var _0x73a0=function(_0x3fa42d,_0x326449){_0x3fa42d=_0x3fa42d-0x0;var _0x1bef7d=_0x3a07[_0x3fa42d];return _0x1bef7d;};'use strict';var BPromise=require(_0x73a0('0x0'));var https=require(_0x73a0('0x1'));var logger=require(_0x73a0('0x2'))(_0x73a0('0x3'));var USERNAME=_0x73a0('0x4');var PASSWORD=_0x73a0('0x5');function openIssue(_0x5274d9,_0x400295){var _0x514c4f={'fields':{'project':{'key':_0x5274d9[_0x73a0('0x6')]||_0x73a0('0x7')},'summary':(_0x5274d9['summary']||_0x73a0('0x8'))+_0x73a0('0x9')+_0x5274d9['ip'],'description':_0x5274d9[_0x73a0('0xa')]||JSON[_0x73a0('0xb')](_0x5274d9),'issuetype':{'name':_0x5274d9[_0x73a0('0xc')]||_0x73a0('0xd')}}};_0x514c4f[_0x73a0('0xe')][_0x73a0('0xf')]=_0x5274d9[_0x73a0('0x10')];_0x514c4f[_0x73a0('0xe')][_0x73a0('0x11')]=_0x5274d9['oldToken'];_0x514c4f[_0x73a0('0xe')][_0x73a0('0x12')]=_0x5274d9[_0x73a0('0x13')];_0x514c4f[_0x73a0('0xe')][_0x73a0('0x14')]=_0x5274d9[_0x73a0('0x15')];_0x514c4f['fields'][_0x73a0('0x16')]=_0x5274d9[_0x73a0('0x17')];_0x514c4f[_0x73a0('0xe')][_0x73a0('0x18')]=_0x5274d9['ip'];var _0x445b9b={'host':_0x73a0('0x19'),'port':0x1bb,'path':_0x73a0('0x1a'),'method':_0x73a0('0x1b'),'timeout':0x4e20,'headers':{'Content-Type':_0x73a0('0x1c'),'Authorization':_0x73a0('0x1d')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x73a0('0x1e'))}};var _0x3b6931=JSON['stringify'](_0x514c4f);var _0xd18c93=https['request'](_0x445b9b,function(_0x56d28f){_0x56d28f[_0x73a0('0x1f')](_0x73a0('0x20'));var _0x4c840c='';_0x56d28f['on'](_0x73a0('0x21'),function(_0x40736a){_0x4c840c+=_0x40736a;});_0x56d28f['on'](_0x73a0('0x22'),function(){if(_0x400295){return _0x400295[_0x73a0('0x23')](_0x56d28f[_0x73a0('0x24')])[_0x73a0('0x25')](JSON['parse'](_0x4c840c));}});});_0xd18c93['on'](_0x73a0('0x26'),function(_0x5cc78f){if(_0x400295){return _0x400295[_0x73a0('0x23')](0x1f4)['json']({'errors':[{'message':_0x73a0('0x27'),'type':'api.jira'}]});}});_0xd18c93['write'](_0x3b6931);_0xd18c93[_0x73a0('0x22')]();}exports[_0x73a0('0x28')]=openIssue;exports['send']=function(_0x307c06,_0x3bed2e){_0x307c06[_0x73a0('0x29')]['ip']=_0x307c06[_0x73a0('0x2a')][_0x73a0('0x2b')]||_0x307c06[_0x73a0('0x2c')][_0x73a0('0x2d')]||_0x307c06[_0x73a0('0x2e')][_0x73a0('0x2d')]||_0x307c06['connection']['socket'][_0x73a0('0x2d')];return openIssue(_0x307c06[_0x73a0('0x29')],_0x3bed2e);};
\ No newline at end of file
+var _0x55d2=['base64','request','setEncoding','utf8','data','end','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','toString'];(function(_0x277a66,_0x4f9367){var _0x3ffa3d=function(_0x364931){while(--_0x364931){_0x277a66['push'](_0x277a66['shift']());}};_0x3ffa3d(++_0x4f9367);}(_0x55d2,0x104));var _0x255d=function(_0x3438e0,_0x140a7f){_0x3438e0=_0x3438e0-0x0;var _0x45cbba=_0x55d2[_0x3438e0];return _0x45cbba;};'use strict';var BPromise=require(_0x255d('0x0'));var https=require('https');var logger=require(_0x255d('0x1'))(_0x255d('0x2'));var USERNAME=_0x255d('0x3');var PASSWORD=_0x255d('0x4');function openIssue(_0x239906,_0x402796){var _0x4c927f={'fields':{'project':{'key':_0x239906[_0x255d('0x5')]||_0x255d('0x6')},'summary':(_0x239906[_0x255d('0x7')]||_0x255d('0x8'))+_0x255d('0x9')+_0x239906['ip'],'description':_0x239906[_0x255d('0xa')]||JSON[_0x255d('0xb')](_0x239906),'issuetype':{'name':_0x239906['issuetype']||_0x255d('0xc')}}};_0x4c927f[_0x255d('0xd')][_0x255d('0xe')]=_0x239906[_0x255d('0xf')];_0x4c927f[_0x255d('0xd')][_0x255d('0x10')]=_0x239906[_0x255d('0x11')];_0x4c927f[_0x255d('0xd')][_0x255d('0x12')]=_0x239906[_0x255d('0x13')];_0x4c927f['fields'][_0x255d('0x14')]=_0x239906[_0x255d('0x15')];_0x4c927f['fields'][_0x255d('0x16')]=_0x239906[_0x255d('0x17')];_0x4c927f['fields'][_0x255d('0x18')]=_0x239906['ip'];var _0x57a737={'host':_0x255d('0x19'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x255d('0x1a'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x255d('0x1b')](_0x255d('0x1c'))}};var _0x2f531a=JSON['stringify'](_0x4c927f);var _0x388a91=https[_0x255d('0x1d')](_0x57a737,function(_0x373d69){_0x373d69[_0x255d('0x1e')](_0x255d('0x1f'));var _0xd1ff27='';_0x373d69['on'](_0x255d('0x20'),function(_0x833f73){_0xd1ff27+=_0x833f73;});_0x373d69['on'](_0x255d('0x21'),function(){if(_0x402796){return _0x402796['status'](_0x373d69[_0x255d('0x22')])[_0x255d('0x23')](JSON[_0x255d('0x24')](_0xd1ff27));}});});_0x388a91['on'](_0x255d('0x25'),function(_0x56b6c6){if(_0x402796){return _0x402796['status'](0x1f4)['json']({'errors':[{'message':_0x255d('0x26'),'type':_0x255d('0x27')}]});}});_0x388a91[_0x255d('0x28')](_0x2f531a);_0x388a91['end']();}exports[_0x255d('0x29')]=openIssue;exports[_0x255d('0x2a')]=function(_0x4f95d6,_0x41a99e){_0x4f95d6[_0x255d('0x2b')]['ip']=_0x4f95d6[_0x255d('0x2c')]['x-forwarded-for']||_0x4f95d6[_0x255d('0x2d')][_0x255d('0x2e')]||_0x4f95d6[_0x255d('0x2f')][_0x255d('0x2e')]||_0x4f95d6[_0x255d('0x2d')]['socket'][_0x255d('0x2e')];return openIssue(_0x4f95d6[_0x255d('0x2b')],_0x41a99e);};
\ No newline at end of file
index d15e063..5067404 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','./jscriptyAnswerReport.controller','get','index','/describe','show','post'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 _0x9bde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','delete','destroy','util','connect-timeout','Router'];(function(_0x149abb,_0x4c9c49){var _0x4fe7c8=function(_0x1d8497){while(--_0x1d8497){_0x149abb['push'](_0x149abb['shift']());}};_0x4fe7c8(++_0x4c9c49);}(_0x9bde,0xe1));var _0xe9bd=function(_0x706888,_0x2db1b4){_0x706888=_0x706888-0x0;var _0x3058a3=_0x9bde[_0x706888];return _0x3058a3;};'use strict';var multer=require('multer');var util=require(_0xe9bd('0x0'));var path=require('path');var timeout=require(_0xe9bd('0x1'));var express=require('express');var router=express[_0xe9bd('0x2')]();var fs_extra=require(_0xe9bd('0x3'));var auth=require(_0xe9bd('0x4'));var interaction=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var controller=require(_0xe9bd('0x7'));router[_0xe9bd('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9bd('0x9')]);router[_0xe9bd('0x8')](_0xe9bd('0xa'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xc')]);router[_0xe9bd('0x8')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0xe')]);router[_0xe9bd('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe9bd('0x10')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller['update']);router[_0xe9bd('0x11')](_0xe9bd('0xd'),auth[_0xe9bd('0xb')](),controller[_0xe9bd('0x12')]);module['exports']=router;
\ No newline at end of file
index 0388fdd..ab0adea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x2b2250,_0x15c79a){_0x2b2250=_0x2b2250-0x0;var _0x5488c3=_0x7a54[_0x2b2250];return _0x5488c3;};'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(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7a54,0x106));var _0x47a5=function(_0x114bf4,_0x40ab01){_0x114bf4=_0x114bf4-0x0;var _0x5f41b9=_0x7a54[_0x114bf4];return _0x5f41b9;};'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 88e94b9..b3f19b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7118=['stack','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x235f01,_0x7c2ed0){var _0x6e3680=function(_0x42bdfa){while(--_0x42bdfa){_0x235f01['push'](_0x235f01['shift']());}};_0x6e3680(++_0x7c2ed0);}(_0x7118,0x159));var _0x8711=function(_0x237b4f,_0x38fc03){_0x237b4f=_0x237b4f-0x0;var _0x3b9c08=_0x7118[_0x237b4f];return _0x3b9c08;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8711('0x0'));var jsonpatch=require(_0x8711('0x1'));var rp=require('request-promise');var moment=require(_0x8711('0x2'));var BPromise=require(_0x8711('0x3'));var Mustache=require(_0x8711('0x4'));var util=require(_0x8711('0x5'));var path=require(_0x8711('0x6'));var sox=require(_0x8711('0x7'));var csv=require(_0x8711('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8711('0x9'));var _=require(_0x8711('0xa'));var squel=require(_0x8711('0xb'));var crypto=require(_0x8711('0xc'));var jsforce=require(_0x8711('0xd'));var deskjs=require(_0x8711('0xe'));var toCsv=require(_0x8711('0x8'));var querystring=require(_0x8711('0xf'));var Papa=require(_0x8711('0x10'));var Redis=require(_0x8711('0x11'));var authService=require(_0x8711('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8711('0x13'));var logger=require(_0x8711('0x14'))(_0x8711('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8711('0x16'));var db=require(_0x8711('0x17'))['db'];function respondWithStatusCode(_0x5d2c38,_0x49b241){_0x49b241=_0x49b241||0xcc;return function(_0x11adb0){if(_0x11adb0){return _0x5d2c38[_0x8711('0x18')](_0x49b241);}return _0x5d2c38[_0x8711('0x19')](_0x49b241)[_0x8711('0x1a')]();};}function respondWithResult(_0xc0a891,_0x22f434){_0x22f434=_0x22f434||0xc8;return function(_0x16b742){if(_0x16b742){return _0xc0a891['status'](_0x22f434)[_0x8711('0x1b')](_0x16b742);}};}function respondWithFilteredResult(_0x363bcd,_0x13f394){return function(_0x2e12ec){if(_0x2e12ec){var _0x3ab905=typeof _0x13f394[_0x8711('0x1c')]==='undefined'&&typeof _0x13f394[_0x8711('0x1d')]===_0x8711('0x1e');var _0x1c2cb5=_0x2e12ec[_0x8711('0x1f')];var _0x19a157=_0x3ab905?0x0:_0x13f394['offset'];var _0x5b2bf8=_0x3ab905?_0x2e12ec['count']:_0x13f394[_0x8711('0x1c')]+_0x13f394[_0x8711('0x1d')];var _0x2f6134;if(_0x5b2bf8>=_0x1c2cb5){_0x5b2bf8=_0x1c2cb5;_0x2f6134=0xc8;}else{_0x2f6134=0xce;}_0x363bcd['status'](_0x2f6134);return _0x363bcd['set'](_0x8711('0x20'),_0x19a157+'-'+_0x5b2bf8+'/'+_0x1c2cb5)[_0x8711('0x1b')](_0x2e12ec);}return null;};}function patchUpdates(_0x1209e0){return function(_0x44b948){try{jsonpatch[_0x8711('0x21')](_0x44b948,_0x1209e0,!![]);}catch(_0x270081){return BPromise[_0x8711('0x22')](_0x270081);}return _0x44b948[_0x8711('0x23')]();};}function saveUpdates(_0xace829,_0x41369d){return function(_0x4a35f5){if(_0x4a35f5){return _0x4a35f5[_0x8711('0x24')](_0xace829)[_0x8711('0x25')](function(_0x3302b9){return _0x3302b9;});}return null;};}function removeEntity(_0x939ef3,_0x4cf830){return function(_0x27cafd){if(_0x27cafd){return _0x27cafd[_0x8711('0x26')]()[_0x8711('0x25')](function(){_0x939ef3['status'](0xcc)[_0x8711('0x1a')]();});}};}function handleEntityNotFound(_0x17bf7f,_0x3e8281){return function(_0x217197){if(!_0x217197){_0x17bf7f[_0x8711('0x18')](0x194);}return _0x217197;};}function handleError(_0x514956,_0x494683){_0x494683=_0x494683||0x1f4;return function(_0x515a74){logger[_0x8711('0x27')](_0x515a74[_0x8711('0x28')]);if(_0x515a74[_0x8711('0x29')]){delete _0x515a74[_0x8711('0x29')];}_0x514956[_0x8711('0x19')](_0x494683)[_0x8711('0x2a')](_0x515a74);};}exports[_0x8711('0x2b')]=function(_0x3ca2b5,_0x398097){var _0x47e7b7={},_0x27db5d={},_0x591380={'count':0x0,'rows':[]};var _0x28c2d5=_[_0x8711('0x2c')](db[_0x8711('0x2d')]['rawAttributes'],function(_0x440bc8){return{'name':_0x440bc8['fieldName'],'type':_0x440bc8[_0x8711('0x2e')][_0x8711('0x2f')]};});_0x27db5d[_0x8711('0x30')]=_['map'](_0x28c2d5,'name');_0x27db5d[_0x8711('0x31')]=_[_0x8711('0x32')](_0x3ca2b5[_0x8711('0x31')]);_0x27db5d[_0x8711('0x33')]=_[_0x8711('0x34')](_0x27db5d[_0x8711('0x30')],_0x27db5d[_0x8711('0x31')]);_0x47e7b7[_0x8711('0x35')]=_[_0x8711('0x34')](_0x27db5d[_0x8711('0x30')],qs['fields'](_0x3ca2b5[_0x8711('0x31')][_0x8711('0x36')]));_0x47e7b7[_0x8711('0x35')]=_0x47e7b7[_0x8711('0x35')][_0x8711('0x37')]?_0x47e7b7[_0x8711('0x35')]:_0x27db5d[_0x8711('0x30')];if(!_0x3ca2b5[_0x8711('0x31')][_0x8711('0x38')](_0x8711('0x39'))){_0x47e7b7['limit']=qs[_0x8711('0x1d')](_0x3ca2b5[_0x8711('0x31')][_0x8711('0x1d')]);_0x47e7b7[_0x8711('0x1c')]=qs[_0x8711('0x1c')](_0x3ca2b5['query'][_0x8711('0x1c')]);}_0x47e7b7[_0x8711('0x3a')]=qs[_0x8711('0x3b')](_0x3ca2b5['query'][_0x8711('0x3b')]);_0x47e7b7[_0x8711('0x3c')]=qs[_0x8711('0x33')](_[_0x8711('0x3d')](_0x3ca2b5[_0x8711('0x31')],_0x27db5d[_0x8711('0x33')]),_0x28c2d5);if(_0x3ca2b5[_0x8711('0x31')]['filter']){_0x47e7b7[_0x8711('0x3c')]=_[_0x8711('0x3e')](_0x47e7b7[_0x8711('0x3c')],{'$or':_[_0x8711('0x2c')](_0x28c2d5,function(_0x5a7e83){if(_0x5a7e83['type']!==_0x8711('0x3f')){var _0x18b82a={};_0x18b82a[_0x5a7e83[_0x8711('0x29')]]={'$like':'%'+_0x3ca2b5[_0x8711('0x31')][_0x8711('0x40')]+'%'};return _0x18b82a;}})});}_0x47e7b7=_[_0x8711('0x3e')]({},_0x47e7b7,_0x3ca2b5[_0x8711('0x41')]);var _0x2db474={'where':_0x47e7b7[_0x8711('0x3c')]};return db[_0x8711('0x2d')][_0x8711('0x1f')](_0x2db474)[_0x8711('0x25')](function(_0x1efd42){_0x591380[_0x8711('0x1f')]=_0x1efd42;if(_0x3ca2b5[_0x8711('0x31')][_0x8711('0x42')]){_0x47e7b7[_0x8711('0x43')]=[{'all':!![]}];}return db[_0x8711('0x2d')][_0x8711('0x44')](_0x47e7b7);})[_0x8711('0x25')](function(_0x2fb5e8){_0x591380['rows']=_0x2fb5e8;return _0x591380;})[_0x8711('0x25')](respondWithFilteredResult(_0x398097,_0x47e7b7))['catch'](handleError(_0x398097,null));};exports[_0x8711('0x45')]=function(_0x3d9562,_0x121971){var _0x38c0c4={'raw':!![],'where':{'id':_0x3d9562[_0x8711('0x46')]['id']}},_0x5f2c0c={};_0x5f2c0c[_0x8711('0x30')]=_[_0x8711('0x32')](db[_0x8711('0x2d')][_0x8711('0x47')]);_0x5f2c0c[_0x8711('0x31')]=_['keys'](_0x3d9562[_0x8711('0x31')]);_0x5f2c0c[_0x8711('0x33')]=_[_0x8711('0x34')](_0x5f2c0c[_0x8711('0x30')],_0x5f2c0c['query']);_0x38c0c4[_0x8711('0x35')]=_[_0x8711('0x34')](_0x5f2c0c[_0x8711('0x30')],qs[_0x8711('0x36')](_0x3d9562[_0x8711('0x31')]['fields']));_0x38c0c4['attributes']=_0x38c0c4[_0x8711('0x35')][_0x8711('0x37')]?_0x38c0c4['attributes']:_0x5f2c0c[_0x8711('0x30')];if(_0x3d9562[_0x8711('0x31')][_0x8711('0x42')]){_0x38c0c4[_0x8711('0x43')]=[{'all':!![]}];}_0x38c0c4=_['merge']({},_0x38c0c4,_0x3d9562[_0x8711('0x41')]);return db[_0x8711('0x2d')][_0x8711('0x48')](_0x38c0c4)['then'](handleEntityNotFound(_0x121971,null))[_0x8711('0x25')](respondWithResult(_0x121971,null))[_0x8711('0x49')](handleError(_0x121971,null));};exports['create']=function(_0x3e9ab1,_0x14a815){return db['JscriptyAnswerReport'][_0x8711('0x4a')](_0x3e9ab1[_0x8711('0x4b')],{})['then'](respondWithResult(_0x14a815,0xc9))[_0x8711('0x49')](handleError(_0x14a815,null));};exports[_0x8711('0x24')]=function(_0x1c55d8,_0x17a3f5){if(_0x1c55d8['body']['id']){delete _0x1c55d8[_0x8711('0x4b')]['id'];}return db[_0x8711('0x2d')]['find']({'where':{'id':_0x1c55d8[_0x8711('0x46')]['id']}})[_0x8711('0x25')](handleEntityNotFound(_0x17a3f5,null))['then'](saveUpdates(_0x1c55d8['body'],null))['then'](respondWithResult(_0x17a3f5,null))['catch'](handleError(_0x17a3f5,null));};exports[_0x8711('0x26')]=function(_0x2efca0,_0x1c83f7){return db[_0x8711('0x2d')][_0x8711('0x48')]({'where':{'id':_0x2efca0[_0x8711('0x46')]['id']}})[_0x8711('0x25')](handleEntityNotFound(_0x1c83f7,null))['then'](removeEntity(_0x1c83f7,null))['catch'](handleError(_0x1c83f7,null));};exports['describe']=function(_0x3b9e2b,_0x867599){return db[_0x8711('0x2d')][_0x8711('0x4c')]()[_0x8711('0x25')](respondWithResult(_0x867599,null))[_0x8711('0x49')](handleError(_0x867599,null));};
\ No newline at end of file
+var _0x815b=['length','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','JscriptyAnswerReport','findAll','rows','show','rawAttributes','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','fieldName','key','model','map','keys','query','attributes','fields'];(function(_0x333d9c,_0xd785d3){var _0x28a68b=function(_0x5295ae){while(--_0x5295ae){_0x333d9c['push'](_0x333d9c['shift']());}};_0x28a68b(++_0xd785d3);}(_0x815b,0xb4));var _0xb815=function(_0x35e4a1,_0xb430bc){_0x35e4a1=_0x35e4a1-0x0;var _0x513537=_0x815b[_0x35e4a1];return _0x513537;};'use strict';var emlformat=require(_0xb815('0x0'));var rimraf=require(_0xb815('0x1'));var zipdir=require(_0xb815('0x2'));var jsonpatch=require(_0xb815('0x3'));var rp=require(_0xb815('0x4'));var moment=require('moment');var BPromise=require(_0xb815('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb815('0x6'));var sox=require(_0xb815('0x7'));var csv=require(_0xb815('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb815('0x9'));var _=require(_0xb815('0xa'));var squel=require('squel');var crypto=require(_0xb815('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb815('0x8'));var querystring=require(_0xb815('0xc'));var Papa=require(_0xb815('0xd'));var Redis=require(_0xb815('0xe'));var authService=require(_0xb815('0xf'));var qs=require(_0xb815('0x10'));var as=require(_0xb815('0x11'));var hardwareService=require(_0xb815('0x12'));var logger=require('../../config/logger')(_0xb815('0x13'));var utils=require(_0xb815('0x14'));var config=require(_0xb815('0x15'));var licenseUtil=require(_0xb815('0x16'));var db=require(_0xb815('0x17'))['db'];function respondWithStatusCode(_0x3ce2fb,_0x3e5c50){_0x3e5c50=_0x3e5c50||0xcc;return function(_0x5af22a){if(_0x5af22a){return _0x3ce2fb['sendStatus'](_0x3e5c50);}return _0x3ce2fb[_0xb815('0x18')](_0x3e5c50)[_0xb815('0x19')]();};}function respondWithResult(_0x13a09e,_0xff2720){_0xff2720=_0xff2720||0xc8;return function(_0x32b50a){if(_0x32b50a){return _0x13a09e[_0xb815('0x18')](_0xff2720)[_0xb815('0x1a')](_0x32b50a);}};}function respondWithFilteredResult(_0x4636c7,_0x966544){return function(_0xf456ca){if(_0xf456ca){var _0x3fd87d=typeof _0x966544[_0xb815('0x1b')]===_0xb815('0x1c')&&typeof _0x966544['limit']==='undefined';var _0x41445e=_0xf456ca[_0xb815('0x1d')];var _0x3f56ab=_0x3fd87d?0x0:_0x966544[_0xb815('0x1b')];var _0x324452=_0x3fd87d?_0xf456ca[_0xb815('0x1d')]:_0x966544[_0xb815('0x1b')]+_0x966544[_0xb815('0x1e')];var _0x839f08;if(_0x324452>=_0x41445e){_0x324452=_0x41445e;_0x839f08=0xc8;}else{_0x839f08=0xce;}_0x4636c7['status'](_0x839f08);return _0x4636c7['set'](_0xb815('0x1f'),_0x3f56ab+'-'+_0x324452+'/'+_0x41445e)['json'](_0xf456ca);}return null;};}function patchUpdates(_0x261b8d){return function(_0x1ebe78){try{jsonpatch[_0xb815('0x20')](_0x1ebe78,_0x261b8d,!![]);}catch(_0x3d7291){return BPromise['reject'](_0x3d7291);}return _0x1ebe78[_0xb815('0x21')]();};}function saveUpdates(_0x3c787e,_0x590eff){return function(_0x3f0f44){if(_0x3f0f44){return _0x3f0f44[_0xb815('0x22')](_0x3c787e)[_0xb815('0x23')](function(_0x37cf47){return _0x37cf47;});}return null;};}function removeEntity(_0x2ecffe,_0x19877b){return function(_0x100113){if(_0x100113){return _0x100113[_0xb815('0x24')]()[_0xb815('0x23')](function(){_0x2ecffe[_0xb815('0x18')](0xcc)[_0xb815('0x19')]();});}};}function handleEntityNotFound(_0x1a460c,_0x55b714){return function(_0x1a07cc){if(!_0x1a07cc){_0x1a460c[_0xb815('0x25')](0x194);}return _0x1a07cc;};}function handleError(_0x350448,_0x33211e){_0x33211e=_0x33211e||0x1f4;return function(_0x5f2eaf){logger[_0xb815('0x26')](_0x5f2eaf[_0xb815('0x27')]);if(_0x5f2eaf[_0xb815('0x28')]){delete _0x5f2eaf['name'];}_0x350448[_0xb815('0x18')](_0x33211e)[_0xb815('0x29')](_0x5f2eaf);};}exports[_0xb815('0x2a')]=function(_0x26bef8,_0x2e9199){var _0x3b0152={},_0x7e8a20={},_0xd22488={'count':0x0,'rows':[]};var _0x46c545=_['map'](db['JscriptyAnswerReport']['rawAttributes'],function(_0x45b5e5){return{'name':_0x45b5e5[_0xb815('0x2b')],'type':_0x45b5e5['type'][_0xb815('0x2c')]};});_0x7e8a20[_0xb815('0x2d')]=_[_0xb815('0x2e')](_0x46c545,_0xb815('0x28'));_0x7e8a20['query']=_[_0xb815('0x2f')](_0x26bef8[_0xb815('0x30')]);_0x7e8a20['filters']=_['intersection'](_0x7e8a20[_0xb815('0x2d')],_0x7e8a20['query']);_0x3b0152[_0xb815('0x31')]=_['intersection'](_0x7e8a20[_0xb815('0x2d')],qs['fields'](_0x26bef8[_0xb815('0x30')][_0xb815('0x32')]));_0x3b0152[_0xb815('0x31')]=_0x3b0152['attributes'][_0xb815('0x33')]?_0x3b0152[_0xb815('0x31')]:_0x7e8a20['model'];if(!_0x26bef8[_0xb815('0x30')][_0xb815('0x34')](_0xb815('0x35'))){_0x3b0152[_0xb815('0x1e')]=qs[_0xb815('0x1e')](_0x26bef8[_0xb815('0x30')]['limit']);_0x3b0152[_0xb815('0x1b')]=qs[_0xb815('0x1b')](_0x26bef8[_0xb815('0x30')][_0xb815('0x1b')]);}_0x3b0152[_0xb815('0x36')]=qs['sort'](_0x26bef8['query']['sort']);_0x3b0152[_0xb815('0x37')]=qs['filters'](_[_0xb815('0x38')](_0x26bef8[_0xb815('0x30')],_0x7e8a20[_0xb815('0x39')]),_0x46c545);if(_0x26bef8[_0xb815('0x30')][_0xb815('0x3a')]){_0x3b0152[_0xb815('0x37')]=_[_0xb815('0x3b')](_0x3b0152[_0xb815('0x37')],{'$or':_[_0xb815('0x2e')](_0x46c545,function(_0x26cfe3){if(_0x26cfe3[_0xb815('0x3c')]!==_0xb815('0x3d')){var _0x1dcdb3={};_0x1dcdb3[_0x26cfe3[_0xb815('0x28')]]={'$like':'%'+_0x26bef8[_0xb815('0x30')][_0xb815('0x3a')]+'%'};return _0x1dcdb3;}})});}_0x3b0152=_[_0xb815('0x3b')]({},_0x3b0152,_0x26bef8[_0xb815('0x3e')]);var _0x554495={'where':_0x3b0152['where']};return db['JscriptyAnswerReport'][_0xb815('0x1d')](_0x554495)[_0xb815('0x23')](function(_0x563ea2){_0xd22488[_0xb815('0x1d')]=_0x563ea2;if(_0x26bef8[_0xb815('0x30')][_0xb815('0x3f')]){_0x3b0152[_0xb815('0x40')]=[{'all':!![]}];}return db[_0xb815('0x41')][_0xb815('0x42')](_0x3b0152);})['then'](function(_0x572803){_0xd22488[_0xb815('0x43')]=_0x572803;return _0xd22488;})['then'](respondWithFilteredResult(_0x2e9199,_0x3b0152))['catch'](handleError(_0x2e9199,null));};exports[_0xb815('0x44')]=function(_0xdd9e31,_0x2ff7a7){var _0x388754={'raw':!![],'where':{'id':_0xdd9e31['params']['id']}},_0x4c8655={};_0x4c8655[_0xb815('0x2d')]=_[_0xb815('0x2f')](db[_0xb815('0x41')][_0xb815('0x45')]);_0x4c8655[_0xb815('0x30')]=_[_0xb815('0x2f')](_0xdd9e31[_0xb815('0x30')]);_0x4c8655[_0xb815('0x39')]=_[_0xb815('0x46')](_0x4c8655['model'],_0x4c8655[_0xb815('0x30')]);_0x388754['attributes']=_[_0xb815('0x46')](_0x4c8655['model'],qs[_0xb815('0x32')](_0xdd9e31[_0xb815('0x30')][_0xb815('0x32')]));_0x388754['attributes']=_0x388754['attributes'][_0xb815('0x33')]?_0x388754[_0xb815('0x31')]:_0x4c8655[_0xb815('0x2d')];if(_0xdd9e31['query'][_0xb815('0x3f')]){_0x388754[_0xb815('0x40')]=[{'all':!![]}];}_0x388754=_[_0xb815('0x3b')]({},_0x388754,_0xdd9e31[_0xb815('0x3e')]);return db[_0xb815('0x41')][_0xb815('0x47')](_0x388754)[_0xb815('0x23')](handleEntityNotFound(_0x2ff7a7,null))[_0xb815('0x23')](respondWithResult(_0x2ff7a7,null))['catch'](handleError(_0x2ff7a7,null));};exports['create']=function(_0x17c39c,_0x3a46f3){return db[_0xb815('0x41')][_0xb815('0x48')](_0x17c39c['body'],{})['then'](respondWithResult(_0x3a46f3,0xc9))[_0xb815('0x49')](handleError(_0x3a46f3,null));};exports[_0xb815('0x22')]=function(_0x549106,_0xfb3946){if(_0x549106['body']['id']){delete _0x549106[_0xb815('0x4a')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x549106[_0xb815('0x4b')]['id']}})['then'](handleEntityNotFound(_0xfb3946,null))[_0xb815('0x23')](saveUpdates(_0x549106[_0xb815('0x4a')],null))[_0xb815('0x23')](respondWithResult(_0xfb3946,null))['catch'](handleError(_0xfb3946,null));};exports[_0xb815('0x24')]=function(_0xe75271,_0x1ce83d){return db[_0xb815('0x41')][_0xb815('0x47')]({'where':{'id':_0xe75271[_0xb815('0x4b')]['id']}})[_0xb815('0x23')](handleEntityNotFound(_0x1ce83d,null))['then'](removeEntity(_0x1ce83d,null))[_0xb815('0x49')](handleError(_0x1ce83d,null));};exports[_0xb815('0x4c')]=function(_0x2ef92a,_0x4d74fc){return db['JscriptyAnswerReport'][_0xb815('0x4c')]()[_0xb815('0x23')](respondWithResult(_0x4d74fc,null))[_0xb815('0x49')](handleError(_0x4d74fc,null));};
\ No newline at end of file
index 4b6ea0d..ac00f9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['request-promise','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment'];(function(_0x3c5f8d,_0x39891f){var _0x3b7beb=function(_0x44d6c9){while(--_0x44d6c9){_0x3c5f8d['push'](_0x3c5f8d['shift']());}};_0x3b7beb(++_0x39891f);}(_0x2dae,0xd7));var _0xe2da=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0x2dae[_0x16aaef];return _0x1c82ef;};'use strict';var _=require(_0xe2da('0x0'));var util=require(_0xe2da('0x1'));var logger=require(_0xe2da('0x2'))(_0xe2da('0x3'));var moment=require(_0xe2da('0x4'));var BPromise=require('bluebird');var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe2da('0x6'));var attributes=require(_0xe2da('0x7'));module['exports']=function(_0x1a18ef,_0x360674){return _0x1a18ef[_0xe2da('0x8')](_0xe2da('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe51e=['path','rimraf','../../config/environment','exports','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xe51e,0x18a));var _0xee51=function(_0x4a10dd,_0x2f3c1a){_0x4a10dd=_0x4a10dd-0x0;var _0x39da0d=_0xe51e[_0x4a10dd];return _0x39da0d;};'use strict';var _=require(_0xee51('0x0'));var util=require(_0xee51('0x1'));var logger=require(_0xee51('0x2'))('api');var moment=require(_0xee51('0x3'));var BPromise=require(_0xee51('0x4'));var rp=require(_0xee51('0x5'));var fs=require('fs');var path=require(_0xee51('0x6'));var rimraf=require(_0xee51('0x7'));var config=require(_0xee51('0x8'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xee51('0x9')]=function(_0x53cb3f,_0x10f72a){return _0x53cb3f['define']('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d80f77e..4005bc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d31=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird'];(function(_0x471dd0,_0x2989d3){var _0x18887c=function(_0x48ae6e){while(--_0x48ae6e){_0x471dd0['push'](_0x471dd0['shift']());}};_0x18887c(++_0x2989d3);}(_0x9d31,0x14d));var _0x19d3=function(_0x5e9691,_0x251156){_0x5e9691=_0x5e9691-0x0;var _0x6348f9=_0x9d31[_0x5e9691];return _0x6348f9;};'use strict';var _=require(_0x19d3('0x0'));var util=require(_0x19d3('0x1'));var moment=require('moment');var BPromise=require(_0x19d3('0x2'));var rs=require(_0x19d3('0x3'));var fs=require('fs');var Redis=require(_0x19d3('0x4'));var db=require(_0x19d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x19d3('0x6'))(_0x19d3('0x7'));var config=require(_0x19d3('0x8'));var jayson=require(_0x19d3('0x9'));var client=jayson[_0x19d3('0xa')][_0x19d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1327ab,_0x382073,_0x4cf26c){return new BPromise(function(_0x50c036,_0x3574fe){return client['request'](_0x1327ab,_0x4cf26c)['then'](function(_0x3fe36f){logger[_0x19d3('0xc')](_0x19d3('0xd'),_0x382073,_0x19d3('0xe'));logger[_0x19d3('0xf')](_0x19d3('0x10'),_0x382073,_0x19d3('0xe'),JSON[_0x19d3('0x11')](_0x3fe36f));if(_0x3fe36f[_0x19d3('0x12')]){if(_0x3fe36f[_0x19d3('0x12')]['code']===0x1f4){logger[_0x19d3('0x12')](_0x19d3('0xd'),_0x382073,_0x3fe36f[_0x19d3('0x12')][_0x19d3('0x13')]);return _0x3574fe(_0x3fe36f['error']['message']);}logger[_0x19d3('0x12')](_0x19d3('0xd'),_0x382073,_0x3fe36f['error']['message']);return _0x50c036(_0x3fe36f['error'][_0x19d3('0x13')]);}else{logger[_0x19d3('0xc')](_0x19d3('0xd'),_0x382073,'request\x20sent');_0x50c036(_0x3fe36f[_0x19d3('0x14')]['message']);}})['catch'](function(_0x101370){logger[_0x19d3('0x12')](_0x19d3('0xd'),_0x382073,_0x101370);_0x3574fe(_0x101370);});});}
\ No newline at end of file
+var _0x1b96=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x1b96,0xfa));var _0x61b9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1b96[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x61b9('0x0'));var util=require(_0x61b9('0x1'));var moment=require('moment');var BPromise=require(_0x61b9('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(_0x61b9('0x3'))('rpc');var config=require(_0x61b9('0x4'));var jayson=require(_0x61b9('0x5'));var client=jayson[_0x61b9('0x6')][_0x61b9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f8d35,_0x4bcec7,_0x1c0ca4){return new BPromise(function(_0x161d1c,_0x4f1785){return client[_0x61b9('0x8')](_0x2f8d35,_0x1c0ca4)[_0x61b9('0x9')](function(_0x280368){logger[_0x61b9('0xa')](_0x61b9('0xb'),_0x4bcec7,_0x61b9('0xc'));logger[_0x61b9('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4bcec7,'request\x20sent',JSON[_0x61b9('0xe')](_0x280368));if(_0x280368[_0x61b9('0xf')]){if(_0x280368[_0x61b9('0xf')][_0x61b9('0x10')]===0x1f4){logger[_0x61b9('0xf')](_0x61b9('0xb'),_0x4bcec7,_0x280368['error'][_0x61b9('0x11')]);return _0x4f1785(_0x280368['error']['message']);}logger['error'](_0x61b9('0xb'),_0x4bcec7,_0x280368[_0x61b9('0xf')][_0x61b9('0x11')]);return _0x161d1c(_0x280368[_0x61b9('0xf')][_0x61b9('0x11')]);}else{logger[_0x61b9('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4bcec7,_0x61b9('0xc'));_0x161d1c(_0x280368[_0x61b9('0x12')][_0x61b9('0x11')]);}})[_0x61b9('0x13')](function(_0x509026){logger['error'](_0x61b9('0xb'),_0x4bcec7,_0x509026);_0x4f1785(_0x509026);});});}
\ No newline at end of file
index a60c0cb..2eba1b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64bd=['getSessions','getAnswers','30s','getSummary','post','/:id/clone','clone','put','delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show','/:id/sessions'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0x64bd,0x15a));var _0xd64b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x64bd[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd64b('0x0'));var timeout=require(_0xd64b('0x1'));var express=require(_0xd64b('0x2'));var router=express[_0xd64b('0x3')]();var fs_extra=require(_0xd64b('0x4'));var auth=require(_0xd64b('0x5'));var interaction=require(_0xd64b('0x6'));var config=require(_0xd64b('0x7'));var controller=require(_0xd64b('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd64b('0x9')](_0xd64b('0xa'),auth[_0xd64b('0xb')](),controller[_0xd64b('0xc')]);router['get'](_0xd64b('0xd'),auth[_0xd64b('0xb')](),controller[_0xd64b('0xe')]);router[_0xd64b('0x9')]('/:id/answers',auth[_0xd64b('0xb')](),controller[_0xd64b('0xf')]);router[_0xd64b('0x9')]('/:id/summary',auth[_0xd64b('0xb')](),timeout(_0xd64b('0x10')),controller[_0xd64b('0x11')]);router[_0xd64b('0x12')]('/',auth[_0xd64b('0xb')](),controller['create']);router[_0xd64b('0x12')](_0xd64b('0x13'),auth[_0xd64b('0xb')](),controller[_0xd64b('0x14')]);router[_0xd64b('0x15')](_0xd64b('0xa'),auth[_0xd64b('0xb')](),controller['update']);router[_0xd64b('0x16')](_0xd64b('0xa'),auth[_0xd64b('0xb')](),controller[_0xd64b('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x62a5=['/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','/:id/clone','clone','put','delete','exports','util','connect-timeout','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id'];(function(_0x1bb57d,_0x11664f){var _0x4fdf76=function(_0x41cb63){while(--_0x41cb63){_0x1bb57d['push'](_0x1bb57d['shift']());}};_0x4fdf76(++_0x11664f);}(_0x62a5,0x1ec));var _0x562a=function(_0x166eb1,_0x4b8f01){_0x166eb1=_0x166eb1-0x0;var _0x37da17=_0x62a5[_0x166eb1];return _0x37da17;};'use strict';var multer=require('multer');var util=require(_0x562a('0x0'));var path=require('path');var timeout=require(_0x562a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x562a('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x562a('0x3'));var controller=require(_0x562a('0x4'));router[_0x562a('0x5')]('/',auth[_0x562a('0x6')](),controller['index']);router[_0x562a('0x5')](_0x562a('0x7'),auth[_0x562a('0x6')](),controller['show']);router[_0x562a('0x5')](_0x562a('0x8'),auth[_0x562a('0x6')](),controller[_0x562a('0x9')]);router[_0x562a('0x5')](_0x562a('0xa'),auth[_0x562a('0x6')](),controller[_0x562a('0xb')]);router['get'](_0x562a('0xc'),auth[_0x562a('0x6')](),timeout('30s'),controller[_0x562a('0xd')]);router['post']('/',auth[_0x562a('0x6')](),controller[_0x562a('0xe')]);router['post'](_0x562a('0xf'),auth[_0x562a('0x6')](),controller[_0x562a('0x10')]);router[_0x562a('0x11')]('/:id',auth[_0x562a('0x6')](),controller['update']);router[_0x562a('0x12')](_0x562a('0x7'),auth[_0x562a('0x6')](),controller['destroy']);module[_0x562a('0x13')]=router;
\ No newline at end of file
index e4092a0..2bc9375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9298=['STRING','TEXT','isObjectLike','setDataValue','stringify','isString','formData','format','getDataValue','description','BOOLEAN','sequelize','util','exports','name'];(function(_0x342548,_0x31c72e){var _0x107140=function(_0x32c2ab){while(--_0x32c2ab){_0x342548['push'](_0x342548['shift']());}};_0x107140(++_0x31c72e);}(_0x9298,0x10a));var _0x8929=function(_0x1c56e0,_0x12d3f8){_0x1c56e0=_0x1c56e0-0x0;var _0x4322bd=_0x9298[_0x1c56e0];return _0x4322bd;};'use strict';var Sequelize=require(_0x8929('0x0'));var _=require('lodash');var util=require(_0x8929('0x1'));module[_0x8929('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x8929('0x3')},'description':{'type':Sequelize[_0x8929('0x4')]},'formData':{'type':Sequelize[_0x8929('0x5')]('long'),'set':function(_0x3ff6b5){if(_[_0x8929('0x6')](_0x3ff6b5)){this[_0x8929('0x7')]('formData',JSON[_0x8929('0x8')](_0x3ff6b5));}else if(_[_0x8929('0x9')](_0x3ff6b5)){this['setDataValue'](_0x8929('0xa'),_0x3ff6b5);}else{this[_0x8929('0x7')](_0x8929('0xa'),util[_0x8929('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x8929('0xc')]('name')||'',this[_0x8929('0xc')](_0x8929('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8929('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8929('0xe')],'defaultValue':![]}};
\ No newline at end of file
+var _0x79f0=['formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','name','BOOLEAN','lodash','util','exports','STRING','TEXT','isObjectLike','setDataValue'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0x79f0,0x69));var _0x079f=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x79f0[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x079f('0x0'));var util=require(_0x079f('0x1'));module[_0x079f('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x079f('0x3')]},'formData':{'type':Sequelize[_0x079f('0x4')]('long'),'set':function(_0x39de69){if(_[_0x079f('0x5')](_0x39de69)){this[_0x079f('0x6')](_0x079f('0x7'),JSON[_0x079f('0x8')](_0x39de69));}else if(_[_0x079f('0x9')](_0x39de69)){this[_0x079f('0x6')](_0x079f('0x7'),_0x39de69);}else{this[_0x079f('0x6')](_0x079f('0x7'),util[_0x079f('0xa')](_0x079f('0xb'),this['getDataValue'](_0x079f('0xc'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x079f('0xd')],'defaultValue':![]}};
\ No newline at end of file
index 287f054..e05f8cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dab=['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','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','stack','name','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','UserProfileSection','userProfileId','error','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','hasOwnProperty','pick','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x3a6b64,_0x230b66){var _0x236354=function(_0x5492d4){while(--_0x5492d4){_0x3a6b64['push'](_0x3a6b64['shift']());}};_0x236354(++_0x230b66);}(_0x7dab,0xe5));var _0xb7da=function(_0x2088cd,_0x1d0d7c){_0x2088cd=_0x2088cd-0x0;var _0x3af5ad=_0x7dab[_0x2088cd];return _0x3af5ad;};'use strict';var emlformat=require(_0xb7da('0x0'));var rimraf=require(_0xb7da('0x1'));var zipdir=require(_0xb7da('0x2'));var jsonpatch=require(_0xb7da('0x3'));var rp=require(_0xb7da('0x4'));var moment=require('moment');var BPromise=require(_0xb7da('0x5'));var Mustache=require(_0xb7da('0x6'));var util=require(_0xb7da('0x7'));var path=require(_0xb7da('0x8'));var sox=require(_0xb7da('0x9'));var csv=require(_0xb7da('0xa'));var ejs=require(_0xb7da('0xb'));var fs=require('fs');var fs_extra=require(_0xb7da('0xc'));var _=require('lodash');var squel=require(_0xb7da('0xd'));var crypto=require(_0xb7da('0xe'));var jsforce=require(_0xb7da('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb7da('0x10'));var Papa=require(_0xb7da('0x11'));var Redis=require(_0xb7da('0x12'));var authService=require(_0xb7da('0x13'));var qs=require(_0xb7da('0x14'));var as=require(_0xb7da('0x15'));var hardwareService=require(_0xb7da('0x16'));var logger=require(_0xb7da('0x17'))('api');var utils=require(_0xb7da('0x18'));var config=require(_0xb7da('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7da('0x1a'))['db'];function respondWithStatusCode(_0x5c76bb,_0x97f4d8){_0x97f4d8=_0x97f4d8||0xcc;return function(_0x3a1df3){if(_0x3a1df3){return _0x5c76bb[_0xb7da('0x1b')](_0x97f4d8);}return _0x5c76bb[_0xb7da('0x1c')](_0x97f4d8)['end']();};}function respondWithResult(_0x5ae9bb,_0xe4cb50){_0xe4cb50=_0xe4cb50||0xc8;return function(_0x3b6f32){if(_0x3b6f32){return _0x5ae9bb[_0xb7da('0x1c')](_0xe4cb50)['json'](_0x3b6f32);}};}function respondWithFilteredResult(_0x3ac23e,_0x1b2682){return function(_0x2b2bf7){if(_0x2b2bf7){var _0xab868c=typeof _0x1b2682['offset']===_0xb7da('0x1d')&&typeof _0x1b2682[_0xb7da('0x1e')]===_0xb7da('0x1d');var _0x4c5bd9=_0x2b2bf7[_0xb7da('0x1f')];var _0x3128b2=_0xab868c?0x0:_0x1b2682[_0xb7da('0x20')];var _0x55ffe4=_0xab868c?_0x2b2bf7[_0xb7da('0x1f')]:_0x1b2682['offset']+_0x1b2682[_0xb7da('0x1e')];var _0xac04f6;if(_0x55ffe4>=_0x4c5bd9){_0x55ffe4=_0x4c5bd9;_0xac04f6=0xc8;}else{_0xac04f6=0xce;}_0x3ac23e[_0xb7da('0x1c')](_0xac04f6);return _0x3ac23e[_0xb7da('0x21')](_0xb7da('0x22'),_0x3128b2+'-'+_0x55ffe4+'/'+_0x4c5bd9)[_0xb7da('0x23')](_0x2b2bf7);}return null;};}function patchUpdates(_0x292923){return function(_0x20b250){try{jsonpatch[_0xb7da('0x24')](_0x20b250,_0x292923,!![]);}catch(_0x805e91){return BPromise[_0xb7da('0x25')](_0x805e91);}return _0x20b250[_0xb7da('0x26')]();};}function saveUpdates(_0x9c5040,_0xbe21ed){return function(_0x20750c){if(_0x20750c){return _0x20750c[_0xb7da('0x27')](_0x9c5040)[_0xb7da('0x28')](function(_0x44eb3a){return _0x44eb3a;});}return null;};}function removeEntity(_0x2d6a9e,_0x5d0fe8){return function(_0x5a6472){if(_0x5a6472){return _0x5a6472[_0xb7da('0x29')]()[_0xb7da('0x28')](function(){var _0x50e668=_0x5a6472[_0xb7da('0x2a')]({'plain':!![]});var _0x5839d4=_0xb7da('0x2b');return db[_0xb7da('0x2c')][_0xb7da('0x29')]({'where':{'type':_0x5839d4,'resourceId':_0x50e668['id']}})[_0xb7da('0x28')](function(){return _0x5a6472;});})[_0xb7da('0x28')](function(){_0x2d6a9e['status'](0xcc)[_0xb7da('0x2d')]();});}};}function handleEntityNotFound(_0x1e564d,_0x412e08){return function(_0x1726f4){if(!_0x1726f4){_0x1e564d['sendStatus'](0x194);}return _0x1726f4;};}function handleError(_0xfb9c2b,_0xbcab52){_0xbcab52=_0xbcab52||0x1f4;return function(_0x1829dc){logger['error'](_0x1829dc[_0xb7da('0x2e')]);if(_0x1829dc['name']){delete _0x1829dc[_0xb7da('0x2f')];}_0xfb9c2b[_0xb7da('0x1c')](_0xbcab52)['send'](_0x1829dc);};}exports['index']=function(_0x2fe29a,_0x2cef86){var _0x3e8ba6={},_0x37634f={},_0x21b7f1={'count':0x0,'rows':[]};var _0x1a394b=_[_0xb7da('0x30')](db[_0xb7da('0x31')][_0xb7da('0x32')],function(_0x45e250){return{'name':_0x45e250[_0xb7da('0x33')],'type':_0x45e250[_0xb7da('0x34')][_0xb7da('0x35')]};});_0x37634f['model']=_[_0xb7da('0x30')](_0x1a394b,_0xb7da('0x2f'));_0x37634f[_0xb7da('0x36')]=_[_0xb7da('0x37')](_0x2fe29a[_0xb7da('0x36')]);_0x37634f[_0xb7da('0x38')]=_[_0xb7da('0x39')](_0x37634f['model'],_0x37634f['query']);_0x3e8ba6[_0xb7da('0x3a')]=_[_0xb7da('0x39')](_0x37634f['model'],qs[_0xb7da('0x3b')](_0x2fe29a[_0xb7da('0x36')][_0xb7da('0x3b')]));_0x3e8ba6['attributes']=_0x3e8ba6[_0xb7da('0x3a')][_0xb7da('0x3c')]?_0x3e8ba6[_0xb7da('0x3a')]:_0x37634f[_0xb7da('0x3d')];if(!_0x2fe29a[_0xb7da('0x36')]['hasOwnProperty'](_0xb7da('0x3e'))){_0x3e8ba6[_0xb7da('0x1e')]=qs['limit'](_0x2fe29a[_0xb7da('0x36')][_0xb7da('0x1e')]);_0x3e8ba6['offset']=qs['offset'](_0x2fe29a['query'][_0xb7da('0x20')]);}_0x3e8ba6[_0xb7da('0x3f')]=qs[_0xb7da('0x40')](_0x2fe29a[_0xb7da('0x36')][_0xb7da('0x40')]);_0x3e8ba6[_0xb7da('0x41')]=qs[_0xb7da('0x38')](_['pick'](_0x2fe29a['query'],_0x37634f[_0xb7da('0x38')]),_0x1a394b);if(_0x2fe29a['query'][_0xb7da('0x42')]){_0x3e8ba6['where']=_[_0xb7da('0x43')](_0x3e8ba6[_0xb7da('0x41')],{'$or':_[_0xb7da('0x30')](_0x1a394b,function(_0x13a1d9){if(_0x13a1d9[_0xb7da('0x34')]!=='VIRTUAL'){var _0x9a3ee2={};_0x9a3ee2[_0x13a1d9[_0xb7da('0x2f')]]={'$like':'%'+_0x2fe29a[_0xb7da('0x36')]['filter']+'%'};return _0x9a3ee2;}})});}_0x3e8ba6=_['merge']({},_0x3e8ba6,_0x2fe29a[_0xb7da('0x44')]);var _0x235fe7={'where':_0x3e8ba6[_0xb7da('0x41')]};return db[_0xb7da('0x31')]['count'](_0x235fe7)[_0xb7da('0x28')](function(_0x422cc2){_0x21b7f1[_0xb7da('0x1f')]=_0x422cc2;if(_0x2fe29a['query']['includeAll']){_0x3e8ba6[_0xb7da('0x45')]=[{'all':!![]}];}return db[_0xb7da('0x31')][_0xb7da('0x46')](_0x3e8ba6);})[_0xb7da('0x28')](function(_0x2b683c){_0x21b7f1[_0xb7da('0x47')]=_0x2b683c;return _0x21b7f1;})[_0xb7da('0x28')](respondWithFilteredResult(_0x2cef86,_0x3e8ba6))[_0xb7da('0x48')](handleError(_0x2cef86,null));};exports[_0xb7da('0x49')]=function(_0x5364b3,_0x49d06f){var _0x50eb7c={'raw':![],'where':{'id':_0x5364b3[_0xb7da('0x4a')]['id']}},_0x249d7c={};_0x249d7c[_0xb7da('0x3d')]=_[_0xb7da('0x37')](db[_0xb7da('0x31')][_0xb7da('0x32')]);_0x249d7c[_0xb7da('0x36')]=_[_0xb7da('0x37')](_0x5364b3['query']);_0x249d7c[_0xb7da('0x38')]=_[_0xb7da('0x39')](_0x249d7c['model'],_0x249d7c['query']);_0x50eb7c[_0xb7da('0x3a')]=_[_0xb7da('0x39')](_0x249d7c[_0xb7da('0x3d')],qs[_0xb7da('0x3b')](_0x5364b3[_0xb7da('0x36')][_0xb7da('0x3b')]));_0x50eb7c[_0xb7da('0x3a')]=_0x50eb7c['attributes']['length']?_0x50eb7c[_0xb7da('0x3a')]:_0x249d7c[_0xb7da('0x3d')];if(_0x5364b3[_0xb7da('0x36')][_0xb7da('0x4b')]){_0x50eb7c[_0xb7da('0x45')]=[{'all':!![]}];}_0x50eb7c=_['merge']({},_0x50eb7c,_0x5364b3[_0xb7da('0x44')]);return db['JscriptyProject'][_0xb7da('0x4c')](_0x50eb7c)[_0xb7da('0x28')](handleEntityNotFound(_0x49d06f,null))[_0xb7da('0x28')](respondWithResult(_0x49d06f,null))[_0xb7da('0x48')](handleError(_0x49d06f,null));};exports[_0xb7da('0x4d')]=function(_0xfc10cc,_0x5f30c2){return db['JscriptyProject'][_0xb7da('0x4d')](_0xfc10cc[_0xb7da('0x4e')],{})[_0xb7da('0x28')](function(_0x1a587){var _0xbbd0fd=_0xfc10cc['user']['get']({'plain':!![]});if(!_0xbbd0fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbbd0fd['role']===_0xb7da('0x4f')){var _0x58bcd2=_0x1a587[_0xb7da('0x2a')]({'plain':!![]});var _0x53ff78=_0xb7da('0x2b');return db[_0xb7da('0x50')]['find']({'where':{'name':_0x53ff78,'userProfileId':_0xbbd0fd[_0xb7da('0x51')]},'raw':!![]})[_0xb7da('0x28')](function(_0x2ba8da){if(_0x2ba8da&&_0x2ba8da['autoAssociation']===0x0){return db[_0xb7da('0x2c')][_0xb7da('0x4d')]({'name':_0x58bcd2[_0xb7da('0x2f')],'resourceId':_0x58bcd2['id'],'type':_0x2ba8da[_0xb7da('0x2f')],'sectionId':_0x2ba8da['id']},{})[_0xb7da('0x28')](function(){return _0x1a587;});}else{return _0x1a587;}})[_0xb7da('0x48')](function(_0x1330e5){logger[_0xb7da('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1330e5);throw _0x1330e5;});}return _0x1a587;})[_0xb7da('0x28')](respondWithResult(_0x5f30c2,0xc9))['catch'](handleError(_0x5f30c2,null));};exports[_0xb7da('0x53')]=function(_0x382d19,_0x2fac0e){var _0x5f78a2={'where':{'id':_0x382d19[_0xb7da('0x4a')]['id']}},_0x4d3e42={};_0x4d3e42[_0xb7da('0x3d')]=_[_0xb7da('0x37')](db['JscriptyProject'][_0xb7da('0x32')]);_0x5f78a2[_0xb7da('0x3a')]=_['intersection'](_0x4d3e42[_0xb7da('0x3d')],qs['fields'](_0x382d19[_0xb7da('0x36')][_0xb7da('0x3b')]));_0x5f78a2['attributes']=_0x5f78a2['attributes'][_0xb7da('0x3c')]?_0x5f78a2[_0xb7da('0x3a')]:_0x4d3e42[_0xb7da('0x3d')];if(_0x382d19[_0xb7da('0x36')]['includeAll']){_0x5f78a2[_0xb7da('0x45')]=[{'all':!![]}];}_0x5f78a2=_[_0xb7da('0x43')]({},_0x5f78a2,_0x382d19['options']);return db[_0xb7da('0x31')]['find'](_0x5f78a2)[_0xb7da('0x28')](handleEntityNotFound(_0x2fac0e,null))[_0xb7da('0x28')](function(_0x2976af){if(_0x2976af){var _0x1f1951=_0x2976af['get']({'plain':!![]});_0x1f1951=qs[_0xb7da('0x54')](_0x1f1951,['id',_0xb7da('0x55'),_0xb7da('0x56')]);_0x382d19[_0xb7da('0x4e')]=_[_0xb7da('0x54')](_0x382d19[_0xb7da('0x4e')],['id',_0xb7da('0x55'),_0xb7da('0x56')]);return db[_0xb7da('0x31')][_0xb7da('0x4d')](_[_0xb7da('0x43')](_0x1f1951,_0x382d19[_0xb7da('0x4e')]),{'include':_0x382d19[_0xb7da('0x36')][_0xb7da('0x4b')]?[{'all':!![]}]:undefined})[_0xb7da('0x28')](function(_0x135ac1){var _0x4bc847=_0x382d19['user'][_0xb7da('0x2a')]({'plain':!![]});if(!_0x4bc847)throw new Error(_0xb7da('0x57'));if(_0x4bc847['role']===_0xb7da('0x4f')){var _0x472069=_0x135ac1[_0xb7da('0x2a')]({'plain':!![]});var _0x1489e8=_0xb7da('0x2b');return db[_0xb7da('0x50')]['find']({'where':{'name':_0x1489e8,'userProfileId':_0x4bc847[_0xb7da('0x51')]},'raw':!![]})[_0xb7da('0x28')](function(_0x52132d){if(_0x52132d&&_0x52132d[_0xb7da('0x58')]===0x0){return db[_0xb7da('0x2c')][_0xb7da('0x4d')]({'name':_0x472069[_0xb7da('0x2f')],'resourceId':_0x472069['id'],'type':_0x52132d[_0xb7da('0x2f')],'sectionId':_0x52132d['id']},{})[_0xb7da('0x28')](function(){return _0x135ac1;});}else{return _0x135ac1;}})[_0xb7da('0x48')](function(_0x357691){logger[_0xb7da('0x52')](_0xb7da('0x59'),_0x357691);throw _0x357691;});}return _0x135ac1;});}})[_0xb7da('0x28')](respondWithResult(_0x2fac0e,0xc9))['catch'](handleError(_0x2fac0e,null));};exports[_0xb7da('0x27')]=function(_0xe4edc,_0x4b7ddd){if(_0xe4edc[_0xb7da('0x4e')]['id']){delete _0xe4edc['body']['id'];}return db[_0xb7da('0x31')][_0xb7da('0x4c')]({'where':{'id':_0xe4edc['params']['id']}})[_0xb7da('0x28')](handleEntityNotFound(_0x4b7ddd,null))[_0xb7da('0x28')](saveUpdates(_0xe4edc[_0xb7da('0x4e')],null))['then'](respondWithResult(_0x4b7ddd,null))[_0xb7da('0x48')](handleError(_0x4b7ddd,null));};exports['destroy']=function(_0x4fc7c9,_0x510294){return db[_0xb7da('0x31')][_0xb7da('0x4c')]({'where':{'id':_0x4fc7c9[_0xb7da('0x4a')]['id']}})[_0xb7da('0x28')](handleEntityNotFound(_0x510294,null))[_0xb7da('0x28')](removeEntity(_0x510294,null))[_0xb7da('0x48')](handleError(_0x510294,null));};exports[_0xb7da('0x5a')]=function(_0x53c5a2,_0x1a2bad,_0x554a57){var _0x56b1f6={'raw':!![],'where':{}};var _0x314de9={};var _0x489284={'count':0x0,'rows':[]};return db[_0xb7da('0x31')][_0xb7da('0x5b')]({'where':{'id':_0x53c5a2[_0xb7da('0x4a')]['id']}})[_0xb7da('0x28')](handleEntityNotFound(_0x1a2bad,null))[_0xb7da('0x28')](function(_0x19e488){if(_0x19e488){_0x314de9[_0xb7da('0x3d')]=_[_0xb7da('0x37')](db[_0xb7da('0x5c')][_0xb7da('0x32')]);_0x314de9[_0xb7da('0x36')]=_['keys'](_0x53c5a2['query']);_0x314de9['filters']=_['intersection'](_0x314de9['model'],_0x314de9['query']);_0x56b1f6[_0xb7da('0x3a')]=_[_0xb7da('0x39')](_0x314de9[_0xb7da('0x3d')],qs[_0xb7da('0x3b')](_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x3b')]));_0x56b1f6[_0xb7da('0x3a')]=_0x56b1f6[_0xb7da('0x3a')][_0xb7da('0x3c')]?_0x56b1f6[_0xb7da('0x3a')]:_0x314de9[_0xb7da('0x3d')];if(!_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x5d')](_0xb7da('0x3e'))){_0x56b1f6['limit']=qs[_0xb7da('0x1e')](_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x1e')]);_0x56b1f6[_0xb7da('0x20')]=qs[_0xb7da('0x20')](_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x20')]);}_0x56b1f6[_0xb7da('0x3f')]=qs[_0xb7da('0x40')](_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x40')]);_0x56b1f6[_0xb7da('0x41')]=qs[_0xb7da('0x38')](_[_0xb7da('0x5e')](_0x53c5a2['query'],_0x314de9[_0xb7da('0x38')]));_0x56b1f6['where'][_0xb7da('0x5f')]=_0x19e488['id'];if(_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x42')]){_0x56b1f6[_0xb7da('0x41')]=_['merge'](_0x56b1f6[_0xb7da('0x41')],{'$or':_[_0xb7da('0x30')](_0x56b1f6['attributes'],function(_0x1d8246){var _0x34317b={};_0x34317b[_0x1d8246]={'$like':'%'+_0x53c5a2[_0xb7da('0x36')][_0xb7da('0x42')]+'%'};return _0x34317b;})});}_0x56b1f6=_[_0xb7da('0x43')]({},_0x56b1f6,_0x53c5a2['options']);return db[_0xb7da('0x5c')][_0xb7da('0x1f')]({'where':_0x56b1f6[_0xb7da('0x41')]})[_0xb7da('0x28')](function(_0x42ffa7){_0x489284['count']=_0x42ffa7;if(_0x53c5a2['query'][_0xb7da('0x4b')]){_0x56b1f6[_0xb7da('0x45')]=[{'all':!![]}];}return db[_0xb7da('0x5c')][_0xb7da('0x46')](_0x56b1f6);})['then'](function(_0x1d9f7a){_0x489284[_0xb7da('0x47')]=_0x1d9f7a;return _0x489284;});}})[_0xb7da('0x28')](respondWithFilteredResult(_0x1a2bad,_0x56b1f6))['catch'](handleError(_0x1a2bad,null));};exports[_0xb7da('0x60')]=function(_0x5db16e,_0x2fc504,_0x4e6c41){var _0x7aae7c={'raw':!![],'where':{}};var _0x4ce942={};var _0x74a1f8={'count':0x0,'rows':[]};return db[_0xb7da('0x31')][_0xb7da('0x5b')]({'where':{'id':_0x5db16e[_0xb7da('0x4a')]['id']}})[_0xb7da('0x28')](handleEntityNotFound(_0x2fc504,null))[_0xb7da('0x28')](function(_0x55f750){if(_0x55f750){_0x4ce942[_0xb7da('0x3d')]=_[_0xb7da('0x37')](db[_0xb7da('0x61')][_0xb7da('0x32')]);_0x4ce942[_0xb7da('0x36')]=_[_0xb7da('0x37')](_0x5db16e[_0xb7da('0x36')]);_0x4ce942['filters']=_[_0xb7da('0x39')](_0x4ce942[_0xb7da('0x3d')],_0x4ce942['query']);_0x7aae7c[_0xb7da('0x3a')]=_[_0xb7da('0x39')](_0x4ce942[_0xb7da('0x3d')],qs[_0xb7da('0x3b')](_0x5db16e[_0xb7da('0x36')][_0xb7da('0x3b')]));_0x7aae7c[_0xb7da('0x3a')]=_0x7aae7c[_0xb7da('0x3a')][_0xb7da('0x3c')]?_0x7aae7c['attributes']:_0x4ce942[_0xb7da('0x3d')];if(!_0x5db16e[_0xb7da('0x36')][_0xb7da('0x5d')](_0xb7da('0x3e'))){_0x7aae7c[_0xb7da('0x1e')]=qs[_0xb7da('0x1e')](_0x5db16e[_0xb7da('0x36')][_0xb7da('0x1e')]);_0x7aae7c[_0xb7da('0x20')]=qs['offset'](_0x5db16e[_0xb7da('0x36')][_0xb7da('0x20')]);}_0x7aae7c[_0xb7da('0x3f')]=qs[_0xb7da('0x40')](_0x5db16e[_0xb7da('0x36')][_0xb7da('0x40')]);_0x7aae7c[_0xb7da('0x41')]=qs[_0xb7da('0x38')](_[_0xb7da('0x5e')](_0x5db16e[_0xb7da('0x36')],_0x4ce942[_0xb7da('0x38')]));_0x7aae7c[_0xb7da('0x41')][_0xb7da('0x5f')]=_0x55f750['id'];if(_0x5db16e[_0xb7da('0x36')]['filter']){_0x7aae7c[_0xb7da('0x41')]=_[_0xb7da('0x43')](_0x7aae7c[_0xb7da('0x41')],{'$or':_[_0xb7da('0x30')](_0x7aae7c[_0xb7da('0x3a')],function(_0x1f954c){var _0x3d9998={};_0x3d9998[_0x1f954c]={'$like':'%'+_0x5db16e[_0xb7da('0x36')][_0xb7da('0x42')]+'%'};return _0x3d9998;})});}_0x7aae7c=_[_0xb7da('0x43')]({},_0x7aae7c,_0x5db16e[_0xb7da('0x44')]);return db[_0xb7da('0x61')][_0xb7da('0x1f')]({'where':_0x7aae7c['where']})[_0xb7da('0x28')](function(_0x4dbed6){_0x74a1f8[_0xb7da('0x1f')]=_0x4dbed6;if(_0x5db16e[_0xb7da('0x36')][_0xb7da('0x4b')]){_0x7aae7c[_0xb7da('0x45')]=[{'all':!![]}];}return db[_0xb7da('0x61')][_0xb7da('0x46')](_0x7aae7c);})[_0xb7da('0x28')](function(_0x16940c){_0x74a1f8[_0xb7da('0x47')]=_0x16940c;return _0x74a1f8;});}})['then'](respondWithFilteredResult(_0x2fc504,_0x7aae7c))[_0xb7da('0x48')](handleError(_0x2fc504,null));};function char(_0x3b9b9c){return'number'===typeof _0x3b9b9c?String[_0xb7da('0x62')][_0xb7da('0x24')](null,arguments):_0x3b9b9c;}function needsEncapsulation(_0x28fd61){return!!_0x28fd61&&(_0x28fd61[_0xb7da('0x63')]()[_0xb7da('0x64')](char(0xd))>=0x0||_0x28fd61['toString']()[_0xb7da('0x64')](char(0xa))>=0x0||_0x28fd61['toString']()[_0xb7da('0x64')](char(0x2c))>=0x0||_0x28fd61[_0xb7da('0x63')]()[_0xb7da('0x64')](char(0x22))>=0x0);}function encapsulate(_0x4b0d77){var _0x97806f=char(0x22),_0x504953='\x5c'+char(0x22),_0x4b97d1=_0x4b0d77[_0xb7da('0x63')]()[_0xb7da('0x65')](new RegExp(_0x97806f,'g'),_0x504953);return _0x97806f+_0x4b97d1+_0x97806f;}exports[_0xb7da('0x66')]=function(_0x3cdda9,_0x4a3f81,_0x5c7488){var _0x437a62,_0x30888b;var _0x44355a={'where':{'ProjectId':_0x3cdda9['params']['id']}};if(_0x3cdda9[_0xb7da('0x36')][_0xb7da('0x67')]){_0x44355a[_0xb7da('0x41')]['starttime']=JSON[_0xb7da('0x68')](_0x3cdda9['query'][_0xb7da('0x67')]);}return db[_0xb7da('0x5c')][_0xb7da('0x46')](_0x44355a)[_0xb7da('0x28')](handleEntityNotFound(_0x4a3f81,null))[_0xb7da('0x28')](function(_0x10dc22){if(_0x10dc22){_0x437a62=_0x10dc22;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0xb7da('0x30')](_0x437a62,'id')},'ProjectId':_0x3cdda9[_0xb7da('0x4a')]['id']},'order':_0xb7da('0x69')});}})[_0xb7da('0x28')](handleEntityNotFound(_0x4a3f81,null))[_0xb7da('0x28')](function(_0x339de7){if(_0x339de7){_0x30888b=_0x339de7;var _0x587dfd={};for(var _0x17f94a=0x0,_0x45e8dd=_0x30888b['length'];_0x17f94a<_0x45e8dd;_0x17f94a++){if(!_0x587dfd[_0xb7da('0x5d')](_0x30888b[_0x17f94a][_0xb7da('0x6a')])){_0x587dfd[_0x30888b[_0x17f94a]['questionId']]=needsEncapsulation(_0x30888b[_0x17f94a][_0xb7da('0x6b')])?encapsulate(_0x30888b[_0x17f94a][_0xb7da('0x6b')]):_0x30888b[_0x17f94a]['question'];}}var _0x1f825a=[],_0x19a686={};for(var _0x2a0cd5=0x0,_0x511026=_0x437a62[_0xb7da('0x3c')];_0x2a0cd5<_0x511026;_0x2a0cd5++){_0x19a686={'ProjectId':_0x3cdda9[_0xb7da('0x4a')]['id'],'SessionId':_0x437a62[_0x2a0cd5]['id'],'StartTime':moment(_0x437a62[_0x2a0cd5]['starttime'])[_0xb7da('0x6c')](_0xb7da('0x6d'))};for(var _0x13589d=0x0,_0x1a7fc1=_0x30888b[_0xb7da('0x3c')];_0x13589d<_0x1a7fc1;_0x13589d++){if(_0x30888b[_0x13589d]['SessionId']==_0x437a62[_0x2a0cd5]['id']&&_0x587dfd['hasOwnProperty'](_0x30888b[_0x13589d][_0xb7da('0x6a')])){_0x19a686[_0x587dfd[_0x30888b[_0x13589d][_0xb7da('0x6a')]]]=_0x30888b[_0x13589d][_0xb7da('0x6e')];}}for(var _0x2cd8a0 in _0x587dfd){if(!_0x19a686[_0xb7da('0x5d')](_0x587dfd[_0x2cd8a0])){_0x19a686[_0x587dfd[_0x2cd8a0]]=null;}}_0x1f825a[_0xb7da('0x6f')](_0x19a686);}return _0x1f825a;}})['then'](function(_0x5abe60){if(!_[_0xb7da('0x70')](_0x5abe60)){var _0x368eee=toCsv(_0x5abe60);var _0x14b687=Date[_0xb7da('0x71')]();fs[_0xb7da('0x72')](util[_0xb7da('0x6c')](_0xb7da('0x73'),_0x3cdda9[_0xb7da('0x4a')]['id'],_0x14b687),_0x368eee);_0x4a3f81['setHeader'](_0xb7da('0x74'),'attachment;\x20filename='+util[_0xb7da('0x6c')](_0xb7da('0x75'),_0x3cdda9['params']['id'],_0x14b687));_0x4a3f81['setHeader'](_0xb7da('0x76'),_0xb7da('0x77'));return _0x4a3f81[_0xb7da('0x78')](util[_0xb7da('0x6c')](_0xb7da('0x73'),_0x3cdda9[_0xb7da('0x4a')]['id'],_0x14b687));}else{return _0x4a3f81[_0xb7da('0x1b')](0xcc);}})[_0xb7da('0x48')](handleError(_0x4a3f81,null));};
\ No newline at end of file
+var _0xa3a3=['update','then','destroy','get','Projects','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','findAll','rows','show','params','filters','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','autoAssociation','getSessions','pick','ProjectId','JscriptySessionReport','getAnswers','findOne','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x4bbd41,_0x269933){var _0xa90941=function(_0x1641ec){while(--_0x1641ec){_0x4bbd41['push'](_0x4bbd41['shift']());}};_0xa90941(++_0x269933);}(_0xa3a3,0x141));var _0x3a3a=function(_0x5252a4,_0x866393){_0x5252a4=_0x5252a4-0x0;var _0xced423=_0xa3a3[_0x5252a4];return _0xced423;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a3a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3a3a('0x1'));var moment=require(_0x3a3a('0x2'));var BPromise=require(_0x3a3a('0x3'));var Mustache=require(_0x3a3a('0x4'));var util=require(_0x3a3a('0x5'));var path=require(_0x3a3a('0x6'));var sox=require(_0x3a3a('0x7'));var csv=require(_0x3a3a('0x8'));var ejs=require(_0x3a3a('0x9'));var fs=require('fs');var fs_extra=require(_0x3a3a('0xa'));var _=require(_0x3a3a('0xb'));var squel=require('squel');var crypto=require(_0x3a3a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3a3a('0xd'));var Papa=require(_0x3a3a('0xe'));var Redis=require(_0x3a3a('0xf'));var authService=require(_0x3a3a('0x10'));var qs=require(_0x3a3a('0x11'));var as=require(_0x3a3a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a3a('0x13'))(_0x3a3a('0x14'));var utils=require(_0x3a3a('0x15'));var config=require(_0x3a3a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3a3a('0x17'))['db'];function respondWithStatusCode(_0x5f3083,_0x432593){_0x432593=_0x432593||0xcc;return function(_0x2461b4){if(_0x2461b4){return _0x5f3083[_0x3a3a('0x18')](_0x432593);}return _0x5f3083[_0x3a3a('0x19')](_0x432593)[_0x3a3a('0x1a')]();};}function respondWithResult(_0x4cdb22,_0x11c936){_0x11c936=_0x11c936||0xc8;return function(_0x556dd8){if(_0x556dd8){return _0x4cdb22[_0x3a3a('0x19')](_0x11c936)[_0x3a3a('0x1b')](_0x556dd8);}};}function respondWithFilteredResult(_0x1bd42b,_0x3eb070){return function(_0x4b7a15){if(_0x4b7a15){var _0xcd1fc2=typeof _0x3eb070['offset']===_0x3a3a('0x1c')&&typeof _0x3eb070['limit']==='undefined';var _0x5f3784=_0x4b7a15[_0x3a3a('0x1d')];var _0x3515a4=_0xcd1fc2?0x0:_0x3eb070[_0x3a3a('0x1e')];var _0x46539d=_0xcd1fc2?_0x4b7a15[_0x3a3a('0x1d')]:_0x3eb070['offset']+_0x3eb070[_0x3a3a('0x1f')];var _0x1056e9;if(_0x46539d>=_0x5f3784){_0x46539d=_0x5f3784;_0x1056e9=0xc8;}else{_0x1056e9=0xce;}_0x1bd42b[_0x3a3a('0x19')](_0x1056e9);return _0x1bd42b['set'](_0x3a3a('0x20'),_0x3515a4+'-'+_0x46539d+'/'+_0x5f3784)[_0x3a3a('0x1b')](_0x4b7a15);}return null;};}function patchUpdates(_0xa87f2a){return function(_0xf42d41){try{jsonpatch[_0x3a3a('0x21')](_0xf42d41,_0xa87f2a,!![]);}catch(_0x164ae9){return BPromise[_0x3a3a('0x22')](_0x164ae9);}return _0xf42d41[_0x3a3a('0x23')]();};}function saveUpdates(_0x4e9ebd,_0x27d71a){return function(_0x33ed7d){if(_0x33ed7d){return _0x33ed7d[_0x3a3a('0x24')](_0x4e9ebd)[_0x3a3a('0x25')](function(_0x3f5fbc){return _0x3f5fbc;});}return null;};}function removeEntity(_0x3a4be2,_0x5f2abb){return function(_0x18b58f){if(_0x18b58f){return _0x18b58f[_0x3a3a('0x26')]()[_0x3a3a('0x25')](function(){var _0x1f569a=_0x18b58f[_0x3a3a('0x27')]({'plain':!![]});var _0xb02405=_0x3a3a('0x28');return db[_0x3a3a('0x29')][_0x3a3a('0x26')]({'where':{'type':_0xb02405,'resourceId':_0x1f569a['id']}})[_0x3a3a('0x25')](function(){return _0x18b58f;});})[_0x3a3a('0x25')](function(){_0x3a4be2[_0x3a3a('0x19')](0xcc)[_0x3a3a('0x1a')]();});}};}function handleEntityNotFound(_0x2d51bf,_0x3ee61b){return function(_0x6ad62c){if(!_0x6ad62c){_0x2d51bf[_0x3a3a('0x18')](0x194);}return _0x6ad62c;};}function handleError(_0x39ec35,_0x3f0de8){_0x3f0de8=_0x3f0de8||0x1f4;return function(_0x37869c){logger[_0x3a3a('0x2a')](_0x37869c[_0x3a3a('0x2b')]);if(_0x37869c[_0x3a3a('0x2c')]){delete _0x37869c[_0x3a3a('0x2c')];}_0x39ec35[_0x3a3a('0x19')](_0x3f0de8)['send'](_0x37869c);};}exports[_0x3a3a('0x2d')]=function(_0x3ca07f,_0x5769c2){var _0x4bf678={},_0x5303c8={},_0x413cc5={'count':0x0,'rows':[]};var _0x38d861=_[_0x3a3a('0x2e')](db['JscriptyProject'][_0x3a3a('0x2f')],function(_0xc8c924){return{'name':_0xc8c924[_0x3a3a('0x30')],'type':_0xc8c924[_0x3a3a('0x31')]['key']};});_0x5303c8[_0x3a3a('0x32')]=_['map'](_0x38d861,_0x3a3a('0x2c'));_0x5303c8[_0x3a3a('0x33')]=_[_0x3a3a('0x34')](_0x3ca07f['query']);_0x5303c8['filters']=_[_0x3a3a('0x35')](_0x5303c8['model'],_0x5303c8['query']);_0x4bf678['attributes']=_['intersection'](_0x5303c8[_0x3a3a('0x32')],qs[_0x3a3a('0x36')](_0x3ca07f[_0x3a3a('0x33')][_0x3a3a('0x36')]));_0x4bf678['attributes']=_0x4bf678[_0x3a3a('0x37')][_0x3a3a('0x38')]?_0x4bf678[_0x3a3a('0x37')]:_0x5303c8[_0x3a3a('0x32')];if(!_0x3ca07f['query'][_0x3a3a('0x39')](_0x3a3a('0x3a'))){_0x4bf678['limit']=qs[_0x3a3a('0x1f')](_0x3ca07f[_0x3a3a('0x33')][_0x3a3a('0x1f')]);_0x4bf678[_0x3a3a('0x1e')]=qs['offset'](_0x3ca07f[_0x3a3a('0x33')][_0x3a3a('0x1e')]);}_0x4bf678[_0x3a3a('0x3b')]=qs['sort'](_0x3ca07f['query'][_0x3a3a('0x3c')]);_0x4bf678[_0x3a3a('0x3d')]=qs['filters'](_['pick'](_0x3ca07f[_0x3a3a('0x33')],_0x5303c8['filters']),_0x38d861);if(_0x3ca07f[_0x3a3a('0x33')][_0x3a3a('0x3e')]){_0x4bf678[_0x3a3a('0x3d')]=_[_0x3a3a('0x3f')](_0x4bf678['where'],{'$or':_[_0x3a3a('0x2e')](_0x38d861,function(_0x3b8885){if(_0x3b8885[_0x3a3a('0x31')]!==_0x3a3a('0x40')){var _0x56771f={};_0x56771f[_0x3b8885[_0x3a3a('0x2c')]]={'$like':'%'+_0x3ca07f[_0x3a3a('0x33')][_0x3a3a('0x3e')]+'%'};return _0x56771f;}})});}_0x4bf678=_['merge']({},_0x4bf678,_0x3ca07f[_0x3a3a('0x41')]);var _0x35f831={'where':_0x4bf678[_0x3a3a('0x3d')]};return db[_0x3a3a('0x42')][_0x3a3a('0x1d')](_0x35f831)['then'](function(_0x324629){_0x413cc5[_0x3a3a('0x1d')]=_0x324629;if(_0x3ca07f[_0x3a3a('0x33')][_0x3a3a('0x43')]){_0x4bf678[_0x3a3a('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x3a3a('0x45')](_0x4bf678);})['then'](function(_0x3033f6){_0x413cc5[_0x3a3a('0x46')]=_0x3033f6;return _0x413cc5;})[_0x3a3a('0x25')](respondWithFilteredResult(_0x5769c2,_0x4bf678))['catch'](handleError(_0x5769c2,null));};exports[_0x3a3a('0x47')]=function(_0x277514,_0x5a18ee){var _0x456483={'raw':![],'where':{'id':_0x277514[_0x3a3a('0x48')]['id']}},_0x36284c={};_0x36284c[_0x3a3a('0x32')]=_[_0x3a3a('0x34')](db[_0x3a3a('0x42')][_0x3a3a('0x2f')]);_0x36284c[_0x3a3a('0x33')]=_[_0x3a3a('0x34')](_0x277514[_0x3a3a('0x33')]);_0x36284c[_0x3a3a('0x49')]=_['intersection'](_0x36284c[_0x3a3a('0x32')],_0x36284c[_0x3a3a('0x33')]);_0x456483['attributes']=_['intersection'](_0x36284c[_0x3a3a('0x32')],qs[_0x3a3a('0x36')](_0x277514[_0x3a3a('0x33')][_0x3a3a('0x36')]));_0x456483[_0x3a3a('0x37')]=_0x456483[_0x3a3a('0x37')]['length']?_0x456483[_0x3a3a('0x37')]:_0x36284c['model'];if(_0x277514['query'][_0x3a3a('0x43')]){_0x456483[_0x3a3a('0x44')]=[{'all':!![]}];}_0x456483=_[_0x3a3a('0x3f')]({},_0x456483,_0x277514['options']);return db[_0x3a3a('0x42')]['find'](_0x456483)[_0x3a3a('0x25')](handleEntityNotFound(_0x5a18ee,null))[_0x3a3a('0x25')](respondWithResult(_0x5a18ee,null))[_0x3a3a('0x4a')](handleError(_0x5a18ee,null));};exports[_0x3a3a('0x4b')]=function(_0x505160,_0x10dc8e){return db[_0x3a3a('0x42')]['create'](_0x505160['body'],{})[_0x3a3a('0x25')](function(_0x6660d4){var _0x24bc41=_0x505160[_0x3a3a('0x4c')][_0x3a3a('0x27')]({'plain':!![]});if(!_0x24bc41)throw new Error(_0x3a3a('0x4d'));if(_0x24bc41[_0x3a3a('0x4e')]===_0x3a3a('0x4c')){var _0x415270=_0x6660d4[_0x3a3a('0x27')]({'plain':!![]});var _0x1b35a4=_0x3a3a('0x28');return db[_0x3a3a('0x4f')][_0x3a3a('0x50')]({'where':{'name':_0x1b35a4,'userProfileId':_0x24bc41[_0x3a3a('0x51')]},'raw':!![]})['then'](function(_0x4ff7de){if(_0x4ff7de&&_0x4ff7de['autoAssociation']===0x0){return db[_0x3a3a('0x29')][_0x3a3a('0x4b')]({'name':_0x415270[_0x3a3a('0x2c')],'resourceId':_0x415270['id'],'type':_0x4ff7de[_0x3a3a('0x2c')],'sectionId':_0x4ff7de['id']},{})[_0x3a3a('0x25')](function(){return _0x6660d4;});}else{return _0x6660d4;}})[_0x3a3a('0x4a')](function(_0x4f9f2b){logger['error'](_0x3a3a('0x52'),_0x4f9f2b);throw _0x4f9f2b;});}return _0x6660d4;})['then'](respondWithResult(_0x10dc8e,0xc9))[_0x3a3a('0x4a')](handleError(_0x10dc8e,null));};exports[_0x3a3a('0x53')]=function(_0x1eeb80,_0x22b8b8){var _0x8c378e={'where':{'id':_0x1eeb80['params']['id']}},_0x40d5c1={};_0x40d5c1[_0x3a3a('0x32')]=_[_0x3a3a('0x34')](db[_0x3a3a('0x42')][_0x3a3a('0x2f')]);_0x8c378e[_0x3a3a('0x37')]=_['intersection'](_0x40d5c1[_0x3a3a('0x32')],qs[_0x3a3a('0x36')](_0x1eeb80['query']['fields']));_0x8c378e[_0x3a3a('0x37')]=_0x8c378e[_0x3a3a('0x37')]['length']?_0x8c378e[_0x3a3a('0x37')]:_0x40d5c1[_0x3a3a('0x32')];if(_0x1eeb80[_0x3a3a('0x33')]['includeAll']){_0x8c378e[_0x3a3a('0x44')]=[{'all':!![]}];}_0x8c378e=_[_0x3a3a('0x3f')]({},_0x8c378e,_0x1eeb80[_0x3a3a('0x41')]);return db['JscriptyProject'][_0x3a3a('0x50')](_0x8c378e)[_0x3a3a('0x25')](handleEntityNotFound(_0x22b8b8,null))[_0x3a3a('0x25')](function(_0x29f4a7){if(_0x29f4a7){var _0x5ba97c=_0x29f4a7['get']({'plain':!![]});_0x5ba97c=qs[_0x3a3a('0x54')](_0x5ba97c,['id','createdAt',_0x3a3a('0x55')]);_0x1eeb80[_0x3a3a('0x56')]=_[_0x3a3a('0x54')](_0x1eeb80[_0x3a3a('0x56')],['id',_0x3a3a('0x57'),_0x3a3a('0x55')]);return db[_0x3a3a('0x42')]['create'](_['merge'](_0x5ba97c,_0x1eeb80[_0x3a3a('0x56')]),{'include':_0x1eeb80[_0x3a3a('0x33')][_0x3a3a('0x43')]?[{'all':!![]}]:undefined})[_0x3a3a('0x25')](function(_0x4de367){var _0x4c06d6=_0x1eeb80[_0x3a3a('0x4c')]['get']({'plain':!![]});if(!_0x4c06d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c06d6['role']===_0x3a3a('0x4c')){var _0x55b913=_0x4de367[_0x3a3a('0x27')]({'plain':!![]});var _0x5b5541=_0x3a3a('0x28');return db[_0x3a3a('0x4f')][_0x3a3a('0x50')]({'where':{'name':_0x5b5541,'userProfileId':_0x4c06d6['userProfileId']},'raw':!![]})[_0x3a3a('0x25')](function(_0x7aea1d){if(_0x7aea1d&&_0x7aea1d[_0x3a3a('0x58')]===0x0){return db[_0x3a3a('0x29')][_0x3a3a('0x4b')]({'name':_0x55b913[_0x3a3a('0x2c')],'resourceId':_0x55b913['id'],'type':_0x7aea1d[_0x3a3a('0x2c')],'sectionId':_0x7aea1d['id']},{})[_0x3a3a('0x25')](function(){return _0x4de367;});}else{return _0x4de367;}})[_0x3a3a('0x4a')](function(_0x41ca8b){logger[_0x3a3a('0x2a')](_0x3a3a('0x52'),_0x41ca8b);throw _0x41ca8b;});}return _0x4de367;});}})[_0x3a3a('0x25')](respondWithResult(_0x22b8b8,0xc9))[_0x3a3a('0x4a')](handleError(_0x22b8b8,null));};exports['update']=function(_0xcfc768,_0x59d43a){if(_0xcfc768['body']['id']){delete _0xcfc768[_0x3a3a('0x56')]['id'];}return db[_0x3a3a('0x42')]['find']({'where':{'id':_0xcfc768[_0x3a3a('0x48')]['id']}})['then'](handleEntityNotFound(_0x59d43a,null))[_0x3a3a('0x25')](saveUpdates(_0xcfc768[_0x3a3a('0x56')],null))['then'](respondWithResult(_0x59d43a,null))['catch'](handleError(_0x59d43a,null));};exports[_0x3a3a('0x26')]=function(_0x36cfba,_0x110c98){return db[_0x3a3a('0x42')][_0x3a3a('0x50')]({'where':{'id':_0x36cfba[_0x3a3a('0x48')]['id']}})[_0x3a3a('0x25')](handleEntityNotFound(_0x110c98,null))[_0x3a3a('0x25')](removeEntity(_0x110c98,null))[_0x3a3a('0x4a')](handleError(_0x110c98,null));};exports[_0x3a3a('0x59')]=function(_0x30d703,_0x3e2366,_0x5a930a){var _0x2ce2ab={'raw':!![],'where':{}};var _0xc5d27e={};var _0x305ab2={'count':0x0,'rows':[]};return db[_0x3a3a('0x42')]['findOne']({'where':{'id':_0x30d703[_0x3a3a('0x48')]['id']}})[_0x3a3a('0x25')](handleEntityNotFound(_0x3e2366,null))[_0x3a3a('0x25')](function(_0x184a99){if(_0x184a99){_0xc5d27e[_0x3a3a('0x32')]=_[_0x3a3a('0x34')](db['JscriptySessionReport'][_0x3a3a('0x2f')]);_0xc5d27e[_0x3a3a('0x33')]=_['keys'](_0x30d703[_0x3a3a('0x33')]);_0xc5d27e[_0x3a3a('0x49')]=_[_0x3a3a('0x35')](_0xc5d27e[_0x3a3a('0x32')],_0xc5d27e[_0x3a3a('0x33')]);_0x2ce2ab[_0x3a3a('0x37')]=_[_0x3a3a('0x35')](_0xc5d27e[_0x3a3a('0x32')],qs['fields'](_0x30d703[_0x3a3a('0x33')][_0x3a3a('0x36')]));_0x2ce2ab[_0x3a3a('0x37')]=_0x2ce2ab['attributes'][_0x3a3a('0x38')]?_0x2ce2ab[_0x3a3a('0x37')]:_0xc5d27e['model'];if(!_0x30d703[_0x3a3a('0x33')]['hasOwnProperty']('nolimit')){_0x2ce2ab[_0x3a3a('0x1f')]=qs[_0x3a3a('0x1f')](_0x30d703['query'][_0x3a3a('0x1f')]);_0x2ce2ab[_0x3a3a('0x1e')]=qs[_0x3a3a('0x1e')](_0x30d703['query'][_0x3a3a('0x1e')]);}_0x2ce2ab[_0x3a3a('0x3b')]=qs[_0x3a3a('0x3c')](_0x30d703['query']['sort']);_0x2ce2ab['where']=qs[_0x3a3a('0x49')](_[_0x3a3a('0x5a')](_0x30d703[_0x3a3a('0x33')],_0xc5d27e[_0x3a3a('0x49')]));_0x2ce2ab[_0x3a3a('0x3d')][_0x3a3a('0x5b')]=_0x184a99['id'];if(_0x30d703[_0x3a3a('0x33')][_0x3a3a('0x3e')]){_0x2ce2ab['where']=_[_0x3a3a('0x3f')](_0x2ce2ab[_0x3a3a('0x3d')],{'$or':_[_0x3a3a('0x2e')](_0x2ce2ab['attributes'],function(_0x205316){var _0x89a120={};_0x89a120[_0x205316]={'$like':'%'+_0x30d703[_0x3a3a('0x33')][_0x3a3a('0x3e')]+'%'};return _0x89a120;})});}_0x2ce2ab=_[_0x3a3a('0x3f')]({},_0x2ce2ab,_0x30d703[_0x3a3a('0x41')]);return db[_0x3a3a('0x5c')][_0x3a3a('0x1d')]({'where':_0x2ce2ab[_0x3a3a('0x3d')]})[_0x3a3a('0x25')](function(_0x5dfe3a){_0x305ab2[_0x3a3a('0x1d')]=_0x5dfe3a;if(_0x30d703['query'][_0x3a3a('0x43')]){_0x2ce2ab[_0x3a3a('0x44')]=[{'all':!![]}];}return db[_0x3a3a('0x5c')]['findAll'](_0x2ce2ab);})[_0x3a3a('0x25')](function(_0x544d9d){_0x305ab2['rows']=_0x544d9d;return _0x305ab2;});}})[_0x3a3a('0x25')](respondWithFilteredResult(_0x3e2366,_0x2ce2ab))['catch'](handleError(_0x3e2366,null));};exports[_0x3a3a('0x5d')]=function(_0x52a7c7,_0x1d66ce,_0x24216b){var _0x4a2eb3={'raw':!![],'where':{}};var _0x5be038={};var _0x4e904d={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x3a3a('0x5e')]({'where':{'id':_0x52a7c7[_0x3a3a('0x48')]['id']}})[_0x3a3a('0x25')](handleEntityNotFound(_0x1d66ce,null))[_0x3a3a('0x25')](function(_0x44353a){if(_0x44353a){_0x5be038['model']=_[_0x3a3a('0x34')](db[_0x3a3a('0x5f')][_0x3a3a('0x2f')]);_0x5be038[_0x3a3a('0x33')]=_[_0x3a3a('0x34')](_0x52a7c7['query']);_0x5be038[_0x3a3a('0x49')]=_[_0x3a3a('0x35')](_0x5be038[_0x3a3a('0x32')],_0x5be038['query']);_0x4a2eb3[_0x3a3a('0x37')]=_[_0x3a3a('0x35')](_0x5be038[_0x3a3a('0x32')],qs[_0x3a3a('0x36')](_0x52a7c7[_0x3a3a('0x33')][_0x3a3a('0x36')]));_0x4a2eb3[_0x3a3a('0x37')]=_0x4a2eb3[_0x3a3a('0x37')][_0x3a3a('0x38')]?_0x4a2eb3['attributes']:_0x5be038[_0x3a3a('0x32')];if(!_0x52a7c7[_0x3a3a('0x33')][_0x3a3a('0x39')]('nolimit')){_0x4a2eb3[_0x3a3a('0x1f')]=qs[_0x3a3a('0x1f')](_0x52a7c7['query'][_0x3a3a('0x1f')]);_0x4a2eb3[_0x3a3a('0x1e')]=qs[_0x3a3a('0x1e')](_0x52a7c7[_0x3a3a('0x33')][_0x3a3a('0x1e')]);}_0x4a2eb3[_0x3a3a('0x3b')]=qs[_0x3a3a('0x3c')](_0x52a7c7[_0x3a3a('0x33')][_0x3a3a('0x3c')]);_0x4a2eb3['where']=qs[_0x3a3a('0x49')](_[_0x3a3a('0x5a')](_0x52a7c7[_0x3a3a('0x33')],_0x5be038[_0x3a3a('0x49')]));_0x4a2eb3['where'][_0x3a3a('0x5b')]=_0x44353a['id'];if(_0x52a7c7[_0x3a3a('0x33')][_0x3a3a('0x3e')]){_0x4a2eb3[_0x3a3a('0x3d')]=_[_0x3a3a('0x3f')](_0x4a2eb3[_0x3a3a('0x3d')],{'$or':_[_0x3a3a('0x2e')](_0x4a2eb3[_0x3a3a('0x37')],function(_0x2a94e3){var _0x25d17f={};_0x25d17f[_0x2a94e3]={'$like':'%'+_0x52a7c7[_0x3a3a('0x33')][_0x3a3a('0x3e')]+'%'};return _0x25d17f;})});}_0x4a2eb3=_[_0x3a3a('0x3f')]({},_0x4a2eb3,_0x52a7c7[_0x3a3a('0x41')]);return db[_0x3a3a('0x5f')][_0x3a3a('0x1d')]({'where':_0x4a2eb3[_0x3a3a('0x3d')]})[_0x3a3a('0x25')](function(_0x1b1dd4){_0x4e904d[_0x3a3a('0x1d')]=_0x1b1dd4;if(_0x52a7c7[_0x3a3a('0x33')]['includeAll']){_0x4a2eb3[_0x3a3a('0x44')]=[{'all':!![]}];}return db[_0x3a3a('0x5f')]['findAll'](_0x4a2eb3);})['then'](function(_0x3ecf29){_0x4e904d[_0x3a3a('0x46')]=_0x3ecf29;return _0x4e904d;});}})[_0x3a3a('0x25')](respondWithFilteredResult(_0x1d66ce,_0x4a2eb3))[_0x3a3a('0x4a')](handleError(_0x1d66ce,null));};function char(_0x15cb2b){return _0x3a3a('0x60')===typeof _0x15cb2b?String['fromCharCode'][_0x3a3a('0x21')](null,arguments):_0x15cb2b;}function needsEncapsulation(_0x290064){return!!_0x290064&&(_0x290064[_0x3a3a('0x61')]()[_0x3a3a('0x62')](char(0xd))>=0x0||_0x290064[_0x3a3a('0x61')]()[_0x3a3a('0x62')](char(0xa))>=0x0||_0x290064[_0x3a3a('0x61')]()[_0x3a3a('0x62')](char(0x2c))>=0x0||_0x290064[_0x3a3a('0x61')]()[_0x3a3a('0x62')](char(0x22))>=0x0);}function encapsulate(_0x340ff9){var _0x47196f=char(0x22),_0x224911='\x5c'+char(0x22),_0x478179=_0x340ff9['toString']()[_0x3a3a('0x63')](new RegExp(_0x47196f,'g'),_0x224911);return _0x47196f+_0x478179+_0x47196f;}exports[_0x3a3a('0x64')]=function(_0xaff4d8,_0x4e3937,_0x458f30){var _0x4515a9,_0x3d17d4;var _0x425a76={'where':{'ProjectId':_0xaff4d8['params']['id']}};if(_0xaff4d8['query'][_0x3a3a('0x65')]){_0x425a76[_0x3a3a('0x3d')][_0x3a3a('0x66')]=JSON[_0x3a3a('0x67')](_0xaff4d8[_0x3a3a('0x33')][_0x3a3a('0x65')]);}return db[_0x3a3a('0x5c')][_0x3a3a('0x45')](_0x425a76)['then'](handleEntityNotFound(_0x4e3937,null))[_0x3a3a('0x25')](function(_0x5e2b5c){if(_0x5e2b5c){_0x4515a9=_0x5e2b5c;return db['JscriptyQuestionReport'][_0x3a3a('0x45')]({'where':{'SessionId':{'$in':_[_0x3a3a('0x2e')](_0x4515a9,'id')},'ProjectId':_0xaff4d8[_0x3a3a('0x48')]['id']},'order':'-createdAt'});}})[_0x3a3a('0x25')](handleEntityNotFound(_0x4e3937,null))[_0x3a3a('0x25')](function(_0x62d78d){if(_0x62d78d){_0x3d17d4=_0x62d78d;var _0x27da3a={};for(var _0x217726=0x0,_0xc9dbb4=_0x3d17d4[_0x3a3a('0x38')];_0x217726<_0xc9dbb4;_0x217726++){if(!_0x27da3a[_0x3a3a('0x39')](_0x3d17d4[_0x217726][_0x3a3a('0x68')])){_0x27da3a[_0x3d17d4[_0x217726][_0x3a3a('0x68')]]=needsEncapsulation(_0x3d17d4[_0x217726][_0x3a3a('0x69')])?encapsulate(_0x3d17d4[_0x217726][_0x3a3a('0x69')]):_0x3d17d4[_0x217726][_0x3a3a('0x69')];}}var _0x179ace=[],_0x42ba84={};for(var _0x4a1ba1=0x0,_0x1a4405=_0x4515a9[_0x3a3a('0x38')];_0x4a1ba1<_0x1a4405;_0x4a1ba1++){_0x42ba84={'ProjectId':_0xaff4d8[_0x3a3a('0x48')]['id'],'SessionId':_0x4515a9[_0x4a1ba1]['id'],'StartTime':moment(_0x4515a9[_0x4a1ba1][_0x3a3a('0x66')])[_0x3a3a('0x6a')](_0x3a3a('0x6b'))};for(var _0x5b9623=0x0,_0x464581=_0x3d17d4[_0x3a3a('0x38')];_0x5b9623<_0x464581;_0x5b9623++){if(_0x3d17d4[_0x5b9623]['SessionId']==_0x4515a9[_0x4a1ba1]['id']&&_0x27da3a[_0x3a3a('0x39')](_0x3d17d4[_0x5b9623][_0x3a3a('0x68')])){_0x42ba84[_0x27da3a[_0x3d17d4[_0x5b9623][_0x3a3a('0x68')]]]=_0x3d17d4[_0x5b9623][_0x3a3a('0x6c')];}}for(var _0x4412d3 in _0x27da3a){if(!_0x42ba84[_0x3a3a('0x39')](_0x27da3a[_0x4412d3])){_0x42ba84[_0x27da3a[_0x4412d3]]=null;}}_0x179ace['push'](_0x42ba84);}return _0x179ace;}})[_0x3a3a('0x25')](function(_0x14e935){if(!_[_0x3a3a('0x6d')](_0x14e935)){var _0x23db73=toCsv(_0x14e935);var _0x56a4db=Date[_0x3a3a('0x6e')]();fs['writeFileSync'](util[_0x3a3a('0x6a')](_0x3a3a('0x6f'),_0xaff4d8[_0x3a3a('0x48')]['id'],_0x56a4db),_0x23db73);_0x4e3937[_0x3a3a('0x70')](_0x3a3a('0x71'),_0x3a3a('0x72')+util[_0x3a3a('0x6a')](_0x3a3a('0x73'),_0xaff4d8[_0x3a3a('0x48')]['id'],_0x56a4db));_0x4e3937[_0x3a3a('0x70')](_0x3a3a('0x74'),_0x3a3a('0x75'));return _0x4e3937[_0x3a3a('0x76')](util[_0x3a3a('0x6a')](_0x3a3a('0x6f'),_0xaff4d8[_0x3a3a('0x48')]['id'],_0x56a4db));}else{return _0x4e3937['sendStatus'](0xcc);}})[_0x3a3a('0x4a')](handleError(_0x4e3937,null));};
\ No newline at end of file
index 7145a28..1a9a1e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4abf=['rimraf','exports','define','jscripty_projects','lodash','util','api','path'];(function(_0x2a9f85,_0xc18726){var _0x259639=function(_0x2ea115){while(--_0x2ea115){_0x2a9f85['push'](_0x2a9f85['shift']());}};_0x259639(++_0xc18726);}(_0x4abf,0xac));var _0xf4ab=function(_0x64b6e,_0x391478){_0x64b6e=_0x64b6e-0x0;var _0x5d4448=_0x4abf[_0x64b6e];return _0x5d4448;};'use strict';var _=require(_0xf4ab('0x0'));var util=require(_0xf4ab('0x1'));var logger=require('../../config/logger')(_0xf4ab('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf4ab('0x3'));var rimraf=require(_0xf4ab('0x4'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0xf4ab('0x5')]=function(_0x4160fb,_0x2e6efe){return _0x4160fb[_0xf4ab('0x6')]('JscriptyProject',attributes,{'tableName':_0xf4ab('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b47=['bluebird','request-promise','path','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment'];(function(_0x10dd55,_0x36184c){var _0x3b6266=function(_0x553cad){while(--_0x553cad){_0x10dd55['push'](_0x10dd55['shift']());}};_0x3b6266(++_0x36184c);}(_0x4b47,0x1b4));var _0x74b4=function(_0x392f70,_0x27c10c){_0x392f70=_0x392f70-0x0;var _0x20bd58=_0x4b47[_0x392f70];return _0x20bd58;};'use strict';var _=require(_0x74b4('0x0'));var util=require('util');var logger=require(_0x74b4('0x1'))(_0x74b4('0x2'));var moment=require(_0x74b4('0x3'));var BPromise=require(_0x74b4('0x4'));var rp=require(_0x74b4('0x5'));var fs=require('fs');var path=require(_0x74b4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74b4('0x7'));module[_0x74b4('0x8')]=function(_0x4dc737,_0x4cd397){return _0x4dc737['define'](_0x74b4('0x9'),attributes,{'tableName':_0x74b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea23288..ca84fac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','JscriptyProject,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x49f19e,_0x1c3aa3){_0x49f19e=_0x49f19e-0x0;var _0x280b5a=_0xbdb7[_0x49f19e];return _0x280b5a;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
+var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xda3f,0xec));var _0xfda3=function(_0x124e55,_0x36f8ed){_0x124e55=_0x124e55-0x0;var _0x3dc46b=_0xda3f[_0x124e55];return _0x3dc46b;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
index 2d23028..d429dd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda50=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xda50,0xdf));var _0x0da5=function(_0x4b5640,_0x30980b){_0x4b5640=_0x4b5640-0x0;var _0x4afbaf=_0xda50[_0x4b5640];return _0x4afbaf;};'use strict';var multer=require('multer');var util=require(_0x0da5('0x0'));var path=require(_0x0da5('0x1'));var timeout=require(_0x0da5('0x2'));var express=require(_0x0da5('0x3'));var router=express[_0x0da5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0da5('0x5'));var config=require(_0x0da5('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x0da5('0x7')]('/',auth[_0x0da5('0x8')](),controller[_0x0da5('0x9')]);router['get']('/describe',auth[_0x0da5('0x8')](),controller[_0x0da5('0xa')]);router[_0x0da5('0x7')](_0x0da5('0xb'),auth[_0x0da5('0x8')](),controller[_0x0da5('0xc')]);router[_0x0da5('0xd')]('/',auth[_0x0da5('0x8')](),controller[_0x0da5('0xe')]);router[_0x0da5('0xf')](_0x0da5('0xb'),auth[_0x0da5('0x8')](),controller[_0x0da5('0x10')]);router[_0x0da5('0x11')](_0x0da5('0xb'),auth['isAuthenticated'](),controller[_0x0da5('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x4775=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','post','put','/:id','update','delete','exports','util','path'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x4775,0x10c));var _0x5477=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0x4775[_0x4063a4];return _0x17908d;};'use strict';var multer=require('multer');var util=require(_0x5477('0x0'));var path=require(_0x5477('0x1'));var timeout=require(_0x5477('0x2'));var express=require(_0x5477('0x3'));var router=express['Router']();var fs_extra=require(_0x5477('0x4'));var auth=require(_0x5477('0x5'));var interaction=require(_0x5477('0x6'));var config=require(_0x5477('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x5477('0x8')]('/',auth[_0x5477('0x9')](),controller['index']);router['get'](_0x5477('0xa'),auth[_0x5477('0x9')](),controller['describe']);router['get']('/:id',auth[_0x5477('0x9')](),controller[_0x5477('0xb')]);router[_0x5477('0xc')]('/',auth[_0x5477('0x9')](),controller['create']);router[_0x5477('0xd')](_0x5477('0xe'),auth[_0x5477('0x9')](),controller[_0x5477('0xf')]);router[_0x5477('0x10')]('/:id',auth[_0x5477('0x9')](),controller['destroy']);module[_0x5477('0x11')]=router;
\ No newline at end of file
index aaca9d5..3ef0129 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x1e395a,_0x4f5de5){_0x1e395a=_0x1e395a-0x0;var _0x40b3c0=_0x7a54[_0x1e395a];return _0x40b3c0;};'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(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x7a54,0x106));var _0x47a5=function(_0x27d987,_0x3ca90e){_0x27d987=_0x27d987-0x0;var _0x4fa171=_0x7a54[_0x27d987];return _0x4fa171;};'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 6c21b83..6a8a400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x645b=['stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error'];(function(_0x38d672,_0xc41411){var _0x33b0ca=function(_0x1022ee){while(--_0x1022ee){_0x38d672['push'](_0x38d672['shift']());}};_0x33b0ca(++_0xc41411);}(_0x645b,0x1af));var _0xb645=function(_0x1ccb3b,_0x55d520){_0x1ccb3b=_0x1ccb3b-0x0;var _0x557296=_0x645b[_0x1ccb3b];return _0x557296;};'use strict';var emlformat=require(_0xb645('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb645('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb645('0x2'));var moment=require('moment');var BPromise=require(_0xb645('0x3'));var Mustache=require(_0xb645('0x4'));var util=require(_0xb645('0x5'));var path=require(_0xb645('0x6'));var sox=require(_0xb645('0x7'));var csv=require(_0xb645('0x8'));var ejs=require(_0xb645('0x9'));var fs=require('fs');var fs_extra=require(_0xb645('0xa'));var _=require(_0xb645('0xb'));var squel=require(_0xb645('0xc'));var crypto=require(_0xb645('0xd'));var jsforce=require(_0xb645('0xe'));var deskjs=require(_0xb645('0xf'));var toCsv=require(_0xb645('0x8'));var querystring=require('querystring');var Papa=require(_0xb645('0x10'));var Redis=require(_0xb645('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb645('0x12'));var as=require(_0xb645('0x13'));var hardwareService=require(_0xb645('0x14'));var logger=require(_0xb645('0x15'))(_0xb645('0x16'));var utils=require(_0xb645('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb645('0x18'));var db=require(_0xb645('0x19'))['db'];function respondWithStatusCode(_0x1c93ea,_0x3d0326){_0x3d0326=_0x3d0326||0xcc;return function(_0x32d8cf){if(_0x32d8cf){return _0x1c93ea[_0xb645('0x1a')](_0x3d0326);}return _0x1c93ea['status'](_0x3d0326)[_0xb645('0x1b')]();};}function respondWithResult(_0x596f04,_0x26dd33){_0x26dd33=_0x26dd33||0xc8;return function(_0x2d5c78){if(_0x2d5c78){return _0x596f04[_0xb645('0x1c')](_0x26dd33)[_0xb645('0x1d')](_0x2d5c78);}};}function respondWithFilteredResult(_0x534f5e,_0x558bf9){return function(_0xd7b26f){if(_0xd7b26f){var _0x5e9782=typeof _0x558bf9[_0xb645('0x1e')]===_0xb645('0x1f')&&typeof _0x558bf9[_0xb645('0x20')]===_0xb645('0x1f');var _0x10964a=_0xd7b26f[_0xb645('0x21')];var _0x65b45c=_0x5e9782?0x0:_0x558bf9[_0xb645('0x1e')];var _0x12f320=_0x5e9782?_0xd7b26f[_0xb645('0x21')]:_0x558bf9['offset']+_0x558bf9[_0xb645('0x20')];var _0x36ec79;if(_0x12f320>=_0x10964a){_0x12f320=_0x10964a;_0x36ec79=0xc8;}else{_0x36ec79=0xce;}_0x534f5e[_0xb645('0x1c')](_0x36ec79);return _0x534f5e[_0xb645('0x22')](_0xb645('0x23'),_0x65b45c+'-'+_0x12f320+'/'+_0x10964a)[_0xb645('0x1d')](_0xd7b26f);}return null;};}function patchUpdates(_0x4dda45){return function(_0x2ada2a){try{jsonpatch[_0xb645('0x24')](_0x2ada2a,_0x4dda45,!![]);}catch(_0x2157ff){return BPromise[_0xb645('0x25')](_0x2157ff);}return _0x2ada2a[_0xb645('0x26')]();};}function saveUpdates(_0x5014cc,_0x170e9e){return function(_0x531265){if(_0x531265){return _0x531265[_0xb645('0x27')](_0x5014cc)[_0xb645('0x28')](function(_0x42dcf3){return _0x42dcf3;});}return null;};}function removeEntity(_0xd3d8ce,_0x4be968){return function(_0x4ef0e4){if(_0x4ef0e4){return _0x4ef0e4[_0xb645('0x29')]()[_0xb645('0x28')](function(){_0xd3d8ce[_0xb645('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f640,_0x4fa5c2){return function(_0x4bd48c){if(!_0x4bd48c){_0x31f640[_0xb645('0x1a')](0x194);}return _0x4bd48c;};}function handleError(_0x20c33d,_0x363e7f){_0x363e7f=_0x363e7f||0x1f4;return function(_0x2190cb){logger[_0xb645('0x2a')](_0x2190cb[_0xb645('0x2b')]);if(_0x2190cb[_0xb645('0x2c')]){delete _0x2190cb[_0xb645('0x2c')];}_0x20c33d['status'](_0x363e7f)[_0xb645('0x2d')](_0x2190cb);};}exports[_0xb645('0x2e')]=function(_0x534f91,_0x479b8b){var _0x4af0d6={},_0x39bcfd={},_0x2ed292={'count':0x0,'rows':[]};var _0x5b9da9=_[_0xb645('0x2f')](db[_0xb645('0x30')][_0xb645('0x31')],function(_0x37dec0){return{'name':_0x37dec0[_0xb645('0x32')],'type':_0x37dec0[_0xb645('0x33')]['key']};});_0x39bcfd[_0xb645('0x34')]=_['map'](_0x5b9da9,_0xb645('0x2c'));_0x39bcfd[_0xb645('0x35')]=_[_0xb645('0x36')](_0x534f91[_0xb645('0x35')]);_0x39bcfd[_0xb645('0x37')]=_[_0xb645('0x38')](_0x39bcfd[_0xb645('0x34')],_0x39bcfd[_0xb645('0x35')]);_0x4af0d6[_0xb645('0x39')]=_[_0xb645('0x38')](_0x39bcfd[_0xb645('0x34')],qs[_0xb645('0x3a')](_0x534f91[_0xb645('0x35')][_0xb645('0x3a')]));_0x4af0d6['attributes']=_0x4af0d6[_0xb645('0x39')][_0xb645('0x3b')]?_0x4af0d6[_0xb645('0x39')]:_0x39bcfd[_0xb645('0x34')];if(!_0x534f91[_0xb645('0x35')][_0xb645('0x3c')]('nolimit')){_0x4af0d6[_0xb645('0x20')]=qs[_0xb645('0x20')](_0x534f91[_0xb645('0x35')][_0xb645('0x20')]);_0x4af0d6[_0xb645('0x1e')]=qs[_0xb645('0x1e')](_0x534f91[_0xb645('0x35')][_0xb645('0x1e')]);}_0x4af0d6[_0xb645('0x3d')]=qs[_0xb645('0x3e')](_0x534f91[_0xb645('0x35')][_0xb645('0x3e')]);_0x4af0d6[_0xb645('0x3f')]=qs['filters'](_[_0xb645('0x40')](_0x534f91['query'],_0x39bcfd[_0xb645('0x37')]),_0x5b9da9);if(_0x534f91['query'][_0xb645('0x41')]){_0x4af0d6[_0xb645('0x3f')]=_[_0xb645('0x42')](_0x4af0d6[_0xb645('0x3f')],{'$or':_['map'](_0x5b9da9,function(_0x32d60c){if(_0x32d60c[_0xb645('0x33')]!=='VIRTUAL'){var _0xb39803={};_0xb39803[_0x32d60c['name']]={'$like':'%'+_0x534f91[_0xb645('0x35')]['filter']+'%'};return _0xb39803;}})});}_0x4af0d6=_[_0xb645('0x42')]({},_0x4af0d6,_0x534f91[_0xb645('0x43')]);var _0x353ab0={'where':_0x4af0d6[_0xb645('0x3f')]};return db['JscriptyQuestionReport'][_0xb645('0x21')](_0x353ab0)[_0xb645('0x28')](function(_0x1ffdb8){_0x2ed292[_0xb645('0x21')]=_0x1ffdb8;if(_0x534f91[_0xb645('0x35')][_0xb645('0x44')]){_0x4af0d6[_0xb645('0x45')]=[{'all':!![]}];}return db[_0xb645('0x30')][_0xb645('0x46')](_0x4af0d6);})[_0xb645('0x28')](function(_0x760f65){_0x2ed292[_0xb645('0x47')]=_0x760f65;return _0x2ed292;})[_0xb645('0x28')](respondWithFilteredResult(_0x479b8b,_0x4af0d6))[_0xb645('0x48')](handleError(_0x479b8b,null));};exports[_0xb645('0x49')]=function(_0x59b1ef,_0x211dc6){var _0x52049f={'raw':!![],'where':{'id':_0x59b1ef[_0xb645('0x4a')]['id']}},_0x1d63cf={};_0x1d63cf[_0xb645('0x34')]=_['keys'](db[_0xb645('0x30')]['rawAttributes']);_0x1d63cf[_0xb645('0x35')]=_['keys'](_0x59b1ef['query']);_0x1d63cf[_0xb645('0x37')]=_['intersection'](_0x1d63cf[_0xb645('0x34')],_0x1d63cf['query']);_0x52049f[_0xb645('0x39')]=_[_0xb645('0x38')](_0x1d63cf[_0xb645('0x34')],qs[_0xb645('0x3a')](_0x59b1ef[_0xb645('0x35')]['fields']));_0x52049f[_0xb645('0x39')]=_0x52049f[_0xb645('0x39')][_0xb645('0x3b')]?_0x52049f[_0xb645('0x39')]:_0x1d63cf['model'];if(_0x59b1ef[_0xb645('0x35')]['includeAll']){_0x52049f['include']=[{'all':!![]}];}_0x52049f=_[_0xb645('0x42')]({},_0x52049f,_0x59b1ef[_0xb645('0x43')]);return db['JscriptyQuestionReport'][_0xb645('0x4b')](_0x52049f)[_0xb645('0x28')](handleEntityNotFound(_0x211dc6,null))[_0xb645('0x28')](respondWithResult(_0x211dc6,null))[_0xb645('0x48')](handleError(_0x211dc6,null));};exports['create']=function(_0x4b6f73,_0x135681){return db[_0xb645('0x30')][_0xb645('0x4c')](_0x4b6f73[_0xb645('0x4d')],{})[_0xb645('0x28')](respondWithResult(_0x135681,0xc9))[_0xb645('0x48')](handleError(_0x135681,null));};exports[_0xb645('0x27')]=function(_0x5a2d63,_0x55e752){if(_0x5a2d63[_0xb645('0x4d')]['id']){delete _0x5a2d63[_0xb645('0x4d')]['id'];}return db[_0xb645('0x30')][_0xb645('0x4b')]({'where':{'id':_0x5a2d63['params']['id']}})[_0xb645('0x28')](handleEntityNotFound(_0x55e752,null))[_0xb645('0x28')](saveUpdates(_0x5a2d63[_0xb645('0x4d')],null))[_0xb645('0x28')](respondWithResult(_0x55e752,null))[_0xb645('0x48')](handleError(_0x55e752,null));};exports[_0xb645('0x29')]=function(_0x48b10d,_0x537727){return db[_0xb645('0x30')][_0xb645('0x4b')]({'where':{'id':_0x48b10d['params']['id']}})[_0xb645('0x28')](handleEntityNotFound(_0x537727,null))['then'](removeEntity(_0x537727,null))[_0xb645('0x48')](handleError(_0x537727,null));};exports[_0xb645('0x4e')]=function(_0x57e7b8,_0x31a883){return db[_0xb645('0x30')][_0xb645('0x4e')]()[_0xb645('0x28')](respondWithResult(_0x31a883,null))[_0xb645('0x48')](handleError(_0x31a883,null));};
\ No newline at end of file
+var _0xe20d=['keys','filters','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0xe20d,0x1ca));var _0xde20=function(_0xa2796e,_0x1eab49){_0xa2796e=_0xa2796e-0x0;var _0x4c1834=_0xe20d[_0xa2796e];return _0x4c1834;};'use strict';var emlformat=require(_0xde20('0x0'));var rimraf=require(_0xde20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde20('0x2'));var rp=require(_0xde20('0x3'));var moment=require(_0xde20('0x4'));var BPromise=require(_0xde20('0x5'));var Mustache=require(_0xde20('0x6'));var util=require(_0xde20('0x7'));var path=require(_0xde20('0x8'));var sox=require(_0xde20('0x9'));var csv=require(_0xde20('0xa'));var ejs=require(_0xde20('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xde20('0xc'));var jsforce=require(_0xde20('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xde20('0xe'));var Papa=require(_0xde20('0xf'));var Redis=require(_0xde20('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xde20('0x11'));var as=require(_0xde20('0x12'));var hardwareService=require(_0xde20('0x13'));var logger=require(_0xde20('0x14'))(_0xde20('0x15'));var utils=require('../../config/utils');var config=require(_0xde20('0x16'));var licenseUtil=require(_0xde20('0x17'));var db=require(_0xde20('0x18'))['db'];function respondWithStatusCode(_0x418ef0,_0x4a07e8){_0x4a07e8=_0x4a07e8||0xcc;return function(_0x1c4c65){if(_0x1c4c65){return _0x418ef0[_0xde20('0x19')](_0x4a07e8);}return _0x418ef0[_0xde20('0x1a')](_0x4a07e8)['end']();};}function respondWithResult(_0x5c59e7,_0x34abbd){_0x34abbd=_0x34abbd||0xc8;return function(_0x55a06e){if(_0x55a06e){return _0x5c59e7[_0xde20('0x1a')](_0x34abbd)[_0xde20('0x1b')](_0x55a06e);}};}function respondWithFilteredResult(_0x13b32,_0xc5a2de){return function(_0x3a86c9){if(_0x3a86c9){var _0x50f58d=typeof _0xc5a2de['offset']===_0xde20('0x1c')&&typeof _0xc5a2de[_0xde20('0x1d')]===_0xde20('0x1c');var _0x413060=_0x3a86c9['count'];var _0x2f7a88=_0x50f58d?0x0:_0xc5a2de[_0xde20('0x1e')];var _0x3f05f2=_0x50f58d?_0x3a86c9[_0xde20('0x1f')]:_0xc5a2de[_0xde20('0x1e')]+_0xc5a2de['limit'];var _0x4f398e;if(_0x3f05f2>=_0x413060){_0x3f05f2=_0x413060;_0x4f398e=0xc8;}else{_0x4f398e=0xce;}_0x13b32[_0xde20('0x1a')](_0x4f398e);return _0x13b32[_0xde20('0x20')]('Content-Range',_0x2f7a88+'-'+_0x3f05f2+'/'+_0x413060)[_0xde20('0x1b')](_0x3a86c9);}return null;};}function patchUpdates(_0x40fbe4){return function(_0x47a7ce){try{jsonpatch[_0xde20('0x21')](_0x47a7ce,_0x40fbe4,!![]);}catch(_0x244074){return BPromise[_0xde20('0x22')](_0x244074);}return _0x47a7ce[_0xde20('0x23')]();};}function saveUpdates(_0x3c365d,_0x7e96c8){return function(_0x4a0d8f){if(_0x4a0d8f){return _0x4a0d8f[_0xde20('0x24')](_0x3c365d)[_0xde20('0x25')](function(_0x50084a){return _0x50084a;});}return null;};}function removeEntity(_0x4158af,_0x3affad){return function(_0x34c235){if(_0x34c235){return _0x34c235[_0xde20('0x26')]()['then'](function(){_0x4158af['status'](0xcc)[_0xde20('0x27')]();});}};}function handleEntityNotFound(_0x38474f,_0x3bb029){return function(_0x42c7fa){if(!_0x42c7fa){_0x38474f['sendStatus'](0x194);}return _0x42c7fa;};}function handleError(_0x144fa9,_0x2085fe){_0x2085fe=_0x2085fe||0x1f4;return function(_0x3dd2ee){logger['error'](_0x3dd2ee[_0xde20('0x28')]);if(_0x3dd2ee['name']){delete _0x3dd2ee[_0xde20('0x29')];}_0x144fa9[_0xde20('0x1a')](_0x2085fe)[_0xde20('0x2a')](_0x3dd2ee);};}exports[_0xde20('0x2b')]=function(_0x22be9d,_0x150135){var _0x1005a4={},_0xe13cc5={},_0x31537f={'count':0x0,'rows':[]};var _0x172117=_[_0xde20('0x2c')](db[_0xde20('0x2d')][_0xde20('0x2e')],function(_0x2e421d){return{'name':_0x2e421d['fieldName'],'type':_0x2e421d['type'][_0xde20('0x2f')]};});_0xe13cc5[_0xde20('0x30')]=_[_0xde20('0x2c')](_0x172117,'name');_0xe13cc5[_0xde20('0x31')]=_['keys'](_0x22be9d['query']);_0xe13cc5['filters']=_[_0xde20('0x32')](_0xe13cc5['model'],_0xe13cc5[_0xde20('0x31')]);_0x1005a4[_0xde20('0x33')]=_[_0xde20('0x32')](_0xe13cc5['model'],qs[_0xde20('0x34')](_0x22be9d['query'][_0xde20('0x34')]));_0x1005a4[_0xde20('0x33')]=_0x1005a4[_0xde20('0x33')][_0xde20('0x35')]?_0x1005a4['attributes']:_0xe13cc5[_0xde20('0x30')];if(!_0x22be9d[_0xde20('0x31')]['hasOwnProperty'](_0xde20('0x36'))){_0x1005a4[_0xde20('0x1d')]=qs['limit'](_0x22be9d['query']['limit']);_0x1005a4['offset']=qs[_0xde20('0x1e')](_0x22be9d['query']['offset']);}_0x1005a4[_0xde20('0x37')]=qs[_0xde20('0x38')](_0x22be9d[_0xde20('0x31')][_0xde20('0x38')]);_0x1005a4[_0xde20('0x39')]=qs['filters'](_['pick'](_0x22be9d[_0xde20('0x31')],_0xe13cc5['filters']),_0x172117);if(_0x22be9d['query'][_0xde20('0x3a')]){_0x1005a4[_0xde20('0x39')]=_['merge'](_0x1005a4[_0xde20('0x39')],{'$or':_[_0xde20('0x2c')](_0x172117,function(_0x5b7129){if(_0x5b7129['type']!==_0xde20('0x3b')){var _0x2b8d90={};_0x2b8d90[_0x5b7129['name']]={'$like':'%'+_0x22be9d[_0xde20('0x31')]['filter']+'%'};return _0x2b8d90;}})});}_0x1005a4=_[_0xde20('0x3c')]({},_0x1005a4,_0x22be9d[_0xde20('0x3d')]);var _0x12da98={'where':_0x1005a4[_0xde20('0x39')]};return db[_0xde20('0x2d')]['count'](_0x12da98)[_0xde20('0x25')](function(_0x55a9d3){_0x31537f[_0xde20('0x1f')]=_0x55a9d3;if(_0x22be9d[_0xde20('0x31')][_0xde20('0x3e')]){_0x1005a4['include']=[{'all':!![]}];}return db[_0xde20('0x2d')][_0xde20('0x3f')](_0x1005a4);})[_0xde20('0x25')](function(_0x131a69){_0x31537f[_0xde20('0x40')]=_0x131a69;return _0x31537f;})[_0xde20('0x25')](respondWithFilteredResult(_0x150135,_0x1005a4))[_0xde20('0x41')](handleError(_0x150135,null));};exports[_0xde20('0x42')]=function(_0x28e815,_0x20a6be){var _0x4e4cd8={'raw':!![],'where':{'id':_0x28e815['params']['id']}},_0x2cf7bb={};_0x2cf7bb[_0xde20('0x30')]=_[_0xde20('0x43')](db[_0xde20('0x2d')]['rawAttributes']);_0x2cf7bb['query']=_[_0xde20('0x43')](_0x28e815['query']);_0x2cf7bb[_0xde20('0x44')]=_[_0xde20('0x32')](_0x2cf7bb['model'],_0x2cf7bb[_0xde20('0x31')]);_0x4e4cd8[_0xde20('0x33')]=_[_0xde20('0x32')](_0x2cf7bb[_0xde20('0x30')],qs['fields'](_0x28e815[_0xde20('0x31')][_0xde20('0x34')]));_0x4e4cd8[_0xde20('0x33')]=_0x4e4cd8[_0xde20('0x33')][_0xde20('0x35')]?_0x4e4cd8[_0xde20('0x33')]:_0x2cf7bb[_0xde20('0x30')];if(_0x28e815[_0xde20('0x31')][_0xde20('0x3e')]){_0x4e4cd8[_0xde20('0x45')]=[{'all':!![]}];}_0x4e4cd8=_[_0xde20('0x3c')]({},_0x4e4cd8,_0x28e815[_0xde20('0x3d')]);return db[_0xde20('0x2d')][_0xde20('0x46')](_0x4e4cd8)[_0xde20('0x25')](handleEntityNotFound(_0x20a6be,null))[_0xde20('0x25')](respondWithResult(_0x20a6be,null))[_0xde20('0x41')](handleError(_0x20a6be,null));};exports['create']=function(_0x236e9a,_0x368307){return db[_0xde20('0x2d')][_0xde20('0x47')](_0x236e9a[_0xde20('0x48')],{})[_0xde20('0x25')](respondWithResult(_0x368307,0xc9))['catch'](handleError(_0x368307,null));};exports['update']=function(_0x186bc6,_0x4b9ed9){if(_0x186bc6[_0xde20('0x48')]['id']){delete _0x186bc6[_0xde20('0x48')]['id'];}return db['JscriptyQuestionReport'][_0xde20('0x46')]({'where':{'id':_0x186bc6[_0xde20('0x49')]['id']}})[_0xde20('0x25')](handleEntityNotFound(_0x4b9ed9,null))[_0xde20('0x25')](saveUpdates(_0x186bc6[_0xde20('0x48')],null))['then'](respondWithResult(_0x4b9ed9,null))['catch'](handleError(_0x4b9ed9,null));};exports[_0xde20('0x26')]=function(_0x556b0a,_0x894aeb){return db[_0xde20('0x2d')]['find']({'where':{'id':_0x556b0a[_0xde20('0x49')]['id']}})['then'](handleEntityNotFound(_0x894aeb,null))[_0xde20('0x25')](removeEntity(_0x894aeb,null))[_0xde20('0x41')](handleError(_0x894aeb,null));};exports[_0xde20('0x4a')]=function(_0xffb2af,_0x58d47c){return db[_0xde20('0x2d')][_0xde20('0x4a')]()[_0xde20('0x25')](respondWithResult(_0x58d47c,null))['catch'](handleError(_0x58d47c,null));};
\ No newline at end of file
index 328a319..735a546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1895=['path','./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','api','bluebird','request-promise'];(function(_0x15cfd3,_0xca8998){var _0x486df1=function(_0x596ef4){while(--_0x596ef4){_0x15cfd3['push'](_0x15cfd3['shift']());}};_0x486df1(++_0xca8998);}(_0x1895,0x1bc));var _0x5189=function(_0x5a7efc,_0x36d657){_0x5a7efc=_0x5a7efc-0x0;var _0x1e6341=_0x1895[_0x5a7efc];return _0x1e6341;};'use strict';var _=require(_0x5189('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5189('0x1'));var moment=require('moment');var BPromise=require(_0x5189('0x2'));var rp=require(_0x5189('0x3'));var fs=require('fs');var path=require(_0x5189('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5189('0x5'));module['exports']=function(_0x15aa72,_0x4b3bf9){return _0x15aa72[_0x5189('0x6')]('JscriptyQuestionReport',attributes,{'tableName':_0x5189('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1878=['lodash','util','api','moment','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions'];(function(_0x57ac8f,_0x570008){var _0x3281db=function(_0x1b5dfe){while(--_0x1b5dfe){_0x57ac8f['push'](_0x57ac8f['shift']());}};_0x3281db(++_0x570008);}(_0x1878,0x1e4));var _0x8187=function(_0x4dcf55,_0x247619){_0x4dcf55=_0x4dcf55-0x0;var _0x6fb438=_0x1878[_0x4dcf55];return _0x6fb438;};'use strict';var _=require(_0x8187('0x0'));var util=require(_0x8187('0x1'));var logger=require('../../config/logger')(_0x8187('0x2'));var moment=require(_0x8187('0x3'));var BPromise=require('bluebird');var rp=require(_0x8187('0x4'));var fs=require('fs');var path=require(_0x8187('0x5'));var rimraf=require(_0x8187('0x6'));var config=require('../../config/environment');var attributes=require(_0x8187('0x7'));module[_0x8187('0x8')]=function(_0x27d046,_0x41c019){return _0x27d046[_0x8187('0x9')]('JscriptyQuestionReport',attributes,{'tableName':_0x8187('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f20b476..7334c39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc10=['http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x25b90a,_0x5891fa){var _0x36c4ae=function(_0x2de29c){while(--_0x2de29c){_0x25b90a['push'](_0x25b90a['shift']());}};_0x36c4ae(++_0x5891fa);}(_0xcc10,0xd1));var _0x0cc1=function(_0x1f2fc1,_0x59c73a){_0x1f2fc1=_0x1f2fc1-0x0;var _0x2ba697=_0xcc10[_0x1f2fc1];return _0x2ba697;};'use strict';var _=require(_0x0cc1('0x0'));var util=require(_0x0cc1('0x1'));var moment=require(_0x0cc1('0x2'));var BPromise=require(_0x0cc1('0x3'));var rs=require(_0x0cc1('0x4'));var fs=require('fs');var Redis=require(_0x0cc1('0x5'));var db=require(_0x0cc1('0x6'))['db'];var utils=require(_0x0cc1('0x7'));var logger=require('../../config/logger')(_0x0cc1('0x8'));var config=require(_0x0cc1('0x9'));var jayson=require(_0x0cc1('0xa'));var client=jayson['client'][_0x0cc1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23c659,_0x387d56,_0x282c8b){return new BPromise(function(_0x581905,_0x10d65b){return client[_0x0cc1('0xc')](_0x23c659,_0x282c8b)[_0x0cc1('0xd')](function(_0xf0a402){logger[_0x0cc1('0xe')](_0x0cc1('0xf'),_0x387d56,_0x0cc1('0x10'));logger['debug']('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x387d56,'request\x20sent',JSON['stringify'](_0xf0a402));if(_0xf0a402[_0x0cc1('0x11')]){if(_0xf0a402[_0x0cc1('0x11')][_0x0cc1('0x12')]===0x1f4){logger[_0x0cc1('0x11')](_0x0cc1('0xf'),_0x387d56,_0xf0a402[_0x0cc1('0x11')][_0x0cc1('0x13')]);return _0x10d65b(_0xf0a402[_0x0cc1('0x11')][_0x0cc1('0x13')]);}logger[_0x0cc1('0x11')](_0x0cc1('0xf'),_0x387d56,_0xf0a402['error'][_0x0cc1('0x13')]);return _0x581905(_0xf0a402[_0x0cc1('0x11')][_0x0cc1('0x13')]);}else{logger[_0x0cc1('0xe')](_0x0cc1('0xf'),_0x387d56,_0x0cc1('0x10'));_0x581905(_0xf0a402[_0x0cc1('0x14')][_0x0cc1('0x13')]);}})[_0x0cc1('0x15')](function(_0x598cf6){logger[_0x0cc1('0x11')](_0x0cc1('0xf'),_0x387d56,_0x598cf6);_0x10d65b(_0x598cf6);});});}
\ No newline at end of file
+var _0x972c=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x549fb4,_0x57140c){var _0xc64c37=function(_0x40e702){while(--_0x40e702){_0x549fb4['push'](_0x549fb4['shift']());}};_0xc64c37(++_0x57140c);}(_0x972c,0x15c));var _0xc972=function(_0x4cbc9c,_0x52849e){_0x4cbc9c=_0x4cbc9c-0x0;var _0x4f0d4d=_0x972c[_0x4cbc9c];return _0x4f0d4d;};'use strict';var _=require(_0xc972('0x0'));var util=require(_0xc972('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc972('0x2'));var fs=require('fs');var Redis=require(_0xc972('0x3'));var db=require(_0xc972('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc972('0x5'));var config=require(_0xc972('0x6'));var jayson=require(_0xc972('0x7'));var client=jayson[_0xc972('0x8')][_0xc972('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dbbdd,_0x20fcd4,_0x568b6e){return new BPromise(function(_0x4b95e1,_0x5105ca){return client[_0xc972('0xa')](_0x1dbbdd,_0x568b6e)[_0xc972('0xb')](function(_0x5bc402){logger[_0xc972('0xc')](_0xc972('0xd'),_0x20fcd4,_0xc972('0xe'));logger['debug'](_0xc972('0xf'),_0x20fcd4,_0xc972('0xe'),JSON[_0xc972('0x10')](_0x5bc402));if(_0x5bc402[_0xc972('0x11')]){if(_0x5bc402['error'][_0xc972('0x12')]===0x1f4){logger[_0xc972('0x11')](_0xc972('0xd'),_0x20fcd4,_0x5bc402[_0xc972('0x11')][_0xc972('0x13')]);return _0x5105ca(_0x5bc402[_0xc972('0x11')]['message']);}logger['error'](_0xc972('0xd'),_0x20fcd4,_0x5bc402[_0xc972('0x11')][_0xc972('0x13')]);return _0x4b95e1(_0x5bc402['error'][_0xc972('0x13')]);}else{logger[_0xc972('0xc')](_0xc972('0xd'),_0x20fcd4,_0xc972('0xe'));_0x4b95e1(_0x5bc402[_0xc972('0x14')]['message']);}})[_0xc972('0x15')](function(_0x3edb20){logger['error'](_0xc972('0xd'),_0x20fcd4,_0x3edb20);_0x5105ca(_0x3edb20);});});}
\ No newline at end of file
index 27ef094..47d6d1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf9=['isAuthenticated','index','/describe','/:id','show','/:id/questions','create','put','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get'];(function(_0x4e6b5e,_0x17b2f1){var _0x4c9460=function(_0x3cf400){while(--_0x3cf400){_0x4e6b5e['push'](_0x4e6b5e['shift']());}};_0x4c9460(++_0x17b2f1);}(_0x6bf9,0x8f));var _0x96bf=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0x6bf9[_0x5eaa0b];return _0x28b295;};'use strict';var multer=require(_0x96bf('0x0'));var util=require(_0x96bf('0x1'));var path=require(_0x96bf('0x2'));var timeout=require(_0x96bf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x96bf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x96bf('0x5'));var config=require(_0x96bf('0x6'));var controller=require(_0x96bf('0x7'));router[_0x96bf('0x8')]('/',auth[_0x96bf('0x9')](),controller[_0x96bf('0xa')]);router['get'](_0x96bf('0xb'),auth[_0x96bf('0x9')](),controller['describe']);router['get'](_0x96bf('0xc'),auth[_0x96bf('0x9')](),controller[_0x96bf('0xd')]);router[_0x96bf('0x8')](_0x96bf('0xe'),auth[_0x96bf('0x9')](),controller['getQuestions']);router['post']('/',auth[_0x96bf('0x9')](),controller[_0x96bf('0xf')]);router[_0x96bf('0x10')](_0x96bf('0xc'),auth[_0x96bf('0x9')](),controller[_0x96bf('0x11')]);router[_0x96bf('0x12')](_0x96bf('0xc'),auth[_0x96bf('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xd796=['path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','post','update','delete','destroy','exports'];(function(_0x41a735,_0x323718){var _0x5de055=function(_0x5a49aa){while(--_0x5a49aa){_0x41a735['push'](_0x41a735['shift']());}};_0x5de055(++_0x323718);}(_0xd796,0x78));var _0x6d79=function(_0x3c7986,_0x1bb6bc){_0x3c7986=_0x3c7986-0x0;var _0x3a26a6=_0xd796[_0x3c7986];return _0x3a26a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6d79('0x0'));var timeout=require(_0x6d79('0x1'));var express=require('express');var router=express[_0x6d79('0x2')]();var fs_extra=require(_0x6d79('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6d79('0x4'));var config=require(_0x6d79('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0x6d79('0x6')]('/',auth['isAuthenticated'](),controller[_0x6d79('0x7')]);router['get'](_0x6d79('0x8'),auth[_0x6d79('0x9')](),controller[_0x6d79('0xa')]);router[_0x6d79('0x6')](_0x6d79('0xb'),auth[_0x6d79('0x9')](),controller[_0x6d79('0xc')]);router[_0x6d79('0x6')](_0x6d79('0xd'),auth['isAuthenticated'](),controller[_0x6d79('0xe')]);router[_0x6d79('0xf')]('/',auth[_0x6d79('0x9')](),controller['create']);router['put']('/:id',auth[_0x6d79('0x9')](),controller[_0x6d79('0x10')]);router[_0x6d79('0x11')](_0x6d79('0xb'),auth['isAuthenticated'](),controller[_0x6d79('0x12')]);module[_0x6d79('0x13')]=router;
\ No newline at end of file
index abab06c..d8d30ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85de=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x49bf83,_0x3a54dc){var _0x339b39=function(_0x4ed39e){while(--_0x4ed39e){_0x49bf83['push'](_0x49bf83['shift']());}};_0x339b39(++_0x3a54dc);}(_0x85de,0x65));var _0xe85d=function(_0x2dcfae,_0x5bb50d){_0x2dcfae=_0x2dcfae-0x0;var _0x213a88=_0x85de[_0x2dcfae];return _0x213a88;};'use strict';var moment=require(_0xe85d('0x0'));var Sequelize=require(_0xe85d('0x1'));module[_0xe85d('0x2')]={'starttime':{'type':Sequelize[_0xe85d('0x3')],'set':function(_0xdb8f9e){this[_0xe85d('0x4')]('starttime',_0xdb8f9e);this[_0xe85d('0x4')](_0xe85d('0x5'),moment()[_0xe85d('0x6')](_0xe85d('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xe85d('0x8')]},'queue':{'type':Sequelize[_0xe85d('0x8')]},'uniqueid':{'type':Sequelize[_0xe85d('0x8')]},'calleridname':{'type':Sequelize[_0xe85d('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xe85d('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0e33=['moment','sequelize','DATE','setDataValue','endtime','format','STRING','BOOLEAN'];(function(_0x4ab58f,_0x382a69){var _0x699d7d=function(_0x4cfaee){while(--_0x4cfaee){_0x4ab58f['push'](_0x4ab58f['shift']());}};_0x699d7d(++_0x382a69);}(_0x0e33,0xf8));var _0x30e3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0e33[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0x30e3('0x0'));var Sequelize=require(_0x30e3('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x30e3('0x2')],'set':function(_0x17ab04){this[_0x30e3('0x3')]('starttime',_0x17ab04);this[_0x30e3('0x3')](_0x30e3('0x4'),moment()[_0x30e3('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x30e3('0x6')]},'projectname':{'type':Sequelize[_0x30e3('0x6')]},'queue':{'type':Sequelize[_0x30e3('0x6')]},'uniqueid':{'type':Sequelize[_0x30e3('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x30e3('0x6')]},'completed':{'type':Sequelize[_0x30e3('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 8bc74e4..ef54305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8044=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','findOne','length','nolimit','pick','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel'];(function(_0x1d5401,_0x2f95da){var _0x5021c0=function(_0x37205d){while(--_0x37205d){_0x1d5401['push'](_0x1d5401['shift']());}};_0x5021c0(++_0x2f95da);}(_0x8044,0xee));var _0x4804=function(_0x1c06f4,_0x2feba6){_0x1c06f4=_0x1c06f4-0x0;var _0x1a727e=_0x8044[_0x1c06f4];return _0x1a727e;};'use strict';var emlformat=require(_0x4804('0x0'));var rimraf=require(_0x4804('0x1'));var zipdir=require(_0x4804('0x2'));var jsonpatch=require(_0x4804('0x3'));var rp=require(_0x4804('0x4'));var moment=require(_0x4804('0x5'));var BPromise=require(_0x4804('0x6'));var Mustache=require(_0x4804('0x7'));var util=require(_0x4804('0x8'));var path=require('path');var sox=require(_0x4804('0x9'));var csv=require('to-csv');var ejs=require(_0x4804('0xa'));var fs=require('fs');var fs_extra=require(_0x4804('0xb'));var _=require(_0x4804('0xc'));var squel=require(_0x4804('0xd'));var crypto=require(_0x4804('0xe'));var jsforce=require(_0x4804('0xf'));var deskjs=require(_0x4804('0x10'));var toCsv=require('to-csv');var querystring=require(_0x4804('0x11'));var Papa=require('papaparse');var Redis=require(_0x4804('0x12'));var authService=require(_0x4804('0x13'));var qs=require(_0x4804('0x14'));var as=require(_0x4804('0x15'));var hardwareService=require(_0x4804('0x16'));var logger=require(_0x4804('0x17'))(_0x4804('0x18'));var utils=require(_0x4804('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x4804('0x1a'));var db=require(_0x4804('0x1b'))['db'];function respondWithStatusCode(_0x1dc811,_0x9c3461){_0x9c3461=_0x9c3461||0xcc;return function(_0x21d1c6){if(_0x21d1c6){return _0x1dc811[_0x4804('0x1c')](_0x9c3461);}return _0x1dc811[_0x4804('0x1d')](_0x9c3461)[_0x4804('0x1e')]();};}function respondWithResult(_0x11bd75,_0x32bf7d){_0x32bf7d=_0x32bf7d||0xc8;return function(_0x49989f){if(_0x49989f){return _0x11bd75[_0x4804('0x1d')](_0x32bf7d)[_0x4804('0x1f')](_0x49989f);}};}function respondWithFilteredResult(_0x59ecac,_0x537229){return function(_0x46ffa7){if(_0x46ffa7){var _0x49249d=typeof _0x537229[_0x4804('0x20')]===_0x4804('0x21')&&typeof _0x537229['limit']===_0x4804('0x21');var _0x3cb74c=_0x46ffa7['count'];var _0x3b2ea8=_0x49249d?0x0:_0x537229['offset'];var _0xfbab2d=_0x49249d?_0x46ffa7[_0x4804('0x22')]:_0x537229[_0x4804('0x20')]+_0x537229[_0x4804('0x23')];var _0x9ac872;if(_0xfbab2d>=_0x3cb74c){_0xfbab2d=_0x3cb74c;_0x9ac872=0xc8;}else{_0x9ac872=0xce;}_0x59ecac[_0x4804('0x1d')](_0x9ac872);return _0x59ecac[_0x4804('0x24')](_0x4804('0x25'),_0x3b2ea8+'-'+_0xfbab2d+'/'+_0x3cb74c)[_0x4804('0x1f')](_0x46ffa7);}return null;};}function patchUpdates(_0x115971){return function(_0x3b0953){try{jsonpatch[_0x4804('0x26')](_0x3b0953,_0x115971,!![]);}catch(_0xb255ac){return BPromise[_0x4804('0x27')](_0xb255ac);}return _0x3b0953['save']();};}function saveUpdates(_0xf125e1,_0x8f76b6){return function(_0x1189a2){if(_0x1189a2){return _0x1189a2[_0x4804('0x28')](_0xf125e1)[_0x4804('0x29')](function(_0x4237bd){return _0x4237bd;});}return null;};}function removeEntity(_0x4fde64,_0x5750e0){return function(_0x10db60){if(_0x10db60){return _0x10db60[_0x4804('0x2a')]()[_0x4804('0x29')](function(){_0x4fde64[_0x4804('0x1d')](0xcc)[_0x4804('0x1e')]();});}};}function handleEntityNotFound(_0xbc61e0,_0x3ebffa){return function(_0x47e544){if(!_0x47e544){_0xbc61e0[_0x4804('0x1c')](0x194);}return _0x47e544;};}function handleError(_0x28ec47,_0x5c292e){_0x5c292e=_0x5c292e||0x1f4;return function(_0x3c9616){logger[_0x4804('0x2b')](_0x3c9616['stack']);if(_0x3c9616[_0x4804('0x2c')]){delete _0x3c9616[_0x4804('0x2c')];}_0x28ec47[_0x4804('0x1d')](_0x5c292e)[_0x4804('0x2d')](_0x3c9616);};}exports[_0x4804('0x2e')]=function(_0x431e59,_0x375adf){var _0x5c8478={},_0xc6187c={},_0x28d2bc={'count':0x0,'rows':[]};var _0x48c57f=_[_0x4804('0x2f')](db[_0x4804('0x30')][_0x4804('0x31')],function(_0x525e61){return{'name':_0x525e61[_0x4804('0x32')],'type':_0x525e61['type']['key']};});_0xc6187c['model']=_[_0x4804('0x2f')](_0x48c57f,_0x4804('0x2c'));_0xc6187c[_0x4804('0x33')]=_[_0x4804('0x34')](_0x431e59[_0x4804('0x33')]);_0xc6187c[_0x4804('0x35')]=_[_0x4804('0x36')](_0xc6187c[_0x4804('0x37')],_0xc6187c[_0x4804('0x33')]);_0x5c8478[_0x4804('0x38')]=_[_0x4804('0x36')](_0xc6187c[_0x4804('0x37')],qs[_0x4804('0x39')](_0x431e59[_0x4804('0x33')]['fields']));_0x5c8478['attributes']=_0x5c8478[_0x4804('0x38')]['length']?_0x5c8478[_0x4804('0x38')]:_0xc6187c[_0x4804('0x37')];if(!_0x431e59['query'][_0x4804('0x3a')]('nolimit')){_0x5c8478[_0x4804('0x23')]=qs[_0x4804('0x23')](_0x431e59[_0x4804('0x33')]['limit']);_0x5c8478[_0x4804('0x20')]=qs[_0x4804('0x20')](_0x431e59[_0x4804('0x33')][_0x4804('0x20')]);}_0x5c8478[_0x4804('0x3b')]=qs[_0x4804('0x3c')](_0x431e59[_0x4804('0x33')][_0x4804('0x3c')]);_0x5c8478[_0x4804('0x3d')]=qs[_0x4804('0x35')](_['pick'](_0x431e59[_0x4804('0x33')],_0xc6187c[_0x4804('0x35')]),_0x48c57f);if(_0x431e59[_0x4804('0x33')]['filter']){_0x5c8478['where']=_['merge'](_0x5c8478['where'],{'$or':_['map'](_0x48c57f,function(_0x345c65){if(_0x345c65[_0x4804('0x3e')]!==_0x4804('0x3f')){var _0x265ebf={};_0x265ebf[_0x345c65[_0x4804('0x2c')]]={'$like':'%'+_0x431e59[_0x4804('0x33')][_0x4804('0x40')]+'%'};return _0x265ebf;}})});}_0x5c8478=_[_0x4804('0x41')]({},_0x5c8478,_0x431e59[_0x4804('0x42')]);var _0x138fc1={'where':_0x5c8478['where']};return db[_0x4804('0x30')][_0x4804('0x22')](_0x138fc1)[_0x4804('0x29')](function(_0x27c080){_0x28d2bc[_0x4804('0x22')]=_0x27c080;if(_0x431e59[_0x4804('0x33')][_0x4804('0x43')]){_0x5c8478[_0x4804('0x44')]=[{'all':!![]}];}return db[_0x4804('0x30')][_0x4804('0x45')](_0x5c8478);})[_0x4804('0x29')](function(_0x1e1b04){_0x28d2bc[_0x4804('0x46')]=_0x1e1b04;return _0x28d2bc;})[_0x4804('0x29')](respondWithFilteredResult(_0x375adf,_0x5c8478))[_0x4804('0x47')](handleError(_0x375adf,null));};exports[_0x4804('0x48')]=function(_0x3f7308,_0x14d703){var _0x249b9d={'raw':!![],'where':{'id':_0x3f7308[_0x4804('0x49')]['id']}},_0x3e1dbe={};_0x3e1dbe[_0x4804('0x37')]=_[_0x4804('0x34')](db['JscriptySessionReport']['rawAttributes']);_0x3e1dbe['query']=_[_0x4804('0x34')](_0x3f7308[_0x4804('0x33')]);_0x3e1dbe[_0x4804('0x35')]=_[_0x4804('0x36')](_0x3e1dbe['model'],_0x3e1dbe[_0x4804('0x33')]);_0x249b9d[_0x4804('0x38')]=_['intersection'](_0x3e1dbe[_0x4804('0x37')],qs['fields'](_0x3f7308['query'][_0x4804('0x39')]));_0x249b9d[_0x4804('0x38')]=_0x249b9d[_0x4804('0x38')]['length']?_0x249b9d[_0x4804('0x38')]:_0x3e1dbe[_0x4804('0x37')];if(_0x3f7308[_0x4804('0x33')]['includeAll']){_0x249b9d[_0x4804('0x44')]=[{'all':!![]}];}_0x249b9d=_[_0x4804('0x41')]({},_0x249b9d,_0x3f7308[_0x4804('0x42')]);return db[_0x4804('0x30')][_0x4804('0x4a')](_0x249b9d)[_0x4804('0x29')](handleEntityNotFound(_0x14d703,null))[_0x4804('0x29')](respondWithResult(_0x14d703,null))[_0x4804('0x47')](handleError(_0x14d703,null));};exports[_0x4804('0x4b')]=function(_0x544280,_0x33b73c){return db['JscriptySessionReport'][_0x4804('0x4b')](_0x544280['body'],{})[_0x4804('0x29')](respondWithResult(_0x33b73c,0xc9))[_0x4804('0x47')](handleError(_0x33b73c,null));};exports[_0x4804('0x28')]=function(_0x435a2b,_0x85a44f){if(_0x435a2b['body']['id']){delete _0x435a2b[_0x4804('0x4c')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x435a2b['params']['id']}})[_0x4804('0x29')](handleEntityNotFound(_0x85a44f,null))['then'](saveUpdates(_0x435a2b[_0x4804('0x4c')],null))['then'](respondWithResult(_0x85a44f,null))['catch'](handleError(_0x85a44f,null));};exports[_0x4804('0x2a')]=function(_0x2e835d,_0x1316ca){return db[_0x4804('0x30')][_0x4804('0x4a')]({'where':{'id':_0x2e835d[_0x4804('0x49')]['id']}})['then'](handleEntityNotFound(_0x1316ca,null))[_0x4804('0x29')](removeEntity(_0x1316ca,null))[_0x4804('0x47')](handleError(_0x1316ca,null));};exports['describe']=function(_0x44c08a,_0x218c1e){return db[_0x4804('0x30')][_0x4804('0x4d')]()[_0x4804('0x29')](respondWithResult(_0x218c1e,null))[_0x4804('0x47')](handleError(_0x218c1e,null));};exports[_0x4804('0x4e')]=function(_0x487208,_0x3da115,_0x43c894){var _0x476a62={'raw':!![],'where':{}};var _0x257432={};var _0x425a5f={'count':0x0,'rows':[]};return db[_0x4804('0x30')][_0x4804('0x4f')]({'where':{'id':_0x487208['params']['id']}})[_0x4804('0x29')](handleEntityNotFound(_0x3da115,null))[_0x4804('0x29')](function(_0x50ae2f){if(_0x50ae2f){_0x257432[_0x4804('0x37')]=_[_0x4804('0x34')](db['JscriptyQuestionReport']['rawAttributes']);_0x257432[_0x4804('0x33')]=_[_0x4804('0x34')](_0x487208[_0x4804('0x33')]);_0x257432['filters']=_[_0x4804('0x36')](_0x257432[_0x4804('0x37')],_0x257432[_0x4804('0x33')]);_0x476a62[_0x4804('0x38')]=_['intersection'](_0x257432[_0x4804('0x37')],qs[_0x4804('0x39')](_0x487208[_0x4804('0x33')]['fields']));_0x476a62[_0x4804('0x38')]=_0x476a62[_0x4804('0x38')][_0x4804('0x50')]?_0x476a62['attributes']:_0x257432[_0x4804('0x37')];if(!_0x487208[_0x4804('0x33')][_0x4804('0x3a')](_0x4804('0x51'))){_0x476a62[_0x4804('0x23')]=qs[_0x4804('0x23')](_0x487208['query']['limit']);_0x476a62[_0x4804('0x20')]=qs['offset'](_0x487208[_0x4804('0x33')][_0x4804('0x20')]);}_0x476a62['order']=qs[_0x4804('0x3c')](_0x487208['query'][_0x4804('0x3c')]);_0x476a62[_0x4804('0x3d')]=qs['filters'](_[_0x4804('0x52')](_0x487208[_0x4804('0x33')],_0x257432[_0x4804('0x35')]));_0x476a62[_0x4804('0x3d')]['SessionId']=_0x50ae2f['id'];if(_0x487208[_0x4804('0x33')][_0x4804('0x40')]){_0x476a62[_0x4804('0x3d')]=_['merge'](_0x476a62[_0x4804('0x3d')],{'$or':_['map'](_0x476a62[_0x4804('0x38')],function(_0x46f821){var _0x56cd71={};_0x56cd71[_0x46f821]={'$like':'%'+_0x487208['query'][_0x4804('0x40')]+'%'};return _0x56cd71;})});}_0x476a62=_[_0x4804('0x41')]({},_0x476a62,_0x487208[_0x4804('0x42')]);return db[_0x4804('0x53')]['count']({'where':_0x476a62['where']})['then'](function(_0x3c14e1){_0x425a5f[_0x4804('0x22')]=_0x3c14e1;if(_0x487208[_0x4804('0x33')][_0x4804('0x43')]){_0x476a62[_0x4804('0x44')]=[{'all':!![]}];}return db[_0x4804('0x53')][_0x4804('0x45')](_0x476a62);})[_0x4804('0x29')](function(_0x3934b7){_0x425a5f['rows']=_0x3934b7;return _0x425a5f;});}})[_0x4804('0x29')](respondWithFilteredResult(_0x3da115,_0x476a62))['catch'](handleError(_0x3da115,null));};
\ No newline at end of file
+var _0xb412=['map','JscriptySessionReport','type','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','catch','params','keys','rawAttributes','fields','find','create','body','describe','getQuestions','JscriptyQuestionReport','nolimit','SessionId','rows','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','index'];(function(_0x6fbbf0,_0x32c234){var _0x12709d=function(_0x4fc877){while(--_0x4fc877){_0x6fbbf0['push'](_0x6fbbf0['shift']());}};_0x12709d(++_0x32c234);}(_0xb412,0x6e));var _0x2b41=function(_0x32faea,_0x54ce22){_0x32faea=_0x32faea-0x0;var _0x1ad3dd=_0xb412[_0x32faea];return _0x1ad3dd;};'use strict';var emlformat=require(_0x2b41('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2b41('0x1'));var rp=require(_0x2b41('0x2'));var moment=require(_0x2b41('0x3'));var BPromise=require(_0x2b41('0x4'));var Mustache=require('mustache');var util=require(_0x2b41('0x5'));var path=require(_0x2b41('0x6'));var sox=require(_0x2b41('0x7'));var csv=require(_0x2b41('0x8'));var ejs=require(_0x2b41('0x9'));var fs=require('fs');var fs_extra=require(_0x2b41('0xa'));var _=require('lodash');var squel=require(_0x2b41('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2b41('0xc'));var toCsv=require(_0x2b41('0x8'));var querystring=require(_0x2b41('0xd'));var Papa=require(_0x2b41('0xe'));var Redis=require(_0x2b41('0xf'));var authService=require(_0x2b41('0x10'));var qs=require(_0x2b41('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2b41('0x12'))('api');var utils=require(_0x2b41('0x13'));var config=require(_0x2b41('0x14'));var licenseUtil=require(_0x2b41('0x15'));var db=require(_0x2b41('0x16'))['db'];function respondWithStatusCode(_0x2037f8,_0xb0b425){_0xb0b425=_0xb0b425||0xcc;return function(_0x16d7c7){if(_0x16d7c7){return _0x2037f8[_0x2b41('0x17')](_0xb0b425);}return _0x2037f8[_0x2b41('0x18')](_0xb0b425)[_0x2b41('0x19')]();};}function respondWithResult(_0xa90826,_0x3dc8dc){_0x3dc8dc=_0x3dc8dc||0xc8;return function(_0x1a997f){if(_0x1a997f){return _0xa90826[_0x2b41('0x18')](_0x3dc8dc)[_0x2b41('0x1a')](_0x1a997f);}};}function respondWithFilteredResult(_0xe0acc3,_0x8a3ad5){return function(_0x728d25){if(_0x728d25){var _0x334437=typeof _0x8a3ad5['offset']===_0x2b41('0x1b')&&typeof _0x8a3ad5[_0x2b41('0x1c')]===_0x2b41('0x1b');var _0x441a6d=_0x728d25[_0x2b41('0x1d')];var _0x12cdc8=_0x334437?0x0:_0x8a3ad5[_0x2b41('0x1e')];var _0x40145e=_0x334437?_0x728d25['count']:_0x8a3ad5[_0x2b41('0x1e')]+_0x8a3ad5[_0x2b41('0x1c')];var _0x3b529a;if(_0x40145e>=_0x441a6d){_0x40145e=_0x441a6d;_0x3b529a=0xc8;}else{_0x3b529a=0xce;}_0xe0acc3[_0x2b41('0x18')](_0x3b529a);return _0xe0acc3[_0x2b41('0x1f')](_0x2b41('0x20'),_0x12cdc8+'-'+_0x40145e+'/'+_0x441a6d)['json'](_0x728d25);}return null;};}function patchUpdates(_0x6d6f8f){return function(_0x585968){try{jsonpatch[_0x2b41('0x21')](_0x585968,_0x6d6f8f,!![]);}catch(_0x2f1723){return BPromise[_0x2b41('0x22')](_0x2f1723);}return _0x585968['save']();};}function saveUpdates(_0x2d8301,_0x22aa25){return function(_0x59dec2){if(_0x59dec2){return _0x59dec2[_0x2b41('0x23')](_0x2d8301)[_0x2b41('0x24')](function(_0x4c8e0f){return _0x4c8e0f;});}return null;};}function removeEntity(_0x128c8d,_0x2fc80c){return function(_0x26e0b3){if(_0x26e0b3){return _0x26e0b3[_0x2b41('0x25')]()[_0x2b41('0x24')](function(){_0x128c8d[_0x2b41('0x18')](0xcc)[_0x2b41('0x19')]();});}};}function handleEntityNotFound(_0x51cfc3,_0x23d771){return function(_0x4c32f4){if(!_0x4c32f4){_0x51cfc3[_0x2b41('0x17')](0x194);}return _0x4c32f4;};}function handleError(_0x3f0309,_0x534283){_0x534283=_0x534283||0x1f4;return function(_0x541fe5){logger[_0x2b41('0x26')](_0x541fe5['stack']);if(_0x541fe5['name']){delete _0x541fe5['name'];}_0x3f0309['status'](_0x534283)['send'](_0x541fe5);};}exports[_0x2b41('0x27')]=function(_0x116501,_0x48a689){var _0x79d5aa={},_0x32c4cd={},_0x10decd={'count':0x0,'rows':[]};var _0x2daec4=_[_0x2b41('0x28')](db[_0x2b41('0x29')]['rawAttributes'],function(_0x3a80dc){return{'name':_0x3a80dc['fieldName'],'type':_0x3a80dc[_0x2b41('0x2a')]['key']};});_0x32c4cd[_0x2b41('0x2b')]=_[_0x2b41('0x28')](_0x2daec4,'name');_0x32c4cd[_0x2b41('0x2c')]=_['keys'](_0x116501[_0x2b41('0x2c')]);_0x32c4cd[_0x2b41('0x2d')]=_[_0x2b41('0x2e')](_0x32c4cd[_0x2b41('0x2b')],_0x32c4cd['query']);_0x79d5aa[_0x2b41('0x2f')]=_[_0x2b41('0x2e')](_0x32c4cd[_0x2b41('0x2b')],qs['fields'](_0x116501[_0x2b41('0x2c')]['fields']));_0x79d5aa['attributes']=_0x79d5aa[_0x2b41('0x2f')][_0x2b41('0x30')]?_0x79d5aa[_0x2b41('0x2f')]:_0x32c4cd['model'];if(!_0x116501[_0x2b41('0x2c')][_0x2b41('0x31')]('nolimit')){_0x79d5aa[_0x2b41('0x1c')]=qs[_0x2b41('0x1c')](_0x116501[_0x2b41('0x2c')][_0x2b41('0x1c')]);_0x79d5aa[_0x2b41('0x1e')]=qs[_0x2b41('0x1e')](_0x116501[_0x2b41('0x2c')][_0x2b41('0x1e')]);}_0x79d5aa['order']=qs[_0x2b41('0x32')](_0x116501[_0x2b41('0x2c')][_0x2b41('0x32')]);_0x79d5aa[_0x2b41('0x33')]=qs[_0x2b41('0x2d')](_[_0x2b41('0x34')](_0x116501[_0x2b41('0x2c')],_0x32c4cd['filters']),_0x2daec4);if(_0x116501[_0x2b41('0x2c')][_0x2b41('0x35')]){_0x79d5aa[_0x2b41('0x33')]=_[_0x2b41('0x36')](_0x79d5aa[_0x2b41('0x33')],{'$or':_['map'](_0x2daec4,function(_0x56adae){if(_0x56adae[_0x2b41('0x2a')]!==_0x2b41('0x37')){var _0x2550eb={};_0x2550eb[_0x56adae[_0x2b41('0x38')]]={'$like':'%'+_0x116501[_0x2b41('0x2c')][_0x2b41('0x35')]+'%'};return _0x2550eb;}})});}_0x79d5aa=_[_0x2b41('0x36')]({},_0x79d5aa,_0x116501[_0x2b41('0x39')]);var _0x2dcc76={'where':_0x79d5aa['where']};return db['JscriptySessionReport'][_0x2b41('0x1d')](_0x2dcc76)[_0x2b41('0x24')](function(_0x4f0ec6){_0x10decd['count']=_0x4f0ec6;if(_0x116501[_0x2b41('0x2c')][_0x2b41('0x3a')]){_0x79d5aa[_0x2b41('0x3b')]=[{'all':!![]}];}return db[_0x2b41('0x29')][_0x2b41('0x3c')](_0x79d5aa);})['then'](function(_0x555e65){_0x10decd['rows']=_0x555e65;return _0x10decd;})[_0x2b41('0x24')](respondWithFilteredResult(_0x48a689,_0x79d5aa))[_0x2b41('0x3d')](handleError(_0x48a689,null));};exports['show']=function(_0x37ba3b,_0x3a99ff){var _0x397f3c={'raw':!![],'where':{'id':_0x37ba3b[_0x2b41('0x3e')]['id']}},_0x54baf8={};_0x54baf8[_0x2b41('0x2b')]=_[_0x2b41('0x3f')](db[_0x2b41('0x29')][_0x2b41('0x40')]);_0x54baf8['query']=_[_0x2b41('0x3f')](_0x37ba3b[_0x2b41('0x2c')]);_0x54baf8[_0x2b41('0x2d')]=_[_0x2b41('0x2e')](_0x54baf8[_0x2b41('0x2b')],_0x54baf8[_0x2b41('0x2c')]);_0x397f3c[_0x2b41('0x2f')]=_[_0x2b41('0x2e')](_0x54baf8[_0x2b41('0x2b')],qs[_0x2b41('0x41')](_0x37ba3b[_0x2b41('0x2c')]['fields']));_0x397f3c[_0x2b41('0x2f')]=_0x397f3c[_0x2b41('0x2f')][_0x2b41('0x30')]?_0x397f3c['attributes']:_0x54baf8[_0x2b41('0x2b')];if(_0x37ba3b[_0x2b41('0x2c')]['includeAll']){_0x397f3c[_0x2b41('0x3b')]=[{'all':!![]}];}_0x397f3c=_[_0x2b41('0x36')]({},_0x397f3c,_0x37ba3b[_0x2b41('0x39')]);return db[_0x2b41('0x29')][_0x2b41('0x42')](_0x397f3c)[_0x2b41('0x24')](handleEntityNotFound(_0x3a99ff,null))[_0x2b41('0x24')](respondWithResult(_0x3a99ff,null))[_0x2b41('0x3d')](handleError(_0x3a99ff,null));};exports['create']=function(_0x976fc8,_0x3d4846){return db[_0x2b41('0x29')][_0x2b41('0x43')](_0x976fc8[_0x2b41('0x44')],{})[_0x2b41('0x24')](respondWithResult(_0x3d4846,0xc9))['catch'](handleError(_0x3d4846,null));};exports[_0x2b41('0x23')]=function(_0x4630aa,_0x13837d){if(_0x4630aa[_0x2b41('0x44')]['id']){delete _0x4630aa['body']['id'];}return db[_0x2b41('0x29')][_0x2b41('0x42')]({'where':{'id':_0x4630aa[_0x2b41('0x3e')]['id']}})[_0x2b41('0x24')](handleEntityNotFound(_0x13837d,null))[_0x2b41('0x24')](saveUpdates(_0x4630aa[_0x2b41('0x44')],null))['then'](respondWithResult(_0x13837d,null))['catch'](handleError(_0x13837d,null));};exports[_0x2b41('0x25')]=function(_0x168a1d,_0x374bc9){return db[_0x2b41('0x29')][_0x2b41('0x42')]({'where':{'id':_0x168a1d['params']['id']}})['then'](handleEntityNotFound(_0x374bc9,null))[_0x2b41('0x24')](removeEntity(_0x374bc9,null))[_0x2b41('0x3d')](handleError(_0x374bc9,null));};exports['describe']=function(_0x41dc83,_0x3469ea){return db[_0x2b41('0x29')][_0x2b41('0x45')]()['then'](respondWithResult(_0x3469ea,null))[_0x2b41('0x3d')](handleError(_0x3469ea,null));};exports[_0x2b41('0x46')]=function(_0x2989bb,_0x27eeba,_0x57e679){var _0x639e81={'raw':!![],'where':{}};var _0x5bbd57={};var _0x330554={'count':0x0,'rows':[]};return db[_0x2b41('0x29')]['findOne']({'where':{'id':_0x2989bb[_0x2b41('0x3e')]['id']}})[_0x2b41('0x24')](handleEntityNotFound(_0x27eeba,null))[_0x2b41('0x24')](function(_0x406d8c){if(_0x406d8c){_0x5bbd57[_0x2b41('0x2b')]=_[_0x2b41('0x3f')](db[_0x2b41('0x47')][_0x2b41('0x40')]);_0x5bbd57['query']=_[_0x2b41('0x3f')](_0x2989bb[_0x2b41('0x2c')]);_0x5bbd57['filters']=_[_0x2b41('0x2e')](_0x5bbd57[_0x2b41('0x2b')],_0x5bbd57['query']);_0x639e81[_0x2b41('0x2f')]=_[_0x2b41('0x2e')](_0x5bbd57[_0x2b41('0x2b')],qs[_0x2b41('0x41')](_0x2989bb[_0x2b41('0x2c')]['fields']));_0x639e81[_0x2b41('0x2f')]=_0x639e81[_0x2b41('0x2f')][_0x2b41('0x30')]?_0x639e81[_0x2b41('0x2f')]:_0x5bbd57['model'];if(!_0x2989bb[_0x2b41('0x2c')][_0x2b41('0x31')](_0x2b41('0x48'))){_0x639e81[_0x2b41('0x1c')]=qs['limit'](_0x2989bb['query'][_0x2b41('0x1c')]);_0x639e81[_0x2b41('0x1e')]=qs[_0x2b41('0x1e')](_0x2989bb['query']['offset']);}_0x639e81['order']=qs[_0x2b41('0x32')](_0x2989bb[_0x2b41('0x2c')]['sort']);_0x639e81[_0x2b41('0x33')]=qs[_0x2b41('0x2d')](_[_0x2b41('0x34')](_0x2989bb['query'],_0x5bbd57[_0x2b41('0x2d')]));_0x639e81[_0x2b41('0x33')][_0x2b41('0x49')]=_0x406d8c['id'];if(_0x2989bb[_0x2b41('0x2c')][_0x2b41('0x35')]){_0x639e81['where']=_[_0x2b41('0x36')](_0x639e81[_0x2b41('0x33')],{'$or':_['map'](_0x639e81[_0x2b41('0x2f')],function(_0x24c7c3){var _0x5ab5d2={};_0x5ab5d2[_0x24c7c3]={'$like':'%'+_0x2989bb[_0x2b41('0x2c')][_0x2b41('0x35')]+'%'};return _0x5ab5d2;})});}_0x639e81=_[_0x2b41('0x36')]({},_0x639e81,_0x2989bb[_0x2b41('0x39')]);return db[_0x2b41('0x47')]['count']({'where':_0x639e81[_0x2b41('0x33')]})['then'](function(_0x400604){_0x330554['count']=_0x400604;if(_0x2989bb[_0x2b41('0x2c')][_0x2b41('0x3a')]){_0x639e81[_0x2b41('0x3b')]=[{'all':!![]}];}return db[_0x2b41('0x47')][_0x2b41('0x3c')](_0x639e81);})[_0x2b41('0x24')](function(_0x1db62d){_0x330554[_0x2b41('0x4a')]=_0x1db62d;return _0x330554;});}})['then'](respondWithFilteredResult(_0x27eeba,_0x639e81))[_0x2b41('0x3d')](handleError(_0x27eeba,null));};
\ No newline at end of file
index 368168c..a9d91da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_jscripty_sessions','lodash'];(function(_0x4a5e0f,_0x24fcf6){var _0x347895=function(_0x1f5e35){while(--_0x1f5e35){_0x4a5e0f['push'](_0x4a5e0f['shift']());}};_0x347895(++_0x24fcf6);}(_0x7da7,0x10d));var _0x77da=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x7da7[_0xcfe8cc];return _0x55ac53;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc7a3=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','JscriptySessionReport','util'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x2087dc,_0x7c5cdb){_0x2087dc=_0x2087dc-0x0;var _0x43db2c=_0xc7a3[_0x2087dc];return _0x43db2c;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var logger=require(_0x3c7a('0x1'))(_0x3c7a('0x2'));var moment=require(_0x3c7a('0x3'));var BPromise=require(_0x3c7a('0x4'));var rp=require(_0x3c7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x3c7a('0x8')]=function(_0x2051ce,_0x2736c1){return _0x2051ce['define'](_0x3c7a('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c43c185..b9bbc3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x627e=['request','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x293ecd,_0x1325a0){var _0x1d03eb=function(_0x134fbf){while(--_0x134fbf){_0x293ecd['push'](_0x293ecd['shift']());}};_0x1d03eb(++_0x1325a0);}(_0x627e,0x14a));var _0xe627=function(_0x931119,_0xd716ee){_0x931119=_0x931119-0x0;var _0x2fba62=_0x627e[_0x931119];return _0x2fba62;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}
\ No newline at end of file
+var _0xdf55=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x11d95f,_0x34f442){var _0x2b1a14=function(_0x3a4fa5){while(--_0x3a4fa5){_0x11d95f['push'](_0x11d95f['shift']());}};_0x2b1a14(++_0x34f442);}(_0xdf55,0x83));var _0x5df5=function(_0x430936,_0x2a6e66){_0x430936=_0x430936-0x0;var _0x470994=_0xdf55[_0x430936];return _0x470994;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var moment=require('moment');var BPromise=require(_0x5df5('0x2'));var rs=require(_0x5df5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5df5('0x4'))['db'];var utils=require(_0x5df5('0x5'));var logger=require(_0x5df5('0x6'))('rpc');var config=require(_0x5df5('0x7'));var jayson=require(_0x5df5('0x8'));var client=jayson[_0x5df5('0x9')][_0x5df5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b8756,_0x2b7ed9,_0x4722a2){return new BPromise(function(_0x3743f3,_0x4d43a3){return client[_0x5df5('0xb')](_0x9b8756,_0x4722a2)[_0x5df5('0xc')](function(_0x41941e){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x2b7ed9,_0x5df5('0xd'));logger['debug'](_0x5df5('0xe'),_0x2b7ed9,_0x5df5('0xd'),JSON['stringify'](_0x41941e));if(_0x41941e['error']){if(_0x41941e[_0x5df5('0xf')][_0x5df5('0x10')]===0x1f4){logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);return _0x4d43a3(_0x41941e[_0x5df5('0xf')][_0x5df5('0x12')]);}logger[_0x5df5('0xf')](_0x5df5('0x11'),_0x2b7ed9,_0x41941e['error'][_0x5df5('0x12')]);return _0x3743f3(_0x41941e['error'][_0x5df5('0x12')]);}else{logger[_0x5df5('0x13')](_0x5df5('0x11'),_0x2b7ed9,_0x5df5('0xd'));_0x3743f3(_0x41941e[_0x5df5('0x14')]['message']);}})[_0x5df5('0x15')](function(_0x457205){logger['error'](_0x5df5('0x11'),_0x2b7ed9,_0x457205);_0x4d43a3(_0x457205);});});}
\ No newline at end of file
index bc46bb2..b513972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['../../config/environment','./license.controller','get','put','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2a8bbd,_0x2d998b){_0x2a8bbd=_0x2a8bbd-0x0;var _0x276e9c=_0xe5b3[_0x2a8bbd];return _0x276e9c;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',controller['index']);router[_0x3e5b('0xb')](_0x3e5b('0xc'),auth['isAuthenticated'](),controller[_0x3e5b('0xd')]);module[_0x3e5b('0xe')]=router;
\ No newline at end of file
+var _0x046b=['get','/:id','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x4fd40f,_0x3b037d){var _0x4e4901=function(_0x4b3a60){while(--_0x4b3a60){_0x4fd40f['push'](_0x4fd40f['shift']());}};_0x4e4901(++_0x3b037d);}(_0x046b,0x147));var _0xb046=function(_0x93be30,_0x1be6c3){_0x93be30=_0x93be30-0x0;var _0x4d6c2c=_0x046b[_0x93be30];return _0x4d6c2c;};'use strict';var multer=require('multer');var util=require(_0xb046('0x0'));var path=require(_0xb046('0x1'));var timeout=require(_0xb046('0x2'));var express=require(_0xb046('0x3'));var router=express[_0xb046('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb046('0x5'));var interaction=require(_0xb046('0x6'));var config=require(_0xb046('0x7'));var controller=require(_0xb046('0x8'));router[_0xb046('0x9')]('/',controller['index']);router['put'](_0xb046('0xa'),auth[_0xb046('0xb')](),controller[_0xb046('0xc')]);module[_0xb046('0xd')]=router;
\ No newline at end of file
index 10c9f72..1c72a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ee3=['STRING','INTEGER','exports','TEXT'];(function(_0x3b87ef,_0x3d0761){var _0x5d9cd9=function(_0x28c539){while(--_0x28c539){_0x3b87ef['push'](_0x3b87ef['shift']());}};_0x5d9cd9(++_0x3d0761);}(_0x2ee3,0x14a));var _0x32ee=function(_0x338581,_0x85c756){_0x338581=_0x338581-0x0;var _0x306123=_0x2ee3[_0x338581];return _0x306123;};'use strict';var Sequelize=require('sequelize');module[_0x32ee('0x0')]={'license':{'type':Sequelize[_0x32ee('0x1')]},'data1':{'type':Sequelize[_0x32ee('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x32ee('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6602=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x4cd0bb,_0x452e55){var _0x1602eb=function(_0x2f5fd8){while(--_0x2f5fd8){_0x4cd0bb['push'](_0x4cd0bb['shift']());}};_0x1602eb(++_0x452e55);}(_0x6602,0x180));var _0x2660=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x6602[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0x2660('0x0'));module[_0x2660('0x1')]={'license':{'type':Sequelize[_0x2660('0x2')]},'data1':{'type':Sequelize[_0x2660('0x3')]},'data2':{'type':Sequelize[_0x2660('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x2660('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 05dab07..9955afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','catch','body','License','find','checkLicense','key','demo','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x326f,0xd1));var _0xf326=function(_0x59f39f,_0xbc7b05){_0x59f39f=_0x59f39f-0x0;var _0x184c4a=_0x326f[_0x59f39f];return _0x184c4a;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x6a8e89,_0x1ae23a){var _0x2fa28e={'raw':!![],'where':{'id':0x1}},_0x5dbe63={};_0x5dbe63[_0xf326('0x28')]=_[_0xf326('0x29')](db['License'][_0xf326('0x2a')]);_0x5dbe63[_0xf326('0x2b')]=_[_0xf326('0x29')](_0x6a8e89[_0xf326('0x2b')]);_0x5dbe63[_0xf326('0x2c')]=_[_0xf326('0x2d')](_0x5dbe63[_0xf326('0x28')],_0x5dbe63[_0xf326('0x2b')]);_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2d')](_0x5dbe63['model'],qs[_0xf326('0x2f')](_0x6a8e89[_0xf326('0x2b')][_0xf326('0x2f')]));_0x2fa28e['attributes']=_0x2fa28e[_0xf326('0x2e')][_0xf326('0x30')]?_0x2fa28e[_0xf326('0x2e')]:_0x5dbe63['model'];_0x2fa28e=_['merge']({},_0x2fa28e,_0x6a8e89[_0xf326('0x31')]);return utilLicense[_0xf326('0x32')](_0x2fa28e)[_0xf326('0x24')](respondWithResult(_0x1ae23a,null))[_0xf326('0x33')](handleError(_0x1ae23a,null));};exports[_0xf326('0x22')]=function(_0x2e8a64,_0x62585a){if(_0x2e8a64[_0xf326('0x34')]['id']){delete _0x2e8a64['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x36')]({'where':{'id':_0x2e8a64['params']['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x62585a,null))['then'](function(_0xce1cbb){var _0x481b64=_0xce1cbb['get']({'plain':!![]});return utilLicense[_0xf326('0x37')](_0x481b64,_0x2e8a64['body'][_0xf326('0x38')]);})['then'](function(_0x310dbb){if(!_0x310dbb[_0xf326('0x39')]){return saveUpdates(_0x2e8a64[_0xf326('0x34')],null);}return _0x310dbb;})['then'](respondWithResult(_0x62585a,null))[_0xf326('0x33')](handleError(_0x62585a,null));};
\ No newline at end of file
+var _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x4e6e56,_0x57f1a1){var _0x266107=function(_0x2e614b){while(--_0x2e614b){_0x4e6e56['push'](_0x4e6e56['shift']());}};_0x266107(++_0x57f1a1);}(_0xabce,0x103));var _0xeabc=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xabce[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));};
\ No newline at end of file
index 403e212..259674a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f92=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','license','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3f92,0x173));var _0x23f9=function(_0x47a63a,_0x52275a){_0x47a63a=_0x47a63a-0x0;var _0x98d27d=_0x3f92[_0x47a63a];return _0x98d27d;};'use strict';var _=require(_0x23f9('0x0'));var util=require(_0x23f9('0x1'));var logger=require(_0x23f9('0x2'))(_0x23f9('0x3'));var moment=require(_0x23f9('0x4'));var BPromise=require(_0x23f9('0x5'));var rp=require(_0x23f9('0x6'));var fs=require('fs');var path=require(_0x23f9('0x7'));var rimraf=require(_0x23f9('0x8'));var config=require(_0x23f9('0x9'));var attributes=require(_0x23f9('0xa'));module['exports']=function(_0x3b808a,_0xf7e69){return _0x3b808a['define']('License',attributes,{'tableName':_0x23f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x293d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','License','license'];(function(_0x36c124,_0x2910f8){var _0x595bb5=function(_0x44f715){while(--_0x44f715){_0x36c124['push'](_0x36c124['shift']());}};_0x595bb5(++_0x2910f8);}(_0x293d,0x179));var _0xd293=function(_0x56f28e,_0x5198fd){_0x56f28e=_0x56f28e-0x0;var _0x3d2305=_0x293d[_0x56f28e];return _0x3d2305;};'use strict';var _=require(_0xd293('0x0'));var util=require(_0xd293('0x1'));var logger=require(_0xd293('0x2'))('api');var moment=require(_0xd293('0x3'));var BPromise=require(_0xd293('0x4'));var rp=require(_0xd293('0x5'));var fs=require('fs');var path=require(_0xd293('0x6'));var rimraf=require(_0xd293('0x7'));var config=require(_0xd293('0x8'));var attributes=require(_0xd293('0x9'));module[_0xd293('0xa')]=function(_0x14e28f,_0x6a9bc3){return _0x14e28f['define'](_0xd293('0xb'),attributes,{'tableName':_0xd293('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b0d4f5b..25d4afb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2193=['stringify','error','code','message','result','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','License,\x20%s,\x20%s','License,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1d7163,_0x53556e){var _0x4eb40a=function(_0x184081){while(--_0x184081){_0x1d7163['push'](_0x1d7163['shift']());}};_0x4eb40a(++_0x53556e);}(_0x2193,0x77));var _0x3219=function(_0x1d0076,_0x3048a4){_0x1d0076=_0x1d0076-0x0;var _0x2fd766=_0x2193[_0x1d0076];return _0x2fd766;};'use strict';var _=require('lodash');var util=require(_0x3219('0x0'));var moment=require(_0x3219('0x1'));var BPromise=require(_0x3219('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3219('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3219('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3219('0x5'));var jayson=require(_0x3219('0x6'));var client=jayson[_0x3219('0x7')][_0x3219('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f6c3a,_0x350a51,_0x5d0874){return new BPromise(function(_0x5a3115,_0x167d94){return client[_0x3219('0x9')](_0x1f6c3a,_0x5d0874)['then'](function(_0x59ac5b){logger[_0x3219('0xa')](_0x3219('0xb'),_0x350a51,'request\x20sent');logger['debug'](_0x3219('0xc'),_0x350a51,_0x3219('0xd'),JSON[_0x3219('0xe')](_0x59ac5b));if(_0x59ac5b[_0x3219('0xf')]){if(_0x59ac5b[_0x3219('0xf')][_0x3219('0x10')]===0x1f4){logger[_0x3219('0xf')](_0x3219('0xb'),_0x350a51,_0x59ac5b['error'][_0x3219('0x11')]);return _0x167d94(_0x59ac5b[_0x3219('0xf')]['message']);}logger[_0x3219('0xf')](_0x3219('0xb'),_0x350a51,_0x59ac5b[_0x3219('0xf')][_0x3219('0x11')]);return _0x5a3115(_0x59ac5b[_0x3219('0xf')][_0x3219('0x11')]);}else{logger[_0x3219('0xa')](_0x3219('0xb'),_0x350a51,'request\x20sent');_0x5a3115(_0x59ac5b[_0x3219('0x12')][_0x3219('0x11')]);}})['catch'](function(_0x5e340f){logger[_0x3219('0xf')](_0x3219('0xb'),_0x350a51,_0x5e340f);_0x167d94(_0x5e340f);});});}
\ No newline at end of file
+var _0x811e=['License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50d915,_0x4ae3b0){var _0x2d005a=function(_0x49f9fc){while(--_0x49f9fc){_0x50d915['push'](_0x50d915['shift']());}};_0x2d005a(++_0x4ae3b0);}(_0x811e,0x1a5));var _0xe811=function(_0x314c95,_0x1c544e){_0x314c95=_0x314c95-0x0;var _0x36ce33=_0x811e[_0x314c95];return _0x36ce33;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe811('0x0'));var BPromise=require(_0xe811('0x1'));var rs=require(_0xe811('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe811('0x3'))['db'];var utils=require(_0xe811('0x4'));var logger=require(_0xe811('0x5'))(_0xe811('0x6'));var config=require('../../config/environment');var jayson=require(_0xe811('0x7'));var client=jayson[_0xe811('0x8')][_0xe811('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x362003,_0x33e601,_0x1f159c){return new BPromise(function(_0x258761,_0x508c82){return client[_0xe811('0xa')](_0x362003,_0x1f159c)[_0xe811('0xb')](function(_0x4c560e){logger[_0xe811('0xc')](_0xe811('0xd'),_0x33e601,_0xe811('0xe'));logger[_0xe811('0xf')](_0xe811('0x10'),_0x33e601,_0xe811('0xe'),JSON[_0xe811('0x11')](_0x4c560e));if(_0x4c560e[_0xe811('0x12')]){if(_0x4c560e[_0xe811('0x12')][_0xe811('0x13')]===0x1f4){logger[_0xe811('0x12')](_0xe811('0xd'),_0x33e601,_0x4c560e['error']['message']);return _0x508c82(_0x4c560e[_0xe811('0x12')][_0xe811('0x14')]);}logger[_0xe811('0x12')](_0xe811('0xd'),_0x33e601,_0x4c560e[_0xe811('0x12')][_0xe811('0x14')]);return _0x258761(_0x4c560e[_0xe811('0x12')][_0xe811('0x14')]);}else{logger[_0xe811('0xc')](_0xe811('0xd'),_0x33e601,'request\x20sent');_0x258761(_0x4c560e[_0xe811('0x15')]['message']);}})[_0xe811('0x16')](function(_0x41f63d){logger['error'](_0xe811('0xd'),_0x33e601,_0x41f63d);_0x508c82(_0x41f63d);});});}
\ No newline at end of file
index 508e8c8..2307949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd902=['get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/verify','verifySmtp','post','addAnswer','create','addImap','addSmtp','addApplications','/:id/send','send','/:id/users','addAgents','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x293a10,_0x3e8970){var _0x4cda0f=function(_0x1cfbba){while(--_0x1cfbba){_0x293a10['push'](_0x293a10['shift']());}};_0x4cda0f(++_0x3e8970);}(_0xd902,0xe6));var _0x2d90=function(_0x4c9393,_0x20e6de){_0x4c9393=_0x4c9393-0x0;var _0x580eda=_0xd902[_0x4c9393];return _0x580eda;};'use strict';var multer=require(_0x2d90('0x0'));var util=require(_0x2d90('0x1'));var path=require(_0x2d90('0x2'));var timeout=require(_0x2d90('0x3'));var express=require(_0x2d90('0x4'));var router=express[_0x2d90('0x5')]();var fs_extra=require(_0x2d90('0x6'));var auth=require(_0x2d90('0x7'));var interaction=require(_0x2d90('0x8'));var config=require(_0x2d90('0x9'));var controller=require('./mailAccount.controller');router[_0x2d90('0xa')]('/',auth[_0x2d90('0xb')](),controller['index']);router[_0x2d90('0xa')](_0x2d90('0xc'),auth[_0x2d90('0xb')](),controller[_0x2d90('0xd')]);router[_0x2d90('0xa')](_0x2d90('0xe'),auth[_0x2d90('0xb')](),controller[_0x2d90('0xf')]);router[_0x2d90('0xa')](_0x2d90('0x10'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0x2d90('0x11'),auth['isAuthenticated'](),controller[_0x2d90('0x12')]);router[_0x2d90('0xa')](_0x2d90('0x13'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x14')]);router[_0x2d90('0xa')](_0x2d90('0x15'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x16')]);router[_0x2d90('0xa')](_0x2d90('0x17'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x18')]);router['get'](_0x2d90('0x19'),auth[_0x2d90('0xb')](),controller['getApplications']);router[_0x2d90('0xa')](_0x2d90('0x1a'),auth['isAuthenticated'](),controller['getMessages']);router[_0x2d90('0xa')](_0x2d90('0x1b'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x1c')]);router[_0x2d90('0xa')]('/:id/users',auth[_0x2d90('0xb')](),controller['getAgents']);router['post'](_0x2d90('0x10'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x2d90('0x1d')](_0x2d90('0x11'),auth['isAuthenticated'](),controller[_0x2d90('0x1e')]);router['post']('/',auth[_0x2d90('0xb')](),controller[_0x2d90('0x1f')]);router[_0x2d90('0x1d')](_0x2d90('0x13'),auth['isAuthenticated'](),controller[_0x2d90('0x20')]);router[_0x2d90('0x1d')]('/:id/out_servers',auth[_0x2d90('0xb')](),controller[_0x2d90('0x21')]);router['post'](_0x2d90('0x17'),auth[_0x2d90('0xb')](),controller['addInteraction']);router[_0x2d90('0x1d')](_0x2d90('0x19'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x22')]);router[_0x2d90('0x1d')](_0x2d90('0x23'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x24')]);router['post'](_0x2d90('0x25'),auth['isAuthenticated'](),controller[_0x2d90('0x26')]);router['put']('/:id',auth[_0x2d90('0xb')](),controller[_0x2d90('0x27')]);router['delete'](_0x2d90('0x10'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x28')]);router[_0x2d90('0x29')](_0x2d90('0x11'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x2a')]);router['delete'](_0x2d90('0x13'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x2b')]);router['delete'](_0x2d90('0x15'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x2c')]);router[_0x2d90('0x29')](_0x2d90('0xe'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x2d')]);router[_0x2d90('0x29')](_0x2d90('0x25'),auth[_0x2d90('0xb')](),controller[_0x2d90('0x2e')]);module[_0x2d90('0x2f')]=router;
\ No newline at end of file
+var _0xb179=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeImap','removeSmtp','destroy','removeAgents','exports'];(function(_0x35000d,_0xc8945c){var _0x2b856f=function(_0x3d8eb2){while(--_0x3d8eb2){_0x35000d['push'](_0x35000d['shift']());}};_0x2b856f(++_0xc8945c);}(_0xb179,0xc4));var _0x9b17=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xb179[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x9b17('0x0'));var path=require(_0x9b17('0x1'));var timeout=require(_0x9b17('0x2'));var express=require(_0x9b17('0x3'));var router=express[_0x9b17('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9b17('0x5'));var interaction=require(_0x9b17('0x6'));var config=require(_0x9b17('0x7'));var controller=require(_0x9b17('0x8'));router[_0x9b17('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b17('0xa')]);router[_0x9b17('0x9')]('/describe',auth[_0x9b17('0xb')](),controller[_0x9b17('0xc')]);router[_0x9b17('0x9')]('/:id',auth[_0x9b17('0xb')](),controller['show']);router['get'](_0x9b17('0xd'),auth[_0x9b17('0xb')](),controller[_0x9b17('0xe')]);router[_0x9b17('0x9')](_0x9b17('0xf'),auth[_0x9b17('0xb')](),controller['getAnswers']);router['get'](_0x9b17('0x10'),auth[_0x9b17('0xb')](),controller['getImap']);router[_0x9b17('0x9')](_0x9b17('0x11'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x12')]);router['get'](_0x9b17('0x13'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x14')]);router['get'](_0x9b17('0x15'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x16')]);router['get'](_0x9b17('0x17'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x18')]);router[_0x9b17('0x9')](_0x9b17('0x19'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x1a')]);router[_0x9b17('0x9')](_0x9b17('0x1b'),auth['isAuthenticated'](),controller[_0x9b17('0x1c')]);router[_0x9b17('0x1d')](_0x9b17('0xd'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x1e')]);router[_0x9b17('0x1d')](_0x9b17('0xf'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x1f')]);router['post']('/',auth[_0x9b17('0xb')](),controller[_0x9b17('0x20')]);router['post'](_0x9b17('0x10'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x21')]);router[_0x9b17('0x1d')](_0x9b17('0x11'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x22')]);router['post'](_0x9b17('0x13'),auth['isAuthenticated'](),controller[_0x9b17('0x23')]);router['post'](_0x9b17('0x15'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x24')]);router[_0x9b17('0x1d')](_0x9b17('0x25'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x26')]);router[_0x9b17('0x1d')](_0x9b17('0x1b'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x27')]);router[_0x9b17('0x28')](_0x9b17('0x29'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x2a')]);router[_0x9b17('0x2b')](_0x9b17('0xd'),auth[_0x9b17('0xb')](),controller['removeDispositions']);router[_0x9b17('0x2b')](_0x9b17('0xf'),auth[_0x9b17('0xb')](),controller['removeAnswers']);router[_0x9b17('0x2b')](_0x9b17('0x10'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x2c')]);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x9b17('0x2d')]);router['delete'](_0x9b17('0x29'),auth[_0x9b17('0xb')](),controller[_0x9b17('0x2e')]);router[_0x9b17('0x2b')]('/:id/users',auth[_0x9b17('0xb')](),controller[_0x9b17('0x2f')]);module[_0x9b17('0x30')]=router;
\ No newline at end of file
index 934bc98..91d04ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee14=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','STRING','BOOLEAN','TEXT','INTEGER','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'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee14,0x13a));var _0x4ee1=function(_0x44ccfc,_0xbee275){_0x44ccfc=_0x44ccfc-0x0;var _0x47ff21=_0xee14[_0x44ccfc];return _0x47ff21;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x4ee1('0x0')]},'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x4ee1('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x4ee1('0x2')]},'markAsUnread':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x4ee1('0x3')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4ee1('0x2')],'defaultValue':function(){return _0x4ee1('0x4');}},'notificationSound':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ee1('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ee1('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x4ee1('0x5')},'mandatoryDisposition':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':![],'comment':_0x4ee1('0x6'),'set':function(_0x191da7){if(!_0x191da7)this['setDataValue'](_0x4ee1('0x7'),null);this[_0x4ee1('0x8')](_0x4ee1('0x9'),_0x191da7);}}};
\ No newline at end of file
+var _0xaa7c=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x42e91c,_0x539c58){var _0x4861ca=function(_0x23c439){while(--_0x23c439){_0x42e91c['push'](_0x42e91c['shift']());}};_0x4861ca(++_0x539c58);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x8c721d,_0x2598f6){_0x8c721d=_0x8c721d-0x0;var _0x20c15a=_0xaa7c[_0x8c721d];return _0x20c15a;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xcaa7('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xcaa7('0x3')]},'markAsUnread':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcaa7('0x1')],'allowNull':![],'defaultValue':_0xcaa7('0x4')},'fontSize':{'type':Sequelize[_0xcaa7('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xcaa7('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcaa7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcaa7('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcaa7('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xcaa7('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xcaa7('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2e037c){if(!_0x2e037c)this[_0xcaa7('0x7')](_0xcaa7('0x8'),null);this[_0xcaa7('0x7')](_0xcaa7('0x9'),_0x2e037c);}}};
\ No newline at end of file
index 941f444..5ad8e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33ab=['getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./mailAccount.socket','register','jayson/promise','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','end','status','offset','undefined','limit','count','Content-Range','json','save','update','then','destroy','get','MailAccounts','UserProfileResource','sendStatus','send','index','MailServerIn','Imap','MailServerOut','Pause','MailAccount','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','Smtp','rawAttributes','find','body','mandatoryDispositionPause','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','CannedAnswer','create','ListId','isNil','active','description','cservice','cauthentication','user','cuser','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','pick','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','CmList','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','auth','pass','secure','sendMail','List\x20not\x20found','messageId','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0x33ab,0x18b));var _0xb33a=function(_0x489df9,_0x5d63b8){_0x489df9=_0x489df9-0x0;var _0x1f2679=_0x33ab[_0x489df9];return _0x1f2679;};'use strict';var emlformat=require(_0xb33a('0x0'));var rimraf=require(_0xb33a('0x1'));var zipdir=require(_0xb33a('0x2'));var jsonpatch=require(_0xb33a('0x3'));var rp=require(_0xb33a('0x4'));var moment=require(_0xb33a('0x5'));var BPromise=require(_0xb33a('0x6'));var Mustache=require('mustache');var util=require(_0xb33a('0x7'));var path=require('path');var sox=require(_0xb33a('0x8'));var csv=require(_0xb33a('0x9'));var ejs=require(_0xb33a('0xa'));var fs=require('fs');var fs_extra=require(_0xb33a('0xb'));var _=require(_0xb33a('0xc'));var squel=require(_0xb33a('0xd'));var crypto=require(_0xb33a('0xe'));var jsforce=require(_0xb33a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb33a('0x10'));var Papa=require(_0xb33a('0x11'));var htmlToText=require('html-to-text');var juice=require(_0xb33a('0x12'));var Redis=require(_0xb33a('0x13'));var authService=require(_0xb33a('0x14'));var qs=require(_0xb33a('0x15'));var as=require(_0xb33a('0x16'));var hardwareService=require(_0xb33a('0x17'));var logger=require(_0xb33a('0x18'))(_0xb33a('0x19'));var utils=require(_0xb33a('0x1a'));var config=require(_0xb33a('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xb33a('0x1c'))['db'];config[_0xb33a('0x1d')]=_[_0xb33a('0x1e')](config[_0xb33a('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb33a('0x1f'))[_0xb33a('0x20')](socket);var jayson=require(_0xb33a('0x21'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x294739,_0x12bfa0,_0x45559e,_0x4ab70d){return new BPromise(function(_0x5cadcf,_0x378f8f){var _0x142742=_0x4ab70d||client;return _0x142742[_0xb33a('0x22')](_0x294739,_0x45559e)['then'](function(_0x26e265){logger[_0xb33a('0x23')](_0xb33a('0x24'),_0x12bfa0,'request\x20sent');logger[_0xb33a('0x25')](_0xb33a('0x26'),_0x12bfa0,_0xb33a('0x27'),JSON[_0xb33a('0x28')](_0x26e265));if(_0x26e265[_0xb33a('0x29')]){if(_0x26e265[_0xb33a('0x29')]['code']===0x1f4){logger['error'](_0xb33a('0x24'),_0x12bfa0,_0x26e265[_0xb33a('0x29')]['message']);return _0x378f8f(_0x26e265[_0xb33a('0x29')][_0xb33a('0x2a')]);}logger[_0xb33a('0x29')](_0xb33a('0x24'),_0x12bfa0,_0x26e265[_0xb33a('0x29')][_0xb33a('0x2a')]);return _0x5cadcf(_0x26e265[_0xb33a('0x29')][_0xb33a('0x2a')]);}else{logger['info'](_0xb33a('0x24'),_0x12bfa0,_0xb33a('0x27'));_0x5cadcf(_0x26e265[_0xb33a('0x2b')][_0xb33a('0x2a')]);}})[_0xb33a('0x2c')](function(_0x251e1d){logger['error'](_0xb33a('0x24'),_0x12bfa0,_0x251e1d);_0x378f8f(_0x251e1d);});});}function respondWithStatusCode(_0x1f4c79,_0x54b6af){_0x54b6af=_0x54b6af||0xcc;return function(_0x446199){if(_0x446199){return _0x1f4c79['sendStatus'](_0x54b6af);}return _0x1f4c79['status'](_0x54b6af)[_0xb33a('0x2d')]();};}function respondWithResult(_0x227a44,_0x446b12){_0x446b12=_0x446b12||0xc8;return function(_0x1c1417){if(_0x1c1417){return _0x227a44[_0xb33a('0x2e')](_0x446b12)['json'](_0x1c1417);}};}function respondWithFilteredResult(_0x183741,_0x18bdd8){return function(_0x494d53){if(_0x494d53){var _0x3913ca=typeof _0x18bdd8[_0xb33a('0x2f')]===_0xb33a('0x30')&&typeof _0x18bdd8[_0xb33a('0x31')]==='undefined';var _0x45c5c5=_0x494d53[_0xb33a('0x32')];var _0x43d122=_0x3913ca?0x0:_0x18bdd8[_0xb33a('0x2f')];var _0x5e3b6d=_0x3913ca?_0x494d53[_0xb33a('0x32')]:_0x18bdd8[_0xb33a('0x2f')]+_0x18bdd8[_0xb33a('0x31')];var _0x50e7a5;if(_0x5e3b6d>=_0x45c5c5){_0x5e3b6d=_0x45c5c5;_0x50e7a5=0xc8;}else{_0x50e7a5=0xce;}_0x183741['status'](_0x50e7a5);return _0x183741['set'](_0xb33a('0x33'),_0x43d122+'-'+_0x5e3b6d+'/'+_0x45c5c5)[_0xb33a('0x34')](_0x494d53);}return null;};}function patchUpdates(_0x4b0116){return function(_0x590cf5){try{jsonpatch['apply'](_0x590cf5,_0x4b0116,!![]);}catch(_0x4a6de2){return BPromise['reject'](_0x4a6de2);}return _0x590cf5[_0xb33a('0x35')]();};}function saveUpdates(_0x1f3fe7,_0x4767a6){return function(_0x5d86b4){if(_0x5d86b4){return _0x5d86b4[_0xb33a('0x36')](_0x1f3fe7)[_0xb33a('0x37')](function(_0x22871d){return _0x22871d;});}return null;};}function removeEntity(_0x281468,_0x95fb46){return function(_0x3c4570){if(_0x3c4570){return _0x3c4570[_0xb33a('0x38')]()[_0xb33a('0x37')](function(){var _0x21ee02=_0x3c4570[_0xb33a('0x39')]({'plain':!![]});var _0x2d7ae3=_0xb33a('0x3a');return db[_0xb33a('0x3b')]['destroy']({'where':{'type':_0x2d7ae3,'resourceId':_0x21ee02['id']}})[_0xb33a('0x37')](function(){return _0x3c4570;});})[_0xb33a('0x37')](function(){_0x281468[_0xb33a('0x2e')](0xcc)[_0xb33a('0x2d')]();});}};}function handleEntityNotFound(_0x23cfa5,_0x448f1a){return function(_0x25b627){if(!_0x25b627){_0x23cfa5[_0xb33a('0x3c')](0x194);}return _0x25b627;};}function handleError(_0x3d17fb,_0x570bb1){_0x570bb1=_0x570bb1||0x1f4;return function(_0x4ad2d1){logger[_0xb33a('0x29')](_0x4ad2d1['stack']);if(_0x4ad2d1['name']){delete _0x4ad2d1['name'];}_0x3d17fb['status'](_0x570bb1)[_0xb33a('0x3d')](_0x4ad2d1);};}exports[_0xb33a('0x3e')]=function(_0x2193ed,_0x55ceb1){var _0x21190d={'include':[{'model':db[_0xb33a('0x3f')],'as':_0xb33a('0x40')},{'model':db[_0xb33a('0x41')],'as':'Smtp'},{'model':db[_0xb33a('0x42')],'as':'mandatoryDispositionPause'}]},_0x53a6d0={},_0x3b7836={'count':0x0,'rows':[]};var _0x54f1b7=_['map'](db[_0xb33a('0x43')]['rawAttributes'],function(_0x1a281b){return{'name':_0x1a281b['fieldName'],'type':_0x1a281b[_0xb33a('0x44')][_0xb33a('0x45')]};});_0x53a6d0[_0xb33a('0x46')]=_[_0xb33a('0x47')](_0x54f1b7,_0xb33a('0x48'));_0x53a6d0[_0xb33a('0x49')]=_[_0xb33a('0x4a')](_0x2193ed[_0xb33a('0x49')]);_0x53a6d0[_0xb33a('0x4b')]=_[_0xb33a('0x4c')](_0x53a6d0['model'],_0x53a6d0[_0xb33a('0x49')]);_0x21190d[_0xb33a('0x4d')]=_[_0xb33a('0x4c')](_0x53a6d0[_0xb33a('0x46')],qs[_0xb33a('0x4e')](_0x2193ed['query'][_0xb33a('0x4e')]));_0x21190d['attributes']=_0x21190d[_0xb33a('0x4d')][_0xb33a('0x4f')]?_0x21190d[_0xb33a('0x4d')]:_0x53a6d0[_0xb33a('0x46')];if(!_0x2193ed['query'][_0xb33a('0x50')](_0xb33a('0x51'))){_0x21190d['limit']=qs[_0xb33a('0x31')](_0x2193ed[_0xb33a('0x49')]['limit']);_0x21190d[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0x2193ed[_0xb33a('0x49')][_0xb33a('0x2f')]);}_0x21190d[_0xb33a('0x52')]=qs[_0xb33a('0x53')](_0x2193ed[_0xb33a('0x49')][_0xb33a('0x53')]);_0x21190d[_0xb33a('0x54')]=qs[_0xb33a('0x4b')](_['pick'](_0x2193ed['query'],_0x53a6d0['filters']),_0x54f1b7);if(_0x2193ed['query'][_0xb33a('0x55')]){_0x21190d['where']=_[_0xb33a('0x56')](_0x21190d[_0xb33a('0x54')],{'$or':_[_0xb33a('0x47')](_0x54f1b7,function(_0x5ae75a){if(_0x5ae75a[_0xb33a('0x44')]!=='VIRTUAL'){var _0x3f69df={};_0x3f69df[_0x5ae75a['name']]={'$like':'%'+_0x2193ed[_0xb33a('0x49')][_0xb33a('0x55')]+'%'};return _0x3f69df;}})});}_0x21190d=_[_0xb33a('0x56')]({},_0x21190d,_0x2193ed[_0xb33a('0x57')]);var _0x1f81e7={'where':_0x21190d['where']};return db[_0xb33a('0x43')][_0xb33a('0x32')](_0x1f81e7)[_0xb33a('0x37')](function(_0x88fc6a){_0x3b7836[_0xb33a('0x32')]=_0x88fc6a;if(_0x2193ed['query'][_0xb33a('0x58')]){_0x21190d[_0xb33a('0x59')]=[{'all':!![]}];}return db[_0xb33a('0x43')][_0xb33a('0x5a')](_0x21190d);})[_0xb33a('0x37')](function(_0x27bb97){_0x3b7836[_0xb33a('0x5b')]=_0x27bb97;return _0x3b7836;})[_0xb33a('0x37')](respondWithFilteredResult(_0x55ceb1,_0x21190d))['catch'](handleError(_0x55ceb1,null));};exports[_0xb33a('0x5c')]=function(_0x2d551d,_0x937a85){var _0x156e75={'raw':![],'where':{'id':_0x2d551d[_0xb33a('0x5d')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xb33a('0x40')},{'model':db[_0xb33a('0x41')],'as':_0xb33a('0x5e')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4ba989={};_0x4ba989['model']=_[_0xb33a('0x4a')](db[_0xb33a('0x43')][_0xb33a('0x5f')]);_0x4ba989[_0xb33a('0x49')]=_[_0xb33a('0x4a')](_0x2d551d[_0xb33a('0x49')]);_0x4ba989[_0xb33a('0x4b')]=_[_0xb33a('0x4c')](_0x4ba989[_0xb33a('0x46')],_0x4ba989[_0xb33a('0x49')]);_0x156e75[_0xb33a('0x4d')]=_[_0xb33a('0x4c')](_0x4ba989['model'],qs[_0xb33a('0x4e')](_0x2d551d[_0xb33a('0x49')]['fields']));_0x156e75[_0xb33a('0x4d')]=_0x156e75[_0xb33a('0x4d')][_0xb33a('0x4f')]?_0x156e75['attributes']:_0x4ba989[_0xb33a('0x46')];if(_0x2d551d[_0xb33a('0x49')][_0xb33a('0x58')]){_0x156e75[_0xb33a('0x59')]=[{'all':!![]}];}_0x156e75=_[_0xb33a('0x56')]({},_0x156e75,_0x2d551d[_0xb33a('0x57')]);return db[_0xb33a('0x43')][_0xb33a('0x60')](_0x156e75)['then'](handleEntityNotFound(_0x937a85,null))['then'](respondWithResult(_0x937a85,null))[_0xb33a('0x2c')](handleError(_0x937a85,null));};exports[_0xb33a('0x36')]=function(_0x5caa9f,_0x1e3f06){if(_0x5caa9f[_0xb33a('0x61')]['id']){delete _0x5caa9f[_0xb33a('0x61')]['id'];}return db[_0xb33a('0x43')]['find']({'where':{'id':_0x5caa9f[_0xb33a('0x5d')]['id']},'include':[{'model':db[_0xb33a('0x3f')],'as':_0xb33a('0x40')},{'model':db[_0xb33a('0x41')],'as':'Smtp'},{'model':db['Pause'],'as':_0xb33a('0x62')}]})[_0xb33a('0x37')](handleEntityNotFound(_0x1e3f06,null))[_0xb33a('0x37')](saveUpdates(_0x5caa9f['body'],null))[_0xb33a('0x37')](function(_0x577090){if(_0x577090&&_0x5caa9f['body'][_0xb33a('0x40')]){return db[_0xb33a('0x3f')][_0xb33a('0x36')](_0x5caa9f[_0xb33a('0x61')][_0xb33a('0x40')],{'where':{'MailAccountId':_0x577090['id']}})[_0xb33a('0x37')](function(){return _0x577090;});}return _0x577090;})[_0xb33a('0x37')](function(_0xfd6e11){if(_0xfd6e11&&_0x5caa9f[_0xb33a('0x61')][_0xb33a('0x5e')]){return db[_0xb33a('0x41')][_0xb33a('0x36')](_0x5caa9f[_0xb33a('0x61')]['Smtp'],{'where':{'MailAccountId':_0xfd6e11['id']}})['then'](function(){return _0xfd6e11;});}return _0xfd6e11;})[_0xb33a('0x37')](respondWithResult(_0x1e3f06,null))['catch'](handleError(_0x1e3f06,null));};exports[_0xb33a('0x63')]=function(_0x232e57,_0x24b062){return db[_0xb33a('0x43')][_0xb33a('0x63')]()[_0xb33a('0x37')](respondWithResult(_0x24b062,null))['catch'](handleError(_0x24b062,null));};exports[_0xb33a('0x64')]=function(_0x3e2316,_0x57e8ae,_0x245cd4){if(_0x3e2316[_0xb33a('0x61')]['id']){delete _0x3e2316[_0xb33a('0x61')]['id'];}return db['MailAccount'][_0xb33a('0x60')]({'where':{'id':_0x3e2316[_0xb33a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x57e8ae,null))[_0xb33a('0x37')](function(_0x14dd62){if(_0x14dd62){_0x3e2316[_0xb33a('0x61')][_0xb33a('0x65')]=_0x14dd62['id'];return db[_0xb33a('0x66')]['create'](_0x3e2316['body']);}})[_0xb33a('0x37')](respondWithResult(_0x57e8ae,null))[_0xb33a('0x2c')](handleError(_0x57e8ae,null));};exports[_0xb33a('0x67')]=function(_0x4c1c2d,_0x4a480c,_0x519ed7){var _0x5a4b67={'raw':![],'where':{}};var _0x9903a1={};var _0x5e5f6f={'count':0x0,'rows':[]};return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x4c1c2d[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x4a480c,null))[_0xb33a('0x37')](function(_0x5b020d){if(_0x5b020d){_0x9903a1[_0xb33a('0x46')]=_[_0xb33a('0x4a')](db[_0xb33a('0x66')][_0xb33a('0x5f')]);_0x9903a1[_0xb33a('0x49')]=_['keys'](_0x4c1c2d[_0xb33a('0x49')]);_0x9903a1[_0xb33a('0x4b')]=_['intersection'](_0x9903a1[_0xb33a('0x46')],_0x9903a1[_0xb33a('0x49')]);_0x5a4b67['attributes']=_[_0xb33a('0x4c')](_0x9903a1[_0xb33a('0x46')],qs[_0xb33a('0x4e')](_0x4c1c2d[_0xb33a('0x49')][_0xb33a('0x4e')]));_0x5a4b67[_0xb33a('0x4d')]=_0x5a4b67[_0xb33a('0x4d')][_0xb33a('0x4f')]?_0x5a4b67[_0xb33a('0x4d')]:_0x9903a1[_0xb33a('0x46')];if(!_0x4c1c2d[_0xb33a('0x49')][_0xb33a('0x50')]('nolimit')){_0x5a4b67[_0xb33a('0x31')]=qs['limit'](_0x4c1c2d[_0xb33a('0x49')][_0xb33a('0x31')]);_0x5a4b67[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0x4c1c2d['query']['offset']);}_0x5a4b67[_0xb33a('0x52')]=qs[_0xb33a('0x53')](_0x4c1c2d[_0xb33a('0x49')]['sort']);_0x5a4b67[_0xb33a('0x54')]=qs['filters'](_['pick'](_0x4c1c2d['query'],_0x9903a1[_0xb33a('0x4b')]));_0x5a4b67['where'][_0xb33a('0x65')]=_0x5b020d['id'];if(_0x4c1c2d[_0xb33a('0x49')][_0xb33a('0x55')]){_0x5a4b67['where']=_[_0xb33a('0x56')](_0x5a4b67['where'],{'$or':_[_0xb33a('0x47')](_0x5a4b67[_0xb33a('0x4d')],function(_0x3afbdd){var _0x1f8170={};_0x1f8170[_0x3afbdd]={'$like':'%'+_0x4c1c2d[_0xb33a('0x49')][_0xb33a('0x55')]+'%'};return _0x1f8170;})});}_0x5a4b67=_['merge']({},_0x5a4b67,_0x4c1c2d[_0xb33a('0x57')]);return db[_0xb33a('0x66')]['count']({'where':_0x5a4b67[_0xb33a('0x54')]})[_0xb33a('0x37')](function(_0xace269){_0x5e5f6f[_0xb33a('0x32')]=_0xace269;if(_0x4c1c2d['query']['includeAll']){_0x5a4b67[_0xb33a('0x59')]=[{'all':!![]}];}return db[_0xb33a('0x66')][_0xb33a('0x5a')](_0x5a4b67);})[_0xb33a('0x37')](function(_0x98b99c){_0x5e5f6f['rows']=_0x98b99c;return _0x5e5f6f;});}})[_0xb33a('0x37')](respondWithFilteredResult(_0x4a480c,_0x5a4b67))[_0xb33a('0x2c')](handleError(_0x4a480c,null));};exports['removeDispositions']=function(_0x3aa19c,_0x1820e5,_0x2e3aa4){return db['MailAccount'][_0xb33a('0x60')]({'where':{'id':_0x3aa19c[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x1820e5,null))[_0xb33a('0x37')](function(_0x53332c){if(_0x53332c){return _0x53332c[_0xb33a('0x69')](_0x3aa19c['query'][_0xb33a('0x6a')]);}})[_0xb33a('0x37')](respondWithStatusCode(_0x1820e5,null))[_0xb33a('0x2c')](handleError(_0x1820e5,null));};exports['addAnswer']=function(_0x1b328d,_0x3f1128,_0x94f44d){if(_0x1b328d['body']['id']){delete _0x1b328d[_0xb33a('0x61')]['id'];}return db[_0xb33a('0x43')][_0xb33a('0x60')]({'where':{'id':_0x1b328d[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x3f1128,null))[_0xb33a('0x37')](function(_0x1cf82a){if(_0x1cf82a){_0x1b328d[_0xb33a('0x61')]['MailAccountId']=_0x1cf82a['id'];return db[_0xb33a('0x6b')]['create'](_0x1b328d[_0xb33a('0x61')]);}})['then'](respondWithResult(_0x3f1128,null))[_0xb33a('0x2c')](handleError(_0x3f1128,null));};exports['getAnswers']=function(_0x51c2c6,_0x39ea52,_0x1201c9){var _0x38f380={'raw':![],'where':{}};var _0x2457c8={};var _0x34217d={'count':0x0,'rows':[]};return db[_0xb33a('0x43')]['findOne']({'where':{'id':_0x51c2c6[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x39ea52,null))[_0xb33a('0x37')](function(_0xc3778c){if(_0xc3778c){_0x2457c8[_0xb33a('0x46')]=_[_0xb33a('0x4a')](db[_0xb33a('0x6b')]['rawAttributes']);_0x2457c8[_0xb33a('0x49')]=_['keys'](_0x51c2c6[_0xb33a('0x49')]);_0x2457c8[_0xb33a('0x4b')]=_['intersection'](_0x2457c8[_0xb33a('0x46')],_0x2457c8[_0xb33a('0x49')]);_0x38f380[_0xb33a('0x4d')]=_[_0xb33a('0x4c')](_0x2457c8['model'],qs[_0xb33a('0x4e')](_0x51c2c6[_0xb33a('0x49')][_0xb33a('0x4e')]));_0x38f380['attributes']=_0x38f380[_0xb33a('0x4d')]['length']?_0x38f380['attributes']:_0x2457c8['model'];if(!_0x51c2c6['query'][_0xb33a('0x50')](_0xb33a('0x51'))){_0x38f380['limit']=qs[_0xb33a('0x31')](_0x51c2c6['query'][_0xb33a('0x31')]);_0x38f380[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0x51c2c6['query'][_0xb33a('0x2f')]);}_0x38f380['order']=qs[_0xb33a('0x53')](_0x51c2c6[_0xb33a('0x49')][_0xb33a('0x53')]);_0x38f380['where']=qs[_0xb33a('0x4b')](_['pick'](_0x51c2c6[_0xb33a('0x49')],_0x2457c8['filters']));_0x38f380[_0xb33a('0x54')][_0xb33a('0x65')]=_0xc3778c['id'];if(_0x51c2c6[_0xb33a('0x49')][_0xb33a('0x55')]){_0x38f380[_0xb33a('0x54')]=_[_0xb33a('0x56')](_0x38f380[_0xb33a('0x54')],{'$or':_[_0xb33a('0x47')](_0x38f380[_0xb33a('0x4d')],function(_0x1629f7){var _0x399c22={};_0x399c22[_0x1629f7]={'$like':'%'+_0x51c2c6[_0xb33a('0x49')]['filter']+'%'};return _0x399c22;})});}_0x38f380=_[_0xb33a('0x56')]({},_0x38f380,_0x51c2c6['options']);return db[_0xb33a('0x6b')][_0xb33a('0x32')]({'where':_0x38f380[_0xb33a('0x54')]})['then'](function(_0x4043b1){_0x34217d['count']=_0x4043b1;if(_0x51c2c6['query'][_0xb33a('0x58')]){_0x38f380['include']=[{'all':!![]}];}return db[_0xb33a('0x6b')][_0xb33a('0x5a')](_0x38f380);})[_0xb33a('0x37')](function(_0x5707ef){_0x34217d[_0xb33a('0x5b')]=_0x5707ef;return _0x34217d;});}})['then'](respondWithFilteredResult(_0x39ea52,_0x38f380))[_0xb33a('0x2c')](handleError(_0x39ea52,null));};exports['removeAnswers']=function(_0xf9cc04,_0x428005,_0x26f370){return db['MailAccount'][_0xb33a('0x60')]({'where':{'id':_0xf9cc04[_0xb33a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x428005,null))[_0xb33a('0x37')](function(_0x25c355){if(_0x25c355){return _0x25c355['removeAnswers'](_0xf9cc04['query']['ids']);}})['then'](respondWithStatusCode(_0x428005,null))[_0xb33a('0x2c')](handleError(_0x428005,null));};exports[_0xb33a('0x6c')]=function(_0x34bf14,_0x2966f4){var _0x440266={'name':_0x34bf14[_0xb33a('0x61')]['name'],'key':_0x34bf14[_0xb33a('0x61')][_0xb33a('0x45')],'email':_0x34bf14[_0xb33a('0x61')]['email'],'ListId':_0x34bf14['body'][_0xb33a('0x6d')],'active':!_[_0xb33a('0x6e')](_0x34bf14[_0xb33a('0x61')][_0xb33a('0x6f')])?_0x34bf14[_0xb33a('0x61')][_0xb33a('0x6f')]:!![],'description':_0x34bf14[_0xb33a('0x61')][_0xb33a('0x70')]||null,'Imap':{},'Smtp':{}};if(_[_0xb33a('0x6e')](_0x34bf14[_0xb33a('0x61')][_0xb33a('0x71')])){if(_0x34bf14[_0xb33a('0x61')][_0xb33a('0x72')]){_0x440266['Imap'][_0xb33a('0x73')]=_0x440266[_0xb33a('0x5e')][_0xb33a('0x73')]=_0x34bf14['body'][_0xb33a('0x74')];_0x440266[_0xb33a('0x40')]['password']=_0x440266['Smtp']['pass']=_0x34bf14[_0xb33a('0x61')][_0xb33a('0x75')];}else{_0x440266['Imap'][_0xb33a('0x76')]=_0x440266[_0xb33a('0x5e')][_0xb33a('0x76')]=![];}_0x440266[_0xb33a('0x40')]['host']=_0x34bf14['body'][_0xb33a('0x40')][_0xb33a('0x77')];_0x440266['Imap'][_0xb33a('0x78')]=_0x34bf14[_0xb33a('0x61')][_0xb33a('0x40')][_0xb33a('0x78')];_0x440266[_0xb33a('0x5e')][_0xb33a('0x77')]=_0x34bf14[_0xb33a('0x61')][_0xb33a('0x5e')][_0xb33a('0x77')];_0x440266[_0xb33a('0x5e')][_0xb33a('0x78')]=_0x34bf14[_0xb33a('0x61')][_0xb33a('0x5e')][_0xb33a('0x78')];}else{_0x440266[_0xb33a('0x40')][_0xb33a('0x79')]=_0x440266[_0xb33a('0x5e')][_0xb33a('0x79')]=_0x34bf14[_0xb33a('0x61')][_0xb33a('0x71')];_0x440266[_0xb33a('0x40')]['user']=_0x440266['Smtp']['user']=_0x34bf14[_0xb33a('0x61')][_0xb33a('0x74')];_0x440266[_0xb33a('0x40')][_0xb33a('0x7a')]=_0x440266['Smtp']['pass']=_0x34bf14[_0xb33a('0x61')]['cpassword'];}return db[_0xb33a('0x43')][_0xb33a('0x6c')](_0x440266,{'include':[{'model':db[_0xb33a('0x41')],'as':_0xb33a('0x5e')},{'model':db['MailServerIn'],'as':_0xb33a('0x40')}]})[_0xb33a('0x37')](function(_0x81c458){var _0x1715aa=_0x34bf14[_0xb33a('0x73')]['get']({'plain':!![]});if(!_0x1715aa)throw new Error(_0xb33a('0x7b'));if(_0x1715aa[_0xb33a('0x7c')]===_0xb33a('0x73')){var _0x3ac462=_0x81c458[_0xb33a('0x39')]({'plain':!![]});return db['UserProfileSection'][_0xb33a('0x60')]({'where':{'name':_0xb33a('0x3a'),'userProfileId':_0x1715aa[_0xb33a('0x7d')]},'raw':!![]})[_0xb33a('0x37')](function(_0x1464b3){if(_0x1464b3&&_0x1464b3[_0xb33a('0x7e')]===0x0){return db[_0xb33a('0x3b')]['create']({'name':_0x3ac462[_0xb33a('0x48')],'resourceId':_0x3ac462['id'],'type':_0x1464b3[_0xb33a('0x48')],'sectionId':_0x1464b3['id']},{})[_0xb33a('0x37')](function(){return _0x81c458;});}else{return _0x81c458;}})[_0xb33a('0x2c')](function(_0x4901ad){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4901ad);throw _0x4901ad;});}return _0x81c458;})[_0xb33a('0x37')](respondWithResult(_0x2966f4,0xc9))[_0xb33a('0x2c')](handleError(_0x2966f4,null));};exports[_0xb33a('0x7f')]=function(_0x4f9bd1,_0x596945,_0x3d5341){return db[_0xb33a('0x43')]['findOne']({'where':{'id':_0x4f9bd1[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x596945,null))[_0xb33a('0x37')](function(_0x559967){if(_0x559967){return _0x559967[_0xb33a('0x7f')]();}return null;})['then'](respondWithResult(_0x596945,null))[_0xb33a('0x2c')](handleError(_0x596945,null));};exports['addImap']=function(_0x48c5c2,_0x42f61c,_0x3250f5){if(_0x48c5c2[_0xb33a('0x61')]['id']){delete _0x48c5c2[_0xb33a('0x61')]['id'];}return db['MailAccount'][_0xb33a('0x60')]({'where':{'id':_0x48c5c2['params']['id']}})['then'](handleEntityNotFound(_0x42f61c,null))[_0xb33a('0x37')](function(_0x23a763){if(_0x23a763){_0x48c5c2[_0xb33a('0x61')][_0xb33a('0x65')]=_0x23a763['id'];return db[_0xb33a('0x3f')][_0xb33a('0x6c')](_0x48c5c2[_0xb33a('0x61')]);}})['then'](respondWithResult(_0x42f61c,null))['catch'](handleError(_0x42f61c,null));};exports[_0xb33a('0x80')]=function(_0x1bb605,_0x34fb71,_0x2f0a09){return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x1bb605[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x34fb71,null))['then'](function(_0x5f4b19){if(_0x5f4b19){return _0x5f4b19[_0xb33a('0x81')](null);}return null;})[_0xb33a('0x37')](respondWithStatusCode(_0x34fb71,null))[_0xb33a('0x2c')](handleError(_0x34fb71,null));};exports[_0xb33a('0x82')]=function(_0x2bc0b9,_0x54f027,_0x1ce4e9){return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x2bc0b9[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x54f027,null))[_0xb33a('0x37')](function(_0x8ef0f5){if(_0x8ef0f5){return _0x8ef0f5['getSmtp']();}return null;})[_0xb33a('0x37')](respondWithResult(_0x54f027,null))[_0xb33a('0x2c')](handleError(_0x54f027,null));};exports[_0xb33a('0x83')]=function(_0x4d6179,_0x3ab735,_0x1b4a5d){if(_0x4d6179[_0xb33a('0x61')]['id']){delete _0x4d6179[_0xb33a('0x61')]['id'];}return db[_0xb33a('0x43')][_0xb33a('0x60')]({'where':{'id':_0x4d6179[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x3ab735,null))['then'](function(_0x16e407){if(_0x16e407){_0x4d6179[_0xb33a('0x61')]['MailAccountId']=_0x16e407['id'];return db['MailServerOut'][_0xb33a('0x6c')](_0x4d6179[_0xb33a('0x61')]);}})[_0xb33a('0x37')](respondWithResult(_0x3ab735,null))[_0xb33a('0x2c')](handleError(_0x3ab735,null));};exports[_0xb33a('0x84')]=function(_0x531b6b,_0x53393a,_0x296ed2){return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x531b6b['params']['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x53393a,null))[_0xb33a('0x37')](function(_0x1bfc38){if(_0x1bfc38){return _0x1bfc38[_0xb33a('0x85')](null);}return null;})['then'](respondWithStatusCode(_0x53393a,null))[_0xb33a('0x2c')](handleError(_0x53393a,null));};exports[_0xb33a('0x86')]=function(_0x234a63,_0x857635,_0x4be24f){return db['MailInteraction']['find']({'where':{'id':_0x234a63[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x857635,null))[_0xb33a('0x37')](function(_0x10a699){if(_0x10a699){return _0x10a699['addInteraction'](_0x234a63[_0xb33a('0x61')][_0xb33a('0x6a')],_['omit'](_0x234a63['body'],[_0xb33a('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x857635,null))[_0xb33a('0x2c')](handleError(_0x857635,null));};exports['getInteractions']=function(_0xb886d1,_0x59a2ad,_0x42dd33){var _0x4c12c2={'raw':![],'where':{}};var _0x5a655c={};var _0x50319c={'count':0x0,'rows':[]};return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0xb886d1['params']['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x59a2ad,null))['then'](function(_0x2f2255){if(_0x2f2255){_0x5a655c[_0xb33a('0x46')]=_['keys'](db[_0xb33a('0x87')][_0xb33a('0x5f')]);_0x5a655c[_0xb33a('0x49')]=_['keys'](_0xb886d1[_0xb33a('0x49')]);_0x5a655c[_0xb33a('0x4b')]=_[_0xb33a('0x4c')](_0x5a655c[_0xb33a('0x46')],_0x5a655c[_0xb33a('0x49')]);_0x4c12c2[_0xb33a('0x4d')]=_['intersection'](_0x5a655c[_0xb33a('0x46')],qs[_0xb33a('0x4e')](_0xb886d1[_0xb33a('0x49')][_0xb33a('0x4e')]));_0x4c12c2[_0xb33a('0x4d')]=_0x4c12c2[_0xb33a('0x4d')][_0xb33a('0x4f')]?_0x4c12c2['attributes']:_0x5a655c['model'];if(!_0xb886d1['query']['hasOwnProperty'](_0xb33a('0x51'))){_0x4c12c2[_0xb33a('0x31')]=qs[_0xb33a('0x31')](_0xb886d1['query']['limit']);_0x4c12c2[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0xb886d1[_0xb33a('0x49')][_0xb33a('0x2f')]);}_0x4c12c2['order']=qs['sort'](_0xb886d1[_0xb33a('0x49')][_0xb33a('0x53')]);_0x4c12c2['where']=qs[_0xb33a('0x4b')](_[_0xb33a('0x88')](_0xb886d1[_0xb33a('0x49')],_0x5a655c['filters']));_0x4c12c2['where'][_0xb33a('0x65')]=_0x2f2255['id'];if(_0xb886d1[_0xb33a('0x49')]['filter']){_0x4c12c2[_0xb33a('0x54')]=_[_0xb33a('0x56')](_0x4c12c2[_0xb33a('0x54')],{'$or':_[_0xb33a('0x47')](_0x4c12c2['attributes'],function(_0x59be7c){var _0x41364c={};_0x41364c[_0x59be7c]={'$like':'%'+_0xb886d1[_0xb33a('0x49')][_0xb33a('0x55')]+'%'};return _0x41364c;})});}_0x4c12c2=_['merge']({},_0x4c12c2,_0xb886d1[_0xb33a('0x57')]);return db[_0xb33a('0x87')][_0xb33a('0x32')]({'where':_0x4c12c2[_0xb33a('0x54')]})['then'](function(_0x5dda94){_0x50319c[_0xb33a('0x32')]=_0x5dda94;if(_0xb886d1[_0xb33a('0x49')][_0xb33a('0x58')]){_0x4c12c2[_0xb33a('0x59')]=[{'model':db['CmContact'],'as':_0xb33a('0x89'),'required':![]},{'model':db['User'],'as':_0xb33a('0x8a'),'attributes':[_0xb33a('0x48'),_0xb33a('0x8b'),_0xb33a('0x8c')],'required':![]},{'model':db[_0xb33a('0x8d')],'as':_0xb33a('0x8e'),'attributes':['id',_0xb33a('0x48'),_0xb33a('0x8f')],'where':_0xb886d1[_0xb33a('0x49')][_0xb33a('0x90')]?{'id':_0xb886d1[_0xb33a('0x49')][_0xb33a('0x90')]}:undefined,'required':_0xb886d1[_0xb33a('0x49')][_0xb33a('0x90')]?!![]:![]}];}return db[_0xb33a('0x87')][_0xb33a('0x5a')](_0x4c12c2);})[_0xb33a('0x37')](function(_0x5b7327){_0x50319c[_0xb33a('0x5b')]=_0x5b7327;return _0x50319c;});}})[_0xb33a('0x37')](respondWithFilteredResult(_0x59a2ad,_0x4c12c2))[_0xb33a('0x2c')](handleError(_0x59a2ad,null));};exports[_0xb33a('0x91')]=function(_0x50cfc8,_0x24a630,_0x3565c1){return db[_0xb33a('0x43')]['findOne']({'where':{'id':_0x50cfc8[_0xb33a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x24a630,null))['then'](function(_0x4a37bb){if(_0x4a37bb){return db[_0xb33a('0x92')][_0xb33a('0x93')](function(_0x5682ef){return db[_0xb33a('0x94')][_0xb33a('0x38')]({'where':{'MailAccountId':_0x50cfc8[_0xb33a('0x5d')]['id']},'transaction':_0x5682ef})[_0xb33a('0x37')](function(_0x55c951){var _0x2e8732=_[_0xb33a('0x47')](_0x50cfc8['body'],function(_0x1c94d2){_0x1c94d2[_0xb33a('0x65')]=_0x50cfc8[_0xb33a('0x5d')]['id'];return _0x1c94d2;});return db[_0xb33a('0x94')][_0xb33a('0x95')](_0x2e8732,{'transaction':_0x5682ef});});})['then'](function(){return db[_0xb33a('0x94')][_0xb33a('0x96')]({'where':{'MailAccountId':_0x50cfc8['params']['id']},'order':'priority'});});}})[_0xb33a('0x37')](respondWithResult(_0x24a630,null))[_0xb33a('0x2c')](handleError(_0x24a630,null));};exports[_0xb33a('0x97')]=function(_0x2cb83a,_0x13d356,_0x2e6208){var _0x1b9d65={};var _0x68a7c2={};var _0x1fd12f;var _0x10e6ec;return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x2cb83a['params']['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x13d356,null))['then'](function(_0x5eb2ac){if(_0x5eb2ac){_0x1fd12f=_0x5eb2ac;_0x68a7c2['model']=_[_0xb33a('0x4a')](db[_0xb33a('0x94')][_0xb33a('0x5f')]);_0x68a7c2[_0xb33a('0x49')]=_[_0xb33a('0x4a')](_0x2cb83a['query']);_0x68a7c2[_0xb33a('0x4b')]=_[_0xb33a('0x4c')](_0x68a7c2[_0xb33a('0x46')],_0x68a7c2[_0xb33a('0x49')]);_0x1b9d65[_0xb33a('0x4d')]=_[_0xb33a('0x4c')](_0x68a7c2[_0xb33a('0x46')],qs[_0xb33a('0x4e')](_0x2cb83a[_0xb33a('0x49')][_0xb33a('0x4e')]));_0x1b9d65[_0xb33a('0x4d')]=_0x1b9d65[_0xb33a('0x4d')][_0xb33a('0x4f')]?_0x1b9d65['attributes']:_0x68a7c2[_0xb33a('0x46')];_0x1b9d65[_0xb33a('0x52')]=qs['sort'](_0x2cb83a[_0xb33a('0x49')][_0xb33a('0x53')]);_0x1b9d65[_0xb33a('0x54')]=qs[_0xb33a('0x4b')](_[_0xb33a('0x88')](_0x2cb83a[_0xb33a('0x49')],_0x68a7c2['filters']));if(_0x2cb83a['query'][_0xb33a('0x55')]){_0x1b9d65['where']=_[_0xb33a('0x56')](_0x1b9d65[_0xb33a('0x54')],{'$or':_[_0xb33a('0x47')](_0x1b9d65[_0xb33a('0x4d')],function(_0x33d6f4){var _0x2f24bf={};_0x2f24bf[_0x33d6f4]={'$like':'%'+_0x2cb83a[_0xb33a('0x49')]['filter']+'%'};return _0x2f24bf;})});}_0x1b9d65=_[_0xb33a('0x56')]({},_0x1b9d65,_0x2cb83a[_0xb33a('0x57')]);return _0x1fd12f[_0xb33a('0x97')](_0x1b9d65);}})['then'](function(_0x2c609c){if(_0x2c609c){_0x10e6ec=_0x2c609c[_0xb33a('0x4f')];if(!_0x2cb83a[_0xb33a('0x49')][_0xb33a('0x50')](_0xb33a('0x51'))){_0x1b9d65[_0xb33a('0x31')]=qs[_0xb33a('0x31')](_0x2cb83a['query'][_0xb33a('0x31')]);_0x1b9d65[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0x2cb83a[_0xb33a('0x49')][_0xb33a('0x2f')]);}return _0x1fd12f[_0xb33a('0x97')](_0x1b9d65);}})[_0xb33a('0x37')](function(_0x4f37b3){if(_0x4f37b3){return _0x4f37b3?{'count':_0x10e6ec,'rows':_0x4f37b3}:null;}})[_0xb33a('0x37')](respondWithResult(_0x13d356,null))[_0xb33a('0x2c')](handleError(_0x13d356,null));};exports[_0xb33a('0x98')]=function(_0x3c4e17,_0x5a0998,_0x5c4998){var _0x2b1c3d={'raw':!![],'where':{}};var _0x523f55={};var _0x2ff7f4={'count':0x0,'rows':[]};return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x3c4e17[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x5a0998,null))[_0xb33a('0x37')](function(_0x2f9400){if(_0x2f9400){_0x523f55[_0xb33a('0x46')]=_[_0xb33a('0x4a')](db['MailMessage']['rawAttributes']);_0x523f55[_0xb33a('0x49')]=_[_0xb33a('0x4a')](_0x3c4e17['query']);_0x523f55['filters']=_[_0xb33a('0x4c')](_0x523f55[_0xb33a('0x46')],_0x523f55[_0xb33a('0x49')]);_0x2b1c3d['attributes']=_[_0xb33a('0x4c')](_0x523f55[_0xb33a('0x46')],qs[_0xb33a('0x4e')](_0x3c4e17[_0xb33a('0x49')][_0xb33a('0x4e')]));_0x2b1c3d[_0xb33a('0x4d')]=_0x2b1c3d[_0xb33a('0x4d')]['length']?_0x2b1c3d[_0xb33a('0x4d')]:_0x523f55['model'];if(!_0x3c4e17['query'][_0xb33a('0x50')](_0xb33a('0x51'))){_0x2b1c3d[_0xb33a('0x31')]=qs['limit'](_0x3c4e17[_0xb33a('0x49')]['limit']);_0x2b1c3d[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0x3c4e17[_0xb33a('0x49')]['offset']);}_0x2b1c3d['order']=qs[_0xb33a('0x53')](_0x3c4e17[_0xb33a('0x49')][_0xb33a('0x53')]);_0x2b1c3d[_0xb33a('0x54')]=qs[_0xb33a('0x4b')](_[_0xb33a('0x88')](_0x3c4e17['query'],_0x523f55['filters']));_0x2b1c3d[_0xb33a('0x54')]['MailAccountId']=_0x2f9400['id'];if(_0x3c4e17[_0xb33a('0x49')][_0xb33a('0x55')]){_0x2b1c3d[_0xb33a('0x54')]=_[_0xb33a('0x56')](_0x2b1c3d['where'],{'$or':_[_0xb33a('0x47')](_0x2b1c3d['attributes'],function(_0x82667a){var _0x2b84fb={};_0x2b84fb[_0x82667a]={'$like':'%'+_0x3c4e17[_0xb33a('0x49')]['filter']+'%'};return _0x2b84fb;})});}if(_0x3c4e17['query'][_0xb33a('0x99')]){var _0x510edb=_0x3c4e17[_0xb33a('0x49')]['$gte'][_0xb33a('0x9a')](',');var _0x2cc4cb={};_0x2cc4cb[_0x510edb[0x0]]={'$gte':moment(_0x510edb[0x1])[_0xb33a('0x9b')](_0xb33a('0x9c'))};_0x2b1c3d['where']=_['merge'](_0x2b1c3d[_0xb33a('0x54')],_0x2cc4cb);}_0x2b1c3d=_[_0xb33a('0x56')]({},_0x2b1c3d,_0x3c4e17['options']);return db[_0xb33a('0x9d')][_0xb33a('0x32')]({'where':_0x2b1c3d[_0xb33a('0x54')]})[_0xb33a('0x37')](function(_0x15ba5e){_0x2ff7f4[_0xb33a('0x32')]=_0x15ba5e;if(_0x3c4e17[_0xb33a('0x49')]['includeAll']){_0x2b1c3d[_0xb33a('0x59')]=[{'all':!![]}];}return db[_0xb33a('0x9d')]['findAll'](_0x2b1c3d);})[_0xb33a('0x37')](function(_0x1ebb04){if(_0x3c4e17[_0xb33a('0x49')][_0xb33a('0x9e')]==='true'){for(var _0x41bfba=0x0;_0x41bfba<_0x1ebb04[_0xb33a('0x4f')];_0x41bfba++){_0x1ebb04[_0x41bfba][_0xb33a('0x61')]=juice(_0x1ebb04[_0x41bfba]['body']);}}_0x2ff7f4['rows']=_0x1ebb04;return _0x2ff7f4;});}})[_0xb33a('0x37')](respondWithFilteredResult(_0x5a0998,_0x2b1c3d))['catch'](handleError(_0x5a0998,null));};exports[_0xb33a('0x3d')]=function(_0x44618f,_0x29d46f,_0x360836){var _0x5e4947,_0x44664a={},_0x196e07;if(_0x44618f[_0xb33a('0x61')]['to']){_0x196e07=_0x44618f[_0xb33a('0x61')]['to'][_0xb33a('0x9a')](',')[0x0];}return db[_0xb33a('0x43')][_0xb33a('0x60')]({'where':{'id':_0x44618f['params']['id']},'include':[{'model':db[_0xb33a('0x9f')],'as':_0xb33a('0xa0'),'include':[{'model':db[_0xb33a('0xa1')],'as':_0xb33a('0xa2'),'where':{'email':_0x196e07},'limit':0x1,'order':[[_0xb33a('0xa3'),_0xb33a('0xa4')]]}]},{'model':db[_0xb33a('0x41')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x29d46f,null))[_0xb33a('0x37')](function(_0xfb84e4){if(_0xfb84e4){_0x5e4947=_0xfb84e4;if(_0xfb84e4[_0xb33a('0x5e')]){if(_[_0xb33a('0x6e')](_0x44618f[_0xb33a('0x61')][_0xb33a('0xa5')])){_0x44618f[_0xb33a('0x61')]['from']=util[_0xb33a('0x9b')](_0xb33a('0xa6'),_0xfb84e4[_0xb33a('0x48')],_0xfb84e4[_0xb33a('0xa7')]||_0xfb84e4[_0xb33a('0x5e')]['user']);}if(_0x44618f['body'][_0xb33a('0xa8')]&&_0x44618f[_0xb33a('0x61')][_0xb33a('0xa8')][_0xb33a('0x4f')]){for(var _0x187f6d=0x0;_0x187f6d<_0x44618f[_0xb33a('0x61')]['attachments'][_0xb33a('0x4f')];_0x187f6d+=0x1){_0x44618f['body'][_0xb33a('0xa8')][_0x187f6d]={'filename':_0x44618f[_0xb33a('0x61')][_0xb33a('0xa8')][_0x187f6d][_0xb33a('0x48')],'path':path[_0xb33a('0xa9')](config[_0xb33a('0xaa')],_0xb33a('0xab'),_0x44618f[_0xb33a('0x61')][_0xb33a('0xa8')][_0x187f6d][_0xb33a('0xac')])};}}var _0x921231={'tls':{'rejectUnauthorized':![]}};if(_[_0xb33a('0x6e')](_0xfb84e4[_0xb33a('0x5e')][_0xb33a('0x79')])){if(_0xfb84e4[_0xb33a('0x5e')][_0xb33a('0x76')]){_0x921231[_0xb33a('0xad')]={'user':_0xfb84e4['Smtp'][_0xb33a('0x73')],'pass':_0xfb84e4[_0xb33a('0x5e')][_0xb33a('0xae')]};}_0x921231[_0xb33a('0x77')]=_0xfb84e4[_0xb33a('0x5e')][_0xb33a('0x77')];_0x921231[_0xb33a('0x78')]=_0xfb84e4[_0xb33a('0x5e')]['port'];_0x921231['secure']=_0xfb84e4[_0xb33a('0x5e')][_0xb33a('0xaf')];}else{_0x921231[_0xb33a('0x79')]=_0xfb84e4['Smtp']['service'];_0x921231[_0xb33a('0xad')]={'user':_0xfb84e4[_0xb33a('0x5e')]['user'],'pass':_0xfb84e4[_0xb33a('0x5e')][_0xb33a('0xae')]};}return respondWithRpcPromise('SendMail',_0xb33a('0xb0'),{'account':_0x921231,'message':_0x44618f[_0xb33a('0x61')]});}else{throw new Error('List\x20not\x20found');}}})[_0xb33a('0x37')](function(_0x5893e6){if(_0x5893e6){_0x44664a=_0x5893e6;if(_0x5e4947[_0xb33a('0xa0')]){if(_0x5e4947['List'][_0xb33a('0xa2')][_0xb33a('0x4f')]){return _0x5e4947[_0xb33a('0xa0')]['Contacts'][0x0];}else{return db[_0xb33a('0xa1')][_0xb33a('0x6c')](_[_0xb33a('0x1e')](_0x44618f[_0xb33a('0x61')],{'firstName':_0x44618f[_0xb33a('0x61')]['to'],'email':_0x44618f['body']['to'],'phone':_0x44618f['body']['to'],'ListId':_0x5e4947['ListId']}));}}else{throw new Error(_0xb33a('0xb1'));}}})['then'](function(_0x253818){if(_0x253818){var _0x42e2ed={'UserId':_0x44618f[_0xb33a('0x73')]['id'],'ContactId':_0x253818['id'],'MailAccountId':_0x5e4947['id'],'inReplyTo':_0x44664a[_0xb33a('0xb2')],'to':_0x44618f['body'][_0xb33a('0xa5')],'cc':_0x44618f['body']['cc'],'subject':_0x44618f['body']['subject'],'attach':_0x44618f[_0xb33a('0x61')][_0xb33a('0xb3')],'firstMsgDirection':_0xb33a('0xb4'),'lastMsgAt':moment()[_0xb33a('0x9b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xb33a('0xb4'),'Messages':[_[_0xb33a('0x56')](_0x44618f[_0xb33a('0x61')],{'messageId':_0x44664a[_0xb33a('0xb2')],'sentAt':moment()[_0xb33a('0x9b')](_0xb33a('0x9c')),'read':!![],'MailAccountId':_0x5e4947['id'],'UserId':_0x44618f['user']['id'],'ContactId':_0x253818['id']})]};if(_0x44618f[_0xb33a('0x61')][_0xb33a('0xb5')]){_0x42e2ed=_[_0xb33a('0x56')](_0x42e2ed,_0x44618f[_0xb33a('0x61')]['Interaction']);}return db['MailInteraction'][_0xb33a('0x6c')](_0x42e2ed,{'include':[{'model':db[_0xb33a('0x9d')],'as':_0xb33a('0xb6')}]});}})[_0xb33a('0x37')](respondWithResult(_0x29d46f,null))['catch'](handleError(_0x29d46f,null));};exports[_0xb33a('0xb7')]=function(_0xb58ef7,_0x2e9fae,_0x3daae1){return db[_0xb33a('0x43')][_0xb33a('0x60')]({'where':{'id':_0xb58ef7[_0xb33a('0x5d')]['id']},'include':[{'model':db[_0xb33a('0x41')],'as':_0xb33a('0x5e'),'raw':!![]}]})[_0xb33a('0x37')](handleEntityNotFound(_0x2e9fae,null))[_0xb33a('0x37')](function(_0x3c1255){if(_0x3c1255&&_0x3c1255[_0xb33a('0x5e')]){var _0x30cb6b={'id':_0x3c1255['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3c1255[_0xb33a('0x5e')][_0xb33a('0x79')]){_0x30cb6b[_0xb33a('0x79')]=_0x3c1255[_0xb33a('0x5e')]['service'];}else{_0x30cb6b[_0xb33a('0x77')]=_0x3c1255[_0xb33a('0x5e')][_0xb33a('0x77')];_0x30cb6b[_0xb33a('0x78')]=_0x3c1255[_0xb33a('0x5e')][_0xb33a('0x78')];_0x30cb6b['secure']=_0x3c1255[_0xb33a('0x5e')][_0xb33a('0xaf')];}if(_0x3c1255[_0xb33a('0x5e')][_0xb33a('0x76')]){_0x30cb6b[_0xb33a('0xad')]={'user':_0x3c1255['Smtp'][_0xb33a('0x73')],'pass':_0x3c1255[_0xb33a('0x5e')][_0xb33a('0xae')]};}return respondWithRpcPromise(_0xb33a('0xb8'),_0xb33a('0xb7'),{'account':_0x30cb6b});}})['then'](respondWithResult(_0x2e9fae,null))[_0xb33a('0x2c')](handleError(_0x2e9fae,null));};exports[_0xb33a('0x38')]=function(_0x49c0df,_0x19fcd9){return db[_0xb33a('0x43')][_0xb33a('0x60')]({'where':{'id':_0x49c0df['params']['id']}})['then'](handleEntityNotFound(_0x19fcd9,null))[_0xb33a('0x37')](function(_0x10bf77){if(_0x10bf77&&_0x10bf77[_0xb33a('0x79')]){throw new db[(_0xb33a('0xb9'))][(_0xb33a('0xba'))](_0xb33a('0xbb'));}return _0x10bf77;})[_0xb33a('0x37')](removeEntity(_0x19fcd9,null))[_0xb33a('0x2c')](handleError(_0x19fcd9,null));};exports['addAgents']=function(_0x3ac310,_0x399895,_0x52e087){return db[_0xb33a('0x43')][_0xb33a('0x60')]({'where':{'id':_0x3ac310[_0xb33a('0x5d')]['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x399895,null))['then'](function(_0x4902c4){if(_0x4902c4){return _0x4902c4[_0xb33a('0xbc')](_0x3ac310[_0xb33a('0x61')][_0xb33a('0x6a')],_[_0xb33a('0xbd')](_0x3ac310[_0xb33a('0x61')],[_0xb33a('0x6a'),'id'])||{})[_0xb33a('0xbe')](function(_0x4e04a9){for(var _0x95a6e7=0x0;_0x95a6e7<_0x3ac310[_0xb33a('0x61')]['ids']['length'];_0x95a6e7+=0x1){socket[_0xb33a('0xbf')](_0xb33a('0xc0'),{'UserId':Number(_0x3ac310[_0xb33a('0x61')]['ids'][_0x95a6e7]),'MailAccountId':Number(_0x3ac310[_0xb33a('0x5d')]['id'])});}return _0x4e04a9;});}})[_0xb33a('0x37')](respondWithResult(_0x399895,null))[_0xb33a('0x2c')](handleError(_0x399895,null));};exports['removeAgents']=function(_0x3dd82e,_0x76b878,_0x4d4c6c){return db['MailAccount'][_0xb33a('0x60')]({'where':{'id':_0x3dd82e[_0xb33a('0x5d')]['id']}})['then'](handleEntityNotFound(_0x76b878,null))['then'](function(_0x190f45){if(_0x190f45){return _0x190f45[_0xb33a('0xc1')](_0x3dd82e[_0xb33a('0x49')][_0xb33a('0x6a')])[_0xb33a('0x37')](function(){if(_[_0xb33a('0xc2')](_0x3dd82e[_0xb33a('0x49')][_0xb33a('0x6a')])){for(var _0x2c47d6=0x0;_0x2c47d6<_0x3dd82e['query'][_0xb33a('0x6a')][_0xb33a('0x4f')];_0x2c47d6+=0x1){socket['emit'](_0xb33a('0xc3'),{'UserId':Number(_0x3dd82e[_0xb33a('0x49')][_0xb33a('0x6a')][_0x2c47d6]),'MailAccountId':Number(_0x3dd82e['params']['id'])});}}else{socket[_0xb33a('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x3dd82e[_0xb33a('0x49')][_0xb33a('0x6a')]),'MailAccountId':Number(_0x3dd82e[_0xb33a('0x5d')]['id'])});}});}})[_0xb33a('0x37')](respondWithStatusCode(_0x76b878,null))[_0xb33a('0x2c')](handleError(_0x76b878,null));};exports[_0xb33a('0xc4')]=function(_0x585fe8,_0x38ab4d,_0x18aa3c){var _0x3ec26a={};var _0x1446bd={};var _0xafc218;var _0x70a81c;return db[_0xb33a('0x43')][_0xb33a('0x68')]({'where':{'id':_0x585fe8['params']['id']}})[_0xb33a('0x37')](handleEntityNotFound(_0x38ab4d,null))['then'](function(_0x1981e8){if(_0x1981e8){_0xafc218=_0x1981e8;_0x1446bd[_0xb33a('0x46')]=_[_0xb33a('0x4a')](db['User'][_0xb33a('0x5f')]);_0x1446bd['query']=_[_0xb33a('0x4a')](_0x585fe8[_0xb33a('0x49')]);_0x1446bd[_0xb33a('0x4b')]=_['intersection'](_0x1446bd[_0xb33a('0x46')],_0x1446bd[_0xb33a('0x49')]);_0x3ec26a['attributes']=_[_0xb33a('0x4c')](_0x1446bd[_0xb33a('0x46')],qs[_0xb33a('0x4e')](_0x585fe8['query'][_0xb33a('0x4e')]));_0x3ec26a[_0xb33a('0x4d')]=_0x3ec26a[_0xb33a('0x4d')][_0xb33a('0x4f')]?_0x3ec26a[_0xb33a('0x4d')]:_0x1446bd[_0xb33a('0x46')];_0x3ec26a[_0xb33a('0x52')]=qs['sort'](_0x585fe8[_0xb33a('0x49')][_0xb33a('0x53')]);_0x3ec26a[_0xb33a('0x54')]=qs[_0xb33a('0x4b')](_[_0xb33a('0x88')](_0x585fe8[_0xb33a('0x49')],_0x1446bd['filters']));if(_0x585fe8[_0xb33a('0x49')][_0xb33a('0x55')]){_0x3ec26a[_0xb33a('0x54')]=_[_0xb33a('0x56')](_0x3ec26a[_0xb33a('0x54')],{'$or':_['map'](_0x3ec26a[_0xb33a('0x4d')],function(_0x57e365){var _0x363882={};_0x363882[_0x57e365]={'$like':'%'+_0x585fe8[_0xb33a('0x49')]['filter']+'%'};return _0x363882;})});}_0x3ec26a=_['merge']({},_0x3ec26a,_0x585fe8[_0xb33a('0x57')]);return _0xafc218[_0xb33a('0xc4')](_0x3ec26a);}})['then'](function(_0x35bd9d){if(_0x35bd9d){_0x70a81c=_0x35bd9d[_0xb33a('0x4f')];if(!_0x585fe8[_0xb33a('0x49')]['hasOwnProperty'](_0xb33a('0x51'))){_0x3ec26a[_0xb33a('0x31')]=qs[_0xb33a('0x31')](_0x585fe8['query'][_0xb33a('0x31')]);_0x3ec26a[_0xb33a('0x2f')]=qs[_0xb33a('0x2f')](_0x585fe8[_0xb33a('0x49')][_0xb33a('0x2f')]);}return _0xafc218[_0xb33a('0xc4')](_0x3ec26a);}})[_0xb33a('0x37')](function(_0x23535d){if(_0x23535d){return _0x23535d?{'count':_0x70a81c,'rows':_0x23535d}:null;}})[_0xb33a('0x37')](respondWithResult(_0x38ab4d,null))['catch'](handleError(_0x38ab4d,null));};
\ No newline at end of file
+var _0xb8be=['../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','save','UserProfileResource','destroy','name','index','MailServerIn','Imap','MailServerOut','mandatoryDispositionPause','MailAccount','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','map','VIRTUAL','merge','options','include','findAll','rows','show','params','Smtp','Pause','length','includeAll','body','find','update','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','where','removeDispositions','CannedAnswer','removeAnswers','ids','isNil','active','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','internal','Tag','Tags','tag','addApplications','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','send','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','secure','auth','SendMail','sendMail','List\x20not\x20found','ListId','messageId','out','Interaction','Messages','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','removeAgents','isArray','getAgents','User','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','querystring','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x55aeae,_0x3c404e){var _0x537128=function(_0x351f88){while(--_0x351f88){_0x55aeae['push'](_0x55aeae['shift']());}};_0x537128(++_0x3c404e);}(_0xb8be,0xa9));var _0xeb8b=function(_0x1a8f86,_0x5ed9c4){_0x1a8f86=_0x1a8f86-0x0;var _0x20d876=_0xb8be[_0x1a8f86];return _0x20d876;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeb8b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb8b('0x1'));var rp=require(_0xeb8b('0x2'));var moment=require(_0xeb8b('0x3'));var BPromise=require(_0xeb8b('0x4'));var Mustache=require(_0xeb8b('0x5'));var util=require(_0xeb8b('0x6'));var path=require(_0xeb8b('0x7'));var sox=require(_0xeb8b('0x8'));var csv=require('to-csv');var ejs=require(_0xeb8b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb8b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeb8b('0xb'));var Papa=require(_0xeb8b('0xc'));var htmlToText=require(_0xeb8b('0xd'));var juice=require(_0xeb8b('0xe'));var Redis=require('ioredis');var authService=require(_0xeb8b('0xf'));var qs=require(_0xeb8b('0x10'));var as=require(_0xeb8b('0x11'));var hardwareService=require(_0xeb8b('0x12'));var logger=require(_0xeb8b('0x13'))('api');var utils=require(_0xeb8b('0x14'));var config=require(_0xeb8b('0x15'));var licenseUtil=require(_0xeb8b('0x16'));var db=require(_0xeb8b('0x17'))['db'];config['redis']=_[_0xeb8b('0x18')](config[_0xeb8b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb8b('0x1a'))(new Redis(config[_0xeb8b('0x19')]));require(_0xeb8b('0x1b'))['register'](socket);var jayson=require(_0xeb8b('0x1c'));var client=jayson[_0xeb8b('0x1d')][_0xeb8b('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x510d7b,_0x303430,_0x58c86b,_0x1a6b8b){return new BPromise(function(_0x3f032e,_0x46daf2){var _0xab7234=_0x1a6b8b||client;return _0xab7234[_0xeb8b('0x1f')](_0x510d7b,_0x58c86b)[_0xeb8b('0x20')](function(_0x466b74){logger[_0xeb8b('0x21')]('MailAccount,\x20%s,\x20%s',_0x303430,'request\x20sent');logger[_0xeb8b('0x22')](_0xeb8b('0x23'),_0x303430,_0xeb8b('0x24'),JSON[_0xeb8b('0x25')](_0x466b74));if(_0x466b74[_0xeb8b('0x26')]){if(_0x466b74[_0xeb8b('0x26')][_0xeb8b('0x27')]===0x1f4){logger['error'](_0xeb8b('0x28'),_0x303430,_0x466b74[_0xeb8b('0x26')][_0xeb8b('0x29')]);return _0x46daf2(_0x466b74[_0xeb8b('0x26')]['message']);}logger[_0xeb8b('0x26')]('MailAccount,\x20%s,\x20%s',_0x303430,_0x466b74[_0xeb8b('0x26')][_0xeb8b('0x29')]);return _0x3f032e(_0x466b74[_0xeb8b('0x26')][_0xeb8b('0x29')]);}else{logger[_0xeb8b('0x21')]('MailAccount,\x20%s,\x20%s',_0x303430,_0xeb8b('0x24'));_0x3f032e(_0x466b74[_0xeb8b('0x2a')][_0xeb8b('0x29')]);}})[_0xeb8b('0x2b')](function(_0x28ec93){logger[_0xeb8b('0x26')]('MailAccount,\x20%s,\x20%s',_0x303430,_0x28ec93);_0x46daf2(_0x28ec93);});});}function respondWithStatusCode(_0xf950c6,_0x39add5){_0x39add5=_0x39add5||0xcc;return function(_0x2b13d1){if(_0x2b13d1){return _0xf950c6[_0xeb8b('0x2c')](_0x39add5);}return _0xf950c6['status'](_0x39add5)[_0xeb8b('0x2d')]();};}function respondWithResult(_0x95a47c,_0x14fe0e){_0x14fe0e=_0x14fe0e||0xc8;return function(_0x23f659){if(_0x23f659){return _0x95a47c[_0xeb8b('0x2e')](_0x14fe0e)[_0xeb8b('0x2f')](_0x23f659);}};}function respondWithFilteredResult(_0x3ea3e7,_0x487fbe){return function(_0x3bc764){if(_0x3bc764){var _0x3fd179=typeof _0x487fbe[_0xeb8b('0x30')]===_0xeb8b('0x31')&&typeof _0x487fbe[_0xeb8b('0x32')]===_0xeb8b('0x31');var _0x4f72f0=_0x3bc764[_0xeb8b('0x33')];var _0x23ea97=_0x3fd179?0x0:_0x487fbe[_0xeb8b('0x30')];var _0x482bf5=_0x3fd179?_0x3bc764[_0xeb8b('0x33')]:_0x487fbe[_0xeb8b('0x30')]+_0x487fbe['limit'];var _0x459104;if(_0x482bf5>=_0x4f72f0){_0x482bf5=_0x4f72f0;_0x459104=0xc8;}else{_0x459104=0xce;}_0x3ea3e7['status'](_0x459104);return _0x3ea3e7['set']('Content-Range',_0x23ea97+'-'+_0x482bf5+'/'+_0x4f72f0)[_0xeb8b('0x2f')](_0x3bc764);}return null;};}function patchUpdates(_0xda373b){return function(_0x3bb1f7){try{jsonpatch['apply'](_0x3bb1f7,_0xda373b,!![]);}catch(_0x39028e){return BPromise['reject'](_0x39028e);}return _0x3bb1f7[_0xeb8b('0x34')]();};}function saveUpdates(_0x2a242a,_0x50f3ce){return function(_0x45d5e9){if(_0x45d5e9){return _0x45d5e9['update'](_0x2a242a)['then'](function(_0x183262){return _0x183262;});}return null;};}function removeEntity(_0x918118,_0x20d169){return function(_0x394790){if(_0x394790){return _0x394790['destroy']()['then'](function(){var _0x7dec06=_0x394790['get']({'plain':!![]});var _0xc367b3='MailAccounts';return db[_0xeb8b('0x35')][_0xeb8b('0x36')]({'where':{'type':_0xc367b3,'resourceId':_0x7dec06['id']}})['then'](function(){return _0x394790;});})[_0xeb8b('0x20')](function(){_0x918118[_0xeb8b('0x2e')](0xcc)[_0xeb8b('0x2d')]();});}};}function handleEntityNotFound(_0x403751,_0x1e49e4){return function(_0x4f84ff){if(!_0x4f84ff){_0x403751[_0xeb8b('0x2c')](0x194);}return _0x4f84ff;};}function handleError(_0xeb2bf2,_0x3966f8){_0x3966f8=_0x3966f8||0x1f4;return function(_0x910169){logger[_0xeb8b('0x26')](_0x910169['stack']);if(_0x910169['name']){delete _0x910169[_0xeb8b('0x37')];}_0xeb2bf2['status'](_0x3966f8)['send'](_0x910169);};}exports[_0xeb8b('0x38')]=function(_0x2216df,_0x5e7c61){var _0x4371cd={'include':[{'model':db[_0xeb8b('0x39')],'as':_0xeb8b('0x3a')},{'model':db[_0xeb8b('0x3b')],'as':'Smtp'},{'model':db['Pause'],'as':_0xeb8b('0x3c')}]},_0x5bf02c={},_0x53066b={'count':0x0,'rows':[]};var _0x2957ad=_['map'](db[_0xeb8b('0x3d')]['rawAttributes'],function(_0x2f4133){return{'name':_0x2f4133[_0xeb8b('0x3e')],'type':_0x2f4133[_0xeb8b('0x3f')][_0xeb8b('0x40')]};});_0x5bf02c[_0xeb8b('0x41')]=_['map'](_0x2957ad,_0xeb8b('0x37'));_0x5bf02c['query']=_[_0xeb8b('0x42')](_0x2216df[_0xeb8b('0x43')]);_0x5bf02c[_0xeb8b('0x44')]=_[_0xeb8b('0x45')](_0x5bf02c[_0xeb8b('0x41')],_0x5bf02c[_0xeb8b('0x43')]);_0x4371cd[_0xeb8b('0x46')]=_['intersection'](_0x5bf02c[_0xeb8b('0x41')],qs[_0xeb8b('0x47')](_0x2216df[_0xeb8b('0x43')][_0xeb8b('0x47')]));_0x4371cd[_0xeb8b('0x46')]=_0x4371cd[_0xeb8b('0x46')]['length']?_0x4371cd[_0xeb8b('0x46')]:_0x5bf02c[_0xeb8b('0x41')];if(!_0x2216df[_0xeb8b('0x43')][_0xeb8b('0x48')](_0xeb8b('0x49'))){_0x4371cd[_0xeb8b('0x32')]=qs[_0xeb8b('0x32')](_0x2216df[_0xeb8b('0x43')][_0xeb8b('0x32')]);_0x4371cd[_0xeb8b('0x30')]=qs[_0xeb8b('0x30')](_0x2216df[_0xeb8b('0x43')]['offset']);}_0x4371cd[_0xeb8b('0x4a')]=qs[_0xeb8b('0x4b')](_0x2216df[_0xeb8b('0x43')][_0xeb8b('0x4b')]);_0x4371cd['where']=qs[_0xeb8b('0x44')](_[_0xeb8b('0x4c')](_0x2216df[_0xeb8b('0x43')],_0x5bf02c[_0xeb8b('0x44')]),_0x2957ad);if(_0x2216df[_0xeb8b('0x43')][_0xeb8b('0x4d')]){_0x4371cd['where']=_['merge'](_0x4371cd['where'],{'$or':_[_0xeb8b('0x4e')](_0x2957ad,function(_0x5f1433){if(_0x5f1433['type']!==_0xeb8b('0x4f')){var _0x33c6aa={};_0x33c6aa[_0x5f1433[_0xeb8b('0x37')]]={'$like':'%'+_0x2216df[_0xeb8b('0x43')][_0xeb8b('0x4d')]+'%'};return _0x33c6aa;}})});}_0x4371cd=_[_0xeb8b('0x50')]({},_0x4371cd,_0x2216df[_0xeb8b('0x51')]);var _0x3f0c6e={'where':_0x4371cd['where']};return db[_0xeb8b('0x3d')][_0xeb8b('0x33')](_0x3f0c6e)[_0xeb8b('0x20')](function(_0x2d9388){_0x53066b[_0xeb8b('0x33')]=_0x2d9388;if(_0x2216df[_0xeb8b('0x43')]['includeAll']){_0x4371cd[_0xeb8b('0x52')]=[{'all':!![]}];}return db[_0xeb8b('0x3d')][_0xeb8b('0x53')](_0x4371cd);})['then'](function(_0x2b5179){_0x53066b[_0xeb8b('0x54')]=_0x2b5179;return _0x53066b;})['then'](respondWithFilteredResult(_0x5e7c61,_0x4371cd))['catch'](handleError(_0x5e7c61,null));};exports[_0xeb8b('0x55')]=function(_0x3d87e8,_0xb0c44a){var _0x21f7de={'raw':![],'where':{'id':_0x3d87e8[_0xeb8b('0x56')]['id']},'include':[{'model':db[_0xeb8b('0x39')],'as':_0xeb8b('0x3a')},{'model':db[_0xeb8b('0x3b')],'as':_0xeb8b('0x57')},{'model':db[_0xeb8b('0x58')],'as':'mandatoryDispositionPause'}]},_0x59c767={};_0x59c767[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db[_0xeb8b('0x3d')]['rawAttributes']);_0x59c767[_0xeb8b('0x43')]=_[_0xeb8b('0x42')](_0x3d87e8[_0xeb8b('0x43')]);_0x59c767[_0xeb8b('0x44')]=_[_0xeb8b('0x45')](_0x59c767[_0xeb8b('0x41')],_0x59c767['query']);_0x21f7de[_0xeb8b('0x46')]=_[_0xeb8b('0x45')](_0x59c767[_0xeb8b('0x41')],qs[_0xeb8b('0x47')](_0x3d87e8[_0xeb8b('0x43')]['fields']));_0x21f7de[_0xeb8b('0x46')]=_0x21f7de[_0xeb8b('0x46')][_0xeb8b('0x59')]?_0x21f7de[_0xeb8b('0x46')]:_0x59c767[_0xeb8b('0x41')];if(_0x3d87e8[_0xeb8b('0x43')][_0xeb8b('0x5a')]){_0x21f7de[_0xeb8b('0x52')]=[{'all':!![]}];}_0x21f7de=_[_0xeb8b('0x50')]({},_0x21f7de,_0x3d87e8['options']);return db[_0xeb8b('0x3d')]['find'](_0x21f7de)[_0xeb8b('0x20')](handleEntityNotFound(_0xb0c44a,null))[_0xeb8b('0x20')](respondWithResult(_0xb0c44a,null))[_0xeb8b('0x2b')](handleError(_0xb0c44a,null));};exports['update']=function(_0x34ed64,_0x1b3f4f){if(_0x34ed64[_0xeb8b('0x5b')]['id']){delete _0x34ed64['body']['id'];}return db[_0xeb8b('0x3d')][_0xeb8b('0x5c')]({'where':{'id':_0x34ed64[_0xeb8b('0x56')]['id']},'include':[{'model':db[_0xeb8b('0x39')],'as':_0xeb8b('0x3a')},{'model':db['MailServerOut'],'as':_0xeb8b('0x57')},{'model':db[_0xeb8b('0x58')],'as':_0xeb8b('0x3c')}]})[_0xeb8b('0x20')](handleEntityNotFound(_0x1b3f4f,null))[_0xeb8b('0x20')](saveUpdates(_0x34ed64[_0xeb8b('0x5b')],null))[_0xeb8b('0x20')](function(_0x4ee3b3){if(_0x4ee3b3&&_0x34ed64[_0xeb8b('0x5b')][_0xeb8b('0x3a')]){return db[_0xeb8b('0x39')][_0xeb8b('0x5d')](_0x34ed64['body'][_0xeb8b('0x3a')],{'where':{'MailAccountId':_0x4ee3b3['id']}})[_0xeb8b('0x20')](function(){return _0x4ee3b3;});}return _0x4ee3b3;})['then'](function(_0x3955c4){if(_0x3955c4&&_0x34ed64['body'][_0xeb8b('0x57')]){return db[_0xeb8b('0x3b')][_0xeb8b('0x5d')](_0x34ed64['body'][_0xeb8b('0x57')],{'where':{'MailAccountId':_0x3955c4['id']}})[_0xeb8b('0x20')](function(){return _0x3955c4;});}return _0x3955c4;})[_0xeb8b('0x20')](respondWithResult(_0x1b3f4f,null))[_0xeb8b('0x2b')](handleError(_0x1b3f4f,null));};exports['describe']=function(_0x154ffe,_0x3072ce){return db[_0xeb8b('0x3d')][_0xeb8b('0x5e')]()[_0xeb8b('0x20')](respondWithResult(_0x3072ce,null))['catch'](handleError(_0x3072ce,null));};exports[_0xeb8b('0x5f')]=function(_0x171bcd,_0x6e9f47,_0xdea08c){if(_0x171bcd['body']['id']){delete _0x171bcd[_0xeb8b('0x5b')]['id'];}return db[_0xeb8b('0x3d')]['find']({'where':{'id':_0x171bcd[_0xeb8b('0x56')]['id']}})['then'](handleEntityNotFound(_0x6e9f47,null))[_0xeb8b('0x20')](function(_0x322f81){if(_0x322f81){_0x171bcd[_0xeb8b('0x5b')][_0xeb8b('0x60')]=_0x322f81['id'];return db[_0xeb8b('0x61')][_0xeb8b('0x62')](_0x171bcd['body']);}})[_0xeb8b('0x20')](respondWithResult(_0x6e9f47,null))[_0xeb8b('0x2b')](handleError(_0x6e9f47,null));};exports[_0xeb8b('0x63')]=function(_0x443ba9,_0x19e6da,_0x13458d){var _0x350446={'raw':![],'where':{}};var _0x340b7e={};var _0x1ea9e0={'count':0x0,'rows':[]};return db[_0xeb8b('0x3d')][_0xeb8b('0x64')]({'where':{'id':_0x443ba9[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x19e6da,null))[_0xeb8b('0x20')](function(_0x5cc556){if(_0x5cc556){_0x340b7e[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db['Disposition'][_0xeb8b('0x65')]);_0x340b7e[_0xeb8b('0x43')]=_['keys'](_0x443ba9[_0xeb8b('0x43')]);_0x340b7e[_0xeb8b('0x44')]=_[_0xeb8b('0x45')](_0x340b7e['model'],_0x340b7e[_0xeb8b('0x43')]);_0x350446[_0xeb8b('0x46')]=_['intersection'](_0x340b7e['model'],qs[_0xeb8b('0x47')](_0x443ba9[_0xeb8b('0x43')]['fields']));_0x350446[_0xeb8b('0x46')]=_0x350446[_0xeb8b('0x46')]['length']?_0x350446[_0xeb8b('0x46')]:_0x340b7e[_0xeb8b('0x41')];if(!_0x443ba9[_0xeb8b('0x43')]['hasOwnProperty'](_0xeb8b('0x49'))){_0x350446[_0xeb8b('0x32')]=qs[_0xeb8b('0x32')](_0x443ba9[_0xeb8b('0x43')][_0xeb8b('0x32')]);_0x350446[_0xeb8b('0x30')]=qs['offset'](_0x443ba9[_0xeb8b('0x43')][_0xeb8b('0x30')]);}_0x350446['order']=qs['sort'](_0x443ba9[_0xeb8b('0x43')]['sort']);_0x350446['where']=qs[_0xeb8b('0x44')](_[_0xeb8b('0x4c')](_0x443ba9['query'],_0x340b7e[_0xeb8b('0x44')]));_0x350446['where']['MailAccountId']=_0x5cc556['id'];if(_0x443ba9[_0xeb8b('0x43')][_0xeb8b('0x4d')]){_0x350446[_0xeb8b('0x66')]=_[_0xeb8b('0x50')](_0x350446[_0xeb8b('0x66')],{'$or':_['map'](_0x350446[_0xeb8b('0x46')],function(_0x425fb5){var _0x511900={};_0x511900[_0x425fb5]={'$like':'%'+_0x443ba9['query'][_0xeb8b('0x4d')]+'%'};return _0x511900;})});}_0x350446=_[_0xeb8b('0x50')]({},_0x350446,_0x443ba9[_0xeb8b('0x51')]);return db[_0xeb8b('0x61')][_0xeb8b('0x33')]({'where':_0x350446['where']})[_0xeb8b('0x20')](function(_0x3357c9){_0x1ea9e0[_0xeb8b('0x33')]=_0x3357c9;if(_0x443ba9[_0xeb8b('0x43')][_0xeb8b('0x5a')]){_0x350446[_0xeb8b('0x52')]=[{'all':!![]}];}return db[_0xeb8b('0x61')][_0xeb8b('0x53')](_0x350446);})[_0xeb8b('0x20')](function(_0x416412){_0x1ea9e0[_0xeb8b('0x54')]=_0x416412;return _0x1ea9e0;});}})[_0xeb8b('0x20')](respondWithFilteredResult(_0x19e6da,_0x350446))[_0xeb8b('0x2b')](handleError(_0x19e6da,null));};exports['removeDispositions']=function(_0x1784a3,_0x1f7524,_0x1a0eb0){return db[_0xeb8b('0x3d')][_0xeb8b('0x5c')]({'where':{'id':_0x1784a3[_0xeb8b('0x56')]['id']}})['then'](handleEntityNotFound(_0x1f7524,null))[_0xeb8b('0x20')](function(_0x27fd8a){if(_0x27fd8a){return _0x27fd8a[_0xeb8b('0x67')](_0x1784a3['query']['ids']);}})['then'](respondWithStatusCode(_0x1f7524,null))[_0xeb8b('0x2b')](handleError(_0x1f7524,null));};exports['addAnswer']=function(_0xd45edf,_0x27e91f,_0x35ea77){if(_0xd45edf[_0xeb8b('0x5b')]['id']){delete _0xd45edf[_0xeb8b('0x5b')]['id'];}return db[_0xeb8b('0x3d')][_0xeb8b('0x5c')]({'where':{'id':_0xd45edf[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x27e91f,null))[_0xeb8b('0x20')](function(_0x2d7be2){if(_0x2d7be2){_0xd45edf['body'][_0xeb8b('0x60')]=_0x2d7be2['id'];return db[_0xeb8b('0x68')]['create'](_0xd45edf['body']);}})[_0xeb8b('0x20')](respondWithResult(_0x27e91f,null))[_0xeb8b('0x2b')](handleError(_0x27e91f,null));};exports['getAnswers']=function(_0x3eae2b,_0x39aa3f,_0x36db35){var _0x283305={'raw':![],'where':{}};var _0x38e875={};var _0x256302={'count':0x0,'rows':[]};return db['MailAccount'][_0xeb8b('0x64')]({'where':{'id':_0x3eae2b['params']['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x39aa3f,null))[_0xeb8b('0x20')](function(_0x4b239e){if(_0x4b239e){_0x38e875[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db[_0xeb8b('0x68')][_0xeb8b('0x65')]);_0x38e875[_0xeb8b('0x43')]=_['keys'](_0x3eae2b[_0xeb8b('0x43')]);_0x38e875[_0xeb8b('0x44')]=_['intersection'](_0x38e875[_0xeb8b('0x41')],_0x38e875[_0xeb8b('0x43')]);_0x283305['attributes']=_['intersection'](_0x38e875[_0xeb8b('0x41')],qs['fields'](_0x3eae2b[_0xeb8b('0x43')][_0xeb8b('0x47')]));_0x283305[_0xeb8b('0x46')]=_0x283305[_0xeb8b('0x46')][_0xeb8b('0x59')]?_0x283305[_0xeb8b('0x46')]:_0x38e875[_0xeb8b('0x41')];if(!_0x3eae2b[_0xeb8b('0x43')][_0xeb8b('0x48')](_0xeb8b('0x49'))){_0x283305[_0xeb8b('0x32')]=qs['limit'](_0x3eae2b[_0xeb8b('0x43')][_0xeb8b('0x32')]);_0x283305['offset']=qs[_0xeb8b('0x30')](_0x3eae2b[_0xeb8b('0x43')][_0xeb8b('0x30')]);}_0x283305[_0xeb8b('0x4a')]=qs[_0xeb8b('0x4b')](_0x3eae2b[_0xeb8b('0x43')][_0xeb8b('0x4b')]);_0x283305[_0xeb8b('0x66')]=qs[_0xeb8b('0x44')](_[_0xeb8b('0x4c')](_0x3eae2b[_0xeb8b('0x43')],_0x38e875['filters']));_0x283305[_0xeb8b('0x66')][_0xeb8b('0x60')]=_0x4b239e['id'];if(_0x3eae2b['query'][_0xeb8b('0x4d')]){_0x283305['where']=_[_0xeb8b('0x50')](_0x283305[_0xeb8b('0x66')],{'$or':_['map'](_0x283305[_0xeb8b('0x46')],function(_0x347cbc){var _0x8735b9={};_0x8735b9[_0x347cbc]={'$like':'%'+_0x3eae2b['query'][_0xeb8b('0x4d')]+'%'};return _0x8735b9;})});}_0x283305=_[_0xeb8b('0x50')]({},_0x283305,_0x3eae2b[_0xeb8b('0x51')]);return db[_0xeb8b('0x68')][_0xeb8b('0x33')]({'where':_0x283305[_0xeb8b('0x66')]})[_0xeb8b('0x20')](function(_0x5df17c){_0x256302[_0xeb8b('0x33')]=_0x5df17c;if(_0x3eae2b['query'][_0xeb8b('0x5a')]){_0x283305[_0xeb8b('0x52')]=[{'all':!![]}];}return db[_0xeb8b('0x68')][_0xeb8b('0x53')](_0x283305);})[_0xeb8b('0x20')](function(_0xe14bd2){_0x256302[_0xeb8b('0x54')]=_0xe14bd2;return _0x256302;});}})[_0xeb8b('0x20')](respondWithFilteredResult(_0x39aa3f,_0x283305))['catch'](handleError(_0x39aa3f,null));};exports[_0xeb8b('0x69')]=function(_0x55f932,_0x2e056c,_0x11418b){return db[_0xeb8b('0x3d')][_0xeb8b('0x5c')]({'where':{'id':_0x55f932[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x2e056c,null))[_0xeb8b('0x20')](function(_0x496fa6){if(_0x496fa6){return _0x496fa6['removeAnswers'](_0x55f932[_0xeb8b('0x43')][_0xeb8b('0x6a')]);}})[_0xeb8b('0x20')](respondWithStatusCode(_0x2e056c,null))[_0xeb8b('0x2b')](handleError(_0x2e056c,null));};exports[_0xeb8b('0x62')]=function(_0x2a9487,_0x4cbda1){var _0x24ccb3={'name':_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x37')],'key':_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x40')],'email':_0x2a9487[_0xeb8b('0x5b')]['email'],'ListId':_0x2a9487[_0xeb8b('0x5b')]['ListId'],'active':!_[_0xeb8b('0x6b')](_0x2a9487['body'][_0xeb8b('0x6c')])?_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x6c')]:!![],'description':_0x2a9487[_0xeb8b('0x5b')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xeb8b('0x6b')](_0x2a9487[_0xeb8b('0x5b')]['cservice'])){if(_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x6d')]){_0x24ccb3[_0xeb8b('0x3a')][_0xeb8b('0x6e')]=_0x24ccb3['Smtp'][_0xeb8b('0x6e')]=_0x2a9487['body'][_0xeb8b('0x6f')];_0x24ccb3[_0xeb8b('0x3a')][_0xeb8b('0x70')]=_0x24ccb3['Smtp'][_0xeb8b('0x71')]=_0x2a9487['body'][_0xeb8b('0x72')];}else{_0x24ccb3['Imap']['authentication']=_0x24ccb3[_0xeb8b('0x57')][_0xeb8b('0x73')]=![];}_0x24ccb3[_0xeb8b('0x3a')][_0xeb8b('0x74')]=_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x3a')][_0xeb8b('0x74')];_0x24ccb3[_0xeb8b('0x3a')]['port']=_0x2a9487['body'][_0xeb8b('0x3a')][_0xeb8b('0x75')];_0x24ccb3[_0xeb8b('0x57')]['host']=_0x2a9487['body'][_0xeb8b('0x57')][_0xeb8b('0x74')];_0x24ccb3['Smtp'][_0xeb8b('0x75')]=_0x2a9487['body'][_0xeb8b('0x57')]['port'];}else{_0x24ccb3['Imap'][_0xeb8b('0x76')]=_0x24ccb3[_0xeb8b('0x57')][_0xeb8b('0x76')]=_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x77')];_0x24ccb3[_0xeb8b('0x3a')][_0xeb8b('0x6e')]=_0x24ccb3[_0xeb8b('0x57')][_0xeb8b('0x6e')]=_0x2a9487[_0xeb8b('0x5b')][_0xeb8b('0x6f')];_0x24ccb3[_0xeb8b('0x3a')][_0xeb8b('0x70')]=_0x24ccb3['Smtp'][_0xeb8b('0x71')]=_0x2a9487[_0xeb8b('0x5b')]['cpassword'];}return db[_0xeb8b('0x3d')][_0xeb8b('0x62')](_0x24ccb3,{'include':[{'model':db[_0xeb8b('0x3b')],'as':_0xeb8b('0x57')},{'model':db[_0xeb8b('0x39')],'as':_0xeb8b('0x3a')}]})[_0xeb8b('0x20')](function(_0x39396b){var _0x4d1549=_0x2a9487[_0xeb8b('0x6e')][_0xeb8b('0x78')]({'plain':!![]});if(!_0x4d1549)throw new Error(_0xeb8b('0x79'));if(_0x4d1549[_0xeb8b('0x7a')]===_0xeb8b('0x6e')){var _0x157870=_0x39396b[_0xeb8b('0x78')]({'plain':!![]});return db[_0xeb8b('0x7b')][_0xeb8b('0x5c')]({'where':{'name':_0xeb8b('0x7c'),'userProfileId':_0x4d1549['userProfileId']},'raw':!![]})[_0xeb8b('0x20')](function(_0x18bc52){if(_0x18bc52&&_0x18bc52[_0xeb8b('0x7d')]===0x0){return db[_0xeb8b('0x35')][_0xeb8b('0x62')]({'name':_0x157870[_0xeb8b('0x37')],'resourceId':_0x157870['id'],'type':_0x18bc52[_0xeb8b('0x37')],'sectionId':_0x18bc52['id']},{})['then'](function(){return _0x39396b;});}else{return _0x39396b;}})[_0xeb8b('0x2b')](function(_0x418715){logger[_0xeb8b('0x26')](_0xeb8b('0x7e'),_0x418715);throw _0x418715;});}return _0x39396b;})[_0xeb8b('0x20')](respondWithResult(_0x4cbda1,0xc9))['catch'](handleError(_0x4cbda1,null));};exports[_0xeb8b('0x7f')]=function(_0x48bbad,_0x9357a6,_0x6ab1b0){return db['MailAccount'][_0xeb8b('0x64')]({'where':{'id':_0x48bbad[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x9357a6,null))[_0xeb8b('0x20')](function(_0x598ce0){if(_0x598ce0){return _0x598ce0[_0xeb8b('0x7f')]();}return null;})[_0xeb8b('0x20')](respondWithResult(_0x9357a6,null))[_0xeb8b('0x2b')](handleError(_0x9357a6,null));};exports[_0xeb8b('0x80')]=function(_0x49a5e7,_0x1b9337,_0x15387c){if(_0x49a5e7[_0xeb8b('0x5b')]['id']){delete _0x49a5e7[_0xeb8b('0x5b')]['id'];}return db[_0xeb8b('0x3d')][_0xeb8b('0x5c')]({'where':{'id':_0x49a5e7[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x1b9337,null))[_0xeb8b('0x20')](function(_0x2d6b49){if(_0x2d6b49){_0x49a5e7[_0xeb8b('0x5b')][_0xeb8b('0x60')]=_0x2d6b49['id'];return db[_0xeb8b('0x39')]['create'](_0x49a5e7[_0xeb8b('0x5b')]);}})[_0xeb8b('0x20')](respondWithResult(_0x1b9337,null))['catch'](handleError(_0x1b9337,null));};exports[_0xeb8b('0x81')]=function(_0x6fe0ab,_0x3d0e67,_0x2c206e){return db[_0xeb8b('0x3d')]['findOne']({'where':{'id':_0x6fe0ab[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x3d0e67,null))[_0xeb8b('0x20')](function(_0x5ada36){if(_0x5ada36){return _0x5ada36[_0xeb8b('0x82')](null);}return null;})[_0xeb8b('0x20')](respondWithStatusCode(_0x3d0e67,null))[_0xeb8b('0x2b')](handleError(_0x3d0e67,null));};exports[_0xeb8b('0x83')]=function(_0x353224,_0x1d5ba4,_0x3c0b7e){return db[_0xeb8b('0x3d')][_0xeb8b('0x64')]({'where':{'id':_0x353224[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x1d5ba4,null))['then'](function(_0x82fc09){if(_0x82fc09){return _0x82fc09[_0xeb8b('0x83')]();}return null;})[_0xeb8b('0x20')](respondWithResult(_0x1d5ba4,null))[_0xeb8b('0x2b')](handleError(_0x1d5ba4,null));};exports[_0xeb8b('0x84')]=function(_0x266570,_0x7c60ca,_0x1edde2){if(_0x266570[_0xeb8b('0x5b')]['id']){delete _0x266570[_0xeb8b('0x5b')]['id'];}return db['MailAccount'][_0xeb8b('0x5c')]({'where':{'id':_0x266570[_0xeb8b('0x56')]['id']}})['then'](handleEntityNotFound(_0x7c60ca,null))[_0xeb8b('0x20')](function(_0x28a82c){if(_0x28a82c){_0x266570[_0xeb8b('0x5b')]['MailAccountId']=_0x28a82c['id'];return db[_0xeb8b('0x3b')][_0xeb8b('0x62')](_0x266570[_0xeb8b('0x5b')]);}})[_0xeb8b('0x20')](respondWithResult(_0x7c60ca,null))[_0xeb8b('0x2b')](handleError(_0x7c60ca,null));};exports[_0xeb8b('0x85')]=function(_0x208adb,_0x4784d3,_0xf93977){return db[_0xeb8b('0x3d')][_0xeb8b('0x64')]({'where':{'id':_0x208adb[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x4784d3,null))['then'](function(_0xdf37e3){if(_0xdf37e3){return _0xdf37e3[_0xeb8b('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x4784d3,null))[_0xeb8b('0x2b')](handleError(_0x4784d3,null));};exports[_0xeb8b('0x87')]=function(_0x504a8d,_0x5e5ca2,_0xbba781){return db[_0xeb8b('0x88')][_0xeb8b('0x5c')]({'where':{'id':_0x504a8d['params']['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x5e5ca2,null))[_0xeb8b('0x20')](function(_0x39ba11){if(_0x39ba11){return _0x39ba11[_0xeb8b('0x87')](_0x504a8d[_0xeb8b('0x5b')][_0xeb8b('0x6a')],_['omit'](_0x504a8d[_0xeb8b('0x5b')],['ids','id'])||{});}})[_0xeb8b('0x20')](respondWithResult(_0x5e5ca2,null))[_0xeb8b('0x2b')](handleError(_0x5e5ca2,null));};exports[_0xeb8b('0x89')]=function(_0x16efd0,_0x10a5f5,_0xf011c6){var _0x327641={'raw':![],'where':{}};var _0x20bc7d={};var _0x121a9b={'count':0x0,'rows':[]};return db['MailAccount'][_0xeb8b('0x64')]({'where':{'id':_0x16efd0['params']['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x10a5f5,null))['then'](function(_0x242c79){if(_0x242c79){_0x20bc7d['model']=_[_0xeb8b('0x42')](db[_0xeb8b('0x88')][_0xeb8b('0x65')]);_0x20bc7d[_0xeb8b('0x43')]=_[_0xeb8b('0x42')](_0x16efd0[_0xeb8b('0x43')]);_0x20bc7d[_0xeb8b('0x44')]=_['intersection'](_0x20bc7d[_0xeb8b('0x41')],_0x20bc7d[_0xeb8b('0x43')]);_0x327641[_0xeb8b('0x46')]=_[_0xeb8b('0x45')](_0x20bc7d['model'],qs[_0xeb8b('0x47')](_0x16efd0['query'][_0xeb8b('0x47')]));_0x327641[_0xeb8b('0x46')]=_0x327641['attributes'][_0xeb8b('0x59')]?_0x327641[_0xeb8b('0x46')]:_0x20bc7d[_0xeb8b('0x41')];if(!_0x16efd0['query'][_0xeb8b('0x48')](_0xeb8b('0x49'))){_0x327641['limit']=qs['limit'](_0x16efd0[_0xeb8b('0x43')][_0xeb8b('0x32')]);_0x327641[_0xeb8b('0x30')]=qs[_0xeb8b('0x30')](_0x16efd0['query'][_0xeb8b('0x30')]);}_0x327641[_0xeb8b('0x4a')]=qs[_0xeb8b('0x4b')](_0x16efd0[_0xeb8b('0x43')][_0xeb8b('0x4b')]);_0x327641[_0xeb8b('0x66')]=qs[_0xeb8b('0x44')](_['pick'](_0x16efd0[_0xeb8b('0x43')],_0x20bc7d[_0xeb8b('0x44')]));_0x327641['where'][_0xeb8b('0x60')]=_0x242c79['id'];if(_0x16efd0[_0xeb8b('0x43')][_0xeb8b('0x4d')]){_0x327641['where']=_[_0xeb8b('0x50')](_0x327641['where'],{'$or':_[_0xeb8b('0x4e')](_0x327641[_0xeb8b('0x46')],function(_0x906b95){var _0x5c679a={};_0x5c679a[_0x906b95]={'$like':'%'+_0x16efd0['query'][_0xeb8b('0x4d')]+'%'};return _0x5c679a;})});}_0x327641=_['merge']({},_0x327641,_0x16efd0[_0xeb8b('0x51')]);return db['MailInteraction'][_0xeb8b('0x33')]({'where':_0x327641[_0xeb8b('0x66')]})[_0xeb8b('0x20')](function(_0x86f0db){_0x121a9b['count']=_0x86f0db;if(_0x16efd0[_0xeb8b('0x43')][_0xeb8b('0x5a')]){_0x327641['include']=[{'model':db[_0xeb8b('0x8a')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':['name','fullname',_0xeb8b('0x8b')],'required':![]},{'model':db[_0xeb8b('0x8c')],'as':_0xeb8b('0x8d'),'attributes':['id',_0xeb8b('0x37'),'color'],'where':_0x16efd0['query'][_0xeb8b('0x8e')]?{'id':_0x16efd0['query'][_0xeb8b('0x8e')]}:undefined,'required':_0x16efd0['query']['tag']?!![]:![]}];}return db[_0xeb8b('0x88')][_0xeb8b('0x53')](_0x327641);})[_0xeb8b('0x20')](function(_0x4a677f){_0x121a9b['rows']=_0x4a677f;return _0x121a9b;});}})[_0xeb8b('0x20')](respondWithFilteredResult(_0x10a5f5,_0x327641))['catch'](handleError(_0x10a5f5,null));};exports[_0xeb8b('0x8f')]=function(_0x4f6196,_0x1d5244,_0x55558f){return db[_0xeb8b('0x3d')][_0xeb8b('0x64')]({'where':{'id':_0x4f6196[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x1d5244,null))[_0xeb8b('0x20')](function(_0x489339){if(_0x489339){return db['sequelize'][_0xeb8b('0x90')](function(_0x324f64){return db['MailApplication'][_0xeb8b('0x36')]({'where':{'MailAccountId':_0x4f6196[_0xeb8b('0x56')]['id']},'transaction':_0x324f64})['then'](function(_0xeeaa2c){var _0x2f803c=_[_0xeb8b('0x4e')](_0x4f6196[_0xeb8b('0x5b')],function(_0x4e4743){_0x4e4743[_0xeb8b('0x60')]=_0x4f6196[_0xeb8b('0x56')]['id'];return _0x4e4743;});return db[_0xeb8b('0x91')][_0xeb8b('0x92')](_0x2f803c,{'transaction':_0x324f64});});})[_0xeb8b('0x20')](function(){return db[_0xeb8b('0x91')][_0xeb8b('0x93')]({'where':{'MailAccountId':_0x4f6196[_0xeb8b('0x56')]['id']},'order':_0xeb8b('0x94')});});}})['then'](respondWithResult(_0x1d5244,null))[_0xeb8b('0x2b')](handleError(_0x1d5244,null));};exports[_0xeb8b('0x95')]=function(_0x43aa4b,_0x3352f2,_0x587b27){var _0x3b5eaf={};var _0x419261={};var _0x71497b;var _0x4b90b8;return db['MailAccount'][_0xeb8b('0x64')]({'where':{'id':_0x43aa4b[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x3352f2,null))[_0xeb8b('0x20')](function(_0x345b15){if(_0x345b15){_0x71497b=_0x345b15;_0x419261[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db[_0xeb8b('0x91')][_0xeb8b('0x65')]);_0x419261[_0xeb8b('0x43')]=_['keys'](_0x43aa4b['query']);_0x419261['filters']=_[_0xeb8b('0x45')](_0x419261[_0xeb8b('0x41')],_0x419261[_0xeb8b('0x43')]);_0x3b5eaf[_0xeb8b('0x46')]=_['intersection'](_0x419261[_0xeb8b('0x41')],qs[_0xeb8b('0x47')](_0x43aa4b[_0xeb8b('0x43')][_0xeb8b('0x47')]));_0x3b5eaf[_0xeb8b('0x46')]=_0x3b5eaf[_0xeb8b('0x46')]['length']?_0x3b5eaf['attributes']:_0x419261[_0xeb8b('0x41')];_0x3b5eaf[_0xeb8b('0x4a')]=qs[_0xeb8b('0x4b')](_0x43aa4b[_0xeb8b('0x43')]['sort']);_0x3b5eaf[_0xeb8b('0x66')]=qs['filters'](_[_0xeb8b('0x4c')](_0x43aa4b[_0xeb8b('0x43')],_0x419261[_0xeb8b('0x44')]));if(_0x43aa4b[_0xeb8b('0x43')][_0xeb8b('0x4d')]){_0x3b5eaf[_0xeb8b('0x66')]=_['merge'](_0x3b5eaf['where'],{'$or':_['map'](_0x3b5eaf['attributes'],function(_0x4dc7be){var _0x3b376c={};_0x3b376c[_0x4dc7be]={'$like':'%'+_0x43aa4b['query'][_0xeb8b('0x4d')]+'%'};return _0x3b376c;})});}_0x3b5eaf=_[_0xeb8b('0x50')]({},_0x3b5eaf,_0x43aa4b[_0xeb8b('0x51')]);return _0x71497b[_0xeb8b('0x95')](_0x3b5eaf);}})[_0xeb8b('0x20')](function(_0x51f677){if(_0x51f677){_0x4b90b8=_0x51f677[_0xeb8b('0x59')];if(!_0x43aa4b[_0xeb8b('0x43')]['hasOwnProperty'](_0xeb8b('0x49'))){_0x3b5eaf[_0xeb8b('0x32')]=qs[_0xeb8b('0x32')](_0x43aa4b[_0xeb8b('0x43')]['limit']);_0x3b5eaf[_0xeb8b('0x30')]=qs['offset'](_0x43aa4b[_0xeb8b('0x43')][_0xeb8b('0x30')]);}return _0x71497b[_0xeb8b('0x95')](_0x3b5eaf);}})[_0xeb8b('0x20')](function(_0x4870d3){if(_0x4870d3){return _0x4870d3?{'count':_0x4b90b8,'rows':_0x4870d3}:null;}})[_0xeb8b('0x20')](respondWithResult(_0x3352f2,null))[_0xeb8b('0x2b')](handleError(_0x3352f2,null));};exports[_0xeb8b('0x96')]=function(_0x54bcb4,_0x212622,_0x4a99e0){var _0x3e48a1={'raw':!![],'where':{}};var _0x5c8dfc={};var _0xd7a5c2={'count':0x0,'rows':[]};return db[_0xeb8b('0x3d')][_0xeb8b('0x64')]({'where':{'id':_0x54bcb4['params']['id']}})['then'](handleEntityNotFound(_0x212622,null))[_0xeb8b('0x20')](function(_0x1545f1){if(_0x1545f1){_0x5c8dfc[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db['MailMessage'][_0xeb8b('0x65')]);_0x5c8dfc[_0xeb8b('0x43')]=_['keys'](_0x54bcb4['query']);_0x5c8dfc[_0xeb8b('0x44')]=_[_0xeb8b('0x45')](_0x5c8dfc[_0xeb8b('0x41')],_0x5c8dfc[_0xeb8b('0x43')]);_0x3e48a1[_0xeb8b('0x46')]=_[_0xeb8b('0x45')](_0x5c8dfc[_0xeb8b('0x41')],qs[_0xeb8b('0x47')](_0x54bcb4['query'][_0xeb8b('0x47')]));_0x3e48a1['attributes']=_0x3e48a1[_0xeb8b('0x46')]['length']?_0x3e48a1[_0xeb8b('0x46')]:_0x5c8dfc['model'];if(!_0x54bcb4[_0xeb8b('0x43')]['hasOwnProperty'](_0xeb8b('0x49'))){_0x3e48a1[_0xeb8b('0x32')]=qs[_0xeb8b('0x32')](_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x32')]);_0x3e48a1['offset']=qs[_0xeb8b('0x30')](_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x30')]);}_0x3e48a1['order']=qs[_0xeb8b('0x4b')](_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x4b')]);_0x3e48a1['where']=qs[_0xeb8b('0x44')](_[_0xeb8b('0x4c')](_0x54bcb4[_0xeb8b('0x43')],_0x5c8dfc[_0xeb8b('0x44')]));_0x3e48a1['where']['MailAccountId']=_0x1545f1['id'];if(_0x54bcb4['query']['filter']){_0x3e48a1[_0xeb8b('0x66')]=_[_0xeb8b('0x50')](_0x3e48a1[_0xeb8b('0x66')],{'$or':_[_0xeb8b('0x4e')](_0x3e48a1[_0xeb8b('0x46')],function(_0x35024e){var _0x16d2fd={};_0x16d2fd[_0x35024e]={'$like':'%'+_0x54bcb4[_0xeb8b('0x43')]['filter']+'%'};return _0x16d2fd;})});}if(_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x97')]){var _0x499fef=_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x97')][_0xeb8b('0x98')](',');var _0x182a59={};_0x182a59[_0x499fef[0x0]]={'$gte':moment(_0x499fef[0x1])[_0xeb8b('0x99')](_0xeb8b('0x9a'))};_0x3e48a1[_0xeb8b('0x66')]=_[_0xeb8b('0x50')](_0x3e48a1[_0xeb8b('0x66')],_0x182a59);}_0x3e48a1=_[_0xeb8b('0x50')]({},_0x3e48a1,_0x54bcb4[_0xeb8b('0x51')]);return db['MailMessage'][_0xeb8b('0x33')]({'where':_0x3e48a1[_0xeb8b('0x66')]})['then'](function(_0x378290){_0xd7a5c2['count']=_0x378290;if(_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x5a')]){_0x3e48a1['include']=[{'all':!![]}];}return db[_0xeb8b('0x9b')][_0xeb8b('0x53')](_0x3e48a1);})['then'](function(_0x37d3e2){if(_0x54bcb4[_0xeb8b('0x43')][_0xeb8b('0x9c')]===_0xeb8b('0x9d')){for(var _0x12222d=0x0;_0x12222d<_0x37d3e2[_0xeb8b('0x59')];_0x12222d++){_0x37d3e2[_0x12222d]['body']=juice(_0x37d3e2[_0x12222d]['body']);}}_0xd7a5c2[_0xeb8b('0x54')]=_0x37d3e2;return _0xd7a5c2;});}})['then'](respondWithFilteredResult(_0x212622,_0x3e48a1))['catch'](handleError(_0x212622,null));};exports[_0xeb8b('0x9e')]=function(_0x4ac6a6,_0x34efbe,_0x25ced3){var _0x27290d,_0x21f0ed={},_0x39cb6e;if(_0x4ac6a6[_0xeb8b('0x5b')]['to']){_0x39cb6e=_0x4ac6a6[_0xeb8b('0x5b')]['to'][_0xeb8b('0x98')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x4ac6a6[_0xeb8b('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xeb8b('0x9f'),'include':[{'model':db[_0xeb8b('0x8a')],'as':_0xeb8b('0xa0'),'where':{'email':_0x39cb6e},'limit':0x1,'order':[[_0xeb8b('0xa1'),_0xeb8b('0xa2')]]}]},{'model':db[_0xeb8b('0x3b')],'as':_0xeb8b('0x57'),'raw':!![]}]})['then'](handleEntityNotFound(_0x34efbe,null))[_0xeb8b('0x20')](function(_0x5f4f63){if(_0x5f4f63){_0x27290d=_0x5f4f63;if(_0x5f4f63['Smtp']){if(_[_0xeb8b('0x6b')](_0x4ac6a6[_0xeb8b('0x5b')][_0xeb8b('0xa3')])){_0x4ac6a6[_0xeb8b('0x5b')]['from']=util[_0xeb8b('0x99')](_0xeb8b('0xa4'),_0x5f4f63['name'],_0x5f4f63[_0xeb8b('0xa5')]||_0x5f4f63[_0xeb8b('0x57')][_0xeb8b('0x6e')]);}if(_0x4ac6a6[_0xeb8b('0x5b')]['attachments']&&_0x4ac6a6[_0xeb8b('0x5b')][_0xeb8b('0xa6')][_0xeb8b('0x59')]){for(var _0x3d8fb6=0x0;_0x3d8fb6<_0x4ac6a6[_0xeb8b('0x5b')]['attachments'][_0xeb8b('0x59')];_0x3d8fb6+=0x1){_0x4ac6a6[_0xeb8b('0x5b')][_0xeb8b('0xa6')][_0x3d8fb6]={'filename':_0x4ac6a6['body'][_0xeb8b('0xa6')][_0x3d8fb6]['name'],'path':path[_0xeb8b('0xa7')](config[_0xeb8b('0xa8')],_0xeb8b('0xa9'),_0x4ac6a6[_0xeb8b('0x5b')][_0xeb8b('0xa6')][_0x3d8fb6][_0xeb8b('0xaa')])};}}var _0x3db42f={'tls':{'rejectUnauthorized':![]}};if(_[_0xeb8b('0x6b')](_0x5f4f63['Smtp']['service'])){if(_0x5f4f63[_0xeb8b('0x57')][_0xeb8b('0x73')]){_0x3db42f['auth']={'user':_0x5f4f63[_0xeb8b('0x57')][_0xeb8b('0x6e')],'pass':_0x5f4f63['Smtp'][_0xeb8b('0x71')]};}_0x3db42f['host']=_0x5f4f63[_0xeb8b('0x57')]['host'];_0x3db42f[_0xeb8b('0x75')]=_0x5f4f63[_0xeb8b('0x57')][_0xeb8b('0x75')];_0x3db42f[_0xeb8b('0xab')]=_0x5f4f63['Smtp'][_0xeb8b('0xab')];}else{_0x3db42f[_0xeb8b('0x76')]=_0x5f4f63[_0xeb8b('0x57')]['service'];_0x3db42f[_0xeb8b('0xac')]={'user':_0x5f4f63[_0xeb8b('0x57')][_0xeb8b('0x6e')],'pass':_0x5f4f63[_0xeb8b('0x57')][_0xeb8b('0x71')]};}return respondWithRpcPromise(_0xeb8b('0xad'),_0xeb8b('0xae'),{'account':_0x3db42f,'message':_0x4ac6a6[_0xeb8b('0x5b')]});}else{throw new Error(_0xeb8b('0xaf'));}}})[_0xeb8b('0x20')](function(_0x322b13){if(_0x322b13){_0x21f0ed=_0x322b13;if(_0x27290d[_0xeb8b('0x9f')]){if(_0x27290d[_0xeb8b('0x9f')]['Contacts'][_0xeb8b('0x59')]){return _0x27290d[_0xeb8b('0x9f')][_0xeb8b('0xa0')][0x0];}else{return db[_0xeb8b('0x8a')][_0xeb8b('0x62')](_['defaults'](_0x4ac6a6[_0xeb8b('0x5b')],{'firstName':_0x4ac6a6['body']['to'],'email':_0x4ac6a6['body']['to'],'phone':_0x4ac6a6[_0xeb8b('0x5b')]['to'],'ListId':_0x27290d[_0xeb8b('0xb0')]}));}}else{throw new Error(_0xeb8b('0xaf'));}}})[_0xeb8b('0x20')](function(_0x376513){if(_0x376513){var _0x44eb7f={'UserId':_0x4ac6a6['user']['id'],'ContactId':_0x376513['id'],'MailAccountId':_0x27290d['id'],'inReplyTo':_0x21f0ed[_0xeb8b('0xb1')],'to':_0x4ac6a6[_0xeb8b('0x5b')][_0xeb8b('0xa3')],'cc':_0x4ac6a6[_0xeb8b('0x5b')]['cc'],'subject':_0x4ac6a6[_0xeb8b('0x5b')]['subject'],'attach':_0x4ac6a6[_0xeb8b('0x5b')]['attach'],'firstMsgDirection':_0xeb8b('0xb2'),'lastMsgAt':moment()['format'](_0xeb8b('0x9a')),'lastMsgDirection':'out','Messages':[_[_0xeb8b('0x50')](_0x4ac6a6[_0xeb8b('0x5b')],{'messageId':_0x21f0ed[_0xeb8b('0xb1')],'sentAt':moment()[_0xeb8b('0x99')](_0xeb8b('0x9a')),'read':!![],'MailAccountId':_0x27290d['id'],'UserId':_0x4ac6a6[_0xeb8b('0x6e')]['id'],'ContactId':_0x376513['id']})]};if(_0x4ac6a6[_0xeb8b('0x5b')][_0xeb8b('0xb3')]){_0x44eb7f=_['merge'](_0x44eb7f,_0x4ac6a6['body'][_0xeb8b('0xb3')]);}return db[_0xeb8b('0x88')][_0xeb8b('0x62')](_0x44eb7f,{'include':[{'model':db['MailMessage'],'as':_0xeb8b('0xb4')}]});}})['then'](respondWithResult(_0x34efbe,null))[_0xeb8b('0x2b')](handleError(_0x34efbe,null));};exports['verifySmtp']=function(_0x2bf192,_0x290776,_0x2414b0){return db[_0xeb8b('0x3d')]['find']({'where':{'id':_0x2bf192[_0xeb8b('0x56')]['id']},'include':[{'model':db[_0xeb8b('0x3b')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x290776,null))['then'](function(_0x4969f8){if(_0x4969f8&&_0x4969f8[_0xeb8b('0x57')]){var _0x21ffab={'id':_0x4969f8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4969f8[_0xeb8b('0x57')][_0xeb8b('0x76')]){_0x21ffab[_0xeb8b('0x76')]=_0x4969f8[_0xeb8b('0x57')]['service'];}else{_0x21ffab[_0xeb8b('0x74')]=_0x4969f8[_0xeb8b('0x57')][_0xeb8b('0x74')];_0x21ffab[_0xeb8b('0x75')]=_0x4969f8['Smtp']['port'];_0x21ffab[_0xeb8b('0xab')]=_0x4969f8[_0xeb8b('0x57')][_0xeb8b('0xab')];}if(_0x4969f8['Smtp'][_0xeb8b('0x73')]){_0x21ffab[_0xeb8b('0xac')]={'user':_0x4969f8[_0xeb8b('0x57')][_0xeb8b('0x6e')],'pass':_0x4969f8[_0xeb8b('0x57')][_0xeb8b('0x71')]};}return respondWithRpcPromise('VerifySmtp',_0xeb8b('0xb5'),{'account':_0x21ffab});}})['then'](respondWithResult(_0x290776,null))[_0xeb8b('0x2b')](handleError(_0x290776,null));};exports['destroy']=function(_0x30ab65,_0x523d97){return db['MailAccount'][_0xeb8b('0x5c')]({'where':{'id':_0x30ab65[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x523d97,null))[_0xeb8b('0x20')](function(_0xc7e056){if(_0xc7e056&&_0xc7e056[_0xeb8b('0x76')]){throw new db['Sequelize']['ValidationError'](_0xeb8b('0xb6'));}return _0xc7e056;})[_0xeb8b('0x20')](removeEntity(_0x523d97,null))[_0xeb8b('0x2b')](handleError(_0x523d97,null));};exports[_0xeb8b('0xb7')]=function(_0x31074f,_0x33888a,_0x3256a5){return db[_0xeb8b('0x3d')][_0xeb8b('0x5c')]({'where':{'id':_0x31074f[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x33888a,null))[_0xeb8b('0x20')](function(_0x417e11){if(_0x417e11){return _0x417e11[_0xeb8b('0xb7')](_0x31074f['body'][_0xeb8b('0x6a')],_[_0xeb8b('0xb8')](_0x31074f['body'],[_0xeb8b('0x6a'),'id'])||{})[_0xeb8b('0xb9')](function(_0x5a71d5){for(var _0x40193f=0x0;_0x40193f<_0x31074f[_0xeb8b('0x5b')][_0xeb8b('0x6a')][_0xeb8b('0x59')];_0x40193f+=0x1){socket[_0xeb8b('0xba')]('userMailAccount:save',{'UserId':Number(_0x31074f[_0xeb8b('0x5b')][_0xeb8b('0x6a')][_0x40193f]),'MailAccountId':Number(_0x31074f[_0xeb8b('0x56')]['id'])});}return _0x5a71d5;});}})[_0xeb8b('0x20')](respondWithResult(_0x33888a,null))[_0xeb8b('0x2b')](handleError(_0x33888a,null));};exports[_0xeb8b('0xbb')]=function(_0x1edc45,_0x5ecc79,_0x1b5ebc){return db[_0xeb8b('0x3d')]['find']({'where':{'id':_0x1edc45[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x5ecc79,null))[_0xeb8b('0x20')](function(_0x44b2fc){if(_0x44b2fc){return _0x44b2fc[_0xeb8b('0xbb')](_0x1edc45[_0xeb8b('0x43')][_0xeb8b('0x6a')])[_0xeb8b('0x20')](function(){if(_[_0xeb8b('0xbc')](_0x1edc45[_0xeb8b('0x43')][_0xeb8b('0x6a')])){for(var _0x183918=0x0;_0x183918<_0x1edc45[_0xeb8b('0x43')][_0xeb8b('0x6a')][_0xeb8b('0x59')];_0x183918+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x1edc45['query'][_0xeb8b('0x6a')][_0x183918]),'MailAccountId':Number(_0x1edc45[_0xeb8b('0x56')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x1edc45[_0xeb8b('0x43')][_0xeb8b('0x6a')]),'MailAccountId':Number(_0x1edc45[_0xeb8b('0x56')]['id'])});}});}})[_0xeb8b('0x20')](respondWithStatusCode(_0x5ecc79,null))['catch'](handleError(_0x5ecc79,null));};exports[_0xeb8b('0xbd')]=function(_0x3aac7d,_0x50dbba,_0x39cedb){var _0x5f285e={};var _0x14d10d={};var _0x28edc7;var _0x6874ad;return db[_0xeb8b('0x3d')][_0xeb8b('0x64')]({'where':{'id':_0x3aac7d[_0xeb8b('0x56')]['id']}})[_0xeb8b('0x20')](handleEntityNotFound(_0x50dbba,null))[_0xeb8b('0x20')](function(_0xa4ea2c){if(_0xa4ea2c){_0x28edc7=_0xa4ea2c;_0x14d10d[_0xeb8b('0x41')]=_[_0xeb8b('0x42')](db[_0xeb8b('0xbe')][_0xeb8b('0x65')]);_0x14d10d['query']=_[_0xeb8b('0x42')](_0x3aac7d['query']);_0x14d10d['filters']=_['intersection'](_0x14d10d[_0xeb8b('0x41')],_0x14d10d[_0xeb8b('0x43')]);_0x5f285e[_0xeb8b('0x46')]=_[_0xeb8b('0x45')](_0x14d10d[_0xeb8b('0x41')],qs[_0xeb8b('0x47')](_0x3aac7d[_0xeb8b('0x43')][_0xeb8b('0x47')]));_0x5f285e[_0xeb8b('0x46')]=_0x5f285e[_0xeb8b('0x46')][_0xeb8b('0x59')]?_0x5f285e[_0xeb8b('0x46')]:_0x14d10d[_0xeb8b('0x41')];_0x5f285e[_0xeb8b('0x4a')]=qs[_0xeb8b('0x4b')](_0x3aac7d[_0xeb8b('0x43')]['sort']);_0x5f285e['where']=qs[_0xeb8b('0x44')](_[_0xeb8b('0x4c')](_0x3aac7d[_0xeb8b('0x43')],_0x14d10d[_0xeb8b('0x44')]));if(_0x3aac7d[_0xeb8b('0x43')]['filter']){_0x5f285e[_0xeb8b('0x66')]=_['merge'](_0x5f285e[_0xeb8b('0x66')],{'$or':_[_0xeb8b('0x4e')](_0x5f285e[_0xeb8b('0x46')],function(_0x16699a){var _0x401d74={};_0x401d74[_0x16699a]={'$like':'%'+_0x3aac7d[_0xeb8b('0x43')][_0xeb8b('0x4d')]+'%'};return _0x401d74;})});}_0x5f285e=_[_0xeb8b('0x50')]({},_0x5f285e,_0x3aac7d[_0xeb8b('0x51')]);return _0x28edc7[_0xeb8b('0xbd')](_0x5f285e);}})['then'](function(_0x47040a){if(_0x47040a){_0x6874ad=_0x47040a[_0xeb8b('0x59')];if(!_0x3aac7d[_0xeb8b('0x43')]['hasOwnProperty'](_0xeb8b('0x49'))){_0x5f285e['limit']=qs['limit'](_0x3aac7d[_0xeb8b('0x43')][_0xeb8b('0x32')]);_0x5f285e[_0xeb8b('0x30')]=qs[_0xeb8b('0x30')](_0x3aac7d[_0xeb8b('0x43')][_0xeb8b('0x30')]);}return _0x28edc7[_0xeb8b('0xbd')](_0x5f285e);}})[_0xeb8b('0x20')](function(_0x37e84e){if(_0x37e84e){return _0x37e84e?{'count':_0x6874ad,'rows':_0x37e84e}:null;}})[_0xeb8b('0x20')](respondWithResult(_0x50dbba,null))[_0xeb8b('0x2b')](handleError(_0x50dbba,null));};
\ No newline at end of file
index 2592e2b..a443136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6209=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x6209,0x1e8));var _0x9620=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6209[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x9620('0x0'));var MailAccount=require(_0x9620('0x1'))['db'][_0x9620('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x9620('0x3')](0x0);var events={'afterCreate':_0x9620('0x4'),'afterUpdate':_0x9620('0x5'),'afterDestroy':_0x9620('0x6')};function emitEvent(_0x5deb40){return function(_0x2869e2,_0x17dc92,_0x2fa00b){MailAccountEvents['emit'](_0x5deb40+':'+_0x2869e2['id'],_0x2869e2);MailAccountEvents[_0x9620('0x7')](_0x5deb40,_0x2869e2);_0x2fa00b(null);};}for(var e in events){if(events[_0x9620('0x8')](e)){var event=events[e];MailAccount[_0x9620('0x9')](e,emitEvent(event));}}module[_0x9620('0xa')]=MailAccountEvents;
\ No newline at end of file
+var _0x2aa3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x152e9a,_0x34c579){var _0x42633e=function(_0x13c6d4){while(--_0x13c6d4){_0x152e9a['push'](_0x152e9a['shift']());}};_0x42633e(++_0x34c579);}(_0x2aa3,0x83));var _0x32aa=function(_0x41d559,_0x28a468){_0x41d559=_0x41d559-0x0;var _0x456832=_0x2aa3[_0x41d559];return _0x456832;};'use strict';var EventEmitter=require(_0x32aa('0x0'));var MailAccount=require(_0x32aa('0x1'))['db'][_0x32aa('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x32aa('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x32aa('0x4')};function emitEvent(_0x2b754c){return function(_0x13843c,_0x33612d,_0x22e989){MailAccountEvents[_0x32aa('0x5')](_0x2b754c+':'+_0x13843c['id'],_0x13843c);MailAccountEvents['emit'](_0x2b754c,_0x13843c);_0x22e989(null);};}for(var e in events){if(events[_0x32aa('0x6')](e)){var event=events[e];MailAccount[_0x32aa('0x7')](e,emitEvent(event));}}module[_0x32aa('0x8')]=MailAccountEvents;
\ No newline at end of file
index c761388..f5a2a0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9524=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailAccount.attributes','define','MailAccount','mail_accounts'];(function(_0x597560,_0x19c4db){var _0x35c31f=function(_0x300bd2){while(--_0x300bd2){_0x597560['push'](_0x597560['shift']());}};_0x35c31f(++_0x19c4db);}(_0x9524,0x138));var _0x4952=function(_0x54a679,_0x2a1df6){_0x54a679=_0x54a679-0x0;var _0x4b2c03=_0x9524[_0x54a679];return _0x4b2c03;};'use strict';var _=require(_0x4952('0x0'));var util=require(_0x4952('0x1'));var logger=require(_0x4952('0x2'))(_0x4952('0x3'));var moment=require(_0x4952('0x4'));var BPromise=require(_0x4952('0x5'));var rp=require(_0x4952('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4952('0x7'));var config=require(_0x4952('0x8'));var attributes=require(_0x4952('0x9'));module['exports']=function(_0x2e566d,_0x50036d){return _0x2e566d[_0x4952('0xa')](_0x4952('0xb'),attributes,{'tableName':_0x4952('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb27a=['MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define'];(function(_0x3048b3,_0x41ab04){var _0x2f3075=function(_0x3801ed){while(--_0x3801ed){_0x3048b3['push'](_0x3048b3['shift']());}};_0x2f3075(++_0x41ab04);}(_0xb27a,0xf2));var _0xab27=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0xb27a[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xab27('0x0'));var util=require(_0xab27('0x1'));var logger=require(_0xab27('0x2'))(_0xab27('0x3'));var moment=require(_0xab27('0x4'));var BPromise=require(_0xab27('0x5'));var rp=require(_0xab27('0x6'));var fs=require('fs');var path=require(_0xab27('0x7'));var rimraf=require(_0xab27('0x8'));var config=require(_0xab27('0x9'));var attributes=require(_0xab27('0xa'));module[_0xab27('0xb')]=function(_0x100cbb,_0x180b22){return _0x100cbb[_0xab27('0xc')](_0xab27('0xd'),attributes,{'tableName':_0xab27('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f7db77..922b1e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfe2=['result','GetMailAccount','MailAccount','findAll','options','where','attributes','limit','map','include','model','catch','ShowMailAccount','raw','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','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','account','CmList','List','Contacts','DESC','Applications','Smtp','get','omit','applications','list','orderBy','priority','asc','autoclose','push','length','*,*,*,*','defaults','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','User','name','UserId','unshift','agent','Start','startRouting','lodash','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','http','redis','localhost','socket.io-emitter','request','then','MailAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xdfe2,0x188));var _0x2dfe=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xdfe2[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x2dfe('0x0'));var util=require(_0x2dfe('0x1'));var moment=require(_0x2dfe('0x2'));var BPromise=require(_0x2dfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2dfe('0x4'));var logger=require(_0x2dfe('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2dfe('0x6'));var client=jayson['client'][_0x2dfe('0x7')]({'port':0x232c});config[_0x2dfe('0x8')]=_['defaults'](config['redis'],{'host':_0x2dfe('0x9'),'port':0x18eb});var socket=require(_0x2dfe('0xa'))(new Redis(config[_0x2dfe('0x8')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1c292d,_0x39e569,_0x2b5e78){return new BPromise(function(_0x3c4964,_0x633dbd){return client[_0x2dfe('0xb')](_0x1c292d,_0x2b5e78)[_0x2dfe('0xc')](function(_0x22a376){logger['info'](_0x2dfe('0xd'),_0x39e569,'request\x20sent');logger[_0x2dfe('0xe')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x39e569,'request\x20sent',JSON[_0x2dfe('0xf')](_0x22a376));if(_0x22a376[_0x2dfe('0x10')]){if(_0x22a376[_0x2dfe('0x10')][_0x2dfe('0x11')]===0x1f4){logger[_0x2dfe('0x10')](_0x2dfe('0xd'),_0x39e569,_0x22a376[_0x2dfe('0x10')][_0x2dfe('0x12')]);return _0x633dbd(_0x22a376[_0x2dfe('0x10')][_0x2dfe('0x12')]);}logger['error'](_0x2dfe('0xd'),_0x39e569,_0x22a376[_0x2dfe('0x10')][_0x2dfe('0x12')]);return _0x3c4964(_0x22a376[_0x2dfe('0x10')]['message']);}else{logger[_0x2dfe('0x13')]('MailAccount,\x20%s,\x20%s',_0x39e569,'request\x20sent');_0x3c4964(_0x22a376[_0x2dfe('0x14')][_0x2dfe('0x12')]);}})['catch'](function(_0x375f56){logger['error']('MailAccount,\x20%s,\x20%s',_0x39e569,_0x375f56);_0x633dbd(_0x375f56);});});}exports[_0x2dfe('0x15')]=function(_0x59d456){var _0x1f628b=this;return new Promise(function(_0x2b5b2e,_0x5456c3){return db[_0x2dfe('0x16')][_0x2dfe('0x17')]({'raw':_0x59d456['options']?_0x59d456[_0x2dfe('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x59d456[_0x2dfe('0x18')]?_0x59d456['options'][_0x2dfe('0x19')]||null:null,'attributes':_0x59d456[_0x2dfe('0x18')]?_0x59d456[_0x2dfe('0x18')][_0x2dfe('0x1a')]||null:null,'limit':_0x59d456['options']?_0x59d456[_0x2dfe('0x18')][_0x2dfe('0x1b')]||null:null,'include':_0x59d456['options']?_0x59d456[_0x2dfe('0x18')]['include']?_[_0x2dfe('0x1c')](_0x59d456['options'][_0x2dfe('0x1d')],function(_0x52c405){return{'model':db[_0x52c405[_0x2dfe('0x1e')]],'as':_0x52c405['as'],'attributes':_0x52c405[_0x2dfe('0x1a')],'include':_0x52c405[_0x2dfe('0x1d')]?_[_0x2dfe('0x1c')](_0x52c405[_0x2dfe('0x1d')],function(_0x475098){return{'model':db[_0x475098['model']],'as':_0x475098['as'],'attributes':_0x475098[_0x2dfe('0x1a')],'include':_0x475098['include']?_['map'](_0x475098[_0x2dfe('0x1d')],function(_0x185e1e){return{'model':db[_0x185e1e[_0x2dfe('0x1e')]],'as':_0x185e1e['as'],'attributes':_0x185e1e[_0x2dfe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2dfe('0xc')](function(_0x530b09){logger[_0x2dfe('0x13')]('GetMailAccount',_0x59d456);logger[_0x2dfe('0xe')](_0x2dfe('0x15'),_0x59d456,JSON['stringify'](_0x530b09));_0x2b5b2e(_0x530b09);})[_0x2dfe('0x1f')](function(_0x393ae7){logger[_0x2dfe('0x10')](_0x2dfe('0x15'),_0x393ae7[_0x2dfe('0x12')],_0x59d456);_0x5456c3(_0x1f628b[_0x2dfe('0x10')](0x1f4,_0x393ae7[_0x2dfe('0x12')]));});});};exports[_0x2dfe('0x20')]=function(_0x22885c){var _0xaf5eca=this;return new Promise(function(_0xd32323,_0x1fbbbd){return db[_0x2dfe('0x16')]['find']({'raw':_0x22885c['options']?_0x22885c['options'][_0x2dfe('0x21')]===undefined?!![]:![]:!![],'where':_0x22885c['options']?_0x22885c[_0x2dfe('0x18')]['where']||null:null,'attributes':_0x22885c[_0x2dfe('0x18')]?_0x22885c['options']['attributes']||null:null,'include':_0x22885c[_0x2dfe('0x18')]?_0x22885c['options'][_0x2dfe('0x1d')]?_[_0x2dfe('0x1c')](_0x22885c[_0x2dfe('0x18')][_0x2dfe('0x1d')],function(_0x10f9d5){return{'model':db[_0x10f9d5[_0x2dfe('0x1e')]],'as':_0x10f9d5['as'],'attributes':_0x10f9d5['attributes'],'include':_0x10f9d5[_0x2dfe('0x1d')]?_[_0x2dfe('0x1c')](_0x10f9d5[_0x2dfe('0x1d')],function(_0x27d4dc){return{'model':db[_0x27d4dc['model']],'as':_0x27d4dc['as'],'attributes':_0x27d4dc['attributes'],'include':_0x27d4dc['include']?_[_0x2dfe('0x1c')](_0x27d4dc['include'],function(_0x2182d8){return{'model':db[_0x2182d8['model']],'as':_0x2182d8['as'],'attributes':_0x2182d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x2dfe('0xc')](function(_0x9f62a6){logger[_0x2dfe('0x13')](_0x2dfe('0x20'),_0x22885c);logger[_0x2dfe('0xe')](_0x2dfe('0x20'),_0x22885c,JSON['stringify'](_0x9f62a6));_0xd32323(_0x9f62a6);})['catch'](function(_0x7b786b){logger[_0x2dfe('0x10')](_0x2dfe('0x20'),_0x7b786b[_0x2dfe('0x12')],_0x22885c);_0x1fbbbd(_0xaf5eca['error'](0x1f4,_0x7b786b[_0x2dfe('0x12')]));});});};exports[_0x2dfe('0x22')]=function(_0x354e0a){var _0x3d43de=this;return new Promise(function(_0x56f672,_0x5bcc9a){var _0x5e2070={'body':_0x354e0a[_0x2dfe('0x23')],'channel':'mail'};var _0x8c456e=_[_0x2dfe('0x24')](_[_0x2dfe('0x25')](db[_0x2dfe('0x26')][_0x2dfe('0x27')]),[_0x2dfe('0x28'),_0x2dfe('0x29'),_0x2dfe('0x2a'),_0x2dfe('0x2b')]);var _0x3c5e62=![];if(_0x354e0a[_0x2dfe('0x23')]['id']){delete _0x354e0a[_0x2dfe('0x23')]['id'];}if(_[_0x2dfe('0x2c')](_0x354e0a['body'][_0x2dfe('0x2d')])){return _0x5bcc9a(_0x3d43de[_0x2dfe('0x10')](0x1f4,_0x2dfe('0x2e')));}if(_['isNil'](_0x354e0a['body']['body'])||_0x354e0a['body'][_0x2dfe('0x23')]===''){return _0x5bcc9a(_0x3d43de['error'](0x1f4,_0x2dfe('0x2f')));}if(_['isNil'](_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x30')])){return _0x5bcc9a(_0x3d43de[_0x2dfe('0x10')](0x1f4,_0x2dfe('0x31')+_0x8c456e));}if(!_[_0x2dfe('0x32')](_0x8c456e,_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x30')])){return _0x5bcc9a(_0x3d43de[_0x2dfe('0x10')](0x1f4,_0x2dfe('0x33')+_0x8c456e));}var _0x1f548b={};_0x1f548b[_0x354e0a[_0x2dfe('0x23')]['mapKey']]=_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x2d')];return db[_0x2dfe('0x16')][_0x2dfe('0x34')]({'where':{'id':_0x354e0a[_0x2dfe('0x35')]['id']},'include':[{'model':db[_0x2dfe('0x36')],'as':_0x2dfe('0x37'),'include':[{'model':db[_0x2dfe('0x26')],'as':_0x2dfe('0x38'),'where':_0x1f548b,'limit':0x1,'order':[[_0x2dfe('0x29'),_0x2dfe('0x39')]]}]},{'model':db['MailApplication'],'as':_0x2dfe('0x3a')},{'model':db['MailServerOut'],'as':_0x2dfe('0x3b')}]})['then'](function(_0x5d41f4){if(_0x5d41f4&&_0x5d41f4['List']){var _0x1cddb2=_0x5d41f4[_0x2dfe('0x3c')]({'plain':!![]});_0x5e2070[_0x2dfe('0x35')]=_[_0x2dfe('0x3d')](_0x1cddb2,['Applications','List']);_0x5e2070[_0x2dfe('0x3e')]=_0x1cddb2[_0x2dfe('0x3a')];_0x5e2070[_0x2dfe('0x3f')]=_0x1cddb2['List'];_0x5e2070[_0x2dfe('0x3e')]=_[_0x2dfe('0x40')](_0x5e2070[_0x2dfe('0x3e')],[_0x2dfe('0x41')],[_0x2dfe('0x42')]);if(_0x5e2070[_0x2dfe('0x35')]&&_0x5e2070[_0x2dfe('0x35')][_0x2dfe('0x43')]){_0x5e2070[_0x2dfe('0x3e')][_0x2dfe('0x44')]({'id':0x0,'priority':_0x5e2070[_0x2dfe('0x3e')][_0x2dfe('0x45')]+0x1,'app':'close','appdata':'autoclose','interval':_0x2dfe('0x46')});}if(_0x5e2070[_0x2dfe('0x35')]['Applications']){delete _0x5e2070['account'][_0x2dfe('0x3a')];}if(_0x5e2070[_0x2dfe('0x35')][_0x2dfe('0x37')]){delete _0x5e2070[_0x2dfe('0x35')][_0x2dfe('0x37')];}if(_0x1cddb2[_0x2dfe('0x37')]['Contacts'][_0x2dfe('0x45')]){return _0x1cddb2['List']['Contacts'][0x0];}var _0x19a1b5=_[_0x2dfe('0x47')](_0x354e0a[_0x2dfe('0x23')],{'firstName':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x2d')],'ListId':_0x1cddb2['ListId']});_0x19a1b5[_0x354e0a[_0x2dfe('0x23')]['mapKey']]=_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x2d')];return db['CmContact'][_0x2dfe('0x48')](_0x19a1b5);}else{throw new Error(_0x2dfe('0x49'));}})[_0x2dfe('0xc')](function(_0x95edcb){_0x5e2070[_0x2dfe('0x4a')]=_0x95edcb;if(_0x95edcb){if(!_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')]['messageId']){_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')][_0x2dfe('0x4b')]=rs['generate']()+'\x20'+_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')][_0x2dfe('0x2d')];}var _0x53676a={'ContactId':_0x95edcb['id'],'MailAccountId':_0x354e0a['account']['id'],'inReplyTo':_0x354e0a[_0x2dfe('0x23')]['message'][_0x2dfe('0x4b')],'to':_0x354e0a[_0x2dfe('0x23')]['message'][_0x2dfe('0x2d')],'cc':_0x354e0a['body'][_0x2dfe('0x12')]['cc'],'subject':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')][_0x2dfe('0x4c')],'attach':_0x354e0a['body']['message'][_0x2dfe('0x4d')],'lastMsgAt':moment()[_0x2dfe('0x4e')](_0x2dfe('0x4f')),'lastMsgDirection':'in'};return db[_0x2dfe('0x50')][_0x2dfe('0x34')]({'where':{'closed':![],'MailAccountId':_0x354e0a['account']['id']},'include':[{'model':db[_0x2dfe('0x51')],'as':_0x2dfe('0x52'),'attributes':[_0x2dfe('0x4b')],'where':{'messageId':_0x354e0a[_0x2dfe('0x23')]['message'][_0x2dfe('0x53')]}}]})[_0x2dfe('0xc')](function(_0x2e4bd5){if(_0x2e4bd5){return[_0x2e4bd5,![]];}return db[_0x2dfe('0x50')][_0x2dfe('0x48')](_0x53676a)[_0x2dfe('0xc')](function(_0x43c736){return[_0x43c736,!![]];});});}else{throw new Error(_0x2dfe('0x54'));}})[_0x2dfe('0x55')](function(_0x5272cd,_0x54aa0e){if(_0x5272cd){_0x3c5e62=_0x54aa0e;if(!_0x54aa0e){return _0x5272cd[_0x2dfe('0x56')]({'inReplyTo':_0x354e0a['body'][_0x2dfe('0x12')][_0x2dfe('0x4b')],'to':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')]['from'],'cc':_0x354e0a[_0x2dfe('0x23')]['message']['cc'],'subject':_0x354e0a['body'][_0x2dfe('0x12')][_0x2dfe('0x4c')],'attach':_0x5272cd[_0x2dfe('0x4d')]?_0x5272cd[_0x2dfe('0x4d')]:_0x354e0a[_0x2dfe('0x23')]['message'][_0x2dfe('0x4d')],'substatus':null,'substatusAt':moment()[_0x2dfe('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x2dfe('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x5272cd;}}})['then'](function(_0x239fa0){_0x5e2070['interaction']=_0x239fa0[_0x2dfe('0x3c')]({'plain':!![]});_0x5e2070[_0x2dfe('0x57')]['created']=_0x3c5e62;return db['MailMessage'][_0x2dfe('0x48')]({'body':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x23')],'MailAccountId':_0x354e0a[_0x2dfe('0x35')]['id'],'MailInteractionId':_0x239fa0['id'],'direction':'in','ContactId':_0x5e2070[_0x2dfe('0x4a')]['id'],'messageId':_0x354e0a['body'][_0x2dfe('0x12')]['messageId'],'from':_0x354e0a['body'][_0x2dfe('0x12')][_0x2dfe('0x2d')],'to':_0x354e0a[_0x2dfe('0x23')]['message']['to'],'cc':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')]['cc'],'subject':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')]['subject'],'attach':_0x354e0a['body'][_0x2dfe('0x12')][_0x2dfe('0x4d')],'Attachments':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')][_0x2dfe('0x58')],'originTo':_0x354e0a['body']['message'][_0x2dfe('0x59')],'originCc':_0x354e0a['body'][_0x2dfe('0x12')][_0x2dfe('0x5a')],'bcc':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')]['bcc'],'ChatWebsiteId':_0x354e0a[_0x2dfe('0x23')]['message'][_0x2dfe('0x5b')]||null,'originChannel':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')][_0x2dfe('0x5c')]||_0x2dfe('0x5d'),'ChatOfflineMessageId':_0x354e0a[_0x2dfe('0x23')][_0x2dfe('0x12')][_0x2dfe('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x2dfe('0x5f')}]});})[_0x2dfe('0xc')](function(_0x3740ea){_0x5e2070[_0x2dfe('0x12')]=_0x3740ea;if(_0x5e2070[_0x2dfe('0x57')]['UserId']){return db[_0x2dfe('0x60')][_0x2dfe('0x34')]({'attributes':['id',_0x2dfe('0x61')],'where':{'id':_0x5e2070[_0x2dfe('0x57')][_0x2dfe('0x62')]}})[_0x2dfe('0xc')](function(_0x4697a6){if(_0x4697a6){_0x5e2070[_0x2dfe('0x3e')][_0x2dfe('0x63')]({'id':0x0,'priority':0x0,'app':_0x2dfe('0x64'),'appdata':_0x4697a6[_0x2dfe('0x61')]+','+(_0x5e2070[_0x2dfe('0x35')]['waitForTheAssignedAgent']||0xa),'interval':_0x2dfe('0x46')});}return respondWithRpcPromise(_0x2dfe('0x65'),_0x2dfe('0x66'),_0x5e2070);});}return respondWithRpcPromise('Start',_0x2dfe('0x66'),_0x5e2070);})[_0x2dfe('0xc')](function(_0x37752e){_0x56f672(_0x37752e);})[_0x2dfe('0x1f')](function(_0x5ddd67){_0x5bcc9a(_0x3d43de[_0x2dfe('0x10')](0x1f4,_0x5ddd67['message']));});});};
\ No newline at end of file
+var _0xc74a=['error','code','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','info','ShowMailAccount','MailAccount','find','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','DESC','MailApplication','Applications','Smtp','get','omit','applications','list','orderBy','asc','autoclose','push','close','*,*,*,*','List\x20not\x20found','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','create','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachments','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','./mailAccount.socket','register','request','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4105b4,_0x58b9cd){var _0x20f545=function(_0x4c8314){while(--_0x4c8314){_0x4105b4['push'](_0x4105b4['shift']());}};_0x20f545(++_0x58b9cd);}(_0xc74a,0x18b));var _0xac74=function(_0x4b3e90,_0x576be8){_0x4b3e90=_0x4b3e90-0x0;var _0x445f11=_0xc74a[_0x4b3e90];return _0x445f11;};'use strict';var _=require(_0xac74('0x0'));var util=require(_0xac74('0x1'));var moment=require(_0xac74('0x2'));var BPromise=require(_0xac74('0x3'));var rs=require(_0xac74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac74('0x5'))['db'];var utils=require(_0xac74('0x6'));var logger=require(_0xac74('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xac74('0x8'));var client=jayson[_0xac74('0x9')][_0xac74('0xa')]({'port':0x232c});config[_0xac74('0xb')]=_['defaults'](config[_0xac74('0xb')],{'host':_0xac74('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac74('0xb')]));require(_0xac74('0xd'))[_0xac74('0xe')](socket);function respondWithRpcPromise(_0xcf2f9b,_0x2c3bac,_0x460148){return new BPromise(function(_0x480046,_0x59438a){return client[_0xac74('0xf')](_0xcf2f9b,_0x460148)[_0xac74('0x10')](function(_0x6164cc){logger['info']('MailAccount,\x20%s,\x20%s',_0x2c3bac,_0xac74('0x11'));logger[_0xac74('0x12')](_0xac74('0x13'),_0x2c3bac,_0xac74('0x11'),JSON[_0xac74('0x14')](_0x6164cc));if(_0x6164cc[_0xac74('0x15')]){if(_0x6164cc[_0xac74('0x15')][_0xac74('0x16')]===0x1f4){logger[_0xac74('0x15')](_0xac74('0x17'),_0x2c3bac,_0x6164cc[_0xac74('0x15')][_0xac74('0x18')]);return _0x59438a(_0x6164cc['error'][_0xac74('0x18')]);}logger[_0xac74('0x15')](_0xac74('0x17'),_0x2c3bac,_0x6164cc[_0xac74('0x15')][_0xac74('0x18')]);return _0x480046(_0x6164cc['error']['message']);}else{logger['info'](_0xac74('0x17'),_0x2c3bac,_0xac74('0x11'));_0x480046(_0x6164cc[_0xac74('0x19')]['message']);}})[_0xac74('0x1a')](function(_0x1f4ac0){logger[_0xac74('0x15')](_0xac74('0x17'),_0x2c3bac,_0x1f4ac0);_0x59438a(_0x1f4ac0);});});}exports[_0xac74('0x1b')]=function(_0x5b9ae7){var _0x781e39=this;return new Promise(function(_0x1454d4,_0x3d1020){return db['MailAccount'][_0xac74('0x1c')]({'raw':_0x5b9ae7[_0xac74('0x1d')]?_0x5b9ae7['options'][_0xac74('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b9ae7[_0xac74('0x1d')]?_0x5b9ae7['options'][_0xac74('0x1f')]||null:null,'attributes':_0x5b9ae7[_0xac74('0x1d')]?_0x5b9ae7[_0xac74('0x1d')][_0xac74('0x20')]||null:null,'limit':_0x5b9ae7['options']?_0x5b9ae7[_0xac74('0x1d')][_0xac74('0x21')]||null:null,'include':_0x5b9ae7['options']?_0x5b9ae7['options'][_0xac74('0x22')]?_[_0xac74('0x23')](_0x5b9ae7[_0xac74('0x1d')]['include'],function(_0x588dc3){return{'model':db[_0x588dc3[_0xac74('0x24')]],'as':_0x588dc3['as'],'attributes':_0x588dc3['attributes'],'include':_0x588dc3[_0xac74('0x22')]?_[_0xac74('0x23')](_0x588dc3[_0xac74('0x22')],function(_0x1c1d42){return{'model':db[_0x1c1d42[_0xac74('0x24')]],'as':_0x1c1d42['as'],'attributes':_0x1c1d42['attributes'],'include':_0x1c1d42[_0xac74('0x22')]?_[_0xac74('0x23')](_0x1c1d42['include'],function(_0x2b560e){return{'model':db[_0x2b560e[_0xac74('0x24')]],'as':_0x2b560e['as'],'attributes':_0x2b560e[_0xac74('0x20')]};}):[]};}):[]};}):[]:[]})[_0xac74('0x10')](function(_0x3837e9){logger[_0xac74('0x25')]('GetMailAccount',_0x5b9ae7);logger['debug'](_0xac74('0x1b'),_0x5b9ae7,JSON['stringify'](_0x3837e9));_0x1454d4(_0x3837e9);})['catch'](function(_0x52740d){logger[_0xac74('0x15')](_0xac74('0x1b'),_0x52740d['message'],_0x5b9ae7);_0x3d1020(_0x781e39[_0xac74('0x15')](0x1f4,_0x52740d[_0xac74('0x18')]));});});};exports[_0xac74('0x26')]=function(_0x454eb6){var _0x3c89bf=this;return new Promise(function(_0x4e27a8,_0x48cc5e){return db[_0xac74('0x27')][_0xac74('0x28')]({'raw':_0x454eb6[_0xac74('0x1d')]?_0x454eb6[_0xac74('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x454eb6[_0xac74('0x1d')]?_0x454eb6[_0xac74('0x1d')][_0xac74('0x1f')]||null:null,'attributes':_0x454eb6[_0xac74('0x1d')]?_0x454eb6[_0xac74('0x1d')][_0xac74('0x20')]||null:null,'include':_0x454eb6['options']?_0x454eb6[_0xac74('0x1d')][_0xac74('0x22')]?_[_0xac74('0x23')](_0x454eb6[_0xac74('0x1d')][_0xac74('0x22')],function(_0x2ee05b){return{'model':db[_0x2ee05b['model']],'as':_0x2ee05b['as'],'attributes':_0x2ee05b[_0xac74('0x20')],'include':_0x2ee05b[_0xac74('0x22')]?_[_0xac74('0x23')](_0x2ee05b[_0xac74('0x22')],function(_0x4d54a8){return{'model':db[_0x4d54a8[_0xac74('0x24')]],'as':_0x4d54a8['as'],'attributes':_0x4d54a8[_0xac74('0x20')],'include':_0x4d54a8[_0xac74('0x22')]?_[_0xac74('0x23')](_0x4d54a8[_0xac74('0x22')],function(_0x394788){return{'model':db[_0x394788[_0xac74('0x24')]],'as':_0x394788['as'],'attributes':_0x394788[_0xac74('0x20')]};}):[]};}):[]};}):[]:[]})[_0xac74('0x10')](function(_0x1deb0e){logger[_0xac74('0x25')](_0xac74('0x26'),_0x454eb6);logger[_0xac74('0x12')](_0xac74('0x26'),_0x454eb6,JSON[_0xac74('0x14')](_0x1deb0e));_0x4e27a8(_0x1deb0e);})['catch'](function(_0xf44a1b){logger[_0xac74('0x15')](_0xac74('0x26'),_0xf44a1b['message'],_0x454eb6);_0x48cc5e(_0x3c89bf['error'](0x1f4,_0xf44a1b[_0xac74('0x18')]));});});};exports[_0xac74('0x29')]=function(_0x211cf1){var _0x34d617=this;return new Promise(function(_0x2c810f,_0x1daee2){var _0x514272={'body':_0x211cf1['body'],'channel':_0xac74('0x2a')};var _0x31c5f8=_[_0xac74('0x2b')](_[_0xac74('0x2c')](db[_0xac74('0x2d')][_0xac74('0x2e')]),[_0xac74('0x2f'),_0xac74('0x30'),_0xac74('0x31'),_0xac74('0x32')]);var _0x62d841=![];if(_0x211cf1[_0xac74('0x33')]['id']){delete _0x211cf1[_0xac74('0x33')]['id'];}if(_[_0xac74('0x34')](_0x211cf1['body'][_0xac74('0x35')])){return _0x1daee2(_0x34d617[_0xac74('0x15')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xac74('0x34')](_0x211cf1[_0xac74('0x33')][_0xac74('0x33')])||_0x211cf1[_0xac74('0x33')][_0xac74('0x33')]===''){return _0x1daee2(_0x34d617[_0xac74('0x15')](0x1f4,_0xac74('0x36')));}if(_[_0xac74('0x34')](_0x211cf1[_0xac74('0x33')][_0xac74('0x37')])){return _0x1daee2(_0x34d617[_0xac74('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31c5f8));}if(!_[_0xac74('0x38')](_0x31c5f8,_0x211cf1[_0xac74('0x33')][_0xac74('0x37')])){return _0x1daee2(_0x34d617[_0xac74('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x31c5f8));}var _0x225a94={};_0x225a94[_0x211cf1['body'][_0xac74('0x37')]]=_0x211cf1[_0xac74('0x33')][_0xac74('0x35')];return db[_0xac74('0x27')][_0xac74('0x28')]({'where':{'id':_0x211cf1[_0xac74('0x39')]['id']},'include':[{'model':db[_0xac74('0x3a')],'as':_0xac74('0x3b'),'include':[{'model':db[_0xac74('0x2d')],'as':_0xac74('0x3c'),'where':_0x225a94,'limit':0x1,'order':[[_0xac74('0x30'),_0xac74('0x3d')]]}]},{'model':db[_0xac74('0x3e')],'as':_0xac74('0x3f')},{'model':db['MailServerOut'],'as':_0xac74('0x40')}]})['then'](function(_0x2e1274){if(_0x2e1274&&_0x2e1274[_0xac74('0x3b')]){var _0x2f228a=_0x2e1274[_0xac74('0x41')]({'plain':!![]});_0x514272['account']=_[_0xac74('0x42')](_0x2f228a,[_0xac74('0x3f'),_0xac74('0x3b')]);_0x514272[_0xac74('0x43')]=_0x2f228a[_0xac74('0x3f')];_0x514272[_0xac74('0x44')]=_0x2f228a[_0xac74('0x3b')];_0x514272['applications']=_[_0xac74('0x45')](_0x514272[_0xac74('0x43')],['priority'],[_0xac74('0x46')]);if(_0x514272[_0xac74('0x39')]&&_0x514272['account'][_0xac74('0x47')]){_0x514272[_0xac74('0x43')][_0xac74('0x48')]({'id':0x0,'priority':_0x514272['applications']['length']+0x1,'app':_0xac74('0x49'),'appdata':_0xac74('0x47'),'interval':_0xac74('0x4a')});}if(_0x514272[_0xac74('0x39')][_0xac74('0x3f')]){delete _0x514272[_0xac74('0x39')]['Applications'];}if(_0x514272[_0xac74('0x39')][_0xac74('0x3b')]){delete _0x514272[_0xac74('0x39')][_0xac74('0x3b')];}if(_0x2f228a[_0xac74('0x3b')][_0xac74('0x3c')]['length']){return _0x2f228a[_0xac74('0x3b')][_0xac74('0x3c')][0x0];}var _0x4c383e=_['defaults'](_0x211cf1['body'],{'firstName':_0x211cf1['body']['from'],'ListId':_0x2f228a[_0xac74('0x32')]});_0x4c383e[_0x211cf1['body'][_0xac74('0x37')]]=_0x211cf1['body'][_0xac74('0x35')];return db[_0xac74('0x2d')]['create'](_0x4c383e);}else{throw new Error(_0xac74('0x4b'));}})[_0xac74('0x10')](function(_0x54034f){_0x514272['contact']=_0x54034f;if(_0x54034f){if(!_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x4c')]){_0x211cf1['body'][_0xac74('0x18')]['messageId']=rs[_0xac74('0x4d')]()+'\x20'+_0x211cf1['body'][_0xac74('0x18')][_0xac74('0x35')];}var _0x1b2547={'ContactId':_0x54034f['id'],'MailAccountId':_0x211cf1['account']['id'],'inReplyTo':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')]['messageId'],'to':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')]['from'],'cc':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')]['cc'],'subject':_0x211cf1['body'][_0xac74('0x18')][_0xac74('0x4e')],'attach':_0x211cf1[_0xac74('0x33')]['message'][_0xac74('0x4f')],'lastMsgAt':moment()[_0xac74('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0xac74('0x51')][_0xac74('0x28')]({'where':{'closed':![],'MailAccountId':_0x211cf1[_0xac74('0x39')]['id']},'include':[{'model':db[_0xac74('0x52')],'as':_0xac74('0x53'),'attributes':[_0xac74('0x4c')],'where':{'messageId':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')]['inReplyTo']}}]})[_0xac74('0x10')](function(_0x199992){if(_0x199992){return[_0x199992,![]];}return db[_0xac74('0x51')][_0xac74('0x54')](_0x1b2547)[_0xac74('0x10')](function(_0x582b56){return[_0x582b56,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xac74('0x55')](function(_0x2558e7,_0x3b50af){if(_0x2558e7){_0x62d841=_0x3b50af;if(!_0x3b50af){return _0x2558e7[_0xac74('0x56')]({'inReplyTo':_0x211cf1[_0xac74('0x33')]['message'][_0xac74('0x4c')],'to':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x35')],'cc':_0x211cf1['body'][_0xac74('0x18')]['cc'],'subject':_0x211cf1['body'][_0xac74('0x18')]['subject'],'attach':_0x2558e7[_0xac74('0x4f')]?_0x2558e7['attach']:_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x4f')],'substatus':null,'substatusAt':moment()['format'](_0xac74('0x57')),'lastMsgAt':moment()[_0xac74('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x2558e7;}}})[_0xac74('0x10')](function(_0x4aa49b){_0x514272['interaction']=_0x4aa49b[_0xac74('0x41')]({'plain':!![]});_0x514272[_0xac74('0x58')][_0xac74('0x59')]=_0x62d841;return db[_0xac74('0x52')][_0xac74('0x54')]({'body':_0x211cf1[_0xac74('0x33')][_0xac74('0x33')],'MailAccountId':_0x211cf1[_0xac74('0x39')]['id'],'MailInteractionId':_0x4aa49b['id'],'direction':'in','ContactId':_0x514272[_0xac74('0x5a')]['id'],'messageId':_0x211cf1[_0xac74('0x33')]['message'][_0xac74('0x4c')],'from':_0x211cf1['body']['message'][_0xac74('0x35')],'to':_0x211cf1['body'][_0xac74('0x18')]['to'],'cc':_0x211cf1[_0xac74('0x33')]['message']['cc'],'subject':_0x211cf1['body'][_0xac74('0x18')]['subject'],'attach':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x4f')],'Attachments':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x5b')],'originTo':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x5c')],'originCc':_0x211cf1['body'][_0xac74('0x18')][_0xac74('0x5d')],'bcc':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x5e')],'ChatWebsiteId':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')]['ChatWebsiteId']||null,'originChannel':_0x211cf1[_0xac74('0x33')]['message'][_0xac74('0x5f')]||'Email','ChatOfflineMessageId':_0x211cf1[_0xac74('0x33')][_0xac74('0x18')][_0xac74('0x60')]||null},{'include':[{'model':db['Attachment'],'as':_0xac74('0x61')}]});})[_0xac74('0x10')](function(_0x4109e5){_0x514272[_0xac74('0x18')]=_0x4109e5;if(_0x514272[_0xac74('0x58')]['UserId']){return db['User'][_0xac74('0x28')]({'attributes':['id',_0xac74('0x62')],'where':{'id':_0x514272[_0xac74('0x58')][_0xac74('0x63')]}})[_0xac74('0x10')](function(_0x4f7eee){if(_0x4f7eee){_0x514272[_0xac74('0x43')][_0xac74('0x64')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4f7eee[_0xac74('0x62')]+','+(_0x514272[_0xac74('0x39')][_0xac74('0x65')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xac74('0x66'),_0xac74('0x67'),_0x514272);});}return respondWithRpcPromise(_0xac74('0x66'),'startRouting',_0x514272);})[_0xac74('0x10')](function(_0x316969){_0x2c810f(_0x316969);})[_0xac74('0x1a')](function(_0x557eaf){_0x1daee2(_0x34d617[_0xac74('0x15')](0x1f4,_0x557eaf[_0xac74('0x18')]));});});};
\ No newline at end of file
index 406aa37..c044dfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f2b=['./mailAccount.events','remove','update','emit','mailAccount:'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x3f2b,0x1f4));var _0xb3f2=function(_0x506ac2,_0x2aaffc){_0x506ac2=_0x506ac2-0x0;var _0x369cca=_0x3f2b[_0x506ac2];return _0x369cca;};'use strict';var MailAccountEvents=require(_0xb3f2('0x0'));var events=['save',_0xb3f2('0x1'),_0xb3f2('0x2')];function createListener(_0x17fbeb,_0x591f4a){return function(_0x95c4cf){_0x591f4a[_0xb3f2('0x3')](_0x17fbeb,_0x95c4cf);};}function removeListener(_0x256707,_0x32ca97){return function(){MailAccountEvents['removeListener'](_0x256707,_0x32ca97);};}exports['register']=function(_0x4e3265){for(var _0x1be817=0x0,_0x341b53=events['length'];_0x1be817<_0x341b53;_0x1be817++){var _0x2bbf7f=events[_0x1be817];var _0x35e243=createListener(_0xb3f2('0x4')+_0x2bbf7f,_0x4e3265);MailAccountEvents['on'](_0x2bbf7f,_0x35e243);}};
\ No newline at end of file
+var _0xe4f4=['remove','emit','removeListener','length','mailAccount:','save'];(function(_0x44af93,_0x45fa15){var _0x22eef3=function(_0x53dc6f){while(--_0x53dc6f){_0x44af93['push'](_0x44af93['shift']());}};_0x22eef3(++_0x45fa15);}(_0xe4f4,0x89));var _0x4e4f=function(_0x2989ef,_0x353d45){_0x2989ef=_0x2989ef-0x0;var _0x25c7dd=_0xe4f4[_0x2989ef];return _0x25c7dd;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x4e4f('0x0'),_0x4e4f('0x1'),'update'];function createListener(_0x1c0b84,_0x12e14b){return function(_0x3df806){_0x12e14b[_0x4e4f('0x2')](_0x1c0b84,_0x3df806);};}function removeListener(_0x413fca,_0xa5adec){return function(){MailAccountEvents[_0x4e4f('0x3')](_0x413fca,_0xa5adec);};}exports['register']=function(_0x404dfb){for(var _0x1de125=0x0,_0x50afc4=events[_0x4e4f('0x4')];_0x1de125<_0x50afc4;_0x1de125++){var _0x411cc8=events[_0x1de125];var _0x4c4a5a=createListener(_0x4e4f('0x5')+_0x411cc8,_0x404dfb);MailAccountEvents['on'](_0x411cc8,_0x4c4a5a);}};
\ No newline at end of file
index 42955ac..a6f3757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa47d=['show','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x54ef39,_0x348cb1){var _0x4f0958=function(_0x52c3d4){while(--_0x52c3d4){_0x54ef39['push'](_0x54ef39['shift']());}};_0x4f0958(++_0x348cb1);}(_0xa47d,0x1d5));var _0xda47=function(_0x263391,_0x365cba){_0x263391=_0x263391-0x0;var _0x326791=_0xa47d[_0x263391];return _0x326791;};'use strict';var multer=require('multer');var util=require(_0xda47('0x0'));var path=require(_0xda47('0x1'));var timeout=require(_0xda47('0x2'));var express=require(_0xda47('0x3'));var router=express[_0xda47('0x4')]();var fs_extra=require(_0xda47('0x5'));var auth=require(_0xda47('0x6'));var interaction=require(_0xda47('0x7'));var config=require(_0xda47('0x8'));var controller=require('./mailApplication.controller');router[_0xda47('0x9')]('/:id',auth[_0xda47('0xa')](),controller[_0xda47('0xb')]);router['put'](_0xda47('0xc'),auth[_0xda47('0xa')](),controller[_0xda47('0xd')]);router[_0xda47('0xe')](_0xda47('0xc'),auth[_0xda47('0xa')](),controller[_0xda47('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x4f5d=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put','update'];(function(_0x3a7e48,_0x1e4521){var _0x193c34=function(_0x590571){while(--_0x590571){_0x3a7e48['push'](_0x3a7e48['shift']());}};_0x193c34(++_0x1e4521);}(_0x4f5d,0x120));var _0xd4f5=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4f5d[_0x565c49];return _0x20ca34;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd4f5('0x0'));var timeout=require(_0xd4f5('0x1'));var express=require(_0xd4f5('0x2'));var router=express[_0xd4f5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd4f5('0x4'));var config=require(_0xd4f5('0x5'));var controller=require(_0xd4f5('0x6'));router['get'](_0xd4f5('0x7'),auth[_0xd4f5('0x8')](),controller[_0xd4f5('0x9')]);router[_0xd4f5('0xa')]('/:id',auth[_0xd4f5('0x8')](),controller[_0xd4f5('0xb')]);router[_0xd4f5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xd4f5('0xd')]);module[_0xd4f5('0xe')]=router;
\ No newline at end of file
index 497a386..d2e7668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1467=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x5e71b4,_0xe270b5){var _0x18f5d1=function(_0x40f9e6){while(--_0x40f9e6){_0x5e71b4['push'](_0x5e71b4['shift']());}};_0x18f5d1(++_0xe270b5);}(_0x1467,0xc3));var _0x7146=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x1467[_0x38987f];return _0x4cb697;};'use strict';var Sequelize=require(_0x7146('0x0'));module[_0x7146('0x1')]={'priority':{'type':Sequelize[_0x7146('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7146('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7146('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7146('0x5')}};
\ No newline at end of file
+var _0xceab=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5bbb58,_0x176f96){var _0x5df0ec=function(_0x5bcce2){while(--_0x5bcce2){_0x5bbb58['push'](_0x5bbb58['shift']());}};_0x5df0ec(++_0x176f96);}(_0xceab,0x103));var _0xbcea=function(_0x30877c,_0x400e88){_0x30877c=_0x30877c-0x0;var _0x463d3a=_0xceab[_0x30877c];return _0x463d3a;};'use strict';var Sequelize=require(_0xbcea('0x0'));module[_0xbcea('0x1')]={'priority':{'type':Sequelize[_0xbcea('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbcea('0x3')],'allowNull':![],'defaultValue':_0xbcea('0x4')},'appdata':{'type':Sequelize[_0xbcea('0x5')]()},'description':{'type':Sequelize[_0xbcea('0x3')]},'interval':{'type':Sequelize[_0xbcea('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 0553bbd..b6eaebb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['attributes','length','include','merge','find','catch','body','params','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','show','model','MailApplication','query','keys','intersection','fields'];(function(_0x286c17,_0x51742e){var _0x52f89c=function(_0xff55ba){while(--_0xff55ba){_0x286c17['push'](_0x286c17['shift']());}};_0x52f89c(++_0x51742e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x0d8b('0x0'));var rimraf=require(_0x0d8b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d8b('0x2'));var BPromise=require(_0x0d8b('0x3'));var Mustache=require(_0x0d8b('0x4'));var util=require(_0x0d8b('0x5'));var path=require(_0x0d8b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d8b('0x7'));var fs=require('fs');var fs_extra=require(_0x0d8b('0x8'));var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0xc'));var querystring=require(_0x0d8b('0xd'));var Papa=require(_0x0d8b('0xe'));var Redis=require(_0x0d8b('0xf'));var authService=require(_0x0d8b('0x10'));var qs=require(_0x0d8b('0x11'));var as=require(_0x0d8b('0x12'));var hardwareService=require(_0x0d8b('0x13'));var logger=require('../../config/logger')(_0x0d8b('0x14'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x15'));var licenseUtil=require(_0x0d8b('0x16'));var db=require(_0x0d8b('0x17'))['db'];function respondWithStatusCode(_0x92cdd8,_0x35a07b){_0x35a07b=_0x35a07b||0xcc;return function(_0x32bb1a){if(_0x32bb1a){return _0x92cdd8[_0x0d8b('0x18')](_0x35a07b);}return _0x92cdd8[_0x0d8b('0x19')](_0x35a07b)[_0x0d8b('0x1a')]();};}function respondWithResult(_0x2ce75e,_0x5ad086){_0x5ad086=_0x5ad086||0xc8;return function(_0xe65334){if(_0xe65334){return _0x2ce75e[_0x0d8b('0x19')](_0x5ad086)[_0x0d8b('0x1b')](_0xe65334);}};}function respondWithFilteredResult(_0x4f6f21,_0x23eb7b){return function(_0xa86349){if(_0xa86349){var _0x17f7df=typeof _0x23eb7b[_0x0d8b('0x1c')]===_0x0d8b('0x1d')&&typeof _0x23eb7b['limit']===_0x0d8b('0x1d');var _0x4586c2=_0xa86349[_0x0d8b('0x1e')];var _0x5fecbd=_0x17f7df?0x0:_0x23eb7b[_0x0d8b('0x1c')];var _0x18dd2d=_0x17f7df?_0xa86349[_0x0d8b('0x1e')]:_0x23eb7b[_0x0d8b('0x1c')]+_0x23eb7b['limit'];var _0x27512e;if(_0x18dd2d>=_0x4586c2){_0x18dd2d=_0x4586c2;_0x27512e=0xc8;}else{_0x27512e=0xce;}_0x4f6f21[_0x0d8b('0x19')](_0x27512e);return _0x4f6f21[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x5fecbd+'-'+_0x18dd2d+'/'+_0x4586c2)[_0x0d8b('0x1b')](_0xa86349);}return null;};}function patchUpdates(_0x5b709c){return function(_0x393beb){try{jsonpatch[_0x0d8b('0x21')](_0x393beb,_0x5b709c,!![]);}catch(_0x50ec1e){return BPromise['reject'](_0x50ec1e);}return _0x393beb[_0x0d8b('0x22')]();};}function saveUpdates(_0x54a9a7,_0x56c729){return function(_0x5527d8){if(_0x5527d8){return _0x5527d8[_0x0d8b('0x23')](_0x54a9a7)[_0x0d8b('0x24')](function(_0x214778){return _0x214778;});}return null;};}function removeEntity(_0x38efc8,_0x221071){return function(_0x2c64e2){if(_0x2c64e2){return _0x2c64e2[_0x0d8b('0x25')]()[_0x0d8b('0x24')](function(){_0x38efc8[_0x0d8b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe8bbee,_0x4463ee){return function(_0x5363e3){if(!_0x5363e3){_0xe8bbee[_0x0d8b('0x18')](0x194);}return _0x5363e3;};}function handleError(_0x4a0ae4,_0x3dd149){_0x3dd149=_0x3dd149||0x1f4;return function(_0x234bdd){logger[_0x0d8b('0x26')](_0x234bdd['stack']);if(_0x234bdd['name']){delete _0x234bdd[_0x0d8b('0x27')];}_0x4a0ae4[_0x0d8b('0x19')](_0x3dd149)['send'](_0x234bdd);};}exports[_0x0d8b('0x28')]=function(_0x59aa83,_0x1b2b59){var _0x4b59e5={'raw':!![],'where':{'id':_0x59aa83['params']['id']}},_0x97050a={};_0x97050a[_0x0d8b('0x29')]=_['keys'](db[_0x0d8b('0x2a')]['rawAttributes']);_0x97050a[_0x0d8b('0x2b')]=_[_0x0d8b('0x2c')](_0x59aa83[_0x0d8b('0x2b')]);_0x97050a['filters']=_['intersection'](_0x97050a['model'],_0x97050a[_0x0d8b('0x2b')]);_0x4b59e5['attributes']=_[_0x0d8b('0x2d')](_0x97050a['model'],qs['fields'](_0x59aa83[_0x0d8b('0x2b')][_0x0d8b('0x2e')]));_0x4b59e5[_0x0d8b('0x2f')]=_0x4b59e5[_0x0d8b('0x2f')][_0x0d8b('0x30')]?_0x4b59e5[_0x0d8b('0x2f')]:_0x97050a[_0x0d8b('0x29')];if(_0x59aa83[_0x0d8b('0x2b')]['includeAll']){_0x4b59e5[_0x0d8b('0x31')]=[{'all':!![]}];}_0x4b59e5=_[_0x0d8b('0x32')]({},_0x4b59e5,_0x59aa83['options']);return db[_0x0d8b('0x2a')][_0x0d8b('0x33')](_0x4b59e5)[_0x0d8b('0x24')](handleEntityNotFound(_0x1b2b59,null))['then'](respondWithResult(_0x1b2b59,null))[_0x0d8b('0x34')](handleError(_0x1b2b59,null));};exports[_0x0d8b('0x23')]=function(_0x206157,_0x31ceba){if(_0x206157[_0x0d8b('0x35')]['id']){delete _0x206157['body']['id'];}return db[_0x0d8b('0x2a')][_0x0d8b('0x33')]({'where':{'id':_0x206157['params']['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x31ceba,null))[_0x0d8b('0x24')](saveUpdates(_0x206157[_0x0d8b('0x35')],null))[_0x0d8b('0x24')](respondWithResult(_0x31ceba,null))[_0x0d8b('0x34')](handleError(_0x31ceba,null));};exports['destroy']=function(_0x497a71,_0x41b4f9){return db['MailApplication']['find']({'where':{'id':_0x497a71[_0x0d8b('0x36')]['id']}})[_0x0d8b('0x24')](handleEntityNotFound(_0x41b4f9,null))[_0x0d8b('0x24')](removeEntity(_0x41b4f9,null))[_0x0d8b('0x34')](handleError(_0x41b4f9,null));};
\ No newline at end of file
+var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x11a962,_0x3cc338){_0x11a962=_0x11a962-0x0;var _0x55d423=_0xaa88[_0x11a962];return _0x55d423;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));};
\ No newline at end of file
index 2a455f1..07d5ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b7a=['utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','request-promise','path','./mailApplication.attributes','exports','MailApplication','mail_applications'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x9b7a,0xde));var _0xa9b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xa9b7('0x0'));var logger=require('../../config/logger')(_0xa9b7('0x1'));var moment=require('moment');var BPromise=require(_0xa9b7('0x2'));var rp=require(_0xa9b7('0x3'));var fs=require('fs');var path=require(_0xa9b7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9b7('0x5'));module[_0xa9b7('0x6')]=function(_0x320018,_0x22fa36){return _0x320018['define'](_0xa9b7('0x7'),attributes,{'tableName':_0xa9b7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9b7('0x9'),'collate':_0xa9b7('0xa')});};
\ No newline at end of file
+var _0x84d2=['request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0xab0515,_0x4b8ab2){var _0x443d59=function(_0xfd6c59){while(--_0xfd6c59){_0xab0515['push'](_0xab0515['shift']());}};_0x443d59(++_0x4b8ab2);}(_0x84d2,0x1cf));var _0x284d=function(_0x3c888a,_0x135752){_0x3c888a=_0x3c888a-0x0;var _0x1f9d35=_0x84d2[_0x3c888a];return _0x1f9d35;};'use strict';var _=require(_0x284d('0x0'));var util=require(_0x284d('0x1'));var logger=require(_0x284d('0x2'))(_0x284d('0x3'));var moment=require(_0x284d('0x4'));var BPromise=require('bluebird');var rp=require(_0x284d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x284d('0x6'));var config=require(_0x284d('0x7'));var attributes=require(_0x284d('0x8'));module[_0x284d('0x9')]=function(_0x462be4,_0x2bf078){return _0x462be4['define']('MailApplication',attributes,{'tableName':_0x284d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x284d('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index f1f5252..fc46829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8357=['request','then','info','request\x20sent','debug','stringify','error','code','message','MailApplication,\x20%s,\x20%s','result','catch','UpdateMailApplication','MailApplication','body','options','raw','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2b2896,_0x155504){var _0xcd6ebf=function(_0x560414){while(--_0x560414){_0x2b2896['push'](_0x2b2896['shift']());}};_0xcd6ebf(++_0x155504);}(_0x8357,0x140));var _0x7835=function(_0xd75b98,_0x15ad99){_0xd75b98=_0xd75b98-0x0;var _0xdd720e=_0x8357[_0xd75b98];return _0xdd720e;};'use strict';var _=require(_0x7835('0x0'));var util=require(_0x7835('0x1'));var moment=require('moment');var BPromise=require(_0x7835('0x2'));var rs=require(_0x7835('0x3'));var fs=require('fs');var Redis=require(_0x7835('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7835('0x5'));var logger=require(_0x7835('0x6'))('rpc');var config=require(_0x7835('0x7'));var jayson=require(_0x7835('0x8'));var client=jayson[_0x7835('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d3ad1,_0x27b4d7,_0x27001b){return new BPromise(function(_0x2b10d7,_0x59581e){return client[_0x7835('0xa')](_0x1d3ad1,_0x27001b)[_0x7835('0xb')](function(_0x2e1dfb){logger[_0x7835('0xc')]('MailApplication,\x20%s,\x20%s',_0x27b4d7,_0x7835('0xd'));logger[_0x7835('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x27b4d7,_0x7835('0xd'),JSON[_0x7835('0xf')](_0x2e1dfb));if(_0x2e1dfb[_0x7835('0x10')]){if(_0x2e1dfb[_0x7835('0x10')][_0x7835('0x11')]===0x1f4){logger[_0x7835('0x10')]('MailApplication,\x20%s,\x20%s',_0x27b4d7,_0x2e1dfb[_0x7835('0x10')][_0x7835('0x12')]);return _0x59581e(_0x2e1dfb[_0x7835('0x10')][_0x7835('0x12')]);}logger[_0x7835('0x10')](_0x7835('0x13'),_0x27b4d7,_0x2e1dfb[_0x7835('0x10')][_0x7835('0x12')]);return _0x2b10d7(_0x2e1dfb[_0x7835('0x10')][_0x7835('0x12')]);}else{logger[_0x7835('0xc')](_0x7835('0x13'),_0x27b4d7,_0x7835('0xd'));_0x2b10d7(_0x2e1dfb[_0x7835('0x14')][_0x7835('0x12')]);}})[_0x7835('0x15')](function(_0xc70bf){logger[_0x7835('0x10')](_0x7835('0x13'),_0x27b4d7,_0xc70bf);_0x59581e(_0xc70bf);});});}exports[_0x7835('0x16')]=function(_0x432de0){var _0x22ca2b=this;return new Promise(function(_0x4534e0,_0x375658){return db[_0x7835('0x17')]['update'](_0x432de0[_0x7835('0x18')],{'raw':_0x432de0[_0x7835('0x19')]?_0x432de0['options'][_0x7835('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x432de0['options']?_0x432de0['options'][_0x7835('0x1b')]||null:null,'attributes':_0x432de0[_0x7835('0x19')]?_0x432de0[_0x7835('0x19')][_0x7835('0x1c')]||null:null,'limit':_0x432de0[_0x7835('0x19')]?_0x432de0['options'][_0x7835('0x1d')]||null:null})[_0x7835('0xb')](function(_0x2f8cea){logger[_0x7835('0xc')](_0x7835('0x16'),_0x432de0);logger[_0x7835('0xe')](_0x7835('0x16'),_0x432de0,JSON['stringify'](_0x2f8cea));_0x4534e0(_0x2f8cea);})[_0x7835('0x15')](function(_0x3ef99d){logger[_0x7835('0x10')](_0x7835('0x16'),_0x3ef99d[_0x7835('0x12')],_0x432de0);_0x375658(_0x22ca2b[_0x7835('0x10')](0x1f4,_0x3ef99d[_0x7835('0x12')]));});});};
\ No newline at end of file
+var _0xb588=['client','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','attributes','limit','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3c2d6e,_0xeb8475){var _0x56f64f=function(_0xffd084){while(--_0xffd084){_0x3c2d6e['push'](_0x3c2d6e['shift']());}};_0x56f64f(++_0xeb8475);}(_0xb588,0xf3));var _0x8b58=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb588[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x8b58('0x0'));var util=require('util');var moment=require(_0x8b58('0x1'));var BPromise=require(_0x8b58('0x2'));var rs=require(_0x8b58('0x3'));var fs=require('fs');var Redis=require(_0x8b58('0x4'));var db=require(_0x8b58('0x5'))['db'];var utils=require(_0x8b58('0x6'));var logger=require(_0x8b58('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b58('0x8'));var client=jayson[_0x8b58('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4721e0,_0x17ea0f,_0x7b210){return new BPromise(function(_0xf9288a,_0x593ae3){return client[_0x8b58('0xa')](_0x4721e0,_0x7b210)['then'](function(_0x2e5ad3){logger[_0x8b58('0xb')](_0x8b58('0xc'),_0x17ea0f,_0x8b58('0xd'));logger[_0x8b58('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x17ea0f,_0x8b58('0xd'),JSON[_0x8b58('0xf')](_0x2e5ad3));if(_0x2e5ad3['error']){if(_0x2e5ad3['error']['code']===0x1f4){logger[_0x8b58('0x10')](_0x8b58('0xc'),_0x17ea0f,_0x2e5ad3[_0x8b58('0x10')][_0x8b58('0x11')]);return _0x593ae3(_0x2e5ad3[_0x8b58('0x10')][_0x8b58('0x11')]);}logger['error'](_0x8b58('0xc'),_0x17ea0f,_0x2e5ad3['error'][_0x8b58('0x11')]);return _0xf9288a(_0x2e5ad3[_0x8b58('0x10')][_0x8b58('0x11')]);}else{logger[_0x8b58('0xb')](_0x8b58('0xc'),_0x17ea0f,_0x8b58('0xd'));_0xf9288a(_0x2e5ad3[_0x8b58('0x12')][_0x8b58('0x11')]);}})[_0x8b58('0x13')](function(_0x2c517f){logger[_0x8b58('0x10')]('MailApplication,\x20%s,\x20%s',_0x17ea0f,_0x2c517f);_0x593ae3(_0x2c517f);});});}exports[_0x8b58('0x14')]=function(_0x1a6b99){var _0x158eb4=this;return new Promise(function(_0x3d87b0,_0x353aa0){return db[_0x8b58('0x15')][_0x8b58('0x16')](_0x1a6b99['body'],{'raw':_0x1a6b99[_0x8b58('0x17')]?_0x1a6b99[_0x8b58('0x17')][_0x8b58('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a6b99[_0x8b58('0x17')]?_0x1a6b99[_0x8b58('0x17')]['where']||null:null,'attributes':_0x1a6b99[_0x8b58('0x17')]?_0x1a6b99['options'][_0x8b58('0x19')]||null:null,'limit':_0x1a6b99[_0x8b58('0x17')]?_0x1a6b99[_0x8b58('0x17')][_0x8b58('0x1a')]||null:null})[_0x8b58('0x1b')](function(_0x5ec31b){logger['info'](_0x8b58('0x14'),_0x1a6b99);logger[_0x8b58('0xe')]('UpdateMailApplication',_0x1a6b99,JSON[_0x8b58('0xf')](_0x5ec31b));_0x3d87b0(_0x5ec31b);})[_0x8b58('0x13')](function(_0x485f6b){logger[_0x8b58('0x10')](_0x8b58('0x14'),_0x485f6b['message'],_0x1a6b99);_0x353aa0(_0x158eb4['error'](0x1f4,_0x485f6b[_0x8b58('0x11')]));});});};
\ No newline at end of file
index 49a83a1..eb3fce8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x289b=['post','create','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','tracked','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download'];(function(_0xb746a4,_0x355bdc){var _0x4b6a58=function(_0x3ebf70){while(--_0x3ebf70){_0xb746a4['push'](_0xb746a4['shift']());}};_0x4b6a58(++_0x355bdc);}(_0x289b,0x6d));var _0xb289=function(_0x1ff527,_0x54b6d2){_0x1ff527=_0x1ff527-0x0;var _0x51cc75=_0x289b[_0x1ff527];return _0x51cc75;};'use strict';var express=require(_0xb289('0x0'));var router=express[_0xb289('0x1')]();var auth=require(_0xb289('0x2'));var interaction=require(_0xb289('0x3'));var controller=require(_0xb289('0x4'));router['get']('/',auth[_0xb289('0x5')](),controller[_0xb289('0x6')]);router[_0xb289('0x7')](_0xb289('0x8'),auth[_0xb289('0x5')](),controller[_0xb289('0x9')]);router[_0xb289('0x7')](_0xb289('0xa'),auth[_0xb289('0x5')](),controller[_0xb289('0xb')]);router[_0xb289('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xb289('0xc')]);router[_0xb289('0x7')](_0xb289('0xd'),auth[_0xb289('0x5')](),controller[_0xb289('0xe')]);router[_0xb289('0xf')]('/',auth['isAuthenticated'](),controller[_0xb289('0x10')]);router['post'](_0xb289('0x11'),auth['isAuthenticated'](),controller[_0xb289('0x12')]);router[_0xb289('0xf')](_0xb289('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0xb289('0x14'),_0xb289('0x15')),controller[_0xb289('0x16')]);router[_0xb289('0x17')](_0xb289('0xa'),auth[_0xb289('0x5')](),interaction['tracked'](_0xb289('0x14'),_0xb289('0x18')),controller[_0xb289('0x19')]);router[_0xb289('0x1a')](_0xb289('0xa'),auth[_0xb289('0x5')](),interaction[_0xb289('0x1b')](_0xb289('0x14'),_0xb289('0x1c')),controller[_0xb289('0x1d')]);router['delete']('/:id/tags',auth[_0xb289('0x5')](),controller['removeTags']);module[_0xb289('0x1e')]=router;
\ No newline at end of file
+var _0x8e25=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/download','post','/:id/messages','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','update','delete','mail','mailinteraction:destroy','destroy','removeTags','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8e25,0x14e));var _0x58e2=function(_0x84970a,_0x347a79){_0x84970a=_0x84970a-0x0;var _0x118942=_0x8e25[_0x84970a];return _0x118942;};'use strict';var express=require(_0x58e2('0x0'));var router=express['Router']();var auth=require(_0x58e2('0x1'));var interaction=require(_0x58e2('0x2'));var controller=require(_0x58e2('0x3'));router[_0x58e2('0x4')]('/',auth['isAuthenticated'](),controller[_0x58e2('0x5')]);router[_0x58e2('0x4')](_0x58e2('0x6'),auth[_0x58e2('0x7')](),controller[_0x58e2('0x8')]);router['get'](_0x58e2('0x9'),auth[_0x58e2('0x7')](),controller[_0x58e2('0xa')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x58e2('0x4')](_0x58e2('0xb'),auth[_0x58e2('0x7')](),controller['download']);router[_0x58e2('0xc')]('/',auth[_0x58e2('0x7')](),controller['create']);router['post'](_0x58e2('0xd'),auth[_0x58e2('0x7')](),controller[_0x58e2('0xe')]);router['post'](_0x58e2('0xf'),auth[_0x58e2('0x7')](),interaction[_0x58e2('0x10')]('mail',_0x58e2('0x11')),controller[_0x58e2('0x12')]);router[_0x58e2('0x13')](_0x58e2('0x9'),auth['isAuthenticated'](),interaction[_0x58e2('0x10')]('mail','mailinteraction:update'),controller[_0x58e2('0x14')]);router[_0x58e2('0x15')](_0x58e2('0x9'),auth[_0x58e2('0x7')](),interaction['tracked'](_0x58e2('0x16'),_0x58e2('0x17')),controller[_0x58e2('0x18')]);router[_0x58e2('0x15')]('/:id/tags',auth[_0x58e2('0x7')](),controller[_0x58e2('0x19')]);module['exports']=router;
\ No newline at end of file
index 1f8c780..e9ff743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf583=['DATE','ENUM','out','sequelize','iconv','BOOLEAN','STRING','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf583,0x111));var _0x3f58=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0xf583[_0x381589];return _0x2a075d;};'use strict';var Sequelize=require(_0x3f58('0x0'));var iconv=require(_0x3f58('0x1'));module['exports']={'closed':{'type':Sequelize[_0x3f58('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x3f58('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3f58('0x3')]},'note':{'type':Sequelize[_0x3f58('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x3f58('0x3')]},'cc':{'type':Sequelize[_0x3f58('0x4')](_0x3f58('0x5'))},'subject':{'type':Sequelize[_0x3f58('0x4')]()},'attach':{'type':Sequelize[_0x3f58('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x3f58('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x3f58('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x3f58('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3f58('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x3f58('0x7')]('in',_0x3f58('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3f58('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x62b3=['DATE','STRING','TEXT','long','ENUM','out','BOOLEAN'];(function(_0x346c4b,_0x57bce3){var _0x1e3b65=function(_0x4f106e){while(--_0x4f106e){_0x346c4b['push'](_0x346c4b['shift']());}};_0x1e3b65(++_0x57bce3);}(_0x62b3,0x19c));var _0x362b=function(_0x170f42,_0x36e3cf){_0x170f42=_0x170f42-0x0;var _0x24c7b1=_0x62b3[_0x170f42];return _0x24c7b1;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x362b('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x362b('0x1')]},'disposition':{'type':Sequelize[_0x362b('0x2')]},'secondDisposition':{'type':Sequelize[_0x362b('0x2')]},'thirdDisposition':{'type':Sequelize[_0x362b('0x2')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x362b('0x2')](0x1fe)},'to':{'type':Sequelize[_0x362b('0x2')]},'cc':{'type':Sequelize[_0x362b('0x3')](_0x362b('0x4'))},'subject':{'type':Sequelize[_0x362b('0x3')]()},'attach':{'type':Sequelize[_0x362b('0x0')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x362b('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x362b('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x362b('0x5')]('in',_0x362b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x362b('0x5')]('in',_0x362b('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x362b('0x0')],'defaultValue':![]}};
\ No newline at end of file
index 557e0fd..b384fbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb10b,0x12a));var _0xbb10=function(_0x15d21f,_0x10997d){_0x15d21f=_0x15d21f-0x0;var _0x50b48d=_0xb10b[_0x15d21f];return _0x50b48d;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
+var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb10b,0x12a));var _0xbb10=function(_0xd578cb,_0x2167a3){_0xd578cb=_0xd578cb-0x0;var _0x775533=_0xb10b[_0xd578cb];return _0x775533;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
index 453e06b..b4c3185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb082=['events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb082,0x1b5));var _0x2b08=function(_0x2e90ec,_0x34c770){_0x2e90ec=_0x2e90ec-0x0;var _0x15fb83=_0xb082[_0x2e90ec];return _0x15fb83;};'use strict';var EventEmitter=require(_0x2b08('0x0'));var MailInteraction=require(_0x2b08('0x1'))['db'][_0x2b08('0x2')];var MailMessage=require(_0x2b08('0x1'))['db'][_0x2b08('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2b08('0x4')](0x0);var events={'afterCreate':_0x2b08('0x5'),'afterUpdate':_0x2b08('0x6'),'afterDestroy':_0x2b08('0x7')};function emitEvent(_0x10fe73){return function(_0x3621a2,_0x2e31d1,_0x34864e){_0x3621a2['getUsers']({'attributes':['id'],'raw':!![]})[_0x2b08('0x8')](function(_0xcfbc96){_0x3621a2['setDataValue'](_0x2b08('0x9'),_0xcfbc96[_0x2b08('0xa')](function(_0x39676a){return{'id':_0x39676a['id']};}));return MailMessage[_0x2b08('0xb')]({'where':{'MailInteractionId':_0x3621a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2b08('0x8')](function(_0x37353e){_0x3621a2[_0x2b08('0xc')](_0x2b08('0xd'),_0x37353e['length']);MailInteractionEvents['emit'](_0x10fe73+':'+_0x3621a2['id'],_0x3621a2);MailInteractionEvents[_0x2b08('0xe')](_0x10fe73,_0x3621a2);_0x34864e(null);})[_0x2b08('0xf')](_0x34864e(null));};}for(var e in events){if(events[_0x2b08('0x10')](e)){var event=events[e];MailInteraction[_0x2b08('0x11')](e,emitEvent(event));}}module[_0x2b08('0x12')]=MailInteractionEvents;
\ No newline at end of file
+var _0xb844=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','catch'];(function(_0x3a0863,_0x4cd5ef){var _0x85c557=function(_0x3011cb){while(--_0x3011cb){_0x3a0863['push'](_0x3a0863['shift']());}};_0x85c557(++_0x4cd5ef);}(_0xb844,0x146));var _0x4b84=function(_0x4af0b3,_0x1729d5){_0x4af0b3=_0x4af0b3-0x0;var _0x4ea8c0=_0xb844[_0x4af0b3];return _0x4ea8c0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x4b84('0x0'))['db']['MailInteraction'];var MailMessage=require(_0x4b84('0x0'))['db'][_0x4b84('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4b84('0x2')](0x0);var events={'afterCreate':_0x4b84('0x3'),'afterUpdate':'update','afterDestroy':_0x4b84('0x4')};function emitEvent(_0x8f38c6){return function(_0x25af74,_0x2163c2,_0x48a82c){_0x25af74[_0x4b84('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x39d955){_0x25af74[_0x4b84('0x6')](_0x4b84('0x7'),_0x39d955[_0x4b84('0x8')](function(_0x1ac456){return{'id':_0x1ac456['id']};}));return MailMessage[_0x4b84('0x9')]({'where':{'MailInteractionId':_0x25af74['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4b84('0xa')](function(_0x248938){_0x25af74[_0x4b84('0x6')](_0x4b84('0xb'),_0x248938['length']);MailInteractionEvents[_0x4b84('0xc')](_0x8f38c6+':'+_0x25af74['id'],_0x25af74);MailInteractionEvents[_0x4b84('0xc')](_0x8f38c6,_0x25af74);_0x48a82c(null);})[_0x4b84('0xd')](_0x48a82c(null));};}for(var e in events){if(events[_0x4b84('0xe')](e)){var event=events[e];MailInteraction[_0x4b84('0xf')](e,emitEvent(event));}}module[_0x4b84('0x10')]=MailInteractionEvents;
\ No newline at end of file
index 687470a..a33bdd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x387a=['../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get','MailMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x558e29,_0x15e088){var _0x2e2f58=function(_0x36cada){while(--_0x36cada){_0x558e29['push'](_0x558e29['shift']());}};_0x2e2f58(++_0x15e088);}(_0x387a,0x1e5));var _0xa387=function(_0x1ac2b2,_0x3bbe8c){_0x1ac2b2=_0x1ac2b2-0x0;var _0x3f633c=_0x387a[_0x1ac2b2];return _0x3f633c;};'use strict';var _=require(_0xa387('0x0'));var util=require(_0xa387('0x1'));var logger=require(_0xa387('0x2'))('api');var moment=require(_0xa387('0x3'));var BPromise=require(_0xa387('0x4'));var rp=require(_0xa387('0x5'));var fs=require('fs');var path=require(_0xa387('0x6'));var rimraf=require(_0xa387('0x7'));var config=require(_0xa387('0x8'));var attributes=require(_0xa387('0x9'));module[_0xa387('0xa')]=function(_0x2d729f,_0xa156c5){return _0x2d729f[_0xa387('0xb')](_0xa387('0xc'),attributes,{'tableName':_0xa387('0xd'),'paranoid':![],'indexes':[{'name':_0xa387('0xe'),'fields':[_0xa387('0xf'),'to'],'type':_0xa387('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f3203,_0x2326c6,_0x4ab338){if(_0x1f3203['substatus']){_0x1f3203[_0xa387('0x11')]=moment()[_0xa387('0x12')](_0xa387('0x13'));}if(_0x1f3203[_0xa387('0x14')]){_0x1f3203[_0xa387('0x15')]=moment()[_0xa387('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ab338(null,_0x2326c6);},'beforeUpdate':function(_0x1cc72b,_0xfe9b45,_0x6b62f){if(_0x1cc72b[_0xa387('0x16')](_0xa387('0x17'))){_0x1cc72b[_0xa387('0x11')]=_0x1cc72b[_0xa387('0x17')]?moment()[_0xa387('0x12')](_0xa387('0x13')):null;}if(_0x1cc72b[_0xa387('0x16')](_0xa387('0x14'))){_0x1cc72b[_0xa387('0x15')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1cc72b['substatus']=null;_0x1cc72b['substatusAt']=null;}_0x6b62f(null,_0x1cc72b);},'afterUpdate':function(_0xc697bb,_0xf06bdf,_0x17a84a){var _0x455d8a=_0x2d729f[_0xa387('0x18')];var _0x57c699=_0xc697bb[_0xa387('0x19')]({'plain':!![]});if(_0x57c699['closed']){return _0x455d8a[_0xa387('0x1a')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x57c699['id']}})['then'](function(){_0x17a84a();})['catch'](function(_0x3be4d5){_0x17a84a(_0x3be4d5);});}else{_0x17a84a();}}},'charset':_0xa387('0x1b'),'collate':_0xa387('0x1c')});};
\ No newline at end of file
+var _0x0b2a=['path','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','MailMessage','update','then','catch','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2503c7,_0xd1280a){var _0x2286b8=function(_0x3332ff){while(--_0x3332ff){_0x2503c7['push'](_0x2503c7['shift']());}};_0x2286b8(++_0xd1280a);}(_0x0b2a,0x19a));var _0xa0b2=function(_0x274d88,_0x5abbb6){_0x274d88=_0x274d88-0x0;var _0x219c5c=_0x0b2a[_0x274d88];return _0x219c5c;};'use strict';var _=require('lodash');var util=require(_0xa0b2('0x0'));var logger=require(_0xa0b2('0x1'))(_0xa0b2('0x2'));var moment=require(_0xa0b2('0x3'));var BPromise=require(_0xa0b2('0x4'));var rp=require(_0xa0b2('0x5'));var fs=require('fs');var path=require(_0xa0b2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0xa0b2('0x7')]=function(_0x283887,_0x1f0872){return _0x283887[_0xa0b2('0x8')](_0xa0b2('0x9'),attributes,{'tableName':_0xa0b2('0xa'),'paranoid':![],'indexes':[{'name':_0xa0b2('0xb'),'fields':[_0xa0b2('0xc'),'to'],'type':_0xa0b2('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x26689c,_0x53dc16,_0xa7e425){if(_0x26689c[_0xa0b2('0xe')]){_0x26689c[_0xa0b2('0xf')]=moment()[_0xa0b2('0x10')](_0xa0b2('0x11'));}if(_0x26689c[_0xa0b2('0x12')]){_0x26689c['closedAt']=moment()[_0xa0b2('0x10')](_0xa0b2('0x11'));}_0xa7e425(null,_0x53dc16);},'beforeUpdate':function(_0x3e4568,_0x67c6cf,_0x59c911){if(_0x3e4568[_0xa0b2('0x13')](_0xa0b2('0xe'))){_0x3e4568[_0xa0b2('0xf')]=_0x3e4568[_0xa0b2('0xe')]?moment()[_0xa0b2('0x10')](_0xa0b2('0x11')):null;}if(_0x3e4568[_0xa0b2('0x13')]('closed')){_0x3e4568[_0xa0b2('0x14')]=moment()[_0xa0b2('0x10')](_0xa0b2('0x11'));_0x3e4568[_0xa0b2('0xe')]=null;_0x3e4568[_0xa0b2('0xf')]=null;}_0x59c911(null,_0x3e4568);},'afterUpdate':function(_0x2b659a,_0x1426e4,_0x1bf0de){var _0x55d8d0=_0x283887[_0xa0b2('0x15')];var _0x380705=_0x2b659a['get']({'plain':!![]});if(_0x380705[_0xa0b2('0x12')]){return _0x55d8d0[_0xa0b2('0x16')][_0xa0b2('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x380705['id']}})[_0xa0b2('0x18')](function(){_0x1bf0de();})[_0xa0b2('0x19')](function(_0x2b5b8e){_0x1bf0de(_0x2b5b8e);});}else{_0x1bf0de();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index ec5603b..4e39f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0984=['ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x0984,0xff));var _0x4098=function(_0x14d1d5,_0x1a2445){_0x14d1d5=_0x14d1d5-0x0;var _0x1a7717=_0x0984[_0x14d1d5];return _0x1a7717;};'use strict';var _=require(_0x4098('0x0'));var util=require(_0x4098('0x1'));var moment=require(_0x4098('0x2'));var BPromise=require('bluebird');var rs=require(_0x4098('0x3'));var fs=require('fs');var Redis=require(_0x4098('0x4'));var db=require(_0x4098('0x5'))['db'];var utils=require(_0x4098('0x6'));var logger=require('../../config/logger')(_0x4098('0x7'));var config=require(_0x4098('0x8'));var jayson=require(_0x4098('0x9'));var client=jayson[_0x4098('0xa')]['http']({'port':0x232a});config[_0x4098('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4098('0xc'))(new Redis(config[_0x4098('0xb')]));require(_0x4098('0xd'))['register'](socket);function respondWithRpcPromise(_0x4ea6e4,_0x5ca76c,_0x253572){return new BPromise(function(_0x25a9e6,_0x518f39){return client[_0x4098('0xe')](_0x4ea6e4,_0x253572)[_0x4098('0xf')](function(_0xbc6a7f){logger[_0x4098('0x10')](_0x4098('0x11'),_0x5ca76c,_0x4098('0x12'));logger[_0x4098('0x13')](_0x4098('0x14'),_0x5ca76c,_0x4098('0x12'),JSON[_0x4098('0x15')](_0xbc6a7f));if(_0xbc6a7f[_0x4098('0x16')]){if(_0xbc6a7f[_0x4098('0x16')][_0x4098('0x17')]===0x1f4){logger[_0x4098('0x16')](_0x4098('0x11'),_0x5ca76c,_0xbc6a7f[_0x4098('0x16')]['message']);return _0x518f39(_0xbc6a7f[_0x4098('0x16')][_0x4098('0x18')]);}logger[_0x4098('0x16')](_0x4098('0x11'),_0x5ca76c,_0xbc6a7f[_0x4098('0x16')]['message']);return _0x25a9e6(_0xbc6a7f[_0x4098('0x16')]['message']);}else{logger['info'](_0x4098('0x11'),_0x5ca76c,_0x4098('0x12'));_0x25a9e6(_0xbc6a7f[_0x4098('0x19')]['message']);}})[_0x4098('0x1a')](function(_0x24cd44){logger[_0x4098('0x16')]('MailInteraction,\x20%s,\x20%s',_0x5ca76c,_0x24cd44);_0x518f39(_0x24cd44);});});}exports[_0x4098('0x1b')]=function(_0x58b45c){var _0x29eecc=this;return new Promise(function(_0xc6466d,_0x5b936d){return db[_0x4098('0x1c')][_0x4098('0x1d')](_0x58b45c[_0x4098('0x1e')],{'raw':_0x58b45c[_0x4098('0x1f')]?_0x58b45c[_0x4098('0x1f')][_0x4098('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58b45c[_0x4098('0x1f')]?_0x58b45c[_0x4098('0x1f')][_0x4098('0x21')]||null:null,'attributes':_0x58b45c[_0x4098('0x1f')]?_0x58b45c['options'][_0x4098('0x22')]||null:null,'limit':_0x58b45c['options']?_0x58b45c['options'][_0x4098('0x23')]||null:null})[_0x4098('0xf')](function(_0x5d5bd2){logger[_0x4098('0x10')](_0x4098('0x1b'),_0x58b45c);logger['debug'](_0x4098('0x1b'),_0x58b45c,JSON[_0x4098('0x15')](_0x5d5bd2));_0xc6466d(_0x5d5bd2);})[_0x4098('0x1a')](function(_0x5e14f3){logger[_0x4098('0x16')](_0x4098('0x1b'),_0x5e14f3['message'],_0x58b45c);_0x5b936d(_0x29eecc[_0x4098('0x16')](0x1f4,_0x5e14f3[_0x4098('0x18')]));});});};exports[_0x4098('0x24')]=function(_0x32d469){return new Promise(function(_0x56074c,_0x1ec1d7){return db[_0x4098('0x1c')][_0x4098('0x25')]({'where':_0x32d469[_0x4098('0x1f')]?_0x32d469[_0x4098('0x1f')][_0x4098('0x21')]||null:null})[_0x4098('0xf')](function(_0x3cb846){if(_0x3cb846){return _0x3cb846[_0x4098('0x26')](_0x32d469[_0x4098('0x1e')][_0x4098('0x27')],_['omit'](_0x32d469['body'],[_0x4098('0x27'),'id'])||{});}})[_0x4098('0x28')](function(_0xc42ccd){logger[_0x4098('0x10')](_0x4098('0x29'),_0x32d469);logger[_0x4098('0x13')]('AddTags',_0x32d469,JSON[_0x4098('0x15')](_0xc42ccd));_0x56074c(_0xc42ccd);})[_0x4098('0x1a')](function(_0x347733){logger[_0x4098('0x16')](_0x4098('0x29'),_0x347733[_0x4098('0x18')],_0x32d469);_0x1ec1d7(_this[_0x4098('0x16')](0x1f4,_0x347733['message']));});});};
\ No newline at end of file
+var _0x9aed=['moment','ioredis','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','raw','options','attributes','limit','AddTagsToMailInteraction','find','where','addTags','ids','omit','AddTags'];(function(_0x41390d,_0x595738){var _0x3d2925=function(_0x460f80){while(--_0x460f80){_0x41390d['push'](_0x41390d['shift']());}};_0x3d2925(++_0x595738);}(_0x9aed,0x9c));var _0xd9ae=function(_0x55bf92,_0x17eefd){_0x55bf92=_0x55bf92-0x0;var _0x286ca3=_0x9aed[_0x55bf92];return _0x286ca3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd9ae('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9ae('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd9ae('0x2'))(_0xd9ae('0x3'));var config=require(_0xd9ae('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xd9ae('0x5')]['http']({'port':0x232a});config[_0xd9ae('0x6')]=_[_0xd9ae('0x7')](config[_0xd9ae('0x6')],{'host':_0xd9ae('0x8'),'port':0x18eb});var socket=require(_0xd9ae('0x9'))(new Redis(config['redis']));require(_0xd9ae('0xa'))[_0xd9ae('0xb')](socket);function respondWithRpcPromise(_0x2ed593,_0x20f67a,_0x38850d){return new BPromise(function(_0x496ea3,_0xc48070){return client[_0xd9ae('0xc')](_0x2ed593,_0x38850d)[_0xd9ae('0xd')](function(_0x2834f1){logger['info'](_0xd9ae('0xe'),_0x20f67a,_0xd9ae('0xf'));logger[_0xd9ae('0x10')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x20f67a,_0xd9ae('0xf'),JSON[_0xd9ae('0x11')](_0x2834f1));if(_0x2834f1[_0xd9ae('0x12')]){if(_0x2834f1['error'][_0xd9ae('0x13')]===0x1f4){logger['error'](_0xd9ae('0xe'),_0x20f67a,_0x2834f1[_0xd9ae('0x12')]['message']);return _0xc48070(_0x2834f1[_0xd9ae('0x12')]['message']);}logger[_0xd9ae('0x12')](_0xd9ae('0xe'),_0x20f67a,_0x2834f1[_0xd9ae('0x12')][_0xd9ae('0x14')]);return _0x496ea3(_0x2834f1[_0xd9ae('0x12')][_0xd9ae('0x14')]);}else{logger[_0xd9ae('0x15')]('MailInteraction,\x20%s,\x20%s',_0x20f67a,_0xd9ae('0xf'));_0x496ea3(_0x2834f1[_0xd9ae('0x16')][_0xd9ae('0x14')]);}})[_0xd9ae('0x17')](function(_0x32d5ad){logger[_0xd9ae('0x12')](_0xd9ae('0xe'),_0x20f67a,_0x32d5ad);_0xc48070(_0x32d5ad);});});}exports[_0xd9ae('0x18')]=function(_0x3b5d5a){var _0xb8a3c3=this;return new Promise(function(_0x41c0ea,_0x334258){return db[_0xd9ae('0x19')][_0xd9ae('0x1a')](_0x3b5d5a[_0xd9ae('0x1b')],{'raw':_0x3b5d5a['options']?_0x3b5d5a['options'][_0xd9ae('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b5d5a[_0xd9ae('0x1d')]?_0x3b5d5a['options']['where']||null:null,'attributes':_0x3b5d5a[_0xd9ae('0x1d')]?_0x3b5d5a['options'][_0xd9ae('0x1e')]||null:null,'limit':_0x3b5d5a['options']?_0x3b5d5a['options'][_0xd9ae('0x1f')]||null:null})[_0xd9ae('0xd')](function(_0x160443){logger[_0xd9ae('0x15')](_0xd9ae('0x18'),_0x3b5d5a);logger['debug'](_0xd9ae('0x18'),_0x3b5d5a,JSON['stringify'](_0x160443));_0x41c0ea(_0x160443);})['catch'](function(_0xb0ac6a){logger['error'](_0xd9ae('0x18'),_0xb0ac6a['message'],_0x3b5d5a);_0x334258(_0xb8a3c3[_0xd9ae('0x12')](0x1f4,_0xb0ac6a[_0xd9ae('0x14')]));});});};exports[_0xd9ae('0x20')]=function(_0x16c4c6){return new Promise(function(_0xb28778,_0x5743d9){return db['MailInteraction'][_0xd9ae('0x21')]({'where':_0x16c4c6[_0xd9ae('0x1d')]?_0x16c4c6['options'][_0xd9ae('0x22')]||null:null})[_0xd9ae('0xd')](function(_0x5d7ac0){if(_0x5d7ac0){return _0x5d7ac0[_0xd9ae('0x23')](_0x16c4c6[_0xd9ae('0x1b')][_0xd9ae('0x24')],_[_0xd9ae('0x25')](_0x16c4c6[_0xd9ae('0x1b')],[_0xd9ae('0x24'),'id'])||{});}})['spread'](function(_0xcdd6f1){logger[_0xd9ae('0x15')]('AddTags',_0x16c4c6);logger[_0xd9ae('0x10')](_0xd9ae('0x26'),_0x16c4c6,JSON[_0xd9ae('0x11')](_0xcdd6f1));_0xb28778(_0xcdd6f1);})[_0xd9ae('0x17')](function(_0x2f1e41){logger['error']('AddTags',_0x2f1e41['message'],_0x16c4c6);_0x5743d9(_this[_0xd9ae('0x12')](0x1f4,_0x2f1e41[_0xd9ae('0x14')]));});});};
\ No newline at end of file
index da974a7..d7ed873 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e7b=['mailInteraction:','./mailInteraction.events','save','update','register'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4e7b,0xa1));var _0xb4e7=function(_0x7db4c4,_0x1a6c7f){_0x7db4c4=_0x7db4c4-0x0;var _0x79c64=_0x4e7b[_0x7db4c4];return _0x79c64;};'use strict';var MailInteractionEvents=require(_0xb4e7('0x0'));var events=[_0xb4e7('0x1'),'remove',_0xb4e7('0x2')];function createListener(_0x3b89f9,_0x1283cb){return function(_0x4a4abc){_0x1283cb['emit'](_0x3b89f9,_0x4a4abc);};}function removeListener(_0x2011a1,_0xa3808c){return function(){MailInteractionEvents['removeListener'](_0x2011a1,_0xa3808c);};}exports[_0xb4e7('0x3')]=function(_0x4c3cc1){for(var _0x373c96=0x0,_0x227351=events['length'];_0x373c96<_0x227351;_0x373c96++){var _0x5e7c4b=events[_0x373c96];var _0x4745f8=createListener(_0xb4e7('0x4')+_0x5e7c4b,_0x4c3cc1);MailInteractionEvents['on'](_0x5e7c4b,_0x4745f8);}};
\ No newline at end of file
+var _0x27ba=['save','remove','update','length','mailInteraction:','./mailInteraction.events'];(function(_0x5ed7f8,_0x397262){var _0x4cc495=function(_0x4f5461){while(--_0x4f5461){_0x5ed7f8['push'](_0x5ed7f8['shift']());}};_0x4cc495(++_0x397262);}(_0x27ba,0x1b5));var _0xa27b=function(_0x26e0d9,_0x3bbeff){_0x26e0d9=_0x26e0d9-0x0;var _0x3ed4bb=_0x27ba[_0x26e0d9];return _0x3ed4bb;};'use strict';var MailInteractionEvents=require(_0xa27b('0x0'));var events=[_0xa27b('0x1'),_0xa27b('0x2'),_0xa27b('0x3')];function createListener(_0x17c5b5,_0x3927a1){return function(_0x5c1a5e){_0x3927a1['emit'](_0x17c5b5,_0x5c1a5e);};}function removeListener(_0x4c0af0,_0x12e009){return function(){MailInteractionEvents['removeListener'](_0x4c0af0,_0x12e009);};}exports['register']=function(_0x4ca25d){for(var _0x1eb5c9=0x0,_0x35dc43=events[_0xa27b('0x4')];_0x1eb5c9<_0x35dc43;_0x1eb5c9++){var _0x203b6b=events[_0x1eb5c9];var _0x2e99a8=createListener(_0xa27b('0x5')+_0x203b6b,_0x4ca25d);MailInteractionEvents['on'](_0x203b6b,_0x2e99a8);}};
\ No newline at end of file
index 126a2f8..059cab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d4d=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2b1a3c,_0x6aa9b3){var _0x32f9fc=function(_0x4ab620){while(--_0x4ab620){_0x2b1a3c['push'](_0x2b1a3c['shift']());}};_0x32f9fc(++_0x6aa9b3);}(_0x2d4d,0x94));var _0xd2d4=function(_0x5a6380,_0x338657){_0x5a6380=_0x5a6380-0x0;var _0x1f1d9c=_0x2d4d[_0x5a6380];return _0x1f1d9c;};'use strict';var multer=require(_0xd2d4('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd2d4('0x1'));var router=express[_0xd2d4('0x2')]();var fs_extra=require(_0xd2d4('0x3'));var auth=require(_0xd2d4('0x4'));var interaction=require(_0xd2d4('0x5'));var config=require(_0xd2d4('0x6'));var controller=require(_0xd2d4('0x7'));router[_0xd2d4('0x8')]('/',auth[_0xd2d4('0x9')](),controller[_0xd2d4('0xa')]);router['get'](_0xd2d4('0xb'),auth['isAuthenticated'](),controller[_0xd2d4('0xc')]);router[_0xd2d4('0x8')](_0xd2d4('0xd'),auth[_0xd2d4('0x9')](),controller[_0xd2d4('0xe')]);router[_0xd2d4('0x8')](_0xd2d4('0xf'),auth[_0xd2d4('0x9')](),controller[_0xd2d4('0x10')]);router[_0xd2d4('0x11')]('/',auth[_0xd2d4('0x9')](),interaction[_0xd2d4('0x12')](_0xd2d4('0x13'),_0xd2d4('0x14')),controller[_0xd2d4('0x15')]);router[_0xd2d4('0x16')](_0xd2d4('0xd'),auth[_0xd2d4('0x9')](),controller[_0xd2d4('0x17')]);router[_0xd2d4('0x16')](_0xd2d4('0x18'),auth[_0xd2d4('0x9')](),controller[_0xd2d4('0x19')]);router[_0xd2d4('0x16')](_0xd2d4('0x1a'),auth[_0xd2d4('0x9')](),controller[_0xd2d4('0x1b')]);router[_0xd2d4('0x1c')](_0xd2d4('0xd'),auth['isAuthenticated'](),controller[_0xd2d4('0x1d')]);module[_0xd2d4('0x1e')]=router;
\ No newline at end of file
+var _0x6916=['describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x6916,0x1ed));var _0x6691=function(_0x210fe2,_0x419896){_0x210fe2=_0x210fe2-0x0;var _0x452c68=_0x6916[_0x210fe2];return _0x452c68;};'use strict';var multer=require('multer');var util=require(_0x6691('0x0'));var path=require(_0x6691('0x1'));var timeout=require(_0x6691('0x2'));var express=require(_0x6691('0x3'));var router=express['Router']();var fs_extra=require(_0x6691('0x4'));var auth=require(_0x6691('0x5'));var interaction=require(_0x6691('0x6'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x6691('0x7')]('/',auth[_0x6691('0x8')](),controller[_0x6691('0x9')]);router[_0x6691('0x7')](_0x6691('0xa'),auth[_0x6691('0x8')](),controller[_0x6691('0xb')]);router[_0x6691('0x7')](_0x6691('0xc'),auth['isAuthenticated'](),controller[_0x6691('0xd')]);router['get'](_0x6691('0xe'),auth[_0x6691('0x8')](),controller[_0x6691('0xf')]);router[_0x6691('0x10')]('/',auth['isAuthenticated'](),interaction[_0x6691('0x11')](_0x6691('0x12'),_0x6691('0x13')),controller[_0x6691('0x14')]);router[_0x6691('0x15')](_0x6691('0xc'),auth[_0x6691('0x8')](),controller['update']);router[_0x6691('0x15')](_0x6691('0x16'),auth[_0x6691('0x8')](),controller[_0x6691('0x17')]);router[_0x6691('0x15')](_0x6691('0x18'),auth['isAuthenticated'](),controller['reject']);router[_0x6691('0x19')](_0x6691('0xc'),auth[_0x6691('0x8')](),controller[_0x6691('0x1a')]);module[_0x6691('0x1b')]=router;
\ No newline at end of file
index 12e16b6..5cd3992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fda=['BOOLEAN','out','STRING','TEXT','ENUM','Email','sequelize','lodash','long','medium'];(function(_0x50c58d,_0x540470){var _0x9e6486=function(_0x4ea996){while(--_0x4ea996){_0x50c58d['push'](_0x50c58d['shift']());}};_0x9e6486(++_0x540470);}(_0x1fda,0x74));var _0xa1fd=function(_0x49c93b,_0x1a56b5){_0x49c93b=_0x49c93b-0x0;var _0x1cc6f0=_0x1fda[_0x49c93b];return _0x1cc6f0;};'use strict';var Sequelize=require(_0xa1fd('0x0'));var _=require(_0xa1fd('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa1fd('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xa1fd('0x3'))},'read':{'type':Sequelize[_0xa1fd('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa1fd('0x5')),'defaultValue':_0xa1fd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa1fd('0x6')](0x1fe)},'from':{'type':Sequelize[_0xa1fd('0x6')]},'to':{'type':Sequelize['TEXT'](_0xa1fd('0x2'))},'cc':{'type':Sequelize['TEXT'](_0xa1fd('0x2'))},'bcc':{'type':Sequelize[_0xa1fd('0x7')](_0xa1fd('0x2'))},'subject':{'type':Sequelize[_0xa1fd('0x7')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xa1fd('0x7')](_0xa1fd('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0xa1fd('0x2'))},'originChannel':{'type':Sequelize[_0xa1fd('0x8')](_0xa1fd('0x9'),'Chat'),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
+var _0xd636=['lodash','exports','TEXT','long','medium','ENUM','out','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize'];(function(_0x133f0e,_0x3c25b6){var _0x11ae34=function(_0x187f92){while(--_0x187f92){_0x133f0e['push'](_0x133f0e['shift']());}};_0x11ae34(++_0x3c25b6);}(_0xd636,0xdc));var _0x6d63=function(_0x2df989,_0x3a5509){_0x2df989=_0x2df989-0x0;var _0x6a7537=_0xd636[_0x2df989];return _0x6a7537;};'use strict';var Sequelize=require(_0x6d63('0x0'));var _=require(_0x6d63('0x1'));module[_0x6d63('0x2')]={'body':{'type':Sequelize[_0x6d63('0x3')](_0x6d63('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6d63('0x3')](_0x6d63('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6d63('0x6')]('in',_0x6d63('0x7')),'defaultValue':_0x6d63('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x6d63('0x3')](_0x6d63('0x4'))},'bcc':{'type':Sequelize[_0x6d63('0x3')](_0x6d63('0x4'))},'subject':{'type':Sequelize[_0x6d63('0x3')]},'sentAt':{'type':Sequelize[_0x6d63('0x8')]},'attach':{'type':Sequelize[_0x6d63('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6d63('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6d63('0x8')]},'originTo':{'type':Sequelize[_0x6d63('0x3')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x6d63('0x4'))},'originChannel':{'type':Sequelize[_0x6d63('0x6')](_0x6d63('0xb'),_0x6d63('0xc')),'defaultValue':_0x6d63('0xb'),'allowNull':![]}};
\ No newline at end of file
index 235b37f..e33101f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d0=['findOne','MailAccountId','CmList','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','attachments','join','root','server/files/attachments','Contacts','List\x20not\x20found','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','read','format','UserId','agent','get','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','email','internal','interface','SIP/%s','channel','event','fromString','EventManager','reject','mail','interaction','role','RejectMessage','QueryTypes','contact','fullname','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','unlinkSync','eml-format','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','info','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','MailMessage','includeAll','include','findAll','rows','params','keys','find','body','create','direction','out','secret','split','MailAccount'];(function(_0x500812,_0x296a3c){var _0x4add02=function(_0x33c252){while(--_0x33c252){_0x500812['push'](_0x500812['shift']());}};_0x4add02(++_0x296a3c);}(_0xc8d0,0xf6));var _0x0c8d=function(_0x4fc421,_0x94e88){_0x4fc421=_0x4fc421-0x0;var _0x8c6d63=_0xc8d0[_0x4fc421];return _0x8c6d63;};'use strict';var emlformat=require(_0x0c8d('0x0'));var moment=require('moment');var BPromise=require(_0x0c8d('0x1'));var util=require('util');var path=require(_0x0c8d('0x2'));var fs=require('fs');var _=require(_0x0c8d('0x3'));var Redis=require(_0x0c8d('0x4'));var htmlToText=require(_0x0c8d('0x5'));var qs=require(_0x0c8d('0x6'));var logger=require('../../config/logger')(_0x0c8d('0x7'));var interaction_log=require(_0x0c8d('0x8'))(_0x0c8d('0x9'));var config=require(_0x0c8d('0xa'));var db=require(_0x0c8d('0xb'))['db'];config[_0x0c8d('0xc')]=_[_0x0c8d('0xd')](config[_0x0c8d('0xc')],{'host':_0x0c8d('0xe'),'port':0x18eb});var socket=require(_0x0c8d('0xf'))(new Redis(config[_0x0c8d('0xc')]));var htmlEntities=require(_0x0c8d('0x10'));require(_0x0c8d('0x11'))[_0x0c8d('0x12')](socket);var jayson=require(_0x0c8d('0x13'));var client=jayson[_0x0c8d('0x14')][_0x0c8d('0x15')]({'port':0x232c});var client9003=jayson[_0x0c8d('0x14')][_0x0c8d('0x15')]({'port':0x232b});var client9002=jayson['client'][_0x0c8d('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x542ad5,_0x52a440,_0x133ec5,_0x3a92e9){return new BPromise(function(_0x1231ef,_0x284660){var _0x14f598=_0x3a92e9||client;return _0x14f598['request'](_0x542ad5,_0x133ec5)[_0x0c8d('0x16')](function(_0x50bb20){logger['info']('MailMessage,\x20%s,\x20%s',_0x52a440,'request\x20sent');logger['debug'](_0x0c8d('0x17'),_0x52a440,_0x0c8d('0x18'),JSON[_0x0c8d('0x19')](_0x50bb20));if(_0x50bb20['error']){if(_0x50bb20[_0x0c8d('0x1a')]['code']===0x1f4){logger[_0x0c8d('0x1a')](_0x0c8d('0x1b'),_0x52a440,_0x50bb20[_0x0c8d('0x1a')][_0x0c8d('0x1c')]);return _0x284660(_0x50bb20['error'][_0x0c8d('0x1c')]);}logger[_0x0c8d('0x1a')](_0x0c8d('0x1b'),_0x52a440,_0x50bb20[_0x0c8d('0x1a')]['message']);return _0x1231ef(_0x50bb20[_0x0c8d('0x1a')][_0x0c8d('0x1c')]);}else{logger[_0x0c8d('0x1d')]('MailMessage,\x20%s,\x20%s',_0x52a440,_0x0c8d('0x18'));_0x1231ef(_0x50bb20['result'][_0x0c8d('0x1c')]);}})[_0x0c8d('0x1e')](function(_0x6ec134){logger[_0x0c8d('0x1a')](_0x0c8d('0x1b'),_0x52a440,_0x6ec134);_0x284660(_0x6ec134);});});}function respondWithResult(_0x467cee,_0x387677){_0x387677=_0x387677||0xc8;return function(_0x2377a5){if(_0x2377a5){return _0x467cee[_0x0c8d('0x1f')](_0x387677)[_0x0c8d('0x20')](_0x2377a5);}};}function respondWithFilteredResult(_0x107950,_0x31b71e){return function(_0x587578){if(_0x587578){var _0x22b8ba=typeof _0x31b71e[_0x0c8d('0x21')]==='undefined'&&typeof _0x31b71e[_0x0c8d('0x22')]===_0x0c8d('0x23');var _0x537a40=_0x587578[_0x0c8d('0x24')];var _0x528a9d=_0x22b8ba?0x0:_0x31b71e[_0x0c8d('0x21')];var _0x118db5=_0x22b8ba?_0x587578[_0x0c8d('0x24')]:_0x31b71e[_0x0c8d('0x21')]+_0x31b71e[_0x0c8d('0x22')];var _0x1c107d;if(_0x118db5>=_0x537a40){_0x118db5=_0x537a40;_0x1c107d=0xc8;}else{_0x1c107d=0xce;}_0x107950[_0x0c8d('0x1f')](_0x1c107d);return _0x107950[_0x0c8d('0x25')](_0x0c8d('0x26'),_0x528a9d+'-'+_0x118db5+'/'+_0x537a40)['json'](_0x587578);}return null;};}function saveUpdates(_0x4a91ce){return function(_0x3d0d21){if(_0x3d0d21){return _0x3d0d21[_0x0c8d('0x27')](_0x4a91ce)[_0x0c8d('0x16')](function(_0x5268ec){return _0x5268ec;});}return null;};}function removeEntity(_0x2b237e){return function(_0x461aff){if(_0x461aff){return _0x461aff[_0x0c8d('0x28')]()['then'](function(){_0x2b237e[_0x0c8d('0x1f')](0xcc)[_0x0c8d('0x29')]();});}};}function handleEntityNotFound(_0x27aba2){return function(_0x2a69c5){if(!_0x2a69c5){_0x27aba2['sendStatus'](0x194);}return _0x2a69c5;};}function handleError(_0x5b637c,_0x2bb32c){_0x2bb32c=_0x2bb32c||0x1f4;return function(_0x1563ca){logger['error'](_0x1563ca[_0x0c8d('0x2a')]);if(_0x1563ca[_0x0c8d('0x2b')]){delete _0x1563ca[_0x0c8d('0x2b')];}_0x5b637c[_0x0c8d('0x1f')](_0x2bb32c)[_0x0c8d('0x2c')](_0x1563ca);};}exports[_0x0c8d('0x2d')]=function(_0x94bff8,_0x5724bf){var _0x3a42e1={},_0x35c470={},_0x46f01d={'count':0x0,'rows':[]};var _0x39ff1d=_[_0x0c8d('0x2e')](db['MailMessage'][_0x0c8d('0x2f')],function(_0x52730c){return{'name':_0x52730c[_0x0c8d('0x30')],'type':_0x52730c['type'][_0x0c8d('0x31')]};});_0x35c470[_0x0c8d('0x32')]=_[_0x0c8d('0x2e')](_0x39ff1d,'name');_0x35c470[_0x0c8d('0x33')]=_['keys'](_0x94bff8[_0x0c8d('0x33')]);_0x35c470['filters']=_[_0x0c8d('0x34')](_0x35c470[_0x0c8d('0x32')],_0x35c470[_0x0c8d('0x33')]);_0x3a42e1[_0x0c8d('0x35')]=_['intersection'](_0x35c470['model'],qs['fields'](_0x94bff8['query'][_0x0c8d('0x36')]));_0x3a42e1[_0x0c8d('0x35')]=_0x3a42e1['attributes'][_0x0c8d('0x37')]?_0x3a42e1[_0x0c8d('0x35')]:_0x35c470[_0x0c8d('0x32')];if(!_0x94bff8[_0x0c8d('0x33')][_0x0c8d('0x38')](_0x0c8d('0x39'))){_0x3a42e1[_0x0c8d('0x22')]=qs[_0x0c8d('0x22')](_0x94bff8[_0x0c8d('0x33')][_0x0c8d('0x22')]);_0x3a42e1[_0x0c8d('0x21')]=qs[_0x0c8d('0x21')](_0x94bff8[_0x0c8d('0x33')][_0x0c8d('0x21')]);}_0x3a42e1[_0x0c8d('0x3a')]=qs[_0x0c8d('0x3b')](_0x94bff8[_0x0c8d('0x33')][_0x0c8d('0x3b')]);_0x3a42e1[_0x0c8d('0x3c')]=qs[_0x0c8d('0x3d')](_[_0x0c8d('0x3e')](_0x94bff8['query'],_0x35c470[_0x0c8d('0x3d')]),_0x39ff1d);if(_0x94bff8[_0x0c8d('0x33')][_0x0c8d('0x3f')]){_0x3a42e1[_0x0c8d('0x3c')]=_[_0x0c8d('0x40')](_0x3a42e1[_0x0c8d('0x3c')],{'$or':_[_0x0c8d('0x2e')](_0x39ff1d,function(_0x3c0cf1){if(_0x3c0cf1[_0x0c8d('0x41')]!==_0x0c8d('0x42')){var _0x2caa10={};_0x2caa10[_0x3c0cf1[_0x0c8d('0x2b')]]={'$like':'%'+_0x94bff8['query']['filter']+'%'};return _0x2caa10;}})});}_0x3a42e1=_[_0x0c8d('0x40')]({},_0x3a42e1,_0x94bff8['options']);var _0x590cb3={'where':_0x3a42e1['where']};return db[_0x0c8d('0x43')]['count'](_0x590cb3)[_0x0c8d('0x16')](function(_0x1d6243){_0x46f01d['count']=_0x1d6243;if(_0x94bff8[_0x0c8d('0x33')][_0x0c8d('0x44')]){_0x3a42e1[_0x0c8d('0x45')]=[{'all':!![]}];}return db[_0x0c8d('0x43')][_0x0c8d('0x46')](_0x3a42e1);})[_0x0c8d('0x16')](function(_0x8ab813){_0x46f01d[_0x0c8d('0x47')]=_0x8ab813;return _0x46f01d;})[_0x0c8d('0x16')](respondWithFilteredResult(_0x5724bf,_0x3a42e1))[_0x0c8d('0x1e')](handleError(_0x5724bf,null));};exports['show']=function(_0x55ce4c,_0x2ddc16){var _0x198067={'raw':!![],'where':{'id':_0x55ce4c[_0x0c8d('0x48')]['id']}},_0x2eebe7={};_0x2eebe7[_0x0c8d('0x32')]=_[_0x0c8d('0x49')](db[_0x0c8d('0x43')]['rawAttributes']);_0x2eebe7[_0x0c8d('0x33')]=_[_0x0c8d('0x49')](_0x55ce4c[_0x0c8d('0x33')]);_0x2eebe7[_0x0c8d('0x3d')]=_[_0x0c8d('0x34')](_0x2eebe7[_0x0c8d('0x32')],_0x2eebe7[_0x0c8d('0x33')]);_0x198067[_0x0c8d('0x35')]=_[_0x0c8d('0x34')](_0x2eebe7[_0x0c8d('0x32')],qs[_0x0c8d('0x36')](_0x55ce4c[_0x0c8d('0x33')][_0x0c8d('0x36')]));_0x198067[_0x0c8d('0x35')]=_0x198067[_0x0c8d('0x35')][_0x0c8d('0x37')]?_0x198067[_0x0c8d('0x35')]:_0x2eebe7[_0x0c8d('0x32')];if(_0x55ce4c['query'][_0x0c8d('0x44')]){_0x198067[_0x0c8d('0x45')]=[{'all':!![]}];}_0x198067=_[_0x0c8d('0x40')]({},_0x198067,_0x55ce4c['options']);return db[_0x0c8d('0x43')][_0x0c8d('0x4a')](_0x198067)[_0x0c8d('0x16')](handleEntityNotFound(_0x2ddc16,null))[_0x0c8d('0x16')](respondWithResult(_0x2ddc16,null))['catch'](handleError(_0x2ddc16,null));};exports[_0x0c8d('0x27')]=function(_0xedab0a,_0x462bb7){if(_0xedab0a[_0x0c8d('0x4b')]['id']){delete _0xedab0a[_0x0c8d('0x4b')]['id'];}return db[_0x0c8d('0x43')]['find']({'where':{'id':_0xedab0a['params']['id']}})['then'](handleEntityNotFound(_0x462bb7,null))[_0x0c8d('0x16')](saveUpdates(_0xedab0a['body'],null))[_0x0c8d('0x16')](respondWithResult(_0x462bb7,null))[_0x0c8d('0x1e')](handleError(_0x462bb7,null));};exports[_0x0c8d('0x28')]=function(_0x32c8a0,_0x46a476){return db['MailMessage']['find']({'where':{'id':_0x32c8a0[_0x0c8d('0x48')]['id']}})[_0x0c8d('0x16')](handleEntityNotFound(_0x46a476,null))[_0x0c8d('0x16')](removeEntity(_0x46a476,null))[_0x0c8d('0x1e')](handleError(_0x46a476,null));};exports['describe']=function(_0x3dac1e,_0x572a00){return db[_0x0c8d('0x43')]['describe']()[_0x0c8d('0x16')](respondWithResult(_0x572a00,null))[_0x0c8d('0x1e')](handleError(_0x572a00,null));};exports[_0x0c8d('0x4c')]=function(_0x2f499e,_0x2f76f5){return db[_0x0c8d('0x43')]['create'](_0x2f499e[_0x0c8d('0x4b')])[_0x0c8d('0x16')](function(_0x322f83){if(_0x322f83){if(_0x322f83[_0x0c8d('0x4d')]===_0x0c8d('0x4e')&&!_0x322f83[_0x0c8d('0x4f')]){var _0x2aa3ff,_0x49ceed,_0x37245e;if(_0x2f499e[_0x0c8d('0x4b')]['to']){_0x49ceed=_0x2f499e[_0x0c8d('0x4b')]['to'][_0x0c8d('0x50')](',')[0x0];}return db[_0x0c8d('0x51')][_0x0c8d('0x52')]({'where':{'id':_0x322f83[_0x0c8d('0x53')]},'include':[{'model':db[_0x0c8d('0x54')],'as':_0x0c8d('0x55'),'include':[{'model':db[_0x0c8d('0x56')],'as':'Contacts','where':{'email':_0x49ceed},'limit':0x1,'order':[[_0x0c8d('0x57'),_0x0c8d('0x58')]]}]},{'model':db[_0x0c8d('0x59')],'as':_0x0c8d('0x5a'),'raw':!![]}]})[_0x0c8d('0x16')](function(_0x95cb29){_0x2aa3ff=_0x95cb29;if(_0x2aa3ff&&_0x2aa3ff[_0x0c8d('0x5a')]){var _0x2da4df={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x2aa3ff[_0x0c8d('0x5a')][_0x0c8d('0x5b')])){_0x2da4df[_0x0c8d('0x5c')]=_0x2aa3ff[_0x0c8d('0x5a')][_0x0c8d('0x5c')];_0x2da4df['port']=_0x2aa3ff[_0x0c8d('0x5a')][_0x0c8d('0x5d')];_0x2da4df[_0x0c8d('0x5e')]=_0x2aa3ff['Smtp'][_0x0c8d('0x5e')];if(_0x2aa3ff[_0x0c8d('0x5a')][_0x0c8d('0x5f')]){_0x2da4df[_0x0c8d('0x60')]={'user':_0x2aa3ff[_0x0c8d('0x5a')]['user'],'pass':_0x2aa3ff[_0x0c8d('0x5a')]['pass']};}}else{_0x2da4df[_0x0c8d('0x5b')]=_0x2aa3ff[_0x0c8d('0x5a')][_0x0c8d('0x5b')];_0x2da4df['auth']={'user':_0x2aa3ff['Smtp']['user'],'pass':_0x2aa3ff[_0x0c8d('0x5a')][_0x0c8d('0x61')]};_0x2da4df['secure']=_0x2aa3ff['Smtp'][_0x0c8d('0x5e')];}if(_0x2f499e[_0x0c8d('0x4b')][_0x0c8d('0x62')]&&_0x2f499e[_0x0c8d('0x4b')][_0x0c8d('0x62')]['length']){for(var _0x5caf57=0x0;_0x5caf57<_0x2f499e[_0x0c8d('0x4b')]['attachments'][_0x0c8d('0x37')];_0x5caf57+=0x1){_0x2f499e['body'][_0x0c8d('0x62')][_0x5caf57]={'filename':_0x2f499e[_0x0c8d('0x4b')][_0x0c8d('0x62')][_0x5caf57][_0x0c8d('0x2b')],'path':path[_0x0c8d('0x63')](config[_0x0c8d('0x64')],_0x0c8d('0x65'),_0x2f499e['body']['attachments'][_0x5caf57]['basename'])};}}_0x37245e={'account':_0x2da4df,'message':_0x2f499e[_0x0c8d('0x4b')]};return;}})[_0x0c8d('0x16')](function(){if(_0x2aa3ff[_0x0c8d('0x55')]){if(_0x2aa3ff[_0x0c8d('0x55')][_0x0c8d('0x66')][_0x0c8d('0x37')]){return _0x2aa3ff['List']['Contacts'][0x0];}else{return db[_0x0c8d('0x56')]['create'](_[_0x0c8d('0xd')](_0x2f499e[_0x0c8d('0x4b')],{'firstName':_0x2f499e[_0x0c8d('0x4b')]['to'],'email':_0x2f499e[_0x0c8d('0x4b')]['to'],'phone':_0x2f499e['body']['to'],'ListId':_0x2aa3ff['ListId']}));}}else{throw new Error(_0x0c8d('0x67'));}})[_0x0c8d('0x16')](function(){if(_0x37245e){return respondWithRpcPromise(_0x0c8d('0x68'),_0x0c8d('0x69'),_0x37245e,client9003)[_0x0c8d('0x16')](function(_0x2be84f){return _0x322f83['update']({'read':!![],'messageId':_0x2be84f[_0x0c8d('0x6a')],'sentAt':moment()['format'](_0x0c8d('0x6b'))});})[_0x0c8d('0x1e')](function(_0x5f5998){logger[_0x0c8d('0x1a')]('%s',JSON[_0x0c8d('0x19')](_0x5f5998));return _0x322f83;});}return _0x322f83;});}return _0x322f83;}})[_0x0c8d('0x16')](respondWithResult(_0x2f76f5,0xc9))[_0x0c8d('0x1e')](handleError(_0x2f76f5,null));};exports[_0x0c8d('0x6c')]=function(_0x31eb43,_0x31d2bc){var _0x38bf7f={'agent':{},'channel':'mail'};if(_0x31eb43[_0x0c8d('0x4b')]['id']){delete _0x31eb43['body']['id'];}_0x31eb43[_0x0c8d('0x4b')][_0x0c8d('0x6d')]=!![];_0x31eb43[_0x0c8d('0x4b')]['readAt']=moment()[_0x0c8d('0x6e')](_0x0c8d('0x6b'));_0x31eb43[_0x0c8d('0x4b')][_0x0c8d('0x6f')]=_0x31eb43['body']['UserId']||_0x31eb43['user']['id'];_0x38bf7f[_0x0c8d('0x70')]['id']=_0x31eb43[_0x0c8d('0x4b')][_0x0c8d('0x6f')];return db[_0x0c8d('0x43')][_0x0c8d('0x4a')]({'where':{'id':_0x31eb43[_0x0c8d('0x48')]['id'],'UserId':null}})[_0x0c8d('0x16')](handleEntityNotFound(_0x31d2bc,null))[_0x0c8d('0x16')](saveUpdates(_0x31eb43[_0x0c8d('0x4b')],null))[_0x0c8d('0x16')](function(_0x1df1f8){if(_0x1df1f8){_0x38bf7f[_0x0c8d('0x1c')]=_0x1df1f8[_0x0c8d('0x71')]({'plain':!![]});return db['MailInteraction'][_0x0c8d('0x4a')]({'where':{'id':_0x1df1f8[_0x0c8d('0x72')]}});}return null;})[_0x0c8d('0x16')](handleEntityNotFound(_0x31d2bc,null))['then'](function(_0x1b8ec4){if(_0x1b8ec4){return _0x1b8ec4['update']({'UserId':_0x31eb43[_0x0c8d('0x4b')][_0x0c8d('0x6f')],'read1stAt':_[_0x0c8d('0x73')](_0x1b8ec4[_0x0c8d('0x74')])?moment()['format'](_0x0c8d('0x6b')):undefined});}return null;})[_0x0c8d('0x16')](function(_0x255272){if(_0x255272){_0x38bf7f['interaction']=_0x255272['get']({'plain':!![]});interaction_log[_0x0c8d('0x1d')](_0x0c8d('0x75'),_0x31eb43['user']['id'],_0x31eb43[_0x0c8d('0x76')][_0x0c8d('0x2b')],_0x31eb43[_0x0c8d('0x76')]['role'],_0x38bf7f['interaction']['id'],_0x31eb43['body']?JSON['stringify'](_0x31eb43['body']):_0x0c8d('0x77'));return respondWithRpcPromise('AcceptMessage',_0x0c8d('0x78'),_0x38bf7f);}return null;})[_0x0c8d('0x16')](function(_0x27a70f){var _0x546f86=_0x0c8d('0x79')+_0x27a70f[_0x0c8d('0x1c')]['ContactId'];return db[_0x0c8d('0x7a')][_0x0c8d('0x33')](_0x546f86,{'type':db[_0x0c8d('0x7b')]['QueryTypes'][_0x0c8d('0x7c')],'raw':!![]})[_0x0c8d('0x16')](function(_0x382323){return _0x382323;});})[_0x0c8d('0x16')](function(_0x4409d0){if(_0x4409d0){_0x38bf7f['message']['contact']=_0x4409d0[0x0];if(!_0x31eb43['body'][_0x0c8d('0x6f')])return;return db[_0x0c8d('0x7d')][_0x0c8d('0x4a')]({'where':{'id':_0x31eb43['body'][_0x0c8d('0x6f')],'role':'agent'},'attributes':['id',_0x0c8d('0x2b'),'fullname',_0x0c8d('0x7e'),_0x0c8d('0x7f')],'raw':!![]});}return null;})[_0x0c8d('0x16')](function(_0x127f00){if(!_0x127f00)return null;_0x38bf7f['message'][_0x0c8d('0x70')]=_0x127f00;return _0x38bf7f;})[_0x0c8d('0x16')](function(_0x512295){if(_0x512295){if(_0x31eb43[_0x0c8d('0x4b')]['manual']){_0x38bf7f[_0x0c8d('0x1c')][_0x0c8d('0x80')]=util[_0x0c8d('0x6e')](_0x0c8d('0x81'),_0x31eb43[_0x0c8d('0x76')]['name']);_0x38bf7f['message'][_0x0c8d('0x82')]=_0x38bf7f[_0x0c8d('0x82')];_0x38bf7f['message'][_0x0c8d('0x83')]=_0x0c8d('0x6c');_0x38bf7f[_0x0c8d('0x1c')][_0x0c8d('0x4b')]=htmlToText[_0x0c8d('0x84')](_0x38bf7f[_0x0c8d('0x1c')][_0x0c8d('0x4b')]);return respondWithRpcPromise(_0x0c8d('0x85'),_0x0c8d('0x85'),{'event':'acceptmessage','message':_0x38bf7f[_0x0c8d('0x1c')]},client9002)[_0x0c8d('0x16')](function(){return _0x38bf7f;});}return _0x38bf7f;}return null;})[_0x0c8d('0x16')](respondWithResult(_0x31d2bc,null))['catch'](handleError(_0x31d2bc,null));};exports[_0x0c8d('0x86')]=function(_0x440699,_0x85149d){var _0x1d27cb={'agent':{},'channel':_0x0c8d('0x87')};if(_0x440699[_0x0c8d('0x4b')]['id']){delete _0x440699[_0x0c8d('0x4b')]['id'];}_0x440699[_0x0c8d('0x4b')][_0x0c8d('0x6f')]=_0x440699[_0x0c8d('0x4b')][_0x0c8d('0x6f')]||_0x440699['user']['id'];_0x1d27cb['agent']['id']=_0x440699['body']['UserId'];return db[_0x0c8d('0x43')][_0x0c8d('0x4a')]({'where':{'id':_0x440699[_0x0c8d('0x48')]['id'],'UserId':null}})[_0x0c8d('0x16')](handleEntityNotFound(_0x85149d,null))['then'](function(_0xe1454a){if(_0xe1454a){_0x1d27cb['message']=_0xe1454a[_0x0c8d('0x71')]({'plain':!![]});return db['MailInteraction'][_0x0c8d('0x4a')]({'where':{'id':_0xe1454a[_0x0c8d('0x72')]}});}return null;})[_0x0c8d('0x16')](handleEntityNotFound(_0x85149d,null))[_0x0c8d('0x16')](function(_0x5b3b7b){if(_0x5b3b7b){_0x1d27cb[_0x0c8d('0x88')]=_0x5b3b7b[_0x0c8d('0x71')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x440699[_0x0c8d('0x76')]['id'],_0x440699[_0x0c8d('0x76')][_0x0c8d('0x2b')],_0x440699[_0x0c8d('0x76')][_0x0c8d('0x89')],_0x1d27cb['interaction']['id'],_0x440699['body']?JSON[_0x0c8d('0x19')](_0x440699[_0x0c8d('0x4b')]):_0x0c8d('0x77'));return respondWithRpcPromise(_0x0c8d('0x8a'),'rejectMessage',_0x1d27cb);}return null;})[_0x0c8d('0x16')](function(_0x437a58){var _0x2d14f7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x437a58['message']['ContactId'];return db[_0x0c8d('0x7a')]['query'](_0x2d14f7,{'type':db[_0x0c8d('0x7b')][_0x0c8d('0x8b')][_0x0c8d('0x7c')],'raw':!![]})['then'](function(_0x3b4fad){return _0x3b4fad;});})[_0x0c8d('0x16')](function(_0x57afa4){if(_0x57afa4){_0x1d27cb['message'][_0x0c8d('0x8c')]=_0x57afa4[0x0];if(!_0x440699[_0x0c8d('0x4b')]['UserId'])return;return db[_0x0c8d('0x7d')][_0x0c8d('0x4a')]({'where':{'id':_0x440699[_0x0c8d('0x4b')][_0x0c8d('0x6f')],'role':_0x0c8d('0x70')},'attributes':['id',_0x0c8d('0x2b'),_0x0c8d('0x8d'),_0x0c8d('0x7e'),_0x0c8d('0x7f')],'raw':!![]});}return null;})[_0x0c8d('0x16')](function(_0x4c8f99){if(!_0x4c8f99)return null;_0x1d27cb[_0x0c8d('0x1c')][_0x0c8d('0x70')]=_0x4c8f99;return _0x1d27cb;})[_0x0c8d('0x16')](function(_0x917065){if(_0x917065){_0x917065[_0x0c8d('0x1c')][_0x0c8d('0x80')]=util[_0x0c8d('0x6e')](_0x0c8d('0x81'),_0x440699[_0x0c8d('0x76')][_0x0c8d('0x2b')]);_0x917065[_0x0c8d('0x1c')][_0x0c8d('0x82')]=_0x1d27cb['channel'];_0x917065[_0x0c8d('0x1c')][_0x0c8d('0x83')]=_0x0c8d('0x86');_0x917065['message'][_0x0c8d('0x4b')]=htmlToText[_0x0c8d('0x84')](_0x1d27cb[_0x0c8d('0x1c')]['body']);respondWithRpcPromise('EventManager','EventManager',{'event':_0x0c8d('0x8e'),'message':_0x917065[_0x0c8d('0x1c')]},client9002);return _0x1d27cb;}return null;})[_0x0c8d('0x16')](respondWithResult(_0x85149d,null))[_0x0c8d('0x1e')](handleError(_0x85149d,null));};exports[_0x0c8d('0x8f')]=function(_0x375c3f,_0x2ff9b3){var _0x271e3a=moment()[_0x0c8d('0x90')]()[_0x0c8d('0x91')]();var _0x2e40b2=path[_0x0c8d('0x63')](config[_0x0c8d('0x64')],_0x0c8d('0x92'),_0x0c8d('0x93'),_0x0c8d('0x94'));var _0x897565=path['join'](config[_0x0c8d('0x64')],_0x0c8d('0x92'),_0x0c8d('0x93'),_0x0c8d('0x62'));var _0x503b1a=util['format'](_0x0c8d('0x95'),_0x271e3a);return db['MailMessage']['find']({'where':{'id':_0x375c3f['params']['id']},'attributes':['id',_0x0c8d('0x4b'),_0x0c8d('0x96'),'to','cc',_0x0c8d('0x97'),_0x0c8d('0x98'),_0x0c8d('0x99')],'include':_0x375c3f['query'][_0x0c8d('0x62')]?[{'model':db[_0x0c8d('0x9a')],'as':_0x0c8d('0x9b')}]:undefined})['then'](handleEntityNotFound(_0x2ff9b3,null))[_0x0c8d('0x16')](function(_0x1b67d){if(_0x1b67d){var _0xd3d93a=_0x1b67d;var _0xcd5344={'from':_0xd3d93a[_0x0c8d('0x96')],'to':_0xd3d93a['to'],'subject':_0xd3d93a[_0x0c8d('0x98')],'html':htmlEntities[_0x0c8d('0x9c')](_0xd3d93a[_0x0c8d('0x4b')]),'headers':{'Date':moment(_0xd3d93a[_0x0c8d('0x99')])['format'](_0x0c8d('0x9d'))},'attachments':[]};if(_0x1b67d['cc']){_0xcd5344[_0x0c8d('0x9e')]['Cc']=_0x1b67d['cc'];}if(_0x1b67d[_0x0c8d('0x97')]){_0xcd5344[_0x0c8d('0x9e')][_0x0c8d('0x9f')]=_0x1b67d[_0x0c8d('0x97')];}return new BPromise(function(_0x5c5086,_0x56ed0a){if(_0x1b67d[_0x0c8d('0x9b')]){for(var _0x27f0e9=0x0;_0x27f0e9<_0x1b67d[_0x0c8d('0x9b')][_0x0c8d('0x37')];_0x27f0e9++){var _0x154ec2=_0x1b67d[_0x0c8d('0x9b')][_0x27f0e9];var _0x49c2b6=path['join'](_0x897565,_0x154ec2[_0x0c8d('0xa0')]);if(fs[_0x0c8d('0xa1')](_0x49c2b6)){_0xcd5344['attachments']['push']({'name':_0x154ec2['name'],'contentType':_0x154ec2['type'],'data':fs[_0x0c8d('0xa2')](_0x49c2b6)});}}}emlformat['build'](_0xcd5344,function(_0x28c141,_0x3de69d){if(_0x28c141)return _0x56ed0a(_0x28c141);fs['writeFileSync'](path[_0x0c8d('0x63')](_0x2e40b2,_0x503b1a),_0x3de69d);return _0x5c5086(_0x3de69d);});});}})[_0x0c8d('0x16')](function(_0x3049f3){if(_0x3049f3){return _0x2ff9b3[_0x0c8d('0x8f')](path[_0x0c8d('0x63')](_0x2e40b2,_0x503b1a),_0x503b1a,function(_0x55dec0){if(!_0x55dec0)fs[_0x0c8d('0xa3')](path[_0x0c8d('0x63')](_0x2e40b2,_0x503b1a));});}})[_0x0c8d('0x1e')](handleError(_0x2ff9b3,null));};
\ No newline at end of file
+var _0x153e=['stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','include','options','find','catch','body','params','describe','create','direction','secret','MailAccount','findOne','MailAccountId','CmList','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','user','auth','pass','attachments','join','root','server/files/attachments','basename','List','Contacts','CmContact','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','User','fullname','email','internal','manual','interface','channel','event','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','SELECT','SIP/%s','fromString','rejectmessage','unix','files','tmp','server','from','subject','createdAt','Attachments','headers','bcc','Bcc','push','readFileSync','build','writeFileSync','download','unlinkSync','bluebird','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','http','request','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','json','limit','undefined','count','offset','set','update','destroy','then','end','sendStatus'];(function(_0x4c5e8b,_0x7fb5a4){var _0x51d31b=function(_0x817965){while(--_0x817965){_0x4c5e8b['push'](_0x4c5e8b['shift']());}};_0x51d31b(++_0x7fb5a4);}(_0x153e,0x11f));var _0xe153=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x153e[_0x39f34f];return _0x59fee1;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0xe153('0x0'));var util=require('util');var path=require(_0xe153('0x1'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xe153('0x2'));var htmlToText=require(_0xe153('0x3'));var qs=require(_0xe153('0x4'));var logger=require(_0xe153('0x5'))(_0xe153('0x6'));var interaction_log=require(_0xe153('0x5'))('mail-interactions');var config=require('../../config/environment');var db=require(_0xe153('0x7'))['db'];config['redis']=_[_0xe153('0x8')](config[_0xe153('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xe153('0xa'))(new Redis(config[_0xe153('0x9')]));var htmlEntities=require(_0xe153('0xb'));require(_0xe153('0xc'))[_0xe153('0xd')](socket);var jayson=require(_0xe153('0xe'));var client=jayson['client'][_0xe153('0xf')]({'port':0x232c});var client9003=jayson['client'][_0xe153('0xf')]({'port':0x232b});var client9002=jayson['client'][_0xe153('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x4024c1,_0x2a7444,_0x3e8be6,_0x197261){return new BPromise(function(_0x2ac4e6,_0x50aa05){var _0x213e29=_0x197261||client;return _0x213e29[_0xe153('0x10')](_0x4024c1,_0x3e8be6)['then'](function(_0x4fd65c){logger['info'](_0xe153('0x11'),_0x2a7444,_0xe153('0x12'));logger[_0xe153('0x13')](_0xe153('0x14'),_0x2a7444,'request\x20sent',JSON[_0xe153('0x15')](_0x4fd65c));if(_0x4fd65c['error']){if(_0x4fd65c[_0xe153('0x16')][_0xe153('0x17')]===0x1f4){logger[_0xe153('0x16')](_0xe153('0x11'),_0x2a7444,_0x4fd65c[_0xe153('0x16')][_0xe153('0x18')]);return _0x50aa05(_0x4fd65c[_0xe153('0x16')][_0xe153('0x18')]);}logger[_0xe153('0x16')](_0xe153('0x11'),_0x2a7444,_0x4fd65c[_0xe153('0x16')][_0xe153('0x18')]);return _0x2ac4e6(_0x4fd65c[_0xe153('0x16')][_0xe153('0x18')]);}else{logger[_0xe153('0x19')]('MailMessage,\x20%s,\x20%s',_0x2a7444,_0xe153('0x12'));_0x2ac4e6(_0x4fd65c[_0xe153('0x1a')][_0xe153('0x18')]);}})['catch'](function(_0x38e14e){logger['error'](_0xe153('0x11'),_0x2a7444,_0x38e14e);_0x50aa05(_0x38e14e);});});}function respondWithResult(_0x3ad143,_0x302827){_0x302827=_0x302827||0xc8;return function(_0x462815){if(_0x462815){return _0x3ad143[_0xe153('0x1b')](_0x302827)[_0xe153('0x1c')](_0x462815);}};}function respondWithFilteredResult(_0x17ac0c,_0x38a58e){return function(_0x10e804){if(_0x10e804){var _0x554ffa=typeof _0x38a58e['offset']==='undefined'&&typeof _0x38a58e[_0xe153('0x1d')]===_0xe153('0x1e');var _0x578cc8=_0x10e804[_0xe153('0x1f')];var _0x1b1ee=_0x554ffa?0x0:_0x38a58e['offset'];var _0xe7af0c=_0x554ffa?_0x10e804[_0xe153('0x1f')]:_0x38a58e[_0xe153('0x20')]+_0x38a58e[_0xe153('0x1d')];var _0x700d92;if(_0xe7af0c>=_0x578cc8){_0xe7af0c=_0x578cc8;_0x700d92=0xc8;}else{_0x700d92=0xce;}_0x17ac0c[_0xe153('0x1b')](_0x700d92);return _0x17ac0c[_0xe153('0x21')]('Content-Range',_0x1b1ee+'-'+_0xe7af0c+'/'+_0x578cc8)['json'](_0x10e804);}return null;};}function saveUpdates(_0x33459f){return function(_0x5ca4a5){if(_0x5ca4a5){return _0x5ca4a5[_0xe153('0x22')](_0x33459f)['then'](function(_0x40fb43){return _0x40fb43;});}return null;};}function removeEntity(_0x192a7a){return function(_0x308ea8){if(_0x308ea8){return _0x308ea8[_0xe153('0x23')]()[_0xe153('0x24')](function(){_0x192a7a[_0xe153('0x1b')](0xcc)[_0xe153('0x25')]();});}};}function handleEntityNotFound(_0x7c3e70){return function(_0x3405d6){if(!_0x3405d6){_0x7c3e70[_0xe153('0x26')](0x194);}return _0x3405d6;};}function handleError(_0x2d2cb9,_0x22dbe7){_0x22dbe7=_0x22dbe7||0x1f4;return function(_0x13945c){logger[_0xe153('0x16')](_0x13945c[_0xe153('0x27')]);if(_0x13945c[_0xe153('0x28')]){delete _0x13945c['name'];}_0x2d2cb9['status'](_0x22dbe7)[_0xe153('0x29')](_0x13945c);};}exports[_0xe153('0x2a')]=function(_0x535fbc,_0x5eb6e2){var _0x82ee29={},_0x2d1e54={},_0x5108ec={'count':0x0,'rows':[]};var _0x40bf84=_[_0xe153('0x2b')](db[_0xe153('0x2c')][_0xe153('0x2d')],function(_0x4b5b19){return{'name':_0x4b5b19[_0xe153('0x2e')],'type':_0x4b5b19[_0xe153('0x2f')][_0xe153('0x30')]};});_0x2d1e54['model']=_[_0xe153('0x2b')](_0x40bf84,'name');_0x2d1e54[_0xe153('0x31')]=_[_0xe153('0x32')](_0x535fbc[_0xe153('0x31')]);_0x2d1e54[_0xe153('0x33')]=_[_0xe153('0x34')](_0x2d1e54[_0xe153('0x35')],_0x2d1e54[_0xe153('0x31')]);_0x82ee29[_0xe153('0x36')]=_['intersection'](_0x2d1e54['model'],qs[_0xe153('0x37')](_0x535fbc[_0xe153('0x31')][_0xe153('0x37')]));_0x82ee29['attributes']=_0x82ee29[_0xe153('0x36')][_0xe153('0x38')]?_0x82ee29['attributes']:_0x2d1e54['model'];if(!_0x535fbc[_0xe153('0x31')]['hasOwnProperty']('nolimit')){_0x82ee29[_0xe153('0x1d')]=qs['limit'](_0x535fbc[_0xe153('0x31')]['limit']);_0x82ee29[_0xe153('0x20')]=qs[_0xe153('0x20')](_0x535fbc[_0xe153('0x31')]['offset']);}_0x82ee29['order']=qs[_0xe153('0x39')](_0x535fbc[_0xe153('0x31')]['sort']);_0x82ee29[_0xe153('0x3a')]=qs[_0xe153('0x33')](_[_0xe153('0x3b')](_0x535fbc[_0xe153('0x31')],_0x2d1e54[_0xe153('0x33')]),_0x40bf84);if(_0x535fbc[_0xe153('0x31')][_0xe153('0x3c')]){_0x82ee29[_0xe153('0x3a')]=_[_0xe153('0x3d')](_0x82ee29['where'],{'$or':_['map'](_0x40bf84,function(_0x11e0a3){if(_0x11e0a3[_0xe153('0x2f')]!==_0xe153('0x3e')){var _0x1d5798={};_0x1d5798[_0x11e0a3[_0xe153('0x28')]]={'$like':'%'+_0x535fbc['query'][_0xe153('0x3c')]+'%'};return _0x1d5798;}})});}_0x82ee29=_[_0xe153('0x3d')]({},_0x82ee29,_0x535fbc['options']);var _0x26c7c9={'where':_0x82ee29['where']};return db['MailMessage'][_0xe153('0x1f')](_0x26c7c9)['then'](function(_0x1b6f87){_0x5108ec[_0xe153('0x1f')]=_0x1b6f87;if(_0x535fbc[_0xe153('0x31')][_0xe153('0x3f')]){_0x82ee29['include']=[{'all':!![]}];}return db[_0xe153('0x2c')][_0xe153('0x40')](_0x82ee29);})['then'](function(_0x3a505d){_0x5108ec[_0xe153('0x41')]=_0x3a505d;return _0x5108ec;})[_0xe153('0x24')](respondWithFilteredResult(_0x5eb6e2,_0x82ee29))['catch'](handleError(_0x5eb6e2,null));};exports[_0xe153('0x42')]=function(_0x2a5c01,_0x17a763){var _0x180a36={'raw':!![],'where':{'id':_0x2a5c01['params']['id']}},_0x9fcc9b={};_0x9fcc9b[_0xe153('0x35')]=_[_0xe153('0x32')](db[_0xe153('0x2c')]['rawAttributes']);_0x9fcc9b[_0xe153('0x31')]=_[_0xe153('0x32')](_0x2a5c01[_0xe153('0x31')]);_0x9fcc9b['filters']=_[_0xe153('0x34')](_0x9fcc9b[_0xe153('0x35')],_0x9fcc9b[_0xe153('0x31')]);_0x180a36[_0xe153('0x36')]=_['intersection'](_0x9fcc9b['model'],qs[_0xe153('0x37')](_0x2a5c01['query'][_0xe153('0x37')]));_0x180a36[_0xe153('0x36')]=_0x180a36['attributes']['length']?_0x180a36[_0xe153('0x36')]:_0x9fcc9b[_0xe153('0x35')];if(_0x2a5c01[_0xe153('0x31')][_0xe153('0x3f')]){_0x180a36[_0xe153('0x43')]=[{'all':!![]}];}_0x180a36=_[_0xe153('0x3d')]({},_0x180a36,_0x2a5c01[_0xe153('0x44')]);return db[_0xe153('0x2c')][_0xe153('0x45')](_0x180a36)[_0xe153('0x24')](handleEntityNotFound(_0x17a763,null))[_0xe153('0x24')](respondWithResult(_0x17a763,null))[_0xe153('0x46')](handleError(_0x17a763,null));};exports['update']=function(_0x2b770c,_0x24b273){if(_0x2b770c[_0xe153('0x47')]['id']){delete _0x2b770c[_0xe153('0x47')]['id'];}return db[_0xe153('0x2c')]['find']({'where':{'id':_0x2b770c['params']['id']}})[_0xe153('0x24')](handleEntityNotFound(_0x24b273,null))[_0xe153('0x24')](saveUpdates(_0x2b770c['body'],null))[_0xe153('0x24')](respondWithResult(_0x24b273,null))[_0xe153('0x46')](handleError(_0x24b273,null));};exports[_0xe153('0x23')]=function(_0x2fb16b,_0xe21224){return db[_0xe153('0x2c')][_0xe153('0x45')]({'where':{'id':_0x2fb16b[_0xe153('0x48')]['id']}})['then'](handleEntityNotFound(_0xe21224,null))[_0xe153('0x24')](removeEntity(_0xe21224,null))[_0xe153('0x46')](handleError(_0xe21224,null));};exports[_0xe153('0x49')]=function(_0x169fb5,_0x309cdd){return db[_0xe153('0x2c')]['describe']()[_0xe153('0x24')](respondWithResult(_0x309cdd,null))[_0xe153('0x46')](handleError(_0x309cdd,null));};exports[_0xe153('0x4a')]=function(_0x58cde4,_0x435376){return db[_0xe153('0x2c')]['create'](_0x58cde4[_0xe153('0x47')])['then'](function(_0x26790d){if(_0x26790d){if(_0x26790d[_0xe153('0x4b')]==='out'&&!_0x26790d[_0xe153('0x4c')]){var _0x2d5f94,_0x146eae,_0x2e76e7;if(_0x58cde4[_0xe153('0x47')]['to']){_0x146eae=_0x58cde4[_0xe153('0x47')]['to']['split'](',')[0x0];}return db[_0xe153('0x4d')][_0xe153('0x4e')]({'where':{'id':_0x26790d[_0xe153('0x4f')]},'include':[{'model':db[_0xe153('0x50')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x146eae},'limit':0x1,'order':[[_0xe153('0x51'),_0xe153('0x52')]]}]},{'model':db[_0xe153('0x53')],'as':_0xe153('0x54'),'raw':!![]}]})[_0xe153('0x24')](function(_0x3ddc4b){_0x2d5f94=_0x3ddc4b;if(_0x2d5f94&&_0x2d5f94[_0xe153('0x54')]){var _0x563d27={'tls':{'rejectUnauthorized':![]}};if(_[_0xe153('0x55')](_0x2d5f94['Smtp'][_0xe153('0x56')])){_0x563d27[_0xe153('0x57')]=_0x2d5f94['Smtp'][_0xe153('0x57')];_0x563d27[_0xe153('0x58')]=_0x2d5f94['Smtp'][_0xe153('0x58')];_0x563d27[_0xe153('0x59')]=_0x2d5f94[_0xe153('0x54')]['secure'];if(_0x2d5f94['Smtp'][_0xe153('0x5a')]){_0x563d27['auth']={'user':_0x2d5f94[_0xe153('0x54')][_0xe153('0x5b')],'pass':_0x2d5f94[_0xe153('0x54')]['pass']};}}else{_0x563d27[_0xe153('0x56')]=_0x2d5f94['Smtp'][_0xe153('0x56')];_0x563d27[_0xe153('0x5c')]={'user':_0x2d5f94[_0xe153('0x54')][_0xe153('0x5b')],'pass':_0x2d5f94[_0xe153('0x54')][_0xe153('0x5d')]};_0x563d27['secure']=_0x2d5f94[_0xe153('0x54')]['secure'];}if(_0x58cde4[_0xe153('0x47')][_0xe153('0x5e')]&&_0x58cde4[_0xe153('0x47')][_0xe153('0x5e')][_0xe153('0x38')]){for(var _0xbf7019=0x0;_0xbf7019<_0x58cde4[_0xe153('0x47')]['attachments']['length'];_0xbf7019+=0x1){_0x58cde4[_0xe153('0x47')]['attachments'][_0xbf7019]={'filename':_0x58cde4[_0xe153('0x47')][_0xe153('0x5e')][_0xbf7019]['name'],'path':path[_0xe153('0x5f')](config[_0xe153('0x60')],_0xe153('0x61'),_0x58cde4[_0xe153('0x47')][_0xe153('0x5e')][_0xbf7019][_0xe153('0x62')])};}}_0x2e76e7={'account':_0x563d27,'message':_0x58cde4['body']};return;}})[_0xe153('0x24')](function(){if(_0x2d5f94[_0xe153('0x63')]){if(_0x2d5f94[_0xe153('0x63')][_0xe153('0x64')]['length']){return _0x2d5f94[_0xe153('0x63')]['Contacts'][0x0];}else{return db[_0xe153('0x65')][_0xe153('0x4a')](_[_0xe153('0x8')](_0x58cde4[_0xe153('0x47')],{'firstName':_0x58cde4[_0xe153('0x47')]['to'],'email':_0x58cde4[_0xe153('0x47')]['to'],'phone':_0x58cde4['body']['to'],'ListId':_0x2d5f94[_0xe153('0x66')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x2e76e7){return respondWithRpcPromise(_0xe153('0x67'),_0xe153('0x68'),_0x2e76e7,client9003)[_0xe153('0x24')](function(_0x314fd6){return _0x26790d[_0xe153('0x22')]({'read':!![],'messageId':_0x314fd6[_0xe153('0x69')],'sentAt':moment()[_0xe153('0x6a')](_0xe153('0x6b'))});})[_0xe153('0x46')](function(_0x21e64a){logger[_0xe153('0x16')]('%s',JSON[_0xe153('0x15')](_0x21e64a));return _0x26790d;});}return _0x26790d;});}return _0x26790d;}})['then'](respondWithResult(_0x435376,0xc9))[_0xe153('0x46')](handleError(_0x435376,null));};exports[_0xe153('0x6c')]=function(_0x25f303,_0x4445e9){var _0xfaee8={'agent':{},'channel':_0xe153('0x6d')};if(_0x25f303['body']['id']){delete _0x25f303[_0xe153('0x47')]['id'];}_0x25f303[_0xe153('0x47')][_0xe153('0x6e')]=!![];_0x25f303['body'][_0xe153('0x6f')]=moment()['format'](_0xe153('0x6b'));_0x25f303[_0xe153('0x47')]['UserId']=_0x25f303[_0xe153('0x47')][_0xe153('0x70')]||_0x25f303[_0xe153('0x5b')]['id'];_0xfaee8[_0xe153('0x71')]['id']=_0x25f303['body'][_0xe153('0x70')];return db[_0xe153('0x2c')][_0xe153('0x45')]({'where':{'id':_0x25f303['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4445e9,null))[_0xe153('0x24')](saveUpdates(_0x25f303[_0xe153('0x47')],null))[_0xe153('0x24')](function(_0x5b73ed){if(_0x5b73ed){_0xfaee8['message']=_0x5b73ed[_0xe153('0x72')]({'plain':!![]});return db[_0xe153('0x73')][_0xe153('0x45')]({'where':{'id':_0x5b73ed[_0xe153('0x74')]}});}return null;})[_0xe153('0x24')](handleEntityNotFound(_0x4445e9,null))[_0xe153('0x24')](function(_0x2a1a21){if(_0x2a1a21){return _0x2a1a21[_0xe153('0x22')]({'UserId':_0x25f303[_0xe153('0x47')][_0xe153('0x70')],'read1stAt':_[_0xe153('0x55')](_0x2a1a21[_0xe153('0x75')])?moment()[_0xe153('0x6a')](_0xe153('0x6b')):undefined});}return null;})[_0xe153('0x24')](function(_0x4875bd){if(_0x4875bd){_0xfaee8[_0xe153('0x76')]=_0x4875bd[_0xe153('0x72')]({'plain':!![]});interaction_log[_0xe153('0x19')](_0xe153('0x77'),_0x25f303[_0xe153('0x5b')]['id'],_0x25f303[_0xe153('0x5b')][_0xe153('0x28')],_0x25f303[_0xe153('0x5b')][_0xe153('0x78')],_0xfaee8[_0xe153('0x76')]['id'],_0x25f303['body']?JSON[_0xe153('0x15')](_0x25f303[_0xe153('0x47')]):_0xe153('0x79'));return respondWithRpcPromise(_0xe153('0x7a'),'acceptMessage',_0xfaee8);}return null;})[_0xe153('0x24')](function(_0x4085cd){var _0x3a55a1=_0xe153('0x7b')+_0x4085cd[_0xe153('0x18')]['ContactId'];return db[_0xe153('0x7c')]['query'](_0x3a55a1,{'type':db['Sequelize'][_0xe153('0x7d')]['SELECT'],'raw':!![]})[_0xe153('0x24')](function(_0x470738){return _0x470738;});})[_0xe153('0x24')](function(_0x25fec2){if(_0x25fec2){_0xfaee8[_0xe153('0x18')]['contact']=_0x25fec2[0x0];if(!_0x25f303[_0xe153('0x47')]['UserId'])return;return db[_0xe153('0x7e')][_0xe153('0x45')]({'where':{'id':_0x25f303['body'][_0xe153('0x70')],'role':'agent'},'attributes':['id','name',_0xe153('0x7f'),_0xe153('0x80'),_0xe153('0x81')],'raw':!![]});}return null;})[_0xe153('0x24')](function(_0x16f1ca){if(!_0x16f1ca)return null;_0xfaee8['message'][_0xe153('0x71')]=_0x16f1ca;return _0xfaee8;})['then'](function(_0x149328){if(_0x149328){if(_0x25f303[_0xe153('0x47')][_0xe153('0x82')]){_0xfaee8[_0xe153('0x18')][_0xe153('0x83')]=util[_0xe153('0x6a')]('SIP/%s',_0x25f303[_0xe153('0x5b')][_0xe153('0x28')]);_0xfaee8[_0xe153('0x18')][_0xe153('0x84')]=_0xfaee8['channel'];_0xfaee8['message'][_0xe153('0x85')]=_0xe153('0x6c');_0xfaee8['message']['body']=htmlToText['fromString'](_0xfaee8[_0xe153('0x18')][_0xe153('0x47')]);return respondWithRpcPromise(_0xe153('0x86'),_0xe153('0x86'),{'event':_0xe153('0x87'),'message':_0xfaee8['message']},client9002)[_0xe153('0x24')](function(){return _0xfaee8;});}return _0xfaee8;}return null;})['then'](respondWithResult(_0x4445e9,null))[_0xe153('0x46')](handleError(_0x4445e9,null));};exports[_0xe153('0x88')]=function(_0x3aeedc,_0x45cd1d){var _0x554acd={'agent':{},'channel':_0xe153('0x6d')};if(_0x3aeedc[_0xe153('0x47')]['id']){delete _0x3aeedc[_0xe153('0x47')]['id'];}_0x3aeedc[_0xe153('0x47')][_0xe153('0x70')]=_0x3aeedc['body'][_0xe153('0x70')]||_0x3aeedc['user']['id'];_0x554acd[_0xe153('0x71')]['id']=_0x3aeedc[_0xe153('0x47')][_0xe153('0x70')];return db[_0xe153('0x2c')][_0xe153('0x45')]({'where':{'id':_0x3aeedc[_0xe153('0x48')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x45cd1d,null))['then'](function(_0x335a9e){if(_0x335a9e){_0x554acd[_0xe153('0x18')]=_0x335a9e[_0xe153('0x72')]({'plain':!![]});return db['MailInteraction'][_0xe153('0x45')]({'where':{'id':_0x335a9e[_0xe153('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x45cd1d,null))[_0xe153('0x24')](function(_0x22ee31){if(_0x22ee31){_0x554acd['interaction']=_0x22ee31[_0xe153('0x72')]({'plain':!![]});interaction_log[_0xe153('0x19')](_0xe153('0x89'),_0x3aeedc[_0xe153('0x5b')]['id'],_0x3aeedc[_0xe153('0x5b')][_0xe153('0x28')],_0x3aeedc[_0xe153('0x5b')][_0xe153('0x78')],_0x554acd[_0xe153('0x76')]['id'],_0x3aeedc['body']?JSON['stringify'](_0x3aeedc['body']):_0xe153('0x79'));return respondWithRpcPromise(_0xe153('0x8a'),_0xe153('0x8b'),_0x554acd);}return null;})[_0xe153('0x24')](function(_0x390779){var _0x401e8c=_0xe153('0x7b')+_0x390779[_0xe153('0x18')][_0xe153('0x8c')];return db[_0xe153('0x7c')][_0xe153('0x31')](_0x401e8c,{'type':db[_0xe153('0x8d')][_0xe153('0x7d')][_0xe153('0x8e')],'raw':!![]})['then'](function(_0x216e2d){return _0x216e2d;});})[_0xe153('0x24')](function(_0x3ca386){if(_0x3ca386){_0x554acd[_0xe153('0x18')]['contact']=_0x3ca386[0x0];if(!_0x3aeedc['body'][_0xe153('0x70')])return;return db[_0xe153('0x7e')][_0xe153('0x45')]({'where':{'id':_0x3aeedc[_0xe153('0x47')][_0xe153('0x70')],'role':'agent'},'attributes':['id',_0xe153('0x28'),_0xe153('0x7f'),_0xe153('0x80'),_0xe153('0x81')],'raw':!![]});}return null;})[_0xe153('0x24')](function(_0x4e611b){if(!_0x4e611b)return null;_0x554acd[_0xe153('0x18')][_0xe153('0x71')]=_0x4e611b;return _0x554acd;})[_0xe153('0x24')](function(_0xffc591){if(_0xffc591){_0xffc591[_0xe153('0x18')][_0xe153('0x83')]=util['format'](_0xe153('0x8f'),_0x3aeedc[_0xe153('0x5b')][_0xe153('0x28')]);_0xffc591[_0xe153('0x18')][_0xe153('0x84')]=_0x554acd[_0xe153('0x84')];_0xffc591[_0xe153('0x18')][_0xe153('0x85')]=_0xe153('0x88');_0xffc591[_0xe153('0x18')]['body']=htmlToText[_0xe153('0x90')](_0x554acd[_0xe153('0x18')][_0xe153('0x47')]);respondWithRpcPromise(_0xe153('0x86'),_0xe153('0x86'),{'event':_0xe153('0x91'),'message':_0xffc591[_0xe153('0x18')]},client9002);return _0x554acd;}return null;})[_0xe153('0x24')](respondWithResult(_0x45cd1d,null))['catch'](handleError(_0x45cd1d,null));};exports['download']=function(_0x454dd4,_0x351287){var _0x67316b=moment()[_0xe153('0x92')]()['toString']();var _0x1dbf2a=path[_0xe153('0x5f')](config[_0xe153('0x60')],'server',_0xe153('0x93'),_0xe153('0x94'));var _0x28f418=path['join'](config['root'],_0xe153('0x95'),'files',_0xe153('0x5e'));var _0x4e1946=util[_0xe153('0x6a')]('message-%s.eml',_0x67316b);return db['MailMessage'][_0xe153('0x45')]({'where':{'id':_0x454dd4[_0xe153('0x48')]['id']},'attributes':['id',_0xe153('0x47'),_0xe153('0x96'),'to','cc','bcc',_0xe153('0x97'),_0xe153('0x98')],'include':_0x454dd4[_0xe153('0x31')][_0xe153('0x5e')]?[{'model':db['Attachment'],'as':_0xe153('0x99')}]:undefined})[_0xe153('0x24')](handleEntityNotFound(_0x351287,null))['then'](function(_0x4cbece){if(_0x4cbece){var _0x5150ae=_0x4cbece;var _0x2926dd={'from':_0x5150ae[_0xe153('0x96')],'to':_0x5150ae['to'],'subject':_0x5150ae[_0xe153('0x97')],'html':htmlEntities['decode'](_0x5150ae[_0xe153('0x47')]),'headers':{'Date':moment(_0x5150ae['createdAt'])[_0xe153('0x6a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4cbece['cc']){_0x2926dd[_0xe153('0x9a')]['Cc']=_0x4cbece['cc'];}if(_0x4cbece[_0xe153('0x9b')]){_0x2926dd[_0xe153('0x9a')][_0xe153('0x9c')]=_0x4cbece[_0xe153('0x9b')];}return new BPromise(function(_0x3b0cf3,_0x59bb82){if(_0x4cbece['Attachments']){for(var _0x270c2b=0x0;_0x270c2b<_0x4cbece['Attachments'][_0xe153('0x38')];_0x270c2b++){var _0x2ea1cb=_0x4cbece[_0xe153('0x99')][_0x270c2b];var _0x5c4e46=path['join'](_0x28f418,_0x2ea1cb[_0xe153('0x62')]);if(fs['existsSync'](_0x5c4e46)){_0x2926dd[_0xe153('0x5e')][_0xe153('0x9d')]({'name':_0x2ea1cb['name'],'contentType':_0x2ea1cb['type'],'data':fs[_0xe153('0x9e')](_0x5c4e46)});}}}emlformat[_0xe153('0x9f')](_0x2926dd,function(_0x58dbaa,_0x42e52b){if(_0x58dbaa)return _0x59bb82(_0x58dbaa);fs[_0xe153('0xa0')](path[_0xe153('0x5f')](_0x1dbf2a,_0x4e1946),_0x42e52b);return _0x3b0cf3(_0x42e52b);});});}})[_0xe153('0x24')](function(_0x27c0b4){if(_0x27c0b4){return _0x351287[_0xe153('0xa1')](path['join'](_0x1dbf2a,_0x4e1946),_0x4e1946,function(_0x11bb4c){if(!_0x11bb4c)fs[_0xe153('0xa2')](path['join'](_0x1dbf2a,_0x4e1946));});}})['catch'](handleError(_0x351287,null));};
\ No newline at end of file
index a823e1a..115c49e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b52=['MailMessage','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x1b52,0x1d4));var _0x21b5=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0x1b52[_0x55969b];return _0x3d7fc1;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x21b5('0x0'))['db'][_0x21b5('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x21b5('0x2'),'afterUpdate':_0x21b5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f6f78){return function(_0x204d8c,_0x2f07c8,_0x3672db){MailMessageEvents['emit'](_0x2f6f78+':'+_0x204d8c['id'],_0x204d8c);MailMessageEvents[_0x21b5('0x4')](_0x2f6f78,_0x204d8c);_0x3672db(null);};}for(var e in events){if(events[_0x21b5('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x21b5('0x6')]=MailMessageEvents;
\ No newline at end of file
+var _0x6c52=['save','update','remove','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0xd17717,_0x216479){var _0x421e11=function(_0x332f5){while(--_0x332f5){_0xd17717['push'](_0xd17717['shift']());}};_0x421e11(++_0x216479);}(_0x6c52,0x100));var _0x26c5=function(_0x5a107c,_0x4803cf){_0x5a107c=_0x5a107c-0x0;var _0x1bd525=_0x6c52[_0x5a107c];return _0x1bd525;};'use strict';var EventEmitter=require(_0x26c5('0x0'));var MailMessage=require(_0x26c5('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x26c5('0x2')](0x0);var events={'afterCreate':_0x26c5('0x3'),'afterUpdate':_0x26c5('0x4'),'afterDestroy':_0x26c5('0x5')};function emitEvent(_0x322c7c){return function(_0x3dc493,_0x96deb4,_0xeb0464){MailMessageEvents['emit'](_0x322c7c+':'+_0x3dc493['id'],_0x3dc493);MailMessageEvents['emit'](_0x322c7c,_0x3dc493);_0xeb0464(null);};}for(var e in events){if(events[_0x26c5('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index 040ec4c..6e92b90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79b4=['direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','models','get'];(function(_0x5c8cd3,_0x420d25){var _0x49f896=function(_0x4cc678){while(--_0x4cc678){_0x5c8cd3['push'](_0x5c8cd3['shift']());}};_0x49f896(++_0x420d25);}(_0x79b4,0xb8));var _0x479b=function(_0x595510,_0x5cc2a9){_0x595510=_0x595510-0x0;var _0x250751=_0x79b4[_0x595510];return _0x250751;};'use strict';var _=require('lodash');var util=require(_0x479b('0x0'));var logger=require('../../config/logger')(_0x479b('0x1'));var moment=require(_0x479b('0x2'));var BPromise=require(_0x479b('0x3'));var rp=require(_0x479b('0x4'));var htmlToText=require(_0x479b('0x5'));var fs=require('fs');var path=require(_0x479b('0x6'));var rimraf=require(_0x479b('0x7'));var config=require('../../config/environment');var attributes=require(_0x479b('0x8'));module['exports']=function(_0x1af18b,_0x341149){return _0x1af18b[_0x479b('0x9')](_0x479b('0xa'),attributes,{'tableName':_0x479b('0xb'),'paranoid':![],'indexes':[{'name':_0x479b('0xc'),'fields':[_0x479b('0xc')]},{'name':_0x479b('0xd'),'fields':['plainBody',_0x479b('0xe')],'type':_0x479b('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a3ba1,_0x5758e4,_0x313fbd){if(_0x2a3ba1[_0x479b('0x10')]){_0x2a3ba1[_0x479b('0x11')]=htmlToText['fromString'](_0x2a3ba1['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x313fbd(null,_0x5758e4);},'afterCreate':function(_0x3d9b0e,_0x255d6f,_0x3813d6){var _0x3ff4d0=_0x1af18b[_0x479b('0x12')];var _0x207e0d=_0x3d9b0e[_0x479b('0x13')]({'plain':!![]});if(_0x207e0d[_0x479b('0x14')][_0x479b('0x15')]()==='in'||_0x207e0d[_0x479b('0x14')][_0x479b('0x15')]()===_0x479b('0x16')&&!_0x207e0d[_0x479b('0x17')]&&!_[_0x479b('0x18')](_0x207e0d[_0x479b('0x19')])){_0x3ff4d0[_0x479b('0x1a')][_0x479b('0x1b')]({'where':{'id':_0x207e0d[_0x479b('0x1c')]}})[_0x479b('0x1d')](function(_0x1901d0){if(_0x1901d0){_0x1901d0[_0x479b('0x1e')]({'lastMsgAt':_0x207e0d[_0x479b('0x1f')],'lastMsgDirection':_0x207e0d[_0x479b('0x14')][_0x479b('0x15')]()});}})[_0x479b('0x20')](function(_0x1f86aa){console['error'](_0x1f86aa);});}_0x3813d6();}},'charset':_0x479b('0x21'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x9dab=['UserId','MailInteraction','findOne','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','plainBody','subject','FULLTEXT','fromString','body','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x188f17,_0x348963){var _0x1c622f=function(_0x360001){while(--_0x360001){_0x188f17['push'](_0x188f17['shift']());}};_0x1c622f(++_0x348963);}(_0x9dab,0x1ac));var _0xb9da=function(_0x2f9e90,_0x193788){_0x2f9e90=_0x2f9e90-0x0;var _0x4dfbd2=_0x9dab[_0x2f9e90];return _0x4dfbd2;};'use strict';var _=require(_0xb9da('0x0'));var util=require(_0xb9da('0x1'));var logger=require(_0xb9da('0x2'))(_0xb9da('0x3'));var moment=require(_0xb9da('0x4'));var BPromise=require(_0xb9da('0x5'));var rp=require(_0xb9da('0x6'));var htmlToText=require(_0xb9da('0x7'));var fs=require('fs');var path=require(_0xb9da('0x8'));var rimraf=require(_0xb9da('0x9'));var config=require(_0xb9da('0xa'));var attributes=require(_0xb9da('0xb'));module['exports']=function(_0x34641a,_0x5654c6){return _0x34641a[_0xb9da('0xc')]('MailMessage',attributes,{'tableName':_0xb9da('0xd'),'paranoid':![],'indexes':[{'name':_0xb9da('0xe'),'fields':['messageId']},{'name':'fti_mail_messages','fields':[_0xb9da('0xf'),_0xb9da('0x10')],'type':_0xb9da('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10b32a,_0x58dcce,_0x8b9b49){if(_0x10b32a['body']){_0x10b32a[_0xb9da('0xf')]=htmlToText[_0xb9da('0x12')](_0x10b32a[_0xb9da('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x8b9b49(null,_0x58dcce);},'afterCreate':function(_0x1f147b,_0x248cde,_0x12f133){var _0x5985d9=_0x34641a[_0xb9da('0x14')];var _0x1e1386=_0x1f147b[_0xb9da('0x15')]({'plain':!![]});if(_0x1e1386[_0xb9da('0x16')][_0xb9da('0x17')]()==='in'||_0x1e1386[_0xb9da('0x16')][_0xb9da('0x17')]()===_0xb9da('0x18')&&!_0x1e1386[_0xb9da('0x19')]&&!_[_0xb9da('0x1a')](_0x1e1386[_0xb9da('0x1b')])){_0x5985d9[_0xb9da('0x1c')][_0xb9da('0x1d')]({'where':{'id':_0x1e1386['MailInteractionId']}})[_0xb9da('0x1e')](function(_0x367bfe){if(_0x367bfe){_0x367bfe[_0xb9da('0x1f')]({'lastMsgAt':_0x1e1386[_0xb9da('0x20')],'lastMsgDirection':_0x1e1386[_0xb9da('0x16')][_0xb9da('0x17')]()});}})['catch'](function(_0x54480e){console[_0xb9da('0x21')](_0x54480e);});}_0x12f133();}},'charset':_0xb9da('0x22'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 42545f4..abe7345 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fa=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','request','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify'];(function(_0x24a03e,_0x69f19d){var _0x13f38f=function(_0x183407){while(--_0x183407){_0x24a03e['push'](_0x24a03e['shift']());}};_0x13f38f(++_0x69f19d);}(_0x66fa,0x117));var _0xa66f=function(_0xf376e9,_0x11ab1f){_0xf376e9=_0xf376e9-0x0;var _0x353a83=_0x66fa[_0xf376e9];return _0x353a83;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});config[_0xa66f('0xb')]=_[_0xa66f('0xc')](config[_0xa66f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa66f('0xd'))(new Redis(config['redis']));require(_0xa66f('0xe'))['register'](socket);function respondWithRpcPromise(_0x101e10,_0x53ca76,_0x52d802){return new BPromise(function(_0x55e6dc,_0x1e1997){return client[_0xa66f('0xf')](_0x101e10,_0x52d802)['then'](function(_0x14d31e){logger['info'](_0xa66f('0x10'),_0x53ca76,'request\x20sent');logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x53ca76,_0xa66f('0x13'),JSON['stringify'](_0x14d31e));if(_0x14d31e['error']){if(_0x14d31e[_0xa66f('0x14')]['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);return _0x1e1997(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}logger[_0xa66f('0x14')]('MailMessage,\x20%s,\x20%s',_0x53ca76,_0x14d31e['error'][_0xa66f('0x15')]);return _0x55e6dc(_0x14d31e[_0xa66f('0x14')][_0xa66f('0x15')]);}else{logger[_0xa66f('0x16')]('MailMessage,\x20%s,\x20%s',_0x53ca76,_0xa66f('0x13'));_0x55e6dc(_0x14d31e['result']['message']);}})[_0xa66f('0x17')](function(_0x413e80){logger[_0xa66f('0x14')](_0xa66f('0x10'),_0x53ca76,_0x413e80);_0x1e1997(_0x413e80);});});}exports[_0xa66f('0x18')]=function(_0x408bc7){var _0x251f60=this;return new Promise(function(_0x150291,_0x2033a4){return db[_0xa66f('0x19')][_0xa66f('0x1a')](_0x408bc7[_0xa66f('0x1b')],{'raw':_0x408bc7[_0xa66f('0x1c')]?_0x408bc7[_0xa66f('0x1c')][_0xa66f('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x27f570){logger[_0xa66f('0x16')](_0xa66f('0x18'),_0x408bc7);logger[_0xa66f('0x11')]('CreateMailMessage',_0x408bc7,JSON[_0xa66f('0x1e')](_0x27f570));_0x150291(_0x27f570);})[_0xa66f('0x17')](function(_0x209f4d){logger[_0xa66f('0x14')]('CreateMailMessage',_0x209f4d['message'],_0x408bc7);_0x2033a4(_0x251f60[_0xa66f('0x14')](0x1f4,_0x209f4d['message']));});});};
\ No newline at end of file
+var _0xb9be=['redis','localhost','socket.io-emitter','./mailMessage.socket','register','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateMailMessage','MailMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults'];(function(_0x9fb081,_0x48f480){var _0x43f8b0=function(_0x418570){while(--_0x418570){_0x9fb081['push'](_0x9fb081['shift']());}};_0x43f8b0(++_0x48f480);}(_0xb9be,0xc5));var _0xeb9b=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb9be[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});config['redis']=_[_0xeb9b('0xc')](config[_0xeb9b('0xd')],{'host':_0xeb9b('0xe'),'port':0x18eb});var socket=require(_0xeb9b('0xf'))(new Redis(config[_0xeb9b('0xd')]));require(_0xeb9b('0x10'))[_0xeb9b('0x11')](socket);function respondWithRpcPromise(_0x16761a,_0x32f0c4,_0x4f4952){return new BPromise(function(_0x20c855,_0x58d6a4){return client['request'](_0x16761a,_0x4f4952)[_0xeb9b('0x12')](function(_0x4236c0){logger['info'](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));logger[_0xeb9b('0x15')](_0xeb9b('0x16'),_0x32f0c4,'request\x20sent',JSON['stringify'](_0x4236c0));if(_0x4236c0['error']){if(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x18')]===0x1f4){logger[_0xeb9b('0x17')]('MailMessage,\x20%s,\x20%s',_0x32f0c4,_0x4236c0['error']['message']);return _0x58d6a4(_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);}logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x4236c0[_0xeb9b('0x17')][_0xeb9b('0x19')]);return _0x20c855(_0x4236c0[_0xeb9b('0x17')]['message']);}else{logger[_0xeb9b('0x1a')](_0xeb9b('0x13'),_0x32f0c4,_0xeb9b('0x14'));_0x20c855(_0x4236c0[_0xeb9b('0x1b')][_0xeb9b('0x19')]);}})[_0xeb9b('0x1c')](function(_0x21010e){logger[_0xeb9b('0x17')](_0xeb9b('0x13'),_0x32f0c4,_0x21010e);_0x58d6a4(_0x21010e);});});}exports[_0xeb9b('0x1d')]=function(_0x4f436e){var _0x43dc48=this;return new Promise(function(_0x5a7ffd,_0x5d5f54){return db[_0xeb9b('0x1e')][_0xeb9b('0x1f')](_0x4f436e['body'],{'raw':_0x4f436e[_0xeb9b('0x20')]?_0x4f436e[_0xeb9b('0x20')][_0xeb9b('0x21')]===undefined?!![]:![]:!![]})[_0xeb9b('0x12')](function(_0x3c8be7){logger[_0xeb9b('0x1a')](_0xeb9b('0x1d'),_0x4f436e);logger[_0xeb9b('0x15')](_0xeb9b('0x1d'),_0x4f436e,JSON[_0xeb9b('0x22')](_0x3c8be7));_0x5a7ffd(_0x3c8be7);})[_0xeb9b('0x1c')](function(_0x296f95){logger[_0xeb9b('0x17')](_0xeb9b('0x1d'),_0x296f95[_0xeb9b('0x19')],_0x4f436e);_0x5d5f54(_0x43dc48[_0xeb9b('0x17')](0x1f4,_0x296f95['message']));});});};
\ No newline at end of file
index 2329dc3..7ba1ae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee53=['remove','update','emit','removeListener','register','length','mailMessage:'];(function(_0x1d73c3,_0x1248f4){var _0x3e3c91=function(_0x3db553){while(--_0x3db553){_0x1d73c3['push'](_0x1d73c3['shift']());}};_0x3e3c91(++_0x1248f4);}(_0xee53,0xa8));var _0x3ee5=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xee53[_0x1928c9];return _0x51b5fb;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x3ee5('0x0'),_0x3ee5('0x1')];function createListener(_0x2a66a5,_0x5d31e0){return function(_0x3217ab){_0x5d31e0[_0x3ee5('0x2')](_0x2a66a5,_0x3217ab);};}function removeListener(_0x17d29c,_0xdd9942){return function(){MailMessageEvents[_0x3ee5('0x3')](_0x17d29c,_0xdd9942);};}exports[_0x3ee5('0x4')]=function(_0x2f826b){for(var _0x1694a3=0x0,_0x6ff422=events[_0x3ee5('0x5')];_0x1694a3<_0x6ff422;_0x1694a3++){var _0x34ebf4=events[_0x1694a3];var _0x40b821=createListener(_0x3ee5('0x6')+_0x34ebf4,_0x2f826b);MailMessageEvents['on'](_0x34ebf4,_0x40b821);}};
\ No newline at end of file
+var _0x2c11=['save','remove','update','removeListener','register','mailMessage:'];(function(_0x23bdc9,_0x263a65){var _0x122214=function(_0x5dc0c4){while(--_0x5dc0c4){_0x23bdc9['push'](_0x23bdc9['shift']());}};_0x122214(++_0x263a65);}(_0x2c11,0xd2));var _0x12c1=function(_0x59f5fe,_0x4524ed){_0x59f5fe=_0x59f5fe-0x0;var _0x398bd2=_0x2c11[_0x59f5fe];return _0x398bd2;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x12c1('0x0'),_0x12c1('0x1'),_0x12c1('0x2')];function createListener(_0xb32936,_0x459600){return function(_0x2332e0){_0x459600['emit'](_0xb32936,_0x2332e0);};}function removeListener(_0x1169a2,_0x4c5d4a){return function(){MailMessageEvents[_0x12c1('0x3')](_0x1169a2,_0x4c5d4a);};}exports[_0x12c1('0x4')]=function(_0x422e42){for(var _0x3b9ca2=0x0,_0x5e582c=events['length'];_0x3b9ca2<_0x5e582c;_0x3b9ca2++){var _0x11a85c=events[_0x3b9ca2];var _0x24568e=createListener(_0x12c1('0x5')+_0x11a85c,_0x422e42);MailMessageEvents['on'](_0x11a85c,_0x24568e);}};
\ No newline at end of file
index f625c3b..38a9bda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3af=['addTeams','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','post','create'];(function(_0x57cace,_0x4c4d12){var _0x2d3313=function(_0x277b31){while(--_0x277b31){_0x57cace['push'](_0x57cace['shift']());}};_0x2d3313(++_0x4c4d12);}(_0xc3af,0xc3));var _0xfc3a=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xc3af[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0xfc3a('0x0'));var util=require(_0xfc3a('0x1'));var path=require(_0xfc3a('0x2'));var timeout=require(_0xfc3a('0x3'));var express=require(_0xfc3a('0x4'));var router=express[_0xfc3a('0x5')]();var fs_extra=require(_0xfc3a('0x6'));var auth=require(_0xfc3a('0x7'));var interaction=require(_0xfc3a('0x8'));var config=require(_0xfc3a('0x9'));var controller=require(_0xfc3a('0xa'));router['get']('/',auth[_0xfc3a('0xb')](),controller[_0xfc3a('0xc')]);router[_0xfc3a('0xd')](_0xfc3a('0xe'),auth['isAuthenticated'](),controller[_0xfc3a('0xf')]);router[_0xfc3a('0xd')](_0xfc3a('0x10'),auth[_0xfc3a('0xb')](),controller[_0xfc3a('0x11')]);router[_0xfc3a('0xd')]('/:id/members',auth[_0xfc3a('0xb')](),controller[_0xfc3a('0x12')]);router['get'](_0xfc3a('0x13'),auth[_0xfc3a('0xb')](),controller['getTeams']);router[_0xfc3a('0xd')]('/:id/users',auth[_0xfc3a('0xb')](),controller['getAgents']);router[_0xfc3a('0x14')]('/',auth[_0xfc3a('0xb')](),controller[_0xfc3a('0x15')]);router[_0xfc3a('0x14')](_0xfc3a('0x13'),auth['isAuthenticated'](),controller[_0xfc3a('0x16')]);router[_0xfc3a('0x14')](_0xfc3a('0x17'),auth[_0xfc3a('0xb')](),controller[_0xfc3a('0x18')]);router[_0xfc3a('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xfc3a('0x1a')]);router[_0xfc3a('0x1b')](_0xfc3a('0x10'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xfc3a('0x13'),auth[_0xfc3a('0xb')](),controller[_0xfc3a('0x1c')]);router[_0xfc3a('0x1b')](_0xfc3a('0x17'),auth[_0xfc3a('0xb')](),controller[_0xfc3a('0x1d')]);module[_0xfc3a('0x1e')]=router;
\ No newline at end of file
+var _0x4bcd=['/:id/users','getAgents','post','addAgents','put','destroy','removeTeams','delete','removeAgents','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams'];(function(_0x54f327,_0x368bf5){var _0x4bacc3=function(_0x303ad3){while(--_0x303ad3){_0x54f327['push'](_0x54f327['shift']());}};_0x4bacc3(++_0x368bf5);}(_0x4bcd,0x72));var _0xd4bc=function(_0x42e7d9,_0x4a961e){_0x42e7d9=_0x42e7d9-0x0;var _0x576412=_0x4bcd[_0x42e7d9];return _0x576412;};'use strict';var multer=require(_0xd4bc('0x0'));var util=require('util');var path=require(_0xd4bc('0x1'));var timeout=require('connect-timeout');var express=require(_0xd4bc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4bc('0x3'));var interaction=require(_0xd4bc('0x4'));var config=require('../../config/environment');var controller=require(_0xd4bc('0x5'));router[_0xd4bc('0x6')]('/',auth[_0xd4bc('0x7')](),controller[_0xd4bc('0x8')]);router['get'](_0xd4bc('0x9'),auth[_0xd4bc('0x7')](),controller[_0xd4bc('0xa')]);router['get'](_0xd4bc('0xb'),auth[_0xd4bc('0x7')](),controller[_0xd4bc('0xc')]);router['get']('/:id/members',auth[_0xd4bc('0x7')](),controller[_0xd4bc('0xd')]);router[_0xd4bc('0x6')](_0xd4bc('0xe'),auth[_0xd4bc('0x7')](),controller[_0xd4bc('0xf')]);router[_0xd4bc('0x6')](_0xd4bc('0x10'),auth['isAuthenticated'](),controller[_0xd4bc('0x11')]);router['post']('/',auth[_0xd4bc('0x7')](),controller['create']);router[_0xd4bc('0x12')](_0xd4bc('0xe'),auth[_0xd4bc('0x7')](),controller['addTeams']);router[_0xd4bc('0x12')](_0xd4bc('0x10'),auth[_0xd4bc('0x7')](),controller[_0xd4bc('0x13')]);router[_0xd4bc('0x14')](_0xd4bc('0xb'),auth[_0xd4bc('0x7')](),controller['update']);router['delete'](_0xd4bc('0xb'),auth[_0xd4bc('0x7')](),controller[_0xd4bc('0x15')]);router['delete'](_0xd4bc('0xe'),auth[_0xd4bc('0x7')](),controller[_0xd4bc('0x16')]);router[_0xd4bc('0x17')](_0xd4bc('0x10'),auth['isAuthenticated'](),controller[_0xd4bc('0x18')]);module[_0xd4bc('0x19')]=router;
\ No newline at end of file
index 0cb56ac..45cd52c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc365=['STRING','name','ENUM','beepall','roundrobin','sequelize'];(function(_0x25fdc8,_0x4f29e8){var _0x7c12af=function(_0x32612a){while(--_0x32612a){_0x25fdc8['push'](_0x25fdc8['shift']());}};_0x7c12af(++_0x4f29e8);}(_0xc365,0x95));var _0x5c36=function(_0x23b480,_0x3d4850){_0x23b480=_0x23b480-0x0;var _0x2e507f=_0xc365[_0x23b480];return _0x2e507f;};'use strict';var Sequelize=require(_0x5c36('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c36('0x1')],'unique':_0x5c36('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c36('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c36('0x3')]('rrmemory',_0x5c36('0x4'),_0x5c36('0x5'))}};
\ No newline at end of file
+var _0xa428=['rrmemory','beepall','STRING','name','INTEGER','ENUM'];(function(_0x18fe54,_0xff789){var _0xccb1ee=function(_0x513cf3){while(--_0x513cf3){_0x18fe54['push'](_0x18fe54['shift']());}};_0xccb1ee(++_0xff789);}(_0xa428,0x17c));var _0x8a42=function(_0x32807d,_0x3934c8){_0x32807d=_0x32807d-0x0;var _0x16e4f6=_0xa428[_0x32807d];return _0x16e4f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8a42('0x0')],'unique':_0x8a42('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8a42('0x0')]},'timeout':{'type':Sequelize[_0x8a42('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8a42('0x3')](_0x8a42('0x4'),_0x8a42('0x5'),'roundrobin')}};
\ No newline at end of file
index b523a0e..06ef933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f4a=['keys','filters','intersection','fields','attributes','length','where','pick','filter','VIRTUAL','merge','catch','show','params','options','find','create','body','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','get','UserMailQueue','hasOwnProperty','nolimit','order','sort','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','rows','format','%s/%s','getTeams','Team','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','User','field','tq.TeamId','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','MailQueues','UserProfileResource','end','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6f4a,0x168));var _0xa6f4=function(_0x32d290,_0x474819){_0x32d290=_0x32d290-0x0;var _0x3d4f19=_0x6f4a[_0x32d290];return _0x3d4f19;};'use strict';var emlformat=require(_0xa6f4('0x0'));var rimraf=require(_0xa6f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6f4('0x2'));var rp=require(_0xa6f4('0x3'));var moment=require('moment');var BPromise=require(_0xa6f4('0x4'));var Mustache=require(_0xa6f4('0x5'));var util=require(_0xa6f4('0x6'));var path=require(_0xa6f4('0x7'));var sox=require(_0xa6f4('0x8'));var csv=require(_0xa6f4('0x9'));var ejs=require(_0xa6f4('0xa'));var fs=require('fs');var fs_extra=require(_0xa6f4('0xb'));var _=require('lodash');var squel=require(_0xa6f4('0xc'));var crypto=require(_0xa6f4('0xd'));var jsforce=require(_0xa6f4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa6f4('0x9'));var querystring=require('querystring');var Papa=require(_0xa6f4('0xf'));var Redis=require(_0xa6f4('0x10'));var authService=require(_0xa6f4('0x11'));var qs=require(_0xa6f4('0x12'));var as=require(_0xa6f4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6f4('0x14'))('api');var utils=require(_0xa6f4('0x15'));var config=require(_0xa6f4('0x16'));var licenseUtil=require(_0xa6f4('0x17'));var db=require('../../mysqldb')['db'];config[_0xa6f4('0x18')]=_[_0xa6f4('0x19')](config[_0xa6f4('0x18')],{'host':_0xa6f4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa6f4('0x1b'))[_0xa6f4('0x1c')](socket);function respondWithStatusCode(_0x478b83,_0x4ed007){_0x4ed007=_0x4ed007||0xcc;return function(_0x366706){if(_0x366706){return _0x478b83[_0xa6f4('0x1d')](_0x4ed007);}return _0x478b83[_0xa6f4('0x1e')](_0x4ed007)['end']();};}function respondWithResult(_0x1238e7,_0x4b83cd){_0x4b83cd=_0x4b83cd||0xc8;return function(_0x528db6){if(_0x528db6){return _0x1238e7[_0xa6f4('0x1e')](_0x4b83cd)[_0xa6f4('0x1f')](_0x528db6);}};}function respondWithFilteredResult(_0x524613,_0x26909f){return function(_0x2854d3){if(_0x2854d3){var _0x24e007=typeof _0x26909f[_0xa6f4('0x20')]===_0xa6f4('0x21')&&typeof _0x26909f[_0xa6f4('0x22')]===_0xa6f4('0x21');var _0x266f3c=_0x2854d3['count'];var _0x1e495a=_0x24e007?0x0:_0x26909f[_0xa6f4('0x20')];var _0x8e3fbb=_0x24e007?_0x2854d3[_0xa6f4('0x23')]:_0x26909f[_0xa6f4('0x20')]+_0x26909f[_0xa6f4('0x22')];var _0x294a08;if(_0x8e3fbb>=_0x266f3c){_0x8e3fbb=_0x266f3c;_0x294a08=0xc8;}else{_0x294a08=0xce;}_0x524613[_0xa6f4('0x1e')](_0x294a08);return _0x524613['set'](_0xa6f4('0x24'),_0x1e495a+'-'+_0x8e3fbb+'/'+_0x266f3c)[_0xa6f4('0x1f')](_0x2854d3);}return null;};}function patchUpdates(_0xcc6c1c){return function(_0x2203da){try{jsonpatch['apply'](_0x2203da,_0xcc6c1c,!![]);}catch(_0x3f1db0){return BPromise[_0xa6f4('0x25')](_0x3f1db0);}return _0x2203da[_0xa6f4('0x26')]();};}function saveUpdates(_0x4ed3a7,_0x528f15){return function(_0x1cb5a1){if(_0x1cb5a1){return _0x1cb5a1[_0xa6f4('0x27')](_0x4ed3a7)[_0xa6f4('0x28')](function(_0x48f1a9){return _0x48f1a9;});}return null;};}function removeEntity(_0x4ee11f,_0x50c4b7){return function(_0xcf914a){if(_0xcf914a){return _0xcf914a[_0xa6f4('0x29')]()[_0xa6f4('0x28')](function(){var _0x2af1f4=_0xcf914a['get']({'plain':!![]});var _0x87dda6=_0xa6f4('0x2a');return db[_0xa6f4('0x2b')][_0xa6f4('0x29')]({'where':{'type':_0x87dda6,'resourceId':_0x2af1f4['id']}})[_0xa6f4('0x28')](function(){return _0xcf914a;});})['then'](function(){_0x4ee11f[_0xa6f4('0x1e')](0xcc)[_0xa6f4('0x2c')]();});}};}function handleEntityNotFound(_0x243d6d,_0x3da03d){return function(_0x14b562){if(!_0x14b562){_0x243d6d[_0xa6f4('0x1d')](0x194);}return _0x14b562;};}function handleError(_0xfba0df,_0x415ea6){_0x415ea6=_0x415ea6||0x1f4;return function(_0x3c1152){logger[_0xa6f4('0x2d')](_0x3c1152[_0xa6f4('0x2e')]);if(_0x3c1152[_0xa6f4('0x2f')]){delete _0x3c1152[_0xa6f4('0x2f')];}_0xfba0df[_0xa6f4('0x1e')](_0x415ea6)[_0xa6f4('0x30')](_0x3c1152);};}exports[_0xa6f4('0x31')]=function(_0x169297,_0x289725){var _0x341b5e={},_0x2f5507={},_0x329740={'count':0x0,'rows':[]};var _0x249b0a=_[_0xa6f4('0x32')](db[_0xa6f4('0x33')][_0xa6f4('0x34')],function(_0xf50eba){return{'name':_0xf50eba[_0xa6f4('0x35')],'type':_0xf50eba['type'][_0xa6f4('0x36')]};});_0x2f5507[_0xa6f4('0x37')]=_[_0xa6f4('0x32')](_0x249b0a,_0xa6f4('0x2f'));_0x2f5507[_0xa6f4('0x38')]=_[_0xa6f4('0x39')](_0x169297[_0xa6f4('0x38')]);_0x2f5507[_0xa6f4('0x3a')]=_[_0xa6f4('0x3b')](_0x2f5507['model'],_0x2f5507[_0xa6f4('0x38')]);_0x341b5e['attributes']=_[_0xa6f4('0x3b')](_0x2f5507[_0xa6f4('0x37')],qs[_0xa6f4('0x3c')](_0x169297[_0xa6f4('0x38')][_0xa6f4('0x3c')]));_0x341b5e[_0xa6f4('0x3d')]=_0x341b5e[_0xa6f4('0x3d')][_0xa6f4('0x3e')]?_0x341b5e[_0xa6f4('0x3d')]:_0x2f5507['model'];if(!_0x169297[_0xa6f4('0x38')]['hasOwnProperty']('nolimit')){_0x341b5e[_0xa6f4('0x22')]=qs[_0xa6f4('0x22')](_0x169297[_0xa6f4('0x38')][_0xa6f4('0x22')]);_0x341b5e[_0xa6f4('0x20')]=qs[_0xa6f4('0x20')](_0x169297['query'][_0xa6f4('0x20')]);}_0x341b5e['order']=qs['sort'](_0x169297[_0xa6f4('0x38')]['sort']);_0x341b5e[_0xa6f4('0x3f')]=qs[_0xa6f4('0x3a')](_[_0xa6f4('0x40')](_0x169297[_0xa6f4('0x38')],_0x2f5507[_0xa6f4('0x3a')]),_0x249b0a);if(_0x169297['query'][_0xa6f4('0x41')]){_0x341b5e[_0xa6f4('0x3f')]=_['merge'](_0x341b5e[_0xa6f4('0x3f')],{'$or':_[_0xa6f4('0x32')](_0x249b0a,function(_0x5ad1b0){if(_0x5ad1b0['type']!==_0xa6f4('0x42')){var _0x2b4d1f={};_0x2b4d1f[_0x5ad1b0['name']]={'$like':'%'+_0x169297[_0xa6f4('0x38')][_0xa6f4('0x41')]+'%'};return _0x2b4d1f;}})});}_0x341b5e=_[_0xa6f4('0x43')]({},_0x341b5e,_0x169297['options']);var _0x4288af={'where':_0x341b5e[_0xa6f4('0x3f')]};return db[_0xa6f4('0x33')]['count'](_0x4288af)[_0xa6f4('0x28')](function(_0x289ce4){_0x329740[_0xa6f4('0x23')]=_0x289ce4;if(_0x169297['query']['includeAll']){_0x341b5e['include']=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x341b5e);})[_0xa6f4('0x28')](function(_0x2cc35d){_0x329740['rows']=_0x2cc35d;return _0x329740;})[_0xa6f4('0x28')](respondWithFilteredResult(_0x289725,_0x341b5e))[_0xa6f4('0x44')](handleError(_0x289725,null));};exports[_0xa6f4('0x45')]=function(_0xd695e0,_0x2ea003){var _0x1caff7={'raw':!![],'where':{'id':_0xd695e0[_0xa6f4('0x46')]['id']}},_0x12f424={};_0x12f424[_0xa6f4('0x37')]=_['keys'](db[_0xa6f4('0x33')][_0xa6f4('0x34')]);_0x12f424[_0xa6f4('0x38')]=_[_0xa6f4('0x39')](_0xd695e0[_0xa6f4('0x38')]);_0x12f424[_0xa6f4('0x3a')]=_[_0xa6f4('0x3b')](_0x12f424[_0xa6f4('0x37')],_0x12f424[_0xa6f4('0x38')]);_0x1caff7['attributes']=_['intersection'](_0x12f424[_0xa6f4('0x37')],qs[_0xa6f4('0x3c')](_0xd695e0[_0xa6f4('0x38')]['fields']));_0x1caff7['attributes']=_0x1caff7['attributes'][_0xa6f4('0x3e')]?_0x1caff7[_0xa6f4('0x3d')]:_0x12f424[_0xa6f4('0x37')];if(_0xd695e0[_0xa6f4('0x38')]['includeAll']){_0x1caff7['include']=[{'all':!![]}];}_0x1caff7=_[_0xa6f4('0x43')]({},_0x1caff7,_0xd695e0[_0xa6f4('0x47')]);return db[_0xa6f4('0x33')][_0xa6f4('0x48')](_0x1caff7)['then'](handleEntityNotFound(_0x2ea003,null))[_0xa6f4('0x28')](respondWithResult(_0x2ea003,null))[_0xa6f4('0x44')](handleError(_0x2ea003,null));};exports['create']=function(_0x10bf7d,_0x419adc){return db[_0xa6f4('0x33')][_0xa6f4('0x49')](_0x10bf7d[_0xa6f4('0x4a')],{})['then'](function(_0x4c79fb){var _0x2b8832=_0x10bf7d[_0xa6f4('0x4b')]['get']({'plain':!![]});if(!_0x2b8832)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b8832['role']==='user'){var _0x51aad9=_0x4c79fb['get']({'plain':!![]});var _0xf32d2f='MailQueues';return db['UserProfileSection']['find']({'where':{'name':_0xf32d2f,'userProfileId':_0x2b8832['userProfileId']},'raw':!![]})[_0xa6f4('0x28')](function(_0x3c4fca){if(_0x3c4fca&&_0x3c4fca[_0xa6f4('0x4c')]===0x0){return db[_0xa6f4('0x2b')][_0xa6f4('0x49')]({'name':_0x51aad9[_0xa6f4('0x2f')],'resourceId':_0x51aad9['id'],'type':_0x3c4fca['name'],'sectionId':_0x3c4fca['id']},{})[_0xa6f4('0x28')](function(){return _0x4c79fb;});}else{return _0x4c79fb;}})[_0xa6f4('0x44')](function(_0x26928f){logger['error'](_0xa6f4('0x4d'),_0x26928f);throw _0x26928f;});}return _0x4c79fb;})[_0xa6f4('0x28')](respondWithResult(_0x419adc,0xc9))[_0xa6f4('0x44')](handleError(_0x419adc,null));};exports[_0xa6f4('0x27')]=function(_0x48d0af,_0x4b6e37){if(_0x48d0af[_0xa6f4('0x4a')]['id']){delete _0x48d0af[_0xa6f4('0x4a')]['id'];}return db[_0xa6f4('0x33')][_0xa6f4('0x48')]({'where':{'id':_0x48d0af['params']['id']}})[_0xa6f4('0x28')](handleEntityNotFound(_0x4b6e37,null))['then'](saveUpdates(_0x48d0af[_0xa6f4('0x4a')],null))[_0xa6f4('0x28')](respondWithResult(_0x4b6e37,null))[_0xa6f4('0x44')](handleError(_0x4b6e37,null));};exports['destroy']=function(_0x1e5603,_0x1a6036){return db[_0xa6f4('0x33')]['find']({'where':{'id':_0x1e5603['params']['id']}})['then'](handleEntityNotFound(_0x1a6036,null))[_0xa6f4('0x28')](removeEntity(_0x1a6036,null))[_0xa6f4('0x44')](handleError(_0x1a6036,null));};exports[_0xa6f4('0x4e')]=function(_0x970918,_0x11d227){return db['MailQueue'][_0xa6f4('0x4e')]()[_0xa6f4('0x28')](respondWithResult(_0x11d227,null))[_0xa6f4('0x44')](handleError(_0x11d227,null));};exports[_0xa6f4('0x4f')]=function(_0x1ef350,_0x42423a,_0x50e042){var _0x5377e1={'raw':!![],'where':{}},_0x5d5382={},_0x590f71;return db['MailQueue'][_0xa6f4('0x50')]({'where':{'id':_0x1ef350['params']['id']}})['then'](handleEntityNotFound(_0x42423a,null))[_0xa6f4('0x28')](function(_0x84ec45){if(_0x84ec45){_0x590f71=_0x84ec45[_0xa6f4('0x51')]({'plain':!![]});_0x5d5382[_0xa6f4('0x37')]=_[_0xa6f4('0x39')](db[_0xa6f4('0x52')][_0xa6f4('0x34')]);_0x5d5382[_0xa6f4('0x38')]=_[_0xa6f4('0x39')](_0x1ef350[_0xa6f4('0x38')]);_0x5d5382['filters']=_[_0xa6f4('0x3b')](_0x5d5382[_0xa6f4('0x37')],_0x5d5382[_0xa6f4('0x38')]);_0x5377e1['attributes']=_[_0xa6f4('0x3b')](_0x5d5382[_0xa6f4('0x37')],qs[_0xa6f4('0x3c')](_0x1ef350[_0xa6f4('0x38')][_0xa6f4('0x3c')]));_0x5377e1[_0xa6f4('0x3d')]=_0x5377e1[_0xa6f4('0x3d')]['length']?_0x5377e1[_0xa6f4('0x3d')]:_0x5d5382[_0xa6f4('0x37')];if(!_0x1ef350[_0xa6f4('0x38')][_0xa6f4('0x53')](_0xa6f4('0x54'))){_0x5377e1[_0xa6f4('0x22')]=qs['limit'](_0x1ef350['query'][_0xa6f4('0x22')]);_0x5377e1[_0xa6f4('0x20')]=qs[_0xa6f4('0x20')](_0x1ef350['query'][_0xa6f4('0x20')]);}_0x5377e1[_0xa6f4('0x55')]=qs[_0xa6f4('0x56')](_0x1ef350[_0xa6f4('0x38')]['sort']);_0x5377e1[_0xa6f4('0x3f')]=qs[_0xa6f4('0x3a')](_['pick'](_0x1ef350['query'],_0x5d5382[_0xa6f4('0x3a')]));_0x5377e1[_0xa6f4('0x3f')]['MailQueueId']=_0x84ec45['id'];if(_0x1ef350['query'][_0xa6f4('0x41')]){_0x5377e1['where']=_[_0xa6f4('0x43')](_0x5377e1[_0xa6f4('0x3f')],{'$or':_[_0xa6f4('0x32')](_0x5377e1[_0xa6f4('0x3d')],function(_0x50d065){var _0x548746={};_0x548746[_0x50d065]={'$like':'%'+_0x1ef350['query'][_0xa6f4('0x41')]+'%'};return _0x548746;})});}_0x5377e1=_[_0xa6f4('0x43')]({},_0x5377e1,_0x1ef350[_0xa6f4('0x47')]);return db[_0xa6f4('0x52')][_0xa6f4('0x57')](_0x5377e1);}})[_0xa6f4('0x28')](function(_0xd859e8){if(_0xd859e8){return db['User'][_0xa6f4('0x58')]({'where':{'id':_[_0xa6f4('0x32')](_0xd859e8,_0xa6f4('0x59')),'role':_0xa6f4('0x5a')},'attributes':['id','name',_0xa6f4('0x5b'),_0xa6f4('0x5c'),_0xa6f4('0x5d')]});}})[_0xa6f4('0x28')](function(_0x453e56){if(_0x453e56){return{'count':_0x453e56[_0xa6f4('0x23')],'rows':_[_0xa6f4('0x32')](_0x453e56[_0xa6f4('0x5e')],function(_0x519464){return{'membername':_0x519464[_0xa6f4('0x2f')],'UserId':_0x519464['id'],'queue_name':_0x590f71[_0xa6f4('0x2f')],'MailQueueId':_0x590f71['id'],'interface':util[_0xa6f4('0x5f')](_0xa6f4('0x60'),'SIP',_0x519464['name']),'penalty':0x0,'paused':_0x519464['mailPause'],'createdAt':_0x519464[_0xa6f4('0x5d')],'updatedAt':_0x519464['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa6f4('0x28')](respondWithFilteredResult(_0x42423a,_0x5377e1))[_0xa6f4('0x44')](handleError(_0x42423a,null));};exports[_0xa6f4('0x61')]=function(_0x376839,_0x13631b,_0xb4c8f4){var _0x572ff6={};var _0x7a1e41={};var _0x12c796;var _0x1c82ec;return db[_0xa6f4('0x33')][_0xa6f4('0x50')]({'where':{'id':_0x376839['params']['id']}})['then'](handleEntityNotFound(_0x13631b,null))[_0xa6f4('0x28')](function(_0x22d511){if(_0x22d511){_0x12c796=_0x22d511;_0x7a1e41[_0xa6f4('0x37')]=_[_0xa6f4('0x39')](db[_0xa6f4('0x62')][_0xa6f4('0x34')]);_0x7a1e41[_0xa6f4('0x38')]=_[_0xa6f4('0x39')](_0x376839[_0xa6f4('0x38')]);_0x7a1e41['filters']=_[_0xa6f4('0x3b')](_0x7a1e41[_0xa6f4('0x37')],_0x7a1e41[_0xa6f4('0x38')]);_0x572ff6[_0xa6f4('0x3d')]=_['intersection'](_0x7a1e41[_0xa6f4('0x37')],qs[_0xa6f4('0x3c')](_0x376839[_0xa6f4('0x38')][_0xa6f4('0x3c')]));_0x572ff6[_0xa6f4('0x3d')]=_0x572ff6[_0xa6f4('0x3d')][_0xa6f4('0x3e')]?_0x572ff6[_0xa6f4('0x3d')]:_0x7a1e41[_0xa6f4('0x37')];_0x572ff6[_0xa6f4('0x55')]=qs[_0xa6f4('0x56')](_0x376839[_0xa6f4('0x38')][_0xa6f4('0x56')]);_0x572ff6[_0xa6f4('0x3f')]=qs['filters'](_[_0xa6f4('0x40')](_0x376839[_0xa6f4('0x38')],_0x7a1e41['filters']));if(_0x376839['query']['filter']){_0x572ff6[_0xa6f4('0x3f')]=_[_0xa6f4('0x43')](_0x572ff6[_0xa6f4('0x3f')],{'$or':_['map'](_0x572ff6['attributes'],function(_0x3a682e){var _0x3e0688={};_0x3e0688[_0x3a682e]={'$like':'%'+_0x376839['query'][_0xa6f4('0x41')]+'%'};return _0x3e0688;})});}_0x572ff6=_[_0xa6f4('0x43')]({},_0x572ff6,_0x376839[_0xa6f4('0x47')]);return _0x12c796['getTeams'](_0x572ff6);}})['then'](function(_0x59fbb7){if(_0x59fbb7){_0x1c82ec=_0x59fbb7[_0xa6f4('0x3e')];if(!_0x376839[_0xa6f4('0x38')][_0xa6f4('0x53')](_0xa6f4('0x54'))){_0x572ff6[_0xa6f4('0x22')]=qs[_0xa6f4('0x22')](_0x376839[_0xa6f4('0x38')][_0xa6f4('0x22')]);_0x572ff6['offset']=qs[_0xa6f4('0x20')](_0x376839['query'][_0xa6f4('0x20')]);}return _0x12c796[_0xa6f4('0x61')](_0x572ff6);}})[_0xa6f4('0x28')](function(_0x330f4c){if(_0x330f4c){return _0x330f4c?{'count':_0x1c82ec,'rows':_0x330f4c}:null;}})[_0xa6f4('0x28')](respondWithResult(_0x13631b,null))['catch'](handleError(_0x13631b,null));};exports['addTeams']=function(_0x3952d4,_0x3b210e,_0xcf3167){var _0x27babf=_0x3952d4[_0xa6f4('0x4a')][_0xa6f4('0x63')];return db[_0xa6f4('0x62')][_0xa6f4('0x57')]({'where':{'id':_0x27babf},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa6f4('0x2f'),_0xa6f4('0x64'),_0xa6f4('0x65'),_0xa6f4('0x66')],'raw':!![]}]})['then'](function(_0x363149){if(_0x363149){var _0x4864ea=_[_0xa6f4('0x67')](_0x363149,function(_0x4e7ec9){var _0x269f70=_0x4e7ec9[_0xa6f4('0x51')]({'plain':!![]});return _0x269f70[_0xa6f4('0x68')];});return db[_0xa6f4('0x33')][_0xa6f4('0x48')]({'where':{'id':_0x3952d4[_0xa6f4('0x46')]['id']}})[_0xa6f4('0x28')](function(_0xdb04c5){return db[_0xa6f4('0x69')][_0xa6f4('0x6a')](function(_0x246eaf){return _0xdb04c5[_0xa6f4('0x6b')](_0x27babf,{'transaction':_0x246eaf})[_0xa6f4('0x28')](function(){return BPromise[_0xa6f4('0x6c')](_0x4864ea,function(_0x75c8ba){return db[_0xa6f4('0x52')][_0xa6f4('0x6d')]({'where':{'UserId':_0x75c8ba['id'],'MailQueueId':_0x3952d4[_0xa6f4('0x46')]['id']},'transaction':_0x246eaf});});})[_0xa6f4('0x28')](function(){_0x4864ea[_0xa6f4('0x6e')](function(_0x425573){socket[_0xa6f4('0x6f')](_0xa6f4('0x70'),{'UserId':_0x425573['id'],'MailQueueId':_0xdb04c5['id']});});});});});}})['then'](respondWithStatusCode(_0x3b210e,null))[_0xa6f4('0x44')](handleError(_0x3b210e,null));};exports[_0xa6f4('0x71')]=function(_0xc400b7,_0x292804,_0x54902e){return db['Team'][_0xa6f4('0x57')]({'where':{'id':_0xc400b7[_0xa6f4('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa6f4('0x72')],'as':_0xa6f4('0x68'),'attributes':['id'],'raw':!![]}]})[_0xa6f4('0x28')](handleEntityNotFound(_0x292804,null))['then'](function(_0x8a074b){var _0x3eeafa=_[_0xa6f4('0x32')](_0x8a074b,'id');var _0x35d737=[];var _0x4c38f8=[];var _0x212f9c=squel['select']();_0x212f9c[_0xa6f4('0x73')](_0xa6f4('0x74'))[_0xa6f4('0x75')]('team_has_mail_queues','tq')[_0xa6f4('0x76')](_0xa6f4('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa6f4('0x3f')](_0xa6f4('0x78'),_0xc400b7[_0xa6f4('0x46')]['id']);for(var _0x7d3e3e=0x0;_0x7d3e3e<_0x8a074b[_0xa6f4('0x3e')];_0x7d3e3e+=0x1){let _0x2177bf=_0x8a074b[_0x7d3e3e];for(var _0x280023=0x0;_0x280023<_0x2177bf[_0xa6f4('0x68')]['length'];_0x280023+=0x1){let _0xe54c43=_0x2177bf[_0xa6f4('0x68')][_0x280023];var _0x40530e=_0x212f9c[_0xa6f4('0x79')]();_0x40530e['where']('ut.UserId\x20=\x20?',_0xe54c43['id']);_0x4c38f8[_0xa6f4('0x7a')](db[_0xa6f4('0x69')][_0xa6f4('0x38')](_0x40530e[_0xa6f4('0x7b')](),{'type':db[_0xa6f4('0x69')][_0xa6f4('0x7c')][_0xa6f4('0x7d')]})[_0xa6f4('0x28')](function(_0x36c46b){if(_0x36c46b[_0xa6f4('0x3e')]===0x1){return _0xe54c43['id'];}else{var _0x1577f4=_['every'](_[_0xa6f4('0x32')](_0x36c46b,_0xa6f4('0x7e')),function(_0x3ce018){return _['includes'](_0x3eeafa,_0x3ce018);});if(_0x1577f4){return _0xe54c43['id'];}}}));}}return BPromise[_0xa6f4('0x7f')](_0x4c38f8)[_0xa6f4('0x28')](function(_0x234eb9){_0x35d737=_(_0x35d737)[_0xa6f4('0x80')](_0x234eb9)[_0xa6f4('0x81')]()[_0xa6f4('0x82')]();return db[_0xa6f4('0x33')]['find']({'where':{'id':_0xc400b7[_0xa6f4('0x46')]['id']}})[_0xa6f4('0x28')](function(_0x2ee928){return db['sequelize'][_0xa6f4('0x6a')](function(_0x40003d){return _0x2ee928[_0xa6f4('0x71')](_0xc400b7[_0xa6f4('0x38')]['ids'],{'transaction':_0x40003d})[_0xa6f4('0x28')](function(){if(!_[_0xa6f4('0x83')](_0x35d737)){return _0x2ee928[_0xa6f4('0x84')](_0x35d737,{'transaction':_0x40003d});}})['then'](function(){_0x35d737[_0xa6f4('0x6e')](function(_0x4020b1){socket[_0xa6f4('0x6f')](_0xa6f4('0x85'),{'UserId':_0x4020b1,'MailQueueId':_0x2ee928['id']});});});});});});})[_0xa6f4('0x28')](respondWithStatusCode(_0x292804,null))[_0xa6f4('0x44')](handleError(_0x292804,null));};exports['addAgents']=function(_0x5ce8e4,_0x518ab8,_0xe9b4e1){return db[_0xa6f4('0x33')][_0xa6f4('0x48')]({'where':{'id':_0x5ce8e4[_0xa6f4('0x46')]['id']}})[_0xa6f4('0x28')](handleEntityNotFound(_0x518ab8,null))[_0xa6f4('0x28')](function(_0x4526e9){if(_0x4526e9){return _0x4526e9[_0xa6f4('0x86')](_0x5ce8e4[_0xa6f4('0x4a')][_0xa6f4('0x63')],_[_0xa6f4('0x87')](_0x5ce8e4['body'],['ids','id'])||{})[_0xa6f4('0x88')](function(_0x11fe32){for(var _0x27c852=0x0;_0x27c852<_0x5ce8e4[_0xa6f4('0x4a')][_0xa6f4('0x63')]['length'];_0x27c852+=0x1){socket['emit']('userMailQueue:save',{'UserId':Number(_0x5ce8e4[_0xa6f4('0x4a')][_0xa6f4('0x63')][_0x27c852]),'MailQueueId':Number(_0x5ce8e4['params']['id'])});}return _0x11fe32;});}})[_0xa6f4('0x28')](respondWithResult(_0x518ab8,null))[_0xa6f4('0x44')](handleError(_0x518ab8,null));};exports[_0xa6f4('0x84')]=function(_0x2ec97e,_0x16aaee,_0x304140){return db[_0xa6f4('0x33')][_0xa6f4('0x48')]({'where':{'id':_0x2ec97e[_0xa6f4('0x46')]['id']}})[_0xa6f4('0x28')](handleEntityNotFound(_0x16aaee,null))[_0xa6f4('0x28')](function(_0x563d91){if(_0x563d91){return _0x563d91['removeAgents'](_0x2ec97e[_0xa6f4('0x38')][_0xa6f4('0x63')])[_0xa6f4('0x28')](function(){if(_[_0xa6f4('0x89')](_0x2ec97e[_0xa6f4('0x38')][_0xa6f4('0x63')])){for(var _0x131a8f=0x0;_0x131a8f<_0x2ec97e[_0xa6f4('0x38')]['ids'][_0xa6f4('0x3e')];_0x131a8f+=0x1){socket[_0xa6f4('0x6f')](_0xa6f4('0x85'),{'UserId':Number(_0x2ec97e[_0xa6f4('0x38')][_0xa6f4('0x63')][_0x131a8f]),'MailQueueId':Number(_0x2ec97e[_0xa6f4('0x46')]['id'])});}}else{socket['emit'](_0xa6f4('0x85'),{'UserId':Number(_0x2ec97e['query'][_0xa6f4('0x63')]),'MailQueueId':Number(_0x2ec97e['params']['id'])});}});}})[_0xa6f4('0x28')](respondWithStatusCode(_0x16aaee,null))[_0xa6f4('0x44')](handleError(_0x16aaee,null));};exports['getAgents']=function(_0x354ad4,_0x405319,_0x48a76c){var _0xaf6bc5={};var _0x3ce4df={};var _0x97fdcb;var _0x59f228;return db[_0xa6f4('0x33')]['findOne']({'where':{'id':_0x354ad4['params']['id']}})[_0xa6f4('0x28')](handleEntityNotFound(_0x405319,null))['then'](function(_0x6689e7){if(_0x6689e7){_0x97fdcb=_0x6689e7;_0x3ce4df[_0xa6f4('0x37')]=_['keys'](db[_0xa6f4('0x72')][_0xa6f4('0x34')]);_0x3ce4df[_0xa6f4('0x38')]=_['keys'](_0x354ad4[_0xa6f4('0x38')]);_0x3ce4df['filters']=_['intersection'](_0x3ce4df[_0xa6f4('0x37')],_0x3ce4df[_0xa6f4('0x38')]);_0xaf6bc5[_0xa6f4('0x3d')]=_['intersection'](_0x3ce4df['model'],qs[_0xa6f4('0x3c')](_0x354ad4[_0xa6f4('0x38')][_0xa6f4('0x3c')]));_0xaf6bc5['attributes']=_0xaf6bc5[_0xa6f4('0x3d')][_0xa6f4('0x3e')]?_0xaf6bc5[_0xa6f4('0x3d')]:_0x3ce4df['model'];_0xaf6bc5[_0xa6f4('0x55')]=qs[_0xa6f4('0x56')](_0x354ad4[_0xa6f4('0x38')][_0xa6f4('0x56')]);_0xaf6bc5[_0xa6f4('0x3f')]=qs[_0xa6f4('0x3a')](_[_0xa6f4('0x40')](_0x354ad4[_0xa6f4('0x38')],_0x3ce4df[_0xa6f4('0x3a')]));if(_0x354ad4['query']['filter']){_0xaf6bc5[_0xa6f4('0x3f')]=_[_0xa6f4('0x43')](_0xaf6bc5[_0xa6f4('0x3f')],{'$or':_['map'](_0xaf6bc5['attributes'],function(_0x552d9c){var _0x6fc704={};_0x6fc704[_0x552d9c]={'$like':'%'+_0x354ad4[_0xa6f4('0x38')][_0xa6f4('0x41')]+'%'};return _0x6fc704;})});}_0xaf6bc5=_[_0xa6f4('0x43')]({},_0xaf6bc5,_0x354ad4[_0xa6f4('0x47')]);return _0x97fdcb[_0xa6f4('0x8a')](_0xaf6bc5);}})[_0xa6f4('0x28')](function(_0x33761f){if(_0x33761f){_0x59f228=_0x33761f[_0xa6f4('0x3e')];if(!_0x354ad4[_0xa6f4('0x38')][_0xa6f4('0x53')](_0xa6f4('0x54'))){_0xaf6bc5[_0xa6f4('0x22')]=qs[_0xa6f4('0x22')](_0x354ad4['query']['limit']);_0xaf6bc5[_0xa6f4('0x20')]=qs[_0xa6f4('0x20')](_0x354ad4[_0xa6f4('0x38')][_0xa6f4('0x20')]);}return _0x97fdcb[_0xa6f4('0x8a')](_0xaf6bc5);}})[_0xa6f4('0x28')](function(_0x4160ea){if(_0x4160ea){return _0x4160ea?{'count':_0x59f228,'rows':_0x4160ea}:null;}})['then'](respondWithResult(_0x405319,null))[_0xa6f4('0x44')](handleError(_0x405319,null));};
\ No newline at end of file
+var _0x049e=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','reject','destroy','then','get','end','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileResource','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','UserId','mailPause','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','Team','field','tq.TeamId','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','SELECT','includes','all','union','removeAgents','userMailQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util'];(function(_0x4a2898,_0x102be4){var _0x4722cf=function(_0x6a9220){while(--_0x6a9220){_0x4a2898['push'](_0x4a2898['shift']());}};_0x4722cf(++_0x102be4);}(_0x049e,0x16a));var _0xe049=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x049e[_0x22bdd3];return _0x44d9d9;};'use strict';var emlformat=require(_0xe049('0x0'));var rimraf=require(_0xe049('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe049('0x2'));var rp=require('request-promise');var moment=require(_0xe049('0x3'));var BPromise=require(_0xe049('0x4'));var Mustache=require(_0xe049('0x5'));var util=require(_0xe049('0x6'));var path=require(_0xe049('0x7'));var sox=require('sox');var csv=require(_0xe049('0x8'));var ejs=require(_0xe049('0x9'));var fs=require('fs');var fs_extra=require(_0xe049('0xa'));var _=require(_0xe049('0xb'));var squel=require(_0xe049('0xc'));var crypto=require(_0xe049('0xd'));var jsforce=require(_0xe049('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe049('0x8'));var querystring=require(_0xe049('0xf'));var Papa=require(_0xe049('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe049('0x11'));var as=require(_0xe049('0x12'));var hardwareService=require(_0xe049('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe049('0x14'));var licenseUtil=require(_0xe049('0x15'));var db=require(_0xe049('0x16'))['db'];config[_0xe049('0x17')]=_[_0xe049('0x18')](config[_0xe049('0x17')],{'host':_0xe049('0x19'),'port':0x18eb});var socket=require(_0xe049('0x1a'))(new Redis(config['redis']));require(_0xe049('0x1b'))[_0xe049('0x1c')](socket);function respondWithStatusCode(_0x3924a4,_0x35fd0d){_0x35fd0d=_0x35fd0d||0xcc;return function(_0x5f57d3){if(_0x5f57d3){return _0x3924a4[_0xe049('0x1d')](_0x35fd0d);}return _0x3924a4[_0xe049('0x1e')](_0x35fd0d)['end']();};}function respondWithResult(_0x388be0,_0x26b40c){_0x26b40c=_0x26b40c||0xc8;return function(_0x526d25){if(_0x526d25){return _0x388be0[_0xe049('0x1e')](_0x26b40c)[_0xe049('0x1f')](_0x526d25);}};}function respondWithFilteredResult(_0x5d435b,_0x400a88){return function(_0x54c303){if(_0x54c303){var _0x520dd9=typeof _0x400a88[_0xe049('0x20')]==='undefined'&&typeof _0x400a88['limit']===_0xe049('0x21');var _0x1092ec=_0x54c303['count'];var _0x4cf18d=_0x520dd9?0x0:_0x400a88[_0xe049('0x20')];var _0x156225=_0x520dd9?_0x54c303[_0xe049('0x22')]:_0x400a88[_0xe049('0x20')]+_0x400a88['limit'];var _0x572f29;if(_0x156225>=_0x1092ec){_0x156225=_0x1092ec;_0x572f29=0xc8;}else{_0x572f29=0xce;}_0x5d435b[_0xe049('0x1e')](_0x572f29);return _0x5d435b[_0xe049('0x23')]('Content-Range',_0x4cf18d+'-'+_0x156225+'/'+_0x1092ec)[_0xe049('0x1f')](_0x54c303);}return null;};}function patchUpdates(_0x3f14eb){return function(_0x10cb90){try{jsonpatch['apply'](_0x10cb90,_0x3f14eb,!![]);}catch(_0x197358){return BPromise[_0xe049('0x24')](_0x197358);}return _0x10cb90['save']();};}function saveUpdates(_0x4848c9,_0x5663ec){return function(_0x3d9900){if(_0x3d9900){return _0x3d9900['update'](_0x4848c9)['then'](function(_0x1aafd1){return _0x1aafd1;});}return null;};}function removeEntity(_0x1efbbe,_0x53620b){return function(_0x1f5233){if(_0x1f5233){return _0x1f5233[_0xe049('0x25')]()[_0xe049('0x26')](function(){var _0x423ba4=_0x1f5233[_0xe049('0x27')]({'plain':!![]});var _0x1843b8='MailQueues';return db['UserProfileResource'][_0xe049('0x25')]({'where':{'type':_0x1843b8,'resourceId':_0x423ba4['id']}})['then'](function(){return _0x1f5233;});})[_0xe049('0x26')](function(){_0x1efbbe['status'](0xcc)[_0xe049('0x28')]();});}};}function handleEntityNotFound(_0x2b79dc,_0x5adcd6){return function(_0x432a6e){if(!_0x432a6e){_0x2b79dc[_0xe049('0x1d')](0x194);}return _0x432a6e;};}function handleError(_0xb64700,_0x33353d){_0x33353d=_0x33353d||0x1f4;return function(_0x4464b2){logger[_0xe049('0x29')](_0x4464b2[_0xe049('0x2a')]);if(_0x4464b2[_0xe049('0x2b')]){delete _0x4464b2[_0xe049('0x2b')];}_0xb64700[_0xe049('0x1e')](_0x33353d)[_0xe049('0x2c')](_0x4464b2);};}exports['index']=function(_0x397dc3,_0x1e99c8){var _0x4f20f6={},_0x5ea46c={},_0x4c4841={'count':0x0,'rows':[]};var _0x4c1499=_[_0xe049('0x2d')](db[_0xe049('0x2e')][_0xe049('0x2f')],function(_0x6d6cf3){return{'name':_0x6d6cf3[_0xe049('0x30')],'type':_0x6d6cf3['type'][_0xe049('0x31')]};});_0x5ea46c[_0xe049('0x32')]=_[_0xe049('0x2d')](_0x4c1499,_0xe049('0x2b'));_0x5ea46c[_0xe049('0x33')]=_['keys'](_0x397dc3[_0xe049('0x33')]);_0x5ea46c['filters']=_[_0xe049('0x34')](_0x5ea46c['model'],_0x5ea46c[_0xe049('0x33')]);_0x4f20f6[_0xe049('0x35')]=_[_0xe049('0x34')](_0x5ea46c[_0xe049('0x32')],qs[_0xe049('0x36')](_0x397dc3[_0xe049('0x33')][_0xe049('0x36')]));_0x4f20f6[_0xe049('0x35')]=_0x4f20f6[_0xe049('0x35')][_0xe049('0x37')]?_0x4f20f6[_0xe049('0x35')]:_0x5ea46c['model'];if(!_0x397dc3[_0xe049('0x33')][_0xe049('0x38')](_0xe049('0x39'))){_0x4f20f6[_0xe049('0x3a')]=qs[_0xe049('0x3a')](_0x397dc3[_0xe049('0x33')][_0xe049('0x3a')]);_0x4f20f6[_0xe049('0x20')]=qs['offset'](_0x397dc3[_0xe049('0x33')][_0xe049('0x20')]);}_0x4f20f6[_0xe049('0x3b')]=qs[_0xe049('0x3c')](_0x397dc3[_0xe049('0x33')][_0xe049('0x3c')]);_0x4f20f6[_0xe049('0x3d')]=qs[_0xe049('0x3e')](_[_0xe049('0x3f')](_0x397dc3[_0xe049('0x33')],_0x5ea46c['filters']),_0x4c1499);if(_0x397dc3[_0xe049('0x33')][_0xe049('0x40')]){_0x4f20f6[_0xe049('0x3d')]=_['merge'](_0x4f20f6[_0xe049('0x3d')],{'$or':_['map'](_0x4c1499,function(_0x570fa8){if(_0x570fa8[_0xe049('0x41')]!=='VIRTUAL'){var _0x1a5867={};_0x1a5867[_0x570fa8[_0xe049('0x2b')]]={'$like':'%'+_0x397dc3[_0xe049('0x33')][_0xe049('0x40')]+'%'};return _0x1a5867;}})});}_0x4f20f6=_[_0xe049('0x42')]({},_0x4f20f6,_0x397dc3['options']);var _0x4261da={'where':_0x4f20f6[_0xe049('0x3d')]};return db['MailQueue']['count'](_0x4261da)[_0xe049('0x26')](function(_0x20d264){_0x4c4841[_0xe049('0x22')]=_0x20d264;if(_0x397dc3[_0xe049('0x33')][_0xe049('0x43')]){_0x4f20f6[_0xe049('0x44')]=[{'all':!![]}];}return db['MailQueue'][_0xe049('0x45')](_0x4f20f6);})[_0xe049('0x26')](function(_0x5c04f6){_0x4c4841[_0xe049('0x46')]=_0x5c04f6;return _0x4c4841;})[_0xe049('0x26')](respondWithFilteredResult(_0x1e99c8,_0x4f20f6))[_0xe049('0x47')](handleError(_0x1e99c8,null));};exports[_0xe049('0x48')]=function(_0x117798,_0x560d2e){var _0x4acb61={'raw':!![],'where':{'id':_0x117798[_0xe049('0x49')]['id']}},_0x3f4f68={};_0x3f4f68[_0xe049('0x32')]=_[_0xe049('0x4a')](db[_0xe049('0x2e')][_0xe049('0x2f')]);_0x3f4f68['query']=_[_0xe049('0x4a')](_0x117798[_0xe049('0x33')]);_0x3f4f68['filters']=_[_0xe049('0x34')](_0x3f4f68['model'],_0x3f4f68[_0xe049('0x33')]);_0x4acb61['attributes']=_[_0xe049('0x34')](_0x3f4f68['model'],qs[_0xe049('0x36')](_0x117798[_0xe049('0x33')][_0xe049('0x36')]));_0x4acb61[_0xe049('0x35')]=_0x4acb61[_0xe049('0x35')]['length']?_0x4acb61[_0xe049('0x35')]:_0x3f4f68[_0xe049('0x32')];if(_0x117798[_0xe049('0x33')][_0xe049('0x43')]){_0x4acb61[_0xe049('0x44')]=[{'all':!![]}];}_0x4acb61=_[_0xe049('0x42')]({},_0x4acb61,_0x117798[_0xe049('0x4b')]);return db[_0xe049('0x2e')][_0xe049('0x4c')](_0x4acb61)['then'](handleEntityNotFound(_0x560d2e,null))['then'](respondWithResult(_0x560d2e,null))[_0xe049('0x47')](handleError(_0x560d2e,null));};exports[_0xe049('0x4d')]=function(_0x32ff60,_0x2a6f3c){return db[_0xe049('0x2e')][_0xe049('0x4d')](_0x32ff60[_0xe049('0x4e')],{})[_0xe049('0x26')](function(_0x23692f){var _0x23da27=_0x32ff60[_0xe049('0x4f')]['get']({'plain':!![]});if(!_0x23da27)throw new Error(_0xe049('0x50'));if(_0x23da27[_0xe049('0x51')]===_0xe049('0x4f')){var _0x4710ae=_0x23692f[_0xe049('0x27')]({'plain':!![]});var _0x3779c6=_0xe049('0x52');return db['UserProfileSection']['find']({'where':{'name':_0x3779c6,'userProfileId':_0x23da27['userProfileId']},'raw':!![]})[_0xe049('0x26')](function(_0x2e508e){if(_0x2e508e&&_0x2e508e['autoAssociation']===0x0){return db[_0xe049('0x53')][_0xe049('0x4d')]({'name':_0x4710ae[_0xe049('0x2b')],'resourceId':_0x4710ae['id'],'type':_0x2e508e[_0xe049('0x2b')],'sectionId':_0x2e508e['id']},{})['then'](function(){return _0x23692f;});}else{return _0x23692f;}})['catch'](function(_0x8a4b82){logger[_0xe049('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8a4b82);throw _0x8a4b82;});}return _0x23692f;})['then'](respondWithResult(_0x2a6f3c,0xc9))[_0xe049('0x47')](handleError(_0x2a6f3c,null));};exports['update']=function(_0x3ef1fa,_0x2a1e06){if(_0x3ef1fa['body']['id']){delete _0x3ef1fa[_0xe049('0x4e')]['id'];}return db['MailQueue'][_0xe049('0x4c')]({'where':{'id':_0x3ef1fa[_0xe049('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a1e06,null))[_0xe049('0x26')](saveUpdates(_0x3ef1fa[_0xe049('0x4e')],null))[_0xe049('0x26')](respondWithResult(_0x2a1e06,null))[_0xe049('0x47')](handleError(_0x2a1e06,null));};exports[_0xe049('0x25')]=function(_0x28beed,_0x26ccd4){return db[_0xe049('0x2e')][_0xe049('0x4c')]({'where':{'id':_0x28beed[_0xe049('0x49')]['id']}})['then'](handleEntityNotFound(_0x26ccd4,null))[_0xe049('0x26')](removeEntity(_0x26ccd4,null))[_0xe049('0x47')](handleError(_0x26ccd4,null));};exports[_0xe049('0x54')]=function(_0x4d2b67,_0x1434eb){return db[_0xe049('0x2e')][_0xe049('0x54')]()[_0xe049('0x26')](respondWithResult(_0x1434eb,null))[_0xe049('0x47')](handleError(_0x1434eb,null));};exports[_0xe049('0x55')]=function(_0x3cea76,_0x5790c6,_0x33f971){var _0x56e942={'raw':!![],'where':{}},_0x440b63={},_0x51f90a;return db[_0xe049('0x2e')][_0xe049('0x56')]({'where':{'id':_0x3cea76[_0xe049('0x49')]['id']}})[_0xe049('0x26')](handleEntityNotFound(_0x5790c6,null))[_0xe049('0x26')](function(_0x4af8a3){if(_0x4af8a3){_0x51f90a=_0x4af8a3[_0xe049('0x27')]({'plain':!![]});_0x440b63[_0xe049('0x32')]=_[_0xe049('0x4a')](db[_0xe049('0x57')][_0xe049('0x2f')]);_0x440b63[_0xe049('0x33')]=_[_0xe049('0x4a')](_0x3cea76[_0xe049('0x33')]);_0x440b63['filters']=_['intersection'](_0x440b63[_0xe049('0x32')],_0x440b63[_0xe049('0x33')]);_0x56e942['attributes']=_[_0xe049('0x34')](_0x440b63[_0xe049('0x32')],qs[_0xe049('0x36')](_0x3cea76[_0xe049('0x33')]['fields']));_0x56e942['attributes']=_0x56e942[_0xe049('0x35')]['length']?_0x56e942[_0xe049('0x35')]:_0x440b63[_0xe049('0x32')];if(!_0x3cea76[_0xe049('0x33')][_0xe049('0x38')](_0xe049('0x39'))){_0x56e942[_0xe049('0x3a')]=qs[_0xe049('0x3a')](_0x3cea76[_0xe049('0x33')]['limit']);_0x56e942[_0xe049('0x20')]=qs[_0xe049('0x20')](_0x3cea76[_0xe049('0x33')][_0xe049('0x20')]);}_0x56e942[_0xe049('0x3b')]=qs['sort'](_0x3cea76[_0xe049('0x33')][_0xe049('0x3c')]);_0x56e942[_0xe049('0x3d')]=qs[_0xe049('0x3e')](_['pick'](_0x3cea76['query'],_0x440b63[_0xe049('0x3e')]));_0x56e942[_0xe049('0x3d')][_0xe049('0x58')]=_0x4af8a3['id'];if(_0x3cea76[_0xe049('0x33')][_0xe049('0x40')]){_0x56e942[_0xe049('0x3d')]=_[_0xe049('0x42')](_0x56e942[_0xe049('0x3d')],{'$or':_[_0xe049('0x2d')](_0x56e942[_0xe049('0x35')],function(_0x8e5805){var _0x3fee79={};_0x3fee79[_0x8e5805]={'$like':'%'+_0x3cea76[_0xe049('0x33')][_0xe049('0x40')]+'%'};return _0x3fee79;})});}_0x56e942=_[_0xe049('0x42')]({},_0x56e942,_0x3cea76[_0xe049('0x4b')]);return db['UserMailQueue']['findAll'](_0x56e942);}})[_0xe049('0x26')](function(_0xb1604a){if(_0xb1604a){return db[_0xe049('0x59')]['findAndCountAll']({'where':{'id':_[_0xe049('0x2d')](_0xb1604a,_0xe049('0x5a')),'role':'agent'},'attributes':['id',_0xe049('0x2b'),_0xe049('0x5b'),'updatedAt',_0xe049('0x5c')]});}})[_0xe049('0x26')](function(_0x408638){if(_0x408638){return{'count':_0x408638[_0xe049('0x22')],'rows':_[_0xe049('0x2d')](_0x408638[_0xe049('0x46')],function(_0x104b8d){return{'membername':_0x104b8d[_0xe049('0x2b')],'UserId':_0x104b8d['id'],'queue_name':_0x51f90a[_0xe049('0x2b')],'MailQueueId':_0x51f90a['id'],'interface':util[_0xe049('0x5d')](_0xe049('0x5e'),_0xe049('0x5f'),_0x104b8d[_0xe049('0x2b')]),'penalty':0x0,'paused':_0x104b8d['mailPause'],'createdAt':_0x104b8d[_0xe049('0x5c')],'updatedAt':_0x104b8d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5790c6,_0x56e942))[_0xe049('0x47')](handleError(_0x5790c6,null));};exports[_0xe049('0x60')]=function(_0x39dfa3,_0x4ed7ba,_0x2b80e5){var _0x5c3121={};var _0x34a588={};var _0x5ee7e1;var _0x27819a;return db[_0xe049('0x2e')][_0xe049('0x56')]({'where':{'id':_0x39dfa3[_0xe049('0x49')]['id']}})[_0xe049('0x26')](handleEntityNotFound(_0x4ed7ba,null))[_0xe049('0x26')](function(_0x78bcfa){if(_0x78bcfa){_0x5ee7e1=_0x78bcfa;_0x34a588[_0xe049('0x32')]=_['keys'](db['Team'][_0xe049('0x2f')]);_0x34a588[_0xe049('0x33')]=_[_0xe049('0x4a')](_0x39dfa3[_0xe049('0x33')]);_0x34a588[_0xe049('0x3e')]=_[_0xe049('0x34')](_0x34a588['model'],_0x34a588[_0xe049('0x33')]);_0x5c3121['attributes']=_['intersection'](_0x34a588[_0xe049('0x32')],qs[_0xe049('0x36')](_0x39dfa3[_0xe049('0x33')]['fields']));_0x5c3121[_0xe049('0x35')]=_0x5c3121['attributes']['length']?_0x5c3121[_0xe049('0x35')]:_0x34a588[_0xe049('0x32')];_0x5c3121[_0xe049('0x3b')]=qs['sort'](_0x39dfa3['query'][_0xe049('0x3c')]);_0x5c3121[_0xe049('0x3d')]=qs['filters'](_[_0xe049('0x3f')](_0x39dfa3[_0xe049('0x33')],_0x34a588[_0xe049('0x3e')]));if(_0x39dfa3[_0xe049('0x33')]['filter']){_0x5c3121[_0xe049('0x3d')]=_[_0xe049('0x42')](_0x5c3121[_0xe049('0x3d')],{'$or':_['map'](_0x5c3121[_0xe049('0x35')],function(_0x409a7a){var _0x26d73a={};_0x26d73a[_0x409a7a]={'$like':'%'+_0x39dfa3[_0xe049('0x33')]['filter']+'%'};return _0x26d73a;})});}_0x5c3121=_[_0xe049('0x42')]({},_0x5c3121,_0x39dfa3[_0xe049('0x4b')]);return _0x5ee7e1[_0xe049('0x60')](_0x5c3121);}})['then'](function(_0x24e26b){if(_0x24e26b){_0x27819a=_0x24e26b[_0xe049('0x37')];if(!_0x39dfa3['query'][_0xe049('0x38')](_0xe049('0x39'))){_0x5c3121['limit']=qs[_0xe049('0x3a')](_0x39dfa3[_0xe049('0x33')][_0xe049('0x3a')]);_0x5c3121[_0xe049('0x20')]=qs[_0xe049('0x20')](_0x39dfa3[_0xe049('0x33')][_0xe049('0x20')]);}return _0x5ee7e1['getTeams'](_0x5c3121);}})['then'](function(_0x4f00c9){if(_0x4f00c9){return _0x4f00c9?{'count':_0x27819a,'rows':_0x4f00c9}:null;}})[_0xe049('0x26')](respondWithResult(_0x4ed7ba,null))['catch'](handleError(_0x4ed7ba,null));};exports[_0xe049('0x61')]=function(_0xbdea83,_0x116acd,_0x3dbc0a){var _0x3cf410=_0xbdea83[_0xe049('0x4e')][_0xe049('0x62')];return db['Team']['findAll']({'where':{'id':_0x3cf410},'attributes':['id'],'include':[{'model':db[_0xe049('0x59')],'as':_0xe049('0x63'),'attributes':['id','name','online',_0xe049('0x64'),'interface'],'raw':!![]}]})['then'](function(_0x328318){if(_0x328318){var _0x13ba1d=_[_0xe049('0x65')](_0x328318,function(_0x45d7be){var _0x1893af=_0x45d7be[_0xe049('0x27')]({'plain':!![]});return _0x1893af['Agents'];});return db[_0xe049('0x2e')][_0xe049('0x4c')]({'where':{'id':_0xbdea83[_0xe049('0x49')]['id']}})['then'](function(_0x5ada32){return db[_0xe049('0x66')][_0xe049('0x67')](function(_0xd43cd6){return _0x5ada32['addTeams'](_0x3cf410,{'transaction':_0xd43cd6})[_0xe049('0x26')](function(){return BPromise[_0xe049('0x68')](_0x13ba1d,function(_0x1e733b){return db[_0xe049('0x57')][_0xe049('0x69')]({'where':{'UserId':_0x1e733b['id'],'MailQueueId':_0xbdea83[_0xe049('0x49')]['id']},'transaction':_0xd43cd6});});})[_0xe049('0x26')](function(){_0x13ba1d[_0xe049('0x6a')](function(_0x54a5a5){socket[_0xe049('0x6b')](_0xe049('0x6c'),{'UserId':_0x54a5a5['id'],'MailQueueId':_0x5ada32['id']});});});});});}})[_0xe049('0x26')](respondWithStatusCode(_0x116acd,null))[_0xe049('0x47')](handleError(_0x116acd,null));};exports[_0xe049('0x6d')]=function(_0x8357fa,_0x1ef82b,_0x1b5655){return db[_0xe049('0x6e')][_0xe049('0x45')]({'where':{'id':_0x8357fa['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe049('0x26')](handleEntityNotFound(_0x1ef82b,null))['then'](function(_0x5089f3){var _0x3c56c2=_['map'](_0x5089f3,'id');var _0x55c600=[];var _0x2c424d=[];var _0x43f134=squel['select']();_0x43f134[_0xe049('0x6f')](_0xe049('0x70'))[_0xe049('0x71')]('team_has_mail_queues','tq')[_0xe049('0x72')](_0xe049('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe049('0x3d')](_0xe049('0x74'),_0x8357fa[_0xe049('0x49')]['id']);for(var _0x3acb63=0x0;_0x3acb63<_0x5089f3[_0xe049('0x37')];_0x3acb63+=0x1){let _0x46a547=_0x5089f3[_0x3acb63];for(var _0x24c02e=0x0;_0x24c02e<_0x46a547[_0xe049('0x63')][_0xe049('0x37')];_0x24c02e+=0x1){let _0x3d364b=_0x46a547[_0xe049('0x63')][_0x24c02e];var _0x3d3150=_0x43f134[_0xe049('0x75')]();_0x3d3150[_0xe049('0x3d')]('ut.UserId\x20=\x20?',_0x3d364b['id']);_0x2c424d['push'](db['sequelize'][_0xe049('0x33')](_0x3d3150['toString'](),{'type':db[_0xe049('0x66')]['QueryTypes'][_0xe049('0x76')]})[_0xe049('0x26')](function(_0x49e328){if(_0x49e328[_0xe049('0x37')]===0x1){return _0x3d364b['id'];}else{var _0x4567f6=_['every'](_[_0xe049('0x2d')](_0x49e328,'TeamId'),function(_0x240f7b){return _[_0xe049('0x77')](_0x3c56c2,_0x240f7b);});if(_0x4567f6){return _0x3d364b['id'];}}}));}}return BPromise[_0xe049('0x78')](_0x2c424d)[_0xe049('0x26')](function(_0x5718fa){_0x55c600=_(_0x55c600)[_0xe049('0x79')](_0x5718fa)['compact']()['value']();return db['MailQueue'][_0xe049('0x4c')]({'where':{'id':_0x8357fa[_0xe049('0x49')]['id']}})[_0xe049('0x26')](function(_0x15f12a){return db[_0xe049('0x66')][_0xe049('0x67')](function(_0x19218f){return _0x15f12a['removeTeams'](_0x8357fa[_0xe049('0x33')]['ids'],{'transaction':_0x19218f})[_0xe049('0x26')](function(){if(!_['isEmpty'](_0x55c600)){return _0x15f12a[_0xe049('0x7a')](_0x55c600,{'transaction':_0x19218f});}})[_0xe049('0x26')](function(){_0x55c600['forEach'](function(_0x370634){socket[_0xe049('0x6b')](_0xe049('0x7b'),{'UserId':_0x370634,'MailQueueId':_0x15f12a['id']});});});});});});})[_0xe049('0x26')](respondWithStatusCode(_0x1ef82b,null))[_0xe049('0x47')](handleError(_0x1ef82b,null));};exports[_0xe049('0x7c')]=function(_0x537324,_0x58096e,_0x2b22d1){return db['MailQueue'][_0xe049('0x4c')]({'where':{'id':_0x537324[_0xe049('0x49')]['id']}})['then'](handleEntityNotFound(_0x58096e,null))[_0xe049('0x26')](function(_0xc75248){if(_0xc75248){return _0xc75248[_0xe049('0x7c')](_0x537324[_0xe049('0x4e')][_0xe049('0x62')],_['omit'](_0x537324[_0xe049('0x4e')],[_0xe049('0x62'),'id'])||{})[_0xe049('0x7d')](function(_0x371709){for(var _0x30152c=0x0;_0x30152c<_0x537324[_0xe049('0x4e')][_0xe049('0x62')][_0xe049('0x37')];_0x30152c+=0x1){socket[_0xe049('0x6b')](_0xe049('0x6c'),{'UserId':Number(_0x537324[_0xe049('0x4e')][_0xe049('0x62')][_0x30152c]),'MailQueueId':Number(_0x537324[_0xe049('0x49')]['id'])});}return _0x371709;});}})[_0xe049('0x26')](respondWithResult(_0x58096e,null))['catch'](handleError(_0x58096e,null));};exports['removeAgents']=function(_0x185144,_0x3dc731,_0x1e5614){return db['MailQueue']['find']({'where':{'id':_0x185144[_0xe049('0x49')]['id']}})[_0xe049('0x26')](handleEntityNotFound(_0x3dc731,null))[_0xe049('0x26')](function(_0xd547cf){if(_0xd547cf){return _0xd547cf[_0xe049('0x7a')](_0x185144[_0xe049('0x33')][_0xe049('0x62')])[_0xe049('0x26')](function(){if(_[_0xe049('0x7e')](_0x185144['query'][_0xe049('0x62')])){for(var _0x3bd8e1=0x0;_0x3bd8e1<_0x185144[_0xe049('0x33')]['ids']['length'];_0x3bd8e1+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x185144[_0xe049('0x33')][_0xe049('0x62')][_0x3bd8e1]),'MailQueueId':Number(_0x185144['params']['id'])});}}else{socket[_0xe049('0x6b')](_0xe049('0x7b'),{'UserId':Number(_0x185144[_0xe049('0x33')][_0xe049('0x62')]),'MailQueueId':Number(_0x185144[_0xe049('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x3dc731,null))[_0xe049('0x47')](handleError(_0x3dc731,null));};exports['getAgents']=function(_0x13cc4f,_0x4a4c6d,_0x404dd5){var _0x93d994={};var _0x446327={};var _0x3891b8;var _0x2eb472;return db[_0xe049('0x2e')][_0xe049('0x56')]({'where':{'id':_0x13cc4f[_0xe049('0x49')]['id']}})[_0xe049('0x26')](handleEntityNotFound(_0x4a4c6d,null))[_0xe049('0x26')](function(_0x42a661){if(_0x42a661){_0x3891b8=_0x42a661;_0x446327[_0xe049('0x32')]=_[_0xe049('0x4a')](db[_0xe049('0x59')][_0xe049('0x2f')]);_0x446327[_0xe049('0x33')]=_[_0xe049('0x4a')](_0x13cc4f['query']);_0x446327[_0xe049('0x3e')]=_[_0xe049('0x34')](_0x446327[_0xe049('0x32')],_0x446327[_0xe049('0x33')]);_0x93d994[_0xe049('0x35')]=_[_0xe049('0x34')](_0x446327[_0xe049('0x32')],qs[_0xe049('0x36')](_0x13cc4f[_0xe049('0x33')][_0xe049('0x36')]));_0x93d994[_0xe049('0x35')]=_0x93d994['attributes']['length']?_0x93d994[_0xe049('0x35')]:_0x446327[_0xe049('0x32')];_0x93d994['order']=qs[_0xe049('0x3c')](_0x13cc4f['query'][_0xe049('0x3c')]);_0x93d994['where']=qs[_0xe049('0x3e')](_['pick'](_0x13cc4f[_0xe049('0x33')],_0x446327['filters']));if(_0x13cc4f['query'][_0xe049('0x40')]){_0x93d994['where']=_[_0xe049('0x42')](_0x93d994[_0xe049('0x3d')],{'$or':_[_0xe049('0x2d')](_0x93d994[_0xe049('0x35')],function(_0x492e40){var _0x21fff6={};_0x21fff6[_0x492e40]={'$like':'%'+_0x13cc4f[_0xe049('0x33')][_0xe049('0x40')]+'%'};return _0x21fff6;})});}_0x93d994=_[_0xe049('0x42')]({},_0x93d994,_0x13cc4f[_0xe049('0x4b')]);return _0x3891b8[_0xe049('0x7f')](_0x93d994);}})['then'](function(_0x4344fb){if(_0x4344fb){_0x2eb472=_0x4344fb[_0xe049('0x37')];if(!_0x13cc4f[_0xe049('0x33')][_0xe049('0x38')]('nolimit')){_0x93d994[_0xe049('0x3a')]=qs[_0xe049('0x3a')](_0x13cc4f['query'][_0xe049('0x3a')]);_0x93d994[_0xe049('0x20')]=qs['offset'](_0x13cc4f[_0xe049('0x33')][_0xe049('0x20')]);}return _0x3891b8['getAgents'](_0x93d994);}})[_0xe049('0x26')](function(_0x1597e1){if(_0x1597e1){return _0x1597e1?{'count':_0x2eb472,'rows':_0x1597e1}:null;}})['then'](respondWithResult(_0x4a4c6d,null))[_0xe049('0x47')](handleError(_0x4a4c6d,null));};
\ No newline at end of file
index 889eaf0..3c8da08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fed=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2dcf72,_0x5f1abe){var _0x523435=function(_0x1f8bc6){while(--_0x1f8bc6){_0x2dcf72['push'](_0x2dcf72['shift']());}};_0x523435(++_0x5f1abe);}(_0x0fed,0x6d));var _0xd0fe=function(_0x42a0f6,_0x4ee755){_0x42a0f6=_0x42a0f6-0x0;var _0x259bdb=_0x0fed[_0x42a0f6];return _0x259bdb;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xd0fe('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd0fe('0x1')](0x0);var events={'afterCreate':_0xd0fe('0x2'),'afterUpdate':_0xd0fe('0x3'),'afterDestroy':_0xd0fe('0x4')};function emitEvent(_0x18cad5){return function(_0x21d349,_0xfe69e0,_0x31b30f){MailQueueEvents[_0xd0fe('0x5')](_0x18cad5+':'+_0x21d349['id'],_0x21d349);MailQueueEvents['emit'](_0x18cad5,_0x21d349);_0x31b30f(null);};}for(var e in events){if(events[_0xd0fe('0x6')](e)){var event=events[e];MailQueue[_0xd0fe('0x7')](e,emitEvent(event));}}module[_0xd0fe('0x8')]=MailQueueEvents;
\ No newline at end of file
+var _0xe2a2=['events','../../mysqldb','MailQueue','remove','emit','hook','exports'];(function(_0x2c6b8c,_0x367dca){var _0x2282bf=function(_0x111caf){while(--_0x111caf){_0x2c6b8c['push'](_0x2c6b8c['shift']());}};_0x2282bf(++_0x367dca);}(_0xe2a2,0xbd));var _0x2e2a=function(_0x5a5513,_0x523836){_0x5a5513=_0x5a5513-0x0;var _0x501d7d=_0xe2a2[_0x5a5513];return _0x501d7d;};'use strict';var EventEmitter=require(_0x2e2a('0x0'));var MailQueue=require(_0x2e2a('0x1'))['db'][_0x2e2a('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2e2a('0x3')};function emitEvent(_0xde6890){return function(_0x2a8104,_0x38944d,_0x3cabdf){MailQueueEvents[_0x2e2a('0x4')](_0xde6890+':'+_0x2a8104['id'],_0x2a8104);MailQueueEvents[_0x2e2a('0x4')](_0xde6890,_0x2a8104);_0x3cabdf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x2e2a('0x5')](e,emitEvent(event));}}module[_0x2e2a('0x6')]=MailQueueEvents;
\ No newline at end of file
index a2f383d..e79a573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7be9=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','../../config/logger','api','moment','bluebird'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x7be9,0x64));var _0x97be=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x7be9[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x97be('0x0'))(_0x97be('0x1'));var moment=require(_0x97be('0x2'));var BPromise=require(_0x97be('0x3'));var rp=require(_0x97be('0x4'));var fs=require('fs');var path=require(_0x97be('0x5'));var rimraf=require(_0x97be('0x6'));var config=require(_0x97be('0x7'));var attributes=require(_0x97be('0x8'));module[_0x97be('0x9')]=function(_0x319c81,_0x296d19){return _0x319c81[_0x97be('0xa')](_0x97be('0xb'),attributes,{'tableName':_0x97be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd88=['rimraf','./mailQueue.attributes','exports','define','MailQueue','lodash','util','api','moment','bluebird','request-promise'];(function(_0x120e09,_0x522872){var _0x4c07e9=function(_0x2b9ddf){while(--_0x2b9ddf){_0x120e09['push'](_0x120e09['shift']());}};_0x4c07e9(++_0x522872);}(_0xdd88,0x15a));var _0x8dd8=function(_0x4893d9,_0x55761d){_0x4893d9=_0x4893d9-0x0;var _0xb91316=_0xdd88[_0x4893d9];return _0xb91316;};'use strict';var _=require(_0x8dd8('0x0'));var util=require(_0x8dd8('0x1'));var logger=require('../../config/logger')(_0x8dd8('0x2'));var moment=require(_0x8dd8('0x3'));var BPromise=require(_0x8dd8('0x4'));var rp=require(_0x8dd8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8dd8('0x6'));var config=require('../../config/environment');var attributes=require(_0x8dd8('0x7'));module[_0x8dd8('0x8')]=function(_0x55897d,_0x168a60){return _0x55897d[_0x8dd8('0x9')](_0x8dd8('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f739f48..efe86ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd51=['./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','model','map','GetMailQueue','ShowMailQueue','where','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdd51,0x8b));var _0x1dd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd51[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1dd5('0x0'));var BPromise=require(_0x1dd5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dd5('0x2'));var db=require(_0x1dd5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1dd5('0x4'))('rpc');var config=require(_0x1dd5('0x5'));var jayson=require(_0x1dd5('0x6'));var client=jayson[_0x1dd5('0x7')][_0x1dd5('0x8')]({'port':0x232a});config['redis']=_[_0x1dd5('0x9')](config[_0x1dd5('0xa')],{'host':_0x1dd5('0xb'),'port':0x18eb});var socket=require(_0x1dd5('0xc'))(new Redis(config['redis']));require(_0x1dd5('0xd'))[_0x1dd5('0xe')](socket);function respondWithRpcPromise(_0x21dce8,_0x1984bc,_0x120a70){return new BPromise(function(_0x59c872,_0x58d3fe){return client[_0x1dd5('0xf')](_0x21dce8,_0x120a70)[_0x1dd5('0x10')](function(_0x587e09){logger[_0x1dd5('0x11')](_0x1dd5('0x12'),_0x1984bc,'request\x20sent');logger[_0x1dd5('0x13')](_0x1dd5('0x14'),_0x1984bc,'request\x20sent',JSON[_0x1dd5('0x15')](_0x587e09));if(_0x587e09[_0x1dd5('0x16')]){if(_0x587e09[_0x1dd5('0x16')][_0x1dd5('0x17')]===0x1f4){logger['error'](_0x1dd5('0x12'),_0x1984bc,_0x587e09[_0x1dd5('0x16')][_0x1dd5('0x18')]);return _0x58d3fe(_0x587e09[_0x1dd5('0x16')][_0x1dd5('0x18')]);}logger['error'](_0x1dd5('0x12'),_0x1984bc,_0x587e09['error'][_0x1dd5('0x18')]);return _0x59c872(_0x587e09[_0x1dd5('0x16')][_0x1dd5('0x18')]);}else{logger[_0x1dd5('0x11')]('MailQueue,\x20%s,\x20%s',_0x1984bc,'request\x20sent');_0x59c872(_0x587e09[_0x1dd5('0x19')][_0x1dd5('0x18')]);}})[_0x1dd5('0x1a')](function(_0x202a2b){logger[_0x1dd5('0x16')](_0x1dd5('0x12'),_0x1984bc,_0x202a2b);_0x58d3fe(_0x202a2b);});});}exports['GetMailQueue']=function(_0x22cd15){var _0x3ca68f=this;return new Promise(function(_0x39a56f,_0x5be4b0){return db['MailQueue'][_0x1dd5('0x1b')]({'raw':_0x22cd15[_0x1dd5('0x1c')]?_0x22cd15['options'][_0x1dd5('0x1d')]===undefined?!![]:![]:!![],'where':_0x22cd15[_0x1dd5('0x1c')]?_0x22cd15['options']['where']||null:null,'attributes':_0x22cd15[_0x1dd5('0x1c')]?_0x22cd15['options'][_0x1dd5('0x1e')]||null:null,'limit':_0x22cd15[_0x1dd5('0x1c')]?_0x22cd15['options'][_0x1dd5('0x1f')]||null:null,'include':_0x22cd15[_0x1dd5('0x1c')]?_0x22cd15[_0x1dd5('0x1c')]['include']?_['map'](_0x22cd15[_0x1dd5('0x1c')][_0x1dd5('0x20')],function(_0x593d35){return{'model':db[_0x593d35[_0x1dd5('0x21')]],'as':_0x593d35['as'],'attributes':_0x593d35[_0x1dd5('0x1e')],'include':_0x593d35[_0x1dd5('0x20')]?_[_0x1dd5('0x22')](_0x593d35[_0x1dd5('0x20')],function(_0x38b52f){return{'model':db[_0x38b52f[_0x1dd5('0x21')]],'as':_0x38b52f['as'],'attributes':_0x38b52f['attributes'],'include':_0x38b52f[_0x1dd5('0x20')]?_[_0x1dd5('0x22')](_0x38b52f['include'],function(_0x448f3c){return{'model':db[_0x448f3c['model']],'as':_0x448f3c['as'],'attributes':_0x448f3c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dd5('0x10')](function(_0x264114){logger[_0x1dd5('0x11')](_0x1dd5('0x23'),_0x22cd15);logger[_0x1dd5('0x13')]('GetMailQueue',_0x22cd15,JSON[_0x1dd5('0x15')](_0x264114));_0x39a56f(_0x264114);})[_0x1dd5('0x1a')](function(_0x12f7ca){logger[_0x1dd5('0x16')]('GetMailQueue',_0x12f7ca[_0x1dd5('0x18')],_0x22cd15);_0x5be4b0(_0x3ca68f[_0x1dd5('0x16')](0x1f4,_0x12f7ca[_0x1dd5('0x18')]));});});};exports[_0x1dd5('0x24')]=function(_0x3a14aa){var _0x53b52e=this;return new Promise(function(_0x12aa8a,_0x2711c5){return db['MailQueue']['find']({'raw':_0x3a14aa[_0x1dd5('0x1c')]?_0x3a14aa[_0x1dd5('0x1c')][_0x1dd5('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a14aa[_0x1dd5('0x1c')]?_0x3a14aa[_0x1dd5('0x1c')][_0x1dd5('0x25')]||null:null,'attributes':_0x3a14aa['options']?_0x3a14aa[_0x1dd5('0x1c')][_0x1dd5('0x1e')]||null:null,'include':_0x3a14aa['options']?_0x3a14aa[_0x1dd5('0x1c')][_0x1dd5('0x20')]?_[_0x1dd5('0x22')](_0x3a14aa[_0x1dd5('0x1c')]['include'],function(_0x5db0ca){return{'model':db[_0x5db0ca[_0x1dd5('0x21')]],'as':_0x5db0ca['as'],'attributes':_0x5db0ca[_0x1dd5('0x1e')],'include':_0x5db0ca['include']?_[_0x1dd5('0x22')](_0x5db0ca[_0x1dd5('0x20')],function(_0x4ab9f9){return{'model':db[_0x4ab9f9[_0x1dd5('0x21')]],'as':_0x4ab9f9['as'],'attributes':_0x4ab9f9[_0x1dd5('0x1e')],'include':_0x4ab9f9[_0x1dd5('0x20')]?_['map'](_0x4ab9f9[_0x1dd5('0x20')],function(_0x85dd11){return{'model':db[_0x85dd11[_0x1dd5('0x21')]],'as':_0x85dd11['as'],'attributes':_0x85dd11[_0x1dd5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1dd5('0x10')](function(_0x235597){logger['info'](_0x1dd5('0x24'),_0x3a14aa);logger[_0x1dd5('0x13')](_0x1dd5('0x24'),_0x3a14aa,JSON[_0x1dd5('0x15')](_0x235597));_0x12aa8a(_0x235597);})[_0x1dd5('0x1a')](function(_0x298996){logger[_0x1dd5('0x16')](_0x1dd5('0x24'),_0x298996[_0x1dd5('0x18')],_0x3a14aa);_0x2711c5(_0x53b52e['error'](0x1f4,_0x298996[_0x1dd5('0x18')]));});});};
\ No newline at end of file
+var _0x2f76=['MailQueue','find','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','MailQueue,\x20%s,\x20%s','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowMailQueue'];(function(_0x10e0a3,_0x3e70a6){var _0x38d487=function(_0x21abad){while(--_0x21abad){_0x10e0a3['push'](_0x10e0a3['shift']());}};_0x38d487(++_0x3e70a6);}(_0x2f76,0x122));var _0x62f7=function(_0xc0793,_0x1aa1a6){_0xc0793=_0xc0793-0x0;var _0x3238c2=_0x2f76[_0xc0793];return _0x3238c2;};'use strict';var _=require('lodash');var util=require(_0x62f7('0x0'));var moment=require(_0x62f7('0x1'));var BPromise=require(_0x62f7('0x2'));var rs=require(_0x62f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x62f7('0x4'))['db'];var utils=require(_0x62f7('0x5'));var logger=require(_0x62f7('0x6'))(_0x62f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x62f7('0x8'));var client=jayson[_0x62f7('0x9')][_0x62f7('0xa')]({'port':0x232a});config[_0x62f7('0xb')]=_[_0x62f7('0xc')](config[_0x62f7('0xb')],{'host':_0x62f7('0xd'),'port':0x18eb});var socket=require(_0x62f7('0xe'))(new Redis(config[_0x62f7('0xb')]));require('./mailQueue.socket')[_0x62f7('0xf')](socket);function respondWithRpcPromise(_0x4a31af,_0x8dbacb,_0x4d4e41){return new BPromise(function(_0x371e94,_0x5cf0cf){return client[_0x62f7('0x10')](_0x4a31af,_0x4d4e41)['then'](function(_0x17bf04){logger[_0x62f7('0x11')]('MailQueue,\x20%s,\x20%s',_0x8dbacb,_0x62f7('0x12'));logger['debug'](_0x62f7('0x13'),_0x8dbacb,_0x62f7('0x12'),JSON['stringify'](_0x17bf04));if(_0x17bf04[_0x62f7('0x14')]){if(_0x17bf04[_0x62f7('0x14')]['code']===0x1f4){logger['error'](_0x62f7('0x15'),_0x8dbacb,_0x17bf04['error'][_0x62f7('0x16')]);return _0x5cf0cf(_0x17bf04[_0x62f7('0x14')][_0x62f7('0x16')]);}logger[_0x62f7('0x14')](_0x62f7('0x15'),_0x8dbacb,_0x17bf04[_0x62f7('0x14')][_0x62f7('0x16')]);return _0x371e94(_0x17bf04['error'][_0x62f7('0x16')]);}else{logger[_0x62f7('0x11')](_0x62f7('0x15'),_0x8dbacb,_0x62f7('0x12'));_0x371e94(_0x17bf04[_0x62f7('0x17')][_0x62f7('0x16')]);}})[_0x62f7('0x18')](function(_0x143511){logger['error'](_0x62f7('0x15'),_0x8dbacb,_0x143511);_0x5cf0cf(_0x143511);});});}exports[_0x62f7('0x19')]=function(_0x39c5a3){var _0x283f52=this;return new Promise(function(_0x2b1295,_0x48bde2){return db['MailQueue'][_0x62f7('0x1a')]({'raw':_0x39c5a3['options']?_0x39c5a3[_0x62f7('0x1b')][_0x62f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x39c5a3[_0x62f7('0x1b')]?_0x39c5a3['options'][_0x62f7('0x1d')]||null:null,'attributes':_0x39c5a3[_0x62f7('0x1b')]?_0x39c5a3[_0x62f7('0x1b')][_0x62f7('0x1e')]||null:null,'limit':_0x39c5a3[_0x62f7('0x1b')]?_0x39c5a3['options'][_0x62f7('0x1f')]||null:null,'include':_0x39c5a3[_0x62f7('0x1b')]?_0x39c5a3['options'][_0x62f7('0x20')]?_[_0x62f7('0x21')](_0x39c5a3[_0x62f7('0x1b')][_0x62f7('0x20')],function(_0x4af8ea){return{'model':db[_0x4af8ea[_0x62f7('0x22')]],'as':_0x4af8ea['as'],'attributes':_0x4af8ea[_0x62f7('0x1e')],'include':_0x4af8ea['include']?_['map'](_0x4af8ea['include'],function(_0x24539e){return{'model':db[_0x24539e[_0x62f7('0x22')]],'as':_0x24539e['as'],'attributes':_0x24539e[_0x62f7('0x1e')],'include':_0x24539e[_0x62f7('0x20')]?_[_0x62f7('0x21')](_0x24539e[_0x62f7('0x20')],function(_0x5649cb){return{'model':db[_0x5649cb['model']],'as':_0x5649cb['as'],'attributes':_0x5649cb[_0x62f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x62f7('0x23')](function(_0x1d92c4){logger[_0x62f7('0x11')](_0x62f7('0x19'),_0x39c5a3);logger['debug'](_0x62f7('0x19'),_0x39c5a3,JSON[_0x62f7('0x24')](_0x1d92c4));_0x2b1295(_0x1d92c4);})[_0x62f7('0x18')](function(_0x2100e0){logger[_0x62f7('0x14')](_0x62f7('0x19'),_0x2100e0[_0x62f7('0x16')],_0x39c5a3);_0x48bde2(_0x283f52['error'](0x1f4,_0x2100e0['message']));});});};exports[_0x62f7('0x25')]=function(_0x46b88a){var _0x25e575=this;return new Promise(function(_0x524e5c,_0x227d6c){return db[_0x62f7('0x26')][_0x62f7('0x27')]({'raw':_0x46b88a[_0x62f7('0x1b')]?_0x46b88a['options'][_0x62f7('0x1c')]===undefined?!![]:![]:!![],'where':_0x46b88a['options']?_0x46b88a[_0x62f7('0x1b')][_0x62f7('0x1d')]||null:null,'attributes':_0x46b88a[_0x62f7('0x1b')]?_0x46b88a[_0x62f7('0x1b')][_0x62f7('0x1e')]||null:null,'include':_0x46b88a['options']?_0x46b88a[_0x62f7('0x1b')]['include']?_[_0x62f7('0x21')](_0x46b88a[_0x62f7('0x1b')]['include'],function(_0x4d5b2a){return{'model':db[_0x4d5b2a['model']],'as':_0x4d5b2a['as'],'attributes':_0x4d5b2a[_0x62f7('0x1e')],'include':_0x4d5b2a[_0x62f7('0x20')]?_[_0x62f7('0x21')](_0x4d5b2a[_0x62f7('0x20')],function(_0x441f4d){return{'model':db[_0x441f4d[_0x62f7('0x22')]],'as':_0x441f4d['as'],'attributes':_0x441f4d[_0x62f7('0x1e')],'include':_0x441f4d[_0x62f7('0x20')]?_[_0x62f7('0x21')](_0x441f4d[_0x62f7('0x20')],function(_0x3013ab){return{'model':db[_0x3013ab['model']],'as':_0x3013ab['as'],'attributes':_0x3013ab[_0x62f7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x62f7('0x23')](function(_0x24f225){logger['info']('ShowMailQueue',_0x46b88a);logger[_0x62f7('0x28')]('ShowMailQueue',_0x46b88a,JSON[_0x62f7('0x24')](_0x24f225));_0x524e5c(_0x24f225);})['catch'](function(_0x2f2694){logger[_0x62f7('0x14')]('ShowMailQueue',_0x2f2694['message'],_0x46b88a);_0x227d6c(_0x25e575[_0x62f7('0x14')](0x1f4,_0x2f2694['message']));});});};
\ No newline at end of file
index ed86820..45d3edd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3f=['./mailQueue.events','save','remove','update','emit','removeListener','register','mailQueue:'];(function(_0x34e088,_0x2ea53d){var _0x21749a=function(_0x12c261){while(--_0x12c261){_0x34e088['push'](_0x34e088['shift']());}};_0x21749a(++_0x2ea53d);}(_0xeb3f,0xa8));var _0xfeb3=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xeb3f[_0x432682];return _0x463d05;};'use strict';var MailQueueEvents=require(_0xfeb3('0x0'));var events=[_0xfeb3('0x1'),_0xfeb3('0x2'),_0xfeb3('0x3')];function createListener(_0x35e554,_0x48b70c){return function(_0x2c0229){_0x48b70c[_0xfeb3('0x4')](_0x35e554,_0x2c0229);};}function removeListener(_0x1f27f4,_0x125a2f){return function(){MailQueueEvents[_0xfeb3('0x5')](_0x1f27f4,_0x125a2f);};}exports[_0xfeb3('0x6')]=function(_0x455738){for(var _0x10fa12=0x0,_0x38379c=events['length'];_0x10fa12<_0x38379c;_0x10fa12++){var _0x20dfc4=events[_0x10fa12];var _0x1a4e9c=createListener(_0xfeb3('0x7')+_0x20dfc4,_0x455738);MailQueueEvents['on'](_0x20dfc4,_0x1a4e9c);}};
\ No newline at end of file
+var _0x6d0c=['emit','removeListener','length','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x482a1e,_0x95073){var _0xfabdd0=function(_0x20d1c2){while(--_0x20d1c2){_0x482a1e['push'](_0x482a1e['shift']());}};_0xfabdd0(++_0x95073);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x35aca8,_0x1bddc9){_0x35aca8=_0x35aca8-0x0;var _0x581ff4=_0x6d0c[_0x35aca8];return _0x581ff4;};'use strict';var MailQueueEvents=require(_0xc6d0('0x0'));var events=[_0xc6d0('0x1'),_0xc6d0('0x2'),_0xc6d0('0x3')];function createListener(_0xc8bedb,_0x350d3a){return function(_0x487187){_0x350d3a[_0xc6d0('0x4')](_0xc8bedb,_0x487187);};}function removeListener(_0x5e2eb1,_0x5e5db2){return function(){MailQueueEvents[_0xc6d0('0x5')](_0x5e2eb1,_0x5e5db2);};}exports['register']=function(_0x589214){for(var _0xdae4c3=0x0,_0x40ba33=events[_0xc6d0('0x6')];_0xdae4c3<_0x40ba33;_0xdae4c3++){var _0x39e8be=events[_0xdae4c3];var _0xbd2213=createListener(_0xc6d0('0x7')+_0x39e8be,_0x589214);MailQueueEvents['on'](_0x39e8be,_0xbd2213);}};
\ No newline at end of file
index b098d3a..bfc9361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18b8=['post','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x33d943,_0x1f1f04){var _0x212c30=function(_0x1e00f2){while(--_0x1e00f2){_0x33d943['push'](_0x33d943['shift']());}};_0x212c30(++_0x1f1f04);}(_0x18b8,0xc3));var _0x818b=function(_0x150268,_0x424e72){_0x150268=_0x150268-0x0;var _0x411336=_0x18b8[_0x150268];return _0x411336;};'use strict';var multer=require(_0x818b('0x0'));var util=require(_0x818b('0x1'));var path=require('path');var timeout=require(_0x818b('0x2'));var express=require(_0x818b('0x3'));var router=express[_0x818b('0x4')]();var fs_extra=require(_0x818b('0x5'));var auth=require(_0x818b('0x6'));var interaction=require(_0x818b('0x7'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x818b('0x8')]('/',auth[_0x818b('0x9')](),controller[_0x818b('0xa')]);router['get'](_0x818b('0xb'),auth['isAuthenticated'](),controller[_0x818b('0xc')]);router['get'](_0x818b('0xd'),auth[_0x818b('0x9')](),controller['show']);router[_0x818b('0xe')]('/',auth[_0x818b('0x9')](),controller['create']);router[_0x818b('0xf')](_0x818b('0xd'),auth[_0x818b('0x9')](),controller[_0x818b('0x10')]);router[_0x818b('0x11')](_0x818b('0xd'),auth[_0x818b('0x9')](),controller['destroy']);module[_0x818b('0x12')]=router;
\ No newline at end of file
+var _0x9490=['/describe','isAuthenticated','/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./mailQueueReport.controller','index','get'];(function(_0xe25d3b,_0x71e6a7){var _0x233ce0=function(_0x98145c){while(--_0x98145c){_0xe25d3b['push'](_0xe25d3b['shift']());}};_0x233ce0(++_0x71e6a7);}(_0x9490,0x1ab));var _0x0949=function(_0x5d9c62,_0x35a1ab){_0x5d9c62=_0x5d9c62-0x0;var _0x380b7d=_0x9490[_0x5d9c62];return _0x380b7d;};'use strict';var multer=require(_0x0949('0x0'));var util=require(_0x0949('0x1'));var path=require(_0x0949('0x2'));var timeout=require('connect-timeout');var express=require(_0x0949('0x3'));var router=express[_0x0949('0x4')]();var fs_extra=require(_0x0949('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0949('0x6'));var controller=require(_0x0949('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0949('0x8')]);router[_0x0949('0x9')](_0x0949('0xa'),auth[_0x0949('0xb')](),controller['describe']);router['get'](_0x0949('0xc'),auth[_0x0949('0xb')](),controller['show']);router[_0x0949('0xd')]('/',auth[_0x0949('0xb')](),controller[_0x0949('0xe')]);router['put'](_0x0949('0xc'),auth[_0x0949('0xb')](),controller[_0x0949('0xf')]);router[_0x0949('0x10')](_0x0949('0xc'),auth[_0x0949('0xb')](),controller[_0x0949('0x11')]);module[_0x0949('0x12')]=router;
\ No newline at end of file
index f1c8790..ce895ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5be=['exports','STRING','DATE','moment','sequelize'];(function(_0x38d636,_0x3ad275){var _0x375ac7=function(_0x1a77ec){while(--_0x1a77ec){_0x38d636['push'](_0x38d636['shift']());}};_0x375ac7(++_0x3ad275);}(_0xf5be,0x107));var _0xef5b=function(_0x48790f,_0x1b48a8){_0x48790f=_0x48790f-0x0;var _0x5ce7bd=_0xf5be[_0x48790f];return _0x5ce7bd;};'use strict';var moment=require(_0xef5b('0x0'));var Sequelize=require(_0xef5b('0x1'));module[_0xef5b('0x2')]={'uniqueid':{'type':Sequelize[_0xef5b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xef5b('0x3')]},'joinAt':{'type':Sequelize[_0xef5b('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xef5b('0x4')]},'exitAt':{'type':Sequelize[_0xef5b('0x4')]},'reason':{'type':Sequelize[_0xef5b('0x3')]}};
\ No newline at end of file
+var _0x544f=['exports','STRING','DATE','moment','sequelize'];(function(_0x2484e7,_0x3f2204){var _0x24a8a6=function(_0x32ad50){while(--_0x32ad50){_0x2484e7['push'](_0x2484e7['shift']());}};_0x24a8a6(++_0x3f2204);}(_0x544f,0xbc));var _0xf544=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x544f[_0x2070da];return _0x4f9fe1;};'use strict';var moment=require(_0xf544('0x0'));var Sequelize=require(_0xf544('0x1'));module[_0xf544('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf544('0x3')]},'joinAt':{'type':Sequelize[_0xf544('0x4')]},'leaveAt':{'type':Sequelize[_0xf544('0x4')]},'acceptAt':{'type':Sequelize[_0xf544('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d08af59..6184813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x4ca83c,_0x34ebce){var _0xadd149=function(_0x4797df){while(--_0x4797df){_0x4ca83c['push'](_0x4ca83c['shift']());}};_0xadd149(++_0x34ebce);}(_0xc2c7,0x134));var _0x7c2c=function(_0x538808,_0x17bd0b){_0x538808=_0x538808-0x0;var _0x2883f7=_0xc2c7[_0x538808];return _0x2883f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['MailQueueReport'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['MailQueueReport'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['MailQueueReport'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));};
\ No newline at end of file
+var _0x5f66=['bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','MailQueueReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x2cb58b,_0x5a879d){var _0xe9dd9c=function(_0x11e835){while(--_0x11e835){_0x2cb58b['push'](_0x2cb58b['shift']());}};_0xe9dd9c(++_0x5a879d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'all':!![]}];}return db[_0x65f6('0x27')][_0x65f6('0x3c')](_0x4ac04b);})[_0x65f6('0x21')](function(_0xed4c96){_0x266cfe[_0x65f6('0x3d')]=_0xed4c96;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))['catch'](handleError(_0x559330,null));};exports[_0x65f6('0x3e')]=function(_0x400ed2,_0x377ae5){var _0x181798={'raw':!![],'where':{'id':_0x400ed2[_0x65f6('0x3f')]['id']}},_0x83e2d9={};_0x83e2d9[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x83e2d9[_0x65f6('0x2c')]=_[_0x65f6('0x2b')](_0x400ed2[_0x65f6('0x2c')]);_0x83e2d9[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],_0x83e2d9['query']);_0x181798[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x83e2d9[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x400ed2['query'][_0x65f6('0x2f')]));_0x181798[_0x65f6('0x30')]=_0x181798[_0x65f6('0x30')]['length']?_0x181798[_0x65f6('0x30')]:_0x83e2d9[_0x65f6('0x2a')];if(_0x400ed2[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x181798['include']=[{'all':!![]}];}_0x181798=_[_0x65f6('0x37')]({},_0x181798,_0x400ed2['options']);return db[_0x65f6('0x27')][_0x65f6('0x40')](_0x181798)['then'](handleEntityNotFound(_0x377ae5,null))[_0x65f6('0x21')](respondWithResult(_0x377ae5,null))['catch'](handleError(_0x377ae5,null));};exports[_0x65f6('0x41')]=function(_0x4d9b76,_0x2d1706){return db[_0x65f6('0x27')][_0x65f6('0x41')](_0x4d9b76[_0x65f6('0x42')],{})['then'](respondWithResult(_0x2d1706,0xc9))['catch'](handleError(_0x2d1706,null));};exports[_0x65f6('0x43')]=function(_0x15d3ba,_0x3b647a){if(_0x15d3ba[_0x65f6('0x42')]['id']){delete _0x15d3ba[_0x65f6('0x42')]['id'];}return db[_0x65f6('0x27')][_0x65f6('0x40')]({'where':{'id':_0x15d3ba[_0x65f6('0x3f')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b647a,null))['then'](saveUpdates(_0x15d3ba[_0x65f6('0x42')],null))[_0x65f6('0x21')](respondWithResult(_0x3b647a,null))[_0x65f6('0x44')](handleError(_0x3b647a,null));};exports['destroy']=function(_0x47e749,_0x42d453){return db['MailQueueReport'][_0x65f6('0x40')]({'where':{'id':_0x47e749[_0x65f6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x42d453,null))[_0x65f6('0x21')](removeEntity(_0x42d453,null))['catch'](handleError(_0x42d453,null));};exports[_0x65f6('0x45')]=function(_0x3b241f,_0x1ca67e){return db['MailQueueReport'][_0x65f6('0x45')]()[_0x65f6('0x21')](respondWithResult(_0x1ca67e,null))['catch'](handleError(_0x1ca67e,null));};
\ No newline at end of file
index 3db905b..9745b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b4e=['moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x5b4e,0xd7));var _0xe5b4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5b4e[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe5b4('0x0'));var moment=require(_0xe5b4('0x1'));var BPromise=require(_0xe5b4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5b4('0x3'));var rimraf=require(_0xe5b4('0x4'));var config=require(_0xe5b4('0x5'));var attributes=require(_0xe5b4('0x6'));module[_0xe5b4('0x7')]=function(_0x90d0d8,_0x859998){return _0x90d0d8[_0xe5b4('0x8')](_0xe5b4('0x9'),attributes,{'tableName':_0xe5b4('0xa'),'paranoid':![],'indexes':[{'name':_0xe5b4('0xb'),'fields':[_0xe5b4('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa434=['report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','MailQueueReport'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xa434,0x1af));var _0x4a43=function(_0x12833b,_0x26c1d2){_0x12833b=_0x12833b-0x0;var _0x3acad3=_0xa434[_0x12833b];return _0x3acad3;};'use strict';var _=require(_0x4a43('0x0'));var util=require(_0x4a43('0x1'));var logger=require(_0x4a43('0x2'))(_0x4a43('0x3'));var moment=require('moment');var BPromise=require(_0x4a43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a43('0x5'));var rimraf=require(_0x4a43('0x6'));var config=require(_0x4a43('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x4a43('0x8')]=function(_0x40abdc,_0x5677da){return _0x40abdc[_0x4a43('0x9')](_0x4a43('0xa'),attributes,{'tableName':_0x4a43('0xb'),'paranoid':![],'indexes':[{'name':_0x4a43('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 32bae95..cde06c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5b25ee,_0x5fdd74){var _0x59910a=function(_0x34b369){while(--_0x34b369){_0x5b25ee['push'](_0x5b25ee['shift']());}};_0x59910a(++_0x5fdd74);}(_0x326f,0xd1));var _0xf326=function(_0x3e45da,_0x3c29f4){_0x3e45da=_0x3e45da-0x0;var _0x1845e5=_0x326f[_0x3e45da];return _0x1845e5;};'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')]('MailQueueReport,\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')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ 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(_0x418da4,_0x615190){var _0x533d9f=function(_0x5c1ff4){while(--_0x5c1ff4){_0x418da4['push'](_0x418da4['shift']());}};_0x533d9f(++_0x615190);}(_0xadb5,0xad));var _0x5adb=function(_0x1a68b8,_0x5375c3){_0x1a68b8=_0x1a68b8-0x0;var _0x2ae571=_0xadb5[_0x1a68b8];return _0x2ae571;};'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 73588a9..22a2b97 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(_0x45aca3,_0x2dc880){var _0x540d06=function(_0x1ca425){while(--_0x1ca425){_0x45aca3['push'](_0x45aca3['shift']());}};_0x540d06(++_0x2dc880);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5e9da3,_0x5afe8e){var _0x1ce810=function(_0x151170){while(--_0x151170){_0x5e9da3['push'](_0x5e9da3['shift']());}};_0x1ce810(++_0x5afe8e);}(_0xe706,0xa3));var _0x6e70=function(_0x88249c,_0x24124e){_0x88249c=_0x88249c-0x0;var _0x951993=_0xe706[_0x88249c];return _0x951993;};'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 3eab5be..237d081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d2=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x357a33,_0x40d6e3){var _0x57ebf1=function(_0x5140b2){while(--_0x5140b2){_0x357a33['push'](_0x357a33['shift']());}};_0x57ebf1(++_0x40d6e3);}(_0x16d2,0x123));var _0x216d=function(_0x91384,_0x476988){_0x91384=_0x91384-0x0;var _0x1a16c2=_0x16d2[_0x91384];return _0x1a16c2;};'use strict';var Sequelize=require(_0x216d('0x0'));module[_0x216d('0x1')]={'description':{'type':Sequelize[_0x216d('0x2')]},'host':{'type':Sequelize[_0x216d('0x2')]},'authentication':{'type':Sequelize[_0x216d('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x216d('0x2')]},'password':{'type':Sequelize[_0x216d('0x2')]},'port':{'type':Sequelize[_0x216d('0x4')]},'tls':{'type':Sequelize[_0x216d('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x216d('0x5')},'connTimeout':{'type':Sequelize[_0x216d('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x216d('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x216d('0x2')]}};
\ No newline at end of file
+var _0xe1e3=['exports','STRING','BOOLEAN','INBOX','INTEGER','sequelize'];(function(_0x5653fd,_0x2109be){var _0x201ff9=function(_0x164730){while(--_0x164730){_0x5653fd['push'](_0x5653fd['shift']());}};_0x201ff9(++_0x2109be);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x533d29,_0x126b92){_0x533d29=_0x533d29-0x0;var _0x522955=_0xe1e3[_0x533d29];return _0x522955;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3e1e('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3e1e('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x3e1e('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3e1e('0x2')],'defaultValue':_0x3e1e('0x4')},'connTimeout':{'type':Sequelize[_0x3e1e('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3e1e('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3e1e('0x2')]}};
\ No newline at end of file
index a173a75..dfece71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c60=['path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','util','../../config/logger','api','moment','request-promise'];(function(_0x3d85b2,_0x546af8){var _0x482cc8=function(_0x4f7ca3){while(--_0x4f7ca3){_0x3d85b2['push'](_0x3d85b2['shift']());}};_0x482cc8(++_0x546af8);}(_0x7c60,0xc1));var _0x07c6=function(_0x846df1,_0x555797){_0x846df1=_0x846df1-0x0;var _0x478c0f=_0x7c60[_0x846df1];return _0x478c0f;};'use strict';var _=require('lodash');var util=require(_0x07c6('0x0'));var logger=require(_0x07c6('0x1'))(_0x07c6('0x2'));var moment=require(_0x07c6('0x3'));var BPromise=require('bluebird');var rp=require(_0x07c6('0x4'));var fs=require('fs');var path=require(_0x07c6('0x5'));var rimraf=require(_0x07c6('0x6'));var config=require(_0x07c6('0x7'));var attributes=require(_0x07c6('0x8'));module[_0x07c6('0x9')]=function(_0x5136b0,_0x3f5087){return _0x5136b0[_0x07c6('0xa')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4025=['./mailServerIn.attributes','define','MailServerIn','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2dbebe,_0x1567db){var _0x5581d9=function(_0x47d2f1){while(--_0x47d2f1){_0x2dbebe['push'](_0x2dbebe['shift']());}};_0x5581d9(++_0x1567db);}(_0x4025,0x16e));var _0x5402=function(_0x277dde,_0x521180){_0x277dde=_0x277dde-0x0;var _0x3fc6d1=_0x4025[_0x277dde];return _0x3fc6d1;};'use strict';var _=require(_0x5402('0x0'));var util=require('util');var logger=require(_0x5402('0x1'))(_0x5402('0x2'));var moment=require(_0x5402('0x3'));var BPromise=require(_0x5402('0x4'));var rp=require(_0x5402('0x5'));var fs=require('fs');var path=require(_0x5402('0x6'));var rimraf=require(_0x5402('0x7'));var config=require('../../config/environment');var attributes=require(_0x5402('0x8'));module['exports']=function(_0x280dcb,_0x146a60){return _0x280dcb[_0x5402('0x9')](_0x5402('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 45ca6a6..39b4a22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebff=['../../mysqldb','../../config/utils','rpc','../../config/environment','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map','model','then','lodash','moment','randomstring','ioredis'];(function(_0xf22d65,_0x165ede){var _0x45a419=function(_0x17ef40){while(--_0x17ef40){_0xf22d65['push'](_0xf22d65['shift']());}};_0x45a419(++_0x165ede);}(_0xebff,0xf8));var _0xfebf=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xebff[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xfebf('0x0'));var util=require('util');var moment=require(_0xfebf('0x1'));var BPromise=require('bluebird');var rs=require(_0xfebf('0x2'));var fs=require('fs');var Redis=require(_0xfebf('0x3'));var db=require(_0xfebf('0x4'))['db'];var utils=require(_0xfebf('0x5'));var logger=require('../../config/logger')(_0xfebf('0x6'));var config=require(_0xfebf('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x256c16,_0x4b8456,_0xf4de6e){return new BPromise(function(_0x86e9c,_0x5da9e1){return client['request'](_0x256c16,_0xf4de6e)['then'](function(_0x2d9a6c){logger[_0xfebf('0x8')](_0xfebf('0x9'),_0x4b8456,_0xfebf('0xa'));logger[_0xfebf('0xb')](_0xfebf('0xc'),_0x4b8456,_0xfebf('0xa'),JSON['stringify'](_0x2d9a6c));if(_0x2d9a6c[_0xfebf('0xd')]){if(_0x2d9a6c[_0xfebf('0xd')][_0xfebf('0xe')]===0x1f4){logger[_0xfebf('0xd')](_0xfebf('0x9'),_0x4b8456,_0x2d9a6c['error'][_0xfebf('0xf')]);return _0x5da9e1(_0x2d9a6c['error']['message']);}logger[_0xfebf('0xd')](_0xfebf('0x9'),_0x4b8456,_0x2d9a6c[_0xfebf('0xd')]['message']);return _0x86e9c(_0x2d9a6c[_0xfebf('0xd')][_0xfebf('0xf')]);}else{logger[_0xfebf('0x8')]('MailServerIn,\x20%s,\x20%s',_0x4b8456,_0xfebf('0xa'));_0x86e9c(_0x2d9a6c[_0xfebf('0x10')][_0xfebf('0xf')]);}})['catch'](function(_0x3d47fc){logger[_0xfebf('0xd')]('MailServerIn,\x20%s,\x20%s',_0x4b8456,_0x3d47fc);_0x5da9e1(_0x3d47fc);});});}exports[_0xfebf('0x11')]=function(_0x117fec){var _0x500666=this;return new Promise(function(_0x36c333,_0x37d8fb){return db[_0xfebf('0x12')]['findAll']({'raw':_0x117fec[_0xfebf('0x13')]?_0x117fec[_0xfebf('0x13')][_0xfebf('0x14')]===undefined?!![]:![]:!![],'where':_0x117fec[_0xfebf('0x13')]?_0x117fec['options'][_0xfebf('0x15')]||null:null,'attributes':_0x117fec[_0xfebf('0x13')]?_0x117fec['options'][_0xfebf('0x16')]||null:null,'limit':_0x117fec['options']?_0x117fec[_0xfebf('0x13')][_0xfebf('0x17')]||null:null,'include':_0x117fec[_0xfebf('0x13')]?_0x117fec[_0xfebf('0x13')][_0xfebf('0x18')]?_['map'](_0x117fec[_0xfebf('0x13')][_0xfebf('0x18')],function(_0x44ce08){return{'model':db[_0x44ce08['model']],'as':_0x44ce08['as'],'attributes':_0x44ce08[_0xfebf('0x16')],'include':_0x44ce08[_0xfebf('0x18')]?_[_0xfebf('0x19')](_0x44ce08['include'],function(_0x3a2a29){return{'model':db[_0x3a2a29[_0xfebf('0x1a')]],'as':_0x3a2a29['as'],'attributes':_0x3a2a29[_0xfebf('0x16')],'include':_0x3a2a29[_0xfebf('0x18')]?_['map'](_0x3a2a29[_0xfebf('0x18')],function(_0x29ef2f){return{'model':db[_0x29ef2f[_0xfebf('0x1a')]],'as':_0x29ef2f['as'],'attributes':_0x29ef2f['attributes']};}):[]};}):[]};}):[]:[]})[_0xfebf('0x1b')](function(_0x3aaa68){logger[_0xfebf('0x8')]('GetMailServerIn',_0x117fec);logger[_0xfebf('0xb')]('GetMailServerIn',_0x117fec,JSON['stringify'](_0x3aaa68));_0x36c333(_0x3aaa68);})['catch'](function(_0x4089f9){logger['error']('GetMailServerIn',_0x4089f9['message'],_0x117fec);_0x37d8fb(_0x500666['error'](0x1f4,_0x4089f9[_0xfebf('0xf')]));});});};
\ No newline at end of file
+var _0xfa5d=['GetMailServerIn','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','result','catch','findAll','options','where','attributes','limit','include','map','model','then'];(function(_0x53f9cf,_0x4e5be8){var _0x437fb4=function(_0x5ae844){while(--_0x5ae844){_0x53f9cf['push'](_0x53f9cf['shift']());}};_0x437fb4(++_0x4e5be8);}(_0xfa5d,0x140));var _0xdfa5=function(_0xab29ee,_0x3e1716){_0xab29ee=_0xab29ee-0x0;var _0x1990cc=_0xfa5d[_0xab29ee];return _0x1990cc;};'use strict';var _=require(_0xdfa5('0x0'));var util=require('util');var moment=require(_0xdfa5('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfa5('0x2'));var fs=require('fs');var Redis=require(_0xdfa5('0x3'));var db=require(_0xdfa5('0x4'))['db'];var utils=require(_0xdfa5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdfa5('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13ece7,_0x633ccb,_0x329837){return new BPromise(function(_0x19310e,_0x5a3686){return client[_0xdfa5('0x7')](_0x13ece7,_0x329837)['then'](function(_0x2f1d32){logger[_0xdfa5('0x8')]('MailServerIn,\x20%s,\x20%s',_0x633ccb,_0xdfa5('0x9'));logger[_0xdfa5('0xa')](_0xdfa5('0xb'),_0x633ccb,'request\x20sent',JSON[_0xdfa5('0xc')](_0x2f1d32));if(_0x2f1d32[_0xdfa5('0xd')]){if(_0x2f1d32[_0xdfa5('0xd')][_0xdfa5('0xe')]===0x1f4){logger[_0xdfa5('0xd')]('MailServerIn,\x20%s,\x20%s',_0x633ccb,_0x2f1d32['error'][_0xdfa5('0xf')]);return _0x5a3686(_0x2f1d32[_0xdfa5('0xd')][_0xdfa5('0xf')]);}logger[_0xdfa5('0xd')](_0xdfa5('0x10'),_0x633ccb,_0x2f1d32[_0xdfa5('0xd')]['message']);return _0x19310e(_0x2f1d32[_0xdfa5('0xd')][_0xdfa5('0xf')]);}else{logger[_0xdfa5('0x8')](_0xdfa5('0x10'),_0x633ccb,'request\x20sent');_0x19310e(_0x2f1d32[_0xdfa5('0x11')][_0xdfa5('0xf')]);}})[_0xdfa5('0x12')](function(_0x19dd53){logger['error'](_0xdfa5('0x10'),_0x633ccb,_0x19dd53);_0x5a3686(_0x19dd53);});});}exports['GetMailServerIn']=function(_0x503334){var _0x5725f6=this;return new Promise(function(_0x430b02,_0x42b80d){return db['MailServerIn'][_0xdfa5('0x13')]({'raw':_0x503334[_0xdfa5('0x14')]?_0x503334[_0xdfa5('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x503334['options']?_0x503334[_0xdfa5('0x14')][_0xdfa5('0x15')]||null:null,'attributes':_0x503334[_0xdfa5('0x14')]?_0x503334[_0xdfa5('0x14')][_0xdfa5('0x16')]||null:null,'limit':_0x503334[_0xdfa5('0x14')]?_0x503334[_0xdfa5('0x14')][_0xdfa5('0x17')]||null:null,'include':_0x503334['options']?_0x503334[_0xdfa5('0x14')][_0xdfa5('0x18')]?_[_0xdfa5('0x19')](_0x503334['options'][_0xdfa5('0x18')],function(_0xc9b18d){return{'model':db[_0xc9b18d[_0xdfa5('0x1a')]],'as':_0xc9b18d['as'],'attributes':_0xc9b18d['attributes'],'include':_0xc9b18d[_0xdfa5('0x18')]?_[_0xdfa5('0x19')](_0xc9b18d[_0xdfa5('0x18')],function(_0x47cbe6){return{'model':db[_0x47cbe6[_0xdfa5('0x1a')]],'as':_0x47cbe6['as'],'attributes':_0x47cbe6[_0xdfa5('0x16')],'include':_0x47cbe6[_0xdfa5('0x18')]?_['map'](_0x47cbe6[_0xdfa5('0x18')],function(_0x527d23){return{'model':db[_0x527d23['model']],'as':_0x527d23['as'],'attributes':_0x527d23[_0xdfa5('0x16')]};}):[]};}):[]};}):[]:[]})[_0xdfa5('0x1b')](function(_0x2a6591){logger['info'](_0xdfa5('0x1c'),_0x503334);logger[_0xdfa5('0xa')](_0xdfa5('0x1c'),_0x503334,JSON['stringify'](_0x2a6591));_0x430b02(_0x2a6591);})['catch'](function(_0x30595f){logger[_0xdfa5('0xd')](_0xdfa5('0x1c'),_0x30595f['message'],_0x503334);_0x42b80d(_0x5725f6[_0xdfa5('0xd')](0x1f4,_0x30595f['message']));});});};
\ No newline at end of file
index f96da75..9e8baad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x7a54,0x106));var _0x47a5=function(_0x1c8b65,_0x2a4ac4){_0x1c8b65=_0x1c8b65-0x0;var _0x428f56=_0x7a54[_0x1c8b65];return _0x428f56;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xd7b049,_0x5d48d9){_0xd7b049=_0xd7b049-0x0;var _0x200caf=_0x7a54[_0xd7b049];return _0x200caf;};'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 cbc0ec0..94c1821 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17bb=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x17bb,0x80));var _0xb17b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x17bb[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xb17b('0x0'));module[_0xb17b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb17b('0x2')]},'user':{'type':Sequelize[_0xb17b('0x2')]},'pass':{'type':Sequelize[_0xb17b('0x2')]},'port':{'type':Sequelize[_0xb17b('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xb17b('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xadfa=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x14c360,_0xeea136){var _0x49e3d7=function(_0x3954fa){while(--_0x3954fa){_0x14c360['push'](_0x14c360['shift']());}};_0x49e3d7(++_0xeea136);}(_0xadfa,0x13a));var _0xaadf=function(_0x176b14,_0x2b8f5c){_0x176b14=_0x176b14-0x0;var _0x53eabb=_0xadfa[_0x176b14];return _0x53eabb;};'use strict';var Sequelize=require(_0xaadf('0x0'));module[_0xaadf('0x1')]={'description':{'type':Sequelize[_0xaadf('0x2')]},'host':{'type':Sequelize[_0xaadf('0x2')]},'user':{'type':Sequelize[_0xaadf('0x2')]},'pass':{'type':Sequelize[_0xaadf('0x2')]},'port':{'type':Sequelize[_0xaadf('0x3')]},'secure':{'type':Sequelize[_0xaadf('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xaadf('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index dcfacf3..01a7cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2965=['MailServerOut','rawAttributes','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','filter','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','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','update','then','destroy','error','stack','name','send','index','map'];(function(_0x451f88,_0x5c061a){var _0x2cc2b7=function(_0x5bb6ce){while(--_0x5bb6ce){_0x451f88['push'](_0x451f88['shift']());}};_0x2cc2b7(++_0x5c061a);}(_0x2965,0xbb));var _0x5296=function(_0x12f2ee,_0x7ebbf8){_0x12f2ee=_0x12f2ee-0x0;var _0x1bb207=_0x2965[_0x12f2ee];return _0x1bb207;};'use strict';var emlformat=require(_0x5296('0x0'));var rimraf=require(_0x5296('0x1'));var zipdir=require(_0x5296('0x2'));var jsonpatch=require(_0x5296('0x3'));var rp=require(_0x5296('0x4'));var moment=require(_0x5296('0x5'));var BPromise=require(_0x5296('0x6'));var Mustache=require(_0x5296('0x7'));var util=require(_0x5296('0x8'));var path=require(_0x5296('0x9'));var sox=require(_0x5296('0xa'));var csv=require(_0x5296('0xb'));var ejs=require(_0x5296('0xc'));var fs=require('fs');var fs_extra=require(_0x5296('0xd'));var _=require(_0x5296('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5296('0xf'));var toCsv=require(_0x5296('0xb'));var querystring=require('querystring');var Papa=require(_0x5296('0x10'));var Redis=require(_0x5296('0x11'));var authService=require(_0x5296('0x12'));var qs=require(_0x5296('0x13'));var as=require(_0x5296('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5296('0x15'))(_0x5296('0x16'));var utils=require(_0x5296('0x17'));var config=require(_0x5296('0x18'));var licenseUtil=require(_0x5296('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a3810,_0x4bd45c){_0x4bd45c=_0x4bd45c||0xcc;return function(_0x521490){if(_0x521490){return _0x3a3810[_0x5296('0x1a')](_0x4bd45c);}return _0x3a3810[_0x5296('0x1b')](_0x4bd45c)[_0x5296('0x1c')]();};}function respondWithResult(_0x5d9906,_0x48469b){_0x48469b=_0x48469b||0xc8;return function(_0x9ed520){if(_0x9ed520){return _0x5d9906[_0x5296('0x1b')](_0x48469b)[_0x5296('0x1d')](_0x9ed520);}};}function respondWithFilteredResult(_0x441261,_0x4bdaf4){return function(_0x2a9de0){if(_0x2a9de0){var _0x1a4cb6=typeof _0x4bdaf4[_0x5296('0x1e')]===_0x5296('0x1f')&&typeof _0x4bdaf4[_0x5296('0x20')]==='undefined';var _0x173afe=_0x2a9de0[_0x5296('0x21')];var _0x1f1cce=_0x1a4cb6?0x0:_0x4bdaf4[_0x5296('0x1e')];var _0x23a974=_0x1a4cb6?_0x2a9de0[_0x5296('0x21')]:_0x4bdaf4['offset']+_0x4bdaf4[_0x5296('0x20')];var _0x4a8f71;if(_0x23a974>=_0x173afe){_0x23a974=_0x173afe;_0x4a8f71=0xc8;}else{_0x4a8f71=0xce;}_0x441261[_0x5296('0x1b')](_0x4a8f71);return _0x441261[_0x5296('0x22')](_0x5296('0x23'),_0x1f1cce+'-'+_0x23a974+'/'+_0x173afe)[_0x5296('0x1d')](_0x2a9de0);}return null;};}function patchUpdates(_0x4370be){return function(_0xc24d0b){try{jsonpatch[_0x5296('0x24')](_0xc24d0b,_0x4370be,!![]);}catch(_0x1d2db0){return BPromise[_0x5296('0x25')](_0x1d2db0);}return _0xc24d0b['save']();};}function saveUpdates(_0x23a9a9,_0x49aa34){return function(_0x400fba){if(_0x400fba){return _0x400fba[_0x5296('0x26')](_0x23a9a9)[_0x5296('0x27')](function(_0x480c4a){return _0x480c4a;});}return null;};}function removeEntity(_0x42603e,_0x1df61c){return function(_0x5edb98){if(_0x5edb98){return _0x5edb98[_0x5296('0x28')]()['then'](function(){_0x42603e[_0x5296('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d2b50,_0x573fd7){return function(_0x2c8889){if(!_0x2c8889){_0x1d2b50[_0x5296('0x1a')](0x194);}return _0x2c8889;};}function handleError(_0x591bed,_0x59928b){_0x59928b=_0x59928b||0x1f4;return function(_0x2f034e){logger[_0x5296('0x29')](_0x2f034e[_0x5296('0x2a')]);if(_0x2f034e[_0x5296('0x2b')]){delete _0x2f034e[_0x5296('0x2b')];}_0x591bed['status'](_0x59928b)[_0x5296('0x2c')](_0x2f034e);};}exports[_0x5296('0x2d')]=function(_0x2e1037,_0x510161){var _0x3cbc79={},_0x564a9b={},_0x5ad107={'count':0x0,'rows':[]};var _0x165d7f=_[_0x5296('0x2e')](db[_0x5296('0x2f')][_0x5296('0x30')],function(_0x127f9d){return{'name':_0x127f9d[_0x5296('0x31')],'type':_0x127f9d[_0x5296('0x32')][_0x5296('0x33')]};});_0x564a9b[_0x5296('0x34')]=_[_0x5296('0x2e')](_0x165d7f,_0x5296('0x2b'));_0x564a9b['query']=_[_0x5296('0x35')](_0x2e1037['query']);_0x564a9b[_0x5296('0x36')]=_[_0x5296('0x37')](_0x564a9b[_0x5296('0x34')],_0x564a9b['query']);_0x3cbc79['attributes']=_['intersection'](_0x564a9b[_0x5296('0x34')],qs[_0x5296('0x38')](_0x2e1037[_0x5296('0x39')][_0x5296('0x38')]));_0x3cbc79[_0x5296('0x3a')]=_0x3cbc79[_0x5296('0x3a')][_0x5296('0x3b')]?_0x3cbc79['attributes']:_0x564a9b[_0x5296('0x34')];if(!_0x2e1037[_0x5296('0x39')]['hasOwnProperty'](_0x5296('0x3c'))){_0x3cbc79['limit']=qs[_0x5296('0x20')](_0x2e1037[_0x5296('0x39')][_0x5296('0x20')]);_0x3cbc79[_0x5296('0x1e')]=qs[_0x5296('0x1e')](_0x2e1037[_0x5296('0x39')][_0x5296('0x1e')]);}_0x3cbc79[_0x5296('0x3d')]=qs[_0x5296('0x3e')](_0x2e1037[_0x5296('0x39')][_0x5296('0x3e')]);_0x3cbc79[_0x5296('0x3f')]=qs['filters'](_[_0x5296('0x40')](_0x2e1037[_0x5296('0x39')],_0x564a9b['filters']),_0x165d7f);if(_0x2e1037[_0x5296('0x39')][_0x5296('0x41')]){_0x3cbc79['where']=_['merge'](_0x3cbc79[_0x5296('0x3f')],{'$or':_[_0x5296('0x2e')](_0x165d7f,function(_0xdf6fed){if(_0xdf6fed['type']!=='VIRTUAL'){var _0x2ae71e={};_0x2ae71e[_0xdf6fed['name']]={'$like':'%'+_0x2e1037[_0x5296('0x39')][_0x5296('0x41')]+'%'};return _0x2ae71e;}})});}_0x3cbc79=_['merge']({},_0x3cbc79,_0x2e1037[_0x5296('0x42')]);var _0xb4bd74={'where':_0x3cbc79['where']};return db[_0x5296('0x2f')][_0x5296('0x21')](_0xb4bd74)[_0x5296('0x27')](function(_0x3dd6f3){_0x5ad107[_0x5296('0x21')]=_0x3dd6f3;if(_0x2e1037[_0x5296('0x39')][_0x5296('0x43')]){_0x3cbc79[_0x5296('0x44')]=[{'all':!![]}];}return db[_0x5296('0x2f')][_0x5296('0x45')](_0x3cbc79);})[_0x5296('0x27')](function(_0x19bb0c){_0x5ad107[_0x5296('0x46')]=_0x19bb0c;return _0x5ad107;})[_0x5296('0x27')](respondWithFilteredResult(_0x510161,_0x3cbc79))['catch'](handleError(_0x510161,null));};exports[_0x5296('0x47')]=function(_0x2f0856,_0x1ff81b){var _0x345ed0={'raw':!![],'where':{'id':_0x2f0856[_0x5296('0x48')]['id']}},_0x363dbe={};_0x363dbe[_0x5296('0x34')]=_[_0x5296('0x35')](db['MailServerOut']['rawAttributes']);_0x363dbe[_0x5296('0x39')]=_[_0x5296('0x35')](_0x2f0856[_0x5296('0x39')]);_0x363dbe['filters']=_['intersection'](_0x363dbe[_0x5296('0x34')],_0x363dbe[_0x5296('0x39')]);_0x345ed0[_0x5296('0x3a')]=_[_0x5296('0x37')](_0x363dbe[_0x5296('0x34')],qs[_0x5296('0x38')](_0x2f0856['query'][_0x5296('0x38')]));_0x345ed0[_0x5296('0x3a')]=_0x345ed0[_0x5296('0x3a')][_0x5296('0x3b')]?_0x345ed0[_0x5296('0x3a')]:_0x363dbe[_0x5296('0x34')];if(_0x2f0856['query']['includeAll']){_0x345ed0[_0x5296('0x44')]=[{'all':!![]}];}_0x345ed0=_[_0x5296('0x49')]({},_0x345ed0,_0x2f0856[_0x5296('0x42')]);return db[_0x5296('0x2f')][_0x5296('0x4a')](_0x345ed0)[_0x5296('0x27')](handleEntityNotFound(_0x1ff81b,null))[_0x5296('0x27')](respondWithResult(_0x1ff81b,null))[_0x5296('0x4b')](handleError(_0x1ff81b,null));};exports[_0x5296('0x4c')]=function(_0x573e6e,_0x45e34e){return db[_0x5296('0x2f')][_0x5296('0x4c')](_0x573e6e[_0x5296('0x4d')],{})[_0x5296('0x27')](respondWithResult(_0x45e34e,0xc9))[_0x5296('0x4b')](handleError(_0x45e34e,null));};exports[_0x5296('0x26')]=function(_0x23edc5,_0x1fa024){if(_0x23edc5[_0x5296('0x4d')]['id']){delete _0x23edc5[_0x5296('0x4d')]['id'];}return db[_0x5296('0x2f')]['find']({'where':{'id':_0x23edc5['params']['id']}})[_0x5296('0x27')](handleEntityNotFound(_0x1fa024,null))[_0x5296('0x27')](saveUpdates(_0x23edc5['body'],null))['then'](respondWithResult(_0x1fa024,null))[_0x5296('0x4b')](handleError(_0x1fa024,null));};exports[_0x5296('0x28')]=function(_0x4dacb6,_0x54f2c3){return db[_0x5296('0x2f')][_0x5296('0x4a')]({'where':{'id':_0x4dacb6[_0x5296('0x48')]['id']}})['then'](handleEntityNotFound(_0x54f2c3,null))['then'](removeEntity(_0x54f2c3,null))['catch'](handleError(_0x54f2c3,null));};
\ No newline at end of file
+var _0x7598=['name','map','MailServerOut','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','status','error','stack'];(function(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0x7598,0xb6));var _0x8759=function(_0x4f1009,_0x19895b){_0x4f1009=_0x4f1009-0x0;var _0x2c9e6f=_0x7598[_0x4f1009];return _0x2c9e6f;};'use strict';var emlformat=require(_0x8759('0x0'));var rimraf=require(_0x8759('0x1'));var zipdir=require(_0x8759('0x2'));var jsonpatch=require(_0x8759('0x3'));var rp=require('request-promise');var moment=require(_0x8759('0x4'));var BPromise=require(_0x8759('0x5'));var Mustache=require(_0x8759('0x6'));var util=require(_0x8759('0x7'));var path=require(_0x8759('0x8'));var sox=require(_0x8759('0x9'));var csv=require(_0x8759('0xa'));var ejs=require(_0x8759('0xb'));var fs=require('fs');var fs_extra=require(_0x8759('0xc'));var _=require(_0x8759('0xd'));var squel=require(_0x8759('0xe'));var crypto=require(_0x8759('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8759('0x10'));var toCsv=require(_0x8759('0xa'));var querystring=require(_0x8759('0x11'));var Papa=require(_0x8759('0x12'));var Redis=require(_0x8759('0x13'));var authService=require(_0x8759('0x14'));var qs=require(_0x8759('0x15'));var as=require(_0x8759('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8759('0x17'))('api');var utils=require(_0x8759('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8759('0x19'));var db=require(_0x8759('0x1a'))['db'];function respondWithStatusCode(_0x5c4437,_0x3e7dcf){_0x3e7dcf=_0x3e7dcf||0xcc;return function(_0x4ad292){if(_0x4ad292){return _0x5c4437[_0x8759('0x1b')](_0x3e7dcf);}return _0x5c4437['status'](_0x3e7dcf)[_0x8759('0x1c')]();};}function respondWithResult(_0x396764,_0x3326d4){_0x3326d4=_0x3326d4||0xc8;return function(_0x4bbb90){if(_0x4bbb90){return _0x396764['status'](_0x3326d4)[_0x8759('0x1d')](_0x4bbb90);}};}function respondWithFilteredResult(_0x2c83b3,_0x3a172b){return function(_0x3db4ae){if(_0x3db4ae){var _0x186887=typeof _0x3a172b['offset']===_0x8759('0x1e')&&typeof _0x3a172b[_0x8759('0x1f')]===_0x8759('0x1e');var _0x2c534f=_0x3db4ae[_0x8759('0x20')];var _0xe5bce7=_0x186887?0x0:_0x3a172b['offset'];var _0x555495=_0x186887?_0x3db4ae['count']:_0x3a172b[_0x8759('0x21')]+_0x3a172b[_0x8759('0x1f')];var _0x5dc950;if(_0x555495>=_0x2c534f){_0x555495=_0x2c534f;_0x5dc950=0xc8;}else{_0x5dc950=0xce;}_0x2c83b3['status'](_0x5dc950);return _0x2c83b3['set'](_0x8759('0x22'),_0xe5bce7+'-'+_0x555495+'/'+_0x2c534f)[_0x8759('0x1d')](_0x3db4ae);}return null;};}function patchUpdates(_0x57e5dc){return function(_0x21c534){try{jsonpatch[_0x8759('0x23')](_0x21c534,_0x57e5dc,!![]);}catch(_0x340b0f){return BPromise[_0x8759('0x24')](_0x340b0f);}return _0x21c534['save']();};}function saveUpdates(_0x35466f,_0x30467a){return function(_0x303dab){if(_0x303dab){return _0x303dab[_0x8759('0x25')](_0x35466f)[_0x8759('0x26')](function(_0x5bdbec){return _0x5bdbec;});}return null;};}function removeEntity(_0x36905d,_0xddf6e8){return function(_0x2cabe0){if(_0x2cabe0){return _0x2cabe0[_0x8759('0x27')]()[_0x8759('0x26')](function(){_0x36905d[_0x8759('0x28')](0xcc)[_0x8759('0x1c')]();});}};}function handleEntityNotFound(_0x4bf503,_0x4eeeff){return function(_0x42981e){if(!_0x42981e){_0x4bf503['sendStatus'](0x194);}return _0x42981e;};}function handleError(_0x3a7a24,_0x2a2cae){_0x2a2cae=_0x2a2cae||0x1f4;return function(_0x29e556){logger[_0x8759('0x29')](_0x29e556[_0x8759('0x2a')]);if(_0x29e556[_0x8759('0x2b')]){delete _0x29e556[_0x8759('0x2b')];}_0x3a7a24[_0x8759('0x28')](_0x2a2cae)['send'](_0x29e556);};}exports['index']=function(_0x205cd4,_0x3d5dfa){var _0x54da64={},_0x3184c5={},_0x107474={'count':0x0,'rows':[]};var _0x2e9ce9=_[_0x8759('0x2c')](db[_0x8759('0x2d')]['rawAttributes'],function(_0x121a8e){return{'name':_0x121a8e[_0x8759('0x2e')],'type':_0x121a8e[_0x8759('0x2f')][_0x8759('0x30')]};});_0x3184c5['model']=_['map'](_0x2e9ce9,_0x8759('0x2b'));_0x3184c5[_0x8759('0x31')]=_[_0x8759('0x32')](_0x205cd4[_0x8759('0x31')]);_0x3184c5['filters']=_[_0x8759('0x33')](_0x3184c5['model'],_0x3184c5[_0x8759('0x31')]);_0x54da64[_0x8759('0x34')]=_[_0x8759('0x33')](_0x3184c5[_0x8759('0x35')],qs[_0x8759('0x36')](_0x205cd4[_0x8759('0x31')][_0x8759('0x36')]));_0x54da64['attributes']=_0x54da64[_0x8759('0x34')][_0x8759('0x37')]?_0x54da64[_0x8759('0x34')]:_0x3184c5['model'];if(!_0x205cd4[_0x8759('0x31')]['hasOwnProperty'](_0x8759('0x38'))){_0x54da64[_0x8759('0x1f')]=qs[_0x8759('0x1f')](_0x205cd4[_0x8759('0x31')]['limit']);_0x54da64[_0x8759('0x21')]=qs['offset'](_0x205cd4[_0x8759('0x31')]['offset']);}_0x54da64[_0x8759('0x39')]=qs[_0x8759('0x3a')](_0x205cd4[_0x8759('0x31')][_0x8759('0x3a')]);_0x54da64[_0x8759('0x3b')]=qs[_0x8759('0x3c')](_[_0x8759('0x3d')](_0x205cd4[_0x8759('0x31')],_0x3184c5[_0x8759('0x3c')]),_0x2e9ce9);if(_0x205cd4[_0x8759('0x31')]['filter']){_0x54da64[_0x8759('0x3b')]=_[_0x8759('0x3e')](_0x54da64[_0x8759('0x3b')],{'$or':_[_0x8759('0x2c')](_0x2e9ce9,function(_0x8e55ac){if(_0x8e55ac[_0x8759('0x2f')]!==_0x8759('0x3f')){var _0x386d42={};_0x386d42[_0x8e55ac[_0x8759('0x2b')]]={'$like':'%'+_0x205cd4['query'][_0x8759('0x40')]+'%'};return _0x386d42;}})});}_0x54da64=_[_0x8759('0x3e')]({},_0x54da64,_0x205cd4[_0x8759('0x41')]);var _0x975278={'where':_0x54da64['where']};return db['MailServerOut'][_0x8759('0x20')](_0x975278)['then'](function(_0x5cdf86){_0x107474[_0x8759('0x20')]=_0x5cdf86;if(_0x205cd4['query'][_0x8759('0x42')]){_0x54da64[_0x8759('0x43')]=[{'all':!![]}];}return db[_0x8759('0x2d')][_0x8759('0x44')](_0x54da64);})[_0x8759('0x26')](function(_0x5d84bc){_0x107474[_0x8759('0x45')]=_0x5d84bc;return _0x107474;})['then'](respondWithFilteredResult(_0x3d5dfa,_0x54da64))[_0x8759('0x46')](handleError(_0x3d5dfa,null));};exports['show']=function(_0x291cb1,_0x152592){var _0x2915f1={'raw':!![],'where':{'id':_0x291cb1[_0x8759('0x47')]['id']}},_0x266f2b={};_0x266f2b[_0x8759('0x35')]=_[_0x8759('0x32')](db[_0x8759('0x2d')]['rawAttributes']);_0x266f2b[_0x8759('0x31')]=_['keys'](_0x291cb1[_0x8759('0x31')]);_0x266f2b['filters']=_[_0x8759('0x33')](_0x266f2b['model'],_0x266f2b['query']);_0x2915f1['attributes']=_['intersection'](_0x266f2b[_0x8759('0x35')],qs[_0x8759('0x36')](_0x291cb1[_0x8759('0x31')][_0x8759('0x36')]));_0x2915f1[_0x8759('0x34')]=_0x2915f1[_0x8759('0x34')][_0x8759('0x37')]?_0x2915f1[_0x8759('0x34')]:_0x266f2b[_0x8759('0x35')];if(_0x291cb1[_0x8759('0x31')]['includeAll']){_0x2915f1[_0x8759('0x43')]=[{'all':!![]}];}_0x2915f1=_[_0x8759('0x3e')]({},_0x2915f1,_0x291cb1[_0x8759('0x41')]);return db[_0x8759('0x2d')][_0x8759('0x48')](_0x2915f1)['then'](handleEntityNotFound(_0x152592,null))[_0x8759('0x26')](respondWithResult(_0x152592,null))[_0x8759('0x46')](handleError(_0x152592,null));};exports[_0x8759('0x49')]=function(_0x1f419d,_0x3ee7c0){return db[_0x8759('0x2d')][_0x8759('0x49')](_0x1f419d['body'],{})[_0x8759('0x26')](respondWithResult(_0x3ee7c0,0xc9))['catch'](handleError(_0x3ee7c0,null));};exports['update']=function(_0x379ca8,_0x37d6c0){if(_0x379ca8[_0x8759('0x4a')]['id']){delete _0x379ca8['body']['id'];}return db[_0x8759('0x2d')][_0x8759('0x48')]({'where':{'id':_0x379ca8[_0x8759('0x47')]['id']}})[_0x8759('0x26')](handleEntityNotFound(_0x37d6c0,null))['then'](saveUpdates(_0x379ca8[_0x8759('0x4a')],null))['then'](respondWithResult(_0x37d6c0,null))[_0x8759('0x46')](handleError(_0x37d6c0,null));};exports[_0x8759('0x27')]=function(_0x39308e,_0x46e754){return db[_0x8759('0x2d')][_0x8759('0x48')]({'where':{'id':_0x39308e[_0x8759('0x47')]['id']}})[_0x8759('0x26')](handleEntityNotFound(_0x46e754,null))['then'](removeEntity(_0x46e754,null))[_0x8759('0x46')](handleError(_0x46e754,null));};
\ No newline at end of file
index 244137e..a9768db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7290=['./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x384a15,_0x1f06c7){var _0x2d4f1d=function(_0x5a5316){while(--_0x5a5316){_0x384a15['push'](_0x384a15['shift']());}};_0x2d4f1d(++_0x1f06c7);}(_0x7290,0x12b));var _0x0729=function(_0x2c73fa,_0x41b660){_0x2c73fa=_0x2c73fa-0x0;var _0x201374=_0x7290[_0x2c73fa];return _0x201374;};'use strict';var _=require(_0x0729('0x0'));var util=require(_0x0729('0x1'));var logger=require(_0x0729('0x2'))(_0x0729('0x3'));var moment=require('moment');var BPromise=require(_0x0729('0x4'));var rp=require(_0x0729('0x5'));var fs=require('fs');var path=require(_0x0729('0x6'));var rimraf=require(_0x0729('0x7'));var config=require(_0x0729('0x8'));var attributes=require(_0x0729('0x9'));module[_0x0729('0xa')]=function(_0x51bf5c,_0x1df58e){return _0x51bf5c[_0x0729('0xb')](_0x0729('0xc'),attributes,{'tableName':_0x0729('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3484=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','util'];(function(_0x345568,_0x1d1413){var _0xd5022c=function(_0x254669){while(--_0x254669){_0x345568['push'](_0x345568['shift']());}};_0xd5022c(++_0x1d1413);}(_0x3484,0x1de));var _0x4348=function(_0x32ffef,_0xb2141a){_0x32ffef=_0x32ffef-0x0;var _0x3b1659=_0x3484[_0x32ffef];return _0x3b1659;};'use strict';var _=require(_0x4348('0x0'));var util=require(_0x4348('0x1'));var logger=require(_0x4348('0x2'))('api');var moment=require(_0x4348('0x3'));var BPromise=require('bluebird');var rp=require(_0x4348('0x4'));var fs=require('fs');var path=require(_0x4348('0x5'));var rimraf=require(_0x4348('0x6'));var config=require(_0x4348('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x4348('0x8')]=function(_0x2fd5f5,_0x5b3a24){return _0x2fd5f5[_0x4348('0x9')](_0x4348('0xa'),attributes,{'tableName':_0x4348('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9739d6c..75b3f6f 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','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4da544,_0x3f2277){var _0x4b6f99=function(_0x58b80c){while(--_0x58b80c){_0x4da544['push'](_0x4da544['shift']());}};_0x4b6f99(++_0x3f2277);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5295d3,_0x2a71bc){_0x5295d3=_0x5295d3-0x0;var _0x52fe19=_0x5f2f[_0x5295d3];return _0x52fe19;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4c1b30,_0x3298cd){var _0x1b2a90=function(_0x5020a1){while(--_0x5020a1){_0x4c1b30['push'](_0x4c1b30['shift']());}};_0x1b2a90(++_0x3298cd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x118b90,_0x5bcd37){_0x118b90=_0x118b90-0x0;var _0x408e38=_0x5f2f[_0x118b90];return _0x408e38;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
index 72862e6..0d0be61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf460=['show','post','put','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf460,0x1e1));var _0x0f46=function(_0x1fc09c,_0x3a4d56){_0x1fc09c=_0x1fc09c-0x0;var _0x390272=_0xf460[_0x1fc09c];return _0x390272;};'use strict';var multer=require(_0x0f46('0x0'));var util=require(_0x0f46('0x1'));var path=require(_0x0f46('0x2'));var timeout=require(_0x0f46('0x3'));var express=require('express');var router=express[_0x0f46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0f46('0x5'));var interaction=require(_0x0f46('0x6'));var config=require('../../config/environment');var controller=require(_0x0f46('0x7'));router[_0x0f46('0x8')]('/',auth[_0x0f46('0x9')](),controller[_0x0f46('0xa')]);router['get'](_0x0f46('0xb'),auth['isAuthenticated'](),controller[_0x0f46('0xc')]);router[_0x0f46('0x8')]('/:id',auth[_0x0f46('0x9')](),controller[_0x0f46('0xd')]);router[_0x0f46('0xe')]('/',auth[_0x0f46('0x9')](),controller['create']);router[_0x0f46('0xf')](_0x0f46('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0f46('0x10'),auth[_0x0f46('0x9')](),controller[_0x0f46('0x11')]);module[_0x0f46('0x12')]=router;
\ No newline at end of file
+var _0x835f=['./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x15cc43,_0x3b5790){var _0x31eff8=function(_0x40410b){while(--_0x40410b){_0x15cc43['push'](_0x15cc43['shift']());}};_0x31eff8(++_0x3b5790);}(_0x835f,0x1c5));var _0xf835=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x835f[_0x5774be];return _0x4914b4;};'use strict';var multer=require(_0xf835('0x0'));var util=require('util');var path=require(_0xf835('0x1'));var timeout=require(_0xf835('0x2'));var express=require(_0xf835('0x3'));var router=express[_0xf835('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf835('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf835('0x6'));var controller=require(_0xf835('0x7'));router[_0xf835('0x8')]('/',auth[_0xf835('0x9')](),controller[_0xf835('0xa')]);router[_0xf835('0x8')](_0xf835('0xb'),auth[_0xf835('0x9')](),controller[_0xf835('0xc')]);router[_0xf835('0x8')](_0xf835('0xd'),auth[_0xf835('0x9')](),controller[_0xf835('0xe')]);router[_0xf835('0xf')]('/',auth[_0xf835('0x9')](),controller['create']);router[_0xf835('0x10')](_0xf835('0xd'),auth[_0xf835('0x9')](),controller['update']);router[_0xf835('0x11')](_0xf835('0xd'),auth[_0xf835('0x9')](),controller[_0xf835('0x12')]);module[_0xf835('0x13')]=router;
\ No newline at end of file
index 9a73321..06976ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['exports','STRING','name','sequelize'];(function(_0x3f52ba,_0x47b62c){var _0x22c92f=function(_0x54b42a){while(--_0x54b42a){_0x3f52ba['push'](_0x3f52ba['shift']());}};_0x22c92f(++_0x47b62c);}(_0x13f5,0xc3));var _0x513f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x13f5[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'name':{'type':Sequelize[_0x513f('0x2')],'unique':_0x513f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0689=['name','STRING','exports'];(function(_0x11b180,_0x503a9c){var _0x40c6a2=function(_0x347c21){while(--_0x347c21){_0x11b180['push'](_0x11b180['shift']());}};_0x40c6a2(++_0x503a9c);}(_0x0689,0x161));var _0x9068=function(_0x4b5ef8,_0x463086){_0x4b5ef8=_0x4b5ef8-0x0;var _0x20b85c=_0x0689[_0x4b5ef8];return _0x20b85c;};'use strict';var Sequelize=require('sequelize');module[_0x9068('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9068('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9068('0x2')]}};
\ No newline at end of file
index 1e9216d..8663760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e3=['squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','then','sendStatus','error','stack','name','send','index','map','MailSubstatus','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','keys','length','includeAll','catch','create','body','destroy','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x55e3,0xd4));var _0x355e=function(_0x4ca9d9,_0x3a7325){_0x4ca9d9=_0x4ca9d9-0x0;var _0x4b628d=_0x55e3[_0x4ca9d9];return _0x4b628d;};'use strict';var emlformat=require(_0x355e('0x0'));var rimraf=require(_0x355e('0x1'));var zipdir=require(_0x355e('0x2'));var jsonpatch=require(_0x355e('0x3'));var rp=require(_0x355e('0x4'));var moment=require(_0x355e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x355e('0x6'));var util=require(_0x355e('0x7'));var path=require(_0x355e('0x8'));var sox=require(_0x355e('0x9'));var csv=require(_0x355e('0xa'));var ejs=require(_0x355e('0xb'));var fs=require('fs');var fs_extra=require(_0x355e('0xc'));var _=require('lodash');var squel=require(_0x355e('0xd'));var crypto=require(_0x355e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x355e('0xa'));var querystring=require(_0x355e('0xf'));var Papa=require(_0x355e('0x10'));var Redis=require(_0x355e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x355e('0x12'));var hardwareService=require(_0x355e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x355e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x355e('0x15'));var db=require(_0x355e('0x16'))['db'];function respondWithStatusCode(_0x2ee4cc,_0x5d2ec6){_0x5d2ec6=_0x5d2ec6||0xcc;return function(_0x1d5022){if(_0x1d5022){return _0x2ee4cc['sendStatus'](_0x5d2ec6);}return _0x2ee4cc[_0x355e('0x17')](_0x5d2ec6)[_0x355e('0x18')]();};}function respondWithResult(_0x1ed400,_0x2faa8e){_0x2faa8e=_0x2faa8e||0xc8;return function(_0xdf1180){if(_0xdf1180){return _0x1ed400['status'](_0x2faa8e)[_0x355e('0x19')](_0xdf1180);}};}function respondWithFilteredResult(_0x1cc719,_0x4bfbf2){return function(_0x5d52c2){if(_0x5d52c2){var _0xc5783=typeof _0x4bfbf2['offset']===_0x355e('0x1a')&&typeof _0x4bfbf2[_0x355e('0x1b')]===_0x355e('0x1a');var _0x1f9b6b=_0x5d52c2['count'];var _0x1b3cac=_0xc5783?0x0:_0x4bfbf2[_0x355e('0x1c')];var _0x2713fa=_0xc5783?_0x5d52c2[_0x355e('0x1d')]:_0x4bfbf2[_0x355e('0x1c')]+_0x4bfbf2[_0x355e('0x1b')];var _0x5465fe;if(_0x2713fa>=_0x1f9b6b){_0x2713fa=_0x1f9b6b;_0x5465fe=0xc8;}else{_0x5465fe=0xce;}_0x1cc719[_0x355e('0x17')](_0x5465fe);return _0x1cc719[_0x355e('0x1e')](_0x355e('0x1f'),_0x1b3cac+'-'+_0x2713fa+'/'+_0x1f9b6b)[_0x355e('0x19')](_0x5d52c2);}return null;};}function patchUpdates(_0x54b6b6){return function(_0x170972){try{jsonpatch[_0x355e('0x20')](_0x170972,_0x54b6b6,!![]);}catch(_0x4f5f17){return BPromise['reject'](_0x4f5f17);}return _0x170972['save']();};}function saveUpdates(_0x51b687,_0x56582b){return function(_0x3b1959){if(_0x3b1959){return _0x3b1959['update'](_0x51b687)[_0x355e('0x21')](function(_0x3f7c16){return _0x3f7c16;});}return null;};}function removeEntity(_0x1341be,_0xc58e4e){return function(_0x43c165){if(_0x43c165){return _0x43c165['destroy']()['then'](function(){_0x1341be[_0x355e('0x17')](0xcc)[_0x355e('0x18')]();});}};}function handleEntityNotFound(_0x50a39b,_0x32133e){return function(_0x558385){if(!_0x558385){_0x50a39b[_0x355e('0x22')](0x194);}return _0x558385;};}function handleError(_0x236ca7,_0xed4dfd){_0xed4dfd=_0xed4dfd||0x1f4;return function(_0x468aa4){logger[_0x355e('0x23')](_0x468aa4[_0x355e('0x24')]);if(_0x468aa4[_0x355e('0x25')]){delete _0x468aa4[_0x355e('0x25')];}_0x236ca7[_0x355e('0x17')](_0xed4dfd)[_0x355e('0x26')](_0x468aa4);};}exports[_0x355e('0x27')]=function(_0x168706,_0x5f3977){var _0x26ddaf={},_0x13c228={},_0x5a8ff8={'count':0x0,'rows':[]};var _0x24e6b2=_[_0x355e('0x28')](db[_0x355e('0x29')]['rawAttributes'],function(_0x3501cb){return{'name':_0x3501cb[_0x355e('0x2a')],'type':_0x3501cb['type'][_0x355e('0x2b')]};});_0x13c228[_0x355e('0x2c')]=_[_0x355e('0x28')](_0x24e6b2,'name');_0x13c228[_0x355e('0x2d')]=_['keys'](_0x168706['query']);_0x13c228[_0x355e('0x2e')]=_[_0x355e('0x2f')](_0x13c228[_0x355e('0x2c')],_0x13c228[_0x355e('0x2d')]);_0x26ddaf['attributes']=_['intersection'](_0x13c228[_0x355e('0x2c')],qs['fields'](_0x168706[_0x355e('0x2d')][_0x355e('0x30')]));_0x26ddaf[_0x355e('0x31')]=_0x26ddaf[_0x355e('0x31')]['length']?_0x26ddaf['attributes']:_0x13c228[_0x355e('0x2c')];if(!_0x168706['query'][_0x355e('0x32')](_0x355e('0x33'))){_0x26ddaf['limit']=qs['limit'](_0x168706[_0x355e('0x2d')][_0x355e('0x1b')]);_0x26ddaf['offset']=qs[_0x355e('0x1c')](_0x168706[_0x355e('0x2d')]['offset']);}_0x26ddaf[_0x355e('0x34')]=qs['sort'](_0x168706[_0x355e('0x2d')][_0x355e('0x35')]);_0x26ddaf['where']=qs[_0x355e('0x2e')](_[_0x355e('0x36')](_0x168706['query'],_0x13c228[_0x355e('0x2e')]),_0x24e6b2);if(_0x168706[_0x355e('0x2d')][_0x355e('0x37')]){_0x26ddaf[_0x355e('0x38')]=_['merge'](_0x26ddaf[_0x355e('0x38')],{'$or':_[_0x355e('0x28')](_0x24e6b2,function(_0x2f83e5){if(_0x2f83e5[_0x355e('0x39')]!==_0x355e('0x3a')){var _0x2272d8={};_0x2272d8[_0x2f83e5['name']]={'$like':'%'+_0x168706['query'][_0x355e('0x37')]+'%'};return _0x2272d8;}})});}_0x26ddaf=_[_0x355e('0x3b')]({},_0x26ddaf,_0x168706[_0x355e('0x3c')]);var _0x1d46ac={'where':_0x26ddaf[_0x355e('0x38')]};return db[_0x355e('0x29')][_0x355e('0x1d')](_0x1d46ac)['then'](function(_0x25690b){_0x5a8ff8[_0x355e('0x1d')]=_0x25690b;if(_0x168706[_0x355e('0x2d')]['includeAll']){_0x26ddaf['include']=[{'all':!![]}];}return db[_0x355e('0x29')][_0x355e('0x3d')](_0x26ddaf);})[_0x355e('0x21')](function(_0x3c5e9a){_0x5a8ff8[_0x355e('0x3e')]=_0x3c5e9a;return _0x5a8ff8;})[_0x355e('0x21')](respondWithFilteredResult(_0x5f3977,_0x26ddaf))['catch'](handleError(_0x5f3977,null));};exports[_0x355e('0x3f')]=function(_0x2e9c70,_0x56b4b7){var _0xa1ff80={'raw':!![],'where':{'id':_0x2e9c70['params']['id']}},_0x52c3ba={};_0x52c3ba['model']=_['keys'](db[_0x355e('0x29')][_0x355e('0x40')]);_0x52c3ba['query']=_[_0x355e('0x41')](_0x2e9c70[_0x355e('0x2d')]);_0x52c3ba['filters']=_[_0x355e('0x2f')](_0x52c3ba[_0x355e('0x2c')],_0x52c3ba[_0x355e('0x2d')]);_0xa1ff80['attributes']=_[_0x355e('0x2f')](_0x52c3ba['model'],qs[_0x355e('0x30')](_0x2e9c70[_0x355e('0x2d')][_0x355e('0x30')]));_0xa1ff80[_0x355e('0x31')]=_0xa1ff80['attributes'][_0x355e('0x42')]?_0xa1ff80['attributes']:_0x52c3ba[_0x355e('0x2c')];if(_0x2e9c70[_0x355e('0x2d')][_0x355e('0x43')]){_0xa1ff80['include']=[{'all':!![]}];}_0xa1ff80=_[_0x355e('0x3b')]({},_0xa1ff80,_0x2e9c70[_0x355e('0x3c')]);return db[_0x355e('0x29')]['find'](_0xa1ff80)[_0x355e('0x21')](handleEntityNotFound(_0x56b4b7,null))[_0x355e('0x21')](respondWithResult(_0x56b4b7,null))[_0x355e('0x44')](handleError(_0x56b4b7,null));};exports[_0x355e('0x45')]=function(_0x38eae0,_0x344ee7){return db[_0x355e('0x29')][_0x355e('0x45')](_0x38eae0[_0x355e('0x46')],{})[_0x355e('0x21')](respondWithResult(_0x344ee7,0xc9))[_0x355e('0x44')](handleError(_0x344ee7,null));};exports['update']=function(_0x40e0d6,_0x3f1090){if(_0x40e0d6[_0x355e('0x46')]['id']){delete _0x40e0d6[_0x355e('0x46')]['id'];}return db[_0x355e('0x29')]['find']({'where':{'id':_0x40e0d6['params']['id']}})[_0x355e('0x21')](handleEntityNotFound(_0x3f1090,null))['then'](saveUpdates(_0x40e0d6['body'],null))[_0x355e('0x21')](respondWithResult(_0x3f1090,null))[_0x355e('0x44')](handleError(_0x3f1090,null));};exports[_0x355e('0x47')]=function(_0x607a34,_0x8a4175){return db[_0x355e('0x29')][_0x355e('0x48')]({'where':{'id':_0x607a34[_0x355e('0x49')]['id']}})[_0x355e('0x21')](handleEntityNotFound(_0x8a4175,null))['then'](removeEntity(_0x8a4175,null))['catch'](handleError(_0x8a4175,null));};exports[_0x355e('0x4a')]=function(_0x4ca499,_0xd5f9b1){return db[_0x355e('0x29')][_0x355e('0x4a')]()['then'](respondWithResult(_0xd5f9b1,null))[_0x355e('0x44')](handleError(_0xd5f9b1,null));};
\ No newline at end of file
+var _0x96de=['describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','error','map','MailSubstatus','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','name','options','then','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body'];(function(_0xf0c734,_0xd684d6){var _0x46be6c=function(_0x30e46f){while(--_0x30e46f){_0xf0c734['push'](_0xf0c734['shift']());}};_0x46be6c(++_0xd684d6);}(_0x96de,0x121));var _0xe96d=function(_0x12f1a0,_0x3f9463){_0x12f1a0=_0x12f1a0-0x0;var _0x1a3b8c=_0x96de[_0x12f1a0];return _0x1a3b8c;};'use strict';var emlformat=require(_0xe96d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe96d('0x1'));var rp=require('request-promise');var moment=require(_0xe96d('0x2'));var BPromise=require(_0xe96d('0x3'));var Mustache=require(_0xe96d('0x4'));var util=require('util');var path=require(_0xe96d('0x5'));var sox=require(_0xe96d('0x6'));var csv=require(_0xe96d('0x7'));var ejs=require(_0xe96d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe96d('0x9'));var squel=require(_0xe96d('0xa'));var crypto=require(_0xe96d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe96d('0x7'));var querystring=require(_0xe96d('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe96d('0xd'));var qs=require(_0xe96d('0xe'));var as=require(_0xe96d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe96d('0x10'));var utils=require(_0xe96d('0x11'));var config=require(_0xe96d('0x12'));var licenseUtil=require(_0xe96d('0x13'));var db=require(_0xe96d('0x14'))['db'];function respondWithStatusCode(_0x32ae5f,_0x2e501e){_0x2e501e=_0x2e501e||0xcc;return function(_0x4fe280){if(_0x4fe280){return _0x32ae5f[_0xe96d('0x15')](_0x2e501e);}return _0x32ae5f['status'](_0x2e501e)[_0xe96d('0x16')]();};}function respondWithResult(_0x568886,_0x424ae7){_0x424ae7=_0x424ae7||0xc8;return function(_0x42b3ac){if(_0x42b3ac){return _0x568886['status'](_0x424ae7)[_0xe96d('0x17')](_0x42b3ac);}};}function respondWithFilteredResult(_0x5f2824,_0x1e05c4){return function(_0x5876ef){if(_0x5876ef){var _0x2f0a50=typeof _0x1e05c4[_0xe96d('0x18')]===_0xe96d('0x19')&&typeof _0x1e05c4['limit']===_0xe96d('0x19');var _0x455759=_0x5876ef[_0xe96d('0x1a')];var _0x1e1259=_0x2f0a50?0x0:_0x1e05c4[_0xe96d('0x18')];var _0x2171fa=_0x2f0a50?_0x5876ef[_0xe96d('0x1a')]:_0x1e05c4[_0xe96d('0x18')]+_0x1e05c4[_0xe96d('0x1b')];var _0x207200;if(_0x2171fa>=_0x455759){_0x2171fa=_0x455759;_0x207200=0xc8;}else{_0x207200=0xce;}_0x5f2824[_0xe96d('0x1c')](_0x207200);return _0x5f2824[_0xe96d('0x1d')](_0xe96d('0x1e'),_0x1e1259+'-'+_0x2171fa+'/'+_0x455759)[_0xe96d('0x17')](_0x5876ef);}return null;};}function patchUpdates(_0x44445c){return function(_0x573266){try{jsonpatch[_0xe96d('0x1f')](_0x573266,_0x44445c,!![]);}catch(_0xeaef3a){return BPromise[_0xe96d('0x20')](_0xeaef3a);}return _0x573266[_0xe96d('0x21')]();};}function saveUpdates(_0x118695,_0x5f03be){return function(_0x110055){if(_0x110055){return _0x110055[_0xe96d('0x22')](_0x118695)['then'](function(_0xb54f21){return _0xb54f21;});}return null;};}function removeEntity(_0x5f2e01,_0x1b0fd5){return function(_0x4e20dd){if(_0x4e20dd){return _0x4e20dd['destroy']()['then'](function(){_0x5f2e01[_0xe96d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x217bbe,_0x197061){return function(_0x1c758d){if(!_0x1c758d){_0x217bbe['sendStatus'](0x194);}return _0x1c758d;};}function handleError(_0x4a2c72,_0xce357c){_0xce357c=_0xce357c||0x1f4;return function(_0x9f6635){logger[_0xe96d('0x23')](_0x9f6635['stack']);if(_0x9f6635['name']){delete _0x9f6635['name'];}_0x4a2c72[_0xe96d('0x1c')](_0xce357c)['send'](_0x9f6635);};}exports['index']=function(_0xb87fff,_0x598fd4){var _0x57791f={},_0x3b40ce={},_0x378747={'count':0x0,'rows':[]};var _0x3fcdd8=_[_0xe96d('0x24')](db[_0xe96d('0x25')]['rawAttributes'],function(_0x30a2a1){return{'name':_0x30a2a1[_0xe96d('0x26')],'type':_0x30a2a1['type'][_0xe96d('0x27')]};});_0x3b40ce[_0xe96d('0x28')]=_['map'](_0x3fcdd8,'name');_0x3b40ce['query']=_[_0xe96d('0x29')](_0xb87fff[_0xe96d('0x2a')]);_0x3b40ce[_0xe96d('0x2b')]=_[_0xe96d('0x2c')](_0x3b40ce[_0xe96d('0x28')],_0x3b40ce['query']);_0x57791f[_0xe96d('0x2d')]=_['intersection'](_0x3b40ce[_0xe96d('0x28')],qs[_0xe96d('0x2e')](_0xb87fff[_0xe96d('0x2a')][_0xe96d('0x2e')]));_0x57791f['attributes']=_0x57791f[_0xe96d('0x2d')][_0xe96d('0x2f')]?_0x57791f['attributes']:_0x3b40ce[_0xe96d('0x28')];if(!_0xb87fff[_0xe96d('0x2a')]['hasOwnProperty'](_0xe96d('0x30'))){_0x57791f['limit']=qs['limit'](_0xb87fff[_0xe96d('0x2a')]['limit']);_0x57791f['offset']=qs[_0xe96d('0x18')](_0xb87fff[_0xe96d('0x2a')][_0xe96d('0x18')]);}_0x57791f[_0xe96d('0x31')]=qs['sort'](_0xb87fff['query'][_0xe96d('0x32')]);_0x57791f['where']=qs['filters'](_[_0xe96d('0x33')](_0xb87fff[_0xe96d('0x2a')],_0x3b40ce['filters']),_0x3fcdd8);if(_0xb87fff[_0xe96d('0x2a')][_0xe96d('0x34')]){_0x57791f[_0xe96d('0x35')]=_[_0xe96d('0x36')](_0x57791f[_0xe96d('0x35')],{'$or':_[_0xe96d('0x24')](_0x3fcdd8,function(_0xe92e35){if(_0xe92e35[_0xe96d('0x37')]!==_0xe96d('0x38')){var _0x1ac17e={};_0x1ac17e[_0xe92e35[_0xe96d('0x39')]]={'$like':'%'+_0xb87fff[_0xe96d('0x2a')][_0xe96d('0x34')]+'%'};return _0x1ac17e;}})});}_0x57791f=_['merge']({},_0x57791f,_0xb87fff[_0xe96d('0x3a')]);var _0x5a71e2={'where':_0x57791f[_0xe96d('0x35')]};return db[_0xe96d('0x25')][_0xe96d('0x1a')](_0x5a71e2)[_0xe96d('0x3b')](function(_0x485eeb){_0x378747[_0xe96d('0x1a')]=_0x485eeb;if(_0xb87fff[_0xe96d('0x2a')]['includeAll']){_0x57791f[_0xe96d('0x3c')]=[{'all':!![]}];}return db[_0xe96d('0x25')][_0xe96d('0x3d')](_0x57791f);})[_0xe96d('0x3b')](function(_0xa1d9f6){_0x378747[_0xe96d('0x3e')]=_0xa1d9f6;return _0x378747;})[_0xe96d('0x3b')](respondWithFilteredResult(_0x598fd4,_0x57791f))['catch'](handleError(_0x598fd4,null));};exports[_0xe96d('0x3f')]=function(_0x289251,_0x3142e7){var _0x317242={'raw':!![],'where':{'id':_0x289251[_0xe96d('0x40')]['id']}},_0x33435f={};_0x33435f['model']=_[_0xe96d('0x29')](db[_0xe96d('0x25')][_0xe96d('0x41')]);_0x33435f[_0xe96d('0x2a')]=_[_0xe96d('0x29')](_0x289251[_0xe96d('0x2a')]);_0x33435f['filters']=_[_0xe96d('0x2c')](_0x33435f['model'],_0x33435f[_0xe96d('0x2a')]);_0x317242[_0xe96d('0x2d')]=_[_0xe96d('0x2c')](_0x33435f[_0xe96d('0x28')],qs['fields'](_0x289251[_0xe96d('0x2a')][_0xe96d('0x2e')]));_0x317242[_0xe96d('0x2d')]=_0x317242[_0xe96d('0x2d')][_0xe96d('0x2f')]?_0x317242['attributes']:_0x33435f[_0xe96d('0x28')];if(_0x289251['query'][_0xe96d('0x42')]){_0x317242[_0xe96d('0x3c')]=[{'all':!![]}];}_0x317242=_[_0xe96d('0x36')]({},_0x317242,_0x289251[_0xe96d('0x3a')]);return db[_0xe96d('0x25')][_0xe96d('0x43')](_0x317242)[_0xe96d('0x3b')](handleEntityNotFound(_0x3142e7,null))[_0xe96d('0x3b')](respondWithResult(_0x3142e7,null))[_0xe96d('0x44')](handleError(_0x3142e7,null));};exports[_0xe96d('0x45')]=function(_0x31fba5,_0xd7129a){return db[_0xe96d('0x25')]['create'](_0x31fba5[_0xe96d('0x46')],{})[_0xe96d('0x3b')](respondWithResult(_0xd7129a,0xc9))['catch'](handleError(_0xd7129a,null));};exports[_0xe96d('0x22')]=function(_0x2f159f,_0x567b2e){if(_0x2f159f['body']['id']){delete _0x2f159f['body']['id'];}return db['MailSubstatus'][_0xe96d('0x43')]({'where':{'id':_0x2f159f[_0xe96d('0x40')]['id']}})[_0xe96d('0x3b')](handleEntityNotFound(_0x567b2e,null))[_0xe96d('0x3b')](saveUpdates(_0x2f159f['body'],null))[_0xe96d('0x3b')](respondWithResult(_0x567b2e,null))[_0xe96d('0x44')](handleError(_0x567b2e,null));};exports['destroy']=function(_0x25a32d,_0x348487){return db[_0xe96d('0x25')][_0xe96d('0x43')]({'where':{'id':_0x25a32d[_0xe96d('0x40')]['id']}})[_0xe96d('0x3b')](handleEntityNotFound(_0x348487,null))[_0xe96d('0x3b')](removeEntity(_0x348487,null))[_0xe96d('0x44')](handleError(_0x348487,null));};exports['describe']=function(_0x4d2d5b,_0x44b5d0){return db[_0xe96d('0x25')][_0xe96d('0x47')]()['then'](respondWithResult(_0x44b5d0,null))['catch'](handleError(_0x44b5d0,null));};
\ No newline at end of file
index a5dfd98..925dbd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa93d=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xa93d,0xf5));var _0xda93=function(_0x221abd,_0x621d76){_0x221abd=_0x221abd-0x0;var _0x47e399=_0xa93d[_0x221abd];return _0x47e399;};'use strict';var _=require(_0xda93('0x0'));var util=require(_0xda93('0x1'));var logger=require(_0xda93('0x2'))('api');var moment=require(_0xda93('0x3'));var BPromise=require('bluebird');var rp=require(_0xda93('0x4'));var fs=require('fs');var path=require(_0xda93('0x5'));var rimraf=require(_0xda93('0x6'));var config=require(_0xda93('0x7'));var attributes=require(_0xda93('0x8'));module[_0xda93('0x9')]=function(_0x34ee8e,_0x434851){return _0x34ee8e[_0xda93('0xa')](_0xda93('0xb'),attributes,{'tableName':_0xda93('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64b6=['util','../../config/logger','api','moment','bluebird','path','rimraf','define','MailSubstatus','mail_substatuses'];(function(_0x3e881d,_0x5a8677){var _0x2b2610=function(_0xfae8f7){while(--_0xfae8f7){_0x3e881d['push'](_0x3e881d['shift']());}};_0x2b2610(++_0x5a8677);}(_0x64b6,0x96));var _0x664b=function(_0x5b1b21,_0x26c3e8){_0x5b1b21=_0x5b1b21-0x0;var _0x4e0d1a=_0x64b6[_0x5b1b21];return _0x4e0d1a;};'use strict';var _=require('lodash');var util=require(_0x664b('0x0'));var logger=require(_0x664b('0x1'))(_0x664b('0x2'));var moment=require(_0x664b('0x3'));var BPromise=require(_0x664b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x664b('0x5'));var rimraf=require(_0x664b('0x6'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x53de76,_0x27cb79){return _0x53de76[_0x664b('0x7')](_0x664b('0x8'),attributes,{'tableName':_0x664b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26dcf79..1d48c55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91d4=['request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x91d4,0x140));var _0x491d=function(_0x263a09,_0x1054e3){_0x263a09=_0x263a09-0x0;var _0x38dd46=_0x91d4[_0x263a09];return _0x38dd46;};'use strict';var _=require(_0x491d('0x0'));var util=require(_0x491d('0x1'));var moment=require('moment');var BPromise=require(_0x491d('0x2'));var rs=require(_0x491d('0x3'));var fs=require('fs');var Redis=require(_0x491d('0x4'));var db=require(_0x491d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x491d('0x6'))(_0x491d('0x7'));var config=require(_0x491d('0x8'));var jayson=require(_0x491d('0x9'));var client=jayson[_0x491d('0xa')][_0x491d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23de64,_0x104974,_0x3f78cd){return new BPromise(function(_0x1a2788,_0x37a02b){return client[_0x491d('0xc')](_0x23de64,_0x3f78cd)[_0x491d('0xd')](function(_0x369ba1){logger[_0x491d('0xe')](_0x491d('0xf'),_0x104974,_0x491d('0x10'));logger[_0x491d('0x11')](_0x491d('0x12'),_0x104974,_0x491d('0x10'),JSON[_0x491d('0x13')](_0x369ba1));if(_0x369ba1[_0x491d('0x14')]){if(_0x369ba1[_0x491d('0x14')][_0x491d('0x15')]===0x1f4){logger[_0x491d('0x14')]('MailSubstatus,\x20%s,\x20%s',_0x104974,_0x369ba1[_0x491d('0x14')][_0x491d('0x16')]);return _0x37a02b(_0x369ba1[_0x491d('0x14')][_0x491d('0x16')]);}logger[_0x491d('0x14')](_0x491d('0xf'),_0x104974,_0x369ba1['error'][_0x491d('0x16')]);return _0x1a2788(_0x369ba1['error']['message']);}else{logger[_0x491d('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x104974,_0x491d('0x10'));_0x1a2788(_0x369ba1[_0x491d('0x17')]['message']);}})['catch'](function(_0x47d756){logger['error'](_0x491d('0xf'),_0x104974,_0x47d756);_0x37a02b(_0x47d756);});});}
\ No newline at end of file
+var _0x7851=['error','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x7851,0x194));var _0x1785=function(_0x117b62,_0x127540){_0x117b62=_0x117b62-0x0;var _0x526fc3=_0x7851[_0x117b62];return _0x526fc3;};'use strict';var _=require('lodash');var util=require(_0x1785('0x0'));var moment=require(_0x1785('0x1'));var BPromise=require(_0x1785('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1785('0x3'));var db=require(_0x1785('0x4'))['db'];var utils=require(_0x1785('0x5'));var logger=require('../../config/logger')(_0x1785('0x6'));var config=require('../../config/environment');var jayson=require(_0x1785('0x7'));var client=jayson['client'][_0x1785('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e9987,_0x1476e2,_0x4d9ed3){return new BPromise(function(_0x5f4e02,_0x459c89){return client[_0x1785('0x9')](_0x4e9987,_0x4d9ed3)[_0x1785('0xa')](function(_0x518e89){logger['info'](_0x1785('0xb'),_0x1476e2,_0x1785('0xc'));logger[_0x1785('0xd')](_0x1785('0xe'),_0x1476e2,'request\x20sent',JSON[_0x1785('0xf')](_0x518e89));if(_0x518e89[_0x1785('0x10')]){if(_0x518e89[_0x1785('0x10')]['code']===0x1f4){logger[_0x1785('0x10')](_0x1785('0xb'),_0x1476e2,_0x518e89['error'][_0x1785('0x11')]);return _0x459c89(_0x518e89[_0x1785('0x10')][_0x1785('0x11')]);}logger[_0x1785('0x10')](_0x1785('0xb'),_0x1476e2,_0x518e89[_0x1785('0x10')][_0x1785('0x11')]);return _0x5f4e02(_0x518e89[_0x1785('0x10')][_0x1785('0x11')]);}else{logger[_0x1785('0x12')](_0x1785('0xb'),_0x1476e2,_0x1785('0xc'));_0x5f4e02(_0x518e89['result'][_0x1785('0x11')]);}})[_0x1785('0x13')](function(_0x3015b5){logger[_0x1785('0x10')](_0x1785('0xb'),_0x1476e2,_0x3015b5);_0x459c89(_0x3015b5);});});}
\ No newline at end of file
index 344e852..6ffe457 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0541=['../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','exports','multer','path','express','Router','fs-extra'];(function(_0x552e13,_0x46e4d9){var _0x50db5f=function(_0x4978b3){while(--_0x4978b3){_0x552e13['push'](_0x552e13['shift']());}};_0x50db5f(++_0x46e4d9);}(_0x0541,0x177));var _0x1054=function(_0x408762,_0x1e2f39){_0x408762=_0x408762-0x0;var _0x5e9e3e=_0x0541[_0x408762];return _0x5e9e3e;};'use strict';var multer=require(_0x1054('0x0'));var util=require('util');var path=require(_0x1054('0x1'));var timeout=require('connect-timeout');var express=require(_0x1054('0x2'));var router=express[_0x1054('0x3')]();var fs_extra=require(_0x1054('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1054('0x5'));var config=require(_0x1054('0x6'));var controller=require(_0x1054('0x7'));router[_0x1054('0x8')]('/',auth['isAuthenticated'](),controller[_0x1054('0x9')]);router['get'](_0x1054('0xa'),auth[_0x1054('0xb')](),controller[_0x1054('0xc')]);router['get'](_0x1054('0xd'),auth['isAuthenticated'](),controller[_0x1054('0xe')]);router['post']('/',auth[_0x1054('0xb')](),controller[_0x1054('0xf')]);router[_0x1054('0x10')](_0x1054('0xd'),auth[_0x1054('0xb')](),controller['update']);router[_0x1054('0x11')](_0x1054('0xd'),auth[_0x1054('0xb')](),controller['destroy']);module[_0x1054('0x12')]=router;
\ No newline at end of file
+var _0x7840=['./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xc0a38e,_0x1907cc){var _0x3eaeee=function(_0x347a0e){while(--_0x347a0e){_0xc0a38e['push'](_0xc0a38e['shift']());}};_0x3eaeee(++_0x1907cc);}(_0x7840,0xd3));var _0x0784=function(_0x37cdae,_0x4092ee){_0x37cdae=_0x37cdae-0x0;var _0x52f50d=_0x7840[_0x37cdae];return _0x52f50d;};'use strict';var multer=require(_0x0784('0x0'));var util=require(_0x0784('0x1'));var path=require(_0x0784('0x2'));var timeout=require(_0x0784('0x3'));var express=require(_0x0784('0x4'));var router=express[_0x0784('0x5')]();var fs_extra=require(_0x0784('0x6'));var auth=require(_0x0784('0x7'));var interaction=require(_0x0784('0x8'));var config=require('../../config/environment');var controller=require(_0x0784('0x9'));router[_0x0784('0xa')]('/',auth[_0x0784('0xb')](),controller['index']);router[_0x0784('0xa')](_0x0784('0xc'),auth[_0x0784('0xb')](),controller[_0x0784('0xd')]);router['get'](_0x0784('0xe'),auth[_0x0784('0xb')](),controller['show']);router[_0x0784('0xf')]('/',auth['isAuthenticated'](),controller[_0x0784('0x10')]);router['put']('/:id',auth[_0x0784('0xb')](),controller['update']);router[_0x0784('0x11')](_0x0784('0xe'),auth['isAuthenticated'](),controller[_0x0784('0x12')]);module[_0x0784('0x13')]=router;
\ No newline at end of file
index b04d523..91791ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x5e9b53,_0x4b8fdc){var _0x12df57=function(_0x579744){while(--_0x579744){_0x5e9b53['push'](_0x5e9b53['shift']());}};_0x12df57(++_0x4b8fdc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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
+var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3b62b4,_0x2059ed){var _0x1b9f17=function(_0x43ec1d){while(--_0x43ec1d){_0x3b62b4['push'](_0x3b62b4['shift']());}};_0x1b9f17(++_0x2059ed);}(_0x008c,0x188));var _0xc008=function(_0x31e94f,_0x42ecd6){_0x31e94f=_0x31e94f-0x0;var _0x1b8494=_0x008c[_0x31e94f];return _0x1b8494;};'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 9da5dd1..b21ba62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbd6=['moment','bluebird','mustache','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','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','fieldName','type','key','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','intersection','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbbd6,0x12d));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6bbd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bbd('0x1'));var jsonpatch=require(_0x6bbd('0x2'));var rp=require('request-promise');var moment=require(_0x6bbd('0x3'));var BPromise=require(_0x6bbd('0x4'));var Mustache=require(_0x6bbd('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6bbd('0x6'));var csv=require(_0x6bbd('0x7'));var ejs=require(_0x6bbd('0x8'));var fs=require('fs');var fs_extra=require(_0x6bbd('0x9'));var _=require(_0x6bbd('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6bbd('0xb'));var deskjs=require(_0x6bbd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6bbd('0xd'));var Papa=require(_0x6bbd('0xe'));var Redis=require(_0x6bbd('0xf'));var authService=require(_0x6bbd('0x10'));var qs=require(_0x6bbd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6bbd('0x12'));var logger=require(_0x6bbd('0x13'))('api');var utils=require(_0x6bbd('0x14'));var config=require(_0x6bbd('0x15'));var licenseUtil=require(_0x6bbd('0x16'));var db=require(_0x6bbd('0x17'))['db'];function respondWithStatusCode(_0x9a3c13,_0x531b6f){_0x531b6f=_0x531b6f||0xcc;return function(_0x275173){if(_0x275173){return _0x9a3c13[_0x6bbd('0x18')](_0x531b6f);}return _0x9a3c13[_0x6bbd('0x19')](_0x531b6f)[_0x6bbd('0x1a')]();};}function respondWithResult(_0x376c45,_0x2b9229){_0x2b9229=_0x2b9229||0xc8;return function(_0x2dda71){if(_0x2dda71){return _0x376c45['status'](_0x2b9229)[_0x6bbd('0x1b')](_0x2dda71);}};}function respondWithFilteredResult(_0x1a228c,_0x1820aa){return function(_0x15e1cb){if(_0x15e1cb){var _0xd6b5bc=typeof _0x1820aa[_0x6bbd('0x1c')]===_0x6bbd('0x1d')&&typeof _0x1820aa[_0x6bbd('0x1e')]===_0x6bbd('0x1d');var _0x5bd457=_0x15e1cb[_0x6bbd('0x1f')];var _0x1befbe=_0xd6b5bc?0x0:_0x1820aa[_0x6bbd('0x1c')];var _0x5a953a=_0xd6b5bc?_0x15e1cb[_0x6bbd('0x1f')]:_0x1820aa['offset']+_0x1820aa['limit'];var _0x1a7675;if(_0x5a953a>=_0x5bd457){_0x5a953a=_0x5bd457;_0x1a7675=0xc8;}else{_0x1a7675=0xce;}_0x1a228c['status'](_0x1a7675);return _0x1a228c['set'](_0x6bbd('0x20'),_0x1befbe+'-'+_0x5a953a+'/'+_0x5bd457)[_0x6bbd('0x1b')](_0x15e1cb);}return null;};}function patchUpdates(_0x1c3bb5){return function(_0xe73ed1){try{jsonpatch[_0x6bbd('0x21')](_0xe73ed1,_0x1c3bb5,!![]);}catch(_0x1eda1b){return BPromise[_0x6bbd('0x22')](_0x1eda1b);}return _0xe73ed1[_0x6bbd('0x23')]();};}function saveUpdates(_0x436c91,_0x521a13){return function(_0x5b2523){if(_0x5b2523){return _0x5b2523[_0x6bbd('0x24')](_0x436c91)[_0x6bbd('0x25')](function(_0x484672){return _0x484672;});}return null;};}function removeEntity(_0xd5c76f,_0xc0fde1){return function(_0x248321){if(_0x248321){return _0x248321[_0x6bbd('0x26')]()[_0x6bbd('0x25')](function(){_0xd5c76f[_0x6bbd('0x19')](0xcc)[_0x6bbd('0x1a')]();});}};}function handleEntityNotFound(_0x1d6309,_0x3f050e){return function(_0x52d439){if(!_0x52d439){_0x1d6309[_0x6bbd('0x18')](0x194);}return _0x52d439;};}function handleError(_0x90fa61,_0x211f4a){_0x211f4a=_0x211f4a||0x1f4;return function(_0x49b417){logger[_0x6bbd('0x27')](_0x49b417[_0x6bbd('0x28')]);if(_0x49b417[_0x6bbd('0x29')]){delete _0x49b417[_0x6bbd('0x29')];}_0x90fa61[_0x6bbd('0x19')](_0x211f4a)[_0x6bbd('0x2a')](_0x49b417);};}exports[_0x6bbd('0x2b')]=function(_0x224b77,_0x2a43a8){var _0x571d9a={},_0x4e7e14={},_0x399577={'count':0x0,'rows':[]};var _0x227942=_[_0x6bbd('0x2c')](db[_0x6bbd('0x2d')]['rawAttributes'],function(_0xf77a87){return{'name':_0xf77a87[_0x6bbd('0x2e')],'type':_0xf77a87[_0x6bbd('0x2f')][_0x6bbd('0x30')]};});_0x4e7e14[_0x6bbd('0x31')]=_[_0x6bbd('0x2c')](_0x227942,_0x6bbd('0x29'));_0x4e7e14['query']=_[_0x6bbd('0x32')](_0x224b77[_0x6bbd('0x33')]);_0x4e7e14['filters']=_['intersection'](_0x4e7e14[_0x6bbd('0x31')],_0x4e7e14[_0x6bbd('0x33')]);_0x571d9a[_0x6bbd('0x34')]=_['intersection'](_0x4e7e14[_0x6bbd('0x31')],qs[_0x6bbd('0x35')](_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x35')]));_0x571d9a[_0x6bbd('0x34')]=_0x571d9a[_0x6bbd('0x34')][_0x6bbd('0x36')]?_0x571d9a['attributes']:_0x4e7e14[_0x6bbd('0x31')];if(!_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x37')](_0x6bbd('0x38'))){_0x571d9a[_0x6bbd('0x1e')]=qs[_0x6bbd('0x1e')](_0x224b77['query'][_0x6bbd('0x1e')]);_0x571d9a['offset']=qs[_0x6bbd('0x1c')](_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x1c')]);}_0x571d9a['order']=qs[_0x6bbd('0x39')](_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x39')]);_0x571d9a[_0x6bbd('0x3a')]=qs[_0x6bbd('0x3b')](_[_0x6bbd('0x3c')](_0x224b77[_0x6bbd('0x33')],_0x4e7e14[_0x6bbd('0x3b')]),_0x227942);if(_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x3d')]){_0x571d9a[_0x6bbd('0x3a')]=_['merge'](_0x571d9a[_0x6bbd('0x3a')],{'$or':_[_0x6bbd('0x2c')](_0x227942,function(_0x3bff32){if(_0x3bff32['type']!==_0x6bbd('0x3e')){var _0x5a40d4={};_0x5a40d4[_0x3bff32[_0x6bbd('0x29')]]={'$like':'%'+_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x3d')]+'%'};return _0x5a40d4;}})});}_0x571d9a=_[_0x6bbd('0x3f')]({},_0x571d9a,_0x224b77['options']);var _0x17d77e={'where':_0x571d9a[_0x6bbd('0x3a')]};return db[_0x6bbd('0x2d')]['count'](_0x17d77e)[_0x6bbd('0x25')](function(_0x61486f){_0x399577['count']=_0x61486f;if(_0x224b77[_0x6bbd('0x33')][_0x6bbd('0x40')]){_0x571d9a[_0x6bbd('0x41')]=[{'all':!![]}];}return db[_0x6bbd('0x2d')][_0x6bbd('0x42')](_0x571d9a);})[_0x6bbd('0x25')](function(_0xc8cd5e){_0x399577[_0x6bbd('0x43')]=_0xc8cd5e;return _0x399577;})[_0x6bbd('0x25')](respondWithFilteredResult(_0x2a43a8,_0x571d9a))[_0x6bbd('0x44')](handleError(_0x2a43a8,null));};exports['show']=function(_0x4e0041,_0xb2b39){var _0x4fc835={'raw':!![],'where':{'id':_0x4e0041[_0x6bbd('0x45')]['id']}},_0x2dd617={};_0x2dd617[_0x6bbd('0x31')]=_[_0x6bbd('0x32')](db['MailTransferReport']['rawAttributes']);_0x2dd617[_0x6bbd('0x33')]=_[_0x6bbd('0x32')](_0x4e0041[_0x6bbd('0x33')]);_0x2dd617['filters']=_[_0x6bbd('0x46')](_0x2dd617[_0x6bbd('0x31')],_0x2dd617[_0x6bbd('0x33')]);_0x4fc835[_0x6bbd('0x34')]=_[_0x6bbd('0x46')](_0x2dd617[_0x6bbd('0x31')],qs[_0x6bbd('0x35')](_0x4e0041['query'][_0x6bbd('0x35')]));_0x4fc835[_0x6bbd('0x34')]=_0x4fc835[_0x6bbd('0x34')]['length']?_0x4fc835[_0x6bbd('0x34')]:_0x2dd617['model'];if(_0x4e0041[_0x6bbd('0x33')]['includeAll']){_0x4fc835[_0x6bbd('0x41')]=[{'all':!![]}];}_0x4fc835=_[_0x6bbd('0x3f')]({},_0x4fc835,_0x4e0041[_0x6bbd('0x47')]);return db[_0x6bbd('0x2d')][_0x6bbd('0x48')](_0x4fc835)['then'](handleEntityNotFound(_0xb2b39,null))[_0x6bbd('0x25')](respondWithResult(_0xb2b39,null))[_0x6bbd('0x44')](handleError(_0xb2b39,null));};exports[_0x6bbd('0x49')]=function(_0x4fdc07,_0x312e52){return db[_0x6bbd('0x2d')][_0x6bbd('0x49')](_0x4fdc07['body'],{})[_0x6bbd('0x25')](respondWithResult(_0x312e52,0xc9))[_0x6bbd('0x44')](handleError(_0x312e52,null));};exports['update']=function(_0x529e8b,_0x3fd601){if(_0x529e8b['body']['id']){delete _0x529e8b[_0x6bbd('0x4a')]['id'];}return db[_0x6bbd('0x2d')]['find']({'where':{'id':_0x529e8b[_0x6bbd('0x45')]['id']}})[_0x6bbd('0x25')](handleEntityNotFound(_0x3fd601,null))['then'](saveUpdates(_0x529e8b[_0x6bbd('0x4a')],null))[_0x6bbd('0x25')](respondWithResult(_0x3fd601,null))[_0x6bbd('0x44')](handleError(_0x3fd601,null));};exports[_0x6bbd('0x26')]=function(_0x1ad1c9,_0x524943){return db['MailTransferReport']['find']({'where':{'id':_0x1ad1c9[_0x6bbd('0x45')]['id']}})[_0x6bbd('0x25')](handleEntityNotFound(_0x524943,null))[_0x6bbd('0x25')](removeEntity(_0x524943,null))[_0x6bbd('0x44')](handleError(_0x524943,null));};exports[_0x6bbd('0x4b')]=function(_0x2317c5,_0x37dd00){return db[_0x6bbd('0x2d')][_0x6bbd('0x4b')]()[_0x6bbd('0x25')](respondWithResult(_0x37dd00,null))[_0x6bbd('0x44')](handleError(_0x37dd00,null));};
\ No newline at end of file
+var _0x0260=['rawAttributes','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','Content-Range','update','then','destroy','error','stack','name','send','MailTransferReport','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x3d893a,_0x42671c){var _0x1b49d6=function(_0x41b767){while(--_0x41b767){_0x3d893a['push'](_0x3d893a['shift']());}};_0x1b49d6(++_0x42671c);}(_0x0260,0xda));var _0x0026=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x0260[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require(_0x0026('0x0'));var rimraf=require(_0x0026('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0026('0x2'));var moment=require('moment');var BPromise=require(_0x0026('0x3'));var Mustache=require(_0x0026('0x4'));var util=require('util');var path=require(_0x0026('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0026('0x6'));var _=require(_0x0026('0x7'));var squel=require(_0x0026('0x8'));var crypto=require(_0x0026('0x9'));var jsforce=require(_0x0026('0xa'));var deskjs=require(_0x0026('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0026('0xc'));var Papa=require(_0x0026('0xd'));var Redis=require(_0x0026('0xe'));var authService=require(_0x0026('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0026('0x10'));var logger=require(_0x0026('0x11'))(_0x0026('0x12'));var utils=require(_0x0026('0x13'));var config=require(_0x0026('0x14'));var licenseUtil=require(_0x0026('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b1cf1,_0x3781c2){_0x3781c2=_0x3781c2||0xcc;return function(_0x25a040){if(_0x25a040){return _0x4b1cf1[_0x0026('0x16')](_0x3781c2);}return _0x4b1cf1[_0x0026('0x17')](_0x3781c2)[_0x0026('0x18')]();};}function respondWithResult(_0x222809,_0x250e92){_0x250e92=_0x250e92||0xc8;return function(_0x2bc8bb){if(_0x2bc8bb){return _0x222809[_0x0026('0x17')](_0x250e92)[_0x0026('0x19')](_0x2bc8bb);}};}function respondWithFilteredResult(_0x223e06,_0x187ac9){return function(_0xf07a3){if(_0xf07a3){var _0x4ed42d=typeof _0x187ac9[_0x0026('0x1a')]===_0x0026('0x1b')&&typeof _0x187ac9['limit']===_0x0026('0x1b');var _0x26a511=_0xf07a3['count'];var _0x58d523=_0x4ed42d?0x0:_0x187ac9[_0x0026('0x1a')];var _0x15d6d0=_0x4ed42d?_0xf07a3['count']:_0x187ac9[_0x0026('0x1a')]+_0x187ac9[_0x0026('0x1c')];var _0x4801e2;if(_0x15d6d0>=_0x26a511){_0x15d6d0=_0x26a511;_0x4801e2=0xc8;}else{_0x4801e2=0xce;}_0x223e06[_0x0026('0x17')](_0x4801e2);return _0x223e06['set'](_0x0026('0x1d'),_0x58d523+'-'+_0x15d6d0+'/'+_0x26a511)['json'](_0xf07a3);}return null;};}function patchUpdates(_0x549678){return function(_0x31a241){try{jsonpatch['apply'](_0x31a241,_0x549678,!![]);}catch(_0x4825ef){return BPromise['reject'](_0x4825ef);}return _0x31a241['save']();};}function saveUpdates(_0x1d5915,_0x5e1bdd){return function(_0x50bdae){if(_0x50bdae){return _0x50bdae[_0x0026('0x1e')](_0x1d5915)[_0x0026('0x1f')](function(_0x1d084d){return _0x1d084d;});}return null;};}function removeEntity(_0x1e3be4,_0x41e38b){return function(_0x47c68b){if(_0x47c68b){return _0x47c68b[_0x0026('0x20')]()[_0x0026('0x1f')](function(){_0x1e3be4[_0x0026('0x17')](0xcc)[_0x0026('0x18')]();});}};}function handleEntityNotFound(_0x5d4b2d,_0x343231){return function(_0x44d7ac){if(!_0x44d7ac){_0x5d4b2d['sendStatus'](0x194);}return _0x44d7ac;};}function handleError(_0x460844,_0x328780){_0x328780=_0x328780||0x1f4;return function(_0x439c1c){logger[_0x0026('0x21')](_0x439c1c[_0x0026('0x22')]);if(_0x439c1c['name']){delete _0x439c1c[_0x0026('0x23')];}_0x460844[_0x0026('0x17')](_0x328780)[_0x0026('0x24')](_0x439c1c);};}exports['index']=function(_0x3fd8ef,_0x21b133){var _0xf225f4={},_0x951bc8={},_0x3f10f1={'count':0x0,'rows':[]};var _0x314bcb=_['map'](db[_0x0026('0x25')]['rawAttributes'],function(_0x5ecab1){return{'name':_0x5ecab1['fieldName'],'type':_0x5ecab1['type'][_0x0026('0x26')]};});_0x951bc8[_0x0026('0x27')]=_[_0x0026('0x28')](_0x314bcb,_0x0026('0x23'));_0x951bc8[_0x0026('0x29')]=_[_0x0026('0x2a')](_0x3fd8ef[_0x0026('0x29')]);_0x951bc8[_0x0026('0x2b')]=_[_0x0026('0x2c')](_0x951bc8[_0x0026('0x27')],_0x951bc8[_0x0026('0x29')]);_0xf225f4[_0x0026('0x2d')]=_[_0x0026('0x2c')](_0x951bc8[_0x0026('0x27')],qs[_0x0026('0x2e')](_0x3fd8ef[_0x0026('0x29')][_0x0026('0x2e')]));_0xf225f4[_0x0026('0x2d')]=_0xf225f4[_0x0026('0x2d')][_0x0026('0x2f')]?_0xf225f4[_0x0026('0x2d')]:_0x951bc8[_0x0026('0x27')];if(!_0x3fd8ef['query'][_0x0026('0x30')](_0x0026('0x31'))){_0xf225f4[_0x0026('0x1c')]=qs[_0x0026('0x1c')](_0x3fd8ef['query'][_0x0026('0x1c')]);_0xf225f4['offset']=qs[_0x0026('0x1a')](_0x3fd8ef[_0x0026('0x29')]['offset']);}_0xf225f4[_0x0026('0x32')]=qs[_0x0026('0x33')](_0x3fd8ef['query'][_0x0026('0x33')]);_0xf225f4[_0x0026('0x34')]=qs[_0x0026('0x2b')](_['pick'](_0x3fd8ef[_0x0026('0x29')],_0x951bc8[_0x0026('0x2b')]),_0x314bcb);if(_0x3fd8ef[_0x0026('0x29')][_0x0026('0x35')]){_0xf225f4[_0x0026('0x34')]=_['merge'](_0xf225f4[_0x0026('0x34')],{'$or':_[_0x0026('0x28')](_0x314bcb,function(_0x400a25){if(_0x400a25[_0x0026('0x36')]!==_0x0026('0x37')){var _0x25af43={};_0x25af43[_0x400a25['name']]={'$like':'%'+_0x3fd8ef['query'][_0x0026('0x35')]+'%'};return _0x25af43;}})});}_0xf225f4=_[_0x0026('0x38')]({},_0xf225f4,_0x3fd8ef[_0x0026('0x39')]);var _0x4413d9={'where':_0xf225f4[_0x0026('0x34')]};return db[_0x0026('0x25')][_0x0026('0x3a')](_0x4413d9)[_0x0026('0x1f')](function(_0x3f8967){_0x3f10f1[_0x0026('0x3a')]=_0x3f8967;if(_0x3fd8ef[_0x0026('0x29')][_0x0026('0x3b')]){_0xf225f4[_0x0026('0x3c')]=[{'all':!![]}];}return db[_0x0026('0x25')][_0x0026('0x3d')](_0xf225f4);})[_0x0026('0x1f')](function(_0x523312){_0x3f10f1[_0x0026('0x3e')]=_0x523312;return _0x3f10f1;})['then'](respondWithFilteredResult(_0x21b133,_0xf225f4))[_0x0026('0x3f')](handleError(_0x21b133,null));};exports[_0x0026('0x40')]=function(_0x3dcd82,_0x52d41e){var _0x4a071b={'raw':!![],'where':{'id':_0x3dcd82[_0x0026('0x41')]['id']}},_0x2d66d8={};_0x2d66d8[_0x0026('0x27')]=_[_0x0026('0x2a')](db[_0x0026('0x25')][_0x0026('0x42')]);_0x2d66d8[_0x0026('0x29')]=_[_0x0026('0x2a')](_0x3dcd82[_0x0026('0x29')]);_0x2d66d8['filters']=_[_0x0026('0x2c')](_0x2d66d8[_0x0026('0x27')],_0x2d66d8[_0x0026('0x29')]);_0x4a071b[_0x0026('0x2d')]=_[_0x0026('0x2c')](_0x2d66d8[_0x0026('0x27')],qs['fields'](_0x3dcd82[_0x0026('0x29')][_0x0026('0x2e')]));_0x4a071b[_0x0026('0x2d')]=_0x4a071b['attributes'][_0x0026('0x2f')]?_0x4a071b[_0x0026('0x2d')]:_0x2d66d8[_0x0026('0x27')];if(_0x3dcd82[_0x0026('0x29')][_0x0026('0x3b')]){_0x4a071b[_0x0026('0x3c')]=[{'all':!![]}];}_0x4a071b=_['merge']({},_0x4a071b,_0x3dcd82[_0x0026('0x39')]);return db[_0x0026('0x25')][_0x0026('0x43')](_0x4a071b)['then'](handleEntityNotFound(_0x52d41e,null))[_0x0026('0x1f')](respondWithResult(_0x52d41e,null))[_0x0026('0x3f')](handleError(_0x52d41e,null));};exports[_0x0026('0x44')]=function(_0x536697,_0x52e73a){return db['MailTransferReport'][_0x0026('0x44')](_0x536697['body'],{})[_0x0026('0x1f')](respondWithResult(_0x52e73a,0xc9))[_0x0026('0x3f')](handleError(_0x52e73a,null));};exports[_0x0026('0x1e')]=function(_0x21741d,_0x2455b1){if(_0x21741d[_0x0026('0x45')]['id']){delete _0x21741d[_0x0026('0x45')]['id'];}return db[_0x0026('0x25')][_0x0026('0x43')]({'where':{'id':_0x21741d[_0x0026('0x41')]['id']}})[_0x0026('0x1f')](handleEntityNotFound(_0x2455b1,null))[_0x0026('0x1f')](saveUpdates(_0x21741d[_0x0026('0x45')],null))[_0x0026('0x1f')](respondWithResult(_0x2455b1,null))['catch'](handleError(_0x2455b1,null));};exports[_0x0026('0x20')]=function(_0xe71ba0,_0x4a45aa){return db[_0x0026('0x25')][_0x0026('0x43')]({'where':{'id':_0xe71ba0[_0x0026('0x41')]['id']}})[_0x0026('0x1f')](handleEntityNotFound(_0x4a45aa,null))['then'](removeEntity(_0x4a45aa,null))['catch'](handleError(_0x4a45aa,null));};exports[_0x0026('0x46')]=function(_0x48c67f,_0x5c90f0){return db['MailTransferReport'][_0x0026('0x46')]()[_0x0026('0x1f')](respondWithResult(_0x5c90f0,null))[_0x0026('0x3f')](handleError(_0x5c90f0,null));};
\ No newline at end of file
index e1c4c90..a03de04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2028=['exports','report_mail_transfer','uniqueid','../../config/logger','moment','bluebird','request-promise','rimraf','./mailTransferReport.attributes'];(function(_0x9b7721,_0x36ef2f){var _0x2c92de=function(_0x27e0b4){while(--_0x27e0b4){_0x9b7721['push'](_0x9b7721['shift']());}};_0x2c92de(++_0x36ef2f);}(_0x2028,0x1e0));var _0x8202=function(_0x33a53e,_0x3e6bd4){_0x33a53e=_0x33a53e-0x0;var _0xe191b=_0x2028[_0x33a53e];return _0xe191b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8202('0x0'))('api');var moment=require(_0x8202('0x1'));var BPromise=require(_0x8202('0x2'));var rp=require(_0x8202('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8202('0x4'));var config=require('../../config/environment');var attributes=require(_0x8202('0x5'));module[_0x8202('0x6')]=function(_0x2b272d,_0xda8397){return _0x2b272d['define']('MailTransferReport',attributes,{'tableName':_0x8202('0x7'),'paranoid':![],'indexes':[{'name':_0x8202('0x8'),'fields':[_0x8202('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x40cb=['../../config/logger','api','bluebird','request-promise','path','rimraf','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util'];(function(_0x2ff7ef,_0x598e58){var _0x5d2adf=function(_0x2553bd){while(--_0x2553bd){_0x2ff7ef['push'](_0x2ff7ef['shift']());}};_0x5d2adf(++_0x598e58);}(_0x40cb,0x108));var _0xb40c=function(_0x1a8d5f,_0x455595){_0x1a8d5f=_0x1a8d5f-0x0;var _0x1dcc34=_0x40cb[_0x1a8d5f];return _0x1dcc34;};'use strict';var _=require(_0xb40c('0x0'));var util=require(_0xb40c('0x1'));var logger=require(_0xb40c('0x2'))(_0xb40c('0x3'));var moment=require('moment');var BPromise=require(_0xb40c('0x4'));var rp=require(_0xb40c('0x5'));var fs=require('fs');var path=require(_0xb40c('0x6'));var rimraf=require(_0xb40c('0x7'));var config=require('../../config/environment');var attributes=require(_0xb40c('0x8'));module[_0xb40c('0x9')]=function(_0x4c650d,_0x36120e){return _0x4c650d[_0xb40c('0xa')](_0xb40c('0xb'),attributes,{'tableName':_0xb40c('0xc'),'paranoid':![],'indexes':[{'name':_0xb40c('0xd'),'fields':[_0xb40c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 9f4e64d..c9b9b3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e5b=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../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','stringify','error','code'];(function(_0x1da11c,_0x18ce7b){var _0x2315e6=function(_0x44f486){while(--_0x44f486){_0x1da11c['push'](_0x1da11c['shift']());}};_0x2315e6(++_0x18ce7b);}(_0x8e5b,0xf6));var _0xb8e5=function(_0x279685,_0x9c6a76){_0x279685=_0x279685-0x0;var _0x7d1bea=_0x8e5b[_0x279685];return _0x7d1bea;};'use strict';var _=require(_0xb8e5('0x0'));var util=require(_0xb8e5('0x1'));var moment=require(_0xb8e5('0x2'));var BPromise=require(_0xb8e5('0x3'));var rs=require(_0xb8e5('0x4'));var fs=require('fs');var Redis=require(_0xb8e5('0x5'));var db=require(_0xb8e5('0x6'))['db'];var utils=require(_0xb8e5('0x7'));var logger=require(_0xb8e5('0x8'))(_0xb8e5('0x9'));var config=require(_0xb8e5('0xa'));var jayson=require(_0xb8e5('0xb'));var client=jayson[_0xb8e5('0xc')][_0xb8e5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x305e00,_0x7f1c6b,_0x1f7e58){return new BPromise(function(_0x3841ca,_0x2666a5){return client[_0xb8e5('0xe')](_0x305e00,_0x1f7e58)[_0xb8e5('0xf')](function(_0x370442){logger[_0xb8e5('0x10')](_0xb8e5('0x11'),_0x7f1c6b,_0xb8e5('0x12'));logger[_0xb8e5('0x13')](_0xb8e5('0x14'),_0x7f1c6b,_0xb8e5('0x12'),JSON[_0xb8e5('0x15')](_0x370442));if(_0x370442[_0xb8e5('0x16')]){if(_0x370442[_0xb8e5('0x16')][_0xb8e5('0x17')]===0x1f4){logger[_0xb8e5('0x16')](_0xb8e5('0x11'),_0x7f1c6b,_0x370442['error']['message']);return _0x2666a5(_0x370442[_0xb8e5('0x16')][_0xb8e5('0x18')]);}logger[_0xb8e5('0x16')](_0xb8e5('0x11'),_0x7f1c6b,_0x370442['error'][_0xb8e5('0x18')]);return _0x3841ca(_0x370442[_0xb8e5('0x16')][_0xb8e5('0x18')]);}else{logger[_0xb8e5('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x7f1c6b,_0xb8e5('0x12'));_0x3841ca(_0x370442[_0xb8e5('0x19')][_0xb8e5('0x18')]);}})[_0xb8e5('0x1a')](function(_0x249f47){logger[_0xb8e5('0x16')](_0xb8e5('0x11'),_0x7f1c6b,_0x249f47);_0x2666a5(_0x249f47);});});}
\ No newline at end of file
+var _0x57ad=['rpc','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\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(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x57ad,0x10b));var _0xd57a=function(_0x29849b,_0xf25afc){_0x29849b=_0x29849b-0x0;var _0x5dcc15=_0x57ad[_0x29849b];return _0x5dcc15;};'use strict';var _=require(_0xd57a('0x0'));var util=require(_0xd57a('0x1'));var moment=require(_0xd57a('0x2'));var BPromise=require(_0xd57a('0x3'));var rs=require(_0xd57a('0x4'));var fs=require('fs');var Redis=require(_0xd57a('0x5'));var db=require(_0xd57a('0x6'))['db'];var utils=require(_0xd57a('0x7'));var logger=require(_0xd57a('0x8'))(_0xd57a('0x9'));var config=require(_0xd57a('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd57a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x98d0c5,_0x37b403,_0x1e568c){return new BPromise(function(_0x1515b8,_0x453779){return client[_0xd57a('0xc')](_0x98d0c5,_0x1e568c)[_0xd57a('0xd')](function(_0x255305){logger[_0xd57a('0xe')](_0xd57a('0xf'),_0x37b403,'request\x20sent');logger['debug'](_0xd57a('0x10'),_0x37b403,_0xd57a('0x11'),JSON[_0xd57a('0x12')](_0x255305));if(_0x255305[_0xd57a('0x13')]){if(_0x255305[_0xd57a('0x13')][_0xd57a('0x14')]===0x1f4){logger[_0xd57a('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x37b403,_0x255305[_0xd57a('0x13')][_0xd57a('0x15')]);return _0x453779(_0x255305['error']['message']);}logger[_0xd57a('0x13')](_0xd57a('0xf'),_0x37b403,_0x255305[_0xd57a('0x13')]['message']);return _0x1515b8(_0x255305[_0xd57a('0x13')][_0xd57a('0x15')]);}else{logger[_0xd57a('0xe')](_0xd57a('0xf'),_0x37b403,'request\x20sent');_0x1515b8(_0x255305['result'][_0xd57a('0x15')]);}})[_0xd57a('0x16')](function(_0xe0c023){logger[_0xd57a('0x13')](_0xd57a('0xf'),_0x37b403,_0xe0c023);_0x453779(_0xe0c023);});});}
\ No newline at end of file
index 93dfcb5..7f6decf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x305e=['../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','update','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x68fd87,_0x17f037){var _0x559470=function(_0x1e7b0b){while(--_0x1e7b0b){_0x68fd87['push'](_0x68fd87['shift']());}};_0x559470(++_0x17f037);}(_0x305e,0x1c7));var _0xe305=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x305e[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xe305('0x0'));var util=require(_0xe305('0x1'));var path=require(_0xe305('0x2'));var timeout=require('connect-timeout');var express=require(_0xe305('0x3'));var router=express[_0xe305('0x4')]();var fs_extra=require(_0xe305('0x5'));var auth=require(_0xe305('0x6'));var interaction=require(_0xe305('0x7'));var config=require('../../config/environment');var controller=require(_0xe305('0x8'));router[_0xe305('0x9')]('/',auth[_0xe305('0xa')](),controller[_0xe305('0xb')]);router[_0xe305('0x9')](_0xe305('0xc'),auth[_0xe305('0xa')](),controller[_0xe305('0xd')]);router[_0xe305('0x9')]('/:id',auth[_0xe305('0xa')](),controller[_0xe305('0xe')]);router[_0xe305('0xf')]('/',auth['isAuthenticated'](),controller[_0xe305('0x10')]);router[_0xe305('0x11')]('/:id',auth[_0xe305('0xa')](),controller[_0xe305('0x12')]);router[_0xe305('0x13')](_0xe305('0x14'),auth[_0xe305('0xa')](),controller['destroy']);module[_0xe305('0x15')]=router;
\ No newline at end of file
+var _0x65eb=['get','isAuthenticated','index','describe','/:id','show','post','create','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller'];(function(_0x13440b,_0x4b3719){var _0x521722=function(_0x29c3cb){while(--_0x29c3cb){_0x13440b['push'](_0x13440b['shift']());}};_0x521722(++_0x4b3719);}(_0x65eb,0xc4));var _0xb65e=function(_0x30b73a,_0x1a39e2){_0x30b73a=_0x30b73a-0x0;var _0x2835d1=_0x65eb[_0x30b73a];return _0x2835d1;};'use strict';var multer=require(_0xb65e('0x0'));var util=require(_0xb65e('0x1'));var path=require(_0xb65e('0x2'));var timeout=require('connect-timeout');var express=require(_0xb65e('0x3'));var router=express['Router']();var fs_extra=require(_0xb65e('0x4'));var auth=require(_0xb65e('0x5'));var interaction=require(_0xb65e('0x6'));var config=require('../../config/environment');var controller=require(_0xb65e('0x7'));router[_0xb65e('0x8')]('/',auth[_0xb65e('0x9')](),controller[_0xb65e('0xa')]);router[_0xb65e('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xb65e('0xb')]);router[_0xb65e('0x8')](_0xb65e('0xc'),auth[_0xb65e('0x9')](),controller[_0xb65e('0xd')]);router[_0xb65e('0xe')]('/',auth[_0xb65e('0x9')](),controller[_0xb65e('0xf')]);router['put'](_0xb65e('0xc'),auth[_0xb65e('0x9')](),controller['update']);router['delete'](_0xb65e('0xc'),auth[_0xb65e('0x9')](),controller[_0xb65e('0x10')]);module['exports']=router;
\ No newline at end of file
index 4d4da14..f094e24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2356=['INTEGER','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x2356,0x14f));var _0x6235=function(_0x534ae9,_0x5735c1){_0x534ae9=_0x534ae9-0x0;var _0x2dc1e7=_0x2356[_0x534ae9];return _0x2dc1e7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6235('0x0'));module[_0x6235('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x6235('0x2')]},'type':{'type':Sequelize[_0x6235('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6235('0x3')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x390c55){var _0x17e08f=moment(_0x390c55);var _0x3663e7=moment(this['getDataValue']('enterAt'));var _0x547159=_0x17e08f[_0x6235('0x4')](_0x3663e7,'seconds');this[_0x6235('0x5')](_0x6235('0x6'),_0x390c55);this[_0x6235('0x5')](_0x6235('0x7'),_0x547159||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x6235('0x8')},'data2':{'type':Sequelize[_0x6235('0x2')],'comment':_0x6235('0x9')},'data3':{'type':Sequelize[_0x6235('0x2')],'comment':_0x6235('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x6235('0xb')},'data5':{'type':Sequelize[_0x6235('0x2')],'comment':_0x6235('0xc')},'role':{'type':Sequelize[_0x6235('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x6235('0x2')]}};
\ No newline at end of file
+var _0x6282=['enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x6282,0x76));var _0x2628=function(_0x26e2a6,_0x228b63){_0x26e2a6=_0x26e2a6-0x0;var _0x13f0bd=_0x6282[_0x26e2a6];return _0x13f0bd;};'use strict';var Sequelize=require(_0x2628('0x0'));var moment=require(_0x2628('0x1'));module[_0x2628('0x2')]={'channel':{'type':Sequelize[_0x2628('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2628('0x3')],'defaultValue':_0x2628('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2628('0x5')]},'enterAt':{'type':Sequelize[_0x2628('0x6')]},'exitAt':{'type':Sequelize[_0x2628('0x6')],'set':function(_0x47102a){var _0x128d3a=moment(_0x47102a);var _0x50412a=moment(this[_0x2628('0x7')](_0x2628('0x8')));var _0x2170a7=_0x128d3a[_0x2628('0x9')](_0x50412a,_0x2628('0xa'));this[_0x2628('0xb')](_0x2628('0xc'),_0x47102a);this[_0x2628('0xb')](_0x2628('0xd'),_0x2170a7||null);}},'data1':{'type':Sequelize[_0x2628('0x3')],'comment':_0x2628('0xe')},'data2':{'type':Sequelize[_0x2628('0x3')],'comment':_0x2628('0xf')},'data3':{'type':Sequelize[_0x2628('0x3')],'comment':_0x2628('0x10')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x2628('0x3')],'comment':_0x2628('0x11')},'role':{'type':Sequelize[_0x2628('0x3')]},'internal':{'type':Sequelize[_0x2628('0x5')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 1295c34..a0c1f61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['destroy','sendStatus','send','index','MemberReport','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then'];(function(_0x1d50a3,_0x3213ff){var _0x4d8902=function(_0x79d1ba){while(--_0x79d1ba){_0x1d50a3['push'](_0x1d50a3['shift']());}};_0x4d8902(++_0x3213ff);}(_0x008c,0x188));var _0xc008=function(_0x138d06,_0x33edf2){_0x138d06=_0x138d06-0x0;var _0x1a01eb=_0x008c[_0x138d06];return _0x1a01eb;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x2a7d4f,_0xc008('0x2b'));_0x32390d[_0xc008('0x2c')]=_[_0xc008('0x2d')](_0x25eae4[_0xc008('0x2c')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x32390d[_0xc008('0x29')],_0x32390d[_0xc008('0x2c')]);_0x24c14c[_0xc008('0x30')]=_['intersection'](_0x32390d[_0xc008('0x29')],qs[_0xc008('0x31')](_0x25eae4['query'][_0xc008('0x31')]));_0x24c14c[_0xc008('0x30')]=_0x24c14c[_0xc008('0x30')][_0xc008('0x32')]?_0x24c14c[_0xc008('0x30')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2c')][_0xc008('0x33')](_0xc008('0x34'))){_0x24c14c['limit']=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4[_0xc008('0x2c')][_0xc008('0x1b')]);}_0x24c14c['order']=qs[_0xc008('0x35')](_0x25eae4[_0xc008('0x2c')]['sort']);_0x24c14c[_0xc008('0x36')]=qs[_0xc008('0x2e')](_['pick'](_0x25eae4[_0xc008('0x2c')],_0x32390d[_0xc008('0x2e')]),_0x2a7d4f);if(_0x25eae4[_0xc008('0x2c')]['filter']){_0x24c14c['where']=_['merge'](_0x24c14c[_0xc008('0x36')],{'$or':_['map'](_0x2a7d4f,function(_0x3dd0ac){if(_0x3dd0ac[_0xc008('0x37')]!==_0xc008('0x38')){var _0x440459={};_0x440459[_0x3dd0ac[_0xc008('0x2b')]]={'$like':'%'+_0x25eae4[_0xc008('0x2c')][_0xc008('0x39')]+'%'};return _0x440459;}})});}_0x24c14c=_[_0xc008('0x3a')]({},_0x24c14c,_0x25eae4[_0xc008('0x3b')]);var _0x387dfd={'where':_0x24c14c[_0xc008('0x36')]};return db[_0xc008('0x26')][_0xc008('0x1e')](_0x387dfd)[_0xc008('0x21')](function(_0x4cace5){_0x209591[_0xc008('0x1e')]=_0x4cace5;if(_0x25eae4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x24c14c[_0xc008('0x3d')]=[{'all':!![]}];}return db['MemberReport'][_0xc008('0x3e')](_0x24c14c);})[_0xc008('0x21')](function(_0xc8cb91){_0x209591[_0xc008('0x3f')]=_0xc8cb91;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))['catch'](handleError(_0x529961,null));};exports[_0xc008('0x40')]=function(_0x3323f4,_0x3794b0){var _0x3e9a99={'raw':!![],'where':{'id':_0x3323f4['params']['id']}},_0x7279e8={};_0x7279e8[_0xc008('0x29')]=_[_0xc008('0x2d')](db[_0xc008('0x26')][_0xc008('0x27')]);_0x7279e8['query']=_[_0xc008('0x2d')](_0x3323f4[_0xc008('0x2c')]);_0x7279e8[_0xc008('0x2e')]=_['intersection'](_0x7279e8[_0xc008('0x29')],_0x7279e8['query']);_0x3e9a99[_0xc008('0x30')]=_['intersection'](_0x7279e8[_0xc008('0x29')],qs[_0xc008('0x31')](_0x3323f4['query'][_0xc008('0x31')]));_0x3e9a99[_0xc008('0x30')]=_0x3e9a99[_0xc008('0x30')]['length']?_0x3e9a99[_0xc008('0x30')]:_0x7279e8[_0xc008('0x29')];if(_0x3323f4[_0xc008('0x2c')][_0xc008('0x3c')]){_0x3e9a99[_0xc008('0x3d')]=[{'all':!![]}];}_0x3e9a99=_[_0xc008('0x3a')]({},_0x3e9a99,_0x3323f4['options']);return db['MemberReport']['find'](_0x3e9a99)[_0xc008('0x21')](handleEntityNotFound(_0x3794b0,null))[_0xc008('0x21')](respondWithResult(_0x3794b0,null))[_0xc008('0x41')](handleError(_0x3794b0,null));};exports[_0xc008('0x42')]=function(_0x25289f,_0x24f6a4){return db[_0xc008('0x26')][_0xc008('0x42')](_0x25289f['body'],{})['then'](respondWithResult(_0x24f6a4,0xc9))['catch'](handleError(_0x24f6a4,null));};exports[_0xc008('0x20')]=function(_0x2651cf,_0x158eae){if(_0x2651cf['body']['id']){delete _0x2651cf[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x44')]({'where':{'id':_0x2651cf[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x158eae,null))[_0xc008('0x21')](saveUpdates(_0x2651cf[_0xc008('0x43')],null))[_0xc008('0x21')](respondWithResult(_0x158eae,null))[_0xc008('0x41')](handleError(_0x158eae,null));};exports[_0xc008('0x22')]=function(_0x52c444,_0x4c63d4){return db[_0xc008('0x26')]['find']({'where':{'id':_0x52c444[_0xc008('0x45')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x4c63d4,null))[_0xc008('0x21')](removeEntity(_0x4c63d4,null))['catch'](handleError(_0x4c63d4,null));};exports[_0xc008('0x46')]=function(_0x32b435,_0xee64){return db[_0xc008('0x26')][_0xc008('0x46')]()['then'](respondWithResult(_0xee64,null))[_0xc008('0x41')](handleError(_0xee64,null));};
\ No newline at end of file
+var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x3b934f,_0x59dc45){var _0x136c82=function(_0x321a23){while(--_0x321a23){_0x3b934f['push'](_0x3b934f['shift']());}};_0x136c82(++_0x59dc45);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));};
\ No newline at end of file
index f63f41e..a7a2927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7182=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','lodash'];(function(_0x6a946,_0x34b170){var _0x3ff4f1=function(_0x2f18b7){while(--_0x2f18b7){_0x6a946['push'](_0x6a946['shift']());}};_0x3ff4f1(++_0x34b170);}(_0x7182,0x187));var _0x2718=function(_0x2385ed,_0x49586f){_0x2385ed=_0x2385ed-0x0;var _0x1f1cd2=_0x7182[_0x2385ed];return _0x1f1cd2;};'use strict';var _=require(_0x2718('0x0'));var util=require(_0x2718('0x1'));var logger=require(_0x2718('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2718('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2718('0x4'));var rimraf=require(_0x2718('0x5'));var config=require(_0x2718('0x6'));var attributes=require(_0x2718('0x7'));module['exports']=function(_0x19e98f,_0x1e7303){return _0x19e98f[_0x2718('0x8')](_0x2718('0x9'),attributes,{'tableName':_0x2718('0xa'),'paranoid':![],'indexes':[{'name':_0x2718('0xb'),'fields':[_0x2718('0xc'),_0x2718('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd14c=['exports','define','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x4ef6a9,_0x158826){var _0x5bcb8c=function(_0x1f5e6e){while(--_0x1f5e6e){_0x4ef6a9['push'](_0x4ef6a9['shift']());}};_0x5bcb8c(++_0x158826);}(_0xd14c,0x124));var _0xcd14=function(_0x2cb73e,_0x16d25f){_0x2cb73e=_0x2cb73e-0x0;var _0x459029=_0xd14c[_0x2cb73e];return _0x459029;};'use strict';var _=require('lodash');var util=require(_0xcd14('0x0'));var logger=require(_0xcd14('0x1'))(_0xcd14('0x2'));var moment=require(_0xcd14('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd14('0x4'));var rimraf=require(_0xcd14('0x5'));var config=require(_0xcd14('0x6'));var attributes=require(_0xcd14('0x7'));module[_0xcd14('0x8')]=function(_0x68b2ca,_0x476a93){return _0x68b2ca[_0xcd14('0x9')](_0xcd14('0xa'),attributes,{'tableName':_0xcd14('0xb'),'paranoid':![],'indexes':[{'name':_0xcd14('0xc'),'fields':[_0xcd14('0xd'),_0xcd14('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 38ea005..9e61645 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa23f=['findAll','options','attributes','limit','include','map','model','GetMemberReport','stringify','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','MemberReport,\x20%s,\x20%s','message','catch'];(function(_0x2fb6f4,_0x15bea0){var _0x357f26=function(_0x4d81e8){while(--_0x4d81e8){_0x2fb6f4['push'](_0x2fb6f4['shift']());}};_0x357f26(++_0x15bea0);}(_0xa23f,0x7c));var _0xfa23=function(_0x3002fb,_0x2959f3){_0x3002fb=_0x3002fb-0x0;var _0x297676=_0xa23f[_0x3002fb];return _0x297676;};'use strict';var _=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa23('0x2'));var fs=require('fs');var Redis=require(_0xfa23('0x3'));var db=require(_0xfa23('0x4'))['db'];var utils=require(_0xfa23('0x5'));var logger=require('../../config/logger')(_0xfa23('0x6'));var config=require('../../config/environment');var jayson=require(_0xfa23('0x7'));var client=jayson[_0xfa23('0x8')][_0xfa23('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3696ef,_0x4fb6e6,_0x5a7882){return new BPromise(function(_0x59d53e,_0x19a1ac){return client[_0xfa23('0xa')](_0x3696ef,_0x5a7882)[_0xfa23('0xb')](function(_0x31bb2c){logger[_0xfa23('0xc')]('MemberReport,\x20%s,\x20%s',_0x4fb6e6,'request\x20sent');logger[_0xfa23('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x4fb6e6,_0xfa23('0xe'),JSON['stringify'](_0x31bb2c));if(_0x31bb2c[_0xfa23('0xf')]){if(_0x31bb2c[_0xfa23('0xf')][_0xfa23('0x10')]===0x1f4){logger['error'](_0xfa23('0x11'),_0x4fb6e6,_0x31bb2c[_0xfa23('0xf')][_0xfa23('0x12')]);return _0x19a1ac(_0x31bb2c['error']['message']);}logger[_0xfa23('0xf')](_0xfa23('0x11'),_0x4fb6e6,_0x31bb2c[_0xfa23('0xf')][_0xfa23('0x12')]);return _0x59d53e(_0x31bb2c['error'][_0xfa23('0x12')]);}else{logger[_0xfa23('0xc')](_0xfa23('0x11'),_0x4fb6e6,_0xfa23('0xe'));_0x59d53e(_0x31bb2c['result'][_0xfa23('0x12')]);}})[_0xfa23('0x13')](function(_0x3ca6be){logger[_0xfa23('0xf')](_0xfa23('0x11'),_0x4fb6e6,_0x3ca6be);_0x19a1ac(_0x3ca6be);});});}exports['GetMemberReport']=function(_0x59610c){var _0x5c3c6d=this;return new Promise(function(_0x445bd0,_0xb3ced2){return db['MemberReport'][_0xfa23('0x14')]({'raw':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')]['where']||null:null,'attributes':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')][_0xfa23('0x16')]||null:null,'limit':_0x59610c[_0xfa23('0x15')]?_0x59610c[_0xfa23('0x15')][_0xfa23('0x17')]||null:null,'include':_0x59610c[_0xfa23('0x15')]?_0x59610c['options'][_0xfa23('0x18')]?_[_0xfa23('0x19')](_0x59610c[_0xfa23('0x15')][_0xfa23('0x18')],function(_0x542cde){return{'model':db[_0x542cde[_0xfa23('0x1a')]],'as':_0x542cde['as'],'attributes':_0x542cde['attributes'],'include':_0x542cde[_0xfa23('0x18')]?_[_0xfa23('0x19')](_0x542cde[_0xfa23('0x18')],function(_0x26bdce){return{'model':db[_0x26bdce[_0xfa23('0x1a')]],'as':_0x26bdce['as'],'attributes':_0x26bdce[_0xfa23('0x16')],'include':_0x26bdce[_0xfa23('0x18')]?_[_0xfa23('0x19')](_0x26bdce['include'],function(_0x2ae826){return{'model':db[_0x2ae826['model']],'as':_0x2ae826['as'],'attributes':_0x2ae826[_0xfa23('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ea972){logger[_0xfa23('0xc')](_0xfa23('0x1b'),_0x59610c);logger[_0xfa23('0xd')](_0xfa23('0x1b'),_0x59610c,JSON[_0xfa23('0x1c')](_0x4ea972));_0x445bd0(_0x4ea972);})[_0xfa23('0x13')](function(_0x3c9d9d){logger['error'](_0xfa23('0x1b'),_0x3c9d9d['message'],_0x59610c);_0xb3ced2(_0x5c3c6d[_0xfa23('0xf')](0x1f4,_0x3c9d9d[_0xfa23('0x12')]));});});};exports['CreateMemberReport']=function(_0x1c83d0){var _0x3a6966=this;return new Promise(function(_0xf9c420,_0x3dadc0){return db[_0xfa23('0x1d')][_0xfa23('0x1e')](_0x1c83d0[_0xfa23('0x1f')],{'raw':_0x1c83d0[_0xfa23('0x15')]?_0x1c83d0[_0xfa23('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xfa23('0xb')](function(_0x59c393){logger[_0xfa23('0xc')](_0xfa23('0x20'),_0x1c83d0);logger[_0xfa23('0xd')](_0xfa23('0x20'),_0x1c83d0,JSON[_0xfa23('0x1c')](_0x59c393));_0xf9c420(_0x59c393);})[_0xfa23('0x13')](function(_0x18f549){logger[_0xfa23('0xf')](_0xfa23('0x20'),_0x18f549['message'],_0x1c83d0);_0x3dadc0(_0x3a6966[_0xfa23('0xf')](0x1f4,_0x18f549['message']));});});};exports[_0xfa23('0x21')]=function(_0x88a593){var _0x17c407=this;return new Promise(function(_0x30ea1e,_0x3fed37){return db[_0xfa23('0x1d')][_0xfa23('0x22')](_0x88a593['body'],{'raw':_0x88a593[_0xfa23('0x15')]?_0x88a593[_0xfa23('0x15')][_0xfa23('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x88a593[_0xfa23('0x15')]?_0x88a593['options']['where']||null:null,'attributes':_0x88a593['options']?_0x88a593[_0xfa23('0x15')][_0xfa23('0x16')]||null:null,'limit':_0x88a593['options']?_0x88a593[_0xfa23('0x15')][_0xfa23('0x17')]||null:null})[_0xfa23('0xb')](function(_0x588fa5){logger[_0xfa23('0xc')]('UpdateMemberReport',_0x88a593);logger[_0xfa23('0xd')](_0xfa23('0x21'),_0x88a593,JSON[_0xfa23('0x1c')](_0x588fa5));_0x30ea1e(_0x588fa5);})[_0xfa23('0x13')](function(_0x1bc029){logger[_0xfa23('0xf')]('UpdateMemberReport',_0x1bc029[_0xfa23('0x12')],_0x88a593);_0x3fed37(_0x17c407[_0xfa23('0xf')](0x1f4,_0x1bc029[_0xfa23('0x12')]));});});};
\ No newline at end of file
+var _0x30bc=['include','map','body','CreateMemberReport','debug','catch','UpdateMemberReport','update','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','model'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0x30bc,0x149));var _0xc30b=function(_0x30bd01,_0x557a2c){_0x30bd01=_0x30bd01-0x0;var _0x44cdc3=_0x30bc[_0x30bd01];return _0x44cdc3;};'use strict';var _=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var moment=require(_0xc30b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc30b('0x3'));var fs=require('fs');var Redis=require(_0xc30b('0x4'));var db=require(_0xc30b('0x5'))['db'];var utils=require(_0xc30b('0x6'));var logger=require(_0xc30b('0x7'))(_0xc30b('0x8'));var config=require(_0xc30b('0x9'));var jayson=require(_0xc30b('0xa'));var client=jayson[_0xc30b('0xb')][_0xc30b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5dff10,_0x2f7826,_0x1aca07){return new BPromise(function(_0x25e199,_0x1c912d){return client['request'](_0x5dff10,_0x1aca07)[_0xc30b('0xd')](function(_0x5b5055){logger[_0xc30b('0xe')](_0xc30b('0xf'),_0x2f7826,'request\x20sent');logger['debug'](_0xc30b('0x10'),_0x2f7826,_0xc30b('0x11'),JSON[_0xc30b('0x12')](_0x5b5055));if(_0x5b5055[_0xc30b('0x13')]){if(_0x5b5055[_0xc30b('0x13')][_0xc30b('0x14')]===0x1f4){logger['error'](_0xc30b('0xf'),_0x2f7826,_0x5b5055[_0xc30b('0x13')]['message']);return _0x1c912d(_0x5b5055[_0xc30b('0x13')][_0xc30b('0x15')]);}logger['error'](_0xc30b('0xf'),_0x2f7826,_0x5b5055['error']['message']);return _0x25e199(_0x5b5055['error'][_0xc30b('0x15')]);}else{logger['info'](_0xc30b('0xf'),_0x2f7826,_0xc30b('0x11'));_0x25e199(_0x5b5055[_0xc30b('0x16')][_0xc30b('0x15')]);}})['catch'](function(_0xff2b55){logger[_0xc30b('0x13')](_0xc30b('0xf'),_0x2f7826,_0xff2b55);_0x1c912d(_0xff2b55);});});}exports[_0xc30b('0x17')]=function(_0x1ce7eb){var _0x23b45f=this;return new Promise(function(_0x5b4345,_0x50ade1){return db[_0xc30b('0x18')][_0xc30b('0x19')]({'raw':_0x1ce7eb[_0xc30b('0x1a')]?_0x1ce7eb[_0xc30b('0x1a')][_0xc30b('0x1b')]===undefined?!![]:![]:!![],'where':_0x1ce7eb[_0xc30b('0x1a')]?_0x1ce7eb['options'][_0xc30b('0x1c')]||null:null,'attributes':_0x1ce7eb['options']?_0x1ce7eb[_0xc30b('0x1a')][_0xc30b('0x1d')]||null:null,'limit':_0x1ce7eb[_0xc30b('0x1a')]?_0x1ce7eb[_0xc30b('0x1a')]['limit']||null:null,'include':_0x1ce7eb[_0xc30b('0x1a')]?_0x1ce7eb[_0xc30b('0x1a')]['include']?_['map'](_0x1ce7eb[_0xc30b('0x1a')]['include'],function(_0x567296){return{'model':db[_0x567296[_0xc30b('0x1e')]],'as':_0x567296['as'],'attributes':_0x567296[_0xc30b('0x1d')],'include':_0x567296[_0xc30b('0x1f')]?_['map'](_0x567296[_0xc30b('0x1f')],function(_0x2e987e){return{'model':db[_0x2e987e[_0xc30b('0x1e')]],'as':_0x2e987e['as'],'attributes':_0x2e987e['attributes'],'include':_0x2e987e[_0xc30b('0x1f')]?_[_0xc30b('0x20')](_0x2e987e[_0xc30b('0x1f')],function(_0x1c7b1b){return{'model':db[_0x1c7b1b[_0xc30b('0x1e')]],'as':_0x1c7b1b['as'],'attributes':_0x1c7b1b[_0xc30b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46a2a5){logger[_0xc30b('0xe')]('GetMemberReport',_0x1ce7eb);logger['debug'](_0xc30b('0x17'),_0x1ce7eb,JSON['stringify'](_0x46a2a5));_0x5b4345(_0x46a2a5);})['catch'](function(_0x3940c2){logger['error'](_0xc30b('0x17'),_0x3940c2[_0xc30b('0x15')],_0x1ce7eb);_0x50ade1(_0x23b45f[_0xc30b('0x13')](0x1f4,_0x3940c2[_0xc30b('0x15')]));});});};exports['CreateMemberReport']=function(_0x12679a){var _0x109693=this;return new Promise(function(_0x399531,_0x11f508){return db[_0xc30b('0x18')]['create'](_0x12679a[_0xc30b('0x21')],{'raw':_0x12679a[_0xc30b('0x1a')]?_0x12679a[_0xc30b('0x1a')][_0xc30b('0x1b')]===undefined?!![]:![]:!![]})[_0xc30b('0xd')](function(_0x5b4cc6){logger[_0xc30b('0xe')](_0xc30b('0x22'),_0x12679a);logger[_0xc30b('0x23')](_0xc30b('0x22'),_0x12679a,JSON['stringify'](_0x5b4cc6));_0x399531(_0x5b4cc6);})[_0xc30b('0x24')](function(_0x29ef09){logger[_0xc30b('0x13')]('CreateMemberReport',_0x29ef09[_0xc30b('0x15')],_0x12679a);_0x11f508(_0x109693[_0xc30b('0x13')](0x1f4,_0x29ef09['message']));});});};exports[_0xc30b('0x25')]=function(_0x5e709b){var _0x390a3d=this;return new Promise(function(_0x4c21c2,_0x57a6ef){return db['MemberReport'][_0xc30b('0x26')](_0x5e709b[_0xc30b('0x21')],{'raw':_0x5e709b['options']?_0x5e709b[_0xc30b('0x1a')][_0xc30b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e709b[_0xc30b('0x1a')]?_0x5e709b[_0xc30b('0x1a')][_0xc30b('0x1c')]||null:null,'attributes':_0x5e709b['options']?_0x5e709b[_0xc30b('0x1a')][_0xc30b('0x1d')]||null:null,'limit':_0x5e709b[_0xc30b('0x1a')]?_0x5e709b[_0xc30b('0x1a')][_0xc30b('0x27')]||null:null})['then'](function(_0x3b5918){logger[_0xc30b('0xe')](_0xc30b('0x25'),_0x5e709b);logger[_0xc30b('0x23')](_0xc30b('0x25'),_0x5e709b,JSON[_0xc30b('0x12')](_0x3b5918));_0x4c21c2(_0x3b5918);})[_0xc30b('0x24')](function(_0x483669){logger['error']('UpdateMemberReport',_0x483669[_0xc30b('0x15')],_0x5e709b);_0x57a6ef(_0x390a3d[_0xc30b('0x13')](0x1f4,_0x483669[_0xc30b('0x15')]));});});};
\ No newline at end of file
index 14d8644..7eddfc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa05=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x79c09c,_0x3befad){var _0x3621af=function(_0x3a9b59){while(--_0x3a9b59){_0x79c09c['push'](_0x79c09c['shift']());}};_0x3621af(++_0x3befad);}(_0xaa05,0x1c5));var _0x5aa0=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0xaa05[_0x54c10d];return _0x1fa703;};'use strict';var multer=require(_0x5aa0('0x0'));var util=require(_0x5aa0('0x1'));var path=require(_0x5aa0('0x2'));var timeout=require(_0x5aa0('0x3'));var express=require(_0x5aa0('0x4'));var router=express['Router']();var fs_extra=require(_0x5aa0('0x5'));var auth=require(_0x5aa0('0x6'));var interaction=require(_0x5aa0('0x7'));var config=require(_0x5aa0('0x8'));var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0x5aa0('0x9')]=router;
\ No newline at end of file
+var _0x010d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','exports','multer','util','path','connect-timeout','express'];(function(_0x5eb2b8,_0x45d757){var _0xd3dbd0=function(_0x4794f6){while(--_0x4794f6){_0x5eb2b8['push'](_0x5eb2b8['shift']());}};_0xd3dbd0(++_0x45d757);}(_0x010d,0xed));var _0xd010=function(_0x216a89,_0x5d0f7d){_0x216a89=_0x216a89-0x0;var _0xfba552=_0x010d[_0x216a89];return _0xfba552;};'use strict';var multer=require(_0xd010('0x0'));var util=require(_0xd010('0x1'));var path=require(_0xd010('0x2'));var timeout=require(_0xd010('0x3'));var express=require(_0xd010('0x4'));var router=express[_0xd010('0x5')]();var fs_extra=require(_0xd010('0x6'));var auth=require(_0xd010('0x7'));var interaction=require(_0xd010('0x8'));var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller[_0xd010('0x9')]);module[_0xd010('0xa')]=router;
\ No newline at end of file
index 7d12dd0..c67a3d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7724=['STRING','version','sequelize','exports'];(function(_0x184772,_0x169901){var _0x27b6fa=function(_0x48480d){while(--_0x48480d){_0x184772['push'](_0x184772['shift']());}};_0x27b6fa(++_0x169901);}(_0x7724,0xe6));var _0x4772=function(_0x3848e7,_0x20147a){_0x3848e7=_0x3848e7-0x0;var _0x2d21be=_0x7724[_0x3848e7];return _0x2d21be;};'use strict';var Sequelize=require(_0x4772('0x0'));module[_0x4772('0x1')]={'version':{'type':Sequelize[_0x4772('0x2')],'unique':_0x4772('0x3')}};
\ No newline at end of file
+var _0x470f=['sequelize','exports','STRING','version'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x470f,0x12c));var _0xf470=function(_0x3d542c,_0x2098ae){_0x3d542c=_0x3d542c-0x0;var _0x4946de=_0x470f[_0x3d542c];return _0x4946de;};'use strict';var Sequelize=require(_0xf470('0x0'));module[_0xf470('0x1')]={'version':{'type':Sequelize[_0xf470('0x2')],'unique':_0xf470('0x3')}};
\ No newline at end of file
index 819688e..c563c49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe359=['nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Migration','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x44dbfe,_0x4a8bb2){var _0x38d95c=function(_0x51f7d5){while(--_0x51f7d5){_0x44dbfe['push'](_0x44dbfe['shift']());}};_0x38d95c(++_0x4a8bb2);}(_0xe359,0x9b));var _0x9e35=function(_0x740abb,_0x35f52d){_0x740abb=_0x740abb-0x0;var _0x30c379=_0xe359[_0x740abb];return _0x30c379;};'use strict';var emlformat=require(_0x9e35('0x0'));var rimraf=require(_0x9e35('0x1'));var zipdir=require(_0x9e35('0x2'));var jsonpatch=require(_0x9e35('0x3'));var rp=require(_0x9e35('0x4'));var moment=require(_0x9e35('0x5'));var BPromise=require(_0x9e35('0x6'));var Mustache=require(_0x9e35('0x7'));var util=require(_0x9e35('0x8'));var path=require(_0x9e35('0x9'));var sox=require('sox');var csv=require(_0x9e35('0xa'));var ejs=require(_0x9e35('0xb'));var fs=require('fs');var fs_extra=require(_0x9e35('0xc'));var _=require(_0x9e35('0xd'));var squel=require(_0x9e35('0xe'));var crypto=require(_0x9e35('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9e35('0x10'));var toCsv=require(_0x9e35('0xa'));var querystring=require(_0x9e35('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9e35('0x12'));var as=require(_0x9e35('0x13'));var hardwareService=require(_0x9e35('0x14'));var logger=require(_0x9e35('0x15'))(_0x9e35('0x16'));var utils=require(_0x9e35('0x17'));var config=require(_0x9e35('0x18'));var licenseUtil=require(_0x9e35('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x318400,_0x20f961){_0x20f961=_0x20f961||0xcc;return function(_0x31fda5){if(_0x31fda5){return _0x318400[_0x9e35('0x1a')](_0x20f961);}return _0x318400[_0x9e35('0x1b')](_0x20f961)[_0x9e35('0x1c')]();};}function respondWithResult(_0x1ab25e,_0x44199a){_0x44199a=_0x44199a||0xc8;return function(_0x127337){if(_0x127337){return _0x1ab25e['status'](_0x44199a)[_0x9e35('0x1d')](_0x127337);}};}function respondWithFilteredResult(_0x56bf69,_0x1ae18b){return function(_0x59f5aa){if(_0x59f5aa){var _0x4da9e0=typeof _0x1ae18b['offset']===_0x9e35('0x1e')&&typeof _0x1ae18b['limit']===_0x9e35('0x1e');var _0x32ca3e=_0x59f5aa[_0x9e35('0x1f')];var _0x2b5859=_0x4da9e0?0x0:_0x1ae18b[_0x9e35('0x20')];var _0x40584e=_0x4da9e0?_0x59f5aa[_0x9e35('0x1f')]:_0x1ae18b[_0x9e35('0x20')]+_0x1ae18b['limit'];var _0x496ea5;if(_0x40584e>=_0x32ca3e){_0x40584e=_0x32ca3e;_0x496ea5=0xc8;}else{_0x496ea5=0xce;}_0x56bf69[_0x9e35('0x1b')](_0x496ea5);return _0x56bf69[_0x9e35('0x21')](_0x9e35('0x22'),_0x2b5859+'-'+_0x40584e+'/'+_0x32ca3e)['json'](_0x59f5aa);}return null;};}function patchUpdates(_0x442bae){return function(_0x1d55ed){try{jsonpatch[_0x9e35('0x23')](_0x1d55ed,_0x442bae,!![]);}catch(_0x83689c){return BPromise[_0x9e35('0x24')](_0x83689c);}return _0x1d55ed[_0x9e35('0x25')]();};}function saveUpdates(_0x29e0ea,_0xdd2506){return function(_0x492b73){if(_0x492b73){return _0x492b73[_0x9e35('0x26')](_0x29e0ea)[_0x9e35('0x27')](function(_0x40f685){return _0x40f685;});}return null;};}function removeEntity(_0x46c180,_0xb2a1ce){return function(_0x3cef77){if(_0x3cef77){return _0x3cef77[_0x9e35('0x28')]()[_0x9e35('0x27')](function(){_0x46c180['status'](0xcc)[_0x9e35('0x1c')]();});}};}function handleEntityNotFound(_0x244ac6,_0x41d19e){return function(_0x4138ee){if(!_0x4138ee){_0x244ac6[_0x9e35('0x1a')](0x194);}return _0x4138ee;};}function handleError(_0x16861f,_0x59a946){_0x59a946=_0x59a946||0x1f4;return function(_0x3bba7d){logger['error'](_0x3bba7d[_0x9e35('0x29')]);if(_0x3bba7d[_0x9e35('0x2a')]){delete _0x3bba7d[_0x9e35('0x2a')];}_0x16861f['status'](_0x59a946)[_0x9e35('0x2b')](_0x3bba7d);};}exports[_0x9e35('0x2c')]=function(_0x2937ba,_0x36afcb){var _0x2984b7={},_0x3d65fb={},_0x2db00b={'count':0x0,'rows':[]};var _0x159c03=_[_0x9e35('0x2d')](db[_0x9e35('0x2e')][_0x9e35('0x2f')],function(_0x23962a){return{'name':_0x23962a['fieldName'],'type':_0x23962a[_0x9e35('0x30')]['key']};});_0x3d65fb[_0x9e35('0x31')]=_[_0x9e35('0x2d')](_0x159c03,'name');_0x3d65fb[_0x9e35('0x32')]=_[_0x9e35('0x33')](_0x2937ba[_0x9e35('0x32')]);_0x3d65fb[_0x9e35('0x34')]=_[_0x9e35('0x35')](_0x3d65fb['model'],_0x3d65fb[_0x9e35('0x32')]);_0x2984b7[_0x9e35('0x36')]=_[_0x9e35('0x35')](_0x3d65fb['model'],qs[_0x9e35('0x37')](_0x2937ba[_0x9e35('0x32')][_0x9e35('0x37')]));_0x2984b7[_0x9e35('0x36')]=_0x2984b7[_0x9e35('0x36')][_0x9e35('0x38')]?_0x2984b7[_0x9e35('0x36')]:_0x3d65fb['model'];if(!_0x2937ba[_0x9e35('0x32')][_0x9e35('0x39')](_0x9e35('0x3a'))){_0x2984b7[_0x9e35('0x3b')]=qs[_0x9e35('0x3b')](_0x2937ba[_0x9e35('0x32')]['limit']);_0x2984b7['offset']=qs[_0x9e35('0x20')](_0x2937ba[_0x9e35('0x32')][_0x9e35('0x20')]);}_0x2984b7[_0x9e35('0x3c')]=qs['sort'](_0x2937ba[_0x9e35('0x32')][_0x9e35('0x3d')]);_0x2984b7[_0x9e35('0x3e')]=qs[_0x9e35('0x34')](_['pick'](_0x2937ba[_0x9e35('0x32')],_0x3d65fb['filters']),_0x159c03);if(_0x2937ba['query'][_0x9e35('0x3f')]){_0x2984b7[_0x9e35('0x3e')]=_[_0x9e35('0x40')](_0x2984b7[_0x9e35('0x3e')],{'$or':_[_0x9e35('0x2d')](_0x159c03,function(_0x3ac39d){if(_0x3ac39d['type']!==_0x9e35('0x41')){var _0x3af808={};_0x3af808[_0x3ac39d[_0x9e35('0x2a')]]={'$like':'%'+_0x2937ba[_0x9e35('0x32')][_0x9e35('0x3f')]+'%'};return _0x3af808;}})});}_0x2984b7=_['merge']({},_0x2984b7,_0x2937ba[_0x9e35('0x42')]);var _0x33edc0={'where':_0x2984b7[_0x9e35('0x3e')]};return db[_0x9e35('0x2e')]['count'](_0x33edc0)[_0x9e35('0x27')](function(_0x961bc3){_0x2db00b[_0x9e35('0x1f')]=_0x961bc3;if(_0x2937ba[_0x9e35('0x32')][_0x9e35('0x43')]){_0x2984b7[_0x9e35('0x44')]=[{'all':!![]}];}return db[_0x9e35('0x2e')]['findAll'](_0x2984b7);})['then'](function(_0xea7c55){_0x2db00b[_0x9e35('0x45')]=_0xea7c55;return _0x2db00b;})[_0x9e35('0x27')](respondWithFilteredResult(_0x36afcb,_0x2984b7))[_0x9e35('0x46')](handleError(_0x36afcb,null));};
\ No newline at end of file
+var _0xa9e4=['options','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','map','Migration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge'];(function(_0x35cfbb,_0x24b8a2){var _0x503a16=function(_0x71bc05){while(--_0x71bc05){_0x35cfbb['push'](_0x35cfbb['shift']());}};_0x503a16(++_0x24b8a2);}(_0xa9e4,0x89));var _0x4a9e=function(_0x172087,_0x5e54ff){_0x172087=_0x172087-0x0;var _0x3ddcd7=_0xa9e4[_0x172087];return _0x3ddcd7;};'use strict';var emlformat=require(_0x4a9e('0x0'));var rimraf=require(_0x4a9e('0x1'));var zipdir=require(_0x4a9e('0x2'));var jsonpatch=require(_0x4a9e('0x3'));var rp=require(_0x4a9e('0x4'));var moment=require(_0x4a9e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4a9e('0x6'));var util=require(_0x4a9e('0x7'));var path=require(_0x4a9e('0x8'));var sox=require('sox');var csv=require(_0x4a9e('0x9'));var ejs=require(_0x4a9e('0xa'));var fs=require('fs');var fs_extra=require(_0x4a9e('0xb'));var _=require(_0x4a9e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4a9e('0xd'));var toCsv=require(_0x4a9e('0x9'));var querystring=require(_0x4a9e('0xe'));var Papa=require(_0x4a9e('0xf'));var Redis=require(_0x4a9e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4a9e('0x11'));var as=require(_0x4a9e('0x12'));var hardwareService=require(_0x4a9e('0x13'));var logger=require(_0x4a9e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a9e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28f6ff,_0x14c292){_0x14c292=_0x14c292||0xcc;return function(_0x517606){if(_0x517606){return _0x28f6ff['sendStatus'](_0x14c292);}return _0x28f6ff['status'](_0x14c292)[_0x4a9e('0x16')]();};}function respondWithResult(_0x412aa8,_0x1889fd){_0x1889fd=_0x1889fd||0xc8;return function(_0x265e56){if(_0x265e56){return _0x412aa8[_0x4a9e('0x17')](_0x1889fd)['json'](_0x265e56);}};}function respondWithFilteredResult(_0x228c44,_0x184391){return function(_0x242009){if(_0x242009){var _0x44c541=typeof _0x184391['offset']===_0x4a9e('0x18')&&typeof _0x184391[_0x4a9e('0x19')]===_0x4a9e('0x18');var _0x5d6bf2=_0x242009[_0x4a9e('0x1a')];var _0x1c3893=_0x44c541?0x0:_0x184391[_0x4a9e('0x1b')];var _0x39e01d=_0x44c541?_0x242009[_0x4a9e('0x1a')]:_0x184391[_0x4a9e('0x1b')]+_0x184391[_0x4a9e('0x19')];var _0x1945ff;if(_0x39e01d>=_0x5d6bf2){_0x39e01d=_0x5d6bf2;_0x1945ff=0xc8;}else{_0x1945ff=0xce;}_0x228c44[_0x4a9e('0x17')](_0x1945ff);return _0x228c44['set'](_0x4a9e('0x1c'),_0x1c3893+'-'+_0x39e01d+'/'+_0x5d6bf2)[_0x4a9e('0x1d')](_0x242009);}return null;};}function patchUpdates(_0x7a1eb0){return function(_0x441305){try{jsonpatch[_0x4a9e('0x1e')](_0x441305,_0x7a1eb0,!![]);}catch(_0x31d49d){return BPromise[_0x4a9e('0x1f')](_0x31d49d);}return _0x441305[_0x4a9e('0x20')]();};}function saveUpdates(_0x1ae6dd,_0x42eba4){return function(_0x5ba258){if(_0x5ba258){return _0x5ba258[_0x4a9e('0x21')](_0x1ae6dd)[_0x4a9e('0x22')](function(_0x26ec1d){return _0x26ec1d;});}return null;};}function removeEntity(_0x59813c,_0xa93510){return function(_0x5aca9c){if(_0x5aca9c){return _0x5aca9c['destroy']()[_0x4a9e('0x22')](function(){_0x59813c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36f5ff,_0x4349b0){return function(_0x47707c){if(!_0x47707c){_0x36f5ff['sendStatus'](0x194);}return _0x47707c;};}function handleError(_0x4304ff,_0x50e032){_0x50e032=_0x50e032||0x1f4;return function(_0x3d7ccc){logger[_0x4a9e('0x23')](_0x3d7ccc[_0x4a9e('0x24')]);if(_0x3d7ccc[_0x4a9e('0x25')]){delete _0x3d7ccc[_0x4a9e('0x25')];}_0x4304ff[_0x4a9e('0x17')](_0x50e032)['send'](_0x3d7ccc);};}exports[_0x4a9e('0x26')]=function(_0xf8e888,_0x335b0c){var _0x23e068={},_0x4670bb={},_0x59f88a={'count':0x0,'rows':[]};var _0x107e9a=_[_0x4a9e('0x27')](db[_0x4a9e('0x28')][_0x4a9e('0x29')],function(_0x3e4c34){return{'name':_0x3e4c34[_0x4a9e('0x2a')],'type':_0x3e4c34['type'][_0x4a9e('0x2b')]};});_0x4670bb[_0x4a9e('0x2c')]=_[_0x4a9e('0x27')](_0x107e9a,_0x4a9e('0x25'));_0x4670bb[_0x4a9e('0x2d')]=_[_0x4a9e('0x2e')](_0xf8e888[_0x4a9e('0x2d')]);_0x4670bb[_0x4a9e('0x2f')]=_[_0x4a9e('0x30')](_0x4670bb[_0x4a9e('0x2c')],_0x4670bb[_0x4a9e('0x2d')]);_0x23e068[_0x4a9e('0x31')]=_[_0x4a9e('0x30')](_0x4670bb['model'],qs[_0x4a9e('0x32')](_0xf8e888[_0x4a9e('0x2d')][_0x4a9e('0x32')]));_0x23e068['attributes']=_0x23e068[_0x4a9e('0x31')][_0x4a9e('0x33')]?_0x23e068[_0x4a9e('0x31')]:_0x4670bb['model'];if(!_0xf8e888[_0x4a9e('0x2d')][_0x4a9e('0x34')](_0x4a9e('0x35'))){_0x23e068[_0x4a9e('0x19')]=qs[_0x4a9e('0x19')](_0xf8e888[_0x4a9e('0x2d')][_0x4a9e('0x19')]);_0x23e068[_0x4a9e('0x1b')]=qs[_0x4a9e('0x1b')](_0xf8e888[_0x4a9e('0x2d')][_0x4a9e('0x1b')]);}_0x23e068['order']=qs['sort'](_0xf8e888[_0x4a9e('0x2d')][_0x4a9e('0x36')]);_0x23e068[_0x4a9e('0x37')]=qs[_0x4a9e('0x2f')](_[_0x4a9e('0x38')](_0xf8e888[_0x4a9e('0x2d')],_0x4670bb[_0x4a9e('0x2f')]),_0x107e9a);if(_0xf8e888['query'][_0x4a9e('0x39')]){_0x23e068[_0x4a9e('0x37')]=_['merge'](_0x23e068[_0x4a9e('0x37')],{'$or':_[_0x4a9e('0x27')](_0x107e9a,function(_0x281e99){if(_0x281e99[_0x4a9e('0x3a')]!==_0x4a9e('0x3b')){var _0x38f886={};_0x38f886[_0x281e99['name']]={'$like':'%'+_0xf8e888[_0x4a9e('0x2d')]['filter']+'%'};return _0x38f886;}})});}_0x23e068=_[_0x4a9e('0x3c')]({},_0x23e068,_0xf8e888[_0x4a9e('0x3d')]);var _0x535160={'where':_0x23e068[_0x4a9e('0x37')]};return db['Migration'][_0x4a9e('0x1a')](_0x535160)[_0x4a9e('0x22')](function(_0x1d6fd2){_0x59f88a[_0x4a9e('0x1a')]=_0x1d6fd2;if(_0xf8e888[_0x4a9e('0x2d')]['includeAll']){_0x23e068[_0x4a9e('0x3e')]=[{'all':!![]}];}return db[_0x4a9e('0x28')][_0x4a9e('0x3f')](_0x23e068);})[_0x4a9e('0x22')](function(_0x5a464f){_0x59f88a[_0x4a9e('0x40')]=_0x5a464f;return _0x59f88a;})[_0x4a9e('0x22')](respondWithFilteredResult(_0x335b0c,_0x23e068))[_0x4a9e('0x41')](handleError(_0x335b0c,null));};
\ No newline at end of file
index 3a7c747..e91d239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb29=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','Migration','lodash','util','../../config/logger','api'];(function(_0x312d8d,_0x29b4a3){var _0x2a070=function(_0x562935){while(--_0x562935){_0x312d8d['push'](_0x312d8d['shift']());}};_0x2a070(++_0x29b4a3);}(_0xeb29,0x1a0));var _0x9eb2=function(_0x4f64ed,_0x59c8c4){_0x4f64ed=_0x4f64ed-0x0;var _0x206f04=_0xeb29[_0x4f64ed];return _0x206f04;};'use strict';var _=require(_0x9eb2('0x0'));var util=require(_0x9eb2('0x1'));var logger=require(_0x9eb2('0x2'))(_0x9eb2('0x3'));var moment=require(_0x9eb2('0x4'));var BPromise=require(_0x9eb2('0x5'));var rp=require(_0x9eb2('0x6'));var fs=require('fs');var path=require(_0x9eb2('0x7'));var rimraf=require(_0x9eb2('0x8'));var config=require(_0x9eb2('0x9'));var attributes=require('./migration.attributes');module['exports']=function(_0x38161a,_0x45e9da){return _0x38161a[_0x9eb2('0xa')](_0x9eb2('0xb'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc816=['api','moment','bluebird','request-promise','rimraf','./migration.attributes','exports','define','Migration','util','../../config/logger'];(function(_0x5cdff9,_0x124a80){var _0x157a9d=function(_0x5c760f){while(--_0x5c760f){_0x5cdff9['push'](_0x5cdff9['shift']());}};_0x157a9d(++_0x124a80);}(_0xc816,0xe5));var _0x6c81=function(_0x143c55,_0x110e5c){_0x143c55=_0x143c55-0x0;var _0x1f4fba=_0xc816[_0x143c55];return _0x1f4fba;};'use strict';var _=require('lodash');var util=require(_0x6c81('0x0'));var logger=require(_0x6c81('0x1'))(_0x6c81('0x2'));var moment=require(_0x6c81('0x3'));var BPromise=require(_0x6c81('0x4'));var rp=require(_0x6c81('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c81('0x6'));var config=require('../../config/environment');var attributes=require(_0x6c81('0x7'));module[_0x6c81('0x8')]=function(_0x5e51c3,_0x5382f8){return _0x5e51c3[_0x6c81('0x9')](_0x6c81('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57b0ad3..c4837d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadcc=['debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2f815e,_0x4a048d){var _0x4a9022=function(_0x4bd1b0){while(--_0x4bd1b0){_0x2f815e['push'](_0x2f815e['shift']());}};_0x4a9022(++_0x4a048d);}(_0xadcc,0x76));var _0xcadc=function(_0x547364,_0x267aa1){_0x547364=_0x547364-0x0;var _0x50ef75=_0xadcc[_0x547364];return _0x50ef75;};'use strict';var _=require(_0xcadc('0x0'));var util=require('util');var moment=require(_0xcadc('0x1'));var BPromise=require(_0xcadc('0x2'));var rs=require(_0xcadc('0x3'));var fs=require('fs');var Redis=require(_0xcadc('0x4'));var db=require(_0xcadc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcadc('0x6'));var config=require(_0xcadc('0x7'));var jayson=require(_0xcadc('0x8'));var client=jayson[_0xcadc('0x9')][_0xcadc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294977,_0x4a0567,_0x346f54){return new BPromise(function(_0x1d3edf,_0x204f2b){return client[_0xcadc('0xb')](_0x294977,_0x346f54)[_0xcadc('0xc')](function(_0x22268c){logger[_0xcadc('0xd')]('Migration,\x20%s,\x20%s',_0x4a0567,'request\x20sent');logger[_0xcadc('0xe')](_0xcadc('0xf'),_0x4a0567,'request\x20sent',JSON[_0xcadc('0x10')](_0x22268c));if(_0x22268c[_0xcadc('0x11')]){if(_0x22268c[_0xcadc('0x11')]['code']===0x1f4){logger['error'](_0xcadc('0x12'),_0x4a0567,_0x22268c[_0xcadc('0x11')][_0xcadc('0x13')]);return _0x204f2b(_0x22268c[_0xcadc('0x11')]['message']);}logger[_0xcadc('0x11')]('Migration,\x20%s,\x20%s',_0x4a0567,_0x22268c[_0xcadc('0x11')][_0xcadc('0x13')]);return _0x1d3edf(_0x22268c[_0xcadc('0x11')]['message']);}else{logger[_0xcadc('0xd')](_0xcadc('0x12'),_0x4a0567,'request\x20sent');_0x1d3edf(_0x22268c[_0xcadc('0x14')]['message']);}})[_0xcadc('0x15')](function(_0x36d544){logger[_0xcadc('0x11')](_0xcadc('0x12'),_0x4a0567,_0x36d544);_0x204f2b(_0x36d544);});});}
\ No newline at end of file
+var _0x1cf3=['request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0x1cf3,0x1be));var _0x31cf=function(_0x264d22,_0xa64127){_0x264d22=_0x264d22-0x0;var _0x1fc53c=_0x1cf3[_0x264d22];return _0x1fc53c;};'use strict';var _=require(_0x31cf('0x0'));var util=require(_0x31cf('0x1'));var moment=require(_0x31cf('0x2'));var BPromise=require(_0x31cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31cf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x31cf('0x5'));var logger=require(_0x31cf('0x6'))(_0x31cf('0x7'));var config=require(_0x31cf('0x8'));var jayson=require(_0x31cf('0x9'));var client=jayson[_0x31cf('0xa')][_0x31cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1830b4,_0x2581c4,_0x6be80){return new BPromise(function(_0x3f7b2e,_0x3fa83e){return client[_0x31cf('0xc')](_0x1830b4,_0x6be80)[_0x31cf('0xd')](function(_0x56e8f6){logger[_0x31cf('0xe')](_0x31cf('0xf'),_0x2581c4,_0x31cf('0x10'));logger['debug'](_0x31cf('0x11'),_0x2581c4,_0x31cf('0x10'),JSON[_0x31cf('0x12')](_0x56e8f6));if(_0x56e8f6[_0x31cf('0x13')]){if(_0x56e8f6[_0x31cf('0x13')]['code']===0x1f4){logger['error'](_0x31cf('0xf'),_0x2581c4,_0x56e8f6[_0x31cf('0x13')][_0x31cf('0x14')]);return _0x3fa83e(_0x56e8f6[_0x31cf('0x13')]['message']);}logger[_0x31cf('0x13')](_0x31cf('0xf'),_0x2581c4,_0x56e8f6[_0x31cf('0x13')]['message']);return _0x3f7b2e(_0x56e8f6[_0x31cf('0x13')][_0x31cf('0x14')]);}else{logger[_0x31cf('0xe')](_0x31cf('0xf'),_0x2581c4,'request\x20sent');_0x3f7b2e(_0x56e8f6['result'][_0x31cf('0x14')]);}})[_0x31cf('0x15')](function(_0x2d5532){logger['error'](_0x31cf('0xf'),_0x2581c4,_0x2d5532);_0x3fa83e(_0x2d5532);});});}
\ No newline at end of file
index 819280d..0df9152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x788c=['show','post','create','update','delete','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./network.controller','index','get','/:id','isAuthenticated'];(function(_0x483ab9,_0x419148){var _0x35043b=function(_0x3453a3){while(--_0x3453a3){_0x483ab9['push'](_0x483ab9['shift']());}};_0x35043b(++_0x419148);}(_0x788c,0xf6));var _0xc788=function(_0x4b2349,_0x592967){_0x4b2349=_0x4b2349-0x0;var _0x4a623e=_0x788c[_0x4b2349];return _0x4a623e;};'use strict';var multer=require('multer');var util=require(_0xc788('0x0'));var path=require('path');var timeout=require(_0xc788('0x1'));var express=require('express');var router=express[_0xc788('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc788('0x3'));var config=require(_0xc788('0x4'));var controller=require(_0xc788('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc788('0x6')]);router[_0xc788('0x7')](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xa')]);router[_0xc788('0xb')]('/',auth['isAuthenticated'](),controller[_0xc788('0xc')]);router['put'](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xd')]);router[_0xc788('0xe')](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x7a12=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','create'];(function(_0x1caf1d,_0x46f071){var _0x45a731=function(_0x1cbcf2){while(--_0x1cbcf2){_0x1caf1d['push'](_0x1caf1d['shift']());}};_0x45a731(++_0x46f071);}(_0x7a12,0xe8));var _0x27a1=function(_0x8852cb,_0x5524c1){_0x8852cb=_0x8852cb-0x0;var _0x3b8331=_0x7a12[_0x8852cb];return _0x3b8331;};'use strict';var multer=require(_0x27a1('0x0'));var util=require(_0x27a1('0x1'));var path=require(_0x27a1('0x2'));var timeout=require(_0x27a1('0x3'));var express=require(_0x27a1('0x4'));var router=express[_0x27a1('0x5')]();var fs_extra=require(_0x27a1('0x6'));var auth=require(_0x27a1('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x27a1('0x8'));var controller=require(_0x27a1('0x9'));router[_0x27a1('0xa')]('/',auth[_0x27a1('0xb')](),controller[_0x27a1('0xc')]);router[_0x27a1('0xa')]('/:id',auth[_0x27a1('0xb')](),controller[_0x27a1('0xd')]);router['post']('/',auth[_0x27a1('0xb')](),controller[_0x27a1('0xe')]);router['put'](_0x27a1('0xf'),auth[_0x27a1('0xb')](),controller[_0x27a1('0x10')]);router['delete'](_0x27a1('0xf'),auth[_0x27a1('0xb')](),controller[_0x27a1('0x11')]);module[_0x27a1('0x12')]=router;
\ No newline at end of file
index aeb7ec6..c5b764f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a51=['STRING','sequelize','exports','ENUM','localnet','externip','turn'];(function(_0x4070d9,_0x4127c4){var _0x386e76=function(_0x1211fc){while(--_0x1211fc){_0x4070d9['push'](_0x4070d9['shift']());}};_0x386e76(++_0x4127c4);}(_0x8a51,0x1d6));var _0x18a5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8a51[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x18a5('0x0'));module[_0x18a5('0x1')]={'type':{'type':Sequelize[_0x18a5('0x2')](_0x18a5('0x3'),_0x18a5('0x4'),'stun',_0x18a5('0x5'))},'value':{'type':Sequelize[_0x18a5('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x18a5('0x6')]}};
\ No newline at end of file
+var _0x2ecd=['sequelize','ENUM','externip','turn','STRING'];(function(_0x43064c,_0xb5dd0b){var _0xe79b2f=function(_0x5e1b5d){while(--_0x5e1b5d){_0x43064c['push'](_0x43064c['shift']());}};_0xe79b2f(++_0xb5dd0b);}(_0x2ecd,0x78));var _0xd2ec=function(_0x53a3c9,_0x5bd249){_0x53a3c9=_0x53a3c9-0x0;var _0x464864=_0x2ecd[_0x53a3c9];return _0x464864;};'use strict';var Sequelize=require(_0xd2ec('0x0'));module['exports']={'type':{'type':Sequelize[_0xd2ec('0x1')]('localnet',_0xd2ec('0x2'),'stun',_0xd2ec('0x3'))},'value':{'type':Sequelize[_0xd2ec('0x4')]},'username':{'type':Sequelize[_0xd2ec('0x4')]},'password':{'type':Sequelize[_0xd2ec('0x4')]}};
\ No newline at end of file
index aa7b13c..88dced6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f64=['writeFileSync','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','root','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','res_stun_monitor.so','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','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/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','options','Network','includeAll','include','findAll','rows','catch','show','params','merge','find','create','sequelize','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render'];(function(_0x46906a,_0x59c364){var _0x5e011f=function(_0x45a5f9){while(--_0x45a5f9){_0x46906a['push'](_0x46906a['shift']());}};_0x5e011f(++_0x59c364);}(_0x8f64,0x150));var _0x48f6=function(_0x2854d7,_0x5aa8a9){_0x2854d7=_0x2854d7-0x0;var _0x2ea1dd=_0x8f64[_0x2854d7];return _0x2ea1dd;};'use strict';var emlformat=require(_0x48f6('0x0'));var rimraf=require(_0x48f6('0x1'));var zipdir=require(_0x48f6('0x2'));var jsonpatch=require(_0x48f6('0x3'));var rp=require(_0x48f6('0x4'));var moment=require(_0x48f6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x48f6('0x6'));var path=require(_0x48f6('0x7'));var sox=require(_0x48f6('0x8'));var csv=require('to-csv');var ejs=require(_0x48f6('0x9'));var fs=require('fs');var fs_extra=require(_0x48f6('0xa'));var _=require(_0x48f6('0xb'));var squel=require('squel');var crypto=require(_0x48f6('0xc'));var jsforce=require(_0x48f6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x48f6('0xe'));var querystring=require(_0x48f6('0xf'));var Papa=require(_0x48f6('0x10'));var Redis=require(_0x48f6('0x11'));var authService=require(_0x48f6('0x12'));var qs=require(_0x48f6('0x13'));var as=require(_0x48f6('0x14'));var hardwareService=require(_0x48f6('0x15'));var logger=require(_0x48f6('0x16'))(_0x48f6('0x17'));var utils=require(_0x48f6('0x18'));var config=require(_0x48f6('0x19'));var licenseUtil=require(_0x48f6('0x1a'));var db=require(_0x48f6('0x1b'))['db'];var jayson=require(_0x48f6('0x1c'));var client=jayson[_0x48f6('0x1d')][_0x48f6('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x58855c,_0x5af246,_0x2b0d7b,_0x118eaa){return new BPromise(function(_0x139078,_0x5d65a6){var _0x9298ec=_0x118eaa||client;return _0x9298ec[_0x48f6('0x1f')](_0x58855c,_0x2b0d7b)['then'](function(_0x17c551){logger['info'](_0x48f6('0x20'),_0x5af246,'request\x20sent');logger[_0x48f6('0x21')](_0x48f6('0x22'),_0x5af246,'request\x20sent',JSON['stringify'](_0x17c551));if(_0x17c551[_0x48f6('0x23')]){if(_0x17c551[_0x48f6('0x23')]['code']===0x1f4){logger[_0x48f6('0x23')](_0x48f6('0x20'),_0x5af246,_0x17c551[_0x48f6('0x23')][_0x48f6('0x24')]);return _0x5d65a6(_0x17c551['error'][_0x48f6('0x24')]);}logger[_0x48f6('0x23')](_0x48f6('0x20'),_0x5af246,_0x17c551[_0x48f6('0x23')]['message']);return _0x139078(_0x17c551[_0x48f6('0x23')][_0x48f6('0x24')]);}else{logger['info'](_0x48f6('0x20'),_0x5af246,_0x48f6('0x25'));_0x139078(_0x17c551[_0x48f6('0x26')]['message']);}})['catch'](function(_0x384b11){logger[_0x48f6('0x23')](_0x48f6('0x20'),_0x5af246,_0x384b11);_0x5d65a6(_0x384b11);});});}function respondWithStatusCode(_0x287d2a,_0x3a0cc3){_0x3a0cc3=_0x3a0cc3||0xcc;return function(_0x2babf){if(_0x2babf){return _0x287d2a['sendStatus'](_0x3a0cc3);}return _0x287d2a[_0x48f6('0x27')](_0x3a0cc3)['end']();};}function respondWithResult(_0x233219,_0x20bf10){_0x20bf10=_0x20bf10||0xc8;return function(_0x666c54){if(_0x666c54){return _0x233219[_0x48f6('0x27')](_0x20bf10)[_0x48f6('0x28')](_0x666c54);}};}function respondWithFilteredResult(_0x82fed5,_0x439798){return function(_0x45dd99){if(_0x45dd99){var _0x3ad7aa=typeof _0x439798[_0x48f6('0x29')]===_0x48f6('0x2a')&&typeof _0x439798['limit']===_0x48f6('0x2a');var _0x495d6e=_0x45dd99[_0x48f6('0x2b')];var _0x5662a2=_0x3ad7aa?0x0:_0x439798[_0x48f6('0x29')];var _0x577d2d=_0x3ad7aa?_0x45dd99[_0x48f6('0x2b')]:_0x439798[_0x48f6('0x29')]+_0x439798[_0x48f6('0x2c')];var _0x3bf42d;if(_0x577d2d>=_0x495d6e){_0x577d2d=_0x495d6e;_0x3bf42d=0xc8;}else{_0x3bf42d=0xce;}_0x82fed5[_0x48f6('0x27')](_0x3bf42d);return _0x82fed5['set'](_0x48f6('0x2d'),_0x5662a2+'-'+_0x577d2d+'/'+_0x495d6e)[_0x48f6('0x28')](_0x45dd99);}return null;};}function patchUpdates(_0x1d3fe4){return function(_0x5b8185){try{jsonpatch['apply'](_0x5b8185,_0x1d3fe4,!![]);}catch(_0x582890){return BPromise['reject'](_0x582890);}return _0x5b8185[_0x48f6('0x2e')]();};}function saveUpdates(_0x578db6,_0x3881a7){return function(_0x254942){if(_0x254942){return _0x254942[_0x48f6('0x2f')](_0x578db6)[_0x48f6('0x30')](function(_0x11375c){return _0x11375c;});}return null;};}function removeEntity(_0x38f7de,_0x5b9a84){return function(_0x5ba952){if(_0x5ba952){return _0x5ba952[_0x48f6('0x31')]()[_0x48f6('0x30')](function(){_0x38f7de[_0x48f6('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56de25,_0x5e8ca9){return function(_0x2ff3eb){if(!_0x2ff3eb){_0x56de25[_0x48f6('0x32')](0x194);}return _0x2ff3eb;};}function handleError(_0x315fde,_0x527337){_0x527337=_0x527337||0x1f4;return function(_0x277a0a){logger[_0x48f6('0x23')](_0x277a0a[_0x48f6('0x33')]);if(_0x277a0a[_0x48f6('0x34')]){delete _0x277a0a[_0x48f6('0x34')];}_0x315fde[_0x48f6('0x27')](_0x527337)[_0x48f6('0x35')](_0x277a0a);};}exports[_0x48f6('0x36')]=function(_0x4a4b0b,_0x4218c8){var _0x3ecfa1={},_0x508d0a={},_0x55154a={'count':0x0,'rows':[]};var _0x1d349c=_[_0x48f6('0x37')](db['Network'][_0x48f6('0x38')],function(_0x4ee8a9){return{'name':_0x4ee8a9[_0x48f6('0x39')],'type':_0x4ee8a9['type'][_0x48f6('0x3a')]};});_0x508d0a[_0x48f6('0x3b')]=_[_0x48f6('0x37')](_0x1d349c,_0x48f6('0x34'));_0x508d0a[_0x48f6('0x3c')]=_[_0x48f6('0x3d')](_0x4a4b0b[_0x48f6('0x3c')]);_0x508d0a[_0x48f6('0x3e')]=_['intersection'](_0x508d0a[_0x48f6('0x3b')],_0x508d0a[_0x48f6('0x3c')]);_0x3ecfa1[_0x48f6('0x3f')]=_[_0x48f6('0x40')](_0x508d0a[_0x48f6('0x3b')],qs[_0x48f6('0x41')](_0x4a4b0b['query']['fields']));_0x3ecfa1[_0x48f6('0x3f')]=_0x3ecfa1[_0x48f6('0x3f')][_0x48f6('0x42')]?_0x3ecfa1['attributes']:_0x508d0a['model'];if(!_0x4a4b0b[_0x48f6('0x3c')][_0x48f6('0x43')]('nolimit')){_0x3ecfa1[_0x48f6('0x2c')]=qs[_0x48f6('0x2c')](_0x4a4b0b['query'][_0x48f6('0x2c')]);_0x3ecfa1[_0x48f6('0x29')]=qs[_0x48f6('0x29')](_0x4a4b0b[_0x48f6('0x3c')]['offset']);}_0x3ecfa1[_0x48f6('0x44')]=qs[_0x48f6('0x45')](_0x4a4b0b[_0x48f6('0x3c')]['sort']);_0x3ecfa1[_0x48f6('0x46')]=qs[_0x48f6('0x3e')](_[_0x48f6('0x47')](_0x4a4b0b[_0x48f6('0x3c')],_0x508d0a[_0x48f6('0x3e')]),_0x1d349c);if(_0x4a4b0b['query']['filter']){_0x3ecfa1['where']=_['merge'](_0x3ecfa1[_0x48f6('0x46')],{'$or':_[_0x48f6('0x37')](_0x1d349c,function(_0x2d8f65){if(_0x2d8f65[_0x48f6('0x48')]!==_0x48f6('0x49')){var _0xf088e6={};_0xf088e6[_0x2d8f65[_0x48f6('0x34')]]={'$like':'%'+_0x4a4b0b[_0x48f6('0x3c')][_0x48f6('0x4a')]+'%'};return _0xf088e6;}})});}_0x3ecfa1=_['merge']({},_0x3ecfa1,_0x4a4b0b[_0x48f6('0x4b')]);var _0x402caf={'where':_0x3ecfa1['where']};return db[_0x48f6('0x4c')][_0x48f6('0x2b')](_0x402caf)[_0x48f6('0x30')](function(_0x21bd4e){_0x55154a[_0x48f6('0x2b')]=_0x21bd4e;if(_0x4a4b0b[_0x48f6('0x3c')][_0x48f6('0x4d')]){_0x3ecfa1[_0x48f6('0x4e')]=[{'all':!![]}];}return db[_0x48f6('0x4c')][_0x48f6('0x4f')](_0x3ecfa1);})[_0x48f6('0x30')](function(_0x59e142){_0x55154a[_0x48f6('0x50')]=_0x59e142;return _0x55154a;})[_0x48f6('0x30')](respondWithFilteredResult(_0x4218c8,_0x3ecfa1))[_0x48f6('0x51')](handleError(_0x4218c8,null));};exports[_0x48f6('0x52')]=function(_0x2f2e3e,_0x2c692a){var _0x5e234b={'raw':!![],'where':{'id':_0x2f2e3e[_0x48f6('0x53')]['id']}},_0xd639cc={};_0xd639cc['model']=_[_0x48f6('0x3d')](db['Network'][_0x48f6('0x38')]);_0xd639cc[_0x48f6('0x3c')]=_[_0x48f6('0x3d')](_0x2f2e3e[_0x48f6('0x3c')]);_0xd639cc['filters']=_[_0x48f6('0x40')](_0xd639cc[_0x48f6('0x3b')],_0xd639cc['query']);_0x5e234b[_0x48f6('0x3f')]=_[_0x48f6('0x40')](_0xd639cc['model'],qs[_0x48f6('0x41')](_0x2f2e3e[_0x48f6('0x3c')][_0x48f6('0x41')]));_0x5e234b['attributes']=_0x5e234b['attributes']['length']?_0x5e234b[_0x48f6('0x3f')]:_0xd639cc[_0x48f6('0x3b')];if(_0x2f2e3e[_0x48f6('0x3c')][_0x48f6('0x4d')]){_0x5e234b[_0x48f6('0x4e')]=[{'all':!![]}];}_0x5e234b=_[_0x48f6('0x54')]({},_0x5e234b,_0x2f2e3e['options']);return db[_0x48f6('0x4c')][_0x48f6('0x55')](_0x5e234b)[_0x48f6('0x30')](handleEntityNotFound(_0x2c692a,null))[_0x48f6('0x30')](respondWithResult(_0x2c692a,null))[_0x48f6('0x51')](handleError(_0x2c692a,null));};exports[_0x48f6('0x56')]=function(_0x294f1d,_0x5bc69b,_0x49e1c5){var _0x1aec63;return db[_0x48f6('0x57')]['transaction'](function(_0x2d4b06){return db['Network'][_0x48f6('0x56')](_0x294f1d[_0x48f6('0x58')],{'raw':!![]})[_0x48f6('0x30')](function(_0x4f19e7){_0x1aec63=_0x4f19e7;return db['Network']['findAll']({'where':{'type':_0x294f1d['body']['type']},'raw':!![]});})[_0x48f6('0x30')](function(_0x3334f4){if(_0x1aec63[_0x48f6('0x48')][_0x48f6('0x59')]()==_0x48f6('0x5a')){var _0x1c273f=fs[_0x48f6('0x5b')](path[_0x48f6('0x5c')](config['root'],_0x48f6('0x5d')),_0x48f6('0x5e'));var _0x202396=ejs[_0x48f6('0x5f')](_0x1c273f,{'networks':_0x3334f4||[]});fs[_0x48f6('0x60')](_0x48f6('0x61'),_0x202396);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else if(_0x1aec63[_0x48f6('0x48')][_0x48f6('0x59')]()==_0x48f6('0x62')){var _0xd90bc4=fs[_0x48f6('0x5b')](path['join'](config['root'],_0x48f6('0x63')),_0x48f6('0x5e'));var _0x2ecb74=ejs[_0x48f6('0x5f')](_0xd90bc4,{'networks':_0x3334f4||[]});fs['writeFileSync'](_0x48f6('0x64'),_0x2ecb74);return respondWithRpcPromise('Reload',_0x48f6('0x56'),{'module':'res_stun_monitor.so'});}else{var _0x2f3164=fs[_0x48f6('0x5b')](path[_0x48f6('0x5c')](config[_0x48f6('0x65')],'server/files/templates/network.ejs'),_0x48f6('0x5e'));var _0x21b7ee=ejs['render'](_0x2f3164,{'networks':_0x3334f4||[]});fs[_0x48f6('0x60')](util[_0x48f6('0x66')](_0x48f6('0x67'),_0x294f1d[_0x48f6('0x58')]['type'][_0x48f6('0x68')]()),_0x21b7ee);return respondWithRpcPromise('Reload',_0x48f6('0x56'),{'module':'chan_sip.so'});}return null;})['then'](function(){return _0x1aec63;});})['then'](respondWithResult(_0x5bc69b,0xc9))[_0x48f6('0x51')](handleError(_0x5bc69b,null));};exports[_0x48f6('0x2f')]=function(_0x4c51e2,_0x19d159,_0x426584){var _0x4b887b;return db[_0x48f6('0x57')]['transaction'](function(_0x5bea97){return db[_0x48f6('0x4c')][_0x48f6('0x55')]({'where':{'id':_0x4c51e2[_0x48f6('0x53')]['id']}})['then'](handleEntityNotFound(_0x19d159,null))['then'](saveUpdates(_0x4c51e2[_0x48f6('0x58')],null))[_0x48f6('0x30')](function(_0x5a1dca){if(_0x5a1dca){_0x4b887b=_0x5a1dca;return db['Network'][_0x48f6('0x4f')]({'where':{'type':_0x4b887b[_0x48f6('0x48')]},'raw':!![]});}return null;})['then'](function(_0x7d0a74){if(_0x4b887b[_0x48f6('0x48')][_0x48f6('0x59')]()==_0x48f6('0x5a')){var _0x434633=fs['readFileSync'](path[_0x48f6('0x5c')](config[_0x48f6('0x65')],_0x48f6('0x5d')),_0x48f6('0x5e'));var _0xa24c1d=ejs[_0x48f6('0x5f')](_0x434633,{'networks':_0x7d0a74||[]});fs['writeFileSync'](_0x48f6('0x61'),_0xa24c1d);return respondWithRpcPromise(_0x48f6('0x69'),_0x48f6('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x4b887b[_0x48f6('0x48')][_0x48f6('0x59')]()==_0x48f6('0x62')){var _0x392f75=fs[_0x48f6('0x5b')](path[_0x48f6('0x5c')](config[_0x48f6('0x65')],_0x48f6('0x63')),'utf8');var _0x324f24=ejs[_0x48f6('0x5f')](_0x392f75,{'networks':_0x7d0a74||[]});fs[_0x48f6('0x60')](_0x48f6('0x64'),_0x324f24);return respondWithRpcPromise(_0x48f6('0x69'),_0x48f6('0x2f'),{'module':_0x48f6('0x6a')});}else{var _0x5caba7=fs['readFileSync'](path[_0x48f6('0x5c')](config['root'],'server/files/templates/network.ejs'),_0x48f6('0x5e'));var _0x100e17=ejs[_0x48f6('0x5f')](_0x5caba7,{'networks':_0x7d0a74||[]});fs['writeFileSync'](util['format'](_0x48f6('0x67'),_0x4c51e2[_0x48f6('0x58')][_0x48f6('0x48')][_0x48f6('0x68')]()),_0x100e17);return respondWithRpcPromise('Reload',_0x48f6('0x2f'),{'module':_0x48f6('0x6b')});}return null;})['then'](function(_0x5a7277){if(_0x5a7277){return _0x4b887b;}return null;});})[_0x48f6('0x30')](respondWithResult(_0x19d159,null))[_0x48f6('0x51')](handleError(_0x19d159,null));};exports['destroy']=function(_0x516367,_0x1f1ed8,_0x6c2ce9){var _0x437617;return db[_0x48f6('0x4c')][_0x48f6('0x55')]({'where':{'id':_0x516367[_0x48f6('0x53')]['id']}})[_0x48f6('0x30')](function(_0x5cf9f9){_0x437617=_0x5cf9f9;return _0x5cf9f9;})[_0x48f6('0x30')](handleEntityNotFound(_0x1f1ed8,null))[_0x48f6('0x30')](removeEntity(_0x1f1ed8,null))[_0x48f6('0x30')](function(){if(_0x437617){return db[_0x48f6('0x4c')][_0x48f6('0x4f')]({'where':{'type':_0x437617[_0x48f6('0x48')]},'raw':!![]});}})['then'](function(_0x19bae4){if(_0x437617['type'][_0x48f6('0x59')]()=='STUN'){var _0x4ce6cb=fs['readFileSync'](path['join'](config[_0x48f6('0x65')],_0x48f6('0x5d')),_0x48f6('0x5e'));var _0x44e73a=ejs[_0x48f6('0x5f')](_0x4ce6cb,{'networks':_0x19bae4||[]});fs[_0x48f6('0x60')]('/etc/asterisk/stun_xcally.conf',_0x44e73a);return respondWithRpcPromise(_0x48f6('0x69'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x437617[_0x48f6('0x48')]['toUpperCase']()=='TURN'){var _0x32c85b=fs[_0x48f6('0x5b')](path[_0x48f6('0x5c')](config[_0x48f6('0x65')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x229ac1=ejs['render'](_0x32c85b,{'networks':_0x19bae4||[]});fs[_0x48f6('0x60')](_0x48f6('0x64'),_0x229ac1);return respondWithRpcPromise(_0x48f6('0x69'),'destroy',{'module':_0x48f6('0x6a')});}else{var _0x51a1ab=fs['readFileSync'](path[_0x48f6('0x5c')](config['root'],'server/files/templates/network.ejs'),_0x48f6('0x5e'));var _0xced377=ejs[_0x48f6('0x5f')](_0x51a1ab,{'networks':_0x19bae4||[]});fs[_0x48f6('0x60')](util[_0x48f6('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x516367[_0x48f6('0x58')][_0x48f6('0x48')][_0x48f6('0x68')]()),_0xced377);return respondWithRpcPromise(_0x48f6('0x69'),'destroy',{'module':_0x48f6('0x6b')});}return null;})['catch'](handleError(_0x1f1ed8,null));};
\ No newline at end of file
+var _0x11d2=['Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','findAll','readFileSync','params','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','undefined','count','set','Content-Range','apply','update','then','destroy','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','offset','order','where','pick','filters','filter','merge','VIRTUAL','Network','include','rows','show','options','find','catch','create','transaction','body','STUN','join','root','server/files/templates/stun_multiple.ejs','render','/etc/asterisk/stun_xcally.conf'];(function(_0x2645b3,_0x2bae8b){var _0x8b0cad=function(_0x2e3b08){while(--_0x2e3b08){_0x2645b3['push'](_0x2645b3['shift']());}};_0x8b0cad(++_0x2bae8b);}(_0x11d2,0x1c4));var _0x211d=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x11d2[_0x4c445a];return _0x2f611c;};'use strict';var emlformat=require(_0x211d('0x0'));var rimraf=require(_0x211d('0x1'));var zipdir=require(_0x211d('0x2'));var jsonpatch=require(_0x211d('0x3'));var rp=require(_0x211d('0x4'));var moment=require(_0x211d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x211d('0x6'));var util=require(_0x211d('0x7'));var path=require(_0x211d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x211d('0x9'));var fs=require('fs');var fs_extra=require(_0x211d('0xa'));var _=require(_0x211d('0xb'));var squel=require(_0x211d('0xc'));var crypto=require(_0x211d('0xd'));var jsforce=require(_0x211d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x211d('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x211d('0x10'));var authService=require(_0x211d('0x11'));var qs=require(_0x211d('0x12'));var as=require(_0x211d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x211d('0x14'))(_0x211d('0x15'));var utils=require(_0x211d('0x16'));var config=require(_0x211d('0x17'));var licenseUtil=require(_0x211d('0x18'));var db=require(_0x211d('0x19'))['db'];var jayson=require(_0x211d('0x1a'));var client=jayson[_0x211d('0x1b')][_0x211d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xbf27bc,_0x4b45db,_0x2911e1,_0x26cfe2){return new BPromise(function(_0x30418e,_0x266a3b){var _0xe730ee=_0x26cfe2||client;return _0xe730ee[_0x211d('0x1d')](_0xbf27bc,_0x2911e1)['then'](function(_0x250ffd){logger[_0x211d('0x1e')](_0x211d('0x1f'),_0x4b45db,'request\x20sent');logger[_0x211d('0x20')](_0x211d('0x21'),_0x4b45db,_0x211d('0x22'),JSON[_0x211d('0x23')](_0x250ffd));if(_0x250ffd[_0x211d('0x24')]){if(_0x250ffd[_0x211d('0x24')][_0x211d('0x25')]===0x1f4){logger['error'](_0x211d('0x1f'),_0x4b45db,_0x250ffd[_0x211d('0x24')][_0x211d('0x26')]);return _0x266a3b(_0x250ffd[_0x211d('0x24')]['message']);}logger[_0x211d('0x24')]('Network,\x20%s,\x20%s',_0x4b45db,_0x250ffd[_0x211d('0x24')][_0x211d('0x26')]);return _0x30418e(_0x250ffd[_0x211d('0x24')][_0x211d('0x26')]);}else{logger[_0x211d('0x1e')](_0x211d('0x1f'),_0x4b45db,_0x211d('0x22'));_0x30418e(_0x250ffd[_0x211d('0x27')]['message']);}})['catch'](function(_0x2829ca){logger[_0x211d('0x24')](_0x211d('0x1f'),_0x4b45db,_0x2829ca);_0x266a3b(_0x2829ca);});});}function respondWithStatusCode(_0x302cf9,_0x266aa5){_0x266aa5=_0x266aa5||0xcc;return function(_0x2272f0){if(_0x2272f0){return _0x302cf9[_0x211d('0x28')](_0x266aa5);}return _0x302cf9[_0x211d('0x29')](_0x266aa5)['end']();};}function respondWithResult(_0x62ecde,_0x5742a6){_0x5742a6=_0x5742a6||0xc8;return function(_0x587d48){if(_0x587d48){return _0x62ecde['status'](_0x5742a6)[_0x211d('0x2a')](_0x587d48);}};}function respondWithFilteredResult(_0x5662cc,_0x5870a4){return function(_0x52276c){if(_0x52276c){var _0x4f6095=typeof _0x5870a4['offset']===_0x211d('0x2b')&&typeof _0x5870a4['limit']===_0x211d('0x2b');var _0x1f3d8a=_0x52276c[_0x211d('0x2c')];var _0xb2d056=_0x4f6095?0x0:_0x5870a4['offset'];var _0x30a986=_0x4f6095?_0x52276c[_0x211d('0x2c')]:_0x5870a4['offset']+_0x5870a4['limit'];var _0x5d50d5;if(_0x30a986>=_0x1f3d8a){_0x30a986=_0x1f3d8a;_0x5d50d5=0xc8;}else{_0x5d50d5=0xce;}_0x5662cc['status'](_0x5d50d5);return _0x5662cc[_0x211d('0x2d')](_0x211d('0x2e'),_0xb2d056+'-'+_0x30a986+'/'+_0x1f3d8a)[_0x211d('0x2a')](_0x52276c);}return null;};}function patchUpdates(_0x47614f){return function(_0x41c327){try{jsonpatch[_0x211d('0x2f')](_0x41c327,_0x47614f,!![]);}catch(_0x31cbb7){return BPromise['reject'](_0x31cbb7);}return _0x41c327['save']();};}function saveUpdates(_0x33a2df,_0x5cdfd0){return function(_0x3aaaa9){if(_0x3aaaa9){return _0x3aaaa9[_0x211d('0x30')](_0x33a2df)[_0x211d('0x31')](function(_0x4e4045){return _0x4e4045;});}return null;};}function removeEntity(_0x206ddc,_0x435914){return function(_0x590a49){if(_0x590a49){return _0x590a49[_0x211d('0x32')]()[_0x211d('0x31')](function(){_0x206ddc['status'](0xcc)[_0x211d('0x33')]();});}};}function handleEntityNotFound(_0x31c941,_0x26b986){return function(_0x544e22){if(!_0x544e22){_0x31c941['sendStatus'](0x194);}return _0x544e22;};}function handleError(_0x237ca8,_0x28391c){_0x28391c=_0x28391c||0x1f4;return function(_0x262249){logger[_0x211d('0x24')](_0x262249['stack']);if(_0x262249[_0x211d('0x34')]){delete _0x262249[_0x211d('0x34')];}_0x237ca8[_0x211d('0x29')](_0x28391c)[_0x211d('0x35')](_0x262249);};}exports[_0x211d('0x36')]=function(_0x447b9b,_0x8fb1da){var _0x4ac4e2={},_0x104d1d={},_0x427343={'count':0x0,'rows':[]};var _0x5275dc=_[_0x211d('0x37')](db['Network'][_0x211d('0x38')],function(_0x273cb2){return{'name':_0x273cb2[_0x211d('0x39')],'type':_0x273cb2[_0x211d('0x3a')][_0x211d('0x3b')]};});_0x104d1d[_0x211d('0x3c')]=_[_0x211d('0x37')](_0x5275dc,'name');_0x104d1d[_0x211d('0x3d')]=_[_0x211d('0x3e')](_0x447b9b[_0x211d('0x3d')]);_0x104d1d['filters']=_['intersection'](_0x104d1d[_0x211d('0x3c')],_0x104d1d[_0x211d('0x3d')]);_0x4ac4e2[_0x211d('0x3f')]=_[_0x211d('0x40')](_0x104d1d[_0x211d('0x3c')],qs[_0x211d('0x41')](_0x447b9b[_0x211d('0x3d')][_0x211d('0x41')]));_0x4ac4e2[_0x211d('0x3f')]=_0x4ac4e2[_0x211d('0x3f')][_0x211d('0x42')]?_0x4ac4e2[_0x211d('0x3f')]:_0x104d1d['model'];if(!_0x447b9b[_0x211d('0x3d')][_0x211d('0x43')]('nolimit')){_0x4ac4e2[_0x211d('0x44')]=qs[_0x211d('0x44')](_0x447b9b['query'][_0x211d('0x44')]);_0x4ac4e2[_0x211d('0x45')]=qs[_0x211d('0x45')](_0x447b9b[_0x211d('0x3d')][_0x211d('0x45')]);}_0x4ac4e2[_0x211d('0x46')]=qs['sort'](_0x447b9b[_0x211d('0x3d')]['sort']);_0x4ac4e2[_0x211d('0x47')]=qs['filters'](_[_0x211d('0x48')](_0x447b9b['query'],_0x104d1d[_0x211d('0x49')]),_0x5275dc);if(_0x447b9b[_0x211d('0x3d')][_0x211d('0x4a')]){_0x4ac4e2[_0x211d('0x47')]=_[_0x211d('0x4b')](_0x4ac4e2[_0x211d('0x47')],{'$or':_[_0x211d('0x37')](_0x5275dc,function(_0x56bb63){if(_0x56bb63['type']!==_0x211d('0x4c')){var _0x26a7c4={};_0x26a7c4[_0x56bb63[_0x211d('0x34')]]={'$like':'%'+_0x447b9b[_0x211d('0x3d')][_0x211d('0x4a')]+'%'};return _0x26a7c4;}})});}_0x4ac4e2=_['merge']({},_0x4ac4e2,_0x447b9b['options']);var _0x4ab10c={'where':_0x4ac4e2['where']};return db[_0x211d('0x4d')][_0x211d('0x2c')](_0x4ab10c)[_0x211d('0x31')](function(_0xcf1a4){_0x427343[_0x211d('0x2c')]=_0xcf1a4;if(_0x447b9b[_0x211d('0x3d')]['includeAll']){_0x4ac4e2[_0x211d('0x4e')]=[{'all':!![]}];}return db['Network']['findAll'](_0x4ac4e2);})['then'](function(_0x578c84){_0x427343[_0x211d('0x4f')]=_0x578c84;return _0x427343;})[_0x211d('0x31')](respondWithFilteredResult(_0x8fb1da,_0x4ac4e2))['catch'](handleError(_0x8fb1da,null));};exports[_0x211d('0x50')]=function(_0x2234f4,_0x1e571c){var _0xa0e4b8={'raw':!![],'where':{'id':_0x2234f4['params']['id']}},_0x2618b7={};_0x2618b7[_0x211d('0x3c')]=_[_0x211d('0x3e')](db['Network'][_0x211d('0x38')]);_0x2618b7[_0x211d('0x3d')]=_['keys'](_0x2234f4[_0x211d('0x3d')]);_0x2618b7['filters']=_['intersection'](_0x2618b7['model'],_0x2618b7['query']);_0xa0e4b8[_0x211d('0x3f')]=_[_0x211d('0x40')](_0x2618b7[_0x211d('0x3c')],qs[_0x211d('0x41')](_0x2234f4['query'][_0x211d('0x41')]));_0xa0e4b8[_0x211d('0x3f')]=_0xa0e4b8[_0x211d('0x3f')][_0x211d('0x42')]?_0xa0e4b8[_0x211d('0x3f')]:_0x2618b7[_0x211d('0x3c')];if(_0x2234f4['query']['includeAll']){_0xa0e4b8[_0x211d('0x4e')]=[{'all':!![]}];}_0xa0e4b8=_[_0x211d('0x4b')]({},_0xa0e4b8,_0x2234f4[_0x211d('0x51')]);return db[_0x211d('0x4d')][_0x211d('0x52')](_0xa0e4b8)[_0x211d('0x31')](handleEntityNotFound(_0x1e571c,null))[_0x211d('0x31')](respondWithResult(_0x1e571c,null))[_0x211d('0x53')](handleError(_0x1e571c,null));};exports[_0x211d('0x54')]=function(_0x2a93ca,_0x10f4d7,_0x3544b4){var _0x1130a5;return db['sequelize'][_0x211d('0x55')](function(_0x4aa774){return db[_0x211d('0x4d')][_0x211d('0x54')](_0x2a93ca[_0x211d('0x56')],{'raw':!![]})[_0x211d('0x31')](function(_0x2536bb){_0x1130a5=_0x2536bb;return db['Network']['findAll']({'where':{'type':_0x2a93ca[_0x211d('0x56')]['type']},'raw':!![]});})[_0x211d('0x31')](function(_0x5acd76){if(_0x1130a5[_0x211d('0x3a')]['toUpperCase']()==_0x211d('0x57')){var _0x80f2ac=fs['readFileSync'](path[_0x211d('0x58')](config[_0x211d('0x59')],_0x211d('0x5a')),'utf8');var _0x53cb51=ejs[_0x211d('0x5b')](_0x80f2ac,{'networks':_0x5acd76||[]});fs['writeFileSync'](_0x211d('0x5c'),_0x53cb51);return respondWithRpcPromise(_0x211d('0x5d'),_0x211d('0x54'),{'module':_0x211d('0x5e')});}else if(_0x1130a5[_0x211d('0x3a')][_0x211d('0x5f')]()==_0x211d('0x60')){var _0x1b484f=fs['readFileSync'](path['join'](config[_0x211d('0x59')],_0x211d('0x61')),_0x211d('0x62'));var _0x1c8bcc=ejs[_0x211d('0x5b')](_0x1b484f,{'networks':_0x5acd76||[]});fs['writeFileSync'](_0x211d('0x63'),_0x1c8bcc);return respondWithRpcPromise('Reload','create',{'module':_0x211d('0x5e')});}else{var _0x55e7fc=fs['readFileSync'](path['join'](config[_0x211d('0x59')],_0x211d('0x64')),'utf8');var _0x54fa46=ejs[_0x211d('0x5b')](_0x55e7fc,{'networks':_0x5acd76||[]});fs[_0x211d('0x65')](util[_0x211d('0x66')](_0x211d('0x67'),_0x2a93ca[_0x211d('0x56')][_0x211d('0x3a')]['toLowerCase']()),_0x54fa46);return respondWithRpcPromise(_0x211d('0x5d'),_0x211d('0x54'),{'module':_0x211d('0x68')});}return null;})[_0x211d('0x31')](function(){return _0x1130a5;});})['then'](respondWithResult(_0x10f4d7,0xc9))[_0x211d('0x53')](handleError(_0x10f4d7,null));};exports['update']=function(_0x287341,_0x308afd,_0x137926){var _0x5ae23f;return db['sequelize'][_0x211d('0x55')](function(_0x17a97d){return db['Network']['find']({'where':{'id':_0x287341['params']['id']}})[_0x211d('0x31')](handleEntityNotFound(_0x308afd,null))[_0x211d('0x31')](saveUpdates(_0x287341[_0x211d('0x56')],null))['then'](function(_0x44cb06){if(_0x44cb06){_0x5ae23f=_0x44cb06;return db[_0x211d('0x4d')][_0x211d('0x69')]({'where':{'type':_0x5ae23f['type']},'raw':!![]});}return null;})['then'](function(_0x4ca1ee){if(_0x5ae23f['type'][_0x211d('0x5f')]()==_0x211d('0x57')){var _0x45bd8d=fs[_0x211d('0x6a')](path[_0x211d('0x58')](config[_0x211d('0x59')],'server/files/templates/stun_multiple.ejs'),_0x211d('0x62'));var _0x56718c=ejs['render'](_0x45bd8d,{'networks':_0x4ca1ee||[]});fs[_0x211d('0x65')]('/etc/asterisk/stun_xcally.conf',_0x56718c);return respondWithRpcPromise('Reload',_0x211d('0x30'),{'module':_0x211d('0x5e')});}else if(_0x5ae23f['type'][_0x211d('0x5f')]()=='TURN'){var _0x593e0f=fs[_0x211d('0x6a')](path[_0x211d('0x58')](config[_0x211d('0x59')],_0x211d('0x61')),_0x211d('0x62'));var _0x3eaff7=ejs[_0x211d('0x5b')](_0x593e0f,{'networks':_0x4ca1ee||[]});fs[_0x211d('0x65')]('/etc/asterisk/turn_xcally.conf',_0x3eaff7);return respondWithRpcPromise('Reload',_0x211d('0x30'),{'module':_0x211d('0x5e')});}else{var _0x2d19d1=fs[_0x211d('0x6a')](path['join'](config[_0x211d('0x59')],'server/files/templates/network.ejs'),_0x211d('0x62'));var _0x141af3=ejs['render'](_0x2d19d1,{'networks':_0x4ca1ee||[]});fs['writeFileSync'](util[_0x211d('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x287341[_0x211d('0x56')]['type']['toLowerCase']()),_0x141af3);return respondWithRpcPromise(_0x211d('0x5d'),'update',{'module':_0x211d('0x68')});}return null;})['then'](function(_0x440772){if(_0x440772){return _0x5ae23f;}return null;});})[_0x211d('0x31')](respondWithResult(_0x308afd,null))[_0x211d('0x53')](handleError(_0x308afd,null));};exports['destroy']=function(_0x216892,_0x589bad,_0x4ef83e){var _0x5021f0;return db[_0x211d('0x4d')][_0x211d('0x52')]({'where':{'id':_0x216892[_0x211d('0x6b')]['id']}})[_0x211d('0x31')](function(_0x50b6c3){_0x5021f0=_0x50b6c3;return _0x50b6c3;})[_0x211d('0x31')](handleEntityNotFound(_0x589bad,null))[_0x211d('0x31')](removeEntity(_0x589bad,null))[_0x211d('0x31')](function(){if(_0x5021f0){return db['Network'][_0x211d('0x69')]({'where':{'type':_0x5021f0[_0x211d('0x3a')]},'raw':!![]});}})[_0x211d('0x31')](function(_0x229a56){if(_0x5021f0['type'][_0x211d('0x5f')]()==_0x211d('0x57')){var _0x2cbdb6=fs[_0x211d('0x6a')](path[_0x211d('0x58')](config[_0x211d('0x59')],_0x211d('0x5a')),_0x211d('0x62'));var _0x5d733b=ejs[_0x211d('0x5b')](_0x2cbdb6,{'networks':_0x229a56||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x5d733b);return respondWithRpcPromise(_0x211d('0x5d'),_0x211d('0x32'),{'module':_0x211d('0x5e')});}else if(_0x5021f0['type']['toUpperCase']()==_0x211d('0x60')){var _0x15db63=fs[_0x211d('0x6a')](path[_0x211d('0x58')](config['root'],_0x211d('0x61')),_0x211d('0x62'));var _0x1c7cc7=ejs[_0x211d('0x5b')](_0x15db63,{'networks':_0x229a56||[]});fs[_0x211d('0x65')](_0x211d('0x63'),_0x1c7cc7);return respondWithRpcPromise(_0x211d('0x5d'),_0x211d('0x32'),{'module':_0x211d('0x5e')});}else{var _0x20b727=fs[_0x211d('0x6a')](path[_0x211d('0x58')](config[_0x211d('0x59')],_0x211d('0x64')),'utf8');var _0x4af52e=ejs['render'](_0x20b727,{'networks':_0x229a56||[]});fs[_0x211d('0x65')](util[_0x211d('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x216892[_0x211d('0x56')][_0x211d('0x3a')][_0x211d('0x6c')]()),_0x4af52e);return respondWithRpcPromise(_0x211d('0x5d'),'destroy',{'module':_0x211d('0x68')});}return null;})[_0x211d('0x53')](handleError(_0x589bad,null));};
\ No newline at end of file
index 3359f8b..9fefa6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf290=['Network','network','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1d7817,_0x3343f2){var _0x29198c=function(_0x4749dd){while(--_0x4749dd){_0x1d7817['push'](_0x1d7817['shift']());}};_0x29198c(++_0x3343f2);}(_0xf290,0xde));var _0x0f29=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xf290[_0x221ba2];return _0x47d08e;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var logger=require('../../config/logger')(_0x0f29('0x1'));var moment=require('moment');var BPromise=require(_0x0f29('0x2'));var rp=require(_0x0f29('0x3'));var fs=require('fs');var path=require(_0x0f29('0x4'));var rimraf=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var attributes=require('./network.attributes');module[_0x0f29('0x7')]=function(_0x4911fb,_0x2d5350){return _0x4911fb[_0x0f29('0x8')](_0x0f29('0x9'),attributes,{'tableName':_0x0f29('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe02=['exports','network','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe02,0x146));var _0x2be0=function(_0x42e7f4,_0x1813a6){_0x42e7f4=_0x42e7f4-0x0;var _0x225359=_0xbe02[_0x42e7f4];return _0x225359;};'use strict';var _=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var logger=require(_0x2be0('0x2'))(_0x2be0('0x3'));var moment=require('moment');var BPromise=require(_0x2be0('0x4'));var rp=require(_0x2be0('0x5'));var fs=require('fs');var path=require(_0x2be0('0x6'));var rimraf=require(_0x2be0('0x7'));var config=require(_0x2be0('0x8'));var attributes=require(_0x2be0('0x9'));module[_0x2be0('0xa')]=function(_0x474a35,_0x39a2ca){return _0x474a35['define']('Network',attributes,{'tableName':_0x2be0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 657321e..5055816 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(_0x4d1473,_0x5e3c67){var _0x45d7ba=function(_0x5b4e1b){while(--_0x5b4e1b){_0x4d1473['push'](_0x4d1473['shift']());}};_0x45d7ba(++_0x5e3c67);}(_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 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 _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x32c4a8,_0x308828){_0x32c4a8=_0x32c4a8-0x0;var _0xfec15d=_0x7a54[_0x32c4a8];return _0xfec15d;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index 9e81312..7e51b50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x237b=['notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify'];(function(_0x125494,_0x5aca7a){var _0x572b66=function(_0x2eff00){while(--_0x2eff00){_0x125494['push'](_0x125494['shift']());}};_0x572b66(++_0x5aca7a);}(_0x237b,0x139));var _0xb237=function(_0x4df5d1,_0x24dbda){_0x4df5d1=_0x4df5d1-0x0;var _0x4926d6=_0x237b[_0x4df5d1];return _0x4926d6;};'use strict';var multer=require(_0xb237('0x0'));var util=require(_0xb237('0x1'));var path=require(_0xb237('0x2'));var timeout=require(_0xb237('0x3'));var express=require(_0xb237('0x4'));var router=express[_0xb237('0x5')]();var fs_extra=require(_0xb237('0x6'));var auth=require(_0xb237('0x7'));var interaction=require(_0xb237('0x8'));var config=require('../../config/environment');var controller=require(_0xb237('0x9'));router[_0xb237('0xa')]('/',auth[_0xb237('0xb')](),controller[_0xb237('0xc')]);router['get'](_0xb237('0xd'),auth['isAuthenticated'](),controller[_0xb237('0xe')]);router[_0xb237('0xa')](_0xb237('0xf'),auth[_0xb237('0xb')](),controller[_0xb237('0x10')]);router[_0xb237('0xa')]('/:id/dispositions',auth[_0xb237('0xb')](),controller['getDispositions']);router[_0xb237('0xa')](_0xb237('0x11'),auth['isAuthenticated'](),controller[_0xb237('0x12')]);router['get'](_0xb237('0x13'),auth['isAuthenticated'](),controller[_0xb237('0x14')]);router[_0xb237('0xa')](_0xb237('0x15'),auth[_0xb237('0xb')](),controller[_0xb237('0x16')]);router[_0xb237('0xa')](_0xb237('0x17'),auth[_0xb237('0xb')](),controller[_0xb237('0x18')]);router[_0xb237('0x19')]('/',auth[_0xb237('0xb')](),controller[_0xb237('0x1a')]);router[_0xb237('0x19')](_0xb237('0x1b'),auth[_0xb237('0xb')](),controller[_0xb237('0x1c')]);router[_0xb237('0x19')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xb237('0x1d')]);router[_0xb237('0x19')](_0xb237('0x1e'),controller[_0xb237('0x1f')]);router[_0xb237('0x19')](_0xb237('0x13'),auth['isAuthenticated'](),controller[_0xb237('0x20')]);router[_0xb237('0x19')]('/:id/users',auth[_0xb237('0xb')](),controller[_0xb237('0x21')]);router[_0xb237('0x19')](_0xb237('0x22'),auth['isAuthenticated'](),controller[_0xb237('0x23')]);router[_0xb237('0x24')](_0xb237('0xf'),auth[_0xb237('0xb')](),controller[_0xb237('0x25')]);router[_0xb237('0x26')](_0xb237('0xf'),auth[_0xb237('0xb')](),controller[_0xb237('0x27')]);router[_0xb237('0x26')](_0xb237('0x1b'),auth['isAuthenticated'](),controller[_0xb237('0x28')]);router['delete'](_0xb237('0x11'),auth[_0xb237('0xb')](),controller['removeAnswers']);router[_0xb237('0x26')](_0xb237('0x17'),auth['isAuthenticated'](),controller[_0xb237('0x29')]);module[_0xb237('0x2a')]=router;
\ No newline at end of file
+var _0x221d=['../../config/environment','./openchannelAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','/:id/notify','addApplications','addAgents','send','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14f586,_0xc57464){var _0x3cc217=function(_0x31d569){while(--_0x31d569){_0x14f586['push'](_0x14f586['shift']());}};_0x3cc217(++_0xc57464);}(_0x221d,0x1e4));var _0xd221=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x221d[_0x186376];return _0x2dbdd9;};'use strict';var multer=require(_0xd221('0x0'));var util=require('util');var path=require(_0xd221('0x1'));var timeout=require('connect-timeout');var express=require(_0xd221('0x2'));var router=express[_0xd221('0x3')]();var fs_extra=require(_0xd221('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd221('0x5'));var config=require(_0xd221('0x6'));var controller=require(_0xd221('0x7'));router['get']('/',auth[_0xd221('0x8')](),controller[_0xd221('0x9')]);router[_0xd221('0xa')](_0xd221('0xb'),auth[_0xd221('0x8')](),controller[_0xd221('0xc')]);router[_0xd221('0xa')](_0xd221('0xd'),auth[_0xd221('0x8')](),controller['show']);router[_0xd221('0xa')](_0xd221('0xe'),auth[_0xd221('0x8')](),controller[_0xd221('0xf')]);router[_0xd221('0xa')](_0xd221('0x10'),auth[_0xd221('0x8')](),controller['getAnswers']);router['get'](_0xd221('0x11'),auth[_0xd221('0x8')](),controller[_0xd221('0x12')]);router[_0xd221('0xa')](_0xd221('0x13'),auth['isAuthenticated'](),controller[_0xd221('0x14')]);router[_0xd221('0xa')](_0xd221('0x15'),auth[_0xd221('0x8')](),controller[_0xd221('0x16')]);router['post']('/',auth[_0xd221('0x8')](),controller[_0xd221('0x17')]);router[_0xd221('0x18')](_0xd221('0xe'),auth[_0xd221('0x8')](),controller['addDisposition']);router[_0xd221('0x18')](_0xd221('0x10'),auth[_0xd221('0x8')](),controller['addAnswer']);router['post'](_0xd221('0x19'),controller['notify']);router[_0xd221('0x18')](_0xd221('0x11'),auth[_0xd221('0x8')](),controller[_0xd221('0x1a')]);router[_0xd221('0x18')](_0xd221('0x15'),auth[_0xd221('0x8')](),controller[_0xd221('0x1b')]);router[_0xd221('0x18')]('/:id/send',auth[_0xd221('0x8')](),controller[_0xd221('0x1c')]);router['put'](_0xd221('0xd'),auth[_0xd221('0x8')](),controller[_0xd221('0x1d')]);router[_0xd221('0x1e')](_0xd221('0xd'),auth[_0xd221('0x8')](),controller['destroy']);router[_0xd221('0x1e')](_0xd221('0xe'),auth[_0xd221('0x8')](),controller[_0xd221('0x1f')]);router[_0xd221('0x1e')](_0xd221('0x10'),auth[_0xd221('0x8')](),controller[_0xd221('0x20')]);router['delete'](_0xd221('0x15'),auth[_0xd221('0x8')](),controller[_0xd221('0x21')]);module[_0xd221('0x22')]=router;
\ No newline at end of file
index 52150d7..f9af82a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1128=['TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate'];(function(_0x184b40,_0x534f1d){var _0x50bbc7=function(_0xbcca7a){while(--_0xbcca7a){_0x184b40['push'](_0x184b40['shift']());}};_0x50bbc7(++_0x534f1d);}(_0x1128,0x120));var _0x8112=function(_0x21ada4,_0xc89442){_0x21ada4=_0x21ada4-0x0;var _0x2c157d=_0x1128[_0x21ada4];return _0x2c157d;};'use strict';var Sequelize=require(_0x8112('0x0'));var rs=require(_0x8112('0x1'));module[_0x8112('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x8112('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8112('0x4')],'defaultValue':function(){return rs[_0x8112('0x5')]();}},'replyUri':{'type':Sequelize[_0x8112('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8112('0x6')],'defaultValue':function(){return _0x8112('0x7');}},'notificationSound':{'type':Sequelize[_0x8112('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8112('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x8112('0x4')]},'queueTransfer':{'type':Sequelize[_0x8112('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8112('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8112('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x8112('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x8112('0x8')],'defaultValue':![],'comment':_0x8112('0xb'),'set':function(_0x691524){if(!_0x691524)this[_0x8112('0xc')]('mandatoryDispositionPauseId',null);this[_0x8112('0xc')](_0x8112('0xd'),_0x691524);}}};
\ No newline at end of file
+var _0x6b71=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','name','generate','STRING'];(function(_0x366b4b,_0x2f5f96){var _0x1ac436=function(_0xa5e0bd){while(--_0xa5e0bd){_0x366b4b['push'](_0x366b4b['shift']());}};_0x1ac436(++_0x2f5f96);}(_0x6b71,0xcb));var _0x16b7=function(_0x31e97b,_0x5c503a){_0x31e97b=_0x31e97b-0x0;var _0x488a2c=_0x6b71[_0x31e97b];return _0x488a2c;};'use strict';var Sequelize=require(_0x16b7('0x0'));var rs=require(_0x16b7('0x1'));module[_0x16b7('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x16b7('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x16b7('0x4')]();}},'replyUri':{'type':Sequelize[_0x16b7('0x5')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x16b7('0x6');}},'notificationSound':{'type':Sequelize[_0x16b7('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x16b7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x16b7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x16b7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x16b7('0x9'),'set':function(_0x4a9c4c){if(!_0x4a9c4c)this[_0x16b7('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x4a9c4c);}}};
\ No newline at end of file
index 952f75a..caa00a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe79a=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','Applications','account','applications','list','priority','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','Tag','Tags','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','Messages','dataValues','eml-format','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','undefined','limit','offset','set','json','apply','reject','update','destroy','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','OpenchannelAccount','count','include','findAll','rows','show','params','keys','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','Disposition','getDispositions','findOne','nolimit','order','includeAll','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes'];(function(_0x1a9d5d,_0x508c47){var _0x37e2b8=function(_0x4631ed){while(--_0x4631ed){_0x1a9d5d['push'](_0x1a9d5d['shift']());}};_0x37e2b8(++_0x508c47);}(_0xe79a,0x1b1));var _0xae79=function(_0xfd0d38,_0x3e89fe){_0xfd0d38=_0xfd0d38-0x0;var _0x38eea8=_0xe79a[_0xfd0d38];return _0x38eea8;};'use strict';var emlformat=require(_0xae79('0x0'));var rimraf=require(_0xae79('0x1'));var zipdir=require(_0xae79('0x2'));var jsonpatch=require(_0xae79('0x3'));var rp=require(_0xae79('0x4'));var moment=require(_0xae79('0x5'));var BPromise=require(_0xae79('0x6'));var Mustache=require(_0xae79('0x7'));var util=require(_0xae79('0x8'));var path=require(_0xae79('0x9'));var sox=require(_0xae79('0xa'));var csv=require(_0xae79('0xb'));var ejs=require(_0xae79('0xc'));var fs=require('fs');var fs_extra=require(_0xae79('0xd'));var _=require(_0xae79('0xe'));var squel=require('squel');var crypto=require(_0xae79('0xf'));var jsforce=require(_0xae79('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xae79('0xb'));var querystring=require(_0xae79('0x11'));var Papa=require(_0xae79('0x12'));var Redis=require(_0xae79('0x13'));var authService=require(_0xae79('0x14'));var qs=require(_0xae79('0x15'));var as=require(_0xae79('0x16'));var hardwareService=require(_0xae79('0x17'));var logger=require('../../config/logger')(_0xae79('0x18'));var utils=require(_0xae79('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xae79('0x1a'));var db=require(_0xae79('0x1b'))['db'];config[_0xae79('0x1c')]=_[_0xae79('0x1d')](config['redis'],{'host':_0xae79('0x1e'),'port':0x18eb});var socket=require(_0xae79('0x1f'))(new Redis(config[_0xae79('0x1c')]));require(_0xae79('0x20'))[_0xae79('0x21')](socket);var jayson=require('jayson/promise');var client=jayson[_0xae79('0x22')][_0xae79('0x23')]({'port':0x232c});var client9002=jayson[_0xae79('0x22')][_0xae79('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x4c7271,_0x1a1ee1,_0x49ce43,_0x2e0ff0){return new BPromise(function(_0x5d8aff,_0x1e6279){var _0x4d4343=_0x2e0ff0||client;return _0x4d4343['request'](_0x4c7271,_0x49ce43)[_0xae79('0x24')](function(_0x707d8a){logger['info'](_0xae79('0x25'),_0x1a1ee1,_0xae79('0x26'));logger['debug'](_0xae79('0x27'),_0x1a1ee1,'request\x20sent',JSON[_0xae79('0x28')](_0x707d8a));if(_0x707d8a['error']){if(_0x707d8a['error']['code']===0x1f4){logger[_0xae79('0x29')](_0xae79('0x25'),_0x1a1ee1,_0x707d8a['error']['message']);return _0x1e6279(_0x707d8a[_0xae79('0x29')][_0xae79('0x2a')]);}logger[_0xae79('0x29')](_0xae79('0x25'),_0x1a1ee1,_0x707d8a[_0xae79('0x29')][_0xae79('0x2a')]);return _0x5d8aff(_0x707d8a[_0xae79('0x29')]['message']);}else{logger['info'](_0xae79('0x25'),_0x1a1ee1,'request\x20sent');_0x5d8aff(_0x707d8a[_0xae79('0x2b')]['message']);}})[_0xae79('0x2c')](function(_0x586254){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x1a1ee1,_0x586254);_0x1e6279(_0x586254);});});}function respondWithStatusCode(_0x372865,_0xd62b72){_0xd62b72=_0xd62b72||0xcc;return function(_0x19c811){if(_0x19c811){return _0x372865[_0xae79('0x2d')](_0xd62b72);}return _0x372865[_0xae79('0x2e')](_0xd62b72)['end']();};}function respondWithResult(_0x549dd2,_0x5a6df6){_0x5a6df6=_0x5a6df6||0xc8;return function(_0x3d5bc7){if(_0x3d5bc7){return _0x549dd2[_0xae79('0x2e')](_0x5a6df6)['json'](_0x3d5bc7);}};}function respondWithFilteredResult(_0x2585d7,_0x3eabb1){return function(_0x312eff){if(_0x312eff){var _0x13d08e=typeof _0x3eabb1['offset']===_0xae79('0x2f')&&typeof _0x3eabb1[_0xae79('0x30')]===_0xae79('0x2f');var _0xe2a8b8=_0x312eff['count'];var _0x10499b=_0x13d08e?0x0:_0x3eabb1[_0xae79('0x31')];var _0x419043=_0x13d08e?_0x312eff['count']:_0x3eabb1[_0xae79('0x31')]+_0x3eabb1[_0xae79('0x30')];var _0x212db6;if(_0x419043>=_0xe2a8b8){_0x419043=_0xe2a8b8;_0x212db6=0xc8;}else{_0x212db6=0xce;}_0x2585d7[_0xae79('0x2e')](_0x212db6);return _0x2585d7[_0xae79('0x32')]('Content-Range',_0x10499b+'-'+_0x419043+'/'+_0xe2a8b8)[_0xae79('0x33')](_0x312eff);}return null;};}function patchUpdates(_0x5add49){return function(_0x4c626a){try{jsonpatch[_0xae79('0x34')](_0x4c626a,_0x5add49,!![]);}catch(_0x4f88ac){return BPromise[_0xae79('0x35')](_0x4f88ac);}return _0x4c626a['save']();};}function saveUpdates(_0x2a8620,_0x5b6ed1){return function(_0x302782){if(_0x302782){return _0x302782[_0xae79('0x36')](_0x2a8620)['then'](function(_0x2194c5){return _0x2194c5;});}return null;};}function removeEntity(_0x13007a,_0x2a45b4){return function(_0x3cb08f){if(_0x3cb08f){return _0x3cb08f[_0xae79('0x37')]()[_0xae79('0x24')](function(){var _0x2f1cd1=_0x3cb08f['get']({'plain':!![]});var _0x3941f0='OpenchannelAccounts';return db[_0xae79('0x38')][_0xae79('0x37')]({'where':{'type':_0x3941f0,'resourceId':_0x2f1cd1['id']}})[_0xae79('0x24')](function(){return _0x3cb08f;});})[_0xae79('0x24')](function(){_0x13007a[_0xae79('0x2e')](0xcc)[_0xae79('0x39')]();});}};}function handleEntityNotFound(_0x1023bd,_0x1b39f3){return function(_0x19649e){if(!_0x19649e){_0x1023bd[_0xae79('0x2d')](0x194);}return _0x19649e;};}function handleError(_0x418c2e,_0x242ab9){_0x242ab9=_0x242ab9||0x1f4;return function(_0x1f3221){logger[_0xae79('0x29')](_0x1f3221['stack']);if(_0x1f3221['name']){delete _0x1f3221[_0xae79('0x3a')];}_0x418c2e['status'](_0x242ab9)[_0xae79('0x3b')](_0x1f3221);};}exports[_0xae79('0x3c')]=function(_0x3bbd82,_0x39ff1e){var _0x4a405b={'include':[{'model':db[_0xae79('0x3d')],'as':_0xae79('0x3e')}]},_0x4590cb={},_0x2e031f={'count':0x0,'rows':[]};var _0x49ddc2=_[_0xae79('0x3f')](db['OpenchannelAccount'][_0xae79('0x40')],function(_0x13f345){return{'name':_0x13f345[_0xae79('0x41')],'type':_0x13f345['type'][_0xae79('0x42')]};});_0x4590cb[_0xae79('0x43')]=_[_0xae79('0x3f')](_0x49ddc2,_0xae79('0x3a'));_0x4590cb[_0xae79('0x44')]=_['keys'](_0x3bbd82['query']);_0x4590cb[_0xae79('0x45')]=_[_0xae79('0x46')](_0x4590cb['model'],_0x4590cb[_0xae79('0x44')]);_0x4a405b[_0xae79('0x47')]=_[_0xae79('0x46')](_0x4590cb['model'],qs['fields'](_0x3bbd82[_0xae79('0x44')]['fields']));_0x4a405b[_0xae79('0x47')]=_0x4a405b['attributes'][_0xae79('0x48')]?_0x4a405b[_0xae79('0x47')]:_0x4590cb['model'];if(!_0x3bbd82[_0xae79('0x44')][_0xae79('0x49')]('nolimit')){_0x4a405b[_0xae79('0x30')]=qs[_0xae79('0x30')](_0x3bbd82[_0xae79('0x44')][_0xae79('0x30')]);_0x4a405b[_0xae79('0x31')]=qs[_0xae79('0x31')](_0x3bbd82[_0xae79('0x44')][_0xae79('0x31')]);}_0x4a405b['order']=qs[_0xae79('0x4a')](_0x3bbd82[_0xae79('0x44')][_0xae79('0x4a')]);_0x4a405b[_0xae79('0x4b')]=qs[_0xae79('0x45')](_[_0xae79('0x4c')](_0x3bbd82[_0xae79('0x44')],_0x4590cb[_0xae79('0x45')]),_0x49ddc2);if(_0x3bbd82[_0xae79('0x44')]['filter']){_0x4a405b[_0xae79('0x4b')]=_[_0xae79('0x4d')](_0x4a405b[_0xae79('0x4b')],{'$or':_['map'](_0x49ddc2,function(_0x2155ba){if(_0x2155ba['type']!=='VIRTUAL'){var _0x1e6de6={};_0x1e6de6[_0x2155ba['name']]={'$like':'%'+_0x3bbd82[_0xae79('0x44')][_0xae79('0x4e')]+'%'};return _0x1e6de6;}})});}_0x4a405b=_[_0xae79('0x4d')]({},_0x4a405b,_0x3bbd82[_0xae79('0x4f')]);var _0x309df8={'where':_0x4a405b[_0xae79('0x4b')]};return db[_0xae79('0x50')][_0xae79('0x51')](_0x309df8)['then'](function(_0x4bfd6c){_0x2e031f[_0xae79('0x51')]=_0x4bfd6c;if(_0x3bbd82['query']['includeAll']){_0x4a405b[_0xae79('0x52')]=[{'all':!![]}];}return db[_0xae79('0x50')][_0xae79('0x53')](_0x4a405b);})[_0xae79('0x24')](function(_0x171df6){_0x2e031f[_0xae79('0x54')]=_0x171df6;return _0x2e031f;})[_0xae79('0x24')](respondWithFilteredResult(_0x39ff1e,_0x4a405b))[_0xae79('0x2c')](handleError(_0x39ff1e,null));};exports[_0xae79('0x55')]=function(_0x4d4cc3,_0x5d99e2){var _0xbea316={'raw':![],'where':{'id':_0x4d4cc3[_0xae79('0x56')]['id']},'include':[{'model':db[_0xae79('0x3d')],'as':_0xae79('0x3e')}]},_0x484a2c={};_0x484a2c[_0xae79('0x43')]=_[_0xae79('0x57')](db[_0xae79('0x50')]['rawAttributes']);_0x484a2c[_0xae79('0x44')]=_[_0xae79('0x57')](_0x4d4cc3[_0xae79('0x44')]);_0x484a2c['filters']=_[_0xae79('0x46')](_0x484a2c['model'],_0x484a2c[_0xae79('0x44')]);_0xbea316[_0xae79('0x47')]=_['intersection'](_0x484a2c[_0xae79('0x43')],qs[_0xae79('0x58')](_0x4d4cc3[_0xae79('0x44')][_0xae79('0x58')]));_0xbea316[_0xae79('0x47')]=_0xbea316[_0xae79('0x47')][_0xae79('0x48')]?_0xbea316[_0xae79('0x47')]:_0x484a2c[_0xae79('0x43')];if(_0x4d4cc3['query']['includeAll']){_0xbea316['include']=[{'all':!![]}];}_0xbea316=_[_0xae79('0x4d')]({},_0xbea316,_0x4d4cc3['options']);return db[_0xae79('0x50')][_0xae79('0x59')](_0xbea316)[_0xae79('0x24')](handleEntityNotFound(_0x5d99e2,null))[_0xae79('0x24')](respondWithResult(_0x5d99e2,null))['catch'](handleError(_0x5d99e2,null));};exports[_0xae79('0x5a')]=function(_0x146d7b,_0x165807){return db[_0xae79('0x50')][_0xae79('0x5a')](_0x146d7b[_0xae79('0x5b')],{})[_0xae79('0x24')](function(_0x2409cc){var _0x374be8=_0x146d7b[_0xae79('0x5c')][_0xae79('0x5d')]({'plain':!![]});if(!_0x374be8)throw new Error(_0xae79('0x5e'));if(_0x374be8[_0xae79('0x5f')]===_0xae79('0x5c')){var _0x432b1a=_0x2409cc[_0xae79('0x5d')]({'plain':!![]});var _0x242a39=_0xae79('0x60');return db['UserProfileSection'][_0xae79('0x59')]({'where':{'name':_0x242a39,'userProfileId':_0x374be8[_0xae79('0x61')]},'raw':!![]})[_0xae79('0x24')](function(_0x4ab165){if(_0x4ab165&&_0x4ab165[_0xae79('0x62')]===0x0){return db[_0xae79('0x38')]['create']({'name':_0x432b1a['name'],'resourceId':_0x432b1a['id'],'type':_0x4ab165[_0xae79('0x3a')],'sectionId':_0x4ab165['id']},{})[_0xae79('0x24')](function(){return _0x2409cc;});}else{return _0x2409cc;}})[_0xae79('0x2c')](function(_0x38ba72){logger['error'](_0xae79('0x63'),_0x38ba72);throw _0x38ba72;});}return _0x2409cc;})[_0xae79('0x24')](respondWithResult(_0x165807,0xc9))[_0xae79('0x2c')](handleError(_0x165807,null));};exports[_0xae79('0x36')]=function(_0xbbb534,_0x544f6d){if(_0xbbb534[_0xae79('0x5b')]['id']){delete _0xbbb534['body']['id'];}return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0xbbb534['params']['id']},'include':[{'model':db[_0xae79('0x3d')],'as':_0xae79('0x3e')}]})['then'](handleEntityNotFound(_0x544f6d,null))[_0xae79('0x24')](saveUpdates(_0xbbb534[_0xae79('0x5b')],null))[_0xae79('0x24')](respondWithResult(_0x544f6d,null))['catch'](handleError(_0x544f6d,null));};exports[_0xae79('0x37')]=function(_0x3255ad,_0x1698bc){return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0x3255ad[_0xae79('0x56')]['id']}})['then'](handleEntityNotFound(_0x1698bc,null))[_0xae79('0x24')](removeEntity(_0x1698bc,null))[_0xae79('0x2c')](handleError(_0x1698bc,null));};exports['describe']=function(_0x1e1423,_0x5e3f1e){return db[_0xae79('0x50')][_0xae79('0x64')]()['then'](respondWithResult(_0x5e3f1e,null))[_0xae79('0x2c')](handleError(_0x5e3f1e,null));};exports['addDisposition']=function(_0x300d08,_0x145a42,_0x53908e){if(_0x300d08[_0xae79('0x5b')]['id']){delete _0x300d08['body']['id'];}return db[_0xae79('0x50')]['find']({'where':{'id':_0x300d08[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x145a42,null))[_0xae79('0x24')](function(_0x57ec04){if(_0x57ec04){_0x300d08['body']['OpenchannelAccountId']=_0x57ec04['id'];return db[_0xae79('0x65')][_0xae79('0x5a')](_0x300d08[_0xae79('0x5b')]);}})[_0xae79('0x24')](respondWithResult(_0x145a42,null))[_0xae79('0x2c')](handleError(_0x145a42,null));};exports[_0xae79('0x66')]=function(_0x3161ec,_0x25749d,_0x1c866e){var _0x22d9f5={'raw':![],'where':{}};var _0x3f7f26={};var _0x4fa4fa={'count':0x0,'rows':[]};return db[_0xae79('0x50')][_0xae79('0x67')]({'where':{'id':_0x3161ec[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x25749d,null))[_0xae79('0x24')](function(_0x868641){if(_0x868641){_0x3f7f26[_0xae79('0x43')]=_['keys'](db[_0xae79('0x65')][_0xae79('0x40')]);_0x3f7f26[_0xae79('0x44')]=_[_0xae79('0x57')](_0x3161ec['query']);_0x3f7f26[_0xae79('0x45')]=_[_0xae79('0x46')](_0x3f7f26['model'],_0x3f7f26[_0xae79('0x44')]);_0x22d9f5['attributes']=_[_0xae79('0x46')](_0x3f7f26[_0xae79('0x43')],qs[_0xae79('0x58')](_0x3161ec[_0xae79('0x44')]['fields']));_0x22d9f5[_0xae79('0x47')]=_0x22d9f5['attributes'][_0xae79('0x48')]?_0x22d9f5[_0xae79('0x47')]:_0x3f7f26[_0xae79('0x43')];if(!_0x3161ec[_0xae79('0x44')][_0xae79('0x49')](_0xae79('0x68'))){_0x22d9f5[_0xae79('0x30')]=qs[_0xae79('0x30')](_0x3161ec[_0xae79('0x44')][_0xae79('0x30')]);_0x22d9f5[_0xae79('0x31')]=qs[_0xae79('0x31')](_0x3161ec['query'][_0xae79('0x31')]);}_0x22d9f5[_0xae79('0x69')]=qs[_0xae79('0x4a')](_0x3161ec[_0xae79('0x44')][_0xae79('0x4a')]);_0x22d9f5[_0xae79('0x4b')]=qs['filters'](_[_0xae79('0x4c')](_0x3161ec[_0xae79('0x44')],_0x3f7f26['filters']));_0x22d9f5[_0xae79('0x4b')]['OpenchannelAccountId']=_0x868641['id'];if(_0x3161ec[_0xae79('0x44')][_0xae79('0x4e')]){_0x22d9f5[_0xae79('0x4b')]=_[_0xae79('0x4d')](_0x22d9f5[_0xae79('0x4b')],{'$or':_[_0xae79('0x3f')](_0x22d9f5['attributes'],function(_0x35b6f2){var _0x244c13={};_0x244c13[_0x35b6f2]={'$like':'%'+_0x3161ec[_0xae79('0x44')]['filter']+'%'};return _0x244c13;})});}_0x22d9f5=_[_0xae79('0x4d')]({},_0x22d9f5,_0x3161ec[_0xae79('0x4f')]);return db[_0xae79('0x65')]['count']({'where':_0x22d9f5[_0xae79('0x4b')]})[_0xae79('0x24')](function(_0x14b66b){_0x4fa4fa[_0xae79('0x51')]=_0x14b66b;if(_0x3161ec[_0xae79('0x44')][_0xae79('0x6a')]){_0x22d9f5[_0xae79('0x52')]=[{'all':!![]}];}return db[_0xae79('0x65')][_0xae79('0x53')](_0x22d9f5);})['then'](function(_0x31e23d){_0x4fa4fa['rows']=_0x31e23d;return _0x4fa4fa;});}})[_0xae79('0x24')](respondWithFilteredResult(_0x25749d,_0x22d9f5))['catch'](handleError(_0x25749d,null));};exports['removeDispositions']=function(_0x4a796a,_0x32e15c,_0x53cac3){return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0x4a796a[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x32e15c,null))[_0xae79('0x24')](function(_0x4d67d0){if(_0x4d67d0){return _0x4d67d0[_0xae79('0x6b')](_0x4a796a[_0xae79('0x44')][_0xae79('0x6c')]);}})[_0xae79('0x24')](respondWithStatusCode(_0x32e15c,null))['catch'](handleError(_0x32e15c,null));};exports[_0xae79('0x6d')]=function(_0xcecb78,_0x3765bc,_0x3df79b){if(_0xcecb78[_0xae79('0x5b')]['id']){delete _0xcecb78[_0xae79('0x5b')]['id'];}return db['OpenchannelAccount'][_0xae79('0x59')]({'where':{'id':_0xcecb78[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x3765bc,null))['then'](function(_0x4a216f){if(_0x4a216f){_0xcecb78[_0xae79('0x5b')][_0xae79('0x6e')]=_0x4a216f['id'];return db[_0xae79('0x6f')][_0xae79('0x5a')](_0xcecb78[_0xae79('0x5b')]);}})[_0xae79('0x24')](respondWithResult(_0x3765bc,null))['catch'](handleError(_0x3765bc,null));};exports['getAnswers']=function(_0x21589b,_0x38ca9f,_0x5bf030){var _0x1951d4={'raw':![],'where':{}};var _0x4db35b={};var _0x33cb3c={'count':0x0,'rows':[]};return db[_0xae79('0x50')][_0xae79('0x67')]({'where':{'id':_0x21589b['params']['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x38ca9f,null))[_0xae79('0x24')](function(_0x3bb7dc){if(_0x3bb7dc){_0x4db35b[_0xae79('0x43')]=_[_0xae79('0x57')](db['CannedAnswer'][_0xae79('0x40')]);_0x4db35b[_0xae79('0x44')]=_[_0xae79('0x57')](_0x21589b['query']);_0x4db35b[_0xae79('0x45')]=_[_0xae79('0x46')](_0x4db35b[_0xae79('0x43')],_0x4db35b[_0xae79('0x44')]);_0x1951d4[_0xae79('0x47')]=_[_0xae79('0x46')](_0x4db35b[_0xae79('0x43')],qs['fields'](_0x21589b[_0xae79('0x44')][_0xae79('0x58')]));_0x1951d4[_0xae79('0x47')]=_0x1951d4['attributes'][_0xae79('0x48')]?_0x1951d4[_0xae79('0x47')]:_0x4db35b['model'];if(!_0x21589b[_0xae79('0x44')][_0xae79('0x49')](_0xae79('0x68'))){_0x1951d4[_0xae79('0x30')]=qs[_0xae79('0x30')](_0x21589b[_0xae79('0x44')][_0xae79('0x30')]);_0x1951d4['offset']=qs[_0xae79('0x31')](_0x21589b[_0xae79('0x44')][_0xae79('0x31')]);}_0x1951d4[_0xae79('0x69')]=qs['sort'](_0x21589b['query'][_0xae79('0x4a')]);_0x1951d4[_0xae79('0x4b')]=qs[_0xae79('0x45')](_[_0xae79('0x4c')](_0x21589b[_0xae79('0x44')],_0x4db35b[_0xae79('0x45')]));_0x1951d4[_0xae79('0x4b')]['OpenchannelAccountId']=_0x3bb7dc['id'];if(_0x21589b[_0xae79('0x44')][_0xae79('0x4e')]){_0x1951d4[_0xae79('0x4b')]=_[_0xae79('0x4d')](_0x1951d4[_0xae79('0x4b')],{'$or':_[_0xae79('0x3f')](_0x1951d4[_0xae79('0x47')],function(_0xea8643){var _0x1acf74={};_0x1acf74[_0xea8643]={'$like':'%'+_0x21589b['query'][_0xae79('0x4e')]+'%'};return _0x1acf74;})});}_0x1951d4=_['merge']({},_0x1951d4,_0x21589b['options']);return db[_0xae79('0x6f')]['count']({'where':_0x1951d4[_0xae79('0x4b')]})['then'](function(_0xeaf218){_0x33cb3c[_0xae79('0x51')]=_0xeaf218;if(_0x21589b[_0xae79('0x44')][_0xae79('0x6a')]){_0x1951d4[_0xae79('0x52')]=[{'all':!![]}];}return db[_0xae79('0x6f')][_0xae79('0x53')](_0x1951d4);})['then'](function(_0xc0083e){_0x33cb3c[_0xae79('0x54')]=_0xc0083e;return _0x33cb3c;});}})['then'](respondWithFilteredResult(_0x38ca9f,_0x1951d4))['catch'](handleError(_0x38ca9f,null));};exports['removeAnswers']=function(_0x515380,_0x50260a,_0x2b3ee7){return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0x515380['params']['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x50260a,null))[_0xae79('0x24')](function(_0x3ba0b4){if(_0x3ba0b4){return _0x3ba0b4['removeAnswers'](_0x515380[_0xae79('0x44')]['ids']);}})[_0xae79('0x24')](respondWithStatusCode(_0x50260a,null))[_0xae79('0x2c')](handleError(_0x50260a,null));};exports[_0xae79('0x70')]=function(_0xec698d,_0x1b3ef9,_0x51cb2c){var _0x29d68a={'body':_0xec698d[_0xae79('0x5b')],'channel':_0xae79('0x71')};var _0x54aef9=[];var _0x11f144=[];var _0x39d150={};var _0x39ecef=![];return db['CmContact']['describe']()['then'](function(_0x4f0386){if(!_0x4f0386){throw new db['Sequelize'][(_0xae79('0x72'))](_0xae79('0x73'));}_0x54aef9=_['difference'](_[_0xae79('0x57')](_0x4f0386),[_0xae79('0x74'),'updatedAt']);_0x11f144=_[_0xae79('0x75')](_[_0xae79('0x57')](_0x4f0386),[_0xae79('0x74'),_0xae79('0x76'),_0xae79('0x77'),_0xae79('0x78')]);if(_0xec698d[_0xae79('0x5b')]['id']){delete _0xec698d[_0xae79('0x5b')]['id'];}if(_[_0xae79('0x79')](_0xec698d[_0xae79('0x5b')][_0xae79('0x7a')])){throw new db[(_0xae79('0x7b'))][(_0xae79('0x72'))](_0xae79('0x7c'));}if(_[_0xae79('0x79')](_0xec698d[_0xae79('0x5b')][_0xae79('0x5b')])||_0xec698d[_0xae79('0x5b')][_0xae79('0x5b')]===''){throw new db[(_0xae79('0x7b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xae79('0x79')](_0xec698d[_0xae79('0x5b')][_0xae79('0x7d')])){throw new db[(_0xae79('0x7b'))][(_0xae79('0x72'))](_0xae79('0x7e')+_0x11f144);}if(!_[_0xae79('0x7f')](_0x11f144,_0xec698d[_0xae79('0x5b')][_0xae79('0x7d')])){throw new db[(_0xae79('0x7b'))]['ValidationError'](_0xae79('0x80')+_0x11f144);}_0x39d150[_0xec698d['body'][_0xae79('0x7d')]]=_0xec698d[_0xae79('0x5b')][_0xae79('0x7a')];})[_0xae79('0x24')](function(){return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0xec698d[_0xae79('0x56')]['id']},'include':[{'model':db[_0xae79('0x81')],'as':_0xae79('0x82'),'include':[{'model':db[_0xae79('0x83')],'as':_0xae79('0x84'),'where':_0x39d150,'limit':0x1,'order':[[_0xae79('0x76'),_0xae79('0x85')]]}]},{'model':db['OpenchannelApplication'],'as':_0xae79('0x86')}]});})[_0xae79('0x24')](handleEntityNotFound(_0x1b3ef9,null))[_0xae79('0x24')](function(_0x19c3a7){if(_0x19c3a7&&_0x19c3a7['List']){_0x29d68a[_0xae79('0x87')]=_0x19c3a7;_0x29d68a[_0xae79('0x88')]=_0x19c3a7[_0xae79('0x86')];_0x29d68a[_0xae79('0x89')]=_0x19c3a7['List'];_0x29d68a[_0xae79('0x88')]=_['orderBy'](_0x29d68a['applications'],[_0xae79('0x8a')],[_0xae79('0x8b')]);if(_0x29d68a[_0xae79('0x87')][_0xae79('0x86')]){delete _0x29d68a[_0xae79('0x87')]['Applications'];}if(_0x29d68a['account']['List']&&_0x29d68a[_0xae79('0x87')][_0xae79('0x82')][_0xae79('0x84')][_0xae79('0x48')]){return _0x29d68a[_0xae79('0x87')][_0xae79('0x82')]['Contacts'][0x0];}var _0x2bb0a8=_[_0xae79('0x1d')](_0xec698d[_0xae79('0x5b')],{'firstName':_0xec698d['body'][_0xae79('0x7a')],'ListId':_0x19c3a7[_0xae79('0x78')]});_0x2bb0a8[_0xec698d['body']['mapKey']]=_0xec698d['body'][_0xae79('0x7a')];return db['CmContact'][_0xae79('0x5a')](_0x2bb0a8,{'fields':_0x54aef9,'raw':!![]});}})['then'](handleEntityNotFound(_0x1b3ef9,null))[_0xae79('0x24')](function(_0x4d2404){_0x29d68a[_0xae79('0x8c')]=_0x4d2404;if(_0x4d2404){var _0x240c96={'ContactId':_0x4d2404['id'],'OpenchannelAccountId':_0xec698d[_0xae79('0x56')]['id'],'from':(_0x4d2404[_0xae79('0x8d')]||'')+'\x20'+(_0x4d2404['lastName']||'')};var _0x186e9c={'OpenchannelAccountId':_0xec698d['params']['id'],'closed':![]};if(_0xec698d[_0xae79('0x5b')][_0xae79('0x8e')]){_0x186e9c[_0xae79('0x8e')]=_0xec698d['body'][_0xae79('0x8e')];return db[_0xae79('0x8f')]['find']({'where':_0x186e9c})[_0xae79('0x24')](function(_0x4dec25){if(_0x4dec25){return[_0x4dec25,![]];}_0x240c96[_0xae79('0x8e')]=_0xec698d[_0xae79('0x5b')][_0xae79('0x8e')];_0x240c96[_0xae79('0x90')]=_0xec698d[_0xae79('0x5b')]['externalUrl'];return db[_0xae79('0x8f')][_0xae79('0x5a')](_0x240c96)[_0xae79('0x24')](function(_0x1ec655){return[_0x1ec655,!![]];});});}else{_0x186e9c['threadId']=null;}_0x186e9c[_0xae79('0x91')]=_0x4d2404['id'];return db[_0xae79('0x8f')][_0xae79('0x59')]({'where':_0x186e9c})['then'](function(_0x369eeb){if(_0x369eeb){return[_0x369eeb,![]];}return db[_0xae79('0x8f')][_0xae79('0x5a')](_0x240c96)[_0xae79('0x24')](function(_0xc91dca){return[_0xc91dca,!![]];});});}})['spread'](function(_0x192921,_0x5617e1){if(_0x192921){_0x39ecef=_0x5617e1;if(!_0x5617e1){var _0x294850={'from':(_0x29d68a[_0xae79('0x8c')][_0xae79('0x8d')]||'')+'\x20'+(_0x29d68a[_0xae79('0x8c')][_0xae79('0x92')]||'')};if(_0xec698d[_0xae79('0x5b')][_0xae79('0x8e')]&&_0xec698d[_0xae79('0x5b')]['messageId']&&_0xec698d[_0xae79('0x5b')][_0xae79('0x8e')]!=_0xec698d[_0xae79('0x5b')][_0xae79('0x93')]){_0x294850[_0xae79('0x8e')]=_0xec698d[_0xae79('0x5b')][_0xae79('0x93')];}return _0x192921[_0xae79('0x36')](_0x294850);}else{return _0x192921;}}})[_0xae79('0x24')](function(_0x535202){_0x29d68a[_0xae79('0x94')]=_0x535202['get']({'plain':!![]});_0x29d68a['interaction'][_0xae79('0x95')]=_0x39ecef;if(_0x29d68a[_0xae79('0x94')]['created']){if(_0x29d68a[_0xae79('0x87')]['autoclose']){_0x29d68a['applications'][_0xae79('0x96')]({'id':0x0,'priority':_0x29d68a['applications'][_0xae79('0x48')]+0x1,'app':_0xae79('0x97'),'appdata':_0xae79('0x98'),'interval':_0xae79('0x99')});}}return db[_0xae79('0x9a')][_0xae79('0x5a')]({'body':_0xec698d[_0xae79('0x5b')][_0xae79('0x5b')],'OpenchannelAccountId':_0xec698d[_0xae79('0x56')]['id'],'OpenchannelInteractionId':_0x535202['id'],'direction':'in','ContactId':_0x29d68a[_0xae79('0x8c')]['id'],'AttachmentId':_0xec698d[_0xae79('0x5b')][_0xae79('0x9b')]});})[_0xae79('0x24')](function(_0x2d4401){_0x29d68a[_0xae79('0x2a')]=_0x2d4401;if(_0x29d68a[_0xae79('0x94')][_0xae79('0x9c')]){return db[_0xae79('0x9d')][_0xae79('0x59')]({'attributes':['id',_0xae79('0x3a')],'where':{'id':_0x29d68a[_0xae79('0x94')]['UserId']}})[_0xae79('0x24')](function(_0x1529b2){if(_0x1529b2){_0x29d68a['applications'][_0xae79('0x9e')]({'id':0x0,'priority':0x0,'app':_0xae79('0x9f'),'appdata':_0x1529b2[_0xae79('0x3a')]+','+(_0x29d68a['account'][_0xae79('0xa0')]||0xa),'interval':_0xae79('0x99')});_0x29d68a[_0xae79('0xa1')]=![];}return respondWithRpcPromise(_0xae79('0xa2'),_0xae79('0xa3'),_0x29d68a);});}return respondWithRpcPromise(_0xae79('0xa2'),_0xae79('0xa3'),_0x29d68a);})[_0xae79('0x24')](function(_0x3767cf){respondWithRpcPromise(_0xae79('0xa4'),'EventManager',{'event':'notify','message':_0x3767cf},client9002);return _0x3767cf;})[_0xae79('0x24')](respondWithResult(_0x1b3ef9,null))[_0xae79('0x2c')](handleError(_0x1b3ef9,null));};exports['addApplications']=function(_0x5cb2e3,_0x50b1a7,_0xa0ff90){return db[_0xae79('0x50')][_0xae79('0x67')]({'where':{'id':_0x5cb2e3[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x50b1a7,null))[_0xae79('0x24')](function(_0x3ae1bd){if(_0x3ae1bd){return db['sequelize'][_0xae79('0xa5')](function(_0x16f162){return db[_0xae79('0xa6')][_0xae79('0x37')]({'where':{'OpenchannelAccountId':_0x5cb2e3[_0xae79('0x56')]['id']},'transaction':_0x16f162})[_0xae79('0x24')](function(_0x453f5d){var _0xd4c84e=_[_0xae79('0x3f')](_0x5cb2e3[_0xae79('0x5b')],function(_0x4415f6){_0x4415f6['OpenchannelAccountId']=_0x5cb2e3[_0xae79('0x56')]['id'];return _0x4415f6;});return db[_0xae79('0xa6')][_0xae79('0xa7')](_0xd4c84e,{'transaction':_0x16f162});});})[_0xae79('0x24')](function(){return db[_0xae79('0xa6')][_0xae79('0xa8')]({'where':{'OpenchannelAccountId':_0x5cb2e3[_0xae79('0x56')]['id']},'order':_0xae79('0x8a')});});}})[_0xae79('0x24')](respondWithResult(_0x50b1a7,null))[_0xae79('0x2c')](handleError(_0x50b1a7,null));};exports['getApplications']=function(_0x36b902,_0xb9ba6d,_0x305bf7){var _0x55976c={};var _0x47c27a={};var _0x514ee7;var _0x56ce19;return db[_0xae79('0x50')][_0xae79('0x67')]({'where':{'id':_0x36b902[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0xb9ba6d,null))[_0xae79('0x24')](function(_0x1c2c65){if(_0x1c2c65){_0x514ee7=_0x1c2c65;_0x47c27a[_0xae79('0x43')]=_[_0xae79('0x57')](db[_0xae79('0xa6')][_0xae79('0x40')]);_0x47c27a[_0xae79('0x44')]=_[_0xae79('0x57')](_0x36b902[_0xae79('0x44')]);_0x47c27a['filters']=_[_0xae79('0x46')](_0x47c27a[_0xae79('0x43')],_0x47c27a['query']);_0x55976c[_0xae79('0x47')]=_[_0xae79('0x46')](_0x47c27a['model'],qs['fields'](_0x36b902['query']['fields']));_0x55976c[_0xae79('0x47')]=_0x55976c['attributes'][_0xae79('0x48')]?_0x55976c[_0xae79('0x47')]:_0x47c27a[_0xae79('0x43')];_0x55976c['order']=qs[_0xae79('0x4a')](_0x36b902[_0xae79('0x44')][_0xae79('0x4a')]);_0x55976c[_0xae79('0x4b')]=qs[_0xae79('0x45')](_[_0xae79('0x4c')](_0x36b902[_0xae79('0x44')],_0x47c27a[_0xae79('0x45')]));if(_0x36b902['query'][_0xae79('0x4e')]){_0x55976c[_0xae79('0x4b')]=_[_0xae79('0x4d')](_0x55976c[_0xae79('0x4b')],{'$or':_[_0xae79('0x3f')](_0x55976c[_0xae79('0x47')],function(_0x1c2781){var _0x336d0a={};_0x336d0a[_0x1c2781]={'$like':'%'+_0x36b902[_0xae79('0x44')][_0xae79('0x4e')]+'%'};return _0x336d0a;})});}_0x55976c=_[_0xae79('0x4d')]({},_0x55976c,_0x36b902[_0xae79('0x4f')]);return _0x514ee7[_0xae79('0xa9')](_0x55976c);}})['then'](function(_0x126c9c){if(_0x126c9c){_0x56ce19=_0x126c9c[_0xae79('0x48')];if(!_0x36b902[_0xae79('0x44')]['hasOwnProperty'](_0xae79('0x68'))){_0x55976c['limit']=qs[_0xae79('0x30')](_0x36b902[_0xae79('0x44')][_0xae79('0x30')]);_0x55976c[_0xae79('0x31')]=qs[_0xae79('0x31')](_0x36b902[_0xae79('0x44')][_0xae79('0x31')]);}return _0x514ee7['getApplications'](_0x55976c);}})[_0xae79('0x24')](function(_0xd83627){if(_0xd83627){return _0xd83627?{'count':_0x56ce19,'rows':_0xd83627}:null;}})['then'](respondWithResult(_0xb9ba6d,null))[_0xae79('0x2c')](handleError(_0xb9ba6d,null));};exports['getInteractions']=function(_0x8b9a34,_0x4fe961,_0x2d4068){var _0x365dd5={'raw':![],'where':{}};var _0x1d4e46={};var _0x4cc290={'count':0x0,'rows':[]};return db[_0xae79('0x50')]['findOne']({'where':{'id':_0x8b9a34[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x4fe961,null))[_0xae79('0x24')](function(_0xb5d5ce){if(_0xb5d5ce){_0x1d4e46[_0xae79('0x43')]=_[_0xae79('0x57')](db['OpenchannelInteraction'][_0xae79('0x40')]);_0x1d4e46[_0xae79('0x44')]=_[_0xae79('0x57')](_0x8b9a34[_0xae79('0x44')]);_0x1d4e46[_0xae79('0x45')]=_[_0xae79('0x46')](_0x1d4e46[_0xae79('0x43')],_0x1d4e46[_0xae79('0x44')]);_0x365dd5['attributes']=_[_0xae79('0x46')](_0x1d4e46[_0xae79('0x43')],qs[_0xae79('0x58')](_0x8b9a34['query'][_0xae79('0x58')]));_0x365dd5[_0xae79('0x47')]=_0x365dd5[_0xae79('0x47')][_0xae79('0x48')]?_0x365dd5['attributes']:_0x1d4e46[_0xae79('0x43')];if(!_0x8b9a34['query']['hasOwnProperty'](_0xae79('0x68'))){_0x365dd5[_0xae79('0x30')]=qs[_0xae79('0x30')](_0x8b9a34[_0xae79('0x44')]['limit']);_0x365dd5[_0xae79('0x31')]=qs['offset'](_0x8b9a34[_0xae79('0x44')]['offset']);}_0x365dd5[_0xae79('0x69')]=qs[_0xae79('0x4a')](_0x8b9a34[_0xae79('0x44')][_0xae79('0x4a')]);_0x365dd5['where']=qs['filters'](_[_0xae79('0x4c')](_0x8b9a34[_0xae79('0x44')],_0x1d4e46['filters']));_0x365dd5[_0xae79('0x4b')]['OpenchannelAccountId']=_0xb5d5ce['id'];if(_0x8b9a34[_0xae79('0x44')][_0xae79('0x4e')]){_0x365dd5[_0xae79('0x4b')]=_['merge'](_0x365dd5[_0xae79('0x4b')],{'$or':_[_0xae79('0x3f')](_0x365dd5[_0xae79('0x47')],function(_0x346372){var _0x4e1131={};_0x4e1131[_0x346372]={'$like':'%'+_0x8b9a34[_0xae79('0x44')]['filter']+'%'};return _0x4e1131;})});}_0x365dd5=_[_0xae79('0x4d')]({},_0x365dd5,_0x8b9a34['options']);return db[_0xae79('0x8f')][_0xae79('0x51')]({'where':_0x365dd5['where']})[_0xae79('0x24')](function(_0x11a7f1){_0x4cc290['count']=_0x11a7f1;if(_0x8b9a34[_0xae79('0x44')][_0xae79('0x6a')]){_0x365dd5['include']=[{'model':db['CmContact'],'as':_0xae79('0xaa'),'required':![]},{'model':db[_0xae79('0x9d')],'as':_0xae79('0xab'),'attributes':[_0xae79('0x3a'),_0xae79('0xac'),'internal'],'required':![]},{'model':db[_0xae79('0xad')],'as':_0xae79('0xae'),'attributes':['id',_0xae79('0x3a'),'color'],'where':_0x8b9a34['query']['tag']?{'id':_0x8b9a34[_0xae79('0x44')][_0xae79('0xaf')]}:undefined,'required':_0x8b9a34['query'][_0xae79('0xaf')]?!![]:![]}];}return db[_0xae79('0x8f')]['findAll'](_0x365dd5);})['then'](function(_0x2e10ca){_0x4cc290[_0xae79('0x54')]=_0x2e10ca;return _0x4cc290;});}})[_0xae79('0x24')](respondWithFilteredResult(_0x4fe961,_0x365dd5))[_0xae79('0x2c')](handleError(_0x4fe961,null));};exports[_0xae79('0xb0')]=function(_0x1d803a,_0x4e8689,_0x4a4e43){return db['OpenchannelAccount'][_0xae79('0x59')]({'where':{'id':_0x1d803a[_0xae79('0x56')]['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x4e8689,null))[_0xae79('0x24')](function(_0x2e51ee){if(_0x2e51ee){return _0x2e51ee['addAgents'](_0x1d803a[_0xae79('0x5b')][_0xae79('0x6c')],_[_0xae79('0xb1')](_0x1d803a[_0xae79('0x5b')],[_0xae79('0x6c'),'id'])||{})[_0xae79('0xb2')](function(_0xbef256){for(var _0x9b1ee=0x0;_0x9b1ee<_0x1d803a[_0xae79('0x5b')][_0xae79('0x6c')][_0xae79('0x48')];_0x9b1ee+=0x1){socket[_0xae79('0xb3')](_0xae79('0xb4'),{'UserId':Number(_0x1d803a[_0xae79('0x5b')]['ids'][_0x9b1ee]),'OpenchannelAccountId':Number(_0x1d803a[_0xae79('0x56')]['id'])});}return _0xbef256;});}})['then'](respondWithResult(_0x4e8689,null))['catch'](handleError(_0x4e8689,null));};exports[_0xae79('0xb5')]=function(_0xe49647,_0x4d8c55,_0x172f78){return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0xe49647['params']['id']}})['then'](handleEntityNotFound(_0x4d8c55,null))['then'](function(_0x441492){if(_0x441492){return _0x441492[_0xae79('0xb5')](_0xe49647[_0xae79('0x44')][_0xae79('0x6c')])[_0xae79('0x24')](function(){if(_[_0xae79('0xb6')](_0xe49647[_0xae79('0x44')]['ids'])){for(var _0x2bb823=0x0;_0x2bb823<_0xe49647[_0xae79('0x44')]['ids'][_0xae79('0x48')];_0x2bb823+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0xe49647[_0xae79('0x44')][_0xae79('0x6c')][_0x2bb823]),'OpenchannelAccountId':Number(_0xe49647[_0xae79('0x56')]['id'])});}}else{socket[_0xae79('0xb3')](_0xae79('0xb7'),{'UserId':Number(_0xe49647['query'][_0xae79('0x6c')]),'OpenchannelAccountId':Number(_0xe49647[_0xae79('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x4d8c55,null))[_0xae79('0x2c')](handleError(_0x4d8c55,null));};exports[_0xae79('0xb8')]=function(_0x49dd8d,_0x11260f,_0x1eedc7){var _0x52625a={};var _0x2f316b={};var _0x1a5e4e;var _0x353e51;return db[_0xae79('0x50')]['findOne']({'where':{'id':_0x49dd8d['params']['id']}})['then'](handleEntityNotFound(_0x11260f,null))[_0xae79('0x24')](function(_0x10cdd2){if(_0x10cdd2){_0x1a5e4e=_0x10cdd2;_0x2f316b['model']=_[_0xae79('0x57')](db[_0xae79('0x9d')][_0xae79('0x40')]);_0x2f316b[_0xae79('0x44')]=_[_0xae79('0x57')](_0x49dd8d[_0xae79('0x44')]);_0x2f316b['filters']=_[_0xae79('0x46')](_0x2f316b[_0xae79('0x43')],_0x2f316b[_0xae79('0x44')]);_0x52625a['attributes']=_['intersection'](_0x2f316b[_0xae79('0x43')],qs[_0xae79('0x58')](_0x49dd8d['query']['fields']));_0x52625a[_0xae79('0x47')]=_0x52625a[_0xae79('0x47')][_0xae79('0x48')]?_0x52625a[_0xae79('0x47')]:_0x2f316b[_0xae79('0x43')];_0x52625a[_0xae79('0x69')]=qs[_0xae79('0x4a')](_0x49dd8d[_0xae79('0x44')][_0xae79('0x4a')]);_0x52625a[_0xae79('0x4b')]=qs[_0xae79('0x45')](_['pick'](_0x49dd8d[_0xae79('0x44')],_0x2f316b[_0xae79('0x45')]));if(_0x49dd8d['query'][_0xae79('0x4e')]){_0x52625a[_0xae79('0x4b')]=_['merge'](_0x52625a['where'],{'$or':_['map'](_0x52625a[_0xae79('0x47')],function(_0x502fc4){var _0x40986c={};_0x40986c[_0x502fc4]={'$like':'%'+_0x49dd8d[_0xae79('0x44')][_0xae79('0x4e')]+'%'};return _0x40986c;})});}_0x52625a=_[_0xae79('0x4d')]({},_0x52625a,_0x49dd8d[_0xae79('0x4f')]);return _0x1a5e4e[_0xae79('0xb8')](_0x52625a);}})[_0xae79('0x24')](function(_0x454809){if(_0x454809){_0x353e51=_0x454809[_0xae79('0x48')];if(!_0x49dd8d[_0xae79('0x44')][_0xae79('0x49')](_0xae79('0x68'))){_0x52625a[_0xae79('0x30')]=qs[_0xae79('0x30')](_0x49dd8d[_0xae79('0x44')][_0xae79('0x30')]);_0x52625a[_0xae79('0x31')]=qs[_0xae79('0x31')](_0x49dd8d[_0xae79('0x44')][_0xae79('0x31')]);}return _0x1a5e4e[_0xae79('0xb8')](_0x52625a);}})[_0xae79('0x24')](function(_0x3b34b4){if(_0x3b34b4){return _0x3b34b4?{'count':_0x353e51,'rows':_0x3b34b4}:null;}})[_0xae79('0x24')](respondWithResult(_0x11260f,null))[_0xae79('0x2c')](handleError(_0x11260f,null));};exports[_0xae79('0x3b')]=function(_0x1dc02f,_0x2d4d25,_0x1390e7){var _0x390eb5,_0x159e14,_0x1d37ef;if(_['isNil'](_0x1dc02f[_0xae79('0x5b')][_0xae79('0x5b')])||_0x1dc02f[_0xae79('0x5b')][_0xae79('0x5b')]===''){throw new db['Sequelize'][(_0xae79('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1dc02f[_0xae79('0x5b')]['to'])){}_0x390eb5=_0x1dc02f[_0xae79('0x5b')]['to'];return db[_0xae79('0x50')][_0xae79('0x67')]({'where':{'id':_0x1dc02f['params']['id']}})[_0xae79('0x24')](handleEntityNotFound(_0x2d4d25,null))['then'](function(_0x2173d1){if(_0x2173d1){return db[_0xae79('0x50')][_0xae79('0x59')]({'where':{'id':_0x2173d1['id']},'include':[{'model':db[_0xae79('0x81')],'as':_0xae79('0x82'),'include':[{'model':db[_0xae79('0x83')],'as':_0xae79('0x84'),'where':{[_0x2173d1['mapKey']]:_0x390eb5},'limit':0x1,'order':[[_0xae79('0x76'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x2d4d25,null))[_0xae79('0x24')](function(_0x4e6cd8){if(_0x4e6cd8&&_0x4e6cd8[_0xae79('0x82')]){_0x159e14=_0x4e6cd8['get']({'plain':!![]});if(_0x159e14[_0xae79('0x82')]&&_0x159e14[_0xae79('0x82')]['Contacts'][_0xae79('0x48')]){return _0x159e14[_0xae79('0x82')][_0xae79('0x84')][0x0];}return db[_0xae79('0x83')][_0xae79('0x5a')](_[_0xae79('0x1d')](_0x1dc02f[_0xae79('0x5b')],{'firstName':_0x390eb5,[_0x4e6cd8[_0xae79('0x7d')]]:_0x390eb5,'phone':_0x390eb5,'ListId':_0x159e14[_0xae79('0x78')]}));}})[_0xae79('0x24')](handleEntityNotFound(_0x2d4d25,null))[_0xae79('0x24')](function(_0x3045ac){if(_0x3045ac){_0x1d37ef=_0x3045ac;return db[_0xae79('0x8f')]['find']({'where':{'ContactId':_0x1d37ef['id'],'closed':![],'OpenchannelAccountId':_0x159e14['id']}})[_0xae79('0x24')](function(_0x32264b){if(_0x32264b){return[_0x32264b,![]];}return db[_0xae79('0x8f')][_0xae79('0x5a')]({'UserId':_0x1dc02f[_0xae79('0x5c')]['id'],'ContactId':_0x1d37ef['id'],'OpenchannelAccountId':_0x159e14['id'],'lastMsgDirection':'out','Messages':[_[_0xae79('0x4d')](_0x1dc02f[_0xae79('0x5b')],{'read':![],'body':_0x1dc02f[_0xae79('0x5b')][_0xae79('0x5b')],'OpenchannelAccountId':_0x159e14['id'],'UserId':_0x1dc02f[_0xae79('0x5c')]['id'],'ContactId':_0x1d37ef['id']})]},{'include':[{'model':db[_0xae79('0x9a')],'as':_0xae79('0xb9')}]})[_0xae79('0x24')](function(_0x42ebce){return[_0x42ebce,!![]];});});}})[_0xae79('0xb2')](function(_0x31ddf5,_0x1d9604){if(_0x1d9604){return _0x31ddf5;}return db['OpenchannelMessage']['create'](_['merge'](_0x1dc02f['body'],{'read':![],'body':_0x1dc02f[_0xae79('0x5b')][_0xae79('0x5b')],'OpenchannelAccountId':_0x159e14['id'],'OpenchannelInteractionId':_0x31ddf5['id'],'UserId':_0x1dc02f['user']['id'],'ContactId':_0x1d37ef['id']}))['then'](function(_0x21b1f3){_0x31ddf5[_0xae79('0xba')]['Messages']=[];_0x31ddf5[_0xae79('0xba')][_0xae79('0xb9')][_0xae79('0x96')](_0x21b1f3['dataValues']);return _0x31ddf5;});});}})[_0xae79('0x24')](respondWithResult(_0x2d4d25,null))[_0xae79('0x2c')](handleError(_0x2d4d25,null));};
\ No newline at end of file
+var _0x54bd=['CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','mapKey','includes','CmList','List','Contacts','account','applications','Applications','list','priority','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','close','unmanaged','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','addApplications','sequelize','transaction','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','get','OpenchannelAccounts','send','Pause','OpenchannelAccount','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','mandatoryDispositionPause','rawAttributes','create','body','user','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','sort','OpenchannelAccountId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel'];(function(_0x1529a3,_0x529f63){var _0x1a0d4b=function(_0x6f1058){while(--_0x6f1058){_0x1529a3['push'](_0x1529a3['shift']());}};_0x1a0d4b(++_0x529f63);}(_0x54bd,0xf7));var _0xd54b=function(_0x6686fb,_0x5b31b1){_0x6686fb=_0x6686fb-0x0;var _0x1e4fba=_0x54bd[_0x6686fb];return _0x1e4fba;};'use strict';var emlformat=require(_0xd54b('0x0'));var rimraf=require(_0xd54b('0x1'));var zipdir=require(_0xd54b('0x2'));var jsonpatch=require(_0xd54b('0x3'));var rp=require(_0xd54b('0x4'));var moment=require(_0xd54b('0x5'));var BPromise=require(_0xd54b('0x6'));var Mustache=require(_0xd54b('0x7'));var util=require(_0xd54b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd54b('0x9'));var ejs=require(_0xd54b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd54b('0xb'));var squel=require(_0xd54b('0xc'));var crypto=require(_0xd54b('0xd'));var jsforce=require(_0xd54b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd54b('0x9'));var querystring=require('querystring');var Papa=require(_0xd54b('0xf'));var Redis=require(_0xd54b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd54b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd54b('0x12'))('api');var utils=require(_0xd54b('0x13'));var config=require(_0xd54b('0x14'));var licenseUtil=require(_0xd54b('0x15'));var db=require(_0xd54b('0x16'))['db'];config[_0xd54b('0x17')]=_[_0xd54b('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd54b('0x19'))(new Redis(config[_0xd54b('0x17')]));require(_0xd54b('0x1a'))['register'](socket);var jayson=require(_0xd54b('0x1b'));var client=jayson[_0xd54b('0x1c')][_0xd54b('0x1d')]({'port':0x232c});var client9002=jayson[_0xd54b('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x928d40,_0x3bd1cf,_0x2d1495,_0x57ee2e){return new BPromise(function(_0x4dd139,_0x449b1e){var _0x3f429f=_0x57ee2e||client;return _0x3f429f[_0xd54b('0x1e')](_0x928d40,_0x2d1495)[_0xd54b('0x1f')](function(_0x46991b){logger[_0xd54b('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x3bd1cf,'request\x20sent');logger[_0xd54b('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x3bd1cf,_0xd54b('0x22'),JSON['stringify'](_0x46991b));if(_0x46991b[_0xd54b('0x23')]){if(_0x46991b['error'][_0xd54b('0x24')]===0x1f4){logger[_0xd54b('0x23')](_0xd54b('0x25'),_0x3bd1cf,_0x46991b[_0xd54b('0x23')][_0xd54b('0x26')]);return _0x449b1e(_0x46991b[_0xd54b('0x23')][_0xd54b('0x26')]);}logger[_0xd54b('0x23')](_0xd54b('0x25'),_0x3bd1cf,_0x46991b[_0xd54b('0x23')][_0xd54b('0x26')]);return _0x4dd139(_0x46991b[_0xd54b('0x23')][_0xd54b('0x26')]);}else{logger['info'](_0xd54b('0x25'),_0x3bd1cf,'request\x20sent');_0x4dd139(_0x46991b[_0xd54b('0x27')]['message']);}})['catch'](function(_0x1e2f03){logger['error'](_0xd54b('0x25'),_0x3bd1cf,_0x1e2f03);_0x449b1e(_0x1e2f03);});});}function respondWithStatusCode(_0x53261e,_0xc08858){_0xc08858=_0xc08858||0xcc;return function(_0xb0c63e){if(_0xb0c63e){return _0x53261e['sendStatus'](_0xc08858);}return _0x53261e[_0xd54b('0x28')](_0xc08858)[_0xd54b('0x29')]();};}function respondWithResult(_0x211a49,_0x52a4ae){_0x52a4ae=_0x52a4ae||0xc8;return function(_0x49f359){if(_0x49f359){return _0x211a49['status'](_0x52a4ae)[_0xd54b('0x2a')](_0x49f359);}};}function respondWithFilteredResult(_0x3e55eb,_0x5a844d){return function(_0x2166ab){if(_0x2166ab){var _0x404017=typeof _0x5a844d[_0xd54b('0x2b')]==='undefined'&&typeof _0x5a844d[_0xd54b('0x2c')]==='undefined';var _0x52ea65=_0x2166ab[_0xd54b('0x2d')];var _0x2cb0ab=_0x404017?0x0:_0x5a844d['offset'];var _0x430605=_0x404017?_0x2166ab[_0xd54b('0x2d')]:_0x5a844d[_0xd54b('0x2b')]+_0x5a844d['limit'];var _0x3716ae;if(_0x430605>=_0x52ea65){_0x430605=_0x52ea65;_0x3716ae=0xc8;}else{_0x3716ae=0xce;}_0x3e55eb[_0xd54b('0x28')](_0x3716ae);return _0x3e55eb[_0xd54b('0x2e')]('Content-Range',_0x2cb0ab+'-'+_0x430605+'/'+_0x52ea65)[_0xd54b('0x2a')](_0x2166ab);}return null;};}function patchUpdates(_0x59c412){return function(_0x5849f9){try{jsonpatch[_0xd54b('0x2f')](_0x5849f9,_0x59c412,!![]);}catch(_0x1c36fc){return BPromise[_0xd54b('0x30')](_0x1c36fc);}return _0x5849f9[_0xd54b('0x31')]();};}function saveUpdates(_0x4f01ce,_0x2a19d1){return function(_0x3b7136){if(_0x3b7136){return _0x3b7136[_0xd54b('0x32')](_0x4f01ce)[_0xd54b('0x1f')](function(_0x5a2370){return _0x5a2370;});}return null;};}function removeEntity(_0x13cbf2,_0x1667b8){return function(_0x1c3327){if(_0x1c3327){return _0x1c3327[_0xd54b('0x33')]()['then'](function(){var _0x4b216c=_0x1c3327[_0xd54b('0x34')]({'plain':!![]});var _0x32c7bc=_0xd54b('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x32c7bc,'resourceId':_0x4b216c['id']}})['then'](function(){return _0x1c3327;});})[_0xd54b('0x1f')](function(){_0x13cbf2[_0xd54b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b5e8f,_0x4cf0f9){return function(_0x478db4){if(!_0x478db4){_0x5b5e8f['sendStatus'](0x194);}return _0x478db4;};}function handleError(_0x83e3db,_0x460453){_0x460453=_0x460453||0x1f4;return function(_0x257bff){logger[_0xd54b('0x23')](_0x257bff['stack']);if(_0x257bff['name']){delete _0x257bff['name'];}_0x83e3db[_0xd54b('0x28')](_0x460453)[_0xd54b('0x36')](_0x257bff);};}exports['index']=function(_0x410bea,_0x2b6daa){var _0x3cc7db={'include':[{'model':db[_0xd54b('0x37')],'as':'mandatoryDispositionPause'}]},_0x3cfeee={},_0x4410a6={'count':0x0,'rows':[]};var _0x3d3a96=_['map'](db[_0xd54b('0x38')]['rawAttributes'],function(_0x4e092f){return{'name':_0x4e092f['fieldName'],'type':_0x4e092f[_0xd54b('0x39')][_0xd54b('0x3a')]};});_0x3cfeee[_0xd54b('0x3b')]=_[_0xd54b('0x3c')](_0x3d3a96,_0xd54b('0x3d'));_0x3cfeee[_0xd54b('0x3e')]=_[_0xd54b('0x3f')](_0x410bea['query']);_0x3cfeee[_0xd54b('0x40')]=_['intersection'](_0x3cfeee[_0xd54b('0x3b')],_0x3cfeee['query']);_0x3cc7db['attributes']=_[_0xd54b('0x41')](_0x3cfeee[_0xd54b('0x3b')],qs[_0xd54b('0x42')](_0x410bea[_0xd54b('0x3e')][_0xd54b('0x42')]));_0x3cc7db[_0xd54b('0x43')]=_0x3cc7db[_0xd54b('0x43')][_0xd54b('0x44')]?_0x3cc7db[_0xd54b('0x43')]:_0x3cfeee[_0xd54b('0x3b')];if(!_0x410bea[_0xd54b('0x3e')][_0xd54b('0x45')](_0xd54b('0x46'))){_0x3cc7db[_0xd54b('0x2c')]=qs[_0xd54b('0x2c')](_0x410bea[_0xd54b('0x3e')][_0xd54b('0x2c')]);_0x3cc7db[_0xd54b('0x2b')]=qs['offset'](_0x410bea[_0xd54b('0x3e')][_0xd54b('0x2b')]);}_0x3cc7db[_0xd54b('0x47')]=qs['sort'](_0x410bea[_0xd54b('0x3e')]['sort']);_0x3cc7db[_0xd54b('0x48')]=qs[_0xd54b('0x40')](_[_0xd54b('0x49')](_0x410bea[_0xd54b('0x3e')],_0x3cfeee['filters']),_0x3d3a96);if(_0x410bea[_0xd54b('0x3e')]['filter']){_0x3cc7db[_0xd54b('0x48')]=_[_0xd54b('0x4a')](_0x3cc7db['where'],{'$or':_[_0xd54b('0x3c')](_0x3d3a96,function(_0x40d889){if(_0x40d889[_0xd54b('0x39')]!==_0xd54b('0x4b')){var _0x1d9e10={};_0x1d9e10[_0x40d889['name']]={'$like':'%'+_0x410bea[_0xd54b('0x3e')][_0xd54b('0x4c')]+'%'};return _0x1d9e10;}})});}_0x3cc7db=_[_0xd54b('0x4a')]({},_0x3cc7db,_0x410bea[_0xd54b('0x4d')]);var _0x564ab2={'where':_0x3cc7db[_0xd54b('0x48')]};return db[_0xd54b('0x38')][_0xd54b('0x2d')](_0x564ab2)[_0xd54b('0x1f')](function(_0x4ec126){_0x4410a6[_0xd54b('0x2d')]=_0x4ec126;if(_0x410bea['query'][_0xd54b('0x4e')]){_0x3cc7db[_0xd54b('0x4f')]=[{'all':!![]}];}return db[_0xd54b('0x38')][_0xd54b('0x50')](_0x3cc7db);})[_0xd54b('0x1f')](function(_0x3601b2){_0x4410a6['rows']=_0x3601b2;return _0x4410a6;})[_0xd54b('0x1f')](respondWithFilteredResult(_0x2b6daa,_0x3cc7db))[_0xd54b('0x51')](handleError(_0x2b6daa,null));};exports[_0xd54b('0x52')]=function(_0x51d89f,_0x2f8298){var _0x493eb7={'raw':![],'where':{'id':_0x51d89f[_0xd54b('0x53')]['id']},'include':[{'model':db[_0xd54b('0x37')],'as':_0xd54b('0x54')}]},_0x2b99f2={};_0x2b99f2[_0xd54b('0x3b')]=_[_0xd54b('0x3f')](db['OpenchannelAccount'][_0xd54b('0x55')]);_0x2b99f2[_0xd54b('0x3e')]=_[_0xd54b('0x3f')](_0x51d89f[_0xd54b('0x3e')]);_0x2b99f2[_0xd54b('0x40')]=_[_0xd54b('0x41')](_0x2b99f2[_0xd54b('0x3b')],_0x2b99f2['query']);_0x493eb7['attributes']=_['intersection'](_0x2b99f2['model'],qs[_0xd54b('0x42')](_0x51d89f[_0xd54b('0x3e')][_0xd54b('0x42')]));_0x493eb7[_0xd54b('0x43')]=_0x493eb7[_0xd54b('0x43')]['length']?_0x493eb7[_0xd54b('0x43')]:_0x2b99f2[_0xd54b('0x3b')];if(_0x51d89f[_0xd54b('0x3e')]['includeAll']){_0x493eb7[_0xd54b('0x4f')]=[{'all':!![]}];}_0x493eb7=_[_0xd54b('0x4a')]({},_0x493eb7,_0x51d89f[_0xd54b('0x4d')]);return db[_0xd54b('0x38')]['find'](_0x493eb7)[_0xd54b('0x1f')](handleEntityNotFound(_0x2f8298,null))[_0xd54b('0x1f')](respondWithResult(_0x2f8298,null))['catch'](handleError(_0x2f8298,null));};exports[_0xd54b('0x56')]=function(_0x21f9ee,_0x239bf5){return db['OpenchannelAccount'][_0xd54b('0x56')](_0x21f9ee[_0xd54b('0x57')],{})[_0xd54b('0x1f')](function(_0x311caa){var _0x3bb7ed=_0x21f9ee['user'][_0xd54b('0x34')]({'plain':!![]});if(!_0x3bb7ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bb7ed['role']===_0xd54b('0x58')){var _0x5959a1=_0x311caa['get']({'plain':!![]});var _0x271407=_0xd54b('0x35');return db[_0xd54b('0x59')][_0xd54b('0x5a')]({'where':{'name':_0x271407,'userProfileId':_0x3bb7ed['userProfileId']},'raw':!![]})[_0xd54b('0x1f')](function(_0x564423){if(_0x564423&&_0x564423['autoAssociation']===0x0){return db[_0xd54b('0x5b')][_0xd54b('0x56')]({'name':_0x5959a1[_0xd54b('0x3d')],'resourceId':_0x5959a1['id'],'type':_0x564423[_0xd54b('0x3d')],'sectionId':_0x564423['id']},{})[_0xd54b('0x1f')](function(){return _0x311caa;});}else{return _0x311caa;}})[_0xd54b('0x51')](function(_0x131bb0){logger[_0xd54b('0x23')](_0xd54b('0x5c'),_0x131bb0);throw _0x131bb0;});}return _0x311caa;})[_0xd54b('0x1f')](respondWithResult(_0x239bf5,0xc9))[_0xd54b('0x51')](handleError(_0x239bf5,null));};exports[_0xd54b('0x32')]=function(_0x27887e,_0x52eeb6){if(_0x27887e[_0xd54b('0x57')]['id']){delete _0x27887e[_0xd54b('0x57')]['id'];}return db['OpenchannelAccount'][_0xd54b('0x5a')]({'where':{'id':_0x27887e[_0xd54b('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0xd54b('0x54')}]})['then'](handleEntityNotFound(_0x52eeb6,null))[_0xd54b('0x1f')](saveUpdates(_0x27887e['body'],null))[_0xd54b('0x1f')](respondWithResult(_0x52eeb6,null))[_0xd54b('0x51')](handleError(_0x52eeb6,null));};exports[_0xd54b('0x33')]=function(_0x2cec25,_0xf32769){return db[_0xd54b('0x38')]['find']({'where':{'id':_0x2cec25['params']['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0xf32769,null))[_0xd54b('0x1f')](removeEntity(_0xf32769,null))[_0xd54b('0x51')](handleError(_0xf32769,null));};exports[_0xd54b('0x5d')]=function(_0x2bcfad,_0x2b4f02){return db[_0xd54b('0x38')][_0xd54b('0x5d')]()[_0xd54b('0x1f')](respondWithResult(_0x2b4f02,null))[_0xd54b('0x51')](handleError(_0x2b4f02,null));};exports[_0xd54b('0x5e')]=function(_0x105b3b,_0x479c68,_0x3e70d8){if(_0x105b3b[_0xd54b('0x57')]['id']){delete _0x105b3b['body']['id'];}return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0x105b3b['params']['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x479c68,null))['then'](function(_0x26c66f){if(_0x26c66f){_0x105b3b[_0xd54b('0x57')]['OpenchannelAccountId']=_0x26c66f['id'];return db[_0xd54b('0x5f')][_0xd54b('0x56')](_0x105b3b[_0xd54b('0x57')]);}})[_0xd54b('0x1f')](respondWithResult(_0x479c68,null))[_0xd54b('0x51')](handleError(_0x479c68,null));};exports[_0xd54b('0x60')]=function(_0x2a4b2e,_0x44b5f6,_0x482dda){var _0xbb2f80={'raw':![],'where':{}};var _0x4cbc1b={};var _0x4d4cb7={'count':0x0,'rows':[]};return db[_0xd54b('0x38')][_0xd54b('0x61')]({'where':{'id':_0x2a4b2e[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x44b5f6,null))[_0xd54b('0x1f')](function(_0x10c8ce){if(_0x10c8ce){_0x4cbc1b[_0xd54b('0x3b')]=_[_0xd54b('0x3f')](db[_0xd54b('0x5f')][_0xd54b('0x55')]);_0x4cbc1b[_0xd54b('0x3e')]=_[_0xd54b('0x3f')](_0x2a4b2e[_0xd54b('0x3e')]);_0x4cbc1b['filters']=_['intersection'](_0x4cbc1b[_0xd54b('0x3b')],_0x4cbc1b[_0xd54b('0x3e')]);_0xbb2f80[_0xd54b('0x43')]=_[_0xd54b('0x41')](_0x4cbc1b[_0xd54b('0x3b')],qs['fields'](_0x2a4b2e['query'][_0xd54b('0x42')]));_0xbb2f80[_0xd54b('0x43')]=_0xbb2f80[_0xd54b('0x43')][_0xd54b('0x44')]?_0xbb2f80['attributes']:_0x4cbc1b[_0xd54b('0x3b')];if(!_0x2a4b2e[_0xd54b('0x3e')][_0xd54b('0x45')](_0xd54b('0x46'))){_0xbb2f80[_0xd54b('0x2c')]=qs[_0xd54b('0x2c')](_0x2a4b2e[_0xd54b('0x3e')]['limit']);_0xbb2f80[_0xd54b('0x2b')]=qs[_0xd54b('0x2b')](_0x2a4b2e['query'][_0xd54b('0x2b')]);}_0xbb2f80[_0xd54b('0x47')]=qs[_0xd54b('0x62')](_0x2a4b2e[_0xd54b('0x3e')][_0xd54b('0x62')]);_0xbb2f80[_0xd54b('0x48')]=qs[_0xd54b('0x40')](_[_0xd54b('0x49')](_0x2a4b2e[_0xd54b('0x3e')],_0x4cbc1b[_0xd54b('0x40')]));_0xbb2f80[_0xd54b('0x48')][_0xd54b('0x63')]=_0x10c8ce['id'];if(_0x2a4b2e['query'][_0xd54b('0x4c')]){_0xbb2f80[_0xd54b('0x48')]=_[_0xd54b('0x4a')](_0xbb2f80[_0xd54b('0x48')],{'$or':_[_0xd54b('0x3c')](_0xbb2f80['attributes'],function(_0x24b6d4){var _0x17beb4={};_0x17beb4[_0x24b6d4]={'$like':'%'+_0x2a4b2e[_0xd54b('0x3e')][_0xd54b('0x4c')]+'%'};return _0x17beb4;})});}_0xbb2f80=_['merge']({},_0xbb2f80,_0x2a4b2e[_0xd54b('0x4d')]);return db['Disposition'][_0xd54b('0x2d')]({'where':_0xbb2f80[_0xd54b('0x48')]})['then'](function(_0x1ffaf5){_0x4d4cb7['count']=_0x1ffaf5;if(_0x2a4b2e[_0xd54b('0x3e')]['includeAll']){_0xbb2f80[_0xd54b('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0xd54b('0x50')](_0xbb2f80);})['then'](function(_0xa6a8e9){_0x4d4cb7[_0xd54b('0x64')]=_0xa6a8e9;return _0x4d4cb7;});}})[_0xd54b('0x1f')](respondWithFilteredResult(_0x44b5f6,_0xbb2f80))[_0xd54b('0x51')](handleError(_0x44b5f6,null));};exports[_0xd54b('0x65')]=function(_0x32c0ef,_0x5785ee,_0x300b06){return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0x32c0ef[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x5785ee,null))[_0xd54b('0x1f')](function(_0xc011c7){if(_0xc011c7){return _0xc011c7[_0xd54b('0x65')](_0x32c0ef[_0xd54b('0x3e')][_0xd54b('0x66')]);}})[_0xd54b('0x1f')](respondWithStatusCode(_0x5785ee,null))[_0xd54b('0x51')](handleError(_0x5785ee,null));};exports[_0xd54b('0x67')]=function(_0x2f5d52,_0x1e4ae1,_0x50a6a5){if(_0x2f5d52['body']['id']){delete _0x2f5d52[_0xd54b('0x57')]['id'];}return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0x2f5d52[_0xd54b('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e4ae1,null))[_0xd54b('0x1f')](function(_0x6fc1e1){if(_0x6fc1e1){_0x2f5d52['body']['OpenchannelAccountId']=_0x6fc1e1['id'];return db[_0xd54b('0x68')]['create'](_0x2f5d52[_0xd54b('0x57')]);}})[_0xd54b('0x1f')](respondWithResult(_0x1e4ae1,null))[_0xd54b('0x51')](handleError(_0x1e4ae1,null));};exports[_0xd54b('0x69')]=function(_0xede400,_0x4b53dc,_0x16a2d2){var _0xb7516a={'raw':![],'where':{}};var _0x485540={};var _0x1df571={'count':0x0,'rows':[]};return db[_0xd54b('0x38')][_0xd54b('0x61')]({'where':{'id':_0xede400[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x4b53dc,null))['then'](function(_0x308a7e){if(_0x308a7e){_0x485540[_0xd54b('0x3b')]=_['keys'](db[_0xd54b('0x68')][_0xd54b('0x55')]);_0x485540[_0xd54b('0x3e')]=_[_0xd54b('0x3f')](_0xede400['query']);_0x485540[_0xd54b('0x40')]=_[_0xd54b('0x41')](_0x485540[_0xd54b('0x3b')],_0x485540[_0xd54b('0x3e')]);_0xb7516a[_0xd54b('0x43')]=_[_0xd54b('0x41')](_0x485540[_0xd54b('0x3b')],qs[_0xd54b('0x42')](_0xede400['query'][_0xd54b('0x42')]));_0xb7516a['attributes']=_0xb7516a[_0xd54b('0x43')][_0xd54b('0x44')]?_0xb7516a[_0xd54b('0x43')]:_0x485540[_0xd54b('0x3b')];if(!_0xede400[_0xd54b('0x3e')][_0xd54b('0x45')](_0xd54b('0x46'))){_0xb7516a[_0xd54b('0x2c')]=qs[_0xd54b('0x2c')](_0xede400[_0xd54b('0x3e')][_0xd54b('0x2c')]);_0xb7516a[_0xd54b('0x2b')]=qs['offset'](_0xede400[_0xd54b('0x3e')][_0xd54b('0x2b')]);}_0xb7516a['order']=qs['sort'](_0xede400[_0xd54b('0x3e')][_0xd54b('0x62')]);_0xb7516a[_0xd54b('0x48')]=qs['filters'](_[_0xd54b('0x49')](_0xede400[_0xd54b('0x3e')],_0x485540[_0xd54b('0x40')]));_0xb7516a['where'][_0xd54b('0x63')]=_0x308a7e['id'];if(_0xede400[_0xd54b('0x3e')][_0xd54b('0x4c')]){_0xb7516a[_0xd54b('0x48')]=_['merge'](_0xb7516a[_0xd54b('0x48')],{'$or':_[_0xd54b('0x3c')](_0xb7516a[_0xd54b('0x43')],function(_0x2e9a18){var _0x427c28={};_0x427c28[_0x2e9a18]={'$like':'%'+_0xede400[_0xd54b('0x3e')][_0xd54b('0x4c')]+'%'};return _0x427c28;})});}_0xb7516a=_[_0xd54b('0x4a')]({},_0xb7516a,_0xede400[_0xd54b('0x4d')]);return db[_0xd54b('0x68')][_0xd54b('0x2d')]({'where':_0xb7516a[_0xd54b('0x48')]})[_0xd54b('0x1f')](function(_0x5ca268){_0x1df571[_0xd54b('0x2d')]=_0x5ca268;if(_0xede400['query'][_0xd54b('0x4e')]){_0xb7516a[_0xd54b('0x4f')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd54b('0x50')](_0xb7516a);})[_0xd54b('0x1f')](function(_0x2616aa){_0x1df571[_0xd54b('0x64')]=_0x2616aa;return _0x1df571;});}})[_0xd54b('0x1f')](respondWithFilteredResult(_0x4b53dc,_0xb7516a))[_0xd54b('0x51')](handleError(_0x4b53dc,null));};exports[_0xd54b('0x6a')]=function(_0xd55f25,_0x5d57de,_0x1ad616){return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0xd55f25[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x5d57de,null))[_0xd54b('0x1f')](function(_0x2001d2){if(_0x2001d2){return _0x2001d2[_0xd54b('0x6a')](_0xd55f25[_0xd54b('0x3e')][_0xd54b('0x66')]);}})[_0xd54b('0x1f')](respondWithStatusCode(_0x5d57de,null))[_0xd54b('0x51')](handleError(_0x5d57de,null));};exports[_0xd54b('0x6b')]=function(_0x14f524,_0x1a43b8,_0x2f27b2){var _0x54a924={'body':_0x14f524[_0xd54b('0x57')],'channel':_0xd54b('0x6c')};var _0x460121=[];var _0x8811ca=[];var _0x5dfe63={};var _0x415c09=![];return db[_0xd54b('0x6d')][_0xd54b('0x5d')]()[_0xd54b('0x1f')](function(_0x450223){if(!_0x450223){throw new db[(_0xd54b('0x6e'))][(_0xd54b('0x6f'))]('no\x20available\x20attributes');}_0x460121=_[_0xd54b('0x70')](_[_0xd54b('0x3f')](_0x450223),[_0xd54b('0x71'),'updatedAt']);_0x8811ca=_[_0xd54b('0x70')](_[_0xd54b('0x3f')](_0x450223),[_0xd54b('0x71'),_0xd54b('0x72'),'CompanyId',_0xd54b('0x73')]);if(_0x14f524[_0xd54b('0x57')]['id']){delete _0x14f524[_0xd54b('0x57')]['id'];}if(_[_0xd54b('0x74')](_0x14f524['body'][_0xd54b('0x75')])){throw new db['Sequelize'][(_0xd54b('0x6f'))](_0xd54b('0x76'));}if(_[_0xd54b('0x74')](_0x14f524['body'][_0xd54b('0x57')])||_0x14f524[_0xd54b('0x57')][_0xd54b('0x57')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd54b('0x74')](_0x14f524[_0xd54b('0x57')][_0xd54b('0x77')])){throw new db[(_0xd54b('0x6e'))][(_0xd54b('0x6f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8811ca);}if(!_[_0xd54b('0x78')](_0x8811ca,_0x14f524[_0xd54b('0x57')][_0xd54b('0x77')])){throw new db[(_0xd54b('0x6e'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8811ca);}_0x5dfe63[_0x14f524['body'][_0xd54b('0x77')]]=_0x14f524[_0xd54b('0x57')]['from'];})['then'](function(){return db['OpenchannelAccount'][_0xd54b('0x5a')]({'where':{'id':_0x14f524[_0xd54b('0x53')]['id']},'include':[{'model':db[_0xd54b('0x79')],'as':_0xd54b('0x7a'),'include':[{'model':db['CmContact'],'as':_0xd54b('0x7b'),'where':_0x5dfe63,'limit':0x1,'order':[[_0xd54b('0x72'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x1a43b8,null))[_0xd54b('0x1f')](function(_0x4d7e24){if(_0x4d7e24&&_0x4d7e24[_0xd54b('0x7a')]){_0x54a924[_0xd54b('0x7c')]=_0x4d7e24;_0x54a924[_0xd54b('0x7d')]=_0x4d7e24[_0xd54b('0x7e')];_0x54a924[_0xd54b('0x7f')]=_0x4d7e24['List'];_0x54a924['applications']=_['orderBy'](_0x54a924[_0xd54b('0x7d')],[_0xd54b('0x80')],['asc']);if(_0x54a924[_0xd54b('0x7c')][_0xd54b('0x7e')]){delete _0x54a924[_0xd54b('0x7c')][_0xd54b('0x7e')];}if(_0x54a924[_0xd54b('0x7c')]['List']&&_0x54a924[_0xd54b('0x7c')][_0xd54b('0x7a')][_0xd54b('0x7b')]['length']){return _0x54a924[_0xd54b('0x7c')][_0xd54b('0x7a')][_0xd54b('0x7b')][0x0];}var _0x5f4b26=_[_0xd54b('0x18')](_0x14f524[_0xd54b('0x57')],{'firstName':_0x14f524[_0xd54b('0x57')][_0xd54b('0x75')],'ListId':_0x4d7e24[_0xd54b('0x73')]});_0x5f4b26[_0x14f524[_0xd54b('0x57')][_0xd54b('0x77')]]=_0x14f524[_0xd54b('0x57')][_0xd54b('0x75')];return db[_0xd54b('0x6d')][_0xd54b('0x56')](_0x5f4b26,{'fields':_0x460121,'raw':!![]});}})[_0xd54b('0x1f')](handleEntityNotFound(_0x1a43b8,null))['then'](function(_0x290a6d){_0x54a924[_0xd54b('0x81')]=_0x290a6d;if(_0x290a6d){var _0x5cffb9={'ContactId':_0x290a6d['id'],'OpenchannelAccountId':_0x14f524[_0xd54b('0x53')]['id'],'from':(_0x290a6d[_0xd54b('0x82')]||'')+'\x20'+(_0x290a6d['lastName']||'')};var _0x3888fa={'OpenchannelAccountId':_0x14f524[_0xd54b('0x53')]['id'],'closed':![]};if(_0x14f524['body'][_0xd54b('0x83')]){_0x3888fa[_0xd54b('0x83')]=_0x14f524[_0xd54b('0x57')]['threadId'];return db[_0xd54b('0x84')][_0xd54b('0x5a')]({'where':_0x3888fa})[_0xd54b('0x1f')](function(_0x5c3f67){if(_0x5c3f67){return[_0x5c3f67,![]];}_0x5cffb9['threadId']=_0x14f524[_0xd54b('0x57')][_0xd54b('0x83')];_0x5cffb9['externalUrl']=_0x14f524['body'][_0xd54b('0x85')];return db[_0xd54b('0x84')][_0xd54b('0x56')](_0x5cffb9)[_0xd54b('0x1f')](function(_0x568df){return[_0x568df,!![]];});});}else{_0x3888fa[_0xd54b('0x83')]=null;}_0x3888fa['ContactId']=_0x290a6d['id'];return db[_0xd54b('0x84')]['find']({'where':_0x3888fa})['then'](function(_0x3857fb){if(_0x3857fb){return[_0x3857fb,![]];}return db[_0xd54b('0x84')]['create'](_0x5cffb9)[_0xd54b('0x1f')](function(_0x1acc5e){return[_0x1acc5e,!![]];});});}})[_0xd54b('0x86')](function(_0x474968,_0x4968a8){if(_0x474968){_0x415c09=_0x4968a8;if(!_0x4968a8){var _0x121fb6={'from':(_0x54a924[_0xd54b('0x81')][_0xd54b('0x82')]||'')+'\x20'+(_0x54a924[_0xd54b('0x81')]['lastName']||'')};if(_0x14f524[_0xd54b('0x57')][_0xd54b('0x83')]&&_0x14f524['body'][_0xd54b('0x87')]&&_0x14f524[_0xd54b('0x57')][_0xd54b('0x83')]!=_0x14f524[_0xd54b('0x57')][_0xd54b('0x87')]){_0x121fb6[_0xd54b('0x83')]=_0x14f524[_0xd54b('0x57')][_0xd54b('0x87')];}return _0x474968[_0xd54b('0x32')](_0x121fb6);}else{return _0x474968;}}})[_0xd54b('0x1f')](function(_0x7b5dc0){_0x54a924[_0xd54b('0x88')]=_0x7b5dc0['get']({'plain':!![]});_0x54a924[_0xd54b('0x88')][_0xd54b('0x89')]=_0x415c09;if(_0x54a924[_0xd54b('0x88')][_0xd54b('0x89')]){if(_0x54a924[_0xd54b('0x7c')][_0xd54b('0x8a')]){_0x54a924[_0xd54b('0x7d')]['push']({'id':0x0,'priority':_0x54a924[_0xd54b('0x7d')]['length']+0x1,'app':_0xd54b('0x8b'),'appdata':_0xd54b('0x8c'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x14f524[_0xd54b('0x57')][_0xd54b('0x57')],'OpenchannelAccountId':_0x14f524[_0xd54b('0x53')]['id'],'OpenchannelInteractionId':_0x7b5dc0['id'],'direction':'in','ContactId':_0x54a924[_0xd54b('0x81')]['id'],'AttachmentId':_0x14f524[_0xd54b('0x57')][_0xd54b('0x8d')]});})[_0xd54b('0x1f')](function(_0x4d18af){_0x54a924['message']=_0x4d18af;if(_0x54a924[_0xd54b('0x88')][_0xd54b('0x8e')]){return db[_0xd54b('0x8f')][_0xd54b('0x5a')]({'attributes':['id','name'],'where':{'id':_0x54a924[_0xd54b('0x88')][_0xd54b('0x8e')]}})['then'](function(_0x3881db){if(_0x3881db){_0x54a924[_0xd54b('0x7d')][_0xd54b('0x90')]({'id':0x0,'priority':0x0,'app':_0xd54b('0x91'),'appdata':_0x3881db[_0xd54b('0x3d')]+','+(_0x54a924[_0xd54b('0x7c')][_0xd54b('0x92')]||0xa),'interval':'*,*,*,*'});_0x54a924[_0xd54b('0x93')]=![];}return respondWithRpcPromise(_0xd54b('0x94'),'startRouting',_0x54a924);});}return respondWithRpcPromise(_0xd54b('0x94'),'startRouting',_0x54a924);})[_0xd54b('0x1f')](function(_0x499d92){respondWithRpcPromise(_0xd54b('0x95'),_0xd54b('0x95'),{'event':_0xd54b('0x6b'),'message':_0x499d92},client9002);return _0x499d92;})['then'](respondWithResult(_0x1a43b8,null))[_0xd54b('0x51')](handleError(_0x1a43b8,null));};exports[_0xd54b('0x96')]=function(_0x1c21f4,_0x22093f,_0x55f4d5){return db['OpenchannelAccount'][_0xd54b('0x61')]({'where':{'id':_0x1c21f4['params']['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x22093f,null))[_0xd54b('0x1f')](function(_0x30b1a2){if(_0x30b1a2){return db[_0xd54b('0x97')][_0xd54b('0x98')](function(_0x446536){return db[_0xd54b('0x99')]['destroy']({'where':{'OpenchannelAccountId':_0x1c21f4[_0xd54b('0x53')]['id']},'transaction':_0x446536})['then'](function(_0x3f1b08){var _0x2f7e24=_[_0xd54b('0x3c')](_0x1c21f4[_0xd54b('0x57')],function(_0x584e7f){_0x584e7f[_0xd54b('0x63')]=_0x1c21f4[_0xd54b('0x53')]['id'];return _0x584e7f;});return db['OpenchannelApplication'][_0xd54b('0x9a')](_0x2f7e24,{'transaction':_0x446536});});})['then'](function(){return db[_0xd54b('0x99')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1c21f4[_0xd54b('0x53')]['id']},'order':_0xd54b('0x80')});});}})['then'](respondWithResult(_0x22093f,null))[_0xd54b('0x51')](handleError(_0x22093f,null));};exports[_0xd54b('0x9b')]=function(_0xb8dc60,_0x2c777e,_0x18fa5b){var _0x2e5fd7={};var _0x4948ef={};var _0x4356f6;var _0x4a8a79;return db[_0xd54b('0x38')]['findOne']({'where':{'id':_0xb8dc60[_0xd54b('0x53')]['id']}})['then'](handleEntityNotFound(_0x2c777e,null))[_0xd54b('0x1f')](function(_0x3be7c2){if(_0x3be7c2){_0x4356f6=_0x3be7c2;_0x4948ef[_0xd54b('0x3b')]=_[_0xd54b('0x3f')](db['OpenchannelApplication'][_0xd54b('0x55')]);_0x4948ef[_0xd54b('0x3e')]=_['keys'](_0xb8dc60[_0xd54b('0x3e')]);_0x4948ef[_0xd54b('0x40')]=_['intersection'](_0x4948ef[_0xd54b('0x3b')],_0x4948ef['query']);_0x2e5fd7[_0xd54b('0x43')]=_[_0xd54b('0x41')](_0x4948ef['model'],qs[_0xd54b('0x42')](_0xb8dc60[_0xd54b('0x3e')]['fields']));_0x2e5fd7[_0xd54b('0x43')]=_0x2e5fd7[_0xd54b('0x43')][_0xd54b('0x44')]?_0x2e5fd7[_0xd54b('0x43')]:_0x4948ef[_0xd54b('0x3b')];_0x2e5fd7['order']=qs[_0xd54b('0x62')](_0xb8dc60[_0xd54b('0x3e')][_0xd54b('0x62')]);_0x2e5fd7[_0xd54b('0x48')]=qs[_0xd54b('0x40')](_[_0xd54b('0x49')](_0xb8dc60[_0xd54b('0x3e')],_0x4948ef[_0xd54b('0x40')]));if(_0xb8dc60[_0xd54b('0x3e')][_0xd54b('0x4c')]){_0x2e5fd7['where']=_[_0xd54b('0x4a')](_0x2e5fd7[_0xd54b('0x48')],{'$or':_['map'](_0x2e5fd7[_0xd54b('0x43')],function(_0x53288e){var _0x207ca2={};_0x207ca2[_0x53288e]={'$like':'%'+_0xb8dc60['query'][_0xd54b('0x4c')]+'%'};return _0x207ca2;})});}_0x2e5fd7=_[_0xd54b('0x4a')]({},_0x2e5fd7,_0xb8dc60[_0xd54b('0x4d')]);return _0x4356f6['getApplications'](_0x2e5fd7);}})[_0xd54b('0x1f')](function(_0x71aa6f){if(_0x71aa6f){_0x4a8a79=_0x71aa6f[_0xd54b('0x44')];if(!_0xb8dc60['query'][_0xd54b('0x45')]('nolimit')){_0x2e5fd7[_0xd54b('0x2c')]=qs[_0xd54b('0x2c')](_0xb8dc60[_0xd54b('0x3e')][_0xd54b('0x2c')]);_0x2e5fd7[_0xd54b('0x2b')]=qs[_0xd54b('0x2b')](_0xb8dc60[_0xd54b('0x3e')]['offset']);}return _0x4356f6['getApplications'](_0x2e5fd7);}})[_0xd54b('0x1f')](function(_0x251b6e){if(_0x251b6e){return _0x251b6e?{'count':_0x4a8a79,'rows':_0x251b6e}:null;}})[_0xd54b('0x1f')](respondWithResult(_0x2c777e,null))[_0xd54b('0x51')](handleError(_0x2c777e,null));};exports[_0xd54b('0x9c')]=function(_0x28002a,_0x2d5cd5,_0x559f7a){var _0x415923={'raw':![],'where':{}};var _0x57ab89={};var _0x42f172={'count':0x0,'rows':[]};return db[_0xd54b('0x38')][_0xd54b('0x61')]({'where':{'id':_0x28002a[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x2d5cd5,null))[_0xd54b('0x1f')](function(_0x596ac3){if(_0x596ac3){_0x57ab89[_0xd54b('0x3b')]=_[_0xd54b('0x3f')](db[_0xd54b('0x84')][_0xd54b('0x55')]);_0x57ab89[_0xd54b('0x3e')]=_[_0xd54b('0x3f')](_0x28002a[_0xd54b('0x3e')]);_0x57ab89[_0xd54b('0x40')]=_[_0xd54b('0x41')](_0x57ab89['model'],_0x57ab89[_0xd54b('0x3e')]);_0x415923[_0xd54b('0x43')]=_[_0xd54b('0x41')](_0x57ab89[_0xd54b('0x3b')],qs[_0xd54b('0x42')](_0x28002a['query'][_0xd54b('0x42')]));_0x415923[_0xd54b('0x43')]=_0x415923[_0xd54b('0x43')][_0xd54b('0x44')]?_0x415923[_0xd54b('0x43')]:_0x57ab89[_0xd54b('0x3b')];if(!_0x28002a[_0xd54b('0x3e')][_0xd54b('0x45')]('nolimit')){_0x415923[_0xd54b('0x2c')]=qs[_0xd54b('0x2c')](_0x28002a[_0xd54b('0x3e')]['limit']);_0x415923[_0xd54b('0x2b')]=qs[_0xd54b('0x2b')](_0x28002a['query'][_0xd54b('0x2b')]);}_0x415923[_0xd54b('0x47')]=qs[_0xd54b('0x62')](_0x28002a[_0xd54b('0x3e')][_0xd54b('0x62')]);_0x415923[_0xd54b('0x48')]=qs[_0xd54b('0x40')](_[_0xd54b('0x49')](_0x28002a[_0xd54b('0x3e')],_0x57ab89[_0xd54b('0x40')]));_0x415923['where']['OpenchannelAccountId']=_0x596ac3['id'];if(_0x28002a[_0xd54b('0x3e')][_0xd54b('0x4c')]){_0x415923[_0xd54b('0x48')]=_['merge'](_0x415923['where'],{'$or':_['map'](_0x415923[_0xd54b('0x43')],function(_0x46575a){var _0x440fd9={};_0x440fd9[_0x46575a]={'$like':'%'+_0x28002a[_0xd54b('0x3e')][_0xd54b('0x4c')]+'%'};return _0x440fd9;})});}_0x415923=_['merge']({},_0x415923,_0x28002a['options']);return db[_0xd54b('0x84')][_0xd54b('0x2d')]({'where':_0x415923['where']})[_0xd54b('0x1f')](function(_0x467aa5){_0x42f172[_0xd54b('0x2d')]=_0x467aa5;if(_0x28002a['query'][_0xd54b('0x4e')]){_0x415923[_0xd54b('0x4f')]=[{'model':db[_0xd54b('0x6d')],'as':_0xd54b('0x9d'),'required':![]},{'model':db[_0xd54b('0x8f')],'as':_0xd54b('0x9e'),'attributes':[_0xd54b('0x3d'),_0xd54b('0x9f'),_0xd54b('0xa0')],'required':![]},{'model':db[_0xd54b('0xa1')],'as':'Tags','attributes':['id','name',_0xd54b('0xa2')],'where':_0x28002a['query']['tag']?{'id':_0x28002a['query'][_0xd54b('0xa3')]}:undefined,'required':_0x28002a[_0xd54b('0x3e')][_0xd54b('0xa3')]?!![]:![]}];}return db[_0xd54b('0x84')]['findAll'](_0x415923);})[_0xd54b('0x1f')](function(_0x5dc861){_0x42f172[_0xd54b('0x64')]=_0x5dc861;return _0x42f172;});}})[_0xd54b('0x1f')](respondWithFilteredResult(_0x2d5cd5,_0x415923))['catch'](handleError(_0x2d5cd5,null));};exports[_0xd54b('0xa4')]=function(_0x89ffce,_0x2874c8,_0x2c3baa){return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0x89ffce[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x2874c8,null))['then'](function(_0x53ef33){if(_0x53ef33){return _0x53ef33[_0xd54b('0xa4')](_0x89ffce[_0xd54b('0x57')][_0xd54b('0x66')],_[_0xd54b('0xa5')](_0x89ffce[_0xd54b('0x57')],[_0xd54b('0x66'),'id'])||{})[_0xd54b('0x86')](function(_0x1413fc){for(var _0x347282=0x0;_0x347282<_0x89ffce[_0xd54b('0x57')][_0xd54b('0x66')][_0xd54b('0x44')];_0x347282+=0x1){socket[_0xd54b('0xa6')](_0xd54b('0xa7'),{'UserId':Number(_0x89ffce[_0xd54b('0x57')][_0xd54b('0x66')][_0x347282]),'OpenchannelAccountId':Number(_0x89ffce[_0xd54b('0x53')]['id'])});}return _0x1413fc;});}})[_0xd54b('0x1f')](respondWithResult(_0x2874c8,null))[_0xd54b('0x51')](handleError(_0x2874c8,null));};exports[_0xd54b('0xa8')]=function(_0x204b2a,_0x3351f1,_0x37bec1){return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0x204b2a[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x3351f1,null))[_0xd54b('0x1f')](function(_0x5be002){if(_0x5be002){return _0x5be002[_0xd54b('0xa8')](_0x204b2a[_0xd54b('0x3e')][_0xd54b('0x66')])[_0xd54b('0x1f')](function(){if(_[_0xd54b('0xa9')](_0x204b2a[_0xd54b('0x3e')]['ids'])){for(var _0x563c3b=0x0;_0x563c3b<_0x204b2a[_0xd54b('0x3e')][_0xd54b('0x66')]['length'];_0x563c3b+=0x1){socket[_0xd54b('0xa6')](_0xd54b('0xaa'),{'UserId':Number(_0x204b2a['query'][_0xd54b('0x66')][_0x563c3b]),'OpenchannelAccountId':Number(_0x204b2a['params']['id'])});}}else{socket[_0xd54b('0xa6')](_0xd54b('0xaa'),{'UserId':Number(_0x204b2a[_0xd54b('0x3e')][_0xd54b('0x66')]),'OpenchannelAccountId':Number(_0x204b2a[_0xd54b('0x53')]['id'])});}});}})[_0xd54b('0x1f')](respondWithStatusCode(_0x3351f1,null))[_0xd54b('0x51')](handleError(_0x3351f1,null));};exports[_0xd54b('0xab')]=function(_0x257d9d,_0x66284c,_0x2ebc76){var _0x45370d={};var _0x3718a9={};var _0x52dcfa;var _0x14e67b;return db[_0xd54b('0x38')]['findOne']({'where':{'id':_0x257d9d[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0x66284c,null))['then'](function(_0x11efdd){if(_0x11efdd){_0x52dcfa=_0x11efdd;_0x3718a9[_0xd54b('0x3b')]=_[_0xd54b('0x3f')](db[_0xd54b('0x8f')][_0xd54b('0x55')]);_0x3718a9['query']=_['keys'](_0x257d9d[_0xd54b('0x3e')]);_0x3718a9[_0xd54b('0x40')]=_[_0xd54b('0x41')](_0x3718a9[_0xd54b('0x3b')],_0x3718a9[_0xd54b('0x3e')]);_0x45370d[_0xd54b('0x43')]=_[_0xd54b('0x41')](_0x3718a9[_0xd54b('0x3b')],qs[_0xd54b('0x42')](_0x257d9d[_0xd54b('0x3e')][_0xd54b('0x42')]));_0x45370d[_0xd54b('0x43')]=_0x45370d['attributes']['length']?_0x45370d[_0xd54b('0x43')]:_0x3718a9[_0xd54b('0x3b')];_0x45370d[_0xd54b('0x47')]=qs[_0xd54b('0x62')](_0x257d9d['query'][_0xd54b('0x62')]);_0x45370d['where']=qs[_0xd54b('0x40')](_['pick'](_0x257d9d[_0xd54b('0x3e')],_0x3718a9[_0xd54b('0x40')]));if(_0x257d9d[_0xd54b('0x3e')]['filter']){_0x45370d[_0xd54b('0x48')]=_[_0xd54b('0x4a')](_0x45370d[_0xd54b('0x48')],{'$or':_[_0xd54b('0x3c')](_0x45370d['attributes'],function(_0x117193){var _0x4c027f={};_0x4c027f[_0x117193]={'$like':'%'+_0x257d9d[_0xd54b('0x3e')][_0xd54b('0x4c')]+'%'};return _0x4c027f;})});}_0x45370d=_[_0xd54b('0x4a')]({},_0x45370d,_0x257d9d[_0xd54b('0x4d')]);return _0x52dcfa[_0xd54b('0xab')](_0x45370d);}})[_0xd54b('0x1f')](function(_0x5649ca){if(_0x5649ca){_0x14e67b=_0x5649ca[_0xd54b('0x44')];if(!_0x257d9d[_0xd54b('0x3e')]['hasOwnProperty'](_0xd54b('0x46'))){_0x45370d['limit']=qs['limit'](_0x257d9d['query'][_0xd54b('0x2c')]);_0x45370d[_0xd54b('0x2b')]=qs[_0xd54b('0x2b')](_0x257d9d[_0xd54b('0x3e')][_0xd54b('0x2b')]);}return _0x52dcfa['getAgents'](_0x45370d);}})[_0xd54b('0x1f')](function(_0x2297c6){if(_0x2297c6){return _0x2297c6?{'count':_0x14e67b,'rows':_0x2297c6}:null;}})[_0xd54b('0x1f')](respondWithResult(_0x66284c,null))['catch'](handleError(_0x66284c,null));};exports[_0xd54b('0x36')]=function(_0x576f59,_0xc71aad,_0x5545a4){var _0x241b2d,_0x4e67ca,_0x4a4fa2;if(_['isNil'](_0x576f59[_0xd54b('0x57')]['body'])||_0x576f59[_0xd54b('0x57')][_0xd54b('0x57')]===''){throw new db['Sequelize'][(_0xd54b('0x6f'))](_0xd54b('0xac'));}if(_['isNil'](_0x576f59[_0xd54b('0x57')]['to'])){}_0x241b2d=_0x576f59[_0xd54b('0x57')]['to'];return db[_0xd54b('0x38')]['findOne']({'where':{'id':_0x576f59[_0xd54b('0x53')]['id']}})[_0xd54b('0x1f')](handleEntityNotFound(_0xc71aad,null))[_0xd54b('0x1f')](function(_0x30722b){if(_0x30722b){return db[_0xd54b('0x38')][_0xd54b('0x5a')]({'where':{'id':_0x30722b['id']},'include':[{'model':db[_0xd54b('0x79')],'as':_0xd54b('0x7a'),'include':[{'model':db[_0xd54b('0x6d')],'as':_0xd54b('0x7b'),'where':{[_0x30722b[_0xd54b('0x77')]]:_0x241b2d},'limit':0x1,'order':[[_0xd54b('0x72'),'DESC']]}]}]})['then'](handleEntityNotFound(_0xc71aad,null))[_0xd54b('0x1f')](function(_0xee8c24){if(_0xee8c24&&_0xee8c24[_0xd54b('0x7a')]){_0x4e67ca=_0xee8c24['get']({'plain':!![]});if(_0x4e67ca[_0xd54b('0x7a')]&&_0x4e67ca[_0xd54b('0x7a')]['Contacts'][_0xd54b('0x44')]){return _0x4e67ca[_0xd54b('0x7a')][_0xd54b('0x7b')][0x0];}return db[_0xd54b('0x6d')][_0xd54b('0x56')](_[_0xd54b('0x18')](_0x576f59[_0xd54b('0x57')],{'firstName':_0x241b2d,[_0xee8c24[_0xd54b('0x77')]]:_0x241b2d,'phone':_0x241b2d,'ListId':_0x4e67ca[_0xd54b('0x73')]}));}})[_0xd54b('0x1f')](handleEntityNotFound(_0xc71aad,null))[_0xd54b('0x1f')](function(_0x11046d){if(_0x11046d){_0x4a4fa2=_0x11046d;return db['OpenchannelInteraction'][_0xd54b('0x5a')]({'where':{'ContactId':_0x4a4fa2['id'],'closed':![],'OpenchannelAccountId':_0x4e67ca['id']}})['then'](function(_0xd0476c){if(_0xd0476c){return[_0xd0476c,![]];}return db[_0xd54b('0x84')]['create']({'UserId':_0x576f59[_0xd54b('0x58')]['id'],'ContactId':_0x4a4fa2['id'],'OpenchannelAccountId':_0x4e67ca['id'],'lastMsgDirection':_0xd54b('0xad'),'Messages':[_[_0xd54b('0x4a')](_0x576f59[_0xd54b('0x57')],{'read':![],'body':_0x576f59[_0xd54b('0x57')][_0xd54b('0x57')],'OpenchannelAccountId':_0x4e67ca['id'],'UserId':_0x576f59[_0xd54b('0x58')]['id'],'ContactId':_0x4a4fa2['id']})]},{'include':[{'model':db[_0xd54b('0xae')],'as':_0xd54b('0xaf')}]})[_0xd54b('0x1f')](function(_0xcb622){return[_0xcb622,!![]];});});}})[_0xd54b('0x86')](function(_0x12f5e5,_0x3ea5a5){if(_0x3ea5a5){return _0x12f5e5;}return db['OpenchannelMessage'][_0xd54b('0x56')](_['merge'](_0x576f59['body'],{'read':![],'body':_0x576f59[_0xd54b('0x57')][_0xd54b('0x57')],'OpenchannelAccountId':_0x4e67ca['id'],'OpenchannelInteractionId':_0x12f5e5['id'],'UserId':_0x576f59['user']['id'],'ContactId':_0x4a4fa2['id']}))['then'](function(_0x429fc8){_0x12f5e5['dataValues'][_0xd54b('0xaf')]=[];_0x12f5e5[_0xd54b('0xb0')][_0xd54b('0xaf')][_0xd54b('0xb1')](_0x429fc8['dataValues']);return _0x12f5e5;});});}})[_0xd54b('0x1f')](respondWithResult(_0xc71aad,null))[_0xd54b('0x51')](handleError(_0xc71aad,null));};
\ No newline at end of file
index 68d68a7..810fa0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove','emit'];(function(_0x4aef84,_0x1c79a2){var _0x8061a4=function(_0x47f6e5){while(--_0x47f6e5){_0x4aef84['push'](_0x4aef84['shift']());}};_0x8061a4(++_0x1c79a2);}(_0xe706,0xa3));var _0x6e70=function(_0x561197,_0x2d7d64){_0x561197=_0x561197-0x0;var _0x191270=_0xe706[_0x561197];return _0x191270;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var OpenchannelAccount=require(_0x6e70('0x1'))['db'][_0x6e70('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x3'),'afterUpdate':_0x6e70('0x4'),'afterDestroy':_0x6e70('0x5')};function emitEvent(_0x7dfbc3){return function(_0x142c27,_0x2164a4,_0x376a8d){OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3+':'+_0x142c27['id'],_0x142c27);OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3,_0x142c27);_0x376a8d(null);};}for(var e in events){if(events[_0x6e70('0x7')](e)){var event=events[e];OpenchannelAccount[_0x6e70('0x8')](e,emitEvent(event));}}module[_0x6e70('0x9')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x41bb=['../../mysqldb','setMaxListeners','update','remove','emit','events'];(function(_0x325c44,_0x73295c){var _0x1dd875=function(_0x46496f){while(--_0x46496f){_0x325c44['push'](_0x325c44['shift']());}};_0x1dd875(++_0x73295c);}(_0x41bb,0xc5));var _0xb41b=function(_0x3cbd7d,_0x4b1bbb){_0x3cbd7d=_0x3cbd7d-0x0;var _0x26d335=_0x41bb[_0x3cbd7d];return _0x26d335;};'use strict';var EventEmitter=require(_0xb41b('0x0'));var OpenchannelAccount=require(_0xb41b('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb41b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb41b('0x3'),'afterDestroy':_0xb41b('0x4')};function emitEvent(_0x148333){return function(_0x448c8e,_0x4ee21b,_0x12cea3){OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333+':'+_0x448c8e['id'],_0x448c8e);OpenchannelAccountEvents[_0xb41b('0x5')](_0x148333,_0x448c8e);_0x12cea3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
index f4798ef..39fb6bf 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(_0x49e1e3,_0x491e11){var _0x3c5403=function(_0x4f535e){while(--_0x4f535e){_0x49e1e3['push'](_0x49e1e3['shift']());}};_0x3c5403(++_0x491e11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x1f5c7a,_0x1bb6aa){var _0x1a4bad=function(_0x384f92){while(--_0x384f92){_0x1f5c7a['push'](_0x1f5c7a['shift']());}};_0x1a4bad(++_0x1bb6aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 88e24fb..981124d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2579bb,_0x2d7f6e){var _0x4f73b6=function(_0x41994b){while(--_0x41994b){_0x2579bb['push'](_0x2579bb['shift']());}};_0x4f73b6(++_0x2d7f6e);}(_0xea28,0x13a));var _0x8ea2=function(_0x2fb631,_0x361204){_0x2fb631=_0x2fb631-0x0;var _0x8000=_0xea28[_0x2fb631];return _0x8000;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});config[_0x8ea2('0xc')]=_[_0x8ea2('0xd')](config[_0x8ea2('0xc')],{'host':_0x8ea2('0xe'),'port':0x18eb});var socket=require(_0x8ea2('0xf'))(new Redis(config[_0x8ea2('0xc')]));require(_0x8ea2('0x10'))[_0x8ea2('0x11')](socket);function respondWithRpcPromise(_0x3000f9,_0x3d0b35,_0x21ae3d){return new BPromise(function(_0x500b82,_0x4da3b1){return client[_0x8ea2('0x12')](_0x3000f9,_0x21ae3d)[_0x8ea2('0x13')](function(_0x374973){logger['info'](_0x8ea2('0x14'),_0x3d0b35,_0x8ea2('0x15'));logger[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x3d0b35,_0x8ea2('0x15'),JSON['stringify'](_0x374973));if(_0x374973[_0x8ea2('0x18')]){if(_0x374973['error']['code']===0x1f4){logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);return _0x4da3b1(_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);}logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);return _0x500b82(_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);}else{logger[_0x8ea2('0x1a')](_0x8ea2('0x14'),_0x3d0b35,_0x8ea2('0x15'));_0x500b82(_0x374973[_0x8ea2('0x1b')][_0x8ea2('0x19')]);}})[_0x8ea2('0x1c')](function(_0x1068b6){logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x1068b6);_0x4da3b1(_0x1068b6);});});}
\ No newline at end of file
+var _0x693f=['info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./openchannelAccount.socket','register','request','then'];(function(_0x37e0f2,_0x179b96){var _0x3e0463=function(_0x597602){while(--_0x597602){_0x37e0f2['push'](_0x37e0f2['shift']());}};_0x3e0463(++_0x179b96);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require(_0xf693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf693('0x4'));var db=require(_0xf693('0x5'))['db'];var utils=require(_0xf693('0x6'));var logger=require(_0xf693('0x7'))(_0xf693('0x8'));var config=require(_0xf693('0x9'));var jayson=require(_0xf693('0xa'));var client=jayson['client'][_0xf693('0xb')]({'port':0x232a});config[_0xf693('0xc')]=_['defaults'](config[_0xf693('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf693('0xd'))(new Redis(config['redis']));require(_0xf693('0xe'))[_0xf693('0xf')](socket);function respondWithRpcPromise(_0x48984a,_0x4b09d6,_0x5d9159){return new BPromise(function(_0x38b847,_0x527cd9){return client[_0xf693('0x10')](_0x48984a,_0x5d9159)[_0xf693('0x11')](function(_0x2202f1){logger[_0xf693('0x12')](_0xf693('0x13'),_0x4b09d6,'request\x20sent');logger['debug'](_0xf693('0x14'),_0x4b09d6,_0xf693('0x15'),JSON['stringify'](_0x2202f1));if(_0x2202f1[_0xf693('0x16')]){if(_0x2202f1[_0xf693('0x16')]['code']===0x1f4){logger['error'](_0xf693('0x13'),_0x4b09d6,_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);return _0x527cd9(_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);}logger['error'](_0xf693('0x13'),_0x4b09d6,_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);return _0x38b847(_0x2202f1[_0xf693('0x16')][_0xf693('0x17')]);}else{logger[_0xf693('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x4b09d6,'request\x20sent');_0x38b847(_0x2202f1['result'][_0xf693('0x17')]);}})[_0xf693('0x18')](function(_0x3f4d4d){logger[_0xf693('0x16')](_0xf693('0x13'),_0x4b09d6,_0x3f4d4d);_0x527cd9(_0x3f4d4d);});});}
\ No newline at end of file
index bb1ac17..40e0ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b8a=['openchannelAccount:','save','update','emit','removeListener','register','length'];(function(_0x5418ad,_0x40742f){var _0x2cae56=function(_0x36d317){while(--_0x36d317){_0x5418ad['push'](_0x5418ad['shift']());}};_0x2cae56(++_0x40742f);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4b8a[_0x3bf83f];return _0x22c4a9;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xa4b8('0x0'),'remove',_0xa4b8('0x1')];function createListener(_0x3ed3b6,_0x20eea6){return function(_0x34c820){_0x20eea6[_0xa4b8('0x2')](_0x3ed3b6,_0x34c820);};}function removeListener(_0x3a22d1,_0xb147cb){return function(){OpenchannelAccountEvents[_0xa4b8('0x3')](_0x3a22d1,_0xb147cb);};}exports[_0xa4b8('0x4')]=function(_0x719605){for(var _0x2c9e45=0x0,_0x2de84d=events[_0xa4b8('0x5')];_0x2c9e45<_0x2de84d;_0x2c9e45++){var _0x1fea78=events[_0x2c9e45];var _0x517970=createListener(_0xa4b8('0x6')+_0x1fea78,_0x719605);OpenchannelAccountEvents['on'](_0x1fea78,_0x517970);}};
\ No newline at end of file
+var _0x8c99=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','openchannelAccount:'];(function(_0xb20170,_0xd6c73d){var _0xf4c14f=function(_0xc05074){while(--_0xc05074){_0xb20170['push'](_0xb20170['shift']());}};_0xf4c14f(++_0xd6c73d);}(_0x8c99,0x1a8));var _0x98c9=function(_0x31295c,_0x2f2b82){_0x31295c=_0x31295c-0x0;var _0x2c150e=_0x8c99[_0x31295c];return _0x2c150e;};'use strict';var OpenchannelAccountEvents=require(_0x98c9('0x0'));var events=[_0x98c9('0x1'),_0x98c9('0x2'),_0x98c9('0x3')];function createListener(_0x33b7c1,_0x33c0b2){return function(_0x3205a2){_0x33c0b2[_0x98c9('0x4')](_0x33b7c1,_0x3205a2);};}function removeListener(_0x459115,_0xeb82d1){return function(){OpenchannelAccountEvents[_0x98c9('0x5')](_0x459115,_0xeb82d1);};}exports[_0x98c9('0x6')]=function(_0x4fb819){for(var _0x7f0fec=0x0,_0x2ed2b6=events['length'];_0x7f0fec<_0x2ed2b6;_0x7f0fec++){var _0x4af8a6=events[_0x7f0fec];var _0x5b983e=createListener(_0x98c9('0x7')+_0x4af8a6,_0x4fb819);OpenchannelAccountEvents['on'](_0x4af8a6,_0x5b983e);}};
\ No newline at end of file
index c5a1dda..897dfc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfd4=['show','post','create','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x81dcac,_0x8ff7db){var _0xc7803b=function(_0x499b29){while(--_0x499b29){_0x81dcac['push'](_0x81dcac['shift']());}};_0xc7803b(++_0x8ff7db);}(_0xbfd4,0x1ce));var _0x4bfd=function(_0x3c47a9,_0x4c8662){_0x3c47a9=_0x3c47a9-0x0;var _0x258ddc=_0xbfd4[_0x3c47a9];return _0x258ddc;};'use strict';var multer=require(_0x4bfd('0x0'));var util=require('util');var path=require(_0x4bfd('0x1'));var timeout=require(_0x4bfd('0x2'));var express=require(_0x4bfd('0x3'));var router=express[_0x4bfd('0x4')]();var fs_extra=require(_0x4bfd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4bfd('0x6'));var config=require(_0x4bfd('0x7'));var controller=require(_0x4bfd('0x8'));router[_0x4bfd('0x9')]('/',auth[_0x4bfd('0xa')](),controller[_0x4bfd('0xb')]);router[_0x4bfd('0x9')](_0x4bfd('0xc'),auth[_0x4bfd('0xa')](),controller[_0x4bfd('0xd')]);router[_0x4bfd('0xe')]('/',auth[_0x4bfd('0xa')](),controller[_0x4bfd('0xf')]);router[_0x4bfd('0x10')](_0x4bfd('0xc'),auth[_0x4bfd('0xa')](),controller[_0x4bfd('0x11')]);router['delete'](_0x4bfd('0xc'),auth[_0x4bfd('0xa')](),controller['destroy']);module[_0x4bfd('0x12')]=router;
\ No newline at end of file
+var _0x865a=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelApplication.controller','get','index','isAuthenticated','create','put','/:id','update'];(function(_0x44467a,_0x362fd8){var _0x182b00=function(_0x2e6b09){while(--_0x2e6b09){_0x44467a['push'](_0x44467a['shift']());}};_0x182b00(++_0x362fd8);}(_0x865a,0x101));var _0xa865=function(_0x4ece71,_0x409249){_0x4ece71=_0x4ece71-0x0;var _0x5c86c9=_0x865a[_0x4ece71];return _0x5c86c9;};'use strict';var multer=require(_0xa865('0x0'));var util=require(_0xa865('0x1'));var path=require(_0xa865('0x2'));var timeout=require(_0xa865('0x3'));var express=require(_0xa865('0x4'));var router=express[_0xa865('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa865('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa865('0x7'));router[_0xa865('0x8')]('/',auth['isAuthenticated'](),controller[_0xa865('0x9')]);router[_0xa865('0x8')]('/:id',auth[_0xa865('0xa')](),controller['show']);router['post']('/',auth[_0xa865('0xa')](),controller[_0xa865('0xb')]);router[_0xa865('0xc')](_0xa865('0xd'),auth[_0xa865('0xa')](),controller[_0xa865('0xe')]);router[_0xa865('0xf')]('/:id',auth[_0xa865('0xa')](),controller['destroy']);module[_0xa865('0x10')]=router;
\ No newline at end of file
index 9e638a1..ee65ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabef=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x258173,_0x5e5224){var _0x58ab1a=function(_0x158848){while(--_0x158848){_0x258173['push'](_0x258173['shift']());}};_0x58ab1a(++_0x5e5224);}(_0xabef,0xce));var _0xfabe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xabef[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xfabe('0x0'));module[_0xfabe('0x1')]={'priority':{'type':Sequelize[_0xfabe('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfabe('0x3')]()},'description':{'type':Sequelize[_0xfabe('0x4')]},'interval':{'type':Sequelize[_0xfabe('0x4')],'defaultValue':_0xfabe('0x5')}};
\ No newline at end of file
+var _0x8d46=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x59990a,_0x30f61e){var _0x1d0cb1=function(_0x1b879c){while(--_0x1b879c){_0x59990a['push'](_0x59990a['shift']());}};_0x1d0cb1(++_0x30f61e);}(_0x8d46,0xac));var _0x68d4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8d46[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x68d4('0x0'));module[_0x68d4('0x1')]={'priority':{'type':Sequelize[_0x68d4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x68d4('0x3')],'allowNull':![],'defaultValue':_0x68d4('0x4')},'appdata':{'type':Sequelize[_0x68d4('0x5')]()},'description':{'type':Sequelize[_0x68d4('0x3')]},'interval':{'type':Sequelize[_0x68d4('0x3')],'defaultValue':_0x68d4('0x6')}};
\ No newline at end of file
index fdcd3ab..f6e034c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5505=['zip-dir','fast-json-patch','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','index','OpenchannelApplication','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','keys','find','catch','create','body','rimraf'];(function(_0x2273ce,_0x3aa076){var _0x104ab0=function(_0x1e5455){while(--_0x1e5455){_0x2273ce['push'](_0x2273ce['shift']());}};_0x104ab0(++_0x3aa076);}(_0x5505,0x133));var _0x5550=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5505[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5550('0x0'));var zipdir=require(_0x5550('0x1'));var jsonpatch=require(_0x5550('0x2'));var rp=require(_0x5550('0x3'));var moment=require(_0x5550('0x4'));var BPromise=require(_0x5550('0x5'));var Mustache=require(_0x5550('0x6'));var util=require(_0x5550('0x7'));var path=require(_0x5550('0x8'));var sox=require(_0x5550('0x9'));var csv=require(_0x5550('0xa'));var ejs=require(_0x5550('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5550('0xc'));var squel=require(_0x5550('0xd'));var crypto=require(_0x5550('0xe'));var jsforce=require(_0x5550('0xf'));var deskjs=require(_0x5550('0x10'));var toCsv=require(_0x5550('0xa'));var querystring=require(_0x5550('0x11'));var Papa=require(_0x5550('0x12'));var Redis=require(_0x5550('0x13'));var authService=require(_0x5550('0x14'));var qs=require(_0x5550('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5550('0x16'));var logger=require(_0x5550('0x17'))(_0x5550('0x18'));var utils=require(_0x5550('0x19'));var config=require(_0x5550('0x1a'));var licenseUtil=require(_0x5550('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaca1f0,_0x5b08cb){_0x5b08cb=_0x5b08cb||0xcc;return function(_0x8111da){if(_0x8111da){return _0xaca1f0[_0x5550('0x1c')](_0x5b08cb);}return _0xaca1f0[_0x5550('0x1d')](_0x5b08cb)[_0x5550('0x1e')]();};}function respondWithResult(_0x3138bc,_0x9200e0){_0x9200e0=_0x9200e0||0xc8;return function(_0x1c1b77){if(_0x1c1b77){return _0x3138bc[_0x5550('0x1d')](_0x9200e0)[_0x5550('0x1f')](_0x1c1b77);}};}function respondWithFilteredResult(_0x3c5f43,_0x4ca305){return function(_0x83befc){if(_0x83befc){var _0x3d81eb=typeof _0x4ca305['offset']===_0x5550('0x20')&&typeof _0x4ca305[_0x5550('0x21')]===_0x5550('0x20');var _0x23761c=_0x83befc[_0x5550('0x22')];var _0x835afe=_0x3d81eb?0x0:_0x4ca305[_0x5550('0x23')];var _0x4859b2=_0x3d81eb?_0x83befc[_0x5550('0x22')]:_0x4ca305[_0x5550('0x23')]+_0x4ca305['limit'];var _0x52de68;if(_0x4859b2>=_0x23761c){_0x4859b2=_0x23761c;_0x52de68=0xc8;}else{_0x52de68=0xce;}_0x3c5f43[_0x5550('0x1d')](_0x52de68);return _0x3c5f43['set'](_0x5550('0x24'),_0x835afe+'-'+_0x4859b2+'/'+_0x23761c)[_0x5550('0x1f')](_0x83befc);}return null;};}function patchUpdates(_0x1c81d8){return function(_0x326c2c){try{jsonpatch[_0x5550('0x25')](_0x326c2c,_0x1c81d8,!![]);}catch(_0x3923ac){return BPromise[_0x5550('0x26')](_0x3923ac);}return _0x326c2c[_0x5550('0x27')]();};}function saveUpdates(_0x59ed9a,_0x19145){return function(_0x5181bf){if(_0x5181bf){return _0x5181bf[_0x5550('0x28')](_0x59ed9a)[_0x5550('0x29')](function(_0x5e1e5d){return _0x5e1e5d;});}return null;};}function removeEntity(_0xe6632d,_0x4dbd98){return function(_0xfd1100){if(_0xfd1100){return _0xfd1100[_0x5550('0x2a')]()[_0x5550('0x29')](function(){_0xe6632d[_0x5550('0x1d')](0xcc)[_0x5550('0x1e')]();});}};}function handleEntityNotFound(_0x2d2040,_0x42ed22){return function(_0xde7b81){if(!_0xde7b81){_0x2d2040[_0x5550('0x1c')](0x194);}return _0xde7b81;};}function handleError(_0x4db7f7,_0x3ad6ca){_0x3ad6ca=_0x3ad6ca||0x1f4;return function(_0x5de078){logger['error'](_0x5de078['stack']);if(_0x5de078[_0x5550('0x2b')]){delete _0x5de078['name'];}_0x4db7f7[_0x5550('0x1d')](_0x3ad6ca)[_0x5550('0x2c')](_0x5de078);};}exports[_0x5550('0x2d')]=function(_0x289cd7,_0x4312b0){var _0x3cc76a={},_0x3d1671={},_0x749b6f={'count':0x0,'rows':[]};var _0x327036=_['map'](db[_0x5550('0x2e')]['rawAttributes'],function(_0x201d19){return{'name':_0x201d19[_0x5550('0x2f')],'type':_0x201d19[_0x5550('0x30')][_0x5550('0x31')]};});_0x3d1671[_0x5550('0x32')]=_[_0x5550('0x33')](_0x327036,_0x5550('0x2b'));_0x3d1671[_0x5550('0x34')]=_['keys'](_0x289cd7[_0x5550('0x34')]);_0x3d1671['filters']=_[_0x5550('0x35')](_0x3d1671[_0x5550('0x32')],_0x3d1671[_0x5550('0x34')]);_0x3cc76a['attributes']=_[_0x5550('0x35')](_0x3d1671[_0x5550('0x32')],qs[_0x5550('0x36')](_0x289cd7[_0x5550('0x34')][_0x5550('0x36')]));_0x3cc76a[_0x5550('0x37')]=_0x3cc76a[_0x5550('0x37')][_0x5550('0x38')]?_0x3cc76a[_0x5550('0x37')]:_0x3d1671[_0x5550('0x32')];if(!_0x289cd7[_0x5550('0x34')][_0x5550('0x39')]('nolimit')){_0x3cc76a[_0x5550('0x21')]=qs[_0x5550('0x21')](_0x289cd7['query'][_0x5550('0x21')]);_0x3cc76a[_0x5550('0x23')]=qs[_0x5550('0x23')](_0x289cd7[_0x5550('0x34')]['offset']);}_0x3cc76a[_0x5550('0x3a')]=qs[_0x5550('0x3b')](_0x289cd7[_0x5550('0x34')]['sort']);_0x3cc76a[_0x5550('0x3c')]=qs['filters'](_[_0x5550('0x3d')](_0x289cd7[_0x5550('0x34')],_0x3d1671[_0x5550('0x3e')]),_0x327036);if(_0x289cd7[_0x5550('0x34')][_0x5550('0x3f')]){_0x3cc76a[_0x5550('0x3c')]=_['merge'](_0x3cc76a[_0x5550('0x3c')],{'$or':_[_0x5550('0x33')](_0x327036,function(_0x29296b){if(_0x29296b[_0x5550('0x30')]!==_0x5550('0x40')){var _0xd63c7f={};_0xd63c7f[_0x29296b[_0x5550('0x2b')]]={'$like':'%'+_0x289cd7[_0x5550('0x34')][_0x5550('0x3f')]+'%'};return _0xd63c7f;}})});}_0x3cc76a=_[_0x5550('0x41')]({},_0x3cc76a,_0x289cd7[_0x5550('0x42')]);var _0x4e9a8a={'where':_0x3cc76a[_0x5550('0x3c')]};return db[_0x5550('0x2e')][_0x5550('0x22')](_0x4e9a8a)[_0x5550('0x29')](function(_0x4a0077){_0x749b6f[_0x5550('0x22')]=_0x4a0077;if(_0x289cd7[_0x5550('0x34')][_0x5550('0x43')]){_0x3cc76a[_0x5550('0x44')]=[{'all':!![]}];}return db[_0x5550('0x2e')]['findAll'](_0x3cc76a);})['then'](function(_0x3fd1dd){_0x749b6f[_0x5550('0x45')]=_0x3fd1dd;return _0x749b6f;})[_0x5550('0x29')](respondWithFilteredResult(_0x4312b0,_0x3cc76a))['catch'](handleError(_0x4312b0,null));};exports[_0x5550('0x46')]=function(_0x1b0b4f,_0x2b1119){var _0x267aa={'raw':!![],'where':{'id':_0x1b0b4f[_0x5550('0x47')]['id']}},_0x58f9c6={};_0x58f9c6[_0x5550('0x32')]=_[_0x5550('0x48')](db['OpenchannelApplication']['rawAttributes']);_0x58f9c6['query']=_[_0x5550('0x48')](_0x1b0b4f['query']);_0x58f9c6['filters']=_['intersection'](_0x58f9c6['model'],_0x58f9c6[_0x5550('0x34')]);_0x267aa['attributes']=_[_0x5550('0x35')](_0x58f9c6[_0x5550('0x32')],qs[_0x5550('0x36')](_0x1b0b4f[_0x5550('0x34')]['fields']));_0x267aa[_0x5550('0x37')]=_0x267aa[_0x5550('0x37')][_0x5550('0x38')]?_0x267aa[_0x5550('0x37')]:_0x58f9c6[_0x5550('0x32')];if(_0x1b0b4f['query']['includeAll']){_0x267aa[_0x5550('0x44')]=[{'all':!![]}];}_0x267aa=_[_0x5550('0x41')]({},_0x267aa,_0x1b0b4f[_0x5550('0x42')]);return db[_0x5550('0x2e')][_0x5550('0x49')](_0x267aa)[_0x5550('0x29')](handleEntityNotFound(_0x2b1119,null))[_0x5550('0x29')](respondWithResult(_0x2b1119,null))[_0x5550('0x4a')](handleError(_0x2b1119,null));};exports[_0x5550('0x4b')]=function(_0x50c0ea,_0x3b9565){return db[_0x5550('0x2e')]['create'](_0x50c0ea[_0x5550('0x4c')],{})[_0x5550('0x29')](respondWithResult(_0x3b9565,0xc9))[_0x5550('0x4a')](handleError(_0x3b9565,null));};exports['update']=function(_0x7415e1,_0x3073f5){if(_0x7415e1[_0x5550('0x4c')]['id']){delete _0x7415e1[_0x5550('0x4c')]['id'];}return db[_0x5550('0x2e')][_0x5550('0x49')]({'where':{'id':_0x7415e1[_0x5550('0x47')]['id']}})[_0x5550('0x29')](handleEntityNotFound(_0x3073f5,null))[_0x5550('0x29')](saveUpdates(_0x7415e1[_0x5550('0x4c')],null))[_0x5550('0x29')](respondWithResult(_0x3073f5,null))[_0x5550('0x4a')](handleError(_0x3073f5,null));};exports[_0x5550('0x2a')]=function(_0x5ec998,_0x2477b1){return db[_0x5550('0x2e')][_0x5550('0x49')]({'where':{'id':_0x5ec998['params']['id']}})['then'](handleEntityNotFound(_0x2477b1,null))['then'](removeEntity(_0x2477b1,null))[_0x5550('0x4a')](handleError(_0x2477b1,null));};
\ No newline at end of file
+var _0xbdb1=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','count','Content-Range','json','apply','save','update','destroy','then','error','index','map','OpenchannelApplication','type','key','name','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x5862ec,_0x1f96c9){var _0x4d727b=function(_0x28d419){while(--_0x28d419){_0x5862ec['push'](_0x5862ec['shift']());}};_0x4d727b(++_0x1f96c9);}(_0xbdb1,0x1c5));var _0x1bdb=function(_0x3feb5f,_0x45cc31){_0x3feb5f=_0x3feb5f-0x0;var _0x5c4911=_0xbdb1[_0x3feb5f];return _0x5c4911;};'use strict';var emlformat=require(_0x1bdb('0x0'));var rimraf=require(_0x1bdb('0x1'));var zipdir=require(_0x1bdb('0x2'));var jsonpatch=require(_0x1bdb('0x3'));var rp=require(_0x1bdb('0x4'));var moment=require(_0x1bdb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bdb('0x6'));var util=require(_0x1bdb('0x7'));var path=require(_0x1bdb('0x8'));var sox=require(_0x1bdb('0x9'));var csv=require(_0x1bdb('0xa'));var ejs=require(_0x1bdb('0xb'));var fs=require('fs');var fs_extra=require(_0x1bdb('0xc'));var _=require(_0x1bdb('0xd'));var squel=require(_0x1bdb('0xe'));var crypto=require(_0x1bdb('0xf'));var jsforce=require(_0x1bdb('0x10'));var deskjs=require(_0x1bdb('0x11'));var toCsv=require(_0x1bdb('0xa'));var querystring=require(_0x1bdb('0x12'));var Papa=require(_0x1bdb('0x13'));var Redis=require('ioredis');var authService=require(_0x1bdb('0x14'));var qs=require(_0x1bdb('0x15'));var as=require(_0x1bdb('0x16'));var hardwareService=require(_0x1bdb('0x17'));var logger=require(_0x1bdb('0x18'))(_0x1bdb('0x19'));var utils=require(_0x1bdb('0x1a'));var config=require(_0x1bdb('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x1bdb('0x1c'))['db'];function respondWithStatusCode(_0xeec833,_0x17eaf1){_0x17eaf1=_0x17eaf1||0xcc;return function(_0x5c399c){if(_0x5c399c){return _0xeec833[_0x1bdb('0x1d')](_0x17eaf1);}return _0xeec833['status'](_0x17eaf1)[_0x1bdb('0x1e')]();};}function respondWithResult(_0x3e29a9,_0x40606c){_0x40606c=_0x40606c||0xc8;return function(_0x3fed82){if(_0x3fed82){return _0x3e29a9[_0x1bdb('0x1f')](_0x40606c)['json'](_0x3fed82);}};}function respondWithFilteredResult(_0xdc7957,_0x2c647a){return function(_0x5e01fa){if(_0x5e01fa){var _0x59bc63=typeof _0x2c647a[_0x1bdb('0x20')]==='undefined'&&typeof _0x2c647a[_0x1bdb('0x21')]==='undefined';var _0x3a963d=_0x5e01fa[_0x1bdb('0x22')];var _0xb5da5=_0x59bc63?0x0:_0x2c647a[_0x1bdb('0x20')];var _0x16777e=_0x59bc63?_0x5e01fa[_0x1bdb('0x22')]:_0x2c647a[_0x1bdb('0x20')]+_0x2c647a['limit'];var _0x419e69;if(_0x16777e>=_0x3a963d){_0x16777e=_0x3a963d;_0x419e69=0xc8;}else{_0x419e69=0xce;}_0xdc7957[_0x1bdb('0x1f')](_0x419e69);return _0xdc7957['set'](_0x1bdb('0x23'),_0xb5da5+'-'+_0x16777e+'/'+_0x3a963d)[_0x1bdb('0x24')](_0x5e01fa);}return null;};}function patchUpdates(_0x3643cc){return function(_0x5c5b36){try{jsonpatch[_0x1bdb('0x25')](_0x5c5b36,_0x3643cc,!![]);}catch(_0xcb36ef){return BPromise['reject'](_0xcb36ef);}return _0x5c5b36[_0x1bdb('0x26')]();};}function saveUpdates(_0xa93940,_0x499929){return function(_0xc56a7d){if(_0xc56a7d){return _0xc56a7d[_0x1bdb('0x27')](_0xa93940)['then'](function(_0x477cb2){return _0x477cb2;});}return null;};}function removeEntity(_0x557cc8,_0x499445){return function(_0x34e373){if(_0x34e373){return _0x34e373[_0x1bdb('0x28')]()[_0x1bdb('0x29')](function(){_0x557cc8[_0x1bdb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1354b3,_0x3baec3){return function(_0x31d8b8){if(!_0x31d8b8){_0x1354b3['sendStatus'](0x194);}return _0x31d8b8;};}function handleError(_0x27f648,_0x296240){_0x296240=_0x296240||0x1f4;return function(_0x5eb4ea){logger[_0x1bdb('0x2a')](_0x5eb4ea['stack']);if(_0x5eb4ea['name']){delete _0x5eb4ea['name'];}_0x27f648['status'](_0x296240)['send'](_0x5eb4ea);};}exports[_0x1bdb('0x2b')]=function(_0x355b3b,_0x4e9b6f){var _0x5bbcec={},_0x4ce64f={},_0x110883={'count':0x0,'rows':[]};var _0x52a5c3=_[_0x1bdb('0x2c')](db[_0x1bdb('0x2d')]['rawAttributes'],function(_0x4798e9){return{'name':_0x4798e9['fieldName'],'type':_0x4798e9[_0x1bdb('0x2e')][_0x1bdb('0x2f')]};});_0x4ce64f['model']=_[_0x1bdb('0x2c')](_0x52a5c3,_0x1bdb('0x30'));_0x4ce64f[_0x1bdb('0x31')]=_['keys'](_0x355b3b[_0x1bdb('0x31')]);_0x4ce64f[_0x1bdb('0x32')]=_[_0x1bdb('0x33')](_0x4ce64f[_0x1bdb('0x34')],_0x4ce64f['query']);_0x5bbcec[_0x1bdb('0x35')]=_[_0x1bdb('0x33')](_0x4ce64f[_0x1bdb('0x34')],qs[_0x1bdb('0x36')](_0x355b3b[_0x1bdb('0x31')][_0x1bdb('0x36')]));_0x5bbcec[_0x1bdb('0x35')]=_0x5bbcec['attributes'][_0x1bdb('0x37')]?_0x5bbcec[_0x1bdb('0x35')]:_0x4ce64f[_0x1bdb('0x34')];if(!_0x355b3b[_0x1bdb('0x31')]['hasOwnProperty'](_0x1bdb('0x38'))){_0x5bbcec[_0x1bdb('0x21')]=qs['limit'](_0x355b3b[_0x1bdb('0x31')][_0x1bdb('0x21')]);_0x5bbcec[_0x1bdb('0x20')]=qs[_0x1bdb('0x20')](_0x355b3b['query'][_0x1bdb('0x20')]);}_0x5bbcec[_0x1bdb('0x39')]=qs[_0x1bdb('0x3a')](_0x355b3b[_0x1bdb('0x31')][_0x1bdb('0x3a')]);_0x5bbcec['where']=qs[_0x1bdb('0x32')](_[_0x1bdb('0x3b')](_0x355b3b[_0x1bdb('0x31')],_0x4ce64f[_0x1bdb('0x32')]),_0x52a5c3);if(_0x355b3b['query'][_0x1bdb('0x3c')]){_0x5bbcec[_0x1bdb('0x3d')]=_[_0x1bdb('0x3e')](_0x5bbcec[_0x1bdb('0x3d')],{'$or':_['map'](_0x52a5c3,function(_0x575614){if(_0x575614[_0x1bdb('0x2e')]!==_0x1bdb('0x3f')){var _0x1714d2={};_0x1714d2[_0x575614[_0x1bdb('0x30')]]={'$like':'%'+_0x355b3b['query'][_0x1bdb('0x3c')]+'%'};return _0x1714d2;}})});}_0x5bbcec=_['merge']({},_0x5bbcec,_0x355b3b['options']);var _0x5c59fd={'where':_0x5bbcec['where']};return db['OpenchannelApplication'][_0x1bdb('0x22')](_0x5c59fd)[_0x1bdb('0x29')](function(_0x22a06f){_0x110883[_0x1bdb('0x22')]=_0x22a06f;if(_0x355b3b['query'][_0x1bdb('0x40')]){_0x5bbcec[_0x1bdb('0x41')]=[{'all':!![]}];}return db[_0x1bdb('0x2d')][_0x1bdb('0x42')](_0x5bbcec);})[_0x1bdb('0x29')](function(_0x16bb61){_0x110883[_0x1bdb('0x43')]=_0x16bb61;return _0x110883;})[_0x1bdb('0x29')](respondWithFilteredResult(_0x4e9b6f,_0x5bbcec))[_0x1bdb('0x44')](handleError(_0x4e9b6f,null));};exports[_0x1bdb('0x45')]=function(_0x11d661,_0x489e89){var _0x125ed3={'raw':!![],'where':{'id':_0x11d661['params']['id']}},_0x2c525a={};_0x2c525a[_0x1bdb('0x34')]=_[_0x1bdb('0x46')](db['OpenchannelApplication'][_0x1bdb('0x47')]);_0x2c525a[_0x1bdb('0x31')]=_['keys'](_0x11d661[_0x1bdb('0x31')]);_0x2c525a[_0x1bdb('0x32')]=_[_0x1bdb('0x33')](_0x2c525a['model'],_0x2c525a['query']);_0x125ed3[_0x1bdb('0x35')]=_[_0x1bdb('0x33')](_0x2c525a[_0x1bdb('0x34')],qs['fields'](_0x11d661[_0x1bdb('0x31')][_0x1bdb('0x36')]));_0x125ed3[_0x1bdb('0x35')]=_0x125ed3[_0x1bdb('0x35')][_0x1bdb('0x37')]?_0x125ed3[_0x1bdb('0x35')]:_0x2c525a[_0x1bdb('0x34')];if(_0x11d661[_0x1bdb('0x31')][_0x1bdb('0x40')]){_0x125ed3[_0x1bdb('0x41')]=[{'all':!![]}];}_0x125ed3=_[_0x1bdb('0x3e')]({},_0x125ed3,_0x11d661[_0x1bdb('0x48')]);return db[_0x1bdb('0x2d')][_0x1bdb('0x49')](_0x125ed3)['then'](handleEntityNotFound(_0x489e89,null))[_0x1bdb('0x29')](respondWithResult(_0x489e89,null))[_0x1bdb('0x44')](handleError(_0x489e89,null));};exports[_0x1bdb('0x4a')]=function(_0x1673d6,_0x334bed){return db[_0x1bdb('0x2d')][_0x1bdb('0x4a')](_0x1673d6[_0x1bdb('0x4b')],{})[_0x1bdb('0x29')](respondWithResult(_0x334bed,0xc9))['catch'](handleError(_0x334bed,null));};exports[_0x1bdb('0x27')]=function(_0x155259,_0x2566f8){if(_0x155259[_0x1bdb('0x4b')]['id']){delete _0x155259[_0x1bdb('0x4b')]['id'];}return db['OpenchannelApplication'][_0x1bdb('0x49')]({'where':{'id':_0x155259[_0x1bdb('0x4c')]['id']}})[_0x1bdb('0x29')](handleEntityNotFound(_0x2566f8,null))[_0x1bdb('0x29')](saveUpdates(_0x155259[_0x1bdb('0x4b')],null))[_0x1bdb('0x29')](respondWithResult(_0x2566f8,null))[_0x1bdb('0x44')](handleError(_0x2566f8,null));};exports[_0x1bdb('0x28')]=function(_0x4c2244,_0x3d7ad8){return db[_0x1bdb('0x2d')]['find']({'where':{'id':_0x4c2244[_0x1bdb('0x4c')]['id']}})[_0x1bdb('0x29')](handleEntityNotFound(_0x3d7ad8,null))[_0x1bdb('0x29')](removeEntity(_0x3d7ad8,null))[_0x1bdb('0x44')](handleError(_0x3d7ad8,null));};
\ No newline at end of file
index 492fc41..76bad7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7129=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','openchannel_applications','utf8mb4','lodash','../../config/logger'];(function(_0x243427,_0x784e11){var _0xc59f9a=function(_0x408037){while(--_0x408037){_0x243427['push'](_0x243427['shift']());}};_0xc59f9a(++_0x784e11);}(_0x7129,0x18a));var _0x9712=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x7129[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x9712('0x0'));var util=require('util');var logger=require(_0x9712('0x1'))('api');var moment=require(_0x9712('0x2'));var BPromise=require(_0x9712('0x3'));var rp=require(_0x9712('0x4'));var fs=require('fs');var path=require(_0x9712('0x5'));var rimraf=require(_0x9712('0x6'));var config=require(_0x9712('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x9712('0x8')]=function(_0x2f6168,_0x2a97f9){return _0x2f6168[_0x9712('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x9712('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9712('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x2019=['moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0xdc5605,_0x5718b2){var _0x1c56b2=function(_0x38525a){while(--_0x38525a){_0xdc5605['push'](_0xdc5605['shift']());}};_0x1c56b2(++_0x5718b2);}(_0x2019,0xc0));var _0x9201=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x2019[_0x307d86];return _0x361745;};'use strict';var _=require(_0x9201('0x0'));var util=require(_0x9201('0x1'));var logger=require(_0x9201('0x2'))(_0x9201('0x3'));var moment=require(_0x9201('0x4'));var BPromise=require(_0x9201('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9201('0x6'));var rimraf=require(_0x9201('0x7'));var config=require(_0x9201('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x9201('0x9')]=function(_0x21247f,_0x46f622){return _0x21247f['define'](_0x9201('0xa'),attributes,{'tableName':_0x9201('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9201('0xc'),'collate':_0x9201('0xd')});};
\ No newline at end of file
index 18931dd..981daa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x631b=['update','body','options','where','attributes','limit','then','info','stringify','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication'];(function(_0x5ca1a0,_0x361f32){var _0x4e529f=function(_0x5f59cb){while(--_0x5f59cb){_0x5ca1a0['push'](_0x5ca1a0['shift']());}};_0x4e529f(++_0x361f32);}(_0x631b,0xd4));var _0xb631=function(_0xbaeba7,_0x578dfa){_0xbaeba7=_0xbaeba7-0x0;var _0x4b42e7=_0x631b[_0xbaeba7];return _0x4b42e7;};'use strict';var _=require(_0xb631('0x0'));var util=require(_0xb631('0x1'));var moment=require(_0xb631('0x2'));var BPromise=require('bluebird');var rs=require(_0xb631('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb631('0x4'))(_0xb631('0x5'));var config=require(_0xb631('0x6'));var jayson=require(_0xb631('0x7'));var client=jayson[_0xb631('0x8')][_0xb631('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ead69,_0x5437eb,_0x5d415f){return new BPromise(function(_0x450121,_0x38fa47){return client[_0xb631('0xa')](_0x2ead69,_0x5d415f)['then'](function(_0xc1a88e){logger['info'](_0xb631('0xb'),_0x5437eb,_0xb631('0xc'));logger[_0xb631('0xd')](_0xb631('0xe'),_0x5437eb,'request\x20sent',JSON['stringify'](_0xc1a88e));if(_0xc1a88e['error']){if(_0xc1a88e[_0xb631('0xf')]['code']===0x1f4){logger[_0xb631('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x5437eb,_0xc1a88e[_0xb631('0xf')][_0xb631('0x10')]);return _0x38fa47(_0xc1a88e[_0xb631('0xf')][_0xb631('0x10')]);}logger[_0xb631('0xf')](_0xb631('0xb'),_0x5437eb,_0xc1a88e[_0xb631('0xf')]['message']);return _0x450121(_0xc1a88e['error'][_0xb631('0x10')]);}else{logger['info'](_0xb631('0xb'),_0x5437eb,_0xb631('0xc'));_0x450121(_0xc1a88e['result'][_0xb631('0x10')]);}})[_0xb631('0x11')](function(_0x361431){logger[_0xb631('0xf')](_0xb631('0xb'),_0x5437eb,_0x361431);_0x38fa47(_0x361431);});});}exports[_0xb631('0x12')]=function(_0xf5a9df){var _0x503511=this;return new Promise(function(_0x2139f8,_0x55a37f){return db[_0xb631('0x13')][_0xb631('0x14')](_0xf5a9df[_0xb631('0x15')],{'raw':_0xf5a9df[_0xb631('0x16')]?_0xf5a9df[_0xb631('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf5a9df[_0xb631('0x16')]?_0xf5a9df['options'][_0xb631('0x17')]||null:null,'attributes':_0xf5a9df['options']?_0xf5a9df['options'][_0xb631('0x18')]||null:null,'limit':_0xf5a9df['options']?_0xf5a9df[_0xb631('0x16')][_0xb631('0x19')]||null:null})[_0xb631('0x1a')](function(_0x15d824){logger[_0xb631('0x1b')](_0xb631('0x12'),_0xf5a9df);logger[_0xb631('0xd')]('UpdateOpenchannelApplication',_0xf5a9df,JSON[_0xb631('0x1c')](_0x15d824));_0x2139f8(_0x15d824);})[_0xb631('0x11')](function(_0x55cea3){logger['error']('UpdateOpenchannelApplication',_0x55cea3[_0xb631('0x10')],_0xf5a9df);_0x55a37f(_0x503511['error'](0x1f4,_0x55cea3[_0xb631('0x10')]));});});};
\ No newline at end of file
+var _0x62b1=['rpc','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','update','body','options','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1e5de7,_0x22b37d){var _0x3ce9ca=function(_0x3bdbdb){while(--_0x3bdbdb){_0x1e5de7['push'](_0x1e5de7['shift']());}};_0x3ce9ca(++_0x22b37d);}(_0x62b1,0x1f1));var _0x162b=function(_0x57cc58,_0x56b014){_0x57cc58=_0x57cc58-0x0;var _0x252f0a=_0x62b1[_0x57cc58];return _0x252f0a;};'use strict';var _=require(_0x162b('0x0'));var util=require(_0x162b('0x1'));var moment=require('moment');var BPromise=require(_0x162b('0x2'));var rs=require(_0x162b('0x3'));var fs=require('fs');var Redis=require(_0x162b('0x4'));var db=require(_0x162b('0x5'))['db'];var utils=require(_0x162b('0x6'));var logger=require('../../config/logger')(_0x162b('0x7'));var config=require('../../config/environment');var jayson=require(_0x162b('0x8'));var client=jayson[_0x162b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x451002,_0x539c5c,_0x43a94f){return new BPromise(function(_0x2c66a9,_0x52379f){return client[_0x162b('0xa')](_0x451002,_0x43a94f)[_0x162b('0xb')](function(_0x5522d3){logger[_0x162b('0xc')](_0x162b('0xd'),_0x539c5c,_0x162b('0xe'));logger[_0x162b('0xf')](_0x162b('0x10'),_0x539c5c,_0x162b('0xe'),JSON[_0x162b('0x11')](_0x5522d3));if(_0x5522d3['error']){if(_0x5522d3[_0x162b('0x12')][_0x162b('0x13')]===0x1f4){logger[_0x162b('0x12')](_0x162b('0xd'),_0x539c5c,_0x5522d3[_0x162b('0x12')]['message']);return _0x52379f(_0x5522d3[_0x162b('0x12')][_0x162b('0x14')]);}logger[_0x162b('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x539c5c,_0x5522d3[_0x162b('0x12')][_0x162b('0x14')]);return _0x2c66a9(_0x5522d3[_0x162b('0x12')][_0x162b('0x14')]);}else{logger[_0x162b('0xc')](_0x162b('0xd'),_0x539c5c,_0x162b('0xe'));_0x2c66a9(_0x5522d3[_0x162b('0x15')][_0x162b('0x14')]);}})[_0x162b('0x16')](function(_0x3d14a6){logger[_0x162b('0x12')](_0x162b('0xd'),_0x539c5c,_0x3d14a6);_0x52379f(_0x3d14a6);});});}exports[_0x162b('0x17')]=function(_0x25f2e5){var _0x844197=this;return new Promise(function(_0x54dbe8,_0x1adbe5){return db['OpenchannelApplication'][_0x162b('0x18')](_0x25f2e5[_0x162b('0x19')],{'raw':_0x25f2e5[_0x162b('0x1a')]?_0x25f2e5[_0x162b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25f2e5['options']?_0x25f2e5[_0x162b('0x1a')]['where']||null:null,'attributes':_0x25f2e5[_0x162b('0x1a')]?_0x25f2e5[_0x162b('0x1a')]['attributes']||null:null,'limit':_0x25f2e5[_0x162b('0x1a')]?_0x25f2e5['options'][_0x162b('0x1b')]||null:null})[_0x162b('0xb')](function(_0x4ce8da){logger[_0x162b('0xc')]('UpdateOpenchannelApplication',_0x25f2e5);logger[_0x162b('0xf')](_0x162b('0x17'),_0x25f2e5,JSON['stringify'](_0x4ce8da));_0x54dbe8(_0x4ce8da);})[_0x162b('0x16')](function(_0x1535a8){logger[_0x162b('0x12')](_0x162b('0x17'),_0x1535a8[_0x162b('0x14')],_0x25f2e5);_0x1adbe5(_0x844197[_0x162b('0x12')](0x1f4,_0x1535a8[_0x162b('0x14')]));});});};
\ No newline at end of file
index ba2f726..348e65a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe978=['/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','addTags','/:id','openchannelinteraction:update','openchannelinteraction:destroy','delete','removeTags','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated'];(function(_0x3ce643,_0x53b200){var _0x4c9392=function(_0x5602da){while(--_0x5602da){_0x3ce643['push'](_0x3ce643['shift']());}};_0x4c9392(++_0x53b200);}(_0xe978,0xf1));var _0x8e97=function(_0x31bb18,_0x5741a3){_0x31bb18=_0x31bb18-0x0;var _0x308a0a=_0xe978[_0x31bb18];return _0x308a0a;};'use strict';var multer=require(_0x8e97('0x0'));var util=require('util');var path=require(_0x8e97('0x1'));var timeout=require(_0x8e97('0x2'));var express=require(_0x8e97('0x3'));var router=express[_0x8e97('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8e97('0x5'));var interaction=require(_0x8e97('0x6'));var config=require(_0x8e97('0x7'));var controller=require(_0x8e97('0x8'));router[_0x8e97('0x9')]('/',auth[_0x8e97('0xa')](),controller['index']);router[_0x8e97('0x9')](_0x8e97('0xb'),auth[_0x8e97('0xa')](),controller['describe']);router[_0x8e97('0x9')]('/:id',auth[_0x8e97('0xa')](),controller[_0x8e97('0xc')]);router[_0x8e97('0x9')](_0x8e97('0xd'),auth['isAuthenticated'](),controller[_0x8e97('0xe')]);router['get'](_0x8e97('0xf'),auth[_0x8e97('0xa')](),controller[_0x8e97('0x10')]);router[_0x8e97('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/messages',auth[_0x8e97('0xa')](),controller[_0x8e97('0x12')]);router[_0x8e97('0x11')](_0x8e97('0x13'),auth[_0x8e97('0xa')](),interaction[_0x8e97('0x14')](_0x8e97('0x15'),'openchannelinteraction:addtags'),controller[_0x8e97('0x16')]);router['put'](_0x8e97('0x17'),auth[_0x8e97('0xa')](),interaction['tracked'](_0x8e97('0x15'),_0x8e97('0x18')),controller['update']);router['delete'](_0x8e97('0x17'),auth[_0x8e97('0xa')](),interaction[_0x8e97('0x14')](_0x8e97('0x15'),_0x8e97('0x19')),controller['destroy']);router[_0x8e97('0x1a')](_0x8e97('0x13'),auth[_0x8e97('0xa')](),controller[_0x8e97('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x4919=['../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','/:id','/:id/messages','/:id/download','download','create','post','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','delete','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x4919,0x18c));var _0x9491=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x4919[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x9491('0x0'));var util=require(_0x9491('0x1'));var path=require(_0x9491('0x2'));var timeout=require('connect-timeout');var express=require(_0x9491('0x3'));var router=express[_0x9491('0x4')]();var fs_extra=require(_0x9491('0x5'));var auth=require(_0x9491('0x6'));var interaction=require(_0x9491('0x7'));var config=require(_0x9491('0x8'));var controller=require(_0x9491('0x9'));router[_0x9491('0xa')]('/',auth[_0x9491('0xb')](),controller['index']);router[_0x9491('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9491('0xc')]);router[_0x9491('0xa')](_0x9491('0xd'),auth[_0x9491('0xb')](),controller['show']);router[_0x9491('0xa')](_0x9491('0xe'),auth[_0x9491('0xb')](),controller['getMessages']);router[_0x9491('0xa')](_0x9491('0xf'),auth[_0x9491('0xb')](),controller[_0x9491('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9491('0x11')]);router[_0x9491('0x12')](_0x9491('0xe'),auth[_0x9491('0xb')](),controller[_0x9491('0x13')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x9491('0x14')](_0x9491('0x15'),_0x9491('0x16')),controller[_0x9491('0x17')]);router[_0x9491('0x18')]('/:id',auth[_0x9491('0xb')](),interaction['tracked'](_0x9491('0x15'),_0x9491('0x19')),controller['update']);router[_0x9491('0x1a')](_0x9491('0xd'),auth['isAuthenticated'](),interaction[_0x9491('0x14')]('openchannel','openchannelinteraction:destroy'),controller[_0x9491('0x1b')]);router['delete'](_0x9491('0x1c'),auth[_0x9491('0xb')](),controller[_0x9491('0x1d')]);module[_0x9491('0x1e')]=router;
\ No newline at end of file
index e33d8ea..b71460f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeef=['sequelize','exports','BOOLEAN','STRING','DATE','out'];(function(_0x163a1c,_0x4f81ea){var _0x239113=function(_0x45eaeb){while(--_0x45eaeb){_0x163a1c['push'](_0x163a1c['shift']());}};_0x239113(++_0x4f81ea);}(_0xaeef,0x14a));var _0xfaee=function(_0x556f08,_0x501e7f){_0x556f08=_0x556f08-0x0;var _0x586ac9=_0xaeef[_0x556f08];return _0x586ac9;};'use strict';var Sequelize=require(_0xfaee('0x0'));module[_0xfaee('0x1')]={'closed':{'type':Sequelize[_0xfaee('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfaee('0x3')]},'secondDisposition':{'type':Sequelize[_0xfaee('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfaee('0x3')]},'note':{'type':Sequelize[_0xfaee('0x3')]},'read1stAt':{'type':Sequelize[_0xfaee('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xfaee('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfaee('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xfaee('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x5a96=['DATE','STRING','BOOLEAN','sequelize','exports'];(function(_0x4265a0,_0x1c6028){var _0x39cb95=function(_0x2ea65d){while(--_0x2ea65d){_0x4265a0['push'](_0x4265a0['shift']());}};_0x39cb95(++_0x1c6028);}(_0x5a96,0xbc));var _0x65a9=function(_0x44b10b,_0x829d97){_0x44b10b=_0x44b10b-0x0;var _0x4c8f0d=_0x5a96[_0x44b10b];return _0x4c8f0d;};'use strict';var Sequelize=require(_0x65a9('0x0'));module[_0x65a9('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x65a9('0x2')]},'disposition':{'type':Sequelize[_0x65a9('0x3')]},'secondDisposition':{'type':Sequelize[_0x65a9('0x3')]},'thirdDisposition':{'type':Sequelize[_0x65a9('0x3')]},'note':{'type':Sequelize[_0x65a9('0x3')]},'read1stAt':{'type':Sequelize[_0x65a9('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x65a9('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x65a9('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x65a9('0x4')],'defaultValue':![]}};
\ No newline at end of file
index c03cb17..8a998d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd719=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','reject','then','destroy','stack','name','send','Users','map','fullname','Tags','TagIds','forEach','push','catch','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','tag','isArray','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','filter','format','options','addTags','spread','removeTags','download','join','root','server','files','tmp','attachments','User','CmContact','lastName','Attachment','Messages','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','Public','Private','existsSync','createReadStream','basename','firstName','out','renderFile','transcript-','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd719,0xdb));var _0x9d71=function(_0x57bf99,_0xcfc71d){_0x57bf99=_0x57bf99-0x0;var _0x48af18=_0xd719[_0x57bf99];return _0x48af18;};'use strict';var emlformat=require(_0x9d71('0x0'));var rimraf=require(_0x9d71('0x1'));var zipdir=require(_0x9d71('0x2'));var jsonpatch=require(_0x9d71('0x3'));var rp=require(_0x9d71('0x4'));var moment=require(_0x9d71('0x5'));var BPromise=require(_0x9d71('0x6'));var Mustache=require(_0x9d71('0x7'));var util=require(_0x9d71('0x8'));var path=require(_0x9d71('0x9'));var sox=require('sox');var csv=require(_0x9d71('0xa'));var ejs=require(_0x9d71('0xb'));var fs=require('fs');var fs_extra=require(_0x9d71('0xc'));var _=require(_0x9d71('0xd'));var squel=require(_0x9d71('0xe'));var crypto=require('crypto');var jsforce=require(_0x9d71('0xf'));var deskjs=require(_0x9d71('0x10'));var toCsv=require(_0x9d71('0xa'));var querystring=require(_0x9d71('0x11'));var Papa=require(_0x9d71('0x12'));var Redis=require(_0x9d71('0x13'));var authService=require(_0x9d71('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x9d71('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9d71('0x16'));var utils=require('../../config/utils');var config=require(_0x9d71('0x17'));var licenseUtil=require(_0x9d71('0x18'));var db=require('../../mysqldb')['db'];config[_0x9d71('0x19')]=_[_0x9d71('0x1a')](config[_0x9d71('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d71('0x1b'))(new Redis(config[_0x9d71('0x19')]));require(_0x9d71('0x1c'))[_0x9d71('0x1d')](socket);function respondWithStatusCode(_0x82ed42,_0x4d86d0){_0x4d86d0=_0x4d86d0||0xcc;return function(_0x3d68c4){if(_0x3d68c4){return _0x82ed42[_0x9d71('0x1e')](_0x4d86d0);}return _0x82ed42[_0x9d71('0x1f')](_0x4d86d0)[_0x9d71('0x20')]();};}function respondWithResult(_0x4123dd,_0x3a330b){_0x3a330b=_0x3a330b||0xc8;return function(_0x17b8d1){if(_0x17b8d1){return _0x4123dd[_0x9d71('0x1f')](_0x3a330b)[_0x9d71('0x21')](_0x17b8d1);}};}function respondWithFilteredResult(_0x25bc54,_0xcefdb9){return function(_0x416e0a){if(_0x416e0a){var _0x1a5468=typeof _0xcefdb9[_0x9d71('0x22')]===_0x9d71('0x23')&&typeof _0xcefdb9['limit']===_0x9d71('0x23');var _0x476938=_0x416e0a[_0x9d71('0x24')];var _0x20542b=_0x1a5468?0x0:_0xcefdb9[_0x9d71('0x22')];var _0x31cfde=_0x1a5468?_0x416e0a[_0x9d71('0x24')]:_0xcefdb9[_0x9d71('0x22')]+_0xcefdb9[_0x9d71('0x25')];var _0x356871;if(_0x31cfde>=_0x476938){_0x31cfde=_0x476938;_0x356871=0xc8;}else{_0x356871=0xce;}_0x25bc54[_0x9d71('0x1f')](_0x356871);return _0x25bc54['set']('Content-Range',_0x20542b+'-'+_0x31cfde+'/'+_0x476938)['json'](_0x416e0a);}return null;};}function patchUpdates(_0x1d77c8){return function(_0x3ebb6c){try{jsonpatch['apply'](_0x3ebb6c,_0x1d77c8,!![]);}catch(_0x8bb7dd){return BPromise[_0x9d71('0x26')](_0x8bb7dd);}return _0x3ebb6c['save']();};}function saveUpdates(_0x1df6d1,_0x5efa9e){return function(_0x2fb898){if(_0x2fb898){return _0x2fb898['update'](_0x1df6d1)[_0x9d71('0x27')](function(_0x48f950){return _0x48f950;});}return null;};}function removeEntity(_0x4564b3,_0x5ed40a){return function(_0x1aa4c7){if(_0x1aa4c7){return _0x1aa4c7[_0x9d71('0x28')]()['then'](function(){_0x4564b3['status'](0xcc)[_0x9d71('0x20')]();});}};}function handleEntityNotFound(_0x5b5cb6,_0x401e3c){return function(_0xae6dab){if(!_0xae6dab){_0x5b5cb6[_0x9d71('0x1e')](0x194);}return _0xae6dab;};}function handleError(_0x2eb685,_0x1207ed){_0x1207ed=_0x1207ed||0x1f4;return function(_0xe3ecd4){logger['error'](_0xe3ecd4[_0x9d71('0x29')]);if(_0xe3ecd4[_0x9d71('0x2a')]){delete _0xe3ecd4[_0x9d71('0x2a')];}_0x2eb685[_0x9d71('0x1f')](_0x1207ed)[_0x9d71('0x2b')](_0xe3ecd4);};}function getInteractionUsers(_0x25303b,_0x3bd38e){return new BPromise(function(_0x349533,_0x4139fe){try{if(_0x3bd38e[_0x25303b['id']]){_0x25303b[_0x9d71('0x2c')]=_[_0x9d71('0x2d')](_0x3bd38e[_0x25303b['id']],function(_0x246239){return{'id':_0x246239['id'],'fullname':_0x246239[_0x9d71('0x2e')]};});}}catch(_0x161c2e){_0x4139fe(_0x161c2e);}_0x349533(_0x25303b);});}function getInteractionTags(_0x5c535f,_0x3f1b1f){return new BPromise(function(_0x352639,_0x24b368){try{if(_0x5c535f['TagIds']){_0x5c535f[_0x9d71('0x2f')]=[];_0x5c535f[_0x9d71('0x30')]['split'](',')[_0x9d71('0x31')](function(_0x2c0271){_0x5c535f[_0x9d71('0x2f')][_0x9d71('0x32')](_0x3f1b1f[_0x2c0271]);});}delete _0x5c535f['TagIds'];}catch(_0xcabe82){_0x24b368(_0xcabe82);}_0x352639(_0x5c535f);});}function updateOpenchannelInteraction(_0x18abf7,_0x2a38a3,_0x3128b4){return new BPromise(function(_0x538763,_0x30fd94){return getInteractionUsers(_0x18abf7,_0x3128b4)[_0x9d71('0x27')](function(_0x1c813a){return getInteractionTags(_0x1c813a,_0x2a38a3);})[_0x9d71('0x27')](function(_0x46add9){_0x538763(_0x46add9);})[_0x9d71('0x33')](function(_0x3c78a9){_0x30fd94(_0x3c78a9);});});}exports['index']=function(_0x2493c6,_0x5c9d79){var _0x2ca0fa={},_0x99f3e3={},_0x4f9b05={'count':0x0,'rows':[]};var _0x3bc8ca=_[_0x9d71('0x2d')](db[_0x9d71('0x34')][_0x9d71('0x35')],function(_0x2db804){return{'name':_0x2db804[_0x9d71('0x36')],'type':_0x2db804[_0x9d71('0x37')][_0x9d71('0x38')]};});_0x99f3e3[_0x9d71('0x39')]=_[_0x9d71('0x2d')](_0x3bc8ca,'name');_0x99f3e3['query']=_[_0x9d71('0x3a')](_0x2493c6[_0x9d71('0x3b')]);_0x99f3e3[_0x9d71('0x3c')]=_[_0x9d71('0x3d')](_0x99f3e3[_0x9d71('0x39')],_0x99f3e3[_0x9d71('0x3b')]);_0x2ca0fa[_0x9d71('0x3e')]=_['intersection'](_0x99f3e3['model'],qs[_0x9d71('0x3f')](_0x2493c6['query'][_0x9d71('0x3f')]));_0x2ca0fa[_0x9d71('0x3e')]=_0x2ca0fa[_0x9d71('0x3e')][_0x9d71('0x40')]?_0x2ca0fa[_0x9d71('0x3e')]:_0x99f3e3['model'];if(!_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x41')](_0x9d71('0x42'))){_0x2ca0fa[_0x9d71('0x25')]=qs['limit'](_0x2493c6[_0x9d71('0x3b')]['limit']);_0x2ca0fa[_0x9d71('0x22')]=qs[_0x9d71('0x22')](_0x2493c6[_0x9d71('0x3b')]['offset']);}_0x2ca0fa[_0x9d71('0x43')]=qs[_0x9d71('0x44')](_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x44')]);_0x2ca0fa[_0x9d71('0x45')]=qs[_0x9d71('0x3c')](_[_0x9d71('0x46')](_0x2493c6[_0x9d71('0x3b')],_0x99f3e3['filters']),_0x3bc8ca);var _0x46de18=[];var _0x56b72f=squel['select']()[_0x9d71('0x47')]('id')['field'](_0x9d71('0x2a'))[_0x9d71('0x47')](_0x9d71('0x48'))[_0x9d71('0x49')](_0x9d71('0x4a'));var _0x50a989=squel[_0x9d71('0x4b')]()[_0x9d71('0x47')]('u.id')[_0x9d71('0x47')](_0x9d71('0x4c'))[_0x9d71('0x47')](_0x9d71('0x4d'))['from']('user_has_openchannel_interactions','ui')[_0x9d71('0x4e')](_0x9d71('0x4f'),'u',_0x9d71('0x50'));var _0x194059=squel['select']()['from'](_0x9d71('0x51'),'i')[_0x9d71('0x4e')](_0x9d71('0x52'),'c',_0x9d71('0x53'))['left_join'](_0x9d71('0x4f'),'o',_0x9d71('0x54'))['left_join']('openchannel_accounts','a',_0x9d71('0x55'))['left_join'](_0x9d71('0x56'),'me',_0x9d71('0x57'))[_0x9d71('0x4e')](_0x9d71('0x58'),'it',_0x9d71('0x59'))[_0x9d71('0x4e')](_0x9d71('0x4a'),'t',_0x9d71('0x5a'));var _0x55a06c=squel[_0x9d71('0x5b')]();var _0x2539aa=[];var _0x14d2f3=squel[_0x9d71('0x5b')]();var _0x1078df;if(_0x2493c6['query'][_0x9d71('0x5c')]){_0x1078df=as[_0x9d71('0x5d')](_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x5c')]);var _0x1df711=_0x1078df[_0x9d71('0x5e')];for(var _0x91ddb3=0x0;_0x91ddb3<_0x1078df[_0x9d71('0x5f')]['length'];_0x91ddb3++){var _0x51bac6=_0x1078df[_0x9d71('0x5f')][_0x91ddb3];var _0x438073='i';var _0x2031ef=_[_0x9d71('0x60')](_0x3bc8ca,[_0x9d71('0x2a'),_0x51bac6[_0x9d71('0x47')]]);if(!_0x2031ef){switch(_0x51bac6['field']){case'unreadMessages':if(_0x51bac6[_0x9d71('0x61')]==0x1){_0x194059[_0x9d71('0x62')]('`'+_0x51bac6[_0x9d71('0x47')]+_0x9d71('0x63'));}else{_0x194059[_0x9d71('0x62')]('`'+_0x51bac6[_0x9d71('0x47')]+_0x9d71('0x64'));}break;case _0x9d71('0x65'):if(_0x51bac6[_0x9d71('0x66')]==='$substring'){if(_0x51bac6[_0x9d71('0x61')][_0x9d71('0x67')]('\x20')['length']>0x1){_0x55a06c[_0x1df711]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9d71('0x68')](_0x51bac6[_0x9d71('0x61')]),null);}else{var _0x3a944e='%'+_0x51bac6[_0x9d71('0x61')]+'%';_0x55a06c[_0x1df711](_0x9d71('0x69'),_0x3a944e,_0x3a944e,_0x3a944e);}}else{_0x2031ef=_[_0x9d71('0x60')](_0x3bc8ca,[_0x9d71('0x2a'),_0x9d71('0x6a')]);_0x51bac6[_0x9d71('0x47')]='ContactId';_0x224350=as[_0x9d71('0x6b')](_0x438073,_0x2031ef[_0x9d71('0x37')],_0x51bac6);_0x55a06c[_0x1df711](_0x224350['text'],_0x224350[_0x9d71('0x61')]['start'],_0x224350[_0x9d71('0x61')]['end']);}break;case _0x9d71('0x6c'):var _0x518120=_0x51bac6['value'][_0x9d71('0x67')](',')['map'](function(_0x31aad6){return Number(_0x31aad6);});_0x518120[_0x9d71('0x31')](function(_0x429fff){_0x14d2f3['or'](_0x9d71('0x6d'),'%,'+_0x429fff+',%');});_0x2539aa=_[_0x9d71('0x6e')](_0x2539aa,_0x518120);break;case'User':if(_0x51bac6[_0x9d71('0x66')]===_0x9d71('0x6f')){_0x55a06c[_0x1df711](_0x9d71('0x70'),'%'+_0x51bac6[_0x9d71('0x61')]+'%',null);}else{_0x2031ef=_['find'](_0x3bc8ca,[_0x9d71('0x2a'),_0x9d71('0x71')]);_0x51bac6[_0x9d71('0x47')]=_0x9d71('0x71');_0x224350=as[_0x9d71('0x6b')](_0x438073,_0x2031ef[_0x9d71('0x37')],_0x51bac6);_0x55a06c[_0x1df711](_0x224350[_0x9d71('0x72')],_0x224350['value']['start'],_0x224350['value'][_0x9d71('0x20')]);}break;case _0x9d71('0x73'):_0x224350=as[_0x9d71('0x6b')]('me',null,_0x51bac6);_0x55a06c[_0x1df711](_0x224350[_0x9d71('0x72')],_0x224350[_0x9d71('0x61')]['start'],_0x224350['value'][_0x9d71('0x20')]);break;}}else{var _0x224350=as['buildExpression'](_0x438073,_0x2031ef[_0x9d71('0x37')],_0x51bac6);_0x55a06c[_0x1df711](_0x224350[_0x9d71('0x72')],_0x224350['value']['start'],_0x224350[_0x9d71('0x61')][_0x9d71('0x20')]);}}}else{var _0x343d4f=_(_0x2493c6['query'])[_0x9d71('0x3a')]()['map'](function(_0x4eab3d){return _[_0x9d71('0x74')](_0x3bc8ca,[_0x9d71('0x2a'),_0x4eab3d])?_0x4eab3d:undefined;})['compact']()[_0x9d71('0x61')]();if(!_[_0x9d71('0x75')](_0x343d4f)){_0x343d4f['forEach'](function(_0xb07374){if(_0xb07374===_0x9d71('0x76')){_0x194059[_0x9d71('0x45')](_0x9d71('0x77'),[][_0x9d71('0x78')](_0x2493c6[_0x9d71('0x3b')][_0xb07374]));}else if(_0xb07374===_0x9d71('0x79')){var _0x1b82fc=JSON[_0x9d71('0x7a')](_0x2493c6[_0x9d71('0x3b')][_0xb07374])[_0x9d71('0x7b')];var _0x5ae8a8=JSON[_0x9d71('0x7a')](_0x2493c6[_0x9d71('0x3b')][_0xb07374])[_0x9d71('0x7c')];_0x194059[_0x9d71('0x45')](_0x9d71('0x7d'),_0x1b82fc,_0x5ae8a8);}else{if(_0x2493c6[_0x9d71('0x3b')][_0xb07374]===_0x9d71('0x7e')){_0x194059[_0x9d71('0x45')]('i.'+_0xb07374+_0x9d71('0x7f'));}else{_0x194059['where']('i.'+_0xb07374+'\x20=\x20?',_0x2493c6[_0x9d71('0x3b')][_0xb07374]);}}});}if(_0x2493c6[_0x9d71('0x3b')]['read']){if(_0x2493c6[_0x9d71('0x3b')]['read']==0x1){_0x194059['having'](_0x9d71('0x80'));}else{_0x194059['having']('`unreadMessages`\x20>\x200');}}if(_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x81')]){_0x2539aa=_[_0x9d71('0x82')](_0x2493c6[_0x9d71('0x3b')]['tag'])?_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x81')]:new Array(_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x81')]);_0x2539aa[_0x9d71('0x31')](function(_0x442a13){_0x14d2f3['or'](_0x9d71('0x6d'),'%,'+_0x442a13+',%');});}if(_0x2493c6[_0x9d71('0x3b')]['filter']){var _0x306402=_0x2493c6['query']['filter'][_0x9d71('0x83')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x306402)){_0x55a06c['or'](_0x9d71('0x84'),_0x306402+'%');}else{_0x55a06c['or'](_0x9d71('0x85'),qs[_0x9d71('0x68')](_0x306402))['or'](_0x9d71('0x86'),_0x306402+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x306402+'%');}}}_0x194059[_0x9d71('0x45')](_0x55a06c);_0x194059[_0x9d71('0x87')](_0x9d71('0x88'));var _0x5c740c={'type':db[_0x9d71('0x89')][_0x9d71('0x8a')]['SELECT'],'raw':!![]};var _0x56e413=_0x194059[_0x9d71('0x8b')]();_0x56e413[_0x9d71('0x47')](_0x9d71('0x88'));_0x56e413['field'](_0x9d71('0x8c'),_0x9d71('0x8d'));if(_0x2ca0fa[_0x9d71('0x43')]){_0x2ca0fa[_0x9d71('0x43')][_0x9d71('0x31')](function(_0x375cf5){var _0x1c2d7e=_0x375cf5[0x0]===_0x9d71('0x8e')?_0x375cf5[0x0]:'i.'+_0x375cf5[0x0];_0x194059['order'](_0x1c2d7e,_0x375cf5[0x1]===_0x9d71('0x8f')?![]:!![]);});}if(!_[_0x9d71('0x75')](_0x2539aa)){_0x194059[_0x9d71('0x62')](_0x14d2f3);_0x56e413['where'](_0x9d71('0x90'),_0x2539aa);}BPromise[_0x9d71('0x91')]()[_0x9d71('0x27')](function(){if(!_0x1078df){if(_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x76')])return;_0x56e413[_0x9d71('0x45')](_0x9d71('0x92'));_0x194059[_0x9d71('0x45')](_0x9d71('0x92'));return;}if(_0x2493c6[_0x9d71('0x93')]['role']!==_0x9d71('0x94'))return;return _0x2493c6[_0x9d71('0x93')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x9d71('0x27')](function(_0x2f7137){if(_[_0x9d71('0x75')](_0x2f7137)){_0x56e413[_0x9d71('0x45')](_0x9d71('0x95'));_0x194059[_0x9d71('0x45')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x56e413[_0x9d71('0x45')](_0x9d71('0x77'),_[_0x9d71('0x2d')](_0x2f7137,'id'));_0x194059[_0x9d71('0x45')](_0x9d71('0x77'),_[_0x9d71('0x2d')](_0x2f7137,'id'));}});})[_0x9d71('0x27')](function(){if(_0x2493c6[_0x9d71('0x93')][_0x9d71('0x96')]===_0x9d71('0x94')&&!_0x1078df&&!_0x2493c6['query'][_0x9d71('0x76')])return[];return db[_0x9d71('0x97')][_0x9d71('0x3b')](_0x56e413[_0x9d71('0x98')](),_0x5c740c);})['then'](function(_0x109984){_0x4f9b05[_0x9d71('0x24')]=_0x109984[_0x9d71('0x40')];if(_0x4f9b05[_0x9d71('0x24')]===0x0)return[];return db[_0x9d71('0x97')][_0x9d71('0x3b')](_0x56b72f[_0x9d71('0x98')](),_0x5c740c)[_0x9d71('0x27')](function(_0x175b07){_0x46de18=_[_0x9d71('0x99')](_0x175b07,'id');_0x5c740c=_[_0x9d71('0x9a')](_0x5c740c,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2493c6[_0x9d71('0x3b')][_0x9d71('0x3f')]){_0x2ca0fa[_0x9d71('0x3e')][_0x9d71('0x31')](function(_0x22f11e){_0x194059[_0x9d71('0x47')]('i.'+_0x22f11e);});}else{_0x194059[_0x9d71('0x47')](_0x9d71('0x8c'),'unreadMessages');_0x194059[_0x9d71('0x47')]('a.key','Account.key');_0x194059['field'](_0x9d71('0x9b'),_0x9d71('0x9c'));_0x194059[_0x9d71('0x47')](_0x9d71('0x9d'),_0x9d71('0x8e'));_0x194059[_0x9d71('0x47')]('i.*');_0x194059[_0x9d71('0x47')](_0x9d71('0x9e'),_0x9d71('0x9f'));_0x194059['field'](_0x9d71('0xa0'),'Contact.lastName');_0x194059[_0x9d71('0x47')](_0x9d71('0xa1'),_0x9d71('0xa2'));_0x194059[_0x9d71('0x47')](_0x9d71('0xa3'),'Contact.phone');_0x194059[_0x9d71('0x47')](_0x9d71('0xa4'),_0x9d71('0xa5'));_0x194059[_0x9d71('0x47')](_0x9d71('0xa6'),_0x9d71('0xa7'));_0x194059['field'](_0x9d71('0xa8'),_0x9d71('0xa9'));_0x194059['field']('o.internal',_0x9d71('0xaa'));_0x194059[_0x9d71('0x47')](_0x9d71('0xab'),_0x9d71('0x30'));}if(_0x2ca0fa[_0x9d71('0x25')])_0x194059[_0x9d71('0x25')](_0x2ca0fa[_0x9d71('0x25')]);if(_0x2ca0fa[_0x9d71('0x22')])_0x194059['offset'](_0x2ca0fa[_0x9d71('0x22')]);return db[_0x9d71('0x97')][_0x9d71('0x3b')](_0x194059[_0x9d71('0x98')](),_0x5c740c);})[_0x9d71('0x27')](function(_0xf01aaa){if(_0xf01aaa[_0x9d71('0x40')]>0x0)_0x50a989[_0x9d71('0x45')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x9d71('0x2d')](_0xf01aaa,'id'));return db[_0x9d71('0x97')][_0x9d71('0x3b')](_0x50a989[_0x9d71('0x98')](),_0x5c740c)['then'](function(_0x5d0f2f){var _0x3aa9d9=_[_0x9d71('0xac')](_0x5d0f2f,_0x9d71('0xad'));var _0x19af24=[];_0xf01aaa[_0x9d71('0x31')](function(_0x5cadc5){_0x19af24[_0x9d71('0x32')](updateOpenchannelInteraction(_0x5cadc5,_0x46de18,_0x3aa9d9));});return BPromise[_0x9d71('0xae')](_0x19af24);});});})[_0x9d71('0x27')](function(_0x3bd139){_0x4f9b05[_0x9d71('0xaf')]=_0x3bd139;return _0x4f9b05;})[_0x9d71('0x27')](respondWithFilteredResult(_0x5c9d79,_0x2ca0fa))[_0x9d71('0x33')](handleError(_0x5c9d79,null));};exports[_0x9d71('0xb0')]=function(_0x1febb3,_0x2a4a84){var _0x585096={};if(_0x1febb3['query'][_0x9d71('0x37')]&&_0x1febb3[_0x9d71('0x3b')]['type']===_0x9d71('0x49')){_0x585096[_0x9d71('0x49')]=_0x1febb3[_0x9d71('0xb1')]['id'];}else{_0x585096['id']=_0x1febb3[_0x9d71('0xb1')]['id'];}var _0x1d40f1={'raw':![],'where':_0x585096},_0x52d3cb={};_0x52d3cb[_0x9d71('0x39')]=_[_0x9d71('0x3a')](db[_0x9d71('0x34')][_0x9d71('0x35')]);_0x52d3cb[_0x9d71('0x3b')]=_['keys'](_0x1febb3['query']);_0x52d3cb['filters']=_[_0x9d71('0x3d')](_0x52d3cb[_0x9d71('0x39')],_0x52d3cb[_0x9d71('0x3b')]);_0x1d40f1[_0x9d71('0x3e')]=_['intersection'](_0x52d3cb[_0x9d71('0x39')],qs['fields'](_0x1febb3[_0x9d71('0x3b')][_0x9d71('0x3f')]));_0x1d40f1[_0x9d71('0x3e')]=_0x1d40f1[_0x9d71('0x3e')][_0x9d71('0x40')]?_0x1d40f1[_0x9d71('0x3e')]:_0x52d3cb[_0x9d71('0x39')];if(_0x1febb3[_0x9d71('0x3b')][_0x9d71('0xb2')]){_0x1d40f1[_0x9d71('0xb3')]=[{'all':!![]}];}_0x1d40f1=_[_0x9d71('0x9a')]({},_0x1d40f1,_0x1febb3['options']);return db['OpenchannelInteraction'][_0x9d71('0x60')](_0x1d40f1)[_0x9d71('0x27')](handleEntityNotFound(_0x2a4a84,null))[_0x9d71('0x27')](respondWithResult(_0x2a4a84,null))[_0x9d71('0x33')](handleError(_0x2a4a84,null));};exports[_0x9d71('0xb4')]=function(_0x76bf4f,_0x3cb440){return db['OpenchannelInteraction'][_0x9d71('0xb4')](_0x76bf4f['body'],{})[_0x9d71('0x27')](respondWithResult(_0x3cb440,0xc9))[_0x9d71('0x33')](handleError(_0x3cb440,null));};exports[_0x9d71('0xb5')]=function(_0x2f0c34,_0x3d157a){if(_0x2f0c34[_0x9d71('0x73')]['id']){delete _0x2f0c34[_0x9d71('0x73')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x2f0c34[_0x9d71('0xb1')]['id']}})[_0x9d71('0x27')](handleEntityNotFound(_0x3d157a,null))[_0x9d71('0x27')](saveUpdates(_0x2f0c34['body'],null))[_0x9d71('0x27')](respondWithResult(_0x3d157a,null))[_0x9d71('0x33')](handleError(_0x3d157a,null));};exports[_0x9d71('0x28')]=function(_0x122bf7,_0x645625){return db['OpenchannelInteraction'][_0x9d71('0x60')]({'where':{'id':_0x122bf7[_0x9d71('0xb1')]['id']}})[_0x9d71('0x27')](handleEntityNotFound(_0x645625,null))[_0x9d71('0x27')](removeEntity(_0x645625,null))[_0x9d71('0x33')](handleError(_0x645625,null));};exports[_0x9d71('0xb6')]=function(_0x2de7ab,_0x1c9aeb){return db[_0x9d71('0x34')]['describe']()[_0x9d71('0x27')](respondWithResult(_0x1c9aeb,null))[_0x9d71('0x33')](handleError(_0x1c9aeb,null));};exports[_0x9d71('0xb7')]=function(_0xf151ab,_0x296328,_0x3cd0e7){return db[_0x9d71('0xb8')][_0x9d71('0x60')]({'where':{'id':_0xf151ab[_0x9d71('0xb1')]['id']}})['then'](handleEntityNotFound(_0x296328,null))[_0x9d71('0x27')](function(_0x2280a9){if(_0x2280a9){return _0x2280a9[_0x9d71('0xb7')](_0xf151ab[_0x9d71('0x73')][_0x9d71('0xb9')],_[_0x9d71('0xba')](_0xf151ab[_0x9d71('0x73')],[_0x9d71('0xb9'),'id'])||{});}})[_0x9d71('0x27')](respondWithResult(_0x296328,null))[_0x9d71('0x33')](handleError(_0x296328,null));};exports[_0x9d71('0xbb')]=function(_0x592b87,_0xf6cb4e,_0x3caa03){var _0x40cfbe={'raw':![],'where':{}};var _0xd574da={};var _0x4647db={'count':0x0,'rows':[]};return db[_0x9d71('0x34')][_0x9d71('0xbc')]({'where':{'id':_0x592b87[_0x9d71('0xb1')]['id']}})[_0x9d71('0x27')](handleEntityNotFound(_0xf6cb4e,null))[_0x9d71('0x27')](function(_0xa21a35){if(_0xa21a35){_0xd574da[_0x9d71('0x39')]=_[_0x9d71('0x3a')](db[_0x9d71('0xb8')][_0x9d71('0x35')]);_0xd574da[_0x9d71('0x3b')]=_[_0x9d71('0x3a')](_0x592b87['query']);_0xd574da[_0x9d71('0x3c')]=_['intersection'](_0xd574da[_0x9d71('0x39')],_0xd574da[_0x9d71('0x3b')]);_0x40cfbe['attributes']=_[_0x9d71('0x3d')](_0xd574da[_0x9d71('0x39')],qs[_0x9d71('0x3f')](_0x592b87[_0x9d71('0x3b')][_0x9d71('0x3f')]));_0x40cfbe[_0x9d71('0x3e')]=_0x40cfbe['attributes'][_0x9d71('0x40')]?_0x40cfbe['attributes']:_0xd574da[_0x9d71('0x39')];if(!_0x592b87[_0x9d71('0x3b')][_0x9d71('0x41')]('nolimit')){_0x40cfbe[_0x9d71('0x25')]=qs['limit'](_0x592b87[_0x9d71('0x3b')][_0x9d71('0x25')]);_0x40cfbe[_0x9d71('0x22')]=qs['offset'](_0x592b87[_0x9d71('0x3b')][_0x9d71('0x22')]);}_0x40cfbe[_0x9d71('0x43')]=qs['sort'](_0x592b87['query'][_0x9d71('0x44')]);_0x40cfbe[_0x9d71('0x45')]=qs[_0x9d71('0x3c')](_[_0x9d71('0x46')](_0x592b87['query'],_0xd574da['filters']));_0x40cfbe[_0x9d71('0x45')][_0x9d71('0xad')]=_0xa21a35['id'];if(_0x592b87['query'][_0x9d71('0xbd')]){_0x40cfbe[_0x9d71('0x45')]=_[_0x9d71('0x9a')](_0x40cfbe[_0x9d71('0x45')],{'$or':_[_0x9d71('0x2d')](_0x40cfbe[_0x9d71('0x3e')],function(_0x3db8fc){var _0x194600={};_0x194600[_0x3db8fc]={'$like':'%'+_0x592b87['query'][_0x9d71('0xbd')]+'%'};return _0x194600;})});}if(_0x592b87['query'][_0x9d71('0x7b')]){var _0x2a1717=_0x592b87['query'][_0x9d71('0x7b')][_0x9d71('0x67')](',');var _0x2854a2={};_0x2854a2[_0x2a1717[0x0]]={'$gte':moment(_0x2a1717[0x1])[_0x9d71('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')};_0x40cfbe[_0x9d71('0x45')]=_[_0x9d71('0x9a')](_0x40cfbe[_0x9d71('0x45')],_0x2854a2);}_0x40cfbe=_[_0x9d71('0x9a')]({},_0x40cfbe,_0x592b87[_0x9d71('0xbf')]);return db[_0x9d71('0xb8')][_0x9d71('0x24')]({'where':_0x40cfbe['where']})['then'](function(_0x445693){_0x4647db[_0x9d71('0x24')]=_0x445693;if(_0x592b87[_0x9d71('0x3b')][_0x9d71('0xb2')]){_0x40cfbe[_0x9d71('0xb3')]=[{'all':!![]}];}return db[_0x9d71('0xb8')]['findAll'](_0x40cfbe);})['then'](function(_0xdfdd59){_0x4647db['rows']=_0xdfdd59;return _0x4647db;});}})[_0x9d71('0x27')](respondWithFilteredResult(_0xf6cb4e,_0x40cfbe))[_0x9d71('0x33')](handleError(_0xf6cb4e,null));};exports[_0x9d71('0xc0')]=function(_0x4fe02b,_0x17f6ff,_0xe468a8){return db['OpenchannelInteraction'][_0x9d71('0x60')]({'where':{'id':_0x4fe02b[_0x9d71('0xb1')]['id']}})[_0x9d71('0x27')](handleEntityNotFound(_0x17f6ff,null))[_0x9d71('0x27')](function(_0x5955e8){if(_0x5955e8){return _0x5955e8['setTags'](_0x4fe02b[_0x9d71('0x73')][_0x9d71('0xb9')],_[_0x9d71('0xba')](_0x4fe02b[_0x9d71('0x73')],[_0x9d71('0xb9'),'id'])||{})[_0x9d71('0xc1')](function(){return db['Tag']['findAll']({'attributes':['id',_0x9d71('0x2a'),_0x9d71('0x48')],'where':{'id':_0x4fe02b['body'][_0x9d71('0xb9')]}});})[_0x9d71('0x27')](function(_0x31e7c2){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x4fe02b[_0x9d71('0xb1')]['id']),'tags':_0x31e7c2||[]});return{'id':Number(_0x4fe02b[_0x9d71('0xb1')]['id']),'tags':_0x31e7c2||[]};});}})[_0x9d71('0x27')](respondWithResult(_0x17f6ff,null))[_0x9d71('0x33')](handleError(_0x17f6ff,null));};exports['removeTags']=function(_0x3aae73,_0x5a3109,_0x451dcd){return db[_0x9d71('0x34')][_0x9d71('0x60')]({'where':{'id':_0x3aae73['params']['id']}})[_0x9d71('0x27')](handleEntityNotFound(_0x5a3109,null))[_0x9d71('0x27')](function(_0xe1864){if(_0xe1864){return _0xe1864[_0x9d71('0xc2')](_0x3aae73[_0x9d71('0x3b')]['ids']);}})[_0x9d71('0x27')](respondWithStatusCode(_0x5a3109,null))[_0x9d71('0x33')](handleError(_0x5a3109,null));};exports[_0x9d71('0xc3')]=function(_0xd35986,_0x44e76f){var _0x16dc47=moment()['unix']()[_0x9d71('0x98')]();var _0x5538ac=path[_0x9d71('0xc4')](config[_0x9d71('0xc5')],_0x9d71('0xc6'),_0x9d71('0xc7'),_0x9d71('0xc8'));var _0x44a046=path[_0x9d71('0xc4')](config[_0x9d71('0xc5')],_0x9d71('0xc6'),_0x9d71('0xc7'),_0x9d71('0xc9'));var _0x10a546=path['join'](_0x5538ac,_0x16dc47);var _0x3af666=util[_0x9d71('0xbe')]('transcript-%d-%s.zip',_0xd35986[_0x9d71('0xb1')]['id'],_0x16dc47);var _0x5c24f6=path[_0x9d71('0xc4')](_0x5538ac,_0x3af666);var _0x305106=[];_0x305106[_0x9d71('0x32')]({'model':db[_0x9d71('0xca')],'as':_0x9d71('0xca'),'attributes':['id',_0x9d71('0x2e')],'raw':!![]});_0x305106['push']({'model':db[_0x9d71('0xcb')],'as':_0x9d71('0x65'),'attributes':['id','firstName',_0x9d71('0xcc')],'raw':!![]});if(_0xd35986[_0x9d71('0x3b')][_0x9d71('0xc9')]){_0x305106[_0x9d71('0x32')]({'model':db[_0x9d71('0xcd')],'as':'Attachment','raw':!![]});}var _0xdf73d1=[{'model':db[_0x9d71('0xb8')],'as':_0x9d71('0xce'),'attributes':['id','body',_0x9d71('0x79'),_0x9d71('0xcf'),_0x9d71('0xd0'),_0x9d71('0xd1')],'include':_0x305106}];_0xdf73d1[_0x9d71('0x32')]({'model':db[_0x9d71('0xd2')],'as':_0x9d71('0xd3'),'attributes':['id',_0x9d71('0x2a')]});_0xdf73d1['push']({'model':db[_0x9d71('0xca')],'as':_0x9d71('0xd4'),'attributes':['id',_0x9d71('0x2e')]});return db[_0x9d71('0x34')][_0x9d71('0x60')]({'where':{'id':_0xd35986[_0x9d71('0xb1')]['id']},'include':_0xdf73d1})[_0x9d71('0x27')](handleEntityNotFound(_0x44e76f,null))[_0x9d71('0x27')](function(_0x4dd3de){if(_0x4dd3de){var _0x3ec79a=_0x4dd3de[_0x9d71('0xd5')]({'plain':!![]});fs[_0x9d71('0xd6')](_0x10a546);var _0x418c5c={'channel':_0x9d71('0xd7'),'account':_0x3ec79a[_0x9d71('0xd3')][_0x9d71('0x2a')],'agent':_0x3ec79a[_0x9d71('0xd4')]?_0x3ec79a[_0x9d71('0xd4')]['fullname']:'N.A.','createdAt':moment(_0x3ec79a[_0x9d71('0x79')])[_0x9d71('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9d71('0x98')](),'closedAt':_0x3ec79a[_0x9d71('0xd8')]?moment(_0x3ec79a[_0x9d71('0xd9')])[_0x9d71('0xbe')](_0x9d71('0xda'))[_0x9d71('0x98')]():'','disposition':_0x3ec79a[_0x9d71('0xdb')],'visibility':_0x3ec79a['threadId']?_0x9d71('0xdc'):_0x9d71('0xdd'),'messages':_(_0x3ec79a[_0x9d71('0xce')])['filter']({'secret':![]})[_0x9d71('0x2d')](function(_0x3ccea8){if(_0x3ccea8[_0x9d71('0xcd')]){var _0xe13142=path['join'](_0x44a046,_0x3ccea8[_0x9d71('0xcd')]['basename']);if(fs[_0x9d71('0xde')](_0xe13142)){fs[_0x9d71('0xdf')](_0xe13142)['pipe'](fs['createWriteStream'](path[_0x9d71('0xc4')](_0x10a546,_0x3ccea8[_0x9d71('0xcd')][_0x9d71('0xe0')])));}}return{'date':moment(_0x3ccea8[_0x9d71('0x79')])['format'](_0x9d71('0xda'))[_0x9d71('0x98')](),'sender':_0x3ccea8[_0x9d71('0xcf')]==='out'?_0x3ccea8[_0x9d71('0xca')]?_0x3ccea8[_0x9d71('0xca')]['fullname']:'System':_0x3ccea8['Contact'][_0x9d71('0xe1')]+(_0x3ccea8[_0x9d71('0x65')][_0x9d71('0xcc')]?'\x20'+_0x3ccea8[_0x9d71('0x65')][_0x9d71('0xcc')]:''),'body':_0x3ccea8['Attachment']?_0x3ccea8['Attachment'][_0x9d71('0xe0')]:_0x3ccea8[_0x9d71('0x73')],'direction':_0x3ccea8['direction']===_0x9d71('0xe2')?'A':'C','secret':_0x3ccea8['secret'],'read':_0x3ccea8[_0x9d71('0xd1')],'attachment':_0x3ccea8['Attachment']};})[_0x9d71('0x61')]()};return ejs[_0x9d71('0xe3')](path['join'](config[_0x9d71('0xc5')],_0x9d71('0xc6'),'views','downloadInteraction.ejs'),{'interaction':_0x418c5c})['then'](function(_0x24366b){var _0x3412a5=path[_0x9d71('0xc4')](_0x10a546,_0x9d71('0xe4')+_0x3ec79a['id']+'-'+_0x16dc47+'.pdf');var _0x138fd2={'path':_0x3412a5,'channel':_0x9d71('0xd7'),'interactionId':_0x3ec79a['id']};return pdf['createPdfFromHTML'](_0x24366b,_0x138fd2);})[_0x9d71('0x27')](function(){return new BPromise(function(_0x4edb3c,_0x23ebb1){zipdir(_0x10a546,{'saveTo':_0x5c24f6},function(_0x261ea2,_0x304ff1){if(_0x261ea2)return _0x23ebb1(_0x261ea2);return _0x4edb3c(_0x304ff1);});})['then'](function(){return new BPromise(function(_0xb056e4,_0x1dc3c2){rimraf(_0x10a546,function(_0x17426f){if(_0x17426f)_0x1dc3c2(_0x17426f);return _0xb056e4();});});})[_0x9d71('0x27')](function(){return _0x44e76f[_0x9d71('0xc3')](_0x5c24f6,_0x3af666,function(_0x30e98e){if(_0x30e98e){console[_0x9d71('0xe5')](_0x9d71('0xe6'),_0x30e98e);}else{fs[_0x9d71('0xe7')](_0x5c24f6);}});});});}else{return _0x44e76f[_0x9d71('0x1e')](0xc8);}})['catch'](handleError(_0x44e76f,null));};
\ No newline at end of file
+var _0x899f=['c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','tag','isArray','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','all','rows','show','params','rawAttributes','includeAll','include','create','update','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','pick','OpenchannelInteractionId','$gte','options','addTags','setTags','omit','Tag','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','fullname','firstName','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','N.A.','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','direction','out','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','Tags','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue'];(function(_0x155d7b,_0x77d5c9){var _0xcf6f90=function(_0x5ee2c0){while(--_0x5ee2c0){_0x155d7b['push'](_0x155d7b['shift']());}};_0xcf6f90(++_0x77d5c9);}(_0x899f,0x8b));var _0xf899=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0x899f[_0x34b821];return _0x5e00a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf899('0x0'));var zipdir=require(_0xf899('0x1'));var jsonpatch=require(_0xf899('0x2'));var rp=require('request-promise');var moment=require(_0xf899('0x3'));var BPromise=require(_0xf899('0x4'));var Mustache=require(_0xf899('0x5'));var util=require(_0xf899('0x6'));var path=require('path');var sox=require(_0xf899('0x7'));var csv=require(_0xf899('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf899('0x9'));var _=require(_0xf899('0xa'));var squel=require('squel');var crypto=require(_0xf899('0xb'));var jsforce=require(_0xf899('0xc'));var deskjs=require(_0xf899('0xd'));var toCsv=require(_0xf899('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf899('0xe'));var authService=require(_0xf899('0xf'));var qs=require(_0xf899('0x10'));var as=require(_0xf899('0x11'));var pdf=require(_0xf899('0x12'));var hardwareService=require(_0xf899('0x13'));var logger=require(_0xf899('0x14'))(_0xf899('0x15'));var utils=require(_0xf899('0x16'));var config=require(_0xf899('0x17'));var licenseUtil=require(_0xf899('0x18'));var db=require(_0xf899('0x19'))['db'];config[_0xf899('0x1a')]=_[_0xf899('0x1b')](config[_0xf899('0x1a')],{'host':_0xf899('0x1c'),'port':0x18eb});var socket=require(_0xf899('0x1d'))(new Redis(config['redis']));require(_0xf899('0x1e'))['register'](socket);function respondWithStatusCode(_0xa534fc,_0x570c66){_0x570c66=_0x570c66||0xcc;return function(_0x5abf13){if(_0x5abf13){return _0xa534fc[_0xf899('0x1f')](_0x570c66);}return _0xa534fc[_0xf899('0x20')](_0x570c66)[_0xf899('0x21')]();};}function respondWithResult(_0x1e1f00,_0x4e0a03){_0x4e0a03=_0x4e0a03||0xc8;return function(_0x31a362){if(_0x31a362){return _0x1e1f00[_0xf899('0x20')](_0x4e0a03)[_0xf899('0x22')](_0x31a362);}};}function respondWithFilteredResult(_0x26e938,_0x14dfd0){return function(_0xaea0f1){if(_0xaea0f1){var _0x2d906e=typeof _0x14dfd0['offset']===_0xf899('0x23')&&typeof _0x14dfd0[_0xf899('0x24')]===_0xf899('0x23');var _0x610b07=_0xaea0f1[_0xf899('0x25')];var _0x423c8f=_0x2d906e?0x0:_0x14dfd0['offset'];var _0x50c305=_0x2d906e?_0xaea0f1[_0xf899('0x25')]:_0x14dfd0['offset']+_0x14dfd0[_0xf899('0x24')];var _0x580b06;if(_0x50c305>=_0x610b07){_0x50c305=_0x610b07;_0x580b06=0xc8;}else{_0x580b06=0xce;}_0x26e938[_0xf899('0x20')](_0x580b06);return _0x26e938[_0xf899('0x26')](_0xf899('0x27'),_0x423c8f+'-'+_0x50c305+'/'+_0x610b07)[_0xf899('0x22')](_0xaea0f1);}return null;};}function patchUpdates(_0x374c11){return function(_0x1159ba){try{jsonpatch[_0xf899('0x28')](_0x1159ba,_0x374c11,!![]);}catch(_0x49b150){return BPromise[_0xf899('0x29')](_0x49b150);}return _0x1159ba[_0xf899('0x2a')]();};}function saveUpdates(_0x1c86d8,_0xd76e58){return function(_0x2decd7){if(_0x2decd7){return _0x2decd7['update'](_0x1c86d8)[_0xf899('0x2b')](function(_0x5f0093){return _0x5f0093;});}return null;};}function removeEntity(_0x5057c2,_0x32b023){return function(_0x3cdd9b){if(_0x3cdd9b){return _0x3cdd9b[_0xf899('0x2c')]()[_0xf899('0x2b')](function(){_0x5057c2['status'](0xcc)[_0xf899('0x21')]();});}};}function handleEntityNotFound(_0x105f27,_0x579bb3){return function(_0x24d236){if(!_0x24d236){_0x105f27[_0xf899('0x1f')](0x194);}return _0x24d236;};}function handleError(_0xdaf560,_0x27284b){_0x27284b=_0x27284b||0x1f4;return function(_0x4f1c9f){logger[_0xf899('0x2d')](_0x4f1c9f[_0xf899('0x2e')]);if(_0x4f1c9f[_0xf899('0x2f')]){delete _0x4f1c9f['name'];}_0xdaf560[_0xf899('0x20')](_0x27284b)['send'](_0x4f1c9f);};}function getInteractionUsers(_0x3e25b0,_0x4cf868){return new BPromise(function(_0x2813f5,_0xb6126){try{if(_0x4cf868[_0x3e25b0['id']]){_0x3e25b0['Users']=_[_0xf899('0x30')](_0x4cf868[_0x3e25b0['id']],function(_0x190532){return{'id':_0x190532['id'],'fullname':_0x190532['fullname']};});}}catch(_0x2f5cda){_0xb6126(_0x2f5cda);}_0x2813f5(_0x3e25b0);});}function getInteractionTags(_0x232030,_0x30e1fa){return new BPromise(function(_0xcc66a1,_0x3b644c){try{if(_0x232030['TagIds']){_0x232030[_0xf899('0x31')]=[];_0x232030[_0xf899('0x32')][_0xf899('0x33')](',')[_0xf899('0x34')](function(_0x3f63c7){_0x232030[_0xf899('0x31')][_0xf899('0x35')](_0x30e1fa[_0x3f63c7]);});}delete _0x232030[_0xf899('0x32')];}catch(_0x1a614c){_0x3b644c(_0x1a614c);}_0xcc66a1(_0x232030);});}function updateOpenchannelInteraction(_0x68b06b,_0x500564,_0x58c4a1){return new BPromise(function(_0x1bc76b,_0x36cb31){return getInteractionUsers(_0x68b06b,_0x58c4a1)[_0xf899('0x2b')](function(_0x5a9d0a){return getInteractionTags(_0x5a9d0a,_0x500564);})[_0xf899('0x2b')](function(_0x5186e1){_0x1bc76b(_0x5186e1);})[_0xf899('0x36')](function(_0x4c15e9){_0x36cb31(_0x4c15e9);});});}exports[_0xf899('0x37')]=function(_0x5112fe,_0x3e9a4b){var _0x267eb5={},_0x364bcc={},_0x121800={'count':0x0,'rows':[]};var _0x1a0626=_[_0xf899('0x30')](db[_0xf899('0x38')]['rawAttributes'],function(_0x5774cf){return{'name':_0x5774cf[_0xf899('0x39')],'type':_0x5774cf['type'][_0xf899('0x3a')]};});_0x364bcc['model']=_[_0xf899('0x30')](_0x1a0626,_0xf899('0x2f'));_0x364bcc[_0xf899('0x3b')]=_[_0xf899('0x3c')](_0x5112fe['query']);_0x364bcc[_0xf899('0x3d')]=_[_0xf899('0x3e')](_0x364bcc['model'],_0x364bcc[_0xf899('0x3b')]);_0x267eb5[_0xf899('0x3f')]=_['intersection'](_0x364bcc[_0xf899('0x40')],qs[_0xf899('0x41')](_0x5112fe['query'][_0xf899('0x41')]));_0x267eb5[_0xf899('0x3f')]=_0x267eb5['attributes'][_0xf899('0x42')]?_0x267eb5[_0xf899('0x3f')]:_0x364bcc['model'];if(!_0x5112fe['query'][_0xf899('0x43')](_0xf899('0x44'))){_0x267eb5[_0xf899('0x24')]=qs[_0xf899('0x24')](_0x5112fe[_0xf899('0x3b')][_0xf899('0x24')]);_0x267eb5[_0xf899('0x45')]=qs['offset'](_0x5112fe[_0xf899('0x3b')][_0xf899('0x45')]);}_0x267eb5[_0xf899('0x46')]=qs[_0xf899('0x47')](_0x5112fe[_0xf899('0x3b')]['sort']);_0x267eb5[_0xf899('0x48')]=qs['filters'](_['pick'](_0x5112fe['query'],_0x364bcc[_0xf899('0x3d')]),_0x1a0626);var _0x5896ae=[];var _0x29d0ef=squel[_0xf899('0x49')]()[_0xf899('0x4a')]('id')['field'](_0xf899('0x2f'))[_0xf899('0x4a')](_0xf899('0x4b'))[_0xf899('0x4c')](_0xf899('0x4d'));var _0x22e850=squel[_0xf899('0x49')]()[_0xf899('0x4a')](_0xf899('0x4e'))['field'](_0xf899('0x4f'))[_0xf899('0x4a')]('ui.OpenchannelInteractionId')[_0xf899('0x4c')]('user_has_openchannel_interactions','ui')['left_join'](_0xf899('0x50'),'u',_0xf899('0x51'));var _0x8f6e32=squel[_0xf899('0x49')]()[_0xf899('0x4c')](_0xf899('0x52'),'i')[_0xf899('0x53')](_0xf899('0x54'),'c',_0xf899('0x55'))[_0xf899('0x53')](_0xf899('0x50'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xf899('0x56'),'a',_0xf899('0x57'))[_0xf899('0x53')]('openchannel_messages','me',_0xf899('0x58'))[_0xf899('0x53')]('openchannel_interaction_has_tags','it',_0xf899('0x59'))['left_join'](_0xf899('0x4d'),'t',_0xf899('0x5a'));var _0x591740=squel[_0xf899('0x5b')]();var _0x176414=[];var _0x16d5ff=squel[_0xf899('0x5b')]();var _0x24ba23;if(_0x5112fe['query'][_0xf899('0x5c')]){_0x24ba23=as['parseSearch'](_0x5112fe[_0xf899('0x3b')][_0xf899('0x5c')]);var _0x3e61a5=_0x24ba23[_0xf899('0x5d')];for(var _0x281165=0x0;_0x281165<_0x24ba23['conditions']['length'];_0x281165++){var _0x19718f=_0x24ba23[_0xf899('0x5e')][_0x281165];var _0x4040a0='i';var _0x19e52e=_[_0xf899('0x5f')](_0x1a0626,[_0xf899('0x2f'),_0x19718f[_0xf899('0x4a')]]);if(!_0x19e52e){switch(_0x19718f['field']){case _0xf899('0x60'):if(_0x19718f[_0xf899('0x61')]==0x1){_0x8f6e32[_0xf899('0x62')]('`'+_0x19718f[_0xf899('0x4a')]+_0xf899('0x63'));}else{_0x8f6e32[_0xf899('0x62')]('`'+_0x19718f['field']+_0xf899('0x64'));}break;case _0xf899('0x65'):if(_0x19718f[_0xf899('0x66')]==='$substring'){if(_0x19718f[_0xf899('0x61')][_0xf899('0x33')]('\x20')[_0xf899('0x42')]>0x1){_0x591740[_0x3e61a5](_0xf899('0x67'),qs[_0xf899('0x68')](_0x19718f[_0xf899('0x61')]),null);}else{var _0x2f0639='%'+_0x19718f[_0xf899('0x61')]+'%';_0x591740[_0x3e61a5](_0xf899('0x69'),_0x2f0639,_0x2f0639,_0x2f0639);}}else{_0x19e52e=_['find'](_0x1a0626,[_0xf899('0x2f'),_0xf899('0x6a')]);_0x19718f[_0xf899('0x4a')]=_0xf899('0x6a');_0x9db8e1=as[_0xf899('0x6b')](_0x4040a0,_0x19e52e[_0xf899('0x6c')],_0x19718f);_0x591740[_0x3e61a5](_0x9db8e1[_0xf899('0x6d')],_0x9db8e1['value']['start'],_0x9db8e1[_0xf899('0x61')][_0xf899('0x21')]);}break;case'Tag':var _0x4c7e5e=_0x19718f['value'][_0xf899('0x33')](',')['map'](function(_0x381602){return Number(_0x381602);});_0x4c7e5e[_0xf899('0x34')](function(_0x40c510){_0x16d5ff['or'](_0xf899('0x6e'),'%,'+_0x40c510+',%');});_0x176414=_[_0xf899('0x6f')](_0x176414,_0x4c7e5e);break;case _0xf899('0x70'):if(_0x19718f[_0xf899('0x66')]===_0xf899('0x71')){_0x591740[_0x3e61a5](_0xf899('0x72'),'%'+_0x19718f['value']+'%',null);}else{_0x19e52e=_['find'](_0x1a0626,['name','UserId']);_0x19718f[_0xf899('0x4a')]='UserId';_0x9db8e1=as[_0xf899('0x6b')](_0x4040a0,_0x19e52e[_0xf899('0x6c')],_0x19718f);_0x591740[_0x3e61a5](_0x9db8e1['text'],_0x9db8e1[_0xf899('0x61')][_0xf899('0x73')],_0x9db8e1[_0xf899('0x61')][_0xf899('0x21')]);}break;case _0xf899('0x74'):_0x9db8e1=as[_0xf899('0x6b')]('me',null,_0x19718f);_0x591740[_0x3e61a5](_0x9db8e1['text'],_0x9db8e1['value']['start'],_0x9db8e1[_0xf899('0x61')][_0xf899('0x21')]);break;}}else{var _0x9db8e1=as[_0xf899('0x6b')](_0x4040a0,_0x19e52e['type'],_0x19718f);_0x591740[_0x3e61a5](_0x9db8e1[_0xf899('0x6d')],_0x9db8e1['value'][_0xf899('0x73')],_0x9db8e1[_0xf899('0x61')][_0xf899('0x21')]);}}}else{var _0x14f21c=_(_0x5112fe['query'])[_0xf899('0x3c')]()[_0xf899('0x30')](function(_0x3a35c0){return _[_0xf899('0x75')](_0x1a0626,[_0xf899('0x2f'),_0x3a35c0])?_0x3a35c0:undefined;})[_0xf899('0x76')]()['value']();if(!_[_0xf899('0x77')](_0x14f21c)){_0x14f21c[_0xf899('0x34')](function(_0x37cee2){if(_0x37cee2===_0xf899('0x78')){_0x8f6e32[_0xf899('0x48')](_0xf899('0x79'),[][_0xf899('0x7a')](_0x5112fe[_0xf899('0x3b')][_0x37cee2]));}else if(_0x37cee2==='createdAt'){var _0x326d7c=JSON['parse'](_0x5112fe[_0xf899('0x3b')][_0x37cee2])['$gte'];var _0x49ade6=JSON[_0xf899('0x7b')](_0x5112fe[_0xf899('0x3b')][_0x37cee2])[_0xf899('0x7c')];_0x8f6e32['where'](_0xf899('0x7d'),_0x326d7c,_0x49ade6);}else{if(_0x5112fe[_0xf899('0x3b')][_0x37cee2]===_0xf899('0x7e')){_0x8f6e32['where']('i.'+_0x37cee2+_0xf899('0x7f'));}else{_0x8f6e32[_0xf899('0x48')]('i.'+_0x37cee2+_0xf899('0x80'),_0x5112fe[_0xf899('0x3b')][_0x37cee2]);}}});}if(_0x5112fe[_0xf899('0x3b')]['read']){if(_0x5112fe[_0xf899('0x3b')][_0xf899('0x81')]==0x1){_0x8f6e32[_0xf899('0x62')]('`unreadMessages`\x20=\x200');}else{_0x8f6e32[_0xf899('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x5112fe[_0xf899('0x3b')][_0xf899('0x82')]){_0x176414=_[_0xf899('0x83')](_0x5112fe[_0xf899('0x3b')][_0xf899('0x82')])?_0x5112fe['query'][_0xf899('0x82')]:new Array(_0x5112fe[_0xf899('0x3b')]['tag']);_0x176414['forEach'](function(_0x33fff8){_0x16d5ff['or'](_0xf899('0x6e'),'%,'+_0x33fff8+',%');});}if(_0x5112fe['query'][_0xf899('0x84')]){var _0x332e94=_0x5112fe[_0xf899('0x3b')][_0xf899('0x84')]['replace']('\x5c','\x5c\x5c')[_0xf899('0x85')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x332e94)){_0x591740['or']('i.id\x20LIKE\x20?',_0x332e94+'%');}else{_0x591740['or'](_0xf899('0x86'),qs['getFullTextValue'](_0x332e94))['or'](_0xf899('0x87'),_0x332e94+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x332e94+'%');}}}_0x8f6e32['where'](_0x591740);_0x8f6e32[_0xf899('0x88')]('i.id');var _0xa1cc9c={'type':db[_0xf899('0x89')][_0xf899('0x8a')][_0xf899('0x8b')],'raw':!![]};var _0xc5af0b=_0x8f6e32['clone']();_0xc5af0b[_0xf899('0x4a')]('i.id');_0xc5af0b['field'](_0xf899('0x8c'),_0xf899('0x60'));if(_0x267eb5[_0xf899('0x46')]){_0x267eb5['order'][_0xf899('0x34')](function(_0x273707){var _0x177a4a=_0x273707[0x0]===_0xf899('0x8d')?_0x273707[0x0]:'i.'+_0x273707[0x0];_0x8f6e32[_0xf899('0x46')](_0x177a4a,_0x273707[0x1]===_0xf899('0x8e')?![]:!![]);});}if(!_[_0xf899('0x77')](_0x176414)){_0x8f6e32['having'](_0x16d5ff);_0xc5af0b[_0xf899('0x48')](_0xf899('0x8f'),_0x176414);}BPromise['resolve']()[_0xf899('0x2b')](function(){if(!_0x24ba23){if(_0x5112fe['query'][_0xf899('0x78')])return;_0xc5af0b[_0xf899('0x48')](_0xf899('0x90'));_0x8f6e32[_0xf899('0x48')](_0xf899('0x90'));return;}if(_0x5112fe['user'][_0xf899('0x91')]!==_0xf899('0x92'))return;return _0x5112fe[_0xf899('0x93')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xf899('0x2b')](function(_0x1cec49){if(_[_0xf899('0x77')](_0x1cec49)){_0xc5af0b[_0xf899('0x48')](_0xf899('0x94'));_0x8f6e32['where'](_0xf899('0x94'));}else{_0xc5af0b[_0xf899('0x48')](_0xf899('0x79'),_[_0xf899('0x30')](_0x1cec49,'id'));_0x8f6e32[_0xf899('0x48')](_0xf899('0x79'),_[_0xf899('0x30')](_0x1cec49,'id'));}});})[_0xf899('0x2b')](function(){if(_0x5112fe[_0xf899('0x93')]['role']===_0xf899('0x92')&&!_0x24ba23&&!_0x5112fe[_0xf899('0x3b')]['OpenchannelAccountId'])return[];return db[_0xf899('0x95')][_0xf899('0x3b')](_0xc5af0b[_0xf899('0x96')](),_0xa1cc9c);})['then'](function(_0x49c37d){_0x121800[_0xf899('0x25')]=_0x49c37d[_0xf899('0x42')];if(_0x121800[_0xf899('0x25')]===0x0)return[];return db[_0xf899('0x95')][_0xf899('0x3b')](_0x29d0ef[_0xf899('0x96')](),_0xa1cc9c)['then'](function(_0x423100){_0x5896ae=_[_0xf899('0x97')](_0x423100,'id');_0xa1cc9c=_[_0xf899('0x98')](_0xa1cc9c,{'model':db[_0xf899('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5112fe[_0xf899('0x3b')]['fields']){_0x267eb5['attributes'][_0xf899('0x34')](function(_0x4deb14){_0x8f6e32[_0xf899('0x4a')]('i.'+_0x4deb14);});}else{_0x8f6e32['field'](_0xf899('0x8c'),_0xf899('0x60'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0x99'),_0xf899('0x9a'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0x9b'),_0xf899('0x9c'));_0x8f6e32[_0xf899('0x4a')]('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',_0xf899('0x8d'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0x9d'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0x9e'),'Contact.firstName');_0x8f6e32['field'](_0xf899('0x9f'),_0xf899('0xa0'));_0x8f6e32[_0xf899('0x4a')]('c.email',_0xf899('0xa1'));_0x8f6e32['field'](_0xf899('0xa2'),_0xf899('0xa3'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0xa4'),_0xf899('0xa5'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0xa6'),_0xf899('0xa7'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0xa8'),_0xf899('0xa9'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0xaa'),_0xf899('0xab'));_0x8f6e32[_0xf899('0x4a')](_0xf899('0xac'),_0xf899('0x32'));}if(_0x267eb5['limit'])_0x8f6e32[_0xf899('0x24')](_0x267eb5['limit']);if(_0x267eb5[_0xf899('0x45')])_0x8f6e32[_0xf899('0x45')](_0x267eb5[_0xf899('0x45')]);return db[_0xf899('0x95')]['query'](_0x8f6e32[_0xf899('0x96')](),_0xa1cc9c);})[_0xf899('0x2b')](function(_0x53fd3e){if(_0x53fd3e['length']>0x0)_0x22e850[_0xf899('0x48')](_0xf899('0xad'),_[_0xf899('0x30')](_0x53fd3e,'id'));return db[_0xf899('0x95')]['query'](_0x22e850[_0xf899('0x96')](),_0xa1cc9c)[_0xf899('0x2b')](function(_0x2b7a4c){var _0x5d1c77=_[_0xf899('0xae')](_0x2b7a4c,'OpenchannelInteractionId');var _0x5c107b=[];_0x53fd3e[_0xf899('0x34')](function(_0x378777){_0x5c107b['push'](updateOpenchannelInteraction(_0x378777,_0x5896ae,_0x5d1c77));});return BPromise[_0xf899('0xaf')](_0x5c107b);});});})[_0xf899('0x2b')](function(_0x5e0dec){_0x121800[_0xf899('0xb0')]=_0x5e0dec;return _0x121800;})[_0xf899('0x2b')](respondWithFilteredResult(_0x3e9a4b,_0x267eb5))['catch'](handleError(_0x3e9a4b,null));};exports[_0xf899('0xb1')]=function(_0x3a236f,_0x19cb12){var _0x24ce2b={};if(_0x3a236f['query']['type']&&_0x3a236f['query'][_0xf899('0x6c')]===_0xf899('0x4c')){_0x24ce2b[_0xf899('0x4c')]=_0x3a236f['params']['id'];}else{_0x24ce2b['id']=_0x3a236f[_0xf899('0xb2')]['id'];}var _0x5c8aee={'raw':![],'where':_0x24ce2b},_0x4374ac={};_0x4374ac[_0xf899('0x40')]=_[_0xf899('0x3c')](db[_0xf899('0x38')][_0xf899('0xb3')]);_0x4374ac[_0xf899('0x3b')]=_[_0xf899('0x3c')](_0x3a236f['query']);_0x4374ac['filters']=_[_0xf899('0x3e')](_0x4374ac[_0xf899('0x40')],_0x4374ac[_0xf899('0x3b')]);_0x5c8aee['attributes']=_[_0xf899('0x3e')](_0x4374ac['model'],qs[_0xf899('0x41')](_0x3a236f[_0xf899('0x3b')][_0xf899('0x41')]));_0x5c8aee[_0xf899('0x3f')]=_0x5c8aee['attributes'][_0xf899('0x42')]?_0x5c8aee[_0xf899('0x3f')]:_0x4374ac[_0xf899('0x40')];if(_0x3a236f['query'][_0xf899('0xb4')]){_0x5c8aee[_0xf899('0xb5')]=[{'all':!![]}];}_0x5c8aee=_[_0xf899('0x98')]({},_0x5c8aee,_0x3a236f['options']);return db['OpenchannelInteraction'][_0xf899('0x5f')](_0x5c8aee)[_0xf899('0x2b')](handleEntityNotFound(_0x19cb12,null))[_0xf899('0x2b')](respondWithResult(_0x19cb12,null))[_0xf899('0x36')](handleError(_0x19cb12,null));};exports[_0xf899('0xb6')]=function(_0xde48b4,_0x47d9bd){return db[_0xf899('0x38')][_0xf899('0xb6')](_0xde48b4[_0xf899('0x74')],{})[_0xf899('0x2b')](respondWithResult(_0x47d9bd,0xc9))['catch'](handleError(_0x47d9bd,null));};exports[_0xf899('0xb7')]=function(_0x1ced1d,_0x2a6dd9){if(_0x1ced1d[_0xf899('0x74')]['id']){delete _0x1ced1d[_0xf899('0x74')]['id'];}return db[_0xf899('0x38')][_0xf899('0x5f')]({'where':{'id':_0x1ced1d['params']['id']}})['then'](handleEntityNotFound(_0x2a6dd9,null))['then'](saveUpdates(_0x1ced1d[_0xf899('0x74')],null))['then'](respondWithResult(_0x2a6dd9,null))['catch'](handleError(_0x2a6dd9,null));};exports[_0xf899('0x2c')]=function(_0x1c2563,_0x3900d0){return db['OpenchannelInteraction']['find']({'where':{'id':_0x1c2563[_0xf899('0xb2')]['id']}})[_0xf899('0x2b')](handleEntityNotFound(_0x3900d0,null))[_0xf899('0x2b')](removeEntity(_0x3900d0,null))[_0xf899('0x36')](handleError(_0x3900d0,null));};exports[_0xf899('0xb8')]=function(_0x2bb2d5,_0x1c6eca){return db['OpenchannelInteraction']['describe']()[_0xf899('0x2b')](respondWithResult(_0x1c6eca,null))['catch'](handleError(_0x1c6eca,null));};exports[_0xf899('0xb9')]=function(_0x25b5bb,_0x22c705,_0x5b9064){return db[_0xf899('0xba')][_0xf899('0x5f')]({'where':{'id':_0x25b5bb['params']['id']}})[_0xf899('0x2b')](handleEntityNotFound(_0x22c705,null))['then'](function(_0x3337ad){if(_0x3337ad){return _0x3337ad['addMessage'](_0x25b5bb[_0xf899('0x74')]['ids'],_['omit'](_0x25b5bb[_0xf899('0x74')],[_0xf899('0xbb'),'id'])||{});}})[_0xf899('0x2b')](respondWithResult(_0x22c705,null))[_0xf899('0x36')](handleError(_0x22c705,null));};exports[_0xf899('0xbc')]=function(_0x5f1930,_0x106b12,_0x44eb34){var _0x11797e={'raw':![],'where':{}};var _0x122cba={};var _0x2bdcdc={'count':0x0,'rows':[]};return db[_0xf899('0x38')][_0xf899('0xbd')]({'where':{'id':_0x5f1930['params']['id']}})[_0xf899('0x2b')](handleEntityNotFound(_0x106b12,null))[_0xf899('0x2b')](function(_0x25162e){if(_0x25162e){_0x122cba[_0xf899('0x40')]=_[_0xf899('0x3c')](db['OpenchannelMessage'][_0xf899('0xb3')]);_0x122cba[_0xf899('0x3b')]=_[_0xf899('0x3c')](_0x5f1930[_0xf899('0x3b')]);_0x122cba[_0xf899('0x3d')]=_['intersection'](_0x122cba[_0xf899('0x40')],_0x122cba[_0xf899('0x3b')]);_0x11797e[_0xf899('0x3f')]=_['intersection'](_0x122cba['model'],qs['fields'](_0x5f1930[_0xf899('0x3b')][_0xf899('0x41')]));_0x11797e[_0xf899('0x3f')]=_0x11797e[_0xf899('0x3f')]['length']?_0x11797e[_0xf899('0x3f')]:_0x122cba[_0xf899('0x40')];if(!_0x5f1930[_0xf899('0x3b')]['hasOwnProperty'](_0xf899('0x44'))){_0x11797e[_0xf899('0x24')]=qs[_0xf899('0x24')](_0x5f1930[_0xf899('0x3b')][_0xf899('0x24')]);_0x11797e[_0xf899('0x45')]=qs[_0xf899('0x45')](_0x5f1930['query'][_0xf899('0x45')]);}_0x11797e['order']=qs[_0xf899('0x47')](_0x5f1930[_0xf899('0x3b')]['sort']);_0x11797e[_0xf899('0x48')]=qs[_0xf899('0x3d')](_[_0xf899('0xbe')](_0x5f1930['query'],_0x122cba[_0xf899('0x3d')]));_0x11797e[_0xf899('0x48')][_0xf899('0xbf')]=_0x25162e['id'];if(_0x5f1930[_0xf899('0x3b')]['filter']){_0x11797e[_0xf899('0x48')]=_[_0xf899('0x98')](_0x11797e[_0xf899('0x48')],{'$or':_[_0xf899('0x30')](_0x11797e[_0xf899('0x3f')],function(_0x6f8c06){var _0x413811={};_0x413811[_0x6f8c06]={'$like':'%'+_0x5f1930[_0xf899('0x3b')]['filter']+'%'};return _0x413811;})});}if(_0x5f1930['query']['$gte']){var _0x610624=_0x5f1930[_0xf899('0x3b')][_0xf899('0xc0')]['split'](',');var _0x778716={};_0x778716[_0x610624[0x0]]={'$gte':moment(_0x610624[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x11797e[_0xf899('0x48')]=_['merge'](_0x11797e[_0xf899('0x48')],_0x778716);}_0x11797e=_['merge']({},_0x11797e,_0x5f1930[_0xf899('0xc1')]);return db[_0xf899('0xba')][_0xf899('0x25')]({'where':_0x11797e[_0xf899('0x48')]})[_0xf899('0x2b')](function(_0x3566f8){_0x2bdcdc[_0xf899('0x25')]=_0x3566f8;if(_0x5f1930[_0xf899('0x3b')]['includeAll']){_0x11797e['include']=[{'all':!![]}];}return db[_0xf899('0xba')]['findAll'](_0x11797e);})[_0xf899('0x2b')](function(_0x43e531){_0x2bdcdc[_0xf899('0xb0')]=_0x43e531;return _0x2bdcdc;});}})[_0xf899('0x2b')](respondWithFilteredResult(_0x106b12,_0x11797e))[_0xf899('0x36')](handleError(_0x106b12,null));};exports[_0xf899('0xc2')]=function(_0x53325f,_0xfe27c2,_0x40c7d3){return db[_0xf899('0x38')][_0xf899('0x5f')]({'where':{'id':_0x53325f['params']['id']}})[_0xf899('0x2b')](handleEntityNotFound(_0xfe27c2,null))[_0xf899('0x2b')](function(_0x243747){if(_0x243747){return _0x243747[_0xf899('0xc3')](_0x53325f[_0xf899('0x74')][_0xf899('0xbb')],_[_0xf899('0xc4')](_0x53325f[_0xf899('0x74')],['ids','id'])||{})['spread'](function(){return db[_0xf899('0xc5')][_0xf899('0xc6')]({'attributes':['id','name','color'],'where':{'id':_0x53325f[_0xf899('0x74')][_0xf899('0xbb')]}});})[_0xf899('0x2b')](function(_0x433289){socket[_0xf899('0xc7')](_0xf899('0xc8'),{'id':Number(_0x53325f[_0xf899('0xb2')]['id']),'tags':_0x433289||[]});return{'id':Number(_0x53325f[_0xf899('0xb2')]['id']),'tags':_0x433289||[]};});}})['then'](respondWithResult(_0xfe27c2,null))['catch'](handleError(_0xfe27c2,null));};exports[_0xf899('0xc9')]=function(_0x57b989,_0x181f88,_0x2d7f85){return db['OpenchannelInteraction'][_0xf899('0x5f')]({'where':{'id':_0x57b989[_0xf899('0xb2')]['id']}})[_0xf899('0x2b')](handleEntityNotFound(_0x181f88,null))[_0xf899('0x2b')](function(_0x15cd52){if(_0x15cd52){return _0x15cd52[_0xf899('0xc9')](_0x57b989[_0xf899('0x3b')][_0xf899('0xbb')]);}})[_0xf899('0x2b')](respondWithStatusCode(_0x181f88,null))[_0xf899('0x36')](handleError(_0x181f88,null));};exports[_0xf899('0xca')]=function(_0x411828,_0x1ddd87){var _0x44109a=moment()[_0xf899('0xcb')]()[_0xf899('0x96')]();var _0x510090=path[_0xf899('0xcc')](config[_0xf899('0xcd')],_0xf899('0xce'),_0xf899('0xcf'),_0xf899('0xd0'));var _0x135020=path[_0xf899('0xcc')](config['root'],'server',_0xf899('0xcf'),_0xf899('0xd1'));var _0xca7f86=path['join'](_0x510090,_0x44109a);var _0x315d7c=util['format']('transcript-%d-%s.zip',_0x411828[_0xf899('0xb2')]['id'],_0x44109a);var _0x63b7b4=path[_0xf899('0xcc')](_0x510090,_0x315d7c);var _0x45e30e=[];_0x45e30e[_0xf899('0x35')]({'model':db[_0xf899('0x70')],'as':_0xf899('0x70'),'attributes':['id',_0xf899('0xd2')],'raw':!![]});_0x45e30e[_0xf899('0x35')]({'model':db['CmContact'],'as':_0xf899('0x65'),'attributes':['id',_0xf899('0xd3'),'lastName'],'raw':!![]});if(_0x411828[_0xf899('0x3b')][_0xf899('0xd1')]){_0x45e30e[_0xf899('0x35')]({'model':db[_0xf899('0xd4')],'as':_0xf899('0xd4'),'raw':!![]});}var _0x3e3d42=[{'model':db[_0xf899('0xba')],'as':_0xf899('0xd5'),'attributes':['id',_0xf899('0x74'),_0xf899('0xd6'),'direction',_0xf899('0xd7'),_0xf899('0x81')],'include':_0x45e30e}];_0x3e3d42[_0xf899('0x35')]({'model':db[_0xf899('0xd8')],'as':_0xf899('0xd9'),'attributes':['id',_0xf899('0x2f')]});_0x3e3d42[_0xf899('0x35')]({'model':db[_0xf899('0x70')],'as':_0xf899('0xda'),'attributes':['id',_0xf899('0xd2')]});return db[_0xf899('0x38')][_0xf899('0x5f')]({'where':{'id':_0x411828['params']['id']},'include':_0x3e3d42})[_0xf899('0x2b')](handleEntityNotFound(_0x1ddd87,null))['then'](function(_0x10ebc0){if(_0x10ebc0){var _0x2ebc13=_0x10ebc0[_0xf899('0xdb')]({'plain':!![]});fs[_0xf899('0xdc')](_0xca7f86);var _0x4f2180={'channel':'Openchannel','account':_0x2ebc13[_0xf899('0xd9')][_0xf899('0x2f')],'agent':_0x2ebc13[_0xf899('0xda')]?_0x2ebc13[_0xf899('0xda')][_0xf899('0xd2')]:_0xf899('0xdd'),'createdAt':moment(_0x2ebc13['createdAt'])[_0xf899('0xde')](_0xf899('0xdf'))[_0xf899('0x96')](),'closedAt':_0x2ebc13['closed']?moment(_0x2ebc13[_0xf899('0xe0')])[_0xf899('0xde')](_0xf899('0xdf'))[_0xf899('0x96')]():'','disposition':_0x2ebc13[_0xf899('0xe1')],'visibility':_0x2ebc13[_0xf899('0xe2')]?_0xf899('0xe3'):_0xf899('0xe4'),'messages':_(_0x2ebc13['Messages'])[_0xf899('0x84')]({'secret':![]})[_0xf899('0x30')](function(_0x45c7a7){if(_0x45c7a7[_0xf899('0xd4')]){var _0x4a95a3=path[_0xf899('0xcc')](_0x135020,_0x45c7a7[_0xf899('0xd4')][_0xf899('0xe5')]);if(fs[_0xf899('0xe6')](_0x4a95a3)){fs['createReadStream'](_0x4a95a3)[_0xf899('0xe7')](fs[_0xf899('0xe8')](path[_0xf899('0xcc')](_0xca7f86,_0x45c7a7['Attachment']['basename'])));}}return{'date':moment(_0x45c7a7['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf899('0x96')](),'sender':_0x45c7a7[_0xf899('0xe9')]===_0xf899('0xea')?_0x45c7a7[_0xf899('0x70')]?_0x45c7a7[_0xf899('0x70')][_0xf899('0xd2')]:'System':_0x45c7a7[_0xf899('0x65')][_0xf899('0xd3')]+(_0x45c7a7[_0xf899('0x65')][_0xf899('0xeb')]?'\x20'+_0x45c7a7[_0xf899('0x65')][_0xf899('0xeb')]:''),'body':_0x45c7a7[_0xf899('0xd4')]?_0x45c7a7[_0xf899('0xd4')][_0xf899('0xe5')]:_0x45c7a7['body'],'direction':_0x45c7a7[_0xf899('0xe9')]==='out'?'A':'C','secret':_0x45c7a7[_0xf899('0xd7')],'read':_0x45c7a7['read'],'attachment':_0x45c7a7[_0xf899('0xd4')]};})['value']()};return ejs[_0xf899('0xec')](path[_0xf899('0xcc')](config[_0xf899('0xcd')],'server',_0xf899('0xed'),_0xf899('0xee')),{'interaction':_0x4f2180})['then'](function(_0x399e89){var _0xdf1386=path[_0xf899('0xcc')](_0xca7f86,_0xf899('0xef')+_0x2ebc13['id']+'-'+_0x44109a+_0xf899('0xf0'));var _0x1c21d3={'path':_0xdf1386,'channel':'Openchannel','interactionId':_0x2ebc13['id']};return pdf['createPdfFromHTML'](_0x399e89,_0x1c21d3);})[_0xf899('0x2b')](function(){return new BPromise(function(_0x483a34,_0x9e9b15){zipdir(_0xca7f86,{'saveTo':_0x63b7b4},function(_0x1ff28f,_0x44be16){if(_0x1ff28f)return _0x9e9b15(_0x1ff28f);return _0x483a34(_0x44be16);});})[_0xf899('0x2b')](function(){return new BPromise(function(_0x1c9cd2,_0x53f5f9){rimraf(_0xca7f86,function(_0x45a983){if(_0x45a983)_0x53f5f9(_0x45a983);return _0x1c9cd2();});});})[_0xf899('0x2b')](function(){return _0x1ddd87[_0xf899('0xca')](_0x63b7b4,_0x315d7c,function(_0x3b229b){if(_0x3b229b){console[_0xf899('0xf1')](_0xf899('0xf2'),_0x3b229b);}else{fs[_0xf899('0xf3')](_0x63b7b4);}});});});}else{return _0x1ddd87[_0xf899('0x1f')](0xc8);}})[_0xf899('0x36')](handleError(_0x1ddd87,null));};
\ No newline at end of file
index 2fed43b..40d24b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3898=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x26f1d2,_0x252997){var _0x39c09e=function(_0x341832){while(--_0x341832){_0x26f1d2['push'](_0x26f1d2['shift']());}};_0x39c09e(++_0x252997);}(_0x3898,0x18f));var _0x8389=function(_0x4c3340,_0x12d85e){_0x4c3340=_0x4c3340-0x0;var _0x3a0762=_0x3898[_0x4c3340];return _0x3a0762;};'use strict';var EventEmitter=require(_0x8389('0x0'));var OpenchannelInteraction=require(_0x8389('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x8389('0x1'))['db'][_0x8389('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8389('0x3')](0x0);var events={'afterCreate':_0x8389('0x4'),'afterUpdate':_0x8389('0x5'),'afterDestroy':'remove'};function emitEvent(_0x151ba9){return function(_0x1f1128,_0x5f0101,_0x58ae9f){_0x1f1128[_0x8389('0x6')]({'attributes':['id'],'raw':!![]})[_0x8389('0x7')](function(_0x366451){_0x1f1128[_0x8389('0x8')]('Users',_0x366451['map'](function(_0x937c){return{'id':_0x937c['id']};}));return OpenchannelMessage[_0x8389('0x9')]({'where':{'OpenchannelInteractionId':_0x1f1128['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xcdde96){_0x1f1128[_0x8389('0x8')](_0x8389('0xa'),_0xcdde96[_0x8389('0xb')]);OpenchannelInteractionEvents[_0x8389('0xc')](_0x151ba9+':'+_0x1f1128['id'],_0x1f1128);OpenchannelInteractionEvents[_0x8389('0xc')](_0x151ba9,_0x1f1128);_0x58ae9f(null);})[_0x8389('0xd')](_0x58ae9f(null));};}for(var e in events){if(events[_0x8389('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x8389('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x00da=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','update','remove','then','setDataValue','Users','map','emit','hasOwnProperty','hook','exports','events'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x00da,0x68));var _0xa00d=function(_0x41715a,_0x296e4c){_0x41715a=_0x41715a-0x0;var _0x5c576b=_0x00da[_0x41715a];return _0x5c576b;};'use strict';var EventEmitter=require(_0xa00d('0x0'));var OpenchannelInteraction=require(_0xa00d('0x1'))['db'][_0xa00d('0x2')];var OpenchannelMessage=require(_0xa00d('0x1'))['db'][_0xa00d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa00d('0x4'),'afterUpdate':_0xa00d('0x5'),'afterDestroy':_0xa00d('0x6')};function emitEvent(_0x2e77){return function(_0x2253aa,_0x611c02,_0x19976a){_0x2253aa['getUsers']({'attributes':['id'],'raw':!![]})[_0xa00d('0x7')](function(_0x151c4a){_0x2253aa[_0xa00d('0x8')](_0xa00d('0x9'),_0x151c4a[_0xa00d('0xa')](function(_0x128f36){return{'id':_0x128f36['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2253aa['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa00d('0x7')](function(_0x4dfdf7){_0x2253aa['setDataValue']('unreadMessages',_0x4dfdf7['length']);OpenchannelInteractionEvents[_0xa00d('0xb')](_0x2e77+':'+_0x2253aa['id'],_0x2253aa);OpenchannelInteractionEvents[_0xa00d('0xb')](_0x2e77,_0x2253aa);_0x19976a(null);})['catch'](_0x19976a(null));};}for(var e in events){if(events[_0xa00d('0xc')](e)){var event=events[e];OpenchannelInteraction[_0xa00d('0xd')](e,emitEvent(event));}}module[_0xa00d('0xe')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 3e890d6..447421d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9b8=['utf8mb4_unicode_ci','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','utf8mb4'];(function(_0x397303,_0x1fef2d){var _0x1227cd=function(_0x510428){while(--_0x510428){_0x397303['push'](_0x397303['shift']());}};_0x1227cd(++_0x1fef2d);}(_0xe9b8,0x1ad));var _0x8e9b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe9b8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e9b('0x0'));var util=require(_0x8e9b('0x1'));var logger=require(_0x8e9b('0x2'))('api');var moment=require(_0x8e9b('0x3'));var BPromise=require(_0x8e9b('0x4'));var rp=require(_0x8e9b('0x5'));var fs=require('fs');var path=require(_0x8e9b('0x6'));var rimraf=require(_0x8e9b('0x7'));var config=require(_0x8e9b('0x8'));var attributes=require(_0x8e9b('0x9'));module['exports']=function(_0x50159c,_0x5bdb78){return _0x50159c[_0x8e9b('0xa')](_0x8e9b('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8e9b('0xc'),'collate':_0x8e9b('0xd'),'hooks':{'beforeUpdate':function(_0x12aaec,_0x3573e6,_0x18004f){if(_0x12aaec[_0x8e9b('0xe')]('closed')){_0x12aaec['closedAt']=moment()[_0x8e9b('0xf')](_0x8e9b('0x10'));}_0x18004f(null,_0x12aaec);}}});};
\ No newline at end of file
+var _0x3595=['path','rimraf','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','closedAt','format','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x3595,0x16a));var _0x5359=function(_0x538fbb,_0x15fb86){_0x538fbb=_0x538fbb-0x0;var _0x2ddfc7=_0x3595[_0x538fbb];return _0x2ddfc7;};'use strict';var _=require(_0x5359('0x0'));var util=require(_0x5359('0x1'));var logger=require(_0x5359('0x2'))(_0x5359('0x3'));var moment=require('moment');var BPromise=require(_0x5359('0x4'));var rp=require(_0x5359('0x5'));var fs=require('fs');var path=require(_0x5359('0x6'));var rimraf=require(_0x5359('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0x5359('0x8')]=function(_0x1fce26,_0x148c25){return _0x1fce26['define'](_0x5359('0x9'),attributes,{'tableName':_0x5359('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5359('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x5aedd0,_0x29276c,_0x59246a){if(_0x5aedd0[_0x5359('0xc')](_0x5359('0xd'))){_0x5aedd0[_0x5359('0xe')]=moment()[_0x5359('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x59246a(null,_0x5aedd0);}}});};
\ No newline at end of file
index ad4f5a0..28ba887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb11=['info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','find','addTags','ids','omit','spread','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','request','then'];(function(_0x1abfd2,_0xf12823){var _0xa82441=function(_0x596a0c){while(--_0x596a0c){_0x1abfd2['push'](_0x1abfd2['shift']());}};_0xa82441(++_0xf12823);}(_0xdb11,0x1dc));var _0x1db1=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xdb11[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x1db1('0x0'));var util=require('util');var moment=require(_0x1db1('0x1'));var BPromise=require(_0x1db1('0x2'));var rs=require(_0x1db1('0x3'));var fs=require('fs');var Redis=require(_0x1db1('0x4'));var db=require(_0x1db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1db1('0x6'))(_0x1db1('0x7'));var config=require(_0x1db1('0x8'));var jayson=require(_0x1db1('0x9'));var client=jayson['client'][_0x1db1('0xa')]({'port':0x232a});config[_0x1db1('0xb')]=_[_0x1db1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1db1('0xd'))(new Redis(config[_0x1db1('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x299e5e,_0x27cb39,_0x245142){return new BPromise(function(_0x352279,_0xedc7dc){return client[_0x1db1('0xe')](_0x299e5e,_0x245142)[_0x1db1('0xf')](function(_0x36f407){logger[_0x1db1('0x10')](_0x1db1('0x11'),_0x27cb39,'request\x20sent');logger[_0x1db1('0x12')](_0x1db1('0x13'),_0x27cb39,_0x1db1('0x14'),JSON[_0x1db1('0x15')](_0x36f407));if(_0x36f407[_0x1db1('0x16')]){if(_0x36f407[_0x1db1('0x16')][_0x1db1('0x17')]===0x1f4){logger[_0x1db1('0x16')](_0x1db1('0x11'),_0x27cb39,_0x36f407['error'][_0x1db1('0x18')]);return _0xedc7dc(_0x36f407[_0x1db1('0x16')]['message']);}logger[_0x1db1('0x16')](_0x1db1('0x11'),_0x27cb39,_0x36f407[_0x1db1('0x16')][_0x1db1('0x18')]);return _0x352279(_0x36f407[_0x1db1('0x16')][_0x1db1('0x18')]);}else{logger[_0x1db1('0x10')](_0x1db1('0x11'),_0x27cb39,_0x1db1('0x14'));_0x352279(_0x36f407[_0x1db1('0x19')]['message']);}})[_0x1db1('0x1a')](function(_0x49b86a){logger['error'](_0x1db1('0x11'),_0x27cb39,_0x49b86a);_0xedc7dc(_0x49b86a);});});}exports[_0x1db1('0x1b')]=function(_0x2fa36d){var _0x5d6a07=this;return new Promise(function(_0x18a288,_0x212a87){return db[_0x1db1('0x1c')][_0x1db1('0x1d')](_0x2fa36d[_0x1db1('0x1e')],{'raw':_0x2fa36d[_0x1db1('0x1f')]?_0x2fa36d[_0x1db1('0x1f')][_0x1db1('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fa36d['options']?_0x2fa36d[_0x1db1('0x1f')][_0x1db1('0x21')]||null:null,'attributes':_0x2fa36d[_0x1db1('0x1f')]?_0x2fa36d[_0x1db1('0x1f')][_0x1db1('0x22')]||null:null,'limit':_0x2fa36d['options']?_0x2fa36d[_0x1db1('0x1f')][_0x1db1('0x23')]||null:null})[_0x1db1('0xf')](function(_0x71c432){logger['info'](_0x1db1('0x1b'),_0x2fa36d);logger[_0x1db1('0x12')]('UpdateOpenchannelInteraction',_0x2fa36d,JSON[_0x1db1('0x15')](_0x71c432));_0x18a288(_0x71c432);})[_0x1db1('0x1a')](function(_0xe65432){logger[_0x1db1('0x16')](_0x1db1('0x1b'),_0xe65432[_0x1db1('0x18')],_0x2fa36d);_0x212a87(_0x5d6a07['error'](0x1f4,_0xe65432['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x50605d){return new Promise(function(_0xd417b3,_0x56a179){return db[_0x1db1('0x1c')][_0x1db1('0x24')]({'where':_0x50605d[_0x1db1('0x1f')]?_0x50605d['options'][_0x1db1('0x21')]||null:null})[_0x1db1('0xf')](function(_0xfdb16d){if(_0xfdb16d){return _0xfdb16d[_0x1db1('0x25')](_0x50605d[_0x1db1('0x1e')][_0x1db1('0x26')],_[_0x1db1('0x27')](_0x50605d['body'],[_0x1db1('0x26'),'id'])||{});}})[_0x1db1('0x28')](function(_0x39e37e){logger[_0x1db1('0x10')]('AddTags',_0x50605d);logger[_0x1db1('0x12')]('AddTags',_0x50605d,JSON[_0x1db1('0x15')](_0x39e37e));_0xd417b3(_0x39e37e);})[_0x1db1('0x1a')](function(_0x384bdb){logger[_0x1db1('0x16')]('AddTags',_0x384bdb['message'],_0x50605d);_0x56a179(_this[_0x1db1('0x16')](0x1f4,_0x384bdb[_0x1db1('0x18')]));});});};
\ No newline at end of file
+var _0x03a8=['then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','body','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03a8,0x12e));var _0x803a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03a8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x803a('0x0'));var util=require(_0x803a('0x1'));var moment=require(_0x803a('0x2'));var BPromise=require(_0x803a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x803a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x803a('0x5'));var logger=require(_0x803a('0x6'))(_0x803a('0x7'));var config=require(_0x803a('0x8'));var jayson=require(_0x803a('0x9'));var client=jayson[_0x803a('0xa')][_0x803a('0xb')]({'port':0x232a});config[_0x803a('0xc')]=_[_0x803a('0xd')](config[_0x803a('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x803a('0xe'))(new Redis(config[_0x803a('0xc')]));require(_0x803a('0xf'))[_0x803a('0x10')](socket);function respondWithRpcPromise(_0x37a100,_0x1e13d1,_0x2cec18){return new BPromise(function(_0x502307,_0x2d69d8){return client[_0x803a('0x11')](_0x37a100,_0x2cec18)[_0x803a('0x12')](function(_0x40737c){logger[_0x803a('0x13')](_0x803a('0x14'),_0x1e13d1,_0x803a('0x15'));logger[_0x803a('0x16')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1e13d1,_0x803a('0x15'),JSON[_0x803a('0x17')](_0x40737c));if(_0x40737c[_0x803a('0x18')]){if(_0x40737c[_0x803a('0x18')][_0x803a('0x19')]===0x1f4){logger[_0x803a('0x18')](_0x803a('0x14'),_0x1e13d1,_0x40737c[_0x803a('0x18')]['message']);return _0x2d69d8(_0x40737c[_0x803a('0x18')]['message']);}logger[_0x803a('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e13d1,_0x40737c[_0x803a('0x18')][_0x803a('0x1a')]);return _0x502307(_0x40737c[_0x803a('0x18')][_0x803a('0x1a')]);}else{logger[_0x803a('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e13d1,_0x803a('0x15'));_0x502307(_0x40737c['result'][_0x803a('0x1a')]);}})[_0x803a('0x1b')](function(_0x36d2d9){logger['error'](_0x803a('0x14'),_0x1e13d1,_0x36d2d9);_0x2d69d8(_0x36d2d9);});});}exports[_0x803a('0x1c')]=function(_0x339997){var _0x4a4c05=this;return new Promise(function(_0x58c597,_0x5329a1){return db[_0x803a('0x1d')][_0x803a('0x1e')](_0x339997['body'],{'raw':_0x339997[_0x803a('0x1f')]?_0x339997['options'][_0x803a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339997[_0x803a('0x1f')]?_0x339997['options'][_0x803a('0x21')]||null:null,'attributes':_0x339997[_0x803a('0x1f')]?_0x339997[_0x803a('0x1f')][_0x803a('0x22')]||null:null,'limit':_0x339997[_0x803a('0x1f')]?_0x339997[_0x803a('0x1f')][_0x803a('0x23')]||null:null})['then'](function(_0x2dfcb0){logger['info'](_0x803a('0x1c'),_0x339997);logger[_0x803a('0x16')](_0x803a('0x1c'),_0x339997,JSON['stringify'](_0x2dfcb0));_0x58c597(_0x2dfcb0);})[_0x803a('0x1b')](function(_0x11d97f){logger[_0x803a('0x18')](_0x803a('0x1c'),_0x11d97f[_0x803a('0x1a')],_0x339997);_0x5329a1(_0x4a4c05[_0x803a('0x18')](0x1f4,_0x11d97f['message']));});});};exports[_0x803a('0x24')]=function(_0x4c65e5){return new Promise(function(_0x177c3a,_0x562a84){return db['OpenchannelInteraction'][_0x803a('0x25')]({'where':_0x4c65e5[_0x803a('0x1f')]?_0x4c65e5[_0x803a('0x1f')][_0x803a('0x21')]||null:null})[_0x803a('0x12')](function(_0xff9df6){if(_0xff9df6){return _0xff9df6['addTags'](_0x4c65e5[_0x803a('0x26')]['ids'],_['omit'](_0x4c65e5['body'],['ids','id'])||{});}})['spread'](function(_0x145691){logger[_0x803a('0x13')](_0x803a('0x27'),_0x4c65e5);logger[_0x803a('0x16')](_0x803a('0x27'),_0x4c65e5,JSON[_0x803a('0x17')](_0x145691));_0x177c3a(_0x145691);})[_0x803a('0x1b')](function(_0x46b03b){logger['error'](_0x803a('0x27'),_0x46b03b[_0x803a('0x1a')],_0x4c65e5);_0x562a84(_this[_0x803a('0x18')](0x1f4,_0x46b03b[_0x803a('0x1a')]));});});};
\ No newline at end of file
index 7e962e7..614f1b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x961c=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','emit'];(function(_0x4706f1,_0x1c2484){var _0x2b70be=function(_0x4373a3){while(--_0x4373a3){_0x4706f1['push'](_0x4706f1['shift']());}};_0x2b70be(++_0x1c2484);}(_0x961c,0x93));var _0xc961=function(_0x2ee5eb,_0x394c49){_0x2ee5eb=_0x2ee5eb-0x0;var _0x18e299=_0x961c[_0x2ee5eb];return _0x18e299;};'use strict';var OpenchannelInteractionEvents=require(_0xc961('0x0'));var events=[_0xc961('0x1'),_0xc961('0x2'),_0xc961('0x3')];function createListener(_0x59ce11,_0x40bef1){return function(_0x5bfec9){_0x40bef1[_0xc961('0x4')](_0x59ce11,_0x5bfec9);};}function removeListener(_0x3868f5,_0x563372){return function(){OpenchannelInteractionEvents[_0xc961('0x5')](_0x3868f5,_0x563372);};}exports[_0xc961('0x6')]=function(_0x533900){for(var _0x332024=0x0,_0x3d732f=events['length'];_0x332024<_0x3d732f;_0x332024++){var _0x420169=events[_0x332024];var _0x21ab13=createListener(_0xc961('0x7')+_0x420169,_0x533900);OpenchannelInteractionEvents['on'](_0x420169,_0x21ab13);}};
\ No newline at end of file
+var _0xa942=['openchannelInteraction:','save','update','register','length'];(function(_0x51e080,_0x1e2060){var _0x2b7b55=function(_0x9d7c7d){while(--_0x9d7c7d){_0x51e080['push'](_0x51e080['shift']());}};_0x2b7b55(++_0x1e2060);}(_0xa942,0x16e));var _0x2a94=function(_0x282a57,_0x108cf8){_0x282a57=_0x282a57-0x0;var _0x5a5b45=_0xa942[_0x282a57];return _0x5a5b45;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x2a94('0x0'),'remove',_0x2a94('0x1')];function createListener(_0x9bcb3b,_0x1e09b4){return function(_0x3f2c4c){_0x1e09b4['emit'](_0x9bcb3b,_0x3f2c4c);};}function removeListener(_0x262a6c,_0xa908dc){return function(){OpenchannelInteractionEvents['removeListener'](_0x262a6c,_0xa908dc);};}exports[_0x2a94('0x2')]=function(_0x4b5740){for(var _0x38c075=0x0,_0x484158=events[_0x2a94('0x3')];_0x38c075<_0x484158;_0x38c075++){var _0xdec33f=events[_0x38c075];var _0xc700c7=createListener(_0x2a94('0x4')+_0xdec33f,_0x4b5740);OpenchannelInteractionEvents['on'](_0xdec33f,_0xc700c7);}};
\ No newline at end of file
index f912e50..fd85fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x4ce479,_0x116f2a){var _0x38bb9d=function(_0x50ddf4){while(--_0x50ddf4){_0x4ce479['push'](_0x4ce479['shift']());}};_0x38bb9d(++_0x116f2a);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
+var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x522e29,_0x51404d){var _0x193bc6=function(_0x1de668){while(--_0x1de668){_0x522e29['push'](_0x522e29['shift']());}};_0x193bc6(++_0x51404d);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router;
\ No newline at end of file
index 659f948..a8bd1de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ac=['exports','medium','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0xb21667,_0x4c19b2){var _0x3534b9=function(_0x10963a){while(--_0x10963a){_0xb21667['push'](_0xb21667['shift']());}};_0x3534b9(++_0x4c19b2);}(_0x48ac,0xe0));var _0xc48a=function(_0x20713e,_0x70589a){_0x20713e=_0x20713e-0x0;var _0x1c76a4=_0x48ac[_0x20713e];return _0x1c76a4;};'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 _0xe5fb=['medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe5fb,0xce));var _0xbe5f=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xe5fb[_0x95411e];return _0x2c8718;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbe5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe5f('0x4')),'defaultValue':_0xbe5f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe5f('0x5')]},'providerName':{'type':Sequelize[_0xbe5f('0x6')]},'providerResponse':{'type':Sequelize[_0xbe5f('0x7')]}};
\ No newline at end of file
index c8d65f7..9e02845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c0=['count','set','apply','reject','save','update','then','destroy','stack','name','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','openchannel-interactions','accept','read','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','interface','format','SIP/%s','channel','event','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x43d32b,_0x57d779){var _0x5457ac=function(_0x4dc00e){while(--_0x4dc00e){_0x43d32b['push'](_0x43d32b['shift']());}};_0x5457ac(++_0x57d779);}(_0xa5c0,0xd1));var _0x0a5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5c0[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0a5c('0x0'));var rimraf=require(_0x0a5c('0x1'));var zipdir=require(_0x0a5c('0x2'));var jsonpatch=require(_0x0a5c('0x3'));var rp=require(_0x0a5c('0x4'));var moment=require('moment');var BPromise=require(_0x0a5c('0x5'));var Mustache=require(_0x0a5c('0x6'));var util=require(_0x0a5c('0x7'));var path=require('path');var sox=require(_0x0a5c('0x8'));var csv=require(_0x0a5c('0x9'));var ejs=require(_0x0a5c('0xa'));var fs=require('fs');var fs_extra=require(_0x0a5c('0xb'));var _=require(_0x0a5c('0xc'));var squel=require('squel');var crypto=require(_0x0a5c('0xd'));var jsforce=require(_0x0a5c('0xe'));var deskjs=require(_0x0a5c('0xf'));var toCsv=require(_0x0a5c('0x9'));var querystring=require(_0x0a5c('0x10'));var Papa=require(_0x0a5c('0x11'));var Redis=require(_0x0a5c('0x12'));var authService=require(_0x0a5c('0x13'));var qs=require(_0x0a5c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a5c('0x15'));var logger=require(_0x0a5c('0x16'))(_0x0a5c('0x17'));var utils=require(_0x0a5c('0x18'));var config=require(_0x0a5c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a5c('0x1a'))['db'];config[_0x0a5c('0x1b')]=_[_0x0a5c('0x1c')](config[_0x0a5c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a5c('0x1d'))(new Redis(config[_0x0a5c('0x1b')]));require(_0x0a5c('0x1e'))[_0x0a5c('0x1f')](socket);var jayson=require(_0x0a5c('0x20'));var client=jayson['client'][_0x0a5c('0x21')]({'port':0x232c});var client9002=jayson[_0x0a5c('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36ea8b,_0x3a3f82,_0x483ef3,_0xb8436){return new BPromise(function(_0x133fe8,_0x34f5dd){var _0x3f7ed7=_0xb8436||client;return _0x3f7ed7[_0x0a5c('0x23')](_0x36ea8b,_0x483ef3)['then'](function(_0x52aa42){logger[_0x0a5c('0x24')](_0x0a5c('0x25'),_0x3a3f82,_0x0a5c('0x26'));logger[_0x0a5c('0x27')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3a3f82,'request\x20sent',JSON[_0x0a5c('0x28')](_0x52aa42));if(_0x52aa42[_0x0a5c('0x29')]){if(_0x52aa42[_0x0a5c('0x29')][_0x0a5c('0x2a')]===0x1f4){logger[_0x0a5c('0x29')](_0x0a5c('0x25'),_0x3a3f82,_0x52aa42['error'][_0x0a5c('0x2b')]);return _0x34f5dd(_0x52aa42[_0x0a5c('0x29')][_0x0a5c('0x2b')]);}logger[_0x0a5c('0x29')](_0x0a5c('0x25'),_0x3a3f82,_0x52aa42[_0x0a5c('0x29')]['message']);return _0x133fe8(_0x52aa42[_0x0a5c('0x29')]['message']);}else{logger[_0x0a5c('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3a3f82,_0x0a5c('0x26'));_0x133fe8(_0x52aa42['result'][_0x0a5c('0x2b')]);}})['catch'](function(_0x48f7e7){logger[_0x0a5c('0x29')](_0x0a5c('0x25'),_0x3a3f82,_0x48f7e7);_0x34f5dd(_0x48f7e7);});});}function respondWithStatusCode(_0x199288,_0x2d0474){_0x2d0474=_0x2d0474||0xcc;return function(_0x75cad0){if(_0x75cad0){return _0x199288[_0x0a5c('0x2c')](_0x2d0474);}return _0x199288['status'](_0x2d0474)[_0x0a5c('0x2d')]();};}function respondWithResult(_0x3fab0c,_0x8a044b){_0x8a044b=_0x8a044b||0xc8;return function(_0x121a5c){if(_0x121a5c){return _0x3fab0c[_0x0a5c('0x2e')](_0x8a044b)[_0x0a5c('0x2f')](_0x121a5c);}};}function respondWithFilteredResult(_0x3a6e8f,_0x3f9a45){return function(_0x3ef2df){if(_0x3ef2df){var _0x322538=typeof _0x3f9a45[_0x0a5c('0x30')]===_0x0a5c('0x31')&&typeof _0x3f9a45[_0x0a5c('0x32')]===_0x0a5c('0x31');var _0xecec=_0x3ef2df['count'];var _0x496d3f=_0x322538?0x0:_0x3f9a45['offset'];var _0xfb080b=_0x322538?_0x3ef2df[_0x0a5c('0x33')]:_0x3f9a45[_0x0a5c('0x30')]+_0x3f9a45[_0x0a5c('0x32')];var _0x490d79;if(_0xfb080b>=_0xecec){_0xfb080b=_0xecec;_0x490d79=0xc8;}else{_0x490d79=0xce;}_0x3a6e8f['status'](_0x490d79);return _0x3a6e8f[_0x0a5c('0x34')]('Content-Range',_0x496d3f+'-'+_0xfb080b+'/'+_0xecec)['json'](_0x3ef2df);}return null;};}function patchUpdates(_0xc7fc16){return function(_0x1b056){try{jsonpatch[_0x0a5c('0x35')](_0x1b056,_0xc7fc16,!![]);}catch(_0x55996e){return BPromise[_0x0a5c('0x36')](_0x55996e);}return _0x1b056[_0x0a5c('0x37')]();};}function saveUpdates(_0x38bfce,_0x234b83){return function(_0x47945f){if(_0x47945f){return _0x47945f[_0x0a5c('0x38')](_0x38bfce)[_0x0a5c('0x39')](function(_0x29e094){return _0x29e094;});}return null;};}function removeEntity(_0x2405a7,_0x4047ac){return function(_0x444038){if(_0x444038){return _0x444038[_0x0a5c('0x3a')]()['then'](function(){_0x2405a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a43ad,_0x147520){return function(_0x1aa4ed){if(!_0x1aa4ed){_0x3a43ad[_0x0a5c('0x2c')](0x194);}return _0x1aa4ed;};}function handleError(_0x4ecb73,_0x4bb424){_0x4bb424=_0x4bb424||0x1f4;return function(_0xb22a7e){logger[_0x0a5c('0x29')](_0xb22a7e[_0x0a5c('0x3b')]);if(_0xb22a7e[_0x0a5c('0x3c')]){delete _0xb22a7e[_0x0a5c('0x3c')];}_0x4ecb73[_0x0a5c('0x2e')](_0x4bb424)['send'](_0xb22a7e);};}exports['index']=function(_0x1be4aa,_0x38dde2){var _0x9b6c1d={},_0x4b89f1={},_0x560a03={'count':0x0,'rows':[]};var _0x543aff=_['map'](db[_0x0a5c('0x3d')][_0x0a5c('0x3e')],function(_0x2db856){return{'name':_0x2db856[_0x0a5c('0x3f')],'type':_0x2db856[_0x0a5c('0x40')][_0x0a5c('0x41')]};});_0x4b89f1[_0x0a5c('0x42')]=_['map'](_0x543aff,_0x0a5c('0x3c'));_0x4b89f1[_0x0a5c('0x43')]=_['keys'](_0x1be4aa['query']);_0x4b89f1[_0x0a5c('0x44')]=_[_0x0a5c('0x45')](_0x4b89f1['model'],_0x4b89f1['query']);_0x9b6c1d[_0x0a5c('0x46')]=_[_0x0a5c('0x45')](_0x4b89f1[_0x0a5c('0x42')],qs[_0x0a5c('0x47')](_0x1be4aa[_0x0a5c('0x43')][_0x0a5c('0x47')]));_0x9b6c1d[_0x0a5c('0x46')]=_0x9b6c1d[_0x0a5c('0x46')][_0x0a5c('0x48')]?_0x9b6c1d[_0x0a5c('0x46')]:_0x4b89f1['model'];if(!_0x1be4aa['query'][_0x0a5c('0x49')](_0x0a5c('0x4a'))){_0x9b6c1d[_0x0a5c('0x32')]=qs[_0x0a5c('0x32')](_0x1be4aa['query']['limit']);_0x9b6c1d['offset']=qs[_0x0a5c('0x30')](_0x1be4aa[_0x0a5c('0x43')][_0x0a5c('0x30')]);}_0x9b6c1d[_0x0a5c('0x4b')]=qs[_0x0a5c('0x4c')](_0x1be4aa['query'][_0x0a5c('0x4c')]);_0x9b6c1d['where']=qs[_0x0a5c('0x44')](_[_0x0a5c('0x4d')](_0x1be4aa[_0x0a5c('0x43')],_0x4b89f1[_0x0a5c('0x44')]),_0x543aff);if(_0x1be4aa[_0x0a5c('0x43')][_0x0a5c('0x4e')]){_0x9b6c1d[_0x0a5c('0x4f')]=_[_0x0a5c('0x50')](_0x9b6c1d[_0x0a5c('0x4f')],{'$or':_[_0x0a5c('0x51')](_0x543aff,function(_0x287cbc){if(_0x287cbc[_0x0a5c('0x40')]!==_0x0a5c('0x52')){var _0x223f98={};_0x223f98[_0x287cbc[_0x0a5c('0x3c')]]={'$like':'%'+_0x1be4aa[_0x0a5c('0x43')]['filter']+'%'};return _0x223f98;}})});}_0x9b6c1d=_['merge']({},_0x9b6c1d,_0x1be4aa[_0x0a5c('0x53')]);var _0x54bf74={'where':_0x9b6c1d['where']};return db[_0x0a5c('0x3d')][_0x0a5c('0x33')](_0x54bf74)[_0x0a5c('0x39')](function(_0x75dc35){_0x560a03[_0x0a5c('0x33')]=_0x75dc35;if(_0x1be4aa['query'][_0x0a5c('0x54')]){_0x9b6c1d[_0x0a5c('0x55')]=[{'all':!![]}];}return db[_0x0a5c('0x3d')][_0x0a5c('0x56')](_0x9b6c1d);})['then'](function(_0xaca636){_0x560a03[_0x0a5c('0x57')]=_0xaca636;return _0x560a03;})['then'](respondWithFilteredResult(_0x38dde2,_0x9b6c1d))[_0x0a5c('0x58')](handleError(_0x38dde2,null));};exports[_0x0a5c('0x59')]=function(_0x184e24,_0x22102e){var _0x16f24e={'raw':!![],'where':{'id':_0x184e24[_0x0a5c('0x5a')]['id']}},_0x2d7324={};_0x2d7324[_0x0a5c('0x42')]=_['keys'](db[_0x0a5c('0x3d')]['rawAttributes']);_0x2d7324[_0x0a5c('0x43')]=_['keys'](_0x184e24['query']);_0x2d7324['filters']=_['intersection'](_0x2d7324[_0x0a5c('0x42')],_0x2d7324[_0x0a5c('0x43')]);_0x16f24e[_0x0a5c('0x46')]=_[_0x0a5c('0x45')](_0x2d7324['model'],qs['fields'](_0x184e24[_0x0a5c('0x43')]['fields']));_0x16f24e[_0x0a5c('0x46')]=_0x16f24e[_0x0a5c('0x46')][_0x0a5c('0x48')]?_0x16f24e[_0x0a5c('0x46')]:_0x2d7324[_0x0a5c('0x42')];if(_0x184e24[_0x0a5c('0x43')][_0x0a5c('0x54')]){_0x16f24e['include']=[{'all':!![]}];}_0x16f24e=_[_0x0a5c('0x50')]({},_0x16f24e,_0x184e24[_0x0a5c('0x53')]);return db['OpenchannelMessage'][_0x0a5c('0x5b')](_0x16f24e)['then'](handleEntityNotFound(_0x22102e,null))[_0x0a5c('0x39')](respondWithResult(_0x22102e,null))[_0x0a5c('0x58')](handleError(_0x22102e,null));};exports[_0x0a5c('0x5c')]=function(_0x13b7db,_0x111411){return db[_0x0a5c('0x3d')][_0x0a5c('0x5c')](_0x13b7db[_0x0a5c('0x5d')],{})[_0x0a5c('0x39')](respondWithResult(_0x111411,0xc9))[_0x0a5c('0x58')](handleError(_0x111411,null));};exports['update']=function(_0x152017,_0x4c3fba){if(_0x152017['body']['id']){delete _0x152017['body']['id'];}return db[_0x0a5c('0x3d')][_0x0a5c('0x5b')]({'where':{'id':_0x152017[_0x0a5c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c3fba,null))[_0x0a5c('0x39')](saveUpdates(_0x152017['body'],null))[_0x0a5c('0x39')](respondWithResult(_0x4c3fba,null))[_0x0a5c('0x58')](handleError(_0x4c3fba,null));};exports['destroy']=function(_0x21dbb9,_0x555d87){return db['OpenchannelMessage'][_0x0a5c('0x5b')]({'where':{'id':_0x21dbb9['params']['id']}})[_0x0a5c('0x39')](handleEntityNotFound(_0x555d87,null))[_0x0a5c('0x39')](removeEntity(_0x555d87,null))['catch'](handleError(_0x555d87,null));};exports[_0x0a5c('0x5e')]=function(_0x459099,_0x2e9b5f){return db[_0x0a5c('0x3d')]['describe']()[_0x0a5c('0x39')](respondWithResult(_0x2e9b5f,null))['catch'](handleError(_0x2e9b5f,null));};var interaction_log=require(_0x0a5c('0x16'))(_0x0a5c('0x5f'));exports[_0x0a5c('0x60')]=function(_0x5be486,_0x2fb7cf,_0x43b732){var _0x59fa23={'agent':{},'channel':'openchannel'};if(_0x5be486[_0x0a5c('0x5d')]['id']){delete _0x5be486['body']['id'];}_0x5be486[_0x0a5c('0x5d')][_0x0a5c('0x61')]=!![];_0x5be486['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5be486['body'][_0x0a5c('0x62')]=_0x5be486[_0x0a5c('0x5d')][_0x0a5c('0x62')]||_0x5be486['user']['id'];_0x59fa23[_0x0a5c('0x63')]['id']=_0x5be486[_0x0a5c('0x5d')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x5be486[_0x0a5c('0x5a')]['id'],'UserId':null}})[_0x0a5c('0x39')](handleEntityNotFound(_0x2fb7cf,null))[_0x0a5c('0x39')](saveUpdates(_0x5be486['body'],null))[_0x0a5c('0x39')](function(_0x575554){if(_0x575554){_0x59fa23[_0x0a5c('0x2b')]=_0x575554[_0x0a5c('0x64')]({'plain':!![]});return db[_0x0a5c('0x65')][_0x0a5c('0x5b')]({'where':{'id':_0x575554[_0x0a5c('0x66')]}});}return null;})[_0x0a5c('0x39')](handleEntityNotFound(_0x2fb7cf,null))[_0x0a5c('0x39')](function(_0x2ae2c1){if(_0x2ae2c1){return _0x2ae2c1[_0x0a5c('0x38')]({'UserId':_0x5be486['body'][_0x0a5c('0x62')],'read1stAt':_['isNil'](_0x2ae2c1[_0x0a5c('0x67')])?moment()['format'](_0x0a5c('0x68')):undefined});}return null;})[_0x0a5c('0x39')](function(_0x3270d8){if(_0x3270d8){_0x59fa23['interaction']=_0x3270d8[_0x0a5c('0x64')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5be486[_0x0a5c('0x69')]['id'],_0x5be486[_0x0a5c('0x69')][_0x0a5c('0x3c')],_0x5be486[_0x0a5c('0x69')][_0x0a5c('0x6a')],_0x59fa23[_0x0a5c('0x6b')]['id'],_0x5be486['body']?JSON[_0x0a5c('0x28')](_0x5be486[_0x0a5c('0x5d')]):'null');return respondWithRpcPromise(_0x0a5c('0x6c'),_0x0a5c('0x6d'),_0x59fa23);}return null;})[_0x0a5c('0x39')](function(_0x4fd6dd){var _0x374309=_0x0a5c('0x6e')+_0x4fd6dd[_0x0a5c('0x2b')][_0x0a5c('0x6f')];return db[_0x0a5c('0x70')][_0x0a5c('0x43')](_0x374309,{'type':db[_0x0a5c('0x71')][_0x0a5c('0x72')][_0x0a5c('0x73')],'raw':!![]})[_0x0a5c('0x39')](function(_0x3ebc0d){return _0x3ebc0d;});})['then'](function(_0xaa6559){if(_0xaa6559){_0x59fa23[_0x0a5c('0x2b')][_0x0a5c('0x74')]=_0xaa6559[0x0];if(!_0x5be486['body'][_0x0a5c('0x62')])return;return db[_0x0a5c('0x75')][_0x0a5c('0x5b')]({'where':{'id':_0x5be486[_0x0a5c('0x5d')][_0x0a5c('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0x0a5c('0x76'),'internal'],'raw':!![]});}return null;})[_0x0a5c('0x39')](function(_0x212638){if(!_0x212638)return null;_0x59fa23[_0x0a5c('0x2b')][_0x0a5c('0x63')]=_0x212638;return _0x59fa23;})[_0x0a5c('0x39')](function(_0x1d29c5){if(_0x1d29c5){if(_0x5be486[_0x0a5c('0x5d')]['manual']){_0x59fa23[_0x0a5c('0x2b')][_0x0a5c('0x77')]=util[_0x0a5c('0x78')](_0x0a5c('0x79'),_0x5be486[_0x0a5c('0x69')]['name']);_0x59fa23[_0x0a5c('0x2b')][_0x0a5c('0x7a')]=_0x59fa23[_0x0a5c('0x7a')];_0x59fa23[_0x0a5c('0x2b')][_0x0a5c('0x7b')]=_0x0a5c('0x60');return respondWithRpcPromise('EventManager',_0x0a5c('0x7c'),{'event':_0x0a5c('0x7d'),'message':_0x59fa23[_0x0a5c('0x2b')]},client9002)['then'](function(){return _0x59fa23;});}return _0x59fa23;}return null;})['then'](respondWithResult(_0x2fb7cf,null))[_0x0a5c('0x58')](handleError(_0x2fb7cf,null));};var interaction_log=require(_0x0a5c('0x16'))('openchannel-interactions');exports['reject']=function(_0x1db72c,_0x57ba91,_0xc732ed){var _0x872cb2={'agent':{},'channel':_0x0a5c('0x7e')};if(_0x1db72c[_0x0a5c('0x5d')]['id']){delete _0x1db72c[_0x0a5c('0x5d')]['id'];}_0x1db72c[_0x0a5c('0x5d')][_0x0a5c('0x62')]=_0x1db72c['body']['UserId']||_0x1db72c['user']['id'];_0x872cb2[_0x0a5c('0x63')]['id']=_0x1db72c[_0x0a5c('0x5d')][_0x0a5c('0x62')];return db[_0x0a5c('0x3d')][_0x0a5c('0x5b')]({'where':{'id':_0x1db72c[_0x0a5c('0x5a')]['id'],'UserId':null}})[_0x0a5c('0x39')](handleEntityNotFound(_0x57ba91,null))[_0x0a5c('0x39')](function(_0x20d88f){if(_0x20d88f){_0x872cb2[_0x0a5c('0x2b')]=_0x20d88f['get']({'plain':!![]});return db[_0x0a5c('0x65')]['find']({'where':{'id':_0x20d88f[_0x0a5c('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x57ba91,null))['then'](function(_0x3c43df){if(_0x3c43df){_0x872cb2[_0x0a5c('0x6b')]=_0x3c43df['get']({'plain':!![]});interaction_log[_0x0a5c('0x24')](_0x0a5c('0x7f'),_0x1db72c[_0x0a5c('0x69')]['id'],_0x1db72c[_0x0a5c('0x69')][_0x0a5c('0x3c')],_0x1db72c[_0x0a5c('0x69')]['role'],_0x872cb2[_0x0a5c('0x6b')]['id'],_0x1db72c[_0x0a5c('0x5d')]?JSON['stringify'](_0x1db72c[_0x0a5c('0x5d')]):'null');return respondWithRpcPromise(_0x0a5c('0x80'),_0x0a5c('0x81'),_0x872cb2);}return null;})[_0x0a5c('0x39')](function(_0x5773d3){var _0x318e15=_0x0a5c('0x6e')+_0x5773d3[_0x0a5c('0x2b')][_0x0a5c('0x6f')];return db['sequelize'][_0x0a5c('0x43')](_0x318e15,{'type':db['Sequelize']['QueryTypes'][_0x0a5c('0x73')],'raw':!![]})['then'](function(_0x567994){return _0x567994;});})[_0x0a5c('0x39')](function(_0x38de45){if(_0x38de45){_0x872cb2[_0x0a5c('0x2b')]['contact']=_0x38de45[0x0];if(!_0x1db72c[_0x0a5c('0x5d')][_0x0a5c('0x62')])return;return db[_0x0a5c('0x75')]['find']({'where':{'id':_0x1db72c[_0x0a5c('0x5d')]['UserId'],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0x0a5c('0x39')](function(_0x5db9b6){if(!_0x5db9b6)return null;_0x872cb2[_0x0a5c('0x2b')]['agent']=_0x5db9b6;return _0x872cb2;})[_0x0a5c('0x39')](function(_0x12e80a){if(_0x12e80a){_0x12e80a[_0x0a5c('0x2b')][_0x0a5c('0x77')]=util[_0x0a5c('0x78')](_0x0a5c('0x79'),_0x1db72c[_0x0a5c('0x69')]['name']);_0x12e80a[_0x0a5c('0x2b')][_0x0a5c('0x7a')]=_0x872cb2[_0x0a5c('0x7a')];_0x12e80a[_0x0a5c('0x2b')][_0x0a5c('0x7b')]=_0x0a5c('0x36');respondWithRpcPromise(_0x0a5c('0x7c'),_0x0a5c('0x7c'),{'event':'rejectmessage','message':_0x12e80a[_0x0a5c('0x2b')]},client9002);return _0x872cb2;}return null;})[_0x0a5c('0x39')](respondWithResult(_0x57ba91,null))['catch'](handleError(_0x57ba91,null));};
\ No newline at end of file
+var _0x6dda=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','sendStatus','stack','send','index','map','OpenchannelMessage','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','find','create','body','describe','openchannel-interactions','accept','read','readAt','format','UserId','agent','get','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','name','fullname','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','OpenchannelInteraction','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','User','rejectmessage','eml-format','rimraf','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6dda,0x17a));var _0xa6dd=function(_0x43de5c,_0x281ca7){_0x43de5c=_0x43de5c-0x0;var _0x37d72e=_0x6dda[_0x43de5c];return _0x37d72e;};'use strict';var emlformat=require(_0xa6dd('0x0'));var rimraf=require(_0xa6dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6dd('0x2'));var rp=require(_0xa6dd('0x3'));var moment=require(_0xa6dd('0x4'));var BPromise=require(_0xa6dd('0x5'));var Mustache=require(_0xa6dd('0x6'));var util=require(_0xa6dd('0x7'));var path=require(_0xa6dd('0x8'));var sox=require(_0xa6dd('0x9'));var csv=require(_0xa6dd('0xa'));var ejs=require(_0xa6dd('0xb'));var fs=require('fs');var fs_extra=require(_0xa6dd('0xc'));var _=require('lodash');var squel=require(_0xa6dd('0xd'));var crypto=require(_0xa6dd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa6dd('0xf'));var toCsv=require(_0xa6dd('0xa'));var querystring=require(_0xa6dd('0x10'));var Papa=require(_0xa6dd('0x11'));var Redis=require(_0xa6dd('0x12'));var authService=require(_0xa6dd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa6dd('0x14'));var hardwareService=require(_0xa6dd('0x15'));var logger=require(_0xa6dd('0x16'))(_0xa6dd('0x17'));var utils=require(_0xa6dd('0x18'));var config=require(_0xa6dd('0x19'));var licenseUtil=require(_0xa6dd('0x1a'));var db=require('../../mysqldb')['db'];config[_0xa6dd('0x1b')]=_[_0xa6dd('0x1c')](config[_0xa6dd('0x1b')],{'host':_0xa6dd('0x1d'),'port':0x18eb});var socket=require(_0xa6dd('0x1e'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0xa6dd('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa6dd('0x20')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb9c368,_0x4fe167,_0x2c24ca,_0x1defa8){return new BPromise(function(_0x452bb0,_0x4bae2f){var _0x2c1ea4=_0x1defa8||client;return _0x2c1ea4['request'](_0xb9c368,_0x2c24ca)['then'](function(_0x29002c){logger[_0xa6dd('0x21')](_0xa6dd('0x22'),_0x4fe167,_0xa6dd('0x23'));logger[_0xa6dd('0x24')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4fe167,_0xa6dd('0x23'),JSON[_0xa6dd('0x25')](_0x29002c));if(_0x29002c[_0xa6dd('0x26')]){if(_0x29002c[_0xa6dd('0x26')][_0xa6dd('0x27')]===0x1f4){logger[_0xa6dd('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x4fe167,_0x29002c[_0xa6dd('0x26')]['message']);return _0x4bae2f(_0x29002c[_0xa6dd('0x26')][_0xa6dd('0x28')]);}logger['error'](_0xa6dd('0x22'),_0x4fe167,_0x29002c['error'][_0xa6dd('0x28')]);return _0x452bb0(_0x29002c[_0xa6dd('0x26')][_0xa6dd('0x28')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x4fe167,_0xa6dd('0x23'));_0x452bb0(_0x29002c[_0xa6dd('0x29')][_0xa6dd('0x28')]);}})[_0xa6dd('0x2a')](function(_0x5d576e){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x4fe167,_0x5d576e);_0x4bae2f(_0x5d576e);});});}function respondWithStatusCode(_0x70c71,_0x379db9){_0x379db9=_0x379db9||0xcc;return function(_0x490baa){if(_0x490baa){return _0x70c71['sendStatus'](_0x379db9);}return _0x70c71['status'](_0x379db9)[_0xa6dd('0x2b')]();};}function respondWithResult(_0x26602d,_0x216b10){_0x216b10=_0x216b10||0xc8;return function(_0x17572c){if(_0x17572c){return _0x26602d[_0xa6dd('0x2c')](_0x216b10)[_0xa6dd('0x2d')](_0x17572c);}};}function respondWithFilteredResult(_0x15b3ac,_0x5e548b){return function(_0x1ac4fe){if(_0x1ac4fe){var _0xe2079a=typeof _0x5e548b[_0xa6dd('0x2e')]===_0xa6dd('0x2f')&&typeof _0x5e548b[_0xa6dd('0x30')]==='undefined';var _0x39e98f=_0x1ac4fe[_0xa6dd('0x31')];var _0x163805=_0xe2079a?0x0:_0x5e548b[_0xa6dd('0x2e')];var _0x24a881=_0xe2079a?_0x1ac4fe[_0xa6dd('0x31')]:_0x5e548b[_0xa6dd('0x2e')]+_0x5e548b[_0xa6dd('0x30')];var _0x260fc4;if(_0x24a881>=_0x39e98f){_0x24a881=_0x39e98f;_0x260fc4=0xc8;}else{_0x260fc4=0xce;}_0x15b3ac[_0xa6dd('0x2c')](_0x260fc4);return _0x15b3ac['set'](_0xa6dd('0x32'),_0x163805+'-'+_0x24a881+'/'+_0x39e98f)[_0xa6dd('0x2d')](_0x1ac4fe);}return null;};}function patchUpdates(_0x40b6de){return function(_0x17e73d){try{jsonpatch['apply'](_0x17e73d,_0x40b6de,!![]);}catch(_0x1c289f){return BPromise['reject'](_0x1c289f);}return _0x17e73d[_0xa6dd('0x33')]();};}function saveUpdates(_0x3cee85,_0x1fbc09){return function(_0x37f4b6){if(_0x37f4b6){return _0x37f4b6[_0xa6dd('0x34')](_0x3cee85)[_0xa6dd('0x35')](function(_0xa4f759){return _0xa4f759;});}return null;};}function removeEntity(_0xce263f,_0xc81437){return function(_0x38b9f0){if(_0x38b9f0){return _0x38b9f0[_0xa6dd('0x36')]()['then'](function(){_0xce263f[_0xa6dd('0x2c')](0xcc)[_0xa6dd('0x2b')]();});}};}function handleEntityNotFound(_0x5bcc79,_0x460c7e){return function(_0x3b04c1){if(!_0x3b04c1){_0x5bcc79[_0xa6dd('0x37')](0x194);}return _0x3b04c1;};}function handleError(_0x290e73,_0x46e7cf){_0x46e7cf=_0x46e7cf||0x1f4;return function(_0x1dd9f5){logger[_0xa6dd('0x26')](_0x1dd9f5[_0xa6dd('0x38')]);if(_0x1dd9f5['name']){delete _0x1dd9f5['name'];}_0x290e73[_0xa6dd('0x2c')](_0x46e7cf)[_0xa6dd('0x39')](_0x1dd9f5);};}exports[_0xa6dd('0x3a')]=function(_0x491a86,_0x58ae12){var _0x3a6304={},_0xa01580={},_0x9c72a7={'count':0x0,'rows':[]};var _0x5d93b6=_[_0xa6dd('0x3b')](db[_0xa6dd('0x3c')][_0xa6dd('0x3d')],function(_0x5d78e2){return{'name':_0x5d78e2['fieldName'],'type':_0x5d78e2['type'][_0xa6dd('0x3e')]};});_0xa01580[_0xa6dd('0x3f')]=_[_0xa6dd('0x3b')](_0x5d93b6,'name');_0xa01580['query']=_[_0xa6dd('0x40')](_0x491a86[_0xa6dd('0x41')]);_0xa01580['filters']=_[_0xa6dd('0x42')](_0xa01580[_0xa6dd('0x3f')],_0xa01580['query']);_0x3a6304[_0xa6dd('0x43')]=_[_0xa6dd('0x42')](_0xa01580[_0xa6dd('0x3f')],qs[_0xa6dd('0x44')](_0x491a86[_0xa6dd('0x41')][_0xa6dd('0x44')]));_0x3a6304['attributes']=_0x3a6304['attributes'][_0xa6dd('0x45')]?_0x3a6304[_0xa6dd('0x43')]:_0xa01580[_0xa6dd('0x3f')];if(!_0x491a86['query'][_0xa6dd('0x46')](_0xa6dd('0x47'))){_0x3a6304[_0xa6dd('0x30')]=qs[_0xa6dd('0x30')](_0x491a86[_0xa6dd('0x41')][_0xa6dd('0x30')]);_0x3a6304[_0xa6dd('0x2e')]=qs['offset'](_0x491a86['query'][_0xa6dd('0x2e')]);}_0x3a6304[_0xa6dd('0x48')]=qs['sort'](_0x491a86[_0xa6dd('0x41')]['sort']);_0x3a6304[_0xa6dd('0x49')]=qs[_0xa6dd('0x4a')](_[_0xa6dd('0x4b')](_0x491a86['query'],_0xa01580['filters']),_0x5d93b6);if(_0x491a86['query'][_0xa6dd('0x4c')]){_0x3a6304[_0xa6dd('0x49')]=_[_0xa6dd('0x4d')](_0x3a6304[_0xa6dd('0x49')],{'$or':_[_0xa6dd('0x3b')](_0x5d93b6,function(_0x10af5f){if(_0x10af5f[_0xa6dd('0x4e')]!==_0xa6dd('0x4f')){var _0x48a5aa={};_0x48a5aa[_0x10af5f['name']]={'$like':'%'+_0x491a86[_0xa6dd('0x41')][_0xa6dd('0x4c')]+'%'};return _0x48a5aa;}})});}_0x3a6304=_[_0xa6dd('0x4d')]({},_0x3a6304,_0x491a86[_0xa6dd('0x50')]);var _0x2d50fa={'where':_0x3a6304[_0xa6dd('0x49')]};return db[_0xa6dd('0x3c')][_0xa6dd('0x31')](_0x2d50fa)[_0xa6dd('0x35')](function(_0x42ff54){_0x9c72a7['count']=_0x42ff54;if(_0x491a86['query'][_0xa6dd('0x51')]){_0x3a6304[_0xa6dd('0x52')]=[{'all':!![]}];}return db[_0xa6dd('0x3c')][_0xa6dd('0x53')](_0x3a6304);})[_0xa6dd('0x35')](function(_0x1a064c){_0x9c72a7['rows']=_0x1a064c;return _0x9c72a7;})[_0xa6dd('0x35')](respondWithFilteredResult(_0x58ae12,_0x3a6304))[_0xa6dd('0x2a')](handleError(_0x58ae12,null));};exports['show']=function(_0xe5e4c1,_0xe32650){var _0x28cb97={'raw':!![],'where':{'id':_0xe5e4c1['params']['id']}},_0x9d1610={};_0x9d1610[_0xa6dd('0x3f')]=_[_0xa6dd('0x40')](db[_0xa6dd('0x3c')][_0xa6dd('0x3d')]);_0x9d1610[_0xa6dd('0x41')]=_[_0xa6dd('0x40')](_0xe5e4c1[_0xa6dd('0x41')]);_0x9d1610[_0xa6dd('0x4a')]=_[_0xa6dd('0x42')](_0x9d1610[_0xa6dd('0x3f')],_0x9d1610[_0xa6dd('0x41')]);_0x28cb97[_0xa6dd('0x43')]=_[_0xa6dd('0x42')](_0x9d1610[_0xa6dd('0x3f')],qs['fields'](_0xe5e4c1['query'][_0xa6dd('0x44')]));_0x28cb97[_0xa6dd('0x43')]=_0x28cb97[_0xa6dd('0x43')]['length']?_0x28cb97[_0xa6dd('0x43')]:_0x9d1610[_0xa6dd('0x3f')];if(_0xe5e4c1[_0xa6dd('0x41')][_0xa6dd('0x51')]){_0x28cb97[_0xa6dd('0x52')]=[{'all':!![]}];}_0x28cb97=_[_0xa6dd('0x4d')]({},_0x28cb97,_0xe5e4c1['options']);return db[_0xa6dd('0x3c')][_0xa6dd('0x54')](_0x28cb97)[_0xa6dd('0x35')](handleEntityNotFound(_0xe32650,null))['then'](respondWithResult(_0xe32650,null))[_0xa6dd('0x2a')](handleError(_0xe32650,null));};exports[_0xa6dd('0x55')]=function(_0x56e6c6,_0x584b1f){return db[_0xa6dd('0x3c')][_0xa6dd('0x55')](_0x56e6c6['body'],{})[_0xa6dd('0x35')](respondWithResult(_0x584b1f,0xc9))[_0xa6dd('0x2a')](handleError(_0x584b1f,null));};exports[_0xa6dd('0x34')]=function(_0x1e78b4,_0x21a18b){if(_0x1e78b4[_0xa6dd('0x56')]['id']){delete _0x1e78b4['body']['id'];}return db[_0xa6dd('0x3c')]['find']({'where':{'id':_0x1e78b4['params']['id']}})[_0xa6dd('0x35')](handleEntityNotFound(_0x21a18b,null))[_0xa6dd('0x35')](saveUpdates(_0x1e78b4[_0xa6dd('0x56')],null))[_0xa6dd('0x35')](respondWithResult(_0x21a18b,null))[_0xa6dd('0x2a')](handleError(_0x21a18b,null));};exports['destroy']=function(_0x138ad9,_0x3ce892){return db[_0xa6dd('0x3c')][_0xa6dd('0x54')]({'where':{'id':_0x138ad9['params']['id']}})['then'](handleEntityNotFound(_0x3ce892,null))[_0xa6dd('0x35')](removeEntity(_0x3ce892,null))[_0xa6dd('0x2a')](handleError(_0x3ce892,null));};exports[_0xa6dd('0x57')]=function(_0x3a9718,_0xf35e08){return db[_0xa6dd('0x3c')][_0xa6dd('0x57')]()[_0xa6dd('0x35')](respondWithResult(_0xf35e08,null))[_0xa6dd('0x2a')](handleError(_0xf35e08,null));};var interaction_log=require(_0xa6dd('0x16'))(_0xa6dd('0x58'));exports[_0xa6dd('0x59')]=function(_0x228bca,_0x49fc92,_0x19fa79){var _0x1b65d0={'agent':{},'channel':'openchannel'};if(_0x228bca[_0xa6dd('0x56')]['id']){delete _0x228bca['body']['id'];}_0x228bca[_0xa6dd('0x56')][_0xa6dd('0x5a')]=!![];_0x228bca[_0xa6dd('0x56')][_0xa6dd('0x5b')]=moment()[_0xa6dd('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x228bca[_0xa6dd('0x56')]['UserId']=_0x228bca[_0xa6dd('0x56')][_0xa6dd('0x5d')]||_0x228bca['user']['id'];_0x1b65d0[_0xa6dd('0x5e')]['id']=_0x228bca[_0xa6dd('0x56')][_0xa6dd('0x5d')];return db['OpenchannelMessage'][_0xa6dd('0x54')]({'where':{'id':_0x228bca['params']['id'],'UserId':null}})[_0xa6dd('0x35')](handleEntityNotFound(_0x49fc92,null))[_0xa6dd('0x35')](saveUpdates(_0x228bca[_0xa6dd('0x56')],null))['then'](function(_0x5e6f17){if(_0x5e6f17){_0x1b65d0[_0xa6dd('0x28')]=_0x5e6f17[_0xa6dd('0x5f')]({'plain':!![]});return db['OpenchannelInteraction'][_0xa6dd('0x54')]({'where':{'id':_0x5e6f17['OpenchannelInteractionId']}});}return null;})[_0xa6dd('0x35')](handleEntityNotFound(_0x49fc92,null))[_0xa6dd('0x35')](function(_0x3f70ff){if(_0x3f70ff){return _0x3f70ff[_0xa6dd('0x34')]({'UserId':_0x228bca[_0xa6dd('0x56')]['UserId'],'read1stAt':_['isNil'](_0x3f70ff[_0xa6dd('0x60')])?moment()['format'](_0xa6dd('0x61')):undefined});}return null;})[_0xa6dd('0x35')](function(_0x2f8516){if(_0x2f8516){_0x1b65d0[_0xa6dd('0x62')]=_0x2f8516[_0xa6dd('0x5f')]({'plain':!![]});interaction_log[_0xa6dd('0x21')](_0xa6dd('0x63'),_0x228bca[_0xa6dd('0x64')]['id'],_0x228bca['user']['name'],_0x228bca[_0xa6dd('0x64')][_0xa6dd('0x65')],_0x1b65d0[_0xa6dd('0x62')]['id'],_0x228bca[_0xa6dd('0x56')]?JSON[_0xa6dd('0x25')](_0x228bca[_0xa6dd('0x56')]):'null');return respondWithRpcPromise(_0xa6dd('0x66'),_0xa6dd('0x67'),_0x1b65d0);}return null;})[_0xa6dd('0x35')](function(_0x3a9e47){var _0x268626=_0xa6dd('0x68')+_0x3a9e47[_0xa6dd('0x28')][_0xa6dd('0x69')];return db[_0xa6dd('0x6a')][_0xa6dd('0x41')](_0x268626,{'type':db[_0xa6dd('0x6b')][_0xa6dd('0x6c')][_0xa6dd('0x6d')],'raw':!![]})['then'](function(_0x4b0f0f){return _0x4b0f0f;});})[_0xa6dd('0x35')](function(_0x2a3b31){if(_0x2a3b31){_0x1b65d0[_0xa6dd('0x28')][_0xa6dd('0x6e')]=_0x2a3b31[0x0];if(!_0x228bca[_0xa6dd('0x56')][_0xa6dd('0x5d')])return;return db['User'][_0xa6dd('0x54')]({'where':{'id':_0x228bca[_0xa6dd('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0xa6dd('0x6f'),_0xa6dd('0x70'),_0xa6dd('0x71'),'internal'],'raw':!![]});}return null;})[_0xa6dd('0x35')](function(_0x5eba40){if(!_0x5eba40)return null;_0x1b65d0[_0xa6dd('0x28')][_0xa6dd('0x5e')]=_0x5eba40;return _0x1b65d0;})[_0xa6dd('0x35')](function(_0x3363f7){if(_0x3363f7){if(_0x228bca[_0xa6dd('0x56')]['manual']){_0x1b65d0[_0xa6dd('0x28')][_0xa6dd('0x72')]=util['format'](_0xa6dd('0x73'),_0x228bca[_0xa6dd('0x64')]['name']);_0x1b65d0[_0xa6dd('0x28')][_0xa6dd('0x74')]=_0x1b65d0[_0xa6dd('0x74')];_0x1b65d0['message'][_0xa6dd('0x75')]=_0xa6dd('0x59');return respondWithRpcPromise(_0xa6dd('0x76'),_0xa6dd('0x76'),{'event':_0xa6dd('0x77'),'message':_0x1b65d0[_0xa6dd('0x28')]},client9002)[_0xa6dd('0x35')](function(){return _0x1b65d0;});}return _0x1b65d0;}return null;})[_0xa6dd('0x35')](respondWithResult(_0x49fc92,null))['catch'](handleError(_0x49fc92,null));};var interaction_log=require(_0xa6dd('0x16'))(_0xa6dd('0x58'));exports[_0xa6dd('0x78')]=function(_0x2c0bf4,_0x1ac582,_0x454911){var _0x1d4631={'agent':{},'channel':'openchannel'};if(_0x2c0bf4[_0xa6dd('0x56')]['id']){delete _0x2c0bf4[_0xa6dd('0x56')]['id'];}_0x2c0bf4[_0xa6dd('0x56')]['UserId']=_0x2c0bf4[_0xa6dd('0x56')][_0xa6dd('0x5d')]||_0x2c0bf4['user']['id'];_0x1d4631[_0xa6dd('0x5e')]['id']=_0x2c0bf4[_0xa6dd('0x56')][_0xa6dd('0x5d')];return db[_0xa6dd('0x3c')]['find']({'where':{'id':_0x2c0bf4['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ac582,null))[_0xa6dd('0x35')](function(_0x41f86f){if(_0x41f86f){_0x1d4631[_0xa6dd('0x28')]=_0x41f86f[_0xa6dd('0x5f')]({'plain':!![]});return db[_0xa6dd('0x79')][_0xa6dd('0x54')]({'where':{'id':_0x41f86f[_0xa6dd('0x7a')]}});}return null;})[_0xa6dd('0x35')](handleEntityNotFound(_0x1ac582,null))['then'](function(_0x593e72){if(_0x593e72){_0x1d4631[_0xa6dd('0x62')]=_0x593e72[_0xa6dd('0x5f')]({'plain':!![]});interaction_log['info'](_0xa6dd('0x7b'),_0x2c0bf4[_0xa6dd('0x64')]['id'],_0x2c0bf4[_0xa6dd('0x64')][_0xa6dd('0x6f')],_0x2c0bf4['user'][_0xa6dd('0x65')],_0x1d4631[_0xa6dd('0x62')]['id'],_0x2c0bf4['body']?JSON[_0xa6dd('0x25')](_0x2c0bf4['body']):'null');return respondWithRpcPromise(_0xa6dd('0x7c'),'rejectMessage',_0x1d4631);}return null;})[_0xa6dd('0x35')](function(_0x92753a){var _0x5d0375=_0xa6dd('0x68')+_0x92753a[_0xa6dd('0x28')][_0xa6dd('0x69')];return db['sequelize']['query'](_0x5d0375,{'type':db[_0xa6dd('0x6b')][_0xa6dd('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x38ee34){return _0x38ee34;});})[_0xa6dd('0x35')](function(_0xd1447f){if(_0xd1447f){_0x1d4631[_0xa6dd('0x28')]['contact']=_0xd1447f[0x0];if(!_0x2c0bf4[_0xa6dd('0x56')][_0xa6dd('0x5d')])return;return db[_0xa6dd('0x7d')][_0xa6dd('0x54')]({'where':{'id':_0x2c0bf4[_0xa6dd('0x56')][_0xa6dd('0x5d')],'role':_0xa6dd('0x5e')},'attributes':['id','name',_0xa6dd('0x70'),_0xa6dd('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x438bc8){if(!_0x438bc8)return null;_0x1d4631[_0xa6dd('0x28')]['agent']=_0x438bc8;return _0x1d4631;})[_0xa6dd('0x35')](function(_0xfd67d0){if(_0xfd67d0){_0xfd67d0[_0xa6dd('0x28')]['interface']=util['format'](_0xa6dd('0x73'),_0x2c0bf4['user'][_0xa6dd('0x6f')]);_0xfd67d0[_0xa6dd('0x28')][_0xa6dd('0x74')]=_0x1d4631[_0xa6dd('0x74')];_0xfd67d0['message'][_0xa6dd('0x75')]=_0xa6dd('0x78');respondWithRpcPromise('EventManager',_0xa6dd('0x76'),{'event':_0xa6dd('0x7e'),'message':_0xfd67d0['message']},client9002);return _0x1d4631;}return null;})[_0xa6dd('0x35')](respondWithResult(_0x1ac582,null))[_0xa6dd('0x2a')](handleError(_0x1ac582,null));};
\ No newline at end of file
index dde6a91..1ef56ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31ef=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x18aab8,_0x24449e){var _0x2ac087=function(_0x20cc30){while(--_0x20cc30){_0x18aab8['push'](_0x18aab8['shift']());}};_0x2ac087(++_0x24449e);}(_0x31ef,0x1d2));var _0xf31e=function(_0x262541,_0x381cd1){_0x262541=_0x262541-0x0;var _0x3b28b0=_0x31ef[_0x262541];return _0x3b28b0;};'use strict';var EventEmitter=require(_0xf31e('0x0'));var OpenchannelMessage=require(_0xf31e('0x1'))['db'][_0xf31e('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf31e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf31e('0x4'),'afterDestroy':_0xf31e('0x5')};function emitEvent(_0x51c152){return function(_0x5126b0,_0x29b41f,_0x2ccab8){OpenchannelMessageEvents['emit'](_0x51c152+':'+_0x5126b0['id'],_0x5126b0);OpenchannelMessageEvents[_0xf31e('0x6')](_0x51c152,_0x5126b0);_0x2ccab8(null);};}for(var e in events){if(events[_0xf31e('0x7')](e)){var event=events[e];OpenchannelMessage[_0xf31e('0x8')](e,emitEvent(event));}}module[_0xf31e('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x1d11=['events','../../mysqldb','save','update','emit','hook','exports'];(function(_0x2768e9,_0x2a50b2){var _0xb5cca0=function(_0x398432){while(--_0x398432){_0x2768e9['push'](_0x2768e9['shift']());}};_0xb5cca0(++_0x2a50b2);}(_0x1d11,0x173));var _0x11d1=function(_0x52d4ee,_0x64e207){_0x52d4ee=_0x52d4ee-0x0;var _0x51d053=_0x1d11[_0x52d4ee];return _0x51d053;};'use strict';var EventEmitter=require(_0x11d1('0x0'));var OpenchannelMessage=require(_0x11d1('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11d1('0x2'),'afterUpdate':_0x11d1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x28a75e){return function(_0x3284ac,_0x471cb6,_0x444221){OpenchannelMessageEvents[_0x11d1('0x4')](_0x28a75e+':'+_0x3284ac['id'],_0x3284ac);OpenchannelMessageEvents[_0x11d1('0x4')](_0x28a75e,_0x3284ac);_0x444221(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x11d1('0x5')](e,emitEvent(event));}}module[_0x11d1('0x6')]=OpenchannelMessageEvents;
\ No newline at end of file
index 9b95c66..03b38ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7708=['update','createdAt','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelMessage,\x20%s,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','api','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then'];(function(_0xd37b91,_0x49186f){var _0x84d8c7=function(_0x285457){while(--_0x285457){_0xd37b91['push'](_0xd37b91['shift']());}};_0x84d8c7(++_0x49186f);}(_0x7708,0x188));var _0x8770=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x7708[_0x587fb5];return _0x551105;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[{'name':_0x8770('0x9'),'fields':[_0x8770('0xa')],'type':_0x8770('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fc512,_0x396322,_0x2ca830){var _0x3f357a=_0x50bab7['models'];var _0x390af0=_0x4fc512[_0x8770('0xc')]({'plain':!![]});if(_0x390af0[_0x8770('0xd')][_0x8770('0xe')]()==='in'||_0x390af0['direction'][_0x8770('0xe')]()===_0x8770('0xf')&&!_0x390af0[_0x8770('0x10')]&&!_['isNil'](_0x390af0[_0x8770('0x11')])){_0x3f357a[_0x8770('0x12')][_0x8770('0x13')]({'where':{'id':_0x390af0[_0x8770('0x14')]}})[_0x8770('0x15')](function(_0x12a06f){if(_0x12a06f){_0x12a06f[_0x8770('0x16')]({'lastMsgAt':_0x390af0[_0x8770('0x17')],'lastMsgDirection':_0x390af0['direction'][_0x8770('0xe')]()});}})[_0x8770('0x18')](function(_0x5dd4e7){console[_0x8770('0x19')](_0x5dd4e7);});}if(_0x390af0['direction']===_0x8770('0xf')&&!_0x390af0['secret']){var _0x5b4716;_0x3f357a['CmContact'][_0x8770('0x1a')]()[_0x8770('0x15')](function(_0x17b634){return _0x3f357a[_0x8770('0x1b')]['find']({'where':{'id':_0x390af0['OpenchannelAccountId']},'include':[{'model':_0x3f357a[_0x8770('0x12')],'as':_0x8770('0x1c'),'where':{'id':_0x390af0[_0x8770('0x14')]},'limit':0x1,'include':[{'model':_0x3f357a[_0x8770('0x1d')],'as':_0x8770('0x1e'),'attributes':_['keys'](_0x17b634)}]}]});})[_0x8770('0x15')](function(_0x1234dd){_0x5b4716=_0x1234dd[_0x8770('0xc')]({'plain':!![]});if(_0x5b4716&&_0x5b4716[_0x8770('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x22'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0x5b4716[_0x8770('0x1c')]&&_0x5b4716[_0x8770('0x1c')]['length']){_0x390af0[_0x8770('0x23')]=_[_0x8770('0x24')](_0x5b4716[_0x8770('0x1c')][0x0],_0x8770('0x1e'));_0x390af0['Contact']=_0x5b4716[_0x8770('0x1c')][0x0]['Contact'];}var _0x396322={'method':_0x8770('0x25'),'uri':encodeURI(_0x5b4716[_0x8770('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x396322[_0x8770('0x26')]){case _0x8770('0x27'):_0x396322['qs']=_0x390af0;break;case _0x8770('0x25'):_0x396322[_0x8770('0xa')]=_0x390af0;break;}return rp(_0x396322)[_0x8770('0x15')](function(_0xb3f4aa){logger[_0x8770('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x29'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0xb3f4aa[_0x8770('0xa')][_0x8770('0x2a')]&&_0xb3f4aa['body']['threadId']!=_0x390af0[_0x8770('0x23')][_0x8770('0x2a')]){return _0x3f357a[_0x8770('0x12')][_0x8770('0x16')]({'threadId':_0xb3f4aa[_0x8770('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x390af0['Interaction']['id']}});}else{return;}})[_0x8770('0x15')](function(){return _0x4fc512[_0x8770('0x16')]({'read':!![]});})[_0x8770('0x18')](function(_0x2c2c77){logger['error'](_0x8770('0x2b'),'afterCreate',util['inspect'](_0x2c2c77,{'showHidden':![],'depth':null}));_0x2ca830();});}else{_0x2ca830();}})[_0x8770('0x2c')](function(){_0x2ca830();});}else{_0x2ca830();}}},'charset':'utf8mb4','collate':_0x8770('0x2d')});};
\ No newline at end of file
+var _0xda2d=['OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','out','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','replyUri','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','direction','toLowerCase','UserId'];(function(_0x48a0f3,_0x481985){var _0x2e8467=function(_0x4a2b9b){while(--_0x4a2b9b){_0x48a0f3['push'](_0x48a0f3['shift']());}};_0x2e8467(++_0x481985);}(_0xda2d,0x102));var _0xdda2=function(_0x232e24,_0x95937){_0x232e24=_0x232e24-0x0;var _0x21c824=_0xda2d[_0x232e24];return _0x21c824;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[{'name':_0xdda2('0xb'),'fields':[_0xdda2('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a774e,_0x22c6e5,_0x4df6b8){var _0x1c11b2=_0x39f6c9[_0xdda2('0xd')];var _0x42d990=_0x1a774e[_0xdda2('0xe')]({'plain':!![]});if(_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='in'||_0x42d990[_0xdda2('0xf')][_0xdda2('0x10')]()==='out'&&!_0x42d990['secret']&&!_['isNil'](_0x42d990[_0xdda2('0x11')])){_0x1c11b2[_0xdda2('0x12')][_0xdda2('0x13')]({'where':{'id':_0x42d990[_0xdda2('0x14')]}})[_0xdda2('0x15')](function(_0x475222){if(_0x475222){_0x475222[_0xdda2('0x16')]({'lastMsgAt':_0x42d990['createdAt'],'lastMsgDirection':_0x42d990[_0xdda2('0xf')]['toLowerCase']()});}})[_0xdda2('0x17')](function(_0xb6b01e){console[_0xdda2('0x18')](_0xb6b01e);});}if(_0x42d990[_0xdda2('0xf')]===_0xdda2('0x19')&&!_0x42d990['secret']){var _0x55d674;_0x1c11b2[_0xdda2('0x1a')]['describe']()[_0xdda2('0x15')](function(_0x1a3b35){return _0x1c11b2[_0xdda2('0x1b')][_0xdda2('0x1c')]({'where':{'id':_0x42d990[_0xdda2('0x1d')]},'include':[{'model':_0x1c11b2[_0xdda2('0x12')],'as':_0xdda2('0x1e'),'where':{'id':_0x42d990[_0xdda2('0x14')]},'limit':0x1,'include':[{'model':_0x1c11b2[_0xdda2('0x1a')],'as':_0xdda2('0x1f'),'attributes':_[_0xdda2('0x20')](_0x1a3b35)}]}]});})[_0xdda2('0x15')](function(_0x4eed30){_0x55d674=_0x4eed30[_0xdda2('0xe')]({'plain':!![]});if(_0x55d674&&_0x55d674['replyUri']){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util['format'](_0xdda2('0x24'),_0x42d990['id'],_0x55d674['replyUri']));if(_0x55d674[_0xdda2('0x1e')]&&_0x55d674[_0xdda2('0x1e')]['length']){_0x42d990[_0xdda2('0x25')]=_[_0xdda2('0x26')](_0x55d674[_0xdda2('0x1e')][0x0],_0xdda2('0x1f'));_0x42d990[_0xdda2('0x1f')]=_0x55d674['Interactions'][0x0][_0xdda2('0x1f')];}var _0x22c6e5={'method':_0xdda2('0x27'),'uri':encodeURI(_0x55d674[_0xdda2('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x22c6e5['method']){case'GET':_0x22c6e5['qs']=_0x42d990;break;case _0xdda2('0x27'):_0x22c6e5[_0xdda2('0xc')]=_0x42d990;break;}return rp(_0x22c6e5)[_0xdda2('0x15')](function(_0x5e9e74){logger[_0xdda2('0x21')](_0xdda2('0x22'),_0xdda2('0x23'),util[_0xdda2('0x29')](_0xdda2('0x2a'),_0x42d990['id'],_0x55d674[_0xdda2('0x28')]));if(_0x5e9e74['body'][_0xdda2('0x2b')]&&_0x5e9e74[_0xdda2('0xc')]['threadId']!=_0x42d990[_0xdda2('0x25')][_0xdda2('0x2b')]){return _0x1c11b2[_0xdda2('0x12')][_0xdda2('0x16')]({'threadId':_0x5e9e74['body'][_0xdda2('0x2b')]},{'logging':!![],'where':{'id':_0x42d990[_0xdda2('0x25')]['id']}});}else{return;}})['then'](function(){return _0x1a774e[_0xdda2('0x16')]({'read':!![]});})['catch'](function(_0x2b8cd6){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xdda2('0x2c')](_0x2b8cd6,{'showHidden':![],'depth':null}));_0x4df6b8();});}else{_0x4df6b8();}})['finally'](function(){_0x4df6b8();});}else{_0x4df6b8();}}},'charset':_0xdda2('0x2d'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index dd40fb4..9581bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x513c0e,_0x5322d7){var _0x2b7d9e=function(_0x3f09ce){while(--_0x3f09ce){_0x513c0e['push'](_0x513c0e['shift']());}};_0x2b7d9e(++_0x5322d7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x43ab40,_0x3abc12){_0x43ab40=_0x43ab40-0x0;var _0x43de5d=_0x5f2f[_0x43ab40];return _0x43de5d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});};
\ No newline at end of file
+var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x18bfd7,_0x9ecbac){var _0x282a2a=function(_0x15a1eb){while(--_0x15a1eb){_0x18bfd7['push'](_0x18bfd7['shift']());}};_0x282a2a(++_0x9ecbac);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});};
\ No newline at end of file
index aa91787..702c80f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35f5=['length','./openchannelMessage.events','remove','update','removeListener'];(function(_0x486562,_0x13eb52){var _0x35eeb9=function(_0x10f1fb){while(--_0x10f1fb){_0x486562['push'](_0x486562['shift']());}};_0x35eeb9(++_0x13eb52);}(_0x35f5,0x100));var _0x535f=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x35f5[_0xc0638b];return _0xd57dfa;};'use strict';var OpenchannelMessageEvents=require(_0x535f('0x0'));var events=['save',_0x535f('0x1'),_0x535f('0x2')];function createListener(_0x46e486,_0xba4dd7){return function(_0x4fd48a){_0xba4dd7['emit'](_0x46e486,_0x4fd48a);};}function removeListener(_0x5f4a18,_0x3a8b37){return function(){OpenchannelMessageEvents[_0x535f('0x3')](_0x5f4a18,_0x3a8b37);};}exports['register']=function(_0x6b403a){for(var _0x4f9d93=0x0,_0x24a137=events[_0x535f('0x4')];_0x4f9d93<_0x24a137;_0x4f9d93++){var _0x4b3440=events[_0x4f9d93];var _0x30802d=createListener('openchannelMessage:'+_0x4b3440,_0x6b403a);OpenchannelMessageEvents['on'](_0x4b3440,_0x30802d);}};
\ No newline at end of file
+var _0xe4d9=['emit','removeListener','register','./openchannelMessage.events','save','remove'];(function(_0x32c06b,_0x6256c7){var _0x2c5b7e=function(_0x10550c){while(--_0x10550c){_0x32c06b['push'](_0x32c06b['shift']());}};_0x2c5b7e(++_0x6256c7);}(_0xe4d9,0x141));var _0x9e4d=function(_0x5252b5,_0x30434b){_0x5252b5=_0x5252b5-0x0;var _0x3bc1e1=_0xe4d9[_0x5252b5];return _0x3bc1e1;};'use strict';var OpenchannelMessageEvents=require(_0x9e4d('0x0'));var events=[_0x9e4d('0x1'),_0x9e4d('0x2'),'update'];function createListener(_0x42b34c,_0x5856ea){return function(_0x5d50b0){_0x5856ea[_0x9e4d('0x3')](_0x42b34c,_0x5d50b0);};}function removeListener(_0x228328,_0x581985){return function(){OpenchannelMessageEvents[_0x9e4d('0x4')](_0x228328,_0x581985);};}exports[_0x9e4d('0x5')]=function(_0x5a4881){for(var _0x493fb5=0x0,_0x74b14=events['length'];_0x493fb5<_0x74b14;_0x493fb5++){var _0x5af2a0=events[_0x493fb5];var _0x36ec30=createListener('openchannelMessage:'+_0x5af2a0,_0x5a4881);OpenchannelMessageEvents['on'](_0x5af2a0,_0x36ec30);}};
\ No newline at end of file
index f589cad..cb5d426 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeb2=['./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2ccafd,_0x5e05e1){var _0x5461f0=function(_0x345292){while(--_0x345292){_0x2ccafd['push'](_0x2ccafd['shift']());}};_0x5461f0(++_0x5e05e1);}(_0xbeb2,0x1de));var _0x2beb=function(_0x13d82d,_0x33d75f){_0x13d82d=_0x13d82d-0x0;var _0x239dd0=_0xbeb2[_0x13d82d];return _0x239dd0;};'use strict';var multer=require(_0x2beb('0x0'));var util=require(_0x2beb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2beb('0x2'));var router=express[_0x2beb('0x3')]();var fs_extra=require(_0x2beb('0x4'));var auth=require(_0x2beb('0x5'));var interaction=require(_0x2beb('0x6'));var config=require(_0x2beb('0x7'));var controller=require(_0x2beb('0x8'));router[_0x2beb('0x9')]('/',auth[_0x2beb('0xa')](),controller[_0x2beb('0xb')]);router[_0x2beb('0x9')](_0x2beb('0xc'),auth[_0x2beb('0xa')](),controller['describe']);router[_0x2beb('0x9')](_0x2beb('0xd'),auth['isAuthenticated'](),controller[_0x2beb('0xe')]);router[_0x2beb('0x9')]('/:id/members',auth[_0x2beb('0xa')](),controller['getMembers']);router[_0x2beb('0x9')](_0x2beb('0xf'),auth['isAuthenticated'](),controller['getTeams']);router[_0x2beb('0x9')](_0x2beb('0x10'),auth[_0x2beb('0xa')](),controller[_0x2beb('0x11')]);router[_0x2beb('0x12')]('/',auth[_0x2beb('0xa')](),controller['create']);router['post'](_0x2beb('0xf'),auth[_0x2beb('0xa')](),controller[_0x2beb('0x13')]);router[_0x2beb('0x12')](_0x2beb('0x10'),auth['isAuthenticated'](),controller[_0x2beb('0x14')]);router[_0x2beb('0x15')](_0x2beb('0xd'),auth[_0x2beb('0xa')](),controller[_0x2beb('0x16')]);router[_0x2beb('0x17')](_0x2beb('0xd'),auth[_0x2beb('0xa')](),controller[_0x2beb('0x18')]);router[_0x2beb('0x17')](_0x2beb('0xf'),auth['isAuthenticated'](),controller[_0x2beb('0x19')]);router[_0x2beb('0x17')]('/:id/users',auth[_0x2beb('0xa')](),controller[_0x2beb('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x0168=['connect-timeout','Router','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','addAgents','/:id','update','delete','removeTeams','removeAgents','multer','path'];(function(_0x265de8,_0x1e526a){var _0x42dbf5=function(_0x48a1a5){while(--_0x48a1a5){_0x265de8['push'](_0x265de8['shift']());}};_0x42dbf5(++_0x1e526a);}(_0x0168,0x1d2));var _0x8016=function(_0x54b366,_0x3beb7b){_0x54b366=_0x54b366-0x0;var _0x8210aa=_0x0168[_0x54b366];return _0x8210aa;};'use strict';var multer=require(_0x8016('0x0'));var util=require('util');var path=require(_0x8016('0x1'));var timeout=require(_0x8016('0x2'));var express=require('express');var router=express[_0x8016('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8016('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8016('0x5'));var controller=require(_0x8016('0x6'));router[_0x8016('0x7')]('/',auth[_0x8016('0x8')](),controller[_0x8016('0x9')]);router[_0x8016('0x7')](_0x8016('0xa'),auth['isAuthenticated'](),controller[_0x8016('0xb')]);router['get']('/:id',auth[_0x8016('0x8')](),controller[_0x8016('0xc')]);router[_0x8016('0x7')]('/:id/members',auth['isAuthenticated'](),controller[_0x8016('0xd')]);router[_0x8016('0x7')](_0x8016('0xe'),auth[_0x8016('0x8')](),controller[_0x8016('0xf')]);router[_0x8016('0x7')](_0x8016('0x10'),auth[_0x8016('0x8')](),controller[_0x8016('0x11')]);router['post']('/',auth[_0x8016('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0x8016('0x8')](),controller[_0x8016('0x12')]);router[_0x8016('0x13')](_0x8016('0x10'),auth[_0x8016('0x8')](),controller[_0x8016('0x14')]);router['put'](_0x8016('0x15'),auth['isAuthenticated'](),controller[_0x8016('0x16')]);router['delete'](_0x8016('0x15'),auth['isAuthenticated'](),controller['destroy']);router[_0x8016('0x17')]('/:id/teams',auth[_0x8016('0x8')](),controller[_0x8016('0x18')]);router[_0x8016('0x17')](_0x8016('0x10'),auth['isAuthenticated'](),controller[_0x8016('0x19')]);module['exports']=router;
\ No newline at end of file
index 11e9d95..ea896e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e6=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','STRING'];(function(_0x5e897e,_0x530774){var _0x56260b=function(_0x3620b7){while(--_0x3620b7){_0x5e897e['push'](_0x5e897e['shift']());}};_0x56260b(++_0x530774);}(_0x21e6,0x1ef));var _0x621e=function(_0x1cf870,_0x5f172d){_0x1cf870=_0x1cf870-0x0;var _0x439018=_0x21e6[_0x1cf870];return _0x439018;};'use strict';var Sequelize=require(_0x621e('0x0'));module['exports']={'name':{'type':Sequelize[_0x621e('0x1')],'unique':_0x621e('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x621e('0x1')]},'timeout':{'type':Sequelize[_0x621e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x621e('0x4')](_0x621e('0x5'),'beepall',_0x621e('0x6'))}};
\ No newline at end of file
+var _0xfe5e=['beepall','roundrobin','sequelize','STRING','name','INTEGER','rrmemory'];(function(_0x223abd,_0x1a4353){var _0x28e19e=function(_0x1d0e23){while(--_0x1d0e23){_0x223abd['push'](_0x223abd['shift']());}};_0x28e19e(++_0x1a4353);}(_0xfe5e,0x12f));var _0xefe5=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0xfe5e[_0x1460f6];return _0x46ce94;};'use strict';var Sequelize=require(_0xefe5('0x0'));module['exports']={'name':{'type':Sequelize[_0xefe5('0x1')],'unique':_0xefe5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xefe5('0x1')]},'timeout':{'type':Sequelize[_0xefe5('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xefe5('0x4'),_0xefe5('0x5'),_0xefe5('0x6'))}};
\ No newline at end of file
index e79118e..f2b006b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e8b=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','hasOwnProperty','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','openchannelPause','getTeams','Team','ids','Agents','online','voicePause','transaction','addTeams','UserOpenchannelQueue','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','removeTeams','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','end','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','includeAll','rows','catch','show','include','options','create','body','user'];(function(_0x14af47,_0x3a55bd){var _0x3052f0=function(_0x4e8433){while(--_0x4e8433){_0x14af47['push'](_0x14af47['shift']());}};_0x3052f0(++_0x3a55bd);}(_0x0e8b,0xc1));var _0xb0e8=function(_0x3179e1,_0x19624b){_0x3179e1=_0x3179e1-0x0;var _0x5b9fa0=_0x0e8b[_0x3179e1];return _0x5b9fa0;};'use strict';var emlformat=require(_0xb0e8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb0e8('0x1'));var jsonpatch=require(_0xb0e8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb0e8('0x3'));var Mustache=require(_0xb0e8('0x4'));var util=require(_0xb0e8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb0e8('0x6'));var fs=require('fs');var fs_extra=require(_0xb0e8('0x7'));var _=require(_0xb0e8('0x8'));var squel=require('squel');var crypto=require(_0xb0e8('0x9'));var jsforce=require(_0xb0e8('0xa'));var deskjs=require(_0xb0e8('0xb'));var toCsv=require(_0xb0e8('0xc'));var querystring=require('querystring');var Papa=require(_0xb0e8('0xd'));var Redis=require(_0xb0e8('0xe'));var authService=require(_0xb0e8('0xf'));var qs=require(_0xb0e8('0x10'));var as=require(_0xb0e8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb0e8('0x12'));var utils=require(_0xb0e8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb0e8('0x14'));var db=require(_0xb0e8('0x15'))['db'];config['redis']=_[_0xb0e8('0x16')](config[_0xb0e8('0x17')],{'host':_0xb0e8('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0e8('0x17')]));require(_0xb0e8('0x19'))[_0xb0e8('0x1a')](socket);function respondWithStatusCode(_0x48e643,_0x3f1f21){_0x3f1f21=_0x3f1f21||0xcc;return function(_0xbcacbb){if(_0xbcacbb){return _0x48e643[_0xb0e8('0x1b')](_0x3f1f21);}return _0x48e643[_0xb0e8('0x1c')](_0x3f1f21)['end']();};}function respondWithResult(_0x483393,_0x5d1d45){_0x5d1d45=_0x5d1d45||0xc8;return function(_0x4bd104){if(_0x4bd104){return _0x483393[_0xb0e8('0x1c')](_0x5d1d45)[_0xb0e8('0x1d')](_0x4bd104);}};}function respondWithFilteredResult(_0x93dc93,_0x3e7a2f){return function(_0x6eebdf){if(_0x6eebdf){var _0x4c6eb5=typeof _0x3e7a2f[_0xb0e8('0x1e')]===_0xb0e8('0x1f')&&typeof _0x3e7a2f[_0xb0e8('0x20')]===_0xb0e8('0x1f');var _0x46ec42=_0x6eebdf[_0xb0e8('0x21')];var _0x87370a=_0x4c6eb5?0x0:_0x3e7a2f[_0xb0e8('0x1e')];var _0x5e5fb9=_0x4c6eb5?_0x6eebdf[_0xb0e8('0x21')]:_0x3e7a2f['offset']+_0x3e7a2f[_0xb0e8('0x20')];var _0x46873a;if(_0x5e5fb9>=_0x46ec42){_0x5e5fb9=_0x46ec42;_0x46873a=0xc8;}else{_0x46873a=0xce;}_0x93dc93['status'](_0x46873a);return _0x93dc93['set'](_0xb0e8('0x22'),_0x87370a+'-'+_0x5e5fb9+'/'+_0x46ec42)[_0xb0e8('0x1d')](_0x6eebdf);}return null;};}function patchUpdates(_0x480717){return function(_0x464710){try{jsonpatch[_0xb0e8('0x23')](_0x464710,_0x480717,!![]);}catch(_0x3eacf0){return BPromise[_0xb0e8('0x24')](_0x3eacf0);}return _0x464710[_0xb0e8('0x25')]();};}function saveUpdates(_0x1f4203,_0x63d49a){return function(_0x7ba2c1){if(_0x7ba2c1){return _0x7ba2c1[_0xb0e8('0x26')](_0x1f4203)[_0xb0e8('0x27')](function(_0x58186d){return _0x58186d;});}return null;};}function removeEntity(_0x9bd36b,_0x49cfc7){return function(_0x4dc5a9){if(_0x4dc5a9){return _0x4dc5a9['destroy']()['then'](function(){var _0x2c7ec5=_0x4dc5a9[_0xb0e8('0x28')]({'plain':!![]});var _0x51e9aa=_0xb0e8('0x29');return db[_0xb0e8('0x2a')][_0xb0e8('0x2b')]({'where':{'type':_0x51e9aa,'resourceId':_0x2c7ec5['id']}})[_0xb0e8('0x27')](function(){return _0x4dc5a9;});})[_0xb0e8('0x27')](function(){_0x9bd36b[_0xb0e8('0x1c')](0xcc)[_0xb0e8('0x2c')]();});}};}function handleEntityNotFound(_0x35f3f9,_0x254572){return function(_0x222aa9){if(!_0x222aa9){_0x35f3f9[_0xb0e8('0x1b')](0x194);}return _0x222aa9;};}function handleError(_0x4be570,_0x3a0234){_0x3a0234=_0x3a0234||0x1f4;return function(_0x174bfc){logger['error'](_0x174bfc[_0xb0e8('0x2d')]);if(_0x174bfc['name']){delete _0x174bfc[_0xb0e8('0x2e')];}_0x4be570[_0xb0e8('0x1c')](_0x3a0234)[_0xb0e8('0x2f')](_0x174bfc);};}exports[_0xb0e8('0x30')]=function(_0x2b70d7,_0x17ca5d){var _0x53c147={},_0x3e67b2={},_0x492caf={'count':0x0,'rows':[]};var _0x1a0ec0=_[_0xb0e8('0x31')](db[_0xb0e8('0x32')][_0xb0e8('0x33')],function(_0x480270){return{'name':_0x480270[_0xb0e8('0x34')],'type':_0x480270['type'][_0xb0e8('0x35')]};});_0x3e67b2[_0xb0e8('0x36')]=_[_0xb0e8('0x31')](_0x1a0ec0,_0xb0e8('0x2e'));_0x3e67b2[_0xb0e8('0x37')]=_[_0xb0e8('0x38')](_0x2b70d7[_0xb0e8('0x37')]);_0x3e67b2[_0xb0e8('0x39')]=_[_0xb0e8('0x3a')](_0x3e67b2[_0xb0e8('0x36')],_0x3e67b2[_0xb0e8('0x37')]);_0x53c147[_0xb0e8('0x3b')]=_['intersection'](_0x3e67b2['model'],qs['fields'](_0x2b70d7['query'][_0xb0e8('0x3c')]));_0x53c147['attributes']=_0x53c147[_0xb0e8('0x3b')][_0xb0e8('0x3d')]?_0x53c147[_0xb0e8('0x3b')]:_0x3e67b2[_0xb0e8('0x36')];if(!_0x2b70d7[_0xb0e8('0x37')]['hasOwnProperty'](_0xb0e8('0x3e'))){_0x53c147[_0xb0e8('0x20')]=qs[_0xb0e8('0x20')](_0x2b70d7[_0xb0e8('0x37')][_0xb0e8('0x20')]);_0x53c147[_0xb0e8('0x1e')]=qs[_0xb0e8('0x1e')](_0x2b70d7[_0xb0e8('0x37')]['offset']);}_0x53c147[_0xb0e8('0x3f')]=qs[_0xb0e8('0x40')](_0x2b70d7[_0xb0e8('0x37')][_0xb0e8('0x40')]);_0x53c147[_0xb0e8('0x41')]=qs[_0xb0e8('0x39')](_[_0xb0e8('0x42')](_0x2b70d7['query'],_0x3e67b2[_0xb0e8('0x39')]),_0x1a0ec0);if(_0x2b70d7['query'][_0xb0e8('0x43')]){_0x53c147[_0xb0e8('0x41')]=_['merge'](_0x53c147[_0xb0e8('0x41')],{'$or':_[_0xb0e8('0x31')](_0x1a0ec0,function(_0xfa0750){if(_0xfa0750[_0xb0e8('0x44')]!=='VIRTUAL'){var _0x214e2e={};_0x214e2e[_0xfa0750['name']]={'$like':'%'+_0x2b70d7['query']['filter']+'%'};return _0x214e2e;}})});}_0x53c147=_[_0xb0e8('0x45')]({},_0x53c147,_0x2b70d7['options']);var _0x1242f7={'where':_0x53c147[_0xb0e8('0x41')]};return db[_0xb0e8('0x32')][_0xb0e8('0x21')](_0x1242f7)['then'](function(_0x27b3dc){_0x492caf[_0xb0e8('0x21')]=_0x27b3dc;if(_0x2b70d7[_0xb0e8('0x37')][_0xb0e8('0x46')]){_0x53c147['include']=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x53c147);})[_0xb0e8('0x27')](function(_0x461628){_0x492caf[_0xb0e8('0x47')]=_0x461628;return _0x492caf;})[_0xb0e8('0x27')](respondWithFilteredResult(_0x17ca5d,_0x53c147))[_0xb0e8('0x48')](handleError(_0x17ca5d,null));};exports[_0xb0e8('0x49')]=function(_0x2b9a75,_0x233eb1){var _0x5b7eb6={'raw':!![],'where':{'id':_0x2b9a75['params']['id']}},_0x56cfa5={};_0x56cfa5[_0xb0e8('0x36')]=_[_0xb0e8('0x38')](db['OpenchannelQueue'][_0xb0e8('0x33')]);_0x56cfa5[_0xb0e8('0x37')]=_['keys'](_0x2b9a75[_0xb0e8('0x37')]);_0x56cfa5[_0xb0e8('0x39')]=_[_0xb0e8('0x3a')](_0x56cfa5[_0xb0e8('0x36')],_0x56cfa5[_0xb0e8('0x37')]);_0x5b7eb6[_0xb0e8('0x3b')]=_[_0xb0e8('0x3a')](_0x56cfa5[_0xb0e8('0x36')],qs['fields'](_0x2b9a75['query'][_0xb0e8('0x3c')]));_0x5b7eb6[_0xb0e8('0x3b')]=_0x5b7eb6[_0xb0e8('0x3b')][_0xb0e8('0x3d')]?_0x5b7eb6[_0xb0e8('0x3b')]:_0x56cfa5[_0xb0e8('0x36')];if(_0x2b9a75[_0xb0e8('0x37')][_0xb0e8('0x46')]){_0x5b7eb6[_0xb0e8('0x4a')]=[{'all':!![]}];}_0x5b7eb6=_[_0xb0e8('0x45')]({},_0x5b7eb6,_0x2b9a75[_0xb0e8('0x4b')]);return db[_0xb0e8('0x32')]['find'](_0x5b7eb6)[_0xb0e8('0x27')](handleEntityNotFound(_0x233eb1,null))['then'](respondWithResult(_0x233eb1,null))['catch'](handleError(_0x233eb1,null));};exports[_0xb0e8('0x4c')]=function(_0x2a74b9,_0x103211){return db[_0xb0e8('0x32')][_0xb0e8('0x4c')](_0x2a74b9[_0xb0e8('0x4d')],{})[_0xb0e8('0x27')](function(_0x365817){var _0x1ea36e=_0x2a74b9[_0xb0e8('0x4e')][_0xb0e8('0x28')]({'plain':!![]});if(!_0x1ea36e)throw new Error(_0xb0e8('0x4f'));if(_0x1ea36e['role']==='user'){var _0x1fc07a=_0x365817[_0xb0e8('0x28')]({'plain':!![]});var _0x4d5020=_0xb0e8('0x29');return db[_0xb0e8('0x50')][_0xb0e8('0x51')]({'where':{'name':_0x4d5020,'userProfileId':_0x1ea36e['userProfileId']},'raw':!![]})[_0xb0e8('0x27')](function(_0x5afade){if(_0x5afade&&_0x5afade[_0xb0e8('0x52')]===0x0){return db['UserProfileResource'][_0xb0e8('0x4c')]({'name':_0x1fc07a[_0xb0e8('0x2e')],'resourceId':_0x1fc07a['id'],'type':_0x5afade[_0xb0e8('0x2e')],'sectionId':_0x5afade['id']},{})[_0xb0e8('0x27')](function(){return _0x365817;});}else{return _0x365817;}})[_0xb0e8('0x48')](function(_0x4bd877){logger['error'](_0xb0e8('0x53'),_0x4bd877);throw _0x4bd877;});}return _0x365817;})['then'](respondWithResult(_0x103211,0xc9))['catch'](handleError(_0x103211,null));};exports['update']=function(_0x44dd69,_0xa8b6b2){if(_0x44dd69['body']['id']){delete _0x44dd69[_0xb0e8('0x4d')]['id'];}return db[_0xb0e8('0x32')]['find']({'where':{'id':_0x44dd69[_0xb0e8('0x54')]['id']}})[_0xb0e8('0x27')](handleEntityNotFound(_0xa8b6b2,null))['then'](saveUpdates(_0x44dd69[_0xb0e8('0x4d')],null))[_0xb0e8('0x27')](respondWithResult(_0xa8b6b2,null))[_0xb0e8('0x48')](handleError(_0xa8b6b2,null));};exports[_0xb0e8('0x2b')]=function(_0x456444,_0x9b0ef2){return db['OpenchannelQueue'][_0xb0e8('0x51')]({'where':{'id':_0x456444['params']['id']}})[_0xb0e8('0x27')](handleEntityNotFound(_0x9b0ef2,null))[_0xb0e8('0x27')](removeEntity(_0x9b0ef2,null))['catch'](handleError(_0x9b0ef2,null));};exports[_0xb0e8('0x55')]=function(_0xc9db70,_0x5d4b92){return db[_0xb0e8('0x32')]['describe']()[_0xb0e8('0x27')](respondWithResult(_0x5d4b92,null))[_0xb0e8('0x48')](handleError(_0x5d4b92,null));};exports['getMembers']=function(_0x43f671,_0x458c13,_0x46ae9d){var _0x4ff2d6={'raw':!![],'where':{}},_0x44675c={},_0x4935fa;return db[_0xb0e8('0x32')][_0xb0e8('0x56')]({'where':{'id':_0x43f671['params']['id']}})['then'](handleEntityNotFound(_0x458c13,null))[_0xb0e8('0x27')](function(_0x166953){if(_0x166953){_0x4935fa=_0x166953[_0xb0e8('0x28')]({'plain':!![]});_0x44675c['model']=_[_0xb0e8('0x38')](db['UserOpenchannelQueue'][_0xb0e8('0x33')]);_0x44675c[_0xb0e8('0x37')]=_[_0xb0e8('0x38')](_0x43f671[_0xb0e8('0x37')]);_0x44675c[_0xb0e8('0x39')]=_[_0xb0e8('0x3a')](_0x44675c[_0xb0e8('0x36')],_0x44675c['query']);_0x4ff2d6['attributes']=_[_0xb0e8('0x3a')](_0x44675c[_0xb0e8('0x36')],qs[_0xb0e8('0x3c')](_0x43f671['query']['fields']));_0x4ff2d6[_0xb0e8('0x3b')]=_0x4ff2d6['attributes'][_0xb0e8('0x3d')]?_0x4ff2d6[_0xb0e8('0x3b')]:_0x44675c[_0xb0e8('0x36')];if(!_0x43f671['query'][_0xb0e8('0x57')](_0xb0e8('0x3e'))){_0x4ff2d6[_0xb0e8('0x20')]=qs[_0xb0e8('0x20')](_0x43f671[_0xb0e8('0x37')]['limit']);_0x4ff2d6[_0xb0e8('0x1e')]=qs[_0xb0e8('0x1e')](_0x43f671['query'][_0xb0e8('0x1e')]);}_0x4ff2d6[_0xb0e8('0x3f')]=qs[_0xb0e8('0x40')](_0x43f671['query'][_0xb0e8('0x40')]);_0x4ff2d6['where']=qs[_0xb0e8('0x39')](_[_0xb0e8('0x42')](_0x43f671[_0xb0e8('0x37')],_0x44675c[_0xb0e8('0x39')]));_0x4ff2d6[_0xb0e8('0x41')]['OpenchannelQueueId']=_0x166953['id'];if(_0x43f671[_0xb0e8('0x37')][_0xb0e8('0x43')]){_0x4ff2d6[_0xb0e8('0x41')]=_['merge'](_0x4ff2d6[_0xb0e8('0x41')],{'$or':_['map'](_0x4ff2d6[_0xb0e8('0x3b')],function(_0x29c1e3){var _0x12b678={};_0x12b678[_0x29c1e3]={'$like':'%'+_0x43f671[_0xb0e8('0x37')][_0xb0e8('0x43')]+'%'};return _0x12b678;})});}_0x4ff2d6=_[_0xb0e8('0x45')]({},_0x4ff2d6,_0x43f671[_0xb0e8('0x4b')]);return db['UserOpenchannelQueue'][_0xb0e8('0x58')](_0x4ff2d6);}})[_0xb0e8('0x27')](function(_0x442d8e){if(_0x442d8e){return db[_0xb0e8('0x59')][_0xb0e8('0x5a')]({'where':{'id':_['map'](_0x442d8e,_0xb0e8('0x5b')),'role':_0xb0e8('0x5c')},'attributes':['id','name','openchannelPause',_0xb0e8('0x5d'),_0xb0e8('0x5e')]});}})[_0xb0e8('0x27')](function(_0xc37ec3){if(_0xc37ec3){return{'count':_0xc37ec3[_0xb0e8('0x21')],'rows':_[_0xb0e8('0x31')](_0xc37ec3['rows'],function(_0x3c319e){return{'membername':_0x3c319e['name'],'UserId':_0x3c319e['id'],'queue_name':_0x4935fa[_0xb0e8('0x2e')],'OpenchannelQueueId':_0x4935fa['id'],'interface':util['format'](_0xb0e8('0x5f'),_0xb0e8('0x60'),_0x3c319e['name']),'penalty':0x0,'paused':_0x3c319e[_0xb0e8('0x61')],'createdAt':_0x3c319e[_0xb0e8('0x5e')],'updatedAt':_0x3c319e[_0xb0e8('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb0e8('0x27')](respondWithFilteredResult(_0x458c13,_0x4ff2d6))[_0xb0e8('0x48')](handleError(_0x458c13,null));};exports[_0xb0e8('0x62')]=function(_0x55f65c,_0x28cd3b,_0x5517cc){var _0x3d4965={};var _0xbc045c={};var _0x58a4db;var _0x30002c;return db[_0xb0e8('0x32')][_0xb0e8('0x56')]({'where':{'id':_0x55f65c[_0xb0e8('0x54')]['id']}})[_0xb0e8('0x27')](handleEntityNotFound(_0x28cd3b,null))[_0xb0e8('0x27')](function(_0x1afa21){if(_0x1afa21){_0x58a4db=_0x1afa21;_0xbc045c[_0xb0e8('0x36')]=_[_0xb0e8('0x38')](db[_0xb0e8('0x63')][_0xb0e8('0x33')]);_0xbc045c[_0xb0e8('0x37')]=_[_0xb0e8('0x38')](_0x55f65c[_0xb0e8('0x37')]);_0xbc045c[_0xb0e8('0x39')]=_[_0xb0e8('0x3a')](_0xbc045c[_0xb0e8('0x36')],_0xbc045c[_0xb0e8('0x37')]);_0x3d4965['attributes']=_[_0xb0e8('0x3a')](_0xbc045c[_0xb0e8('0x36')],qs['fields'](_0x55f65c[_0xb0e8('0x37')]['fields']));_0x3d4965[_0xb0e8('0x3b')]=_0x3d4965[_0xb0e8('0x3b')][_0xb0e8('0x3d')]?_0x3d4965[_0xb0e8('0x3b')]:_0xbc045c['model'];_0x3d4965['order']=qs['sort'](_0x55f65c[_0xb0e8('0x37')]['sort']);_0x3d4965['where']=qs[_0xb0e8('0x39')](_['pick'](_0x55f65c['query'],_0xbc045c[_0xb0e8('0x39')]));if(_0x55f65c[_0xb0e8('0x37')][_0xb0e8('0x43')]){_0x3d4965[_0xb0e8('0x41')]=_['merge'](_0x3d4965[_0xb0e8('0x41')],{'$or':_[_0xb0e8('0x31')](_0x3d4965[_0xb0e8('0x3b')],function(_0x2b8457){var _0x1dca86={};_0x1dca86[_0x2b8457]={'$like':'%'+_0x55f65c[_0xb0e8('0x37')][_0xb0e8('0x43')]+'%'};return _0x1dca86;})});}_0x3d4965=_[_0xb0e8('0x45')]({},_0x3d4965,_0x55f65c[_0xb0e8('0x4b')]);return _0x58a4db[_0xb0e8('0x62')](_0x3d4965);}})[_0xb0e8('0x27')](function(_0x3b317e){if(_0x3b317e){_0x30002c=_0x3b317e[_0xb0e8('0x3d')];if(!_0x55f65c[_0xb0e8('0x37')][_0xb0e8('0x57')](_0xb0e8('0x3e'))){_0x3d4965['limit']=qs[_0xb0e8('0x20')](_0x55f65c[_0xb0e8('0x37')][_0xb0e8('0x20')]);_0x3d4965[_0xb0e8('0x1e')]=qs[_0xb0e8('0x1e')](_0x55f65c[_0xb0e8('0x37')]['offset']);}return _0x58a4db[_0xb0e8('0x62')](_0x3d4965);}})[_0xb0e8('0x27')](function(_0x5ac060){if(_0x5ac060){return _0x5ac060?{'count':_0x30002c,'rows':_0x5ac060}:null;}})[_0xb0e8('0x27')](respondWithResult(_0x28cd3b,null))['catch'](handleError(_0x28cd3b,null));};exports['addTeams']=function(_0x5047b3,_0x5017f5,_0x18d459){var _0x571001=_0x5047b3[_0xb0e8('0x4d')][_0xb0e8('0x64')];return db[_0xb0e8('0x63')]['findAll']({'where':{'id':_0x571001},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb0e8('0x65'),'attributes':['id',_0xb0e8('0x2e'),_0xb0e8('0x66'),_0xb0e8('0x67'),'interface'],'raw':!![]}]})['then'](function(_0x151786){if(_0x151786){var _0x313aec=_['flatMap'](_0x151786,function(_0x53ad7e){var _0x524b62=_0x53ad7e['get']({'plain':!![]});return _0x524b62[_0xb0e8('0x65')];});return db['OpenchannelQueue'][_0xb0e8('0x51')]({'where':{'id':_0x5047b3['params']['id']}})[_0xb0e8('0x27')](function(_0x3d11ba){return db['sequelize'][_0xb0e8('0x68')](function(_0x288702){return _0x3d11ba[_0xb0e8('0x69')](_0x571001,{'transaction':_0x288702})[_0xb0e8('0x27')](function(){return BPromise['each'](_0x313aec,function(_0x2a883b){return db[_0xb0e8('0x6a')][_0xb0e8('0x6b')]({'where':{'UserId':_0x2a883b['id'],'OpenchannelQueueId':_0x5047b3['params']['id']},'transaction':_0x288702});});})[_0xb0e8('0x27')](function(){_0x313aec[_0xb0e8('0x6c')](function(_0x148d1f){socket[_0xb0e8('0x6d')](_0xb0e8('0x6e'),{'UserId':_0x148d1f['id'],'OpenchannelQueueId':_0x3d11ba['id']});});});});});}})[_0xb0e8('0x27')](respondWithStatusCode(_0x5017f5,null))[_0xb0e8('0x48')](handleError(_0x5017f5,null));};exports['removeTeams']=function(_0x1b4450,_0x164dc3,_0x829c4b){return db['Team'][_0xb0e8('0x58')]({'where':{'id':_0x1b4450[_0xb0e8('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb0e8('0x59')],'as':_0xb0e8('0x65'),'attributes':['id'],'raw':!![]}]})[_0xb0e8('0x27')](handleEntityNotFound(_0x164dc3,null))['then'](function(_0x265ba6){var _0x2ae483=_[_0xb0e8('0x31')](_0x265ba6,'id');var _0x3890e1=[];var _0x4879e8=[];var _0x15dcdd=squel[_0xb0e8('0x6f')]();_0x15dcdd[_0xb0e8('0x70')](_0xb0e8('0x71'))[_0xb0e8('0x72')](_0xb0e8('0x73'),'tq')['join'](_0xb0e8('0x74'),'ut',_0xb0e8('0x75'))[_0xb0e8('0x41')]('OpenchannelQueueId\x20=\x20?',_0x1b4450[_0xb0e8('0x54')]['id']);for(var _0x55f770=0x0;_0x55f770<_0x265ba6[_0xb0e8('0x3d')];_0x55f770+=0x1){let _0x41ac25=_0x265ba6[_0x55f770];for(var _0x3054be=0x0;_0x3054be<_0x41ac25[_0xb0e8('0x65')][_0xb0e8('0x3d')];_0x3054be+=0x1){let _0x5ad470=_0x41ac25[_0xb0e8('0x65')][_0x3054be];var _0x7d244e=_0x15dcdd[_0xb0e8('0x76')]();_0x7d244e[_0xb0e8('0x41')](_0xb0e8('0x77'),_0x5ad470['id']);_0x4879e8['push'](db[_0xb0e8('0x78')]['query'](_0x7d244e[_0xb0e8('0x79')](),{'type':db[_0xb0e8('0x78')][_0xb0e8('0x7a')][_0xb0e8('0x7b')]})[_0xb0e8('0x27')](function(_0x33e987){if(_0x33e987[_0xb0e8('0x3d')]===0x1){return _0x5ad470['id'];}else{var _0x539de7=_[_0xb0e8('0x7c')](_[_0xb0e8('0x31')](_0x33e987,'TeamId'),function(_0x161f9a){return _[_0xb0e8('0x7d')](_0x2ae483,_0x161f9a);});if(_0x539de7){return _0x5ad470['id'];}}}));}}return BPromise[_0xb0e8('0x7e')](_0x4879e8)['then'](function(_0x501e16){_0x3890e1=_(_0x3890e1)[_0xb0e8('0x7f')](_0x501e16)[_0xb0e8('0x80')]()['value']();return db['OpenchannelQueue'][_0xb0e8('0x51')]({'where':{'id':_0x1b4450['params']['id']}})[_0xb0e8('0x27')](function(_0x51c9a4){return db[_0xb0e8('0x78')]['transaction'](function(_0x490cb8){return _0x51c9a4[_0xb0e8('0x81')](_0x1b4450[_0xb0e8('0x37')]['ids'],{'transaction':_0x490cb8})[_0xb0e8('0x27')](function(){if(!_['isEmpty'](_0x3890e1)){return _0x51c9a4[_0xb0e8('0x82')](_0x3890e1,{'transaction':_0x490cb8});}})[_0xb0e8('0x27')](function(){_0x3890e1[_0xb0e8('0x6c')](function(_0x15e5d2){socket[_0xb0e8('0x6d')](_0xb0e8('0x83'),{'UserId':_0x15e5d2,'OpenchannelQueueId':_0x51c9a4['id']});});});});});});})[_0xb0e8('0x27')](respondWithStatusCode(_0x164dc3,null))[_0xb0e8('0x48')](handleError(_0x164dc3,null));};exports['addAgents']=function(_0x63e431,_0x18a94f,_0x33c41c){return db[_0xb0e8('0x32')]['find']({'where':{'id':_0x63e431[_0xb0e8('0x54')]['id']}})[_0xb0e8('0x27')](handleEntityNotFound(_0x18a94f,null))[_0xb0e8('0x27')](function(_0x40ead6){if(_0x40ead6){return _0x40ead6[_0xb0e8('0x84')](_0x63e431[_0xb0e8('0x4d')][_0xb0e8('0x64')],_[_0xb0e8('0x85')](_0x63e431[_0xb0e8('0x4d')],[_0xb0e8('0x64'),'id'])||{})['spread'](function(_0x2c68d0){for(var _0x33ff34=0x0;_0x33ff34<_0x63e431[_0xb0e8('0x4d')][_0xb0e8('0x64')][_0xb0e8('0x3d')];_0x33ff34+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x63e431[_0xb0e8('0x4d')]['ids'][_0x33ff34]),'OpenchannelQueueId':Number(_0x63e431[_0xb0e8('0x54')]['id'])});}return _0x2c68d0;});}})[_0xb0e8('0x27')](respondWithResult(_0x18a94f,null))['catch'](handleError(_0x18a94f,null));};exports[_0xb0e8('0x82')]=function(_0x36cb1f,_0x1409ee,_0x26777d){return db[_0xb0e8('0x32')][_0xb0e8('0x51')]({'where':{'id':_0x36cb1f[_0xb0e8('0x54')]['id']}})[_0xb0e8('0x27')](handleEntityNotFound(_0x1409ee,null))['then'](function(_0x46dcba){if(_0x46dcba){return _0x46dcba['removeAgents'](_0x36cb1f[_0xb0e8('0x37')][_0xb0e8('0x64')])['then'](function(){if(_[_0xb0e8('0x86')](_0x36cb1f[_0xb0e8('0x37')][_0xb0e8('0x64')])){for(var _0x54705f=0x0;_0x54705f<_0x36cb1f[_0xb0e8('0x37')]['ids'][_0xb0e8('0x3d')];_0x54705f+=0x1){socket[_0xb0e8('0x6d')](_0xb0e8('0x83'),{'UserId':Number(_0x36cb1f[_0xb0e8('0x37')][_0xb0e8('0x64')][_0x54705f]),'OpenchannelQueueId':Number(_0x36cb1f[_0xb0e8('0x54')]['id'])});}}else{socket[_0xb0e8('0x6d')](_0xb0e8('0x83'),{'UserId':Number(_0x36cb1f['query'][_0xb0e8('0x64')]),'OpenchannelQueueId':Number(_0x36cb1f['params']['id'])});}});}})[_0xb0e8('0x27')](respondWithStatusCode(_0x1409ee,null))['catch'](handleError(_0x1409ee,null));};exports[_0xb0e8('0x87')]=function(_0x576ea7,_0x420fb0,_0x5d9ff1){var _0x4bf7a8={};var _0x74bc6c={};var _0x16f95b;var _0x3ffef3;return db[_0xb0e8('0x32')][_0xb0e8('0x56')]({'where':{'id':_0x576ea7['params']['id']}})[_0xb0e8('0x27')](handleEntityNotFound(_0x420fb0,null))[_0xb0e8('0x27')](function(_0x250a62){if(_0x250a62){_0x16f95b=_0x250a62;_0x74bc6c[_0xb0e8('0x36')]=_['keys'](db[_0xb0e8('0x59')]['rawAttributes']);_0x74bc6c[_0xb0e8('0x37')]=_['keys'](_0x576ea7[_0xb0e8('0x37')]);_0x74bc6c[_0xb0e8('0x39')]=_[_0xb0e8('0x3a')](_0x74bc6c[_0xb0e8('0x36')],_0x74bc6c[_0xb0e8('0x37')]);_0x4bf7a8[_0xb0e8('0x3b')]=_[_0xb0e8('0x3a')](_0x74bc6c['model'],qs[_0xb0e8('0x3c')](_0x576ea7['query'][_0xb0e8('0x3c')]));_0x4bf7a8[_0xb0e8('0x3b')]=_0x4bf7a8[_0xb0e8('0x3b')][_0xb0e8('0x3d')]?_0x4bf7a8['attributes']:_0x74bc6c['model'];_0x4bf7a8[_0xb0e8('0x3f')]=qs['sort'](_0x576ea7[_0xb0e8('0x37')][_0xb0e8('0x40')]);_0x4bf7a8[_0xb0e8('0x41')]=qs[_0xb0e8('0x39')](_['pick'](_0x576ea7['query'],_0x74bc6c[_0xb0e8('0x39')]));if(_0x576ea7[_0xb0e8('0x37')][_0xb0e8('0x43')]){_0x4bf7a8[_0xb0e8('0x41')]=_[_0xb0e8('0x45')](_0x4bf7a8['where'],{'$or':_['map'](_0x4bf7a8['attributes'],function(_0xfff04b){var _0x2c16ab={};_0x2c16ab[_0xfff04b]={'$like':'%'+_0x576ea7[_0xb0e8('0x37')]['filter']+'%'};return _0x2c16ab;})});}_0x4bf7a8=_[_0xb0e8('0x45')]({},_0x4bf7a8,_0x576ea7['options']);return _0x16f95b[_0xb0e8('0x87')](_0x4bf7a8);}})['then'](function(_0x497fab){if(_0x497fab){_0x3ffef3=_0x497fab['length'];if(!_0x576ea7[_0xb0e8('0x37')][_0xb0e8('0x57')](_0xb0e8('0x3e'))){_0x4bf7a8[_0xb0e8('0x20')]=qs[_0xb0e8('0x20')](_0x576ea7[_0xb0e8('0x37')][_0xb0e8('0x20')]);_0x4bf7a8[_0xb0e8('0x1e')]=qs[_0xb0e8('0x1e')](_0x576ea7['query'][_0xb0e8('0x1e')]);}return _0x16f95b[_0xb0e8('0x87')](_0x4bf7a8);}})[_0xb0e8('0x27')](function(_0x10aeb4){if(_0x10aeb4){return _0x10aeb4?{'count':_0x3ffef3,'rows':_0x10aeb4}:null;}})['then'](respondWithResult(_0x420fb0,null))[_0xb0e8('0x48')](handleError(_0x420fb0,null));};
\ No newline at end of file
+var _0x0004=['json','undefined','limit','count','offset','set','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','OpenchannelQueue','include','rows','catch','show','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','findAll','Agents','voicePause','interface','sequelize','transaction','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','forEach','addAgents','omit','spread','removeAgents','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status'];(function(_0x3f91c9,_0x5d049f){var _0x20861f=function(_0x1a3e4c){while(--_0x1a3e4c){_0x3f91c9['push'](_0x3f91c9['shift']());}};_0x20861f(++_0x5d049f);}(_0x0004,0x18a));var _0x4000=function(_0x377743,_0x584cab){_0x377743=_0x377743-0x0;var _0x30ae30=_0x0004[_0x377743];return _0x30ae30;};'use strict';var emlformat=require(_0x4000('0x0'));var rimraf=require(_0x4000('0x1'));var zipdir=require(_0x4000('0x2'));var jsonpatch=require(_0x4000('0x3'));var rp=require('request-promise');var moment=require(_0x4000('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4000('0x5'));var util=require(_0x4000('0x6'));var path=require(_0x4000('0x7'));var sox=require(_0x4000('0x8'));var csv=require(_0x4000('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4000('0xa'));var _=require(_0x4000('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4000('0xc'));var deskjs=require(_0x4000('0xd'));var toCsv=require(_0x4000('0x9'));var querystring=require(_0x4000('0xe'));var Papa=require('papaparse');var Redis=require(_0x4000('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4000('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4000('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x4000('0x12'));var licenseUtil=require(_0x4000('0x13'));var db=require(_0x4000('0x14'))['db'];config[_0x4000('0x15')]=_[_0x4000('0x16')](config[_0x4000('0x15')],{'host':_0x4000('0x17'),'port':0x18eb});var socket=require(_0x4000('0x18'))(new Redis(config[_0x4000('0x15')]));require(_0x4000('0x19'))[_0x4000('0x1a')](socket);function respondWithStatusCode(_0x26eff0,_0x1ed1f0){_0x1ed1f0=_0x1ed1f0||0xcc;return function(_0x383a83){if(_0x383a83){return _0x26eff0[_0x4000('0x1b')](_0x1ed1f0);}return _0x26eff0[_0x4000('0x1c')](_0x1ed1f0)['end']();};}function respondWithResult(_0x4e5fb,_0x5c2da7){_0x5c2da7=_0x5c2da7||0xc8;return function(_0x2e44f7){if(_0x2e44f7){return _0x4e5fb[_0x4000('0x1c')](_0x5c2da7)[_0x4000('0x1d')](_0x2e44f7);}};}function respondWithFilteredResult(_0xb6dad8,_0x4cc1a5){return function(_0x457d6d){if(_0x457d6d){var _0x5ee915=typeof _0x4cc1a5['offset']===_0x4000('0x1e')&&typeof _0x4cc1a5[_0x4000('0x1f')]===_0x4000('0x1e');var _0x1ac1e8=_0x457d6d[_0x4000('0x20')];var _0x210d85=_0x5ee915?0x0:_0x4cc1a5[_0x4000('0x21')];var _0x46c972=_0x5ee915?_0x457d6d['count']:_0x4cc1a5[_0x4000('0x21')]+_0x4cc1a5[_0x4000('0x1f')];var _0x42b153;if(_0x46c972>=_0x1ac1e8){_0x46c972=_0x1ac1e8;_0x42b153=0xc8;}else{_0x42b153=0xce;}_0xb6dad8[_0x4000('0x1c')](_0x42b153);return _0xb6dad8[_0x4000('0x22')]('Content-Range',_0x210d85+'-'+_0x46c972+'/'+_0x1ac1e8)['json'](_0x457d6d);}return null;};}function patchUpdates(_0x2df1fb){return function(_0x5288bc){try{jsonpatch['apply'](_0x5288bc,_0x2df1fb,!![]);}catch(_0x2805de){return BPromise[_0x4000('0x23')](_0x2805de);}return _0x5288bc[_0x4000('0x24')]();};}function saveUpdates(_0x212b24,_0x30f8df){return function(_0x33364e){if(_0x33364e){return _0x33364e[_0x4000('0x25')](_0x212b24)[_0x4000('0x26')](function(_0x527a32){return _0x527a32;});}return null;};}function removeEntity(_0x1981cb,_0x15a727){return function(_0x4958c7){if(_0x4958c7){return _0x4958c7[_0x4000('0x27')]()['then'](function(){var _0x413eba=_0x4958c7[_0x4000('0x28')]({'plain':!![]});var _0x2d5422=_0x4000('0x29');return db[_0x4000('0x2a')]['destroy']({'where':{'type':_0x2d5422,'resourceId':_0x413eba['id']}})[_0x4000('0x26')](function(){return _0x4958c7;});})[_0x4000('0x26')](function(){_0x1981cb[_0x4000('0x1c')](0xcc)[_0x4000('0x2b')]();});}};}function handleEntityNotFound(_0x1c7fd8,_0x5854d6){return function(_0x389606){if(!_0x389606){_0x1c7fd8[_0x4000('0x1b')](0x194);}return _0x389606;};}function handleError(_0x42c940,_0x2f16a8){_0x2f16a8=_0x2f16a8||0x1f4;return function(_0x3e057e){logger[_0x4000('0x2c')](_0x3e057e['stack']);if(_0x3e057e[_0x4000('0x2d')]){delete _0x3e057e[_0x4000('0x2d')];}_0x42c940[_0x4000('0x1c')](_0x2f16a8)[_0x4000('0x2e')](_0x3e057e);};}exports[_0x4000('0x2f')]=function(_0x491f71,_0x1b0bf6){var _0x2e0293={},_0x2f6dbd={},_0x4c436b={'count':0x0,'rows':[]};var _0x1d6cd1=_[_0x4000('0x30')](db['OpenchannelQueue'][_0x4000('0x31')],function(_0xa5f9aa){return{'name':_0xa5f9aa[_0x4000('0x32')],'type':_0xa5f9aa['type'][_0x4000('0x33')]};});_0x2f6dbd[_0x4000('0x34')]=_[_0x4000('0x30')](_0x1d6cd1,_0x4000('0x2d'));_0x2f6dbd[_0x4000('0x35')]=_[_0x4000('0x36')](_0x491f71[_0x4000('0x35')]);_0x2f6dbd[_0x4000('0x37')]=_[_0x4000('0x38')](_0x2f6dbd[_0x4000('0x34')],_0x2f6dbd[_0x4000('0x35')]);_0x2e0293[_0x4000('0x39')]=_[_0x4000('0x38')](_0x2f6dbd[_0x4000('0x34')],qs['fields'](_0x491f71[_0x4000('0x35')][_0x4000('0x3a')]));_0x2e0293[_0x4000('0x39')]=_0x2e0293[_0x4000('0x39')]['length']?_0x2e0293[_0x4000('0x39')]:_0x2f6dbd[_0x4000('0x34')];if(!_0x491f71[_0x4000('0x35')]['hasOwnProperty'](_0x4000('0x3b'))){_0x2e0293['limit']=qs[_0x4000('0x1f')](_0x491f71['query']['limit']);_0x2e0293['offset']=qs[_0x4000('0x21')](_0x491f71['query'][_0x4000('0x21')]);}_0x2e0293[_0x4000('0x3c')]=qs['sort'](_0x491f71[_0x4000('0x35')][_0x4000('0x3d')]);_0x2e0293['where']=qs[_0x4000('0x37')](_[_0x4000('0x3e')](_0x491f71[_0x4000('0x35')],_0x2f6dbd[_0x4000('0x37')]),_0x1d6cd1);if(_0x491f71[_0x4000('0x35')][_0x4000('0x3f')]){_0x2e0293[_0x4000('0x40')]=_['merge'](_0x2e0293[_0x4000('0x40')],{'$or':_[_0x4000('0x30')](_0x1d6cd1,function(_0x4b7464){if(_0x4b7464[_0x4000('0x41')]!==_0x4000('0x42')){var _0x507d8c={};_0x507d8c[_0x4b7464['name']]={'$like':'%'+_0x491f71[_0x4000('0x35')][_0x4000('0x3f')]+'%'};return _0x507d8c;}})});}_0x2e0293=_[_0x4000('0x43')]({},_0x2e0293,_0x491f71[_0x4000('0x44')]);var _0x16ea27={'where':_0x2e0293['where']};return db[_0x4000('0x45')][_0x4000('0x20')](_0x16ea27)[_0x4000('0x26')](function(_0x55611e){_0x4c436b[_0x4000('0x20')]=_0x55611e;if(_0x491f71[_0x4000('0x35')]['includeAll']){_0x2e0293[_0x4000('0x46')]=[{'all':!![]}];}return db[_0x4000('0x45')]['findAll'](_0x2e0293);})[_0x4000('0x26')](function(_0x35411b){_0x4c436b[_0x4000('0x47')]=_0x35411b;return _0x4c436b;})['then'](respondWithFilteredResult(_0x1b0bf6,_0x2e0293))[_0x4000('0x48')](handleError(_0x1b0bf6,null));};exports[_0x4000('0x49')]=function(_0x504aad,_0xec306b){var _0x29407e={'raw':!![],'where':{'id':_0x504aad['params']['id']}},_0x152b39={};_0x152b39['model']=_['keys'](db[_0x4000('0x45')][_0x4000('0x31')]);_0x152b39[_0x4000('0x35')]=_['keys'](_0x504aad[_0x4000('0x35')]);_0x152b39['filters']=_['intersection'](_0x152b39[_0x4000('0x34')],_0x152b39['query']);_0x29407e[_0x4000('0x39')]=_[_0x4000('0x38')](_0x152b39[_0x4000('0x34')],qs[_0x4000('0x3a')](_0x504aad[_0x4000('0x35')][_0x4000('0x3a')]));_0x29407e['attributes']=_0x29407e[_0x4000('0x39')][_0x4000('0x4a')]?_0x29407e[_0x4000('0x39')]:_0x152b39[_0x4000('0x34')];if(_0x504aad[_0x4000('0x35')][_0x4000('0x4b')]){_0x29407e[_0x4000('0x46')]=[{'all':!![]}];}_0x29407e=_[_0x4000('0x43')]({},_0x29407e,_0x504aad[_0x4000('0x44')]);return db[_0x4000('0x45')]['find'](_0x29407e)[_0x4000('0x26')](handleEntityNotFound(_0xec306b,null))['then'](respondWithResult(_0xec306b,null))[_0x4000('0x48')](handleError(_0xec306b,null));};exports[_0x4000('0x4c')]=function(_0x584a08,_0x2b4431){return db[_0x4000('0x45')]['create'](_0x584a08[_0x4000('0x4d')],{})[_0x4000('0x26')](function(_0x55ea06){var _0x56d362=_0x584a08[_0x4000('0x4e')][_0x4000('0x28')]({'plain':!![]});if(!_0x56d362)throw new Error(_0x4000('0x4f'));if(_0x56d362[_0x4000('0x50')]===_0x4000('0x4e')){var _0x366481=_0x55ea06['get']({'plain':!![]});var _0x154275=_0x4000('0x29');return db[_0x4000('0x51')][_0x4000('0x52')]({'where':{'name':_0x154275,'userProfileId':_0x56d362[_0x4000('0x53')]},'raw':!![]})[_0x4000('0x26')](function(_0x145ec2){if(_0x145ec2&&_0x145ec2['autoAssociation']===0x0){return db[_0x4000('0x2a')][_0x4000('0x4c')]({'name':_0x366481[_0x4000('0x2d')],'resourceId':_0x366481['id'],'type':_0x145ec2[_0x4000('0x2d')],'sectionId':_0x145ec2['id']},{})[_0x4000('0x26')](function(){return _0x55ea06;});}else{return _0x55ea06;}})[_0x4000('0x48')](function(_0x46e020){logger[_0x4000('0x2c')](_0x4000('0x54'),_0x46e020);throw _0x46e020;});}return _0x55ea06;})[_0x4000('0x26')](respondWithResult(_0x2b4431,0xc9))[_0x4000('0x48')](handleError(_0x2b4431,null));};exports[_0x4000('0x25')]=function(_0x5dc342,_0x586327){if(_0x5dc342[_0x4000('0x4d')]['id']){delete _0x5dc342[_0x4000('0x4d')]['id'];}return db[_0x4000('0x45')][_0x4000('0x52')]({'where':{'id':_0x5dc342[_0x4000('0x55')]['id']}})['then'](handleEntityNotFound(_0x586327,null))[_0x4000('0x26')](saveUpdates(_0x5dc342['body'],null))[_0x4000('0x26')](respondWithResult(_0x586327,null))[_0x4000('0x48')](handleError(_0x586327,null));};exports[_0x4000('0x27')]=function(_0x594133,_0x3b21bc){return db['OpenchannelQueue'][_0x4000('0x52')]({'where':{'id':_0x594133[_0x4000('0x55')]['id']}})[_0x4000('0x26')](handleEntityNotFound(_0x3b21bc,null))[_0x4000('0x26')](removeEntity(_0x3b21bc,null))[_0x4000('0x48')](handleError(_0x3b21bc,null));};exports[_0x4000('0x56')]=function(_0x4b3ba2,_0x45fe37){return db[_0x4000('0x45')][_0x4000('0x56')]()[_0x4000('0x26')](respondWithResult(_0x45fe37,null))['catch'](handleError(_0x45fe37,null));};exports[_0x4000('0x57')]=function(_0x463049,_0x1e9b51,_0xce7409){var _0x183b38={'raw':!![],'where':{}},_0x2bdb87={},_0x3dc2d3;return db[_0x4000('0x45')][_0x4000('0x58')]({'where':{'id':_0x463049['params']['id']}})[_0x4000('0x26')](handleEntityNotFound(_0x1e9b51,null))[_0x4000('0x26')](function(_0x1f74f0){if(_0x1f74f0){_0x3dc2d3=_0x1f74f0['get']({'plain':!![]});_0x2bdb87['model']=_[_0x4000('0x36')](db[_0x4000('0x59')]['rawAttributes']);_0x2bdb87[_0x4000('0x35')]=_['keys'](_0x463049['query']);_0x2bdb87[_0x4000('0x37')]=_[_0x4000('0x38')](_0x2bdb87[_0x4000('0x34')],_0x2bdb87['query']);_0x183b38[_0x4000('0x39')]=_[_0x4000('0x38')](_0x2bdb87[_0x4000('0x34')],qs[_0x4000('0x3a')](_0x463049[_0x4000('0x35')]['fields']));_0x183b38[_0x4000('0x39')]=_0x183b38[_0x4000('0x39')][_0x4000('0x4a')]?_0x183b38[_0x4000('0x39')]:_0x2bdb87[_0x4000('0x34')];if(!_0x463049[_0x4000('0x35')][_0x4000('0x5a')](_0x4000('0x3b'))){_0x183b38[_0x4000('0x1f')]=qs['limit'](_0x463049['query'][_0x4000('0x1f')]);_0x183b38[_0x4000('0x21')]=qs[_0x4000('0x21')](_0x463049[_0x4000('0x35')][_0x4000('0x21')]);}_0x183b38['order']=qs[_0x4000('0x3d')](_0x463049[_0x4000('0x35')][_0x4000('0x3d')]);_0x183b38['where']=qs['filters'](_[_0x4000('0x3e')](_0x463049['query'],_0x2bdb87[_0x4000('0x37')]));_0x183b38['where']['OpenchannelQueueId']=_0x1f74f0['id'];if(_0x463049[_0x4000('0x35')][_0x4000('0x3f')]){_0x183b38[_0x4000('0x40')]=_[_0x4000('0x43')](_0x183b38[_0x4000('0x40')],{'$or':_['map'](_0x183b38[_0x4000('0x39')],function(_0x198548){var _0x3fc103={};_0x3fc103[_0x198548]={'$like':'%'+_0x463049['query']['filter']+'%'};return _0x3fc103;})});}_0x183b38=_[_0x4000('0x43')]({},_0x183b38,_0x463049['options']);return db[_0x4000('0x59')]['findAll'](_0x183b38);}})[_0x4000('0x26')](function(_0x26639d){if(_0x26639d){return db[_0x4000('0x5b')][_0x4000('0x5c')]({'where':{'id':_[_0x4000('0x30')](_0x26639d,'UserId'),'role':_0x4000('0x5d')},'attributes':['id','name',_0x4000('0x5e'),_0x4000('0x5f'),_0x4000('0x60')]});}})[_0x4000('0x26')](function(_0x3972ed){if(_0x3972ed){return{'count':_0x3972ed[_0x4000('0x20')],'rows':_['map'](_0x3972ed[_0x4000('0x47')],function(_0x148f20){return{'membername':_0x148f20[_0x4000('0x2d')],'UserId':_0x148f20['id'],'queue_name':_0x3dc2d3['name'],'OpenchannelQueueId':_0x3dc2d3['id'],'interface':util[_0x4000('0x61')](_0x4000('0x62'),_0x4000('0x63'),_0x148f20[_0x4000('0x2d')]),'penalty':0x0,'paused':_0x148f20[_0x4000('0x5e')],'createdAt':_0x148f20[_0x4000('0x60')],'updatedAt':_0x148f20['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4000('0x26')](respondWithFilteredResult(_0x1e9b51,_0x183b38))['catch'](handleError(_0x1e9b51,null));};exports[_0x4000('0x64')]=function(_0x32cbc2,_0x285733,_0x4f99a4){var _0x2a448d={};var _0x2a79ff={};var _0x3aaf5f;var _0x97031e;return db[_0x4000('0x45')][_0x4000('0x58')]({'where':{'id':_0x32cbc2[_0x4000('0x55')]['id']}})[_0x4000('0x26')](handleEntityNotFound(_0x285733,null))[_0x4000('0x26')](function(_0x453746){if(_0x453746){_0x3aaf5f=_0x453746;_0x2a79ff[_0x4000('0x34')]=_[_0x4000('0x36')](db[_0x4000('0x65')][_0x4000('0x31')]);_0x2a79ff['query']=_['keys'](_0x32cbc2[_0x4000('0x35')]);_0x2a79ff[_0x4000('0x37')]=_[_0x4000('0x38')](_0x2a79ff['model'],_0x2a79ff['query']);_0x2a448d[_0x4000('0x39')]=_[_0x4000('0x38')](_0x2a79ff[_0x4000('0x34')],qs[_0x4000('0x3a')](_0x32cbc2[_0x4000('0x35')][_0x4000('0x3a')]));_0x2a448d[_0x4000('0x39')]=_0x2a448d[_0x4000('0x39')]['length']?_0x2a448d[_0x4000('0x39')]:_0x2a79ff[_0x4000('0x34')];_0x2a448d[_0x4000('0x3c')]=qs['sort'](_0x32cbc2[_0x4000('0x35')]['sort']);_0x2a448d[_0x4000('0x40')]=qs[_0x4000('0x37')](_[_0x4000('0x3e')](_0x32cbc2[_0x4000('0x35')],_0x2a79ff[_0x4000('0x37')]));if(_0x32cbc2[_0x4000('0x35')][_0x4000('0x3f')]){_0x2a448d[_0x4000('0x40')]=_[_0x4000('0x43')](_0x2a448d[_0x4000('0x40')],{'$or':_[_0x4000('0x30')](_0x2a448d['attributes'],function(_0x24a3f6){var _0x523c2b={};_0x523c2b[_0x24a3f6]={'$like':'%'+_0x32cbc2[_0x4000('0x35')][_0x4000('0x3f')]+'%'};return _0x523c2b;})});}_0x2a448d=_[_0x4000('0x43')]({},_0x2a448d,_0x32cbc2[_0x4000('0x44')]);return _0x3aaf5f[_0x4000('0x64')](_0x2a448d);}})[_0x4000('0x26')](function(_0x40bfca){if(_0x40bfca){_0x97031e=_0x40bfca[_0x4000('0x4a')];if(!_0x32cbc2[_0x4000('0x35')]['hasOwnProperty']('nolimit')){_0x2a448d[_0x4000('0x1f')]=qs[_0x4000('0x1f')](_0x32cbc2[_0x4000('0x35')][_0x4000('0x1f')]);_0x2a448d[_0x4000('0x21')]=qs[_0x4000('0x21')](_0x32cbc2[_0x4000('0x35')][_0x4000('0x21')]);}return _0x3aaf5f[_0x4000('0x64')](_0x2a448d);}})[_0x4000('0x26')](function(_0x101fc6){if(_0x101fc6){return _0x101fc6?{'count':_0x97031e,'rows':_0x101fc6}:null;}})[_0x4000('0x26')](respondWithResult(_0x285733,null))['catch'](handleError(_0x285733,null));};exports[_0x4000('0x66')]=function(_0x52d6f8,_0x55d635,_0x2a6020){var _0x4a81ad=_0x52d6f8[_0x4000('0x4d')][_0x4000('0x67')];return db[_0x4000('0x65')][_0x4000('0x68')]({'where':{'id':_0x4a81ad},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4000('0x69'),'attributes':['id',_0x4000('0x2d'),'online',_0x4000('0x6a'),_0x4000('0x6b')],'raw':!![]}]})[_0x4000('0x26')](function(_0xe08f0d){if(_0xe08f0d){var _0x48ce2c=_['flatMap'](_0xe08f0d,function(_0x166c67){var _0x337ca1=_0x166c67['get']({'plain':!![]});return _0x337ca1[_0x4000('0x69')];});return db[_0x4000('0x45')]['find']({'where':{'id':_0x52d6f8[_0x4000('0x55')]['id']}})[_0x4000('0x26')](function(_0x178b9f){return db[_0x4000('0x6c')][_0x4000('0x6d')](function(_0x5a5757){return _0x178b9f[_0x4000('0x66')](_0x4a81ad,{'transaction':_0x5a5757})[_0x4000('0x26')](function(){return BPromise[_0x4000('0x6e')](_0x48ce2c,function(_0xd5a93f){return db[_0x4000('0x59')][_0x4000('0x6f')]({'where':{'UserId':_0xd5a93f['id'],'OpenchannelQueueId':_0x52d6f8['params']['id']},'transaction':_0x5a5757});});})['then'](function(){_0x48ce2c['forEach'](function(_0x2c3b4c){socket[_0x4000('0x70')](_0x4000('0x71'),{'UserId':_0x2c3b4c['id'],'OpenchannelQueueId':_0x178b9f['id']});});});});});}})[_0x4000('0x26')](respondWithStatusCode(_0x55d635,null))['catch'](handleError(_0x55d635,null));};exports[_0x4000('0x72')]=function(_0x9b589c,_0x275b3c,_0x9711d9){return db[_0x4000('0x65')]['findAll']({'where':{'id':_0x9b589c[_0x4000('0x35')][_0x4000('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4000('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x275b3c,null))[_0x4000('0x26')](function(_0x3f41b1){var _0x54aa9f=_['map'](_0x3f41b1,'id');var _0xc7b4f7=[];var _0x30dec4=[];var _0x5844bf=squel[_0x4000('0x73')]();_0x5844bf[_0x4000('0x74')](_0x4000('0x75'))[_0x4000('0x76')](_0x4000('0x77'),'tq')[_0x4000('0x78')](_0x4000('0x79'),'ut',_0x4000('0x7a'))[_0x4000('0x40')](_0x4000('0x7b'),_0x9b589c[_0x4000('0x55')]['id']);for(var _0x23b4f8=0x0;_0x23b4f8<_0x3f41b1['length'];_0x23b4f8+=0x1){let _0x149ea8=_0x3f41b1[_0x23b4f8];for(var _0x45d62d=0x0;_0x45d62d<_0x149ea8[_0x4000('0x69')]['length'];_0x45d62d+=0x1){let _0x3ececd=_0x149ea8[_0x4000('0x69')][_0x45d62d];var _0xdacb8d=_0x5844bf[_0x4000('0x7c')]();_0xdacb8d[_0x4000('0x40')]('ut.UserId\x20=\x20?',_0x3ececd['id']);_0x30dec4[_0x4000('0x7d')](db['sequelize'][_0x4000('0x35')](_0xdacb8d[_0x4000('0x7e')](),{'type':db['sequelize'][_0x4000('0x7f')][_0x4000('0x80')]})[_0x4000('0x26')](function(_0x4c3122){if(_0x4c3122['length']===0x1){return _0x3ececd['id'];}else{var _0x547250=_[_0x4000('0x81')](_[_0x4000('0x30')](_0x4c3122,_0x4000('0x82')),function(_0xc30920){return _[_0x4000('0x83')](_0x54aa9f,_0xc30920);});if(_0x547250){return _0x3ececd['id'];}}}));}}return BPromise['all'](_0x30dec4)[_0x4000('0x26')](function(_0x1ce7e3){_0xc7b4f7=_(_0xc7b4f7)['union'](_0x1ce7e3)[_0x4000('0x84')]()['value']();return db[_0x4000('0x45')]['find']({'where':{'id':_0x9b589c['params']['id']}})[_0x4000('0x26')](function(_0x1d7df3){return db[_0x4000('0x6c')]['transaction'](function(_0x218447){return _0x1d7df3[_0x4000('0x72')](_0x9b589c[_0x4000('0x35')]['ids'],{'transaction':_0x218447})['then'](function(){if(!_['isEmpty'](_0xc7b4f7)){return _0x1d7df3['removeAgents'](_0xc7b4f7,{'transaction':_0x218447});}})[_0x4000('0x26')](function(){_0xc7b4f7[_0x4000('0x85')](function(_0x417697){socket[_0x4000('0x70')]('userOpenchannelQueue:remove',{'UserId':_0x417697,'OpenchannelQueueId':_0x1d7df3['id']});});});});});});})['then'](respondWithStatusCode(_0x275b3c,null))['catch'](handleError(_0x275b3c,null));};exports[_0x4000('0x86')]=function(_0x114335,_0x117b4c,_0x4f9bef){return db[_0x4000('0x45')][_0x4000('0x52')]({'where':{'id':_0x114335[_0x4000('0x55')]['id']}})[_0x4000('0x26')](handleEntityNotFound(_0x117b4c,null))[_0x4000('0x26')](function(_0x1072e0){if(_0x1072e0){return _0x1072e0['addAgents'](_0x114335[_0x4000('0x4d')][_0x4000('0x67')],_[_0x4000('0x87')](_0x114335[_0x4000('0x4d')],[_0x4000('0x67'),'id'])||{})[_0x4000('0x88')](function(_0x1b3708){for(var _0x1729c9=0x0;_0x1729c9<_0x114335[_0x4000('0x4d')][_0x4000('0x67')]['length'];_0x1729c9+=0x1){socket['emit'](_0x4000('0x71'),{'UserId':Number(_0x114335['body']['ids'][_0x1729c9]),'OpenchannelQueueId':Number(_0x114335[_0x4000('0x55')]['id'])});}return _0x1b3708;});}})[_0x4000('0x26')](respondWithResult(_0x117b4c,null))[_0x4000('0x48')](handleError(_0x117b4c,null));};exports[_0x4000('0x89')]=function(_0x2219b2,_0x5b74a1,_0x24b7cd){return db[_0x4000('0x45')][_0x4000('0x52')]({'where':{'id':_0x2219b2['params']['id']}})[_0x4000('0x26')](handleEntityNotFound(_0x5b74a1,null))[_0x4000('0x26')](function(_0x3549da){if(_0x3549da){return _0x3549da[_0x4000('0x89')](_0x2219b2[_0x4000('0x35')][_0x4000('0x67')])[_0x4000('0x26')](function(){if(_[_0x4000('0x8a')](_0x2219b2[_0x4000('0x35')][_0x4000('0x67')])){for(var _0x3d08a1=0x0;_0x3d08a1<_0x2219b2[_0x4000('0x35')][_0x4000('0x67')][_0x4000('0x4a')];_0x3d08a1+=0x1){socket[_0x4000('0x70')](_0x4000('0x8b'),{'UserId':Number(_0x2219b2[_0x4000('0x35')]['ids'][_0x3d08a1]),'OpenchannelQueueId':Number(_0x2219b2['params']['id'])});}}else{socket['emit'](_0x4000('0x8b'),{'UserId':Number(_0x2219b2[_0x4000('0x35')]['ids']),'OpenchannelQueueId':Number(_0x2219b2[_0x4000('0x55')]['id'])});}});}})[_0x4000('0x26')](respondWithStatusCode(_0x5b74a1,null))[_0x4000('0x48')](handleError(_0x5b74a1,null));};exports[_0x4000('0x8c')]=function(_0x180f1c,_0x3721bf,_0x7528a4){var _0x7de333={};var _0x10fbf4={};var _0x19e271;var _0x571470;return db['OpenchannelQueue'][_0x4000('0x58')]({'where':{'id':_0x180f1c[_0x4000('0x55')]['id']}})[_0x4000('0x26')](handleEntityNotFound(_0x3721bf,null))[_0x4000('0x26')](function(_0x2dd5bb){if(_0x2dd5bb){_0x19e271=_0x2dd5bb;_0x10fbf4[_0x4000('0x34')]=_[_0x4000('0x36')](db[_0x4000('0x5b')]['rawAttributes']);_0x10fbf4[_0x4000('0x35')]=_[_0x4000('0x36')](_0x180f1c['query']);_0x10fbf4[_0x4000('0x37')]=_[_0x4000('0x38')](_0x10fbf4[_0x4000('0x34')],_0x10fbf4[_0x4000('0x35')]);_0x7de333[_0x4000('0x39')]=_[_0x4000('0x38')](_0x10fbf4[_0x4000('0x34')],qs[_0x4000('0x3a')](_0x180f1c[_0x4000('0x35')][_0x4000('0x3a')]));_0x7de333['attributes']=_0x7de333[_0x4000('0x39')][_0x4000('0x4a')]?_0x7de333[_0x4000('0x39')]:_0x10fbf4['model'];_0x7de333[_0x4000('0x3c')]=qs[_0x4000('0x3d')](_0x180f1c[_0x4000('0x35')][_0x4000('0x3d')]);_0x7de333['where']=qs[_0x4000('0x37')](_[_0x4000('0x3e')](_0x180f1c['query'],_0x10fbf4[_0x4000('0x37')]));if(_0x180f1c[_0x4000('0x35')][_0x4000('0x3f')]){_0x7de333['where']=_['merge'](_0x7de333[_0x4000('0x40')],{'$or':_[_0x4000('0x30')](_0x7de333[_0x4000('0x39')],function(_0x2ee645){var _0x3393d3={};_0x3393d3[_0x2ee645]={'$like':'%'+_0x180f1c[_0x4000('0x35')][_0x4000('0x3f')]+'%'};return _0x3393d3;})});}_0x7de333=_[_0x4000('0x43')]({},_0x7de333,_0x180f1c[_0x4000('0x44')]);return _0x19e271[_0x4000('0x8c')](_0x7de333);}})[_0x4000('0x26')](function(_0x4fc528){if(_0x4fc528){_0x571470=_0x4fc528['length'];if(!_0x180f1c['query'][_0x4000('0x5a')](_0x4000('0x3b'))){_0x7de333['limit']=qs['limit'](_0x180f1c[_0x4000('0x35')][_0x4000('0x1f')]);_0x7de333[_0x4000('0x21')]=qs['offset'](_0x180f1c[_0x4000('0x35')][_0x4000('0x21')]);}return _0x19e271[_0x4000('0x8c')](_0x7de333);}})[_0x4000('0x26')](function(_0x371a68){if(_0x371a68){return _0x371a68?{'count':_0x571470,'rows':_0x371a68}:null;}})[_0x4000('0x26')](respondWithResult(_0x3721bf,null))[_0x4000('0x48')](handleError(_0x3721bf,null));};
\ No newline at end of file
index c7d642d..a868b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1543=['events','../../mysqldb','setMaxListeners','update','emit','hook','exports'];(function(_0x51e844,_0x58d32a){var _0x5dd852=function(_0x5aa3e0){while(--_0x5aa3e0){_0x51e844['push'](_0x51e844['shift']());}};_0x5dd852(++_0x58d32a);}(_0x1543,0x1ce));var _0x3154=function(_0x25ebb5,_0x18f1c0){_0x25ebb5=_0x25ebb5-0x0;var _0x42cbc7=_0x1543[_0x25ebb5];return _0x42cbc7;};'use strict';var EventEmitter=require(_0x3154('0x0'));var OpenchannelQueue=require(_0x3154('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3154('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3154('0x3'),'afterDestroy':'remove'};function emitEvent(_0x449609){return function(_0x839e49,_0x5617c3,_0x45f23d){OpenchannelQueueEvents[_0x3154('0x4')](_0x449609+':'+_0x839e49['id'],_0x839e49);OpenchannelQueueEvents[_0x3154('0x4')](_0x449609,_0x839e49);_0x45f23d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x3154('0x5')](e,emitEvent(event));}}module[_0x3154('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x4a46=['remove','emit','hasOwnProperty','hook','events','setMaxListeners','update'];(function(_0x59cf22,_0x4e65d9){var _0x480d57=function(_0x70407b){while(--_0x70407b){_0x59cf22['push'](_0x59cf22['shift']());}};_0x480d57(++_0x4e65d9);}(_0x4a46,0xba));var _0x64a4=function(_0x1cff65,_0x2990df){_0x1cff65=_0x1cff65-0x0;var _0x2c88e7=_0x4a46[_0x1cff65];return _0x2c88e7;};'use strict';var EventEmitter=require(_0x64a4('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x64a4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x64a4('0x2'),'afterDestroy':_0x64a4('0x3')};function emitEvent(_0x48059b){return function(_0x12a0d7,_0x46a1a5,_0x275c4b){OpenchannelQueueEvents[_0x64a4('0x4')](_0x48059b+':'+_0x12a0d7['id'],_0x12a0d7);OpenchannelQueueEvents[_0x64a4('0x4')](_0x48059b,_0x12a0d7);_0x275c4b(null);};}for(var e in events){if(events[_0x64a4('0x5')](e)){var event=events[e];OpenchannelQueue[_0x64a4('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index 94018ce..d3dfe96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bf8=['bluebird','path','rimraf','../../config/environment','exports','define','openchannel_queues','util','../../config/logger','moment'];(function(_0x440d11,_0x4ab1b3){var _0x5a4859=function(_0x3e7f8c){while(--_0x3e7f8c){_0x440d11['push'](_0x440d11['shift']());}};_0x5a4859(++_0x4ab1b3);}(_0x0bf8,0x1ab));var _0x80bf=function(_0x593c1b,_0x35c524){_0x593c1b=_0x593c1b-0x0;var _0x4e0c07=_0x0bf8[_0x593c1b];return _0x4e0c07;};'use strict';var _=require('lodash');var util=require(_0x80bf('0x0'));var logger=require(_0x80bf('0x1'))('api');var moment=require(_0x80bf('0x2'));var BPromise=require(_0x80bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80bf('0x4'));var rimraf=require(_0x80bf('0x5'));var config=require(_0x80bf('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x80bf('0x7')]=function(_0x5723e0,_0x149401){return _0x5723e0[_0x80bf('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x80bf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2182=['OpenchannelQueue','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x245f3b,_0x5bb656){var _0x573d0e=function(_0x6313f0){while(--_0x6313f0){_0x245f3b['push'](_0x245f3b['shift']());}};_0x573d0e(++_0x5bb656);}(_0x2182,0x109));var _0x2218=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2182[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x2218('0x0'));var logger=require(_0x2218('0x1'))(_0x2218('0x2'));var moment=require(_0x2218('0x3'));var BPromise=require(_0x2218('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2218('0x5'));var rimraf=require(_0x2218('0x6'));var config=require(_0x2218('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0x2218('0x8')]=function(_0x4be881,_0xe2a979){return _0x4be881[_0x2218('0x9')](_0x2218('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 523ad53..21b61cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec4c=['info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then'];(function(_0x371db8,_0x16eacf){var _0x20cc85=function(_0x23b09){while(--_0x23b09){_0x371db8['push'](_0x371db8['shift']());}};_0x20cc85(++_0x16eacf);}(_0xec4c,0x8f));var _0xcec4=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xec4c[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xcec4('0x0'));var util=require('util');var moment=require(_0xcec4('0x1'));var BPromise=require(_0xcec4('0x2'));var rs=require(_0xcec4('0x3'));var fs=require('fs');var Redis=require(_0xcec4('0x4'));var db=require(_0xcec4('0x5'))['db'];var utils=require(_0xcec4('0x6'));var logger=require('../../config/logger')(_0xcec4('0x7'));var config=require(_0xcec4('0x8'));var jayson=require(_0xcec4('0x9'));var client=jayson['client'][_0xcec4('0xa')]({'port':0x232a});config[_0xcec4('0xb')]=_[_0xcec4('0xc')](config[_0xcec4('0xb')],{'host':_0xcec4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcec4('0xb')]));require('./openchannelQueue.socket')[_0xcec4('0xe')](socket);function respondWithRpcPromise(_0x1e8baa,_0x1d0485,_0x61b7ec){return new BPromise(function(_0x22bc28,_0x41f928){return client[_0xcec4('0xf')](_0x1e8baa,_0x61b7ec)[_0xcec4('0x10')](function(_0x37e34c){logger[_0xcec4('0x11')](_0xcec4('0x12'),_0x1d0485,_0xcec4('0x13'));logger[_0xcec4('0x14')](_0xcec4('0x15'),_0x1d0485,_0xcec4('0x13'),JSON['stringify'](_0x37e34c));if(_0x37e34c['error']){if(_0x37e34c[_0xcec4('0x16')][_0xcec4('0x17')]===0x1f4){logger[_0xcec4('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1d0485,_0x37e34c[_0xcec4('0x16')]['message']);return _0x41f928(_0x37e34c['error'][_0xcec4('0x18')]);}logger[_0xcec4('0x16')](_0xcec4('0x12'),_0x1d0485,_0x37e34c[_0xcec4('0x16')][_0xcec4('0x18')]);return _0x22bc28(_0x37e34c[_0xcec4('0x16')][_0xcec4('0x18')]);}else{logger[_0xcec4('0x11')](_0xcec4('0x12'),_0x1d0485,_0xcec4('0x13'));_0x22bc28(_0x37e34c[_0xcec4('0x19')]['message']);}})[_0xcec4('0x1a')](function(_0x25295c){logger[_0xcec4('0x16')](_0xcec4('0x12'),_0x1d0485,_0x25295c);_0x41f928(_0x25295c);});});}exports[_0xcec4('0x1b')]=function(_0x402571){var _0x59195c=this;return new Promise(function(_0x570699,_0x347a80){return db[_0xcec4('0x1c')]['findAll']({'raw':_0x402571['options']?_0x402571[_0xcec4('0x1d')][_0xcec4('0x1e')]===undefined?!![]:![]:!![],'where':_0x402571[_0xcec4('0x1d')]?_0x402571[_0xcec4('0x1d')][_0xcec4('0x1f')]||null:null,'attributes':_0x402571[_0xcec4('0x1d')]?_0x402571[_0xcec4('0x1d')][_0xcec4('0x20')]||null:null,'limit':_0x402571[_0xcec4('0x1d')]?_0x402571[_0xcec4('0x1d')][_0xcec4('0x21')]||null:null,'include':_0x402571[_0xcec4('0x1d')]?_0x402571['options'][_0xcec4('0x22')]?_[_0xcec4('0x23')](_0x402571['options'][_0xcec4('0x22')],function(_0x4e5fde){return{'model':db[_0x4e5fde[_0xcec4('0x24')]],'as':_0x4e5fde['as'],'attributes':_0x4e5fde['attributes'],'include':_0x4e5fde[_0xcec4('0x22')]?_['map'](_0x4e5fde['include'],function(_0x3803ce){return{'model':db[_0x3803ce[_0xcec4('0x24')]],'as':_0x3803ce['as'],'attributes':_0x3803ce[_0xcec4('0x20')],'include':_0x3803ce[_0xcec4('0x22')]?_[_0xcec4('0x23')](_0x3803ce['include'],function(_0x1d1cca){return{'model':db[_0x1d1cca[_0xcec4('0x24')]],'as':_0x1d1cca['as'],'attributes':_0x1d1cca[_0xcec4('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcec4('0x10')](function(_0xe08e69){logger[_0xcec4('0x11')](_0xcec4('0x1b'),_0x402571);logger[_0xcec4('0x14')](_0xcec4('0x1b'),_0x402571,JSON[_0xcec4('0x25')](_0xe08e69));_0x570699(_0xe08e69);})['catch'](function(_0x1ef769){logger['error'](_0xcec4('0x1b'),_0x1ef769[_0xcec4('0x18')],_0x402571);_0x347a80(_0x59195c['error'](0x1f4,_0x1ef769['message']));});});};exports['ShowOpenchannelQueue']=function(_0x1e21f){var _0x38a305=this;return new Promise(function(_0x244760,_0x5d14ce){return db[_0xcec4('0x1c')][_0xcec4('0x26')]({'raw':_0x1e21f[_0xcec4('0x1d')]?_0x1e21f[_0xcec4('0x1d')][_0xcec4('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e21f[_0xcec4('0x1d')]?_0x1e21f['options']['where']||null:null,'attributes':_0x1e21f[_0xcec4('0x1d')]?_0x1e21f[_0xcec4('0x1d')][_0xcec4('0x20')]||null:null,'include':_0x1e21f[_0xcec4('0x1d')]?_0x1e21f[_0xcec4('0x1d')][_0xcec4('0x22')]?_[_0xcec4('0x23')](_0x1e21f[_0xcec4('0x1d')]['include'],function(_0x515b7a){return{'model':db[_0x515b7a['model']],'as':_0x515b7a['as'],'attributes':_0x515b7a[_0xcec4('0x20')],'include':_0x515b7a[_0xcec4('0x22')]?_[_0xcec4('0x23')](_0x515b7a['include'],function(_0x803098){return{'model':db[_0x803098[_0xcec4('0x24')]],'as':_0x803098['as'],'attributes':_0x803098['attributes'],'include':_0x803098[_0xcec4('0x22')]?_[_0xcec4('0x23')](_0x803098[_0xcec4('0x22')],function(_0x430061){return{'model':db[_0x430061[_0xcec4('0x24')]],'as':_0x430061['as'],'attributes':_0x430061['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21fe71){logger[_0xcec4('0x11')]('ShowOpenchannelQueue',_0x1e21f);logger['debug'](_0xcec4('0x27'),_0x1e21f,JSON['stringify'](_0x21fe71));_0x244760(_0x21fe71);})['catch'](function(_0x212eba){logger[_0xcec4('0x16')](_0xcec4('0x27'),_0x212eba[_0xcec4('0x18')],_0x1e21f);_0x5d14ce(_0x38a305[_0xcec4('0x16')](0x1f4,_0x212eba[_0xcec4('0x18')]));});});};
\ No newline at end of file
+var _0x2cd0=['request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','attributes','limit','include','map','model','find','where','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','./openchannelQueue.socket','register','request','then','info'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x2cd0,0xf9));var _0x02cd=function(_0x32e735,_0x518b99){_0x32e735=_0x32e735-0x0;var _0x4b8029=_0x2cd0[_0x32e735];return _0x4b8029;};'use strict';var _=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var moment=require(_0x02cd('0x2'));var BPromise=require('bluebird');var rs=require(_0x02cd('0x3'));var fs=require('fs');var Redis=require(_0x02cd('0x4'));var db=require(_0x02cd('0x5'))['db'];var utils=require(_0x02cd('0x6'));var logger=require(_0x02cd('0x7'))('rpc');var config=require(_0x02cd('0x8'));var jayson=require(_0x02cd('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x02cd('0xa')]=_['defaults'](config[_0x02cd('0xa')],{'host':_0x02cd('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02cd('0xa')]));require(_0x02cd('0xc'))[_0x02cd('0xd')](socket);function respondWithRpcPromise(_0x3c4b10,_0x362dcc,_0x14ce00){return new BPromise(function(_0x294f58,_0xce8ff6){return client[_0x02cd('0xe')](_0x3c4b10,_0x14ce00)[_0x02cd('0xf')](function(_0x43e066){logger[_0x02cd('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x362dcc,_0x02cd('0x11'));logger[_0x02cd('0x12')](_0x02cd('0x13'),_0x362dcc,_0x02cd('0x11'),JSON[_0x02cd('0x14')](_0x43e066));if(_0x43e066[_0x02cd('0x15')]){if(_0x43e066[_0x02cd('0x15')]['code']===0x1f4){logger[_0x02cd('0x15')](_0x02cd('0x16'),_0x362dcc,_0x43e066[_0x02cd('0x15')]['message']);return _0xce8ff6(_0x43e066['error'][_0x02cd('0x17')]);}logger[_0x02cd('0x15')](_0x02cd('0x16'),_0x362dcc,_0x43e066[_0x02cd('0x15')]['message']);return _0x294f58(_0x43e066['error'][_0x02cd('0x17')]);}else{logger[_0x02cd('0x10')](_0x02cd('0x16'),_0x362dcc,_0x02cd('0x11'));_0x294f58(_0x43e066[_0x02cd('0x18')][_0x02cd('0x17')]);}})[_0x02cd('0x19')](function(_0x424e17){logger[_0x02cd('0x15')](_0x02cd('0x16'),_0x362dcc,_0x424e17);_0xce8ff6(_0x424e17);});});}exports[_0x02cd('0x1a')]=function(_0x14d325){var _0xed60f3=this;return new Promise(function(_0x55d07c,_0x359cf0){return db[_0x02cd('0x1b')]['findAll']({'raw':_0x14d325[_0x02cd('0x1c')]?_0x14d325[_0x02cd('0x1c')][_0x02cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x14d325['options']?_0x14d325[_0x02cd('0x1c')]['where']||null:null,'attributes':_0x14d325[_0x02cd('0x1c')]?_0x14d325[_0x02cd('0x1c')][_0x02cd('0x1e')]||null:null,'limit':_0x14d325[_0x02cd('0x1c')]?_0x14d325[_0x02cd('0x1c')][_0x02cd('0x1f')]||null:null,'include':_0x14d325['options']?_0x14d325[_0x02cd('0x1c')][_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x14d325[_0x02cd('0x1c')]['include'],function(_0x3da454){return{'model':db[_0x3da454[_0x02cd('0x22')]],'as':_0x3da454['as'],'attributes':_0x3da454[_0x02cd('0x1e')],'include':_0x3da454[_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x3da454['include'],function(_0x57eb30){return{'model':db[_0x57eb30['model']],'as':_0x57eb30['as'],'attributes':_0x57eb30[_0x02cd('0x1e')],'include':_0x57eb30[_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x57eb30[_0x02cd('0x20')],function(_0x2d6713){return{'model':db[_0x2d6713[_0x02cd('0x22')]],'as':_0x2d6713['as'],'attributes':_0x2d6713[_0x02cd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02cd('0xf')](function(_0x342aa9){logger[_0x02cd('0x10')]('GetOpenchannelQueue',_0x14d325);logger[_0x02cd('0x12')](_0x02cd('0x1a'),_0x14d325,JSON[_0x02cd('0x14')](_0x342aa9));_0x55d07c(_0x342aa9);})[_0x02cd('0x19')](function(_0x133495){logger[_0x02cd('0x15')](_0x02cd('0x1a'),_0x133495['message'],_0x14d325);_0x359cf0(_0xed60f3[_0x02cd('0x15')](0x1f4,_0x133495[_0x02cd('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x17c58c){var _0x4d21cb=this;return new Promise(function(_0x16dbb7,_0x4bb88d){return db[_0x02cd('0x1b')][_0x02cd('0x23')]({'raw':_0x17c58c[_0x02cd('0x1c')]?_0x17c58c[_0x02cd('0x1c')][_0x02cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x17c58c[_0x02cd('0x1c')]?_0x17c58c['options'][_0x02cd('0x24')]||null:null,'attributes':_0x17c58c[_0x02cd('0x1c')]?_0x17c58c[_0x02cd('0x1c')][_0x02cd('0x1e')]||null:null,'include':_0x17c58c[_0x02cd('0x1c')]?_0x17c58c[_0x02cd('0x1c')]['include']?_[_0x02cd('0x21')](_0x17c58c[_0x02cd('0x1c')][_0x02cd('0x20')],function(_0x4e8560){return{'model':db[_0x4e8560[_0x02cd('0x22')]],'as':_0x4e8560['as'],'attributes':_0x4e8560[_0x02cd('0x1e')],'include':_0x4e8560[_0x02cd('0x20')]?_[_0x02cd('0x21')](_0x4e8560[_0x02cd('0x20')],function(_0x598dc6){return{'model':db[_0x598dc6[_0x02cd('0x22')]],'as':_0x598dc6['as'],'attributes':_0x598dc6[_0x02cd('0x1e')],'include':_0x598dc6[_0x02cd('0x20')]?_['map'](_0x598dc6['include'],function(_0x430779){return{'model':db[_0x430779[_0x02cd('0x22')]],'as':_0x430779['as'],'attributes':_0x430779[_0x02cd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x02cd('0xf')](function(_0x2ccc8a){logger[_0x02cd('0x10')](_0x02cd('0x25'),_0x17c58c);logger['debug'](_0x02cd('0x25'),_0x17c58c,JSON[_0x02cd('0x14')](_0x2ccc8a));_0x16dbb7(_0x2ccc8a);})['catch'](function(_0x2df5d6){logger[_0x02cd('0x15')](_0x02cd('0x25'),_0x2df5d6[_0x02cd('0x17')],_0x17c58c);_0x4bb88d(_0x4d21cb['error'](0x1f4,_0x2df5d6[_0x02cd('0x17')]));});});};
\ No newline at end of file
index a14e8cd..a90d76e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5837=['update','emit','removeListener','length','openchannelQueue:','save','remove'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x5837,0x16a));var _0x7583=function(_0x39c084,_0xbc0456){_0x39c084=_0x39c084-0x0;var _0x5e6575=_0x5837[_0x39c084];return _0x5e6575;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x7583('0x0'),_0x7583('0x1'),_0x7583('0x2')];function createListener(_0x58ae22,_0x410acf){return function(_0x3c5f06){_0x410acf[_0x7583('0x3')](_0x58ae22,_0x3c5f06);};}function removeListener(_0x284102,_0x5ac3cf){return function(){OpenchannelQueueEvents[_0x7583('0x4')](_0x284102,_0x5ac3cf);};}exports['register']=function(_0x1f8ee3){for(var _0x3d5e4c=0x0,_0x1b0d0b=events[_0x7583('0x5')];_0x3d5e4c<_0x1b0d0b;_0x3d5e4c++){var _0x335f25=events[_0x3d5e4c];var _0x1a6eeb=createListener(_0x7583('0x6')+_0x335f25,_0x1f8ee3);OpenchannelQueueEvents['on'](_0x335f25,_0x1a6eeb);}};
\ No newline at end of file
+var _0x09cf=['save','remove','emit','register','length','./openchannelQueue.events'];(function(_0x3fc057,_0x4ac466){var _0x2abc4c=function(_0x1df6d4){while(--_0x1df6d4){_0x3fc057['push'](_0x3fc057['shift']());}};_0x2abc4c(++_0x4ac466);}(_0x09cf,0xbf));var _0xf09c=function(_0x4b7f0c,_0x431253){_0x4b7f0c=_0x4b7f0c-0x0;var _0x3f1a05=_0x09cf[_0x4b7f0c];return _0x3f1a05;};'use strict';var OpenchannelQueueEvents=require(_0xf09c('0x0'));var events=[_0xf09c('0x1'),_0xf09c('0x2'),'update'];function createListener(_0xfd317d,_0x43a2b9){return function(_0x3f651c){_0x43a2b9[_0xf09c('0x3')](_0xfd317d,_0x3f651c);};}function removeListener(_0x1c693a,_0xf7a300){return function(){OpenchannelQueueEvents['removeListener'](_0x1c693a,_0xf7a300);};}exports[_0xf09c('0x4')]=function(_0x51712d){for(var _0x148bed=0x0,_0x308c2b=events[_0xf09c('0x5')];_0x148bed<_0x308c2b;_0x148bed++){var _0x85011a=events[_0x148bed];var _0x2545ae=createListener('openchannelQueue:'+_0x85011a,_0x51712d);OpenchannelQueueEvents['on'](_0x85011a,_0x2545ae);}};
\ No newline at end of file
index 8460b78..4d24eb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bbd=['delete','destroy','multer','util','path','connect-timeout','express','Router','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update'];(function(_0x5f4c9b,_0x61bc){var _0x5eabde=function(_0x29ef79){while(--_0x29ef79){_0x5f4c9b['push'](_0x5f4c9b['shift']());}};_0x5eabde(++_0x61bc);}(_0x1bbd,0xec));var _0xd1bb=function(_0x156b1b,_0x107157){_0x156b1b=_0x156b1b-0x0;var _0x5018e8=_0x1bbd[_0x156b1b];return _0x5018e8;};'use strict';var multer=require(_0xd1bb('0x0'));var util=require(_0xd1bb('0x1'));var path=require(_0xd1bb('0x2'));var timeout=require(_0xd1bb('0x3'));var express=require(_0xd1bb('0x4'));var router=express[_0xd1bb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1bb('0x6'));router[_0xd1bb('0x7')]('/',auth[_0xd1bb('0x8')](),controller[_0xd1bb('0x9')]);router[_0xd1bb('0x7')](_0xd1bb('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd1bb('0x7')]('/:id',auth[_0xd1bb('0x8')](),controller[_0xd1bb('0xb')]);router[_0xd1bb('0xc')]('/',auth['isAuthenticated'](),controller[_0xd1bb('0xd')]);router['put'](_0xd1bb('0xe'),auth['isAuthenticated'](),controller[_0xd1bb('0xf')]);router[_0xd1bb('0x10')](_0xd1bb('0xe'),auth['isAuthenticated'](),controller[_0xd1bb('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x793a=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x793a,0x1c9));var _0xa793=function(_0x22cd4d,_0x688b8){_0x22cd4d=_0x22cd4d-0x0;var _0x41adc=_0x793a[_0x22cd4d];return _0x41adc;};'use strict';var multer=require(_0xa793('0x0'));var util=require(_0xa793('0x1'));var path=require(_0xa793('0x2'));var timeout=require(_0xa793('0x3'));var express=require(_0xa793('0x4'));var router=express['Router']();var fs_extra=require(_0xa793('0x5'));var auth=require(_0xa793('0x6'));var interaction=require(_0xa793('0x7'));var config=require(_0xa793('0x8'));var controller=require(_0xa793('0x9'));router[_0xa793('0xa')]('/',auth[_0xa793('0xb')](),controller[_0xa793('0xc')]);router[_0xa793('0xa')](_0xa793('0xd'),auth[_0xa793('0xb')](),controller[_0xa793('0xe')]);router[_0xa793('0xa')]('/:id',auth[_0xa793('0xb')](),controller[_0xa793('0xf')]);router['post']('/',auth[_0xa793('0xb')](),controller[_0xa793('0x10')]);router[_0xa793('0x11')](_0xa793('0x12'),auth[_0xa793('0xb')](),controller[_0xa793('0x13')]);router[_0xa793('0x14')](_0xa793('0x12'),auth[_0xa793('0xb')](),controller[_0xa793('0x15')]);module[_0xa793('0x16')]=router;
\ No newline at end of file
index c654516..2de4e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff4=['DATE','moment','sequelize','exports','STRING'];(function(_0x159765,_0x288667){var _0x36aadb=function(_0x420e6f){while(--_0x420e6f){_0x159765['push'](_0x159765['shift']());}};_0x36aadb(++_0x288667);}(_0xcff4,0x11e));var _0x4cff=function(_0x4fd2d2,_0x329b0f){_0x4fd2d2=_0x4fd2d2-0x0;var _0x1b9f0d=_0xcff4[_0x4fd2d2];return _0x1b9f0d;};'use strict';var moment=require(_0x4cff('0x0'));var Sequelize=require(_0x4cff('0x1'));module[_0x4cff('0x2')]={'uniqueid':{'type':Sequelize[_0x4cff('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4cff('0x3')]},'joinAt':{'type':Sequelize[_0x4cff('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4cff('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4cff('0x3')]}};
\ No newline at end of file
+var _0x60fd=['sequelize','exports','DATE','STRING'];(function(_0x6ffdb6,_0x279456){var _0x18a56b=function(_0x1d9108){while(--_0x1d9108){_0x6ffdb6['push'](_0x6ffdb6['shift']());}};_0x18a56b(++_0x279456);}(_0x60fd,0xf8));var _0xd60f=function(_0x5ee76c,_0x39cdae){_0x5ee76c=_0x5ee76c-0x0;var _0x5ddc1f=_0x60fd[_0x5ee76c];return _0x5ddc1f;};'use strict';var moment=require('moment');var Sequelize=require(_0xd60f('0x0'));module[_0xd60f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd60f('0x2')]},'leaveAt':{'type':Sequelize[_0xd60f('0x2')]},'acceptAt':{'type':Sequelize[_0xd60f('0x2')]},'exitAt':{'type':Sequelize[_0xd60f('0x2')]},'reason':{'type':Sequelize[_0xd60f('0x3')]}};
\ No newline at end of file
index 18c1bf4..bfa7b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e1b=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','count','set','json','apply','reject','then','destroy','stack','name','map','OpenchannelQueueReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','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','api'];(function(_0x439205,_0x4531e4){var _0xb18d9b=function(_0x499873){while(--_0x499873){_0x439205['push'](_0x439205['shift']());}};_0xb18d9b(++_0x4531e4);}(_0x4e1b,0x109));var _0xb4e1=function(_0x31fcda,_0x3433fe){_0x31fcda=_0x31fcda-0x0;var _0x45e7ea=_0x4e1b[_0x31fcda];return _0x45e7ea;};'use strict';var emlformat=require(_0xb4e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb4e1('0x1'));var jsonpatch=require(_0xb4e1('0x2'));var rp=require(_0xb4e1('0x3'));var moment=require(_0xb4e1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4e1('0x5'));var util=require(_0xb4e1('0x6'));var path=require(_0xb4e1('0x7'));var sox=require(_0xb4e1('0x8'));var csv=require('to-csv');var ejs=require(_0xb4e1('0x9'));var fs=require('fs');var fs_extra=require(_0xb4e1('0xa'));var _=require(_0xb4e1('0xb'));var squel=require(_0xb4e1('0xc'));var crypto=require(_0xb4e1('0xd'));var jsforce=require(_0xb4e1('0xe'));var deskjs=require(_0xb4e1('0xf'));var toCsv=require(_0xb4e1('0x10'));var querystring=require(_0xb4e1('0x11'));var Papa=require(_0xb4e1('0x12'));var Redis=require(_0xb4e1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb4e1('0x14'));var as=require(_0xb4e1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb4e1('0x16'));var utils=require(_0xb4e1('0x17'));var config=require(_0xb4e1('0x18'));var licenseUtil=require(_0xb4e1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x32db38,_0x30a7f7){_0x30a7f7=_0x30a7f7||0xcc;return function(_0x112ab2){if(_0x112ab2){return _0x32db38[_0xb4e1('0x1a')](_0x30a7f7);}return _0x32db38['status'](_0x30a7f7)[_0xb4e1('0x1b')]();};}function respondWithResult(_0x377ddb,_0x5d27f0){_0x5d27f0=_0x5d27f0||0xc8;return function(_0x38ff67){if(_0x38ff67){return _0x377ddb[_0xb4e1('0x1c')](_0x5d27f0)['json'](_0x38ff67);}};}function respondWithFilteredResult(_0x1dda7f,_0x45b46a){return function(_0x2d55dd){if(_0x2d55dd){var _0x2bdc47=typeof _0x45b46a[_0xb4e1('0x1d')]==='undefined'&&typeof _0x45b46a[_0xb4e1('0x1e')]==='undefined';var _0x32c910=_0x2d55dd[_0xb4e1('0x1f')];var _0x33e495=_0x2bdc47?0x0:_0x45b46a['offset'];var _0x5a7300=_0x2bdc47?_0x2d55dd[_0xb4e1('0x1f')]:_0x45b46a[_0xb4e1('0x1d')]+_0x45b46a['limit'];var _0x3749b9;if(_0x5a7300>=_0x32c910){_0x5a7300=_0x32c910;_0x3749b9=0xc8;}else{_0x3749b9=0xce;}_0x1dda7f['status'](_0x3749b9);return _0x1dda7f[_0xb4e1('0x20')]('Content-Range',_0x33e495+'-'+_0x5a7300+'/'+_0x32c910)[_0xb4e1('0x21')](_0x2d55dd);}return null;};}function patchUpdates(_0x47557c){return function(_0xda055){try{jsonpatch[_0xb4e1('0x22')](_0xda055,_0x47557c,!![]);}catch(_0x25e86c){return BPromise[_0xb4e1('0x23')](_0x25e86c);}return _0xda055['save']();};}function saveUpdates(_0x49d065,_0x1c4caf){return function(_0x2b8da6){if(_0x2b8da6){return _0x2b8da6['update'](_0x49d065)[_0xb4e1('0x24')](function(_0x29f702){return _0x29f702;});}return null;};}function removeEntity(_0x3ad1d9,_0x1dc9f2){return function(_0x318636){if(_0x318636){return _0x318636[_0xb4e1('0x25')]()[_0xb4e1('0x24')](function(){_0x3ad1d9[_0xb4e1('0x1c')](0xcc)[_0xb4e1('0x1b')]();});}};}function handleEntityNotFound(_0x4389d0,_0x34ff7c){return function(_0x2da573){if(!_0x2da573){_0x4389d0[_0xb4e1('0x1a')](0x194);}return _0x2da573;};}function handleError(_0x5be558,_0x2a036d){_0x2a036d=_0x2a036d||0x1f4;return function(_0x5c52eb){logger['error'](_0x5c52eb[_0xb4e1('0x26')]);if(_0x5c52eb[_0xb4e1('0x27')]){delete _0x5c52eb[_0xb4e1('0x27')];}_0x5be558[_0xb4e1('0x1c')](_0x2a036d)['send'](_0x5c52eb);};}exports['index']=function(_0x49f2af,_0x9a2100){var _0x53c78c={},_0x3cbc6a={},_0x3829c6={'count':0x0,'rows':[]};var _0x27e0c8=_[_0xb4e1('0x28')](db[_0xb4e1('0x29')]['rawAttributes'],function(_0x18ffcd){return{'name':_0x18ffcd[_0xb4e1('0x2a')],'type':_0x18ffcd[_0xb4e1('0x2b')]['key']};});_0x3cbc6a[_0xb4e1('0x2c')]=_[_0xb4e1('0x28')](_0x27e0c8,'name');_0x3cbc6a[_0xb4e1('0x2d')]=_[_0xb4e1('0x2e')](_0x49f2af[_0xb4e1('0x2d')]);_0x3cbc6a['filters']=_[_0xb4e1('0x2f')](_0x3cbc6a['model'],_0x3cbc6a[_0xb4e1('0x2d')]);_0x53c78c[_0xb4e1('0x30')]=_[_0xb4e1('0x2f')](_0x3cbc6a[_0xb4e1('0x2c')],qs[_0xb4e1('0x31')](_0x49f2af[_0xb4e1('0x2d')][_0xb4e1('0x31')]));_0x53c78c[_0xb4e1('0x30')]=_0x53c78c[_0xb4e1('0x30')][_0xb4e1('0x32')]?_0x53c78c['attributes']:_0x3cbc6a[_0xb4e1('0x2c')];if(!_0x49f2af[_0xb4e1('0x2d')][_0xb4e1('0x33')](_0xb4e1('0x34'))){_0x53c78c[_0xb4e1('0x1e')]=qs['limit'](_0x49f2af['query']['limit']);_0x53c78c['offset']=qs['offset'](_0x49f2af[_0xb4e1('0x2d')]['offset']);}_0x53c78c[_0xb4e1('0x35')]=qs['sort'](_0x49f2af[_0xb4e1('0x2d')]['sort']);_0x53c78c[_0xb4e1('0x36')]=qs[_0xb4e1('0x37')](_[_0xb4e1('0x38')](_0x49f2af[_0xb4e1('0x2d')],_0x3cbc6a['filters']),_0x27e0c8);if(_0x49f2af['query']['filter']){_0x53c78c[_0xb4e1('0x36')]=_[_0xb4e1('0x39')](_0x53c78c[_0xb4e1('0x36')],{'$or':_[_0xb4e1('0x28')](_0x27e0c8,function(_0x22333b){if(_0x22333b[_0xb4e1('0x2b')]!==_0xb4e1('0x3a')){var _0x48e353={};_0x48e353[_0x22333b[_0xb4e1('0x27')]]={'$like':'%'+_0x49f2af['query'][_0xb4e1('0x3b')]+'%'};return _0x48e353;}})});}_0x53c78c=_[_0xb4e1('0x39')]({},_0x53c78c,_0x49f2af[_0xb4e1('0x3c')]);var _0x2f6f34={'where':_0x53c78c['where']};return db['OpenchannelQueueReport']['count'](_0x2f6f34)['then'](function(_0x300451){_0x3829c6['count']=_0x300451;if(_0x49f2af[_0xb4e1('0x2d')][_0xb4e1('0x3d')]){_0x53c78c[_0xb4e1('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xb4e1('0x3f')](_0x53c78c);})[_0xb4e1('0x24')](function(_0x4c3e9a){_0x3829c6['rows']=_0x4c3e9a;return _0x3829c6;})['then'](respondWithFilteredResult(_0x9a2100,_0x53c78c))['catch'](handleError(_0x9a2100,null));};exports[_0xb4e1('0x40')]=function(_0x3a6ce4,_0x5975b3){var _0x28a6ae={'raw':!![],'where':{'id':_0x3a6ce4[_0xb4e1('0x41')]['id']}},_0x4c21b1={};_0x4c21b1[_0xb4e1('0x2c')]=_[_0xb4e1('0x2e')](db[_0xb4e1('0x29')]['rawAttributes']);_0x4c21b1[_0xb4e1('0x2d')]=_[_0xb4e1('0x2e')](_0x3a6ce4[_0xb4e1('0x2d')]);_0x4c21b1['filters']=_[_0xb4e1('0x2f')](_0x4c21b1[_0xb4e1('0x2c')],_0x4c21b1[_0xb4e1('0x2d')]);_0x28a6ae['attributes']=_['intersection'](_0x4c21b1['model'],qs['fields'](_0x3a6ce4[_0xb4e1('0x2d')]['fields']));_0x28a6ae['attributes']=_0x28a6ae[_0xb4e1('0x30')][_0xb4e1('0x32')]?_0x28a6ae[_0xb4e1('0x30')]:_0x4c21b1['model'];if(_0x3a6ce4[_0xb4e1('0x2d')][_0xb4e1('0x3d')]){_0x28a6ae[_0xb4e1('0x3e')]=[{'all':!![]}];}_0x28a6ae=_['merge']({},_0x28a6ae,_0x3a6ce4[_0xb4e1('0x3c')]);return db[_0xb4e1('0x29')][_0xb4e1('0x42')](_0x28a6ae)[_0xb4e1('0x24')](handleEntityNotFound(_0x5975b3,null))[_0xb4e1('0x24')](respondWithResult(_0x5975b3,null))[_0xb4e1('0x43')](handleError(_0x5975b3,null));};exports[_0xb4e1('0x44')]=function(_0x23b08f,_0x15ff47){return db[_0xb4e1('0x29')][_0xb4e1('0x44')](_0x23b08f[_0xb4e1('0x45')],{})[_0xb4e1('0x24')](respondWithResult(_0x15ff47,0xc9))[_0xb4e1('0x43')](handleError(_0x15ff47,null));};exports[_0xb4e1('0x46')]=function(_0x348d77,_0x3909f0){if(_0x348d77[_0xb4e1('0x45')]['id']){delete _0x348d77[_0xb4e1('0x45')]['id'];}return db[_0xb4e1('0x29')][_0xb4e1('0x42')]({'where':{'id':_0x348d77['params']['id']}})[_0xb4e1('0x24')](handleEntityNotFound(_0x3909f0,null))['then'](saveUpdates(_0x348d77[_0xb4e1('0x45')],null))[_0xb4e1('0x24')](respondWithResult(_0x3909f0,null))[_0xb4e1('0x43')](handleError(_0x3909f0,null));};exports[_0xb4e1('0x25')]=function(_0xd23f5a,_0x22e08f){return db[_0xb4e1('0x29')][_0xb4e1('0x42')]({'where':{'id':_0xd23f5a[_0xb4e1('0x41')]['id']}})[_0xb4e1('0x24')](handleEntityNotFound(_0x22e08f,null))[_0xb4e1('0x24')](removeEntity(_0x22e08f,null))[_0xb4e1('0x43')](handleError(_0x22e08f,null));};exports['describe']=function(_0x4aa413,_0x32dfe7){return db[_0xb4e1('0x29')][_0xb4e1('0x47')]()[_0xb4e1('0x24')](respondWithResult(_0x32dfe7,null))[_0xb4e1('0x43')](handleError(_0x32dfe7,null));};
\ No newline at end of file
+var _0x6d80=['index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','OpenchannelQueueReport','findAll','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','name'];(function(_0x23266e,_0x3647e2){var _0x55c2b6=function(_0x32afd4){while(--_0x32afd4){_0x23266e['push'](_0x23266e['shift']());}};_0x55c2b6(++_0x3647e2);}(_0x6d80,0x1c3));var _0x06d8=function(_0x1db3fd,_0x2fa630){_0x1db3fd=_0x1db3fd-0x0;var _0x17f282=_0x6d80[_0x1db3fd];return _0x17f282;};'use strict';var emlformat=require(_0x06d8('0x0'));var rimraf=require(_0x06d8('0x1'));var zipdir=require(_0x06d8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x06d8('0x3'));var Mustache=require(_0x06d8('0x4'));var util=require(_0x06d8('0x5'));var path=require('path');var sox=require(_0x06d8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x06d8('0x7'));var _=require(_0x06d8('0x8'));var squel=require('squel');var crypto=require(_0x06d8('0x9'));var jsforce=require(_0x06d8('0xa'));var deskjs=require(_0x06d8('0xb'));var toCsv=require(_0x06d8('0xc'));var querystring=require(_0x06d8('0xd'));var Papa=require(_0x06d8('0xe'));var Redis=require(_0x06d8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x06d8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06d8('0x11'));var logger=require(_0x06d8('0x12'))(_0x06d8('0x13'));var utils=require('../../config/utils');var config=require(_0x06d8('0x14'));var licenseUtil=require(_0x06d8('0x15'));var db=require(_0x06d8('0x16'))['db'];function respondWithStatusCode(_0x2d9789,_0x9f08e7){_0x9f08e7=_0x9f08e7||0xcc;return function(_0x3768e7){if(_0x3768e7){return _0x2d9789[_0x06d8('0x17')](_0x9f08e7);}return _0x2d9789['status'](_0x9f08e7)[_0x06d8('0x18')]();};}function respondWithResult(_0x51bb45,_0x163a5f){_0x163a5f=_0x163a5f||0xc8;return function(_0xd2e076){if(_0xd2e076){return _0x51bb45[_0x06d8('0x19')](_0x163a5f)[_0x06d8('0x1a')](_0xd2e076);}};}function respondWithFilteredResult(_0x4d7516,_0xa483a){return function(_0x22f45a){if(_0x22f45a){var _0x269d92=typeof _0xa483a[_0x06d8('0x1b')]===_0x06d8('0x1c')&&typeof _0xa483a[_0x06d8('0x1d')]===_0x06d8('0x1c');var _0xc6d939=_0x22f45a[_0x06d8('0x1e')];var _0x24ce14=_0x269d92?0x0:_0xa483a['offset'];var _0x282ece=_0x269d92?_0x22f45a[_0x06d8('0x1e')]:_0xa483a[_0x06d8('0x1b')]+_0xa483a['limit'];var _0x165830;if(_0x282ece>=_0xc6d939){_0x282ece=_0xc6d939;_0x165830=0xc8;}else{_0x165830=0xce;}_0x4d7516[_0x06d8('0x19')](_0x165830);return _0x4d7516['set'](_0x06d8('0x1f'),_0x24ce14+'-'+_0x282ece+'/'+_0xc6d939)['json'](_0x22f45a);}return null;};}function patchUpdates(_0x3462f4){return function(_0x195c46){try{jsonpatch[_0x06d8('0x20')](_0x195c46,_0x3462f4,!![]);}catch(_0xdf83bc){return BPromise['reject'](_0xdf83bc);}return _0x195c46[_0x06d8('0x21')]();};}function saveUpdates(_0x563d37,_0x1802a7){return function(_0x546c1e){if(_0x546c1e){return _0x546c1e[_0x06d8('0x22')](_0x563d37)[_0x06d8('0x23')](function(_0x4c8ca8){return _0x4c8ca8;});}return null;};}function removeEntity(_0x351629,_0x28ada2){return function(_0x56b215){if(_0x56b215){return _0x56b215[_0x06d8('0x24')]()[_0x06d8('0x23')](function(){_0x351629[_0x06d8('0x19')](0xcc)[_0x06d8('0x18')]();});}};}function handleEntityNotFound(_0x280013,_0xeb0d60){return function(_0x4ab688){if(!_0x4ab688){_0x280013[_0x06d8('0x17')](0x194);}return _0x4ab688;};}function handleError(_0x27125d,_0x1af579){_0x1af579=_0x1af579||0x1f4;return function(_0x319398){logger[_0x06d8('0x25')](_0x319398['stack']);if(_0x319398[_0x06d8('0x26')]){delete _0x319398[_0x06d8('0x26')];}_0x27125d[_0x06d8('0x19')](_0x1af579)['send'](_0x319398);};}exports[_0x06d8('0x27')]=function(_0x521b71,_0x1e8246){var _0x414a45={},_0x5d2572={},_0x121d28={'count':0x0,'rows':[]};var _0x289a57=_[_0x06d8('0x28')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x46d150){return{'name':_0x46d150['fieldName'],'type':_0x46d150[_0x06d8('0x29')][_0x06d8('0x2a')]};});_0x5d2572[_0x06d8('0x2b')]=_[_0x06d8('0x28')](_0x289a57,_0x06d8('0x26'));_0x5d2572[_0x06d8('0x2c')]=_[_0x06d8('0x2d')](_0x521b71[_0x06d8('0x2c')]);_0x5d2572[_0x06d8('0x2e')]=_[_0x06d8('0x2f')](_0x5d2572[_0x06d8('0x2b')],_0x5d2572['query']);_0x414a45[_0x06d8('0x30')]=_[_0x06d8('0x2f')](_0x5d2572['model'],qs[_0x06d8('0x31')](_0x521b71[_0x06d8('0x2c')][_0x06d8('0x31')]));_0x414a45[_0x06d8('0x30')]=_0x414a45[_0x06d8('0x30')][_0x06d8('0x32')]?_0x414a45['attributes']:_0x5d2572[_0x06d8('0x2b')];if(!_0x521b71[_0x06d8('0x2c')][_0x06d8('0x33')](_0x06d8('0x34'))){_0x414a45[_0x06d8('0x1d')]=qs[_0x06d8('0x1d')](_0x521b71['query'][_0x06d8('0x1d')]);_0x414a45['offset']=qs['offset'](_0x521b71[_0x06d8('0x2c')][_0x06d8('0x1b')]);}_0x414a45[_0x06d8('0x35')]=qs['sort'](_0x521b71[_0x06d8('0x2c')][_0x06d8('0x36')]);_0x414a45[_0x06d8('0x37')]=qs[_0x06d8('0x2e')](_[_0x06d8('0x38')](_0x521b71['query'],_0x5d2572[_0x06d8('0x2e')]),_0x289a57);if(_0x521b71[_0x06d8('0x2c')][_0x06d8('0x39')]){_0x414a45[_0x06d8('0x37')]=_['merge'](_0x414a45[_0x06d8('0x37')],{'$or':_['map'](_0x289a57,function(_0x5bda93){if(_0x5bda93[_0x06d8('0x29')]!=='VIRTUAL'){var _0x4206c9={};_0x4206c9[_0x5bda93[_0x06d8('0x26')]]={'$like':'%'+_0x521b71[_0x06d8('0x2c')][_0x06d8('0x39')]+'%'};return _0x4206c9;}})});}_0x414a45=_[_0x06d8('0x3a')]({},_0x414a45,_0x521b71['options']);var _0x461e1d={'where':_0x414a45['where']};return db['OpenchannelQueueReport']['count'](_0x461e1d)[_0x06d8('0x23')](function(_0x3284d5){_0x121d28['count']=_0x3284d5;if(_0x521b71[_0x06d8('0x2c')]['includeAll']){_0x414a45['include']=[{'all':!![]}];}return db[_0x06d8('0x3b')][_0x06d8('0x3c')](_0x414a45);})[_0x06d8('0x23')](function(_0x13cf87){_0x121d28[_0x06d8('0x3d')]=_0x13cf87;return _0x121d28;})['then'](respondWithFilteredResult(_0x1e8246,_0x414a45))['catch'](handleError(_0x1e8246,null));};exports[_0x06d8('0x3e')]=function(_0x4137e7,_0xe0ada4){var _0x241969={'raw':!![],'where':{'id':_0x4137e7[_0x06d8('0x3f')]['id']}},_0x13b443={};_0x13b443[_0x06d8('0x2b')]=_['keys'](db[_0x06d8('0x3b')]['rawAttributes']);_0x13b443['query']=_[_0x06d8('0x2d')](_0x4137e7[_0x06d8('0x2c')]);_0x13b443[_0x06d8('0x2e')]=_[_0x06d8('0x2f')](_0x13b443[_0x06d8('0x2b')],_0x13b443['query']);_0x241969[_0x06d8('0x30')]=_[_0x06d8('0x2f')](_0x13b443[_0x06d8('0x2b')],qs[_0x06d8('0x31')](_0x4137e7[_0x06d8('0x2c')][_0x06d8('0x31')]));_0x241969['attributes']=_0x241969['attributes'][_0x06d8('0x32')]?_0x241969[_0x06d8('0x30')]:_0x13b443[_0x06d8('0x2b')];if(_0x4137e7[_0x06d8('0x2c')]['includeAll']){_0x241969[_0x06d8('0x40')]=[{'all':!![]}];}_0x241969=_[_0x06d8('0x3a')]({},_0x241969,_0x4137e7['options']);return db[_0x06d8('0x3b')][_0x06d8('0x41')](_0x241969)['then'](handleEntityNotFound(_0xe0ada4,null))[_0x06d8('0x23')](respondWithResult(_0xe0ada4,null))[_0x06d8('0x42')](handleError(_0xe0ada4,null));};exports[_0x06d8('0x43')]=function(_0x4be682,_0x5614c3){return db[_0x06d8('0x3b')][_0x06d8('0x43')](_0x4be682['body'],{})[_0x06d8('0x23')](respondWithResult(_0x5614c3,0xc9))[_0x06d8('0x42')](handleError(_0x5614c3,null));};exports[_0x06d8('0x22')]=function(_0x38f337,_0x13b148){if(_0x38f337[_0x06d8('0x44')]['id']){delete _0x38f337[_0x06d8('0x44')]['id'];}return db[_0x06d8('0x3b')][_0x06d8('0x41')]({'where':{'id':_0x38f337['params']['id']}})[_0x06d8('0x23')](handleEntityNotFound(_0x13b148,null))[_0x06d8('0x23')](saveUpdates(_0x38f337[_0x06d8('0x44')],null))[_0x06d8('0x23')](respondWithResult(_0x13b148,null))[_0x06d8('0x42')](handleError(_0x13b148,null));};exports[_0x06d8('0x24')]=function(_0x4ab3a1,_0x16d4b3){return db[_0x06d8('0x3b')][_0x06d8('0x41')]({'where':{'id':_0x4ab3a1['params']['id']}})[_0x06d8('0x23')](handleEntityNotFound(_0x16d4b3,null))[_0x06d8('0x23')](removeEntity(_0x16d4b3,null))[_0x06d8('0x42')](handleError(_0x16d4b3,null));};exports[_0x06d8('0x45')]=function(_0x5536e7,_0x2eef8b){return db[_0x06d8('0x3b')]['describe']()[_0x06d8('0x23')](respondWithResult(_0x2eef8b,null))[_0x06d8('0x42')](handleError(_0x2eef8b,null));};
\ No newline at end of file
index 5932b57..d30470a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x131800,_0x4af3de){var _0x297f4b=function(_0x5ca43e){while(--_0x5ca43e){_0x131800['push'](_0x131800['shift']());}};_0x297f4b(++_0x4af3de);}(_0x1261,0x144));var _0x1126=function(_0x58da8a,_0x1fb6ff){_0x58da8a=_0x58da8a-0x0;var _0x5294b9=_0x1261[_0x58da8a];return _0x5294b9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x1b4357,_0x36717c){var _0x621e7b=function(_0x15e740){while(--_0x15e740){_0x1b4357['push'](_0x1b4357['shift']());}};_0x621e7b(++_0x36717c);}(_0x326f,0xd1));var _0xf326=function(_0x401827,_0x8a3cc7){_0x401827=_0x401827-0x0;var _0x3da7f5=_0x326f[_0x401827];return _0x3da7f5;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 84ac2fa..50540f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06ef=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','OpenchannelQueueReport,\x20%s,\x20%s','body','options','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','limit','moment','../../config/utils','../../config/logger'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x06ef,0x185));var _0xf06e=function(_0x597655,_0x47f4e8){_0x597655=_0x597655-0x0;var _0x4999d2=_0x06ef[_0x597655];return _0x4999d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf06e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf06e('0x1'));var logger=require(_0xf06e('0x2'))(_0xf06e('0x3'));var config=require('../../config/environment');var jayson=require(_0xf06e('0x4'));var client=jayson[_0xf06e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59b74b,_0x4e05dc,_0x5cddf1){return new BPromise(function(_0x4ccbee,_0x25b56e){return client[_0xf06e('0x6')](_0x59b74b,_0x5cddf1)[_0xf06e('0x7')](function(_0x2bb08c){logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));logger[_0xf06e('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'),JSON[_0xf06e('0xb')](_0x2bb08c));if(_0x2bb08c[_0xf06e('0xc')]){if(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xd')]===0x1f4){logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);return _0x25b56e(_0x2bb08c['error'][_0xf06e('0xe')]);}logger[_0xf06e('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0x2bb08c['error']['message']);return _0x4ccbee(_0x2bb08c[_0xf06e('0xc')][_0xf06e('0xe')]);}else{logger[_0xf06e('0x8')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4e05dc,_0xf06e('0x9'));_0x4ccbee(_0x2bb08c[_0xf06e('0xf')][_0xf06e('0xe')]);}})[_0xf06e('0x10')](function(_0x44157a){logger[_0xf06e('0xc')](_0xf06e('0x11'),_0x4e05dc,_0x44157a);_0x25b56e(_0x44157a);});});}exports['CreateOpenchannelQueueReport']=function(_0x380c07){var _0x55dabf=this;return new Promise(function(_0x251c9f,_0x7a9f4b){return db['OpenchannelQueueReport']['create'](_0x380c07[_0xf06e('0x12')],{'raw':_0x380c07[_0xf06e('0x13')]?_0x380c07['options']['raw']===undefined?!![]:![]:!![]})[_0xf06e('0x7')](function(_0x211590){logger[_0xf06e('0x8')]('CreateOpenchannelQueueReport',_0x380c07);logger[_0xf06e('0xa')](_0xf06e('0x14'),_0x380c07,JSON['stringify'](_0x211590));_0x251c9f(_0x211590);})[_0xf06e('0x10')](function(_0x1ba130){logger[_0xf06e('0xc')]('CreateOpenchannelQueueReport',_0x1ba130[_0xf06e('0xe')],_0x380c07);_0x7a9f4b(_0x55dabf[_0xf06e('0xc')](0x1f4,_0x1ba130[_0xf06e('0xe')]));});});};exports[_0xf06e('0x15')]=function(_0x3b410e){var _0x4c2d01=this;return new Promise(function(_0x3a969c,_0x4923d3){return db[_0xf06e('0x16')][_0xf06e('0x17')](_0x3b410e[_0xf06e('0x12')],{'raw':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x19')]||null:null,'attributes':_0x3b410e[_0xf06e('0x13')]?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1a')]||null:null,'limit':_0x3b410e['options']?_0x3b410e[_0xf06e('0x13')][_0xf06e('0x1b')]||null:null})[_0xf06e('0x7')](function(_0x89a74f){logger[_0xf06e('0x8')](_0xf06e('0x15'),_0x3b410e);logger['debug'](_0xf06e('0x15'),_0x3b410e,JSON[_0xf06e('0xb')](_0x89a74f));_0x3a969c(_0x89a74f);})[_0xf06e('0x10')](function(_0x5d21f7){logger[_0xf06e('0xc')](_0xf06e('0x15'),_0x5d21f7[_0xf06e('0xe')],_0x3b410e);_0x4923d3(_0x4c2d01[_0xf06e('0xc')](0x1f4,_0x5d21f7[_0xf06e('0xe')]));});});};
\ No newline at end of file
+var _0xdc9b=['client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','update','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise'];(function(_0x2cd1e4,_0x23d906){var _0x167374=function(_0x496435){while(--_0x496435){_0x2cd1e4['push'](_0x2cd1e4['shift']());}};_0x167374(++_0x23d906);}(_0xdc9b,0x70));var _0xbdc9=function(_0x48fb5f,_0x4e31de){_0x48fb5f=_0x48fb5f-0x0;var _0x1c7d10=_0xdc9b[_0x48fb5f];return _0x1c7d10;};'use strict';var _=require(_0xbdc9('0x0'));var util=require(_0xbdc9('0x1'));var moment=require(_0xbdc9('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdc9('0x3'));var fs=require('fs');var Redis=require(_0xbdc9('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbdc9('0x5'))(_0xbdc9('0x6'));var config=require('../../config/environment');var jayson=require(_0xbdc9('0x7'));var client=jayson[_0xbdc9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x472956,_0x597a18,_0x3a3dc9){return new BPromise(function(_0x15236a,_0x3b3cbd){return client[_0xbdc9('0x9')](_0x472956,_0x3a3dc9)[_0xbdc9('0xa')](function(_0x33f353){logger[_0xbdc9('0xb')](_0xbdc9('0xc'),_0x597a18,_0xbdc9('0xd'));logger[_0xbdc9('0xe')](_0xbdc9('0xf'),_0x597a18,_0xbdc9('0xd'),JSON[_0xbdc9('0x10')](_0x33f353));if(_0x33f353[_0xbdc9('0x11')]){if(_0x33f353[_0xbdc9('0x11')][_0xbdc9('0x12')]===0x1f4){logger[_0xbdc9('0x11')](_0xbdc9('0xc'),_0x597a18,_0x33f353[_0xbdc9('0x11')][_0xbdc9('0x13')]);return _0x3b3cbd(_0x33f353[_0xbdc9('0x11')]['message']);}logger[_0xbdc9('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x597a18,_0x33f353['error'][_0xbdc9('0x13')]);return _0x15236a(_0x33f353[_0xbdc9('0x11')]['message']);}else{logger[_0xbdc9('0xb')](_0xbdc9('0xc'),_0x597a18,_0xbdc9('0xd'));_0x15236a(_0x33f353[_0xbdc9('0x14')][_0xbdc9('0x13')]);}})[_0xbdc9('0x15')](function(_0x4f6125){logger['error'](_0xbdc9('0xc'),_0x597a18,_0x4f6125);_0x3b3cbd(_0x4f6125);});});}exports[_0xbdc9('0x16')]=function(_0x32b094){var _0x54add5=this;return new Promise(function(_0x4f60f4,_0x333488){return db[_0xbdc9('0x17')]['create'](_0x32b094[_0xbdc9('0x18')],{'raw':_0x32b094[_0xbdc9('0x19')]?_0x32b094[_0xbdc9('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbdc9('0xa')](function(_0x37e81f){logger[_0xbdc9('0xb')](_0xbdc9('0x16'),_0x32b094);logger[_0xbdc9('0xe')](_0xbdc9('0x16'),_0x32b094,JSON['stringify'](_0x37e81f));_0x4f60f4(_0x37e81f);})['catch'](function(_0x2d9831){logger[_0xbdc9('0x11')](_0xbdc9('0x16'),_0x2d9831['message'],_0x32b094);_0x333488(_0x54add5[_0xbdc9('0x11')](0x1f4,_0x2d9831[_0xbdc9('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x715fa1){var _0x18ca88=this;return new Promise(function(_0x38d868,_0x23a571){return db[_0xbdc9('0x17')][_0xbdc9('0x1a')](_0x715fa1[_0xbdc9('0x18')],{'raw':_0x715fa1[_0xbdc9('0x19')]?_0x715fa1[_0xbdc9('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x715fa1[_0xbdc9('0x19')]?_0x715fa1[_0xbdc9('0x19')]['where']||null:null,'attributes':_0x715fa1[_0xbdc9('0x19')]?_0x715fa1[_0xbdc9('0x19')][_0xbdc9('0x1b')]||null:null,'limit':_0x715fa1[_0xbdc9('0x19')]?_0x715fa1[_0xbdc9('0x19')][_0xbdc9('0x1c')]||null:null})['then'](function(_0x1e1397){logger[_0xbdc9('0xb')](_0xbdc9('0x1d'),_0x715fa1);logger['debug']('UpdateOpenchannelQueueReport',_0x715fa1,JSON['stringify'](_0x1e1397));_0x38d868(_0x1e1397);})[_0xbdc9('0x15')](function(_0x2ce975){logger[_0xbdc9('0x11')](_0xbdc9('0x1d'),_0x2ce975[_0xbdc9('0x13')],_0x715fa1);_0x23a571(_0x18ca88[_0xbdc9('0x11')](0x1f4,_0x2ce975['message']));});});};
\ No newline at end of file
index 8aa1a36..a46998b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d51=['show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1c95a1,_0x3fe773){var _0x5a015e=function(_0x493f95){while(--_0x493f95){_0x1c95a1['push'](_0x1c95a1['shift']());}};_0x5a015e(++_0x3fe773);}(_0x6d51,0x1eb));var _0x16d5=function(_0x3df6af,_0x3dca23){_0x3df6af=_0x3df6af-0x0;var _0x28cb3d=_0x6d51[_0x3df6af];return _0x28cb3d;};'use strict';var multer=require(_0x16d5('0x0'));var util=require(_0x16d5('0x1'));var path=require(_0x16d5('0x2'));var timeout=require(_0x16d5('0x3'));var express=require(_0x16d5('0x4'));var router=express[_0x16d5('0x5')]();var fs_extra=require(_0x16d5('0x6'));var auth=require(_0x16d5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x16d5('0x8'));var controller=require(_0x16d5('0x9'));router[_0x16d5('0xa')]('/',auth[_0x16d5('0xb')](),controller[_0x16d5('0xc')]);router['get'](_0x16d5('0xd'),auth[_0x16d5('0xb')](),controller[_0x16d5('0xe')]);router['get']('/:id',auth[_0x16d5('0xb')](),controller[_0x16d5('0xf')]);router[_0x16d5('0x10')]('/',auth[_0x16d5('0xb')](),controller[_0x16d5('0x11')]);router['put'](_0x16d5('0x12'),auth[_0x16d5('0xb')](),controller['update']);router[_0x16d5('0x13')](_0x16d5('0x12'),auth[_0x16d5('0xb')](),controller[_0x16d5('0x14')]);module[_0x16d5('0x15')]=router;
\ No newline at end of file
+var _0xe74d=['multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','show','post','put','/:id','delete','destroy'];(function(_0x4ea982,_0x18c04d){var _0x13c0d5=function(_0x172c1d){while(--_0x172c1d){_0x4ea982['push'](_0x4ea982['shift']());}};_0x13c0d5(++_0x18c04d);}(_0xe74d,0x144));var _0xde74=function(_0x9eb6c0,_0x4a1995){_0x9eb6c0=_0x9eb6c0-0x0;var _0x2a4010=_0xe74d[_0x9eb6c0];return _0x2a4010;};'use strict';var multer=require(_0xde74('0x0'));var util=require('util');var path=require(_0xde74('0x1'));var timeout=require(_0xde74('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xde74('0x3'));var auth=require(_0xde74('0x4'));var interaction=require(_0xde74('0x5'));var config=require(_0xde74('0x6'));var controller=require(_0xde74('0x7'));router[_0xde74('0x8')]('/',auth[_0xde74('0x9')](),controller[_0xde74('0xa')]);router[_0xde74('0x8')](_0xde74('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xde74('0x8')]('/:id',auth[_0xde74('0x9')](),controller[_0xde74('0xc')]);router[_0xde74('0xd')]('/',auth[_0xde74('0x9')](),controller['create']);router[_0xde74('0xe')](_0xde74('0xf'),auth[_0xde74('0x9')](),controller['update']);router[_0xde74('0x10')](_0xde74('0xf'),auth[_0xde74('0x9')](),controller[_0xde74('0x11')]);module['exports']=router;
\ No newline at end of file
index 698607e..034e2b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1ce61e,_0x1cb067){var _0x7d0ea9=function(_0x50038b){while(--_0x50038b){_0x1ce61e['push'](_0x1ce61e['shift']());}};_0x7d0ea9(++_0x1cb067);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1476ba,_0x446421){_0x1476ba=_0x1476ba-0x0;var _0x5e7bc1=_0xf3cd[_0x1476ba];return _0x5e7bc1;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3bc8e3,_0x409f8b){var _0xcac8d2=function(_0xa1d61c){while(--_0xa1d61c){_0x3bc8e3['push'](_0x3bc8e3['shift']());}};_0xcac8d2(++_0x409f8b);}(_0xaa88,0x137));var _0x8aa8=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0xaa88[_0x11ba83];return _0x3f3925;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
index 33fdf7a..42eb122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba26=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','count','set','save','destroy','then','error','stack','name','send','map','OpenchannelTransferReport','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','pick','filter','where','type','merge','includeAll','rows','catch','params','rawAttributes','include','options','find','create','body','update','describe','eml-format','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x30efc1,_0xce84de){var _0x46d79e=function(_0x397ace){while(--_0x397ace){_0x30efc1['push'](_0x30efc1['shift']());}};_0x46d79e(++_0xce84de);}(_0xba26,0xbc));var _0x6ba2=function(_0x1a5bbd,_0x4a34f4){_0x1a5bbd=_0x1a5bbd-0x0;var _0xbd42aa=_0xba26[_0x1a5bbd];return _0xbd42aa;};'use strict';var emlformat=require(_0x6ba2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6ba2('0x1'));var fs=require('fs');var fs_extra=require(_0x6ba2('0x2'));var _=require(_0x6ba2('0x3'));var squel=require(_0x6ba2('0x4'));var crypto=require(_0x6ba2('0x5'));var jsforce=require(_0x6ba2('0x6'));var deskjs=require(_0x6ba2('0x7'));var toCsv=require(_0x6ba2('0x8'));var querystring=require(_0x6ba2('0x9'));var Papa=require(_0x6ba2('0xa'));var Redis=require(_0x6ba2('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x6ba2('0xc'));var as=require(_0x6ba2('0xd'));var hardwareService=require(_0x6ba2('0xe'));var logger=require(_0x6ba2('0xf'))(_0x6ba2('0x10'));var utils=require(_0x6ba2('0x11'));var config=require(_0x6ba2('0x12'));var licenseUtil=require(_0x6ba2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcda5,_0x35995b){_0x35995b=_0x35995b||0xcc;return function(_0xecbd86){if(_0xecbd86){return _0x1fcda5[_0x6ba2('0x14')](_0x35995b);}return _0x1fcda5['status'](_0x35995b)[_0x6ba2('0x15')]();};}function respondWithResult(_0x542903,_0x3b4818){_0x3b4818=_0x3b4818||0xc8;return function(_0x19918f){if(_0x19918f){return _0x542903[_0x6ba2('0x16')](_0x3b4818)[_0x6ba2('0x17')](_0x19918f);}};}function respondWithFilteredResult(_0x3fabfb,_0x4ff24b){return function(_0x19ac33){if(_0x19ac33){var _0x2c93f2=typeof _0x4ff24b[_0x6ba2('0x18')]==='undefined'&&typeof _0x4ff24b[_0x6ba2('0x19')]==='undefined';var _0x56f43c=_0x19ac33['count'];var _0x21b12b=_0x2c93f2?0x0:_0x4ff24b[_0x6ba2('0x18')];var _0x262e7a=_0x2c93f2?_0x19ac33[_0x6ba2('0x1a')]:_0x4ff24b[_0x6ba2('0x18')]+_0x4ff24b[_0x6ba2('0x19')];var _0x4b8b23;if(_0x262e7a>=_0x56f43c){_0x262e7a=_0x56f43c;_0x4b8b23=0xc8;}else{_0x4b8b23=0xce;}_0x3fabfb['status'](_0x4b8b23);return _0x3fabfb[_0x6ba2('0x1b')]('Content-Range',_0x21b12b+'-'+_0x262e7a+'/'+_0x56f43c)[_0x6ba2('0x17')](_0x19ac33);}return null;};}function patchUpdates(_0x54072b){return function(_0x422e6d){try{jsonpatch['apply'](_0x422e6d,_0x54072b,!![]);}catch(_0x3b5b17){return BPromise['reject'](_0x3b5b17);}return _0x422e6d[_0x6ba2('0x1c')]();};}function saveUpdates(_0x3a5a91,_0x442f75){return function(_0x532d67){if(_0x532d67){return _0x532d67['update'](_0x3a5a91)['then'](function(_0x3f283f){return _0x3f283f;});}return null;};}function removeEntity(_0x4bc350,_0xceed65){return function(_0x5996f){if(_0x5996f){return _0x5996f[_0x6ba2('0x1d')]()[_0x6ba2('0x1e')](function(){_0x4bc350[_0x6ba2('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21e8dd,_0x13c0fe){return function(_0x5bf4f9){if(!_0x5bf4f9){_0x21e8dd[_0x6ba2('0x14')](0x194);}return _0x5bf4f9;};}function handleError(_0x3e81bb,_0x338639){_0x338639=_0x338639||0x1f4;return function(_0x1fe5e7){logger[_0x6ba2('0x1f')](_0x1fe5e7[_0x6ba2('0x20')]);if(_0x1fe5e7[_0x6ba2('0x21')]){delete _0x1fe5e7['name'];}_0x3e81bb[_0x6ba2('0x16')](_0x338639)[_0x6ba2('0x22')](_0x1fe5e7);};}exports['index']=function(_0x1e5abc,_0x4fdbf4){var _0x33a7fc={},_0x103666={},_0x2f42b8={'count':0x0,'rows':[]};var _0x5a76c=_[_0x6ba2('0x23')](db[_0x6ba2('0x24')]['rawAttributes'],function(_0x15be44){return{'name':_0x15be44[_0x6ba2('0x25')],'type':_0x15be44['type'][_0x6ba2('0x26')]};});_0x103666['model']=_[_0x6ba2('0x23')](_0x5a76c,'name');_0x103666[_0x6ba2('0x27')]=_[_0x6ba2('0x28')](_0x1e5abc['query']);_0x103666[_0x6ba2('0x29')]=_[_0x6ba2('0x2a')](_0x103666['model'],_0x103666['query']);_0x33a7fc[_0x6ba2('0x2b')]=_[_0x6ba2('0x2a')](_0x103666[_0x6ba2('0x2c')],qs[_0x6ba2('0x2d')](_0x1e5abc[_0x6ba2('0x27')]['fields']));_0x33a7fc[_0x6ba2('0x2b')]=_0x33a7fc[_0x6ba2('0x2b')][_0x6ba2('0x2e')]?_0x33a7fc[_0x6ba2('0x2b')]:_0x103666[_0x6ba2('0x2c')];if(!_0x1e5abc[_0x6ba2('0x27')][_0x6ba2('0x2f')](_0x6ba2('0x30'))){_0x33a7fc[_0x6ba2('0x19')]=qs[_0x6ba2('0x19')](_0x1e5abc[_0x6ba2('0x27')]['limit']);_0x33a7fc[_0x6ba2('0x18')]=qs[_0x6ba2('0x18')](_0x1e5abc[_0x6ba2('0x27')][_0x6ba2('0x18')]);}_0x33a7fc['order']=qs['sort'](_0x1e5abc['query']['sort']);_0x33a7fc['where']=qs[_0x6ba2('0x29')](_[_0x6ba2('0x31')](_0x1e5abc['query'],_0x103666['filters']),_0x5a76c);if(_0x1e5abc[_0x6ba2('0x27')][_0x6ba2('0x32')]){_0x33a7fc[_0x6ba2('0x33')]=_['merge'](_0x33a7fc['where'],{'$or':_[_0x6ba2('0x23')](_0x5a76c,function(_0x57c171){if(_0x57c171[_0x6ba2('0x34')]!=='VIRTUAL'){var _0x459c32={};_0x459c32[_0x57c171[_0x6ba2('0x21')]]={'$like':'%'+_0x1e5abc['query'][_0x6ba2('0x32')]+'%'};return _0x459c32;}})});}_0x33a7fc=_[_0x6ba2('0x35')]({},_0x33a7fc,_0x1e5abc['options']);var _0x232ce7={'where':_0x33a7fc[_0x6ba2('0x33')]};return db[_0x6ba2('0x24')][_0x6ba2('0x1a')](_0x232ce7)['then'](function(_0x1dde5b){_0x2f42b8[_0x6ba2('0x1a')]=_0x1dde5b;if(_0x1e5abc[_0x6ba2('0x27')][_0x6ba2('0x36')]){_0x33a7fc['include']=[{'all':!![]}];}return db[_0x6ba2('0x24')]['findAll'](_0x33a7fc);})[_0x6ba2('0x1e')](function(_0x2d73af){_0x2f42b8[_0x6ba2('0x37')]=_0x2d73af;return _0x2f42b8;})['then'](respondWithFilteredResult(_0x4fdbf4,_0x33a7fc))[_0x6ba2('0x38')](handleError(_0x4fdbf4,null));};exports['show']=function(_0x1607a1,_0x2b88c7){var _0x590a67={'raw':!![],'where':{'id':_0x1607a1[_0x6ba2('0x39')]['id']}},_0x30a55b={};_0x30a55b[_0x6ba2('0x2c')]=_[_0x6ba2('0x28')](db[_0x6ba2('0x24')][_0x6ba2('0x3a')]);_0x30a55b[_0x6ba2('0x27')]=_['keys'](_0x1607a1[_0x6ba2('0x27')]);_0x30a55b[_0x6ba2('0x29')]=_['intersection'](_0x30a55b[_0x6ba2('0x2c')],_0x30a55b['query']);_0x590a67['attributes']=_[_0x6ba2('0x2a')](_0x30a55b[_0x6ba2('0x2c')],qs['fields'](_0x1607a1[_0x6ba2('0x27')][_0x6ba2('0x2d')]));_0x590a67[_0x6ba2('0x2b')]=_0x590a67[_0x6ba2('0x2b')][_0x6ba2('0x2e')]?_0x590a67[_0x6ba2('0x2b')]:_0x30a55b[_0x6ba2('0x2c')];if(_0x1607a1['query']['includeAll']){_0x590a67[_0x6ba2('0x3b')]=[{'all':!![]}];}_0x590a67=_['merge']({},_0x590a67,_0x1607a1[_0x6ba2('0x3c')]);return db[_0x6ba2('0x24')][_0x6ba2('0x3d')](_0x590a67)[_0x6ba2('0x1e')](handleEntityNotFound(_0x2b88c7,null))[_0x6ba2('0x1e')](respondWithResult(_0x2b88c7,null))['catch'](handleError(_0x2b88c7,null));};exports[_0x6ba2('0x3e')]=function(_0x2bf8f1,_0x29cc22){return db[_0x6ba2('0x24')][_0x6ba2('0x3e')](_0x2bf8f1[_0x6ba2('0x3f')],{})['then'](respondWithResult(_0x29cc22,0xc9))[_0x6ba2('0x38')](handleError(_0x29cc22,null));};exports[_0x6ba2('0x40')]=function(_0x4be17b,_0x275c60){if(_0x4be17b['body']['id']){delete _0x4be17b[_0x6ba2('0x3f')]['id'];}return db[_0x6ba2('0x24')]['find']({'where':{'id':_0x4be17b[_0x6ba2('0x39')]['id']}})[_0x6ba2('0x1e')](handleEntityNotFound(_0x275c60,null))[_0x6ba2('0x1e')](saveUpdates(_0x4be17b[_0x6ba2('0x3f')],null))[_0x6ba2('0x1e')](respondWithResult(_0x275c60,null))[_0x6ba2('0x38')](handleError(_0x275c60,null));};exports[_0x6ba2('0x1d')]=function(_0x4b7bff,_0x38b5ab){return db[_0x6ba2('0x24')]['find']({'where':{'id':_0x4b7bff['params']['id']}})['then'](handleEntityNotFound(_0x38b5ab,null))['then'](removeEntity(_0x38b5ab,null))[_0x6ba2('0x38')](handleError(_0x38b5ab,null));};exports[_0x6ba2('0x41')]=function(_0x13d4c0,_0xdd4f25){return db[_0x6ba2('0x24')][_0x6ba2('0x41')]()[_0x6ba2('0x1e')](respondWithResult(_0xdd4f25,null))[_0x6ba2('0x38')](handleError(_0xdd4f25,null));};
\ No newline at end of file
+var _0xa75e=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','options','OpenchannelTransferReport','findAll','catch','show','params','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','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','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0xa75e,0x78));var _0xea75=function(_0x290093,_0x1e4f0d){_0x290093=_0x290093-0x0;var _0x191bfb=_0xa75e[_0x290093];return _0x191bfb;};'use strict';var emlformat=require(_0xea75('0x0'));var rimraf=require(_0xea75('0x1'));var zipdir=require(_0xea75('0x2'));var jsonpatch=require(_0xea75('0x3'));var rp=require(_0xea75('0x4'));var moment=require('moment');var BPromise=require(_0xea75('0x5'));var Mustache=require('mustache');var util=require(_0xea75('0x6'));var path=require(_0xea75('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xea75('0x8'));var fs=require('fs');var fs_extra=require(_0xea75('0x9'));var _=require(_0xea75('0xa'));var squel=require(_0xea75('0xb'));var crypto=require(_0xea75('0xc'));var jsforce=require(_0xea75('0xd'));var deskjs=require(_0xea75('0xe'));var toCsv=require(_0xea75('0xf'));var querystring=require(_0xea75('0x10'));var Papa=require('papaparse');var Redis=require(_0xea75('0x11'));var authService=require(_0xea75('0x12'));var qs=require(_0xea75('0x13'));var as=require(_0xea75('0x14'));var hardwareService=require(_0xea75('0x15'));var logger=require(_0xea75('0x16'))(_0xea75('0x17'));var utils=require(_0xea75('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xea75('0x19'))['db'];function respondWithStatusCode(_0x2f1b9b,_0x49f4e1){_0x49f4e1=_0x49f4e1||0xcc;return function(_0x5b0778){if(_0x5b0778){return _0x2f1b9b[_0xea75('0x1a')](_0x49f4e1);}return _0x2f1b9b['status'](_0x49f4e1)[_0xea75('0x1b')]();};}function respondWithResult(_0x55fa78,_0x5322aa){_0x5322aa=_0x5322aa||0xc8;return function(_0x8158c9){if(_0x8158c9){return _0x55fa78[_0xea75('0x1c')](_0x5322aa)[_0xea75('0x1d')](_0x8158c9);}};}function respondWithFilteredResult(_0x523ef8,_0x32a5c2){return function(_0x16ba49){if(_0x16ba49){var _0x581d02=typeof _0x32a5c2['offset']==='undefined'&&typeof _0x32a5c2[_0xea75('0x1e')]===_0xea75('0x1f');var _0x240029=_0x16ba49[_0xea75('0x20')];var _0x347b1e=_0x581d02?0x0:_0x32a5c2[_0xea75('0x21')];var _0x3fdb1a=_0x581d02?_0x16ba49[_0xea75('0x20')]:_0x32a5c2[_0xea75('0x21')]+_0x32a5c2[_0xea75('0x1e')];var _0x19e51a;if(_0x3fdb1a>=_0x240029){_0x3fdb1a=_0x240029;_0x19e51a=0xc8;}else{_0x19e51a=0xce;}_0x523ef8[_0xea75('0x1c')](_0x19e51a);return _0x523ef8['set'](_0xea75('0x22'),_0x347b1e+'-'+_0x3fdb1a+'/'+_0x240029)[_0xea75('0x1d')](_0x16ba49);}return null;};}function patchUpdates(_0x366831){return function(_0x56ac87){try{jsonpatch[_0xea75('0x23')](_0x56ac87,_0x366831,!![]);}catch(_0x3301c1){return BPromise[_0xea75('0x24')](_0x3301c1);}return _0x56ac87[_0xea75('0x25')]();};}function saveUpdates(_0x491e8c,_0x12680d){return function(_0x14f476){if(_0x14f476){return _0x14f476[_0xea75('0x26')](_0x491e8c)[_0xea75('0x27')](function(_0x3abf43){return _0x3abf43;});}return null;};}function removeEntity(_0xdff49,_0x53a699){return function(_0x2d9009){if(_0x2d9009){return _0x2d9009[_0xea75('0x28')]()[_0xea75('0x27')](function(){_0xdff49[_0xea75('0x1c')](0xcc)[_0xea75('0x1b')]();});}};}function handleEntityNotFound(_0x5138e7,_0x10a768){return function(_0x29bd7f){if(!_0x29bd7f){_0x5138e7[_0xea75('0x1a')](0x194);}return _0x29bd7f;};}function handleError(_0x437e56,_0x1c090b){_0x1c090b=_0x1c090b||0x1f4;return function(_0x86aecf){logger[_0xea75('0x29')](_0x86aecf[_0xea75('0x2a')]);if(_0x86aecf[_0xea75('0x2b')]){delete _0x86aecf[_0xea75('0x2b')];}_0x437e56[_0xea75('0x1c')](_0x1c090b)[_0xea75('0x2c')](_0x86aecf);};}exports[_0xea75('0x2d')]=function(_0x312924,_0xc46b71){var _0x10fe0d={},_0x4320ab={},_0x5a6c57={'count':0x0,'rows':[]};var _0x1b92c0=_[_0xea75('0x2e')](db['OpenchannelTransferReport'][_0xea75('0x2f')],function(_0x1993d7){return{'name':_0x1993d7[_0xea75('0x30')],'type':_0x1993d7['type'][_0xea75('0x31')]};});_0x4320ab[_0xea75('0x32')]=_[_0xea75('0x2e')](_0x1b92c0,_0xea75('0x2b'));_0x4320ab[_0xea75('0x33')]=_[_0xea75('0x34')](_0x312924[_0xea75('0x33')]);_0x4320ab[_0xea75('0x35')]=_['intersection'](_0x4320ab[_0xea75('0x32')],_0x4320ab[_0xea75('0x33')]);_0x10fe0d['attributes']=_[_0xea75('0x36')](_0x4320ab[_0xea75('0x32')],qs[_0xea75('0x37')](_0x312924['query']['fields']));_0x10fe0d[_0xea75('0x38')]=_0x10fe0d[_0xea75('0x38')][_0xea75('0x39')]?_0x10fe0d[_0xea75('0x38')]:_0x4320ab['model'];if(!_0x312924[_0xea75('0x33')][_0xea75('0x3a')](_0xea75('0x3b'))){_0x10fe0d[_0xea75('0x1e')]=qs[_0xea75('0x1e')](_0x312924[_0xea75('0x33')][_0xea75('0x1e')]);_0x10fe0d[_0xea75('0x21')]=qs[_0xea75('0x21')](_0x312924['query'][_0xea75('0x21')]);}_0x10fe0d['order']=qs[_0xea75('0x3c')](_0x312924[_0xea75('0x33')][_0xea75('0x3c')]);_0x10fe0d[_0xea75('0x3d')]=qs[_0xea75('0x35')](_[_0xea75('0x3e')](_0x312924[_0xea75('0x33')],_0x4320ab[_0xea75('0x35')]),_0x1b92c0);if(_0x312924[_0xea75('0x33')]['filter']){_0x10fe0d[_0xea75('0x3d')]=_[_0xea75('0x3f')](_0x10fe0d[_0xea75('0x3d')],{'$or':_[_0xea75('0x2e')](_0x1b92c0,function(_0x35f976){if(_0x35f976[_0xea75('0x40')]!=='VIRTUAL'){var _0x159d98={};_0x159d98[_0x35f976[_0xea75('0x2b')]]={'$like':'%'+_0x312924[_0xea75('0x33')]['filter']+'%'};return _0x159d98;}})});}_0x10fe0d=_[_0xea75('0x3f')]({},_0x10fe0d,_0x312924[_0xea75('0x41')]);var _0x264efb={'where':_0x10fe0d[_0xea75('0x3d')]};return db['OpenchannelTransferReport']['count'](_0x264efb)[_0xea75('0x27')](function(_0x92d3cf){_0x5a6c57[_0xea75('0x20')]=_0x92d3cf;if(_0x312924['query']['includeAll']){_0x10fe0d['include']=[{'all':!![]}];}return db[_0xea75('0x42')][_0xea75('0x43')](_0x10fe0d);})[_0xea75('0x27')](function(_0x3948){_0x5a6c57['rows']=_0x3948;return _0x5a6c57;})[_0xea75('0x27')](respondWithFilteredResult(_0xc46b71,_0x10fe0d))[_0xea75('0x44')](handleError(_0xc46b71,null));};exports[_0xea75('0x45')]=function(_0x4a8ed1,_0x51f745){var _0x113484={'raw':!![],'where':{'id':_0x4a8ed1[_0xea75('0x46')]['id']}},_0x391917={};_0x391917['model']=_[_0xea75('0x34')](db[_0xea75('0x42')]['rawAttributes']);_0x391917[_0xea75('0x33')]=_['keys'](_0x4a8ed1['query']);_0x391917['filters']=_[_0xea75('0x36')](_0x391917[_0xea75('0x32')],_0x391917[_0xea75('0x33')]);_0x113484['attributes']=_[_0xea75('0x36')](_0x391917[_0xea75('0x32')],qs['fields'](_0x4a8ed1[_0xea75('0x33')][_0xea75('0x37')]));_0x113484[_0xea75('0x38')]=_0x113484[_0xea75('0x38')][_0xea75('0x39')]?_0x113484[_0xea75('0x38')]:_0x391917[_0xea75('0x32')];if(_0x4a8ed1[_0xea75('0x33')][_0xea75('0x47')]){_0x113484[_0xea75('0x48')]=[{'all':!![]}];}_0x113484=_[_0xea75('0x3f')]({},_0x113484,_0x4a8ed1['options']);return db[_0xea75('0x42')]['find'](_0x113484)['then'](handleEntityNotFound(_0x51f745,null))[_0xea75('0x27')](respondWithResult(_0x51f745,null))[_0xea75('0x44')](handleError(_0x51f745,null));};exports[_0xea75('0x49')]=function(_0x13c450,_0x31d2c7){return db['OpenchannelTransferReport']['create'](_0x13c450[_0xea75('0x4a')],{})[_0xea75('0x27')](respondWithResult(_0x31d2c7,0xc9))['catch'](handleError(_0x31d2c7,null));};exports[_0xea75('0x26')]=function(_0x284c41,_0x2f6d75){if(_0x284c41[_0xea75('0x4a')]['id']){delete _0x284c41[_0xea75('0x4a')]['id'];}return db[_0xea75('0x42')][_0xea75('0x4b')]({'where':{'id':_0x284c41[_0xea75('0x46')]['id']}})[_0xea75('0x27')](handleEntityNotFound(_0x2f6d75,null))['then'](saveUpdates(_0x284c41['body'],null))[_0xea75('0x27')](respondWithResult(_0x2f6d75,null))[_0xea75('0x44')](handleError(_0x2f6d75,null));};exports['destroy']=function(_0x3edecb,_0x5c8ea8){return db[_0xea75('0x42')][_0xea75('0x4b')]({'where':{'id':_0x3edecb['params']['id']}})[_0xea75('0x27')](handleEntityNotFound(_0x5c8ea8,null))['then'](removeEntity(_0x5c8ea8,null))[_0xea75('0x44')](handleError(_0x5c8ea8,null));};exports[_0xea75('0x4c')]=function(_0x482681,_0x54be00){return db[_0xea75('0x42')]['describe']()['then'](respondWithResult(_0x54be00,null))[_0xea75('0x44')](handleError(_0x54be00,null));};
\ No newline at end of file
index 7039f95..ca5c070 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2603=['request-promise','path','rimraf','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x4055b3,_0x19d733){var _0x194589=function(_0x5c7b15){while(--_0x5c7b15){_0x4055b3['push'](_0x4055b3['shift']());}};_0x194589(++_0x19d733);}(_0x2603,0x8a));var _0x3260=function(_0x4d58ce,_0x47fb4f){_0x4d58ce=_0x4d58ce-0x0;var _0x504769=_0x2603[_0x4d58ce];return _0x504769;};'use strict';var _=require(_0x3260('0x0'));var util=require(_0x3260('0x1'));var logger=require('../../config/logger')(_0x3260('0x2'));var moment=require(_0x3260('0x3'));var BPromise=require(_0x3260('0x4'));var rp=require(_0x3260('0x5'));var fs=require('fs');var path=require(_0x3260('0x6'));var rimraf=require(_0x3260('0x7'));var config=require('../../config/environment');var attributes=require(_0x3260('0x8'));module[_0x3260('0x9')]=function(_0x40bf82,_0xd9cf72){return _0x40bf82[_0x3260('0xa')](_0x3260('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x3260('0xc'),'fields':[_0x3260('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6ac2=['rimraf','../../config/environment','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x1ca9c5,_0x20c304){var _0x4092bc=function(_0x2ac730){while(--_0x2ac730){_0x1ca9c5['push'](_0x1ca9c5['shift']());}};_0x4092bc(++_0x20c304);}(_0x6ac2,0x1bc));var _0x26ac=function(_0x514c63,_0x3c34df){_0x514c63=_0x514c63-0x0;var _0x3f648f=_0x6ac2[_0x514c63];return _0x3f648f;};'use strict';var _=require(_0x26ac('0x0'));var util=require('util');var logger=require(_0x26ac('0x1'))(_0x26ac('0x2'));var moment=require(_0x26ac('0x3'));var BPromise=require(_0x26ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26ac('0x5'));var rimraf=require(_0x26ac('0x6'));var config=require(_0x26ac('0x7'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x12450f,_0x492ccb){return _0x12450f['define'](_0x26ac('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x26ac('0x9'),'fields':[_0x26ac('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index e2e0db4..f615057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b1=['../../config/environment','jayson/promise','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x29b1,0x13b));var _0x129b=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x29b1[_0xf71120];return _0xbe2fd3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x129b('0x0'));var BPromise=require(_0x129b('0x1'));var rs=require(_0x129b('0x2'));var fs=require('fs');var Redis=require(_0x129b('0x3'));var db=require(_0x129b('0x4'))['db'];var utils=require(_0x129b('0x5'));var logger=require(_0x129b('0x6'))(_0x129b('0x7'));var config=require(_0x129b('0x8'));var jayson=require(_0x129b('0x9'));var client=jayson[_0x129b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b0923,_0x5f0bcc,_0x1155dd){return new BPromise(function(_0x31e697,_0x54a406){return client['request'](_0x4b0923,_0x1155dd)[_0x129b('0xb')](function(_0x5b7597){logger[_0x129b('0xc')](_0x129b('0xd'),_0x5f0bcc,_0x129b('0xe'));logger[_0x129b('0xf')](_0x129b('0x10'),_0x5f0bcc,_0x129b('0xe'),JSON['stringify'](_0x5b7597));if(_0x5b7597[_0x129b('0x11')]){if(_0x5b7597[_0x129b('0x11')]['code']===0x1f4){logger[_0x129b('0x11')](_0x129b('0xd'),_0x5f0bcc,_0x5b7597['error'][_0x129b('0x12')]);return _0x54a406(_0x5b7597[_0x129b('0x11')][_0x129b('0x12')]);}logger[_0x129b('0x11')](_0x129b('0xd'),_0x5f0bcc,_0x5b7597['error'][_0x129b('0x12')]);return _0x31e697(_0x5b7597[_0x129b('0x11')][_0x129b('0x12')]);}else{logger['info'](_0x129b('0xd'),_0x5f0bcc,_0x129b('0xe'));_0x31e697(_0x5b7597['result'][_0x129b('0x12')]);}})['catch'](function(_0x168620){logger[_0x129b('0x11')](_0x129b('0xd'),_0x5f0bcc,_0x168620);_0x54a406(_0x168620);});});}
\ No newline at end of file
+var _0xa786=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0xa786,0x1d2));var _0x6a78=function(_0x521e75,_0x5d5b16){_0x521e75=_0x521e75-0x0;var _0x4d57ce=_0xa786[_0x521e75];return _0x4d57ce;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a78('0x0'));var BPromise=require(_0x6a78('0x1'));var rs=require(_0x6a78('0x2'));var fs=require('fs');var Redis=require(_0x6a78('0x3'));var db=require(_0x6a78('0x4'))['db'];var utils=require(_0x6a78('0x5'));var logger=require(_0x6a78('0x6'))('rpc');var config=require(_0x6a78('0x7'));var jayson=require(_0x6a78('0x8'));var client=jayson[_0x6a78('0x9')][_0x6a78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28d286,_0x2f8387,_0x2b8c4c){return new BPromise(function(_0x2a6de6,_0x25db5e){return client[_0x6a78('0xb')](_0x28d286,_0x2b8c4c)[_0x6a78('0xc')](function(_0x33e71c){logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x2f8387,_0x6a78('0xf'));logger[_0x6a78('0x10')](_0x6a78('0x11'),_0x2f8387,_0x6a78('0xf'),JSON[_0x6a78('0x12')](_0x33e71c));if(_0x33e71c['error']){if(_0x33e71c['error'][_0x6a78('0x13')]===0x1f4){logger[_0x6a78('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2f8387,_0x33e71c[_0x6a78('0x14')][_0x6a78('0x15')]);return _0x25db5e(_0x33e71c[_0x6a78('0x14')][_0x6a78('0x15')]);}logger[_0x6a78('0x14')](_0x6a78('0xe'),_0x2f8387,_0x33e71c[_0x6a78('0x14')]['message']);return _0x2a6de6(_0x33e71c['error']['message']);}else{logger[_0x6a78('0xd')](_0x6a78('0xe'),_0x2f8387,_0x6a78('0xf'));_0x2a6de6(_0x33e71c['result'][_0x6a78('0x15')]);}})[_0x6a78('0x16')](function(_0x5b5a5d){logger[_0x6a78('0x14')](_0x6a78('0xe'),_0x2f8387,_0x5b5a5d);_0x25db5e(_0x5b5a5d);});});}
\ No newline at end of file
index fc8ab30..b8effad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6f4=['exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','update','delete','destroy'];(function(_0x1c1fdd,_0x3330da){var _0x25ff90=function(_0x3a6615){while(--_0x3a6615){_0x1c1fdd['push'](_0x1c1fdd['shift']());}};_0x25ff90(++_0x3330da);}(_0xd6f4,0x7f));var _0x4d6f=function(_0x6726fd,_0x428da2){_0x6726fd=_0x6726fd-0x0;var _0x115454=_0xd6f4[_0x6726fd];return _0x115454;};'use strict';var multer=require(_0x4d6f('0x0'));var util=require('util');var path=require(_0x4d6f('0x1'));var timeout=require(_0x4d6f('0x2'));var express=require(_0x4d6f('0x3'));var router=express[_0x4d6f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4d6f('0x5'));var config=require(_0x4d6f('0x6'));var controller=require('./pause.controller');router[_0x4d6f('0x7')]('/',auth['isAuthenticated'](),controller[_0x4d6f('0x8')]);router['get']('/:id',auth[_0x4d6f('0x9')](),controller[_0x4d6f('0xa')]);router[_0x4d6f('0xb')]('/',auth[_0x4d6f('0x9')](),controller[_0x4d6f('0xc')]);router[_0x4d6f('0xd')]('/:id',auth[_0x4d6f('0x9')](),controller[_0x4d6f('0xe')]);router[_0x4d6f('0xf')]('/:id',auth[_0x4d6f('0x9')](),controller[_0x4d6f('0x10')]);module[_0x4d6f('0x11')]=router;
\ No newline at end of file
+var _0xb50a=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','post'];(function(_0x2b8424,_0x54131d){var _0x2678c2=function(_0xd42725){while(--_0xd42725){_0x2b8424['push'](_0x2b8424['shift']());}};_0x2678c2(++_0x54131d);}(_0xb50a,0x135));var _0xab50=function(_0x462d45,_0xec23a){_0x462d45=_0x462d45-0x0;var _0x51acb3=_0xb50a[_0x462d45];return _0x51acb3;};'use strict';var multer=require(_0xab50('0x0'));var util=require(_0xab50('0x1'));var path=require(_0xab50('0x2'));var timeout=require(_0xab50('0x3'));var express=require(_0xab50('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab50('0x5'));var interaction=require(_0xab50('0x6'));var config=require(_0xab50('0x7'));var controller=require(_0xab50('0x8'));router[_0xab50('0x9')]('/',auth[_0xab50('0xa')](),controller[_0xab50('0xb')]);router[_0xab50('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xab50('0xc')]);router[_0xab50('0xd')]('/',auth[_0xab50('0xa')](),controller['create']);router['put'](_0xab50('0xe'),auth[_0xab50('0xa')](),controller[_0xab50('0xf')]);router[_0xab50('0x10')](_0xab50('0xe'),auth[_0xab50('0xa')](),controller[_0xab50('0x11')]);module[_0xab50('0x12')]=router;
\ No newline at end of file
index cb92887..a2c08e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2566=['name','sequelize','STRING'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x2566,0x76));var _0x6256=function(_0x2eb739,_0x30968b){_0x2eb739=_0x2eb739-0x0;var _0x247822=_0x2566[_0x2eb739];return _0x247822;};'use strict';var Sequelize=require(_0x6256('0x0'));module['exports']={'name':{'type':Sequelize[_0x6256('0x1')],'unique':_0x6256('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6256('0x1')]}};
\ No newline at end of file
+var _0x4563=['sequelize','name'];(function(_0x2ab350,_0x5600d9){var _0x4a16d7=function(_0x36576b){while(--_0x36576b){_0x2ab350['push'](_0x2ab350['shift']());}};_0x4a16d7(++_0x5600d9);}(_0x4563,0x13c));var _0x3456=function(_0x45d08e,_0x2387ab){_0x45d08e=_0x45d08e-0x0;var _0x1a3ec8=_0x4563[_0x45d08e];return _0x1a3ec8;};'use strict';var Sequelize=require(_0x3456('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3456('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6b80834..63c15de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c2=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','end','error','name','index','map','Pause','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xa2c2,0xe4));var _0x2a2c=function(_0x49d6f0,_0x492fee){_0x49d6f0=_0x49d6f0-0x0;var _0x33b6dc=_0xa2c2[_0x49d6f0];return _0x33b6dc;};'use strict';var emlformat=require(_0x2a2c('0x0'));var rimraf=require(_0x2a2c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2a2c('0x2'));var rp=require(_0x2a2c('0x3'));var moment=require(_0x2a2c('0x4'));var BPromise=require(_0x2a2c('0x5'));var Mustache=require(_0x2a2c('0x6'));var util=require(_0x2a2c('0x7'));var path=require('path');var sox=require(_0x2a2c('0x8'));var csv=require('to-csv');var ejs=require(_0x2a2c('0x9'));var fs=require('fs');var fs_extra=require(_0x2a2c('0xa'));var _=require(_0x2a2c('0xb'));var squel=require(_0x2a2c('0xc'));var crypto=require(_0x2a2c('0xd'));var jsforce=require(_0x2a2c('0xe'));var deskjs=require(_0x2a2c('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2a2c('0x10'));var Papa=require(_0x2a2c('0x11'));var Redis=require(_0x2a2c('0x12'));var authService=require(_0x2a2c('0x13'));var qs=require(_0x2a2c('0x14'));var as=require(_0x2a2c('0x15'));var hardwareService=require(_0x2a2c('0x16'));var logger=require(_0x2a2c('0x17'))(_0x2a2c('0x18'));var utils=require('../../config/utils');var config=require(_0x2a2c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a2c('0x1a'))['db'];function respondWithStatusCode(_0x57339f,_0x3cafea){_0x3cafea=_0x3cafea||0xcc;return function(_0x33278c){if(_0x33278c){return _0x57339f['sendStatus'](_0x3cafea);}return _0x57339f[_0x2a2c('0x1b')](_0x3cafea)['end']();};}function respondWithResult(_0x45b102,_0x5a0444){_0x5a0444=_0x5a0444||0xc8;return function(_0x81d896){if(_0x81d896){return _0x45b102[_0x2a2c('0x1b')](_0x5a0444)[_0x2a2c('0x1c')](_0x81d896);}};}function respondWithFilteredResult(_0x43a94a,_0x35709c){return function(_0x181c6a){if(_0x181c6a){var _0x5c2b7c=typeof _0x35709c[_0x2a2c('0x1d')]===_0x2a2c('0x1e')&&typeof _0x35709c[_0x2a2c('0x1f')]===_0x2a2c('0x1e');var _0x3eeec0=_0x181c6a[_0x2a2c('0x20')];var _0xa66a77=_0x5c2b7c?0x0:_0x35709c[_0x2a2c('0x1d')];var _0x2ea197=_0x5c2b7c?_0x181c6a[_0x2a2c('0x20')]:_0x35709c['offset']+_0x35709c[_0x2a2c('0x1f')];var _0x5d3098;if(_0x2ea197>=_0x3eeec0){_0x2ea197=_0x3eeec0;_0x5d3098=0xc8;}else{_0x5d3098=0xce;}_0x43a94a[_0x2a2c('0x1b')](_0x5d3098);return _0x43a94a[_0x2a2c('0x21')](_0x2a2c('0x22'),_0xa66a77+'-'+_0x2ea197+'/'+_0x3eeec0)[_0x2a2c('0x1c')](_0x181c6a);}return null;};}function patchUpdates(_0x1a33b3){return function(_0x162601){try{jsonpatch[_0x2a2c('0x23')](_0x162601,_0x1a33b3,!![]);}catch(_0x4d3e1e){return BPromise['reject'](_0x4d3e1e);}return _0x162601[_0x2a2c('0x24')]();};}function saveUpdates(_0x1de8cf,_0x35d47c){return function(_0x50b21d){if(_0x50b21d){return _0x50b21d[_0x2a2c('0x25')](_0x1de8cf)[_0x2a2c('0x26')](function(_0x510dc3){return _0x510dc3;});}return null;};}function removeEntity(_0x4b87ea,_0x37c6c5){return function(_0x98c874){if(_0x98c874){return _0x98c874[_0x2a2c('0x27')]()[_0x2a2c('0x26')](function(){var _0x3deef9=_0x98c874[_0x2a2c('0x28')]({'plain':!![]});var _0x442cff=_0x2a2c('0x29');return db[_0x2a2c('0x2a')][_0x2a2c('0x27')]({'where':{'type':_0x442cff,'resourceId':_0x3deef9['id']}})['then'](function(){return _0x98c874;});})[_0x2a2c('0x26')](function(){_0x4b87ea[_0x2a2c('0x1b')](0xcc)[_0x2a2c('0x2b')]();});}};}function handleEntityNotFound(_0x613d6c,_0x49f427){return function(_0x1237af){if(!_0x1237af){_0x613d6c['sendStatus'](0x194);}return _0x1237af;};}function handleError(_0x8fd301,_0x1148e6){_0x1148e6=_0x1148e6||0x1f4;return function(_0x5a97e9){logger[_0x2a2c('0x2c')](_0x5a97e9['stack']);if(_0x5a97e9['name']){delete _0x5a97e9[_0x2a2c('0x2d')];}_0x8fd301[_0x2a2c('0x1b')](_0x1148e6)['send'](_0x5a97e9);};}exports[_0x2a2c('0x2e')]=function(_0x1d6217,_0x122e73){var _0x3a2f8e={},_0x33ca20={},_0x158021={'count':0x0,'rows':[]};var _0x114c67=_[_0x2a2c('0x2f')](db[_0x2a2c('0x30')]['rawAttributes'],function(_0x1e446c){return{'name':_0x1e446c[_0x2a2c('0x31')],'type':_0x1e446c[_0x2a2c('0x32')]['key']};});_0x33ca20[_0x2a2c('0x33')]=_[_0x2a2c('0x2f')](_0x114c67,_0x2a2c('0x2d'));_0x33ca20['query']=_[_0x2a2c('0x34')](_0x1d6217['query']);_0x33ca20[_0x2a2c('0x35')]=_[_0x2a2c('0x36')](_0x33ca20[_0x2a2c('0x33')],_0x33ca20[_0x2a2c('0x37')]);_0x3a2f8e['attributes']=_['intersection'](_0x33ca20[_0x2a2c('0x33')],qs[_0x2a2c('0x38')](_0x1d6217[_0x2a2c('0x37')][_0x2a2c('0x38')]));_0x3a2f8e[_0x2a2c('0x39')]=_0x3a2f8e[_0x2a2c('0x39')][_0x2a2c('0x3a')]?_0x3a2f8e[_0x2a2c('0x39')]:_0x33ca20[_0x2a2c('0x33')];if(!_0x1d6217[_0x2a2c('0x37')][_0x2a2c('0x3b')](_0x2a2c('0x3c'))){_0x3a2f8e[_0x2a2c('0x1f')]=qs['limit'](_0x1d6217['query'][_0x2a2c('0x1f')]);_0x3a2f8e[_0x2a2c('0x1d')]=qs[_0x2a2c('0x1d')](_0x1d6217['query'][_0x2a2c('0x1d')]);}_0x3a2f8e['order']=qs[_0x2a2c('0x3d')](_0x1d6217[_0x2a2c('0x37')][_0x2a2c('0x3d')]);_0x3a2f8e[_0x2a2c('0x3e')]=qs[_0x2a2c('0x35')](_[_0x2a2c('0x3f')](_0x1d6217[_0x2a2c('0x37')],_0x33ca20[_0x2a2c('0x35')]),_0x114c67);if(_0x1d6217['query']['filter']){_0x3a2f8e[_0x2a2c('0x3e')]=_[_0x2a2c('0x40')](_0x3a2f8e['where'],{'$or':_[_0x2a2c('0x2f')](_0x114c67,function(_0x11d82e){if(_0x11d82e[_0x2a2c('0x32')]!=='VIRTUAL'){var _0x5b03f8={};_0x5b03f8[_0x11d82e[_0x2a2c('0x2d')]]={'$like':'%'+_0x1d6217['query']['filter']+'%'};return _0x5b03f8;}})});}_0x3a2f8e=_[_0x2a2c('0x40')]({},_0x3a2f8e,_0x1d6217[_0x2a2c('0x41')]);var _0x25ea81={'where':_0x3a2f8e[_0x2a2c('0x3e')]};return db['Pause'][_0x2a2c('0x20')](_0x25ea81)[_0x2a2c('0x26')](function(_0x10bbb1){_0x158021[_0x2a2c('0x20')]=_0x10bbb1;if(_0x1d6217[_0x2a2c('0x37')][_0x2a2c('0x42')]){_0x3a2f8e[_0x2a2c('0x43')]=[{'all':!![]}];}return db[_0x2a2c('0x30')][_0x2a2c('0x44')](_0x3a2f8e);})[_0x2a2c('0x26')](function(_0x2dcfe0){_0x158021['rows']=_0x2dcfe0;return _0x158021;})[_0x2a2c('0x26')](respondWithFilteredResult(_0x122e73,_0x3a2f8e))[_0x2a2c('0x45')](handleError(_0x122e73,null));};exports[_0x2a2c('0x46')]=function(_0x43e1cf,_0x85e76d){var _0x11cfed={'raw':!![],'where':{'id':_0x43e1cf['params']['id']}},_0x5b6348={};_0x5b6348[_0x2a2c('0x33')]=_[_0x2a2c('0x34')](db['Pause'][_0x2a2c('0x47')]);_0x5b6348['query']=_[_0x2a2c('0x34')](_0x43e1cf[_0x2a2c('0x37')]);_0x5b6348[_0x2a2c('0x35')]=_[_0x2a2c('0x36')](_0x5b6348[_0x2a2c('0x33')],_0x5b6348[_0x2a2c('0x37')]);_0x11cfed[_0x2a2c('0x39')]=_['intersection'](_0x5b6348[_0x2a2c('0x33')],qs[_0x2a2c('0x38')](_0x43e1cf['query'][_0x2a2c('0x38')]));_0x11cfed[_0x2a2c('0x39')]=_0x11cfed[_0x2a2c('0x39')][_0x2a2c('0x3a')]?_0x11cfed[_0x2a2c('0x39')]:_0x5b6348['model'];if(_0x43e1cf['query']['includeAll']){_0x11cfed[_0x2a2c('0x43')]=[{'all':!![]}];}_0x11cfed=_[_0x2a2c('0x40')]({},_0x11cfed,_0x43e1cf['options']);return db[_0x2a2c('0x30')][_0x2a2c('0x48')](_0x11cfed)[_0x2a2c('0x26')](handleEntityNotFound(_0x85e76d,null))[_0x2a2c('0x26')](respondWithResult(_0x85e76d,null))[_0x2a2c('0x45')](handleError(_0x85e76d,null));};exports[_0x2a2c('0x49')]=function(_0x14a7de,_0xed135a){return db[_0x2a2c('0x30')]['create'](_0x14a7de[_0x2a2c('0x4a')],{})[_0x2a2c('0x26')](function(_0x45c447){var _0x2be312=_0x14a7de['user'][_0x2a2c('0x28')]({'plain':!![]});if(!_0x2be312)throw new Error(_0x2a2c('0x4b'));if(_0x2be312[_0x2a2c('0x4c')]===_0x2a2c('0x4d')){var _0x2e0d5e=_0x45c447[_0x2a2c('0x28')]({'plain':!![]});var _0x56fce0=_0x2a2c('0x29');return db[_0x2a2c('0x4e')][_0x2a2c('0x48')]({'where':{'name':_0x56fce0,'userProfileId':_0x2be312['userProfileId']},'raw':!![]})[_0x2a2c('0x26')](function(_0x30abf9){if(_0x30abf9&&_0x30abf9['autoAssociation']===0x0){return db[_0x2a2c('0x2a')]['create']({'name':_0x2e0d5e['name'],'resourceId':_0x2e0d5e['id'],'type':_0x30abf9[_0x2a2c('0x2d')],'sectionId':_0x30abf9['id']},{})[_0x2a2c('0x26')](function(){return _0x45c447;});}else{return _0x45c447;}})[_0x2a2c('0x45')](function(_0x500ce2){logger[_0x2a2c('0x2c')](_0x2a2c('0x4f'),_0x500ce2);throw _0x500ce2;});}return _0x45c447;})[_0x2a2c('0x26')](respondWithResult(_0xed135a,0xc9))[_0x2a2c('0x45')](handleError(_0xed135a,null));};exports['update']=function(_0x2f056c,_0x299bcb){if(_0x2f056c['body']['id']){delete _0x2f056c[_0x2a2c('0x4a')]['id'];}return db[_0x2a2c('0x30')]['find']({'where':{'id':_0x2f056c[_0x2a2c('0x50')]['id']}})[_0x2a2c('0x26')](handleEntityNotFound(_0x299bcb,null))[_0x2a2c('0x26')](saveUpdates(_0x2f056c[_0x2a2c('0x4a')],null))[_0x2a2c('0x26')](respondWithResult(_0x299bcb,null))[_0x2a2c('0x45')](handleError(_0x299bcb,null));};exports[_0x2a2c('0x27')]=function(_0x35760f,_0x3fdac9){return db[_0x2a2c('0x30')][_0x2a2c('0x48')]({'where':{'id':_0x35760f[_0x2a2c('0x50')]['id']}})[_0x2a2c('0x26')](handleEntityNotFound(_0x3fdac9,null))[_0x2a2c('0x26')](removeEntity(_0x3fdac9,null))['catch'](handleError(_0x3fdac9,null));};
\ No newline at end of file
+var _0xa246=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','get','Pauses','UserProfileResource','sendStatus','error','stack','name','send','map','Pause','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','request-promise','mustache','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x3fdc3d,_0x48e855){var _0x1250ee=function(_0x585702){while(--_0x585702){_0x3fdc3d['push'](_0x3fdc3d['shift']());}};_0x1250ee(++_0x48e855);}(_0xa246,0x91));var _0x6a24=function(_0x550036,_0x329f68){_0x550036=_0x550036-0x0;var _0x927217=_0xa246[_0x550036];return _0x927217;};'use strict';var emlformat=require(_0x6a24('0x0'));var rimraf=require(_0x6a24('0x1'));var zipdir=require(_0x6a24('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a24('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6a24('0x4'));var util=require('util');var path=require(_0x6a24('0x5'));var sox=require('sox');var csv=require(_0x6a24('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a24('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6a24('0x8'));var jsforce=require(_0x6a24('0x9'));var deskjs=require(_0x6a24('0xa'));var toCsv=require('to-csv');var querystring=require(_0x6a24('0xb'));var Papa=require('papaparse');var Redis=require(_0x6a24('0xc'));var authService=require(_0x6a24('0xd'));var qs=require(_0x6a24('0xe'));var as=require(_0x6a24('0xf'));var hardwareService=require(_0x6a24('0x10'));var logger=require(_0x6a24('0x11'))(_0x6a24('0x12'));var utils=require(_0x6a24('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6a24('0x14'))['db'];function respondWithStatusCode(_0x592470,_0x31dd06){_0x31dd06=_0x31dd06||0xcc;return function(_0x3d1e21){if(_0x3d1e21){return _0x592470['sendStatus'](_0x31dd06);}return _0x592470[_0x6a24('0x15')](_0x31dd06)[_0x6a24('0x16')]();};}function respondWithResult(_0xb036c3,_0x51d808){_0x51d808=_0x51d808||0xc8;return function(_0x45ee57){if(_0x45ee57){return _0xb036c3[_0x6a24('0x15')](_0x51d808)[_0x6a24('0x17')](_0x45ee57);}};}function respondWithFilteredResult(_0x2bb9ce,_0x4d1c95){return function(_0x18e6d0){if(_0x18e6d0){var _0xa711d0=typeof _0x4d1c95[_0x6a24('0x18')]===_0x6a24('0x19')&&typeof _0x4d1c95[_0x6a24('0x1a')]===_0x6a24('0x19');var _0x109a8b=_0x18e6d0[_0x6a24('0x1b')];var _0x40c2ec=_0xa711d0?0x0:_0x4d1c95[_0x6a24('0x18')];var _0x42281f=_0xa711d0?_0x18e6d0[_0x6a24('0x1b')]:_0x4d1c95[_0x6a24('0x18')]+_0x4d1c95[_0x6a24('0x1a')];var _0x25ed28;if(_0x42281f>=_0x109a8b){_0x42281f=_0x109a8b;_0x25ed28=0xc8;}else{_0x25ed28=0xce;}_0x2bb9ce[_0x6a24('0x15')](_0x25ed28);return _0x2bb9ce[_0x6a24('0x1c')]('Content-Range',_0x40c2ec+'-'+_0x42281f+'/'+_0x109a8b)[_0x6a24('0x17')](_0x18e6d0);}return null;};}function patchUpdates(_0x3f7193){return function(_0x656bd5){try{jsonpatch[_0x6a24('0x1d')](_0x656bd5,_0x3f7193,!![]);}catch(_0x133e28){return BPromise['reject'](_0x133e28);}return _0x656bd5[_0x6a24('0x1e')]();};}function saveUpdates(_0x29379a,_0x8bee2f){return function(_0x5bc9b8){if(_0x5bc9b8){return _0x5bc9b8[_0x6a24('0x1f')](_0x29379a)['then'](function(_0x553dec){return _0x553dec;});}return null;};}function removeEntity(_0x9772a8,_0x4b1965){return function(_0x30c079){if(_0x30c079){return _0x30c079[_0x6a24('0x20')]()[_0x6a24('0x21')](function(){var _0x57c21a=_0x30c079[_0x6a24('0x22')]({'plain':!![]});var _0x48bbd8=_0x6a24('0x23');return db[_0x6a24('0x24')][_0x6a24('0x20')]({'where':{'type':_0x48bbd8,'resourceId':_0x57c21a['id']}})[_0x6a24('0x21')](function(){return _0x30c079;});})['then'](function(){_0x9772a8['status'](0xcc)[_0x6a24('0x16')]();});}};}function handleEntityNotFound(_0x28acfa,_0x42a53b){return function(_0x525563){if(!_0x525563){_0x28acfa[_0x6a24('0x25')](0x194);}return _0x525563;};}function handleError(_0x17ae22,_0x6bcd2e){_0x6bcd2e=_0x6bcd2e||0x1f4;return function(_0x47c2e5){logger[_0x6a24('0x26')](_0x47c2e5[_0x6a24('0x27')]);if(_0x47c2e5[_0x6a24('0x28')]){delete _0x47c2e5[_0x6a24('0x28')];}_0x17ae22[_0x6a24('0x15')](_0x6bcd2e)[_0x6a24('0x29')](_0x47c2e5);};}exports['index']=function(_0x122dad,_0x4b86ef){var _0x17caf3={},_0x285de2={},_0x4c5019={'count':0x0,'rows':[]};var _0x2ad617=_[_0x6a24('0x2a')](db[_0x6a24('0x2b')][_0x6a24('0x2c')],function(_0x222bf8){return{'name':_0x222bf8['fieldName'],'type':_0x222bf8[_0x6a24('0x2d')][_0x6a24('0x2e')]};});_0x285de2['model']=_[_0x6a24('0x2a')](_0x2ad617,_0x6a24('0x28'));_0x285de2[_0x6a24('0x2f')]=_[_0x6a24('0x30')](_0x122dad[_0x6a24('0x2f')]);_0x285de2[_0x6a24('0x31')]=_[_0x6a24('0x32')](_0x285de2['model'],_0x285de2[_0x6a24('0x2f')]);_0x17caf3[_0x6a24('0x33')]=_['intersection'](_0x285de2[_0x6a24('0x34')],qs['fields'](_0x122dad['query'][_0x6a24('0x35')]));_0x17caf3[_0x6a24('0x33')]=_0x17caf3[_0x6a24('0x33')][_0x6a24('0x36')]?_0x17caf3['attributes']:_0x285de2[_0x6a24('0x34')];if(!_0x122dad[_0x6a24('0x2f')]['hasOwnProperty'](_0x6a24('0x37'))){_0x17caf3['limit']=qs[_0x6a24('0x1a')](_0x122dad[_0x6a24('0x2f')][_0x6a24('0x1a')]);_0x17caf3[_0x6a24('0x18')]=qs[_0x6a24('0x18')](_0x122dad['query'][_0x6a24('0x18')]);}_0x17caf3[_0x6a24('0x38')]=qs['sort'](_0x122dad['query'][_0x6a24('0x39')]);_0x17caf3[_0x6a24('0x3a')]=qs[_0x6a24('0x31')](_[_0x6a24('0x3b')](_0x122dad[_0x6a24('0x2f')],_0x285de2[_0x6a24('0x31')]),_0x2ad617);if(_0x122dad[_0x6a24('0x2f')]['filter']){_0x17caf3[_0x6a24('0x3a')]=_[_0x6a24('0x3c')](_0x17caf3[_0x6a24('0x3a')],{'$or':_['map'](_0x2ad617,function(_0x402590){if(_0x402590[_0x6a24('0x2d')]!==_0x6a24('0x3d')){var _0xb70128={};_0xb70128[_0x402590[_0x6a24('0x28')]]={'$like':'%'+_0x122dad[_0x6a24('0x2f')][_0x6a24('0x3e')]+'%'};return _0xb70128;}})});}_0x17caf3=_[_0x6a24('0x3c')]({},_0x17caf3,_0x122dad[_0x6a24('0x3f')]);var _0x50c24a={'where':_0x17caf3[_0x6a24('0x3a')]};return db['Pause'][_0x6a24('0x1b')](_0x50c24a)[_0x6a24('0x21')](function(_0x4e555b){_0x4c5019[_0x6a24('0x1b')]=_0x4e555b;if(_0x122dad[_0x6a24('0x2f')][_0x6a24('0x40')]){_0x17caf3[_0x6a24('0x41')]=[{'all':!![]}];}return db[_0x6a24('0x2b')][_0x6a24('0x42')](_0x17caf3);})[_0x6a24('0x21')](function(_0x48fb3d){_0x4c5019['rows']=_0x48fb3d;return _0x4c5019;})[_0x6a24('0x21')](respondWithFilteredResult(_0x4b86ef,_0x17caf3))['catch'](handleError(_0x4b86ef,null));};exports[_0x6a24('0x43')]=function(_0x429b45,_0x49df6e){var _0x144dcc={'raw':!![],'where':{'id':_0x429b45['params']['id']}},_0xaabb6a={};_0xaabb6a['model']=_[_0x6a24('0x30')](db['Pause'][_0x6a24('0x2c')]);_0xaabb6a['query']=_['keys'](_0x429b45[_0x6a24('0x2f')]);_0xaabb6a[_0x6a24('0x31')]=_['intersection'](_0xaabb6a[_0x6a24('0x34')],_0xaabb6a['query']);_0x144dcc[_0x6a24('0x33')]=_[_0x6a24('0x32')](_0xaabb6a[_0x6a24('0x34')],qs['fields'](_0x429b45[_0x6a24('0x2f')][_0x6a24('0x35')]));_0x144dcc['attributes']=_0x144dcc[_0x6a24('0x33')][_0x6a24('0x36')]?_0x144dcc[_0x6a24('0x33')]:_0xaabb6a[_0x6a24('0x34')];if(_0x429b45[_0x6a24('0x2f')][_0x6a24('0x40')]){_0x144dcc['include']=[{'all':!![]}];}_0x144dcc=_[_0x6a24('0x3c')]({},_0x144dcc,_0x429b45[_0x6a24('0x3f')]);return db[_0x6a24('0x2b')][_0x6a24('0x44')](_0x144dcc)[_0x6a24('0x21')](handleEntityNotFound(_0x49df6e,null))[_0x6a24('0x21')](respondWithResult(_0x49df6e,null))[_0x6a24('0x45')](handleError(_0x49df6e,null));};exports['create']=function(_0x4f02ff,_0x2739fe){return db[_0x6a24('0x2b')][_0x6a24('0x46')](_0x4f02ff['body'],{})[_0x6a24('0x21')](function(_0x43895d){var _0x1deaff=_0x4f02ff[_0x6a24('0x47')][_0x6a24('0x22')]({'plain':!![]});if(!_0x1deaff)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1deaff[_0x6a24('0x48')]===_0x6a24('0x47')){var _0x573bb5=_0x43895d['get']({'plain':!![]});var _0x3a3f45=_0x6a24('0x23');return db[_0x6a24('0x49')][_0x6a24('0x44')]({'where':{'name':_0x3a3f45,'userProfileId':_0x1deaff[_0x6a24('0x4a')]},'raw':!![]})[_0x6a24('0x21')](function(_0x4bb135){if(_0x4bb135&&_0x4bb135[_0x6a24('0x4b')]===0x0){return db[_0x6a24('0x24')][_0x6a24('0x46')]({'name':_0x573bb5[_0x6a24('0x28')],'resourceId':_0x573bb5['id'],'type':_0x4bb135[_0x6a24('0x28')],'sectionId':_0x4bb135['id']},{})[_0x6a24('0x21')](function(){return _0x43895d;});}else{return _0x43895d;}})['catch'](function(_0x415be6){logger['error'](_0x6a24('0x4c'),_0x415be6);throw _0x415be6;});}return _0x43895d;})[_0x6a24('0x21')](respondWithResult(_0x2739fe,0xc9))[_0x6a24('0x45')](handleError(_0x2739fe,null));};exports[_0x6a24('0x1f')]=function(_0x31677e,_0x1713e5){if(_0x31677e[_0x6a24('0x4d')]['id']){delete _0x31677e[_0x6a24('0x4d')]['id'];}return db[_0x6a24('0x2b')][_0x6a24('0x44')]({'where':{'id':_0x31677e[_0x6a24('0x4e')]['id']}})[_0x6a24('0x21')](handleEntityNotFound(_0x1713e5,null))[_0x6a24('0x21')](saveUpdates(_0x31677e['body'],null))[_0x6a24('0x21')](respondWithResult(_0x1713e5,null))[_0x6a24('0x45')](handleError(_0x1713e5,null));};exports[_0x6a24('0x20')]=function(_0x21db02,_0x1c47b8){return db['Pause']['find']({'where':{'id':_0x21db02['params']['id']}})['then'](handleEntityNotFound(_0x1c47b8,null))[_0x6a24('0x21')](removeEntity(_0x1c47b8,null))[_0x6a24('0x45')](handleError(_0x1c47b8,null));};
\ No newline at end of file
index 8a310fe..574825d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1c9f9b,_0x32b776){var _0x305aed=function(_0x57bed9){while(--_0x57bed9){_0x1c9f9b['push'](_0x1c9f9b['shift']());}};_0x305aed(++_0x32b776);}(_0x1cb9,0x14e));var _0x91cb=function(_0x11d5f0,_0x1618bc){_0x11d5f0=_0x11d5f0-0x0;var _0x30196e=_0x1cb9[_0x11d5f0];return _0x30196e;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x5c1eba,_0x2a356c){var _0x46e2dc=function(_0x1b1d1b){while(--_0x1b1d1b){_0x5c1eba['push'](_0x5c1eba['shift']());}};_0x46e2dc(++_0x2a356c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x42fdef,_0x1fce07){_0x42fdef=_0x42fdef-0x0;var _0x2de5e3=_0x8ef6[_0x42fdef];return _0x2de5e3;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6fccde7..3106f65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4adba3,_0x4b89eb){var _0x40dc67=function(_0x207201){while(--_0x207201){_0x4adba3['push'](_0x4adba3['shift']());}};_0x40dc67(++_0x4b89eb);}(_0xb10b,0x12a));var _0xbb10=function(_0x121328,_0x2c3815){_0x121328=_0x121328-0x0;var _0x28548a=_0xb10b[_0x121328];return _0x28548a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0xcc5685,_0x411c72){var _0x267842=function(_0x2a4b77){while(--_0x2a4b77){_0xcc5685['push'](_0xcc5685['shift']());}};_0x267842(++_0x411c72);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c264f,_0x571dfa){_0x5c264f=_0x5c264f-0x0;var _0x57455c=_0xb10b[_0x5c264f];return _0x57455c;};'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 84a4bfc..9a685f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['webhookPost','put','update','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/:id','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','/webhook'];(function(_0x273c02,_0x568c91){var _0x3b0c6b=function(_0x1e8bf5){while(--_0x1e8bf5){_0x273c02['push'](_0x273c02['shift']());}};_0x3b0c6b(++_0x568c91);}(_0xfd28,0x148));var _0x8fd2=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xfd28[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var fs_extra=require(_0x8fd2('0x3'));var auth=require(_0x8fd2('0x4'));var interaction=require(_0x8fd2('0x5'));var config=require('../../config/environment');var controller=require(_0x8fd2('0x6'));router[_0x8fd2('0x7')]('/',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x9')]);router[_0x8fd2('0x7')]('/webhook',controller['webhookGet']);router[_0x8fd2('0x7')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['show']);router[_0x8fd2('0x7')]('/:id/download',auth[_0x8fd2('0x8')](),controller['download']);var upload=multer({'storage':multer[_0x8fd2('0xb')]({'destination':function(_0x4fdf0b,_0x1ca2a1,_0x5244ed){_0x5244ed(null,path[_0x8fd2('0xc')](config['root'],_0x8fd2('0xd')));},'filename':function(_0x207298,_0xfd78d,_0xa6d7ca){_0xfd78d[_0x8fd2('0xe')]=_0xfd78d[_0x8fd2('0xe')][_0x8fd2('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa6d7ca(null,util[_0x8fd2('0x10')](_0x8fd2('0x11'),path[_0x8fd2('0x12')](_0xfd78d[_0x8fd2('0xe')],path[_0x8fd2('0x13')](_0xfd78d[_0x8fd2('0xe')])),Date[_0x8fd2('0x14')](),path[_0x8fd2('0x13')](_0xfd78d['originalname'])));}})});router[_0x8fd2('0x15')]('/',upload['single']('file'),controller['upload']);router[_0x8fd2('0x15')](_0x8fd2('0x16'),controller[_0x8fd2('0x17')]);router[_0x8fd2('0x18')]('/:id',auth[_0x8fd2('0x8')](),controller[_0x8fd2('0x19')]);router[_0x8fd2('0x1a')](_0x8fd2('0xa'),auth[_0x8fd2('0x8')](),controller['delete']);module['exports']=router;
\ No newline at end of file
+var _0x00bb=['upload','post','put','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','originalname','replace','%s-%s%s','basename','extname','file'];(function(_0x47b493,_0x429ada){var _0xb7f5be=function(_0x20eb88){while(--_0x20eb88){_0x47b493['push'](_0x47b493['shift']());}};_0xb7f5be(++_0x429ada);}(_0x00bb,0x1d8));var _0xb00b=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x00bb[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var fs_extra=require(_0xb00b('0x4'));var auth=require(_0xb00b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb00b('0x6'));var controller=require(_0xb00b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb00b('0x8')](_0xb00b('0x9'),controller[_0xb00b('0xa')]);router[_0xb00b('0x8')](_0xb00b('0xb'),auth[_0xb00b('0xc')](),controller['show']);router['get'](_0xb00b('0xd'),auth[_0xb00b('0xc')](),controller[_0xb00b('0xe')]);var upload=multer({'storage':multer[_0xb00b('0xf')]({'destination':function(_0x28d3cc,_0x48e125,_0x3182db){_0x3182db(null,path['join'](config['root'],'server/files/plugins'));},'filename':function(_0x4ff792,_0x2d8ddf,_0x1be8aa){_0x2d8ddf[_0xb00b('0x10')]=_0x2d8ddf[_0xb00b('0x10')][_0xb00b('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1be8aa(null,util['format'](_0xb00b('0x12'),path[_0xb00b('0x13')](_0x2d8ddf['originalname'],path[_0xb00b('0x14')](_0x2d8ddf[_0xb00b('0x10')])),Date['now'](),path['extname'](_0x2d8ddf[_0xb00b('0x10')])));}})});router['post']('/',upload['single'](_0xb00b('0x15')),controller[_0xb00b('0x16')]);router[_0xb00b('0x17')](_0xb00b('0x9'),controller['webhookPost']);router[_0xb00b('0x18')]('/:id',auth[_0xb00b('0xc')](),controller['update']);router[_0xb00b('0x19')]('/:id',auth[_0xb00b('0xc')](),controller[_0xb00b('0x19')]);module['exports']=router;
\ No newline at end of file
index 6ef0640..de43d94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0183=['script','TEXT','ENUM','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING'];(function(_0x3da7c2,_0x5c0ec3){var _0x4eb160=function(_0x583c71){while(--_0x583c71){_0x3da7c2['push'](_0x3da7c2['shift']());}};_0x4eb160(++_0x5c0ec3);}(_0x0183,0x197));var _0x3018=function(_0x12da50,_0x4eab81){_0x12da50=_0x12da50-0x0;var _0x4159b0=_0x0183[_0x12da50];return _0x4159b0;};'use strict';var Sequelize=require(_0x3018('0x0'));module[_0x3018('0x1')]={'name':{'type':Sequelize[_0x3018('0x2')]},'type':{'type':Sequelize['ENUM']('html',_0x3018('0x3'))},'description':{'type':Sequelize[_0x3018('0x4')]},'version':{'type':Sequelize[_0x3018('0x4')]},'path':{'type':Sequelize[_0x3018('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x3018('0x5')](_0x3018('0x6'),'agentOnly','always',_0x3018('0x7')),'defaultValue':_0x3018('0x8'),'comment':_0x3018('0x9')},'icon':{'type':Sequelize[_0x3018('0x2')]},'adminUrl':{'type':Sequelize[_0x3018('0x2')]},'agentUrl':{'type':Sequelize[_0x3018('0x2')]},'scriptName':{'type':Sequelize[_0x3018('0x2')]},'scriptPath':{'type':Sequelize[_0x3018('0x2')]}};
\ No newline at end of file
+var _0xada3=['adminOnly','agentOnly','never','always','sequelize','STRING','ENUM','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x6b292e,_0xd14796){var _0x3929b8=function(_0x5284e0){while(--_0x5284e0){_0x6b292e['push'](_0x6b292e['shift']());}};_0x3929b8(++_0xd14796);}(_0xada3,0xd3));var _0x3ada=function(_0x4e2fd0,_0x28e4e1){_0x4e2fd0=_0x4e2fd0-0x0;var _0x1c5b42=_0xada3[_0x4e2fd0];return _0x1c5b42;};'use strict';var Sequelize=require(_0x3ada('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ada('0x1')]},'type':{'type':Sequelize[_0x3ada('0x2')]('html','script')},'description':{'type':Sequelize[_0x3ada('0x3')]},'version':{'type':Sequelize[_0x3ada('0x3')]},'path':{'type':Sequelize[_0x3ada('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3ada('0x4')},'sidebar':{'type':Sequelize[_0x3ada('0x2')](_0x3ada('0x5'),_0x3ada('0x6'),'always',_0x3ada('0x7')),'defaultValue':_0x3ada('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x3ada('0x1')]},'adminUrl':{'type':Sequelize[_0x3ada('0x1')]},'agentUrl':{'type':Sequelize[_0x3ada('0x1')]},'scriptName':{'type':Sequelize[_0x3ada('0x1')]},'scriptPath':{'type':Sequelize[_0x3ada('0x1')]}};
\ No newline at end of file
index af5d9db..0ec6e8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc84b=['extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','some','manifest.json','readFileSync','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-type','endsWith','sendStatus','statusCode','method','%s%s','content-length','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','rows','catch','params','includeAll','include','find','join','root','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','server/files/plugins','dirname','basename','node_modules/**/*','attachments/**/*','finalize','existsSync','Plugin\x20not\x20found','download','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','file','filename'];(function(_0x34d068,_0x17a58c){var _0x24e72d=function(_0x46a458){while(--_0x46a458){_0x34d068['push'](_0x34d068['shift']());}};_0x24e72d(++_0x17a58c);}(_0xc84b,0xe9));var _0xbc84=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xc84b[_0x486f4a];return _0x135d99;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc84('0x0'));var zipdir=require(_0xbc84('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc84('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbc84('0x3'));var util=require(_0xbc84('0x4'));var path=require(_0xbc84('0x5'));var sox=require(_0xbc84('0x6'));var csv=require(_0xbc84('0x7'));var ejs=require(_0xbc84('0x8'));var fs=require('fs');var fs_extra=require(_0xbc84('0x9'));var _=require(_0xbc84('0xa'));var squel=require('squel');var crypto=require(_0xbc84('0xb'));var jsforce=require(_0xbc84('0xc'));var deskjs=require(_0xbc84('0xd'));var toCsv=require(_0xbc84('0x7'));var querystring=require('querystring');var Papa=require(_0xbc84('0xe'));var extract=require(_0xbc84('0xf'));var rimraf=require(_0xbc84('0x0'));var archiver=require(_0xbc84('0x10'));var Redis=require(_0xbc84('0x11'));var authService=require(_0xbc84('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc84('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbc84('0x14'));var utils=require(_0xbc84('0x15'));var config=require(_0xbc84('0x16'));var licenseUtil=require(_0xbc84('0x17'));var db=require(_0xbc84('0x18'))['db'];config[_0xbc84('0x19')]=_[_0xbc84('0x1a')](config[_0xbc84('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc84('0x1b'))(new Redis(config['redis']));require('./plugin.socket')[_0xbc84('0x1c')](socket);function respondWithStatusCode(_0x230340,_0x436520){_0x436520=_0x436520||0xcc;return function(_0x1775f4){if(_0x1775f4){return _0x230340['sendStatus'](_0x436520);}return _0x230340[_0xbc84('0x1d')](_0x436520)[_0xbc84('0x1e')]();};}function respondWithResult(_0x1497af,_0x351bfb){_0x351bfb=_0x351bfb||0xc8;return function(_0x519cbd){if(_0x519cbd){return _0x1497af[_0xbc84('0x1d')](_0x351bfb)[_0xbc84('0x1f')](_0x519cbd);}};}function respondWithFilteredResult(_0x34a1cd,_0x3a5006){return function(_0x3f3724){if(_0x3f3724){var _0x4879ad=typeof _0x3a5006[_0xbc84('0x20')]==='undefined'&&typeof _0x3a5006[_0xbc84('0x21')]==='undefined';var _0x227151=_0x3f3724[_0xbc84('0x22')];var _0x4a3f87=_0x4879ad?0x0:_0x3a5006[_0xbc84('0x20')];var _0x15d360=_0x4879ad?_0x3f3724[_0xbc84('0x22')]:_0x3a5006[_0xbc84('0x20')]+_0x3a5006[_0xbc84('0x21')];var _0x51b307;if(_0x15d360>=_0x227151){_0x15d360=_0x227151;_0x51b307=0xc8;}else{_0x51b307=0xce;}_0x34a1cd[_0xbc84('0x1d')](_0x51b307);return _0x34a1cd[_0xbc84('0x23')](_0xbc84('0x24'),_0x4a3f87+'-'+_0x15d360+'/'+_0x227151)[_0xbc84('0x1f')](_0x3f3724);}return null;};}function patchUpdates(_0x37bd43){return function(_0x137b6b){try{jsonpatch[_0xbc84('0x25')](_0x137b6b,_0x37bd43,!![]);}catch(_0x13da44){return BPromise[_0xbc84('0x26')](_0x13da44);}return _0x137b6b[_0xbc84('0x27')]();};}function saveUpdates(_0x3b0dc3,_0x5cfa63){return function(_0x500c40){if(_0x500c40){return _0x500c40[_0xbc84('0x28')](_0x3b0dc3)[_0xbc84('0x29')](function(_0x48c2db){return _0x48c2db;});}return null;};}function removeEntity(_0x3ebe61,_0xad29eb){return function(_0x4cf233){if(_0x4cf233){return _0x4cf233[_0xbc84('0x2a')]()[_0xbc84('0x29')](function(){var _0xa07a85=_0x4cf233[_0xbc84('0x2b')]({'plain':!![]});var _0x4b168d='Plugins';return db[_0xbc84('0x2c')][_0xbc84('0x2a')]({'where':{'type':_0x4b168d,'resourceId':_0xa07a85['id']}})['then'](function(){return _0x4cf233;});})[_0xbc84('0x29')](function(){_0x3ebe61[_0xbc84('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1972d7,_0x8b3a0e){return function(_0x3de431){if(!_0x3de431){_0x1972d7['sendStatus'](0x194);}return _0x3de431;};}function handleError(_0x17e133,_0x400828){_0x400828=_0x400828||0x1f4;return function(_0x2479f0){logger[_0xbc84('0x2d')](_0x2479f0[_0xbc84('0x2e')]);if(_0x2479f0[_0xbc84('0x2f')]){delete _0x2479f0[_0xbc84('0x2f')];}_0x17e133[_0xbc84('0x1d')](_0x400828)[_0xbc84('0x30')](_0x2479f0);};}exports[_0xbc84('0x31')]=function(_0x19094a,_0x3cc85e){var _0x26cd2e={},_0x919c30={},_0x1a8eb5={'count':0x0,'rows':[]};var _0x241ea0=_['map'](db[_0xbc84('0x32')][_0xbc84('0x33')],function(_0x5b165c){return{'name':_0x5b165c[_0xbc84('0x34')],'type':_0x5b165c['type'][_0xbc84('0x35')]};});_0x919c30[_0xbc84('0x36')]=_['map'](_0x241ea0,_0xbc84('0x2f'));_0x919c30['query']=_[_0xbc84('0x37')](_0x19094a[_0xbc84('0x38')]);_0x919c30[_0xbc84('0x39')]=_[_0xbc84('0x3a')](_0x919c30[_0xbc84('0x36')],_0x919c30[_0xbc84('0x38')]);_0x26cd2e[_0xbc84('0x3b')]=_[_0xbc84('0x3a')](_0x919c30[_0xbc84('0x36')],qs[_0xbc84('0x3c')](_0x19094a[_0xbc84('0x38')][_0xbc84('0x3c')]));_0x26cd2e[_0xbc84('0x3b')]=_0x26cd2e[_0xbc84('0x3b')][_0xbc84('0x3d')]?_0x26cd2e[_0xbc84('0x3b')]:_0x919c30[_0xbc84('0x36')];if(!_0x19094a['query'][_0xbc84('0x3e')](_0xbc84('0x3f'))){_0x26cd2e[_0xbc84('0x21')]=qs[_0xbc84('0x21')](_0x19094a[_0xbc84('0x38')][_0xbc84('0x21')]);_0x26cd2e[_0xbc84('0x20')]=qs[_0xbc84('0x20')](_0x19094a[_0xbc84('0x38')][_0xbc84('0x20')]);}_0x26cd2e[_0xbc84('0x40')]=qs[_0xbc84('0x41')](_0x19094a[_0xbc84('0x38')][_0xbc84('0x41')]);_0x26cd2e[_0xbc84('0x42')]=qs[_0xbc84('0x39')](_[_0xbc84('0x43')](_0x19094a['query'],_0x919c30[_0xbc84('0x39')]),_0x241ea0);if(_0x19094a['query']['filter']){_0x26cd2e['where']=_[_0xbc84('0x44')](_0x26cd2e['where'],{'$or':_[_0xbc84('0x45')](_0x241ea0,function(_0x28be47){if(_0x28be47[_0xbc84('0x46')]!==_0xbc84('0x47')){var _0x28171d={};_0x28171d[_0x28be47['name']]={'$like':'%'+_0x19094a['query']['filter']+'%'};return _0x28171d;}})});}_0x26cd2e=_[_0xbc84('0x44')]({},_0x26cd2e,_0x19094a[_0xbc84('0x48')]);var _0x120851={'where':_0x26cd2e['where']};return db[_0xbc84('0x32')]['count'](_0x120851)['then'](function(_0x29e243){_0x1a8eb5['count']=_0x29e243;if(_0x19094a[_0xbc84('0x38')]['includeAll']){_0x26cd2e['include']=[{'all':!![]}];}return db[_0xbc84('0x32')]['findAll'](_0x26cd2e);})[_0xbc84('0x29')](function(_0x2eae8a){_0x1a8eb5[_0xbc84('0x49')]=_0x2eae8a;return _0x1a8eb5;})[_0xbc84('0x29')](respondWithFilteredResult(_0x3cc85e,_0x26cd2e))[_0xbc84('0x4a')](handleError(_0x3cc85e,null));};exports['show']=function(_0x1235a8,_0x12c36d){var _0x5f2f6a={'raw':!![],'where':{'id':_0x1235a8[_0xbc84('0x4b')]['id']}},_0x1c213d={};_0x1c213d[_0xbc84('0x36')]=_['keys'](db[_0xbc84('0x32')][_0xbc84('0x33')]);_0x1c213d[_0xbc84('0x38')]=_[_0xbc84('0x37')](_0x1235a8[_0xbc84('0x38')]);_0x1c213d[_0xbc84('0x39')]=_[_0xbc84('0x3a')](_0x1c213d[_0xbc84('0x36')],_0x1c213d[_0xbc84('0x38')]);_0x5f2f6a['attributes']=_[_0xbc84('0x3a')](_0x1c213d[_0xbc84('0x36')],qs['fields'](_0x1235a8[_0xbc84('0x38')][_0xbc84('0x3c')]));_0x5f2f6a[_0xbc84('0x3b')]=_0x5f2f6a[_0xbc84('0x3b')]['length']?_0x5f2f6a[_0xbc84('0x3b')]:_0x1c213d[_0xbc84('0x36')];if(_0x1235a8[_0xbc84('0x38')][_0xbc84('0x4c')]){_0x5f2f6a[_0xbc84('0x4d')]=[{'all':!![]}];}_0x5f2f6a=_[_0xbc84('0x44')]({},_0x5f2f6a,_0x1235a8['options']);return db[_0xbc84('0x32')][_0xbc84('0x4e')](_0x5f2f6a)[_0xbc84('0x29')](handleEntityNotFound(_0x12c36d,null))[_0xbc84('0x29')](respondWithResult(_0x12c36d,null))[_0xbc84('0x4a')](handleError(_0x12c36d,null));};exports['download']=function(_0x45efbd,_0x39cf30,_0x41d56f){return db['Plugin'][_0xbc84('0x4e')]({'where':{'id':_0x45efbd['params']['id']},'attributes':[_0xbc84('0x2f'),_0xbc84('0x5')],'raw':!![]})[_0xbc84('0x29')](handleEntityNotFound(_0x39cf30,null))[_0xbc84('0x29')](function(_0x4853ec){if(_0x4853ec){var _0x53f89a=path[_0xbc84('0x4f')](config[_0xbc84('0x50')],'server/files/plugins',util['format'](_0xbc84('0x51'),path['basename'](_0x4853ec[_0xbc84('0x5')])));var _0x216214=fs[_0xbc84('0x52')](_0x53f89a);var _0x5b3bcd=archiver(_0xbc84('0x53'),{'zlib':{'level':0x9}});_0x5b3bcd['on'](_0xbc84('0x54'),function(_0x5267ff){if(_0x5267ff[_0xbc84('0x55')]===_0xbc84('0x56')){logger[_0xbc84('0x2d')](_0x5267ff);}else{throw new db[(_0xbc84('0x57'))][(_0xbc84('0x58'))](_0xbc84('0x59'));}});_0x5b3bcd['on'](_0xbc84('0x2d'),function(_0x324dab){throw new db[(_0xbc84('0x57'))]['Error'](_0xbc84('0x59'));});_0x5b3bcd['pipe'](_0x216214);_0x5b3bcd[_0xbc84('0x5a')](_0xbc84('0x5b'),{'cwd':path[_0xbc84('0x4f')](config[_0xbc84('0x50')],_0xbc84('0x5c'),path[_0xbc84('0x5d')](_0x4853ec[_0xbc84('0x5')])),'ignore':[path[_0xbc84('0x4f')](path[_0xbc84('0x5e')](_0x4853ec[_0xbc84('0x5')]),_0xbc84('0x5f')),path[_0xbc84('0x4f')](path[_0xbc84('0x5e')](_0x4853ec['path']),_0xbc84('0x60'))],'nodir':!![]})[_0xbc84('0x61')]();_0x216214['on']('close',function(){if(!fs[_0xbc84('0x62')](_0x53f89a)){throw new db[(_0xbc84('0x57'))][(_0xbc84('0x58'))](_0xbc84('0x63'));}return _0x39cf30[_0xbc84('0x64')](_0x53f89a,util[_0xbc84('0x65')](_0xbc84('0x51'),path[_0xbc84('0x5e')](_0x4853ec[_0xbc84('0x5')])),function(_0x364488){if(_0x364488){throw new db[(_0xbc84('0x57'))][(_0xbc84('0x58'))](_0xbc84('0x66'));}fs[_0xbc84('0x67')](_0x53f89a);logger[_0xbc84('0x68')](_0xbc84('0x69'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x39cf30,null));};exports[_0xbc84('0x6a')]=function(_0x4c7eaf,_0x473753,_0x7410df){var _0x1c417a=path[_0xbc84('0x5e')](_0x4c7eaf[_0xbc84('0x6b')][_0xbc84('0x6c')],path[_0xbc84('0x6d')](_0x4c7eaf[_0xbc84('0x6b')][_0xbc84('0x6c')]));var _0x1a70d6=path[_0xbc84('0x4f')](config[_0xbc84('0x50')],'server/files/plugins',_0x4c7eaf[_0xbc84('0x6b')][_0xbc84('0x6c')]);var _0x56ecfa=path[_0xbc84('0x4f')](config[_0xbc84('0x50')],'server/files/plugins',_0x1c417a);logger[_0xbc84('0x68')](_0xbc84('0x6e'),_0x1a70d6);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x56ecfa);try{fs[_0xbc84('0x6f')](_0x1a70d6,parseInt(_0xbc84('0x70'),0x8));extract(_0x1a70d6,{'dir':_0x56ecfa},function(_0x21f2e5){if(_0x21f2e5){logger['error'](_0x21f2e5);handleError(_0x21f2e5,!![]);};var _0x2930c8=fs[_0xbc84('0x71')](_0x56ecfa);if(_0x2930c8[_0xbc84('0x3d')]>0x1){removeReferences(_0x1a70d6,_0x56ecfa);logger[_0xbc84('0x2d')](_0xbc84('0x72'));return _0x7410df(new Error(_0xbc84('0x72')));}var _0x49a7ce=fs[_0xbc84('0x73')](path[_0xbc84('0x4f')](_0x56ecfa,_0x2930c8[0x0]));if(_0x49a7ce[_0xbc84('0x74')]()){removeReferences(_0x1a70d6,_0x56ecfa);logger['error'](_0xbc84('0x72'));return _0x7410df(new Error('Invalid\x20plugin\x20structure'));}if(_0x49a7ce['isDirectory']()){var _0x115901=fs['readdirSync'](path[_0xbc84('0x4f')](_0x56ecfa,_0x2930c8[0x0]));if(_0x115901[_0xbc84('0x3d')]===0x0){removeReferences(_0x1a70d6,_0x56ecfa);logger[_0xbc84('0x2d')](_0xbc84('0x72'));return _0x7410df(new Error(_0xbc84('0x72')));}var _0x5b6047=_0x115901[_0xbc84('0x75')](function(_0x169924){return _0x169924===_0xbc84('0x76');});if(!_0x5b6047){return _0x7410df(new Error('Plugin\x20manifest\x20missing'));}var _0xf6dffc=fs[_0xbc84('0x77')](path[_0xbc84('0x4f')](_0x56ecfa,_0x2930c8[0x0],'manifest.json'));var _0x1fbb31=JSON['parse'](_0xf6dffc);if(_0xbc84('0x78')==typeof _0x1fbb31[_0xbc84('0x2f')]){return _0x7410df(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xbc84('0x78')==typeof _0x1fbb31['type']){return _0x7410df(new Error(_0xbc84('0x79')));}if(_0xbc84('0x78')==typeof _0x1fbb31[_0xbc84('0x7a')]){return _0x7410df(new Error(_0xbc84('0x7b')));}if(_0xbc84('0x78')==typeof _0x1fbb31[_0xbc84('0x7c')]){return _0x7410df(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1fbb31[_0xbc84('0x46')]===_0xbc84('0x7d')){if('undefined'==typeof _0x1fbb31[_0xbc84('0x7c')]['views']){return _0x7410df(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')]['admin']&&'undefined'==typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x7f')]){return _0x7410df(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1fbb31['type']===_0xbc84('0x80')){if('undefined'==typeof _0x1fbb31['parameters'][_0xbc84('0x81')]){return _0x7410df(new Error(_0xbc84('0x82')));}if(_0xbc84('0x78')==typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x83')]){return _0x7410df(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x7410df(new Error(_0xbc84('0x84')));}var _0x4afb02=_0x1fbb31['name'];var _0x43993b=_0x1fbb31[_0xbc84('0x85')];var _0x4d1dc8=_0x1fbb31['type'];var _0x5ca4a9=_0x1fbb31[_0xbc84('0x86')]?_0x1fbb31['sidebar']:_0xbc84('0x87');var _0x533270=_0x1fbb31[_0xbc84('0x88')]?_0x1fbb31[_0xbc84('0x88')]:_0xbc84('0x89');var _0x1adc1f='';var _0x17d522='';var _0x572c7e='';var _0x100535='';var _0x44d3a0=_0x1fbb31[_0xbc84('0x7a')];if(_0x4d1dc8==='html'){if(_0xbc84('0x78')!=typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x8a')]){var _0x22689f=_0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x8a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x22689f)){_0x1adc1f=path['join'](_0xbc84('0x8b'),_0x1c417a,_0x2930c8[0x0],_0x22689f);}else{_0x1adc1f=_0x22689f;}}else{logger[_0xbc84('0x68')](_0xbc84('0x8c'));}if('undefined'!=typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x7f')]){var _0x35ea06=_0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xbc84('0x8d')](_0x35ea06)){_0x17d522=path[_0xbc84('0x4f')]('plugins',_0x1c417a,_0x2930c8[0x0],_0x35ea06);}else{_0x17d522=_0x35ea06;}}else{logger[_0xbc84('0x68')](_0xbc84('0x8e'));}}else if(_0x4d1dc8==='script'){_0x572c7e=_0x1fbb31[_0xbc84('0x7c')]['scriptName'];_0x100535=_0x1fbb31[_0xbc84('0x7c')]['scriptPath'];if('undefined'!=typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')]){if(_0xbc84('0x78')!=typeof _0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x8a')]){var _0x22689f=_0x1fbb31[_0xbc84('0x7c')][_0xbc84('0x7e')][_0xbc84('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xbc84('0x8d')](_0x22689f)){_0x1adc1f=path['join'](_0xbc84('0x8b'),_0x1c417a,_0x2930c8[0x0],_0x22689f);}else{_0x1adc1f=_0x22689f;}}if(_0xbc84('0x78')!=typeof _0x1fbb31[_0xbc84('0x7c')]['views']['agent']){var _0x35ea06=_0x1fbb31['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xbc84('0x8d')](_0x35ea06)){_0x17d522=path[_0xbc84('0x4f')](_0xbc84('0x8b'),_0x1c417a,_0x2930c8[0x0],_0x35ea06);}else{_0x17d522=_0x35ea06;}}}}var _0x17d89e={'name':_0x4afb02,'description':_0x43993b,'path':path[_0xbc84('0x4f')](_0x1c417a,_0x2930c8[0x0]),'type':_0x4d1dc8,'sidebar':_0x5ca4a9,'icon':_0x533270,'adminUrl':_0x1adc1f,'agentUrl':_0x17d522,'scriptName':_0x572c7e,'scriptPath':_0x100535,'version':_0x44d3a0};removeReferences(_0x1a70d6,null);return db[_0xbc84('0x32')][_0xbc84('0x8f')](_0x17d89e)[_0xbc84('0x29')](function(_0x11f4e2){var _0x5c13e6={'role':_0x4c7eaf[_0xbc84('0x90')][_0xbc84('0x91')],'userProfileId':_0x4c7eaf['body'][_0xbc84('0x92')]};if(!_0x5c13e6)throw new Error(_0xbc84('0x93'));if(_0x5c13e6['role']===_0xbc84('0x94')){var _0x1d4332=_0x11f4e2[_0xbc84('0x2b')]({'plain':!![]});return db[_0xbc84('0x95')][_0xbc84('0x4e')]({'where':{'name':_0xbc84('0x96'),'userProfileId':_0x5c13e6[_0xbc84('0x92')]},'raw':!![]})[_0xbc84('0x29')](function(_0x541531){if(_0x541531&&_0x541531['autoAssociation']===0x0){return db[_0xbc84('0x2c')][_0xbc84('0x8f')]({'name':_0x1d4332['name'],'resourceId':_0x1d4332['id'],'type':_0x541531[_0xbc84('0x2f')],'sectionId':_0x541531['id']},{})[_0xbc84('0x29')](function(){return _0x11f4e2;});}else{return _0x11f4e2;}})[_0xbc84('0x4a')](function(_0x1aedcf){logger[_0xbc84('0x2d')](_0xbc84('0x97'),_0x1aedcf);throw _0x1aedcf;});}return _0x11f4e2;})['then'](respondWithResult(_0x473753,null))[_0xbc84('0x4a')](handleError(_0x473753,null));}});}catch(_0x1bff6d){_0x473753[_0xbc84('0x1d')](0x1f4)[_0xbc84('0x30')](_0x1bff6d);}};function removeReferences(_0x560165,_0x4a1989){try{if(_0x560165){fs['unlinkSync'](_0x560165);logger[_0xbc84('0x68')](_0xbc84('0x98'));}if(_0x4a1989){rimraf(_0x4a1989,function(){});logger[_0xbc84('0x68')](_0xbc84('0x99'));}}catch(_0xf08cc2){logger[_0xbc84('0x2d')](_0xf08cc2);}}exports[_0xbc84('0x28')]=function(_0x556973,_0x1a40c5,_0x5b916f){return db[_0xbc84('0x32')][_0xbc84('0x4e')]({'where':{'id':_0x556973[_0xbc84('0x4b')]['id']}})[_0xbc84('0x29')](handleEntityNotFound(_0x1a40c5,null))[_0xbc84('0x29')](saveUpdates(_0x556973[_0xbc84('0x90')],null))[_0xbc84('0x29')](respondWithResult(_0x1a40c5,null))[_0xbc84('0x4a')](handleError(_0x1a40c5,null));};exports[_0xbc84('0x9a')]=function(_0x5b1eb9,_0x22c1ac,_0x43bbf3){return db[_0xbc84('0x32')]['find']({'where':{'id':_0x5b1eb9[_0xbc84('0x4b')]['id']}})[_0xbc84('0x29')](function(_0x133d70){if(_0x133d70){return _0x133d70[_0xbc84('0x2a')]();}})[_0xbc84('0x29')](function(_0x5bf06e){rimraf(path[_0xbc84('0x4f')](config[_0xbc84('0x50')],_0xbc84('0x5c'),path[_0xbc84('0x5d')](_0x5bf06e[_0xbc84('0x5')])),function(){});return _0x5bf06e;})[_0xbc84('0x29')](handleEntityNotFound(_0x22c1ac,null))['then'](respondWithStatusCode(_0x22c1ac,null))['catch'](handleError(_0x22c1ac,null));};exports[_0xbc84('0x9b')]=function(_0x548d52,_0x245433,_0x3e131e){return BPromise[_0xbc84('0x9c')]()[_0xbc84('0x29')](function(){if(!_0x548d52[_0xbc84('0x38')][_0xbc84('0x5')]){throw new Error(_0xbc84('0x9d'));}if(!_0x548d52[_0xbc84('0x38')][_0xbc84('0x9e')]){throw new Error(_0xbc84('0x9f'));}var _0x56f252=_0x548d52[_0xbc84('0x38')][_0xbc84('0xa0')]?_0x548d52[_0xbc84('0x38')]['hostname']+':'+_0x548d52[_0xbc84('0x38')][_0xbc84('0x9e')]:_0xbc84('0xa1')+_0x548d52[_0xbc84('0x38')][_0xbc84('0x9e')];var _0x25b8a9=_0x548d52[_0xbc84('0x38')][_0xbc84('0x1f')]?_0x548d52[_0xbc84('0x38')]['json']:!![];var _0x2070a1=_0x548d52[_0xbc84('0x38')]['encoding']?_0x548d52[_0xbc84('0x38')][_0xbc84('0xa2')]:null;var _0x4ee5cb={'method':_0x548d52['method'],'uri':util[_0xbc84('0x65')]('%s%s',_0x56f252,_0x548d52['query']['path']),'json':_0x25b8a9,'resolveWithFullResponse':!![],'encoding':_0x2070a1,'qs':_0x548d52[_0xbc84('0x38')]};if(_0x548d52[_0xbc84('0xa3')]){_0x4ee5cb['headers']=_0x548d52[_0xbc84('0xa3')];if(_0x4ee5cb[_0xbc84('0xa3')]['content-length']){delete _0x4ee5cb[_0xbc84('0xa3')]['content-length'];}}if(_0x4ee5cb[_0xbc84('0xa3')]['content-type']){delete _0x4ee5cb['headers'][_0xbc84('0xa4')];}return rp(_0x4ee5cb);})['then'](function(_0x36e189){if(_0x36e189){_0x245433[_0xbc84('0x23')](_0x36e189[_0xbc84('0xa3')]);logger[_0xbc84('0x68')](_0x36e189[_0xbc84('0x90')]);if(_[_0xbc84('0xa5')](_0x548d52[_0xbc84('0x38')][_0xbc84('0x5')],'download')&&_0x36e189['statusCode']==0x1f4){return _0x245433[_0xbc84('0xa6')](_0x36e189[_0xbc84('0xa7')]);}else{return _0x245433[_0xbc84('0x1d')](_0x36e189['statusCode'])[_0xbc84('0x30')](_0x36e189[_0xbc84('0x90')]);}}else{return _0x245433[_0xbc84('0xa6')](0xc8);}})[_0xbc84('0x4a')](handleError(_0x245433,null));};exports['webhookPost']=function(_0x59b2da,_0x4cb888,_0x5e84df){return BPromise['resolve']()[_0xbc84('0x29')](function(){if(!_0x59b2da['query'][_0xbc84('0x5')]){throw new Error(_0xbc84('0x9d'));}if(!_0x59b2da[_0xbc84('0x38')][_0xbc84('0x9e')]){throw new Error(_0xbc84('0x9f'));}var _0x543731=_0x59b2da[_0xbc84('0x38')]['hostname']?_0x59b2da[_0xbc84('0x38')][_0xbc84('0xa0')]+':'+_0x59b2da[_0xbc84('0x38')]['port']:'http://localhost:'+_0x59b2da['query']['port'];var _0x1c8ba7=_0x59b2da[_0xbc84('0x38')]['json']?_0x59b2da['query'][_0xbc84('0x1f')]:!![];var _0x15db5c=_0x59b2da[_0xbc84('0x38')][_0xbc84('0xa2')]?_0x59b2da[_0xbc84('0x38')][_0xbc84('0xa2')]:null;var _0x3abf65={'method':_0x59b2da[_0xbc84('0xa8')],'uri':util[_0xbc84('0x65')](_0xbc84('0xa9'),_0x543731,_0x59b2da[_0xbc84('0x38')][_0xbc84('0x5')]),'json':_0x1c8ba7,'resolveWithFullResponse':!![],'encoding':_0x15db5c,'body':_0x59b2da[_0xbc84('0x90')]};if(_0x59b2da[_0xbc84('0xa3')]){_0x3abf65[_0xbc84('0xa3')]=_0x59b2da[_0xbc84('0xa3')];if(_0x3abf65[_0xbc84('0xa3')][_0xbc84('0xaa')]){delete _0x3abf65[_0xbc84('0xa3')][_0xbc84('0xaa')];}}if(_0x3abf65[_0xbc84('0xa3')][_0xbc84('0xa4')]){delete _0x3abf65[_0xbc84('0xa3')][_0xbc84('0xa4')];}return rp(_0x3abf65);})[_0xbc84('0x29')](function(_0x56fe0d){if(_0x56fe0d){_0x4cb888['set'](_0x56fe0d[_0xbc84('0xa3')]);logger[_0xbc84('0x68')](_0x56fe0d[_0xbc84('0x90')]);return _0x4cb888[_0xbc84('0x1d')](_0x56fe0d['statusCode'])[_0xbc84('0x30')](_0x56fe0d[_0xbc84('0x90')]);}else{return _0x4cb888[_0xbc84('0xa6')](0xc8);}})[_0xbc84('0x4a')](handleError(_0x4cb888,null));};
\ No newline at end of file
+var _0x9db5=['localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Plugins','error','stack','name','index','map','Plugin','rawAttributes','type','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','intersection','length','download','find','path','server/files/plugins','%s.zip','createWriteStream','zip','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','root','dirname','basename','attachments/**/*','finalize','close','existsSync','Error','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','info','file','extname','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','manifest.json','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','format','%s%s','headers','content-length','statusCode','send','content-type','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis'];(function(_0x5b5c66,_0x232916){var _0x19c519=function(_0x2f64bd){while(--_0x2f64bd){_0x5b5c66['push'](_0x5b5c66['shift']());}};_0x19c519(++_0x232916);}(_0x9db5,0x12c));var _0x59db=function(_0x242b51,_0x586c72){_0x242b51=_0x242b51-0x0;var _0xc63c10=_0x9db5[_0x242b51];return _0xc63c10;};'use strict';var emlformat=require(_0x59db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x59db('0x1'));var jsonpatch=require(_0x59db('0x2'));var rp=require(_0x59db('0x3'));var moment=require(_0x59db('0x4'));var BPromise=require(_0x59db('0x5'));var Mustache=require(_0x59db('0x6'));var util=require('util');var path=require('path');var sox=require(_0x59db('0x7'));var csv=require(_0x59db('0x8'));var ejs=require(_0x59db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x59db('0xa'));var squel=require('squel');var crypto=require(_0x59db('0xb'));var jsforce=require(_0x59db('0xc'));var deskjs=require(_0x59db('0xd'));var toCsv=require(_0x59db('0x8'));var querystring=require(_0x59db('0xe'));var Papa=require(_0x59db('0xf'));var extract=require(_0x59db('0x10'));var rimraf=require(_0x59db('0x11'));var archiver=require(_0x59db('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x59db('0x13'));var as=require(_0x59db('0x14'));var hardwareService=require(_0x59db('0x15'));var logger=require('../../config/logger')(_0x59db('0x16'));var utils=require('../../config/utils');var config=require(_0x59db('0x17'));var licenseUtil=require(_0x59db('0x18'));var db=require(_0x59db('0x19'))['db'];config['redis']=_[_0x59db('0x1a')](config[_0x59db('0x1b')],{'host':_0x59db('0x1c'),'port':0x18eb});var socket=require(_0x59db('0x1d'))(new Redis(config['redis']));require(_0x59db('0x1e'))[_0x59db('0x1f')](socket);function respondWithStatusCode(_0x4e03aa,_0x3b6100){_0x3b6100=_0x3b6100||0xcc;return function(_0x340f0d){if(_0x340f0d){return _0x4e03aa[_0x59db('0x20')](_0x3b6100);}return _0x4e03aa[_0x59db('0x21')](_0x3b6100)[_0x59db('0x22')]();};}function respondWithResult(_0x3f595b,_0x51d203){_0x51d203=_0x51d203||0xc8;return function(_0x14df1d){if(_0x14df1d){return _0x3f595b[_0x59db('0x21')](_0x51d203)[_0x59db('0x23')](_0x14df1d);}};}function respondWithFilteredResult(_0x3fe09d,_0x3f40c6){return function(_0x5adc79){if(_0x5adc79){var _0x44f4ef=typeof _0x3f40c6[_0x59db('0x24')]===_0x59db('0x25')&&typeof _0x3f40c6[_0x59db('0x26')]===_0x59db('0x25');var _0x453c44=_0x5adc79[_0x59db('0x27')];var _0x40e4cc=_0x44f4ef?0x0:_0x3f40c6['offset'];var _0x4989a2=_0x44f4ef?_0x5adc79['count']:_0x3f40c6[_0x59db('0x24')]+_0x3f40c6[_0x59db('0x26')];var _0x5690fb;if(_0x4989a2>=_0x453c44){_0x4989a2=_0x453c44;_0x5690fb=0xc8;}else{_0x5690fb=0xce;}_0x3fe09d[_0x59db('0x21')](_0x5690fb);return _0x3fe09d[_0x59db('0x28')](_0x59db('0x29'),_0x40e4cc+'-'+_0x4989a2+'/'+_0x453c44)[_0x59db('0x23')](_0x5adc79);}return null;};}function patchUpdates(_0x9fd46b){return function(_0x4ae20d){try{jsonpatch[_0x59db('0x2a')](_0x4ae20d,_0x9fd46b,!![]);}catch(_0x4abce8){return BPromise['reject'](_0x4abce8);}return _0x4ae20d['save']();};}function saveUpdates(_0x48cdf0,_0x5c3688){return function(_0x136722){if(_0x136722){return _0x136722[_0x59db('0x2b')](_0x48cdf0)[_0x59db('0x2c')](function(_0x5a4b8c){return _0x5a4b8c;});}return null;};}function removeEntity(_0x13e8c3,_0x48c803){return function(_0x1c85d5){if(_0x1c85d5){return _0x1c85d5[_0x59db('0x2d')]()[_0x59db('0x2c')](function(){var _0x3b8a71=_0x1c85d5[_0x59db('0x2e')]({'plain':!![]});var _0x270f86=_0x59db('0x2f');return db['UserProfileResource'][_0x59db('0x2d')]({'where':{'type':_0x270f86,'resourceId':_0x3b8a71['id']}})[_0x59db('0x2c')](function(){return _0x1c85d5;});})['then'](function(){_0x13e8c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1d55,_0x6914c0){return function(_0x558c3f){if(!_0x558c3f){_0x3f1d55[_0x59db('0x20')](0x194);}return _0x558c3f;};}function handleError(_0x49b7d9,_0x160db2){_0x160db2=_0x160db2||0x1f4;return function(_0x29e418){logger[_0x59db('0x30')](_0x29e418[_0x59db('0x31')]);if(_0x29e418[_0x59db('0x32')]){delete _0x29e418[_0x59db('0x32')];}_0x49b7d9[_0x59db('0x21')](_0x160db2)['send'](_0x29e418);};}exports[_0x59db('0x33')]=function(_0x5a93c2,_0x162e4a){var _0x18689d={},_0x466945={},_0x3cd9f0={'count':0x0,'rows':[]};var _0x221e73=_[_0x59db('0x34')](db[_0x59db('0x35')][_0x59db('0x36')],function(_0x2a5b71){return{'name':_0x2a5b71['fieldName'],'type':_0x2a5b71[_0x59db('0x37')]['key']};});_0x466945[_0x59db('0x38')]=_[_0x59db('0x34')](_0x221e73,_0x59db('0x32'));_0x466945[_0x59db('0x39')]=_[_0x59db('0x3a')](_0x5a93c2['query']);_0x466945[_0x59db('0x3b')]=_['intersection'](_0x466945[_0x59db('0x38')],_0x466945[_0x59db('0x39')]);_0x18689d[_0x59db('0x3c')]=_['intersection'](_0x466945[_0x59db('0x38')],qs[_0x59db('0x3d')](_0x5a93c2['query'][_0x59db('0x3d')]));_0x18689d['attributes']=_0x18689d[_0x59db('0x3c')]['length']?_0x18689d[_0x59db('0x3c')]:_0x466945[_0x59db('0x38')];if(!_0x5a93c2[_0x59db('0x39')][_0x59db('0x3e')](_0x59db('0x3f'))){_0x18689d['limit']=qs[_0x59db('0x26')](_0x5a93c2[_0x59db('0x39')][_0x59db('0x26')]);_0x18689d[_0x59db('0x24')]=qs['offset'](_0x5a93c2[_0x59db('0x39')]['offset']);}_0x18689d[_0x59db('0x40')]=qs[_0x59db('0x41')](_0x5a93c2[_0x59db('0x39')][_0x59db('0x41')]);_0x18689d['where']=qs[_0x59db('0x3b')](_[_0x59db('0x42')](_0x5a93c2['query'],_0x466945[_0x59db('0x3b')]),_0x221e73);if(_0x5a93c2[_0x59db('0x39')][_0x59db('0x43')]){_0x18689d[_0x59db('0x44')]=_[_0x59db('0x45')](_0x18689d[_0x59db('0x44')],{'$or':_['map'](_0x221e73,function(_0x386b32){if(_0x386b32[_0x59db('0x37')]!==_0x59db('0x46')){var _0x1fa4ce={};_0x1fa4ce[_0x386b32[_0x59db('0x32')]]={'$like':'%'+_0x5a93c2[_0x59db('0x39')]['filter']+'%'};return _0x1fa4ce;}})});}_0x18689d=_[_0x59db('0x45')]({},_0x18689d,_0x5a93c2[_0x59db('0x47')]);var _0x3f8527={'where':_0x18689d[_0x59db('0x44')]};return db['Plugin'][_0x59db('0x27')](_0x3f8527)['then'](function(_0x49f839){_0x3cd9f0['count']=_0x49f839;if(_0x5a93c2[_0x59db('0x39')][_0x59db('0x48')]){_0x18689d[_0x59db('0x49')]=[{'all':!![]}];}return db['Plugin']['findAll'](_0x18689d);})[_0x59db('0x2c')](function(_0x3e5f02){_0x3cd9f0['rows']=_0x3e5f02;return _0x3cd9f0;})[_0x59db('0x2c')](respondWithFilteredResult(_0x162e4a,_0x18689d))[_0x59db('0x4a')](handleError(_0x162e4a,null));};exports[_0x59db('0x4b')]=function(_0x13258e,_0x56b45f){var _0x220c29={'raw':!![],'where':{'id':_0x13258e[_0x59db('0x4c')]['id']}},_0x24cd26={};_0x24cd26[_0x59db('0x38')]=_[_0x59db('0x3a')](db[_0x59db('0x35')][_0x59db('0x36')]);_0x24cd26[_0x59db('0x39')]=_['keys'](_0x13258e['query']);_0x24cd26[_0x59db('0x3b')]=_['intersection'](_0x24cd26[_0x59db('0x38')],_0x24cd26[_0x59db('0x39')]);_0x220c29[_0x59db('0x3c')]=_[_0x59db('0x4d')](_0x24cd26[_0x59db('0x38')],qs[_0x59db('0x3d')](_0x13258e[_0x59db('0x39')][_0x59db('0x3d')]));_0x220c29[_0x59db('0x3c')]=_0x220c29[_0x59db('0x3c')][_0x59db('0x4e')]?_0x220c29[_0x59db('0x3c')]:_0x24cd26[_0x59db('0x38')];if(_0x13258e[_0x59db('0x39')][_0x59db('0x48')]){_0x220c29['include']=[{'all':!![]}];}_0x220c29=_[_0x59db('0x45')]({},_0x220c29,_0x13258e[_0x59db('0x47')]);return db[_0x59db('0x35')]['find'](_0x220c29)[_0x59db('0x2c')](handleEntityNotFound(_0x56b45f,null))[_0x59db('0x2c')](respondWithResult(_0x56b45f,null))[_0x59db('0x4a')](handleError(_0x56b45f,null));};exports[_0x59db('0x4f')]=function(_0x194b54,_0x1d6d18,_0x90a0d7){return db[_0x59db('0x35')][_0x59db('0x50')]({'where':{'id':_0x194b54[_0x59db('0x4c')]['id']},'attributes':[_0x59db('0x32'),_0x59db('0x51')],'raw':!![]})[_0x59db('0x2c')](handleEntityNotFound(_0x1d6d18,null))[_0x59db('0x2c')](function(_0x1d0e66){if(_0x1d0e66){var _0x488e43=path['join'](config['root'],_0x59db('0x52'),util['format'](_0x59db('0x53'),path['basename'](_0x1d0e66[_0x59db('0x51')])));var _0x12ab89=fs[_0x59db('0x54')](_0x488e43);var _0x5185f0=archiver(_0x59db('0x55'),{'zlib':{'level':0x9}});_0x5185f0['on']('warning',function(_0x551ab1){if(_0x551ab1[_0x59db('0x56')]===_0x59db('0x57')){logger[_0x59db('0x30')](_0x551ab1);}else{throw new db[(_0x59db('0x58'))]['Error'](_0x59db('0x59'));}});_0x5185f0['on']('error',function(_0x598f56){throw new db['Sequelize']['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5185f0[_0x59db('0x5a')](_0x12ab89);_0x5185f0[_0x59db('0x5b')](_0x59db('0x5c'),{'cwd':path[_0x59db('0x5d')](config[_0x59db('0x5e')],_0x59db('0x52'),path[_0x59db('0x5f')](_0x1d0e66[_0x59db('0x51')])),'ignore':[path[_0x59db('0x5d')](path[_0x59db('0x60')](_0x1d0e66['path']),'node_modules/**/*'),path[_0x59db('0x5d')](path[_0x59db('0x60')](_0x1d0e66[_0x59db('0x51')]),_0x59db('0x61'))],'nodir':!![]})[_0x59db('0x62')]();_0x12ab89['on'](_0x59db('0x63'),function(){if(!fs[_0x59db('0x64')](_0x488e43)){throw new db[(_0x59db('0x58'))]['Error']('Plugin\x20not\x20found');}return _0x1d6d18[_0x59db('0x4f')](_0x488e43,util['format'](_0x59db('0x53'),path[_0x59db('0x60')](_0x1d0e66['path'])),function(_0xc0e39b){if(_0xc0e39b){throw new db['Sequelize'][(_0x59db('0x65'))](_0x59db('0x66'));}fs['unlinkSync'](_0x488e43);logger['info'](_0x59db('0x67'));logger[_0x59db('0x68')]('Temporary\x20file\x20removed');});});}return null;})[_0x59db('0x4a')](handleError(_0x1d6d18,null));};exports['upload']=function(_0x338bc4,_0x4682ad,_0x41a1b2){var _0x1857cc=path[_0x59db('0x60')](_0x338bc4[_0x59db('0x69')]['filename'],path[_0x59db('0x6a')](_0x338bc4[_0x59db('0x69')]['filename']));var _0x378a6e=path[_0x59db('0x5d')](config['root'],_0x59db('0x52'),_0x338bc4['file']['filename']);var _0x1e5ec9=path[_0x59db('0x5d')](config[_0x59db('0x5e')],_0x59db('0x52'),_0x1857cc);logger[_0x59db('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x378a6e);logger['info'](_0x59db('0x6b'),_0x1e5ec9);try{fs['chmodSync'](_0x378a6e,parseInt('0777',0x8));extract(_0x378a6e,{'dir':_0x1e5ec9},function(_0x3a5b44){if(_0x3a5b44){logger[_0x59db('0x30')](_0x3a5b44);handleError(_0x3a5b44,!![]);};var _0xb7e52c=fs[_0x59db('0x6c')](_0x1e5ec9);if(_0xb7e52c[_0x59db('0x4e')]>0x1){removeReferences(_0x378a6e,_0x1e5ec9);logger[_0x59db('0x30')](_0x59db('0x6d'));return _0x41a1b2(new Error(_0x59db('0x6d')));}var _0x1afc3b=fs[_0x59db('0x6e')](path[_0x59db('0x5d')](_0x1e5ec9,_0xb7e52c[0x0]));if(_0x1afc3b['isFile']()){removeReferences(_0x378a6e,_0x1e5ec9);logger[_0x59db('0x30')]('Invalid\x20plugin\x20structure');return _0x41a1b2(new Error(_0x59db('0x6d')));}if(_0x1afc3b['isDirectory']()){var _0x36152f=fs[_0x59db('0x6c')](path[_0x59db('0x5d')](_0x1e5ec9,_0xb7e52c[0x0]));if(_0x36152f[_0x59db('0x4e')]===0x0){removeReferences(_0x378a6e,_0x1e5ec9);logger[_0x59db('0x30')](_0x59db('0x6d'));return _0x41a1b2(new Error('Invalid\x20plugin\x20structure'));}var _0x19e668=_0x36152f['some'](function(_0x565b77){return _0x565b77===_0x59db('0x6f');});if(!_0x19e668){return _0x41a1b2(new Error('Plugin\x20manifest\x20missing'));}var _0x377c63=fs[_0x59db('0x70')](path[_0x59db('0x5d')](_0x1e5ec9,_0xb7e52c[0x0],_0x59db('0x6f')));var _0x4215d0=JSON['parse'](_0x377c63);if(_0x59db('0x25')==typeof _0x4215d0[_0x59db('0x32')]){return _0x41a1b2(new Error(_0x59db('0x71')));}if(_0x59db('0x25')==typeof _0x4215d0[_0x59db('0x37')]){return _0x41a1b2(new Error(_0x59db('0x72')));}if(_0x59db('0x25')==typeof _0x4215d0[_0x59db('0x73')]){return _0x41a1b2(new Error(_0x59db('0x74')));}if('undefined'==typeof _0x4215d0[_0x59db('0x75')]){return _0x41a1b2(new Error(_0x59db('0x76')));}if(_0x4215d0[_0x59db('0x37')]===_0x59db('0x77')){if('undefined'==typeof _0x4215d0[_0x59db('0x75')][_0x59db('0x78')]){return _0x41a1b2(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x59db('0x25')==typeof _0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x79')]&&_0x59db('0x25')==typeof _0x4215d0[_0x59db('0x75')]['views'][_0x59db('0x7a')]){return _0x41a1b2(new Error(_0x59db('0x7b')));}}else if(_0x4215d0[_0x59db('0x37')]===_0x59db('0x7c')){if(_0x59db('0x25')==typeof _0x4215d0['parameters'][_0x59db('0x7d')]){return _0x41a1b2(new Error(_0x59db('0x7e')));}if(_0x59db('0x25')==typeof _0x4215d0[_0x59db('0x75')]['scriptPath']){return _0x41a1b2(new Error(_0x59db('0x7f')));}}else{return _0x41a1b2(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x59590f=_0x4215d0[_0x59db('0x32')];var _0x5d0176=_0x4215d0[_0x59db('0x80')];var _0x48f493=_0x4215d0[_0x59db('0x37')];var _0x480dd8=_0x4215d0[_0x59db('0x81')]?_0x4215d0[_0x59db('0x81')]:_0x59db('0x82');var _0x96cb49=_0x4215d0[_0x59db('0x83')]?_0x4215d0[_0x59db('0x83')]:_0x59db('0x84');var _0x7b9c30='';var _0x12d4e2='';var _0x12b3f5='';var _0x445d8b='';var _0x4b0447=_0x4215d0['version'];if(_0x48f493===_0x59db('0x77')){if('undefined'!=typeof _0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x79')]){var _0x5caa94=_0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x59db('0x85')](_0x5caa94)){_0x7b9c30=path[_0x59db('0x5d')](_0x59db('0x86'),_0x1857cc,_0xb7e52c[0x0],_0x5caa94);}else{_0x7b9c30=_0x5caa94;}}else{logger['info'](_0x59db('0x87'));}if(_0x59db('0x25')!=typeof _0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x7a')]){var _0x2ac4fe=_0x4215d0['parameters'][_0x59db('0x78')][_0x59db('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x59db('0x85')](_0x2ac4fe)){_0x12d4e2=path[_0x59db('0x5d')](_0x59db('0x86'),_0x1857cc,_0xb7e52c[0x0],_0x2ac4fe);}else{_0x12d4e2=_0x2ac4fe;}}else{logger[_0x59db('0x68')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x48f493===_0x59db('0x7c')){_0x12b3f5=_0x4215d0[_0x59db('0x75')]['scriptName'];_0x445d8b=_0x4215d0['parameters']['scriptPath'];if(_0x59db('0x25')!=typeof _0x4215d0['parameters'][_0x59db('0x78')]){if(_0x59db('0x25')!=typeof _0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x79')]){var _0x5caa94=_0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x79')];if(!/^(f|ht)tps?:\/\//i[_0x59db('0x85')](_0x5caa94)){_0x7b9c30=path[_0x59db('0x5d')](_0x59db('0x86'),_0x1857cc,_0xb7e52c[0x0],_0x5caa94);}else{_0x7b9c30=_0x5caa94;}}if(_0x59db('0x25')!=typeof _0x4215d0['parameters']['views'][_0x59db('0x7a')]){var _0x2ac4fe=_0x4215d0[_0x59db('0x75')][_0x59db('0x78')][_0x59db('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0x59db('0x85')](_0x2ac4fe)){_0x12d4e2=path[_0x59db('0x5d')]('plugins',_0x1857cc,_0xb7e52c[0x0],_0x2ac4fe);}else{_0x12d4e2=_0x2ac4fe;}}}}var _0x53efa7={'name':_0x59590f,'description':_0x5d0176,'path':path[_0x59db('0x5d')](_0x1857cc,_0xb7e52c[0x0]),'type':_0x48f493,'sidebar':_0x480dd8,'icon':_0x96cb49,'adminUrl':_0x7b9c30,'agentUrl':_0x12d4e2,'scriptName':_0x12b3f5,'scriptPath':_0x445d8b,'version':_0x4b0447};removeReferences(_0x378a6e,null);return db['Plugin'][_0x59db('0x88')](_0x53efa7)[_0x59db('0x2c')](function(_0x16e3e5){var _0x54bf41={'role':_0x338bc4[_0x59db('0x89')][_0x59db('0x8a')],'userProfileId':_0x338bc4[_0x59db('0x89')][_0x59db('0x8b')]};if(!_0x54bf41)throw new Error(_0x59db('0x8c'));if(_0x54bf41[_0x59db('0x8a')]===_0x59db('0x8d')){var _0x370db8=_0x16e3e5['get']({'plain':!![]});return db[_0x59db('0x8e')]['find']({'where':{'name':_0x59db('0x2f'),'userProfileId':_0x54bf41[_0x59db('0x8b')]},'raw':!![]})[_0x59db('0x2c')](function(_0x2964f1){if(_0x2964f1&&_0x2964f1[_0x59db('0x8f')]===0x0){return db[_0x59db('0x90')][_0x59db('0x88')]({'name':_0x370db8[_0x59db('0x32')],'resourceId':_0x370db8['id'],'type':_0x2964f1[_0x59db('0x32')],'sectionId':_0x2964f1['id']},{})[_0x59db('0x2c')](function(){return _0x16e3e5;});}else{return _0x16e3e5;}})['catch'](function(_0x5d8b22){logger[_0x59db('0x30')](_0x59db('0x91'),_0x5d8b22);throw _0x5d8b22;});}return _0x16e3e5;})['then'](respondWithResult(_0x4682ad,null))[_0x59db('0x4a')](handleError(_0x4682ad,null));}});}catch(_0x114e66){_0x4682ad[_0x59db('0x21')](0x1f4)['send'](_0x114e66);}};function removeReferences(_0x1c488b,_0x5e17bc){try{if(_0x1c488b){fs[_0x59db('0x92')](_0x1c488b);logger[_0x59db('0x68')]('Zip\x20archive\x20removed');}if(_0x5e17bc){rimraf(_0x5e17bc,function(){});logger[_0x59db('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x151b25){logger[_0x59db('0x30')](_0x151b25);}}exports[_0x59db('0x2b')]=function(_0x3854b9,_0x556e51,_0x3e29f2){return db[_0x59db('0x35')][_0x59db('0x50')]({'where':{'id':_0x3854b9[_0x59db('0x4c')]['id']}})[_0x59db('0x2c')](handleEntityNotFound(_0x556e51,null))['then'](saveUpdates(_0x3854b9[_0x59db('0x89')],null))[_0x59db('0x2c')](respondWithResult(_0x556e51,null))['catch'](handleError(_0x556e51,null));};exports[_0x59db('0x93')]=function(_0x3e4d6f,_0x4f2d86,_0x4cf4d3){return db[_0x59db('0x35')][_0x59db('0x50')]({'where':{'id':_0x3e4d6f[_0x59db('0x4c')]['id']}})[_0x59db('0x2c')](function(_0x26cb7c){if(_0x26cb7c){return _0x26cb7c[_0x59db('0x2d')]();}})['then'](function(_0x8a890b){rimraf(path[_0x59db('0x5d')](config[_0x59db('0x5e')],_0x59db('0x52'),path['dirname'](_0x8a890b[_0x59db('0x51')])),function(){});return _0x8a890b;})[_0x59db('0x2c')](handleEntityNotFound(_0x4f2d86,null))[_0x59db('0x2c')](respondWithStatusCode(_0x4f2d86,null))[_0x59db('0x4a')](handleError(_0x4f2d86,null));};exports[_0x59db('0x94')]=function(_0x5de402,_0x8e5616,_0x21ea99){return BPromise[_0x59db('0x95')]()['then'](function(){if(!_0x5de402[_0x59db('0x39')][_0x59db('0x51')]){throw new Error(_0x59db('0x96'));}if(!_0x5de402['query'][_0x59db('0x97')]){throw new Error(_0x59db('0x98'));}var _0x4a41c5=_0x5de402[_0x59db('0x39')][_0x59db('0x99')]?_0x5de402[_0x59db('0x39')][_0x59db('0x99')]+':'+_0x5de402['query']['port']:_0x59db('0x9a')+_0x5de402[_0x59db('0x39')][_0x59db('0x97')];var _0x228642=_0x5de402[_0x59db('0x39')][_0x59db('0x23')]?_0x5de402[_0x59db('0x39')][_0x59db('0x23')]:!![];var _0x35276d=_0x5de402[_0x59db('0x39')][_0x59db('0x9b')]?_0x5de402[_0x59db('0x39')][_0x59db('0x9b')]:null;var _0xe87aa3={'method':_0x5de402[_0x59db('0x9c')],'uri':util[_0x59db('0x9d')](_0x59db('0x9e'),_0x4a41c5,_0x5de402[_0x59db('0x39')][_0x59db('0x51')]),'json':_0x228642,'resolveWithFullResponse':!![],'encoding':_0x35276d,'qs':_0x5de402['query']};if(_0x5de402['headers']){_0xe87aa3['headers']=_0x5de402[_0x59db('0x9f')];if(_0xe87aa3[_0x59db('0x9f')][_0x59db('0xa0')]){delete _0xe87aa3[_0x59db('0x9f')][_0x59db('0xa0')];}}if(_0xe87aa3['headers']['content-type']){delete _0xe87aa3[_0x59db('0x9f')]['content-type'];}return rp(_0xe87aa3);})[_0x59db('0x2c')](function(_0x326135){if(_0x326135){_0x8e5616[_0x59db('0x28')](_0x326135['headers']);logger[_0x59db('0x68')](_0x326135['body']);if(_['endsWith'](_0x5de402['query'][_0x59db('0x51')],'download')&&_0x326135['statusCode']==0x1f4){return _0x8e5616[_0x59db('0x20')](_0x326135[_0x59db('0xa1')]);}else{return _0x8e5616['status'](_0x326135[_0x59db('0xa1')])[_0x59db('0xa2')](_0x326135['body']);}}else{return _0x8e5616[_0x59db('0x20')](0xc8);}})[_0x59db('0x4a')](handleError(_0x8e5616,null));};exports['webhookPost']=function(_0x45765f,_0x3e4802,_0x2ad6ea){return BPromise['resolve']()[_0x59db('0x2c')](function(){if(!_0x45765f[_0x59db('0x39')][_0x59db('0x51')]){throw new Error(_0x59db('0x96'));}if(!_0x45765f['query'][_0x59db('0x97')]){throw new Error(_0x59db('0x98'));}var _0x5284da=_0x45765f[_0x59db('0x39')][_0x59db('0x99')]?_0x45765f[_0x59db('0x39')][_0x59db('0x99')]+':'+_0x45765f['query'][_0x59db('0x97')]:'http://localhost:'+_0x45765f[_0x59db('0x39')][_0x59db('0x97')];var _0x424506=_0x45765f[_0x59db('0x39')]['json']?_0x45765f['query']['json']:!![];var _0x4b21d0=_0x45765f[_0x59db('0x39')][_0x59db('0x9b')]?_0x45765f[_0x59db('0x39')]['encoding']:null;var _0x478395={'method':_0x45765f[_0x59db('0x9c')],'uri':util[_0x59db('0x9d')](_0x59db('0x9e'),_0x5284da,_0x45765f['query'][_0x59db('0x51')]),'json':_0x424506,'resolveWithFullResponse':!![],'encoding':_0x4b21d0,'body':_0x45765f[_0x59db('0x89')]};if(_0x45765f[_0x59db('0x9f')]){_0x478395[_0x59db('0x9f')]=_0x45765f[_0x59db('0x9f')];if(_0x478395[_0x59db('0x9f')][_0x59db('0xa0')]){delete _0x478395[_0x59db('0x9f')][_0x59db('0xa0')];}}if(_0x478395[_0x59db('0x9f')]['content-type']){delete _0x478395[_0x59db('0x9f')][_0x59db('0xa3')];}return rp(_0x478395);})[_0x59db('0x2c')](function(_0x27f3ca){if(_0x27f3ca){_0x3e4802['set'](_0x27f3ca[_0x59db('0x9f')]);logger[_0x59db('0x68')](_0x27f3ca[_0x59db('0x89')]);return _0x3e4802['status'](_0x27f3ca['statusCode'])['send'](_0x27f3ca[_0x59db('0x89')]);}else{return _0x3e4802[_0x59db('0x20')](0xc8);}})[_0x59db('0x4a')](handleError(_0x3e4802,null));};
\ No newline at end of file
index 67c0865..9b021e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd634=['emit','hasOwnProperty','hook','exports','../../mysqldb','Plugin','update','remove'];(function(_0x3844df,_0x48d374){var _0x33cfeb=function(_0x2a14ed){while(--_0x2a14ed){_0x3844df['push'](_0x3844df['shift']());}};_0x33cfeb(++_0x48d374);}(_0xd634,0xf4));var _0x4d63=function(_0xd816e2,_0x5edac2){_0xd816e2=_0xd816e2-0x0;var _0x1f5924=_0xd634[_0xd816e2];return _0x1f5924;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x4d63('0x0'))['db'][_0x4d63('0x1')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d63('0x2'),'afterDestroy':_0x4d63('0x3')};function emitEvent(_0x478b56){return function(_0x4f99ac,_0x2b8d62,_0x35ba45){PluginEvents[_0x4d63('0x4')](_0x478b56+':'+_0x4f99ac['id'],_0x4f99ac);PluginEvents[_0x4d63('0x4')](_0x478b56,_0x4f99ac);_0x35ba45(null);};}for(var e in events){if(events[_0x4d63('0x5')](e)){var event=events[e];Plugin[_0x4d63('0x6')](e,emitEvent(event));}}module[_0x4d63('0x7')]=PluginEvents;
\ No newline at end of file
+var _0xce22=['events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xf58b6c,_0x2bba2e){var _0x3f984f=function(_0xd7fdcf){while(--_0xd7fdcf){_0xf58b6c['push'](_0xf58b6c['shift']());}};_0x3f984f(++_0x2bba2e);}(_0xce22,0xea));var _0x2ce2=function(_0x26ba32,_0x5b1b1e){_0x26ba32=_0x26ba32-0x0;var _0x3845f1=_0xce22[_0x26ba32];return _0x3845f1;};'use strict';var EventEmitter=require(_0x2ce2('0x0'));var Plugin=require(_0x2ce2('0x1'))['db'][_0x2ce2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x2ce2('0x3')](0x0);var events={'afterCreate':_0x2ce2('0x4'),'afterUpdate':'update','afterDestroy':_0x2ce2('0x5')};function emitEvent(_0x5bc506){return function(_0x26b273,_0x1801be,_0x470a06){PluginEvents[_0x2ce2('0x6')](_0x5bc506+':'+_0x26b273['id'],_0x26b273);PluginEvents[_0x2ce2('0x6')](_0x5bc506,_0x26b273);_0x470a06(null);};}for(var e in events){if(events[_0x2ce2('0x7')](e)){var event=events[e];Plugin[_0x2ce2('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index f8303bf..995753f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1ba=['bluebird','request-promise','path','Plugin','plugins','lodash','util','../../config/logger'];(function(_0x487476,_0x1f226c){var _0x4a41d1=function(_0x1a3d40){while(--_0x1a3d40){_0x487476['push'](_0x487476['shift']());}};_0x4a41d1(++_0x1f226c);}(_0xc1ba,0x18d));var _0xac1b=function(_0x2e30f4,_0x40e9b7){_0x2e30f4=_0x2e30f4-0x0;var _0x3550e6=_0xc1ba[_0x2e30f4];return _0x3550e6;};'use strict';var _=require(_0xac1b('0x0'));var util=require(_0xac1b('0x1'));var logger=require(_0xac1b('0x2'))('api');var moment=require('moment');var BPromise=require(_0xac1b('0x3'));var rp=require(_0xac1b('0x4'));var fs=require('fs');var path=require(_0xac1b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x160dfb,_0x497af4){return _0x160dfb['define'](_0xac1b('0x6'),attributes,{'tableName':_0xac1b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3cdb=['plugins','lodash','../../config/logger','api','moment','bluebird','rimraf','exports','define'];(function(_0x38183c,_0xcd6103){var _0x331e08=function(_0x237649){while(--_0x237649){_0x38183c['push'](_0x38183c['shift']());}};_0x331e08(++_0xcd6103);}(_0x3cdb,0x17b));var _0xb3cd=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0x3cdb[_0x8560d3];return _0x33b1b5;};'use strict';var _=require(_0xb3cd('0x0'));var util=require('util');var logger=require(_0xb3cd('0x1'))(_0xb3cd('0x2'));var moment=require(_0xb3cd('0x3'));var BPromise=require(_0xb3cd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb3cd('0x5'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0xb3cd('0x6')]=function(_0x336b4e,_0x531082){return _0x336b4e[_0xb3cd('0x7')]('Plugin',attributes,{'tableName':_0xb3cd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa2413c..1b05189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2781=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreatePlugin','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3898fd,_0x4fad32){var _0x42b0b1=function(_0x4fd74a){while(--_0x4fd74a){_0x3898fd['push'](_0x3898fd['shift']());}};_0x42b0b1(++_0x4fad32);}(_0x2781,0x76));var _0x1278=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2781[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x1278('0x0'));var util=require('util');var moment=require(_0x1278('0x1'));var BPromise=require(_0x1278('0x2'));var rs=require(_0x1278('0x3'));var fs=require('fs');var Redis=require(_0x1278('0x4'));var db=require(_0x1278('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1278('0x6'))(_0x1278('0x7'));var config=require(_0x1278('0x8'));var jayson=require(_0x1278('0x9'));var client=jayson['client'][_0x1278('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1278('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1278('0xc'))(new Redis(config[_0x1278('0xb')]));require(_0x1278('0xd'))['register'](socket);function respondWithRpcPromise(_0x4c0e3b,_0x555256,_0x55a37e){return new BPromise(function(_0x200a80,_0x467ae5){return client[_0x1278('0xe')](_0x4c0e3b,_0x55a37e)[_0x1278('0xf')](function(_0x1dcb78){logger['info'](_0x1278('0x10'),_0x555256,_0x1278('0x11'));logger[_0x1278('0x12')](_0x1278('0x13'),_0x555256,_0x1278('0x11'),JSON[_0x1278('0x14')](_0x1dcb78));if(_0x1dcb78[_0x1278('0x15')]){if(_0x1dcb78[_0x1278('0x15')][_0x1278('0x16')]===0x1f4){logger[_0x1278('0x15')](_0x1278('0x10'),_0x555256,_0x1dcb78['error'][_0x1278('0x17')]);return _0x467ae5(_0x1dcb78[_0x1278('0x15')][_0x1278('0x17')]);}logger['error'](_0x1278('0x10'),_0x555256,_0x1dcb78[_0x1278('0x15')][_0x1278('0x17')]);return _0x200a80(_0x1dcb78[_0x1278('0x15')]['message']);}else{logger[_0x1278('0x18')](_0x1278('0x10'),_0x555256,'request\x20sent');_0x200a80(_0x1dcb78['result'][_0x1278('0x17')]);}})[_0x1278('0x19')](function(_0x3cd18c){logger[_0x1278('0x15')](_0x1278('0x10'),_0x555256,_0x3cd18c);_0x467ae5(_0x3cd18c);});});}exports[_0x1278('0x1a')]=function(_0x5e4002){var _0x236ad4=this;return new Promise(function(_0x262756,_0x1af8e0){return db['Plugin'][_0x1278('0x1b')](_0x5e4002[_0x1278('0x1c')],{'raw':_0x5e4002[_0x1278('0x1d')]?_0x5e4002['options'][_0x1278('0x1e')]===undefined?!![]:![]:!![]})[_0x1278('0xf')](function(_0x4d5708){logger[_0x1278('0x18')](_0x1278('0x1a'),_0x5e4002);logger[_0x1278('0x12')]('CreatePlugin',_0x5e4002,JSON[_0x1278('0x14')](_0x4d5708));_0x262756(_0x4d5708);})['catch'](function(_0x1d8746){logger[_0x1278('0x15')](_0x1278('0x1a'),_0x1d8746['message'],_0x5e4002);_0x1af8e0(_0x236ad4[_0x1278('0x15')](0x1f4,_0x1d8746[_0x1278('0x17')]));});});};
\ No newline at end of file
+var _0x8472=['./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreatePlugin','Plugin','create','body','options','raw','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter'];(function(_0x4c212e,_0x431781){var _0x1ce92b=function(_0xd78e91){while(--_0xd78e91){_0x4c212e['push'](_0x4c212e['shift']());}};_0x1ce92b(++_0x431781);}(_0x8472,0x1f0));var _0x2847=function(_0x31d8f4,_0x344b8d){_0x31d8f4=_0x31d8f4-0x0;var _0x33e020=_0x8472[_0x31d8f4];return _0x33e020;};'use strict';var _=require(_0x2847('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2847('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2847('0x2'));var db=require(_0x2847('0x3'))['db'];var utils=require(_0x2847('0x4'));var logger=require(_0x2847('0x5'))(_0x2847('0x6'));var config=require(_0x2847('0x7'));var jayson=require(_0x2847('0x8'));var client=jayson[_0x2847('0x9')][_0x2847('0xa')]({'port':0x232a});config[_0x2847('0xb')]=_['defaults'](config[_0x2847('0xb')],{'host':_0x2847('0xc'),'port':0x18eb});var socket=require(_0x2847('0xd'))(new Redis(config[_0x2847('0xb')]));require(_0x2847('0xe'))[_0x2847('0xf')](socket);function respondWithRpcPromise(_0x8d940b,_0x3254f9,_0x42e1e6){return new BPromise(function(_0x20e0ab,_0x5c1606){return client[_0x2847('0x10')](_0x8d940b,_0x42e1e6)[_0x2847('0x11')](function(_0x3c1a1e){logger['info'](_0x2847('0x12'),_0x3254f9,_0x2847('0x13'));logger[_0x2847('0x14')](_0x2847('0x15'),_0x3254f9,_0x2847('0x13'),JSON[_0x2847('0x16')](_0x3c1a1e));if(_0x3c1a1e['error']){if(_0x3c1a1e['error']['code']===0x1f4){logger[_0x2847('0x17')](_0x2847('0x12'),_0x3254f9,_0x3c1a1e[_0x2847('0x17')]['message']);return _0x5c1606(_0x3c1a1e[_0x2847('0x17')][_0x2847('0x18')]);}logger[_0x2847('0x17')](_0x2847('0x12'),_0x3254f9,_0x3c1a1e['error'][_0x2847('0x18')]);return _0x20e0ab(_0x3c1a1e[_0x2847('0x17')][_0x2847('0x18')]);}else{logger[_0x2847('0x19')](_0x2847('0x12'),_0x3254f9,_0x2847('0x13'));_0x20e0ab(_0x3c1a1e[_0x2847('0x1a')][_0x2847('0x18')]);}})['catch'](function(_0x146149){logger['error'](_0x2847('0x12'),_0x3254f9,_0x146149);_0x5c1606(_0x146149);});});}exports[_0x2847('0x1b')]=function(_0x25fe3d){var _0x57ba11=this;return new Promise(function(_0x2a3433,_0x19153c){return db[_0x2847('0x1c')][_0x2847('0x1d')](_0x25fe3d[_0x2847('0x1e')],{'raw':_0x25fe3d[_0x2847('0x1f')]?_0x25fe3d[_0x2847('0x1f')][_0x2847('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x3109ea){logger[_0x2847('0x19')](_0x2847('0x1b'),_0x25fe3d);logger[_0x2847('0x14')]('CreatePlugin',_0x25fe3d,JSON[_0x2847('0x16')](_0x3109ea));_0x2a3433(_0x3109ea);})[_0x2847('0x21')](function(_0x3a5ef6){logger[_0x2847('0x17')](_0x2847('0x1b'),_0x3a5ef6[_0x2847('0x18')],_0x25fe3d);_0x19153c(_0x57ba11[_0x2847('0x17')](0x1f4,_0x3a5ef6[_0x2847('0x18')]));});});};
\ No newline at end of file
index dae6a2c..63650a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ba9=['removeListener','register','length','./plugin.events','save','update'];(function(_0xbd6776,_0x55f759){var _0x60b1fa=function(_0x2458b7){while(--_0x2458b7){_0xbd6776['push'](_0xbd6776['shift']());}};_0x60b1fa(++_0x55f759);}(_0x0ba9,0x17d));var _0x90ba=function(_0x1f80ac,_0x37fb2a){_0x1f80ac=_0x1f80ac-0x0;var _0x2a8e0c=_0x0ba9[_0x1f80ac];return _0x2a8e0c;};'use strict';var PluginEvents=require(_0x90ba('0x0'));var events=[_0x90ba('0x1'),'remove',_0x90ba('0x2')];function createListener(_0x6b436f,_0x29e747){return function(_0x54dc81){_0x29e747['emit'](_0x6b436f,_0x54dc81);};}function removeListener(_0x538cf7,_0x2869fb){return function(){PluginEvents[_0x90ba('0x3')](_0x538cf7,_0x2869fb);};}exports[_0x90ba('0x4')]=function(_0x18fe6e){for(var _0xcac1ae=0x0,_0x29c90e=events[_0x90ba('0x5')];_0xcac1ae<_0x29c90e;_0xcac1ae++){var _0x58a3b8=events[_0xcac1ae];var _0x375280=createListener('plugin:'+_0x58a3b8,_0x18fe6e);PluginEvents['on'](_0x58a3b8,_0x375280);}};
\ No newline at end of file
+var _0x201f=['plugin:','./plugin.events','save','remove','removeListener','register'];(function(_0x42f968,_0x48d521){var _0x5c045c=function(_0x27759b){while(--_0x27759b){_0x42f968['push'](_0x42f968['shift']());}};_0x5c045c(++_0x48d521);}(_0x201f,0x1c9));var _0xf201=function(_0x1fdf8a,_0x97b5e6){_0x1fdf8a=_0x1fdf8a-0x0;var _0x3b4f19=_0x201f[_0x1fdf8a];return _0x3b4f19;};'use strict';var PluginEvents=require(_0xf201('0x0'));var events=[_0xf201('0x1'),_0xf201('0x2'),'update'];function createListener(_0x548a0a,_0x3011b3){return function(_0x3315f1){_0x3011b3['emit'](_0x548a0a,_0x3315f1);};}function removeListener(_0x344542,_0x1755c1){return function(){PluginEvents[_0xf201('0x3')](_0x344542,_0x1755c1);};}exports[_0xf201('0x4')]=function(_0x13a5be){for(var _0x411f33=0x0,_0x498dba=events['length'];_0x411f33<_0x498dba;_0x411f33++){var _0x287678=events[_0x411f33];var _0x1c6d3a=createListener(_0xf201('0x5')+_0x287678,_0x13a5be);PluginEvents['on'](_0x287678,_0x1c6d3a);}};
\ No newline at end of file
index 921ef6a..5df0b47 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(_0x8b5b4,_0x4869da){var _0x5281e1=function(_0x5c665f){while(--_0x5c665f){_0x8b5b4['push'](_0x8b5b4['shift']());}};_0x5281e1(++_0x4869da);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x371964,_0x19369a){var _0x5bf78a=function(_0x3777a4){while(--_0x3777a4){_0x371964['push'](_0x371964['shift']());}};_0x5bf78a(++_0x19369a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 a803970..b9b7d9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af2=['sendStatus','json','error','stack','name','status','info','index','list','then','reject','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty','params','send','destroy','Unknown\x20id','../../config/pm2','../../config/logger','api','path','exec','bluebird'];(function(_0x9fa1d9,_0x26899f){var _0x14b09f=function(_0x5f1450){while(--_0x5f1450){_0x9fa1d9['push'](_0x9fa1d9['shift']());}};_0x14b09f(++_0x26899f);}(_0x7af2,0x119));var _0x27af=function(_0xf74372,_0x51fe82){_0xf74372=_0xf74372-0x0;var _0x36bb65=_0x7af2[_0xf74372];return _0x36bb65;};'use strict';var _=require('lodash');var pm2=require(_0x27af('0x0'));var logger=require(_0x27af('0x1'))(_0x27af('0x2'));var path=require(_0x27af('0x3'));var exec=require('child_process')[_0x27af('0x4')];var BPromise=require(_0x27af('0x5'));function handleEntityNotFound(_0x709cb6,_0x2a542f){return function(_0x22ae46){if(!_0x22ae46){_0x709cb6[_0x27af('0x6')](0x194);;}return _0x22ae46;};}function respondWithResult(_0x350532,_0x184630){_0x184630=_0x184630||0xc8;return function(_0x2193c6){if(_0x2193c6){return _0x350532['status'](_0x184630)[_0x27af('0x7')](_0x2193c6);}return null;};}function handleError(_0x366868,_0x389e97){_0x389e97=_0x389e97||0x1f4;return function(_0x583db8){logger[_0x27af('0x8')](_0x583db8[_0x27af('0x9')]);if(_0x583db8[_0x27af('0xa')]){delete _0x583db8['name'];}_0x366868[_0x27af('0xb')](_0x389e97)['send'](_0x583db8);};}function execChildProcess(){return new BPromise(function(_0x4d4729,_0x3e4b33){exec('npm\x20install',function(_0x50fe01,_0x184e25,_0x59c073){logger[_0x27af('0xc')](_0x184e25);logger['info'](_0x59c073);if(_0x50fe01){logger[_0x27af('0x8')](_0x50fe01);return _0x3e4b33(_0x50fe01);}return _0x4d4729(_0x184e25);});});}exports[_0x27af('0xd')]=function(_0x1fd964,_0x23f9ec){return pm2[_0x27af('0xe')]()[_0x27af('0xf')](function(_0x234825){if(_0x234825){var _0x3da435=_[_0x27af('0x10')](_0x234825,function(_0x4724e0){return _0x4724e0[_0x27af('0xa')]===_0x27af('0x11')||_0x4724e0[_0x27af('0xa')]===_0x27af('0x12');});return{'rows':_0x3da435,'count':_0x3da435[_0x27af('0x13')]};}return null;})[_0x27af('0xf')](respondWithResult(_0x23f9ec,null))[_0x27af('0x14')](handleError(_0x23f9ec,null));};exports[_0x27af('0x15')]=function(_0x58583a,_0x315661){return pm2[_0x27af('0x16')](_0x58583a['params']['id'])['then'](respondWithResult(_0x315661,null))[_0x27af('0xf')](handleEntityNotFound(_0x315661,null))[_0x27af('0x14')](handleError(_0x315661,null));};exports[_0x27af('0x17')]=function(_0x31573a,_0xec699a){if(_0x31573a['body'][_0x27af('0xa')]&&_0x31573a[_0x27af('0x18')][_0x27af('0x19')]){var _0x5e7c19=path[_0x27af('0x1a')](__dirname,_0x27af('0x1b'),_0x31573a[_0x27af('0x18')]['script']);var _0x2dce2b=process[_0x27af('0x1c')]();process[_0x27af('0x1d')](path[_0x27af('0x1e')](_0x5e7c19));return execChildProcess()[_0x27af('0xf')](function(_0x396156){process[_0x27af('0x1d')](_0x2dce2b);return pm2[_0x27af('0x1f')]({'name':_0x31573a[_0x27af('0x18')]['name'],'script':_0x5e7c19});})['then'](function(_0x4b8fe6){pm2[_0x27af('0x20')]();return _0x4b8fe6[0x0];})['then'](respondWithResult(_0xec699a,0xc9))[_0x27af('0x14')](handleError(_0xec699a,null));}else{return _0xec699a[_0x27af('0xb')](0x1f4)['send']({'message':_0x27af('0x21')});}};exports[_0x27af('0x22')]=function(_0x463e36,_0x424490){if(_0x463e36[_0x27af('0x18')]['id']){delete _0x463e36[_0x27af('0x18')]['id'];}var _0x775d4e={'online':'restart','stopped':_0x27af('0x23')};if(_0x775d4e[_0x27af('0x24')](_0x463e36[_0x27af('0x18')][_0x27af('0xb')])){return pm2[_0x775d4e[_0x463e36[_0x27af('0x18')][_0x27af('0xb')]]](_0x463e36[_0x27af('0x25')]['id'])[_0x27af('0xf')](respondWithResult(_0x424490,0xc8))[_0x27af('0x14')](handleError(_0x424490,null));}else{return _0x424490[_0x27af('0xb')](0x1f4)[_0x27af('0x26')]({'message':'Unknown\x20status'});}};exports[_0x27af('0x27')]=function(_0x14b2e7,_0x3800a1){if(_0x14b2e7[_0x27af('0x18')]['id']){delete _0x14b2e7[_0x27af('0x18')]['id'];}if(_0x14b2e7[_0x27af('0x25')]['id']){return pm2['delete'](_0x14b2e7['params']['id'])[_0x27af('0xf')](function(_0x37cb41){pm2['dump']();return _0x37cb41[0x0];})[_0x27af('0xf')](respondWithResult(_0x3800a1,null))[_0x27af('0x14')](handleError(_0x3800a1,null));}else{return _0x3800a1[_0x27af('0xb')](0x1f4)[_0x27af('0x26')]({'message':_0x27af('0x28')});}};
\ No newline at end of file
+var _0xde2c=['start','dump','update','restart','stop','hasOwnProperty','params','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','list','reject','express','motion2','then','catch','show','create','body','script','cwd','chdir','dirname'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xde2c,0x7f));var _0xcde2=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xde2c[_0x510c60];return _0x49c4aa;};'use strict';var _=require(_0xcde2('0x0'));var pm2=require(_0xcde2('0x1'));var logger=require(_0xcde2('0x2'))(_0xcde2('0x3'));var path=require(_0xcde2('0x4'));var exec=require(_0xcde2('0x5'))[_0xcde2('0x6')];var BPromise=require(_0xcde2('0x7'));function handleEntityNotFound(_0x55c175,_0x4353c8){return function(_0x196898){if(!_0x196898){_0x55c175[_0xcde2('0x8')](0x194);;}return _0x196898;};}function respondWithResult(_0x1398de,_0x401b16){_0x401b16=_0x401b16||0xc8;return function(_0x53c558){if(_0x53c558){return _0x1398de[_0xcde2('0x9')](_0x401b16)[_0xcde2('0xa')](_0x53c558);}return null;};}function handleError(_0x9c7036,_0x544235){_0x544235=_0x544235||0x1f4;return function(_0x582a6c){logger[_0xcde2('0xb')](_0x582a6c[_0xcde2('0xc')]);if(_0x582a6c['name']){delete _0x582a6c[_0xcde2('0xd')];}_0x9c7036[_0xcde2('0x9')](_0x544235)[_0xcde2('0xe')](_0x582a6c);};}function execChildProcess(){return new BPromise(function(_0x127358,_0x54b7c5){exec('npm\x20install',function(_0x25677f,_0x1bc697,_0x3b1333){logger[_0xcde2('0xf')](_0x1bc697);logger[_0xcde2('0xf')](_0x3b1333);if(_0x25677f){logger[_0xcde2('0xb')](_0x25677f);return _0x54b7c5(_0x25677f);}return _0x127358(_0x1bc697);});});}exports['index']=function(_0x211215,_0x577062){return pm2[_0xcde2('0x10')]()['then'](function(_0x4b0e0e){if(_0x4b0e0e){var _0x34e079=_[_0xcde2('0x11')](_0x4b0e0e,function(_0x417505){return _0x417505[_0xcde2('0xd')]===_0xcde2('0x12')||_0x417505['name']===_0xcde2('0x13');});return{'rows':_0x34e079,'count':_0x34e079['length']};}return null;})[_0xcde2('0x14')](respondWithResult(_0x577062,null))[_0xcde2('0x15')](handleError(_0x577062,null));};exports[_0xcde2('0x16')]=function(_0x1f1858,_0x5223f1){return pm2['describe'](_0x1f1858['params']['id'])[_0xcde2('0x14')](respondWithResult(_0x5223f1,null))['then'](handleEntityNotFound(_0x5223f1,null))[_0xcde2('0x15')](handleError(_0x5223f1,null));};exports[_0xcde2('0x17')]=function(_0x252372,_0x481fc0){if(_0x252372[_0xcde2('0x18')][_0xcde2('0xd')]&&_0x252372[_0xcde2('0x18')][_0xcde2('0x19')]){var _0x43df7a=path['join'](__dirname,'../../files/plugins',_0x252372['body'][_0xcde2('0x19')]);var _0x3e5170=process[_0xcde2('0x1a')]();process[_0xcde2('0x1b')](path[_0xcde2('0x1c')](_0x43df7a));return execChildProcess()['then'](function(_0x1104b8){process['chdir'](_0x3e5170);return pm2[_0xcde2('0x1d')]({'name':_0x252372[_0xcde2('0x18')][_0xcde2('0xd')],'script':_0x43df7a});})['then'](function(_0x593aa4){pm2[_0xcde2('0x1e')]();return _0x593aa4[0x0];})[_0xcde2('0x14')](respondWithResult(_0x481fc0,0xc9))[_0xcde2('0x15')](handleError(_0x481fc0,null));}else{return _0x481fc0[_0xcde2('0x9')](0x1f4)[_0xcde2('0xe')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xcde2('0x1f')]=function(_0x45275a,_0x1dce65){if(_0x45275a['body']['id']){delete _0x45275a[_0xcde2('0x18')]['id'];}var _0x348ca1={'online':_0xcde2('0x20'),'stopped':_0xcde2('0x21')};if(_0x348ca1[_0xcde2('0x22')](_0x45275a[_0xcde2('0x18')][_0xcde2('0x9')])){return pm2[_0x348ca1[_0x45275a[_0xcde2('0x18')]['status']]](_0x45275a[_0xcde2('0x23')]['id'])['then'](respondWithResult(_0x1dce65,0xc8))[_0xcde2('0x15')](handleError(_0x1dce65,null));}else{return _0x1dce65[_0xcde2('0x9')](0x1f4)[_0xcde2('0xe')]({'message':'Unknown\x20status'});}};exports[_0xcde2('0x24')]=function(_0x28fedd,_0x58afb1){if(_0x28fedd[_0xcde2('0x18')]['id']){delete _0x28fedd[_0xcde2('0x18')]['id'];}if(_0x28fedd[_0xcde2('0x23')]['id']){return pm2[_0xcde2('0x25')](_0x28fedd[_0xcde2('0x23')]['id'])[_0xcde2('0x14')](function(_0x11b817){pm2[_0xcde2('0x1e')]();return _0x11b817[0x0];})['then'](respondWithResult(_0x58afb1,null))[_0xcde2('0x15')](handleError(_0x58afb1,null));}else{return _0x58afb1[_0xcde2('0x9')](0x1f4)[_0xcde2('0xe')]({'message':_0xcde2('0x26')});}};
\ No newline at end of file
index 0b2c9eb..776972d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf11=['isAuthenticated','getQueues','express','Router','../../components/auth/service','./realtime.controller','/queues'];(function(_0x185fbf,_0x3d147f){var _0x169eef=function(_0x4f8a33){while(--_0x4f8a33){_0x185fbf['push'](_0x185fbf['shift']());}};_0x169eef(++_0x3d147f);}(_0xaf11,0x12f));var _0x1af1=function(_0x2043f8,_0x189ceb){_0x2043f8=_0x2043f8-0x0;var _0x12a443=_0xaf11[_0x2043f8];return _0x12a443;};'use strict';var express=require(_0x1af1('0x0'));var router=express[_0x1af1('0x1')]();var auth=require(_0x1af1('0x2'));var controller=require(_0x1af1('0x3'));router['get'](_0x1af1('0x4'),auth[_0x1af1('0x5')](),controller[_0x1af1('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x7008=['./realtime.controller','/queues','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x2720ff,_0xa42935){var _0x55598b=function(_0x4bbebc){while(--_0x4bbebc){_0x2720ff['push'](_0x2720ff['shift']());}};_0x55598b(++_0xa42935);}(_0x7008,0x185));var _0x8700=function(_0x4c3ea6,_0x50f253){_0x4c3ea6=_0x4c3ea6-0x0;var _0x29d530=_0x7008[_0x4c3ea6];return _0x29d530;};'use strict';var express=require(_0x8700('0x0'));var router=express[_0x8700('0x1')]();var auth=require(_0x8700('0x2'));var controller=require(_0x8700('0x3'));router['get'](_0x8700('0x4'),auth[_0x8700('0x5')](),controller['getQueues']);module[_0x8700('0x6')]=router;
\ No newline at end of file
index c72600f..ff0b1bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd6=['getQueues','mail','sms','openchannel','fax','whatsapp','voice','then','includes','query','toLowerCase','Invalid\x20channel','Queue','map','fieldName','key','getOptions','role','user','userProfileId','outbound','startCase','Queues','filter','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','talking','paused','type','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','rows','loggedInDb','available','waiting','agents','find','merge','pick','online','getMembers','UserId','User','Pause','findAll','agent','length','all','catch','util','lodash','jayson/promise','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','json','error','stack','name'];(function(_0x1dd706,_0xb6166b){var _0x5c45aa=function(_0x116854){while(--_0x116854){_0x1dd706['push'](_0x1dd706['shift']());}};_0x5c45aa(++_0xb6166b);}(_0xffd6,0x97));var _0x6ffd=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xffd6[_0x1780f8];return _0x33a410;};'use strict';var util=require(_0x6ffd('0x0'));var _=require(_0x6ffd('0x1'));var jayson=require(_0x6ffd('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var client=jayson[_0x6ffd('0x5')]['http']({'port':0x232a});var routingClient=jayson[_0x6ffd('0x5')][_0x6ffd('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x3b8a46,_0x2949a4){return function(_0x561055){if(_0x561055){var _0x122b71=typeof _0x2949a4[_0x6ffd('0x7')]===_0x6ffd('0x8')&&typeof _0x2949a4[_0x6ffd('0x9')]===_0x6ffd('0x8');var _0x4a9f85=_0x561055[_0x6ffd('0xa')];var _0x417f34=_0x122b71?0x0:_0x2949a4['offset'];var _0x469d0d=_0x122b71?_0x561055[_0x6ffd('0xa')]:_0x2949a4[_0x6ffd('0x7')]+_0x2949a4[_0x6ffd('0x9')];var _0x262023;if(_0x469d0d>=_0x4a9f85){_0x469d0d=_0x4a9f85;_0x262023=0xc8;}else{_0x262023=0xce;}_0x3b8a46[_0x6ffd('0xb')](_0x262023);return _0x3b8a46[_0x6ffd('0xc')]('Content-Range',_0x417f34+'-'+_0x469d0d+'/'+_0x4a9f85)[_0x6ffd('0xd')](_0x561055);}return null;};}function handleError(_0x46936d,_0x5e8d6d){_0x5e8d6d=_0x5e8d6d||0x1f4;return function(_0x2d0b63){logger[_0x6ffd('0xe')](_0x2d0b63[_0x6ffd('0xf')]);if(_0x2d0b63[_0x6ffd('0x10')]){delete _0x2d0b63['name'];}_0x46936d[_0x6ffd('0xb')](_0x5e8d6d)['send'](_0x2d0b63);};}exports[_0x6ffd('0x11')]=function(_0x4d163f,_0xfd9569){var _0x261ed7=[_0x6ffd('0x12'),'chat',_0x6ffd('0x13'),_0x6ffd('0x14'),_0x6ffd('0x15'),_0x6ffd('0x16'),_0x6ffd('0x17')];var _0x19a772={'count':0x0,'rows':[]},_0x3f38e7={},_0x889a4b;Promise['resolve']()[_0x6ffd('0x18')](function(){if(_0x4d163f['query']['channel']){if(!_[_0x6ffd('0x19')](_0x261ed7,_0x4d163f[_0x6ffd('0x1a')]['channel'][_0x6ffd('0x1b')]()))throw new Error(_0x6ffd('0x1c'));_0x889a4b=_0x4d163f['query']['channel'][_0x6ffd('0x1b')]();}var _0x1c9d19=_['startCase'](_0x889a4b)+_0x6ffd('0x1d');var _0x39f25c=_[_0x6ffd('0x1e')](db[_0x1c9d19]['rawAttributes'],function(_0x3ba429){return{'name':_0x3ba429[_0x6ffd('0x1f')],'type':_0x3ba429['type'][_0x6ffd('0x20')]};});_0x3f38e7=qs[_0x6ffd('0x21')](_0x39f25c,_0x4d163f);if(_0x4d163f['user'][_0x6ffd('0x22')]===_0x6ffd('0x23')){var _0xb504e5={'params':{'id':_0x4d163f['user'][_0x6ffd('0x24')]},'query':{'section':_0x889a4b===_0x6ffd('0x17')&&_0x4d163f[_0x6ffd('0x1a')]['type']===_0x6ffd('0x25')?'QueueCampaigns':_[_0x6ffd('0x26')](_0x889a4b)+_0x6ffd('0x27'),'type':_0x4d163f['query']['type'],'nolimit':!![],'sort':_0x6ffd('0x10'),'filter':_0x4d163f[_0x6ffd('0x1a')][_0x6ffd('0x28')]}};return db['UserProfile']['getResources'](_0xb504e5);}return db[_0x1c9d19][_0x6ffd('0x29')](_0x3f38e7);})['then'](function(_0x470021){_0x19a772[_0x6ffd('0xa')]=_0x470021['count'];var _0x6b5aba=_0x889a4b===_0x6ffd('0x17')?client:routingClient;return _0x6b5aba[_0x6ffd('0x2a')](_[_0x6ffd('0x26')](_0x889a4b)+_0x6ffd('0x27'),_0x4d163f)[_0x6ffd('0x18')](function(_0x225c66){if(_0x225c66[_0x6ffd('0xe')])throw new Error(util[_0x6ffd('0x2b')](_0x6ffd('0x2c'),_0x889a4b));var _0x295a37=_0x225c66[_0x6ffd('0x2d')];var _0x2b9873=['loggedIn','available','waiting',_0x6ffd('0x2e'),_0x6ffd('0x2f')];if(_0x889a4b===_0x6ffd('0x17')&&_0x4d163f[_0x6ffd('0x1a')][_0x6ffd('0x30')]===_0x6ffd('0x25')){_0x2b9873[_0x6ffd('0x31')](_0x6ffd('0x32'),_0x6ffd('0x33'),_0x6ffd('0x34'),_0x6ffd('0x35'),_0x6ffd('0x36'),_0x6ffd('0x37'),'startPredictive',_0x6ffd('0x38'),_0x6ffd('0x39'),_0x6ffd('0x3a'),_0x6ffd('0x3b'),'erlangBusyFactor',_0x6ffd('0x3c'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0x6ffd('0x3d'),_0x6ffd('0x3e'),_0x6ffd('0x3f'),_0x6ffd('0x40'),'predictiveIntervalDroppedCallsCallersExit',_0x6ffd('0x41'),'predictiveIntervalAvgTalktime');}var _0x5848bb=_0x470021[_0x6ffd('0x42')][_0x6ffd('0x1e')](function(_0x399984){var _0x23fae4=_0x399984['get']({'plain':!![]});_0x23fae4['paused']=0x0;_0x23fae4[_0x6ffd('0x43')]=0x0;_0x23fae4['loggedIn']=0x0;_0x23fae4[_0x6ffd('0x44')]=0x0;_0x23fae4[_0x6ffd('0x2f')]=0x0;_0x23fae4[_0x6ffd('0x45')]=0x0;if(_0x889a4b===_0x6ffd('0x17')){_0x23fae4[_0x6ffd('0x2e')]=0x0;if(_0x4d163f[_0x6ffd('0x1a')]['type']===_0x6ffd('0x25')){_0x23fae4[_0x6ffd('0x32')]=0x0;_0x23fae4[_0x6ffd('0x33')]=0x0;}}_0x23fae4[_0x6ffd('0x46')]=[];var _0x4c536d=_[_0x6ffd('0x47')](_0x295a37['rows'],['id',_0x23fae4['id']]);if(_0x4c536d)_[_0x6ffd('0x48')](_0x23fae4,_[_0x6ffd('0x49')](_0x4c536d,_0x2b9873));if(_0x889a4b===_0x6ffd('0x17')){return _0x399984['getAgents']({'attributes':['id',_0x6ffd('0x10'),_0x6ffd('0x4a')],'joinTableAttributes':[],'raw':!![]})[_0x6ffd('0x18')](function(_0x27b6fd){return _0x399984[_0x6ffd('0x4b')]({'raw':!![]})[_0x6ffd('0x18')](function(_0x14608b){for(var _0x4da181=0x0;_0x4da181<_0x27b6fd['length'];_0x4da181++){var _0x595ceb=_[_0x6ffd('0x47')](_0x14608b,[_0x6ffd('0x4c'),_0x27b6fd[_0x4da181]['id']]);var _0x51ae8d={'id':_0x27b6fd[_0x4da181]['id'],'name':_0x27b6fd[_0x4da181][_0x6ffd('0x10')],'online':Boolean(_0x27b6fd[_0x4da181][_0x6ffd('0x4a')]),'paused':_0x595ceb?Boolean(_0x595ceb[_0x6ffd('0x2f')]):![]};if(_0x51ae8d[_0x6ffd('0x4a')])_0x23fae4['loggedInDb']++;if(_0x51ae8d[_0x6ffd('0x2f')])_0x23fae4[_0x6ffd('0x2f')]++;_0x23fae4[_0x6ffd('0x46')][_0x6ffd('0x31')](_0x51ae8d);}return _0x23fae4;});});}else{var _0x2b8a8e=_0x6ffd('0x4d')+_[_0x6ffd('0x26')](_0x889a4b)+_0x6ffd('0x1d');var _0x188a56=_0x889a4b+_0x6ffd('0x4e');return db[_0x2b8a8e][_0x6ffd('0x4f')]({'where':{[_['startCase'](_0x889a4b)+'QueueId']:_0x399984['id']},'raw':!![]})['then'](function(_0x440fb3){return db[_0x6ffd('0x4d')]['findAll']({'attributes':['id',_0x6ffd('0x10'),_0x6ffd('0x4a'),_0x188a56],'where':{'id':_[_0x6ffd('0x1e')](_0x440fb3,_0x6ffd('0x4c')),'role':_0x6ffd('0x50')},'raw':!![]});})['then'](function(_0x376864){for(var _0x28e9a1=0x0;_0x28e9a1<_0x376864[_0x6ffd('0x51')];_0x28e9a1++){var _0x495a8d={'id':_0x376864[_0x28e9a1]['id'],'name':_0x376864[_0x28e9a1][_0x6ffd('0x10')],'online':Boolean(_0x376864[_0x28e9a1][_0x6ffd('0x4a')]),'paused':Boolean(_0x376864[_0x28e9a1][_0x188a56])};if(_0x495a8d[_0x6ffd('0x4a')])_0x23fae4[_0x6ffd('0x43')]++;if(_0x495a8d[_0x6ffd('0x2f')])_0x23fae4[_0x6ffd('0x2f')]++;_0x23fae4['agents'][_0x6ffd('0x31')](_0x495a8d);}return _0x23fae4;});}});return Promise[_0x6ffd('0x52')](_0x5848bb);});})[_0x6ffd('0x18')](function(_0xbb803b){_0x19a772[_0x6ffd('0x42')]=_0xbb803b;return _0x19a772;})[_0x6ffd('0x18')](respondWithFilteredResult(_0xfd9569,_0x3f38e7))[_0x6ffd('0x53')](handleError(_0xfd9569,null));};
\ No newline at end of file
+var _0x0adf=['talking','pTalking','find','rows','getAgents','online','getMembers','length','agents','Pause','findAll','QueueId','User','UserId','all','catch','util','lodash','jayson/promise','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','json','stack','name','getQueues','mail','chat','sms','fax','whatsapp','voice','resolve','then','channel','includes','query','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','paused','push','originated','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','get','loggedInDb','waiting'];(function(_0x68c4e3,_0x5b18b0){var _0xaca048=function(_0x485160){while(--_0x485160){_0x68c4e3['push'](_0x68c4e3['shift']());}};_0xaca048(++_0x5b18b0);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x2cf985,_0x3ba904){_0x2cf985=_0x2cf985-0x0;var _0x695c36=_0x0adf[_0x2cf985];return _0x695c36;};'use strict';var util=require(_0xf0ad('0x0'));var _=require(_0xf0ad('0x1'));var jayson=require(_0xf0ad('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xf0ad('0x3'))(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var client=jayson[_0xf0ad('0x6')][_0xf0ad('0x7')]({'port':0x232a});var routingClient=jayson[_0xf0ad('0x6')][_0xf0ad('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x59a588,_0x3bbf85){return function(_0x53221f){if(_0x53221f){var _0x2eca0e=typeof _0x3bbf85[_0xf0ad('0x8')]===_0xf0ad('0x9')&&typeof _0x3bbf85[_0xf0ad('0xa')]===_0xf0ad('0x9');var _0x3bc706=_0x53221f[_0xf0ad('0xb')];var _0x5bdf69=_0x2eca0e?0x0:_0x3bbf85[_0xf0ad('0x8')];var _0x53c81a=_0x2eca0e?_0x53221f[_0xf0ad('0xb')]:_0x3bbf85[_0xf0ad('0x8')]+_0x3bbf85[_0xf0ad('0xa')];var _0x2a5d0e;if(_0x53c81a>=_0x3bc706){_0x53c81a=_0x3bc706;_0x2a5d0e=0xc8;}else{_0x2a5d0e=0xce;}_0x59a588[_0xf0ad('0xc')](_0x2a5d0e);return _0x59a588['set']('Content-Range',_0x5bdf69+'-'+_0x53c81a+'/'+_0x3bc706)[_0xf0ad('0xd')](_0x53221f);}return null;};}function handleError(_0x19892c,_0x3646a2){_0x3646a2=_0x3646a2||0x1f4;return function(_0x238c3b){logger['error'](_0x238c3b[_0xf0ad('0xe')]);if(_0x238c3b[_0xf0ad('0xf')]){delete _0x238c3b['name'];}_0x19892c['status'](_0x3646a2)['send'](_0x238c3b);};}exports[_0xf0ad('0x10')]=function(_0x513237,_0x1dad7b){var _0x313ad6=[_0xf0ad('0x11'),_0xf0ad('0x12'),_0xf0ad('0x13'),'openchannel',_0xf0ad('0x14'),_0xf0ad('0x15'),_0xf0ad('0x16')];var _0x1c9fac={'count':0x0,'rows':[]},_0x47fa2b={},_0x4e9970;Promise[_0xf0ad('0x17')]()[_0xf0ad('0x18')](function(){if(_0x513237['query'][_0xf0ad('0x19')]){if(!_[_0xf0ad('0x1a')](_0x313ad6,_0x513237[_0xf0ad('0x1b')][_0xf0ad('0x19')]['toLowerCase']()))throw new Error('Invalid\x20channel');_0x4e9970=_0x513237[_0xf0ad('0x1b')][_0xf0ad('0x19')][_0xf0ad('0x1c')]();}var _0x20c5f3=_[_0xf0ad('0x1d')](_0x4e9970)+_0xf0ad('0x1e');var _0x4e874a=_[_0xf0ad('0x1f')](db[_0x20c5f3][_0xf0ad('0x20')],function(_0x31635b){return{'name':_0x31635b[_0xf0ad('0x21')],'type':_0x31635b[_0xf0ad('0x22')][_0xf0ad('0x23')]};});_0x47fa2b=qs[_0xf0ad('0x24')](_0x4e874a,_0x513237);if(_0x513237[_0xf0ad('0x25')][_0xf0ad('0x26')]===_0xf0ad('0x25')){var _0x39b3e8={'params':{'id':_0x513237[_0xf0ad('0x25')][_0xf0ad('0x27')]},'query':{'section':_0x4e9970===_0xf0ad('0x16')&&_0x513237[_0xf0ad('0x1b')]['type']===_0xf0ad('0x28')?_0xf0ad('0x29'):_[_0xf0ad('0x1d')](_0x4e9970)+_0xf0ad('0x2a'),'type':_0x513237[_0xf0ad('0x1b')][_0xf0ad('0x22')],'nolimit':!![],'sort':'name','filter':_0x513237[_0xf0ad('0x1b')][_0xf0ad('0x2b')]}};return db[_0xf0ad('0x2c')][_0xf0ad('0x2d')](_0x39b3e8);}return db[_0x20c5f3][_0xf0ad('0x2e')](_0x47fa2b);})[_0xf0ad('0x18')](function(_0x267b7a){_0x1c9fac[_0xf0ad('0xb')]=_0x267b7a[_0xf0ad('0xb')];var _0x39c46c=_0x4e9970===_0xf0ad('0x16')?client:routingClient;return _0x39c46c['request'](_[_0xf0ad('0x1d')](_0x4e9970)+'Queues',_0x513237)[_0xf0ad('0x18')](function(_0x57a1f3){if(_0x57a1f3[_0xf0ad('0x2f')])throw new Error(util[_0xf0ad('0x30')](_0xf0ad('0x31'),_0x4e9970));var _0x3015ce=_0x57a1f3[_0xf0ad('0x32')];var _0xebb70b=[_0xf0ad('0x33'),_0xf0ad('0x34'),'waiting','talking',_0xf0ad('0x35')];if(_0x4e9970===_0xf0ad('0x16')&&_0x513237[_0xf0ad('0x1b')][_0xf0ad('0x22')]==='outbound'){_0xebb70b[_0xf0ad('0x36')]('pTalking',_0xf0ad('0x37'),'message',_0xf0ad('0x38'),'dialMethod',_0xf0ad('0x39'),_0xf0ad('0x3a'),_0xf0ad('0x3b'),_0xf0ad('0x3c'),_0xf0ad('0x3d'),_0xf0ad('0x3e'),_0xf0ad('0x3f'),_0xf0ad('0x40'),'dialPredictiveIntervalMaxThreshold',_0xf0ad('0x41'),'predictiveIntervalAvailable',_0xf0ad('0x42'),'predictiveIntervalAnsweredCalls',_0xf0ad('0x43'),_0xf0ad('0x44'),_0xf0ad('0x45'),_0xf0ad('0x46'));}var _0x82f4e4=_0x267b7a['rows'][_0xf0ad('0x1f')](function(_0x31c955){var _0x1d57d1=_0x31c955[_0xf0ad('0x47')]({'plain':!![]});_0x1d57d1[_0xf0ad('0x35')]=0x0;_0x1d57d1[_0xf0ad('0x48')]=0x0;_0x1d57d1[_0xf0ad('0x33')]=0x0;_0x1d57d1['available']=0x0;_0x1d57d1[_0xf0ad('0x35')]=0x0;_0x1d57d1[_0xf0ad('0x49')]=0x0;if(_0x4e9970===_0xf0ad('0x16')){_0x1d57d1[_0xf0ad('0x4a')]=0x0;if(_0x513237[_0xf0ad('0x1b')][_0xf0ad('0x22')]===_0xf0ad('0x28')){_0x1d57d1[_0xf0ad('0x4b')]=0x0;_0x1d57d1[_0xf0ad('0x37')]=0x0;}}_0x1d57d1['agents']=[];var _0x6b3854=_[_0xf0ad('0x4c')](_0x3015ce[_0xf0ad('0x4d')],['id',_0x1d57d1['id']]);if(_0x6b3854)_['merge'](_0x1d57d1,_['pick'](_0x6b3854,_0xebb70b));if(_0x4e9970==='voice'){return _0x31c955[_0xf0ad('0x4e')]({'attributes':['id',_0xf0ad('0xf'),_0xf0ad('0x4f')],'joinTableAttributes':[],'raw':!![]})[_0xf0ad('0x18')](function(_0x383633){return _0x31c955[_0xf0ad('0x50')]({'raw':!![]})[_0xf0ad('0x18')](function(_0x1dcbd0){for(var _0x3dfedd=0x0;_0x3dfedd<_0x383633[_0xf0ad('0x51')];_0x3dfedd++){var _0x2a7138=_['find'](_0x1dcbd0,['UserId',_0x383633[_0x3dfedd]['id']]);var _0x5cd1dc={'id':_0x383633[_0x3dfedd]['id'],'name':_0x383633[_0x3dfedd][_0xf0ad('0xf')],'online':Boolean(_0x383633[_0x3dfedd][_0xf0ad('0x4f')]),'paused':_0x2a7138?Boolean(_0x2a7138['paused']):![]};if(_0x5cd1dc[_0xf0ad('0x4f')])_0x1d57d1[_0xf0ad('0x48')]++;if(_0x5cd1dc['paused'])_0x1d57d1[_0xf0ad('0x35')]++;_0x1d57d1[_0xf0ad('0x52')][_0xf0ad('0x36')](_0x5cd1dc);}return _0x1d57d1;});});}else{var _0x440291='User'+_[_0xf0ad('0x1d')](_0x4e9970)+_0xf0ad('0x1e');var _0x172e14=_0x4e9970+_0xf0ad('0x53');return db[_0x440291][_0xf0ad('0x54')]({'where':{[_[_0xf0ad('0x1d')](_0x4e9970)+_0xf0ad('0x55')]:_0x31c955['id']},'raw':!![]})[_0xf0ad('0x18')](function(_0x32b020){return db[_0xf0ad('0x56')][_0xf0ad('0x54')]({'attributes':['id','name',_0xf0ad('0x4f'),_0x172e14],'where':{'id':_[_0xf0ad('0x1f')](_0x32b020,_0xf0ad('0x57')),'role':'agent'},'raw':!![]});})['then'](function(_0x2cf742){for(var _0x6b41e8=0x0;_0x6b41e8<_0x2cf742[_0xf0ad('0x51')];_0x6b41e8++){var _0x36500c={'id':_0x2cf742[_0x6b41e8]['id'],'name':_0x2cf742[_0x6b41e8][_0xf0ad('0xf')],'online':Boolean(_0x2cf742[_0x6b41e8][_0xf0ad('0x4f')]),'paused':Boolean(_0x2cf742[_0x6b41e8][_0x172e14])};if(_0x36500c[_0xf0ad('0x4f')])_0x1d57d1['loggedInDb']++;if(_0x36500c[_0xf0ad('0x35')])_0x1d57d1['paused']++;_0x1d57d1[_0xf0ad('0x52')][_0xf0ad('0x36')](_0x36500c);}return _0x1d57d1;});}});return Promise[_0xf0ad('0x58')](_0x82f4e4);});})[_0xf0ad('0x18')](function(_0x3e99db){_0x1c9fac['rows']=_0x3e99db;return _0x1c9fac;})['then'](respondWithFilteredResult(_0x1dad7b,_0x47fa2b))[_0xf0ad('0x59')](handleError(_0x1dad7b,null));};
\ No newline at end of file
index 037dad5..cdf09ae 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(_0x17315a,_0xec91b4){var _0x38f114=function(_0x3f88ae){while(--_0x3f88ae){_0x17315a['push'](_0x17315a['shift']());}};_0x38f114(++_0xec91b4);}(_0xe706,0xa3));var _0x6e70=function(_0x24ddf6,_0x114e56){_0x24ddf6=_0x24ddf6-0x0;var _0x393d70=_0xe706[_0x24ddf6];return _0x393d70;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xdb5e9,_0x8584fa){var _0x394d46=function(_0x30d394){while(--_0x30d394){_0xdb5e9['push'](_0xdb5e9['shift']());}};_0x394d46(++_0x8584fa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 9744b3e..927e5e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f4d=['STRING','DATE','INTEGER'];(function(_0x124cbd,_0xf3a808){var _0x40a853=function(_0x4ed1d7){while(--_0x4ed1d7){_0x124cbd['push'](_0x124cbd['shift']());}};_0x40a853(++_0xf3a808);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x2a44ee,_0x4f0c65){_0x2a44ee=_0x2a44ee-0x0;var _0x36ceb4=_0x0f4d[_0x2a44ee];return _0x36ceb4;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xd0f4('0x0')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xd0f4('0x0')]},'starttime':{'type':Sequelize[_0xd0f4('0x1')]},'responsetime':{'type':Sequelize[_0xd0f4('0x1')]},'ringtime':{'type':Sequelize[_0xd0f4('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xd0f4('0x0')]},'campaigntype':{'type':Sequelize[_0xd0f4('0x0')]},'membername':{'type':Sequelize[_0xd0f4('0x0')]}};
\ No newline at end of file
+var _0x96f1=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x4dd0fb,_0x5984b1){var _0x1d0172=function(_0x353f08){while(--_0x353f08){_0x4dd0fb['push'](_0x4dd0fb['shift']());}};_0x1d0172(++_0x5984b1);}(_0x96f1,0x19c));var _0x196f=function(_0x133178,_0x30c7cf){_0x133178=_0x133178-0x0;var _0x53a051=_0x96f1[_0x133178];return _0x53a051;};'use strict';var Sequelize=require(_0x196f('0x0'));module[_0x196f('0x1')]={'state':{'type':Sequelize[_0x196f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x196f('0x3')]},'scheduledat':{'type':Sequelize[_0x196f('0x4')]},'uniqueid':{'type':Sequelize[_0x196f('0x3')]},'starttime':{'type':Sequelize[_0x196f('0x4')]},'responsetime':{'type':Sequelize[_0x196f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x196f('0x3')]},'membername':{'type':Sequelize[_0x196f('0x3')]}};
\ No newline at end of file
index 998072b..858e603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14ac=['define','ReportAgentPreview','report_agent_preview','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x3951e5,_0x3532f4){var _0x5101aa=function(_0x205f85){while(--_0x205f85){_0x3951e5['push'](_0x3951e5['shift']());}};_0x5101aa(++_0x3532f4);}(_0x14ac,0xe0));var _0xc14a=function(_0x458a20,_0x206f85){_0x458a20=_0x458a20-0x0;var _0x3cce8a=_0x14ac[_0x458a20];return _0x3cce8a;};'use strict';var _=require(_0xc14a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc14a('0x1'));var moment=require(_0xc14a('0x2'));var BPromise=require(_0xc14a('0x3'));var rp=require(_0xc14a('0x4'));var fs=require('fs');var path=require(_0xc14a('0x5'));var rimraf=require(_0xc14a('0x6'));var config=require(_0xc14a('0x7'));var attributes=require(_0xc14a('0x8'));module[_0xc14a('0x9')]=function(_0xb272b2,_0x1c0a27){return _0xb272b2[_0xc14a('0xa')](_0xc14a('0xb'),attributes,{'tableName':_0xc14a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d3c=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util','moment','bluebird','request-promise'];(function(_0x47f808,_0x86e0f6){var _0x299483=function(_0xcad841){while(--_0xcad841){_0x47f808['push'](_0x47f808['shift']());}};_0x299483(++_0x86e0f6);}(_0x3d3c,0x1c3));var _0xc3d3=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d3c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xc3d3('0x0'));var util=require(_0xc3d3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc3d3('0x2'));var BPromise=require(_0xc3d3('0x3'));var rp=require(_0xc3d3('0x4'));var fs=require('fs');var path=require(_0xc3d3('0x5'));var rimraf=require(_0xc3d3('0x6'));var config=require(_0xc3d3('0x7'));var attributes=require(_0xc3d3('0x8'));module['exports']=function(_0x130e39,_0x1db54a){return _0x130e39[_0xc3d3('0x9')](_0xc3d3('0xa'),attributes,{'tableName':_0xc3d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b11511a..c0e44b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5670=['message','result','catch','ReportAgentPreview','body','options','then','CreateReportAgentPreview','lodash','util','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2e7a43,_0x3b3df4){var _0x52e9e1=function(_0x2c08cf){while(--_0x2c08cf){_0x2e7a43['push'](_0x2e7a43['shift']());}};_0x52e9e1(++_0x3b3df4);}(_0x5670,0xaa));var _0x0567=function(_0x38b313,_0x4c5217){_0x38b313=_0x38b313-0x0;var _0x5d393d=_0x5670[_0x38b313];return _0x5d393d;};'use strict';var _=require(_0x0567('0x0'));var util=require(_0x0567('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0567('0x2'));var fs=require('fs');var Redis=require(_0x0567('0x3'));var db=require(_0x0567('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0567('0x5'));var config=require(_0x0567('0x6'));var jayson=require(_0x0567('0x7'));var client=jayson[_0x0567('0x8')][_0x0567('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2936bb,_0x38cf7c,_0x55bf61){return new BPromise(function(_0x5e1dcc,_0x3e9f22){return client[_0x0567('0xa')](_0x2936bb,_0x55bf61)['then'](function(_0xe7f032){logger[_0x0567('0xb')](_0x0567('0xc'),_0x38cf7c,'request\x20sent');logger[_0x0567('0xd')](_0x0567('0xe'),_0x38cf7c,_0x0567('0xf'),JSON[_0x0567('0x10')](_0xe7f032));if(_0xe7f032[_0x0567('0x11')]){if(_0xe7f032['error'][_0x0567('0x12')]===0x1f4){logger[_0x0567('0x11')](_0x0567('0xc'),_0x38cf7c,_0xe7f032[_0x0567('0x11')][_0x0567('0x13')]);return _0x3e9f22(_0xe7f032[_0x0567('0x11')][_0x0567('0x13')]);}logger[_0x0567('0x11')](_0x0567('0xc'),_0x38cf7c,_0xe7f032[_0x0567('0x11')][_0x0567('0x13')]);return _0x5e1dcc(_0xe7f032['error']['message']);}else{logger[_0x0567('0xb')](_0x0567('0xc'),_0x38cf7c,'request\x20sent');_0x5e1dcc(_0xe7f032[_0x0567('0x14')][_0x0567('0x13')]);}})[_0x0567('0x15')](function(_0x138780){logger[_0x0567('0x11')](_0x0567('0xc'),_0x38cf7c,_0x138780);_0x3e9f22(_0x138780);});});}exports['CreateReportAgentPreview']=function(_0x21ec74){var _0x462963=this;return new Promise(function(_0x4632bb,_0x209a50){return db[_0x0567('0x16')]['create'](_0x21ec74[_0x0567('0x17')],{'raw':_0x21ec74[_0x0567('0x18')]?_0x21ec74[_0x0567('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0567('0x19')](function(_0x1adaac){logger[_0x0567('0xb')]('CreateReportAgentPreview',_0x21ec74);logger[_0x0567('0xd')]('CreateReportAgentPreview',_0x21ec74,JSON[_0x0567('0x10')](_0x1adaac));_0x4632bb(_0x1adaac);})['catch'](function(_0x185daf){logger[_0x0567('0x11')](_0x0567('0x1a'),_0x185daf[_0x0567('0x13')],_0x21ec74);_0x209a50(_0x462963[_0x0567('0x11')](0x1f4,_0x185daf[_0x0567('0x13')]));});});};
\ No newline at end of file
+var _0x7bfa=['jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x388914,_0x3c63f9){var _0x1f9111=function(_0x23dd69){while(--_0x23dd69){_0x388914['push'](_0x388914['shift']());}};_0x1f9111(++_0x3c63f9);}(_0x7bfa,0x1ab));var _0xa7bf=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0x7bfa[_0x4df1f5];return _0x56585b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa7bf('0x0'));var BPromise=require(_0xa7bf('0x1'));var rs=require(_0xa7bf('0x2'));var fs=require('fs');var Redis=require(_0xa7bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7bf('0x4'));var logger=require(_0xa7bf('0x5'))(_0xa7bf('0x6'));var config=require(_0xa7bf('0x7'));var jayson=require(_0xa7bf('0x8'));var client=jayson[_0xa7bf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x535afc,_0x21be26,_0x2a4e5e){return new BPromise(function(_0x176c8d,_0x2ed14c){return client[_0xa7bf('0xa')](_0x535afc,_0x2a4e5e)[_0xa7bf('0xb')](function(_0x4b1300){logger[_0xa7bf('0xc')](_0xa7bf('0xd'),_0x21be26,_0xa7bf('0xe'));logger[_0xa7bf('0xf')](_0xa7bf('0x10'),_0x21be26,_0xa7bf('0xe'),JSON[_0xa7bf('0x11')](_0x4b1300));if(_0x4b1300['error']){if(_0x4b1300[_0xa7bf('0x12')][_0xa7bf('0x13')]===0x1f4){logger[_0xa7bf('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x21be26,_0x4b1300[_0xa7bf('0x12')][_0xa7bf('0x14')]);return _0x2ed14c(_0x4b1300[_0xa7bf('0x12')][_0xa7bf('0x14')]);}logger[_0xa7bf('0x12')](_0xa7bf('0xd'),_0x21be26,_0x4b1300[_0xa7bf('0x12')][_0xa7bf('0x14')]);return _0x176c8d(_0x4b1300['error'][_0xa7bf('0x14')]);}else{logger[_0xa7bf('0xc')](_0xa7bf('0xd'),_0x21be26,_0xa7bf('0xe'));_0x176c8d(_0x4b1300[_0xa7bf('0x15')][_0xa7bf('0x14')]);}})[_0xa7bf('0x16')](function(_0x4eca2c){logger[_0xa7bf('0x12')](_0xa7bf('0xd'),_0x21be26,_0x4eca2c);_0x2ed14c(_0x4eca2c);});});}exports[_0xa7bf('0x17')]=function(_0x4ca2c8){var _0x304b32=this;return new Promise(function(_0x3277eb,_0x292c6b){return db[_0xa7bf('0x18')][_0xa7bf('0x19')](_0x4ca2c8[_0xa7bf('0x1a')],{'raw':_0x4ca2c8[_0xa7bf('0x1b')]?_0x4ca2c8[_0xa7bf('0x1b')][_0xa7bf('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x239c0e){logger[_0xa7bf('0xc')]('CreateReportAgentPreview',_0x4ca2c8);logger[_0xa7bf('0xf')](_0xa7bf('0x17'),_0x4ca2c8,JSON[_0xa7bf('0x11')](_0x239c0e));_0x3277eb(_0x239c0e);})['catch'](function(_0x1feea2){logger[_0xa7bf('0x12')](_0xa7bf('0x17'),_0x1feea2['message'],_0x4ca2c8);_0x292c6b(_0x304b32[_0xa7bf('0x12')](0x1f4,_0x1feea2[_0xa7bf('0x14')]));});});};
\ No newline at end of file
index 79fc902..549c31e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87f8=['/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','/agents','/agents/:id/capacity','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','isAuthenticated','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x87f8,0x11f));var _0x887f=function(_0x221916,_0x307415){_0x221916=_0x221916-0x0;var _0x99cb72=_0x87f8[_0x221916];return _0x99cb72;};'use strict';var multer=require(_0x887f('0x0'));var util=require(_0x887f('0x1'));var path=require(_0x887f('0x2'));var express=require(_0x887f('0x3'));var router=express[_0x887f('0x4')]();var auth=require(_0x887f('0x5'));var controller=require(_0x887f('0x6'));router[_0x887f('0x7')]('/voice/channels',auth['isAuthenticated'](),controller['voiceChannels']);router[_0x887f('0x7')](_0x887f('0x8'),auth['isAuthenticated'](),controller['voiceChannelMixMonitor']);router['get'](_0x887f('0x9'),auth['isAuthenticated'](),controller[_0x887f('0xa')]);router[_0x887f('0x7')](_0x887f('0xb'),auth[_0x887f('0xc')](),controller[_0x887f('0xd')]);router['get'](_0x887f('0xe'),auth['isAuthenticated'](),controller[_0x887f('0xf')]);router[_0x887f('0x7')](_0x887f('0x10'),auth[_0x887f('0xc')](),controller[_0x887f('0x11')]);router[_0x887f('0x7')]('/mail/accounts',auth[_0x887f('0xc')](),controller[_0x887f('0x12')]);router['get'](_0x887f('0x13'),auth[_0x887f('0xc')](),controller[_0x887f('0x14')]);router[_0x887f('0x7')](_0x887f('0x15'),auth[_0x887f('0xc')](),controller[_0x887f('0x16')]);router[_0x887f('0x7')](_0x887f('0x17'),auth['isAuthenticated'](),controller[_0x887f('0x18')]);router[_0x887f('0x7')]('/fax/queues',auth[_0x887f('0xc')](),controller[_0x887f('0x19')]);router[_0x887f('0x7')]('/voice/queues/preview/:id',auth[_0x887f('0xc')](),controller[_0x887f('0x1a')]);router[_0x887f('0x7')]('/voice/queues/channels',auth[_0x887f('0xc')](),controller[_0x887f('0x1b')]);router['get'](_0x887f('0x1c'),auth['isAuthenticated'](),controller[_0x887f('0x1d')]);router[_0x887f('0x7')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x887f('0xc')](),controller['voiceQueuesChannelHangup']);router[_0x887f('0x7')](_0x887f('0x1e'),auth[_0x887f('0xc')](),controller[_0x887f('0x1f')]);router[_0x887f('0x7')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x887f('0x20')]);router[_0x887f('0x21')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x887f('0x22')]);router[_0x887f('0x7')](_0x887f('0x23'),auth['isAuthenticated'](),controller['outbound']);router[_0x887f('0x7')](_0x887f('0x24'),auth[_0x887f('0xc')](),controller['outboundChannels']);router[_0x887f('0x7')](_0x887f('0x25'),auth[_0x887f('0xc')](),controller['agents']);router[_0x887f('0x21')](_0x887f('0x26'),auth['isAuthenticated'](),controller['agentCapacity']);router[_0x887f('0x7')]('/telephones',auth[_0x887f('0xc')](),controller['telephones']);router[_0x887f('0x7')](_0x887f('0x27'),auth['isAuthenticated'](),controller[_0x887f('0x28')]);router[_0x887f('0x7')](_0x887f('0x29'),auth[_0x887f('0xc')](),controller[_0x887f('0x2a')]);router[_0x887f('0x7')](_0x887f('0x2b'),auth['isAuthenticated'](),controller[_0x887f('0x2c')]);router[_0x887f('0x7')](_0x887f('0x2d'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x887f('0x7')](_0x887f('0x2e'),auth[_0x887f('0xc')](),controller[_0x887f('0x2f')]);router[_0x887f('0x7')](_0x887f('0x30'),auth['isAuthenticated'](),controller[_0x887f('0x31')]);router[_0x887f('0x7')]('/openchannel/queues/:id/waitinginteractions',auth[_0x887f('0xc')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x887f('0x7')](_0x887f('0x32'),auth[_0x887f('0xc')](),controller[_0x887f('0x33')]);router[_0x887f('0x7')](_0x887f('0x34'),auth[_0x887f('0xc')](),controller[_0x887f('0x35')]);router[_0x887f('0x7')]('/fax/queues/waitinginteractions',auth[_0x887f('0xc')](),controller[_0x887f('0x36')]);router[_0x887f('0x37')](_0x887f('0x38'),auth['isAuthenticated'](),controller[_0x887f('0x39')](_0x887f('0x3a')));router[_0x887f('0x7')](_0x887f('0x3b'),auth[_0x887f('0xc')](),controller[_0x887f('0x3c')]);router[_0x887f('0x37')](_0x887f('0x3d'),auth['isAuthenticated'](),controller['queueNotify']('chat'));router[_0x887f('0x7')](_0x887f('0x3e'),auth[_0x887f('0xc')](),controller[_0x887f('0x3f')]);router[_0x887f('0x37')](_0x887f('0x40'),auth[_0x887f('0xc')](),controller[_0x887f('0x39')](_0x887f('0x41')));router[_0x887f('0x7')](_0x887f('0x42'),auth[_0x887f('0xc')](),controller[_0x887f('0x43')]);router[_0x887f('0x37')](_0x887f('0x44'),auth[_0x887f('0xc')](),controller[_0x887f('0x39')]('openchannel'));router[_0x887f('0x7')](_0x887f('0x45'),auth[_0x887f('0xc')](),controller['showOpenchannelQueues']);router[_0x887f('0x37')](_0x887f('0x46'),auth[_0x887f('0xc')](),controller['queueNotify'](_0x887f('0x47')));router[_0x887f('0x37')](_0x887f('0x48'),auth['isAuthenticated'](),controller[_0x887f('0x39')](_0x887f('0x49')));router[_0x887f('0x7')]('/sms/queues/:id',auth[_0x887f('0xc')](),controller[_0x887f('0x4a')]);router[_0x887f('0x7')](_0x887f('0x4b'),auth[_0x887f('0xc')](),controller['showWhatsappQueues']);router[_0x887f('0x37')]('/agents/:id/notify',auth[_0x887f('0xc')](),controller['agentNotify']);module[_0x887f('0x4c')]=router;
\ No newline at end of file
+var _0x7c4a=['voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','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','showVoiceQueues','put','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','openchannel','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor'];(function(_0x15c8d1,_0x40ba32){var _0x262c5c=function(_0x1f9611){while(--_0x1f9611){_0x15c8d1['push'](_0x15c8d1['shift']());}};_0x262c5c(++_0x40ba32);}(_0x7c4a,0xf1));var _0xa7c4=function(_0x234341,_0x1f0568){_0x234341=_0x234341-0x0;var _0x2fd6e9=_0x7c4a[_0x234341];return _0x2fd6e9;};'use strict';var multer=require(_0xa7c4('0x0'));var util=require(_0xa7c4('0x1'));var path=require(_0xa7c4('0x2'));var express=require(_0xa7c4('0x3'));var router=express[_0xa7c4('0x4')]();var auth=require(_0xa7c4('0x5'));var controller=require('./rpc.controller');router[_0xa7c4('0x6')](_0xa7c4('0x7'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x9')]);router[_0xa7c4('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xa7c4('0x8')](),controller[_0xa7c4('0xa')]);router[_0xa7c4('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xa7c4('0x8')](),controller[_0xa7c4('0xb')]);router[_0xa7c4('0x6')](_0xa7c4('0xc'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0xd')]);router[_0xa7c4('0x6')]('/chat/queues',auth['isAuthenticated'](),controller[_0xa7c4('0xe')]);router[_0xa7c4('0x6')](_0xa7c4('0xf'),auth[_0xa7c4('0x8')](),controller['mailQueues']);router[_0xa7c4('0x6')](_0xa7c4('0x10'),auth[_0xa7c4('0x8')](),controller['mailAccounts']);router[_0xa7c4('0x6')](_0xa7c4('0x11'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x12')]);router['get'](_0xa7c4('0x13'),auth['isAuthenticated'](),controller[_0xa7c4('0x14')]);router[_0xa7c4('0x6')](_0xa7c4('0x15'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x16')]);router[_0xa7c4('0x6')](_0xa7c4('0x17'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x18')]);router[_0xa7c4('0x6')](_0xa7c4('0x19'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x1a')]);router[_0xa7c4('0x6')](_0xa7c4('0x1b'),auth[_0xa7c4('0x8')](),controller['voiceQueuesChannels']);router[_0xa7c4('0x6')](_0xa7c4('0x1c'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x1d')]);router['get'](_0xa7c4('0x1e'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x1f')]);router[_0xa7c4('0x6')](_0xa7c4('0x20'),auth['isAuthenticated'](),controller[_0xa7c4('0x21')]);router['get'](_0xa7c4('0x22'),auth['isAuthenticated'](),controller[_0xa7c4('0x23')]);router[_0xa7c4('0x24')](_0xa7c4('0x22'),auth[_0xa7c4('0x8')](),controller['updateVoiceQueue']);router[_0xa7c4('0x6')]('/outbound',auth[_0xa7c4('0x8')](),controller['outbound']);router[_0xa7c4('0x6')](_0xa7c4('0x25'),auth['isAuthenticated'](),controller[_0xa7c4('0x26')]);router['get'](_0xa7c4('0x27'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x28')]);router[_0xa7c4('0x24')](_0xa7c4('0x29'),auth['isAuthenticated'](),controller[_0xa7c4('0x2a')]);router[_0xa7c4('0x6')](_0xa7c4('0x2b'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x2c')]);router[_0xa7c4('0x6')](_0xa7c4('0x2d'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x2e')]);router[_0xa7c4('0x6')](_0xa7c4('0x2f'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x30')]);router[_0xa7c4('0x6')](_0xa7c4('0x31'),auth[_0xa7c4('0x8')](),controller['faxAccounts']);router['get'](_0xa7c4('0x32'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0xa7c4('0x6')](_0xa7c4('0x33'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x34')]);router['get'](_0xa7c4('0x35'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x36')]);router[_0xa7c4('0x6')](_0xa7c4('0x37'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x38')]);router[_0xa7c4('0x6')]('/sms/queues/waitinginteractions',auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x39')]);router[_0xa7c4('0x6')](_0xa7c4('0x3a'),auth['isAuthenticated'](),controller[_0xa7c4('0x3b')]);router[_0xa7c4('0x6')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xa7c4('0x3c')](_0xa7c4('0x3d'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x3e')](_0xa7c4('0x3f')));router[_0xa7c4('0x6')](_0xa7c4('0x40'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x41')]);router[_0xa7c4('0x3c')]('/chat/queues/:id/notify',auth[_0xa7c4('0x8')](),controller['queueNotify'](_0xa7c4('0x42')));router[_0xa7c4('0x6')](_0xa7c4('0x43'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x44')]);router[_0xa7c4('0x3c')](_0xa7c4('0x45'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x3e')](_0xa7c4('0x46')));router['get']('/fax/queues/:id',auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x47')]);router[_0xa7c4('0x3c')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xa7c4('0x3e')](_0xa7c4('0x48')));router['get']('/openchannel/queues/:id',auth[_0xa7c4('0x8')](),controller['showOpenchannelQueues']);router[_0xa7c4('0x3c')](_0xa7c4('0x49'),auth[_0xa7c4('0x8')](),controller['queueNotify'](_0xa7c4('0x4a')));router['post'](_0xa7c4('0x4b'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x3e')](_0xa7c4('0x4c')));router[_0xa7c4('0x6')](_0xa7c4('0x4d'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x4e')]);router[_0xa7c4('0x6')](_0xa7c4('0x4f'),auth['isAuthenticated'](),controller[_0xa7c4('0x50')]);router[_0xa7c4('0x3c')](_0xa7c4('0x51'),auth[_0xa7c4('0x8')](),controller[_0xa7c4('0x52')]);module[_0xa7c4('0x53')]=router;
\ No newline at end of file
index 50ed786..588b57f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0x776da7,_0x59ff73){var _0x78d758=function(_0x361396){while(--_0x361396){_0x776da7['push'](_0x776da7['shift']());}};_0x78d758(++_0x59ff73);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x5fc3[_0x5280f4];return _0xba93e7;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));};
\ No newline at end of file
+var _0xeec6=['YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','\x20Message\x20not\x20found','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','status','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','catch','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','MemberReport','INTERACTION','length','format','SIP/%s','interface'];(function(_0x3bffc5,_0x288950){var _0x1b666b=function(_0x480698){while(--_0x480698){_0x3bffc5['push'](_0x3bffc5['shift']());}};_0x1b666b(++_0x288950);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xeec6[_0x5e42a7];return _0x36d21b;};'use strict';var BPromise=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var _=require(_0x6eec('0x2'));var util=require(_0x6eec('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6eec('0x4'))(_0x6eec('0x5'));var jayson=require(_0x6eec('0x6'));var amiClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232a});var mailClient=jayson[_0x6eec('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0x6eec('0x7')][_0x6eec('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x48064a,_0x5a5e47,_0x1c810e){return new BPromise(function(_0x3443c2,_0x834c2){var _0x56e849=_0x1c810e?_0x1c810e:amiClient;return _0x56e849[_0x6eec('0x9')](_0x48064a,_0x5a5e47)[_0x6eec('0xa')](function(_0x1c774d){if(_0x1c774d['error']){if(_0x1c774d['error']['code']===0x1f4){return _0x834c2(_0x1c774d[_0x6eec('0xb')][_0x6eec('0xc')]);}return _0x3443c2(_0x1c774d['error']['message']);}else{_0x3443c2(_0x1c774d[_0x6eec('0xd')]);}})['catch'](function(_0x3091d0){_0x834c2(_0x3091d0);});});}function respondWithResult(_0x3387c2,_0x162db1){_0x162db1=_0x162db1||0xc8;return function(_0x3fe94b){if(_0x3fe94b){return _0x3387c2[_0x6eec('0xe')](_0x162db1)['json'](_0x3fe94b);}return _0x3387c2[_0x6eec('0xf')](0x194);};}function handleError(_0x3b2972,_0x462dbb){_0x462dbb=_0x462dbb||0x1f4;return function(_0xc35914){logger[_0x6eec('0xb')](_0xc35914[_0x6eec('0x10')]);if(_0xc35914[_0x6eec('0x11')]){delete _0xc35914[_0x6eec('0x11')];}_0x3b2972[_0x6eec('0xe')](_0x462dbb)[_0x6eec('0x12')](_0xc35914);};}function findById(_0x5e2a9b){return function(_0x3c0c1b){if(!_['isNil'](_0x5e2a9b)&&!_[_0x6eec('0x13')](_0x3c0c1b)&&!_[_0x6eec('0x13')](_0x3c0c1b['rows'])){return _[_0x6eec('0x14')](_0x3c0c1b[_0x6eec('0x15')],function(_0xb1eab7){return _0xb1eab7['id']==_0x5e2a9b;});}return null;};}exports['voiceChannels']=function(_0x87f3be,_0x1ed94c){return respondWithRpcPromise(_0x6eec('0x16'),_0x87f3be[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1ed94c,null))[_0x6eec('0x18')](handleError(_0x1ed94c,null));};exports['voiceChannelMixMonitor']=function(_0x328693,_0x2f843e){return respondWithRpcPromise(_0x6eec('0x19'),_[_0x6eec('0x1a')](_0x328693[_0x6eec('0x17')],_0x328693[_0x6eec('0x1b')]))['then'](respondWithResult(_0x2f843e,null))[_0x6eec('0x18')](handleError(_0x2f843e,null));};exports[_0x6eec('0x1c')]=function(_0x285d41,_0x27785a){return respondWithRpcPromise(_0x6eec('0x1d'),_[_0x6eec('0x1a')](_0x285d41['query'],_0x285d41[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x27785a,null))[_0x6eec('0x18')](handleError(_0x27785a,null));};exports[_0x6eec('0x1e')]=function(_0x1d2be9,_0x1f386c){return respondWithRpcPromise(_0x6eec('0x1f'),_0x1d2be9[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x1f386c,null))['catch'](handleError(_0x1f386c,null));};exports[_0x6eec('0x20')]=function(_0x44b31c,_0x30eb98){return respondWithRpcPromise(_0x6eec('0x1f'),_0x44b31c['query'])[_0x6eec('0xa')](findById(_0x44b31c[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0x30eb98,null))['catch'](handleError(_0x30eb98,null));};exports[_0x6eec('0x21')]=function(_0x47ed95,_0x20a130){return respondWithRpcPromise(_0x6eec('0x22'),_[_0x6eec('0x1a')](_0x47ed95[_0x6eec('0x23')],_0x47ed95[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x20a130,null))[_0x6eec('0x18')](handleError(_0x20a130,null));};exports[_0x6eec('0x24')]=function(_0x1abd19,_0x414f5b){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6eec('0x1a')](_0x1abd19['query'],_0x1abd19[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x414f5b,null))[_0x6eec('0x18')](handleError(_0x414f5b,null));};exports['voiceQueuesChannels']=function(_0x57b40b,_0x508735){return respondWithRpcPromise(_0x6eec('0x25'),_0x57b40b[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x508735,null))[_0x6eec('0x18')](handleError(_0x508735,null));};exports[_0x6eec('0x26')]=function(_0x23547d,_0x22e0cb){return respondWithRpcPromise(_0x6eec('0x27'),_[_0x6eec('0x1a')](_0x23547d[_0x6eec('0x17')],_0x23547d[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x22e0cb,null))['catch'](handleError(_0x22e0cb,null));};exports[_0x6eec('0x28')]=function(_0x361ab7,_0x2c83d1){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x6eec('0x1a')](_0x361ab7[_0x6eec('0x17')],_0x361ab7[_0x6eec('0x1b')]))[_0x6eec('0xa')](respondWithResult(_0x2c83d1,null))[_0x6eec('0x18')](handleError(_0x2c83d1,null));};exports[_0x6eec('0x29')]=function(_0x4a7699,_0x45cfb6){return respondWithRpcPromise(_0x6eec('0x2a'),_[_0x6eec('0x1a')](_0x4a7699['query'],_0x4a7699['params']))[_0x6eec('0xa')](respondWithResult(_0x45cfb6,null))[_0x6eec('0x18')](handleError(_0x45cfb6,null));};exports[_0x6eec('0x2b')]=function(_0x3f79d1,_0x402bac){return respondWithRpcPromise('Outbound',_0x3f79d1[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x402bac,null))[_0x6eec('0x18')](handleError(_0x402bac,null));};exports[_0x6eec('0x2c')]=function(_0x15918c,_0x2be999){return respondWithRpcPromise(_0x6eec('0x2d'),_0x15918c[_0x6eec('0x17')])['then'](respondWithResult(_0x2be999,null))[_0x6eec('0x18')](handleError(_0x2be999,null));};exports[_0x6eec('0x2e')]=function(_0x4d30c9,_0x5b3283){var _0x160fc0;return respondWithRpcPromise(_0x6eec('0x2f'),_0x4d30c9[_0x6eec('0x17')])[_0x6eec('0xa')](function(_0x4cb50e){_0x160fc0=_0x4cb50e;return respondWithRpcPromise('Agents',_0x4d30c9[_0x6eec('0x17')],routingClient);})['then'](function(_0x5ac8b2){return _[_0x6eec('0x1a')]({},_0x5ac8b2,_0x160fc0);})[_0x6eec('0xa')](respondWithResult(_0x5b3283,null))[_0x6eec('0x18')](handleError(_0x5b3283,null));};exports[_0x6eec('0x30')]=function(_0x25d3f3,_0x58dfe7){if(_0x25d3f3[_0x6eec('0x23')]&&_0x25d3f3[_0x6eec('0x23')]['interaction']&&_0x25d3f3[_0x6eec('0x31')]&&_0x25d3f3[_0x6eec('0x31')]['name']){for(var _0x2d39bf in _0x25d3f3[_0x6eec('0x23')]['interaction']){if(_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x6eec('0x33')](_0x2d39bf)){db[_0x6eec('0x34')]['findAll']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'type':_0x6eec('0x35'),'exitAt':null,'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]&&_0x25d3f3['body']['interaction'][_0x2d39bf][_0x6eec('0x36')]?{'$notIn':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf]}:{'$ne':null}}})[_0x6eec('0xa')](function(_0x44c7b8){var _0x59d7a7=moment()[_0x6eec('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x20524a=0x0,_0x408295=_0x44c7b8[_0x6eec('0x36')];_0x20524a<_0x408295;_0x20524a+=0x1){_0x44c7b8[_0x20524a]['updateAttributes']({'exitAt':_0x59d7a7});}});for(var _0x2b83f2=0x0;_0x2b83f2<_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x6eec('0x36')];_0x2b83f2+=0x1){db[_0x6eec('0x34')]['findOrCreate']({'where':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')]['name'],'type':'INTERACTION','uniqueid':_0x25d3f3[_0x6eec('0x23')]['interaction'][_0x2d39bf][_0x2b83f2],'exitAt':null},'defaults':{'channel':_0x2d39bf,'membername':_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')],'interface':_[_0x6eec('0x13')](_0x25d3f3['user']['interface'])?util[_0x6eec('0x37')](_0x6eec('0x38'),_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x11')]):_0x25d3f3[_0x6eec('0x31')][_0x6eec('0x39')],'type':_0x6eec('0x35'),'enterAt':moment()[_0x6eec('0x37')](_0x6eec('0x3a')),'role':_0x6eec('0x3b'),'internal':_0x25d3f3['user']['internal'],'uniqueid':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x32')][_0x2d39bf][_0x2b83f2]}});}}}}return respondWithRpcPromise(_0x6eec('0x3c'),{'id':_0x25d3f3['params']['id'],'capacity':_0x25d3f3[_0x6eec('0x23')][_0x6eec('0x3d')]},routingClient)[_0x6eec('0xa')](respondWithResult(_0x58dfe7,null))[_0x6eec('0x18')](handleError(_0x58dfe7,null));};exports[_0x6eec('0x3e')]=function(_0x43f77a,_0x10c10a){return respondWithRpcPromise(_0x6eec('0x3f'),_0x43f77a['query'])[_0x6eec('0xa')](respondWithResult(_0x10c10a,null))[_0x6eec('0x18')](handleError(_0x10c10a,null));};exports[_0x6eec('0x40')]=function(_0x3e77f3,_0x490d27){return respondWithRpcPromise('Trunks',_0x3e77f3['query'])[_0x6eec('0xa')](respondWithResult(_0x490d27,null))[_0x6eec('0x18')](handleError(_0x490d27,null));};exports[_0x6eec('0x41')]=function(_0x1de626,_0x5178f5){return respondWithRpcPromise('Campaigns',_0x1de626[_0x6eec('0x17')])[_0x6eec('0xa')](respondWithResult(_0x5178f5,null))[_0x6eec('0x18')](handleError(_0x5178f5,null));};exports['chatQueues']=function(_0x238605,_0x35f411){return respondWithRpcPromise(_0x6eec('0x42'),_0x238605[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x35f411,null))[_0x6eec('0x18')](handleError(_0x35f411,null));};exports[_0x6eec('0x43')]=function(_0x19fe55,_0x45fed3){return respondWithRpcPromise('ChatQueues',_0x19fe55[_0x6eec('0x17')],routingClient)['then'](findById(_0x19fe55[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x45fed3,null))[_0x6eec('0x18')](handleError(_0x45fed3,null));};exports[_0x6eec('0x44')]=function(_0x248d76,_0x360176){return respondWithRpcPromise(_0x6eec('0x45'),_0x248d76['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x360176,null))['catch'](handleError(_0x360176,null));};exports[_0x6eec('0x46')]=function(_0x5c905f,_0x237324){return respondWithRpcPromise(_0x6eec('0x45'),_0x5c905f[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5c905f[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x237324,null))[_0x6eec('0x18')](handleError(_0x237324,null));};exports[_0x6eec('0x47')]=function(_0x130002,_0x4114d1){return respondWithRpcPromise('MailAccounts',_0x130002['query'],mailClient)[_0x6eec('0xa')](respondWithResult(_0x4114d1,null))[_0x6eec('0x18')](handleError(_0x4114d1,null));};exports[_0x6eec('0x48')]=function(_0x2c0644,_0x20b040){return respondWithRpcPromise('OpenchannelQueues',_0x2c0644[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x20b040,null))['catch'](handleError(_0x20b040,null));};exports['showOpenchannelQueues']=function(_0x5dc8b3,_0xaa2a15){return respondWithRpcPromise(_0x6eec('0x49'),_0x5dc8b3['query'],routingClient)[_0x6eec('0xa')](findById(_0x5dc8b3[_0x6eec('0x1b')]['id']))['then'](respondWithResult(_0xaa2a15,null))[_0x6eec('0x18')](handleError(_0xaa2a15,null));};exports[_0x6eec('0x4a')]=function(_0xc852b3,_0x3c1f77){return respondWithRpcPromise('SmsQueues',_0xc852b3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x3c1f77,null))[_0x6eec('0x18')](handleError(_0x3c1f77,null));};exports[_0x6eec('0x4b')]=function(_0x19ca46,_0x34c4b4){return respondWithRpcPromise(_0x6eec('0x4c'),_0x19ca46[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x19ca46[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x34c4b4,null))[_0x6eec('0x18')](handleError(_0x34c4b4,null));};exports[_0x6eec('0x4d')]=function(_0x2799ca,_0x386a67){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2799ca[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x386a67,null))['catch'](handleError(_0x386a67,null));};exports[_0x6eec('0x4f')]=function(_0x2236f7,_0x48bb52){return respondWithRpcPromise(_0x6eec('0x4e'),_0x2236f7[_0x6eec('0x17')],routingClient)['then'](findById(_0x2236f7[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x48bb52,null))[_0x6eec('0x18')](handleError(_0x48bb52,null));};exports[_0x6eec('0x50')]=function(_0x4c73f2,_0x40a81a){return respondWithRpcPromise(_0x6eec('0x51'),_0x4c73f2[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x40a81a,null))[_0x6eec('0x18')](handleError(_0x40a81a,null));};exports[_0x6eec('0x52')]=function(_0x5ae0a0,_0x1ed47e){return respondWithRpcPromise('FaxQueues',_0x5ae0a0[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](findById(_0x5ae0a0[_0x6eec('0x1b')]['id']))[_0x6eec('0xa')](respondWithResult(_0x1ed47e,null))[_0x6eec('0x18')](handleError(_0x1ed47e,null));};exports[_0x6eec('0x53')]=function(_0x404b64,_0x2ea7fe){return respondWithRpcPromise(_0x6eec('0x54'),_0x404b64['query'])[_0x6eec('0xa')](respondWithResult(_0x2ea7fe,null))[_0x6eec('0x18')](handleError(_0x2ea7fe,null));};exports[_0x6eec('0x55')]=function(_0x4eef6e,_0x19f8e2){return respondWithRpcPromise(_0x6eec('0x56'),_0x4eef6e['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x19f8e2,null))[_0x6eec('0x18')](handleError(_0x19f8e2,null));};exports[_0x6eec('0x57')]=function(_0x18e62b,_0x266689){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x18e62b[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x266689,null))[_0x6eec('0x18')](handleError(_0x266689,null));};exports[_0x6eec('0x58')]=function(_0x3894dc,_0x56483b){return respondWithRpcPromise(_0x6eec('0x59'),_0x3894dc[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x56483b,null))[_0x6eec('0x18')](handleError(_0x56483b,null));};exports[_0x6eec('0x5a')]=function(_0x232b3a,_0x7dd5d1){return respondWithRpcPromise(_0x6eec('0x59'),_0x232b3a['query'],routingClient)[_0x6eec('0xa')](function(_0x59341a){if(_0x232b3a[_0x6eec('0x17')][_0x6eec('0x5b')]!==undefined){var _0x7a7288=_(_0x59341a[_0x6eec('0x15')])['filter']([_0x232b3a[_0x6eec('0x17')]['type'],_0x232b3a[_0x6eec('0x1b')]['id']])[_0x6eec('0x5c')](_0x6eec('0x5d'))[_0x6eec('0x5e')]()['value']();return _0x59341a['rows']['filter'](function(_0x1158b1){return _0x7a7288[_0x6eec('0x5f')](_0x1158b1[_0x6eec('0x5d')])>-0x1;});}else{return _0x59341a[_0x6eec('0x15')]['filter'](function(_0x44302a){return _0x44302a['queue_id']===parseInt(_0x232b3a[_0x6eec('0x1b')]['id']);});}})[_0x6eec('0xa')](respondWithResult(_0x7dd5d1,null))['catch'](handleError(_0x7dd5d1,null));};exports[_0x6eec('0x60')]=function(_0x2f9e8a,_0x333280){return respondWithRpcPromise(_0x6eec('0x61'),_0x2f9e8a[_0x6eec('0x17')],routingClient)[_0x6eec('0xa')](respondWithResult(_0x333280,null))['catch'](handleError(_0x333280,null));};exports[_0x6eec('0x62')]=function(_0x5aa2f3,_0x64c2ef){return respondWithRpcPromise(_0x6eec('0x63'),_0x5aa2f3['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x64c2ef,null))['catch'](handleError(_0x64c2ef,null));};exports[_0x6eec('0x64')]=function(_0x1d1683,_0x8a4166){return respondWithRpcPromise(_0x6eec('0x65'),_0x1d1683['query'],routingClient)[_0x6eec('0xa')](respondWithResult(_0x8a4166,null))['catch'](handleError(_0x8a4166,null));};exports[_0x6eec('0x66')]=function(_0x2c0a85){return function(_0x51560c,_0x3dcf9d){var _0x435562,_0x3a90cd;var _0x328f28=_[_0x6eec('0x67')](_0x2c0a85);var _0x514e15=_0x2c0a85===_0x6eec('0x68')?_0x6eec('0x69'):_0x6eec('0x6a');return db[_0x328f28+_0x6eec('0x6b')][_0x6eec('0x6c')]({'raw':!![],'where':{'id':_0x51560c[_0x6eec('0x1b')]['id']}})['then'](function(_0x4a3af3){if(_[_0x6eec('0x13')](_0x4a3af3)){throw new Error(_0x328f28+_0x6eec('0x6d'));}_0x435562=_0x4a3af3;return db[_0x328f28+'Message']['findOne']({'where':{'id':_0x51560c[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0x328f28+'Interaction'],'as':_0x6eec('0x6f')},{'model':db[_0x328f28+_0x514e15],'as':_0x6eec('0x6a')}]});})[_0x6eec('0xa')](function(_0x5042a0){if(_[_0x6eec('0x13')](_0x5042a0)){throw new Error(_0x328f28+'\x20Message\x20not\x20found');}_0x3a90cd=_0x5042a0;return _0x5042a0[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6eec('0xa')](function(){var _0x585432={'uniqueid':_0x2c0a85+'.'+_0x3a90cd['id']+'.'+_0x3a90cd[_0x6eec('0x6f')]['id'],'FromUserId':_0x51560c[_0x6eec('0x31')]['id'],'type':_0x6eec('0x71')};_0x585432[_0x328f28+'MessageId']=_0x3a90cd['id'];_0x585432[_0x328f28+_0x6eec('0x72')]=_0x3a90cd[_0x6eec('0x6f')]['id'];_0x585432[_0x6eec('0x73')+_0x328f28+_0x514e15+'Id']=_0x3a90cd[_0x6eec('0x6a')]['id'];_0x585432['To'+_0x328f28+_0x6eec('0x74')]=_0x435562['id'];return db[_0x328f28+_0x6eec('0x75')]['create'](_0x585432);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0x2c0a85,'interaction':_0x3a90cd[_0x6eec('0x6f')],'message':_0x3a90cd,'account':_0x3a90cd[_0x6eec('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6eec('0x71'),'appdata':_0x435562[_0x6eec('0x11')]+','+(_0x3a90cd[_0x6eec('0x6a')][_0x6eec('0x77')]||0x12c),'interval':_0x6eec('0x78')}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x3dcf9d,null))[_0x6eec('0x18')](handleError(_0x3dcf9d,null));};};exports[_0x6eec('0x79')]=function(_0x56043a,_0x1419e0){var _0x1d6604,_0x10fad1;if(_[_0x6eec('0x13')](_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')])){throw new Error(_0x6eec('0x7b'));}var _0xa94ada=_0x56043a[_0x6eec('0x23')][_0x6eec('0x7a')];var _0xaddba4=_[_0x6eec('0x67')](_0xa94ada);var _0x89aace=_0xa94ada===_0x6eec('0x68')?_0x6eec('0x69'):'Account';return db[_0x6eec('0x7c')]['findOne']({'raw':!![],'where':{'id':_0x56043a[_0x6eec('0x1b')]['id'],'role':_0x6eec('0x3b')}})[_0x6eec('0xa')](function(_0x2607ca){if(_['isNil'](_0x2607ca)){throw new Error(_0x6eec('0x7d'));}_0x1d6604=_0x2607ca;return db[_0xaddba4+'Message'][_0x6eec('0x6c')]({'where':{'id':_0x56043a[_0x6eec('0x23')][_0x6eec('0x6e')]},'include':[{'model':db[_0xaddba4+_0x6eec('0x6f')],'as':_0x6eec('0x6f')},{'model':db[_0xaddba4+_0x89aace],'as':_0x6eec('0x6a')}]});})['then'](function(_0x2888f4){if(_[_0x6eec('0x13')](_0x2888f4)){throw new Error(_0xaddba4+_0x6eec('0x7e'));}_0x10fad1=_0x2888f4;return _0x2888f4[_0x6eec('0x70')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5229db={'uniqueid':_0xa94ada+'.'+_0x10fad1['id']+'.'+_0x10fad1[_0x6eec('0x6f')]['id'],'FromUserId':_0x56043a[_0x6eec('0x31')]['id'],'type':'queue','ToUserId':_0x1d6604['id']};_0x5229db[_0xaddba4+'MessageId']=_0x10fad1['id'];_0x5229db[_0xaddba4+_0x6eec('0x72')]=_0x10fad1[_0x6eec('0x6f')]['id'];_0x5229db['From'+_0xaddba4+_0x89aace+'Id']=_0x10fad1[_0x6eec('0x6a')]['id'];return db[_0xaddba4+_0x6eec('0x75')]['create'](_0x5229db);})[_0x6eec('0xa')](function(){return respondWithRpcPromise(_0x6eec('0x76'),{'channel':_0xa94ada,'interaction':_0x10fad1[_0x6eec('0x6f')],'message':_0x10fad1,'account':_0x10fad1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1d6604['name']+','+(_0x10fad1[_0x6eec('0x6a')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6eec('0xa')](respondWithResult(_0x1419e0,null))['catch'](handleError(_0x1419e0,null));};
\ No newline at end of file
index 21623f1..396e1cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa6f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./schedule.controller','isAuthenticated','get','/:id','show','run','update','delete','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xfa6f,0x177));var _0xffa6=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xfa6f[_0x3207aa];return _0x51758f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xffa6('0x0'));var timeout=require(_0xffa6('0x1'));var express=require(_0xffa6('0x2'));var router=express['Router']();var fs_extra=require(_0xffa6('0x3'));var auth=require(_0xffa6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xffa6('0x5'));var controller=require(_0xffa6('0x6'));router['get']('/',auth[_0xffa6('0x7')](),controller['index']);router[_0xffa6('0x8')](_0xffa6('0x9'),auth[_0xffa6('0x7')](),controller[_0xffa6('0xa')]);router['get']('/:id/run',auth[_0xffa6('0x7')](),controller[_0xffa6('0xb')]);router['post']('/',auth[_0xffa6('0x7')](),controller['create']);router['put']('/:id',auth[_0xffa6('0x7')](),controller[_0xffa6('0xc')]);router[_0xffa6('0xd')](_0xffa6('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xffa6('0xe')]=router;
\ No newline at end of file
+var _0xf5d9=['fs-extra','../../components/interaction/service','./schedule.controller','isAuthenticated','index','get','/:id','show','run','post','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x15a5fa,_0x1dc1e0){var _0x31b570=function(_0x496859){while(--_0x496859){_0x15a5fa['push'](_0x15a5fa['shift']());}};_0x31b570(++_0x1dc1e0);}(_0xf5d9,0x1e2));var _0x9f5d=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xf5d9[_0x30b0d8];return _0x459c09;};'use strict';var multer=require('multer');var util=require(_0x9f5d('0x0'));var path=require('path');var timeout=require(_0x9f5d('0x1'));var express=require(_0x9f5d('0x2'));var router=express[_0x9f5d('0x3')]();var fs_extra=require(_0x9f5d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f5d('0x5'));var config=require('../../config/environment');var controller=require(_0x9f5d('0x6'));router['get']('/',auth[_0x9f5d('0x7')](),controller[_0x9f5d('0x8')]);router[_0x9f5d('0x9')](_0x9f5d('0xa'),auth[_0x9f5d('0x7')](),controller[_0x9f5d('0xb')]);router[_0x9f5d('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0x9f5d('0xc')]);router[_0x9f5d('0xd')]('/',auth[_0x9f5d('0x7')](),controller['create']);router[_0x9f5d('0xe')](_0x9f5d('0xa'),auth[_0x9f5d('0x7')](),controller[_0x9f5d('0xf')]);router[_0x9f5d('0x10')]('/:id',auth[_0x9f5d('0x7')](),controller['destroy']);module[_0x9f5d('0x11')]=router;
\ No newline at end of file
index 0ecceaf..f10cf6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc6=['months','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters'];(function(_0x4c43fd,_0x48c00e){var _0x5cde73=function(_0x51df75){while(--_0x51df75){_0x4c43fd['push'](_0x4c43fd['shift']());}};_0x5cde73(++_0x48c00e);}(_0x5bc6,0x199));var _0x65bc=function(_0x5b3fb7,_0x24fcf6){_0x5b3fb7=_0x5b3fb7-0x0;var _0x4b947b=_0x5bc6[_0x5b3fb7];return _0x4b947b;};'use strict';var Sequelize=require(_0x65bc('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x65bc('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x65bc('0x2')],'allowNull':![],'defaultValue':_0x65bc('0x3')},'startAt':{'type':Sequelize[_0x65bc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x65bc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x65bc('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x65bc('0x6')](_0x65bc('0x7'),_0x65bc('0x8'),_0x65bc('0x9'),'weeks',_0x65bc('0xa'),_0x65bc('0xb'),_0x65bc('0xc')),'allowNull':![],'defaultValue':_0x65bc('0xa')},'output':{'type':Sequelize['ENUM'](_0x65bc('0xd'),_0x65bc('0xe'),_0x65bc('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x65bc('0x6')](_0x65bc('0x10'),_0x65bc('0x11')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x65bc('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x65bc('0x2')]},'cc':{'type':Sequelize[_0x65bc('0x12')]},'bcc':{'type':Sequelize[_0x65bc('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x65bc('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5271=['xlsx','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','weeks','csv'];(function(_0x21ccfc,_0x48834e){var _0x279454=function(_0x12b780){while(--_0x12b780){_0x21ccfc['push'](_0x21ccfc['shift']());}};_0x279454(++_0x48834e);}(_0x5271,0x12f));var _0x1527=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x5271[_0x5a3cf0];return _0x5a64ee;};'use strict';var Sequelize=require('sequelize');module[_0x1527('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x1527('0x1')]},'active':{'type':Sequelize[_0x1527('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x1527('0x1')],'allowNull':![],'defaultValue':_0x1527('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x1527('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x1527('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x1527('0x6'),'quarters','months',_0x1527('0x7'),'days','hours','minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x1527('0x8'),'pdf',_0x1527('0x9')),'allowNull':![],'defaultValue':_0x1527('0x8')},'type':{'type':Sequelize['ENUM']('custom',_0x1527('0xa')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x1527('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x1527('0x1')]},'cc':{'type':Sequelize[_0x1527('0xb')]},'bcc':{'type':Sequelize[_0x1527('0xb')]},'sendIfEmpty':{'type':Sequelize[_0x1527('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index e094c37..976d611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a56=['bluebird','mustache','path','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','end','error','name','send','index','Schedule','rawAttributes','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x394d83,_0x35522d){var _0x411295=function(_0x3173a9){while(--_0x3173a9){_0x394d83['push'](_0x394d83['shift']());}};_0x411295(++_0x35522d);}(_0x9a56,0x134));var _0x69a5=function(_0x5cd405,_0x509baf){_0x5cd405=_0x5cd405-0x0;var _0x39ed5c=_0x9a56[_0x5cd405];return _0x39ed5c;};'use strict';var emlformat=require(_0x69a5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69a5('0x1'));var jsonpatch=require(_0x69a5('0x2'));var rp=require(_0x69a5('0x3'));var moment=require('moment');var BPromise=require(_0x69a5('0x4'));var Mustache=require(_0x69a5('0x5'));var util=require('util');var path=require(_0x69a5('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x69a5('0x7'));var crypto=require('crypto');var jsforce=require(_0x69a5('0x8'));var deskjs=require(_0x69a5('0x9'));var toCsv=require(_0x69a5('0xa'));var querystring=require(_0x69a5('0xb'));var Papa=require(_0x69a5('0xc'));var Redis=require('ioredis');var authService=require(_0x69a5('0xd'));var qs=require(_0x69a5('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69a5('0xf'));var logger=require(_0x69a5('0x10'))(_0x69a5('0x11'));var utils=require(_0x69a5('0x12'));var config=require(_0x69a5('0x13'));var licenseUtil=require(_0x69a5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42825a,_0xd91a90){_0xd91a90=_0xd91a90||0xcc;return function(_0x52936c){if(_0x52936c){return _0x42825a['sendStatus'](_0xd91a90);}return _0x42825a[_0x69a5('0x15')](_0xd91a90)['end']();};}function respondWithResult(_0x2b91f7,_0x4db1f4){_0x4db1f4=_0x4db1f4||0xc8;return function(_0x5376e2){if(_0x5376e2){return _0x2b91f7[_0x69a5('0x15')](_0x4db1f4)[_0x69a5('0x16')](_0x5376e2);}};}function respondWithFilteredResult(_0x510aa5,_0x50e02e){return function(_0x3ade57){if(_0x3ade57){var _0x194cea=typeof _0x50e02e[_0x69a5('0x17')]==='undefined'&&typeof _0x50e02e['limit']===_0x69a5('0x18');var _0xe02886=_0x3ade57['count'];var _0x4c522d=_0x194cea?0x0:_0x50e02e[_0x69a5('0x17')];var _0x498e0b=_0x194cea?_0x3ade57[_0x69a5('0x19')]:_0x50e02e[_0x69a5('0x17')]+_0x50e02e[_0x69a5('0x1a')];var _0x5618de;if(_0x498e0b>=_0xe02886){_0x498e0b=_0xe02886;_0x5618de=0xc8;}else{_0x5618de=0xce;}_0x510aa5[_0x69a5('0x15')](_0x5618de);return _0x510aa5['set']('Content-Range',_0x4c522d+'-'+_0x498e0b+'/'+_0xe02886)['json'](_0x3ade57);}return null;};}function patchUpdates(_0x2d42e3){return function(_0x26a4e7){try{jsonpatch[_0x69a5('0x1b')](_0x26a4e7,_0x2d42e3,!![]);}catch(_0x193857){return BPromise[_0x69a5('0x1c')](_0x193857);}return _0x26a4e7[_0x69a5('0x1d')]();};}function saveUpdates(_0x241257,_0x4112dd){return function(_0x212313){if(_0x212313){return _0x212313['update'](_0x241257)[_0x69a5('0x1e')](function(_0x512fcf){return _0x512fcf;});}return null;};}function removeEntity(_0x3b7e13,_0x1778e3){return function(_0x29578d){if(_0x29578d){return _0x29578d[_0x69a5('0x1f')]()[_0x69a5('0x1e')](function(){var _0x59153d=_0x29578d[_0x69a5('0x20')]({'plain':!![]});var _0x5be2c5=_0x69a5('0x21');return db[_0x69a5('0x22')]['destroy']({'where':{'type':_0x5be2c5,'resourceId':_0x59153d['id']}})['then'](function(){return _0x29578d;});})[_0x69a5('0x1e')](function(){_0x3b7e13[_0x69a5('0x15')](0xcc)[_0x69a5('0x23')]();});}};}function handleEntityNotFound(_0x1c194,_0xe1f6be){return function(_0x2475fe){if(!_0x2475fe){_0x1c194['sendStatus'](0x194);}return _0x2475fe;};}function handleError(_0x4d9c6f,_0x137208){_0x137208=_0x137208||0x1f4;return function(_0x47f3d5){logger[_0x69a5('0x24')](_0x47f3d5['stack']);if(_0x47f3d5[_0x69a5('0x25')]){delete _0x47f3d5[_0x69a5('0x25')];}_0x4d9c6f[_0x69a5('0x15')](_0x137208)[_0x69a5('0x26')](_0x47f3d5);};}exports[_0x69a5('0x27')]=function(_0x5b1602,_0x49664f){var _0x5d6153={},_0x253d26={},_0x461d7b={'count':0x0,'rows':[]};var _0x2651ee=_['map'](db[_0x69a5('0x28')][_0x69a5('0x29')],function(_0x1f88dc){return{'name':_0x1f88dc['fieldName'],'type':_0x1f88dc[_0x69a5('0x2a')][_0x69a5('0x2b')]};});_0x253d26[_0x69a5('0x2c')]=_[_0x69a5('0x2d')](_0x2651ee,_0x69a5('0x25'));_0x253d26[_0x69a5('0x2e')]=_[_0x69a5('0x2f')](_0x5b1602[_0x69a5('0x2e')]);_0x253d26['filters']=_['intersection'](_0x253d26[_0x69a5('0x2c')],_0x253d26[_0x69a5('0x2e')]);_0x5d6153[_0x69a5('0x30')]=_['intersection'](_0x253d26[_0x69a5('0x2c')],qs[_0x69a5('0x31')](_0x5b1602[_0x69a5('0x2e')]['fields']));_0x5d6153[_0x69a5('0x30')]=_0x5d6153['attributes'][_0x69a5('0x32')]?_0x5d6153[_0x69a5('0x30')]:_0x253d26[_0x69a5('0x2c')];if(!_0x5b1602[_0x69a5('0x2e')][_0x69a5('0x33')](_0x69a5('0x34'))){_0x5d6153[_0x69a5('0x1a')]=qs[_0x69a5('0x1a')](_0x5b1602[_0x69a5('0x2e')]['limit']);_0x5d6153[_0x69a5('0x17')]=qs[_0x69a5('0x17')](_0x5b1602[_0x69a5('0x2e')][_0x69a5('0x17')]);}_0x5d6153[_0x69a5('0x35')]=qs[_0x69a5('0x36')](_0x5b1602[_0x69a5('0x2e')][_0x69a5('0x36')]);_0x5d6153[_0x69a5('0x37')]=qs[_0x69a5('0x38')](_['pick'](_0x5b1602[_0x69a5('0x2e')],_0x253d26[_0x69a5('0x38')]),_0x2651ee);if(_0x5b1602[_0x69a5('0x2e')][_0x69a5('0x39')]){_0x5d6153[_0x69a5('0x37')]=_[_0x69a5('0x3a')](_0x5d6153[_0x69a5('0x37')],{'$or':_['map'](_0x2651ee,function(_0x2b229b){if(_0x2b229b[_0x69a5('0x2a')]!=='VIRTUAL'){var _0x40067c={};_0x40067c[_0x2b229b[_0x69a5('0x25')]]={'$like':'%'+_0x5b1602[_0x69a5('0x2e')][_0x69a5('0x39')]+'%'};return _0x40067c;}})});}_0x5d6153=_[_0x69a5('0x3a')]({},_0x5d6153,_0x5b1602[_0x69a5('0x3b')]);var _0xc6df4f={'where':_0x5d6153[_0x69a5('0x37')]};return db[_0x69a5('0x28')][_0x69a5('0x19')](_0xc6df4f)['then'](function(_0x17cc70){_0x461d7b[_0x69a5('0x19')]=_0x17cc70;if(_0x5b1602[_0x69a5('0x2e')][_0x69a5('0x3c')]){_0x5d6153[_0x69a5('0x3d')]=[{'all':!![]}];}return db[_0x69a5('0x28')][_0x69a5('0x3e')](_0x5d6153);})[_0x69a5('0x1e')](function(_0x400516){_0x461d7b[_0x69a5('0x3f')]=_0x400516;return _0x461d7b;})[_0x69a5('0x1e')](respondWithFilteredResult(_0x49664f,_0x5d6153))[_0x69a5('0x40')](handleError(_0x49664f,null));};exports['show']=function(_0x17cac0,_0x59d094){var _0x1e4b93={'raw':![],'where':{'id':_0x17cac0[_0x69a5('0x41')]['id']}},_0x5ae287={};_0x5ae287['model']=_['keys'](db[_0x69a5('0x28')]['rawAttributes']);_0x5ae287['query']=_[_0x69a5('0x2f')](_0x17cac0[_0x69a5('0x2e')]);_0x5ae287[_0x69a5('0x38')]=_[_0x69a5('0x42')](_0x5ae287[_0x69a5('0x2c')],_0x5ae287[_0x69a5('0x2e')]);_0x1e4b93[_0x69a5('0x30')]=_[_0x69a5('0x42')](_0x5ae287[_0x69a5('0x2c')],qs[_0x69a5('0x31')](_0x17cac0['query'][_0x69a5('0x31')]));_0x1e4b93['attributes']=_0x1e4b93['attributes'][_0x69a5('0x32')]?_0x1e4b93[_0x69a5('0x30')]:_0x5ae287[_0x69a5('0x2c')];if(_0x17cac0['query'][_0x69a5('0x3c')]){_0x1e4b93[_0x69a5('0x3d')]=[{'all':!![]}];}_0x1e4b93=_[_0x69a5('0x3a')]({},_0x1e4b93,_0x17cac0[_0x69a5('0x3b')]);return db[_0x69a5('0x28')][_0x69a5('0x43')](_0x1e4b93)[_0x69a5('0x1e')](handleEntityNotFound(_0x59d094,null))[_0x69a5('0x1e')](respondWithResult(_0x59d094,null))[_0x69a5('0x40')](handleError(_0x59d094,null));};exports[_0x69a5('0x44')]=function(_0x2bc35b,_0x2507a2){return db[_0x69a5('0x28')][_0x69a5('0x44')](_0x2bc35b[_0x69a5('0x45')],{})[_0x69a5('0x1e')](function(_0x129a8b){var _0x152b9e=_0x2bc35b[_0x69a5('0x46')]['get']({'plain':!![]});if(!_0x152b9e)throw new Error(_0x69a5('0x47'));if(_0x152b9e[_0x69a5('0x48')]===_0x69a5('0x46')){var _0x44d98c=_0x129a8b[_0x69a5('0x20')]({'plain':!![]});var _0x5b6ddf=_0x69a5('0x21');return db[_0x69a5('0x49')][_0x69a5('0x43')]({'where':{'name':_0x5b6ddf,'userProfileId':_0x152b9e['userProfileId']},'raw':!![]})[_0x69a5('0x1e')](function(_0x52aaa5){if(_0x52aaa5&&_0x52aaa5[_0x69a5('0x4a')]===0x0){return db[_0x69a5('0x22')]['create']({'name':_0x44d98c['name'],'resourceId':_0x44d98c['id'],'type':_0x52aaa5[_0x69a5('0x25')],'sectionId':_0x52aaa5['id']},{})[_0x69a5('0x1e')](function(){return _0x129a8b;});}else{return _0x129a8b;}})['catch'](function(_0x381452){logger[_0x69a5('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x381452);throw _0x381452;});}return _0x129a8b;})[_0x69a5('0x1e')](respondWithResult(_0x2507a2,0xc9))[_0x69a5('0x40')](handleError(_0x2507a2,null));};exports[_0x69a5('0x4b')]=function(_0xea8f6c,_0x1c12d6){if(_0xea8f6c['body']['id']){delete _0xea8f6c[_0x69a5('0x45')]['id'];}return db[_0x69a5('0x28')][_0x69a5('0x43')]({'where':{'id':_0xea8f6c[_0x69a5('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c12d6,null))['then'](saveUpdates(_0xea8f6c[_0x69a5('0x45')],null))[_0x69a5('0x1e')](respondWithResult(_0x1c12d6,null))[_0x69a5('0x40')](handleError(_0x1c12d6,null));};exports[_0x69a5('0x1f')]=function(_0x528f56,_0x48951c){return db[_0x69a5('0x28')][_0x69a5('0x43')]({'where':{'id':_0x528f56[_0x69a5('0x41')]['id']}})[_0x69a5('0x1e')](handleEntityNotFound(_0x48951c,null))[_0x69a5('0x1e')](removeEntity(_0x48951c,null))[_0x69a5('0x40')](handleError(_0x48951c,null));};exports[_0x69a5('0x4c')]=function(_0x1e9f07,_0x4462cf,_0x1e452a){var _0x273f69=require(_0x69a5('0x4d'));return db[_0x69a5('0x28')][_0x69a5('0x43')]({'where':{'id':_0x1e9f07[_0x69a5('0x41')]['id']},'raw':!![]})[_0x69a5('0x1e')](handleEntityNotFound(_0x4462cf,null))['then'](function(){_0x273f69[_0x69a5('0x4c')](_0x1e9f07[_0x69a5('0x41')]['id']);})[_0x69a5('0x1e')](respondWithStatusCode(_0x4462cf,null))[_0x69a5('0x40')](handleError(_0x4462cf,null));};
\ No newline at end of file
+var _0x6d71=['get','Scheduler','UserProfileResource','error','stack','name','index','map','Schedule','fieldName','type','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','length','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','../../config/schedule','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x6d71,0x1d5));var _0x16d7=function(_0x2ee2ae,_0x184f85){_0x2ee2ae=_0x2ee2ae-0x0;var _0x5dc51d=_0x6d71[_0x2ee2ae];return _0x5dc51d;};'use strict';var emlformat=require(_0x16d7('0x0'));var rimraf=require(_0x16d7('0x1'));var zipdir=require(_0x16d7('0x2'));var jsonpatch=require(_0x16d7('0x3'));var rp=require(_0x16d7('0x4'));var moment=require(_0x16d7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x16d7('0x6'));var path=require('path');var sox=require(_0x16d7('0x7'));var csv=require('to-csv');var ejs=require(_0x16d7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16d7('0x9'));var squel=require(_0x16d7('0xa'));var crypto=require(_0x16d7('0xb'));var jsforce=require(_0x16d7('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d7('0xd'));var Papa=require(_0x16d7('0xe'));var Redis=require(_0x16d7('0xf'));var authService=require(_0x16d7('0x10'));var qs=require(_0x16d7('0x11'));var as=require(_0x16d7('0x12'));var hardwareService=require(_0x16d7('0x13'));var logger=require(_0x16d7('0x14'))(_0x16d7('0x15'));var utils=require(_0x16d7('0x16'));var config=require(_0x16d7('0x17'));var licenseUtil=require(_0x16d7('0x18'));var db=require(_0x16d7('0x19'))['db'];function respondWithStatusCode(_0x49bbc4,_0x3d5b57){_0x3d5b57=_0x3d5b57||0xcc;return function(_0x1cd540){if(_0x1cd540){return _0x49bbc4[_0x16d7('0x1a')](_0x3d5b57);}return _0x49bbc4['status'](_0x3d5b57)[_0x16d7('0x1b')]();};}function respondWithResult(_0x15be68,_0x49166b){_0x49166b=_0x49166b||0xc8;return function(_0xecfe45){if(_0xecfe45){return _0x15be68[_0x16d7('0x1c')](_0x49166b)[_0x16d7('0x1d')](_0xecfe45);}};}function respondWithFilteredResult(_0x798c9a,_0x349593){return function(_0x3992e8){if(_0x3992e8){var _0x4c65a8=typeof _0x349593[_0x16d7('0x1e')]===_0x16d7('0x1f')&&typeof _0x349593['limit']==='undefined';var _0x66944=_0x3992e8['count'];var _0x8c9b13=_0x4c65a8?0x0:_0x349593[_0x16d7('0x1e')];var _0x19f458=_0x4c65a8?_0x3992e8[_0x16d7('0x20')]:_0x349593[_0x16d7('0x1e')]+_0x349593[_0x16d7('0x21')];var _0x2e6a49;if(_0x19f458>=_0x66944){_0x19f458=_0x66944;_0x2e6a49=0xc8;}else{_0x2e6a49=0xce;}_0x798c9a[_0x16d7('0x1c')](_0x2e6a49);return _0x798c9a[_0x16d7('0x22')](_0x16d7('0x23'),_0x8c9b13+'-'+_0x19f458+'/'+_0x66944)['json'](_0x3992e8);}return null;};}function patchUpdates(_0x28cd47){return function(_0x331ff1){try{jsonpatch[_0x16d7('0x24')](_0x331ff1,_0x28cd47,!![]);}catch(_0x3b197d){return BPromise['reject'](_0x3b197d);}return _0x331ff1[_0x16d7('0x25')]();};}function saveUpdates(_0x488da7,_0x390004){return function(_0x4e9cb){if(_0x4e9cb){return _0x4e9cb[_0x16d7('0x26')](_0x488da7)[_0x16d7('0x27')](function(_0x256ca2){return _0x256ca2;});}return null;};}function removeEntity(_0x5625aa,_0x168511){return function(_0x53e01f){if(_0x53e01f){return _0x53e01f[_0x16d7('0x28')]()[_0x16d7('0x27')](function(){var _0x5c2d54=_0x53e01f[_0x16d7('0x29')]({'plain':!![]});var _0x3de426=_0x16d7('0x2a');return db[_0x16d7('0x2b')][_0x16d7('0x28')]({'where':{'type':_0x3de426,'resourceId':_0x5c2d54['id']}})['then'](function(){return _0x53e01f;});})[_0x16d7('0x27')](function(){_0x5625aa[_0x16d7('0x1c')](0xcc)[_0x16d7('0x1b')]();});}};}function handleEntityNotFound(_0x2f66a1,_0x241c61){return function(_0x2d079d){if(!_0x2d079d){_0x2f66a1[_0x16d7('0x1a')](0x194);}return _0x2d079d;};}function handleError(_0x48dfff,_0x20ea27){_0x20ea27=_0x20ea27||0x1f4;return function(_0x4576fd){logger[_0x16d7('0x2c')](_0x4576fd[_0x16d7('0x2d')]);if(_0x4576fd[_0x16d7('0x2e')]){delete _0x4576fd[_0x16d7('0x2e')];}_0x48dfff['status'](_0x20ea27)['send'](_0x4576fd);};}exports[_0x16d7('0x2f')]=function(_0x46ce9c,_0x1362bf){var _0x5a6920={},_0x355e86={},_0x24e090={'count':0x0,'rows':[]};var _0x4f903e=_[_0x16d7('0x30')](db[_0x16d7('0x31')]['rawAttributes'],function(_0x11355d){return{'name':_0x11355d[_0x16d7('0x32')],'type':_0x11355d[_0x16d7('0x33')]['key']};});_0x355e86[_0x16d7('0x34')]=_[_0x16d7('0x30')](_0x4f903e,_0x16d7('0x2e'));_0x355e86['query']=_[_0x16d7('0x35')](_0x46ce9c[_0x16d7('0x36')]);_0x355e86['filters']=_[_0x16d7('0x37')](_0x355e86[_0x16d7('0x34')],_0x355e86[_0x16d7('0x36')]);_0x5a6920[_0x16d7('0x38')]=_[_0x16d7('0x37')](_0x355e86[_0x16d7('0x34')],qs['fields'](_0x46ce9c[_0x16d7('0x36')][_0x16d7('0x39')]));_0x5a6920['attributes']=_0x5a6920[_0x16d7('0x38')]['length']?_0x5a6920[_0x16d7('0x38')]:_0x355e86[_0x16d7('0x34')];if(!_0x46ce9c[_0x16d7('0x36')][_0x16d7('0x3a')]('nolimit')){_0x5a6920[_0x16d7('0x21')]=qs[_0x16d7('0x21')](_0x46ce9c[_0x16d7('0x36')]['limit']);_0x5a6920[_0x16d7('0x1e')]=qs['offset'](_0x46ce9c[_0x16d7('0x36')][_0x16d7('0x1e')]);}_0x5a6920[_0x16d7('0x3b')]=qs[_0x16d7('0x3c')](_0x46ce9c[_0x16d7('0x36')][_0x16d7('0x3c')]);_0x5a6920[_0x16d7('0x3d')]=qs['filters'](_[_0x16d7('0x3e')](_0x46ce9c[_0x16d7('0x36')],_0x355e86[_0x16d7('0x3f')]),_0x4f903e);if(_0x46ce9c[_0x16d7('0x36')][_0x16d7('0x40')]){_0x5a6920['where']=_['merge'](_0x5a6920[_0x16d7('0x3d')],{'$or':_['map'](_0x4f903e,function(_0x4dcaf0){if(_0x4dcaf0[_0x16d7('0x33')]!==_0x16d7('0x41')){var _0x1f3b70={};_0x1f3b70[_0x4dcaf0['name']]={'$like':'%'+_0x46ce9c['query']['filter']+'%'};return _0x1f3b70;}})});}_0x5a6920=_['merge']({},_0x5a6920,_0x46ce9c[_0x16d7('0x42')]);var _0x397c42={'where':_0x5a6920[_0x16d7('0x3d')]};return db[_0x16d7('0x31')][_0x16d7('0x20')](_0x397c42)['then'](function(_0x2244fe){_0x24e090[_0x16d7('0x20')]=_0x2244fe;if(_0x46ce9c[_0x16d7('0x36')][_0x16d7('0x43')]){_0x5a6920[_0x16d7('0x44')]=[{'all':!![]}];}return db[_0x16d7('0x31')]['findAll'](_0x5a6920);})[_0x16d7('0x27')](function(_0x56606a){_0x24e090['rows']=_0x56606a;return _0x24e090;})[_0x16d7('0x27')](respondWithFilteredResult(_0x1362bf,_0x5a6920))[_0x16d7('0x45')](handleError(_0x1362bf,null));};exports[_0x16d7('0x46')]=function(_0xbffbac,_0x3aebc6){var _0x34450d={'raw':![],'where':{'id':_0xbffbac[_0x16d7('0x47')]['id']}},_0x2781ea={};_0x2781ea['model']=_[_0x16d7('0x35')](db[_0x16d7('0x31')][_0x16d7('0x48')]);_0x2781ea[_0x16d7('0x36')]=_[_0x16d7('0x35')](_0xbffbac[_0x16d7('0x36')]);_0x2781ea[_0x16d7('0x3f')]=_['intersection'](_0x2781ea[_0x16d7('0x34')],_0x2781ea[_0x16d7('0x36')]);_0x34450d['attributes']=_[_0x16d7('0x37')](_0x2781ea['model'],qs[_0x16d7('0x39')](_0xbffbac[_0x16d7('0x36')][_0x16d7('0x39')]));_0x34450d['attributes']=_0x34450d[_0x16d7('0x38')][_0x16d7('0x49')]?_0x34450d[_0x16d7('0x38')]:_0x2781ea[_0x16d7('0x34')];if(_0xbffbac[_0x16d7('0x36')][_0x16d7('0x43')]){_0x34450d[_0x16d7('0x44')]=[{'all':!![]}];}_0x34450d=_[_0x16d7('0x4a')]({},_0x34450d,_0xbffbac[_0x16d7('0x42')]);return db[_0x16d7('0x31')][_0x16d7('0x4b')](_0x34450d)[_0x16d7('0x27')](handleEntityNotFound(_0x3aebc6,null))['then'](respondWithResult(_0x3aebc6,null))[_0x16d7('0x45')](handleError(_0x3aebc6,null));};exports[_0x16d7('0x4c')]=function(_0x2126bc,_0x1a970d){return db[_0x16d7('0x31')][_0x16d7('0x4c')](_0x2126bc['body'],{})['then'](function(_0x1477c8){var _0x134a78=_0x2126bc[_0x16d7('0x4d')][_0x16d7('0x29')]({'plain':!![]});if(!_0x134a78)throw new Error(_0x16d7('0x4e'));if(_0x134a78[_0x16d7('0x4f')]===_0x16d7('0x4d')){var _0x824bbd=_0x1477c8['get']({'plain':!![]});var _0x329bab=_0x16d7('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x329bab,'userProfileId':_0x134a78[_0x16d7('0x50')]},'raw':!![]})[_0x16d7('0x27')](function(_0x229af1){if(_0x229af1&&_0x229af1['autoAssociation']===0x0){return db[_0x16d7('0x2b')][_0x16d7('0x4c')]({'name':_0x824bbd[_0x16d7('0x2e')],'resourceId':_0x824bbd['id'],'type':_0x229af1[_0x16d7('0x2e')],'sectionId':_0x229af1['id']},{})['then'](function(){return _0x1477c8;});}else{return _0x1477c8;}})[_0x16d7('0x45')](function(_0x3ef81d){logger['error'](_0x16d7('0x51'),_0x3ef81d);throw _0x3ef81d;});}return _0x1477c8;})[_0x16d7('0x27')](respondWithResult(_0x1a970d,0xc9))[_0x16d7('0x45')](handleError(_0x1a970d,null));};exports[_0x16d7('0x26')]=function(_0x1d97d3,_0x1a9a0d){if(_0x1d97d3[_0x16d7('0x52')]['id']){delete _0x1d97d3['body']['id'];}return db[_0x16d7('0x31')][_0x16d7('0x4b')]({'where':{'id':_0x1d97d3[_0x16d7('0x47')]['id']}})[_0x16d7('0x27')](handleEntityNotFound(_0x1a9a0d,null))[_0x16d7('0x27')](saveUpdates(_0x1d97d3[_0x16d7('0x52')],null))[_0x16d7('0x27')](respondWithResult(_0x1a9a0d,null))[_0x16d7('0x45')](handleError(_0x1a9a0d,null));};exports['destroy']=function(_0xd647c6,_0x4fbfd7){return db[_0x16d7('0x31')][_0x16d7('0x4b')]({'where':{'id':_0xd647c6[_0x16d7('0x47')]['id']}})[_0x16d7('0x27')](handleEntityNotFound(_0x4fbfd7,null))[_0x16d7('0x27')](removeEntity(_0x4fbfd7,null))[_0x16d7('0x45')](handleError(_0x4fbfd7,null));};exports['run']=function(_0x53c534,_0x1afa5f,_0x31c58a){var _0x453067=require(_0x16d7('0x53'));return db[_0x16d7('0x31')][_0x16d7('0x4b')]({'where':{'id':_0x53c534[_0x16d7('0x47')]['id']},'raw':!![]})[_0x16d7('0x27')](handleEntityNotFound(_0x1afa5f,null))[_0x16d7('0x27')](function(){_0x453067[_0x16d7('0x54')](_0x53c534[_0x16d7('0x47')]['id']);})[_0x16d7('0x27')](respondWithStatusCode(_0x1afa5f,null))[_0x16d7('0x45')](handleError(_0x1afa5f,null));};
\ No newline at end of file
index 0ce50e6..8bb681c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed0d=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','tools_schedules'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0xed0d,0x75));var _0xded0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xed0d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xded0('0x0'));var util=require(_0xded0('0x1'));var logger=require(_0xded0('0x2'))(_0xded0('0x3'));var moment=require(_0xded0('0x4'));var BPromise=require(_0xded0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xded0('0x6'));var rimraf=require(_0xded0('0x7'));var config=require(_0xded0('0x8'));var attributes=require(_0xded0('0x9'));module['exports']=function(_0xf1f295,_0x290f13){return _0xf1f295[_0xded0('0xa')](_0xded0('0xb'),attributes,{'tableName':_0xded0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xca5c=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x552005,_0x4c1398){var _0x22d800=function(_0x39ba04){while(--_0x39ba04){_0x552005['push'](_0x552005['shift']());}};_0x22d800(++_0x4c1398);}(_0xca5c,0xda));var _0xcca5=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0xca5c[_0x299784];return _0x5ab008;};'use strict';var _=require(_0xcca5('0x0'));var util=require(_0xcca5('0x1'));var logger=require(_0xcca5('0x2'))(_0xcca5('0x3'));var moment=require(_0xcca5('0x4'));var BPromise=require(_0xcca5('0x5'));var rp=require(_0xcca5('0x6'));var fs=require('fs');var path=require(_0xcca5('0x7'));var rimraf=require(_0xcca5('0x8'));var config=require(_0xcca5('0x9'));var attributes=require(_0xcca5('0xa'));module[_0xcca5('0xb')]=function(_0x2c5017,_0x149413){return _0x2c5017[_0xcca5('0xc')](_0xcca5('0xd'),attributes,{'tableName':_0xcca5('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0927245..23c52ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcd3=['info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','then'];(function(_0x434e6a,_0x21339b){var _0x154b69=function(_0xe36402){while(--_0xe36402){_0x434e6a['push'](_0x434e6a['shift']());}};_0x154b69(++_0x21339b);}(_0xdcd3,0x15e));var _0x3dcd=function(_0x1d717f,_0x45d90d){_0x1d717f=_0x1d717f-0x0;var _0x578f33=_0xdcd3[_0x1d717f];return _0x578f33;};'use strict';var _=require(_0x3dcd('0x0'));var util=require(_0x3dcd('0x1'));var moment=require('moment');var BPromise=require(_0x3dcd('0x2'));var rs=require(_0x3dcd('0x3'));var fs=require('fs');var Redis=require(_0x3dcd('0x4'));var db=require(_0x3dcd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3dcd('0x6'))(_0x3dcd('0x7'));var config=require(_0x3dcd('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2be1da,_0x1a58f3,_0x31ebd4){return new BPromise(function(_0x42b4fa,_0x2ecc40){return client['request'](_0x2be1da,_0x31ebd4)[_0x3dcd('0x9')](function(_0x18c939){logger[_0x3dcd('0xa')](_0x3dcd('0xb'),_0x1a58f3,_0x3dcd('0xc'));logger[_0x3dcd('0xd')](_0x3dcd('0xe'),_0x1a58f3,'request\x20sent',JSON['stringify'](_0x18c939));if(_0x18c939[_0x3dcd('0xf')]){if(_0x18c939['error'][_0x3dcd('0x10')]===0x1f4){logger[_0x3dcd('0xf')]('Schedule,\x20%s,\x20%s',_0x1a58f3,_0x18c939[_0x3dcd('0xf')]['message']);return _0x2ecc40(_0x18c939[_0x3dcd('0xf')][_0x3dcd('0x11')]);}logger[_0x3dcd('0xf')](_0x3dcd('0xb'),_0x1a58f3,_0x18c939[_0x3dcd('0xf')][_0x3dcd('0x11')]);return _0x42b4fa(_0x18c939[_0x3dcd('0xf')][_0x3dcd('0x11')]);}else{logger[_0x3dcd('0xa')](_0x3dcd('0xb'),_0x1a58f3,_0x3dcd('0xc'));_0x42b4fa(_0x18c939[_0x3dcd('0x12')]['message']);}})[_0x3dcd('0x13')](function(_0x42107d){logger[_0x3dcd('0xf')](_0x3dcd('0xb'),_0x1a58f3,_0x42107d);_0x2ecc40(_0x42107d);});});}
\ No newline at end of file
+var _0x6cbc=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','error','Schedule,\x20%s,\x20%s'];(function(_0x15a4fd,_0x4538b4){var _0x2e1e01=function(_0x3a526a){while(--_0x3a526a){_0x15a4fd['push'](_0x15a4fd['shift']());}};_0x2e1e01(++_0x4538b4);}(_0x6cbc,0x193));var _0xc6cb=function(_0x1eb98b,_0x37e356){_0x1eb98b=_0x1eb98b-0x0;var _0x40b4b4=_0x6cbc[_0x1eb98b];return _0x40b4b4;};'use strict';var _=require(_0xc6cb('0x0'));var util=require(_0xc6cb('0x1'));var moment=require(_0xc6cb('0x2'));var BPromise=require('bluebird');var rs=require(_0xc6cb('0x3'));var fs=require('fs');var Redis=require(_0xc6cb('0x4'));var db=require(_0xc6cb('0x5'))['db'];var utils=require(_0xc6cb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc6cb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc6cb('0x8')][_0xc6cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51c3a9,_0x486843,_0x2c9f61){return new BPromise(function(_0xaa8ae,_0x19b5f8){return client[_0xc6cb('0xa')](_0x51c3a9,_0x2c9f61)[_0xc6cb('0xb')](function(_0xe8045f){logger['info']('Schedule,\x20%s,\x20%s',_0x486843,_0xc6cb('0xc'));logger[_0xc6cb('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x486843,_0xc6cb('0xc'),JSON[_0xc6cb('0xe')](_0xe8045f));if(_0xe8045f[_0xc6cb('0xf')]){if(_0xe8045f[_0xc6cb('0xf')]['code']===0x1f4){logger[_0xc6cb('0xf')](_0xc6cb('0x10'),_0x486843,_0xe8045f[_0xc6cb('0xf')][_0xc6cb('0x11')]);return _0x19b5f8(_0xe8045f[_0xc6cb('0xf')][_0xc6cb('0x11')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x486843,_0xe8045f[_0xc6cb('0xf')][_0xc6cb('0x11')]);return _0xaa8ae(_0xe8045f[_0xc6cb('0xf')][_0xc6cb('0x11')]);}else{logger['info'](_0xc6cb('0x10'),_0x486843,_0xc6cb('0xc'));_0xaa8ae(_0xe8045f[_0xc6cb('0x12')][_0xc6cb('0x11')]);}})[_0xc6cb('0x13')](function(_0x1cfe68){logger['error'](_0xc6cb('0x10'),_0x486843,_0x1cfe68);_0x19b5f8(_0x1cfe68);});});}
\ No newline at end of file
index 7c7c64a..161ab2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc1=['isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x301652,_0x1adc45){var _0x3d38b6=function(_0x38fc37){while(--_0x38fc37){_0x301652['push'](_0x301652['shift']());}};_0x3d38b6(++_0x1adc45);}(_0xafc1,0xae));var _0x1afc=function(_0x5efa1b,_0x21dba7){_0x5efa1b=_0x5efa1b-0x0;var _0x373d7a=_0xafc1[_0x5efa1b];return _0x373d7a;};'use strict';var multer=require(_0x1afc('0x0'));var util=require('util');var path=require(_0x1afc('0x1'));var timeout=require(_0x1afc('0x2'));var express=require(_0x1afc('0x3'));var router=express[_0x1afc('0x4')]();var fs_extra=require(_0x1afc('0x5'));var auth=require(_0x1afc('0x6'));var interaction=require(_0x1afc('0x7'));var config=require(_0x1afc('0x8'));var controller=require('./screenRecording.controller');router[_0x1afc('0x9')]('/',auth[_0x1afc('0xa')](),controller[_0x1afc('0xb')]);router[_0x1afc('0x9')](_0x1afc('0xc'),auth[_0x1afc('0xa')](),controller[_0x1afc('0xd')]);router[_0x1afc('0x9')](_0x1afc('0xe'),auth[_0x1afc('0xa')](),controller[_0x1afc('0xf')]);router[_0x1afc('0x9')](_0x1afc('0x10'),auth[_0x1afc('0xa')](),controller[_0x1afc('0x11')]);router[_0x1afc('0x12')]('/',auth[_0x1afc('0xa')](),controller['create']);router[_0x1afc('0x13')](_0x1afc('0xe'),auth[_0x1afc('0xa')](),controller['update']);router[_0x1afc('0x14')](_0x1afc('0xe'),auth[_0x1afc('0xa')](),controller[_0x1afc('0x15')]);module[_0x1afc('0x16')]=router;
\ No newline at end of file
+var _0x2724=['./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','download','post','create','put','update','delete','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0x2724,0x189));var _0x4272=function(_0x6dbb4d,_0x2325c1){_0x6dbb4d=_0x6dbb4d-0x0;var _0x335b16=_0x2724[_0x6dbb4d];return _0x335b16;};'use strict';var multer=require(_0x4272('0x0'));var util=require('util');var path=require(_0x4272('0x1'));var timeout=require(_0x4272('0x2'));var express=require(_0x4272('0x3'));var router=express[_0x4272('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4272('0x5'));var config=require('../../config/environment');var controller=require(_0x4272('0x6'));router[_0x4272('0x7')]('/',auth[_0x4272('0x8')](),controller['index']);router[_0x4272('0x7')](_0x4272('0x9'),auth[_0x4272('0x8')](),controller[_0x4272('0xa')]);router[_0x4272('0x7')](_0x4272('0xb'),auth[_0x4272('0x8')](),controller[_0x4272('0xc')]);router['get']('/:id/download',auth[_0x4272('0x8')](),controller[_0x4272('0xd')]);router[_0x4272('0xe')]('/',auth[_0x4272('0x8')](),controller[_0x4272('0xf')]);router[_0x4272('0x10')]('/:id',auth[_0x4272('0x8')](),controller[_0x4272('0x11')]);router[_0x4272('0x12')](_0x4272('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index aedfc4e..fb656d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a07=['DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration'];(function(_0x4e8c32,_0x2e170e){var _0x5e35e1=function(_0x305685){while(--_0x305685){_0x4e8c32['push'](_0x4e8c32['shift']());}};_0x5e35e1(++_0x2e170e);}(_0x2a07,0x74));var _0x72a0=function(_0x2610db,_0x454344){_0x2610db=_0x2610db-0x0;var _0x5d4d96=_0x2a07[_0x2610db];return _0x5d4d96;};'use strict';var Sequelize=require(_0x72a0('0x0'));var moment=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var config=require(_0x72a0('0x3'));module[_0x72a0('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x72a0('0x5')](_0x72a0('0x6'))?path[_0x72a0('0x7')](this[_0x72a0('0x5')](_0x72a0('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x72a0('0x8')]},'channel':{'type':Sequelize[_0x72a0('0x8')]},'value':{'type':Sequelize[_0x72a0('0x8')],'set':function(_0x193e3b){var _0x287b06=_0x193e3b[_0x72a0('0x9')](/\\/g,'/');this[_0x72a0('0xa')](_0x72a0('0x6'),_0x287b06);}},'rating':{'type':Sequelize[_0x72a0('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x72a0('0xb')],'set':function(_0x2bc45b){this['setDataValue'](_0x72a0('0xc'),moment()[_0x72a0('0xd')](_0x2bc45b,'ms'));this['setDataValue'](_0x72a0('0xe'),moment());this[_0x72a0('0xa')](_0x72a0('0xf'),_0x2bc45b);}},'startedAt':{'type':Sequelize[_0x72a0('0x10')],'get':function(){return moment(this[_0x72a0('0x5')]('startedAt'))[_0x72a0('0x11')](_0x72a0('0x12'))[_0x72a0('0x13')]();}},'closedAt':{'type':Sequelize[_0x72a0('0x10')],'get':function(){return moment(this[_0x72a0('0x5')](_0x72a0('0xe')))[_0x72a0('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0x72a0('0x10')],'get':function(){return moment(this[_0x72a0('0x5')](_0x72a0('0x14')))[_0x72a0('0x11')](_0x72a0('0x12'))[_0x72a0('0x13')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x72a0('0x5')](_0x72a0('0x15')))[_0x72a0('0x11')](_0x72a0('0x12'))[_0x72a0('0x13')]();}}};
\ No newline at end of file
+var _0xa1c5=['DATE','format','MM-DD-YYYY\x20HH:mm','createdAt','toString','updatedAt','sequelize','moment','path','VIRTUAL','getDataValue','value','STRING','replace','INTEGER','setDataValue','subtract','closedAt'];(function(_0x3f7480,_0x3b4000){var _0x697e48=function(_0x10b448){while(--_0x10b448){_0x3f7480['push'](_0x3f7480['shift']());}};_0x697e48(++_0x3b4000);}(_0xa1c5,0x96));var _0x5a1c=function(_0x10e246,_0x2a6a63){_0x10e246=_0x10e246-0x0;var _0x42f015=_0xa1c5[_0x10e246];return _0x42f015;};'use strict';var Sequelize=require(_0x5a1c('0x0'));var moment=require(_0x5a1c('0x1'));var path=require(_0x5a1c('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x5a1c('0x3')],'get':function(){return this[_0x5a1c('0x4')](_0x5a1c('0x5'))?path['extname'](this[_0x5a1c('0x4')](_0x5a1c('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x5a1c('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x5a1c('0x6')],'set':function(_0x471644){var _0x5a77f6=_0x471644[_0x5a1c('0x7')](/\\/g,'/');this['setDataValue'](_0x5a1c('0x5'),_0x5a77f6);}},'rating':{'type':Sequelize[_0x5a1c('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5a1c('0x8')],'set':function(_0x2214b7){this[_0x5a1c('0x9')]('startedAt',moment()[_0x5a1c('0xa')](_0x2214b7,'ms'));this['setDataValue'](_0x5a1c('0xb'),moment());this[_0x5a1c('0x9')]('duration',_0x2214b7);}},'startedAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')]('startedAt'))[_0x5a1c('0xd')](_0x5a1c('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')]('closedAt'))['format'](_0x5a1c('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')](_0x5a1c('0xf')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5a1c('0x10')]();}},'updatedAt':{'type':Sequelize[_0x5a1c('0xc')],'get':function(){return moment(this[_0x5a1c('0x4')](_0x5a1c('0x11')))[_0x5a1c('0xd')]('MM-DD-YYYY\x20HH:mm')[_0x5a1c('0x10')]();}}};
\ No newline at end of file
index b0b8e3d..62b8483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd50=['unlinkSync','.cypher','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','update','duration','value','describe','../../components/encryptor','uniqueid','join','root','%s.cypher','existsSync','decryptFile','recording','server/files/screen_recordings','ValidationError','filename','extname','download','unlink','message','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x1c682e,_0x36456c){var _0x5c8512=function(_0x41cf4c){while(--_0x41cf4c){_0x1c682e['push'](_0x1c682e['shift']());}};_0x5c8512(++_0x36456c);}(_0xbd50,0x196));var _0x0bd5=function(_0x58482c,_0x10c672){_0x58482c=_0x58482c-0x0;var _0x449f6c=_0xbd50[_0x58482c];return _0x449f6c;};'use strict';var emlformat=require(_0x0bd5('0x0'));var rimraf=require(_0x0bd5('0x1'));var zipdir=require(_0x0bd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd5('0x3'));var moment=require(_0x0bd5('0x4'));var BPromise=require(_0x0bd5('0x5'));var Mustache=require(_0x0bd5('0x6'));var util=require(_0x0bd5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0bd5('0x8'));var fs=require('fs');var fs_extra=require(_0x0bd5('0x9'));var _=require(_0x0bd5('0xa'));var squel=require(_0x0bd5('0xb'));var crypto=require(_0x0bd5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0bd5('0xd'));var querystring=require(_0x0bd5('0xe'));var Papa=require(_0x0bd5('0xf'));var Redis=require('ioredis');var authService=require(_0x0bd5('0x10'));var qs=require(_0x0bd5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd5('0x12'));var logger=require(_0x0bd5('0x13'))('api');var utils=require(_0x0bd5('0x14'));var config=require(_0x0bd5('0x15'));var licenseUtil=require(_0x0bd5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f7a0c,_0x23982f){_0x23982f=_0x23982f||0xcc;return function(_0x2f9588){if(_0x2f9588){return _0x2f7a0c[_0x0bd5('0x17')](_0x23982f);}return _0x2f7a0c[_0x0bd5('0x18')](_0x23982f)[_0x0bd5('0x19')]();};}function respondWithResult(_0x30765e,_0x1e961d){_0x1e961d=_0x1e961d||0xc8;return function(_0x4f485b){if(_0x4f485b){return _0x30765e[_0x0bd5('0x18')](_0x1e961d)[_0x0bd5('0x1a')](_0x4f485b);}};}function respondWithFilteredResult(_0x574315,_0x31349f){return function(_0x23ef4e){if(_0x23ef4e){var _0x3a34e4=typeof _0x31349f[_0x0bd5('0x1b')]==='undefined'&&typeof _0x31349f[_0x0bd5('0x1c')]===_0x0bd5('0x1d');var _0xa890be=_0x23ef4e[_0x0bd5('0x1e')];var _0x833c14=_0x3a34e4?0x0:_0x31349f[_0x0bd5('0x1b')];var _0xc58e12=_0x3a34e4?_0x23ef4e[_0x0bd5('0x1e')]:_0x31349f[_0x0bd5('0x1b')]+_0x31349f[_0x0bd5('0x1c')];var _0x27bc1e;if(_0xc58e12>=_0xa890be){_0xc58e12=_0xa890be;_0x27bc1e=0xc8;}else{_0x27bc1e=0xce;}_0x574315[_0x0bd5('0x18')](_0x27bc1e);return _0x574315[_0x0bd5('0x1f')](_0x0bd5('0x20'),_0x833c14+'-'+_0xc58e12+'/'+_0xa890be)['json'](_0x23ef4e);}return null;};}function patchUpdates(_0x5ba943){return function(_0x596b6a){try{jsonpatch['apply'](_0x596b6a,_0x5ba943,!![]);}catch(_0x47d74a){return BPromise[_0x0bd5('0x21')](_0x47d74a);}return _0x596b6a[_0x0bd5('0x22')]();};}function saveUpdates(_0x13ce46,_0x4a6910){return function(_0x6ee1a8){if(_0x6ee1a8){return _0x6ee1a8['update'](_0x13ce46)[_0x0bd5('0x23')](function(_0x3b235b){return _0x3b235b;});}return null;};}function removeEntity(_0x38c21d,_0x5a8139){return function(_0x5b6dde){if(_0x5b6dde){return _0x5b6dde['destroy']()['then'](function(){_0x38c21d[_0x0bd5('0x18')](0xcc)[_0x0bd5('0x19')]();});}};}function handleEntityNotFound(_0x184db3,_0x4fde84){return function(_0x42428c){if(!_0x42428c){_0x184db3['sendStatus'](0x194);}return _0x42428c;};}function handleError(_0x456e87,_0x3ffb08){_0x3ffb08=_0x3ffb08||0x1f4;return function(_0x18cec3){logger[_0x0bd5('0x24')](_0x18cec3[_0x0bd5('0x25')]);if(_0x18cec3[_0x0bd5('0x26')]){delete _0x18cec3[_0x0bd5('0x26')];}_0x456e87[_0x0bd5('0x18')](_0x3ffb08)[_0x0bd5('0x27')](_0x18cec3);};}exports[_0x0bd5('0x28')]=function(_0x15561b,_0xcbfc51){var _0x2e10ce={},_0x2704ee={},_0x5e5a33={'count':0x0,'rows':[]};var _0x461ae3=_[_0x0bd5('0x29')](db['ScreenRecording'][_0x0bd5('0x2a')],function(_0x8eccc9){return{'name':_0x8eccc9['fieldName'],'type':_0x8eccc9[_0x0bd5('0x2b')][_0x0bd5('0x2c')]};});_0x2704ee[_0x0bd5('0x2d')]=_[_0x0bd5('0x2e')](_['map'](_0x461ae3,_0x0bd5('0x26')),[_0x0bd5('0x2f')]);_0x2704ee[_0x0bd5('0x30')]=_[_0x0bd5('0x31')](_0x15561b[_0x0bd5('0x30')]);_0x2704ee[_0x0bd5('0x32')]=_['intersection'](_0x2704ee[_0x0bd5('0x2d')],_0x2704ee['query']);_0x2e10ce[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x2704ee[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x35')]));_0x2e10ce[_0x0bd5('0x33')]=_0x2e10ce[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x2e10ce[_0x0bd5('0x33')]:_0x2704ee[_0x0bd5('0x2d')];if(!_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x37')]('nolimit')){_0x2e10ce[_0x0bd5('0x1c')]=qs[_0x0bd5('0x1c')](_0x15561b['query']['limit']);_0x2e10ce[_0x0bd5('0x1b')]=qs[_0x0bd5('0x1b')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x1b')]);}_0x2e10ce[_0x0bd5('0x38')]=qs[_0x0bd5('0x39')](_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x39')]);_0x2e10ce[_0x0bd5('0x3a')]=qs[_0x0bd5('0x32')](_[_0x0bd5('0x3b')](_0x15561b[_0x0bd5('0x30')],_0x2704ee[_0x0bd5('0x32')]),_0x461ae3);if(_0x15561b['query'][_0x0bd5('0x3c')]){_0x2e10ce['where']=_[_0x0bd5('0x3d')](_0x2e10ce[_0x0bd5('0x3a')],{'$or':_[_0x0bd5('0x29')](_0x461ae3,function(_0x1fcc49){if(_0x1fcc49[_0x0bd5('0x2b')]!==_0x0bd5('0x3e')){var _0x53a682={};_0x53a682[_0x1fcc49[_0x0bd5('0x26')]]={'$like':'%'+_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x3c')]+'%'};return _0x53a682;}})});}_0x2e10ce=_[_0x0bd5('0x3d')]({},_0x2e10ce,_0x15561b[_0x0bd5('0x3f')]);var _0x493089={'where':_0x2e10ce[_0x0bd5('0x3a')]};return db[_0x0bd5('0x40')][_0x0bd5('0x1e')](_0x493089)['then'](function(_0x177aa3){_0x5e5a33['count']=_0x177aa3;if(_0x15561b[_0x0bd5('0x30')][_0x0bd5('0x41')]){_0x2e10ce['include']=[{'all':!![]}];}return db[_0x0bd5('0x40')][_0x0bd5('0x42')](_0x2e10ce);})[_0x0bd5('0x23')](function(_0x3ec4b0){_0x5e5a33[_0x0bd5('0x43')]=_0x3ec4b0;return _0x5e5a33;})[_0x0bd5('0x23')](respondWithFilteredResult(_0xcbfc51,_0x2e10ce))[_0x0bd5('0x44')](handleError(_0xcbfc51,null));};exports['show']=function(_0x4d3ca5,_0x994f24){var _0x545b63={'raw':![],'where':{'id':_0x4d3ca5[_0x0bd5('0x45')]['id']}},_0x5dd42b={};_0x5dd42b[_0x0bd5('0x2d')]=_['keys'](db['ScreenRecording']['rawAttributes']);_0x5dd42b[_0x0bd5('0x30')]=_['keys'](_0x4d3ca5['query']);_0x5dd42b[_0x0bd5('0x32')]=_[_0x0bd5('0x34')](_0x5dd42b['model'],_0x5dd42b['query']);_0x545b63[_0x0bd5('0x33')]=_[_0x0bd5('0x34')](_0x5dd42b[_0x0bd5('0x2d')],qs[_0x0bd5('0x35')](_0x4d3ca5['query'][_0x0bd5('0x35')]));_0x545b63[_0x0bd5('0x33')]=_0x545b63[_0x0bd5('0x33')][_0x0bd5('0x36')]?_0x545b63[_0x0bd5('0x33')]:_0x5dd42b[_0x0bd5('0x2d')];if(_0x4d3ca5['query'][_0x0bd5('0x41')]){_0x545b63[_0x0bd5('0x46')]=[{'all':!![]}];}_0x545b63=_[_0x0bd5('0x3d')]({},_0x545b63,_0x4d3ca5['options']);return db[_0x0bd5('0x40')][_0x0bd5('0x47')](_0x545b63)[_0x0bd5('0x23')](handleEntityNotFound(_0x994f24,null))['then'](respondWithResult(_0x994f24,null))[_0x0bd5('0x44')](handleError(_0x994f24,null));};exports[_0x0bd5('0x48')]=function(_0x54cd78,_0x18c7c7){return db[_0x0bd5('0x40')]['create'](_0x54cd78[_0x0bd5('0x49')],{})[_0x0bd5('0x23')](respondWithResult(_0x18c7c7,0xc9))['catch'](handleError(_0x18c7c7,null));};exports[_0x0bd5('0x4a')]=function(_0x20960a,_0x146bdc){if(_0x20960a[_0x0bd5('0x49')]['id']){delete _0x20960a[_0x0bd5('0x49')]['id'];}delete _0x20960a['body'][_0x0bd5('0x4b')];delete _0x20960a[_0x0bd5('0x49')]['createdAt'];delete _0x20960a[_0x0bd5('0x49')]['closedAt'];delete _0x20960a[_0x0bd5('0x49')][_0x0bd5('0x4c')];return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x20960a['params']['id']}})[_0x0bd5('0x23')](handleEntityNotFound(_0x146bdc,null))['then'](saveUpdates(_0x20960a['body'],null))[_0x0bd5('0x23')](respondWithResult(_0x146bdc,null))[_0x0bd5('0x44')](handleError(_0x146bdc,null));};exports[_0x0bd5('0x4d')]=function(_0x4c9a79,_0x424187){return db['ScreenRecording'][_0x0bd5('0x4d')]()[_0x0bd5('0x23')](respondWithResult(_0x424187,null))[_0x0bd5('0x44')](handleError(_0x424187,null));};exports['download']=function(_0x512fe3,_0x4f0467,_0x122f84){var _0x21db5d=require(_0x0bd5('0x4e'));var _0x5b06c6=![];var _0x2b174a={};if(_0x512fe3[_0x0bd5('0x30')]['type']&&_0x512fe3[_0x0bd5('0x30')]['type']==='uniqueid'){_0x2b174a[_0x0bd5('0x4f')]=_0x512fe3[_0x0bd5('0x45')]['id'];}else{_0x2b174a['id']=_0x512fe3[_0x0bd5('0x45')]['id'];}return db[_0x0bd5('0x40')]['find']({'where':_0x2b174a,'attributes':['id',_0x0bd5('0x4c')],'raw':!![]})[_0x0bd5('0x23')](handleEntityNotFound(_0x4f0467,null))[_0x0bd5('0x23')](function(_0x5cf2f2){if(_0x5cf2f2){var _0x504e46=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],'server/files/screen_recordings',_0x5cf2f2['value']);var _0x2b11e8=util['format'](_0x0bd5('0x52'),_0x504e46);if(fs[_0x0bd5('0x53')](_0x2b11e8)){_0x5b06c6=!![];return _0x21db5d[_0x0bd5('0x54')](_0x2b11e8,_0x504e46,config['secrets'][_0x0bd5('0x55')])[_0x0bd5('0x23')](function(){return _0x5cf2f2;});}return _0x5cf2f2;}})[_0x0bd5('0x23')](function(_0x38aae5){if(_0x38aae5){var _0x5e93fa=path[_0x0bd5('0x50')](config[_0x0bd5('0x51')],_0x0bd5('0x56'),_0x38aae5[_0x0bd5('0x4c')]);if(!fs[_0x0bd5('0x53')](_0x5e93fa)){throw new db['Sequelize'][(_0x0bd5('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x38aae5[_0x0bd5('0x58')]){return _0x4f0467['download'](_0x5e93fa,_0x38aae5['filename']+path[_0x0bd5('0x59')](_0x5e93fa),function(){if(_0x5b06c6){fs['unlink'](_0x5e93fa);}});}else{return _0x4f0467[_0x0bd5('0x5a')](_0x5e93fa,function(_0x3087de){if(_0x5b06c6){fs[_0x0bd5('0x5b')](_0x5e93fa);}});}}})['catch'](function(_0x4f7e86){if(_0x4f7e86[_0x0bd5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x4f0467[_0x0bd5('0x18')](0x194)[_0x0bd5('0x27')]('Not\x20found');}else{return handleError(_0x4f0467,null);}});};exports[_0x0bd5('0x5d')]=function(_0x5a38b1,_0x45ccf5){return db[_0x0bd5('0x40')][_0x0bd5('0x47')]({'where':{'id':_0x5a38b1[_0x0bd5('0x45')]['id']}})[_0x0bd5('0x23')](function(_0x467488){if(_[_0x0bd5('0x5e')](_0x467488)){throw new ReferenceError('Entity\x20not\x20found');}return _0x467488;})[_0x0bd5('0x23')](function(_0x1e5e7d){var _0x33c5eb=path['join'](config['root'],_0x0bd5('0x56'),_0x1e5e7d[_0x0bd5('0x4c')]);logger[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x33c5eb);if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs[_0x0bd5('0x63')](_0x33c5eb);}_0x33c5eb=_0x33c5eb+_0x0bd5('0x64');if(!_[_0x0bd5('0x5e')](_0x1e5e7d[_0x0bd5('0x4c')])&&fs[_0x0bd5('0x53')](_0x33c5eb)){logger[_0x0bd5('0x5f')](_0x0bd5('0x61')+_0x33c5eb+_0x0bd5('0x62'));fs['unlinkSync'](_0x33c5eb);}return _0x1e5e7d;})[_0x0bd5('0x23')](function(_0x32eaaf){if(!_0x32eaaf)throw new InternalError();return _0x32eaaf['destroy']();})[_0x0bd5('0x23')](function(){_0x45ccf5['status'](0xcc)[_0x0bd5('0x19')]();})[_0x0bd5('0x44')](handleError(_0x45ccf5,null));};
\ No newline at end of file
+var _0x55ca=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','createdAt','closedAt','value','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','moment','bluebird','util','path'];(function(_0x28a4ea,_0x3b0042){var _0x306326=function(_0x3c2588){while(--_0x3c2588){_0x28a4ea['push'](_0x28a4ea['shift']());}};_0x306326(++_0x3b0042);}(_0x55ca,0x126));var _0xa55c=function(_0x595add,_0x15feb9){_0x595add=_0x595add-0x0;var _0x52eb1a=_0x55ca[_0x595add];return _0x52eb1a;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x2d')](_['map'](_0x201941,_0xa55c('0x25')),[_0xa55c('0x2e')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x906caa[_0xa55c('0x2f')]);_0x22f6b6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2f')]);_0x1377b0[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x22f6b6['model'],qs['fields'](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x1377b0['attributes']=_0x1377b0[_0xa55c('0x33')][_0xa55c('0x35')]?_0x1377b0[_0xa55c('0x33')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2f')][_0xa55c('0x36')](_0xa55c('0x37'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa['query']['limit']);_0x1377b0['offset']=qs[_0xa55c('0x1a')](_0x906caa[_0xa55c('0x2f')][_0xa55c('0x1a')]);}_0x1377b0['order']=qs[_0xa55c('0x38')](_0x906caa['query'][_0xa55c('0x38')]);_0x1377b0['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x39')](_0x906caa[_0xa55c('0x2f')],_0x22f6b6['filters']),_0x201941);if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3a')]){_0x1377b0['where']=_[_0xa55c('0x3b')](_0x1377b0[_0xa55c('0x3c')],{'$or':_['map'](_0x201941,function(_0x529ff8){if(_0x529ff8[_0xa55c('0x2a')]!=='VIRTUAL'){var _0x1e75dc={};_0x1e75dc[_0x529ff8[_0xa55c('0x25')]]={'$like':'%'+_0x906caa['query']['filter']+'%'};return _0x1e75dc;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x3b3308={'where':_0x1377b0[_0xa55c('0x3c')]};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x3b3308)[_0xa55c('0x20')](function(_0x56d17c){_0x1b8388[_0xa55c('0x1d')]=_0x56d17c;if(_0x906caa[_0xa55c('0x2f')][_0xa55c('0x3d')]){_0x1377b0[_0xa55c('0x3e')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0x1377b0);})['then'](function(_0x386e34){_0x1b8388['rows']=_0x386e34;return _0x1b8388;})['then'](respondWithFilteredResult(_0x5d940d,_0x1377b0))[_0xa55c('0x40')](handleError(_0x5d940d,null));};exports[_0xa55c('0x41')]=function(_0x496920,_0x2bd98b){var _0x508bd3={'raw':![],'where':{'id':_0x496920[_0xa55c('0x42')]['id']}},_0x5f25f7={};_0x5f25f7[_0xa55c('0x2c')]=_[_0xa55c('0x30')](db['ScreenRecording'][_0xa55c('0x43')]);_0x5f25f7[_0xa55c('0x2f')]=_['keys'](_0x496920[_0xa55c('0x2f')]);_0x5f25f7['filters']=_[_0xa55c('0x32')](_0x5f25f7[_0xa55c('0x2c')],_0x5f25f7['query']);_0x508bd3[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5f25f7['model'],qs[_0xa55c('0x34')](_0x496920[_0xa55c('0x2f')][_0xa55c('0x34')]));_0x508bd3['attributes']=_0x508bd3[_0xa55c('0x33')]['length']?_0x508bd3[_0xa55c('0x33')]:_0x5f25f7[_0xa55c('0x2c')];if(_0x496920[_0xa55c('0x2f')]['includeAll']){_0x508bd3[_0xa55c('0x3e')]=[{'all':!![]}];}_0x508bd3=_[_0xa55c('0x3b')]({},_0x508bd3,_0x496920['options']);return db[_0xa55c('0x29')][_0xa55c('0x44')](_0x508bd3)['then'](handleEntityNotFound(_0x2bd98b,null))[_0xa55c('0x20')](respondWithResult(_0x2bd98b,null))[_0xa55c('0x40')](handleError(_0x2bd98b,null));};exports['create']=function(_0x46f839,_0x81cee8){return db[_0xa55c('0x29')][_0xa55c('0x45')](_0x46f839['body'],{})[_0xa55c('0x20')](respondWithResult(_0x81cee8,0xc9))['catch'](handleError(_0x81cee8,null));};exports[_0xa55c('0x1f')]=function(_0x213100,_0x194a79){if(_0x213100['body']['id']){delete _0x213100[_0xa55c('0x46')]['id'];}delete _0x213100[_0xa55c('0x46')]['duration'];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x47')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x48')];delete _0x213100[_0xa55c('0x46')][_0xa55c('0x49')];return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x213100[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x194a79,null))['then'](saveUpdates(_0x213100[_0xa55c('0x46')],null))[_0xa55c('0x20')](respondWithResult(_0x194a79,null))[_0xa55c('0x40')](handleError(_0x194a79,null));};exports['describe']=function(_0x4c3095,_0x35bf0a){return db['ScreenRecording'][_0xa55c('0x4a')]()['then'](respondWithResult(_0x35bf0a,null))[_0xa55c('0x40')](handleError(_0x35bf0a,null));};exports[_0xa55c('0x4b')]=function(_0x181802,_0x3f9313,_0x2ecf79){var _0x5b1cf3=require(_0xa55c('0x4c'));var _0x4607ca=![];var _0x4b85cc={};if(_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]&&_0x181802[_0xa55c('0x2f')][_0xa55c('0x2a')]==='uniqueid'){_0x4b85cc['uniqueid']=_0x181802[_0xa55c('0x42')]['id'];}else{_0x4b85cc['id']=_0x181802[_0xa55c('0x42')]['id'];}return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':_0x4b85cc,'attributes':['id','value'],'raw':!![]})[_0xa55c('0x20')](handleEntityNotFound(_0x3f9313,null))['then'](function(_0x2742e4){if(_0x2742e4){var _0x437ced=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x2742e4['value']);var _0x1cb73b=util['format'](_0xa55c('0x50'),_0x437ced);if(fs[_0xa55c('0x51')](_0x1cb73b)){_0x4607ca=!![];return _0x5b1cf3[_0xa55c('0x52')](_0x1cb73b,_0x437ced,config[_0xa55c('0x53')][_0xa55c('0x54')])[_0xa55c('0x20')](function(){return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x20')](function(_0x53e2be){if(_0x53e2be){var _0x450567=path[_0xa55c('0x4d')](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x53e2be[_0xa55c('0x49')]);if(!fs['existsSync'](_0x450567)){throw new db[(_0xa55c('0x55'))][(_0xa55c('0x56'))](_0xa55c('0x57'));}if(_0x53e2be[_0xa55c('0x58')]){return _0x3f9313[_0xa55c('0x4b')](_0x450567,_0x53e2be['filename']+path[_0xa55c('0x59')](_0x450567),function(){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}else{return _0x3f9313[_0xa55c('0x4b')](_0x450567,function(_0x16d9b2){if(_0x4607ca){fs[_0xa55c('0x5a')](_0x450567);}});}}})['catch'](function(_0x419fc3){if(_0x419fc3['message']===_0xa55c('0x57')){_0x3f9313['status'](0x194)[_0xa55c('0x26')]('Not\x20found');}else{return handleError(_0x3f9313,null);}});};exports[_0xa55c('0x5b')]=function(_0x1333da,_0x21d6b4){return db[_0xa55c('0x29')][_0xa55c('0x44')]({'where':{'id':_0x1333da[_0xa55c('0x42')]['id']}})[_0xa55c('0x20')](function(_0x2f2226){if(_[_0xa55c('0x5c')](_0x2f2226)){throw new ReferenceError(_0xa55c('0x5d'));}return _0x2f2226;})['then'](function(_0x150a07){var _0x311bb9=path['join'](config[_0xa55c('0x4e')],_0xa55c('0x4f'),_0x150a07[_0xa55c('0x49')]);logger[_0xa55c('0x5e')](_0xa55c('0x5f'),_0x311bb9);if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger['info'](_0xa55c('0x60')+_0x311bb9+_0xa55c('0x61'));fs[_0xa55c('0x62')](_0x311bb9);}_0x311bb9=_0x311bb9+_0xa55c('0x63');if(!_[_0xa55c('0x5c')](_0x150a07[_0xa55c('0x49')])&&fs[_0xa55c('0x51')](_0x311bb9)){logger[_0xa55c('0x5e')](_0xa55c('0x60')+_0x311bb9+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xa55c('0x62')](_0x311bb9);}return _0x150a07;})[_0xa55c('0x20')](function(_0x40c56a){if(!_0x40c56a)throw new InternalError();return _0x40c56a[_0xa55c('0x5b')]();})[_0xa55c('0x20')](function(){_0x21d6b4[_0xa55c('0x18')](0xcc)[_0xa55c('0x21')]();})[_0xa55c('0x40')](handleError(_0x21d6b4,null));};
\ No newline at end of file
index 8979f43..fb82946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf507=['../../config/environment','define','ScreenRecording','screen_recordings','interactionid','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xc445e2,_0x199367){var _0x3198ed=function(_0x47df8e){while(--_0x47df8e){_0xc445e2['push'](_0xc445e2['shift']());}};_0x3198ed(++_0x199367);}(_0xf507,0xdd));var _0x7f50=function(_0x242876,_0x40c095){_0x242876=_0x242876-0x0;var _0x2e2718=_0xf507[_0x242876];return _0x2e2718;};'use strict';var _=require(_0x7f50('0x0'));var util=require('util');var logger=require(_0x7f50('0x1'))(_0x7f50('0x2'));var moment=require(_0x7f50('0x3'));var BPromise=require('bluebird');var rp=require(_0x7f50('0x4'));var fs=require('fs');var path=require(_0x7f50('0x5'));var rimraf=require(_0x7f50('0x6'));var config=require(_0x7f50('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x2d0a62,_0x41d3eb){return _0x2d0a62[_0x7f50('0x8')](_0x7f50('0x9'),attributes,{'tableName':_0x7f50('0xa'),'paranoid':![],'indexes':[{'name':_0x7f50('0xb'),'fields':[_0x7f50('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d40=['bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording','interactionid','lodash','util','api','moment'];(function(_0x23aba5,_0x26ea20){var _0x113061=function(_0x137f09){while(--_0x137f09){_0x23aba5['push'](_0x23aba5['shift']());}};_0x113061(++_0x26ea20);}(_0x3d40,0xbf));var _0x03d4=function(_0x4066a4,_0x22d662){_0x4066a4=_0x4066a4-0x0;var _0x30ce99=_0x3d40[_0x4066a4];return _0x30ce99;};'use strict';var _=require(_0x03d4('0x0'));var util=require(_0x03d4('0x1'));var logger=require('../../config/logger')(_0x03d4('0x2'));var moment=require(_0x03d4('0x3'));var BPromise=require(_0x03d4('0x4'));var rp=require(_0x03d4('0x5'));var fs=require('fs');var path=require(_0x03d4('0x6'));var rimraf=require(_0x03d4('0x7'));var config=require(_0x03d4('0x8'));var attributes=require(_0x03d4('0x9'));module['exports']=function(_0x1108f4,_0xd64ddc){return _0x1108f4[_0x03d4('0xa')](_0x03d4('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x03d4('0xc'),'fields':[_0x03d4('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index f4df556..d86c0d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03f8=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3c1ea9,_0x385421){var _0x4cbe96=function(_0x241d06){while(--_0x241d06){_0x3c1ea9['push'](_0x3c1ea9['shift']());}};_0x4cbe96(++_0x385421);}(_0x03f8,0x1b1));var _0x803f=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x03f8[_0xa2c0a3];return _0x52c618;};'use strict';var _=require('lodash');var util=require(_0x803f('0x0'));var moment=require(_0x803f('0x1'));var BPromise=require(_0x803f('0x2'));var rs=require(_0x803f('0x3'));var fs=require('fs');var Redis=require(_0x803f('0x4'));var db=require(_0x803f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x803f('0x6'))(_0x803f('0x7'));var config=require(_0x803f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x803f('0x9')][_0x803f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x596f7b,_0x23101b,_0x3e0d9a){return new BPromise(function(_0x260fb1,_0x503b85){return client[_0x803f('0xb')](_0x596f7b,_0x3e0d9a)[_0x803f('0xc')](function(_0x29a164){logger[_0x803f('0xd')](_0x803f('0xe'),_0x23101b,'request\x20sent');logger[_0x803f('0xf')](_0x803f('0x10'),_0x23101b,_0x803f('0x11'),JSON[_0x803f('0x12')](_0x29a164));if(_0x29a164[_0x803f('0x13')]){if(_0x29a164[_0x803f('0x13')][_0x803f('0x14')]===0x1f4){logger[_0x803f('0x13')](_0x803f('0xe'),_0x23101b,_0x29a164['error']['message']);return _0x503b85(_0x29a164[_0x803f('0x13')]['message']);}logger[_0x803f('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x23101b,_0x29a164[_0x803f('0x13')][_0x803f('0x15')]);return _0x260fb1(_0x29a164[_0x803f('0x13')]['message']);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x23101b,_0x803f('0x11'));_0x260fb1(_0x29a164[_0x803f('0x16')][_0x803f('0x15')]);}})[_0x803f('0x17')](function(_0x1b890f){logger[_0x803f('0x13')](_0x803f('0xe'),_0x23101b,_0x1b890f);_0x503b85(_0x1b890f);});});}
\ No newline at end of file
+var _0x7515=['error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x5be4fc,_0x3cdc5a){var _0x81fca3=function(_0x4d596a){while(--_0x4d596a){_0x5be4fc['push'](_0x5be4fc['shift']());}};_0x81fca3(++_0x3cdc5a);}(_0x7515,0x6e));var _0x5751=function(_0x1af577,_0x1bd440){_0x1af577=_0x1af577-0x0;var _0x18ec4f=_0x7515[_0x1af577];return _0x18ec4f;};'use strict';var _=require('lodash');var util=require(_0x5751('0x0'));var moment=require(_0x5751('0x1'));var BPromise=require(_0x5751('0x2'));var rs=require(_0x5751('0x3'));var fs=require('fs');var Redis=require(_0x5751('0x4'));var db=require(_0x5751('0x5'))['db'];var utils=require(_0x5751('0x6'));var logger=require(_0x5751('0x7'))(_0x5751('0x8'));var config=require(_0x5751('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5751('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc0b5f5,_0x1615ee,_0x5dfc9c){return new BPromise(function(_0xa64367,_0x5d880b){return client[_0x5751('0xb')](_0xc0b5f5,_0x5dfc9c)['then'](function(_0x50215e){logger['info'](_0x5751('0xc'),_0x1615ee,_0x5751('0xd'));logger[_0x5751('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1615ee,_0x5751('0xd'),JSON[_0x5751('0xf')](_0x50215e));if(_0x50215e[_0x5751('0x10')]){if(_0x50215e['error'][_0x5751('0x11')]===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1615ee,_0x50215e[_0x5751('0x10')][_0x5751('0x12')]);return _0x5d880b(_0x50215e[_0x5751('0x10')]['message']);}logger[_0x5751('0x10')](_0x5751('0xc'),_0x1615ee,_0x50215e['error']['message']);return _0xa64367(_0x50215e[_0x5751('0x10')][_0x5751('0x12')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x1615ee,'request\x20sent');_0xa64367(_0x50215e[_0x5751('0x13')]['message']);}})[_0x5751('0x14')](function(_0x3d553e){logger[_0x5751('0x10')](_0x5751('0xc'),_0x1615ee,_0x3d553e);_0x5d880b(_0x3d553e);});});}
\ No newline at end of file
index 2602476..96ea765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4d0=['post','/:id/logo','single','server/files/images/logos/','logologin','addLogoLogin','root','preferred','file','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','format','%s%s','logo','extname','originalname'];(function(_0x84562b,_0x520d17){var _0x1b590c=function(_0x1026b6){while(--_0x1026b6){_0x84562b['push'](_0x84562b['shift']());}};_0x1b590c(++_0x520d17);}(_0xe4d0,0x1f3));var _0x0e4d=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0xe4d0[_0x173113];return _0x3bea89;};'use strict';var multer=require(_0x0e4d('0x0'));var util=require(_0x0e4d('0x1'));var path=require(_0x0e4d('0x2'));var timeout=require(_0x0e4d('0x3'));var express=require(_0x0e4d('0x4'));var router=express[_0x0e4d('0x5')]();var fs_extra=require(_0x0e4d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0e4d('0x7'));var config=require(_0x0e4d('0x8'));var controller=require(_0x0e4d('0x9'));router[_0x0e4d('0xa')]('/',auth['isAuthenticated'](),controller[_0x0e4d('0xb')]);router[_0x0e4d('0xa')](_0x0e4d('0xc'),controller[_0x0e4d('0xd')]);router[_0x0e4d('0xa')](_0x0e4d('0xe'),controller[_0x0e4d('0xf')]);router[_0x0e4d('0xa')]('/:id/logo',controller['getLogo']);router[_0x0e4d('0xa')](_0x0e4d('0x10'),controller['getLogoLogin']);router['get'](_0x0e4d('0x11'),controller[_0x0e4d('0x12')]);router[_0x0e4d('0xa')](_0x0e4d('0x13'),controller[_0x0e4d('0x14')]);router[_0x0e4d('0xa')](_0x0e4d('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0e4d('0x16')]({'destination':function(_0x5cafa2,_0x2ef79b,_0xf64e2f){_0xf64e2f(null,path[_0x0e4d('0x17')](config['root'],'server/files/images/logos/'));},'filename':function(_0x681dbe,_0x56a715,_0x18509c){_0x18509c(null,util[_0x0e4d('0x18')](_0x0e4d('0x19'),_0x0e4d('0x1a'),path[_0x0e4d('0x1b')](_0x56a715[_0x0e4d('0x1c')])));}})});router[_0x0e4d('0x1d')](_0x0e4d('0x1e'),upload[_0x0e4d('0x1f')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x0e4d('0x16')]({'destination':function(_0x42c21c,_0x89036d,_0x22cf1a){_0x22cf1a(null,path[_0x0e4d('0x17')](config['root'],_0x0e4d('0x20')));},'filename':function(_0x5ad30d,_0x4ff4b6,_0x1fed17){_0x1fed17(null,util[_0x0e4d('0x18')](_0x0e4d('0x19'),_0x0e4d('0x21'),path[_0x0e4d('0x1b')](_0x4ff4b6[_0x0e4d('0x1c')])));}})});router[_0x0e4d('0x1d')](_0x0e4d('0x10'),upload['single']('file'),controller[_0x0e4d('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17c47,_0x242f42,_0x2358e6){_0x2358e6(null,path['join'](config[_0x0e4d('0x23')],'server/files/images/logos/'));},'filename':function(_0x4af988,_0x4a220f,_0x292c18){_0x292c18(null,util[_0x0e4d('0x18')](_0x0e4d('0x19'),_0x0e4d('0x24'),path['extname'](_0x4a220f[_0x0e4d('0x1c')])));}})});router[_0x0e4d('0x1d')]('/:id/preferred',upload[_0x0e4d('0x1f')](_0x0e4d('0x25')),controller['addPreferred']);var upload=multer({'storage':multer[_0x0e4d('0x16')]({'destination':function(_0xf72f89,_0x2bc8d2,_0x4edd81){_0x4edd81(null,path['join'](config['root'],_0x0e4d('0x20')));},'filename':function(_0x1edd89,_0x45c1b1,_0x12a76d){_0x12a76d(null,util[_0x0e4d('0x18')](_0x0e4d('0x19'),_0x0e4d('0x26'),path[_0x0e4d('0x1b')](_0x45c1b1['originalname'])));}})});router[_0x0e4d('0x1d')](_0x0e4d('0x15'),upload[_0x0e4d('0x1f')](_0x0e4d('0x25')),controller[_0x0e4d('0x27')]);router[_0x0e4d('0x28')](_0x0e4d('0xe'),auth[_0x0e4d('0x29')](),controller[_0x0e4d('0x2a')]);module[_0x0e4d('0x2b')]=router;
\ No newline at end of file
+var _0x10dc=['root','logologin','extname','originalname','post','/:id/logo_login','file','addLogoLogin','/:id/preferred','addPreferred','diskStorage','favicon','addFavicon','isAuthenticated','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','join','server/files/images/logos/','format','%s%s','logo','/:id/logo','single','addLogo'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x10dc,0x90));var _0xc10d=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x10dc[_0x209941];return _0x1e8729;};'use strict';var multer=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var path=require(_0xc10d('0x2'));var timeout=require(_0xc10d('0x3'));var express=require(_0xc10d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc10d('0x5'));var config=require(_0xc10d('0x6'));var controller=require(_0xc10d('0x7'));router[_0xc10d('0x8')]('/',auth['isAuthenticated'](),controller[_0xc10d('0x9')]);router[_0xc10d('0x8')](_0xc10d('0xa'),controller[_0xc10d('0xb')]);router[_0xc10d('0x8')](_0xc10d('0xc'),controller[_0xc10d('0xd')]);router[_0xc10d('0x8')]('/:id/logo',controller['getLogo']);router[_0xc10d('0x8')]('/:id/logo_login',controller[_0xc10d('0xe')]);router['get'](_0xc10d('0xf'),controller[_0xc10d('0x10')]);router[_0xc10d('0x8')]('/:id/preferred',controller[_0xc10d('0x11')]);router['get'](_0xc10d('0x12'),controller[_0xc10d('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x176245,_0x367b23,_0x3ffb89){_0x3ffb89(null,path[_0xc10d('0x14')](config['root'],_0xc10d('0x15')));},'filename':function(_0x484a9c,_0x25d5e5,_0x5abacc){_0x5abacc(null,util[_0xc10d('0x16')](_0xc10d('0x17'),_0xc10d('0x18'),path['extname'](_0x25d5e5['originalname'])));}})});router['post'](_0xc10d('0x19'),upload[_0xc10d('0x1a')]('file'),controller[_0xc10d('0x1b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xf46e5d,_0x3fc2d1,_0x4841c9){_0x4841c9(null,path[_0xc10d('0x14')](config[_0xc10d('0x1c')],_0xc10d('0x15')));},'filename':function(_0x59ca31,_0xc294e6,_0x1ae146){_0x1ae146(null,util[_0xc10d('0x16')](_0xc10d('0x17'),_0xc10d('0x1d'),path[_0xc10d('0x1e')](_0xc294e6[_0xc10d('0x1f')])));}})});router[_0xc10d('0x20')](_0xc10d('0x21'),upload[_0xc10d('0x1a')](_0xc10d('0x22')),controller[_0xc10d('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4314b2,_0x4dc9c0,_0xf33e85){_0xf33e85(null,path[_0xc10d('0x14')](config['root'],_0xc10d('0x15')));},'filename':function(_0x2ed33f,_0x10010d,_0x26c301){_0x26c301(null,util['format'](_0xc10d('0x17'),'preferred',path[_0xc10d('0x1e')](_0x10010d[_0xc10d('0x1f')])));}})});router[_0xc10d('0x20')](_0xc10d('0x24'),upload[_0xc10d('0x1a')](_0xc10d('0x22')),controller[_0xc10d('0x25')]);var upload=multer({'storage':multer[_0xc10d('0x26')]({'destination':function(_0x3042d9,_0x4901bc,_0x2fdd8f){_0x2fdd8f(null,path['join'](config['root'],_0xc10d('0x15')));},'filename':function(_0xbd438b,_0x351d3a,_0x17ef1b){_0x17ef1b(null,util[_0xc10d('0x16')]('%s%s',_0xc10d('0x27'),path[_0xc10d('0x1e')](_0x351d3a[_0xc10d('0x1f')])));}})});router['post']('/:id/favicon',upload[_0xc10d('0x1a')](_0xc10d('0x22')),controller[_0xc10d('0x28')]);router['put'](_0xc10d('0xc'),auth[_0xc10d('0x29')](),controller['update']);module[_0xc10d('0x2a')]=router;
\ No newline at end of file
index faa81f4..9762f16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['STRING','BOOLEAN','UNSIGNED','exports','min_internal','INTEGER','min_mailbox'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x65f6('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x65f6('0x2')](0xb),'unique':_0x65f6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x65f6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x65f6('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x65f6('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x65f6('0x4')]},'turnaddr':{'type':Sequelize[_0x65f6('0x4')]},'turnusername':{'type':Sequelize[_0x65f6('0x4')]},'turnpassword':{'type':Sequelize[_0x65f6('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x65f6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x65f6('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x65f6('0x4')]},'defaultPreferred':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x65f6('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x65f6('0x4')]},'defaultFavicon':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x65f6('0x4')]},'sentiment':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x65f6('0x2')]},'sentimentRegion':{'type':Sequelize[_0x65f6('0x4')]},'language':{'type':Sequelize[_0x65f6('0x4')]},'bucket':{'type':Sequelize[_0x65f6('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x65f6('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x65f6('0x6')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x65f6('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x65f6('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xadb5=['https://www.xcally.com/bar/phonebar/autoupdater.xml','UNSIGNED','exports','min_internal','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xadb5,0xad));var _0x5adb=function(_0x3756ae,_0x3c6ec1){_0x3756ae=_0x3756ae-0x0;var _0x5e3f65=_0xadb5[_0x3756ae];return _0x5e3f65;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x5adb('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x5adb('0x2')](0xb),'unique':_0x5adb('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':_0x5adb('0x5')},'logo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x5adb('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x5adb('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnaddr':{'type':Sequelize[_0x5adb('0x4')]},'turnusername':{'type':Sequelize[_0x5adb('0x4')]},'turnpassword':{'type':Sequelize[_0x5adb('0x4')]},'pageTitle':{'type':Sequelize[_0x5adb('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x5adb('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x5adb('0x7')},'enableEmailPreview':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x5adb('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x5adb('0x4')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x5adb('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x5adb('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x5adb('0x2')]},'transcribeRegion':{'type':Sequelize[_0x5adb('0x4')]},'sentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x5adb('0x2')]},'sentimentRegion':{'type':Sequelize[_0x5adb('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x5adb('0x4')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x5adb('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x5adb('0x2')](0x2)[_0x5adb('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x5adb('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 2ba2d8d..7d41fe5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc4=['lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','status','end','offset','undefined','limit','count','set','json','apply','reject','destroy','sendStatus','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','body','addLogo','file','filename','logo','find','addLogoLogin','loginLogo','getLogo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','\x20not\x20found','server/files/images/logos','getLicense','default_loginLogo.svg','default','custom','Sequelize','ValidationError','gdpr','securePassword','getPreferred','default_preferred.png','download','getFavicon','default_favicon.ico','getDate','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x279732,_0x2c13af){var _0x576ce2=function(_0x2e54e6){while(--_0x2e54e6){_0x279732['push'](_0x279732['shift']());}};_0x576ce2(++_0x2c13af);}(_0xabc4,0x160));var _0x4abc=function(_0x5b494c,_0x182312){_0x5b494c=_0x5b494c-0x0;var _0x5d8bac=_0xabc4[_0x5b494c];return _0x5d8bac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4abc('0x0'));var zipdir=require(_0x4abc('0x1'));var jsonpatch=require(_0x4abc('0x2'));var rp=require('request-promise');var moment=require(_0x4abc('0x3'));var BPromise=require(_0x4abc('0x4'));var Mustache=require(_0x4abc('0x5'));var util=require(_0x4abc('0x6'));var path=require(_0x4abc('0x7'));var sox=require(_0x4abc('0x8'));var csv=require('to-csv');var ejs=require(_0x4abc('0x9'));var fs=require('fs');var fs_extra=require(_0x4abc('0xa'));var _=require(_0x4abc('0xb'));var squel=require('squel');var crypto=require(_0x4abc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4abc('0xd'));var querystring=require(_0x4abc('0xe'));var Papa=require('papaparse');var Redis=require(_0x4abc('0xf'));var authService=require(_0x4abc('0x10'));var qs=require(_0x4abc('0x11'));var as=require(_0x4abc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4abc('0x13'));var utils=require(_0x4abc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4abc('0x15'));var db=require(_0x4abc('0x16'))['db'];var jayson=require(_0x4abc('0x17'));var client=jayson[_0x4abc('0x18')][_0x4abc('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x8203d,_0x1304d0,_0x26b53a,_0x35c02d){return new BPromise(function(_0x17efaf,_0x2f9c59){var _0x300aa4=_0x35c02d||client;return _0x300aa4[_0x4abc('0x1a')](_0x8203d,_0x26b53a)[_0x4abc('0x1b')](function(_0x79abbb){logger[_0x4abc('0x1c')]('Setting,\x20%s,\x20%s',_0x1304d0,_0x4abc('0x1d'));logger[_0x4abc('0x1e')](_0x4abc('0x1f'),_0x1304d0,_0x4abc('0x1d'),JSON[_0x4abc('0x20')](_0x79abbb));if(_0x79abbb[_0x4abc('0x21')]){if(_0x79abbb[_0x4abc('0x21')][_0x4abc('0x22')]===0x1f4){logger['error'](_0x4abc('0x23'),_0x1304d0,_0x79abbb['error'][_0x4abc('0x24')]);return _0x2f9c59(_0x79abbb[_0x4abc('0x21')][_0x4abc('0x24')]);}logger['error'](_0x4abc('0x23'),_0x1304d0,_0x79abbb[_0x4abc('0x21')][_0x4abc('0x24')]);return _0x17efaf(_0x79abbb[_0x4abc('0x21')]['message']);}else{logger[_0x4abc('0x1c')](_0x4abc('0x23'),_0x1304d0,_0x4abc('0x1d'));_0x17efaf(_0x79abbb['result']['message']);}})[_0x4abc('0x25')](function(_0x20d2ab){logger['error'](_0x4abc('0x23'),_0x1304d0,_0x20d2ab);_0x2f9c59(_0x20d2ab);});});}function respondWithStatusCode(_0xa1642c,_0x1faae2){_0x1faae2=_0x1faae2||0xcc;return function(_0x3879d0){if(_0x3879d0){return _0xa1642c['sendStatus'](_0x1faae2);}return _0xa1642c[_0x4abc('0x26')](_0x1faae2)[_0x4abc('0x27')]();};}function respondWithResult(_0x33caef,_0x246f45){_0x246f45=_0x246f45||0xc8;return function(_0x262dff){if(_0x262dff){return _0x33caef[_0x4abc('0x26')](_0x246f45)['json'](_0x262dff);}};}function respondWithFilteredResult(_0x4393c6,_0x1f5130){return function(_0x228830){if(_0x228830){var _0x93e528=typeof _0x1f5130[_0x4abc('0x28')]===_0x4abc('0x29')&&typeof _0x1f5130[_0x4abc('0x2a')]==='undefined';var _0xd179fb=_0x228830[_0x4abc('0x2b')];var _0x5505c2=_0x93e528?0x0:_0x1f5130[_0x4abc('0x28')];var _0x4e899c=_0x93e528?_0x228830[_0x4abc('0x2b')]:_0x1f5130[_0x4abc('0x28')]+_0x1f5130[_0x4abc('0x2a')];var _0x370d5d;if(_0x4e899c>=_0xd179fb){_0x4e899c=_0xd179fb;_0x370d5d=0xc8;}else{_0x370d5d=0xce;}_0x4393c6[_0x4abc('0x26')](_0x370d5d);return _0x4393c6[_0x4abc('0x2c')]('Content-Range',_0x5505c2+'-'+_0x4e899c+'/'+_0xd179fb)[_0x4abc('0x2d')](_0x228830);}return null;};}function patchUpdates(_0x1d4f5e){return function(_0x22d0ab){try{jsonpatch[_0x4abc('0x2e')](_0x22d0ab,_0x1d4f5e,!![]);}catch(_0x1b98fb){return BPromise[_0x4abc('0x2f')](_0x1b98fb);}return _0x22d0ab['save']();};}function saveUpdates(_0x5e565f,_0x3188ca){return function(_0x475d32){if(_0x475d32){return _0x475d32['update'](_0x5e565f)[_0x4abc('0x1b')](function(_0xa2cf4d){return _0xa2cf4d;});}return null;};}function removeEntity(_0x458962,_0x478c43){return function(_0x1923e4){if(_0x1923e4){return _0x1923e4[_0x4abc('0x30')]()[_0x4abc('0x1b')](function(){_0x458962[_0x4abc('0x26')](0xcc)[_0x4abc('0x27')]();});}};}function handleEntityNotFound(_0x50d4d1,_0x126676){return function(_0x369eee){if(!_0x369eee){_0x50d4d1[_0x4abc('0x31')](0x194);}return _0x369eee;};}function handleError(_0xbb0ddf,_0x1d0d0b){_0x1d0d0b=_0x1d0d0b||0x1f4;return function(_0x5cd4be){logger['error'](_0x5cd4be['stack']);if(_0x5cd4be[_0x4abc('0x32')]){delete _0x5cd4be[_0x4abc('0x32')];}_0xbb0ddf[_0x4abc('0x26')](_0x1d0d0b)[_0x4abc('0x33')](_0x5cd4be);};}exports['index']=function(_0x28900e,_0x3076b8){var _0x388603={},_0x345ec7={},_0x1880b0={'count':0x0,'rows':[]};var _0x28afbf=_[_0x4abc('0x34')](db[_0x4abc('0x35')][_0x4abc('0x36')],function(_0x28722f){return{'name':_0x28722f[_0x4abc('0x37')],'type':_0x28722f[_0x4abc('0x38')][_0x4abc('0x39')]};});_0x345ec7[_0x4abc('0x3a')]=_[_0x4abc('0x34')](_0x28afbf,_0x4abc('0x32'));_0x345ec7[_0x4abc('0x3b')]=_[_0x4abc('0x3c')](_0x28900e[_0x4abc('0x3b')]);_0x345ec7['filters']=_[_0x4abc('0x3d')](_0x345ec7['model'],_0x345ec7[_0x4abc('0x3b')]);_0x388603[_0x4abc('0x3e')]=_[_0x4abc('0x3d')](_0x345ec7[_0x4abc('0x3a')],qs[_0x4abc('0x3f')](_0x28900e['query'][_0x4abc('0x3f')]));_0x388603[_0x4abc('0x3e')]=_0x388603[_0x4abc('0x3e')][_0x4abc('0x40')]?_0x388603[_0x4abc('0x3e')]:_0x345ec7[_0x4abc('0x3a')];if(!_0x28900e[_0x4abc('0x3b')][_0x4abc('0x41')](_0x4abc('0x42'))){_0x388603[_0x4abc('0x2a')]=qs['limit'](_0x28900e[_0x4abc('0x3b')][_0x4abc('0x2a')]);_0x388603[_0x4abc('0x28')]=qs[_0x4abc('0x28')](_0x28900e[_0x4abc('0x3b')][_0x4abc('0x28')]);}_0x388603[_0x4abc('0x43')]=qs[_0x4abc('0x44')](_0x28900e[_0x4abc('0x3b')][_0x4abc('0x44')]);_0x388603[_0x4abc('0x45')]=qs[_0x4abc('0x46')](_[_0x4abc('0x47')](_0x28900e['query'],_0x345ec7['filters']),_0x28afbf);if(_0x28900e[_0x4abc('0x3b')][_0x4abc('0x48')]){_0x388603[_0x4abc('0x45')]=_[_0x4abc('0x49')](_0x388603[_0x4abc('0x45')],{'$or':_['map'](_0x28afbf,function(_0x3c4a13){if(_0x3c4a13['type']!==_0x4abc('0x4a')){var _0x557030={};_0x557030[_0x3c4a13[_0x4abc('0x32')]]={'$like':'%'+_0x28900e[_0x4abc('0x3b')][_0x4abc('0x48')]+'%'};return _0x557030;}})});}_0x388603=_[_0x4abc('0x49')]({},_0x388603,_0x28900e[_0x4abc('0x4b')]);var _0x5d2148={'where':_0x388603[_0x4abc('0x45')]};return db['Setting'][_0x4abc('0x2b')](_0x5d2148)[_0x4abc('0x1b')](function(_0xea0198){_0x1880b0['count']=_0xea0198;if(_0x28900e[_0x4abc('0x3b')][_0x4abc('0x4c')]){_0x388603[_0x4abc('0x4d')]=[{'all':!![]}];}return db[_0x4abc('0x35')][_0x4abc('0x4e')](_0x388603);})[_0x4abc('0x1b')](function(_0x26ce33){_0x1880b0[_0x4abc('0x4f')]=_0x26ce33;return _0x1880b0;})[_0x4abc('0x1b')](respondWithFilteredResult(_0x3076b8,_0x388603))[_0x4abc('0x25')](handleError(_0x3076b8,null));};exports[_0x4abc('0x50')]=function(_0x3bf978,_0x4e92cf){var _0x53b09d={'raw':![],'where':{'id':_0x3bf978[_0x4abc('0x51')]['id']}},_0x16e977={};_0x16e977[_0x4abc('0x3a')]=_[_0x4abc('0x3c')](db[_0x4abc('0x35')][_0x4abc('0x36')]);_0x16e977['query']=_[_0x4abc('0x3c')](_0x3bf978[_0x4abc('0x3b')]);_0x16e977['filters']=_[_0x4abc('0x3d')](_0x16e977[_0x4abc('0x3a')],_0x16e977[_0x4abc('0x3b')]);_0x53b09d['attributes']=_[_0x4abc('0x3d')](_0x16e977['model'],qs[_0x4abc('0x3f')](_0x3bf978[_0x4abc('0x3b')]['fields']));_0x53b09d[_0x4abc('0x3e')]=_0x53b09d['attributes'][_0x4abc('0x40')]?_0x53b09d[_0x4abc('0x3e')]:_0x16e977[_0x4abc('0x3a')];if(_0x3bf978[_0x4abc('0x3b')][_0x4abc('0x4c')]){_0x53b09d[_0x4abc('0x4d')]=[{'all':!![]}];}_0x53b09d=_[_0x4abc('0x49')]({},_0x53b09d,_0x3bf978[_0x4abc('0x4b')]);return db[_0x4abc('0x35')]['find'](_0x53b09d)['then'](handleEntityNotFound(_0x4e92cf,null))['then'](respondWithResult(_0x4e92cf,null))[_0x4abc('0x25')](handleError(_0x4e92cf,null));};exports['update']=function(_0x13a55b,_0xac2efb){if(_0x13a55b[_0x4abc('0x52')]['id']){delete _0x13a55b['body']['id'];}return db[_0x4abc('0x35')]['find']({'where':{'id':_0x13a55b[_0x4abc('0x51')]['id']}})[_0x4abc('0x1b')](handleEntityNotFound(_0xac2efb,null))[_0x4abc('0x1b')](saveUpdates(_0x13a55b[_0x4abc('0x52')],null))['then'](respondWithResult(_0xac2efb,null))[_0x4abc('0x25')](handleError(_0xac2efb,null));};exports[_0x4abc('0x53')]=function(_0x13ba31,_0x409943,_0x2390f0){if(_0x13ba31[_0x4abc('0x54')]&&_0x13ba31[_0x4abc('0x54')][_0x4abc('0x55')]){_0x13ba31[_0x4abc('0x52')][_0x4abc('0x56')]=_0x13ba31[_0x4abc('0x54')][_0x4abc('0x55')];}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x13ba31['params']['id']}})['then'](handleEntityNotFound(_0x409943,null))['then'](saveUpdates(_0x13ba31[_0x4abc('0x52')],null))['then'](respondWithResult(_0x409943,null))[_0x4abc('0x25')](handleError(_0x409943,null));};exports[_0x4abc('0x58')]=function(_0x20cac1,_0x31afbd,_0x2a3542){if(_0x20cac1[_0x4abc('0x54')]&&_0x20cac1['file'][_0x4abc('0x55')]){_0x20cac1[_0x4abc('0x52')][_0x4abc('0x59')]=_0x20cac1['file'][_0x4abc('0x55')];}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x20cac1['params']['id']}})[_0x4abc('0x1b')](handleEntityNotFound(_0x31afbd,null))['then'](saveUpdates(_0x20cac1[_0x4abc('0x52')],null))['then'](respondWithResult(_0x31afbd,null))['catch'](handleError(_0x31afbd,null));};var utilLicense=require('../../config/license/util');exports[_0x4abc('0x5a')]=function(_0x272bbc,_0x33dcd7,_0x4580dd){var _0x3f5c8d='server/files/images/logos';var _0x4acdde={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x74e877){if(_0x74e877){_0x4acdde=_0x74e877;}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x272bbc[_0x4abc('0x51')]['id']},'attributes':['logo',_0x4abc('0x59'),_0x4abc('0x5b'),_0x4abc('0x5c'),_0x4abc('0x5d'),_0x4abc('0x5e'),_0x4abc('0x5f'),_0x4abc('0x60')],'raw':!![]});})[_0x4abc('0x1b')](handleEntityNotFound(_0x33dcd7,null))['then'](function(_0x2bc90a){if(_0x2bc90a){var _0x36dab2=_0x2bc90a[_0x4abc('0x56')]&&fs[_0x4abc('0x61')](path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x3f5c8d,_[_0x4abc('0x64')](_0x2bc90a[_0x4abc('0x56')])))?path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x3f5c8d,_[_0x4abc('0x64')](_0x2bc90a[_0x4abc('0x56')])):path['join'](config['root'],_0x3f5c8d,_[_0x4abc('0x64')](_0x4abc('0x65')));var _0x365b2b='default'+_[_0x4abc('0x66')]('logo');if(_0x2bc90a[_0x365b2b]||!_0x4acdde['custom']){_0x36dab2=path[_0x4abc('0x62')](config['root'],_0x3f5c8d,_[_0x4abc('0x64')](_0x4abc('0x65')));}if(!fs[_0x4abc('0x61')](_0x36dab2)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x4abc('0x56'))+_0x4abc('0x67'));}return _0x33dcd7['download'](_0x36dab2);}})[_0x4abc('0x25')](handleError(_0x33dcd7,null));};var utilLicense=require(_0x4abc('0x15'));exports['getLogoLogin']=function(_0x5f4331,_0x4fee6d,_0x451eff){var _0x593f6d=_0x4abc('0x68');var _0xa6695f={'custom':![]};return utilLicense[_0x4abc('0x69')]()[_0x4abc('0x1b')](function(_0x51e52d){if(_0x51e52d){_0xa6695f=_0x51e52d;}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x5f4331[_0x4abc('0x51')]['id']},'attributes':['logo',_0x4abc('0x59'),_0x4abc('0x5b'),_0x4abc('0x5c'),_0x4abc('0x5d'),_0x4abc('0x5e'),_0x4abc('0x5f'),_0x4abc('0x60')],'raw':!![]});})[_0x4abc('0x1b')](handleEntityNotFound(_0x4fee6d,null))['then'](function(_0x4bd08b){if(_0x4bd08b){var _0x53f41f=_0x4bd08b[_0x4abc('0x59')]&&fs[_0x4abc('0x61')](path['join'](config[_0x4abc('0x63')],_0x593f6d,_[_0x4abc('0x64')](_0x4bd08b[_0x4abc('0x59')])))?path[_0x4abc('0x62')](config['root'],_0x593f6d,_[_0x4abc('0x64')](_0x4bd08b[_0x4abc('0x59')])):path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x593f6d,_[_0x4abc('0x64')](_0x4abc('0x6a')));var _0x2881a4=_0x4abc('0x6b')+_[_0x4abc('0x66')](_0x4abc('0x59'));if(_0x4bd08b[_0x2881a4]||!_0xa6695f[_0x4abc('0x6c')]){_0x53f41f=path['join'](config[_0x4abc('0x63')],_0x593f6d,_[_0x4abc('0x64')](_0x4abc('0x6a')));}if(!fs[_0x4abc('0x61')](_0x53f41f)){throw new db[(_0x4abc('0x6d'))][(_0x4abc('0x6e'))](_[_0x4abc('0x66')](_0x4abc('0x59'))+'\x20not\x20found');}return _0x4fee6d['download'](_0x53f41f);}})[_0x4abc('0x25')](handleError(_0x4fee6d,null));};exports[_0x4abc('0x6f')]=function(_0x1cb945,_0x129de4){return db['Setting'][_0x4abc('0x57')]({'where':{'id':_0x1cb945['params']['id']},'attributes':[_0x4abc('0x70')]})[_0x4abc('0x1b')](respondWithResult(_0x129de4,null))[_0x4abc('0x25')](handleError(_0x129de4,null));};exports['addPreferred']=function(_0x21d650,_0x3c6174,_0x35cef7){if(_0x21d650[_0x4abc('0x54')]&&_0x21d650[_0x4abc('0x54')][_0x4abc('0x55')]){_0x21d650[_0x4abc('0x52')]['preferred']=_0x21d650[_0x4abc('0x54')][_0x4abc('0x55')];}return db['Setting'][_0x4abc('0x57')]({'where':{'id':_0x21d650['params']['id']}})[_0x4abc('0x1b')](handleEntityNotFound(_0x3c6174,null))[_0x4abc('0x1b')](saveUpdates(_0x21d650['body'],null))[_0x4abc('0x1b')](respondWithResult(_0x3c6174,null))[_0x4abc('0x25')](handleError(_0x3c6174,null));};var utilLicense=require(_0x4abc('0x15'));exports[_0x4abc('0x71')]=function(_0x1f6952,_0x5275e7,_0x1c89d3){var _0x57fb32='server/files/images/logos';var _0x2d2070={'custom':![]};return utilLicense[_0x4abc('0x69')]()[_0x4abc('0x1b')](function(_0x469a11){if(_0x469a11){_0x2d2070=_0x469a11;}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x1f6952[_0x4abc('0x51')]['id']},'attributes':[_0x4abc('0x56'),'loginLogo',_0x4abc('0x5b'),_0x4abc('0x5c'),'defaultLogo',_0x4abc('0x5e'),_0x4abc('0x5f'),_0x4abc('0x60')],'raw':!![]});})[_0x4abc('0x1b')](handleEntityNotFound(_0x5275e7,null))[_0x4abc('0x1b')](function(_0x182be9){if(_0x182be9){var _0x5d8624=_0x182be9['preferred']&&fs['existsSync'](path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x57fb32,_[_0x4abc('0x64')](_0x182be9[_0x4abc('0x5b')])))?path[_0x4abc('0x62')](config['root'],_0x57fb32,_[_0x4abc('0x64')](_0x182be9[_0x4abc('0x5b')])):path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x57fb32,_['toLower'](_0x4abc('0x72')));var _0x2c25b9=_0x4abc('0x6b')+_[_0x4abc('0x66')](_0x4abc('0x5b'));if(_0x182be9[_0x2c25b9]||!_0x2d2070[_0x4abc('0x6c')]||!_0x2d2070[_0x4abc('0x5b')]){_0x5d8624=path['join'](config[_0x4abc('0x63')],_0x57fb32,_[_0x4abc('0x64')]('default_preferred.png'));}if(!fs[_0x4abc('0x61')](_0x5d8624)){throw new db[(_0x4abc('0x6d'))][(_0x4abc('0x6e'))](_['upperFirst'](_0x4abc('0x5b'))+_0x4abc('0x67'));}return _0x5275e7[_0x4abc('0x73')](_0x5d8624);}})['catch'](handleError(_0x5275e7,null));};exports['addFavicon']=function(_0x19b63e,_0x23ff6b,_0x2542f5){if(_0x19b63e[_0x4abc('0x54')]&&_0x19b63e[_0x4abc('0x54')]['filename']){_0x19b63e[_0x4abc('0x52')]['favicon']=_0x19b63e[_0x4abc('0x54')][_0x4abc('0x55')];}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x19b63e['params']['id']}})['then'](handleEntityNotFound(_0x23ff6b,null))[_0x4abc('0x1b')](saveUpdates(_0x19b63e[_0x4abc('0x52')],null))[_0x4abc('0x1b')](respondWithResult(_0x23ff6b,null))['catch'](handleError(_0x23ff6b,null));};var utilLicense=require(_0x4abc('0x15'));exports[_0x4abc('0x74')]=function(_0x4acd19,_0x5a73f8,_0x47acfc){var _0x5f4ac3=_0x4abc('0x68');var _0x109b53={'custom':![]};return utilLicense[_0x4abc('0x69')]()[_0x4abc('0x1b')](function(_0x4aed13){if(_0x4aed13){_0x109b53=_0x4aed13;}return db[_0x4abc('0x35')][_0x4abc('0x57')]({'where':{'id':_0x4acd19[_0x4abc('0x51')]['id']},'attributes':[_0x4abc('0x56'),_0x4abc('0x59'),'preferred','favicon',_0x4abc('0x5d'),_0x4abc('0x5e'),_0x4abc('0x5f'),_0x4abc('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x5a73f8,null))['then'](function(_0x37be27){if(_0x37be27){var _0x1f1dfd=_0x37be27[_0x4abc('0x5c')]&&fs[_0x4abc('0x61')](path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x5f4ac3,_[_0x4abc('0x64')](_0x37be27[_0x4abc('0x5c')])))?path[_0x4abc('0x62')](config['root'],_0x5f4ac3,_[_0x4abc('0x64')](_0x37be27['favicon'])):path['join'](config[_0x4abc('0x63')],_0x5f4ac3,_['toLower']('default_favicon.ico'));var _0x8a4cab='default'+_[_0x4abc('0x66')](_0x4abc('0x5c'));if(_0x37be27[_0x8a4cab]||!_0x109b53[_0x4abc('0x6c')]){_0x1f1dfd=path[_0x4abc('0x62')](config[_0x4abc('0x63')],_0x5f4ac3,_[_0x4abc('0x64')](_0x4abc('0x75')));}if(!fs[_0x4abc('0x61')](_0x1f1dfd)){throw new db[(_0x4abc('0x6d'))]['ValidationError'](_['upperFirst'](_0x4abc('0x5c'))+_0x4abc('0x67'));}return _0x5a73f8[_0x4abc('0x73')](_0x1f1dfd);}})[_0x4abc('0x25')](handleError(_0x5a73f8,null));};exports[_0x4abc('0x76')]=function(_0x4d33a5,_0xf695d6){var _0x19acd7={'offset':moment()['utcOffset']()};_0x19acd7[_0x4abc('0x77')]=moment()['utcOffset'](_0x19acd7[_0x4abc('0x28')])['format'](_0x4abc('0x78'));return _0xf695d6[_0x4abc('0x26')](0xc8)[_0x4abc('0x33')](_0x19acd7);};
\ No newline at end of file
+var _0x7aa7=['default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Setting','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','map','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','body','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','join','root','toLower','default_logo.svg','default','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon'];(function(_0x79a5ef,_0xed5e03){var _0x21fbf9=function(_0x431d7d){while(--_0x431d7d){_0x79a5ef['push'](_0x79a5ef['shift']());}};_0x21fbf9(++_0xed5e03);}(_0x7aa7,0xfd));var _0x77aa=function(_0xaf4993,_0x436c90){_0xaf4993=_0xaf4993-0x0;var _0x55189b=_0x7aa7[_0xaf4993];return _0x55189b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x77aa('0x0'));var jsonpatch=require(_0x77aa('0x1'));var rp=require(_0x77aa('0x2'));var moment=require('moment');var BPromise=require(_0x77aa('0x3'));var Mustache=require(_0x77aa('0x4'));var util=require(_0x77aa('0x5'));var path=require(_0x77aa('0x6'));var sox=require(_0x77aa('0x7'));var csv=require(_0x77aa('0x8'));var ejs=require(_0x77aa('0x9'));var fs=require('fs');var fs_extra=require(_0x77aa('0xa'));var _=require('lodash');var squel=require(_0x77aa('0xb'));var crypto=require(_0x77aa('0xc'));var jsforce=require(_0x77aa('0xd'));var deskjs=require(_0x77aa('0xe'));var toCsv=require(_0x77aa('0x8'));var querystring=require(_0x77aa('0xf'));var Papa=require(_0x77aa('0x10'));var Redis=require('ioredis');var authService=require(_0x77aa('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77aa('0x12'));var logger=require(_0x77aa('0x13'))(_0x77aa('0x14'));var utils=require(_0x77aa('0x15'));var config=require(_0x77aa('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x77aa('0x17'))['db'];var jayson=require(_0x77aa('0x18'));var client=jayson[_0x77aa('0x19')][_0x77aa('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x568a54,_0x309489,_0xd08ada,_0x17c985){return new BPromise(function(_0x4dd3e7,_0x334a88){var _0x4b160f=_0x17c985||client;return _0x4b160f[_0x77aa('0x1b')](_0x568a54,_0xd08ada)[_0x77aa('0x1c')](function(_0x105a49){logger[_0x77aa('0x1d')](_0x77aa('0x1e'),_0x309489,_0x77aa('0x1f'));logger[_0x77aa('0x20')](_0x77aa('0x21'),_0x309489,_0x77aa('0x1f'),JSON['stringify'](_0x105a49));if(_0x105a49[_0x77aa('0x22')]){if(_0x105a49[_0x77aa('0x22')][_0x77aa('0x23')]===0x1f4){logger[_0x77aa('0x22')]('Setting,\x20%s,\x20%s',_0x309489,_0x105a49[_0x77aa('0x22')][_0x77aa('0x24')]);return _0x334a88(_0x105a49[_0x77aa('0x22')][_0x77aa('0x24')]);}logger['error'](_0x77aa('0x1e'),_0x309489,_0x105a49['error'][_0x77aa('0x24')]);return _0x4dd3e7(_0x105a49[_0x77aa('0x22')]['message']);}else{logger['info'](_0x77aa('0x1e'),_0x309489,_0x77aa('0x1f'));_0x4dd3e7(_0x105a49[_0x77aa('0x25')][_0x77aa('0x24')]);}})['catch'](function(_0x2a593e){logger[_0x77aa('0x22')](_0x77aa('0x1e'),_0x309489,_0x2a593e);_0x334a88(_0x2a593e);});});}function respondWithStatusCode(_0x580fc8,_0x5af6b9){_0x5af6b9=_0x5af6b9||0xcc;return function(_0x1aedfd){if(_0x1aedfd){return _0x580fc8['sendStatus'](_0x5af6b9);}return _0x580fc8['status'](_0x5af6b9)['end']();};}function respondWithResult(_0x1c6524,_0x445c45){_0x445c45=_0x445c45||0xc8;return function(_0x20cf32){if(_0x20cf32){return _0x1c6524[_0x77aa('0x26')](_0x445c45)[_0x77aa('0x27')](_0x20cf32);}};}function respondWithFilteredResult(_0x1c4772,_0x4eb890){return function(_0x286691){if(_0x286691){var _0x5e613a=typeof _0x4eb890[_0x77aa('0x28')]===_0x77aa('0x29')&&typeof _0x4eb890[_0x77aa('0x2a')]==='undefined';var _0x4b4c49=_0x286691['count'];var _0xc766ff=_0x5e613a?0x0:_0x4eb890['offset'];var _0x59dc4d=_0x5e613a?_0x286691['count']:_0x4eb890['offset']+_0x4eb890[_0x77aa('0x2a')];var _0x2c6ab2;if(_0x59dc4d>=_0x4b4c49){_0x59dc4d=_0x4b4c49;_0x2c6ab2=0xc8;}else{_0x2c6ab2=0xce;}_0x1c4772['status'](_0x2c6ab2);return _0x1c4772['set'](_0x77aa('0x2b'),_0xc766ff+'-'+_0x59dc4d+'/'+_0x4b4c49)[_0x77aa('0x27')](_0x286691);}return null;};}function patchUpdates(_0x5c29b0){return function(_0xab7732){try{jsonpatch[_0x77aa('0x2c')](_0xab7732,_0x5c29b0,!![]);}catch(_0x561cca){return BPromise[_0x77aa('0x2d')](_0x561cca);}return _0xab7732[_0x77aa('0x2e')]();};}function saveUpdates(_0x557874,_0x40569a){return function(_0x3a28eb){if(_0x3a28eb){return _0x3a28eb[_0x77aa('0x2f')](_0x557874)[_0x77aa('0x1c')](function(_0x925e50){return _0x925e50;});}return null;};}function removeEntity(_0x22b4de,_0x2e1713){return function(_0x4ed58d){if(_0x4ed58d){return _0x4ed58d[_0x77aa('0x30')]()['then'](function(){_0x22b4de[_0x77aa('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48c4ee,_0x32594f){return function(_0x46e7e9){if(!_0x46e7e9){_0x48c4ee['sendStatus'](0x194);}return _0x46e7e9;};}function handleError(_0x15a15d,_0x7ffda4){_0x7ffda4=_0x7ffda4||0x1f4;return function(_0x44c9af){logger[_0x77aa('0x22')](_0x44c9af[_0x77aa('0x31')]);if(_0x44c9af[_0x77aa('0x32')]){delete _0x44c9af[_0x77aa('0x32')];}_0x15a15d[_0x77aa('0x26')](_0x7ffda4)[_0x77aa('0x33')](_0x44c9af);};}exports[_0x77aa('0x34')]=function(_0x1d7d70,_0x4fd832){var _0x17661e={},_0x46553d={},_0xb3da8c={'count':0x0,'rows':[]};var _0x14f947=_['map'](db[_0x77aa('0x35')][_0x77aa('0x36')],function(_0x523ade){return{'name':_0x523ade[_0x77aa('0x37')],'type':_0x523ade[_0x77aa('0x38')]['key']};});_0x46553d['model']=_['map'](_0x14f947,_0x77aa('0x32'));_0x46553d['query']=_['keys'](_0x1d7d70[_0x77aa('0x39')]);_0x46553d[_0x77aa('0x3a')]=_['intersection'](_0x46553d[_0x77aa('0x3b')],_0x46553d[_0x77aa('0x39')]);_0x17661e[_0x77aa('0x3c')]=_['intersection'](_0x46553d[_0x77aa('0x3b')],qs[_0x77aa('0x3d')](_0x1d7d70[_0x77aa('0x39')][_0x77aa('0x3d')]));_0x17661e[_0x77aa('0x3c')]=_0x17661e['attributes'][_0x77aa('0x3e')]?_0x17661e[_0x77aa('0x3c')]:_0x46553d[_0x77aa('0x3b')];if(!_0x1d7d70[_0x77aa('0x39')][_0x77aa('0x3f')](_0x77aa('0x40'))){_0x17661e[_0x77aa('0x2a')]=qs[_0x77aa('0x2a')](_0x1d7d70[_0x77aa('0x39')]['limit']);_0x17661e[_0x77aa('0x28')]=qs['offset'](_0x1d7d70[_0x77aa('0x39')][_0x77aa('0x28')]);}_0x17661e['order']=qs[_0x77aa('0x41')](_0x1d7d70[_0x77aa('0x39')][_0x77aa('0x41')]);_0x17661e[_0x77aa('0x42')]=qs[_0x77aa('0x3a')](_['pick'](_0x1d7d70[_0x77aa('0x39')],_0x46553d['filters']),_0x14f947);if(_0x1d7d70[_0x77aa('0x39')]['filter']){_0x17661e[_0x77aa('0x42')]=_[_0x77aa('0x43')](_0x17661e[_0x77aa('0x42')],{'$or':_[_0x77aa('0x44')](_0x14f947,function(_0x150dca){if(_0x150dca[_0x77aa('0x38')]!==_0x77aa('0x45')){var _0x41cb26={};_0x41cb26[_0x150dca[_0x77aa('0x32')]]={'$like':'%'+_0x1d7d70[_0x77aa('0x39')][_0x77aa('0x46')]+'%'};return _0x41cb26;}})});}_0x17661e=_[_0x77aa('0x43')]({},_0x17661e,_0x1d7d70[_0x77aa('0x47')]);var _0xa40f6e={'where':_0x17661e['where']};return db[_0x77aa('0x35')][_0x77aa('0x48')](_0xa40f6e)[_0x77aa('0x1c')](function(_0xe24898){_0xb3da8c[_0x77aa('0x48')]=_0xe24898;if(_0x1d7d70[_0x77aa('0x39')][_0x77aa('0x49')]){_0x17661e[_0x77aa('0x4a')]=[{'all':!![]}];}return db[_0x77aa('0x35')][_0x77aa('0x4b')](_0x17661e);})[_0x77aa('0x1c')](function(_0xe631c7){_0xb3da8c[_0x77aa('0x4c')]=_0xe631c7;return _0xb3da8c;})[_0x77aa('0x1c')](respondWithFilteredResult(_0x4fd832,_0x17661e))[_0x77aa('0x4d')](handleError(_0x4fd832,null));};exports[_0x77aa('0x4e')]=function(_0x1afe8a,_0xeef2e6){var _0x445aa5={'raw':![],'where':{'id':_0x1afe8a[_0x77aa('0x4f')]['id']}},_0x2be1f5={};_0x2be1f5['model']=_[_0x77aa('0x50')](db['Setting']['rawAttributes']);_0x2be1f5['query']=_['keys'](_0x1afe8a[_0x77aa('0x39')]);_0x2be1f5['filters']=_[_0x77aa('0x51')](_0x2be1f5[_0x77aa('0x3b')],_0x2be1f5['query']);_0x445aa5[_0x77aa('0x3c')]=_[_0x77aa('0x51')](_0x2be1f5[_0x77aa('0x3b')],qs[_0x77aa('0x3d')](_0x1afe8a[_0x77aa('0x39')][_0x77aa('0x3d')]));_0x445aa5['attributes']=_0x445aa5[_0x77aa('0x3c')][_0x77aa('0x3e')]?_0x445aa5['attributes']:_0x2be1f5[_0x77aa('0x3b')];if(_0x1afe8a['query'][_0x77aa('0x49')]){_0x445aa5['include']=[{'all':!![]}];}_0x445aa5=_[_0x77aa('0x43')]({},_0x445aa5,_0x1afe8a[_0x77aa('0x47')]);return db[_0x77aa('0x35')][_0x77aa('0x52')](_0x445aa5)[_0x77aa('0x1c')](handleEntityNotFound(_0xeef2e6,null))['then'](respondWithResult(_0xeef2e6,null))[_0x77aa('0x4d')](handleError(_0xeef2e6,null));};exports[_0x77aa('0x2f')]=function(_0x4a9dbe,_0x4eaf84){if(_0x4a9dbe[_0x77aa('0x53')]['id']){delete _0x4a9dbe['body']['id'];}return db[_0x77aa('0x35')]['find']({'where':{'id':_0x4a9dbe[_0x77aa('0x4f')]['id']}})[_0x77aa('0x1c')](handleEntityNotFound(_0x4eaf84,null))['then'](saveUpdates(_0x4a9dbe[_0x77aa('0x53')],null))['then'](respondWithResult(_0x4eaf84,null))['catch'](handleError(_0x4eaf84,null));};exports[_0x77aa('0x54')]=function(_0x120804,_0x452be0,_0x20b389){if(_0x120804[_0x77aa('0x55')]&&_0x120804[_0x77aa('0x55')]['filename']){_0x120804[_0x77aa('0x53')][_0x77aa('0x56')]=_0x120804[_0x77aa('0x55')][_0x77aa('0x57')];}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x120804[_0x77aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x452be0,null))[_0x77aa('0x1c')](saveUpdates(_0x120804[_0x77aa('0x53')],null))[_0x77aa('0x1c')](respondWithResult(_0x452be0,null))[_0x77aa('0x4d')](handleError(_0x452be0,null));};exports['addLogoLogin']=function(_0x5efad2,_0x530e4e,_0x1b787f){if(_0x5efad2['file']&&_0x5efad2[_0x77aa('0x55')][_0x77aa('0x57')]){_0x5efad2[_0x77aa('0x53')][_0x77aa('0x58')]=_0x5efad2[_0x77aa('0x55')][_0x77aa('0x57')];}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x5efad2[_0x77aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x530e4e,null))[_0x77aa('0x1c')](saveUpdates(_0x5efad2['body'],null))[_0x77aa('0x1c')](respondWithResult(_0x530e4e,null))['catch'](handleError(_0x530e4e,null));};var utilLicense=require(_0x77aa('0x59'));exports[_0x77aa('0x5a')]=function(_0x44dadc,_0x29b003,_0x271446){var _0x51ecc9=_0x77aa('0x5b');var _0x409ba0={'custom':![]};return utilLicense['getLicense']()[_0x77aa('0x1c')](function(_0x496f2e){if(_0x496f2e){_0x409ba0=_0x496f2e;}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x44dadc[_0x77aa('0x4f')]['id']},'attributes':[_0x77aa('0x56'),_0x77aa('0x58'),_0x77aa('0x5c'),_0x77aa('0x5d'),_0x77aa('0x5e'),_0x77aa('0x5f'),_0x77aa('0x60'),_0x77aa('0x61')],'raw':!![]});})[_0x77aa('0x1c')](handleEntityNotFound(_0x29b003,null))[_0x77aa('0x1c')](function(_0x2b1a0c){if(_0x2b1a0c){var _0x5e09ed=_0x2b1a0c[_0x77aa('0x56')]&&fs['existsSync'](path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x51ecc9,_[_0x77aa('0x64')](_0x2b1a0c[_0x77aa('0x56')])))?path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x51ecc9,_[_0x77aa('0x64')](_0x2b1a0c['logo'])):path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x51ecc9,_[_0x77aa('0x64')](_0x77aa('0x65')));var _0x3eb84e=_0x77aa('0x66')+_[_0x77aa('0x67')](_0x77aa('0x56'));if(_0x2b1a0c[_0x3eb84e]||!_0x409ba0[_0x77aa('0x68')]){_0x5e09ed=path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x51ecc9,_[_0x77aa('0x64')]('default_logo.svg'));}if(!fs[_0x77aa('0x69')](_0x5e09ed)){throw new db[(_0x77aa('0x6a'))][(_0x77aa('0x6b'))](_[_0x77aa('0x67')](_0x77aa('0x56'))+_0x77aa('0x6c'));}return _0x29b003[_0x77aa('0x6d')](_0x5e09ed);}})[_0x77aa('0x4d')](handleError(_0x29b003,null));};var utilLicense=require(_0x77aa('0x59'));exports[_0x77aa('0x6e')]=function(_0x4bdde8,_0x33e114,_0x118bde){var _0x116a1f=_0x77aa('0x5b');var _0x15caa4={'custom':![]};return utilLicense[_0x77aa('0x6f')]()[_0x77aa('0x1c')](function(_0xdad1fa){if(_0xdad1fa){_0x15caa4=_0xdad1fa;}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x4bdde8[_0x77aa('0x4f')]['id']},'attributes':[_0x77aa('0x56'),_0x77aa('0x58'),'preferred',_0x77aa('0x5d'),_0x77aa('0x5e'),'defaultLoginLogo',_0x77aa('0x60'),_0x77aa('0x61')],'raw':!![]});})[_0x77aa('0x1c')](handleEntityNotFound(_0x33e114,null))[_0x77aa('0x1c')](function(_0x4a4aa6){if(_0x4a4aa6){var _0x4a7837=_0x4a4aa6['loginLogo']&&fs['existsSync'](path[_0x77aa('0x62')](config['root'],_0x116a1f,_['toLower'](_0x4a4aa6[_0x77aa('0x58')])))?path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x116a1f,_[_0x77aa('0x64')](_0x4a4aa6[_0x77aa('0x58')])):path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x116a1f,_[_0x77aa('0x64')](_0x77aa('0x70')));var _0x3b4ed9='default'+_[_0x77aa('0x67')]('loginLogo');if(_0x4a4aa6[_0x3b4ed9]||!_0x15caa4[_0x77aa('0x68')]){_0x4a7837=path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x116a1f,_[_0x77aa('0x64')](_0x77aa('0x70')));}if(!fs[_0x77aa('0x69')](_0x4a7837)){throw new db[(_0x77aa('0x6a'))]['ValidationError'](_[_0x77aa('0x67')](_0x77aa('0x58'))+_0x77aa('0x6c'));}return _0x33e114[_0x77aa('0x6d')](_0x4a7837);}})[_0x77aa('0x4d')](handleError(_0x33e114,null));};exports[_0x77aa('0x71')]=function(_0x3ceca2,_0x596140){return db['Setting']['find']({'where':{'id':_0x3ceca2[_0x77aa('0x4f')]['id']},'attributes':['securePassword']})[_0x77aa('0x1c')](respondWithResult(_0x596140,null))['catch'](handleError(_0x596140,null));};exports[_0x77aa('0x72')]=function(_0x1070df,_0xd9d6e1,_0x179a16){if(_0x1070df[_0x77aa('0x55')]&&_0x1070df[_0x77aa('0x55')][_0x77aa('0x57')]){_0x1070df[_0x77aa('0x53')]['preferred']=_0x1070df[_0x77aa('0x55')]['filename'];}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x1070df['params']['id']}})['then'](handleEntityNotFound(_0xd9d6e1,null))[_0x77aa('0x1c')](saveUpdates(_0x1070df[_0x77aa('0x53')],null))[_0x77aa('0x1c')](respondWithResult(_0xd9d6e1,null))[_0x77aa('0x4d')](handleError(_0xd9d6e1,null));};var utilLicense=require(_0x77aa('0x59'));exports[_0x77aa('0x73')]=function(_0x4fa59b,_0x25e8b4,_0xf28cd4){var _0x1fd9ef=_0x77aa('0x5b');var _0x4d2262={'custom':![]};return utilLicense[_0x77aa('0x6f')]()['then'](function(_0x3dece3){if(_0x3dece3){_0x4d2262=_0x3dece3;}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x4fa59b[_0x77aa('0x4f')]['id']},'attributes':['logo',_0x77aa('0x58'),_0x77aa('0x5c'),_0x77aa('0x5d'),'defaultLogo','defaultLoginLogo',_0x77aa('0x60'),'defaultFavicon'],'raw':!![]});})[_0x77aa('0x1c')](handleEntityNotFound(_0x25e8b4,null))[_0x77aa('0x1c')](function(_0xa86a24){if(_0xa86a24){var _0x198814=_0xa86a24[_0x77aa('0x5c')]&&fs[_0x77aa('0x69')](path[_0x77aa('0x62')](config[_0x77aa('0x63')],_0x1fd9ef,_[_0x77aa('0x64')](_0xa86a24[_0x77aa('0x5c')])))?path['join'](config[_0x77aa('0x63')],_0x1fd9ef,_['toLower'](_0xa86a24[_0x77aa('0x5c')])):path['join'](config[_0x77aa('0x63')],_0x1fd9ef,_[_0x77aa('0x64')](_0x77aa('0x74')));var _0xcf7158=_0x77aa('0x66')+_[_0x77aa('0x67')](_0x77aa('0x5c'));if(_0xa86a24[_0xcf7158]||!_0x4d2262['custom']||!_0x4d2262[_0x77aa('0x5c')]){_0x198814=path['join'](config['root'],_0x1fd9ef,_['toLower'](_0x77aa('0x74')));}if(!fs[_0x77aa('0x69')](_0x198814)){throw new db[(_0x77aa('0x6a'))][(_0x77aa('0x6b'))](_[_0x77aa('0x67')](_0x77aa('0x5c'))+_0x77aa('0x6c'));}return _0x25e8b4['download'](_0x198814);}})['catch'](handleError(_0x25e8b4,null));};exports[_0x77aa('0x75')]=function(_0x37c849,_0x73afb4,_0x45ea41){if(_0x37c849['file']&&_0x37c849[_0x77aa('0x55')][_0x77aa('0x57')]){_0x37c849[_0x77aa('0x53')][_0x77aa('0x5d')]=_0x37c849[_0x77aa('0x55')][_0x77aa('0x57')];}return db[_0x77aa('0x35')]['find']({'where':{'id':_0x37c849[_0x77aa('0x4f')]['id']}})[_0x77aa('0x1c')](handleEntityNotFound(_0x73afb4,null))['then'](saveUpdates(_0x37c849[_0x77aa('0x53')],null))[_0x77aa('0x1c')](respondWithResult(_0x73afb4,null))['catch'](handleError(_0x73afb4,null));};var utilLicense=require(_0x77aa('0x59'));exports[_0x77aa('0x76')]=function(_0x48d60b,_0x54d67a,_0x53aba7){var _0x4eed18=_0x77aa('0x5b');var _0x3e72cb={'custom':![]};return utilLicense['getLicense']()[_0x77aa('0x1c')](function(_0x4fea4e){if(_0x4fea4e){_0x3e72cb=_0x4fea4e;}return db[_0x77aa('0x35')][_0x77aa('0x52')]({'where':{'id':_0x48d60b['params']['id']},'attributes':[_0x77aa('0x56'),_0x77aa('0x58'),_0x77aa('0x5c'),_0x77aa('0x5d'),_0x77aa('0x5e'),_0x77aa('0x5f'),'defaultPreferred',_0x77aa('0x61')],'raw':!![]});})[_0x77aa('0x1c')](handleEntityNotFound(_0x54d67a,null))[_0x77aa('0x1c')](function(_0x4baf9f){if(_0x4baf9f){var _0xef97bd=_0x4baf9f[_0x77aa('0x5d')]&&fs[_0x77aa('0x69')](path['join'](config[_0x77aa('0x63')],_0x4eed18,_[_0x77aa('0x64')](_0x4baf9f[_0x77aa('0x5d')])))?path['join'](config[_0x77aa('0x63')],_0x4eed18,_[_0x77aa('0x64')](_0x4baf9f['favicon'])):path['join'](config[_0x77aa('0x63')],_0x4eed18,_['toLower'](_0x77aa('0x77')));var _0x27863c=_0x77aa('0x66')+_[_0x77aa('0x67')](_0x77aa('0x5d'));if(_0x4baf9f[_0x27863c]||!_0x3e72cb[_0x77aa('0x68')]){_0xef97bd=path['join'](config['root'],_0x4eed18,_[_0x77aa('0x64')]('default_favicon.ico'));}if(!fs[_0x77aa('0x69')](_0xef97bd)){throw new db['Sequelize'][(_0x77aa('0x6b'))](_['upperFirst'](_0x77aa('0x5d'))+_0x77aa('0x6c'));}return _0x54d67a[_0x77aa('0x6d')](_0xef97bd);}})['catch'](handleError(_0x54d67a,null));};exports[_0x77aa('0x78')]=function(_0x3d297a,_0x5e614a){var _0x4684a6={'offset':moment()[_0x77aa('0x79')]()};_0x4684a6['now']=moment()[_0x77aa('0x79')](_0x4684a6[_0x77aa('0x28')])[_0x77aa('0x7a')](_0x77aa('0x7b'));return _0x5e614a['status'](0xc8)[_0x77aa('0x33')](_0x4684a6);};
\ No newline at end of file
index 6085ab5..d3ac6d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x148c09,_0x4fd39f){var _0x18e613=function(_0xfaa810){while(--_0xfaa810){_0x148c09['push'](_0x148c09['shift']());}};_0x18e613(++_0x4fd39f);}(_0x55ca,0x126));var _0xa55c=function(_0x1af469,_0x584d95){_0x1af469=_0x1af469-0x0;var _0x336171=_0x55ca[_0x1af469];return _0x336171;};'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
+var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 97b8c62..ce0b518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8b4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSetting','Setting','find','options','raw','include','map','model','attributes','lodash'];(function(_0x143e58,_0x35d2d4){var _0x515630=function(_0x504575){while(--_0x504575){_0x143e58['push'](_0x143e58['shift']());}};_0x515630(++_0x35d2d4);}(_0xf8b4,0x128));var _0x4f8b=function(_0x2282c2,_0x46dbd6){_0x2282c2=_0x2282c2-0x0;var _0x63e743=_0xf8b4[_0x2282c2];return _0x63e743;};'use strict';var _=require(_0x4f8b('0x0'));var util=require(_0x4f8b('0x1'));var moment=require(_0x4f8b('0x2'));var BPromise=require(_0x4f8b('0x3'));var rs=require(_0x4f8b('0x4'));var fs=require('fs');var Redis=require(_0x4f8b('0x5'));var db=require(_0x4f8b('0x6'))['db'];var utils=require(_0x4f8b('0x7'));var logger=require('../../config/logger')(_0x4f8b('0x8'));var config=require(_0x4f8b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4f8b('0xa')][_0x4f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x626114,_0x2881f3,_0x218ec5){return new BPromise(function(_0x46e828,_0x22b6ff){return client[_0x4f8b('0xc')](_0x626114,_0x218ec5)[_0x4f8b('0xd')](function(_0x1a2ca0){logger[_0x4f8b('0xe')](_0x4f8b('0xf'),_0x2881f3,'request\x20sent');logger[_0x4f8b('0x10')](_0x4f8b('0x11'),_0x2881f3,_0x4f8b('0x12'),JSON[_0x4f8b('0x13')](_0x1a2ca0));if(_0x1a2ca0[_0x4f8b('0x14')]){if(_0x1a2ca0[_0x4f8b('0x14')]['code']===0x1f4){logger[_0x4f8b('0x14')](_0x4f8b('0xf'),_0x2881f3,_0x1a2ca0[_0x4f8b('0x14')][_0x4f8b('0x15')]);return _0x22b6ff(_0x1a2ca0[_0x4f8b('0x14')]['message']);}logger[_0x4f8b('0x14')](_0x4f8b('0xf'),_0x2881f3,_0x1a2ca0[_0x4f8b('0x14')][_0x4f8b('0x15')]);return _0x46e828(_0x1a2ca0['error']['message']);}else{logger[_0x4f8b('0xe')](_0x4f8b('0xf'),_0x2881f3,_0x4f8b('0x12'));_0x46e828(_0x1a2ca0[_0x4f8b('0x16')]['message']);}})[_0x4f8b('0x17')](function(_0x2e21c8){logger[_0x4f8b('0x14')](_0x4f8b('0xf'),_0x2881f3,_0x2e21c8);_0x22b6ff(_0x2e21c8);});});}exports[_0x4f8b('0x18')]=function(_0xf9d8a1){var _0x4300c9=this;return new Promise(function(_0x232fcb,_0x4e1dd0){return db[_0x4f8b('0x19')][_0x4f8b('0x1a')]({'raw':_0xf9d8a1[_0x4f8b('0x1b')]?_0xf9d8a1[_0x4f8b('0x1b')][_0x4f8b('0x1c')]===undefined?!![]:![]:!![],'where':_0xf9d8a1['options']?_0xf9d8a1['options']['where']||null:null,'attributes':_0xf9d8a1['options']?_0xf9d8a1[_0x4f8b('0x1b')]['attributes']||null:null,'include':_0xf9d8a1['options']?_0xf9d8a1[_0x4f8b('0x1b')][_0x4f8b('0x1d')]?_[_0x4f8b('0x1e')](_0xf9d8a1[_0x4f8b('0x1b')]['include'],function(_0x12fb76){return{'model':db[_0x12fb76[_0x4f8b('0x1f')]],'as':_0x12fb76['as'],'attributes':_0x12fb76[_0x4f8b('0x20')],'include':_0x12fb76[_0x4f8b('0x1d')]?_[_0x4f8b('0x1e')](_0x12fb76[_0x4f8b('0x1d')],function(_0x207cfa){return{'model':db[_0x207cfa[_0x4f8b('0x1f')]],'as':_0x207cfa['as'],'attributes':_0x207cfa['attributes'],'include':_0x207cfa[_0x4f8b('0x1d')]?_['map'](_0x207cfa[_0x4f8b('0x1d')],function(_0x2a1ed4){return{'model':db[_0x2a1ed4[_0x4f8b('0x1f')]],'as':_0x2a1ed4['as'],'attributes':_0x2a1ed4['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f8b('0xd')](function(_0x1ba419){logger['info'](_0x4f8b('0x18'),_0xf9d8a1);logger[_0x4f8b('0x10')](_0x4f8b('0x18'),_0xf9d8a1,JSON[_0x4f8b('0x13')](_0x1ba419));_0x232fcb(_0x1ba419);})[_0x4f8b('0x17')](function(_0x62551b){logger[_0x4f8b('0x14')](_0x4f8b('0x18'),_0x62551b[_0x4f8b('0x15')],_0xf9d8a1);_0x4e1dd0(_0x4300c9[_0x4f8b('0x14')](0x1f4,_0x62551b['message']));});});};
\ No newline at end of file
+var _0x6c00=['catch','ShowSetting','Setting','find','options','where','attributes','map','include','model','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x128dec,_0x4c9251){var _0x31a4c1=function(_0x587372){while(--_0x587372){_0x128dec['push'](_0x128dec['shift']());}};_0x31a4c1(++_0x4c9251);}(_0x6c00,0x133));var _0x06c0=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x6c00[_0x30abff];return _0x4c571e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x06c0('0x0'));var BPromise=require(_0x06c0('0x1'));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(_0x06c0('0x2'))('rpc');var config=require(_0x06c0('0x3'));var jayson=require(_0x06c0('0x4'));var client=jayson['client'][_0x06c0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x13a242,_0x2f3302,_0x5e13c8){return new BPromise(function(_0x278fac,_0x275089){return client[_0x06c0('0x6')](_0x13a242,_0x5e13c8)[_0x06c0('0x7')](function(_0x4c5546){logger[_0x06c0('0x8')](_0x06c0('0x9'),_0x2f3302,_0x06c0('0xa'));logger[_0x06c0('0xb')](_0x06c0('0xc'),_0x2f3302,_0x06c0('0xa'),JSON[_0x06c0('0xd')](_0x4c5546));if(_0x4c5546[_0x06c0('0xe')]){if(_0x4c5546[_0x06c0('0xe')][_0x06c0('0xf')]===0x1f4){logger[_0x06c0('0xe')](_0x06c0('0x9'),_0x2f3302,_0x4c5546[_0x06c0('0xe')]['message']);return _0x275089(_0x4c5546['error'][_0x06c0('0x10')]);}logger[_0x06c0('0xe')]('Setting,\x20%s,\x20%s',_0x2f3302,_0x4c5546[_0x06c0('0xe')][_0x06c0('0x10')]);return _0x278fac(_0x4c5546[_0x06c0('0xe')][_0x06c0('0x10')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x2f3302,_0x06c0('0xa'));_0x278fac(_0x4c5546['result']['message']);}})[_0x06c0('0x11')](function(_0x5424a8){logger[_0x06c0('0xe')](_0x06c0('0x9'),_0x2f3302,_0x5424a8);_0x275089(_0x5424a8);});});}exports[_0x06c0('0x12')]=function(_0x393362){var _0x292b87=this;return new Promise(function(_0xaa81d1,_0x43a379){return db[_0x06c0('0x13')][_0x06c0('0x14')]({'raw':_0x393362[_0x06c0('0x15')]?_0x393362[_0x06c0('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x393362[_0x06c0('0x15')]?_0x393362[_0x06c0('0x15')][_0x06c0('0x16')]||null:null,'attributes':_0x393362['options']?_0x393362[_0x06c0('0x15')][_0x06c0('0x17')]||null:null,'include':_0x393362['options']?_0x393362['options']['include']?_[_0x06c0('0x18')](_0x393362[_0x06c0('0x15')][_0x06c0('0x19')],function(_0x1c4758){return{'model':db[_0x1c4758[_0x06c0('0x1a')]],'as':_0x1c4758['as'],'attributes':_0x1c4758[_0x06c0('0x17')],'include':_0x1c4758[_0x06c0('0x19')]?_[_0x06c0('0x18')](_0x1c4758[_0x06c0('0x19')],function(_0x254bad){return{'model':db[_0x254bad['model']],'as':_0x254bad['as'],'attributes':_0x254bad[_0x06c0('0x17')],'include':_0x254bad['include']?_['map'](_0x254bad[_0x06c0('0x19')],function(_0x4a28e4){return{'model':db[_0x4a28e4['model']],'as':_0x4a28e4['as'],'attributes':_0x4a28e4[_0x06c0('0x17')]};}):[]};}):[]};}):[]:[]})[_0x06c0('0x7')](function(_0x16bb1f){logger[_0x06c0('0x8')](_0x06c0('0x12'),_0x393362);logger['debug'](_0x06c0('0x12'),_0x393362,JSON[_0x06c0('0xd')](_0x16bb1f));_0xaa81d1(_0x16bb1f);})[_0x06c0('0x11')](function(_0x25139f){logger['error'](_0x06c0('0x12'),_0x25139f[_0x06c0('0x10')],_0x393362);_0x43a379(_0x292b87[_0x06c0('0xe')](0x1f4,_0x25139f[_0x06c0('0x10')]));});});};
\ No newline at end of file
index 132768d..2d5822f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','/:id/notify','notify','put','delete','removeAnswers','path','connect-timeout','express'];(function(_0x1f320a,_0x5318e2){var _0x19b92c=function(_0x513762){while(--_0x513762){_0x1f320a['push'](_0x1f320a['shift']());}};_0x19b92c(++_0x5318e2);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x80eb99,_0xf5b711){_0x80eb99=_0x80eb99-0x0;var _0x398203=_0x7fbe[_0x80eb99];return _0x398203;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['show']);router['get'](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x10')]);router[_0xe7fb('0x9')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x12')]);router[_0xe7fb('0x9')](_0xe7fb('0x13'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x14')]);router[_0xe7fb('0x9')](_0xe7fb('0x15'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x16')]);router['get'](_0xe7fb('0x17'),controller[_0xe7fb('0x18')]);router['get'](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['getAgents']);router[_0xe7fb('0x1a')]('/',auth['isAuthenticated'](),controller[_0xe7fb('0x1b')]);router[_0xe7fb('0x1a')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['addDisposition']);router[_0xe7fb('0x1a')]('/:id/canned_answers',auth[_0xe7fb('0xa')](),controller['addAnswer']);router[_0xe7fb('0x1a')](_0xe7fb('0x1c'),controller[_0xe7fb('0x1d')]);router[_0xe7fb('0x1a')]('/:id/applications',auth[_0xe7fb('0xa')](),controller['addApplications']);router[_0xe7fb('0x1a')]('/:id/send',auth[_0xe7fb('0xa')](),controller['send']);router[_0xe7fb('0x1a')](_0xe7fb('0x17'),controller['status']);router[_0xe7fb('0x1a')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['addAgents']);router[_0xe7fb('0x1e')](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe7fb('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xe7fb('0x1f')](_0xe7fb('0xf'),auth[_0xe7fb('0xa')](),controller['removeDispositions']);router[_0xe7fb('0x1f')](_0xe7fb('0x11'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x20')]);router[_0xe7fb('0x1f')](_0xe7fb('0x19'),auth[_0xe7fb('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x6aa7=['create','addDisposition','addAnswer','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','getAgents','post'];(function(_0x95c26e,_0x49a9aa){var _0x152e8b=function(_0x5a7627){while(--_0x5a7627){_0x95c26e['push'](_0x95c26e['shift']());}};_0x152e8b(++_0x49a9aa);}(_0x6aa7,0x178));var _0x76aa=function(_0x4cce3a,_0x51f8c4){_0x4cce3a=_0x4cce3a-0x0;var _0xdc8b27=_0x6aa7[_0x4cce3a];return _0xdc8b27;};'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('./smsAccount.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('0x9')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xd')]);router[_0x76aa('0x9')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x9')](_0x76aa('0x10'),auth['isAuthenticated'](),controller[_0x76aa('0x11')]);router['get'](_0x76aa('0x12'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x13')]);router[_0x76aa('0x9')](_0x76aa('0x14'),controller['statusGet']);router['get'](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x16')]);router[_0x76aa('0x17')]('/',auth['isAuthenticated'](),controller[_0x76aa('0x18')]);router['post'](_0x76aa('0xc'),auth['isAuthenticated'](),controller[_0x76aa('0x19')]);router[_0x76aa('0x17')](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1a')]);router[_0x76aa('0x17')]('/:id/notify',controller['notify']);router[_0x76aa('0x17')](_0x76aa('0x10'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1b')]);router[_0x76aa('0x17')](_0x76aa('0x1c'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x1d')]);router[_0x76aa('0x17')]('/:id/status',controller[_0x76aa('0x1e')]);router[_0x76aa('0x17')](_0x76aa('0x15'),auth['isAuthenticated'](),controller[_0x76aa('0x1f')]);router[_0x76aa('0x20')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x21')]);router[_0x76aa('0x22')](_0x76aa('0xb'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x23')]);router[_0x76aa('0x22')](_0x76aa('0xc'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x24')]);router['delete'](_0x76aa('0xe'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x25')]);router[_0x76aa('0x22')](_0x76aa('0x15'),auth[_0x76aa('0x8')](),controller[_0x76aa('0x26')]);module[_0x76aa('0x27')]=router;
\ No newline at end of file
index 1bc4f6c..ab2e550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x576a=['randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x13dfca,_0x1c4fb9){var _0x515eab=function(_0x467a33){while(--_0x467a33){_0x13dfca['push'](_0x13dfca['shift']());}};_0x515eab(++_0x1c4fb9);}(_0x576a,0x186));var _0xa576=function(_0x5b2106,_0x357840){_0x5b2106=_0x5b2106-0x0;var _0x640bf3=_0x576a[_0x5b2106];return _0x640bf3;};'use strict';var Sequelize=require(_0xa576('0x0'));var rs=require(_0xa576('0x1'));module[_0xa576('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa576('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa576('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xa576('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xa576('0x4')],'defaultValue':function(){return rs[_0xa576('0x5')]();}},'phone':{'type':Sequelize[_0xa576('0x4')]},'type':{'type':Sequelize[_0xa576('0x6')](_0xa576('0x7'),_0xa576('0x8'),_0xa576('0x9'),_0xa576('0xa'),_0xa576('0xb'),_0xa576('0xc'),_0xa576('0xd'),_0xa576('0xe'),_0xa576('0xf'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa576('0x4')]},'smsMethod':{'type':Sequelize[_0xa576('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa576('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xa576('0x4')]},'applicationId':{'type':Sequelize[_0xa576('0x4')]},'accountId':{'type':Sequelize[_0xa576('0x4')]},'senderString':{'type':Sequelize[_0xa576('0x4')]},'deliveryReport':{'type':Sequelize[_0xa576('0x10')],'defaultValue':![]},'description':{'type':Sequelize[_0xa576('0x4')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa576('0x11');}},'notificationSound':{'type':Sequelize[_0xa576('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa576('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa576('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa576('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa576('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa576('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa576('0x12')],'comment':_0xa576('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x375ce6){if(!_0x375ce6)this[_0xa576('0x14')](_0xa576('0x15'),null);this[_0xa576('0x14')](_0xa576('0x16'),_0x375ce6);}}};
\ No newline at end of file
+var _0x49a4=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio','connectel','plivo','bandwidth','infobip','intelepeer','ENUM','TEXT'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x49a4,0x133));var _0x449a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x49a4[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x449a('0x0'));var rs=require('randomstring');module[_0x449a('0x1')]={'name':{'type':Sequelize[_0x449a('0x2')],'unique':_0x449a('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x449a('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x449a('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x449a('0x5'),'skebby',_0x449a('0x6'),'clicksend',_0x449a('0x7'),'clickatell',_0x449a('0x8'),'csc',_0x449a('0x9'),_0x449a('0xa'))},'accountSid':{'type':Sequelize[_0x449a('0x2')]},'authId':{'type':Sequelize[_0x449a('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x449a('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0x449a('0x2')]},'password':{'type':Sequelize[_0x449a('0x2')]},'apiKey':{'type':Sequelize[_0x449a('0x2')]},'applicationId':{'type':Sequelize[_0x449a('0x2')]},'accountId':{'type':Sequelize[_0x449a('0x2')]},'senderString':{'type':Sequelize[_0x449a('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x449a('0xc')],'defaultValue':function(){return _0x449a('0xd');}},'notificationSound':{'type':Sequelize[_0x449a('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x449a('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x449a('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x449a('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x449a('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x449a('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x449a('0xf')],'comment':_0x449a('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x449a('0xe')],'defaultValue':![],'comment':_0x449a('0x11'),'set':function(_0x3f4f6b){if(!_0x3f4f6b)this[_0x449a('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x449a('0x13'),_0x3f4f6b);}}};
\ No newline at end of file
index e88b175..8509889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x988d=['../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','SmsAccounts','UserProfileResource','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','find','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','createdAt','updatedAt','CompanyId','ListId','mobile','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','ValidationError','from\x20is\x20mandatory','isNil','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','list','omit','contact','SmsInteraction','spread','interaction','autoclose','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','findAndCountAll','getApplications','Contact','Owner','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','message_id','status_code','groupName','DELIVERED','redif','error_code','infobip','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x469fcd,_0x1b8c77){var _0x1298ad=function(_0x4f0c0d){while(--_0x4f0c0d){_0x469fcd['push'](_0x469fcd['shift']());}};_0x1298ad(++_0x1b8c77);}(_0x988d,0x1b0));var _0xd988=function(_0x3b50e6,_0x347347){_0x3b50e6=_0x3b50e6-0x0;var _0x359a7e=_0x988d[_0x3b50e6];return _0x359a7e;};'use strict';var emlformat=require(_0xd988('0x0'));var rimraf=require(_0xd988('0x1'));var zipdir=require(_0xd988('0x2'));var jsonpatch=require(_0xd988('0x3'));var rp=require(_0xd988('0x4'));var moment=require(_0xd988('0x5'));var BPromise=require(_0xd988('0x6'));var Mustache=require(_0xd988('0x7'));var util=require(_0xd988('0x8'));var path=require(_0xd988('0x9'));var sox=require(_0xd988('0xa'));var csv=require(_0xd988('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd988('0xc'));var _=require(_0xd988('0xd'));var squel=require('squel');var crypto=require(_0xd988('0xe'));var jsforce=require(_0xd988('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd988('0x10'));var authService=require(_0xd988('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd988('0x12'));var hardwareService=require(_0xd988('0x13'));var logger=require(_0xd988('0x14'))(_0xd988('0x15'));var utils=require(_0xd988('0x16'));var config=require(_0xd988('0x17'));var licenseUtil=require(_0xd988('0x18'));var db=require('../../mysqldb')['db'];config[_0xd988('0x19')]=_[_0xd988('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd988('0x1b'))(new Redis(config[_0xd988('0x19')]));require('./smsAccount.socket')[_0xd988('0x1c')](socket);var jayson=require(_0xd988('0x1d'));var client=jayson[_0xd988('0x1e')][_0xd988('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2f61f,_0x2dab9e,_0x2afe7c,_0x49056e){return new BPromise(function(_0x91f064,_0x1043e2){var _0x301d9b=_0x49056e||client;return _0x301d9b['request'](_0x2f61f,_0x2afe7c)[_0xd988('0x20')](function(_0x170076){logger[_0xd988('0x21')](_0xd988('0x22'),_0x2dab9e,_0xd988('0x23'));logger[_0xd988('0x24')](_0xd988('0x25'),_0x2dab9e,_0xd988('0x23'),JSON[_0xd988('0x26')](_0x170076));if(_0x170076['error']){if(_0x170076['error']['code']===0x1f4){logger['error'](_0xd988('0x22'),_0x2dab9e,_0x170076[_0xd988('0x27')][_0xd988('0x28')]);return _0x1043e2(_0x170076[_0xd988('0x27')][_0xd988('0x28')]);}logger[_0xd988('0x27')](_0xd988('0x22'),_0x2dab9e,_0x170076['error']['message']);return _0x91f064(_0x170076['error'][_0xd988('0x28')]);}else{logger[_0xd988('0x21')](_0xd988('0x22'),_0x2dab9e,_0xd988('0x23'));_0x91f064(_0x170076[_0xd988('0x29')][_0xd988('0x28')]);}})[_0xd988('0x2a')](function(_0x48c038){logger['error'](_0xd988('0x22'),_0x2dab9e,_0x48c038);_0x1043e2(_0x48c038);});});}function respondWithStatusCode(_0x47919f,_0x5241c7){_0x5241c7=_0x5241c7||0xcc;return function(_0x11c3df){if(_0x11c3df){return _0x47919f['sendStatus'](_0x5241c7);}return _0x47919f[_0xd988('0x2b')](_0x5241c7)[_0xd988('0x2c')]();};}function respondWithResult(_0x408d67,_0x538d52){_0x538d52=_0x538d52||0xc8;return function(_0x4af1de){if(_0x4af1de){return _0x408d67[_0xd988('0x2b')](_0x538d52)[_0xd988('0x2d')](_0x4af1de);}};}function respondWithFilteredResult(_0x57255f,_0x255d1b){return function(_0xa7f9db){if(_0xa7f9db){var _0x4eead4=typeof _0x255d1b[_0xd988('0x2e')]===_0xd988('0x2f')&&typeof _0x255d1b['limit']===_0xd988('0x2f');var _0x402f51=_0xa7f9db[_0xd988('0x30')];var _0x23a51b=_0x4eead4?0x0:_0x255d1b['offset'];var _0x3c8b51=_0x4eead4?_0xa7f9db[_0xd988('0x30')]:_0x255d1b['offset']+_0x255d1b[_0xd988('0x31')];var _0x8a4b3f;if(_0x3c8b51>=_0x402f51){_0x3c8b51=_0x402f51;_0x8a4b3f=0xc8;}else{_0x8a4b3f=0xce;}_0x57255f[_0xd988('0x2b')](_0x8a4b3f);return _0x57255f[_0xd988('0x32')](_0xd988('0x33'),_0x23a51b+'-'+_0x3c8b51+'/'+_0x402f51)[_0xd988('0x2d')](_0xa7f9db);}return null;};}function patchUpdates(_0x20135d){return function(_0x2f53eb){try{jsonpatch[_0xd988('0x34')](_0x2f53eb,_0x20135d,!![]);}catch(_0x364a46){return BPromise['reject'](_0x364a46);}return _0x2f53eb['save']();};}function saveUpdates(_0x47b7e9,_0x50e062){return function(_0x3a5350){if(_0x3a5350){return _0x3a5350['update'](_0x47b7e9)[_0xd988('0x20')](function(_0x2e9530){return _0x2e9530;});}return null;};}function removeEntity(_0x48c07f,_0xa65360){return function(_0x13b90a){if(_0x13b90a){return _0x13b90a['destroy']()['then'](function(){var _0x4fc272=_0x13b90a['get']({'plain':!![]});var _0x106b29=_0xd988('0x35');return db[_0xd988('0x36')][_0xd988('0x37')]({'where':{'type':_0x106b29,'resourceId':_0x4fc272['id']}})[_0xd988('0x20')](function(){return _0x13b90a;});})[_0xd988('0x20')](function(){_0x48c07f[_0xd988('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48e694,_0x2ce2a2){return function(_0xfe7b33){if(!_0xfe7b33){_0x48e694[_0xd988('0x38')](0x194);}return _0xfe7b33;};}function handleError(_0x2d03f2,_0x16a401){_0x16a401=_0x16a401||0x1f4;return function(_0x19a501){logger['error'](_0x19a501['stack']);if(_0x19a501[_0xd988('0x39')]){delete _0x19a501[_0xd988('0x39')];}_0x2d03f2[_0xd988('0x2b')](_0x16a401)[_0xd988('0x3a')](_0x19a501);};}exports[_0xd988('0x3b')]=function(_0x36a856,_0x390ed5){var _0x38216b={'include':[{'model':db[_0xd988('0x3c')],'as':_0xd988('0x3d')}]},_0x5eb836={},_0x4c7be1={'count':0x0,'rows':[]};var _0x3e4956=_[_0xd988('0x3e')](db[_0xd988('0x3f')][_0xd988('0x40')],function(_0xdff62c){return{'name':_0xdff62c[_0xd988('0x41')],'type':_0xdff62c[_0xd988('0x42')][_0xd988('0x43')]};});_0x5eb836[_0xd988('0x44')]=_['map'](_0x3e4956,_0xd988('0x39'));_0x5eb836[_0xd988('0x45')]=_[_0xd988('0x46')](_0x36a856[_0xd988('0x45')]);_0x5eb836[_0xd988('0x47')]=_[_0xd988('0x48')](_0x5eb836[_0xd988('0x44')],_0x5eb836[_0xd988('0x45')]);_0x38216b[_0xd988('0x49')]=_[_0xd988('0x48')](_0x5eb836[_0xd988('0x44')],qs['fields'](_0x36a856[_0xd988('0x45')][_0xd988('0x4a')]));_0x38216b[_0xd988('0x49')]=_0x38216b[_0xd988('0x49')][_0xd988('0x4b')]?_0x38216b['attributes']:_0x5eb836[_0xd988('0x44')];if(!_0x36a856[_0xd988('0x45')][_0xd988('0x4c')](_0xd988('0x4d'))){_0x38216b[_0xd988('0x31')]=qs[_0xd988('0x31')](_0x36a856[_0xd988('0x45')][_0xd988('0x31')]);_0x38216b[_0xd988('0x2e')]=qs[_0xd988('0x2e')](_0x36a856[_0xd988('0x45')][_0xd988('0x2e')]);}_0x38216b[_0xd988('0x4e')]=qs[_0xd988('0x4f')](_0x36a856[_0xd988('0x45')][_0xd988('0x4f')]);_0x38216b[_0xd988('0x50')]=qs['filters'](_[_0xd988('0x51')](_0x36a856[_0xd988('0x45')],_0x5eb836['filters']),_0x3e4956);if(_0x36a856['query']['filter']){_0x38216b[_0xd988('0x50')]=_[_0xd988('0x52')](_0x38216b[_0xd988('0x50')],{'$or':_[_0xd988('0x3e')](_0x3e4956,function(_0x1c1049){if(_0x1c1049[_0xd988('0x42')]!==_0xd988('0x53')){var _0x59e409={};_0x59e409[_0x1c1049[_0xd988('0x39')]]={'$like':'%'+_0x36a856[_0xd988('0x45')][_0xd988('0x54')]+'%'};return _0x59e409;}})});}_0x38216b=_[_0xd988('0x52')]({},_0x38216b,_0x36a856[_0xd988('0x55')]);var _0x118a95={'where':_0x38216b[_0xd988('0x50')]};return db[_0xd988('0x3f')]['count'](_0x118a95)[_0xd988('0x20')](function(_0x2652db){_0x4c7be1['count']=_0x2652db;if(_0x36a856[_0xd988('0x45')][_0xd988('0x56')]){_0x38216b[_0xd988('0x57')]=[{'all':!![]}];}return db[_0xd988('0x3f')][_0xd988('0x58')](_0x38216b);})[_0xd988('0x20')](function(_0x3bf4d7){_0x4c7be1['rows']=_0x3bf4d7;return _0x4c7be1;})[_0xd988('0x20')](respondWithFilteredResult(_0x390ed5,_0x38216b))['catch'](handleError(_0x390ed5,null));};exports[_0xd988('0x59')]=function(_0x4a0973,_0x170c0c){var _0x5f590b={'raw':![],'where':{'id':_0x4a0973['params']['id']},'include':[{'model':db['Pause'],'as':_0xd988('0x3d')}]},_0x2e9903={};_0x2e9903[_0xd988('0x44')]=_[_0xd988('0x46')](db[_0xd988('0x3f')]['rawAttributes']);_0x2e9903['query']=_[_0xd988('0x46')](_0x4a0973[_0xd988('0x45')]);_0x2e9903['filters']=_[_0xd988('0x48')](_0x2e9903['model'],_0x2e9903['query']);_0x5f590b['attributes']=_['intersection'](_0x2e9903[_0xd988('0x44')],qs[_0xd988('0x4a')](_0x4a0973[_0xd988('0x45')][_0xd988('0x4a')]));_0x5f590b[_0xd988('0x49')]=_0x5f590b[_0xd988('0x49')][_0xd988('0x4b')]?_0x5f590b[_0xd988('0x49')]:_0x2e9903[_0xd988('0x44')];if(_0x4a0973['query'][_0xd988('0x56')]){_0x5f590b[_0xd988('0x57')]=[{'all':!![]}];}_0x5f590b=_[_0xd988('0x52')]({},_0x5f590b,_0x4a0973['options']);return db[_0xd988('0x3f')]['find'](_0x5f590b)[_0xd988('0x20')](handleEntityNotFound(_0x170c0c,null))['then'](respondWithResult(_0x170c0c,null))['catch'](handleError(_0x170c0c,null));};exports[_0xd988('0x5a')]=function(_0xf5434e,_0x103ff7){return db['SmsAccount'][_0xd988('0x5a')](_0xf5434e[_0xd988('0x5b')],{})[_0xd988('0x20')](function(_0x1ea894){var _0x22863c=_0xf5434e[_0xd988('0x5c')][_0xd988('0x5d')]({'plain':!![]});if(!_0x22863c)throw new Error(_0xd988('0x5e'));if(_0x22863c[_0xd988('0x5f')]==='user'){var _0x2aecd8=_0x1ea894['get']({'plain':!![]});var _0x10e4a5=_0xd988('0x35');return db[_0xd988('0x60')]['find']({'where':{'name':_0x10e4a5,'userProfileId':_0x22863c[_0xd988('0x61')]},'raw':!![]})[_0xd988('0x20')](function(_0x15d0ae){if(_0x15d0ae&&_0x15d0ae[_0xd988('0x62')]===0x0){return db[_0xd988('0x36')]['create']({'name':_0x2aecd8['name'],'resourceId':_0x2aecd8['id'],'type':_0x15d0ae[_0xd988('0x39')],'sectionId':_0x15d0ae['id']},{})[_0xd988('0x20')](function(){return _0x1ea894;});}else{return _0x1ea894;}})[_0xd988('0x2a')](function(_0x40214e){logger[_0xd988('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40214e);throw _0x40214e;});}return _0x1ea894;})[_0xd988('0x20')](respondWithResult(_0x103ff7,0xc9))['catch'](handleError(_0x103ff7,null));};exports[_0xd988('0x63')]=function(_0x24c953,_0x5d5eeb){if(_0x24c953[_0xd988('0x5b')]['id']){delete _0x24c953['body']['id'];}return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0x24c953[_0xd988('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0xd988('0x3d')}]})['then'](handleEntityNotFound(_0x5d5eeb,null))[_0xd988('0x20')](saveUpdates(_0x24c953[_0xd988('0x5b')],null))[_0xd988('0x20')](respondWithResult(_0x5d5eeb,null))[_0xd988('0x2a')](handleError(_0x5d5eeb,null));};exports[_0xd988('0x37')]=function(_0x18d989,_0x145586){return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0x18d989[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x145586,null))[_0xd988('0x20')](removeEntity(_0x145586,null))[_0xd988('0x2a')](handleError(_0x145586,null));};exports[_0xd988('0x66')]=function(_0x492ac0,_0x18d45f){return db['SmsAccount'][_0xd988('0x66')]()[_0xd988('0x20')](respondWithResult(_0x18d45f,null))['catch'](handleError(_0x18d45f,null));};exports[_0xd988('0x67')]=function(_0xaafed6,_0xd7dbf9,_0x33dff9){if(_0xaafed6[_0xd988('0x5b')]['id']){delete _0xaafed6[_0xd988('0x5b')]['id'];}return db[_0xd988('0x3f')]['find']({'where':{'id':_0xaafed6[_0xd988('0x65')]['id']}})['then'](handleEntityNotFound(_0xd7dbf9,null))[_0xd988('0x20')](function(_0x3cc9da){if(_0x3cc9da){_0xaafed6[_0xd988('0x5b')][_0xd988('0x68')]=_0x3cc9da['id'];return db[_0xd988('0x69')][_0xd988('0x5a')](_0xaafed6[_0xd988('0x5b')]);}})[_0xd988('0x20')](respondWithResult(_0xd7dbf9,null))['catch'](handleError(_0xd7dbf9,null));};exports[_0xd988('0x6a')]=function(_0x355a16,_0x53a3a8,_0x48bf0f){var _0x2baeef={'raw':![],'where':{}};var _0x425844={};var _0x3b6d2c={'count':0x0,'rows':[]};return db['SmsAccount'][_0xd988('0x6b')]({'where':{'id':_0x355a16[_0xd988('0x65')]['id']}})['then'](handleEntityNotFound(_0x53a3a8,null))[_0xd988('0x20')](function(_0x147a1a){if(_0x147a1a){_0x425844[_0xd988('0x44')]=_[_0xd988('0x46')](db['Disposition'][_0xd988('0x40')]);_0x425844[_0xd988('0x45')]=_['keys'](_0x355a16[_0xd988('0x45')]);_0x425844[_0xd988('0x47')]=_[_0xd988('0x48')](_0x425844[_0xd988('0x44')],_0x425844[_0xd988('0x45')]);_0x2baeef[_0xd988('0x49')]=_[_0xd988('0x48')](_0x425844[_0xd988('0x44')],qs[_0xd988('0x4a')](_0x355a16['query']['fields']));_0x2baeef[_0xd988('0x49')]=_0x2baeef[_0xd988('0x49')][_0xd988('0x4b')]?_0x2baeef[_0xd988('0x49')]:_0x425844[_0xd988('0x44')];if(!_0x355a16[_0xd988('0x45')][_0xd988('0x4c')](_0xd988('0x4d'))){_0x2baeef[_0xd988('0x31')]=qs[_0xd988('0x31')](_0x355a16[_0xd988('0x45')][_0xd988('0x31')]);_0x2baeef[_0xd988('0x2e')]=qs[_0xd988('0x2e')](_0x355a16[_0xd988('0x45')][_0xd988('0x2e')]);}_0x2baeef[_0xd988('0x4e')]=qs[_0xd988('0x4f')](_0x355a16[_0xd988('0x45')][_0xd988('0x4f')]);_0x2baeef[_0xd988('0x50')]=qs[_0xd988('0x47')](_[_0xd988('0x51')](_0x355a16['query'],_0x425844[_0xd988('0x47')]));_0x2baeef['where'][_0xd988('0x68')]=_0x147a1a['id'];if(_0x355a16['query'][_0xd988('0x54')]){_0x2baeef['where']=_[_0xd988('0x52')](_0x2baeef[_0xd988('0x50')],{'$or':_['map'](_0x2baeef[_0xd988('0x49')],function(_0x2cfdb){var _0x13ef48={};_0x13ef48[_0x2cfdb]={'$like':'%'+_0x355a16[_0xd988('0x45')]['filter']+'%'};return _0x13ef48;})});}_0x2baeef=_[_0xd988('0x52')]({},_0x2baeef,_0x355a16['options']);return db[_0xd988('0x69')][_0xd988('0x30')]({'where':_0x2baeef[_0xd988('0x50')]})['then'](function(_0x40ad10){_0x3b6d2c[_0xd988('0x30')]=_0x40ad10;if(_0x355a16['query']['includeAll']){_0x2baeef[_0xd988('0x57')]=[{'all':!![]}];}return db[_0xd988('0x69')]['findAll'](_0x2baeef);})[_0xd988('0x20')](function(_0x1adc2d){_0x3b6d2c[_0xd988('0x6c')]=_0x1adc2d;return _0x3b6d2c;});}})[_0xd988('0x20')](respondWithFilteredResult(_0x53a3a8,_0x2baeef))['catch'](handleError(_0x53a3a8,null));};exports[_0xd988('0x6d')]=function(_0x45a2d4,_0x40cdbe,_0x15e264){return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0x45a2d4[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x40cdbe,null))[_0xd988('0x20')](function(_0x18ea6b){if(_0x18ea6b){return _0x18ea6b['removeDispositions'](_0x45a2d4[_0xd988('0x45')][_0xd988('0x6e')]);}})[_0xd988('0x20')](respondWithStatusCode(_0x40cdbe,null))[_0xd988('0x2a')](handleError(_0x40cdbe,null));};exports[_0xd988('0x6f')]=function(_0x32d182,_0x5ac1fb,_0x3f4dc6){if(_0x32d182[_0xd988('0x5b')]['id']){delete _0x32d182[_0xd988('0x5b')]['id'];}return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0x32d182[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x5ac1fb,null))[_0xd988('0x20')](function(_0x2ffe18){if(_0x2ffe18){_0x32d182[_0xd988('0x5b')][_0xd988('0x68')]=_0x2ffe18['id'];return db[_0xd988('0x70')][_0xd988('0x5a')](_0x32d182[_0xd988('0x5b')]);}})[_0xd988('0x20')](respondWithResult(_0x5ac1fb,null))[_0xd988('0x2a')](handleError(_0x5ac1fb,null));};exports[_0xd988('0x71')]=function(_0x24d798,_0x2dad6f,_0x4809c8){var _0x4fe1fd={'raw':![],'where':{}};var _0x38c1e4={};var _0x2f3c38={'count':0x0,'rows':[]};return db[_0xd988('0x3f')]['findOne']({'where':{'id':_0x24d798[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x2dad6f,null))[_0xd988('0x20')](function(_0x28dca4){if(_0x28dca4){_0x38c1e4['model']=_[_0xd988('0x46')](db[_0xd988('0x70')][_0xd988('0x40')]);_0x38c1e4[_0xd988('0x45')]=_['keys'](_0x24d798[_0xd988('0x45')]);_0x38c1e4[_0xd988('0x47')]=_[_0xd988('0x48')](_0x38c1e4[_0xd988('0x44')],_0x38c1e4[_0xd988('0x45')]);_0x4fe1fd[_0xd988('0x49')]=_['intersection'](_0x38c1e4[_0xd988('0x44')],qs['fields'](_0x24d798['query'][_0xd988('0x4a')]));_0x4fe1fd['attributes']=_0x4fe1fd[_0xd988('0x49')]['length']?_0x4fe1fd[_0xd988('0x49')]:_0x38c1e4[_0xd988('0x44')];if(!_0x24d798[_0xd988('0x45')][_0xd988('0x4c')](_0xd988('0x4d'))){_0x4fe1fd[_0xd988('0x31')]=qs[_0xd988('0x31')](_0x24d798[_0xd988('0x45')][_0xd988('0x31')]);_0x4fe1fd[_0xd988('0x2e')]=qs['offset'](_0x24d798['query']['offset']);}_0x4fe1fd[_0xd988('0x4e')]=qs[_0xd988('0x4f')](_0x24d798[_0xd988('0x45')]['sort']);_0x4fe1fd[_0xd988('0x50')]=qs[_0xd988('0x47')](_[_0xd988('0x51')](_0x24d798[_0xd988('0x45')],_0x38c1e4[_0xd988('0x47')]));_0x4fe1fd[_0xd988('0x50')][_0xd988('0x68')]=_0x28dca4['id'];if(_0x24d798[_0xd988('0x45')][_0xd988('0x54')]){_0x4fe1fd[_0xd988('0x50')]=_['merge'](_0x4fe1fd[_0xd988('0x50')],{'$or':_['map'](_0x4fe1fd[_0xd988('0x49')],function(_0x1883ed){var _0x14a787={};_0x14a787[_0x1883ed]={'$like':'%'+_0x24d798['query'][_0xd988('0x54')]+'%'};return _0x14a787;})});}_0x4fe1fd=_[_0xd988('0x52')]({},_0x4fe1fd,_0x24d798['options']);return db[_0xd988('0x70')][_0xd988('0x30')]({'where':_0x4fe1fd[_0xd988('0x50')]})[_0xd988('0x20')](function(_0x49105a){_0x2f3c38[_0xd988('0x30')]=_0x49105a;if(_0x24d798[_0xd988('0x45')][_0xd988('0x56')]){_0x4fe1fd[_0xd988('0x57')]=[{'all':!![]}];}return db[_0xd988('0x70')][_0xd988('0x58')](_0x4fe1fd);})['then'](function(_0xad093b){_0x2f3c38[_0xd988('0x6c')]=_0xad093b;return _0x2f3c38;});}})[_0xd988('0x20')](respondWithFilteredResult(_0x2dad6f,_0x4fe1fd))[_0xd988('0x2a')](handleError(_0x2dad6f,null));};exports[_0xd988('0x72')]=function(_0x439968,_0x3b8b0e,_0x5f21ab){return db[_0xd988('0x3f')]['find']({'where':{'id':_0x439968[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x3b8b0e,null))[_0xd988('0x20')](function(_0x1cdc38){if(_0x1cdc38){return _0x1cdc38[_0xd988('0x72')](_0x439968['query'][_0xd988('0x6e')]);}})['then'](respondWithStatusCode(_0x3b8b0e,null))['catch'](handleError(_0x3b8b0e,null));};exports[_0xd988('0x73')]=function(_0x434da7,_0x35b354,_0x456b64){var _0x35271c={'channel':_0xd988('0x74')};var _0x4186f5=[];var _0x1b7488=[];var _0x559645={};return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0x434da7['params']['id']},'include':[{'model':db[_0xd988('0x75')],'as':_0xd988('0x76')}]})['then'](handleEntityNotFound(_0x35b354,null))['then'](function(_0x1fbeb0){_0x35271c[_0xd988('0x77')]=_0x1fbeb0;_0x35271c[_0xd988('0x78')]=_[_0xd988('0x79')](_0x1fbeb0[_0xd988('0x76')],[_0xd988('0x7a')],[_0xd988('0x7b')]);if(_0x35271c[_0xd988('0x77')][_0xd988('0x76')]){delete _0x35271c[_0xd988('0x77')][_0xd988('0x76')];}return db['CmContact']['describe']();})['then'](function(_0x1bdfa9){if(!_0x1bdfa9){throw new db[(_0xd988('0x7c'))]['ValidationError']('no\x20available\x20attributes');}_0x4186f5=_['difference'](_[_0xd988('0x46')](_0x1bdfa9),[_0xd988('0x7d'),_0xd988('0x7e')]);_0x1b7488=_['difference'](_[_0xd988('0x46')](_0x1bdfa9),[_0xd988('0x7d'),'updatedAt',_0xd988('0x7f'),_0xd988('0x80')]);_0x35271c[_0xd988('0x5b')]={'mapKey':_0xd988('0x81')};if(_0x35271c[_0xd988('0x77')]['type']){switch(_0x35271c[_0xd988('0x77')][_0xd988('0x42')]){case'twilio':_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x83')];_0x35271c['body'][_0xd988('0x5b')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x84')];_0x35271c[_0xd988('0x5b')][_0xd988('0x85')]=_0x434da7['body'][_0xd988('0x86')];break;case _0xd988('0x87'):_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]='+'+_0x434da7[_0xd988('0x5b')][_0xd988('0x88')];_0x35271c[_0xd988('0x5b')][_0xd988('0x5b')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x89')];break;case'connectel':_0x35271c['body'][_0xd988('0x82')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x82')];_0x35271c['body']['body']=_0x434da7['body']['message'];break;case _0xd988('0x8a'):_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x82')];_0x35271c[_0xd988('0x5b')][_0xd988('0x5b')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x5b')];_0x35271c[_0xd988('0x5b')]['messageId']=_0x434da7['body']['message_id'];break;case _0xd988('0x8b'):_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x83')];_0x35271c['body'][_0xd988('0x5b')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x8c')];_0x35271c[_0xd988('0x5b')][_0xd988('0x85')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x8d')];break;case'infobip':_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]='+'+_0x434da7[_0xd988('0x5b')][_0xd988('0x8e')][0x0][_0xd988('0x82')];_0x35271c[_0xd988('0x5b')]['body']=_0x434da7['body'][_0xd988('0x8e')][0x0]['text'];_0x35271c['body'][_0xd988('0x85')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x8e')][0x0]['messageId'];break;case _0xd988('0x8f'):_0x35271c[_0xd988('0x5b')]['from']=_0x434da7[_0xd988('0x5b')][_0xd988('0x90')];_0x35271c[_0xd988('0x5b')][_0xd988('0x5b')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x91')][_0xd988('0x28')];break;case _0xd988('0x92'):_0x35271c['body']['from']=_0x434da7[_0xd988('0x5b')][_0xd988('0x93')];_0x35271c['body']['body']=_0x434da7[_0xd988('0x5b')][_0xd988('0x89')];_0x35271c['body'][_0xd988('0x85')]=_0x434da7[_0xd988('0x5b')]['replyMessageId'];break;case _0xd988('0x94'):_0x35271c[_0xd988('0x5b')][_0xd988('0x85')]=_0x434da7[_0xd988('0x5b')][0x0][_0xd988('0x28')]['id'];_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]=_0x434da7[_0xd988('0x5b')][0x0]['message'][_0xd988('0x82')];_0x35271c['body'][_0xd988('0x5b')]=_0x434da7['body'][0x0]['message']['text'];break;case _0xd988('0x95'):_0x35271c[_0xd988('0x5b')][_0xd988('0x82')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x82')];_0x35271c[_0xd988('0x5b')][_0xd988('0x5b')]=_0x434da7[_0xd988('0x5b')][_0xd988('0x28')];_0x35271c[_0xd988('0x5b')]['messageId']=_0x434da7['body'][_0xd988('0x96')];break;}}if(_0x35271c[_0xd988('0x5b')]['id']){delete _0x35271c[_0xd988('0x5b')]['id'];}if(_['isNil'](_0x35271c[_0xd988('0x5b')][_0xd988('0x82')])){throw new db[(_0xd988('0x7c'))][(_0xd988('0x97'))](_0xd988('0x98'));}if(_['isNil'](_0x35271c[_0xd988('0x5b')][_0xd988('0x5b')])||_0x35271c['body']['body']===''){throw new db[(_0xd988('0x7c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd988('0x99')](_0x35271c[_0xd988('0x5b')]['mapKey'])){throw new db[(_0xd988('0x7c'))][(_0xd988('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1b7488);}if(!_[_0xd988('0x9a')](_0x1b7488,_0x35271c['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xd988('0x9b')+_0x1b7488);}_0x559645[_0x35271c[_0xd988('0x5b')][_0xd988('0x9c')]]=_0x35271c[_0xd988('0x5b')][_0xd988('0x82')];return db[_0xd988('0x9d')][_0xd988('0x64')]({'where':{'id':_0x35271c['account'][_0xd988('0x80')]},'include':[{'model':db[_0xd988('0x9e')],'as':_0xd988('0x9f'),'where':_0x559645,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x35b354,null))[_0xd988('0x20')](function(_0x1b5463){if(_0x1b5463){_0x35271c[_0xd988('0xa0')]=_[_0xd988('0xa1')](_0x1b5463,['Contacts']);if(_0x1b5463['Contacts'][_0xd988('0x4b')]){return _0x1b5463['Contacts'][0x0];}var _0x5a435c=_[_0xd988('0x1a')](_0x35271c['body'],{'firstName':_0x35271c[_0xd988('0x5b')]['from'],'ListId':_0x1b5463['id']});_0x5a435c[_0x35271c[_0xd988('0x5b')]['mapKey']]=_0x35271c[_0xd988('0x5b')][_0xd988('0x82')];return db[_0xd988('0x9e')][_0xd988('0x5a')](_0x5a435c,{'fields':_0x4186f5,'raw':!![]});}})[_0xd988('0x20')](handleEntityNotFound(_0x35b354,null))[_0xd988('0x20')](function(_0x1750d3){if(_0x1750d3){_0x35271c[_0xd988('0xa2')]=_0x1750d3;var _0xd0e58={'ContactId':_0x1750d3['id'],'phone':_0x35271c[_0xd988('0x5b')][_0xd988('0x82')],'SmsAccountId':_0x434da7[_0xd988('0x65')]['id']};var _0x317107={'ContactId':_0x1750d3['id'],'SmsAccountId':_0x434da7['params']['id'],'closed':![]};return db['SmsInteraction'][_0xd988('0x64')]({'where':_0x317107})[_0xd988('0x20')](function(_0x82d99e){if(_0x82d99e){return[_0x82d99e,![]];}return db[_0xd988('0xa3')][_0xd988('0x5a')](_0xd0e58)['then'](function(_0x27a741){return[_0x27a741,!![]];});});}})[_0xd988('0xa4')](function(_0x15396d,_0x3abcf3){_0x35271c[_0xd988('0xa5')]=_0x15396d[_0xd988('0x5d')]({'plain':!![]});_0x35271c['interaction']['created']=![];if(_0x3abcf3){if(_0x35271c[_0xd988('0x77')][_0xd988('0xa6')]){_0x35271c['applications']['push']({'id':0x0,'priority':_0x35271c[_0xd988('0x78')][_0xd988('0x4b')]+0x1,'app':_0xd988('0xa7'),'appdata':_0xd988('0xa8'),'interval':_0xd988('0xa9')});}_0x35271c['interaction']['created']=!![];}return db[_0xd988('0xaa')][_0xd988('0x5a')]({'phone':_0x35271c[_0xd988('0x5b')][_0xd988('0x82')],'messageId':_0x35271c['body'][_0xd988('0x85')],'body':_0x35271c[_0xd988('0x5b')][_0xd988('0x5b')],'SmsAccountId':_0x434da7['params']['id'],'SmsInteractionId':_0x15396d['id'],'direction':'in','ContactId':_0x15396d[_0xd988('0xab')],'AttachmentId':_0x35271c[_0xd988('0x5b')]['AttachmentId']});})[_0xd988('0x20')](function(_0x4c356d){_0x35271c[_0xd988('0x28')]=_0x4c356d;if(_0x35271c[_0xd988('0xa5')][_0xd988('0xac')]){return db[_0xd988('0xad')][_0xd988('0x64')]({'attributes':['id',_0xd988('0x39')],'where':{'id':_0x35271c[_0xd988('0xa5')][_0xd988('0xac')]}})[_0xd988('0x20')](function(_0x5abedb){if(_0x5abedb){_0x35271c['applications'][_0xd988('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5abedb[_0xd988('0x39')]+','+(_0x35271c[_0xd988('0x77')][_0xd988('0xaf')]||0xa),'interval':_0xd988('0xa9')});}return respondWithRpcPromise(_0xd988('0xb0'),_0xd988('0xb1'),_0x35271c);});}return respondWithRpcPromise(_0xd988('0xb0'),'startRouting',_0x35271c);})[_0xd988('0x20')](function(_0x482f29){if(_0x482f29){var _0x4beb6b=0xc8;var _0x447aa7='receiveMessage';logger[_0xd988('0x21')](_0xd988('0x25'),_0x447aa7,_0x4beb6b,_0xd988('0xb2'));logger['debug'](_0xd988('0xb3'),_0x447aa7,_0x4beb6b,_0xd988('0xb2'),JSON[_0xd988('0x26')](_0x482f29));if(_0x35271c[_0xd988('0x77')]['type']===_0xd988('0xb4')){return _0x35b354['status'](_0x4beb6b)['set'](_0xd988('0xb5'),_0xd988('0xb6'))[_0xd988('0x3a')](_0xd988('0xb7'));}else{return _0x35b354[_0xd988('0x2b')](_0x4beb6b)[_0xd988('0x2d')](_0x482f29);}}})['catch'](handleError(_0x35b354,null));};exports[_0xd988('0xb8')]=function(_0xb11960,_0x1375bd,_0x122f6c){return db[_0xd988('0x3f')][_0xd988('0x6b')]({'where':{'id':_0xb11960[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x1375bd,null))[_0xd988('0x20')](function(_0x3c22ff){if(_0x3c22ff){return db[_0xd988('0xb9')][_0xd988('0xba')](function(_0x4a6694){return db['SmsApplication'][_0xd988('0x37')]({'where':{'SmsAccountId':_0xb11960[_0xd988('0x65')]['id']},'transaction':_0x4a6694})[_0xd988('0x20')](function(_0x36ae18){var _0x2de258=_[_0xd988('0x3e')](_0xb11960[_0xd988('0x5b')],function(_0x19f33a){_0x19f33a['SmsAccountId']=_0xb11960[_0xd988('0x65')]['id'];return _0x19f33a;});return db[_0xd988('0x75')]['bulkCreate'](_0x2de258,{'transaction':_0x4a6694});});})['then'](function(){return db[_0xd988('0x75')][_0xd988('0xbb')]({'where':{'SmsAccountId':_0xb11960[_0xd988('0x65')]['id']},'order':'priority'});});}})[_0xd988('0x20')](respondWithResult(_0x1375bd,null))[_0xd988('0x2a')](handleError(_0x1375bd,null));};exports[_0xd988('0xbc')]=function(_0x2bb5b9,_0x18c981,_0x19917c){var _0x3b7abb={};var _0xda1780={};var _0x2d91a8;var _0x19c65b;return db[_0xd988('0x3f')][_0xd988('0x6b')]({'where':{'id':_0x2bb5b9[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x18c981,null))[_0xd988('0x20')](function(_0x6f0c66){if(_0x6f0c66){_0x2d91a8=_0x6f0c66;_0xda1780[_0xd988('0x44')]=_[_0xd988('0x46')](db[_0xd988('0x75')][_0xd988('0x40')]);_0xda1780[_0xd988('0x45')]=_['keys'](_0x2bb5b9['query']);_0xda1780['filters']=_[_0xd988('0x48')](_0xda1780['model'],_0xda1780[_0xd988('0x45')]);_0x3b7abb['attributes']=_['intersection'](_0xda1780[_0xd988('0x44')],qs[_0xd988('0x4a')](_0x2bb5b9['query'][_0xd988('0x4a')]));_0x3b7abb[_0xd988('0x49')]=_0x3b7abb[_0xd988('0x49')][_0xd988('0x4b')]?_0x3b7abb[_0xd988('0x49')]:_0xda1780[_0xd988('0x44')];_0x3b7abb['order']=qs[_0xd988('0x4f')](_0x2bb5b9['query'][_0xd988('0x4f')]);_0x3b7abb[_0xd988('0x50')]=qs[_0xd988('0x47')](_[_0xd988('0x51')](_0x2bb5b9[_0xd988('0x45')],_0xda1780[_0xd988('0x47')]));if(_0x2bb5b9[_0xd988('0x45')]['filter']){_0x3b7abb[_0xd988('0x50')]=_['merge'](_0x3b7abb['where'],{'$or':_[_0xd988('0x3e')](_0x3b7abb[_0xd988('0x49')],function(_0x3180d5){var _0x41bcca={};_0x41bcca[_0x3180d5]={'$like':'%'+_0x2bb5b9[_0xd988('0x45')]['filter']+'%'};return _0x41bcca;})});}_0x3b7abb=_[_0xd988('0x52')]({},_0x3b7abb,_0x2bb5b9['options']);return _0x2d91a8[_0xd988('0xbc')](_0x3b7abb);}})[_0xd988('0x20')](function(_0x544102){if(_0x544102){_0x19c65b=_0x544102[_0xd988('0x4b')];if(!_0x2bb5b9['query'][_0xd988('0x4c')](_0xd988('0x4d'))){_0x3b7abb[_0xd988('0x31')]=qs[_0xd988('0x31')](_0x2bb5b9[_0xd988('0x45')][_0xd988('0x31')]);_0x3b7abb[_0xd988('0x2e')]=qs[_0xd988('0x2e')](_0x2bb5b9[_0xd988('0x45')][_0xd988('0x2e')]);}return _0x2d91a8['getApplications'](_0x3b7abb);}})[_0xd988('0x20')](function(_0x29a2f1){if(_0x29a2f1){return _0x29a2f1?{'count':_0x19c65b,'rows':_0x29a2f1}:null;}})[_0xd988('0x20')](respondWithResult(_0x18c981,null))['catch'](handleError(_0x18c981,null));};exports['getInteractions']=function(_0x207602,_0x5d84ad,_0x460ab7){var _0x25df74={'raw':![],'where':{}};var _0x239c62={};var _0x44dec5={'count':0x0,'rows':[]};return db[_0xd988('0x3f')][_0xd988('0x6b')]({'where':{'id':_0x207602[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x5d84ad,null))['then'](function(_0x131360){if(_0x131360){_0x239c62[_0xd988('0x44')]=_['keys'](db[_0xd988('0xa3')][_0xd988('0x40')]);_0x239c62[_0xd988('0x45')]=_[_0xd988('0x46')](_0x207602['query']);_0x239c62[_0xd988('0x47')]=_[_0xd988('0x48')](_0x239c62['model'],_0x239c62['query']);_0x25df74['attributes']=_[_0xd988('0x48')](_0x239c62['model'],qs[_0xd988('0x4a')](_0x207602[_0xd988('0x45')][_0xd988('0x4a')]));_0x25df74[_0xd988('0x49')]=_0x25df74[_0xd988('0x49')][_0xd988('0x4b')]?_0x25df74[_0xd988('0x49')]:_0x239c62[_0xd988('0x44')];if(!_0x207602[_0xd988('0x45')][_0xd988('0x4c')](_0xd988('0x4d'))){_0x25df74['limit']=qs['limit'](_0x207602['query'][_0xd988('0x31')]);_0x25df74['offset']=qs[_0xd988('0x2e')](_0x207602[_0xd988('0x45')][_0xd988('0x2e')]);}_0x25df74[_0xd988('0x4e')]=qs[_0xd988('0x4f')](_0x207602['query'][_0xd988('0x4f')]);_0x25df74['where']=qs[_0xd988('0x47')](_[_0xd988('0x51')](_0x207602[_0xd988('0x45')],_0x239c62[_0xd988('0x47')]));_0x25df74[_0xd988('0x50')]['SmsAccountId']=_0x131360['id'];if(_0x207602[_0xd988('0x45')]['filter']){_0x25df74[_0xd988('0x50')]=_[_0xd988('0x52')](_0x25df74['where'],{'$or':_[_0xd988('0x3e')](_0x25df74[_0xd988('0x49')],function(_0x43c55f){var _0x539507={};_0x539507[_0x43c55f]={'$like':'%'+_0x207602[_0xd988('0x45')][_0xd988('0x54')]+'%'};return _0x539507;})});}_0x25df74=_[_0xd988('0x52')]({},_0x25df74,_0x207602['options']);return db[_0xd988('0xa3')][_0xd988('0x30')]({'where':_0x25df74['where']})[_0xd988('0x20')](function(_0x473d43){_0x44dec5[_0xd988('0x30')]=_0x473d43;if(_0x207602[_0xd988('0x45')][_0xd988('0x56')]){_0x25df74[_0xd988('0x57')]=[{'model':db[_0xd988('0x9e')],'as':_0xd988('0xbd'),'required':![]},{'model':db[_0xd988('0xad')],'as':_0xd988('0xbe'),'attributes':[_0xd988('0x39'),'fullname',_0xd988('0xbf')],'required':![]},{'model':db[_0xd988('0xc0')],'as':_0xd988('0xc1'),'attributes':['id',_0xd988('0x39'),_0xd988('0xc2')],'where':_0x207602[_0xd988('0x45')][_0xd988('0xc3')]?{'id':_0x207602[_0xd988('0x45')][_0xd988('0xc3')]}:undefined,'required':_0x207602[_0xd988('0x45')][_0xd988('0xc3')]?!![]:![]}];}return db[_0xd988('0xa3')][_0xd988('0x58')](_0x25df74);})[_0xd988('0x20')](function(_0x7065f6){_0x44dec5[_0xd988('0x6c')]=_0x7065f6;return _0x44dec5;});}})[_0xd988('0x20')](respondWithFilteredResult(_0x5d84ad,_0x25df74))['catch'](handleError(_0x5d84ad,null));};exports[_0xd988('0x3a')]=function(_0x3168d7,_0x17e7e2,_0x2a7787){var _0x471e66,_0x3a56b7,_0x95048a;if(_[_0xd988('0x99')](_0x3168d7['body'][_0xd988('0x5b')])||_0x3168d7[_0xd988('0x5b')][_0xd988('0x5b')]===''){throw new db[(_0xd988('0x7c'))][(_0xd988('0x97'))](_0xd988('0xc4'));}if(_['isNil'](_0x3168d7[_0xd988('0x5b')]['to'])){throw new db[(_0xd988('0x7c'))][(_0xd988('0x97'))](_0xd988('0xc5'));}_0x471e66=_0x3168d7['body']['to'];return db['SmsAccount']['find']({'where':{'id':_0x3168d7[_0xd988('0x65')]['id']},'include':[{'model':db[_0xd988('0x9d')],'as':_0xd988('0xc6'),'include':[{'model':db[_0xd988('0x9e')],'as':_0xd988('0x9f'),'where':{'mobile':_0x471e66},'limit':0x1,'order':[[_0xd988('0x7e'),'DESC']]}]}]})[_0xd988('0x20')](handleEntityNotFound(_0x17e7e2,null))[_0xd988('0x20')](function(_0x3c1a6e){if(_0x3c1a6e&&_0x3c1a6e[_0xd988('0xc6')]){_0x3a56b7=_0x3c1a6e[_0xd988('0x5d')]({'plain':!![]});if(_0x3a56b7[_0xd988('0xc6')]&&_0x3a56b7[_0xd988('0xc6')]['Contacts']['length']){return _0x3a56b7['List'][_0xd988('0x9f')][0x0];}return db[_0xd988('0x9e')][_0xd988('0x5a')](_[_0xd988('0x1a')](_0x3168d7[_0xd988('0x5b')],{'firstName':_0x471e66,'mobile':_0x471e66,'phone':_0x471e66,'ListId':_0x3a56b7['ListId']}));}})[_0xd988('0x20')](handleEntityNotFound(_0x17e7e2,null))[_0xd988('0x20')](function(_0x3d7784){if(_0x3d7784){_0x95048a=_0x3d7784;return db[_0xd988('0xa3')][_0xd988('0x64')]({'where':{'ContactId':_0x95048a['id'],'closed':![],'SmsAccountId':_0x3a56b7['id']}})[_0xd988('0x20')](function(_0x2100e4){if(_0x2100e4){return[_0x2100e4,![]];}return db[_0xd988('0xa3')][_0xd988('0x5a')]({'UserId':_0x3168d7['user']['id'],'ContactId':_0x95048a['id'],'SmsAccountId':_0x3a56b7['id'],'phone':_0x471e66,'firstMsgDirection':_0xd988('0xc7'),'Messages':[_[_0xd988('0x52')](_0x3168d7[_0xd988('0x5b')],{'read':![],'body':_0x3168d7[_0xd988('0x5b')]['body'],'phone':_0x471e66,'SmsAccountId':_0x3a56b7['id'],'UserId':_0x3168d7['user']['id'],'ContactId':_0x95048a['id']})]},{'include':[{'model':db[_0xd988('0xaa')],'as':_0xd988('0xc8')}]})[_0xd988('0x20')](function(_0x2165e0){return[_0x2165e0,!![]];});});}})[_0xd988('0xa4')](function(_0x106861,_0x1d9659){if(_0x1d9659){return _0x106861;}return db[_0xd988('0xaa')][_0xd988('0x5a')](_['merge'](_0x3168d7[_0xd988('0x5b')],{'read':![],'body':_0x3168d7[_0xd988('0x5b')][_0xd988('0x5b')],'phone':_0x471e66,'SmsAccountId':_0x3a56b7['id'],'SmsInteractionId':_0x106861['id'],'UserId':_0x3168d7[_0xd988('0x5c')]['id'],'ContactId':_0x95048a['id']}))[_0xd988('0x20')](function(_0x28db8c){_0x106861['dataValues'][_0xd988('0xc8')]=[];_0x106861[_0xd988('0xc9')][_0xd988('0xc8')][_0xd988('0xca')](_0x28db8c[_0xd988('0xc9')]);return _0x106861;});})['then'](respondWithResult(_0x17e7e2,null))[_0xd988('0x2a')](handleError(_0x17e7e2,null));};exports[_0xd988('0x2b')]=function(_0x4b1f02,_0x221fc6,_0x5d2804){if(_0x4b1f02[_0xd988('0x5b')]['id']){delete _0x4b1f02[_0xd988('0x5b')]['id'];}var _0x4334ed,_0x1bc909,_0x231a65;return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0x4b1f02[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x221fc6,null))['then'](function(_0x3deb1a){if(_0x3deb1a){_0x231a65=_0x3deb1a;logger[_0xd988('0x24')](_0xd988('0x25'),_0xd988('0x2b'),_0xd988('0xcb'),_0x3deb1a[_0xd988('0x42')],util[_0xd988('0xcc')](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3deb1a['type']){case _0xd988('0x87'):if(_0x4b1f02['body']['skebby_dispatch_id']&&_0x4b1f02[_0xd988('0x5b')][_0xd988('0x2b')]){_0x1bc909=_0x4b1f02[_0xd988('0x5b')][_0xd988('0x2b')];return db[_0xd988('0xaa')][_0xd988('0x64')]({'where':{'messageId':_0x4b1f02[_0xd988('0x5b')][_0xd988('0xcd')]}});}break;case _0xd988('0xce'):if(_0x4b1f02[_0xd988('0x5b')][_0xd988('0xcf')]&&_0x4b1f02['body'][_0xd988('0xd0')]){_0x1bc909=_0x4b1f02[_0xd988('0x5b')][_0xd988('0xd0')];return db[_0xd988('0xaa')][_0xd988('0x64')]({'where':{'messageId':_0x4b1f02[_0xd988('0x5b')][_0xd988('0xcf')]}});}break;case _0xd988('0x8a'):if(_0x4b1f02['body'][_0xd988('0xd1')]&&_0x4b1f02[_0xd988('0x5b')][_0xd988('0xd2')]){_0x1bc909=_0x4b1f02[_0xd988('0x5b')]['status_code'];return db[_0xd988('0xaa')]['find']({'where':{'messageId':_0x4b1f02[_0xd988('0x5b')][_0xd988('0xd1')]}});}break;case'infobip':var _0x34d44b=_0x4b1f02[_0xd988('0x5b')][_0xd988('0x8e')][0x0];if(_0x34d44b['messageId']&&_0x34d44b[_0xd988('0x2b')][_0xd988('0xd3')]===_0xd988('0xd4')){_0x1bc909=_0x34d44b[_0xd988('0x2b')][_0xd988('0xd3')];return db[_0xd988('0xaa')]['find']({'where':{'messageId':_0x34d44b[_0xd988('0x85')]}});}break;case'clickatell':if(_0x4b1f02[_0xd988('0x5b')][_0xd988('0x85')]&&_0x4b1f02[_0xd988('0x5b')]['status']){_0x1bc909=_0x4b1f02[_0xd988('0x5b')][_0xd988('0x2b')];return db[_0xd988('0xaa')][_0xd988('0x64')]({'where':{'messageId':_0x4b1f02[_0xd988('0x5b')][_0xd988('0x85')]}});}break;case _0xd988('0x94'):if(_0x4b1f02['body'][0x0]['message']['id']){_0x1bc909=_0x4b1f02['body'][0x0][_0xd988('0x42')];return db[_0xd988('0xaa')]['find']({'where':{'messageId':_0x4b1f02[_0xd988('0x5b')][0x0][_0xd988('0x28')]['id']}});}break;case _0xd988('0x95'):if(_0x4b1f02[_0xd988('0x5b')][_0xd988('0xd5')]&&_0x4b1f02[_0xd988('0x5b')][_0xd988('0x2b')]){_0x1bc909=_0x4b1f02[_0xd988('0x5b')][_0xd988('0x2b')];return db[_0xd988('0xaa')][_0xd988('0x64')]({'where':{'messageId':_0x4b1f02['body'][_0xd988('0xd5')]}});}break;}}})[_0xd988('0x20')](handleEntityNotFound(_0x221fc6,null))[_0xd988('0x20')](function(_0x198b18){if(_0x198b18){_0x4334ed=_0x198b18;switch(_0x231a65[_0xd988('0x42')]){case _0xd988('0x87'):if(_0x1bc909===_0xd988('0xd4')){return _0x4334ed[_0xd988('0x63')]({'read':!![]});}else{logger[_0xd988('0x27')](_0xd988('0x25'),'status','skebby',util[_0xd988('0xcc')](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd988('0xce'):if(_0x1bc909==='1'){return _0x4334ed[_0xd988('0x63')]({'read':!![]});}else{logger[_0xd988('0x27')](_0xd988('0x25'),'status',_0xd988('0x87'),util[_0xd988('0xcc')](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd988('0x8a'):if(!_0x4b1f02[_0xd988('0x5b')][_0xd988('0xd6')]&&_0x1bc909>=0xc8&&_0x1bc909<=0xce){return _0x4334ed['update']({'read':!![]});}else{logger['error'](_0xd988('0x25'),_0xd988('0x2b'),_0xd988('0x8a'),util[_0xd988('0xcc')](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd988('0xd7'):var _0x41fbbc=_0x4b1f02[_0xd988('0x5b')][_0xd988('0x8e')][0x0];if(_0x41fbbc[_0xd988('0x2b')][_0xd988('0xd3')]===_0xd988('0xd4')){return _0x4334ed[_0xd988('0x63')]({'read':!![]});}else{logger[_0xd988('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xd988('0xd7'),util[_0xd988('0xcc')](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xd988('0x92'):if(_0x1bc909=='DELIVERED_TO_GATEWAY'||_0x1bc909=='RECEIVED_BY_RECIPIENT'){return _0x4334ed[_0xd988('0x63')]({'read':!![]});}else{logger[_0xd988('0x27')](_0xd988('0x25'),_0xd988('0x2b'),_0xd988('0x92'),util[_0xd988('0xcc')](_0x4b1f02['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x1bc909==_0xd988('0xd8')){return _0x4334ed[_0xd988('0x63')]({'read':!![]});}else{logger['error'](_0xd988('0x25'),_0xd988('0x2b'),_0xd988('0x94'),util['inspect'](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1bc909===_0xd988('0xd9')||_0x1bc909===_0xd988('0xda')){return _0x4334ed[_0xd988('0x63')]({'read':!![]});}else{logger[_0xd988('0x27')](_0xd988('0x25'),_0xd988('0x2b'),_0xd988('0x95'),util[_0xd988('0xcc')](_0x4b1f02[_0xd988('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x4334ed;}})['then'](respondWithResult(_0x221fc6,null))[_0xd988('0x2a')](handleError(_0x221fc6,null));};exports[_0xd988('0xdb')]=function(_0x2c69bd,_0x3bfd3c,_0xd4526b){var _0x1f8057,_0x6339bd,_0x121266;return db['SmsAccount']['find']({'where':{'id':_0x2c69bd['params']['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x3bfd3c,null))[_0xd988('0x20')](function(_0x38cdaa){if(_0x38cdaa){_0x121266=_0x38cdaa;logger[_0xd988('0x24')](_0xd988('0x25'),'status','received\x20delivery\x20report\x20from',_0x38cdaa['type'],util[_0xd988('0xcc')](_0x2c69bd[_0xd988('0x45')],{'showHidden':![],'depth':null}));switch(_0x38cdaa['type']){case _0xd988('0x8f'):if(_0x2c69bd['query']['message-id']&&_0x2c69bd[_0xd988('0x45')]['state']){_0x6339bd=_0x2c69bd[_0xd988('0x45')][_0xd988('0xdc')];return db[_0xd988('0xaa')][_0xd988('0x64')]({'where':{'messageId':_0x2c69bd[_0xd988('0x45')][_0xd988('0xdd')]}});}break;}}})[_0xd988('0x20')](handleEntityNotFound(_0x3bfd3c,null))['then'](function(_0x165848){if(_0x165848){_0x1f8057=_0x165848;switch(_0x121266[_0xd988('0x42')]){case _0xd988('0x8f'):if(_0x6339bd==='2'||_0x6339bd==='6'){return _0x1f8057['update']({'read':!![]});}else{logger['error'](_0xd988('0x25'),'status','csc',util[_0xd988('0xcc')](_0x2c69bd['query'],{'showHidden':![],'depth':null}));};break;}return _0x1f8057;}})[_0xd988('0x20')](respondWithResult(_0x3bfd3c,null))['catch'](handleError(_0x3bfd3c,null));};exports[_0xd988('0xde')]=function(_0x21e247,_0x1b21b8,_0x1cf553){return db['SmsAccount']['find']({'where':{'id':_0x21e247[_0xd988('0x65')]['id']}})['then'](handleEntityNotFound(_0x1b21b8,null))[_0xd988('0x20')](function(_0x3d6c82){if(_0x3d6c82){return _0x3d6c82[_0xd988('0xde')](_0x21e247[_0xd988('0x5b')][_0xd988('0x6e')],_[_0xd988('0xa1')](_0x21e247[_0xd988('0x5b')],['ids','id'])||{})[_0xd988('0xa4')](function(_0x534e5a){for(var _0x3e9dd6=0x0;_0x3e9dd6<_0x21e247[_0xd988('0x5b')]['ids'][_0xd988('0x4b')];_0x3e9dd6+=0x1){socket[_0xd988('0xdf')](_0xd988('0xe0'),{'UserId':Number(_0x21e247[_0xd988('0x5b')][_0xd988('0x6e')][_0x3e9dd6]),'SmsAccountId':Number(_0x21e247[_0xd988('0x65')]['id'])});}return _0x534e5a;});}})[_0xd988('0x20')](respondWithResult(_0x1b21b8,null))[_0xd988('0x2a')](handleError(_0x1b21b8,null));};exports[_0xd988('0xe1')]=function(_0xbcb32,_0x56990f,_0x18ce7e){return db[_0xd988('0x3f')][_0xd988('0x64')]({'where':{'id':_0xbcb32[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x56990f,null))[_0xd988('0x20')](function(_0x3a50dc){if(_0x3a50dc){return _0x3a50dc[_0xd988('0xe1')](_0xbcb32['query']['ids'])[_0xd988('0x20')](function(){if(_['isArray'](_0xbcb32[_0xd988('0x45')][_0xd988('0x6e')])){for(var _0x1d86a7=0x0;_0x1d86a7<_0xbcb32[_0xd988('0x45')]['ids'][_0xd988('0x4b')];_0x1d86a7+=0x1){socket[_0xd988('0xdf')](_0xd988('0xe2'),{'UserId':Number(_0xbcb32[_0xd988('0x45')][_0xd988('0x6e')][_0x1d86a7]),'SmsAccountId':Number(_0xbcb32[_0xd988('0x65')]['id'])});}}else{socket[_0xd988('0xdf')](_0xd988('0xe2'),{'UserId':Number(_0xbcb32[_0xd988('0x45')][_0xd988('0x6e')]),'SmsAccountId':Number(_0xbcb32[_0xd988('0x65')]['id'])});}});}})[_0xd988('0x20')](respondWithStatusCode(_0x56990f,null))[_0xd988('0x2a')](handleError(_0x56990f,null));};exports[_0xd988('0xe3')]=function(_0x53c359,_0x11df48,_0x491047){var _0x213dab={};var _0x477157={};var _0x560ee6;var _0x18db89;return db[_0xd988('0x3f')][_0xd988('0x6b')]({'where':{'id':_0x53c359[_0xd988('0x65')]['id']}})[_0xd988('0x20')](handleEntityNotFound(_0x11df48,null))['then'](function(_0x204666){if(_0x204666){_0x560ee6=_0x204666;_0x477157[_0xd988('0x44')]=_[_0xd988('0x46')](db[_0xd988('0xad')][_0xd988('0x40')]);_0x477157[_0xd988('0x45')]=_['keys'](_0x53c359[_0xd988('0x45')]);_0x477157[_0xd988('0x47')]=_[_0xd988('0x48')](_0x477157['model'],_0x477157['query']);_0x213dab[_0xd988('0x49')]=_[_0xd988('0x48')](_0x477157['model'],qs[_0xd988('0x4a')](_0x53c359['query'][_0xd988('0x4a')]));_0x213dab['attributes']=_0x213dab[_0xd988('0x49')][_0xd988('0x4b')]?_0x213dab[_0xd988('0x49')]:_0x477157[_0xd988('0x44')];_0x213dab[_0xd988('0x4e')]=qs[_0xd988('0x4f')](_0x53c359['query'][_0xd988('0x4f')]);_0x213dab[_0xd988('0x50')]=qs[_0xd988('0x47')](_[_0xd988('0x51')](_0x53c359[_0xd988('0x45')],_0x477157[_0xd988('0x47')]));if(_0x53c359[_0xd988('0x45')]['filter']){_0x213dab[_0xd988('0x50')]=_[_0xd988('0x52')](_0x213dab['where'],{'$or':_[_0xd988('0x3e')](_0x213dab[_0xd988('0x49')],function(_0x41d311){var _0x1e33b0={};_0x1e33b0[_0x41d311]={'$like':'%'+_0x53c359[_0xd988('0x45')][_0xd988('0x54')]+'%'};return _0x1e33b0;})});}_0x213dab=_['merge']({},_0x213dab,_0x53c359[_0xd988('0x55')]);return _0x560ee6[_0xd988('0xe3')](_0x213dab);}})[_0xd988('0x20')](function(_0x3229ca){if(_0x3229ca){_0x18db89=_0x3229ca[_0xd988('0x4b')];if(!_0x53c359[_0xd988('0x45')]['hasOwnProperty']('nolimit')){_0x213dab['limit']=qs[_0xd988('0x31')](_0x53c359['query'][_0xd988('0x31')]);_0x213dab[_0xd988('0x2e')]=qs[_0xd988('0x2e')](_0x53c359[_0xd988('0x45')][_0xd988('0x2e')]);}return _0x560ee6[_0xd988('0xe3')](_0x213dab);}})[_0xd988('0x20')](function(_0x58ffcf){if(_0x58ffcf){return _0x58ffcf?{'count':_0x18db89,'rows':_0x58ffcf}:null;}})['then'](respondWithResult(_0x11df48,null))['catch'](handleError(_0x11df48,null));};
\ No newline at end of file
+var _0xa023=['reject','save','then','destroy','SmsAccounts','end','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','update','body','describe','addDisposition','SmsAccountId','getDispositions','Disposition','order','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','from','sender','clicksend','message_id','plivo','infobip','text','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','Contacts','DESC','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','User','Owner','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','connectel','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x33e4f2,_0x760009){var _0xb32415=function(_0x226dcd){while(--_0x226dcd){_0x33e4f2['push'](_0x33e4f2['shift']());}};_0xb32415(++_0x760009);}(_0xa023,0x18d));var _0x3a02=function(_0x31e391,_0x211e7a){_0x31e391=_0x31e391-0x0;var _0x2090cd=_0xa023[_0x31e391];return _0x2090cd;};'use strict';var emlformat=require(_0x3a02('0x0'));var rimraf=require(_0x3a02('0x1'));var zipdir=require(_0x3a02('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3a02('0x3'));var BPromise=require(_0x3a02('0x4'));var Mustache=require(_0x3a02('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3a02('0x6'));var csv=require(_0x3a02('0x7'));var ejs=require(_0x3a02('0x8'));var fs=require('fs');var fs_extra=require(_0x3a02('0x9'));var _=require(_0x3a02('0xa'));var squel=require(_0x3a02('0xb'));var crypto=require(_0x3a02('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3a02('0x7'));var querystring=require(_0x3a02('0xd'));var Papa=require(_0x3a02('0xe'));var Redis=require(_0x3a02('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a02('0x10'));var hardwareService=require(_0x3a02('0x11'));var logger=require(_0x3a02('0x12'))(_0x3a02('0x13'));var utils=require(_0x3a02('0x14'));var config=require(_0x3a02('0x15'));var licenseUtil=require(_0x3a02('0x16'));var db=require('../../mysqldb')['db'];config[_0x3a02('0x17')]=_[_0x3a02('0x18')](config[_0x3a02('0x17')],{'host':_0x3a02('0x19'),'port':0x18eb});var socket=require(_0x3a02('0x1a'))(new Redis(config[_0x3a02('0x17')]));require(_0x3a02('0x1b'))[_0x3a02('0x1c')](socket);var jayson=require(_0x3a02('0x1d'));var client=jayson['client'][_0x3a02('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x5d7b7e,_0x17909a,_0x38275e,_0x518d44){return new BPromise(function(_0x57d7b9,_0x2394dd){var _0x33d06d=_0x518d44||client;return _0x33d06d[_0x3a02('0x1f')](_0x5d7b7e,_0x38275e)['then'](function(_0x377983){logger[_0x3a02('0x20')](_0x3a02('0x21'),_0x17909a,_0x3a02('0x22'));logger[_0x3a02('0x23')](_0x3a02('0x24'),_0x17909a,'request\x20sent',JSON[_0x3a02('0x25')](_0x377983));if(_0x377983[_0x3a02('0x26')]){if(_0x377983['error']['code']===0x1f4){logger[_0x3a02('0x26')](_0x3a02('0x21'),_0x17909a,_0x377983[_0x3a02('0x26')][_0x3a02('0x27')]);return _0x2394dd(_0x377983[_0x3a02('0x26')][_0x3a02('0x27')]);}logger[_0x3a02('0x26')](_0x3a02('0x21'),_0x17909a,_0x377983['error'][_0x3a02('0x27')]);return _0x57d7b9(_0x377983[_0x3a02('0x26')]['message']);}else{logger[_0x3a02('0x20')](_0x3a02('0x21'),_0x17909a,_0x3a02('0x22'));_0x57d7b9(_0x377983[_0x3a02('0x28')]['message']);}})[_0x3a02('0x29')](function(_0x3f08e7){logger['error']('SmsAccount,\x20%s,\x20%s',_0x17909a,_0x3f08e7);_0x2394dd(_0x3f08e7);});});}function respondWithStatusCode(_0x4cbb42,_0x584e80){_0x584e80=_0x584e80||0xcc;return function(_0x33e6a1){if(_0x33e6a1){return _0x4cbb42['sendStatus'](_0x584e80);}return _0x4cbb42[_0x3a02('0x2a')](_0x584e80)['end']();};}function respondWithResult(_0x539d24,_0xaf08bb){_0xaf08bb=_0xaf08bb||0xc8;return function(_0x2bcea2){if(_0x2bcea2){return _0x539d24[_0x3a02('0x2a')](_0xaf08bb)[_0x3a02('0x2b')](_0x2bcea2);}};}function respondWithFilteredResult(_0xca0147,_0x449067){return function(_0x53bbd3){if(_0x53bbd3){var _0x3cff2e=typeof _0x449067[_0x3a02('0x2c')]===_0x3a02('0x2d')&&typeof _0x449067[_0x3a02('0x2e')]===_0x3a02('0x2d');var _0x100eaa=_0x53bbd3[_0x3a02('0x2f')];var _0x45e89e=_0x3cff2e?0x0:_0x449067['offset'];var _0xd4a75c=_0x3cff2e?_0x53bbd3['count']:_0x449067[_0x3a02('0x2c')]+_0x449067['limit'];var _0x4d882e;if(_0xd4a75c>=_0x100eaa){_0xd4a75c=_0x100eaa;_0x4d882e=0xc8;}else{_0x4d882e=0xce;}_0xca0147['status'](_0x4d882e);return _0xca0147[_0x3a02('0x30')](_0x3a02('0x31'),_0x45e89e+'-'+_0xd4a75c+'/'+_0x100eaa)[_0x3a02('0x2b')](_0x53bbd3);}return null;};}function patchUpdates(_0x549483){return function(_0x334c5){try{jsonpatch[_0x3a02('0x32')](_0x334c5,_0x549483,!![]);}catch(_0x2fd30b){return BPromise[_0x3a02('0x33')](_0x2fd30b);}return _0x334c5[_0x3a02('0x34')]();};}function saveUpdates(_0x1b92ee,_0x4626dd){return function(_0x428793){if(_0x428793){return _0x428793['update'](_0x1b92ee)[_0x3a02('0x35')](function(_0x3eec96){return _0x3eec96;});}return null;};}function removeEntity(_0x26ed75,_0x45e978){return function(_0x2d2e7f){if(_0x2d2e7f){return _0x2d2e7f[_0x3a02('0x36')]()[_0x3a02('0x35')](function(){var _0x114081=_0x2d2e7f['get']({'plain':!![]});var _0x116cf0=_0x3a02('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x116cf0,'resourceId':_0x114081['id']}})[_0x3a02('0x35')](function(){return _0x2d2e7f;});})[_0x3a02('0x35')](function(){_0x26ed75[_0x3a02('0x2a')](0xcc)[_0x3a02('0x38')]();});}};}function handleEntityNotFound(_0xcfd568,_0x2b8a9d){return function(_0x13cd23){if(!_0x13cd23){_0xcfd568['sendStatus'](0x194);}return _0x13cd23;};}function handleError(_0x1ca260,_0x423cbf){_0x423cbf=_0x423cbf||0x1f4;return function(_0x108271){logger[_0x3a02('0x26')](_0x108271['stack']);if(_0x108271[_0x3a02('0x39')]){delete _0x108271[_0x3a02('0x39')];}_0x1ca260['status'](_0x423cbf)[_0x3a02('0x3a')](_0x108271);};}exports[_0x3a02('0x3b')]=function(_0xf852a2,_0x497c6d){var _0x1917fd={'include':[{'model':db[_0x3a02('0x3c')],'as':_0x3a02('0x3d')}]},_0x906bb0={},_0x1564d6={'count':0x0,'rows':[]};var _0x45bb7c=_[_0x3a02('0x3e')](db[_0x3a02('0x3f')][_0x3a02('0x40')],function(_0x54b7a3){return{'name':_0x54b7a3[_0x3a02('0x41')],'type':_0x54b7a3[_0x3a02('0x42')][_0x3a02('0x43')]};});_0x906bb0[_0x3a02('0x44')]=_['map'](_0x45bb7c,_0x3a02('0x39'));_0x906bb0[_0x3a02('0x45')]=_['keys'](_0xf852a2[_0x3a02('0x45')]);_0x906bb0[_0x3a02('0x46')]=_['intersection'](_0x906bb0[_0x3a02('0x44')],_0x906bb0[_0x3a02('0x45')]);_0x1917fd[_0x3a02('0x47')]=_[_0x3a02('0x48')](_0x906bb0[_0x3a02('0x44')],qs[_0x3a02('0x49')](_0xf852a2[_0x3a02('0x45')][_0x3a02('0x49')]));_0x1917fd[_0x3a02('0x47')]=_0x1917fd[_0x3a02('0x47')][_0x3a02('0x4a')]?_0x1917fd[_0x3a02('0x47')]:_0x906bb0[_0x3a02('0x44')];if(!_0xf852a2['query'][_0x3a02('0x4b')](_0x3a02('0x4c'))){_0x1917fd[_0x3a02('0x2e')]=qs[_0x3a02('0x2e')](_0xf852a2[_0x3a02('0x45')][_0x3a02('0x2e')]);_0x1917fd[_0x3a02('0x2c')]=qs[_0x3a02('0x2c')](_0xf852a2[_0x3a02('0x45')][_0x3a02('0x2c')]);}_0x1917fd['order']=qs['sort'](_0xf852a2[_0x3a02('0x45')][_0x3a02('0x4d')]);_0x1917fd[_0x3a02('0x4e')]=qs['filters'](_[_0x3a02('0x4f')](_0xf852a2[_0x3a02('0x45')],_0x906bb0[_0x3a02('0x46')]),_0x45bb7c);if(_0xf852a2['query'][_0x3a02('0x50')]){_0x1917fd[_0x3a02('0x4e')]=_[_0x3a02('0x51')](_0x1917fd[_0x3a02('0x4e')],{'$or':_[_0x3a02('0x3e')](_0x45bb7c,function(_0x445040){if(_0x445040[_0x3a02('0x42')]!=='VIRTUAL'){var _0x250193={};_0x250193[_0x445040[_0x3a02('0x39')]]={'$like':'%'+_0xf852a2[_0x3a02('0x45')]['filter']+'%'};return _0x250193;}})});}_0x1917fd=_[_0x3a02('0x51')]({},_0x1917fd,_0xf852a2[_0x3a02('0x52')]);var _0x4375b2={'where':_0x1917fd[_0x3a02('0x4e')]};return db['SmsAccount'][_0x3a02('0x2f')](_0x4375b2)['then'](function(_0x217f43){_0x1564d6[_0x3a02('0x2f')]=_0x217f43;if(_0xf852a2[_0x3a02('0x45')][_0x3a02('0x53')]){_0x1917fd[_0x3a02('0x54')]=[{'all':!![]}];}return db['SmsAccount'][_0x3a02('0x55')](_0x1917fd);})[_0x3a02('0x35')](function(_0x318987){_0x1564d6[_0x3a02('0x56')]=_0x318987;return _0x1564d6;})[_0x3a02('0x35')](respondWithFilteredResult(_0x497c6d,_0x1917fd))[_0x3a02('0x29')](handleError(_0x497c6d,null));};exports[_0x3a02('0x57')]=function(_0x202253,_0x4eaa9e){var _0x27e53f={'raw':![],'where':{'id':_0x202253[_0x3a02('0x58')]['id']},'include':[{'model':db[_0x3a02('0x3c')],'as':_0x3a02('0x3d')}]},_0x201eaa={};_0x201eaa[_0x3a02('0x44')]=_['keys'](db[_0x3a02('0x3f')][_0x3a02('0x40')]);_0x201eaa['query']=_[_0x3a02('0x59')](_0x202253[_0x3a02('0x45')]);_0x201eaa[_0x3a02('0x46')]=_['intersection'](_0x201eaa[_0x3a02('0x44')],_0x201eaa[_0x3a02('0x45')]);_0x27e53f[_0x3a02('0x47')]=_[_0x3a02('0x48')](_0x201eaa[_0x3a02('0x44')],qs['fields'](_0x202253[_0x3a02('0x45')]['fields']));_0x27e53f['attributes']=_0x27e53f['attributes'][_0x3a02('0x4a')]?_0x27e53f[_0x3a02('0x47')]:_0x201eaa[_0x3a02('0x44')];if(_0x202253['query']['includeAll']){_0x27e53f[_0x3a02('0x54')]=[{'all':!![]}];}_0x27e53f=_[_0x3a02('0x51')]({},_0x27e53f,_0x202253['options']);return db['SmsAccount'][_0x3a02('0x5a')](_0x27e53f)[_0x3a02('0x35')](handleEntityNotFound(_0x4eaa9e,null))[_0x3a02('0x35')](respondWithResult(_0x4eaa9e,null))[_0x3a02('0x29')](handleError(_0x4eaa9e,null));};exports['create']=function(_0x4c1613,_0x369363){return db[_0x3a02('0x3f')][_0x3a02('0x5b')](_0x4c1613['body'],{})[_0x3a02('0x35')](function(_0x1e5350){var _0xe8bf47=_0x4c1613[_0x3a02('0x5c')][_0x3a02('0x5d')]({'plain':!![]});if(!_0xe8bf47)throw new Error(_0x3a02('0x5e'));if(_0xe8bf47[_0x3a02('0x5f')]==='user'){var _0x21b599=_0x1e5350[_0x3a02('0x5d')]({'plain':!![]});var _0x5bd06c=_0x3a02('0x37');return db[_0x3a02('0x60')][_0x3a02('0x5a')]({'where':{'name':_0x5bd06c,'userProfileId':_0xe8bf47['userProfileId']},'raw':!![]})[_0x3a02('0x35')](function(_0x20ab3e){if(_0x20ab3e&&_0x20ab3e[_0x3a02('0x61')]===0x0){return db[_0x3a02('0x62')][_0x3a02('0x5b')]({'name':_0x21b599[_0x3a02('0x39')],'resourceId':_0x21b599['id'],'type':_0x20ab3e[_0x3a02('0x39')],'sectionId':_0x20ab3e['id']},{})[_0x3a02('0x35')](function(){return _0x1e5350;});}else{return _0x1e5350;}})['catch'](function(_0x4833e0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4833e0);throw _0x4833e0;});}return _0x1e5350;})[_0x3a02('0x35')](respondWithResult(_0x369363,0xc9))[_0x3a02('0x29')](handleError(_0x369363,null));};exports[_0x3a02('0x63')]=function(_0x14d667,_0x2c771){if(_0x14d667['body']['id']){delete _0x14d667[_0x3a02('0x64')]['id'];}return db[_0x3a02('0x3f')]['find']({'where':{'id':_0x14d667['params']['id']},'include':[{'model':db[_0x3a02('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2c771,null))['then'](saveUpdates(_0x14d667[_0x3a02('0x64')],null))[_0x3a02('0x35')](respondWithResult(_0x2c771,null))['catch'](handleError(_0x2c771,null));};exports[_0x3a02('0x36')]=function(_0x5714da,_0x297e8e){return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x5714da[_0x3a02('0x58')]['id']}})['then'](handleEntityNotFound(_0x297e8e,null))['then'](removeEntity(_0x297e8e,null))[_0x3a02('0x29')](handleError(_0x297e8e,null));};exports[_0x3a02('0x65')]=function(_0x5bdf04,_0x2d8492){return db[_0x3a02('0x3f')]['describe']()[_0x3a02('0x35')](respondWithResult(_0x2d8492,null))[_0x3a02('0x29')](handleError(_0x2d8492,null));};exports[_0x3a02('0x66')]=function(_0x26f951,_0x3c568c,_0x4ef3c8){if(_0x26f951['body']['id']){delete _0x26f951[_0x3a02('0x64')]['id'];}return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x26f951[_0x3a02('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c568c,null))[_0x3a02('0x35')](function(_0x520a7c){if(_0x520a7c){_0x26f951[_0x3a02('0x64')][_0x3a02('0x67')]=_0x520a7c['id'];return db['Disposition'][_0x3a02('0x5b')](_0x26f951['body']);}})[_0x3a02('0x35')](respondWithResult(_0x3c568c,null))[_0x3a02('0x29')](handleError(_0x3c568c,null));};exports[_0x3a02('0x68')]=function(_0xa23ad0,_0x419d84,_0x16a6bb){var _0x35b07a={'raw':![],'where':{}};var _0x4c793b={};var _0xa4d4ee={'count':0x0,'rows':[]};return db[_0x3a02('0x3f')]['findOne']({'where':{'id':_0xa23ad0[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x419d84,null))[_0x3a02('0x35')](function(_0x19f23f){if(_0x19f23f){_0x4c793b['model']=_[_0x3a02('0x59')](db[_0x3a02('0x69')][_0x3a02('0x40')]);_0x4c793b['query']=_[_0x3a02('0x59')](_0xa23ad0['query']);_0x4c793b['filters']=_['intersection'](_0x4c793b[_0x3a02('0x44')],_0x4c793b[_0x3a02('0x45')]);_0x35b07a['attributes']=_['intersection'](_0x4c793b[_0x3a02('0x44')],qs[_0x3a02('0x49')](_0xa23ad0['query'][_0x3a02('0x49')]));_0x35b07a[_0x3a02('0x47')]=_0x35b07a[_0x3a02('0x47')][_0x3a02('0x4a')]?_0x35b07a[_0x3a02('0x47')]:_0x4c793b[_0x3a02('0x44')];if(!_0xa23ad0[_0x3a02('0x45')]['hasOwnProperty'](_0x3a02('0x4c'))){_0x35b07a['limit']=qs['limit'](_0xa23ad0[_0x3a02('0x45')][_0x3a02('0x2e')]);_0x35b07a[_0x3a02('0x2c')]=qs[_0x3a02('0x2c')](_0xa23ad0[_0x3a02('0x45')][_0x3a02('0x2c')]);}_0x35b07a[_0x3a02('0x6a')]=qs[_0x3a02('0x4d')](_0xa23ad0[_0x3a02('0x45')][_0x3a02('0x4d')]);_0x35b07a[_0x3a02('0x4e')]=qs[_0x3a02('0x46')](_[_0x3a02('0x4f')](_0xa23ad0[_0x3a02('0x45')],_0x4c793b[_0x3a02('0x46')]));_0x35b07a[_0x3a02('0x4e')]['SmsAccountId']=_0x19f23f['id'];if(_0xa23ad0[_0x3a02('0x45')][_0x3a02('0x50')]){_0x35b07a[_0x3a02('0x4e')]=_[_0x3a02('0x51')](_0x35b07a[_0x3a02('0x4e')],{'$or':_[_0x3a02('0x3e')](_0x35b07a[_0x3a02('0x47')],function(_0x5f1e97){var _0x4db8b3={};_0x4db8b3[_0x5f1e97]={'$like':'%'+_0xa23ad0[_0x3a02('0x45')]['filter']+'%'};return _0x4db8b3;})});}_0x35b07a=_[_0x3a02('0x51')]({},_0x35b07a,_0xa23ad0[_0x3a02('0x52')]);return db[_0x3a02('0x69')][_0x3a02('0x2f')]({'where':_0x35b07a[_0x3a02('0x4e')]})[_0x3a02('0x35')](function(_0x108fe3){_0xa4d4ee[_0x3a02('0x2f')]=_0x108fe3;if(_0xa23ad0[_0x3a02('0x45')]['includeAll']){_0x35b07a[_0x3a02('0x54')]=[{'all':!![]}];}return db[_0x3a02('0x69')]['findAll'](_0x35b07a);})[_0x3a02('0x35')](function(_0x3e2a23){_0xa4d4ee[_0x3a02('0x56')]=_0x3e2a23;return _0xa4d4ee;});}})[_0x3a02('0x35')](respondWithFilteredResult(_0x419d84,_0x35b07a))[_0x3a02('0x29')](handleError(_0x419d84,null));};exports[_0x3a02('0x6b')]=function(_0x2ffb04,_0x55dd43,_0x219d6e){return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x2ffb04[_0x3a02('0x58')]['id']}})['then'](handleEntityNotFound(_0x55dd43,null))[_0x3a02('0x35')](function(_0x4c25a8){if(_0x4c25a8){return _0x4c25a8[_0x3a02('0x6b')](_0x2ffb04[_0x3a02('0x45')][_0x3a02('0x6c')]);}})[_0x3a02('0x35')](respondWithStatusCode(_0x55dd43,null))['catch'](handleError(_0x55dd43,null));};exports['addAnswer']=function(_0x5c616f,_0x23faf3,_0x1bc338){if(_0x5c616f['body']['id']){delete _0x5c616f[_0x3a02('0x64')]['id'];}return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x5c616f[_0x3a02('0x58')]['id']}})['then'](handleEntityNotFound(_0x23faf3,null))[_0x3a02('0x35')](function(_0x363c7e){if(_0x363c7e){_0x5c616f[_0x3a02('0x64')][_0x3a02('0x67')]=_0x363c7e['id'];return db[_0x3a02('0x6d')][_0x3a02('0x5b')](_0x5c616f['body']);}})['then'](respondWithResult(_0x23faf3,null))[_0x3a02('0x29')](handleError(_0x23faf3,null));};exports['getAnswers']=function(_0x30e6b3,_0x4cc06f,_0x483960){var _0x9ac36d={'raw':![],'where':{}};var _0x3a9add={};var _0x48900a={'count':0x0,'rows':[]};return db[_0x3a02('0x3f')][_0x3a02('0x6e')]({'where':{'id':_0x30e6b3[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x4cc06f,null))[_0x3a02('0x35')](function(_0x16b259){if(_0x16b259){_0x3a9add[_0x3a02('0x44')]=_[_0x3a02('0x59')](db['CannedAnswer']['rawAttributes']);_0x3a9add['query']=_[_0x3a02('0x59')](_0x30e6b3[_0x3a02('0x45')]);_0x3a9add['filters']=_['intersection'](_0x3a9add[_0x3a02('0x44')],_0x3a9add[_0x3a02('0x45')]);_0x9ac36d[_0x3a02('0x47')]=_[_0x3a02('0x48')](_0x3a9add[_0x3a02('0x44')],qs[_0x3a02('0x49')](_0x30e6b3[_0x3a02('0x45')][_0x3a02('0x49')]));_0x9ac36d[_0x3a02('0x47')]=_0x9ac36d['attributes'][_0x3a02('0x4a')]?_0x9ac36d[_0x3a02('0x47')]:_0x3a9add['model'];if(!_0x30e6b3['query']['hasOwnProperty']('nolimit')){_0x9ac36d['limit']=qs[_0x3a02('0x2e')](_0x30e6b3['query']['limit']);_0x9ac36d[_0x3a02('0x2c')]=qs[_0x3a02('0x2c')](_0x30e6b3[_0x3a02('0x45')]['offset']);}_0x9ac36d[_0x3a02('0x6a')]=qs['sort'](_0x30e6b3['query'][_0x3a02('0x4d')]);_0x9ac36d['where']=qs[_0x3a02('0x46')](_['pick'](_0x30e6b3[_0x3a02('0x45')],_0x3a9add['filters']));_0x9ac36d[_0x3a02('0x4e')][_0x3a02('0x67')]=_0x16b259['id'];if(_0x30e6b3[_0x3a02('0x45')][_0x3a02('0x50')]){_0x9ac36d[_0x3a02('0x4e')]=_[_0x3a02('0x51')](_0x9ac36d[_0x3a02('0x4e')],{'$or':_[_0x3a02('0x3e')](_0x9ac36d[_0x3a02('0x47')],function(_0x593b7d){var _0x420971={};_0x420971[_0x593b7d]={'$like':'%'+_0x30e6b3[_0x3a02('0x45')][_0x3a02('0x50')]+'%'};return _0x420971;})});}_0x9ac36d=_['merge']({},_0x9ac36d,_0x30e6b3[_0x3a02('0x52')]);return db[_0x3a02('0x6d')][_0x3a02('0x2f')]({'where':_0x9ac36d[_0x3a02('0x4e')]})[_0x3a02('0x35')](function(_0x2cd164){_0x48900a[_0x3a02('0x2f')]=_0x2cd164;if(_0x30e6b3['query']['includeAll']){_0x9ac36d['include']=[{'all':!![]}];}return db[_0x3a02('0x6d')][_0x3a02('0x55')](_0x9ac36d);})[_0x3a02('0x35')](function(_0x2f9156){_0x48900a['rows']=_0x2f9156;return _0x48900a;});}})['then'](respondWithFilteredResult(_0x4cc06f,_0x9ac36d))[_0x3a02('0x29')](handleError(_0x4cc06f,null));};exports[_0x3a02('0x6f')]=function(_0x2df2eb,_0x4d3e45,_0x4b2e3a){return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x2df2eb[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x4d3e45,null))[_0x3a02('0x35')](function(_0x3b5de4){if(_0x3b5de4){return _0x3b5de4['removeAnswers'](_0x2df2eb[_0x3a02('0x45')][_0x3a02('0x6c')]);}})[_0x3a02('0x35')](respondWithStatusCode(_0x4d3e45,null))[_0x3a02('0x29')](handleError(_0x4d3e45,null));};exports['notify']=function(_0x111b7a,_0x1d87b0,_0xc038d6){var _0x1b2f37={'channel':_0x3a02('0x70')};var _0x5b9e0d=[];var _0x47e428=[];var _0x51159f={};return db['SmsAccount']['find']({'where':{'id':_0x111b7a[_0x3a02('0x58')]['id']},'include':[{'model':db[_0x3a02('0x71')],'as':_0x3a02('0x72')}]})['then'](handleEntityNotFound(_0x1d87b0,null))[_0x3a02('0x35')](function(_0x2528bd){_0x1b2f37[_0x3a02('0x73')]=_0x2528bd;_0x1b2f37[_0x3a02('0x74')]=_[_0x3a02('0x75')](_0x2528bd[_0x3a02('0x72')],[_0x3a02('0x76')],[_0x3a02('0x77')]);if(_0x1b2f37[_0x3a02('0x73')]['Applications']){delete _0x1b2f37[_0x3a02('0x73')][_0x3a02('0x72')];}return db[_0x3a02('0x78')][_0x3a02('0x65')]();})[_0x3a02('0x35')](function(_0x18cb6a){if(!_0x18cb6a){throw new db[(_0x3a02('0x79'))][(_0x3a02('0x7a'))](_0x3a02('0x7b'));}_0x5b9e0d=_[_0x3a02('0x7c')](_[_0x3a02('0x59')](_0x18cb6a),[_0x3a02('0x7d'),_0x3a02('0x7e')]);_0x47e428=_[_0x3a02('0x7c')](_[_0x3a02('0x59')](_0x18cb6a),[_0x3a02('0x7d'),_0x3a02('0x7e'),_0x3a02('0x7f'),_0x3a02('0x80')]);_0x1b2f37['body']={'mapKey':_0x3a02('0x81')};if(_0x1b2f37[_0x3a02('0x73')][_0x3a02('0x42')]){switch(_0x1b2f37[_0x3a02('0x73')][_0x3a02('0x42')]){case _0x3a02('0x82'):_0x1b2f37['body']['from']=_0x111b7a['body'][_0x3a02('0x83')];_0x1b2f37[_0x3a02('0x64')]['body']=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x84')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x85')]=_0x111b7a['body']['MessageSid'];break;case'skebby':_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')]='+'+_0x111b7a[_0x3a02('0x64')][_0x3a02('0x87')];_0x1b2f37['body'][_0x3a02('0x64')]=_0x111b7a['body']['text'];break;case'connectel':_0x1b2f37[_0x3a02('0x64')]['from']=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x86')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x64')]=_0x111b7a['body'][_0x3a02('0x27')];break;case _0x3a02('0x88'):_0x1b2f37[_0x3a02('0x64')]['from']=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x86')];_0x1b2f37[_0x3a02('0x64')]['body']=_0x111b7a['body'][_0x3a02('0x64')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x85')]=_0x111b7a['body'][_0x3a02('0x89')];break;case _0x3a02('0x8a'):_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')]=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x83')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x64')]=_0x111b7a[_0x3a02('0x64')]['Text'];_0x1b2f37[_0x3a02('0x64')]['messageId']=_0x111b7a[_0x3a02('0x64')]['MessageUUID'];break;case _0x3a02('0x8b'):_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')]='+'+_0x111b7a[_0x3a02('0x64')]['results'][0x0][_0x3a02('0x86')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x64')]=_0x111b7a[_0x3a02('0x64')]['results'][0x0][_0x3a02('0x8c')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x85')]=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x8d')][0x0][_0x3a02('0x85')];break;case _0x3a02('0x8e'):_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')]=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x8f')];_0x1b2f37['body'][_0x3a02('0x64')]=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x90')][_0x3a02('0x27')];break;case _0x3a02('0x91'):_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')]=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x92')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x64')]=_0x111b7a['body'][_0x3a02('0x8c')];_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x85')]=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x93')];break;case'bandwidth':_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x85')]=_0x111b7a[_0x3a02('0x64')][0x0][_0x3a02('0x27')]['id'];_0x1b2f37['body']['from']=_0x111b7a[_0x3a02('0x64')][0x0][_0x3a02('0x27')][_0x3a02('0x86')];_0x1b2f37['body'][_0x3a02('0x64')]=_0x111b7a[_0x3a02('0x64')][0x0]['message']['text'];break;case _0x3a02('0x94'):_0x1b2f37[_0x3a02('0x64')]['from']=_0x111b7a[_0x3a02('0x64')][_0x3a02('0x86')];_0x1b2f37['body'][_0x3a02('0x64')]=_0x111b7a['body']['message'];_0x1b2f37['body'][_0x3a02('0x85')]=_0x111b7a[_0x3a02('0x64')]['refid'];break;}}if(_0x1b2f37['body']['id']){delete _0x1b2f37['body']['id'];}if(_[_0x3a02('0x95')](_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')])){throw new db[(_0x3a02('0x79'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x3a02('0x95')](_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x64')])||_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x64')]===''){throw new db[(_0x3a02('0x79'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1b2f37['body']['mapKey'])){throw new db[(_0x3a02('0x79'))][(_0x3a02('0x7a'))](_0x3a02('0x96')+_0x47e428);}if(!_[_0x3a02('0x97')](_0x47e428,_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x98')])){throw new db[(_0x3a02('0x79'))][(_0x3a02('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47e428);}_0x51159f[_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x98')]]=_0x1b2f37['body'][_0x3a02('0x86')];return db['CmList'][_0x3a02('0x5a')]({'where':{'id':_0x1b2f37[_0x3a02('0x73')][_0x3a02('0x80')]},'include':[{'model':db[_0x3a02('0x78')],'as':_0x3a02('0x99'),'where':_0x51159f,'limit':0x1,'order':[[_0x3a02('0x7e'),_0x3a02('0x9a')]]}]});})[_0x3a02('0x35')](handleEntityNotFound(_0x1d87b0,null))[_0x3a02('0x35')](function(_0x3e3075){if(_0x3e3075){_0x1b2f37[_0x3a02('0x9b')]=_[_0x3a02('0x9c')](_0x3e3075,['Contacts']);if(_0x3e3075['Contacts'][_0x3a02('0x4a')]){return _0x3e3075[_0x3a02('0x99')][0x0];}var _0x1d204a=_[_0x3a02('0x18')](_0x1b2f37[_0x3a02('0x64')],{'firstName':_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')],'ListId':_0x3e3075['id']});_0x1d204a[_0x1b2f37['body'][_0x3a02('0x98')]]=_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x86')];return db[_0x3a02('0x78')][_0x3a02('0x5b')](_0x1d204a,{'fields':_0x5b9e0d,'raw':!![]});}})[_0x3a02('0x35')](handleEntityNotFound(_0x1d87b0,null))[_0x3a02('0x35')](function(_0x17cd2f){if(_0x17cd2f){_0x1b2f37['contact']=_0x17cd2f;var _0x36fa1d={'ContactId':_0x17cd2f['id'],'phone':_0x1b2f37[_0x3a02('0x64')]['from'],'SmsAccountId':_0x111b7a[_0x3a02('0x58')]['id']};var _0x40088a={'ContactId':_0x17cd2f['id'],'SmsAccountId':_0x111b7a[_0x3a02('0x58')]['id'],'closed':![]};return db[_0x3a02('0x9d')]['find']({'where':_0x40088a})[_0x3a02('0x35')](function(_0x4029d9){if(_0x4029d9){return[_0x4029d9,![]];}return db[_0x3a02('0x9d')][_0x3a02('0x5b')](_0x36fa1d)['then'](function(_0x24809d){return[_0x24809d,!![]];});});}})[_0x3a02('0x9e')](function(_0x5016eb,_0x4a36f5){_0x1b2f37[_0x3a02('0x9f')]=_0x5016eb[_0x3a02('0x5d')]({'plain':!![]});_0x1b2f37[_0x3a02('0x9f')][_0x3a02('0xa0')]=![];if(_0x4a36f5){if(_0x1b2f37[_0x3a02('0x73')][_0x3a02('0xa1')]){_0x1b2f37['applications'][_0x3a02('0xa2')]({'id':0x0,'priority':_0x1b2f37[_0x3a02('0x74')][_0x3a02('0x4a')]+0x1,'app':_0x3a02('0xa3'),'appdata':'unmanaged','interval':_0x3a02('0xa4')});}_0x1b2f37[_0x3a02('0x9f')][_0x3a02('0xa0')]=!![];}return db[_0x3a02('0xa5')][_0x3a02('0x5b')]({'phone':_0x1b2f37[_0x3a02('0x64')]['from'],'messageId':_0x1b2f37[_0x3a02('0x64')][_0x3a02('0x85')],'body':_0x1b2f37[_0x3a02('0x64')]['body'],'SmsAccountId':_0x111b7a[_0x3a02('0x58')]['id'],'SmsInteractionId':_0x5016eb['id'],'direction':'in','ContactId':_0x5016eb[_0x3a02('0xa6')],'AttachmentId':_0x1b2f37['body']['AttachmentId']});})[_0x3a02('0x35')](function(_0x196e48){_0x1b2f37[_0x3a02('0x27')]=_0x196e48;if(_0x1b2f37[_0x3a02('0x9f')][_0x3a02('0xa7')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1b2f37[_0x3a02('0x9f')][_0x3a02('0xa7')]}})['then'](function(_0x175091){if(_0x175091){_0x1b2f37[_0x3a02('0x74')][_0x3a02('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x175091[_0x3a02('0x39')]+','+(_0x1b2f37[_0x3a02('0x73')][_0x3a02('0xa9')]||0xa),'interval':_0x3a02('0xa4')});}return respondWithRpcPromise(_0x3a02('0xaa'),_0x3a02('0xab'),_0x1b2f37);});}return respondWithRpcPromise(_0x3a02('0xaa'),_0x3a02('0xab'),_0x1b2f37);})['then'](function(_0x1cebbd){if(_0x1cebbd){var _0x5e067c=0xc8;var _0x320783='receiveMessage';logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x320783,_0x5e067c,_0x3a02('0xac'));logger[_0x3a02('0x23')](_0x3a02('0xad'),_0x320783,_0x5e067c,_0x3a02('0xac'),JSON['stringify'](_0x1cebbd));if(_0x1b2f37['account'][_0x3a02('0x42')]==='twilio'){return _0x1d87b0[_0x3a02('0x2a')](_0x5e067c)[_0x3a02('0x30')](_0x3a02('0xae'),_0x3a02('0xaf'))[_0x3a02('0x3a')](_0x3a02('0xb0'));}else{return _0x1d87b0[_0x3a02('0x2a')](_0x5e067c)['json'](_0x1cebbd);}}})[_0x3a02('0x29')](handleError(_0x1d87b0,null));};exports[_0x3a02('0xb1')]=function(_0x80115d,_0x226a6d,_0x2f4f4a){return db[_0x3a02('0x3f')][_0x3a02('0x6e')]({'where':{'id':_0x80115d[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x226a6d,null))[_0x3a02('0x35')](function(_0x143182){if(_0x143182){return db['sequelize'][_0x3a02('0xb2')](function(_0x475958){return db[_0x3a02('0x71')][_0x3a02('0x36')]({'where':{'SmsAccountId':_0x80115d[_0x3a02('0x58')]['id']},'transaction':_0x475958})[_0x3a02('0x35')](function(_0x1858d7){var _0x3c0a52=_[_0x3a02('0x3e')](_0x80115d[_0x3a02('0x64')],function(_0x5b7ec7){_0x5b7ec7['SmsAccountId']=_0x80115d[_0x3a02('0x58')]['id'];return _0x5b7ec7;});return db[_0x3a02('0x71')][_0x3a02('0xb3')](_0x3c0a52,{'transaction':_0x475958});});})[_0x3a02('0x35')](function(){return db[_0x3a02('0x71')][_0x3a02('0xb4')]({'where':{'SmsAccountId':_0x80115d[_0x3a02('0x58')]['id']},'order':_0x3a02('0x76')});});}})[_0x3a02('0x35')](respondWithResult(_0x226a6d,null))[_0x3a02('0x29')](handleError(_0x226a6d,null));};exports[_0x3a02('0xb5')]=function(_0x71a1ca,_0xdadae1,_0x30f007){var _0x5937b5={};var _0x17e6a0={};var _0x5365fc;var _0x4cb630;return db['SmsAccount'][_0x3a02('0x6e')]({'where':{'id':_0x71a1ca[_0x3a02('0x58')]['id']}})['then'](handleEntityNotFound(_0xdadae1,null))['then'](function(_0x2521fa){if(_0x2521fa){_0x5365fc=_0x2521fa;_0x17e6a0[_0x3a02('0x44')]=_[_0x3a02('0x59')](db[_0x3a02('0x71')][_0x3a02('0x40')]);_0x17e6a0['query']=_[_0x3a02('0x59')](_0x71a1ca[_0x3a02('0x45')]);_0x17e6a0[_0x3a02('0x46')]=_[_0x3a02('0x48')](_0x17e6a0[_0x3a02('0x44')],_0x17e6a0['query']);_0x5937b5[_0x3a02('0x47')]=_[_0x3a02('0x48')](_0x17e6a0[_0x3a02('0x44')],qs['fields'](_0x71a1ca['query'][_0x3a02('0x49')]));_0x5937b5[_0x3a02('0x47')]=_0x5937b5[_0x3a02('0x47')][_0x3a02('0x4a')]?_0x5937b5[_0x3a02('0x47')]:_0x17e6a0[_0x3a02('0x44')];_0x5937b5['order']=qs[_0x3a02('0x4d')](_0x71a1ca[_0x3a02('0x45')]['sort']);_0x5937b5[_0x3a02('0x4e')]=qs[_0x3a02('0x46')](_[_0x3a02('0x4f')](_0x71a1ca[_0x3a02('0x45')],_0x17e6a0[_0x3a02('0x46')]));if(_0x71a1ca[_0x3a02('0x45')][_0x3a02('0x50')]){_0x5937b5[_0x3a02('0x4e')]=_[_0x3a02('0x51')](_0x5937b5['where'],{'$or':_[_0x3a02('0x3e')](_0x5937b5['attributes'],function(_0x2e2353){var _0x29d132={};_0x29d132[_0x2e2353]={'$like':'%'+_0x71a1ca[_0x3a02('0x45')][_0x3a02('0x50')]+'%'};return _0x29d132;})});}_0x5937b5=_['merge']({},_0x5937b5,_0x71a1ca['options']);return _0x5365fc['getApplications'](_0x5937b5);}})['then'](function(_0x17e1fa){if(_0x17e1fa){_0x4cb630=_0x17e1fa['length'];if(!_0x71a1ca['query']['hasOwnProperty'](_0x3a02('0x4c'))){_0x5937b5[_0x3a02('0x2e')]=qs['limit'](_0x71a1ca['query']['limit']);_0x5937b5[_0x3a02('0x2c')]=qs[_0x3a02('0x2c')](_0x71a1ca['query'][_0x3a02('0x2c')]);}return _0x5365fc[_0x3a02('0xb5')](_0x5937b5);}})['then'](function(_0x28a478){if(_0x28a478){return _0x28a478?{'count':_0x4cb630,'rows':_0x28a478}:null;}})[_0x3a02('0x35')](respondWithResult(_0xdadae1,null))['catch'](handleError(_0xdadae1,null));};exports[_0x3a02('0xb6')]=function(_0x3061ae,_0x2d2460,_0x3121cd){var _0xd9ead4={'raw':![],'where':{}};var _0xd94e3a={};var _0x55a908={'count':0x0,'rows':[]};return db[_0x3a02('0x3f')][_0x3a02('0x6e')]({'where':{'id':_0x3061ae['params']['id']}})['then'](handleEntityNotFound(_0x2d2460,null))[_0x3a02('0x35')](function(_0xe5dd8f){if(_0xe5dd8f){_0xd94e3a['model']=_[_0x3a02('0x59')](db[_0x3a02('0x9d')][_0x3a02('0x40')]);_0xd94e3a[_0x3a02('0x45')]=_[_0x3a02('0x59')](_0x3061ae['query']);_0xd94e3a[_0x3a02('0x46')]=_[_0x3a02('0x48')](_0xd94e3a[_0x3a02('0x44')],_0xd94e3a[_0x3a02('0x45')]);_0xd9ead4[_0x3a02('0x47')]=_[_0x3a02('0x48')](_0xd94e3a[_0x3a02('0x44')],qs[_0x3a02('0x49')](_0x3061ae[_0x3a02('0x45')][_0x3a02('0x49')]));_0xd9ead4[_0x3a02('0x47')]=_0xd9ead4['attributes']['length']?_0xd9ead4[_0x3a02('0x47')]:_0xd94e3a['model'];if(!_0x3061ae['query'][_0x3a02('0x4b')](_0x3a02('0x4c'))){_0xd9ead4[_0x3a02('0x2e')]=qs['limit'](_0x3061ae['query'][_0x3a02('0x2e')]);_0xd9ead4['offset']=qs[_0x3a02('0x2c')](_0x3061ae['query'][_0x3a02('0x2c')]);}_0xd9ead4[_0x3a02('0x6a')]=qs[_0x3a02('0x4d')](_0x3061ae[_0x3a02('0x45')][_0x3a02('0x4d')]);_0xd9ead4[_0x3a02('0x4e')]=qs[_0x3a02('0x46')](_[_0x3a02('0x4f')](_0x3061ae[_0x3a02('0x45')],_0xd94e3a[_0x3a02('0x46')]));_0xd9ead4[_0x3a02('0x4e')][_0x3a02('0x67')]=_0xe5dd8f['id'];if(_0x3061ae[_0x3a02('0x45')][_0x3a02('0x50')]){_0xd9ead4[_0x3a02('0x4e')]=_[_0x3a02('0x51')](_0xd9ead4[_0x3a02('0x4e')],{'$or':_[_0x3a02('0x3e')](_0xd9ead4[_0x3a02('0x47')],function(_0x477679){var _0x3f215c={};_0x3f215c[_0x477679]={'$like':'%'+_0x3061ae[_0x3a02('0x45')][_0x3a02('0x50')]+'%'};return _0x3f215c;})});}_0xd9ead4=_[_0x3a02('0x51')]({},_0xd9ead4,_0x3061ae['options']);return db[_0x3a02('0x9d')][_0x3a02('0x2f')]({'where':_0xd9ead4[_0x3a02('0x4e')]})[_0x3a02('0x35')](function(_0x476359){_0x55a908[_0x3a02('0x2f')]=_0x476359;if(_0x3061ae[_0x3a02('0x45')][_0x3a02('0x53')]){_0xd9ead4[_0x3a02('0x54')]=[{'model':db[_0x3a02('0x78')],'as':'Contact','required':![]},{'model':db[_0x3a02('0xb7')],'as':_0x3a02('0xb8'),'attributes':[_0x3a02('0x39'),'fullname',_0x3a02('0xb9')],'required':![]},{'model':db[_0x3a02('0xba')],'as':_0x3a02('0xbb'),'attributes':['id',_0x3a02('0x39'),_0x3a02('0xbc')],'where':_0x3061ae[_0x3a02('0x45')][_0x3a02('0xbd')]?{'id':_0x3061ae['query']['tag']}:undefined,'required':_0x3061ae[_0x3a02('0x45')][_0x3a02('0xbd')]?!![]:![]}];}return db['SmsInteraction'][_0x3a02('0x55')](_0xd9ead4);})[_0x3a02('0x35')](function(_0x50b98c){_0x55a908['rows']=_0x50b98c;return _0x55a908;});}})[_0x3a02('0x35')](respondWithFilteredResult(_0x2d2460,_0xd9ead4))[_0x3a02('0x29')](handleError(_0x2d2460,null));};exports[_0x3a02('0x3a')]=function(_0x13c899,_0x3be4c6,_0x3c2a84){var _0x5c872d,_0x1bb9b8,_0x4ace25;if(_['isNil'](_0x13c899[_0x3a02('0x64')][_0x3a02('0x64')])||_0x13c899['body'][_0x3a02('0x64')]===''){throw new db['Sequelize']['ValidationError'](_0x3a02('0xbe'));}if(_[_0x3a02('0x95')](_0x13c899[_0x3a02('0x64')]['to'])){throw new db['Sequelize'][(_0x3a02('0x7a'))](_0x3a02('0xbf'));}_0x5c872d=_0x13c899['body']['to'];return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x13c899[_0x3a02('0x58')]['id']},'include':[{'model':db[_0x3a02('0xc0')],'as':_0x3a02('0xc1'),'include':[{'model':db[_0x3a02('0x78')],'as':'Contacts','where':{'mobile':_0x5c872d},'limit':0x1,'order':[[_0x3a02('0x7e'),'DESC']]}]}]})[_0x3a02('0x35')](handleEntityNotFound(_0x3be4c6,null))[_0x3a02('0x35')](function(_0x1cfe23){if(_0x1cfe23&&_0x1cfe23['List']){_0x1bb9b8=_0x1cfe23[_0x3a02('0x5d')]({'plain':!![]});if(_0x1bb9b8[_0x3a02('0xc1')]&&_0x1bb9b8['List'][_0x3a02('0x99')]['length']){return _0x1bb9b8['List']['Contacts'][0x0];}return db[_0x3a02('0x78')][_0x3a02('0x5b')](_[_0x3a02('0x18')](_0x13c899[_0x3a02('0x64')],{'firstName':_0x5c872d,'mobile':_0x5c872d,'phone':_0x5c872d,'ListId':_0x1bb9b8[_0x3a02('0x80')]}));}})[_0x3a02('0x35')](handleEntityNotFound(_0x3be4c6,null))[_0x3a02('0x35')](function(_0x934a60){if(_0x934a60){_0x4ace25=_0x934a60;return db['SmsInteraction'][_0x3a02('0x5a')]({'where':{'ContactId':_0x4ace25['id'],'closed':![],'SmsAccountId':_0x1bb9b8['id']}})[_0x3a02('0x35')](function(_0x120256){if(_0x120256){return[_0x120256,![]];}return db[_0x3a02('0x9d')][_0x3a02('0x5b')]({'UserId':_0x13c899[_0x3a02('0x5c')]['id'],'ContactId':_0x4ace25['id'],'SmsAccountId':_0x1bb9b8['id'],'phone':_0x5c872d,'firstMsgDirection':_0x3a02('0xc2'),'Messages':[_[_0x3a02('0x51')](_0x13c899[_0x3a02('0x64')],{'read':![],'body':_0x13c899[_0x3a02('0x64')][_0x3a02('0x64')],'phone':_0x5c872d,'SmsAccountId':_0x1bb9b8['id'],'UserId':_0x13c899[_0x3a02('0x5c')]['id'],'ContactId':_0x4ace25['id']})]},{'include':[{'model':db[_0x3a02('0xa5')],'as':'Messages'}]})[_0x3a02('0x35')](function(_0x83724e){return[_0x83724e,!![]];});});}})[_0x3a02('0x9e')](function(_0xc5e0dc,_0x565c79){if(_0x565c79){return _0xc5e0dc;}return db[_0x3a02('0xa5')][_0x3a02('0x5b')](_['merge'](_0x13c899['body'],{'read':![],'body':_0x13c899[_0x3a02('0x64')][_0x3a02('0x64')],'phone':_0x5c872d,'SmsAccountId':_0x1bb9b8['id'],'SmsInteractionId':_0xc5e0dc['id'],'UserId':_0x13c899[_0x3a02('0x5c')]['id'],'ContactId':_0x4ace25['id']}))[_0x3a02('0x35')](function(_0x42fa50){_0xc5e0dc[_0x3a02('0xc3')][_0x3a02('0xc4')]=[];_0xc5e0dc[_0x3a02('0xc3')][_0x3a02('0xc4')][_0x3a02('0xa2')](_0x42fa50[_0x3a02('0xc3')]);return _0xc5e0dc;});})[_0x3a02('0x35')](respondWithResult(_0x3be4c6,null))[_0x3a02('0x29')](handleError(_0x3be4c6,null));};exports[_0x3a02('0x2a')]=function(_0x4164b4,_0x522a54,_0xda6372){if(_0x4164b4[_0x3a02('0x64')]['id']){delete _0x4164b4[_0x3a02('0x64')]['id'];}var _0x1d16d9,_0x34b54b,_0x23eba5;return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x4164b4[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x522a54,null))[_0x3a02('0x35')](function(_0x1e949a){if(_0x1e949a){_0x23eba5=_0x1e949a;logger['debug'](_0x3a02('0x24'),_0x3a02('0x2a'),_0x3a02('0xc5'),_0x1e949a['type'],util[_0x3a02('0xc6')](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));switch(_0x1e949a['type']){case _0x3a02('0xc7'):if(_0x4164b4[_0x3a02('0x64')][_0x3a02('0xc8')]&&_0x4164b4[_0x3a02('0x64')][_0x3a02('0x2a')]){_0x34b54b=_0x4164b4['body'][_0x3a02('0x2a')];return db[_0x3a02('0xa5')][_0x3a02('0x5a')]({'where':{'messageId':_0x4164b4[_0x3a02('0x64')][_0x3a02('0xc8')]}});}break;case _0x3a02('0xc9'):if(_0x4164b4[_0x3a02('0x64')][_0x3a02('0xca')]&&_0x4164b4[_0x3a02('0x64')][_0x3a02('0xcb')]){_0x34b54b=_0x4164b4[_0x3a02('0x64')][_0x3a02('0xcb')];return db['SmsMessage']['find']({'where':{'messageId':_0x4164b4['body'][_0x3a02('0xca')]}});}break;case'clicksend':if(_0x4164b4[_0x3a02('0x64')]['message_id']&&_0x4164b4[_0x3a02('0x64')]['status_code']){_0x34b54b=_0x4164b4[_0x3a02('0x64')][_0x3a02('0xcc')];return db['SmsMessage'][_0x3a02('0x5a')]({'where':{'messageId':_0x4164b4[_0x3a02('0x64')]['message_id']}});}break;case _0x3a02('0x8b'):var _0x5de64e=_0x4164b4[_0x3a02('0x64')]['results'][0x0];if(_0x5de64e[_0x3a02('0x85')]&&_0x5de64e[_0x3a02('0x2a')][_0x3a02('0xcd')]===_0x3a02('0xce')){_0x34b54b=_0x5de64e['status'][_0x3a02('0xcd')];return db[_0x3a02('0xa5')][_0x3a02('0x5a')]({'where':{'messageId':_0x5de64e[_0x3a02('0x85')]}});}break;case _0x3a02('0x91'):if(_0x4164b4[_0x3a02('0x64')][_0x3a02('0x85')]&&_0x4164b4[_0x3a02('0x64')]['status']){_0x34b54b=_0x4164b4[_0x3a02('0x64')][_0x3a02('0x2a')];return db[_0x3a02('0xa5')]['find']({'where':{'messageId':_0x4164b4['body']['messageId']}});}break;case _0x3a02('0xcf'):if(_0x4164b4[_0x3a02('0x64')][0x0]['message']['id']){_0x34b54b=_0x4164b4[_0x3a02('0x64')][0x0][_0x3a02('0x42')];return db[_0x3a02('0xa5')][_0x3a02('0x5a')]({'where':{'messageId':_0x4164b4['body'][0x0][_0x3a02('0x27')]['id']}});}break;case'intelepeer':if(_0x4164b4[_0x3a02('0x64')][_0x3a02('0xd0')]&&_0x4164b4[_0x3a02('0x64')][_0x3a02('0x2a')]){_0x34b54b=_0x4164b4[_0x3a02('0x64')]['status'];return db['SmsMessage']['find']({'where':{'messageId':_0x4164b4[_0x3a02('0x64')][_0x3a02('0xd0')]}});}break;}}})[_0x3a02('0x35')](handleEntityNotFound(_0x522a54,null))[_0x3a02('0x35')](function(_0x40a82b){if(_0x40a82b){_0x1d16d9=_0x40a82b;switch(_0x23eba5[_0x3a02('0x42')]){case _0x3a02('0xc7'):if(_0x34b54b==='DELIVERED'){return _0x1d16d9[_0x3a02('0x63')]({'read':!![]});}else{logger[_0x3a02('0x26')](_0x3a02('0x24'),'status',_0x3a02('0xc7'),util[_0x3a02('0xc6')](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x34b54b==='1'){return _0x1d16d9[_0x3a02('0x63')]({'read':!![]});}else{logger[_0x3a02('0x26')](_0x3a02('0x24'),'status',_0x3a02('0xc7'),util['inspect'](_0x4164b4['body'],{'showHidden':![],'depth':null}));}break;case _0x3a02('0x88'):if(!_0x4164b4['body'][_0x3a02('0xd1')]&&_0x34b54b>=0xc8&&_0x34b54b<=0xce){return _0x1d16d9[_0x3a02('0x63')]({'read':!![]});}else{logger[_0x3a02('0x26')](_0x3a02('0x24'),_0x3a02('0x2a'),_0x3a02('0x88'),util[_0x3a02('0xc6')](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));}break;case _0x3a02('0x8b'):var _0x2ac322=_0x4164b4[_0x3a02('0x64')][_0x3a02('0x8d')][0x0];if(_0x2ac322[_0x3a02('0x2a')][_0x3a02('0xcd')]==='DELIVERED'){return _0x1d16d9['update']({'read':!![]});}else{logger[_0x3a02('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3a02('0x2a'),_0x3a02('0x8b'),util['inspect'](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x34b54b==_0x3a02('0xd2')||_0x34b54b==_0x3a02('0xd3')){return _0x1d16d9[_0x3a02('0x63')]({'read':!![]});}else{logger[_0x3a02('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3a02('0x91'),util[_0x3a02('0xc6')](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));}break;case _0x3a02('0xcf'):if(_0x34b54b==_0x3a02('0xd4')){return _0x1d16d9['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3a02('0x2a'),'bandwidth',util[_0x3a02('0xc6')](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x34b54b===_0x3a02('0xd5')||_0x34b54b===_0x3a02('0xd6')){return _0x1d16d9[_0x3a02('0x63')]({'read':!![]});}else{logger['error'](_0x3a02('0x24'),'status','intelepeer',util['inspect'](_0x4164b4[_0x3a02('0x64')],{'showHidden':![],'depth':null}));}break;}return _0x1d16d9;}})['then'](respondWithResult(_0x522a54,null))[_0x3a02('0x29')](handleError(_0x522a54,null));};exports[_0x3a02('0xd7')]=function(_0x64a87e,_0x414029,_0x17dd91){var _0xb0b8f2,_0xba3576,_0x4a6927;return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x64a87e[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x414029,null))[_0x3a02('0x35')](function(_0x5619b4){if(_0x5619b4){_0x4a6927=_0x5619b4;logger['debug'](_0x3a02('0x24'),_0x3a02('0x2a'),'received\x20delivery\x20report\x20from',_0x5619b4['type'],util[_0x3a02('0xc6')](_0x64a87e[_0x3a02('0x45')],{'showHidden':![],'depth':null}));switch(_0x5619b4['type']){case _0x3a02('0x8e'):if(_0x64a87e[_0x3a02('0x45')][_0x3a02('0xd8')]&&_0x64a87e[_0x3a02('0x45')][_0x3a02('0xd9')]){_0xba3576=_0x64a87e[_0x3a02('0x45')]['state'];return db[_0x3a02('0xa5')][_0x3a02('0x5a')]({'where':{'messageId':_0x64a87e[_0x3a02('0x45')][_0x3a02('0xd8')]}});}break;}}})[_0x3a02('0x35')](handleEntityNotFound(_0x414029,null))[_0x3a02('0x35')](function(_0x39a435){if(_0x39a435){_0xb0b8f2=_0x39a435;switch(_0x4a6927[_0x3a02('0x42')]){case _0x3a02('0x8e'):if(_0xba3576==='2'||_0xba3576==='6'){return _0xb0b8f2['update']({'read':!![]});}else{logger[_0x3a02('0x26')](_0x3a02('0x24'),_0x3a02('0x2a'),_0x3a02('0x8e'),util[_0x3a02('0xc6')](_0x64a87e[_0x3a02('0x45')],{'showHidden':![],'depth':null}));};break;}return _0xb0b8f2;}})[_0x3a02('0x35')](respondWithResult(_0x414029,null))[_0x3a02('0x29')](handleError(_0x414029,null));};exports[_0x3a02('0xda')]=function(_0x593f18,_0x41c26a,_0x2abbee){return db[_0x3a02('0x3f')][_0x3a02('0x5a')]({'where':{'id':_0x593f18[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x41c26a,null))[_0x3a02('0x35')](function(_0x4b0844){if(_0x4b0844){return _0x4b0844[_0x3a02('0xda')](_0x593f18['body'][_0x3a02('0x6c')],_[_0x3a02('0x9c')](_0x593f18[_0x3a02('0x64')],['ids','id'])||{})[_0x3a02('0x9e')](function(_0x3cae6e){for(var _0x5cc5bc=0x0;_0x5cc5bc<_0x593f18[_0x3a02('0x64')][_0x3a02('0x6c')][_0x3a02('0x4a')];_0x5cc5bc+=0x1){socket[_0x3a02('0xdb')](_0x3a02('0xdc'),{'UserId':Number(_0x593f18[_0x3a02('0x64')]['ids'][_0x5cc5bc]),'SmsAccountId':Number(_0x593f18[_0x3a02('0x58')]['id'])});}return _0x3cae6e;});}})['then'](respondWithResult(_0x41c26a,null))[_0x3a02('0x29')](handleError(_0x41c26a,null));};exports[_0x3a02('0xdd')]=function(_0x5cb47c,_0x5af84a,_0x26fc2b){return db[_0x3a02('0x3f')]['find']({'where':{'id':_0x5cb47c[_0x3a02('0x58')]['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x5af84a,null))[_0x3a02('0x35')](function(_0x4f161f){if(_0x4f161f){return _0x4f161f['removeAgents'](_0x5cb47c['query'][_0x3a02('0x6c')])['then'](function(){if(_[_0x3a02('0xde')](_0x5cb47c[_0x3a02('0x45')][_0x3a02('0x6c')])){for(var _0x136080=0x0;_0x136080<_0x5cb47c[_0x3a02('0x45')]['ids'][_0x3a02('0x4a')];_0x136080+=0x1){socket[_0x3a02('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x5cb47c[_0x3a02('0x45')]['ids'][_0x136080]),'SmsAccountId':Number(_0x5cb47c['params']['id'])});}}else{socket[_0x3a02('0xdb')]('userSmsAccount:remove',{'UserId':Number(_0x5cb47c['query'][_0x3a02('0x6c')]),'SmsAccountId':Number(_0x5cb47c[_0x3a02('0x58')]['id'])});}});}})[_0x3a02('0x35')](respondWithStatusCode(_0x5af84a,null))[_0x3a02('0x29')](handleError(_0x5af84a,null));};exports['getAgents']=function(_0x34766e,_0x1d5f98,_0x46bc39){var _0x3a4278={};var _0x2d210a={};var _0x4bde1d;var _0x50d4bf;return db[_0x3a02('0x3f')][_0x3a02('0x6e')]({'where':{'id':_0x34766e['params']['id']}})[_0x3a02('0x35')](handleEntityNotFound(_0x1d5f98,null))[_0x3a02('0x35')](function(_0x2d421c){if(_0x2d421c){_0x4bde1d=_0x2d421c;_0x2d210a['model']=_[_0x3a02('0x59')](db[_0x3a02('0xb7')][_0x3a02('0x40')]);_0x2d210a[_0x3a02('0x45')]=_['keys'](_0x34766e[_0x3a02('0x45')]);_0x2d210a['filters']=_[_0x3a02('0x48')](_0x2d210a[_0x3a02('0x44')],_0x2d210a[_0x3a02('0x45')]);_0x3a4278['attributes']=_[_0x3a02('0x48')](_0x2d210a[_0x3a02('0x44')],qs['fields'](_0x34766e[_0x3a02('0x45')][_0x3a02('0x49')]));_0x3a4278[_0x3a02('0x47')]=_0x3a4278[_0x3a02('0x47')][_0x3a02('0x4a')]?_0x3a4278[_0x3a02('0x47')]:_0x2d210a[_0x3a02('0x44')];_0x3a4278[_0x3a02('0x6a')]=qs[_0x3a02('0x4d')](_0x34766e[_0x3a02('0x45')]['sort']);_0x3a4278[_0x3a02('0x4e')]=qs[_0x3a02('0x46')](_[_0x3a02('0x4f')](_0x34766e[_0x3a02('0x45')],_0x2d210a[_0x3a02('0x46')]));if(_0x34766e[_0x3a02('0x45')][_0x3a02('0x50')]){_0x3a4278['where']=_[_0x3a02('0x51')](_0x3a4278[_0x3a02('0x4e')],{'$or':_[_0x3a02('0x3e')](_0x3a4278[_0x3a02('0x47')],function(_0x1e5b8e){var _0x3b0645={};_0x3b0645[_0x1e5b8e]={'$like':'%'+_0x34766e['query'][_0x3a02('0x50')]+'%'};return _0x3b0645;})});}_0x3a4278=_[_0x3a02('0x51')]({},_0x3a4278,_0x34766e[_0x3a02('0x52')]);return _0x4bde1d[_0x3a02('0xdf')](_0x3a4278);}})[_0x3a02('0x35')](function(_0x3f0b9f){if(_0x3f0b9f){_0x50d4bf=_0x3f0b9f[_0x3a02('0x4a')];if(!_0x34766e['query'][_0x3a02('0x4b')](_0x3a02('0x4c'))){_0x3a4278[_0x3a02('0x2e')]=qs[_0x3a02('0x2e')](_0x34766e[_0x3a02('0x45')][_0x3a02('0x2e')]);_0x3a4278[_0x3a02('0x2c')]=qs['offset'](_0x34766e[_0x3a02('0x45')][_0x3a02('0x2c')]);}return _0x4bde1d['getAgents'](_0x3a4278);}})[_0x3a02('0x35')](function(_0x485925){if(_0x485925){return _0x485925?{'count':_0x50d4bf,'rows':_0x485925}:null;}})[_0x3a02('0x35')](respondWithResult(_0x1d5f98,null))[_0x3a02('0x29')](handleError(_0x1d5f98,null));};
\ No newline at end of file
index 3cae663..0c4a068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96f0=['SmsAccount','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xd4db61,_0x5959e7){var _0x5dd72d=function(_0x5c6c18){while(--_0x5c6c18){_0xd4db61['push'](_0xd4db61['shift']());}};_0x5dd72d(++_0x5959e7);}(_0x96f0,0x19c));var _0x096f=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x96f0[_0x454165];return _0x56db53;};'use strict';var EventEmitter=require(_0x096f('0x0'));var SmsAccount=require(_0x096f('0x1'))['db'][_0x096f('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x096f('0x3'),'afterDestroy':_0x096f('0x4')};function emitEvent(_0x1454ff){return function(_0x4e9147,_0xc261c2,_0xb070d1){SmsAccountEvents['emit'](_0x1454ff+':'+_0x4e9147['id'],_0x4e9147);SmsAccountEvents[_0x096f('0x5')](_0x1454ff,_0x4e9147);_0xb070d1(null);};}for(var e in events){if(events[_0x096f('0x6')](e)){var event=events[e];SmsAccount[_0x096f('0x7')](e,emitEvent(event));}}module[_0x096f('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0xfb0e=['SmsAccount','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x21c76e,_0x4e415d){var _0x27e000=function(_0x54c51f){while(--_0x54c51f){_0x21c76e['push'](_0x21c76e['shift']());}};_0x27e000(++_0x4e415d);}(_0xfb0e,0xd8));var _0xefb0=function(_0x2d8434,_0x43d781){_0x2d8434=_0x2d8434-0x0;var _0x26b9e4=_0xfb0e[_0x2d8434];return _0x26b9e4;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xefb0('0x0'))['db'][_0xefb0('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xefb0('0x2'),'afterUpdate':'update','afterDestroy':_0xefb0('0x3')};function emitEvent(_0x325b36){return function(_0x1b95f7,_0x35eee6,_0x4c2248){SmsAccountEvents[_0xefb0('0x4')](_0x325b36+':'+_0x1b95f7['id'],_0x1b95f7);SmsAccountEvents[_0xefb0('0x4')](_0x325b36,_0x1b95f7);_0x4c2248(null);};}for(var e in events){if(events[_0xefb0('0x5')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xefb0('0x6')]=SmsAccountEvents;
\ No newline at end of file
index a759b4d..f0b43ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x234e=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','sms_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0x234e,0x1db));var _0xe234=function(_0x4da94f,_0x1abacc){_0x4da94f=_0x4da94f-0x0;var _0x278995=_0x234e[_0x4da94f];return _0x278995;};'use strict';var _=require(_0xe234('0x0'));var util=require('util');var logger=require(_0xe234('0x1'))(_0xe234('0x2'));var moment=require(_0xe234('0x3'));var BPromise=require(_0xe234('0x4'));var rp=require(_0xe234('0x5'));var fs=require('fs');var path=require(_0xe234('0x6'));var rimraf=require(_0xe234('0x7'));var config=require(_0xe234('0x8'));var attributes=require(_0xe234('0x9'));module[_0xe234('0xa')]=function(_0x4e51f8,_0x1021a0){return _0x4e51f8['define']('SmsAccount',attributes,{'tableName':_0xe234('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fbe=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x53b551,_0x1681dc){var _0x2d7ce8=function(_0x399e61){while(--_0x399e61){_0x53b551['push'](_0x53b551['shift']());}};_0x2d7ce8(++_0x1681dc);}(_0x8fbe,0xe1));var _0xe8fb=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x8fbe[_0x158da6];return _0x429c30;};'use strict';var _=require(_0xe8fb('0x0'));var util=require(_0xe8fb('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe8fb('0x2'));var rp=require(_0xe8fb('0x3'));var fs=require('fs');var path=require(_0xe8fb('0x4'));var rimraf=require(_0xe8fb('0x5'));var config=require('../../config/environment');var attributes=require(_0xe8fb('0x6'));module[_0xe8fb('0x7')]=function(_0x5277a5,_0x4bc78b){return _0x5277a5[_0xe8fb('0x8')](_0xe8fb('0x9'),attributes,{'tableName':_0xe8fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 00d07a6..4543568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc74f=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','map','include','model','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x144aa4,_0x4f2d0c){var _0x43368c=function(_0x30cbaf){while(--_0x30cbaf){_0x144aa4['push'](_0x144aa4['shift']());}};_0x43368c(++_0x4f2d0c);}(_0xc74f,0x1a8));var _0xfc74=function(_0x4dece9,_0x1627e3){_0x4dece9=_0x4dece9-0x0;var _0x404d91=_0xc74f[_0x4dece9];return _0x404d91;};'use strict';var _=require('lodash');var util=require(_0xfc74('0x0'));var moment=require('moment');var BPromise=require(_0xfc74('0x1'));var rs=require(_0xfc74('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc74('0x3'))['db'];var utils=require(_0xfc74('0x4'));var logger=require(_0xfc74('0x5'))(_0xfc74('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc74('0x7')][_0xfc74('0x8')]({'port':0x232a});config[_0xfc74('0x9')]=_[_0xfc74('0xa')](config[_0xfc74('0x9')],{'host':_0xfc74('0xb'),'port':0x18eb});var socket=require(_0xfc74('0xc'))(new Redis(config[_0xfc74('0x9')]));require('./smsAccount.socket')[_0xfc74('0xd')](socket);function respondWithRpcPromise(_0x1c1665,_0x25f8d0,_0x3e979a){return new BPromise(function(_0xc1fdea,_0x4e2f04){return client[_0xfc74('0xe')](_0x1c1665,_0x3e979a)[_0xfc74('0xf')](function(_0x30ba66){logger[_0xfc74('0x10')](_0xfc74('0x11'),_0x25f8d0,'request\x20sent');logger[_0xfc74('0x12')](_0xfc74('0x13'),_0x25f8d0,_0xfc74('0x14'),JSON[_0xfc74('0x15')](_0x30ba66));if(_0x30ba66[_0xfc74('0x16')]){if(_0x30ba66[_0xfc74('0x16')][_0xfc74('0x17')]===0x1f4){logger[_0xfc74('0x16')](_0xfc74('0x11'),_0x25f8d0,_0x30ba66[_0xfc74('0x16')][_0xfc74('0x18')]);return _0x4e2f04(_0x30ba66['error'][_0xfc74('0x18')]);}logger[_0xfc74('0x16')]('SmsAccount,\x20%s,\x20%s',_0x25f8d0,_0x30ba66[_0xfc74('0x16')]['message']);return _0xc1fdea(_0x30ba66[_0xfc74('0x16')]['message']);}else{logger['info'](_0xfc74('0x11'),_0x25f8d0,_0xfc74('0x14'));_0xc1fdea(_0x30ba66[_0xfc74('0x19')]['message']);}})[_0xfc74('0x1a')](function(_0x394c31){logger['error'](_0xfc74('0x11'),_0x25f8d0,_0x394c31);_0x4e2f04(_0x394c31);});});}exports[_0xfc74('0x1b')]=function(_0x17487f){var _0x409770=this;return new Promise(function(_0x834093,_0x5dca6f){return db[_0xfc74('0x1c')][_0xfc74('0x1d')]({'raw':_0x17487f['options']?_0x17487f[_0xfc74('0x1e')][_0xfc74('0x1f')]===undefined?!![]:![]:!![],'where':_0x17487f[_0xfc74('0x1e')]?_0x17487f[_0xfc74('0x1e')]['where']||null:null,'attributes':_0x17487f[_0xfc74('0x1e')]?_0x17487f[_0xfc74('0x1e')][_0xfc74('0x20')]||null:null,'include':_0x17487f['options']?_0x17487f[_0xfc74('0x1e')]['include']?_[_0xfc74('0x21')](_0x17487f[_0xfc74('0x1e')][_0xfc74('0x22')],function(_0x47d032){return{'model':db[_0x47d032['model']],'as':_0x47d032['as'],'attributes':_0x47d032[_0xfc74('0x20')],'include':_0x47d032['include']?_[_0xfc74('0x21')](_0x47d032[_0xfc74('0x22')],function(_0x200a70){return{'model':db[_0x200a70[_0xfc74('0x23')]],'as':_0x200a70['as'],'attributes':_0x200a70[_0xfc74('0x20')],'include':_0x200a70[_0xfc74('0x22')]?_[_0xfc74('0x21')](_0x200a70[_0xfc74('0x22')],function(_0x2b772f){return{'model':db[_0x2b772f['model']],'as':_0x2b772f['as'],'attributes':_0x2b772f['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc74('0xf')](function(_0x4f3d57){logger[_0xfc74('0x10')]('ShowSmsAccount',_0x17487f);logger['debug']('ShowSmsAccount',_0x17487f,JSON['stringify'](_0x4f3d57));_0x834093(_0x4f3d57);})[_0xfc74('0x1a')](function(_0x37eee5){logger[_0xfc74('0x16')](_0xfc74('0x1b'),_0x37eee5[_0xfc74('0x18')],_0x17487f);_0x5dca6f(_0x409770['error'](0x1f4,_0x37eee5['message']));});});};
\ No newline at end of file
+var _0xfd82=['../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','find','options','raw','where','map','include','model','attributes','ShowSmsAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4a7ea5,_0x2c8357){var _0x51688a=function(_0x4c6d9c){while(--_0x4c6d9c){_0x4a7ea5['push'](_0x4a7ea5['shift']());}};_0x51688a(++_0x2c8357);}(_0xfd82,0x146));var _0x2fd8=function(_0x211aa9,_0x5d2873){_0x211aa9=_0x211aa9-0x0;var _0x4f90f8=_0xfd82[_0x211aa9];return _0x4f90f8;};'use strict';var _=require(_0x2fd8('0x0'));var util=require(_0x2fd8('0x1'));var moment=require(_0x2fd8('0x2'));var BPromise=require(_0x2fd8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fd8('0x4'));var db=require(_0x2fd8('0x5'))['db'];var utils=require(_0x2fd8('0x6'));var logger=require(_0x2fd8('0x7'))(_0x2fd8('0x8'));var config=require(_0x2fd8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2fd8('0xa')]({'port':0x232a});config[_0x2fd8('0xb')]=_[_0x2fd8('0xc')](config[_0x2fd8('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fd8('0xd'))(new Redis(config[_0x2fd8('0xb')]));require(_0x2fd8('0xe'))[_0x2fd8('0xf')](socket);function respondWithRpcPromise(_0x55580c,_0x4361be,_0x35f2fc){return new BPromise(function(_0x56bc06,_0x1349e4){return client[_0x2fd8('0x10')](_0x55580c,_0x35f2fc)[_0x2fd8('0x11')](function(_0x4362ff){logger[_0x2fd8('0x12')](_0x2fd8('0x13'),_0x4361be,_0x2fd8('0x14'));logger[_0x2fd8('0x15')](_0x2fd8('0x16'),_0x4361be,_0x2fd8('0x14'),JSON[_0x2fd8('0x17')](_0x4362ff));if(_0x4362ff['error']){if(_0x4362ff[_0x2fd8('0x18')]['code']===0x1f4){logger['error'](_0x2fd8('0x13'),_0x4361be,_0x4362ff[_0x2fd8('0x18')][_0x2fd8('0x19')]);return _0x1349e4(_0x4362ff[_0x2fd8('0x18')][_0x2fd8('0x19')]);}logger[_0x2fd8('0x18')](_0x2fd8('0x13'),_0x4361be,_0x4362ff[_0x2fd8('0x18')][_0x2fd8('0x19')]);return _0x56bc06(_0x4362ff[_0x2fd8('0x18')][_0x2fd8('0x19')]);}else{logger[_0x2fd8('0x12')]('SmsAccount,\x20%s,\x20%s',_0x4361be,'request\x20sent');_0x56bc06(_0x4362ff[_0x2fd8('0x1a')][_0x2fd8('0x19')]);}})[_0x2fd8('0x1b')](function(_0xed228){logger[_0x2fd8('0x18')](_0x2fd8('0x13'),_0x4361be,_0xed228);_0x1349e4(_0xed228);});});}exports['ShowSmsAccount']=function(_0x5f0a44){var _0x207359=this;return new Promise(function(_0x5483d5,_0x5d5fb0){return db['SmsAccount'][_0x2fd8('0x1c')]({'raw':_0x5f0a44[_0x2fd8('0x1d')]?_0x5f0a44[_0x2fd8('0x1d')][_0x2fd8('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f0a44[_0x2fd8('0x1d')]?_0x5f0a44[_0x2fd8('0x1d')][_0x2fd8('0x1f')]||null:null,'attributes':_0x5f0a44[_0x2fd8('0x1d')]?_0x5f0a44[_0x2fd8('0x1d')]['attributes']||null:null,'include':_0x5f0a44['options']?_0x5f0a44[_0x2fd8('0x1d')]['include']?_[_0x2fd8('0x20')](_0x5f0a44[_0x2fd8('0x1d')][_0x2fd8('0x21')],function(_0x32d645){return{'model':db[_0x32d645[_0x2fd8('0x22')]],'as':_0x32d645['as'],'attributes':_0x32d645[_0x2fd8('0x23')],'include':_0x32d645[_0x2fd8('0x21')]?_[_0x2fd8('0x20')](_0x32d645[_0x2fd8('0x21')],function(_0x57be7d){return{'model':db[_0x57be7d[_0x2fd8('0x22')]],'as':_0x57be7d['as'],'attributes':_0x57be7d['attributes'],'include':_0x57be7d['include']?_[_0x2fd8('0x20')](_0x57be7d[_0x2fd8('0x21')],function(_0x548ddc){return{'model':db[_0x548ddc['model']],'as':_0x548ddc['as'],'attributes':_0x548ddc['attributes']};}):[]};}):[]};}):[]:[]})[_0x2fd8('0x11')](function(_0x1595e2){logger[_0x2fd8('0x12')](_0x2fd8('0x24'),_0x5f0a44);logger['debug'](_0x2fd8('0x24'),_0x5f0a44,JSON['stringify'](_0x1595e2));_0x5483d5(_0x1595e2);})[_0x2fd8('0x1b')](function(_0x5c7049){logger['error'](_0x2fd8('0x24'),_0x5c7049[_0x2fd8('0x19')],_0x5f0a44);_0x5d5fb0(_0x207359[_0x2fd8('0x18')](0x1f4,_0x5c7049[_0x2fd8('0x19')]));});});};
\ No newline at end of file
index c52dcca..5ce81f0 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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 15229b2..58d84b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x29975a,_0x2ca253){var _0x41bcac=function(_0x4023ba){while(--_0x4023ba){_0x29975a['push'](_0x29975a['shift']());}};_0x41bcac(++_0x2ca253);}(_0x3e74,0x175));var _0x43e7=function(_0x208578,_0x41abc9){_0x208578=_0x208578-0x0;var _0x195163=_0x3e74[_0x208578];return _0x195163;};'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
+var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x243181,_0x4ad5f3){var _0x21c002=function(_0x1ce967){while(--_0x1ce967){_0x243181['push'](_0x243181['shift']());}};_0x21c002(++_0x4ad5f3);}(_0xedd9,0xfc));var _0x9edd=function(_0x19b677,_0x39f86d){_0x19b677=_0x19b677-0x0;var _0x324f65=_0xedd9[_0x19b677];return _0x324f65;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
index a2ec04c..9ba8073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72cc=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x38f3dd,_0x2000f5){var _0x3e062a=function(_0x33d12a){while(--_0x33d12a){_0x38f3dd['push'](_0x38f3dd['shift']());}};_0x3e062a(++_0x2000f5);}(_0x72cc,0x152));var _0xc72c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x72cc[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xc72c('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc72c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc72c('0x2')],'allowNull':![],'defaultValue':_0xc72c('0x3')},'appdata':{'type':Sequelize[_0xc72c('0x4')]()},'description':{'type':Sequelize[_0xc72c('0x2')]},'interval':{'type':Sequelize[_0xc72c('0x2')],'defaultValue':_0xc72c('0x5')}};
\ No newline at end of file
+var _0x1da6=['sequelize','exports','INTEGER','noop','STRING','*,*,*,*'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1da6,0x1ce));var _0x61da=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x1da6[_0x2aaa60];return _0x2e3fa5;};'use strict';var Sequelize=require(_0x61da('0x0'));module[_0x61da('0x1')]={'priority':{'type':Sequelize[_0x61da('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x61da('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x61da('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x61da('0x5')}};
\ No newline at end of file
index 6e40571..022570d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8850=['undefined','limit','count','offset','Content-Range','reject','update','destroy','end','sendStatus','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','catch','show','params','options','find','create','body','eml-format','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x5da0fd,_0x18a7c7){var _0x5a2412=function(_0x21374b){while(--_0x21374b){_0x5da0fd['push'](_0x5da0fd['shift']());}};_0x5a2412(++_0x18a7c7);}(_0x8850,0x17d));var _0x0885=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8850[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0885('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0885('0x1'));var jsonpatch=require(_0x0885('0x2'));var rp=require('request-promise');var moment=require(_0x0885('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0885('0x4'));var path=require(_0x0885('0x5'));var sox=require(_0x0885('0x6'));var csv=require(_0x0885('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0885('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x0885('0x9'));var toCsv=require(_0x0885('0x7'));var querystring=require(_0x0885('0xa'));var Papa=require(_0x0885('0xb'));var Redis=require('ioredis');var authService=require(_0x0885('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x0885('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0885('0xe'))(_0x0885('0xf'));var utils=require('../../config/utils');var config=require(_0x0885('0x10'));var licenseUtil=require(_0x0885('0x11'));var db=require(_0x0885('0x12'))['db'];function respondWithStatusCode(_0x36bf20,_0x292f19){_0x292f19=_0x292f19||0xcc;return function(_0x3edab6){if(_0x3edab6){return _0x36bf20['sendStatus'](_0x292f19);}return _0x36bf20[_0x0885('0x13')](_0x292f19)['end']();};}function respondWithResult(_0x3dfee8,_0x27ab9c){_0x27ab9c=_0x27ab9c||0xc8;return function(_0x3ccc15){if(_0x3ccc15){return _0x3dfee8[_0x0885('0x13')](_0x27ab9c)[_0x0885('0x14')](_0x3ccc15);}};}function respondWithFilteredResult(_0x56c6cf,_0x1303ca){return function(_0x4dca06){if(_0x4dca06){var _0x48f7f5=typeof _0x1303ca['offset']===_0x0885('0x15')&&typeof _0x1303ca[_0x0885('0x16')]==='undefined';var _0x45bab1=_0x4dca06[_0x0885('0x17')];var _0x37739d=_0x48f7f5?0x0:_0x1303ca['offset'];var _0x5222a3=_0x48f7f5?_0x4dca06[_0x0885('0x17')]:_0x1303ca[_0x0885('0x18')]+_0x1303ca[_0x0885('0x16')];var _0x1b1ee9;if(_0x5222a3>=_0x45bab1){_0x5222a3=_0x45bab1;_0x1b1ee9=0xc8;}else{_0x1b1ee9=0xce;}_0x56c6cf[_0x0885('0x13')](_0x1b1ee9);return _0x56c6cf['set'](_0x0885('0x19'),_0x37739d+'-'+_0x5222a3+'/'+_0x45bab1)[_0x0885('0x14')](_0x4dca06);}return null;};}function patchUpdates(_0x2b626a){return function(_0x2a74fd){try{jsonpatch['apply'](_0x2a74fd,_0x2b626a,!![]);}catch(_0x3ef3b0){return BPromise[_0x0885('0x1a')](_0x3ef3b0);}return _0x2a74fd['save']();};}function saveUpdates(_0xa11ed9,_0x5957da){return function(_0x2129ac){if(_0x2129ac){return _0x2129ac[_0x0885('0x1b')](_0xa11ed9)['then'](function(_0x24ad02){return _0x24ad02;});}return null;};}function removeEntity(_0x30e1e5,_0x593ab5){return function(_0x3e73c5){if(_0x3e73c5){return _0x3e73c5[_0x0885('0x1c')]()['then'](function(){_0x30e1e5[_0x0885('0x13')](0xcc)[_0x0885('0x1d')]();});}};}function handleEntityNotFound(_0x3e35fd,_0x435f09){return function(_0x6a62cf){if(!_0x6a62cf){_0x3e35fd[_0x0885('0x1e')](0x194);}return _0x6a62cf;};}function handleError(_0x275d7a,_0x19ca03){_0x19ca03=_0x19ca03||0x1f4;return function(_0x794aab){logger[_0x0885('0x1f')](_0x794aab[_0x0885('0x20')]);if(_0x794aab[_0x0885('0x21')]){delete _0x794aab['name'];}_0x275d7a[_0x0885('0x13')](_0x19ca03)[_0x0885('0x22')](_0x794aab);};}exports[_0x0885('0x23')]=function(_0xd3c67,_0x4d0469){var _0x2510c2={},_0x509a68={},_0x17891={'count':0x0,'rows':[]};var _0x49471f=_[_0x0885('0x24')](db[_0x0885('0x25')][_0x0885('0x26')],function(_0x237046){return{'name':_0x237046[_0x0885('0x27')],'type':_0x237046[_0x0885('0x28')][_0x0885('0x29')]};});_0x509a68[_0x0885('0x2a')]=_['map'](_0x49471f,_0x0885('0x21'));_0x509a68[_0x0885('0x2b')]=_[_0x0885('0x2c')](_0xd3c67['query']);_0x509a68[_0x0885('0x2d')]=_['intersection'](_0x509a68[_0x0885('0x2a')],_0x509a68[_0x0885('0x2b')]);_0x2510c2[_0x0885('0x2e')]=_[_0x0885('0x2f')](_0x509a68[_0x0885('0x2a')],qs[_0x0885('0x30')](_0xd3c67[_0x0885('0x2b')]['fields']));_0x2510c2[_0x0885('0x2e')]=_0x2510c2['attributes'][_0x0885('0x31')]?_0x2510c2[_0x0885('0x2e')]:_0x509a68[_0x0885('0x2a')];if(!_0xd3c67[_0x0885('0x2b')][_0x0885('0x32')]('nolimit')){_0x2510c2[_0x0885('0x16')]=qs[_0x0885('0x16')](_0xd3c67[_0x0885('0x2b')]['limit']);_0x2510c2[_0x0885('0x18')]=qs[_0x0885('0x18')](_0xd3c67[_0x0885('0x2b')][_0x0885('0x18')]);}_0x2510c2['order']=qs['sort'](_0xd3c67[_0x0885('0x2b')][_0x0885('0x33')]);_0x2510c2[_0x0885('0x34')]=qs[_0x0885('0x2d')](_[_0x0885('0x35')](_0xd3c67['query'],_0x509a68[_0x0885('0x2d')]),_0x49471f);if(_0xd3c67[_0x0885('0x2b')][_0x0885('0x36')]){_0x2510c2[_0x0885('0x34')]=_[_0x0885('0x37')](_0x2510c2['where'],{'$or':_[_0x0885('0x24')](_0x49471f,function(_0x326398){if(_0x326398[_0x0885('0x28')]!==_0x0885('0x38')){var _0x50ca66={};_0x50ca66[_0x326398[_0x0885('0x21')]]={'$like':'%'+_0xd3c67[_0x0885('0x2b')]['filter']+'%'};return _0x50ca66;}})});}_0x2510c2=_[_0x0885('0x37')]({},_0x2510c2,_0xd3c67['options']);var _0x1abc2b={'where':_0x2510c2['where']};return db[_0x0885('0x25')][_0x0885('0x17')](_0x1abc2b)[_0x0885('0x39')](function(_0x45c6b5){_0x17891[_0x0885('0x17')]=_0x45c6b5;if(_0xd3c67[_0x0885('0x2b')][_0x0885('0x3a')]){_0x2510c2[_0x0885('0x3b')]=[{'all':!![]}];}return db[_0x0885('0x25')]['findAll'](_0x2510c2);})[_0x0885('0x39')](function(_0x198610){_0x17891['rows']=_0x198610;return _0x17891;})[_0x0885('0x39')](respondWithFilteredResult(_0x4d0469,_0x2510c2))[_0x0885('0x3c')](handleError(_0x4d0469,null));};exports[_0x0885('0x3d')]=function(_0x4f7130,_0x101ad3){var _0x401890={'raw':!![],'where':{'id':_0x4f7130[_0x0885('0x3e')]['id']}},_0x32e8d0={};_0x32e8d0[_0x0885('0x2a')]=_[_0x0885('0x2c')](db['SmsApplication'][_0x0885('0x26')]);_0x32e8d0[_0x0885('0x2b')]=_[_0x0885('0x2c')](_0x4f7130['query']);_0x32e8d0['filters']=_[_0x0885('0x2f')](_0x32e8d0[_0x0885('0x2a')],_0x32e8d0[_0x0885('0x2b')]);_0x401890[_0x0885('0x2e')]=_[_0x0885('0x2f')](_0x32e8d0['model'],qs['fields'](_0x4f7130['query'][_0x0885('0x30')]));_0x401890[_0x0885('0x2e')]=_0x401890[_0x0885('0x2e')]['length']?_0x401890['attributes']:_0x32e8d0[_0x0885('0x2a')];if(_0x4f7130[_0x0885('0x2b')]['includeAll']){_0x401890[_0x0885('0x3b')]=[{'all':!![]}];}_0x401890=_[_0x0885('0x37')]({},_0x401890,_0x4f7130[_0x0885('0x3f')]);return db['SmsApplication'][_0x0885('0x40')](_0x401890)[_0x0885('0x39')](handleEntityNotFound(_0x101ad3,null))[_0x0885('0x39')](respondWithResult(_0x101ad3,null))['catch'](handleError(_0x101ad3,null));};exports[_0x0885('0x41')]=function(_0x2995bf,_0x3a0725){return db[_0x0885('0x25')][_0x0885('0x41')](_0x2995bf[_0x0885('0x42')],{})['then'](respondWithResult(_0x3a0725,0xc9))[_0x0885('0x3c')](handleError(_0x3a0725,null));};exports[_0x0885('0x1b')]=function(_0x9fa9b3,_0xb5853e){if(_0x9fa9b3[_0x0885('0x42')]['id']){delete _0x9fa9b3['body']['id'];}return db['SmsApplication'][_0x0885('0x40')]({'where':{'id':_0x9fa9b3['params']['id']}})[_0x0885('0x39')](handleEntityNotFound(_0xb5853e,null))[_0x0885('0x39')](saveUpdates(_0x9fa9b3[_0x0885('0x42')],null))[_0x0885('0x39')](respondWithResult(_0xb5853e,null))[_0x0885('0x3c')](handleError(_0xb5853e,null));};exports[_0x0885('0x1c')]=function(_0x26de4f,_0x60fa9){return db[_0x0885('0x25')]['find']({'where':{'id':_0x26de4f[_0x0885('0x3e')]['id']}})[_0x0885('0x39')](handleEntityNotFound(_0x60fa9,null))[_0x0885('0x39')](removeEntity(_0x60fa9,null))[_0x0885('0x3c')](handleError(_0x60fa9,null));};
\ No newline at end of file
+var _0xa9d2=['SmsApplication','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','fast-json-patch','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','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','error','name','send','index','map'];(function(_0x41568f,_0x7c6734){var _0x2b35e5=function(_0x486c48){while(--_0x486c48){_0x41568f['push'](_0x41568f['shift']());}};_0x2b35e5(++_0x7c6734);}(_0xa9d2,0x18b));var _0x2a9d=function(_0xeb6d03,_0x532844){_0xeb6d03=_0xeb6d03-0x0;var _0x4862bd=_0xa9d2[_0xeb6d03];return _0x4862bd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a9d('0x0'));var jsonpatch=require(_0x2a9d('0x1'));var rp=require(_0x2a9d('0x2'));var moment=require(_0x2a9d('0x3'));var BPromise=require(_0x2a9d('0x4'));var Mustache=require(_0x2a9d('0x5'));var util=require(_0x2a9d('0x6'));var path=require(_0x2a9d('0x7'));var sox=require(_0x2a9d('0x8'));var csv=require(_0x2a9d('0x9'));var ejs=require(_0x2a9d('0xa'));var fs=require('fs');var fs_extra=require(_0x2a9d('0xb'));var _=require(_0x2a9d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2a9d('0xd'));var deskjs=require(_0x2a9d('0xe'));var toCsv=require(_0x2a9d('0x9'));var querystring=require(_0x2a9d('0xf'));var Papa=require(_0x2a9d('0x10'));var Redis=require(_0x2a9d('0x11'));var authService=require(_0x2a9d('0x12'));var qs=require(_0x2a9d('0x13'));var as=require(_0x2a9d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2a9d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2a9d('0x16'));var db=require(_0x2a9d('0x17'))['db'];function respondWithStatusCode(_0x59d278,_0x5a6e88){_0x5a6e88=_0x5a6e88||0xcc;return function(_0x4c7cdd){if(_0x4c7cdd){return _0x59d278[_0x2a9d('0x18')](_0x5a6e88);}return _0x59d278[_0x2a9d('0x19')](_0x5a6e88)[_0x2a9d('0x1a')]();};}function respondWithResult(_0x57c5d6,_0x327143){_0x327143=_0x327143||0xc8;return function(_0x3572af){if(_0x3572af){return _0x57c5d6[_0x2a9d('0x19')](_0x327143)['json'](_0x3572af);}};}function respondWithFilteredResult(_0xe3ad7b,_0x16104c){return function(_0x925586){if(_0x925586){var _0x539d35=typeof _0x16104c['offset']===_0x2a9d('0x1b')&&typeof _0x16104c[_0x2a9d('0x1c')]==='undefined';var _0x524bbc=_0x925586[_0x2a9d('0x1d')];var _0x1a525a=_0x539d35?0x0:_0x16104c[_0x2a9d('0x1e')];var _0x1c9ede=_0x539d35?_0x925586['count']:_0x16104c[_0x2a9d('0x1e')]+_0x16104c[_0x2a9d('0x1c')];var _0x461cba;if(_0x1c9ede>=_0x524bbc){_0x1c9ede=_0x524bbc;_0x461cba=0xc8;}else{_0x461cba=0xce;}_0xe3ad7b[_0x2a9d('0x19')](_0x461cba);return _0xe3ad7b[_0x2a9d('0x1f')](_0x2a9d('0x20'),_0x1a525a+'-'+_0x1c9ede+'/'+_0x524bbc)[_0x2a9d('0x21')](_0x925586);}return null;};}function patchUpdates(_0x52f338){return function(_0x2734ec){try{jsonpatch[_0x2a9d('0x22')](_0x2734ec,_0x52f338,!![]);}catch(_0x158bb2){return BPromise['reject'](_0x158bb2);}return _0x2734ec['save']();};}function saveUpdates(_0x443222,_0x212110){return function(_0x39fcb2){if(_0x39fcb2){return _0x39fcb2[_0x2a9d('0x23')](_0x443222)[_0x2a9d('0x24')](function(_0x1b25c0){return _0x1b25c0;});}return null;};}function removeEntity(_0xb9520b,_0x4a1887){return function(_0xc80a35){if(_0xc80a35){return _0xc80a35[_0x2a9d('0x25')]()['then'](function(){_0xb9520b[_0x2a9d('0x19')](0xcc)[_0x2a9d('0x1a')]();});}};}function handleEntityNotFound(_0x5d6ef8,_0x3d46eb){return function(_0x29b131){if(!_0x29b131){_0x5d6ef8['sendStatus'](0x194);}return _0x29b131;};}function handleError(_0x91ef67,_0x510b23){_0x510b23=_0x510b23||0x1f4;return function(_0x186e8f){logger[_0x2a9d('0x26')](_0x186e8f['stack']);if(_0x186e8f[_0x2a9d('0x27')]){delete _0x186e8f[_0x2a9d('0x27')];}_0x91ef67[_0x2a9d('0x19')](_0x510b23)[_0x2a9d('0x28')](_0x186e8f);};}exports[_0x2a9d('0x29')]=function(_0x5bcf09,_0x259c7f){var _0x2069d9={},_0x3c0a03={},_0x9542b8={'count':0x0,'rows':[]};var _0x501791=_[_0x2a9d('0x2a')](db[_0x2a9d('0x2b')][_0x2a9d('0x2c')],function(_0x3eb53f){return{'name':_0x3eb53f[_0x2a9d('0x2d')],'type':_0x3eb53f['type']['key']};});_0x3c0a03[_0x2a9d('0x2e')]=_[_0x2a9d('0x2a')](_0x501791,_0x2a9d('0x27'));_0x3c0a03[_0x2a9d('0x2f')]=_[_0x2a9d('0x30')](_0x5bcf09[_0x2a9d('0x2f')]);_0x3c0a03[_0x2a9d('0x31')]=_[_0x2a9d('0x32')](_0x3c0a03[_0x2a9d('0x2e')],_0x3c0a03[_0x2a9d('0x2f')]);_0x2069d9[_0x2a9d('0x33')]=_['intersection'](_0x3c0a03[_0x2a9d('0x2e')],qs['fields'](_0x5bcf09[_0x2a9d('0x2f')][_0x2a9d('0x34')]));_0x2069d9[_0x2a9d('0x33')]=_0x2069d9[_0x2a9d('0x33')][_0x2a9d('0x35')]?_0x2069d9['attributes']:_0x3c0a03['model'];if(!_0x5bcf09[_0x2a9d('0x2f')]['hasOwnProperty'](_0x2a9d('0x36'))){_0x2069d9[_0x2a9d('0x1c')]=qs['limit'](_0x5bcf09[_0x2a9d('0x2f')][_0x2a9d('0x1c')]);_0x2069d9[_0x2a9d('0x1e')]=qs['offset'](_0x5bcf09[_0x2a9d('0x2f')][_0x2a9d('0x1e')]);}_0x2069d9[_0x2a9d('0x37')]=qs[_0x2a9d('0x38')](_0x5bcf09[_0x2a9d('0x2f')][_0x2a9d('0x38')]);_0x2069d9[_0x2a9d('0x39')]=qs[_0x2a9d('0x31')](_[_0x2a9d('0x3a')](_0x5bcf09['query'],_0x3c0a03['filters']),_0x501791);if(_0x5bcf09[_0x2a9d('0x2f')][_0x2a9d('0x3b')]){_0x2069d9[_0x2a9d('0x39')]=_[_0x2a9d('0x3c')](_0x2069d9[_0x2a9d('0x39')],{'$or':_[_0x2a9d('0x2a')](_0x501791,function(_0x2e4250){if(_0x2e4250[_0x2a9d('0x3d')]!==_0x2a9d('0x3e')){var _0x2e054f={};_0x2e054f[_0x2e4250[_0x2a9d('0x27')]]={'$like':'%'+_0x5bcf09['query'][_0x2a9d('0x3b')]+'%'};return _0x2e054f;}})});}_0x2069d9=_[_0x2a9d('0x3c')]({},_0x2069d9,_0x5bcf09[_0x2a9d('0x3f')]);var _0x2df35c={'where':_0x2069d9['where']};return db[_0x2a9d('0x2b')][_0x2a9d('0x1d')](_0x2df35c)[_0x2a9d('0x24')](function(_0x4eb04b){_0x9542b8[_0x2a9d('0x1d')]=_0x4eb04b;if(_0x5bcf09['query'][_0x2a9d('0x40')]){_0x2069d9[_0x2a9d('0x41')]=[{'all':!![]}];}return db[_0x2a9d('0x2b')]['findAll'](_0x2069d9);})[_0x2a9d('0x24')](function(_0xef4997){_0x9542b8[_0x2a9d('0x42')]=_0xef4997;return _0x9542b8;})[_0x2a9d('0x24')](respondWithFilteredResult(_0x259c7f,_0x2069d9))[_0x2a9d('0x43')](handleError(_0x259c7f,null));};exports[_0x2a9d('0x44')]=function(_0x120c34,_0x3373cd){var _0x4ff6e9={'raw':!![],'where':{'id':_0x120c34[_0x2a9d('0x45')]['id']}},_0x3cc2d7={};_0x3cc2d7['model']=_[_0x2a9d('0x30')](db[_0x2a9d('0x2b')][_0x2a9d('0x2c')]);_0x3cc2d7[_0x2a9d('0x2f')]=_[_0x2a9d('0x30')](_0x120c34[_0x2a9d('0x2f')]);_0x3cc2d7[_0x2a9d('0x31')]=_['intersection'](_0x3cc2d7['model'],_0x3cc2d7[_0x2a9d('0x2f')]);_0x4ff6e9[_0x2a9d('0x33')]=_[_0x2a9d('0x32')](_0x3cc2d7[_0x2a9d('0x2e')],qs[_0x2a9d('0x34')](_0x120c34[_0x2a9d('0x2f')][_0x2a9d('0x34')]));_0x4ff6e9[_0x2a9d('0x33')]=_0x4ff6e9[_0x2a9d('0x33')][_0x2a9d('0x35')]?_0x4ff6e9[_0x2a9d('0x33')]:_0x3cc2d7['model'];if(_0x120c34[_0x2a9d('0x2f')][_0x2a9d('0x40')]){_0x4ff6e9[_0x2a9d('0x41')]=[{'all':!![]}];}_0x4ff6e9=_['merge']({},_0x4ff6e9,_0x120c34[_0x2a9d('0x3f')]);return db[_0x2a9d('0x2b')][_0x2a9d('0x46')](_0x4ff6e9)[_0x2a9d('0x24')](handleEntityNotFound(_0x3373cd,null))[_0x2a9d('0x24')](respondWithResult(_0x3373cd,null))[_0x2a9d('0x43')](handleError(_0x3373cd,null));};exports[_0x2a9d('0x47')]=function(_0xfeca32,_0x273144){return db['SmsApplication'][_0x2a9d('0x47')](_0xfeca32[_0x2a9d('0x48')],{})[_0x2a9d('0x24')](respondWithResult(_0x273144,0xc9))[_0x2a9d('0x43')](handleError(_0x273144,null));};exports[_0x2a9d('0x23')]=function(_0x1f2e8c,_0x4919c3){if(_0x1f2e8c[_0x2a9d('0x48')]['id']){delete _0x1f2e8c[_0x2a9d('0x48')]['id'];}return db[_0x2a9d('0x2b')]['find']({'where':{'id':_0x1f2e8c[_0x2a9d('0x45')]['id']}})[_0x2a9d('0x24')](handleEntityNotFound(_0x4919c3,null))[_0x2a9d('0x24')](saveUpdates(_0x1f2e8c[_0x2a9d('0x48')],null))[_0x2a9d('0x24')](respondWithResult(_0x4919c3,null))[_0x2a9d('0x43')](handleError(_0x4919c3,null));};exports[_0x2a9d('0x25')]=function(_0x175792,_0x4129f9){return db['SmsApplication'][_0x2a9d('0x46')]({'where':{'id':_0x175792['params']['id']}})[_0x2a9d('0x24')](handleEntityNotFound(_0x4129f9,null))['then'](removeEntity(_0x4129f9,null))[_0x2a9d('0x43')](handleError(_0x4129f9,null));};
\ No newline at end of file
index 48d7e33..5a9a91a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbda9=['./smsApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3f9ec3,_0x3dfd37){var _0xe85b13=function(_0x10e8ed){while(--_0x10e8ed){_0x3f9ec3['push'](_0x3f9ec3['shift']());}};_0xe85b13(++_0x3dfd37);}(_0xbda9,0x101));var _0x9bda=function(_0x25fbf2,_0x35de8d){_0x25fbf2=_0x25fbf2-0x0;var _0x57519e=_0xbda9[_0x25fbf2];return _0x57519e;};'use strict';var _=require(_0x9bda('0x0'));var util=require(_0x9bda('0x1'));var logger=require(_0x9bda('0x2'))(_0x9bda('0x3'));var moment=require(_0x9bda('0x4'));var BPromise=require(_0x9bda('0x5'));var rp=require(_0x9bda('0x6'));var fs=require('fs');var path=require(_0x9bda('0x7'));var rimraf=require(_0x9bda('0x8'));var config=require('../../config/environment');var attributes=require(_0x9bda('0x9'));module[_0x9bda('0xa')]=function(_0x26544e,_0x4d2979){return _0x26544e[_0x9bda('0xb')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9bda('0xc'),'collate':_0x9bda('0xd')});};
\ No newline at end of file
+var _0x76ae=['rimraf','../../config/environment','define','sms_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x32744d,_0x79cca1){var _0x4f3f2c=function(_0x370b94){while(--_0x370b94){_0x32744d['push'](_0x32744d['shift']());}};_0x4f3f2c(++_0x79cca1);}(_0x76ae,0x155));var _0xe76a=function(_0x10d244,_0x49c680){_0x10d244=_0x10d244-0x0;var _0x67755d=_0x76ae[_0x10d244];return _0x67755d;};'use strict';var _=require(_0xe76a('0x0'));var util=require(_0xe76a('0x1'));var logger=require(_0xe76a('0x2'))(_0xe76a('0x3'));var moment=require(_0xe76a('0x4'));var BPromise=require('bluebird');var rp=require(_0xe76a('0x5'));var fs=require('fs');var path=require(_0xe76a('0x6'));var rimraf=require(_0xe76a('0x7'));var config=require(_0xe76a('0x8'));var attributes=require('./smsApplication.attributes');module['exports']=function(_0x19d5e4,_0x497064){return _0x19d5e4[_0xe76a('0x9')]('SmsApplication',attributes,{'tableName':_0xe76a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe76a('0xb')});};
\ No newline at end of file
index d5f5051..acf3573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e94=['rpc','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x12dbb5,_0x1c0f0f){var _0xf922ac=function(_0x3e8631){while(--_0x3e8631){_0x12dbb5['push'](_0x12dbb5['shift']());}};_0xf922ac(++_0x1c0f0f);}(_0x3e94,0x67));var _0x43e9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3e94[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x43e9('0x0'));var util=require(_0x43e9('0x1'));var moment=require('moment');var BPromise=require(_0x43e9('0x2'));var rs=require(_0x43e9('0x3'));var fs=require('fs');var Redis=require(_0x43e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x43e9('0x5'));var logger=require(_0x43e9('0x6'))(_0x43e9('0x7'));var config=require('../../config/environment');var jayson=require(_0x43e9('0x8'));var client=jayson['client'][_0x43e9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b35f1,_0x1183a0,_0x2989fe){return new BPromise(function(_0x287aaf,_0x510ee7){return client[_0x43e9('0xa')](_0x4b35f1,_0x2989fe)[_0x43e9('0xb')](function(_0x43d6e8){logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));logger[_0x43e9('0xf')](_0x43e9('0x10'),_0x1183a0,_0x43e9('0xe'),JSON['stringify'](_0x43d6e8));if(_0x43d6e8[_0x43e9('0x11')]){if(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x12')]===0x1f4){logger['error'](_0x43e9('0xd'),_0x1183a0,_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);return _0x510ee7(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x1183a0,_0x43d6e8[_0x43e9('0x11')]['message']);return _0x287aaf(_0x43d6e8[_0x43e9('0x11')][_0x43e9('0x13')]);}else{logger[_0x43e9('0xc')](_0x43e9('0xd'),_0x1183a0,_0x43e9('0xe'));_0x287aaf(_0x43d6e8[_0x43e9('0x14')][_0x43e9('0x13')]);}})[_0x43e9('0x15')](function(_0x3f7164){logger[_0x43e9('0x11')](_0x43e9('0xd'),_0x1183a0,_0x3f7164);_0x510ee7(_0x3f7164);});});}
\ No newline at end of file
+var _0xa24d=['http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x103c58,_0x4ccc7b){var _0x220461=function(_0x50b638){while(--_0x50b638){_0x103c58['push'](_0x103c58['shift']());}};_0x220461(++_0x4ccc7b);}(_0xa24d,0x1c1));var _0xda24=function(_0x4e4d5c,_0x25dd3a){_0x4e4d5c=_0x4e4d5c-0x0;var _0x56854a=_0xa24d[_0x4e4d5c];return _0x56854a;};'use strict';var _=require(_0xda24('0x0'));var util=require(_0xda24('0x1'));var moment=require(_0xda24('0x2'));var BPromise=require(_0xda24('0x3'));var rs=require(_0xda24('0x4'));var fs=require('fs');var Redis=require(_0xda24('0x5'));var db=require(_0xda24('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xda24('0x7'))(_0xda24('0x8'));var config=require(_0xda24('0x9'));var jayson=require(_0xda24('0xa'));var client=jayson['client'][_0xda24('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xdba54e,_0x5868af,_0x3d0ec5){return new BPromise(function(_0x48117a,_0x446e2e){return client[_0xda24('0xc')](_0xdba54e,_0x3d0ec5)[_0xda24('0xd')](function(_0x1dccb2){logger['info'](_0xda24('0xe'),_0x5868af,_0xda24('0xf'));logger[_0xda24('0x10')](_0xda24('0x11'),_0x5868af,_0xda24('0xf'),JSON['stringify'](_0x1dccb2));if(_0x1dccb2[_0xda24('0x12')]){if(_0x1dccb2['error'][_0xda24('0x13')]===0x1f4){logger[_0xda24('0x12')]('SmsApplication,\x20%s,\x20%s',_0x5868af,_0x1dccb2['error'][_0xda24('0x14')]);return _0x446e2e(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}logger[_0xda24('0x12')]('SmsApplication,\x20%s,\x20%s',_0x5868af,_0x1dccb2[_0xda24('0x12')]['message']);return _0x48117a(_0x1dccb2[_0xda24('0x12')][_0xda24('0x14')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5868af,_0xda24('0xf'));_0x48117a(_0x1dccb2[_0xda24('0x15')][_0xda24('0x14')]);}})[_0xda24('0x16')](function(_0x3348e0){logger[_0xda24('0x12')](_0xda24('0xe'),_0x5868af,_0x3348e0);_0x446e2e(_0x3348e0);});});}
\ No newline at end of file
index 6838e74..28a2131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x3e37b3,_0x570305){var _0x47e724=function(_0x3f4884){while(--_0x3f4884){_0x3e37b3['push'](_0x3e37b3['shift']());}};_0x47e724(++_0x570305);}(_0x7708,0x188));var _0x8770=function(_0x53e3fa,_0x50c5f2){_0x53e3fa=_0x53e3fa-0x0;var _0xe8584a=_0x7708[_0x53e3fa];return _0xe8584a;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router;
\ No newline at end of file
+var _0x8f4c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout'];(function(_0x4cf005,_0x2efccb){var _0x2e20cb=function(_0x23a8b0){while(--_0x23a8b0){_0x4cf005['push'](_0x4cf005['shift']());}};_0x2e20cb(++_0x2efccb);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1deab1,_0x3ca2f0){_0x1deab1=_0x1deab1-0x0;var _0x30822d=_0x8f4c[_0x1deab1];return _0x30822d;};'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('./smsInteraction.controller');router[_0xc8f4('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8f4('0xa'),auth['isAuthenticated'](),controller[_0xc8f4('0xb')]);router[_0xc8f4('0x9')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0xe')]);router['get'](_0xc8f4('0xf'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x10')]);router[_0xc8f4('0x9')]('/:id/download',auth[_0xc8f4('0xd')](),controller['download']);router[_0xc8f4('0x11')]('/',auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x12')]);router[_0xc8f4('0x11')](_0xc8f4('0xf'),auth['isAuthenticated'](),controller[_0xc8f4('0x13')]);router[_0xc8f4('0x11')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),'smsinteraction:addtags'),controller[_0xc8f4('0x17')]);router[_0xc8f4('0x18')](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')]('sms',_0xc8f4('0x19')),controller['update']);router['delete'](_0xc8f4('0xc'),auth[_0xc8f4('0xd')](),interaction[_0xc8f4('0x15')](_0xc8f4('0x16'),_0xc8f4('0x1a')),controller[_0xc8f4('0x1b')]);router[_0xc8f4('0x1c')](_0xc8f4('0x14'),auth[_0xc8f4('0xd')](),controller[_0xc8f4('0x1d')]);module[_0xc8f4('0x1e')]=router;
\ No newline at end of file
index 930d453..8eadb20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51f2=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x51f2,0xeb));var _0x251f=function(_0x572667,_0x1db39a){_0x572667=_0x572667-0x0;var _0x417936=_0x51f2[_0x572667];return _0x417936;};'use strict';var Sequelize=require(_0x251f('0x0'));var moment=require(_0x251f('0x1'));module[_0x251f('0x2')]={'closed':{'type':Sequelize[_0x251f('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x251f('0x4')]},'disposition':{'type':Sequelize[_0x251f('0x5')]},'secondDisposition':{'type':Sequelize[_0x251f('0x5')]},'thirdDisposition':{'type':Sequelize[_0x251f('0x5')]},'note':{'type':Sequelize[_0x251f('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x251f('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x251f('0x6')]('in',_0x251f('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x251f('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x251f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x251f('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3baf=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x3baf,0xf7));var _0xf3ba=function(_0x4a1cc2,_0x545018){_0x4a1cc2=_0x4a1cc2-0x0;var _0x21ca95=_0x3baf[_0x4a1cc2];return _0x21ca95;};'use strict';var Sequelize=require(_0xf3ba('0x0'));var moment=require(_0xf3ba('0x1'));module[_0xf3ba('0x2')]={'closed':{'type':Sequelize[_0xf3ba('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf3ba('0x4')]},'disposition':{'type':Sequelize[_0xf3ba('0x5')]},'secondDisposition':{'type':Sequelize[_0xf3ba('0x5')]},'thirdDisposition':{'type':Sequelize[_0xf3ba('0x5')]},'note':{'type':Sequelize[_0xf3ba('0x5')]},'phone':{'type':Sequelize[_0xf3ba('0x5')]},'read1stAt':{'type':Sequelize[_0xf3ba('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf3ba('0x6')]('in',_0xf3ba('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf3ba('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf3ba('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index db07b1c..ab9cc8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee68=['log','err','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','stack','name','send','Users','map','fullname','Tags','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','select','field','from','tools_tags','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','buildExpression','keys','some','compact','isEmpty','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','i.phone\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','SELECT','unreadMessages','DESC','resolve','SmsAccountId','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','catch','show','params','includeAll','include','create','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','color','removeTags','download','unix','join','root','tmp','server','files','attachments','format','transcript-%d-%s.zip','firstName','lastName','Messages','direction','secret','SmsAccount','Owner','get','mkdirSync','Sms','Account','closed','closedAt','out','System','Contact','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML'];(function(_0x1c4e3d,_0x4b5da5){var _0xc03b3b=function(_0x16a471){while(--_0x16a471){_0x1c4e3d['push'](_0x1c4e3d['shift']());}};_0xc03b3b(++_0x4b5da5);}(_0xee68,0x1d7));var _0x8ee6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xee68[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x8ee6('0x0'));var rimraf=require(_0x8ee6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8ee6('0x2'));var BPromise=require(_0x8ee6('0x3'));var Mustache=require(_0x8ee6('0x4'));var util=require(_0x8ee6('0x5'));var path=require('path');var sox=require(_0x8ee6('0x6'));var csv=require(_0x8ee6('0x7'));var ejs=require(_0x8ee6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ee6('0x9'));var squel=require(_0x8ee6('0xa'));var crypto=require(_0x8ee6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8ee6('0xc'));var toCsv=require(_0x8ee6('0x7'));var querystring=require(_0x8ee6('0xd'));var Papa=require(_0x8ee6('0xe'));var Redis=require(_0x8ee6('0xf'));var authService=require(_0x8ee6('0x10'));var qs=require(_0x8ee6('0x11'));var as=require(_0x8ee6('0x12'));var pdf=require(_0x8ee6('0x13'));var hardwareService=require(_0x8ee6('0x14'));var logger=require('../../config/logger')(_0x8ee6('0x15'));var utils=require(_0x8ee6('0x16'));var config=require(_0x8ee6('0x17'));var licenseUtil=require(_0x8ee6('0x18'));var db=require(_0x8ee6('0x19'))['db'];config[_0x8ee6('0x1a')]=_[_0x8ee6('0x1b')](config[_0x8ee6('0x1a')],{'host':_0x8ee6('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ee6('0x1a')]));require(_0x8ee6('0x1d'))[_0x8ee6('0x1e')](socket);function respondWithStatusCode(_0x438eb8,_0x548c43){_0x548c43=_0x548c43||0xcc;return function(_0x547ccc){if(_0x547ccc){return _0x438eb8[_0x8ee6('0x1f')](_0x548c43);}return _0x438eb8['status'](_0x548c43)[_0x8ee6('0x20')]();};}function respondWithResult(_0x41473a,_0x583984){_0x583984=_0x583984||0xc8;return function(_0x4c563c){if(_0x4c563c){return _0x41473a[_0x8ee6('0x21')](_0x583984)['json'](_0x4c563c);}};}function respondWithFilteredResult(_0x3f150e,_0x47a1e1){return function(_0x3c4849){if(_0x3c4849){var _0x2e8592=typeof _0x47a1e1[_0x8ee6('0x22')]===_0x8ee6('0x23')&&typeof _0x47a1e1[_0x8ee6('0x24')]===_0x8ee6('0x23');var _0x1858a6=_0x3c4849[_0x8ee6('0x25')];var _0x43214e=_0x2e8592?0x0:_0x47a1e1['offset'];var _0x349668=_0x2e8592?_0x3c4849[_0x8ee6('0x25')]:_0x47a1e1[_0x8ee6('0x22')]+_0x47a1e1['limit'];var _0x724e9e;if(_0x349668>=_0x1858a6){_0x349668=_0x1858a6;_0x724e9e=0xc8;}else{_0x724e9e=0xce;}_0x3f150e[_0x8ee6('0x21')](_0x724e9e);return _0x3f150e[_0x8ee6('0x26')](_0x8ee6('0x27'),_0x43214e+'-'+_0x349668+'/'+_0x1858a6)[_0x8ee6('0x28')](_0x3c4849);}return null;};}function patchUpdates(_0x1f47cf){return function(_0x27832d){try{jsonpatch['apply'](_0x27832d,_0x1f47cf,!![]);}catch(_0x22cc86){return BPromise['reject'](_0x22cc86);}return _0x27832d[_0x8ee6('0x29')]();};}function saveUpdates(_0xb2affd,_0x3a05ea){return function(_0x46b5f6){if(_0x46b5f6){return _0x46b5f6[_0x8ee6('0x2a')](_0xb2affd)[_0x8ee6('0x2b')](function(_0x2ff971){return _0x2ff971;});}return null;};}function removeEntity(_0x3e65bb,_0x5569a9){return function(_0x57ac3c){if(_0x57ac3c){return _0x57ac3c[_0x8ee6('0x2c')]()[_0x8ee6('0x2b')](function(){_0x3e65bb[_0x8ee6('0x21')](0xcc)[_0x8ee6('0x20')]();});}};}function handleEntityNotFound(_0x31615d,_0x45c65e){return function(_0x1c2be4){if(!_0x1c2be4){_0x31615d['sendStatus'](0x194);}return _0x1c2be4;};}function handleError(_0xd16f39,_0x447d32){_0x447d32=_0x447d32||0x1f4;return function(_0x453998){logger['error'](_0x453998[_0x8ee6('0x2d')]);if(_0x453998[_0x8ee6('0x2e')]){delete _0x453998[_0x8ee6('0x2e')];}_0xd16f39[_0x8ee6('0x21')](_0x447d32)[_0x8ee6('0x2f')](_0x453998);};}function getInteractionUsers(_0x24e2eb,_0x3ba319){return new BPromise(function(_0x3becff,_0x48490e){try{if(_0x3ba319[_0x24e2eb['id']]){_0x24e2eb[_0x8ee6('0x30')]=_[_0x8ee6('0x31')](_0x3ba319[_0x24e2eb['id']],function(_0x848daa){return{'id':_0x848daa['id'],'fullname':_0x848daa[_0x8ee6('0x32')]};});}}catch(_0x43b17d){_0x48490e(_0x43b17d);}_0x3becff(_0x24e2eb);});}function getInteractionTags(_0x30e8a0,_0x4ef330){return new BPromise(function(_0x105235,_0x218718){try{if(_0x30e8a0['TagIds']){_0x30e8a0[_0x8ee6('0x33')]=[];_0x30e8a0['TagIds'][_0x8ee6('0x34')](',')[_0x8ee6('0x35')](function(_0x23bd52){_0x30e8a0[_0x8ee6('0x33')][_0x8ee6('0x36')](_0x4ef330[_0x23bd52]);});}delete _0x30e8a0['TagIds'];}catch(_0x411c6b){_0x218718(_0x411c6b);}_0x105235(_0x30e8a0);});}function updateSmsInteraction(_0x16de58,_0x24febd,_0x1b0c2f){return new BPromise(function(_0x1324b6,_0x1eaafd){return getInteractionUsers(_0x16de58,_0x1b0c2f)[_0x8ee6('0x2b')](function(_0x403d23){return getInteractionTags(_0x403d23,_0x24febd);})[_0x8ee6('0x2b')](function(_0x3aef23){_0x1324b6(_0x3aef23);})['catch'](function(_0x434e37){_0x1eaafd(_0x434e37);});});}exports[_0x8ee6('0x37')]=function(_0x198e87,_0x4efa0f){var _0x3d9cbf={},_0x19226b={},_0x10159e={'count':0x0,'rows':[]};var _0x3ce3ba=_['map'](db[_0x8ee6('0x38')][_0x8ee6('0x39')],function(_0x16cb4e){return{'name':_0x16cb4e[_0x8ee6('0x3a')],'type':_0x16cb4e['type'][_0x8ee6('0x3b')]};});_0x19226b['model']=_['map'](_0x3ce3ba,'name');_0x19226b[_0x8ee6('0x3c')]=_['keys'](_0x198e87[_0x8ee6('0x3c')]);_0x19226b['filters']=_[_0x8ee6('0x3d')](_0x19226b[_0x8ee6('0x3e')],_0x19226b[_0x8ee6('0x3c')]);_0x3d9cbf[_0x8ee6('0x3f')]=_[_0x8ee6('0x3d')](_0x19226b[_0x8ee6('0x3e')],qs[_0x8ee6('0x40')](_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x40')]));_0x3d9cbf['attributes']=_0x3d9cbf[_0x8ee6('0x3f')][_0x8ee6('0x41')]?_0x3d9cbf[_0x8ee6('0x3f')]:_0x19226b[_0x8ee6('0x3e')];if(!_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x42')]('nolimit')){_0x3d9cbf['limit']=qs[_0x8ee6('0x24')](_0x198e87['query'][_0x8ee6('0x24')]);_0x3d9cbf[_0x8ee6('0x22')]=qs[_0x8ee6('0x22')](_0x198e87['query'][_0x8ee6('0x22')]);}_0x3d9cbf[_0x8ee6('0x43')]=qs[_0x8ee6('0x44')](_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x44')]);_0x3d9cbf['where']=qs['filters'](_['pick'](_0x198e87[_0x8ee6('0x3c')],_0x19226b[_0x8ee6('0x45')]),_0x3ce3ba);var _0x2f686b=[];var _0x1e07bd=squel[_0x8ee6('0x46')]()[_0x8ee6('0x47')]('id')['field'](_0x8ee6('0x2e'))[_0x8ee6('0x47')]('color')[_0x8ee6('0x48')](_0x8ee6('0x49'));var _0x14728e=squel['select']()['field'](_0x8ee6('0x4a'))['field'](_0x8ee6('0x4b'))[_0x8ee6('0x47')]('ui.SmsInteractionId')[_0x8ee6('0x48')](_0x8ee6('0x4c'),'ui')[_0x8ee6('0x4d')](_0x8ee6('0x4e'),'u',_0x8ee6('0x4f'));var _0x4aa43b=squel[_0x8ee6('0x46')]()[_0x8ee6('0x48')](_0x8ee6('0x50'),'i')[_0x8ee6('0x4d')]('cm_contacts','c',_0x8ee6('0x51'))[_0x8ee6('0x4d')](_0x8ee6('0x4e'),'o',_0x8ee6('0x52'))[_0x8ee6('0x4d')](_0x8ee6('0x53'),'a',_0x8ee6('0x54'))[_0x8ee6('0x4d')](_0x8ee6('0x55'),'me',_0x8ee6('0x56'))[_0x8ee6('0x4d')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join']('tools_tags','t',_0x8ee6('0x57'));var _0x49e734=squel[_0x8ee6('0x58')]();var _0x354272=[];var _0xfcd327=squel[_0x8ee6('0x58')]();var _0x10a479;if(_0x198e87[_0x8ee6('0x3c')]['search']){_0x10a479=as[_0x8ee6('0x59')](_0x198e87[_0x8ee6('0x3c')]['search']);var _0x16536e=_0x10a479[_0x8ee6('0x5a')];for(var _0x261bc5=0x0;_0x261bc5<_0x10a479[_0x8ee6('0x5b')][_0x8ee6('0x41')];_0x261bc5++){var _0xb2bbfd=_0x10a479[_0x8ee6('0x5b')][_0x261bc5];var _0xcffc4='i';var _0xe10741=_['find'](_0x3ce3ba,['name',_0xb2bbfd[_0x8ee6('0x47')]]);if(!_0xe10741){switch(_0xb2bbfd[_0x8ee6('0x47')]){case'unreadMessages':if(_0xb2bbfd[_0x8ee6('0x5c')]==0x1){_0x4aa43b[_0x8ee6('0x5d')]('`'+_0xb2bbfd[_0x8ee6('0x47')]+_0x8ee6('0x5e'));}else{_0x4aa43b[_0x8ee6('0x5d')]('`'+_0xb2bbfd[_0x8ee6('0x47')]+_0x8ee6('0x5f'));}break;case'Contact':if(_0xb2bbfd[_0x8ee6('0x60')]===_0x8ee6('0x61')){if(_0xb2bbfd[_0x8ee6('0x5c')][_0x8ee6('0x34')]('\x20')[_0x8ee6('0x41')]>0x1){_0x49e734[_0x16536e](_0x8ee6('0x62'),qs['getFullTextValue'](_0xb2bbfd[_0x8ee6('0x5c')]),null);}else{var _0x55b0fc='%'+_0xb2bbfd[_0x8ee6('0x5c')]+'%';_0x49e734[_0x16536e](_0x8ee6('0x63'),_0x55b0fc,_0x55b0fc,_0x55b0fc);}}else{_0xe10741=_['find'](_0x3ce3ba,[_0x8ee6('0x2e'),_0x8ee6('0x64')]);_0xb2bbfd[_0x8ee6('0x47')]=_0x8ee6('0x64');_0x176408=as['buildExpression'](_0xcffc4,_0xe10741[_0x8ee6('0x65')],_0xb2bbfd);_0x49e734[_0x16536e](_0x176408[_0x8ee6('0x66')],_0x176408[_0x8ee6('0x5c')][_0x8ee6('0x67')],_0x176408[_0x8ee6('0x5c')][_0x8ee6('0x20')]);}break;case _0x8ee6('0x68'):var _0x10e6ac=_0xb2bbfd[_0x8ee6('0x5c')][_0x8ee6('0x34')](',')[_0x8ee6('0x31')](function(_0x2d5e85){return Number(_0x2d5e85);});_0x10e6ac[_0x8ee6('0x35')](function(_0x28ad37){_0xfcd327['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x28ad37+',%');});_0x354272=_[_0x8ee6('0x69')](_0x354272,_0x10e6ac);break;case _0x8ee6('0x6a'):if(_0xb2bbfd[_0x8ee6('0x60')]===_0x8ee6('0x61')){_0x49e734[_0x16536e](_0x8ee6('0x6b'),'%'+_0xb2bbfd[_0x8ee6('0x5c')]+'%',null);}else{_0xe10741=_[_0x8ee6('0x6c')](_0x3ce3ba,['name',_0x8ee6('0x6d')]);_0xb2bbfd[_0x8ee6('0x47')]=_0x8ee6('0x6d');_0x176408=as['buildExpression'](_0xcffc4,_0xe10741[_0x8ee6('0x65')],_0xb2bbfd);_0x49e734[_0x16536e](_0x176408[_0x8ee6('0x66')],_0x176408[_0x8ee6('0x5c')][_0x8ee6('0x67')],_0x176408[_0x8ee6('0x5c')][_0x8ee6('0x20')]);}break;case'body':_0x176408=as[_0x8ee6('0x6e')]('me',null,_0xb2bbfd);_0x49e734[_0x16536e](_0x176408[_0x8ee6('0x66')],_0x176408['value'][_0x8ee6('0x67')],_0x176408[_0x8ee6('0x5c')]['end']);break;}}else{var _0x176408=as['buildExpression'](_0xcffc4,_0xe10741[_0x8ee6('0x65')],_0xb2bbfd);_0x49e734[_0x16536e](_0x176408[_0x8ee6('0x66')],_0x176408[_0x8ee6('0x5c')]['start'],_0x176408[_0x8ee6('0x5c')]['end']);}}}else{var _0xced575=_(_0x198e87[_0x8ee6('0x3c')])[_0x8ee6('0x6f')]()[_0x8ee6('0x31')](function(_0x28a12b){return _[_0x8ee6('0x70')](_0x3ce3ba,['name',_0x28a12b])?_0x28a12b:undefined;})[_0x8ee6('0x71')]()[_0x8ee6('0x5c')]();if(!_[_0x8ee6('0x72')](_0xced575)){_0xced575[_0x8ee6('0x35')](function(_0x90f770){if(_0x90f770==='SmsAccountId'){_0x4aa43b['where'](_0x8ee6('0x73'),[][_0x8ee6('0x74')](_0x198e87[_0x8ee6('0x3c')][_0x90f770]));}else if(_0x90f770===_0x8ee6('0x75')){var _0x5904ae=JSON['parse'](_0x198e87['query'][_0x90f770])[_0x8ee6('0x76')];var _0xa84dbe=JSON[_0x8ee6('0x77')](_0x198e87['query'][_0x90f770])[_0x8ee6('0x78')];_0x4aa43b[_0x8ee6('0x79')](_0x8ee6('0x7a'),_0x5904ae,_0xa84dbe);}else{if(_0x198e87['query'][_0x90f770]===_0x8ee6('0x7b')){_0x4aa43b[_0x8ee6('0x79')]('i.'+_0x90f770+_0x8ee6('0x7c'));}else{_0x4aa43b[_0x8ee6('0x79')]('i.'+_0x90f770+_0x8ee6('0x7d'),_0x198e87['query'][_0x90f770]);}}});}if(_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x7e')]){if(_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x7e')]==0x1){_0x4aa43b[_0x8ee6('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4aa43b[_0x8ee6('0x5d')](_0x8ee6('0x7f'));}}if(_0x198e87['query'][_0x8ee6('0x80')]){_0x354272=_[_0x8ee6('0x81')](_0x198e87['query'][_0x8ee6('0x80')])?_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x80')]:new Array(_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x80')]);_0x354272[_0x8ee6('0x35')](function(_0x479294){_0xfcd327['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x479294+',%');});}if(_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x82')]){var _0x4797b3=_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x82')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4797b3)){_0x49e734['or'](_0x8ee6('0x83'),_0x4797b3+'%')['or'](_0x8ee6('0x84'),_0x4797b3+'%');}else{_0x49e734['or'](_0x8ee6('0x85'),qs[_0x8ee6('0x86')](_0x4797b3))['or'](_0x8ee6('0x87'),_0x4797b3+'%');}}}_0x4aa43b[_0x8ee6('0x79')](_0x49e734);_0x4aa43b[_0x8ee6('0x88')](_0x8ee6('0x89'));var _0x430e9f={'type':db[_0x8ee6('0x8a')][_0x8ee6('0x8b')][_0x8ee6('0x8c')],'raw':!![]};var _0x4c9789=_0x4aa43b['clone']();_0x4c9789['field'](_0x8ee6('0x89'));_0x4c9789[_0x8ee6('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8ee6('0x8d'));if(_0x3d9cbf[_0x8ee6('0x43')]){_0x3d9cbf[_0x8ee6('0x43')][_0x8ee6('0x35')](function(_0x2896d9){var _0x35813f=_0x2896d9[0x0]==='contactName'?_0x2896d9[0x0]:'i.'+_0x2896d9[0x0];_0x4aa43b[_0x8ee6('0x43')](_0x35813f,_0x2896d9[0x1]===_0x8ee6('0x8e')?![]:!![]);});}if(!_[_0x8ee6('0x72')](_0x354272)){_0x4aa43b[_0x8ee6('0x5d')](_0xfcd327);_0x4c9789[_0x8ee6('0x79')]('t.id\x20IN\x20?',_0x354272);}BPromise[_0x8ee6('0x8f')]()[_0x8ee6('0x2b')](function(){if(!_0x10a479){if(_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x90')])return;_0x4c9789[_0x8ee6('0x79')](_0x8ee6('0x91'));_0x4aa43b[_0x8ee6('0x79')](_0x8ee6('0x91'));return;}if(_0x198e87['user'][_0x8ee6('0x92')]!==_0x8ee6('0x93'))return;return _0x198e87[_0x8ee6('0x94')][_0x8ee6('0x95')]({'attributes':['id'],'raw':!![]})[_0x8ee6('0x2b')](function(_0x47e538){if(_['isEmpty'](_0x47e538)){_0x4c9789['where']('i.SmsAccountId\x20IS\x20NULL');_0x4aa43b[_0x8ee6('0x79')](_0x8ee6('0x96'));}else{_0x4c9789[_0x8ee6('0x79')](_0x8ee6('0x73'),_['map'](_0x47e538,'id'));_0x4aa43b['where']('i.SmsAccountId\x20IN\x20?',_[_0x8ee6('0x31')](_0x47e538,'id'));}});})[_0x8ee6('0x2b')](function(){if(_0x198e87['user'][_0x8ee6('0x92')]==='agent'&&!_0x10a479&&!_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x90')])return[];return db['sequelize'][_0x8ee6('0x3c')](_0x4c9789[_0x8ee6('0x97')](),_0x430e9f);})['then'](function(_0x50160b){_0x10159e[_0x8ee6('0x25')]=_0x50160b[_0x8ee6('0x41')];if(_0x10159e['count']===0x0)return[];return db[_0x8ee6('0x98')][_0x8ee6('0x3c')](_0x1e07bd[_0x8ee6('0x97')](),_0x430e9f)[_0x8ee6('0x2b')](function(_0x363262){_0x2f686b=_[_0x8ee6('0x99')](_0x363262,'id');_0x430e9f=_[_0x8ee6('0x9a')](_0x430e9f,{'model':db[_0x8ee6('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x198e87[_0x8ee6('0x3c')][_0x8ee6('0x40')]){_0x3d9cbf[_0x8ee6('0x3f')][_0x8ee6('0x35')](function(_0x19ba4d){_0x4aa43b['field']('i.'+_0x19ba4d);});}else{_0x4aa43b[_0x8ee6('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8ee6('0x8d'));_0x4aa43b['field']('a.key','Account.key');_0x4aa43b['field'](_0x8ee6('0x9b'),_0x8ee6('0x9c'));_0x4aa43b[_0x8ee6('0x47')]('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');_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0x9d'));_0x4aa43b[_0x8ee6('0x47')]('c.firstName',_0x8ee6('0x9e'));_0x4aa43b['field'](_0x8ee6('0x9f'),'Contact.lastName');_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0xa0'),_0x8ee6('0xa1'));_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0xa2'),_0x8ee6('0xa3'));_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0xa4'),_0x8ee6('0xa5'));_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0xa6'),_0x8ee6('0xa7'));_0x4aa43b['field']('o.fullname',_0x8ee6('0xa8'));_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0xa9'),_0x8ee6('0xaa'));_0x4aa43b[_0x8ee6('0x47')](_0x8ee6('0xab'),_0x8ee6('0xac'));}if(_0x3d9cbf[_0x8ee6('0x24')])_0x4aa43b['limit'](_0x3d9cbf[_0x8ee6('0x24')]);if(_0x3d9cbf[_0x8ee6('0x22')])_0x4aa43b[_0x8ee6('0x22')](_0x3d9cbf[_0x8ee6('0x22')]);return db['sequelize'][_0x8ee6('0x3c')](_0x4aa43b[_0x8ee6('0x97')](),_0x430e9f);})[_0x8ee6('0x2b')](function(_0x48689d){if(_0x48689d[_0x8ee6('0x41')]>0x0)_0x14728e[_0x8ee6('0x79')](_0x8ee6('0xad'),_['map'](_0x48689d,'id'));return db['sequelize'][_0x8ee6('0x3c')](_0x14728e[_0x8ee6('0x97')](),_0x430e9f)[_0x8ee6('0x2b')](function(_0x1fc1e2){var _0x411d0d=_['groupBy'](_0x1fc1e2,_0x8ee6('0xae'));var _0x5e16ff=[];_0x48689d[_0x8ee6('0x35')](function(_0x16df08){_0x5e16ff[_0x8ee6('0x36')](updateSmsInteraction(_0x16df08,_0x2f686b,_0x411d0d));});return BPromise[_0x8ee6('0xaf')](_0x5e16ff);});});})[_0x8ee6('0x2b')](function(_0x3e0dfd){_0x10159e[_0x8ee6('0xb0')]=_0x3e0dfd;return _0x10159e;})[_0x8ee6('0x2b')](respondWithFilteredResult(_0x4efa0f,_0x3d9cbf))[_0x8ee6('0xb1')](handleError(_0x4efa0f,null));};exports[_0x8ee6('0xb2')]=function(_0x5bbd6b,_0xfb051a){var _0x2fb8b3={'raw':![],'where':{'id':_0x5bbd6b[_0x8ee6('0xb3')]['id']}},_0x98927={};_0x98927['model']=_['keys'](db[_0x8ee6('0x38')][_0x8ee6('0x39')]);_0x98927[_0x8ee6('0x3c')]=_['keys'](_0x5bbd6b[_0x8ee6('0x3c')]);_0x98927[_0x8ee6('0x45')]=_[_0x8ee6('0x3d')](_0x98927[_0x8ee6('0x3e')],_0x98927[_0x8ee6('0x3c')]);_0x2fb8b3[_0x8ee6('0x3f')]=_[_0x8ee6('0x3d')](_0x98927[_0x8ee6('0x3e')],qs[_0x8ee6('0x40')](_0x5bbd6b['query'][_0x8ee6('0x40')]));_0x2fb8b3[_0x8ee6('0x3f')]=_0x2fb8b3[_0x8ee6('0x3f')]['length']?_0x2fb8b3[_0x8ee6('0x3f')]:_0x98927[_0x8ee6('0x3e')];if(_0x5bbd6b['query'][_0x8ee6('0xb4')]){_0x2fb8b3[_0x8ee6('0xb5')]=[{'all':!![]}];}_0x2fb8b3=_[_0x8ee6('0x9a')]({},_0x2fb8b3,_0x5bbd6b['options']);return db[_0x8ee6('0x38')]['find'](_0x2fb8b3)[_0x8ee6('0x2b')](handleEntityNotFound(_0xfb051a,null))['then'](respondWithResult(_0xfb051a,null))[_0x8ee6('0xb1')](handleError(_0xfb051a,null));};exports['create']=function(_0x3e073a,_0x3f204b){return db['SmsInteraction'][_0x8ee6('0xb6')](_0x3e073a[_0x8ee6('0xb7')],{})[_0x8ee6('0x2b')](respondWithResult(_0x3f204b,0xc9))[_0x8ee6('0xb1')](handleError(_0x3f204b,null));};exports['update']=function(_0x1141ac,_0x30ae3a){if(_0x1141ac[_0x8ee6('0xb7')]['id']){delete _0x1141ac['body']['id'];}return db[_0x8ee6('0x38')][_0x8ee6('0x6c')]({'where':{'id':_0x1141ac[_0x8ee6('0xb3')]['id']}})['then'](handleEntityNotFound(_0x30ae3a,null))['then'](saveUpdates(_0x1141ac['body'],null))[_0x8ee6('0x2b')](respondWithResult(_0x30ae3a,null))[_0x8ee6('0xb1')](handleError(_0x30ae3a,null));};exports[_0x8ee6('0x2c')]=function(_0xa9bef3,_0x42f4b4){return db[_0x8ee6('0x38')]['find']({'where':{'id':_0xa9bef3[_0x8ee6('0xb3')]['id']}})['then'](handleEntityNotFound(_0x42f4b4,null))['then'](removeEntity(_0x42f4b4,null))[_0x8ee6('0xb1')](handleError(_0x42f4b4,null));};exports[_0x8ee6('0xb8')]=function(_0x4eab31,_0x2c49f9){return db[_0x8ee6('0x38')][_0x8ee6('0xb8')]()[_0x8ee6('0x2b')](respondWithResult(_0x2c49f9,null))['catch'](handleError(_0x2c49f9,null));};exports[_0x8ee6('0xb9')]=function(_0x23f43d,_0x2e1a9f,_0x7e1a8a){return db[_0x8ee6('0xba')][_0x8ee6('0x6c')]({'where':{'id':_0x23f43d[_0x8ee6('0xb3')]['id']}})[_0x8ee6('0x2b')](handleEntityNotFound(_0x2e1a9f,null))[_0x8ee6('0x2b')](function(_0x37a7f2){if(_0x37a7f2){return _0x37a7f2[_0x8ee6('0xb9')](_0x23f43d[_0x8ee6('0xb7')][_0x8ee6('0xbb')],_['omit'](_0x23f43d[_0x8ee6('0xb7')],[_0x8ee6('0xbb'),'id'])||{});}})[_0x8ee6('0x2b')](respondWithResult(_0x2e1a9f,null))['catch'](handleError(_0x2e1a9f,null));};exports[_0x8ee6('0xbc')]=function(_0x14453a,_0x3f0959,_0xa2a384){var _0x3e9adf={'raw':![],'where':{}};var _0x5eb3b2={};var _0x2bd843={'count':0x0,'rows':[]};return db[_0x8ee6('0x38')][_0x8ee6('0xbd')]({'where':{'id':_0x14453a['params']['id']}})[_0x8ee6('0x2b')](handleEntityNotFound(_0x3f0959,null))[_0x8ee6('0x2b')](function(_0x35c857){if(_0x35c857){_0x5eb3b2[_0x8ee6('0x3e')]=_[_0x8ee6('0x6f')](db[_0x8ee6('0xba')][_0x8ee6('0x39')]);_0x5eb3b2['query']=_[_0x8ee6('0x6f')](_0x14453a[_0x8ee6('0x3c')]);_0x5eb3b2[_0x8ee6('0x45')]=_['intersection'](_0x5eb3b2[_0x8ee6('0x3e')],_0x5eb3b2[_0x8ee6('0x3c')]);_0x3e9adf[_0x8ee6('0x3f')]=_[_0x8ee6('0x3d')](_0x5eb3b2['model'],qs['fields'](_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x40')]));_0x3e9adf[_0x8ee6('0x3f')]=_0x3e9adf[_0x8ee6('0x3f')][_0x8ee6('0x41')]?_0x3e9adf[_0x8ee6('0x3f')]:_0x5eb3b2[_0x8ee6('0x3e')];if(!_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x42')]('nolimit')){_0x3e9adf[_0x8ee6('0x24')]=qs[_0x8ee6('0x24')](_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x24')]);_0x3e9adf[_0x8ee6('0x22')]=qs[_0x8ee6('0x22')](_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x22')]);}_0x3e9adf[_0x8ee6('0x43')]=qs[_0x8ee6('0x44')](_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x44')]);_0x3e9adf[_0x8ee6('0x79')]=qs['filters'](_[_0x8ee6('0xbe')](_0x14453a[_0x8ee6('0x3c')],_0x5eb3b2[_0x8ee6('0x45')]));_0x3e9adf['where'][_0x8ee6('0xae')]=_0x35c857['id'];if(_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x82')]){_0x3e9adf[_0x8ee6('0x79')]=_[_0x8ee6('0x9a')](_0x3e9adf[_0x8ee6('0x79')],{'$or':_['map'](_0x3e9adf[_0x8ee6('0x3f')],function(_0x21df36){var _0x3c677a={};_0x3c677a[_0x21df36]={'$like':'%'+_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0x82')]+'%'};return _0x3c677a;})});}if(_0x14453a[_0x8ee6('0x3c')]['$gte']){var _0x14ef95=_0x14453a['query'][_0x8ee6('0x76')][_0x8ee6('0x34')](',');var _0xd6bff1={};_0xd6bff1[_0x14ef95[0x0]]={'$gte':moment(_0x14ef95[0x1])['format'](_0x8ee6('0xbf'))};_0x3e9adf[_0x8ee6('0x79')]=_[_0x8ee6('0x9a')](_0x3e9adf['where'],_0xd6bff1);}_0x3e9adf=_[_0x8ee6('0x9a')]({},_0x3e9adf,_0x14453a['options']);return db[_0x8ee6('0xba')][_0x8ee6('0x25')]({'where':_0x3e9adf['where']})[_0x8ee6('0x2b')](function(_0x588f43){_0x2bd843[_0x8ee6('0x25')]=_0x588f43;if(_0x14453a[_0x8ee6('0x3c')][_0x8ee6('0xb4')]){_0x3e9adf[_0x8ee6('0xb5')]=[{'all':!![]}];}return db[_0x8ee6('0xba')][_0x8ee6('0xc0')](_0x3e9adf);})[_0x8ee6('0x2b')](function(_0x19ebb3){_0x2bd843['rows']=_0x19ebb3;return _0x2bd843;});}})[_0x8ee6('0x2b')](respondWithFilteredResult(_0x3f0959,_0x3e9adf))[_0x8ee6('0xb1')](handleError(_0x3f0959,null));};exports[_0x8ee6('0xc1')]=function(_0x119331,_0x569647,_0x2ac0df){return db[_0x8ee6('0x38')][_0x8ee6('0x6c')]({'where':{'id':_0x119331[_0x8ee6('0xb3')]['id']}})[_0x8ee6('0x2b')](handleEntityNotFound(_0x569647,null))[_0x8ee6('0x2b')](function(_0x25e412){if(_0x25e412){return _0x25e412[_0x8ee6('0xc2')](_0x119331[_0x8ee6('0xb7')][_0x8ee6('0xbb')],_[_0x8ee6('0xc3')](_0x119331[_0x8ee6('0xb7')],[_0x8ee6('0xbb'),'id'])||{})[_0x8ee6('0xc4')](function(){return db['Tag'][_0x8ee6('0xc0')]({'attributes':['id',_0x8ee6('0x2e'),_0x8ee6('0xc5')],'where':{'id':_0x119331[_0x8ee6('0xb7')]['ids']}});})[_0x8ee6('0x2b')](function(_0x254690){socket['emit']('smsInteractionTags:save',{'id':Number(_0x119331[_0x8ee6('0xb3')]['id']),'tags':_0x254690||[]});return{'id':Number(_0x119331[_0x8ee6('0xb3')]['id']),'tags':_0x254690||[]};});}})[_0x8ee6('0x2b')](respondWithResult(_0x569647,null))['catch'](handleError(_0x569647,null));};exports[_0x8ee6('0xc6')]=function(_0x21f4a6,_0x490b88,_0x26ab06){return db['SmsInteraction']['find']({'where':{'id':_0x21f4a6[_0x8ee6('0xb3')]['id']}})[_0x8ee6('0x2b')](handleEntityNotFound(_0x490b88,null))['then'](function(_0xd340f1){if(_0xd340f1){return _0xd340f1[_0x8ee6('0xc6')](_0x21f4a6[_0x8ee6('0x3c')][_0x8ee6('0xbb')]);}})['then'](respondWithStatusCode(_0x490b88,null))['catch'](handleError(_0x490b88,null));};exports[_0x8ee6('0xc7')]=function(_0x4e0faf,_0x41c85e){var _0x14d3fa=moment()[_0x8ee6('0xc8')]()['toString']();var _0xeaf1d1=path[_0x8ee6('0xc9')](config[_0x8ee6('0xca')],'server','files',_0x8ee6('0xcb'));var _0x5bc4ef=path[_0x8ee6('0xc9')](config[_0x8ee6('0xca')],_0x8ee6('0xcc'),_0x8ee6('0xcd'),_0x8ee6('0xce'));var _0x4b25f4=path[_0x8ee6('0xc9')](_0xeaf1d1,_0x14d3fa);var _0x130b45=util[_0x8ee6('0xcf')](_0x8ee6('0xd0'),_0x4e0faf[_0x8ee6('0xb3')]['id'],_0x14d3fa);var _0x3cae08=path[_0x8ee6('0xc9')](_0xeaf1d1,_0x130b45);var _0x216dc4=[];_0x216dc4[_0x8ee6('0x36')]({'model':db['User'],'as':_0x8ee6('0x6a'),'attributes':['id',_0x8ee6('0x32')],'raw':!![]});_0x216dc4['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x8ee6('0xd1'),_0x8ee6('0xd2')],'raw':!![]});var _0x43a288=[{'model':db[_0x8ee6('0xba')],'as':_0x8ee6('0xd3'),'attributes':['id',_0x8ee6('0xb7'),'createdAt',_0x8ee6('0xd4'),_0x8ee6('0xd5'),_0x8ee6('0x7e')],'include':_0x216dc4}];_0x43a288[_0x8ee6('0x36')]({'model':db[_0x8ee6('0xd6')],'as':'Account','attributes':['id',_0x8ee6('0x2e')]});_0x43a288[_0x8ee6('0x36')]({'model':db[_0x8ee6('0x6a')],'as':_0x8ee6('0xd7'),'attributes':['id',_0x8ee6('0x32')]});return db[_0x8ee6('0x38')][_0x8ee6('0x6c')]({'where':{'id':_0x4e0faf[_0x8ee6('0xb3')]['id']},'include':_0x43a288})[_0x8ee6('0x2b')](handleEntityNotFound(_0x41c85e,null))['then'](function(_0x2b80e0){if(_0x2b80e0){var _0x294112=_0x2b80e0[_0x8ee6('0xd8')]({'plain':!![]});fs[_0x8ee6('0xd9')](_0x4b25f4);var _0x1d6d69={'channel':_0x8ee6('0xda'),'account':_0x294112[_0x8ee6('0xdb')][_0x8ee6('0x2e')],'agent':_0x294112[_0x8ee6('0xd7')]?_0x294112['Owner'][_0x8ee6('0x32')]:'N.A.','createdAt':moment(_0x294112['createdAt'])[_0x8ee6('0xcf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8ee6('0x97')](),'closedAt':_0x294112[_0x8ee6('0xdc')]?moment(_0x294112[_0x8ee6('0xdd')])[_0x8ee6('0xcf')](_0x8ee6('0xbf'))['toString']():'','disposition':_0x294112['disposition'],'messages':_(_0x294112[_0x8ee6('0xd3')])['filter']({'secret':![]})['map'](function(_0x52ed9f){return{'date':moment(_0x52ed9f[_0x8ee6('0x75')])[_0x8ee6('0xcf')](_0x8ee6('0xbf'))[_0x8ee6('0x97')](),'sender':_0x52ed9f[_0x8ee6('0xd4')]===_0x8ee6('0xde')?_0x52ed9f[_0x8ee6('0x6a')]?_0x52ed9f[_0x8ee6('0x6a')]['fullname']:_0x8ee6('0xdf'):_0x52ed9f[_0x8ee6('0xe0')]['firstName']+(_0x52ed9f[_0x8ee6('0xe0')][_0x8ee6('0xd2')]?'\x20'+_0x52ed9f[_0x8ee6('0xe0')][_0x8ee6('0xd2')]:''),'body':_0x52ed9f[_0x8ee6('0xb7')],'direction':_0x52ed9f[_0x8ee6('0xd4')]==='out'?'A':'C','secret':_0x52ed9f['secret'],'read':_0x52ed9f['read']};})['value']()};return ejs[_0x8ee6('0xe1')](path[_0x8ee6('0xc9')](config[_0x8ee6('0xca')],'server',_0x8ee6('0xe2'),_0x8ee6('0xe3')),{'interaction':_0x1d6d69})[_0x8ee6('0x2b')](function(_0x5871d9){var _0x309f34=path[_0x8ee6('0xc9')](_0x4b25f4,_0x8ee6('0xe4')+_0x294112['id']+'-'+_0x14d3fa+_0x8ee6('0xe5'));var _0x42381a={'path':_0x309f34,'channel':_0x8ee6('0xda'),'interactionId':_0x294112['id']};return pdf[_0x8ee6('0xe6')](_0x5871d9,_0x42381a);})['then'](function(){return new BPromise(function(_0x747ccf,_0x3a6b3d){zipdir(_0x4b25f4,{'saveTo':_0x3cae08},function(_0x14a9f0,_0x31c6c2){if(_0x14a9f0)return _0x3a6b3d(_0x14a9f0);return _0x747ccf(_0x31c6c2);});})['then'](function(){return new BPromise(function(_0x9bb3d2,_0x329793){rimraf(_0x4b25f4,function(_0x3b6f72){if(_0x3b6f72)_0x329793(_0x3b6f72);return _0x9bb3d2();});});})[_0x8ee6('0x2b')](function(){return _0x41c85e[_0x8ee6('0xc7')](_0x3cae08,_0x130b45,function(_0x122cd1){if(_0x122cd1){console[_0x8ee6('0xe7')](_0x8ee6('0xe8'),_0x122cd1);}else{fs[_0x8ee6('0xe9')](_0x3cae08);}});});});}else{return _0x41c85e['sendStatus'](0xc8);}})[_0x8ee6('0xb1')](handleError(_0x41c85e,null));};
\ No newline at end of file
+var _0x93b5=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','unreadMessages','value','having','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','SmsInteractionId','all','rows','params','options','create','describe','SmsMessage','omit','ids','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','join','CmContact','Contact','firstName','lastName','direction','secret','Account','Owner','get','mkdirSync','Sms','closed','closedAt','disposition','Messages','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','query','keys'];(function(_0x23301a,_0xe583b7){var _0x1ccace=function(_0x4db4bb){while(--_0x4db4bb){_0x23301a['push'](_0x23301a['shift']());}};_0x1ccace(++_0xe583b7);}(_0x93b5,0x178));var _0x593b=function(_0x56a398,_0x3635a8){_0x56a398=_0x56a398-0x0;var _0x1169b2=_0x93b5[_0x56a398];return _0x1169b2;};'use strict';var emlformat=require(_0x593b('0x0'));var rimraf=require(_0x593b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x593b('0x2'));var moment=require(_0x593b('0x3'));var BPromise=require(_0x593b('0x4'));var Mustache=require(_0x593b('0x5'));var util=require('util');var path=require(_0x593b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x593b('0x7'));var fs=require('fs');var fs_extra=require(_0x593b('0x8'));var _=require(_0x593b('0x9'));var squel=require(_0x593b('0xa'));var crypto=require(_0x593b('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x593b('0xc'));var querystring=require('querystring');var Papa=require(_0x593b('0xd'));var Redis=require(_0x593b('0xe'));var authService=require(_0x593b('0xf'));var qs=require(_0x593b('0x10'));var as=require(_0x593b('0x11'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x593b('0x12'));var logger=require('../../config/logger')(_0x593b('0x13'));var utils=require(_0x593b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x593b('0x15'));var db=require(_0x593b('0x16'))['db'];config[_0x593b('0x17')]=_[_0x593b('0x18')](config[_0x593b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x593b('0x19'))(new Redis(config['redis']));require(_0x593b('0x1a'))[_0x593b('0x1b')](socket);function respondWithStatusCode(_0x2c79fe,_0x2331d7){_0x2331d7=_0x2331d7||0xcc;return function(_0x2d7631){if(_0x2d7631){return _0x2c79fe['sendStatus'](_0x2331d7);}return _0x2c79fe[_0x593b('0x1c')](_0x2331d7)[_0x593b('0x1d')]();};}function respondWithResult(_0x4d9b9d,_0x1705df){_0x1705df=_0x1705df||0xc8;return function(_0x146e1f){if(_0x146e1f){return _0x4d9b9d[_0x593b('0x1c')](_0x1705df)['json'](_0x146e1f);}};}function respondWithFilteredResult(_0x7b09d1,_0x280de5){return function(_0x23e073){if(_0x23e073){var _0x39a9=typeof _0x280de5[_0x593b('0x1e')]==='undefined'&&typeof _0x280de5['limit']===_0x593b('0x1f');var _0x46e942=_0x23e073[_0x593b('0x20')];var _0x4f3e23=_0x39a9?0x0:_0x280de5[_0x593b('0x1e')];var _0x4907b6=_0x39a9?_0x23e073[_0x593b('0x20')]:_0x280de5['offset']+_0x280de5[_0x593b('0x21')];var _0x449fc2;if(_0x4907b6>=_0x46e942){_0x4907b6=_0x46e942;_0x449fc2=0xc8;}else{_0x449fc2=0xce;}_0x7b09d1[_0x593b('0x1c')](_0x449fc2);return _0x7b09d1[_0x593b('0x22')](_0x593b('0x23'),_0x4f3e23+'-'+_0x4907b6+'/'+_0x46e942)[_0x593b('0x24')](_0x23e073);}return null;};}function patchUpdates(_0x3fa860){return function(_0x20af75){try{jsonpatch['apply'](_0x20af75,_0x3fa860,!![]);}catch(_0x44755b){return BPromise[_0x593b('0x25')](_0x44755b);}return _0x20af75[_0x593b('0x26')]();};}function saveUpdates(_0x261b3d,_0xd19e98){return function(_0x55c813){if(_0x55c813){return _0x55c813[_0x593b('0x27')](_0x261b3d)[_0x593b('0x28')](function(_0x220a34){return _0x220a34;});}return null;};}function removeEntity(_0x1de408,_0x4bb67b){return function(_0x720795){if(_0x720795){return _0x720795[_0x593b('0x29')]()[_0x593b('0x28')](function(){_0x1de408['status'](0xcc)[_0x593b('0x1d')]();});}};}function handleEntityNotFound(_0x304cb9,_0x36cf01){return function(_0x3af432){if(!_0x3af432){_0x304cb9['sendStatus'](0x194);}return _0x3af432;};}function handleError(_0x499b71,_0x40c17f){_0x40c17f=_0x40c17f||0x1f4;return function(_0x3341d1){logger[_0x593b('0x2a')](_0x3341d1[_0x593b('0x2b')]);if(_0x3341d1[_0x593b('0x2c')]){delete _0x3341d1[_0x593b('0x2c')];}_0x499b71[_0x593b('0x1c')](_0x40c17f)['send'](_0x3341d1);};}function getInteractionUsers(_0x629c23,_0x5636d2){return new BPromise(function(_0x1c7917,_0x38240c){try{if(_0x5636d2[_0x629c23['id']]){_0x629c23[_0x593b('0x2d')]=_[_0x593b('0x2e')](_0x5636d2[_0x629c23['id']],function(_0xcd1d24){return{'id':_0xcd1d24['id'],'fullname':_0xcd1d24[_0x593b('0x2f')]};});}}catch(_0x19b84b){_0x38240c(_0x19b84b);}_0x1c7917(_0x629c23);});}function getInteractionTags(_0x563def,_0x5127aa){return new BPromise(function(_0x44971c,_0x565d25){try{if(_0x563def[_0x593b('0x30')]){_0x563def['Tags']=[];_0x563def[_0x593b('0x30')]['split'](',')['forEach'](function(_0x3f76e1){_0x563def[_0x593b('0x31')][_0x593b('0x32')](_0x5127aa[_0x3f76e1]);});}delete _0x563def[_0x593b('0x30')];}catch(_0xa207f0){_0x565d25(_0xa207f0);}_0x44971c(_0x563def);});}function updateSmsInteraction(_0x2d7188,_0x3ac204,_0x35a8cd){return new BPromise(function(_0xfaed2e,_0x417acb){return getInteractionUsers(_0x2d7188,_0x35a8cd)[_0x593b('0x28')](function(_0x477ffc){return getInteractionTags(_0x477ffc,_0x3ac204);})[_0x593b('0x28')](function(_0x384950){_0xfaed2e(_0x384950);})[_0x593b('0x33')](function(_0x3a4a1d){_0x417acb(_0x3a4a1d);});});}exports[_0x593b('0x34')]=function(_0x49ab63,_0x573dc7){var _0x520365={},_0x56eb67={},_0x254981={'count':0x0,'rows':[]};var _0x22e0a7=_[_0x593b('0x2e')](db[_0x593b('0x35')][_0x593b('0x36')],function(_0x47213a){return{'name':_0x47213a[_0x593b('0x37')],'type':_0x47213a[_0x593b('0x38')][_0x593b('0x39')]};});_0x56eb67['model']=_['map'](_0x22e0a7,_0x593b('0x2c'));_0x56eb67[_0x593b('0x3a')]=_[_0x593b('0x3b')](_0x49ab63[_0x593b('0x3a')]);_0x56eb67[_0x593b('0x3c')]=_[_0x593b('0x3d')](_0x56eb67[_0x593b('0x3e')],_0x56eb67[_0x593b('0x3a')]);_0x520365[_0x593b('0x3f')]=_[_0x593b('0x3d')](_0x56eb67[_0x593b('0x3e')],qs['fields'](_0x49ab63['query'][_0x593b('0x40')]));_0x520365[_0x593b('0x3f')]=_0x520365[_0x593b('0x3f')]['length']?_0x520365['attributes']:_0x56eb67[_0x593b('0x3e')];if(!_0x49ab63[_0x593b('0x3a')][_0x593b('0x41')](_0x593b('0x42'))){_0x520365[_0x593b('0x21')]=qs[_0x593b('0x21')](_0x49ab63[_0x593b('0x3a')][_0x593b('0x21')]);_0x520365[_0x593b('0x1e')]=qs[_0x593b('0x1e')](_0x49ab63[_0x593b('0x3a')]['offset']);}_0x520365[_0x593b('0x43')]=qs[_0x593b('0x44')](_0x49ab63[_0x593b('0x3a')]['sort']);_0x520365[_0x593b('0x45')]=qs[_0x593b('0x3c')](_[_0x593b('0x46')](_0x49ab63[_0x593b('0x3a')],_0x56eb67[_0x593b('0x3c')]),_0x22e0a7);var _0x537f8f=[];var _0x1959ee=squel[_0x593b('0x47')]()[_0x593b('0x48')]('id')[_0x593b('0x48')](_0x593b('0x2c'))['field'](_0x593b('0x49'))[_0x593b('0x4a')](_0x593b('0x4b'));var _0xfd4fb7=squel[_0x593b('0x47')]()[_0x593b('0x48')]('u.id')[_0x593b('0x48')]('u.fullname')['field']('ui.SmsInteractionId')[_0x593b('0x4a')](_0x593b('0x4c'),'ui')[_0x593b('0x4d')](_0x593b('0x4e'),'u',_0x593b('0x4f'));var _0x46a554=squel['select']()[_0x593b('0x4a')]('sms_interactions','i')[_0x593b('0x4d')](_0x593b('0x50'),'c',_0x593b('0x51'))[_0x593b('0x4d')](_0x593b('0x4e'),'o','o.id\x20=\x20i.UserId')[_0x593b('0x4d')]('sms_accounts','a',_0x593b('0x52'))[_0x593b('0x4d')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x593b('0x53'),'it',_0x593b('0x54'))[_0x593b('0x4d')](_0x593b('0x4b'),'t',_0x593b('0x55'));var _0x1c2281=squel[_0x593b('0x56')]();var _0x3cd1a6=[];var _0x4582ff=squel[_0x593b('0x56')]();var _0x5aeb03;if(_0x49ab63[_0x593b('0x3a')]['search']){_0x5aeb03=as['parseSearch'](_0x49ab63[_0x593b('0x3a')][_0x593b('0x57')]);var _0xb529e5=_0x5aeb03[_0x593b('0x58')];for(var _0x5c25bd=0x0;_0x5c25bd<_0x5aeb03[_0x593b('0x59')][_0x593b('0x5a')];_0x5c25bd++){var _0x3d0175=_0x5aeb03[_0x593b('0x59')][_0x5c25bd];var _0x5864e8='i';var _0x125bfe=_['find'](_0x22e0a7,[_0x593b('0x2c'),_0x3d0175['field']]);if(!_0x125bfe){switch(_0x3d0175[_0x593b('0x48')]){case _0x593b('0x5b'):if(_0x3d0175[_0x593b('0x5c')]==0x1){_0x46a554[_0x593b('0x5d')]('`'+_0x3d0175[_0x593b('0x48')]+'`\x20=\x200');}else{_0x46a554[_0x593b('0x5d')]('`'+_0x3d0175[_0x593b('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x3d0175[_0x593b('0x5e')]===_0x593b('0x5f')){if(_0x3d0175[_0x593b('0x5c')][_0x593b('0x60')]('\x20')['length']>0x1){_0x1c2281[_0xb529e5](_0x593b('0x61'),qs[_0x593b('0x62')](_0x3d0175[_0x593b('0x5c')]),null);}else{var _0x57d8f1='%'+_0x3d0175['value']+'%';_0x1c2281[_0xb529e5](_0x593b('0x63'),_0x57d8f1,_0x57d8f1,_0x57d8f1);}}else{_0x125bfe=_[_0x593b('0x64')](_0x22e0a7,[_0x593b('0x2c'),'ContactId']);_0x3d0175[_0x593b('0x48')]=_0x593b('0x65');_0xee366b=as['buildExpression'](_0x5864e8,_0x125bfe[_0x593b('0x38')],_0x3d0175);_0x1c2281[_0xb529e5](_0xee366b[_0x593b('0x66')],_0xee366b[_0x593b('0x5c')][_0x593b('0x67')],_0xee366b[_0x593b('0x5c')][_0x593b('0x1d')]);}break;case _0x593b('0x68'):var _0x51b5df=_0x3d0175[_0x593b('0x5c')]['split'](',')['map'](function(_0x3905d1){return Number(_0x3905d1);});_0x51b5df[_0x593b('0x69')](function(_0x1c28e2){_0x4582ff['or'](_0x593b('0x6a'),'%,'+_0x1c28e2+',%');});_0x3cd1a6=_[_0x593b('0x6b')](_0x3cd1a6,_0x51b5df);break;case _0x593b('0x6c'):if(_0x3d0175[_0x593b('0x5e')]===_0x593b('0x5f')){_0x1c2281[_0xb529e5](_0x593b('0x6d'),'%'+_0x3d0175[_0x593b('0x5c')]+'%',null);}else{_0x125bfe=_[_0x593b('0x64')](_0x22e0a7,[_0x593b('0x2c'),_0x593b('0x6e')]);_0x3d0175['field']=_0x593b('0x6e');_0xee366b=as[_0x593b('0x6f')](_0x5864e8,_0x125bfe[_0x593b('0x38')],_0x3d0175);_0x1c2281[_0xb529e5](_0xee366b['text'],_0xee366b[_0x593b('0x5c')][_0x593b('0x67')],_0xee366b[_0x593b('0x5c')]['end']);}break;case _0x593b('0x70'):_0xee366b=as[_0x593b('0x6f')]('me',null,_0x3d0175);_0x1c2281[_0xb529e5](_0xee366b[_0x593b('0x66')],_0xee366b['value']['start'],_0xee366b[_0x593b('0x5c')]['end']);break;}}else{var _0xee366b=as[_0x593b('0x6f')](_0x5864e8,_0x125bfe['type'],_0x3d0175);_0x1c2281[_0xb529e5](_0xee366b[_0x593b('0x66')],_0xee366b[_0x593b('0x5c')][_0x593b('0x67')],_0xee366b[_0x593b('0x5c')][_0x593b('0x1d')]);}}}else{var _0x4df5a0=_(_0x49ab63['query'])['keys']()[_0x593b('0x2e')](function(_0x3fc7ec){return _[_0x593b('0x71')](_0x22e0a7,[_0x593b('0x2c'),_0x3fc7ec])?_0x3fc7ec:undefined;})['compact']()[_0x593b('0x5c')]();if(!_[_0x593b('0x72')](_0x4df5a0)){_0x4df5a0[_0x593b('0x69')](function(_0x1668e8){if(_0x1668e8===_0x593b('0x73')){_0x46a554[_0x593b('0x45')](_0x593b('0x74'),[]['concat'](_0x49ab63[_0x593b('0x3a')][_0x1668e8]));}else if(_0x1668e8===_0x593b('0x75')){var _0x3285e2=JSON[_0x593b('0x76')](_0x49ab63[_0x593b('0x3a')][_0x1668e8])[_0x593b('0x77')];var _0x141b9e=JSON[_0x593b('0x76')](_0x49ab63[_0x593b('0x3a')][_0x1668e8])[_0x593b('0x78')];_0x46a554[_0x593b('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3285e2,_0x141b9e);}else{if(_0x49ab63['query'][_0x1668e8]==='null'){_0x46a554['where']('i.'+_0x1668e8+_0x593b('0x79'));}else{_0x46a554[_0x593b('0x45')]('i.'+_0x1668e8+'\x20=\x20?',_0x49ab63['query'][_0x1668e8]);}}});}if(_0x49ab63[_0x593b('0x3a')][_0x593b('0x7a')]){if(_0x49ab63[_0x593b('0x3a')][_0x593b('0x7a')]==0x1){_0x46a554['having'](_0x593b('0x7b'));}else{_0x46a554[_0x593b('0x5d')](_0x593b('0x7c'));}}if(_0x49ab63[_0x593b('0x3a')]['tag']){_0x3cd1a6=_[_0x593b('0x7d')](_0x49ab63[_0x593b('0x3a')][_0x593b('0x7e')])?_0x49ab63[_0x593b('0x3a')]['tag']:new Array(_0x49ab63[_0x593b('0x3a')][_0x593b('0x7e')]);_0x3cd1a6['forEach'](function(_0x2036bd){_0x4582ff['or'](_0x593b('0x6a'),'%,'+_0x2036bd+',%');});}if(_0x49ab63[_0x593b('0x3a')][_0x593b('0x7f')]){var _0x11da7b=_0x49ab63['query'][_0x593b('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x593b('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x11da7b)){_0x1c2281['or'](_0x593b('0x81'),_0x11da7b+'%')['or']('i.phone\x20LIKE\x20?',_0x11da7b+'%');}else{_0x1c2281['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x593b('0x62')](_0x11da7b))['or'](_0x593b('0x82'),_0x11da7b+'%');}}}_0x46a554[_0x593b('0x45')](_0x1c2281);_0x46a554[_0x593b('0x83')](_0x593b('0x84'));var _0x4f36ab={'type':db[_0x593b('0x85')]['QueryTypes']['SELECT'],'raw':!![]};var _0xb4f02f=_0x46a554[_0x593b('0x86')]();_0xb4f02f['field'](_0x593b('0x84'));_0xb4f02f[_0x593b('0x48')](_0x593b('0x87'),_0x593b('0x5b'));if(_0x520365[_0x593b('0x43')]){_0x520365[_0x593b('0x43')][_0x593b('0x69')](function(_0x4bb43f){var _0x312c03=_0x4bb43f[0x0]===_0x593b('0x88')?_0x4bb43f[0x0]:'i.'+_0x4bb43f[0x0];_0x46a554[_0x593b('0x43')](_0x312c03,_0x4bb43f[0x1]===_0x593b('0x89')?![]:!![]);});}if(!_[_0x593b('0x72')](_0x3cd1a6)){_0x46a554['having'](_0x4582ff);_0xb4f02f[_0x593b('0x45')](_0x593b('0x8a'),_0x3cd1a6);}BPromise[_0x593b('0x8b')]()[_0x593b('0x28')](function(){if(!_0x5aeb03){if(_0x49ab63[_0x593b('0x3a')][_0x593b('0x73')])return;_0xb4f02f[_0x593b('0x45')](_0x593b('0x8c'));_0x46a554[_0x593b('0x45')](_0x593b('0x8c'));return;}if(_0x49ab63[_0x593b('0x8d')][_0x593b('0x8e')]!=='agent')return;return _0x49ab63[_0x593b('0x8d')][_0x593b('0x8f')]({'attributes':['id'],'raw':!![]})[_0x593b('0x28')](function(_0x1d1e15){if(_[_0x593b('0x72')](_0x1d1e15)){_0xb4f02f[_0x593b('0x45')](_0x593b('0x90'));_0x46a554['where'](_0x593b('0x90'));}else{_0xb4f02f[_0x593b('0x45')](_0x593b('0x74'),_[_0x593b('0x2e')](_0x1d1e15,'id'));_0x46a554[_0x593b('0x45')](_0x593b('0x74'),_['map'](_0x1d1e15,'id'));}});})['then'](function(){if(_0x49ab63[_0x593b('0x8d')][_0x593b('0x8e')]===_0x593b('0x91')&&!_0x5aeb03&&!_0x49ab63[_0x593b('0x3a')][_0x593b('0x73')])return[];return db['sequelize']['query'](_0xb4f02f['toString'](),_0x4f36ab);})[_0x593b('0x28')](function(_0xc78d65){_0x254981[_0x593b('0x20')]=_0xc78d65['length'];if(_0x254981[_0x593b('0x20')]===0x0)return[];return db[_0x593b('0x92')]['query'](_0x1959ee[_0x593b('0x93')](),_0x4f36ab)[_0x593b('0x28')](function(_0x3027e4){_0x537f8f=_['keyBy'](_0x3027e4,'id');_0x4f36ab=_[_0x593b('0x94')](_0x4f36ab,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49ab63[_0x593b('0x3a')][_0x593b('0x40')]){_0x520365[_0x593b('0x3f')][_0x593b('0x69')](function(_0x387d43){_0x46a554[_0x593b('0x48')]('i.'+_0x387d43);});}else{_0x46a554[_0x593b('0x48')](_0x593b('0x87'),_0x593b('0x5b'));_0x46a554[_0x593b('0x48')](_0x593b('0x95'),'Account.key');_0x46a554[_0x593b('0x48')]('a.mandatoryDisposition',_0x593b('0x96'));_0x46a554[_0x593b('0x48')](_0x593b('0x97'),_0x593b('0x88'));_0x46a554[_0x593b('0x48')](_0x593b('0x98'));_0x46a554[_0x593b('0x48')](_0x593b('0x99'),'Contact.firstName');_0x46a554['field'](_0x593b('0x9a'),_0x593b('0x9b'));_0x46a554[_0x593b('0x48')](_0x593b('0x9c'),_0x593b('0x9d'));_0x46a554[_0x593b('0x48')]('c.phone',_0x593b('0x9e'));_0x46a554[_0x593b('0x48')](_0x593b('0x9f'),_0x593b('0xa0'));_0x46a554[_0x593b('0x48')](_0x593b('0xa1'),_0x593b('0xa2'));_0x46a554[_0x593b('0x48')](_0x593b('0xa3'),'Owner.fullname');_0x46a554['field'](_0x593b('0xa4'),_0x593b('0xa5'));_0x46a554[_0x593b('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x593b('0x30'));}if(_0x520365[_0x593b('0x21')])_0x46a554[_0x593b('0x21')](_0x520365[_0x593b('0x21')]);if(_0x520365[_0x593b('0x1e')])_0x46a554[_0x593b('0x1e')](_0x520365['offset']);return db[_0x593b('0x92')][_0x593b('0x3a')](_0x46a554[_0x593b('0x93')](),_0x4f36ab);})[_0x593b('0x28')](function(_0x41bbc2){if(_0x41bbc2[_0x593b('0x5a')]>0x0)_0xfd4fb7[_0x593b('0x45')]('ui.SmsInteractionId\x20IN\x20?',_[_0x593b('0x2e')](_0x41bbc2,'id'));return db[_0x593b('0x92')][_0x593b('0x3a')](_0xfd4fb7[_0x593b('0x93')](),_0x4f36ab)['then'](function(_0x36051f){var _0x5dd3a9=_['groupBy'](_0x36051f,_0x593b('0xa6'));var _0x3b412e=[];_0x41bbc2[_0x593b('0x69')](function(_0x464d22){_0x3b412e[_0x593b('0x32')](updateSmsInteraction(_0x464d22,_0x537f8f,_0x5dd3a9));});return BPromise[_0x593b('0xa7')](_0x3b412e);});});})['then'](function(_0x59a894){_0x254981[_0x593b('0xa8')]=_0x59a894;return _0x254981;})['then'](respondWithFilteredResult(_0x573dc7,_0x520365))[_0x593b('0x33')](handleError(_0x573dc7,null));};exports['show']=function(_0x18a0ce,_0x1d47b6){var _0x4fb1a2={'raw':![],'where':{'id':_0x18a0ce[_0x593b('0xa9')]['id']}},_0x212cba={};_0x212cba['model']=_['keys'](db[_0x593b('0x35')][_0x593b('0x36')]);_0x212cba['query']=_[_0x593b('0x3b')](_0x18a0ce[_0x593b('0x3a')]);_0x212cba[_0x593b('0x3c')]=_[_0x593b('0x3d')](_0x212cba[_0x593b('0x3e')],_0x212cba[_0x593b('0x3a')]);_0x4fb1a2[_0x593b('0x3f')]=_['intersection'](_0x212cba[_0x593b('0x3e')],qs[_0x593b('0x40')](_0x18a0ce['query'][_0x593b('0x40')]));_0x4fb1a2[_0x593b('0x3f')]=_0x4fb1a2['attributes'][_0x593b('0x5a')]?_0x4fb1a2[_0x593b('0x3f')]:_0x212cba[_0x593b('0x3e')];if(_0x18a0ce[_0x593b('0x3a')]['includeAll']){_0x4fb1a2['include']=[{'all':!![]}];}_0x4fb1a2=_[_0x593b('0x94')]({},_0x4fb1a2,_0x18a0ce[_0x593b('0xaa')]);return db[_0x593b('0x35')][_0x593b('0x64')](_0x4fb1a2)[_0x593b('0x28')](handleEntityNotFound(_0x1d47b6,null))[_0x593b('0x28')](respondWithResult(_0x1d47b6,null))[_0x593b('0x33')](handleError(_0x1d47b6,null));};exports['create']=function(_0x5d8bfa,_0x4c0302){return db[_0x593b('0x35')][_0x593b('0xab')](_0x5d8bfa[_0x593b('0x70')],{})[_0x593b('0x28')](respondWithResult(_0x4c0302,0xc9))['catch'](handleError(_0x4c0302,null));};exports[_0x593b('0x27')]=function(_0x4dd7ea,_0x354119){if(_0x4dd7ea['body']['id']){delete _0x4dd7ea['body']['id'];}return db[_0x593b('0x35')][_0x593b('0x64')]({'where':{'id':_0x4dd7ea[_0x593b('0xa9')]['id']}})[_0x593b('0x28')](handleEntityNotFound(_0x354119,null))[_0x593b('0x28')](saveUpdates(_0x4dd7ea[_0x593b('0x70')],null))[_0x593b('0x28')](respondWithResult(_0x354119,null))[_0x593b('0x33')](handleError(_0x354119,null));};exports[_0x593b('0x29')]=function(_0x4e0642,_0x1be70a){return db[_0x593b('0x35')]['find']({'where':{'id':_0x4e0642[_0x593b('0xa9')]['id']}})[_0x593b('0x28')](handleEntityNotFound(_0x1be70a,null))[_0x593b('0x28')](removeEntity(_0x1be70a,null))[_0x593b('0x33')](handleError(_0x1be70a,null));};exports[_0x593b('0xac')]=function(_0x4c4333,_0x40e530){return db['SmsInteraction'][_0x593b('0xac')]()[_0x593b('0x28')](respondWithResult(_0x40e530,null))[_0x593b('0x33')](handleError(_0x40e530,null));};exports['addMessage']=function(_0x5bc427,_0xabaeea,_0x2d9fdc){return db[_0x593b('0xad')][_0x593b('0x64')]({'where':{'id':_0x5bc427[_0x593b('0xa9')]['id']}})['then'](handleEntityNotFound(_0xabaeea,null))[_0x593b('0x28')](function(_0xdc8911){if(_0xdc8911){return _0xdc8911['addMessage'](_0x5bc427[_0x593b('0x70')]['ids'],_[_0x593b('0xae')](_0x5bc427[_0x593b('0x70')],[_0x593b('0xaf'),'id'])||{});}})[_0x593b('0x28')](respondWithResult(_0xabaeea,null))[_0x593b('0x33')](handleError(_0xabaeea,null));};exports['getMessages']=function(_0x3e39cb,_0x2850a6,_0x12722a){var _0x30305f={'raw':![],'where':{}};var _0x1c1bd5={};var _0x51ab74={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x593b('0xb0')]({'where':{'id':_0x3e39cb[_0x593b('0xa9')]['id']}})[_0x593b('0x28')](handleEntityNotFound(_0x2850a6,null))[_0x593b('0x28')](function(_0x31e0b2){if(_0x31e0b2){_0x1c1bd5[_0x593b('0x3e')]=_[_0x593b('0x3b')](db['SmsMessage'][_0x593b('0x36')]);_0x1c1bd5['query']=_[_0x593b('0x3b')](_0x3e39cb['query']);_0x1c1bd5[_0x593b('0x3c')]=_[_0x593b('0x3d')](_0x1c1bd5[_0x593b('0x3e')],_0x1c1bd5[_0x593b('0x3a')]);_0x30305f['attributes']=_[_0x593b('0x3d')](_0x1c1bd5[_0x593b('0x3e')],qs['fields'](_0x3e39cb[_0x593b('0x3a')]['fields']));_0x30305f[_0x593b('0x3f')]=_0x30305f[_0x593b('0x3f')]['length']?_0x30305f[_0x593b('0x3f')]:_0x1c1bd5[_0x593b('0x3e')];if(!_0x3e39cb[_0x593b('0x3a')]['hasOwnProperty']('nolimit')){_0x30305f[_0x593b('0x21')]=qs[_0x593b('0x21')](_0x3e39cb[_0x593b('0x3a')][_0x593b('0x21')]);_0x30305f['offset']=qs[_0x593b('0x1e')](_0x3e39cb[_0x593b('0x3a')]['offset']);}_0x30305f[_0x593b('0x43')]=qs[_0x593b('0x44')](_0x3e39cb[_0x593b('0x3a')][_0x593b('0x44')]);_0x30305f[_0x593b('0x45')]=qs[_0x593b('0x3c')](_['pick'](_0x3e39cb['query'],_0x1c1bd5[_0x593b('0x3c')]));_0x30305f[_0x593b('0x45')][_0x593b('0xa6')]=_0x31e0b2['id'];if(_0x3e39cb[_0x593b('0x3a')][_0x593b('0x7f')]){_0x30305f[_0x593b('0x45')]=_[_0x593b('0x94')](_0x30305f['where'],{'$or':_[_0x593b('0x2e')](_0x30305f[_0x593b('0x3f')],function(_0x2c333f){var _0x5c4716={};_0x5c4716[_0x2c333f]={'$like':'%'+_0x3e39cb[_0x593b('0x3a')][_0x593b('0x7f')]+'%'};return _0x5c4716;})});}if(_0x3e39cb[_0x593b('0x3a')][_0x593b('0x77')]){var _0x3c8035=_0x3e39cb[_0x593b('0x3a')][_0x593b('0x77')]['split'](',');var _0x561330={};_0x561330[_0x3c8035[0x0]]={'$gte':moment(_0x3c8035[0x1])[_0x593b('0xb1')](_0x593b('0xb2'))};_0x30305f[_0x593b('0x45')]=_['merge'](_0x30305f[_0x593b('0x45')],_0x561330);}_0x30305f=_[_0x593b('0x94')]({},_0x30305f,_0x3e39cb['options']);return db[_0x593b('0xad')]['count']({'where':_0x30305f[_0x593b('0x45')]})['then'](function(_0x1751c9){_0x51ab74[_0x593b('0x20')]=_0x1751c9;if(_0x3e39cb[_0x593b('0x3a')][_0x593b('0xb3')]){_0x30305f[_0x593b('0xb4')]=[{'all':!![]}];}return db[_0x593b('0xad')][_0x593b('0xb5')](_0x30305f);})[_0x593b('0x28')](function(_0x5e5aaf){_0x51ab74[_0x593b('0xa8')]=_0x5e5aaf;return _0x51ab74;});}})[_0x593b('0x28')](respondWithFilteredResult(_0x2850a6,_0x30305f))[_0x593b('0x33')](handleError(_0x2850a6,null));};exports[_0x593b('0xb6')]=function(_0x4e5ee8,_0x28d0d7,_0x3fdadf){return db[_0x593b('0x35')][_0x593b('0x64')]({'where':{'id':_0x4e5ee8[_0x593b('0xa9')]['id']}})['then'](handleEntityNotFound(_0x28d0d7,null))[_0x593b('0x28')](function(_0x51782d){if(_0x51782d){return _0x51782d[_0x593b('0xb7')](_0x4e5ee8['body'][_0x593b('0xaf')],_[_0x593b('0xae')](_0x4e5ee8[_0x593b('0x70')],[_0x593b('0xaf'),'id'])||{})[_0x593b('0xb8')](function(){return db[_0x593b('0x68')][_0x593b('0xb5')]({'attributes':['id',_0x593b('0x2c'),_0x593b('0x49')],'where':{'id':_0x4e5ee8[_0x593b('0x70')][_0x593b('0xaf')]}});})[_0x593b('0x28')](function(_0x590cfb){socket[_0x593b('0xb9')](_0x593b('0xba'),{'id':Number(_0x4e5ee8[_0x593b('0xa9')]['id']),'tags':_0x590cfb||[]});return{'id':Number(_0x4e5ee8['params']['id']),'tags':_0x590cfb||[]};});}})['then'](respondWithResult(_0x28d0d7,null))[_0x593b('0x33')](handleError(_0x28d0d7,null));};exports[_0x593b('0xbb')]=function(_0x250f9b,_0x545fe3,_0x5686a5){return db[_0x593b('0x35')][_0x593b('0x64')]({'where':{'id':_0x250f9b[_0x593b('0xa9')]['id']}})['then'](handleEntityNotFound(_0x545fe3,null))[_0x593b('0x28')](function(_0x190fea){if(_0x190fea){return _0x190fea[_0x593b('0xbb')](_0x250f9b[_0x593b('0x3a')][_0x593b('0xaf')]);}})[_0x593b('0x28')](respondWithStatusCode(_0x545fe3,null))[_0x593b('0x33')](handleError(_0x545fe3,null));};exports[_0x593b('0xbc')]=function(_0x3251ef,_0x1e51ba){var _0x1cad16=moment()[_0x593b('0xbd')]()[_0x593b('0x93')]();var _0x2c72d5=path['join'](config[_0x593b('0xbe')],_0x593b('0xbf'),_0x593b('0xc0'),'tmp');var _0x26939a=path[_0x593b('0xc1')](config[_0x593b('0xbe')],_0x593b('0xbf'),'files','attachments');var _0x573946=path[_0x593b('0xc1')](_0x2c72d5,_0x1cad16);var _0x45874c=util[_0x593b('0xb1')]('transcript-%d-%s.zip',_0x3251ef['params']['id'],_0x1cad16);var _0x587dfe=path[_0x593b('0xc1')](_0x2c72d5,_0x45874c);var _0x161d3a=[];_0x161d3a[_0x593b('0x32')]({'model':db[_0x593b('0x6c')],'as':_0x593b('0x6c'),'attributes':['id',_0x593b('0x2f')],'raw':!![]});_0x161d3a[_0x593b('0x32')]({'model':db[_0x593b('0xc2')],'as':_0x593b('0xc3'),'attributes':['id',_0x593b('0xc4'),_0x593b('0xc5')],'raw':!![]});var _0x4f3f9c=[{'model':db[_0x593b('0xad')],'as':'Messages','attributes':['id',_0x593b('0x70'),_0x593b('0x75'),_0x593b('0xc6'),_0x593b('0xc7'),'read'],'include':_0x161d3a}];_0x4f3f9c[_0x593b('0x32')]({'model':db['SmsAccount'],'as':_0x593b('0xc8'),'attributes':['id',_0x593b('0x2c')]});_0x4f3f9c['push']({'model':db[_0x593b('0x6c')],'as':_0x593b('0xc9'),'attributes':['id','fullname']});return db[_0x593b('0x35')]['find']({'where':{'id':_0x3251ef['params']['id']},'include':_0x4f3f9c})[_0x593b('0x28')](handleEntityNotFound(_0x1e51ba,null))[_0x593b('0x28')](function(_0x367b91){if(_0x367b91){var _0x12f302=_0x367b91[_0x593b('0xca')]({'plain':!![]});fs[_0x593b('0xcb')](_0x573946);var _0x3cd8e3={'channel':_0x593b('0xcc'),'account':_0x12f302[_0x593b('0xc8')]['name'],'agent':_0x12f302['Owner']?_0x12f302[_0x593b('0xc9')][_0x593b('0x2f')]:'N.A.','createdAt':moment(_0x12f302[_0x593b('0x75')])[_0x593b('0xb1')](_0x593b('0xb2'))['toString'](),'closedAt':_0x12f302[_0x593b('0xcd')]?moment(_0x12f302[_0x593b('0xce')])[_0x593b('0xb1')](_0x593b('0xb2'))[_0x593b('0x93')]():'','disposition':_0x12f302[_0x593b('0xcf')],'messages':_(_0x12f302[_0x593b('0xd0')])[_0x593b('0x7f')]({'secret':![]})[_0x593b('0x2e')](function(_0x1cef6f){return{'date':moment(_0x1cef6f[_0x593b('0x75')])[_0x593b('0xb1')](_0x593b('0xb2'))[_0x593b('0x93')](),'sender':_0x1cef6f[_0x593b('0xc6')]===_0x593b('0xd1')?_0x1cef6f[_0x593b('0x6c')]?_0x1cef6f[_0x593b('0x6c')][_0x593b('0x2f')]:_0x593b('0xd2'):_0x1cef6f['Contact'][_0x593b('0xc4')]+(_0x1cef6f['Contact'][_0x593b('0xc5')]?'\x20'+_0x1cef6f[_0x593b('0xc3')][_0x593b('0xc5')]:''),'body':_0x1cef6f['body'],'direction':_0x1cef6f[_0x593b('0xc6')]===_0x593b('0xd1')?'A':'C','secret':_0x1cef6f[_0x593b('0xc7')],'read':_0x1cef6f[_0x593b('0x7a')]};})[_0x593b('0x5c')]()};return ejs[_0x593b('0xd3')](path['join'](config['root'],_0x593b('0xbf'),_0x593b('0xd4'),_0x593b('0xd5')),{'interaction':_0x3cd8e3})[_0x593b('0x28')](function(_0x4b0b7a){var _0x483ce1=path[_0x593b('0xc1')](_0x573946,'transcript-'+_0x12f302['id']+'-'+_0x1cad16+_0x593b('0xd6'));var _0x34fa57={'path':_0x483ce1,'channel':_0x593b('0xcc'),'interactionId':_0x12f302['id']};return pdf[_0x593b('0xd7')](_0x4b0b7a,_0x34fa57);})['then'](function(){return new BPromise(function(_0x1269ec,_0x3480cf){zipdir(_0x573946,{'saveTo':_0x587dfe},function(_0x5530a0,_0x5e8945){if(_0x5530a0)return _0x3480cf(_0x5530a0);return _0x1269ec(_0x5e8945);});})['then'](function(){return new BPromise(function(_0x40e514,_0x3cb3e2){rimraf(_0x573946,function(_0x52e278){if(_0x52e278)_0x3cb3e2(_0x52e278);return _0x40e514();});});})[_0x593b('0x28')](function(){return _0x1e51ba['download'](_0x587dfe,_0x45874c,function(_0x1bf8ac){if(_0x1bf8ac){console[_0x593b('0xd8')]('err',_0x1bf8ac);}else{fs[_0x593b('0xd9')](_0x587dfe);}});});});}else{return _0x1e51ba['sendStatus'](0xc8);}})['catch'](handleError(_0x1e51ba,null));};
\ No newline at end of file
index 7a48bd5..9f2ec6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7d1=['SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x17b6b4,_0x41253e){var _0x16d1c1=function(_0x4bed40){while(--_0x4bed40){_0x17b6b4['push'](_0x17b6b4['shift']());}};_0x16d1c1(++_0x41253e);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x465d00,_0x3fdb0f){_0x465d00=_0x465d00-0x0;var _0x4aa533=_0xd7d1[_0x465d00];return _0x4aa533;};'use strict';var EventEmitter=require(_0x1d7d('0x0'));var SmsInteraction=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x2')];var SmsMessage=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1d7d('0x4')](0x0);var events={'afterCreate':_0x1d7d('0x5'),'afterUpdate':_0x1d7d('0x6'),'afterDestroy':_0x1d7d('0x7')};function emitEvent(_0x1adb6b){return function(_0x3c0839,_0x1a2564,_0x14b2b9){_0x3c0839['getUsers']({'attributes':['id'],'raw':!![]})[_0x1d7d('0x8')](function(_0x1aa456){_0x3c0839[_0x1d7d('0x9')](_0x1d7d('0xa'),_0x1aa456[_0x1d7d('0xb')](function(_0x268732){return{'id':_0x268732['id']};}));return SmsMessage[_0x1d7d('0xc')]({'where':{'SmsInteractionId':_0x3c0839['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1d7d('0x8')](function(_0x1ad06f){_0x3c0839[_0x1d7d('0x9')](_0x1d7d('0xd'),_0x1ad06f['length']);SmsInteractionEvents[_0x1d7d('0xe')](_0x1adb6b+':'+_0x3c0839['id'],_0x3c0839);SmsInteractionEvents['emit'](_0x1adb6b,_0x3c0839);_0x14b2b9(null);})[_0x1d7d('0xf')](_0x14b2b9(null));};}for(var e in events){if(events[_0x1d7d('0x10')](e)){var event=events[e];SmsInteraction[_0x1d7d('0x11')](e,emitEvent(event));}}module[_0x1d7d('0x12')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xa456=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','then','setDataValue','Users','map','findAll','unreadMessages','length','emit'];(function(_0x1ef4dc,_0x26c59e){var _0x2f8bb6=function(_0x571962){while(--_0x571962){_0x1ef4dc['push'](_0x1ef4dc['shift']());}};_0x2f8bb6(++_0x26c59e);}(_0xa456,0x142));var _0x6a45=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xa456[_0x3ea913];return _0x2b4f28;};'use strict';var EventEmitter=require(_0x6a45('0x0'));var SmsInteraction=require(_0x6a45('0x1'))['db'][_0x6a45('0x2')];var SmsMessage=require(_0x6a45('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6a45('0x3')](0x0);var events={'afterCreate':_0x6a45('0x4'),'afterUpdate':_0x6a45('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f0701){return function(_0x40acad,_0x1e5882,_0x14da6b){_0x40acad['getUsers']({'attributes':['id'],'raw':!![]})[_0x6a45('0x6')](function(_0x26bfc0){_0x40acad[_0x6a45('0x7')](_0x6a45('0x8'),_0x26bfc0[_0x6a45('0x9')](function(_0x4858df){return{'id':_0x4858df['id']};}));return SmsMessage[_0x6a45('0xa')]({'where':{'SmsInteractionId':_0x40acad['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x36378a){_0x40acad[_0x6a45('0x7')](_0x6a45('0xb'),_0x36378a[_0x6a45('0xc')]);SmsInteractionEvents[_0x6a45('0xd')](_0x1f0701+':'+_0x40acad['id'],_0x40acad);SmsInteractionEvents['emit'](_0x1f0701,_0x40acad);_0x14da6b(null);})['catch'](_0x14da6b(null));};}for(var e in events){if(events[_0x6a45('0xe')](e)){var event=events[e];SmsInteraction[_0x6a45('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index 6c37766..83f8251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8921=['./smsInteraction.attributes','exports','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x58e35c,_0xa4ed5a){var _0x27a7de=function(_0x2ec406){while(--_0x2ec406){_0x58e35c['push'](_0x58e35c['shift']());}};_0x27a7de(++_0xa4ed5a);}(_0x8921,0x143));var _0x1892=function(_0x3e9bd3,_0x3e6201){_0x3e9bd3=_0x3e9bd3-0x0;var _0x3a11be=_0x8921[_0x3e9bd3];return _0x3a11be;};'use strict';var _=require(_0x1892('0x0'));var util=require(_0x1892('0x1'));var logger=require(_0x1892('0x2'))(_0x1892('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1892('0x4'));var fs=require('fs');var path=require(_0x1892('0x5'));var rimraf=require('rimraf');var config=require(_0x1892('0x6'));var attributes=require(_0x1892('0x7'));module[_0x1892('0x8')]=function(_0x480d1c,_0x591f7a){return _0x480d1c[_0x1892('0x9')](_0x1892('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5eb0a0,_0x348191,_0x24d169){if(_0x5eb0a0[_0x1892('0xb')]('closed')){_0x5eb0a0[_0x1892('0xc')]=moment()[_0x1892('0xd')](_0x1892('0xe'));}_0x24d169(null,_0x5eb0a0);}}});};
\ No newline at end of file
+var _0x29f0=['lodash','util','../../config/logger','request-promise','path','../../config/environment','exports','define','SmsInteraction','sms_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x523cab,_0x4e899b){var _0x55de76=function(_0x34a941){while(--_0x34a941){_0x523cab['push'](_0x523cab['shift']());}};_0x55de76(++_0x4e899b);}(_0x29f0,0x1c7));var _0x029f=function(_0x126752,_0x33ae69){_0x126752=_0x126752-0x0;var _0x304088=_0x29f0[_0x126752];return _0x304088;};'use strict';var _=require(_0x029f('0x0'));var util=require(_0x029f('0x1'));var logger=require(_0x029f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x029f('0x3'));var fs=require('fs');var path=require(_0x029f('0x4'));var rimraf=require('rimraf');var config=require(_0x029f('0x5'));var attributes=require('./smsInteraction.attributes');module[_0x029f('0x6')]=function(_0x20956e,_0xa8a7f5){return _0x20956e[_0x029f('0x7')](_0x029f('0x8'),attributes,{'tableName':_0x029f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x163324,_0x180135,_0x1acaee){if(_0x163324['changed']('closed')){_0x163324[_0x029f('0xa')]=moment()[_0x029f('0xb')](_0x029f('0xc'));}_0x1acaee(null,_0x163324);}}});};
\ No newline at end of file
index 618cc0b..2012844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89bc=['util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x89bc,0x183));var _0xc89b=function(_0x3d9b04,_0x1e851a){_0x3d9b04=_0x3d9b04-0x0;var _0x557936=_0x89bc[_0x3d9b04];return _0x557936;};'use strict';var _=require('lodash');var util=require(_0xc89b('0x0'));var moment=require('moment');var BPromise=require(_0xc89b('0x1'));var rs=require(_0xc89b('0x2'));var fs=require('fs');var Redis=require(_0xc89b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc89b('0x4'));var logger=require('../../config/logger')(_0xc89b('0x5'));var config=require(_0xc89b('0x6'));var jayson=require(_0xc89b('0x7'));var client=jayson[_0xc89b('0x8')][_0xc89b('0x9')]({'port':0x232a});config['redis']=_[_0xc89b('0xa')](config[_0xc89b('0xb')],{'host':_0xc89b('0xc'),'port':0x18eb});var socket=require(_0xc89b('0xd'))(new Redis(config[_0xc89b('0xb')]));require(_0xc89b('0xe'))['register'](socket);function respondWithRpcPromise(_0x27c5c1,_0x47a67c,_0x30d359){return new BPromise(function(_0x2cffba,_0x4f81ab){return client[_0xc89b('0xf')](_0x27c5c1,_0x30d359)[_0xc89b('0x10')](function(_0xc3266f){logger[_0xc89b('0x11')](_0xc89b('0x12'),_0x47a67c,_0xc89b('0x13'));logger[_0xc89b('0x14')](_0xc89b('0x15'),_0x47a67c,'request\x20sent',JSON[_0xc89b('0x16')](_0xc3266f));if(_0xc3266f[_0xc89b('0x17')]){if(_0xc3266f[_0xc89b('0x17')]['code']===0x1f4){logger[_0xc89b('0x17')](_0xc89b('0x12'),_0x47a67c,_0xc3266f[_0xc89b('0x17')][_0xc89b('0x18')]);return _0x4f81ab(_0xc3266f[_0xc89b('0x17')][_0xc89b('0x18')]);}logger[_0xc89b('0x17')](_0xc89b('0x12'),_0x47a67c,_0xc3266f[_0xc89b('0x17')]['message']);return _0x2cffba(_0xc3266f[_0xc89b('0x17')][_0xc89b('0x18')]);}else{logger['info'](_0xc89b('0x12'),_0x47a67c,'request\x20sent');_0x2cffba(_0xc3266f[_0xc89b('0x19')][_0xc89b('0x18')]);}})['catch'](function(_0x55213c){logger[_0xc89b('0x17')](_0xc89b('0x12'),_0x47a67c,_0x55213c);_0x4f81ab(_0x55213c);});});}exports[_0xc89b('0x1a')]=function(_0x375d7c){var _0x5e0ae3=this;return new Promise(function(_0xabfe9b,_0x5e847b){return db[_0xc89b('0x1b')][_0xc89b('0x1c')](_0x375d7c[_0xc89b('0x1d')],{'raw':_0x375d7c[_0xc89b('0x1e')]?_0x375d7c[_0xc89b('0x1e')][_0xc89b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x375d7c[_0xc89b('0x1e')]?_0x375d7c[_0xc89b('0x1e')][_0xc89b('0x20')]||null:null,'attributes':_0x375d7c[_0xc89b('0x1e')]?_0x375d7c[_0xc89b('0x1e')][_0xc89b('0x21')]||null:null,'limit':_0x375d7c['options']?_0x375d7c[_0xc89b('0x1e')][_0xc89b('0x22')]||null:null})['then'](function(_0x152665){logger[_0xc89b('0x11')](_0xc89b('0x1a'),_0x375d7c);logger[_0xc89b('0x14')](_0xc89b('0x1a'),_0x375d7c,JSON[_0xc89b('0x16')](_0x152665));_0xabfe9b(_0x152665);})[_0xc89b('0x23')](function(_0x3a7f8b){logger['error'](_0xc89b('0x1a'),_0x3a7f8b[_0xc89b('0x18')],_0x375d7c);_0x5e847b(_0x5e0ae3[_0xc89b('0x17')](0x1f4,_0x3a7f8b[_0xc89b('0x18')]));});});};exports[_0xc89b('0x24')]=function(_0x28d986){return new Promise(function(_0xb6c4cb,_0x3f8448){return db[_0xc89b('0x1b')][_0xc89b('0x25')]({'where':_0x28d986[_0xc89b('0x1e')]?_0x28d986['options'][_0xc89b('0x20')]||null:null})[_0xc89b('0x10')](function(_0xf01bcd){if(_0xf01bcd){return _0xf01bcd[_0xc89b('0x26')](_0x28d986[_0xc89b('0x1d')][_0xc89b('0x27')],_[_0xc89b('0x28')](_0x28d986[_0xc89b('0x1d')],[_0xc89b('0x27'),'id'])||{});}})[_0xc89b('0x29')](function(_0x58c351){logger[_0xc89b('0x11')](_0xc89b('0x2a'),_0x28d986);logger[_0xc89b('0x14')](_0xc89b('0x2a'),_0x28d986,JSON[_0xc89b('0x16')](_0x58c351));_0xb6c4cb(_0x58c351);})['catch'](function(_0x50a52d){logger['error'](_0xc89b('0x2a'),_0x50a52d[_0xc89b('0x18')],_0x28d986);_0x3f8448(_this[_0xc89b('0x17')](0x1f4,_0x50a52d[_0xc89b('0x18')]));});});};
\ No newline at end of file
+var _0x94da=['redis','localhost','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','body','raw','options','attributes','limit','then','AddTagsToSmsInteraction','SmsInteraction','find','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults'];(function(_0x19d41b,_0x2c6be5){var _0x530d5c=function(_0x1eb7cd){while(--_0x1eb7cd){_0x19d41b['push'](_0x19d41b['shift']());}};_0x530d5c(++_0x2c6be5);}(_0x94da,0xdc));var _0xa94d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x94da[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa94d('0x0'));var util=require(_0xa94d('0x1'));var moment=require(_0xa94d('0x2'));var BPromise=require(_0xa94d('0x3'));var rs=require(_0xa94d('0x4'));var fs=require('fs');var Redis=require(_0xa94d('0x5'));var db=require(_0xa94d('0x6'))['db'];var utils=require(_0xa94d('0x7'));var logger=require(_0xa94d('0x8'))(_0xa94d('0x9'));var config=require('../../config/environment');var jayson=require(_0xa94d('0xa'));var client=jayson[_0xa94d('0xb')][_0xa94d('0xc')]({'port':0x232a});config['redis']=_[_0xa94d('0xd')](config[_0xa94d('0xe')],{'host':_0xa94d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa94d('0xe')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x374479,_0x54cbfc,_0x56dc99){return new BPromise(function(_0xc841f1,_0x14f4ae){return client[_0xa94d('0x10')](_0x374479,_0x56dc99)['then'](function(_0x3ac912){logger[_0xa94d('0x11')](_0xa94d('0x12'),_0x54cbfc,_0xa94d('0x13'));logger[_0xa94d('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x54cbfc,'request\x20sent',JSON[_0xa94d('0x15')](_0x3ac912));if(_0x3ac912[_0xa94d('0x16')]){if(_0x3ac912[_0xa94d('0x16')][_0xa94d('0x17')]===0x1f4){logger[_0xa94d('0x16')](_0xa94d('0x12'),_0x54cbfc,_0x3ac912[_0xa94d('0x16')][_0xa94d('0x18')]);return _0x14f4ae(_0x3ac912[_0xa94d('0x16')][_0xa94d('0x18')]);}logger[_0xa94d('0x16')](_0xa94d('0x12'),_0x54cbfc,_0x3ac912[_0xa94d('0x16')][_0xa94d('0x18')]);return _0xc841f1(_0x3ac912[_0xa94d('0x16')][_0xa94d('0x18')]);}else{logger['info'](_0xa94d('0x12'),_0x54cbfc,'request\x20sent');_0xc841f1(_0x3ac912[_0xa94d('0x19')]['message']);}})[_0xa94d('0x1a')](function(_0x38bb18){logger[_0xa94d('0x16')](_0xa94d('0x12'),_0x54cbfc,_0x38bb18);_0x14f4ae(_0x38bb18);});});}exports[_0xa94d('0x1b')]=function(_0x1a7a11){var _0x318d35=this;return new Promise(function(_0x3a307b,_0xe2cc35){return db['SmsInteraction']['update'](_0x1a7a11[_0xa94d('0x1c')],{'raw':_0x1a7a11['options']?_0x1a7a11['options'][_0xa94d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7a11['options']?_0x1a7a11['options']['where']||null:null,'attributes':_0x1a7a11[_0xa94d('0x1e')]?_0x1a7a11['options'][_0xa94d('0x1f')]||null:null,'limit':_0x1a7a11['options']?_0x1a7a11[_0xa94d('0x1e')][_0xa94d('0x20')]||null:null})[_0xa94d('0x21')](function(_0x2528df){logger['info']('UpdateSmsInteraction',_0x1a7a11);logger[_0xa94d('0x14')](_0xa94d('0x1b'),_0x1a7a11,JSON[_0xa94d('0x15')](_0x2528df));_0x3a307b(_0x2528df);})[_0xa94d('0x1a')](function(_0x547238){logger[_0xa94d('0x16')](_0xa94d('0x1b'),_0x547238['message'],_0x1a7a11);_0xe2cc35(_0x318d35[_0xa94d('0x16')](0x1f4,_0x547238[_0xa94d('0x18')]));});});};exports[_0xa94d('0x22')]=function(_0x5eb98f){return new Promise(function(_0x1d5284,_0x3e24cd){return db[_0xa94d('0x23')][_0xa94d('0x24')]({'where':_0x5eb98f[_0xa94d('0x1e')]?_0x5eb98f[_0xa94d('0x1e')]['where']||null:null})[_0xa94d('0x21')](function(_0x4d4160){if(_0x4d4160){return _0x4d4160['addTags'](_0x5eb98f['body']['ids'],_['omit'](_0x5eb98f[_0xa94d('0x1c')],['ids','id'])||{});}})[_0xa94d('0x25')](function(_0x1e9054){logger[_0xa94d('0x11')]('AddTags',_0x5eb98f);logger[_0xa94d('0x14')](_0xa94d('0x26'),_0x5eb98f,JSON[_0xa94d('0x15')](_0x1e9054));_0x1d5284(_0x1e9054);})['catch'](function(_0x746e03){logger[_0xa94d('0x16')](_0xa94d('0x26'),_0x746e03[_0xa94d('0x18')],_0x5eb98f);_0x3e24cd(_this['error'](0x1f4,_0x746e03[_0xa94d('0x18')]));});});};
\ No newline at end of file
index 8c46792..6f92dc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd967=['save','remove','update','emit'];(function(_0x1bc553,_0x329d78){var _0x2f9699=function(_0x13ec03){while(--_0x13ec03){_0x1bc553['push'](_0x1bc553['shift']());}};_0x2f9699(++_0x329d78);}(_0xd967,0x94));var _0x7d96=function(_0x3889ae,_0x4770c3){_0x3889ae=_0x3889ae-0x0;var _0x6533dd=_0xd967[_0x3889ae];return _0x6533dd;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x7d96('0x0'),_0x7d96('0x1'),_0x7d96('0x2')];function createListener(_0xe9e256,_0x3d5eb5){return function(_0x3ee3b8){_0x3d5eb5[_0x7d96('0x3')](_0xe9e256,_0x3ee3b8);};}function removeListener(_0x530439,_0x32ba4d){return function(){SmsInteractionEvents['removeListener'](_0x530439,_0x32ba4d);};}exports['register']=function(_0x5280c9){for(var _0x35a926=0x0,_0x51bb2e=events['length'];_0x35a926<_0x51bb2e;_0x35a926++){var _0x5d0a7e=events[_0x35a926];var _0x18eb95=createListener('smsInteraction:'+_0x5d0a7e,_0x5280c9);SmsInteractionEvents['on'](_0x5d0a7e,_0x18eb95);}};
\ No newline at end of file
+var _0x6853=['remove','update','emit','removeListener','register','./smsInteraction.events'];(function(_0x44cb52,_0x72fc8){var _0x389f92=function(_0xa5bad8){while(--_0xa5bad8){_0x44cb52['push'](_0x44cb52['shift']());}};_0x389f92(++_0x72fc8);}(_0x6853,0x6b));var _0x3685=function(_0x83d05e,_0xdcfd0d){_0x83d05e=_0x83d05e-0x0;var _0x5d5a2b=_0x6853[_0x83d05e];return _0x5d5a2b;};'use strict';var SmsInteractionEvents=require(_0x3685('0x0'));var events=['save',_0x3685('0x1'),_0x3685('0x2')];function createListener(_0x274bba,_0xc8f327){return function(_0x442ae0){_0xc8f327[_0x3685('0x3')](_0x274bba,_0x442ae0);};}function removeListener(_0x76b4f5,_0x494a70){return function(){SmsInteractionEvents[_0x3685('0x4')](_0x76b4f5,_0x494a70);};}exports[_0x3685('0x5')]=function(_0xeb35ec){for(var _0x5aafdf=0x0,_0x49c934=events['length'];_0x5aafdf<_0x49c934;_0x5aafdf++){var _0x179e22=events[_0x5aafdf];var _0x5eb3fa=createListener('smsInteraction:'+_0x179e22,_0xeb35ec);SmsInteractionEvents['on'](_0x179e22,_0x5eb3fa);}};
\ No newline at end of file
index 2079388..4be3209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x180d=['/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','status','put','update','accept','/:id/reject','reject','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x180d,0xf9));var _0xd180=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x180d[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0xd180('0x0'));var path=require(_0xd180('0x1'));var timeout=require(_0xd180('0x2'));var express=require(_0xd180('0x3'));var router=express[_0xd180('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd180('0x5'));var interaction=require(_0xd180('0x6'));var config=require(_0xd180('0x7'));var controller=require(_0xd180('0x8'));router[_0xd180('0x9')]('/',auth[_0xd180('0xa')](),controller['index']);router['get'](_0xd180('0xb'),auth[_0xd180('0xa')](),controller[_0xd180('0xc')]);router[_0xd180('0x9')](_0xd180('0xd'),auth[_0xd180('0xa')](),controller[_0xd180('0xe')]);router[_0xd180('0xf')]('/',auth[_0xd180('0xa')](),interaction[_0xd180('0x10')](_0xd180('0x11'),_0xd180('0x12')),controller[_0xd180('0x13')]);router[_0xd180('0xf')]('/:id/status',controller[_0xd180('0x14')]);router[_0xd180('0x15')](_0xd180('0xd'),auth[_0xd180('0xa')](),controller[_0xd180('0x16')]);router['put']('/:id/accept',auth[_0xd180('0xa')](),controller[_0xd180('0x17')]);router[_0xd180('0x15')](_0xd180('0x18'),auth[_0xd180('0xa')](),controller[_0xd180('0x19')]);router['delete']('/:id',auth[_0xd180('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x0cda=['smsmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms'];(function(_0x38d2a9,_0x1d59f8){var _0x321ff0=function(_0x568392){while(--_0x568392){_0x38d2a9['push'](_0x38d2a9['shift']());}};_0x321ff0(++_0x1d59f8);}(_0x0cda,0x80));var _0xa0cd=function(_0x2a993a,_0x1b2b34){_0x2a993a=_0x2a993a-0x0;var _0xdfd3ed=_0x0cda[_0x2a993a];return _0xdfd3ed;};'use strict';var multer=require(_0xa0cd('0x0'));var util=require(_0xa0cd('0x1'));var path=require(_0xa0cd('0x2'));var timeout=require('connect-timeout');var express=require(_0xa0cd('0x3'));var router=express[_0xa0cd('0x4')]();var fs_extra=require(_0xa0cd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa0cd('0x6'));var config=require('../../config/environment');var controller=require(_0xa0cd('0x7'));router[_0xa0cd('0x8')]('/',auth[_0xa0cd('0x9')](),controller[_0xa0cd('0xa')]);router[_0xa0cd('0x8')](_0xa0cd('0xb'),auth[_0xa0cd('0x9')](),controller[_0xa0cd('0xc')]);router[_0xa0cd('0x8')](_0xa0cd('0xd'),auth[_0xa0cd('0x9')](),controller[_0xa0cd('0xe')]);router['post']('/',auth[_0xa0cd('0x9')](),interaction[_0xa0cd('0xf')](_0xa0cd('0x10'),_0xa0cd('0x11')),controller[_0xa0cd('0x12')]);router['post']('/:id/status',controller[_0xa0cd('0x13')]);router[_0xa0cd('0x14')](_0xa0cd('0xd'),auth[_0xa0cd('0x9')](),controller[_0xa0cd('0x15')]);router[_0xa0cd('0x14')](_0xa0cd('0x16'),auth[_0xa0cd('0x9')](),controller[_0xa0cd('0x17')]);router[_0xa0cd('0x14')](_0xa0cd('0x18'),auth[_0xa0cd('0x9')](),controller[_0xa0cd('0x19')]);router[_0xa0cd('0x1a')](_0xa0cd('0xd'),auth['isAuthenticated'](),controller[_0xa0cd('0x1b')]);module[_0xa0cd('0x1c')]=router;
\ No newline at end of file
index f68e792..2259f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc651=['STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0xc651,0x16a));var _0x1c65=function(_0x50b410,_0x3741be){_0x50b410=_0x50b410-0x0;var _0x2d9eeb=_0xc651[_0x50b410];return _0x2d9eeb;};'use strict';var Sequelize=require(_0x1c65('0x0'));module[_0x1c65('0x1')]={'body':{'type':Sequelize[_0x1c65('0x2')](_0x1c65('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1c65('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1c65('0x5')]('in',_0x1c65('0x6')),'defaultValue':_0x1c65('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x1c65('0x7')](0xbe)},'phone':{'type':Sequelize[_0x1c65('0x7')]},'readAt':{'type':Sequelize[_0x1c65('0x8')]},'secret':{'type':Sequelize[_0x1c65('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1c65('0x7')]},'providerResponse':{'type':Sequelize[_0x1c65('0x2')]}};
\ No newline at end of file
+var _0x0233=['TEXT','medium','BOOLEAN','out','STRING','sequelize','exports'];(function(_0x5043a9,_0x5e5d50){var _0x32e792=function(_0x546f90){while(--_0x546f90){_0x5043a9['push'](_0x5043a9['shift']());}};_0x32e792(++_0x5e5d50);}(_0x0233,0x1b0));var _0x3023=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x0233[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require(_0x3023('0x0'));module[_0x3023('0x1')]={'body':{'type':Sequelize[_0x3023('0x2')](_0x3023('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3023('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3023('0x5')),'defaultValue':_0x3023('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3023('0x6')](0xbe)},'phone':{'type':Sequelize[_0x3023('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x3023('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3023('0x6')]},'providerResponse':{'type':Sequelize[_0x3023('0x2')]}};
\ No newline at end of file
index a7e1638..8be2e98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe99=['filter','SmsMessage','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','find','body','describe','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','sms-interactions','SmsInteractionId','null','RejectMessage','rejectMessage','SELECT','email','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','client','http','request','info','debug','request\x20sent','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xfe99,0xda));var _0x9fe9=function(_0x54b2ef,_0x98e281){_0x54b2ef=_0x54b2ef-0x0;var _0x45afe7=_0xfe99[_0x54b2ef];return _0x45afe7;};'use strict';var emlformat=require(_0x9fe9('0x0'));var rimraf=require(_0x9fe9('0x1'));var zipdir=require(_0x9fe9('0x2'));var jsonpatch=require(_0x9fe9('0x3'));var rp=require('request-promise');var moment=require(_0x9fe9('0x4'));var BPromise=require(_0x9fe9('0x5'));var Mustache=require(_0x9fe9('0x6'));var util=require('util');var path=require(_0x9fe9('0x7'));var sox=require(_0x9fe9('0x8'));var csv=require('to-csv');var ejs=require(_0x9fe9('0x9'));var fs=require('fs');var fs_extra=require(_0x9fe9('0xa'));var _=require(_0x9fe9('0xb'));var squel=require(_0x9fe9('0xc'));var crypto=require('crypto');var jsforce=require(_0x9fe9('0xd'));var deskjs=require(_0x9fe9('0xe'));var toCsv=require(_0x9fe9('0xf'));var querystring=require('querystring');var Papa=require(_0x9fe9('0x10'));var Redis=require(_0x9fe9('0x11'));var authService=require(_0x9fe9('0x12'));var qs=require(_0x9fe9('0x13'));var as=require(_0x9fe9('0x14'));var hardwareService=require(_0x9fe9('0x15'));var logger=require(_0x9fe9('0x16'))(_0x9fe9('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9fe9('0x18'));var db=require('../../mysqldb')['db'];config[_0x9fe9('0x19')]=_[_0x9fe9('0x1a')](config[_0x9fe9('0x19')],{'host':_0x9fe9('0x1b'),'port':0x18eb});var socket=require(_0x9fe9('0x1c'))(new Redis(config[_0x9fe9('0x19')]));require(_0x9fe9('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9fe9('0x1e')][_0x9fe9('0x1f')]({'port':0x232c});var client9002=jayson[_0x9fe9('0x1e')][_0x9fe9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5180d9,_0x302110,_0x3f6490,_0x44e2f9){return new BPromise(function(_0x2c2d2c,_0x5dd5a8){var _0x24c500=_0x44e2f9||client;return _0x24c500[_0x9fe9('0x20')](_0x5180d9,_0x3f6490)['then'](function(_0xd03ada){logger[_0x9fe9('0x21')]('SmsMessage,\x20%s,\x20%s',_0x302110,'request\x20sent');logger[_0x9fe9('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x302110,_0x9fe9('0x23'),JSON[_0x9fe9('0x24')](_0xd03ada));if(_0xd03ada['error']){if(_0xd03ada[_0x9fe9('0x25')][_0x9fe9('0x26')]===0x1f4){logger[_0x9fe9('0x25')](_0x9fe9('0x27'),_0x302110,_0xd03ada[_0x9fe9('0x25')][_0x9fe9('0x28')]);return _0x5dd5a8(_0xd03ada[_0x9fe9('0x25')][_0x9fe9('0x28')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x302110,_0xd03ada[_0x9fe9('0x25')][_0x9fe9('0x28')]);return _0x2c2d2c(_0xd03ada[_0x9fe9('0x25')][_0x9fe9('0x28')]);}else{logger[_0x9fe9('0x21')](_0x9fe9('0x27'),_0x302110,'request\x20sent');_0x2c2d2c(_0xd03ada[_0x9fe9('0x29')][_0x9fe9('0x28')]);}})['catch'](function(_0x4f0e07){logger[_0x9fe9('0x25')]('SmsMessage,\x20%s,\x20%s',_0x302110,_0x4f0e07);_0x5dd5a8(_0x4f0e07);});});}function respondWithStatusCode(_0x46dc21,_0x3cc528){_0x3cc528=_0x3cc528||0xcc;return function(_0x34ded6){if(_0x34ded6){return _0x46dc21['sendStatus'](_0x3cc528);}return _0x46dc21[_0x9fe9('0x2a')](_0x3cc528)[_0x9fe9('0x2b')]();};}function respondWithResult(_0x2dc9a9,_0x494e87){_0x494e87=_0x494e87||0xc8;return function(_0x208856){if(_0x208856){return _0x2dc9a9[_0x9fe9('0x2a')](_0x494e87)[_0x9fe9('0x2c')](_0x208856);}};}function respondWithFilteredResult(_0x55f059,_0x229e5a){return function(_0xfa6bad){if(_0xfa6bad){var _0x3be098=typeof _0x229e5a[_0x9fe9('0x2d')]===_0x9fe9('0x2e')&&typeof _0x229e5a[_0x9fe9('0x2f')]===_0x9fe9('0x2e');var _0x5af2d8=_0xfa6bad[_0x9fe9('0x30')];var _0x53494d=_0x3be098?0x0:_0x229e5a[_0x9fe9('0x2d')];var _0x94b2c9=_0x3be098?_0xfa6bad[_0x9fe9('0x30')]:_0x229e5a['offset']+_0x229e5a[_0x9fe9('0x2f')];var _0x23ea68;if(_0x94b2c9>=_0x5af2d8){_0x94b2c9=_0x5af2d8;_0x23ea68=0xc8;}else{_0x23ea68=0xce;}_0x55f059[_0x9fe9('0x2a')](_0x23ea68);return _0x55f059[_0x9fe9('0x31')]('Content-Range',_0x53494d+'-'+_0x94b2c9+'/'+_0x5af2d8)[_0x9fe9('0x2c')](_0xfa6bad);}return null;};}function patchUpdates(_0x16451e){return function(_0x3181db){try{jsonpatch[_0x9fe9('0x32')](_0x3181db,_0x16451e,!![]);}catch(_0x42a2ad){return BPromise[_0x9fe9('0x33')](_0x42a2ad);}return _0x3181db[_0x9fe9('0x34')]();};}function saveUpdates(_0x29afb2,_0x1edfae){return function(_0x5844f9){if(_0x5844f9){return _0x5844f9[_0x9fe9('0x35')](_0x29afb2)[_0x9fe9('0x36')](function(_0x425556){return _0x425556;});}return null;};}function removeEntity(_0x5a09ff,_0x28e629){return function(_0x1f8215){if(_0x1f8215){return _0x1f8215[_0x9fe9('0x37')]()[_0x9fe9('0x36')](function(){_0x5a09ff[_0x9fe9('0x2a')](0xcc)[_0x9fe9('0x2b')]();});}};}function handleEntityNotFound(_0x4d0e88,_0x5499e3){return function(_0x484a9e){if(!_0x484a9e){_0x4d0e88[_0x9fe9('0x38')](0x194);}return _0x484a9e;};}function handleError(_0x4bfa2e,_0x4c56e2){_0x4c56e2=_0x4c56e2||0x1f4;return function(_0x207ff0){logger[_0x9fe9('0x25')](_0x207ff0[_0x9fe9('0x39')]);if(_0x207ff0['name']){delete _0x207ff0[_0x9fe9('0x3a')];}_0x4bfa2e[_0x9fe9('0x2a')](_0x4c56e2)[_0x9fe9('0x3b')](_0x207ff0);};}exports[_0x9fe9('0x3c')]=function(_0x28df96,_0x37d15f){var _0x49c0d9={},_0x575cdc={},_0x52247a={'count':0x0,'rows':[]};var _0x559b1d=_[_0x9fe9('0x3d')](db['SmsMessage'][_0x9fe9('0x3e')],function(_0x17aaa4){return{'name':_0x17aaa4[_0x9fe9('0x3f')],'type':_0x17aaa4[_0x9fe9('0x40')][_0x9fe9('0x41')]};});_0x575cdc['model']=_['map'](_0x559b1d,_0x9fe9('0x3a'));_0x575cdc[_0x9fe9('0x42')]=_['keys'](_0x28df96[_0x9fe9('0x42')]);_0x575cdc[_0x9fe9('0x43')]=_['intersection'](_0x575cdc[_0x9fe9('0x44')],_0x575cdc['query']);_0x49c0d9['attributes']=_[_0x9fe9('0x45')](_0x575cdc['model'],qs[_0x9fe9('0x46')](_0x28df96[_0x9fe9('0x42')][_0x9fe9('0x46')]));_0x49c0d9['attributes']=_0x49c0d9[_0x9fe9('0x47')][_0x9fe9('0x48')]?_0x49c0d9['attributes']:_0x575cdc[_0x9fe9('0x44')];if(!_0x28df96['query'][_0x9fe9('0x49')](_0x9fe9('0x4a'))){_0x49c0d9[_0x9fe9('0x2f')]=qs[_0x9fe9('0x2f')](_0x28df96[_0x9fe9('0x42')][_0x9fe9('0x2f')]);_0x49c0d9['offset']=qs[_0x9fe9('0x2d')](_0x28df96['query'][_0x9fe9('0x2d')]);}_0x49c0d9['order']=qs['sort'](_0x28df96['query'][_0x9fe9('0x4b')]);_0x49c0d9[_0x9fe9('0x4c')]=qs[_0x9fe9('0x43')](_[_0x9fe9('0x4d')](_0x28df96[_0x9fe9('0x42')],_0x575cdc[_0x9fe9('0x43')]),_0x559b1d);if(_0x28df96[_0x9fe9('0x42')][_0x9fe9('0x4e')]){_0x49c0d9['where']=_['merge'](_0x49c0d9[_0x9fe9('0x4c')],{'$or':_['map'](_0x559b1d,function(_0x2f0819){if(_0x2f0819['type']!=='VIRTUAL'){var _0x59e025={};_0x59e025[_0x2f0819[_0x9fe9('0x3a')]]={'$like':'%'+_0x28df96[_0x9fe9('0x42')][_0x9fe9('0x4e')]+'%'};return _0x59e025;}})});}_0x49c0d9=_['merge']({},_0x49c0d9,_0x28df96['options']);var _0x281c7f={'where':_0x49c0d9[_0x9fe9('0x4c')]};return db[_0x9fe9('0x4f')]['count'](_0x281c7f)[_0x9fe9('0x36')](function(_0x3b4658){_0x52247a['count']=_0x3b4658;if(_0x28df96['query'][_0x9fe9('0x50')]){_0x49c0d9[_0x9fe9('0x51')]=[{'all':!![]}];}return db[_0x9fe9('0x4f')][_0x9fe9('0x52')](_0x49c0d9);})[_0x9fe9('0x36')](function(_0x431ba5){_0x52247a[_0x9fe9('0x53')]=_0x431ba5;return _0x52247a;})['then'](respondWithFilteredResult(_0x37d15f,_0x49c0d9))[_0x9fe9('0x54')](handleError(_0x37d15f,null));};exports[_0x9fe9('0x55')]=function(_0x51052e,_0x578331){var _0x1906b6={'raw':!![],'where':{'id':_0x51052e[_0x9fe9('0x56')]['id']}},_0x418ec0={};_0x418ec0[_0x9fe9('0x44')]=_[_0x9fe9('0x57')](db[_0x9fe9('0x4f')]['rawAttributes']);_0x418ec0[_0x9fe9('0x42')]=_['keys'](_0x51052e[_0x9fe9('0x42')]);_0x418ec0[_0x9fe9('0x43')]=_[_0x9fe9('0x45')](_0x418ec0[_0x9fe9('0x44')],_0x418ec0[_0x9fe9('0x42')]);_0x1906b6[_0x9fe9('0x47')]=_[_0x9fe9('0x45')](_0x418ec0[_0x9fe9('0x44')],qs[_0x9fe9('0x46')](_0x51052e['query'][_0x9fe9('0x46')]));_0x1906b6[_0x9fe9('0x47')]=_0x1906b6[_0x9fe9('0x47')][_0x9fe9('0x48')]?_0x1906b6[_0x9fe9('0x47')]:_0x418ec0['model'];if(_0x51052e['query'][_0x9fe9('0x50')]){_0x1906b6[_0x9fe9('0x51')]=[{'all':!![]}];}_0x1906b6=_[_0x9fe9('0x58')]({},_0x1906b6,_0x51052e[_0x9fe9('0x59')]);return db[_0x9fe9('0x4f')][_0x9fe9('0x5a')](_0x1906b6)[_0x9fe9('0x36')](handleEntityNotFound(_0x578331,null))[_0x9fe9('0x36')](respondWithResult(_0x578331,null))[_0x9fe9('0x54')](handleError(_0x578331,null));};exports['create']=function(_0x339641,_0x3c567d){return db[_0x9fe9('0x4f')]['create'](_0x339641['body'],{})[_0x9fe9('0x36')](respondWithResult(_0x3c567d,0xc9))['catch'](handleError(_0x3c567d,null));};exports[_0x9fe9('0x35')]=function(_0x52f03c,_0x1b3d18){if(_0x52f03c[_0x9fe9('0x5b')]['id']){delete _0x52f03c[_0x9fe9('0x5b')]['id'];}return db[_0x9fe9('0x4f')][_0x9fe9('0x5a')]({'where':{'id':_0x52f03c[_0x9fe9('0x56')]['id']}})[_0x9fe9('0x36')](handleEntityNotFound(_0x1b3d18,null))[_0x9fe9('0x36')](saveUpdates(_0x52f03c[_0x9fe9('0x5b')],null))['then'](respondWithResult(_0x1b3d18,null))['catch'](handleError(_0x1b3d18,null));};exports['destroy']=function(_0x148cf0,_0x29090a){return db['SmsMessage'][_0x9fe9('0x5a')]({'where':{'id':_0x148cf0['params']['id']}})['then'](handleEntityNotFound(_0x29090a,null))[_0x9fe9('0x36')](removeEntity(_0x29090a,null))['catch'](handleError(_0x29090a,null));};exports[_0x9fe9('0x5c')]=function(_0x1d00db,_0xbea391){return db['SmsMessage'][_0x9fe9('0x5c')]()[_0x9fe9('0x36')](respondWithResult(_0xbea391,null))[_0x9fe9('0x54')](handleError(_0xbea391,null));};var interaction_log=require(_0x9fe9('0x16'))('sms-interactions');exports[_0x9fe9('0x5d')]=function(_0x27e2b7,_0x159006,_0x53d103){var _0x53b741={'agent':{},'channel':_0x9fe9('0x5e')};if(_0x27e2b7[_0x9fe9('0x5b')]['id']){delete _0x27e2b7[_0x9fe9('0x5b')]['id'];}_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x5f')]=!![];_0x27e2b7[_0x9fe9('0x5b')]['readAt']=moment()['format'](_0x9fe9('0x60'));_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x61')]=_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x61')]||_0x27e2b7[_0x9fe9('0x62')]['id'];_0x53b741[_0x9fe9('0x63')]['id']=_0x27e2b7['body'][_0x9fe9('0x61')];return db['SmsMessage'][_0x9fe9('0x5a')]({'where':{'id':_0x27e2b7[_0x9fe9('0x56')]['id'],'UserId':null}})[_0x9fe9('0x36')](handleEntityNotFound(_0x159006,null))[_0x9fe9('0x36')](saveUpdates(_0x27e2b7[_0x9fe9('0x5b')],null))[_0x9fe9('0x36')](function(_0x523cb1){if(_0x523cb1){_0x53b741[_0x9fe9('0x28')]=_0x523cb1[_0x9fe9('0x64')]({'plain':!![]});return db[_0x9fe9('0x65')][_0x9fe9('0x5a')]({'where':{'id':_0x523cb1['SmsInteractionId']}});}return null;})[_0x9fe9('0x36')](handleEntityNotFound(_0x159006,null))[_0x9fe9('0x36')](function(_0x2dfb4a){if(_0x2dfb4a){return _0x2dfb4a['update']({'UserId':_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x61')],'read1stAt':_['isNil'](_0x2dfb4a[_0x9fe9('0x66')])?moment()[_0x9fe9('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9fe9('0x36')](function(_0x1e1f46){if(_0x1e1f46){_0x53b741[_0x9fe9('0x68')]=_0x1e1f46[_0x9fe9('0x64')]({'plain':!![]});interaction_log[_0x9fe9('0x21')](_0x9fe9('0x69'),_0x27e2b7[_0x9fe9('0x62')]['id'],_0x27e2b7['user'][_0x9fe9('0x3a')],_0x27e2b7[_0x9fe9('0x62')][_0x9fe9('0x6a')],_0x53b741[_0x9fe9('0x68')]['id'],_0x27e2b7[_0x9fe9('0x5b')]?JSON[_0x9fe9('0x24')](_0x27e2b7[_0x9fe9('0x5b')]):'null');return respondWithRpcPromise(_0x9fe9('0x6b'),'acceptMessage',_0x53b741);}return null;})[_0x9fe9('0x36')](function(_0x200d6a){var _0x4a6e13=_0x9fe9('0x6c')+_0x200d6a[_0x9fe9('0x28')][_0x9fe9('0x6d')];return db[_0x9fe9('0x6e')][_0x9fe9('0x42')](_0x4a6e13,{'type':db[_0x9fe9('0x6f')][_0x9fe9('0x70')]['SELECT'],'raw':!![]})[_0x9fe9('0x36')](function(_0xc8af67){return _0xc8af67;});})[_0x9fe9('0x36')](function(_0x7eae8f){if(_0x7eae8f){_0x53b741[_0x9fe9('0x28')][_0x9fe9('0x71')]=_0x7eae8f[0x0];if(!_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x61')])return;return db[_0x9fe9('0x72')][_0x9fe9('0x5a')]({'where':{'id':_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x61')],'role':_0x9fe9('0x63')},'attributes':['id',_0x9fe9('0x3a'),_0x9fe9('0x73'),'email',_0x9fe9('0x74')],'raw':!![]});}return null;})[_0x9fe9('0x36')](function(_0x26848e){if(!_0x26848e)return null;_0x53b741[_0x9fe9('0x28')][_0x9fe9('0x63')]=_0x26848e;return _0x53b741;})[_0x9fe9('0x36')](function(_0x5878fc){if(_0x5878fc){if(_0x27e2b7[_0x9fe9('0x5b')][_0x9fe9('0x75')]){_0x53b741['message'][_0x9fe9('0x76')]=util[_0x9fe9('0x67')](_0x9fe9('0x77'),_0x27e2b7[_0x9fe9('0x62')][_0x9fe9('0x3a')]);_0x53b741[_0x9fe9('0x28')][_0x9fe9('0x78')]=_0x53b741[_0x9fe9('0x78')];_0x53b741[_0x9fe9('0x28')][_0x9fe9('0x79')]=_0x9fe9('0x5d');return respondWithRpcPromise(_0x9fe9('0x7a'),_0x9fe9('0x7a'),{'event':'acceptmessage','message':_0x53b741[_0x9fe9('0x28')]},client9002)[_0x9fe9('0x36')](function(){return _0x53b741;});}return _0x53b741;}return null;})[_0x9fe9('0x36')](respondWithResult(_0x159006,null))[_0x9fe9('0x54')](handleError(_0x159006,null));};var interaction_log=require(_0x9fe9('0x16'))(_0x9fe9('0x7b'));exports[_0x9fe9('0x33')]=function(_0x1620f1,_0x50c131,_0xa086e){var _0x32aa55={'agent':{},'channel':_0x9fe9('0x5e')};if(_0x1620f1['body']['id']){delete _0x1620f1[_0x9fe9('0x5b')]['id'];}_0x1620f1['body'][_0x9fe9('0x61')]=_0x1620f1[_0x9fe9('0x5b')][_0x9fe9('0x61')]||_0x1620f1[_0x9fe9('0x62')]['id'];_0x32aa55[_0x9fe9('0x63')]['id']=_0x1620f1[_0x9fe9('0x5b')][_0x9fe9('0x61')];return db['SmsMessage'][_0x9fe9('0x5a')]({'where':{'id':_0x1620f1['params']['id'],'UserId':null}})[_0x9fe9('0x36')](handleEntityNotFound(_0x50c131,null))[_0x9fe9('0x36')](function(_0x3dbe45){if(_0x3dbe45){_0x32aa55[_0x9fe9('0x28')]=_0x3dbe45[_0x9fe9('0x64')]({'plain':!![]});return db[_0x9fe9('0x65')][_0x9fe9('0x5a')]({'where':{'id':_0x3dbe45[_0x9fe9('0x7c')]}});}return null;})[_0x9fe9('0x36')](handleEntityNotFound(_0x50c131,null))[_0x9fe9('0x36')](function(_0x935906){if(_0x935906){_0x32aa55[_0x9fe9('0x68')]=_0x935906['get']({'plain':!![]});interaction_log[_0x9fe9('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1620f1[_0x9fe9('0x62')]['id'],_0x1620f1[_0x9fe9('0x62')]['name'],_0x1620f1['user'][_0x9fe9('0x6a')],_0x32aa55[_0x9fe9('0x68')]['id'],_0x1620f1['body']?JSON[_0x9fe9('0x24')](_0x1620f1[_0x9fe9('0x5b')]):_0x9fe9('0x7d'));return respondWithRpcPromise(_0x9fe9('0x7e'),_0x9fe9('0x7f'),_0x32aa55);}return null;})[_0x9fe9('0x36')](function(_0x5f546f){var _0x57f3b0=_0x9fe9('0x6c')+_0x5f546f[_0x9fe9('0x28')][_0x9fe9('0x6d')];return db[_0x9fe9('0x6e')]['query'](_0x57f3b0,{'type':db[_0x9fe9('0x6f')]['QueryTypes'][_0x9fe9('0x80')],'raw':!![]})[_0x9fe9('0x36')](function(_0x22ef4f){return _0x22ef4f;});})[_0x9fe9('0x36')](function(_0x13eba5){if(_0x13eba5){_0x32aa55[_0x9fe9('0x28')]['contact']=_0x13eba5[0x0];if(!_0x1620f1[_0x9fe9('0x5b')][_0x9fe9('0x61')])return;return db['User']['find']({'where':{'id':_0x1620f1[_0x9fe9('0x5b')][_0x9fe9('0x61')],'role':_0x9fe9('0x63')},'attributes':['id',_0x9fe9('0x3a'),'fullname',_0x9fe9('0x81'),_0x9fe9('0x74')],'raw':!![]});}return null;})[_0x9fe9('0x36')](function(_0x4ce36f){if(!_0x4ce36f)return null;_0x32aa55['message'][_0x9fe9('0x63')]=_0x4ce36f;return _0x32aa55;})[_0x9fe9('0x36')](function(_0x3325c1){if(_0x3325c1){_0x3325c1['message'][_0x9fe9('0x76')]=util[_0x9fe9('0x67')]('SIP/%s',_0x1620f1['user'][_0x9fe9('0x3a')]);_0x3325c1[_0x9fe9('0x28')]['channel']=_0x32aa55[_0x9fe9('0x78')];_0x3325c1[_0x9fe9('0x28')][_0x9fe9('0x79')]=_0x9fe9('0x33');respondWithRpcPromise('EventManager',_0x9fe9('0x7a'),{'event':'rejectmessage','message':_0x3325c1['message']},client9002);return _0x32aa55;}return null;})[_0x9fe9('0x36')](respondWithResult(_0x50c131,null))[_0x9fe9('0x54')](handleError(_0x50c131,null));};exports[_0x9fe9('0x2a')]=function(_0x106958,_0x19e594,_0x31a06e){if(_0x106958[_0x9fe9('0x5b')]['id']){delete _0x106958['body']['id'];}var _0x55b225;return db[_0x9fe9('0x4f')][_0x9fe9('0x5a')]({'where':{'id':_0x106958['params']['id']}})['then'](handleEntityNotFound(_0x19e594,null))['then'](function(_0x56cbec){if(_0x56cbec){_0x55b225=_0x56cbec;return db[_0x9fe9('0x82')]['find']({'where':{'id':_0x56cbec[_0x9fe9('0x83')]}});}})[_0x9fe9('0x36')](handleEntityNotFound(_0x19e594,null))[_0x9fe9('0x36')](function(_0x588c39){if(_0x588c39){logger[_0x9fe9('0x22')](_0x9fe9('0x84'),_0x9fe9('0x2a'),_0x9fe9('0x85'),_0x588c39[_0x9fe9('0x40')],util[_0x9fe9('0x86')](_0x106958[_0x9fe9('0x5b')],{'showHidden':![],'depth':null}));switch(_0x588c39[_0x9fe9('0x40')]){case _0x9fe9('0x87'):if(_0x106958[_0x9fe9('0x5b')][_0x9fe9('0x88')]&&_0x106958[_0x9fe9('0x5b')]['MessageSid']===_0x55b225[_0x9fe9('0x89')]){return _0x55b225[_0x9fe9('0x35')]({'read':!![]});}else{logger[_0x9fe9('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','twilio',util['inspect'](_0x106958['body'],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x106958[_0x9fe9('0x5b')][_0x9fe9('0x8a')]&&_0x106958[_0x9fe9('0x5b')][_0x9fe9('0x8a')]===_0x55b225[_0x9fe9('0x89')]&&_[_0x9fe9('0x8b')]([_0x9fe9('0x8c'),_0x9fe9('0x8d')],_0x106958[_0x9fe9('0x5b')][_0x9fe9('0x8e')])>=0x0){return _0x55b225[_0x9fe9('0x35')]({'read':!![]});}else{logger[_0x9fe9('0x25')](_0x9fe9('0x8f'),_0x9fe9('0x2a'),_0x9fe9('0x90'),util[_0x9fe9('0x86')](_0x106958['body'],{'showHidden':![],'depth':null}));}break;case _0x9fe9('0x91'):var _0x51adb2=_0x106958[_0x9fe9('0x5b')][_0x9fe9('0x92')][0x0];if(_0x51adb2['status'][_0x9fe9('0x93')]==='DELIVERED'){return _0x55b225['update']({'read':!![]});}else{logger[_0x9fe9('0x25')](_0x9fe9('0x8f'),_0x9fe9('0x2a'),_0x9fe9('0x91'),util[_0x9fe9('0x86')](_0x106958[_0x9fe9('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x55b225;}})[_0x9fe9('0x36')](respondWithResult(_0x19e594,null))['catch'](handleError(_0x19e594,null));};
\ No newline at end of file
+var _0x724c=['MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','send','map','SmsMessage','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','create','body','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','manual','interface','channel','EventManager','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','User','email','rejectmessage','SmsAccountId','type','inspect','twilio'];(function(_0x321613,_0x39a4dc){var _0x23595f=function(_0x31b645){while(--_0x31b645){_0x321613['push'](_0x321613['shift']());}};_0x23595f(++_0x39a4dc);}(_0x724c,0x1c7));var _0xc724=function(_0xa7e359,_0x59d9a4){_0xa7e359=_0xa7e359-0x0;var _0x142f6d=_0x724c[_0xa7e359];return _0x142f6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc724('0x0'));var zipdir=require(_0xc724('0x1'));var jsonpatch=require(_0xc724('0x2'));var rp=require('request-promise');var moment=require(_0xc724('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc724('0x4'));var util=require('util');var path=require(_0xc724('0x5'));var sox=require(_0xc724('0x6'));var csv=require('to-csv');var ejs=require(_0xc724('0x7'));var fs=require('fs');var fs_extra=require(_0xc724('0x8'));var _=require('lodash');var squel=require(_0xc724('0x9'));var crypto=require(_0xc724('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc724('0xb'));var toCsv=require(_0xc724('0xc'));var querystring=require(_0xc724('0xd'));var Papa=require(_0xc724('0xe'));var Redis=require(_0xc724('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc724('0x10'));var as=require(_0xc724('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc724('0x12'))('api');var utils=require(_0xc724('0x13'));var config=require(_0xc724('0x14'));var licenseUtil=require(_0xc724('0x15'));var db=require(_0xc724('0x16'))['db'];config[_0xc724('0x17')]=_['defaults'](config[_0xc724('0x17')],{'host':_0xc724('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc724('0x17')]));require(_0xc724('0x19'))[_0xc724('0x1a')](socket);var jayson=require(_0xc724('0x1b'));var client=jayson[_0xc724('0x1c')][_0xc724('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xc724('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x278453,_0x116977,_0x1899f4,_0x8c654e){return new BPromise(function(_0x32eedf,_0x5ccc66){var _0x551c1f=_0x8c654e||client;return _0x551c1f[_0xc724('0x1e')](_0x278453,_0x1899f4)[_0xc724('0x1f')](function(_0x5987b8){logger['info']('SmsMessage,\x20%s,\x20%s',_0x116977,_0xc724('0x20'));logger[_0xc724('0x21')](_0xc724('0x22'),_0x116977,'request\x20sent',JSON[_0xc724('0x23')](_0x5987b8));if(_0x5987b8[_0xc724('0x24')]){if(_0x5987b8[_0xc724('0x24')][_0xc724('0x25')]===0x1f4){logger['error'](_0xc724('0x26'),_0x116977,_0x5987b8['error'][_0xc724('0x27')]);return _0x5ccc66(_0x5987b8[_0xc724('0x24')]['message']);}logger[_0xc724('0x24')](_0xc724('0x26'),_0x116977,_0x5987b8['error'][_0xc724('0x27')]);return _0x32eedf(_0x5987b8['error'][_0xc724('0x27')]);}else{logger['info'](_0xc724('0x26'),_0x116977,_0xc724('0x20'));_0x32eedf(_0x5987b8[_0xc724('0x28')][_0xc724('0x27')]);}})[_0xc724('0x29')](function(_0x56a9f9){logger[_0xc724('0x24')](_0xc724('0x26'),_0x116977,_0x56a9f9);_0x5ccc66(_0x56a9f9);});});}function respondWithStatusCode(_0x50c889,_0x537939){_0x537939=_0x537939||0xcc;return function(_0x408d76){if(_0x408d76){return _0x50c889[_0xc724('0x2a')](_0x537939);}return _0x50c889['status'](_0x537939)[_0xc724('0x2b')]();};}function respondWithResult(_0x2cbb10,_0x3801cb){_0x3801cb=_0x3801cb||0xc8;return function(_0x38e14){if(_0x38e14){return _0x2cbb10[_0xc724('0x2c')](_0x3801cb)[_0xc724('0x2d')](_0x38e14);}};}function respondWithFilteredResult(_0x2dfe30,_0x535522){return function(_0x293bef){if(_0x293bef){var _0x3ac791=typeof _0x535522[_0xc724('0x2e')]===_0xc724('0x2f')&&typeof _0x535522[_0xc724('0x30')]===_0xc724('0x2f');var _0x55b689=_0x293bef[_0xc724('0x31')];var _0x3b3afc=_0x3ac791?0x0:_0x535522[_0xc724('0x2e')];var _0x364a53=_0x3ac791?_0x293bef[_0xc724('0x31')]:_0x535522[_0xc724('0x2e')]+_0x535522['limit'];var _0x3bcc5f;if(_0x364a53>=_0x55b689){_0x364a53=_0x55b689;_0x3bcc5f=0xc8;}else{_0x3bcc5f=0xce;}_0x2dfe30[_0xc724('0x2c')](_0x3bcc5f);return _0x2dfe30[_0xc724('0x32')](_0xc724('0x33'),_0x3b3afc+'-'+_0x364a53+'/'+_0x55b689)['json'](_0x293bef);}return null;};}function patchUpdates(_0x59706a){return function(_0x4c111a){try{jsonpatch[_0xc724('0x34')](_0x4c111a,_0x59706a,!![]);}catch(_0x8e8f42){return BPromise['reject'](_0x8e8f42);}return _0x4c111a[_0xc724('0x35')]();};}function saveUpdates(_0x44a184,_0xace185){return function(_0x26b191){if(_0x26b191){return _0x26b191[_0xc724('0x36')](_0x44a184)[_0xc724('0x1f')](function(_0xa8609e){return _0xa8609e;});}return null;};}function removeEntity(_0x2e64c9,_0x28ea19){return function(_0x1f7b95){if(_0x1f7b95){return _0x1f7b95[_0xc724('0x37')]()[_0xc724('0x1f')](function(){_0x2e64c9[_0xc724('0x2c')](0xcc)[_0xc724('0x2b')]();});}};}function handleEntityNotFound(_0x1e1559,_0x2b2386){return function(_0x39ab50){if(!_0x39ab50){_0x1e1559[_0xc724('0x2a')](0x194);}return _0x39ab50;};}function handleError(_0x404add,_0x56f743){_0x56f743=_0x56f743||0x1f4;return function(_0x26493e){logger[_0xc724('0x24')](_0x26493e[_0xc724('0x38')]);if(_0x26493e['name']){delete _0x26493e[_0xc724('0x39')];}_0x404add['status'](_0x56f743)[_0xc724('0x3a')](_0x26493e);};}exports['index']=function(_0x4ae86a,_0x1d3605){var _0x2aa9f9={},_0x1a3357={},_0x16daa6={'count':0x0,'rows':[]};var _0x40ab6e=_[_0xc724('0x3b')](db[_0xc724('0x3c')][_0xc724('0x3d')],function(_0x3d84d9){return{'name':_0x3d84d9[_0xc724('0x3e')],'type':_0x3d84d9['type']['key']};});_0x1a3357['model']=_[_0xc724('0x3b')](_0x40ab6e,_0xc724('0x39'));_0x1a3357[_0xc724('0x3f')]=_['keys'](_0x4ae86a[_0xc724('0x3f')]);_0x1a3357[_0xc724('0x40')]=_[_0xc724('0x41')](_0x1a3357[_0xc724('0x42')],_0x1a3357[_0xc724('0x3f')]);_0x2aa9f9[_0xc724('0x43')]=_[_0xc724('0x41')](_0x1a3357[_0xc724('0x42')],qs['fields'](_0x4ae86a['query'][_0xc724('0x44')]));_0x2aa9f9['attributes']=_0x2aa9f9[_0xc724('0x43')][_0xc724('0x45')]?_0x2aa9f9[_0xc724('0x43')]:_0x1a3357['model'];if(!_0x4ae86a[_0xc724('0x3f')][_0xc724('0x46')](_0xc724('0x47'))){_0x2aa9f9[_0xc724('0x30')]=qs[_0xc724('0x30')](_0x4ae86a[_0xc724('0x3f')][_0xc724('0x30')]);_0x2aa9f9[_0xc724('0x2e')]=qs[_0xc724('0x2e')](_0x4ae86a['query']['offset']);}_0x2aa9f9[_0xc724('0x48')]=qs[_0xc724('0x49')](_0x4ae86a['query'][_0xc724('0x49')]);_0x2aa9f9[_0xc724('0x4a')]=qs['filters'](_[_0xc724('0x4b')](_0x4ae86a[_0xc724('0x3f')],_0x1a3357[_0xc724('0x40')]),_0x40ab6e);if(_0x4ae86a[_0xc724('0x3f')][_0xc724('0x4c')]){_0x2aa9f9[_0xc724('0x4a')]=_[_0xc724('0x4d')](_0x2aa9f9[_0xc724('0x4a')],{'$or':_[_0xc724('0x3b')](_0x40ab6e,function(_0xc48253){if(_0xc48253['type']!==_0xc724('0x4e')){var _0x8d6399={};_0x8d6399[_0xc48253[_0xc724('0x39')]]={'$like':'%'+_0x4ae86a[_0xc724('0x3f')]['filter']+'%'};return _0x8d6399;}})});}_0x2aa9f9=_['merge']({},_0x2aa9f9,_0x4ae86a[_0xc724('0x4f')]);var _0x4d20bc={'where':_0x2aa9f9[_0xc724('0x4a')]};return db[_0xc724('0x3c')][_0xc724('0x31')](_0x4d20bc)[_0xc724('0x1f')](function(_0x4ae142){_0x16daa6[_0xc724('0x31')]=_0x4ae142;if(_0x4ae86a[_0xc724('0x3f')][_0xc724('0x50')]){_0x2aa9f9[_0xc724('0x51')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x2aa9f9);})[_0xc724('0x1f')](function(_0x60030c){_0x16daa6[_0xc724('0x52')]=_0x60030c;return _0x16daa6;})[_0xc724('0x1f')](respondWithFilteredResult(_0x1d3605,_0x2aa9f9))['catch'](handleError(_0x1d3605,null));};exports[_0xc724('0x53')]=function(_0x1b0ce6,_0x2b7d3){var _0x213a28={'raw':!![],'where':{'id':_0x1b0ce6[_0xc724('0x54')]['id']}},_0x39ad90={};_0x39ad90[_0xc724('0x42')]=_[_0xc724('0x55')](db[_0xc724('0x3c')][_0xc724('0x3d')]);_0x39ad90['query']=_['keys'](_0x1b0ce6[_0xc724('0x3f')]);_0x39ad90['filters']=_[_0xc724('0x41')](_0x39ad90[_0xc724('0x42')],_0x39ad90['query']);_0x213a28[_0xc724('0x43')]=_[_0xc724('0x41')](_0x39ad90['model'],qs[_0xc724('0x44')](_0x1b0ce6['query'][_0xc724('0x44')]));_0x213a28[_0xc724('0x43')]=_0x213a28['attributes'][_0xc724('0x45')]?_0x213a28[_0xc724('0x43')]:_0x39ad90[_0xc724('0x42')];if(_0x1b0ce6[_0xc724('0x3f')][_0xc724('0x50')]){_0x213a28[_0xc724('0x51')]=[{'all':!![]}];}_0x213a28=_['merge']({},_0x213a28,_0x1b0ce6['options']);return db['SmsMessage'][_0xc724('0x56')](_0x213a28)[_0xc724('0x1f')](handleEntityNotFound(_0x2b7d3,null))[_0xc724('0x1f')](respondWithResult(_0x2b7d3,null))[_0xc724('0x29')](handleError(_0x2b7d3,null));};exports[_0xc724('0x57')]=function(_0x66c222,_0x20e7b7){return db[_0xc724('0x3c')][_0xc724('0x57')](_0x66c222[_0xc724('0x58')],{})[_0xc724('0x1f')](respondWithResult(_0x20e7b7,0xc9))[_0xc724('0x29')](handleError(_0x20e7b7,null));};exports['update']=function(_0x578447,_0x5115da){if(_0x578447['body']['id']){delete _0x578447['body']['id'];}return db['SmsMessage']['find']({'where':{'id':_0x578447[_0xc724('0x54')]['id']}})[_0xc724('0x1f')](handleEntityNotFound(_0x5115da,null))['then'](saveUpdates(_0x578447['body'],null))['then'](respondWithResult(_0x5115da,null))[_0xc724('0x29')](handleError(_0x5115da,null));};exports[_0xc724('0x37')]=function(_0x46353c,_0x55a2b1){return db['SmsMessage']['find']({'where':{'id':_0x46353c[_0xc724('0x54')]['id']}})[_0xc724('0x1f')](handleEntityNotFound(_0x55a2b1,null))[_0xc724('0x1f')](removeEntity(_0x55a2b1,null))['catch'](handleError(_0x55a2b1,null));};exports[_0xc724('0x59')]=function(_0x26b06e,_0x429b72){return db['SmsMessage'][_0xc724('0x59')]()[_0xc724('0x1f')](respondWithResult(_0x429b72,null))[_0xc724('0x29')](handleError(_0x429b72,null));};var interaction_log=require(_0xc724('0x12'))(_0xc724('0x5a'));exports[_0xc724('0x5b')]=function(_0x924ce4,_0x4b3b28,_0xe0042a){var _0x559bb9={'agent':{},'channel':'sms'};if(_0x924ce4[_0xc724('0x58')]['id']){delete _0x924ce4[_0xc724('0x58')]['id'];}_0x924ce4[_0xc724('0x58')][_0xc724('0x5c')]=!![];_0x924ce4[_0xc724('0x58')]['readAt']=moment()[_0xc724('0x5d')](_0xc724('0x5e'));_0x924ce4[_0xc724('0x58')][_0xc724('0x5f')]=_0x924ce4[_0xc724('0x58')][_0xc724('0x5f')]||_0x924ce4['user']['id'];_0x559bb9['agent']['id']=_0x924ce4[_0xc724('0x58')][_0xc724('0x5f')];return db['SmsMessage'][_0xc724('0x56')]({'where':{'id':_0x924ce4[_0xc724('0x54')]['id'],'UserId':null}})[_0xc724('0x1f')](handleEntityNotFound(_0x4b3b28,null))[_0xc724('0x1f')](saveUpdates(_0x924ce4[_0xc724('0x58')],null))[_0xc724('0x1f')](function(_0x157ee2){if(_0x157ee2){_0x559bb9[_0xc724('0x27')]=_0x157ee2[_0xc724('0x60')]({'plain':!![]});return db[_0xc724('0x61')][_0xc724('0x56')]({'where':{'id':_0x157ee2[_0xc724('0x62')]}});}return null;})[_0xc724('0x1f')](handleEntityNotFound(_0x4b3b28,null))[_0xc724('0x1f')](function(_0x8b64e){if(_0x8b64e){return _0x8b64e[_0xc724('0x36')]({'UserId':_0x924ce4[_0xc724('0x58')][_0xc724('0x5f')],'read1stAt':_[_0xc724('0x63')](_0x8b64e[_0xc724('0x64')])?moment()[_0xc724('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc724('0x1f')](function(_0x5db980){if(_0x5db980){_0x559bb9[_0xc724('0x65')]=_0x5db980['get']({'plain':!![]});interaction_log[_0xc724('0x66')](_0xc724('0x67'),_0x924ce4[_0xc724('0x68')]['id'],_0x924ce4['user'][_0xc724('0x39')],_0x924ce4[_0xc724('0x68')][_0xc724('0x69')],_0x559bb9[_0xc724('0x65')]['id'],_0x924ce4[_0xc724('0x58')]?JSON[_0xc724('0x23')](_0x924ce4[_0xc724('0x58')]):'null');return respondWithRpcPromise(_0xc724('0x6a'),_0xc724('0x6b'),_0x559bb9);}return null;})[_0xc724('0x1f')](function(_0x3fbb2b){var _0x387047=_0xc724('0x6c')+_0x3fbb2b[_0xc724('0x27')][_0xc724('0x6d')];return db[_0xc724('0x6e')]['query'](_0x387047,{'type':db[_0xc724('0x6f')][_0xc724('0x70')][_0xc724('0x71')],'raw':!![]})[_0xc724('0x1f')](function(_0xe0caec){return _0xe0caec;});})['then'](function(_0x22c704){if(_0x22c704){_0x559bb9['message'][_0xc724('0x72')]=_0x22c704[0x0];if(!_0x924ce4['body']['UserId'])return;return db['User'][_0xc724('0x56')]({'where':{'id':_0x924ce4[_0xc724('0x58')][_0xc724('0x5f')],'role':_0xc724('0x73')},'attributes':['id',_0xc724('0x39'),_0xc724('0x74'),'email',_0xc724('0x75')],'raw':!![]});}return null;})['then'](function(_0x28b01a){if(!_0x28b01a)return null;_0x559bb9[_0xc724('0x27')][_0xc724('0x73')]=_0x28b01a;return _0x559bb9;})[_0xc724('0x1f')](function(_0x3fd6b2){if(_0x3fd6b2){if(_0x924ce4[_0xc724('0x58')][_0xc724('0x76')]){_0x559bb9[_0xc724('0x27')][_0xc724('0x77')]=util['format']('SIP/%s',_0x924ce4[_0xc724('0x68')][_0xc724('0x39')]);_0x559bb9[_0xc724('0x27')][_0xc724('0x78')]=_0x559bb9['channel'];_0x559bb9[_0xc724('0x27')]['event']=_0xc724('0x5b');return respondWithRpcPromise(_0xc724('0x79'),'EventManager',{'event':'acceptmessage','message':_0x559bb9[_0xc724('0x27')]},client9002)['then'](function(){return _0x559bb9;});}return _0x559bb9;}return null;})['then'](respondWithResult(_0x4b3b28,null))[_0xc724('0x29')](handleError(_0x4b3b28,null));};var interaction_log=require(_0xc724('0x12'))('sms-interactions');exports[_0xc724('0x7a')]=function(_0x1fadca,_0x263f8b,_0x341882){var _0x326855={'agent':{},'channel':'sms'};if(_0x1fadca['body']['id']){delete _0x1fadca[_0xc724('0x58')]['id'];}_0x1fadca['body']['UserId']=_0x1fadca[_0xc724('0x58')][_0xc724('0x5f')]||_0x1fadca[_0xc724('0x68')]['id'];_0x326855['agent']['id']=_0x1fadca[_0xc724('0x58')]['UserId'];return db['SmsMessage'][_0xc724('0x56')]({'where':{'id':_0x1fadca['params']['id'],'UserId':null}})[_0xc724('0x1f')](handleEntityNotFound(_0x263f8b,null))[_0xc724('0x1f')](function(_0x194ac8){if(_0x194ac8){_0x326855['message']=_0x194ac8[_0xc724('0x60')]({'plain':!![]});return db['SmsInteraction'][_0xc724('0x56')]({'where':{'id':_0x194ac8['SmsInteractionId']}});}return null;})[_0xc724('0x1f')](handleEntityNotFound(_0x263f8b,null))[_0xc724('0x1f')](function(_0x3bbe20){if(_0x3bbe20){_0x326855[_0xc724('0x65')]=_0x3bbe20['get']({'plain':!![]});interaction_log[_0xc724('0x66')](_0xc724('0x7b'),_0x1fadca[_0xc724('0x68')]['id'],_0x1fadca[_0xc724('0x68')][_0xc724('0x39')],_0x1fadca['user'][_0xc724('0x69')],_0x326855[_0xc724('0x65')]['id'],_0x1fadca[_0xc724('0x58')]?JSON[_0xc724('0x23')](_0x1fadca[_0xc724('0x58')]):_0xc724('0x7c'));return respondWithRpcPromise(_0xc724('0x7d'),'rejectMessage',_0x326855);}return null;})['then'](function(_0x24518c){var _0x5dd5a7=_0xc724('0x6c')+_0x24518c[_0xc724('0x27')]['ContactId'];return db[_0xc724('0x6e')][_0xc724('0x3f')](_0x5dd5a7,{'type':db['Sequelize'][_0xc724('0x70')][_0xc724('0x71')],'raw':!![]})[_0xc724('0x1f')](function(_0xb017cc){return _0xb017cc;});})['then'](function(_0x4faf94){if(_0x4faf94){_0x326855['message'][_0xc724('0x72')]=_0x4faf94[0x0];if(!_0x1fadca[_0xc724('0x58')][_0xc724('0x5f')])return;return db[_0xc724('0x7e')]['find']({'where':{'id':_0x1fadca['body']['UserId'],'role':_0xc724('0x73')},'attributes':['id',_0xc724('0x39'),'fullname',_0xc724('0x7f'),'internal'],'raw':!![]});}return null;})[_0xc724('0x1f')](function(_0xc36bcb){if(!_0xc36bcb)return null;_0x326855[_0xc724('0x27')][_0xc724('0x73')]=_0xc36bcb;return _0x326855;})[_0xc724('0x1f')](function(_0x3bae6c){if(_0x3bae6c){_0x3bae6c['message'][_0xc724('0x77')]=util[_0xc724('0x5d')]('SIP/%s',_0x1fadca[_0xc724('0x68')]['name']);_0x3bae6c[_0xc724('0x27')]['channel']=_0x326855[_0xc724('0x78')];_0x3bae6c[_0xc724('0x27')]['event']=_0xc724('0x7a');respondWithRpcPromise('EventManager',_0xc724('0x79'),{'event':_0xc724('0x80'),'message':_0x3bae6c[_0xc724('0x27')]},client9002);return _0x326855;}return null;})[_0xc724('0x1f')](respondWithResult(_0x263f8b,null))[_0xc724('0x29')](handleError(_0x263f8b,null));};exports[_0xc724('0x2c')]=function(_0x3eba1c,_0x2b58d7,_0x54f0e1){if(_0x3eba1c['body']['id']){delete _0x3eba1c[_0xc724('0x58')]['id'];}var _0x103338;return db[_0xc724('0x3c')][_0xc724('0x56')]({'where':{'id':_0x3eba1c['params']['id']}})[_0xc724('0x1f')](handleEntityNotFound(_0x2b58d7,null))[_0xc724('0x1f')](function(_0x1db93c){if(_0x1db93c){_0x103338=_0x1db93c;return db['SmsAccount'][_0xc724('0x56')]({'where':{'id':_0x1db93c[_0xc724('0x81')]}});}})[_0xc724('0x1f')](handleEntityNotFound(_0x2b58d7,null))['then'](function(_0x6ec567){if(_0x6ec567){logger[_0xc724('0x21')](_0xc724('0x22'),_0xc724('0x2c'),'received\x20delivery\x20report\x20from',_0x6ec567[_0xc724('0x82')],util[_0xc724('0x83')](_0x3eba1c['body'],{'showHidden':![],'depth':null}));switch(_0x6ec567[_0xc724('0x82')]){case _0xc724('0x84'):if(_0x3eba1c[_0xc724('0x58')][_0xc724('0x85')]&&_0x3eba1c[_0xc724('0x58')][_0xc724('0x85')]===_0x103338[_0xc724('0x86')]){return _0x103338[_0xc724('0x36')]({'read':!![]});}else{logger[_0xc724('0x24')](_0xc724('0x87'),_0xc724('0x2c'),'twilio',util[_0xc724('0x83')](_0x3eba1c['body'],{'showHidden':![],'depth':null}));}break;case _0xc724('0x88'):if(_0x3eba1c[_0xc724('0x58')]['MessageUUID']&&_0x3eba1c[_0xc724('0x58')][_0xc724('0x89')]===_0x103338[_0xc724('0x86')]&&_[_0xc724('0x8a')]([_0xc724('0x8b'),_0xc724('0x8c')],_0x3eba1c[_0xc724('0x58')][_0xc724('0x8d')])>=0x0){return _0x103338['update']({'read':!![]});}else{logger['error'](_0xc724('0x87'),'status',_0xc724('0x8e'),util[_0xc724('0x83')](_0x3eba1c['body'],{'showHidden':![],'depth':null}));}break;case _0xc724('0x8f'):var _0x41305d=_0x3eba1c[_0xc724('0x58')][_0xc724('0x90')][0x0];if(_0x41305d[_0xc724('0x2c')][_0xc724('0x91')]===_0xc724('0x92')){return _0x103338['update']({'read':!![]});}else{logger[_0xc724('0x24')](_0xc724('0x87'),_0xc724('0x2c'),'infobip',util[_0xc724('0x83')](_0x3eba1c[_0xc724('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x103338;}})[_0xc724('0x1f')](respondWithResult(_0x2b58d7,null))[_0xc724('0x29')](handleError(_0x2b58d7,null));};
\ No newline at end of file
index 250a456..aa38c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f78=['exports','events','../../mysqldb','setMaxListeners','remove','hasOwnProperty','hook'];(function(_0x1539ff,_0x13582d){var _0x440930=function(_0x253b57){while(--_0x253b57){_0x1539ff['push'](_0x1539ff['shift']());}};_0x440930(++_0x13582d);}(_0x5f78,0xb7));var _0x85f7=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0x5f78[_0x7148a3];return _0x52f31d;};'use strict';var EventEmitter=require(_0x85f7('0x0'));var SmsMessage=require(_0x85f7('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x85f7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x85f7('0x3')};function emitEvent(_0x231ff8){return function(_0x120401,_0xd7b8ea,_0x537651){SmsMessageEvents['emit'](_0x231ff8+':'+_0x120401['id'],_0x120401);SmsMessageEvents['emit'](_0x231ff8,_0x120401);_0x537651(null);};}for(var e in events){if(events[_0x85f7('0x4')](e)){var event=events[e];SmsMessage[_0x85f7('0x5')](e,emitEvent(event));}}module[_0x85f7('0x6')]=SmsMessageEvents;
\ No newline at end of file
+var _0xa62a=['SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x349b85,_0x582c5d){var _0x375bbe=function(_0x23258c){while(--_0x23258c){_0x349b85['push'](_0x349b85['shift']());}};_0x375bbe(++_0x582c5d);}(_0xa62a,0xda));var _0xaa62=function(_0x345e4c,_0x3e73ba){_0x345e4c=_0x345e4c-0x0;var _0x40c41c=_0xa62a[_0x345e4c];return _0x40c41c;};'use strict';var EventEmitter=require(_0xaa62('0x0'));var SmsMessage=require(_0xaa62('0x1'))['db'][_0xaa62('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xaa62('0x3')](0x0);var events={'afterCreate':_0xaa62('0x4'),'afterUpdate':_0xaa62('0x5'),'afterDestroy':_0xaa62('0x6')};function emitEvent(_0x1c4f3e){return function(_0x26f1bd,_0x20a578,_0x2bdf2c){SmsMessageEvents[_0xaa62('0x7')](_0x1c4f3e+':'+_0x26f1bd['id'],_0x26f1bd);SmsMessageEvents[_0xaa62('0x7')](_0x1c4f3e,_0x26f1bd);_0x2bdf2c(null);};}for(var e in events){if(events[_0xaa62('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xaa62('0x9')]=SmsMessageEvents;
\ No newline at end of file
index 42afe0a..c00c1d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf9b=['direction','out','isNil','UserId','findOne','SmsInteractionId','then','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','update','afterCreate','inspect','connectel','clicksend','password','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','createHash','digest','GET','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase'];(function(_0xb39081,_0x53f065){var _0x503a3f=function(_0x3ea885){while(--_0x3ea885){_0xb39081['push'](_0xb39081['shift']());}};_0x503a3f(++_0x53f065);}(_0xaf9b,0x1d7));var _0xbaf9=function(_0x5ca7e2,_0x5e1f8e){_0x5ca7e2=_0x5ca7e2-0x0;var _0x27faa5=_0xaf9b[_0x5ca7e2];return _0x27faa5;};'use strict';var _=require(_0xbaf9('0x0'));var util=require('util');var logger=require(_0xbaf9('0x1'))('api');var moment=require(_0xbaf9('0x2'));var BPromise=require(_0xbaf9('0x3'));var rp=require(_0xbaf9('0x4'));var fs=require('fs');var path=require(_0xbaf9('0x5'));var rimraf=require('rimraf');var config=require(_0xbaf9('0x6'));var attributes=require(_0xbaf9('0x7'));module[_0xbaf9('0x8')]=function(_0x4b443e,_0x40b949){return _0x4b443e[_0xbaf9('0x9')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xbaf9('0xa'),'fields':[_0xbaf9('0xa')]},{'name':_0xbaf9('0xb'),'fields':[_0xbaf9('0xc')],'type':_0xbaf9('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1356fb,_0x3281cd,_0x34c5da){var _0x37a933=_0x4b443e[_0xbaf9('0xe')];var _0x30fa1f=_0x1356fb[_0xbaf9('0xf')]({'plain':!![]});if(_0x30fa1f['direction'][_0xbaf9('0x10')]()==='in'||_0x30fa1f[_0xbaf9('0x11')][_0xbaf9('0x10')]()===_0xbaf9('0x12')&&!_0x30fa1f['secret']&&!_[_0xbaf9('0x13')](_0x30fa1f[_0xbaf9('0x14')])){_0x37a933['SmsInteraction'][_0xbaf9('0x15')]({'where':{'id':_0x30fa1f[_0xbaf9('0x16')]}})[_0xbaf9('0x17')](function(_0x488d4a){if(_0x488d4a){_0x488d4a['update']({'lastMsgAt':_0x30fa1f[_0xbaf9('0x18')],'lastMsgDirection':_0x30fa1f['direction'][_0xbaf9('0x10')]()});}})[_0xbaf9('0x19')](function(_0x2cd568){console[_0xbaf9('0x1a')](_0x2cd568);});}if(_0x30fa1f['direction']==='out'&&!_0x30fa1f[_0xbaf9('0x1b')]){var _0x3e3d4c;_0x37a933[_0xbaf9('0x1c')][_0xbaf9('0x1d')]({'where':{'id':_0x30fa1f[_0xbaf9('0x1e')]},'raw':!![]})[_0xbaf9('0x17')](function(_0x1a1d1b){_0x3e3d4c=_0x1a1d1b;if(_0x3e3d4c&&_0x3e3d4c['type']){switch(_0x3e3d4c[_0xbaf9('0x1f')]){case _0xbaf9('0x20'):var _0x16f0e3=require('twilio');if(_0x3e3d4c[_0xbaf9('0x21')]&&_0x3e3d4c[_0xbaf9('0x22')]&&_0x3e3d4c[_0xbaf9('0x23')]){var _0x4dece7=new _0x16f0e3(_0x3e3d4c[_0xbaf9('0x21')],_0x3e3d4c[_0xbaf9('0x22')]);_0x4dece7[_0xbaf9('0x24')]['create']({'body':_0x30fa1f[_0xbaf9('0xc')],'to':_0x30fa1f[_0xbaf9('0x23')],'from':_0x3e3d4c['phone'],'statusCallback':_0x3e3d4c[_0xbaf9('0x25')]+_0xbaf9('0x26')+_0x30fa1f['id']+_0xbaf9('0x27')+_0x3e3d4c[_0xbaf9('0x28')]})['then'](function(_0x225334){if(_0x225334[_0xbaf9('0x29')]){return _0x1356fb['update']({'messageId':_0x225334[_0xbaf9('0x29')]});}})[_0xbaf9('0x19')](function(_0x135d46){logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),'afterCreate',_0xbaf9('0x20'),util['inspect'](_0x135d46,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),'afterCreate','twilio',_0xbaf9('0x2b'));}break;case _0xbaf9('0x2c'):var _0x5a3fd1=_0xbaf9('0x2d');if(_0x3e3d4c[_0xbaf9('0x2e')]&&_0x3e3d4c['password']){var _0x11eeb5={'recipient':[_0x30fa1f[_0xbaf9('0x23')]],'message':_0x30fa1f['body'],'message_type':_0x3e3d4c[_0xbaf9('0x2f')]};if(_0x3e3d4c['smsMethod']&&_0x3e3d4c['smsMethod']!=='SI'){_0x11eeb5[_0xbaf9('0x30')]=_0x3e3d4c[_0xbaf9('0x23')];}var _0x4d8460={'url':_0x5a3fd1+_0xbaf9('0x31')+_0x3e3d4c[_0xbaf9('0x2e')]+_0xbaf9('0x32')+_0x3e3d4c['password'],'method':'GET'};rp(_0x4d8460)[_0xbaf9('0x17')](function(_0x5cfe2c){var _0x1e1ccb=_0x5cfe2c[_0xbaf9('0x33')](';');var _0x37d809={'user_key':_0x1e1ccb[0x0],'session_key':_0x1e1ccb[0x1]};_0x4d8460={'url':_0x5a3fd1+_0xbaf9('0x34'),'method':_0xbaf9('0x35'),'headers':{'user_key':_0x37d809[_0xbaf9('0x36')],'Session_key':_0x37d809[_0xbaf9('0x37')]},'json':!![],'body':_0x11eeb5};return rp(_0x4d8460);})[_0xbaf9('0x17')](function(_0x4f6153){if(_0x4f6153[_0xbaf9('0x38')]>=0x1){var _0x347039={'messageId':_0x4f6153[_0xbaf9('0x39')]};if(_0x3e3d4c[_0xbaf9('0x2f')]!=='GP'||!_0x3e3d4c[_0xbaf9('0x3a')]){_0x347039[_0xbaf9('0x3b')]=!![];}return _0x1356fb[_0xbaf9('0x3c')](_0x347039);}else{return logger['error'](_0xbaf9('0x2a'),_0xbaf9('0x3d'),'skebby',util['inspect'](_0x4f6153,{'showHidden':![],'depth':null}));}})['catch'](function(_0x25719e){return logger['error'](_0xbaf9('0x2a'),'afterCreate',_0xbaf9('0x2c'),util[_0xbaf9('0x3e')](_0x25719e,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbaf9('0x3d'),'skebby','Missing\x20parameters:\x20username,\x20password');}break;case _0xbaf9('0x3f'):if(_0x3e3d4c[_0xbaf9('0x22')]){var _0x473a6f={'recipient':_0x30fa1f[_0xbaf9('0x23')],'message':_0x30fa1f['body'],'sender':_0x3e3d4c['senderString']||_0x3e3d4c[_0xbaf9('0x23')],'authorization':_0x3e3d4c['authToken']};var _0x3281cd={'method':_0xbaf9('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x473a6f,'json':!![]};rp(_0x3281cd)['then'](function(_0x581bf5){var _0x4eb9c5={'messageId':_0x581bf5['requestid']};if(!_0x3e3d4c['deliveryReport']){_0x4eb9c5[_0xbaf9('0x3b')]=!![];}return _0x1356fb[_0xbaf9('0x3c')](_0x4eb9c5);})['catch'](function(_0x551da7){logger['error'](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x3f'),util[_0xbaf9('0x3e')](_0x551da7,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x3f'),'Missing\x20parameters:\x20authToken');}break;case _0xbaf9('0x40'):if(_0x3e3d4c[_0xbaf9('0x2e')]&&_0x3e3d4c[_0xbaf9('0x41')]){var _0x473a6f={'messages':[{'source':_0xbaf9('0x42'),'to':_0x30fa1f['phone'],'body':_0x30fa1f['body'],'from':_0x3e3d4c[_0xbaf9('0x43')]||_0x3e3d4c[_0xbaf9('0x23')]}]};var _0x4a674f=util[_0xbaf9('0x44')](_0xbaf9('0x45'),_0x3e3d4c['username'],_0x3e3d4c[_0xbaf9('0x41')]);var _0x3281cd={'method':_0xbaf9('0x35'),'uri':_0xbaf9('0x46'),'body':_0x473a6f,'headers':{'Authorization':util['format'](_0xbaf9('0x47'),new Buffer(_0x4a674f)['toString'](_0xbaf9('0x48')))},'json':!![]};rp(_0x3281cd)['then'](function(_0x433bce){if(_0x433bce[_0xbaf9('0x49')]>=0xc8&&_0x433bce['http_code']<=0xce){if(_0x433bce['data']&&_0x433bce[_0xbaf9('0x4a')][_0xbaf9('0x4b')]>0x0){var _0x5ee43f=_[_0xbaf9('0x4c')](_0x433bce[_0xbaf9('0x4a')][_0xbaf9('0x24')]);var _0x161d0c={'messageId':_0x5ee43f[_0xbaf9('0x4d')]};if(!_0x3e3d4c['deliveryReport']){_0x161d0c[_0xbaf9('0x3b')]=!![];}return _0x1356fb[_0xbaf9('0x3c')](_0x161d0c);}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),'clickSend',util[_0xbaf9('0x3e')](_0x433bce,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x4e'),util['inspect'](_0x433bce,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2c89f1){logger['error'](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x4e'),util[_0xbaf9('0x3e')](_0x2c89f1,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x4e'),_0xbaf9('0x4f'));}break;case _0xbaf9('0x50'):if(_0x3e3d4c[_0xbaf9('0x51')]&&_0x3e3d4c[_0xbaf9('0x22')]){var _0x473a6f={'dst':_0x30fa1f[_0xbaf9('0x23')],'text':_0x30fa1f[_0xbaf9('0xc')],'src':_0x3e3d4c[_0xbaf9('0x43')]||_0x3e3d4c[_0xbaf9('0x23')],'url':_0x3e3d4c[_0xbaf9('0x25')]+_0xbaf9('0x26')+_0x30fa1f['id']+'/status?token='+_0x3e3d4c[_0xbaf9('0x28')]};var _0x4a674f=util[_0xbaf9('0x44')]('%s:%s',_0x3e3d4c['authId'],_0x3e3d4c[_0xbaf9('0x22')]);var _0x3281cd={'method':_0xbaf9('0x35'),'uri':util[_0xbaf9('0x44')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3e3d4c['authId']),'body':_0x473a6f,'headers':{'Authorization':util[_0xbaf9('0x44')](_0xbaf9('0x47'),new Buffer(_0x4a674f)[_0xbaf9('0x52')](_0xbaf9('0x48')))},'json':!![]};rp(_0x3281cd)['then'](function(_0x29052d){var _0xe04fd0={'messageId':_0x29052d[_0xbaf9('0x53')][0x0]};return _0x1356fb['update'](_0xe04fd0);})[_0xbaf9('0x19')](function(_0xe72140){logger[_0xbaf9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbaf9('0x3d'),_0xbaf9('0x50'),util[_0xbaf9('0x3e')](_0xe72140,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),'plivo',_0xbaf9('0x54'));}break;case'infobip':if(_0x3e3d4c[_0xbaf9('0x2e')]&&_0x3e3d4c[_0xbaf9('0x41')]){if(_0x3e3d4c[_0xbaf9('0x55')]){var _0x35c69b={'method':'POST','uri':_0x3e3d4c[_0xbaf9('0x55')]+_0xbaf9('0x56'),'body':{'username':_0x3e3d4c[_0xbaf9('0x2e')],'password':_0x3e3d4c['password']},'json':!![]};return rp(_0x35c69b)[_0xbaf9('0x17')](function(_0x2d3658){var _0x2e72c2={'method':'POST','uri':_0x3e3d4c[_0xbaf9('0x55')]+_0xbaf9('0x57'),'body':{'messages':[{'from':_0x3e3d4c[_0xbaf9('0x23')],'destinations':[{'to':_0x30fa1f[_0xbaf9('0x23')]}],'text':_0x30fa1f['body'],'notifyUrl':_0x3e3d4c[_0xbaf9('0x25')]+_0xbaf9('0x26')+_0x30fa1f['id']+_0xbaf9('0x27')+_0x3e3d4c[_0xbaf9('0x28')],'notifyContentType':_0xbaf9('0x58'),'callbackData':_0x3e3d4c[_0xbaf9('0x23')]+';'+_0x30fa1f['body']}]},'headers':{'Authorization':'IBSSO\x20'+_0x2d3658[_0xbaf9('0x28')]},'json':!![]};return rp(_0x2e72c2)[_0xbaf9('0x17')](function(_0x54a50c){if(_0x54a50c[_0xbaf9('0x24')]){var _0x5e0b5a={'messageId':_0x54a50c[_0xbaf9('0x24')][0x0][_0xbaf9('0xa')]};if(!_0x3e3d4c[_0xbaf9('0x3a')]){_0x5e0b5a[_0xbaf9('0x3b')]=!![];}return _0x1356fb[_0xbaf9('0x3c')](_0x5e0b5a);}else{return logger[_0xbaf9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbaf9('0x3d'),_0xbaf9('0x59'),util[_0xbaf9('0x3e')](_0x54a50c,{'showHidden':![],'depth':null}));}});})[_0xbaf9('0x19')](function(_0x3186fd){return logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),'infobip',util[_0xbaf9('0x3e')](_0x3186fd,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x59'),_0xbaf9('0x5a'));}}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x59'),_0xbaf9('0x4f'));}break;case'csc':var _0x37719c=require(_0xbaf9('0x5b'));if(_0x3e3d4c[_0xbaf9('0x5c')]){var _0x4e33ce={};_0x4e33ce[_0xbaf9('0x5d')]=_0x3e3d4c[_0xbaf9('0x2e')];_0x4e33ce[_0xbaf9('0x23')]=_0x30fa1f[_0xbaf9('0x23')];_0x4e33ce['sender']=_0x3e3d4c[_0xbaf9('0x23')];_0x4e33ce[_0xbaf9('0x5e')]=_0x30fa1f['body'];_0x4e33ce[_0xbaf9('0x5f')]=+new Date();var _0x8af71='';var _0x1a135b='';var _0x3724d9=Object[_0xbaf9('0x60')](_0x4e33ce);_0x3724d9[_0xbaf9('0x61')]();for(var _0x764854=0x0;_0x764854<_0x3724d9['length'];_0x764854++){if(_0x8af71!=''){_0x8af71+='&';}_0x8af71+=_0x3724d9[_0x764854]+'='+encodeURIComponent(_0x4e33ce[_0x3724d9[_0x764854]]);_0x1a135b+=_0x4e33ce[_0x3724d9[_0x764854]];}_0x1a135b+=_0x3e3d4c[_0xbaf9('0x5c')];_0x1a135b=_0x37719c[_0xbaf9('0x62')]('md5')[_0xbaf9('0x3c')](_0x1a135b)[_0xbaf9('0x63')]('hex');if(_0x8af71!==''){_0x8af71+='&';}_0x8af71+='signature='+_0x1a135b;var _0x4d8460={'method':_0xbaf9('0x64'),'uri':_0x3e3d4c[_0xbaf9('0x55')]+_0xbaf9('0x65')+_0x8af71,'json':!![]};return rp(_0x4d8460)[_0xbaf9('0x17')](function(_0x453dc1){var _0x5b859b=Object['keys'](_0x453dc1);if(_0x453dc1[_0x5b859b[0x0]]['error']&&parseInt(_0x453dc1[_0x5b859b[0x0]][_0xbaf9('0x1a')])===0x0){var _0x5be939={'messageId':_0x453dc1[_0x5b859b[0x0]]['id_sms']};if(!_0x3e3d4c[_0xbaf9('0x3a')]){_0x5be939[_0xbaf9('0x3b')]=!![];}return _0x1356fb['update'](_0x5be939);}else{return logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x66'),util[_0xbaf9('0x3e')](_0x453dc1[_0xbaf9('0x1a')],{'showHidden':![],'depth':null}));}})[_0xbaf9('0x19')](function(_0x3e2f6e){return logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),'afterCreate',_0xbaf9('0x66'),util[_0xbaf9('0x3e')](_0x3e2f6e,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),'csc',_0xbaf9('0x67'));}break;case _0xbaf9('0x68'):if(_0x3e3d4c[_0xbaf9('0x5c')]){var _0x114abd={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3e3d4c[_0xbaf9('0x5c')]},'body':{'content':_0x30fa1f[_0xbaf9('0xc')],'to':[_0x30fa1f[_0xbaf9('0x23')]],'from':_0x3e3d4c[_0xbaf9('0x23')],'binary':![],'clientMessageId':_0xbaf9('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0x114abd)[_0xbaf9('0x17')](function(_0x34109b){if(!_0x34109b['error']){var _0x34e0cf={'messageId':_0x34109b[_0xbaf9('0x24')][0x0][_0xbaf9('0x6a')]};if(!_0x3e3d4c[_0xbaf9('0x3a')]){_0x34e0cf[_0xbaf9('0x3b')]=!![];}return _0x1356fb[_0xbaf9('0x3c')](_0x34e0cf);}else{return logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x68'),util[_0xbaf9('0x3e')](_0x34109b['error'],{'showHidden':![],'depth':null}));}})[_0xbaf9('0x19')](function(_0x47893d){return logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),'clickatell',util[_0xbaf9('0x3e')](_0x47893d,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x68'),_0xbaf9('0x67'));}break;case'bandwidth':if(_0x3e3d4c[_0xbaf9('0x2e')]&&_0x3e3d4c[_0xbaf9('0x41')]){var _0x4a674f=util[_0xbaf9('0x44')](_0xbaf9('0x45'),_0x3e3d4c['username'],_0x3e3d4c['password']);var _0x3281cd={'method':_0xbaf9('0x35'),'uri':_0xbaf9('0x6b')+_0x3e3d4c[_0xbaf9('0x6c')]+_0xbaf9('0x6d'),'body':{'to':[_0x30fa1f[_0xbaf9('0x23')]],'text':_0x30fa1f[_0xbaf9('0xc')],'from':_0x3e3d4c[_0xbaf9('0x23')],'applicationId':_0x3e3d4c['applicationId']},'headers':{'Authorization':util[_0xbaf9('0x44')]('Basic\x20%s',new Buffer(_0x4a674f)[_0xbaf9('0x52')](_0xbaf9('0x48')))},'json':!![]};rp(_0x3281cd)['then'](function(_0x2a2853){if(_0x2a2853['id']){var _0x26623b={'messageId':_0x2a2853['id']};return _0x1356fb[_0xbaf9('0x3c')](_0x26623b);}else{logger[_0xbaf9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbaf9('0x3d'),_0xbaf9('0x6e'),util[_0xbaf9('0x3e')](_0x2a2853,{'showHidden':![],'depth':null}));}})[_0xbaf9('0x19')](function(_0xfd13a9){logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),'afterCreate',_0xbaf9('0x6e'),util['inspect'](_0xfd13a9,{'showHidden':![],'depth':null}));});}else{logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x6e'),_0xbaf9('0x4f'));}break;case'intelepeer':if(_0x3e3d4c[_0xbaf9('0x5c')]){var _0x50a2d6={};var _0x4d8460={'method':_0xbaf9('0x35'),'uri':_0xbaf9('0x6f'),'headers':{'Authorization':_0xbaf9('0x70')+_0x3e3d4c[_0xbaf9('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x3e3d4c['phone'],'to':_0x30fa1f[_0xbaf9('0x23')],'text':_0x30fa1f['body']},'json':!![]};return rp(_0x4d8460)[_0xbaf9('0x17')](function(_0x4b64dc){if(_0x4b64dc[_0xbaf9('0x71')]==0xca){_0x50a2d6[_0xbaf9('0x72')]=_0x4b64dc;var _0xa954ba={'method':'POST','uri':_0xbaf9('0x73'),'headers':{'Authorization':_0xbaf9('0x70')+_0x3e3d4c[_0xbaf9('0x5c')],'Content-Type':_0xbaf9('0x58')},'body':{'refid':_0x50a2d6['message']['refid']},'json':!![]};return rp(_0xa954ba)[_0xbaf9('0x17')](function(_0x13a7e7){_0x50a2d6[_0xbaf9('0x74')]=_0x13a7e7;var _0x276867={'messageId':_0x50a2d6[_0xbaf9('0x72')][_0xbaf9('0x75')],'read':!![]};return _0x1356fb[_0xbaf9('0x3c')](_0x276867);});}else{return logger[_0xbaf9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbaf9('0x3d'),_0xbaf9('0x76'),util[_0xbaf9('0x3e')](_0x4b64dc,{'showHidden':![],'depth':null}));}})[_0xbaf9('0x19')](function(_0x550f3d){return logger[_0xbaf9('0x1a')](_0xbaf9('0x2a'),_0xbaf9('0x3d'),_0xbaf9('0x76'),util[_0xbaf9('0x3e')](_0x550f3d,{'showHidden':![],'depth':null}));});}else{return logger[_0xbaf9('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbaf9('0x3d'),_0xbaf9('0x76'),'Token\x20not\x20received');}break;}}})[_0xbaf9('0x77')](function(){_0x34c5da();});}else{_0x34c5da();}}},'charset':_0xbaf9('0x78'),'collate':_0xbaf9('0x79')});};
\ No newline at end of file
+var _0xee5b=['length','createHash','md5','digest','signature=','GET','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','SmsInteraction','findOne','SmsInteractionId','update','catch','error','secret','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','password','sms','POST','user_key','total_sent','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','requestid','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','messages','message_id','clickSend','authId','senderString','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','message_uuid','plivo','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort'];(function(_0x5b175e,_0xfeb3f1){var _0x2f65c5=function(_0x1138f8){while(--_0x1138f8){_0x5b175e['push'](_0x5b175e['shift']());}};_0x2f65c5(++_0xfeb3f1);}(_0xee5b,0x1f4));var _0xbee5=function(_0x375852,_0x12aac7){_0x375852=_0x375852-0x0;var _0x4f8781=_0xee5b[_0x375852];return _0x4f8781;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xbee5('0x9')],'type':_0xbee5('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x45c2c7,_0x20f717,_0x4a15bf){var _0x143bd6=_0x2c0bde[_0xbee5('0xb')];var _0x9b3d3b=_0x45c2c7[_0xbee5('0xc')]({'plain':!![]});if(_0x9b3d3b[_0xbee5('0xd')][_0xbee5('0xe')]()==='in'||_0x9b3d3b[_0xbee5('0xd')][_0xbee5('0xe')]()===_0xbee5('0xf')&&!_0x9b3d3b['secret']&&!_[_0xbee5('0x10')](_0x9b3d3b['UserId'])){_0x143bd6[_0xbee5('0x11')][_0xbee5('0x12')]({'where':{'id':_0x9b3d3b[_0xbee5('0x13')]}})['then'](function(_0x5092f2){if(_0x5092f2){_0x5092f2[_0xbee5('0x14')]({'lastMsgAt':_0x9b3d3b['createdAt'],'lastMsgDirection':_0x9b3d3b[_0xbee5('0xd')]['toLowerCase']()});}})[_0xbee5('0x15')](function(_0x141878){console[_0xbee5('0x16')](_0x141878);});}if(_0x9b3d3b['direction']===_0xbee5('0xf')&&!_0x9b3d3b[_0xbee5('0x17')]){var _0x5a0ae5;_0x143bd6[_0xbee5('0x18')][_0xbee5('0x19')]({'where':{'id':_0x9b3d3b[_0xbee5('0x1a')]},'raw':!![]})[_0xbee5('0x1b')](function(_0x35eb5c){_0x5a0ae5=_0x35eb5c;if(_0x5a0ae5&&_0x5a0ae5[_0xbee5('0x1c')]){switch(_0x5a0ae5[_0xbee5('0x1c')]){case _0xbee5('0x1d'):var _0x20cf52=require(_0xbee5('0x1d'));if(_0x5a0ae5[_0xbee5('0x1e')]&&_0x5a0ae5[_0xbee5('0x1f')]&&_0x5a0ae5[_0xbee5('0x20')]){var _0x40a06=new _0x20cf52(_0x5a0ae5[_0xbee5('0x1e')],_0x5a0ae5['authToken']);_0x40a06['messages'][_0xbee5('0x21')]({'body':_0x9b3d3b['body'],'to':_0x9b3d3b[_0xbee5('0x20')],'from':_0x5a0ae5[_0xbee5('0x20')],'statusCallback':_0x5a0ae5[_0xbee5('0x22')]+_0xbee5('0x23')+_0x9b3d3b['id']+_0xbee5('0x24')+_0x5a0ae5[_0xbee5('0x25')]})[_0xbee5('0x1b')](function(_0x3cfa8d){if(_0x3cfa8d[_0xbee5('0x26')]){return _0x45c2c7['update']({'messageId':_0x3cfa8d['sid']});}})['catch'](function(_0x519473){logger['error'](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x1d'),util[_0xbee5('0x29')](_0x519473,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),'twilio',_0xbee5('0x2a'));}break;case _0xbee5('0x2b'):var _0x179d14=_0xbee5('0x2c');if(_0x5a0ae5[_0xbee5('0x2d')]&&_0x5a0ae5['password']){var _0x21b993={'recipient':[_0x9b3d3b[_0xbee5('0x20')]],'message':_0x9b3d3b[_0xbee5('0x9')],'message_type':_0x5a0ae5[_0xbee5('0x2e')]};if(_0x5a0ae5[_0xbee5('0x2e')]&&_0x5a0ae5[_0xbee5('0x2e')]!=='SI'){_0x21b993[_0xbee5('0x2f')]=_0x5a0ae5[_0xbee5('0x20')];}var _0x2861da={'url':_0x179d14+'login?username='+_0x5a0ae5[_0xbee5('0x2d')]+'&password='+_0x5a0ae5[_0xbee5('0x30')],'method':'GET'};rp(_0x2861da)[_0xbee5('0x1b')](function(_0x52dad9){var _0x35609d=_0x52dad9['split'](';');var _0x3220bf={'user_key':_0x35609d[0x0],'session_key':_0x35609d[0x1]};_0x2861da={'url':_0x179d14+_0xbee5('0x31'),'method':_0xbee5('0x32'),'headers':{'user_key':_0x3220bf[_0xbee5('0x33')],'Session_key':_0x3220bf['session_key']},'json':!![],'body':_0x21b993};return rp(_0x2861da);})[_0xbee5('0x1b')](function(_0x17aa8d){if(_0x17aa8d[_0xbee5('0x34')]>=0x1){var _0x1c78cc={'messageId':_0x17aa8d['internal_order_id']};if(_0x5a0ae5[_0xbee5('0x2e')]!=='GP'||!_0x5a0ae5[_0xbee5('0x35')]){_0x1c78cc[_0xbee5('0x36')]=!![];}return _0x45c2c7[_0xbee5('0x14')](_0x1c78cc);}else{return logger['error'](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x2b'),util[_0xbee5('0x29')](_0x17aa8d,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3c8a87){return logger['error'](_0xbee5('0x27'),'afterCreate','skebby',util['inspect'](_0x3c8a87,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x2b'),_0xbee5('0x37'));}break;case _0xbee5('0x38'):if(_0x5a0ae5[_0xbee5('0x1f')]){var _0x702ce8={'recipient':_0x9b3d3b['phone'],'message':_0x9b3d3b[_0xbee5('0x9')],'sender':_0x5a0ae5['senderString']||_0x5a0ae5[_0xbee5('0x20')],'authorization':_0x5a0ae5[_0xbee5('0x1f')]};var _0x20f717={'method':_0xbee5('0x32'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x702ce8,'json':!![]};rp(_0x20f717)[_0xbee5('0x1b')](function(_0x4eb1f8){var _0x565e9f={'messageId':_0x4eb1f8[_0xbee5('0x39')]};if(!_0x5a0ae5[_0xbee5('0x35')]){_0x565e9f[_0xbee5('0x36')]=!![];}return _0x45c2c7[_0xbee5('0x14')](_0x565e9f);})['catch'](function(_0xf3dd5){logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x38'),util[_0xbee5('0x29')](_0xf3dd5,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x38'),'Missing\x20parameters:\x20authToken');}break;case _0xbee5('0x3a'):if(_0x5a0ae5[_0xbee5('0x2d')]&&_0x5a0ae5['password']){var _0x702ce8={'messages':[{'source':_0xbee5('0x3b'),'to':_0x9b3d3b[_0xbee5('0x20')],'body':_0x9b3d3b[_0xbee5('0x9')],'from':_0x5a0ae5['senderString']||_0x5a0ae5['phone']}]};var _0x5985b4=util[_0xbee5('0x3c')](_0xbee5('0x3d'),_0x5a0ae5[_0xbee5('0x2d')],_0x5a0ae5[_0xbee5('0x30')]);var _0x20f717={'method':_0xbee5('0x32'),'uri':_0xbee5('0x3e'),'body':_0x702ce8,'headers':{'Authorization':util[_0xbee5('0x3c')](_0xbee5('0x3f'),new Buffer(_0x5985b4)['toString']('base64'))},'json':!![]};rp(_0x20f717)[_0xbee5('0x1b')](function(_0x51726a){if(_0x51726a[_0xbee5('0x40')]>=0xc8&&_0x51726a[_0xbee5('0x40')]<=0xce){if(_0x51726a['data']&&_0x51726a[_0xbee5('0x41')][_0xbee5('0x42')]>0x0){var _0x535843=_['head'](_0x51726a[_0xbee5('0x41')][_0xbee5('0x43')]);var _0x496872={'messageId':_0x535843[_0xbee5('0x44')]};if(!_0x5a0ae5[_0xbee5('0x35')]){_0x496872['read']=!![];}return _0x45c2c7[_0xbee5('0x14')](_0x496872);}else{logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x45'),util[_0xbee5('0x29')](_0x51726a,{'showHidden':![],'depth':null}));}}else{logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x45'),util[_0xbee5('0x29')](_0x51726a,{'showHidden':![],'depth':null}));}})[_0xbee5('0x15')](function(_0x5ba5f1){logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),'clickSend',util[_0xbee5('0x29')](_0x5ba5f1,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',_0xbee5('0x37'));}break;case'plivo':if(_0x5a0ae5[_0xbee5('0x46')]&&_0x5a0ae5[_0xbee5('0x1f')]){var _0x702ce8={'dst':_0x9b3d3b[_0xbee5('0x20')],'text':_0x9b3d3b[_0xbee5('0x9')],'src':_0x5a0ae5[_0xbee5('0x47')]||_0x5a0ae5['phone'],'url':_0x5a0ae5[_0xbee5('0x22')]+_0xbee5('0x23')+_0x9b3d3b['id']+_0xbee5('0x24')+_0x5a0ae5[_0xbee5('0x25')]};var _0x5985b4=util[_0xbee5('0x3c')]('%s:%s',_0x5a0ae5[_0xbee5('0x46')],_0x5a0ae5[_0xbee5('0x1f')]);var _0x20f717={'method':_0xbee5('0x32'),'uri':util[_0xbee5('0x3c')](_0xbee5('0x48'),_0x5a0ae5[_0xbee5('0x46')]),'body':_0x702ce8,'headers':{'Authorization':util[_0xbee5('0x3c')](_0xbee5('0x3f'),new Buffer(_0x5985b4)[_0xbee5('0x49')](_0xbee5('0x4a')))},'json':!![]};rp(_0x20f717)[_0xbee5('0x1b')](function(_0xeebac7){var _0x359738={'messageId':_0xeebac7[_0xbee5('0x4b')][0x0]};return _0x45c2c7['update'](_0x359738);})[_0xbee5('0x15')](function(_0x1f47ec){logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x4c'),util[_0xbee5('0x29')](_0x1f47ec,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xbee5('0x27'),'afterCreate',_0xbee5('0x4c'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xbee5('0x4d'):if(_0x5a0ae5[_0xbee5('0x2d')]&&_0x5a0ae5[_0xbee5('0x30')]){if(_0x5a0ae5['baseUrl']){var _0x51bc42={'method':'POST','uri':_0x5a0ae5[_0xbee5('0x4e')]+_0xbee5('0x4f'),'body':{'username':_0x5a0ae5[_0xbee5('0x2d')],'password':_0x5a0ae5['password']},'json':!![]};return rp(_0x51bc42)[_0xbee5('0x1b')](function(_0x521543){var _0x21492a={'method':_0xbee5('0x32'),'uri':_0x5a0ae5[_0xbee5('0x4e')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5a0ae5[_0xbee5('0x20')],'destinations':[{'to':_0x9b3d3b[_0xbee5('0x20')]}],'text':_0x9b3d3b[_0xbee5('0x9')],'notifyUrl':_0x5a0ae5[_0xbee5('0x22')]+_0xbee5('0x23')+_0x9b3d3b['id']+_0xbee5('0x24')+_0x5a0ae5[_0xbee5('0x25')],'notifyContentType':_0xbee5('0x50'),'callbackData':_0x5a0ae5[_0xbee5('0x20')]+';'+_0x9b3d3b[_0xbee5('0x9')]}]},'headers':{'Authorization':_0xbee5('0x51')+_0x521543[_0xbee5('0x25')]},'json':!![]};return rp(_0x21492a)[_0xbee5('0x1b')](function(_0x317b5c){if(_0x317b5c[_0xbee5('0x43')]){var _0x143fd9={'messageId':_0x317b5c[_0xbee5('0x43')][0x0]['messageId']};if(!_0x5a0ae5[_0xbee5('0x35')]){_0x143fd9['read']=!![];}return _0x45c2c7['update'](_0x143fd9);}else{return logger[_0xbee5('0x16')](_0xbee5('0x27'),'afterCreate','infobip',util[_0xbee5('0x29')](_0x317b5c,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2fa95e){return logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x4d'),util[_0xbee5('0x29')](_0x2fa95e,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),'infobip',_0xbee5('0x52'));}}else{logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xbee5('0x53'):var _0x2b6d1a=require('crypto');if(_0x5a0ae5[_0xbee5('0x54')]){var _0x54f45e={};_0x54f45e[_0xbee5('0x55')]=_0x5a0ae5['username'];_0x54f45e[_0xbee5('0x20')]=_0x9b3d3b['phone'];_0x54f45e['sender']=_0x5a0ae5[_0xbee5('0x20')];_0x54f45e[_0xbee5('0x56')]=_0x9b3d3b[_0xbee5('0x9')];_0x54f45e[_0xbee5('0x57')]=+new Date();var _0x2ad0c6='';var _0x6c6df6='';var _0x4c6a0b=Object[_0xbee5('0x58')](_0x54f45e);_0x4c6a0b[_0xbee5('0x59')]();for(var _0x36586a=0x0;_0x36586a<_0x4c6a0b[_0xbee5('0x5a')];_0x36586a++){if(_0x2ad0c6!=''){_0x2ad0c6+='&';}_0x2ad0c6+=_0x4c6a0b[_0x36586a]+'='+encodeURIComponent(_0x54f45e[_0x4c6a0b[_0x36586a]]);_0x6c6df6+=_0x54f45e[_0x4c6a0b[_0x36586a]];}_0x6c6df6+=_0x5a0ae5[_0xbee5('0x54')];_0x6c6df6=_0x2b6d1a[_0xbee5('0x5b')](_0xbee5('0x5c'))[_0xbee5('0x14')](_0x6c6df6)[_0xbee5('0x5d')]('hex');if(_0x2ad0c6!==''){_0x2ad0c6+='&';}_0x2ad0c6+=_0xbee5('0x5e')+_0x6c6df6;var _0x2861da={'method':_0xbee5('0x5f'),'uri':_0x5a0ae5[_0xbee5('0x4e')]+'/external/get/send.php?'+_0x2ad0c6,'json':!![]};return rp(_0x2861da)[_0xbee5('0x1b')](function(_0x237431){var _0xbb4ff6=Object[_0xbee5('0x58')](_0x237431);if(_0x237431[_0xbb4ff6[0x0]][_0xbee5('0x16')]&&parseInt(_0x237431[_0xbb4ff6[0x0]][_0xbee5('0x16')])===0x0){var _0x2bf005={'messageId':_0x237431[_0xbb4ff6[0x0]][_0xbee5('0x60')]};if(!_0x5a0ae5[_0xbee5('0x35')]){_0x2bf005[_0xbee5('0x36')]=!![];}return _0x45c2c7[_0xbee5('0x14')](_0x2bf005);}else{return logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x53'),util['inspect'](_0x237431[_0xbee5('0x16')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x3913d5){return logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),'csc',util['inspect'](_0x3913d5,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',_0xbee5('0x61'));}break;case _0xbee5('0x62'):if(_0x5a0ae5[_0xbee5('0x54')]){var _0x38b7e6={'method':_0xbee5('0x32'),'uri':_0xbee5('0x63'),'headers':{'Authorization':_0x5a0ae5[_0xbee5('0x54')]},'body':{'content':_0x9b3d3b[_0xbee5('0x9')],'to':[_0x9b3d3b[_0xbee5('0x20')]],'from':_0x5a0ae5[_0xbee5('0x20')],'binary':![],'clientMessageId':_0xbee5('0x64'),'charset':_0xbee5('0x65')},'json':!![]};rp(_0x38b7e6)['then'](function(_0xc0bdc1){if(!_0xc0bdc1[_0xbee5('0x16')]){var _0x56cff5={'messageId':_0xc0bdc1['messages'][0x0][_0xbee5('0x66')]};if(!_0x5a0ae5[_0xbee5('0x35')]){_0x56cff5[_0xbee5('0x36')]=!![];}return _0x45c2c7['update'](_0x56cff5);}else{return logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),'clickatell',util['inspect'](_0xc0bdc1['error'],{'showHidden':![],'depth':null}));}})[_0xbee5('0x15')](function(_0x185219){return logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x62'),util[_0xbee5('0x29')](_0x185219,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbee5('0x62'),_0xbee5('0x61'));}break;case'bandwidth':if(_0x5a0ae5['username']&&_0x5a0ae5[_0xbee5('0x30')]){var _0x5985b4=util['format'](_0xbee5('0x3d'),_0x5a0ae5['username'],_0x5a0ae5[_0xbee5('0x30')]);var _0x20f717={'method':'POST','uri':_0xbee5('0x67')+_0x5a0ae5[_0xbee5('0x68')]+_0xbee5('0x69'),'body':{'to':[_0x9b3d3b[_0xbee5('0x20')]],'text':_0x9b3d3b[_0xbee5('0x9')],'from':_0x5a0ae5['phone'],'applicationId':_0x5a0ae5['applicationId']},'headers':{'Authorization':util[_0xbee5('0x3c')]('Basic\x20%s',new Buffer(_0x5985b4)[_0xbee5('0x49')]('base64'))},'json':!![]};rp(_0x20f717)[_0xbee5('0x1b')](function(_0x387032){if(_0x387032['id']){var _0x42d198={'messageId':_0x387032['id']};return _0x45c2c7[_0xbee5('0x14')](_0x42d198);}else{logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x6a'),util[_0xbee5('0x29')](_0x387032,{'showHidden':![],'depth':null}));}})[_0xbee5('0x15')](function(_0x1a07ac){logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x6a'),util[_0xbee5('0x29')](_0x1a07ac,{'showHidden':![],'depth':null}));});}else{logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x6a'),_0xbee5('0x37'));}break;case _0xbee5('0x6b'):if(_0x5a0ae5[_0xbee5('0x54')]){var _0x3433e6={};var _0x2861da={'method':_0xbee5('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xbee5('0x6c')+_0x5a0ae5[_0xbee5('0x54')],'Content-Type':_0xbee5('0x50')},'body':{'from':_0x5a0ae5[_0xbee5('0x20')],'to':_0x9b3d3b[_0xbee5('0x20')],'text':_0x9b3d3b[_0xbee5('0x9')]},'json':!![]};return rp(_0x2861da)[_0xbee5('0x1b')](function(_0xed8e44){if(_0xed8e44[_0xbee5('0x6d')]==0xca){_0x3433e6[_0xbee5('0x6e')]=_0xed8e44;var _0x3b0679={'method':'POST','uri':_0xbee5('0x6f'),'headers':{'Authorization':_0xbee5('0x6c')+_0x5a0ae5['apiKey'],'Content-Type':_0xbee5('0x50')},'body':{'refid':_0x3433e6[_0xbee5('0x6e')][_0xbee5('0x70')]},'json':!![]};return rp(_0x3b0679)['then'](function(_0x424bae){_0x3433e6[_0xbee5('0x71')]=_0x424bae;var _0x21c3df={'messageId':_0x3433e6[_0xbee5('0x6e')][_0xbee5('0x70')],'read':!![]};return _0x45c2c7[_0xbee5('0x14')](_0x21c3df);});}else{return logger[_0xbee5('0x16')](_0xbee5('0x27'),_0xbee5('0x28'),_0xbee5('0x6b'),util[_0xbee5('0x29')](_0xed8e44,{'showHidden':![],'depth':null}));}})[_0xbee5('0x15')](function(_0x50dbf5){return logger[_0xbee5('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xbee5('0x6b'),util[_0xbee5('0x29')](_0x50dbf5,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xbee5('0x28'),_0xbee5('0x6b'),_0xbee5('0x72'));}break;}}})[_0xbee5('0x73')](function(){_0x4a15bf();});}else{_0x4a15bf();}}},'charset':_0xbee5('0x74'),'collate':_0xbee5('0x75')});};
\ No newline at end of file
index 141731f..484c933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c15=['socket.io-emitter','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSmsMessage','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis'];(function(_0x4cd125,_0xf61237){var _0x33358a=function(_0x40ba76){while(--_0x40ba76){_0x4cd125['push'](_0x4cd125['shift']());}};_0x33358a(++_0xf61237);}(_0x4c15,0x103));var _0x54c1=function(_0x5c5381,_0x428f55){_0x5c5381=_0x5c5381-0x0;var _0x45f881=_0x4c15[_0x5c5381];return _0x45f881;};'use strict';var _=require(_0x54c1('0x0'));var util=require(_0x54c1('0x1'));var moment=require(_0x54c1('0x2'));var BPromise=require('bluebird');var rs=require(_0x54c1('0x3'));var fs=require('fs');var Redis=require(_0x54c1('0x4'));var db=require(_0x54c1('0x5'))['db'];var utils=require(_0x54c1('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x54c1('0x7'));var client=jayson[_0x54c1('0x8')][_0x54c1('0x9')]({'port':0x232a});config[_0x54c1('0xa')]=_['defaults'](config[_0x54c1('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x54c1('0xb'))(new Redis(config[_0x54c1('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2721db,_0x33a7dd,_0x27c4a2){return new BPromise(function(_0x25353f,_0x1ae69e){return client[_0x54c1('0xc')](_0x2721db,_0x27c4a2)[_0x54c1('0xd')](function(_0x32f326){logger['info'](_0x54c1('0xe'),_0x33a7dd,_0x54c1('0xf'));logger[_0x54c1('0x10')](_0x54c1('0x11'),_0x33a7dd,'request\x20sent',JSON[_0x54c1('0x12')](_0x32f326));if(_0x32f326[_0x54c1('0x13')]){if(_0x32f326['error'][_0x54c1('0x14')]===0x1f4){logger['error'](_0x54c1('0xe'),_0x33a7dd,_0x32f326['error']['message']);return _0x1ae69e(_0x32f326[_0x54c1('0x13')][_0x54c1('0x15')]);}logger[_0x54c1('0x13')](_0x54c1('0xe'),_0x33a7dd,_0x32f326['error']['message']);return _0x25353f(_0x32f326['error'][_0x54c1('0x15')]);}else{logger[_0x54c1('0x16')](_0x54c1('0xe'),_0x33a7dd,_0x54c1('0xf'));_0x25353f(_0x32f326['result'][_0x54c1('0x15')]);}})[_0x54c1('0x17')](function(_0x4b049a){logger['error'](_0x54c1('0xe'),_0x33a7dd,_0x4b049a);_0x1ae69e(_0x4b049a);});});}exports[_0x54c1('0x18')]=function(_0x1a1446){var _0x575f3c=this;return new Promise(function(_0x3e7700,_0x4849b6){return db['SmsMessage']['create'](_0x1a1446[_0x54c1('0x19')],{'raw':_0x1a1446[_0x54c1('0x1a')]?_0x1a1446[_0x54c1('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x7d81c9){logger[_0x54c1('0x16')]('CreateSmsMessage',_0x1a1446);logger[_0x54c1('0x10')](_0x54c1('0x18'),_0x1a1446,JSON[_0x54c1('0x12')](_0x7d81c9));_0x3e7700(_0x7d81c9);})[_0x54c1('0x17')](function(_0x25b834){logger[_0x54c1('0x13')]('CreateSmsMessage',_0x25b834[_0x54c1('0x15')],_0x1a1446);_0x4849b6(_0x575f3c[_0x54c1('0x13')](0x1f4,_0x25b834[_0x54c1('0x15')]));});});};
\ No newline at end of file
+var _0x5a46=['body','options','then','info','debug','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsMessage','SmsMessage','create'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x5a46,0x9b));var _0x65a4=function(_0x10995e,_0x5e3a08){_0x10995e=_0x10995e-0x0;var _0x3545e5=_0x5a46[_0x10995e];return _0x3545e5;};'use strict';var _=require(_0x65a4('0x0'));var util=require('util');var moment=require(_0x65a4('0x1'));var BPromise=require(_0x65a4('0x2'));var rs=require(_0x65a4('0x3'));var fs=require('fs');var Redis=require(_0x65a4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x65a4('0x5'));var config=require(_0x65a4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x65a4('0x7')]({'port':0x232a});config[_0x65a4('0x8')]=_[_0x65a4('0x9')](config[_0x65a4('0x8')],{'host':_0x65a4('0xa'),'port':0x18eb});var socket=require(_0x65a4('0xb'))(new Redis(config[_0x65a4('0x8')]));require(_0x65a4('0xc'))[_0x65a4('0xd')](socket);function respondWithRpcPromise(_0x3e4b87,_0x10bb07,_0x5f255b){return new BPromise(function(_0x2125b3,_0x314fcb){return client['request'](_0x3e4b87,_0x5f255b)['then'](function(_0x16b645){logger['info'](_0x65a4('0xe'),_0x10bb07,_0x65a4('0xf'));logger['debug'](_0x65a4('0x10'),_0x10bb07,_0x65a4('0xf'),JSON[_0x65a4('0x11')](_0x16b645));if(_0x16b645['error']){if(_0x16b645[_0x65a4('0x12')][_0x65a4('0x13')]===0x1f4){logger[_0x65a4('0x12')](_0x65a4('0xe'),_0x10bb07,_0x16b645[_0x65a4('0x12')][_0x65a4('0x14')]);return _0x314fcb(_0x16b645['error'][_0x65a4('0x14')]);}logger[_0x65a4('0x12')]('SmsMessage,\x20%s,\x20%s',_0x10bb07,_0x16b645['error'][_0x65a4('0x14')]);return _0x2125b3(_0x16b645[_0x65a4('0x12')][_0x65a4('0x14')]);}else{logger['info'](_0x65a4('0xe'),_0x10bb07,'request\x20sent');_0x2125b3(_0x16b645['result'][_0x65a4('0x14')]);}})[_0x65a4('0x15')](function(_0x1dcda4){logger[_0x65a4('0x12')](_0x65a4('0xe'),_0x10bb07,_0x1dcda4);_0x314fcb(_0x1dcda4);});});}exports[_0x65a4('0x16')]=function(_0x966dcd){var _0x43fc57=this;return new Promise(function(_0x1f66a5,_0x4b35d3){return db[_0x65a4('0x17')][_0x65a4('0x18')](_0x966dcd[_0x65a4('0x19')],{'raw':_0x966dcd[_0x65a4('0x1a')]?_0x966dcd[_0x65a4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x65a4('0x1b')](function(_0xa3933d){logger[_0x65a4('0x1c')](_0x65a4('0x16'),_0x966dcd);logger[_0x65a4('0x1d')]('CreateSmsMessage',_0x966dcd,JSON[_0x65a4('0x11')](_0xa3933d));_0x1f66a5(_0xa3933d);})[_0x65a4('0x15')](function(_0x16a236){logger[_0x65a4('0x12')](_0x65a4('0x16'),_0x16a236[_0x65a4('0x14')],_0x966dcd);_0x4b35d3(_0x43fc57[_0x65a4('0x12')](0x1f4,_0x16a236[_0x65a4('0x14')]));});});};
\ No newline at end of file
index 8e03f94..ec2fe00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x938b=['emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove','update'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x938b,0x1bd));var _0xb938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938b[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0xb938('0x0'));var events=['save',_0xb938('0x1'),_0xb938('0x2')];function createListener(_0x37ee5d,_0x424115){return function(_0x258634){_0x424115[_0xb938('0x3')](_0x37ee5d,_0x258634);};}function removeListener(_0xb687bc,_0xb2bdd){return function(){SmsMessageEvents[_0xb938('0x4')](_0xb687bc,_0xb2bdd);};}exports[_0xb938('0x5')]=function(_0x18e969){for(var _0x299afa=0x0,_0x1b8fb9=events[_0xb938('0x6')];_0x299afa<_0x1b8fb9;_0x299afa++){var _0x47a158=events[_0x299afa];var _0x41c411=createListener(_0xb938('0x7')+_0x47a158,_0x18e969);SmsMessageEvents['on'](_0x47a158,_0x41c411);}};
\ No newline at end of file
+var _0x3ecb=['update','emit','removeListener','length','smsMessage:','./smsMessage.events','save','remove'];(function(_0x3bc350,_0x239339){var _0x1a2e3d=function(_0x9ee0b6){while(--_0x9ee0b6){_0x3bc350['push'](_0x3bc350['shift']());}};_0x1a2e3d(++_0x239339);}(_0x3ecb,0x75));var _0xb3ec=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0x3ecb[_0x3662b4];return _0x50928c;};'use strict';var SmsMessageEvents=require(_0xb3ec('0x0'));var events=[_0xb3ec('0x1'),_0xb3ec('0x2'),_0xb3ec('0x3')];function createListener(_0x18d4f0,_0x2e037f){return function(_0x2127f3){_0x2e037f[_0xb3ec('0x4')](_0x18d4f0,_0x2127f3);};}function removeListener(_0x59b8a1,_0x49597f){return function(){SmsMessageEvents[_0xb3ec('0x5')](_0x59b8a1,_0x49597f);};}exports['register']=function(_0x3ead67){for(var _0x13c0a4=0x0,_0x188a0c=events[_0xb3ec('0x6')];_0x13c0a4<_0x188a0c;_0x13c0a4++){var _0x48b2fd=events[_0x13c0a4];var _0x329e8a=createListener(_0xb3ec('0x7')+_0x48b2fd,_0x3ead67);SmsMessageEvents['on'](_0x48b2fd,_0x329e8a);}};
\ No newline at end of file
index e4d5098..87152d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7560=['/:id/users','put','/:id','destroy','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','/:id/teams','getTeams','getAgents','post','create'];(function(_0x5ba95d,_0x55090b){var _0x14949b=function(_0x569a13){while(--_0x569a13){_0x5ba95d['push'](_0x5ba95d['shift']());}};_0x14949b(++_0x55090b);}(_0x7560,0x18c));var _0x0756=function(_0x5b7d6a,_0x63e6a2){_0x5b7d6a=_0x5b7d6a-0x0;var _0x992adf=_0x7560[_0x5b7d6a];return _0x992adf;};'use strict';var multer=require(_0x0756('0x0'));var util=require(_0x0756('0x1'));var path=require(_0x0756('0x2'));var timeout=require(_0x0756('0x3'));var express=require('express');var router=express[_0x0756('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0756('0x5'));var interaction=require(_0x0756('0x6'));var config=require(_0x0756('0x7'));var controller=require(_0x0756('0x8'));router[_0x0756('0x9')]('/',auth[_0x0756('0xa')](),controller[_0x0756('0xb')]);router[_0x0756('0x9')]('/describe',auth[_0x0756('0xa')](),controller[_0x0756('0xc')]);router[_0x0756('0x9')]('/:id',auth[_0x0756('0xa')](),controller[_0x0756('0xd')]);router['get'](_0x0756('0xe'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x0756('0xf'),auth[_0x0756('0xa')](),controller[_0x0756('0x10')]);router[_0x0756('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x0756('0x11')]);router[_0x0756('0x12')]('/',auth[_0x0756('0xa')](),controller[_0x0756('0x13')]);router['post']('/:id/teams',auth[_0x0756('0xa')](),controller['addTeams']);router[_0x0756('0x12')](_0x0756('0x14'),auth[_0x0756('0xa')](),controller['addAgents']);router[_0x0756('0x15')](_0x0756('0x16'),auth[_0x0756('0xa')](),controller['update']);router['delete'](_0x0756('0x16'),auth[_0x0756('0xa')](),controller[_0x0756('0x17')]);router[_0x0756('0x18')](_0x0756('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x0756('0x18')]('/:id/users',auth[_0x0756('0xa')](),controller['removeAgents']);module[_0x0756('0x19')]=router;
\ No newline at end of file
+var _0x69e5=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','addTeams','post','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x418ce8,_0x2d9def){var _0x4eabcd=function(_0xb27a9e){while(--_0xb27a9e){_0x418ce8['push'](_0x418ce8['shift']());}};_0x4eabcd(++_0x2d9def);}(_0x69e5,0x84));var _0x569e=function(_0x114984,_0x5c9593){_0x114984=_0x114984-0x0;var _0x44822b=_0x69e5[_0x114984];return _0x44822b;};'use strict';var multer=require(_0x569e('0x0'));var util=require(_0x569e('0x1'));var path=require(_0x569e('0x2'));var timeout=require(_0x569e('0x3'));var express=require(_0x569e('0x4'));var router=express[_0x569e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x569e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x569e('0x7'));router[_0x569e('0x8')]('/',auth[_0x569e('0x9')](),controller[_0x569e('0xa')]);router['get'](_0x569e('0xb'),auth[_0x569e('0x9')](),controller[_0x569e('0xc')]);router[_0x569e('0x8')](_0x569e('0xd'),auth[_0x569e('0x9')](),controller[_0x569e('0xe')]);router[_0x569e('0x8')](_0x569e('0xf'),auth[_0x569e('0x9')](),controller[_0x569e('0x10')]);router['get'](_0x569e('0x11'),auth[_0x569e('0x9')](),controller[_0x569e('0x12')]);router[_0x569e('0x8')](_0x569e('0x13'),auth[_0x569e('0x9')](),controller['getAgents']);router['post']('/',auth[_0x569e('0x9')](),controller[_0x569e('0x14')]);router['post']('/:id/teams',auth[_0x569e('0x9')](),controller[_0x569e('0x15')]);router[_0x569e('0x16')]('/:id/users',auth[_0x569e('0x9')](),controller[_0x569e('0x17')]);router[_0x569e('0x18')](_0x569e('0xd'),auth[_0x569e('0x9')](),controller[_0x569e('0x19')]);router[_0x569e('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x569e('0x1a')](_0x569e('0x11'),auth[_0x569e('0x9')](),controller[_0x569e('0x1b')]);router[_0x569e('0x1a')](_0x569e('0x13'),auth['isAuthenticated'](),controller[_0x569e('0x1c')]);module['exports']=router;
\ No newline at end of file
index de07704..4ccdc38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x753e=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x3df897,_0x3b1a8c){var _0x43ebf3=function(_0x591289){while(--_0x591289){_0x3df897['push'](_0x3df897['shift']());}};_0x43ebf3(++_0x3b1a8c);}(_0x753e,0x19b));var _0xe753=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x753e[_0xefd519];return _0x4bb882;};'use strict';var Sequelize=require(_0xe753('0x0'));module[_0xe753('0x1')]={'name':{'type':Sequelize[_0xe753('0x2')],'unique':_0xe753('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe753('0x2')]},'timeout':{'type':Sequelize[_0xe753('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe753('0x5')](_0xe753('0x6'),_0xe753('0x7'),_0xe753('0x8'))}};
\ No newline at end of file
+var _0x320a=['rrmemory','beepall','roundrobin','STRING','INTEGER'];(function(_0x332875,_0x5675dc){var _0x16b33d=function(_0x4100ff){while(--_0x4100ff){_0x332875['push'](_0x332875['shift']());}};_0x16b33d(++_0x5675dc);}(_0x320a,0xb2));var _0xa320=function(_0x58dafc,_0x7f27b3){_0x58dafc=_0x58dafc-0x0;var _0x5cf7b2=_0x320a[_0x58dafc];return _0x5cf7b2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa320('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa320('0x0')]},'timeout':{'type':Sequelize[_0xa320('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa320('0x2'),_0xa320('0x3'),_0xa320('0x4'))}};
\ No newline at end of file
index 647b02b..16c3311 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd906=['localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','limit','count','offset','Content-Range','apply','reject','save','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','name','send','index','SmsQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','describe','getMembers','nolimit','sort','pick','SmsQueueId','User','UserId','smsPause','updatedAt','createdAt','SIP','Team','getTeams','addTeams','ids','online','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','removeTeams','field','tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','includes','all','union','compact','value','isEmpty','emit','userSmsQueue:remove','addAgents','omit','userSmsQueue:save','removeAgents','isArray','getAgents','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xd906,0x6b));var _0x6d90=function(_0x5eaf8e,_0x2056f4){_0x5eaf8e=_0x5eaf8e-0x0;var _0x3165ab=_0xd906[_0x5eaf8e];return _0x3165ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6d90('0x0'));var jsonpatch=require(_0x6d90('0x1'));var rp=require(_0x6d90('0x2'));var moment=require(_0x6d90('0x3'));var BPromise=require(_0x6d90('0x4'));var Mustache=require('mustache');var util=require(_0x6d90('0x5'));var path=require(_0x6d90('0x6'));var sox=require(_0x6d90('0x7'));var csv=require(_0x6d90('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d90('0x9'));var _=require(_0x6d90('0xa'));var squel=require(_0x6d90('0xb'));var crypto=require(_0x6d90('0xc'));var jsforce=require(_0x6d90('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d90('0xe'));var Redis=require(_0x6d90('0xf'));var authService=require(_0x6d90('0x10'));var qs=require(_0x6d90('0x11'));var as=require(_0x6d90('0x12'));var hardwareService=require(_0x6d90('0x13'));var logger=require(_0x6d90('0x14'))('api');var utils=require(_0x6d90('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6d90('0x16'));var db=require('../../mysqldb')['db'];config[_0x6d90('0x17')]=_[_0x6d90('0x18')](config[_0x6d90('0x17')],{'host':_0x6d90('0x19'),'port':0x18eb});var socket=require(_0x6d90('0x1a'))(new Redis(config[_0x6d90('0x17')]));require(_0x6d90('0x1b'))[_0x6d90('0x1c')](socket);function respondWithStatusCode(_0x50b642,_0x35994a){_0x35994a=_0x35994a||0xcc;return function(_0x513417){if(_0x513417){return _0x50b642[_0x6d90('0x1d')](_0x35994a);}return _0x50b642[_0x6d90('0x1e')](_0x35994a)[_0x6d90('0x1f')]();};}function respondWithResult(_0x4dc4e3,_0x1e44db){_0x1e44db=_0x1e44db||0xc8;return function(_0x49b4ad){if(_0x49b4ad){return _0x4dc4e3[_0x6d90('0x1e')](_0x1e44db)['json'](_0x49b4ad);}};}function respondWithFilteredResult(_0x179703,_0xeb9d15){return function(_0x352736){if(_0x352736){var _0x3d37c6=typeof _0xeb9d15['offset']==='undefined'&&typeof _0xeb9d15[_0x6d90('0x20')]==='undefined';var _0x3aaa84=_0x352736[_0x6d90('0x21')];var _0x4f97ea=_0x3d37c6?0x0:_0xeb9d15['offset'];var _0x3f383d=_0x3d37c6?_0x352736[_0x6d90('0x21')]:_0xeb9d15[_0x6d90('0x22')]+_0xeb9d15['limit'];var _0x5cf8dc;if(_0x3f383d>=_0x3aaa84){_0x3f383d=_0x3aaa84;_0x5cf8dc=0xc8;}else{_0x5cf8dc=0xce;}_0x179703['status'](_0x5cf8dc);return _0x179703['set'](_0x6d90('0x23'),_0x4f97ea+'-'+_0x3f383d+'/'+_0x3aaa84)['json'](_0x352736);}return null;};}function patchUpdates(_0x19eb9d){return function(_0x3f9314){try{jsonpatch[_0x6d90('0x24')](_0x3f9314,_0x19eb9d,!![]);}catch(_0x470b5c){return BPromise[_0x6d90('0x25')](_0x470b5c);}return _0x3f9314[_0x6d90('0x26')]();};}function saveUpdates(_0x3aef5b,_0x43c927){return function(_0x243a32){if(_0x243a32){return _0x243a32[_0x6d90('0x27')](_0x3aef5b)[_0x6d90('0x28')](function(_0x597386){return _0x597386;});}return null;};}function removeEntity(_0x18f9aa,_0x2036f1){return function(_0x447070){if(_0x447070){return _0x447070['destroy']()[_0x6d90('0x28')](function(){var _0x1fefae=_0x447070[_0x6d90('0x29')]({'plain':!![]});var _0x46d76b=_0x6d90('0x2a');return db[_0x6d90('0x2b')][_0x6d90('0x2c')]({'where':{'type':_0x46d76b,'resourceId':_0x1fefae['id']}})[_0x6d90('0x28')](function(){return _0x447070;});})[_0x6d90('0x28')](function(){_0x18f9aa[_0x6d90('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec50d,_0x5e1ab7){return function(_0xf4fb3){if(!_0xf4fb3){_0x5ec50d['sendStatus'](0x194);}return _0xf4fb3;};}function handleError(_0x53a2bd,_0x6a4f09){_0x6a4f09=_0x6a4f09||0x1f4;return function(_0x148cf5){logger[_0x6d90('0x2d')](_0x148cf5[_0x6d90('0x2e')]);if(_0x148cf5[_0x6d90('0x2f')]){delete _0x148cf5[_0x6d90('0x2f')];}_0x53a2bd[_0x6d90('0x1e')](_0x6a4f09)[_0x6d90('0x30')](_0x148cf5);};}exports[_0x6d90('0x31')]=function(_0xb20831,_0x378b93){var _0x2b325a={},_0x4da0ec={},_0x385758={'count':0x0,'rows':[]};var _0x56384d=_['map'](db[_0x6d90('0x32')][_0x6d90('0x33')],function(_0x5f3e6e){return{'name':_0x5f3e6e[_0x6d90('0x34')],'type':_0x5f3e6e[_0x6d90('0x35')][_0x6d90('0x36')]};});_0x4da0ec[_0x6d90('0x37')]=_[_0x6d90('0x38')](_0x56384d,_0x6d90('0x2f'));_0x4da0ec[_0x6d90('0x39')]=_[_0x6d90('0x3a')](_0xb20831[_0x6d90('0x39')]);_0x4da0ec[_0x6d90('0x3b')]=_[_0x6d90('0x3c')](_0x4da0ec[_0x6d90('0x37')],_0x4da0ec[_0x6d90('0x39')]);_0x2b325a[_0x6d90('0x3d')]=_[_0x6d90('0x3c')](_0x4da0ec[_0x6d90('0x37')],qs[_0x6d90('0x3e')](_0xb20831[_0x6d90('0x39')]['fields']));_0x2b325a[_0x6d90('0x3d')]=_0x2b325a['attributes'][_0x6d90('0x3f')]?_0x2b325a[_0x6d90('0x3d')]:_0x4da0ec['model'];if(!_0xb20831[_0x6d90('0x39')][_0x6d90('0x40')]('nolimit')){_0x2b325a[_0x6d90('0x20')]=qs[_0x6d90('0x20')](_0xb20831[_0x6d90('0x39')][_0x6d90('0x20')]);_0x2b325a[_0x6d90('0x22')]=qs['offset'](_0xb20831[_0x6d90('0x39')][_0x6d90('0x22')]);}_0x2b325a[_0x6d90('0x41')]=qs['sort'](_0xb20831[_0x6d90('0x39')]['sort']);_0x2b325a[_0x6d90('0x42')]=qs['filters'](_['pick'](_0xb20831[_0x6d90('0x39')],_0x4da0ec[_0x6d90('0x3b')]),_0x56384d);if(_0xb20831[_0x6d90('0x39')][_0x6d90('0x43')]){_0x2b325a[_0x6d90('0x42')]=_[_0x6d90('0x44')](_0x2b325a[_0x6d90('0x42')],{'$or':_[_0x6d90('0x38')](_0x56384d,function(_0x12c5a8){if(_0x12c5a8[_0x6d90('0x35')]!=='VIRTUAL'){var _0x4b352d={};_0x4b352d[_0x12c5a8['name']]={'$like':'%'+_0xb20831['query']['filter']+'%'};return _0x4b352d;}})});}_0x2b325a=_['merge']({},_0x2b325a,_0xb20831[_0x6d90('0x45')]);var _0x5b0ea7={'where':_0x2b325a[_0x6d90('0x42')]};return db[_0x6d90('0x32')][_0x6d90('0x21')](_0x5b0ea7)[_0x6d90('0x28')](function(_0x5ed325){_0x385758[_0x6d90('0x21')]=_0x5ed325;if(_0xb20831['query'][_0x6d90('0x46')]){_0x2b325a[_0x6d90('0x47')]=[{'all':!![]}];}return db[_0x6d90('0x32')][_0x6d90('0x48')](_0x2b325a);})[_0x6d90('0x28')](function(_0x5d39d0){_0x385758[_0x6d90('0x49')]=_0x5d39d0;return _0x385758;})[_0x6d90('0x28')](respondWithFilteredResult(_0x378b93,_0x2b325a))[_0x6d90('0x4a')](handleError(_0x378b93,null));};exports[_0x6d90('0x4b')]=function(_0x390149,_0x5bfd1d){var _0x1554b8={'raw':!![],'where':{'id':_0x390149['params']['id']}},_0x40957a={};_0x40957a[_0x6d90('0x37')]=_[_0x6d90('0x3a')](db['SmsQueue']['rawAttributes']);_0x40957a[_0x6d90('0x39')]=_[_0x6d90('0x3a')](_0x390149[_0x6d90('0x39')]);_0x40957a[_0x6d90('0x3b')]=_[_0x6d90('0x3c')](_0x40957a[_0x6d90('0x37')],_0x40957a[_0x6d90('0x39')]);_0x1554b8[_0x6d90('0x3d')]=_[_0x6d90('0x3c')](_0x40957a[_0x6d90('0x37')],qs[_0x6d90('0x3e')](_0x390149['query'][_0x6d90('0x3e')]));_0x1554b8['attributes']=_0x1554b8['attributes']['length']?_0x1554b8[_0x6d90('0x3d')]:_0x40957a[_0x6d90('0x37')];if(_0x390149[_0x6d90('0x39')][_0x6d90('0x46')]){_0x1554b8[_0x6d90('0x47')]=[{'all':!![]}];}_0x1554b8=_[_0x6d90('0x44')]({},_0x1554b8,_0x390149[_0x6d90('0x45')]);return db[_0x6d90('0x32')]['find'](_0x1554b8)[_0x6d90('0x28')](handleEntityNotFound(_0x5bfd1d,null))[_0x6d90('0x28')](respondWithResult(_0x5bfd1d,null))['catch'](handleError(_0x5bfd1d,null));};exports[_0x6d90('0x4c')]=function(_0x394947,_0x2ebc12){return db[_0x6d90('0x32')][_0x6d90('0x4c')](_0x394947[_0x6d90('0x4d')],{})['then'](function(_0x464a23){var _0x16e9cd=_0x394947['user'][_0x6d90('0x29')]({'plain':!![]});if(!_0x16e9cd)throw new Error(_0x6d90('0x4e'));if(_0x16e9cd[_0x6d90('0x4f')]==='user'){var _0x35a69b=_0x464a23[_0x6d90('0x29')]({'plain':!![]});var _0x317d2e=_0x6d90('0x2a');return db[_0x6d90('0x50')]['find']({'where':{'name':_0x317d2e,'userProfileId':_0x16e9cd['userProfileId']},'raw':!![]})[_0x6d90('0x28')](function(_0x4c6838){if(_0x4c6838&&_0x4c6838['autoAssociation']===0x0){return db[_0x6d90('0x2b')][_0x6d90('0x4c')]({'name':_0x35a69b[_0x6d90('0x2f')],'resourceId':_0x35a69b['id'],'type':_0x4c6838['name'],'sectionId':_0x4c6838['id']},{})[_0x6d90('0x28')](function(){return _0x464a23;});}else{return _0x464a23;}})[_0x6d90('0x4a')](function(_0x37de50){logger[_0x6d90('0x2d')](_0x6d90('0x51'),_0x37de50);throw _0x37de50;});}return _0x464a23;})[_0x6d90('0x28')](respondWithResult(_0x2ebc12,0xc9))[_0x6d90('0x4a')](handleError(_0x2ebc12,null));};exports[_0x6d90('0x27')]=function(_0x1886ed,_0x91a03c){if(_0x1886ed[_0x6d90('0x4d')]['id']){delete _0x1886ed['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x1886ed[_0x6d90('0x52')]['id']}})[_0x6d90('0x28')](handleEntityNotFound(_0x91a03c,null))[_0x6d90('0x28')](saveUpdates(_0x1886ed[_0x6d90('0x4d')],null))[_0x6d90('0x28')](respondWithResult(_0x91a03c,null))[_0x6d90('0x4a')](handleError(_0x91a03c,null));};exports[_0x6d90('0x2c')]=function(_0x521f62,_0x2547fd){return db[_0x6d90('0x32')][_0x6d90('0x53')]({'where':{'id':_0x521f62['params']['id']}})[_0x6d90('0x28')](handleEntityNotFound(_0x2547fd,null))['then'](removeEntity(_0x2547fd,null))['catch'](handleError(_0x2547fd,null));};exports[_0x6d90('0x54')]=function(_0x5e234,_0xedfacc){return db[_0x6d90('0x32')]['describe']()['then'](respondWithResult(_0xedfacc,null))[_0x6d90('0x4a')](handleError(_0xedfacc,null));};exports[_0x6d90('0x55')]=function(_0x4672e1,_0x557d92,_0x53e4f0){var _0x38b1d0={'raw':!![],'where':{}},_0x264d65={},_0x59eaab;return db[_0x6d90('0x32')]['findOne']({'where':{'id':_0x4672e1[_0x6d90('0x52')]['id']}})[_0x6d90('0x28')](handleEntityNotFound(_0x557d92,null))['then'](function(_0x102e4a){if(_0x102e4a){_0x59eaab=_0x102e4a[_0x6d90('0x29')]({'plain':!![]});_0x264d65[_0x6d90('0x37')]=_[_0x6d90('0x3a')](db['UserSmsQueue']['rawAttributes']);_0x264d65[_0x6d90('0x39')]=_['keys'](_0x4672e1[_0x6d90('0x39')]);_0x264d65[_0x6d90('0x3b')]=_[_0x6d90('0x3c')](_0x264d65['model'],_0x264d65[_0x6d90('0x39')]);_0x38b1d0['attributes']=_['intersection'](_0x264d65['model'],qs['fields'](_0x4672e1[_0x6d90('0x39')][_0x6d90('0x3e')]));_0x38b1d0['attributes']=_0x38b1d0[_0x6d90('0x3d')]['length']?_0x38b1d0[_0x6d90('0x3d')]:_0x264d65[_0x6d90('0x37')];if(!_0x4672e1[_0x6d90('0x39')][_0x6d90('0x40')](_0x6d90('0x56'))){_0x38b1d0[_0x6d90('0x20')]=qs['limit'](_0x4672e1[_0x6d90('0x39')][_0x6d90('0x20')]);_0x38b1d0['offset']=qs[_0x6d90('0x22')](_0x4672e1[_0x6d90('0x39')][_0x6d90('0x22')]);}_0x38b1d0[_0x6d90('0x41')]=qs[_0x6d90('0x57')](_0x4672e1[_0x6d90('0x39')][_0x6d90('0x57')]);_0x38b1d0[_0x6d90('0x42')]=qs[_0x6d90('0x3b')](_[_0x6d90('0x58')](_0x4672e1[_0x6d90('0x39')],_0x264d65['filters']));_0x38b1d0[_0x6d90('0x42')][_0x6d90('0x59')]=_0x102e4a['id'];if(_0x4672e1[_0x6d90('0x39')][_0x6d90('0x43')]){_0x38b1d0[_0x6d90('0x42')]=_[_0x6d90('0x44')](_0x38b1d0['where'],{'$or':_[_0x6d90('0x38')](_0x38b1d0[_0x6d90('0x3d')],function(_0x3e732c){var _0x5a8419={};_0x5a8419[_0x3e732c]={'$like':'%'+_0x4672e1['query']['filter']+'%'};return _0x5a8419;})});}_0x38b1d0=_[_0x6d90('0x44')]({},_0x38b1d0,_0x4672e1[_0x6d90('0x45')]);return db['UserSmsQueue']['findAll'](_0x38b1d0);}})[_0x6d90('0x28')](function(_0x132338){if(_0x132338){return db[_0x6d90('0x5a')]['findAndCountAll']({'where':{'id':_[_0x6d90('0x38')](_0x132338,_0x6d90('0x5b')),'role':'agent'},'attributes':['id',_0x6d90('0x2f'),_0x6d90('0x5c'),_0x6d90('0x5d'),_0x6d90('0x5e')]});}})['then'](function(_0x4b8edd){if(_0x4b8edd){return{'count':_0x4b8edd[_0x6d90('0x21')],'rows':_[_0x6d90('0x38')](_0x4b8edd['rows'],function(_0x3b1dd6){return{'membername':_0x3b1dd6[_0x6d90('0x2f')],'UserId':_0x3b1dd6['id'],'queue_name':_0x59eaab[_0x6d90('0x2f')],'SmsQueueId':_0x59eaab['id'],'interface':util['format']('%s/%s',_0x6d90('0x5f'),_0x3b1dd6[_0x6d90('0x2f')]),'penalty':0x0,'paused':_0x3b1dd6[_0x6d90('0x5c')],'createdAt':_0x3b1dd6['createdAt'],'updatedAt':_0x3b1dd6[_0x6d90('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6d90('0x28')](respondWithFilteredResult(_0x557d92,_0x38b1d0))[_0x6d90('0x4a')](handleError(_0x557d92,null));};exports['getTeams']=function(_0x206c59,_0xc1b982,_0x4c8d25){var _0x552dca={};var _0x243079={};var _0x5a298d;var _0x4ba9b1;return db[_0x6d90('0x32')]['findOne']({'where':{'id':_0x206c59[_0x6d90('0x52')]['id']}})['then'](handleEntityNotFound(_0xc1b982,null))['then'](function(_0x4dae43){if(_0x4dae43){_0x5a298d=_0x4dae43;_0x243079[_0x6d90('0x37')]=_[_0x6d90('0x3a')](db[_0x6d90('0x60')]['rawAttributes']);_0x243079['query']=_[_0x6d90('0x3a')](_0x206c59['query']);_0x243079[_0x6d90('0x3b')]=_[_0x6d90('0x3c')](_0x243079[_0x6d90('0x37')],_0x243079[_0x6d90('0x39')]);_0x552dca['attributes']=_[_0x6d90('0x3c')](_0x243079[_0x6d90('0x37')],qs[_0x6d90('0x3e')](_0x206c59['query']['fields']));_0x552dca[_0x6d90('0x3d')]=_0x552dca[_0x6d90('0x3d')]['length']?_0x552dca[_0x6d90('0x3d')]:_0x243079[_0x6d90('0x37')];_0x552dca['order']=qs[_0x6d90('0x57')](_0x206c59[_0x6d90('0x39')][_0x6d90('0x57')]);_0x552dca[_0x6d90('0x42')]=qs[_0x6d90('0x3b')](_[_0x6d90('0x58')](_0x206c59[_0x6d90('0x39')],_0x243079[_0x6d90('0x3b')]));if(_0x206c59['query'][_0x6d90('0x43')]){_0x552dca[_0x6d90('0x42')]=_['merge'](_0x552dca[_0x6d90('0x42')],{'$or':_[_0x6d90('0x38')](_0x552dca[_0x6d90('0x3d')],function(_0x2eadb8){var _0x5c3ca1={};_0x5c3ca1[_0x2eadb8]={'$like':'%'+_0x206c59['query']['filter']+'%'};return _0x5c3ca1;})});}_0x552dca=_[_0x6d90('0x44')]({},_0x552dca,_0x206c59[_0x6d90('0x45')]);return _0x5a298d[_0x6d90('0x61')](_0x552dca);}})['then'](function(_0xaeb7fb){if(_0xaeb7fb){_0x4ba9b1=_0xaeb7fb[_0x6d90('0x3f')];if(!_0x206c59[_0x6d90('0x39')][_0x6d90('0x40')](_0x6d90('0x56'))){_0x552dca[_0x6d90('0x20')]=qs[_0x6d90('0x20')](_0x206c59['query'][_0x6d90('0x20')]);_0x552dca[_0x6d90('0x22')]=qs[_0x6d90('0x22')](_0x206c59[_0x6d90('0x39')][_0x6d90('0x22')]);}return _0x5a298d[_0x6d90('0x61')](_0x552dca);}})[_0x6d90('0x28')](function(_0x38eb34){if(_0x38eb34){return _0x38eb34?{'count':_0x4ba9b1,'rows':_0x38eb34}:null;}})[_0x6d90('0x28')](respondWithResult(_0xc1b982,null))[_0x6d90('0x4a')](handleError(_0xc1b982,null));};exports[_0x6d90('0x62')]=function(_0x1dfe60,_0x36dd50,_0x3bea3b){var _0x2f7ee7=_0x1dfe60[_0x6d90('0x4d')][_0x6d90('0x63')];return db[_0x6d90('0x60')][_0x6d90('0x48')]({'where':{'id':_0x2f7ee7},'attributes':['id'],'include':[{'model':db[_0x6d90('0x5a')],'as':'Agents','attributes':['id','name',_0x6d90('0x64'),'voicePause',_0x6d90('0x65')],'raw':!![]}]})[_0x6d90('0x28')](function(_0x504b02){if(_0x504b02){var _0x3db585=_[_0x6d90('0x66')](_0x504b02,function(_0x512c85){var _0x45260f=_0x512c85['get']({'plain':!![]});return _0x45260f[_0x6d90('0x67')];});return db[_0x6d90('0x32')]['find']({'where':{'id':_0x1dfe60[_0x6d90('0x52')]['id']}})[_0x6d90('0x28')](function(_0x2cc07e){return db['sequelize'][_0x6d90('0x68')](function(_0xcd6e4e){return _0x2cc07e[_0x6d90('0x62')](_0x2f7ee7,{'transaction':_0xcd6e4e})[_0x6d90('0x28')](function(){return BPromise[_0x6d90('0x69')](_0x3db585,function(_0x4be376){return db['UserSmsQueue'][_0x6d90('0x6a')]({'where':{'UserId':_0x4be376['id'],'SmsQueueId':_0x1dfe60[_0x6d90('0x52')]['id']},'transaction':_0xcd6e4e});});})[_0x6d90('0x28')](function(){_0x3db585[_0x6d90('0x6b')](function(_0x49cd68){socket['emit']('userSmsQueue:save',{'UserId':_0x49cd68['id'],'SmsQueueId':_0x2cc07e['id']});});});});});}})[_0x6d90('0x28')](respondWithStatusCode(_0x36dd50,null))[_0x6d90('0x4a')](handleError(_0x36dd50,null));};exports[_0x6d90('0x6c')]=function(_0x1a051e,_0x87c427,_0x51280c){return db[_0x6d90('0x60')][_0x6d90('0x48')]({'where':{'id':_0x1a051e[_0x6d90('0x39')][_0x6d90('0x63')]},'attributes':['id'],'include':[{'model':db[_0x6d90('0x5a')],'as':_0x6d90('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6d90('0x28')](handleEntityNotFound(_0x87c427,null))[_0x6d90('0x28')](function(_0x4f9946){var _0x5a5fd6=_[_0x6d90('0x38')](_0x4f9946,'id');var _0x2813e4=[];var _0x132853=[];var _0x339a19=squel['select']();_0x339a19[_0x6d90('0x6d')](_0x6d90('0x6e'))['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6d90('0x42')](_0x6d90('0x6f'),_0x1a051e[_0x6d90('0x52')]['id']);for(var _0x45b251=0x0;_0x45b251<_0x4f9946[_0x6d90('0x3f')];_0x45b251+=0x1){let _0x501fb3=_0x4f9946[_0x45b251];for(var _0x29db93=0x0;_0x29db93<_0x501fb3[_0x6d90('0x67')][_0x6d90('0x3f')];_0x29db93+=0x1){let _0x41fdc9=_0x501fb3[_0x6d90('0x67')][_0x29db93];var _0x573407=_0x339a19[_0x6d90('0x70')]();_0x573407['where'](_0x6d90('0x71'),_0x41fdc9['id']);_0x132853[_0x6d90('0x72')](db[_0x6d90('0x73')][_0x6d90('0x39')](_0x573407[_0x6d90('0x74')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x6d90('0x28')](function(_0x20f370){if(_0x20f370[_0x6d90('0x3f')]===0x1){return _0x41fdc9['id'];}else{var _0x291ae3=_['every'](_['map'](_0x20f370,'TeamId'),function(_0x96ea60){return _[_0x6d90('0x75')](_0x5a5fd6,_0x96ea60);});if(_0x291ae3){return _0x41fdc9['id'];}}}));}}return BPromise[_0x6d90('0x76')](_0x132853)[_0x6d90('0x28')](function(_0x22e8bd){_0x2813e4=_(_0x2813e4)[_0x6d90('0x77')](_0x22e8bd)[_0x6d90('0x78')]()[_0x6d90('0x79')]();return db['SmsQueue']['find']({'where':{'id':_0x1a051e[_0x6d90('0x52')]['id']}})[_0x6d90('0x28')](function(_0x49e1f4){return db[_0x6d90('0x73')][_0x6d90('0x68')](function(_0x1804cf){return _0x49e1f4['removeTeams'](_0x1a051e[_0x6d90('0x39')][_0x6d90('0x63')],{'transaction':_0x1804cf})[_0x6d90('0x28')](function(){if(!_[_0x6d90('0x7a')](_0x2813e4)){return _0x49e1f4['removeAgents'](_0x2813e4,{'transaction':_0x1804cf});}})[_0x6d90('0x28')](function(){_0x2813e4[_0x6d90('0x6b')](function(_0x425e08){socket[_0x6d90('0x7b')](_0x6d90('0x7c'),{'UserId':_0x425e08,'SmsQueueId':_0x49e1f4['id']});});});});});});})[_0x6d90('0x28')](respondWithStatusCode(_0x87c427,null))[_0x6d90('0x4a')](handleError(_0x87c427,null));};exports[_0x6d90('0x7d')]=function(_0x2dd4e3,_0x8af858,_0x3b90af){return db[_0x6d90('0x32')][_0x6d90('0x53')]({'where':{'id':_0x2dd4e3[_0x6d90('0x52')]['id']}})[_0x6d90('0x28')](handleEntityNotFound(_0x8af858,null))[_0x6d90('0x28')](function(_0x5898ac){if(_0x5898ac){return _0x5898ac[_0x6d90('0x7d')](_0x2dd4e3[_0x6d90('0x4d')]['ids'],_[_0x6d90('0x7e')](_0x2dd4e3[_0x6d90('0x4d')],[_0x6d90('0x63'),'id'])||{})['spread'](function(_0x336844){for(var _0x1fb3b2=0x0;_0x1fb3b2<_0x2dd4e3[_0x6d90('0x4d')][_0x6d90('0x63')][_0x6d90('0x3f')];_0x1fb3b2+=0x1){socket[_0x6d90('0x7b')](_0x6d90('0x7f'),{'UserId':Number(_0x2dd4e3[_0x6d90('0x4d')]['ids'][_0x1fb3b2]),'SmsQueueId':Number(_0x2dd4e3[_0x6d90('0x52')]['id'])});}return _0x336844;});}})[_0x6d90('0x28')](respondWithResult(_0x8af858,null))[_0x6d90('0x4a')](handleError(_0x8af858,null));};exports[_0x6d90('0x80')]=function(_0x4aa9c0,_0x22edcc,_0x2125d3){return db[_0x6d90('0x32')][_0x6d90('0x53')]({'where':{'id':_0x4aa9c0[_0x6d90('0x52')]['id']}})[_0x6d90('0x28')](handleEntityNotFound(_0x22edcc,null))['then'](function(_0x196691){if(_0x196691){return _0x196691[_0x6d90('0x80')](_0x4aa9c0[_0x6d90('0x39')][_0x6d90('0x63')])['then'](function(){if(_[_0x6d90('0x81')](_0x4aa9c0[_0x6d90('0x39')][_0x6d90('0x63')])){for(var _0x159ffb=0x0;_0x159ffb<_0x4aa9c0[_0x6d90('0x39')]['ids'][_0x6d90('0x3f')];_0x159ffb+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x4aa9c0[_0x6d90('0x39')][_0x6d90('0x63')][_0x159ffb]),'SmsQueueId':Number(_0x4aa9c0[_0x6d90('0x52')]['id'])});}}else{socket['emit'](_0x6d90('0x7c'),{'UserId':Number(_0x4aa9c0['query']['ids']),'SmsQueueId':Number(_0x4aa9c0[_0x6d90('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x22edcc,null))[_0x6d90('0x4a')](handleError(_0x22edcc,null));};exports[_0x6d90('0x82')]=function(_0x3aa479,_0x341a5d,_0x1d010a){var _0x1300d7={};var _0x91f48a={};var _0x203558;var _0x5daa38;return db['SmsQueue'][_0x6d90('0x83')]({'where':{'id':_0x3aa479[_0x6d90('0x52')]['id']}})['then'](handleEntityNotFound(_0x341a5d,null))[_0x6d90('0x28')](function(_0xe32dfd){if(_0xe32dfd){_0x203558=_0xe32dfd;_0x91f48a[_0x6d90('0x37')]=_[_0x6d90('0x3a')](db['User'][_0x6d90('0x33')]);_0x91f48a[_0x6d90('0x39')]=_[_0x6d90('0x3a')](_0x3aa479[_0x6d90('0x39')]);_0x91f48a['filters']=_[_0x6d90('0x3c')](_0x91f48a[_0x6d90('0x37')],_0x91f48a[_0x6d90('0x39')]);_0x1300d7['attributes']=_[_0x6d90('0x3c')](_0x91f48a[_0x6d90('0x37')],qs[_0x6d90('0x3e')](_0x3aa479[_0x6d90('0x39')]['fields']));_0x1300d7[_0x6d90('0x3d')]=_0x1300d7[_0x6d90('0x3d')][_0x6d90('0x3f')]?_0x1300d7[_0x6d90('0x3d')]:_0x91f48a['model'];_0x1300d7[_0x6d90('0x41')]=qs[_0x6d90('0x57')](_0x3aa479['query'][_0x6d90('0x57')]);_0x1300d7[_0x6d90('0x42')]=qs[_0x6d90('0x3b')](_[_0x6d90('0x58')](_0x3aa479['query'],_0x91f48a[_0x6d90('0x3b')]));if(_0x3aa479[_0x6d90('0x39')][_0x6d90('0x43')]){_0x1300d7[_0x6d90('0x42')]=_[_0x6d90('0x44')](_0x1300d7[_0x6d90('0x42')],{'$or':_[_0x6d90('0x38')](_0x1300d7[_0x6d90('0x3d')],function(_0x60490f){var _0x3d276d={};_0x3d276d[_0x60490f]={'$like':'%'+_0x3aa479[_0x6d90('0x39')]['filter']+'%'};return _0x3d276d;})});}_0x1300d7=_[_0x6d90('0x44')]({},_0x1300d7,_0x3aa479[_0x6d90('0x45')]);return _0x203558[_0x6d90('0x82')](_0x1300d7);}})['then'](function(_0x18bf10){if(_0x18bf10){_0x5daa38=_0x18bf10['length'];if(!_0x3aa479[_0x6d90('0x39')][_0x6d90('0x40')](_0x6d90('0x56'))){_0x1300d7['limit']=qs[_0x6d90('0x20')](_0x3aa479[_0x6d90('0x39')][_0x6d90('0x20')]);_0x1300d7[_0x6d90('0x22')]=qs[_0x6d90('0x22')](_0x3aa479[_0x6d90('0x39')][_0x6d90('0x22')]);}return _0x203558['getAgents'](_0x1300d7);}})['then'](function(_0x54b812){if(_0x54b812){return _0x54b812?{'count':_0x5daa38,'rows':_0x54b812}:null;}})['then'](respondWithResult(_0x341a5d,null))[_0x6d90('0x4a')](handleError(_0x341a5d,null));};
\ No newline at end of file
+var _0x77e6=['ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','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','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','agent','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','User','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox'];(function(_0x59dc86,_0x34812a){var _0x37c79c=function(_0x2e838c){while(--_0x2e838c){_0x59dc86['push'](_0x59dc86['shift']());}};_0x37c79c(++_0x34812a);}(_0x77e6,0x1a6));var _0x677e=function(_0x28b511,_0x2fce48){_0x28b511=_0x28b511-0x0;var _0x3d9779=_0x77e6[_0x28b511];return _0x3d9779;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];config[_0x677e('0x1a')]=_[_0x677e('0x1b')](config[_0x677e('0x1a')],{'host':_0x677e('0x1c'),'port':0x18eb});var socket=require(_0x677e('0x1d'))(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x213a50,_0x1dbe16){_0x1dbe16=_0x1dbe16||0xcc;return function(_0x105c88){if(_0x105c88){return _0x213a50[_0x677e('0x1e')](_0x1dbe16);}return _0x213a50[_0x677e('0x1f')](_0x1dbe16)[_0x677e('0x20')]();};}function respondWithResult(_0x24c9eb,_0xe88242){_0xe88242=_0xe88242||0xc8;return function(_0x251069){if(_0x251069){return _0x24c9eb[_0x677e('0x1f')](_0xe88242)[_0x677e('0x21')](_0x251069);}};}function respondWithFilteredResult(_0xe4d960,_0x49d428){return function(_0x1c5124){if(_0x1c5124){var _0x2ef2bf=typeof _0x49d428[_0x677e('0x22')]===_0x677e('0x23')&&typeof _0x49d428[_0x677e('0x24')]===_0x677e('0x23');var _0x52f65d=_0x1c5124[_0x677e('0x25')];var _0x4bfbb6=_0x2ef2bf?0x0:_0x49d428[_0x677e('0x22')];var _0x267aac=_0x2ef2bf?_0x1c5124[_0x677e('0x25')]:_0x49d428['offset']+_0x49d428[_0x677e('0x24')];var _0x1a6122;if(_0x267aac>=_0x52f65d){_0x267aac=_0x52f65d;_0x1a6122=0xc8;}else{_0x1a6122=0xce;}_0xe4d960[_0x677e('0x1f')](_0x1a6122);return _0xe4d960[_0x677e('0x26')](_0x677e('0x27'),_0x4bfbb6+'-'+_0x267aac+'/'+_0x52f65d)[_0x677e('0x21')](_0x1c5124);}return null;};}function patchUpdates(_0x3a7895){return function(_0x52ee8b){try{jsonpatch['apply'](_0x52ee8b,_0x3a7895,!![]);}catch(_0x52d915){return BPromise[_0x677e('0x28')](_0x52d915);}return _0x52ee8b[_0x677e('0x29')]();};}function saveUpdates(_0x31a1e4,_0x540d0e){return function(_0x424e5d){if(_0x424e5d){return _0x424e5d[_0x677e('0x2a')](_0x31a1e4)[_0x677e('0x2b')](function(_0x42f2b8){return _0x42f2b8;});}return null;};}function removeEntity(_0x2c51d3,_0x3f0646){return function(_0x5e5397){if(_0x5e5397){return _0x5e5397['destroy']()[_0x677e('0x2b')](function(){var _0x184f68=_0x5e5397['get']({'plain':!![]});var _0x51e39d=_0x677e('0x2c');return db[_0x677e('0x2d')][_0x677e('0x2e')]({'where':{'type':_0x51e39d,'resourceId':_0x184f68['id']}})[_0x677e('0x2b')](function(){return _0x5e5397;});})[_0x677e('0x2b')](function(){_0x2c51d3['status'](0xcc)[_0x677e('0x20')]();});}};}function handleEntityNotFound(_0x2a6033,_0xeca8e2){return function(_0x1e2694){if(!_0x1e2694){_0x2a6033[_0x677e('0x1e')](0x194);}return _0x1e2694;};}function handleError(_0x2bd6fb,_0x9179a0){_0x9179a0=_0x9179a0||0x1f4;return function(_0x10eb66){logger[_0x677e('0x2f')](_0x10eb66['stack']);if(_0x10eb66[_0x677e('0x30')]){delete _0x10eb66[_0x677e('0x30')];}_0x2bd6fb[_0x677e('0x1f')](_0x9179a0)[_0x677e('0x31')](_0x10eb66);};}exports[_0x677e('0x32')]=function(_0x16f516,_0x34bb3d){var _0x65331={},_0x3b875f={},_0x1d9756={'count':0x0,'rows':[]};var _0x4d0c01=_[_0x677e('0x33')](db[_0x677e('0x34')][_0x677e('0x35')],function(_0x2570b9){return{'name':_0x2570b9[_0x677e('0x36')],'type':_0x2570b9[_0x677e('0x37')]['key']};});_0x3b875f[_0x677e('0x38')]=_[_0x677e('0x33')](_0x4d0c01,_0x677e('0x30'));_0x3b875f['query']=_[_0x677e('0x39')](_0x16f516[_0x677e('0x3a')]);_0x3b875f[_0x677e('0x3b')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],_0x3b875f['query']);_0x65331[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3b875f[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x16f516['query'][_0x677e('0x3e')]));_0x65331[_0x677e('0x3d')]=_0x65331[_0x677e('0x3d')]['length']?_0x65331['attributes']:_0x3b875f[_0x677e('0x38')];if(!_0x16f516[_0x677e('0x3a')]['hasOwnProperty'](_0x677e('0x3f'))){_0x65331[_0x677e('0x24')]=qs['limit'](_0x16f516['query'][_0x677e('0x24')]);_0x65331[_0x677e('0x22')]=qs['offset'](_0x16f516['query'][_0x677e('0x22')]);}_0x65331[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x16f516['query'][_0x677e('0x41')]);_0x65331[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x16f516[_0x677e('0x3a')],_0x3b875f['filters']),_0x4d0c01);if(_0x16f516['query'][_0x677e('0x44')]){_0x65331[_0x677e('0x42')]=_[_0x677e('0x45')](_0x65331[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x4d0c01,function(_0x2f8ebb){if(_0x2f8ebb[_0x677e('0x37')]!==_0x677e('0x46')){var _0x78202e={};_0x78202e[_0x2f8ebb[_0x677e('0x30')]]={'$like':'%'+_0x16f516['query']['filter']+'%'};return _0x78202e;}})});}_0x65331=_[_0x677e('0x45')]({},_0x65331,_0x16f516[_0x677e('0x47')]);var _0x5abab2={'where':_0x65331[_0x677e('0x42')]};return db['SmsQueue'][_0x677e('0x25')](_0x5abab2)[_0x677e('0x2b')](function(_0x283aaa){_0x1d9756[_0x677e('0x25')]=_0x283aaa;if(_0x16f516[_0x677e('0x3a')][_0x677e('0x48')]){_0x65331['include']=[{'all':!![]}];}return db[_0x677e('0x34')][_0x677e('0x49')](_0x65331);})[_0x677e('0x2b')](function(_0x33fce2){_0x1d9756[_0x677e('0x4a')]=_0x33fce2;return _0x1d9756;})[_0x677e('0x2b')](respondWithFilteredResult(_0x34bb3d,_0x65331))['catch'](handleError(_0x34bb3d,null));};exports[_0x677e('0x4b')]=function(_0x5ca3db,_0x3211a9){var _0x2470d0={'raw':!![],'where':{'id':_0x5ca3db[_0x677e('0x4c')]['id']}},_0x3609da={};_0x3609da[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x34')][_0x677e('0x35')]);_0x3609da[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x5ca3db['query']);_0x3609da[_0x677e('0x3b')]=_['intersection'](_0x3609da['model'],_0x3609da[_0x677e('0x3a')]);_0x2470d0[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x3609da[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x5ca3db['query'][_0x677e('0x3e')]));_0x2470d0[_0x677e('0x3d')]=_0x2470d0[_0x677e('0x3d')][_0x677e('0x4d')]?_0x2470d0[_0x677e('0x3d')]:_0x3609da['model'];if(_0x5ca3db[_0x677e('0x3a')][_0x677e('0x48')]){_0x2470d0[_0x677e('0x4e')]=[{'all':!![]}];}_0x2470d0=_['merge']({},_0x2470d0,_0x5ca3db[_0x677e('0x47')]);return db['SmsQueue'][_0x677e('0x4f')](_0x2470d0)['then'](handleEntityNotFound(_0x3211a9,null))['then'](respondWithResult(_0x3211a9,null))[_0x677e('0x50')](handleError(_0x3211a9,null));};exports[_0x677e('0x51')]=function(_0x1f767f,_0x3ff832){return db['SmsQueue'][_0x677e('0x51')](_0x1f767f[_0x677e('0x52')],{})['then'](function(_0x5e93e9){var _0x558d43=_0x1f767f[_0x677e('0x53')][_0x677e('0x54')]({'plain':!![]});if(!_0x558d43)throw new Error(_0x677e('0x55'));if(_0x558d43['role']===_0x677e('0x53')){var _0x4fa910=_0x5e93e9['get']({'plain':!![]});var _0x3bb4d8='SmsQueues';return db[_0x677e('0x56')][_0x677e('0x4f')]({'where':{'name':_0x3bb4d8,'userProfileId':_0x558d43[_0x677e('0x57')]},'raw':!![]})[_0x677e('0x2b')](function(_0x410012){if(_0x410012&&_0x410012[_0x677e('0x58')]===0x0){return db[_0x677e('0x2d')]['create']({'name':_0x4fa910['name'],'resourceId':_0x4fa910['id'],'type':_0x410012['name'],'sectionId':_0x410012['id']},{})[_0x677e('0x2b')](function(){return _0x5e93e9;});}else{return _0x5e93e9;}})[_0x677e('0x50')](function(_0x108d48){logger[_0x677e('0x2f')](_0x677e('0x59'),_0x108d48);throw _0x108d48;});}return _0x5e93e9;})[_0x677e('0x2b')](respondWithResult(_0x3ff832,0xc9))['catch'](handleError(_0x3ff832,null));};exports[_0x677e('0x2a')]=function(_0xe6654c,_0x5d4ba5){if(_0xe6654c[_0x677e('0x52')]['id']){delete _0xe6654c['body']['id'];}return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0xe6654c[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x5d4ba5,null))['then'](saveUpdates(_0xe6654c[_0x677e('0x52')],null))['then'](respondWithResult(_0x5d4ba5,null))[_0x677e('0x50')](handleError(_0x5d4ba5,null));};exports[_0x677e('0x2e')]=function(_0x6e6f2e,_0x1c6f18){return db[_0x677e('0x34')]['find']({'where':{'id':_0x6e6f2e[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x1c6f18,null))[_0x677e('0x2b')](removeEntity(_0x1c6f18,null))['catch'](handleError(_0x1c6f18,null));};exports[_0x677e('0x5a')]=function(_0x8c6495,_0xaa218d){return db[_0x677e('0x34')][_0x677e('0x5a')]()[_0x677e('0x2b')](respondWithResult(_0xaa218d,null))['catch'](handleError(_0xaa218d,null));};exports[_0x677e('0x5b')]=function(_0x5eb65e,_0x4c48a4,_0x38b717){var _0x52d973={'raw':!![],'where':{}},_0x5ddc5f={},_0x69c67c;return db['SmsQueue'][_0x677e('0x5c')]({'where':{'id':_0x5eb65e[_0x677e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c48a4,null))[_0x677e('0x2b')](function(_0x100be4){if(_0x100be4){_0x69c67c=_0x100be4[_0x677e('0x54')]({'plain':!![]});_0x5ddc5f[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x5d')]['rawAttributes']);_0x5ddc5f[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x5eb65e[_0x677e('0x3a')]);_0x5ddc5f['filters']=_[_0x677e('0x3c')](_0x5ddc5f[_0x677e('0x38')],_0x5ddc5f[_0x677e('0x3a')]);_0x52d973[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x5ddc5f[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x5eb65e[_0x677e('0x3a')]['fields']));_0x52d973[_0x677e('0x3d')]=_0x52d973[_0x677e('0x3d')][_0x677e('0x4d')]?_0x52d973[_0x677e('0x3d')]:_0x5ddc5f[_0x677e('0x38')];if(!_0x5eb65e['query'][_0x677e('0x5e')](_0x677e('0x3f'))){_0x52d973[_0x677e('0x24')]=qs[_0x677e('0x24')](_0x5eb65e['query'][_0x677e('0x24')]);_0x52d973[_0x677e('0x22')]=qs[_0x677e('0x22')](_0x5eb65e[_0x677e('0x3a')][_0x677e('0x22')]);}_0x52d973[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x5eb65e[_0x677e('0x3a')][_0x677e('0x41')]);_0x52d973[_0x677e('0x42')]=qs[_0x677e('0x3b')](_['pick'](_0x5eb65e['query'],_0x5ddc5f[_0x677e('0x3b')]));_0x52d973[_0x677e('0x42')][_0x677e('0x5f')]=_0x100be4['id'];if(_0x5eb65e[_0x677e('0x3a')][_0x677e('0x44')]){_0x52d973[_0x677e('0x42')]=_['merge'](_0x52d973[_0x677e('0x42')],{'$or':_[_0x677e('0x33')](_0x52d973[_0x677e('0x3d')],function(_0x949a37){var _0x44b96a={};_0x44b96a[_0x949a37]={'$like':'%'+_0x5eb65e[_0x677e('0x3a')]['filter']+'%'};return _0x44b96a;})});}_0x52d973=_[_0x677e('0x45')]({},_0x52d973,_0x5eb65e['options']);return db['UserSmsQueue'][_0x677e('0x49')](_0x52d973);}})['then'](function(_0x49c583){if(_0x49c583){return db['User']['findAndCountAll']({'where':{'id':_[_0x677e('0x33')](_0x49c583,'UserId'),'role':_0x677e('0x60')},'attributes':['id',_0x677e('0x30'),'smsPause',_0x677e('0x61'),_0x677e('0x62')]});}})[_0x677e('0x2b')](function(_0x1f6412){if(_0x1f6412){return{'count':_0x1f6412[_0x677e('0x25')],'rows':_[_0x677e('0x33')](_0x1f6412['rows'],function(_0x15a176){return{'membername':_0x15a176['name'],'UserId':_0x15a176['id'],'queue_name':_0x69c67c[_0x677e('0x30')],'SmsQueueId':_0x69c67c['id'],'interface':util['format'](_0x677e('0x63'),_0x677e('0x64'),_0x15a176[_0x677e('0x30')]),'penalty':0x0,'paused':_0x15a176['smsPause'],'createdAt':_0x15a176['createdAt'],'updatedAt':_0x15a176['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4c48a4,_0x52d973))[_0x677e('0x50')](handleError(_0x4c48a4,null));};exports[_0x677e('0x65')]=function(_0x333634,_0x318eb2,_0xff9fdf){var _0x2f9c58={};var _0x2b1639={};var _0x642312;var _0x337b52;return db[_0x677e('0x34')][_0x677e('0x5c')]({'where':{'id':_0x333634['params']['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x318eb2,null))[_0x677e('0x2b')](function(_0x5b07c5){if(_0x5b07c5){_0x642312=_0x5b07c5;_0x2b1639[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x66')][_0x677e('0x35')]);_0x2b1639[_0x677e('0x3a')]=_[_0x677e('0x39')](_0x333634[_0x677e('0x3a')]);_0x2b1639[_0x677e('0x3b')]=_[_0x677e('0x3c')](_0x2b1639['model'],_0x2b1639['query']);_0x2f9c58[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x2b1639[_0x677e('0x38')],qs[_0x677e('0x3e')](_0x333634['query'][_0x677e('0x3e')]));_0x2f9c58[_0x677e('0x3d')]=_0x2f9c58[_0x677e('0x3d')]['length']?_0x2f9c58['attributes']:_0x2b1639['model'];_0x2f9c58[_0x677e('0x40')]=qs[_0x677e('0x41')](_0x333634['query'][_0x677e('0x41')]);_0x2f9c58[_0x677e('0x42')]=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0x333634['query'],_0x2b1639['filters']));if(_0x333634[_0x677e('0x3a')][_0x677e('0x44')]){_0x2f9c58[_0x677e('0x42')]=_[_0x677e('0x45')](_0x2f9c58['where'],{'$or':_['map'](_0x2f9c58['attributes'],function(_0x3c2ba0){var _0x24fd7b={};_0x24fd7b[_0x3c2ba0]={'$like':'%'+_0x333634['query']['filter']+'%'};return _0x24fd7b;})});}_0x2f9c58=_[_0x677e('0x45')]({},_0x2f9c58,_0x333634['options']);return _0x642312['getTeams'](_0x2f9c58);}})[_0x677e('0x2b')](function(_0x42746){if(_0x42746){_0x337b52=_0x42746[_0x677e('0x4d')];if(!_0x333634[_0x677e('0x3a')]['hasOwnProperty']('nolimit')){_0x2f9c58['limit']=qs[_0x677e('0x24')](_0x333634[_0x677e('0x3a')][_0x677e('0x24')]);_0x2f9c58[_0x677e('0x22')]=qs[_0x677e('0x22')](_0x333634[_0x677e('0x3a')]['offset']);}return _0x642312[_0x677e('0x65')](_0x2f9c58);}})['then'](function(_0x4b418d){if(_0x4b418d){return _0x4b418d?{'count':_0x337b52,'rows':_0x4b418d}:null;}})[_0x677e('0x2b')](respondWithResult(_0x318eb2,null))[_0x677e('0x50')](handleError(_0x318eb2,null));};exports['addTeams']=function(_0x1f2b4b,_0x22690c,_0x216182){var _0x4df9ba=_0x1f2b4b['body'][_0x677e('0x67')];return db['Team']['findAll']({'where':{'id':_0x4df9ba},'attributes':['id'],'include':[{'model':db[_0x677e('0x68')],'as':_0x677e('0x69'),'attributes':['id',_0x677e('0x30'),'online','voicePause',_0x677e('0x6a')],'raw':!![]}]})[_0x677e('0x2b')](function(_0x387c16){if(_0x387c16){var _0x4ebfa3=_[_0x677e('0x6b')](_0x387c16,function(_0x7edc45){var _0x5c8cd9=_0x7edc45[_0x677e('0x54')]({'plain':!![]});return _0x5c8cd9['Agents'];});return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x1f2b4b['params']['id']}})[_0x677e('0x2b')](function(_0x12cb20){return db[_0x677e('0x6c')]['transaction'](function(_0x565b36){return _0x12cb20['addTeams'](_0x4df9ba,{'transaction':_0x565b36})[_0x677e('0x2b')](function(){return BPromise[_0x677e('0x6d')](_0x4ebfa3,function(_0x17859a){return db[_0x677e('0x5d')][_0x677e('0x6e')]({'where':{'UserId':_0x17859a['id'],'SmsQueueId':_0x1f2b4b[_0x677e('0x4c')]['id']},'transaction':_0x565b36});});})[_0x677e('0x2b')](function(){_0x4ebfa3[_0x677e('0x6f')](function(_0x31ed60){socket[_0x677e('0x70')](_0x677e('0x71'),{'UserId':_0x31ed60['id'],'SmsQueueId':_0x12cb20['id']});});});});});}})[_0x677e('0x2b')](respondWithStatusCode(_0x22690c,null))['catch'](handleError(_0x22690c,null));};exports[_0x677e('0x72')]=function(_0x585593,_0x59bded,_0x487107){return db[_0x677e('0x66')][_0x677e('0x49')]({'where':{'id':_0x585593[_0x677e('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db[_0x677e('0x68')],'as':_0x677e('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x59bded,null))['then'](function(_0x32edc3){var _0x59cf17=_[_0x677e('0x33')](_0x32edc3,'id');var _0x4b6280=[];var _0x1cf5a8=[];var _0x2171ec=squel['select']();_0x2171ec[_0x677e('0x73')](_0x677e('0x74'))[_0x677e('0x75')](_0x677e('0x76'),'tq')[_0x677e('0x77')](_0x677e('0x78'),'ut',_0x677e('0x79'))[_0x677e('0x42')](_0x677e('0x7a'),_0x585593[_0x677e('0x4c')]['id']);for(var _0x5a1b4a=0x0;_0x5a1b4a<_0x32edc3['length'];_0x5a1b4a+=0x1){let _0x31dd93=_0x32edc3[_0x5a1b4a];for(var _0x18bc64=0x0;_0x18bc64<_0x31dd93[_0x677e('0x69')]['length'];_0x18bc64+=0x1){let _0x1f5918=_0x31dd93[_0x677e('0x69')][_0x18bc64];var _0x12f311=_0x2171ec[_0x677e('0x7b')]();_0x12f311['where'](_0x677e('0x7c'),_0x1f5918['id']);_0x1cf5a8[_0x677e('0x7d')](db[_0x677e('0x6c')][_0x677e('0x3a')](_0x12f311['toString'](),{'type':db['sequelize'][_0x677e('0x7e')][_0x677e('0x7f')]})['then'](function(_0x368f80){if(_0x368f80[_0x677e('0x4d')]===0x1){return _0x1f5918['id'];}else{var _0x41968b=_[_0x677e('0x80')](_[_0x677e('0x33')](_0x368f80,_0x677e('0x81')),function(_0x36901a){return _[_0x677e('0x82')](_0x59cf17,_0x36901a);});if(_0x41968b){return _0x1f5918['id'];}}}));}}return BPromise[_0x677e('0x83')](_0x1cf5a8)[_0x677e('0x2b')](function(_0x4a6a8c){_0x4b6280=_(_0x4b6280)[_0x677e('0x84')](_0x4a6a8c)[_0x677e('0x85')]()[_0x677e('0x86')]();return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x585593['params']['id']}})[_0x677e('0x2b')](function(_0x6f2bee){return db['sequelize'][_0x677e('0x87')](function(_0x17c944){return _0x6f2bee[_0x677e('0x72')](_0x585593[_0x677e('0x3a')]['ids'],{'transaction':_0x17c944})[_0x677e('0x2b')](function(){if(!_[_0x677e('0x88')](_0x4b6280)){return _0x6f2bee['removeAgents'](_0x4b6280,{'transaction':_0x17c944});}})[_0x677e('0x2b')](function(){_0x4b6280[_0x677e('0x6f')](function(_0xf8fae6){socket[_0x677e('0x70')](_0x677e('0x89'),{'UserId':_0xf8fae6,'SmsQueueId':_0x6f2bee['id']});});});});});});})['then'](respondWithStatusCode(_0x59bded,null))[_0x677e('0x50')](handleError(_0x59bded,null));};exports[_0x677e('0x8a')]=function(_0x82371a,_0x49ed9c,_0x218773){return db[_0x677e('0x34')]['find']({'where':{'id':_0x82371a[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x49ed9c,null))['then'](function(_0xfc07b9){if(_0xfc07b9){return _0xfc07b9[_0x677e('0x8a')](_0x82371a[_0x677e('0x52')][_0x677e('0x67')],_[_0x677e('0x8b')](_0x82371a[_0x677e('0x52')],['ids','id'])||{})[_0x677e('0x8c')](function(_0x79e0ea){for(var _0x50a65f=0x0;_0x50a65f<_0x82371a[_0x677e('0x52')]['ids']['length'];_0x50a65f+=0x1){socket['emit'](_0x677e('0x71'),{'UserId':Number(_0x82371a[_0x677e('0x52')][_0x677e('0x67')][_0x50a65f]),'SmsQueueId':Number(_0x82371a[_0x677e('0x4c')]['id'])});}return _0x79e0ea;});}})['then'](respondWithResult(_0x49ed9c,null))['catch'](handleError(_0x49ed9c,null));};exports[_0x677e('0x8d')]=function(_0x316104,_0x48c59e,_0x122a82){return db[_0x677e('0x34')][_0x677e('0x4f')]({'where':{'id':_0x316104[_0x677e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48c59e,null))[_0x677e('0x2b')](function(_0x4a5ded){if(_0x4a5ded){return _0x4a5ded[_0x677e('0x8d')](_0x316104['query']['ids'])[_0x677e('0x2b')](function(){if(_[_0x677e('0x8e')](_0x316104[_0x677e('0x3a')][_0x677e('0x67')])){for(var _0x11f41a=0x0;_0x11f41a<_0x316104[_0x677e('0x3a')][_0x677e('0x67')][_0x677e('0x4d')];_0x11f41a+=0x1){socket[_0x677e('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x316104[_0x677e('0x3a')][_0x677e('0x67')][_0x11f41a]),'SmsQueueId':Number(_0x316104['params']['id'])});}}else{socket[_0x677e('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x316104[_0x677e('0x3a')][_0x677e('0x67')]),'SmsQueueId':Number(_0x316104[_0x677e('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x48c59e,null))[_0x677e('0x50')](handleError(_0x48c59e,null));};exports[_0x677e('0x8f')]=function(_0xd330fa,_0x45fcdb,_0x335c41){var _0x3cf834={};var _0x237320={};var _0x19de60;var _0xe8559e;return db[_0x677e('0x34')][_0x677e('0x5c')]({'where':{'id':_0xd330fa[_0x677e('0x4c')]['id']}})[_0x677e('0x2b')](handleEntityNotFound(_0x45fcdb,null))[_0x677e('0x2b')](function(_0x477428){if(_0x477428){_0x19de60=_0x477428;_0x237320[_0x677e('0x38')]=_[_0x677e('0x39')](db[_0x677e('0x68')]['rawAttributes']);_0x237320[_0x677e('0x3a')]=_[_0x677e('0x39')](_0xd330fa[_0x677e('0x3a')]);_0x237320[_0x677e('0x3b')]=_['intersection'](_0x237320['model'],_0x237320[_0x677e('0x3a')]);_0x3cf834[_0x677e('0x3d')]=_[_0x677e('0x3c')](_0x237320[_0x677e('0x38')],qs[_0x677e('0x3e')](_0xd330fa[_0x677e('0x3a')][_0x677e('0x3e')]));_0x3cf834[_0x677e('0x3d')]=_0x3cf834['attributes']['length']?_0x3cf834[_0x677e('0x3d')]:_0x237320[_0x677e('0x38')];_0x3cf834[_0x677e('0x40')]=qs[_0x677e('0x41')](_0xd330fa[_0x677e('0x3a')][_0x677e('0x41')]);_0x3cf834['where']=qs[_0x677e('0x3b')](_[_0x677e('0x43')](_0xd330fa[_0x677e('0x3a')],_0x237320[_0x677e('0x3b')]));if(_0xd330fa[_0x677e('0x3a')][_0x677e('0x44')]){_0x3cf834[_0x677e('0x42')]=_['merge'](_0x3cf834['where'],{'$or':_[_0x677e('0x33')](_0x3cf834[_0x677e('0x3d')],function(_0x2a2386){var _0x949975={};_0x949975[_0x2a2386]={'$like':'%'+_0xd330fa[_0x677e('0x3a')][_0x677e('0x44')]+'%'};return _0x949975;})});}_0x3cf834=_[_0x677e('0x45')]({},_0x3cf834,_0xd330fa[_0x677e('0x47')]);return _0x19de60[_0x677e('0x8f')](_0x3cf834);}})[_0x677e('0x2b')](function(_0x2a163e){if(_0x2a163e){_0xe8559e=_0x2a163e['length'];if(!_0xd330fa[_0x677e('0x3a')][_0x677e('0x5e')]('nolimit')){_0x3cf834[_0x677e('0x24')]=qs[_0x677e('0x24')](_0xd330fa[_0x677e('0x3a')]['limit']);_0x3cf834[_0x677e('0x22')]=qs[_0x677e('0x22')](_0xd330fa[_0x677e('0x3a')][_0x677e('0x22')]);}return _0x19de60['getAgents'](_0x3cf834);}})[_0x677e('0x2b')](function(_0x50acd9){if(_0x50acd9){return _0x50acd9?{'count':_0xe8559e,'rows':_0x50acd9}:null;}})['then'](respondWithResult(_0x45fcdb,null))[_0x677e('0x50')](handleError(_0x45fcdb,null));};
\ No newline at end of file
index 60691f4..62f07d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10fc=['SmsQueue','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x4796a9,_0x30d627){var _0x1858b7=function(_0x409795){while(--_0x409795){_0x4796a9['push'](_0x4796a9['shift']());}};_0x1858b7(++_0x30d627);}(_0x10fc,0x1b1));var _0xc10f=function(_0x4c75e1,_0x1ff897){_0x4c75e1=_0x4c75e1-0x0;var _0x278ad0=_0x10fc[_0x4c75e1];return _0x278ad0;};'use strict';var EventEmitter=require(_0xc10f('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xc10f('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc10f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7a937e){return function(_0x2e79b5,_0x240b33,_0x57ab53){SmsQueueEvents[_0xc10f('0x3')](_0x7a937e+':'+_0x2e79b5['id'],_0x2e79b5);SmsQueueEvents['emit'](_0x7a937e,_0x2e79b5);_0x57ab53(null);};}for(var e in events){if(events[_0xc10f('0x4')](e)){var event=events[e];SmsQueue[_0xc10f('0x5')](e,emitEvent(event));}}module[_0xc10f('0x6')]=SmsQueueEvents;
\ No newline at end of file
+var _0xef0c=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xef0c,0xd1));var _0xcef0=function(_0x2ba510,_0x5310be){_0x2ba510=_0x2ba510-0x0;var _0x1659e7=_0xef0c[_0x2ba510];return _0x1659e7;};'use strict';var EventEmitter=require(_0xcef0('0x0'));var SmsQueue=require(_0xcef0('0x1'))['db'][_0xcef0('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xcef0('0x3')](0x0);var events={'afterCreate':_0xcef0('0x4'),'afterUpdate':_0xcef0('0x5'),'afterDestroy':_0xcef0('0x6')};function emitEvent(_0x32b2a2){return function(_0x1276aa,_0x598d1b,_0x7f6a1a){SmsQueueEvents[_0xcef0('0x7')](_0x32b2a2+':'+_0x1276aa['id'],_0x1276aa);SmsQueueEvents[_0xcef0('0x7')](_0x32b2a2,_0x1276aa);_0x7f6a1a(null);};}for(var e in events){if(events[_0xcef0('0x8')](e)){var event=events[e];SmsQueue[_0xcef0('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index dbabe4b..318497f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1fe=['moment','request-promise','path','../../config/environment','./smsQueue.attributes','exports','sms_queues','lodash','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb1fe,0xa0));var _0xeb1f=function(_0xe73202,_0x24aa8e){_0xe73202=_0xe73202-0x0;var _0x514092=_0xb1fe[_0xe73202];return _0x514092;};'use strict';var _=require(_0xeb1f('0x0'));var util=require('util');var logger=require(_0xeb1f('0x1'))('api');var moment=require(_0xeb1f('0x2'));var BPromise=require('bluebird');var rp=require(_0xeb1f('0x3'));var fs=require('fs');var path=require(_0xeb1f('0x4'));var rimraf=require('rimraf');var config=require(_0xeb1f('0x5'));var attributes=require(_0xeb1f('0x6'));module[_0xeb1f('0x7')]=function(_0xdaa6cc,_0x4e7fa1){return _0xdaa6cc['define']('SmsQueue',attributes,{'tableName':_0xeb1f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5565=['./smsQueue.attributes','exports','define','SmsQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1a281e,_0x3263f5){var _0x1feb78=function(_0x5b85b5){while(--_0x5b85b5){_0x1a281e['push'](_0x1a281e['shift']());}};_0x1feb78(++_0x3263f5);}(_0x5565,0x149));var _0x5556=function(_0x1959ee,_0xeed73c){_0x1959ee=_0x1959ee-0x0;var _0x3d19ff=_0x5565[_0x1959ee];return _0x3d19ff;};'use strict';var _=require('lodash');var util=require(_0x5556('0x0'));var logger=require(_0x5556('0x1'))(_0x5556('0x2'));var moment=require(_0x5556('0x3'));var BPromise=require(_0x5556('0x4'));var rp=require(_0x5556('0x5'));var fs=require('fs');var path=require(_0x5556('0x6'));var rimraf=require(_0x5556('0x7'));var config=require(_0x5556('0x8'));var attributes=require(_0x5556('0x9'));module[_0x5556('0xa')]=function(_0x432573,_0x21e66c){return _0x432573[_0x5556('0xb')](_0x5556('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 61cdfef..b99042a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb495=['debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsQueue','findAll','options','raw','attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','find','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s'];(function(_0x56a81d,_0x7ed51c){var _0xe918bd=function(_0x96dedd){while(--_0x96dedd){_0x56a81d['push'](_0x56a81d['shift']());}};_0xe918bd(++_0x7ed51c);}(_0xb495,0x151));var _0x5b49=function(_0x33a99c,_0x207417){_0x33a99c=_0x33a99c-0x0;var _0x5e45d2=_0xb495[_0x33a99c];return _0x5e45d2;};'use strict';var _=require(_0x5b49('0x0'));var util=require(_0x5b49('0x1'));var moment=require(_0x5b49('0x2'));var BPromise=require(_0x5b49('0x3'));var rs=require(_0x5b49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b49('0x5'))['db'];var utils=require(_0x5b49('0x6'));var logger=require(_0x5b49('0x7'))(_0x5b49('0x8'));var config=require(_0x5b49('0x9'));var jayson=require(_0x5b49('0xa'));var client=jayson[_0x5b49('0xb')][_0x5b49('0xc')]({'port':0x232a});config[_0x5b49('0xd')]=_[_0x5b49('0xe')](config[_0x5b49('0xd')],{'host':_0x5b49('0xf'),'port':0x18eb});var socket=require(_0x5b49('0x10'))(new Redis(config[_0x5b49('0xd')]));require(_0x5b49('0x11'))[_0x5b49('0x12')](socket);function respondWithRpcPromise(_0x233ff5,_0x4e8fc3,_0x433391){return new BPromise(function(_0x3c7abd,_0x4acbe1){return client[_0x5b49('0x13')](_0x233ff5,_0x433391)[_0x5b49('0x14')](function(_0x22a8d3){logger[_0x5b49('0x15')](_0x5b49('0x16'),_0x4e8fc3,'request\x20sent');logger[_0x5b49('0x17')](_0x5b49('0x18'),_0x4e8fc3,_0x5b49('0x19'),JSON[_0x5b49('0x1a')](_0x22a8d3));if(_0x22a8d3[_0x5b49('0x1b')]){if(_0x22a8d3[_0x5b49('0x1b')][_0x5b49('0x1c')]===0x1f4){logger[_0x5b49('0x1b')](_0x5b49('0x16'),_0x4e8fc3,_0x22a8d3[_0x5b49('0x1b')][_0x5b49('0x1d')]);return _0x4acbe1(_0x22a8d3[_0x5b49('0x1b')]['message']);}logger[_0x5b49('0x1b')](_0x5b49('0x16'),_0x4e8fc3,_0x22a8d3['error'][_0x5b49('0x1d')]);return _0x3c7abd(_0x22a8d3[_0x5b49('0x1b')]['message']);}else{logger[_0x5b49('0x15')](_0x5b49('0x16'),_0x4e8fc3,'request\x20sent');_0x3c7abd(_0x22a8d3[_0x5b49('0x1e')][_0x5b49('0x1d')]);}})[_0x5b49('0x1f')](function(_0x12bdf7){logger[_0x5b49('0x1b')](_0x5b49('0x16'),_0x4e8fc3,_0x12bdf7);_0x4acbe1(_0x12bdf7);});});}exports['GetSmsQueue']=function(_0xbfa428){var _0x44b7cc=this;return new Promise(function(_0x4e372d,_0x3042d6){return db[_0x5b49('0x20')][_0x5b49('0x21')]({'raw':_0xbfa428['options']?_0xbfa428[_0x5b49('0x22')][_0x5b49('0x23')]===undefined?!![]:![]:!![],'where':_0xbfa428[_0x5b49('0x22')]?_0xbfa428[_0x5b49('0x22')]['where']||null:null,'attributes':_0xbfa428[_0x5b49('0x22')]?_0xbfa428[_0x5b49('0x22')][_0x5b49('0x24')]||null:null,'limit':_0xbfa428[_0x5b49('0x22')]?_0xbfa428[_0x5b49('0x22')][_0x5b49('0x25')]||null:null,'include':_0xbfa428['options']?_0xbfa428[_0x5b49('0x22')][_0x5b49('0x26')]?_[_0x5b49('0x27')](_0xbfa428[_0x5b49('0x22')][_0x5b49('0x26')],function(_0xdb15e9){return{'model':db[_0xdb15e9[_0x5b49('0x28')]],'as':_0xdb15e9['as'],'attributes':_0xdb15e9[_0x5b49('0x24')],'include':_0xdb15e9[_0x5b49('0x26')]?_[_0x5b49('0x27')](_0xdb15e9[_0x5b49('0x26')],function(_0x3dfe61){return{'model':db[_0x3dfe61['model']],'as':_0x3dfe61['as'],'attributes':_0x3dfe61['attributes'],'include':_0x3dfe61[_0x5b49('0x26')]?_['map'](_0x3dfe61[_0x5b49('0x26')],function(_0x42379e){return{'model':db[_0x42379e[_0x5b49('0x28')]],'as':_0x42379e['as'],'attributes':_0x42379e[_0x5b49('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5b49('0x14')](function(_0x5834bc){logger[_0x5b49('0x15')]('GetSmsQueue',_0xbfa428);logger[_0x5b49('0x17')](_0x5b49('0x29'),_0xbfa428,JSON['stringify'](_0x5834bc));_0x4e372d(_0x5834bc);})[_0x5b49('0x1f')](function(_0x641455){logger[_0x5b49('0x1b')](_0x5b49('0x29'),_0x641455['message'],_0xbfa428);_0x3042d6(_0x44b7cc[_0x5b49('0x1b')](0x1f4,_0x641455['message']));});});};exports[_0x5b49('0x2a')]=function(_0x415ec0){var _0x493d7b=this;return new Promise(function(_0x28c027,_0x52ef23){return db[_0x5b49('0x20')][_0x5b49('0x2b')]({'raw':_0x415ec0['options']?_0x415ec0[_0x5b49('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x415ec0['options']?_0x415ec0['options'][_0x5b49('0x2c')]||null:null,'attributes':_0x415ec0[_0x5b49('0x22')]?_0x415ec0[_0x5b49('0x22')][_0x5b49('0x24')]||null:null,'include':_0x415ec0[_0x5b49('0x22')]?_0x415ec0[_0x5b49('0x22')][_0x5b49('0x26')]?_[_0x5b49('0x27')](_0x415ec0[_0x5b49('0x22')][_0x5b49('0x26')],function(_0x524c58){return{'model':db[_0x524c58[_0x5b49('0x28')]],'as':_0x524c58['as'],'attributes':_0x524c58['attributes'],'include':_0x524c58['include']?_[_0x5b49('0x27')](_0x524c58[_0x5b49('0x26')],function(_0x2fdb3f){return{'model':db[_0x2fdb3f[_0x5b49('0x28')]],'as':_0x2fdb3f['as'],'attributes':_0x2fdb3f[_0x5b49('0x24')],'include':_0x2fdb3f[_0x5b49('0x26')]?_[_0x5b49('0x27')](_0x2fdb3f[_0x5b49('0x26')],function(_0x151c63){return{'model':db[_0x151c63[_0x5b49('0x28')]],'as':_0x151c63['as'],'attributes':_0x151c63[_0x5b49('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5b49('0x14')](function(_0x207f07){logger['info'](_0x5b49('0x2a'),_0x415ec0);logger[_0x5b49('0x17')](_0x5b49('0x2a'),_0x415ec0,JSON[_0x5b49('0x1a')](_0x207f07));_0x28c027(_0x207f07);})[_0x5b49('0x1f')](function(_0x3ea906){logger[_0x5b49('0x1b')](_0x5b49('0x2a'),_0x3ea906[_0x5b49('0x1d')],_0x415ec0);_0x52ef23(_0x493d7b[_0x5b49('0x1b')](0x1f4,_0x3ea906[_0x5b49('0x1d')]));});});};
\ No newline at end of file
+var _0x8e77=['then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','findAll','options','raw','attributes','limit','include','map','model','ShowSmsQueue','SmsQueue','find','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x8e77,0x1f2));var _0x78e7=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x8e77[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0x78e7('0x0'));var util=require(_0x78e7('0x1'));var moment=require(_0x78e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x78e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78e7('0x4'))['db'];var utils=require(_0x78e7('0x5'));var logger=require(_0x78e7('0x6'))(_0x78e7('0x7'));var config=require(_0x78e7('0x8'));var jayson=require(_0x78e7('0x9'));var client=jayson[_0x78e7('0xa')][_0x78e7('0xb')]({'port':0x232a});config[_0x78e7('0xc')]=_[_0x78e7('0xd')](config[_0x78e7('0xc')],{'host':_0x78e7('0xe'),'port':0x18eb});var socket=require(_0x78e7('0xf'))(new Redis(config[_0x78e7('0xc')]));require(_0x78e7('0x10'))['register'](socket);function respondWithRpcPromise(_0x126f15,_0x1b2616,_0x359753){return new BPromise(function(_0x5a9d49,_0x3ca19e){return client[_0x78e7('0x11')](_0x126f15,_0x359753)[_0x78e7('0x12')](function(_0x321c17){logger['info']('SmsQueue,\x20%s,\x20%s',_0x1b2616,'request\x20sent');logger[_0x78e7('0x13')](_0x78e7('0x14'),_0x1b2616,_0x78e7('0x15'),JSON[_0x78e7('0x16')](_0x321c17));if(_0x321c17[_0x78e7('0x17')]){if(_0x321c17[_0x78e7('0x17')][_0x78e7('0x18')]===0x1f4){logger[_0x78e7('0x17')](_0x78e7('0x19'),_0x1b2616,_0x321c17[_0x78e7('0x17')][_0x78e7('0x1a')]);return _0x3ca19e(_0x321c17[_0x78e7('0x17')][_0x78e7('0x1a')]);}logger[_0x78e7('0x17')](_0x78e7('0x19'),_0x1b2616,_0x321c17[_0x78e7('0x17')][_0x78e7('0x1a')]);return _0x5a9d49(_0x321c17[_0x78e7('0x17')]['message']);}else{logger[_0x78e7('0x1b')](_0x78e7('0x19'),_0x1b2616,_0x78e7('0x15'));_0x5a9d49(_0x321c17[_0x78e7('0x1c')][_0x78e7('0x1a')]);}})[_0x78e7('0x1d')](function(_0x5bad80){logger[_0x78e7('0x17')](_0x78e7('0x19'),_0x1b2616,_0x5bad80);_0x3ca19e(_0x5bad80);});});}exports[_0x78e7('0x1e')]=function(_0x1bab4b){var _0x281718=this;return new Promise(function(_0x11572a,_0x35c529){return db['SmsQueue'][_0x78e7('0x1f')]({'raw':_0x1bab4b[_0x78e7('0x20')]?_0x1bab4b[_0x78e7('0x20')][_0x78e7('0x21')]===undefined?!![]:![]:!![],'where':_0x1bab4b[_0x78e7('0x20')]?_0x1bab4b[_0x78e7('0x20')]['where']||null:null,'attributes':_0x1bab4b[_0x78e7('0x20')]?_0x1bab4b[_0x78e7('0x20')][_0x78e7('0x22')]||null:null,'limit':_0x1bab4b[_0x78e7('0x20')]?_0x1bab4b[_0x78e7('0x20')][_0x78e7('0x23')]||null:null,'include':_0x1bab4b['options']?_0x1bab4b[_0x78e7('0x20')][_0x78e7('0x24')]?_[_0x78e7('0x25')](_0x1bab4b['options'][_0x78e7('0x24')],function(_0x3fa99c){return{'model':db[_0x3fa99c[_0x78e7('0x26')]],'as':_0x3fa99c['as'],'attributes':_0x3fa99c[_0x78e7('0x22')],'include':_0x3fa99c[_0x78e7('0x24')]?_[_0x78e7('0x25')](_0x3fa99c[_0x78e7('0x24')],function(_0xe26529){return{'model':db[_0xe26529[_0x78e7('0x26')]],'as':_0xe26529['as'],'attributes':_0xe26529[_0x78e7('0x22')],'include':_0xe26529[_0x78e7('0x24')]?_[_0x78e7('0x25')](_0xe26529[_0x78e7('0x24')],function(_0x1787f6){return{'model':db[_0x1787f6[_0x78e7('0x26')]],'as':_0x1787f6['as'],'attributes':_0x1787f6[_0x78e7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x78e7('0x12')](function(_0x84a34e){logger[_0x78e7('0x1b')]('GetSmsQueue',_0x1bab4b);logger['debug'](_0x78e7('0x1e'),_0x1bab4b,JSON[_0x78e7('0x16')](_0x84a34e));_0x11572a(_0x84a34e);})[_0x78e7('0x1d')](function(_0x22ac1b){logger['error'](_0x78e7('0x1e'),_0x22ac1b[_0x78e7('0x1a')],_0x1bab4b);_0x35c529(_0x281718[_0x78e7('0x17')](0x1f4,_0x22ac1b[_0x78e7('0x1a')]));});});};exports[_0x78e7('0x27')]=function(_0x1971ef){var _0x92a6a=this;return new Promise(function(_0x5d665c,_0xc4b8a0){return db[_0x78e7('0x28')][_0x78e7('0x29')]({'raw':_0x1971ef[_0x78e7('0x20')]?_0x1971ef['options'][_0x78e7('0x21')]===undefined?!![]:![]:!![],'where':_0x1971ef[_0x78e7('0x20')]?_0x1971ef[_0x78e7('0x20')][_0x78e7('0x2a')]||null:null,'attributes':_0x1971ef['options']?_0x1971ef[_0x78e7('0x20')][_0x78e7('0x22')]||null:null,'include':_0x1971ef[_0x78e7('0x20')]?_0x1971ef[_0x78e7('0x20')][_0x78e7('0x24')]?_[_0x78e7('0x25')](_0x1971ef[_0x78e7('0x20')][_0x78e7('0x24')],function(_0x19f86f){return{'model':db[_0x19f86f[_0x78e7('0x26')]],'as':_0x19f86f['as'],'attributes':_0x19f86f['attributes'],'include':_0x19f86f[_0x78e7('0x24')]?_['map'](_0x19f86f[_0x78e7('0x24')],function(_0x11b8b9){return{'model':db[_0x11b8b9[_0x78e7('0x26')]],'as':_0x11b8b9['as'],'attributes':_0x11b8b9[_0x78e7('0x22')],'include':_0x11b8b9['include']?_['map'](_0x11b8b9['include'],function(_0x4d8615){return{'model':db[_0x4d8615['model']],'as':_0x4d8615['as'],'attributes':_0x4d8615['attributes']};}):[]};}):[]};}):[]:[]})[_0x78e7('0x12')](function(_0x3f92a5){logger[_0x78e7('0x1b')](_0x78e7('0x27'),_0x1971ef);logger['debug'](_0x78e7('0x27'),_0x1971ef,JSON[_0x78e7('0x16')](_0x3f92a5));_0x5d665c(_0x3f92a5);})[_0x78e7('0x1d')](function(_0x1a5bff){logger['error'](_0x78e7('0x27'),_0x1a5bff[_0x78e7('0x1a')],_0x1971ef);_0xc4b8a0(_0x92a6a['error'](0x1f4,_0x1a5bff[_0x78e7('0x1a')]));});});};
\ No newline at end of file
index b527007..32ce86a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9cf=['register','length','smsQueue:','./smsQueue.events','save','remove','update','removeListener'];(function(_0x36d64f,_0x125060){var _0x444629=function(_0x2f8025){while(--_0x2f8025){_0x36d64f['push'](_0x36d64f['shift']());}};_0x444629(++_0x125060);}(_0xb9cf,0x14b));var _0xfb9c=function(_0x4dcbef,_0x1aca1c){_0x4dcbef=_0x4dcbef-0x0;var _0x283f61=_0xb9cf[_0x4dcbef];return _0x283f61;};'use strict';var SmsQueueEvents=require(_0xfb9c('0x0'));var events=[_0xfb9c('0x1'),_0xfb9c('0x2'),_0xfb9c('0x3')];function createListener(_0x391623,_0x58d24c){return function(_0x4ac27f){_0x58d24c['emit'](_0x391623,_0x4ac27f);};}function removeListener(_0x3a7434,_0x1845c7){return function(){SmsQueueEvents[_0xfb9c('0x4')](_0x3a7434,_0x1845c7);};}exports[_0xfb9c('0x5')]=function(_0x5a3611){for(var _0x6ce4cc=0x0,_0x3f9b83=events[_0xfb9c('0x6')];_0x6ce4cc<_0x3f9b83;_0x6ce4cc++){var _0x38b187=events[_0x6ce4cc];var _0x328eca=createListener(_0xfb9c('0x7')+_0x38b187,_0x5a3611);SmsQueueEvents['on'](_0x38b187,_0x328eca);}};
\ No newline at end of file
+var _0x18f5=['removeListener','register','length','smsQueue:','./smsQueue.events','remove','update','emit'];(function(_0x12bb90,_0x1d84df){var _0x42338c=function(_0xf86130){while(--_0xf86130){_0x12bb90['push'](_0x12bb90['shift']());}};_0x42338c(++_0x1d84df);}(_0x18f5,0x16c));var _0x518f=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x18f5[_0x5f3f88];return _0xd08119;};'use strict';var SmsQueueEvents=require(_0x518f('0x0'));var events=['save',_0x518f('0x1'),_0x518f('0x2')];function createListener(_0x292101,_0x1233f5){return function(_0x18bca8){_0x1233f5[_0x518f('0x3')](_0x292101,_0x18bca8);};}function removeListener(_0xea2570,_0x28c1fb){return function(){SmsQueueEvents[_0x518f('0x4')](_0xea2570,_0x28c1fb);};}exports[_0x518f('0x5')]=function(_0x11183f){for(var _0x2f839a=0x0,_0x19a0c4=events[_0x518f('0x6')];_0x2f839a<_0x19a0c4;_0x2f839a++){var _0x541579=events[_0x2f839a];var _0x55eeba=createListener(_0x518f('0x7')+_0x541579,_0x11183f);SmsQueueEvents['on'](_0x541579,_0x55eeba);}};
\ No newline at end of file
index 7924c53..d643e0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfc0=['index','/describe','describe','/:id','show','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x9007ea,_0x4094cf){var _0x43f6ee=function(_0x1f5fd4){while(--_0x1f5fd4){_0x9007ea['push'](_0x9007ea['shift']());}};_0x43f6ee(++_0x4094cf);}(_0xbfc0,0x125));var _0x0bfc=function(_0x1894e7,_0x1253e6){_0x1894e7=_0x1894e7-0x0;var _0x5e857f=_0xbfc0[_0x1894e7];return _0x5e857f;};'use strict';var multer=require(_0x0bfc('0x0'));var util=require(_0x0bfc('0x1'));var path=require(_0x0bfc('0x2'));var timeout=require(_0x0bfc('0x3'));var express=require(_0x0bfc('0x4'));var router=express[_0x0bfc('0x5')]();var fs_extra=require(_0x0bfc('0x6'));var auth=require(_0x0bfc('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0bfc('0x8'));var controller=require('./smsQueueReport.controller');router[_0x0bfc('0x9')]('/',auth[_0x0bfc('0xa')](),controller[_0x0bfc('0xb')]);router[_0x0bfc('0x9')](_0x0bfc('0xc'),auth[_0x0bfc('0xa')](),controller[_0x0bfc('0xd')]);router[_0x0bfc('0x9')](_0x0bfc('0xe'),auth['isAuthenticated'](),controller[_0x0bfc('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0bfc('0x10')]('/:id',auth[_0x0bfc('0xa')](),controller['update']);router['delete'](_0x0bfc('0xe'),auth[_0x0bfc('0xa')](),controller[_0x0bfc('0x11')]);module[_0x0bfc('0x12')]=router;
\ No newline at end of file
+var _0x8dbd=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x34e725,_0x5633f8){var _0x57acc4=function(_0x1715c5){while(--_0x1715c5){_0x34e725['push'](_0x34e725['shift']());}};_0x57acc4(++_0x5633f8);}(_0x8dbd,0x159));var _0xd8db=function(_0x74690b,_0x12b33b){_0x74690b=_0x74690b-0x0;var _0x35c4a7=_0x8dbd[_0x74690b];return _0x35c4a7;};'use strict';var multer=require(_0xd8db('0x0'));var util=require(_0xd8db('0x1'));var path=require('path');var timeout=require(_0xd8db('0x2'));var express=require(_0xd8db('0x3'));var router=express[_0xd8db('0x4')]();var fs_extra=require(_0xd8db('0x5'));var auth=require(_0xd8db('0x6'));var interaction=require(_0xd8db('0x7'));var config=require(_0xd8db('0x8'));var controller=require(_0xd8db('0x9'));router[_0xd8db('0xa')]('/',auth[_0xd8db('0xb')](),controller[_0xd8db('0xc')]);router[_0xd8db('0xa')](_0xd8db('0xd'),auth[_0xd8db('0xb')](),controller[_0xd8db('0xe')]);router[_0xd8db('0xa')](_0xd8db('0xf'),auth['isAuthenticated'](),controller[_0xd8db('0x10')]);router[_0xd8db('0x11')]('/',auth[_0xd8db('0xb')](),controller[_0xd8db('0x12')]);router[_0xd8db('0x13')](_0xd8db('0xf'),auth[_0xd8db('0xb')](),controller[_0xd8db('0x14')]);router[_0xd8db('0x15')](_0xd8db('0xf'),auth['isAuthenticated'](),controller[_0xd8db('0x16')]);module[_0xd8db('0x17')]=router;
\ No newline at end of file
index 7062c45..6a85e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6927=['STRING','DATE','moment','exports'];(function(_0x3c99f6,_0x44a9bd){var _0x3feccd=function(_0x215704){while(--_0x215704){_0x3c99f6['push'](_0x3c99f6['shift']());}};_0x3feccd(++_0x44a9bd);}(_0x6927,0xf6));var _0x7692=function(_0x5a367c,_0x30a599){_0x5a367c=_0x5a367c-0x0;var _0x13be54=_0x6927[_0x5a367c];return _0x13be54;};'use strict';var moment=require(_0x7692('0x0'));var Sequelize=require('sequelize');module[_0x7692('0x1')]={'uniqueid':{'type':Sequelize[_0x7692('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7692('0x2')]},'joinAt':{'type':Sequelize[_0x7692('0x3')]},'leaveAt':{'type':Sequelize[_0x7692('0x3')]},'acceptAt':{'type':Sequelize[_0x7692('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7692('0x2')]}};
\ No newline at end of file
+var _0xa5e4=['exports','STRING','DATE','moment','sequelize'];(function(_0x2b0e0f,_0x34c37a){var _0x59585b=function(_0x19a66a){while(--_0x19a66a){_0x2b0e0f['push'](_0x2b0e0f['shift']());}};_0x59585b(++_0x34c37a);}(_0xa5e4,0xee));var _0x4a5e=function(_0x4923b6,_0x3590a7){_0x4923b6=_0x4923b6-0x0;var _0x143ee6=_0xa5e4[_0x4923b6];return _0x143ee6;};'use strict';var moment=require(_0x4a5e('0x0'));var Sequelize=require(_0x4a5e('0x1'));module[_0x4a5e('0x2')]={'uniqueid':{'type':Sequelize[_0x4a5e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x4a5e('0x4')]},'exitAt':{'type':Sequelize[_0x4a5e('0x4')]},'reason':{'type':Sequelize[_0x4a5e('0x3')]}};
\ No newline at end of file
index b50826e..8bcb445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfbc=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','find'];(function(_0x304d22,_0x40537c){var _0x11694b=function(_0x121b59){while(--_0x121b59){_0x304d22['push'](_0x304d22['shift']());}};_0x11694b(++_0x40537c);}(_0xcfbc,0xf0));var _0xccfb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcfbc[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xccfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccfb('0x1'));var jsonpatch=require(_0xccfb('0x2'));var rp=require(_0xccfb('0x3'));var moment=require(_0xccfb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xccfb('0x5'));var util=require(_0xccfb('0x6'));var path=require(_0xccfb('0x7'));var sox=require(_0xccfb('0x8'));var csv=require(_0xccfb('0x9'));var ejs=require(_0xccfb('0xa'));var fs=require('fs');var fs_extra=require(_0xccfb('0xb'));var _=require(_0xccfb('0xc'));var squel=require(_0xccfb('0xd'));var crypto=require(_0xccfb('0xe'));var jsforce=require(_0xccfb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xccfb('0x9'));var querystring=require(_0xccfb('0x10'));var Papa=require(_0xccfb('0x11'));var Redis=require(_0xccfb('0x12'));var authService=require(_0xccfb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xccfb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xccfb('0x15'))(_0xccfb('0x16'));var utils=require(_0xccfb('0x17'));var config=require(_0xccfb('0x18'));var licenseUtil=require(_0xccfb('0x19'));var db=require(_0xccfb('0x1a'))['db'];function respondWithStatusCode(_0x2711b5,_0x512dcf){_0x512dcf=_0x512dcf||0xcc;return function(_0x33c7aa){if(_0x33c7aa){return _0x2711b5[_0xccfb('0x1b')](_0x512dcf);}return _0x2711b5[_0xccfb('0x1c')](_0x512dcf)[_0xccfb('0x1d')]();};}function respondWithResult(_0x36f60c,_0x5f1021){_0x5f1021=_0x5f1021||0xc8;return function(_0x2bc71a){if(_0x2bc71a){return _0x36f60c['status'](_0x5f1021)[_0xccfb('0x1e')](_0x2bc71a);}};}function respondWithFilteredResult(_0x52f462,_0x43cdec){return function(_0x3346ea){if(_0x3346ea){var _0x3f5c2c=typeof _0x43cdec[_0xccfb('0x1f')]===_0xccfb('0x20')&&typeof _0x43cdec[_0xccfb('0x21')]===_0xccfb('0x20');var _0x208259=_0x3346ea[_0xccfb('0x22')];var _0x591d94=_0x3f5c2c?0x0:_0x43cdec[_0xccfb('0x1f')];var _0x5f524c=_0x3f5c2c?_0x3346ea[_0xccfb('0x22')]:_0x43cdec['offset']+_0x43cdec[_0xccfb('0x21')];var _0x6ee579;if(_0x5f524c>=_0x208259){_0x5f524c=_0x208259;_0x6ee579=0xc8;}else{_0x6ee579=0xce;}_0x52f462[_0xccfb('0x1c')](_0x6ee579);return _0x52f462['set'](_0xccfb('0x23'),_0x591d94+'-'+_0x5f524c+'/'+_0x208259)[_0xccfb('0x1e')](_0x3346ea);}return null;};}function patchUpdates(_0x49c17c){return function(_0x2d93e4){try{jsonpatch[_0xccfb('0x24')](_0x2d93e4,_0x49c17c,!![]);}catch(_0x2274cb){return BPromise[_0xccfb('0x25')](_0x2274cb);}return _0x2d93e4[_0xccfb('0x26')]();};}function saveUpdates(_0x936b67,_0x2312ad){return function(_0x28e382){if(_0x28e382){return _0x28e382[_0xccfb('0x27')](_0x936b67)[_0xccfb('0x28')](function(_0x18d103){return _0x18d103;});}return null;};}function removeEntity(_0x73c1c2,_0x96fa92){return function(_0x59612d){if(_0x59612d){return _0x59612d[_0xccfb('0x29')]()[_0xccfb('0x28')](function(){_0x73c1c2[_0xccfb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1a05,_0x23297b){return function(_0x278261){if(!_0x278261){_0x5b1a05[_0xccfb('0x1b')](0x194);}return _0x278261;};}function handleError(_0x16d0b7,_0x524524){_0x524524=_0x524524||0x1f4;return function(_0x17d6da){logger[_0xccfb('0x2a')](_0x17d6da[_0xccfb('0x2b')]);if(_0x17d6da[_0xccfb('0x2c')]){delete _0x17d6da[_0xccfb('0x2c')];}_0x16d0b7[_0xccfb('0x1c')](_0x524524)[_0xccfb('0x2d')](_0x17d6da);};}exports[_0xccfb('0x2e')]=function(_0x1c4881,_0x20fc5e){var _0x4d208d={},_0x16837f={},_0x432f08={'count':0x0,'rows':[]};var _0x24be9e=_[_0xccfb('0x2f')](db['SmsQueueReport'][_0xccfb('0x30')],function(_0x2ec075){return{'name':_0x2ec075[_0xccfb('0x31')],'type':_0x2ec075[_0xccfb('0x32')][_0xccfb('0x33')]};});_0x16837f[_0xccfb('0x34')]=_[_0xccfb('0x2f')](_0x24be9e,_0xccfb('0x2c'));_0x16837f['query']=_[_0xccfb('0x35')](_0x1c4881[_0xccfb('0x36')]);_0x16837f[_0xccfb('0x37')]=_[_0xccfb('0x38')](_0x16837f[_0xccfb('0x34')],_0x16837f[_0xccfb('0x36')]);_0x4d208d['attributes']=_[_0xccfb('0x38')](_0x16837f[_0xccfb('0x34')],qs[_0xccfb('0x39')](_0x1c4881[_0xccfb('0x36')]['fields']));_0x4d208d[_0xccfb('0x3a')]=_0x4d208d[_0xccfb('0x3a')][_0xccfb('0x3b')]?_0x4d208d[_0xccfb('0x3a')]:_0x16837f[_0xccfb('0x34')];if(!_0x1c4881[_0xccfb('0x36')][_0xccfb('0x3c')]('nolimit')){_0x4d208d[_0xccfb('0x21')]=qs['limit'](_0x1c4881[_0xccfb('0x36')][_0xccfb('0x21')]);_0x4d208d['offset']=qs['offset'](_0x1c4881['query'][_0xccfb('0x1f')]);}_0x4d208d[_0xccfb('0x3d')]=qs[_0xccfb('0x3e')](_0x1c4881['query'][_0xccfb('0x3e')]);_0x4d208d['where']=qs['filters'](_[_0xccfb('0x3f')](_0x1c4881[_0xccfb('0x36')],_0x16837f['filters']),_0x24be9e);if(_0x1c4881[_0xccfb('0x36')][_0xccfb('0x40')]){_0x4d208d[_0xccfb('0x41')]=_[_0xccfb('0x42')](_0x4d208d['where'],{'$or':_[_0xccfb('0x2f')](_0x24be9e,function(_0x2cca49){if(_0x2cca49[_0xccfb('0x32')]!==_0xccfb('0x43')){var _0x35d4ee={};_0x35d4ee[_0x2cca49[_0xccfb('0x2c')]]={'$like':'%'+_0x1c4881[_0xccfb('0x36')][_0xccfb('0x40')]+'%'};return _0x35d4ee;}})});}_0x4d208d=_[_0xccfb('0x42')]({},_0x4d208d,_0x1c4881['options']);var _0x12db07={'where':_0x4d208d['where']};return db[_0xccfb('0x44')][_0xccfb('0x22')](_0x12db07)[_0xccfb('0x28')](function(_0x241506){_0x432f08[_0xccfb('0x22')]=_0x241506;if(_0x1c4881[_0xccfb('0x36')][_0xccfb('0x45')]){_0x4d208d[_0xccfb('0x46')]=[{'all':!![]}];}return db[_0xccfb('0x44')][_0xccfb('0x47')](_0x4d208d);})[_0xccfb('0x28')](function(_0x5835f8){_0x432f08[_0xccfb('0x48')]=_0x5835f8;return _0x432f08;})['then'](respondWithFilteredResult(_0x20fc5e,_0x4d208d))[_0xccfb('0x49')](handleError(_0x20fc5e,null));};exports[_0xccfb('0x4a')]=function(_0x57eb3a,_0x6fa99b){var _0x741259={'raw':!![],'where':{'id':_0x57eb3a[_0xccfb('0x4b')]['id']}},_0x52dd93={};_0x52dd93[_0xccfb('0x34')]=_[_0xccfb('0x35')](db['SmsQueueReport'][_0xccfb('0x30')]);_0x52dd93[_0xccfb('0x36')]=_[_0xccfb('0x35')](_0x57eb3a[_0xccfb('0x36')]);_0x52dd93[_0xccfb('0x37')]=_[_0xccfb('0x38')](_0x52dd93[_0xccfb('0x34')],_0x52dd93[_0xccfb('0x36')]);_0x741259[_0xccfb('0x3a')]=_[_0xccfb('0x38')](_0x52dd93[_0xccfb('0x34')],qs['fields'](_0x57eb3a[_0xccfb('0x36')][_0xccfb('0x39')]));_0x741259[_0xccfb('0x3a')]=_0x741259[_0xccfb('0x3a')][_0xccfb('0x3b')]?_0x741259['attributes']:_0x52dd93[_0xccfb('0x34')];if(_0x57eb3a[_0xccfb('0x36')][_0xccfb('0x45')]){_0x741259[_0xccfb('0x46')]=[{'all':!![]}];}_0x741259=_['merge']({},_0x741259,_0x57eb3a[_0xccfb('0x4c')]);return db[_0xccfb('0x44')]['find'](_0x741259)[_0xccfb('0x28')](handleEntityNotFound(_0x6fa99b,null))[_0xccfb('0x28')](respondWithResult(_0x6fa99b,null))[_0xccfb('0x49')](handleError(_0x6fa99b,null));};exports[_0xccfb('0x4d')]=function(_0x1c5704,_0x1cdc26){return db[_0xccfb('0x44')][_0xccfb('0x4d')](_0x1c5704[_0xccfb('0x4e')],{})[_0xccfb('0x28')](respondWithResult(_0x1cdc26,0xc9))['catch'](handleError(_0x1cdc26,null));};exports['update']=function(_0x33be66,_0x27c243){if(_0x33be66['body']['id']){delete _0x33be66[_0xccfb('0x4e')]['id'];}return db[_0xccfb('0x44')][_0xccfb('0x4f')]({'where':{'id':_0x33be66[_0xccfb('0x4b')]['id']}})[_0xccfb('0x28')](handleEntityNotFound(_0x27c243,null))[_0xccfb('0x28')](saveUpdates(_0x33be66[_0xccfb('0x4e')],null))['then'](respondWithResult(_0x27c243,null))[_0xccfb('0x49')](handleError(_0x27c243,null));};exports[_0xccfb('0x29')]=function(_0xba129c,_0x1e6d36){return db[_0xccfb('0x44')][_0xccfb('0x4f')]({'where':{'id':_0xba129c['params']['id']}})[_0xccfb('0x28')](handleEntityNotFound(_0x1e6d36,null))[_0xccfb('0x28')](removeEntity(_0x1e6d36,null))[_0xccfb('0x49')](handleError(_0x1e6d36,null));};exports['describe']=function(_0x4eb2a4,_0xbf63e3){return db[_0xccfb('0x44')]['describe']()[_0xccfb('0x28')](respondWithResult(_0xbf63e3,null))[_0xccfb('0x49')](handleError(_0xbf63e3,null));};
\ No newline at end of file
+var _0xfd81=['pick','filter','merge','options','SmsQueueReport','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch','create','body','describe','eml-format','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters'];(function(_0x5546aa,_0x44fdaa){var _0x1f11b2=function(_0x5be4b4){while(--_0x5be4b4){_0x5546aa['push'](_0x5546aa['shift']());}};_0x1f11b2(++_0x44fdaa);}(_0xfd81,0xa6));var _0x1fd8=function(_0xe1784f,_0x4a4d3e){_0xe1784f=_0xe1784f-0x0;var _0x25e8e2=_0xfd81[_0xe1784f];return _0x25e8e2;};'use strict';var emlformat=require(_0x1fd8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fd8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fd8('0x2'));var moment=require('moment');var BPromise=require(_0x1fd8('0x3'));var Mustache=require('mustache');var util=require(_0x1fd8('0x4'));var path=require(_0x1fd8('0x5'));var sox=require(_0x1fd8('0x6'));var csv=require('to-csv');var ejs=require(_0x1fd8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fd8('0x8'));var squel=require('squel');var crypto=require(_0x1fd8('0x9'));var jsforce=require(_0x1fd8('0xa'));var deskjs=require(_0x1fd8('0xb'));var toCsv=require(_0x1fd8('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fd8('0xd'));var authService=require(_0x1fd8('0xe'));var qs=require(_0x1fd8('0xf'));var as=require(_0x1fd8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fd8('0x11'))(_0x1fd8('0x12'));var utils=require('../../config/utils');var config=require(_0x1fd8('0x13'));var licenseUtil=require(_0x1fd8('0x14'));var db=require(_0x1fd8('0x15'))['db'];function respondWithStatusCode(_0x5bdefb,_0x570433){_0x570433=_0x570433||0xcc;return function(_0x413e7c){if(_0x413e7c){return _0x5bdefb[_0x1fd8('0x16')](_0x570433);}return _0x5bdefb['status'](_0x570433)[_0x1fd8('0x17')]();};}function respondWithResult(_0x24830b,_0x3f8757){_0x3f8757=_0x3f8757||0xc8;return function(_0x4ac6dd){if(_0x4ac6dd){return _0x24830b['status'](_0x3f8757)[_0x1fd8('0x18')](_0x4ac6dd);}};}function respondWithFilteredResult(_0x30c1ac,_0x59f7d2){return function(_0xd7266b){if(_0xd7266b){var _0x4de9ee=typeof _0x59f7d2[_0x1fd8('0x19')]===_0x1fd8('0x1a')&&typeof _0x59f7d2[_0x1fd8('0x1b')]===_0x1fd8('0x1a');var _0x1b2a98=_0xd7266b['count'];var _0x2b9f85=_0x4de9ee?0x0:_0x59f7d2['offset'];var _0x5ab330=_0x4de9ee?_0xd7266b[_0x1fd8('0x1c')]:_0x59f7d2[_0x1fd8('0x19')]+_0x59f7d2[_0x1fd8('0x1b')];var _0x37444c;if(_0x5ab330>=_0x1b2a98){_0x5ab330=_0x1b2a98;_0x37444c=0xc8;}else{_0x37444c=0xce;}_0x30c1ac[_0x1fd8('0x1d')](_0x37444c);return _0x30c1ac[_0x1fd8('0x1e')](_0x1fd8('0x1f'),_0x2b9f85+'-'+_0x5ab330+'/'+_0x1b2a98)[_0x1fd8('0x18')](_0xd7266b);}return null;};}function patchUpdates(_0x1f56c9){return function(_0x913943){try{jsonpatch[_0x1fd8('0x20')](_0x913943,_0x1f56c9,!![]);}catch(_0x4f7e48){return BPromise[_0x1fd8('0x21')](_0x4f7e48);}return _0x913943[_0x1fd8('0x22')]();};}function saveUpdates(_0x3addf2,_0x5b5dc9){return function(_0x31c5be){if(_0x31c5be){return _0x31c5be[_0x1fd8('0x23')](_0x3addf2)['then'](function(_0x502e83){return _0x502e83;});}return null;};}function removeEntity(_0x4aa30c,_0x576e31){return function(_0x2d5e4b){if(_0x2d5e4b){return _0x2d5e4b['destroy']()[_0x1fd8('0x24')](function(){_0x4aa30c[_0x1fd8('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5875fd,_0x5cce89){return function(_0x4514d5){if(!_0x4514d5){_0x5875fd[_0x1fd8('0x16')](0x194);}return _0x4514d5;};}function handleError(_0x430639,_0x2e7c22){_0x2e7c22=_0x2e7c22||0x1f4;return function(_0x831c7a){logger[_0x1fd8('0x25')](_0x831c7a[_0x1fd8('0x26')]);if(_0x831c7a['name']){delete _0x831c7a[_0x1fd8('0x27')];}_0x430639[_0x1fd8('0x1d')](_0x2e7c22)[_0x1fd8('0x28')](_0x831c7a);};}exports[_0x1fd8('0x29')]=function(_0x2041c9,_0xcf2bd1){var _0x1c4d8c={},_0x4b2516={},_0x169502={'count':0x0,'rows':[]};var _0x506d86=_[_0x1fd8('0x2a')](db['SmsQueueReport']['rawAttributes'],function(_0x42c5f3){return{'name':_0x42c5f3[_0x1fd8('0x2b')],'type':_0x42c5f3[_0x1fd8('0x2c')][_0x1fd8('0x2d')]};});_0x4b2516[_0x1fd8('0x2e')]=_[_0x1fd8('0x2a')](_0x506d86,_0x1fd8('0x27'));_0x4b2516[_0x1fd8('0x2f')]=_['keys'](_0x2041c9[_0x1fd8('0x2f')]);_0x4b2516['filters']=_[_0x1fd8('0x30')](_0x4b2516['model'],_0x4b2516[_0x1fd8('0x2f')]);_0x1c4d8c[_0x1fd8('0x31')]=_[_0x1fd8('0x30')](_0x4b2516[_0x1fd8('0x2e')],qs[_0x1fd8('0x32')](_0x2041c9[_0x1fd8('0x2f')][_0x1fd8('0x32')]));_0x1c4d8c[_0x1fd8('0x31')]=_0x1c4d8c['attributes'][_0x1fd8('0x33')]?_0x1c4d8c[_0x1fd8('0x31')]:_0x4b2516['model'];if(!_0x2041c9[_0x1fd8('0x2f')]['hasOwnProperty'](_0x1fd8('0x34'))){_0x1c4d8c[_0x1fd8('0x1b')]=qs[_0x1fd8('0x1b')](_0x2041c9[_0x1fd8('0x2f')]['limit']);_0x1c4d8c[_0x1fd8('0x19')]=qs[_0x1fd8('0x19')](_0x2041c9[_0x1fd8('0x2f')][_0x1fd8('0x19')]);}_0x1c4d8c['order']=qs['sort'](_0x2041c9['query'][_0x1fd8('0x35')]);_0x1c4d8c[_0x1fd8('0x36')]=qs[_0x1fd8('0x37')](_[_0x1fd8('0x38')](_0x2041c9[_0x1fd8('0x2f')],_0x4b2516['filters']),_0x506d86);if(_0x2041c9['query'][_0x1fd8('0x39')]){_0x1c4d8c[_0x1fd8('0x36')]=_[_0x1fd8('0x3a')](_0x1c4d8c[_0x1fd8('0x36')],{'$or':_['map'](_0x506d86,function(_0x147618){if(_0x147618[_0x1fd8('0x2c')]!=='VIRTUAL'){var _0xcfae2d={};_0xcfae2d[_0x147618[_0x1fd8('0x27')]]={'$like':'%'+_0x2041c9[_0x1fd8('0x2f')]['filter']+'%'};return _0xcfae2d;}})});}_0x1c4d8c=_[_0x1fd8('0x3a')]({},_0x1c4d8c,_0x2041c9[_0x1fd8('0x3b')]);var _0x34a7f2={'where':_0x1c4d8c[_0x1fd8('0x36')]};return db[_0x1fd8('0x3c')][_0x1fd8('0x1c')](_0x34a7f2)['then'](function(_0x27fcf4){_0x169502[_0x1fd8('0x1c')]=_0x27fcf4;if(_0x2041c9[_0x1fd8('0x2f')][_0x1fd8('0x3d')]){_0x1c4d8c['include']=[{'all':!![]}];}return db[_0x1fd8('0x3c')][_0x1fd8('0x3e')](_0x1c4d8c);})[_0x1fd8('0x24')](function(_0x188c02){_0x169502[_0x1fd8('0x3f')]=_0x188c02;return _0x169502;})[_0x1fd8('0x24')](respondWithFilteredResult(_0xcf2bd1,_0x1c4d8c))['catch'](handleError(_0xcf2bd1,null));};exports[_0x1fd8('0x40')]=function(_0x27b986,_0x1518b2){var _0x288c63={'raw':!![],'where':{'id':_0x27b986[_0x1fd8('0x41')]['id']}},_0x4985a3={};_0x4985a3[_0x1fd8('0x2e')]=_[_0x1fd8('0x42')](db[_0x1fd8('0x3c')][_0x1fd8('0x43')]);_0x4985a3[_0x1fd8('0x2f')]=_[_0x1fd8('0x42')](_0x27b986['query']);_0x4985a3[_0x1fd8('0x37')]=_['intersection'](_0x4985a3[_0x1fd8('0x2e')],_0x4985a3[_0x1fd8('0x2f')]);_0x288c63['attributes']=_[_0x1fd8('0x30')](_0x4985a3[_0x1fd8('0x2e')],qs[_0x1fd8('0x32')](_0x27b986[_0x1fd8('0x2f')][_0x1fd8('0x32')]));_0x288c63['attributes']=_0x288c63[_0x1fd8('0x31')]['length']?_0x288c63[_0x1fd8('0x31')]:_0x4985a3['model'];if(_0x27b986[_0x1fd8('0x2f')][_0x1fd8('0x3d')]){_0x288c63[_0x1fd8('0x44')]=[{'all':!![]}];}_0x288c63=_[_0x1fd8('0x3a')]({},_0x288c63,_0x27b986['options']);return db[_0x1fd8('0x3c')][_0x1fd8('0x45')](_0x288c63)[_0x1fd8('0x24')](handleEntityNotFound(_0x1518b2,null))[_0x1fd8('0x24')](respondWithResult(_0x1518b2,null))[_0x1fd8('0x46')](handleError(_0x1518b2,null));};exports['create']=function(_0x41eb5e,_0x2b913e){return db[_0x1fd8('0x3c')][_0x1fd8('0x47')](_0x41eb5e[_0x1fd8('0x48')],{})[_0x1fd8('0x24')](respondWithResult(_0x2b913e,0xc9))[_0x1fd8('0x46')](handleError(_0x2b913e,null));};exports['update']=function(_0x36e4db,_0x3b4759){if(_0x36e4db['body']['id']){delete _0x36e4db[_0x1fd8('0x48')]['id'];}return db['SmsQueueReport'][_0x1fd8('0x45')]({'where':{'id':_0x36e4db[_0x1fd8('0x41')]['id']}})[_0x1fd8('0x24')](handleEntityNotFound(_0x3b4759,null))[_0x1fd8('0x24')](saveUpdates(_0x36e4db[_0x1fd8('0x48')],null))[_0x1fd8('0x24')](respondWithResult(_0x3b4759,null))[_0x1fd8('0x46')](handleError(_0x3b4759,null));};exports['destroy']=function(_0x5d6c4e,_0x182264){return db['SmsQueueReport'][_0x1fd8('0x45')]({'where':{'id':_0x5d6c4e[_0x1fd8('0x41')]['id']}})['then'](handleEntityNotFound(_0x182264,null))[_0x1fd8('0x24')](removeEntity(_0x182264,null))[_0x1fd8('0x46')](handleError(_0x182264,null));};exports[_0x1fd8('0x49')]=function(_0x13eecc,_0xe4725e){return db[_0x1fd8('0x3c')][_0x1fd8('0x49')]()[_0x1fd8('0x24')](respondWithResult(_0xe4725e,null))[_0x1fd8('0x46')](handleError(_0xe4725e,null));};
\ No newline at end of file
index 5aac525..b262709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d2450,_0x15d4a4){var _0x394ef3=function(_0x4cb4c9){while(--_0x4cb4c9){_0x5d2450['push'](_0x5d2450['shift']());}};_0x394ef3(++_0x15d4a4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x3ddce3,_0x547f1f){var _0x21ed2f=function(_0x4fdf38){while(--_0x4fdf38){_0x3ddce3['push'](_0x3ddce3['shift']());}};_0x21ed2f(++_0x547f1f);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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 5e3bb26..3a6ae8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a3c=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','then','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x347884,_0xd8ef37){var _0x2cd3fa=function(_0xbeb1b8){while(--_0xbeb1b8){_0x347884['push'](_0x347884['shift']());}};_0x2cd3fa(++_0xd8ef37);}(_0x9a3c,0x1a0));var _0xc9a3=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x9a3c[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0xc9a3('0x0'));var util=require(_0xc9a3('0x1'));var moment=require(_0xc9a3('0x2'));var BPromise=require(_0xc9a3('0x3'));var rs=require(_0xc9a3('0x4'));var fs=require('fs');var Redis=require(_0xc9a3('0x5'));var db=require(_0xc9a3('0x6'))['db'];var utils=require(_0xc9a3('0x7'));var logger=require(_0xc9a3('0x8'))(_0xc9a3('0x9'));var config=require(_0xc9a3('0xa'));var jayson=require(_0xc9a3('0xb'));var client=jayson[_0xc9a3('0xc')][_0xc9a3('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x338b37,_0x9e4fac,_0x2df2e2){return new BPromise(function(_0x4e4eee,_0x2102e2){return client['request'](_0x338b37,_0x2df2e2)['then'](function(_0x1a678c){logger[_0xc9a3('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x9e4fac,_0xc9a3('0xf'));logger[_0xc9a3('0x10')](_0xc9a3('0x11'),_0x9e4fac,_0xc9a3('0xf'),JSON[_0xc9a3('0x12')](_0x1a678c));if(_0x1a678c[_0xc9a3('0x13')]){if(_0x1a678c[_0xc9a3('0x13')][_0xc9a3('0x14')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x9e4fac,_0x1a678c[_0xc9a3('0x13')][_0xc9a3('0x15')]);return _0x2102e2(_0x1a678c['error'][_0xc9a3('0x15')]);}logger[_0xc9a3('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x9e4fac,_0x1a678c[_0xc9a3('0x13')][_0xc9a3('0x15')]);return _0x4e4eee(_0x1a678c[_0xc9a3('0x13')][_0xc9a3('0x15')]);}else{logger[_0xc9a3('0xe')](_0xc9a3('0x16'),_0x9e4fac,_0xc9a3('0xf'));_0x4e4eee(_0x1a678c[_0xc9a3('0x17')]['message']);}})[_0xc9a3('0x18')](function(_0x1fb0c1){logger[_0xc9a3('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x9e4fac,_0x1fb0c1);_0x2102e2(_0x1fb0c1);});});}exports[_0xc9a3('0x19')]=function(_0x2fc2dd){var _0x2c700b=this;return new Promise(function(_0xbd2f69,_0x234dba){return db[_0xc9a3('0x1a')]['create'](_0x2fc2dd[_0xc9a3('0x1b')],{'raw':_0x2fc2dd['options']?_0x2fc2dd[_0xc9a3('0x1c')][_0xc9a3('0x1d')]===undefined?!![]:![]:!![]})[_0xc9a3('0x1e')](function(_0x2d6286){logger[_0xc9a3('0xe')](_0xc9a3('0x19'),_0x2fc2dd);logger['debug'](_0xc9a3('0x19'),_0x2fc2dd,JSON[_0xc9a3('0x12')](_0x2d6286));_0xbd2f69(_0x2d6286);})['catch'](function(_0x4effd9){logger['error'](_0xc9a3('0x19'),_0x4effd9[_0xc9a3('0x15')],_0x2fc2dd);_0x234dba(_0x2c700b[_0xc9a3('0x13')](0x1f4,_0x4effd9['message']));});});};exports[_0xc9a3('0x1f')]=function(_0x48d3f6){var _0x246688=this;return new Promise(function(_0x5caa4e,_0x383076){return db[_0xc9a3('0x1a')][_0xc9a3('0x20')](_0x48d3f6['body'],{'raw':_0x48d3f6[_0xc9a3('0x1c')]?_0x48d3f6['options'][_0xc9a3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48d3f6[_0xc9a3('0x1c')]?_0x48d3f6[_0xc9a3('0x1c')][_0xc9a3('0x21')]||null:null,'attributes':_0x48d3f6[_0xc9a3('0x1c')]?_0x48d3f6[_0xc9a3('0x1c')][_0xc9a3('0x22')]||null:null,'limit':_0x48d3f6['options']?_0x48d3f6[_0xc9a3('0x1c')][_0xc9a3('0x23')]||null:null})[_0xc9a3('0x1e')](function(_0x2cac39){logger[_0xc9a3('0xe')](_0xc9a3('0x1f'),_0x48d3f6);logger['debug'](_0xc9a3('0x1f'),_0x48d3f6,JSON[_0xc9a3('0x12')](_0x2cac39));_0x5caa4e(_0x2cac39);})[_0xc9a3('0x18')](function(_0x415588){logger['error'](_0xc9a3('0x1f'),_0x415588[_0xc9a3('0x15')],_0x48d3f6);_0x383076(_0x246688[_0xc9a3('0x13')](0x1f4,_0x415588['message']));});});};
\ No newline at end of file
+var _0xc5cb=['../../config/environment','jayson/promise','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x34ad03,_0x348ed6){var _0x1a4399=function(_0xe37dc1){while(--_0xe37dc1){_0x34ad03['push'](_0x34ad03['shift']());}};_0x1a4399(++_0x348ed6);}(_0xc5cb,0x16d));var _0xbc5c=function(_0xc8f565,_0xe0e55f){_0xc8f565=_0xc8f565-0x0;var _0x58209f=_0xc5cb[_0xc8f565];return _0x58209f;};'use strict';var _=require(_0xbc5c('0x0'));var util=require('util');var moment=require(_0xbc5c('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc5c('0x2'));var fs=require('fs');var Redis=require(_0xbc5c('0x3'));var db=require(_0xbc5c('0x4'))['db'];var utils=require(_0xbc5c('0x5'));var logger=require(_0xbc5c('0x6'))('rpc');var config=require(_0xbc5c('0x7'));var jayson=require(_0xbc5c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe00a,_0x48ed81,_0x41c68c){return new BPromise(function(_0xd91ba7,_0x384f0a){return client[_0xbc5c('0x9')](_0x3fe00a,_0x41c68c)['then'](function(_0x10da9a){logger[_0xbc5c('0xa')](_0xbc5c('0xb'),_0x48ed81,_0xbc5c('0xc'));logger[_0xbc5c('0xd')](_0xbc5c('0xe'),_0x48ed81,_0xbc5c('0xc'),JSON[_0xbc5c('0xf')](_0x10da9a));if(_0x10da9a[_0xbc5c('0x10')]){if(_0x10da9a[_0xbc5c('0x10')]['code']===0x1f4){logger[_0xbc5c('0x10')](_0xbc5c('0xb'),_0x48ed81,_0x10da9a['error'][_0xbc5c('0x11')]);return _0x384f0a(_0x10da9a[_0xbc5c('0x10')][_0xbc5c('0x11')]);}logger[_0xbc5c('0x10')](_0xbc5c('0xb'),_0x48ed81,_0x10da9a[_0xbc5c('0x10')][_0xbc5c('0x11')]);return _0xd91ba7(_0x10da9a[_0xbc5c('0x10')][_0xbc5c('0x11')]);}else{logger[_0xbc5c('0xa')](_0xbc5c('0xb'),_0x48ed81,_0xbc5c('0xc'));_0xd91ba7(_0x10da9a[_0xbc5c('0x12')]['message']);}})[_0xbc5c('0x13')](function(_0x254351){logger[_0xbc5c('0x10')](_0xbc5c('0xb'),_0x48ed81,_0x254351);_0x384f0a(_0x254351);});});}exports['CreateSmsQueueReport']=function(_0x1ef8b7){var _0x3413fd=this;return new Promise(function(_0x357cdb,_0x28811b){return db[_0xbc5c('0x14')][_0xbc5c('0x15')](_0x1ef8b7[_0xbc5c('0x16')],{'raw':_0x1ef8b7[_0xbc5c('0x17')]?_0x1ef8b7['options'][_0xbc5c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x76ef9a){logger[_0xbc5c('0xa')]('CreateSmsQueueReport',_0x1ef8b7);logger[_0xbc5c('0xd')](_0xbc5c('0x19'),_0x1ef8b7,JSON[_0xbc5c('0xf')](_0x76ef9a));_0x357cdb(_0x76ef9a);})[_0xbc5c('0x13')](function(_0x1d975e){logger[_0xbc5c('0x10')](_0xbc5c('0x19'),_0x1d975e[_0xbc5c('0x11')],_0x1ef8b7);_0x28811b(_0x3413fd[_0xbc5c('0x10')](0x1f4,_0x1d975e[_0xbc5c('0x11')]));});});};exports[_0xbc5c('0x1a')]=function(_0x273354){var _0x24c082=this;return new Promise(function(_0x458882,_0x1a1aa1){return db[_0xbc5c('0x14')][_0xbc5c('0x1b')](_0x273354['body'],{'raw':_0x273354[_0xbc5c('0x17')]?_0x273354['options'][_0xbc5c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x273354[_0xbc5c('0x17')]?_0x273354[_0xbc5c('0x17')][_0xbc5c('0x1c')]||null:null,'attributes':_0x273354['options']?_0x273354[_0xbc5c('0x17')][_0xbc5c('0x1d')]||null:null,'limit':_0x273354[_0xbc5c('0x17')]?_0x273354[_0xbc5c('0x17')][_0xbc5c('0x1e')]||null:null})['then'](function(_0x396606){logger[_0xbc5c('0xa')](_0xbc5c('0x1a'),_0x273354);logger[_0xbc5c('0xd')]('UpdateSmsQueueReport',_0x273354,JSON['stringify'](_0x396606));_0x458882(_0x396606);})[_0xbc5c('0x13')](function(_0x442959){logger[_0xbc5c('0x10')](_0xbc5c('0x1a'),_0x442959[_0xbc5c('0x11')],_0x273354);_0x1a1aa1(_0x24c082[_0xbc5c('0x10')](0x1f4,_0x442959[_0xbc5c('0x11')]));});});};
\ No newline at end of file
index 2a8cb2f..7918613 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe132=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe132,0x162));var _0x2e13=function(_0x3a1083,_0x175e1f){_0x3a1083=_0x3a1083-0x0;var _0x179a6d=_0xe132[_0x3a1083];return _0x179a6d;};'use strict';var multer=require(_0x2e13('0x0'));var util=require('util');var path=require(_0x2e13('0x1'));var timeout=require(_0x2e13('0x2'));var express=require(_0x2e13('0x3'));var router=express[_0x2e13('0x4')]();var fs_extra=require(_0x2e13('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0x9')]);router[_0x2e13('0xa')](_0x2e13('0xb'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xc')]);router[_0x2e13('0xa')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xe')]);router['post']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0xf')]);router[_0x2e13('0x10')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x11')]);router[_0x2e13('0x12')]('/:id',auth[_0x2e13('0x8')](),controller[_0x2e13('0x13')]);module[_0x2e13('0x14')]=router;
\ No newline at end of file
+var _0x56a4=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x453eb3,_0x4d8a42){var _0x34ebb7=function(_0x53121c){while(--_0x53121c){_0x453eb3['push'](_0x453eb3['shift']());}};_0x34ebb7(++_0x4d8a42);}(_0x56a4,0x11b));var _0x456a=function(_0x16c2b1,_0x36a70c){_0x16c2b1=_0x16c2b1-0x0;var _0x199ac4=_0x56a4[_0x16c2b1];return _0x199ac4;};'use strict';var multer=require(_0x456a('0x0'));var util=require(_0x456a('0x1'));var path=require('path');var timeout=require(_0x456a('0x2'));var express=require(_0x456a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x456a('0x4'));var interaction=require(_0x456a('0x5'));var config=require(_0x456a('0x6'));var controller=require(_0x456a('0x7'));router[_0x456a('0x8')]('/',auth['isAuthenticated'](),controller[_0x456a('0x9')]);router['get']('/describe',auth[_0x456a('0xa')](),controller[_0x456a('0xb')]);router[_0x456a('0x8')]('/:id',auth[_0x456a('0xa')](),controller['show']);router[_0x456a('0xc')]('/',auth[_0x456a('0xa')](),controller[_0x456a('0xd')]);router[_0x456a('0xe')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x10')]);router[_0x456a('0x11')](_0x456a('0xf'),auth[_0x456a('0xa')](),controller[_0x456a('0x12')]);module['exports']=router;
\ No newline at end of file
index 73d78cd..384246a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0xc77819,_0x139fdc){var _0x1c9434=function(_0x11d15d){while(--_0x11d15d){_0xc77819['push'](_0xc77819['shift']());}};_0x1c9434(++_0x139fdc);}(_0x9bde,0xe1));var _0xe9bd=function(_0xd08cdf,_0x1b73d2){_0xd08cdf=_0xd08cdf-0x0;var _0x5ca766=_0x9bde[_0xd08cdf];return _0x5ca766;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x232a4a,_0x5220dd){_0x232a4a=_0x232a4a-0x0;var _0x3eb908=_0xb43b[_0x232a4a];return _0x3eb908;};'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 c1164ab..530ba5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fd3=['filter','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x4a0f60,_0x298c30){var _0x59b579=function(_0x28e479){while(--_0x28e479){_0x4a0f60['push'](_0x4a0f60['shift']());}};_0x59b579(++_0x298c30);}(_0x8fd3,0xa2));var _0x38fd=function(_0x596684,_0x113a46){_0x596684=_0x596684-0x0;var _0x2f1664=_0x8fd3[_0x596684];return _0x2f1664;};'use strict';var emlformat=require(_0x38fd('0x0'));var rimraf=require(_0x38fd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x38fd('0x2'));var moment=require('moment');var BPromise=require(_0x38fd('0x3'));var Mustache=require(_0x38fd('0x4'));var util=require(_0x38fd('0x5'));var path=require(_0x38fd('0x6'));var sox=require(_0x38fd('0x7'));var csv=require(_0x38fd('0x8'));var ejs=require(_0x38fd('0x9'));var fs=require('fs');var fs_extra=require(_0x38fd('0xa'));var _=require('lodash');var squel=require(_0x38fd('0xb'));var crypto=require(_0x38fd('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x38fd('0x8'));var querystring=require(_0x38fd('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x38fd('0xe'));var qs=require(_0x38fd('0xf'));var as=require(_0x38fd('0x10'));var hardwareService=require(_0x38fd('0x11'));var logger=require('../../config/logger')(_0x38fd('0x12'));var utils=require(_0x38fd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x38fd('0x14'));var db=require(_0x38fd('0x15'))['db'];function respondWithStatusCode(_0x44c695,_0xc176f8){_0xc176f8=_0xc176f8||0xcc;return function(_0x37b18b){if(_0x37b18b){return _0x44c695[_0x38fd('0x16')](_0xc176f8);}return _0x44c695[_0x38fd('0x17')](_0xc176f8)[_0x38fd('0x18')]();};}function respondWithResult(_0x2d9bcc,_0x128e24){_0x128e24=_0x128e24||0xc8;return function(_0x4c52f5){if(_0x4c52f5){return _0x2d9bcc['status'](_0x128e24)['json'](_0x4c52f5);}};}function respondWithFilteredResult(_0x674e5a,_0x2644c2){return function(_0x213f0a){if(_0x213f0a){var _0xa1f038=typeof _0x2644c2[_0x38fd('0x19')]===_0x38fd('0x1a')&&typeof _0x2644c2['limit']===_0x38fd('0x1a');var _0x1d4a11=_0x213f0a['count'];var _0x21c414=_0xa1f038?0x0:_0x2644c2['offset'];var _0xe73829=_0xa1f038?_0x213f0a[_0x38fd('0x1b')]:_0x2644c2[_0x38fd('0x19')]+_0x2644c2['limit'];var _0x32d2b6;if(_0xe73829>=_0x1d4a11){_0xe73829=_0x1d4a11;_0x32d2b6=0xc8;}else{_0x32d2b6=0xce;}_0x674e5a['status'](_0x32d2b6);return _0x674e5a['set'](_0x38fd('0x1c'),_0x21c414+'-'+_0xe73829+'/'+_0x1d4a11)[_0x38fd('0x1d')](_0x213f0a);}return null;};}function patchUpdates(_0x45d1eb){return function(_0x331140){try{jsonpatch[_0x38fd('0x1e')](_0x331140,_0x45d1eb,!![]);}catch(_0x489967){return BPromise[_0x38fd('0x1f')](_0x489967);}return _0x331140[_0x38fd('0x20')]();};}function saveUpdates(_0x367979,_0x4b8af7){return function(_0x2afb7f){if(_0x2afb7f){return _0x2afb7f['update'](_0x367979)[_0x38fd('0x21')](function(_0x3ec24b){return _0x3ec24b;});}return null;};}function removeEntity(_0x4a67e0,_0x25d5f6){return function(_0x23c136){if(_0x23c136){return _0x23c136['destroy']()[_0x38fd('0x21')](function(){_0x4a67e0[_0x38fd('0x17')](0xcc)[_0x38fd('0x18')]();});}};}function handleEntityNotFound(_0x27b02e,_0x3d824d){return function(_0x315e9b){if(!_0x315e9b){_0x27b02e[_0x38fd('0x16')](0x194);}return _0x315e9b;};}function handleError(_0x286220,_0x1ef8ab){_0x1ef8ab=_0x1ef8ab||0x1f4;return function(_0x4053b6){logger[_0x38fd('0x22')](_0x4053b6[_0x38fd('0x23')]);if(_0x4053b6[_0x38fd('0x24')]){delete _0x4053b6['name'];}_0x286220[_0x38fd('0x17')](_0x1ef8ab)[_0x38fd('0x25')](_0x4053b6);};}exports[_0x38fd('0x26')]=function(_0x5dee21,_0x1664bb){var _0x315aca={},_0x2e9265={},_0x2efe2e={'count':0x0,'rows':[]};var _0x2eb1d6=_[_0x38fd('0x27')](db[_0x38fd('0x28')][_0x38fd('0x29')],function(_0x49fdf0){return{'name':_0x49fdf0['fieldName'],'type':_0x49fdf0[_0x38fd('0x2a')][_0x38fd('0x2b')]};});_0x2e9265[_0x38fd('0x2c')]=_[_0x38fd('0x27')](_0x2eb1d6,_0x38fd('0x24'));_0x2e9265[_0x38fd('0x2d')]=_['keys'](_0x5dee21[_0x38fd('0x2d')]);_0x2e9265[_0x38fd('0x2e')]=_[_0x38fd('0x2f')](_0x2e9265[_0x38fd('0x2c')],_0x2e9265[_0x38fd('0x2d')]);_0x315aca[_0x38fd('0x30')]=_[_0x38fd('0x2f')](_0x2e9265['model'],qs[_0x38fd('0x31')](_0x5dee21[_0x38fd('0x2d')]['fields']));_0x315aca['attributes']=_0x315aca[_0x38fd('0x30')][_0x38fd('0x32')]?_0x315aca[_0x38fd('0x30')]:_0x2e9265['model'];if(!_0x5dee21[_0x38fd('0x2d')][_0x38fd('0x33')](_0x38fd('0x34'))){_0x315aca[_0x38fd('0x35')]=qs[_0x38fd('0x35')](_0x5dee21[_0x38fd('0x2d')][_0x38fd('0x35')]);_0x315aca[_0x38fd('0x19')]=qs[_0x38fd('0x19')](_0x5dee21['query'][_0x38fd('0x19')]);}_0x315aca[_0x38fd('0x36')]=qs[_0x38fd('0x37')](_0x5dee21[_0x38fd('0x2d')][_0x38fd('0x37')]);_0x315aca[_0x38fd('0x38')]=qs['filters'](_[_0x38fd('0x39')](_0x5dee21[_0x38fd('0x2d')],_0x2e9265['filters']),_0x2eb1d6);if(_0x5dee21['query']['filter']){_0x315aca[_0x38fd('0x38')]=_[_0x38fd('0x3a')](_0x315aca['where'],{'$or':_['map'](_0x2eb1d6,function(_0x20eff5){if(_0x20eff5[_0x38fd('0x2a')]!==_0x38fd('0x3b')){var _0x3e5b72={};_0x3e5b72[_0x20eff5['name']]={'$like':'%'+_0x5dee21[_0x38fd('0x2d')][_0x38fd('0x3c')]+'%'};return _0x3e5b72;}})});}_0x315aca=_['merge']({},_0x315aca,_0x5dee21['options']);var _0x4df0f1={'where':_0x315aca['where']};return db[_0x38fd('0x28')]['count'](_0x4df0f1)[_0x38fd('0x21')](function(_0x5224ac){_0x2efe2e['count']=_0x5224ac;if(_0x5dee21[_0x38fd('0x2d')][_0x38fd('0x3d')]){_0x315aca['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0x38fd('0x3e')](_0x315aca);})[_0x38fd('0x21')](function(_0x5434ea){_0x2efe2e[_0x38fd('0x3f')]=_0x5434ea;return _0x2efe2e;})[_0x38fd('0x21')](respondWithFilteredResult(_0x1664bb,_0x315aca))[_0x38fd('0x40')](handleError(_0x1664bb,null));};exports[_0x38fd('0x41')]=function(_0x46c7e4,_0x4db923){var _0xbc16a8={'raw':!![],'where':{'id':_0x46c7e4[_0x38fd('0x42')]['id']}},_0x48cfb4={};_0x48cfb4[_0x38fd('0x2c')]=_['keys'](db['SmsTransferReport'][_0x38fd('0x29')]);_0x48cfb4['query']=_['keys'](_0x46c7e4[_0x38fd('0x2d')]);_0x48cfb4['filters']=_[_0x38fd('0x2f')](_0x48cfb4['model'],_0x48cfb4[_0x38fd('0x2d')]);_0xbc16a8[_0x38fd('0x30')]=_[_0x38fd('0x2f')](_0x48cfb4[_0x38fd('0x2c')],qs[_0x38fd('0x31')](_0x46c7e4[_0x38fd('0x2d')]['fields']));_0xbc16a8['attributes']=_0xbc16a8[_0x38fd('0x30')]['length']?_0xbc16a8['attributes']:_0x48cfb4[_0x38fd('0x2c')];if(_0x46c7e4[_0x38fd('0x2d')]['includeAll']){_0xbc16a8[_0x38fd('0x43')]=[{'all':!![]}];}_0xbc16a8=_[_0x38fd('0x3a')]({},_0xbc16a8,_0x46c7e4[_0x38fd('0x44')]);return db['SmsTransferReport'][_0x38fd('0x45')](_0xbc16a8)[_0x38fd('0x21')](handleEntityNotFound(_0x4db923,null))[_0x38fd('0x21')](respondWithResult(_0x4db923,null))['catch'](handleError(_0x4db923,null));};exports[_0x38fd('0x46')]=function(_0x9be94a,_0x1cb217){return db[_0x38fd('0x28')][_0x38fd('0x46')](_0x9be94a[_0x38fd('0x47')],{})[_0x38fd('0x21')](respondWithResult(_0x1cb217,0xc9))[_0x38fd('0x40')](handleError(_0x1cb217,null));};exports[_0x38fd('0x48')]=function(_0x368538,_0x21657e){if(_0x368538[_0x38fd('0x47')]['id']){delete _0x368538[_0x38fd('0x47')]['id'];}return db[_0x38fd('0x28')][_0x38fd('0x45')]({'where':{'id':_0x368538[_0x38fd('0x42')]['id']}})[_0x38fd('0x21')](handleEntityNotFound(_0x21657e,null))[_0x38fd('0x21')](saveUpdates(_0x368538['body'],null))['then'](respondWithResult(_0x21657e,null))['catch'](handleError(_0x21657e,null));};exports['destroy']=function(_0x5856f2,_0x4ea838){return db[_0x38fd('0x28')][_0x38fd('0x45')]({'where':{'id':_0x5856f2[_0x38fd('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ea838,null))['then'](removeEntity(_0x4ea838,null))[_0x38fd('0x40')](handleError(_0x4ea838,null));};exports[_0x38fd('0x49')]=function(_0x10ac21,_0x38719c){return db[_0x38fd('0x28')][_0x38fd('0x49')]()['then'](respondWithResult(_0x38719c,null))[_0x38fd('0x40')](handleError(_0x38719c,null));};
\ No newline at end of file
+var _0xbdbe=['SmsTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','show','include','merge','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','stack','send','index','map'];(function(_0x18d9e9,_0x4e112b){var _0x31cc73=function(_0x428b4c){while(--_0x428b4c){_0x18d9e9['push'](_0x18d9e9['shift']());}};_0x31cc73(++_0x4e112b);}(_0xbdbe,0x153));var _0xebdb=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xbdbe[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require(_0xebdb('0x0'));var rimraf=require(_0xebdb('0x1'));var zipdir=require(_0xebdb('0x2'));var jsonpatch=require(_0xebdb('0x3'));var rp=require(_0xebdb('0x4'));var moment=require(_0xebdb('0x5'));var BPromise=require(_0xebdb('0x6'));var Mustache=require('mustache');var util=require(_0xebdb('0x7'));var path=require(_0xebdb('0x8'));var sox=require('sox');var csv=require(_0xebdb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebdb('0xa'));var _=require(_0xebdb('0xb'));var squel=require(_0xebdb('0xc'));var crypto=require(_0xebdb('0xd'));var jsforce=require(_0xebdb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xebdb('0x9'));var querystring=require(_0xebdb('0xf'));var Papa=require(_0xebdb('0x10'));var Redis=require(_0xebdb('0x11'));var authService=require(_0xebdb('0x12'));var qs=require(_0xebdb('0x13'));var as=require(_0xebdb('0x14'));var hardwareService=require(_0xebdb('0x15'));var logger=require(_0xebdb('0x16'))(_0xebdb('0x17'));var utils=require('../../config/utils');var config=require(_0xebdb('0x18'));var licenseUtil=require(_0xebdb('0x19'));var db=require(_0xebdb('0x1a'))['db'];function respondWithStatusCode(_0x1a6446,_0x22d861){_0x22d861=_0x22d861||0xcc;return function(_0x12af6f){if(_0x12af6f){return _0x1a6446[_0xebdb('0x1b')](_0x22d861);}return _0x1a6446[_0xebdb('0x1c')](_0x22d861)[_0xebdb('0x1d')]();};}function respondWithResult(_0x42b8b6,_0x310703){_0x310703=_0x310703||0xc8;return function(_0x36f8bb){if(_0x36f8bb){return _0x42b8b6[_0xebdb('0x1c')](_0x310703)['json'](_0x36f8bb);}};}function respondWithFilteredResult(_0x1faae4,_0x13b792){return function(_0x132199){if(_0x132199){var _0x283dea=typeof _0x13b792[_0xebdb('0x1e')]===_0xebdb('0x1f')&&typeof _0x13b792[_0xebdb('0x20')]==='undefined';var _0x2feb8d=_0x132199['count'];var _0x51d670=_0x283dea?0x0:_0x13b792[_0xebdb('0x1e')];var _0x363d2e=_0x283dea?_0x132199[_0xebdb('0x21')]:_0x13b792[_0xebdb('0x1e')]+_0x13b792[_0xebdb('0x20')];var _0x4ac043;if(_0x363d2e>=_0x2feb8d){_0x363d2e=_0x2feb8d;_0x4ac043=0xc8;}else{_0x4ac043=0xce;}_0x1faae4[_0xebdb('0x1c')](_0x4ac043);return _0x1faae4[_0xebdb('0x22')](_0xebdb('0x23'),_0x51d670+'-'+_0x363d2e+'/'+_0x2feb8d)[_0xebdb('0x24')](_0x132199);}return null;};}function patchUpdates(_0x508dfe){return function(_0x3543c7){try{jsonpatch[_0xebdb('0x25')](_0x3543c7,_0x508dfe,!![]);}catch(_0x26dd54){return BPromise[_0xebdb('0x26')](_0x26dd54);}return _0x3543c7['save']();};}function saveUpdates(_0xe43d8b,_0x489464){return function(_0x2199b6){if(_0x2199b6){return _0x2199b6[_0xebdb('0x27')](_0xe43d8b)[_0xebdb('0x28')](function(_0x129a79){return _0x129a79;});}return null;};}function removeEntity(_0x358bd6,_0x2887ac){return function(_0x461f41){if(_0x461f41){return _0x461f41['destroy']()['then'](function(){_0x358bd6[_0xebdb('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a99ac,_0x388b13){return function(_0x1c6721){if(!_0x1c6721){_0x1a99ac[_0xebdb('0x1b')](0x194);}return _0x1c6721;};}function handleError(_0x3faca4,_0x2fb7a4){_0x2fb7a4=_0x2fb7a4||0x1f4;return function(_0xeb4356){logger[_0xebdb('0x29')](_0xeb4356[_0xebdb('0x2a')]);if(_0xeb4356['name']){delete _0xeb4356['name'];}_0x3faca4['status'](_0x2fb7a4)[_0xebdb('0x2b')](_0xeb4356);};}exports[_0xebdb('0x2c')]=function(_0x2abfcd,_0x10f78e){var _0xf84666={},_0x50074b={},_0xa2898a={'count':0x0,'rows':[]};var _0x3e3502=_[_0xebdb('0x2d')](db[_0xebdb('0x2e')][_0xebdb('0x2f')],function(_0x7dd02e){return{'name':_0x7dd02e[_0xebdb('0x30')],'type':_0x7dd02e[_0xebdb('0x31')][_0xebdb('0x32')]};});_0x50074b[_0xebdb('0x33')]=_['map'](_0x3e3502,_0xebdb('0x34'));_0x50074b[_0xebdb('0x35')]=_[_0xebdb('0x36')](_0x2abfcd[_0xebdb('0x35')]);_0x50074b[_0xebdb('0x37')]=_[_0xebdb('0x38')](_0x50074b['model'],_0x50074b[_0xebdb('0x35')]);_0xf84666[_0xebdb('0x39')]=_[_0xebdb('0x38')](_0x50074b[_0xebdb('0x33')],qs[_0xebdb('0x3a')](_0x2abfcd[_0xebdb('0x35')][_0xebdb('0x3a')]));_0xf84666[_0xebdb('0x39')]=_0xf84666[_0xebdb('0x39')]['length']?_0xf84666[_0xebdb('0x39')]:_0x50074b[_0xebdb('0x33')];if(!_0x2abfcd[_0xebdb('0x35')][_0xebdb('0x3b')](_0xebdb('0x3c'))){_0xf84666[_0xebdb('0x20')]=qs['limit'](_0x2abfcd[_0xebdb('0x35')]['limit']);_0xf84666[_0xebdb('0x1e')]=qs[_0xebdb('0x1e')](_0x2abfcd['query'][_0xebdb('0x1e')]);}_0xf84666[_0xebdb('0x3d')]=qs[_0xebdb('0x3e')](_0x2abfcd[_0xebdb('0x35')]['sort']);_0xf84666[_0xebdb('0x3f')]=qs[_0xebdb('0x37')](_[_0xebdb('0x40')](_0x2abfcd['query'],_0x50074b[_0xebdb('0x37')]),_0x3e3502);if(_0x2abfcd[_0xebdb('0x35')][_0xebdb('0x41')]){_0xf84666[_0xebdb('0x3f')]=_['merge'](_0xf84666[_0xebdb('0x3f')],{'$or':_[_0xebdb('0x2d')](_0x3e3502,function(_0x3658ce){if(_0x3658ce[_0xebdb('0x31')]!=='VIRTUAL'){var _0x46d041={};_0x46d041[_0x3658ce[_0xebdb('0x34')]]={'$like':'%'+_0x2abfcd[_0xebdb('0x35')][_0xebdb('0x41')]+'%'};return _0x46d041;}})});}_0xf84666=_['merge']({},_0xf84666,_0x2abfcd[_0xebdb('0x42')]);var _0x37303e={'where':_0xf84666['where']};return db[_0xebdb('0x2e')][_0xebdb('0x21')](_0x37303e)[_0xebdb('0x28')](function(_0x342f84){_0xa2898a[_0xebdb('0x21')]=_0x342f84;if(_0x2abfcd[_0xebdb('0x35')][_0xebdb('0x43')]){_0xf84666['include']=[{'all':!![]}];}return db[_0xebdb('0x2e')]['findAll'](_0xf84666);})[_0xebdb('0x28')](function(_0x29ff51){_0xa2898a['rows']=_0x29ff51;return _0xa2898a;})['then'](respondWithFilteredResult(_0x10f78e,_0xf84666))['catch'](handleError(_0x10f78e,null));};exports[_0xebdb('0x44')]=function(_0x33ad76,_0x1769bf){var _0x1c2cf5={'raw':!![],'where':{'id':_0x33ad76['params']['id']}},_0x3c6e18={};_0x3c6e18[_0xebdb('0x33')]=_['keys'](db[_0xebdb('0x2e')][_0xebdb('0x2f')]);_0x3c6e18[_0xebdb('0x35')]=_['keys'](_0x33ad76[_0xebdb('0x35')]);_0x3c6e18[_0xebdb('0x37')]=_[_0xebdb('0x38')](_0x3c6e18[_0xebdb('0x33')],_0x3c6e18[_0xebdb('0x35')]);_0x1c2cf5['attributes']=_[_0xebdb('0x38')](_0x3c6e18[_0xebdb('0x33')],qs[_0xebdb('0x3a')](_0x33ad76['query']['fields']));_0x1c2cf5['attributes']=_0x1c2cf5[_0xebdb('0x39')]['length']?_0x1c2cf5[_0xebdb('0x39')]:_0x3c6e18[_0xebdb('0x33')];if(_0x33ad76[_0xebdb('0x35')][_0xebdb('0x43')]){_0x1c2cf5[_0xebdb('0x45')]=[{'all':!![]}];}_0x1c2cf5=_[_0xebdb('0x46')]({},_0x1c2cf5,_0x33ad76[_0xebdb('0x42')]);return db['SmsTransferReport'][_0xebdb('0x47')](_0x1c2cf5)['then'](handleEntityNotFound(_0x1769bf,null))['then'](respondWithResult(_0x1769bf,null))[_0xebdb('0x48')](handleError(_0x1769bf,null));};exports['create']=function(_0x4af8b2,_0x592e81){return db[_0xebdb('0x2e')][_0xebdb('0x49')](_0x4af8b2[_0xebdb('0x4a')],{})[_0xebdb('0x28')](respondWithResult(_0x592e81,0xc9))[_0xebdb('0x48')](handleError(_0x592e81,null));};exports[_0xebdb('0x27')]=function(_0xdcd9f0,_0x38b5cc){if(_0xdcd9f0['body']['id']){delete _0xdcd9f0['body']['id'];}return db[_0xebdb('0x2e')][_0xebdb('0x47')]({'where':{'id':_0xdcd9f0['params']['id']}})[_0xebdb('0x28')](handleEntityNotFound(_0x38b5cc,null))['then'](saveUpdates(_0xdcd9f0['body'],null))[_0xebdb('0x28')](respondWithResult(_0x38b5cc,null))[_0xebdb('0x48')](handleError(_0x38b5cc,null));};exports[_0xebdb('0x4b')]=function(_0x49cf97,_0x247356){return db[_0xebdb('0x2e')]['find']({'where':{'id':_0x49cf97['params']['id']}})[_0xebdb('0x28')](handleEntityNotFound(_0x247356,null))[_0xebdb('0x28')](removeEntity(_0x247356,null))[_0xebdb('0x48')](handleError(_0x247356,null));};exports[_0xebdb('0x4c')]=function(_0x54fdbf,_0x1e591f){return db[_0xebdb('0x2e')][_0xebdb('0x4c')]()[_0xebdb('0x28')](respondWithResult(_0x1e591f,null))[_0xebdb('0x48')](handleError(_0x1e591f,null));};
\ No newline at end of file
index 5835ebc..72942f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea11=['./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x829e6,_0x53ace7){var _0x3c36f5=function(_0x5032a6){while(--_0x5032a6){_0x829e6['push'](_0x829e6['shift']());}};_0x3c36f5(++_0x53ace7);}(_0xea11,0x10c));var _0x1ea1=function(_0x1e432d,_0x35df07){_0x1e432d=_0x1e432d-0x0;var _0x2cc650=_0xea11[_0x1e432d];return _0x2cc650;};'use strict';var _=require(_0x1ea1('0x0'));var util=require(_0x1ea1('0x1'));var logger=require('../../config/logger')(_0x1ea1('0x2'));var moment=require(_0x1ea1('0x3'));var BPromise=require(_0x1ea1('0x4'));var rp=require(_0x1ea1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ea1('0x6'));var config=require(_0x1ea1('0x7'));var attributes=require(_0x1ea1('0x8'));module['exports']=function(_0x597279,_0x37bb21){return _0x597279['define'](_0x1ea1('0x9'),attributes,{'tableName':_0x1ea1('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1ea1('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbed7=['request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x18fa0f,_0x539204){var _0x187b26=function(_0x30ef31){while(--_0x30ef31){_0x18fa0f['push'](_0x18fa0f['shift']());}};_0x187b26(++_0x539204);}(_0xbed7,0x14b));var _0x7bed=function(_0x18004b,_0x5249f2){_0x18004b=_0x18004b-0x0;var _0x314a26=_0xbed7[_0x18004b];return _0x314a26;};'use strict';var _=require(_0x7bed('0x0'));var util=require(_0x7bed('0x1'));var logger=require(_0x7bed('0x2'))(_0x7bed('0x3'));var moment=require(_0x7bed('0x4'));var BPromise=require('bluebird');var rp=require(_0x7bed('0x5'));var fs=require('fs');var path=require(_0x7bed('0x6'));var rimraf=require(_0x7bed('0x7'));var config=require(_0x7bed('0x8'));var attributes=require(_0x7bed('0x9'));module[_0x7bed('0xa')]=function(_0x41c148,_0x3aa0e9){return _0x41c148[_0x7bed('0xb')]('SmsTransferReport',attributes,{'tableName':_0x7bed('0xc'),'paranoid':![],'indexes':[{'name':_0x7bed('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 2285fde..e6020d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7266=['request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1c7811,_0xf012fa){var _0x5eb147=function(_0xe04d31){while(--_0xe04d31){_0x1c7811['push'](_0x1c7811['shift']());}};_0x5eb147(++_0xf012fa);}(_0x7266,0xec));var _0x6726=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x7266[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var moment=require(_0x6726('0x2'));var BPromise=require(_0x6726('0x3'));var rs=require(_0x6726('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6726('0x5'));var logger=require(_0x6726('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6726('0x7'));var client=jayson[_0x6726('0x8')][_0x6726('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x180502,_0x217972,_0x3c8020){return new BPromise(function(_0x126ba7,_0x3d9f0f){return client[_0x6726('0xa')](_0x180502,_0x3c8020)[_0x6726('0xb')](function(_0x9f993){logger[_0x6726('0xc')](_0x6726('0xd'),_0x217972,'request\x20sent');logger[_0x6726('0xe')](_0x6726('0xf'),_0x217972,_0x6726('0x10'),JSON[_0x6726('0x11')](_0x9f993));if(_0x9f993['error']){if(_0x9f993[_0x6726('0x12')]['code']===0x1f4){logger[_0x6726('0x12')](_0x6726('0xd'),_0x217972,_0x9f993['error'][_0x6726('0x13')]);return _0x3d9f0f(_0x9f993[_0x6726('0x12')][_0x6726('0x13')]);}logger[_0x6726('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x217972,_0x9f993[_0x6726('0x12')][_0x6726('0x13')]);return _0x126ba7(_0x9f993['error'][_0x6726('0x13')]);}else{logger['info'](_0x6726('0xd'),_0x217972,_0x6726('0x10'));_0x126ba7(_0x9f993[_0x6726('0x14')][_0x6726('0x13')]);}})['catch'](function(_0x8323b2){logger[_0x6726('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x217972,_0x8323b2);_0x3d9f0f(_0x8323b2);});});}
\ No newline at end of file
+var _0x4944=['code','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x791ceb,_0x3761aa){var _0x1cdf44=function(_0x5ef0bf){while(--_0x5ef0bf){_0x791ceb['push'](_0x791ceb['shift']());}};_0x1cdf44(++_0x3761aa);}(_0x4944,0x6d));var _0x4494=function(_0x525291,_0x2f81ae){_0x525291=_0x525291-0x0;var _0x5d8813=_0x4944[_0x525291];return _0x5d8813;};'use strict';var _=require(_0x4494('0x0'));var util=require('util');var moment=require(_0x4494('0x1'));var BPromise=require(_0x4494('0x2'));var rs=require(_0x4494('0x3'));var fs=require('fs');var Redis=require(_0x4494('0x4'));var db=require(_0x4494('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4494('0x6'))('rpc');var config=require(_0x4494('0x7'));var jayson=require(_0x4494('0x8'));var client=jayson[_0x4494('0x9')][_0x4494('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a4911,_0x1a94d6,_0x55bb81){return new BPromise(function(_0x12ef8e,_0x21098c){return client['request'](_0x2a4911,_0x55bb81)[_0x4494('0xb')](function(_0xec1762){logger[_0x4494('0xc')](_0x4494('0xd'),_0x1a94d6,'request\x20sent');logger['debug'](_0x4494('0xe'),_0x1a94d6,_0x4494('0xf'),JSON[_0x4494('0x10')](_0xec1762));if(_0xec1762['error']){if(_0xec1762['error'][_0x4494('0x11')]===0x1f4){logger[_0x4494('0x12')](_0x4494('0xd'),_0x1a94d6,_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);return _0x21098c(_0xec1762[_0x4494('0x12')]['message']);}logger[_0x4494('0x12')](_0x4494('0xd'),_0x1a94d6,_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);return _0x12ef8e(_0xec1762[_0x4494('0x12')][_0x4494('0x13')]);}else{logger[_0x4494('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1a94d6,_0x4494('0xf'));_0x12ef8e(_0xec1762['result']['message']);}})[_0x4494('0x14')](function(_0x267d0b){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x1a94d6,_0x267d0b);_0x21098c(_0x267d0b);});});}
\ No newline at end of file
index 76bed29..0cb4ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd72a=['diskStorage','join','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','file','create','put','update','/:id','delete','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','show','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd72a,0x138));var _0xad72=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xd72a[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0xad72('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad72('0x1'));var express=require(_0xad72('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xad72('0x3'));var interaction=require(_0xad72('0x4'));var config=require(_0xad72('0x5'));var controller=require(_0xad72('0x6'));router['get']('/',auth[_0xad72('0x7')](),controller[_0xad72('0x8')]);router[_0xad72('0x9')]('/:id',auth[_0xad72('0x7')](),controller[_0xad72('0xa')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xad72('0xb')]);var upload=multer({'storage':multer[_0xad72('0xc')]({'destination':function(_0xb3798f,_0x266021,_0x19be1a){_0x19be1a(null,path[_0xad72('0xd')](config['root'],_0xad72('0xe')));},'filename':function(_0x24fc25,_0xf5f10a,_0x5b16f9){_0xf5f10a[_0xad72('0xf')]=_0xf5f10a['originalname'][_0xad72('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5b16f9(null,util[_0xad72('0x11')](_0xad72('0x12'),path['basename'](_0xf5f10a[_0xad72('0xf')],path[_0xad72('0x13')](_0xf5f10a[_0xad72('0xf')])),Date['now'](),path[_0xad72('0x13')](_0xf5f10a[_0xad72('0xf')])));}})});router['post']('/',upload['single'](_0xad72('0x14')),controller[_0xad72('0x15')]);router[_0xad72('0x16')]('/:id',auth[_0xad72('0x7')](),controller[_0xad72('0x17')]);router['delete'](_0xad72('0x18'),auth[_0xad72('0x7')](),controller[_0xad72('0x19')]);module[_0xad72('0x1a')]=router;
\ No newline at end of file
+var _0x8081=['originalname','replace','format','basename','extname','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','diskStorage','join','root'];(function(_0xa3a31f,_0x19333d){var _0x103d0f=function(_0x400b7e){while(--_0x400b7e){_0xa3a31f['push'](_0xa3a31f['shift']());}};_0x103d0f(++_0x19333d);}(_0x8081,0x92));var _0x1808=function(_0x26bab2,_0x4aa151){_0x26bab2=_0x26bab2-0x0;var _0x1c8350=_0x8081[_0x26bab2];return _0x1c8350;};'use strict';var multer=require(_0x1808('0x0'));var util=require(_0x1808('0x1'));var path=require(_0x1808('0x2'));var timeout=require(_0x1808('0x3'));var express=require('express');var router=express[_0x1808('0x4')]();var fs_extra=require(_0x1808('0x5'));var auth=require(_0x1808('0x6'));var interaction=require(_0x1808('0x7'));var config=require(_0x1808('0x8'));var controller=require(_0x1808('0x9'));router[_0x1808('0xa')]('/',auth[_0x1808('0xb')](),controller[_0x1808('0xc')]);router[_0x1808('0xa')](_0x1808('0xd'),auth[_0x1808('0xb')](),controller[_0x1808('0xe')]);router[_0x1808('0xa')](_0x1808('0xf'),auth[_0x1808('0xb')](),controller['download']);var upload=multer({'storage':multer[_0x1808('0x10')]({'destination':function(_0x397f9c,_0x388fd6,_0x441c2a){_0x441c2a(null,path[_0x1808('0x11')](config[_0x1808('0x12')],'server/files/sounds/original/'));},'filename':function(_0x43b4fb,_0x370870,_0x1fa17d){_0x370870[_0x1808('0x13')]=_0x370870[_0x1808('0x13')][_0x1808('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1fa17d(null,util[_0x1808('0x15')]('%s-%s%s',path[_0x1808('0x16')](_0x370870[_0x1808('0x13')],path[_0x1808('0x17')](_0x370870[_0x1808('0x13')])),Date[_0x1808('0x18')](),path[_0x1808('0x17')](_0x370870[_0x1808('0x13')])));}})});router[_0x1808('0x19')]('/',upload[_0x1808('0x1a')](_0x1808('0x1b')),controller[_0x1808('0x1c')]);router[_0x1808('0x1d')](_0x1808('0xd'),auth[_0x1808('0xb')](),controller[_0x1808('0x1e')]);router[_0x1808('0x1f')](_0x1808('0xd'),auth[_0x1808('0xb')](),controller[_0x1808('0x1f')]);module[_0x1808('0x20')]=router;
\ No newline at end of file
index 3d94a0b..f18537d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x797a=['BIGINT','FLOAT','name','STRING','INTEGER'];(function(_0x1d2946,_0x41fa09){var _0x2dc9b4=function(_0x333068){while(--_0x333068){_0x1d2946['push'](_0x1d2946['shift']());}};_0x2dc9b4(++_0x41fa09);}(_0x797a,0x7a));var _0xa797=function(_0xebc93c,_0x50bec3){_0xebc93c=_0xebc93c-0x0;var _0x3795ed=_0x797a[_0xebc93c];return _0x3795ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xa797('0x0'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa797('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xa797('0x1')]},'original_format':{'type':Sequelize[_0xa797('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xa797('0x2')]},'original_bitRate':{'type':Sequelize[_0xa797('0x3')]},'original_sampleRate':{'type':Sequelize[_0xa797('0x2')]},'converted_format':{'type':Sequelize[_0xa797('0x1')]},'converted_duration':{'type':Sequelize[_0xa797('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xa797('0x3')]},'converted_channelCount':{'type':Sequelize[_0xa797('0x2')]},'converted_bitRate':{'type':Sequelize[_0xa797('0x3')]},'converted_sampleRate':{'type':Sequelize[_0xa797('0x2')]}};
\ No newline at end of file
+var _0xd5a9=['BIGINT','INTEGER','exports','STRING','FLOAT'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xd5a9,0x1ec));var _0x9d5a=function(_0x802465,_0x4fe93b){_0x802465=_0x802465-0x0;var _0x5e7be4=_0xd5a9[_0x802465];return _0x5e7be4;};'use strict';var Sequelize=require('sequelize');module[_0x9d5a('0x0')]={'name':{'type':Sequelize[_0x9d5a('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x9d5a('0x1')]},'original_format':{'type':Sequelize[_0x9d5a('0x1')]},'original_duration':{'type':Sequelize[_0x9d5a('0x2')]},'original_sampleCount':{'type':Sequelize[_0x9d5a('0x3')]},'original_channelCount':{'type':Sequelize[_0x9d5a('0x4')]},'original_bitRate':{'type':Sequelize[_0x9d5a('0x3')]},'original_sampleRate':{'type':Sequelize[_0x9d5a('0x4')]},'converted_format':{'type':Sequelize[_0x9d5a('0x1')]},'converted_duration':{'type':Sequelize[_0x9d5a('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x9d5a('0x3')]},'converted_channelCount':{'type':Sequelize[_0x9d5a('0x4')]},'converted_bitRate':{'type':Sequelize[_0x9d5a('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x9d5a('0x4')]}};
\ No newline at end of file
index 4552f8c..e1dc535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b73=['Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','Sounds','userProfileId','autoAssociation','start','body','description','delete','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','get','error','stack','name','map','Sound','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','intersection','download','params','converted_format','existsSync','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','format','%s.%s','create','basename','file','originalname','filename','extname','substring','join','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','chmodSync','role'];(function(_0x30d546,_0xa70200){var _0x79d19d=function(_0x4a9c4d){while(--_0x4a9c4d){_0x30d546['push'](_0x30d546['shift']());}};_0x79d19d(++_0xa70200);}(_0x6b73,0xfb));var _0x36b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b73[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x36b7('0x0'));var rimraf=require(_0x36b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x36b7('0x2'));var rp=require(_0x36b7('0x3'));var moment=require(_0x36b7('0x4'));var BPromise=require(_0x36b7('0x5'));var Mustache=require(_0x36b7('0x6'));var util=require(_0x36b7('0x7'));var path=require(_0x36b7('0x8'));var sox=require('sox');var csv=require(_0x36b7('0x9'));var ejs=require(_0x36b7('0xa'));var fs=require('fs');var fs_extra=require(_0x36b7('0xb'));var _=require(_0x36b7('0xc'));var squel=require(_0x36b7('0xd'));var crypto=require(_0x36b7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x36b7('0xf'));var toCsv=require(_0x36b7('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x36b7('0x10'));var qs=require(_0x36b7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x36b7('0x12'))('api');var utils=require(_0x36b7('0x13'));var config=require(_0x36b7('0x14'));var licenseUtil=require(_0x36b7('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54f5a5,_0x3046c){_0x3046c=_0x3046c||0xcc;return function(_0x813ac9){if(_0x813ac9){return _0x54f5a5[_0x36b7('0x16')](_0x3046c);}return _0x54f5a5[_0x36b7('0x17')](_0x3046c)[_0x36b7('0x18')]();};}function respondWithResult(_0x36e8ef,_0x31334d){_0x31334d=_0x31334d||0xc8;return function(_0x62dc8c){if(_0x62dc8c){return _0x36e8ef[_0x36b7('0x17')](_0x31334d)[_0x36b7('0x19')](_0x62dc8c);}};}function respondWithFilteredResult(_0x5a8f16,_0xcc6bd6){return function(_0x707871){if(_0x707871){var _0x246702=typeof _0xcc6bd6[_0x36b7('0x1a')]===_0x36b7('0x1b')&&typeof _0xcc6bd6[_0x36b7('0x1c')]===_0x36b7('0x1b');var _0x146c1b=_0x707871[_0x36b7('0x1d')];var _0x2910af=_0x246702?0x0:_0xcc6bd6[_0x36b7('0x1a')];var _0x3f1e74=_0x246702?_0x707871[_0x36b7('0x1d')]:_0xcc6bd6[_0x36b7('0x1a')]+_0xcc6bd6[_0x36b7('0x1c')];var _0x4be8ff;if(_0x3f1e74>=_0x146c1b){_0x3f1e74=_0x146c1b;_0x4be8ff=0xc8;}else{_0x4be8ff=0xce;}_0x5a8f16[_0x36b7('0x17')](_0x4be8ff);return _0x5a8f16[_0x36b7('0x1e')]('Content-Range',_0x2910af+'-'+_0x3f1e74+'/'+_0x146c1b)[_0x36b7('0x19')](_0x707871);}return null;};}function patchUpdates(_0x25402f){return function(_0x3e651f){try{jsonpatch['apply'](_0x3e651f,_0x25402f,!![]);}catch(_0x1bff3a){return BPromise[_0x36b7('0x1f')](_0x1bff3a);}return _0x3e651f[_0x36b7('0x20')]();};}function saveUpdates(_0x183c5a,_0x341b1b){return function(_0x441495){if(_0x441495){return _0x441495[_0x36b7('0x21')](_0x183c5a)['then'](function(_0x1c36fb){return _0x1c36fb;});}return null;};}function removeEntity(_0x692dff,_0x3fab4c){return function(_0x4f78aa){if(_0x4f78aa){return _0x4f78aa[_0x36b7('0x22')]()[_0x36b7('0x23')](function(){var _0x4b1ad8=_0x4f78aa[_0x36b7('0x24')]({'plain':!![]});var _0x4c189c='Sounds';return db['UserProfileResource'][_0x36b7('0x22')]({'where':{'type':_0x4c189c,'resourceId':_0x4b1ad8['id']}})[_0x36b7('0x23')](function(){return _0x4f78aa;});})['then'](function(){_0x692dff[_0x36b7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff9de,_0x98d463){return function(_0x850925){if(!_0x850925){_0x4ff9de[_0x36b7('0x16')](0x194);}return _0x850925;};}function handleError(_0xf21a00,_0x504a84){_0x504a84=_0x504a84||0x1f4;return function(_0x9acc3e){logger[_0x36b7('0x25')](_0x9acc3e[_0x36b7('0x26')]);if(_0x9acc3e[_0x36b7('0x27')]){delete _0x9acc3e[_0x36b7('0x27')];}_0xf21a00[_0x36b7('0x17')](_0x504a84)['send'](_0x9acc3e);};}exports['index']=function(_0x4824d6,_0x344d2e){var _0x575fa1={},_0x57e0a9={},_0x1d0adb={'count':0x0,'rows':[]};var _0x39f54f=_[_0x36b7('0x28')](db[_0x36b7('0x29')][_0x36b7('0x2a')],function(_0x3d59c5){return{'name':_0x3d59c5['fieldName'],'type':_0x3d59c5[_0x36b7('0x2b')][_0x36b7('0x2c')]};});_0x57e0a9[_0x36b7('0x2d')]=_[_0x36b7('0x28')](_0x39f54f,'name');_0x57e0a9[_0x36b7('0x2e')]=_[_0x36b7('0x2f')](_0x4824d6[_0x36b7('0x2e')]);_0x57e0a9[_0x36b7('0x30')]=_['intersection'](_0x57e0a9['model'],_0x57e0a9[_0x36b7('0x2e')]);_0x575fa1[_0x36b7('0x31')]=_['intersection'](_0x57e0a9[_0x36b7('0x2d')],qs[_0x36b7('0x32')](_0x4824d6[_0x36b7('0x2e')][_0x36b7('0x32')]));_0x575fa1[_0x36b7('0x31')]=_0x575fa1['attributes'][_0x36b7('0x33')]?_0x575fa1[_0x36b7('0x31')]:_0x57e0a9['model'];if(!_0x4824d6[_0x36b7('0x2e')]['hasOwnProperty']('nolimit')){_0x575fa1['limit']=qs[_0x36b7('0x1c')](_0x4824d6['query']['limit']);_0x575fa1[_0x36b7('0x1a')]=qs[_0x36b7('0x1a')](_0x4824d6[_0x36b7('0x2e')][_0x36b7('0x1a')]);}_0x575fa1[_0x36b7('0x34')]=qs[_0x36b7('0x35')](_0x4824d6[_0x36b7('0x2e')][_0x36b7('0x35')]);_0x575fa1['where']=qs[_0x36b7('0x30')](_[_0x36b7('0x36')](_0x4824d6[_0x36b7('0x2e')],_0x57e0a9[_0x36b7('0x30')]),_0x39f54f);if(_0x4824d6[_0x36b7('0x2e')][_0x36b7('0x37')]){_0x575fa1[_0x36b7('0x38')]=_['merge'](_0x575fa1['where'],{'$or':_[_0x36b7('0x28')](_0x39f54f,function(_0x5e3e8c){if(_0x5e3e8c[_0x36b7('0x2b')]!==_0x36b7('0x39')){var _0xf2d025={};_0xf2d025[_0x5e3e8c[_0x36b7('0x27')]]={'$like':'%'+_0x4824d6[_0x36b7('0x2e')][_0x36b7('0x37')]+'%'};return _0xf2d025;}})});}_0x575fa1=_['merge']({},_0x575fa1,_0x4824d6[_0x36b7('0x3a')]);var _0x5e9ebd={'where':_0x575fa1['where']};return db[_0x36b7('0x29')][_0x36b7('0x1d')](_0x5e9ebd)[_0x36b7('0x23')](function(_0x2ccebd){_0x1d0adb[_0x36b7('0x1d')]=_0x2ccebd;if(_0x4824d6[_0x36b7('0x2e')][_0x36b7('0x3b')]){_0x575fa1[_0x36b7('0x3c')]=[{'all':!![]}];}return db[_0x36b7('0x29')][_0x36b7('0x3d')](_0x575fa1);})['then'](function(_0x383fe4){_0x1d0adb[_0x36b7('0x3e')]=_0x383fe4;return _0x1d0adb;})[_0x36b7('0x23')](respondWithFilteredResult(_0x344d2e,_0x575fa1))[_0x36b7('0x3f')](handleError(_0x344d2e,null));};exports[_0x36b7('0x40')]=function(_0x1feb2e,_0x2017a7){var _0x4966ef={'raw':!![],'where':{'id':_0x1feb2e['params']['id']}},_0x316f22={};_0x316f22[_0x36b7('0x2d')]=_[_0x36b7('0x2f')](db[_0x36b7('0x29')][_0x36b7('0x2a')]);_0x316f22[_0x36b7('0x2e')]=_[_0x36b7('0x2f')](_0x1feb2e['query']);_0x316f22[_0x36b7('0x30')]=_[_0x36b7('0x41')](_0x316f22[_0x36b7('0x2d')],_0x316f22[_0x36b7('0x2e')]);_0x4966ef['attributes']=_[_0x36b7('0x41')](_0x316f22['model'],qs['fields'](_0x1feb2e[_0x36b7('0x2e')]['fields']));_0x4966ef[_0x36b7('0x31')]=_0x4966ef[_0x36b7('0x31')][_0x36b7('0x33')]?_0x4966ef[_0x36b7('0x31')]:_0x316f22['model'];if(_0x1feb2e[_0x36b7('0x2e')][_0x36b7('0x3b')]){_0x4966ef[_0x36b7('0x3c')]=[{'all':!![]}];}_0x4966ef=_['merge']({},_0x4966ef,_0x1feb2e[_0x36b7('0x3a')]);return db['Sound']['find'](_0x4966ef)['then'](handleEntityNotFound(_0x2017a7,null))['then'](respondWithResult(_0x2017a7,null))[_0x36b7('0x3f')](handleError(_0x2017a7,null));};exports[_0x36b7('0x42')]=function(_0x42d51a,_0x2439ef,_0x36168b){return db[_0x36b7('0x29')]['find']({'where':{'id':_0x42d51a[_0x36b7('0x43')]['id']},'attributes':[_0x36b7('0x27'),'save_name',_0x36b7('0x44')],'raw':!![]})['then'](handleEntityNotFound(_0x2439ef,null))[_0x36b7('0x23')](function(_0x5294bb){if(_0x5294bb){if(!fs[_0x36b7('0x45')](path['join'](config[_0x36b7('0x46')],_0x36b7('0x47'),_0x5294bb[_0x36b7('0x48')]+'.'+_0x5294bb['converted_format']))){throw new db[(_0x36b7('0x49'))][(_0x36b7('0x4a'))]('Sound\x20not\x20found');}return _0x2439ef[_0x36b7('0x42')](path['join'](config[_0x36b7('0x46')],'server/files/sounds/converted',util[_0x36b7('0x4b')](_0x36b7('0x4c'),_0x5294bb[_0x36b7('0x48')],_0x5294bb[_0x36b7('0x44')])),util[_0x36b7('0x4b')]('%s.%s',_0x5294bb[_0x36b7('0x27')],_0x5294bb[_0x36b7('0x44')]));}return null;})['catch'](handleError(_0x2439ef,null));};exports[_0x36b7('0x4d')]=function(_0x366d81,_0x599ef4,_0x53f0f6){var _0x2eb925={'name':path[_0x36b7('0x4e')](_0x366d81[_0x36b7('0x4f')][_0x36b7('0x50')],path['extname'](_0x366d81[_0x36b7('0x4f')][_0x36b7('0x50')])),'save_name':path[_0x36b7('0x4e')](_0x366d81[_0x36b7('0x4f')][_0x36b7('0x51')],path[_0x36b7('0x52')](_0x366d81['file']['filename'])),'original_format':path[_0x36b7('0x52')](_0x366d81[_0x36b7('0x4f')]['originalname'])[_0x36b7('0x53')](0x1),'converted_format':'wav'};var _0x3e41ac=path[_0x36b7('0x54')](config[_0x36b7('0x46')],_0x36b7('0x55'),_0x366d81[_0x36b7('0x4f')][_0x36b7('0x51')]);var _0x5eb640=path[_0x36b7('0x54')](config[_0x36b7('0x46')],_0x36b7('0x47'),util[_0x36b7('0x4b')](_0x36b7('0x4c'),path[_0x36b7('0x4e')](_0x366d81['file'][_0x36b7('0x51')],path['extname'](_0x366d81['file'][_0x36b7('0x51')])),_0x2eb925[_0x36b7('0x44')]));logger[_0x36b7('0x56')]('Sound\x20upload\x20filepath:\x20%s',_0x3e41ac);logger[_0x36b7('0x56')](_0x36b7('0x57'),_0x5eb640);try{fs['chmodSync'](_0x3e41ac,parseInt(_0x36b7('0x58'),0x8));var _0x34c863=sox[_0x36b7('0x59')](_0x3e41ac,_0x5eb640,{'sampleRate':0x1f40,'format':_0x36b7('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x34c863['on'](_0x36b7('0x25'),function(_0x1c1fe8){fs[_0x36b7('0x5b')](_0x3e41ac);_0x599ef4[_0x36b7('0x17')](0x1f4)[_0x36b7('0x5c')](_0x1c1fe8);});_0x34c863['on'](_0x36b7('0x5d'),function(_0xef6f78){_0x2eb925[_0x36b7('0x5e')]=isNaN(_0xef6f78[_0x36b7('0x5f')])?null:_0xef6f78[_0x36b7('0x5f')]*0x3e8;_0x2eb925[_0x36b7('0x60')]=isNaN(_0xef6f78[_0x36b7('0x61')])?null:_0xef6f78[_0x36b7('0x61')];_0x2eb925['original_channelCount']=isNaN(_0xef6f78[_0x36b7('0x62')])?null:_0xef6f78[_0x36b7('0x62')];_0x2eb925[_0x36b7('0x63')]=isNaN(_0xef6f78['bitRate'])?null:_0xef6f78[_0x36b7('0x64')];_0x2eb925[_0x36b7('0x65')]=isNaN(_0xef6f78[_0x36b7('0x66')])?null:_0xef6f78[_0x36b7('0x66')];});_0x34c863['on'](_0x36b7('0x67'),function(_0x5ccebc){_0x2eb925[_0x36b7('0x68')]=isNaN(_0x5ccebc[_0x36b7('0x5f')])?null:_0x5ccebc[_0x36b7('0x5f')]*0x3e8;_0x2eb925[_0x36b7('0x69')]=isNaN(_0x5ccebc[_0x36b7('0x61')])?null:_0x5ccebc[_0x36b7('0x61')];_0x2eb925[_0x36b7('0x6a')]=isNaN(_0x5ccebc[_0x36b7('0x62')])?null:_0x5ccebc[_0x36b7('0x62')];_0x2eb925['converted_bitRate']=isNaN(_0x5ccebc['bitRate'])?null:_0x5ccebc[_0x36b7('0x64')];_0x2eb925['converted_sampleRate']=isNaN(_0x5ccebc[_0x36b7('0x66')])?null:_0x5ccebc[_0x36b7('0x66')];});_0x34c863['on'](_0x36b7('0x18'),function(){fs[_0x36b7('0x6b')](_0x5eb640,parseInt(_0x36b7('0x58'),0x8));return db['Sound']['create'](_0x2eb925)[_0x36b7('0x23')](function(_0x32eb4d){var _0x3811d2={'role':_0x366d81['body'][_0x36b7('0x6c')],'userProfileId':_0x366d81['body']['userProfileId']};if(!_0x3811d2)throw new Error(_0x36b7('0x6d'));if(_0x3811d2[_0x36b7('0x6c')]===_0x36b7('0x6e')){var _0x2021fd=_0x32eb4d['get']({'plain':!![]});return db['UserProfileSection'][_0x36b7('0x6f')]({'where':{'name':_0x36b7('0x70'),'userProfileId':_0x3811d2[_0x36b7('0x71')]},'raw':!![]})[_0x36b7('0x23')](function(_0x516dd9){if(_0x516dd9&&_0x516dd9[_0x36b7('0x72')]===0x0){return db['UserProfileResource']['create']({'name':_0x2021fd[_0x36b7('0x27')],'resourceId':_0x2021fd['id'],'type':_0x516dd9['name'],'sectionId':_0x516dd9['id']},{})[_0x36b7('0x23')](function(){return _0x32eb4d;});}else{return _0x32eb4d;}})[_0x36b7('0x3f')](function(_0x13e03a){logger[_0x36b7('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13e03a);throw _0x13e03a;});}return _0x32eb4d;})[_0x36b7('0x23')](respondWithResult(_0x599ef4,null))['catch'](handleError(_0x599ef4,null));});_0x34c863[_0x36b7('0x73')]();}catch(_0x338ca3){_0x599ef4[_0x36b7('0x17')](0x1f4)['send'](_0x338ca3);}};exports[_0x36b7('0x21')]=function(_0x5eb83a,_0x365907,_0x38d188){return db[_0x36b7('0x29')][_0x36b7('0x6f')]({'where':{'id':_0x5eb83a[_0x36b7('0x43')]['id']}})[_0x36b7('0x23')](handleEntityNotFound(_0x365907,null))[_0x36b7('0x23')](saveUpdates(_[_0x36b7('0x36')](_0x5eb83a[_0x36b7('0x74')],['name',_0x36b7('0x75')]),null))[_0x36b7('0x23')](respondWithResult(_0x365907,null))[_0x36b7('0x3f')](handleError(_0x365907,null));};exports[_0x36b7('0x76')]=function(_0x473646,_0x31bfd1,_0xc25170){return db['Sound']['find']({'where':{'id':_0x473646['params']['id']}})[_0x36b7('0x23')](function(_0x57abf6){if(_0x57abf6){return _0x57abf6[_0x36b7('0x22')]();}})[_0x36b7('0x23')](function(_0x518d3d){var _0x4d2d53=path[_0x36b7('0x54')](config['root'],_0x36b7('0x55'),util[_0x36b7('0x4b')](_0x36b7('0x4c'),_0x518d3d[_0x36b7('0x48')],_0x518d3d[_0x36b7('0x77')]));var _0x534a47=path[_0x36b7('0x54')](config['root'],'server/files/sounds/converted',util[_0x36b7('0x4b')]('%s.%s',_0x518d3d['save_name'],_0x518d3d[_0x36b7('0x44')]));fs[_0x36b7('0x5b')](_0x4d2d53);fs['unlinkSync'](_0x534a47);return _0x518d3d;})['then'](function(_0x3dab21){if(_0x3dab21){return _0x31bfd1[_0x36b7('0x17')](0xcc)[_0x36b7('0x18')]();}})['then'](handleEntityNotFound(_0x31bfd1,null))[_0x36b7('0x3f')](handleError(_0x31bfd1,null));};
\ No newline at end of file
+var _0x4dd6=['where','pick','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','download','save_name','join','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','root','format','%s.%s','create','basename','file','extname','originalname','filename','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','body','role','user','userProfileId','autoAssociation','start','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Sounds','end','sendStatus','error','stack','name','index','map','Sound','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0x7b0b53,_0x4d6b7c){var _0x2bd38f=function(_0x381b39){while(--_0x381b39){_0x7b0b53['push'](_0x7b0b53['shift']());}};_0x2bd38f(++_0x4d6b7c);}(_0x4dd6,0x13e));var _0x64dd=function(_0x5c8bcf,_0x11f46d){_0x5c8bcf=_0x5c8bcf-0x0;var _0x188485=_0x4dd6[_0x5c8bcf];return _0x188485;};'use strict';var emlformat=require(_0x64dd('0x0'));var rimraf=require(_0x64dd('0x1'));var zipdir=require(_0x64dd('0x2'));var jsonpatch=require(_0x64dd('0x3'));var rp=require(_0x64dd('0x4'));var moment=require(_0x64dd('0x5'));var BPromise=require(_0x64dd('0x6'));var Mustache=require('mustache');var util=require(_0x64dd('0x7'));var path=require(_0x64dd('0x8'));var sox=require(_0x64dd('0x9'));var csv=require(_0x64dd('0xa'));var ejs=require(_0x64dd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64dd('0xc'));var squel=require('squel');var crypto=require(_0x64dd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x64dd('0xe'));var toCsv=require(_0x64dd('0xa'));var querystring=require(_0x64dd('0xf'));var Papa=require(_0x64dd('0x10'));var Redis=require(_0x64dd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64dd('0x12'));var hardwareService=require(_0x64dd('0x13'));var logger=require(_0x64dd('0x14'))(_0x64dd('0x15'));var utils=require(_0x64dd('0x16'));var config=require(_0x64dd('0x17'));var licenseUtil=require(_0x64dd('0x18'));var db=require(_0x64dd('0x19'))['db'];function respondWithStatusCode(_0x3bedfc,_0x105385){_0x105385=_0x105385||0xcc;return function(_0x17727e){if(_0x17727e){return _0x3bedfc['sendStatus'](_0x105385);}return _0x3bedfc[_0x64dd('0x1a')](_0x105385)['end']();};}function respondWithResult(_0x5f0bf7,_0x598d92){_0x598d92=_0x598d92||0xc8;return function(_0x27d1a7){if(_0x27d1a7){return _0x5f0bf7[_0x64dd('0x1a')](_0x598d92)[_0x64dd('0x1b')](_0x27d1a7);}};}function respondWithFilteredResult(_0x27132c,_0x413ea5){return function(_0x55941a){if(_0x55941a){var _0x68cd94=typeof _0x413ea5[_0x64dd('0x1c')]===_0x64dd('0x1d')&&typeof _0x413ea5[_0x64dd('0x1e')]===_0x64dd('0x1d');var _0x4ae2d9=_0x55941a[_0x64dd('0x1f')];var _0xe907af=_0x68cd94?0x0:_0x413ea5[_0x64dd('0x1c')];var _0xc49e30=_0x68cd94?_0x55941a['count']:_0x413ea5['offset']+_0x413ea5['limit'];var _0x3f0116;if(_0xc49e30>=_0x4ae2d9){_0xc49e30=_0x4ae2d9;_0x3f0116=0xc8;}else{_0x3f0116=0xce;}_0x27132c[_0x64dd('0x1a')](_0x3f0116);return _0x27132c[_0x64dd('0x20')](_0x64dd('0x21'),_0xe907af+'-'+_0xc49e30+'/'+_0x4ae2d9)['json'](_0x55941a);}return null;};}function patchUpdates(_0x489cef){return function(_0x24f9ef){try{jsonpatch[_0x64dd('0x22')](_0x24f9ef,_0x489cef,!![]);}catch(_0x5de841){return BPromise['reject'](_0x5de841);}return _0x24f9ef[_0x64dd('0x23')]();};}function saveUpdates(_0x1c29ee,_0x3dd95c){return function(_0x4b52f5){if(_0x4b52f5){return _0x4b52f5[_0x64dd('0x24')](_0x1c29ee)[_0x64dd('0x25')](function(_0x2bb96b){return _0x2bb96b;});}return null;};}function removeEntity(_0x17341c,_0x18812d){return function(_0x482ffb){if(_0x482ffb){return _0x482ffb[_0x64dd('0x26')]()[_0x64dd('0x25')](function(){var _0x3c5ed8=_0x482ffb[_0x64dd('0x27')]({'plain':!![]});var _0x3bf7f2=_0x64dd('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x3bf7f2,'resourceId':_0x3c5ed8['id']}})[_0x64dd('0x25')](function(){return _0x482ffb;});})[_0x64dd('0x25')](function(){_0x17341c['status'](0xcc)[_0x64dd('0x29')]();});}};}function handleEntityNotFound(_0x419421,_0x246378){return function(_0xf9a7b2){if(!_0xf9a7b2){_0x419421[_0x64dd('0x2a')](0x194);}return _0xf9a7b2;};}function handleError(_0xf215fb,_0x25e9ea){_0x25e9ea=_0x25e9ea||0x1f4;return function(_0x44dc12){logger[_0x64dd('0x2b')](_0x44dc12[_0x64dd('0x2c')]);if(_0x44dc12[_0x64dd('0x2d')]){delete _0x44dc12[_0x64dd('0x2d')];}_0xf215fb['status'](_0x25e9ea)['send'](_0x44dc12);};}exports[_0x64dd('0x2e')]=function(_0x3f2ffe,_0xef23de){var _0x12025f={},_0xfe22a7={},_0x54106c={'count':0x0,'rows':[]};var _0x3c3dc4=_[_0x64dd('0x2f')](db[_0x64dd('0x30')][_0x64dd('0x31')],function(_0x12254f){return{'name':_0x12254f['fieldName'],'type':_0x12254f[_0x64dd('0x32')][_0x64dd('0x33')]};});_0xfe22a7[_0x64dd('0x34')]=_[_0x64dd('0x2f')](_0x3c3dc4,_0x64dd('0x2d'));_0xfe22a7['query']=_[_0x64dd('0x35')](_0x3f2ffe[_0x64dd('0x36')]);_0xfe22a7[_0x64dd('0x37')]=_['intersection'](_0xfe22a7[_0x64dd('0x34')],_0xfe22a7[_0x64dd('0x36')]);_0x12025f['attributes']=_[_0x64dd('0x38')](_0xfe22a7['model'],qs[_0x64dd('0x39')](_0x3f2ffe[_0x64dd('0x36')][_0x64dd('0x39')]));_0x12025f[_0x64dd('0x3a')]=_0x12025f['attributes'][_0x64dd('0x3b')]?_0x12025f['attributes']:_0xfe22a7[_0x64dd('0x34')];if(!_0x3f2ffe[_0x64dd('0x36')]['hasOwnProperty'](_0x64dd('0x3c'))){_0x12025f[_0x64dd('0x1e')]=qs[_0x64dd('0x1e')](_0x3f2ffe[_0x64dd('0x36')][_0x64dd('0x1e')]);_0x12025f[_0x64dd('0x1c')]=qs['offset'](_0x3f2ffe['query']['offset']);}_0x12025f[_0x64dd('0x3d')]=qs[_0x64dd('0x3e')](_0x3f2ffe[_0x64dd('0x36')][_0x64dd('0x3e')]);_0x12025f[_0x64dd('0x3f')]=qs[_0x64dd('0x37')](_[_0x64dd('0x40')](_0x3f2ffe[_0x64dd('0x36')],_0xfe22a7[_0x64dd('0x37')]),_0x3c3dc4);if(_0x3f2ffe[_0x64dd('0x36')][_0x64dd('0x41')]){_0x12025f['where']=_[_0x64dd('0x42')](_0x12025f[_0x64dd('0x3f')],{'$or':_[_0x64dd('0x2f')](_0x3c3dc4,function(_0x567d57){if(_0x567d57['type']!=='VIRTUAL'){var _0x2cd58e={};_0x2cd58e[_0x567d57['name']]={'$like':'%'+_0x3f2ffe[_0x64dd('0x36')]['filter']+'%'};return _0x2cd58e;}})});}_0x12025f=_[_0x64dd('0x42')]({},_0x12025f,_0x3f2ffe[_0x64dd('0x43')]);var _0x17695c={'where':_0x12025f['where']};return db[_0x64dd('0x30')]['count'](_0x17695c)['then'](function(_0x5b6138){_0x54106c['count']=_0x5b6138;if(_0x3f2ffe[_0x64dd('0x36')][_0x64dd('0x44')]){_0x12025f['include']=[{'all':!![]}];}return db[_0x64dd('0x30')][_0x64dd('0x45')](_0x12025f);})[_0x64dd('0x25')](function(_0x4d76b0){_0x54106c[_0x64dd('0x46')]=_0x4d76b0;return _0x54106c;})[_0x64dd('0x25')](respondWithFilteredResult(_0xef23de,_0x12025f))['catch'](handleError(_0xef23de,null));};exports[_0x64dd('0x47')]=function(_0x4125b1,_0xfb5043){var _0x4b1635={'raw':!![],'where':{'id':_0x4125b1[_0x64dd('0x48')]['id']}},_0x536ed9={};_0x536ed9['model']=_[_0x64dd('0x35')](db[_0x64dd('0x30')][_0x64dd('0x31')]);_0x536ed9['query']=_['keys'](_0x4125b1[_0x64dd('0x36')]);_0x536ed9[_0x64dd('0x37')]=_[_0x64dd('0x38')](_0x536ed9['model'],_0x536ed9['query']);_0x4b1635[_0x64dd('0x3a')]=_['intersection'](_0x536ed9[_0x64dd('0x34')],qs[_0x64dd('0x39')](_0x4125b1[_0x64dd('0x36')][_0x64dd('0x39')]));_0x4b1635['attributes']=_0x4b1635[_0x64dd('0x3a')][_0x64dd('0x3b')]?_0x4b1635[_0x64dd('0x3a')]:_0x536ed9[_0x64dd('0x34')];if(_0x4125b1[_0x64dd('0x36')][_0x64dd('0x44')]){_0x4b1635[_0x64dd('0x49')]=[{'all':!![]}];}_0x4b1635=_[_0x64dd('0x42')]({},_0x4b1635,_0x4125b1[_0x64dd('0x43')]);return db['Sound'][_0x64dd('0x4a')](_0x4b1635)[_0x64dd('0x25')](handleEntityNotFound(_0xfb5043,null))[_0x64dd('0x25')](respondWithResult(_0xfb5043,null))[_0x64dd('0x4b')](handleError(_0xfb5043,null));};exports[_0x64dd('0x4c')]=function(_0x35a9a6,_0x55013f,_0x161a5d){return db[_0x64dd('0x30')][_0x64dd('0x4a')]({'where':{'id':_0x35a9a6['params']['id']},'attributes':[_0x64dd('0x2d'),_0x64dd('0x4d'),'converted_format'],'raw':!![]})[_0x64dd('0x25')](handleEntityNotFound(_0x55013f,null))['then'](function(_0x19ea4b){if(_0x19ea4b){if(!fs['existsSync'](path[_0x64dd('0x4e')](config['root'],_0x64dd('0x4f'),_0x19ea4b[_0x64dd('0x4d')]+'.'+_0x19ea4b[_0x64dd('0x50')]))){throw new db[(_0x64dd('0x51'))][(_0x64dd('0x52'))](_0x64dd('0x53'));}return _0x55013f[_0x64dd('0x4c')](path[_0x64dd('0x4e')](config[_0x64dd('0x54')],'server/files/sounds/converted',util[_0x64dd('0x55')](_0x64dd('0x56'),_0x19ea4b['save_name'],_0x19ea4b['converted_format'])),util[_0x64dd('0x55')](_0x64dd('0x56'),_0x19ea4b[_0x64dd('0x2d')],_0x19ea4b[_0x64dd('0x50')]));}return null;})['catch'](handleError(_0x55013f,null));};exports[_0x64dd('0x57')]=function(_0x14bf1e,_0x133b9c,_0x1f261e){var _0x13ddfc={'name':path[_0x64dd('0x58')](_0x14bf1e[_0x64dd('0x59')]['originalname'],path[_0x64dd('0x5a')](_0x14bf1e[_0x64dd('0x59')][_0x64dd('0x5b')])),'save_name':path[_0x64dd('0x58')](_0x14bf1e[_0x64dd('0x59')][_0x64dd('0x5c')],path[_0x64dd('0x5a')](_0x14bf1e[_0x64dd('0x59')][_0x64dd('0x5c')])),'original_format':path[_0x64dd('0x5a')](_0x14bf1e[_0x64dd('0x59')][_0x64dd('0x5b')])['substring'](0x1),'converted_format':_0x64dd('0x5d')};var _0x2eab2a=path[_0x64dd('0x4e')](config[_0x64dd('0x54')],'server/files/sounds/original',_0x14bf1e[_0x64dd('0x59')]['filename']);var _0x57dd43=path[_0x64dd('0x4e')](config[_0x64dd('0x54')],_0x64dd('0x4f'),util[_0x64dd('0x55')]('%s.%s',path[_0x64dd('0x58')](_0x14bf1e[_0x64dd('0x59')][_0x64dd('0x5c')],path[_0x64dd('0x5a')](_0x14bf1e['file'][_0x64dd('0x5c')])),_0x13ddfc[_0x64dd('0x50')]));logger[_0x64dd('0x5e')](_0x64dd('0x5f'),_0x2eab2a);logger['info'](_0x64dd('0x60'),_0x57dd43);try{fs['chmodSync'](_0x2eab2a,parseInt(_0x64dd('0x61'),0x8));var _0x21ee66=sox[_0x64dd('0x62')](_0x2eab2a,_0x57dd43,{'sampleRate':0x1f40,'format':_0x64dd('0x5d'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x21ee66['on'](_0x64dd('0x2b'),function(_0xa8ee14){fs[_0x64dd('0x63')](_0x2eab2a);_0x133b9c[_0x64dd('0x1a')](0x1f4)[_0x64dd('0x64')](_0xa8ee14);});_0x21ee66['on'](_0x64dd('0x65'),function(_0x2c0016){_0x13ddfc[_0x64dd('0x66')]=isNaN(_0x2c0016[_0x64dd('0x67')])?null:_0x2c0016['duration']*0x3e8;_0x13ddfc[_0x64dd('0x68')]=isNaN(_0x2c0016[_0x64dd('0x69')])?null:_0x2c0016[_0x64dd('0x69')];_0x13ddfc[_0x64dd('0x6a')]=isNaN(_0x2c0016[_0x64dd('0x6b')])?null:_0x2c0016[_0x64dd('0x6b')];_0x13ddfc[_0x64dd('0x6c')]=isNaN(_0x2c0016[_0x64dd('0x6d')])?null:_0x2c0016['bitRate'];_0x13ddfc[_0x64dd('0x6e')]=isNaN(_0x2c0016['sampleRate'])?null:_0x2c0016[_0x64dd('0x6f')];});_0x21ee66['on'](_0x64dd('0x70'),function(_0x3e4a64){_0x13ddfc[_0x64dd('0x71')]=isNaN(_0x3e4a64[_0x64dd('0x67')])?null:_0x3e4a64[_0x64dd('0x67')]*0x3e8;_0x13ddfc[_0x64dd('0x72')]=isNaN(_0x3e4a64[_0x64dd('0x69')])?null:_0x3e4a64['sampleCount'];_0x13ddfc[_0x64dd('0x73')]=isNaN(_0x3e4a64['channelCount'])?null:_0x3e4a64[_0x64dd('0x6b')];_0x13ddfc[_0x64dd('0x74')]=isNaN(_0x3e4a64[_0x64dd('0x6d')])?null:_0x3e4a64[_0x64dd('0x6d')];_0x13ddfc['converted_sampleRate']=isNaN(_0x3e4a64[_0x64dd('0x6f')])?null:_0x3e4a64[_0x64dd('0x6f')];});_0x21ee66['on']('end',function(){fs['chmodSync'](_0x57dd43,parseInt('0777',0x8));return db[_0x64dd('0x30')][_0x64dd('0x57')](_0x13ddfc)[_0x64dd('0x25')](function(_0x392f11){var _0x833778={'role':_0x14bf1e[_0x64dd('0x75')][_0x64dd('0x76')],'userProfileId':_0x14bf1e[_0x64dd('0x75')]['userProfileId']};if(!_0x833778)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x833778[_0x64dd('0x76')]===_0x64dd('0x77')){var _0x415709=_0x392f11[_0x64dd('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x64dd('0x28'),'userProfileId':_0x833778[_0x64dd('0x78')]},'raw':!![]})[_0x64dd('0x25')](function(_0x4b196){if(_0x4b196&&_0x4b196[_0x64dd('0x79')]===0x0){return db['UserProfileResource'][_0x64dd('0x57')]({'name':_0x415709[_0x64dd('0x2d')],'resourceId':_0x415709['id'],'type':_0x4b196['name'],'sectionId':_0x4b196['id']},{})[_0x64dd('0x25')](function(){return _0x392f11;});}else{return _0x392f11;}})['catch'](function(_0x5ac6e6){logger[_0x64dd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ac6e6);throw _0x5ac6e6;});}return _0x392f11;})[_0x64dd('0x25')](respondWithResult(_0x133b9c,null))[_0x64dd('0x4b')](handleError(_0x133b9c,null));});_0x21ee66[_0x64dd('0x7a')]();}catch(_0x44a60f){_0x133b9c[_0x64dd('0x1a')](0x1f4)[_0x64dd('0x64')](_0x44a60f);}};exports[_0x64dd('0x24')]=function(_0x1ef052,_0xaa8190,_0x19cb5a){return db[_0x64dd('0x30')][_0x64dd('0x4a')]({'where':{'id':_0x1ef052['params']['id']}})[_0x64dd('0x25')](handleEntityNotFound(_0xaa8190,null))[_0x64dd('0x25')](saveUpdates(_[_0x64dd('0x40')](_0x1ef052['body'],[_0x64dd('0x2d'),_0x64dd('0x7b')]),null))[_0x64dd('0x25')](respondWithResult(_0xaa8190,null))[_0x64dd('0x4b')](handleError(_0xaa8190,null));};exports[_0x64dd('0x7c')]=function(_0x1df723,_0x2f2cdb,_0xfb5198){return db[_0x64dd('0x30')][_0x64dd('0x4a')]({'where':{'id':_0x1df723[_0x64dd('0x48')]['id']}})[_0x64dd('0x25')](function(_0x4985ab){if(_0x4985ab){return _0x4985ab[_0x64dd('0x26')]();}})[_0x64dd('0x25')](function(_0x2663a1){var _0x3476a7=path[_0x64dd('0x4e')](config[_0x64dd('0x54')],_0x64dd('0x7d'),util[_0x64dd('0x55')](_0x64dd('0x56'),_0x2663a1[_0x64dd('0x4d')],_0x2663a1[_0x64dd('0x7e')]));var _0x298178=path[_0x64dd('0x4e')](config[_0x64dd('0x54')],'server/files/sounds/converted',util[_0x64dd('0x55')]('%s.%s',_0x2663a1[_0x64dd('0x4d')],_0x2663a1[_0x64dd('0x50')]));fs[_0x64dd('0x63')](_0x3476a7);fs['unlinkSync'](_0x298178);return _0x2663a1;})['then'](function(_0x3dc17f){if(_0x3dc17f){return _0x2f2cdb[_0x64dd('0x1a')](0xcc)[_0x64dd('0x29')]();}})[_0x64dd('0x25')](handleEntityNotFound(_0x2f2cdb,null))[_0x64dd('0x4b')](handleError(_0x2f2cdb,null));};
\ No newline at end of file
index e24b66a..a42177e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09a5=['tools_sounds','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x09a5,0x85));var _0x509a=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x09a5[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x509a('0x0'))(_0x509a('0x1'));var moment=require(_0x509a('0x2'));var BPromise=require('bluebird');var rp=require(_0x509a('0x3'));var fs=require('fs');var path=require(_0x509a('0x4'));var rimraf=require(_0x509a('0x5'));var config=require(_0x509a('0x6'));var attributes=require(_0x509a('0x7'));module[_0x509a('0x8')]=function(_0xbf2b09,_0x48912c){return _0xbf2b09[_0x509a('0x9')](_0x509a('0xa'),attributes,{'tableName':_0x509a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5b9=['rimraf','../../config/environment','exports','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5b9,0xb8));var _0x9c5b=function(_0x4391ee,_0x363e20){_0x4391ee=_0x4391ee-0x0;var _0x46095e=_0xc5b9[_0x4391ee];return _0x46095e;};'use strict';var _=require(_0x9c5b('0x0'));var util=require(_0x9c5b('0x1'));var logger=require(_0x9c5b('0x2'))(_0x9c5b('0x3'));var moment=require(_0x9c5b('0x4'));var BPromise=require(_0x9c5b('0x5'));var rp=require(_0x9c5b('0x6'));var fs=require('fs');var path=require(_0x9c5b('0x7'));var rimraf=require(_0x9c5b('0x8'));var config=require(_0x9c5b('0x9'));var attributes=require('./sound.attributes');module[_0x9c5b('0xa')]=function(_0x215d1a,_0x67a94a){return _0x215d1a['define']('Sound',attributes,{'tableName':_0x9c5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8262297..2a9cac6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe061=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','Sound,\x20%s,\x20%s','message','info','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','model','map','then','lodash','util','moment'];(function(_0x2716e3,_0x4680bb){var _0x1e4ad5=function(_0x4d4c9c){while(--_0x4d4c9c){_0x2716e3['push'](_0x2716e3['shift']());}};_0x1e4ad5(++_0x4680bb);}(_0xe061,0x85));var _0x1e06=function(_0x3ac2cd,_0x153d1a){_0x3ac2cd=_0x3ac2cd-0x0;var _0x3c23ca=_0xe061[_0x3ac2cd];return _0x3c23ca;};'use strict';var _=require(_0x1e06('0x0'));var util=require(_0x1e06('0x1'));var moment=require(_0x1e06('0x2'));var BPromise=require(_0x1e06('0x3'));var rs=require(_0x1e06('0x4'));var fs=require('fs');var Redis=require(_0x1e06('0x5'));var db=require(_0x1e06('0x6'))['db'];var utils=require(_0x1e06('0x7'));var logger=require(_0x1e06('0x8'))(_0x1e06('0x9'));var config=require(_0x1e06('0xa'));var jayson=require(_0x1e06('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x12aa83,_0x26016f,_0x5274d0){return new BPromise(function(_0x566797,_0x4acc53){return client[_0x1e06('0xc')](_0x12aa83,_0x5274d0)['then'](function(_0x592c6f){logger['info']('Sound,\x20%s,\x20%s',_0x26016f,_0x1e06('0xd'));logger[_0x1e06('0xe')](_0x1e06('0xf'),_0x26016f,_0x1e06('0xd'),JSON[_0x1e06('0x10')](_0x592c6f));if(_0x592c6f[_0x1e06('0x11')]){if(_0x592c6f[_0x1e06('0x11')]['code']===0x1f4){logger[_0x1e06('0x11')](_0x1e06('0x12'),_0x26016f,_0x592c6f[_0x1e06('0x11')][_0x1e06('0x13')]);return _0x4acc53(_0x592c6f['error'][_0x1e06('0x13')]);}logger['error'](_0x1e06('0x12'),_0x26016f,_0x592c6f[_0x1e06('0x11')][_0x1e06('0x13')]);return _0x566797(_0x592c6f[_0x1e06('0x11')][_0x1e06('0x13')]);}else{logger[_0x1e06('0x14')]('Sound,\x20%s,\x20%s',_0x26016f,'request\x20sent');_0x566797(_0x592c6f[_0x1e06('0x15')][_0x1e06('0x13')]);}})[_0x1e06('0x16')](function(_0x5b1652){logger['error'](_0x1e06('0x12'),_0x26016f,_0x5b1652);_0x4acc53(_0x5b1652);});});}exports[_0x1e06('0x17')]=function(_0x5ddee7){var _0x5dab02=this;return new Promise(function(_0x1a4080,_0xe8ca74){return db[_0x1e06('0x18')][_0x1e06('0x19')]({'raw':_0x5ddee7[_0x1e06('0x1a')]?_0x5ddee7['options'][_0x1e06('0x1b')]===undefined?!![]:![]:!![],'where':_0x5ddee7[_0x1e06('0x1a')]?_0x5ddee7[_0x1e06('0x1a')][_0x1e06('0x1c')]||null:null,'attributes':_0x5ddee7['options']?_0x5ddee7[_0x1e06('0x1a')][_0x1e06('0x1d')]||null:null,'include':_0x5ddee7[_0x1e06('0x1a')]?_0x5ddee7['options'][_0x1e06('0x1e')]?_['map'](_0x5ddee7[_0x1e06('0x1a')][_0x1e06('0x1e')],function(_0x5e5d32){return{'model':db[_0x5e5d32[_0x1e06('0x1f')]],'as':_0x5e5d32['as'],'attributes':_0x5e5d32[_0x1e06('0x1d')],'include':_0x5e5d32[_0x1e06('0x1e')]?_[_0x1e06('0x20')](_0x5e5d32[_0x1e06('0x1e')],function(_0x31dd0a){return{'model':db[_0x31dd0a[_0x1e06('0x1f')]],'as':_0x31dd0a['as'],'attributes':_0x31dd0a['attributes'],'include':_0x31dd0a[_0x1e06('0x1e')]?_['map'](_0x31dd0a[_0x1e06('0x1e')],function(_0x502f2a){return{'model':db[_0x502f2a[_0x1e06('0x1f')]],'as':_0x502f2a['as'],'attributes':_0x502f2a[_0x1e06('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1e06('0x21')](function(_0x29d159){logger['info'](_0x1e06('0x17'),_0x5ddee7);logger[_0x1e06('0xe')]('ShowSound',_0x5ddee7,JSON[_0x1e06('0x10')](_0x29d159));_0x1a4080(_0x29d159);})[_0x1e06('0x16')](function(_0x590519){logger[_0x1e06('0x11')](_0x1e06('0x17'),_0x590519[_0x1e06('0x13')],_0x5ddee7);_0xe8ca74(_0x5dab02[_0x1e06('0x11')](0x1f4,_0x590519[_0x1e06('0x13')]));});});};
\ No newline at end of file
+var _0xa404=['Sound','find','options','raw','map','include','model','attributes','then','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa404,0x1c9));var _0x4a40=function(_0x120192,_0x2a60dd){_0x120192=_0x120192-0x0;var _0x4418c1=_0xa404[_0x120192];return _0x4418c1;};'use strict';var _=require('lodash');var util=require(_0x4a40('0x0'));var moment=require(_0x4a40('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a40('0x2'));var fs=require('fs');var Redis=require(_0x4a40('0x3'));var db=require(_0x4a40('0x4'))['db'];var utils=require(_0x4a40('0x5'));var logger=require('../../config/logger')(_0x4a40('0x6'));var config=require(_0x4a40('0x7'));var jayson=require(_0x4a40('0x8'));var client=jayson['client'][_0x4a40('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x106daf,_0x51b930,_0x3f3574){return new BPromise(function(_0x48d9f8,_0x54cf55){return client[_0x4a40('0xa')](_0x106daf,_0x3f3574)['then'](function(_0x1eb504){logger[_0x4a40('0xb')](_0x4a40('0xc'),_0x51b930,_0x4a40('0xd'));logger[_0x4a40('0xe')](_0x4a40('0xf'),_0x51b930,_0x4a40('0xd'),JSON[_0x4a40('0x10')](_0x1eb504));if(_0x1eb504[_0x4a40('0x11')]){if(_0x1eb504[_0x4a40('0x11')][_0x4a40('0x12')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x51b930,_0x1eb504[_0x4a40('0x11')]['message']);return _0x54cf55(_0x1eb504[_0x4a40('0x11')][_0x4a40('0x13')]);}logger[_0x4a40('0x11')](_0x4a40('0xc'),_0x51b930,_0x1eb504[_0x4a40('0x11')][_0x4a40('0x13')]);return _0x48d9f8(_0x1eb504['error'][_0x4a40('0x13')]);}else{logger['info'](_0x4a40('0xc'),_0x51b930,'request\x20sent');_0x48d9f8(_0x1eb504[_0x4a40('0x14')][_0x4a40('0x13')]);}})[_0x4a40('0x15')](function(_0x5eda96){logger[_0x4a40('0x11')](_0x4a40('0xc'),_0x51b930,_0x5eda96);_0x54cf55(_0x5eda96);});});}exports[_0x4a40('0x16')]=function(_0x2f6bbf){var _0x386c1b=this;return new Promise(function(_0x3541ac,_0xf1001f){return db[_0x4a40('0x17')][_0x4a40('0x18')]({'raw':_0x2f6bbf[_0x4a40('0x19')]?_0x2f6bbf[_0x4a40('0x19')][_0x4a40('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f6bbf[_0x4a40('0x19')]?_0x2f6bbf[_0x4a40('0x19')]['where']||null:null,'attributes':_0x2f6bbf['options']?_0x2f6bbf[_0x4a40('0x19')]['attributes']||null:null,'include':_0x2f6bbf[_0x4a40('0x19')]?_0x2f6bbf[_0x4a40('0x19')]['include']?_[_0x4a40('0x1b')](_0x2f6bbf[_0x4a40('0x19')][_0x4a40('0x1c')],function(_0x43ca18){return{'model':db[_0x43ca18[_0x4a40('0x1d')]],'as':_0x43ca18['as'],'attributes':_0x43ca18['attributes'],'include':_0x43ca18['include']?_['map'](_0x43ca18[_0x4a40('0x1c')],function(_0x238fa6){return{'model':db[_0x238fa6[_0x4a40('0x1d')]],'as':_0x238fa6['as'],'attributes':_0x238fa6[_0x4a40('0x1e')],'include':_0x238fa6[_0x4a40('0x1c')]?_['map'](_0x238fa6[_0x4a40('0x1c')],function(_0x5aa303){return{'model':db[_0x5aa303[_0x4a40('0x1d')]],'as':_0x5aa303['as'],'attributes':_0x5aa303[_0x4a40('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a40('0x1f')](function(_0x245e3f){logger[_0x4a40('0xb')](_0x4a40('0x16'),_0x2f6bbf);logger[_0x4a40('0xe')](_0x4a40('0x16'),_0x2f6bbf,JSON[_0x4a40('0x10')](_0x245e3f));_0x3541ac(_0x245e3f);})[_0x4a40('0x15')](function(_0x751089){logger['error'](_0x4a40('0x16'),_0x751089['message'],_0x2f6bbf);_0xf1001f(_0x386c1b[_0x4a40('0x11')](0x1f4,_0x751089[_0x4a40('0x13')]));});});};
\ No newline at end of file
index 82a9b1b..97920c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x508e17,_0x1a0cb6){var _0x485044=function(_0xd31847){while(--_0xd31847){_0x508e17['push'](_0x508e17['shift']());}};_0x485044(++_0x1a0cb6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0xb7e7[_0x5d80de];return _0x1c7556;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
+var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x229354,_0xfe2ef8){var _0x545296=function(_0xe77bef){while(--_0xe77bef){_0x229354['push'](_0x229354['shift']());}};_0x545296(++_0xfe2ef8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router;
\ No newline at end of file
index ae602ee..a594425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7abe=['TEXT','medium','ENUM','out','sequelize','STRING'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x7abe,0xf4));var _0xe7ab=function(_0x4a4eb6,_0x34e9a3){_0x4a4eb6=_0x4a4eb6-0x0;var _0x105085=_0x7abe[_0x4a4eb6];return _0x105085;};'use strict';var Sequelize=require(_0xe7ab('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe7ab('0x1')]},'body':{'type':Sequelize[_0xe7ab('0x2')](_0xe7ab('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xe7ab('0x4')]('in',_0xe7ab('0x5')),'defaultValue':_0xe7ab('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xe7ab('0x1')]},'providerResponse':{'type':Sequelize[_0xe7ab('0x2')]}};
\ No newline at end of file
+var _0x5d7c=['ENUM','out','sequelize','STRING','TEXT','medium'];(function(_0x561580,_0x3dde94){var _0x258184=function(_0x1d18c3){while(--_0x1d18c3){_0x561580['push'](_0x561580['shift']());}};_0x258184(++_0x3dde94);}(_0x5d7c,0x116));var _0xc5d7=function(_0x4f7bc4,_0x1bcc07){_0x4f7bc4=_0x4f7bc4-0x0;var _0x3b347f=_0x5d7c[_0x4f7bc4];return _0x3b347f;};'use strict';var Sequelize=require(_0xc5d7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc5d7('0x1')]},'body':{'type':Sequelize[_0xc5d7('0x2')](_0xc5d7('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xc5d7('0x4')]('in',_0xc5d7('0x5')),'defaultValue':_0xc5d7('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc5d7('0x1')]},'providerResponse':{'type':Sequelize[_0xc5d7('0x2')]}};
\ No newline at end of file
index d1d4a9e..7f944e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x556a=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','update','then','destroy','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','key'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x556a,0x1dd));var _0xa556=function(_0xa12506,_0x31ef96){_0xa12506=_0xa12506-0x0;var _0x2a836e=_0x556a[_0xa12506];return _0x2a836e;};'use strict';var emlformat=require(_0xa556('0x0'));var rimraf=require(_0xa556('0x1'));var zipdir=require(_0xa556('0x2'));var jsonpatch=require(_0xa556('0x3'));var rp=require(_0xa556('0x4'));var moment=require(_0xa556('0x5'));var BPromise=require(_0xa556('0x6'));var Mustache=require(_0xa556('0x7'));var util=require(_0xa556('0x8'));var path=require('path');var sox=require(_0xa556('0x9'));var csv=require(_0xa556('0xa'));var ejs=require(_0xa556('0xb'));var fs=require('fs');var fs_extra=require(_0xa556('0xc'));var _=require(_0xa556('0xd'));var squel=require('squel');var crypto=require(_0xa556('0xe'));var jsforce=require(_0xa556('0xf'));var deskjs=require(_0xa556('0x10'));var toCsv=require(_0xa556('0xa'));var querystring=require('querystring');var Papa=require(_0xa556('0x11'));var Redis=require(_0xa556('0x12'));var authService=require(_0xa556('0x13'));var qs=require(_0xa556('0x14'));var as=require(_0xa556('0x15'));var hardwareService=require(_0xa556('0x16'));var logger=require(_0xa556('0x17'))(_0xa556('0x18'));var utils=require('../../config/utils');var config=require(_0xa556('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa556('0x1a'))['db'];function respondWithStatusCode(_0x552788,_0x562211){_0x562211=_0x562211||0xcc;return function(_0x2de803){if(_0x2de803){return _0x552788[_0xa556('0x1b')](_0x562211);}return _0x552788[_0xa556('0x1c')](_0x562211)[_0xa556('0x1d')]();};}function respondWithResult(_0x59b04e,_0x2f20cb){_0x2f20cb=_0x2f20cb||0xc8;return function(_0x10f9bc){if(_0x10f9bc){return _0x59b04e[_0xa556('0x1c')](_0x2f20cb)[_0xa556('0x1e')](_0x10f9bc);}};}function respondWithFilteredResult(_0x1f8b7c,_0x570ed0){return function(_0x5cee6c){if(_0x5cee6c){var _0xbdb988=typeof _0x570ed0[_0xa556('0x1f')]==='undefined'&&typeof _0x570ed0[_0xa556('0x20')]==='undefined';var _0x47b96a=_0x5cee6c[_0xa556('0x21')];var _0x529879=_0xbdb988?0x0:_0x570ed0[_0xa556('0x1f')];var _0x46b205=_0xbdb988?_0x5cee6c[_0xa556('0x21')]:_0x570ed0[_0xa556('0x1f')]+_0x570ed0['limit'];var _0x452e6f;if(_0x46b205>=_0x47b96a){_0x46b205=_0x47b96a;_0x452e6f=0xc8;}else{_0x452e6f=0xce;}_0x1f8b7c[_0xa556('0x1c')](_0x452e6f);return _0x1f8b7c[_0xa556('0x22')]('Content-Range',_0x529879+'-'+_0x46b205+'/'+_0x47b96a)[_0xa556('0x1e')](_0x5cee6c);}return null;};}function patchUpdates(_0x11ab73){return function(_0x5bfa4d){try{jsonpatch['apply'](_0x5bfa4d,_0x11ab73,!![]);}catch(_0x31c8c6){return BPromise[_0xa556('0x23')](_0x31c8c6);}return _0x5bfa4d['save']();};}function saveUpdates(_0x22e9d0,_0x50bc16){return function(_0x22718a){if(_0x22718a){return _0x22718a[_0xa556('0x24')](_0x22e9d0)[_0xa556('0x25')](function(_0x39cae2){return _0x39cae2;});}return null;};}function removeEntity(_0x3e8628,_0xfb4dda){return function(_0x1bcecb){if(_0x1bcecb){return _0x1bcecb[_0xa556('0x26')]()[_0xa556('0x25')](function(){_0x3e8628[_0xa556('0x1c')](0xcc)[_0xa556('0x1d')]();});}};}function handleEntityNotFound(_0xec6fbb,_0x4bf442){return function(_0x2ca8b6){if(!_0x2ca8b6){_0xec6fbb[_0xa556('0x1b')](0x194);}return _0x2ca8b6;};}function handleError(_0x518557,_0x20ec86){_0x20ec86=_0x20ec86||0x1f4;return function(_0x169d01){logger['error'](_0x169d01[_0xa556('0x27')]);if(_0x169d01[_0xa556('0x28')]){delete _0x169d01[_0xa556('0x28')];}_0x518557['status'](_0x20ec86)[_0xa556('0x29')](_0x169d01);};}exports[_0xa556('0x2a')]=function(_0x19f1b8,_0x57da1a){var _0x25dab6={},_0x1f5ce4={},_0x20accc={'count':0x0,'rows':[]};var _0x385fb1=_[_0xa556('0x2b')](db[_0xa556('0x2c')][_0xa556('0x2d')],function(_0x4d0a30){return{'name':_0x4d0a30[_0xa556('0x2e')],'type':_0x4d0a30['type'][_0xa556('0x2f')]};});_0x1f5ce4[_0xa556('0x30')]=_[_0xa556('0x2b')](_0x385fb1,_0xa556('0x28'));_0x1f5ce4[_0xa556('0x31')]=_[_0xa556('0x32')](_0x19f1b8[_0xa556('0x31')]);_0x1f5ce4['filters']=_[_0xa556('0x33')](_0x1f5ce4[_0xa556('0x30')],_0x1f5ce4[_0xa556('0x31')]);_0x25dab6[_0xa556('0x34')]=_[_0xa556('0x33')](_0x1f5ce4[_0xa556('0x30')],qs[_0xa556('0x35')](_0x19f1b8[_0xa556('0x31')][_0xa556('0x35')]));_0x25dab6['attributes']=_0x25dab6[_0xa556('0x34')][_0xa556('0x36')]?_0x25dab6[_0xa556('0x34')]:_0x1f5ce4['model'];if(!_0x19f1b8[_0xa556('0x31')][_0xa556('0x37')](_0xa556('0x38'))){_0x25dab6[_0xa556('0x20')]=qs['limit'](_0x19f1b8[_0xa556('0x31')]['limit']);_0x25dab6[_0xa556('0x1f')]=qs['offset'](_0x19f1b8[_0xa556('0x31')][_0xa556('0x1f')]);}_0x25dab6[_0xa556('0x39')]=qs[_0xa556('0x3a')](_0x19f1b8[_0xa556('0x31')]['sort']);_0x25dab6['where']=qs[_0xa556('0x3b')](_[_0xa556('0x3c')](_0x19f1b8[_0xa556('0x31')],_0x1f5ce4[_0xa556('0x3b')]),_0x385fb1);if(_0x19f1b8[_0xa556('0x31')][_0xa556('0x3d')]){_0x25dab6[_0xa556('0x3e')]=_[_0xa556('0x3f')](_0x25dab6[_0xa556('0x3e')],{'$or':_[_0xa556('0x2b')](_0x385fb1,function(_0x1cd7e0){if(_0x1cd7e0[_0xa556('0x40')]!==_0xa556('0x41')){var _0x3a4d27={};_0x3a4d27[_0x1cd7e0[_0xa556('0x28')]]={'$like':'%'+_0x19f1b8['query'][_0xa556('0x3d')]+'%'};return _0x3a4d27;}})});}_0x25dab6=_[_0xa556('0x3f')]({},_0x25dab6,_0x19f1b8[_0xa556('0x42')]);var _0x2fc959={'where':_0x25dab6['where']};return db[_0xa556('0x2c')][_0xa556('0x21')](_0x2fc959)[_0xa556('0x25')](function(_0x41bc2e){_0x20accc[_0xa556('0x21')]=_0x41bc2e;if(_0x19f1b8['query'][_0xa556('0x43')]){_0x25dab6[_0xa556('0x44')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x25dab6);})[_0xa556('0x25')](function(_0x544579){_0x20accc[_0xa556('0x45')]=_0x544579;return _0x20accc;})['then'](respondWithFilteredResult(_0x57da1a,_0x25dab6))[_0xa556('0x46')](handleError(_0x57da1a,null));};exports['show']=function(_0x483475,_0x48f2dc){var _0x5b405c={'raw':!![],'where':{'id':_0x483475[_0xa556('0x47')]['id']}},_0x3c700e={};_0x3c700e['model']=_[_0xa556('0x32')](db[_0xa556('0x2c')]['rawAttributes']);_0x3c700e['query']=_[_0xa556('0x32')](_0x483475['query']);_0x3c700e['filters']=_['intersection'](_0x3c700e[_0xa556('0x30')],_0x3c700e[_0xa556('0x31')]);_0x5b405c['attributes']=_[_0xa556('0x33')](_0x3c700e[_0xa556('0x30')],qs[_0xa556('0x35')](_0x483475['query']['fields']));_0x5b405c[_0xa556('0x34')]=_0x5b405c[_0xa556('0x34')][_0xa556('0x36')]?_0x5b405c[_0xa556('0x34')]:_0x3c700e[_0xa556('0x30')];if(_0x483475[_0xa556('0x31')]['includeAll']){_0x5b405c['include']=[{'all':!![]}];}_0x5b405c=_['merge']({},_0x5b405c,_0x483475[_0xa556('0x42')]);return db[_0xa556('0x2c')]['find'](_0x5b405c)[_0xa556('0x25')](handleEntityNotFound(_0x48f2dc,null))['then'](respondWithResult(_0x48f2dc,null))[_0xa556('0x46')](handleError(_0x48f2dc,null));};exports[_0xa556('0x48')]=function(_0x213c4d,_0x3cd157){return db['SquareMessage'][_0xa556('0x48')](_0x213c4d[_0xa556('0x49')],{})[_0xa556('0x25')](respondWithResult(_0x3cd157,0xc9))[_0xa556('0x46')](handleError(_0x3cd157,null));};exports[_0xa556('0x24')]=function(_0x64781a,_0x41171c){if(_0x64781a['body']['id']){delete _0x64781a[_0xa556('0x49')]['id'];}return db[_0xa556('0x2c')]['find']({'where':{'id':_0x64781a[_0xa556('0x47')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x41171c,null))[_0xa556('0x25')](saveUpdates(_0x64781a['body'],null))[_0xa556('0x25')](respondWithResult(_0x41171c,null))[_0xa556('0x46')](handleError(_0x41171c,null));};exports[_0xa556('0x26')]=function(_0x1256a6,_0x1536eb){return db[_0xa556('0x2c')][_0xa556('0x4a')]({'where':{'id':_0x1256a6[_0xa556('0x47')]['id']}})[_0xa556('0x25')](handleEntityNotFound(_0x1536eb,null))[_0xa556('0x25')](removeEntity(_0x1536eb,null))['catch'](handleError(_0x1536eb,null));};
\ No newline at end of file
+var _0x61c2=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','sendStatus','error','stack','name','index','map','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','SquareMessage','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','fs-extra'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x61c2,0x11f));var _0x261c=function(_0x5a346b,_0x107187){_0x5a346b=_0x5a346b-0x0;var _0x35b2e0=_0x61c2[_0x5a346b];return _0x35b2e0;};'use strict';var emlformat=require(_0x261c('0x0'));var rimraf=require(_0x261c('0x1'));var zipdir=require(_0x261c('0x2'));var jsonpatch=require(_0x261c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x261c('0x4'));var Mustache=require(_0x261c('0x5'));var util=require(_0x261c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x261c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x261c('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x261c('0x9'));var jsforce=require(_0x261c('0xa'));var deskjs=require(_0x261c('0xb'));var toCsv=require(_0x261c('0x7'));var querystring=require(_0x261c('0xc'));var Papa=require(_0x261c('0xd'));var Redis=require(_0x261c('0xe'));var authService=require(_0x261c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x261c('0x10'));var hardwareService=require(_0x261c('0x11'));var logger=require(_0x261c('0x12'))('api');var utils=require(_0x261c('0x13'));var config=require(_0x261c('0x14'));var licenseUtil=require(_0x261c('0x15'));var db=require(_0x261c('0x16'))['db'];function respondWithStatusCode(_0x56e550,_0x3caf40){_0x3caf40=_0x3caf40||0xcc;return function(_0x2f232e){if(_0x2f232e){return _0x56e550['sendStatus'](_0x3caf40);}return _0x56e550[_0x261c('0x17')](_0x3caf40)[_0x261c('0x18')]();};}function respondWithResult(_0x4da031,_0x1c5a24){_0x1c5a24=_0x1c5a24||0xc8;return function(_0x2132df){if(_0x2132df){return _0x4da031[_0x261c('0x17')](_0x1c5a24)[_0x261c('0x19')](_0x2132df);}};}function respondWithFilteredResult(_0x48fd51,_0x3a6ad9){return function(_0x27a3c9){if(_0x27a3c9){var _0x234a12=typeof _0x3a6ad9['offset']===_0x261c('0x1a')&&typeof _0x3a6ad9[_0x261c('0x1b')]===_0x261c('0x1a');var _0x26dad1=_0x27a3c9[_0x261c('0x1c')];var _0x2dd3b6=_0x234a12?0x0:_0x3a6ad9[_0x261c('0x1d')];var _0x5786f0=_0x234a12?_0x27a3c9[_0x261c('0x1c')]:_0x3a6ad9[_0x261c('0x1d')]+_0x3a6ad9[_0x261c('0x1b')];var _0x127202;if(_0x5786f0>=_0x26dad1){_0x5786f0=_0x26dad1;_0x127202=0xc8;}else{_0x127202=0xce;}_0x48fd51['status'](_0x127202);return _0x48fd51[_0x261c('0x1e')](_0x261c('0x1f'),_0x2dd3b6+'-'+_0x5786f0+'/'+_0x26dad1)[_0x261c('0x19')](_0x27a3c9);}return null;};}function patchUpdates(_0x5f3288){return function(_0x4cd1e0){try{jsonpatch[_0x261c('0x20')](_0x4cd1e0,_0x5f3288,!![]);}catch(_0x35bd3f){return BPromise['reject'](_0x35bd3f);}return _0x4cd1e0[_0x261c('0x21')]();};}function saveUpdates(_0x13a947,_0x8fea){return function(_0x5a45da){if(_0x5a45da){return _0x5a45da[_0x261c('0x22')](_0x13a947)['then'](function(_0x513bc3){return _0x513bc3;});}return null;};}function removeEntity(_0x56e7cd,_0x173cbc){return function(_0x398b2c){if(_0x398b2c){return _0x398b2c[_0x261c('0x23')]()[_0x261c('0x24')](function(){_0x56e7cd[_0x261c('0x17')](0xcc)[_0x261c('0x18')]();});}};}function handleEntityNotFound(_0x10a041,_0x5131c9){return function(_0x9cb234){if(!_0x9cb234){_0x10a041[_0x261c('0x25')](0x194);}return _0x9cb234;};}function handleError(_0x1ad2fd,_0x91bdd0){_0x91bdd0=_0x91bdd0||0x1f4;return function(_0x295a25){logger[_0x261c('0x26')](_0x295a25[_0x261c('0x27')]);if(_0x295a25[_0x261c('0x28')]){delete _0x295a25[_0x261c('0x28')];}_0x1ad2fd[_0x261c('0x17')](_0x91bdd0)['send'](_0x295a25);};}exports[_0x261c('0x29')]=function(_0x21147d,_0xbeb7f4){var _0xd8f8a5={},_0x2d66cc={},_0x20a385={'count':0x0,'rows':[]};var _0x28ff6d=_[_0x261c('0x2a')](db['SquareMessage']['rawAttributes'],function(_0x1fd691){return{'name':_0x1fd691[_0x261c('0x2b')],'type':_0x1fd691[_0x261c('0x2c')]['key']};});_0x2d66cc['model']=_[_0x261c('0x2a')](_0x28ff6d,_0x261c('0x28'));_0x2d66cc[_0x261c('0x2d')]=_[_0x261c('0x2e')](_0x21147d['query']);_0x2d66cc[_0x261c('0x2f')]=_[_0x261c('0x30')](_0x2d66cc[_0x261c('0x31')],_0x2d66cc[_0x261c('0x2d')]);_0xd8f8a5['attributes']=_['intersection'](_0x2d66cc[_0x261c('0x31')],qs[_0x261c('0x32')](_0x21147d[_0x261c('0x2d')][_0x261c('0x32')]));_0xd8f8a5['attributes']=_0xd8f8a5[_0x261c('0x33')][_0x261c('0x34')]?_0xd8f8a5[_0x261c('0x33')]:_0x2d66cc['model'];if(!_0x21147d[_0x261c('0x2d')][_0x261c('0x35')]('nolimit')){_0xd8f8a5[_0x261c('0x1b')]=qs[_0x261c('0x1b')](_0x21147d[_0x261c('0x2d')][_0x261c('0x1b')]);_0xd8f8a5['offset']=qs['offset'](_0x21147d['query'][_0x261c('0x1d')]);}_0xd8f8a5[_0x261c('0x36')]=qs[_0x261c('0x37')](_0x21147d[_0x261c('0x2d')][_0x261c('0x37')]);_0xd8f8a5['where']=qs['filters'](_[_0x261c('0x38')](_0x21147d[_0x261c('0x2d')],_0x2d66cc[_0x261c('0x2f')]),_0x28ff6d);if(_0x21147d['query'][_0x261c('0x39')]){_0xd8f8a5[_0x261c('0x3a')]=_[_0x261c('0x3b')](_0xd8f8a5[_0x261c('0x3a')],{'$or':_[_0x261c('0x2a')](_0x28ff6d,function(_0x1d8d14){if(_0x1d8d14[_0x261c('0x2c')]!==_0x261c('0x3c')){var _0x27ecf7={};_0x27ecf7[_0x1d8d14[_0x261c('0x28')]]={'$like':'%'+_0x21147d[_0x261c('0x2d')]['filter']+'%'};return _0x27ecf7;}})});}_0xd8f8a5=_[_0x261c('0x3b')]({},_0xd8f8a5,_0x21147d[_0x261c('0x3d')]);var _0x18c626={'where':_0xd8f8a5['where']};return db['SquareMessage']['count'](_0x18c626)['then'](function(_0x314085){_0x20a385[_0x261c('0x1c')]=_0x314085;if(_0x21147d[_0x261c('0x2d')][_0x261c('0x3e')]){_0xd8f8a5['include']=[{'all':!![]}];}return db['SquareMessage'][_0x261c('0x3f')](_0xd8f8a5);})[_0x261c('0x24')](function(_0x5580fd){_0x20a385[_0x261c('0x40')]=_0x5580fd;return _0x20a385;})['then'](respondWithFilteredResult(_0xbeb7f4,_0xd8f8a5))['catch'](handleError(_0xbeb7f4,null));};exports[_0x261c('0x41')]=function(_0x27a9ba,_0x5b9e6a){var _0x570d92={'raw':!![],'where':{'id':_0x27a9ba[_0x261c('0x42')]['id']}},_0x29364d={};_0x29364d[_0x261c('0x31')]=_[_0x261c('0x2e')](db['SquareMessage'][_0x261c('0x43')]);_0x29364d[_0x261c('0x2d')]=_[_0x261c('0x2e')](_0x27a9ba[_0x261c('0x2d')]);_0x29364d[_0x261c('0x2f')]=_['intersection'](_0x29364d[_0x261c('0x31')],_0x29364d['query']);_0x570d92[_0x261c('0x33')]=_['intersection'](_0x29364d[_0x261c('0x31')],qs[_0x261c('0x32')](_0x27a9ba[_0x261c('0x2d')]['fields']));_0x570d92[_0x261c('0x33')]=_0x570d92['attributes'][_0x261c('0x34')]?_0x570d92['attributes']:_0x29364d[_0x261c('0x31')];if(_0x27a9ba[_0x261c('0x2d')]['includeAll']){_0x570d92[_0x261c('0x44')]=[{'all':!![]}];}_0x570d92=_[_0x261c('0x3b')]({},_0x570d92,_0x27a9ba['options']);return db[_0x261c('0x45')][_0x261c('0x46')](_0x570d92)[_0x261c('0x24')](handleEntityNotFound(_0x5b9e6a,null))[_0x261c('0x24')](respondWithResult(_0x5b9e6a,null))[_0x261c('0x47')](handleError(_0x5b9e6a,null));};exports['create']=function(_0x37a768,_0x3a80dc){return db['SquareMessage'][_0x261c('0x48')](_0x37a768[_0x261c('0x49')],{})[_0x261c('0x24')](respondWithResult(_0x3a80dc,0xc9))[_0x261c('0x47')](handleError(_0x3a80dc,null));};exports[_0x261c('0x22')]=function(_0x23de42,_0x4f09f6){if(_0x23de42[_0x261c('0x49')]['id']){delete _0x23de42[_0x261c('0x49')]['id'];}return db['SquareMessage'][_0x261c('0x46')]({'where':{'id':_0x23de42[_0x261c('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f09f6,null))[_0x261c('0x24')](saveUpdates(_0x23de42[_0x261c('0x49')],null))[_0x261c('0x24')](respondWithResult(_0x4f09f6,null))[_0x261c('0x47')](handleError(_0x4f09f6,null));};exports[_0x261c('0x23')]=function(_0x5780ab,_0x3f3fa4){return db[_0x261c('0x45')][_0x261c('0x46')]({'where':{'id':_0x5780ab[_0x261c('0x42')]['id']}})[_0x261c('0x24')](handleEntityNotFound(_0x3f3fa4,null))['then'](removeEntity(_0x3f3fa4,null))['catch'](handleError(_0x3f3fa4,null));};
\ No newline at end of file
index f9deed5..e33b6f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x916f=['moment','bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','util','api'];(function(_0x526eb9,_0x54fa63){var _0x52f83b=function(_0x3f8e07){while(--_0x3f8e07){_0x526eb9['push'](_0x526eb9['shift']());}};_0x52f83b(++_0x54fa63);}(_0x916f,0x141));var _0xf916=function(_0x559bc4,_0x1c5809){_0x559bc4=_0x559bc4-0x0;var _0x140122=_0x916f[_0x559bc4];return _0x140122;};'use strict';var _=require(_0xf916('0x0'));var util=require(_0xf916('0x1'));var logger=require('../../config/logger')(_0xf916('0x2'));var moment=require(_0xf916('0x3'));var BPromise=require(_0xf916('0x4'));var rp=require(_0xf916('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf916('0x6'));var config=require(_0xf916('0x7'));var attributes=require(_0xf916('0x8'));module['exports']=function(_0x3fd8b6,_0x405fe7){return _0x3fd8b6[_0xf916('0x9')](_0xf916('0xa'),attributes,{'tableName':_0xf916('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f94=['path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x11ff24,_0x4e7385){var _0x59f49c=function(_0x32dfb8){while(--_0x32dfb8){_0x11ff24['push'](_0x11ff24['shift']());}};_0x59f49c(++_0x4e7385);}(_0x9f94,0x1e7));var _0x49f9=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9f94[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var logger=require(_0x49f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x49f9('0x3'));var rp=require(_0x49f9('0x4'));var fs=require('fs');var path=require(_0x49f9('0x5'));var rimraf=require(_0x49f9('0x6'));var config=require(_0x49f9('0x7'));var attributes=require('./squareMessage.attributes');module[_0x49f9('0x8')]=function(_0x31a7fe,_0x3cd35a){return _0x31a7fe[_0x49f9('0x9')](_0x49f9('0xa'),attributes,{'tableName':_0x49f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2633549..51b2b04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01cb=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body','options','raw','then','CreateSquareMessage','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3b765f,_0xaac966){var _0x152f0=function(_0x2ae249){while(--_0x2ae249){_0x3b765f['push'](_0x3b765f['shift']());}};_0x152f0(++_0xaac966);}(_0x01cb,0x124));var _0xb01c=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x01cb[_0x247fa1];return _0x244f35;};'use strict';var _=require(_0xb01c('0x0'));var util=require(_0xb01c('0x1'));var moment=require('moment');var BPromise=require(_0xb01c('0x2'));var rs=require(_0xb01c('0x3'));var fs=require('fs');var Redis=require(_0xb01c('0x4'));var db=require(_0xb01c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb01c('0x6'))(_0xb01c('0x7'));var config=require('../../config/environment');var jayson=require(_0xb01c('0x8'));var client=jayson['client'][_0xb01c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11b1ca,_0x167991,_0x512ba4){return new BPromise(function(_0x12b586,_0x5dd9f6){return client[_0xb01c('0xa')](_0x11b1ca,_0x512ba4)['then'](function(_0x133b9e){logger[_0xb01c('0xb')](_0xb01c('0xc'),_0x167991,_0xb01c('0xd'));logger[_0xb01c('0xe')](_0xb01c('0xf'),_0x167991,_0xb01c('0xd'),JSON[_0xb01c('0x10')](_0x133b9e));if(_0x133b9e['error']){if(_0x133b9e[_0xb01c('0x11')][_0xb01c('0x12')]===0x1f4){logger[_0xb01c('0x11')](_0xb01c('0xc'),_0x167991,_0x133b9e[_0xb01c('0x11')][_0xb01c('0x13')]);return _0x5dd9f6(_0x133b9e[_0xb01c('0x11')][_0xb01c('0x13')]);}logger[_0xb01c('0x11')]('SquareMessage,\x20%s,\x20%s',_0x167991,_0x133b9e[_0xb01c('0x11')][_0xb01c('0x13')]);return _0x12b586(_0x133b9e[_0xb01c('0x11')]['message']);}else{logger[_0xb01c('0xb')]('SquareMessage,\x20%s,\x20%s',_0x167991,'request\x20sent');_0x12b586(_0x133b9e[_0xb01c('0x14')]['message']);}})[_0xb01c('0x15')](function(_0x2dfcf3){logger[_0xb01c('0x11')](_0xb01c('0xc'),_0x167991,_0x2dfcf3);_0x5dd9f6(_0x2dfcf3);});});}exports['CreateSquareMessage']=function(_0x288768){var _0x38beec=this;return new Promise(function(_0x6dac3d,_0x4b53e8){return db['SquareMessage']['create'](_0x288768[_0xb01c('0x16')],{'raw':_0x288768['options']?_0x288768[_0xb01c('0x17')][_0xb01c('0x18')]===undefined?!![]:![]:!![]})[_0xb01c('0x19')](function(_0x83766b){logger['info'](_0xb01c('0x1a'),_0x288768);logger[_0xb01c('0xe')](_0xb01c('0x1a'),_0x288768,JSON[_0xb01c('0x10')](_0x83766b));_0x6dac3d(_0x83766b);})[_0xb01c('0x15')](function(_0x665c46){logger['error'](_0xb01c('0x1a'),_0x665c46['message'],_0x288768);_0x4b53e8(_0x38beec['error'](0x1f4,_0x665c46[_0xb01c('0x13')]));});});};
\ No newline at end of file
+var _0x87c4=['message','result','SquareMessage','create','body','options','raw','CreateSquareMessage','stringify','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x41d876,_0x3854cd){var _0x1b63ee=function(_0x2c9710){while(--_0x2c9710){_0x41d876['push'](_0x41d876['shift']());}};_0x1b63ee(++_0x3854cd);}(_0x87c4,0x7a));var _0x487c=function(_0x56f1a9,_0x18ab59){_0x56f1a9=_0x56f1a9-0x0;var _0x3df1e9=_0x87c4[_0x56f1a9];return _0x3df1e9;};'use strict';var _=require(_0x487c('0x0'));var util=require(_0x487c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x487c('0x2'));var fs=require('fs');var Redis=require(_0x487c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x487c('0x4'));var logger=require(_0x487c('0x5'))('rpc');var config=require(_0x487c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x487c('0x7')][_0x487c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3bd15c,_0x560320,_0x5a9521){return new BPromise(function(_0x23c0d8,_0x39cbf9){return client[_0x487c('0x9')](_0x3bd15c,_0x5a9521)[_0x487c('0xa')](function(_0x331b0b){logger[_0x487c('0xb')](_0x487c('0xc'),_0x560320,'request\x20sent');logger[_0x487c('0xd')](_0x487c('0xe'),_0x560320,_0x487c('0xf'),JSON['stringify'](_0x331b0b));if(_0x331b0b['error']){if(_0x331b0b[_0x487c('0x10')][_0x487c('0x11')]===0x1f4){logger[_0x487c('0x10')](_0x487c('0xc'),_0x560320,_0x331b0b[_0x487c('0x10')]['message']);return _0x39cbf9(_0x331b0b[_0x487c('0x10')][_0x487c('0x12')]);}logger['error'](_0x487c('0xc'),_0x560320,_0x331b0b['error'][_0x487c('0x12')]);return _0x23c0d8(_0x331b0b[_0x487c('0x10')]['message']);}else{logger[_0x487c('0xb')](_0x487c('0xc'),_0x560320,'request\x20sent');_0x23c0d8(_0x331b0b[_0x487c('0x13')][_0x487c('0x12')]);}})['catch'](function(_0x4edfff){logger['error'](_0x487c('0xc'),_0x560320,_0x4edfff);_0x39cbf9(_0x4edfff);});});}exports['CreateSquareMessage']=function(_0x5308db){var _0x3b1e63=this;return new Promise(function(_0x18f768,_0x231fd3){return db[_0x487c('0x14')][_0x487c('0x15')](_0x5308db[_0x487c('0x16')],{'raw':_0x5308db['options']?_0x5308db[_0x487c('0x17')][_0x487c('0x18')]===undefined?!![]:![]:!![]})[_0x487c('0xa')](function(_0x397948){logger['info'](_0x487c('0x19'),_0x5308db);logger[_0x487c('0xd')](_0x487c('0x19'),_0x5308db,JSON[_0x487c('0x1a')](_0x397948));_0x18f768(_0x397948);})[_0x487c('0x1b')](function(_0x5aa103){logger[_0x487c('0x10')](_0x487c('0x19'),_0x5aa103['message'],_0x5308db);_0x231fd3(_0x3b1e63[_0x487c('0x10')](0x1f4,_0x5aa103['message']));});});};
\ No newline at end of file
index 5c8f1c5..93a7148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad50=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','15s','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x15dac9,_0x3f9493){var _0x122b1b=function(_0x5cf148){while(--_0x5cf148){_0x15dac9['push'](_0x15dac9['shift']());}};_0x122b1b(++_0x3f9493);}(_0xad50,0xe0));var _0x0ad5=function(_0x352d28,_0x444033){_0x352d28=_0x352d28-0x0;var _0x387d7e=_0xad50[_0x352d28];return _0x387d7e;};'use strict';var multer=require(_0x0ad5('0x0'));var util=require(_0x0ad5('0x1'));var path=require(_0x0ad5('0x2'));var timeout=require(_0x0ad5('0x3'));var express=require(_0x0ad5('0x4'));var router=express[_0x0ad5('0x5')]();var fs_extra=require(_0x0ad5('0x6'));var auth=require(_0x0ad5('0x7'));var interaction=require(_0x0ad5('0x8'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x0ad5('0x9')]('/',auth['isAuthenticated'](),controller[_0x0ad5('0xa')]);router[_0x0ad5('0x9')](_0x0ad5('0xb'),auth[_0x0ad5('0xc')](),controller[_0x0ad5('0xd')]);router[_0x0ad5('0x9')]('/:id/test',auth[_0x0ad5('0xc')](),timeout(_0x0ad5('0xe')),controller['test']);router[_0x0ad5('0xf')]('/',auth['isAuthenticated'](),controller[_0x0ad5('0x10')]);router[_0x0ad5('0x11')](_0x0ad5('0xb'),auth[_0x0ad5('0xc')](),controller['update']);router[_0x0ad5('0x12')]('/:id',auth[_0x0ad5('0xc')](),controller[_0x0ad5('0x13')]);module[_0x0ad5('0x14')]=router;
\ No newline at end of file
+var _0x0212=['show','/:id/test','post','create','put','update','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','isAuthenticated'];(function(_0x98ffc0,_0x19254c){var _0x44ac31=function(_0x50b8ab){while(--_0x50b8ab){_0x98ffc0['push'](_0x98ffc0['shift']());}};_0x44ac31(++_0x19254c);}(_0x0212,0xe5));var _0x2021=function(_0x18a536,_0x2acb01){_0x18a536=_0x18a536-0x0;var _0x5bbf23=_0x0212[_0x18a536];return _0x5bbf23;};'use strict';var multer=require('multer');var util=require(_0x2021('0x0'));var path=require(_0x2021('0x1'));var timeout=require(_0x2021('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2021('0x3'));var auth=require(_0x2021('0x4'));var interaction=require(_0x2021('0x5'));var config=require(_0x2021('0x6'));var controller=require(_0x2021('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2021('0x8')]);router[_0x2021('0x9')]('/:id',auth[_0x2021('0xa')](),controller[_0x2021('0xb')]);router[_0x2021('0x9')](_0x2021('0xc'),auth['isAuthenticated'](),timeout('15s'),controller['test']);router[_0x2021('0xd')]('/',auth[_0x2021('0xa')](),controller[_0x2021('0xe')]);router[_0x2021('0xf')]('/:id',auth[_0x2021('0xa')](),controller[_0x2021('0x10')]);router['delete'](_0x2021('0x11'),auth[_0x2021('0xa')](),controller[_0x2021('0x12')]);module[_0x2021('0x13')]=router;
\ No newline at end of file
index 4ec64d7..524efb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ee1=['sequelize','exports','STRING','name'];(function(_0x195335,_0x431773){var _0x90b087=function(_0x3660fd){while(--_0x3660fd){_0x195335['push'](_0x195335['shift']());}};_0x90b087(++_0x431773);}(_0x5ee1,0xb8));var _0x15ee=function(_0x167323,_0x1a2478){_0x167323=_0x167323-0x0;var _0x5a56f0=_0x5ee1[_0x167323];return _0x5a56f0;};'use strict';var Sequelize=require(_0x15ee('0x0'));module[_0x15ee('0x1')]={'name':{'type':Sequelize[_0x15ee('0x2')],'unique':_0x15ee('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x15ee('0x2')]},'description':{'type':Sequelize[_0x15ee('0x2')]}};
\ No newline at end of file
+var _0x3cf9=['STRING','name'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x3cf9,0x162));var _0x93cf=function(_0x528efd,_0x58f433){_0x528efd=_0x528efd-0x0;var _0x2c1e04=_0x3cf9[_0x528efd];return _0x2c1e04;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x93cf('0x0')],'unique':_0x93cf('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0x93cf('0x0')]},'description':{'type':Sequelize[_0x93cf('0x0')]}};
\ No newline at end of file
index a05ec03..f428011 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b80=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','ODBC','error','stack','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','model','filters','intersection','attributes','length','query','hasOwnProperty','order','sort'];(function(_0x368613,_0x5f5f6b){var _0x5e3b00=function(_0x2035ce){while(--_0x2035ce){_0x368613['push'](_0x368613['shift']());}};_0x5e3b00(++_0x5f5f6b);}(_0x2b80,0x74));var _0x02b8=function(_0x37e2db,_0x2e77a0){_0x37e2db=_0x37e2db-0x0;var _0x362746=_0x2b80[_0x37e2db];return _0x362746;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x02b8('0x0'));var jsonpatch=require(_0x02b8('0x1'));var rp=require(_0x02b8('0x2'));var moment=require('moment');var BPromise=require(_0x02b8('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x02b8('0x4'));var sox=require('sox');var csv=require(_0x02b8('0x5'));var ejs=require(_0x02b8('0x6'));var fs=require('fs');var fs_extra=require(_0x02b8('0x7'));var _=require(_0x02b8('0x8'));var squel=require(_0x02b8('0x9'));var crypto=require('crypto');var jsforce=require(_0x02b8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x02b8('0x5'));var querystring=require('querystring');var Papa=require(_0x02b8('0xb'));var Redis=require(_0x02b8('0xc'));var authService=require(_0x02b8('0xd'));var qs=require(_0x02b8('0xe'));var as=require(_0x02b8('0xf'));var hardwareService=require(_0x02b8('0x10'));var logger=require('../../config/logger')(_0x02b8('0x11'));var utils=require(_0x02b8('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x02b8('0x13'));var db=require(_0x02b8('0x14'))['db'];function respondWithStatusCode(_0x628c64,_0xfdcf6f){_0xfdcf6f=_0xfdcf6f||0xcc;return function(_0x2d9598){if(_0x2d9598){return _0x628c64[_0x02b8('0x15')](_0xfdcf6f);}return _0x628c64[_0x02b8('0x16')](_0xfdcf6f)[_0x02b8('0x17')]();};}function respondWithResult(_0x4ad615,_0xc5ba98){_0xc5ba98=_0xc5ba98||0xc8;return function(_0x3324e2){if(_0x3324e2){return _0x4ad615[_0x02b8('0x16')](_0xc5ba98)[_0x02b8('0x18')](_0x3324e2);}};}function respondWithFilteredResult(_0x4debb3,_0x14636c){return function(_0x4a6ee8){if(_0x4a6ee8){var _0x3b4ced=typeof _0x14636c['offset']==='undefined'&&typeof _0x14636c[_0x02b8('0x19')]===_0x02b8('0x1a');var _0x4b5d50=_0x4a6ee8[_0x02b8('0x1b')];var _0x4779ac=_0x3b4ced?0x0:_0x14636c[_0x02b8('0x1c')];var _0x59380b=_0x3b4ced?_0x4a6ee8[_0x02b8('0x1b')]:_0x14636c[_0x02b8('0x1c')]+_0x14636c[_0x02b8('0x19')];var _0x56e270;if(_0x59380b>=_0x4b5d50){_0x59380b=_0x4b5d50;_0x56e270=0xc8;}else{_0x56e270=0xce;}_0x4debb3['status'](_0x56e270);return _0x4debb3[_0x02b8('0x1d')](_0x02b8('0x1e'),_0x4779ac+'-'+_0x59380b+'/'+_0x4b5d50)['json'](_0x4a6ee8);}return null;};}function patchUpdates(_0x3ed534){return function(_0x3a8330){try{jsonpatch[_0x02b8('0x1f')](_0x3a8330,_0x3ed534,!![]);}catch(_0xa7c0d4){return BPromise[_0x02b8('0x20')](_0xa7c0d4);}return _0x3a8330[_0x02b8('0x21')]();};}function saveUpdates(_0x2d4571,_0x317a5d){return function(_0x2fa6c6){if(_0x2fa6c6){return _0x2fa6c6[_0x02b8('0x22')](_0x2d4571)['then'](function(_0x3859c0){return _0x3859c0;});}return null;};}function removeEntity(_0x3d7454,_0x139eb7){return function(_0xbb52ff){if(_0xbb52ff){return _0xbb52ff[_0x02b8('0x23')]()[_0x02b8('0x24')](function(){var _0x4137a7=_0xbb52ff[_0x02b8('0x25')]({'plain':!![]});var _0x360e83=_0x02b8('0x26');return db['UserProfileResource'][_0x02b8('0x23')]({'where':{'type':_0x360e83,'resourceId':_0x4137a7['id']}})[_0x02b8('0x24')](function(){return _0xbb52ff;});})[_0x02b8('0x24')](function(){_0x3d7454[_0x02b8('0x16')](0xcc)[_0x02b8('0x17')]();});}};}function handleEntityNotFound(_0xa5d2f0,_0x1ead2e){return function(_0x31095f){if(!_0x31095f){_0xa5d2f0[_0x02b8('0x15')](0x194);}return _0x31095f;};}function handleError(_0x1563b0,_0x3eb1d8){_0x3eb1d8=_0x3eb1d8||0x1f4;return function(_0x4a35b4){logger[_0x02b8('0x27')](_0x4a35b4[_0x02b8('0x28')]);if(_0x4a35b4[_0x02b8('0x29')]){delete _0x4a35b4[_0x02b8('0x29')];}_0x1563b0[_0x02b8('0x16')](_0x3eb1d8)['send'](_0x4a35b4);};}exports[_0x02b8('0x2a')]=function(_0x4c49f4,_0x260a21){var _0x2d60f9={},_0x250ab9={},_0x19616={'count':0x0,'rows':[]};var _0x56f817=_[_0x02b8('0x2b')](db[_0x02b8('0x2c')][_0x02b8('0x2d')],function(_0x596aae){return{'name':_0x596aae[_0x02b8('0x2e')],'type':_0x596aae[_0x02b8('0x2f')][_0x02b8('0x30')]};});_0x250ab9[_0x02b8('0x31')]=_[_0x02b8('0x2b')](_0x56f817,_0x02b8('0x29'));_0x250ab9['query']=_['keys'](_0x4c49f4['query']);_0x250ab9[_0x02b8('0x32')]=_[_0x02b8('0x33')](_0x250ab9[_0x02b8('0x31')],_0x250ab9['query']);_0x2d60f9[_0x02b8('0x34')]=_[_0x02b8('0x33')](_0x250ab9[_0x02b8('0x31')],qs['fields'](_0x4c49f4['query']['fields']));_0x2d60f9[_0x02b8('0x34')]=_0x2d60f9[_0x02b8('0x34')][_0x02b8('0x35')]?_0x2d60f9['attributes']:_0x250ab9[_0x02b8('0x31')];if(!_0x4c49f4[_0x02b8('0x36')][_0x02b8('0x37')]('nolimit')){_0x2d60f9[_0x02b8('0x19')]=qs['limit'](_0x4c49f4['query']['limit']);_0x2d60f9[_0x02b8('0x1c')]=qs[_0x02b8('0x1c')](_0x4c49f4[_0x02b8('0x36')][_0x02b8('0x1c')]);}_0x2d60f9[_0x02b8('0x38')]=qs[_0x02b8('0x39')](_0x4c49f4['query'][_0x02b8('0x39')]);_0x2d60f9[_0x02b8('0x3a')]=qs['filters'](_[_0x02b8('0x3b')](_0x4c49f4[_0x02b8('0x36')],_0x250ab9[_0x02b8('0x32')]),_0x56f817);if(_0x4c49f4[_0x02b8('0x36')][_0x02b8('0x3c')]){_0x2d60f9['where']=_[_0x02b8('0x3d')](_0x2d60f9[_0x02b8('0x3a')],{'$or':_[_0x02b8('0x2b')](_0x56f817,function(_0x3c18dd){if(_0x3c18dd[_0x02b8('0x2f')]!==_0x02b8('0x3e')){var _0x2bc700={};_0x2bc700[_0x3c18dd[_0x02b8('0x29')]]={'$like':'%'+_0x4c49f4[_0x02b8('0x36')][_0x02b8('0x3c')]+'%'};return _0x2bc700;}})});}_0x2d60f9=_['merge']({},_0x2d60f9,_0x4c49f4[_0x02b8('0x3f')]);var _0x34f1a8={'where':_0x2d60f9[_0x02b8('0x3a')]};return db['SquareOdbc'][_0x02b8('0x1b')](_0x34f1a8)[_0x02b8('0x24')](function(_0x41e6ab){_0x19616[_0x02b8('0x1b')]=_0x41e6ab;if(_0x4c49f4[_0x02b8('0x36')][_0x02b8('0x40')]){_0x2d60f9[_0x02b8('0x41')]=[{'all':!![]}];}return db[_0x02b8('0x2c')][_0x02b8('0x42')](_0x2d60f9);})[_0x02b8('0x24')](function(_0x204004){_0x19616[_0x02b8('0x43')]=_0x204004;return _0x19616;})['then'](respondWithFilteredResult(_0x260a21,_0x2d60f9))[_0x02b8('0x44')](handleError(_0x260a21,null));};exports['show']=function(_0x3e726c,_0x2901ec){var _0x28181c={'raw':!![],'where':{'id':_0x3e726c[_0x02b8('0x45')]['id']}},_0x43c627={};_0x43c627['model']=_[_0x02b8('0x46')](db[_0x02b8('0x2c')][_0x02b8('0x2d')]);_0x43c627[_0x02b8('0x36')]=_[_0x02b8('0x46')](_0x3e726c['query']);_0x43c627[_0x02b8('0x32')]=_[_0x02b8('0x33')](_0x43c627[_0x02b8('0x31')],_0x43c627[_0x02b8('0x36')]);_0x28181c[_0x02b8('0x34')]=_[_0x02b8('0x33')](_0x43c627['model'],qs['fields'](_0x3e726c[_0x02b8('0x36')][_0x02b8('0x47')]));_0x28181c[_0x02b8('0x34')]=_0x28181c[_0x02b8('0x34')]['length']?_0x28181c[_0x02b8('0x34')]:_0x43c627[_0x02b8('0x31')];if(_0x3e726c[_0x02b8('0x36')]['includeAll']){_0x28181c[_0x02b8('0x41')]=[{'all':!![]}];}_0x28181c=_[_0x02b8('0x3d')]({},_0x28181c,_0x3e726c['options']);return db[_0x02b8('0x2c')][_0x02b8('0x48')](_0x28181c)[_0x02b8('0x24')](handleEntityNotFound(_0x2901ec,null))['then'](respondWithResult(_0x2901ec,null))[_0x02b8('0x44')](handleError(_0x2901ec,null));};exports[_0x02b8('0x49')]=function(_0x44feab,_0x5bb944){return db[_0x02b8('0x2c')][_0x02b8('0x49')](_0x44feab['body'],{})[_0x02b8('0x24')](function(_0x4b099b){var _0x450ac5=_0x44feab[_0x02b8('0x4a')][_0x02b8('0x25')]({'plain':!![]});if(!_0x450ac5)throw new Error(_0x02b8('0x4b'));if(_0x450ac5[_0x02b8('0x4c')]===_0x02b8('0x4a')){var _0x4f48f5=_0x4b099b['get']({'plain':!![]});var _0x481b8d='ODBC';return db['UserProfileSection'][_0x02b8('0x48')]({'where':{'name':_0x481b8d,'userProfileId':_0x450ac5[_0x02b8('0x4d')]},'raw':!![]})[_0x02b8('0x24')](function(_0x9124ef){if(_0x9124ef&&_0x9124ef[_0x02b8('0x4e')]===0x0){return db[_0x02b8('0x4f')][_0x02b8('0x49')]({'name':_0x4f48f5[_0x02b8('0x29')],'resourceId':_0x4f48f5['id'],'type':_0x9124ef[_0x02b8('0x29')],'sectionId':_0x9124ef['id']},{})[_0x02b8('0x24')](function(){return _0x4b099b;});}else{return _0x4b099b;}})['catch'](function(_0x52ad8f){logger[_0x02b8('0x27')](_0x02b8('0x50'),_0x52ad8f);throw _0x52ad8f;});}return _0x4b099b;})['then'](respondWithResult(_0x5bb944,0xc9))[_0x02b8('0x44')](handleError(_0x5bb944,null));};exports[_0x02b8('0x22')]=function(_0x3b1508,_0x540575){if(_0x3b1508[_0x02b8('0x51')]['id']){delete _0x3b1508[_0x02b8('0x51')]['id'];}return db[_0x02b8('0x2c')]['find']({'where':{'id':_0x3b1508[_0x02b8('0x45')]['id']}})[_0x02b8('0x24')](handleEntityNotFound(_0x540575,null))['then'](saveUpdates(_0x3b1508['body'],null))[_0x02b8('0x24')](respondWithResult(_0x540575,null))[_0x02b8('0x44')](handleError(_0x540575,null));};exports[_0x02b8('0x23')]=function(_0x4f22fa,_0x36fce0){return db[_0x02b8('0x2c')]['find']({'where':{'id':_0x4f22fa[_0x02b8('0x45')]['id']}})[_0x02b8('0x24')](handleEntityNotFound(_0x36fce0,null))[_0x02b8('0x24')](removeEntity(_0x36fce0,null))[_0x02b8('0x44')](handleError(_0x36fce0,null));};exports[_0x02b8('0x52')]=function(_0x5676fb,_0x58abb7,_0x5a740f){var _0x142919;return db['SquareOdbc'][_0x02b8('0x48')]({'where':{'id':_0x5676fb[_0x02b8('0x45')]['id']},'attributes':['id',_0x02b8('0x53')]})[_0x02b8('0x24')](handleEntityNotFound(_0x58abb7,null))[_0x02b8('0x24')](function(_0x3f1eac){if(_0x3f1eac){var _0x2c5a12=require(_0x02b8('0x54'))();_0x2c5a12[_0x02b8('0x55')](_0x3f1eac[_0x02b8('0x53')]);_0x2c5a12[_0x02b8('0x56')]();return _0x3f1eac;}})[_0x02b8('0x24')](respondWithResult(_0x58abb7,null))[_0x02b8('0x44')](handleError(_0x58abb7,null));};
\ No newline at end of file
+var _0xec31=['test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','update','then','destroy','ODBC','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find'];(function(_0x17df0c,_0x328b96){var _0x58d9d9=function(_0x16894c){while(--_0x16894c){_0x17df0c['push'](_0x17df0c['shift']());}};_0x58d9d9(++_0x328b96);}(_0xec31,0xbb));var _0x1ec3=function(_0x3c6a95,_0x20bd63){_0x3c6a95=_0x3c6a95-0x0;var _0x5e0021=_0xec31[_0x3c6a95];return _0x5e0021;};'use strict';var emlformat=require(_0x1ec3('0x0'));var rimraf=require(_0x1ec3('0x1'));var zipdir=require(_0x1ec3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ec3('0x3'));var moment=require(_0x1ec3('0x4'));var BPromise=require(_0x1ec3('0x5'));var Mustache=require(_0x1ec3('0x6'));var util=require('util');var path=require(_0x1ec3('0x7'));var sox=require(_0x1ec3('0x8'));var csv=require(_0x1ec3('0x9'));var ejs=require(_0x1ec3('0xa'));var fs=require('fs');var fs_extra=require(_0x1ec3('0xb'));var _=require('lodash');var squel=require(_0x1ec3('0xc'));var crypto=require(_0x1ec3('0xd'));var jsforce=require(_0x1ec3('0xe'));var deskjs=require(_0x1ec3('0xf'));var toCsv=require(_0x1ec3('0x9'));var querystring=require(_0x1ec3('0x10'));var Papa=require(_0x1ec3('0x11'));var Redis=require(_0x1ec3('0x12'));var authService=require(_0x1ec3('0x13'));var qs=require(_0x1ec3('0x14'));var as=require(_0x1ec3('0x15'));var hardwareService=require(_0x1ec3('0x16'));var logger=require(_0x1ec3('0x17'))(_0x1ec3('0x18'));var utils=require('../../config/utils');var config=require(_0x1ec3('0x19'));var licenseUtil=require(_0x1ec3('0x1a'));var db=require(_0x1ec3('0x1b'))['db'];function respondWithStatusCode(_0xd8b505,_0x15738c){_0x15738c=_0x15738c||0xcc;return function(_0x339198){if(_0x339198){return _0xd8b505[_0x1ec3('0x1c')](_0x15738c);}return _0xd8b505['status'](_0x15738c)['end']();};}function respondWithResult(_0x545fc6,_0xa63754){_0xa63754=_0xa63754||0xc8;return function(_0xbfb974){if(_0xbfb974){return _0x545fc6[_0x1ec3('0x1d')](_0xa63754)[_0x1ec3('0x1e')](_0xbfb974);}};}function respondWithFilteredResult(_0x1d22b6,_0x103b54){return function(_0x4e1bcf){if(_0x4e1bcf){var _0x39c818=typeof _0x103b54[_0x1ec3('0x1f')]===_0x1ec3('0x20')&&typeof _0x103b54[_0x1ec3('0x21')]===_0x1ec3('0x20');var _0x2b6d0e=_0x4e1bcf[_0x1ec3('0x22')];var _0x461b55=_0x39c818?0x0:_0x103b54[_0x1ec3('0x1f')];var _0x4daa78=_0x39c818?_0x4e1bcf[_0x1ec3('0x22')]:_0x103b54[_0x1ec3('0x1f')]+_0x103b54['limit'];var _0xa09a0a;if(_0x4daa78>=_0x2b6d0e){_0x4daa78=_0x2b6d0e;_0xa09a0a=0xc8;}else{_0xa09a0a=0xce;}_0x1d22b6[_0x1ec3('0x1d')](_0xa09a0a);return _0x1d22b6['set']('Content-Range',_0x461b55+'-'+_0x4daa78+'/'+_0x2b6d0e)[_0x1ec3('0x1e')](_0x4e1bcf);}return null;};}function patchUpdates(_0x1e4f7e){return function(_0x17bb56){try{jsonpatch['apply'](_0x17bb56,_0x1e4f7e,!![]);}catch(_0x2e97a8){return BPromise[_0x1ec3('0x23')](_0x2e97a8);}return _0x17bb56['save']();};}function saveUpdates(_0xaec800,_0x1ef708){return function(_0xee35be){if(_0xee35be){return _0xee35be[_0x1ec3('0x24')](_0xaec800)[_0x1ec3('0x25')](function(_0x4d5080){return _0x4d5080;});}return null;};}function removeEntity(_0x357566,_0x5a6890){return function(_0x430c65){if(_0x430c65){return _0x430c65[_0x1ec3('0x26')]()[_0x1ec3('0x25')](function(){var _0x5db992=_0x430c65['get']({'plain':!![]});var _0x441329=_0x1ec3('0x27');return db[_0x1ec3('0x28')]['destroy']({'where':{'type':_0x441329,'resourceId':_0x5db992['id']}})[_0x1ec3('0x25')](function(){return _0x430c65;});})['then'](function(){_0x357566[_0x1ec3('0x1d')](0xcc)[_0x1ec3('0x29')]();});}};}function handleEntityNotFound(_0xec4fe7,_0x555e2d){return function(_0x5319fd){if(!_0x5319fd){_0xec4fe7[_0x1ec3('0x1c')](0x194);}return _0x5319fd;};}function handleError(_0x6d5172,_0x1489a1){_0x1489a1=_0x1489a1||0x1f4;return function(_0x372c37){logger[_0x1ec3('0x2a')](_0x372c37['stack']);if(_0x372c37['name']){delete _0x372c37[_0x1ec3('0x2b')];}_0x6d5172[_0x1ec3('0x1d')](_0x1489a1)[_0x1ec3('0x2c')](_0x372c37);};}exports[_0x1ec3('0x2d')]=function(_0x3e619e,_0x27cb22){var _0x589e9b={},_0x2058b6={},_0xe23b5c={'count':0x0,'rows':[]};var _0x4ff0c5=_['map'](db['SquareOdbc'][_0x1ec3('0x2e')],function(_0x4dca20){return{'name':_0x4dca20[_0x1ec3('0x2f')],'type':_0x4dca20[_0x1ec3('0x30')][_0x1ec3('0x31')]};});_0x2058b6['model']=_[_0x1ec3('0x32')](_0x4ff0c5,_0x1ec3('0x2b'));_0x2058b6[_0x1ec3('0x33')]=_['keys'](_0x3e619e[_0x1ec3('0x33')]);_0x2058b6[_0x1ec3('0x34')]=_[_0x1ec3('0x35')](_0x2058b6[_0x1ec3('0x36')],_0x2058b6[_0x1ec3('0x33')]);_0x589e9b[_0x1ec3('0x37')]=_[_0x1ec3('0x35')](_0x2058b6[_0x1ec3('0x36')],qs[_0x1ec3('0x38')](_0x3e619e['query'][_0x1ec3('0x38')]));_0x589e9b[_0x1ec3('0x37')]=_0x589e9b[_0x1ec3('0x37')]['length']?_0x589e9b[_0x1ec3('0x37')]:_0x2058b6[_0x1ec3('0x36')];if(!_0x3e619e['query'][_0x1ec3('0x39')]('nolimit')){_0x589e9b[_0x1ec3('0x21')]=qs[_0x1ec3('0x21')](_0x3e619e['query'][_0x1ec3('0x21')]);_0x589e9b[_0x1ec3('0x1f')]=qs[_0x1ec3('0x1f')](_0x3e619e[_0x1ec3('0x33')][_0x1ec3('0x1f')]);}_0x589e9b[_0x1ec3('0x3a')]=qs[_0x1ec3('0x3b')](_0x3e619e[_0x1ec3('0x33')][_0x1ec3('0x3b')]);_0x589e9b[_0x1ec3('0x3c')]=qs[_0x1ec3('0x34')](_[_0x1ec3('0x3d')](_0x3e619e[_0x1ec3('0x33')],_0x2058b6[_0x1ec3('0x34')]),_0x4ff0c5);if(_0x3e619e[_0x1ec3('0x33')][_0x1ec3('0x3e')]){_0x589e9b['where']=_[_0x1ec3('0x3f')](_0x589e9b[_0x1ec3('0x3c')],{'$or':_[_0x1ec3('0x32')](_0x4ff0c5,function(_0x36bf52){if(_0x36bf52[_0x1ec3('0x30')]!=='VIRTUAL'){var _0x5b2eaf={};_0x5b2eaf[_0x36bf52['name']]={'$like':'%'+_0x3e619e[_0x1ec3('0x33')][_0x1ec3('0x3e')]+'%'};return _0x5b2eaf;}})});}_0x589e9b=_[_0x1ec3('0x3f')]({},_0x589e9b,_0x3e619e[_0x1ec3('0x40')]);var _0x281ca1={'where':_0x589e9b[_0x1ec3('0x3c')]};return db[_0x1ec3('0x41')][_0x1ec3('0x22')](_0x281ca1)[_0x1ec3('0x25')](function(_0x961fc3){_0xe23b5c[_0x1ec3('0x22')]=_0x961fc3;if(_0x3e619e[_0x1ec3('0x33')][_0x1ec3('0x42')]){_0x589e9b[_0x1ec3('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x1ec3('0x44')](_0x589e9b);})[_0x1ec3('0x25')](function(_0x14eb63){_0xe23b5c[_0x1ec3('0x45')]=_0x14eb63;return _0xe23b5c;})[_0x1ec3('0x25')](respondWithFilteredResult(_0x27cb22,_0x589e9b))[_0x1ec3('0x46')](handleError(_0x27cb22,null));};exports[_0x1ec3('0x47')]=function(_0x693f23,_0x461e46){var _0x2d99be={'raw':!![],'where':{'id':_0x693f23[_0x1ec3('0x48')]['id']}},_0x5eae1c={};_0x5eae1c[_0x1ec3('0x36')]=_[_0x1ec3('0x49')](db[_0x1ec3('0x41')][_0x1ec3('0x2e')]);_0x5eae1c[_0x1ec3('0x33')]=_[_0x1ec3('0x49')](_0x693f23[_0x1ec3('0x33')]);_0x5eae1c['filters']=_[_0x1ec3('0x35')](_0x5eae1c[_0x1ec3('0x36')],_0x5eae1c[_0x1ec3('0x33')]);_0x2d99be[_0x1ec3('0x37')]=_[_0x1ec3('0x35')](_0x5eae1c['model'],qs['fields'](_0x693f23[_0x1ec3('0x33')][_0x1ec3('0x38')]));_0x2d99be[_0x1ec3('0x37')]=_0x2d99be[_0x1ec3('0x37')][_0x1ec3('0x4a')]?_0x2d99be['attributes']:_0x5eae1c[_0x1ec3('0x36')];if(_0x693f23[_0x1ec3('0x33')][_0x1ec3('0x42')]){_0x2d99be['include']=[{'all':!![]}];}_0x2d99be=_[_0x1ec3('0x3f')]({},_0x2d99be,_0x693f23['options']);return db[_0x1ec3('0x41')]['find'](_0x2d99be)['then'](handleEntityNotFound(_0x461e46,null))['then'](respondWithResult(_0x461e46,null))[_0x1ec3('0x46')](handleError(_0x461e46,null));};exports[_0x1ec3('0x4b')]=function(_0x2c7be3,_0x3c2060){return db['SquareOdbc'][_0x1ec3('0x4b')](_0x2c7be3[_0x1ec3('0x4c')],{})[_0x1ec3('0x25')](function(_0x13620b){var _0x325bb7=_0x2c7be3[_0x1ec3('0x4d')][_0x1ec3('0x4e')]({'plain':!![]});if(!_0x325bb7)throw new Error(_0x1ec3('0x4f'));if(_0x325bb7[_0x1ec3('0x50')]===_0x1ec3('0x4d')){var _0xcc692c=_0x13620b[_0x1ec3('0x4e')]({'plain':!![]});var _0x43ded7=_0x1ec3('0x27');return db[_0x1ec3('0x51')]['find']({'where':{'name':_0x43ded7,'userProfileId':_0x325bb7[_0x1ec3('0x52')]},'raw':!![]})[_0x1ec3('0x25')](function(_0x538682){if(_0x538682&&_0x538682[_0x1ec3('0x53')]===0x0){return db[_0x1ec3('0x28')][_0x1ec3('0x4b')]({'name':_0xcc692c[_0x1ec3('0x2b')],'resourceId':_0xcc692c['id'],'type':_0x538682['name'],'sectionId':_0x538682['id']},{})[_0x1ec3('0x25')](function(){return _0x13620b;});}else{return _0x13620b;}})[_0x1ec3('0x46')](function(_0x5d241a){logger[_0x1ec3('0x2a')](_0x1ec3('0x54'),_0x5d241a);throw _0x5d241a;});}return _0x13620b;})['then'](respondWithResult(_0x3c2060,0xc9))['catch'](handleError(_0x3c2060,null));};exports[_0x1ec3('0x24')]=function(_0x6b57e9,_0x569cab){if(_0x6b57e9[_0x1ec3('0x4c')]['id']){delete _0x6b57e9[_0x1ec3('0x4c')]['id'];}return db['SquareOdbc'][_0x1ec3('0x55')]({'where':{'id':_0x6b57e9['params']['id']}})['then'](handleEntityNotFound(_0x569cab,null))['then'](saveUpdates(_0x6b57e9['body'],null))[_0x1ec3('0x25')](respondWithResult(_0x569cab,null))[_0x1ec3('0x46')](handleError(_0x569cab,null));};exports[_0x1ec3('0x26')]=function(_0x27ac32,_0x27264c){return db[_0x1ec3('0x41')][_0x1ec3('0x55')]({'where':{'id':_0x27ac32[_0x1ec3('0x48')]['id']}})[_0x1ec3('0x25')](handleEntityNotFound(_0x27264c,null))[_0x1ec3('0x25')](removeEntity(_0x27264c,null))[_0x1ec3('0x46')](handleError(_0x27264c,null));};exports[_0x1ec3('0x56')]=function(_0x367735,_0x319f0d,_0x379389){var _0x5af6e9;return db['SquareOdbc'][_0x1ec3('0x55')]({'where':{'id':_0x367735['params']['id']},'attributes':['id',_0x1ec3('0x57')]})[_0x1ec3('0x25')](handleEntityNotFound(_0x319f0d,null))[_0x1ec3('0x25')](function(_0x568068){if(_0x568068){var _0x2919e2=require(_0x1ec3('0x58'))();_0x2919e2[_0x1ec3('0x59')](_0x568068[_0x1ec3('0x57')]);_0x2919e2[_0x1ec3('0x5a')]();return _0x568068;}})[_0x1ec3('0x25')](respondWithResult(_0x319f0d,null))[_0x1ec3('0x46')](handleError(_0x319f0d,null));};
\ No newline at end of file
index bc70781..ac24946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b37=['rimraf','../../config/environment','define','square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3a38bd,_0x5bfb4d){var _0x38a03d=function(_0x4136b1){while(--_0x4136b1){_0x3a38bd['push'](_0x3a38bd['shift']());}};_0x38a03d(++_0x5bfb4d);}(_0x4b37,0x1bc));var _0x74b3=function(_0x2ac896,_0x1b6e58){_0x2ac896=_0x2ac896-0x0;var _0x5154e1=_0x4b37[_0x2ac896];return _0x5154e1;};'use strict';var _=require(_0x74b3('0x0'));var util=require(_0x74b3('0x1'));var logger=require(_0x74b3('0x2'))(_0x74b3('0x3'));var moment=require('moment');var BPromise=require(_0x74b3('0x4'));var rp=require(_0x74b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74b3('0x6'));var config=require(_0x74b3('0x7'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x4ad5c4,_0x5889d4){return _0x4ad5c4[_0x74b3('0x8')]('SquareOdbc',attributes,{'tableName':_0x74b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe2e9=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util','api','moment'];(function(_0x557014,_0x4006c5){var _0x5c1f85=function(_0xebf756){while(--_0xebf756){_0x557014['push'](_0x557014['shift']());}};_0x5c1f85(++_0x4006c5);}(_0xe2e9,0x167));var _0x9e2e=function(_0x3af820,_0x35cbbe){_0x3af820=_0x3af820-0x0;var _0x215e66=_0xe2e9[_0x3af820];return _0x215e66;};'use strict';var _=require(_0x9e2e('0x0'));var util=require(_0x9e2e('0x1'));var logger=require('../../config/logger')(_0x9e2e('0x2'));var moment=require(_0x9e2e('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e2e('0x4'));var fs=require('fs');var path=require(_0x9e2e('0x5'));var rimraf=require(_0x9e2e('0x6'));var config=require(_0x9e2e('0x7'));var attributes=require(_0x9e2e('0x8'));module['exports']=function(_0x2ed7cb,_0xdb7104){return _0x2ed7cb['define'](_0x9e2e('0x9'),attributes,{'tableName':_0x9e2e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b91430c..549795e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d0f=['where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','request','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw'];(function(_0x1a7262,_0x462d83){var _0x3cb606=function(_0x568393){while(--_0x568393){_0x1a7262['push'](_0x1a7262['shift']());}};_0x3cb606(++_0x462d83);}(_0x7d0f,0x9c));var _0xf7d0=function(_0x15e176,_0x58a3f4){_0x15e176=_0x15e176-0x0;var _0x3a5fff=_0x7d0f[_0x15e176];return _0x3a5fff;};'use strict';var _=require(_0xf7d0('0x0'));var util=require(_0xf7d0('0x1'));var moment=require(_0xf7d0('0x2'));var BPromise=require(_0xf7d0('0x3'));var rs=require(_0xf7d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf7d0('0x5'));var config=require(_0xf7d0('0x6'));var jayson=require(_0xf7d0('0x7'));var client=jayson[_0xf7d0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0d6e,_0x659c4,_0x5722e8){return new BPromise(function(_0x1b4083,_0x536549){return client[_0xf7d0('0x9')](_0x1f0d6e,_0x5722e8)['then'](function(_0x476cc4){logger[_0xf7d0('0xa')](_0xf7d0('0xb'),_0x659c4,'request\x20sent');logger[_0xf7d0('0xc')](_0xf7d0('0xd'),_0x659c4,'request\x20sent',JSON['stringify'](_0x476cc4));if(_0x476cc4[_0xf7d0('0xe')]){if(_0x476cc4[_0xf7d0('0xe')][_0xf7d0('0xf')]===0x1f4){logger[_0xf7d0('0xe')](_0xf7d0('0xb'),_0x659c4,_0x476cc4[_0xf7d0('0xe')][_0xf7d0('0x10')]);return _0x536549(_0x476cc4[_0xf7d0('0xe')][_0xf7d0('0x10')]);}logger[_0xf7d0('0xe')](_0xf7d0('0xb'),_0x659c4,_0x476cc4[_0xf7d0('0xe')]['message']);return _0x1b4083(_0x476cc4[_0xf7d0('0xe')][_0xf7d0('0x10')]);}else{logger[_0xf7d0('0xa')]('SquareOdbc,\x20%s,\x20%s',_0x659c4,'request\x20sent');_0x1b4083(_0x476cc4[_0xf7d0('0x11')][_0xf7d0('0x10')]);}})[_0xf7d0('0x12')](function(_0x5280d7){logger['error'](_0xf7d0('0xb'),_0x659c4,_0x5280d7);_0x536549(_0x5280d7);});});}exports[_0xf7d0('0x13')]=function(_0x14ca91){var _0x4c1ed3=this;return new Promise(function(_0xfdce8f,_0x140c2d){return db[_0xf7d0('0x14')][_0xf7d0('0x15')]({'raw':_0x14ca91['options']?_0x14ca91[_0xf7d0('0x16')][_0xf7d0('0x17')]===undefined?!![]:![]:!![],'where':_0x14ca91[_0xf7d0('0x16')]?_0x14ca91['options'][_0xf7d0('0x18')]||null:null,'attributes':_0x14ca91[_0xf7d0('0x16')]?_0x14ca91[_0xf7d0('0x16')][_0xf7d0('0x19')]||null:null,'include':_0x14ca91[_0xf7d0('0x16')]?_0x14ca91[_0xf7d0('0x16')][_0xf7d0('0x1a')]?_['map'](_0x14ca91[_0xf7d0('0x16')][_0xf7d0('0x1a')],function(_0x112a27){return{'model':db[_0x112a27['model']],'as':_0x112a27['as'],'attributes':_0x112a27[_0xf7d0('0x19')],'include':_0x112a27[_0xf7d0('0x1a')]?_[_0xf7d0('0x1b')](_0x112a27[_0xf7d0('0x1a')],function(_0x4e133a){return{'model':db[_0x4e133a['model']],'as':_0x4e133a['as'],'attributes':_0x4e133a[_0xf7d0('0x19')],'include':_0x4e133a[_0xf7d0('0x1a')]?_[_0xf7d0('0x1b')](_0x4e133a[_0xf7d0('0x1a')],function(_0x2e3566){return{'model':db[_0x2e3566[_0xf7d0('0x1c')]],'as':_0x2e3566['as'],'attributes':_0x2e3566[_0xf7d0('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf7d0('0x1d')](function(_0x56dd46){logger[_0xf7d0('0xa')](_0xf7d0('0x13'),_0x14ca91);logger[_0xf7d0('0xc')](_0xf7d0('0x13'),_0x14ca91,JSON['stringify'](_0x56dd46));_0xfdce8f(_0x56dd46);})[_0xf7d0('0x12')](function(_0x13a4c8){logger['error'](_0xf7d0('0x13'),_0x13a4c8[_0xf7d0('0x10')],_0x14ca91);_0x140c2d(_0x4c1ed3['error'](0x1f4,_0x13a4c8[_0xf7d0('0x10')]));});});};
\ No newline at end of file
+var _0x9f76=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x2ceb1b,_0x59b66f){var _0x4f1ff3=function(_0x185e18){while(--_0x185e18){_0x2ceb1b['push'](_0x2ceb1b['shift']());}};_0x4f1ff3(++_0x59b66f);}(_0x9f76,0x96));var _0x69f7=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x9f76[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x69f7('0x0'));var util=require(_0x69f7('0x1'));var moment=require(_0x69f7('0x2'));var BPromise=require(_0x69f7('0x3'));var rs=require(_0x69f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69f7('0x5'))['db'];var utils=require(_0x69f7('0x6'));var logger=require(_0x69f7('0x7'))(_0x69f7('0x8'));var config=require(_0x69f7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x69f7('0xa')][_0x69f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1322ae,_0xed8eb7,_0x210ad2){return new BPromise(function(_0x4b81c6,_0x50d181){return client[_0x69f7('0xc')](_0x1322ae,_0x210ad2)[_0x69f7('0xd')](function(_0x58be4c){logger[_0x69f7('0xe')](_0x69f7('0xf'),_0xed8eb7,_0x69f7('0x10'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0xed8eb7,'request\x20sent',JSON[_0x69f7('0x11')](_0x58be4c));if(_0x58be4c['error']){if(_0x58be4c['error']['code']===0x1f4){logger['error'](_0x69f7('0xf'),_0xed8eb7,_0x58be4c['error']['message']);return _0x50d181(_0x58be4c[_0x69f7('0x12')][_0x69f7('0x13')]);}logger[_0x69f7('0x12')](_0x69f7('0xf'),_0xed8eb7,_0x58be4c[_0x69f7('0x12')][_0x69f7('0x13')]);return _0x4b81c6(_0x58be4c['error'][_0x69f7('0x13')]);}else{logger[_0x69f7('0xe')]('SquareOdbc,\x20%s,\x20%s',_0xed8eb7,'request\x20sent');_0x4b81c6(_0x58be4c['result'][_0x69f7('0x13')]);}})[_0x69f7('0x14')](function(_0x4a37c3){logger[_0x69f7('0x12')](_0x69f7('0xf'),_0xed8eb7,_0x4a37c3);_0x50d181(_0x4a37c3);});});}exports[_0x69f7('0x15')]=function(_0x1f1f87){var _0x35e858=this;return new Promise(function(_0x3a041d,_0x5a85fa){return db[_0x69f7('0x16')]['find']({'raw':_0x1f1f87[_0x69f7('0x17')]?_0x1f1f87['options'][_0x69f7('0x18')]===undefined?!![]:![]:!![],'where':_0x1f1f87['options']?_0x1f1f87[_0x69f7('0x17')][_0x69f7('0x19')]||null:null,'attributes':_0x1f1f87[_0x69f7('0x17')]?_0x1f1f87[_0x69f7('0x17')][_0x69f7('0x1a')]||null:null,'include':_0x1f1f87[_0x69f7('0x17')]?_0x1f1f87[_0x69f7('0x17')]['include']?_[_0x69f7('0x1b')](_0x1f1f87['options'][_0x69f7('0x1c')],function(_0x3270fa){return{'model':db[_0x3270fa[_0x69f7('0x1d')]],'as':_0x3270fa['as'],'attributes':_0x3270fa[_0x69f7('0x1a')],'include':_0x3270fa[_0x69f7('0x1c')]?_[_0x69f7('0x1b')](_0x3270fa[_0x69f7('0x1c')],function(_0x46d133){return{'model':db[_0x46d133[_0x69f7('0x1d')]],'as':_0x46d133['as'],'attributes':_0x46d133[_0x69f7('0x1a')],'include':_0x46d133['include']?_[_0x69f7('0x1b')](_0x46d133[_0x69f7('0x1c')],function(_0x45490e){return{'model':db[_0x45490e[_0x69f7('0x1d')]],'as':_0x45490e['as'],'attributes':_0x45490e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56950a){logger[_0x69f7('0xe')](_0x69f7('0x15'),_0x1f1f87);logger[_0x69f7('0x1e')](_0x69f7('0x15'),_0x1f1f87,JSON[_0x69f7('0x11')](_0x56950a));_0x3a041d(_0x56950a);})['catch'](function(_0x575b2a){logger['error'](_0x69f7('0x15'),_0x575b2a['message'],_0x1f1f87);_0x5a85fa(_0x35e858[_0x69f7('0x12')](0x1f4,_0x575b2a[_0x69f7('0x13')]));});});};
\ No newline at end of file
index a427374..c74eda8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7008=['delete','/:id','destroy','removeUsers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','/:id/users','getUsers','post','create','addUsers','update'];(function(_0xdc922,_0x2a301a){var _0x5c3fe2=function(_0x504c89){while(--_0x504c89){_0xdc922['push'](_0xdc922['shift']());}};_0x5c3fe2(++_0x2a301a);}(_0x7008,0x185));var _0x8700=function(_0x24037f,_0x4c2296){_0x24037f=_0x24037f-0x0;var _0x126a28=_0x7008[_0x24037f];return _0x126a28;};'use strict';var multer=require(_0x8700('0x0'));var util=require(_0x8700('0x1'));var path=require(_0x8700('0x2'));var timeout=require(_0x8700('0x3'));var express=require('express');var router=express[_0x8700('0x4')]();var fs_extra=require(_0x8700('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8700('0x6'));var config=require(_0x8700('0x7'));var controller=require(_0x8700('0x8'));router[_0x8700('0x9')]('/',auth[_0x8700('0xa')](),controller[_0x8700('0xb')]);router[_0x8700('0x9')]('/:id',auth[_0x8700('0xa')](),controller[_0x8700('0xc')]);router[_0x8700('0x9')](_0x8700('0xd'),auth[_0x8700('0xa')](),controller[_0x8700('0xe')]);router[_0x8700('0xf')]('/',auth[_0x8700('0xa')](),controller[_0x8700('0x10')]);router[_0x8700('0xf')]('/:id/users',auth['isAuthenticated'](),controller[_0x8700('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x8700('0x12')]);router[_0x8700('0x13')](_0x8700('0x14'),auth[_0x8700('0xa')](),controller[_0x8700('0x15')]);router[_0x8700('0x13')](_0x8700('0xd'),auth['isAuthenticated'](),controller[_0x8700('0x16')]);module[_0x8700('0x17')]=router;
\ No newline at end of file
+var _0x404d=['index','show','getUsers','post','isAuthenticated','create','addUsers','/:id','update','delete','destroy','/:id/users','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x404d,0x1e9));var _0xd404=function(_0x1cabc6,_0x5e7748){_0x1cabc6=_0x1cabc6-0x0;var _0x5904f3=_0x404d[_0x1cabc6];return _0x5904f3;};'use strict';var multer=require(_0xd404('0x0'));var util=require(_0xd404('0x1'));var path=require(_0xd404('0x2'));var timeout=require(_0xd404('0x3'));var express=require(_0xd404('0x4'));var router=express[_0xd404('0x5')]();var fs_extra=require(_0xd404('0x6'));var auth=require(_0xd404('0x7'));var interaction=require(_0xd404('0x8'));var config=require('../../config/environment');var controller=require(_0xd404('0x9'));router[_0xd404('0xa')]('/',auth['isAuthenticated'](),controller[_0xd404('0xb')]);router[_0xd404('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd404('0xc')]);router[_0xd404('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0xd404('0xd')]);router[_0xd404('0xe')]('/',auth[_0xd404('0xf')](),controller[_0xd404('0x10')]);router['post']('/:id/users',auth[_0xd404('0xf')](),controller[_0xd404('0x11')]);router['put'](_0xd404('0x12'),auth[_0xd404('0xf')](),controller[_0xd404('0x13')]);router[_0xd404('0x14')](_0xd404('0x12'),auth[_0xd404('0xf')](),controller[_0xd404('0x15')]);router[_0xd404('0x14')](_0xd404('0x16'),auth[_0xd404('0xf')](),controller[_0xd404('0x17')]);module[_0xd404('0x18')]=router;
\ No newline at end of file
index ae18fdf..57c1bae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4b9=['utf8','sequelize','exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','production'];(function(_0x1b58c5,_0x44eb0f){var _0x2c8cb6=function(_0x508dc4){while(--_0x508dc4){_0x1b58c5['push'](_0x1b58c5['shift']());}};_0x2c8cb6(++_0x44eb0f);}(_0xb4b9,0xd2));var _0x9b4b=function(_0xe6fa71,_0x45b669){_0xe6fa71=_0xe6fa71-0x0;var _0x5a6d62=_0xb4b9[_0xe6fa71];return _0x5a6d62;};'use strict';var Sequelize=require(_0x9b4b('0x0'));module[_0x9b4b('0x1')]={'name':{'type':Sequelize[_0x9b4b('0x2')],'unique':_0x9b4b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x9b4b('0x4')](_0x9b4b('0x5')),'get':function(){if(this[_0x9b4b('0x6')](_0x9b4b('0x7'))){return this[_0x9b4b('0x6')](_0x9b4b('0x7'))[_0x9b4b('0x8')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x9b4b('0x5')),'get':function(){if(this[_0x9b4b('0x6')](_0x9b4b('0x9'))){return this[_0x9b4b('0x6')]('production')['toString'](_0x9b4b('0xa'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x0a4d=['BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','exports','STRING','name'];(function(_0x184800,_0x13f14e){var _0x58e20b=function(_0x481e55){while(--_0x481e55){_0x184800['push'](_0x184800['shift']());}};_0x58e20b(++_0x13f14e);}(_0x0a4d,0xad));var _0xd0a4=function(_0xd3d949,_0x4f10e4){_0xd3d949=_0xd3d949-0x0;var _0x1a9f7a=_0x0a4d[_0xd3d949];return _0x1a9f7a;};'use strict';var Sequelize=require('sequelize');module[_0xd0a4('0x0')]={'name':{'type':Sequelize[_0xd0a4('0x1')],'unique':_0xd0a4('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xd0a4('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xd0a4('0x3')]('long'),'get':function(){if(this[_0xd0a4('0x4')](_0xd0a4('0x5'))){return this[_0xd0a4('0x4')](_0xd0a4('0x5'))[_0xd0a4('0x6')](_0xd0a4('0x7'));}}},'production':{'type':Sequelize[_0xd0a4('0x3')](_0xd0a4('0x8')),'get':function(){if(this[_0xd0a4('0x4')](_0xd0a4('0x9'))){return this['getDataValue'](_0xd0a4('0x9'))[_0xd0a4('0x6')]('utf8');}}},'savedAt':{'type':Sequelize[_0xd0a4('0xa')]},'publishedAt':{'type':Sequelize[_0xd0a4('0xa')]}};
\ No newline at end of file
index 20bed49..acee0cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f18=['findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','register','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','SquareProjects','UserProfileResource','error','stack','name','map','SquareProject','rawAttributes','type','model','query','filters','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers'];(function(_0x24431a,_0x52459a){var _0x454ec7=function(_0x34cd60){while(--_0x34cd60){_0x24431a['push'](_0x24431a['shift']());}};_0x454ec7(++_0x52459a);}(_0x1f18,0x1ce));var _0x81f1=function(_0x1f824b,_0x1f9910){_0x1f824b=_0x1f824b-0x0;var _0x2a4acb=_0x1f18[_0x1f824b];return _0x2a4acb;};'use strict';var emlformat=require(_0x81f1('0x0'));var rimraf=require(_0x81f1('0x1'));var zipdir=require(_0x81f1('0x2'));var jsonpatch=require(_0x81f1('0x3'));var rp=require(_0x81f1('0x4'));var moment=require(_0x81f1('0x5'));var BPromise=require(_0x81f1('0x6'));var Mustache=require(_0x81f1('0x7'));var util=require('util');var path=require('path');var sox=require(_0x81f1('0x8'));var csv=require(_0x81f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x81f1('0xa'));var squel=require(_0x81f1('0xb'));var crypto=require('crypto');var jsforce=require(_0x81f1('0xc'));var deskjs=require(_0x81f1('0xd'));var toCsv=require(_0x81f1('0x9'));var querystring=require('querystring');var Papa=require(_0x81f1('0xe'));var Redis=require(_0x81f1('0xf'));var authService=require(_0x81f1('0x10'));var qs=require(_0x81f1('0x11'));var as=require(_0x81f1('0x12'));var hardwareService=require(_0x81f1('0x13'));var logger=require(_0x81f1('0x14'))('api');var utils=require(_0x81f1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x81f1('0x16'));var db=require(_0x81f1('0x17'))['db'];config['redis']=_['defaults'](config[_0x81f1('0x18')],{'host':_0x81f1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x81f1('0x18')]));require('./squareProject.socket')[_0x81f1('0x1a')](socket);function respondWithStatusCode(_0xb6c5df,_0x3ec5f4){_0x3ec5f4=_0x3ec5f4||0xcc;return function(_0x1c4aaf){if(_0x1c4aaf){return _0xb6c5df[_0x81f1('0x1b')](_0x3ec5f4);}return _0xb6c5df['status'](_0x3ec5f4)[_0x81f1('0x1c')]();};}function respondWithResult(_0xb21e2d,_0x10cb9f){_0x10cb9f=_0x10cb9f||0xc8;return function(_0x58b55d){if(_0x58b55d){return _0xb21e2d[_0x81f1('0x1d')](_0x10cb9f)['json'](_0x58b55d);}};}function respondWithFilteredResult(_0x4c67e2,_0xceb34f){return function(_0x5ae31c){if(_0x5ae31c){var _0x5dd906=typeof _0xceb34f[_0x81f1('0x1e')]===_0x81f1('0x1f')&&typeof _0xceb34f[_0x81f1('0x20')]==='undefined';var _0x17d305=_0x5ae31c[_0x81f1('0x21')];var _0x1d39d2=_0x5dd906?0x0:_0xceb34f[_0x81f1('0x1e')];var _0x41d2a5=_0x5dd906?_0x5ae31c['count']:_0xceb34f[_0x81f1('0x1e')]+_0xceb34f[_0x81f1('0x20')];var _0x364108;if(_0x41d2a5>=_0x17d305){_0x41d2a5=_0x17d305;_0x364108=0xc8;}else{_0x364108=0xce;}_0x4c67e2[_0x81f1('0x1d')](_0x364108);return _0x4c67e2[_0x81f1('0x22')]('Content-Range',_0x1d39d2+'-'+_0x41d2a5+'/'+_0x17d305)['json'](_0x5ae31c);}return null;};}function patchUpdates(_0x53fd83){return function(_0x4cea49){try{jsonpatch[_0x81f1('0x23')](_0x4cea49,_0x53fd83,!![]);}catch(_0x27c187){return BPromise[_0x81f1('0x24')](_0x27c187);}return _0x4cea49[_0x81f1('0x25')]();};}function saveUpdates(_0x1e3be4,_0x449be8){return function(_0x46e693){if(_0x46e693){return _0x46e693[_0x81f1('0x26')](_0x1e3be4)[_0x81f1('0x27')](function(_0x1ca581){return _0x1ca581;});}return null;};}function removeEntity(_0x15d0a1,_0x510e9b){return function(_0x345c3e){if(_0x345c3e){return _0x345c3e[_0x81f1('0x28')]()[_0x81f1('0x27')](function(){var _0x591f2a=_0x345c3e['get']({'plain':!![]});var _0x1beb58=_0x81f1('0x29');return db[_0x81f1('0x2a')][_0x81f1('0x28')]({'where':{'type':_0x1beb58,'resourceId':_0x591f2a['id']}})[_0x81f1('0x27')](function(){return _0x345c3e;});})['then'](function(){_0x15d0a1[_0x81f1('0x1d')](0xcc)[_0x81f1('0x1c')]();});}};}function handleEntityNotFound(_0x2a5f22,_0x337dcc){return function(_0x35109b){if(!_0x35109b){_0x2a5f22[_0x81f1('0x1b')](0x194);}return _0x35109b;};}function handleError(_0x290517,_0x7037de){_0x7037de=_0x7037de||0x1f4;return function(_0x24b769){logger[_0x81f1('0x2b')](_0x24b769[_0x81f1('0x2c')]);if(_0x24b769['name']){delete _0x24b769[_0x81f1('0x2d')];}_0x290517[_0x81f1('0x1d')](_0x7037de)['send'](_0x24b769);};}exports['index']=function(_0x53be95,_0x4fa093){var _0x4162b5={},_0x383d1a={},_0x10d4e5={'count':0x0,'rows':[]};var _0x3c8c74=_[_0x81f1('0x2e')](db[_0x81f1('0x2f')][_0x81f1('0x30')],function(_0x4ad901){return{'name':_0x4ad901['fieldName'],'type':_0x4ad901[_0x81f1('0x31')]['key']};});_0x383d1a[_0x81f1('0x32')]=_[_0x81f1('0x2e')](_0x3c8c74,'name');_0x383d1a[_0x81f1('0x33')]=_['keys'](_0x53be95[_0x81f1('0x33')]);_0x383d1a[_0x81f1('0x34')]=_['intersection'](_0x383d1a[_0x81f1('0x32')],_0x383d1a[_0x81f1('0x33')]);_0x4162b5[_0x81f1('0x35')]=_['intersection'](_0x383d1a[_0x81f1('0x32')],qs[_0x81f1('0x36')](_0x53be95['query'][_0x81f1('0x36')]));_0x4162b5[_0x81f1('0x35')]=_0x4162b5[_0x81f1('0x35')][_0x81f1('0x37')]?_0x4162b5[_0x81f1('0x35')]:_0x383d1a[_0x81f1('0x32')];if(!_0x53be95['query']['hasOwnProperty'](_0x81f1('0x38'))){_0x4162b5[_0x81f1('0x20')]=qs[_0x81f1('0x20')](_0x53be95[_0x81f1('0x33')][_0x81f1('0x20')]);_0x4162b5[_0x81f1('0x1e')]=qs[_0x81f1('0x1e')](_0x53be95[_0x81f1('0x33')][_0x81f1('0x1e')]);}_0x4162b5[_0x81f1('0x39')]=qs[_0x81f1('0x3a')](_0x53be95['query']['sort']);_0x4162b5[_0x81f1('0x3b')]=qs[_0x81f1('0x34')](_[_0x81f1('0x3c')](_0x53be95[_0x81f1('0x33')],_0x383d1a[_0x81f1('0x34')]),_0x3c8c74);if(_0x53be95['query']['filter']){_0x4162b5[_0x81f1('0x3b')]=_['merge'](_0x4162b5[_0x81f1('0x3b')],{'$or':_[_0x81f1('0x2e')](_0x3c8c74,function(_0xa51045){if(_0xa51045[_0x81f1('0x31')]!==_0x81f1('0x3d')){var _0x5a6449={};_0x5a6449[_0xa51045[_0x81f1('0x2d')]]={'$like':'%'+_0x53be95['query'][_0x81f1('0x3e')]+'%'};return _0x5a6449;}})});}_0x4162b5=_[_0x81f1('0x3f')]({},_0x4162b5,_0x53be95[_0x81f1('0x40')]);var _0xa29a0c={'where':_0x4162b5['where']};return db[_0x81f1('0x2f')][_0x81f1('0x21')](_0xa29a0c)['then'](function(_0x2a4c46){_0x10d4e5[_0x81f1('0x21')]=_0x2a4c46;if(_0x53be95['query'][_0x81f1('0x41')]){_0x4162b5[_0x81f1('0x42')]=[{'all':!![]}];}return db[_0x81f1('0x2f')][_0x81f1('0x43')](_0x4162b5);})['then'](function(_0x7e9ed5){_0x10d4e5[_0x81f1('0x44')]=_0x7e9ed5;return _0x10d4e5;})[_0x81f1('0x27')](respondWithFilteredResult(_0x4fa093,_0x4162b5))[_0x81f1('0x45')](handleError(_0x4fa093,null));};exports['show']=function(_0x5010d8,_0x254b20){var _0x5c6c5b={'raw':![],'where':{'id':_0x5010d8[_0x81f1('0x46')]['id']}},_0x43c057={};_0x43c057[_0x81f1('0x32')]=_[_0x81f1('0x47')](db[_0x81f1('0x2f')][_0x81f1('0x30')]);_0x43c057[_0x81f1('0x33')]=_['keys'](_0x5010d8[_0x81f1('0x33')]);_0x43c057[_0x81f1('0x34')]=_[_0x81f1('0x48')](_0x43c057[_0x81f1('0x32')],_0x43c057['query']);_0x5c6c5b[_0x81f1('0x35')]=_[_0x81f1('0x48')](_0x43c057[_0x81f1('0x32')],qs[_0x81f1('0x36')](_0x5010d8[_0x81f1('0x33')][_0x81f1('0x36')]));_0x5c6c5b[_0x81f1('0x35')]=_0x5c6c5b[_0x81f1('0x35')]['length']?_0x5c6c5b['attributes']:_0x43c057['model'];if(_0x5010d8[_0x81f1('0x33')][_0x81f1('0x41')]){_0x5c6c5b[_0x81f1('0x42')]=[{'all':!![]}];}_0x5c6c5b=_[_0x81f1('0x3f')]({},_0x5c6c5b,_0x5010d8[_0x81f1('0x40')]);return db['SquareProject'][_0x81f1('0x49')](_0x5c6c5b)['then'](handleEntityNotFound(_0x254b20,null))[_0x81f1('0x27')](respondWithResult(_0x254b20,null))[_0x81f1('0x45')](handleError(_0x254b20,null));};exports['create']=function(_0x3e5025,_0x15c289){return db[_0x81f1('0x2f')][_0x81f1('0x4a')](_0x3e5025[_0x81f1('0x4b')],{})['then'](function(_0x451fc3){var _0x51c9dc=_0x3e5025[_0x81f1('0x4c')][_0x81f1('0x4d')]({'plain':!![]});if(!_0x51c9dc)throw new Error(_0x81f1('0x4e'));if(_0x51c9dc[_0x81f1('0x4f')]===_0x81f1('0x4c')){var _0x37f27f=_0x451fc3[_0x81f1('0x4d')]({'plain':!![]});var _0x1850b9=_0x81f1('0x29');return db[_0x81f1('0x50')][_0x81f1('0x49')]({'where':{'name':_0x1850b9,'userProfileId':_0x51c9dc['userProfileId']},'raw':!![]})['then'](function(_0x43c2c3){if(_0x43c2c3&&_0x43c2c3[_0x81f1('0x51')]===0x0){return db[_0x81f1('0x2a')][_0x81f1('0x4a')]({'name':_0x37f27f[_0x81f1('0x2d')],'resourceId':_0x37f27f['id'],'type':_0x43c2c3['name'],'sectionId':_0x43c2c3['id']},{})[_0x81f1('0x27')](function(){return _0x451fc3;});}else{return _0x451fc3;}})['catch'](function(_0x4eb2ac){logger[_0x81f1('0x2b')](_0x81f1('0x52'),_0x4eb2ac);throw _0x4eb2ac;});}return _0x451fc3;})['then'](respondWithResult(_0x15c289,0xc9))[_0x81f1('0x45')](handleError(_0x15c289,null));};exports[_0x81f1('0x26')]=function(_0x3b472e,_0x48b6d0){if(_0x3b472e[_0x81f1('0x4b')]['id']){delete _0x3b472e['body']['id'];}return db[_0x81f1('0x2f')]['find']({'where':{'id':_0x3b472e['params']['id']}})[_0x81f1('0x27')](handleEntityNotFound(_0x48b6d0,null))['then'](saveUpdates(_0x3b472e[_0x81f1('0x4b')],null))['then'](respondWithResult(_0x48b6d0,null))[_0x81f1('0x45')](handleError(_0x48b6d0,null));};exports['destroy']=function(_0x1136aa,_0x12529a){return db[_0x81f1('0x2f')]['find']({'where':{'id':_0x1136aa[_0x81f1('0x46')]['id']}})[_0x81f1('0x27')](handleEntityNotFound(_0x12529a,null))[_0x81f1('0x27')](removeEntity(_0x12529a,null))['catch'](handleError(_0x12529a,null));};exports[_0x81f1('0x53')]=function(_0x531b1b,_0x195f8d,_0x3b124b){return db[_0x81f1('0x2f')][_0x81f1('0x49')]({'where':{'id':_0x531b1b['params']['id']}})[_0x81f1('0x27')](handleEntityNotFound(_0x195f8d,null))['then'](function(_0x34f4d3){if(_0x34f4d3){return _0x34f4d3[_0x81f1('0x53')](_0x531b1b['body'][_0x81f1('0x54')],_[_0x81f1('0x55')](_0x531b1b[_0x81f1('0x4b')],[_0x81f1('0x54'),'id'])||{});}})[_0x81f1('0x27')](respondWithResult(_0x195f8d,null))['catch'](handleError(_0x195f8d,null));};exports[_0x81f1('0x56')]=function(_0x2b4a4b,_0x8bbbcf,_0xc982b2){return db[_0x81f1('0x2f')]['find']({'where':{'id':_0x2b4a4b[_0x81f1('0x46')]['id']}})[_0x81f1('0x27')](handleEntityNotFound(_0x8bbbcf,null))[_0x81f1('0x27')](function(_0x2d4e51){if(_0x2d4e51){return _0x2d4e51['removeUsers'](_0x2b4a4b[_0x81f1('0x33')][_0x81f1('0x54')])[_0x81f1('0x27')](function(){if(_['isArray'](_0x2b4a4b[_0x81f1('0x33')][_0x81f1('0x54')])){for(var _0x222c32=0x0;_0x222c32<_0x2b4a4b[_0x81f1('0x33')][_0x81f1('0x54')][_0x81f1('0x37')];_0x222c32+=0x1){socket[_0x81f1('0x57')](_0x81f1('0x58'),{'UserId':Number(_0x2b4a4b['query'][_0x81f1('0x54')][_0x222c32]),'SquareProjectId':Number(_0x2b4a4b[_0x81f1('0x46')]['id'])});}}else{socket[_0x81f1('0x57')]('userSquareProject:remove',{'UserId':Number(_0x2b4a4b[_0x81f1('0x33')][_0x81f1('0x54')]),'SquareProjectId':Number(_0x2b4a4b[_0x81f1('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x8bbbcf,null))[_0x81f1('0x45')](handleError(_0x8bbbcf,null));};exports[_0x81f1('0x59')]=function(_0x3582ec,_0x3b7516,_0x47676b){var _0x4ab260={};var _0x9b0023={};var _0x23d925;var _0x3385c8;return db[_0x81f1('0x2f')][_0x81f1('0x5a')]({'where':{'id':_0x3582ec['params']['id']}})[_0x81f1('0x27')](handleEntityNotFound(_0x3b7516,null))[_0x81f1('0x27')](function(_0xa3ca2a){if(_0xa3ca2a){_0x23d925=_0xa3ca2a;_0x9b0023[_0x81f1('0x32')]=_['keys'](db[_0x81f1('0x5b')][_0x81f1('0x30')]);_0x9b0023['query']=_[_0x81f1('0x47')](_0x3582ec[_0x81f1('0x33')]);_0x9b0023['filters']=_[_0x81f1('0x48')](_0x9b0023[_0x81f1('0x32')],_0x9b0023['query']);_0x4ab260[_0x81f1('0x35')]=_[_0x81f1('0x48')](_0x9b0023[_0x81f1('0x32')],qs['fields'](_0x3582ec[_0x81f1('0x33')][_0x81f1('0x36')]));_0x4ab260[_0x81f1('0x35')]=_0x4ab260[_0x81f1('0x35')][_0x81f1('0x37')]?_0x4ab260[_0x81f1('0x35')]:_0x9b0023[_0x81f1('0x32')];_0x4ab260[_0x81f1('0x39')]=qs['sort'](_0x3582ec['query'][_0x81f1('0x3a')]);_0x4ab260[_0x81f1('0x3b')]=qs[_0x81f1('0x34')](_['pick'](_0x3582ec[_0x81f1('0x33')],_0x9b0023['filters']));if(_0x3582ec['query']['filter']){_0x4ab260[_0x81f1('0x3b')]=_[_0x81f1('0x3f')](_0x4ab260[_0x81f1('0x3b')],{'$or':_[_0x81f1('0x2e')](_0x4ab260[_0x81f1('0x35')],function(_0x5a27bd){var _0x5309e0={};_0x5309e0[_0x5a27bd]={'$like':'%'+_0x3582ec[_0x81f1('0x33')]['filter']+'%'};return _0x5309e0;})});}_0x4ab260=_[_0x81f1('0x3f')]({},_0x4ab260,_0x3582ec[_0x81f1('0x40')]);return _0x23d925['getUsers'](_0x4ab260);}})[_0x81f1('0x27')](function(_0x384707){if(_0x384707){_0x3385c8=_0x384707[_0x81f1('0x37')];if(!_0x3582ec['query']['hasOwnProperty'](_0x81f1('0x38'))){_0x4ab260[_0x81f1('0x20')]=qs[_0x81f1('0x20')](_0x3582ec[_0x81f1('0x33')]['limit']);_0x4ab260[_0x81f1('0x1e')]=qs['offset'](_0x3582ec[_0x81f1('0x33')][_0x81f1('0x1e')]);}return _0x23d925['getUsers'](_0x4ab260);}})['then'](function(_0x25c91e){if(_0x25c91e){return _0x25c91e?{'count':_0x3385c8,'rows':_0x25c91e}:null;}})[_0x81f1('0x27')](respondWithResult(_0x3b7516,null))[_0x81f1('0x45')](handleError(_0x3b7516,null));};
\ No newline at end of file
+var _0x3297=['undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','SquareProject','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','map','VIRTUAL','includeAll','include','catch','show','params','keys','options','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','order','pick','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','offset'];(function(_0x415a57,_0x7cf318){var _0x37c5b6=function(_0x50aac9){while(--_0x50aac9){_0x415a57['push'](_0x415a57['shift']());}};_0x37c5b6(++_0x7cf318);}(_0x3297,0x1c9));var _0x7329=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x3297[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x7329('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7329('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7329('0x2'));var moment=require(_0x7329('0x3'));var BPromise=require(_0x7329('0x4'));var Mustache=require(_0x7329('0x5'));var util=require(_0x7329('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7329('0x7'));var ejs=require(_0x7329('0x8'));var fs=require('fs');var fs_extra=require(_0x7329('0x9'));var _=require(_0x7329('0xa'));var squel=require(_0x7329('0xb'));var crypto=require(_0x7329('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7329('0x7'));var querystring=require(_0x7329('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7329('0xe'));var qs=require(_0x7329('0xf'));var as=require(_0x7329('0x10'));var hardwareService=require(_0x7329('0x11'));var logger=require('../../config/logger')(_0x7329('0x12'));var utils=require(_0x7329('0x13'));var config=require(_0x7329('0x14'));var licenseUtil=require(_0x7329('0x15'));var db=require(_0x7329('0x16'))['db'];config[_0x7329('0x17')]=_['defaults'](config[_0x7329('0x17')],{'host':_0x7329('0x18'),'port':0x18eb});var socket=require(_0x7329('0x19'))(new Redis(config[_0x7329('0x17')]));require(_0x7329('0x1a'))[_0x7329('0x1b')](socket);function respondWithStatusCode(_0x1f65d5,_0x369d62){_0x369d62=_0x369d62||0xcc;return function(_0x34f774){if(_0x34f774){return _0x1f65d5[_0x7329('0x1c')](_0x369d62);}return _0x1f65d5[_0x7329('0x1d')](_0x369d62)[_0x7329('0x1e')]();};}function respondWithResult(_0x36d6a5,_0x5003dc){_0x5003dc=_0x5003dc||0xc8;return function(_0x4946c6){if(_0x4946c6){return _0x36d6a5[_0x7329('0x1d')](_0x5003dc)[_0x7329('0x1f')](_0x4946c6);}};}function respondWithFilteredResult(_0x19dcf6,_0x31938e){return function(_0x343c68){if(_0x343c68){var _0x3c1031=typeof _0x31938e[_0x7329('0x20')]===_0x7329('0x21')&&typeof _0x31938e[_0x7329('0x22')]===_0x7329('0x21');var _0x248818=_0x343c68[_0x7329('0x23')];var _0x46a868=_0x3c1031?0x0:_0x31938e[_0x7329('0x20')];var _0x36b9f4=_0x3c1031?_0x343c68[_0x7329('0x23')]:_0x31938e['offset']+_0x31938e[_0x7329('0x22')];var _0x281d50;if(_0x36b9f4>=_0x248818){_0x36b9f4=_0x248818;_0x281d50=0xc8;}else{_0x281d50=0xce;}_0x19dcf6[_0x7329('0x1d')](_0x281d50);return _0x19dcf6[_0x7329('0x24')](_0x7329('0x25'),_0x46a868+'-'+_0x36b9f4+'/'+_0x248818)[_0x7329('0x1f')](_0x343c68);}return null;};}function patchUpdates(_0x4b2c3e){return function(_0x217a02){try{jsonpatch[_0x7329('0x26')](_0x217a02,_0x4b2c3e,!![]);}catch(_0x161181){return BPromise['reject'](_0x161181);}return _0x217a02[_0x7329('0x27')]();};}function saveUpdates(_0x41157e,_0x2508f8){return function(_0xa46775){if(_0xa46775){return _0xa46775[_0x7329('0x28')](_0x41157e)[_0x7329('0x29')](function(_0x253211){return _0x253211;});}return null;};}function removeEntity(_0x24918e,_0x446e2e){return function(_0x25dc38){if(_0x25dc38){return _0x25dc38[_0x7329('0x2a')]()['then'](function(){var _0x4b3146=_0x25dc38[_0x7329('0x2b')]({'plain':!![]});var _0x15b737=_0x7329('0x2c');return db[_0x7329('0x2d')]['destroy']({'where':{'type':_0x15b737,'resourceId':_0x4b3146['id']}})[_0x7329('0x29')](function(){return _0x25dc38;});})[_0x7329('0x29')](function(){_0x24918e[_0x7329('0x1d')](0xcc)[_0x7329('0x1e')]();});}};}function handleEntityNotFound(_0x328cc8,_0x230159){return function(_0x2251d3){if(!_0x2251d3){_0x328cc8[_0x7329('0x1c')](0x194);}return _0x2251d3;};}function handleError(_0x43fc7a,_0x3a9971){_0x3a9971=_0x3a9971||0x1f4;return function(_0x2d3aed){logger[_0x7329('0x2e')](_0x2d3aed[_0x7329('0x2f')]);if(_0x2d3aed[_0x7329('0x30')]){delete _0x2d3aed[_0x7329('0x30')];}_0x43fc7a[_0x7329('0x1d')](_0x3a9971)[_0x7329('0x31')](_0x2d3aed);};}exports[_0x7329('0x32')]=function(_0x2395c8,_0x2f19d2){var _0x34bda5={},_0x4df163={},_0x5b7bd0={'count':0x0,'rows':[]};var _0x31ff7a=_['map'](db[_0x7329('0x33')][_0x7329('0x34')],function(_0x4171a3){return{'name':_0x4171a3[_0x7329('0x35')],'type':_0x4171a3[_0x7329('0x36')][_0x7329('0x37')]};});_0x4df163['model']=_['map'](_0x31ff7a,_0x7329('0x30'));_0x4df163[_0x7329('0x38')]=_['keys'](_0x2395c8[_0x7329('0x38')]);_0x4df163[_0x7329('0x39')]=_['intersection'](_0x4df163[_0x7329('0x3a')],_0x4df163['query']);_0x34bda5[_0x7329('0x3b')]=_[_0x7329('0x3c')](_0x4df163[_0x7329('0x3a')],qs['fields'](_0x2395c8['query'][_0x7329('0x3d')]));_0x34bda5['attributes']=_0x34bda5['attributes'][_0x7329('0x3e')]?_0x34bda5[_0x7329('0x3b')]:_0x4df163[_0x7329('0x3a')];if(!_0x2395c8[_0x7329('0x38')]['hasOwnProperty'](_0x7329('0x3f'))){_0x34bda5[_0x7329('0x22')]=qs['limit'](_0x2395c8[_0x7329('0x38')]['limit']);_0x34bda5[_0x7329('0x20')]=qs[_0x7329('0x20')](_0x2395c8['query']['offset']);}_0x34bda5['order']=qs[_0x7329('0x40')](_0x2395c8[_0x7329('0x38')]['sort']);_0x34bda5[_0x7329('0x41')]=qs[_0x7329('0x39')](_['pick'](_0x2395c8[_0x7329('0x38')],_0x4df163[_0x7329('0x39')]),_0x31ff7a);if(_0x2395c8[_0x7329('0x38')][_0x7329('0x42')]){_0x34bda5[_0x7329('0x41')]=_[_0x7329('0x43')](_0x34bda5[_0x7329('0x41')],{'$or':_[_0x7329('0x44')](_0x31ff7a,function(_0x3c2ce0){if(_0x3c2ce0[_0x7329('0x36')]!==_0x7329('0x45')){var _0x5688fe={};_0x5688fe[_0x3c2ce0[_0x7329('0x30')]]={'$like':'%'+_0x2395c8['query'][_0x7329('0x42')]+'%'};return _0x5688fe;}})});}_0x34bda5=_[_0x7329('0x43')]({},_0x34bda5,_0x2395c8['options']);var _0xd5cfe3={'where':_0x34bda5[_0x7329('0x41')]};return db[_0x7329('0x33')][_0x7329('0x23')](_0xd5cfe3)[_0x7329('0x29')](function(_0x1ae84f){_0x5b7bd0[_0x7329('0x23')]=_0x1ae84f;if(_0x2395c8[_0x7329('0x38')][_0x7329('0x46')]){_0x34bda5[_0x7329('0x47')]=[{'all':!![]}];}return db[_0x7329('0x33')]['findAll'](_0x34bda5);})['then'](function(_0x56bbde){_0x5b7bd0['rows']=_0x56bbde;return _0x5b7bd0;})['then'](respondWithFilteredResult(_0x2f19d2,_0x34bda5))[_0x7329('0x48')](handleError(_0x2f19d2,null));};exports[_0x7329('0x49')]=function(_0x3bdcfe,_0x25eaca){var _0xf510a7={'raw':![],'where':{'id':_0x3bdcfe[_0x7329('0x4a')]['id']}},_0x1f3214={};_0x1f3214['model']=_[_0x7329('0x4b')](db['SquareProject']['rawAttributes']);_0x1f3214['query']=_[_0x7329('0x4b')](_0x3bdcfe['query']);_0x1f3214['filters']=_['intersection'](_0x1f3214[_0x7329('0x3a')],_0x1f3214[_0x7329('0x38')]);_0xf510a7[_0x7329('0x3b')]=_['intersection'](_0x1f3214[_0x7329('0x3a')],qs[_0x7329('0x3d')](_0x3bdcfe[_0x7329('0x38')][_0x7329('0x3d')]));_0xf510a7['attributes']=_0xf510a7[_0x7329('0x3b')][_0x7329('0x3e')]?_0xf510a7[_0x7329('0x3b')]:_0x1f3214[_0x7329('0x3a')];if(_0x3bdcfe[_0x7329('0x38')][_0x7329('0x46')]){_0xf510a7[_0x7329('0x47')]=[{'all':!![]}];}_0xf510a7=_[_0x7329('0x43')]({},_0xf510a7,_0x3bdcfe[_0x7329('0x4c')]);return db[_0x7329('0x33')]['find'](_0xf510a7)[_0x7329('0x29')](handleEntityNotFound(_0x25eaca,null))[_0x7329('0x29')](respondWithResult(_0x25eaca,null))[_0x7329('0x48')](handleError(_0x25eaca,null));};exports['create']=function(_0x10569c,_0x269c67){return db['SquareProject']['create'](_0x10569c[_0x7329('0x4d')],{})['then'](function(_0x111ced){var _0x2ecc75=_0x10569c[_0x7329('0x4e')][_0x7329('0x2b')]({'plain':!![]});if(!_0x2ecc75)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ecc75[_0x7329('0x4f')]==='user'){var _0xeae053=_0x111ced[_0x7329('0x2b')]({'plain':!![]});var _0x4008c9='SquareProjects';return db[_0x7329('0x50')][_0x7329('0x51')]({'where':{'name':_0x4008c9,'userProfileId':_0x2ecc75[_0x7329('0x52')]},'raw':!![]})[_0x7329('0x29')](function(_0x2fae86){if(_0x2fae86&&_0x2fae86[_0x7329('0x53')]===0x0){return db[_0x7329('0x2d')][_0x7329('0x54')]({'name':_0xeae053[_0x7329('0x30')],'resourceId':_0xeae053['id'],'type':_0x2fae86[_0x7329('0x30')],'sectionId':_0x2fae86['id']},{})[_0x7329('0x29')](function(){return _0x111ced;});}else{return _0x111ced;}})[_0x7329('0x48')](function(_0x4f8f56){logger[_0x7329('0x2e')](_0x7329('0x55'),_0x4f8f56);throw _0x4f8f56;});}return _0x111ced;})[_0x7329('0x29')](respondWithResult(_0x269c67,0xc9))[_0x7329('0x48')](handleError(_0x269c67,null));};exports[_0x7329('0x28')]=function(_0x48620a,_0x3aedef){if(_0x48620a['body']['id']){delete _0x48620a[_0x7329('0x4d')]['id'];}return db['SquareProject'][_0x7329('0x51')]({'where':{'id':_0x48620a[_0x7329('0x4a')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x3aedef,null))[_0x7329('0x29')](saveUpdates(_0x48620a[_0x7329('0x4d')],null))[_0x7329('0x29')](respondWithResult(_0x3aedef,null))[_0x7329('0x48')](handleError(_0x3aedef,null));};exports['destroy']=function(_0x38112c,_0x4f32e5){return db['SquareProject'][_0x7329('0x51')]({'where':{'id':_0x38112c[_0x7329('0x4a')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x4f32e5,null))['then'](removeEntity(_0x4f32e5,null))[_0x7329('0x48')](handleError(_0x4f32e5,null));};exports['addUsers']=function(_0x38be7e,_0x20bf10,_0x143096){return db['SquareProject'][_0x7329('0x51')]({'where':{'id':_0x38be7e[_0x7329('0x4a')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x20bf10,null))[_0x7329('0x29')](function(_0x553b2b){if(_0x553b2b){return _0x553b2b[_0x7329('0x56')](_0x38be7e['body'][_0x7329('0x57')],_[_0x7329('0x58')](_0x38be7e['body'],['ids','id'])||{});}})[_0x7329('0x29')](respondWithResult(_0x20bf10,null))[_0x7329('0x48')](handleError(_0x20bf10,null));};exports[_0x7329('0x59')]=function(_0x12a2a0,_0x1c6e6f,_0x10be46){return db[_0x7329('0x33')][_0x7329('0x51')]({'where':{'id':_0x12a2a0[_0x7329('0x4a')]['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x1c6e6f,null))[_0x7329('0x29')](function(_0x21fcfa){if(_0x21fcfa){return _0x21fcfa['removeUsers'](_0x12a2a0['query'][_0x7329('0x57')])[_0x7329('0x29')](function(){if(_['isArray'](_0x12a2a0[_0x7329('0x38')][_0x7329('0x57')])){for(var _0x3b13dc=0x0;_0x3b13dc<_0x12a2a0['query'][_0x7329('0x57')][_0x7329('0x3e')];_0x3b13dc+=0x1){socket[_0x7329('0x5a')](_0x7329('0x5b'),{'UserId':Number(_0x12a2a0[_0x7329('0x38')][_0x7329('0x57')][_0x3b13dc]),'SquareProjectId':Number(_0x12a2a0['params']['id'])});}}else{socket[_0x7329('0x5a')](_0x7329('0x5b'),{'UserId':Number(_0x12a2a0[_0x7329('0x38')][_0x7329('0x57')]),'SquareProjectId':Number(_0x12a2a0[_0x7329('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c6e6f,null))[_0x7329('0x48')](handleError(_0x1c6e6f,null));};exports[_0x7329('0x5c')]=function(_0x39ba4f,_0x5ca8b8,_0x180852){var _0x493dca={};var _0x24c013={};var _0x2d0e0e;var _0x31051e;return db[_0x7329('0x33')][_0x7329('0x5d')]({'where':{'id':_0x39ba4f['params']['id']}})[_0x7329('0x29')](handleEntityNotFound(_0x5ca8b8,null))[_0x7329('0x29')](function(_0x249d12){if(_0x249d12){_0x2d0e0e=_0x249d12;_0x24c013[_0x7329('0x3a')]=_[_0x7329('0x4b')](db[_0x7329('0x5e')][_0x7329('0x34')]);_0x24c013[_0x7329('0x38')]=_[_0x7329('0x4b')](_0x39ba4f[_0x7329('0x38')]);_0x24c013['filters']=_['intersection'](_0x24c013[_0x7329('0x3a')],_0x24c013[_0x7329('0x38')]);_0x493dca[_0x7329('0x3b')]=_[_0x7329('0x3c')](_0x24c013['model'],qs[_0x7329('0x3d')](_0x39ba4f[_0x7329('0x38')]['fields']));_0x493dca[_0x7329('0x3b')]=_0x493dca['attributes']['length']?_0x493dca[_0x7329('0x3b')]:_0x24c013[_0x7329('0x3a')];_0x493dca[_0x7329('0x5f')]=qs[_0x7329('0x40')](_0x39ba4f[_0x7329('0x38')][_0x7329('0x40')]);_0x493dca[_0x7329('0x41')]=qs[_0x7329('0x39')](_[_0x7329('0x60')](_0x39ba4f['query'],_0x24c013[_0x7329('0x39')]));if(_0x39ba4f[_0x7329('0x38')]['filter']){_0x493dca[_0x7329('0x41')]=_['merge'](_0x493dca[_0x7329('0x41')],{'$or':_[_0x7329('0x44')](_0x493dca[_0x7329('0x3b')],function(_0x22d6bb){var _0x34d4ce={};_0x34d4ce[_0x22d6bb]={'$like':'%'+_0x39ba4f['query'][_0x7329('0x42')]+'%'};return _0x34d4ce;})});}_0x493dca=_[_0x7329('0x43')]({},_0x493dca,_0x39ba4f[_0x7329('0x4c')]);return _0x2d0e0e[_0x7329('0x5c')](_0x493dca);}})['then'](function(_0x58e3d1){if(_0x58e3d1){_0x31051e=_0x58e3d1[_0x7329('0x3e')];if(!_0x39ba4f['query'][_0x7329('0x61')](_0x7329('0x3f'))){_0x493dca['limit']=qs[_0x7329('0x22')](_0x39ba4f[_0x7329('0x38')][_0x7329('0x22')]);_0x493dca[_0x7329('0x20')]=qs[_0x7329('0x20')](_0x39ba4f['query']['offset']);}return _0x2d0e0e[_0x7329('0x5c')](_0x493dca);}})[_0x7329('0x29')](function(_0x5da4f2){if(_0x5da4f2){return _0x5da4f2?{'count':_0x31051e,'rows':_0x5da4f2}:null;}})[_0x7329('0x29')](respondWithResult(_0x5ca8b8,null))[_0x7329('0x48')](handleError(_0x5ca8b8,null));};
\ No newline at end of file
index 7c40b77..d431983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x198e=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x377d12,_0x4e9fd0){var _0x3b4c41=function(_0x1e706d){while(--_0x1e706d){_0x377d12['push'](_0x377d12['shift']());}};_0x3b4c41(++_0x4e9fd0);}(_0x198e,0x1de));var _0xe198=function(_0x21235e,_0x3b40e3){_0x21235e=_0x21235e-0x0;var _0x479e51=_0x198e[_0x21235e];return _0x479e51;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xe198('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xe198('0x1')](0x0);var events={'afterCreate':_0xe198('0x2'),'afterUpdate':_0xe198('0x3'),'afterDestroy':_0xe198('0x4')};function emitEvent(_0x371c9f){return function(_0x2d05fb,_0x43616d,_0x40c6fa){SquareProjectEvents[_0xe198('0x5')](_0x371c9f+':'+_0x2d05fb['id'],_0x2d05fb);SquareProjectEvents[_0xe198('0x5')](_0x371c9f,_0x2d05fb);_0x40c6fa(null);};}for(var e in events){if(events[_0xe198('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xe198('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0x0b48=['SquareProject','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x46aaca,_0x38531f){var _0x1f928f=function(_0x47d662){while(--_0x47d662){_0x46aaca['push'](_0x46aaca['shift']());}};_0x1f928f(++_0x38531f);}(_0x0b48,0xc6));var _0x80b4=function(_0x315d5d,_0x2d1146){_0x315d5d=_0x315d5d-0x0;var _0x169e12=_0x0b48[_0x315d5d];return _0x169e12;};'use strict';var EventEmitter=require(_0x80b4('0x0'));var SquareProject=require(_0x80b4('0x1'))['db'][_0x80b4('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x80b4('0x3')](0x0);var events={'afterCreate':_0x80b4('0x4'),'afterUpdate':_0x80b4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x18431f){return function(_0x15e1dc,_0x2eaf94,_0x912e52){SquareProjectEvents[_0x80b4('0x6')](_0x18431f+':'+_0x15e1dc['id'],_0x15e1dc);SquareProjectEvents['emit'](_0x18431f,_0x15e1dc);_0x912e52(null);};}for(var e in events){if(events[_0x80b4('0x7')](e)){var event=events[e];SquareProject[_0x80b4('0x8')](e,emitEvent(event));}}module[_0x80b4('0x9')]=SquareProjectEvents;
\ No newline at end of file
index 192df8c..87c2996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf35=['rimraf','./squareProject.attributes','define','SquareProject','square_projects','preproduction','savedAt','format','changed','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5a5acc,_0x20b7a7){var _0x2c4e0e=function(_0x5e1010){while(--_0x5e1010){_0x5a5acc['push'](_0x5a5acc['shift']());}};_0x2c4e0e(++_0x20b7a7);}(_0xbf35,0x185));var _0x5bf3=function(_0x2e5915,_0x54ada9){_0x2e5915=_0x2e5915-0x0;var _0x252d64=_0xbf35[_0x2e5915];return _0x252d64;};'use strict';var _=require(_0x5bf3('0x0'));var util=require(_0x5bf3('0x1'));var logger=require(_0x5bf3('0x2'))(_0x5bf3('0x3'));var moment=require(_0x5bf3('0x4'));var BPromise=require(_0x5bf3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bf3('0x6'));var rimraf=require(_0x5bf3('0x7'));var config=require('../../config/environment');var attributes=require(_0x5bf3('0x8'));module['exports']=function(_0x154f5,_0x228509){return _0x154f5[_0x5bf3('0x9')](_0x5bf3('0xa'),attributes,{'tableName':_0x5bf3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x353438,_0x583cf3,_0x1bf63e){if(_0x353438['changed'](_0x5bf3('0xc'))){_0x353438[_0x5bf3('0xd')]=moment()[_0x5bf3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x353438[_0x5bf3('0xf')](_0x5bf3('0x10'))){_0x353438[_0x5bf3('0x11')]=moment()[_0x5bf3('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1bf63e(null,_0x353438);}}});};
\ No newline at end of file
+var _0x8c2b=['savedAt','production','publishedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed'];(function(_0x1d3906,_0x551f8c){var _0x90e496=function(_0x13e6ac){while(--_0x13e6ac){_0x1d3906['push'](_0x1d3906['shift']());}};_0x90e496(++_0x551f8c);}(_0x8c2b,0x81));var _0xb8c2=function(_0x9c8b0c,_0x41ee23){_0x9c8b0c=_0x9c8b0c-0x0;var _0x478fc4=_0x8c2b[_0x9c8b0c];return _0x478fc4;};'use strict';var _=require(_0xb8c2('0x0'));var util=require(_0xb8c2('0x1'));var logger=require(_0xb8c2('0x2'))(_0xb8c2('0x3'));var moment=require(_0xb8c2('0x4'));var BPromise=require(_0xb8c2('0x5'));var rp=require(_0xb8c2('0x6'));var fs=require('fs');var path=require(_0xb8c2('0x7'));var rimraf=require(_0xb8c2('0x8'));var config=require(_0xb8c2('0x9'));var attributes=require('./squareProject.attributes');module[_0xb8c2('0xa')]=function(_0x20fb53,_0x27e26b){return _0x20fb53[_0xb8c2('0xb')](_0xb8c2('0xc'),attributes,{'tableName':_0xb8c2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3edae0,_0x365a65,_0x495d27){if(_0x3edae0[_0xb8c2('0xe')]('preproduction')){_0x3edae0[_0xb8c2('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3edae0[_0xb8c2('0xe')](_0xb8c2('0x10'))){_0x3edae0[_0xb8c2('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x495d27(null,_0x3edae0);}}});};
\ No newline at end of file
index 0ffbaf8..a94f259 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d03=['ShowSquareProject','SquareProject','find','options','attributes','include','map','model','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2c768d,_0x5b3efb){var _0x2e0941=function(_0x3caae9){while(--_0x3caae9){_0x2c768d['push'](_0x2c768d['shift']());}};_0x2e0941(++_0x5b3efb);}(_0x1d03,0x18a));var _0x31d0=function(_0x539e36,_0xe85f1a){_0x539e36=_0x539e36-0x0;var _0x958c58=_0x1d03[_0x539e36];return _0x958c58;};'use strict';var _=require('lodash');var util=require(_0x31d0('0x0'));var moment=require(_0x31d0('0x1'));var BPromise=require(_0x31d0('0x2'));var rs=require(_0x31d0('0x3'));var fs=require('fs');var Redis=require(_0x31d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x31d0('0x5'));var logger=require('../../config/logger')(_0x31d0('0x6'));var config=require(_0x31d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x31d0('0x8')][_0x31d0('0x9')]({'port':0x232a});config[_0x31d0('0xa')]=_[_0x31d0('0xb')](config[_0x31d0('0xa')],{'host':_0x31d0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31d0('0xa')]));require(_0x31d0('0xd'))[_0x31d0('0xe')](socket);function respondWithRpcPromise(_0x32a15a,_0xba72de,_0x57de5e){return new BPromise(function(_0x5c095d,_0x3048f4){return client['request'](_0x32a15a,_0x57de5e)[_0x31d0('0xf')](function(_0x1e2d34){logger[_0x31d0('0x10')](_0x31d0('0x11'),_0xba72de,_0x31d0('0x12'));logger[_0x31d0('0x13')](_0x31d0('0x14'),_0xba72de,_0x31d0('0x12'),JSON[_0x31d0('0x15')](_0x1e2d34));if(_0x1e2d34['error']){if(_0x1e2d34[_0x31d0('0x16')][_0x31d0('0x17')]===0x1f4){logger[_0x31d0('0x16')](_0x31d0('0x11'),_0xba72de,_0x1e2d34[_0x31d0('0x16')]['message']);return _0x3048f4(_0x1e2d34[_0x31d0('0x16')][_0x31d0('0x18')]);}logger['error'](_0x31d0('0x11'),_0xba72de,_0x1e2d34['error']['message']);return _0x5c095d(_0x1e2d34[_0x31d0('0x16')][_0x31d0('0x18')]);}else{logger[_0x31d0('0x10')]('SquareProject,\x20%s,\x20%s',_0xba72de,_0x31d0('0x12'));_0x5c095d(_0x1e2d34[_0x31d0('0x19')][_0x31d0('0x18')]);}})['catch'](function(_0x23ce01){logger['error'](_0x31d0('0x11'),_0xba72de,_0x23ce01);_0x3048f4(_0x23ce01);});});}exports[_0x31d0('0x1a')]=function(_0x6f87dc){var _0x2a582e=this;return new Promise(function(_0x6a427f,_0x3f7454){return db[_0x31d0('0x1b')][_0x31d0('0x1c')]({'raw':_0x6f87dc[_0x31d0('0x1d')]?_0x6f87dc[_0x31d0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x6f87dc[_0x31d0('0x1d')]?_0x6f87dc[_0x31d0('0x1d')]['where']||null:null,'attributes':_0x6f87dc[_0x31d0('0x1d')]?_0x6f87dc['options'][_0x31d0('0x1e')]||null:null,'include':_0x6f87dc[_0x31d0('0x1d')]?_0x6f87dc['options'][_0x31d0('0x1f')]?_[_0x31d0('0x20')](_0x6f87dc[_0x31d0('0x1d')][_0x31d0('0x1f')],function(_0x3e9dc0){return{'model':db[_0x3e9dc0[_0x31d0('0x21')]],'as':_0x3e9dc0['as'],'attributes':_0x3e9dc0['attributes'],'include':_0x3e9dc0[_0x31d0('0x1f')]?_[_0x31d0('0x20')](_0x3e9dc0[_0x31d0('0x1f')],function(_0x2cd88f){return{'model':db[_0x2cd88f['model']],'as':_0x2cd88f['as'],'attributes':_0x2cd88f['attributes'],'include':_0x2cd88f[_0x31d0('0x1f')]?_[_0x31d0('0x20')](_0x2cd88f[_0x31d0('0x1f')],function(_0x456ac0){return{'model':db[_0x456ac0[_0x31d0('0x21')]],'as':_0x456ac0['as'],'attributes':_0x456ac0[_0x31d0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5495cd){logger[_0x31d0('0x10')]('ShowSquareProject',_0x6f87dc);logger['debug'](_0x31d0('0x1a'),_0x6f87dc,JSON['stringify'](_0x5495cd));_0x6a427f(_0x5495cd);})[_0x31d0('0x22')](function(_0x33e1e9){logger[_0x31d0('0x16')](_0x31d0('0x1a'),_0x33e1e9['message'],_0x6f87dc);_0x3f7454(_0x2a582e[_0x31d0('0x16')](0x1f4,_0x33e1e9[_0x31d0('0x18')]));});});};
\ No newline at end of file
+var _0x7165=['request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareProject','SquareProject','find','options','where','attributes','include','map','model','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','register'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x7165,0x112));var _0x5716=function(_0xb5fc12,_0x52af9e){_0xb5fc12=_0xb5fc12-0x0;var _0x41063c=_0x7165[_0xb5fc12];return _0x41063c;};'use strict';var _=require(_0x5716('0x0'));var util=require('util');var moment=require(_0x5716('0x1'));var BPromise=require('bluebird');var rs=require(_0x5716('0x2'));var fs=require('fs');var Redis=require(_0x5716('0x3'));var db=require(_0x5716('0x4'))['db'];var utils=require(_0x5716('0x5'));var logger=require(_0x5716('0x6'))(_0x5716('0x7'));var config=require(_0x5716('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5716('0x9')]({'port':0x232a});config[_0x5716('0xa')]=_[_0x5716('0xb')](config[_0x5716('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5716('0xc'))(new Redis(config[_0x5716('0xa')]));require('./squareProject.socket')[_0x5716('0xd')](socket);function respondWithRpcPromise(_0xfb7b42,_0x413ce9,_0x10fd54){return new BPromise(function(_0x4ee002,_0x42e575){return client[_0x5716('0xe')](_0xfb7b42,_0x10fd54)[_0x5716('0xf')](function(_0x636be){logger['info'](_0x5716('0x10'),_0x413ce9,_0x5716('0x11'));logger[_0x5716('0x12')](_0x5716('0x13'),_0x413ce9,_0x5716('0x11'),JSON[_0x5716('0x14')](_0x636be));if(_0x636be[_0x5716('0x15')]){if(_0x636be[_0x5716('0x15')][_0x5716('0x16')]===0x1f4){logger[_0x5716('0x15')](_0x5716('0x10'),_0x413ce9,_0x636be['error'][_0x5716('0x17')]);return _0x42e575(_0x636be['error'][_0x5716('0x17')]);}logger[_0x5716('0x15')](_0x5716('0x10'),_0x413ce9,_0x636be[_0x5716('0x15')][_0x5716('0x17')]);return _0x4ee002(_0x636be['error'][_0x5716('0x17')]);}else{logger[_0x5716('0x18')]('SquareProject,\x20%s,\x20%s',_0x413ce9,_0x5716('0x11'));_0x4ee002(_0x636be[_0x5716('0x19')][_0x5716('0x17')]);}})[_0x5716('0x1a')](function(_0x470fc7){logger[_0x5716('0x15')]('SquareProject,\x20%s,\x20%s',_0x413ce9,_0x470fc7);_0x42e575(_0x470fc7);});});}exports[_0x5716('0x1b')]=function(_0x5380b0){var _0x49d153=this;return new Promise(function(_0x3988a7,_0x7df5c3){return db[_0x5716('0x1c')][_0x5716('0x1d')]({'raw':_0x5380b0[_0x5716('0x1e')]?_0x5380b0['options']['raw']===undefined?!![]:![]:!![],'where':_0x5380b0[_0x5716('0x1e')]?_0x5380b0[_0x5716('0x1e')][_0x5716('0x1f')]||null:null,'attributes':_0x5380b0[_0x5716('0x1e')]?_0x5380b0[_0x5716('0x1e')][_0x5716('0x20')]||null:null,'include':_0x5380b0[_0x5716('0x1e')]?_0x5380b0[_0x5716('0x1e')][_0x5716('0x21')]?_[_0x5716('0x22')](_0x5380b0[_0x5716('0x1e')]['include'],function(_0x4a7bca){return{'model':db[_0x4a7bca['model']],'as':_0x4a7bca['as'],'attributes':_0x4a7bca[_0x5716('0x20')],'include':_0x4a7bca['include']?_['map'](_0x4a7bca[_0x5716('0x21')],function(_0x1641ce){return{'model':db[_0x1641ce['model']],'as':_0x1641ce['as'],'attributes':_0x1641ce[_0x5716('0x20')],'include':_0x1641ce['include']?_['map'](_0x1641ce['include'],function(_0x2cc8b8){return{'model':db[_0x2cc8b8[_0x5716('0x23')]],'as':_0x2cc8b8['as'],'attributes':_0x2cc8b8['attributes']};}):[]};}):[]};}):[]:[]})[_0x5716('0xf')](function(_0x467f86){logger[_0x5716('0x18')](_0x5716('0x1b'),_0x5380b0);logger[_0x5716('0x12')](_0x5716('0x1b'),_0x5380b0,JSON[_0x5716('0x14')](_0x467f86));_0x3988a7(_0x467f86);})['catch'](function(_0x495cb3){logger[_0x5716('0x15')]('ShowSquareProject',_0x495cb3['message'],_0x5380b0);_0x7df5c3(_0x49d153['error'](0x1f4,_0x495cb3['message']));});});};
\ No newline at end of file
index bcc5a19..00f462e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3136=['emit','removeListener','register','length','squareProject:','save','remove','update'];(function(_0x189c9e,_0x1c3b55){var _0x3f38ca=function(_0x4c05ec){while(--_0x4c05ec){_0x189c9e['push'](_0x189c9e['shift']());}};_0x3f38ca(++_0x1c3b55);}(_0x3136,0xf5));var _0x6313=function(_0x50917b,_0x56cf1b){_0x50917b=_0x50917b-0x0;var _0x259324=_0x3136[_0x50917b];return _0x259324;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6313('0x0'),_0x6313('0x1'),_0x6313('0x2')];function createListener(_0x40ea9a,_0x6b853d){return function(_0x2758a9){_0x6b853d[_0x6313('0x3')](_0x40ea9a,_0x2758a9);};}function removeListener(_0x7567ef,_0xcd00a7){return function(){SquareProjectEvents[_0x6313('0x4')](_0x7567ef,_0xcd00a7);};}exports[_0x6313('0x5')]=function(_0x3795ca){for(var _0xea6750=0x0,_0x589fbe=events[_0x6313('0x6')];_0xea6750<_0x589fbe;_0xea6750++){var _0x547e35=events[_0xea6750];var _0x3a4166=createListener(_0x6313('0x7')+_0x547e35,_0x3795ca);SquareProjectEvents['on'](_0x547e35,_0x3a4166);}};
\ No newline at end of file
+var _0x6ac8=['length','squareProject:','./squareProject.events','save','remove','update','removeListener','register'];(function(_0x1ecaeb,_0x4ce41a){var _0xd2053=function(_0x51ff4e){while(--_0x51ff4e){_0x1ecaeb['push'](_0x1ecaeb['shift']());}};_0xd2053(++_0x4ce41a);}(_0x6ac8,0x15a));var _0x86ac=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x6ac8[_0x4e9628];return _0x27bc8c;};'use strict';var SquareProjectEvents=require(_0x86ac('0x0'));var events=[_0x86ac('0x1'),_0x86ac('0x2'),_0x86ac('0x3')];function createListener(_0xd14896,_0x212040){return function(_0x2b2b36){_0x212040['emit'](_0xd14896,_0x2b2b36);};}function removeListener(_0x7ab43a,_0x449df5){return function(){SquareProjectEvents[_0x86ac('0x4')](_0x7ab43a,_0x449df5);};}exports[_0x86ac('0x5')]=function(_0x4d9a41){for(var _0x3c214f=0x0,_0x9d353=events[_0x86ac('0x6')];_0x3c214f<_0x9d353;_0x3c214f++){var _0x8808dc=events[_0x3c214f];var _0x2fbcee=createListener(_0x86ac('0x7')+_0x8808dc,_0x4d9a41);SquareProjectEvents['on'](_0x8808dc,_0x2fbcee);}};
\ No newline at end of file
index 47d0d46..e5cd0ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x213143,_0x2e370c){var _0x13aa33=function(_0x12404f){while(--_0x12404f){_0x213143['push'](_0x213143['shift']());}};_0x13aa33(++_0x2e370c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0x5fc3[_0x58a4fe];return _0x697de2;};'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')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x48bed1,_0x5ba87d){var _0x17a796=function(_0x163d29){while(--_0x163d29){_0x48bed1['push'](_0x48bed1['shift']());}};_0x17a796(++_0x5ba87d);}(_0x5fab,0x177));var _0xb5fa=function(_0x1d606e,_0x438c6a){_0x1d606e=_0x1d606e-0x0;var _0x528543=_0x5fab[_0x1d606e];return _0x528543;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
index 1f9111e..34fbc18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31f0=['getDataValue','savePath','substring','sequelize','STRING','VIRTUAL'];(function(_0x5f3e11,_0x1e5b9d){var _0x3f6149=function(_0x34ecad){while(--_0x34ecad){_0x5f3e11['push'](_0x5f3e11['shift']());}};_0x3f6149(++_0x1e5b9d);}(_0x31f0,0xb7));var _0x031f=function(_0x1d9368,_0x546b95){_0x1d9368=_0x1d9368-0x0;var _0x3b2555=_0x31f0[_0x1d9368];return _0x3b2555;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x031f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'context':{'type':Sequelize[_0x031f('0x1')]},'extension':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x031f('0x1')]},'projectName':{'type':Sequelize[_0x031f('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x031f('0x2')],'get':function(){var _0x487e65='';var _0x365f59=this[_0x031f('0x3')](_0x031f('0x4'));if(_0x365f59){_0x487e65=_0x365f59[_0x031f('0x5')](_0x365f59['lastIndexOf']('.'));}return _0x487e65;}}};
\ No newline at end of file
+var _0x3e74=['getDataValue','savePath','substring','sequelize','STRING'];(function(_0x1528df,_0xca312b){var _0x366a50=function(_0x2c8b3e){while(--_0x2c8b3e){_0x1528df['push'](_0x1528df['shift']());}};_0x366a50(++_0xca312b);}(_0x3e74,0x175));var _0x43e7=function(_0xf2710f,_0x4b5d23){_0xf2710f=_0xf2710f-0x0;var _0x3112c3=_0x3e74[_0xf2710f];return _0x3112c3;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x43e7('0x1')]},'callerid':{'type':Sequelize[_0x43e7('0x1')]},'calleridname':{'type':Sequelize[_0x43e7('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x43e7('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x43e7('0x1')]},'projectName':{'type':Sequelize[_0x43e7('0x1')]},'saveName':{'type':Sequelize[_0x43e7('0x1')]},'filename':{'type':Sequelize[_0x43e7('0x1')]},'savePath':{'type':Sequelize[_0x43e7('0x1')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x45a0d1='';var _0x3491d6=this[_0x43e7('0x2')](_0x43e7('0x3'));if(_0x3491d6){_0x45a0d1=_0x3491d6[_0x43e7('0x4')](_0x3491d6['lastIndexOf']('.'));}return _0x45a0d1;}}};
\ No newline at end of file
index 277377c..8691198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x844b=['SquareRecording','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','download','../../components/encryptor','uniqueid','filename','savePath','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x844b,0x1a8));var _0xb844=function(_0x3c858f,_0x235201){_0x3c858f=_0x3c858f-0x0;var _0x198090=_0x844b[_0x3c858f];return _0x198090;};'use strict';var emlformat=require(_0xb844('0x0'));var rimraf=require(_0xb844('0x1'));var zipdir=require(_0xb844('0x2'));var jsonpatch=require(_0xb844('0x3'));var rp=require(_0xb844('0x4'));var moment=require('moment');var BPromise=require(_0xb844('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb844('0x6'));var csv=require(_0xb844('0x7'));var ejs=require(_0xb844('0x8'));var fs=require('fs');var fs_extra=require(_0xb844('0x9'));var _=require(_0xb844('0xa'));var squel=require(_0xb844('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb844('0xc'));var toCsv=require(_0xb844('0x7'));var querystring=require('querystring');var Papa=require(_0xb844('0xd'));var Redis=require('ioredis');var authService=require(_0xb844('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xb844('0xf'));var hardwareService=require(_0xb844('0x10'));var logger=require(_0xb844('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xb844('0x12'));var licenseUtil=require(_0xb844('0x13'));var db=require(_0xb844('0x14'))['db'];function respondWithStatusCode(_0x64a4b0,_0x35fead){_0x35fead=_0x35fead||0xcc;return function(_0x26afb5){if(_0x26afb5){return _0x64a4b0['sendStatus'](_0x35fead);}return _0x64a4b0[_0xb844('0x15')](_0x35fead)[_0xb844('0x16')]();};}function respondWithResult(_0x589254,_0x5d5663){_0x5d5663=_0x5d5663||0xc8;return function(_0x102f3b){if(_0x102f3b){return _0x589254[_0xb844('0x15')](_0x5d5663)[_0xb844('0x17')](_0x102f3b);}};}function respondWithFilteredResult(_0x8641bb,_0x39f16d){return function(_0x2cfde2){if(_0x2cfde2){var _0x153cef=typeof _0x39f16d[_0xb844('0x18')]===_0xb844('0x19')&&typeof _0x39f16d[_0xb844('0x1a')]===_0xb844('0x19');var _0x256a9a=_0x2cfde2['count'];var _0x200410=_0x153cef?0x0:_0x39f16d['offset'];var _0x10f6f6=_0x153cef?_0x2cfde2[_0xb844('0x1b')]:_0x39f16d['offset']+_0x39f16d[_0xb844('0x1a')];var _0x5b297e;if(_0x10f6f6>=_0x256a9a){_0x10f6f6=_0x256a9a;_0x5b297e=0xc8;}else{_0x5b297e=0xce;}_0x8641bb['status'](_0x5b297e);return _0x8641bb[_0xb844('0x1c')](_0xb844('0x1d'),_0x200410+'-'+_0x10f6f6+'/'+_0x256a9a)[_0xb844('0x17')](_0x2cfde2);}return null;};}function patchUpdates(_0x125080){return function(_0x444c1b){try{jsonpatch[_0xb844('0x1e')](_0x444c1b,_0x125080,!![]);}catch(_0xffbee4){return BPromise['reject'](_0xffbee4);}return _0x444c1b['save']();};}function saveUpdates(_0x83c74d,_0x61206a){return function(_0x27c742){if(_0x27c742){return _0x27c742[_0xb844('0x1f')](_0x83c74d)[_0xb844('0x20')](function(_0x4d0028){return _0x4d0028;});}return null;};}function removeEntity(_0x4a6dd0,_0xff900e){return function(_0x5e6b8d){if(_0x5e6b8d){return _0x5e6b8d[_0xb844('0x21')]()['then'](function(){_0x4a6dd0[_0xb844('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3407f2,_0x4ac0fb){return function(_0x2d2372){if(!_0x2d2372){_0x3407f2[_0xb844('0x22')](0x194);}return _0x2d2372;};}function handleError(_0x43eecb,_0x199c13){_0x199c13=_0x199c13||0x1f4;return function(_0x195ac8){logger[_0xb844('0x23')](_0x195ac8[_0xb844('0x24')]);if(_0x195ac8[_0xb844('0x25')]){delete _0x195ac8[_0xb844('0x25')];}_0x43eecb['status'](_0x199c13)[_0xb844('0x26')](_0x195ac8);};}exports[_0xb844('0x27')]=function(_0x2f2e13,_0x16827a){var _0xf7ad56={},_0x2ec7c1={},_0x565a98={'count':0x0,'rows':[]};var _0x16cbc8=_[_0xb844('0x28')](db[_0xb844('0x29')][_0xb844('0x2a')],function(_0xd494c8){return{'name':_0xd494c8[_0xb844('0x2b')],'type':_0xd494c8['type'][_0xb844('0x2c')]};});_0x2ec7c1['model']=_['map'](_0x16cbc8,_0xb844('0x25'));_0x2ec7c1[_0xb844('0x2d')]=_[_0xb844('0x2e')](_0x2f2e13[_0xb844('0x2d')]);_0x2ec7c1[_0xb844('0x2f')]=_[_0xb844('0x30')](_0x2ec7c1[_0xb844('0x31')],_0x2ec7c1[_0xb844('0x2d')]);_0xf7ad56[_0xb844('0x32')]=_[_0xb844('0x30')](_0x2ec7c1['model'],qs['fields'](_0x2f2e13[_0xb844('0x2d')][_0xb844('0x33')]));_0xf7ad56[_0xb844('0x32')]=_0xf7ad56[_0xb844('0x32')]['length']?_0xf7ad56[_0xb844('0x32')]:_0x2ec7c1[_0xb844('0x31')];if(!_0x2f2e13['query'][_0xb844('0x34')](_0xb844('0x35'))){_0xf7ad56[_0xb844('0x1a')]=qs[_0xb844('0x1a')](_0x2f2e13[_0xb844('0x2d')][_0xb844('0x1a')]);_0xf7ad56[_0xb844('0x18')]=qs['offset'](_0x2f2e13[_0xb844('0x2d')][_0xb844('0x18')]);}_0xf7ad56['order']=qs[_0xb844('0x36')](_0x2f2e13[_0xb844('0x2d')][_0xb844('0x36')]);_0xf7ad56[_0xb844('0x37')]=qs['filters'](_['pick'](_0x2f2e13[_0xb844('0x2d')],_0x2ec7c1[_0xb844('0x2f')]),_0x16cbc8);if(_0x2f2e13['query'][_0xb844('0x38')]){_0xf7ad56[_0xb844('0x37')]=_[_0xb844('0x39')](_0xf7ad56[_0xb844('0x37')],{'$or':_['map'](_0x16cbc8,function(_0x5470a9){if(_0x5470a9[_0xb844('0x3a')]!==_0xb844('0x3b')){var _0x4ba072={};_0x4ba072[_0x5470a9[_0xb844('0x25')]]={'$like':'%'+_0x2f2e13[_0xb844('0x2d')][_0xb844('0x38')]+'%'};return _0x4ba072;}})});}_0xf7ad56=_['merge']({},_0xf7ad56,_0x2f2e13[_0xb844('0x3c')]);var _0x46c2d9={'where':_0xf7ad56[_0xb844('0x37')]};return db[_0xb844('0x29')][_0xb844('0x1b')](_0x46c2d9)[_0xb844('0x20')](function(_0xbbf335){_0x565a98[_0xb844('0x1b')]=_0xbbf335;if(_0x2f2e13[_0xb844('0x2d')][_0xb844('0x3d')]){_0xf7ad56[_0xb844('0x3e')]=[{'all':!![]}];}return db[_0xb844('0x29')][_0xb844('0x3f')](_0xf7ad56);})[_0xb844('0x20')](function(_0x4693b2){_0x565a98[_0xb844('0x40')]=_0x4693b2;return _0x565a98;})[_0xb844('0x20')](respondWithFilteredResult(_0x16827a,_0xf7ad56))[_0xb844('0x41')](handleError(_0x16827a,null));};exports[_0xb844('0x42')]=function(_0x1b3e99,_0x52bd72){var _0x2f8956={'raw':!![],'where':{'id':_0x1b3e99['params']['id']}},_0x33e8dc={};_0x33e8dc[_0xb844('0x31')]=_['keys'](db[_0xb844('0x29')]['rawAttributes']);_0x33e8dc['query']=_[_0xb844('0x2e')](_0x1b3e99['query']);_0x33e8dc[_0xb844('0x2f')]=_[_0xb844('0x30')](_0x33e8dc[_0xb844('0x31')],_0x33e8dc['query']);_0x2f8956[_0xb844('0x32')]=_['intersection'](_0x33e8dc[_0xb844('0x31')],qs[_0xb844('0x33')](_0x1b3e99[_0xb844('0x2d')][_0xb844('0x33')]));_0x2f8956[_0xb844('0x32')]=_0x2f8956[_0xb844('0x32')][_0xb844('0x43')]?_0x2f8956[_0xb844('0x32')]:_0x33e8dc[_0xb844('0x31')];if(_0x1b3e99['query'][_0xb844('0x3d')]){_0x2f8956[_0xb844('0x3e')]=[{'all':!![]}];}_0x2f8956=_[_0xb844('0x39')]({},_0x2f8956,_0x1b3e99[_0xb844('0x3c')]);return db[_0xb844('0x29')][_0xb844('0x44')](_0x2f8956)[_0xb844('0x20')](handleEntityNotFound(_0x52bd72,null))[_0xb844('0x20')](respondWithResult(_0x52bd72,null))['catch'](handleError(_0x52bd72,null));};exports[_0xb844('0x45')]=function(_0x4cafaa,_0x17761d){return db[_0xb844('0x29')][_0xb844('0x45')](_0x4cafaa[_0xb844('0x46')],{})['then'](respondWithResult(_0x17761d,0xc9))['catch'](handleError(_0x17761d,null));};exports['update']=function(_0x4774c0,_0xc6b523){if(_0x4774c0[_0xb844('0x46')]['id']){delete _0x4774c0[_0xb844('0x46')]['id'];}return db[_0xb844('0x29')][_0xb844('0x44')]({'where':{'id':_0x4774c0[_0xb844('0x47')]['id']}})[_0xb844('0x20')](handleEntityNotFound(_0xc6b523,null))[_0xb844('0x20')](saveUpdates(_0x4774c0[_0xb844('0x46')],null))[_0xb844('0x20')](respondWithResult(_0xc6b523,null))[_0xb844('0x41')](handleError(_0xc6b523,null));};exports[_0xb844('0x48')]=function(_0x38afc1,_0x4bfd69,_0x30f9db){var _0x5efe2a=require(_0xb844('0x49'));var _0x25d941=![];var _0x575423={};if(_0x38afc1['query'][_0xb844('0x3a')]&&_0x38afc1[_0xb844('0x2d')][_0xb844('0x3a')]===_0xb844('0x4a')){_0x575423[_0xb844('0x4a')]=_0x38afc1[_0xb844('0x47')]['id'];}else{_0x575423['id']=_0x38afc1[_0xb844('0x47')]['id'];}return db[_0xb844('0x29')][_0xb844('0x44')]({'where':_0x575423,'attributes':['id','savePath',_0xb844('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x4bfd69,null))[_0xb844('0x20')](function(_0x4ad9f8){if(_0x4ad9f8){var _0x45f28c=_0x4ad9f8[_0xb844('0x4c')];var _0x4d5dd5=util['format']('%s.cypher',_0x45f28c);if(fs['existsSync'](_0x4d5dd5)){_0x25d941=!![];return _0x5efe2a[_0xb844('0x4d')](_0x4d5dd5,_0x45f28c,config[_0xb844('0x4e')][_0xb844('0x4f')])[_0xb844('0x20')](function(){return _0x4ad9f8;});}return _0x4ad9f8;}})[_0xb844('0x20')](function(_0x2549bd){if(_0x2549bd){var _0x21683b=_0x2549bd[_0xb844('0x4c')];if(!fs[_0xb844('0x50')](_0x21683b)){throw new db[(_0xb844('0x51'))][(_0xb844('0x52'))](_0xb844('0x53'));}if(_0x2549bd['filename']){return _0x4bfd69[_0xb844('0x48')](_0x21683b,_0x2549bd['filename']+path[_0xb844('0x54')](_0x21683b),function(){if(_0x25d941){fs['unlink'](_0x21683b);}});}else{return _0x4bfd69[_0xb844('0x48')](_0x21683b,function(_0x30d237){if(_0x25d941){fs[_0xb844('0x55')](_0x21683b);}});}}})[_0xb844('0x41')](function(_0x11b204){if(_0x11b204[_0xb844('0x56')]===_0xb844('0x53')){_0x4bfd69[_0xb844('0x15')](0x194)[_0xb844('0x26')]('Not\x20found');}else{return handleError(_0x4bfd69,null);}});};exports[_0xb844('0x21')]=function(_0x20afbf,_0x55aa1b){return db['SquareRecording'][_0xb844('0x44')]({'where':{'id':_0x20afbf[_0xb844('0x47')]['id']}})['then'](function(_0x2f0b91){if(_[_0xb844('0x57')](_0x2f0b91)){throw new ReferenceError(_0xb844('0x58'));}return _0x2f0b91;})[_0xb844('0x20')](function(_0x2b720e){var _0x52e331=_0x2b720e['savePath'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x52e331);if(!_[_0xb844('0x57')](_0x2b720e['savePath'])&&fs[_0xb844('0x50')](_0x52e331)){logger[_0xb844('0x59')](_0xb844('0x5a')+_0x52e331+_0xb844('0x5b'));fs['unlinkSync'](_0x52e331);}_0x52e331=_0x52e331+_0xb844('0x5c');if(!_['isNil'](_0x2b720e['savePath'])&&fs[_0xb844('0x50')](_0x52e331)){logger[_0xb844('0x59')]('File:\x20\x22'+_0x52e331+_0xb844('0x5b'));fs['unlinkSync'](_0x52e331);}return _0x2b720e;})[_0xb844('0x20')](function(_0xc78b7c){if(!_0xc78b7c)throw new InternalError();return _0xc78b7c[_0xb844('0x21')]();})['then'](function(){_0x55aa1b[_0xb844('0x15')](0xcc)[_0xb844('0x16')]();})[_0xb844('0x41')](handleError(_0x55aa1b,null));};
\ No newline at end of file
+var _0xa0f0=['json','offset','undefined','limit','count','set','Content-Range','save','update','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','catch','show','includeAll','find','create','body','params','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end'];(function(_0x378eb2,_0x42bfe3){var _0x1437cc=function(_0x27c09b){while(--_0x27c09b){_0x378eb2['push'](_0x378eb2['shift']());}};_0x1437cc(++_0x42bfe3);}(_0xa0f0,0x170));var _0x0a0f=function(_0x40c0ff,_0x32ef02){_0x40c0ff=_0x40c0ff-0x0;var _0x59f4d1=_0xa0f0[_0x40c0ff];return _0x59f4d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0a0f('0x0'));var zipdir=require(_0x0a0f('0x1'));var jsonpatch=require(_0x0a0f('0x2'));var rp=require(_0x0a0f('0x3'));var moment=require(_0x0a0f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0a0f('0x5'));var util=require(_0x0a0f('0x6'));var path=require('path');var sox=require(_0x0a0f('0x7'));var csv=require(_0x0a0f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a0f('0x9'));var _=require(_0x0a0f('0xa'));var squel=require(_0x0a0f('0xb'));var crypto=require(_0x0a0f('0xc'));var jsforce=require(_0x0a0f('0xd'));var deskjs=require(_0x0a0f('0xe'));var toCsv=require(_0x0a0f('0x8'));var querystring=require(_0x0a0f('0xf'));var Papa=require(_0x0a0f('0x10'));var Redis=require(_0x0a0f('0x11'));var authService=require(_0x0a0f('0x12'));var qs=require(_0x0a0f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a0f('0x14'));var logger=require(_0x0a0f('0x15'))(_0x0a0f('0x16'));var utils=require(_0x0a0f('0x17'));var config=require(_0x0a0f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40304a,_0x16a455){_0x16a455=_0x16a455||0xcc;return function(_0x294ec4){if(_0x294ec4){return _0x40304a[_0x0a0f('0x19')](_0x16a455);}return _0x40304a[_0x0a0f('0x1a')](_0x16a455)[_0x0a0f('0x1b')]();};}function respondWithResult(_0x446250,_0x3a7e0a){_0x3a7e0a=_0x3a7e0a||0xc8;return function(_0x10ebb6){if(_0x10ebb6){return _0x446250[_0x0a0f('0x1a')](_0x3a7e0a)[_0x0a0f('0x1c')](_0x10ebb6);}};}function respondWithFilteredResult(_0x52aea9,_0x44f7b8){return function(_0x42b78f){if(_0x42b78f){var _0x1ec01c=typeof _0x44f7b8[_0x0a0f('0x1d')]===_0x0a0f('0x1e')&&typeof _0x44f7b8[_0x0a0f('0x1f')]===_0x0a0f('0x1e');var _0x2ca307=_0x42b78f[_0x0a0f('0x20')];var _0x93b8f9=_0x1ec01c?0x0:_0x44f7b8[_0x0a0f('0x1d')];var _0x56a579=_0x1ec01c?_0x42b78f['count']:_0x44f7b8['offset']+_0x44f7b8[_0x0a0f('0x1f')];var _0x18b024;if(_0x56a579>=_0x2ca307){_0x56a579=_0x2ca307;_0x18b024=0xc8;}else{_0x18b024=0xce;}_0x52aea9[_0x0a0f('0x1a')](_0x18b024);return _0x52aea9[_0x0a0f('0x21')](_0x0a0f('0x22'),_0x93b8f9+'-'+_0x56a579+'/'+_0x2ca307)[_0x0a0f('0x1c')](_0x42b78f);}return null;};}function patchUpdates(_0x2dec58){return function(_0x42cf42){try{jsonpatch['apply'](_0x42cf42,_0x2dec58,!![]);}catch(_0xb1565c){return BPromise['reject'](_0xb1565c);}return _0x42cf42[_0x0a0f('0x23')]();};}function saveUpdates(_0x1b520b,_0x4f94b3){return function(_0x1e25dc){if(_0x1e25dc){return _0x1e25dc[_0x0a0f('0x24')](_0x1b520b)['then'](function(_0x43c339){return _0x43c339;});}return null;};}function removeEntity(_0x558e56,_0x3766a1){return function(_0x31b590){if(_0x31b590){return _0x31b590['destroy']()['then'](function(){_0x558e56['status'](0xcc)[_0x0a0f('0x1b')]();});}};}function handleEntityNotFound(_0x17d1f8,_0x23925a){return function(_0x1d8793){if(!_0x1d8793){_0x17d1f8[_0x0a0f('0x19')](0x194);}return _0x1d8793;};}function handleError(_0x31f981,_0x9ad12e){_0x9ad12e=_0x9ad12e||0x1f4;return function(_0x540842){logger[_0x0a0f('0x25')](_0x540842[_0x0a0f('0x26')]);if(_0x540842[_0x0a0f('0x27')]){delete _0x540842[_0x0a0f('0x27')];}_0x31f981['status'](_0x9ad12e)[_0x0a0f('0x28')](_0x540842);};}exports[_0x0a0f('0x29')]=function(_0x1b9f84,_0x373716){var _0x518704={},_0x218038={},_0x127d7d={'count':0x0,'rows':[]};var _0x122f25=_[_0x0a0f('0x2a')](db[_0x0a0f('0x2b')][_0x0a0f('0x2c')],function(_0xab479e){return{'name':_0xab479e[_0x0a0f('0x2d')],'type':_0xab479e[_0x0a0f('0x2e')][_0x0a0f('0x2f')]};});_0x218038['model']=_[_0x0a0f('0x2a')](_0x122f25,_0x0a0f('0x27'));_0x218038[_0x0a0f('0x30')]=_[_0x0a0f('0x31')](_0x1b9f84[_0x0a0f('0x30')]);_0x218038[_0x0a0f('0x32')]=_[_0x0a0f('0x33')](_0x218038['model'],_0x218038[_0x0a0f('0x30')]);_0x518704['attributes']=_['intersection'](_0x218038[_0x0a0f('0x34')],qs[_0x0a0f('0x35')](_0x1b9f84[_0x0a0f('0x30')][_0x0a0f('0x35')]));_0x518704[_0x0a0f('0x36')]=_0x518704[_0x0a0f('0x36')][_0x0a0f('0x37')]?_0x518704['attributes']:_0x218038[_0x0a0f('0x34')];if(!_0x1b9f84[_0x0a0f('0x30')]['hasOwnProperty'](_0x0a0f('0x38'))){_0x518704[_0x0a0f('0x1f')]=qs[_0x0a0f('0x1f')](_0x1b9f84[_0x0a0f('0x30')][_0x0a0f('0x1f')]);_0x518704['offset']=qs['offset'](_0x1b9f84[_0x0a0f('0x30')][_0x0a0f('0x1d')]);}_0x518704[_0x0a0f('0x39')]=qs[_0x0a0f('0x3a')](_0x1b9f84[_0x0a0f('0x30')][_0x0a0f('0x3a')]);_0x518704[_0x0a0f('0x3b')]=qs[_0x0a0f('0x32')](_[_0x0a0f('0x3c')](_0x1b9f84[_0x0a0f('0x30')],_0x218038[_0x0a0f('0x32')]),_0x122f25);if(_0x1b9f84[_0x0a0f('0x30')][_0x0a0f('0x3d')]){_0x518704['where']=_[_0x0a0f('0x3e')](_0x518704['where'],{'$or':_[_0x0a0f('0x2a')](_0x122f25,function(_0x4ef581){if(_0x4ef581[_0x0a0f('0x2e')]!==_0x0a0f('0x3f')){var _0x241d90={};_0x241d90[_0x4ef581['name']]={'$like':'%'+_0x1b9f84[_0x0a0f('0x30')][_0x0a0f('0x3d')]+'%'};return _0x241d90;}})});}_0x518704=_[_0x0a0f('0x3e')]({},_0x518704,_0x1b9f84[_0x0a0f('0x40')]);var _0x2d0ff1={'where':_0x518704[_0x0a0f('0x3b')]};return db['SquareRecording']['count'](_0x2d0ff1)[_0x0a0f('0x41')](function(_0x484125){_0x127d7d[_0x0a0f('0x20')]=_0x484125;if(_0x1b9f84['query']['includeAll']){_0x518704[_0x0a0f('0x42')]=[{'all':!![]}];}return db[_0x0a0f('0x2b')][_0x0a0f('0x43')](_0x518704);})[_0x0a0f('0x41')](function(_0x14820b){_0x127d7d['rows']=_0x14820b;return _0x127d7d;})[_0x0a0f('0x41')](respondWithFilteredResult(_0x373716,_0x518704))[_0x0a0f('0x44')](handleError(_0x373716,null));};exports[_0x0a0f('0x45')]=function(_0x26a245,_0x299b5b){var _0x5d0478={'raw':!![],'where':{'id':_0x26a245['params']['id']}},_0x5f42de={};_0x5f42de[_0x0a0f('0x34')]=_['keys'](db[_0x0a0f('0x2b')][_0x0a0f('0x2c')]);_0x5f42de[_0x0a0f('0x30')]=_[_0x0a0f('0x31')](_0x26a245[_0x0a0f('0x30')]);_0x5f42de[_0x0a0f('0x32')]=_['intersection'](_0x5f42de['model'],_0x5f42de[_0x0a0f('0x30')]);_0x5d0478['attributes']=_[_0x0a0f('0x33')](_0x5f42de[_0x0a0f('0x34')],qs['fields'](_0x26a245[_0x0a0f('0x30')][_0x0a0f('0x35')]));_0x5d0478[_0x0a0f('0x36')]=_0x5d0478['attributes'][_0x0a0f('0x37')]?_0x5d0478[_0x0a0f('0x36')]:_0x5f42de[_0x0a0f('0x34')];if(_0x26a245[_0x0a0f('0x30')][_0x0a0f('0x46')]){_0x5d0478[_0x0a0f('0x42')]=[{'all':!![]}];}_0x5d0478=_[_0x0a0f('0x3e')]({},_0x5d0478,_0x26a245[_0x0a0f('0x40')]);return db[_0x0a0f('0x2b')][_0x0a0f('0x47')](_0x5d0478)[_0x0a0f('0x41')](handleEntityNotFound(_0x299b5b,null))[_0x0a0f('0x41')](respondWithResult(_0x299b5b,null))[_0x0a0f('0x44')](handleError(_0x299b5b,null));};exports[_0x0a0f('0x48')]=function(_0x5db8ef,_0x3e96b8){return db['SquareRecording'][_0x0a0f('0x48')](_0x5db8ef[_0x0a0f('0x49')],{})['then'](respondWithResult(_0x3e96b8,0xc9))[_0x0a0f('0x44')](handleError(_0x3e96b8,null));};exports['update']=function(_0x237e25,_0xc8e200){if(_0x237e25['body']['id']){delete _0x237e25[_0x0a0f('0x49')]['id'];}return db[_0x0a0f('0x2b')][_0x0a0f('0x47')]({'where':{'id':_0x237e25[_0x0a0f('0x4a')]['id']}})[_0x0a0f('0x41')](handleEntityNotFound(_0xc8e200,null))[_0x0a0f('0x41')](saveUpdates(_0x237e25['body'],null))[_0x0a0f('0x41')](respondWithResult(_0xc8e200,null))['catch'](handleError(_0xc8e200,null));};exports[_0x0a0f('0x4b')]=function(_0x1ebbce,_0x346d21,_0x15d9ee){var _0x51212e=require('../../components/encryptor');var _0x5102f8=![];var _0x16485a={};if(_0x1ebbce[_0x0a0f('0x30')][_0x0a0f('0x2e')]&&_0x1ebbce[_0x0a0f('0x30')][_0x0a0f('0x2e')]===_0x0a0f('0x4c')){_0x16485a[_0x0a0f('0x4c')]=_0x1ebbce['params']['id'];}else{_0x16485a['id']=_0x1ebbce[_0x0a0f('0x4a')]['id'];}return db[_0x0a0f('0x2b')][_0x0a0f('0x47')]({'where':_0x16485a,'attributes':['id',_0x0a0f('0x4d'),_0x0a0f('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x346d21,null))[_0x0a0f('0x41')](function(_0x3d19eb){if(_0x3d19eb){var _0x379a3a=_0x3d19eb[_0x0a0f('0x4d')];var _0x27729a=util[_0x0a0f('0x4f')](_0x0a0f('0x50'),_0x379a3a);if(fs[_0x0a0f('0x51')](_0x27729a)){_0x5102f8=!![];return _0x51212e[_0x0a0f('0x52')](_0x27729a,_0x379a3a,config[_0x0a0f('0x53')][_0x0a0f('0x54')])[_0x0a0f('0x41')](function(){return _0x3d19eb;});}return _0x3d19eb;}})[_0x0a0f('0x41')](function(_0x557f72){if(_0x557f72){var _0x7fda88=_0x557f72['savePath'];if(!fs[_0x0a0f('0x51')](_0x7fda88)){throw new db[(_0x0a0f('0x55'))]['ValidationError'](_0x0a0f('0x56'));}if(_0x557f72[_0x0a0f('0x4e')]){return _0x346d21[_0x0a0f('0x4b')](_0x7fda88,_0x557f72[_0x0a0f('0x4e')]+path['extname'](_0x7fda88),function(){if(_0x5102f8){fs[_0x0a0f('0x57')](_0x7fda88);}});}else{return _0x346d21[_0x0a0f('0x4b')](_0x7fda88,function(_0x5a254e){if(_0x5102f8){fs[_0x0a0f('0x57')](_0x7fda88);}});}}})[_0x0a0f('0x44')](function(_0x22087f){if(_0x22087f[_0x0a0f('0x58')]==='SquareRecording\x20not\x20found'){_0x346d21[_0x0a0f('0x1a')](0x194)['send'](_0x0a0f('0x59'));}else{return handleError(_0x346d21,null);}});};exports[_0x0a0f('0x5a')]=function(_0x4b271a,_0x2d19e4){return db[_0x0a0f('0x2b')][_0x0a0f('0x47')]({'where':{'id':_0x4b271a[_0x0a0f('0x4a')]['id']}})[_0x0a0f('0x41')](function(_0x374eb2){if(_['isNil'](_0x374eb2)){throw new ReferenceError(_0x0a0f('0x5b'));}return _0x374eb2;})[_0x0a0f('0x41')](function(_0x1100db){var _0x19111f=_0x1100db['savePath'];logger['info'](_0x0a0f('0x5c'),_0x19111f);if(!_[_0x0a0f('0x5d')](_0x1100db[_0x0a0f('0x4d')])&&fs[_0x0a0f('0x51')](_0x19111f)){logger[_0x0a0f('0x5e')](_0x0a0f('0x5f')+_0x19111f+_0x0a0f('0x60'));fs[_0x0a0f('0x61')](_0x19111f);}_0x19111f=_0x19111f+_0x0a0f('0x62');if(!_[_0x0a0f('0x5d')](_0x1100db[_0x0a0f('0x4d')])&&fs[_0x0a0f('0x51')](_0x19111f)){logger['info'](_0x0a0f('0x5f')+_0x19111f+_0x0a0f('0x60'));fs[_0x0a0f('0x61')](_0x19111f);}return _0x1100db;})[_0x0a0f('0x41')](function(_0x14fbcf){if(!_0x14fbcf)throw new InternalError();return _0x14fbcf[_0x0a0f('0x5a')]();})[_0x0a0f('0x41')](function(){_0x2d19e4[_0x0a0f('0x1a')](0xcc)[_0x0a0f('0x1b')]();})[_0x0a0f('0x44')](handleError(_0x2d19e4,null));};
\ No newline at end of file
index cd67b85..d2bf13a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc36=['square_recordings','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','SquareRecording'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc36,0x169));var _0x6bc3=function(_0x5e7cd5,_0x2afb60){_0x5e7cd5=_0x5e7cd5-0x0;var _0x364117=_0xbc36[_0x5e7cd5];return _0x364117;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var logger=require(_0x6bc3('0x1'))(_0x6bc3('0x2'));var moment=require(_0x6bc3('0x3'));var BPromise=require(_0x6bc3('0x4'));var rp=require(_0x6bc3('0x5'));var fs=require('fs');var path=require(_0x6bc3('0x6'));var rimraf=require(_0x6bc3('0x7'));var config=require(_0x6bc3('0x8'));var attributes=require(_0x6bc3('0x9'));module['exports']=function(_0x1c47e8,_0x4715c8){return _0x1c47e8['define'](_0x6bc3('0xa'),attributes,{'tableName':_0x6bc3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fdc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x140962,_0x32c9c0){var _0x279527=function(_0xcbcfd){while(--_0xcbcfd){_0x140962['push'](_0x140962['shift']());}};_0x279527(++_0x32c9c0);}(_0x5fdc,0x127));var _0xc5fd=function(_0x24e7f3,_0x4e1a29){_0x24e7f3=_0x24e7f3-0x0;var _0x25090e=_0x5fdc[_0x24e7f3];return _0x25090e;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var logger=require(_0xc5fd('0x2'))(_0xc5fd('0x3'));var moment=require(_0xc5fd('0x4'));var BPromise=require(_0xc5fd('0x5'));var rp=require(_0xc5fd('0x6'));var fs=require('fs');var path=require(_0xc5fd('0x7'));var rimraf=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var attributes=require(_0xc5fd('0xa'));module[_0xc5fd('0xb')]=function(_0x44722b,_0x216902){return _0x44722b[_0xc5fd('0xc')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 116b925..ea2d4b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a61=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','bluebird','ioredis'];(function(_0x270bda,_0x15d488){var _0x1e9d9f=function(_0x2b0aa5){while(--_0x2b0aa5){_0x270bda['push'](_0x270bda['shift']());}};_0x1e9d9f(++_0x15d488);}(_0x3a61,0x192));var _0x13a6=function(_0x531424,_0x215494){_0x531424=_0x531424-0x0;var _0x83c322=_0x3a61[_0x531424];return _0x83c322;};'use strict';var _=require(_0x13a6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x13a6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13a6('0x2'));var db=require(_0x13a6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x13a6('0x4'))(_0x13a6('0x5'));var config=require('../../config/environment');var jayson=require(_0x13a6('0x6'));var client=jayson[_0x13a6('0x7')][_0x13a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6d0c1,_0x2ec5a7,_0x241608){return new BPromise(function(_0x2d09d3,_0x3222c8){return client['request'](_0x6d0c1,_0x241608)[_0x13a6('0x9')](function(_0x2989e2){logger[_0x13a6('0xa')](_0x13a6('0xb'),_0x2ec5a7,_0x13a6('0xc'));logger[_0x13a6('0xd')](_0x13a6('0xe'),_0x2ec5a7,_0x13a6('0xc'),JSON[_0x13a6('0xf')](_0x2989e2));if(_0x2989e2[_0x13a6('0x10')]){if(_0x2989e2[_0x13a6('0x10')][_0x13a6('0x11')]===0x1f4){logger[_0x13a6('0x10')](_0x13a6('0xb'),_0x2ec5a7,_0x2989e2['error'][_0x13a6('0x12')]);return _0x3222c8(_0x2989e2['error'][_0x13a6('0x12')]);}logger[_0x13a6('0x10')]('SquareRecording,\x20%s,\x20%s',_0x2ec5a7,_0x2989e2[_0x13a6('0x10')][_0x13a6('0x12')]);return _0x2d09d3(_0x2989e2[_0x13a6('0x10')]['message']);}else{logger[_0x13a6('0xa')]('SquareRecording,\x20%s,\x20%s',_0x2ec5a7,_0x13a6('0xc'));_0x2d09d3(_0x2989e2[_0x13a6('0x13')][_0x13a6('0x12')]);}})[_0x13a6('0x14')](function(_0x50ff9e){logger[_0x13a6('0x10')](_0x13a6('0xb'),_0x2ec5a7,_0x50ff9e);_0x3222c8(_0x50ff9e);});});}exports['CreateSquareRecording']=function(_0x42f3fd){var _0x56ecc8=this;return new Promise(function(_0x5be9f9,_0x4034f1){return db[_0x13a6('0x15')][_0x13a6('0x16')](_0x42f3fd[_0x13a6('0x17')],{'raw':_0x42f3fd['options']?_0x42f3fd[_0x13a6('0x18')][_0x13a6('0x19')]===undefined?!![]:![]:!![]})[_0x13a6('0x9')](function(_0x414a64){logger[_0x13a6('0xa')](_0x13a6('0x1a'),_0x42f3fd);logger[_0x13a6('0xd')](_0x13a6('0x1a'),_0x42f3fd,JSON['stringify'](_0x414a64));_0x5be9f9(_0x414a64);})[_0x13a6('0x14')](function(_0x1599ba){logger[_0x13a6('0x10')](_0x13a6('0x1a'),_0x1599ba[_0x13a6('0x12')],_0x42f3fd);_0x4034f1(_0x56ecc8[_0x13a6('0x10')](0x1f4,_0x1599ba[_0x13a6('0x12')]));});});};
\ No newline at end of file
+var _0x8c36=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','SquareRecording','create','options','raw','then','CreateSquareRecording','debug','stringify','lodash','util','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c36,0x10b));var _0x68c3=function(_0x4eeeb9,_0x5740a2){_0x4eeeb9=_0x4eeeb9-0x0;var _0x10c149=_0x8c36[_0x4eeeb9];return _0x10c149;};'use strict';var _=require(_0x68c3('0x0'));var util=require(_0x68c3('0x1'));var moment=require(_0x68c3('0x2'));var BPromise=require(_0x68c3('0x3'));var rs=require(_0x68c3('0x4'));var fs=require('fs');var Redis=require(_0x68c3('0x5'));var db=require(_0x68c3('0x6'))['db'];var utils=require(_0x68c3('0x7'));var logger=require('../../config/logger')(_0x68c3('0x8'));var config=require(_0x68c3('0x9'));var jayson=require(_0x68c3('0xa'));var client=jayson[_0x68c3('0xb')][_0x68c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x536985,_0x9bfe8b,_0x3c4e2d){return new BPromise(function(_0x469f27,_0x361787){return client[_0x68c3('0xd')](_0x536985,_0x3c4e2d)['then'](function(_0x3ef69f){logger[_0x68c3('0xe')](_0x68c3('0xf'),_0x9bfe8b,_0x68c3('0x10'));logger['debug'](_0x68c3('0x11'),_0x9bfe8b,_0x68c3('0x10'),JSON['stringify'](_0x3ef69f));if(_0x3ef69f[_0x68c3('0x12')]){if(_0x3ef69f[_0x68c3('0x12')]['code']===0x1f4){logger[_0x68c3('0x12')](_0x68c3('0xf'),_0x9bfe8b,_0x3ef69f['error'][_0x68c3('0x13')]);return _0x361787(_0x3ef69f[_0x68c3('0x12')]['message']);}logger[_0x68c3('0x12')](_0x68c3('0xf'),_0x9bfe8b,_0x3ef69f[_0x68c3('0x12')]['message']);return _0x469f27(_0x3ef69f[_0x68c3('0x12')]['message']);}else{logger[_0x68c3('0xe')]('SquareRecording,\x20%s,\x20%s',_0x9bfe8b,_0x68c3('0x10'));_0x469f27(_0x3ef69f[_0x68c3('0x14')]['message']);}})[_0x68c3('0x15')](function(_0x3f61e0){logger[_0x68c3('0x12')](_0x68c3('0xf'),_0x9bfe8b,_0x3f61e0);_0x361787(_0x3f61e0);});});}exports['CreateSquareRecording']=function(_0x42bacd){var _0x154202=this;return new Promise(function(_0x471870,_0x3acf26){return db[_0x68c3('0x16')][_0x68c3('0x17')](_0x42bacd['body'],{'raw':_0x42bacd[_0x68c3('0x18')]?_0x42bacd['options'][_0x68c3('0x19')]===undefined?!![]:![]:!![]})[_0x68c3('0x1a')](function(_0x3c0597){logger['info'](_0x68c3('0x1b'),_0x42bacd);logger[_0x68c3('0x1c')](_0x68c3('0x1b'),_0x42bacd,JSON[_0x68c3('0x1d')](_0x3c0597));_0x471870(_0x3c0597);})['catch'](function(_0x3a8d28){logger[_0x68c3('0x12')]('CreateSquareRecording',_0x3a8d28[_0x68c3('0x13')],_0x42bacd);_0x3acf26(_0x154202[_0x68c3('0x12')](0x1f4,_0x3a8d28[_0x68c3('0x13')]));});});};
\ No newline at end of file
index f4255fd..077d120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x427c98,_0x521679){var _0x2eebd8=function(_0x5997cc){while(--_0x5997cc){_0x427c98['push'](_0x427c98['shift']());}};_0x2eebd8(++_0x521679);}(_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
+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(_0x32e308,_0xec7dcb){var _0x319a4f=function(_0x1018cd){while(--_0x1018cd){_0x32e308['push'](_0x32e308['shift']());}};_0x319a4f(++_0xec7dcb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index 8cdccf0..b809826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6ba=['BOOLEAN','exports','STRING'];(function(_0x549caa,_0x50012b){var _0x5e4ac9=function(_0x539c08){while(--_0x539c08){_0x549caa['push'](_0x549caa['shift']());}};_0x5e4ac9(++_0x50012b);}(_0xe6ba,0x1d5));var _0xae6b=function(_0x1592e3,_0x45e4f9){_0x1592e3=_0x1592e3-0x0;var _0x19e1e0=_0xe6ba[_0x1592e3];return _0x19e1e0;};'use strict';var Sequelize=require('sequelize');module[_0xae6b('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xae6b('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xae6b('0x1')]},'language':{'type':Sequelize[_0xae6b('0x1')]},'type':{'type':Sequelize[_0xae6b('0x1')]},'uniqueid':{'type':Sequelize[_0xae6b('0x1')]},'version':{'type':Sequelize[_0xae6b('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xae6b('0x1')]},'callingpres':{'type':Sequelize[_0xae6b('0x1')]},'callingani2':{'type':Sequelize[_0xae6b('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xae6b('0x1')]},'dnid':{'type':Sequelize[_0xae6b('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xae6b('0x1')]},'extension':{'type':Sequelize[_0xae6b('0x1')]},'priority':{'type':Sequelize[_0xae6b('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xae6b('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0xae6b('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xef48=['STRING','sequelize','exports'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0xef48,0x103));var _0x8ef4=function(_0x21198c,_0x37f88c){_0x21198c=_0x21198c-0x0;var _0x31e791=_0xef48[_0x21198c];return _0x31e791;};'use strict';var Sequelize=require(_0x8ef4('0x0'));module[_0x8ef4('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x8ef4('0x2')]},'request':{'type':Sequelize[_0x8ef4('0x2')]},'channel':{'type':Sequelize[_0x8ef4('0x2')]},'language':{'type':Sequelize[_0x8ef4('0x2')]},'type':{'type':Sequelize[_0x8ef4('0x2')]},'uniqueid':{'type':Sequelize[_0x8ef4('0x2')]},'version':{'type':Sequelize[_0x8ef4('0x2')]},'callerid':{'type':Sequelize[_0x8ef4('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x8ef4('0x2')]},'callingtns':{'type':Sequelize[_0x8ef4('0x2')]},'dnid':{'type':Sequelize[_0x8ef4('0x2')]},'rdnis':{'type':Sequelize[_0x8ef4('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8ef4('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8ef4('0x2')]},'threadid':{'type':Sequelize[_0x8ef4('0x2')]},'project_name':{'type':Sequelize[_0x8ef4('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index b309d18..ba646e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa844=['SquareReport','include','rows','show','params','rawAttributes','length','options','catch','create','update','body','find','describe','eml-format','fast-json-patch','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','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa844,0x9e));var _0x4a84=function(_0x4ebe52,_0x3b8e6a){_0x4ebe52=_0x4ebe52-0x0;var _0x3fb2bb=_0xa844[_0x4ebe52];return _0x3fb2bb;};'use strict';var emlformat=require(_0x4a84('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4a84('0x1'));var rp=require('request-promise');var moment=require(_0x4a84('0x2'));var BPromise=require(_0x4a84('0x3'));var Mustache=require(_0x4a84('0x4'));var util=require(_0x4a84('0x5'));var path=require(_0x4a84('0x6'));var sox=require(_0x4a84('0x7'));var csv=require(_0x4a84('0x8'));var ejs=require(_0x4a84('0x9'));var fs=require('fs');var fs_extra=require(_0x4a84('0xa'));var _=require(_0x4a84('0xb'));var squel=require(_0x4a84('0xc'));var crypto=require(_0x4a84('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4a84('0x8'));var querystring=require(_0x4a84('0xe'));var Papa=require(_0x4a84('0xf'));var Redis=require('ioredis');var authService=require(_0x4a84('0x10'));var qs=require(_0x4a84('0x11'));var as=require(_0x4a84('0x12'));var hardwareService=require(_0x4a84('0x13'));var logger=require(_0x4a84('0x14'))('api');var utils=require(_0x4a84('0x15'));var config=require(_0x4a84('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd1517,_0x21105b){_0x21105b=_0x21105b||0xcc;return function(_0x3774c8){if(_0x3774c8){return _0xcd1517[_0x4a84('0x17')](_0x21105b);}return _0xcd1517[_0x4a84('0x18')](_0x21105b)[_0x4a84('0x19')]();};}function respondWithResult(_0x4baba1,_0x3a0fa5){_0x3a0fa5=_0x3a0fa5||0xc8;return function(_0xae846b){if(_0xae846b){return _0x4baba1['status'](_0x3a0fa5)[_0x4a84('0x1a')](_0xae846b);}};}function respondWithFilteredResult(_0x2fc5ff,_0x4ede80){return function(_0xb054a1){if(_0xb054a1){var _0x39b55b=typeof _0x4ede80[_0x4a84('0x1b')]===_0x4a84('0x1c')&&typeof _0x4ede80['limit']===_0x4a84('0x1c');var _0x28c1f0=_0xb054a1[_0x4a84('0x1d')];var _0x48d95d=_0x39b55b?0x0:_0x4ede80[_0x4a84('0x1b')];var _0x35ba84=_0x39b55b?_0xb054a1[_0x4a84('0x1d')]:_0x4ede80[_0x4a84('0x1b')]+_0x4ede80['limit'];var _0x223e1f;if(_0x35ba84>=_0x28c1f0){_0x35ba84=_0x28c1f0;_0x223e1f=0xc8;}else{_0x223e1f=0xce;}_0x2fc5ff[_0x4a84('0x18')](_0x223e1f);return _0x2fc5ff[_0x4a84('0x1e')](_0x4a84('0x1f'),_0x48d95d+'-'+_0x35ba84+'/'+_0x28c1f0)[_0x4a84('0x1a')](_0xb054a1);}return null;};}function patchUpdates(_0x309ef3){return function(_0x26c058){try{jsonpatch[_0x4a84('0x20')](_0x26c058,_0x309ef3,!![]);}catch(_0x38f3c2){return BPromise[_0x4a84('0x21')](_0x38f3c2);}return _0x26c058[_0x4a84('0x22')]();};}function saveUpdates(_0x1d6f01,_0x56fa1f){return function(_0xe4117f){if(_0xe4117f){return _0xe4117f['update'](_0x1d6f01)['then'](function(_0x4c60b4){return _0x4c60b4;});}return null;};}function removeEntity(_0x4da976,_0x4ae103){return function(_0x51e9b5){if(_0x51e9b5){return _0x51e9b5[_0x4a84('0x23')]()[_0x4a84('0x24')](function(){_0x4da976[_0x4a84('0x18')](0xcc)[_0x4a84('0x19')]();});}};}function handleEntityNotFound(_0x33c627,_0x56a19b){return function(_0x1779c0){if(!_0x1779c0){_0x33c627[_0x4a84('0x17')](0x194);}return _0x1779c0;};}function handleError(_0x9404ca,_0x52443e){_0x52443e=_0x52443e||0x1f4;return function(_0x243208){logger[_0x4a84('0x25')](_0x243208['stack']);if(_0x243208[_0x4a84('0x26')]){delete _0x243208[_0x4a84('0x26')];}_0x9404ca[_0x4a84('0x18')](_0x52443e)[_0x4a84('0x27')](_0x243208);};}exports[_0x4a84('0x28')]=function(_0x176d94,_0x54e8ef){var _0x324dc7={},_0x5e122b={},_0x48f673={'count':0x0,'rows':[]};var _0x581c24=_[_0x4a84('0x29')](db['SquareReport']['rawAttributes'],function(_0x1892e1){return{'name':_0x1892e1['fieldName'],'type':_0x1892e1[_0x4a84('0x2a')]['key']};});_0x5e122b[_0x4a84('0x2b')]=_[_0x4a84('0x29')](_0x581c24,_0x4a84('0x26'));_0x5e122b['query']=_[_0x4a84('0x2c')](_0x176d94[_0x4a84('0x2d')]);_0x5e122b[_0x4a84('0x2e')]=_[_0x4a84('0x2f')](_0x5e122b[_0x4a84('0x2b')],_0x5e122b[_0x4a84('0x2d')]);_0x324dc7[_0x4a84('0x30')]=_[_0x4a84('0x2f')](_0x5e122b[_0x4a84('0x2b')],qs[_0x4a84('0x31')](_0x176d94[_0x4a84('0x2d')][_0x4a84('0x31')]));_0x324dc7[_0x4a84('0x30')]=_0x324dc7['attributes']['length']?_0x324dc7[_0x4a84('0x30')]:_0x5e122b['model'];if(!_0x176d94['query'][_0x4a84('0x32')](_0x4a84('0x33'))){_0x324dc7['limit']=qs[_0x4a84('0x34')](_0x176d94[_0x4a84('0x2d')]['limit']);_0x324dc7[_0x4a84('0x1b')]=qs[_0x4a84('0x1b')](_0x176d94['query']['offset']);}_0x324dc7[_0x4a84('0x35')]=qs[_0x4a84('0x36')](_0x176d94[_0x4a84('0x2d')][_0x4a84('0x36')]);_0x324dc7[_0x4a84('0x37')]=qs[_0x4a84('0x2e')](_[_0x4a84('0x38')](_0x176d94[_0x4a84('0x2d')],_0x5e122b['filters']),_0x581c24);if(_0x176d94[_0x4a84('0x2d')]['filter']){_0x324dc7['where']=_[_0x4a84('0x39')](_0x324dc7[_0x4a84('0x37')],{'$or':_[_0x4a84('0x29')](_0x581c24,function(_0x423657){if(_0x423657[_0x4a84('0x2a')]!=='VIRTUAL'){var _0x29d0bb={};_0x29d0bb[_0x423657['name']]={'$like':'%'+_0x176d94['query']['filter']+'%'};return _0x29d0bb;}})});}_0x324dc7=_['merge']({},_0x324dc7,_0x176d94['options']);var _0x30ddc1={'where':_0x324dc7[_0x4a84('0x37')]};return db[_0x4a84('0x3a')][_0x4a84('0x1d')](_0x30ddc1)[_0x4a84('0x24')](function(_0x1a33a7){_0x48f673[_0x4a84('0x1d')]=_0x1a33a7;if(_0x176d94[_0x4a84('0x2d')]['includeAll']){_0x324dc7[_0x4a84('0x3b')]=[{'all':!![]}];}return db[_0x4a84('0x3a')]['findAll'](_0x324dc7);})['then'](function(_0x250caa){_0x48f673[_0x4a84('0x3c')]=_0x250caa;return _0x48f673;})[_0x4a84('0x24')](respondWithFilteredResult(_0x54e8ef,_0x324dc7))['catch'](handleError(_0x54e8ef,null));};exports[_0x4a84('0x3d')]=function(_0x19597d,_0x2b3e46){var _0xd99a5={'raw':!![],'where':{'id':_0x19597d[_0x4a84('0x3e')]['id']}},_0x33d279={};_0x33d279[_0x4a84('0x2b')]=_[_0x4a84('0x2c')](db[_0x4a84('0x3a')][_0x4a84('0x3f')]);_0x33d279['query']=_[_0x4a84('0x2c')](_0x19597d[_0x4a84('0x2d')]);_0x33d279[_0x4a84('0x2e')]=_[_0x4a84('0x2f')](_0x33d279['model'],_0x33d279[_0x4a84('0x2d')]);_0xd99a5[_0x4a84('0x30')]=_[_0x4a84('0x2f')](_0x33d279[_0x4a84('0x2b')],qs[_0x4a84('0x31')](_0x19597d[_0x4a84('0x2d')][_0x4a84('0x31')]));_0xd99a5[_0x4a84('0x30')]=_0xd99a5['attributes'][_0x4a84('0x40')]?_0xd99a5[_0x4a84('0x30')]:_0x33d279['model'];if(_0x19597d[_0x4a84('0x2d')]['includeAll']){_0xd99a5[_0x4a84('0x3b')]=[{'all':!![]}];}_0xd99a5=_[_0x4a84('0x39')]({},_0xd99a5,_0x19597d[_0x4a84('0x41')]);return db['SquareReport']['find'](_0xd99a5)[_0x4a84('0x24')](handleEntityNotFound(_0x2b3e46,null))['then'](respondWithResult(_0x2b3e46,null))[_0x4a84('0x42')](handleError(_0x2b3e46,null));};exports[_0x4a84('0x43')]=function(_0x4de3a5,_0x5c9eed){return db[_0x4a84('0x3a')][_0x4a84('0x43')](_0x4de3a5['body'],{})[_0x4a84('0x24')](respondWithResult(_0x5c9eed,0xc9))['catch'](handleError(_0x5c9eed,null));};exports[_0x4a84('0x44')]=function(_0x1f79d2,_0x576ab5){if(_0x1f79d2[_0x4a84('0x45')]['id']){delete _0x1f79d2[_0x4a84('0x45')]['id'];}return db[_0x4a84('0x3a')]['find']({'where':{'id':_0x1f79d2[_0x4a84('0x3e')]['id']}})[_0x4a84('0x24')](handleEntityNotFound(_0x576ab5,null))[_0x4a84('0x24')](saveUpdates(_0x1f79d2[_0x4a84('0x45')],null))['then'](respondWithResult(_0x576ab5,null))[_0x4a84('0x42')](handleError(_0x576ab5,null));};exports[_0x4a84('0x23')]=function(_0x1d8d01,_0x2abd73){return db[_0x4a84('0x3a')][_0x4a84('0x46')]({'where':{'id':_0x1d8d01[_0x4a84('0x3e')]['id']}})[_0x4a84('0x24')](handleEntityNotFound(_0x2abd73,null))[_0x4a84('0x24')](removeEntity(_0x2abd73,null))[_0x4a84('0x42')](handleError(_0x2abd73,null));};exports['describe']=function(_0x38565a,_0x3e8b80){return db[_0x4a84('0x3a')][_0x4a84('0x47')]()['then'](respondWithResult(_0x3e8b80,null))[_0x4a84('0x42')](handleError(_0x3e8b80,null));};
\ No newline at end of file
+var _0xa1db=['SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map'];(function(_0x1395d2,_0x34e033){var _0x22c592=function(_0x587aa9){while(--_0x587aa9){_0x1395d2['push'](_0x1395d2['shift']());}};_0x22c592(++_0x34e033);}(_0xa1db,0xbb));var _0xba1d=function(_0x4b1fb4,_0x36f2e0){_0x4b1fb4=_0x4b1fb4-0x0;var _0x1617cc=_0xa1db[_0x4b1fb4];return _0x1617cc;};'use strict';var emlformat=require(_0xba1d('0x0'));var rimraf=require(_0xba1d('0x1'));var zipdir=require(_0xba1d('0x2'));var jsonpatch=require(_0xba1d('0x3'));var rp=require('request-promise');var moment=require(_0xba1d('0x4'));var BPromise=require(_0xba1d('0x5'));var Mustache=require(_0xba1d('0x6'));var util=require(_0xba1d('0x7'));var path=require(_0xba1d('0x8'));var sox=require(_0xba1d('0x9'));var csv=require(_0xba1d('0xa'));var ejs=require(_0xba1d('0xb'));var fs=require('fs');var fs_extra=require(_0xba1d('0xc'));var _=require(_0xba1d('0xd'));var squel=require(_0xba1d('0xe'));var crypto=require(_0xba1d('0xf'));var jsforce=require(_0xba1d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xba1d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xba1d('0x11'));var authService=require(_0xba1d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xba1d('0x13'));var hardwareService=require(_0xba1d('0x14'));var logger=require(_0xba1d('0x15'))('api');var utils=require(_0xba1d('0x16'));var config=require(_0xba1d('0x17'));var licenseUtil=require(_0xba1d('0x18'));var db=require(_0xba1d('0x19'))['db'];function respondWithStatusCode(_0x3b356f,_0x5cdd79){_0x5cdd79=_0x5cdd79||0xcc;return function(_0x292e62){if(_0x292e62){return _0x3b356f['sendStatus'](_0x5cdd79);}return _0x3b356f[_0xba1d('0x1a')](_0x5cdd79)['end']();};}function respondWithResult(_0xe6a179,_0x53575a){_0x53575a=_0x53575a||0xc8;return function(_0xbe6f66){if(_0xbe6f66){return _0xe6a179[_0xba1d('0x1a')](_0x53575a)[_0xba1d('0x1b')](_0xbe6f66);}};}function respondWithFilteredResult(_0x35c4ab,_0x389e28){return function(_0x13ce9b){if(_0x13ce9b){var _0x46307e=typeof _0x389e28[_0xba1d('0x1c')]===_0xba1d('0x1d')&&typeof _0x389e28[_0xba1d('0x1e')]==='undefined';var _0x15a890=_0x13ce9b['count'];var _0x50292b=_0x46307e?0x0:_0x389e28['offset'];var _0x406e53=_0x46307e?_0x13ce9b[_0xba1d('0x1f')]:_0x389e28[_0xba1d('0x1c')]+_0x389e28[_0xba1d('0x1e')];var _0x2b004e;if(_0x406e53>=_0x15a890){_0x406e53=_0x15a890;_0x2b004e=0xc8;}else{_0x2b004e=0xce;}_0x35c4ab[_0xba1d('0x1a')](_0x2b004e);return _0x35c4ab['set'](_0xba1d('0x20'),_0x50292b+'-'+_0x406e53+'/'+_0x15a890)[_0xba1d('0x1b')](_0x13ce9b);}return null;};}function patchUpdates(_0x5c5a4c){return function(_0x3002d9){try{jsonpatch[_0xba1d('0x21')](_0x3002d9,_0x5c5a4c,!![]);}catch(_0x5bed9c){return BPromise[_0xba1d('0x22')](_0x5bed9c);}return _0x3002d9[_0xba1d('0x23')]();};}function saveUpdates(_0x19e2d3,_0x4d8b82){return function(_0x4a7a10){if(_0x4a7a10){return _0x4a7a10['update'](_0x19e2d3)[_0xba1d('0x24')](function(_0x55687a){return _0x55687a;});}return null;};}function removeEntity(_0x3b2861,_0x4b275b){return function(_0x3eb479){if(_0x3eb479){return _0x3eb479[_0xba1d('0x25')]()[_0xba1d('0x24')](function(){_0x3b2861['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x602c7,_0x50e72c){return function(_0x54ac61){if(!_0x54ac61){_0x602c7[_0xba1d('0x26')](0x194);}return _0x54ac61;};}function handleError(_0x235795,_0x55ad74){_0x55ad74=_0x55ad74||0x1f4;return function(_0x3a7763){logger[_0xba1d('0x27')](_0x3a7763['stack']);if(_0x3a7763['name']){delete _0x3a7763[_0xba1d('0x28')];}_0x235795[_0xba1d('0x1a')](_0x55ad74)[_0xba1d('0x29')](_0x3a7763);};}exports[_0xba1d('0x2a')]=function(_0x133378,_0x2c8589){var _0x232204={},_0x48d120={},_0x28fc58={'count':0x0,'rows':[]};var _0x3fb1a1=_[_0xba1d('0x2b')](db[_0xba1d('0x2c')][_0xba1d('0x2d')],function(_0x56c942){return{'name':_0x56c942[_0xba1d('0x2e')],'type':_0x56c942[_0xba1d('0x2f')][_0xba1d('0x30')]};});_0x48d120[_0xba1d('0x31')]=_['map'](_0x3fb1a1,_0xba1d('0x28'));_0x48d120[_0xba1d('0x32')]=_[_0xba1d('0x33')](_0x133378[_0xba1d('0x32')]);_0x48d120[_0xba1d('0x34')]=_[_0xba1d('0x35')](_0x48d120[_0xba1d('0x31')],_0x48d120[_0xba1d('0x32')]);_0x232204[_0xba1d('0x36')]=_['intersection'](_0x48d120[_0xba1d('0x31')],qs[_0xba1d('0x37')](_0x133378[_0xba1d('0x32')][_0xba1d('0x37')]));_0x232204[_0xba1d('0x36')]=_0x232204[_0xba1d('0x36')]['length']?_0x232204[_0xba1d('0x36')]:_0x48d120[_0xba1d('0x31')];if(!_0x133378[_0xba1d('0x32')][_0xba1d('0x38')](_0xba1d('0x39'))){_0x232204[_0xba1d('0x1e')]=qs[_0xba1d('0x1e')](_0x133378[_0xba1d('0x32')]['limit']);_0x232204['offset']=qs[_0xba1d('0x1c')](_0x133378['query'][_0xba1d('0x1c')]);}_0x232204['order']=qs[_0xba1d('0x3a')](_0x133378['query'][_0xba1d('0x3a')]);_0x232204[_0xba1d('0x3b')]=qs[_0xba1d('0x34')](_[_0xba1d('0x3c')](_0x133378[_0xba1d('0x32')],_0x48d120[_0xba1d('0x34')]),_0x3fb1a1);if(_0x133378[_0xba1d('0x32')][_0xba1d('0x3d')]){_0x232204[_0xba1d('0x3b')]=_[_0xba1d('0x3e')](_0x232204[_0xba1d('0x3b')],{'$or':_['map'](_0x3fb1a1,function(_0x6a2e1d){if(_0x6a2e1d[_0xba1d('0x2f')]!==_0xba1d('0x3f')){var _0x18224d={};_0x18224d[_0x6a2e1d[_0xba1d('0x28')]]={'$like':'%'+_0x133378[_0xba1d('0x32')]['filter']+'%'};return _0x18224d;}})});}_0x232204=_[_0xba1d('0x3e')]({},_0x232204,_0x133378[_0xba1d('0x40')]);var _0x488509={'where':_0x232204[_0xba1d('0x3b')]};return db[_0xba1d('0x2c')][_0xba1d('0x1f')](_0x488509)[_0xba1d('0x24')](function(_0x2b02ae){_0x28fc58['count']=_0x2b02ae;if(_0x133378[_0xba1d('0x32')][_0xba1d('0x41')]){_0x232204[_0xba1d('0x42')]=[{'all':!![]}];}return db[_0xba1d('0x2c')]['findAll'](_0x232204);})[_0xba1d('0x24')](function(_0x57e1a1){_0x28fc58[_0xba1d('0x43')]=_0x57e1a1;return _0x28fc58;})['then'](respondWithFilteredResult(_0x2c8589,_0x232204))[_0xba1d('0x44')](handleError(_0x2c8589,null));};exports[_0xba1d('0x45')]=function(_0x43cce2,_0x2fe65b){var _0xec72e1={'raw':!![],'where':{'id':_0x43cce2[_0xba1d('0x46')]['id']}},_0x1ba72={};_0x1ba72[_0xba1d('0x31')]=_[_0xba1d('0x33')](db['SquareReport'][_0xba1d('0x2d')]);_0x1ba72[_0xba1d('0x32')]=_['keys'](_0x43cce2['query']);_0x1ba72[_0xba1d('0x34')]=_['intersection'](_0x1ba72[_0xba1d('0x31')],_0x1ba72[_0xba1d('0x32')]);_0xec72e1['attributes']=_[_0xba1d('0x35')](_0x1ba72[_0xba1d('0x31')],qs[_0xba1d('0x37')](_0x43cce2[_0xba1d('0x32')][_0xba1d('0x37')]));_0xec72e1['attributes']=_0xec72e1[_0xba1d('0x36')][_0xba1d('0x47')]?_0xec72e1[_0xba1d('0x36')]:_0x1ba72[_0xba1d('0x31')];if(_0x43cce2[_0xba1d('0x32')][_0xba1d('0x41')]){_0xec72e1[_0xba1d('0x42')]=[{'all':!![]}];}_0xec72e1=_[_0xba1d('0x3e')]({},_0xec72e1,_0x43cce2[_0xba1d('0x40')]);return db['SquareReport']['find'](_0xec72e1)[_0xba1d('0x24')](handleEntityNotFound(_0x2fe65b,null))['then'](respondWithResult(_0x2fe65b,null))[_0xba1d('0x44')](handleError(_0x2fe65b,null));};exports[_0xba1d('0x48')]=function(_0x29b0b2,_0x51d901){return db[_0xba1d('0x2c')][_0xba1d('0x48')](_0x29b0b2[_0xba1d('0x49')],{})[_0xba1d('0x24')](respondWithResult(_0x51d901,0xc9))[_0xba1d('0x44')](handleError(_0x51d901,null));};exports[_0xba1d('0x4a')]=function(_0x19a93b,_0x119604){if(_0x19a93b['body']['id']){delete _0x19a93b[_0xba1d('0x49')]['id'];}return db['SquareReport'][_0xba1d('0x4b')]({'where':{'id':_0x19a93b[_0xba1d('0x46')]['id']}})[_0xba1d('0x24')](handleEntityNotFound(_0x119604,null))[_0xba1d('0x24')](saveUpdates(_0x19a93b['body'],null))[_0xba1d('0x24')](respondWithResult(_0x119604,null))[_0xba1d('0x44')](handleError(_0x119604,null));};exports[_0xba1d('0x25')]=function(_0x272e7a,_0x437b95){return db[_0xba1d('0x2c')][_0xba1d('0x4b')]({'where':{'id':_0x272e7a[_0xba1d('0x46')]['id']}})['then'](handleEntityNotFound(_0x437b95,null))[_0xba1d('0x24')](removeEntity(_0x437b95,null))[_0xba1d('0x44')](handleError(_0x437b95,null));};exports[_0xba1d('0x4c')]=function(_0x45b565,_0x492249){return db[_0xba1d('0x2c')][_0xba1d('0x4c')]()[_0xba1d('0x24')](respondWithResult(_0x492249,null))['catch'](handleError(_0x492249,null));};
\ No newline at end of file
index 0ed46f0..8cfba2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad75=['bluebird','path','rimraf','../../config/environment','exports','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment'];(function(_0x271b73,_0x37ac84){var _0x267965=function(_0x2793f3){while(--_0x2793f3){_0x271b73['push'](_0x271b73['shift']());}};_0x267965(++_0x37ac84);}(_0xad75,0xdb));var _0x5ad7=function(_0x4e516d,_0x482c2f){_0x4e516d=_0x4e516d-0x0;var _0x4adae3=_0xad75[_0x4e516d];return _0x4adae3;};'use strict';var _=require(_0x5ad7('0x0'));var util=require(_0x5ad7('0x1'));var logger=require(_0x5ad7('0x2'))(_0x5ad7('0x3'));var moment=require(_0x5ad7('0x4'));var BPromise=require(_0x5ad7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ad7('0x6'));var rimraf=require(_0x5ad7('0x7'));var config=require(_0x5ad7('0x8'));var attributes=require('./squareReport.attributes');module[_0x5ad7('0x9')]=function(_0x36f296,_0x4a4846){return _0x36f296['define']('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x5ad7('0xa'),'fields':[_0x5ad7('0xb'),_0x5ad7('0xc')]},{'name':_0x5ad7('0xd'),'fields':[_0x5ad7('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x94db=['api','moment','bluebird','rimraf','../../config/environment','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash'];(function(_0x274be0,_0x32de72){var _0x197ca3=function(_0x3eaa01){while(--_0x3eaa01){_0x274be0['push'](_0x274be0['shift']());}};_0x197ca3(++_0x32de72);}(_0x94db,0x1e0));var _0xb94d=function(_0x1a0239,_0x434c3f){_0x1a0239=_0x1a0239-0x0;var _0x4dae46=_0x94db[_0x1a0239];return _0x4dae46;};'use strict';var _=require(_0xb94d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb94d('0x1'));var moment=require(_0xb94d('0x2'));var BPromise=require(_0xb94d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb94d('0x4'));var config=require(_0xb94d('0x5'));var attributes=require('./squareReport.attributes');module[_0xb94d('0x6')]=function(_0x567105,_0x5569c0){return _0x567105[_0xb94d('0x7')]('SquareReport',attributes,{'tableName':_0xb94d('0x8'),'paranoid':![],'indexes':[{'name':_0xb94d('0x9'),'fields':[_0xb94d('0xa'),_0xb94d('0xb')]},{'name':_0xb94d('0xc'),'fields':[_0xb94d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index bb6ac5e..69fb05a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa87c=['then','debug','CreateSquareReport','UpdateSquareReport','update','body','where','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareReport','create','options'];(function(_0x5d1a82,_0x2d1fec){var _0x2ad31c=function(_0xe91aea){while(--_0xe91aea){_0x5d1a82['push'](_0x5d1a82['shift']());}};_0x2ad31c(++_0x2d1fec);}(_0xa87c,0x110));var _0xca87=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0xa87c[_0x4bc65f];return _0x44f85f;};'use strict';var _=require(_0xca87('0x0'));var util=require(_0xca87('0x1'));var moment=require('moment');var BPromise=require(_0xca87('0x2'));var rs=require(_0xca87('0x3'));var fs=require('fs');var Redis=require(_0xca87('0x4'));var db=require(_0xca87('0x5'))['db'];var utils=require(_0xca87('0x6'));var logger=require(_0xca87('0x7'))(_0xca87('0x8'));var config=require('../../config/environment');var jayson=require(_0xca87('0x9'));var client=jayson[_0xca87('0xa')][_0xca87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x172cbf,_0x2fd1eb,_0x479e1b){return new BPromise(function(_0x41025b,_0x4c27aa){return client[_0xca87('0xc')](_0x172cbf,_0x479e1b)['then'](function(_0x5b9667){logger[_0xca87('0xd')](_0xca87('0xe'),_0x2fd1eb,_0xca87('0xf'));logger['debug'](_0xca87('0x10'),_0x2fd1eb,'request\x20sent',JSON[_0xca87('0x11')](_0x5b9667));if(_0x5b9667[_0xca87('0x12')]){if(_0x5b9667['error'][_0xca87('0x13')]===0x1f4){logger[_0xca87('0x12')](_0xca87('0xe'),_0x2fd1eb,_0x5b9667[_0xca87('0x12')]['message']);return _0x4c27aa(_0x5b9667[_0xca87('0x12')][_0xca87('0x14')]);}logger[_0xca87('0x12')](_0xca87('0xe'),_0x2fd1eb,_0x5b9667[_0xca87('0x12')]['message']);return _0x41025b(_0x5b9667[_0xca87('0x12')]['message']);}else{logger[_0xca87('0xd')](_0xca87('0xe'),_0x2fd1eb,_0xca87('0xf'));_0x41025b(_0x5b9667['result'][_0xca87('0x14')]);}})[_0xca87('0x15')](function(_0x283311){logger[_0xca87('0x12')](_0xca87('0xe'),_0x2fd1eb,_0x283311);_0x4c27aa(_0x283311);});});}exports['CreateSquareReport']=function(_0x364dfb){var _0x4d5167=this;return new Promise(function(_0x198f2a,_0x1204fa){return db[_0xca87('0x16')][_0xca87('0x17')](_0x364dfb['body'],{'raw':_0x364dfb[_0xca87('0x18')]?_0x364dfb[_0xca87('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xca87('0x19')](function(_0x3a8f28){logger[_0xca87('0xd')]('CreateSquareReport',_0x364dfb);logger[_0xca87('0x1a')](_0xca87('0x1b'),_0x364dfb,JSON[_0xca87('0x11')](_0x3a8f28));_0x198f2a(_0x3a8f28);})['catch'](function(_0x196a76){logger[_0xca87('0x12')](_0xca87('0x1b'),_0x196a76[_0xca87('0x14')],_0x364dfb);_0x1204fa(_0x4d5167[_0xca87('0x12')](0x1f4,_0x196a76[_0xca87('0x14')]));});});};exports[_0xca87('0x1c')]=function(_0x2afd6c){var _0xfd11fc=this;return new Promise(function(_0x18da63,_0x596d8a){return db['SquareReport'][_0xca87('0x1d')](_0x2afd6c[_0xca87('0x1e')],{'raw':_0x2afd6c['options']?_0x2afd6c[_0xca87('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2afd6c[_0xca87('0x18')]?_0x2afd6c[_0xca87('0x18')][_0xca87('0x1f')]||null:null,'attributes':_0x2afd6c[_0xca87('0x18')]?_0x2afd6c[_0xca87('0x18')]['attributes']||null:null,'limit':_0x2afd6c[_0xca87('0x18')]?_0x2afd6c[_0xca87('0x18')][_0xca87('0x20')]||null:null})[_0xca87('0x19')](function(_0x2d6e92){logger[_0xca87('0xd')]('UpdateSquareReport',_0x2afd6c);logger[_0xca87('0x1a')](_0xca87('0x1c'),_0x2afd6c,JSON[_0xca87('0x11')](_0x2d6e92));_0x18da63(_0x2d6e92);})[_0xca87('0x15')](function(_0x1e33fd){logger[_0xca87('0x12')]('UpdateSquareReport',_0x1e33fd[_0xca87('0x14')],_0x2afd6c);_0x596d8a(_0xfd11fc[_0xca87('0x12')](0x1f4,_0x1e33fd[_0xca87('0x14')]));});});};
\ No newline at end of file
+var _0xff14=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','options','raw','UpdateSquareReport','update','body','where','attributes','limit','lodash','util','moment'];(function(_0x3ce006,_0x20b0aa){var _0x3f7b85=function(_0x53d9a9){while(--_0x53d9a9){_0x3ce006['push'](_0x3ce006['shift']());}};_0x3f7b85(++_0x20b0aa);}(_0xff14,0x1c4));var _0x4ff1=function(_0x217614,_0x328c14){_0x217614=_0x217614-0x0;var _0x5501c3=_0xff14[_0x217614];return _0x5501c3;};'use strict';var _=require(_0x4ff1('0x0'));var util=require(_0x4ff1('0x1'));var moment=require(_0x4ff1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ff1('0x3'));var db=require(_0x4ff1('0x4'))['db'];var utils=require(_0x4ff1('0x5'));var logger=require(_0x4ff1('0x6'))(_0x4ff1('0x7'));var config=require(_0x4ff1('0x8'));var jayson=require(_0x4ff1('0x9'));var client=jayson[_0x4ff1('0xa')][_0x4ff1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45d28c,_0x31d62f,_0x5502ee){return new BPromise(function(_0x354c73,_0x4f970c){return client[_0x4ff1('0xc')](_0x45d28c,_0x5502ee)[_0x4ff1('0xd')](function(_0x104d19){logger[_0x4ff1('0xe')](_0x4ff1('0xf'),_0x31d62f,_0x4ff1('0x10'));logger[_0x4ff1('0x11')](_0x4ff1('0x12'),_0x31d62f,_0x4ff1('0x10'),JSON[_0x4ff1('0x13')](_0x104d19));if(_0x104d19['error']){if(_0x104d19[_0x4ff1('0x14')][_0x4ff1('0x15')]===0x1f4){logger[_0x4ff1('0x14')](_0x4ff1('0xf'),_0x31d62f,_0x104d19[_0x4ff1('0x14')][_0x4ff1('0x16')]);return _0x4f970c(_0x104d19[_0x4ff1('0x14')][_0x4ff1('0x16')]);}logger['error'](_0x4ff1('0xf'),_0x31d62f,_0x104d19[_0x4ff1('0x14')][_0x4ff1('0x16')]);return _0x354c73(_0x104d19[_0x4ff1('0x14')][_0x4ff1('0x16')]);}else{logger[_0x4ff1('0xe')](_0x4ff1('0xf'),_0x31d62f,_0x4ff1('0x10'));_0x354c73(_0x104d19[_0x4ff1('0x17')][_0x4ff1('0x16')]);}})[_0x4ff1('0x18')](function(_0x48015b){logger[_0x4ff1('0x14')](_0x4ff1('0xf'),_0x31d62f,_0x48015b);_0x4f970c(_0x48015b);});});}exports[_0x4ff1('0x19')]=function(_0x1fa8c3){var _0x2d7531=this;return new Promise(function(_0x57a9dc,_0x231895){return db[_0x4ff1('0x1a')]['create'](_0x1fa8c3['body'],{'raw':_0x1fa8c3[_0x4ff1('0x1b')]?_0x1fa8c3[_0x4ff1('0x1b')][_0x4ff1('0x1c')]===undefined?!![]:![]:!![]})[_0x4ff1('0xd')](function(_0x1e23e8){logger['info'](_0x4ff1('0x19'),_0x1fa8c3);logger[_0x4ff1('0x11')](_0x4ff1('0x19'),_0x1fa8c3,JSON[_0x4ff1('0x13')](_0x1e23e8));_0x57a9dc(_0x1e23e8);})[_0x4ff1('0x18')](function(_0x6db861){logger[_0x4ff1('0x14')]('CreateSquareReport',_0x6db861[_0x4ff1('0x16')],_0x1fa8c3);_0x231895(_0x2d7531[_0x4ff1('0x14')](0x1f4,_0x6db861[_0x4ff1('0x16')]));});});};exports[_0x4ff1('0x1d')]=function(_0x4a7040){var _0x197aeb=this;return new Promise(function(_0x23b2d4,_0x3885c7){return db[_0x4ff1('0x1a')][_0x4ff1('0x1e')](_0x4a7040[_0x4ff1('0x1f')],{'raw':_0x4a7040[_0x4ff1('0x1b')]?_0x4a7040[_0x4ff1('0x1b')][_0x4ff1('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a7040[_0x4ff1('0x1b')]?_0x4a7040[_0x4ff1('0x1b')][_0x4ff1('0x20')]||null:null,'attributes':_0x4a7040[_0x4ff1('0x1b')]?_0x4a7040[_0x4ff1('0x1b')][_0x4ff1('0x21')]||null:null,'limit':_0x4a7040[_0x4ff1('0x1b')]?_0x4a7040[_0x4ff1('0x1b')][_0x4ff1('0x22')]||null:null})[_0x4ff1('0xd')](function(_0x17f776){logger[_0x4ff1('0xe')](_0x4ff1('0x1d'),_0x4a7040);logger[_0x4ff1('0x11')](_0x4ff1('0x1d'),_0x4a7040,JSON[_0x4ff1('0x13')](_0x17f776));_0x23b2d4(_0x17f776);})[_0x4ff1('0x18')](function(_0x15b40a){logger[_0x4ff1('0x14')](_0x4ff1('0x1d'),_0x15b40a[_0x4ff1('0x16')],_0x4a7040);_0x3885c7(_0x197aeb[_0x4ff1('0x14')](0x1f4,_0x15b40a[_0x4ff1('0x16')]));});});};
\ No newline at end of file
index 85770f1..fcddf90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4d2=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path'];(function(_0x267750,_0x54f315){var _0x12f0dd=function(_0x2ea032){while(--_0x2ea032){_0x267750['push'](_0x267750['shift']());}};_0x12f0dd(++_0x54f315);}(_0xf4d2,0x139));var _0x2f4d=function(_0x959354,_0x21b8cc){_0x959354=_0x959354-0x0;var _0x49adb8=_0xf4d2[_0x959354];return _0x49adb8;};'use strict';var multer=require('multer');var util=require(_0x2f4d('0x0'));var path=require(_0x2f4d('0x1'));var timeout=require(_0x2f4d('0x2'));var express=require('express');var router=express[_0x2f4d('0x3')]();var fs_extra=require(_0x2f4d('0x4'));var auth=require(_0x2f4d('0x5'));var interaction=require(_0x2f4d('0x6'));var config=require(_0x2f4d('0x7'));var controller=require(_0x2f4d('0x8'));router[_0x2f4d('0x9')]('/',auth[_0x2f4d('0xa')](),controller[_0x2f4d('0xb')]);router[_0x2f4d('0x9')](_0x2f4d('0xc'),auth[_0x2f4d('0xa')](),controller[_0x2f4d('0xd')]);router[_0x2f4d('0x9')](_0x2f4d('0xe'),auth[_0x2f4d('0xa')](),controller[_0x2f4d('0xf')]);router['post']('/',auth[_0x2f4d('0xa')](),controller[_0x2f4d('0x10')]);router[_0x2f4d('0x11')](_0x2f4d('0xe'),auth[_0x2f4d('0xa')](),controller['update']);router[_0x2f4d('0x12')](_0x2f4d('0xe'),auth[_0x2f4d('0xa')](),controller[_0x2f4d('0x13')]);module[_0x2f4d('0x14')]=router;
\ No newline at end of file
+var _0x794b=['express','Router','fs-extra','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','describe','create','put','/:id','delete','destroy','exports','path'];(function(_0x52215e,_0x3644bd){var _0x5e787c=function(_0x34415f){while(--_0x34415f){_0x52215e['push'](_0x52215e['shift']());}};_0x5e787c(++_0x3644bd);}(_0x794b,0x1af));var _0xb794=function(_0x51e327,_0x32fc19){_0x51e327=_0x51e327-0x0;var _0x548d19=_0x794b[_0x51e327];return _0x548d19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb794('0x0'));var timeout=require('connect-timeout');var express=require(_0xb794('0x1'));var router=express[_0xb794('0x2')]();var fs_extra=require(_0xb794('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb794('0x4'));var config=require('../../config/environment');var controller=require(_0xb794('0x5'));router[_0xb794('0x6')]('/',auth[_0xb794('0x7')](),controller[_0xb794('0x8')]);router[_0xb794('0x6')]('/describe',auth[_0xb794('0x7')](),controller[_0xb794('0x9')]);router[_0xb794('0x6')]('/:id',auth[_0xb794('0x7')](),controller['show']);router['post']('/',auth[_0xb794('0x7')](),controller[_0xb794('0xa')]);router[_0xb794('0xb')](_0xb794('0xc'),auth[_0xb794('0x7')](),controller['update']);router[_0xb794('0xd')]('/:id',auth[_0xb794('0x7')](),controller[_0xb794('0xe')]);module[_0xb794('0xf')]=router;
\ No newline at end of file
index 689348d..8182656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaeb9=['exports','STRING','TEXT','sequelize'];(function(_0x1fd0ac,_0x554f3c){var _0x4a9deb=function(_0xf81e52){while(--_0xf81e52){_0x1fd0ac['push'](_0x1fd0ac['shift']());}};_0x4a9deb(++_0x554f3c);}(_0xaeb9,0x1d3));var _0x9aeb=function(_0x225a30,_0x22bc59){_0x225a30=_0x225a30-0x0;var _0x33066d=_0xaeb9[_0x225a30];return _0x33066d;};'use strict';var Sequelize=require(_0x9aeb('0x0'));module[_0x9aeb('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x9aeb('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x9aeb('0x3')]},'project_name':{'type':Sequelize[_0x9aeb('0x2')]},'callerid':{'type':Sequelize[_0x9aeb('0x2')]}};
\ No newline at end of file
+var _0x1157=['TEXT','sequelize','STRING'];(function(_0xfe3407,_0x2d93f9){var _0x2a86ba=function(_0x557e9e){while(--_0x557e9e){_0xfe3407['push'](_0xfe3407['shift']());}};_0x2a86ba(++_0x2d93f9);}(_0x1157,0x1a8));var _0x7115=function(_0x42d9d4,_0x158ad6){_0x42d9d4=_0x42d9d4-0x0;var _0x3440a9=_0x1157[_0x42d9d4];return _0x3440a9;};'use strict';var Sequelize=require(_0x7115('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7115('0x1')]},'node':{'type':Sequelize[_0x7115('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x7115('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e2b57be..2759264 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x970c=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','intersection','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x9331c0,_0x2940a6){var _0x9878c7=function(_0x2c672a){while(--_0x2c672a){_0x9331c0['push'](_0x9331c0['shift']());}};_0x9878c7(++_0x2940a6);}(_0x970c,0xce));var _0xc970=function(_0x4a6573,_0xe9c4af){_0x4a6573=_0x4a6573-0x0;var _0x46ccc8=_0x970c[_0x4a6573];return _0x46ccc8;};'use strict';var emlformat=require(_0xc970('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc970('0x1'));var jsonpatch=require(_0xc970('0x2'));var rp=require(_0xc970('0x3'));var moment=require(_0xc970('0x4'));var BPromise=require(_0xc970('0x5'));var Mustache=require('mustache');var util=require(_0xc970('0x6'));var path=require(_0xc970('0x7'));var sox=require(_0xc970('0x8'));var csv=require(_0xc970('0x9'));var ejs=require(_0xc970('0xa'));var fs=require('fs');var fs_extra=require(_0xc970('0xb'));var _=require(_0xc970('0xc'));var squel=require('squel');var crypto=require(_0xc970('0xd'));var jsforce=require(_0xc970('0xe'));var deskjs=require(_0xc970('0xf'));var toCsv=require(_0xc970('0x9'));var querystring=require(_0xc970('0x10'));var Papa=require(_0xc970('0x11'));var Redis=require(_0xc970('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc970('0x13'));var hardwareService=require(_0xc970('0x14'));var logger=require(_0xc970('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xc970('0x16'));var licenseUtil=require(_0xc970('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d6e0,_0x3a1bde){_0x3a1bde=_0x3a1bde||0xcc;return function(_0x18754c){if(_0x18754c){return _0x25d6e0['sendStatus'](_0x3a1bde);}return _0x25d6e0[_0xc970('0x18')](_0x3a1bde)[_0xc970('0x19')]();};}function respondWithResult(_0x352a9f,_0x35acc9){_0x35acc9=_0x35acc9||0xc8;return function(_0x47fc62){if(_0x47fc62){return _0x352a9f[_0xc970('0x18')](_0x35acc9)[_0xc970('0x1a')](_0x47fc62);}};}function respondWithFilteredResult(_0x7fe9e1,_0x29dd26){return function(_0x3960c8){if(_0x3960c8){var _0x2ce72d=typeof _0x29dd26[_0xc970('0x1b')]===_0xc970('0x1c')&&typeof _0x29dd26[_0xc970('0x1d')]===_0xc970('0x1c');var _0x2413d9=_0x3960c8['count'];var _0x117a18=_0x2ce72d?0x0:_0x29dd26[_0xc970('0x1b')];var _0x236d31=_0x2ce72d?_0x3960c8[_0xc970('0x1e')]:_0x29dd26['offset']+_0x29dd26[_0xc970('0x1d')];var _0x5f4ba0;if(_0x236d31>=_0x2413d9){_0x236d31=_0x2413d9;_0x5f4ba0=0xc8;}else{_0x5f4ba0=0xce;}_0x7fe9e1['status'](_0x5f4ba0);return _0x7fe9e1[_0xc970('0x1f')](_0xc970('0x20'),_0x117a18+'-'+_0x236d31+'/'+_0x2413d9)[_0xc970('0x1a')](_0x3960c8);}return null;};}function patchUpdates(_0x49e95a){return function(_0x1a9858){try{jsonpatch[_0xc970('0x21')](_0x1a9858,_0x49e95a,!![]);}catch(_0x2aba09){return BPromise[_0xc970('0x22')](_0x2aba09);}return _0x1a9858[_0xc970('0x23')]();};}function saveUpdates(_0x2c63f0,_0x48e2f1){return function(_0x4526af){if(_0x4526af){return _0x4526af[_0xc970('0x24')](_0x2c63f0)['then'](function(_0x36ec11){return _0x36ec11;});}return null;};}function removeEntity(_0x40b708,_0x41752c){return function(_0x2304f4){if(_0x2304f4){return _0x2304f4['destroy']()[_0xc970('0x25')](function(){_0x40b708['status'](0xcc)[_0xc970('0x19')]();});}};}function handleEntityNotFound(_0x3a9f34,_0x4817c7){return function(_0x24be29){if(!_0x24be29){_0x3a9f34['sendStatus'](0x194);}return _0x24be29;};}function handleError(_0x325a97,_0x1340c1){_0x1340c1=_0x1340c1||0x1f4;return function(_0x4361b4){logger[_0xc970('0x26')](_0x4361b4['stack']);if(_0x4361b4[_0xc970('0x27')]){delete _0x4361b4[_0xc970('0x27')];}_0x325a97[_0xc970('0x18')](_0x1340c1)[_0xc970('0x28')](_0x4361b4);};}exports[_0xc970('0x29')]=function(_0x3dd03a,_0xcc47f1){var _0x2d6fd9={},_0x29a65e={},_0x4a4eeb={'count':0x0,'rows':[]};var _0x32f29a=_[_0xc970('0x2a')](db[_0xc970('0x2b')][_0xc970('0x2c')],function(_0x228f6a){return{'name':_0x228f6a[_0xc970('0x2d')],'type':_0x228f6a[_0xc970('0x2e')][_0xc970('0x2f')]};});_0x29a65e[_0xc970('0x30')]=_[_0xc970('0x2a')](_0x32f29a,_0xc970('0x27'));_0x29a65e[_0xc970('0x31')]=_[_0xc970('0x32')](_0x3dd03a[_0xc970('0x31')]);_0x29a65e[_0xc970('0x33')]=_['intersection'](_0x29a65e[_0xc970('0x30')],_0x29a65e['query']);_0x2d6fd9['attributes']=_['intersection'](_0x29a65e[_0xc970('0x30')],qs[_0xc970('0x34')](_0x3dd03a[_0xc970('0x31')]['fields']));_0x2d6fd9['attributes']=_0x2d6fd9['attributes'][_0xc970('0x35')]?_0x2d6fd9[_0xc970('0x36')]:_0x29a65e['model'];if(!_0x3dd03a[_0xc970('0x31')][_0xc970('0x37')](_0xc970('0x38'))){_0x2d6fd9[_0xc970('0x1d')]=qs[_0xc970('0x1d')](_0x3dd03a[_0xc970('0x31')][_0xc970('0x1d')]);_0x2d6fd9['offset']=qs[_0xc970('0x1b')](_0x3dd03a[_0xc970('0x31')][_0xc970('0x1b')]);}_0x2d6fd9[_0xc970('0x39')]=qs[_0xc970('0x3a')](_0x3dd03a[_0xc970('0x31')][_0xc970('0x3a')]);_0x2d6fd9[_0xc970('0x3b')]=qs[_0xc970('0x33')](_[_0xc970('0x3c')](_0x3dd03a[_0xc970('0x31')],_0x29a65e[_0xc970('0x33')]),_0x32f29a);if(_0x3dd03a[_0xc970('0x31')][_0xc970('0x3d')]){_0x2d6fd9[_0xc970('0x3b')]=_[_0xc970('0x3e')](_0x2d6fd9[_0xc970('0x3b')],{'$or':_[_0xc970('0x2a')](_0x32f29a,function(_0x2209f3){if(_0x2209f3[_0xc970('0x2e')]!=='VIRTUAL'){var _0xe85e06={};_0xe85e06[_0x2209f3[_0xc970('0x27')]]={'$like':'%'+_0x3dd03a[_0xc970('0x31')][_0xc970('0x3d')]+'%'};return _0xe85e06;}})});}_0x2d6fd9=_[_0xc970('0x3e')]({},_0x2d6fd9,_0x3dd03a['options']);var _0x33f6d={'where':_0x2d6fd9[_0xc970('0x3b')]};return db[_0xc970('0x2b')][_0xc970('0x1e')](_0x33f6d)[_0xc970('0x25')](function(_0x3e7424){_0x4a4eeb[_0xc970('0x1e')]=_0x3e7424;if(_0x3dd03a[_0xc970('0x31')][_0xc970('0x3f')]){_0x2d6fd9[_0xc970('0x40')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xc970('0x41')](_0x2d6fd9);})['then'](function(_0x545c02){_0x4a4eeb[_0xc970('0x42')]=_0x545c02;return _0x4a4eeb;})[_0xc970('0x25')](respondWithFilteredResult(_0xcc47f1,_0x2d6fd9))['catch'](handleError(_0xcc47f1,null));};exports[_0xc970('0x43')]=function(_0x4a0aa1,_0x10004f){var _0x12e859={'raw':!![],'where':{'id':_0x4a0aa1[_0xc970('0x44')]['id']}},_0x3e11e0={};_0x3e11e0[_0xc970('0x30')]=_['keys'](db[_0xc970('0x2b')][_0xc970('0x2c')]);_0x3e11e0[_0xc970('0x31')]=_[_0xc970('0x32')](_0x4a0aa1['query']);_0x3e11e0[_0xc970('0x33')]=_[_0xc970('0x45')](_0x3e11e0[_0xc970('0x30')],_0x3e11e0[_0xc970('0x31')]);_0x12e859['attributes']=_['intersection'](_0x3e11e0['model'],qs[_0xc970('0x34')](_0x4a0aa1[_0xc970('0x31')][_0xc970('0x34')]));_0x12e859[_0xc970('0x36')]=_0x12e859[_0xc970('0x36')][_0xc970('0x35')]?_0x12e859['attributes']:_0x3e11e0[_0xc970('0x30')];if(_0x4a0aa1[_0xc970('0x31')]['includeAll']){_0x12e859[_0xc970('0x40')]=[{'all':!![]}];}_0x12e859=_['merge']({},_0x12e859,_0x4a0aa1['options']);return db['SquareDetailsReport'][_0xc970('0x46')](_0x12e859)['then'](handleEntityNotFound(_0x10004f,null))['then'](respondWithResult(_0x10004f,null))[_0xc970('0x47')](handleError(_0x10004f,null));};exports[_0xc970('0x48')]=function(_0x1f7ff,_0x150c85){return db[_0xc970('0x2b')][_0xc970('0x48')](_0x1f7ff[_0xc970('0x49')],{})[_0xc970('0x25')](respondWithResult(_0x150c85,0xc9))[_0xc970('0x47')](handleError(_0x150c85,null));};exports['update']=function(_0x5ba94c,_0x4aad8a){if(_0x5ba94c[_0xc970('0x49')]['id']){delete _0x5ba94c[_0xc970('0x49')]['id'];}return db['SquareDetailsReport'][_0xc970('0x46')]({'where':{'id':_0x5ba94c[_0xc970('0x44')]['id']}})[_0xc970('0x25')](handleEntityNotFound(_0x4aad8a,null))[_0xc970('0x25')](saveUpdates(_0x5ba94c[_0xc970('0x49')],null))['then'](respondWithResult(_0x4aad8a,null))[_0xc970('0x47')](handleError(_0x4aad8a,null));};exports[_0xc970('0x4a')]=function(_0x5b1054,_0x2df31c){return db['SquareDetailsReport'][_0xc970('0x46')]({'where':{'id':_0x5b1054[_0xc970('0x44')]['id']}})[_0xc970('0x25')](handleEntityNotFound(_0x2df31c,null))[_0xc970('0x25')](removeEntity(_0x2df31c,null))[_0xc970('0x47')](handleError(_0x2df31c,null));};exports[_0xc970('0x4b')]=function(_0x48b46a,_0x58f30e){return db[_0xc970('0x2b')][_0xc970('0x4b')]()['then'](respondWithResult(_0x58f30e,null))[_0xc970('0x47')](handleError(_0x58f30e,null));};
\ No newline at end of file
+var _0x7acd=['map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SquareDetailsReport','findAll','rows','catch','show','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','destroy','then','error','stack','name','send','index'];(function(_0xb292f9,_0x42a4bc){var _0x366dab=function(_0x3c8359){while(--_0x3c8359){_0xb292f9['push'](_0xb292f9['shift']());}};_0x366dab(++_0x42a4bc);}(_0x7acd,0x1b0));var _0xd7ac=function(_0x1168d1,_0x233c7d){_0x1168d1=_0x1168d1-0x0;var _0x5ea464=_0x7acd[_0x1168d1];return _0x5ea464;};'use strict';var emlformat=require(_0xd7ac('0x0'));var rimraf=require(_0xd7ac('0x1'));var zipdir=require(_0xd7ac('0x2'));var jsonpatch=require(_0xd7ac('0x3'));var rp=require(_0xd7ac('0x4'));var moment=require(_0xd7ac('0x5'));var BPromise=require(_0xd7ac('0x6'));var Mustache=require('mustache');var util=require(_0xd7ac('0x7'));var path=require(_0xd7ac('0x8'));var sox=require('sox');var csv=require(_0xd7ac('0x9'));var ejs=require(_0xd7ac('0xa'));var fs=require('fs');var fs_extra=require(_0xd7ac('0xb'));var _=require(_0xd7ac('0xc'));var squel=require(_0xd7ac('0xd'));var crypto=require(_0xd7ac('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd7ac('0xf'));var toCsv=require(_0xd7ac('0x9'));var querystring=require(_0xd7ac('0x10'));var Papa=require(_0xd7ac('0x11'));var Redis=require(_0xd7ac('0x12'));var authService=require(_0xd7ac('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd7ac('0x14'));var hardwareService=require(_0xd7ac('0x15'));var logger=require(_0xd7ac('0x16'))(_0xd7ac('0x17'));var utils=require(_0xd7ac('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xd7ac('0x19'));var db=require(_0xd7ac('0x1a'))['db'];function respondWithStatusCode(_0x3e46eb,_0x5ce758){_0x5ce758=_0x5ce758||0xcc;return function(_0x343a11){if(_0x343a11){return _0x3e46eb[_0xd7ac('0x1b')](_0x5ce758);}return _0x3e46eb[_0xd7ac('0x1c')](_0x5ce758)[_0xd7ac('0x1d')]();};}function respondWithResult(_0x491412,_0x22947c){_0x22947c=_0x22947c||0xc8;return function(_0x209e91){if(_0x209e91){return _0x491412[_0xd7ac('0x1c')](_0x22947c)[_0xd7ac('0x1e')](_0x209e91);}};}function respondWithFilteredResult(_0xd617af,_0x44df2e){return function(_0x5d34c4){if(_0x5d34c4){var _0x47a720=typeof _0x44df2e[_0xd7ac('0x1f')]===_0xd7ac('0x20')&&typeof _0x44df2e['limit']===_0xd7ac('0x20');var _0x3eb756=_0x5d34c4[_0xd7ac('0x21')];var _0x10fd0e=_0x47a720?0x0:_0x44df2e[_0xd7ac('0x1f')];var _0x52d7b4=_0x47a720?_0x5d34c4['count']:_0x44df2e[_0xd7ac('0x1f')]+_0x44df2e['limit'];var _0x6fa7d5;if(_0x52d7b4>=_0x3eb756){_0x52d7b4=_0x3eb756;_0x6fa7d5=0xc8;}else{_0x6fa7d5=0xce;}_0xd617af[_0xd7ac('0x1c')](_0x6fa7d5);return _0xd617af[_0xd7ac('0x22')]('Content-Range',_0x10fd0e+'-'+_0x52d7b4+'/'+_0x3eb756)[_0xd7ac('0x1e')](_0x5d34c4);}return null;};}function patchUpdates(_0x43661b){return function(_0x2781c5){try{jsonpatch['apply'](_0x2781c5,_0x43661b,!![]);}catch(_0x4bcd0e){return BPromise['reject'](_0x4bcd0e);}return _0x2781c5['save']();};}function saveUpdates(_0xae8883,_0x1f6620){return function(_0xd23ae5){if(_0xd23ae5){return _0xd23ae5['update'](_0xae8883)['then'](function(_0x5d932b){return _0x5d932b;});}return null;};}function removeEntity(_0x1f1bc0,_0x34ac6a){return function(_0x2769b7){if(_0x2769b7){return _0x2769b7[_0xd7ac('0x23')]()[_0xd7ac('0x24')](function(){_0x1f1bc0[_0xd7ac('0x1c')](0xcc)[_0xd7ac('0x1d')]();});}};}function handleEntityNotFound(_0x108110,_0x553f46){return function(_0x2ae6ba){if(!_0x2ae6ba){_0x108110[_0xd7ac('0x1b')](0x194);}return _0x2ae6ba;};}function handleError(_0x2a7c73,_0x2b94b9){_0x2b94b9=_0x2b94b9||0x1f4;return function(_0x13891a){logger[_0xd7ac('0x25')](_0x13891a[_0xd7ac('0x26')]);if(_0x13891a[_0xd7ac('0x27')]){delete _0x13891a[_0xd7ac('0x27')];}_0x2a7c73['status'](_0x2b94b9)[_0xd7ac('0x28')](_0x13891a);};}exports[_0xd7ac('0x29')]=function(_0x1e87c8,_0x6ab7f0){var _0x126931={},_0x3ac216={},_0x5abe87={'count':0x0,'rows':[]};var _0xe03689=_[_0xd7ac('0x2a')](db['SquareDetailsReport'][_0xd7ac('0x2b')],function(_0x1c8615){return{'name':_0x1c8615[_0xd7ac('0x2c')],'type':_0x1c8615[_0xd7ac('0x2d')][_0xd7ac('0x2e')]};});_0x3ac216[_0xd7ac('0x2f')]=_[_0xd7ac('0x2a')](_0xe03689,'name');_0x3ac216['query']=_[_0xd7ac('0x30')](_0x1e87c8['query']);_0x3ac216[_0xd7ac('0x31')]=_[_0xd7ac('0x32')](_0x3ac216[_0xd7ac('0x2f')],_0x3ac216[_0xd7ac('0x33')]);_0x126931[_0xd7ac('0x34')]=_[_0xd7ac('0x32')](_0x3ac216[_0xd7ac('0x2f')],qs[_0xd7ac('0x35')](_0x1e87c8['query'][_0xd7ac('0x35')]));_0x126931[_0xd7ac('0x34')]=_0x126931['attributes'][_0xd7ac('0x36')]?_0x126931['attributes']:_0x3ac216[_0xd7ac('0x2f')];if(!_0x1e87c8['query'][_0xd7ac('0x37')](_0xd7ac('0x38'))){_0x126931[_0xd7ac('0x39')]=qs['limit'](_0x1e87c8[_0xd7ac('0x33')]['limit']);_0x126931[_0xd7ac('0x1f')]=qs[_0xd7ac('0x1f')](_0x1e87c8[_0xd7ac('0x33')]['offset']);}_0x126931[_0xd7ac('0x3a')]=qs[_0xd7ac('0x3b')](_0x1e87c8['query'][_0xd7ac('0x3b')]);_0x126931[_0xd7ac('0x3c')]=qs['filters'](_[_0xd7ac('0x3d')](_0x1e87c8[_0xd7ac('0x33')],_0x3ac216['filters']),_0xe03689);if(_0x1e87c8[_0xd7ac('0x33')][_0xd7ac('0x3e')]){_0x126931[_0xd7ac('0x3c')]=_[_0xd7ac('0x3f')](_0x126931[_0xd7ac('0x3c')],{'$or':_[_0xd7ac('0x2a')](_0xe03689,function(_0x8949b7){if(_0x8949b7[_0xd7ac('0x2d')]!==_0xd7ac('0x40')){var _0x547f07={};_0x547f07[_0x8949b7[_0xd7ac('0x27')]]={'$like':'%'+_0x1e87c8[_0xd7ac('0x33')][_0xd7ac('0x3e')]+'%'};return _0x547f07;}})});}_0x126931=_[_0xd7ac('0x3f')]({},_0x126931,_0x1e87c8[_0xd7ac('0x41')]);var _0x152a70={'where':_0x126931[_0xd7ac('0x3c')]};return db['SquareDetailsReport']['count'](_0x152a70)['then'](function(_0x4fe602){_0x5abe87[_0xd7ac('0x21')]=_0x4fe602;if(_0x1e87c8[_0xd7ac('0x33')][_0xd7ac('0x42')]){_0x126931[_0xd7ac('0x43')]=[{'all':!![]}];}return db[_0xd7ac('0x44')][_0xd7ac('0x45')](_0x126931);})['then'](function(_0x3acabb){_0x5abe87[_0xd7ac('0x46')]=_0x3acabb;return _0x5abe87;})['then'](respondWithFilteredResult(_0x6ab7f0,_0x126931))[_0xd7ac('0x47')](handleError(_0x6ab7f0,null));};exports[_0xd7ac('0x48')]=function(_0x2871ed,_0x32d298){var _0x40fdf7={'raw':!![],'where':{'id':_0x2871ed['params']['id']}},_0x5c4991={};_0x5c4991['model']=_[_0xd7ac('0x30')](db[_0xd7ac('0x44')]['rawAttributes']);_0x5c4991[_0xd7ac('0x33')]=_[_0xd7ac('0x30')](_0x2871ed[_0xd7ac('0x33')]);_0x5c4991[_0xd7ac('0x31')]=_[_0xd7ac('0x32')](_0x5c4991[_0xd7ac('0x2f')],_0x5c4991[_0xd7ac('0x33')]);_0x40fdf7[_0xd7ac('0x34')]=_[_0xd7ac('0x32')](_0x5c4991[_0xd7ac('0x2f')],qs[_0xd7ac('0x35')](_0x2871ed[_0xd7ac('0x33')]['fields']));_0x40fdf7[_0xd7ac('0x34')]=_0x40fdf7[_0xd7ac('0x34')][_0xd7ac('0x36')]?_0x40fdf7[_0xd7ac('0x34')]:_0x5c4991[_0xd7ac('0x2f')];if(_0x2871ed['query'][_0xd7ac('0x42')]){_0x40fdf7['include']=[{'all':!![]}];}_0x40fdf7=_[_0xd7ac('0x3f')]({},_0x40fdf7,_0x2871ed[_0xd7ac('0x41')]);return db[_0xd7ac('0x44')]['find'](_0x40fdf7)[_0xd7ac('0x24')](handleEntityNotFound(_0x32d298,null))[_0xd7ac('0x24')](respondWithResult(_0x32d298,null))['catch'](handleError(_0x32d298,null));};exports[_0xd7ac('0x49')]=function(_0x5adbff,_0x363023){return db['SquareDetailsReport'][_0xd7ac('0x49')](_0x5adbff[_0xd7ac('0x4a')],{})[_0xd7ac('0x24')](respondWithResult(_0x363023,0xc9))[_0xd7ac('0x47')](handleError(_0x363023,null));};exports[_0xd7ac('0x4b')]=function(_0x3303df,_0x450035){if(_0x3303df['body']['id']){delete _0x3303df['body']['id'];}return db[_0xd7ac('0x44')][_0xd7ac('0x4c')]({'where':{'id':_0x3303df[_0xd7ac('0x4d')]['id']}})[_0xd7ac('0x24')](handleEntityNotFound(_0x450035,null))[_0xd7ac('0x24')](saveUpdates(_0x3303df['body'],null))[_0xd7ac('0x24')](respondWithResult(_0x450035,null))[_0xd7ac('0x47')](handleError(_0x450035,null));};exports[_0xd7ac('0x23')]=function(_0x29dbae,_0x3745e1){return db['SquareDetailsReport']['find']({'where':{'id':_0x29dbae[_0xd7ac('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3745e1,null))[_0xd7ac('0x24')](removeEntity(_0x3745e1,null))[_0xd7ac('0x47')](handleError(_0x3745e1,null));};exports[_0xd7ac('0x4e')]=function(_0x34a314,_0x5c6a65){return db['SquareDetailsReport'][_0xd7ac('0x4e')]()[_0xd7ac('0x24')](respondWithResult(_0x5c6a65,null))[_0xd7ac('0x47')](handleError(_0x5c6a65,null));};
\ No newline at end of file
index 693d8d2..f7cae4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x031d=['../../config/environment','./squareReportDetail.attributes','exports','report_square_details','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5ecac8,_0x246286){var _0x255862=function(_0x1a2d83){while(--_0x1a2d83){_0x5ecac8['push'](_0x5ecac8['shift']());}};_0x255862(++_0x246286);}(_0x031d,0x1c6));var _0xd031=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x031d[_0x578275];return _0xf78041;};'use strict';var _=require(_0xd031('0x0'));var util=require(_0xd031('0x1'));var logger=require(_0xd031('0x2'))(_0xd031('0x3'));var moment=require(_0xd031('0x4'));var BPromise=require(_0xd031('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd031('0x6'));var attributes=require(_0xd031('0x7'));module[_0xd031('0x8')]=function(_0x3da97e,_0x78bb7b){return _0x3da97e['define']('SquareDetailsReport',attributes,{'tableName':_0xd031('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x02f2=['../../config/logger','request-promise','path','define','report_square_details','lodash','util'];(function(_0x50922c,_0x4d29d6){var _0x523b1c=function(_0x481791){while(--_0x481791){_0x50922c['push'](_0x50922c['shift']());}};_0x523b1c(++_0x4d29d6);}(_0x02f2,0x19b));var _0x202f=function(_0x266dd5,_0x4f1248){_0x266dd5=_0x266dd5-0x0;var _0x4420f3=_0x02f2[_0x266dd5];return _0x4420f3;};'use strict';var _=require(_0x202f('0x0'));var util=require(_0x202f('0x1'));var logger=require(_0x202f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x202f('0x3'));var fs=require('fs');var path=require(_0x202f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x1656b6,_0x22ec7b){return _0x1656b6[_0x202f('0x5')]('SquareDetailsReport',attributes,{'tableName':_0x202f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 666ba3c..72853ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['options','raw','util','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body'];(function(_0x57230e,_0x3d28af){var _0x304c64=function(_0x213a33){while(--_0x213a33){_0x57230e['push'](_0x57230e['shift']());}};_0x304c64(++_0x3d28af);}(_0xda3f,0xec));var _0xfda3=function(_0x1d9c98,_0x3b4fac){_0x1d9c98=_0x1d9c98-0x0;var _0x336e28=_0xda3f[_0x1d9c98];return _0x336e28;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}exports[_0xfda3('0x14')]=function(_0x4680bf){var _0xc62ae6=this;return new Promise(function(_0x54a7c6,_0x15ddb9){return db[_0xfda3('0x15')][_0xfda3('0x16')](_0x4680bf[_0xfda3('0x17')],{'raw':_0x4680bf['options']?_0x4680bf[_0xfda3('0x18')][_0xfda3('0x19')]===undefined?!![]:![]:!![]})[_0xfda3('0x8')](function(_0x51e731){logger['info'](_0xfda3('0x14'),_0x4680bf);logger[_0xfda3('0xc')](_0xfda3('0x14'),_0x4680bf,JSON['stringify'](_0x51e731));_0x54a7c6(_0x51e731);})[_0xfda3('0x13')](function(_0xef2535){logger[_0xfda3('0xf')](_0xfda3('0x14'),_0xef2535[_0xfda3('0x11')],_0x4680bf);_0x15ddb9(_0xc62ae6[_0xfda3('0xf')](0x1f4,_0xef2535[_0xfda3('0x11')]));});});};
\ No newline at end of file
+var _0xa30a=['message','request\x20sent','CreateSquareDetailsReport','create','body','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['SquareDetailsReport'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![]})[_0xaa30('0xc')](function(_0x3e4f1d){logger[_0xaa30('0xd')](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x18')]('CreateSquareDetailsReport',_0x540e36,JSON[_0xaa30('0x10')](_0x3e4f1d));_0x53f9fd(_0x3e4f1d);})[_0xaa30('0x19')](function(_0x2e16e7){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x2e16e7['message'],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x2e16e7[_0xaa30('0x13')]));});});};
\ No newline at end of file
index 3d9f642..b57f8b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52eb=['killProcess','exports','Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated'];(function(_0x2a6398,_0x17fe47){var _0x11f5f8=function(_0x57aa84){while(--_0x57aa84){_0x2a6398['push'](_0x2a6398['shift']());}};_0x11f5f8(++_0x17fe47);}(_0x52eb,0xa2));var _0xb52e=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x52eb[_0x4d1ee9];return _0x9a5456;};'use strict';var express=require('express');var router=express[_0xb52e('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xb52e('0x1'));router[_0xb52e('0x2')]('/',auth['isAuthenticated'](),controller[_0xb52e('0x3')]);router[_0xb52e('0x2')](_0xb52e('0x4'),auth[_0xb52e('0x5')](),controller[_0xb52e('0x6')]);module[_0xb52e('0x7')]=router;
\ No newline at end of file
+var _0x7d5b=['isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service','get'];(function(_0x27e95b,_0x3b8302){var _0x827fb3=function(_0x422b29){while(--_0x422b29){_0x27e95b['push'](_0x27e95b['shift']());}};_0x827fb3(++_0x3b8302);}(_0x7d5b,0x1c7));var _0xb7d5=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x7d5b[_0x45783c];return _0x1161da;};'use strict';var express=require(_0xb7d5('0x0'));var router=express[_0xb7d5('0x1')]();var auth=require(_0xb7d5('0x2'));var controller=require('./system.controller');router[_0xb7d5('0x3')]('/',auth[_0xb7d5('0x4')](),controller[_0xb7d5('0x5')]);router['get'](_0xb7d5('0x6'),auth['isAuthenticated'](),controller[_0xb7d5('0x7')]);module[_0xb7d5('0x8')]=router;
\ No newline at end of file
index 11de7c2..e8809ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1809=['kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','exec','api','util','bluebird','lodash','inspect','status','send','index','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x3a0ed4,_0x5c9fe3){var _0x4805cf=function(_0x4ee1fc){while(--_0x4ee1fc){_0x3a0ed4['push'](_0x3a0ed4['shift']());}};_0x4805cf(++_0x5c9fe3);}(_0x1809,0x183));var _0x9180=function(_0x335161,_0x4ed3a7){_0x335161=_0x335161-0x0;var _0x2ff2e1=_0x1809[_0x335161];return _0x2ff2e1;};'use strict';var info=require(_0x9180('0x0'));var exec=require('child_process')[_0x9180('0x1')];var logger=require('../../config/logger')(_0x9180('0x2'));var util=require(_0x9180('0x3'));var BPromise=require(_0x9180('0x4'));var _=require(_0x9180('0x5'));function handleError(_0x5ea01e,_0x563e37,_0x2c082){_0x563e37=_0x563e37||0x1f4;return function(_0x3be5c8){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2c082,_0x563e37,util[_0x9180('0x6')](_0x3be5c8,{'showHidden':![],'depth':null}));delete _0x3be5c8['name'];_0x5ea01e[_0x9180('0x7')](_0x563e37)[_0x9180('0x8')](_0x3be5c8);};}exports[_0x9180('0x9')]=function(_0x4124f0,_0x1f7305){return info['getAllData']()['then'](function(_0x441f6c){return _0x1f7305[_0x9180('0x7')](0xc8)[_0x9180('0xa')](_0x441f6c);})['catch'](function(_0x58d11b){return _0x1f7305[_0x9180('0x7')](0x1f4)['json'](_0x58d11b);});};exports[_0x9180('0xb')]=function(_0xab26e8,_0x106740){var _0x1d166a=[_0x9180('0xc')];return new BPromise(function(_0x246c3c,_0x4c543d){return exec(util['format'](_0x9180('0xd'),_0xab26e8[_0x9180('0xe')][_0x9180('0xf')]),function(_0x417afc,_0x3db8a8,_0x5973d8){if(_0x417afc){return _0x4c543d(_0x417afc);}return _0x246c3c(_0x3db8a8);});})[_0x9180('0x10')](function(_0x3a5c0b){var _0x58de9e=![];var _0x14c3d2=_0x3a5c0b[_0x9180('0x11')](/\n/);for(var _0x505f4a=0x0,_0x4517e6=_0x1d166a['length'];_0x505f4a<_0x4517e6,_0x58de9e===![];_0x505f4a+=0x1){if(_0x3a5c0b[_0x9180('0x12')](_0x1d166a[_0x505f4a])>=0x0){_0x58de9e=!![];}}if(!_0x58de9e){throw new Error(util[_0x9180('0x13')](_0x9180('0x14'),_0xab26e8['params'][_0x9180('0xf')]));}process[_0x9180('0x15')](_0xab26e8[_0x9180('0xe')][_0x9180('0xf')],_0x9180('0x16'));return _0x106740['status'](0xc8)['json']({'message':util[_0x9180('0x13')](_0x9180('0x17'),_0xab26e8[_0x9180('0xe')]['pid'])});})['catch'](handleError(_0x106740,null,_0x9180('0xb')));};
\ No newline at end of file
+var _0x81d2=['pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','name','index','getAllData','then','status','json','killProcess','components/import/cm','format','params','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x44db68,_0x26fbd3){var _0x5165a9=function(_0x5decec){while(--_0x5decec){_0x44db68['push'](_0x44db68['shift']());}};_0x5165a9(++_0x26fbd3);}(_0x81d2,0xfe));var _0x281d=function(_0x24d593,_0x188576){_0x24d593=_0x24d593-0x0;var _0x514b11=_0x81d2[_0x24d593];return _0x514b11;};'use strict';var info=require(_0x281d('0x0'));var exec=require(_0x281d('0x1'))[_0x281d('0x2')];var logger=require(_0x281d('0x3'))(_0x281d('0x4'));var util=require('util');var BPromise=require(_0x281d('0x5'));var _=require(_0x281d('0x6'));function handleError(_0x2f115e,_0x401ce9,_0x2a19c4){_0x401ce9=_0x401ce9||0x1f4;return function(_0x5b91cb){logger[_0x281d('0x7')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x2a19c4,_0x401ce9,util['inspect'](_0x5b91cb,{'showHidden':![],'depth':null}));delete _0x5b91cb[_0x281d('0x8')];_0x2f115e['status'](_0x401ce9)['send'](_0x5b91cb);};}exports[_0x281d('0x9')]=function(_0x22c827,_0x4618ee){return info[_0x281d('0xa')]()[_0x281d('0xb')](function(_0x1b3983){return _0x4618ee[_0x281d('0xc')](0xc8)['json'](_0x1b3983);})['catch'](function(_0x426e52){return _0x4618ee[_0x281d('0xc')](0x1f4)[_0x281d('0xd')](_0x426e52);});};exports[_0x281d('0xe')]=function(_0x31f6f1,_0x465702){var _0xe7fe7=[_0x281d('0xf')];return new BPromise(function(_0x4a6c3c,_0x43a3fc){return exec(util[_0x281d('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x31f6f1[_0x281d('0x11')]['pid']),function(_0x59be32,_0x5b10ab,_0x3d8eca){if(_0x59be32){return _0x43a3fc(_0x59be32);}return _0x4a6c3c(_0x5b10ab);});})[_0x281d('0xb')](function(_0x4f1c2d){var _0x820d51=![];var _0x4d3eb3=_0x4f1c2d[_0x281d('0x12')](/\n/);for(var _0x536660=0x0,_0x103367=_0xe7fe7['length'];_0x536660<_0x103367,_0x820d51===![];_0x536660+=0x1){if(_0x4f1c2d[_0x281d('0x13')](_0xe7fe7[_0x536660])>=0x0){_0x820d51=!![];}}if(!_0x820d51){throw new Error(util['format'](_0x281d('0x14'),_0x31f6f1[_0x281d('0x11')][_0x281d('0x15')]));}process[_0x281d('0x16')](_0x31f6f1[_0x281d('0x11')][_0x281d('0x15')],'SIGINT');return _0x465702[_0x281d('0xc')](0xc8)[_0x281d('0xd')]({'message':util[_0x281d('0x10')](_0x281d('0x17'),_0x31f6f1[_0x281d('0x11')][_0x281d('0x15')])});})[_0x281d('0x18')](handleError(_0x465702,null,'killProcess'));};
\ No newline at end of file
index da4bcb1..7a2e48c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe083=['isAuthenticated','index','post','create','put','/:id','update','delete','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get'];(function(_0x37d214,_0x16f70){var _0x5bbf89=function(_0x1c3612){while(--_0x1c3612){_0x37d214['push'](_0x37d214['shift']());}};_0x5bbf89(++_0x16f70);}(_0xe083,0x1dc));var _0x3e08=function(_0x942858,_0xcee991){_0x942858=_0x942858-0x0;var _0x4d302b=_0xe083[_0x942858];return _0x4d302b;};'use strict';var multer=require(_0x3e08('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e08('0x1'));var express=require(_0x3e08('0x2'));var router=express[_0x3e08('0x3')]();var fs_extra=require(_0x3e08('0x4'));var auth=require(_0x3e08('0x5'));var interaction=require(_0x3e08('0x6'));var config=require(_0x3e08('0x7'));var controller=require(_0x3e08('0x8'));router[_0x3e08('0x9')]('/',auth[_0x3e08('0xa')](),controller[_0x3e08('0xb')]);router['get']('/:id',auth[_0x3e08('0xa')](),controller['show']);router[_0x3e08('0xc')]('/',auth[_0x3e08('0xa')](),controller[_0x3e08('0xd')]);router[_0x3e08('0xe')](_0x3e08('0xf'),auth[_0x3e08('0xa')](),controller[_0x3e08('0x10')]);router[_0x3e08('0x11')](_0x3e08('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x186d=['delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','index','get','/:id','show','post','isAuthenticated','put','update'];(function(_0x49481d,_0xd95b74){var _0x27dd6e=function(_0xee3740){while(--_0xee3740){_0x49481d['push'](_0x49481d['shift']());}};_0x27dd6e(++_0xd95b74);}(_0x186d,0x1ca));var _0xd186=function(_0x260073,_0xbe6af9){_0x260073=_0x260073-0x0;var _0x4ff033=_0x186d[_0x260073];return _0x4ff033;};'use strict';var multer=require('multer');var util=require(_0xd186('0x0'));var path=require(_0xd186('0x1'));var timeout=require(_0xd186('0x2'));var express=require(_0xd186('0x3'));var router=express[_0xd186('0x4')]();var fs_extra=require(_0xd186('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd186('0x6'));var config=require(_0xd186('0x7'));var controller=require(_0xd186('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd186('0x9')]);router[_0xd186('0xa')](_0xd186('0xb'),auth['isAuthenticated'](),controller[_0xd186('0xc')]);router[_0xd186('0xd')]('/',auth[_0xd186('0xe')](),controller['create']);router[_0xd186('0xf')](_0xd186('0xb'),auth[_0xd186('0xe')](),controller[_0xd186('0x10')]);router[_0xd186('0x11')](_0xd186('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xd186('0x12')]=router;
\ No newline at end of file
index b1b8883..0b22beb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e44=['sequelize','exports','STRING','#0091EA'];(function(_0x1f1816,_0x2031e2){var _0x4f4cc9=function(_0x28fb7d){while(--_0x28fb7d){_0x1f1816['push'](_0x1f1816['shift']());}};_0x4f4cc9(++_0x2031e2);}(_0x8e44,0x1ac));var _0x48e4=function(_0x517082,_0xc70ef9){_0x517082=_0x517082-0x0;var _0x560118=_0x8e44[_0x517082];return _0x560118;};'use strict';var Sequelize=require(_0x48e4('0x0'));module[_0x48e4('0x1')]={'name':{'type':Sequelize[_0x48e4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x48e4('0x3')},'description':{'type':Sequelize[_0x48e4('0x2')]}};
\ No newline at end of file
+var _0x5b12=['STRING','sequelize','exports'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x5b12,0xa3));var _0x25b1=function(_0x59e727,_0x555328){_0x59e727=_0x59e727-0x0;var _0x427e82=_0x5b12[_0x59e727];return _0x427e82;};'use strict';var Sequelize=require(_0x25b1('0x0'));module[_0x25b1('0x1')]={'name':{'type':Sequelize[_0x25b1('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x25b1('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x25b1('0x2')]}};
\ No newline at end of file
index 7e6925a..23a4047 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9099=['includeAll','findAll','rows','catch','show','keys','length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','then','get','Tags','destroy','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x407d07,_0x515a81){var _0x562ae8=function(_0x1426d0){while(--_0x1426d0){_0x407d07['push'](_0x407d07['shift']());}};_0x562ae8(++_0x515a81);}(_0x9099,0x1ac));var _0x9909=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x9099[_0x2405bc];return _0x5272d4;};'use strict';var emlformat=require(_0x9909('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9909('0x1'));var jsonpatch=require(_0x9909('0x2'));var rp=require(_0x9909('0x3'));var moment=require(_0x9909('0x4'));var BPromise=require(_0x9909('0x5'));var Mustache=require(_0x9909('0x6'));var util=require(_0x9909('0x7'));var path=require(_0x9909('0x8'));var sox=require(_0x9909('0x9'));var csv=require(_0x9909('0xa'));var ejs=require(_0x9909('0xb'));var fs=require('fs');var fs_extra=require(_0x9909('0xc'));var _=require(_0x9909('0xd'));var squel=require(_0x9909('0xe'));var crypto=require('crypto');var jsforce=require(_0x9909('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9909('0x11'));var as=require(_0x9909('0x12'));var hardwareService=require(_0x9909('0x13'));var logger=require('../../config/logger')(_0x9909('0x14'));var utils=require('../../config/utils');var config=require(_0x9909('0x15'));var licenseUtil=require(_0x9909('0x16'));var db=require(_0x9909('0x17'))['db'];function respondWithStatusCode(_0x3ba080,_0x1c69bb){_0x1c69bb=_0x1c69bb||0xcc;return function(_0x5cc11e){if(_0x5cc11e){return _0x3ba080[_0x9909('0x18')](_0x1c69bb);}return _0x3ba080[_0x9909('0x19')](_0x1c69bb)[_0x9909('0x1a')]();};}function respondWithResult(_0xef3295,_0x1c2668){_0x1c2668=_0x1c2668||0xc8;return function(_0x38c2e3){if(_0x38c2e3){return _0xef3295[_0x9909('0x19')](_0x1c2668)['json'](_0x38c2e3);}};}function respondWithFilteredResult(_0x33a8e3,_0x55e800){return function(_0x1f32cc){if(_0x1f32cc){var _0x5bd7e7=typeof _0x55e800[_0x9909('0x1b')]===_0x9909('0x1c')&&typeof _0x55e800[_0x9909('0x1d')]==='undefined';var _0x9a16a6=_0x1f32cc[_0x9909('0x1e')];var _0x180929=_0x5bd7e7?0x0:_0x55e800[_0x9909('0x1b')];var _0x1106e5=_0x5bd7e7?_0x1f32cc[_0x9909('0x1e')]:_0x55e800[_0x9909('0x1b')]+_0x55e800['limit'];var _0x1b038f;if(_0x1106e5>=_0x9a16a6){_0x1106e5=_0x9a16a6;_0x1b038f=0xc8;}else{_0x1b038f=0xce;}_0x33a8e3[_0x9909('0x19')](_0x1b038f);return _0x33a8e3['set'](_0x9909('0x1f'),_0x180929+'-'+_0x1106e5+'/'+_0x9a16a6)[_0x9909('0x20')](_0x1f32cc);}return null;};}function patchUpdates(_0x20c236){return function(_0x1553ae){try{jsonpatch[_0x9909('0x21')](_0x1553ae,_0x20c236,!![]);}catch(_0x222cd9){return BPromise[_0x9909('0x22')](_0x222cd9);}return _0x1553ae['save']();};}function saveUpdates(_0x112727,_0x319c31){return function(_0x4a626b){if(_0x4a626b){return _0x4a626b['update'](_0x112727)[_0x9909('0x23')](function(_0x176593){return _0x176593;});}return null;};}function removeEntity(_0xdd5088,_0x19e66b){return function(_0x2f15fa){if(_0x2f15fa){return _0x2f15fa['destroy']()['then'](function(){var _0x2d83a5=_0x2f15fa[_0x9909('0x24')]({'plain':!![]});var _0x614308=_0x9909('0x25');return db['UserProfileResource'][_0x9909('0x26')]({'where':{'type':_0x614308,'resourceId':_0x2d83a5['id']}})[_0x9909('0x23')](function(){return _0x2f15fa;});})[_0x9909('0x23')](function(){_0xdd5088[_0x9909('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x405c5e,_0x22ff12){return function(_0x19c7e8){if(!_0x19c7e8){_0x405c5e[_0x9909('0x18')](0x194);}return _0x19c7e8;};}function handleError(_0x5250d8,_0xb0b66f){_0xb0b66f=_0xb0b66f||0x1f4;return function(_0x175d52){logger[_0x9909('0x27')](_0x175d52[_0x9909('0x28')]);if(_0x175d52[_0x9909('0x29')]){delete _0x175d52[_0x9909('0x29')];}_0x5250d8[_0x9909('0x19')](_0xb0b66f)['send'](_0x175d52);};}exports[_0x9909('0x2a')]=function(_0x3a3f4f,_0x87ac8a){var _0x42f1e5={},_0x3e4e07={},_0x519066={'count':0x0,'rows':[]};var _0x4245eb=_[_0x9909('0x2b')](db[_0x9909('0x2c')][_0x9909('0x2d')],function(_0xc1bd06){return{'name':_0xc1bd06[_0x9909('0x2e')],'type':_0xc1bd06[_0x9909('0x2f')][_0x9909('0x30')]};});_0x3e4e07['model']=_['map'](_0x4245eb,_0x9909('0x29'));_0x3e4e07[_0x9909('0x31')]=_['keys'](_0x3a3f4f[_0x9909('0x31')]);_0x3e4e07[_0x9909('0x32')]=_[_0x9909('0x33')](_0x3e4e07[_0x9909('0x34')],_0x3e4e07[_0x9909('0x31')]);_0x42f1e5[_0x9909('0x35')]=_[_0x9909('0x33')](_0x3e4e07['model'],qs[_0x9909('0x36')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x36')]));_0x42f1e5[_0x9909('0x35')]=_0x42f1e5[_0x9909('0x35')]['length']?_0x42f1e5[_0x9909('0x35')]:_0x3e4e07[_0x9909('0x34')];if(!_0x3a3f4f['query'][_0x9909('0x37')](_0x9909('0x38'))){_0x42f1e5[_0x9909('0x1d')]=qs[_0x9909('0x1d')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x1d')]);_0x42f1e5['offset']=qs[_0x9909('0x1b')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x1b')]);}_0x42f1e5[_0x9909('0x39')]=qs[_0x9909('0x3a')](_0x3a3f4f[_0x9909('0x31')][_0x9909('0x3a')]);_0x42f1e5[_0x9909('0x3b')]=qs[_0x9909('0x32')](_[_0x9909('0x3c')](_0x3a3f4f[_0x9909('0x31')],_0x3e4e07[_0x9909('0x32')]),_0x4245eb);if(_0x3a3f4f[_0x9909('0x31')][_0x9909('0x3d')]){_0x42f1e5[_0x9909('0x3b')]=_[_0x9909('0x3e')](_0x42f1e5[_0x9909('0x3b')],{'$or':_[_0x9909('0x2b')](_0x4245eb,function(_0x1b5e2b){if(_0x1b5e2b[_0x9909('0x2f')]!==_0x9909('0x3f')){var _0x1b224d={};_0x1b224d[_0x1b5e2b[_0x9909('0x29')]]={'$like':'%'+_0x3a3f4f['query']['filter']+'%'};return _0x1b224d;}})});}_0x42f1e5=_[_0x9909('0x3e')]({},_0x42f1e5,_0x3a3f4f['options']);var _0x52724f={'where':_0x42f1e5[_0x9909('0x3b')]};return db[_0x9909('0x2c')][_0x9909('0x1e')](_0x52724f)[_0x9909('0x23')](function(_0x556fad){_0x519066[_0x9909('0x1e')]=_0x556fad;if(_0x3a3f4f[_0x9909('0x31')][_0x9909('0x40')]){_0x42f1e5['include']=[{'all':!![]}];}return db[_0x9909('0x2c')][_0x9909('0x41')](_0x42f1e5);})[_0x9909('0x23')](function(_0x4b0a4c){_0x519066[_0x9909('0x42')]=_0x4b0a4c;return _0x519066;})[_0x9909('0x23')](respondWithFilteredResult(_0x87ac8a,_0x42f1e5))[_0x9909('0x43')](handleError(_0x87ac8a,null));};exports[_0x9909('0x44')]=function(_0x1f57bd,_0x856057){var _0xef5aa6={'raw':!![],'where':{'id':_0x1f57bd['params']['id']}},_0x3b1844={};_0x3b1844[_0x9909('0x34')]=_[_0x9909('0x45')](db['Tag'][_0x9909('0x2d')]);_0x3b1844[_0x9909('0x31')]=_['keys'](_0x1f57bd['query']);_0x3b1844[_0x9909('0x32')]=_[_0x9909('0x33')](_0x3b1844[_0x9909('0x34')],_0x3b1844[_0x9909('0x31')]);_0xef5aa6[_0x9909('0x35')]=_[_0x9909('0x33')](_0x3b1844[_0x9909('0x34')],qs[_0x9909('0x36')](_0x1f57bd[_0x9909('0x31')][_0x9909('0x36')]));_0xef5aa6['attributes']=_0xef5aa6[_0x9909('0x35')][_0x9909('0x46')]?_0xef5aa6[_0x9909('0x35')]:_0x3b1844[_0x9909('0x34')];if(_0x1f57bd['query']['includeAll']){_0xef5aa6[_0x9909('0x47')]=[{'all':!![]}];}_0xef5aa6=_['merge']({},_0xef5aa6,_0x1f57bd[_0x9909('0x48')]);return db[_0x9909('0x2c')][_0x9909('0x49')](_0xef5aa6)['then'](handleEntityNotFound(_0x856057,null))[_0x9909('0x23')](respondWithResult(_0x856057,null))[_0x9909('0x43')](handleError(_0x856057,null));};exports[_0x9909('0x4a')]=function(_0x54152c,_0x271984){return db[_0x9909('0x2c')][_0x9909('0x4a')](_0x54152c[_0x9909('0x4b')],{})[_0x9909('0x23')](function(_0x137fb6){var _0x8fbd0c=_0x54152c['user'][_0x9909('0x24')]({'plain':!![]});if(!_0x8fbd0c)throw new Error(_0x9909('0x4c'));if(_0x8fbd0c['role']===_0x9909('0x4d')){var _0x240947=_0x137fb6[_0x9909('0x24')]({'plain':!![]});var _0x37697d=_0x9909('0x25');return db['UserProfileSection'][_0x9909('0x49')]({'where':{'name':_0x37697d,'userProfileId':_0x8fbd0c['userProfileId']},'raw':!![]})[_0x9909('0x23')](function(_0x159e08){if(_0x159e08&&_0x159e08[_0x9909('0x4e')]===0x0){return db[_0x9909('0x4f')][_0x9909('0x4a')]({'name':_0x240947[_0x9909('0x29')],'resourceId':_0x240947['id'],'type':_0x159e08[_0x9909('0x29')],'sectionId':_0x159e08['id']},{})[_0x9909('0x23')](function(){return _0x137fb6;});}else{return _0x137fb6;}})['catch'](function(_0x51b214){logger[_0x9909('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51b214);throw _0x51b214;});}return _0x137fb6;})['then'](respondWithResult(_0x271984,0xc9))[_0x9909('0x43')](handleError(_0x271984,null));};exports[_0x9909('0x50')]=function(_0x49659a,_0x1144e0){if(_0x49659a[_0x9909('0x4b')]['id']){delete _0x49659a[_0x9909('0x4b')]['id'];}return db[_0x9909('0x2c')][_0x9909('0x49')]({'where':{'id':_0x49659a[_0x9909('0x51')]['id']}})['then'](handleEntityNotFound(_0x1144e0,null))[_0x9909('0x23')](saveUpdates(_0x49659a[_0x9909('0x4b')],null))['then'](respondWithResult(_0x1144e0,null))['catch'](handleError(_0x1144e0,null));};exports[_0x9909('0x26')]=function(_0x508b6a,_0x180cf5){return db[_0x9909('0x2c')][_0x9909('0x49')]({'where':{'id':_0x508b6a[_0x9909('0x51')]['id']}})['then'](handleEntityNotFound(_0x180cf5,null))['then'](removeEntity(_0x180cf5,null))['catch'](handleError(_0x180cf5,null));};
\ No newline at end of file
+var _0xbec5=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','name','send','index','map','Tag','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','filter','where','options','includeAll','include','catch','show','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0xe68117,_0x1d113f){var _0x3aa731=function(_0x3bc643){while(--_0x3bc643){_0xe68117['push'](_0xe68117['shift']());}};_0x3aa731(++_0x1d113f);}(_0xbec5,0xe5));var _0x5bec=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0xbec5[_0xdf3db6];return _0x4b7a65;};'use strict';var emlformat=require(_0x5bec('0x0'));var rimraf=require(_0x5bec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5bec('0x2'));var rp=require(_0x5bec('0x3'));var moment=require(_0x5bec('0x4'));var BPromise=require(_0x5bec('0x5'));var Mustache=require(_0x5bec('0x6'));var util=require('util');var path=require(_0x5bec('0x7'));var sox=require(_0x5bec('0x8'));var csv=require(_0x5bec('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5bec('0xa'));var _=require(_0x5bec('0xb'));var squel=require(_0x5bec('0xc'));var crypto=require(_0x5bec('0xd'));var jsforce=require(_0x5bec('0xe'));var deskjs=require(_0x5bec('0xf'));var toCsv=require(_0x5bec('0x9'));var querystring=require(_0x5bec('0x10'));var Papa=require('papaparse');var Redis=require(_0x5bec('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5bec('0x12'));var as=require(_0x5bec('0x13'));var hardwareService=require(_0x5bec('0x14'));var logger=require('../../config/logger')(_0x5bec('0x15'));var utils=require(_0x5bec('0x16'));var config=require(_0x5bec('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5bec('0x18'))['db'];function respondWithStatusCode(_0x1c888f,_0x589d14){_0x589d14=_0x589d14||0xcc;return function(_0x2d2ba2){if(_0x2d2ba2){return _0x1c888f[_0x5bec('0x19')](_0x589d14);}return _0x1c888f[_0x5bec('0x1a')](_0x589d14)[_0x5bec('0x1b')]();};}function respondWithResult(_0x3198e0,_0xcd6d90){_0xcd6d90=_0xcd6d90||0xc8;return function(_0x24dcd6){if(_0x24dcd6){return _0x3198e0[_0x5bec('0x1a')](_0xcd6d90)[_0x5bec('0x1c')](_0x24dcd6);}};}function respondWithFilteredResult(_0x3ebc41,_0x31b9e4){return function(_0x325daf){if(_0x325daf){var _0x11fb8e=typeof _0x31b9e4['offset']==='undefined'&&typeof _0x31b9e4[_0x5bec('0x1d')]===_0x5bec('0x1e');var _0x31ad9c=_0x325daf[_0x5bec('0x1f')];var _0x5cd7ae=_0x11fb8e?0x0:_0x31b9e4['offset'];var _0x3cd354=_0x11fb8e?_0x325daf[_0x5bec('0x1f')]:_0x31b9e4['offset']+_0x31b9e4[_0x5bec('0x1d')];var _0xa7e223;if(_0x3cd354>=_0x31ad9c){_0x3cd354=_0x31ad9c;_0xa7e223=0xc8;}else{_0xa7e223=0xce;}_0x3ebc41[_0x5bec('0x1a')](_0xa7e223);return _0x3ebc41[_0x5bec('0x20')]('Content-Range',_0x5cd7ae+'-'+_0x3cd354+'/'+_0x31ad9c)[_0x5bec('0x1c')](_0x325daf);}return null;};}function patchUpdates(_0x5be91c){return function(_0x191c0f){try{jsonpatch[_0x5bec('0x21')](_0x191c0f,_0x5be91c,!![]);}catch(_0x3e1896){return BPromise[_0x5bec('0x22')](_0x3e1896);}return _0x191c0f[_0x5bec('0x23')]();};}function saveUpdates(_0x5e154e,_0x232584){return function(_0x4cfcb8){if(_0x4cfcb8){return _0x4cfcb8[_0x5bec('0x24')](_0x5e154e)[_0x5bec('0x25')](function(_0x5b2636){return _0x5b2636;});}return null;};}function removeEntity(_0xa414f8,_0xbef70b){return function(_0x4e0ca2){if(_0x4e0ca2){return _0x4e0ca2[_0x5bec('0x26')]()[_0x5bec('0x25')](function(){var _0x43d460=_0x4e0ca2[_0x5bec('0x27')]({'plain':!![]});var _0x226d55=_0x5bec('0x28');return db[_0x5bec('0x29')]['destroy']({'where':{'type':_0x226d55,'resourceId':_0x43d460['id']}})['then'](function(){return _0x4e0ca2;});})['then'](function(){_0xa414f8[_0x5bec('0x1a')](0xcc)[_0x5bec('0x1b')]();});}};}function handleEntityNotFound(_0x338c25,_0x4939a5){return function(_0x2b3b2c){if(!_0x2b3b2c){_0x338c25[_0x5bec('0x19')](0x194);}return _0x2b3b2c;};}function handleError(_0x57331b,_0x29e358){_0x29e358=_0x29e358||0x1f4;return function(_0x63ac8){logger['error'](_0x63ac8['stack']);if(_0x63ac8[_0x5bec('0x2a')]){delete _0x63ac8[_0x5bec('0x2a')];}_0x57331b[_0x5bec('0x1a')](_0x29e358)[_0x5bec('0x2b')](_0x63ac8);};}exports[_0x5bec('0x2c')]=function(_0x3f224c,_0x5d6621){var _0x2987ca={},_0x59b5b6={},_0x45863b={'count':0x0,'rows':[]};var _0xafbd94=_[_0x5bec('0x2d')](db[_0x5bec('0x2e')]['rawAttributes'],function(_0x2b42c8){return{'name':_0x2b42c8[_0x5bec('0x2f')],'type':_0x2b42c8[_0x5bec('0x30')]['key']};});_0x59b5b6[_0x5bec('0x31')]=_['map'](_0xafbd94,_0x5bec('0x2a'));_0x59b5b6[_0x5bec('0x32')]=_[_0x5bec('0x33')](_0x3f224c['query']);_0x59b5b6[_0x5bec('0x34')]=_[_0x5bec('0x35')](_0x59b5b6['model'],_0x59b5b6[_0x5bec('0x32')]);_0x2987ca[_0x5bec('0x36')]=_[_0x5bec('0x35')](_0x59b5b6[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x3f224c['query'][_0x5bec('0x37')]));_0x2987ca['attributes']=_0x2987ca[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2987ca[_0x5bec('0x36')]:_0x59b5b6[_0x5bec('0x31')];if(!_0x3f224c[_0x5bec('0x32')][_0x5bec('0x39')]('nolimit')){_0x2987ca[_0x5bec('0x1d')]=qs[_0x5bec('0x1d')](_0x3f224c[_0x5bec('0x32')]['limit']);_0x2987ca[_0x5bec('0x3a')]=qs[_0x5bec('0x3a')](_0x3f224c['query'][_0x5bec('0x3a')]);}_0x2987ca['order']=qs[_0x5bec('0x3b')](_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3b')]);_0x2987ca['where']=qs[_0x5bec('0x34')](_[_0x5bec('0x3c')](_0x3f224c[_0x5bec('0x32')],_0x59b5b6[_0x5bec('0x34')]),_0xafbd94);if(_0x3f224c[_0x5bec('0x32')][_0x5bec('0x3d')]){_0x2987ca[_0x5bec('0x3e')]=_['merge'](_0x2987ca[_0x5bec('0x3e')],{'$or':_[_0x5bec('0x2d')](_0xafbd94,function(_0x323812){if(_0x323812[_0x5bec('0x30')]!=='VIRTUAL'){var _0x27863b={};_0x27863b[_0x323812[_0x5bec('0x2a')]]={'$like':'%'+_0x3f224c[_0x5bec('0x32')]['filter']+'%'};return _0x27863b;}})});}_0x2987ca=_['merge']({},_0x2987ca,_0x3f224c[_0x5bec('0x3f')]);var _0x153d02={'where':_0x2987ca[_0x5bec('0x3e')]};return db[_0x5bec('0x2e')][_0x5bec('0x1f')](_0x153d02)['then'](function(_0x4fee8a){_0x45863b[_0x5bec('0x1f')]=_0x4fee8a;if(_0x3f224c['query'][_0x5bec('0x40')]){_0x2987ca[_0x5bec('0x41')]=[{'all':!![]}];}return db[_0x5bec('0x2e')]['findAll'](_0x2987ca);})[_0x5bec('0x25')](function(_0x26a4a5){_0x45863b['rows']=_0x26a4a5;return _0x45863b;})[_0x5bec('0x25')](respondWithFilteredResult(_0x5d6621,_0x2987ca))[_0x5bec('0x42')](handleError(_0x5d6621,null));};exports[_0x5bec('0x43')]=function(_0x2b51f7,_0x3b5631){var _0x2724cf={'raw':!![],'where':{'id':_0x2b51f7['params']['id']}},_0x3a795c={};_0x3a795c['model']=_[_0x5bec('0x33')](db['Tag']['rawAttributes']);_0x3a795c[_0x5bec('0x32')]=_['keys'](_0x2b51f7['query']);_0x3a795c['filters']=_[_0x5bec('0x35')](_0x3a795c[_0x5bec('0x31')],_0x3a795c[_0x5bec('0x32')]);_0x2724cf[_0x5bec('0x36')]=_['intersection'](_0x3a795c[_0x5bec('0x31')],qs[_0x5bec('0x37')](_0x2b51f7[_0x5bec('0x32')][_0x5bec('0x37')]));_0x2724cf['attributes']=_0x2724cf[_0x5bec('0x36')][_0x5bec('0x38')]?_0x2724cf[_0x5bec('0x36')]:_0x3a795c['model'];if(_0x2b51f7[_0x5bec('0x32')]['includeAll']){_0x2724cf[_0x5bec('0x41')]=[{'all':!![]}];}_0x2724cf=_[_0x5bec('0x44')]({},_0x2724cf,_0x2b51f7[_0x5bec('0x3f')]);return db[_0x5bec('0x2e')]['find'](_0x2724cf)[_0x5bec('0x25')](handleEntityNotFound(_0x3b5631,null))[_0x5bec('0x25')](respondWithResult(_0x3b5631,null))[_0x5bec('0x42')](handleError(_0x3b5631,null));};exports[_0x5bec('0x45')]=function(_0x35b250,_0x123758){return db[_0x5bec('0x2e')]['create'](_0x35b250[_0x5bec('0x46')],{})[_0x5bec('0x25')](function(_0x5775ca){var _0x273e09=_0x35b250[_0x5bec('0x47')][_0x5bec('0x27')]({'plain':!![]});if(!_0x273e09)throw new Error(_0x5bec('0x48'));if(_0x273e09[_0x5bec('0x49')]===_0x5bec('0x47')){var _0x3545a5=_0x5775ca['get']({'plain':!![]});var _0x101dcb='Tags';return db[_0x5bec('0x4a')][_0x5bec('0x4b')]({'where':{'name':_0x101dcb,'userProfileId':_0x273e09[_0x5bec('0x4c')]},'raw':!![]})[_0x5bec('0x25')](function(_0x158e8e){if(_0x158e8e&&_0x158e8e[_0x5bec('0x4d')]===0x0){return db[_0x5bec('0x29')][_0x5bec('0x45')]({'name':_0x3545a5[_0x5bec('0x2a')],'resourceId':_0x3545a5['id'],'type':_0x158e8e[_0x5bec('0x2a')],'sectionId':_0x158e8e['id']},{})['then'](function(){return _0x5775ca;});}else{return _0x5775ca;}})[_0x5bec('0x42')](function(_0x51af88){logger['error'](_0x5bec('0x4e'),_0x51af88);throw _0x51af88;});}return _0x5775ca;})['then'](respondWithResult(_0x123758,0xc9))['catch'](handleError(_0x123758,null));};exports[_0x5bec('0x24')]=function(_0x2114e5,_0x416058){if(_0x2114e5['body']['id']){delete _0x2114e5[_0x5bec('0x46')]['id'];}return db[_0x5bec('0x2e')][_0x5bec('0x4b')]({'where':{'id':_0x2114e5[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x416058,null))[_0x5bec('0x25')](saveUpdates(_0x2114e5[_0x5bec('0x46')],null))[_0x5bec('0x25')](respondWithResult(_0x416058,null))[_0x5bec('0x42')](handleError(_0x416058,null));};exports[_0x5bec('0x26')]=function(_0x3ddf28,_0x33b924){return db['Tag']['find']({'where':{'id':_0x3ddf28[_0x5bec('0x4f')]['id']}})['then'](handleEntityNotFound(_0x33b924,null))[_0x5bec('0x25')](removeEntity(_0x33b924,null))[_0x5bec('0x42')](handleError(_0x33b924,null));};
\ No newline at end of file
index cb2e57a..02e02d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757f=['./tag.attributes','define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x757f,0xee));var _0xf757=function(_0x32be82,_0x21b592){_0x32be82=_0x32be82-0x0;var _0x35aa04=_0x757f[_0x32be82];return _0x35aa04;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var logger=require(_0xf757('0x1'))(_0xf757('0x2'));var moment=require(_0xf757('0x3'));var BPromise=require(_0xf757('0x4'));var rp=require(_0xf757('0x5'));var fs=require('fs');var path=require(_0xf757('0x6'));var rimraf=require(_0xf757('0x7'));var config=require(_0xf757('0x8'));var attributes=require(_0xf757('0x9'));module['exports']=function(_0x36b04b,_0x30ccea){return _0x36b04b[_0xf757('0xa')](_0xf757('0xb'),attributes,{'tableName':_0xf757('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7136=['tools_tags','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x5c813a,_0x1ec52c){var _0xe55f5b=function(_0x1cdf37){while(--_0x1cdf37){_0x5c813a['push'](_0x5c813a['shift']());}};_0xe55f5b(++_0x1ec52c);}(_0x7136,0x90));var _0x6713=function(_0x52ce8e,_0x4dacf5){_0x52ce8e=_0x52ce8e-0x0;var _0x489cf9=_0x7136[_0x52ce8e];return _0x489cf9;};'use strict';var _=require('lodash');var util=require(_0x6713('0x0'));var logger=require(_0x6713('0x1'))(_0x6713('0x2'));var moment=require('moment');var BPromise=require(_0x6713('0x3'));var rp=require(_0x6713('0x4'));var fs=require('fs');var path=require(_0x6713('0x5'));var rimraf=require(_0x6713('0x6'));var config=require(_0x6713('0x7'));var attributes=require(_0x6713('0x8'));module[_0x6713('0x9')]=function(_0x13adc7,_0x3b3523){return _0x13adc7[_0x6713('0xa')](_0x6713('0xb'),attributes,{'tableName':_0x6713('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 34cba79..91db748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3937=['error','code','Tag,\x20%s,\x20%s','message','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x225b4b,_0xf57141){var _0x256965=function(_0x44fd7e){while(--_0x44fd7e){_0x225b4b['push'](_0x225b4b['shift']());}};_0x256965(++_0xf57141);}(_0x3937,0xbf));var _0x7393=function(_0x18cd3c,_0x44f48f){_0x18cd3c=_0x18cd3c-0x0;var _0x49af3e=_0x3937[_0x18cd3c];return _0x49af3e;};'use strict';var _=require(_0x7393('0x0'));var util=require('util');var moment=require(_0x7393('0x1'));var BPromise=require(_0x7393('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7393('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7393('0x4'));var logger=require('../../config/logger')(_0x7393('0x5'));var config=require(_0x7393('0x6'));var jayson=require(_0x7393('0x7'));var client=jayson[_0x7393('0x8')][_0x7393('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42bdd1,_0x3f0800,_0x26668a){return new BPromise(function(_0x944b0b,_0x4efb50){return client['request'](_0x42bdd1,_0x26668a)[_0x7393('0xa')](function(_0x3b7bbc){logger[_0x7393('0xb')]('Tag,\x20%s,\x20%s',_0x3f0800,_0x7393('0xc'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x3f0800,'request\x20sent',JSON['stringify'](_0x3b7bbc));if(_0x3b7bbc[_0x7393('0xd')]){if(_0x3b7bbc[_0x7393('0xd')][_0x7393('0xe')]===0x1f4){logger['error'](_0x7393('0xf'),_0x3f0800,_0x3b7bbc[_0x7393('0xd')][_0x7393('0x10')]);return _0x4efb50(_0x3b7bbc[_0x7393('0xd')][_0x7393('0x10')]);}logger[_0x7393('0xd')](_0x7393('0xf'),_0x3f0800,_0x3b7bbc[_0x7393('0xd')][_0x7393('0x10')]);return _0x944b0b(_0x3b7bbc['error']['message']);}else{logger[_0x7393('0xb')]('Tag,\x20%s,\x20%s',_0x3f0800,'request\x20sent');_0x944b0b(_0x3b7bbc['result'][_0x7393('0x10')]);}})['catch'](function(_0x2a1180){logger[_0x7393('0xd')]('Tag,\x20%s,\x20%s',_0x3f0800,_0x2a1180);_0x4efb50(_0x2a1180);});});}
\ No newline at end of file
+var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Tag,\x20%s,\x20%s','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x15ef34,_0x300c6b){var _0x31dc49=function(_0x10d6b1){while(--_0x10d6b1){_0x15ef34['push'](_0x15ef34['shift']());}};_0x31dc49(++_0x300c6b);}(_0x9f62,0x154));var _0x29f6=function(_0x5caa93,_0x4863ba){_0x5caa93=_0x5caa93-0x0;var _0x2157dd=_0x9f62[_0x5caa93];return _0x2157dd;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x272876,_0x9a43fe,_0x2ba602){return new BPromise(function(_0x416c6c,_0x5e9945){return client['request'](_0x272876,_0x2ba602)['then'](function(_0x549f64){logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,'request\x20sent');logger['debug'](_0x29f6('0xb'),_0x9a43fe,_0x29f6('0xc'),JSON['stringify'](_0x549f64));if(_0x549f64[_0x29f6('0xd')]){if(_0x549f64[_0x29f6('0xd')]['code']===0x1f4){logger['error']('Tag,\x20%s,\x20%s',_0x9a43fe,_0x549f64['error'][_0x29f6('0xe')]);return _0x5e9945(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}logger[_0x29f6('0xd')](_0x29f6('0xa'),_0x9a43fe,_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);return _0x416c6c(_0x549f64[_0x29f6('0xd')][_0x29f6('0xe')]);}else{logger[_0x29f6('0x9')](_0x29f6('0xa'),_0x9a43fe,_0x29f6('0xc'));_0x416c6c(_0x549f64[_0x29f6('0xf')][_0x29f6('0xe')]);}})[_0x29f6('0x10')](function(_0x14dd56){logger[_0x29f6('0xd')]('Tag,\x20%s,\x20%s',_0x9a43fe,_0x14dd56);_0x5e9945(_0x14dd56);});});}
\ No newline at end of file
index a26b75b..77d3ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 17adf77..377c25a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','name'];(function(_0x20ec6e,_0x3286ea){var _0x3c6ca=function(_0x3e4791){while(--_0x3e4791){_0x20ec6e['push'](_0x20ec6e['shift']());}};_0x3c6ca(++_0x3286ea);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x578bb4,_0x51668c){var _0x1604d2=function(_0x218f9f){while(--_0x218f9f){_0x578bb4['push'](_0x578bb4['shift']());}};_0x1604d2(++_0x51668c);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 96da38b..6cc84c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f0=['toLowerCase','Queues','addQueues','Sequelize','add','ids','removeQueues','remove','addAgents','Chat','Sms','Fax','Whatsapp','transaction','Voice','through','TeamVoiceQueue','penalty','User','findOrCreate','emit','Queue:save','QueueId','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','Mail','Openchannel','sequelize','parse','removeAgents','getAgents','eml-format','zip-dir','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/utils','../../config/license/util','redis','defaults','localhost','register','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','get','Teams','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','Team','findAll','rows','catch','params','includeAll','include','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','Queue','order','pick','capitalize'];(function(_0x3d2511,_0x2938e7){var _0x1cc3c0=function(_0x113bd2){while(--_0x113bd2){_0x3d2511['push'](_0x3d2511['shift']());}};_0x1cc3c0(++_0x2938e7);}(_0xa3f0,0x1ad));var _0x0a3f=function(_0x26e3cb,_0x3e38c3){_0x26e3cb=_0x26e3cb-0x0;var _0x15e990=_0xa3f0[_0x26e3cb];return _0x15e990;};'use strict';var emlformat=require(_0x0a3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0a3f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a3f('0x2'));var moment=require(_0x0a3f('0x3'));var BPromise=require(_0x0a3f('0x4'));var Mustache=require(_0x0a3f('0x5'));var util=require(_0x0a3f('0x6'));var path=require(_0x0a3f('0x7'));var sox=require('sox');var csv=require(_0x0a3f('0x8'));var ejs=require(_0x0a3f('0x9'));var fs=require('fs');var fs_extra=require(_0x0a3f('0xa'));var _=require(_0x0a3f('0xb'));var squel=require(_0x0a3f('0xc'));var crypto=require(_0x0a3f('0xd'));var jsforce=require(_0x0a3f('0xe'));var deskjs=require(_0x0a3f('0xf'));var toCsv=require(_0x0a3f('0x8'));var querystring=require(_0x0a3f('0x10'));var Papa=require(_0x0a3f('0x11'));var Redis=require(_0x0a3f('0x12'));var authService=require(_0x0a3f('0x13'));var qs=require(_0x0a3f('0x14'));var as=require(_0x0a3f('0x15'));var hardwareService=require(_0x0a3f('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x0a3f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0a3f('0x18'));var db=require('../../mysqldb')['db'];config[_0x0a3f('0x19')]=_[_0x0a3f('0x1a')](config[_0x0a3f('0x19')],{'host':_0x0a3f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0x0a3f('0x1c')](socket);function respondWithStatusCode(_0x5dc34c,_0x1b9b1d){_0x1b9b1d=_0x1b9b1d||0xcc;return function(_0x2af39e){if(_0x2af39e){return _0x5dc34c['sendStatus'](_0x1b9b1d);}return _0x5dc34c[_0x0a3f('0x1d')](_0x1b9b1d)[_0x0a3f('0x1e')]();};}function respondWithResult(_0x1f569c,_0x39f7ab){_0x39f7ab=_0x39f7ab||0xc8;return function(_0x1b0f00){if(_0x1b0f00){return _0x1f569c['status'](_0x39f7ab)['json'](_0x1b0f00);}};}function respondWithFilteredResult(_0x1cc52e,_0x498b91){return function(_0x1d26aa){if(_0x1d26aa){var _0x5bdae7=typeof _0x498b91[_0x0a3f('0x1f')]===_0x0a3f('0x20')&&typeof _0x498b91[_0x0a3f('0x21')]===_0x0a3f('0x20');var _0x2ce2f7=_0x1d26aa['count'];var _0x1dd779=_0x5bdae7?0x0:_0x498b91[_0x0a3f('0x1f')];var _0x39ac1e=_0x5bdae7?_0x1d26aa[_0x0a3f('0x22')]:_0x498b91[_0x0a3f('0x1f')]+_0x498b91[_0x0a3f('0x21')];var _0x20d82f;if(_0x39ac1e>=_0x2ce2f7){_0x39ac1e=_0x2ce2f7;_0x20d82f=0xc8;}else{_0x20d82f=0xce;}_0x1cc52e[_0x0a3f('0x1d')](_0x20d82f);return _0x1cc52e[_0x0a3f('0x23')]('Content-Range',_0x1dd779+'-'+_0x39ac1e+'/'+_0x2ce2f7)[_0x0a3f('0x24')](_0x1d26aa);}return null;};}function patchUpdates(_0x386550){return function(_0xc3759e){try{jsonpatch['apply'](_0xc3759e,_0x386550,!![]);}catch(_0x2547e4){return BPromise[_0x0a3f('0x25')](_0x2547e4);}return _0xc3759e['save']();};}function saveUpdates(_0x270d1a,_0x48276a){return function(_0x5e87b1){if(_0x5e87b1){return _0x5e87b1[_0x0a3f('0x26')](_0x270d1a)[_0x0a3f('0x27')](function(_0x5acf28){return _0x5acf28;});}return null;};}function removeEntity(_0x2ecfd7,_0x1165ed){return function(_0x59496c){if(_0x59496c){return _0x59496c[_0x0a3f('0x28')]()[_0x0a3f('0x27')](function(){var _0x15ac78=_0x59496c[_0x0a3f('0x29')]({'plain':!![]});var _0x47395e=_0x0a3f('0x2a');return db['UserProfileResource'][_0x0a3f('0x28')]({'where':{'type':_0x47395e,'resourceId':_0x15ac78['id']}})[_0x0a3f('0x27')](function(){return _0x59496c;});})[_0x0a3f('0x27')](function(){_0x2ecfd7[_0x0a3f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f150b,_0x450d72){return function(_0x374737){if(!_0x374737){_0x4f150b[_0x0a3f('0x2b')](0x194);}return _0x374737;};}function handleError(_0x3aa272,_0x3b74c1){_0x3b74c1=_0x3b74c1||0x1f4;return function(_0x1a5bdb){logger[_0x0a3f('0x2c')](_0x1a5bdb[_0x0a3f('0x2d')]);if(_0x1a5bdb[_0x0a3f('0x2e')]){delete _0x1a5bdb['name'];}_0x3aa272['status'](_0x3b74c1)[_0x0a3f('0x2f')](_0x1a5bdb);};}exports['index']=function(_0x34fa26,_0xae90ca){var _0x24ba82={},_0x3a368d={},_0x52bcad={'count':0x0,'rows':[]};var _0x5711d0=_['map'](db['Team'][_0x0a3f('0x30')],function(_0x5b42b8){return{'name':_0x5b42b8[_0x0a3f('0x31')],'type':_0x5b42b8[_0x0a3f('0x32')][_0x0a3f('0x33')]};});_0x3a368d[_0x0a3f('0x34')]=_[_0x0a3f('0x35')](_0x5711d0,_0x0a3f('0x2e'));_0x3a368d['query']=_[_0x0a3f('0x36')](_0x34fa26[_0x0a3f('0x37')]);_0x3a368d[_0x0a3f('0x38')]=_[_0x0a3f('0x39')](_0x3a368d[_0x0a3f('0x34')],_0x3a368d[_0x0a3f('0x37')]);_0x24ba82[_0x0a3f('0x3a')]=_[_0x0a3f('0x39')](_0x3a368d[_0x0a3f('0x34')],qs[_0x0a3f('0x3b')](_0x34fa26['query'][_0x0a3f('0x3b')]));_0x24ba82[_0x0a3f('0x3a')]=_0x24ba82[_0x0a3f('0x3a')][_0x0a3f('0x3c')]?_0x24ba82['attributes']:_0x3a368d[_0x0a3f('0x34')];if(!_0x34fa26['query'][_0x0a3f('0x3d')]('nolimit')){_0x24ba82[_0x0a3f('0x21')]=qs['limit'](_0x34fa26[_0x0a3f('0x37')][_0x0a3f('0x21')]);_0x24ba82['offset']=qs[_0x0a3f('0x1f')](_0x34fa26[_0x0a3f('0x37')][_0x0a3f('0x1f')]);}_0x24ba82['order']=qs[_0x0a3f('0x3e')](_0x34fa26['query']['sort']);_0x24ba82[_0x0a3f('0x3f')]=qs[_0x0a3f('0x38')](_['pick'](_0x34fa26[_0x0a3f('0x37')],_0x3a368d['filters']),_0x5711d0);if(_0x34fa26[_0x0a3f('0x37')]['filter']){_0x24ba82[_0x0a3f('0x3f')]=_[_0x0a3f('0x40')](_0x24ba82['where'],{'$or':_[_0x0a3f('0x35')](_0x5711d0,function(_0x439926){if(_0x439926[_0x0a3f('0x32')]!==_0x0a3f('0x41')){var _0x4a0a04={};_0x4a0a04[_0x439926['name']]={'$like':'%'+_0x34fa26[_0x0a3f('0x37')][_0x0a3f('0x42')]+'%'};return _0x4a0a04;}})});}_0x24ba82=_[_0x0a3f('0x40')]({},_0x24ba82,_0x34fa26[_0x0a3f('0x43')]);var _0xca2d35={'where':_0x24ba82[_0x0a3f('0x3f')]};return db[_0x0a3f('0x44')][_0x0a3f('0x22')](_0xca2d35)[_0x0a3f('0x27')](function(_0x4e15fd){_0x52bcad[_0x0a3f('0x22')]=_0x4e15fd;if(_0x34fa26[_0x0a3f('0x37')]['includeAll']){_0x24ba82['include']=[{'all':!![]}];}return db[_0x0a3f('0x44')][_0x0a3f('0x45')](_0x24ba82);})[_0x0a3f('0x27')](function(_0x2c96b5){_0x52bcad[_0x0a3f('0x46')]=_0x2c96b5;return _0x52bcad;})['then'](respondWithFilteredResult(_0xae90ca,_0x24ba82))[_0x0a3f('0x47')](handleError(_0xae90ca,null));};exports['show']=function(_0x49b308,_0x18f216){var _0x3a7ff2={'raw':![],'where':{'id':_0x49b308[_0x0a3f('0x48')]['id']}},_0x543ffa={};_0x543ffa[_0x0a3f('0x34')]=_[_0x0a3f('0x36')](db['Team'][_0x0a3f('0x30')]);_0x543ffa[_0x0a3f('0x37')]=_[_0x0a3f('0x36')](_0x49b308[_0x0a3f('0x37')]);_0x543ffa[_0x0a3f('0x38')]=_['intersection'](_0x543ffa[_0x0a3f('0x34')],_0x543ffa[_0x0a3f('0x37')]);_0x3a7ff2[_0x0a3f('0x3a')]=_['intersection'](_0x543ffa[_0x0a3f('0x34')],qs[_0x0a3f('0x3b')](_0x49b308['query'][_0x0a3f('0x3b')]));_0x3a7ff2[_0x0a3f('0x3a')]=_0x3a7ff2[_0x0a3f('0x3a')]['length']?_0x3a7ff2[_0x0a3f('0x3a')]:_0x543ffa[_0x0a3f('0x34')];if(_0x49b308[_0x0a3f('0x37')][_0x0a3f('0x49')]){_0x3a7ff2[_0x0a3f('0x4a')]=[{'all':!![]}];}_0x3a7ff2=_[_0x0a3f('0x40')]({},_0x3a7ff2,_0x49b308[_0x0a3f('0x43')]);return db[_0x0a3f('0x44')]['find'](_0x3a7ff2)['then'](handleEntityNotFound(_0x18f216,null))[_0x0a3f('0x27')](respondWithResult(_0x18f216,null))[_0x0a3f('0x47')](handleError(_0x18f216,null));};exports[_0x0a3f('0x4b')]=function(_0x411da1,_0x10aa0c){return db[_0x0a3f('0x44')][_0x0a3f('0x4b')](_0x411da1['body'],{})[_0x0a3f('0x27')](function(_0x510597){var _0x5838a8=_0x411da1[_0x0a3f('0x4c')]['get']({'plain':!![]});if(!_0x5838a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5838a8[_0x0a3f('0x4d')]===_0x0a3f('0x4c')){var _0x384a3c=_0x510597[_0x0a3f('0x29')]({'plain':!![]});var _0x20745e=_0x0a3f('0x2a');return db[_0x0a3f('0x4e')][_0x0a3f('0x4f')]({'where':{'name':_0x20745e,'userProfileId':_0x5838a8[_0x0a3f('0x50')]},'raw':!![]})[_0x0a3f('0x27')](function(_0x17d6b4){if(_0x17d6b4&&_0x17d6b4[_0x0a3f('0x51')]===0x0){return db[_0x0a3f('0x52')][_0x0a3f('0x4b')]({'name':_0x384a3c['name'],'resourceId':_0x384a3c['id'],'type':_0x17d6b4[_0x0a3f('0x2e')],'sectionId':_0x17d6b4['id']},{})[_0x0a3f('0x27')](function(){return _0x510597;});}else{return _0x510597;}})['catch'](function(_0x9141e){logger[_0x0a3f('0x2c')](_0x0a3f('0x53'),_0x9141e);throw _0x9141e;});}return _0x510597;})[_0x0a3f('0x27')](respondWithResult(_0x10aa0c,0xc9))[_0x0a3f('0x47')](handleError(_0x10aa0c,null));};exports[_0x0a3f('0x26')]=function(_0x3cb648,_0x2e0f1b){if(_0x3cb648[_0x0a3f('0x54')]['id']){delete _0x3cb648[_0x0a3f('0x54')]['id'];}return db[_0x0a3f('0x44')][_0x0a3f('0x4f')]({'where':{'id':_0x3cb648['params']['id']}})[_0x0a3f('0x27')](handleEntityNotFound(_0x2e0f1b,null))[_0x0a3f('0x27')](saveUpdates(_0x3cb648[_0x0a3f('0x54')],null))[_0x0a3f('0x27')](respondWithResult(_0x2e0f1b,null))['catch'](handleError(_0x2e0f1b,null));};exports[_0x0a3f('0x28')]=function(_0x49796b,_0x57e755){return db[_0x0a3f('0x44')]['find']({'where':{'id':_0x49796b[_0x0a3f('0x48')]['id']}})[_0x0a3f('0x27')](handleEntityNotFound(_0x57e755,null))['then'](removeEntity(_0x57e755,null))[_0x0a3f('0x47')](handleError(_0x57e755,null));};exports[_0x0a3f('0x55')]=function(_0x5688ae,_0x3338e8,_0x2b8aa3){return db[_0x0a3f('0x44')][_0x0a3f('0x56')]({'where':{'id':_0x5688ae[_0x0a3f('0x48')]['id']}})[_0x0a3f('0x27')](handleEntityNotFound(_0x3338e8,null))[_0x0a3f('0x27')](function(_0x37d520){if(!_0x5688ae['query'][_0x0a3f('0x57')]||!utils[_0x0a3f('0x58')](_0x5688ae['query'][_0x0a3f('0x57')])){throw new db['Sequelize'][(_0x0a3f('0x59'))](_0x0a3f('0x5a'));}var _0x400525={};var _0x4678a9={};_0x4678a9[_0x0a3f('0x34')]=_['keys'](db[_['capitalize'](_0x5688ae[_0x0a3f('0x37')][_0x0a3f('0x57')]['toLowerCase']())+_0x0a3f('0x5b')]['rawAttributes']);_0x4678a9[_0x0a3f('0x37')]=_[_0x0a3f('0x36')](_0x5688ae[_0x0a3f('0x37')]);_0x4678a9[_0x0a3f('0x38')]=_['intersection'](_0x4678a9[_0x0a3f('0x34')],_0x4678a9[_0x0a3f('0x37')]);_0x400525[_0x0a3f('0x3a')]=_['intersection'](_0x4678a9[_0x0a3f('0x34')],qs[_0x0a3f('0x3b')](_0x5688ae['query'][_0x0a3f('0x3b')]));_0x400525[_0x0a3f('0x3a')]=_0x400525['attributes'][_0x0a3f('0x3c')]?_0x400525['attributes']:_0x4678a9[_0x0a3f('0x34')];_0x400525[_0x0a3f('0x21')]=qs[_0x0a3f('0x21')](_0x5688ae['query']['limit']);_0x400525[_0x0a3f('0x1f')]=qs[_0x0a3f('0x1f')](_0x5688ae['query'][_0x0a3f('0x1f')]);_0x400525[_0x0a3f('0x5c')]=qs['sort'](_0x5688ae[_0x0a3f('0x37')][_0x0a3f('0x3e')]);_0x400525[_0x0a3f('0x3f')]=qs['filters'](_[_0x0a3f('0x5d')](_0x5688ae[_0x0a3f('0x37')],_0x4678a9[_0x0a3f('0x38')]));_0x400525=_[_0x0a3f('0x40')]({},_0x400525,_0x5688ae[_0x0a3f('0x43')]);return _0x37d520[_0x0a3f('0x29')+_[_0x0a3f('0x5e')](_0x5688ae[_0x0a3f('0x37')][_0x0a3f('0x57')][_0x0a3f('0x5f')]())+_0x0a3f('0x60')](_0x400525);})[_0x0a3f('0x27')](respondWithResult(_0x3338e8,null))['catch'](handleError(_0x3338e8,null));};exports[_0x0a3f('0x61')]=function(_0x721d19,_0x538d6f,_0x493302){return db[_0x0a3f('0x44')][_0x0a3f('0x56')]({'where':{'id':_0x721d19[_0x0a3f('0x48')]['id']}})[_0x0a3f('0x27')](function(_0xa87067){if(_0xa87067){if(!_0x721d19[_0x0a3f('0x54')][_0x0a3f('0x57')]||!utils[_0x0a3f('0x58')](_0x721d19[_0x0a3f('0x54')][_0x0a3f('0x57')])){throw new db[(_0x0a3f('0x62'))]['ValidationError'](_0x0a3f('0x5a'));}return _0xa87067[_0x0a3f('0x63')+_[_0x0a3f('0x5e')](_0x721d19[_0x0a3f('0x54')]['channel']['toLowerCase']())+_0x0a3f('0x60')](_0x721d19[_0x0a3f('0x54')][_0x0a3f('0x64')]);}return null;})[_0x0a3f('0x27')](handleEntityNotFound(_0x538d6f,null))[_0x0a3f('0x27')](respondWithStatusCode(_0x538d6f,null))['catch'](handleError(_0x538d6f,null));};exports[_0x0a3f('0x65')]=function(_0x247c9f,_0x4ebd12,_0x1e91bb){return db['Team'][_0x0a3f('0x56')]({'where':{'id':_0x247c9f[_0x0a3f('0x48')]['id']}})[_0x0a3f('0x27')](function(_0x3af3e6){if(_0x3af3e6){if(!_0x247c9f[_0x0a3f('0x37')][_0x0a3f('0x57')]||!utils[_0x0a3f('0x58')](_0x247c9f[_0x0a3f('0x37')]['channel'])){throw new db['Sequelize'][(_0x0a3f('0x59'))]('Unknown\x20channel');}return _0x3af3e6[_0x0a3f('0x66')+_['capitalize'](_0x247c9f[_0x0a3f('0x37')]['channel'][_0x0a3f('0x5f')]())+'Queues'](_0x247c9f[_0x0a3f('0x37')]['ids']);}return null;})[_0x0a3f('0x27')](handleEntityNotFound(_0x4ebd12,null))['then'](respondWithStatusCode(_0x4ebd12,null))[_0x0a3f('0x47')](handleError(_0x4ebd12,null));};exports[_0x0a3f('0x67')]=function(_0x1a4ba4,_0x54adb9){return db[_0x0a3f('0x44')][_0x0a3f('0x4f')]({'where':{'id':_0x1a4ba4[_0x0a3f('0x48')]['id']}})[_0x0a3f('0x27')](handleEntityNotFound(_0x54adb9,null))[_0x0a3f('0x27')](function(_0x197a5b){if(_0x197a5b){var _0x74d5d7=['Voice',_0x0a3f('0x68'),'Mail',_0x0a3f('0x69'),_0x0a3f('0x6a'),'Openchannel',_0x0a3f('0x6b')];return db['sequelize'][_0x0a3f('0x6c')](function(_0x1f4a20){var _0x5b3302=_[_0x0a3f('0x35')](_0x74d5d7,function(_0x4ca970){var _0x57b4a4={'attributes':['id',_0x0a3f('0x2e')]};if(_0x4ca970===_0x0a3f('0x6d')){_0x57b4a4[_0x0a3f('0x6e')]={'attributes':['penalty']};}return _0x197a5b[_0x0a3f('0x29')+_0x4ca970+_0x0a3f('0x60')](_0x57b4a4)[_0x0a3f('0x27')](function(_0x437933){var _0x51fe28=_[_0x0a3f('0x35')](_0x437933,function(_0x4cb75d){var _0x3772b5=_[_0x0a3f('0x35')](_0x1a4ba4[_0x0a3f('0x54')]['ids'],function(_0x8e353f){var _0x367f8d={'where':{'UserId':_0x8e353f,[_0x4ca970+'QueueId']:_0x4cb75d['id']},'transaction':_0x1f4a20};if(_0x4ca970===_0x0a3f('0x6d')){_0x367f8d[_0x0a3f('0x1a')]={'penalty':_0x4cb75d[_0x0a3f('0x6f')][_0x0a3f('0x70')]};}return db[_0x0a3f('0x71')+_0x4ca970+_0x0a3f('0x5b')][_0x0a3f('0x72')](_0x367f8d)['then'](function(){socket[_0x0a3f('0x73')](_0x0a3f('0x4c')+_0x4ca970+_0x0a3f('0x74'),{'UserId':_0x8e353f,[_0x4ca970+_0x0a3f('0x75')]:_0x4cb75d['id']});if(_0x4ca970!==_0x0a3f('0x6d'))return;return db[_0x0a3f('0x71')][_0x0a3f('0x45')]({'where':{'id':_0x1a4ba4[_0x0a3f('0x54')][_0x0a3f('0x64')],'online':0x1},'attributes':['id','name','online',_0x0a3f('0x76'),_0x0a3f('0x77')],'raw':!![]})['then'](function(_0x87a4f5){var _0xdcaf1b=_[_0x0a3f('0x35')](_0x87a4f5,function(_0x1b990f){return db[_0x0a3f('0x78')][_0x0a3f('0x79')]({'membername':_0x1b990f[_0x0a3f('0x2e')],'UserId':_0x1b990f['id'],'queue_name':_0x4cb75d['name'],'VoiceQueueId':_0x4cb75d['id'],'interface':_['isNil'](_0x1b990f[_0x0a3f('0x77')])?util[_0x0a3f('0x7a')](_0x0a3f('0x7b'),_0x1b990f[_0x0a3f('0x2e')]):_0x1b990f[_0x0a3f('0x77')],'paused':_0x1b990f[_0x0a3f('0x76')]||![],'penalty':_0x4cb75d[_0x0a3f('0x6f')][_0x0a3f('0x70')]},{'transaction':_0x1f4a20});});return Promise['all'](_0xdcaf1b);});});});return Promise['all'](_0x3772b5);});return Promise[_0x0a3f('0x7c')](_0x51fe28);});});return Promise[_0x0a3f('0x7c')](_0x5b3302)['then'](function(){return _0x197a5b[_0x0a3f('0x67')](_0x1a4ba4[_0x0a3f('0x54')][_0x0a3f('0x64')],{'transaction':_0x1f4a20})['spread'](function(_0x495721){return _0x495721;});});});}})[_0x0a3f('0x27')](respondWithResult(_0x54adb9,null))[_0x0a3f('0x47')](handleError(_0x54adb9,null));};exports['removeAgents']=function(_0x2d9ed4,_0x53b67c){return db['Team'][_0x0a3f('0x4f')]({'where':{'id':_0x2d9ed4[_0x0a3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x53b67c,null))[_0x0a3f('0x27')](function(_0x54f388){if(_0x54f388){var _0x4bed62=['Voice',_0x0a3f('0x68'),_0x0a3f('0x7d'),_0x0a3f('0x69'),_0x0a3f('0x6a'),_0x0a3f('0x7e'),_0x0a3f('0x6b')];return db[_0x0a3f('0x7f')]['transaction'](function(_0x2beafb){var _0x75b46b=_[_0x0a3f('0x35')](_0x4bed62,function(_0x500340){var _0x5a6180={'attributes':['id',_0x0a3f('0x2e')]};return _0x54f388['get'+_0x500340+'Queues'](_0x5a6180)[_0x0a3f('0x27')](function(_0x1c1abd){var _0x3639a6=_['map'](_0x1c1abd,function(_0x3b0a9e){return _0x3b0a9e['removeAgents'](_0x2d9ed4[_0x0a3f('0x37')][_0x0a3f('0x64')],{'transaction':_0x2beafb})[_0x0a3f('0x27')](function(){var _0x120cb6=JSON[_0x0a3f('0x80')]('['+_0x2d9ed4['query'][_0x0a3f('0x64')]+']');var _0x5dafd0=_[_0x0a3f('0x35')](_0x120cb6,function(_0x5ec6c0){socket[_0x0a3f('0x73')](_0x0a3f('0x4c')+_0x500340+'Queue:remove',{'UserId':Number(_0x5ec6c0),[_0x500340+_0x0a3f('0x75')]:_0x3b0a9e['id']});if(_0x500340!==_0x0a3f('0x6d'))return;return db['UserVoiceQueueRt'][_0x0a3f('0x28')]({'where':{'VoiceQueueId':_0x3b0a9e['id'],'UserId':_0x5ec6c0},'transaction':_0x2beafb});});return Promise[_0x0a3f('0x7c')](_0x5dafd0);});});return Promise[_0x0a3f('0x7c')](_0x3639a6);});});return Promise['all'](_0x75b46b)[_0x0a3f('0x27')](function(){return _0x54f388[_0x0a3f('0x81')](_0x2d9ed4[_0x0a3f('0x37')][_0x0a3f('0x64')],{'transaction':_0x2beafb});});});}})[_0x0a3f('0x27')](respondWithStatusCode(_0x53b67c,null))['catch'](handleError(_0x53b67c,null));};exports[_0x0a3f('0x82')]=function(_0x3ff1c7,_0x12b129,_0x1102ac){var _0x1aaead={};var _0x709232={};var _0x3df172;var _0x1bb66b;return db[_0x0a3f('0x44')]['findOne']({'where':{'id':_0x3ff1c7[_0x0a3f('0x48')]['id']}})[_0x0a3f('0x27')](handleEntityNotFound(_0x12b129,null))[_0x0a3f('0x27')](function(_0x371f83){if(_0x371f83){_0x3df172=_0x371f83;_0x709232[_0x0a3f('0x34')]=_[_0x0a3f('0x36')](db[_0x0a3f('0x71')][_0x0a3f('0x30')]);_0x709232[_0x0a3f('0x37')]=_[_0x0a3f('0x36')](_0x3ff1c7[_0x0a3f('0x37')]);_0x709232[_0x0a3f('0x38')]=_[_0x0a3f('0x39')](_0x709232[_0x0a3f('0x34')],_0x709232[_0x0a3f('0x37')]);_0x1aaead['attributes']=_['intersection'](_0x709232[_0x0a3f('0x34')],qs[_0x0a3f('0x3b')](_0x3ff1c7['query'][_0x0a3f('0x3b')]));_0x1aaead[_0x0a3f('0x3a')]=_0x1aaead[_0x0a3f('0x3a')][_0x0a3f('0x3c')]?_0x1aaead[_0x0a3f('0x3a')]:_0x709232[_0x0a3f('0x34')];_0x1aaead[_0x0a3f('0x5c')]=qs[_0x0a3f('0x3e')](_0x3ff1c7[_0x0a3f('0x37')][_0x0a3f('0x3e')]);_0x1aaead[_0x0a3f('0x3f')]=qs[_0x0a3f('0x38')](_['pick'](_0x3ff1c7[_0x0a3f('0x37')],_0x709232[_0x0a3f('0x38')]));if(_0x3ff1c7[_0x0a3f('0x37')][_0x0a3f('0x42')]){_0x1aaead[_0x0a3f('0x3f')]=_['merge'](_0x1aaead['where'],{'$or':_['map'](_0x1aaead[_0x0a3f('0x3a')],function(_0x3692de){var _0x5a4a7d={};_0x5a4a7d[_0x3692de]={'$like':'%'+_0x3ff1c7[_0x0a3f('0x37')]['filter']+'%'};return _0x5a4a7d;})});}_0x1aaead=_['merge']({},_0x1aaead,_0x3ff1c7[_0x0a3f('0x43')]);return _0x3df172[_0x0a3f('0x82')](_0x1aaead);}})['then'](function(_0x3a02f5){if(_0x3a02f5){_0x1bb66b=_0x3a02f5[_0x0a3f('0x3c')];if(!_0x3ff1c7[_0x0a3f('0x37')][_0x0a3f('0x3d')]('nolimit')){_0x1aaead[_0x0a3f('0x21')]=qs[_0x0a3f('0x21')](_0x3ff1c7[_0x0a3f('0x37')][_0x0a3f('0x21')]);_0x1aaead['offset']=qs[_0x0a3f('0x1f')](_0x3ff1c7['query'][_0x0a3f('0x1f')]);}return _0x3df172[_0x0a3f('0x82')](_0x1aaead);}})[_0x0a3f('0x27')](function(_0x3e5579){if(_0x3e5579){return _0x3e5579?{'count':_0x1bb66b,'rows':_0x3e5579}:null;}})['then'](respondWithResult(_0x12b129,null))['catch'](handleError(_0x12b129,null));};
\ No newline at end of file
+var _0x7c59=['toLowerCase','Queue','Queues','addQueues','isValidChannel','add','ids','removeQueues','findOne','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','sequelize','transaction','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','Whatsapp','parse','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','get','Teams','UserProfileResource','destroy','end','stack','name','index','map','Team','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','channel','Sequelize','ValidationError','Unknown\x20channel','capitalize'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x7c59,0x143));var _0x97c5=function(_0x225566,_0x185e72){_0x225566=_0x225566-0x0;var _0x3d48b3=_0x7c59[_0x225566];return _0x3d48b3;};'use strict';var emlformat=require(_0x97c5('0x0'));var rimraf=require(_0x97c5('0x1'));var zipdir=require(_0x97c5('0x2'));var jsonpatch=require(_0x97c5('0x3'));var rp=require('request-promise');var moment=require(_0x97c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x97c5('0x5'));var util=require('util');var path=require(_0x97c5('0x6'));var sox=require(_0x97c5('0x7'));var csv=require(_0x97c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97c5('0x9'));var _=require(_0x97c5('0xa'));var squel=require(_0x97c5('0xb'));var crypto=require('crypto');var jsforce=require(_0x97c5('0xc'));var deskjs=require(_0x97c5('0xd'));var toCsv=require(_0x97c5('0x8'));var querystring=require(_0x97c5('0xe'));var Papa=require(_0x97c5('0xf'));var Redis=require('ioredis');var authService=require(_0x97c5('0x10'));var qs=require(_0x97c5('0x11'));var as=require(_0x97c5('0x12'));var hardwareService=require(_0x97c5('0x13'));var logger=require(_0x97c5('0x14'))(_0x97c5('0x15'));var utils=require(_0x97c5('0x16'));var config=require(_0x97c5('0x17'));var licenseUtil=require(_0x97c5('0x18'));var db=require(_0x97c5('0x19'))['db'];config['redis']=_[_0x97c5('0x1a')](config['redis'],{'host':_0x97c5('0x1b'),'port':0x18eb});var socket=require(_0x97c5('0x1c'))(new Redis(config[_0x97c5('0x1d')]));require(_0x97c5('0x1e'))[_0x97c5('0x1f')](socket);function respondWithStatusCode(_0xe409af,_0x1ede8e){_0x1ede8e=_0x1ede8e||0xcc;return function(_0x1aeeaf){if(_0x1aeeaf){return _0xe409af[_0x97c5('0x20')](_0x1ede8e);}return _0xe409af[_0x97c5('0x21')](_0x1ede8e)['end']();};}function respondWithResult(_0x20120a,_0x560d3e){_0x560d3e=_0x560d3e||0xc8;return function(_0x533c86){if(_0x533c86){return _0x20120a[_0x97c5('0x21')](_0x560d3e)['json'](_0x533c86);}};}function respondWithFilteredResult(_0x5c74fd,_0x2065ad){return function(_0x5a8299){if(_0x5a8299){var _0x41a601=typeof _0x2065ad['offset']===_0x97c5('0x22')&&typeof _0x2065ad[_0x97c5('0x23')]===_0x97c5('0x22');var _0x4babfb=_0x5a8299[_0x97c5('0x24')];var _0x3a24af=_0x41a601?0x0:_0x2065ad[_0x97c5('0x25')];var _0x38c041=_0x41a601?_0x5a8299[_0x97c5('0x24')]:_0x2065ad[_0x97c5('0x25')]+_0x2065ad['limit'];var _0x46b051;if(_0x38c041>=_0x4babfb){_0x38c041=_0x4babfb;_0x46b051=0xc8;}else{_0x46b051=0xce;}_0x5c74fd[_0x97c5('0x21')](_0x46b051);return _0x5c74fd['set'](_0x97c5('0x26'),_0x3a24af+'-'+_0x38c041+'/'+_0x4babfb)[_0x97c5('0x27')](_0x5a8299);}return null;};}function patchUpdates(_0x5e7b94){return function(_0x1795a3){try{jsonpatch[_0x97c5('0x28')](_0x1795a3,_0x5e7b94,!![]);}catch(_0xf44f31){return BPromise[_0x97c5('0x29')](_0xf44f31);}return _0x1795a3[_0x97c5('0x2a')]();};}function saveUpdates(_0x1c73cb,_0xd6f2b3){return function(_0x294c62){if(_0x294c62){return _0x294c62['update'](_0x1c73cb)['then'](function(_0x42e05f){return _0x42e05f;});}return null;};}function removeEntity(_0x52a52c,_0x482ca2){return function(_0x3d388b){if(_0x3d388b){return _0x3d388b['destroy']()[_0x97c5('0x2b')](function(){var _0xace66e=_0x3d388b[_0x97c5('0x2c')]({'plain':!![]});var _0x350ea0=_0x97c5('0x2d');return db[_0x97c5('0x2e')][_0x97c5('0x2f')]({'where':{'type':_0x350ea0,'resourceId':_0xace66e['id']}})[_0x97c5('0x2b')](function(){return _0x3d388b;});})[_0x97c5('0x2b')](function(){_0x52a52c[_0x97c5('0x21')](0xcc)[_0x97c5('0x30')]();});}};}function handleEntityNotFound(_0x3abe1c,_0x2b5b30){return function(_0xc0a1de){if(!_0xc0a1de){_0x3abe1c[_0x97c5('0x20')](0x194);}return _0xc0a1de;};}function handleError(_0x402c20,_0x2dc991){_0x2dc991=_0x2dc991||0x1f4;return function(_0x2c14c4){logger['error'](_0x2c14c4[_0x97c5('0x31')]);if(_0x2c14c4['name']){delete _0x2c14c4[_0x97c5('0x32')];}_0x402c20[_0x97c5('0x21')](_0x2dc991)['send'](_0x2c14c4);};}exports[_0x97c5('0x33')]=function(_0x1dfbea,_0x356ba2){var _0x24059d={},_0x46d6d6={},_0x724027={'count':0x0,'rows':[]};var _0x2781b1=_[_0x97c5('0x34')](db[_0x97c5('0x35')][_0x97c5('0x36')],function(_0x799995){return{'name':_0x799995[_0x97c5('0x37')],'type':_0x799995[_0x97c5('0x38')][_0x97c5('0x39')]};});_0x46d6d6[_0x97c5('0x3a')]=_['map'](_0x2781b1,_0x97c5('0x32'));_0x46d6d6['query']=_[_0x97c5('0x3b')](_0x1dfbea[_0x97c5('0x3c')]);_0x46d6d6[_0x97c5('0x3d')]=_['intersection'](_0x46d6d6['model'],_0x46d6d6[_0x97c5('0x3c')]);_0x24059d[_0x97c5('0x3e')]=_['intersection'](_0x46d6d6[_0x97c5('0x3a')],qs['fields'](_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x3f')]));_0x24059d[_0x97c5('0x3e')]=_0x24059d[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x24059d[_0x97c5('0x3e')]:_0x46d6d6[_0x97c5('0x3a')];if(!_0x1dfbea['query'][_0x97c5('0x41')](_0x97c5('0x42'))){_0x24059d['limit']=qs[_0x97c5('0x23')](_0x1dfbea['query'][_0x97c5('0x23')]);_0x24059d[_0x97c5('0x25')]=qs['offset'](_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x25')]);}_0x24059d['order']=qs[_0x97c5('0x43')](_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x43')]);_0x24059d[_0x97c5('0x44')]=qs[_0x97c5('0x3d')](_[_0x97c5('0x45')](_0x1dfbea['query'],_0x46d6d6[_0x97c5('0x3d')]),_0x2781b1);if(_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x46')]){_0x24059d[_0x97c5('0x44')]=_[_0x97c5('0x47')](_0x24059d['where'],{'$or':_[_0x97c5('0x34')](_0x2781b1,function(_0x531569){if(_0x531569[_0x97c5('0x38')]!==_0x97c5('0x48')){var _0x39e457={};_0x39e457[_0x531569['name']]={'$like':'%'+_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x46')]+'%'};return _0x39e457;}})});}_0x24059d=_['merge']({},_0x24059d,_0x1dfbea[_0x97c5('0x49')]);var _0x3f0e4a={'where':_0x24059d[_0x97c5('0x44')]};return db[_0x97c5('0x35')][_0x97c5('0x24')](_0x3f0e4a)[_0x97c5('0x2b')](function(_0x3ad0fb){_0x724027[_0x97c5('0x24')]=_0x3ad0fb;if(_0x1dfbea['query'][_0x97c5('0x4a')]){_0x24059d[_0x97c5('0x4b')]=[{'all':!![]}];}return db[_0x97c5('0x35')]['findAll'](_0x24059d);})[_0x97c5('0x2b')](function(_0x6487aa){_0x724027['rows']=_0x6487aa;return _0x724027;})[_0x97c5('0x2b')](respondWithFilteredResult(_0x356ba2,_0x24059d))[_0x97c5('0x4c')](handleError(_0x356ba2,null));};exports[_0x97c5('0x4d')]=function(_0x25d871,_0x2f254f){var _0x437190={'raw':![],'where':{'id':_0x25d871[_0x97c5('0x4e')]['id']}},_0x2e63b6={};_0x2e63b6[_0x97c5('0x3a')]=_['keys'](db['Team'][_0x97c5('0x36')]);_0x2e63b6['query']=_[_0x97c5('0x3b')](_0x25d871['query']);_0x2e63b6[_0x97c5('0x3d')]=_['intersection'](_0x2e63b6[_0x97c5('0x3a')],_0x2e63b6['query']);_0x437190[_0x97c5('0x3e')]=_[_0x97c5('0x4f')](_0x2e63b6[_0x97c5('0x3a')],qs[_0x97c5('0x3f')](_0x25d871[_0x97c5('0x3c')][_0x97c5('0x3f')]));_0x437190[_0x97c5('0x3e')]=_0x437190[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x437190[_0x97c5('0x3e')]:_0x2e63b6['model'];if(_0x25d871[_0x97c5('0x3c')][_0x97c5('0x4a')]){_0x437190[_0x97c5('0x4b')]=[{'all':!![]}];}_0x437190=_[_0x97c5('0x47')]({},_0x437190,_0x25d871[_0x97c5('0x49')]);return db['Team'][_0x97c5('0x50')](_0x437190)['then'](handleEntityNotFound(_0x2f254f,null))[_0x97c5('0x2b')](respondWithResult(_0x2f254f,null))[_0x97c5('0x4c')](handleError(_0x2f254f,null));};exports[_0x97c5('0x51')]=function(_0x375709,_0x2c91df){return db[_0x97c5('0x35')][_0x97c5('0x51')](_0x375709[_0x97c5('0x52')],{})['then'](function(_0xbd9175){var _0x2a4153=_0x375709[_0x97c5('0x53')][_0x97c5('0x2c')]({'plain':!![]});if(!_0x2a4153)throw new Error(_0x97c5('0x54'));if(_0x2a4153[_0x97c5('0x55')]==='user'){var _0x5c0192=_0xbd9175[_0x97c5('0x2c')]({'plain':!![]});var _0x2c1b23=_0x97c5('0x2d');return db[_0x97c5('0x56')][_0x97c5('0x50')]({'where':{'name':_0x2c1b23,'userProfileId':_0x2a4153['userProfileId']},'raw':!![]})[_0x97c5('0x2b')](function(_0x1adb1e){if(_0x1adb1e&&_0x1adb1e[_0x97c5('0x57')]===0x0){return db[_0x97c5('0x2e')]['create']({'name':_0x5c0192[_0x97c5('0x32')],'resourceId':_0x5c0192['id'],'type':_0x1adb1e[_0x97c5('0x32')],'sectionId':_0x1adb1e['id']},{})['then'](function(){return _0xbd9175;});}else{return _0xbd9175;}})['catch'](function(_0x53c80a){logger[_0x97c5('0x58')](_0x97c5('0x59'),_0x53c80a);throw _0x53c80a;});}return _0xbd9175;})[_0x97c5('0x2b')](respondWithResult(_0x2c91df,0xc9))[_0x97c5('0x4c')](handleError(_0x2c91df,null));};exports[_0x97c5('0x5a')]=function(_0x195cb6,_0x3c292e){if(_0x195cb6[_0x97c5('0x52')]['id']){delete _0x195cb6['body']['id'];}return db[_0x97c5('0x35')][_0x97c5('0x50')]({'where':{'id':_0x195cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c292e,null))[_0x97c5('0x2b')](saveUpdates(_0x195cb6['body'],null))['then'](respondWithResult(_0x3c292e,null))[_0x97c5('0x4c')](handleError(_0x3c292e,null));};exports[_0x97c5('0x2f')]=function(_0x496ba6,_0x4070e8){return db[_0x97c5('0x35')][_0x97c5('0x50')]({'where':{'id':_0x496ba6['params']['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x4070e8,null))['then'](removeEntity(_0x4070e8,null))['catch'](handleError(_0x4070e8,null));};exports[_0x97c5('0x5b')]=function(_0x483c08,_0x429362,_0x4a7b76){return db[_0x97c5('0x35')]['findOne']({'where':{'id':_0x483c08[_0x97c5('0x4e')]['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x429362,null))['then'](function(_0x5ed112){if(!_0x483c08['query'][_0x97c5('0x5c')]||!utils['isValidChannel'](_0x483c08[_0x97c5('0x3c')][_0x97c5('0x5c')])){throw new db[(_0x97c5('0x5d'))][(_0x97c5('0x5e'))](_0x97c5('0x5f'));}var _0x52e9a7={};var _0xbd4ef3={};_0xbd4ef3[_0x97c5('0x3a')]=_[_0x97c5('0x3b')](db[_[_0x97c5('0x60')](_0x483c08[_0x97c5('0x3c')][_0x97c5('0x5c')][_0x97c5('0x61')]())+_0x97c5('0x62')][_0x97c5('0x36')]);_0xbd4ef3[_0x97c5('0x3c')]=_[_0x97c5('0x3b')](_0x483c08[_0x97c5('0x3c')]);_0xbd4ef3[_0x97c5('0x3d')]=_[_0x97c5('0x4f')](_0xbd4ef3['model'],_0xbd4ef3[_0x97c5('0x3c')]);_0x52e9a7[_0x97c5('0x3e')]=_['intersection'](_0xbd4ef3[_0x97c5('0x3a')],qs['fields'](_0x483c08[_0x97c5('0x3c')]['fields']));_0x52e9a7[_0x97c5('0x3e')]=_0x52e9a7[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x52e9a7['attributes']:_0xbd4ef3[_0x97c5('0x3a')];_0x52e9a7[_0x97c5('0x23')]=qs[_0x97c5('0x23')](_0x483c08['query']['limit']);_0x52e9a7[_0x97c5('0x25')]=qs[_0x97c5('0x25')](_0x483c08[_0x97c5('0x3c')][_0x97c5('0x25')]);_0x52e9a7['order']=qs['sort'](_0x483c08[_0x97c5('0x3c')][_0x97c5('0x43')]);_0x52e9a7[_0x97c5('0x44')]=qs[_0x97c5('0x3d')](_[_0x97c5('0x45')](_0x483c08['query'],_0xbd4ef3[_0x97c5('0x3d')]));_0x52e9a7=_[_0x97c5('0x47')]({},_0x52e9a7,_0x483c08[_0x97c5('0x49')]);return _0x5ed112['get'+_[_0x97c5('0x60')](_0x483c08[_0x97c5('0x3c')][_0x97c5('0x5c')][_0x97c5('0x61')]())+_0x97c5('0x63')](_0x52e9a7);})[_0x97c5('0x2b')](respondWithResult(_0x429362,null))['catch'](handleError(_0x429362,null));};exports[_0x97c5('0x64')]=function(_0x6d7869,_0x511f50,_0x2dec7a){return db['Team']['findOne']({'where':{'id':_0x6d7869[_0x97c5('0x4e')]['id']}})['then'](function(_0x31f673){if(_0x31f673){if(!_0x6d7869[_0x97c5('0x52')][_0x97c5('0x5c')]||!utils[_0x97c5('0x65')](_0x6d7869['body'][_0x97c5('0x5c')])){throw new db[(_0x97c5('0x5d'))][(_0x97c5('0x5e'))](_0x97c5('0x5f'));}return _0x31f673[_0x97c5('0x66')+_[_0x97c5('0x60')](_0x6d7869[_0x97c5('0x52')]['channel']['toLowerCase']())+_0x97c5('0x63')](_0x6d7869['body'][_0x97c5('0x67')]);}return null;})[_0x97c5('0x2b')](handleEntityNotFound(_0x511f50,null))[_0x97c5('0x2b')](respondWithStatusCode(_0x511f50,null))[_0x97c5('0x4c')](handleError(_0x511f50,null));};exports[_0x97c5('0x68')]=function(_0x48b508,_0x3ed1a0,_0x64424b){return db[_0x97c5('0x35')][_0x97c5('0x69')]({'where':{'id':_0x48b508['params']['id']}})[_0x97c5('0x2b')](function(_0x59c226){if(_0x59c226){if(!_0x48b508['query']['channel']||!utils['isValidChannel'](_0x48b508[_0x97c5('0x3c')]['channel'])){throw new db[(_0x97c5('0x5d'))][(_0x97c5('0x5e'))](_0x97c5('0x5f'));}return _0x59c226[_0x97c5('0x6a')+_[_0x97c5('0x60')](_0x48b508[_0x97c5('0x3c')][_0x97c5('0x5c')][_0x97c5('0x61')]())+_0x97c5('0x63')](_0x48b508[_0x97c5('0x3c')]['ids']);}return null;})[_0x97c5('0x2b')](handleEntityNotFound(_0x3ed1a0,null))[_0x97c5('0x2b')](respondWithStatusCode(_0x3ed1a0,null))['catch'](handleError(_0x3ed1a0,null));};exports[_0x97c5('0x6b')]=function(_0x20590c,_0x111a3e){return db['Team'][_0x97c5('0x50')]({'where':{'id':_0x20590c['params']['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x111a3e,null))[_0x97c5('0x2b')](function(_0x19daf9){if(_0x19daf9){var _0x545d04=[_0x97c5('0x6c'),_0x97c5('0x6d'),_0x97c5('0x6e'),_0x97c5('0x6f'),_0x97c5('0x70'),_0x97c5('0x71'),'Whatsapp'];return db[_0x97c5('0x72')][_0x97c5('0x73')](function(_0x4fa417){var _0x25cbb4=_[_0x97c5('0x34')](_0x545d04,function(_0x33e91a){var _0x3bac92={'attributes':['id',_0x97c5('0x32')]};if(_0x33e91a==='Voice'){_0x3bac92[_0x97c5('0x74')]={'attributes':[_0x97c5('0x75')]};}return _0x19daf9[_0x97c5('0x2c')+_0x33e91a+_0x97c5('0x63')](_0x3bac92)[_0x97c5('0x2b')](function(_0x4f5585){var _0x151651=_['map'](_0x4f5585,function(_0x44d757){var _0x399f04=_[_0x97c5('0x34')](_0x20590c[_0x97c5('0x52')][_0x97c5('0x67')],function(_0x1ea649){var _0x5aa4ad={'where':{'UserId':_0x1ea649,[_0x33e91a+_0x97c5('0x76')]:_0x44d757['id']},'transaction':_0x4fa417};if(_0x33e91a==='Voice'){_0x5aa4ad[_0x97c5('0x1a')]={'penalty':_0x44d757['TeamVoiceQueue'][_0x97c5('0x75')]};}return db[_0x97c5('0x77')+_0x33e91a+_0x97c5('0x62')][_0x97c5('0x78')](_0x5aa4ad)[_0x97c5('0x2b')](function(){socket[_0x97c5('0x79')](_0x97c5('0x53')+_0x33e91a+_0x97c5('0x7a'),{'UserId':_0x1ea649,[_0x33e91a+_0x97c5('0x76')]:_0x44d757['id']});if(_0x33e91a!==_0x97c5('0x6c'))return;return db[_0x97c5('0x77')][_0x97c5('0x7b')]({'where':{'id':_0x20590c[_0x97c5('0x52')][_0x97c5('0x67')],'online':0x1},'attributes':['id','name',_0x97c5('0x7c'),_0x97c5('0x7d'),_0x97c5('0x7e')],'raw':!![]})[_0x97c5('0x2b')](function(_0x394d87){var _0x1ee1c1=_[_0x97c5('0x34')](_0x394d87,function(_0x3e1b1c){return db[_0x97c5('0x7f')][_0x97c5('0x80')]({'membername':_0x3e1b1c[_0x97c5('0x32')],'UserId':_0x3e1b1c['id'],'queue_name':_0x44d757[_0x97c5('0x32')],'VoiceQueueId':_0x44d757['id'],'interface':_[_0x97c5('0x81')](_0x3e1b1c[_0x97c5('0x7e')])?util[_0x97c5('0x82')](_0x97c5('0x83'),_0x3e1b1c[_0x97c5('0x32')]):_0x3e1b1c[_0x97c5('0x7e')],'paused':_0x3e1b1c[_0x97c5('0x7d')]||![],'penalty':_0x44d757[_0x97c5('0x84')][_0x97c5('0x75')]},{'transaction':_0x4fa417});});return Promise[_0x97c5('0x85')](_0x1ee1c1);});});});return Promise[_0x97c5('0x85')](_0x399f04);});return Promise['all'](_0x151651);});});return Promise[_0x97c5('0x85')](_0x25cbb4)[_0x97c5('0x2b')](function(){return _0x19daf9['addAgents'](_0x20590c[_0x97c5('0x52')]['ids'],{'transaction':_0x4fa417})[_0x97c5('0x86')](function(_0x4724b2){return _0x4724b2;});});});}})[_0x97c5('0x2b')](respondWithResult(_0x111a3e,null))['catch'](handleError(_0x111a3e,null));};exports[_0x97c5('0x87')]=function(_0x2b6b59,_0x5c55ef){return db['Team']['find']({'where':{'id':_0x2b6b59['params']['id']}})['then'](handleEntityNotFound(_0x5c55ef,null))['then'](function(_0x368ed2){if(_0x368ed2){var _0x322ec9=[_0x97c5('0x6c'),_0x97c5('0x6d'),_0x97c5('0x6e'),_0x97c5('0x6f'),_0x97c5('0x70'),_0x97c5('0x71'),_0x97c5('0x88')];return db['sequelize'][_0x97c5('0x73')](function(_0x8e2cc){var _0x1ea915=_[_0x97c5('0x34')](_0x322ec9,function(_0x25929e){var _0x34eb60={'attributes':['id',_0x97c5('0x32')]};return _0x368ed2['get'+_0x25929e+_0x97c5('0x63')](_0x34eb60)[_0x97c5('0x2b')](function(_0xa38f73){var _0x5be314=_['map'](_0xa38f73,function(_0x2e8764){return _0x2e8764[_0x97c5('0x87')](_0x2b6b59['query'][_0x97c5('0x67')],{'transaction':_0x8e2cc})['then'](function(){var _0x2b5981=JSON[_0x97c5('0x89')]('['+_0x2b6b59[_0x97c5('0x3c')][_0x97c5('0x67')]+']');var _0x2966c1=_[_0x97c5('0x34')](_0x2b5981,function(_0x4ae17a){socket[_0x97c5('0x79')](_0x97c5('0x53')+_0x25929e+_0x97c5('0x8a'),{'UserId':Number(_0x4ae17a),[_0x25929e+_0x97c5('0x76')]:_0x2e8764['id']});if(_0x25929e!=='Voice')return;return db['UserVoiceQueueRt'][_0x97c5('0x2f')]({'where':{'VoiceQueueId':_0x2e8764['id'],'UserId':_0x4ae17a},'transaction':_0x8e2cc});});return Promise[_0x97c5('0x85')](_0x2966c1);});});return Promise[_0x97c5('0x85')](_0x5be314);});});return Promise['all'](_0x1ea915)[_0x97c5('0x2b')](function(){return _0x368ed2['removeAgents'](_0x2b6b59[_0x97c5('0x3c')]['ids'],{'transaction':_0x8e2cc});});});}})[_0x97c5('0x2b')](respondWithStatusCode(_0x5c55ef,null))[_0x97c5('0x4c')](handleError(_0x5c55ef,null));};exports[_0x97c5('0x8b')]=function(_0x3e6127,_0x5100e8,_0x4c2274){var _0x52c97b={};var _0x2b0eef={};var _0xbb8435;var _0x1f0236;return db[_0x97c5('0x35')][_0x97c5('0x69')]({'where':{'id':_0x3e6127[_0x97c5('0x4e')]['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x5100e8,null))['then'](function(_0x5958fd){if(_0x5958fd){_0xbb8435=_0x5958fd;_0x2b0eef['model']=_[_0x97c5('0x3b')](db[_0x97c5('0x77')][_0x97c5('0x36')]);_0x2b0eef[_0x97c5('0x3c')]=_['keys'](_0x3e6127[_0x97c5('0x3c')]);_0x2b0eef[_0x97c5('0x3d')]=_[_0x97c5('0x4f')](_0x2b0eef[_0x97c5('0x3a')],_0x2b0eef['query']);_0x52c97b[_0x97c5('0x3e')]=_['intersection'](_0x2b0eef[_0x97c5('0x3a')],qs[_0x97c5('0x3f')](_0x3e6127['query'][_0x97c5('0x3f')]));_0x52c97b[_0x97c5('0x3e')]=_0x52c97b[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x52c97b[_0x97c5('0x3e')]:_0x2b0eef[_0x97c5('0x3a')];_0x52c97b['order']=qs[_0x97c5('0x43')](_0x3e6127[_0x97c5('0x3c')]['sort']);_0x52c97b['where']=qs[_0x97c5('0x3d')](_[_0x97c5('0x45')](_0x3e6127[_0x97c5('0x3c')],_0x2b0eef['filters']));if(_0x3e6127[_0x97c5('0x3c')][_0x97c5('0x46')]){_0x52c97b[_0x97c5('0x44')]=_[_0x97c5('0x47')](_0x52c97b[_0x97c5('0x44')],{'$or':_[_0x97c5('0x34')](_0x52c97b[_0x97c5('0x3e')],function(_0x46f58e){var _0x56c111={};_0x56c111[_0x46f58e]={'$like':'%'+_0x3e6127[_0x97c5('0x3c')][_0x97c5('0x46')]+'%'};return _0x56c111;})});}_0x52c97b=_[_0x97c5('0x47')]({},_0x52c97b,_0x3e6127[_0x97c5('0x49')]);return _0xbb8435[_0x97c5('0x8b')](_0x52c97b);}})[_0x97c5('0x2b')](function(_0x36586d){if(_0x36586d){_0x1f0236=_0x36586d['length'];if(!_0x3e6127[_0x97c5('0x3c')]['hasOwnProperty']('nolimit')){_0x52c97b['limit']=qs['limit'](_0x3e6127[_0x97c5('0x3c')]['limit']);_0x52c97b[_0x97c5('0x25')]=qs['offset'](_0x3e6127[_0x97c5('0x3c')][_0x97c5('0x25')]);}return _0xbb8435[_0x97c5('0x8b')](_0x52c97b);}})[_0x97c5('0x2b')](function(_0x3b7260){if(_0x3b7260){return _0x3b7260?{'count':_0x1f0236,'rows':_0x3b7260}:null;}})[_0x97c5('0x2b')](respondWithResult(_0x5100e8,null))[_0x97c5('0x4c')](handleError(_0x5100e8,null));};
\ No newline at end of file
index d24a673..edd500f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff4f=['remove','emit','hasOwnProperty','exports','Team','setMaxListeners'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xff4f,0x1e4));var _0xfff4=function(_0x5e99ff,_0x5e7a57){_0x5e99ff=_0x5e99ff-0x0;var _0xf9d4b5=_0xff4f[_0x5e99ff];return _0xf9d4b5;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xfff4('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xfff4('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfff4('0x2')};function emitEvent(_0xd7d6d9){return function(_0xb00dd6,_0x3fbcaa,_0x34e0ac){TeamEvents['emit'](_0xd7d6d9+':'+_0xb00dd6['id'],_0xb00dd6);TeamEvents[_0xfff4('0x3')](_0xd7d6d9,_0xb00dd6);_0x34e0ac(null);};}for(var e in events){if(events[_0xfff4('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xfff4('0x5')]=TeamEvents;
\ No newline at end of file
+var _0xaea3=['update','remove','emit','hook','../../mysqldb','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaea3,0x146));var _0x3aea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaea3[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var Team=require(_0x3aea('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x3aea('0x1')](0x0);var events={'afterCreate':_0x3aea('0x2'),'afterUpdate':_0x3aea('0x3'),'afterDestroy':_0x3aea('0x4')};function emitEvent(_0x9442de){return function(_0x17f909,_0x3f5a44,_0x1a3673){TeamEvents[_0x3aea('0x5')](_0x9442de+':'+_0x17f909['id'],_0x17f909);TeamEvents[_0x3aea('0x5')](_0x9442de,_0x17f909);_0x1a3673(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x3aea('0x6')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index 674766f..aab1e89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ef9=['request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','teams','lodash','../../config/logger','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4ef9,0x1b9));var _0x94ef=function(_0xd2548e,_0x556106){_0xd2548e=_0xd2548e-0x0;var _0x1258d3=_0x4ef9[_0xd2548e];return _0x1258d3;};'use strict';var _=require(_0x94ef('0x0'));var util=require('util');var logger=require(_0x94ef('0x1'))('api');var moment=require(_0x94ef('0x2'));var BPromise=require('bluebird');var rp=require(_0x94ef('0x3'));var fs=require('fs');var path=require(_0x94ef('0x4'));var rimraf=require(_0x94ef('0x5'));var config=require(_0x94ef('0x6'));var attributes=require(_0x94ef('0x7'));module[_0x94ef('0x8')]=function(_0x2e6802,_0x4595ee){return _0x2e6802[_0x94ef('0x9')](_0x94ef('0xa'),attributes,{'tableName':_0x94ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac5f=['util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xac5f,0xf3));var _0xfac5=function(_0x33c97d,_0x4ba623){_0x33c97d=_0x33c97d-0x0;var _0x29b037=_0xac5f[_0x33c97d];return _0x29b037;};'use strict';var _=require('lodash');var util=require(_0xfac5('0x0'));var logger=require(_0xfac5('0x1'))(_0xfac5('0x2'));var moment=require(_0xfac5('0x3'));var BPromise=require('bluebird');var rp=require(_0xfac5('0x4'));var fs=require('fs');var path=require(_0xfac5('0x5'));var rimraf=require(_0xfac5('0x6'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xfac5('0x7')]=function(_0x140396,_0x1d7e38){return _0x140396[_0xfac5('0x8')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index de05fe9..acb1607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42c1=['message','info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x45745d,_0x541e6d){var _0x3c1408=function(_0x18f383){while(--_0x18f383){_0x45745d['push'](_0x45745d['shift']());}};_0x3c1408(++_0x541e6d);}(_0x42c1,0x145));var _0x142c=function(_0x323676,_0x50863e){_0x323676=_0x323676-0x0;var _0x580101=_0x42c1[_0x323676];return _0x580101;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x142c('0x0'));var rs=require(_0x142c('0x1'));var fs=require('fs');var Redis=require(_0x142c('0x2'));var db=require(_0x142c('0x3'))['db'];var utils=require(_0x142c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x142c('0x5'));var jayson=require(_0x142c('0x6'));var client=jayson[_0x142c('0x7')][_0x142c('0x8')]({'port':0x232a});config[_0x142c('0x9')]=_[_0x142c('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0x142c('0xb')](socket);function respondWithRpcPromise(_0x58a9b6,_0x5b0614,_0x4bdce5){return new BPromise(function(_0xeb3445,_0x536f54){return client[_0x142c('0xc')](_0x58a9b6,_0x4bdce5)[_0x142c('0xd')](function(_0x35780f){logger['info'](_0x142c('0xe'),_0x5b0614,_0x142c('0xf'));logger['debug'](_0x142c('0x10'),_0x5b0614,'request\x20sent',JSON[_0x142c('0x11')](_0x35780f));if(_0x35780f[_0x142c('0x12')]){if(_0x35780f['error'][_0x142c('0x13')]===0x1f4){logger['error'](_0x142c('0xe'),_0x5b0614,_0x35780f[_0x142c('0x12')][_0x142c('0x14')]);return _0x536f54(_0x35780f[_0x142c('0x12')][_0x142c('0x14')]);}logger['error']('Team,\x20%s,\x20%s',_0x5b0614,_0x35780f['error'][_0x142c('0x14')]);return _0xeb3445(_0x35780f[_0x142c('0x12')]['message']);}else{logger[_0x142c('0x15')](_0x142c('0xe'),_0x5b0614,'request\x20sent');_0xeb3445(_0x35780f['result'][_0x142c('0x14')]);}})[_0x142c('0x16')](function(_0x283fc7){logger['error'](_0x142c('0xe'),_0x5b0614,_0x283fc7);_0x536f54(_0x283fc7);});});}
\ No newline at end of file
+var _0xca16=['then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','request'];(function(_0x1300ec,_0x3ff267){var _0x2c13c9=function(_0x58d88){while(--_0x58d88){_0x1300ec['push'](_0x1300ec['shift']());}};_0x2c13c9(++_0x3ff267);}(_0xca16,0x1dc));var _0x6ca1=function(_0x241a07,_0x5f117c){_0x241a07=_0x241a07-0x0;var _0x433062=_0xca16[_0x241a07];return _0x433062;};'use strict';var _=require(_0x6ca1('0x0'));var util=require(_0x6ca1('0x1'));var moment=require(_0x6ca1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ca1('0x3'));var db=require(_0x6ca1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ca1('0x5'))(_0x6ca1('0x6'));var config=require(_0x6ca1('0x7'));var jayson=require(_0x6ca1('0x8'));var client=jayson[_0x6ca1('0x9')][_0x6ca1('0xa')]({'port':0x232a});config[_0x6ca1('0xb')]=_[_0x6ca1('0xc')](config[_0x6ca1('0xb')],{'host':_0x6ca1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ca1('0xb')]));require(_0x6ca1('0xe'))[_0x6ca1('0xf')](socket);function respondWithRpcPromise(_0x5c2f33,_0x26c388,_0xa84742){return new BPromise(function(_0x31da85,_0x217015){return client[_0x6ca1('0x10')](_0x5c2f33,_0xa84742)[_0x6ca1('0x11')](function(_0x2f3070){logger[_0x6ca1('0x12')]('Team,\x20%s,\x20%s',_0x26c388,_0x6ca1('0x13'));logger[_0x6ca1('0x14')](_0x6ca1('0x15'),_0x26c388,_0x6ca1('0x13'),JSON[_0x6ca1('0x16')](_0x2f3070));if(_0x2f3070[_0x6ca1('0x17')]){if(_0x2f3070['error'][_0x6ca1('0x18')]===0x1f4){logger['error'](_0x6ca1('0x19'),_0x26c388,_0x2f3070[_0x6ca1('0x17')]['message']);return _0x217015(_0x2f3070[_0x6ca1('0x17')]['message']);}logger['error'](_0x6ca1('0x19'),_0x26c388,_0x2f3070['error'][_0x6ca1('0x1a')]);return _0x31da85(_0x2f3070[_0x6ca1('0x17')]['message']);}else{logger[_0x6ca1('0x12')](_0x6ca1('0x19'),_0x26c388,_0x6ca1('0x13'));_0x31da85(_0x2f3070[_0x6ca1('0x1b')][_0x6ca1('0x1a')]);}})[_0x6ca1('0x1c')](function(_0x3b9fe7){logger['error'](_0x6ca1('0x19'),_0x26c388,_0x3b9fe7);_0x217015(_0x3b9fe7);});});}
\ No newline at end of file
index c9a3761..46c7cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67da=['removeListener','length','team:','save','remove','update','emit'];(function(_0x30d3b5,_0x1e9bcb){var _0x37603a=function(_0x35c140){while(--_0x35c140){_0x30d3b5['push'](_0x30d3b5['shift']());}};_0x37603a(++_0x1e9bcb);}(_0x67da,0x192));var _0xa67d=function(_0x2daf49,_0x131e8a){_0x2daf49=_0x2daf49-0x0;var _0x67085d=_0x67da[_0x2daf49];return _0x67085d;};'use strict';var TeamEvents=require('./team.events');var events=[_0xa67d('0x0'),_0xa67d('0x1'),_0xa67d('0x2')];function createListener(_0x3cae01,_0x472755){return function(_0x3633a0){_0x472755[_0xa67d('0x3')](_0x3cae01,_0x3633a0);};}function removeListener(_0x1a8b5e,_0x3dcee7){return function(){TeamEvents[_0xa67d('0x4')](_0x1a8b5e,_0x3dcee7);};}exports['register']=function(_0x5b8ec7){for(var _0x408786=0x0,_0x4d2734=events[_0xa67d('0x5')];_0x408786<_0x4d2734;_0x408786++){var _0x2346f4=events[_0x408786];var _0x10f89a=createListener(_0xa67d('0x6')+_0x2346f4,_0x5b8ec7);TeamEvents['on'](_0x2346f4,_0x10f89a);}};
\ No newline at end of file
+var _0x47c7=['length','team:','save','remove','update','emit','register'];(function(_0x45f7c9,_0x192a73){var _0x2c6810=function(_0xddb463){while(--_0xddb463){_0x45f7c9['push'](_0x45f7c9['shift']());}};_0x2c6810(++_0x192a73);}(_0x47c7,0x1f3));var _0x747c=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x47c7[_0x1ab180];return _0xfb2c2d;};'use strict';var TeamEvents=require('./team.events');var events=[_0x747c('0x0'),_0x747c('0x1'),_0x747c('0x2')];function createListener(_0x5d8956,_0x552a0f){return function(_0x2cf1a3){_0x552a0f[_0x747c('0x3')](_0x5d8956,_0x2cf1a3);};}function removeListener(_0x627fc5,_0x3f4579){return function(){TeamEvents['removeListener'](_0x627fc5,_0x3f4579);};}exports[_0x747c('0x4')]=function(_0x5c9a0b){for(var _0xf4d0b2=0x0,_0x351f82=events[_0x747c('0x5')];_0xf4d0b2<_0x351f82;_0xf4d0b2++){var _0x2e0e82=events[_0xf4d0b2];var _0x8b3b3b=createListener(_0x747c('0x6')+_0x2e0e82,_0x5c9a0b);TeamEvents['on'](_0x2e0e82,_0x8b3b3b);}};
\ No newline at end of file
index 2ece227..f0577e6 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(_0x33e450,_0x4929be){var _0xebfe73=function(_0x5098c1){while(--_0x5098c1){_0x33e450['push'](_0x33e450['shift']());}};_0xebfe73(++_0x4929be);}(_0x70e0,0x17b));var _0x070e=function(_0x1b0335,_0x38326c){_0x1b0335=_0x1b0335-0x0;var _0x5ecde8=_0x70e0[_0x1b0335];return _0x5ecde8;};'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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2bb455,_0x1e0a7c){var _0x1d2cfc=function(_0x217390){while(--_0x217390){_0x2bb455['push'](_0x2bb455['shift']());}};_0x1d2cfc(++_0x1e0a7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xaf025d,_0x586d7a){_0xaf025d=_0xaf025d-0x0;var _0x1c77cb=_0xcb91[_0xaf025d];return _0x1c77cb;};'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 8eb2ea1..2119985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4b6=['INTEGER','exports'];(function(_0x53c085,_0x5049b5){var _0xfc210a=function(_0x40b46c){while(--_0x40b46c){_0x53c085['push'](_0x53c085['shift']());}};_0xfc210a(++_0x5049b5);}(_0xf4b6,0x85));var _0x6f4b=function(_0x623401,_0x1ec322){_0x623401=_0x623401-0x0;var _0x424849=_0xf4b6[_0x623401];return _0x424849;};'use strict';var Sequelize=require('sequelize');module[_0x6f4b('0x0')]={'penalty':{'type':Sequelize[_0x6f4b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x63b1=['sequelize','exports','INTEGER'];(function(_0x2ea5ae,_0x3fe75f){var _0x208303=function(_0x39e3a9){while(--_0x39e3a9){_0x2ea5ae['push'](_0x2ea5ae['shift']());}};_0x208303(++_0x3fe75f);}(_0x63b1,0x96));var _0x163b=function(_0x10e1d4,_0x17aed9){_0x10e1d4=_0x10e1d4-0x0;var _0x169a61=_0x63b1[_0x10e1d4];return _0x169a61;};'use strict';var Sequelize=require(_0x163b('0x0'));module[_0x163b('0x1')]={'penalty':{'type':Sequelize[_0x163b('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 40662c1..eb48e71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb18e=['request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','team_has_voice_queues','../../config/logger','moment'];(function(_0x9a9f24,_0x47ed04){var _0x3422cb=function(_0x4431a4){while(--_0x4431a4){_0x9a9f24['push'](_0x9a9f24['shift']());}};_0x3422cb(++_0x47ed04);}(_0xb18e,0x181));var _0xeb18=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0xb18e[_0xdaab62];return _0x13d767;};'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')]('TeamVoiceQueue',attributes,{'tableName':_0xeb18('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x032e=['exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x3071ab,_0x574a59){var _0x2f458c=function(_0x1eb9c7){while(--_0x1eb9c7){_0x3071ab['push'](_0x3071ab['shift']());}};_0x2f458c(++_0x574a59);}(_0x032e,0x124));var _0xe032=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x032e[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xe032('0x0'));var util=require('util');var logger=require(_0xe032('0x1'))(_0xe032('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe032('0x3'));var fs=require('fs');var path=require(_0xe032('0x4'));var rimraf=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var attributes=require(_0xe032('0x7'));module[_0xe032('0x8')]=function(_0x2ba8a0,_0x33ad0b){return _0x2ba8a0[_0xe032('0x9')](_0xe032('0xa'),attributes,{'tableName':_0xe032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87759e0..debd538 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ba=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d718b,_0x1f53f2){var _0x27144c=function(_0x402ec2){while(--_0x402ec2){_0x2d718b['push'](_0x2d718b['shift']());}};_0x27144c(++_0x1f53f2);}(_0xc5ba,0xb9));var _0xac5b=function(_0x20008a,_0x362490){_0x20008a=_0x20008a-0x0;var _0x5d0f1c=_0xc5ba[_0x20008a];return _0x5d0f1c;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var moment=require(_0xac5b('0x2'));var BPromise=require(_0xac5b('0x3'));var rs=require(_0xac5b('0x4'));var fs=require('fs');var Redis=require(_0xac5b('0x5'));var db=require(_0xac5b('0x6'))['db'];var utils=require(_0xac5b('0x7'));var logger=require(_0xac5b('0x8'))(_0xac5b('0x9'));var config=require(_0xac5b('0xa'));var jayson=require(_0xac5b('0xb'));var client=jayson[_0xac5b('0xc')][_0xac5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38602a,_0xc09fbc,_0xc193a7){return new BPromise(function(_0x4a7fc7,_0x525e20){return client[_0xac5b('0xe')](_0x38602a,_0xc193a7)['then'](function(_0x3c5bd3){logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));logger[_0xac5b('0x12')](_0xac5b('0x13'),_0xc09fbc,_0xac5b('0x11'),JSON[_0xac5b('0x14')](_0x3c5bd3));if(_0x3c5bd3[_0xac5b('0x15')]){if(_0x3c5bd3['error'][_0xac5b('0x16')]===0x1f4){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x525e20(_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);}logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x3c5bd3[_0xac5b('0x15')][_0xac5b('0x17')]);return _0x4a7fc7(_0x3c5bd3[_0xac5b('0x15')]['message']);}else{logger[_0xac5b('0xf')](_0xac5b('0x10'),_0xc09fbc,_0xac5b('0x11'));_0x4a7fc7(_0x3c5bd3[_0xac5b('0x18')][_0xac5b('0x17')]);}})[_0xac5b('0x19')](function(_0x363de5){logger[_0xac5b('0x15')](_0xac5b('0x10'),_0xc09fbc,_0x363de5);_0x525e20(_0x363de5);});});}
\ No newline at end of file
+var _0xc85c=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x266bac,_0xe03f9a){var _0x267ee2=function(_0x3e4291){while(--_0x3e4291){_0x266bac['push'](_0x266bac['shift']());}};_0x267ee2(++_0xe03f9a);}(_0xc85c,0xf2));var _0xcc85=function(_0x13d580,_0x53a187){_0x13d580=_0x13d580-0x0;var _0x5e124b=_0xc85c[_0x13d580];return _0x5e124b;};'use strict';var _=require(_0xcc85('0x0'));var util=require(_0xcc85('0x1'));var moment=require('moment');var BPromise=require(_0xcc85('0x2'));var rs=require(_0xcc85('0x3'));var fs=require('fs');var Redis=require(_0xcc85('0x4'));var db=require(_0xcc85('0x5'))['db'];var utils=require(_0xcc85('0x6'));var logger=require(_0xcc85('0x7'))(_0xcc85('0x8'));var config=require(_0xcc85('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5172dd,_0x55d825,_0x37f9be){return new BPromise(function(_0xa2dc3e,_0xb1af23){return client['request'](_0x5172dd,_0x37f9be)['then'](function(_0x2916a9){logger[_0xcc85('0xa')](_0xcc85('0xb'),_0x55d825,_0xcc85('0xc'));logger[_0xcc85('0xd')](_0xcc85('0xe'),_0x55d825,_0xcc85('0xc'),JSON['stringify'](_0x2916a9));if(_0x2916a9[_0xcc85('0xf')]){if(_0x2916a9[_0xcc85('0xf')][_0xcc85('0x10')]===0x1f4){logger[_0xcc85('0xf')](_0xcc85('0xb'),_0x55d825,_0x2916a9[_0xcc85('0xf')]['message']);return _0xb1af23(_0x2916a9[_0xcc85('0xf')][_0xcc85('0x11')]);}logger['error'](_0xcc85('0xb'),_0x55d825,_0x2916a9[_0xcc85('0xf')][_0xcc85('0x11')]);return _0xa2dc3e(_0x2916a9[_0xcc85('0xf')][_0xcc85('0x11')]);}else{logger[_0xcc85('0xa')](_0xcc85('0xb'),_0x55d825,_0xcc85('0xc'));_0xa2dc3e(_0x2916a9[_0xcc85('0x12')][_0xcc85('0x11')]);}})[_0xcc85('0x13')](function(_0x554649){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x55d825,_0x554649);_0xb1af23(_0x554649);});});}
\ No newline at end of file
index 6798336..9421952 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26c2=['index','post','put','/:id','update','delete','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26c2,0x1d6));var _0x226c=function(_0x39952e,_0x40c621){_0x39952e=_0x39952e-0x0;var _0x5004de=_0x26c2[_0x39952e];return _0x5004de;};'use strict';var multer=require('multer');var util=require(_0x226c('0x0'));var path=require(_0x226c('0x1'));var timeout=require(_0x226c('0x2'));var express=require(_0x226c('0x3'));var router=express['Router']();var fs_extra=require(_0x226c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x5'));var config=require(_0x226c('0x6'));var controller=require(_0x226c('0x7'));router[_0x226c('0x8')]('/',auth[_0x226c('0x9')](),controller[_0x226c('0xa')]);router[_0x226c('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x226c('0xb')]('/',auth[_0x226c('0x9')](),controller['create']);router[_0x226c('0xc')](_0x226c('0xd'),auth[_0x226c('0x9')](),controller[_0x226c('0xe')]);router[_0x226c('0xf')](_0x226c('0xd'),auth[_0x226c('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xc4d8=['show','create','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc4d8[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0x8c4d('0x0'));var util=require('util');var path=require(_0x8c4d('0x1'));var timeout=require(_0x8c4d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c4d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8c4d('0x4'));var controller=require(_0x8c4d('0x5'));router[_0x8c4d('0x6')]('/',auth[_0x8c4d('0x7')](),controller[_0x8c4d('0x8')]);router[_0x8c4d('0x6')](_0x8c4d('0x9'),auth[_0x8c4d('0x7')](),controller[_0x8c4d('0xa')]);router['post']('/',auth[_0x8c4d('0x7')](),controller[_0x8c4d('0xb')]);router[_0x8c4d('0xc')](_0x8c4d('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8c4d('0xd')](_0x8c4d('0x9'),auth[_0x8c4d('0x7')](),controller[_0x8c4d('0xe')]);module[_0x8c4d('0xf')]=router;
\ No newline at end of file
index edbace6..cfded34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfce0=['sequelize','exports','STRING','TEXT'];(function(_0x5b7361,_0xa93e5a){var _0x21c7a4=function(_0x5142e9){while(--_0x5142e9){_0x5b7361['push'](_0x5b7361['shift']());}};_0x21c7a4(++_0xa93e5a);}(_0xfce0,0x78));var _0x0fce=function(_0x5b7412,_0x28b1ed){_0x5b7412=_0x5b7412-0x0;var _0x2a55f5=_0xfce0[_0x5b7412];return _0x2a55f5;};'use strict';var Sequelize=require(_0x0fce('0x0'));module[_0x0fce('0x1')]={'name':{'type':Sequelize[_0x0fce('0x2')]},'description':{'type':Sequelize[_0x0fce('0x2')]},'html':{'type':Sequelize[_0x0fce('0x3')]}};
\ No newline at end of file
+var _0x538b=['STRING','TEXT','sequelize'];(function(_0x3925e5,_0x5dcecb){var _0x57d9a0=function(_0x2c837a){while(--_0x2c837a){_0x3925e5['push'](_0x3925e5['shift']());}};_0x57d9a0(++_0x5dcecb);}(_0x538b,0xf2));var _0xb538=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x538b[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xb538('0x0'));module['exports']={'name':{'type':Sequelize[_0xb538('0x1')]},'description':{'type':Sequelize[_0xb538('0x1')]},'html':{'type':Sequelize[_0xb538('0x2')]}};
\ No newline at end of file
index 38ab21e..7605e51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf16e=['body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','count','limit','Content-Range','save','update','then','destroy','get','Templates','stack','name','send','index','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge','options','Template','findAll','show','params','includeAll','include','find','catch','create'];(function(_0x267dd0,_0x41e87b){var _0x1a2fd9=function(_0x57a2a8){while(--_0x57a2a8){_0x267dd0['push'](_0x267dd0['shift']());}};_0x1a2fd9(++_0x41e87b);}(_0xf16e,0x19e));var _0xef16=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xf16e[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0xef16('0x0'));var rimraf=require(_0xef16('0x1'));var zipdir=require(_0xef16('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xef16('0x3'));var moment=require(_0xef16('0x4'));var BPromise=require(_0xef16('0x5'));var Mustache=require(_0xef16('0x6'));var util=require('util');var path=require(_0xef16('0x7'));var sox=require(_0xef16('0x8'));var csv=require(_0xef16('0x9'));var ejs=require(_0xef16('0xa'));var fs=require('fs');var fs_extra=require(_0xef16('0xb'));var _=require(_0xef16('0xc'));var squel=require(_0xef16('0xd'));var crypto=require(_0xef16('0xe'));var jsforce=require(_0xef16('0xf'));var deskjs=require(_0xef16('0x10'));var toCsv=require(_0xef16('0x9'));var querystring=require(_0xef16('0x11'));var Papa=require(_0xef16('0x12'));var Redis=require(_0xef16('0x13'));var authService=require(_0xef16('0x14'));var qs=require(_0xef16('0x15'));var as=require(_0xef16('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef16('0x17'))('api');var utils=require(_0xef16('0x18'));var config=require(_0xef16('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bbc0c,_0x514ac0){_0x514ac0=_0x514ac0||0xcc;return function(_0x26d035){if(_0x26d035){return _0x1bbc0c[_0xef16('0x1a')](_0x514ac0);}return _0x1bbc0c[_0xef16('0x1b')](_0x514ac0)[_0xef16('0x1c')]();};}function respondWithResult(_0x54f3ad,_0x5f12a3){_0x5f12a3=_0x5f12a3||0xc8;return function(_0x290adb){if(_0x290adb){return _0x54f3ad['status'](_0x5f12a3)[_0xef16('0x1d')](_0x290adb);}};}function respondWithFilteredResult(_0x33f598,_0x14bab6){return function(_0xa31eae){if(_0xa31eae){var _0x360c38=typeof _0x14bab6[_0xef16('0x1e')]==='undefined'&&typeof _0x14bab6['limit']==='undefined';var _0x38c75e=_0xa31eae[_0xef16('0x1f')];var _0x1b30da=_0x360c38?0x0:_0x14bab6[_0xef16('0x1e')];var _0x29599d=_0x360c38?_0xa31eae[_0xef16('0x1f')]:_0x14bab6[_0xef16('0x1e')]+_0x14bab6[_0xef16('0x20')];var _0x337a4f;if(_0x29599d>=_0x38c75e){_0x29599d=_0x38c75e;_0x337a4f=0xc8;}else{_0x337a4f=0xce;}_0x33f598[_0xef16('0x1b')](_0x337a4f);return _0x33f598['set'](_0xef16('0x21'),_0x1b30da+'-'+_0x29599d+'/'+_0x38c75e)[_0xef16('0x1d')](_0xa31eae);}return null;};}function patchUpdates(_0x16ab7f){return function(_0x4fa080){try{jsonpatch['apply'](_0x4fa080,_0x16ab7f,!![]);}catch(_0x5aa993){return BPromise['reject'](_0x5aa993);}return _0x4fa080[_0xef16('0x22')]();};}function saveUpdates(_0x2501de,_0x396ae5){return function(_0x254ad9){if(_0x254ad9){return _0x254ad9[_0xef16('0x23')](_0x2501de)[_0xef16('0x24')](function(_0x395277){return _0x395277;});}return null;};}function removeEntity(_0x58ea0a,_0x4793ff){return function(_0x54b2eb){if(_0x54b2eb){return _0x54b2eb[_0xef16('0x25')]()[_0xef16('0x24')](function(){var _0x2d26f3=_0x54b2eb[_0xef16('0x26')]({'plain':!![]});var _0x139751=_0xef16('0x27');return db['UserProfileResource'][_0xef16('0x25')]({'where':{'type':_0x139751,'resourceId':_0x2d26f3['id']}})[_0xef16('0x24')](function(){return _0x54b2eb;});})[_0xef16('0x24')](function(){_0x58ea0a[_0xef16('0x1b')](0xcc)[_0xef16('0x1c')]();});}};}function handleEntityNotFound(_0x2ab2a1,_0x4605fb){return function(_0x88c781){if(!_0x88c781){_0x2ab2a1[_0xef16('0x1a')](0x194);}return _0x88c781;};}function handleError(_0xe37576,_0x125dac){_0x125dac=_0x125dac||0x1f4;return function(_0x2d35e4){logger['error'](_0x2d35e4[_0xef16('0x28')]);if(_0x2d35e4[_0xef16('0x29')]){delete _0x2d35e4[_0xef16('0x29')];}_0xe37576['status'](_0x125dac)[_0xef16('0x2a')](_0x2d35e4);};}exports[_0xef16('0x2b')]=function(_0x2bba0c,_0x538458){var _0x57da45={},_0x39bdca={},_0x2620bd={'count':0x0,'rows':[]};var _0x82eea6=_['map'](db['Template']['rawAttributes'],function(_0x211c2b){return{'name':_0x211c2b[_0xef16('0x2c')],'type':_0x211c2b[_0xef16('0x2d')]['key']};});_0x39bdca[_0xef16('0x2e')]=_['map'](_0x82eea6,_0xef16('0x29'));_0x39bdca[_0xef16('0x2f')]=_[_0xef16('0x30')](_0x2bba0c['query']);_0x39bdca[_0xef16('0x31')]=_[_0xef16('0x32')](_0x39bdca['model'],_0x39bdca['query']);_0x57da45[_0xef16('0x33')]=_[_0xef16('0x32')](_0x39bdca[_0xef16('0x2e')],qs[_0xef16('0x34')](_0x2bba0c[_0xef16('0x2f')][_0xef16('0x34')]));_0x57da45[_0xef16('0x33')]=_0x57da45[_0xef16('0x33')][_0xef16('0x35')]?_0x57da45[_0xef16('0x33')]:_0x39bdca['model'];if(!_0x2bba0c[_0xef16('0x2f')][_0xef16('0x36')]('nolimit')){_0x57da45[_0xef16('0x20')]=qs[_0xef16('0x20')](_0x2bba0c[_0xef16('0x2f')][_0xef16('0x20')]);_0x57da45[_0xef16('0x1e')]=qs['offset'](_0x2bba0c[_0xef16('0x2f')][_0xef16('0x1e')]);}_0x57da45['order']=qs['sort'](_0x2bba0c[_0xef16('0x2f')][_0xef16('0x37')]);_0x57da45[_0xef16('0x38')]=qs[_0xef16('0x31')](_[_0xef16('0x39')](_0x2bba0c[_0xef16('0x2f')],_0x39bdca['filters']),_0x82eea6);if(_0x2bba0c[_0xef16('0x2f')][_0xef16('0x3a')]){_0x57da45['where']=_['merge'](_0x57da45[_0xef16('0x38')],{'$or':_[_0xef16('0x3b')](_0x82eea6,function(_0x31be2a){if(_0x31be2a[_0xef16('0x2d')]!==_0xef16('0x3c')){var _0x1feb01={};_0x1feb01[_0x31be2a[_0xef16('0x29')]]={'$like':'%'+_0x2bba0c[_0xef16('0x2f')]['filter']+'%'};return _0x1feb01;}})});}_0x57da45=_[_0xef16('0x3d')]({},_0x57da45,_0x2bba0c[_0xef16('0x3e')]);var _0x353acd={'where':_0x57da45[_0xef16('0x38')]};return db[_0xef16('0x3f')][_0xef16('0x1f')](_0x353acd)[_0xef16('0x24')](function(_0x5d5828){_0x2620bd[_0xef16('0x1f')]=_0x5d5828;if(_0x2bba0c['query']['includeAll']){_0x57da45['include']=[{'all':!![]}];}return db['Template'][_0xef16('0x40')](_0x57da45);})[_0xef16('0x24')](function(_0x10aa8b){_0x2620bd['rows']=_0x10aa8b;return _0x2620bd;})['then'](respondWithFilteredResult(_0x538458,_0x57da45))['catch'](handleError(_0x538458,null));};exports[_0xef16('0x41')]=function(_0x21814f,_0x2566e5){var _0x20ed40={'raw':!![],'where':{'id':_0x21814f[_0xef16('0x42')]['id']}},_0x330658={};_0x330658[_0xef16('0x2e')]=_[_0xef16('0x30')](db[_0xef16('0x3f')]['rawAttributes']);_0x330658[_0xef16('0x2f')]=_[_0xef16('0x30')](_0x21814f['query']);_0x330658[_0xef16('0x31')]=_[_0xef16('0x32')](_0x330658[_0xef16('0x2e')],_0x330658[_0xef16('0x2f')]);_0x20ed40[_0xef16('0x33')]=_[_0xef16('0x32')](_0x330658[_0xef16('0x2e')],qs['fields'](_0x21814f[_0xef16('0x2f')][_0xef16('0x34')]));_0x20ed40[_0xef16('0x33')]=_0x20ed40['attributes']['length']?_0x20ed40[_0xef16('0x33')]:_0x330658['model'];if(_0x21814f[_0xef16('0x2f')][_0xef16('0x43')]){_0x20ed40[_0xef16('0x44')]=[{'all':!![]}];}_0x20ed40=_[_0xef16('0x3d')]({},_0x20ed40,_0x21814f['options']);return db[_0xef16('0x3f')][_0xef16('0x45')](_0x20ed40)[_0xef16('0x24')](handleEntityNotFound(_0x2566e5,null))[_0xef16('0x24')](respondWithResult(_0x2566e5,null))[_0xef16('0x46')](handleError(_0x2566e5,null));};exports[_0xef16('0x47')]=function(_0x346d57,_0x5dbae5){return db[_0xef16('0x3f')][_0xef16('0x47')](_0x346d57[_0xef16('0x48')],{})[_0xef16('0x24')](function(_0x2cd21f){var _0x2c81bc=_0x346d57[_0xef16('0x49')][_0xef16('0x26')]({'plain':!![]});if(!_0x2c81bc)throw new Error(_0xef16('0x4a'));if(_0x2c81bc[_0xef16('0x4b')]===_0xef16('0x49')){var _0xdcf1ed=_0x2cd21f[_0xef16('0x26')]({'plain':!![]});var _0x281df2=_0xef16('0x27');return db[_0xef16('0x4c')][_0xef16('0x45')]({'where':{'name':_0x281df2,'userProfileId':_0x2c81bc[_0xef16('0x4d')]},'raw':!![]})['then'](function(_0x554d45){if(_0x554d45&&_0x554d45[_0xef16('0x4e')]===0x0){return db[_0xef16('0x4f')]['create']({'name':_0xdcf1ed[_0xef16('0x29')],'resourceId':_0xdcf1ed['id'],'type':_0x554d45[_0xef16('0x29')],'sectionId':_0x554d45['id']},{})['then'](function(){return _0x2cd21f;});}else{return _0x2cd21f;}})[_0xef16('0x46')](function(_0x501683){logger[_0xef16('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501683);throw _0x501683;});}return _0x2cd21f;})[_0xef16('0x24')](respondWithResult(_0x5dbae5,0xc9))['catch'](handleError(_0x5dbae5,null));};exports[_0xef16('0x23')]=function(_0x3c68a1,_0x3246c9){if(_0x3c68a1['body']['id']){delete _0x3c68a1[_0xef16('0x48')]['id'];}return db[_0xef16('0x3f')]['find']({'where':{'id':_0x3c68a1['params']['id']}})[_0xef16('0x24')](handleEntityNotFound(_0x3246c9,null))[_0xef16('0x24')](saveUpdates(_0x3c68a1[_0xef16('0x48')],null))[_0xef16('0x24')](respondWithResult(_0x3246c9,null))[_0xef16('0x46')](handleError(_0x3246c9,null));};exports['destroy']=function(_0x5da31c,_0x415998){return db['Template'][_0xef16('0x45')]({'where':{'id':_0x5da31c[_0xef16('0x42')]['id']}})[_0xef16('0x24')](handleEntityNotFound(_0x415998,null))[_0xef16('0x24')](removeEntity(_0x415998,null))['catch'](handleError(_0x415998,null));};
\ No newline at end of file
+var _0xc246=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Template','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','user','role','Templates','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x23ea6a,_0xeb7243){var _0x3520a4=function(_0x5bc3b8){while(--_0x5bc3b8){_0x23ea6a['push'](_0x23ea6a['shift']());}};_0x3520a4(++_0xeb7243);}(_0xc246,0x144));var _0x6c24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc246[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6c24('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c24('0x1'));var jsonpatch=require(_0x6c24('0x2'));var rp=require('request-promise');var moment=require(_0x6c24('0x3'));var BPromise=require(_0x6c24('0x4'));var Mustache=require(_0x6c24('0x5'));var util=require(_0x6c24('0x6'));var path=require(_0x6c24('0x7'));var sox=require('sox');var csv=require(_0x6c24('0x8'));var ejs=require(_0x6c24('0x9'));var fs=require('fs');var fs_extra=require(_0x6c24('0xa'));var _=require(_0x6c24('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6c24('0xc'));var deskjs=require(_0x6c24('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6c24('0xe'));var Papa=require(_0x6c24('0xf'));var Redis=require(_0x6c24('0x10'));var authService=require(_0x6c24('0x11'));var qs=require(_0x6c24('0x12'));var as=require(_0x6c24('0x13'));var hardwareService=require(_0x6c24('0x14'));var logger=require(_0x6c24('0x15'))(_0x6c24('0x16'));var utils=require(_0x6c24('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6c24('0x18'));var db=require(_0x6c24('0x19'))['db'];function respondWithStatusCode(_0x1b1c98,_0x2200a2){_0x2200a2=_0x2200a2||0xcc;return function(_0x11c469){if(_0x11c469){return _0x1b1c98[_0x6c24('0x1a')](_0x2200a2);}return _0x1b1c98[_0x6c24('0x1b')](_0x2200a2)[_0x6c24('0x1c')]();};}function respondWithResult(_0xc4e38c,_0xb955d9){_0xb955d9=_0xb955d9||0xc8;return function(_0x568620){if(_0x568620){return _0xc4e38c[_0x6c24('0x1b')](_0xb955d9)[_0x6c24('0x1d')](_0x568620);}};}function respondWithFilteredResult(_0x3db1fa,_0x585d66){return function(_0xd9e112){if(_0xd9e112){var _0x225715=typeof _0x585d66[_0x6c24('0x1e')]===_0x6c24('0x1f')&&typeof _0x585d66[_0x6c24('0x20')]===_0x6c24('0x1f');var _0x4a20c2=_0xd9e112[_0x6c24('0x21')];var _0x1ffdef=_0x225715?0x0:_0x585d66['offset'];var _0x129db9=_0x225715?_0xd9e112['count']:_0x585d66['offset']+_0x585d66[_0x6c24('0x20')];var _0x3ac7a9;if(_0x129db9>=_0x4a20c2){_0x129db9=_0x4a20c2;_0x3ac7a9=0xc8;}else{_0x3ac7a9=0xce;}_0x3db1fa[_0x6c24('0x1b')](_0x3ac7a9);return _0x3db1fa[_0x6c24('0x22')]('Content-Range',_0x1ffdef+'-'+_0x129db9+'/'+_0x4a20c2)[_0x6c24('0x1d')](_0xd9e112);}return null;};}function patchUpdates(_0x370933){return function(_0x2f1aa0){try{jsonpatch['apply'](_0x2f1aa0,_0x370933,!![]);}catch(_0x50fc6f){return BPromise[_0x6c24('0x23')](_0x50fc6f);}return _0x2f1aa0[_0x6c24('0x24')]();};}function saveUpdates(_0xddcea3,_0xf4639e){return function(_0x243077){if(_0x243077){return _0x243077[_0x6c24('0x25')](_0xddcea3)[_0x6c24('0x26')](function(_0x5451ff){return _0x5451ff;});}return null;};}function removeEntity(_0x520715,_0x488ac7){return function(_0x5e8870){if(_0x5e8870){return _0x5e8870[_0x6c24('0x27')]()['then'](function(){var _0x58513a=_0x5e8870[_0x6c24('0x28')]({'plain':!![]});var _0x540d8c='Templates';return db[_0x6c24('0x29')][_0x6c24('0x27')]({'where':{'type':_0x540d8c,'resourceId':_0x58513a['id']}})[_0x6c24('0x26')](function(){return _0x5e8870;});})[_0x6c24('0x26')](function(){_0x520715['status'](0xcc)[_0x6c24('0x1c')]();});}};}function handleEntityNotFound(_0x135b06,_0x34add8){return function(_0x39d32b){if(!_0x39d32b){_0x135b06[_0x6c24('0x1a')](0x194);}return _0x39d32b;};}function handleError(_0x3fade5,_0x34b71b){_0x34b71b=_0x34b71b||0x1f4;return function(_0xa0f7d){logger[_0x6c24('0x2a')](_0xa0f7d[_0x6c24('0x2b')]);if(_0xa0f7d[_0x6c24('0x2c')]){delete _0xa0f7d[_0x6c24('0x2c')];}_0x3fade5[_0x6c24('0x1b')](_0x34b71b)[_0x6c24('0x2d')](_0xa0f7d);};}exports[_0x6c24('0x2e')]=function(_0x1c18bf,_0xf5bf05){var _0x2f508f={},_0x22c676={},_0x4a7756={'count':0x0,'rows':[]};var _0x40f2a3=_[_0x6c24('0x2f')](db['Template'][_0x6c24('0x30')],function(_0x32bf78){return{'name':_0x32bf78[_0x6c24('0x31')],'type':_0x32bf78[_0x6c24('0x32')][_0x6c24('0x33')]};});_0x22c676['model']=_[_0x6c24('0x2f')](_0x40f2a3,_0x6c24('0x2c'));_0x22c676[_0x6c24('0x34')]=_[_0x6c24('0x35')](_0x1c18bf[_0x6c24('0x34')]);_0x22c676[_0x6c24('0x36')]=_[_0x6c24('0x37')](_0x22c676[_0x6c24('0x38')],_0x22c676['query']);_0x2f508f[_0x6c24('0x39')]=_[_0x6c24('0x37')](_0x22c676[_0x6c24('0x38')],qs[_0x6c24('0x3a')](_0x1c18bf[_0x6c24('0x34')][_0x6c24('0x3a')]));_0x2f508f['attributes']=_0x2f508f[_0x6c24('0x39')]['length']?_0x2f508f[_0x6c24('0x39')]:_0x22c676[_0x6c24('0x38')];if(!_0x1c18bf['query'][_0x6c24('0x3b')](_0x6c24('0x3c'))){_0x2f508f[_0x6c24('0x20')]=qs[_0x6c24('0x20')](_0x1c18bf[_0x6c24('0x34')]['limit']);_0x2f508f[_0x6c24('0x1e')]=qs[_0x6c24('0x1e')](_0x1c18bf[_0x6c24('0x34')][_0x6c24('0x1e')]);}_0x2f508f[_0x6c24('0x3d')]=qs[_0x6c24('0x3e')](_0x1c18bf[_0x6c24('0x34')]['sort']);_0x2f508f[_0x6c24('0x3f')]=qs[_0x6c24('0x36')](_['pick'](_0x1c18bf[_0x6c24('0x34')],_0x22c676[_0x6c24('0x36')]),_0x40f2a3);if(_0x1c18bf[_0x6c24('0x34')][_0x6c24('0x40')]){_0x2f508f[_0x6c24('0x3f')]=_[_0x6c24('0x41')](_0x2f508f[_0x6c24('0x3f')],{'$or':_[_0x6c24('0x2f')](_0x40f2a3,function(_0x4f35d5){if(_0x4f35d5[_0x6c24('0x32')]!==_0x6c24('0x42')){var _0x584b22={};_0x584b22[_0x4f35d5['name']]={'$like':'%'+_0x1c18bf[_0x6c24('0x34')]['filter']+'%'};return _0x584b22;}})});}_0x2f508f=_[_0x6c24('0x41')]({},_0x2f508f,_0x1c18bf[_0x6c24('0x43')]);var _0x174e4b={'where':_0x2f508f['where']};return db[_0x6c24('0x44')][_0x6c24('0x21')](_0x174e4b)[_0x6c24('0x26')](function(_0x14b1d1){_0x4a7756[_0x6c24('0x21')]=_0x14b1d1;if(_0x1c18bf['query']['includeAll']){_0x2f508f['include']=[{'all':!![]}];}return db[_0x6c24('0x44')][_0x6c24('0x45')](_0x2f508f);})[_0x6c24('0x26')](function(_0x210a7a){_0x4a7756[_0x6c24('0x46')]=_0x210a7a;return _0x4a7756;})['then'](respondWithFilteredResult(_0xf5bf05,_0x2f508f))[_0x6c24('0x47')](handleError(_0xf5bf05,null));};exports[_0x6c24('0x48')]=function(_0x5c82fa,_0x1e0526){var _0x4c7f6c={'raw':!![],'where':{'id':_0x5c82fa[_0x6c24('0x49')]['id']}},_0x5498a6={};_0x5498a6[_0x6c24('0x38')]=_['keys'](db[_0x6c24('0x44')]['rawAttributes']);_0x5498a6[_0x6c24('0x34')]=_[_0x6c24('0x35')](_0x5c82fa['query']);_0x5498a6[_0x6c24('0x36')]=_[_0x6c24('0x37')](_0x5498a6[_0x6c24('0x38')],_0x5498a6[_0x6c24('0x34')]);_0x4c7f6c['attributes']=_[_0x6c24('0x37')](_0x5498a6[_0x6c24('0x38')],qs[_0x6c24('0x3a')](_0x5c82fa[_0x6c24('0x34')][_0x6c24('0x3a')]));_0x4c7f6c[_0x6c24('0x39')]=_0x4c7f6c['attributes'][_0x6c24('0x4a')]?_0x4c7f6c[_0x6c24('0x39')]:_0x5498a6[_0x6c24('0x38')];if(_0x5c82fa[_0x6c24('0x34')][_0x6c24('0x4b')]){_0x4c7f6c[_0x6c24('0x4c')]=[{'all':!![]}];}_0x4c7f6c=_[_0x6c24('0x41')]({},_0x4c7f6c,_0x5c82fa[_0x6c24('0x43')]);return db[_0x6c24('0x44')][_0x6c24('0x4d')](_0x4c7f6c)[_0x6c24('0x26')](handleEntityNotFound(_0x1e0526,null))[_0x6c24('0x26')](respondWithResult(_0x1e0526,null))[_0x6c24('0x47')](handleError(_0x1e0526,null));};exports[_0x6c24('0x4e')]=function(_0x5d8fa8,_0x45029f){return db[_0x6c24('0x44')][_0x6c24('0x4e')](_0x5d8fa8[_0x6c24('0x4f')],{})['then'](function(_0x4152c6){var _0x4e4976=_0x5d8fa8[_0x6c24('0x50')][_0x6c24('0x28')]({'plain':!![]});if(!_0x4e4976)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e4976[_0x6c24('0x51')]===_0x6c24('0x50')){var _0x42353d=_0x4152c6[_0x6c24('0x28')]({'plain':!![]});var _0x27119b=_0x6c24('0x52');return db[_0x6c24('0x53')][_0x6c24('0x4d')]({'where':{'name':_0x27119b,'userProfileId':_0x4e4976[_0x6c24('0x54')]},'raw':!![]})['then'](function(_0x115e8d){if(_0x115e8d&&_0x115e8d[_0x6c24('0x55')]===0x0){return db[_0x6c24('0x29')][_0x6c24('0x4e')]({'name':_0x42353d[_0x6c24('0x2c')],'resourceId':_0x42353d['id'],'type':_0x115e8d['name'],'sectionId':_0x115e8d['id']},{})[_0x6c24('0x26')](function(){return _0x4152c6;});}else{return _0x4152c6;}})['catch'](function(_0x3b9e71){logger[_0x6c24('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b9e71);throw _0x3b9e71;});}return _0x4152c6;})[_0x6c24('0x26')](respondWithResult(_0x45029f,0xc9))['catch'](handleError(_0x45029f,null));};exports['update']=function(_0x2ba0a6,_0xc00ddf){if(_0x2ba0a6[_0x6c24('0x4f')]['id']){delete _0x2ba0a6['body']['id'];}return db[_0x6c24('0x44')]['find']({'where':{'id':_0x2ba0a6['params']['id']}})[_0x6c24('0x26')](handleEntityNotFound(_0xc00ddf,null))[_0x6c24('0x26')](saveUpdates(_0x2ba0a6[_0x6c24('0x4f')],null))[_0x6c24('0x26')](respondWithResult(_0xc00ddf,null))[_0x6c24('0x47')](handleError(_0xc00ddf,null));};exports[_0x6c24('0x27')]=function(_0x383768,_0x50d934){return db['Template']['find']({'where':{'id':_0x383768[_0x6c24('0x49')]['id']}})[_0x6c24('0x26')](handleEntityNotFound(_0x50d934,null))[_0x6c24('0x26')](removeEntity(_0x50d934,null))['catch'](handleError(_0x50d934,null));};
\ No newline at end of file
index f3c2df8..95888a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc92=['rimraf','../../config/environment','./template.attributes','define','Template','bluebird','request-promise','path'];(function(_0x128c97,_0x30f201){var _0x139f59=function(_0x2dacfa){while(--_0x2dacfa){_0x128c97['push'](_0x128c97['shift']());}};_0x139f59(++_0x30f201);}(_0xdc92,0x1b5));var _0x2dc9=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0xdc92[_0x454e6d];return _0x4bc294;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2dc9('0x0'));var rp=require(_0x2dc9('0x1'));var fs=require('fs');var path=require(_0x2dc9('0x2'));var rimraf=require(_0x2dc9('0x3'));var config=require(_0x2dc9('0x4'));var attributes=require(_0x2dc9('0x5'));module['exports']=function(_0x16d095,_0x2667f5){return _0x16d095[_0x2dc9('0x6')](_0x2dc9('0x7'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8313=['path','../../config/environment','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','request-promise'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x8313,0x15b));var _0x3831=function(_0x55dd4a,_0x52da5d){_0x55dd4a=_0x55dd4a-0x0;var _0x87d880=_0x8313[_0x55dd4a];return _0x87d880;};'use strict';var _=require('lodash');var util=require(_0x3831('0x0'));var logger=require(_0x3831('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3831('0x2'));var fs=require('fs');var path=require(_0x3831('0x3'));var rimraf=require('rimraf');var config=require(_0x3831('0x4'));var attributes=require(_0x3831('0x5'));module[_0x3831('0x6')]=function(_0x44f86f,_0x51c613){return _0x44f86f[_0x3831('0x7')](_0x3831('0x8'),attributes,{'tableName':_0x3831('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index edf7666..7679089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82f4=['map','include','model','debug','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','info','result','GetTemplate','Template','options','raw','where','attributes','limit'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x82f4,0x1bf));var _0x482f=function(_0x4f1ef3,_0x2f4764){_0x4f1ef3=_0x4f1ef3-0x0;var _0x3f6294=_0x82f4[_0x4f1ef3];return _0x3f6294;};'use strict';var _=require(_0x482f('0x0'));var util=require(_0x482f('0x1'));var moment=require('moment');var BPromise=require(_0x482f('0x2'));var rs=require(_0x482f('0x3'));var fs=require('fs');var Redis=require(_0x482f('0x4'));var db=require(_0x482f('0x5'))['db'];var utils=require(_0x482f('0x6'));var logger=require(_0x482f('0x7'))('rpc');var config=require(_0x482f('0x8'));var jayson=require(_0x482f('0x9'));var client=jayson[_0x482f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25509e,_0x3d8b14,_0x42b36b){return new BPromise(function(_0x549235,_0x28c43b){return client[_0x482f('0xb')](_0x25509e,_0x42b36b)[_0x482f('0xc')](function(_0x8aab6b){logger['info']('Template,\x20%s,\x20%s',_0x3d8b14,_0x482f('0xd'));logger['debug'](_0x482f('0xe'),_0x3d8b14,_0x482f('0xd'),JSON[_0x482f('0xf')](_0x8aab6b));if(_0x8aab6b[_0x482f('0x10')]){if(_0x8aab6b[_0x482f('0x10')][_0x482f('0x11')]===0x1f4){logger['error'](_0x482f('0x12'),_0x3d8b14,_0x8aab6b[_0x482f('0x10')][_0x482f('0x13')]);return _0x28c43b(_0x8aab6b[_0x482f('0x10')][_0x482f('0x13')]);}logger[_0x482f('0x10')]('Template,\x20%s,\x20%s',_0x3d8b14,_0x8aab6b['error'][_0x482f('0x13')]);return _0x549235(_0x8aab6b[_0x482f('0x10')][_0x482f('0x13')]);}else{logger[_0x482f('0x14')]('Template,\x20%s,\x20%s',_0x3d8b14,_0x482f('0xd'));_0x549235(_0x8aab6b[_0x482f('0x15')][_0x482f('0x13')]);}})['catch'](function(_0xa2ff14){logger['error']('Template,\x20%s,\x20%s',_0x3d8b14,_0xa2ff14);_0x28c43b(_0xa2ff14);});});}exports[_0x482f('0x16')]=function(_0x97db2c){var _0x49da93=this;return new Promise(function(_0x323d87,_0x579b67){return db[_0x482f('0x17')]['findAll']({'raw':_0x97db2c[_0x482f('0x18')]?_0x97db2c[_0x482f('0x18')][_0x482f('0x19')]===undefined?!![]:![]:!![],'where':_0x97db2c[_0x482f('0x18')]?_0x97db2c[_0x482f('0x18')][_0x482f('0x1a')]||null:null,'attributes':_0x97db2c[_0x482f('0x18')]?_0x97db2c['options'][_0x482f('0x1b')]||null:null,'limit':_0x97db2c[_0x482f('0x18')]?_0x97db2c[_0x482f('0x18')][_0x482f('0x1c')]||null:null,'include':_0x97db2c[_0x482f('0x18')]?_0x97db2c[_0x482f('0x18')]['include']?_[_0x482f('0x1d')](_0x97db2c[_0x482f('0x18')][_0x482f('0x1e')],function(_0x13dd80){return{'model':db[_0x13dd80[_0x482f('0x1f')]],'as':_0x13dd80['as'],'attributes':_0x13dd80['attributes'],'include':_0x13dd80[_0x482f('0x1e')]?_[_0x482f('0x1d')](_0x13dd80[_0x482f('0x1e')],function(_0x22dc00){return{'model':db[_0x22dc00['model']],'as':_0x22dc00['as'],'attributes':_0x22dc00[_0x482f('0x1b')],'include':_0x22dc00['include']?_[_0x482f('0x1d')](_0x22dc00[_0x482f('0x1e')],function(_0x582805){return{'model':db[_0x582805[_0x482f('0x1f')]],'as':_0x582805['as'],'attributes':_0x582805['attributes']};}):[]};}):[]};}):[]:[]})[_0x482f('0xc')](function(_0x3fa7d6){logger[_0x482f('0x14')](_0x482f('0x16'),_0x97db2c);logger[_0x482f('0x20')](_0x482f('0x16'),_0x97db2c,JSON[_0x482f('0xf')](_0x3fa7d6));_0x323d87(_0x3fa7d6);})[_0x482f('0x21')](function(_0x5e38b5){logger['error'](_0x482f('0x16'),_0x5e38b5[_0x482f('0x13')],_0x97db2c);_0x579b67(_0x49da93['error'](0x1f4,_0x5e38b5[_0x482f('0x13')]));});});};
\ No newline at end of file
+var _0x0718=['findAll','options','raw','where','limit','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template'];(function(_0x2eddac,_0x5be14f){var _0x5598ed=function(_0x8f347d){while(--_0x8f347d){_0x2eddac['push'](_0x2eddac['shift']());}};_0x5598ed(++_0x5be14f);}(_0x0718,0x18a));var _0x8071=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0x0718[_0x3f59b1];return _0x11d2e8;};'use strict';var _=require(_0x8071('0x0'));var util=require('util');var moment=require(_0x8071('0x1'));var BPromise=require(_0x8071('0x2'));var rs=require(_0x8071('0x3'));var fs=require('fs');var Redis=require(_0x8071('0x4'));var db=require(_0x8071('0x5'))['db'];var utils=require(_0x8071('0x6'));var logger=require(_0x8071('0x7'))(_0x8071('0x8'));var config=require(_0x8071('0x9'));var jayson=require(_0x8071('0xa'));var client=jayson[_0x8071('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e1e35,_0x1e011c,_0x4d38ac){return new BPromise(function(_0x52d2e3,_0x4d8cd4){return client[_0x8071('0xc')](_0x1e1e35,_0x4d38ac)[_0x8071('0xd')](function(_0x5bbb8f){logger[_0x8071('0xe')]('Template,\x20%s,\x20%s',_0x1e011c,'request\x20sent');logger[_0x8071('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x1e011c,_0x8071('0x10'),JSON[_0x8071('0x11')](_0x5bbb8f));if(_0x5bbb8f[_0x8071('0x12')]){if(_0x5bbb8f[_0x8071('0x12')][_0x8071('0x13')]===0x1f4){logger['error'](_0x8071('0x14'),_0x1e011c,_0x5bbb8f[_0x8071('0x12')]['message']);return _0x4d8cd4(_0x5bbb8f[_0x8071('0x12')][_0x8071('0x15')]);}logger[_0x8071('0x12')](_0x8071('0x14'),_0x1e011c,_0x5bbb8f[_0x8071('0x12')][_0x8071('0x15')]);return _0x52d2e3(_0x5bbb8f[_0x8071('0x12')]['message']);}else{logger['info'](_0x8071('0x14'),_0x1e011c,_0x8071('0x10'));_0x52d2e3(_0x5bbb8f[_0x8071('0x16')][_0x8071('0x15')]);}})[_0x8071('0x17')](function(_0x1d79e1){logger[_0x8071('0x12')](_0x8071('0x14'),_0x1e011c,_0x1d79e1);_0x4d8cd4(_0x1d79e1);});});}exports[_0x8071('0x18')]=function(_0x36aedc){var _0x1687c7=this;return new Promise(function(_0x3690f4,_0xe378e1){return db[_0x8071('0x19')][_0x8071('0x1a')]({'raw':_0x36aedc[_0x8071('0x1b')]?_0x36aedc[_0x8071('0x1b')][_0x8071('0x1c')]===undefined?!![]:![]:!![],'where':_0x36aedc[_0x8071('0x1b')]?_0x36aedc[_0x8071('0x1b')][_0x8071('0x1d')]||null:null,'attributes':_0x36aedc[_0x8071('0x1b')]?_0x36aedc['options']['attributes']||null:null,'limit':_0x36aedc['options']?_0x36aedc[_0x8071('0x1b')][_0x8071('0x1e')]||null:null,'include':_0x36aedc['options']?_0x36aedc[_0x8071('0x1b')][_0x8071('0x1f')]?_[_0x8071('0x20')](_0x36aedc[_0x8071('0x1b')][_0x8071('0x1f')],function(_0x2f401c){return{'model':db[_0x2f401c[_0x8071('0x21')]],'as':_0x2f401c['as'],'attributes':_0x2f401c[_0x8071('0x22')],'include':_0x2f401c['include']?_[_0x8071('0x20')](_0x2f401c[_0x8071('0x1f')],function(_0x18f43b){return{'model':db[_0x18f43b[_0x8071('0x21')]],'as':_0x18f43b['as'],'attributes':_0x18f43b[_0x8071('0x22')],'include':_0x18f43b[_0x8071('0x1f')]?_[_0x8071('0x20')](_0x18f43b[_0x8071('0x1f')],function(_0x255b1f){return{'model':db[_0x255b1f[_0x8071('0x21')]],'as':_0x255b1f['as'],'attributes':_0x255b1f[_0x8071('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x485dec){logger[_0x8071('0xe')]('GetTemplate',_0x36aedc);logger[_0x8071('0xf')]('GetTemplate',_0x36aedc,JSON[_0x8071('0x11')](_0x485dec));_0x3690f4(_0x485dec);})[_0x8071('0x17')](function(_0xa414cc){logger[_0x8071('0x12')]('GetTemplate',_0xa414cc['message'],_0x36aedc);_0xe378e1(_0x1687c7[_0x8071('0x12')](0x1f4,_0xa414cc[_0x8071('0x15')]));});});};
\ No newline at end of file
index 49c72cf..21e764e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x088d=['index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','/:id/actions','create','post','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x088d,0x10a));var _0xd088=function(_0x58168a,_0x18f374){_0x58168a=_0x58168a-0x0;var _0x1b9e79=_0x088d[_0x58168a];return _0x1b9e79;};'use strict';var multer=require('multer');var util=require(_0xd088('0x0'));var path=require(_0xd088('0x1'));var timeout=require(_0xd088('0x2'));var express=require(_0xd088('0x3'));var router=express[_0xd088('0x4')]();var fs_extra=require(_0xd088('0x5'));var auth=require(_0xd088('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xd088('0x7')]('/',auth[_0xd088('0x8')](),controller[_0xd088('0x9')]);router[_0xd088('0x7')](_0xd088('0xa'),auth['isAuthenticated'](),controller[_0xd088('0xb')]);router[_0xd088('0x7')](_0xd088('0xc'),auth[_0xd088('0x8')](),controller[_0xd088('0xd')]);router[_0xd088('0x7')](_0xd088('0xe'),auth[_0xd088('0x8')](),controller['getAnyConditions']);router[_0xd088('0x7')](_0xd088('0xf'),auth[_0xd088('0x8')](),controller['getActions']);router['post']('/',auth[_0xd088('0x8')](),controller[_0xd088('0x10')]);router[_0xd088('0x11')]('/:id/all_conditions',auth[_0xd088('0x8')](),controller['addAllCondition']);router[_0xd088('0x11')]('/:id/any_conditions',auth[_0xd088('0x8')](),controller[_0xd088('0x12')]);router['post'](_0xd088('0xf'),auth[_0xd088('0x8')](),controller[_0xd088('0x13')]);router[_0xd088('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xd088('0x15')]);router[_0xd088('0x16')](_0xd088('0xa'),auth[_0xd088('0x8')](),controller[_0xd088('0x17')]);module[_0xd088('0x18')]=router;
\ No newline at end of file
+var _0xb3f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAllCondition','addAnyCondition','addAction','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb3f2,0x1bb));var _0x2b3f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xb3f2[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b3f('0x0'));var timeout=require(_0x2b3f('0x1'));var express=require(_0x2b3f('0x2'));var router=express[_0x2b3f('0x3')]();var fs_extra=require(_0x2b3f('0x4'));var auth=require(_0x2b3f('0x5'));var interaction=require(_0x2b3f('0x6'));var config=require(_0x2b3f('0x7'));var controller=require(_0x2b3f('0x8'));router[_0x2b3f('0x9')]('/',auth['isAuthenticated'](),controller[_0x2b3f('0xa')]);router['get'](_0x2b3f('0xb'),auth[_0x2b3f('0xc')](),controller[_0x2b3f('0xd')]);router[_0x2b3f('0x9')](_0x2b3f('0xe'),auth['isAuthenticated'](),controller[_0x2b3f('0xf')]);router[_0x2b3f('0x9')](_0x2b3f('0x10'),auth[_0x2b3f('0xc')](),controller[_0x2b3f('0x11')]);router[_0x2b3f('0x9')](_0x2b3f('0x12'),auth[_0x2b3f('0xc')](),controller[_0x2b3f('0x13')]);router[_0x2b3f('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2b3f('0x14')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x2b3f('0x15')]);router[_0x2b3f('0x14')](_0x2b3f('0x10'),auth[_0x2b3f('0xc')](),controller[_0x2b3f('0x16')]);router[_0x2b3f('0x14')](_0x2b3f('0x12'),auth['isAuthenticated'](),controller[_0x2b3f('0x17')]);router['put'](_0x2b3f('0xb'),auth['isAuthenticated'](),controller[_0x2b3f('0x18')]);router[_0x2b3f('0x19')](_0x2b3f('0xb'),auth['isAuthenticated'](),controller[_0x2b3f('0x1a')]);module[_0x2b3f('0x1b')]=router;
\ No newline at end of file
index 88a3095..a7f15b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d7e=['STRING','BOOLEAN'];(function(_0x40597a,_0x30410d){var _0x423296=function(_0x116441){while(--_0x116441){_0x40597a['push'](_0x40597a['shift']());}};_0x423296(++_0x30410d);}(_0x6d7e,0xaa));var _0xe6d7=function(_0x409197,_0x51280f){_0x409197=_0x409197-0x0;var _0x16a6f5=_0x6d7e[_0x409197];return _0x16a6f5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe6d7('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe6d7('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0xdd20=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4ecc26,_0x57a231){var _0x314613=function(_0x424e88){while(--_0x424e88){_0x4ecc26['push'](_0x4ecc26['shift']());}};_0x314613(++_0x57a231);}(_0xdd20,0xbd));var _0x0dd2=function(_0x45e14c,_0x9dabd){_0x45e14c=_0x45e14c-0x0;var _0x3f364f=_0xdd20[_0x45e14c];return _0x3f364f;};'use strict';var Sequelize=require(_0x0dd2('0x0'));module[_0x0dd2('0x1')]={'name':{'type':Sequelize[_0x0dd2('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0dd2('0x2')]},'status':{'type':Sequelize[_0x0dd2('0x3')],'defaultValue':![]}};
\ No newline at end of file
index cca73cc..23b0ffb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x816f=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','options','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x525037,_0x3e72d4){var _0x3157e8=function(_0x4b7ce1){while(--_0x4b7ce1){_0x525037['push'](_0x525037['shift']());}};_0x3157e8(++_0x3e72d4);}(_0x816f,0x1cf));var _0xf816=function(_0x3e2e13,_0x300b0f){_0x3e2e13=_0x3e2e13-0x0;var _0x32e50d=_0x816f[_0x3e2e13];return _0x32e50d;};'use strict';var emlformat=require(_0xf816('0x0'));var rimraf=require(_0xf816('0x1'));var zipdir=require(_0xf816('0x2'));var jsonpatch=require(_0xf816('0x3'));var rp=require(_0xf816('0x4'));var moment=require(_0xf816('0x5'));var BPromise=require(_0xf816('0x6'));var Mustache=require('mustache');var util=require(_0xf816('0x7'));var path=require(_0xf816('0x8'));var sox=require(_0xf816('0x9'));var csv=require(_0xf816('0xa'));var ejs=require(_0xf816('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf816('0xc'));var crypto=require(_0xf816('0xd'));var jsforce=require(_0xf816('0xe'));var deskjs=require(_0xf816('0xf'));var toCsv=require(_0xf816('0xa'));var querystring=require(_0xf816('0x10'));var Papa=require(_0xf816('0x11'));var Redis=require(_0xf816('0x12'));var authService=require(_0xf816('0x13'));var qs=require(_0xf816('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf816('0x15'));var logger=require(_0xf816('0x16'))('api');var utils=require(_0xf816('0x17'));var config=require(_0xf816('0x18'));var licenseUtil=require(_0xf816('0x19'));var db=require(_0xf816('0x1a'))['db'];function respondWithStatusCode(_0x26a866,_0x95fb71){_0x95fb71=_0x95fb71||0xcc;return function(_0x51e9a3){if(_0x51e9a3){return _0x26a866[_0xf816('0x1b')](_0x95fb71);}return _0x26a866['status'](_0x95fb71)[_0xf816('0x1c')]();};}function respondWithResult(_0x3f1faa,_0x5308dd){_0x5308dd=_0x5308dd||0xc8;return function(_0x34fd15){if(_0x34fd15){return _0x3f1faa[_0xf816('0x1d')](_0x5308dd)[_0xf816('0x1e')](_0x34fd15);}};}function respondWithFilteredResult(_0x926cea,_0x44a858){return function(_0x19b8db){if(_0x19b8db){var _0xb7ef23=typeof _0x44a858[_0xf816('0x1f')]===_0xf816('0x20')&&typeof _0x44a858[_0xf816('0x21')]===_0xf816('0x20');var _0x34b914=_0x19b8db['count'];var _0x300b9d=_0xb7ef23?0x0:_0x44a858['offset'];var _0x2cdd1f=_0xb7ef23?_0x19b8db[_0xf816('0x22')]:_0x44a858[_0xf816('0x1f')]+_0x44a858[_0xf816('0x21')];var _0x5d787c;if(_0x2cdd1f>=_0x34b914){_0x2cdd1f=_0x34b914;_0x5d787c=0xc8;}else{_0x5d787c=0xce;}_0x926cea[_0xf816('0x1d')](_0x5d787c);return _0x926cea[_0xf816('0x23')]('Content-Range',_0x300b9d+'-'+_0x2cdd1f+'/'+_0x34b914)[_0xf816('0x1e')](_0x19b8db);}return null;};}function patchUpdates(_0x2a870d){return function(_0x454fde){try{jsonpatch['apply'](_0x454fde,_0x2a870d,!![]);}catch(_0x1f33a9){return BPromise[_0xf816('0x24')](_0x1f33a9);}return _0x454fde[_0xf816('0x25')]();};}function saveUpdates(_0x1053b2,_0x2f0f87){return function(_0x50293b){if(_0x50293b){return _0x50293b[_0xf816('0x26')](_0x1053b2)['then'](function(_0x586642){return _0x586642;});}return null;};}function removeEntity(_0x422af4,_0xc95b04){return function(_0x4e4f16){if(_0x4e4f16){return _0x4e4f16[_0xf816('0x27')]()[_0xf816('0x28')](function(){var _0x3d842d=_0x4e4f16[_0xf816('0x29')]({'plain':!![]});var _0x4b8c86='Triggers';return db[_0xf816('0x2a')][_0xf816('0x27')]({'where':{'type':_0x4b8c86,'resourceId':_0x3d842d['id']}})['then'](function(){return _0x4e4f16;});})['then'](function(){_0x422af4[_0xf816('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6f0c,_0x10a3f6){return function(_0x53bc01){if(!_0x53bc01){_0x4d6f0c[_0xf816('0x1b')](0x194);}return _0x53bc01;};}function handleError(_0x397538,_0x2499c6){_0x2499c6=_0x2499c6||0x1f4;return function(_0x312cea){logger[_0xf816('0x2b')](_0x312cea[_0xf816('0x2c')]);if(_0x312cea['name']){delete _0x312cea[_0xf816('0x2d')];}_0x397538[_0xf816('0x1d')](_0x2499c6)[_0xf816('0x2e')](_0x312cea);};}exports[_0xf816('0x2f')]=function(_0x43b170,_0xd4f546){var _0x5d1910={},_0x5d374f={},_0x4ff720={'count':0x0,'rows':[]};var _0x1b495c=_[_0xf816('0x30')](db[_0xf816('0x31')][_0xf816('0x32')],function(_0x55c154){return{'name':_0x55c154[_0xf816('0x33')],'type':_0x55c154['type'][_0xf816('0x34')]};});_0x5d374f[_0xf816('0x35')]=_['map'](_0x1b495c,'name');_0x5d374f[_0xf816('0x36')]=_['keys'](_0x43b170['query']);_0x5d374f[_0xf816('0x37')]=_[_0xf816('0x38')](_0x5d374f[_0xf816('0x35')],_0x5d374f[_0xf816('0x36')]);_0x5d1910[_0xf816('0x39')]=_[_0xf816('0x38')](_0x5d374f[_0xf816('0x35')],qs[_0xf816('0x3a')](_0x43b170[_0xf816('0x36')][_0xf816('0x3a')]));_0x5d1910['attributes']=_0x5d1910[_0xf816('0x39')][_0xf816('0x3b')]?_0x5d1910[_0xf816('0x39')]:_0x5d374f['model'];if(!_0x43b170[_0xf816('0x36')]['hasOwnProperty'](_0xf816('0x3c'))){_0x5d1910['limit']=qs['limit'](_0x43b170[_0xf816('0x36')][_0xf816('0x21')]);_0x5d1910[_0xf816('0x1f')]=qs['offset'](_0x43b170[_0xf816('0x36')][_0xf816('0x1f')]);}_0x5d1910[_0xf816('0x3d')]=qs[_0xf816('0x3e')](_0x43b170[_0xf816('0x36')]['sort']);_0x5d1910[_0xf816('0x3f')]=qs['filters'](_[_0xf816('0x40')](_0x43b170['query'],_0x5d374f[_0xf816('0x37')]),_0x1b495c);if(_0x43b170['query'][_0xf816('0x41')]){_0x5d1910['where']=_[_0xf816('0x42')](_0x5d1910[_0xf816('0x3f')],{'$or':_[_0xf816('0x30')](_0x1b495c,function(_0x2b1ddb){if(_0x2b1ddb[_0xf816('0x43')]!==_0xf816('0x44')){var _0x3dfd60={};_0x3dfd60[_0x2b1ddb[_0xf816('0x2d')]]={'$like':'%'+_0x43b170[_0xf816('0x36')][_0xf816('0x41')]+'%'};return _0x3dfd60;}})});}_0x5d1910=_['merge']({},_0x5d1910,_0x43b170['options']);var _0x552467={'where':_0x5d1910[_0xf816('0x3f')]};return db[_0xf816('0x31')][_0xf816('0x22')](_0x552467)['then'](function(_0x2953b9){_0x4ff720[_0xf816('0x22')]=_0x2953b9;if(_0x43b170[_0xf816('0x36')][_0xf816('0x45')]){_0x5d1910[_0xf816('0x46')]=[{'all':!![]}];}return db['Trigger'][_0xf816('0x47')](_0x5d1910);})[_0xf816('0x28')](function(_0x1e2746){_0x4ff720[_0xf816('0x48')]=_0x1e2746;return _0x4ff720;})[_0xf816('0x28')](respondWithFilteredResult(_0xd4f546,_0x5d1910))[_0xf816('0x49')](handleError(_0xd4f546,null));};exports[_0xf816('0x4a')]=function(_0x893236,_0x38261c){var _0xee69da={'raw':![],'where':{'id':_0x893236[_0xf816('0x4b')]['id']}},_0x3a1e0b={};_0x3a1e0b[_0xf816('0x35')]=_[_0xf816('0x4c')](db[_0xf816('0x31')][_0xf816('0x32')]);_0x3a1e0b[_0xf816('0x36')]=_[_0xf816('0x4c')](_0x893236[_0xf816('0x36')]);_0x3a1e0b[_0xf816('0x37')]=_[_0xf816('0x38')](_0x3a1e0b[_0xf816('0x35')],_0x3a1e0b['query']);_0xee69da[_0xf816('0x39')]=_['intersection'](_0x3a1e0b[_0xf816('0x35')],qs[_0xf816('0x3a')](_0x893236[_0xf816('0x36')][_0xf816('0x3a')]));_0xee69da[_0xf816('0x39')]=_0xee69da[_0xf816('0x39')][_0xf816('0x3b')]?_0xee69da['attributes']:_0x3a1e0b['model'];if(_0x893236[_0xf816('0x36')][_0xf816('0x45')]){_0xee69da[_0xf816('0x46')]=[{'all':!![]}];}_0xee69da=_[_0xf816('0x42')]({},_0xee69da,_0x893236['options']);return db[_0xf816('0x31')]['find'](_0xee69da)[_0xf816('0x28')](handleEntityNotFound(_0x38261c,null))['then'](respondWithResult(_0x38261c,null))['catch'](handleError(_0x38261c,null));};exports[_0xf816('0x4d')]=function(_0x12853b,_0x4927ca){return db[_0xf816('0x31')][_0xf816('0x4d')](_0x12853b[_0xf816('0x4e')],{})[_0xf816('0x28')](function(_0x4b1686){var _0x3caddd=_0x12853b[_0xf816('0x4f')]['get']({'plain':!![]});if(!_0x3caddd)throw new Error(_0xf816('0x50'));if(_0x3caddd[_0xf816('0x51')]===_0xf816('0x4f')){var _0x53c76f=_0x4b1686['get']({'plain':!![]});var _0x542e74=_0xf816('0x52');return db[_0xf816('0x53')]['find']({'where':{'name':_0x542e74,'userProfileId':_0x3caddd['userProfileId']},'raw':!![]})[_0xf816('0x28')](function(_0x2ec866){if(_0x2ec866&&_0x2ec866['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x53c76f[_0xf816('0x2d')],'resourceId':_0x53c76f['id'],'type':_0x2ec866[_0xf816('0x2d')],'sectionId':_0x2ec866['id']},{})[_0xf816('0x28')](function(){return _0x4b1686;});}else{return _0x4b1686;}})[_0xf816('0x49')](function(_0x1c4bcb){logger['error'](_0xf816('0x54'),_0x1c4bcb);throw _0x1c4bcb;});}return _0x4b1686;})['then'](respondWithResult(_0x4927ca,0xc9))[_0xf816('0x49')](handleError(_0x4927ca,null));};exports[_0xf816('0x26')]=function(_0x2f5ff7,_0xa0d1b8){if(_0x2f5ff7[_0xf816('0x4e')]['id']){delete _0x2f5ff7[_0xf816('0x4e')]['id'];}return db[_0xf816('0x31')][_0xf816('0x55')]({'where':{'id':_0x2f5ff7[_0xf816('0x4b')]['id']}})[_0xf816('0x28')](handleEntityNotFound(_0xa0d1b8,null))[_0xf816('0x28')](saveUpdates(_0x2f5ff7[_0xf816('0x4e')],null))['then'](respondWithResult(_0xa0d1b8,null))[_0xf816('0x49')](handleError(_0xa0d1b8,null));};exports['destroy']=function(_0x1e980f,_0x185047){return db[_0xf816('0x31')][_0xf816('0x55')]({'where':{'id':_0x1e980f['params']['id']}})[_0xf816('0x28')](handleEntityNotFound(_0x185047,null))[_0xf816('0x28')](removeEntity(_0x185047,null))['catch'](handleError(_0x185047,null));};exports['addAllCondition']=function(_0x307b8d,_0x5b1102,_0x227dc4){if(_0x307b8d['body']['id']){delete _0x307b8d[_0xf816('0x4e')]['id'];}return db[_0xf816('0x31')][_0xf816('0x55')]({'where':{'id':_0x307b8d[_0xf816('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b1102,null))[_0xf816('0x28')](function(_0x140d03){if(_0x140d03){_0x307b8d[_0xf816('0x4e')][_0xf816('0x56')]=_0x140d03['id'];return db[_0xf816('0x57')][_0xf816('0x4d')](_0x307b8d[_0xf816('0x4e')]);}})['then'](respondWithResult(_0x5b1102,null))[_0xf816('0x49')](handleError(_0x5b1102,null));};exports[_0xf816('0x58')]=function(_0x329e74,_0x130b72,_0x541730){if(_0x329e74['body']['id']){delete _0x329e74[_0xf816('0x4e')]['id'];}return db[_0xf816('0x31')][_0xf816('0x55')]({'where':{'id':_0x329e74[_0xf816('0x4b')]['id']}})[_0xf816('0x28')](handleEntityNotFound(_0x130b72,null))['then'](function(_0x1c5000){if(_0x1c5000){_0x329e74[_0xf816('0x4e')][_0xf816('0x59')]=_0x1c5000['id'];return db[_0xf816('0x57')]['create'](_0x329e74['body']);}})[_0xf816('0x28')](respondWithResult(_0x130b72,null))[_0xf816('0x49')](handleError(_0x130b72,null));};exports[_0xf816('0x5a')]=function(_0x544192,_0x5bfd78,_0x1fdaef){var _0x117f7e={};var _0x480c2c={};var _0x17924e;var _0x338086;return db[_0xf816('0x31')]['findOne']({'where':{'id':_0x544192[_0xf816('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bfd78,null))[_0xf816('0x28')](function(_0x109179){if(_0x109179){_0x17924e=_0x109179;_0x480c2c[_0xf816('0x35')]=_['keys'](db['Condition'][_0xf816('0x32')]);_0x480c2c[_0xf816('0x36')]=_['keys'](_0x544192['query']);_0x480c2c['filters']=_[_0xf816('0x38')](_0x480c2c[_0xf816('0x35')],_0x480c2c[_0xf816('0x36')]);_0x117f7e[_0xf816('0x39')]=_[_0xf816('0x38')](_0x480c2c[_0xf816('0x35')],qs[_0xf816('0x3a')](_0x544192[_0xf816('0x36')][_0xf816('0x3a')]));_0x117f7e[_0xf816('0x39')]=_0x117f7e[_0xf816('0x39')]['length']?_0x117f7e[_0xf816('0x39')]:_0x480c2c[_0xf816('0x35')];_0x117f7e[_0xf816('0x3d')]=qs[_0xf816('0x3e')](_0x544192[_0xf816('0x36')][_0xf816('0x3e')]);_0x117f7e['where']=qs[_0xf816('0x37')](_[_0xf816('0x40')](_0x544192['query'],_0x480c2c[_0xf816('0x37')]));if(_0x544192[_0xf816('0x36')][_0xf816('0x41')]){_0x117f7e[_0xf816('0x3f')]=_['merge'](_0x117f7e['where'],{'$or':_[_0xf816('0x30')](_0x117f7e['attributes'],function(_0x4cd63e){var _0x322862={};_0x322862[_0x4cd63e]={'$like':'%'+_0x544192[_0xf816('0x36')][_0xf816('0x41')]+'%'};return _0x322862;})});}_0x117f7e=_[_0xf816('0x42')]({},_0x117f7e,_0x544192[_0xf816('0x5b')]);return _0x17924e[_0xf816('0x5a')](_0x117f7e);}})[_0xf816('0x28')](function(_0x1e12fb){if(_0x1e12fb){_0x338086=_0x1e12fb[_0xf816('0x3b')];if(!_0x544192[_0xf816('0x36')][_0xf816('0x5c')](_0xf816('0x3c'))){_0x117f7e[_0xf816('0x21')]=qs[_0xf816('0x21')](_0x544192[_0xf816('0x36')][_0xf816('0x21')]);_0x117f7e[_0xf816('0x1f')]=qs[_0xf816('0x1f')](_0x544192['query']['offset']);}return _0x17924e[_0xf816('0x5a')](_0x117f7e);}})[_0xf816('0x28')](function(_0x52f313){if(_0x52f313){return _0x52f313?{'count':_0x338086,'rows':_0x52f313}:null;}})[_0xf816('0x28')](respondWithResult(_0x5bfd78,null))[_0xf816('0x49')](handleError(_0x5bfd78,null));};exports[_0xf816('0x5d')]=function(_0x43f025,_0x1ea937,_0x21ac64){var _0x24b5bc={};var _0xa38a1e={};var _0x7b6f35;var _0xea4cfb;return db[_0xf816('0x31')]['findOne']({'where':{'id':_0x43f025['params']['id']}})[_0xf816('0x28')](handleEntityNotFound(_0x1ea937,null))[_0xf816('0x28')](function(_0x4fadf9){if(_0x4fadf9){_0x7b6f35=_0x4fadf9;_0xa38a1e[_0xf816('0x35')]=_[_0xf816('0x4c')](db[_0xf816('0x57')]['rawAttributes']);_0xa38a1e[_0xf816('0x36')]=_[_0xf816('0x4c')](_0x43f025[_0xf816('0x36')]);_0xa38a1e[_0xf816('0x37')]=_[_0xf816('0x38')](_0xa38a1e[_0xf816('0x35')],_0xa38a1e[_0xf816('0x36')]);_0x24b5bc[_0xf816('0x39')]=_[_0xf816('0x38')](_0xa38a1e[_0xf816('0x35')],qs['fields'](_0x43f025[_0xf816('0x36')][_0xf816('0x3a')]));_0x24b5bc[_0xf816('0x39')]=_0x24b5bc[_0xf816('0x39')][_0xf816('0x3b')]?_0x24b5bc['attributes']:_0xa38a1e[_0xf816('0x35')];_0x24b5bc[_0xf816('0x3d')]=qs['sort'](_0x43f025['query'][_0xf816('0x3e')]);_0x24b5bc[_0xf816('0x3f')]=qs[_0xf816('0x37')](_[_0xf816('0x40')](_0x43f025[_0xf816('0x36')],_0xa38a1e['filters']));if(_0x43f025[_0xf816('0x36')]['filter']){_0x24b5bc[_0xf816('0x3f')]=_[_0xf816('0x42')](_0x24b5bc['where'],{'$or':_[_0xf816('0x30')](_0x24b5bc[_0xf816('0x39')],function(_0xb68d3f){var _0x1a9649={};_0x1a9649[_0xb68d3f]={'$like':'%'+_0x43f025['query'][_0xf816('0x41')]+'%'};return _0x1a9649;})});}_0x24b5bc=_['merge']({},_0x24b5bc,_0x43f025[_0xf816('0x5b')]);return _0x7b6f35[_0xf816('0x5d')](_0x24b5bc);}})[_0xf816('0x28')](function(_0x1325e9){if(_0x1325e9){_0xea4cfb=_0x1325e9[_0xf816('0x3b')];if(!_0x43f025[_0xf816('0x36')][_0xf816('0x5c')](_0xf816('0x3c'))){_0x24b5bc['limit']=qs[_0xf816('0x21')](_0x43f025[_0xf816('0x36')][_0xf816('0x21')]);_0x24b5bc['offset']=qs[_0xf816('0x1f')](_0x43f025[_0xf816('0x36')]['offset']);}return _0x7b6f35[_0xf816('0x5d')](_0x24b5bc);}})['then'](function(_0x4309f7){if(_0x4309f7){return _0x4309f7?{'count':_0xea4cfb,'rows':_0x4309f7}:null;}})['then'](respondWithResult(_0x1ea937,null))[_0xf816('0x49')](handleError(_0x1ea937,null));};exports['addAction']=function(_0x5678b6,_0x1681e5,_0x7bc550){if(_0x5678b6[_0xf816('0x4e')]['id']){delete _0x5678b6[_0xf816('0x4e')]['id'];}return db[_0xf816('0x31')][_0xf816('0x55')]({'where':{'id':_0x5678b6[_0xf816('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1681e5,null))[_0xf816('0x28')](function(_0x17e4cd){if(_0x17e4cd){_0x5678b6[_0xf816('0x4e')][_0xf816('0x5e')]=_0x17e4cd['id'];return db[_0xf816('0x5f')][_0xf816('0x4d')](_0x5678b6['body']);}})[_0xf816('0x28')](respondWithResult(_0x1681e5,null))[_0xf816('0x49')](handleError(_0x1681e5,null));};exports[_0xf816('0x60')]=function(_0x3d953b,_0x1a67b7,_0x732ba2){var _0x2865f2={};var _0x265713={};var _0x1c8bb5;var _0x1f140b;return db['Trigger']['findOne']({'where':{'id':_0x3d953b[_0xf816('0x4b')]['id']}})[_0xf816('0x28')](handleEntityNotFound(_0x1a67b7,null))[_0xf816('0x28')](function(_0x1ae527){if(_0x1ae527){_0x1c8bb5=_0x1ae527;_0x265713[_0xf816('0x35')]=_[_0xf816('0x4c')](db['Action'][_0xf816('0x32')]);_0x265713['query']=_[_0xf816('0x4c')](_0x3d953b['query']);_0x265713[_0xf816('0x37')]=_[_0xf816('0x38')](_0x265713[_0xf816('0x35')],_0x265713[_0xf816('0x36')]);_0x2865f2[_0xf816('0x39')]=_[_0xf816('0x38')](_0x265713[_0xf816('0x35')],qs[_0xf816('0x3a')](_0x3d953b[_0xf816('0x36')][_0xf816('0x3a')]));_0x2865f2['attributes']=_0x2865f2[_0xf816('0x39')][_0xf816('0x3b')]?_0x2865f2['attributes']:_0x265713['model'];_0x2865f2['order']=qs['sort'](_0x3d953b[_0xf816('0x36')][_0xf816('0x3e')]);_0x2865f2['where']=qs['filters'](_[_0xf816('0x40')](_0x3d953b[_0xf816('0x36')],_0x265713[_0xf816('0x37')]));if(_0x3d953b[_0xf816('0x36')][_0xf816('0x41')]){_0x2865f2[_0xf816('0x3f')]=_[_0xf816('0x42')](_0x2865f2[_0xf816('0x3f')],{'$or':_[_0xf816('0x30')](_0x2865f2[_0xf816('0x39')],function(_0x57a7a0){var _0x28a9cd={};_0x28a9cd[_0x57a7a0]={'$like':'%'+_0x3d953b[_0xf816('0x36')][_0xf816('0x41')]+'%'};return _0x28a9cd;})});}_0x2865f2=_[_0xf816('0x42')]({},_0x2865f2,_0x3d953b[_0xf816('0x5b')]);return _0x1c8bb5[_0xf816('0x60')](_0x2865f2);}})[_0xf816('0x28')](function(_0x5b3c3d){if(_0x5b3c3d){_0x1f140b=_0x5b3c3d[_0xf816('0x3b')];if(!_0x3d953b[_0xf816('0x36')][_0xf816('0x5c')](_0xf816('0x3c'))){_0x2865f2[_0xf816('0x21')]=qs[_0xf816('0x21')](_0x3d953b[_0xf816('0x36')]['limit']);_0x2865f2['offset']=qs[_0xf816('0x1f')](_0x3d953b['query']['offset']);}return _0x1c8bb5[_0xf816('0x60')](_0x2865f2);}})[_0xf816('0x28')](function(_0x1bd00c){if(_0x1bd00c){return _0x1bd00c?{'count':_0x1f140b,'rows':_0x1bd00c}:null;}})[_0xf816('0x28')](respondWithResult(_0x1a67b7,null))[_0xf816('0x49')](handleError(_0x1a67b7,null));};
\ No newline at end of file
+var _0x1826=['findOne','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','destroy','then','get','Triggers','UserProfileResource','sendStatus','error','name','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','Trigger','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions'];(function(_0x21f9b9,_0x16758d){var _0x399ad3=function(_0x43e706){while(--_0x43e706){_0x21f9b9['push'](_0x21f9b9['shift']());}};_0x399ad3(++_0x16758d);}(_0x1826,0x1c7));var _0x6182=function(_0x48a17b,_0x15fe4b){_0x48a17b=_0x48a17b-0x0;var _0x3170db=_0x1826[_0x48a17b];return _0x3170db;};'use strict';var emlformat=require(_0x6182('0x0'));var rimraf=require(_0x6182('0x1'));var zipdir=require(_0x6182('0x2'));var jsonpatch=require(_0x6182('0x3'));var rp=require(_0x6182('0x4'));var moment=require(_0x6182('0x5'));var BPromise=require(_0x6182('0x6'));var Mustache=require(_0x6182('0x7'));var util=require(_0x6182('0x8'));var path=require('path');var sox=require(_0x6182('0x9'));var csv=require(_0x6182('0xa'));var ejs=require(_0x6182('0xb'));var fs=require('fs');var fs_extra=require(_0x6182('0xc'));var _=require('lodash');var squel=require(_0x6182('0xd'));var crypto=require(_0x6182('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6182('0xa'));var querystring=require('querystring');var Papa=require(_0x6182('0xf'));var Redis=require(_0x6182('0x10'));var authService=require(_0x6182('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6182('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6182('0x13'))(_0x6182('0x14'));var utils=require(_0x6182('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6182('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5905d7,_0x3a80f2){_0x3a80f2=_0x3a80f2||0xcc;return function(_0x33a0d7){if(_0x33a0d7){return _0x5905d7['sendStatus'](_0x3a80f2);}return _0x5905d7[_0x6182('0x17')](_0x3a80f2)[_0x6182('0x18')]();};}function respondWithResult(_0x12e3ab,_0xcc2961){_0xcc2961=_0xcc2961||0xc8;return function(_0x1e3e8b){if(_0x1e3e8b){return _0x12e3ab[_0x6182('0x17')](_0xcc2961)['json'](_0x1e3e8b);}};}function respondWithFilteredResult(_0x54ca0e,_0x4a65e3){return function(_0x21f1d4){if(_0x21f1d4){var _0x546006=typeof _0x4a65e3['offset']===_0x6182('0x19')&&typeof _0x4a65e3[_0x6182('0x1a')]===_0x6182('0x19');var _0x5da1d4=_0x21f1d4[_0x6182('0x1b')];var _0x24a237=_0x546006?0x0:_0x4a65e3[_0x6182('0x1c')];var _0x2dfd7a=_0x546006?_0x21f1d4['count']:_0x4a65e3[_0x6182('0x1c')]+_0x4a65e3['limit'];var _0x48d064;if(_0x2dfd7a>=_0x5da1d4){_0x2dfd7a=_0x5da1d4;_0x48d064=0xc8;}else{_0x48d064=0xce;}_0x54ca0e[_0x6182('0x17')](_0x48d064);return _0x54ca0e[_0x6182('0x1d')](_0x6182('0x1e'),_0x24a237+'-'+_0x2dfd7a+'/'+_0x5da1d4)[_0x6182('0x1f')](_0x21f1d4);}return null;};}function patchUpdates(_0x415cea){return function(_0x4eff92){try{jsonpatch[_0x6182('0x20')](_0x4eff92,_0x415cea,!![]);}catch(_0x37c6e9){return BPromise[_0x6182('0x21')](_0x37c6e9);}return _0x4eff92['save']();};}function saveUpdates(_0x2b8012,_0x91a641){return function(_0x2a73b5){if(_0x2a73b5){return _0x2a73b5['update'](_0x2b8012)['then'](function(_0x2dbf91){return _0x2dbf91;});}return null;};}function removeEntity(_0x791267,_0x3872ec){return function(_0x2b4dc4){if(_0x2b4dc4){return _0x2b4dc4[_0x6182('0x22')]()[_0x6182('0x23')](function(){var _0x1c1ffa=_0x2b4dc4[_0x6182('0x24')]({'plain':!![]});var _0x573190=_0x6182('0x25');return db[_0x6182('0x26')][_0x6182('0x22')]({'where':{'type':_0x573190,'resourceId':_0x1c1ffa['id']}})[_0x6182('0x23')](function(){return _0x2b4dc4;});})[_0x6182('0x23')](function(){_0x791267['status'](0xcc)[_0x6182('0x18')]();});}};}function handleEntityNotFound(_0xb7ce6e,_0x3e5211){return function(_0x451ff2){if(!_0x451ff2){_0xb7ce6e[_0x6182('0x27')](0x194);}return _0x451ff2;};}function handleError(_0x5457b2,_0x2add20){_0x2add20=_0x2add20||0x1f4;return function(_0x2b36cb){logger[_0x6182('0x28')](_0x2b36cb['stack']);if(_0x2b36cb[_0x6182('0x29')]){delete _0x2b36cb[_0x6182('0x29')];}_0x5457b2[_0x6182('0x17')](_0x2add20)['send'](_0x2b36cb);};}exports['index']=function(_0x56493b,_0x4980d1){var _0x3e104a={},_0x587cca={},_0x4f1f26={'count':0x0,'rows':[]};var _0x3d9e09=_[_0x6182('0x2a')](db['Trigger']['rawAttributes'],function(_0x1d2db6){return{'name':_0x1d2db6[_0x6182('0x2b')],'type':_0x1d2db6['type'][_0x6182('0x2c')]};});_0x587cca[_0x6182('0x2d')]=_['map'](_0x3d9e09,_0x6182('0x29'));_0x587cca[_0x6182('0x2e')]=_['keys'](_0x56493b['query']);_0x587cca[_0x6182('0x2f')]=_[_0x6182('0x30')](_0x587cca[_0x6182('0x2d')],_0x587cca['query']);_0x3e104a[_0x6182('0x31')]=_[_0x6182('0x30')](_0x587cca['model'],qs[_0x6182('0x32')](_0x56493b['query'][_0x6182('0x32')]));_0x3e104a[_0x6182('0x31')]=_0x3e104a[_0x6182('0x31')][_0x6182('0x33')]?_0x3e104a[_0x6182('0x31')]:_0x587cca[_0x6182('0x2d')];if(!_0x56493b['query'][_0x6182('0x34')](_0x6182('0x35'))){_0x3e104a[_0x6182('0x1a')]=qs[_0x6182('0x1a')](_0x56493b[_0x6182('0x2e')][_0x6182('0x1a')]);_0x3e104a[_0x6182('0x1c')]=qs[_0x6182('0x1c')](_0x56493b['query'][_0x6182('0x1c')]);}_0x3e104a[_0x6182('0x36')]=qs['sort'](_0x56493b[_0x6182('0x2e')][_0x6182('0x37')]);_0x3e104a[_0x6182('0x38')]=qs[_0x6182('0x2f')](_[_0x6182('0x39')](_0x56493b[_0x6182('0x2e')],_0x587cca['filters']),_0x3d9e09);if(_0x56493b[_0x6182('0x2e')]['filter']){_0x3e104a['where']=_['merge'](_0x3e104a[_0x6182('0x38')],{'$or':_[_0x6182('0x2a')](_0x3d9e09,function(_0x24004c){if(_0x24004c[_0x6182('0x3a')]!==_0x6182('0x3b')){var _0x3d1e96={};_0x3d1e96[_0x24004c[_0x6182('0x29')]]={'$like':'%'+_0x56493b[_0x6182('0x2e')][_0x6182('0x3c')]+'%'};return _0x3d1e96;}})});}_0x3e104a=_[_0x6182('0x3d')]({},_0x3e104a,_0x56493b[_0x6182('0x3e')]);var _0x4de3d7={'where':_0x3e104a[_0x6182('0x38')]};return db[_0x6182('0x3f')][_0x6182('0x1b')](_0x4de3d7)[_0x6182('0x23')](function(_0x37b21c){_0x4f1f26['count']=_0x37b21c;if(_0x56493b['query'][_0x6182('0x40')]){_0x3e104a[_0x6182('0x41')]=[{'all':!![]}];}return db[_0x6182('0x3f')][_0x6182('0x42')](_0x3e104a);})[_0x6182('0x23')](function(_0x230ad7){_0x4f1f26[_0x6182('0x43')]=_0x230ad7;return _0x4f1f26;})[_0x6182('0x23')](respondWithFilteredResult(_0x4980d1,_0x3e104a))[_0x6182('0x44')](handleError(_0x4980d1,null));};exports['show']=function(_0x1334fe,_0x3541f4){var _0x1ca0d4={'raw':![],'where':{'id':_0x1334fe[_0x6182('0x45')]['id']}},_0x2e3841={};_0x2e3841[_0x6182('0x2d')]=_[_0x6182('0x46')](db['Trigger'][_0x6182('0x47')]);_0x2e3841['query']=_['keys'](_0x1334fe['query']);_0x2e3841['filters']=_[_0x6182('0x30')](_0x2e3841[_0x6182('0x2d')],_0x2e3841[_0x6182('0x2e')]);_0x1ca0d4[_0x6182('0x31')]=_[_0x6182('0x30')](_0x2e3841[_0x6182('0x2d')],qs[_0x6182('0x32')](_0x1334fe['query'][_0x6182('0x32')]));_0x1ca0d4[_0x6182('0x31')]=_0x1ca0d4[_0x6182('0x31')]['length']?_0x1ca0d4[_0x6182('0x31')]:_0x2e3841['model'];if(_0x1334fe['query']['includeAll']){_0x1ca0d4['include']=[{'all':!![]}];}_0x1ca0d4=_['merge']({},_0x1ca0d4,_0x1334fe[_0x6182('0x3e')]);return db[_0x6182('0x3f')]['find'](_0x1ca0d4)[_0x6182('0x23')](handleEntityNotFound(_0x3541f4,null))[_0x6182('0x23')](respondWithResult(_0x3541f4,null))[_0x6182('0x44')](handleError(_0x3541f4,null));};exports['create']=function(_0x9115ce,_0x219c15){return db[_0x6182('0x3f')][_0x6182('0x48')](_0x9115ce[_0x6182('0x49')],{})[_0x6182('0x23')](function(_0x54bbd2){var _0xafaafa=_0x9115ce[_0x6182('0x4a')][_0x6182('0x24')]({'plain':!![]});if(!_0xafaafa)throw new Error(_0x6182('0x4b'));if(_0xafaafa['role']===_0x6182('0x4a')){var _0x56f3ae=_0x54bbd2[_0x6182('0x24')]({'plain':!![]});var _0x64a11c=_0x6182('0x25');return db[_0x6182('0x4c')][_0x6182('0x4d')]({'where':{'name':_0x64a11c,'userProfileId':_0xafaafa['userProfileId']},'raw':!![]})[_0x6182('0x23')](function(_0x4736ec){if(_0x4736ec&&_0x4736ec['autoAssociation']===0x0){return db[_0x6182('0x26')][_0x6182('0x48')]({'name':_0x56f3ae[_0x6182('0x29')],'resourceId':_0x56f3ae['id'],'type':_0x4736ec[_0x6182('0x29')],'sectionId':_0x4736ec['id']},{})[_0x6182('0x23')](function(){return _0x54bbd2;});}else{return _0x54bbd2;}})['catch'](function(_0x376a77){logger[_0x6182('0x28')](_0x6182('0x4e'),_0x376a77);throw _0x376a77;});}return _0x54bbd2;})[_0x6182('0x23')](respondWithResult(_0x219c15,0xc9))[_0x6182('0x44')](handleError(_0x219c15,null));};exports[_0x6182('0x4f')]=function(_0x1354fb,_0x180eea){if(_0x1354fb[_0x6182('0x49')]['id']){delete _0x1354fb[_0x6182('0x49')]['id'];}return db[_0x6182('0x3f')][_0x6182('0x4d')]({'where':{'id':_0x1354fb[_0x6182('0x45')]['id']}})[_0x6182('0x23')](handleEntityNotFound(_0x180eea,null))[_0x6182('0x23')](saveUpdates(_0x1354fb[_0x6182('0x49')],null))[_0x6182('0x23')](respondWithResult(_0x180eea,null))[_0x6182('0x44')](handleError(_0x180eea,null));};exports[_0x6182('0x22')]=function(_0x234710,_0x5019f7){return db[_0x6182('0x3f')][_0x6182('0x4d')]({'where':{'id':_0x234710[_0x6182('0x45')]['id']}})[_0x6182('0x23')](handleEntityNotFound(_0x5019f7,null))['then'](removeEntity(_0x5019f7,null))['catch'](handleError(_0x5019f7,null));};exports[_0x6182('0x50')]=function(_0x264f46,_0x467ae8,_0x1371ba){if(_0x264f46['body']['id']){delete _0x264f46[_0x6182('0x49')]['id'];}return db['Trigger'][_0x6182('0x4d')]({'where':{'id':_0x264f46[_0x6182('0x45')]['id']}})['then'](handleEntityNotFound(_0x467ae8,null))[_0x6182('0x23')](function(_0xdc3dd5){if(_0xdc3dd5){_0x264f46['body'][_0x6182('0x51')]=_0xdc3dd5['id'];return db[_0x6182('0x52')][_0x6182('0x48')](_0x264f46[_0x6182('0x49')]);}})['then'](respondWithResult(_0x467ae8,null))[_0x6182('0x44')](handleError(_0x467ae8,null));};exports[_0x6182('0x53')]=function(_0x33e06f,_0x13306e,_0x201261){if(_0x33e06f['body']['id']){delete _0x33e06f['body']['id'];}return db[_0x6182('0x3f')]['find']({'where':{'id':_0x33e06f['params']['id']}})[_0x6182('0x23')](handleEntityNotFound(_0x13306e,null))[_0x6182('0x23')](function(_0x5ee65f){if(_0x5ee65f){_0x33e06f[_0x6182('0x49')]['TriggerAnyId']=_0x5ee65f['id'];return db['Condition']['create'](_0x33e06f[_0x6182('0x49')]);}})['then'](respondWithResult(_0x13306e,null))[_0x6182('0x44')](handleError(_0x13306e,null));};exports[_0x6182('0x54')]=function(_0x4a1d25,_0x1827c2,_0x22441e){var _0x1cc9ce={};var _0x4d4fb6={};var _0x5b0fb3;var _0xdd0f14;return db[_0x6182('0x3f')][_0x6182('0x55')]({'where':{'id':_0x4a1d25[_0x6182('0x45')]['id']}})['then'](handleEntityNotFound(_0x1827c2,null))[_0x6182('0x23')](function(_0x267633){if(_0x267633){_0x5b0fb3=_0x267633;_0x4d4fb6[_0x6182('0x2d')]=_[_0x6182('0x46')](db[_0x6182('0x52')][_0x6182('0x47')]);_0x4d4fb6[_0x6182('0x2e')]=_[_0x6182('0x46')](_0x4a1d25[_0x6182('0x2e')]);_0x4d4fb6[_0x6182('0x2f')]=_['intersection'](_0x4d4fb6[_0x6182('0x2d')],_0x4d4fb6[_0x6182('0x2e')]);_0x1cc9ce[_0x6182('0x31')]=_[_0x6182('0x30')](_0x4d4fb6[_0x6182('0x2d')],qs[_0x6182('0x32')](_0x4a1d25[_0x6182('0x2e')][_0x6182('0x32')]));_0x1cc9ce[_0x6182('0x31')]=_0x1cc9ce[_0x6182('0x31')][_0x6182('0x33')]?_0x1cc9ce[_0x6182('0x31')]:_0x4d4fb6[_0x6182('0x2d')];_0x1cc9ce['order']=qs[_0x6182('0x37')](_0x4a1d25['query']['sort']);_0x1cc9ce[_0x6182('0x38')]=qs[_0x6182('0x2f')](_['pick'](_0x4a1d25[_0x6182('0x2e')],_0x4d4fb6[_0x6182('0x2f')]));if(_0x4a1d25['query'][_0x6182('0x3c')]){_0x1cc9ce['where']=_['merge'](_0x1cc9ce[_0x6182('0x38')],{'$or':_[_0x6182('0x2a')](_0x1cc9ce[_0x6182('0x31')],function(_0xed2c12){var _0x5c41ff={};_0x5c41ff[_0xed2c12]={'$like':'%'+_0x4a1d25['query'][_0x6182('0x3c')]+'%'};return _0x5c41ff;})});}_0x1cc9ce=_[_0x6182('0x3d')]({},_0x1cc9ce,_0x4a1d25[_0x6182('0x3e')]);return _0x5b0fb3['getAllConditions'](_0x1cc9ce);}})[_0x6182('0x23')](function(_0x2b393d){if(_0x2b393d){_0xdd0f14=_0x2b393d[_0x6182('0x33')];if(!_0x4a1d25[_0x6182('0x2e')][_0x6182('0x34')](_0x6182('0x35'))){_0x1cc9ce[_0x6182('0x1a')]=qs[_0x6182('0x1a')](_0x4a1d25[_0x6182('0x2e')][_0x6182('0x1a')]);_0x1cc9ce[_0x6182('0x1c')]=qs[_0x6182('0x1c')](_0x4a1d25[_0x6182('0x2e')]['offset']);}return _0x5b0fb3['getAllConditions'](_0x1cc9ce);}})['then'](function(_0x4cb3fe){if(_0x4cb3fe){return _0x4cb3fe?{'count':_0xdd0f14,'rows':_0x4cb3fe}:null;}})[_0x6182('0x23')](respondWithResult(_0x1827c2,null))[_0x6182('0x44')](handleError(_0x1827c2,null));};exports[_0x6182('0x56')]=function(_0x2261ba,_0x49e781,_0x457c2e){var _0x35f2f9={};var _0x2ddc6c={};var _0x1ffa96;var _0x55a48d;return db[_0x6182('0x3f')][_0x6182('0x55')]({'where':{'id':_0x2261ba[_0x6182('0x45')]['id']}})[_0x6182('0x23')](handleEntityNotFound(_0x49e781,null))[_0x6182('0x23')](function(_0x5b99f0){if(_0x5b99f0){_0x1ffa96=_0x5b99f0;_0x2ddc6c['model']=_[_0x6182('0x46')](db['Condition'][_0x6182('0x47')]);_0x2ddc6c[_0x6182('0x2e')]=_['keys'](_0x2261ba[_0x6182('0x2e')]);_0x2ddc6c[_0x6182('0x2f')]=_['intersection'](_0x2ddc6c['model'],_0x2ddc6c[_0x6182('0x2e')]);_0x35f2f9[_0x6182('0x31')]=_[_0x6182('0x30')](_0x2ddc6c[_0x6182('0x2d')],qs[_0x6182('0x32')](_0x2261ba[_0x6182('0x2e')][_0x6182('0x32')]));_0x35f2f9[_0x6182('0x31')]=_0x35f2f9[_0x6182('0x31')][_0x6182('0x33')]?_0x35f2f9[_0x6182('0x31')]:_0x2ddc6c[_0x6182('0x2d')];_0x35f2f9[_0x6182('0x36')]=qs['sort'](_0x2261ba[_0x6182('0x2e')][_0x6182('0x37')]);_0x35f2f9[_0x6182('0x38')]=qs[_0x6182('0x2f')](_[_0x6182('0x39')](_0x2261ba[_0x6182('0x2e')],_0x2ddc6c['filters']));if(_0x2261ba[_0x6182('0x2e')]['filter']){_0x35f2f9['where']=_[_0x6182('0x3d')](_0x35f2f9[_0x6182('0x38')],{'$or':_[_0x6182('0x2a')](_0x35f2f9[_0x6182('0x31')],function(_0x240112){var _0x56b01a={};_0x56b01a[_0x240112]={'$like':'%'+_0x2261ba[_0x6182('0x2e')][_0x6182('0x3c')]+'%'};return _0x56b01a;})});}_0x35f2f9=_[_0x6182('0x3d')]({},_0x35f2f9,_0x2261ba[_0x6182('0x3e')]);return _0x1ffa96[_0x6182('0x56')](_0x35f2f9);}})[_0x6182('0x23')](function(_0x415eab){if(_0x415eab){_0x55a48d=_0x415eab[_0x6182('0x33')];if(!_0x2261ba['query'][_0x6182('0x34')]('nolimit')){_0x35f2f9[_0x6182('0x1a')]=qs[_0x6182('0x1a')](_0x2261ba['query'][_0x6182('0x1a')]);_0x35f2f9[_0x6182('0x1c')]=qs[_0x6182('0x1c')](_0x2261ba[_0x6182('0x2e')][_0x6182('0x1c')]);}return _0x1ffa96[_0x6182('0x56')](_0x35f2f9);}})[_0x6182('0x23')](function(_0x5a8562){if(_0x5a8562){return _0x5a8562?{'count':_0x55a48d,'rows':_0x5a8562}:null;}})[_0x6182('0x23')](respondWithResult(_0x49e781,null))[_0x6182('0x44')](handleError(_0x49e781,null));};exports['addAction']=function(_0xaa75c4,_0x268c39,_0x1c7db1){if(_0xaa75c4['body']['id']){delete _0xaa75c4[_0x6182('0x49')]['id'];}return db[_0x6182('0x3f')][_0x6182('0x4d')]({'where':{'id':_0xaa75c4[_0x6182('0x45')]['id']}})['then'](handleEntityNotFound(_0x268c39,null))[_0x6182('0x23')](function(_0xd30774){if(_0xd30774){_0xaa75c4[_0x6182('0x49')][_0x6182('0x57')]=_0xd30774['id'];return db[_0x6182('0x58')]['create'](_0xaa75c4['body']);}})['then'](respondWithResult(_0x268c39,null))[_0x6182('0x44')](handleError(_0x268c39,null));};exports[_0x6182('0x59')]=function(_0x17b390,_0x445e15,_0x499fac){var _0x5c0a3a={};var _0x92fda9={};var _0x59927e;var _0x362b42;return db[_0x6182('0x3f')][_0x6182('0x55')]({'where':{'id':_0x17b390[_0x6182('0x45')]['id']}})[_0x6182('0x23')](handleEntityNotFound(_0x445e15,null))['then'](function(_0x36647f){if(_0x36647f){_0x59927e=_0x36647f;_0x92fda9[_0x6182('0x2d')]=_['keys'](db['Action'][_0x6182('0x47')]);_0x92fda9[_0x6182('0x2e')]=_[_0x6182('0x46')](_0x17b390[_0x6182('0x2e')]);_0x92fda9['filters']=_[_0x6182('0x30')](_0x92fda9[_0x6182('0x2d')],_0x92fda9['query']);_0x5c0a3a['attributes']=_['intersection'](_0x92fda9[_0x6182('0x2d')],qs[_0x6182('0x32')](_0x17b390[_0x6182('0x2e')][_0x6182('0x32')]));_0x5c0a3a[_0x6182('0x31')]=_0x5c0a3a['attributes'][_0x6182('0x33')]?_0x5c0a3a['attributes']:_0x92fda9[_0x6182('0x2d')];_0x5c0a3a['order']=qs['sort'](_0x17b390[_0x6182('0x2e')][_0x6182('0x37')]);_0x5c0a3a[_0x6182('0x38')]=qs[_0x6182('0x2f')](_[_0x6182('0x39')](_0x17b390[_0x6182('0x2e')],_0x92fda9['filters']));if(_0x17b390['query']['filter']){_0x5c0a3a['where']=_[_0x6182('0x3d')](_0x5c0a3a[_0x6182('0x38')],{'$or':_[_0x6182('0x2a')](_0x5c0a3a[_0x6182('0x31')],function(_0x4d3847){var _0x4efb83={};_0x4efb83[_0x4d3847]={'$like':'%'+_0x17b390['query'][_0x6182('0x3c')]+'%'};return _0x4efb83;})});}_0x5c0a3a=_['merge']({},_0x5c0a3a,_0x17b390[_0x6182('0x3e')]);return _0x59927e[_0x6182('0x59')](_0x5c0a3a);}})[_0x6182('0x23')](function(_0x8f9f30){if(_0x8f9f30){_0x362b42=_0x8f9f30[_0x6182('0x33')];if(!_0x17b390['query'][_0x6182('0x34')](_0x6182('0x35'))){_0x5c0a3a[_0x6182('0x1a')]=qs[_0x6182('0x1a')](_0x17b390[_0x6182('0x2e')][_0x6182('0x1a')]);_0x5c0a3a[_0x6182('0x1c')]=qs[_0x6182('0x1c')](_0x17b390[_0x6182('0x2e')][_0x6182('0x1c')]);}return _0x59927e[_0x6182('0x59')](_0x5c0a3a);}})[_0x6182('0x23')](function(_0x23593a){if(_0x23593a){return _0x23593a?{'count':_0x362b42,'rows':_0x23593a}:null;}})[_0x6182('0x23')](respondWithResult(_0x445e15,null))['catch'](handleError(_0x445e15,null));};
\ No newline at end of file
index bddf6d1..64fa4fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7118=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api','bluebird'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x7118,0x159));var _0x8711=function(_0x18026a,_0x2f0708){_0x18026a=_0x18026a-0x0;var _0x42df34=_0x7118[_0x18026a];return _0x42df34;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8711('0x0'))(_0x8711('0x1'));var moment=require('moment');var BPromise=require(_0x8711('0x2'));var rp=require(_0x8711('0x3'));var fs=require('fs');var path=require(_0x8711('0x4'));var rimraf=require(_0x8711('0x5'));var config=require(_0x8711('0x6'));var attributes=require(_0x8711('0x7'));module[_0x8711('0x8')]=function(_0x54885e,_0x385033){return _0x54885e[_0x8711('0x9')](_0x8711('0xa'),attributes,{'tableName':_0x8711('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f49=['util','api','moment','bluebird','path','rimraf','exports','Trigger','lodash'];(function(_0x6dca2d,_0x5c9cc){var _0x14e000=function(_0x30bd68){while(--_0x30bd68){_0x6dca2d['push'](_0x6dca2d['shift']());}};_0x14e000(++_0x5c9cc);}(_0x3f49,0x11f));var _0x93f4=function(_0x450a2d,_0x5c4673){_0x450a2d=_0x450a2d-0x0;var _0x39b4b6=_0x3f49[_0x450a2d];return _0x39b4b6;};'use strict';var _=require(_0x93f4('0x0'));var util=require(_0x93f4('0x1'));var logger=require('../../config/logger')(_0x93f4('0x2'));var moment=require(_0x93f4('0x3'));var BPromise=require(_0x93f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x93f4('0x5'));var rimraf=require(_0x93f4('0x6'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module[_0x93f4('0x7')]=function(_0x38eb6c,_0x2dfdf7){return _0x38eb6c['define'](_0x93f4('0x8'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b39d6b..0b9cd39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdea=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','Trigger','findAll','raw','options','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','catch','lodash'];(function(_0x5bd6e3,_0x23d132){var _0x3cbebc=function(_0x3da13e){while(--_0x3da13e){_0x5bd6e3['push'](_0x5bd6e3['shift']());}};_0x3cbebc(++_0x23d132);}(_0xbdea,0x1e9));var _0xabde=function(_0x45385c,_0x840419){_0x45385c=_0x45385c-0x0;var _0x523eb1=_0xbdea[_0x45385c];return _0x523eb1;};'use strict';var _=require(_0xabde('0x0'));var util=require(_0xabde('0x1'));var moment=require(_0xabde('0x2'));var BPromise=require(_0xabde('0x3'));var rs=require(_0xabde('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabde('0x5'))['db'];var utils=require(_0xabde('0x6'));var logger=require(_0xabde('0x7'))(_0xabde('0x8'));var config=require('../../config/environment');var jayson=require(_0xabde('0x9'));var client=jayson[_0xabde('0xa')][_0xabde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfdfa9,_0x262af6,_0x347a45){return new BPromise(function(_0x402c7a,_0x5906d){return client[_0xabde('0xc')](_0xfdfa9,_0x347a45)[_0xabde('0xd')](function(_0x3765c7){logger[_0xabde('0xe')]('Trigger,\x20%s,\x20%s',_0x262af6,'request\x20sent');logger[_0xabde('0xf')](_0xabde('0x10'),_0x262af6,'request\x20sent',JSON[_0xabde('0x11')](_0x3765c7));if(_0x3765c7[_0xabde('0x12')]){if(_0x3765c7[_0xabde('0x12')]['code']===0x1f4){logger[_0xabde('0x12')](_0xabde('0x13'),_0x262af6,_0x3765c7[_0xabde('0x12')]['message']);return _0x5906d(_0x3765c7[_0xabde('0x12')][_0xabde('0x14')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x262af6,_0x3765c7[_0xabde('0x12')][_0xabde('0x14')]);return _0x402c7a(_0x3765c7[_0xabde('0x12')][_0xabde('0x14')]);}else{logger[_0xabde('0xe')](_0xabde('0x13'),_0x262af6,'request\x20sent');_0x402c7a(_0x3765c7[_0xabde('0x15')][_0xabde('0x14')]);}})['catch'](function(_0xbc51ad){logger[_0xabde('0x12')](_0xabde('0x13'),_0x262af6,_0xbc51ad);_0x5906d(_0xbc51ad);});});}exports['GetTrigger']=function(_0x5d70be){var _0x172f7d=this;return new Promise(function(_0x490767,_0x54700d){return db[_0xabde('0x16')][_0xabde('0x17')]({'raw':_0x5d70be['options']?_0x5d70be['options'][_0xabde('0x18')]===undefined?!![]:![]:!![],'where':_0x5d70be[_0xabde('0x19')]?_0x5d70be[_0xabde('0x19')][_0xabde('0x1a')]||null:null,'attributes':_0x5d70be[_0xabde('0x19')]?_0x5d70be[_0xabde('0x19')][_0xabde('0x1b')]||null:null,'limit':_0x5d70be['options']?_0x5d70be['options'][_0xabde('0x1c')]||null:null,'include':_0x5d70be[_0xabde('0x19')]?_0x5d70be[_0xabde('0x19')][_0xabde('0x1d')]?_[_0xabde('0x1e')](_0x5d70be[_0xabde('0x19')][_0xabde('0x1d')],function(_0x4d81ba){return{'model':db[_0x4d81ba[_0xabde('0x1f')]],'as':_0x4d81ba['as'],'attributes':_0x4d81ba['attributes'],'include':_0x4d81ba[_0xabde('0x1d')]?_[_0xabde('0x1e')](_0x4d81ba[_0xabde('0x1d')],function(_0x361fab){return{'model':db[_0x361fab[_0xabde('0x1f')]],'as':_0x361fab['as'],'attributes':_0x361fab[_0xabde('0x1b')],'include':_0x361fab[_0xabde('0x1d')]?_[_0xabde('0x1e')](_0x361fab['include'],function(_0x5c26c9){return{'model':db[_0x5c26c9[_0xabde('0x1f')]],'as':_0x5c26c9['as'],'attributes':_0x5c26c9[_0xabde('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b4b59){logger['info'](_0xabde('0x20'),_0x5d70be);logger['debug'](_0xabde('0x20'),_0x5d70be,JSON[_0xabde('0x11')](_0x1b4b59));_0x490767(_0x1b4b59);})['catch'](function(_0x299daf){logger['error'](_0xabde('0x20'),_0x299daf['message'],_0x5d70be);_0x54700d(_0x172f7d[_0xabde('0x12')](0x1f4,_0x299daf[_0xabde('0x14')]));});});};exports[_0xabde('0x21')]=function(_0x46b266){var _0x267cf3=this;return new Promise(function(_0x491ea4,_0x2d021e){return db[_0xabde('0x16')]['find']({'raw':_0x46b266[_0xabde('0x19')]?_0x46b266[_0xabde('0x19')][_0xabde('0x18')]===undefined?!![]:![]:!![],'where':_0x46b266[_0xabde('0x19')]?_0x46b266[_0xabde('0x19')][_0xabde('0x1a')]||null:null,'attributes':_0x46b266[_0xabde('0x19')]?_0x46b266[_0xabde('0x19')]['attributes']||null:null,'include':_0x46b266[_0xabde('0x19')]?_0x46b266[_0xabde('0x19')][_0xabde('0x1d')]?_[_0xabde('0x1e')](_0x46b266[_0xabde('0x19')]['include'],function(_0xcaa2af){return{'model':db[_0xcaa2af[_0xabde('0x1f')]],'as':_0xcaa2af['as'],'attributes':_0xcaa2af['attributes'],'include':_0xcaa2af['include']?_[_0xabde('0x1e')](_0xcaa2af[_0xabde('0x1d')],function(_0x38bf9e){return{'model':db[_0x38bf9e[_0xabde('0x1f')]],'as':_0x38bf9e['as'],'attributes':_0x38bf9e[_0xabde('0x1b')],'include':_0x38bf9e[_0xabde('0x1d')]?_[_0xabde('0x1e')](_0x38bf9e[_0xabde('0x1d')],function(_0x50854f){return{'model':db[_0x50854f[_0xabde('0x1f')]],'as':_0x50854f['as'],'attributes':_0x50854f[_0xabde('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xabde('0xd')](function(_0x17bab7){logger[_0xabde('0xe')](_0xabde('0x21'),_0x46b266);logger[_0xabde('0xf')](_0xabde('0x21'),_0x46b266,JSON[_0xabde('0x11')](_0x17bab7));_0x491ea4(_0x17bab7);})[_0xabde('0x22')](function(_0x1273c5){logger[_0xabde('0x12')]('ShowTrigger',_0x1273c5['message'],_0x46b266);_0x2d021e(_0x267cf3[_0xabde('0x12')](0x1f4,_0x1273c5['message']));});});};
\ No newline at end of file
+var _0x8178=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options','raw','attributes','limit','include','map','model','find','where','ShowTrigger','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x8178,0x110));var _0x8817=function(_0x19f137,_0x69a6c5){_0x19f137=_0x19f137-0x0;var _0x13021f=_0x8178[_0x19f137];return _0x13021f;};'use strict';var _=require(_0x8817('0x0'));var util=require('util');var moment=require(_0x8817('0x1'));var BPromise=require(_0x8817('0x2'));var rs=require(_0x8817('0x3'));var fs=require('fs');var Redis=require(_0x8817('0x4'));var db=require(_0x8817('0x5'))['db'];var utils=require(_0x8817('0x6'));var logger=require('../../config/logger')(_0x8817('0x7'));var config=require(_0x8817('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8817('0x9')][_0x8817('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11034c,_0x3145b9,_0x5ca62e){return new BPromise(function(_0x4d11ce,_0x1a2b34){return client[_0x8817('0xb')](_0x11034c,_0x5ca62e)[_0x8817('0xc')](function(_0x14fdcb){logger[_0x8817('0xd')]('Trigger,\x20%s,\x20%s',_0x3145b9,_0x8817('0xe'));logger[_0x8817('0xf')](_0x8817('0x10'),_0x3145b9,_0x8817('0xe'),JSON[_0x8817('0x11')](_0x14fdcb));if(_0x14fdcb[_0x8817('0x12')]){if(_0x14fdcb[_0x8817('0x12')][_0x8817('0x13')]===0x1f4){logger[_0x8817('0x12')](_0x8817('0x14'),_0x3145b9,_0x14fdcb[_0x8817('0x12')][_0x8817('0x15')]);return _0x1a2b34(_0x14fdcb[_0x8817('0x12')]['message']);}logger[_0x8817('0x12')]('Trigger,\x20%s,\x20%s',_0x3145b9,_0x14fdcb[_0x8817('0x12')][_0x8817('0x15')]);return _0x4d11ce(_0x14fdcb[_0x8817('0x12')][_0x8817('0x15')]);}else{logger[_0x8817('0xd')]('Trigger,\x20%s,\x20%s',_0x3145b9,_0x8817('0xe'));_0x4d11ce(_0x14fdcb[_0x8817('0x16')][_0x8817('0x15')]);}})[_0x8817('0x17')](function(_0x1eb588){logger['error'](_0x8817('0x14'),_0x3145b9,_0x1eb588);_0x1a2b34(_0x1eb588);});});}exports[_0x8817('0x18')]=function(_0x85a66){var _0x60412=this;return new Promise(function(_0x17d75f,_0x5a798d){return db[_0x8817('0x19')]['findAll']({'raw':_0x85a66[_0x8817('0x1a')]?_0x85a66[_0x8817('0x1a')][_0x8817('0x1b')]===undefined?!![]:![]:!![],'where':_0x85a66['options']?_0x85a66[_0x8817('0x1a')]['where']||null:null,'attributes':_0x85a66[_0x8817('0x1a')]?_0x85a66['options'][_0x8817('0x1c')]||null:null,'limit':_0x85a66[_0x8817('0x1a')]?_0x85a66[_0x8817('0x1a')][_0x8817('0x1d')]||null:null,'include':_0x85a66[_0x8817('0x1a')]?_0x85a66[_0x8817('0x1a')][_0x8817('0x1e')]?_[_0x8817('0x1f')](_0x85a66[_0x8817('0x1a')][_0x8817('0x1e')],function(_0xdfa58f){return{'model':db[_0xdfa58f[_0x8817('0x20')]],'as':_0xdfa58f['as'],'attributes':_0xdfa58f[_0x8817('0x1c')],'include':_0xdfa58f[_0x8817('0x1e')]?_[_0x8817('0x1f')](_0xdfa58f[_0x8817('0x1e')],function(_0x586988){return{'model':db[_0x586988[_0x8817('0x20')]],'as':_0x586988['as'],'attributes':_0x586988[_0x8817('0x1c')],'include':_0x586988[_0x8817('0x1e')]?_[_0x8817('0x1f')](_0x586988[_0x8817('0x1e')],function(_0x58ada2){return{'model':db[_0x58ada2['model']],'as':_0x58ada2['as'],'attributes':_0x58ada2[_0x8817('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ed2e9){logger[_0x8817('0xd')]('GetTrigger',_0x85a66);logger[_0x8817('0xf')](_0x8817('0x18'),_0x85a66,JSON[_0x8817('0x11')](_0x2ed2e9));_0x17d75f(_0x2ed2e9);})[_0x8817('0x17')](function(_0x1a567f){logger[_0x8817('0x12')](_0x8817('0x18'),_0x1a567f['message'],_0x85a66);_0x5a798d(_0x60412[_0x8817('0x12')](0x1f4,_0x1a567f['message']));});});};exports['ShowTrigger']=function(_0x3dc7ab){var _0x2fb80a=this;return new Promise(function(_0x5ba4dc,_0x5ec258){return db[_0x8817('0x19')][_0x8817('0x21')]({'raw':_0x3dc7ab[_0x8817('0x1a')]?_0x3dc7ab[_0x8817('0x1a')][_0x8817('0x1b')]===undefined?!![]:![]:!![],'where':_0x3dc7ab[_0x8817('0x1a')]?_0x3dc7ab[_0x8817('0x1a')][_0x8817('0x22')]||null:null,'attributes':_0x3dc7ab['options']?_0x3dc7ab[_0x8817('0x1a')][_0x8817('0x1c')]||null:null,'include':_0x3dc7ab[_0x8817('0x1a')]?_0x3dc7ab[_0x8817('0x1a')]['include']?_[_0x8817('0x1f')](_0x3dc7ab['options'][_0x8817('0x1e')],function(_0x269571){return{'model':db[_0x269571[_0x8817('0x20')]],'as':_0x269571['as'],'attributes':_0x269571['attributes'],'include':_0x269571[_0x8817('0x1e')]?_[_0x8817('0x1f')](_0x269571[_0x8817('0x1e')],function(_0x4ce820){return{'model':db[_0x4ce820['model']],'as':_0x4ce820['as'],'attributes':_0x4ce820[_0x8817('0x1c')],'include':_0x4ce820[_0x8817('0x1e')]?_['map'](_0x4ce820['include'],function(_0x31d6d1){return{'model':db[_0x31d6d1[_0x8817('0x20')]],'as':_0x31d6d1['as'],'attributes':_0x31d6d1[_0x8817('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8817('0xc')](function(_0x1ff53){logger[_0x8817('0xd')](_0x8817('0x23'),_0x3dc7ab);logger['debug'](_0x8817('0x23'),_0x3dc7ab,JSON[_0x8817('0x11')](_0x1ff53));_0x5ba4dc(_0x1ff53);})[_0x8817('0x17')](function(_0x179206){logger['error']('ShowTrigger',_0x179206[_0x8817('0x15')],_0x3dc7ab);_0x5ec258(_0x2fb80a[_0x8817('0x12')](0x1f4,_0x179206[_0x8817('0x15')]));});});};
\ No newline at end of file
index c35b90c..7efd93b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab41=['/:id/clone','clone','create','put','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0x168fe1,_0x2cb0ec){var _0x1c29a5=function(_0x2b1e64){while(--_0x2b1e64){_0x168fe1['push'](_0x168fe1['shift']());}};_0x1c29a5(++_0x2cb0ec);}(_0xab41,0x97));var _0x1ab4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xab41[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require(_0x1ab4('0x0'));var path=require('path');var timeout=require(_0x1ab4('0x1'));var express=require(_0x1ab4('0x2'));var router=express[_0x1ab4('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ab4('0x4'));var config=require(_0x1ab4('0x5'));var controller=require(_0x1ab4('0x6'));router[_0x1ab4('0x7')]('/',auth[_0x1ab4('0x8')](),controller[_0x1ab4('0x9')]);router[_0x1ab4('0x7')](_0x1ab4('0xa'),auth[_0x1ab4('0x8')](),controller['show']);router['post'](_0x1ab4('0xb'),auth[_0x1ab4('0x8')](),controller[_0x1ab4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1ab4('0xd')]);router[_0x1ab4('0xe')](_0x1ab4('0xa'),auth[_0x1ab4('0x8')](),controller['update']);router[_0x1ab4('0xf')](_0x1ab4('0xa'),auth[_0x1ab4('0x8')](),controller[_0x1ab4('0x10')]);module[_0x1ab4('0x11')]=router;
\ No newline at end of file
+var _0x1b40=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x1b40,0x1b6));var _0x01b4=function(_0x53d578,_0x4ca37f){_0x53d578=_0x53d578-0x0;var _0x5ce805=_0x1b40[_0x53d578];return _0x5ce805;};'use strict';var multer=require(_0x01b4('0x0'));var util=require(_0x01b4('0x1'));var path=require(_0x01b4('0x2'));var timeout=require(_0x01b4('0x3'));var express=require(_0x01b4('0x4'));var router=express[_0x01b4('0x5')]();var fs_extra=require(_0x01b4('0x6'));var auth=require(_0x01b4('0x7'));var interaction=require(_0x01b4('0x8'));var config=require(_0x01b4('0x9'));var controller=require(_0x01b4('0xa'));router[_0x01b4('0xb')]('/',auth[_0x01b4('0xc')](),controller[_0x01b4('0xd')]);router[_0x01b4('0xb')](_0x01b4('0xe'),auth[_0x01b4('0xc')](),controller[_0x01b4('0xf')]);router[_0x01b4('0x10')](_0x01b4('0x11'),auth[_0x01b4('0xc')](),controller['clone']);router[_0x01b4('0x10')]('/',auth[_0x01b4('0xc')](),controller[_0x01b4('0x12')]);router[_0x01b4('0x13')]('/:id',auth[_0x01b4('0xc')](),controller[_0x01b4('0x14')]);router[_0x01b4('0x15')]('/:id',auth[_0x01b4('0xc')](),controller[_0x01b4('0x16')]);module[_0x01b4('0x17')]=router;
\ No newline at end of file
index bcfecc2..793cfbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2969=['accept','refuse','uas','pai','fingerprint','certificate','passive','actpass','dynamic','sequelize','STRING','ENUM','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','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','never','INTEGER','always'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x2969,0x136));var _0x9296=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2969[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x9296('0x0'));module['exports']={'name':{'type':Sequelize[_0x9296('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9296('0x2')]('friend','user',_0x9296('0x3')),'allowNull':![],'defaultValue':_0x9296('0x4')},'context':{'type':Sequelize[_0x9296('0x1')],'allowNull':![],'defaultValue':_0x9296('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0x9296('0x6'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x9296('0x7'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x9296('0x8'))},'deny':{'type':Sequelize[_0x9296('0x1')]},'permit':{'type':Sequelize[_0x9296('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x9296('0x1')]},'remotesecret':{'type':Sequelize[_0x9296('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x4b7e8a){this[_0x9296('0x9')]('transport',_0x4b7e8a?_0x4b7e8a[_0x9296('0xa')](','):null);},'get':function(){return this[_0x9296('0xb')](_0x9296('0xc'))?this[_0x9296('0xb')]('transport')[_0x9296('0xd')](','):null;},'comment':_0x9296('0xe')},'dtmfmode':{'type':Sequelize[_0x9296('0x2')](_0x9296('0xf'),_0x9296('0x10'),'shortinfo',_0x9296('0x11'),_0x9296('0x12')),'defaultValue':_0x9296('0xf')},'directmedia':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no',_0x9296('0x14'),_0x9296('0x15'),_0x9296('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x9296('0x13'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9296('0x1')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x9296('0x17'),'set':function(_0x532f6e){this[_0x9296('0x9')](_0x9296('0x18'),_0x532f6e?_0x532f6e['join'](','):null);},'get':function(){return this[_0x9296('0xb')]('nat')?this[_0x9296('0xb')](_0x9296('0x18'))[_0x9296('0xd')](','):null;},'comment':_0x9296('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x9296('0x1')]},'pickupgroup':{'type':Sequelize[_0x9296('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9296('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9296('0x1a'),'set':function(_0x2a80b0){this[_0x9296('0x9')](_0x9296('0x1b'),_0x2a80b0?_0x2a80b0[_0x9296('0xa')](';'):_0x9296('0x1a'));},'get':function(){return this[_0x9296('0xb')](_0x9296('0x1b'))?this[_0x9296('0xb')](_0x9296('0x1b'))[_0x9296('0xd')](';'):null;},'comment':_0x9296('0x1c')},'autoframing':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'insecure':{'type':Sequelize[_0x9296('0x1')],'defaultValue':_0x9296('0x1d'),'set':function(_0x5b0b32){this['setDataValue'](_0x9296('0x1e'),_0x5b0b32?_0x5b0b32['join'](','):null);},'get':function(){return this[_0x9296('0xb')]('insecure')?this[_0x9296('0xb')](_0x9296('0x1e'))[_0x9296('0xd')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x9296('0x13'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9296('0x2')]('yes','no',_0x9296('0x1f'))},'promiscredir':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'useclientcode':{'type':Sequelize[_0x9296('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9296('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x9296('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0x9296('0x13'),'no'),'defaultValue':_0x9296('0x13')},'busylevel':{'type':Sequelize[_0x9296('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x9296('0x13'),'no')},'allowtransfer':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'ignoresdpversion':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'subscribecontext':{'type':Sequelize[_0x9296('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no',_0x9296('0x21')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9296('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x9296('0x13'),'no')},'mailbox':{'type':Sequelize[_0x9296('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x9296('0x22'),_0x9296('0x23'),'originate')},'session_expires':{'type':Sequelize[_0x9296('0x20')](0xb)},'session_minse':{'type':Sequelize[_0x9296('0x20')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0x9296('0x24')),'defaultValue':_0x9296('0x24')},'t38pt_usertpsource':{'type':Sequelize[_0x9296('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x9296('0x1')]},'fromuser':{'type':Sequelize[_0x9296('0x1')]},'port':{'type':Sequelize[_0x9296('0x20')](0x5)},'qualify':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no'),'defaultValue':_0x9296('0x13')},'keepalive':{'type':Sequelize[_0x9296('0x20')](0xb)},'defaultip':{'type':Sequelize[_0x9296('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x9296('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x9296('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0x9296('0x2')]('yes','no',_0x9296('0x25')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9296('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x9296('0x1')]},'contactdeny':{'type':Sequelize[_0x9296('0x1')]},'contactacl':{'type':Sequelize[_0x9296('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x9296('0x1')]},'use_q850_reason':{'type':Sequelize[_0x9296('0x1')]},'maxforwards':{'type':Sequelize[_0x9296('0x20')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'icesupport':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'dtlsenable':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'dtlsverify':{'type':Sequelize[_0x9296('0x2')]('yes','no',_0x9296('0x26'),_0x9296('0x27'))},'dtlsrekey':{'type':Sequelize[_0x9296('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0x9296('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x9296('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x9296('0x1')]},'dtlssetup':{'type':Sequelize[_0x9296('0x2')]('active',_0x9296('0x28'),_0x9296('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9296('0x1')]},'usereqphone':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x9296('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x9296('0x2')](_0x9296('0x13'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x9296('0x1')]},'mohinterpret':{'type':Sequelize[_0x9296('0x1')]},'mohsuggest':{'type':Sequelize[_0x9296('0x1')]},'parkinglot':{'type':Sequelize[_0x9296('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x9296('0x2a')},'canreinvite':{'type':Sequelize[_0x9296('0x2')]('yes','no',_0x9296('0x14'),_0x9296('0x15'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x9296('0x1')]},'otherFields':{'type':Sequelize[_0x9296('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x9296('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x57f8=['ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','nonat','force_rport,comedia','setDataValue','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','pai','fingerprint','certificate','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','from-voip-provider'];(function(_0x4748d1,_0x49d5dd){var _0x5082db=function(_0x846a49){while(--_0x846a49){_0x4748d1['push'](_0x4748d1['shift']());}};_0x5082db(++_0x49d5dd);}(_0x57f8,0xc1));var _0x857f=function(_0x124c75,_0x332013){_0x124c75=_0x124c75-0x0;var _0x5c5471=_0x57f8[_0x124c75];return _0x5c5471;};'use strict';var Sequelize=require(_0x857f('0x0'));module[_0x857f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x857f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x4'),_0x857f('0x5'),'peer'),'allowNull':![],'defaultValue':_0x857f('0x4')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x857f('0x6')},'callingpres':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x7'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x857f('0x8'),_0x857f('0x9'),_0x857f('0xa'),_0x857f('0xb'),_0x857f('0xc'))},'deny':{'type':Sequelize[_0x857f('0xd')]},'permit':{'type':Sequelize[_0x857f('0xd')]},'secret':{'type':Sequelize[_0x857f('0xd')]},'md5secret':{'type':Sequelize[_0x857f('0xd')]},'remotesecret':{'type':Sequelize[_0x857f('0xd')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x857f('0xe'),'set':function(_0x7b7214){this['setDataValue'](_0x857f('0xf'),_0x7b7214?_0x7b7214['join'](','):null);},'get':function(){return this['getDataValue'](_0x857f('0xf'))?this[_0x857f('0x10')](_0x857f('0xf'))[_0x857f('0x11')](','):null;},'comment':_0x857f('0x12')},'dtmfmode':{'type':Sequelize[_0x857f('0x3')]('rfc2833',_0x857f('0x13'),_0x857f('0x14'),_0x857f('0x15'),_0x857f('0x16')),'defaultValue':_0x857f('0x17')},'directmedia':{'type':Sequelize[_0x857f('0x3')]('yes','no',_0x857f('0x18'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x857f('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x857f('0xd')]},'directmediadeny':{'type':Sequelize[_0x857f('0xd')]},'nat':{'type':Sequelize[_0x857f('0xd')],'defaultValue':_0x857f('0x19'),'set':function(_0x4b0ec3){this[_0x857f('0x1a')](_0x857f('0x1b'),_0x4b0ec3?_0x4b0ec3[_0x857f('0x1c')](','):null);},'get':function(){return this[_0x857f('0x10')]('nat')?this[_0x857f('0x10')](_0x857f('0x1b'))['split'](','):null;},'comment':_0x857f('0x1d')},'callgroup':{'type':Sequelize[_0x857f('0xd')]},'namedcallgroup':{'type':Sequelize[_0x857f('0xd')]},'pickupgroup':{'type':Sequelize[_0x857f('0xd')]},'namedpickupgroup':{'type':Sequelize[_0x857f('0xd')]},'language':{'type':Sequelize[_0x857f('0xd')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x857f('0xd')],'defaultValue':_0x857f('0x1e')},'allow':{'type':Sequelize[_0x857f('0xd')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3435e7){this[_0x857f('0x1a')](_0x857f('0x1f'),_0x3435e7?_0x3435e7[_0x857f('0x1c')](';'):_0x857f('0x20'));},'get':function(){return this[_0x857f('0x10')](_0x857f('0x1f'))?this[_0x857f('0x10')]('allow')[_0x857f('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'insecure':{'type':Sequelize[_0x857f('0xd')],'defaultValue':_0x857f('0x22'),'set':function(_0xbb7f34){this[_0x857f('0x1a')](_0x857f('0x23'),_0xbb7f34?_0xbb7f34['join'](','):null);},'get':function(){return this[_0x857f('0x10')](_0x857f('0x23'))?this[_0x857f('0x10')](_0x857f('0x23'))['split'](','):null;},'comment':_0x857f('0x24')},'trustrpid':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x857f('0x21'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x857f('0x21'),'no')},'useclientcode':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x857f('0xd')],'defaultValue':_0x857f('0x25')},'amaflags':{'type':Sequelize[_0x857f('0xd')]},'callcounter':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no'),'defaultValue':_0x857f('0x21')},'busylevel':{'type':Sequelize[_0x857f('0x26')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'allowtransfer':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'ignoresdpversion':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'subscribecontext':{'type':Sequelize[_0x857f('0xd')]},'template':{'type':Sequelize[_0x857f('0xd')]},'videosupport':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no',_0x857f('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x857f('0x26')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x857f('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0x857f('0xd')]},'session_timers':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x28'),'refuse',_0x857f('0x29'))},'session_expires':{'type':Sequelize[_0x857f('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x857f('0x26')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x857f('0x2a'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x857f('0xd')]},'fromdomain':{'type':Sequelize[_0x857f('0xd')]},'fromuser':{'type':Sequelize[_0x857f('0xd')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no'),'defaultValue':_0x857f('0x21')},'keepalive':{'type':Sequelize[_0x857f('0x26')](0xb)},'defaultip':{'type':Sequelize[_0x857f('0xd')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x857f('0x26')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x857f('0x26')](0xb)},'sendrpid':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no',_0x857f('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x857f('0xd')]},'callbackextension':{'type':Sequelize[_0x857f('0xd')]},'timert1':{'type':Sequelize[_0x857f('0x26')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x857f('0x26')](0xb)},'contactpermit':{'type':Sequelize[_0x857f('0xd')]},'contactdeny':{'type':Sequelize[_0x857f('0xd')]},'contactacl':{'type':Sequelize[_0x857f('0xd')]},'unsolicited_mailbox':{'type':Sequelize[_0x857f('0xd')]},'use_q850_reason':{'type':Sequelize[_0x857f('0xd')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0x857f('0x21'),'no')},'dtlsenable':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'dtlsverify':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no',_0x857f('0x2c'),_0x857f('0x2d'))},'dtlsrekey':{'type':Sequelize[_0x857f('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x857f('0xd')]},'dtlsprivatekey':{'type':Sequelize[_0x857f('0xd')]},'dtlscipher':{'type':Sequelize[_0x857f('0xd')]},'dtlscafile':{'type':Sequelize[_0x857f('0xd')]},'dtlscapath':{'type':Sequelize[_0x857f('0xd')]},'dtlssetup':{'type':Sequelize[_0x857f('0x3')]('active',_0x857f('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x857f('0xd')]},'usereqphone':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x857f('0xd')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x857f('0x26')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'subscribemwi':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x857f('0xd')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x857f('0x2f')},'canreinvite':{'type':Sequelize[_0x857f('0x3')](_0x857f('0x21'),'no',_0x857f('0x18'),'update',_0x857f('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x857f('0xd')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x857f('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
index dabffb9..2c5a459 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x1c75f2,_0x155a26){var _0x9f019d=function(_0x2bb4c2){while(--_0x2bb4c2){_0x1c75f2['push'](_0x1c75f2['shift']());}};_0x9f019d(++_0x155a26);}(_0x55ca,0x126));var _0xa55c=function(_0x5a8269,_0xfb2f54){_0x5a8269=_0x5a8269-0x0;var _0x539ed7=_0x55ca[_0x5a8269];return _0x539ed7;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,null));};
\ No newline at end of file
+var _0x55ca=['catch','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','stack','name','send','Trunk','rawAttributes','type','model','map','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','length','options','find','clone','omit','updatedAt','body','createdAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','render','Reload','chan_sip.so','readFileSync','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x12d9d1,_0x11241c){var _0x2095da=function(_0x1243ef){while(--_0x1243ef){_0x12d9d1['push'](_0x12d9d1['shift']());}};_0x2095da(++_0x11241c);}(_0x55ca,0x126));var _0xa55c=function(_0x101ccf,_0x37e172){_0x101ccf=_0x101ccf-0x0;var _0x99b0f1=_0x55ca[_0x101ccf];return _0x99b0f1;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55c('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x576044,_0x5a3672,_0x59ea8d,_0x18ee85){return new BPromise(function(_0x3930e4,_0x462cd6){var _0x938bd6=_0x18ee85||client;return _0x938bd6[_0xa55c('0x19')](_0x576044,_0x59ea8d)[_0xa55c('0x1a')](function(_0x4e0b2f){logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,_0xa55c('0x1d'));logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x5a3672,_0xa55c('0x1d'),JSON[_0xa55c('0x20')](_0x4e0b2f));if(_0x4e0b2f[_0xa55c('0x21')]){if(_0x4e0b2f[_0xa55c('0x21')]['code']===0x1f4){logger[_0xa55c('0x21')](_0xa55c('0x1c'),_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x462cd6(_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5a3672,_0x4e0b2f[_0xa55c('0x21')][_0xa55c('0x22')]);return _0x3930e4(_0x4e0b2f[_0xa55c('0x21')]['message']);}else{logger[_0xa55c('0x1b')](_0xa55c('0x1c'),_0x5a3672,'request\x20sent');_0x3930e4(_0x4e0b2f[_0xa55c('0x23')][_0xa55c('0x22')]);}})[_0xa55c('0x24')](function(_0x1965f1){logger[_0xa55c('0x21')]('Trunk,\x20%s,\x20%s',_0x5a3672,_0x1965f1);_0x462cd6(_0x1965f1);});});}function respondWithStatusCode(_0x1fc828,_0x504c24){_0x504c24=_0x504c24||0xcc;return function(_0x5ba836){if(_0x5ba836){return _0x1fc828['sendStatus'](_0x504c24);}return _0x1fc828[_0xa55c('0x25')](_0x504c24)['end']();};}function respondWithResult(_0x3ecbe7,_0x190757){_0x190757=_0x190757||0xc8;return function(_0x3f64de){if(_0x3f64de){return _0x3ecbe7[_0xa55c('0x25')](_0x190757)[_0xa55c('0x26')](_0x3f64de);}};}function respondWithFilteredResult(_0x170ba4,_0x1da633){return function(_0x11e7f7){if(_0x11e7f7){var _0x192df2=typeof _0x1da633[_0xa55c('0x27')]===_0xa55c('0x28')&&typeof _0x1da633['limit']===_0xa55c('0x28');var _0x28814f=_0x11e7f7[_0xa55c('0x29')];var _0x906caa=_0x192df2?0x0:_0x1da633['offset'];var _0x1377b0=_0x192df2?_0x11e7f7[_0xa55c('0x29')]:_0x1da633[_0xa55c('0x27')]+_0x1da633[_0xa55c('0x2a')];var _0x45ee8d;if(_0x1377b0>=_0x28814f){_0x1377b0=_0x28814f;_0x45ee8d=0xc8;}else{_0x45ee8d=0xce;}_0x170ba4[_0xa55c('0x25')](_0x45ee8d);return _0x170ba4['set'](_0xa55c('0x2b'),_0x906caa+'-'+_0x1377b0+'/'+_0x28814f)['json'](_0x11e7f7);}return null;};}function patchUpdates(_0x35c9c2){return function(_0x1d730b){try{jsonpatch[_0xa55c('0x2c')](_0x1d730b,_0x35c9c2,!![]);}catch(_0x223813){return BPromise['reject'](_0x223813);}return _0x1d730b[_0xa55c('0x2d')]();};}function saveUpdates(_0x2096ae,_0x331e58){return function(_0x20da31){if(_0x20da31){return _0x20da31[_0xa55c('0x2e')](_0x2096ae)[_0xa55c('0x1a')](function(_0x29748a){return _0x29748a;});}return null;};}function removeEntity(_0x24d44d,_0x2808e9){return function(_0xcbaf2e){if(_0xcbaf2e){return _0xcbaf2e[_0xa55c('0x2f')]()['then'](function(){var _0x54ca97=_0xcbaf2e[_0xa55c('0x30')]({'plain':!![]});var _0x19733e='Trunks';return db[_0xa55c('0x31')][_0xa55c('0x2f')]({'where':{'type':_0x19733e,'resourceId':_0x54ca97['id']}})[_0xa55c('0x1a')](function(){return _0xcbaf2e;});})[_0xa55c('0x1a')](function(){_0x24d44d[_0xa55c('0x25')](0xcc)[_0xa55c('0x32')]();});}};}function handleEntityNotFound(_0x3ce1b3,_0x222d4b){return function(_0x3959e3){if(!_0x3959e3){_0x3ce1b3['sendStatus'](0x194);}return _0x3959e3;};}function handleError(_0x5f3e99,_0x4b23d3){_0x4b23d3=_0x4b23d3||0x1f4;return function(_0x3fd75f){logger[_0xa55c('0x21')](_0x3fd75f[_0xa55c('0x33')]);if(_0x3fd75f['name']){delete _0x3fd75f[_0xa55c('0x34')];}_0x5f3e99['status'](_0x4b23d3)[_0xa55c('0x35')](_0x3fd75f);};}exports['index']=function(_0x18c6f1,_0x39267c){var _0x3c0ec1={},_0x4d3eb5={},_0x7c4a47={'count':0x0,'rows':[]};var _0x30f23b=_['map'](db[_0xa55c('0x36')][_0xa55c('0x37')],function(_0x4d9083){return{'name':_0x4d9083['fieldName'],'type':_0x4d9083[_0xa55c('0x38')]['key']};});_0x4d3eb5[_0xa55c('0x39')]=_[_0xa55c('0x3a')](_0x30f23b,'name');_0x4d3eb5['query']=_['keys'](_0x18c6f1['query']);_0x4d3eb5[_0xa55c('0x3b')]=_[_0xa55c('0x3c')](_0x4d3eb5[_0xa55c('0x39')],_0x4d3eb5[_0xa55c('0x3d')]);_0x3c0ec1[_0xa55c('0x3e')]=_['intersection'](_0x4d3eb5[_0xa55c('0x39')],qs[_0xa55c('0x3f')](_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x3f')]));_0x3c0ec1[_0xa55c('0x3e')]=_0x3c0ec1[_0xa55c('0x3e')]['length']?_0x3c0ec1[_0xa55c('0x3e')]:_0x4d3eb5['model'];if(!_0x18c6f1['query'][_0xa55c('0x40')](_0xa55c('0x41'))){_0x3c0ec1['limit']=qs[_0xa55c('0x2a')](_0x18c6f1['query']['limit']);_0x3c0ec1[_0xa55c('0x27')]=qs[_0xa55c('0x27')](_0x18c6f1[_0xa55c('0x3d')]['offset']);}_0x3c0ec1[_0xa55c('0x42')]=qs[_0xa55c('0x43')](_0x18c6f1['query'][_0xa55c('0x43')]);_0x3c0ec1['where']=qs[_0xa55c('0x3b')](_[_0xa55c('0x44')](_0x18c6f1['query'],_0x4d3eb5[_0xa55c('0x3b')]),_0x30f23b);if(_0x18c6f1[_0xa55c('0x3d')]['filter']){_0x3c0ec1[_0xa55c('0x45')]=_[_0xa55c('0x46')](_0x3c0ec1[_0xa55c('0x45')],{'$or':_['map'](_0x30f23b,function(_0x334f52){if(_0x334f52['type']!==_0xa55c('0x47')){var _0x3a8af4={};_0x3a8af4[_0x334f52[_0xa55c('0x34')]]={'$like':'%'+_0x18c6f1['query'][_0xa55c('0x48')]+'%'};return _0x3a8af4;}})});}_0x3c0ec1=_[_0xa55c('0x46')]({},_0x3c0ec1,_0x18c6f1['options']);var _0x3d19f5={'where':_0x3c0ec1[_0xa55c('0x45')]};return db['Trunk'][_0xa55c('0x29')](_0x3d19f5)[_0xa55c('0x1a')](function(_0x52f9a7){_0x7c4a47[_0xa55c('0x29')]=_0x52f9a7;if(_0x18c6f1[_0xa55c('0x3d')][_0xa55c('0x49')]){_0x3c0ec1[_0xa55c('0x4a')]=[{'all':!![]}];}return db['Trunk'][_0xa55c('0x4b')](_0x3c0ec1);})['then'](function(_0x2157d6){_0x7c4a47[_0xa55c('0x4c')]=_0x2157d6;return _0x7c4a47;})[_0xa55c('0x1a')](respondWithFilteredResult(_0x39267c,_0x3c0ec1))['catch'](handleError(_0x39267c,null));};exports[_0xa55c('0x4d')]=function(_0x250b00,_0x574fe9){var _0x5be06={'raw':![],'where':{'id':_0x250b00[_0xa55c('0x4e')]['id']}},_0x34de95={};_0x34de95[_0xa55c('0x39')]=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x34de95[_0xa55c('0x3d')]=_[_0xa55c('0x4f')](_0x250b00[_0xa55c('0x3d')]);_0x34de95['filters']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],_0x34de95[_0xa55c('0x3d')]);_0x5be06['attributes']=_[_0xa55c('0x3c')](_0x34de95[_0xa55c('0x39')],qs['fields'](_0x250b00[_0xa55c('0x3d')]['fields']));_0x5be06[_0xa55c('0x3e')]=_0x5be06[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x5be06[_0xa55c('0x3e')]:_0x34de95[_0xa55c('0x39')];if(_0x250b00['query'][_0xa55c('0x49')]){_0x5be06[_0xa55c('0x4a')]=[{'all':!![]}];}_0x5be06=_['merge']({},_0x5be06,_0x250b00[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x5be06)[_0xa55c('0x1a')](handleEntityNotFound(_0x574fe9,null))['then'](respondWithResult(_0x574fe9,null))['catch'](handleError(_0x574fe9,null));};exports[_0xa55c('0x53')]=function(_0x250dea,_0x3ca5b8){var _0x44ac57={'where':{'id':_0x250dea[_0xa55c('0x4e')]['id']}},_0x54cbde={};_0x54cbde['model']=_[_0xa55c('0x4f')](db[_0xa55c('0x36')][_0xa55c('0x37')]);_0x44ac57[_0xa55c('0x3e')]=_[_0xa55c('0x3c')](_0x54cbde['model'],qs[_0xa55c('0x3f')](_0x250dea['query'][_0xa55c('0x3f')]));_0x44ac57[_0xa55c('0x3e')]=_0x44ac57[_0xa55c('0x3e')][_0xa55c('0x50')]?_0x44ac57[_0xa55c('0x3e')]:_0x54cbde[_0xa55c('0x39')];if(_0x250dea[_0xa55c('0x3d')]['includeAll']){_0x44ac57[_0xa55c('0x4a')]=[{'all':!![]}];}_0x44ac57=_[_0xa55c('0x46')]({},_0x44ac57,_0x250dea[_0xa55c('0x51')]);return db[_0xa55c('0x36')][_0xa55c('0x52')](_0x44ac57)['then'](handleEntityNotFound(_0x3ca5b8,null))[_0xa55c('0x1a')](function(_0x3cd40d){if(_0x3cd40d){var _0x28bac4=_0x3cd40d[_0xa55c('0x30')]({'plain':!![]});_0x28bac4=qs[_0xa55c('0x54')](_0x28bac4,['id','createdAt',_0xa55c('0x55')]);_0x250dea[_0xa55c('0x56')]=_[_0xa55c('0x54')](_0x250dea[_0xa55c('0x56')],['id',_0xa55c('0x57'),'updatedAt']);return db[_0xa55c('0x36')]['create'](_[_0xa55c('0x46')](_0x28bac4,_0x250dea['body']),{'include':_0x250dea[_0xa55c('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x1a')](function(_0x1333da){var _0x21d6b4=_0x250dea[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x21d6b4)throw new Error(_0xa55c('0x59'));if(_0x21d6b4[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0x14b515=_0x1333da[_0xa55c('0x30')]({'plain':!![]});var _0x51c736=_0xa55c('0x5b');return db[_0xa55c('0x5c')]['find']({'where':{'name':_0x51c736,'userProfileId':_0x21d6b4[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x3e3b4b){if(_0x3e3b4b&&_0x3e3b4b[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')][_0xa55c('0x5f')]({'name':_0x14b515[_0xa55c('0x34')],'resourceId':_0x14b515['id'],'type':_0x3e3b4b[_0xa55c('0x34')],'sectionId':_0x3e3b4b['id']},{})['then'](function(){return _0x1333da;});}else{return _0x1333da;}})[_0xa55c('0x24')](function(_0x475131){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x475131);throw _0x475131;});}return _0x1333da;});}})[_0xa55c('0x1a')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x24')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x5f')]=function(_0x4249c1,_0x25d5a1,_0x4a08ca){var _0x347562;return db[_0xa55c('0x36')][_0xa55c('0x5f')](_0x4249c1[_0xa55c('0x56')],{'raw':!![]})[_0xa55c('0x1a')](function(_0x10e711){_0x347562=_0x10e711;return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x3178a6){var _0x3bbc4b=fs['readFileSync'](path[_0xa55c('0x61')](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0x129bb4=fs['readFileSync'](path['join'](config[_0xa55c('0x64')],_0xa55c('0x65')),_0xa55c('0x63'));var _0x42529f=ejs['render'](_0x3bbc4b,{'trunks':_0x3178a6||[]});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x42529f);if(_0x347562[_0xa55c('0x68')]){var _0x3a9910=ejs[_0xa55c('0x69')](_0x129bb4,{'trunks':_0x3178a6||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x3a9910);}})[_0xa55c('0x1a')](function(){return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x5f'),{'module':_0xa55c('0x6b')});})[_0xa55c('0x1a')](function(){var _0x4b2032=_0x4249c1[_0xa55c('0x58')][_0xa55c('0x30')]({'plain':!![]});if(!_0x4b2032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b2032[_0xa55c('0x5a')]===_0xa55c('0x58')){var _0xa340fb=_0x347562['get']({'plain':!![]});return db[_0xa55c('0x5c')][_0xa55c('0x52')]({'where':{'name':_0xa55c('0x5b'),'userProfileId':_0x4b2032[_0xa55c('0x5d')]},'raw':!![]})[_0xa55c('0x1a')](function(_0x506f74){if(_0x506f74&&_0x506f74[_0xa55c('0x5e')]===0x0){return db[_0xa55c('0x31')]['create']({'name':_0xa340fb['name'],'resourceId':_0xa340fb['id'],'type':_0x506f74[_0xa55c('0x34')],'sectionId':_0x506f74['id']},{})['then'](function(){return _0x347562;});}else{return _0x347562;}})[_0xa55c('0x24')](function(_0x5ca0bc){logger[_0xa55c('0x21')](_0xa55c('0x60'),_0x5ca0bc);throw _0x5ca0bc;});}return _0x347562;})[_0xa55c('0x1a')](respondWithResult(_0x25d5a1,0xc9))[_0xa55c('0x24')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x2e')]=function(_0xff7b1c,_0x16dfc6,_0x5d8551){var _0x463195;return db[_0xa55c('0x36')][_0xa55c('0x52')]({'where':{'id':_0xff7b1c[_0xa55c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x16dfc6,null))[_0xa55c('0x1a')](saveUpdates(_0xff7b1c[_0xa55c('0x56')],null))[_0xa55c('0x1a')](function(_0x2298ac){if(_0x2298ac){_0x463195=_0x2298ac;return db['Trunk']['findAll']({'raw':!![]});}})[_0xa55c('0x1a')](function(_0x428872){if(_0x428872){var _0x12e3a8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x62')),_0xa55c('0x63'));var _0xd33c9c=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x65')),'utf8');var _0x19497b=ejs['render'](_0x12e3a8,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x19497b);var _0x36ded7=ejs[_0xa55c('0x69')](_0xd33c9c,{'trunks':_0x428872||[]});fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x36ded7);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2e'),{'module':_0xa55c('0x6b')});}return null;})[_0xa55c('0x1a')](function(_0x576a1b){if(_0x576a1b){return _0x463195;}})['then'](respondWithResult(_0x16dfc6,null))[_0xa55c('0x24')](handleError(_0x16dfc6,null));};exports[_0xa55c('0x2f')]=function(_0xc2ad5c,_0x256db0,_0x1622cb){var _0x137728;return db['Trunk'][_0xa55c('0x52')]({'where':{'id':_0xc2ad5c[_0xa55c('0x4e')]['id']}})[_0xa55c('0x1a')](handleEntityNotFound(_0x256db0,null))[_0xa55c('0x1a')](removeEntity(_0x256db0,null))[_0xa55c('0x1a')](function(){return db[_0xa55c('0x36')][_0xa55c('0x4b')]({'raw':!![]});})[_0xa55c('0x1a')](function(_0x58b670){var _0x25d09d=fs[_0xa55c('0x6c')](path[_0xa55c('0x61')](config[_0xa55c('0x64')],_0xa55c('0x62')),'utf8');var _0x2685d8=fs[_0xa55c('0x6c')](path['join'](config['root'],_0xa55c('0x65')),_0xa55c('0x63'));var _0x5c2229=ejs['render'](_0x25d09d,{'trunks':_0x58b670});var _0x579726=ejs['render'](_0x2685d8,{'trunks':_0x58b670});fs[_0xa55c('0x66')](_0xa55c('0x67'),_0x5c2229);fs[_0xa55c('0x66')](_0xa55c('0x6d'),_0x579726);return respondWithRpcPromise(_0xa55c('0x6a'),_0xa55c('0x2f'),{'module':'chan_sip.so'});})[_0xa55c('0x24')](handleError(_0x256db0,null));};
\ No newline at end of file
index 524cfd8..4f95609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe607=['api','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x3de147,_0x177956){var _0x2b0851=function(_0x4d1f31){while(--_0x4d1f31){_0x3de147['push'](_0x3de147['shift']());}};_0x2b0851(++_0x177956);}(_0xe607,0x99));var _0x7e60=function(_0x20a74d,_0x223174){_0x20a74d=_0x20a74d-0x0;var _0x17aefb=_0xe607[_0x20a74d];return _0x17aefb;};'use strict';var _=require(_0x7e60('0x0'));var util=require(_0x7e60('0x1'));var logger=require(_0x7e60('0x2'))(_0x7e60('0x3'));var moment=require('moment');var BPromise=require(_0x7e60('0x4'));var rp=require(_0x7e60('0x5'));var fs=require('fs');var path=require(_0x7e60('0x6'));var rimraf=require(_0x7e60('0x7'));var config=require(_0x7e60('0x8'));var attributes=require(_0x7e60('0x9'));module[_0x7e60('0xa')]=function(_0x417965,_0x283b2d){return _0x417965['define'](_0x7e60('0xb'),attributes,{'tableName':_0x7e60('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3855=['request-promise','rimraf','../../config/environment','define','tools_trunks','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x3855,0x1d3));var _0x5385=function(_0x3b82a2,_0x231997){_0x3b82a2=_0x3b82a2-0x0;var _0x15c4ce=_0x3855[_0x3b82a2];return _0x15c4ce;};'use strict';var _=require(_0x5385('0x0'));var util=require(_0x5385('0x1'));var logger=require(_0x5385('0x2'))(_0x5385('0x3'));var moment=require(_0x5385('0x4'));var BPromise=require(_0x5385('0x5'));var rp=require(_0x5385('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5385('0x7'));var config=require(_0x5385('0x8'));var attributes=require('./trunk.attributes');module['exports']=function(_0x165940,_0x1a4503){return _0x165940[_0x5385('0x9')]('Trunk',attributes,{'tableName':_0x5385('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c3820cf..ba38afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a03=['client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetTrunk','options','raw','attributes','limit','include','map','model','stringify','ShowTrunk','Trunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x390878,_0xc01c24){var _0x2938af=function(_0x1fcb7a){while(--_0x1fcb7a){_0x390878['push'](_0x390878['shift']());}};_0x2938af(++_0xc01c24);}(_0x0a03,0x131));var _0x30a0=function(_0x408ca6,_0x5a036){_0x408ca6=_0x408ca6-0x0;var _0x27f3ce=_0x0a03[_0x408ca6];return _0x27f3ce;};'use strict';var _=require(_0x30a0('0x0'));var util=require(_0x30a0('0x1'));var moment=require(_0x30a0('0x2'));var BPromise=require(_0x30a0('0x3'));var rs=require(_0x30a0('0x4'));var fs=require('fs');var Redis=require(_0x30a0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x30a0('0x6'));var logger=require(_0x30a0('0x7'))('rpc');var config=require(_0x30a0('0x8'));var jayson=require(_0x30a0('0x9'));var client=jayson[_0x30a0('0xa')][_0x30a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fe40c,_0x3ab731,_0x4d1aea){return new BPromise(function(_0x318750,_0x4f17c2){return client[_0x30a0('0xc')](_0x3fe40c,_0x4d1aea)[_0x30a0('0xd')](function(_0x469da4){logger[_0x30a0('0xe')](_0x30a0('0xf'),_0x3ab731,_0x30a0('0x10'));logger[_0x30a0('0x11')](_0x30a0('0x12'),_0x3ab731,_0x30a0('0x10'),JSON['stringify'](_0x469da4));if(_0x469da4[_0x30a0('0x13')]){if(_0x469da4['error']['code']===0x1f4){logger[_0x30a0('0x13')](_0x30a0('0xf'),_0x3ab731,_0x469da4[_0x30a0('0x13')][_0x30a0('0x14')]);return _0x4f17c2(_0x469da4['error'][_0x30a0('0x14')]);}logger[_0x30a0('0x13')]('Trunk,\x20%s,\x20%s',_0x3ab731,_0x469da4[_0x30a0('0x13')][_0x30a0('0x14')]);return _0x318750(_0x469da4['error'][_0x30a0('0x14')]);}else{logger[_0x30a0('0xe')](_0x30a0('0xf'),_0x3ab731,_0x30a0('0x10'));_0x318750(_0x469da4[_0x30a0('0x15')][_0x30a0('0x14')]);}})[_0x30a0('0x16')](function(_0x15122b){logger[_0x30a0('0x13')](_0x30a0('0xf'),_0x3ab731,_0x15122b);_0x4f17c2(_0x15122b);});});}exports[_0x30a0('0x17')]=function(_0x3ffe1f){var _0x191298=this;return new Promise(function(_0x3452d3,_0x8c1e9e){return db['Trunk']['findAll']({'raw':_0x3ffe1f[_0x30a0('0x18')]?_0x3ffe1f[_0x30a0('0x18')][_0x30a0('0x19')]===undefined?!![]:![]:!![],'where':_0x3ffe1f['options']?_0x3ffe1f[_0x30a0('0x18')]['where']||null:null,'attributes':_0x3ffe1f[_0x30a0('0x18')]?_0x3ffe1f[_0x30a0('0x18')][_0x30a0('0x1a')]||null:null,'limit':_0x3ffe1f[_0x30a0('0x18')]?_0x3ffe1f['options'][_0x30a0('0x1b')]||null:null,'include':_0x3ffe1f['options']?_0x3ffe1f[_0x30a0('0x18')][_0x30a0('0x1c')]?_[_0x30a0('0x1d')](_0x3ffe1f[_0x30a0('0x18')]['include'],function(_0x545a58){return{'model':db[_0x545a58[_0x30a0('0x1e')]],'as':_0x545a58['as'],'attributes':_0x545a58['attributes'],'include':_0x545a58['include']?_[_0x30a0('0x1d')](_0x545a58[_0x30a0('0x1c')],function(_0x41181a){return{'model':db[_0x41181a[_0x30a0('0x1e')]],'as':_0x41181a['as'],'attributes':_0x41181a[_0x30a0('0x1a')],'include':_0x41181a[_0x30a0('0x1c')]?_[_0x30a0('0x1d')](_0x41181a['include'],function(_0x381cb1){return{'model':db[_0x381cb1['model']],'as':_0x381cb1['as'],'attributes':_0x381cb1[_0x30a0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x30a0('0xd')](function(_0x4b6675){logger[_0x30a0('0xe')](_0x30a0('0x17'),_0x3ffe1f);logger['debug'](_0x30a0('0x17'),_0x3ffe1f,JSON[_0x30a0('0x1f')](_0x4b6675));_0x3452d3(_0x4b6675);})[_0x30a0('0x16')](function(_0x407b29){logger[_0x30a0('0x13')](_0x30a0('0x17'),_0x407b29[_0x30a0('0x14')],_0x3ffe1f);_0x8c1e9e(_0x191298[_0x30a0('0x13')](0x1f4,_0x407b29[_0x30a0('0x14')]));});});};exports[_0x30a0('0x20')]=function(_0x5ac1a1){var _0x14f52c=this;return new Promise(function(_0x1dda6f,_0x45f80f){return db[_0x30a0('0x21')][_0x30a0('0x22')]({'raw':_0x5ac1a1[_0x30a0('0x18')]?_0x5ac1a1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ac1a1[_0x30a0('0x18')]?_0x5ac1a1[_0x30a0('0x18')]['where']||null:null,'attributes':_0x5ac1a1[_0x30a0('0x18')]?_0x5ac1a1[_0x30a0('0x18')]['attributes']||null:null,'include':_0x5ac1a1['options']?_0x5ac1a1[_0x30a0('0x18')][_0x30a0('0x1c')]?_[_0x30a0('0x1d')](_0x5ac1a1[_0x30a0('0x18')]['include'],function(_0x5a45eb){return{'model':db[_0x5a45eb[_0x30a0('0x1e')]],'as':_0x5a45eb['as'],'attributes':_0x5a45eb[_0x30a0('0x1a')],'include':_0x5a45eb['include']?_[_0x30a0('0x1d')](_0x5a45eb[_0x30a0('0x1c')],function(_0x1c685f){return{'model':db[_0x1c685f[_0x30a0('0x1e')]],'as':_0x1c685f['as'],'attributes':_0x1c685f[_0x30a0('0x1a')],'include':_0x1c685f[_0x30a0('0x1c')]?_[_0x30a0('0x1d')](_0x1c685f[_0x30a0('0x1c')],function(_0x5e251b){return{'model':db[_0x5e251b['model']],'as':_0x5e251b['as'],'attributes':_0x5e251b[_0x30a0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f3a6){logger['info'](_0x30a0('0x20'),_0x5ac1a1);logger[_0x30a0('0x11')]('ShowTrunk',_0x5ac1a1,JSON['stringify'](_0x29f3a6));_0x1dda6f(_0x29f3a6);})['catch'](function(_0x1b0e5b){logger['error'](_0x30a0('0x20'),_0x1b0e5b[_0x30a0('0x14')],_0x5ac1a1);_0x45f80f(_0x14f52c[_0x30a0('0x13')](0x1f4,_0x1b0e5b[_0x30a0('0x14')]));});});};
\ No newline at end of file
+var _0x5fbe=['model','attributes','debug','ShowTrunk','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','options','raw','where','limit','include','map'];(function(_0x13f752,_0x221be5){var _0xff8a32=function(_0x475f59){while(--_0x475f59){_0x13f752['push'](_0x13f752['shift']());}};_0xff8a32(++_0x221be5);}(_0x5fbe,0xbe));var _0xe5fb=function(_0x9bdf3b,_0x2f78f0){_0x9bdf3b=_0x9bdf3b-0x0;var _0x1fd757=_0x5fbe[_0x9bdf3b];return _0x1fd757;};'use strict';var _=require(_0xe5fb('0x0'));var util=require(_0xe5fb('0x1'));var moment=require(_0xe5fb('0x2'));var BPromise=require(_0xe5fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe5fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5fb('0x5'))(_0xe5fb('0x6'));var config=require(_0xe5fb('0x7'));var jayson=require(_0xe5fb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3e84,_0x4d2ad0,_0x3500e8){return new BPromise(function(_0x3773f9,_0x2d24ed){return client['request'](_0x4e3e84,_0x3500e8)[_0xe5fb('0x9')](function(_0x5f5a3e){logger[_0xe5fb('0xa')]('Trunk,\x20%s,\x20%s',_0x4d2ad0,_0xe5fb('0xb'));logger['debug'](_0xe5fb('0xc'),_0x4d2ad0,_0xe5fb('0xb'),JSON[_0xe5fb('0xd')](_0x5f5a3e));if(_0x5f5a3e['error']){if(_0x5f5a3e[_0xe5fb('0xe')]['code']===0x1f4){logger[_0xe5fb('0xe')](_0xe5fb('0xf'),_0x4d2ad0,_0x5f5a3e['error'][_0xe5fb('0x10')]);return _0x2d24ed(_0x5f5a3e[_0xe5fb('0xe')][_0xe5fb('0x10')]);}logger['error'](_0xe5fb('0xf'),_0x4d2ad0,_0x5f5a3e[_0xe5fb('0xe')][_0xe5fb('0x10')]);return _0x3773f9(_0x5f5a3e[_0xe5fb('0xe')][_0xe5fb('0x10')]);}else{logger['info'](_0xe5fb('0xf'),_0x4d2ad0,_0xe5fb('0xb'));_0x3773f9(_0x5f5a3e[_0xe5fb('0x11')][_0xe5fb('0x10')]);}})[_0xe5fb('0x12')](function(_0x4cf872){logger[_0xe5fb('0xe')](_0xe5fb('0xf'),_0x4d2ad0,_0x4cf872);_0x2d24ed(_0x4cf872);});});}exports[_0xe5fb('0x13')]=function(_0x22d596){var _0x2748dc=this;return new Promise(function(_0x4edfdc,_0x384872){return db[_0xe5fb('0x14')]['findAll']({'raw':_0x22d596[_0xe5fb('0x15')]?_0x22d596[_0xe5fb('0x15')][_0xe5fb('0x16')]===undefined?!![]:![]:!![],'where':_0x22d596['options']?_0x22d596['options'][_0xe5fb('0x17')]||null:null,'attributes':_0x22d596[_0xe5fb('0x15')]?_0x22d596[_0xe5fb('0x15')]['attributes']||null:null,'limit':_0x22d596[_0xe5fb('0x15')]?_0x22d596[_0xe5fb('0x15')][_0xe5fb('0x18')]||null:null,'include':_0x22d596[_0xe5fb('0x15')]?_0x22d596['options'][_0xe5fb('0x19')]?_[_0xe5fb('0x1a')](_0x22d596[_0xe5fb('0x15')][_0xe5fb('0x19')],function(_0x50e87e){return{'model':db[_0x50e87e[_0xe5fb('0x1b')]],'as':_0x50e87e['as'],'attributes':_0x50e87e[_0xe5fb('0x1c')],'include':_0x50e87e[_0xe5fb('0x19')]?_[_0xe5fb('0x1a')](_0x50e87e[_0xe5fb('0x19')],function(_0x112025){return{'model':db[_0x112025['model']],'as':_0x112025['as'],'attributes':_0x112025[_0xe5fb('0x1c')],'include':_0x112025[_0xe5fb('0x19')]?_['map'](_0x112025[_0xe5fb('0x19')],function(_0x514bf1){return{'model':db[_0x514bf1[_0xe5fb('0x1b')]],'as':_0x514bf1['as'],'attributes':_0x514bf1[_0xe5fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe5fb('0x9')](function(_0x4d5b26){logger[_0xe5fb('0xa')](_0xe5fb('0x13'),_0x22d596);logger[_0xe5fb('0x1d')](_0xe5fb('0x13'),_0x22d596,JSON['stringify'](_0x4d5b26));_0x4edfdc(_0x4d5b26);})['catch'](function(_0x56ea41){logger[_0xe5fb('0xe')]('GetTrunk',_0x56ea41[_0xe5fb('0x10')],_0x22d596);_0x384872(_0x2748dc[_0xe5fb('0xe')](0x1f4,_0x56ea41[_0xe5fb('0x10')]));});});};exports[_0xe5fb('0x1e')]=function(_0x50ca3a){var _0x2e0e4d=this;return new Promise(function(_0x1b1f85,_0x58a099){return db[_0xe5fb('0x14')]['find']({'raw':_0x50ca3a[_0xe5fb('0x15')]?_0x50ca3a[_0xe5fb('0x15')][_0xe5fb('0x16')]===undefined?!![]:![]:!![],'where':_0x50ca3a[_0xe5fb('0x15')]?_0x50ca3a[_0xe5fb('0x15')]['where']||null:null,'attributes':_0x50ca3a[_0xe5fb('0x15')]?_0x50ca3a[_0xe5fb('0x15')]['attributes']||null:null,'include':_0x50ca3a[_0xe5fb('0x15')]?_0x50ca3a[_0xe5fb('0x15')][_0xe5fb('0x19')]?_['map'](_0x50ca3a[_0xe5fb('0x15')][_0xe5fb('0x19')],function(_0x524a48){return{'model':db[_0x524a48['model']],'as':_0x524a48['as'],'attributes':_0x524a48[_0xe5fb('0x1c')],'include':_0x524a48[_0xe5fb('0x19')]?_[_0xe5fb('0x1a')](_0x524a48[_0xe5fb('0x19')],function(_0x2c1404){return{'model':db[_0x2c1404[_0xe5fb('0x1b')]],'as':_0x2c1404['as'],'attributes':_0x2c1404[_0xe5fb('0x1c')],'include':_0x2c1404[_0xe5fb('0x19')]?_[_0xe5fb('0x1a')](_0x2c1404[_0xe5fb('0x19')],function(_0x2f8a4e){return{'model':db[_0x2f8a4e[_0xe5fb('0x1b')]],'as':_0x2f8a4e['as'],'attributes':_0x2f8a4e[_0xe5fb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe5fb('0x9')](function(_0x34f092){logger[_0xe5fb('0xa')](_0xe5fb('0x1e'),_0x50ca3a);logger[_0xe5fb('0x1d')]('ShowTrunk',_0x50ca3a,JSON[_0xe5fb('0xd')](_0x34f092));_0x1b1f85(_0x34f092);})['catch'](function(_0x3640fc){logger['error'](_0xe5fb('0x1e'),_0x3640fc['message'],_0x50ca3a);_0x58a099(_0x2e0e4d[_0xe5fb('0xe')](0x1f4,_0x3640fc['message']));});});};
\ No newline at end of file
index c7bd306..5657780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe794=['removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','fs-extra','get','index','/describe','isAuthenticated','describe','/whoami','show','/:id/avatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','bulkCreate','root','server/files/images/','single','/:id/login','login','/:id/logout','logout','/:id/pause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeTeams','destroy','removeFaxInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions'];(function(_0x78dc7e,_0x286e20){var _0x101081=function(_0x127f89){while(--_0x127f89){_0x78dc7e['push'](_0x78dc7e['shift']());}};_0x101081(++_0x286e20);}(_0xe794,0xe0));var _0x4e79=function(_0x36c144,_0x5391f5){_0x36c144=_0x36c144-0x0;var _0x3dae5d=_0xe794[_0x36c144];return _0x3dae5d;};'use strict';var multer=require(_0x4e79('0x0'));var util=require(_0x4e79('0x1'));var path=require(_0x4e79('0x2'));var timeout=require(_0x4e79('0x3'));var express=require(_0x4e79('0x4'));var router=express['Router']();var fs_extra=require(_0x4e79('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./user.controller');router[_0x4e79('0x6')]('/',auth['isAuthenticated'](),controller[_0x4e79('0x7')]);router['get'](_0x4e79('0x8'),auth[_0x4e79('0x9')](),controller[_0x4e79('0xa')]);router['get'](_0x4e79('0xb'),auth['isAuthenticated'](),controller['whoami']);router[_0x4e79('0x6')]('/presence',auth['isAuthenticated'](),controller['getPresence']);router['get']('/:id',auth[_0x4e79('0x9')](),controller[_0x4e79('0xc')]);router[_0x4e79('0x6')](_0x4e79('0xd'),controller['getAvatar']);router['get']('/:id/open_tabs',auth['isAuthenticated'](),controller[_0x4e79('0xe')]);router[_0x4e79('0x6')](_0x4e79('0xf'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x10')]);router['get'](_0x4e79('0x11'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x12')]);router['get']('/:id/queues_rt',auth[_0x4e79('0x9')](),controller[_0x4e79('0x13')]);router[_0x4e79('0x6')]('/:id/groups',auth[_0x4e79('0x9')](),controller[_0x4e79('0x14')]);router[_0x4e79('0x6')]('/:id/recordings',auth[_0x4e79('0x9')](),controller[_0x4e79('0x15')]);router['get'](_0x4e79('0x16'),auth['isAuthenticated'](),controller[_0x4e79('0x17')]);router[_0x4e79('0x6')](_0x4e79('0x18'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x19')]);router['get'](_0x4e79('0x1a'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x1b')]);router['get'](_0x4e79('0x1c'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x1d')]);router[_0x4e79('0x6')](_0x4e79('0x1e'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x4e79('0x6')]('/:id/fax/interactions',auth[_0x4e79('0x9')](),controller[_0x4e79('0x1f')]);router['get']('/:id/whatsapp/interactions',auth[_0x4e79('0x9')](),controller[_0x4e79('0x20')]);router['get'](_0x4e79('0x21'),auth['isAuthenticated'](),controller[_0x4e79('0x22')]);router['get']('/:id/lists',auth[_0x4e79('0x9')](),controller[_0x4e79('0x23')]);router[_0x4e79('0x6')](_0x4e79('0x24'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x25')]);router[_0x4e79('0x6')]('/:id/prefixes',auth[_0x4e79('0x9')](),controller[_0x4e79('0x26')]);router[_0x4e79('0x6')]('/:id/fax_accounts',auth[_0x4e79('0x9')](),controller[_0x4e79('0x27')]);router[_0x4e79('0x6')](_0x4e79('0x28'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x29')]);router['get'](_0x4e79('0x2a'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x2b')]);router[_0x4e79('0x6')](_0x4e79('0x2c'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x2d')]);router[_0x4e79('0x6')](_0x4e79('0x2e'),auth[_0x4e79('0x9')](),controller['getChatWebsites']);router[_0x4e79('0x6')](_0x4e79('0x2f'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x30')]);router[_0x4e79('0x6')](_0x4e79('0x31'),auth['isAuthenticated'](),controller[_0x4e79('0x32')]);router[_0x4e79('0x6')](_0x4e79('0x33'),auth['isAuthenticated'](),controller[_0x4e79('0x34')]);router[_0x4e79('0x6')](_0x4e79('0x35'),auth[_0x4e79('0x9')](),controller['getApiKey']);router[_0x4e79('0x36')]('/:id/contacts',auth[_0x4e79('0x9')](),controller[_0x4e79('0x37')]);router[_0x4e79('0x36')]('/',auth['isAuthenticated'](),controller[_0x4e79('0x38')]);router[_0x4e79('0x36')]('/create_many',auth[_0x4e79('0x9')](),controller[_0x4e79('0x39')]);router['post'](_0x4e79('0x11'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x25d468,_0x11c2c9,_0x4a7cec){_0x4a7cec(null,path['join'](config[_0x4e79('0x3a')],_0x4e79('0x3b')));},'filename':function(_0x51e12f,_0x2eb247,_0x15459d){_0x15459d(null,util['format']('%s-%s',Date['now'](),_0x2eb247['originalname']));}})});router[_0x4e79('0x36')]('/:id/avatar',upload[_0x4e79('0x3c')]('file'),controller['addAvatar']);router[_0x4e79('0x36')](_0x4e79('0x3d'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x3e')]);router['post'](_0x4e79('0x3f'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x40')]);router[_0x4e79('0x36')](_0x4e79('0x41'),auth[_0x4e79('0x9')](),controller['pause']);router[_0x4e79('0x36')]('/:id/unpause',auth[_0x4e79('0x9')](),controller[_0x4e79('0x42')]);router[_0x4e79('0x36')](_0x4e79('0x21'),auth['isAuthenticated'](),controller[_0x4e79('0x43')]);router[_0x4e79('0x36')](_0x4e79('0x44'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x45')]);router[_0x4e79('0x36')](_0x4e79('0x46'),auth['isAuthenticated'](),controller[_0x4e79('0x47')]);router[_0x4e79('0x36')](_0x4e79('0x48'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x49')]);router[_0x4e79('0x36')](_0x4e79('0x4a'),auth['isAuthenticated'](),controller[_0x4e79('0x4b')]);router[_0x4e79('0x36')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x4e79('0x36')]('/:id/whatsapp_interactions',auth[_0x4e79('0x9')](),controller[_0x4e79('0x4c')]);router[_0x4e79('0x36')](_0x4e79('0x4d'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x4e')]);router[_0x4e79('0x36')]('/:id/mail_accounts',auth[_0x4e79('0x9')](),controller[_0x4e79('0x4f')]);router['post'](_0x4e79('0x2a'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x50')]);router[_0x4e79('0x36')](_0x4e79('0x2c'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x51')]);router[_0x4e79('0x36')](_0x4e79('0x2e'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x52')]);router['post'](_0x4e79('0x2f'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x4e79('0x36')](_0x4e79('0x31'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x53')]);router[_0x4e79('0x36')](_0x4e79('0x35'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x54')]);router[_0x4e79('0x55')](_0x4e79('0x56'),auth['isAuthenticated'](),controller[_0x4e79('0x57')]);router[_0x4e79('0x55')](_0x4e79('0x58'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x59')]);router[_0x4e79('0x5a')](_0x4e79('0x11'),auth[_0x4e79('0x9')](),controller['removeQueues']);router[_0x4e79('0x5a')](_0x4e79('0x21'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x5b')]);router[_0x4e79('0x5a')](_0x4e79('0x56'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x5c')]);router[_0x4e79('0x5a')](_0x4e79('0x44'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x4e79('0x5a')](_0x4e79('0x46'),auth[_0x4e79('0x9')](),controller['removeMailInteractions']);router[_0x4e79('0x5a')](_0x4e79('0x48'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x5d')]);router['delete'](_0x4e79('0x4a'),auth[_0x4e79('0x9')](),controller['removeSmsInteractions']);router[_0x4e79('0x5a')](_0x4e79('0x5e'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x5f')]);router[_0x4e79('0x5a')](_0x4e79('0x60'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x61')]);router[_0x4e79('0x5a')](_0x4e79('0x4d'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x62')]);router['delete'](_0x4e79('0x28'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x63')]);router[_0x4e79('0x5a')](_0x4e79('0x2a'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x64')]);router[_0x4e79('0x5a')](_0x4e79('0x2c'),auth['isAuthenticated'](),controller[_0x4e79('0x65')]);router[_0x4e79('0x5a')](_0x4e79('0x2e'),auth['isAuthenticated'](),controller[_0x4e79('0x66')]);router['delete'](_0x4e79('0x2f'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x67')]);router[_0x4e79('0x5a')]('/:id/square_projects',auth[_0x4e79('0x9')](),controller[_0x4e79('0x68')]);router[_0x4e79('0x5a')](_0x4e79('0x35'),auth[_0x4e79('0x9')](),controller[_0x4e79('0x69')]);module[_0x4e79('0x6a')]=router;
\ No newline at end of file
+var _0x0562=['/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','removeChatInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','file','addAvatar','/:id/login','login','/:id/logout','/:id/unpause','unpause','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts'];(function(_0x7ed9e9,_0x35fb5d){var _0x383437=function(_0x496ea0){while(--_0x496ea0){_0x7ed9e9['push'](_0x7ed9e9['shift']());}};_0x383437(++_0x35fb5d);}(_0x0562,0x1de));var _0x2056=function(_0x2b5571,_0x1542da){_0x2b5571=_0x2b5571-0x0;var _0x220dc6=_0x0562[_0x2b5571];return _0x220dc6;};'use strict';var multer=require('multer');var util=require(_0x2056('0x0'));var path=require('path');var timeout=require(_0x2056('0x1'));var express=require('express');var router=express[_0x2056('0x2')]();var fs_extra=require(_0x2056('0x3'));var auth=require(_0x2056('0x4'));var interaction=require(_0x2056('0x5'));var config=require(_0x2056('0x6'));var controller=require(_0x2056('0x7'));router[_0x2056('0x8')]('/',auth[_0x2056('0x9')](),controller[_0x2056('0xa')]);router[_0x2056('0x8')](_0x2056('0xb'),auth[_0x2056('0x9')](),controller[_0x2056('0xc')]);router[_0x2056('0x8')](_0x2056('0xd'),auth[_0x2056('0x9')](),controller[_0x2056('0xe')]);router[_0x2056('0x8')](_0x2056('0xf'),auth[_0x2056('0x9')](),controller[_0x2056('0x10')]);router['get'](_0x2056('0x11'),auth[_0x2056('0x9')](),controller[_0x2056('0x12')]);router[_0x2056('0x8')](_0x2056('0x13'),controller['getAvatar']);router[_0x2056('0x8')](_0x2056('0x14'),auth[_0x2056('0x9')](),controller[_0x2056('0x15')]);router['get'](_0x2056('0x16'),auth[_0x2056('0x9')](),controller[_0x2056('0x17')]);router[_0x2056('0x8')](_0x2056('0x18'),auth['isAuthenticated'](),controller[_0x2056('0x19')]);router[_0x2056('0x8')](_0x2056('0x1a'),auth[_0x2056('0x9')](),controller[_0x2056('0x1b')]);router[_0x2056('0x8')]('/:id/groups',auth['isAuthenticated'](),controller[_0x2056('0x1c')]);router['get']('/:id/recordings',auth[_0x2056('0x9')](),controller[_0x2056('0x1d')]);router['get'](_0x2056('0x1e'),auth[_0x2056('0x9')](),controller['getScreenRecordings']);router[_0x2056('0x8')](_0x2056('0x1f'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x2056('0x8')](_0x2056('0x20'),auth[_0x2056('0x9')](),controller['getOpenchannelInteractions']);router[_0x2056('0x8')](_0x2056('0x21'),auth[_0x2056('0x9')](),controller['getMailInteractions']);router['get'](_0x2056('0x22'),auth[_0x2056('0x9')](),controller[_0x2056('0x23')]);router['get'](_0x2056('0x24'),auth[_0x2056('0x9')](),controller[_0x2056('0x25')]);router['get']('/:id/whatsapp/interactions',auth[_0x2056('0x9')](),controller[_0x2056('0x26')]);router['get'](_0x2056('0x27'),auth[_0x2056('0x9')](),controller[_0x2056('0x28')]);router[_0x2056('0x8')](_0x2056('0x29'),auth[_0x2056('0x9')](),controller[_0x2056('0x2a')]);router[_0x2056('0x8')](_0x2056('0x2b'),auth[_0x2056('0x9')](),controller[_0x2056('0x2c')]);router[_0x2056('0x8')](_0x2056('0x2d'),auth[_0x2056('0x9')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth[_0x2056('0x9')](),controller[_0x2056('0x2e')]);router[_0x2056('0x8')](_0x2056('0x2f'),auth[_0x2056('0x9')](),controller['getMailAccounts']);router['get'](_0x2056('0x30'),auth[_0x2056('0x9')](),controller[_0x2056('0x31')]);router[_0x2056('0x8')]('/:id/sms_accounts',auth[_0x2056('0x9')](),controller[_0x2056('0x32')]);router[_0x2056('0x8')](_0x2056('0x33'),auth[_0x2056('0x9')](),controller[_0x2056('0x34')]);router[_0x2056('0x8')](_0x2056('0x35'),auth[_0x2056('0x9')](),controller[_0x2056('0x36')]);router[_0x2056('0x8')](_0x2056('0x37'),auth[_0x2056('0x9')](),controller['getSquareProjects']);router[_0x2056('0x8')](_0x2056('0x38'),auth[_0x2056('0x9')](),controller[_0x2056('0x39')]);router['get'](_0x2056('0x3a'),auth[_0x2056('0x9')](),controller[_0x2056('0x3b')]);router[_0x2056('0x3c')](_0x2056('0x16'),auth[_0x2056('0x9')](),controller['addContacts']);router[_0x2056('0x3c')]('/',auth['isAuthenticated'](),controller[_0x2056('0x3d')]);router[_0x2056('0x3c')](_0x2056('0x3e'),auth[_0x2056('0x9')](),controller['bulkCreate']);router[_0x2056('0x3c')]('/:id/queues',auth['isAuthenticated'](),controller[_0x2056('0x3f')]);var upload=multer({'storage':multer[_0x2056('0x40')]({'destination':function(_0x1a5935,_0x3e7f30,_0x506e95){_0x506e95(null,path[_0x2056('0x41')](config[_0x2056('0x42')],_0x2056('0x43')));},'filename':function(_0x95e798,_0x281e55,_0x37f905){_0x37f905(null,util['format'](_0x2056('0x44'),Date[_0x2056('0x45')](),_0x281e55[_0x2056('0x46')]));}})});router[_0x2056('0x3c')](_0x2056('0x13'),upload['single'](_0x2056('0x47')),controller[_0x2056('0x48')]);router[_0x2056('0x3c')](_0x2056('0x49'),auth[_0x2056('0x9')](),controller[_0x2056('0x4a')]);router[_0x2056('0x3c')](_0x2056('0x4b'),auth[_0x2056('0x9')](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller['pause']);router[_0x2056('0x3c')](_0x2056('0x4c'),auth[_0x2056('0x9')](),controller[_0x2056('0x4d')]);router['post'](_0x2056('0x27'),auth[_0x2056('0x9')](),controller['addTeams']);router[_0x2056('0x3c')]('/:id/chat_interactions',auth[_0x2056('0x9')](),controller['addChatInteractions']);router[_0x2056('0x3c')](_0x2056('0x4e'),auth[_0x2056('0x9')](),controller[_0x2056('0x4f')]);router[_0x2056('0x3c')](_0x2056('0x50'),auth[_0x2056('0x9')](),controller[_0x2056('0x51')]);router[_0x2056('0x3c')]('/:id/sms_interactions',auth[_0x2056('0x9')](),controller[_0x2056('0x52')]);router[_0x2056('0x3c')](_0x2056('0x53'),auth[_0x2056('0x9')](),controller[_0x2056('0x54')]);router[_0x2056('0x3c')]('/:id/whatsapp_interactions',auth[_0x2056('0x9')](),controller[_0x2056('0x55')]);router[_0x2056('0x3c')]('/:id/fax_accounts',auth[_0x2056('0x9')](),controller[_0x2056('0x56')]);router[_0x2056('0x3c')]('/:id/mail_accounts',auth[_0x2056('0x9')](),controller['addMailAccounts']);router[_0x2056('0x3c')](_0x2056('0x30'),auth[_0x2056('0x9')](),controller['addOpenchannelAccounts']);router[_0x2056('0x3c')](_0x2056('0x57'),auth[_0x2056('0x9')](),controller[_0x2056('0x58')]);router[_0x2056('0x3c')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x2056('0x59')]);router['post'](_0x2056('0x35'),auth[_0x2056('0x9')](),controller[_0x2056('0x5a')]);router['post'](_0x2056('0x37'),auth[_0x2056('0x9')](),controller['addSquareProjects']);router[_0x2056('0x3c')](_0x2056('0x3a'),auth[_0x2056('0x9')](),controller[_0x2056('0x5b')]);router[_0x2056('0x5c')](_0x2056('0x11'),auth[_0x2056('0x9')](),controller[_0x2056('0x5d')]);router[_0x2056('0x5c')](_0x2056('0x5e'),auth[_0x2056('0x9')](),controller[_0x2056('0x5f')]);router[_0x2056('0x60')](_0x2056('0x18'),auth['isAuthenticated'](),controller[_0x2056('0x61')]);router['delete'](_0x2056('0x27'),auth[_0x2056('0x9')](),controller[_0x2056('0x62')]);router[_0x2056('0x60')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2056('0x60')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x2056('0x63')]);router[_0x2056('0x60')](_0x2056('0x4e'),auth[_0x2056('0x9')](),controller['removeMailInteractions']);router[_0x2056('0x60')]('/:id/fax_interactions',auth[_0x2056('0x9')](),controller[_0x2056('0x64')]);router['delete'](_0x2056('0x65'),auth[_0x2056('0x9')](),controller[_0x2056('0x66')]);router[_0x2056('0x60')](_0x2056('0x53'),auth[_0x2056('0x9')](),controller[_0x2056('0x67')]);router[_0x2056('0x60')]('/:id/whatsapp_interactions',auth[_0x2056('0x9')](),controller[_0x2056('0x68')]);router['delete'](_0x2056('0x69'),auth[_0x2056('0x9')](),controller['removeFaxAccounts']);router['delete'](_0x2056('0x2f'),auth[_0x2056('0x9')](),controller[_0x2056('0x6a')]);router[_0x2056('0x60')]('/:id/openchannel_accounts',auth[_0x2056('0x9')](),controller[_0x2056('0x6b')]);router['delete'](_0x2056('0x57'),auth[_0x2056('0x9')](),controller[_0x2056('0x6c')]);router[_0x2056('0x60')](_0x2056('0x33'),auth['isAuthenticated'](),controller[_0x2056('0x6d')]);router[_0x2056('0x60')](_0x2056('0x35'),auth[_0x2056('0x9')](),controller[_0x2056('0x6e')]);router[_0x2056('0x60')](_0x2056('0x37'),auth[_0x2056('0x9')](),controller[_0x2056('0x6f')]);router['delete'](_0x2056('0x3a'),auth[_0x2056('0x9')](),controller['removeApiKey']);module[_0x2056('0x70')]=router;
\ No newline at end of file
index 200800a..47a16fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['telephone','local','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','passive','actpass','update,nonat','TEXT','get','wss','encryption','force_avp','icesupport','dtlsverify','dtlssetup','rtcp_mux','dtlsenable','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','UNSIGNED','sequelize','moment','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xed1c,0xe4));var _0xced1=function(_0x6d3600,_0xd2b6a6){_0x6d3600=_0x6d3600-0x0;var _0x5a0da3=_0xed1c[_0x6d3600];return _0x5a0da3;};'use strict';var Sequelize=require(_0xced1('0x0'));var moment=require(_0xced1('0x1'));var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xced1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x329a0a){this[_0xced1('0x3')]('name',_0x329a0a);this[_0xced1('0x3')](_0xced1('0x4'),_0x329a0a);},'comment':_0xced1('0x5')},'fullname':{'type':Sequelize[_0xced1('0x6')],'allowNull':![],'set':function(_0x59399e){this[_0xced1('0x3')](_0xced1('0x7'),_0x59399e);this[_0xced1('0x3')](_0xced1('0x8'),util[_0xced1('0x9')](_0xced1('0xa'),_0x59399e,this[_0xced1('0xb')](_0xced1('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xced1('0x6')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3464f3){if(_0x3464f3){this[_0xced1('0x3')](_0xced1('0xd'),_0x3464f3[_0xced1('0xe')]());}}},'role':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x10'),_0xced1('0x11'),'agent',_0xced1('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xced1('0x6')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xced1('0x6')],'defaultValue':_0xced1('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xced1('0xc'),'set':function(_0x31a32c){this['setDataValue'](_0xced1('0xc'),_0x31a32c);this[_0xced1('0x3')](_0xced1('0x14'),_0x31a32c);this[_0xced1('0x3')]('callerid',util['format'](_0xced1('0xa'),this[_0xced1('0xb')](_0xced1('0x7')),_0x31a32c));}},'salt':{'type':Sequelize[_0xced1('0x6')]},'phone':{'type':Sequelize[_0xced1('0x6')]},'mobile':{'type':Sequelize[_0xced1('0x6')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xced1('0x6')]},'city':{'type':Sequelize[_0xced1('0x6')]},'country':{'type':Sequelize[_0xced1('0x6')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xced1('0x15')]},'voicePause':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xced1('0x6')],'defaultValue':_0xced1('0x17')},'lastPauseAt':{'type':Sequelize[_0xced1('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xced1('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xced1('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'host':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![],'defaultValue':_0xced1('0x19')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xced1('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xced1('0xf')]('friend',_0xced1('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xced1('0x1a')},'context':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![],'defaultValue':_0xced1('0x1b')},'callingpres':{'type':Sequelize[_0xced1('0xf')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0xced1('0x1c'),_0xced1('0x1d'),_0xced1('0x1e'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'permit':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'secret':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![],'defaultValue':_0xced1('0x1f'),'set':function(_0x46b672){this[_0xced1('0x3')](_0xced1('0x20'),_0x46b672?_0x46b672[_0xced1('0x21')](','):null);},'get':function(){return this[_0xced1('0xb')]('transport')?this['getDataValue'](_0xced1('0x20'))[_0xced1('0x22')](','):null;},'comment':_0xced1('0x23')},'dtmfmode':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x24'),_0xced1('0x25'),'shortinfo','inband','auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no',_0xced1('0x27'),_0xced1('0x28'),_0xced1('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'nat':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![],'defaultValue':_0xced1('0x2a'),'set':function(_0x1db647){this[_0xced1('0x3')]('nat',_0x1db647?_0x1db647[_0xced1('0x21')](','):null);},'get':function(){return this[_0xced1('0xb')](_0xced1('0x2b'))?this[_0xced1('0xb')](_0xced1('0x2b'))[_0xced1('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xced1('0x6')]},'namedcallgroup':{'type':Sequelize[_0xced1('0x6')]},'pickupgroup':{'type':Sequelize[_0xced1('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xced1('0x6')]},'language':{'type':Sequelize[_0xced1('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xced1('0x6')]},'disallow':{'type':Sequelize[_0xced1('0x6')],'allowNull':![],'defaultValue':_0xced1('0x2c')},'allow':{'type':Sequelize[_0xced1('0x6')],'allowNull':![],'defaultValue':_0xced1('0x2d'),'set':function(_0x1e119c){this['setDataValue']('allow',_0x1e119c?_0x1e119c[_0xced1('0x21')](';'):_0xced1('0x2d'));},'get':function(){return this[_0xced1('0xb')]('allow')?this[_0xced1('0xb')](_0xced1('0x2e'))[_0xced1('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x20ab72){this['setDataValue'](_0xced1('0x2f'),_0x20ab72?_0x20ab72[_0xced1('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xced1('0x2f'))?this[_0xced1('0xb')](_0xced1('0x2f'))['split'](','):null;},'comment':_0xced1('0x30')},'trustrpid':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xced1('0x26'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![],'defaultValue':_0xced1('0x31')},'amaflags':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0xced1('0x26')},'busylevel':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xced1('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'template':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no',_0xced1('0x32')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xced1('0xf')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x33'),_0xced1('0x34'),_0xced1('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x36'),'uas'),'allowNull':!![],'defaultValue':_0xced1('0x37')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xced1('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xced1('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xced1('0xf')]('yes','no',_0xced1('0x38'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xced1('0xf')]('active',_0xced1('0x39'),_0xced1('0x3a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xced1('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no',_0xced1('0x27'),'update',_0xced1('0x3b')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xced1('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0xced1('0x15')]},'passwordResetAt':{'type':Sequelize[_0xced1('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xced1('0x3c')]},'showWebBar':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0,'set':function(_0x457e5b){this['setDataValue']('showWebBar',_0x457e5b);var _0x4cc559=this[_0xced1('0x3d')]({'plain':!![]});switch(_0x457e5b){case 0x0:case 0x1:var _0x52e873=_0x4cc559[_0xced1('0x20')]?_['isArray'](_0x4cc559['transport'])?_0x4cc559[_0xced1('0x20')][_0xced1('0x21')]():_0x4cc559[_0xced1('0x20')]:_0xced1('0x1f');if(_0x52e873===_0xced1('0x3e')){_0x52e873=_0xced1('0x1f');}this[_0xced1('0x3')](_0xced1('0x20'),_0x52e873);this[_0xced1('0x3')](_0xced1('0x3f'),'no');this[_0xced1('0x3')]('avpf',null);this[_0xced1('0x3')](_0xced1('0x40'),null);this['setDataValue'](_0xced1('0x41'),null);this[_0xced1('0x3')]('dtlsenable',null);this[_0xced1('0x3')](_0xced1('0x42'),null);this[_0xced1('0x3')](_0xced1('0x43'),null);this[_0xced1('0x3')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0xced1('0x3')](_0xced1('0x44'),'no');break;case 0x2:this['setDataValue'](_0xced1('0x20'),_0xced1('0x3e'));this[_0xced1('0x3')]('encryption',_0xced1('0x26'));this[_0xced1('0x3')]('avpf',_0xced1('0x26'));this['setDataValue'](_0xced1('0x40'),_0xced1('0x26'));this[_0xced1('0x3')](_0xced1('0x41'),_0xced1('0x26'));this[_0xced1('0x3')](_0xced1('0x45'),'yes');this[_0xced1('0x3')](_0xced1('0x42'),'no');this[_0xced1('0x3')]('dtlssetup','actpass');this[_0xced1('0x3')](_0xced1('0x46'),_0x4cc559['dtlscertfile']||_0xced1('0x47'));this[_0xced1('0x3')](_0xced1('0x48'),_0x4cc559['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0xced1('0x3')](_0xced1('0x44'),_0xced1('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xced1('0x3c')],'set':function(_0x95c83b){this[_0xced1('0x3')]('permissions',_0x95c83b?_0x95c83b[_0xced1('0x21')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this['getDataValue'](_0xced1('0x49'))[_0xced1('0x22')](','),function(_0x586699){return parseInt(_0x586699,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xced1('0x6')]},'phoneBarBusyNumber':{'type':Sequelize[_0xced1('0x6')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xced1('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xced1('0xf')](_0xced1('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xced1('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xced1('0x6')]},'phoneBarEnableJaws':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xced1('0x4a')],'get':function(){return this[_0xced1('0xb')](_0xced1('0x4b'))?this[_0xced1('0xb')](_0xced1('0x4b')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0xced1('0x6')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xced1('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x39ffe8){if(typeof _0x39ffe8==='string'){var _0x11a86f=_0x39ffe8==='1'?!![]:_0x39ffe8==='0'?![]:_0x39ffe8===_0xced1('0x4c')?!![]:_0x39ffe8===_0xced1('0x4d')?![]:![];this[_0xced1('0x3')](_0xced1('0x4e'),_0x11a86f);}else{this[_0xced1('0x3')]('screenrecording',_0x39ffe8);}}},'blocked':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![],'set':function(_0x1a0462){this[_0xced1('0x3')](_0xced1('0x4f'),_0x1a0462);if(_0x1a0462===!![]){this[_0xced1('0x3')](_0xced1('0x50'),moment());this['setDataValue']('loginAttempts',0x0);}else{this[_0xced1('0x3')](_0xced1('0x50'),null);}}},'blockedAt':{'type':Sequelize[_0xced1('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xced1('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xced1('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xced1('0x18')](0x5)[_0xced1('0x51')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xced1('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xced1('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x553a=['info','shortinfo','inband','auto','rfc2833','update','yes','force_rport,comedia','nat','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\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','accept','refuse','originate','uac','uas','fingerprint','certificate','actpass','nonat','isArray','udp','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','lodash','exports','STRING','setDataValue','defaultuser','fullname','callerid','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','user','agent','local','format','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'];(function(_0x21f707,_0x6ae101){var _0x4d153e=function(_0x3308b1){while(--_0x3308b1){_0x21f707['push'](_0x21f707['shift']());}};_0x4d153e(++_0x6ae101);}(_0x553a,0x192));var _0xa553=function(_0x1394a2,_0x533264){_0x1394a2=_0x1394a2-0x0;var _0x31dcd1=_0x553a[_0x1394a2];return _0x31dcd1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa553('0x0'));var util=require('util');var _=require(_0xa553('0x1'));module[_0xa553('0x2')]={'name':{'type':Sequelize[_0xa553('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4d5106){this[_0xa553('0x4')]('name',_0x4d5106);this['setDataValue'](_0xa553('0x5'),_0x4d5106);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x18da5d){this[_0xa553('0x4')](_0xa553('0x6'),_0x18da5d);this['setDataValue'](_0xa553('0x7'),util['format'](_0xa553('0x8'),_0x18da5d,this[_0xa553('0x9')](_0xa553('0xa'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa553('0xb'),'validate':{'isEmail':!![]},'set':function(_0x58c170){if(_0x58c170){this[_0xa553('0x4')](_0xa553('0xb'),_0x58c170[_0xa553('0xc')]());}}},'role':{'type':Sequelize['ENUM'](_0xa553('0xd'),_0xa553('0xe'),_0xa553('0xf'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0xa553('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa553('0x3')],'defaultValue':_0xa553('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x15b224){this[_0xa553('0x4')](_0xa553('0xa'),_0x15b224);this[_0xa553('0x4')]('accountcode',_0x15b224);this[_0xa553('0x4')]('callerid',util[_0xa553('0x11')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0xa553('0x6')),_0x15b224));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa553('0x3')]},'mobile':{'type':Sequelize[_0xa553('0x3')]},'address':{'type':Sequelize[_0xa553('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xa553('0x3')]},'city':{'type':Sequelize[_0xa553('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa553('0x13')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xa553('0x14')},'lastPauseAt':{'type':Sequelize[_0xa553('0x13')]},'chatCapacity':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xa553('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa553('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![],'defaultValue':_0xa553('0x16')},'ipaddr':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xa553('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x18'),_0xa553('0xe'),_0xa553('0x19')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![],'defaultValue':_0xa553('0x1a')},'callingpres':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x1b'),_0xa553('0x1c'),_0xa553('0x1d'),_0xa553('0x1e'),_0xa553('0x1f'),_0xa553('0x20'),_0xa553('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x20830f){this[_0xa553('0x4')](_0xa553('0x22'),_0x20830f?_0x20830f[_0xa553('0x23')](','):null);},'get':function(){return this[_0xa553('0x9')]('transport')?this[_0xa553('0x9')]('transport')[_0xa553('0x24')](','):null;},'comment':_0xa553('0x25')},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0xa553('0x26'),_0xa553('0x27'),_0xa553('0x28'),_0xa553('0x29')),'allowNull':!![],'defaultValue':_0xa553('0x2a')},'directmedia':{'type':Sequelize[_0xa553('0x17')]('yes','no','nonat',_0xa553('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xa553('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![],'defaultValue':_0xa553('0x2d'),'set':function(_0x1728b0){this[_0xa553('0x4')](_0xa553('0x2e'),_0x1728b0?_0x1728b0[_0xa553('0x23')](','):null);},'get':function(){return this[_0xa553('0x9')](_0xa553('0x2e'))?this[_0xa553('0x9')](_0xa553('0x2e'))[_0xa553('0x24')](','):null;},'comment':_0xa553('0x2f')},'callgroup':{'type':Sequelize[_0xa553('0x3')]},'namedcallgroup':{'type':Sequelize[_0xa553('0x3')]},'pickupgroup':{'type':Sequelize[_0xa553('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xa553('0x3')]},'language':{'type':Sequelize[_0xa553('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa553('0x3')]},'disallow':{'type':Sequelize[_0xa553('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xa553('0x3')],'allowNull':![],'defaultValue':_0xa553('0x30'),'set':function(_0x222d8e){this[_0xa553('0x4')](_0xa553('0x31'),_0x222d8e?_0x222d8e[_0xa553('0x23')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xa553('0x9')]('allow')?this[_0xa553('0x9')](_0xa553('0x31'))[_0xa553('0x24')](';'):null;},'comment':_0xa553('0x32')},'autoframing':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![],'set':function(_0xfbccf4){this[_0xa553('0x4')](_0xa553('0x33'),_0xfbccf4?_0xfbccf4[_0xa553('0x23')](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0xa553('0x9')]('insecure')[_0xa553('0x24')](','):null;},'comment':_0xa553('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0xa553('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xa553('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xa553('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no',_0xa553('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x36'),_0xa553('0x37'),_0xa553('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x39'),'uas'),'allowNull':!![],'defaultValue':_0xa553('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'allowNull':!![],'defaultValue':_0xa553('0x2c')},'keepalive':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa553('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xa553('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no',_0xa553('0x3b'),_0xa553('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xa553('0x17')]('active','passive',_0xa553('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa553('0x17')](_0xa553('0x2c'),'no',_0xa553('0x3e'),_0xa553('0x2b'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xa553('0x13')]},'passwordResetAt':{'type':Sequelize[_0xa553('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0,'set':function(_0x3aae77){this[_0xa553('0x4')]('showWebBar',_0x3aae77);var _0x244124=this['get']({'plain':!![]});switch(_0x3aae77){case 0x0:case 0x1:var _0x4f8a3d=_0x244124[_0xa553('0x22')]?_[_0xa553('0x3f')](_0x244124['transport'])?_0x244124[_0xa553('0x22')][_0xa553('0x23')]():_0x244124[_0xa553('0x22')]:_0xa553('0x40');if(_0x4f8a3d===_0xa553('0x41')){_0x4f8a3d=_0xa553('0x40');}this[_0xa553('0x4')](_0xa553('0x22'),_0x4f8a3d);this['setDataValue'](_0xa553('0x42'),'no');this[_0xa553('0x4')](_0xa553('0x43'),null);this['setDataValue'](_0xa553('0x44'),null);this[_0xa553('0x4')]('icesupport',null);this['setDataValue'](_0xa553('0x45'),null);this[_0xa553('0x4')](_0xa553('0x46'),null);this[_0xa553('0x4')](_0xa553('0x47'),null);this[_0xa553('0x4')](_0xa553('0x48'),null);this[_0xa553('0x4')](_0xa553('0x49'),null);this[_0xa553('0x4')](_0xa553('0x4a'),'no');break;case 0x2:this['setDataValue']('transport','wss');this[_0xa553('0x4')](_0xa553('0x42'),_0xa553('0x2c'));this[_0xa553('0x4')](_0xa553('0x43'),_0xa553('0x2c'));this[_0xa553('0x4')](_0xa553('0x44'),_0xa553('0x2c'));this[_0xa553('0x4')]('icesupport',_0xa553('0x2c'));this[_0xa553('0x4')]('dtlsenable',_0xa553('0x2c'));this[_0xa553('0x4')](_0xa553('0x46'),'no');this[_0xa553('0x4')](_0xa553('0x47'),_0xa553('0x3d'));this[_0xa553('0x4')](_0xa553('0x48'),_0x244124[_0xa553('0x48')]||_0xa553('0x4b'));this['setDataValue']('dtlsprivatekey',_0x244124[_0xa553('0x49')]||_0xa553('0x4c'));this[_0xa553('0x4')]('rtcp_mux',_0xa553('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x34e59e){this[_0xa553('0x4')](_0xa553('0x4d'),_0x34e59e?_0x34e59e['join'](','):[]);},'get':function(){return this['getDataValue'](_0xa553('0x4d'))?_[_0xa553('0x4e')](this[_0xa553('0x9')](_0xa553('0x4d'))[_0xa553('0x24')](','),function(_0x6089ff){return parseInt(_0x6089ff,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa553('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xa553('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa553('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa553('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa553('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa553('0x17')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa553('0x12')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa553('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa553('0x4f')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0xa553('0x9')](_0xa553('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0xa553('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa553('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![],'set':function(_0x487830){if(typeof _0x487830===_0xa553('0x51')){var _0x3f89be=_0x487830==='1'?!![]:_0x487830==='0'?![]:_0x487830==='true'?!![]:_0x487830===_0xa553('0x52')?![]:![];this[_0xa553('0x4')](_0xa553('0x53'),_0x3f89be);}else{this[_0xa553('0x4')]('screenrecording',_0x487830);}}},'blocked':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![],'set':function(_0x4c2265){this[_0xa553('0x4')](_0xa553('0x54'),_0x4c2265);if(_0x4c2265===!![]){this[_0xa553('0x4')](_0xa553('0x55'),moment());this['setDataValue'](_0xa553('0x56'),0x0);}else{this[_0xa553('0x4')](_0xa553('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0xa553('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa553('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa553('0x12')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa553('0x15')](0x5)[_0xa553('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa553('0x12')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa553('0x12')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa553('0x12')],'defaultValue':!![]}};
\ No newline at end of file
index f2a35c4..fe61c3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cc8=['then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','includes','name','UserProfileResource','end','stack','send','rawAttributes','fieldName','key','password','salt','User','query','includeAll','include','attributes','push','rows','openTabs','true','chat','dataValues','fax','mail','whatsapp','all','params','model','keys','filters','intersection','fields','length','merge','options','sms','openchannel','update','body','find','addContacts','ids','Setting','securePassword','max','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','VoiceMail','permissions','101','102','103','113','110','105','107','108','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','isEmpty','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','channel','online','interface','isValidChannel','add','capitalize','toLowerCase','Queues','QueueId','emit','findAll','voice','format','voicePause','penalty','UserVoiceQueueRt','upsert','removeQueues','Unknown\x20channel','remove','isArray','Queue:remove','userpic','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','order','sort','where','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','getQueues','Queue','nolimit','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','mobile','loginInPause','intrf','SIP/%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','MemberReport','bulkCreate','concat','isMiddleware','logout','forEach','QueuePause','pause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','%s%s','Pause','getTeams','addTeams','omit','Team','Voice','getChatQueues','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','Whatsapp','Fax','getOpenchannelQueues','flatten','getDataValue','Queue:save','removeTeams','getFaxQueues','transaction','removeAgent','getLists','getAgents','getVoiceQueues','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$or','$gt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notLike','$iLike','$like','$contains','$contained','$any','firstName','CmContact','Contact','VoiceQueue','CmHopper','retrieveApiKey','No\x20API\x20access\x20key\x20found!','generateApiKey','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','inbound','toString','asc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','unknown','unavailable','voiceStatus','busy','slice','charAt','toUpperCase','QueryTypes','ui.','InteractionId','ui.createdAt','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','http','request'];(function(_0x4c9a2f,_0x1e1c85){var _0x3f8a54=function(_0x496f07){while(--_0x496f07){_0x4c9a2f['push'](_0x4c9a2f['shift']());}};_0x3f8a54(++_0x1e1c85);}(_0x8cc8,0x177));var _0x88cc=function(_0x4c24da,_0x519109){_0x4c24da=_0x4c24da-0x0;var _0x234dc2=_0x8cc8[_0x4c24da];return _0x234dc2;};'use strict';var moment=require(_0x88cc('0x0'));var BPromise=require(_0x88cc('0x1'));var util=require(_0x88cc('0x2'));var path=require(_0x88cc('0x3'));var fs=require('fs');var _=require(_0x88cc('0x4'));var squel=require(_0x88cc('0x5'));var jayson=require(_0x88cc('0x6'));var Redis=require(_0x88cc('0x7'));var authService=require(_0x88cc('0x8'));var qs=require(_0x88cc('0x9'));var logger=require(_0x88cc('0xa'))(_0x88cc('0xb'));var utils=require(_0x88cc('0xc'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x88cc('0xd'))['db'];var socket=require(_0x88cc('0xe'))(new Redis(config[_0x88cc('0xf')]));require(_0x88cc('0x10'))['register'](socket);config[_0x88cc('0xf')]=_[_0x88cc('0x11')](config['redis'],{'host':_0x88cc('0x12'),'port':0x18eb});var client=jayson['client'][_0x88cc('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x23aee8,_0x22c044,_0x3bfea7,_0x5a70a9){return new BPromise(function(_0x10d09f,_0x2fd89c){var _0xee5f6f=_0x5a70a9||client;return _0xee5f6f[_0x88cc('0x14')](_0x23aee8,_0x3bfea7)[_0x88cc('0x15')](function(_0x1289d0){logger[_0x88cc('0x16')](_0x88cc('0x17'),_0x22c044,'request\x20sent');logger[_0x88cc('0x18')](_0x88cc('0x19'),_0x22c044,_0x88cc('0x1a'),JSON[_0x88cc('0x1b')](_0x1289d0));if(_0x1289d0[_0x88cc('0x1c')]){if(_0x1289d0[_0x88cc('0x1c')]['code']===0x1f4){logger[_0x88cc('0x1c')](_0x88cc('0x17'),_0x22c044,_0x1289d0[_0x88cc('0x1c')][_0x88cc('0x1d')]);return _0x2fd89c(_0x1289d0[_0x88cc('0x1c')]['message']);}logger[_0x88cc('0x1c')](_0x88cc('0x17'),_0x22c044,_0x1289d0[_0x88cc('0x1c')][_0x88cc('0x1d')]);return _0x10d09f(_0x1289d0[_0x88cc('0x1c')]['message']);}else{logger[_0x88cc('0x16')](_0x88cc('0x17'),_0x22c044,'request\x20sent');_0x10d09f(_0x1289d0[_0x88cc('0x1e')]['message']);}})[_0x88cc('0x1f')](function(_0x2a88c4){logger['error'](_0x88cc('0x17'),_0x22c044,_0x2a88c4);_0x2fd89c(_0x2a88c4);});});}function respondWithStatusCode(_0x2b6c12,_0xe55e9d){_0xe55e9d=_0xe55e9d||0xcc;return function(_0x149246){if(_0x149246){return _0x2b6c12[_0x88cc('0x20')](_0xe55e9d);}return _0x2b6c12[_0x88cc('0x21')](_0xe55e9d)['end']();};}function respondWithResult(_0x155635,_0x54b67){_0x54b67=_0x54b67||0xc8;return function(_0x22abea){if(_0x22abea){return _0x155635[_0x88cc('0x21')](_0x54b67)[_0x88cc('0x22')](_0x22abea);}};}function respondWithFilteredResult(_0x3c2353,_0x420279){return function(_0xcf454c){if(_0xcf454c){var _0x345f7e=typeof _0x420279[_0x88cc('0x23')]===_0x88cc('0x24')&&typeof _0x420279[_0x88cc('0x25')]===_0x88cc('0x24');var _0x5657ef=_0xcf454c[_0x88cc('0x26')];var _0x337bab=_0x345f7e?0x0:_0x420279[_0x88cc('0x23')];var _0x3474b6=_0x345f7e?_0xcf454c[_0x88cc('0x26')]:_0x420279[_0x88cc('0x23')]+_0x420279[_0x88cc('0x25')];var _0xdced80;if(_0x3474b6>=_0x5657ef){_0x3474b6=_0x5657ef;_0xdced80=0xc8;}else{_0xdced80=0xce;}_0x3c2353['status'](_0xdced80);return _0x3c2353['set'](_0x88cc('0x27'),_0x337bab+'-'+_0x3474b6+'/'+_0x5657ef)[_0x88cc('0x22')](_0xcf454c);}return null;};}function saveUpdates(_0x1c1d57){return function(_0x5b77ae){if(_0x5b77ae){return _0x5b77ae['update'](_0x1c1d57)[_0x88cc('0x15')](function(_0x2cc552){return _0x2cc552;});}return null;};}function removeEntity(_0x5511b9){return function(_0x3d2e96){if(_0x3d2e96){return _0x3d2e96[_0x88cc('0x28')]()[_0x88cc('0x15')](function(){var _0x5edea2=_0x3d2e96[_0x88cc('0x29')]({'plain':!![]});if(_0x5edea2[_0x88cc('0x2a')]===_0x88cc('0x2b'))return;var _0x59b4c5=[{'name':_0x88cc('0x2c'),'value':_0x88cc('0x2d'),'ignore':!![]},{'name':_0x88cc('0x2e'),'value':_0x88cc('0x2f'),'ignore':![]},{'name':_0x88cc('0x30'),'value':_0x88cc('0x31'),'ignore':![]}];var _0x5628d9=_(_0x59b4c5)[_0x88cc('0x32')](_0x88cc('0x33'))[_0x88cc('0x34')](_0x88cc('0x35'))[_0x88cc('0x35')]();if(_[_0x88cc('0x36')](_0x5628d9,_0x5edea2[_0x88cc('0x2a')])){return;}var _0x579a1f=_['find'](_0x59b4c5,[_0x88cc('0x35'),_0x5edea2[_0x88cc('0x2a')]])[_0x88cc('0x37')];return db[_0x88cc('0x38')][_0x88cc('0x28')]({'where':{'type':_0x579a1f,'resourceId':_0x5edea2['id']}})['then'](function(){return _0x3d2e96;});})[_0x88cc('0x15')](function(){_0x5511b9[_0x88cc('0x21')](0xcc)[_0x88cc('0x39')]();});}};}function handleEntityNotFound(_0x3baf9f){return function(_0x2bb05b){if(!_0x2bb05b){_0x3baf9f[_0x88cc('0x20')](0x194);}return _0x2bb05b;};}function handleError(_0x263ca2,_0x46fb4b){_0x46fb4b=_0x46fb4b||0x1f4;return function(_0x2841e7){logger[_0x88cc('0x1c')](_0x2841e7[_0x88cc('0x3a')]);if(_0x2841e7[_0x88cc('0x37')]){delete _0x2841e7['name'];}_0x263ca2[_0x88cc('0x21')](_0x46fb4b)[_0x88cc('0x3b')](_0x2841e7);};}exports['index']=function(_0x30bdd2,_0x47f4da){var _0x54be38={},_0x5278f2={'count':0x0,'rows':[]};var _0x2beb74=_(db['User'][_0x88cc('0x3c')])[_0x88cc('0x34')](function(_0x57bc5c){return{'name':_0x57bc5c[_0x88cc('0x3d')],'type':_0x57bc5c['type'][_0x88cc('0x3e')]};})['filter'](function(_0x31270f){return!_['includes']([_0x88cc('0x3f'),_0x88cc('0x40')],_0x31270f[_0x88cc('0x37')]);})[_0x88cc('0x35')]();_0x54be38=qs['getOptions'](_0x2beb74,_0x30bdd2);var _0x237423={'where':_0x54be38['where']};return db[_0x88cc('0x41')][_0x88cc('0x26')](_0x237423)[_0x88cc('0x15')](function(_0x1d58a6){_0x5278f2[_0x88cc('0x26')]=_0x1d58a6;if(_0x30bdd2[_0x88cc('0x42')][_0x88cc('0x43')]){_0x54be38[_0x88cc('0x44')]=[{'all':!![]}];}if(!_[_0x88cc('0x36')](_0x54be38['attributes'],'id')){_0x54be38[_0x88cc('0x45')][_0x88cc('0x46')]('id');}return db[_0x88cc('0x41')]['findAll'](_0x54be38);})[_0x88cc('0x15')](function(_0x37ad9f){_0x5278f2[_0x88cc('0x47')]=_0x37ad9f;if(_0x30bdd2['query'][_0x88cc('0x48')]===_0x88cc('0x49')){var _0x328f4b=[];for(var _0xbca88c=0x0;_0xbca88c<_0x5278f2[_0x88cc('0x47')]['length'];_0xbca88c++){_0x328f4b[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x4a'),_0x5278f2[_0x88cc('0x47')][_0xbca88c][_0x88cc('0x4b')]));_0x328f4b[_0x88cc('0x46')](get_open_tabs('sms',_0x5278f2[_0x88cc('0x47')][_0xbca88c]['dataValues']));_0x328f4b['push'](get_open_tabs(_0x88cc('0x4c'),_0x5278f2[_0x88cc('0x47')][_0xbca88c]['dataValues']));_0x328f4b['push'](get_open_tabs(_0x88cc('0x4d'),_0x5278f2[_0x88cc('0x47')][_0xbca88c][_0x88cc('0x4b')]));_0x328f4b[_0x88cc('0x46')](get_open_tabs('openchannel',_0x5278f2[_0x88cc('0x47')][_0xbca88c][_0x88cc('0x4b')]));_0x328f4b[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x4e'),_0x5278f2[_0x88cc('0x47')][_0xbca88c][_0x88cc('0x4b')]));}return BPromise[_0x88cc('0x4f')](_0x328f4b)[_0x88cc('0x15')](function(_0x14e889){return _0x5278f2;});}else{return _0x5278f2;}})[_0x88cc('0x15')](respondWithFilteredResult(_0x47f4da,_0x54be38))[_0x88cc('0x1f')](handleError(_0x47f4da,null));};exports['show']=function(_0x42d75d,_0x421571){var _0x16816b={'raw':![],'where':{'id':_0x42d75d[_0x88cc('0x50')]['id']}},_0x5690d2={};_0x5690d2[_0x88cc('0x51')]=_['differenceBy'](_[_0x88cc('0x52')](db[_0x88cc('0x41')][_0x88cc('0x3c')]),[_0x88cc('0x3f'),'salt']);_0x5690d2[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x42d75d['query']);_0x5690d2[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x5690d2[_0x88cc('0x51')],_0x5690d2[_0x88cc('0x42')]);_0x16816b[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x5690d2[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x42d75d[_0x88cc('0x42')][_0x88cc('0x55')]));_0x16816b[_0x88cc('0x45')]=_0x16816b[_0x88cc('0x45')][_0x88cc('0x56')]?_0x16816b[_0x88cc('0x45')]:_0x5690d2[_0x88cc('0x51')];if(_0x42d75d[_0x88cc('0x42')][_0x88cc('0x43')]){_0x16816b['include']=[{'all':!![]}];}_0x16816b=_[_0x88cc('0x57')]({},_0x16816b,_0x42d75d[_0x88cc('0x58')]);if(!_['includes'](_0x16816b['attributes'],'id')){_0x16816b[_0x88cc('0x45')][_0x88cc('0x46')]('id');}return db[_0x88cc('0x41')]['find'](_0x16816b)['then'](handleEntityNotFound(_0x421571,null))[_0x88cc('0x15')](function(_0x225e4f){var _0x36547c=[];values=_0x225e4f;if(_0x42d75d[_0x88cc('0x42')][_0x88cc('0x48')]===_0x88cc('0x49')){_0x36547c['push'](get_open_tabs(_0x88cc('0x4a'),_0x225e4f[_0x88cc('0x4b')]));_0x36547c[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x59'),_0x225e4f[_0x88cc('0x4b')]));_0x36547c[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x5a'),_0x225e4f[_0x88cc('0x4b')]));_0x36547c['push'](get_open_tabs(_0x88cc('0x4e'),_0x225e4f[_0x88cc('0x4b')]));_0x36547c['push'](get_open_tabs(_0x88cc('0x4c'),_0x225e4f[_0x88cc('0x4b')]));_0x36547c[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x4d'),_0x225e4f[_0x88cc('0x4b')]));return BPromise[_0x88cc('0x4f')](_0x36547c);}else{return values;}})['then'](function(_0x4f5a8b){return values;})[_0x88cc('0x15')](respondWithResult(_0x421571,null))['catch'](handleError(_0x421571,null));};exports[_0x88cc('0x5b')]=function(_0x484f99,_0x2db0a6){if(_0x484f99[_0x88cc('0x5c')]['id']){delete _0x484f99[_0x88cc('0x5c')]['id'];}delete _0x484f99[_0x88cc('0x5c')][_0x88cc('0x2a')];return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x484f99[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x2db0a6,null))['then'](saveUpdates(_0x484f99[_0x88cc('0x5c')],null))[_0x88cc('0x15')](respondWithResult(_0x2db0a6,null))[_0x88cc('0x1f')](handleError(_0x2db0a6,null));};exports['describe']=function(_0xacce64,_0x28d577){return db[_0x88cc('0x41')]['describe']()[_0x88cc('0x15')](respondWithResult(_0x28d577,null))[_0x88cc('0x1f')](handleError(_0x28d577,null));};exports[_0x88cc('0x5e')]=function(_0x50ce77,_0x2f856a){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x50ce77[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x2f856a,null))[_0x88cc('0x15')](function(_0x1f37ac){if(_0x1f37ac){return _0x1f37ac[_0x88cc('0x5e')](_0x50ce77['body'][_0x88cc('0x5f')],_['omit'](_0x50ce77[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{});}})[_0x88cc('0x15')](respondWithResult(_0x2f856a,null))[_0x88cc('0x1f')](handleError(_0x2f856a,null));};function validateUser(_0x41dddd){return new BPromise(function(_0x38411f,_0x2b3727){if(_0x41dddd['internal'])return _0x38411f(_0x41dddd);return db[_0x88cc('0x60')]['findById'](0x1)[_0x88cc('0x15')](function(_0x351c94){if(_0x351c94[_0x88cc('0x61')])authService['validatePasswordPattern'](_0x41dddd[_0x88cc('0x3f')]);db['User'][_0x88cc('0x62')](_0x88cc('0x63'))['then'](function(_0x5a0fa1){if(_[_0x88cc('0x64')](_0x5a0fa1)){_0x41dddd[_0x88cc('0x63')]=_0x351c94[_0x88cc('0x65')]||0x1;return;}if(_[_0x88cc('0x64')](_0x351c94[_0x88cc('0x65')])||_0x351c94[_0x88cc('0x65')]===_0x5a0fa1){_0x41dddd[_0x88cc('0x63')]=_0x5a0fa1+0x1;return;}if(_0x351c94[_0x88cc('0x65')]>_0x5a0fa1){_0x41dddd['internal']=_0x351c94[_0x88cc('0x65')];return;}return db[_0x88cc('0x66')][_0x88cc('0x42')](_0x88cc('0x67'),{'type':db[_0x88cc('0x66')]['QueryTypes'][_0x88cc('0x68')]})[_0x88cc('0x15')](function(_0x3857ad){if(_0x3857ad&&_0x3857ad[_0x88cc('0x56')]){for(var _0x1cba60=0x0,_0x126672=_0x3857ad[_0x88cc('0x56')];_0x1cba60<_0x126672&&_['isNil'](_0x41dddd[_0x88cc('0x63')]);_0x1cba60++){if(_0x351c94[_0x88cc('0x65')]<=_0x3857ad[_0x1cba60][_0x88cc('0x69')]){_0x41dddd[_0x88cc('0x63')]=_0x3857ad[_0x1cba60][_0x88cc('0x69')];}else if(_0x351c94[_0x88cc('0x65')]>_0x3857ad[_0x1cba60][_0x88cc('0x69')]&&_0x351c94[_0x88cc('0x65')]<=_0x3857ad[_0x1cba60]['to']){_0x41dddd['internal']=_0x351c94[_0x88cc('0x65')];}}}if(_[_0x88cc('0x64')](_0x41dddd[_0x88cc('0x63')])){_0x41dddd[_0x88cc('0x63')]=_0x5a0fa1+0x1;}return _0x38411f(_0x41dddd);});});})['catch'](function(_0x333c3c){_0x2b3727(_0x333c3c);});});}function updateUser(_0x5936f8){return new BPromise(function(_0x2591cb,_0x3ab943){try{if(_0x5936f8[_0x88cc('0x6a')]){_0x5936f8[_0x88cc('0x6b')]=_0x5936f8[_0x88cc('0x63')];_0x5936f8[_0x88cc('0x6c')]={'mailbox':_0x5936f8[_0x88cc('0x63')],'password':_0x5936f8[_0x88cc('0x3f')],'fullname':_0x5936f8['fullname'],'email':_0x5936f8['email']};}if(_0x5936f8['role']===_0x88cc('0x2f')){if(!_0x5936f8[_0x88cc('0x6d')])_0x5936f8['permissions']=[_0x88cc('0x6e'),_0x88cc('0x6f'),_0x88cc('0x70'),_0x88cc('0x71'),_0x88cc('0x72'),'104',_0x88cc('0x73'),'106',_0x88cc('0x74'),_0x88cc('0x75'),'109',_0x88cc('0x76'),_0x88cc('0x77'),_0x88cc('0x78'),_0x88cc('0x79')];}_0x2591cb(_0x5936f8);}catch(_0x12e449){_0x3ab943(_0x12e449);}});}exports[_0x88cc('0x7a')]=function(_0x46cd60,_0x1dc30d){if(_0x46cd60[_0x88cc('0x2d')][_0x88cc('0x2a')]==='agent')throw new Error('Unauthorized');if(_0x46cd60[_0x88cc('0x5c')][_0x88cc('0x2a')]===_0x88cc('0x2d')&&_0x46cd60[_0x88cc('0x2d')][_0x88cc('0x2a')]!==_0x88cc('0x2b')){throw new Error(_0x88cc('0x7b'));}if(_0x46cd60[_0x88cc('0x5c')][_0x88cc('0x2a')]===_0x88cc('0x2b')&&_0x46cd60[_0x88cc('0x2d')]['role']!==_0x88cc('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x46cd60[_0x88cc('0x5c')]])[_0x88cc('0x15')](function(){return validateUser(_0x46cd60['body']);})['then'](function(_0x39f48d){return updateUser(_0x39f48d)['then'](function(_0x28d7d6){if(_0x28d7d6[_0x88cc('0x2a')]==='admin'){_0x28d7d6[_0x88cc('0x7c')]=_0x46cd60['user'][_0x88cc('0x7c')];delete _0x28d7d6['userProfileId'];}return _0x28d7d6;});})[_0x88cc('0x15')](function(_0xd5e338){return db[_0x88cc('0x41')]['create'](_0xd5e338,{'include':[{'model':db[_0x88cc('0x6c')],'as':_0x88cc('0x6c')}]});})[_0x88cc('0x15')](function(_0x44b7ca){if(_0x46cd60[_0x88cc('0x5c')][_0x88cc('0x2a')]==='user')return _0x44b7ca;if(_0x46cd60[_0x88cc('0x2d')][_0x88cc('0x2a')]!==_0x88cc('0x2d'))return _0x44b7ca;return db[_0x88cc('0x7d')][_0x88cc('0x5d')]({'where':{'name':_0x44b7ca['role']===_0x88cc('0x2f')?'Agents':_0x88cc('0x30'),'userProfileId':_0x46cd60[_0x88cc('0x2d')][_0x88cc('0x7e')]},'raw':!![]})[_0x88cc('0x15')](function(_0x42d58d){if(!_0x42d58d||_0x42d58d[_0x88cc('0x7f')]!=0x0)return _0x44b7ca;return db['UserProfileResource'][_0x88cc('0x7a')]({'name':_0x44b7ca[_0x88cc('0x37')],'resourceId':_0x44b7ca['id'],'type':_0x42d58d[_0x88cc('0x37')],'sectionId':_0x42d58d['id']},{})[_0x88cc('0x15')](function(){return _0x44b7ca;});})[_0x88cc('0x1f')](function(_0x125aa3){logger['error'](_0x88cc('0x80'),_0x125aa3);throw _0x125aa3;});})[_0x88cc('0x15')](respondWithResult(_0x1dc30d,0xc9))[_0x88cc('0x1f')](handleError(_0x1dc30d,null));};exports['bulkCreate']=function(_0x19b187,_0xa6f1ee){var _0x5caa1c=_0x19b187[_0x88cc('0x5c')];var _0x1f5716=[];if(_0x19b187[_0x88cc('0x2d')][_0x88cc('0x2a')]===_0x88cc('0x2f'))throw new Error('Unauthorized');if(_[_0x88cc('0x81')](_0x5caa1c,[_0x88cc('0x2a'),_0x88cc('0x2d')])&&_0x19b187[_0x88cc('0x2d')]['role']!==_0x88cc('0x2b')){throw new Error(_0x88cc('0x7b'));}if(_['some'](_0x5caa1c,[_0x88cc('0x2a'),_0x88cc('0x2b')])&&_0x19b187['user'][_0x88cc('0x2a')]!==_0x88cc('0x2b')){throw new Error(_0x88cc('0x82'));}return licenseUtil[_0x88cc('0x83')](_0x5caa1c)[_0x88cc('0x15')](function(){return validateUser(_0x5caa1c[0x0]);})[_0x88cc('0x15')](function(){for(var _0x9bad0c=0x1;_0x9bad0c<_0x5caa1c[_0x88cc('0x56')];_0x9bad0c++){var _0x2859d3=_0x5caa1c[_0x9bad0c-0x1][_0x88cc('0x63')];if(!_0x5caa1c[_0x9bad0c]['internal'])_0x5caa1c[_0x9bad0c]['internal']=_0x2859d3+0x1;_0x1f5716[_0x88cc('0x46')](validateUser(_0x5caa1c[_0x9bad0c]));}return BPromise['all'](_0x1f5716);})['then'](function(){_0x1f5716=[];for(var _0x559e10=0x0;_0x559e10<_0x5caa1c[_0x88cc('0x56')];_0x559e10++){_0x1f5716[_0x88cc('0x46')](updateUser(_0x5caa1c[_0x559e10]));}return BPromise[_0x88cc('0x4f')](_0x1f5716);})[_0x88cc('0x15')](function(){return BPromise[_0x88cc('0x84')](_0x5caa1c,function(_0x366c70){return db[_0x88cc('0x41')][_0x88cc('0x7a')](_0x366c70,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})['then'](function(_0x2a0470){_0x366c70['id']=_0x2a0470['id'];return _0x366c70;});});})[_0x88cc('0x15')](function(_0xfd11b7){if(_0x19b187[_0x88cc('0x5c')]['role']==='user')return _0xfd11b7;if(_0x19b187[_0x88cc('0x2d')]['role']!=='user')return _0xfd11b7;var _0x405eef=_['some'](_0xfd11b7,function(_0x4b87fe){return _0x4b87fe[_0x88cc('0x2a')]===_0x88cc('0x2f')||_0x4b87fe[_0x88cc('0x2a')]===_0x88cc('0x31');});if(!_0x405eef)return _0xfd11b7;return db[_0x88cc('0x7d')]['findAll']({'where':{'name':{'$or':['Agents',_0x88cc('0x30')]},'userProfileId':_0x19b187['user']['userProfileId']},'raw':!![]})[_0x88cc('0x15')](function(_0x5c7b55){if(_[_0x88cc('0x85')](_0x5c7b55)||!_['some'](_0x5c7b55,[_0x88cc('0x7f'),0x0]))return _0xfd11b7;_0x1f5716=[];var _0x49fe56=_(_0x5c7b55)[_0x88cc('0x34')](function(_0x3f175f){if(_0x3f175f[_0x88cc('0x7f')]===0x1)return;return _0x3f175f[_0x88cc('0x37')]==='Agents'?_0x88cc('0x2f'):_0x88cc('0x31');})['compact']()['value']();for(var _0x5170e7=0x0;_0x5170e7<_0xfd11b7['length'];_0x5170e7++){if(!_['includes'](_0x49fe56,_0xfd11b7[_0x5170e7]['role']))return;var _0x373468=_0xfd11b7[_0x5170e7][_0x88cc('0x2a')]===_0x88cc('0x2f')?'Agents':_0x88cc('0x30');_0x1f5716[_0x88cc('0x46')](db[_0x88cc('0x38')]['create']({'name':_0xfd11b7[_0x5170e7][_0x88cc('0x37')],'resourceId':_0xfd11b7[_0x5170e7]['id'],'type':_0x373468,'sectionId':_[_0x88cc('0x5d')](_0x5c7b55,[_0x88cc('0x37'),_0x373468])['id']},{}));}return BPromise['all'](_0x1f5716);});})[_0x88cc('0x15')](respondWithResult(_0xa6f1ee,0xc9))[_0x88cc('0x1f')](handleError(_0xa6f1ee,null));};exports[_0x88cc('0x86')]=function(_0x12405f,_0x57abc9){if(_0x12405f[_0x88cc('0x5c')]['id']){delete _0x12405f[_0x88cc('0x5c')]['id'];}return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x12405f[_0x88cc('0x50')]['id']}})['then'](function(_0x183ca6){if(!_0x183ca6)return null;if(_0x183ca6['id']===_0x12405f['user']['id']){if(!_0x12405f['body'][_0x88cc('0x87')]||!_0x12405f[_0x88cc('0x5c')]['newPassword']){throw new db[(_0x88cc('0x88'))]['ValidationError'](_0x88cc('0x89'));}if(!_0x183ca6[_0x88cc('0x8a')](_0x12405f['body'][_0x88cc('0x87')])){throw new db['Sequelize'][(_0x88cc('0x8b'))](_0x88cc('0x8c'));}if(_0x12405f[_0x88cc('0x5c')][_0x88cc('0x87')]===_0x12405f[_0x88cc('0x5c')][_0x88cc('0x8d')]){throw new db[(_0x88cc('0x88'))]['ValidationError'](_0x88cc('0x8e'));}}else if(_0x12405f['user'][_0x88cc('0x2a')]===_0x88cc('0x2b')){if(!_0x12405f[_0x88cc('0x5c')][_0x88cc('0x8d')]){throw new db[(_0x88cc('0x88'))]['ValidationError'](_0x88cc('0x8f'));}}else if(_0x12405f[_0x88cc('0x2d')][_0x88cc('0x2a')]==='user'){if(!_0x12405f['body']['newPassword']){throw new db[(_0x88cc('0x88'))]['ValidationError'](_0x88cc('0x8f'));}if(_0x183ca6['role']!==_0x88cc('0x2f')){throw new db[(_0x88cc('0x88'))][(_0x88cc('0x8b'))]('Unauthorized');}}else{throw new db[(_0x88cc('0x88'))][(_0x88cc('0x8b'))](_0x88cc('0x90'));}return _0x183ca6;})[_0x88cc('0x15')](handleEntityNotFound(_0x57abc9,null))[_0x88cc('0x15')](function(_0x19488b){return db[_0x88cc('0x60')][_0x88cc('0x91')]({'attributes':['id',_0x88cc('0x61'),_0x88cc('0x92'),_0x88cc('0x93')]})[_0x88cc('0x15')](function(_0x2efd33){if(_0x2efd33[_0x88cc('0x61')])authService['validatePasswordPattern'](_0x12405f[_0x88cc('0x5c')][_0x88cc('0x8d')]);if(!_0x2efd33[_0x88cc('0x92')]||!_0x19488b[_0x88cc('0x94')])return _0x19488b;authService['validatePasswordHistory'](_0x12405f[_0x88cc('0x5c')][_0x88cc('0x8d')],_0x19488b[_0x88cc('0x94')],_0x2efd33[_0x88cc('0x93')]);return _0x19488b;})[_0x88cc('0x15')](saveUpdates({'password':_0x12405f[_0x88cc('0x5c')][_0x88cc('0x8d')],'passwordResetAt':_0x12405f[_0x88cc('0x2d')]['id']==_0x12405f[_0x88cc('0x50')]['id']?moment():null,'previousPasswords':authService[_0x88cc('0x95')](_0x12405f['body'][_0x88cc('0x8d')],_0x19488b[_0x88cc('0x94')])},null));})['then'](respondWithResult(_0x57abc9,null))[_0x88cc('0x1f')](handleError(_0x57abc9,null));};exports['addQueues']=function(_0x49d0f4,_0x2d69e2){var _0x38964f=_0x49d0f4['body'][_0x88cc('0x96')];return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x49d0f4[_0x88cc('0x50')]['id']},'attributes':['id','name','role',_0x88cc('0x97'),'loginInPause','voicePause',_0x88cc('0x98')]})[_0x88cc('0x15')](handleEntityNotFound(_0x2d69e2,null))[_0x88cc('0x15')](function(_0x88aa95){if(_0x88aa95){if(!utils[_0x88cc('0x99')](_0x38964f)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x88aa95[_0x88cc('0x9a')+_[_0x88cc('0x9b')](_0x38964f[_0x88cc('0x9c')]())+_0x88cc('0x9d')](_0x49d0f4[_0x88cc('0x5c')][_0x88cc('0x5f')],{'penalty':_0x49d0f4[_0x88cc('0x5c')]['penalty']||0x0})['spread'](function(_0x301beb){for(var _0x3e5ae5=0x0;_0x3e5ae5<_0x49d0f4['body'][_0x88cc('0x5f')][_0x88cc('0x56')];_0x3e5ae5+=0x1){var _0x449cf8={'UserId':Number(_0x49d0f4[_0x88cc('0x50')]['id'])};_0x449cf8[_[_0x88cc('0x9b')](_0x38964f[_0x88cc('0x9c')]())+_0x88cc('0x9e')]=Number(_0x49d0f4[_0x88cc('0x5c')]['ids'][_0x3e5ae5]);socket[_0x88cc('0x9f')](_0x88cc('0x2d')+_[_0x88cc('0x9b')](_0x38964f[_0x88cc('0x9c')]())+'Queue:save',_0x449cf8);}return _0x301beb;})[_0x88cc('0x15')](function(){if(_0x38964f==='voice'){return db['VoiceQueue'][_0x88cc('0xa0')]({'where':{'id':_0x49d0f4[_0x88cc('0x5c')][_0x88cc('0x5f')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x88cc('0x15')](function(_0x50516e){var _0xc91526=_0x88aa95[_0x88cc('0x29')]({'plain':!![]});var _0x5c1023=[];if(_0x38964f===_0x88cc('0xa1')&&_0xc91526[_0x88cc('0x2a')]===_0x88cc('0x2f')&&_0xc91526['online']){for(var _0x27550c=0x0;_0x27550c<_0x50516e[_0x88cc('0x56')];_0x27550c+=0x1){_0x5c1023[_0x88cc('0x46')]({'membername':_0xc91526[_0x88cc('0x37')],'UserId':_0xc91526['id'],'queue_name':_0x50516e[_0x27550c]['name'],'VoiceQueueId':_0x50516e[_0x27550c]['id'],'interface':_[_0x88cc('0x64')](_0xc91526[_0x88cc('0x98')])?util[_0x88cc('0xa2')]('SIP/%s',_0xc91526[_0x88cc('0x37')]):_0xc91526['interface'],'paused':_0xc91526[_0x88cc('0xa3')]||![],'penalty':_0x49d0f4[_0x88cc('0x5c')][_0x88cc('0xa4')]||0x0});}return BPromise[_0x88cc('0x84')](_0x5c1023,function(_0xfa913c){return db[_0x88cc('0xa5')][_0x88cc('0xa6')](_0xfa913c);});}return _0x88aa95;});}})[_0x88cc('0x15')](respondWithStatusCode(_0x2d69e2,null))['catch'](handleError(_0x2d69e2,null));};exports[_0x88cc('0xa7')]=function(_0x41debd,_0x2f2864){var _0x2b949c;return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x41debd[_0x88cc('0x50')]['id']},'attributes':['id',_0x88cc('0x37'),_0x88cc('0x2a')]})['then'](handleEntityNotFound(_0x2f2864,null))[_0x88cc('0x15')](function(_0x3be117){if(_0x3be117){_0x2b949c=_0x3be117;if(!_0x41debd[_0x88cc('0x42')]['channel']||!utils[_0x88cc('0x99')](_0x41debd[_0x88cc('0x42')][_0x88cc('0x96')])){throw new db[(_0x88cc('0x88'))][(_0x88cc('0x8b'))](_0x88cc('0xa8'));}return _0x3be117[_0x88cc('0xa9')+_[_0x88cc('0x9b')](_0x41debd[_0x88cc('0x42')]['channel'][_0x88cc('0x9c')]())+_0x88cc('0x9d')](_0x41debd[_0x88cc('0x42')][_0x88cc('0x5f')]);}})[_0x88cc('0x15')](function(_0x1bc3cb){if(_[_0x88cc('0xaa')](_0x41debd[_0x88cc('0x42')]['ids'])){for(var _0xbc48f=0x0;_0xbc48f<_0x41debd[_0x88cc('0x42')]['ids'][_0x88cc('0x56')];_0xbc48f+=0x1){var _0x12a7a3={'UserId':Number(_0x41debd[_0x88cc('0x50')]['id'])};_0x12a7a3[_[_0x88cc('0x9b')](_0x41debd[_0x88cc('0x42')][_0x88cc('0x96')][_0x88cc('0x9c')]())+_0x88cc('0x9e')]=Number(_0x41debd[_0x88cc('0x42')]['ids'][_0xbc48f]);socket[_0x88cc('0x9f')]('user'+_[_0x88cc('0x9b')](_0x41debd[_0x88cc('0x42')][_0x88cc('0x96')][_0x88cc('0x9c')]())+_0x88cc('0xab'),_0x12a7a3);}}else{var _0x12a7a3={'UserId':Number(_0x41debd[_0x88cc('0x50')]['id'])};_0x12a7a3[_[_0x88cc('0x9b')](_0x41debd[_0x88cc('0x42')][_0x88cc('0x96')][_0x88cc('0x9c')]())+_0x88cc('0x9e')]=Number(_0x41debd[_0x88cc('0x42')][_0x88cc('0x5f')]);socket[_0x88cc('0x9f')]('user'+_[_0x88cc('0x9b')](_0x41debd['query']['channel'][_0x88cc('0x9c')]())+_0x88cc('0xab'),_0x12a7a3);}return _0x1bc3cb;})['then'](function(){if(_0x41debd['query']['channel']===_0x88cc('0xa1')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x41debd['params']['id'],'VoiceQueueId':_0x41debd[_0x88cc('0x42')]['ids']},'individualHooks':!![]})[_0x88cc('0x15')](function(){return _0x2b949c;});}return _0x2b949c;})[_0x88cc('0x15')](respondWithStatusCode(_0x2f2864,null))[_0x88cc('0x1f')](handleError(_0x2f2864,null));};exports['addAvatar']=function(_0x45048b,_0x22d812){_0x45048b['body'][_0x88cc('0xac')]=_0x45048b['file']['filename'];return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x45048b[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x22d812,null))['then'](saveUpdates(_0x45048b[_0x88cc('0x5c')],null))[_0x88cc('0x15')](respondWithResult(_0x22d812,null))[_0x88cc('0x1f')](handleError(_0x22d812,null));};exports[_0x88cc('0xad')]=function(_0x4eec09,_0x238775){var _0x58bccc=path[_0x88cc('0xae')](config[_0x88cc('0xaf')],_0x88cc('0xb0'));return db[_0x88cc('0x41')]['find']({'where':{'id':_0x4eec09[_0x88cc('0x50')]['id']},'attributes':['id',_0x88cc('0xac')],'raw':!![]})[_0x88cc('0x15')](handleEntityNotFound(_0x238775,null))[_0x88cc('0x15')](function(_0x45dcf3){if(_0x45dcf3){if(_[_0x88cc('0x64')](_0x45dcf3['userpic'])){return _0x238775[_0x88cc('0xb1')](_0x58bccc);}else{if(!fs['existsSync'](path[_0x88cc('0xae')](config['root'],_0x88cc('0xb2'),_0x45dcf3[_0x88cc('0xac')]))){return _0x238775[_0x88cc('0xb1')](_0x58bccc);}return _0x238775[_0x88cc('0xb1')](path[_0x88cc('0xae')](config[_0x88cc('0xaf')],_0x88cc('0xb2'),_0x45dcf3[_0x88cc('0xac')]));}}})[_0x88cc('0x1f')](handleError(_0x238775,null));};exports[_0x88cc('0xb3')]=function(_0x58b267,_0x46d602){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x58b267['params']['id']},'attributes':['id']})[_0x88cc('0x15')](handleEntityNotFound(_0x46d602,null))[_0x88cc('0x15')](function(_0x2a7f17){var _0x751b55=[];values=_0x2a7f17[_0x88cc('0x4b')];_0x751b55[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x4a'),_0x2a7f17[_0x88cc('0x4b')]));_0x751b55[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x59'),_0x2a7f17['dataValues']));_0x751b55[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x5a'),_0x2a7f17[_0x88cc('0x4b')]));_0x751b55[_0x88cc('0x46')](get_open_tabs('whatsapp',_0x2a7f17[_0x88cc('0x4b')]));_0x751b55[_0x88cc('0x46')](get_open_tabs(_0x88cc('0x4c'),_0x2a7f17[_0x88cc('0x4b')]));_0x751b55['push'](get_open_tabs(_0x88cc('0x4d'),_0x2a7f17[_0x88cc('0x4b')]));return BPromise[_0x88cc('0x4f')](_0x751b55);})['then'](function(_0x3e7bcf){var _0x3b1f28=[];if(_0x3e7bcf){for(var _0x327b0e=0x0;_0x327b0e<values['ChatOpenTabs']['length'];_0x327b0e++){var _0x307a28=values[_0x88cc('0xb4')][_0x327b0e];_0x3b1f28[_0x88cc('0x46')]({'channel':_0x88cc('0xb5'),'id':_0x307a28['id'],'createdAt':_0x307a28[_0x88cc('0xb6')]});}for(var _0x327b0e=0x0;_0x327b0e<values['FaxOpenTabs'][_0x88cc('0x56')];_0x327b0e++){var _0x307a28=values[_0x88cc('0xb7')][_0x327b0e];_0x3b1f28[_0x88cc('0x46')]({'channel':_0x88cc('0xb8'),'id':_0x307a28['id'],'createdAt':_0x307a28[_0x88cc('0xb6')]});}for(var _0x327b0e=0x0;_0x327b0e<values['OpenchannelOpenTabs'][_0x88cc('0x56')];_0x327b0e++){var _0x307a28=values['OpenchannelOpenTabs'][_0x327b0e];_0x3b1f28[_0x88cc('0x46')]({'channel':_0x88cc('0xb9'),'id':_0x307a28['id'],'createdAt':_0x307a28[_0x88cc('0xb6')]});}for(var _0x327b0e=0x0;_0x327b0e<values['MailOpenTabs'][_0x88cc('0x56')];_0x327b0e++){var _0x307a28=values[_0x88cc('0xba')][_0x327b0e];_0x3b1f28[_0x88cc('0x46')]({'channel':_0x88cc('0xbb'),'id':_0x307a28['id'],'createdAt':_0x307a28[_0x88cc('0xb6')]});}for(var _0x327b0e=0x0;_0x327b0e<values['SmsOpenTabs'][_0x88cc('0x56')];_0x327b0e++){var _0x307a28=values[_0x88cc('0xbc')][_0x327b0e];_0x3b1f28[_0x88cc('0x46')]({'channel':_0x88cc('0xbd'),'id':_0x307a28['id'],'createdAt':_0x307a28[_0x88cc('0xb6')]});}for(var _0x327b0e=0x0;_0x327b0e<values[_0x88cc('0xbe')][_0x88cc('0x56')];_0x327b0e++){var _0x307a28=values['WhatsappOpenTabs'][_0x327b0e];_0x3b1f28[_0x88cc('0x46')]({'channel':_0x88cc('0xbf'),'id':_0x307a28['id'],'createdAt':_0x307a28[_0x88cc('0xb6')]});}var _0x1c2623={'count':_0x3b1f28['length'],'rows':_0x3b1f28};return _0x1c2623;}else return null;})[_0x88cc('0x15')](respondWithResult(_0x46d602,null))['catch'](handleError(_0x46d602,null));};exports[_0x88cc('0xc0')]=function(_0x3894ed,_0x53aa81){var _0x36bf25={};var _0x38d4df={};var _0x43771f;var _0x52eda5;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x3894ed[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x53aa81,null))[_0x88cc('0x15')](function(_0x3deacd){if(_0x3deacd){_0x43771f=_0x3deacd;_0x38d4df[_0x88cc('0x51')]=_['keys'](db['CmContact'][_0x88cc('0x3c')]);_0x38d4df[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x3894ed[_0x88cc('0x42')]);_0x38d4df[_0x88cc('0x53')]=_['intersection'](_0x38d4df['model'],_0x38d4df[_0x88cc('0x42')]);_0x36bf25[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x38d4df[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x3894ed['query']['fields']));_0x36bf25['attributes']=_0x36bf25[_0x88cc('0x45')][_0x88cc('0x56')]?_0x36bf25[_0x88cc('0x45')]:_0x38d4df[_0x88cc('0x51')];_0x36bf25[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x3894ed[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x36bf25[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x3894ed['query'],_0x38d4df['filters']));if(_0x3894ed['query'][_0x88cc('0x32')]){_0x36bf25[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x36bf25[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x36bf25[_0x88cc('0x45')],function(_0xa86815){var _0x2a7e88={};_0x2a7e88[_0xa86815]={'$like':'%'+_0x3894ed[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x2a7e88;})});}_0x36bf25=_[_0x88cc('0x57')]({},_0x36bf25,_0x3894ed['options']);return _0x43771f['getContacts'](_0x36bf25);}})[_0x88cc('0x15')](function(_0x362e6e){if(_0x362e6e){_0x52eda5=_0x362e6e['length'];if(_0x3894ed[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0x43'))){_0x36bf25[_0x88cc('0x44')]=[{'model':db[_0x88cc('0xc6')],'as':_0x88cc('0xc7'),'required':![]},{'model':db[_0x88cc('0xc8')],'as':_0x88cc('0xc9'),'attributes':['id','name',_0x88cc('0xca')],'where':_0x3894ed[_0x88cc('0x42')]['tag']?{'id':_0x3894ed[_0x88cc('0x42')][_0x88cc('0xcb')]}:undefined,'required':_0x3894ed[_0x88cc('0x42')][_0x88cc('0xcb')]?!![]:![]}];}if(!_0x3894ed[_0x88cc('0x42')][_0x88cc('0xc5')]('nolimit')){_0x36bf25[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x3894ed[_0x88cc('0x42')][_0x88cc('0x25')]);_0x36bf25[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x3894ed['query'][_0x88cc('0x23')]);}return _0x43771f['getContacts'](_0x36bf25);}})[_0x88cc('0x15')](function(_0x58eca2){if(_0x58eca2){return _0x58eca2?{'count':_0x52eda5,'rows':_0x58eca2}:null;}})[_0x88cc('0x15')](respondWithResult(_0x53aa81,null))[_0x88cc('0x1f')](handleError(_0x53aa81,null));};exports[_0x88cc('0xcc')]=function(_0x5cf4a1,_0x3820ca){var _0x20173d;var _0x52b259;var _0x2bc41d={};var _0x310a90;return db['User']['findOne']({'where':{'id':_0x5cf4a1[_0x88cc('0x50')]['id']},'attributes':['id',_0x88cc('0x37'),_0x88cc('0x2a')]})[_0x88cc('0x15')](handleEntityNotFound(_0x3820ca,null))[_0x88cc('0x15')](function(_0x4625fb){if(!utils[_0x88cc('0x99')](_0x5cf4a1[_0x88cc('0x42')]['channel'])){throw new db['Sequelize'][(_0x88cc('0x8b'))](_0x88cc('0xa8'));}_0x20173d=_0x4625fb;var _0x42afe6={};_0x42afe6[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_[_0x88cc('0x9b')](_0x5cf4a1[_0x88cc('0x42')][_0x88cc('0x96')])+_0x88cc('0xcd')][_0x88cc('0x3c')]);_0x42afe6[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x5cf4a1[_0x88cc('0x42')]);_0x42afe6[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x42afe6[_0x88cc('0x51')],_0x42afe6['query']);_0x2bc41d[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x42afe6[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x5cf4a1[_0x88cc('0x42')]['fields']));_0x2bc41d[_0x88cc('0x45')]=_0x2bc41d[_0x88cc('0x45')]['length']?_0x2bc41d[_0x88cc('0x45')]:_0x42afe6['model'];_0x2bc41d['order']=qs[_0x88cc('0xc2')](_0x5cf4a1[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x2bc41d[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x5cf4a1['query'],_0x42afe6[_0x88cc('0x53')]));if(_0x5cf4a1[_0x88cc('0x42')]['filter']){_0x2bc41d[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x2bc41d[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x2bc41d[_0x88cc('0x45')],function(_0x52e865){var _0x169f16={};_0x169f16[_0x52e865]={'$like':'%'+_0x5cf4a1['query']['filter']+'%'};return _0x169f16;})});}_0x2bc41d=_[_0x88cc('0x57')]({},_0x2bc41d,_0x5cf4a1['options']);switch(_0x20173d[_0x88cc('0x2a')]){case'admin':return db[_[_0x88cc('0x9b')](_0x5cf4a1[_0x88cc('0x42')][_0x88cc('0x96')])+_0x88cc('0xcd')][_0x88cc('0xa0')](_0x2bc41d);case _0x88cc('0x2d'):case _0x88cc('0x2f'):return _0x20173d['get'+_[_0x88cc('0x9b')](_0x5cf4a1['query'][_0x88cc('0x96')])+_0x88cc('0x9d')](_0x2bc41d);default:throw new db['Sequelize'][(_0x88cc('0x8b'))]('Unknown\x20role');}})[_0x88cc('0x15')](function(_0x1373f1){_0x310a90=_0x1373f1[_0x88cc('0x56')];if(!_0x5cf4a1['query'][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x2bc41d[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x5cf4a1[_0x88cc('0x42')]['limit']);_0x2bc41d['offset']=qs['offset'](_0x5cf4a1[_0x88cc('0x42')]['offset']);}switch(_0x20173d[_0x88cc('0x2a')]){case _0x88cc('0x2b'):return db[_[_0x88cc('0x9b')](_0x5cf4a1['query'][_0x88cc('0x96')])+_0x88cc('0xcd')]['findAll'](_0x2bc41d);case'user':case _0x88cc('0x2f'):return _0x20173d[_0x88cc('0x29')+_[_0x88cc('0x9b')](_0x5cf4a1[_0x88cc('0x42')][_0x88cc('0x96')])+_0x88cc('0x9d')](_0x2bc41d);}})[_0x88cc('0x15')](function(_0x14f6d4){return{'count':_0x310a90,'rows':_0x14f6d4};})[_0x88cc('0x15')](respondWithResult(_0x3820ca,null))[_0x88cc('0x1f')](handleError(_0x3820ca,null));};exports[_0x88cc('0xcf')]=function(_0x3f52dc,_0x455a4e){var _0x2da5e5={};var _0x46e65d={};var _0x1bdcfa;var _0x5963e2;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x3f52dc[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x455a4e,null))[_0x88cc('0x15')](function(_0x223df9){if(_0x223df9){_0x1bdcfa=_0x223df9;_0x46e65d[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0xa5')][_0x88cc('0x3c')]);_0x46e65d[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x3f52dc[_0x88cc('0x42')]);_0x46e65d[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x46e65d[_0x88cc('0x51')],_0x46e65d['query']);_0x2da5e5[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x46e65d[_0x88cc('0x51')],qs['fields'](_0x3f52dc[_0x88cc('0x42')][_0x88cc('0x55')]));_0x2da5e5[_0x88cc('0x45')]=_0x2da5e5[_0x88cc('0x45')][_0x88cc('0x56')]?_0x2da5e5[_0x88cc('0x45')]:_0x46e65d[_0x88cc('0x51')];_0x2da5e5[_0x88cc('0xc1')]=qs['sort'](_0x3f52dc['query']['sort']);_0x2da5e5[_0x88cc('0xc3')]=qs['filters'](_[_0x88cc('0xc4')](_0x3f52dc['query'],_0x46e65d[_0x88cc('0x53')]));if(_0x3f52dc[_0x88cc('0x42')][_0x88cc('0x32')]){_0x2da5e5[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x2da5e5[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x2da5e5['attributes'],function(_0xbc9d0f){var _0x5d5abf={};_0x5d5abf[_0xbc9d0f]={'$like':'%'+_0x3f52dc[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x5d5abf;})});}_0x2da5e5=_['merge']({},_0x2da5e5,_0x3f52dc[_0x88cc('0x58')]);return _0x1bdcfa[_0x88cc('0xcf')](_0x2da5e5);}})[_0x88cc('0x15')](function(_0x51902a){if(_0x51902a){_0x5963e2=_0x51902a[_0x88cc('0x56')];if(!_0x3f52dc['query'][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x2da5e5[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x3f52dc[_0x88cc('0x42')][_0x88cc('0x25')]);_0x2da5e5['offset']=qs[_0x88cc('0x23')](_0x3f52dc['query'][_0x88cc('0x23')]);}return _0x1bdcfa[_0x88cc('0xcf')](_0x2da5e5);}})[_0x88cc('0x15')](function(_0xc798b4){if(_0xc798b4){return _0xc798b4?{'count':_0x5963e2,'rows':_0xc798b4}:null;}})[_0x88cc('0x15')](respondWithResult(_0x455a4e,null))['catch'](handleError(_0x455a4e,null));};exports[_0x88cc('0xd0')]=function(_0x379565,_0x2e3c45){var _0x43b5f1={};var _0x1f4195={};var _0xd39a7;var _0x44cf95;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x379565[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x2e3c45,null))[_0x88cc('0x15')](function(_0x5b2460){if(_0x5b2460){_0xd39a7=_0x5b2460;_0x1f4195[_0x88cc('0x51')]=_[_0x88cc('0x52')](db['ChatGroup'][_0x88cc('0x3c')]);_0x1f4195[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x379565[_0x88cc('0x42')]);_0x1f4195[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x1f4195['model'],_0x1f4195[_0x88cc('0x42')]);_0x43b5f1[_0x88cc('0x45')]=_['intersection'](_0x1f4195['model'],qs[_0x88cc('0x55')](_0x379565[_0x88cc('0x42')][_0x88cc('0x55')]));_0x43b5f1[_0x88cc('0x45')]=_0x43b5f1[_0x88cc('0x45')][_0x88cc('0x56')]?_0x43b5f1[_0x88cc('0x45')]:_0x1f4195[_0x88cc('0x51')];_0x43b5f1[_0x88cc('0xc1')]=qs['sort'](_0x379565[_0x88cc('0x42')]['sort']);_0x43b5f1[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x379565[_0x88cc('0x42')],_0x1f4195[_0x88cc('0x53')]));if(_0x379565[_0x88cc('0x42')][_0x88cc('0x32')]){_0x43b5f1['where']=_[_0x88cc('0x57')](_0x43b5f1[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x43b5f1['attributes'],function(_0x319d69){var _0x12acbc={};_0x12acbc[_0x319d69]={'$like':'%'+_0x379565[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x12acbc;})});}_0x43b5f1=_[_0x88cc('0x57')]({},_0x43b5f1,_0x379565[_0x88cc('0x58')]);return _0xd39a7[_0x88cc('0xd0')](_0x43b5f1);}})[_0x88cc('0x15')](function(_0x36f153){if(_0x36f153){_0x44cf95=_0x36f153[_0x88cc('0x56')];if(!_0x379565[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x43b5f1[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x379565[_0x88cc('0x42')][_0x88cc('0x25')]);_0x43b5f1[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x379565[_0x88cc('0x42')]['offset']);}return _0xd39a7['getGroups'](_0x43b5f1);}})[_0x88cc('0x15')](function(_0x349d72){if(_0x349d72){return _0x349d72?{'count':_0x44cf95,'rows':_0x349d72}:null;}})['then'](respondWithResult(_0x2e3c45,null))[_0x88cc('0x1f')](handleError(_0x2e3c45,null));};exports[_0x88cc('0xd1')]=function(_0x4a6cb0,_0x585d53){var _0x2c1163={'raw':!![],'where':{}};var _0xa04f2e={};var _0x3f1efa={'count':0x0,'rows':[]};return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x4a6cb0[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x585d53,null))[_0x88cc('0x15')](function(_0x25160e){if(_0x25160e){_0xa04f2e[_0x88cc('0x51')]=_[_0x88cc('0x52')](db['VoiceRecording']['rawAttributes']);_0xa04f2e[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x4a6cb0['query']);_0xa04f2e['filters']=_[_0x88cc('0x54')](_0xa04f2e['model'],_0xa04f2e[_0x88cc('0x42')]);_0x2c1163[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0xa04f2e[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x4a6cb0[_0x88cc('0x42')]['fields']));_0x2c1163[_0x88cc('0x45')]=_0x2c1163[_0x88cc('0x45')][_0x88cc('0x56')]?_0x2c1163[_0x88cc('0x45')]:_0xa04f2e['model'];if(!_0x4a6cb0['query'][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x2c1163['limit']=qs[_0x88cc('0x25')](_0x4a6cb0[_0x88cc('0x42')]['limit']);_0x2c1163[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x4a6cb0[_0x88cc('0x42')][_0x88cc('0x23')]);}_0x2c1163[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x4a6cb0[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x2c1163[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x4a6cb0[_0x88cc('0x42')],_0xa04f2e[_0x88cc('0x53')]));_0x2c1163[_0x88cc('0xc3')][_0x88cc('0xd2')]=_0x25160e['id'];if(_0x4a6cb0[_0x88cc('0x42')][_0x88cc('0x32')]){_0x2c1163[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x2c1163['where'],{'$or':_[_0x88cc('0x34')](_0x2c1163[_0x88cc('0x45')],function(_0x920e1c){var _0x352561={};_0x352561[_0x920e1c]={'$like':'%'+_0x4a6cb0[_0x88cc('0x42')]['filter']+'%'};return _0x352561;})});}_0x2c1163=_[_0x88cc('0x57')]({},_0x2c1163,_0x4a6cb0['options']);return db['VoiceRecording']['count']({'where':_0x2c1163['where']})[_0x88cc('0x15')](function(_0x56bf93){_0x3f1efa[_0x88cc('0x26')]=_0x56bf93;if(_0x4a6cb0[_0x88cc('0x42')][_0x88cc('0x43')]){_0x2c1163[_0x88cc('0x44')]=[{'all':!![]}];}return db[_0x88cc('0xd3')][_0x88cc('0xa0')](_0x2c1163);})[_0x88cc('0x15')](function(_0x49bc18){_0x3f1efa[_0x88cc('0x47')]=_0x49bc18;return _0x3f1efa;});}})['then'](respondWithFilteredResult(_0x585d53,_0x2c1163))[_0x88cc('0x1f')](handleError(_0x585d53,null));};exports[_0x88cc('0xd4')]=function(_0x497288,_0x18c515){var _0x3d150d={'raw':!![],'where':{}};var _0x3f50d9={};var _0xf7b4ee={'count':0x0,'rows':[]};return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x497288[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x18c515,null))[_0x88cc('0x15')](function(_0x5451f6){if(_0x5451f6){_0x3f50d9[_0x88cc('0x51')]=_['keys'](db[_0x88cc('0xd5')][_0x88cc('0x3c')]);_0x3f50d9[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x497288[_0x88cc('0x42')]);_0x3f50d9['filters']=_['intersection'](_0x3f50d9[_0x88cc('0x51')],_0x3f50d9[_0x88cc('0x42')]);_0x3d150d[_0x88cc('0x45')]=_['intersection'](_0x3f50d9['model'],qs[_0x88cc('0x55')](_0x497288[_0x88cc('0x42')][_0x88cc('0x55')]));_0x3d150d[_0x88cc('0x45')]=_0x3d150d[_0x88cc('0x45')][_0x88cc('0x56')]?_0x3d150d['attributes']:_0x3f50d9[_0x88cc('0x51')];if(!_0x497288[_0x88cc('0x42')][_0x88cc('0xc5')]('nolimit')){_0x3d150d[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x497288[_0x88cc('0x42')][_0x88cc('0x25')]);_0x3d150d[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x497288[_0x88cc('0x42')][_0x88cc('0x23')]);}_0x3d150d[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x497288[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x3d150d[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x497288['query'],_0x3f50d9[_0x88cc('0x53')]));_0x3d150d[_0x88cc('0xc3')]['UserId']=_0x5451f6['id'];if(_0x497288[_0x88cc('0x42')][_0x88cc('0x32')]){_0x3d150d[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x3d150d[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x3d150d[_0x88cc('0x45')],function(_0x51511a){var _0x3ff6ca={};_0x3ff6ca[_0x51511a]={'$like':'%'+_0x497288[_0x88cc('0x42')]['filter']+'%'};return _0x3ff6ca;})});}_0x3d150d=_[_0x88cc('0x57')]({},_0x3d150d,_0x497288[_0x88cc('0x58')]);return db[_0x88cc('0xd5')][_0x88cc('0x26')]({'where':_0x3d150d[_0x88cc('0xc3')]})[_0x88cc('0x15')](function(_0x429ae3){_0xf7b4ee[_0x88cc('0x26')]=_0x429ae3;if(_0x497288['query']['includeAll']){_0x3d150d[_0x88cc('0x44')]=[{'all':!![]}];}return db['ScreenRecording'][_0x88cc('0xa0')](_0x3d150d);})[_0x88cc('0x15')](function(_0x2e4e6b){_0xf7b4ee[_0x88cc('0x47')]=_0x2e4e6b;return _0xf7b4ee;});}})[_0x88cc('0x15')](respondWithFilteredResult(_0x18c515,_0x3d150d))['catch'](handleError(_0x18c515,null));};exports[_0x88cc('0xd6')]=function(_0x399772,_0x390d1c){var _0x260108={};var _0x367571={};var _0x225a30;var _0x3cc604;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x399772[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x390d1c,null))[_0x88cc('0x15')](function(_0x2df660){if(_0x2df660){_0x225a30=_0x2df660;_0x367571[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0xd7')]['rawAttributes']);_0x367571[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x399772['query']);_0x367571[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x367571[_0x88cc('0x51')],_0x367571['query']);_0x260108[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x367571[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x399772[_0x88cc('0x42')][_0x88cc('0x55')]));_0x260108[_0x88cc('0x45')]=_0x260108[_0x88cc('0x45')][_0x88cc('0x56')]?_0x260108['attributes']:_0x367571[_0x88cc('0x51')];_0x260108[_0x88cc('0xc1')]=qs['sort'](_0x399772['query'][_0x88cc('0xc2')]);_0x260108[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x399772['query'],_0x367571[_0x88cc('0x53')]));if(_0x399772['query'][_0x88cc('0x32')]){_0x260108[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x260108['where'],{'$or':_[_0x88cc('0x34')](_0x260108[_0x88cc('0x45')],function(_0x117f5d){var _0x1bf7ee={};_0x1bf7ee[_0x117f5d]={'$like':'%'+_0x399772[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x1bf7ee;})});}_0x260108=_[_0x88cc('0x57')]({},_0x260108,_0x399772[_0x88cc('0x58')]);return _0x225a30[_0x88cc('0xd6')](_0x260108);}})['then'](function(_0x29c4da){if(_0x29c4da){_0x3cc604=_0x29c4da[_0x88cc('0x56')];if(!_0x399772['query'][_0x88cc('0xc5')]('nolimit')){_0x260108[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x399772[_0x88cc('0x42')][_0x88cc('0x25')]);_0x260108[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x399772['query'][_0x88cc('0x23')]);}return _0x225a30['getChatInteractions'](_0x260108);}})['then'](function(_0x8c0e2a){if(_0x8c0e2a){return _0x8c0e2a?{'count':_0x3cc604,'rows':_0x8c0e2a}:null;}})[_0x88cc('0x15')](respondWithResult(_0x390d1c,null))['catch'](handleError(_0x390d1c,null));};exports[_0x88cc('0xd8')]=function(_0x3ea7eb,_0x110a3d){var _0x214e0e={};var _0x434e83={};var _0xd523d;var _0x464cbf;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x3ea7eb['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x110a3d,null))[_0x88cc('0x15')](function(_0x301d32){if(_0x301d32){_0xd523d=_0x301d32;_0x434e83[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0xd9')]['rawAttributes']);_0x434e83['query']=_[_0x88cc('0x52')](_0x3ea7eb[_0x88cc('0x42')]);_0x434e83[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x434e83[_0x88cc('0x51')],_0x434e83[_0x88cc('0x42')]);_0x214e0e[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x434e83[_0x88cc('0x51')],qs['fields'](_0x3ea7eb[_0x88cc('0x42')][_0x88cc('0x55')]));_0x214e0e[_0x88cc('0x45')]=_0x214e0e['attributes'][_0x88cc('0x56')]?_0x214e0e['attributes']:_0x434e83[_0x88cc('0x51')];_0x214e0e[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x3ea7eb['query'][_0x88cc('0xc2')]);_0x214e0e[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x3ea7eb['query'],_0x434e83['filters']));if(_0x3ea7eb[_0x88cc('0x42')]['filter']){_0x214e0e[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x214e0e['where'],{'$or':_['map'](_0x214e0e['attributes'],function(_0x2ddec6){var _0x3384c6={};_0x3384c6[_0x2ddec6]={'$like':'%'+_0x3ea7eb[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x3384c6;})});}_0x214e0e=_[_0x88cc('0x57')]({},_0x214e0e,_0x3ea7eb[_0x88cc('0x58')]);return _0xd523d['getOpenchannelInteractions'](_0x214e0e);}})['then'](function(_0x2bae38){if(_0x2bae38){_0x464cbf=_0x2bae38['length'];if(!_0x3ea7eb[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x214e0e[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x3ea7eb['query'][_0x88cc('0x25')]);_0x214e0e['offset']=qs[_0x88cc('0x23')](_0x3ea7eb['query'][_0x88cc('0x23')]);}return _0xd523d[_0x88cc('0xd8')](_0x214e0e);}})[_0x88cc('0x15')](function(_0x108316){if(_0x108316){return _0x108316?{'count':_0x464cbf,'rows':_0x108316}:null;}})['then'](respondWithResult(_0x110a3d,null))[_0x88cc('0x1f')](handleError(_0x110a3d,null));};exports['getMailInteractions']=function(_0x3d7a74,_0x18e905){var _0x5c3ad9={'raw':!![],'where':{}};var _0x3b4b3f={};var _0x17a488={'count':0x0,'rows':[]};return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x3d7a74[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x18e905,null))[_0x88cc('0x15')](function(_0x16a388){if(_0x16a388){_0x3b4b3f[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0xda')]['rawAttributes']);_0x3b4b3f['query']=_['keys'](_0x3d7a74[_0x88cc('0x42')]);_0x3b4b3f[_0x88cc('0x53')]=_['intersection'](_0x3b4b3f['model'],_0x3b4b3f['query']);_0x5c3ad9[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x3b4b3f[_0x88cc('0x51')],qs['fields'](_0x3d7a74[_0x88cc('0x42')][_0x88cc('0x55')]));_0x5c3ad9[_0x88cc('0x45')]=_0x5c3ad9[_0x88cc('0x45')]['length']?_0x5c3ad9['attributes']:_0x3b4b3f[_0x88cc('0x51')];if(!_0x3d7a74[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x5c3ad9[_0x88cc('0x25')]=qs['limit'](_0x3d7a74['query']['limit']);_0x5c3ad9[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x3d7a74['query'][_0x88cc('0x23')]);}_0x5c3ad9['order']=qs['sort'](_0x3d7a74[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x5c3ad9[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x3d7a74[_0x88cc('0x42')],_0x3b4b3f[_0x88cc('0x53')]));_0x5c3ad9[_0x88cc('0xc3')]['UserId']=_0x16a388['id'];if(_0x3d7a74[_0x88cc('0x42')][_0x88cc('0x32')]){_0x5c3ad9['where']=_[_0x88cc('0x57')](_0x5c3ad9[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x5c3ad9['attributes'],function(_0x31d9cd){var _0x4432b5={};_0x4432b5[_0x31d9cd]={'$like':'%'+_0x3d7a74[_0x88cc('0x42')]['filter']+'%'};return _0x4432b5;})});}_0x5c3ad9=_['merge']({},_0x5c3ad9,_0x3d7a74[_0x88cc('0x58')]);return db[_0x88cc('0xda')][_0x88cc('0x26')]({'where':_0x5c3ad9['where']})[_0x88cc('0x15')](function(_0xb06e38){_0x17a488[_0x88cc('0x26')]=_0xb06e38;if(_0x3d7a74['query'][_0x88cc('0x43')]){_0x5c3ad9[_0x88cc('0x44')]=[{'all':!![]}];}return db[_0x88cc('0xda')][_0x88cc('0xa0')](_0x5c3ad9);})[_0x88cc('0x15')](function(_0x26adb2){_0x17a488[_0x88cc('0x47')]=_0x26adb2;return _0x17a488;});}})[_0x88cc('0x15')](respondWithFilteredResult(_0x18e905,_0x5c3ad9))[_0x88cc('0x1f')](handleError(_0x18e905,null));};exports[_0x88cc('0xdb')]=function(_0x4c67ad,_0x396522){var _0x130d70={};var _0x54cd5d={};var _0x48d3df;var _0x156e70;return db[_0x88cc('0x41')]['findOne']({'where':{'id':_0x4c67ad['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x396522,null))[_0x88cc('0x15')](function(_0xbf306a){if(_0xbf306a){_0x48d3df=_0xbf306a;_0x54cd5d[_0x88cc('0x51')]=_[_0x88cc('0x52')](db['SmsInteraction'][_0x88cc('0x3c')]);_0x54cd5d['query']=_[_0x88cc('0x52')](_0x4c67ad[_0x88cc('0x42')]);_0x54cd5d[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x54cd5d[_0x88cc('0x51')],_0x54cd5d['query']);_0x130d70['attributes']=_[_0x88cc('0x54')](_0x54cd5d[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x4c67ad[_0x88cc('0x42')][_0x88cc('0x55')]));_0x130d70[_0x88cc('0x45')]=_0x130d70[_0x88cc('0x45')][_0x88cc('0x56')]?_0x130d70[_0x88cc('0x45')]:_0x54cd5d[_0x88cc('0x51')];_0x130d70['order']=qs[_0x88cc('0xc2')](_0x4c67ad['query'][_0x88cc('0xc2')]);_0x130d70[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_['pick'](_0x4c67ad[_0x88cc('0x42')],_0x54cd5d[_0x88cc('0x53')]));if(_0x4c67ad[_0x88cc('0x42')][_0x88cc('0x32')]){_0x130d70['where']=_[_0x88cc('0x57')](_0x130d70[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x130d70[_0x88cc('0x45')],function(_0x4096fb){var _0xa3b0ca={};_0xa3b0ca[_0x4096fb]={'$like':'%'+_0x4c67ad[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0xa3b0ca;})});}_0x130d70=_[_0x88cc('0x57')]({},_0x130d70,_0x4c67ad[_0x88cc('0x58')]);return _0x48d3df[_0x88cc('0xdb')](_0x130d70);}})[_0x88cc('0x15')](function(_0x1b3c9f){if(_0x1b3c9f){_0x156e70=_0x1b3c9f[_0x88cc('0x56')];if(!_0x4c67ad[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x130d70[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x4c67ad['query'][_0x88cc('0x25')]);_0x130d70['offset']=qs[_0x88cc('0x23')](_0x4c67ad[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x48d3df[_0x88cc('0xdb')](_0x130d70);}})['then'](function(_0x383aa4){if(_0x383aa4){return _0x383aa4?{'count':_0x156e70,'rows':_0x383aa4}:null;}})['then'](respondWithResult(_0x396522,null))['catch'](handleError(_0x396522,null));};exports[_0x88cc('0xdc')]=function(_0x5bd4ef,_0x1c2e37){var _0xce2546={};var _0x4de276={};var _0x57a0dc;var _0x2e316d;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x5bd4ef['params']['id']}})['then'](handleEntityNotFound(_0x1c2e37,null))['then'](function(_0x4446ea){if(_0x4446ea){_0x57a0dc=_0x4446ea;_0x4de276[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0xdd')][_0x88cc('0x3c')]);_0x4de276[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x5bd4ef['query']);_0x4de276[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x4de276['model'],_0x4de276[_0x88cc('0x42')]);_0xce2546[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x4de276[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x5bd4ef['query'][_0x88cc('0x55')]));_0xce2546[_0x88cc('0x45')]=_0xce2546[_0x88cc('0x45')][_0x88cc('0x56')]?_0xce2546[_0x88cc('0x45')]:_0x4de276[_0x88cc('0x51')];_0xce2546[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x5bd4ef[_0x88cc('0x42')][_0x88cc('0xc2')]);_0xce2546[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x5bd4ef['query'],_0x4de276[_0x88cc('0x53')]));if(_0x5bd4ef[_0x88cc('0x42')][_0x88cc('0x32')]){_0xce2546['where']=_['merge'](_0xce2546[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0xce2546[_0x88cc('0x45')],function(_0x2cb3e5){var _0x4b9f85={};_0x4b9f85[_0x2cb3e5]={'$like':'%'+_0x5bd4ef[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x4b9f85;})});}_0xce2546=_[_0x88cc('0x57')]({},_0xce2546,_0x5bd4ef[_0x88cc('0x58')]);return _0x57a0dc['getFaxInteractions'](_0xce2546);}})[_0x88cc('0x15')](function(_0x3ccc1b){if(_0x3ccc1b){_0x2e316d=_0x3ccc1b[_0x88cc('0x56')];if(!_0x5bd4ef[_0x88cc('0x42')][_0x88cc('0xc5')]('nolimit')){_0xce2546[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x5bd4ef[_0x88cc('0x42')]['limit']);_0xce2546[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x5bd4ef[_0x88cc('0x42')]['offset']);}return _0x57a0dc['getFaxInteractions'](_0xce2546);}})[_0x88cc('0x15')](function(_0x53487b){if(_0x53487b){return _0x53487b?{'count':_0x2e316d,'rows':_0x53487b}:null;}})[_0x88cc('0x15')](respondWithResult(_0x1c2e37,null))[_0x88cc('0x1f')](handleError(_0x1c2e37,null));};exports[_0x88cc('0xde')]=function(_0x55dc8d,_0x589970){var _0x21aa8c={};var _0x1d5d74={};var _0x527a50;var _0x25e4e5;return db['User'][_0x88cc('0x91')]({'where':{'id':_0x55dc8d[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x589970,null))['then'](function(_0x5a4bca){if(_0x5a4bca){_0x527a50=_0x5a4bca;_0x1d5d74[_0x88cc('0x51')]=_[_0x88cc('0x52')](db['WhatsappInteraction'][_0x88cc('0x3c')]);_0x1d5d74[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x55dc8d[_0x88cc('0x42')]);_0x1d5d74[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x1d5d74[_0x88cc('0x51')],_0x1d5d74['query']);_0x21aa8c['attributes']=_[_0x88cc('0x54')](_0x1d5d74['model'],qs[_0x88cc('0x55')](_0x55dc8d[_0x88cc('0x42')][_0x88cc('0x55')]));_0x21aa8c[_0x88cc('0x45')]=_0x21aa8c[_0x88cc('0x45')][_0x88cc('0x56')]?_0x21aa8c['attributes']:_0x1d5d74[_0x88cc('0x51')];_0x21aa8c[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x55dc8d[_0x88cc('0x42')]['sort']);_0x21aa8c[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x55dc8d[_0x88cc('0x42')],_0x1d5d74[_0x88cc('0x53')]));if(_0x55dc8d[_0x88cc('0x42')]['filter']){_0x21aa8c[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x21aa8c[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x21aa8c['attributes'],function(_0x523ad0){var _0x3dfc5b={};_0x3dfc5b[_0x523ad0]={'$like':'%'+_0x55dc8d['query']['filter']+'%'};return _0x3dfc5b;})});}_0x21aa8c=_[_0x88cc('0x57')]({},_0x21aa8c,_0x55dc8d[_0x88cc('0x58')]);return _0x527a50[_0x88cc('0xde')](_0x21aa8c);}})['then'](function(_0x36e5b9){if(_0x36e5b9){_0x25e4e5=_0x36e5b9[_0x88cc('0x56')];if(!_0x55dc8d[_0x88cc('0x42')]['hasOwnProperty'](_0x88cc('0xce'))){_0x21aa8c[_0x88cc('0x25')]=qs['limit'](_0x55dc8d[_0x88cc('0x42')][_0x88cc('0x25')]);_0x21aa8c['offset']=qs[_0x88cc('0x23')](_0x55dc8d[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x527a50[_0x88cc('0xde')](_0x21aa8c);}})[_0x88cc('0x15')](function(_0x131eb8){if(_0x131eb8){return _0x131eb8?{'count':_0x25e4e5,'rows':_0x131eb8}:null;}})[_0x88cc('0x15')](respondWithResult(_0x589970,null))[_0x88cc('0x1f')](handleError(_0x589970,null));};exports['login']=function(_0x1207f0,_0x23d0b2,_0x2dcd93){var _0x3fbdb9;var _0x35f32e;var _0x5c840c;var _0x5c82cf=!_[_0x88cc('0x64')](_0x1207f0['params']['id'])?_0x1207f0['params']['id']:!_['isNil'](_0x1207f0['user']['id'])?_0x1207f0['user']['id']:null;return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x5c82cf,'role':{'$or':[_0x88cc('0x2b'),_0x88cc('0x2d'),_0x88cc('0x2f')]}},'attributes':['id',_0x88cc('0x37'),_0x88cc('0xdf'),_0x88cc('0xe0'),_0x88cc('0x2a'),_0x88cc('0x63'),_0x88cc('0xe1')]})[_0x88cc('0x15')](function(_0x50bf2b){if(_0x50bf2b){if(_0x50bf2b['role']===_0x88cc('0x2f')){_0x3fbdb9=_0x50bf2b;if(_0x1207f0[_0x88cc('0x5c')][_0x88cc('0x98')]){_0x5c840c=util['format']('LOCAL/%s@from-sip/n',_0x3fbdb9[_0x1207f0[_0x88cc('0x5c')][_0x88cc('0x98')]]);}else if(_0x1207f0[_0x88cc('0x5c')][_0x88cc('0xe2')]){_0x5c840c=util[_0x88cc('0xa2')](_0x88cc('0xe3'),_0x1207f0[_0x88cc('0x5c')][_0x88cc('0xe2')]);}else{_0x5c840c=util[_0x88cc('0xa2')](_0x88cc('0xe3'),_0x3fbdb9[_0x88cc('0x37')]);}socket['to'](util[_0x88cc('0xa2')]('user:%s',_0x3fbdb9['name']))[_0x88cc('0x9f')](_0x88cc('0xe4'),{'user':{'id':_0x3fbdb9['id'],'name':_0x3fbdb9[_0x88cc('0x37')]},'ip':_0x1207f0[_0x88cc('0xe5')][_0x88cc('0xe6')]||_0x1207f0[_0x88cc('0xe7')][_0x88cc('0xe8')]||_0x1207f0['socket'][_0x88cc('0xe8')]||_0x1207f0[_0x88cc('0xe7')]['socket'][_0x88cc('0xe8')]});return db[_0x88cc('0xa5')][_0x88cc('0x28')]({'where':{'membername':_0x3fbdb9[_0x88cc('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x88cc('0x88'))][(_0x88cc('0x8b'))](_0x88cc('0xe9'));}})['then'](function(){if(_0x3fbdb9){return _0x3fbdb9['getVoiceQueues']({'raw':!![]});}})[_0x88cc('0x15')](function(_0x12cbcb){if(_0x3fbdb9){var _0x3e42d5=[];if(_0x12cbcb){_0x35f32e=_0x12cbcb;if(_0x35f32e[_0x88cc('0x56')]){for(var _0x334ca1=0x0;_0x334ca1<_0x35f32e[_0x88cc('0x56')];_0x334ca1++){_0x3e42d5[_0x88cc('0x46')]({'membername':_0x3fbdb9['name'],'UserId':_0x3fbdb9['id'],'queue_name':_0x35f32e[_0x334ca1][_0x88cc('0x37')],'VoiceQueueId':_0x35f32e[_0x334ca1]['id'],'interface':_0x5c840c,'paused':_0x3fbdb9[_0x88cc('0xe1')]||![],'penalty':_0x35f32e[_0x334ca1][_0x88cc('0xea')]||0x0});}return BPromise['each'](_0x3e42d5,function(_0x15aeaf){return db['UserVoiceQueueRt'][_0x88cc('0xa6')](_0x15aeaf);});}}}})['then'](function(){if(_0x3fbdb9){return db['MemberReport'][_0x88cc('0xa0')]({'where':{'membername':_0x3fbdb9[_0x88cc('0x37')],'exitAt':null}});}})['then'](function(_0x1d39ac){if(_0x3fbdb9){var _0x3e148f=[];_0x1d39ac['forEach'](function(_0x3e2c09){_0x3e148f[_0x88cc('0x46')](_0x3e2c09['update']({'exitAt':moment()[_0x88cc('0xa2')](_0x88cc('0xeb'))}));});return BPromise[_0x88cc('0x4f')](_0x3e148f);}})[_0x88cc('0x15')](function(){if(_0x3fbdb9){var _0x1ee6bf=[];var _0x36dc80=[];var _0x4db6d1=utils[_0x88cc('0xec')]();var _0x2dd805={'membername':_0x3fbdb9[_0x88cc('0x37')],'interface':_0x5c840c,'enterAt':moment()[_0x88cc('0xa2')](_0x88cc('0xeb')),'role':_0x3fbdb9[_0x88cc('0x2a')],'internal':_0x3fbdb9[_0x88cc('0x63')]};_0x4db6d1['forEach'](function(_0x3e8a3d){_0x1ee6bf[_0x88cc('0x46')](_['merge']({'channel':_0x3e8a3d,'type':'LOGIN','data1':_0x1207f0[_0x88cc('0x5c')][_0x88cc('0xed')],'data2':_0x5c840c},_0x2dd805));if(_0x3fbdb9[_0x88cc('0xe1')]){_0x36dc80[_0x88cc('0x46')](_[_0x88cc('0x57')]({'channel':_0x3e8a3d,'type':_0x88cc('0xee'),'data1':_0x88cc('0xef')},_0x2dd805));}});return db[_0x88cc('0xf0')][_0x88cc('0xf1')](_0x1ee6bf[_0x88cc('0xf2')](_0x36dc80),{'individualHooks':!![]});}})[_0x88cc('0x15')](function(){if(_0x3fbdb9){return _0x3fbdb9['update']({'online':!![],'lastLoginAt':moment()[_0x88cc('0xa2')](_0x88cc('0xeb')),'voicePause':_0x3fbdb9[_0x88cc('0xe1')]||![],'mailPause':_0x3fbdb9['loginInPause']||![],'chatPause':_0x3fbdb9[_0x88cc('0xe1')]||![],'faxPause':_0x3fbdb9[_0x88cc('0xe1')]||![],'smsPause':_0x3fbdb9[_0x88cc('0xe1')]||![],'openchannelPause':_0x3fbdb9[_0x88cc('0xe1')]||![],'whatsappPause':_0x3fbdb9[_0x88cc('0xe1')]||![],'pauseType':_0x3fbdb9[_0x88cc('0xe1')]?_0x88cc('0xef'):null,'interface':_0x5c840c,'lastPauseAt':moment()[_0x88cc('0xa2')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x88cc('0x15')](function(_0x1b03f3){if(_0x1207f0[_0x88cc('0xf3')]){return _0x2dcd93();}else{return BPromise['resolve'](_0x1b03f3)[_0x88cc('0x15')](respondWithResult(_0x23d0b2,null));}})[_0x88cc('0x1f')](handleError(_0x23d0b2,null));};exports[_0x88cc('0xf4')]=function(_0x1b3f9a,_0x3a365c){var _0x48513b;return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x1b3f9a['params']['id'],'role':'agent'},'attributes':['id',_0x88cc('0x37'),_0x88cc('0x2a')]})[_0x88cc('0x15')](handleEntityNotFound(_0x3a365c,null))[_0x88cc('0x15')](function(_0x76bc2f){if(_0x76bc2f){_0x48513b=_0x76bc2f;return db[_0x88cc('0xa5')][_0x88cc('0x28')]({'where':{'membername':_0x48513b[_0x88cc('0x37')]},'individualHooks':!![]});}})[_0x88cc('0x15')](function(){return db['MemberReport'][_0x88cc('0xa0')]({'where':{'membername':_0x48513b[_0x88cc('0x37')],'exitAt':null}});})[_0x88cc('0x15')](function(_0x52d84f){var _0x189df2=[];_0x52d84f[_0x88cc('0xf5')](function(_0x4a0e75){_0x189df2[_0x88cc('0x46')](_0x4a0e75[_0x88cc('0x5b')]({'exitAt':moment()[_0x88cc('0xa2')](_0x88cc('0xeb'))}));});return BPromise['all'](_0x189df2);})[_0x88cc('0x15')](function(){return _0x48513b['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x88cc('0x15')](respondWithResult(_0x3a365c,null))['catch'](handleError(_0x3a365c,null));};exports['pause']=function(_0x518776,_0x3531af){var _0x17dc16;return db[_0x88cc('0xa5')][_0x88cc('0x5b')]({'paused':0x1},{'where':{'UserId':_0x518776[_0x88cc('0x50')]['id']},'individualHooks':!![]})[_0x88cc('0x15')](function(){return db[_0x88cc('0x41')]['find']({'where':{'id':_0x518776[_0x88cc('0x50')]['id'],'role':_0x88cc('0x2f')},'attributes':['id','name','role',_0x88cc('0x63'),'interface']});})[_0x88cc('0x15')](handleEntityNotFound(_0x3531af,null))[_0x88cc('0x15')](function(_0x53eb0f){if(_0x53eb0f){_0x17dc16=_0x53eb0f;return respondWithRpcPromise(_0x88cc('0xf6'),_0x88cc('0xf7'),{'id':_0x17dc16['id'],'name':_0x17dc16[_0x88cc('0x37')],'pause':!![]});}})['then'](function(){if(_0x17dc16){return db['MemberReport']['findAll']({'where':{'membername':_0x17dc16[_0x88cc('0x37')],'type':_0x88cc('0xee'),'exitAt':null}});}})['then'](function(_0x4deadb){if(_0x4deadb['length']){var _0x3b13a6=moment()['format'](_0x88cc('0xeb'));for(var _0xf30ed7=0x0,_0x488cb1=_0x4deadb[_0x88cc('0x56')];_0xf30ed7<_0x488cb1;_0xf30ed7++){_0x4deadb[_0xf30ed7][_0x88cc('0xf8')]({'exitAt':_0x3b13a6});}}})['then'](function(){var _0x13b0ed=[];var _0x417898=utils[_0x88cc('0xec')]();_0x417898[_0x88cc('0xf5')](function(_0x3cf61a){_0x13b0ed[_0x88cc('0x46')]({'channel':_0x3cf61a,'membername':_0x17dc16['name'],'interface':_[_0x88cc('0x64')](_0x17dc16['interface'])?util[_0x88cc('0xa2')]('SIP/%s',_0x17dc16[_0x88cc('0x37')]):_0x17dc16[_0x88cc('0x98')],'type':_0x88cc('0xee'),'enterAt':moment()['format'](_0x88cc('0xeb')),'data1':_0x518776[_0x88cc('0x5c')][_0x88cc('0xf9')]||_0x88cc('0xfa'),'role':_0x17dc16[_0x88cc('0x2a')],'internal':_0x17dc16[_0x88cc('0x63')]});});return db[_0x88cc('0xf0')][_0x88cc('0xf1')](_0x13b0ed,{'individualHooks':!![]});})[_0x88cc('0x15')](function(){return _0x17dc16[_0x88cc('0x5b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x518776['body']['type']||_0x88cc('0xfa'),'lastPauseAt':moment()['format'](_0x88cc('0xeb'))});})[_0x88cc('0x15')](respondWithResult(_0x3531af,null))[_0x88cc('0x1f')](handleError(_0x3531af,null));};exports[_0x88cc('0xfb')]=function(_0x1cd816,_0x4a9581){var _0xbf7ec5;return db[_0x88cc('0x41')]['find']({'where':{'id':_0x1cd816['params']['id']},'attributes':['id',_0x88cc('0x37'),_0x88cc('0x2a'),'voicePause',_0x88cc('0xfc'),_0x88cc('0xfd'),'faxPause',_0x88cc('0xfe'),_0x88cc('0xff'),_0x88cc('0x100'),_0x88cc('0x101'),_0x88cc('0x102')]})[_0x88cc('0x15')](handleEntityNotFound(_0x4a9581,null))[_0x88cc('0x15')](function(_0x54644d){if(_0x54644d){_0xbf7ec5=_0x54644d;if(_0x1cd816['body'][_0x88cc('0x96')]&&!utils[_0x88cc('0x99')](_0x1cd816[_0x88cc('0x5c')]['channel'])){throw new db[(_0x88cc('0x88'))][(_0x88cc('0x8b'))]('Unknown\x20channel');}switch(_0x1cd816[_0x88cc('0x5c')]['channel']){case _0x88cc('0xa1'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0xbf7ec5['id'],'name':_0xbf7ec5[_0x88cc('0x37')],'pause':![]})[_0x88cc('0x15')](function(){return db[_0x88cc('0xa5')][_0x88cc('0x5b')]({'paused':0x0},{'where':{'UserId':_0xbf7ec5['id']},'individualHooks':!![]});})['then'](function(){return db[_0x88cc('0xf0')][_0x88cc('0x5d')]({'where':{'channel':_0x1cd816[_0x88cc('0x5c')][_0x88cc('0x96')],'membername':_0xbf7ec5['name'],'type':'PAUSE','exitAt':null}});})[_0x88cc('0x15')](function(_0x20d609){if(_0x20d609){return _0x20d609['update']({'exitAt':moment()[_0x88cc('0xa2')](_0x88cc('0xeb')),'data2':_0x88cc('0x103')},{'individualHooks':!![]});}return null;})[_0x88cc('0x15')](function(){return _0xbf7ec5[_0x88cc('0x5b')]({'voicePause':![]});});case _0x88cc('0x4d'):case _0x88cc('0x4a'):case _0x88cc('0x4c'):case _0x88cc('0x59'):case _0x88cc('0x4e'):case _0x88cc('0x5a'):return db[_0x88cc('0xf0')][_0x88cc('0x5d')]({'where':{'channel':_0x1cd816[_0x88cc('0x5c')][_0x88cc('0x96')],'membername':_0xbf7ec5['name'],'type':_0x88cc('0xee'),'exitAt':null}})[_0x88cc('0x15')](function(_0x46f116){if(_0x46f116){return _0x46f116[_0x88cc('0x5b')]({'exitAt':moment()[_0x88cc('0xa2')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x3135fa={};_[_0x88cc('0x104')](_0x3135fa,util[_0x88cc('0xa2')](_0x88cc('0x105'),_0x1cd816[_0x88cc('0x5c')][_0x88cc('0x96')],_0x88cc('0x106')),![]);return _0xbf7ec5[_0x88cc('0x5b')](_0x3135fa);});default:return respondWithRpcPromise(_0x88cc('0xf6'),_0x88cc('0xfb'),{'id':_0xbf7ec5['id'],'name':_0xbf7ec5['name'],'pause':![]})[_0x88cc('0x15')](function(){return db[_0x88cc('0xa5')][_0x88cc('0x5b')]({'paused':0x0},{'where':{'UserId':_0xbf7ec5['id']}});})['then'](function(){return db[_0x88cc('0xf0')][_0x88cc('0xa0')]({'where':{'membername':_0xbf7ec5['name'],'type':_0x88cc('0xee'),'exitAt':null}});})['then'](function(_0x4d8ab7){var _0x5c9d28=[];_0x4d8ab7['forEach'](function(_0x59947b){_0x5c9d28[_0x88cc('0x46')](_0x59947b[_0x88cc('0x5b')]({'exitAt':moment()[_0x88cc('0xa2')](_0x88cc('0xeb')),'data2':_0x88cc('0x103')}));});return BPromise['all'](_0x5c9d28);})[_0x88cc('0x15')](function(){return _0xbf7ec5[_0x88cc('0x5b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x4a9581,null))[_0x88cc('0x1f')](handleError(_0x4a9581,null));};exports[_0x88cc('0x107')]=function(_0x1e32d4,_0x508f9f){var _0x2072cf={};var _0x22ae96={};var _0x1917c0;var _0x565ecd;return db['User']['findOne']({'where':{'id':_0x1e32d4['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x508f9f,null))[_0x88cc('0x15')](function(_0x3ce62e){if(_0x3ce62e){_0x1917c0=_0x3ce62e;_0x22ae96['model']=_[_0x88cc('0x52')](db['Team'][_0x88cc('0x3c')]);_0x22ae96[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x1e32d4[_0x88cc('0x42')]);_0x22ae96[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x22ae96[_0x88cc('0x51')],_0x22ae96[_0x88cc('0x42')]);_0x2072cf['attributes']=_['intersection'](_0x22ae96[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x1e32d4[_0x88cc('0x42')][_0x88cc('0x55')]));_0x2072cf[_0x88cc('0x45')]=_0x2072cf['attributes'][_0x88cc('0x56')]?_0x2072cf['attributes']:_0x22ae96[_0x88cc('0x51')];_0x2072cf[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x1e32d4[_0x88cc('0x42')]['sort']);_0x2072cf['where']=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x1e32d4[_0x88cc('0x42')],_0x22ae96[_0x88cc('0x53')]));if(_0x1e32d4[_0x88cc('0x42')][_0x88cc('0x32')]){_0x2072cf[_0x88cc('0xc3')]=_['merge'](_0x2072cf[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x2072cf[_0x88cc('0x45')],function(_0x140fef){var _0x4a4ac3={};_0x4a4ac3[_0x140fef]={'$like':'%'+_0x1e32d4['query'][_0x88cc('0x32')]+'%'};return _0x4a4ac3;})});}_0x2072cf=_['merge']({},_0x2072cf,_0x1e32d4[_0x88cc('0x58')]);return _0x1917c0['getTeams'](_0x2072cf);}})[_0x88cc('0x15')](function(_0x3f769f){if(_0x3f769f){_0x565ecd=_0x3f769f[_0x88cc('0x56')];if(!_0x1e32d4[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x2072cf[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x1e32d4[_0x88cc('0x42')][_0x88cc('0x25')]);_0x2072cf[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x1e32d4[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x1917c0[_0x88cc('0x107')](_0x2072cf);}})[_0x88cc('0x15')](function(_0x84ce22){if(_0x84ce22){return _0x84ce22?{'count':_0x565ecd,'rows':_0x84ce22}:null;}})[_0x88cc('0x15')](respondWithResult(_0x508f9f,null))['catch'](handleError(_0x508f9f,null));};exports[_0x88cc('0x108')]=function(_0x1488c0,_0x2370f6){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x1488c0[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x2370f6,null))[_0x88cc('0x15')](function(_0x214e2b){if(_0x214e2b){var _0x57069a=_0x214e2b[_0x88cc('0x29')]({'plain':!![]});return _0x214e2b[_0x88cc('0x108')](_0x1488c0[_0x88cc('0x5c')]['ids'],_[_0x88cc('0x109')](_0x1488c0[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{})['then'](function(){for(var _0x3a4244=0x0;_0x3a4244<_0x1488c0['body'][_0x88cc('0x5f')][_0x88cc('0x56')];_0x3a4244++){var _0x303447=[];db[_0x88cc('0x10a')][_0x88cc('0x91')]({'where':{'id':_0x1488c0[_0x88cc('0x5c')][_0x88cc('0x5f')][_0x3a4244]}})[_0x88cc('0x15')](function(_0x57edf2){_0x303447[_0x88cc('0x46')](_0x57edf2['getVoiceQueues']()[_0x88cc('0x15')](function(_0x2d9dba){for(var _0x25a667=0x0;_0x25a667<_0x2d9dba['length'];_0x25a667++){_0x2d9dba[_0x25a667]['setDataValue'](_0x88cc('0x96'),_0x88cc('0x10b'));}return _0x2d9dba;}));_0x303447[_0x88cc('0x46')](_0x57edf2[_0x88cc('0x10c')]()['then'](function(_0x3ca1da){for(var _0x208f57=0x0;_0x208f57<_0x3ca1da[_0x88cc('0x56')];_0x208f57++){_0x3ca1da[_0x208f57][_0x88cc('0x10d')](_0x88cc('0x96'),_0x88cc('0x10e'));}return _0x3ca1da;}));_0x303447[_0x88cc('0x46')](_0x57edf2[_0x88cc('0x10f')]()[_0x88cc('0x15')](function(_0x5845a6){for(var _0x1cd638=0x0;_0x1cd638<_0x5845a6['length'];_0x1cd638++){_0x5845a6[_0x1cd638]['setDataValue']('channel',_0x88cc('0x110'));}return _0x5845a6;}));_0x303447[_0x88cc('0x46')](_0x57edf2[_0x88cc('0x111')]()[_0x88cc('0x15')](function(_0x245e94){for(var _0x35608a=0x0;_0x35608a<_0x245e94[_0x88cc('0x56')];_0x35608a++){_0x245e94[_0x35608a][_0x88cc('0x10d')](_0x88cc('0x96'),_0x88cc('0x112'));}return _0x245e94;}));_0x303447['push'](_0x57edf2[_0x88cc('0x113')]()[_0x88cc('0x15')](function(_0x30b65c){for(var _0x20c00d=0x0;_0x20c00d<_0x30b65c[_0x88cc('0x56')];_0x20c00d++){_0x30b65c[_0x20c00d][_0x88cc('0x10d')]('channel',_0x88cc('0x114'));}return _0x30b65c;}));_0x303447['push'](_0x57edf2['getFaxQueues']()[_0x88cc('0x15')](function(_0x443c93){for(var _0x38ff8c=0x0;_0x38ff8c<_0x443c93[_0x88cc('0x56')];_0x38ff8c++){_0x443c93[_0x38ff8c][_0x88cc('0x10d')](_0x88cc('0x96'),_0x88cc('0x115'));}return _0x443c93;}));_0x303447[_0x88cc('0x46')](_0x57edf2[_0x88cc('0x116')]()['then'](function(_0x36c94f){for(var _0x156eff=0x0;_0x156eff<_0x36c94f[_0x88cc('0x56')];_0x156eff++){_0x36c94f[_0x156eff][_0x88cc('0x10d')](_0x88cc('0x96'),'Openchannel');}return _0x36c94f;}));return BPromise[_0x88cc('0x4f')](_0x303447);})[_0x88cc('0x15')](function(_0x53a101){var _0x58f743=_[_0x88cc('0x117')](_0x53a101);_0x303447=[];return db[_0x88cc('0x66')]['transaction'](function(_0x219c70){for(var _0x25435e=0x0;_0x25435e<_0x58f743[_0x88cc('0x56')];_0x25435e++){_0x303447[_0x88cc('0x46')](_0x58f743[_0x25435e]['addAgent'](_0x57069a['id']),{'transaction':_0x219c70});}return BPromise[_0x88cc('0x4f')](_0x303447)[_0x88cc('0x15')](function(){if(_0x57069a['online']){return BPromise['each'](_[_0x88cc('0x32')](_0x58f743,function(_0x181342){return _0x181342['getDataValue']('channel')===_0x88cc('0x10b');}),function(_0x3a6bba){return db[_0x88cc('0xa5')][_0x88cc('0xa6')]({'membername':_0x57069a[_0x88cc('0x37')],'UserId':_0x57069a['id'],'queue_name':_0x3a6bba[_0x88cc('0x37')],'VoiceQueueId':_0x3a6bba['id'],'interface':_['isNil'](_0x57069a[_0x88cc('0x98')])?util[_0x88cc('0xa2')](_0x88cc('0xe3'),_0x57069a[_0x88cc('0x37')]):_0x57069a[_0x88cc('0x98')],'paused':_0x57069a[_0x88cc('0xa3')]||![],'penalty':_0x57069a['penalty']},{'transaction':_0x219c70});});}else{return;}})['then'](function(){for(var _0x1db0f3=0x0;_0x1db0f3<_0x58f743[_0x88cc('0x56')];_0x1db0f3++){var _0x5a6a9a=_0x58f743[_0x1db0f3][_0x88cc('0x118')](_0x88cc('0x96'));var _0x3c1452=_0x5a6a9a+_0x88cc('0x9e');socket['emit'](_0x88cc('0x2d')+_0x5a6a9a+_0x88cc('0x119'),{'UserId':_0x57069a['id'],['queueField']:_0x58f743[_0x1db0f3]['id']});}});});});}});}})[_0x88cc('0x15')](respondWithStatusCode(_0x2370f6,null))[_0x88cc('0x1f')](handleError(_0x2370f6,null));};exports[_0x88cc('0x11a')]=function(_0x1b1c3a,_0x37a6da){return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x1b1c3a[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x37a6da,null))['then'](function(_0x459c93){if(_0x459c93){var _0x3c5171=_0x459c93['get']({'plain':!![]});var _0x3ee36d=_0x1b1c3a['query']['ids'];return _0x459c93['removeTeams'](_0x3ee36d)[_0x88cc('0x15')](function(){for(var _0x34f65b=0x0;_0x34f65b<_0x3ee36d[_0x88cc('0x56')];_0x34f65b++){var _0x1523b8=[];db['Team'][_0x88cc('0x91')]({'where':{'id':_0x3ee36d[_0x34f65b]}})[_0x88cc('0x15')](function(_0x103724){_0x1523b8['push'](_0x103724['getVoiceQueues']()[_0x88cc('0x15')](function(_0x4659e8){for(var _0x3879e5=0x0;_0x3879e5<_0x4659e8[_0x88cc('0x56')];_0x3879e5++){_0x4659e8[_0x3879e5]['setDataValue']('channel',_0x88cc('0x10b'));}return _0x4659e8;}));_0x1523b8[_0x88cc('0x46')](_0x103724[_0x88cc('0x10c')]()[_0x88cc('0x15')](function(_0x30e6ef){for(var _0x345478=0x0;_0x345478<_0x30e6ef[_0x88cc('0x56')];_0x345478++){_0x30e6ef[_0x345478][_0x88cc('0x10d')](_0x88cc('0x96'),'Chat');}return _0x30e6ef;}));_0x1523b8[_0x88cc('0x46')](_0x103724[_0x88cc('0x10f')]()[_0x88cc('0x15')](function(_0x478b46){for(var _0x59fc39=0x0;_0x59fc39<_0x478b46[_0x88cc('0x56')];_0x59fc39++){_0x478b46[_0x59fc39][_0x88cc('0x10d')](_0x88cc('0x96'),_0x88cc('0x110'));}return _0x478b46;}));_0x1523b8[_0x88cc('0x46')](_0x103724[_0x88cc('0x111')]()['then'](function(_0x36024d){for(var _0x49d7c9=0x0;_0x49d7c9<_0x36024d['length'];_0x49d7c9++){_0x36024d[_0x49d7c9]['setDataValue'](_0x88cc('0x96'),_0x88cc('0x112'));}return _0x36024d;}));_0x1523b8[_0x88cc('0x46')](_0x103724[_0x88cc('0x113')]()[_0x88cc('0x15')](function(_0x314599){for(var _0x234db4=0x0;_0x234db4<_0x314599[_0x88cc('0x56')];_0x234db4++){_0x314599[_0x234db4][_0x88cc('0x10d')](_0x88cc('0x96'),'Whatsapp');}return _0x314599;}));_0x1523b8[_0x88cc('0x46')](_0x103724[_0x88cc('0x11b')]()['then'](function(_0x50666d){for(var _0x4d4b38=0x0;_0x4d4b38<_0x50666d[_0x88cc('0x56')];_0x4d4b38++){_0x50666d[_0x4d4b38][_0x88cc('0x10d')]('channel',_0x88cc('0x115'));}return _0x50666d;}));_0x1523b8[_0x88cc('0x46')](_0x103724[_0x88cc('0x116')]()['then'](function(_0xca1695){for(var _0x2a50b8=0x0;_0x2a50b8<_0xca1695['length'];_0x2a50b8++){_0xca1695[_0x2a50b8][_0x88cc('0x10d')](_0x88cc('0x96'),'Openchannel');}return _0xca1695;}));return BPromise['all'](_0x1523b8);})[_0x88cc('0x15')](function(_0xaa960){var _0xb76868=_['flatten'](_0xaa960);_0x1523b8=[];return db[_0x88cc('0x66')][_0x88cc('0x11c')](function(_0x161bf4){for(var _0x9e655=0x0;_0x9e655<_0xb76868[_0x88cc('0x56')];_0x9e655++){_0x1523b8[_0x88cc('0x46')](_0xb76868[_0x9e655][_0x88cc('0x11d')](_0x3c5171['id']),{'transaction':_0x161bf4});}return BPromise[_0x88cc('0x4f')](_0x1523b8)['then'](function(){if(_0x3c5171[_0x88cc('0x97')]){return BPromise['each'](_['filter'](_0xb76868,function(_0x4e5853){return _0x4e5853['getDataValue']('channel')===_0x88cc('0x10b');}),function(_0x2eba5f){return db[_0x88cc('0xa5')][_0x88cc('0x28')]({'where':{'VoiceQueueId':_0x2eba5f['id'],'UserId':_0x3c5171['id']},'transaction':_0x161bf4});});}else{return;}})['then'](function(){for(var _0x489975=0x0;_0x489975<_0xb76868[_0x88cc('0x56')];_0x489975++){var _0x1c5969=_0xb76868[_0x489975]['getDataValue'](_0x88cc('0x96'));var _0x790b02=_0x1c5969+_0x88cc('0x9e');socket[_0x88cc('0x9f')](_0x88cc('0x2d')+_0x1c5969+_0x88cc('0xab'),{'UserId':_0x3c5171['id'],['queueField']:_0xb76868[_0x489975]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x37a6da,null))[_0x88cc('0x1f')](handleError(_0x37a6da,null));};exports[_0x88cc('0x11e')]=function(_0x512a76,_0x457857){var _0x809fe={};var _0x2af8c9={};var _0x228ffe;var _0x555db9;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x512a76['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x457857,null))[_0x88cc('0x15')](function(_0x450ecc){if(_0x450ecc){_0x228ffe=_0x450ecc;_0x2af8c9[_0x88cc('0x51')]=_[_0x88cc('0x52')](db['CmList'][_0x88cc('0x3c')]);_0x2af8c9[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x512a76[_0x88cc('0x42')]);_0x2af8c9['filters']=_[_0x88cc('0x54')](_0x2af8c9[_0x88cc('0x51')],_0x2af8c9[_0x88cc('0x42')]);_0x809fe[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x2af8c9[_0x88cc('0x51')],qs['fields'](_0x512a76[_0x88cc('0x42')][_0x88cc('0x55')]));_0x809fe[_0x88cc('0x45')]=_0x809fe[_0x88cc('0x45')]['length']?_0x809fe[_0x88cc('0x45')]:_0x2af8c9[_0x88cc('0x51')];_0x809fe['order']=qs[_0x88cc('0xc2')](_0x512a76[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x809fe[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x512a76[_0x88cc('0x42')],_0x2af8c9[_0x88cc('0x53')]));if(_0x512a76[_0x88cc('0x42')][_0x88cc('0x32')]){_0x809fe[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x809fe[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x809fe[_0x88cc('0x45')],function(_0x433b1c){var _0x355378={};_0x355378[_0x433b1c]={'$like':'%'+_0x512a76[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x355378;})});}_0x809fe=_[_0x88cc('0x57')]({},_0x809fe,_0x512a76[_0x88cc('0x58')]);return _0x228ffe[_0x88cc('0x11e')](_0x809fe);}})['then'](function(_0x515cbe){if(_0x515cbe){_0x555db9=_0x515cbe['length'];if(!_0x512a76['query'][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x809fe[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x512a76['query'][_0x88cc('0x25')]);_0x809fe[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x512a76[_0x88cc('0x42')]['offset']);}return _0x228ffe[_0x88cc('0x11e')](_0x809fe);}})[_0x88cc('0x15')](function(_0x11439c){if(_0x11439c){return _0x11439c?{'count':_0x555db9,'rows':_0x11439c}:null;}})['then'](respondWithResult(_0x457857,null))[_0x88cc('0x1f')](handleError(_0x457857,null));};exports[_0x88cc('0x11f')]=function(_0x3664d7,_0x28602d){var _0x113eba={};var _0x3ac2de={};var _0x4216f4;var _0x4c49b6;return db['User']['findOne']({'where':{'id':_0x3664d7['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x28602d,null))['then'](function(_0x3278ee){if(_0x3278ee){_0x4216f4=_0x3278ee;_0x3ac2de[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x41')]['rawAttributes']);_0x3ac2de[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x3664d7[_0x88cc('0x42')]);_0x3ac2de[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x3ac2de[_0x88cc('0x51')],_0x3ac2de[_0x88cc('0x42')]);_0x113eba['attributes']=_[_0x88cc('0x54')](_0x3ac2de['model'],qs[_0x88cc('0x55')](_0x3664d7[_0x88cc('0x42')][_0x88cc('0x55')]));_0x113eba[_0x88cc('0x45')]=_0x113eba[_0x88cc('0x45')]['length']?_0x113eba[_0x88cc('0x45')]:_0x3ac2de[_0x88cc('0x51')];_0x113eba[_0x88cc('0xc1')]=qs['sort'](_0x3664d7[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x113eba['where']=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x3664d7[_0x88cc('0x42')],_0x3ac2de[_0x88cc('0x53')]));if(_0x3664d7[_0x88cc('0x42')]['filter']){_0x113eba['where']=_['merge'](_0x113eba[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x113eba[_0x88cc('0x45')],function(_0x1e2504){var _0x532854={};_0x532854[_0x1e2504]={'$like':'%'+_0x3664d7[_0x88cc('0x42')]['filter']+'%'};return _0x532854;})});}_0x113eba['model']=db[_0x88cc('0x41')];_0x113eba['as']=_0x88cc('0x2e');_0x113eba=_[_0x88cc('0x57')]({},_0x113eba,_0x3664d7['options']);return _0x4216f4[_0x88cc('0x120')]({'include':[_0x113eba]});}})[_0x88cc('0x15')](function(_0x2ccfbe){if(_0x2ccfbe){var _0x49086b={},_0x48bf3e=[],_0x4d6e69=0x0;for(var _0x86204f=0x0;_0x86204f<_0x2ccfbe[_0x88cc('0x56')];_0x86204f+=0x1){for(var _0xa08a81=0x0,_0x4882da;_0xa08a81<_0x2ccfbe[_0x86204f][_0x88cc('0x2e')][_0x88cc('0x56')];_0xa08a81+=0x1){_0x4882da=_0x2ccfbe[_0x86204f]['Agents'][_0xa08a81][_0x88cc('0x29')]({'plain':!![]});_0x49086b[_0x4882da['id']]=_0x4882da;}}_0x49086b=_['values'](_0x49086b);for(var _0x550a7a=qs[_0x88cc('0x23')](_0x3664d7[_0x88cc('0x42')][_0x88cc('0x23')]);_0x550a7a<_0x49086b[_0x88cc('0x56')]&&_0x48bf3e['length']<qs[_0x88cc('0x25')](_0x3664d7[_0x88cc('0x42')][_0x88cc('0x25')]);_0x550a7a+=0x1){if(_0x49086b[_0x550a7a]){_0x48bf3e[_0x88cc('0x46')](_0x49086b[_0x550a7a]);}}return{'count':_0x49086b[_0x88cc('0x56')],'rows':_0x48bf3e};}})[_0x88cc('0x15')](respondWithResult(_0x28602d,null))['catch'](handleError(_0x28602d,null));};exports[_0x88cc('0x28')]=function(_0x4c7abe,_0x515ae2){if(_0x4c7abe['user']['id']==_0x4c7abe[_0x88cc('0x50')]['id']){return _0x515ae2[_0x88cc('0x21')](0x1f4)['send']({'message':_0x88cc('0x121')});}return db[_0x88cc('0x41')]['find']({'where':{'id':_0x4c7abe[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x515ae2,null))[_0x88cc('0x15')](removeEntity(_0x515ae2,null))[_0x88cc('0x1f')](handleError(_0x515ae2,null));};exports['addChatInteractions']=function(_0x1dda1e,_0x4c182f){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x1dda1e[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x4c182f,null))[_0x88cc('0x15')](function(_0x38093e){if(_0x38093e){return _0x38093e[_0x88cc('0x122')](_0x1dda1e['body']['ids'],_['omit'](_0x1dda1e[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{})[_0x88cc('0x123')](function(){for(var _0x3b53f2=0x0;_0x3b53f2<_0x1dda1e['body'][_0x88cc('0x5f')][_0x88cc('0x56')];_0x3b53f2+=0x1){socket['emit']('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x1dda1e['body'][_0x88cc('0x5f')][_0x3b53f2]),'UserId':Number(_0x1dda1e['params']['id'])});}return _0x1dda1e[_0x88cc('0x5c')][_0x88cc('0x5f')];});}})[_0x88cc('0x15')](respondWithResult(_0x4c182f,null))['catch'](handleError(_0x4c182f,null));};exports['removeChatInteractions']=function(_0x29fcda,_0x56d8af){return db[_0x88cc('0x41')]['find']({'where':{'id':_0x29fcda[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x56d8af,null))[_0x88cc('0x15')](function(_0x20ca30){if(_0x20ca30){return _0x20ca30[_0x88cc('0x124')](_0x29fcda[_0x88cc('0x42')][_0x88cc('0x5f')])[_0x88cc('0x15')](function(){if(_[_0x88cc('0xaa')](_0x29fcda[_0x88cc('0x42')][_0x88cc('0x5f')])){for(var _0x2e303c=0x0;_0x2e303c<_0x29fcda['query'][_0x88cc('0x5f')][_0x88cc('0x56')];_0x2e303c+=0x1){socket['emit'](_0x88cc('0x125'),{'ChatInteractionId':Number(_0x29fcda[_0x88cc('0x42')][_0x88cc('0x5f')][_0x2e303c]),'UserId':Number(_0x29fcda[_0x88cc('0x50')]['id'])});}}else{socket[_0x88cc('0x9f')](_0x88cc('0x125'),{'ChatInteractionId':Number(_0x29fcda[_0x88cc('0x42')]['ids']),'UserId':Number(_0x29fcda['params']['id'])});}});}})[_0x88cc('0x15')](respondWithStatusCode(_0x56d8af,null))[_0x88cc('0x1f')](handleError(_0x56d8af,null));};exports[_0x88cc('0x126')]=function(_0x57764f,_0x33cfbd){return db['User'][_0x88cc('0x5d')]({'where':{'id':_0x57764f['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x33cfbd,null))['then'](function(_0x447861){if(_0x447861){return _0x447861[_0x88cc('0x126')](_0x57764f[_0x88cc('0x5c')][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x57764f[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{})[_0x88cc('0x123')](function(){for(var _0x21b795=0x0;_0x21b795<_0x57764f[_0x88cc('0x5c')][_0x88cc('0x5f')][_0x88cc('0x56')];_0x21b795+=0x1){socket['emit'](_0x88cc('0x127'),{'MailInteractionId':Number(_0x57764f['body'][_0x88cc('0x5f')][_0x21b795]),'UserId':Number(_0x57764f['params']['id'])});}return _0x57764f['body'][_0x88cc('0x5f')];});}})['then'](respondWithResult(_0x33cfbd,null))[_0x88cc('0x1f')](handleError(_0x33cfbd,null));};exports[_0x88cc('0x128')]=function(_0xe59e19,_0x17f026){return db['User'][_0x88cc('0x5d')]({'where':{'id':_0xe59e19[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x17f026,null))[_0x88cc('0x15')](function(_0x1543ec){if(_0x1543ec){return _0x1543ec[_0x88cc('0x128')](_0xe59e19[_0x88cc('0x42')]['ids'])[_0x88cc('0x15')](function(){if(_[_0x88cc('0xaa')](_0xe59e19[_0x88cc('0x42')][_0x88cc('0x5f')])){for(var _0x1a9dca=0x0;_0x1a9dca<_0xe59e19['query']['ids'][_0x88cc('0x56')];_0x1a9dca+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x129'),{'MailInteractionId':Number(_0xe59e19[_0x88cc('0x42')][_0x88cc('0x5f')][_0x1a9dca]),'UserId':Number(_0xe59e19[_0x88cc('0x50')]['id'])});}}else{socket[_0x88cc('0x9f')](_0x88cc('0x129'),{'MailInteractionId':Number(_0xe59e19[_0x88cc('0x42')][_0x88cc('0x5f')]),'UserId':Number(_0xe59e19[_0x88cc('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x17f026,null))[_0x88cc('0x1f')](handleError(_0x17f026,null));};exports[_0x88cc('0x12a')]=function(_0x4ccfae,_0x32598e){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x4ccfae[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x32598e,null))[_0x88cc('0x15')](function(_0x3c4631){if(_0x3c4631){return _0x3c4631[_0x88cc('0x12a')](_0x4ccfae[_0x88cc('0x5c')][_0x88cc('0x5f')],_['omit'](_0x4ccfae['body'],[_0x88cc('0x5f'),'id'])||{})['spread'](function(){for(var _0x50461e=0x0;_0x50461e<_0x4ccfae[_0x88cc('0x5c')][_0x88cc('0x5f')][_0x88cc('0x56')];_0x50461e+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x12b'),{'FaxInteractionId':Number(_0x4ccfae[_0x88cc('0x5c')][_0x88cc('0x5f')][_0x50461e]),'UserId':Number(_0x4ccfae[_0x88cc('0x50')]['id'])});}return _0x4ccfae[_0x88cc('0x5c')][_0x88cc('0x5f')];});}})['then'](respondWithResult(_0x32598e,null))[_0x88cc('0x1f')](handleError(_0x32598e,null));};exports[_0x88cc('0x12c')]=function(_0x231daf,_0x517a0b){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x231daf[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x517a0b,null))[_0x88cc('0x15')](function(_0x348df3){if(_0x348df3){return _0x348df3[_0x88cc('0x12c')](_0x231daf[_0x88cc('0x42')][_0x88cc('0x5f')])[_0x88cc('0x15')](function(){if(_[_0x88cc('0xaa')](_0x231daf[_0x88cc('0x42')][_0x88cc('0x5f')])){for(var _0x2f1b9d=0x0;_0x2f1b9d<_0x231daf[_0x88cc('0x42')]['ids'][_0x88cc('0x56')];_0x2f1b9d+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x12d'),{'FaxInteractionId':Number(_0x231daf[_0x88cc('0x42')]['ids'][_0x2f1b9d]),'UserId':Number(_0x231daf['params']['id'])});}}else{socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x231daf[_0x88cc('0x42')]['ids']),'UserId':Number(_0x231daf['params']['id'])});}});}})[_0x88cc('0x15')](respondWithStatusCode(_0x517a0b,null))['catch'](handleError(_0x517a0b,null));};exports[_0x88cc('0x12e')]=function(_0x15c471,_0x1f2165){return db['User']['find']({'where':{'id':_0x15c471[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f2165,null))['then'](function(_0x11bb95){if(_0x11bb95){return _0x11bb95[_0x88cc('0x12e')](_0x15c471[_0x88cc('0x5c')]['ids'],_[_0x88cc('0x109')](_0x15c471[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{})[_0x88cc('0x123')](function(){for(var _0x4817b1=0x0;_0x4817b1<_0x15c471['body']['ids'][_0x88cc('0x56')];_0x4817b1+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x12f'),{'SmsInteractionId':Number(_0x15c471[_0x88cc('0x5c')][_0x88cc('0x5f')][_0x4817b1]),'UserId':Number(_0x15c471['params']['id'])});}return _0x15c471[_0x88cc('0x5c')][_0x88cc('0x5f')];});}})['then'](respondWithResult(_0x1f2165,null))['catch'](handleError(_0x1f2165,null));};exports[_0x88cc('0x130')]=function(_0x24a6c3,_0x13ff0b){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x24a6c3[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x13ff0b,null))['then'](function(_0x170cf1){if(_0x170cf1){return _0x170cf1[_0x88cc('0x130')](_0x24a6c3['query'][_0x88cc('0x5f')])[_0x88cc('0x15')](function(){if(_[_0x88cc('0xaa')](_0x24a6c3[_0x88cc('0x42')][_0x88cc('0x5f')])){for(var _0x14f0d6=0x0;_0x14f0d6<_0x24a6c3[_0x88cc('0x42')][_0x88cc('0x5f')][_0x88cc('0x56')];_0x14f0d6+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x131'),{'SmsInteractionId':Number(_0x24a6c3[_0x88cc('0x42')][_0x88cc('0x5f')][_0x14f0d6]),'UserId':Number(_0x24a6c3['params']['id'])});}}else{socket[_0x88cc('0x9f')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x24a6c3[_0x88cc('0x42')]['ids']),'UserId':Number(_0x24a6c3['params']['id'])});}});}})[_0x88cc('0x15')](respondWithStatusCode(_0x13ff0b,null))[_0x88cc('0x1f')](handleError(_0x13ff0b,null));};exports[_0x88cc('0x132')]=function(_0x5de751,_0x2918bf){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x5de751['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x2918bf,null))[_0x88cc('0x15')](function(_0x463839){if(_0x463839){return _0x463839[_0x88cc('0x132')](_0x5de751[_0x88cc('0x5c')]['ids'],_[_0x88cc('0x109')](_0x5de751[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{})[_0x88cc('0x123')](function(){for(var _0x47eaf7=0x0;_0x47eaf7<_0x5de751[_0x88cc('0x5c')][_0x88cc('0x5f')][_0x88cc('0x56')];_0x47eaf7+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x133'),{'OpenchannelInteractionId':Number(_0x5de751[_0x88cc('0x5c')]['ids'][_0x47eaf7]),'UserId':Number(_0x5de751['params']['id'])});}return _0x5de751['body'][_0x88cc('0x5f')];});}})[_0x88cc('0x15')](respondWithResult(_0x2918bf,null))[_0x88cc('0x1f')](handleError(_0x2918bf,null));};exports['removeOpenchannelInteractions']=function(_0x56052c,_0x3150f6){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x56052c['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x3150f6,null))['then'](function(_0x2ac4f9){if(_0x2ac4f9){return _0x2ac4f9[_0x88cc('0x134')](_0x56052c[_0x88cc('0x42')][_0x88cc('0x5f')])[_0x88cc('0x15')](function(){if(_[_0x88cc('0xaa')](_0x56052c['query'][_0x88cc('0x5f')])){for(var _0x3644ab=0x0;_0x3644ab<_0x56052c[_0x88cc('0x42')][_0x88cc('0x5f')][_0x88cc('0x56')];_0x3644ab+=0x1){socket[_0x88cc('0x9f')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x56052c[_0x88cc('0x42')][_0x88cc('0x5f')][_0x3644ab]),'UserId':Number(_0x56052c[_0x88cc('0x50')]['id'])});}}else{socket[_0x88cc('0x9f')](_0x88cc('0x135'),{'OpenchannelInteractionId':Number(_0x56052c[_0x88cc('0x42')][_0x88cc('0x5f')]),'UserId':Number(_0x56052c[_0x88cc('0x50')]['id'])});}});}})[_0x88cc('0x15')](respondWithStatusCode(_0x3150f6,null))[_0x88cc('0x1f')](handleError(_0x3150f6,null));};exports[_0x88cc('0x136')]=function(_0x590d10,_0x4efdb4){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x590d10['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x4efdb4,null))[_0x88cc('0x15')](function(_0x1c60ab){if(_0x1c60ab){return _0x1c60ab[_0x88cc('0x136')](_0x590d10['body'][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x590d10[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{})[_0x88cc('0x123')](function(){for(var _0x2c8b13=0x0;_0x2c8b13<_0x590d10[_0x88cc('0x5c')]['ids']['length'];_0x2c8b13+=0x1){socket[_0x88cc('0x9f')](_0x88cc('0x137'),{'WhatsappInteractionId':Number(_0x590d10['body'][_0x88cc('0x5f')][_0x2c8b13]),'UserId':Number(_0x590d10[_0x88cc('0x50')]['id'])});}return _0x590d10[_0x88cc('0x5c')][_0x88cc('0x5f')];});}})['then'](respondWithResult(_0x4efdb4,null))[_0x88cc('0x1f')](handleError(_0x4efdb4,null));};exports[_0x88cc('0x138')]=function(_0x553fd5,_0x17bce4){return db['User']['find']({'where':{'id':_0x553fd5['params']['id']}})['then'](handleEntityNotFound(_0x17bce4,null))['then'](function(_0x3ee3ad){if(_0x3ee3ad){return _0x3ee3ad['removeWhatsappInteractions'](_0x553fd5[_0x88cc('0x42')][_0x88cc('0x5f')]);}})[_0x88cc('0x15')](respondWithStatusCode(_0x17bce4,null))[_0x88cc('0x1f')](handleError(_0x17bce4,null));};exports[_0x88cc('0x139')]=function(_0x1e6c01,_0x5f1fe1){var _0x5bf8da={};var _0x9ee05b={};var _0x3c638d;var _0x4573e6;return db['User'][_0x88cc('0x91')]({'where':{'id':_0x1e6c01[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x5f1fe1,null))['then'](function(_0x1030c5){if(_0x1030c5){_0x3c638d=_0x1030c5;_0x9ee05b[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x13a')]['rawAttributes']);_0x9ee05b[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x1e6c01[_0x88cc('0x42')]);_0x9ee05b[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x9ee05b[_0x88cc('0x51')],_0x9ee05b[_0x88cc('0x42')]);_0x5bf8da['attributes']=_[_0x88cc('0x54')](_0x9ee05b[_0x88cc('0x51')],qs['fields'](_0x1e6c01[_0x88cc('0x42')][_0x88cc('0x55')]));_0x5bf8da[_0x88cc('0x45')]=_0x5bf8da[_0x88cc('0x45')][_0x88cc('0x56')]?_0x5bf8da['attributes']:_0x9ee05b[_0x88cc('0x51')];_0x5bf8da[_0x88cc('0xc1')]=qs['sort'](_0x1e6c01['query']['sort']);_0x5bf8da[_0x88cc('0xc3')]=qs['filters'](_[_0x88cc('0xc4')](_0x1e6c01[_0x88cc('0x42')],_0x9ee05b['filters']));if(_0x1e6c01[_0x88cc('0x42')][_0x88cc('0x32')]){_0x5bf8da[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x5bf8da[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x5bf8da[_0x88cc('0x45')],function(_0x5388be){var _0x58ab2f={};_0x58ab2f[_0x5388be]={'$like':'%'+_0x1e6c01[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x58ab2f;})});}_0x5bf8da=_[_0x88cc('0x57')]({},_0x5bf8da,_0x1e6c01[_0x88cc('0x58')]);return _0x3c638d[_0x88cc('0x139')](_0x5bf8da);}})[_0x88cc('0x15')](function(_0x28b06f){if(_0x28b06f){_0x4573e6=_0x28b06f[_0x88cc('0x56')];if(!_0x1e6c01[_0x88cc('0x42')]['hasOwnProperty']('nolimit')){_0x5bf8da['limit']=qs[_0x88cc('0x25')](_0x1e6c01[_0x88cc('0x42')][_0x88cc('0x25')]);_0x5bf8da[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x1e6c01['query']['offset']);}return _0x3c638d[_0x88cc('0x139')](_0x5bf8da);}})[_0x88cc('0x15')](function(_0x264533){if(_0x264533){return _0x264533?{'count':_0x4573e6,'rows':_0x264533}:null;}})[_0x88cc('0x15')](respondWithResult(_0x5f1fe1,null))[_0x88cc('0x1f')](handleError(_0x5f1fe1,null));};exports[_0x88cc('0x13b')]=function(_0x46472e,_0x371feb){var _0x268321={};var _0x13584e={};var _0x419996;var _0x12ae6d;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x46472e[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x371feb,null))[_0x88cc('0x15')](function(_0x360bdf){if(_0x360bdf){_0x419996=_0x360bdf;_0x13584e[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x13c')][_0x88cc('0x3c')]);_0x13584e[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x46472e[_0x88cc('0x42')]);_0x13584e[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x13584e[_0x88cc('0x51')],_0x13584e[_0x88cc('0x42')]);_0x268321['attributes']=_[_0x88cc('0x54')](_0x13584e[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x46472e[_0x88cc('0x42')][_0x88cc('0x55')]));_0x268321[_0x88cc('0x45')]=_0x268321[_0x88cc('0x45')][_0x88cc('0x56')]?_0x268321['attributes']:_0x13584e[_0x88cc('0x51')];_0x268321[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x46472e[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x268321['where']=qs[_0x88cc('0x53')](_['pick'](_0x46472e[_0x88cc('0x42')],_0x13584e[_0x88cc('0x53')]));if(_0x46472e[_0x88cc('0x42')]['filter']){_0x268321[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x268321['where'],{'$or':_['map'](_0x268321['attributes'],function(_0x5dbd61){var _0x48ba7b={};_0x48ba7b[_0x5dbd61]={'$like':'%'+_0x46472e[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x48ba7b;})});}_0x268321=_[_0x88cc('0x57')]({},_0x268321,_0x46472e['options']);return _0x419996[_0x88cc('0x13b')](_0x268321);}})[_0x88cc('0x15')](function(_0x896ffd){if(_0x896ffd){_0x12ae6d=_0x896ffd[_0x88cc('0x56')];if(!_0x46472e[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x268321['limit']=qs[_0x88cc('0x25')](_0x46472e[_0x88cc('0x42')][_0x88cc('0x25')]);_0x268321[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x46472e['query']['offset']);}return _0x419996['getFaxAccounts'](_0x268321);}})['then'](function(_0x1da63f){if(_0x1da63f){return _0x1da63f?{'count':_0x12ae6d,'rows':_0x1da63f}:null;}})['then'](respondWithResult(_0x371feb,null))[_0x88cc('0x1f')](handleError(_0x371feb,null));};exports['addFaxAccounts']=function(_0x5455f5,_0x4e0f9f){return db['User'][_0x88cc('0x5d')]({'where':{'id':_0x5455f5[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x4e0f9f,null))[_0x88cc('0x15')](function(_0x2b0a3){if(_0x2b0a3){return _0x2b0a3[_0x88cc('0x13d')](_0x5455f5[_0x88cc('0x5c')]['ids'],_[_0x88cc('0x109')](_0x5455f5[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{});}})[_0x88cc('0x15')](respondWithResult(_0x4e0f9f,null))['catch'](handleError(_0x4e0f9f,null));};exports[_0x88cc('0x13e')]=function(_0x2a1b36,_0x5447ec){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x2a1b36[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x5447ec,null))[_0x88cc('0x15')](function(_0x57c406){if(_0x57c406){return _0x57c406['removeFaxAccounts'](_0x2a1b36[_0x88cc('0x42')]['ids']);}})[_0x88cc('0x15')](respondWithStatusCode(_0x5447ec,null))[_0x88cc('0x1f')](handleError(_0x5447ec,null));};exports[_0x88cc('0x13f')]=function(_0x48fd33,_0x27e8df){var _0x26e363={};var _0x39cc03={};var _0x5d037f;var _0x5ebb6f;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x48fd33[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x27e8df,null))[_0x88cc('0x15')](function(_0x4fa8d0){if(_0x4fa8d0){_0x5d037f=_0x4fa8d0;_0x39cc03['model']=_[_0x88cc('0x52')](db['MailAccount'][_0x88cc('0x3c')]);_0x39cc03[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x48fd33[_0x88cc('0x42')]);_0x39cc03[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x39cc03[_0x88cc('0x51')],_0x39cc03['query']);_0x26e363[_0x88cc('0x45')]=_['intersection'](_0x39cc03[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x48fd33[_0x88cc('0x42')]['fields']));_0x26e363[_0x88cc('0x45')]=_0x26e363[_0x88cc('0x45')][_0x88cc('0x56')]?_0x26e363[_0x88cc('0x45')]:_0x39cc03['model'];_0x26e363[_0x88cc('0xc1')]=qs['sort'](_0x48fd33['query'][_0x88cc('0xc2')]);_0x26e363[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_['pick'](_0x48fd33[_0x88cc('0x42')],_0x39cc03[_0x88cc('0x53')]));if(_0x48fd33[_0x88cc('0x42')][_0x88cc('0x32')]){_0x26e363[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x26e363['where'],{'$or':_[_0x88cc('0x34')](_0x26e363[_0x88cc('0x45')],function(_0x4988f0){var _0x206347={};_0x206347[_0x4988f0]={'$like':'%'+_0x48fd33[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x206347;})});}_0x26e363=_['merge']({},_0x26e363,_0x48fd33[_0x88cc('0x58')]);return _0x5d037f[_0x88cc('0x13f')](_0x26e363);}})['then'](function(_0x2d180d){if(_0x2d180d){_0x5ebb6f=_0x2d180d[_0x88cc('0x56')];if(!_0x48fd33[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x26e363['limit']=qs[_0x88cc('0x25')](_0x48fd33[_0x88cc('0x42')][_0x88cc('0x25')]);_0x26e363[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x48fd33[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x5d037f['getMailAccounts'](_0x26e363);}})[_0x88cc('0x15')](function(_0x435d11){if(_0x435d11){return _0x435d11?{'count':_0x5ebb6f,'rows':_0x435d11}:null;}})[_0x88cc('0x15')](respondWithResult(_0x27e8df,null))['catch'](handleError(_0x27e8df,null));};exports[_0x88cc('0x140')]=function(_0x59a651,_0x42f7de){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x59a651['params']['id']}})['then'](handleEntityNotFound(_0x42f7de,null))['then'](function(_0x189e5c){if(_0x189e5c){return _0x189e5c[_0x88cc('0x140')](_0x59a651['body']['ids'],_[_0x88cc('0x109')](_0x59a651[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{});}})[_0x88cc('0x15')](respondWithResult(_0x42f7de,null))['catch'](handleError(_0x42f7de,null));};exports[_0x88cc('0x141')]=function(_0x59297c,_0x12e166){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x59297c[_0x88cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x12e166,null))['then'](function(_0x53c814){if(_0x53c814){return _0x53c814[_0x88cc('0x141')](_0x59297c[_0x88cc('0x42')]['ids']);}})[_0x88cc('0x15')](respondWithStatusCode(_0x12e166,null))['catch'](handleError(_0x12e166,null));};exports[_0x88cc('0x142')]=function(_0x1c8d0f,_0x57e23b){var _0x3195c4={};var _0x39b824={};var _0x3248e8;var _0x5ac747;return db[_0x88cc('0x41')]['findOne']({'where':{'id':_0x1c8d0f[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x57e23b,null))[_0x88cc('0x15')](function(_0x5c6781){if(_0x5c6781){_0x3248e8=_0x5c6781;_0x39b824[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x143')]['rawAttributes']);_0x39b824[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x1c8d0f[_0x88cc('0x42')]);_0x39b824[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x39b824[_0x88cc('0x51')],_0x39b824['query']);_0x3195c4[_0x88cc('0x45')]=_['intersection'](_0x39b824[_0x88cc('0x51')],qs['fields'](_0x1c8d0f[_0x88cc('0x42')][_0x88cc('0x55')]));_0x3195c4['attributes']=_0x3195c4[_0x88cc('0x45')]['length']?_0x3195c4['attributes']:_0x39b824[_0x88cc('0x51')];_0x3195c4['order']=qs[_0x88cc('0xc2')](_0x1c8d0f[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x3195c4[_0x88cc('0xc3')]=qs['filters'](_['pick'](_0x1c8d0f[_0x88cc('0x42')],_0x39b824['filters']));if(_0x1c8d0f[_0x88cc('0x42')][_0x88cc('0x32')]){_0x3195c4[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x3195c4[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x3195c4['attributes'],function(_0x4265d7){var _0x441499={};_0x441499[_0x4265d7]={'$like':'%'+_0x1c8d0f['query'][_0x88cc('0x32')]+'%'};return _0x441499;})});}_0x3195c4=_[_0x88cc('0x57')]({},_0x3195c4,_0x1c8d0f[_0x88cc('0x58')]);return _0x3248e8[_0x88cc('0x142')](_0x3195c4);}})[_0x88cc('0x15')](function(_0x531f27){if(_0x531f27){_0x5ac747=_0x531f27['length'];if(!_0x1c8d0f[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x3195c4[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x1c8d0f[_0x88cc('0x42')][_0x88cc('0x25')]);_0x3195c4['offset']=qs[_0x88cc('0x23')](_0x1c8d0f[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x3248e8[_0x88cc('0x142')](_0x3195c4);}})[_0x88cc('0x15')](function(_0x38b6f8){if(_0x38b6f8){return _0x38b6f8?{'count':_0x5ac747,'rows':_0x38b6f8}:null;}})[_0x88cc('0x15')](respondWithResult(_0x57e23b,null))[_0x88cc('0x1f')](handleError(_0x57e23b,null));};exports[_0x88cc('0x144')]=function(_0x1da40c,_0x59d2cf){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x1da40c[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x59d2cf,null))[_0x88cc('0x15')](function(_0x10e66a){if(_0x10e66a){return _0x10e66a[_0x88cc('0x144')](_0x1da40c[_0x88cc('0x5c')][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x1da40c[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x59d2cf,null))['catch'](handleError(_0x59d2cf,null));};exports[_0x88cc('0x145')]=function(_0x284845,_0x284ea9){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x284845[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x284ea9,null))['then'](function(_0x29a842){if(_0x29a842){return _0x29a842[_0x88cc('0x145')](_0x284845[_0x88cc('0x42')][_0x88cc('0x5f')]);}})['then'](respondWithStatusCode(_0x284ea9,null))[_0x88cc('0x1f')](handleError(_0x284ea9,null));};exports[_0x88cc('0x146')]=function(_0x331831,_0xc04eae){var _0x17e87e={};var _0xb3cce8={};var _0x5300bb;var _0x42ac96;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x331831['params']['id']}})['then'](handleEntityNotFound(_0xc04eae,null))['then'](function(_0x4d8fba){if(_0x4d8fba){_0x5300bb=_0x4d8fba;_0xb3cce8[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x147')][_0x88cc('0x3c')]);_0xb3cce8['query']=_[_0x88cc('0x52')](_0x331831['query']);_0xb3cce8[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0xb3cce8[_0x88cc('0x51')],_0xb3cce8[_0x88cc('0x42')]);_0x17e87e[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0xb3cce8['model'],qs[_0x88cc('0x55')](_0x331831['query']['fields']));_0x17e87e[_0x88cc('0x45')]=_0x17e87e[_0x88cc('0x45')][_0x88cc('0x56')]?_0x17e87e[_0x88cc('0x45')]:_0xb3cce8[_0x88cc('0x51')];_0x17e87e['order']=qs['sort'](_0x331831['query'][_0x88cc('0xc2')]);_0x17e87e[_0x88cc('0xc3')]=qs['filters'](_[_0x88cc('0xc4')](_0x331831['query'],_0xb3cce8['filters']));if(_0x331831[_0x88cc('0x42')]['filter']){_0x17e87e[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x17e87e['where'],{'$or':_['map'](_0x17e87e[_0x88cc('0x45')],function(_0xc5ce9c){var _0x3f7b91={};_0x3f7b91[_0xc5ce9c]={'$like':'%'+_0x331831[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x3f7b91;})});}_0x17e87e=_['merge']({},_0x17e87e,_0x331831[_0x88cc('0x58')]);return _0x5300bb[_0x88cc('0x146')](_0x17e87e);}})[_0x88cc('0x15')](function(_0x1eac27){if(_0x1eac27){_0x42ac96=_0x1eac27['length'];if(!_0x331831['query'][_0x88cc('0xc5')]('nolimit')){_0x17e87e[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0x331831[_0x88cc('0x42')][_0x88cc('0x25')]);_0x17e87e[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x331831[_0x88cc('0x42')]['offset']);}return _0x5300bb[_0x88cc('0x146')](_0x17e87e);}})['then'](function(_0x394751){if(_0x394751){return _0x394751?{'count':_0x42ac96,'rows':_0x394751}:null;}})[_0x88cc('0x15')](respondWithResult(_0xc04eae,null))['catch'](handleError(_0xc04eae,null));};exports[_0x88cc('0x148')]=function(_0x2d1369,_0x23bf4c){return db[_0x88cc('0x41')]['find']({'where':{'id':_0x2d1369[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x23bf4c,null))[_0x88cc('0x15')](function(_0x529404){if(_0x529404){return _0x529404[_0x88cc('0x148')](_0x2d1369[_0x88cc('0x5c')][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x2d1369[_0x88cc('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x23bf4c,null))['catch'](handleError(_0x23bf4c,null));};exports[_0x88cc('0x149')]=function(_0x308696,_0x235956){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x308696[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x235956,null))[_0x88cc('0x15')](function(_0x46a786){if(_0x46a786){return _0x46a786[_0x88cc('0x149')](_0x308696[_0x88cc('0x42')][_0x88cc('0x5f')]);}})['then'](respondWithStatusCode(_0x235956,null))[_0x88cc('0x1f')](handleError(_0x235956,null));};exports[_0x88cc('0x14a')]=function(_0x165349,_0x4fce0f){var _0x217204={};var _0x8f0cc8={};var _0x58e496;var _0x4bb075;return db['User'][_0x88cc('0x91')]({'where':{'id':_0x165349[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x4fce0f,null))[_0x88cc('0x15')](function(_0x4a1673){if(_0x4a1673){_0x58e496=_0x4a1673;_0x8f0cc8[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x14b')]['rawAttributes']);_0x8f0cc8[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x165349[_0x88cc('0x42')]);_0x8f0cc8[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x8f0cc8[_0x88cc('0x51')],_0x8f0cc8['query']);_0x217204[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x8f0cc8[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x165349['query']['fields']));_0x217204[_0x88cc('0x45')]=_0x217204['attributes'][_0x88cc('0x56')]?_0x217204[_0x88cc('0x45')]:_0x8f0cc8['model'];_0x217204[_0x88cc('0xc1')]=qs['sort'](_0x165349[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x217204[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x165349[_0x88cc('0x42')],_0x8f0cc8[_0x88cc('0x53')]));if(_0x165349['query'][_0x88cc('0x32')]){_0x217204[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x217204[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x217204[_0x88cc('0x45')],function(_0x3bc785){var _0x888059={};_0x888059[_0x3bc785]={'$like':'%'+_0x165349[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x888059;})});}_0x217204=_[_0x88cc('0x57')]({},_0x217204,_0x165349['options']);return _0x58e496[_0x88cc('0x14a')](_0x217204);}})[_0x88cc('0x15')](function(_0xe5a36f){if(_0xe5a36f){_0x4bb075=_0xe5a36f[_0x88cc('0x56')];if(!_0x165349[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x217204['limit']=qs[_0x88cc('0x25')](_0x165349['query'][_0x88cc('0x25')]);_0x217204[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x165349[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x58e496[_0x88cc('0x14a')](_0x217204);}})[_0x88cc('0x15')](function(_0x5a97cc){if(_0x5a97cc){return _0x5a97cc?{'count':_0x4bb075,'rows':_0x5a97cc}:null;}})[_0x88cc('0x15')](respondWithResult(_0x4fce0f,null))['catch'](handleError(_0x4fce0f,null));};exports[_0x88cc('0x14c')]=function(_0x5db449,_0xb955f4){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x5db449['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0xb955f4,null))[_0x88cc('0x15')](function(_0x41d394){if(_0x41d394){return _0x41d394[_0x88cc('0x14c')](_0x5db449[_0x88cc('0x5c')][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x5db449[_0x88cc('0x5c')],['ids','id'])||{});}})[_0x88cc('0x15')](respondWithResult(_0xb955f4,null))['catch'](handleError(_0xb955f4,null));};exports[_0x88cc('0x14d')]=function(_0x428d8b,_0x16bbb0){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x428d8b[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x16bbb0,null))[_0x88cc('0x15')](function(_0x4e7f88){if(_0x4e7f88){return _0x4e7f88[_0x88cc('0x14d')](_0x428d8b[_0x88cc('0x42')][_0x88cc('0x5f')]);}})[_0x88cc('0x15')](respondWithStatusCode(_0x16bbb0,null))['catch'](handleError(_0x16bbb0,null));};exports[_0x88cc('0x14e')]=function(_0x2a29c4,_0x5229da){var _0x4a1112={};var _0x1d83c1={};var _0x2bb2a9;var _0x38862e;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x2a29c4[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x5229da,null))[_0x88cc('0x15')](function(_0x421695){if(_0x421695){_0x2bb2a9=_0x421695;_0x1d83c1[_0x88cc('0x51')]=_[_0x88cc('0x52')](db[_0x88cc('0x14f')][_0x88cc('0x3c')]);_0x1d83c1[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x2a29c4['query']);_0x1d83c1[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x1d83c1[_0x88cc('0x51')],_0x1d83c1[_0x88cc('0x42')]);_0x4a1112[_0x88cc('0x45')]=_['intersection'](_0x1d83c1[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0x2a29c4[_0x88cc('0x42')][_0x88cc('0x55')]));_0x4a1112[_0x88cc('0x45')]=_0x4a1112[_0x88cc('0x45')][_0x88cc('0x56')]?_0x4a1112[_0x88cc('0x45')]:_0x1d83c1['model'];_0x4a1112[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x2a29c4['query'][_0x88cc('0xc2')]);_0x4a1112[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x2a29c4[_0x88cc('0x42')],_0x1d83c1['filters']));if(_0x2a29c4['query'][_0x88cc('0x32')]){_0x4a1112[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x4a1112['where'],{'$or':_[_0x88cc('0x34')](_0x4a1112[_0x88cc('0x45')],function(_0x3eedee){var _0x132593={};_0x132593[_0x3eedee]={'$like':'%'+_0x2a29c4[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x132593;})});}_0x4a1112=_[_0x88cc('0x57')]({},_0x4a1112,_0x2a29c4[_0x88cc('0x58')]);return _0x2bb2a9[_0x88cc('0x14e')](_0x4a1112);}})[_0x88cc('0x15')](function(_0x228af6){if(_0x228af6){_0x38862e=_0x228af6[_0x88cc('0x56')];if(!_0x2a29c4[_0x88cc('0x42')][_0x88cc('0xc5')]('nolimit')){_0x4a1112['limit']=qs[_0x88cc('0x25')](_0x2a29c4[_0x88cc('0x42')][_0x88cc('0x25')]);_0x4a1112[_0x88cc('0x23')]=qs['offset'](_0x2a29c4[_0x88cc('0x42')][_0x88cc('0x23')]);}return _0x2bb2a9[_0x88cc('0x14e')](_0x4a1112);}})[_0x88cc('0x15')](function(_0x23dc5c){if(_0x23dc5c){return _0x23dc5c?{'count':_0x38862e,'rows':_0x23dc5c}:null;}})[_0x88cc('0x15')](respondWithResult(_0x5229da,null))['catch'](handleError(_0x5229da,null));};exports[_0x88cc('0x150')]=function(_0x414f26,_0x4a3021){return db['User'][_0x88cc('0x5d')]({'where':{'id':_0x414f26[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x4a3021,null))[_0x88cc('0x15')](function(_0x213c4b){if(_0x213c4b){return _0x213c4b['addWhatsappAccounts'](_0x414f26[_0x88cc('0x5c')][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x414f26[_0x88cc('0x5c')],[_0x88cc('0x5f'),'id'])||{});}})[_0x88cc('0x15')](respondWithResult(_0x4a3021,null))['catch'](handleError(_0x4a3021,null));};exports[_0x88cc('0x151')]=function(_0x52261b,_0x5a1db0){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x52261b[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x5a1db0,null))[_0x88cc('0x15')](function(_0x291824){if(_0x291824){return _0x291824[_0x88cc('0x151')](_0x52261b[_0x88cc('0x42')]['ids']);}})[_0x88cc('0x15')](respondWithStatusCode(_0x5a1db0,null))[_0x88cc('0x1f')](handleError(_0x5a1db0,null));};exports[_0x88cc('0x152')]=function(_0x1f2335,_0x39bfae){var _0x1a1c1d={};var _0x4bbb5d={};var _0x2622cc;var _0x140a02;return db[_0x88cc('0x41')][_0x88cc('0x91')]({'where':{'id':_0x1f2335['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x39bfae,null))[_0x88cc('0x15')](function(_0x49a0a1){if(_0x49a0a1){_0x2622cc=_0x49a0a1;_0x4bbb5d[_0x88cc('0x51')]=_['keys'](db[_0x88cc('0x153')][_0x88cc('0x3c')]);_0x4bbb5d[_0x88cc('0x42')]=_[_0x88cc('0x52')](_0x1f2335[_0x88cc('0x42')]);_0x4bbb5d[_0x88cc('0x53')]=_[_0x88cc('0x54')](_0x4bbb5d['model'],_0x4bbb5d[_0x88cc('0x42')]);_0x1a1c1d[_0x88cc('0x45')]=_[_0x88cc('0x54')](_0x4bbb5d['model'],qs['fields'](_0x1f2335[_0x88cc('0x42')][_0x88cc('0x55')]));_0x1a1c1d[_0x88cc('0x45')]=_0x1a1c1d[_0x88cc('0x45')]['length']?_0x1a1c1d[_0x88cc('0x45')]:_0x4bbb5d['model'];_0x1a1c1d[_0x88cc('0xc1')]=qs[_0x88cc('0xc2')](_0x1f2335[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x1a1c1d['where']=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0x1f2335['query'],_0x4bbb5d[_0x88cc('0x53')]));if(_0x1f2335[_0x88cc('0x42')][_0x88cc('0x32')]){_0x1a1c1d[_0x88cc('0xc3')]=_['merge'](_0x1a1c1d['where'],{'$or':_[_0x88cc('0x34')](_0x1a1c1d[_0x88cc('0x45')],function(_0x33da16){var _0x595b51={};_0x595b51[_0x33da16]={'$like':'%'+_0x1f2335[_0x88cc('0x42')]['filter']+'%'};return _0x595b51;})});}_0x1a1c1d=_[_0x88cc('0x57')]({},_0x1a1c1d,_0x1f2335[_0x88cc('0x58')]);return _0x2622cc[_0x88cc('0x152')](_0x1a1c1d);}})[_0x88cc('0x15')](function(_0x717f5f){if(_0x717f5f){_0x140a02=_0x717f5f['length'];if(!_0x1f2335[_0x88cc('0x42')][_0x88cc('0xc5')](_0x88cc('0xce'))){_0x1a1c1d['limit']=qs[_0x88cc('0x25')](_0x1f2335[_0x88cc('0x42')][_0x88cc('0x25')]);_0x1a1c1d['offset']=qs['offset'](_0x1f2335[_0x88cc('0x42')]['offset']);}return _0x2622cc[_0x88cc('0x152')](_0x1a1c1d);}})[_0x88cc('0x15')](function(_0x351d54){if(_0x351d54){return _0x351d54?{'count':_0x140a02,'rows':_0x351d54}:null;}})[_0x88cc('0x15')](respondWithResult(_0x39bfae,null))[_0x88cc('0x1f')](handleError(_0x39bfae,null));};exports[_0x88cc('0x154')]=function(_0x11f3cc,_0x25c1f5){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x11f3cc['params']['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x25c1f5,null))['then'](function(_0x412873){if(_0x412873){return _0x412873[_0x88cc('0x154')](_0x11f3cc[_0x88cc('0x5c')][_0x88cc('0x5f')],_[_0x88cc('0x109')](_0x11f3cc['body'],[_0x88cc('0x5f'),'id'])||{});}})[_0x88cc('0x15')](respondWithResult(_0x25c1f5,null))[_0x88cc('0x1f')](handleError(_0x25c1f5,null));};exports[_0x88cc('0x155')]=function(_0x2e52b9,_0x166299){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x2e52b9[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](handleEntityNotFound(_0x166299,null))[_0x88cc('0x15')](function(_0x383920){if(_0x383920){return _0x383920[_0x88cc('0x155')](_0x2e52b9[_0x88cc('0x42')][_0x88cc('0x5f')]);}})[_0x88cc('0x15')](respondWithStatusCode(_0x166299,null))[_0x88cc('0x1f')](handleError(_0x166299,null));};exports['getScheduledCalls']=function(_0xce8527,_0x27f752){var _0x245ba9={},_0x411573={},_0x5e220d={'count':0x0,'rows':[]};var _0x208e84=db['CmHopper']['rawAttributes'];_0x411573[_0x88cc('0x51')]=_[_0x88cc('0x52')](_0x208e84);_0x411573['query']=_['keys'](_0xce8527[_0x88cc('0x42')]);_0x411573['filters']=_['intersection'](_0x411573[_0x88cc('0x51')],_0x411573[_0x88cc('0x42')]);_0x411573[_0x88cc('0x53')]=_['concat'](_0x411573['filters'],['$and',_0x88cc('0x156'),_0x88cc('0x157'),'$gte','$lt',_0x88cc('0x158'),_0x88cc('0x159'),_0x88cc('0x15a'),_0x88cc('0x15b'),_0x88cc('0x15c'),_0x88cc('0x15d'),_0x88cc('0x15e'),'$notIn','$like',_0x88cc('0x15f'),_0x88cc('0x160'),'$notILike',_0x88cc('0x161'),'$overlap',_0x88cc('0x162'),_0x88cc('0x163'),_0x88cc('0x164')]);_0x245ba9[_0x88cc('0x45')]=_['intersection'](_0x411573[_0x88cc('0x51')],qs[_0x88cc('0x55')](_0xce8527[_0x88cc('0x42')][_0x88cc('0x55')]));_0x245ba9[_0x88cc('0x45')]=_0x245ba9['attributes'][_0x88cc('0x56')]?_0x245ba9[_0x88cc('0x45')]:_0x411573[_0x88cc('0x51')];if(!_0xce8527['query'][_0x88cc('0xc5')]('nolimit')){_0x245ba9[_0x88cc('0x25')]=qs[_0x88cc('0x25')](_0xce8527[_0x88cc('0x42')]['limit']);_0x245ba9[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0xce8527[_0x88cc('0x42')][_0x88cc('0x23')]);}_0x245ba9['order']=qs['sort'](_0xce8527[_0x88cc('0x42')][_0x88cc('0xc2')]);_0x245ba9[_0x88cc('0xc3')]=qs[_0x88cc('0x53')](_[_0x88cc('0xc4')](_0xce8527[_0x88cc('0x42')],_0x411573[_0x88cc('0x53')]));if(_0xce8527[_0x88cc('0x42')][_0x88cc('0x32')]){_0x245ba9[_0x88cc('0xc3')]=_[_0x88cc('0x57')](_0x245ba9[_0x88cc('0xc3')],{'$or':_[_0x88cc('0x34')](_0x245ba9[_0x88cc('0x45')],function(_0x3c19f2){var _0x49c395={};_0x49c395[_0x3c19f2]={'$like':'%'+_0xce8527[_0x88cc('0x42')][_0x88cc('0x32')]+'%'};return _0x49c395;})});}_0x245ba9[_0x88cc('0xc3')]={'$and':[_0x245ba9[_0x88cc('0xc3')],{'$or':[{'UserId':_0xce8527[_0x88cc('0x50')]['id']},{'OwnerId':_0xce8527[_0x88cc('0x50')]['id']}]}]};_0x245ba9=_['merge']({},_0x245ba9,_0xce8527['options']);var _0x3ac0fe={'where':_0x245ba9[_0x88cc('0xc3')]};return db['CmHopper'][_0x88cc('0x26')](_0x3ac0fe)[_0x88cc('0x15')](function(_0x41fb7a){_0x5e220d[_0x88cc('0x26')]=_0x41fb7a;if(_0xce8527[_0x88cc('0x42')][_0x88cc('0x43')]){_0x245ba9[_0x88cc('0x44')]=[{'attributes':['id',_0x88cc('0x165'),'lastName','phone'],'model':db[_0x88cc('0x166')],'as':_0x88cc('0x167')},{'attributes':['id',_0x88cc('0x37'),'dialActive'],'model':db[_0x88cc('0x168')],'as':'Queue'}];}return db[_0x88cc('0x169')][_0x88cc('0xa0')](_0x245ba9);})[_0x88cc('0x15')](function(_0x5e46d2){_0x5e220d[_0x88cc('0x47')]=_0x5e46d2;return _0x5e220d;})[_0x88cc('0x15')](respondWithFilteredResult(_0x27f752,_0x245ba9))[_0x88cc('0x1f')](handleError(_0x27f752,null));};exports['getApiKey']=function(_0x408afe,_0x59afce){if(!_[_0x88cc('0x64')](_0x408afe[_0x88cc('0x2d')]['id'])&&(_0x408afe[_0x88cc('0x2d')][_0x88cc('0x2a')]==_0x88cc('0x2b')||_0x408afe[_0x88cc('0x2d')]['role']==_0x88cc('0x2d'))){return db['User']['findOne']({'where':{'id':_0x408afe[_0x88cc('0x50')]['id']},'raw':!![]})[_0x88cc('0x15')](function(_0x190f81){return authService[_0x88cc('0x16a')](_0x190f81);})[_0x88cc('0x15')](function(_0xaec6f9){if(_0xaec6f9){return _0x59afce[_0x88cc('0x21')](0xc8)[_0x88cc('0x22')]({'api_key':_0xaec6f9['token']});}else{return _0x59afce[_0x88cc('0x21')](0xcc)[_0x88cc('0x22')]({'message':_0x88cc('0x16b')});}})[_0x88cc('0x1f')](handleError(_0x59afce,0x193));}else{return _0x59afce[_0x88cc('0x21')](0x191)[_0x88cc('0x22')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['createApiKey']=function(_0x3ebad3,_0x4b9e53){if(!_[_0x88cc('0x64')](_0x3ebad3['user']['id'])&&(_0x3ebad3[_0x88cc('0x2d')]['role']==_0x88cc('0x2b')||_0x3ebad3['user'][_0x88cc('0x2a')]=='user')){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0x3ebad3[_0x88cc('0x50')]['id']}})['then'](function(_0x2d0510){return authService[_0x88cc('0x16c')](_0x2d0510);})['then'](function(_0x1d7b61){return db[_0x88cc('0x41')][_0x88cc('0x5b')]({'apiKeyIat':_0x1d7b61['iat'],'apiKeyNonce':_0x1d7b61[_0x88cc('0x16d')]},{'where':{'id':_0x3ebad3[_0x88cc('0x50')]['id']}})[_0x88cc('0x15')](function(){return _0x4b9e53[_0x88cc('0x21')](0xc8)[_0x88cc('0x22')]({'api_key':_0x1d7b61['token']});});})[_0x88cc('0x1f')](handleError(_0x4b9e53,0x193));}else{return _0x4b9e53[_0x88cc('0x21')](0x191)[_0x88cc('0x22')]({'message':_0x88cc('0x16e')});}};exports[_0x88cc('0x16f')]=function(_0xd0fea9,_0x41b1dd){if(!_[_0x88cc('0x64')](_0xd0fea9['user']['id'])&&(_0xd0fea9[_0x88cc('0x2d')][_0x88cc('0x2a')]==_0x88cc('0x2b')||_0xd0fea9[_0x88cc('0x2d')][_0x88cc('0x2a')]==_0x88cc('0x2d'))){return db[_0x88cc('0x41')][_0x88cc('0x5d')]({'where':{'id':_0xd0fea9['params']['id']}})['then'](handleEntityNotFound(_0x41b1dd,null))[_0x88cc('0x15')](function(_0x574b80){if(_0x574b80&&_0x574b80['apiKeyNonce']&&_0x574b80[_0x88cc('0x170')])return _0x574b80;else throw{'message':_0x88cc('0x171')};})[_0x88cc('0x15')](function(_0x66188){return db[_0x88cc('0x41')][_0x88cc('0x5b')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xd0fea9[_0x88cc('0x50')]['id']}});})[_0x88cc('0x15')](respondWithStatusCode(_0x41b1dd,0xc8))[_0x88cc('0x1f')](handleError(_0x41b1dd,0x193));}else{return _0x41b1dd['status'](0x191)[_0x88cc('0x22')]({'message':_0x88cc('0x16e')});}};exports[_0x88cc('0x172')]=function(_0x151a0d,_0x185ce6){var _0xcc6751=_0x151a0d[_0x88cc('0x2d')]['get']({'plain':!![]});if(!_0xcc6751){return _0x185ce6[_0x88cc('0x21')](0x191)[_0x88cc('0x3b')](_0x88cc('0x173'));}else{return _0x185ce6['status'](0xc8)['json'](_0xcc6751);}};exports[_0x88cc('0x174')]=function(_0x16fd64,_0x5a579d){var _0x374d36={'offset':0x0},_0x4f570d={'count':0x0,'rows':[]};Promise[_0x88cc('0x175')]()[_0x88cc('0x15')](function(){if(!_0x16fd64[_0x88cc('0x42')][_0x88cc('0x32')]&&!_0x16fd64[_0x88cc('0x42')][_0x88cc('0x176')]&&!_0x16fd64[_0x88cc('0x42')][_0x88cc('0x177')])return[];return Promise[_0x88cc('0x175')]()[_0x88cc('0x15')](function(){var _0x3d7686=[];if(!_['isEmpty'](_0x16fd64['query'][_0x88cc('0x176')])){_0x3d7686['push'](db[_0x88cc('0x10a')]['findAll']({'attributes':['id',_0x88cc('0x37')],'where':{'id':_0x16fd64[_0x88cc('0x42')]['teams']}}));}if(!_[_0x88cc('0x85')](_0x16fd64[_0x88cc('0x42')]['queues'])){_0x3d7686[_0x88cc('0x46')](db[_0x88cc('0x168')][_0x88cc('0xa0')]({'attributes':['id','name'],'type':_0x88cc('0x178'),'where':{'id':_0x16fd64[_0x88cc('0x42')][_0x88cc('0x177')]}}));}return Promise[_0x88cc('0x4f')](_0x3d7686);})['then'](function(_0xf10cb7){var _0x4a9ae2=_[_0x88cc('0x117')](_0xf10cb7)['map'](function(_0xa986e8){return _0xa986e8['getAgents']({'attributes':['id','name','internal','online'],'raw':!![]});});return Promise['all'](_0x4a9ae2);})[_0x88cc('0x15')](function(_0x433a7d){var _0x2449d7=_[_0x88cc('0x117')](_0x433a7d);if(!_0x16fd64[_0x88cc('0x42')][_0x88cc('0x32')])return _0x2449d7;if(_['isEmpty'](_0x2449d7)){return db[_0x88cc('0x41')]['findAll']({'attributes':['id',_0x88cc('0x37'),'internal',_0x88cc('0x97')],'where':{'role':_0x88cc('0x2f'),'$or':[db[_0x88cc('0x66')]['where'](db[_0x88cc('0x66')]['fn']('lower',db['sequelize']['col']('name')),{'$like':'%'+_0x16fd64[_0x88cc('0x42')]['filter']['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x16fd64[_0x88cc('0x42')][_0x88cc('0x32')]+'%'}}]},'raw':!![]});}else{return _(_0x2449d7)['flatten']()['filter'](function(_0x199518){return _0x199518[_0x88cc('0x37')]['toLowerCase']()[_0x88cc('0x36')](_0x16fd64[_0x88cc('0x42')][_0x88cc('0x32')]['toLowerCase']())||_0x199518[_0x88cc('0x63')][_0x88cc('0x179')]()[_0x88cc('0x36')](_0x16fd64[_0x88cc('0x42')][_0x88cc('0x32')]);})[_0x88cc('0x35')]();}})['then'](function(_0x14b80a){var _0x532fa3=_0x88cc('0x37');var _0x1798af='asc';if(_0x16fd64[_0x88cc('0x42')][_0x88cc('0xc2')]){var _0x1798af=_0x16fd64[_0x88cc('0x42')][_0x88cc('0xc2')][0x0]==='-'?'desc':_0x88cc('0x17a');var _0x532fa3=_0x1798af===_0x88cc('0x17a')?_0x16fd64[_0x88cc('0x42')][_0x88cc('0xc2')]:_0x16fd64[_0x88cc('0x42')]['sort'][_0x88cc('0x17b')](0x1);}return _(_0x14b80a)[_0x88cc('0x17c')]('id')['orderBy']([function(_0x568b36){return _0x532fa3==='name'?_0x568b36[_0x532fa3][_0x88cc('0x9c')]():_0x568b36[_0x532fa3];}],[_0x1798af])[_0x88cc('0x34')](function(_0x41944a){return _[_0x88cc('0xc4')](_0x41944a,['id',_0x88cc('0x37'),_0x88cc('0x63'),'online']);})[_0x88cc('0x35')]();})[_0x88cc('0x15')](function(_0x43efc2){return client['request']('Agents',_0x16fd64)[_0x88cc('0x15')](function(_0x16a00f){if(_0x16a00f[_0x88cc('0x1c')])throw new Error(_0x88cc('0x17d'));var _0x38b773=_0x16a00f[_0x88cc('0x1e')];var _0x5758fc=jayson[_0x88cc('0x17e')][_0x88cc('0x13')]({'port':0x232c});return _0x5758fc['request']('Agents',_0x16fd64)['then'](function(_0x511643){if(_0x511643[_0x88cc('0x1c')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x3e7bfb=_0x511643[_0x88cc('0x1e')];return _[_0x88cc('0x57')]({},_0x3e7bfb,_0x38b773);});})[_0x88cc('0x15')](function(_0x50e4a9){return _[_0x88cc('0x34')](_0x43efc2,function(_0xebd4e6){var _0x2b17be=_[_0x88cc('0x5d')](_0x50e4a9['rows'],['id',_0xebd4e6['id']]);if(!_0x2b17be||!_0xebd4e6[_0x88cc('0x97')]){_0xebd4e6['status']='offline';}else if(_0x2b17be[_0x88cc('0xa3')]){_0xebd4e6['status']=_0x88cc('0xf7');}else{_0xebd4e6[_0x88cc('0x21')]=_['includes'](['idle',_0x88cc('0x17f'),_0x88cc('0x180'),'ringing',null,undefined],_0x2b17be[_0x88cc('0x181')])?_0x88cc('0x97'):_0x88cc('0x182');}return _0xebd4e6;});});});})[_0x88cc('0x15')](function(_0x57ec1d){if(!_0x16fd64['query']['hasOwnProperty'](_0x88cc('0xce'))){_0x374d36[_0x88cc('0x25')]=qs['limit'](_0x16fd64[_0x88cc('0x42')]['limit']||0xa);_0x374d36[_0x88cc('0x23')]=qs[_0x88cc('0x23')](_0x16fd64[_0x88cc('0x42')][_0x88cc('0x23')]);}_0x4f570d[_0x88cc('0x26')]=_0x57ec1d[_0x88cc('0x56')];_0x4f570d[_0x88cc('0x47')]=_0x374d36[_0x88cc('0x25')]?_0x57ec1d[_0x88cc('0x183')](_0x374d36[_0x88cc('0x23')],_0x374d36[_0x88cc('0x23')]+_0x374d36['limit']):_0x57ec1d;return _0x4f570d;})[_0x88cc('0x15')](respondWithFilteredResult(_0x5a579d,_0x374d36))['catch'](handleError(_0x5a579d,null));};function get_open_tabs(_0x5aa571,_0x4243ea){var _0x3d771e=_0x5aa571[_0x88cc('0x184')](0x0)[_0x88cc('0x185')]()+_0x5aa571[_0x88cc('0x183')](0x1);var _0x16f8c7={'type':db['Sequelize'][_0x88cc('0x186')]['SELECT'],'raw':!![]};return new BPromise(function(_0x3a7c97,_0x24b6ca){var _0x229dd1=squel['select']()['field'](_0x88cc('0x187')+_0x3d771e+_0x88cc('0x188'),'id')['field'](_0x88cc('0x189'))[_0x88cc('0x69')]('user_has_'+_0x5aa571+'_interactions','ui')[_0x88cc('0xc3')](_0x88cc('0x18a'),_0x4243ea['id']);return db[_0x88cc('0x66')][_0x88cc('0x42')](_0x229dd1[_0x88cc('0x179')](),_0x16f8c7)[_0x88cc('0x15')](function(_0x2ae108){_0x4243ea[_0x3d771e+_0x88cc('0x18b')]=_0x2ae108;_0x3a7c97(_0x2ae108);})[_0x88cc('0x1f')](function(_0x25d154){_0x24b6ca(_0x25d154);});});};
\ No newline at end of file
+var _0x3f8c=['Queue:save','isNil','format','SIP/%s','voicePause','upsert','removeQueues','remove','Queues','isArray','QueueId','Queue:remove','UserVoiceQueueRt','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','filters','sort','where','pick','merge','CmList','List','Tag','Tags','tag','hasOwnProperty','nolimit','order','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','pause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','voice','QueuePause','manual','%s%s','Pause','Team','getTeams','addTeams','setDataValue','getChatQueues','getMailQueues','Mail','Sms','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','online','getDataValue','removeTeams','Voice','Chat','getSmsQueues','Whatsapp','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','getScheduledCalls','$or','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','CmHopper','lastName','CmContact','Contact','dialActive','VoiceQueue','retrieveApiKey','json','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','resolve','teams','queues','inbound','col','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','QueryTypes','select','field','ui.','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','toString','OpenTabs','util','path','lodash','squel','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','./user.socket','register','redis','defaults','localhost','client','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','update','destroy','get','role','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','value','find','name','stack','send','rawAttributes','type','key','password','salt','include','includes','attributes','push','User','findAll','rows','query','true','length','chat','dataValues','sms','fax','mail','openchannel','all','show','model','differenceBy','keys','intersection','fields','includeAll','options','params','body','describe','addContacts','ids','Setting','findById','securePassword','validatePasswordPattern','max','internal','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','fullname','email','permissions','101','103','113','110','104','105','107','108','109','100','111','115','create','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','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','isEmpty','compact','UserProfileResource','changePassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','Wrong\x20credentials','oldPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','emit'];(function(_0x425cab,_0x38a6ad){var _0x105290=function(_0x26251d){while(--_0x26251d){_0x425cab['push'](_0x425cab['shift']());}};_0x105290(++_0x38a6ad);}(_0x3f8c,0x104));var _0xc3f8=function(_0x401c8f,_0x119525){_0x401c8f=_0x401c8f-0x0;var _0x482baf=_0x3f8c[_0x401c8f];return _0x482baf;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xc3f8('0x0'));var path=require(_0xc3f8('0x1'));var fs=require('fs');var _=require(_0xc3f8('0x2'));var squel=require(_0xc3f8('0x3'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc3f8('0x4'));var utils=require(_0xc3f8('0x5'));var config=require(_0xc3f8('0x6'));var licenseUtil=require(_0xc3f8('0x7'));var db=require(_0xc3f8('0x8'))['db'];var socket=require(_0xc3f8('0x9'))(new Redis(config['redis']));require(_0xc3f8('0xa'))[_0xc3f8('0xb')](socket);config[_0xc3f8('0xc')]=_[_0xc3f8('0xd')](config[_0xc3f8('0xc')],{'host':_0xc3f8('0xe'),'port':0x18eb});var client=jayson[_0xc3f8('0xf')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x22736b,_0x1075a6,_0x378541,_0x4303aa){return new BPromise(function(_0x58118f,_0x313714){var _0x28e4c7=_0x4303aa||client;return _0x28e4c7[_0xc3f8('0x10')](_0x22736b,_0x378541)[_0xc3f8('0x11')](function(_0x511763){logger[_0xc3f8('0x12')](_0xc3f8('0x13'),_0x1075a6,_0xc3f8('0x14'));logger[_0xc3f8('0x15')](_0xc3f8('0x16'),_0x1075a6,_0xc3f8('0x14'),JSON[_0xc3f8('0x17')](_0x511763));if(_0x511763[_0xc3f8('0x18')]){if(_0x511763[_0xc3f8('0x18')][_0xc3f8('0x19')]===0x1f4){logger[_0xc3f8('0x18')](_0xc3f8('0x13'),_0x1075a6,_0x511763[_0xc3f8('0x18')]['message']);return _0x313714(_0x511763[_0xc3f8('0x18')]['message']);}logger['error'](_0xc3f8('0x13'),_0x1075a6,_0x511763[_0xc3f8('0x18')][_0xc3f8('0x1a')]);return _0x58118f(_0x511763[_0xc3f8('0x18')]['message']);}else{logger[_0xc3f8('0x12')](_0xc3f8('0x13'),_0x1075a6,'request\x20sent');_0x58118f(_0x511763[_0xc3f8('0x1b')]['message']);}})[_0xc3f8('0x1c')](function(_0x42ce65){logger[_0xc3f8('0x18')]('User,\x20%s,\x20%s',_0x1075a6,_0x42ce65);_0x313714(_0x42ce65);});});}function respondWithStatusCode(_0x543dca,_0x113cd2){_0x113cd2=_0x113cd2||0xcc;return function(_0x2a7096){if(_0x2a7096){return _0x543dca[_0xc3f8('0x1d')](_0x113cd2);}return _0x543dca[_0xc3f8('0x1e')](_0x113cd2)[_0xc3f8('0x1f')]();};}function respondWithResult(_0x251bf7,_0x43b2b4){_0x43b2b4=_0x43b2b4||0xc8;return function(_0x42a155){if(_0x42a155){return _0x251bf7['status'](_0x43b2b4)['json'](_0x42a155);}};}function respondWithFilteredResult(_0x4b83f0,_0x2559a4){return function(_0x5e1d14){if(_0x5e1d14){var _0x11335=typeof _0x2559a4[_0xc3f8('0x20')]==='undefined'&&typeof _0x2559a4[_0xc3f8('0x21')]===_0xc3f8('0x22');var _0x2d237e=_0x5e1d14[_0xc3f8('0x23')];var _0x25088f=_0x11335?0x0:_0x2559a4[_0xc3f8('0x20')];var _0xf1d460=_0x11335?_0x5e1d14[_0xc3f8('0x23')]:_0x2559a4[_0xc3f8('0x20')]+_0x2559a4[_0xc3f8('0x21')];var _0x22c8e6;if(_0xf1d460>=_0x2d237e){_0xf1d460=_0x2d237e;_0x22c8e6=0xc8;}else{_0x22c8e6=0xce;}_0x4b83f0[_0xc3f8('0x1e')](_0x22c8e6);return _0x4b83f0[_0xc3f8('0x24')](_0xc3f8('0x25'),_0x25088f+'-'+_0xf1d460+'/'+_0x2d237e)['json'](_0x5e1d14);}return null;};}function saveUpdates(_0x58b303){return function(_0x2909f8){if(_0x2909f8){return _0x2909f8[_0xc3f8('0x26')](_0x58b303)['then'](function(_0x151bba){return _0x151bba;});}return null;};}function removeEntity(_0x4d39a0){return function(_0x2015af){if(_0x2015af){return _0x2015af[_0xc3f8('0x27')]()['then'](function(){var _0x48b32e=_0x2015af[_0xc3f8('0x28')]({'plain':!![]});if(_0x48b32e[_0xc3f8('0x29')]===_0xc3f8('0x2a'))return;var _0x3704e5=[{'name':_0xc3f8('0x2b'),'value':_0xc3f8('0x2c'),'ignore':!![]},{'name':_0xc3f8('0x2d'),'value':_0xc3f8('0x2e'),'ignore':![]},{'name':_0xc3f8('0x2f'),'value':_0xc3f8('0x30'),'ignore':![]}];var _0x52e543=_(_0x3704e5)[_0xc3f8('0x31')](_0xc3f8('0x32'))[_0xc3f8('0x33')](_0xc3f8('0x34'))[_0xc3f8('0x34')]();if(_['includes'](_0x52e543,_0x48b32e['role'])){return;}var _0x2be68e=_[_0xc3f8('0x35')](_0x3704e5,[_0xc3f8('0x34'),_0x48b32e[_0xc3f8('0x29')]])[_0xc3f8('0x36')];return db['UserProfileResource'][_0xc3f8('0x27')]({'where':{'type':_0x2be68e,'resourceId':_0x48b32e['id']}})[_0xc3f8('0x11')](function(){return _0x2015af;});})[_0xc3f8('0x11')](function(){_0x4d39a0['status'](0xcc)[_0xc3f8('0x1f')]();});}};}function handleEntityNotFound(_0x11ecc2){return function(_0x317319){if(!_0x317319){_0x11ecc2['sendStatus'](0x194);}return _0x317319;};}function handleError(_0x21a725,_0x37ae52){_0x37ae52=_0x37ae52||0x1f4;return function(_0x560553){logger[_0xc3f8('0x18')](_0x560553[_0xc3f8('0x37')]);if(_0x560553[_0xc3f8('0x36')]){delete _0x560553[_0xc3f8('0x36')];}_0x21a725[_0xc3f8('0x1e')](_0x37ae52)[_0xc3f8('0x38')](_0x560553);};}exports['index']=function(_0x285307,_0x2e4880){var _0x2d3129={},_0x2f589d={'count':0x0,'rows':[]};var _0x17aff0=_(db['User'][_0xc3f8('0x39')])[_0xc3f8('0x33')](function(_0xaa4c98){return{'name':_0xaa4c98['fieldName'],'type':_0xaa4c98[_0xc3f8('0x3a')][_0xc3f8('0x3b')]};})[_0xc3f8('0x31')](function(_0x2d4167){return!_['includes']([_0xc3f8('0x3c'),_0xc3f8('0x3d')],_0x2d4167[_0xc3f8('0x36')]);})[_0xc3f8('0x34')]();_0x2d3129=qs['getOptions'](_0x17aff0,_0x285307);var _0x3f313e={'where':_0x2d3129['where']};return db['User'][_0xc3f8('0x23')](_0x3f313e)[_0xc3f8('0x11')](function(_0x22ec3b){_0x2f589d[_0xc3f8('0x23')]=_0x22ec3b;if(_0x285307['query']['includeAll']){_0x2d3129[_0xc3f8('0x3e')]=[{'all':!![]}];}if(!_[_0xc3f8('0x3f')](_0x2d3129[_0xc3f8('0x40')],'id')){_0x2d3129[_0xc3f8('0x40')][_0xc3f8('0x41')]('id');}return db[_0xc3f8('0x42')][_0xc3f8('0x43')](_0x2d3129);})[_0xc3f8('0x11')](function(_0x13d8dc){_0x2f589d[_0xc3f8('0x44')]=_0x13d8dc;if(_0x285307[_0xc3f8('0x45')]['openTabs']===_0xc3f8('0x46')){var _0x22e9b3=[];for(var _0x4b327f=0x0;_0x4b327f<_0x2f589d[_0xc3f8('0x44')][_0xc3f8('0x47')];_0x4b327f++){_0x22e9b3['push'](get_open_tabs(_0xc3f8('0x48'),_0x2f589d[_0xc3f8('0x44')][_0x4b327f][_0xc3f8('0x49')]));_0x22e9b3[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4a'),_0x2f589d[_0xc3f8('0x44')][_0x4b327f][_0xc3f8('0x49')]));_0x22e9b3[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4b'),_0x2f589d[_0xc3f8('0x44')][_0x4b327f][_0xc3f8('0x49')]));_0x22e9b3['push'](get_open_tabs(_0xc3f8('0x4c'),_0x2f589d[_0xc3f8('0x44')][_0x4b327f]['dataValues']));_0x22e9b3[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4d'),_0x2f589d[_0xc3f8('0x44')][_0x4b327f][_0xc3f8('0x49')]));_0x22e9b3['push'](get_open_tabs('whatsapp',_0x2f589d[_0xc3f8('0x44')][_0x4b327f][_0xc3f8('0x49')]));}return BPromise[_0xc3f8('0x4e')](_0x22e9b3)['then'](function(_0x1b5777){return _0x2f589d;});}else{return _0x2f589d;}})[_0xc3f8('0x11')](respondWithFilteredResult(_0x2e4880,_0x2d3129))[_0xc3f8('0x1c')](handleError(_0x2e4880,null));};exports[_0xc3f8('0x4f')]=function(_0x103f0d,_0x5bf6a5){var _0x309e40={'raw':![],'where':{'id':_0x103f0d['params']['id']}},_0x873828={};_0x873828[_0xc3f8('0x50')]=_[_0xc3f8('0x51')](_[_0xc3f8('0x52')](db[_0xc3f8('0x42')][_0xc3f8('0x39')]),[_0xc3f8('0x3c'),_0xc3f8('0x3d')]);_0x873828['query']=_[_0xc3f8('0x52')](_0x103f0d[_0xc3f8('0x45')]);_0x873828['filters']=_[_0xc3f8('0x53')](_0x873828[_0xc3f8('0x50')],_0x873828[_0xc3f8('0x45')]);_0x309e40[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x873828[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x103f0d['query'][_0xc3f8('0x54')]));_0x309e40[_0xc3f8('0x40')]=_0x309e40[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x309e40[_0xc3f8('0x40')]:_0x873828[_0xc3f8('0x50')];if(_0x103f0d[_0xc3f8('0x45')][_0xc3f8('0x55')]){_0x309e40['include']=[{'all':!![]}];}_0x309e40=_['merge']({},_0x309e40,_0x103f0d[_0xc3f8('0x56')]);if(!_[_0xc3f8('0x3f')](_0x309e40['attributes'],'id')){_0x309e40['attributes'][_0xc3f8('0x41')]('id');}return db['User'][_0xc3f8('0x35')](_0x309e40)[_0xc3f8('0x11')](handleEntityNotFound(_0x5bf6a5,null))[_0xc3f8('0x11')](function(_0x5292a0){var _0x109a31=[];values=_0x5292a0;if(_0x103f0d['query']['openTabs']===_0xc3f8('0x46')){_0x109a31['push'](get_open_tabs(_0xc3f8('0x48'),_0x5292a0[_0xc3f8('0x49')]));_0x109a31[_0xc3f8('0x41')](get_open_tabs('sms',_0x5292a0[_0xc3f8('0x49')]));_0x109a31[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4d'),_0x5292a0[_0xc3f8('0x49')]));_0x109a31[_0xc3f8('0x41')](get_open_tabs('whatsapp',_0x5292a0['dataValues']));_0x109a31[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4b'),_0x5292a0[_0xc3f8('0x49')]));_0x109a31[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4c'),_0x5292a0['dataValues']));return BPromise[_0xc3f8('0x4e')](_0x109a31);}else{return values;}})['then'](function(_0x21dfc8){return values;})[_0xc3f8('0x11')](respondWithResult(_0x5bf6a5,null))[_0xc3f8('0x1c')](handleError(_0x5bf6a5,null));};exports[_0xc3f8('0x26')]=function(_0x5c6f6e,_0x2c549e){if(_0x5c6f6e['body']['id']){delete _0x5c6f6e['body']['id'];}delete _0x5c6f6e['body']['role'];return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x5c6f6e[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x2c549e,null))[_0xc3f8('0x11')](saveUpdates(_0x5c6f6e[_0xc3f8('0x58')],null))[_0xc3f8('0x11')](respondWithResult(_0x2c549e,null))[_0xc3f8('0x1c')](handleError(_0x2c549e,null));};exports['describe']=function(_0x84e1a2,_0x1c1d08){return db[_0xc3f8('0x42')][_0xc3f8('0x59')]()[_0xc3f8('0x11')](respondWithResult(_0x1c1d08,null))['catch'](handleError(_0x1c1d08,null));};exports[_0xc3f8('0x5a')]=function(_0x39b142,_0x30c90f){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x39b142['params']['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x30c90f,null))[_0xc3f8('0x11')](function(_0x42b255){if(_0x42b255){return _0x42b255[_0xc3f8('0x5a')](_0x39b142[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x39b142[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{});}})[_0xc3f8('0x11')](respondWithResult(_0x30c90f,null))['catch'](handleError(_0x30c90f,null));};function validateUser(_0x20cebe){return new BPromise(function(_0x54a6b7,_0x546e3b){if(_0x20cebe['internal'])return _0x54a6b7(_0x20cebe);return db[_0xc3f8('0x5c')][_0xc3f8('0x5d')](0x1)['then'](function(_0x24811c){if(_0x24811c[_0xc3f8('0x5e')])authService[_0xc3f8('0x5f')](_0x20cebe[_0xc3f8('0x3c')]);db[_0xc3f8('0x42')][_0xc3f8('0x60')](_0xc3f8('0x61'))[_0xc3f8('0x11')](function(_0x58268e){if(_['isNil'](_0x58268e)){_0x20cebe[_0xc3f8('0x61')]=_0x24811c['min_internal']||0x1;return;}if(_['isNil'](_0x24811c['min_internal'])||_0x24811c['min_internal']===_0x58268e){_0x20cebe['internal']=_0x58268e+0x1;return;}if(_0x24811c[_0xc3f8('0x62')]>_0x58268e){_0x20cebe[_0xc3f8('0x61')]=_0x24811c[_0xc3f8('0x62')];return;}return db[_0xc3f8('0x63')]['query'](_0xc3f8('0x64'),{'type':db[_0xc3f8('0x63')]['QueryTypes'][_0xc3f8('0x65')]})[_0xc3f8('0x11')](function(_0x104eec){if(_0x104eec&&_0x104eec['length']){for(var _0xaedf89=0x0,_0x5e3125=_0x104eec['length'];_0xaedf89<_0x5e3125&&_['isNil'](_0x20cebe[_0xc3f8('0x61')]);_0xaedf89++){if(_0x24811c[_0xc3f8('0x62')]<=_0x104eec[_0xaedf89]['from']){_0x20cebe[_0xc3f8('0x61')]=_0x104eec[_0xaedf89][_0xc3f8('0x66')];}else if(_0x24811c['min_internal']>_0x104eec[_0xaedf89][_0xc3f8('0x66')]&&_0x24811c[_0xc3f8('0x62')]<=_0x104eec[_0xaedf89]['to']){_0x20cebe['internal']=_0x24811c[_0xc3f8('0x62')];}}}if(_['isNil'](_0x20cebe[_0xc3f8('0x61')])){_0x20cebe[_0xc3f8('0x61')]=_0x58268e+0x1;}return _0x54a6b7(_0x20cebe);});});})['catch'](function(_0x54a784){_0x546e3b(_0x54a784);});});}function updateUser(_0x11edfe){return new BPromise(function(_0x10a1b6,_0x58bbc4){try{if(_0x11edfe[_0xc3f8('0x67')]){_0x11edfe['mailbox']=_0x11edfe[_0xc3f8('0x61')];_0x11edfe['VoiceMail']={'mailbox':_0x11edfe[_0xc3f8('0x61')],'password':_0x11edfe[_0xc3f8('0x3c')],'fullname':_0x11edfe[_0xc3f8('0x68')],'email':_0x11edfe[_0xc3f8('0x69')]};}if(_0x11edfe[_0xc3f8('0x29')]===_0xc3f8('0x2e')){if(!_0x11edfe[_0xc3f8('0x6a')])_0x11edfe[_0xc3f8('0x6a')]=[_0xc3f8('0x6b'),'102',_0xc3f8('0x6c'),_0xc3f8('0x6d'),_0xc3f8('0x6e'),_0xc3f8('0x6f'),_0xc3f8('0x70'),'106',_0xc3f8('0x71'),_0xc3f8('0x72'),_0xc3f8('0x73'),_0xc3f8('0x74'),_0xc3f8('0x75'),'114',_0xc3f8('0x76')];}_0x10a1b6(_0x11edfe);}catch(_0xbd005d){_0x58bbc4(_0xbd005d);}});}exports[_0xc3f8('0x77')]=function(_0x52e6fc,_0x4a0f25){if(_0x52e6fc[_0xc3f8('0x2c')][_0xc3f8('0x29')]===_0xc3f8('0x2e'))throw new Error(_0xc3f8('0x78'));if(_0x52e6fc['body'][_0xc3f8('0x29')]===_0xc3f8('0x2c')&&_0x52e6fc[_0xc3f8('0x2c')]['role']!==_0xc3f8('0x2a')){throw new Error(_0xc3f8('0x79'));}if(_0x52e6fc['body']['role']===_0xc3f8('0x2a')&&_0x52e6fc[_0xc3f8('0x2c')]['role']!==_0xc3f8('0x2a')){throw new Error(_0xc3f8('0x7a'));}return licenseUtil['checkUserLimits']([_0x52e6fc[_0xc3f8('0x58')]])['then'](function(){return validateUser(_0x52e6fc[_0xc3f8('0x58')]);})['then'](function(_0x34e991){return updateUser(_0x34e991)[_0xc3f8('0x11')](function(_0x2fafd7){if(_0x2fafd7[_0xc3f8('0x29')]===_0xc3f8('0x2a')){_0x2fafd7[_0xc3f8('0x7b')]=_0x52e6fc[_0xc3f8('0x2c')][_0xc3f8('0x7b')];delete _0x2fafd7[_0xc3f8('0x7c')];}return _0x2fafd7;});})['then'](function(_0x47e2c1){return db[_0xc3f8('0x42')]['create'](_0x47e2c1,{'include':[{'model':db[_0xc3f8('0x7d')],'as':_0xc3f8('0x7d')}]});})[_0xc3f8('0x11')](function(_0xfb05eb){if(_0x52e6fc['body'][_0xc3f8('0x29')]===_0xc3f8('0x2c'))return _0xfb05eb;if(_0x52e6fc[_0xc3f8('0x2c')][_0xc3f8('0x29')]!==_0xc3f8('0x2c'))return _0xfb05eb;return db[_0xc3f8('0x7e')][_0xc3f8('0x35')]({'where':{'name':_0xfb05eb[_0xc3f8('0x29')]===_0xc3f8('0x2e')?'Agents':'Telephones','userProfileId':_0x52e6fc[_0xc3f8('0x2c')][_0xc3f8('0x7c')]},'raw':!![]})[_0xc3f8('0x11')](function(_0x4d0b1a){if(!_0x4d0b1a||_0x4d0b1a[_0xc3f8('0x7f')]!=0x0)return _0xfb05eb;return db['UserProfileResource'][_0xc3f8('0x77')]({'name':_0xfb05eb['name'],'resourceId':_0xfb05eb['id'],'type':_0x4d0b1a[_0xc3f8('0x36')],'sectionId':_0x4d0b1a['id']},{})[_0xc3f8('0x11')](function(){return _0xfb05eb;});})[_0xc3f8('0x1c')](function(_0x2e3c2d){logger[_0xc3f8('0x18')](_0xc3f8('0x80'),_0x2e3c2d);throw _0x2e3c2d;});})[_0xc3f8('0x11')](respondWithResult(_0x4a0f25,0xc9))[_0xc3f8('0x1c')](handleError(_0x4a0f25,null));};exports['bulkCreate']=function(_0x3cd57d,_0x209748){var _0x33c670=_0x3cd57d[_0xc3f8('0x58')];var _0x4536bf=[];if(_0x3cd57d['user'][_0xc3f8('0x29')]===_0xc3f8('0x2e'))throw new Error(_0xc3f8('0x78'));if(_[_0xc3f8('0x81')](_0x33c670,['role','user'])&&_0x3cd57d[_0xc3f8('0x2c')][_0xc3f8('0x29')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x33c670,[_0xc3f8('0x29'),'admin'])&&_0x3cd57d[_0xc3f8('0x2c')][_0xc3f8('0x29')]!==_0xc3f8('0x2a')){throw new Error(_0xc3f8('0x82'));}return licenseUtil[_0xc3f8('0x83')](_0x33c670)[_0xc3f8('0x11')](function(){return validateUser(_0x33c670[0x0]);})[_0xc3f8('0x11')](function(){for(var _0x52690f=0x1;_0x52690f<_0x33c670['length'];_0x52690f++){var _0x55185a=_0x33c670[_0x52690f-0x1]['internal'];if(!_0x33c670[_0x52690f][_0xc3f8('0x61')])_0x33c670[_0x52690f]['internal']=_0x55185a+0x1;_0x4536bf[_0xc3f8('0x41')](validateUser(_0x33c670[_0x52690f]));}return BPromise[_0xc3f8('0x4e')](_0x4536bf);})[_0xc3f8('0x11')](function(){_0x4536bf=[];for(var _0x4dac11=0x0;_0x4dac11<_0x33c670[_0xc3f8('0x47')];_0x4dac11++){_0x4536bf[_0xc3f8('0x41')](updateUser(_0x33c670[_0x4dac11]));}return BPromise['all'](_0x4536bf);})[_0xc3f8('0x11')](function(){return BPromise[_0xc3f8('0x84')](_0x33c670,function(_0x1faa05){return db['User'][_0xc3f8('0x77')](_0x1faa05,{'include':[{'model':db[_0xc3f8('0x7d')],'as':_0xc3f8('0x7d')}]})['then'](function(_0x1704e5){_0x1faa05['id']=_0x1704e5['id'];return _0x1faa05;});});})[_0xc3f8('0x11')](function(_0x248316){if(_0x3cd57d[_0xc3f8('0x58')][_0xc3f8('0x29')]===_0xc3f8('0x2c'))return _0x248316;if(_0x3cd57d['user'][_0xc3f8('0x29')]!==_0xc3f8('0x2c'))return _0x248316;var _0x532750=_[_0xc3f8('0x81')](_0x248316,function(_0xe6f37d){return _0xe6f37d['role']===_0xc3f8('0x2e')||_0xe6f37d[_0xc3f8('0x29')]===_0xc3f8('0x30');});if(!_0x532750)return _0x248316;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xc3f8('0x2d'),'Telephones']},'userProfileId':_0x3cd57d[_0xc3f8('0x2c')][_0xc3f8('0x7c')]},'raw':!![]})[_0xc3f8('0x11')](function(_0x4b885b){if(_[_0xc3f8('0x85')](_0x4b885b)||!_[_0xc3f8('0x81')](_0x4b885b,[_0xc3f8('0x7f'),0x0]))return _0x248316;_0x4536bf=[];var _0x42e2e1=_(_0x4b885b)[_0xc3f8('0x33')](function(_0x128bc8){if(_0x128bc8['autoAssociation']===0x1)return;return _0x128bc8[_0xc3f8('0x36')]===_0xc3f8('0x2d')?_0xc3f8('0x2e'):_0xc3f8('0x30');})[_0xc3f8('0x86')]()['value']();for(var _0x1fe97d=0x0;_0x1fe97d<_0x248316[_0xc3f8('0x47')];_0x1fe97d++){if(!_[_0xc3f8('0x3f')](_0x42e2e1,_0x248316[_0x1fe97d]['role']))return;var _0x429889=_0x248316[_0x1fe97d][_0xc3f8('0x29')]===_0xc3f8('0x2e')?_0xc3f8('0x2d'):_0xc3f8('0x2f');_0x4536bf['push'](db[_0xc3f8('0x87')][_0xc3f8('0x77')]({'name':_0x248316[_0x1fe97d][_0xc3f8('0x36')],'resourceId':_0x248316[_0x1fe97d]['id'],'type':_0x429889,'sectionId':_[_0xc3f8('0x35')](_0x4b885b,[_0xc3f8('0x36'),_0x429889])['id']},{}));}return BPromise[_0xc3f8('0x4e')](_0x4536bf);});})[_0xc3f8('0x11')](respondWithResult(_0x209748,0xc9))[_0xc3f8('0x1c')](handleError(_0x209748,null));};exports[_0xc3f8('0x88')]=function(_0x132d60,_0x259ff9){if(_0x132d60['body']['id']){delete _0x132d60['body']['id'];}return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x132d60['params']['id']}})[_0xc3f8('0x11')](function(_0x254bb0){if(!_0x254bb0)return null;if(_0x254bb0['id']===_0x132d60[_0xc3f8('0x2c')]['id']){if(!_0x132d60[_0xc3f8('0x58')]['oldPassword']||!_0x132d60[_0xc3f8('0x58')][_0xc3f8('0x89')]){throw new db['Sequelize'][(_0xc3f8('0x8a'))](_0xc3f8('0x8b'));}if(!_0x254bb0['authenticate'](_0x132d60['body']['oldPassword'])){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x8d'));}if(_0x132d60[_0xc3f8('0x58')][_0xc3f8('0x8e')]===_0x132d60[_0xc3f8('0x58')][_0xc3f8('0x89')]){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x132d60['user'][_0xc3f8('0x29')]===_0xc3f8('0x2a')){if(!_0x132d60[_0xc3f8('0x58')][_0xc3f8('0x89')]){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x8f'));}}else if(_0x132d60[_0xc3f8('0x2c')][_0xc3f8('0x29')]==='user'){if(!_0x132d60[_0xc3f8('0x58')]['newPassword']){throw new db['Sequelize'][(_0xc3f8('0x8a'))](_0xc3f8('0x8f'));}if(_0x254bb0[_0xc3f8('0x29')]!==_0xc3f8('0x2e')){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))]('Unauthorized');}}else{throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x78'));}return _0x254bb0;})['then'](handleEntityNotFound(_0x259ff9,null))['then'](function(_0x14427e){return db[_0xc3f8('0x5c')]['findOne']({'attributes':['id',_0xc3f8('0x5e'),_0xc3f8('0x90'),'passwordHistoryLimit']})[_0xc3f8('0x11')](function(_0xfec26){if(_0xfec26[_0xc3f8('0x5e')])authService[_0xc3f8('0x5f')](_0x132d60[_0xc3f8('0x58')]['newPassword']);if(!_0xfec26[_0xc3f8('0x90')]||!_0x14427e['previousPasswords'])return _0x14427e;authService[_0xc3f8('0x91')](_0x132d60[_0xc3f8('0x58')]['newPassword'],_0x14427e[_0xc3f8('0x92')],_0xfec26[_0xc3f8('0x93')]);return _0x14427e;})[_0xc3f8('0x11')](saveUpdates({'password':_0x132d60[_0xc3f8('0x58')][_0xc3f8('0x89')],'passwordResetAt':_0x132d60[_0xc3f8('0x2c')]['id']==_0x132d60[_0xc3f8('0x57')]['id']?moment():null,'previousPasswords':authService[_0xc3f8('0x94')](_0x132d60[_0xc3f8('0x58')][_0xc3f8('0x89')],_0x14427e[_0xc3f8('0x92')])},null));})[_0xc3f8('0x11')](respondWithResult(_0x259ff9,null))[_0xc3f8('0x1c')](handleError(_0x259ff9,null));};exports[_0xc3f8('0x95')]=function(_0x38e365,_0x5085cf){var _0x31d6da=_0x38e365[_0xc3f8('0x58')][_0xc3f8('0x96')];return db['User'][_0xc3f8('0x35')]({'where':{'id':_0x38e365[_0xc3f8('0x57')]['id']},'attributes':['id','name',_0xc3f8('0x29'),'online',_0xc3f8('0x97'),'voicePause',_0xc3f8('0x98')]})[_0xc3f8('0x11')](handleEntityNotFound(_0x5085cf,null))[_0xc3f8('0x11')](function(_0x5b984d){if(_0x5b984d){if(!utils[_0xc3f8('0x99')](_0x31d6da)){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x9a'));}return _0x5b984d[_0xc3f8('0x9b')+_[_0xc3f8('0x9c')](_0x31d6da[_0xc3f8('0x9d')]())+'Queues'](_0x38e365[_0xc3f8('0x58')][_0xc3f8('0x5b')],{'penalty':_0x38e365[_0xc3f8('0x58')][_0xc3f8('0x9e')]||0x0})[_0xc3f8('0x9f')](function(_0x4337be){for(var _0x2eab2c=0x0;_0x2eab2c<_0x38e365[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x2eab2c+=0x1){var _0x1cc82b={'UserId':Number(_0x38e365[_0xc3f8('0x57')]['id'])};_0x1cc82b[_[_0xc3f8('0x9c')](_0x31d6da[_0xc3f8('0x9d')]())+'QueueId']=Number(_0x38e365[_0xc3f8('0x58')]['ids'][_0x2eab2c]);socket[_0xc3f8('0xa0')]('user'+_['capitalize'](_0x31d6da[_0xc3f8('0x9d')]())+_0xc3f8('0xa1'),_0x1cc82b);}return _0x4337be;})[_0xc3f8('0x11')](function(){if(_0x31d6da==='voice'){return db['VoiceQueue'][_0xc3f8('0x43')]({'where':{'id':_0x38e365[_0xc3f8('0x58')][_0xc3f8('0x5b')]||[]},'raw':!![],'attributes':['id',_0xc3f8('0x36')]});}})[_0xc3f8('0x11')](function(_0x5ecde8){var _0x44948e=_0x5b984d[_0xc3f8('0x28')]({'plain':!![]});var _0x1e5530=[];if(_0x31d6da==='voice'&&_0x44948e['role']===_0xc3f8('0x2e')&&_0x44948e['online']){for(var _0x574a1b=0x0;_0x574a1b<_0x5ecde8['length'];_0x574a1b+=0x1){_0x1e5530[_0xc3f8('0x41')]({'membername':_0x44948e[_0xc3f8('0x36')],'UserId':_0x44948e['id'],'queue_name':_0x5ecde8[_0x574a1b][_0xc3f8('0x36')],'VoiceQueueId':_0x5ecde8[_0x574a1b]['id'],'interface':_[_0xc3f8('0xa2')](_0x44948e['interface'])?util[_0xc3f8('0xa3')](_0xc3f8('0xa4'),_0x44948e[_0xc3f8('0x36')]):_0x44948e['interface'],'paused':_0x44948e[_0xc3f8('0xa5')]||![],'penalty':_0x38e365[_0xc3f8('0x58')][_0xc3f8('0x9e')]||0x0});}return BPromise[_0xc3f8('0x84')](_0x1e5530,function(_0x2e95aa){return db['UserVoiceQueueRt'][_0xc3f8('0xa6')](_0x2e95aa);});}return _0x5b984d;});}})[_0xc3f8('0x11')](respondWithStatusCode(_0x5085cf,null))[_0xc3f8('0x1c')](handleError(_0x5085cf,null));};exports[_0xc3f8('0xa7')]=function(_0x450622,_0x21f724){var _0x488ec8;return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x450622['params']['id']},'attributes':['id',_0xc3f8('0x36'),_0xc3f8('0x29')]})[_0xc3f8('0x11')](handleEntityNotFound(_0x21f724,null))['then'](function(_0x38f806){if(_0x38f806){_0x488ec8=_0x38f806;if(!_0x450622['query'][_0xc3f8('0x96')]||!utils[_0xc3f8('0x99')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x96')])){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x9a'));}return _0x38f806[_0xc3f8('0xa8')+_[_0xc3f8('0x9c')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x96')][_0xc3f8('0x9d')]())+_0xc3f8('0xa9')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x5b')]);}})[_0xc3f8('0x11')](function(_0x5a9d28){if(_[_0xc3f8('0xaa')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x5b')])){for(var _0x3a53a9=0x0;_0x3a53a9<_0x450622[_0xc3f8('0x45')]['ids'][_0xc3f8('0x47')];_0x3a53a9+=0x1){var _0x204330={'UserId':Number(_0x450622[_0xc3f8('0x57')]['id'])};_0x204330[_[_0xc3f8('0x9c')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x96')][_0xc3f8('0x9d')]())+'QueueId']=Number(_0x450622[_0xc3f8('0x45')]['ids'][_0x3a53a9]);socket['emit'](_0xc3f8('0x2c')+_[_0xc3f8('0x9c')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x96')][_0xc3f8('0x9d')]())+'Queue:remove',_0x204330);}}else{var _0x204330={'UserId':Number(_0x450622['params']['id'])};_0x204330[_[_0xc3f8('0x9c')](_0x450622[_0xc3f8('0x45')]['channel'][_0xc3f8('0x9d')]())+_0xc3f8('0xab')]=Number(_0x450622['query'][_0xc3f8('0x5b')]);socket[_0xc3f8('0xa0')](_0xc3f8('0x2c')+_[_0xc3f8('0x9c')](_0x450622[_0xc3f8('0x45')][_0xc3f8('0x96')][_0xc3f8('0x9d')]())+_0xc3f8('0xac'),_0x204330);}return _0x5a9d28;})[_0xc3f8('0x11')](function(){if(_0x450622[_0xc3f8('0x45')][_0xc3f8('0x96')]==='voice'){return db[_0xc3f8('0xad')]['destroy']({'where':{'UserId':_0x450622[_0xc3f8('0x57')]['id'],'VoiceQueueId':_0x450622['query'][_0xc3f8('0x5b')]},'individualHooks':!![]})[_0xc3f8('0x11')](function(){return _0x488ec8;});}return _0x488ec8;})['then'](respondWithStatusCode(_0x21f724,null))['catch'](handleError(_0x21f724,null));};exports['addAvatar']=function(_0x1a423a,_0xbc517d){_0x1a423a[_0xc3f8('0x58')][_0xc3f8('0xae')]=_0x1a423a[_0xc3f8('0xaf')][_0xc3f8('0xb0')];return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x1a423a[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0xbc517d,null))[_0xc3f8('0x11')](saveUpdates(_0x1a423a[_0xc3f8('0x58')],null))['then'](respondWithResult(_0xbc517d,null))[_0xc3f8('0x1c')](handleError(_0xbc517d,null));};exports[_0xc3f8('0xb1')]=function(_0x2dc74f,_0x31d2d5){var _0x18bacd=path[_0xc3f8('0xb2')](config[_0xc3f8('0xb3')],_0xc3f8('0xb4'));return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x2dc74f[_0xc3f8('0x57')]['id']},'attributes':['id',_0xc3f8('0xae')],'raw':!![]})[_0xc3f8('0x11')](handleEntityNotFound(_0x31d2d5,null))[_0xc3f8('0x11')](function(_0x3d088a){if(_0x3d088a){if(_[_0xc3f8('0xa2')](_0x3d088a[_0xc3f8('0xae')])){return _0x31d2d5[_0xc3f8('0xb5')](_0x18bacd);}else{if(!fs[_0xc3f8('0xb6')](path[_0xc3f8('0xb2')](config[_0xc3f8('0xb3')],_0xc3f8('0xb7'),_0x3d088a[_0xc3f8('0xae')]))){return _0x31d2d5[_0xc3f8('0xb5')](_0x18bacd);}return _0x31d2d5[_0xc3f8('0xb5')](path[_0xc3f8('0xb2')](config[_0xc3f8('0xb3')],_0xc3f8('0xb7'),_0x3d088a[_0xc3f8('0xae')]));}}})[_0xc3f8('0x1c')](handleError(_0x31d2d5,null));};exports[_0xc3f8('0xb8')]=function(_0x3a89ba,_0x4fb914){return db['User']['find']({'where':{'id':_0x3a89ba[_0xc3f8('0x57')]['id']},'attributes':['id']})[_0xc3f8('0x11')](handleEntityNotFound(_0x4fb914,null))[_0xc3f8('0x11')](function(_0x565405){var _0x5495a3=[];values=_0x565405['dataValues'];_0x5495a3[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x48'),_0x565405[_0xc3f8('0x49')]));_0x5495a3[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4a'),_0x565405['dataValues']));_0x5495a3['push'](get_open_tabs(_0xc3f8('0x4d'),_0x565405['dataValues']));_0x5495a3['push'](get_open_tabs(_0xc3f8('0xb9'),_0x565405[_0xc3f8('0x49')]));_0x5495a3['push'](get_open_tabs('fax',_0x565405[_0xc3f8('0x49')]));_0x5495a3[_0xc3f8('0x41')](get_open_tabs(_0xc3f8('0x4c'),_0x565405[_0xc3f8('0x49')]));return BPromise['all'](_0x5495a3);})[_0xc3f8('0x11')](function(_0x16a074){var _0x38b73a=[];if(_0x16a074){for(var _0x3284eb=0x0;_0x3284eb<values[_0xc3f8('0xba')]['length'];_0x3284eb++){var _0x513b34=values[_0xc3f8('0xba')][_0x3284eb];_0x38b73a[_0xc3f8('0x41')]({'channel':_0xc3f8('0xbb'),'id':_0x513b34['id'],'createdAt':_0x513b34[_0xc3f8('0xbc')]});}for(var _0x3284eb=0x0;_0x3284eb<values[_0xc3f8('0xbd')][_0xc3f8('0x47')];_0x3284eb++){var _0x513b34=values['FaxOpenTabs'][_0x3284eb];_0x38b73a[_0xc3f8('0x41')]({'channel':_0xc3f8('0xbe'),'id':_0x513b34['id'],'createdAt':_0x513b34[_0xc3f8('0xbc')]});}for(var _0x3284eb=0x0;_0x3284eb<values[_0xc3f8('0xbf')]['length'];_0x3284eb++){var _0x513b34=values['OpenchannelOpenTabs'][_0x3284eb];_0x38b73a['push']({'channel':_0xc3f8('0xc0'),'id':_0x513b34['id'],'createdAt':_0x513b34[_0xc3f8('0xbc')]});}for(var _0x3284eb=0x0;_0x3284eb<values[_0xc3f8('0xc1')][_0xc3f8('0x47')];_0x3284eb++){var _0x513b34=values[_0xc3f8('0xc1')][_0x3284eb];_0x38b73a[_0xc3f8('0x41')]({'channel':_0xc3f8('0xc2'),'id':_0x513b34['id'],'createdAt':_0x513b34['createdAt']});}for(var _0x3284eb=0x0;_0x3284eb<values[_0xc3f8('0xc3')][_0xc3f8('0x47')];_0x3284eb++){var _0x513b34=values[_0xc3f8('0xc3')][_0x3284eb];_0x38b73a[_0xc3f8('0x41')]({'channel':_0xc3f8('0xc4'),'id':_0x513b34['id'],'createdAt':_0x513b34[_0xc3f8('0xbc')]});}for(var _0x3284eb=0x0;_0x3284eb<values[_0xc3f8('0xc5')]['length'];_0x3284eb++){var _0x513b34=values[_0xc3f8('0xc5')][_0x3284eb];_0x38b73a['push']({'channel':_0xc3f8('0xc6'),'id':_0x513b34['id'],'createdAt':_0x513b34[_0xc3f8('0xbc')]});}var _0x131c87={'count':_0x38b73a['length'],'rows':_0x38b73a};return _0x131c87;}else return null;})['then'](respondWithResult(_0x4fb914,null))[_0xc3f8('0x1c')](handleError(_0x4fb914,null));};exports[_0xc3f8('0xc7')]=function(_0x2aceb8,_0x3c97ba){var _0x2a638d={};var _0x38f7c4={};var _0x5f3167;var _0x97caf1;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x2aceb8['params']['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x3c97ba,null))[_0xc3f8('0x11')](function(_0x56e0bc){if(_0x56e0bc){_0x5f3167=_0x56e0bc;_0x38f7c4['model']=_[_0xc3f8('0x52')](db['CmContact'][_0xc3f8('0x39')]);_0x38f7c4['query']=_[_0xc3f8('0x52')](_0x2aceb8[_0xc3f8('0x45')]);_0x38f7c4[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x38f7c4[_0xc3f8('0x50')],_0x38f7c4['query']);_0x2a638d[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x38f7c4[_0xc3f8('0x50')],qs['fields'](_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x2a638d[_0xc3f8('0x40')]=_0x2a638d[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x2a638d[_0xc3f8('0x40')]:_0x38f7c4['model'];_0x2a638d['order']=qs[_0xc3f8('0xca')](_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x2a638d[_0xc3f8('0xcb')]=qs['filters'](_[_0xc3f8('0xcc')](_0x2aceb8[_0xc3f8('0x45')],_0x38f7c4[_0xc3f8('0xc9')]));if(_0x2aceb8['query'][_0xc3f8('0x31')]){_0x2a638d[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x2a638d[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x2a638d[_0xc3f8('0x40')],function(_0x103abc){var _0x2ce7e3={};_0x2ce7e3[_0x103abc]={'$like':'%'+_0x2aceb8[_0xc3f8('0x45')]['filter']+'%'};return _0x2ce7e3;})});}_0x2a638d=_[_0xc3f8('0xcd')]({},_0x2a638d,_0x2aceb8[_0xc3f8('0x56')]);return _0x5f3167[_0xc3f8('0xc7')](_0x2a638d);}})[_0xc3f8('0x11')](function(_0x2a5927){if(_0x2a5927){_0x97caf1=_0x2a5927[_0xc3f8('0x47')];if(_0x2aceb8['query']['hasOwnProperty'](_0xc3f8('0x55'))){_0x2a638d['include']=[{'model':db[_0xc3f8('0xce')],'as':_0xc3f8('0xcf'),'required':![]},{'model':db[_0xc3f8('0xd0')],'as':_0xc3f8('0xd1'),'attributes':['id',_0xc3f8('0x36'),'color'],'where':_0x2aceb8['query'][_0xc3f8('0xd2')]?{'id':_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0xd2')]}:undefined,'required':_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0xd2')]?!![]:![]}];}if(!_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x2a638d['limit']=qs[_0xc3f8('0x21')](_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x2a638d[_0xc3f8('0x20')]=qs['offset'](_0x2aceb8[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x5f3167['getContacts'](_0x2a638d);}})[_0xc3f8('0x11')](function(_0x4da608){if(_0x4da608){return _0x4da608?{'count':_0x97caf1,'rows':_0x4da608}:null;}})['then'](respondWithResult(_0x3c97ba,null))[_0xc3f8('0x1c')](handleError(_0x3c97ba,null));};exports['getQueues']=function(_0x10bd96,_0x2db24){var _0x569f62;var _0x48c8bb;var _0x4ce116={};var _0x46cedb;return db['User']['findOne']({'where':{'id':_0x10bd96[_0xc3f8('0x57')]['id']},'attributes':['id','name','role']})[_0xc3f8('0x11')](handleEntityNotFound(_0x2db24,null))[_0xc3f8('0x11')](function(_0x82ad5c){if(!utils[_0xc3f8('0x99')](_0x10bd96['query'][_0xc3f8('0x96')])){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x9a'));}_0x569f62=_0x82ad5c;var _0x6cdcf5={};_0x6cdcf5[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_[_0xc3f8('0x9c')](_0x10bd96[_0xc3f8('0x45')][_0xc3f8('0x96')])+'Queue'][_0xc3f8('0x39')]);_0x6cdcf5[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x10bd96[_0xc3f8('0x45')]);_0x6cdcf5[_0xc3f8('0xc9')]=_['intersection'](_0x6cdcf5[_0xc3f8('0x50')],_0x6cdcf5[_0xc3f8('0x45')]);_0x4ce116[_0xc3f8('0x40')]=_['intersection'](_0x6cdcf5[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x10bd96['query'][_0xc3f8('0x54')]));_0x4ce116[_0xc3f8('0x40')]=_0x4ce116[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x4ce116[_0xc3f8('0x40')]:_0x6cdcf5[_0xc3f8('0x50')];_0x4ce116[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x10bd96[_0xc3f8('0x45')]['sort']);_0x4ce116[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x10bd96['query'],_0x6cdcf5['filters']));if(_0x10bd96[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x4ce116[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x4ce116[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x4ce116[_0xc3f8('0x40')],function(_0x2d6f8b){var _0x1e1587={};_0x1e1587[_0x2d6f8b]={'$like':'%'+_0x10bd96[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x1e1587;})});}_0x4ce116=_[_0xc3f8('0xcd')]({},_0x4ce116,_0x10bd96['options']);switch(_0x569f62[_0xc3f8('0x29')]){case _0xc3f8('0x2a'):return db[_[_0xc3f8('0x9c')](_0x10bd96[_0xc3f8('0x45')][_0xc3f8('0x96')])+_0xc3f8('0xd6')][_0xc3f8('0x43')](_0x4ce116);case _0xc3f8('0x2c'):case _0xc3f8('0x2e'):return _0x569f62['get'+_['capitalize'](_0x10bd96[_0xc3f8('0x45')][_0xc3f8('0x96')])+_0xc3f8('0xa9')](_0x4ce116);default:throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0xd7'));}})[_0xc3f8('0x11')](function(_0x2a36a9){_0x46cedb=_0x2a36a9[_0xc3f8('0x47')];if(!_0x10bd96['query'][_0xc3f8('0xd3')]('nolimit')){_0x4ce116['limit']=qs[_0xc3f8('0x21')](_0x10bd96['query']['limit']);_0x4ce116['offset']=qs[_0xc3f8('0x20')](_0x10bd96['query'][_0xc3f8('0x20')]);}switch(_0x569f62[_0xc3f8('0x29')]){case'admin':return db[_[_0xc3f8('0x9c')](_0x10bd96[_0xc3f8('0x45')][_0xc3f8('0x96')])+_0xc3f8('0xd6')]['findAll'](_0x4ce116);case _0xc3f8('0x2c'):case _0xc3f8('0x2e'):return _0x569f62[_0xc3f8('0x28')+_[_0xc3f8('0x9c')](_0x10bd96['query'][_0xc3f8('0x96')])+_0xc3f8('0xa9')](_0x4ce116);}})['then'](function(_0xd512ad){return{'count':_0x46cedb,'rows':_0xd512ad};})[_0xc3f8('0x11')](respondWithResult(_0x2db24,null))[_0xc3f8('0x1c')](handleError(_0x2db24,null));};exports[_0xc3f8('0xd8')]=function(_0x3f7dd0,_0x371de5){var _0x44d716={};var _0x97ce27={};var _0x2a9310;var _0x39dad0;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x3f7dd0['params']['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x371de5,null))[_0xc3f8('0x11')](function(_0x5d740f){if(_0x5d740f){_0x2a9310=_0x5d740f;_0x97ce27[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xad')][_0xc3f8('0x39')]);_0x97ce27['query']=_[_0xc3f8('0x52')](_0x3f7dd0['query']);_0x97ce27[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x97ce27[_0xc3f8('0x50')],_0x97ce27[_0xc3f8('0x45')]);_0x44d716[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x97ce27[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x3f7dd0[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x44d716[_0xc3f8('0x40')]=_0x44d716[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x44d716['attributes']:_0x97ce27[_0xc3f8('0x50')];_0x44d716[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x3f7dd0[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x44d716[_0xc3f8('0xcb')]=qs['filters'](_['pick'](_0x3f7dd0[_0xc3f8('0x45')],_0x97ce27[_0xc3f8('0xc9')]));if(_0x3f7dd0[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x44d716[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x44d716[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x44d716[_0xc3f8('0x40')],function(_0xb57378){var _0x5cbb57={};_0x5cbb57[_0xb57378]={'$like':'%'+_0x3f7dd0[_0xc3f8('0x45')]['filter']+'%'};return _0x5cbb57;})});}_0x44d716=_[_0xc3f8('0xcd')]({},_0x44d716,_0x3f7dd0[_0xc3f8('0x56')]);return _0x2a9310[_0xc3f8('0xd8')](_0x44d716);}})['then'](function(_0xcf6a3e){if(_0xcf6a3e){_0x39dad0=_0xcf6a3e[_0xc3f8('0x47')];if(!_0x3f7dd0['query']['hasOwnProperty'](_0xc3f8('0xd4'))){_0x44d716[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x3f7dd0['query']['limit']);_0x44d716[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x3f7dd0[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x2a9310[_0xc3f8('0xd8')](_0x44d716);}})[_0xc3f8('0x11')](function(_0x5b75f9){if(_0x5b75f9){return _0x5b75f9?{'count':_0x39dad0,'rows':_0x5b75f9}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x371de5,null))[_0xc3f8('0x1c')](handleError(_0x371de5,null));};exports[_0xc3f8('0xd9')]=function(_0x2d2b55,_0x2966be){var _0x5b19ea={};var _0x26c6b8={};var _0x7dc9a;var _0x2e2558;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x2d2b55[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x2966be,null))[_0xc3f8('0x11')](function(_0x499f6a){if(_0x499f6a){_0x7dc9a=_0x499f6a;_0x26c6b8[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xda')][_0xc3f8('0x39')]);_0x26c6b8[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x2d2b55['query']);_0x26c6b8[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x26c6b8['model'],_0x26c6b8[_0xc3f8('0x45')]);_0x5b19ea[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x26c6b8[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x2d2b55[_0xc3f8('0x45')]['fields']));_0x5b19ea[_0xc3f8('0x40')]=_0x5b19ea[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x5b19ea['attributes']:_0x26c6b8[_0xc3f8('0x50')];_0x5b19ea['order']=qs[_0xc3f8('0xca')](_0x2d2b55[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x5b19ea[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x2d2b55[_0xc3f8('0x45')],_0x26c6b8[_0xc3f8('0xc9')]));if(_0x2d2b55['query']['filter']){_0x5b19ea['where']=_[_0xc3f8('0xcd')](_0x5b19ea['where'],{'$or':_['map'](_0x5b19ea['attributes'],function(_0xba7d31){var _0x446ba4={};_0x446ba4[_0xba7d31]={'$like':'%'+_0x2d2b55[_0xc3f8('0x45')]['filter']+'%'};return _0x446ba4;})});}_0x5b19ea=_['merge']({},_0x5b19ea,_0x2d2b55['options']);return _0x7dc9a['getGroups'](_0x5b19ea);}})['then'](function(_0x38714a){if(_0x38714a){_0x2e2558=_0x38714a[_0xc3f8('0x47')];if(!_0x2d2b55[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x5b19ea[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x2d2b55[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x5b19ea[_0xc3f8('0x20')]=qs['offset'](_0x2d2b55[_0xc3f8('0x45')]['offset']);}return _0x7dc9a['getGroups'](_0x5b19ea);}})[_0xc3f8('0x11')](function(_0x2ed4a6){if(_0x2ed4a6){return _0x2ed4a6?{'count':_0x2e2558,'rows':_0x2ed4a6}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x2966be,null))['catch'](handleError(_0x2966be,null));};exports[_0xc3f8('0xdb')]=function(_0x38d0ec,_0x254e56){var _0x5cd036={'raw':!![],'where':{}};var _0x5de922={};var _0x4bb992={'count':0x0,'rows':[]};return db[_0xc3f8('0x42')]['findOne']({'where':{'id':_0x38d0ec[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x254e56,null))[_0xc3f8('0x11')](function(_0x47bb2e){if(_0x47bb2e){_0x5de922[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xdc')][_0xc3f8('0x39')]);_0x5de922[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x38d0ec[_0xc3f8('0x45')]);_0x5de922[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x5de922['model'],_0x5de922['query']);_0x5cd036[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x5de922[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x38d0ec[_0xc3f8('0x45')]['fields']));_0x5cd036[_0xc3f8('0x40')]=_0x5cd036[_0xc3f8('0x40')]['length']?_0x5cd036[_0xc3f8('0x40')]:_0x5de922[_0xc3f8('0x50')];if(!_0x38d0ec[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x5cd036[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x38d0ec['query']['limit']);_0x5cd036[_0xc3f8('0x20')]=qs['offset'](_0x38d0ec['query'][_0xc3f8('0x20')]);}_0x5cd036[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x38d0ec[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x5cd036[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x38d0ec['query'],_0x5de922[_0xc3f8('0xc9')]));_0x5cd036[_0xc3f8('0xcb')][_0xc3f8('0xdd')]=_0x47bb2e['id'];if(_0x38d0ec[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x5cd036[_0xc3f8('0xcb')]=_['merge'](_0x5cd036[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x5cd036[_0xc3f8('0x40')],function(_0x37775f){var _0x398d59={};_0x398d59[_0x37775f]={'$like':'%'+_0x38d0ec[_0xc3f8('0x45')]['filter']+'%'};return _0x398d59;})});}_0x5cd036=_[_0xc3f8('0xcd')]({},_0x5cd036,_0x38d0ec[_0xc3f8('0x56')]);return db[_0xc3f8('0xdc')]['count']({'where':_0x5cd036['where']})[_0xc3f8('0x11')](function(_0x5a73cc){_0x4bb992[_0xc3f8('0x23')]=_0x5a73cc;if(_0x38d0ec[_0xc3f8('0x45')][_0xc3f8('0x55')]){_0x5cd036[_0xc3f8('0x3e')]=[{'all':!![]}];}return db[_0xc3f8('0xdc')][_0xc3f8('0x43')](_0x5cd036);})['then'](function(_0x32e2a1){_0x4bb992['rows']=_0x32e2a1;return _0x4bb992;});}})[_0xc3f8('0x11')](respondWithFilteredResult(_0x254e56,_0x5cd036))['catch'](handleError(_0x254e56,null));};exports['getScreenRecordings']=function(_0x239ddc,_0x539c13){var _0x4e7ce5={'raw':!![],'where':{}};var _0x64fffa={};var _0x2904a1={'count':0x0,'rows':[]};return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x239ddc[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x539c13,null))[_0xc3f8('0x11')](function(_0x2243cc){if(_0x2243cc){_0x64fffa[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xde')][_0xc3f8('0x39')]);_0x64fffa[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x239ddc['query']);_0x64fffa[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x64fffa['model'],_0x64fffa[_0xc3f8('0x45')]);_0x4e7ce5[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x64fffa['model'],qs['fields'](_0x239ddc[_0xc3f8('0x45')]['fields']));_0x4e7ce5[_0xc3f8('0x40')]=_0x4e7ce5['attributes'][_0xc3f8('0x47')]?_0x4e7ce5[_0xc3f8('0x40')]:_0x64fffa[_0xc3f8('0x50')];if(!_0x239ddc[_0xc3f8('0x45')][_0xc3f8('0xd3')]('nolimit')){_0x4e7ce5[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x239ddc[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x4e7ce5[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x239ddc[_0xc3f8('0x45')][_0xc3f8('0x20')]);}_0x4e7ce5[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x239ddc[_0xc3f8('0x45')]['sort']);_0x4e7ce5[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x239ddc[_0xc3f8('0x45')],_0x64fffa[_0xc3f8('0xc9')]));_0x4e7ce5[_0xc3f8('0xcb')]['UserId']=_0x2243cc['id'];if(_0x239ddc[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x4e7ce5[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x4e7ce5[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x4e7ce5[_0xc3f8('0x40')],function(_0x3f3637){var _0x4a5e52={};_0x4a5e52[_0x3f3637]={'$like':'%'+_0x239ddc[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x4a5e52;})});}_0x4e7ce5=_['merge']({},_0x4e7ce5,_0x239ddc['options']);return db['ScreenRecording'][_0xc3f8('0x23')]({'where':_0x4e7ce5[_0xc3f8('0xcb')]})['then'](function(_0x22c204){_0x2904a1[_0xc3f8('0x23')]=_0x22c204;if(_0x239ddc[_0xc3f8('0x45')][_0xc3f8('0x55')]){_0x4e7ce5[_0xc3f8('0x3e')]=[{'all':!![]}];}return db[_0xc3f8('0xde')]['findAll'](_0x4e7ce5);})[_0xc3f8('0x11')](function(_0x3d3c52){_0x2904a1['rows']=_0x3d3c52;return _0x2904a1;});}})[_0xc3f8('0x11')](respondWithFilteredResult(_0x539c13,_0x4e7ce5))[_0xc3f8('0x1c')](handleError(_0x539c13,null));};exports[_0xc3f8('0xdf')]=function(_0x5093dd,_0x6a4adb){var _0x47b275={};var _0x4cb7e3={};var _0x37d4de;var _0x553349;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x5093dd[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x6a4adb,null))[_0xc3f8('0x11')](function(_0x386dc0){if(_0x386dc0){_0x37d4de=_0x386dc0;_0x4cb7e3[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xe0')][_0xc3f8('0x39')]);_0x4cb7e3['query']=_['keys'](_0x5093dd[_0xc3f8('0x45')]);_0x4cb7e3[_0xc3f8('0xc9')]=_['intersection'](_0x4cb7e3['model'],_0x4cb7e3[_0xc3f8('0x45')]);_0x47b275[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x4cb7e3['model'],qs['fields'](_0x5093dd[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x47b275[_0xc3f8('0x40')]=_0x47b275[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x47b275[_0xc3f8('0x40')]:_0x4cb7e3[_0xc3f8('0x50')];_0x47b275['order']=qs['sort'](_0x5093dd['query']['sort']);_0x47b275[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_['pick'](_0x5093dd[_0xc3f8('0x45')],_0x4cb7e3[_0xc3f8('0xc9')]));if(_0x5093dd[_0xc3f8('0x45')]['filter']){_0x47b275[_0xc3f8('0xcb')]=_['merge'](_0x47b275[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x47b275[_0xc3f8('0x40')],function(_0x110a51){var _0x407da5={};_0x407da5[_0x110a51]={'$like':'%'+_0x5093dd[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x407da5;})});}_0x47b275=_[_0xc3f8('0xcd')]({},_0x47b275,_0x5093dd[_0xc3f8('0x56')]);return _0x37d4de['getChatInteractions'](_0x47b275);}})['then'](function(_0x43f015){if(_0x43f015){_0x553349=_0x43f015['length'];if(!_0x5093dd[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x47b275[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x5093dd[_0xc3f8('0x45')]['limit']);_0x47b275[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x5093dd['query']['offset']);}return _0x37d4de[_0xc3f8('0xdf')](_0x47b275);}})[_0xc3f8('0x11')](function(_0x3a32b1){if(_0x3a32b1){return _0x3a32b1?{'count':_0x553349,'rows':_0x3a32b1}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x6a4adb,null))[_0xc3f8('0x1c')](handleError(_0x6a4adb,null));};exports[_0xc3f8('0xe1')]=function(_0x20105b,_0x5eb30a){var _0x5e7826={};var _0x6f6f13={};var _0x289f24;var _0x329101;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x20105b['params']['id']}})['then'](handleEntityNotFound(_0x5eb30a,null))[_0xc3f8('0x11')](function(_0x529352){if(_0x529352){_0x289f24=_0x529352;_0x6f6f13[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xe2')][_0xc3f8('0x39')]);_0x6f6f13[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x20105b[_0xc3f8('0x45')]);_0x6f6f13['filters']=_[_0xc3f8('0x53')](_0x6f6f13['model'],_0x6f6f13[_0xc3f8('0x45')]);_0x5e7826[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x6f6f13[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x20105b[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x5e7826['attributes']=_0x5e7826[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x5e7826[_0xc3f8('0x40')]:_0x6f6f13['model'];_0x5e7826[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x20105b[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x5e7826[_0xc3f8('0xcb')]=qs['filters'](_[_0xc3f8('0xcc')](_0x20105b['query'],_0x6f6f13['filters']));if(_0x20105b['query'][_0xc3f8('0x31')]){_0x5e7826[_0xc3f8('0xcb')]=_['merge'](_0x5e7826[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x5e7826[_0xc3f8('0x40')],function(_0x144687){var _0x34518f={};_0x34518f[_0x144687]={'$like':'%'+_0x20105b[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x34518f;})});}_0x5e7826=_[_0xc3f8('0xcd')]({},_0x5e7826,_0x20105b[_0xc3f8('0x56')]);return _0x289f24[_0xc3f8('0xe1')](_0x5e7826);}})['then'](function(_0x28491a){if(_0x28491a){_0x329101=_0x28491a['length'];if(!_0x20105b[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x5e7826[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x20105b['query'][_0xc3f8('0x21')]);_0x5e7826[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x20105b[_0xc3f8('0x45')]['offset']);}return _0x289f24[_0xc3f8('0xe1')](_0x5e7826);}})['then'](function(_0x22c521){if(_0x22c521){return _0x22c521?{'count':_0x329101,'rows':_0x22c521}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x5eb30a,null))[_0xc3f8('0x1c')](handleError(_0x5eb30a,null));};exports[_0xc3f8('0xe3')]=function(_0x425724,_0x2aca06){var _0x1a696a={'raw':!![],'where':{}};var _0x4d242d={};var _0x308989={'count':0x0,'rows':[]};return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x425724[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x2aca06,null))[_0xc3f8('0x11')](function(_0x33d28a){if(_0x33d28a){_0x4d242d[_0xc3f8('0x50')]=_['keys'](db['MailInteraction'][_0xc3f8('0x39')]);_0x4d242d['query']=_['keys'](_0x425724[_0xc3f8('0x45')]);_0x4d242d[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x4d242d[_0xc3f8('0x50')],_0x4d242d['query']);_0x1a696a['attributes']=_[_0xc3f8('0x53')](_0x4d242d['model'],qs[_0xc3f8('0x54')](_0x425724[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x1a696a[_0xc3f8('0x40')]=_0x1a696a[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x1a696a[_0xc3f8('0x40')]:_0x4d242d[_0xc3f8('0x50')];if(!_0x425724[_0xc3f8('0x45')]['hasOwnProperty']('nolimit')){_0x1a696a['limit']=qs[_0xc3f8('0x21')](_0x425724[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x1a696a[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x425724[_0xc3f8('0x45')][_0xc3f8('0x20')]);}_0x1a696a[_0xc3f8('0xd5')]=qs['sort'](_0x425724[_0xc3f8('0x45')]['sort']);_0x1a696a[_0xc3f8('0xcb')]=qs['filters'](_[_0xc3f8('0xcc')](_0x425724[_0xc3f8('0x45')],_0x4d242d[_0xc3f8('0xc9')]));_0x1a696a[_0xc3f8('0xcb')][_0xc3f8('0xdd')]=_0x33d28a['id'];if(_0x425724[_0xc3f8('0x45')]['filter']){_0x1a696a[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x1a696a[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x1a696a[_0xc3f8('0x40')],function(_0x4a512e){var _0x186e21={};_0x186e21[_0x4a512e]={'$like':'%'+_0x425724[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x186e21;})});}_0x1a696a=_['merge']({},_0x1a696a,_0x425724[_0xc3f8('0x56')]);return db[_0xc3f8('0xe4')][_0xc3f8('0x23')]({'where':_0x1a696a[_0xc3f8('0xcb')]})[_0xc3f8('0x11')](function(_0x199ec4){_0x308989[_0xc3f8('0x23')]=_0x199ec4;if(_0x425724[_0xc3f8('0x45')]['includeAll']){_0x1a696a['include']=[{'all':!![]}];}return db[_0xc3f8('0xe4')][_0xc3f8('0x43')](_0x1a696a);})[_0xc3f8('0x11')](function(_0x506be2){_0x308989[_0xc3f8('0x44')]=_0x506be2;return _0x308989;});}})['then'](respondWithFilteredResult(_0x2aca06,_0x1a696a))[_0xc3f8('0x1c')](handleError(_0x2aca06,null));};exports[_0xc3f8('0xe5')]=function(_0xc1df6b,_0x18aacd){var _0x5d4557={};var _0x9b2cf6={};var _0x1f6c05;var _0x7c6d68;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0xc1df6b[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x18aacd,null))[_0xc3f8('0x11')](function(_0x4ff67f){if(_0x4ff67f){_0x1f6c05=_0x4ff67f;_0x9b2cf6[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xe6')][_0xc3f8('0x39')]);_0x9b2cf6[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0xc1df6b[_0xc3f8('0x45')]);_0x9b2cf6[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x9b2cf6['model'],_0x9b2cf6[_0xc3f8('0x45')]);_0x5d4557[_0xc3f8('0x40')]=_['intersection'](_0x9b2cf6[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0xc1df6b[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x5d4557[_0xc3f8('0x40')]=_0x5d4557[_0xc3f8('0x40')]['length']?_0x5d4557[_0xc3f8('0x40')]:_0x9b2cf6[_0xc3f8('0x50')];_0x5d4557[_0xc3f8('0xd5')]=qs['sort'](_0xc1df6b['query'][_0xc3f8('0xca')]);_0x5d4557[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_['pick'](_0xc1df6b[_0xc3f8('0x45')],_0x9b2cf6[_0xc3f8('0xc9')]));if(_0xc1df6b['query'][_0xc3f8('0x31')]){_0x5d4557[_0xc3f8('0xcb')]=_['merge'](_0x5d4557[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x5d4557['attributes'],function(_0x4e6e12){var _0x4c00b1={};_0x4c00b1[_0x4e6e12]={'$like':'%'+_0xc1df6b['query'][_0xc3f8('0x31')]+'%'};return _0x4c00b1;})});}_0x5d4557=_[_0xc3f8('0xcd')]({},_0x5d4557,_0xc1df6b[_0xc3f8('0x56')]);return _0x1f6c05[_0xc3f8('0xe5')](_0x5d4557);}})['then'](function(_0x3f55ea){if(_0x3f55ea){_0x7c6d68=_0x3f55ea[_0xc3f8('0x47')];if(!_0xc1df6b[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x5d4557['limit']=qs[_0xc3f8('0x21')](_0xc1df6b[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x5d4557[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0xc1df6b[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x1f6c05[_0xc3f8('0xe5')](_0x5d4557);}})[_0xc3f8('0x11')](function(_0xf25666){if(_0xf25666){return _0xf25666?{'count':_0x7c6d68,'rows':_0xf25666}:null;}})['then'](respondWithResult(_0x18aacd,null))[_0xc3f8('0x1c')](handleError(_0x18aacd,null));};exports[_0xc3f8('0xe7')]=function(_0x2cf486,_0x13d388){var _0x3d8eea={};var _0x2c9290={};var _0x4d60bb;var _0x22722c;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x2cf486[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x13d388,null))['then'](function(_0x15d341){if(_0x15d341){_0x4d60bb=_0x15d341;_0x2c9290[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0xe8')][_0xc3f8('0x39')]);_0x2c9290[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x2cf486['query']);_0x2c9290[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x2c9290[_0xc3f8('0x50')],_0x2c9290[_0xc3f8('0x45')]);_0x3d8eea[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x2c9290['model'],qs[_0xc3f8('0x54')](_0x2cf486[_0xc3f8('0x45')]['fields']));_0x3d8eea[_0xc3f8('0x40')]=_0x3d8eea[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x3d8eea[_0xc3f8('0x40')]:_0x2c9290[_0xc3f8('0x50')];_0x3d8eea['order']=qs[_0xc3f8('0xca')](_0x2cf486['query'][_0xc3f8('0xca')]);_0x3d8eea[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_['pick'](_0x2cf486['query'],_0x2c9290[_0xc3f8('0xc9')]));if(_0x2cf486[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x3d8eea[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x3d8eea[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x3d8eea[_0xc3f8('0x40')],function(_0x15cecb){var _0x289844={};_0x289844[_0x15cecb]={'$like':'%'+_0x2cf486[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x289844;})});}_0x3d8eea=_[_0xc3f8('0xcd')]({},_0x3d8eea,_0x2cf486[_0xc3f8('0x56')]);return _0x4d60bb['getFaxInteractions'](_0x3d8eea);}})[_0xc3f8('0x11')](function(_0x5e7dca){if(_0x5e7dca){_0x22722c=_0x5e7dca[_0xc3f8('0x47')];if(!_0x2cf486[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x3d8eea[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x2cf486[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x3d8eea[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x2cf486['query'][_0xc3f8('0x20')]);}return _0x4d60bb[_0xc3f8('0xe7')](_0x3d8eea);}})[_0xc3f8('0x11')](function(_0x4f9d7c){if(_0x4f9d7c){return _0x4f9d7c?{'count':_0x22722c,'rows':_0x4f9d7c}:null;}})['then'](respondWithResult(_0x13d388,null))[_0xc3f8('0x1c')](handleError(_0x13d388,null));};exports[_0xc3f8('0xe9')]=function(_0x10145f,_0x1c6f8c){var _0x7785ae={};var _0x565e00={};var _0x53deb2;var _0x40f70d;return db[_0xc3f8('0x42')]['findOne']({'where':{'id':_0x10145f[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x1c6f8c,null))['then'](function(_0x268a5c){if(_0x268a5c){_0x53deb2=_0x268a5c;_0x565e00[_0xc3f8('0x50')]=_['keys'](db[_0xc3f8('0xea')]['rawAttributes']);_0x565e00[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x10145f[_0xc3f8('0x45')]);_0x565e00[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x565e00['model'],_0x565e00[_0xc3f8('0x45')]);_0x7785ae['attributes']=_['intersection'](_0x565e00[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x10145f[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x7785ae['attributes']=_0x7785ae[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x7785ae[_0xc3f8('0x40')]:_0x565e00[_0xc3f8('0x50')];_0x7785ae[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x10145f[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x7785ae[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x10145f[_0xc3f8('0x45')],_0x565e00['filters']));if(_0x10145f[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x7785ae[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x7785ae[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x7785ae[_0xc3f8('0x40')],function(_0x4dc9a6){var _0x4b52fb={};_0x4b52fb[_0x4dc9a6]={'$like':'%'+_0x10145f['query'][_0xc3f8('0x31')]+'%'};return _0x4b52fb;})});}_0x7785ae=_['merge']({},_0x7785ae,_0x10145f[_0xc3f8('0x56')]);return _0x53deb2[_0xc3f8('0xe9')](_0x7785ae);}})['then'](function(_0x2f49af){if(_0x2f49af){_0x40f70d=_0x2f49af[_0xc3f8('0x47')];if(!_0x10145f[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x7785ae[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x10145f[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x7785ae['offset']=qs['offset'](_0x10145f['query'][_0xc3f8('0x20')]);}return _0x53deb2['getWhatsappInteractions'](_0x7785ae);}})[_0xc3f8('0x11')](function(_0x2dc1dd){if(_0x2dc1dd){return _0x2dc1dd?{'count':_0x40f70d,'rows':_0x2dc1dd}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x1c6f8c,null))[_0xc3f8('0x1c')](handleError(_0x1c6f8c,null));};exports[_0xc3f8('0xeb')]=function(_0x516a75,_0x36bdcb,_0xf49df8){var _0x24b52f;var _0x5eaeca;var _0x1a42fa;var _0x36d0e1=!_[_0xc3f8('0xa2')](_0x516a75[_0xc3f8('0x57')]['id'])?_0x516a75[_0xc3f8('0x57')]['id']:!_[_0xc3f8('0xa2')](_0x516a75[_0xc3f8('0x2c')]['id'])?_0x516a75[_0xc3f8('0x2c')]['id']:null;return db['User'][_0xc3f8('0x35')]({'where':{'id':_0x36d0e1,'role':{'$or':[_0xc3f8('0x2a'),_0xc3f8('0x2c'),_0xc3f8('0x2e')]}},'attributes':['id',_0xc3f8('0x36'),_0xc3f8('0xec'),_0xc3f8('0xed'),_0xc3f8('0x29'),_0xc3f8('0x61'),_0xc3f8('0x97')]})['then'](function(_0x1004d7){if(_0x1004d7){if(_0x1004d7[_0xc3f8('0x29')]===_0xc3f8('0x2e')){_0x24b52f=_0x1004d7;if(_0x516a75['body'][_0xc3f8('0x98')]){_0x1a42fa=util['format'](_0xc3f8('0xee'),_0x24b52f[_0x516a75[_0xc3f8('0x58')][_0xc3f8('0x98')]]);}else if(_0x516a75[_0xc3f8('0x58')][_0xc3f8('0xef')]){_0x1a42fa=util[_0xc3f8('0xa3')]('SIP/%s',_0x516a75[_0xc3f8('0x58')][_0xc3f8('0xef')]);}else{_0x1a42fa=util[_0xc3f8('0xa3')]('SIP/%s',_0x24b52f[_0xc3f8('0x36')]);}socket['to'](util[_0xc3f8('0xa3')]('user:%s',_0x24b52f[_0xc3f8('0x36')]))[_0xc3f8('0xa0')](_0xc3f8('0xf0'),{'user':{'id':_0x24b52f['id'],'name':_0x24b52f[_0xc3f8('0x36')]},'ip':_0x516a75[_0xc3f8('0xf1')][_0xc3f8('0xf2')]||_0x516a75[_0xc3f8('0xf3')][_0xc3f8('0xf4')]||_0x516a75['socket'][_0xc3f8('0xf4')]||_0x516a75[_0xc3f8('0xf3')][_0xc3f8('0xf5')]['remoteAddress']});return db[_0xc3f8('0xad')][_0xc3f8('0x27')]({'where':{'membername':_0x24b52f['name']},'individualHooks':!![]});}}else{throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xc3f8('0x11')](function(){if(_0x24b52f){return _0x24b52f[_0xc3f8('0xf6')]({'raw':!![]});}})[_0xc3f8('0x11')](function(_0x38fea4){if(_0x24b52f){var _0x3bb412=[];if(_0x38fea4){_0x5eaeca=_0x38fea4;if(_0x5eaeca[_0xc3f8('0x47')]){for(var _0xdd825f=0x0;_0xdd825f<_0x5eaeca[_0xc3f8('0x47')];_0xdd825f++){_0x3bb412[_0xc3f8('0x41')]({'membername':_0x24b52f[_0xc3f8('0x36')],'UserId':_0x24b52f['id'],'queue_name':_0x5eaeca[_0xdd825f][_0xc3f8('0x36')],'VoiceQueueId':_0x5eaeca[_0xdd825f]['id'],'interface':_0x1a42fa,'paused':_0x24b52f[_0xc3f8('0x97')]||![],'penalty':_0x5eaeca[_0xdd825f][_0xc3f8('0xf7')]||0x0});}return BPromise[_0xc3f8('0x84')](_0x3bb412,function(_0x167abe){return db['UserVoiceQueueRt'][_0xc3f8('0xa6')](_0x167abe);});}}}})[_0xc3f8('0x11')](function(){if(_0x24b52f){return db[_0xc3f8('0xf8')][_0xc3f8('0x43')]({'where':{'membername':_0x24b52f[_0xc3f8('0x36')],'exitAt':null}});}})['then'](function(_0x2a857d){if(_0x24b52f){var _0x275be5=[];_0x2a857d[_0xc3f8('0xf9')](function(_0x4be758){_0x275be5[_0xc3f8('0x41')](_0x4be758[_0xc3f8('0x26')]({'exitAt':moment()[_0xc3f8('0xa3')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xc3f8('0x4e')](_0x275be5);}})['then'](function(){if(_0x24b52f){var _0x15bb69=[];var _0x220ff7=[];var _0xfe89aa=utils['getChannels']();var _0x860a1e={'membername':_0x24b52f['name'],'interface':_0x1a42fa,'enterAt':moment()[_0xc3f8('0xa3')](_0xc3f8('0xfa')),'role':_0x24b52f[_0xc3f8('0x29')],'internal':_0x24b52f[_0xc3f8('0x61')]};_0xfe89aa[_0xc3f8('0xf9')](function(_0x415fb0){_0x15bb69[_0xc3f8('0x41')](_[_0xc3f8('0xcd')]({'channel':_0x415fb0,'type':_0xc3f8('0xfb'),'data1':_0x516a75['body'][_0xc3f8('0xfc')],'data2':_0x1a42fa},_0x860a1e));if(_0x24b52f[_0xc3f8('0x97')]){_0x220ff7[_0xc3f8('0x41')](_[_0xc3f8('0xcd')]({'channel':_0x415fb0,'type':_0xc3f8('0xfd'),'data1':_0xc3f8('0xfe')},_0x860a1e));}});return db['MemberReport']['bulkCreate'](_0x15bb69[_0xc3f8('0xff')](_0x220ff7),{'individualHooks':!![]});}})['then'](function(){if(_0x24b52f){return _0x24b52f[_0xc3f8('0x26')]({'online':!![],'lastLoginAt':moment()[_0xc3f8('0xa3')](_0xc3f8('0xfa')),'voicePause':_0x24b52f[_0xc3f8('0x97')]||![],'mailPause':_0x24b52f[_0xc3f8('0x97')]||![],'chatPause':_0x24b52f[_0xc3f8('0x97')]||![],'faxPause':_0x24b52f[_0xc3f8('0x97')]||![],'smsPause':_0x24b52f[_0xc3f8('0x97')]||![],'openchannelPause':_0x24b52f[_0xc3f8('0x97')]||![],'whatsappPause':_0x24b52f[_0xc3f8('0x97')]||![],'pauseType':_0x24b52f[_0xc3f8('0x97')]?_0xc3f8('0xfe'):null,'interface':_0x1a42fa,'lastPauseAt':moment()[_0xc3f8('0xa3')](_0xc3f8('0xfa'))});}})[_0xc3f8('0x11')](function(_0x5a7f0a){if(_0x516a75[_0xc3f8('0x100')]){return _0xf49df8();}else{return BPromise['resolve'](_0x5a7f0a)[_0xc3f8('0x11')](respondWithResult(_0x36bdcb,null));}})['catch'](handleError(_0x36bdcb,null));};exports['logout']=function(_0x469c24,_0x4a221f){var _0x6743a5;return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x469c24[_0xc3f8('0x57')]['id'],'role':_0xc3f8('0x2e')},'attributes':['id',_0xc3f8('0x36'),_0xc3f8('0x29')]})['then'](handleEntityNotFound(_0x4a221f,null))['then'](function(_0x5a9170){if(_0x5a9170){_0x6743a5=_0x5a9170;return db[_0xc3f8('0xad')][_0xc3f8('0x27')]({'where':{'membername':_0x6743a5[_0xc3f8('0x36')]},'individualHooks':!![]});}})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x6743a5['name'],'exitAt':null}});})['then'](function(_0x1ad38b){var _0x304dc4=[];_0x1ad38b[_0xc3f8('0xf9')](function(_0x4f2236){_0x304dc4[_0xc3f8('0x41')](_0x4f2236[_0xc3f8('0x26')]({'exitAt':moment()['format'](_0xc3f8('0xfa'))}));});return BPromise[_0xc3f8('0x4e')](_0x304dc4);})['then'](function(){return _0x6743a5['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xc3f8('0x11')](respondWithResult(_0x4a221f,null))['catch'](handleError(_0x4a221f,null));};exports[_0xc3f8('0x101')]=function(_0x3b8553,_0x24b8a4){var _0x42b8f5;return db['UserVoiceQueueRt'][_0xc3f8('0x26')]({'paused':0x1},{'where':{'UserId':_0x3b8553[_0xc3f8('0x57')]['id']},'individualHooks':!![]})['then'](function(){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x3b8553[_0xc3f8('0x57')]['id'],'role':'agent'},'attributes':['id',_0xc3f8('0x36'),'role','internal',_0xc3f8('0x98')]});})['then'](handleEntityNotFound(_0x24b8a4,null))[_0xc3f8('0x11')](function(_0x39f3c4){if(_0x39f3c4){_0x42b8f5=_0x39f3c4;return respondWithRpcPromise('QueuePause',_0xc3f8('0x101'),{'id':_0x42b8f5['id'],'name':_0x42b8f5[_0xc3f8('0x36')],'pause':!![]});}})[_0xc3f8('0x11')](function(){if(_0x42b8f5){return db[_0xc3f8('0xf8')][_0xc3f8('0x43')]({'where':{'membername':_0x42b8f5['name'],'type':_0xc3f8('0xfd'),'exitAt':null}});}})[_0xc3f8('0x11')](function(_0x1585ee){if(_0x1585ee['length']){var _0x546338=moment()['format'](_0xc3f8('0xfa'));for(var _0x8a2d71=0x0,_0xbd977e=_0x1585ee['length'];_0x8a2d71<_0xbd977e;_0x8a2d71++){_0x1585ee[_0x8a2d71][_0xc3f8('0x102')]({'exitAt':_0x546338});}}})[_0xc3f8('0x11')](function(){var _0x26d703=[];var _0x5f3e45=utils[_0xc3f8('0x103')]();_0x5f3e45[_0xc3f8('0xf9')](function(_0x187459){_0x26d703[_0xc3f8('0x41')]({'channel':_0x187459,'membername':_0x42b8f5[_0xc3f8('0x36')],'interface':_[_0xc3f8('0xa2')](_0x42b8f5[_0xc3f8('0x98')])?util[_0xc3f8('0xa3')](_0xc3f8('0xa4'),_0x42b8f5[_0xc3f8('0x36')]):_0x42b8f5[_0xc3f8('0x98')],'type':'PAUSE','enterAt':moment()[_0xc3f8('0xa3')](_0xc3f8('0xfa')),'data1':_0x3b8553['body']['type']||_0xc3f8('0x104'),'role':_0x42b8f5['role'],'internal':_0x42b8f5[_0xc3f8('0x61')]});});return db[_0xc3f8('0xf8')]['bulkCreate'](_0x26d703,{'individualHooks':!![]});})[_0xc3f8('0x11')](function(){return _0x42b8f5[_0xc3f8('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3b8553['body'][_0xc3f8('0x3a')]||_0xc3f8('0x104'),'lastPauseAt':moment()['format'](_0xc3f8('0xfa'))});})['then'](respondWithResult(_0x24b8a4,null))[_0xc3f8('0x1c')](handleError(_0x24b8a4,null));};exports[_0xc3f8('0x105')]=function(_0x398ea5,_0x29b492){var _0x4dfed7;return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x398ea5[_0xc3f8('0x57')]['id']},'attributes':['id',_0xc3f8('0x36'),_0xc3f8('0x29'),'voicePause',_0xc3f8('0x106'),_0xc3f8('0x107'),_0xc3f8('0x108'),_0xc3f8('0x109'),_0xc3f8('0x10a'),_0xc3f8('0x10b'),_0xc3f8('0x10c'),'lastPauseAt']})[_0xc3f8('0x11')](handleEntityNotFound(_0x29b492,null))[_0xc3f8('0x11')](function(_0x3b3520){if(_0x3b3520){_0x4dfed7=_0x3b3520;if(_0x398ea5['body']['channel']&&!utils[_0xc3f8('0x99')](_0x398ea5[_0xc3f8('0x58')][_0xc3f8('0x96')])){throw new db[(_0xc3f8('0x8c'))][(_0xc3f8('0x8a'))](_0xc3f8('0x9a'));}switch(_0x398ea5[_0xc3f8('0x58')][_0xc3f8('0x96')]){case _0xc3f8('0x10d'):return respondWithRpcPromise(_0xc3f8('0x10e'),_0xc3f8('0x105'),{'id':_0x4dfed7['id'],'name':_0x4dfed7[_0xc3f8('0x36')],'pause':![]})[_0xc3f8('0x11')](function(){return db['UserVoiceQueueRt'][_0xc3f8('0x26')]({'paused':0x0},{'where':{'UserId':_0x4dfed7['id']},'individualHooks':!![]});})[_0xc3f8('0x11')](function(){return db[_0xc3f8('0xf8')][_0xc3f8('0x35')]({'where':{'channel':_0x398ea5[_0xc3f8('0x58')][_0xc3f8('0x96')],'membername':_0x4dfed7[_0xc3f8('0x36')],'type':_0xc3f8('0xfd'),'exitAt':null}});})['then'](function(_0x2aca34){if(_0x2aca34){return _0x2aca34[_0xc3f8('0x26')]({'exitAt':moment()[_0xc3f8('0xa3')](_0xc3f8('0xfa')),'data2':_0xc3f8('0x10f')},{'individualHooks':!![]});}return null;})[_0xc3f8('0x11')](function(){return _0x4dfed7[_0xc3f8('0x26')]({'voicePause':![]});});case _0xc3f8('0x4c'):case _0xc3f8('0x48'):case _0xc3f8('0x4b'):case _0xc3f8('0x4a'):case _0xc3f8('0xb9'):case'openchannel':return db[_0xc3f8('0xf8')][_0xc3f8('0x35')]({'where':{'channel':_0x398ea5['body'][_0xc3f8('0x96')],'membername':_0x4dfed7[_0xc3f8('0x36')],'type':'PAUSE','exitAt':null}})['then'](function(_0x49368b){if(_0x49368b){return _0x49368b[_0xc3f8('0x26')]({'exitAt':moment()[_0xc3f8('0xa3')](_0xc3f8('0xfa')),'data2':_0xc3f8('0x10f')},{'individualHooks':!![]});}return null;})[_0xc3f8('0x11')](function(){var _0x30b8b7={};_[_0xc3f8('0x24')](_0x30b8b7,util[_0xc3f8('0xa3')](_0xc3f8('0x110'),_0x398ea5[_0xc3f8('0x58')]['channel'],_0xc3f8('0x111')),![]);return _0x4dfed7['update'](_0x30b8b7);});default:return respondWithRpcPromise(_0xc3f8('0x10e'),_0xc3f8('0x105'),{'id':_0x4dfed7['id'],'name':_0x4dfed7[_0xc3f8('0x36')],'pause':![]})[_0xc3f8('0x11')](function(){return db[_0xc3f8('0xad')][_0xc3f8('0x26')]({'paused':0x0},{'where':{'UserId':_0x4dfed7['id']}});})['then'](function(){return db[_0xc3f8('0xf8')][_0xc3f8('0x43')]({'where':{'membername':_0x4dfed7[_0xc3f8('0x36')],'type':_0xc3f8('0xfd'),'exitAt':null}});})['then'](function(_0xa472e8){var _0x5cb6e3=[];_0xa472e8[_0xc3f8('0xf9')](function(_0x5e9dd6){_0x5cb6e3['push'](_0x5e9dd6[_0xc3f8('0x26')]({'exitAt':moment()[_0xc3f8('0xa3')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xc3f8('0x10f')}));});return BPromise[_0xc3f8('0x4e')](_0x5cb6e3);})[_0xc3f8('0x11')](function(){return _0x4dfed7[_0xc3f8('0x26')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xc3f8('0x11')](respondWithResult(_0x29b492,null))['catch'](handleError(_0x29b492,null));};exports['getTeams']=function(_0x4dee6f,_0x4a8f71){var _0x5b6d01={};var _0x45d061={};var _0x149092;var _0x46dfcc;return db[_0xc3f8('0x42')]['findOne']({'where':{'id':_0x4dee6f['params']['id']}})['then'](handleEntityNotFound(_0x4a8f71,null))[_0xc3f8('0x11')](function(_0x598796){if(_0x598796){_0x149092=_0x598796;_0x45d061[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0x112')][_0xc3f8('0x39')]);_0x45d061[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x4dee6f[_0xc3f8('0x45')]);_0x45d061[_0xc3f8('0xc9')]=_['intersection'](_0x45d061[_0xc3f8('0x50')],_0x45d061[_0xc3f8('0x45')]);_0x5b6d01[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x45d061[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x4dee6f[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x5b6d01['attributes']=_0x5b6d01['attributes']['length']?_0x5b6d01[_0xc3f8('0x40')]:_0x45d061['model'];_0x5b6d01['order']=qs[_0xc3f8('0xca')](_0x4dee6f[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x5b6d01[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x4dee6f['query'],_0x45d061[_0xc3f8('0xc9')]));if(_0x4dee6f['query'][_0xc3f8('0x31')]){_0x5b6d01[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x5b6d01[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x5b6d01[_0xc3f8('0x40')],function(_0x5c84f5){var _0xfe062f={};_0xfe062f[_0x5c84f5]={'$like':'%'+_0x4dee6f['query'][_0xc3f8('0x31')]+'%'};return _0xfe062f;})});}_0x5b6d01=_[_0xc3f8('0xcd')]({},_0x5b6d01,_0x4dee6f[_0xc3f8('0x56')]);return _0x149092[_0xc3f8('0x113')](_0x5b6d01);}})['then'](function(_0x4a4639){if(_0x4a4639){_0x46dfcc=_0x4a4639[_0xc3f8('0x47')];if(!_0x4dee6f[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x5b6d01['limit']=qs[_0xc3f8('0x21')](_0x4dee6f['query'][_0xc3f8('0x21')]);_0x5b6d01[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x4dee6f['query'][_0xc3f8('0x20')]);}return _0x149092[_0xc3f8('0x113')](_0x5b6d01);}})[_0xc3f8('0x11')](function(_0x488e1f){if(_0x488e1f){return _0x488e1f?{'count':_0x46dfcc,'rows':_0x488e1f}:null;}})['then'](respondWithResult(_0x4a8f71,null))[_0xc3f8('0x1c')](handleError(_0x4a8f71,null));};exports['addTeams']=function(_0x3c6b53,_0x25073b){return db['User']['find']({'where':{'id':_0x3c6b53[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x25073b,null))[_0xc3f8('0x11')](function(_0x266786){if(_0x266786){var _0x2d237c=_0x266786['get']({'plain':!![]});return _0x266786[_0xc3f8('0x114')](_0x3c6b53[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x3c6b53[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{})[_0xc3f8('0x11')](function(){for(var _0x4ef330=0x0;_0x4ef330<_0x3c6b53[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x4ef330++){var _0xa3ff73=[];db[_0xc3f8('0x112')]['findOne']({'where':{'id':_0x3c6b53[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0x4ef330]}})['then'](function(_0x410130){_0xa3ff73[_0xc3f8('0x41')](_0x410130[_0xc3f8('0xf6')]()[_0xc3f8('0x11')](function(_0x5ec7e8){for(var _0x3f006e=0x0;_0x3f006e<_0x5ec7e8['length'];_0x3f006e++){_0x5ec7e8[_0x3f006e][_0xc3f8('0x115')]('channel','Voice');}return _0x5ec7e8;}));_0xa3ff73[_0xc3f8('0x41')](_0x410130[_0xc3f8('0x116')]()[_0xc3f8('0x11')](function(_0xa86739){for(var _0x13b2ff=0x0;_0x13b2ff<_0xa86739[_0xc3f8('0x47')];_0x13b2ff++){_0xa86739[_0x13b2ff][_0xc3f8('0x115')](_0xc3f8('0x96'),'Chat');}return _0xa86739;}));_0xa3ff73['push'](_0x410130[_0xc3f8('0x117')]()[_0xc3f8('0x11')](function(_0x133ccc){for(var _0x35d615=0x0;_0x35d615<_0x133ccc[_0xc3f8('0x47')];_0x35d615++){_0x133ccc[_0x35d615]['setDataValue'](_0xc3f8('0x96'),_0xc3f8('0x118'));}return _0x133ccc;}));_0xa3ff73[_0xc3f8('0x41')](_0x410130['getSmsQueues']()[_0xc3f8('0x11')](function(_0x1fabc9){for(var _0x15cf2a=0x0;_0x15cf2a<_0x1fabc9[_0xc3f8('0x47')];_0x15cf2a++){_0x1fabc9[_0x15cf2a][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x119'));}return _0x1fabc9;}));_0xa3ff73[_0xc3f8('0x41')](_0x410130['getWhatsappQueues']()[_0xc3f8('0x11')](function(_0x451c2f){for(var _0x5e1abc=0x0;_0x5e1abc<_0x451c2f[_0xc3f8('0x47')];_0x5e1abc++){_0x451c2f[_0x5e1abc][_0xc3f8('0x115')](_0xc3f8('0x96'),'Whatsapp');}return _0x451c2f;}));_0xa3ff73[_0xc3f8('0x41')](_0x410130[_0xc3f8('0x11a')]()['then'](function(_0xe0131){for(var _0x23a4c8=0x0;_0x23a4c8<_0xe0131[_0xc3f8('0x47')];_0x23a4c8++){_0xe0131[_0x23a4c8][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x11b'));}return _0xe0131;}));_0xa3ff73['push'](_0x410130[_0xc3f8('0x11c')]()[_0xc3f8('0x11')](function(_0x243715){for(var _0x35a8c4=0x0;_0x35a8c4<_0x243715[_0xc3f8('0x47')];_0x35a8c4++){_0x243715[_0x35a8c4][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x11d'));}return _0x243715;}));return BPromise[_0xc3f8('0x4e')](_0xa3ff73);})[_0xc3f8('0x11')](function(_0x42b6ef){var _0x48b3f7=_[_0xc3f8('0x11e')](_0x42b6ef);_0xa3ff73=[];return db[_0xc3f8('0x63')][_0xc3f8('0x11f')](function(_0x4aa748){for(var _0x883f9c=0x0;_0x883f9c<_0x48b3f7[_0xc3f8('0x47')];_0x883f9c++){_0xa3ff73['push'](_0x48b3f7[_0x883f9c][_0xc3f8('0x120')](_0x2d237c['id']),{'transaction':_0x4aa748});}return BPromise['all'](_0xa3ff73)[_0xc3f8('0x11')](function(){if(_0x2d237c[_0xc3f8('0x121')]){return BPromise['each'](_[_0xc3f8('0x31')](_0x48b3f7,function(_0x24be7b){return _0x24be7b[_0xc3f8('0x122')](_0xc3f8('0x96'))==='Voice';}),function(_0x1225c5){return db[_0xc3f8('0xad')][_0xc3f8('0xa6')]({'membername':_0x2d237c['name'],'UserId':_0x2d237c['id'],'queue_name':_0x1225c5['name'],'VoiceQueueId':_0x1225c5['id'],'interface':_[_0xc3f8('0xa2')](_0x2d237c[_0xc3f8('0x98')])?util[_0xc3f8('0xa3')]('SIP/%s',_0x2d237c[_0xc3f8('0x36')]):_0x2d237c[_0xc3f8('0x98')],'paused':_0x2d237c[_0xc3f8('0xa5')]||![],'penalty':_0x2d237c[_0xc3f8('0x9e')]},{'transaction':_0x4aa748});});}else{return;}})[_0xc3f8('0x11')](function(){for(var _0x332fb5=0x0;_0x332fb5<_0x48b3f7[_0xc3f8('0x47')];_0x332fb5++){var _0x761b5c=_0x48b3f7[_0x332fb5]['getDataValue'](_0xc3f8('0x96'));var _0x13c408=_0x761b5c+'QueueId';socket[_0xc3f8('0xa0')]('user'+_0x761b5c+'Queue:save',{'UserId':_0x2d237c['id'],['queueField']:_0x48b3f7[_0x332fb5]['id']});}});});});}});}})[_0xc3f8('0x11')](respondWithStatusCode(_0x25073b,null))[_0xc3f8('0x1c')](handleError(_0x25073b,null));};exports[_0xc3f8('0x123')]=function(_0x22270c,_0x2d22b6){return db['User'][_0xc3f8('0xc8')]({'where':{'id':_0x22270c[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x2d22b6,null))[_0xc3f8('0x11')](function(_0x18dc51){if(_0x18dc51){var _0x269fbf=_0x18dc51[_0xc3f8('0x28')]({'plain':!![]});var _0x4e9120=_0x22270c[_0xc3f8('0x45')][_0xc3f8('0x5b')];return _0x18dc51[_0xc3f8('0x123')](_0x4e9120)['then'](function(){for(var _0xb5fed9=0x0;_0xb5fed9<_0x4e9120[_0xc3f8('0x47')];_0xb5fed9++){var _0x131695=[];db[_0xc3f8('0x112')][_0xc3f8('0xc8')]({'where':{'id':_0x4e9120[_0xb5fed9]}})[_0xc3f8('0x11')](function(_0x333634){_0x131695[_0xc3f8('0x41')](_0x333634['getVoiceQueues']()[_0xc3f8('0x11')](function(_0x2dd63f){for(var _0x17146b=0x0;_0x17146b<_0x2dd63f[_0xc3f8('0x47')];_0x17146b++){_0x2dd63f[_0x17146b][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x124'));}return _0x2dd63f;}));_0x131695[_0xc3f8('0x41')](_0x333634[_0xc3f8('0x116')]()['then'](function(_0x153ebb){for(var _0x199c1c=0x0;_0x199c1c<_0x153ebb[_0xc3f8('0x47')];_0x199c1c++){_0x153ebb[_0x199c1c]['setDataValue'](_0xc3f8('0x96'),_0xc3f8('0x125'));}return _0x153ebb;}));_0x131695['push'](_0x333634[_0xc3f8('0x117')]()[_0xc3f8('0x11')](function(_0x1a2cae){for(var _0xf3a74b=0x0;_0xf3a74b<_0x1a2cae['length'];_0xf3a74b++){_0x1a2cae[_0xf3a74b][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x118'));}return _0x1a2cae;}));_0x131695[_0xc3f8('0x41')](_0x333634[_0xc3f8('0x126')]()[_0xc3f8('0x11')](function(_0x4f90c0){for(var _0x6b8f42=0x0;_0x6b8f42<_0x4f90c0[_0xc3f8('0x47')];_0x6b8f42++){_0x4f90c0[_0x6b8f42]['setDataValue']('channel',_0xc3f8('0x119'));}return _0x4f90c0;}));_0x131695[_0xc3f8('0x41')](_0x333634['getWhatsappQueues']()[_0xc3f8('0x11')](function(_0x327bcf){for(var _0x490da7=0x0;_0x490da7<_0x327bcf[_0xc3f8('0x47')];_0x490da7++){_0x327bcf[_0x490da7][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x127'));}return _0x327bcf;}));_0x131695[_0xc3f8('0x41')](_0x333634['getFaxQueues']()[_0xc3f8('0x11')](function(_0x39aa74){for(var _0x33ce40=0x0;_0x33ce40<_0x39aa74[_0xc3f8('0x47')];_0x33ce40++){_0x39aa74[_0x33ce40][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x11b'));}return _0x39aa74;}));_0x131695[_0xc3f8('0x41')](_0x333634['getOpenchannelQueues']()[_0xc3f8('0x11')](function(_0xff6144){for(var _0x3d5e55=0x0;_0x3d5e55<_0xff6144['length'];_0x3d5e55++){_0xff6144[_0x3d5e55][_0xc3f8('0x115')](_0xc3f8('0x96'),_0xc3f8('0x11d'));}return _0xff6144;}));return BPromise['all'](_0x131695);})[_0xc3f8('0x11')](function(_0x586a40){var _0x549e4c=_[_0xc3f8('0x11e')](_0x586a40);_0x131695=[];return db[_0xc3f8('0x63')][_0xc3f8('0x11f')](function(_0x46c368){for(var _0x559dd0=0x0;_0x559dd0<_0x549e4c[_0xc3f8('0x47')];_0x559dd0++){_0x131695[_0xc3f8('0x41')](_0x549e4c[_0x559dd0][_0xc3f8('0x128')](_0x269fbf['id']),{'transaction':_0x46c368});}return BPromise[_0xc3f8('0x4e')](_0x131695)[_0xc3f8('0x11')](function(){if(_0x269fbf['online']){return BPromise[_0xc3f8('0x84')](_[_0xc3f8('0x31')](_0x549e4c,function(_0x100e42){return _0x100e42[_0xc3f8('0x122')](_0xc3f8('0x96'))===_0xc3f8('0x124');}),function(_0x3b0e75){return db[_0xc3f8('0xad')][_0xc3f8('0x27')]({'where':{'VoiceQueueId':_0x3b0e75['id'],'UserId':_0x269fbf['id']},'transaction':_0x46c368});});}else{return;}})[_0xc3f8('0x11')](function(){for(var _0x38b553=0x0;_0x38b553<_0x549e4c[_0xc3f8('0x47')];_0x38b553++){var _0x2d7dcf=_0x549e4c[_0x38b553][_0xc3f8('0x122')]('channel');var _0xff992e=_0x2d7dcf+_0xc3f8('0xab');socket[_0xc3f8('0xa0')](_0xc3f8('0x2c')+_0x2d7dcf+_0xc3f8('0xac'),{'UserId':_0x269fbf['id'],['queueField']:_0x549e4c[_0x38b553]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x2d22b6,null))[_0xc3f8('0x1c')](handleError(_0x2d22b6,null));};exports[_0xc3f8('0x129')]=function(_0x3ed642,_0x1d3bb5){var _0xbfd6ed={};var _0x4342ed={};var _0x140ad1;var _0x1fcb37;return db['User'][_0xc3f8('0xc8')]({'where':{'id':_0x3ed642['params']['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x1d3bb5,null))['then'](function(_0x2e404c){if(_0x2e404c){_0x140ad1=_0x2e404c;_0x4342ed[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db['CmList']['rawAttributes']);_0x4342ed['query']=_[_0xc3f8('0x52')](_0x3ed642[_0xc3f8('0x45')]);_0x4342ed['filters']=_[_0xc3f8('0x53')](_0x4342ed[_0xc3f8('0x50')],_0x4342ed[_0xc3f8('0x45')]);_0xbfd6ed[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x4342ed[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x3ed642[_0xc3f8('0x45')]['fields']));_0xbfd6ed['attributes']=_0xbfd6ed[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0xbfd6ed[_0xc3f8('0x40')]:_0x4342ed[_0xc3f8('0x50')];_0xbfd6ed[_0xc3f8('0xd5')]=qs['sort'](_0x3ed642[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0xbfd6ed[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x3ed642['query'],_0x4342ed['filters']));if(_0x3ed642[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0xbfd6ed[_0xc3f8('0xcb')]=_['merge'](_0xbfd6ed['where'],{'$or':_['map'](_0xbfd6ed[_0xc3f8('0x40')],function(_0x760826){var _0x12a208={};_0x12a208[_0x760826]={'$like':'%'+_0x3ed642[_0xc3f8('0x45')]['filter']+'%'};return _0x12a208;})});}_0xbfd6ed=_[_0xc3f8('0xcd')]({},_0xbfd6ed,_0x3ed642[_0xc3f8('0x56')]);return _0x140ad1[_0xc3f8('0x129')](_0xbfd6ed);}})[_0xc3f8('0x11')](function(_0x4aedc3){if(_0x4aedc3){_0x1fcb37=_0x4aedc3['length'];if(!_0x3ed642[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0xbfd6ed[_0xc3f8('0x21')]=qs['limit'](_0x3ed642['query'][_0xc3f8('0x21')]);_0xbfd6ed[_0xc3f8('0x20')]=qs['offset'](_0x3ed642[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x140ad1['getLists'](_0xbfd6ed);}})[_0xc3f8('0x11')](function(_0x5a7f6f){if(_0x5a7f6f){return _0x5a7f6f?{'count':_0x1fcb37,'rows':_0x5a7f6f}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x1d3bb5,null))[_0xc3f8('0x1c')](handleError(_0x1d3bb5,null));};exports[_0xc3f8('0x12a')]=function(_0x156ea3,_0x1a3002){var _0x3f2199={};var _0x463182={};var _0x5c66b2;var _0x2322c3;return db[_0xc3f8('0x42')]['findOne']({'where':{'id':_0x156ea3[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x1a3002,null))['then'](function(_0x28306f){if(_0x28306f){_0x5c66b2=_0x28306f;_0x463182['model']=_[_0xc3f8('0x52')](db[_0xc3f8('0x42')][_0xc3f8('0x39')]);_0x463182[_0xc3f8('0x45')]=_['keys'](_0x156ea3[_0xc3f8('0x45')]);_0x463182['filters']=_[_0xc3f8('0x53')](_0x463182[_0xc3f8('0x50')],_0x463182[_0xc3f8('0x45')]);_0x3f2199[_0xc3f8('0x40')]=_['intersection'](_0x463182[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x156ea3[_0xc3f8('0x45')]['fields']));_0x3f2199[_0xc3f8('0x40')]=_0x3f2199[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x3f2199[_0xc3f8('0x40')]:_0x463182['model'];_0x3f2199[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x156ea3[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x3f2199[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x156ea3[_0xc3f8('0x45')],_0x463182['filters']));if(_0x156ea3['query'][_0xc3f8('0x31')]){_0x3f2199[_0xc3f8('0xcb')]=_['merge'](_0x3f2199[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x3f2199[_0xc3f8('0x40')],function(_0x39c41a){var _0x22a538={};_0x22a538[_0x39c41a]={'$like':'%'+_0x156ea3['query'][_0xc3f8('0x31')]+'%'};return _0x22a538;})});}_0x3f2199['model']=db[_0xc3f8('0x42')];_0x3f2199['as']='Agents';_0x3f2199=_['merge']({},_0x3f2199,_0x156ea3[_0xc3f8('0x56')]);return _0x5c66b2['getVoiceQueues']({'include':[_0x3f2199]});}})[_0xc3f8('0x11')](function(_0x6d6af1){if(_0x6d6af1){var _0x1f5146={},_0x264008=[],_0x510b05=0x0;for(var _0x549752=0x0;_0x549752<_0x6d6af1[_0xc3f8('0x47')];_0x549752+=0x1){for(var _0x468282=0x0,_0x2ea932;_0x468282<_0x6d6af1[_0x549752][_0xc3f8('0x2d')]['length'];_0x468282+=0x1){_0x2ea932=_0x6d6af1[_0x549752][_0xc3f8('0x2d')][_0x468282][_0xc3f8('0x28')]({'plain':!![]});_0x1f5146[_0x2ea932['id']]=_0x2ea932;}}_0x1f5146=_['values'](_0x1f5146);for(var _0x7c0668=qs[_0xc3f8('0x20')](_0x156ea3[_0xc3f8('0x45')][_0xc3f8('0x20')]);_0x7c0668<_0x1f5146[_0xc3f8('0x47')]&&_0x264008[_0xc3f8('0x47')]<qs['limit'](_0x156ea3[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x7c0668+=0x1){if(_0x1f5146[_0x7c0668]){_0x264008[_0xc3f8('0x41')](_0x1f5146[_0x7c0668]);}}return{'count':_0x1f5146[_0xc3f8('0x47')],'rows':_0x264008};}})[_0xc3f8('0x11')](respondWithResult(_0x1a3002,null))['catch'](handleError(_0x1a3002,null));};exports[_0xc3f8('0x27')]=function(_0x5cb9fc,_0x2f4bce){if(_0x5cb9fc[_0xc3f8('0x2c')]['id']==_0x5cb9fc[_0xc3f8('0x57')]['id']){return _0x2f4bce[_0xc3f8('0x1e')](0x1f4)[_0xc3f8('0x38')]({'message':_0xc3f8('0x12b')});}return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x5cb9fc[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x2f4bce,null))[_0xc3f8('0x11')](removeEntity(_0x2f4bce,null))['catch'](handleError(_0x2f4bce,null));};exports[_0xc3f8('0x12c')]=function(_0x19a111,_0x35ba33){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x19a111[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x35ba33,null))[_0xc3f8('0x11')](function(_0x537183){if(_0x537183){return _0x537183['addChatInteractions'](_0x19a111['body'][_0xc3f8('0x5b')],_[_0xc3f8('0x12d')](_0x19a111[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{})[_0xc3f8('0x9f')](function(){for(var _0x5864cc=0x0;_0x5864cc<_0x19a111['body'][_0xc3f8('0x5b')]['length'];_0x5864cc+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x12e'),{'ChatInteractionId':Number(_0x19a111[_0xc3f8('0x58')]['ids'][_0x5864cc]),'UserId':Number(_0x19a111['params']['id'])});}return _0x19a111['body'][_0xc3f8('0x5b')];});}})[_0xc3f8('0x11')](respondWithResult(_0x35ba33,null))[_0xc3f8('0x1c')](handleError(_0x35ba33,null));};exports['removeChatInteractions']=function(_0x3074cc,_0x1c79c5){return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x3074cc['params']['id']}})['then'](handleEntityNotFound(_0x1c79c5,null))[_0xc3f8('0x11')](function(_0x5a56dd){if(_0x5a56dd){return _0x5a56dd[_0xc3f8('0x12f')](_0x3074cc[_0xc3f8('0x45')]['ids'])[_0xc3f8('0x11')](function(){if(_[_0xc3f8('0xaa')](_0x3074cc[_0xc3f8('0x45')][_0xc3f8('0x5b')])){for(var _0x26cc69=0x0;_0x26cc69<_0x3074cc['query'][_0xc3f8('0x5b')]['length'];_0x26cc69+=0x1){socket['emit'](_0xc3f8('0x130'),{'ChatInteractionId':Number(_0x3074cc[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0x26cc69]),'UserId':Number(_0x3074cc[_0xc3f8('0x57')]['id'])});}}else{socket[_0xc3f8('0xa0')](_0xc3f8('0x130'),{'ChatInteractionId':Number(_0x3074cc[_0xc3f8('0x45')]['ids']),'UserId':Number(_0x3074cc[_0xc3f8('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c79c5,null))[_0xc3f8('0x1c')](handleError(_0x1c79c5,null));};exports[_0xc3f8('0x131')]=function(_0x58cf93,_0x177f4c){return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x58cf93[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x177f4c,null))[_0xc3f8('0x11')](function(_0x5bf55a){if(_0x5bf55a){return _0x5bf55a[_0xc3f8('0x131')](_0x58cf93[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x58cf93[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{})[_0xc3f8('0x9f')](function(){for(var _0x23494b=0x0;_0x23494b<_0x58cf93[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x23494b+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x132'),{'MailInteractionId':Number(_0x58cf93[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0x23494b]),'UserId':Number(_0x58cf93[_0xc3f8('0x57')]['id'])});}return _0x58cf93[_0xc3f8('0x58')][_0xc3f8('0x5b')];});}})['then'](respondWithResult(_0x177f4c,null))[_0xc3f8('0x1c')](handleError(_0x177f4c,null));};exports[_0xc3f8('0x133')]=function(_0x3db748,_0x8608c0){return db['User'][_0xc3f8('0x35')]({'where':{'id':_0x3db748[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x8608c0,null))['then'](function(_0x9daa35){if(_0x9daa35){return _0x9daa35['removeMailInteractions'](_0x3db748[_0xc3f8('0x45')][_0xc3f8('0x5b')])['then'](function(){if(_[_0xc3f8('0xaa')](_0x3db748[_0xc3f8('0x45')][_0xc3f8('0x5b')])){for(var _0x861782=0x0;_0x861782<_0x3db748[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x861782+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x134'),{'MailInteractionId':Number(_0x3db748[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0x861782]),'UserId':Number(_0x3db748[_0xc3f8('0x57')]['id'])});}}else{socket['emit'](_0xc3f8('0x134'),{'MailInteractionId':Number(_0x3db748[_0xc3f8('0x45')][_0xc3f8('0x5b')]),'UserId':Number(_0x3db748[_0xc3f8('0x57')]['id'])});}});}})[_0xc3f8('0x11')](respondWithStatusCode(_0x8608c0,null))['catch'](handleError(_0x8608c0,null));};exports[_0xc3f8('0x135')]=function(_0x491982,_0x71dd1b){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x491982[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x71dd1b,null))[_0xc3f8('0x11')](function(_0x39219b){if(_0x39219b){return _0x39219b[_0xc3f8('0x135')](_0x491982[_0xc3f8('0x58')][_0xc3f8('0x5b')],_[_0xc3f8('0x12d')](_0x491982[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{})[_0xc3f8('0x9f')](function(){for(var _0x1f28ad=0x0;_0x1f28ad<_0x491982[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x1f28ad+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x136'),{'FaxInteractionId':Number(_0x491982['body'][_0xc3f8('0x5b')][_0x1f28ad]),'UserId':Number(_0x491982['params']['id'])});}return _0x491982['body'][_0xc3f8('0x5b')];});}})[_0xc3f8('0x11')](respondWithResult(_0x71dd1b,null))[_0xc3f8('0x1c')](handleError(_0x71dd1b,null));};exports[_0xc3f8('0x137')]=function(_0x3cc3ed,_0x2a97f5){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x3cc3ed[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x2a97f5,null))[_0xc3f8('0x11')](function(_0x337bd1){if(_0x337bd1){return _0x337bd1[_0xc3f8('0x137')](_0x3cc3ed[_0xc3f8('0x45')][_0xc3f8('0x5b')])[_0xc3f8('0x11')](function(){if(_['isArray'](_0x3cc3ed[_0xc3f8('0x45')]['ids'])){for(var _0x5995de=0x0;_0x5995de<_0x3cc3ed[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x5995de+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x138'),{'FaxInteractionId':Number(_0x3cc3ed[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0x5995de]),'UserId':Number(_0x3cc3ed[_0xc3f8('0x57')]['id'])});}}else{socket[_0xc3f8('0xa0')](_0xc3f8('0x138'),{'FaxInteractionId':Number(_0x3cc3ed[_0xc3f8('0x45')]['ids']),'UserId':Number(_0x3cc3ed[_0xc3f8('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a97f5,null))[_0xc3f8('0x1c')](handleError(_0x2a97f5,null));};exports['addSmsInteractions']=function(_0x31f8ff,_0x2a3232){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x31f8ff['params']['id']}})['then'](handleEntityNotFound(_0x2a3232,null))[_0xc3f8('0x11')](function(_0x1c5980){if(_0x1c5980){return _0x1c5980[_0xc3f8('0x139')](_0x31f8ff[_0xc3f8('0x58')][_0xc3f8('0x5b')],_[_0xc3f8('0x12d')](_0x31f8ff[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{})[_0xc3f8('0x9f')](function(){for(var _0x3139e9=0x0;_0x3139e9<_0x31f8ff['body'][_0xc3f8('0x5b')]['length'];_0x3139e9+=0x1){socket[_0xc3f8('0xa0')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x31f8ff['body'][_0xc3f8('0x5b')][_0x3139e9]),'UserId':Number(_0x31f8ff['params']['id'])});}return _0x31f8ff[_0xc3f8('0x58')][_0xc3f8('0x5b')];});}})[_0xc3f8('0x11')](respondWithResult(_0x2a3232,null))[_0xc3f8('0x1c')](handleError(_0x2a3232,null));};exports[_0xc3f8('0x13a')]=function(_0x2d8351,_0x347682){return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x2d8351[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x347682,null))[_0xc3f8('0x11')](function(_0x328ea6){if(_0x328ea6){return _0x328ea6[_0xc3f8('0x13a')](_0x2d8351[_0xc3f8('0x45')][_0xc3f8('0x5b')])['then'](function(){if(_['isArray'](_0x2d8351['query'][_0xc3f8('0x5b')])){for(var _0x362ed0=0x0;_0x362ed0<_0x2d8351[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x362ed0+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x13b'),{'SmsInteractionId':Number(_0x2d8351[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0x362ed0]),'UserId':Number(_0x2d8351['params']['id'])});}}else{socket['emit'](_0xc3f8('0x13b'),{'SmsInteractionId':Number(_0x2d8351['query'][_0xc3f8('0x5b')]),'UserId':Number(_0x2d8351['params']['id'])});}});}})[_0xc3f8('0x11')](respondWithStatusCode(_0x347682,null))['catch'](handleError(_0x347682,null));};exports[_0xc3f8('0x13c')]=function(_0x5652a6,_0x28f44f){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x5652a6[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x28f44f,null))[_0xc3f8('0x11')](function(_0x4bc7a3){if(_0x4bc7a3){return _0x4bc7a3[_0xc3f8('0x13c')](_0x5652a6[_0xc3f8('0x58')][_0xc3f8('0x5b')],_[_0xc3f8('0x12d')](_0x5652a6['body'],[_0xc3f8('0x5b'),'id'])||{})['spread'](function(){for(var _0x3430b9=0x0;_0x3430b9<_0x5652a6[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x3430b9+=0x1){socket['emit']('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x5652a6[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0x3430b9]),'UserId':Number(_0x5652a6[_0xc3f8('0x57')]['id'])});}return _0x5652a6[_0xc3f8('0x58')]['ids'];});}})[_0xc3f8('0x11')](respondWithResult(_0x28f44f,null))['catch'](handleError(_0x28f44f,null));};exports[_0xc3f8('0x13d')]=function(_0x230ba2,_0x3ac36c){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x230ba2['params']['id']}})['then'](handleEntityNotFound(_0x3ac36c,null))[_0xc3f8('0x11')](function(_0x48a9f6){if(_0x48a9f6){return _0x48a9f6[_0xc3f8('0x13d')](_0x230ba2[_0xc3f8('0x45')]['ids'])[_0xc3f8('0x11')](function(){if(_['isArray'](_0x230ba2[_0xc3f8('0x45')][_0xc3f8('0x5b')])){for(var _0xd3c8dd=0x0;_0xd3c8dd<_0x230ba2[_0xc3f8('0x45')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0xd3c8dd+=0x1){socket['emit'](_0xc3f8('0x13e'),{'OpenchannelInteractionId':Number(_0x230ba2[_0xc3f8('0x45')]['ids'][_0xd3c8dd]),'UserId':Number(_0x230ba2[_0xc3f8('0x57')]['id'])});}}else{socket[_0xc3f8('0xa0')](_0xc3f8('0x13e'),{'OpenchannelInteractionId':Number(_0x230ba2['query'][_0xc3f8('0x5b')]),'UserId':Number(_0x230ba2[_0xc3f8('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x3ac36c,null))['catch'](handleError(_0x3ac36c,null));};exports[_0xc3f8('0x13f')]=function(_0x7930d1,_0x203d02){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x7930d1[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x203d02,null))[_0xc3f8('0x11')](function(_0x11a245){if(_0x11a245){return _0x11a245[_0xc3f8('0x13f')](_0x7930d1[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x7930d1[_0xc3f8('0x58')],['ids','id'])||{})[_0xc3f8('0x9f')](function(){for(var _0x1852cc=0x0;_0x1852cc<_0x7930d1[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0xc3f8('0x47')];_0x1852cc+=0x1){socket[_0xc3f8('0xa0')](_0xc3f8('0x140'),{'WhatsappInteractionId':Number(_0x7930d1[_0xc3f8('0x58')][_0xc3f8('0x5b')][_0x1852cc]),'UserId':Number(_0x7930d1[_0xc3f8('0x57')]['id'])});}return _0x7930d1[_0xc3f8('0x58')][_0xc3f8('0x5b')];});}})[_0xc3f8('0x11')](respondWithResult(_0x203d02,null))[_0xc3f8('0x1c')](handleError(_0x203d02,null));};exports[_0xc3f8('0x141')]=function(_0x390ccd,_0x41b330){return db['User']['find']({'where':{'id':_0x390ccd['params']['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x41b330,null))[_0xc3f8('0x11')](function(_0x3e5a62){if(_0x3e5a62){return _0x3e5a62[_0xc3f8('0x141')](_0x390ccd['query']['ids']);}})['then'](respondWithStatusCode(_0x41b330,null))[_0xc3f8('0x1c')](handleError(_0x41b330,null));};exports[_0xc3f8('0x142')]=function(_0x22be44,_0x18aae6){var _0x3fe855={};var _0x1047f2={};var _0x3c46b0;var _0x5baa9a;return db['User'][_0xc3f8('0xc8')]({'where':{'id':_0x22be44[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x18aae6,null))['then'](function(_0x325247){if(_0x325247){_0x3c46b0=_0x325247;_0x1047f2[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0x143')][_0xc3f8('0x39')]);_0x1047f2['query']=_[_0xc3f8('0x52')](_0x22be44[_0xc3f8('0x45')]);_0x1047f2[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x1047f2[_0xc3f8('0x50')],_0x1047f2[_0xc3f8('0x45')]);_0x3fe855[_0xc3f8('0x40')]=_['intersection'](_0x1047f2[_0xc3f8('0x50')],qs['fields'](_0x22be44['query']['fields']));_0x3fe855[_0xc3f8('0x40')]=_0x3fe855[_0xc3f8('0x40')]['length']?_0x3fe855[_0xc3f8('0x40')]:_0x1047f2['model'];_0x3fe855[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x22be44[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x3fe855['where']=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x22be44[_0xc3f8('0x45')],_0x1047f2['filters']));if(_0x22be44[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x3fe855[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x3fe855['where'],{'$or':_['map'](_0x3fe855[_0xc3f8('0x40')],function(_0x2db508){var _0x2a6f90={};_0x2a6f90[_0x2db508]={'$like':'%'+_0x22be44[_0xc3f8('0x45')]['filter']+'%'};return _0x2a6f90;})});}_0x3fe855=_[_0xc3f8('0xcd')]({},_0x3fe855,_0x22be44[_0xc3f8('0x56')]);return _0x3c46b0['getVoicePrefixes'](_0x3fe855);}})['then'](function(_0x432d7a){if(_0x432d7a){_0x5baa9a=_0x432d7a[_0xc3f8('0x47')];if(!_0x22be44[_0xc3f8('0x45')][_0xc3f8('0xd3')]('nolimit')){_0x3fe855[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x22be44[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x3fe855[_0xc3f8('0x20')]=qs['offset'](_0x22be44[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x3c46b0[_0xc3f8('0x142')](_0x3fe855);}})[_0xc3f8('0x11')](function(_0x5a5fec){if(_0x5a5fec){return _0x5a5fec?{'count':_0x5baa9a,'rows':_0x5a5fec}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x18aae6,null))[_0xc3f8('0x1c')](handleError(_0x18aae6,null));};exports[_0xc3f8('0x144')]=function(_0x3c7043,_0x836b5a){var _0x29ef9f={};var _0x4b212d={};var _0x1fbc2b;var _0x53c8fe;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x3c7043[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x836b5a,null))['then'](function(_0x255d0d){if(_0x255d0d){_0x1fbc2b=_0x255d0d;_0x4b212d['model']=_['keys'](db[_0xc3f8('0x145')][_0xc3f8('0x39')]);_0x4b212d[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x3c7043['query']);_0x4b212d['filters']=_[_0xc3f8('0x53')](_0x4b212d['model'],_0x4b212d[_0xc3f8('0x45')]);_0x29ef9f[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x4b212d['model'],qs[_0xc3f8('0x54')](_0x3c7043['query'][_0xc3f8('0x54')]));_0x29ef9f['attributes']=_0x29ef9f[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x29ef9f[_0xc3f8('0x40')]:_0x4b212d[_0xc3f8('0x50')];_0x29ef9f[_0xc3f8('0xd5')]=qs['sort'](_0x3c7043[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x29ef9f[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x3c7043[_0xc3f8('0x45')],_0x4b212d[_0xc3f8('0xc9')]));if(_0x3c7043[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x29ef9f[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x29ef9f[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x29ef9f[_0xc3f8('0x40')],function(_0x27ec71){var _0x287590={};_0x287590[_0x27ec71]={'$like':'%'+_0x3c7043['query'][_0xc3f8('0x31')]+'%'};return _0x287590;})});}_0x29ef9f=_[_0xc3f8('0xcd')]({},_0x29ef9f,_0x3c7043[_0xc3f8('0x56')]);return _0x1fbc2b[_0xc3f8('0x144')](_0x29ef9f);}})['then'](function(_0x13e8eb){if(_0x13e8eb){_0x53c8fe=_0x13e8eb['length'];if(!_0x3c7043[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x29ef9f[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x3c7043[_0xc3f8('0x45')]['limit']);_0x29ef9f[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x3c7043[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x1fbc2b[_0xc3f8('0x144')](_0x29ef9f);}})[_0xc3f8('0x11')](function(_0x42f83d){if(_0x42f83d){return _0x42f83d?{'count':_0x53c8fe,'rows':_0x42f83d}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x836b5a,null))[_0xc3f8('0x1c')](handleError(_0x836b5a,null));};exports[_0xc3f8('0x146')]=function(_0x4d7246,_0x3bfea9){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x4d7246[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x3bfea9,null))[_0xc3f8('0x11')](function(_0x1472f8){if(_0x1472f8){return _0x1472f8[_0xc3f8('0x146')](_0x4d7246[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x4d7246[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{});}})[_0xc3f8('0x11')](respondWithResult(_0x3bfea9,null))[_0xc3f8('0x1c')](handleError(_0x3bfea9,null));};exports['removeFaxAccounts']=function(_0x2dc5ff,_0x28cd04){return db['User'][_0xc3f8('0x35')]({'where':{'id':_0x2dc5ff[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x28cd04,null))[_0xc3f8('0x11')](function(_0x4eb08b){if(_0x4eb08b){return _0x4eb08b['removeFaxAccounts'](_0x2dc5ff['query'][_0xc3f8('0x5b')]);}})['then'](respondWithStatusCode(_0x28cd04,null))[_0xc3f8('0x1c')](handleError(_0x28cd04,null));};exports['getMailAccounts']=function(_0x3e5989,_0x1f7d4c){var _0x15695f={};var _0x34f240={};var _0x24f692;var _0x2f3c88;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x3e5989[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x1f7d4c,null))['then'](function(_0x29d133){if(_0x29d133){_0x24f692=_0x29d133;_0x34f240[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db['MailAccount'][_0xc3f8('0x39')]);_0x34f240[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x3e5989[_0xc3f8('0x45')]);_0x34f240[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x34f240[_0xc3f8('0x50')],_0x34f240[_0xc3f8('0x45')]);_0x15695f['attributes']=_[_0xc3f8('0x53')](_0x34f240['model'],qs[_0xc3f8('0x54')](_0x3e5989[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x15695f[_0xc3f8('0x40')]=_0x15695f[_0xc3f8('0x40')]['length']?_0x15695f['attributes']:_0x34f240['model'];_0x15695f[_0xc3f8('0xd5')]=qs['sort'](_0x3e5989[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x15695f[_0xc3f8('0xcb')]=qs['filters'](_['pick'](_0x3e5989[_0xc3f8('0x45')],_0x34f240[_0xc3f8('0xc9')]));if(_0x3e5989[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x15695f[_0xc3f8('0xcb')]=_['merge'](_0x15695f['where'],{'$or':_[_0xc3f8('0x33')](_0x15695f[_0xc3f8('0x40')],function(_0x423a6e){var _0x144f5a={};_0x144f5a[_0x423a6e]={'$like':'%'+_0x3e5989[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x144f5a;})});}_0x15695f=_[_0xc3f8('0xcd')]({},_0x15695f,_0x3e5989[_0xc3f8('0x56')]);return _0x24f692[_0xc3f8('0x147')](_0x15695f);}})['then'](function(_0x1fd6e4){if(_0x1fd6e4){_0x2f3c88=_0x1fd6e4[_0xc3f8('0x47')];if(!_0x3e5989[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x15695f[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x3e5989['query'][_0xc3f8('0x21')]);_0x15695f[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x3e5989['query']['offset']);}return _0x24f692[_0xc3f8('0x147')](_0x15695f);}})['then'](function(_0x1f27da){if(_0x1f27da){return _0x1f27da?{'count':_0x2f3c88,'rows':_0x1f27da}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x1f7d4c,null))['catch'](handleError(_0x1f7d4c,null));};exports[_0xc3f8('0x148')]=function(_0x1fbed7,_0x57b251){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x1fbed7[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x57b251,null))[_0xc3f8('0x11')](function(_0x24b991){if(_0x24b991){return _0x24b991['addMailAccounts'](_0x1fbed7[_0xc3f8('0x58')][_0xc3f8('0x5b')],_[_0xc3f8('0x12d')](_0x1fbed7[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x57b251,null))[_0xc3f8('0x1c')](handleError(_0x57b251,null));};exports['removeMailAccounts']=function(_0x1b2053,_0x3eca9d){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x1b2053['params']['id']}})['then'](handleEntityNotFound(_0x3eca9d,null))[_0xc3f8('0x11')](function(_0x133fc0){if(_0x133fc0){return _0x133fc0[_0xc3f8('0x149')](_0x1b2053['query']['ids']);}})[_0xc3f8('0x11')](respondWithStatusCode(_0x3eca9d,null))['catch'](handleError(_0x3eca9d,null));};exports[_0xc3f8('0x14a')]=function(_0x48403c,_0x12ff55){var _0x2092e9={};var _0x63987d={};var _0x27bf4c;var _0x1de1b3;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x48403c[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x12ff55,null))[_0xc3f8('0x11')](function(_0x267844){if(_0x267844){_0x27bf4c=_0x267844;_0x63987d[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0x14b')]['rawAttributes']);_0x63987d[_0xc3f8('0x45')]=_['keys'](_0x48403c[_0xc3f8('0x45')]);_0x63987d[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x63987d[_0xc3f8('0x50')],_0x63987d[_0xc3f8('0x45')]);_0x2092e9[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x63987d['model'],qs[_0xc3f8('0x54')](_0x48403c[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x2092e9[_0xc3f8('0x40')]=_0x2092e9['attributes'][_0xc3f8('0x47')]?_0x2092e9['attributes']:_0x63987d[_0xc3f8('0x50')];_0x2092e9[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x48403c[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x2092e9['where']=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x48403c[_0xc3f8('0x45')],_0x63987d[_0xc3f8('0xc9')]));if(_0x48403c[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x2092e9['where']=_[_0xc3f8('0xcd')](_0x2092e9[_0xc3f8('0xcb')],{'$or':_['map'](_0x2092e9[_0xc3f8('0x40')],function(_0x39e179){var _0xfcc1d6={};_0xfcc1d6[_0x39e179]={'$like':'%'+_0x48403c[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0xfcc1d6;})});}_0x2092e9=_[_0xc3f8('0xcd')]({},_0x2092e9,_0x48403c['options']);return _0x27bf4c[_0xc3f8('0x14a')](_0x2092e9);}})[_0xc3f8('0x11')](function(_0x1258e5){if(_0x1258e5){_0x1de1b3=_0x1258e5[_0xc3f8('0x47')];if(!_0x48403c[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x2092e9[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x48403c[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x2092e9[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x48403c[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x27bf4c[_0xc3f8('0x14a')](_0x2092e9);}})['then'](function(_0x401337){if(_0x401337){return _0x401337?{'count':_0x1de1b3,'rows':_0x401337}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x12ff55,null))[_0xc3f8('0x1c')](handleError(_0x12ff55,null));};exports[_0xc3f8('0x14c')]=function(_0x104ea7,_0x1b3670){return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x104ea7[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x1b3670,null))[_0xc3f8('0x11')](function(_0xd0346e){if(_0xd0346e){return _0xd0346e['addOpenchannelAccounts'](_0x104ea7['body'][_0xc3f8('0x5b')],_[_0xc3f8('0x12d')](_0x104ea7[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{});}})[_0xc3f8('0x11')](respondWithResult(_0x1b3670,null))[_0xc3f8('0x1c')](handleError(_0x1b3670,null));};exports[_0xc3f8('0x14d')]=function(_0x4b8e6a,_0x36b3fc){return db['User'][_0xc3f8('0x35')]({'where':{'id':_0x4b8e6a['params']['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x36b3fc,null))[_0xc3f8('0x11')](function(_0x100672){if(_0x100672){return _0x100672[_0xc3f8('0x14d')](_0x4b8e6a[_0xc3f8('0x45')][_0xc3f8('0x5b')]);}})[_0xc3f8('0x11')](respondWithStatusCode(_0x36b3fc,null))[_0xc3f8('0x1c')](handleError(_0x36b3fc,null));};exports[_0xc3f8('0x14e')]=function(_0x197a23,_0x332792){var _0x464d3f={};var _0x47a331={};var _0x167f5b;var _0x47b828;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x197a23[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x332792,null))[_0xc3f8('0x11')](function(_0x12d566){if(_0x12d566){_0x167f5b=_0x12d566;_0x47a331['model']=_[_0xc3f8('0x52')](db[_0xc3f8('0x14f')][_0xc3f8('0x39')]);_0x47a331[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x197a23[_0xc3f8('0x45')]);_0x47a331[_0xc3f8('0xc9')]=_['intersection'](_0x47a331['model'],_0x47a331[_0xc3f8('0x45')]);_0x464d3f[_0xc3f8('0x40')]=_['intersection'](_0x47a331[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x197a23[_0xc3f8('0x45')]['fields']));_0x464d3f[_0xc3f8('0x40')]=_0x464d3f[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x464d3f[_0xc3f8('0x40')]:_0x47a331[_0xc3f8('0x50')];_0x464d3f['order']=qs['sort'](_0x197a23[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x464d3f[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x197a23['query'],_0x47a331[_0xc3f8('0xc9')]));if(_0x197a23[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x464d3f[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x464d3f['where'],{'$or':_[_0xc3f8('0x33')](_0x464d3f[_0xc3f8('0x40')],function(_0x1ba011){var _0xe6b6b1={};_0xe6b6b1[_0x1ba011]={'$like':'%'+_0x197a23[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0xe6b6b1;})});}_0x464d3f=_['merge']({},_0x464d3f,_0x197a23[_0xc3f8('0x56')]);return _0x167f5b[_0xc3f8('0x14e')](_0x464d3f);}})['then'](function(_0xa7172b){if(_0xa7172b){_0x47b828=_0xa7172b['length'];if(!_0x197a23[_0xc3f8('0x45')][_0xc3f8('0xd3')]('nolimit')){_0x464d3f[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x197a23[_0xc3f8('0x45')]['limit']);_0x464d3f[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x197a23[_0xc3f8('0x45')]['offset']);}return _0x167f5b['getSmsAccounts'](_0x464d3f);}})[_0xc3f8('0x11')](function(_0x2cf0f4){if(_0x2cf0f4){return _0x2cf0f4?{'count':_0x47b828,'rows':_0x2cf0f4}:null;}})['then'](respondWithResult(_0x332792,null))['catch'](handleError(_0x332792,null));};exports[_0xc3f8('0x150')]=function(_0x135fb4,_0x3d071f){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x135fb4[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x3d071f,null))[_0xc3f8('0x11')](function(_0x326ba3){if(_0x326ba3){return _0x326ba3[_0xc3f8('0x150')](_0x135fb4[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x135fb4[_0xc3f8('0x58')],['ids','id'])||{});}})[_0xc3f8('0x11')](respondWithResult(_0x3d071f,null))[_0xc3f8('0x1c')](handleError(_0x3d071f,null));};exports[_0xc3f8('0x151')]=function(_0x17e684,_0x14ee60){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x17e684[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x14ee60,null))[_0xc3f8('0x11')](function(_0x111505){if(_0x111505){return _0x111505[_0xc3f8('0x151')](_0x17e684[_0xc3f8('0x45')][_0xc3f8('0x5b')]);}})[_0xc3f8('0x11')](respondWithStatusCode(_0x14ee60,null))['catch'](handleError(_0x14ee60,null));};exports['getChatWebsites']=function(_0x112cf9,_0x51ee91){var _0x2a5c61={};var _0x366e77={};var _0x11253f;var _0x295d0;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x112cf9[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x51ee91,null))[_0xc3f8('0x11')](function(_0x276699){if(_0x276699){_0x11253f=_0x276699;_0x366e77[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0x152')]['rawAttributes']);_0x366e77[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x112cf9['query']);_0x366e77[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x366e77[_0xc3f8('0x50')],_0x366e77[_0xc3f8('0x45')]);_0x2a5c61[_0xc3f8('0x40')]=_['intersection'](_0x366e77['model'],qs[_0xc3f8('0x54')](_0x112cf9['query']['fields']));_0x2a5c61[_0xc3f8('0x40')]=_0x2a5c61['attributes'][_0xc3f8('0x47')]?_0x2a5c61[_0xc3f8('0x40')]:_0x366e77[_0xc3f8('0x50')];_0x2a5c61[_0xc3f8('0xd5')]=qs['sort'](_0x112cf9[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x2a5c61[_0xc3f8('0xcb')]=qs['filters'](_['pick'](_0x112cf9[_0xc3f8('0x45')],_0x366e77[_0xc3f8('0xc9')]));if(_0x112cf9[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x2a5c61['where']=_['merge'](_0x2a5c61['where'],{'$or':_['map'](_0x2a5c61[_0xc3f8('0x40')],function(_0x4873ac){var _0x24b661={};_0x24b661[_0x4873ac]={'$like':'%'+_0x112cf9[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x24b661;})});}_0x2a5c61=_[_0xc3f8('0xcd')]({},_0x2a5c61,_0x112cf9['options']);return _0x11253f[_0xc3f8('0x153')](_0x2a5c61);}})[_0xc3f8('0x11')](function(_0x2a5d4d){if(_0x2a5d4d){_0x295d0=_0x2a5d4d[_0xc3f8('0x47')];if(!_0x112cf9['query'][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x2a5c61['limit']=qs['limit'](_0x112cf9[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x2a5c61[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x112cf9[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x11253f[_0xc3f8('0x153')](_0x2a5c61);}})[_0xc3f8('0x11')](function(_0x76e34f){if(_0x76e34f){return _0x76e34f?{'count':_0x295d0,'rows':_0x76e34f}:null;}})[_0xc3f8('0x11')](respondWithResult(_0x51ee91,null))[_0xc3f8('0x1c')](handleError(_0x51ee91,null));};exports['addChatWebsites']=function(_0x5ce070,_0x1b3d95){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x5ce070[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x1b3d95,null))[_0xc3f8('0x11')](function(_0x18603a){if(_0x18603a){return _0x18603a[_0xc3f8('0x154')](_0x5ce070[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x5ce070['body'],[_0xc3f8('0x5b'),'id'])||{});}})[_0xc3f8('0x11')](respondWithResult(_0x1b3d95,null))[_0xc3f8('0x1c')](handleError(_0x1b3d95,null));};exports['removeChatWebsites']=function(_0x3d3f08,_0x38dd1e){return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x3d3f08[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x38dd1e,null))[_0xc3f8('0x11')](function(_0x385fad){if(_0x385fad){return _0x385fad[_0xc3f8('0x155')](_0x3d3f08[_0xc3f8('0x45')][_0xc3f8('0x5b')]);}})[_0xc3f8('0x11')](respondWithStatusCode(_0x38dd1e,null))[_0xc3f8('0x1c')](handleError(_0x38dd1e,null));};exports[_0xc3f8('0x156')]=function(_0x494e72,_0xab2528){var _0x29a4ec={};var _0x4bd62d={};var _0x20aeef;var _0x8e1849;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x494e72[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0xab2528,null))[_0xc3f8('0x11')](function(_0x3ed543){if(_0x3ed543){_0x20aeef=_0x3ed543;_0x4bd62d[_0xc3f8('0x50')]=_['keys'](db[_0xc3f8('0x157')][_0xc3f8('0x39')]);_0x4bd62d[_0xc3f8('0x45')]=_['keys'](_0x494e72['query']);_0x4bd62d[_0xc3f8('0xc9')]=_['intersection'](_0x4bd62d[_0xc3f8('0x50')],_0x4bd62d[_0xc3f8('0x45')]);_0x29a4ec[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x4bd62d[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x494e72[_0xc3f8('0x45')]['fields']));_0x29a4ec[_0xc3f8('0x40')]=_0x29a4ec['attributes'][_0xc3f8('0x47')]?_0x29a4ec[_0xc3f8('0x40')]:_0x4bd62d[_0xc3f8('0x50')];_0x29a4ec['order']=qs['sort'](_0x494e72[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x29a4ec[_0xc3f8('0xcb')]=qs['filters'](_[_0xc3f8('0xcc')](_0x494e72[_0xc3f8('0x45')],_0x4bd62d['filters']));if(_0x494e72[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x29a4ec[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x29a4ec['where'],{'$or':_[_0xc3f8('0x33')](_0x29a4ec['attributes'],function(_0x218370){var _0x516d79={};_0x516d79[_0x218370]={'$like':'%'+_0x494e72[_0xc3f8('0x45')]['filter']+'%'};return _0x516d79;})});}_0x29a4ec=_[_0xc3f8('0xcd')]({},_0x29a4ec,_0x494e72['options']);return _0x20aeef[_0xc3f8('0x156')](_0x29a4ec);}})[_0xc3f8('0x11')](function(_0x407c13){if(_0x407c13){_0x8e1849=_0x407c13[_0xc3f8('0x47')];if(!_0x494e72[_0xc3f8('0x45')]['hasOwnProperty'](_0xc3f8('0xd4'))){_0x29a4ec[_0xc3f8('0x21')]=qs[_0xc3f8('0x21')](_0x494e72[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x29a4ec[_0xc3f8('0x20')]=qs['offset'](_0x494e72[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0x20aeef['getWhatsappAccounts'](_0x29a4ec);}})['then'](function(_0x3716d6){if(_0x3716d6){return _0x3716d6?{'count':_0x8e1849,'rows':_0x3716d6}:null;}})[_0xc3f8('0x11')](respondWithResult(_0xab2528,null))[_0xc3f8('0x1c')](handleError(_0xab2528,null));};exports[_0xc3f8('0x158')]=function(_0x1646a0,_0x4144fb){return db['User']['find']({'where':{'id':_0x1646a0[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x4144fb,null))[_0xc3f8('0x11')](function(_0x3f01c1){if(_0x3f01c1){return _0x3f01c1[_0xc3f8('0x158')](_0x1646a0[_0xc3f8('0x58')][_0xc3f8('0x5b')],_['omit'](_0x1646a0[_0xc3f8('0x58')],['ids','id'])||{});}})[_0xc3f8('0x11')](respondWithResult(_0x4144fb,null))[_0xc3f8('0x1c')](handleError(_0x4144fb,null));};exports['removeWhatsappAccounts']=function(_0xdfdc55,_0x413e9f){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0xdfdc55[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x413e9f,null))[_0xc3f8('0x11')](function(_0x172989){if(_0x172989){return _0x172989[_0xc3f8('0x159')](_0xdfdc55[_0xc3f8('0x45')][_0xc3f8('0x5b')]);}})[_0xc3f8('0x11')](respondWithStatusCode(_0x413e9f,null))[_0xc3f8('0x1c')](handleError(_0x413e9f,null));};exports[_0xc3f8('0x15a')]=function(_0x3c89df,_0xd546ff){var _0x40ff4e={};var _0x7e3ec1={};var _0xc091b6;var _0x290783;return db[_0xc3f8('0x42')][_0xc3f8('0xc8')]({'where':{'id':_0x3c89df[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0xd546ff,null))[_0xc3f8('0x11')](function(_0x170e69){if(_0x170e69){_0xc091b6=_0x170e69;_0x7e3ec1[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](db[_0xc3f8('0x15b')][_0xc3f8('0x39')]);_0x7e3ec1['query']=_[_0xc3f8('0x52')](_0x3c89df[_0xc3f8('0x45')]);_0x7e3ec1['filters']=_[_0xc3f8('0x53')](_0x7e3ec1[_0xc3f8('0x50')],_0x7e3ec1['query']);_0x40ff4e[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x7e3ec1[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x3c89df[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x40ff4e[_0xc3f8('0x40')]=_0x40ff4e[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x40ff4e['attributes']:_0x7e3ec1['model'];_0x40ff4e[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x3c89df[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x40ff4e[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_['pick'](_0x3c89df[_0xc3f8('0x45')],_0x7e3ec1[_0xc3f8('0xc9')]));if(_0x3c89df[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x40ff4e[_0xc3f8('0xcb')]=_['merge'](_0x40ff4e[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x40ff4e[_0xc3f8('0x40')],function(_0x3ed045){var _0x59423e={};_0x59423e[_0x3ed045]={'$like':'%'+_0x3c89df[_0xc3f8('0x45')][_0xc3f8('0x31')]+'%'};return _0x59423e;})});}_0x40ff4e=_['merge']({},_0x40ff4e,_0x3c89df[_0xc3f8('0x56')]);return _0xc091b6[_0xc3f8('0x15a')](_0x40ff4e);}})[_0xc3f8('0x11')](function(_0x50d680){if(_0x50d680){_0x290783=_0x50d680[_0xc3f8('0x47')];if(!_0x3c89df['query']['hasOwnProperty']('nolimit')){_0x40ff4e['limit']=qs[_0xc3f8('0x21')](_0x3c89df[_0xc3f8('0x45')][_0xc3f8('0x21')]);_0x40ff4e[_0xc3f8('0x20')]=qs[_0xc3f8('0x20')](_0x3c89df[_0xc3f8('0x45')][_0xc3f8('0x20')]);}return _0xc091b6['getSquareProjects'](_0x40ff4e);}})[_0xc3f8('0x11')](function(_0x483a08){if(_0x483a08){return _0x483a08?{'count':_0x290783,'rows':_0x483a08}:null;}})[_0xc3f8('0x11')](respondWithResult(_0xd546ff,null))['catch'](handleError(_0xd546ff,null));};exports['addSquareProjects']=function(_0x51d9a5,_0x37d744){return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x51d9a5[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x37d744,null))[_0xc3f8('0x11')](function(_0x106713){if(_0x106713){return _0x106713[_0xc3f8('0x15c')](_0x51d9a5[_0xc3f8('0x58')]['ids'],_[_0xc3f8('0x12d')](_0x51d9a5[_0xc3f8('0x58')],[_0xc3f8('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x37d744,null))[_0xc3f8('0x1c')](handleError(_0x37d744,null));};exports['removeSquareProjects']=function(_0x24f478,_0x4909fb){return db['User'][_0xc3f8('0x35')]({'where':{'id':_0x24f478[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x4909fb,null))['then'](function(_0x1d2f86){if(_0x1d2f86){return _0x1d2f86['removeSquareProjects'](_0x24f478[_0xc3f8('0x45')][_0xc3f8('0x5b')]);}})['then'](respondWithStatusCode(_0x4909fb,null))[_0xc3f8('0x1c')](handleError(_0x4909fb,null));};exports[_0xc3f8('0x15d')]=function(_0x32c2b2,_0x42b557){var _0x37a0fe={},_0x316176={},_0xe42765={'count':0x0,'rows':[]};var _0x273131=db['CmHopper'][_0xc3f8('0x39')];_0x316176[_0xc3f8('0x50')]=_[_0xc3f8('0x52')](_0x273131);_0x316176[_0xc3f8('0x45')]=_[_0xc3f8('0x52')](_0x32c2b2[_0xc3f8('0x45')]);_0x316176[_0xc3f8('0xc9')]=_[_0xc3f8('0x53')](_0x316176[_0xc3f8('0x50')],_0x316176[_0xc3f8('0x45')]);_0x316176[_0xc3f8('0xc9')]=_[_0xc3f8('0xff')](_0x316176['filters'],['$and',_0xc3f8('0x15e'),'$gt',_0xc3f8('0x15f'),_0xc3f8('0x160'),_0xc3f8('0x161'),_0xc3f8('0x162'),_0xc3f8('0x163'),'$not',_0xc3f8('0x164'),_0xc3f8('0x165'),_0xc3f8('0x166'),_0xc3f8('0x167'),_0xc3f8('0x168'),_0xc3f8('0x169'),_0xc3f8('0x16a'),_0xc3f8('0x16b'),_0xc3f8('0x168'),_0xc3f8('0x16c'),'$contains','$contained',_0xc3f8('0x16d')]);_0x37a0fe[_0xc3f8('0x40')]=_[_0xc3f8('0x53')](_0x316176[_0xc3f8('0x50')],qs[_0xc3f8('0x54')](_0x32c2b2[_0xc3f8('0x45')][_0xc3f8('0x54')]));_0x37a0fe['attributes']=_0x37a0fe[_0xc3f8('0x40')][_0xc3f8('0x47')]?_0x37a0fe[_0xc3f8('0x40')]:_0x316176[_0xc3f8('0x50')];if(!_0x32c2b2[_0xc3f8('0x45')][_0xc3f8('0xd3')]('nolimit')){_0x37a0fe['limit']=qs[_0xc3f8('0x21')](_0x32c2b2['query']['limit']);_0x37a0fe['offset']=qs[_0xc3f8('0x20')](_0x32c2b2[_0xc3f8('0x45')][_0xc3f8('0x20')]);}_0x37a0fe[_0xc3f8('0xd5')]=qs[_0xc3f8('0xca')](_0x32c2b2[_0xc3f8('0x45')][_0xc3f8('0xca')]);_0x37a0fe[_0xc3f8('0xcb')]=qs[_0xc3f8('0xc9')](_[_0xc3f8('0xcc')](_0x32c2b2[_0xc3f8('0x45')],_0x316176[_0xc3f8('0xc9')]));if(_0x32c2b2[_0xc3f8('0x45')][_0xc3f8('0x31')]){_0x37a0fe[_0xc3f8('0xcb')]=_[_0xc3f8('0xcd')](_0x37a0fe[_0xc3f8('0xcb')],{'$or':_[_0xc3f8('0x33')](_0x37a0fe[_0xc3f8('0x40')],function(_0x583068){var _0x5e9574={};_0x5e9574[_0x583068]={'$like':'%'+_0x32c2b2['query'][_0xc3f8('0x31')]+'%'};return _0x5e9574;})});}_0x37a0fe[_0xc3f8('0xcb')]={'$and':[_0x37a0fe['where'],{'$or':[{'UserId':_0x32c2b2[_0xc3f8('0x57')]['id']},{'OwnerId':_0x32c2b2[_0xc3f8('0x57')]['id']}]}]};_0x37a0fe=_[_0xc3f8('0xcd')]({},_0x37a0fe,_0x32c2b2[_0xc3f8('0x56')]);var _0x1ac0a8={'where':_0x37a0fe[_0xc3f8('0xcb')]};return db[_0xc3f8('0x16e')][_0xc3f8('0x23')](_0x1ac0a8)[_0xc3f8('0x11')](function(_0x348e20){_0xe42765['count']=_0x348e20;if(_0x32c2b2['query'][_0xc3f8('0x55')]){_0x37a0fe[_0xc3f8('0x3e')]=[{'attributes':['id','firstName',_0xc3f8('0x16f'),_0xc3f8('0xec')],'model':db[_0xc3f8('0x170')],'as':_0xc3f8('0x171')},{'attributes':['id','name',_0xc3f8('0x172')],'model':db[_0xc3f8('0x173')],'as':'Queue'}];}return db[_0xc3f8('0x16e')][_0xc3f8('0x43')](_0x37a0fe);})['then'](function(_0x4e257a){_0xe42765[_0xc3f8('0x44')]=_0x4e257a;return _0xe42765;})[_0xc3f8('0x11')](respondWithFilteredResult(_0x42b557,_0x37a0fe))[_0xc3f8('0x1c')](handleError(_0x42b557,null));};exports['getApiKey']=function(_0x346f33,_0x1af760){if(!_[_0xc3f8('0xa2')](_0x346f33['user']['id'])&&(_0x346f33[_0xc3f8('0x2c')][_0xc3f8('0x29')]==_0xc3f8('0x2a')||_0x346f33[_0xc3f8('0x2c')][_0xc3f8('0x29')]==_0xc3f8('0x2c'))){return db[_0xc3f8('0x42')]['findOne']({'where':{'id':_0x346f33[_0xc3f8('0x57')]['id']},'raw':!![]})[_0xc3f8('0x11')](function(_0x4eb280){return authService[_0xc3f8('0x174')](_0x4eb280);})[_0xc3f8('0x11')](function(_0x23aa83){if(_0x23aa83){return _0x1af760[_0xc3f8('0x1e')](0xc8)[_0xc3f8('0x175')]({'api_key':_0x23aa83[_0xc3f8('0x176')]});}else{return _0x1af760[_0xc3f8('0x1e')](0xcc)[_0xc3f8('0x175')]({'message':_0xc3f8('0x177')});}})['catch'](handleError(_0x1af760,0x193));}else{return _0x1af760['status'](0x191)[_0xc3f8('0x175')]({'message':_0xc3f8('0x178')});}};exports[_0xc3f8('0x179')]=function(_0x25c4b2,_0x2162a6){if(!_[_0xc3f8('0xa2')](_0x25c4b2[_0xc3f8('0x2c')]['id'])&&(_0x25c4b2[_0xc3f8('0x2c')][_0xc3f8('0x29')]==_0xc3f8('0x2a')||_0x25c4b2['user'][_0xc3f8('0x29')]==_0xc3f8('0x2c'))){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x25c4b2[_0xc3f8('0x57')]['id']}})['then'](function(_0x2ac7ce){return authService[_0xc3f8('0x17a')](_0x2ac7ce);})[_0xc3f8('0x11')](function(_0xdf8687){return db[_0xc3f8('0x42')]['update']({'apiKeyIat':_0xdf8687[_0xc3f8('0x17b')],'apiKeyNonce':_0xdf8687[_0xc3f8('0x17c')]},{'where':{'id':_0x25c4b2['params']['id']}})[_0xc3f8('0x11')](function(){return _0x2162a6[_0xc3f8('0x1e')](0xc8)[_0xc3f8('0x175')]({'api_key':_0xdf8687['token']});});})[_0xc3f8('0x1c')](handleError(_0x2162a6,0x193));}else{return _0x2162a6['status'](0x191)[_0xc3f8('0x175')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xc3f8('0x17d')]=function(_0x25bfdb,_0x2cde3a){if(!_[_0xc3f8('0xa2')](_0x25bfdb['user']['id'])&&(_0x25bfdb['user'][_0xc3f8('0x29')]=='admin'||_0x25bfdb[_0xc3f8('0x2c')][_0xc3f8('0x29')]==_0xc3f8('0x2c'))){return db[_0xc3f8('0x42')][_0xc3f8('0x35')]({'where':{'id':_0x25bfdb[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x11')](handleEntityNotFound(_0x2cde3a,null))[_0xc3f8('0x11')](function(_0x5ec051){if(_0x5ec051&&_0x5ec051[_0xc3f8('0x17e')]&&_0x5ec051[_0xc3f8('0x17f')])return _0x5ec051;else throw{'message':_0xc3f8('0x180')};})[_0xc3f8('0x11')](function(_0x3ec20c){return db['User'][_0xc3f8('0x26')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x25bfdb['params']['id']}});})[_0xc3f8('0x11')](respondWithStatusCode(_0x2cde3a,0xc8))[_0xc3f8('0x1c')](handleError(_0x2cde3a,0x193));}else{return _0x2cde3a[_0xc3f8('0x1e')](0x191)[_0xc3f8('0x175')]({'message':_0xc3f8('0x178')});}};exports[_0xc3f8('0x181')]=function(_0x595f4d,_0x2a238d){var _0x4874e1=_0x595f4d[_0xc3f8('0x2c')][_0xc3f8('0x28')]({'plain':!![]});if(!_0x4874e1){return _0x2a238d['status'](0x191)[_0xc3f8('0x38')](_0xc3f8('0x182'));}else{return _0x2a238d[_0xc3f8('0x1e')](0xc8)[_0xc3f8('0x175')](_0x4874e1);}};exports[_0xc3f8('0x183')]=function(_0x1b8e20,_0x257cf1){var _0x443346={'offset':0x0},_0x28387d={'count':0x0,'rows':[]};Promise[_0xc3f8('0x184')]()[_0xc3f8('0x11')](function(){if(!_0x1b8e20['query'][_0xc3f8('0x31')]&&!_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x185')]&&!_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x186')])return[];return Promise[_0xc3f8('0x184')]()[_0xc3f8('0x11')](function(){var _0x3ed07f=[];if(!_[_0xc3f8('0x85')](_0x1b8e20[_0xc3f8('0x45')]['teams'])){_0x3ed07f[_0xc3f8('0x41')](db[_0xc3f8('0x112')][_0xc3f8('0x43')]({'attributes':['id',_0xc3f8('0x36')],'where':{'id':_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x185')]}}));}if(!_['isEmpty'](_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x186')])){_0x3ed07f[_0xc3f8('0x41')](db['VoiceQueue']['findAll']({'attributes':['id','name'],'type':_0xc3f8('0x187'),'where':{'id':_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x186')]}}));}return Promise['all'](_0x3ed07f);})[_0xc3f8('0x11')](function(_0xc775fa){var _0x26cc18=_['flatten'](_0xc775fa)[_0xc3f8('0x33')](function(_0x4e8e3d){return _0x4e8e3d[_0xc3f8('0x12a')]({'attributes':['id',_0xc3f8('0x36'),_0xc3f8('0x61'),_0xc3f8('0x121')],'raw':!![]});});return Promise[_0xc3f8('0x4e')](_0x26cc18);})[_0xc3f8('0x11')](function(_0x131e8c){var _0x5b329d=_[_0xc3f8('0x11e')](_0x131e8c);if(!_0x1b8e20['query']['filter'])return _0x5b329d;if(_[_0xc3f8('0x85')](_0x5b329d)){return db[_0xc3f8('0x42')]['findAll']({'attributes':['id',_0xc3f8('0x36'),'internal',_0xc3f8('0x121')],'where':{'role':_0xc3f8('0x2e'),'$or':[db[_0xc3f8('0x63')][_0xc3f8('0xcb')](db['sequelize']['fn']('lower',db['sequelize'][_0xc3f8('0x188')](_0xc3f8('0x36'))),{'$like':'%'+_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x31')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x1b8e20['query'][_0xc3f8('0x31')]+'%'}}]},'raw':!![]});}else{return _(_0x5b329d)['flatten']()[_0xc3f8('0x31')](function(_0x56121f){return _0x56121f[_0xc3f8('0x36')][_0xc3f8('0x9d')]()[_0xc3f8('0x3f')](_0x1b8e20['query'][_0xc3f8('0x31')][_0xc3f8('0x9d')]())||_0x56121f[_0xc3f8('0x61')]['toString']()['includes'](_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x31')]);})[_0xc3f8('0x34')]();}})['then'](function(_0x24de78){var _0x31076a='name';var _0x41a3dd=_0xc3f8('0x189');if(_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0xca')]){var _0x41a3dd=_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0xca')][0x0]==='-'?_0xc3f8('0x18a'):_0xc3f8('0x189');var _0x31076a=_0x41a3dd==='asc'?_0x1b8e20[_0xc3f8('0x45')]['sort']:_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0xca')][_0xc3f8('0x18b')](0x1);}return _(_0x24de78)[_0xc3f8('0x18c')]('id')[_0xc3f8('0x18d')]([function(_0x45b0b7){return _0x31076a===_0xc3f8('0x36')?_0x45b0b7[_0x31076a][_0xc3f8('0x9d')]():_0x45b0b7[_0x31076a];}],[_0x41a3dd])[_0xc3f8('0x33')](function(_0x1d0dd4){return _[_0xc3f8('0xcc')](_0x1d0dd4,['id',_0xc3f8('0x36'),_0xc3f8('0x61'),_0xc3f8('0x121')]);})[_0xc3f8('0x34')]();})[_0xc3f8('0x11')](function(_0x12a9ce){return client[_0xc3f8('0x10')]('Agents',_0x1b8e20)[_0xc3f8('0x11')](function(_0x427fdc){if(_0x427fdc[_0xc3f8('0x18')])throw new Error(_0xc3f8('0x18e'));var _0x1a719=_0x427fdc[_0xc3f8('0x1b')];var _0x54511c=jayson['client'][_0xc3f8('0x18f')]({'port':0x232c});return _0x54511c[_0xc3f8('0x10')](_0xc3f8('0x2d'),_0x1b8e20)[_0xc3f8('0x11')](function(_0xc129c8){if(_0xc129c8[_0xc3f8('0x18')])throw new Error(_0xc3f8('0x190'));var _0x2b4439=_0xc129c8[_0xc3f8('0x1b')];return _[_0xc3f8('0xcd')]({},_0x2b4439,_0x1a719);});})[_0xc3f8('0x11')](function(_0x4c2ca1){return _[_0xc3f8('0x33')](_0x12a9ce,function(_0x1f4ff5){var _0x4ca2de=_['find'](_0x4c2ca1[_0xc3f8('0x44')],['id',_0x1f4ff5['id']]);if(!_0x4ca2de||!_0x1f4ff5['online']){_0x1f4ff5['status']=_0xc3f8('0x191');}else if(_0x4ca2de[_0xc3f8('0xa5')]){_0x1f4ff5[_0xc3f8('0x1e')]=_0xc3f8('0x101');}else{_0x1f4ff5[_0xc3f8('0x1e')]=_[_0xc3f8('0x3f')]([_0xc3f8('0x192'),_0xc3f8('0x193'),_0xc3f8('0x194'),_0xc3f8('0x195'),null,undefined],_0x4ca2de[_0xc3f8('0x196')])?_0xc3f8('0x121'):_0xc3f8('0x197');}return _0x1f4ff5;});});});})['then'](function(_0x574226){if(!_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0xd3')](_0xc3f8('0xd4'))){_0x443346['limit']=qs[_0xc3f8('0x21')](_0x1b8e20[_0xc3f8('0x45')]['limit']||0xa);_0x443346['offset']=qs['offset'](_0x1b8e20[_0xc3f8('0x45')][_0xc3f8('0x20')]);}_0x28387d[_0xc3f8('0x23')]=_0x574226[_0xc3f8('0x47')];_0x28387d['rows']=_0x443346[_0xc3f8('0x21')]?_0x574226[_0xc3f8('0x198')](_0x443346[_0xc3f8('0x20')],_0x443346[_0xc3f8('0x20')]+_0x443346[_0xc3f8('0x21')]):_0x574226;return _0x28387d;})[_0xc3f8('0x11')](respondWithFilteredResult(_0x257cf1,_0x443346))[_0xc3f8('0x1c')](handleError(_0x257cf1,null));};function get_open_tabs(_0x575cf5,_0x2609ea){var _0x45d3c0=_0x575cf5[_0xc3f8('0x199')](0x0)[_0xc3f8('0x19a')]()+_0x575cf5['slice'](0x1);var _0xf68e9b={'type':db[_0xc3f8('0x8c')][_0xc3f8('0x19b')]['SELECT'],'raw':!![]};return new BPromise(function(_0x184b6c,_0x638f91){var _0x1f84ec=squel[_0xc3f8('0x19c')]()[_0xc3f8('0x19d')](_0xc3f8('0x19e')+_0x45d3c0+'InteractionId','id')[_0xc3f8('0x19d')](_0xc3f8('0x19f'))[_0xc3f8('0x66')](_0xc3f8('0x1a0')+_0x575cf5+_0xc3f8('0x1a1'),'ui')[_0xc3f8('0xcb')](_0xc3f8('0x1a2'),_0x2609ea['id']);return db[_0xc3f8('0x63')][_0xc3f8('0x45')](_0x1f84ec[_0xc3f8('0x1a3')](),_0xf68e9b)[_0xc3f8('0x11')](function(_0x137783){_0x2609ea[_0x45d3c0+_0xc3f8('0x1a4')]=_0x137783;_0x184b6c(_0x137783);})[_0xc3f8('0x1c')](function(_0x1e0382){_0x638f91(_0x1e0382);});});};
\ No newline at end of file
index 87dbf11..1d5dfdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ae=['exports','events','../../mysqldb','User','update','remove','emit','hasOwnProperty','hook'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xc7ae,0x12a));var _0xec7a=function(_0xb1bb88,_0x1bb8a6){_0xb1bb88=_0xb1bb88-0x0;var _0xe81a96=_0xc7ae[_0xb1bb88];return _0xe81a96;};'use strict';var EventEmitter=require(_0xec7a('0x0'));var User=require(_0xec7a('0x1'))['db'][_0xec7a('0x2')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xec7a('0x3'),'afterDestroy':_0xec7a('0x4')};function emitEvent(_0x25127a){return function(_0x3341cf,_0x26ade9,_0x2ea15f){UserEvents[_0xec7a('0x5')](_0x25127a+':'+_0x3341cf['id'],_0x3341cf);UserEvents[_0xec7a('0x5')](_0x25127a,_0x3341cf);_0x2ea15f(null);};}for(var e in events){if(events[_0xec7a('0x6')](e)){var event=events[e];User[_0xec7a('0x7')](e,emitEvent(event));}}module[_0xec7a('0x8')]=UserEvents;
\ No newline at end of file
+var _0x5f04=['exports','events','../../mysqldb','User','setMaxListeners','remove','emit'];(function(_0x324b53,_0x38e44b){var _0x36cd87=function(_0x1c4046){while(--_0x1c4046){_0x324b53['push'](_0x324b53['shift']());}};_0x36cd87(++_0x38e44b);}(_0x5f04,0x104));var _0x45f0=function(_0x285b48,_0x41b4c6){_0x285b48=_0x285b48-0x0;var _0x5020e9=_0x5f04[_0x285b48];return _0x5020e9;};'use strict';var EventEmitter=require(_0x45f0('0x0'));var User=require(_0x45f0('0x1'))['db'][_0x45f0('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x45f0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x45f0('0x4')};function emitEvent(_0x367f3c){return function(_0x46bd6a,_0x432181,_0x196af9){UserEvents[_0x45f0('0x5')](_0x367f3c+':'+_0x46bd6a['id'],_0x46bd6a);UserEvents[_0x45f0('0x5')](_0x367f3c,_0x46bd6a);_0x196af9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x45f0('0x6')]=UserEvents;
\ No newline at end of file
index 8065fa7..f59497c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bfa=['context','from-sip','system','prefix','merge','Set','format','chanspy','record','push','${UNIQUEID}.%s,a','recordingFormat','auth','ChanSpy','options','StopMixMonitor','WAV','gsm','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','name','SIP/%s,,tTxX','priority','defaults','VoiceChanSpy','findAll','then','concat','exports','define','User','users','utf8_bin','userProfileId','undefined','privacyEnabled','updateMd5Password','catch','resolve','changed','UserProfile','find','password','updatePassword','internal','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','pbkdf2','sha1','indexOf','provider','makeSalt','md5secret',':asterisk:','bluebird','crypto','md5','lodash','google','length'];(function(_0x7b08e5,_0x529d97){var _0x523dee=function(_0x1dd340){while(--_0x1dd340){_0x7b08e5['push'](_0x7b08e5['shift']());}};_0x523dee(++_0x529d97);}(_0x3bfa,0x1f2));var _0xa3bf=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x3bfa[_0x17b6e3];return _0x3906f3;};'use strict';var BPromise=require(_0xa3bf('0x0'));var crypto=require(_0xa3bf('0x1'));var util=require('util');var md5=require(_0xa3bf('0x2'));var _=require(_0xa3bf('0x3'));var attributes=require('./user.attributes');var authTypes=[_0xa3bf('0x4')];var validatePresenceOf=function(_0x482b78){return _0x482b78&&_0x482b78[_0xa3bf('0x5')];};var getChanSpyApplications=function(_0x5d7587,_0x10ab5b,_0x44ed8e){var _0x204f9a={'context':_0x5d7587[_0xa3bf('0x6')]||_0xa3bf('0x7'),'type':_0xa3bf('0x8'),'isApp':![],'UserId':_0x5d7587['id']};var _0x44007d=[];for(var _0x3d8290=0x0,_0x5bb0e9=0x1;_0x3d8290<_0x44ed8e[_0xa3bf('0x5')];_0x3d8290++,_0x5bb0e9=0x1){var _0x5b8997={'exten':util['format']('%s%s',_0x44ed8e[_0x3d8290][_0xa3bf('0x9')],_0x10ab5b),'ChanSpyId':_0x44ed8e[_0x3d8290]['id']};_0x44007d['push'](_[_0xa3bf('0xa')]({'app':_0xa3bf('0xb'),'appdata':util[_0xa3bf('0xc')]('CDR(type)=%s',_0xa3bf('0xd')),'priority':_0x5bb0e9++},_0x204f9a,_0x5b8997));if(_0x44ed8e[_0x3d8290][_0xa3bf('0xe')]){_0x44007d[_0xa3bf('0xf')](_[_0xa3bf('0xa')]({'app':'MixMonitor','appdata':util[_0xa3bf('0xc')](_0xa3bf('0x10'),_0x44ed8e[_0x3d8290][_0xa3bf('0x11')]),'priority':_0x5bb0e9++},_0x204f9a,_0x5b8997));}if(_0x44ed8e[_0x3d8290][_0xa3bf('0x12')]){_0x44007d[_0xa3bf('0xf')](_[_0xa3bf('0xa')]({'app':'Authenticate','appdata':_0x44ed8e[_0x3d8290]['password'],'priority':_0x5bb0e9++},_0x204f9a,_0x5b8997));}_0x44007d['push'](_[_0xa3bf('0xa')]({'app':_0xa3bf('0x13'),'appdata':util[_0xa3bf('0xc')]('SIP/%s,%s',_0x5d7587['name'],_0x44ed8e[_0x3d8290][_0xa3bf('0x14')]?_0x44ed8e[_0x3d8290][_0xa3bf('0x14')]['join'](''):''),'priority':_0x5bb0e9++},_0x204f9a,_0x5b8997));if(_0x44ed8e[_0x3d8290]['record']){_0x44007d[_0xa3bf('0xf')](_['merge']({'app':_0xa3bf('0x15'),'priority':_0x5bb0e9++},_0x204f9a,_0x5b8997));}}return _0x44007d;};var getUserApplications=function(_0x1c2b62,_0x4d2b91){var _0x40971a=['wav',_0xa3bf('0x16'),_0xa3bf('0x17')];var _0x12821e={'context':_0x1c2b62[_0xa3bf('0x6')]||_0xa3bf('0x7'),'exten':_0x4d2b91,'type':_0xa3bf('0x8'),'isApp':![],'UserId':_0x1c2b62['id']};var _0x47d5d5=[{'app':_0xa3bf('0xb'),'appdata':_0xa3bf('0x18')}];if(_0x1c2b62['extensionMonitor']&&_['includes'](_0x40971a,_0x1c2b62[_0xa3bf('0x19')])){_0x47d5d5['push']({'app':'Set','appdata':_0xa3bf('0x1a')});_0x47d5d5['push']({'app':_0xa3bf('0xb'),'appdata':util[_0xa3bf('0xc')](_0xa3bf('0x1b'),_0x1c2b62['extensionMonitor'])});_0x47d5d5['push']({'app':_0xa3bf('0x1c'),'appdata':util[_0xa3bf('0xc')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x1c2b62[_0xa3bf('0x1d')])});}else{_0x47d5d5['push']({'app':_0xa3bf('0x1c'),'appdata':util['format'](_0xa3bf('0x1e'),_0x1c2b62[_0xa3bf('0x1d')])});}_0x47d5d5[_0xa3bf('0xf')]({'app':'Hangup'});for(var _0x36e6b6=0x0;_0x36e6b6<_0x47d5d5[_0xa3bf('0x5')];_0x36e6b6++){_0x47d5d5[_0x36e6b6][_0xa3bf('0x1f')]=_0x36e6b6+0x1;_0x47d5d5[_0x36e6b6]=_[_0xa3bf('0x20')](_0x47d5d5[_0x36e6b6],_0x12821e);}return _0x47d5d5;};var getChanSpyPromise=function(_0x4853df,_0x210ed4){return new BPromise(function(_0xb54c79,_0xb5788b){return _0x4853df[_0xa3bf('0x21')][_0xa3bf('0x22')]()[_0xa3bf('0x23')](function(_0x143544){if(_0x143544){var _0x15f749=getChanSpyApplications(_0x210ed4,_0x210ed4['internal'],_0x143544);if(_0x210ed4['internal']!=_0x210ed4[_0xa3bf('0x1d')]){_0x15f749=_0x15f749[_0xa3bf('0x24')](getChanSpyApplications(_0x210ed4,_0x210ed4[_0xa3bf('0x1d')],_0x143544));}return _0xb54c79(_0x15f749);}return _0xb54c79([]);})['catch'](function(_0x147935){_0xb5788b(_0x147935);});});};module[_0xa3bf('0x25')]=function(_0x28e0f6,_0x1f0d35){var _0x13ee2c=_0x28e0f6['models'];return _0x28e0f6[_0xa3bf('0x26')](_0xa3bf('0x27'),attributes,{'tableName':_0xa3bf('0x28'),'charset':'utf8','collate':_0xa3bf('0x29'),'hooks':{'beforeCreate':function(_0x590b84,_0x796899,_0x5b38b4){var _0x578cba=typeof _0x590b84[_0xa3bf('0x2a')]===_0xa3bf('0x2b')?BPromise['resolve'](null):_0x13ee2c['UserProfile']['find']({'where':{'id':_0x590b84[_0xa3bf('0x2a')]}});_0x578cba[_0xa3bf('0x23')](function(_0x523364){if(_0x523364){_0x590b84[_0xa3bf('0x2c')]=_0x523364[_0xa3bf('0x2c')];}})['then'](function(){_0x590b84[_0xa3bf('0x2d')]();_0x590b84['updatePassword'](_0x5b38b4);})[_0xa3bf('0x2e')](function(_0x2e79d5){_0x5b38b4(_0x2e79d5);});},'beforeUpdate':function(_0x822893,_0x206ab3,_0x4a40a1){Promise[_0xa3bf('0x2f')]()[_0xa3bf('0x23')](function(){if(_0x822893[_0xa3bf('0x30')](_0xa3bf('0x2a'))===![])return;return _0x13ee2c[_0xa3bf('0x31')][_0xa3bf('0x32')]({'where':{'id':_0x822893[_0xa3bf('0x2a')]}})[_0xa3bf('0x23')](function(_0x99682d){if(_0x99682d)_0x822893['privacyEnabled']=_0x99682d[_0xa3bf('0x2c')];return;});})[_0xa3bf('0x23')](function(){if(_0x822893[_0xa3bf('0x30')](_0xa3bf('0x33'))){_0x822893[_0xa3bf('0x2d')]();return _0x822893[_0xa3bf('0x34')](_0x4a40a1);}_0x4a40a1();})[_0xa3bf('0x2e')](function(_0x342b39){_0x4a40a1(_0x342b39);});},'afterCreate':function(_0x4bbdcc,_0xfe29ed,_0x385628){var _0x25c35f=getUserApplications(_0x4bbdcc,_0x4bbdcc[_0xa3bf('0x35')]);if(_0x4bbdcc['internal']!=_0x4bbdcc['name']){_0x25c35f=_0x25c35f[_0xa3bf('0x24')](getUserApplications(_0x4bbdcc,_0x4bbdcc['name']));}return _0x13ee2c[_0xa3bf('0x36')][_0xa3bf('0x37')](_0x25c35f)[_0xa3bf('0x23')](function(){if(_0x4bbdcc[_0xa3bf('0xd')]){return getChanSpyPromise(_0x13ee2c,_0x4bbdcc);}})[_0xa3bf('0x23')](function(_0xb3e906){if(_0xb3e906&&_0xb3e906[_0xa3bf('0x5')]){return _0x13ee2c[_0xa3bf('0x36')]['bulkCreate'](_0xb3e906);}})[_0xa3bf('0x23')](function(){_0x385628();})[_0xa3bf('0x2e')](function(_0x4402f8){_0x385628(_0x4402f8);});},'afterUpdate':function(_0x103108,_0x1093a5,_0x13d4f6){return BPromise[_0xa3bf('0x2f')]()[_0xa3bf('0x23')](function(){if(_0x103108[_0xa3bf('0x30')]('chanspy')||_0x103108['changed']('context')){return _0x13ee2c[_0xa3bf('0x36')][_0xa3bf('0x38')]({'where':{'UserId':_0x103108['id'],'type':_0xa3bf('0x8'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x103108['chanspy']){return getChanSpyPromise(_0x13ee2c,_0x103108)[_0xa3bf('0x23')](function(_0x2da099){if(_0x2da099&&_0x2da099[_0xa3bf('0x5')]){return _0x13ee2c['VoiceExtension'][_0xa3bf('0x37')](_0x2da099);}});}});}})['then'](function(){if(_0x103108[_0xa3bf('0x30')]('extensionMonitor')||_0x103108[_0xa3bf('0x30')]('context')){return _0x13ee2c[_0xa3bf('0x36')]['destroy']({'where':{'UserId':_0x103108['id'],'type':_0xa3bf('0x8'),'ChanSpyId':null}})[_0xa3bf('0x23')](function(){var _0x405628=getUserApplications(_0x103108,_0x103108[_0xa3bf('0x35')]);if(_0x103108[_0xa3bf('0x35')]!=_0x103108[_0xa3bf('0x1d')]){_0x405628=_0x405628[_0xa3bf('0x24')](getUserApplications(_0x103108,_0x103108[_0xa3bf('0x1d')]));}return _0x13ee2c[_0xa3bf('0x36')][_0xa3bf('0x37')](_0x405628);});}})[_0xa3bf('0x23')](function(){_0x13d4f6();})[_0xa3bf('0x2e')](function(_0x460463){_0x13d4f6(_0x460463);});},'afterDestroy':function(_0xf6a463,_0x202baa){return _0x13ee2c['VoiceExtension'][_0xa3bf('0x38')]({'where':{'UserId':_0xf6a463['id'],'type':_0xa3bf('0x8')}});}},'instanceMethods':{'authenticate':function(_0x5a1683,_0x5e73d2){if(!_0x5e73d2){return this[_0xa3bf('0x33')]===this[_0xa3bf('0x39')](_0x5a1683);}var _0x245e14=this;this[_0xa3bf('0x39')](_0x5a1683,function(_0x5d4168,_0xf5388b){if(_0x5d4168){_0x5e73d2(_0x5d4168);}if(_0x245e14['password']===_0xf5388b){_0x5e73d2(null,!![]);}else{_0x5e73d2(null,![]);}});},'makeSalt':function(_0x449827,_0x2887f6){var _0x108423=0x10;if(typeof arguments[0x0]==='function'){_0x2887f6=arguments[0x0];_0x449827=_0x108423;}else if(typeof arguments[0x1]===_0xa3bf('0x3a')){_0x2887f6=arguments[0x1];}else{throw new Error(_0xa3bf('0x3b'));}if(!_0x449827){_0x449827=_0x108423;}return crypto[_0xa3bf('0x3c')](_0x449827,function(_0x4f8181,_0x1d9116){if(_0x4f8181){_0x2887f6(_0x4f8181);}return _0x2887f6(null,_0x1d9116[_0xa3bf('0x3d')](_0xa3bf('0x3e')));});},'encryptPassword':function(_0x585a3d,_0x3bade2){if(!_0x585a3d||!this[_0xa3bf('0x3f')]){return _0x3bade2?_0x3bade2(null):null;}var _0x52224a=0x2710;var _0xd7dbc9=0x40;var _0x55fdd2=new Buffer(this['salt'],_0xa3bf('0x3e'));if(!_0x3bade2){return crypto[_0xa3bf('0x40')](_0x585a3d,_0x55fdd2,_0x52224a,_0xd7dbc9,'sha1')[_0xa3bf('0x3d')](_0xa3bf('0x3e'));}return crypto[_0xa3bf('0x41')](_0x585a3d,_0x55fdd2,_0x52224a,_0xd7dbc9,_0xa3bf('0x42'),function(_0x194129,_0x5ec482){if(_0x194129){_0x3bade2(_0x194129);}return _0x3bade2(null,_0x5ec482[_0xa3bf('0x3d')]('base64'));});},'updatePassword':function(_0x2a9c6f){if(!this['password']){return _0x2a9c6f(null);}if(!validatePresenceOf(this[_0xa3bf('0x33')])&&authTypes[_0xa3bf('0x43')](this[_0xa3bf('0x44')])===-0x1){_0x2a9c6f(new Error('Invalid\x20password'));}var _0x3eeff1=this;this[_0xa3bf('0x45')](function(_0x351d2d,_0x524bd9){if(_0x351d2d){return _0x2a9c6f(_0x351d2d);}_0x3eeff1[_0xa3bf('0x3f')]=_0x524bd9;_0x3eeff1['encryptPassword'](_0x3eeff1[_0xa3bf('0x33')],function(_0x1eca5d,_0x24fa86){if(_0x1eca5d){_0x2a9c6f(_0x1eca5d);}_0x3eeff1['password']=_0x24fa86;_0x2a9c6f(null);});});},'updateMd5Password':function(){this[_0xa3bf('0x46')]=md5(this['name']+_0xa3bf('0x47')+this[_0xa3bf('0x33')]);return this[_0xa3bf('0x46')];}}});};
\ No newline at end of file
+var _0x780b=['salt','md5secret',':asterisk:','bluebird','crypto','util','md5','lodash','./user.attributes','google','length','context','from-sip','system','%s%s','prefix','push','merge','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','password','SIP/%s,%s','name','options','join','wav','gsm','Set','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Hangup','priority','VoiceChanSpy','findAll','internal','exports','models','define','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','then','privacyEnabled','updateMd5Password','catch','changed','updatePassword','VoiceExtension','bulkCreate','destroy','concat','encryptPassword','function','randomBytes','toString','base64','pbkdf2Sync','pbkdf2','sha1','indexOf','provider','Invalid\x20password','makeSalt'];(function(_0x52a3b9,_0x134550){var _0x2b0874=function(_0x4358b5){while(--_0x4358b5){_0x52a3b9['push'](_0x52a3b9['shift']());}};_0x2b0874(++_0x134550);}(_0x780b,0x184));var _0xb780=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x780b[_0x3e5086];return _0xfeb102;};'use strict';var BPromise=require(_0xb780('0x0'));var crypto=require(_0xb780('0x1'));var util=require(_0xb780('0x2'));var md5=require(_0xb780('0x3'));var _=require(_0xb780('0x4'));var attributes=require(_0xb780('0x5'));var authTypes=[_0xb780('0x6')];var validatePresenceOf=function(_0x36cbe3){return _0x36cbe3&&_0x36cbe3[_0xb780('0x7')];};var getChanSpyApplications=function(_0x1a82d1,_0x32e793,_0xca49a2){var _0x128197={'context':_0x1a82d1[_0xb780('0x8')]||_0xb780('0x9'),'type':_0xb780('0xa'),'isApp':![],'UserId':_0x1a82d1['id']};var _0x45b562=[];for(var _0x1931ca=0x0,_0x1041b7=0x1;_0x1931ca<_0xca49a2[_0xb780('0x7')];_0x1931ca++,_0x1041b7=0x1){var _0x11289c={'exten':util['format'](_0xb780('0xb'),_0xca49a2[_0x1931ca][_0xb780('0xc')],_0x32e793),'ChanSpyId':_0xca49a2[_0x1931ca]['id']};_0x45b562[_0xb780('0xd')](_[_0xb780('0xe')]({'app':'Set','appdata':util[_0xb780('0xf')](_0xb780('0x10'),_0xb780('0x11')),'priority':_0x1041b7++},_0x128197,_0x11289c));if(_0xca49a2[_0x1931ca][_0xb780('0x12')]){_0x45b562[_0xb780('0xd')](_[_0xb780('0xe')]({'app':_0xb780('0x13'),'appdata':util['format'](_0xb780('0x14'),_0xca49a2[_0x1931ca]['recordingFormat']),'priority':_0x1041b7++},_0x128197,_0x11289c));}if(_0xca49a2[_0x1931ca]['auth']){_0x45b562['push'](_['merge']({'app':'Authenticate','appdata':_0xca49a2[_0x1931ca][_0xb780('0x15')],'priority':_0x1041b7++},_0x128197,_0x11289c));}_0x45b562['push'](_['merge']({'app':'ChanSpy','appdata':util[_0xb780('0xf')](_0xb780('0x16'),_0x1a82d1[_0xb780('0x17')],_0xca49a2[_0x1931ca][_0xb780('0x18')]?_0xca49a2[_0x1931ca][_0xb780('0x18')][_0xb780('0x19')](''):''),'priority':_0x1041b7++},_0x128197,_0x11289c));if(_0xca49a2[_0x1931ca][_0xb780('0x12')]){_0x45b562[_0xb780('0xd')](_[_0xb780('0xe')]({'app':'StopMixMonitor','priority':_0x1041b7++},_0x128197,_0x11289c));}}return _0x45b562;};var getUserApplications=function(_0x13dec2,_0xf07c45){var _0x4beb08=[_0xb780('0x1a'),'WAV',_0xb780('0x1b')];var _0x4922b7={'context':_0x13dec2['context']||_0xb780('0x9'),'exten':_0xf07c45,'type':_0xb780('0xa'),'isApp':![],'UserId':_0x13dec2['id']};var _0x580182=[{'app':_0xb780('0x1c'),'appdata':_0xb780('0x1d')}];if(_0x13dec2[_0xb780('0x1e')]&&_[_0xb780('0x1f')](_0x4beb08,_0x13dec2[_0xb780('0x1e')])){_0x580182[_0xb780('0xd')]({'app':_0xb780('0x1c'),'appdata':_0xb780('0x20')});_0x580182['push']({'app':_0xb780('0x1c'),'appdata':util[_0xb780('0xf')](_0xb780('0x21'),_0x13dec2['extensionMonitor'])});_0x580182[_0xb780('0xd')]({'app':_0xb780('0x22'),'appdata':util[_0xb780('0xf')](_0xb780('0x23'),_0x13dec2[_0xb780('0x17')])});}else{_0x580182[_0xb780('0xd')]({'app':'Dial','appdata':util[_0xb780('0xf')]('SIP/%s,,tTxX',_0x13dec2[_0xb780('0x17')])});}_0x580182[_0xb780('0xd')]({'app':_0xb780('0x24')});for(var _0x130884=0x0;_0x130884<_0x580182[_0xb780('0x7')];_0x130884++){_0x580182[_0x130884][_0xb780('0x25')]=_0x130884+0x1;_0x580182[_0x130884]=_['defaults'](_0x580182[_0x130884],_0x4922b7);}return _0x580182;};var getChanSpyPromise=function(_0x226e27,_0x117650){return new BPromise(function(_0x3fc0b1,_0x73987a){return _0x226e27[_0xb780('0x26')][_0xb780('0x27')]()['then'](function(_0x11a9e4){if(_0x11a9e4){var _0x3b65c2=getChanSpyApplications(_0x117650,_0x117650[_0xb780('0x28')],_0x11a9e4);if(_0x117650[_0xb780('0x28')]!=_0x117650['name']){_0x3b65c2=_0x3b65c2['concat'](getChanSpyApplications(_0x117650,_0x117650[_0xb780('0x17')],_0x11a9e4));}return _0x3fc0b1(_0x3b65c2);}return _0x3fc0b1([]);})['catch'](function(_0x4e64f3){_0x73987a(_0x4e64f3);});});};module[_0xb780('0x29')]=function(_0x104af1,_0x18f239){var _0x257d67=_0x104af1[_0xb780('0x2a')];return _0x104af1[_0xb780('0x2b')](_0xb780('0x2c'),attributes,{'tableName':_0xb780('0x2d'),'charset':_0xb780('0x2e'),'collate':_0xb780('0x2f'),'hooks':{'beforeCreate':function(_0x184d19,_0x50bba3,_0x422d9a){var _0x3120de=typeof _0x184d19[_0xb780('0x30')]===_0xb780('0x31')?BPromise[_0xb780('0x32')](null):_0x257d67[_0xb780('0x33')]['find']({'where':{'id':_0x184d19[_0xb780('0x30')]}});_0x3120de[_0xb780('0x34')](function(_0x4bb9e5){if(_0x4bb9e5){_0x184d19['privacyEnabled']=_0x4bb9e5[_0xb780('0x35')];}})['then'](function(){_0x184d19[_0xb780('0x36')]();_0x184d19['updatePassword'](_0x422d9a);})[_0xb780('0x37')](function(_0x54887f){_0x422d9a(_0x54887f);});},'beforeUpdate':function(_0xb22a2c,_0x4fb406,_0x38dd9b){Promise[_0xb780('0x32')]()[_0xb780('0x34')](function(){if(_0xb22a2c[_0xb780('0x38')](_0xb780('0x30'))===![])return;return _0x257d67['UserProfile']['find']({'where':{'id':_0xb22a2c[_0xb780('0x30')]}})[_0xb780('0x34')](function(_0x4c5f35){if(_0x4c5f35)_0xb22a2c[_0xb780('0x35')]=_0x4c5f35['privacyEnabled'];return;});})[_0xb780('0x34')](function(){if(_0xb22a2c[_0xb780('0x38')]('password')){_0xb22a2c[_0xb780('0x36')]();return _0xb22a2c[_0xb780('0x39')](_0x38dd9b);}_0x38dd9b();})[_0xb780('0x37')](function(_0x25d7f1){_0x38dd9b(_0x25d7f1);});},'afterCreate':function(_0x207a5d,_0x430941,_0x2019fb){var _0x59130e=getUserApplications(_0x207a5d,_0x207a5d[_0xb780('0x28')]);if(_0x207a5d['internal']!=_0x207a5d[_0xb780('0x17')]){_0x59130e=_0x59130e['concat'](getUserApplications(_0x207a5d,_0x207a5d['name']));}return _0x257d67['VoiceExtension']['bulkCreate'](_0x59130e)[_0xb780('0x34')](function(){if(_0x207a5d[_0xb780('0x11')]){return getChanSpyPromise(_0x257d67,_0x207a5d);}})[_0xb780('0x34')](function(_0x517da7){if(_0x517da7&&_0x517da7[_0xb780('0x7')]){return _0x257d67[_0xb780('0x3a')][_0xb780('0x3b')](_0x517da7);}})[_0xb780('0x34')](function(){_0x2019fb();})['catch'](function(_0x5dc570){_0x2019fb(_0x5dc570);});},'afterUpdate':function(_0x5de730,_0xd5d2b8,_0x30fa7f){return BPromise[_0xb780('0x32')]()[_0xb780('0x34')](function(){if(_0x5de730['changed'](_0xb780('0x11'))||_0x5de730['changed'](_0xb780('0x8'))){return _0x257d67[_0xb780('0x3a')][_0xb780('0x3c')]({'where':{'UserId':_0x5de730['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0xb780('0x34')](function(){if(_0x5de730[_0xb780('0x11')]){return getChanSpyPromise(_0x257d67,_0x5de730)[_0xb780('0x34')](function(_0x1c60d5){if(_0x1c60d5&&_0x1c60d5[_0xb780('0x7')]){return _0x257d67[_0xb780('0x3a')][_0xb780('0x3b')](_0x1c60d5);}});}});}})[_0xb780('0x34')](function(){if(_0x5de730['changed'](_0xb780('0x1e'))||_0x5de730['changed'](_0xb780('0x8'))){return _0x257d67[_0xb780('0x3a')][_0xb780('0x3c')]({'where':{'UserId':_0x5de730['id'],'type':'system','ChanSpyId':null}})[_0xb780('0x34')](function(){var _0xc86fcc=getUserApplications(_0x5de730,_0x5de730[_0xb780('0x28')]);if(_0x5de730[_0xb780('0x28')]!=_0x5de730[_0xb780('0x17')]){_0xc86fcc=_0xc86fcc[_0xb780('0x3d')](getUserApplications(_0x5de730,_0x5de730[_0xb780('0x17')]));}return _0x257d67['VoiceExtension'][_0xb780('0x3b')](_0xc86fcc);});}})[_0xb780('0x34')](function(){_0x30fa7f();})[_0xb780('0x37')](function(_0x1ceea0){_0x30fa7f(_0x1ceea0);});},'afterDestroy':function(_0x534a46,_0xd89afa){return _0x257d67['VoiceExtension']['destroy']({'where':{'UserId':_0x534a46['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x4f309d,_0x6794bd){if(!_0x6794bd){return this[_0xb780('0x15')]===this[_0xb780('0x3e')](_0x4f309d);}var _0x6113fb=this;this['encryptPassword'](_0x4f309d,function(_0x379b25,_0x3314c5){if(_0x379b25){_0x6794bd(_0x379b25);}if(_0x6113fb[_0xb780('0x15')]===_0x3314c5){_0x6794bd(null,!![]);}else{_0x6794bd(null,![]);}});},'makeSalt':function(_0x160696,_0x4ad23b){var _0x8e9099=0x10;if(typeof arguments[0x0]===_0xb780('0x3f')){_0x4ad23b=arguments[0x0];_0x160696=_0x8e9099;}else if(typeof arguments[0x1]===_0xb780('0x3f')){_0x4ad23b=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x160696){_0x160696=_0x8e9099;}return crypto[_0xb780('0x40')](_0x160696,function(_0x836e7f,_0x41d6de){if(_0x836e7f){_0x4ad23b(_0x836e7f);}return _0x4ad23b(null,_0x41d6de[_0xb780('0x41')]('base64'));});},'encryptPassword':function(_0xb6d17f,_0x5bdb9d){if(!_0xb6d17f||!this['salt']){return _0x5bdb9d?_0x5bdb9d(null):null;}var _0x4725cd=0x2710;var _0x1d2bed=0x40;var _0x4b114e=new Buffer(this['salt'],_0xb780('0x42'));if(!_0x5bdb9d){return crypto[_0xb780('0x43')](_0xb6d17f,_0x4b114e,_0x4725cd,_0x1d2bed,'sha1')[_0xb780('0x41')](_0xb780('0x42'));}return crypto[_0xb780('0x44')](_0xb6d17f,_0x4b114e,_0x4725cd,_0x1d2bed,_0xb780('0x45'),function(_0x304c38,_0x235abb){if(_0x304c38){_0x5bdb9d(_0x304c38);}return _0x5bdb9d(null,_0x235abb[_0xb780('0x41')](_0xb780('0x42')));});},'updatePassword':function(_0x143edb){if(!this[_0xb780('0x15')]){return _0x143edb(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0xb780('0x46')](this[_0xb780('0x47')])===-0x1){_0x143edb(new Error(_0xb780('0x48')));}var _0x1e44e0=this;this[_0xb780('0x49')](function(_0x54bc9e,_0x27381b){if(_0x54bc9e){return _0x143edb(_0x54bc9e);}_0x1e44e0[_0xb780('0x4a')]=_0x27381b;_0x1e44e0[_0xb780('0x3e')](_0x1e44e0['password'],function(_0x45f5cb,_0x1e506f){if(_0x45f5cb){_0x143edb(_0x45f5cb);}_0x1e44e0['password']=_0x1e506f;_0x143edb(null);});});},'updateMd5Password':function(){this[_0xb780('0x4b')]=md5(this[_0xb780('0x17')]+_0xb780('0x4c')+this[_0xb780('0x15')]);return this[_0xb780('0x4b')];}}});};
\ No newline at end of file
index 57c0e6c..25e661d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5026=['User','findAll','options','raw','attributes','include','map','model','then','ShowUser','where','PauseUser','find','name','role','internal','interface','MemberReport','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','update','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','UserVoiceQueueRt','system','sms','openchannel','whatsapp','set','%s%s','Pause','LogoutUser','destroy','all','LoginUser','phone','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./user.socket','register','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser'];(function(_0x16f742,_0x354373){var _0x1ac60f=function(_0xc7ca07){while(--_0xc7ca07){_0x16f742['push'](_0x16f742['shift']());}};_0x1ac60f(++_0x354373);}(_0x5026,0x159));var _0x6502=function(_0x1e55ae,_0x3f76ca){_0x1e55ae=_0x1e55ae-0x0;var _0x5f3ac7=_0x5026[_0x1e55ae];return _0x5f3ac7;};'use strict';var _=require(_0x6502('0x0'));var util=require(_0x6502('0x1'));var moment=require(_0x6502('0x2'));var BPromise=require('bluebird');var rs=require(_0x6502('0x3'));var fs=require('fs');var Redis=require(_0x6502('0x4'));var db=require(_0x6502('0x5'))['db'];var utils=require(_0x6502('0x6'));var logger=require(_0x6502('0x7'))(_0x6502('0x8'));var config=require(_0x6502('0x9'));var jayson=require(_0x6502('0xa'));var client=jayson[_0x6502('0xb')][_0x6502('0xc')]({'port':0x232a});config[_0x6502('0xd')]=_[_0x6502('0xe')](config[_0x6502('0xd')],{'host':_0x6502('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6502('0xd')]));require(_0x6502('0x10'))[_0x6502('0x11')](socket);function respondWithRpcPromise(_0x1efcb7,_0x10e2f8,_0x2808e3){return new BPromise(function(_0x57f5de,_0x3ae3c6){return client[_0x6502('0x12')](_0x1efcb7,_0x2808e3)['then'](function(_0x596916){logger[_0x6502('0x13')](_0x6502('0x14'),_0x10e2f8,_0x6502('0x15'));logger[_0x6502('0x16')](_0x6502('0x17'),_0x10e2f8,_0x6502('0x15'),JSON[_0x6502('0x18')](_0x596916));if(_0x596916[_0x6502('0x19')]){if(_0x596916[_0x6502('0x19')][_0x6502('0x1a')]===0x1f4){logger['error'](_0x6502('0x14'),_0x10e2f8,_0x596916[_0x6502('0x19')]['message']);return _0x3ae3c6(_0x596916['error']['message']);}logger[_0x6502('0x19')](_0x6502('0x14'),_0x10e2f8,_0x596916[_0x6502('0x19')][_0x6502('0x1b')]);return _0x57f5de(_0x596916['error'][_0x6502('0x1b')]);}else{logger[_0x6502('0x13')](_0x6502('0x14'),_0x10e2f8,'request\x20sent');_0x57f5de(_0x596916[_0x6502('0x1c')]['message']);}})[_0x6502('0x1d')](function(_0x1fe501){logger[_0x6502('0x19')](_0x6502('0x14'),_0x10e2f8,_0x1fe501);_0x3ae3c6(_0x1fe501);});});}exports[_0x6502('0x1e')]=function(_0x53d4b2){var _0x2ba4d5=this;return new Promise(function(_0x29158b,_0x5e6d4a){return db[_0x6502('0x1f')][_0x6502('0x20')]({'raw':_0x53d4b2['options']?_0x53d4b2[_0x6502('0x21')][_0x6502('0x22')]===undefined?!![]:![]:!![],'where':_0x53d4b2[_0x6502('0x21')]?_0x53d4b2[_0x6502('0x21')]['where']||null:null,'attributes':_0x53d4b2[_0x6502('0x21')]?_0x53d4b2['options'][_0x6502('0x23')]||null:null,'limit':_0x53d4b2[_0x6502('0x21')]?_0x53d4b2['options']['limit']||null:null,'include':_0x53d4b2[_0x6502('0x21')]?_0x53d4b2[_0x6502('0x21')][_0x6502('0x24')]?_[_0x6502('0x25')](_0x53d4b2[_0x6502('0x21')][_0x6502('0x24')],function(_0x5d8783){return{'model':db[_0x5d8783[_0x6502('0x26')]],'as':_0x5d8783['as'],'attributes':_0x5d8783['attributes'],'include':_0x5d8783[_0x6502('0x24')]?_['map'](_0x5d8783[_0x6502('0x24')],function(_0x199eba){return{'model':db[_0x199eba[_0x6502('0x26')]],'as':_0x199eba['as'],'attributes':_0x199eba[_0x6502('0x23')],'include':_0x199eba[_0x6502('0x24')]?_[_0x6502('0x25')](_0x199eba['include'],function(_0x4c0a2a){return{'model':db[_0x4c0a2a[_0x6502('0x26')]],'as':_0x4c0a2a['as'],'attributes':_0x4c0a2a[_0x6502('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6502('0x27')](function(_0x234614){logger[_0x6502('0x13')](_0x6502('0x1e'),_0x53d4b2);logger[_0x6502('0x16')]('GetUser',_0x53d4b2,JSON[_0x6502('0x18')](_0x234614));_0x29158b(_0x234614);})[_0x6502('0x1d')](function(_0x23c8e3){logger[_0x6502('0x19')](_0x6502('0x1e'),_0x23c8e3[_0x6502('0x1b')],_0x53d4b2);_0x5e6d4a(_0x2ba4d5['error'](0x1f4,_0x23c8e3[_0x6502('0x1b')]));});});};exports[_0x6502('0x28')]=function(_0x14895a){var _0x299f0e=this;return new Promise(function(_0x53eac1,_0x3c38bc){return db[_0x6502('0x1f')]['find']({'raw':_0x14895a[_0x6502('0x21')]?_0x14895a[_0x6502('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x14895a['options']?_0x14895a[_0x6502('0x21')][_0x6502('0x29')]||null:null,'attributes':_0x14895a['options']?_0x14895a[_0x6502('0x21')]['attributes']||null:null,'include':_0x14895a[_0x6502('0x21')]?_0x14895a[_0x6502('0x21')][_0x6502('0x24')]?_['map'](_0x14895a[_0x6502('0x21')][_0x6502('0x24')],function(_0x771607){return{'model':db[_0x771607['model']],'as':_0x771607['as'],'attributes':_0x771607[_0x6502('0x23')],'include':_0x771607[_0x6502('0x24')]?_['map'](_0x771607[_0x6502('0x24')],function(_0x290bbb){return{'model':db[_0x290bbb['model']],'as':_0x290bbb['as'],'attributes':_0x290bbb['attributes'],'include':_0x290bbb[_0x6502('0x24')]?_[_0x6502('0x25')](_0x290bbb['include'],function(_0x189bdb){return{'model':db[_0x189bdb[_0x6502('0x26')]],'as':_0x189bdb['as'],'attributes':_0x189bdb[_0x6502('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6502('0x27')](function(_0x22eb61){logger[_0x6502('0x13')](_0x6502('0x28'),_0x14895a);logger['debug'](_0x6502('0x28'),_0x14895a,JSON['stringify'](_0x22eb61));_0x53eac1(_0x22eb61);})['catch'](function(_0x38b371){logger[_0x6502('0x19')]('ShowUser',_0x38b371[_0x6502('0x1b')],_0x14895a);_0x3c38bc(_0x299f0e['error'](0x1f4,_0x38b371[_0x6502('0x1b')]));});});};exports[_0x6502('0x2a')]=function(_0x4b46e4){var _0x2e70d5=this;return new Promise(function(_0x3ef46f,_0x2f64de){var _0x1dfcc4;return db[_0x6502('0x1f')][_0x6502('0x2b')]({'where':_0x4b46e4[_0x6502('0x21')]['where']||{},'attributes':['id',_0x6502('0x2c'),_0x6502('0x2d'),_0x6502('0x2e'),_0x6502('0x2f')]})[_0x6502('0x27')](function(_0x2c26b4){if(_0x2c26b4){_0x1dfcc4=_0x2c26b4;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x1dfcc4['id']},'individualHooks':!![]});}})[_0x6502('0x27')](function(){if(_0x1dfcc4){return db[_0x6502('0x30')]['findAll']({'where':{'membername':_0x1dfcc4[_0x6502('0x2c')],'type':_0x6502('0x31'),'exitAt':null}});}})[_0x6502('0x27')](function(_0x16dd96){if(_0x1dfcc4){if(_0x16dd96&&_0x16dd96[_0x6502('0x32')]){var _0xd74f8c=moment()[_0x6502('0x33')](_0x6502('0x34'));for(var _0x2d2767=0x0,_0x32f0e8=_0x16dd96[_0x6502('0x32')];_0x2d2767<_0x32f0e8;_0x2d2767++){_0x16dd96[_0x2d2767][_0x6502('0x35')]({'exitAt':_0xd74f8c});}}}})[_0x6502('0x27')](function(){if(_0x1dfcc4){var _0x1f1960=[];var _0x92d0bf=utils[_0x6502('0x36')]();_0x92d0bf[_0x6502('0x37')](function(_0x98e374){_0x1f1960[_0x6502('0x38')]({'channel':_0x98e374,'membername':_0x1dfcc4['name'],'interface':_['isNil'](_0x1dfcc4[_0x6502('0x2f')])?util[_0x6502('0x33')](_0x6502('0x39'),_0x1dfcc4[_0x6502('0x2c')]):_0x1dfcc4[_0x6502('0x2f')],'type':'PAUSE','enterAt':moment()[_0x6502('0x33')](_0x6502('0x34')),'data1':_0x4b46e4[_0x6502('0x3a')][_0x6502('0x3b')]||_0x6502('0x3c'),'role':_0x1dfcc4['role'],'internal':_0x1dfcc4['internal'],'uniqueid':_0x4b46e4[_0x6502('0x3a')]['uniqueid']||null});});return db[_0x6502('0x30')][_0x6502('0x3d')](_0x1f1960,{'individualHooks':!![]});}})[_0x6502('0x27')](function(){if(_0x1dfcc4){return _0x1dfcc4[_0x6502('0x3e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4b46e4[_0x6502('0x3a')][_0x6502('0x3b')]||_0x6502('0x3c'),'lastPauseAt':moment()[_0x6502('0x33')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x6502('0x27')](function(_0x4d20dd){_0x3ef46f(_0x4d20dd);})['catch'](function(_0x580770){_0x2f64de(_0x2e70d5['error'](0x1f4,_0x580770[_0x6502('0x1b')]));});});};exports[_0x6502('0x3f')]=function(_0x244dda){var _0x44eeb0=this;return new Promise(function(_0x1db33e,_0x5344e7){var _0x4b9042;return db[_0x6502('0x1f')][_0x6502('0x40')]({'where':_0x244dda[_0x6502('0x21')][_0x6502('0x29')]||{},'attributes':['id','name']})[_0x6502('0x27')](function(_0x2bb5a3){if(_0x2bb5a3){_0x4b9042=_0x2bb5a3;if(_0x244dda[_0x6502('0x3a')][_0x6502('0x41')]&&!utils[_0x6502('0x42')](_0x244dda['body'][_0x6502('0x41')])){throw new Error(_0x6502('0x43'));}switch(_0x244dda[_0x6502('0x3a')][_0x6502('0x41')]){case'voice':return db[_0x6502('0x44')]['update']({'paused':0x0},{'where':{'UserId':_0x4b9042['id']}})[_0x6502('0x27')](function(){return db[_0x6502('0x30')][_0x6502('0x2b')]({'where':{'channel':_0x244dda[_0x6502('0x3a')]['channel'],'membername':_0x4b9042['name'],'type':_0x6502('0x31'),'exitAt':null}});})[_0x6502('0x27')](function(_0x199f5b){if(_0x199f5b){return _0x199f5b[_0x6502('0x3e')]({'exitAt':moment()[_0x6502('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6502('0x45')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x4b9042[_0x6502('0x3e')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0x6502('0x46'):case _0x6502('0x47'):case _0x6502('0x48'):return db[_0x6502('0x30')]['find']({'where':{'channel':_0x244dda[_0x6502('0x3a')]['channel'],'membername':_0x4b9042[_0x6502('0x2c')],'type':_0x6502('0x31'),'exitAt':null}})[_0x6502('0x27')](function(_0xeb6a94){return _0xeb6a94[_0x6502('0x3e')]({'exitAt':moment()['format'](_0x6502('0x34')),'data2':_0x6502('0x45')},{'individualHooks':!![]});})[_0x6502('0x27')](function(){var _0x4923c1={};_[_0x6502('0x49')](_0x4923c1,util[_0x6502('0x33')](_0x6502('0x4a'),_0x244dda[_0x6502('0x3a')][_0x6502('0x41')],_0x6502('0x4b')),![]);return _0x4b9042['update'](_0x4923c1);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x4b9042['id']}})['then'](function(){return db[_0x6502('0x30')][_0x6502('0x20')]({'where':{'membername':_0x4b9042[_0x6502('0x2c')],'type':_0x6502('0x31'),'exitAt':null}});})['then'](function(_0x5058e8){var _0x288c41=[];_0x5058e8[_0x6502('0x37')](function(_0x11ec0e){_0x288c41[_0x6502('0x38')](_0x11ec0e[_0x6502('0x3e')]({'exitAt':moment()[_0x6502('0x33')](_0x6502('0x34')),'data2':_0x6502('0x45')}));});return BPromise['all'](_0x288c41);})['then'](function(){return _0x4b9042[_0x6502('0x3e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x6502('0x27')](function(_0x4c8b3b){_0x1db33e(_0x4c8b3b);})['catch'](function(_0x337085){_0x5344e7(_0x44eeb0[_0x6502('0x19')](0x1f4,_0x337085[_0x6502('0x1b')]));});});};exports[_0x6502('0x4c')]=function(_0xfdf844){var _0x5a59fc=this;return new Promise(function(_0x5852c7,_0x91628c){var _0x66af82;return db['User']['findOne']({'where':_0xfdf844['options'][_0x6502('0x29')]||{},'attributes':['id','name']})[_0x6502('0x27')](function(_0x578b70){if(_0x578b70){_0x66af82=_0x578b70;return db['UserVoiceQueueRt'][_0x6502('0x4d')]({'where':{'membername':_0x66af82['name']},'individualHooks':!![]});}})['then'](function(){if(_0x66af82){return db['MemberReport'][_0x6502('0x20')]({'where':{'membername':_0x66af82[_0x6502('0x2c')],'exitAt':null}});}})['then'](function(_0x553d35){if(_0x66af82){if(_0x553d35&&_0x553d35[_0x6502('0x32')]){var _0x570aa1=[];_0x553d35[_0x6502('0x37')](function(_0x553429){_0x570aa1[_0x6502('0x38')](_0x553429[_0x6502('0x3e')]({'exitAt':moment()[_0x6502('0x33')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6502('0x4e')](_0x570aa1);}}})[_0x6502('0x27')](function(){if(_0x66af82){return _0x66af82[_0x6502('0x3e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6502('0x27')](function(_0x5d2d10){_0x5852c7(_0x5d2d10);})[_0x6502('0x1d')](function(_0x36bd74){_0x91628c(_0x5a59fc[_0x6502('0x19')](0x1f4,_0x36bd74[_0x6502('0x1b')]));});});};exports[_0x6502('0x4f')]=function(_0x30baa7){var _0x462aa9=this;return new Promise(function(_0x5a858e,_0x370578){var _0x28f075;var _0x2cc09d;var _0x3a3112;var _0xe905ac;return db[_0x6502('0x1f')][_0x6502('0x40')]({'where':_0x30baa7['options'][_0x6502('0x29')]||{},'attributes':['id',_0x6502('0x2c'),_0x6502('0x2d'),'mobile',_0x6502('0x50'),_0x6502('0x2e'),'loginInPause',_0x6502('0x2f')]})[_0x6502('0x27')](function(_0x5cbf4c){if(_0x5cbf4c){_0x28f075=_0x5cbf4c;_0xe905ac=_0x30baa7[_0x6502('0x3a')][_0x6502('0x2f')]?_0x30baa7[_0x6502('0x3a')][_0x6502('0x2f')]:util[_0x6502('0x33')](_0x6502('0x39'),_0x28f075['name']);return db[_0x6502('0x1f')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x28f075['id']}}});}})['then'](function(_0x126421){if(_0x126421){_0x3a3112=_0x126421;return require(_0x6502('0x51'))[_0x6502('0x52')]();}})[_0x6502('0x27')](function(_0xda604b){if(_0xda604b&&_0xda604b['agents']&&_0x3a3112>=_0xda604b[_0x6502('0x53')]){throw new Error(_0x6502('0x54'));}})['then'](function(){if(_0x28f075){return db['UserVoiceQueueRt'][_0x6502('0x4d')]({'where':{'membername':_0x28f075['name']},'individualHooks':!![]});}})['then'](function(){if(_0x28f075){return _0x28f075[_0x6502('0x55')]({'raw':!![]});}})[_0x6502('0x27')](function(_0x18ea62){if(_0x28f075){if(_0x18ea62){var _0x55988d=[];_0x2cc09d=_0x18ea62;if(_0x2cc09d[_0x6502('0x32')]){for(var _0x247026=0x0;_0x247026<_0x2cc09d[_0x6502('0x32')];_0x247026++){_0x55988d[_0x6502('0x38')](db[_0x6502('0x44')][_0x6502('0x56')]({'membername':_0x28f075[_0x6502('0x2c')],'UserId':_0x28f075['id'],'queue_name':_0x2cc09d[_0x247026][_0x6502('0x2c')],'VoiceQueueId':_0x2cc09d[_0x247026]['id'],'interface':_0xe905ac,'paused':_0x28f075[_0x6502('0x57')]||![],'penalty':_0x2cc09d[_0x247026][_0x6502('0x58')]||0x0}));}return BPromise[_0x6502('0x4e')](_0x55988d);}}}})[_0x6502('0x27')](function(){if(_0x28f075){return db[_0x6502('0x30')][_0x6502('0x20')]({'where':{'membername':_0x28f075[_0x6502('0x2c')],'exitAt':null}});}})['then'](function(_0x480825){if(_0x28f075){if(_0x480825&&_0x480825[_0x6502('0x32')]){var _0x255ff5=[];_0x480825['forEach'](function(_0x483458){_0x255ff5[_0x6502('0x38')](_0x483458[_0x6502('0x3e')]({'exitAt':moment()['format'](_0x6502('0x34'))}));});return BPromise[_0x6502('0x4e')](_0x255ff5);}}})[_0x6502('0x27')](function(_0x17776c){if(_0x28f075){var _0x5a3835=[];var _0x5e3bfc=[];var _0x5b8852=utils['getChannels']();var _0x5a7eb9={'membername':_0x28f075[_0x6502('0x2c')],'interface':_0xe905ac,'enterAt':moment()[_0x6502('0x33')](_0x6502('0x34')),'role':_0x28f075[_0x6502('0x2d')],'internal':_0x28f075[_0x6502('0x2e')]};_0x5b8852[_0x6502('0x37')](function(_0x1e02f3){_0x5a3835[_0x6502('0x38')](_[_0x6502('0x59')]({'channel':_0x1e02f3,'type':_0x6502('0x5a'),'data1':_0x6502('0x5b'),'data2':_0xe905ac},_0x5a7eb9));if(_0x28f075[_0x6502('0x57')]){_0x5e3bfc[_0x6502('0x38')](_[_0x6502('0x59')]({'channel':_0x1e02f3,'type':_0x6502('0x31'),'data1':_0x6502('0x5c')},_0x5a7eb9));}});return db[_0x6502('0x30')][_0x6502('0x3d')](_0x5a3835[_0x6502('0x5d')](_0x5e3bfc),{'individualHooks':!![]});}})['then'](function(){if(_0x28f075){return _0x28f075[_0x6502('0x3e')]({'online':!![],'lastLoginAt':moment()[_0x6502('0x33')](_0x6502('0x34')),'voicePause':_0x28f075['loginInPause']||![],'mailPause':_0x28f075['loginInPause']||![],'chatPause':_0x28f075[_0x6502('0x57')]||![],'faxPause':_0x28f075[_0x6502('0x57')]||![],'smsPause':_0x28f075['loginInPause']||![],'openchannelPause':_0x28f075['loginInPause']||![],'pauseType':_0x28f075[_0x6502('0x57')]?_0x6502('0x5c'):null,'lastPauseAt':moment()[_0x6502('0x33')](_0x6502('0x34')),'interface':_0xe905ac});}})[_0x6502('0x27')](function(_0x3485aa){_0x5a858e(_0x3485aa);})['catch'](function(_0x481574){_0x370578(_0x462aa9[_0x6502('0x19')](0x1f4,_0x481574['message']));});});};
\ No newline at end of file
+var _0x49a7=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','ShowUser','name','role','internal','UserVoiceQueueRt','update','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','interface','type','DEFAULT\x20PAUSE','body','uniqueid','MemberReport','bulkCreate','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','findOne','isValidChannel','Unknown\x20channel','channel','voice','chat','fax','sms','whatsapp','system','set','%s%s','Pause','all','LogoutUser','destroy','LoginUser','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x413941,_0x32c0e4){var _0x4e4927=function(_0xa297e4){while(--_0xa297e4){_0x413941['push'](_0x413941['shift']());}};_0x4e4927(++_0x32c0e4);}(_0x49a7,0xb2));var _0x749a=function(_0x1863a5,_0x19a8c6){_0x1863a5=_0x1863a5-0x0;var _0x591172=_0x49a7[_0x1863a5];return _0x591172;};'use strict';var _=require(_0x749a('0x0'));var util=require(_0x749a('0x1'));var moment=require(_0x749a('0x2'));var BPromise=require(_0x749a('0x3'));var rs=require(_0x749a('0x4'));var fs=require('fs');var Redis=require(_0x749a('0x5'));var db=require(_0x749a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x749a('0x7'))(_0x749a('0x8'));var config=require('../../config/environment');var jayson=require(_0x749a('0x9'));var client=jayson[_0x749a('0xa')][_0x749a('0xb')]({'port':0x232a});config[_0x749a('0xc')]=_[_0x749a('0xd')](config[_0x749a('0xc')],{'host':_0x749a('0xe'),'port':0x18eb});var socket=require(_0x749a('0xf'))(new Redis(config[_0x749a('0xc')]));require('./user.socket')['register'](socket);function respondWithRpcPromise(_0x4e613a,_0x6f177e,_0x2c1c11){return new BPromise(function(_0x323320,_0x5dda6f){return client[_0x749a('0x10')](_0x4e613a,_0x2c1c11)[_0x749a('0x11')](function(_0x50d6f3){logger['info'](_0x749a('0x12'),_0x6f177e,_0x749a('0x13'));logger[_0x749a('0x14')]('User,\x20%s,\x20%s,\x20%s',_0x6f177e,_0x749a('0x13'),JSON[_0x749a('0x15')](_0x50d6f3));if(_0x50d6f3['error']){if(_0x50d6f3[_0x749a('0x16')]['code']===0x1f4){logger[_0x749a('0x16')](_0x749a('0x12'),_0x6f177e,_0x50d6f3[_0x749a('0x16')][_0x749a('0x17')]);return _0x5dda6f(_0x50d6f3[_0x749a('0x16')]['message']);}logger[_0x749a('0x16')](_0x749a('0x12'),_0x6f177e,_0x50d6f3['error'][_0x749a('0x17')]);return _0x323320(_0x50d6f3[_0x749a('0x16')][_0x749a('0x17')]);}else{logger[_0x749a('0x18')](_0x749a('0x12'),_0x6f177e,_0x749a('0x13'));_0x323320(_0x50d6f3[_0x749a('0x19')][_0x749a('0x17')]);}})['catch'](function(_0x1b4d35){logger[_0x749a('0x16')](_0x749a('0x12'),_0x6f177e,_0x1b4d35);_0x5dda6f(_0x1b4d35);});});}exports[_0x749a('0x1a')]=function(_0x1f11da){var _0x528212=this;return new Promise(function(_0x4bd8bf,_0x5ee5c3){return db[_0x749a('0x1b')][_0x749a('0x1c')]({'raw':_0x1f11da['options']?_0x1f11da[_0x749a('0x1d')][_0x749a('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f11da[_0x749a('0x1d')]?_0x1f11da[_0x749a('0x1d')][_0x749a('0x1f')]||null:null,'attributes':_0x1f11da[_0x749a('0x1d')]?_0x1f11da[_0x749a('0x1d')][_0x749a('0x20')]||null:null,'limit':_0x1f11da[_0x749a('0x1d')]?_0x1f11da['options'][_0x749a('0x21')]||null:null,'include':_0x1f11da[_0x749a('0x1d')]?_0x1f11da[_0x749a('0x1d')][_0x749a('0x22')]?_[_0x749a('0x23')](_0x1f11da['options'][_0x749a('0x22')],function(_0x4894af){return{'model':db[_0x4894af['model']],'as':_0x4894af['as'],'attributes':_0x4894af[_0x749a('0x20')],'include':_0x4894af[_0x749a('0x22')]?_[_0x749a('0x23')](_0x4894af[_0x749a('0x22')],function(_0x44f59e){return{'model':db[_0x44f59e[_0x749a('0x24')]],'as':_0x44f59e['as'],'attributes':_0x44f59e[_0x749a('0x20')],'include':_0x44f59e[_0x749a('0x22')]?_['map'](_0x44f59e[_0x749a('0x22')],function(_0x56403d){return{'model':db[_0x56403d['model']],'as':_0x56403d['as'],'attributes':_0x56403d[_0x749a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x749a('0x11')](function(_0x24836){logger['info']('GetUser',_0x1f11da);logger[_0x749a('0x14')](_0x749a('0x1a'),_0x1f11da,JSON[_0x749a('0x15')](_0x24836));_0x4bd8bf(_0x24836);})[_0x749a('0x25')](function(_0x3b6bdd){logger[_0x749a('0x16')](_0x749a('0x1a'),_0x3b6bdd[_0x749a('0x17')],_0x1f11da);_0x5ee5c3(_0x528212[_0x749a('0x16')](0x1f4,_0x3b6bdd[_0x749a('0x17')]));});});};exports['ShowUser']=function(_0xf231cb){var _0xf649c6=this;return new Promise(function(_0x274aa3,_0x552594){return db[_0x749a('0x1b')][_0x749a('0x26')]({'raw':_0xf231cb[_0x749a('0x1d')]?_0xf231cb[_0x749a('0x1d')][_0x749a('0x1e')]===undefined?!![]:![]:!![],'where':_0xf231cb[_0x749a('0x1d')]?_0xf231cb['options'][_0x749a('0x1f')]||null:null,'attributes':_0xf231cb['options']?_0xf231cb['options']['attributes']||null:null,'include':_0xf231cb[_0x749a('0x1d')]?_0xf231cb[_0x749a('0x1d')][_0x749a('0x22')]?_[_0x749a('0x23')](_0xf231cb['options'][_0x749a('0x22')],function(_0x53d33e){return{'model':db[_0x53d33e[_0x749a('0x24')]],'as':_0x53d33e['as'],'attributes':_0x53d33e[_0x749a('0x20')],'include':_0x53d33e[_0x749a('0x22')]?_['map'](_0x53d33e['include'],function(_0x5082a1){return{'model':db[_0x5082a1['model']],'as':_0x5082a1['as'],'attributes':_0x5082a1[_0x749a('0x20')],'include':_0x5082a1[_0x749a('0x22')]?_[_0x749a('0x23')](_0x5082a1[_0x749a('0x22')],function(_0x555664){return{'model':db[_0x555664[_0x749a('0x24')]],'as':_0x555664['as'],'attributes':_0x555664[_0x749a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15d2ab){logger['info'](_0x749a('0x27'),_0xf231cb);logger['debug'](_0x749a('0x27'),_0xf231cb,JSON['stringify'](_0x15d2ab));_0x274aa3(_0x15d2ab);})[_0x749a('0x25')](function(_0x4d38eb){logger[_0x749a('0x16')](_0x749a('0x27'),_0x4d38eb[_0x749a('0x17')],_0xf231cb);_0x552594(_0xf649c6['error'](0x1f4,_0x4d38eb[_0x749a('0x17')]));});});};exports['PauseUser']=function(_0x3e5989){var _0x5ed705=this;return new Promise(function(_0x23d482,_0x25c946){var _0x4dc421;return db['User']['find']({'where':_0x3e5989[_0x749a('0x1d')]['where']||{},'attributes':['id',_0x749a('0x28'),_0x749a('0x29'),_0x749a('0x2a'),'interface']})['then'](function(_0x5b6b75){if(_0x5b6b75){_0x4dc421=_0x5b6b75;return db[_0x749a('0x2b')][_0x749a('0x2c')]({'paused':0x1},{'where':{'UserId':_0x4dc421['id']},'individualHooks':!![]});}})[_0x749a('0x11')](function(){if(_0x4dc421){return db['MemberReport']['findAll']({'where':{'membername':_0x4dc421[_0x749a('0x28')],'type':_0x749a('0x2d'),'exitAt':null}});}})[_0x749a('0x11')](function(_0xadbe84){if(_0x4dc421){if(_0xadbe84&&_0xadbe84[_0x749a('0x2e')]){var _0x1f13ac=moment()[_0x749a('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xab9afa=0x0,_0x39683b=_0xadbe84['length'];_0xab9afa<_0x39683b;_0xab9afa++){_0xadbe84[_0xab9afa][_0x749a('0x30')]({'exitAt':_0x1f13ac});}}}})[_0x749a('0x11')](function(){if(_0x4dc421){var _0xfaf0a8=[];var _0x11489e=utils[_0x749a('0x31')]();_0x11489e[_0x749a('0x32')](function(_0x427282){_0xfaf0a8[_0x749a('0x33')]({'channel':_0x427282,'membername':_0x4dc421[_0x749a('0x28')],'interface':_[_0x749a('0x34')](_0x4dc421['interface'])?util[_0x749a('0x2f')](_0x749a('0x35'),_0x4dc421['name']):_0x4dc421[_0x749a('0x36')],'type':_0x749a('0x2d'),'enterAt':moment()[_0x749a('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3e5989['body'][_0x749a('0x37')]||_0x749a('0x38'),'role':_0x4dc421[_0x749a('0x29')],'internal':_0x4dc421[_0x749a('0x2a')],'uniqueid':_0x3e5989[_0x749a('0x39')][_0x749a('0x3a')]||null});});return db[_0x749a('0x3b')][_0x749a('0x3c')](_0xfaf0a8,{'individualHooks':!![]});}})[_0x749a('0x11')](function(){if(_0x4dc421){return _0x4dc421[_0x749a('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3e5989['body']['type']||_0x749a('0x38'),'lastPauseAt':moment()['format'](_0x749a('0x3d'))});}})[_0x749a('0x11')](function(_0x4f06af){_0x23d482(_0x4f06af);})[_0x749a('0x25')](function(_0x33f09d){_0x25c946(_0x5ed705[_0x749a('0x16')](0x1f4,_0x33f09d[_0x749a('0x17')]));});});};exports[_0x749a('0x3e')]=function(_0x3321f8){var _0x1dadd6=this;return new Promise(function(_0x4531a0,_0x3b3498){var _0x51a222;return db[_0x749a('0x1b')][_0x749a('0x3f')]({'where':_0x3321f8[_0x749a('0x1d')][_0x749a('0x1f')]||{},'attributes':['id',_0x749a('0x28')]})[_0x749a('0x11')](function(_0x595f4c){if(_0x595f4c){_0x51a222=_0x595f4c;if(_0x3321f8[_0x749a('0x39')]['channel']&&!utils[_0x749a('0x40')](_0x3321f8['body']['channel'])){throw new Error(_0x749a('0x41'));}switch(_0x3321f8[_0x749a('0x39')][_0x749a('0x42')]){case _0x749a('0x43'):return db['UserVoiceQueueRt'][_0x749a('0x2c')]({'paused':0x0},{'where':{'UserId':_0x51a222['id']}})[_0x749a('0x11')](function(){return db[_0x749a('0x3b')][_0x749a('0x26')]({'where':{'channel':_0x3321f8[_0x749a('0x39')][_0x749a('0x42')],'membername':_0x51a222[_0x749a('0x28')],'type':_0x749a('0x2d'),'exitAt':null}});})[_0x749a('0x11')](function(_0x5782be){if(_0x5782be){return _0x5782be[_0x749a('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x749a('0x11')](function(){return _0x51a222['update']({'voicePause':![]});});case'mail':case _0x749a('0x44'):case _0x749a('0x45'):case _0x749a('0x46'):case'openchannel':case _0x749a('0x47'):return db[_0x749a('0x3b')][_0x749a('0x26')]({'where':{'channel':_0x3321f8['body'][_0x749a('0x42')],'membername':_0x51a222[_0x749a('0x28')],'type':_0x749a('0x2d'),'exitAt':null}})[_0x749a('0x11')](function(_0x3bb3ed){return _0x3bb3ed[_0x749a('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x749a('0x48')},{'individualHooks':!![]});})[_0x749a('0x11')](function(){var _0x3eaf6a={};_[_0x749a('0x49')](_0x3eaf6a,util['format'](_0x749a('0x4a'),_0x3321f8[_0x749a('0x39')][_0x749a('0x42')],_0x749a('0x4b')),![]);return _0x51a222['update'](_0x3eaf6a);});default:return db[_0x749a('0x2b')][_0x749a('0x2c')]({'paused':0x0},{'where':{'UserId':_0x51a222['id']}})[_0x749a('0x11')](function(){return db[_0x749a('0x3b')][_0x749a('0x1c')]({'where':{'membername':_0x51a222[_0x749a('0x28')],'type':_0x749a('0x2d'),'exitAt':null}});})['then'](function(_0x1e8649){var _0x59581d=[];_0x1e8649[_0x749a('0x32')](function(_0x2b50bb){_0x59581d[_0x749a('0x33')](_0x2b50bb['update']({'exitAt':moment()[_0x749a('0x2f')](_0x749a('0x3d')),'data2':_0x749a('0x48')}));});return BPromise[_0x749a('0x4c')](_0x59581d);})[_0x749a('0x11')](function(){return _0x51a222[_0x749a('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x749a('0x11')](function(_0x29e7ce){_0x4531a0(_0x29e7ce);})['catch'](function(_0x44c89e){_0x3b3498(_0x1dadd6[_0x749a('0x16')](0x1f4,_0x44c89e[_0x749a('0x17')]));});});};exports[_0x749a('0x4d')]=function(_0x540b74){var _0x233be6=this;return new Promise(function(_0x212a28,_0x2a2ffb){var _0x14292b;return db['User']['findOne']({'where':_0x540b74[_0x749a('0x1d')][_0x749a('0x1f')]||{},'attributes':['id',_0x749a('0x28')]})[_0x749a('0x11')](function(_0x2b77cd){if(_0x2b77cd){_0x14292b=_0x2b77cd;return db[_0x749a('0x2b')][_0x749a('0x4e')]({'where':{'membername':_0x14292b[_0x749a('0x28')]},'individualHooks':!![]});}})[_0x749a('0x11')](function(){if(_0x14292b){return db[_0x749a('0x3b')]['findAll']({'where':{'membername':_0x14292b['name'],'exitAt':null}});}})[_0x749a('0x11')](function(_0x31980d){if(_0x14292b){if(_0x31980d&&_0x31980d[_0x749a('0x2e')]){var _0x22334e=[];_0x31980d[_0x749a('0x32')](function(_0x2977d0){_0x22334e[_0x749a('0x33')](_0x2977d0[_0x749a('0x2c')]({'exitAt':moment()[_0x749a('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x749a('0x4c')](_0x22334e);}}})[_0x749a('0x11')](function(){if(_0x14292b){return _0x14292b['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x154294){_0x212a28(_0x154294);})[_0x749a('0x25')](function(_0x5d37b6){_0x2a2ffb(_0x233be6[_0x749a('0x16')](0x1f4,_0x5d37b6[_0x749a('0x17')]));});});};exports[_0x749a('0x4f')]=function(_0x3ac103){var _0x32f4d9=this;return new Promise(function(_0x40414c,_0x51bd60){var _0x19c406;var _0x2290ca;var _0x176479;var _0x2c1675;return db['User'][_0x749a('0x3f')]({'where':_0x3ac103[_0x749a('0x1d')][_0x749a('0x1f')]||{},'attributes':['id',_0x749a('0x28'),'role','mobile',_0x749a('0x50'),'internal',_0x749a('0x51'),_0x749a('0x36')]})[_0x749a('0x11')](function(_0x2a2393){if(_0x2a2393){_0x19c406=_0x2a2393;_0x2c1675=_0x3ac103[_0x749a('0x39')][_0x749a('0x36')]?_0x3ac103[_0x749a('0x39')][_0x749a('0x36')]:util[_0x749a('0x2f')](_0x749a('0x35'),_0x19c406['name']);return db[_0x749a('0x1b')][_0x749a('0x52')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x19c406['id']}}});}})[_0x749a('0x11')](function(_0x5c650c){if(_0x5c650c){_0x176479=_0x5c650c;return require(_0x749a('0x53'))[_0x749a('0x54')]();}})[_0x749a('0x11')](function(_0x79fbe){if(_0x79fbe&&_0x79fbe['agents']&&_0x176479>=_0x79fbe[_0x749a('0x55')]){throw new Error(_0x749a('0x56'));}})[_0x749a('0x11')](function(){if(_0x19c406){return db[_0x749a('0x2b')][_0x749a('0x4e')]({'where':{'membername':_0x19c406[_0x749a('0x28')]},'individualHooks':!![]});}})[_0x749a('0x11')](function(){if(_0x19c406){return _0x19c406[_0x749a('0x57')]({'raw':!![]});}})[_0x749a('0x11')](function(_0xcde61e){if(_0x19c406){if(_0xcde61e){var _0x1716aa=[];_0x2290ca=_0xcde61e;if(_0x2290ca[_0x749a('0x2e')]){for(var _0x27b4bc=0x0;_0x27b4bc<_0x2290ca[_0x749a('0x2e')];_0x27b4bc++){_0x1716aa['push'](db[_0x749a('0x2b')][_0x749a('0x58')]({'membername':_0x19c406[_0x749a('0x28')],'UserId':_0x19c406['id'],'queue_name':_0x2290ca[_0x27b4bc][_0x749a('0x28')],'VoiceQueueId':_0x2290ca[_0x27b4bc]['id'],'interface':_0x2c1675,'paused':_0x19c406[_0x749a('0x51')]||![],'penalty':_0x2290ca[_0x27b4bc]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x749a('0x4c')](_0x1716aa);}}}})[_0x749a('0x11')](function(){if(_0x19c406){return db[_0x749a('0x3b')]['findAll']({'where':{'membername':_0x19c406[_0x749a('0x28')],'exitAt':null}});}})['then'](function(_0x436176){if(_0x19c406){if(_0x436176&&_0x436176[_0x749a('0x2e')]){var _0x5a4752=[];_0x436176[_0x749a('0x32')](function(_0x2efe41){_0x5a4752[_0x749a('0x33')](_0x2efe41[_0x749a('0x2c')]({'exitAt':moment()[_0x749a('0x2f')](_0x749a('0x3d'))}));});return BPromise[_0x749a('0x4c')](_0x5a4752);}}})[_0x749a('0x11')](function(_0x3234c3){if(_0x19c406){var _0x4a91f4=[];var _0x277601=[];var _0x434402=utils[_0x749a('0x31')]();var _0x16a7ae={'membername':_0x19c406[_0x749a('0x28')],'interface':_0x2c1675,'enterAt':moment()[_0x749a('0x2f')](_0x749a('0x3d')),'role':_0x19c406['role'],'internal':_0x19c406[_0x749a('0x2a')]};_0x434402[_0x749a('0x32')](function(_0x17b565){_0x4a91f4['push'](_[_0x749a('0x59')]({'channel':_0x17b565,'type':'LOGIN','data1':_0x749a('0x5a'),'data2':_0x2c1675},_0x16a7ae));if(_0x19c406[_0x749a('0x51')]){_0x277601['push'](_[_0x749a('0x59')]({'channel':_0x17b565,'type':_0x749a('0x2d'),'data1':_0x749a('0x5b')},_0x16a7ae));}});return db[_0x749a('0x3b')][_0x749a('0x3c')](_0x4a91f4[_0x749a('0x5c')](_0x277601),{'individualHooks':!![]});}})[_0x749a('0x11')](function(){if(_0x19c406){return _0x19c406[_0x749a('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x749a('0x2f')](_0x749a('0x3d')),'voicePause':_0x19c406['loginInPause']||![],'mailPause':_0x19c406['loginInPause']||![],'chatPause':_0x19c406[_0x749a('0x51')]||![],'faxPause':_0x19c406['loginInPause']||![],'smsPause':_0x19c406[_0x749a('0x51')]||![],'openchannelPause':_0x19c406[_0x749a('0x51')]||![],'pauseType':_0x19c406[_0x749a('0x51')]?_0x749a('0x5b'):null,'lastPauseAt':moment()['format'](_0x749a('0x3d')),'interface':_0x2c1675});}})[_0x749a('0x11')](function(_0x3a388f){_0x40414c(_0x3a388f);})[_0x749a('0x25')](function(_0x2d21ea){_0x51bd60(_0x32f4d9[_0x749a('0x16')](0x1f4,_0x2d21ea[_0x749a('0x17')]));});});};
\ No newline at end of file
index 7619c88..b8c3358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x558f=['save','update','emit','removeListener','register','user:','./user.events'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0x558f,0xed));var _0xf558=function(_0x1bace4,_0x47f3d7){_0x1bace4=_0x1bace4-0x0;var _0x47ec01=_0x558f[_0x1bace4];return _0x47ec01;};'use strict';var UserEvents=require(_0xf558('0x0'));var events=[_0xf558('0x1'),'remove',_0xf558('0x2')];function createListener(_0x153f10,_0x5ebc4a){return function(_0x1ffa26){_0x5ebc4a[_0xf558('0x3')](_0x153f10,_0x1ffa26);};}function removeListener(_0x389714,_0x3a5782){return function(){UserEvents[_0xf558('0x4')](_0x389714,_0x3a5782);};}exports[_0xf558('0x5')]=function(_0xa730eb){for(var _0x314ff6=0x0,_0x5c9163=events['length'];_0x314ff6<_0x5c9163;_0x314ff6++){var _0x185cb3=events[_0x314ff6];var _0x30ee92=createListener(_0xf558('0x6')+_0x185cb3,_0xa730eb);UserEvents['on'](_0x185cb3,_0x30ee92);}};
\ No newline at end of file
+var _0xed85=['remove','emit','register','length','./user.events'];(function(_0x1f0084,_0x169444){var _0x5e80ac=function(_0x15cd3d){while(--_0x15cd3d){_0x1f0084['push'](_0x1f0084['shift']());}};_0x5e80ac(++_0x169444);}(_0xed85,0x7c));var _0x5ed8=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xed85[_0x2e76a7];return _0x454cde;};'use strict';var UserEvents=require(_0x5ed8('0x0'));var events=['save',_0x5ed8('0x1'),'update'];function createListener(_0x2ab311,_0x3138d2){return function(_0x2142a0){_0x3138d2[_0x5ed8('0x2')](_0x2ab311,_0x2142a0);};}function removeListener(_0xc1f4a3,_0x3f7ae2){return function(){UserEvents['removeListener'](_0xc1f4a3,_0x3f7ae2);};}exports[_0x5ed8('0x3')]=function(_0x2160a2){for(var _0xce4274=0x0,_0x53b47d=events[_0x5ed8('0x4')];_0xce4274<_0x53b47d;_0xce4274++){var _0x37d377=events[_0xce4274];var _0x5bf7d5=createListener('user:'+_0x37d377,_0x2160a2);UserEvents['on'](_0x37d377,_0x5bf7d5);}};
\ No newline at end of file
index c5b6199..307d72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1ae139,_0x529c60){var _0x5e0de7=function(_0x2b8273){while(--_0x2b8273){_0x1ae139['push'](_0x1ae139['shift']());}};_0x5e0de7(++_0x529c60);}(_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 92bb546..c2c5e62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdebb=['INTEGER','exports'];(function(_0x57c8de,_0x4e354c){var _0x1c9326=function(_0x4e272d){while(--_0x4e272d){_0x57c8de['push'](_0x57c8de['shift']());}};_0x1c9326(++_0x4e354c);}(_0xdebb,0x13f));var _0xbdeb=function(_0x4b7a7c,_0x4e13ad){_0x4b7a7c=_0x4b7a7c-0x0;var _0x54ebf0=_0xdebb[_0x4b7a7c];return _0x54ebf0;};'use strict';var Sequelize=require('sequelize');module[_0xbdeb('0x0')]={'penalty':{'type':Sequelize[_0xbdeb('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5058=['sequelize','exports','INTEGER'];(function(_0x3f6eb8,_0x3bba68){var _0x58bef9=function(_0x110a15){while(--_0x110a15){_0x3f6eb8['push'](_0x3f6eb8['shift']());}};_0x58bef9(++_0x3bba68);}(_0x5058,0xde));var _0x8505=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x5058[_0x5dfc2a];return _0x3f1a71;};'use strict';var Sequelize=require(_0x8505('0x0'));module[_0x8505('0x1')]={'penalty':{'type':Sequelize[_0x8505('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index b0ced8d..822dff1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb886=['user_has_chat_queues','lodash','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','define'];(function(_0x403ec8,_0x579d9c){var _0x21515e=function(_0x3a12b0){while(--_0x3a12b0){_0x403ec8['push'](_0x403ec8['shift']());}};_0x21515e(++_0x579d9c);}(_0xb886,0xc1));var _0x6b88=function(_0x3f304c,_0x3f53cd){_0x3f304c=_0x3f304c-0x0;var _0x103feb=_0xb886[_0x3f304c];return _0x103feb;};'use strict';var _=require(_0x6b88('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6b88('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b88('0x2'));var rimraf=require(_0x6b88('0x3'));var config=require(_0x6b88('0x4'));var attributes=require(_0x6b88('0x5'));module['exports']=function(_0x452d5c,_0x4e7b21){return _0x452d5c[_0x6b88('0x6')]('UserChatQueue',attributes,{'tableName':_0x6b88('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84df=['exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','bluebird','request-promise','rimraf','./userChatQueue.attributes'];(function(_0x6efde0,_0x2fca93){var _0x5c1cde=function(_0x5a1e55){while(--_0x5a1e55){_0x6efde0['push'](_0x6efde0['shift']());}};_0x5c1cde(++_0x2fca93);}(_0x84df,0x143));var _0xf84d=function(_0x13fd59,_0x2e05b1){_0x13fd59=_0x13fd59-0x0;var _0x2e6ce7=_0x84df[_0x13fd59];return _0x2e6ce7;};'use strict';var _=require(_0xf84d('0x0'));var util=require('util');var logger=require(_0xf84d('0x1'))(_0xf84d('0x2'));var moment=require('moment');var BPromise=require(_0xf84d('0x3'));var rp=require(_0xf84d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf84d('0x5'));var config=require('../../config/environment');var attributes=require(_0xf84d('0x6'));module[_0xf84d('0x7')]=function(_0x1032e3,_0x24bade){return _0x1032e3[_0xf84d('0x8')](_0xf84d('0x9'),attributes,{'tableName':_0xf84d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbfdff8..be3e7ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb4d=['jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0xdb4d,0x72));var _0xddb4=function(_0x581f6d,_0x600d39){_0x581f6d=_0x581f6d-0x0;var _0x11f192=_0xdb4d[_0x581f6d];return _0x11f192;};'use strict';var _=require(_0xddb4('0x0'));var util=require(_0xddb4('0x1'));var moment=require(_0xddb4('0x2'));var BPromise=require(_0xddb4('0x3'));var rs=require(_0xddb4('0x4'));var fs=require('fs');var Redis=require(_0xddb4('0x5'));var db=require(_0xddb4('0x6'))['db'];var utils=require(_0xddb4('0x7'));var logger=require(_0xddb4('0x8'))(_0xddb4('0x9'));var config=require(_0xddb4('0xa'));var jayson=require(_0xddb4('0xb'));var client=jayson[_0xddb4('0xc')][_0xddb4('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c5e01,_0x28d02b,_0x3cb87f){return new BPromise(function(_0x53a8c2,_0x5984e1){return client[_0xddb4('0xe')](_0x3c5e01,_0x3cb87f)[_0xddb4('0xf')](function(_0x21b80f){logger[_0xddb4('0x10')](_0xddb4('0x11'),_0x28d02b,'request\x20sent');logger[_0xddb4('0x12')](_0xddb4('0x13'),_0x28d02b,'request\x20sent',JSON['stringify'](_0x21b80f));if(_0x21b80f['error']){if(_0x21b80f[_0xddb4('0x14')][_0xddb4('0x15')]===0x1f4){logger[_0xddb4('0x14')](_0xddb4('0x11'),_0x28d02b,_0x21b80f['error'][_0xddb4('0x16')]);return _0x5984e1(_0x21b80f['error'][_0xddb4('0x16')]);}logger[_0xddb4('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x28d02b,_0x21b80f[_0xddb4('0x14')][_0xddb4('0x16')]);return _0x53a8c2(_0x21b80f[_0xddb4('0x14')]['message']);}else{logger[_0xddb4('0x10')](_0xddb4('0x11'),_0x28d02b,'request\x20sent');_0x53a8c2(_0x21b80f[_0xddb4('0x17')][_0xddb4('0x16')]);}})[_0xddb4('0x18')](function(_0x133f06){logger[_0xddb4('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x28d02b,_0x133f06);_0x5984e1(_0x133f06);});});}
\ No newline at end of file
+var _0x9ccd=['request','then','info','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x274b75,_0x1bf6dc){var _0x248f5c=function(_0x151997){while(--_0x151997){_0x274b75['push'](_0x274b75['shift']());}};_0x248f5c(++_0x1bf6dc);}(_0x9ccd,0x17b));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd9cc('0x0'));var moment=require(_0xd9cc('0x1'));var BPromise=require(_0xd9cc('0x2'));var rs=require(_0xd9cc('0x3'));var fs=require('fs');var Redis=require(_0xd9cc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd9cc('0x5'));var logger=require(_0xd9cc('0x6'))(_0xd9cc('0x7'));var config=require(_0xd9cc('0x8'));var jayson=require(_0xd9cc('0x9'));var client=jayson[_0xd9cc('0xa')][_0xd9cc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x428cc0,_0x28ed0c,_0x294d62){return new BPromise(function(_0x1382fb,_0x362009){return client[_0xd9cc('0xc')](_0x428cc0,_0x294d62)[_0xd9cc('0xd')](function(_0x111a6d){logger[_0xd9cc('0xe')](_0xd9cc('0xf'),_0x28ed0c,'request\x20sent');logger['debug'](_0xd9cc('0x10'),_0x28ed0c,'request\x20sent',JSON[_0xd9cc('0x11')](_0x111a6d));if(_0x111a6d[_0xd9cc('0x12')]){if(_0x111a6d['error'][_0xd9cc('0x13')]===0x1f4){logger[_0xd9cc('0x12')](_0xd9cc('0xf'),_0x28ed0c,_0x111a6d[_0xd9cc('0x12')][_0xd9cc('0x14')]);return _0x362009(_0x111a6d['error'][_0xd9cc('0x14')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x28ed0c,_0x111a6d[_0xd9cc('0x12')][_0xd9cc('0x14')]);return _0x1382fb(_0x111a6d['error'][_0xd9cc('0x14')]);}else{logger['info'](_0xd9cc('0xf'),_0x28ed0c,'request\x20sent');_0x1382fb(_0x111a6d[_0xd9cc('0x15')][_0xd9cc('0x14')]);}})[_0xd9cc('0x16')](function(_0x19e525){logger[_0xd9cc('0x12')](_0xd9cc('0xf'),_0x28ed0c,_0x19e525);_0x362009(_0x19e525);});});}
\ No newline at end of file
index c811bf0..8fe117a 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(_0x5d0aeb,_0x33a0cf){var _0x4efe9b=function(_0x1f39ef){while(--_0x1f39ef){_0x5d0aeb['push'](_0x5d0aeb['shift']());}};_0x4efe9b(++_0x33a0cf);}(_0x70e0,0x17b));var _0x070e=function(_0xab5ece,_0x48e1f1){_0xab5ece=_0xab5ece-0x0;var _0x1f84a3=_0x70e0[_0xab5ece];return _0x1f84a3;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2ddd42,_0x39be46){var _0x189dc1=function(_0xab9aac){while(--_0xab9aac){_0x2ddd42['push'](_0x2ddd42['shift']());}};_0x189dc1(++_0x39be46);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 5677a4d..04d8095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d26=['exports','INTEGER','STRING','sequelize'];(function(_0x462695,_0x2a8cf0){var _0x49c1d1=function(_0x3043e5){while(--_0x3043e5){_0x462695['push'](_0x462695['shift']());}};_0x49c1d1(++_0x2a8cf0);}(_0x0d26,0x14f));var _0x60d2=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x0d26[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x60d2('0x0'));module[_0x60d2('0x1')]={'penalty':{'type':Sequelize[_0x60d2('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x60d2('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x60d2('0x3')]}};
\ No newline at end of file
+var _0x1bf2=['sequelize','INTEGER'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x1bf2,0x1ce));var _0x21bf=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x1bf2[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x21bf('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x21bf('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x21bf('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index a45dca6..6399205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x210f=['exports','define','UserFaxQueue','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x8d6c19,_0x513845){var _0x10ad87=function(_0x2a8a68){while(--_0x2a8a68){_0x8d6c19['push'](_0x8d6c19['shift']());}};_0x10ad87(++_0x513845);}(_0x210f,0x1b3));var _0xf210=function(_0xa04413,_0x518cb3){_0xa04413=_0xa04413-0x0;var _0x5d2f2c=_0x210f[_0xa04413];return _0x5d2f2c;};'use strict';var _=require(_0xf210('0x0'));var util=require(_0xf210('0x1'));var logger=require(_0xf210('0x2'))('api');var moment=require(_0xf210('0x3'));var BPromise=require('bluebird');var rp=require(_0xf210('0x4'));var fs=require('fs');var path=require(_0xf210('0x5'));var rimraf=require(_0xf210('0x6'));var config=require(_0xf210('0x7'));var attributes=require(_0xf210('0x8'));module[_0xf210('0x9')]=function(_0x3e1737,_0x433a08){return _0x3e1737[_0xf210('0xa')](_0xf210('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77d6=['api','bluebird','request-promise','path','../../config/environment','exports','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger'];(function(_0x43a7a9,_0x55df48){var _0x429e3f=function(_0x40cf5f){while(--_0x40cf5f){_0x43a7a9['push'](_0x43a7a9['shift']());}};_0x429e3f(++_0x55df48);}(_0x77d6,0x15e));var _0x677d=function(_0x3650e0,_0xda0f52){_0x3650e0=_0x3650e0-0x0;var _0x6841fb=_0x77d6[_0x3650e0];return _0x6841fb;};'use strict';var _=require('lodash');var util=require(_0x677d('0x0'));var logger=require(_0x677d('0x1'))(_0x677d('0x2'));var moment=require('moment');var BPromise=require(_0x677d('0x3'));var rp=require(_0x677d('0x4'));var fs=require('fs');var path=require(_0x677d('0x5'));var rimraf=require('rimraf');var config=require(_0x677d('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x677d('0x7')]=function(_0x4adafa,_0x35f3a3){return _0x4adafa[_0x677d('0x8')](_0x677d('0x9'),attributes,{'tableName':_0x677d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e55f35..5e20eb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4c3=['rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1c0f3d,_0x55a9e2){var _0x4d71a8=function(_0xeff131){while(--_0xeff131){_0x1c0f3d['push'](_0x1c0f3d['shift']());}};_0x4d71a8(++_0x55a9e2);}(_0xe4c3,0x1ee));var _0x3e4c=function(_0x17b974,_0xe012f){_0x17b974=_0x17b974-0x0;var _0x3244dd=_0xe4c3[_0x17b974];return _0x3244dd;};'use strict';var _=require(_0x3e4c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e4c('0x1'));var rs=require(_0x3e4c('0x2'));var fs=require('fs');var Redis=require(_0x3e4c('0x3'));var db=require(_0x3e4c('0x4'))['db'];var utils=require(_0x3e4c('0x5'));var logger=require('../../config/logger')(_0x3e4c('0x6'));var config=require(_0x3e4c('0x7'));var jayson=require(_0x3e4c('0x8'));var client=jayson[_0x3e4c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bf903,_0x376b5a,_0x15f9d6){return new BPromise(function(_0x1b37f9,_0x36b10b){return client[_0x3e4c('0xa')](_0x5bf903,_0x15f9d6)[_0x3e4c('0xb')](function(_0x5dce87){logger[_0x3e4c('0xc')](_0x3e4c('0xd'),_0x376b5a,_0x3e4c('0xe'));logger[_0x3e4c('0xf')](_0x3e4c('0x10'),_0x376b5a,_0x3e4c('0xe'),JSON[_0x3e4c('0x11')](_0x5dce87));if(_0x5dce87['error']){if(_0x5dce87['error']['code']===0x1f4){logger[_0x3e4c('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x376b5a,_0x5dce87[_0x3e4c('0x12')]['message']);return _0x36b10b(_0x5dce87[_0x3e4c('0x12')][_0x3e4c('0x13')]);}logger[_0x3e4c('0x12')](_0x3e4c('0xd'),_0x376b5a,_0x5dce87[_0x3e4c('0x12')][_0x3e4c('0x13')]);return _0x1b37f9(_0x5dce87[_0x3e4c('0x12')][_0x3e4c('0x13')]);}else{logger[_0x3e4c('0xc')](_0x3e4c('0xd'),_0x376b5a,_0x3e4c('0xe'));_0x1b37f9(_0x5dce87['result']['message']);}})['catch'](function(_0x586e44){logger[_0x3e4c('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x376b5a,_0x586e44);_0x36b10b(_0x586e44);});});}
\ No newline at end of file
+var _0x1541=['../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x28eaf2,_0x2a3a3f){var _0x2efac4=function(_0x5bf19c){while(--_0x5bf19c){_0x28eaf2['push'](_0x28eaf2['shift']());}};_0x2efac4(++_0x2a3a3f);}(_0x1541,0x1b0));var _0x1154=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x1541[_0x1dd532];return _0x3732aa;};'use strict';var _=require(_0x1154('0x0'));var util=require(_0x1154('0x1'));var moment=require(_0x1154('0x2'));var BPromise=require('bluebird');var rs=require(_0x1154('0x3'));var fs=require('fs');var Redis=require(_0x1154('0x4'));var db=require(_0x1154('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1154('0x6'))(_0x1154('0x7'));var config=require(_0x1154('0x8'));var jayson=require(_0x1154('0x9'));var client=jayson[_0x1154('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1754d0,_0x2a38ca,_0x5c1b99){return new BPromise(function(_0x5f3eda,_0x2ab9a2){return client['request'](_0x1754d0,_0x5c1b99)[_0x1154('0xb')](function(_0x55ca7b){logger[_0x1154('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x2a38ca,_0x1154('0xd'));logger[_0x1154('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x2a38ca,_0x1154('0xd'),JSON[_0x1154('0xf')](_0x55ca7b));if(_0x55ca7b['error']){if(_0x55ca7b[_0x1154('0x10')][_0x1154('0x11')]===0x1f4){logger[_0x1154('0x10')](_0x1154('0x12'),_0x2a38ca,_0x55ca7b['error'][_0x1154('0x13')]);return _0x2ab9a2(_0x55ca7b[_0x1154('0x10')][_0x1154('0x13')]);}logger['error'](_0x1154('0x12'),_0x2a38ca,_0x55ca7b[_0x1154('0x10')][_0x1154('0x13')]);return _0x5f3eda(_0x55ca7b[_0x1154('0x10')][_0x1154('0x13')]);}else{logger['info'](_0x1154('0x12'),_0x2a38ca,_0x1154('0xd'));_0x5f3eda(_0x55ca7b[_0x1154('0x14')]['message']);}})[_0x1154('0x15')](function(_0x787d6c){logger[_0x1154('0x10')](_0x1154('0x12'),_0x2a38ca,_0x787d6c);_0x2ab9a2(_0x787d6c);});});}
\ No newline at end of file
index 66816e1..90faf32 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(_0x55d2b3,_0x20c0ff){var _0x488908=function(_0x8038d5){while(--_0x8038d5){_0x55d2b3['push'](_0x55d2b3['shift']());}};_0x488908(++_0x20c0ff);}(_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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2782db,_0x2a516f){var _0x4af4e4=function(_0x17316a){while(--_0x17316a){_0x2782db['push'](_0x2782db['shift']());}};_0x4af4e4(++_0x2a516f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 215e6e8..88784e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc4=['exports','INTEGER','sequelize'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xedc4,0x13a));var _0x4edc=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xedc4[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x4edc('0x0'));module[_0x4edc('0x1')]={'penalty':{'type':Sequelize[_0x4edc('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9916=['sequelize','exports','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9916,0x120));var _0x6991=function(_0x41d617,_0x2dfb85){_0x41d617=_0x41d617-0x0;var _0xfe21ca=_0x9916[_0x41d617];return _0xfe21ca;};'use strict';var Sequelize=require(_0x6991('0x0'));module[_0x6991('0x1')]={'penalty':{'type':Sequelize[_0x6991('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 29782b3..19441bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb512=['moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x1514dc,_0x4de402){var _0x72ca6=function(_0x2b8768){while(--_0x2b8768){_0x1514dc['push'](_0x1514dc['shift']());}};_0x72ca6(++_0x4de402);}(_0xb512,0x1dd));var _0x2b51=function(_0x2d0027,_0x23213c){_0x2d0027=_0x2d0027-0x0;var _0x7fbf1c=_0xb512[_0x2d0027];return _0x7fbf1c;};'use strict';var _=require(_0x2b51('0x0'));var util=require(_0x2b51('0x1'));var logger=require(_0x2b51('0x2'))('api');var moment=require(_0x2b51('0x3'));var BPromise=require('bluebird');var rp=require(_0x2b51('0x4'));var fs=require('fs');var path=require(_0x2b51('0x5'));var rimraf=require(_0x2b51('0x6'));var config=require(_0x2b51('0x7'));var attributes=require(_0x2b51('0x8'));module['exports']=function(_0x591878,_0x147852){return _0x591878[_0x2b51('0x9')](_0x2b51('0xa'),attributes,{'tableName':_0x2b51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd2f5=['bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','moment'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xd2f5,0x127));var _0x5d2f=function(_0x5f5e7c,_0x3c66e4){_0x5f5e7c=_0x5f5e7c-0x0;var _0x8475d7=_0xd2f5[_0x5f5e7c];return _0x8475d7;};'use strict';var _=require(_0x5d2f('0x0'));var util=require(_0x5d2f('0x1'));var logger=require(_0x5d2f('0x2'))('api');var moment=require(_0x5d2f('0x3'));var BPromise=require(_0x5d2f('0x4'));var rp=require(_0x5d2f('0x5'));var fs=require('fs');var path=require(_0x5d2f('0x6'));var rimraf=require(_0x5d2f('0x7'));var config=require(_0x5d2f('0x8'));var attributes=require(_0x5d2f('0x9'));module[_0x5d2f('0xa')]=function(_0xadd707,_0x38b59e){return _0xadd707['define'](_0x5d2f('0xb'),attributes,{'tableName':_0x5d2f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bf7cbdd..aaf1352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x49a8ef,_0x2da913){var _0x316572=function(_0x8bffd9){while(--_0x8bffd9){_0x49a8ef['push'](_0x49a8ef['shift']());}};_0x316572(++_0x2da913);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4e291c,_0x3d2678){_0x4e291c=_0x4e291c-0x0;var _0x4c9625=_0x8ef6[_0x4e291c];return _0x4c9625;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});}
\ No newline at end of file
+var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4f7d5f,_0x43a77a){var _0x4a86d7=function(_0x461516){while(--_0x461516){_0x4f7d5f['push'](_0x4f7d5f['shift']());}};_0x4a86d7(++_0x43a77a);}(_0x34e8,0x12c));var _0x834e=function(_0x5580a0,_0x35c801){_0x5580a0=_0x5580a0-0x0;var _0x57528e=_0x34e8[_0x5580a0];return _0x57528e;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}
\ No newline at end of file
index 2eb64d6..af27f54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fc4=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x17ef17,_0x1e9a56){var _0x2bb6c3=function(_0xf864df){while(--_0xf864df){_0x17ef17['push'](_0x17ef17['shift']());}};_0x2bb6c3(++_0x1e9a56);}(_0x0fc4,0x13f));var _0x40fc=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x0fc4[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x40fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x40fc('0x1'));var express=require(_0x40fc('0x2'));var router=express[_0x40fc('0x3')]();var fs_extra=require(_0x40fc('0x4'));var auth=require(_0x40fc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x40fc('0x6'));var controller=require('./userNotification.controller');router['post']('/',auth[_0x40fc('0x7')](),controller[_0x40fc('0x8')]);module[_0x40fc('0x9')]=router;
\ No newline at end of file
+var _0x350e=['fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3e4305,_0xf8967e){var _0x143d47=function(_0x810579){while(--_0x810579){_0x3e4305['push'](_0x3e4305['shift']());}};_0x143d47(++_0xf8967e);}(_0x350e,0x158));var _0xe350=function(_0x47fbdd,_0x487e75){_0x47fbdd=_0x47fbdd-0x0;var _0x39172c=_0x350e[_0x47fbdd];return _0x39172c;};'use strict';var multer=require(_0xe350('0x0'));var util=require(_0xe350('0x1'));var path=require(_0xe350('0x2'));var timeout=require(_0xe350('0x3'));var express=require(_0xe350('0x4'));var router=express[_0xe350('0x5')]();var fs_extra=require(_0xe350('0x6'));var auth=require(_0xe350('0x7'));var interaction=require(_0xe350('0x8'));var config=require('../../config/environment');var controller=require(_0xe350('0x9'));router[_0xe350('0xa')]('/',auth[_0xe350('0xb')](),controller[_0xe350('0xc')]);module[_0xe350('0xd')]=router;
\ No newline at end of file
index ef864f0..ebeafd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba2=['STRING','BOOLEAN','TEXT'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0xfba2,0x1df));var _0x2fba=function(_0x2eb13f,_0x2e1b1a){_0x2eb13f=_0x2eb13f-0x0;var _0x2d073e=_0xfba2[_0x2eb13f];return _0x2d073e;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2fba('0x0')]},'senderName':{'type':Sequelize[_0x2fba('0x1')]},'recipientsId':{'type':Sequelize[_0x2fba('0x0')]},'recipientsDescription':{'type':Sequelize[_0x2fba('0x1')]},'beep':{'type':Sequelize[_0x2fba('0x2')]}};
\ No newline at end of file
+var _0x7342=['sequelize','STRING','TEXT','BOOLEAN'];(function(_0x167c26,_0x2bf7d9){var _0x31bc24=function(_0x2f4a38){while(--_0x2f4a38){_0x167c26['push'](_0x167c26['shift']());}};_0x31bc24(++_0x2bf7d9);}(_0x7342,0x17c));var _0x2734=function(_0x5e6f91,_0x52e027){_0x5e6f91=_0x5e6f91-0x0;var _0x4d1283=_0x7342[_0x5e6f91];return _0x4d1283;};'use strict';var Sequelize=require(_0x2734('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x2734('0x1')]},'recipientsId':{'type':Sequelize[_0x2734('0x2')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x2734('0x3')]}};
\ No newline at end of file
index 424e6c2..d9a7728 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3070=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','beep','forEach','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','toLowerCase','User','union','replace','queue','Queue','ids','push','flatten','getAgents','map','eml-format'];(function(_0xf5edfb,_0x40e47c){var _0x40239a=function(_0x22202d){while(--_0x22202d){_0xf5edfb['push'](_0xf5edfb['shift']());}};_0x40239a(++_0x40e47c);}(_0x3070,0xd1));var _0x0307=function(_0x17075f,_0x522107){_0x17075f=_0x17075f-0x0;var _0x428e92=_0x3070[_0x17075f];return _0x428e92;};'use strict';var emlformat=require(_0x0307('0x0'));var rimraf=require(_0x0307('0x1'));var zipdir=require(_0x0307('0x2'));var jsonpatch=require(_0x0307('0x3'));var rp=require(_0x0307('0x4'));var moment=require(_0x0307('0x5'));var BPromise=require(_0x0307('0x6'));var Mustache=require('mustache');var util=require(_0x0307('0x7'));var path=require(_0x0307('0x8'));var sox=require('sox');var csv=require(_0x0307('0x9'));var ejs=require(_0x0307('0xa'));var fs=require('fs');var fs_extra=require(_0x0307('0xb'));var _=require('lodash');var squel=require(_0x0307('0xc'));var crypto=require(_0x0307('0xd'));var jsforce=require(_0x0307('0xe'));var deskjs=require(_0x0307('0xf'));var toCsv=require(_0x0307('0x9'));var querystring=require(_0x0307('0x10'));var Papa=require(_0x0307('0x11'));var Redis=require(_0x0307('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0307('0x13'));var as=require(_0x0307('0x14'));var hardwareService=require(_0x0307('0x15'));var logger=require(_0x0307('0x16'))(_0x0307('0x17'));var utils=require(_0x0307('0x18'));var config=require(_0x0307('0x19'));var licenseUtil=require(_0x0307('0x1a'));var db=require('../../mysqldb')['db'];config[_0x0307('0x1b')]=_[_0x0307('0x1c')](config[_0x0307('0x1b')],{'host':_0x0307('0x1d'),'port':0x18eb});var socket=require(_0x0307('0x1e'))(new Redis(config[_0x0307('0x1b')]));require(_0x0307('0x1f'))[_0x0307('0x20')](socket);function respondWithStatusCode(_0xbb387e,_0x33eb1c){_0x33eb1c=_0x33eb1c||0xcc;return function(_0x2085f0){if(_0x2085f0){return _0xbb387e['sendStatus'](_0x33eb1c);}return _0xbb387e[_0x0307('0x21')](_0x33eb1c)[_0x0307('0x22')]();};}function respondWithResult(_0x3e2b37,_0x176cb5){_0x176cb5=_0x176cb5||0xc8;return function(_0x53707d){if(_0x53707d){return _0x3e2b37['status'](_0x176cb5)[_0x0307('0x23')](_0x53707d);}};}function respondWithFilteredResult(_0x46dbc7,_0x258575){return function(_0xbcc118){if(_0xbcc118){var _0x209ba=typeof _0x258575[_0x0307('0x24')]===_0x0307('0x25')&&typeof _0x258575[_0x0307('0x26')]===_0x0307('0x25');var _0x384b5d=_0xbcc118[_0x0307('0x27')];var _0x210f40=_0x209ba?0x0:_0x258575[_0x0307('0x24')];var _0x5360b4=_0x209ba?_0xbcc118['count']:_0x258575[_0x0307('0x24')]+_0x258575[_0x0307('0x26')];var _0x5e6112;if(_0x5360b4>=_0x384b5d){_0x5360b4=_0x384b5d;_0x5e6112=0xc8;}else{_0x5e6112=0xce;}_0x46dbc7['status'](_0x5e6112);return _0x46dbc7['set'](_0x0307('0x28'),_0x210f40+'-'+_0x5360b4+'/'+_0x384b5d)[_0x0307('0x23')](_0xbcc118);}return null;};}function patchUpdates(_0x5c9c3c){return function(_0x45cbd5){try{jsonpatch[_0x0307('0x29')](_0x45cbd5,_0x5c9c3c,!![]);}catch(_0x32e142){return BPromise[_0x0307('0x2a')](_0x32e142);}return _0x45cbd5[_0x0307('0x2b')]();};}function saveUpdates(_0x1ebbe4,_0x4af6b9){return function(_0xd89261){if(_0xd89261){return _0xd89261[_0x0307('0x2c')](_0x1ebbe4)[_0x0307('0x2d')](function(_0x32fa9e){return _0x32fa9e;});}return null;};}function removeEntity(_0x5522a6,_0x5e392e){return function(_0x4f9fa7){if(_0x4f9fa7){return _0x4f9fa7[_0x0307('0x2e')]()['then'](function(){_0x5522a6[_0x0307('0x21')](0xcc)[_0x0307('0x22')]();});}};}function handleEntityNotFound(_0x4aca87,_0x1cabe1){return function(_0x4d5954){if(!_0x4d5954){_0x4aca87['sendStatus'](0x194);}return _0x4d5954;};}function handleError(_0x433c9f,_0x2d98ff){_0x2d98ff=_0x2d98ff||0x1f4;return function(_0x55fc9a){logger[_0x0307('0x2f')](_0x55fc9a[_0x0307('0x30')]);if(_0x55fc9a[_0x0307('0x31')]){delete _0x55fc9a[_0x0307('0x31')];}_0x433c9f[_0x0307('0x21')](_0x2d98ff)[_0x0307('0x32')](_0x55fc9a);};}exports[_0x0307('0x33')]=function(_0x4ba389,_0x16beed,_0x3ef50c){if(!_0x4ba389[_0x0307('0x34')]['hasOwnProperty'](_0x0307('0x35'))&&!_0x4ba389[_0x0307('0x34')][_0x0307('0x36')](_0x0307('0x37'))){throw new db['Sequelize'][(_0x0307('0x38'))](_0x0307('0x39'));}else{if(_0x4ba389[_0x0307('0x34')][_0x0307('0x36')](_0x0307('0x37'))&&!_0x4ba389[_0x0307('0x34')][_0x0307('0x36')](_0x0307('0x3a'))){throw new db[(_0x0307('0x3b'))][(_0x0307('0x38'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4ba389['body'][_0x0307('0x36')](_0x0307('0x3c'))){throw new db[(_0x0307('0x3b'))][(_0x0307('0x38'))](_0x0307('0x3d'));}else{try{var _0x42cc24=JSON[_0x0307('0x3e')](_0x4ba389['body'][_0x0307('0x3c')]);}catch(_0x4f955d){logger[_0x0307('0x2f')](_0x4f955d);throw new db['Sequelize'][(_0x0307('0x38'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xc6652e=[_0x0307('0x3f'),'faxqueue',_0x0307('0x40'),_0x0307('0x41'),_0x0307('0x42'),'voicequeue',_0x0307('0x43'),_0x0307('0x44'),'user'];if(_['some'](_0x42cc24,function(_0x38359d){return!_[_0x0307('0x45')](_0xc6652e,_0x38359d[_0x0307('0x46')]['toLowerCase']());})){throw new db[(_0x0307('0x3b'))][(_0x0307('0x38'))](_0x0307('0x47'));}}}var _0x3d393c={};_0x3d393c['senderName']=_0x4ba389[_0x0307('0x34')][_0x0307('0x36')](_0x0307('0x48'))?_0x4ba389[_0x0307('0x34')][_0x0307('0x48')]:_0x4ba389[_0x0307('0x49')][_0x0307('0x4a')];_0x3d393c[_0x0307('0x4b')]=_[_0x0307('0x4c')](_0x4ba389['body'][_0x0307('0x4b')])?null:_0x4ba389[_0x0307('0x34')][_0x0307('0x4b')];_0x3d393c['beep']=_0x4ba389['body']['beep']||![];_0x3d393c[_0x0307('0x4d')]=_0x4ba389['user']['id'];return getContent(_0x4ba389[_0x0307('0x34')])[_0x0307('0x2d')](function(_0x29e166){_0x3d393c['body']=_0x29e166;return getRecipients(_0x42cc24);})[_0x0307('0x2d')](function(_0x64b437){_0x3d393c[_0x0307('0x4e')]=_[_0x0307('0x4f')](_0x64b437)['join'](',');return db[_0x0307('0x50')][_0x0307('0x51')](function(_0x530061){return db[_0x0307('0x52')][_0x0307('0x53')](_0x3d393c,{'raw':!![],'transaction':_0x530061})[_0x0307('0x2d')](function(_0x336898){var _0x487c9a={'sender':_0x3d393c[_0x0307('0x48')],'description':_0x3d393c['recipientsDescription'],'content':_0x3d393c[_0x0307('0x34')],'beep':_0x3d393c[_0x0307('0x54')]};_0x64b437[_0x0307('0x55')](function(_0x138948){_0x487c9a['recipient']=_0x138948;socket[_0x0307('0x56')]('userNotification:send',_0x487c9a);});return _0x336898;});});})[_0x0307('0x2d')](respondWithResult(_0x16beed,0xc9))[_0x0307('0x57')](handleError(_0x16beed,null));};function getContent(_0x40211a){return new BPromise(function(_0x6f2c26,_0x415fe3){if(_0x40211a[_0x0307('0x35')]){_0x6f2c26(_0x40211a[_0x0307('0x35')]);return;}return db[_0x0307('0x58')][_0x0307('0x59')]({'attributes':[_0x0307('0x5a')],'where':{'id':_0x40211a[_0x0307('0x37')]},'raw':!![]})[_0x0307('0x2d')](function(_0x37d563){if(!_0x37d563)throw new db[(_0x0307('0x3b'))]['ValidationError'](_0x0307('0x5b'));var _0x4c37cb=Mustache[_0x0307('0x5c')](_0x37d563[_0x0307('0x5a')],_0x40211a[_0x0307('0x3a')]);_0x6f2c26(_0x4c37cb);})[_0x0307('0x57')](function(_0x877a08){_0x415fe3(_0x877a08);});});}function getRecipients(_0x3336f4){return new BPromise(function(_0x3a4ebd,_0x2e0d13){var _0x52f5b2=[];var _0x42fb4c=[];_0x3336f4[_0x0307('0x55')](function(_0x2c2245){var _0x404419=_[_0x0307('0x5d')](_0x2c2245[_0x0307('0x46')][_0x0307('0x5e')]());if(_0x404419===_0x0307('0x5f')){_0x52f5b2=_[_0x0307('0x60')](_0x52f5b2,_0x2c2245['ids']);}else{if(_['includes'](_0x404419,'queue'))_0x404419=_0x404419[_0x0307('0x61')](_0x0307('0x62'),_0x0307('0x63'));_0x2c2245[_0x0307('0x64')][_0x0307('0x55')](function(_0x5106dd){_0x42fb4c[_0x0307('0x65')](getAgents(_0x404419,_0x5106dd));});}});return BPromise['all'](_0x42fb4c)[_0x0307('0x2d')](function(_0x195832){_0x52f5b2=_[_0x0307('0x60')](_0x52f5b2,_[_0x0307('0x66')](_0x195832));_0x3a4ebd(_0x52f5b2);})[_0x0307('0x57')](function(_0x4c6e18){_0x2e0d13(_0x4c6e18);});});}function getAgents(_0x55e536,_0x5495f0){return new BPromise(function(_0x2fdd80,_0x55f0b0){return db[_0x55e536][_0x0307('0x59')]({'where':{'id':_0x5495f0}})[_0x0307('0x2d')](function(_0x32e1d8){return _0x32e1d8[_0x0307('0x67')]({'attributes':['id'],'raw':!![]})[_0x0307('0x2d')](function(_0x243cca){var _0x2f669c=_[_0x0307('0x68')](_0x243cca,'id');_0x2fdd80(_0x2f669c);});})[_0x0307('0x57')](function(_0x5b8c33){_0x55f0b0(_0x5b8c33);});});}
\ No newline at end of file
+var _0xea22=['redis','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','count','apply','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','mailqueue','openchannelqueue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','sortBy','join','sequelize','UserNotification','forEach','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','view','startCase','User','union','queue','replace','ids','push','flatten','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x237f07,_0x2142a9){var _0x22c133=function(_0x3e1280){while(--_0x3e1280){_0x237f07['push'](_0x237f07['shift']());}};_0x22c133(++_0x2142a9);}(_0xea22,0x15d));var _0x2ea2=function(_0x97ca17,_0x3d3d36){_0x97ca17=_0x97ca17-0x0;var _0x34f6cd=_0xea22[_0x97ca17];return _0x34f6cd;};'use strict';var emlformat=require(_0x2ea2('0x0'));var rimraf=require(_0x2ea2('0x1'));var zipdir=require(_0x2ea2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2ea2('0x3'));var moment=require(_0x2ea2('0x4'));var BPromise=require(_0x2ea2('0x5'));var Mustache=require(_0x2ea2('0x6'));var util=require(_0x2ea2('0x7'));var path=require(_0x2ea2('0x8'));var sox=require(_0x2ea2('0x9'));var csv=require(_0x2ea2('0xa'));var ejs=require(_0x2ea2('0xb'));var fs=require('fs');var fs_extra=require(_0x2ea2('0xc'));var _=require(_0x2ea2('0xd'));var squel=require(_0x2ea2('0xe'));var crypto=require(_0x2ea2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x2ea2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2ea2('0x11'));var Papa=require(_0x2ea2('0x12'));var Redis=require(_0x2ea2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2ea2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ea2('0x15'));var logger=require(_0x2ea2('0x16'))(_0x2ea2('0x17'));var utils=require(_0x2ea2('0x18'));var config=require(_0x2ea2('0x19'));var licenseUtil=require(_0x2ea2('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2ea2('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ea2('0x1c'))(new Redis(config['redis']));require(_0x2ea2('0x1d'))['register'](socket);function respondWithStatusCode(_0x10c337,_0x2d687f){_0x2d687f=_0x2d687f||0xcc;return function(_0x49874b){if(_0x49874b){return _0x10c337[_0x2ea2('0x1e')](_0x2d687f);}return _0x10c337[_0x2ea2('0x1f')](_0x2d687f)[_0x2ea2('0x20')]();};}function respondWithResult(_0x355047,_0x2aad7d){_0x2aad7d=_0x2aad7d||0xc8;return function(_0x25444c){if(_0x25444c){return _0x355047[_0x2ea2('0x1f')](_0x2aad7d)[_0x2ea2('0x21')](_0x25444c);}};}function respondWithFilteredResult(_0x5e326b,_0x2d621e){return function(_0x4abdf4){if(_0x4abdf4){var _0x2a75c7=typeof _0x2d621e[_0x2ea2('0x22')]==='undefined'&&typeof _0x2d621e['limit']==='undefined';var _0x53518f=_0x4abdf4[_0x2ea2('0x23')];var _0x28c6f0=_0x2a75c7?0x0:_0x2d621e[_0x2ea2('0x22')];var _0x318936=_0x2a75c7?_0x4abdf4[_0x2ea2('0x23')]:_0x2d621e['offset']+_0x2d621e['limit'];var _0x4e740a;if(_0x318936>=_0x53518f){_0x318936=_0x53518f;_0x4e740a=0xc8;}else{_0x4e740a=0xce;}_0x5e326b[_0x2ea2('0x1f')](_0x4e740a);return _0x5e326b['set']('Content-Range',_0x28c6f0+'-'+_0x318936+'/'+_0x53518f)['json'](_0x4abdf4);}return null;};}function patchUpdates(_0x49c4e7){return function(_0x4d60ba){try{jsonpatch[_0x2ea2('0x24')](_0x4d60ba,_0x49c4e7,!![]);}catch(_0x3fa072){return BPromise['reject'](_0x3fa072);}return _0x4d60ba['save']();};}function saveUpdates(_0x8edaf0,_0x267f33){return function(_0x5bad2a){if(_0x5bad2a){return _0x5bad2a[_0x2ea2('0x25')](_0x8edaf0)[_0x2ea2('0x26')](function(_0x356a5c){return _0x356a5c;});}return null;};}function removeEntity(_0x1287f4,_0x4a2fd1){return function(_0x1faeed){if(_0x1faeed){return _0x1faeed[_0x2ea2('0x27')]()[_0x2ea2('0x26')](function(){_0x1287f4['status'](0xcc)[_0x2ea2('0x20')]();});}};}function handleEntityNotFound(_0x52b40b,_0x118044){return function(_0x2602bd){if(!_0x2602bd){_0x52b40b[_0x2ea2('0x1e')](0x194);}return _0x2602bd;};}function handleError(_0x279829,_0x5e9d5e){_0x5e9d5e=_0x5e9d5e||0x1f4;return function(_0x1c0ce6){logger[_0x2ea2('0x28')](_0x1c0ce6[_0x2ea2('0x29')]);if(_0x1c0ce6[_0x2ea2('0x2a')]){delete _0x1c0ce6['name'];}_0x279829[_0x2ea2('0x1f')](_0x5e9d5e)[_0x2ea2('0x2b')](_0x1c0ce6);};}exports[_0x2ea2('0x2c')]=function(_0x1e6dc1,_0x45e30b,_0x5f00db){if(!_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x2e')](_0x2ea2('0x2f'))&&!_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x2e')](_0x2ea2('0x30'))){throw new db[(_0x2ea2('0x31'))][(_0x2ea2('0x32'))](_0x2ea2('0x33'));}else{if(_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x2e')](_0x2ea2('0x30'))&&!_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x2e')]('view')){throw new db[(_0x2ea2('0x31'))]['ValidationError'](_0x2ea2('0x34'));}if(!_0x1e6dc1[_0x2ea2('0x2d')]['hasOwnProperty'](_0x2ea2('0x35'))){throw new db[(_0x2ea2('0x31'))][(_0x2ea2('0x32'))](_0x2ea2('0x36'));}else{try{var _0x28e6b9=JSON[_0x2ea2('0x37')](_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x35')]);}catch(_0x5f1a51){logger[_0x2ea2('0x28')](_0x5f1a51);throw new db[(_0x2ea2('0x31'))][(_0x2ea2('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x31df75=[_0x2ea2('0x38'),'faxqueue',_0x2ea2('0x39'),_0x2ea2('0x3a'),'smsqueue','voicequeue',_0x2ea2('0x3b'),'team',_0x2ea2('0x3c')];if(_[_0x2ea2('0x3d')](_0x28e6b9,function(_0x2faff0){return!_[_0x2ea2('0x3e')](_0x31df75,_0x2faff0[_0x2ea2('0x3f')][_0x2ea2('0x40')]());})){throw new db[(_0x2ea2('0x31'))][(_0x2ea2('0x32'))](_0x2ea2('0x41'));}}}var _0x3c356a={};_0x3c356a['senderName']=_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x2e')](_0x2ea2('0x42'))?_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x42')]:_0x1e6dc1['user'][_0x2ea2('0x43')];_0x3c356a[_0x2ea2('0x44')]=_[_0x2ea2('0x45')](_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x44')])?null:_0x1e6dc1[_0x2ea2('0x2d')][_0x2ea2('0x44')];_0x3c356a[_0x2ea2('0x46')]=_0x1e6dc1['body']['beep']||![];_0x3c356a[_0x2ea2('0x47')]=_0x1e6dc1[_0x2ea2('0x3c')]['id'];return getContent(_0x1e6dc1['body'])[_0x2ea2('0x26')](function(_0x4fbb2c){_0x3c356a[_0x2ea2('0x2d')]=_0x4fbb2c;return getRecipients(_0x28e6b9);})['then'](function(_0x41fd07){_0x3c356a['recipientsId']=_[_0x2ea2('0x48')](_0x41fd07)[_0x2ea2('0x49')](',');return db[_0x2ea2('0x4a')]['transaction'](function(_0xaa0240){return db[_0x2ea2('0x4b')]['create'](_0x3c356a,{'raw':!![],'transaction':_0xaa0240})[_0x2ea2('0x26')](function(_0x17d7dd){var _0x8bb504={'sender':_0x3c356a[_0x2ea2('0x42')],'description':_0x3c356a[_0x2ea2('0x44')],'content':_0x3c356a[_0x2ea2('0x2d')],'beep':_0x3c356a[_0x2ea2('0x46')]};_0x41fd07[_0x2ea2('0x4c')](function(_0x2c4b24){_0x8bb504['recipient']=_0x2c4b24;socket[_0x2ea2('0x4d')](_0x2ea2('0x4e'),_0x8bb504);});return _0x17d7dd;});});})[_0x2ea2('0x26')](respondWithResult(_0x45e30b,0xc9))[_0x2ea2('0x4f')](handleError(_0x45e30b,null));};function getContent(_0x1dcd8b){return new BPromise(function(_0x1dacb8,_0x30b6ee){if(_0x1dcd8b[_0x2ea2('0x2f')]){_0x1dacb8(_0x1dcd8b['text']);return;}return db[_0x2ea2('0x50')][_0x2ea2('0x51')]({'attributes':['html'],'where':{'id':_0x1dcd8b[_0x2ea2('0x30')]},'raw':!![]})[_0x2ea2('0x26')](function(_0x3d78b1){if(!_0x3d78b1)throw new db[(_0x2ea2('0x31'))]['ValidationError'](_0x2ea2('0x52'));var _0x14d5c5=Mustache['render'](_0x3d78b1[_0x2ea2('0x53')],_0x1dcd8b[_0x2ea2('0x54')]);_0x1dacb8(_0x14d5c5);})[_0x2ea2('0x4f')](function(_0x8ed739){_0x30b6ee(_0x8ed739);});});}function getRecipients(_0x58bedc){return new BPromise(function(_0x2b3a85,_0x12ecc8){var _0x26a170=[];var _0x5ee17f=[];_0x58bedc[_0x2ea2('0x4c')](function(_0x3febf7){var _0xac967a=_[_0x2ea2('0x55')](_0x3febf7['model'][_0x2ea2('0x40')]());if(_0xac967a===_0x2ea2('0x56')){_0x26a170=_[_0x2ea2('0x57')](_0x26a170,_0x3febf7['ids']);}else{if(_['includes'](_0xac967a,_0x2ea2('0x58')))_0xac967a=_0xac967a[_0x2ea2('0x59')](_0x2ea2('0x58'),'Queue');_0x3febf7[_0x2ea2('0x5a')][_0x2ea2('0x4c')](function(_0x55801b){_0x5ee17f[_0x2ea2('0x5b')](getAgents(_0xac967a,_0x55801b));});}});return BPromise['all'](_0x5ee17f)[_0x2ea2('0x26')](function(_0x136ba5){_0x26a170=_[_0x2ea2('0x57')](_0x26a170,_[_0x2ea2('0x5c')](_0x136ba5));_0x2b3a85(_0x26a170);})[_0x2ea2('0x4f')](function(_0x3c8f0f){_0x12ecc8(_0x3c8f0f);});});}function getAgents(_0xa2bc7f,_0x4c2be0){return new BPromise(function(_0x3bec27,_0x2a59e9){return db[_0xa2bc7f][_0x2ea2('0x51')]({'where':{'id':_0x4c2be0}})[_0x2ea2('0x26')](function(_0x44b9e3){return _0x44b9e3[_0x2ea2('0x5d')]({'attributes':['id'],'raw':!![]})[_0x2ea2('0x26')](function(_0x514d25){var _0x2040d5=_['map'](_0x514d25,'id');_0x3bec27(_0x2040d5);});})[_0x2ea2('0x4f')](function(_0x59d911){_0x2a59e9(_0x59d911);});});}
\ No newline at end of file
index bd295dd..5d90963 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1bd=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','UserNotification','setMaxListeners'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0xb1bd,0x178));var _0xdb1b=function(_0x22e80b,_0x5ebfa7){_0x22e80b=_0x22e80b-0x0;var _0x558833=_0xb1bd[_0x22e80b];return _0x558833;};'use strict';var EventEmitter=require(_0xdb1b('0x0'));var UserNotification=require(_0xdb1b('0x1'))['db'][_0xdb1b('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdb1b('0x3')](0x0);var events={'afterCreate':_0xdb1b('0x4'),'afterUpdate':_0xdb1b('0x5'),'afterDestroy':_0xdb1b('0x6')};function emitEvent(_0x18e130){return function(_0x5be0f4,_0xf57cb9,_0x5bb80d){UserNotificationEvents[_0xdb1b('0x7')](_0x18e130+':'+_0x5be0f4['id'],_0x5be0f4);UserNotificationEvents[_0xdb1b('0x7')](_0x18e130,_0x5be0f4);_0x5bb80d(null);};}for(var e in events){if(events[_0xdb1b('0x8')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xdb1b('0x9')]=UserNotificationEvents;
\ No newline at end of file
+var _0x330f=['exports','events','../../mysqldb','UserNotification','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x330f,0xbf));var _0xf330=function(_0x305486,_0x24acd4){_0x305486=_0x305486-0x0;var _0xa04940=_0x330f[_0x305486];return _0xa04940;};'use strict';var EventEmitter=require(_0xf330('0x0'));var UserNotification=require(_0xf330('0x1'))['db'][_0xf330('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf330('0x3'),'afterUpdate':_0xf330('0x4'),'afterDestroy':_0xf330('0x5')};function emitEvent(_0x39db3a){return function(_0x5f3c85,_0x3db07e,_0x2158ef){UserNotificationEvents[_0xf330('0x6')](_0x39db3a+':'+_0x5f3c85['id'],_0x5f3c85);UserNotificationEvents[_0xf330('0x6')](_0x39db3a,_0x5f3c85);_0x2158ef(null);};}for(var e in events){if(events[_0xf330('0x7')](e)){var event=events[e];UserNotification[_0xf330('0x8')](e,emitEvent(event));}}module[_0xf330('0x9')]=UserNotificationEvents;
\ No newline at end of file
index d5b6d5c..9d0e3f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1591=['request-promise','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x352c23,_0x39d765){var _0x2fffa0=function(_0x5d145f){while(--_0x5d145f){_0x352c23['push'](_0x352c23['shift']());}};_0x2fffa0(++_0x39d765);}(_0x1591,0x19c));var _0x1159=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x1591[_0xfb0281];return _0x408dd3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1159('0x0'))(_0x1159('0x1'));var moment=require(_0x1159('0x2'));var BPromise=require(_0x1159('0x3'));var rp=require(_0x1159('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1159('0x5'));var config=require(_0x1159('0x6'));var attributes=require(_0x1159('0x7'));module[_0x1159('0x8')]=function(_0x2d6745,_0x5bdb44){return _0x2d6745[_0x1159('0x9')](_0x1159('0xa'),attributes,{'tableName':_0x1159('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1159('0xc')});};
\ No newline at end of file
+var _0xa445=['exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./userNotification.attributes'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xa445,0x1d3));var _0x5a44=function(_0x3d89c5,_0x45f207){_0x3d89c5=_0x3d89c5-0x0;var _0xa43950=_0xa445[_0x3d89c5];return _0xa43950;};'use strict';var _=require(_0x5a44('0x0'));var util=require(_0x5a44('0x1'));var logger=require('../../config/logger')(_0x5a44('0x2'));var moment=require(_0x5a44('0x3'));var BPromise=require(_0x5a44('0x4'));var rp=require(_0x5a44('0x5'));var fs=require('fs');var path=require(_0x5a44('0x6'));var rimraf=require(_0x5a44('0x7'));var config=require('../../config/environment');var attributes=require(_0x5a44('0x8'));module[_0x5a44('0x9')]=function(_0x17cfc0,_0xeca339){return _0x17cfc0[_0x5a44('0xa')]('UserNotification',attributes,{'tableName':_0x5a44('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5a44('0xc'),'collate':_0x5a44('0xd')});};
\ No newline at end of file
index 68598df..5df5f6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08fd=['defaults','register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x96eb17,_0x5a80ac){var _0x5e5ad5=function(_0x1aec23){while(--_0x1aec23){_0x96eb17['push'](_0x96eb17['shift']());}};_0x5e5ad5(++_0x5a80ac);}(_0x08fd,0x17c));var _0xd08f=function(_0x42a8ab,_0x31cc0d){_0x42a8ab=_0x42a8ab-0x0;var _0x4f0174=_0x08fd[_0x42a8ab];return _0x4f0174;};'use strict';var _=require(_0xd08f('0x0'));var util=require(_0xd08f('0x1'));var moment=require(_0xd08f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd08f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd08f('0x4'));var logger=require('../../config/logger')(_0xd08f('0x5'));var config=require(_0xd08f('0x6'));var jayson=require(_0xd08f('0x7'));var client=jayson[_0xd08f('0x8')][_0xd08f('0x9')]({'port':0x232a});config[_0xd08f('0xa')]=_[_0xd08f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd08f('0xa')]));require('./userNotification.socket')[_0xd08f('0xc')](socket);function respondWithRpcPromise(_0x3cb9a7,_0x392948,_0x11a578){return new BPromise(function(_0x5e2f52,_0x189480){return client['request'](_0x3cb9a7,_0x11a578)[_0xd08f('0xd')](function(_0x1d7c7d){logger[_0xd08f('0xe')](_0xd08f('0xf'),_0x392948,_0xd08f('0x10'));logger[_0xd08f('0x11')](_0xd08f('0x12'),_0x392948,_0xd08f('0x10'),JSON[_0xd08f('0x13')](_0x1d7c7d));if(_0x1d7c7d[_0xd08f('0x14')]){if(_0x1d7c7d[_0xd08f('0x14')]['code']===0x1f4){logger[_0xd08f('0x14')](_0xd08f('0xf'),_0x392948,_0x1d7c7d[_0xd08f('0x14')]['message']);return _0x189480(_0x1d7c7d['error'][_0xd08f('0x15')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x392948,_0x1d7c7d[_0xd08f('0x14')][_0xd08f('0x15')]);return _0x5e2f52(_0x1d7c7d[_0xd08f('0x14')][_0xd08f('0x15')]);}else{logger['info'](_0xd08f('0xf'),_0x392948,_0xd08f('0x10'));_0x5e2f52(_0x1d7c7d[_0xd08f('0x16')][_0xd08f('0x15')]);}})['catch'](function(_0x104b4e){logger[_0xd08f('0x14')](_0xd08f('0xf'),_0x392948,_0x104b4e);_0x189480(_0x104b4e);});});}
\ No newline at end of file
+var _0x55ef=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch'];(function(_0x422540,_0x51898b){var _0x400b5d=function(_0x5e0469){while(--_0x5e0469){_0x422540['push'](_0x422540['shift']());}};_0x400b5d(++_0x51898b);}(_0x55ef,0x177));var _0xf55e=function(_0x27bd79,_0x1d7d2b){_0x27bd79=_0x27bd79-0x0;var _0x208297=_0x55ef[_0x27bd79];return _0x208297;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf55e('0x0'));var BPromise=require(_0xf55e('0x1'));var rs=require(_0xf55e('0x2'));var fs=require('fs');var Redis=require(_0xf55e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf55e('0x4'));var logger=require(_0xf55e('0x5'))(_0xf55e('0x6'));var config=require(_0xf55e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf55e('0x8')][_0xf55e('0x9')]({'port':0x232a});config[_0xf55e('0xa')]=_['defaults'](config[_0xf55e('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf55e('0xa')]));require(_0xf55e('0xb'))[_0xf55e('0xc')](socket);function respondWithRpcPromise(_0x1e1375,_0x46450c,_0x3c8513){return new BPromise(function(_0x588009,_0x411ff2){return client[_0xf55e('0xd')](_0x1e1375,_0x3c8513)[_0xf55e('0xe')](function(_0x9f0421){logger[_0xf55e('0xf')](_0xf55e('0x10'),_0x46450c,'request\x20sent');logger[_0xf55e('0x11')](_0xf55e('0x12'),_0x46450c,_0xf55e('0x13'),JSON['stringify'](_0x9f0421));if(_0x9f0421[_0xf55e('0x14')]){if(_0x9f0421[_0xf55e('0x14')][_0xf55e('0x15')]===0x1f4){logger[_0xf55e('0x14')](_0xf55e('0x10'),_0x46450c,_0x9f0421[_0xf55e('0x14')][_0xf55e('0x16')]);return _0x411ff2(_0x9f0421[_0xf55e('0x14')]['message']);}logger['error'](_0xf55e('0x10'),_0x46450c,_0x9f0421[_0xf55e('0x14')][_0xf55e('0x16')]);return _0x588009(_0x9f0421[_0xf55e('0x14')]['message']);}else{logger[_0xf55e('0xf')]('UserNotification,\x20%s,\x20%s',_0x46450c,'request\x20sent');_0x588009(_0x9f0421[_0xf55e('0x17')][_0xf55e('0x16')]);}})[_0xf55e('0x18')](function(_0xa00b5f){logger[_0xf55e('0x14')]('UserNotification,\x20%s,\x20%s',_0x46450c,_0xa00b5f);_0x411ff2(_0xa00b5f);});});}
\ No newline at end of file
index a173ea7..09d638c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c8=['removeListener','register','length','./userNotification.events','remove','update','emit'];(function(_0x476c6c,_0x434db8){var _0xbb94db=function(_0x4be12){while(--_0x4be12){_0x476c6c['push'](_0x476c6c['shift']());}};_0xbb94db(++_0x434db8);}(_0xa2c8,0x9d));var _0x8a2c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa2c8[_0x14add3];return _0x4a174f;};'use strict';var UserNotificationEvents=require(_0x8a2c('0x0'));var events=['save',_0x8a2c('0x1'),_0x8a2c('0x2')];function createListener(_0x4b758a,_0x4b110f){return function(_0x5603a5){_0x4b110f[_0x8a2c('0x3')](_0x4b758a,_0x5603a5);};}function removeListener(_0x46f410,_0x327ed3){return function(){UserNotificationEvents[_0x8a2c('0x4')](_0x46f410,_0x327ed3);};}exports[_0x8a2c('0x5')]=function(_0x482ff5){for(var _0x18d4a1=0x0,_0x22e059=events[_0x8a2c('0x6')];_0x18d4a1<_0x22e059;_0x18d4a1++){var _0x1efa6b=events[_0x18d4a1];var _0x38c2b6=createListener('userNotification:'+_0x1efa6b,_0x482ff5);UserNotificationEvents['on'](_0x1efa6b,_0x38c2b6);}};
\ No newline at end of file
+var _0x5278=['update','emit','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x37639c,_0x548f82){var _0x23bb59=function(_0x2ae408){while(--_0x2ae408){_0x37639c['push'](_0x37639c['shift']());}};_0x23bb59(++_0x548f82);}(_0x5278,0xd1));var _0x8527=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5278[_0x422905];return _0x33dc6c;};'use strict';var UserNotificationEvents=require(_0x8527('0x0'));var events=['save','remove',_0x8527('0x1')];function createListener(_0x3e9025,_0x472e0f){return function(_0x54d678){_0x472e0f[_0x8527('0x2')](_0x3e9025,_0x54d678);};}function removeListener(_0x23aa29,_0x4d9d80){return function(){UserNotificationEvents[_0x8527('0x3')](_0x23aa29,_0x4d9d80);};}exports[_0x8527('0x4')]=function(_0x21ea53){for(var _0xc843c1=0x0,_0x42378c=events[_0x8527('0x5')];_0xc843c1<_0x42378c;_0xc843c1++){var _0x334c99=events[_0xc843c1];var _0x5ed560=createListener(_0x8527('0x6')+_0x334c99,_0x21ea53);UserNotificationEvents['on'](_0x334c99,_0x5ed560);}};
\ No newline at end of file
index 4f37a68..8a7c095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3e5a76,_0x1e2316){var _0x2b9bc6=function(_0x1218e3){while(--_0x1218e3){_0x3e5a76['push'](_0x3e5a76['shift']());}};_0x2b9bc6(++_0x1e2316);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 7c31ff0..35d8056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd05=['sequelize'];(function(_0x56ee15,_0x1effd1){var _0x94991f=function(_0x5018fa){while(--_0x5018fa){_0x56ee15['push'](_0x56ee15['shift']());}};_0x94991f(++_0x1effd1);}(_0xdd05,0xcb));var _0x5dd0=function(_0x128239,_0x30a688){_0x128239=_0x128239-0x0;var _0x5543df=_0xdd05[_0x128239];return _0x5543df;};'use strict';var Sequelize=require(_0x5dd0('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd7a2=['INTEGER','sequelize','exports'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xd7a2,0x18a));var _0x2d7a=function(_0x471a93,_0x56f59f){_0x471a93=_0x471a93-0x0;var _0x12731e=_0xd7a2[_0x471a93];return _0x12731e;};'use strict';var Sequelize=require(_0x2d7a('0x0'));module[_0x2d7a('0x1')]={'penalty':{'type':Sequelize[_0x2d7a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 8318ad8..d58e2e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafcd=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x5495b3,_0x10cd9a){var _0x5e6721=function(_0x3d08c2){while(--_0x3d08c2){_0x5495b3['push'](_0x5495b3['shift']());}};_0x5e6721(++_0x10cd9a);}(_0xafcd,0x1c3));var _0xdafc=function(_0x3f737b,_0x1d1f8b){_0x3f737b=_0x3f737b-0x0;var _0x404f7c=_0xafcd[_0x3f737b];return _0x404f7c;};'use strict';var _=require('lodash');var util=require(_0xdafc('0x0'));var logger=require(_0xdafc('0x1'))(_0xdafc('0x2'));var moment=require(_0xdafc('0x3'));var BPromise=require('bluebird');var rp=require(_0xdafc('0x4'));var fs=require('fs');var path=require(_0xdafc('0x5'));var rimraf=require(_0xdafc('0x6'));var config=require(_0xdafc('0x7'));var attributes=require(_0xdafc('0x8'));module[_0xdafc('0x9')]=function(_0x21a3df,_0x6cdb1){return _0x21a3df[_0xdafc('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0xdafc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x227a=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x227a,0x11a));var _0xa227=function(_0x3eb645,_0x303a80){_0x3eb645=_0x3eb645-0x0;var _0x2b5512=_0x227a[_0x3eb645];return _0x2b5512;};'use strict';var _=require(_0xa227('0x0'));var util=require(_0xa227('0x1'));var logger=require(_0xa227('0x2'))(_0xa227('0x3'));var moment=require(_0xa227('0x4'));var BPromise=require(_0xa227('0x5'));var rp=require(_0xa227('0x6'));var fs=require('fs');var path=require(_0xa227('0x7'));var rimraf=require(_0xa227('0x8'));var config=require('../../config/environment');var attributes=require(_0xa227('0x9'));module[_0xa227('0xa')]=function(_0x49e626,_0x4299dc){return _0x49e626[_0xa227('0xb')](_0xa227('0xc'),attributes,{'tableName':_0xa227('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 56b4a78..d3f55b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7258=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x270582,_0x45727d){var _0x316e7f=function(_0x136796){while(--_0x136796){_0x270582['push'](_0x270582['shift']());}};_0x316e7f(++_0x45727d);}(_0x7258,0x199));var _0x8725=function(_0x2e0b01,_0x2e74ad){_0x2e0b01=_0x2e0b01-0x0;var _0x43c76f=_0x7258[_0x2e0b01];return _0x43c76f;};'use strict';var _=require(_0x8725('0x0'));var util=require(_0x8725('0x1'));var moment=require(_0x8725('0x2'));var BPromise=require('bluebird');var rs=require(_0x8725('0x3'));var fs=require('fs');var Redis=require(_0x8725('0x4'));var db=require(_0x8725('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8725('0x6'))(_0x8725('0x7'));var config=require(_0x8725('0x8'));var jayson=require(_0x8725('0x9'));var client=jayson['client'][_0x8725('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37d72b,_0x410c67,_0x14544c){return new BPromise(function(_0x5dc47a,_0x1af691){return client[_0x8725('0xb')](_0x37d72b,_0x14544c)[_0x8725('0xc')](function(_0x119e19){logger[_0x8725('0xd')](_0x8725('0xe'),_0x410c67,'request\x20sent');logger['debug'](_0x8725('0xf'),_0x410c67,_0x8725('0x10'),JSON['stringify'](_0x119e19));if(_0x119e19[_0x8725('0x11')]){if(_0x119e19[_0x8725('0x11')]['code']===0x1f4){logger[_0x8725('0x11')](_0x8725('0xe'),_0x410c67,_0x119e19['error'][_0x8725('0x12')]);return _0x1af691(_0x119e19[_0x8725('0x11')][_0x8725('0x12')]);}logger[_0x8725('0x11')](_0x8725('0xe'),_0x410c67,_0x119e19[_0x8725('0x11')][_0x8725('0x12')]);return _0x5dc47a(_0x119e19['error']['message']);}else{logger[_0x8725('0xd')](_0x8725('0xe'),_0x410c67,_0x8725('0x10'));_0x5dc47a(_0x119e19[_0x8725('0x13')][_0x8725('0x12')]);}})[_0x8725('0x14')](function(_0x2ac737){logger[_0x8725('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x410c67,_0x2ac737);_0x1af691(_0x2ac737);});});}
\ No newline at end of file
+var _0x37ad=['../../config/environment','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x37ad,0x1b0));var _0xd37a=function(_0x5a31b6,_0x58f421){_0x5a31b6=_0x5a31b6-0x0;var _0x1c3523=_0x37ad[_0x5a31b6];return _0x1c3523;};'use strict';var _=require('lodash');var util=require(_0xd37a('0x0'));var moment=require(_0xd37a('0x1'));var BPromise=require('bluebird');var rs=require(_0xd37a('0x2'));var fs=require('fs');var Redis=require(_0xd37a('0x3'));var db=require(_0xd37a('0x4'))['db'];var utils=require(_0xd37a('0x5'));var logger=require(_0xd37a('0x6'))(_0xd37a('0x7'));var config=require(_0xd37a('0x8'));var jayson=require(_0xd37a('0x9'));var client=jayson[_0xd37a('0xa')][_0xd37a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2abd54,_0x2b38e7,_0x147284){return new BPromise(function(_0x6862a9,_0x2e4e3c){return client[_0xd37a('0xc')](_0x2abd54,_0x147284)['then'](function(_0x5d910d){logger[_0xd37a('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2b38e7,'request\x20sent');logger['debug'](_0xd37a('0xe'),_0x2b38e7,_0xd37a('0xf'),JSON['stringify'](_0x5d910d));if(_0x5d910d[_0xd37a('0x10')]){if(_0x5d910d[_0xd37a('0x10')][_0xd37a('0x11')]===0x1f4){logger['error'](_0xd37a('0x12'),_0x2b38e7,_0x5d910d['error'][_0xd37a('0x13')]);return _0x2e4e3c(_0x5d910d[_0xd37a('0x10')]['message']);}logger[_0xd37a('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2b38e7,_0x5d910d[_0xd37a('0x10')]['message']);return _0x6862a9(_0x5d910d['error']['message']);}else{logger['info'](_0xd37a('0x12'),_0x2b38e7,_0xd37a('0xf'));_0x6862a9(_0x5d910d[_0xd37a('0x14')][_0xd37a('0x13')]);}})[_0xd37a('0x15')](function(_0x858570){logger[_0xd37a('0x10')](_0xd37a('0x12'),_0x2b38e7,_0x858570);_0x2e4e3c(_0x858570);});});}
\ No newline at end of file
index f3677d9..09a265f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04dc=['/:id','show','getSections','/:id/resources','getResources','post','/:id/clone','addSections','addResources','put','delete','destroy','removeSections','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','/describe','isAuthenticated','describe'];(function(_0x27f614,_0x2b0fdc){var _0x533fe0=function(_0x2f42f5){while(--_0x2f42f5){_0x27f614['push'](_0x27f614['shift']());}};_0x533fe0(++_0x2b0fdc);}(_0x04dc,0xd2));var _0xc04d=function(_0x3f132a,_0x359822){_0x3f132a=_0x3f132a-0x0;var _0x224a39=_0x04dc[_0x3f132a];return _0x224a39;};'use strict';var multer=require(_0xc04d('0x0'));var util=require(_0xc04d('0x1'));var path=require(_0xc04d('0x2'));var timeout=require(_0xc04d('0x3'));var express=require(_0xc04d('0x4'));var router=express[_0xc04d('0x5')]();var fs_extra=require(_0xc04d('0x6'));var auth=require(_0xc04d('0x7'));var interaction=require(_0xc04d('0x8'));var config=require('../../config/environment');var controller=require(_0xc04d('0x9'));router[_0xc04d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc04d('0xa')](_0xc04d('0xb'),auth[_0xc04d('0xc')](),controller[_0xc04d('0xd')]);router['get'](_0xc04d('0xe'),auth[_0xc04d('0xc')](),controller[_0xc04d('0xf')]);router['get']('/:id/sections',auth[_0xc04d('0xc')](),controller[_0xc04d('0x10')]);router[_0xc04d('0xa')](_0xc04d('0x11'),auth['isAuthenticated'](),controller[_0xc04d('0x12')]);router[_0xc04d('0x13')]('/',auth[_0xc04d('0xc')](),controller['create']);router['post'](_0xc04d('0x14'),auth[_0xc04d('0xc')](),controller['clone']);router['post']('/:id/sections',auth[_0xc04d('0xc')](),controller[_0xc04d('0x15')]);router[_0xc04d('0x13')](_0xc04d('0x11'),auth[_0xc04d('0xc')](),controller[_0xc04d('0x16')]);router[_0xc04d('0x17')](_0xc04d('0xe'),auth[_0xc04d('0xc')](),controller['update']);router[_0xc04d('0x18')](_0xc04d('0xe'),auth[_0xc04d('0xc')](),controller[_0xc04d('0x19')]);router['delete']('/:id/sections',auth[_0xc04d('0xc')](),controller[_0xc04d('0x1a')]);router['delete'](_0xc04d('0x11'),auth[_0xc04d('0xc')](),controller['removeResources']);module[_0xc04d('0x1b')]=router;
\ No newline at end of file
+var _0x5e83=['post','/:id/clone','clone','addSections','addResources','put','delete','removeSections','removeResources','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','isAuthenticated','index','get','/describe','/:id','/:id/sections','getSections','/:id/resources','getResources','create'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0x5e83,0xb2));var _0x35e8=function(_0x5cb977,_0x13c79c){_0x5cb977=_0x5cb977-0x0;var _0x40c203=_0x5e83[_0x5cb977];return _0x40c203;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x35e8('0x0'));var timeout=require(_0x35e8('0x1'));var express=require(_0x35e8('0x2'));var router=express[_0x35e8('0x3')]();var fs_extra=require(_0x35e8('0x4'));var auth=require(_0x35e8('0x5'));var interaction=require(_0x35e8('0x6'));var config=require('../../config/environment');var controller=require(_0x35e8('0x7'));router['get']('/',auth[_0x35e8('0x8')](),controller[_0x35e8('0x9')]);router[_0x35e8('0xa')](_0x35e8('0xb'),auth[_0x35e8('0x8')](),controller['describe']);router['get'](_0x35e8('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x35e8('0xd'),auth[_0x35e8('0x8')](),controller[_0x35e8('0xe')]);router['get'](_0x35e8('0xf'),auth[_0x35e8('0x8')](),controller[_0x35e8('0x10')]);router['post']('/',auth[_0x35e8('0x8')](),controller[_0x35e8('0x11')]);router[_0x35e8('0x12')](_0x35e8('0x13'),auth[_0x35e8('0x8')](),controller[_0x35e8('0x14')]);router[_0x35e8('0x12')](_0x35e8('0xd'),auth[_0x35e8('0x8')](),controller[_0x35e8('0x15')]);router['post'](_0x35e8('0xf'),auth[_0x35e8('0x8')](),controller[_0x35e8('0x16')]);router[_0x35e8('0x17')](_0x35e8('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x35e8('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x35e8('0x18')](_0x35e8('0xd'),auth[_0x35e8('0x8')](),controller[_0x35e8('0x19')]);router[_0x35e8('0x18')]('/:id/resources',auth[_0x35e8('0x8')](),controller[_0x35e8('0x1a')]);module[_0x35e8('0x1b')]=router;
\ No newline at end of file
index 5917b25..01a6932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ac=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x33aae2,_0x58c8f0){var _0x3a65d7=function(_0x30cfa3){while(--_0x30cfa3){_0x33aae2['push'](_0x33aae2['shift']());}};_0x3a65d7(++_0x58c8f0);}(_0x24ac,0x1c1));var _0xc24a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24ac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc24a('0x0'));module[_0xc24a('0x1')]={'name':{'type':Sequelize[_0xc24a('0x2')],'allowNull':![],'unique':_0xc24a('0x3')},'crudPermissions':{'type':Sequelize[_0xc24a('0x2')],'set':function(_0x58542c){this[_0xc24a('0x4')](_0xc24a('0x5'),_0x58542c?_0x58542c[_0xc24a('0x6')](''):[]);},'get':function(){return this[_0xc24a('0x7')](_0xc24a('0x5'))?this[_0xc24a('0x7')]('crudPermissions')[_0xc24a('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc24a('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc24a('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc24a('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc24a('0x9')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xfe7f=['sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x55054d,_0x35adc6){var _0x5324fa=function(_0x348b0c){while(--_0x348b0c){_0x55054d['push'](_0x55054d['shift']());}};_0x5324fa(++_0x35adc6);}(_0xfe7f,0xcf));var _0xffe7=function(_0x22766f,_0x577e75){_0x22766f=_0x22766f-0x0;var _0x5e0773=_0xfe7f[_0x22766f];return _0x5e0773;};'use strict';var Sequelize=require(_0xffe7('0x0'));module[_0xffe7('0x1')]={'name':{'type':Sequelize[_0xffe7('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xffe7('0x2')],'set':function(_0x226d6c){this[_0xffe7('0x3')](_0xffe7('0x4'),_0x226d6c?_0x226d6c[_0xffe7('0x5')](''):[]);},'get':function(){return this[_0xffe7('0x6')](_0xffe7('0x4'))?this[_0xffe7('0x6')](_0xffe7('0x4'))[_0xffe7('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xffe7('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xffe7('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index 1d26d28..3e04b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c63=['resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','destroy','then','error','name','send','UserProfile','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','pick','where','merge','map','VIRTUAL','options','catch','show','params','keys','includeAll','clone','include','find','get','omit','createdAt','updatedAt','body','sequelize','create','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','transaction','push','ids','filter','enabled','includes','subsections','Dashboard','forEach'];(function(_0x9034be,_0x40f1bd){var _0x90cfba=function(_0x5f3abd){while(--_0x5f3abd){_0x9034be['push'](_0x9034be['shift']());}};_0x90cfba(++_0x40f1bd);}(_0x1c63,0xdc));var _0x31c6=function(_0x4c3593,_0x4ea381){_0x4c3593=_0x4c3593-0x0;var _0x1172d1=_0x1c63[_0x4c3593];return _0x1172d1;};'use strict';var emlformat=require(_0x31c6('0x0'));var rimraf=require(_0x31c6('0x1'));var zipdir=require(_0x31c6('0x2'));var jsonpatch=require(_0x31c6('0x3'));var rp=require('request-promise');var moment=require(_0x31c6('0x4'));var BPromise=require(_0x31c6('0x5'));var Mustache=require(_0x31c6('0x6'));var util=require('util');var path=require(_0x31c6('0x7'));var sox=require(_0x31c6('0x8'));var csv=require(_0x31c6('0x9'));var ejs=require(_0x31c6('0xa'));var fs=require('fs');var fs_extra=require(_0x31c6('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x31c6('0xc'));var jsforce=require(_0x31c6('0xd'));var deskjs=require(_0x31c6('0xe'));var toCsv=require(_0x31c6('0x9'));var querystring=require(_0x31c6('0xf'));var Papa=require('papaparse');var Redis=require(_0x31c6('0x10'));var authService=require(_0x31c6('0x11'));var qs=require(_0x31c6('0x12'));var as=require(_0x31c6('0x13'));var hardwareService=require(_0x31c6('0x14'));var logger=require('../../config/logger')(_0x31c6('0x15'));var utils=require('../../config/utils');var config=require(_0x31c6('0x16'));var licenseUtil=require(_0x31c6('0x17'));var db=require('../../mysqldb')['db'];config[_0x31c6('0x18')]=_[_0x31c6('0x19')](config[_0x31c6('0x18')],{'host':_0x31c6('0x1a'),'port':0x18eb});var socket=require(_0x31c6('0x1b'))(new Redis(config[_0x31c6('0x18')]));require('./userProfile.socket')[_0x31c6('0x1c')](socket);function respondWithStatusCode(_0x3995cc,_0x42c611){_0x42c611=_0x42c611||0xcc;return function(_0x28dbc9){if(_0x28dbc9){return _0x3995cc[_0x31c6('0x1d')](_0x42c611);}return _0x3995cc['status'](_0x42c611)['end']();};}function respondWithResult(_0x497264,_0x527b48){_0x527b48=_0x527b48||0xc8;return function(_0x3766df){if(_0x3766df){return _0x497264['status'](_0x527b48)[_0x31c6('0x1e')](_0x3766df);}};}function respondWithFilteredResult(_0x2a4780,_0x43b5cb){return function(_0xf352af){if(_0xf352af){var _0x20f9a2=typeof _0x43b5cb[_0x31c6('0x1f')]===_0x31c6('0x20')&&typeof _0x43b5cb[_0x31c6('0x21')]==='undefined';var _0x593d2b=_0xf352af['count'];var _0x9f02ae=_0x20f9a2?0x0:_0x43b5cb[_0x31c6('0x1f')];var _0x58dce5=_0x20f9a2?_0xf352af[_0x31c6('0x22')]:_0x43b5cb['offset']+_0x43b5cb['limit'];var _0x4070f6;if(_0x58dce5>=_0x593d2b){_0x58dce5=_0x593d2b;_0x4070f6=0xc8;}else{_0x4070f6=0xce;}_0x2a4780[_0x31c6('0x23')](_0x4070f6);return _0x2a4780['set'](_0x31c6('0x24'),_0x9f02ae+'-'+_0x58dce5+'/'+_0x593d2b)[_0x31c6('0x1e')](_0xf352af);}return null;};}function patchUpdates(_0x392723){return function(_0x4632f6){try{jsonpatch[_0x31c6('0x25')](_0x4632f6,_0x392723,!![]);}catch(_0x509bed){return BPromise[_0x31c6('0x26')](_0x509bed);}return _0x4632f6['save']();};}function saveUpdates(_0x8773d4,_0x178973){return function(_0x5cc043){if(_0x5cc043){return _0x5cc043['update'](_0x8773d4)['then'](function(_0x412a8a){return _0x412a8a;});}return null;};}function removeEntity(_0x250ab1,_0x551291){return function(_0x8a608b){if(_0x8a608b){return _0x8a608b[_0x31c6('0x27')]()[_0x31c6('0x28')](function(){_0x250ab1[_0x31c6('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x542209,_0x559f65){return function(_0x53fa6c){if(!_0x53fa6c){_0x542209[_0x31c6('0x1d')](0x194);}return _0x53fa6c;};}function handleError(_0x4aa110,_0x5f283d){_0x5f283d=_0x5f283d||0x1f4;return function(_0x1e24fa){logger[_0x31c6('0x29')](_0x1e24fa['stack']);if(_0x1e24fa[_0x31c6('0x2a')]){delete _0x1e24fa['name'];}_0x4aa110[_0x31c6('0x23')](_0x5f283d)[_0x31c6('0x2b')](_0x1e24fa);};}exports['index']=function(_0x1d114e,_0x3840de){var _0x28937c={},_0x3399fe={},_0x202f45={'count':0x0,'rows':[]};var _0x35c366=_['map'](db[_0x31c6('0x2c')][_0x31c6('0x2d')],function(_0x49fda2){return{'name':_0x49fda2[_0x31c6('0x2e')],'type':_0x49fda2[_0x31c6('0x2f')]['key']};});_0x3399fe['model']=_['map'](_0x35c366,_0x31c6('0x2a'));_0x3399fe[_0x31c6('0x30')]=_['keys'](_0x1d114e[_0x31c6('0x30')]);_0x3399fe[_0x31c6('0x31')]=_[_0x31c6('0x32')](_0x3399fe[_0x31c6('0x33')],_0x3399fe[_0x31c6('0x30')]);_0x28937c['attributes']=_[_0x31c6('0x32')](_0x3399fe[_0x31c6('0x33')],qs[_0x31c6('0x34')](_0x1d114e[_0x31c6('0x30')][_0x31c6('0x34')]));_0x28937c[_0x31c6('0x35')]=_0x28937c[_0x31c6('0x35')][_0x31c6('0x36')]?_0x28937c[_0x31c6('0x35')]:_0x3399fe['model'];if(!_0x1d114e[_0x31c6('0x30')][_0x31c6('0x37')]('nolimit')){_0x28937c[_0x31c6('0x21')]=qs[_0x31c6('0x21')](_0x1d114e['query'][_0x31c6('0x21')]);_0x28937c[_0x31c6('0x1f')]=qs[_0x31c6('0x1f')](_0x1d114e['query'][_0x31c6('0x1f')]);}_0x28937c['order']=qs[_0x31c6('0x38')](_0x1d114e[_0x31c6('0x30')][_0x31c6('0x38')]);_0x28937c['where']=qs[_0x31c6('0x31')](_[_0x31c6('0x39')](_0x1d114e[_0x31c6('0x30')],_0x3399fe[_0x31c6('0x31')]),_0x35c366);if(_0x1d114e['query']['filter']){_0x28937c[_0x31c6('0x3a')]=_[_0x31c6('0x3b')](_0x28937c[_0x31c6('0x3a')],{'$or':_[_0x31c6('0x3c')](_0x35c366,function(_0x1f4dd3){if(_0x1f4dd3[_0x31c6('0x2f')]!==_0x31c6('0x3d')){var _0x26dbf4={};_0x26dbf4[_0x1f4dd3[_0x31c6('0x2a')]]={'$like':'%'+_0x1d114e[_0x31c6('0x30')]['filter']+'%'};return _0x26dbf4;}})});}_0x28937c=_[_0x31c6('0x3b')]({},_0x28937c,_0x1d114e[_0x31c6('0x3e')]);var _0x4b2037={'where':_0x28937c['where']};return db[_0x31c6('0x2c')][_0x31c6('0x22')](_0x4b2037)[_0x31c6('0x28')](function(_0xd85393){_0x202f45[_0x31c6('0x22')]=_0xd85393;if(_0x1d114e[_0x31c6('0x30')]['includeAll']){_0x28937c['include']=[{'all':!![]}];}return db[_0x31c6('0x2c')]['findAll'](_0x28937c);})[_0x31c6('0x28')](function(_0x1f0b73){_0x202f45['rows']=_0x1f0b73;return _0x202f45;})[_0x31c6('0x28')](respondWithFilteredResult(_0x3840de,_0x28937c))[_0x31c6('0x3f')](handleError(_0x3840de,null));};exports[_0x31c6('0x40')]=function(_0x37cbed,_0x285940){var _0x43a3ca={'raw':![],'where':{'id':_0x37cbed[_0x31c6('0x41')]['id']}},_0x562ddb={};_0x562ddb[_0x31c6('0x33')]=_[_0x31c6('0x42')](db[_0x31c6('0x2c')][_0x31c6('0x2d')]);_0x562ddb['query']=_[_0x31c6('0x42')](_0x37cbed[_0x31c6('0x30')]);_0x562ddb[_0x31c6('0x31')]=_[_0x31c6('0x32')](_0x562ddb['model'],_0x562ddb[_0x31c6('0x30')]);_0x43a3ca['attributes']=_[_0x31c6('0x32')](_0x562ddb[_0x31c6('0x33')],qs[_0x31c6('0x34')](_0x37cbed[_0x31c6('0x30')][_0x31c6('0x34')]));_0x43a3ca['attributes']=_0x43a3ca[_0x31c6('0x35')][_0x31c6('0x36')]?_0x43a3ca[_0x31c6('0x35')]:_0x562ddb[_0x31c6('0x33')];if(_0x37cbed[_0x31c6('0x30')][_0x31c6('0x43')]){_0x43a3ca['include']=[{'all':!![]}];}_0x43a3ca=_[_0x31c6('0x3b')]({},_0x43a3ca,_0x37cbed['options']);return db[_0x31c6('0x2c')]['find'](_0x43a3ca)['then'](handleEntityNotFound(_0x285940,null))[_0x31c6('0x28')](respondWithResult(_0x285940,null))[_0x31c6('0x3f')](handleError(_0x285940,null));};exports['create']=function(_0xf33b6c,_0x129197){return db[_0x31c6('0x2c')]['create'](_0xf33b6c['body'],{})[_0x31c6('0x28')](respondWithResult(_0x129197,0xc9))[_0x31c6('0x3f')](handleError(_0x129197,null));};exports[_0x31c6('0x44')]=function(_0x344192,_0xbb1229){var _0x2866c8={'where':{'id':_0x344192[_0x31c6('0x41')]['id']}},_0x30ec7a={};_0x30ec7a[_0x31c6('0x33')]=_[_0x31c6('0x42')](db[_0x31c6('0x2c')][_0x31c6('0x2d')]);_0x2866c8['attributes']=_['intersection'](_0x30ec7a['model'],qs[_0x31c6('0x34')](_0x344192[_0x31c6('0x30')][_0x31c6('0x34')]));_0x2866c8[_0x31c6('0x35')]=_0x2866c8[_0x31c6('0x35')][_0x31c6('0x36')]?_0x2866c8[_0x31c6('0x35')]:_0x30ec7a['model'];if(_0x344192['query'][_0x31c6('0x43')]){_0x2866c8[_0x31c6('0x45')]=[{'all':!![]}];}_0x2866c8=_[_0x31c6('0x3b')]({},_0x2866c8,_0x344192[_0x31c6('0x3e')]);return db['UserProfile'][_0x31c6('0x46')](_0x2866c8)[_0x31c6('0x28')](handleEntityNotFound(_0xbb1229,null))['then'](function(_0x4eabd8){if(_0x4eabd8){var _0x48e0c8=_0x4eabd8[_0x31c6('0x47')]({'plain':!![]});_0x48e0c8=qs[_0x31c6('0x48')](_0x48e0c8,['id',_0x31c6('0x49'),_0x31c6('0x4a'),'crudPermissions']);_0x344192['body']=_[_0x31c6('0x48')](_0x344192[_0x31c6('0x4b')],['id','createdAt','updatedAt']);return db[_0x31c6('0x4c')]['transaction'](function(_0x17afcf){return db[_0x31c6('0x2c')][_0x31c6('0x4d')](_['merge'](_0x48e0c8,_0x344192['body']),{'include':_0x344192['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x17afcf})[_0x31c6('0x28')](function(_0x54562a){var _0x3145a9=_0x54562a[_0x31c6('0x47')]({'plain':!![]});return db[_0x31c6('0x4e')][_0x31c6('0x4f')]({'where':{'userProfileId':_0x344192['params']['id']},'raw':!![]})[_0x31c6('0x28')](function(_0x4bc617){if(_0x4bc617){return BPromise[_0x31c6('0x50')](_0x4bc617,function(_0x54e307){return new BPromise(function(_0x2d6f31,_0x9d12bc){if(_0x54e307[_0x31c6('0x51')]===null||_0x54e307['autoAssociation']===0x1)_0x2d6f31(null);return db[_0x31c6('0x52')][_0x31c6('0x4f')]({'where':{'sectionId':_0x54e307['id']},'raw':!![]})[_0x31c6('0x28')](function(_0x386bab){var _0x97c1d2=_['map'](_0x386bab,function(_0x2d6d50){return qs[_0x31c6('0x48')](_0x2d6d50,['id','createdAt','updatedAt',_0x31c6('0x53')]);});_0x2d6f31(_0x97c1d2);})[_0x31c6('0x3f')](function(_0x5743ae){_0x9d12bc(_0x5743ae);});})['then'](function(_0x40b35e){var _0x520053=qs[_0x31c6('0x48')](_0x54e307,['id',_0x31c6('0x49'),_0x31c6('0x4a')]);_0x520053[_0x31c6('0x54')]=_0x3145a9['id'];if(_0x40b35e)_0x520053[_0x31c6('0x55')]=_0x40b35e;return _0x520053;})[_0x31c6('0x28')](function(_0x2449c1){return db[_0x31c6('0x4e')][_0x31c6('0x4d')](_0x2449c1,{'include':[{'model':db['UserProfileResource'],'as':_0x31c6('0x55')}],'raw':!![],'transaction':_0x17afcf});});})[_0x31c6('0x28')](function(){return _0x3145a9;});}});});});}})['then'](respondWithResult(_0xbb1229,0xc9))[_0x31c6('0x3f')](handleError(_0xbb1229,null));};exports[_0x31c6('0x56')]=function(_0x3f6854,_0x423fab){if(_0x3f6854[_0x31c6('0x4b')]['id']){delete _0x3f6854[_0x31c6('0x4b')]['id'];}return db[_0x31c6('0x2c')][_0x31c6('0x46')]({'where':{'id':_0x3f6854['params']['id']}})[_0x31c6('0x28')](handleEntityNotFound(_0x423fab,null))[_0x31c6('0x28')](saveUpdates(_0x3f6854[_0x31c6('0x4b')],null))[_0x31c6('0x28')](respondWithResult(_0x423fab,null))[_0x31c6('0x3f')](handleError(_0x423fab,null));};exports[_0x31c6('0x27')]=function(_0x54ddb7,_0x2c10c3){return db[_0x31c6('0x2c')]['find']({'where':{'id':_0x54ddb7[_0x31c6('0x41')]['id']}})[_0x31c6('0x28')](handleEntityNotFound(_0x2c10c3,null))[_0x31c6('0x28')](removeEntity(_0x2c10c3,null))['catch'](handleError(_0x2c10c3,null));};exports[_0x31c6('0x57')]=function(_0x3152ea,_0x52c015){return db[_0x31c6('0x2c')][_0x31c6('0x57')]()['then'](respondWithResult(_0x52c015,null))[_0x31c6('0x3f')](handleError(_0x52c015,null));};exports[_0x31c6('0x58')]=function(_0x6f22cd,_0x32400c){var _0x222b63=_0x6f22cd['body'];return db[_0x31c6('0x2c')][_0x31c6('0x46')]({'where':{'id':_0x6f22cd['params']['id']}})['then'](handleEntityNotFound(_0x32400c,null))['then'](function(_0x3c08dc){if(_0x3c08dc){return db[_0x31c6('0x4c')][_0x31c6('0x59')](function(_0x55d404){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x6f22cd['params']['id'],'sectionId':_[_0x31c6('0x3c')](_0x222b63,function(_0x32edc5){return _0x32edc5[_0x31c6('0x53')];})},'transaction':_0x55d404})[_0x31c6('0x28')](function(){var _0x2d49cb=_[_0x31c6('0x3c')](_0x222b63,function(_0x491c05){_0x491c05[_0x31c6('0x54')]=_0x6f22cd[_0x31c6('0x41')]['id'];return _0x491c05;});var _0x339e85=[];return BPromise[_0x31c6('0x50')](_0x2d49cb,function(_0x31d73b){return db[_0x31c6('0x4e')]['create'](_0x31d73b,{'include':[{'model':db[_0x31c6('0x52')],'as':_0x31c6('0x55')}],'raw':!![],'transaction':_0x55d404})[_0x31c6('0x28')](function(_0x5b9eb5){_0x339e85[_0x31c6('0x5a')](_0x5b9eb5['get']({'plain':!![]}));});})[_0x31c6('0x28')](function(){return _0x339e85;});});});}})[_0x31c6('0x28')](function(_0x5f0e68){return _0x5f0e68;})[_0x31c6('0x28')](respondWithResult(_0x32400c,null))['catch'](handleError(_0x32400c,null));};exports['removeSections']=function(_0x59d255,_0x47efe7){var _0x4c0faa;return db[_0x31c6('0x2c')][_0x31c6('0x46')]({'where':{'id':_0x59d255['params']['id']},'attributes':['id',_0x31c6('0x2a')]})[_0x31c6('0x28')](handleEntityNotFound(_0x47efe7,null))['then'](function(_0x599d8a){if(_0x599d8a){_0x4c0faa=_0x599d8a;return db[_0x31c6('0x4e')][_0x31c6('0x27')]({'where':{'userProfileId':_0x59d255[_0x31c6('0x41')]['id'],'sectionId':_0x59d255[_0x31c6('0x30')][_0x31c6('0x5b')]}});}})[_0x31c6('0x28')](function(){return _0x4c0faa;})[_0x31c6('0x28')](respondWithStatusCode(_0x47efe7,null))[_0x31c6('0x3f')](handleError(_0x47efe7,null));};exports['getSections']=function(_0xcd9022,_0x5631d6){var _0xea2495=[];var _0x1f879d=[];return db[_0x31c6('0x4e')][_0x31c6('0x4f')]({'where':{'userProfileId':_0xcd9022[_0x31c6('0x41')]['id']},'raw':!![]})['then'](function(_0x51fb4c){_0xea2495=_[_0x31c6('0x5c')](_0x51fb4c,function(_0x4d2a60){return _0x4d2a60[_0x31c6('0x5d')]===0x1||_[_0x31c6('0x5e')]([0x3eb,0x709],_0x4d2a60[_0x31c6('0x53')]);});if(!_['isEmpty'](_0xea2495)){return _[_0x31c6('0x3c')](_0xea2495,function(_0x2b1860){return _0x2b1860[_0x31c6('0x53')];});}else{return;}})[_0x31c6('0x28')](function(_0xf350de){if(_0xf350de)_0x1f879d=_0xf350de;if(_[_0x31c6('0x5e')](_0x1f879d,0x64)){var _0x210fe2=_[_0x31c6('0x46')](_0xea2495,{'sectionId':0x64});return hasDefaultDashboard(_0x210fe2)[_0x31c6('0x28')](function(_0x2dbb68){return _[_0x31c6('0x3c')](_0xea2495,function(_0x43018c){if(_0x43018c['sectionId']===0x64){_0x43018c[_0x31c6('0x5f')]=_0x2dbb68;}return _0x43018c;});});}else{return;}})[_0x31c6('0x28')](function(_0x4a6472){if(_0x4a6472)_0xea2495=_0x4a6472;if(_[_0x31c6('0x5e')](_0x1f879d,0x3eb)){var _0x47b744=_[_0x31c6('0x46')](_0xea2495,{'sectionId':0x3eb});return getCustomDashboards(_0x47b744)[_0x31c6('0x28')](function(_0x11a64b){return _[_0x31c6('0x3c')](_0xea2495,function(_0x395440){if(_0x47b744[_0x31c6('0x5d')]){if(_0x395440[_0x31c6('0x53')]===0x3eb){_0x395440[_0x31c6('0x5f')]=_0x11a64b;}}else{if(_0x395440[_0x31c6('0x53')]===0x64){_0x395440[_0x31c6('0x5f')]=_0x11a64b;}}return _0x395440;});});}else{return;}})[_0x31c6('0x28')](function(_0x26cbf4){if(_0x26cbf4)_0xea2495=_0x26cbf4;if(_[_0x31c6('0x5e')](_0x1f879d,0x709)){var _0x3caa69=_['find'](_0xea2495,{'sectionId':0x709});return getPlugins(_0x3caa69)[_0x31c6('0x28')](function(_0x3f933){if(_0x3caa69[_0x31c6('0x5d')]){return _[_0x31c6('0x3c')](_0xea2495,function(_0x5072b8){if(_0x5072b8[_0x31c6('0x53')]===0x709){_0x5072b8[_0x31c6('0x5f')]=_0x3f933;}return _0x5072b8;});}else{var _0x3411c7={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3f933};var _0x4eb461=_[_0x31c6('0x3c')](_0xea2495);_0x4eb461[_0x31c6('0x5a')](_0x3411c7);return _0x4eb461;}});}else{return;}})[_0x31c6('0x28')](function(_0x4a7339){if(_0x4a7339)_0xea2495=_0x4a7339;return _[_0x31c6('0x5c')](_0xea2495,[_0x31c6('0x5d'),0x1]);})[_0x31c6('0x28')](respondWithResult(_0x5631d6,null))[_0x31c6('0x3f')](handleError(_0x5631d6,null));};function hasDefaultDashboard(_0x22c39d){var _0x2fdc0e=[0x65];return new BPromise(function(_0x2aac26,_0x1356c4){try{if(_0x22c39d[_0x31c6('0x51')]){_0x2aac26(_0x2fdc0e);}else{return db[_0x31c6('0x52')]['findOne']({'where':{'sectionId':_0x22c39d['id']},'raw':!![]})[_0x31c6('0x28')](function(_0x4cfbe8){_0x4cfbe8?_0x2aac26(_0x2fdc0e):_0x2aac26();});}}catch(_0x3a6f2a){_0x1356c4(_0x3a6f2a);}});}function getCustomDashboards(_0x57e52d){var _0x2ce3db=[];return new BPromise(function(_0xecc8c,_0x5e1071){try{if(_0x57e52d[_0x31c6('0x51')]){return db[_0x31c6('0x60')][_0x31c6('0x4f')]({'raw':!![]})['then'](function(_0x1d81a6){_0x1d81a6[_0x31c6('0x61')](function(_0x61409a){_0x2ce3db[_0x31c6('0x5a')](_0x61409a['id']+0x1869f);});_0xecc8c(_0x2ce3db);});}else{return db['UserProfileResource'][_0x31c6('0x4f')]({'where':{'sectionId':_0x57e52d['id']},'raw':!![]})['then'](function(_0x2d5751){_0x2d5751[_0x31c6('0x61')](function(_0x2d2af1){_0x2ce3db[_0x31c6('0x5a')](_0x2d2af1[_0x31c6('0x62')]+0x1869f);});_0xecc8c(_0x2ce3db);});}}catch(_0x39a8ed){_0x5e1071(_0x39a8ed);}});}function getPlugins(_0x28f922){var _0x3132c4=[];return new BPromise(function(_0x4606ca,_0x100413){try{if(_0x28f922[_0x31c6('0x51')]){return db[_0x31c6('0x63')][_0x31c6('0x4f')]({'raw':!![]})[_0x31c6('0x28')](function(_0x40e8b1){_0x40e8b1['forEach'](function(_0x2a9035){_0x3132c4['push'](_0x2a9035['id']+0x15b38);});_0x4606ca(_0x3132c4);});}else{return db['UserProfileResource'][_0x31c6('0x4f')]({'where':{'sectionId':_0x28f922['id']},'raw':!![]})[_0x31c6('0x28')](function(_0x56b7ea){_0x56b7ea[_0x31c6('0x61')](function(_0x22c68c){_0x3132c4[_0x31c6('0x5a')](_0x22c68c[_0x31c6('0x62')]+0x15b38);});_0x4606ca(_0x3132c4);});}}catch(_0x10d9cd){_0x100413(_0x10d9cd);}});}exports[_0x31c6('0x64')]=function(_0x28144b,_0x2dd4da){return db[_0x31c6('0x2c')][_0x31c6('0x46')]({'where':{'id':_0x28144b[_0x31c6('0x41')]['id']}})[_0x31c6('0x28')](handleEntityNotFound(_0x2dd4da,null))['then'](function(_0x6befd0){if(_0x6befd0){return db[_0x31c6('0x4c')][_0x31c6('0x59')](function(_0x5bf117){return db[_0x31c6('0x4e')][_0x31c6('0x4f')]({'where':{'userProfileId':_0x28144b[_0x31c6('0x41')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x43c36d){if(_0x43c36d){return db[_0x31c6('0x4e')][_0x31c6('0x27')]({'where':{'userProfileId':_0x28144b['params']['id'],'id':_[_0x31c6('0x3c')](_0x43c36d,function(_0x323107){return _0x323107['id'];})},'transaction':_0x5bf117});}})[_0x31c6('0x28')](function(_0x4dae3c){var _0x205917=_[_0x31c6('0x3c')](_0x28144b[_0x31c6('0x4b')],function(_0x488787){_0x488787['userProfileId']=_0x28144b[_0x31c6('0x41')]['id'];return _0x488787;});return db[_0x31c6('0x4e')]['bulkCreate'](_0x205917,{'raw':!![],'transaction':_0x5bf117});})['then'](function(_0xee4de8){var _0x467d88=_['filter'](_[_0x31c6('0x3c')](_0xee4de8,function(_0x483467){return _0x483467[_0x31c6('0x47')]({'plain':!![]});}),{'includeAll':![]});if(_0x467d88){return db['UserProfileSection'][_0x31c6('0x4f')]({'where':{'userProfileId':_0x28144b[_0x31c6('0x41')]['id'],'sectionId':_[_0x31c6('0x3c')](_0x467d88,function(_0x184408){return _0x184408[_0x31c6('0x53')];})},'attributes':['id',_0x31c6('0x53')],'raw':!![]})[_0x31c6('0x28')](function(_0x4d1d5c){var _0xb37982=_[_0x31c6('0x3c')](_0x28144b[_0x31c6('0x4b')],function(_0x1024e1){_0x1024e1[_0x31c6('0x54')]=_0x28144b[_0x31c6('0x41')]['id'];return _0x1024e1;});return db[_0x31c6('0x52')][_0x31c6('0x65')](_0xb37982,{'raw':!![],'transaction':_0x5bf117});});}})[_0x31c6('0x3f')](handleError(_0x2dd4da,null));});}})[_0x31c6('0x28')](function(_0x215153){var _0xc68346=_['map'](_0x215153,function(_0x252dc3){return _0x252dc3[_0x31c6('0x47')]({'plain':!![]});});})[_0x31c6('0x28')](respondWithResult(_0x2dd4da,null))[_0x31c6('0x3f')](handleError(_0x2dd4da,null));};exports[_0x31c6('0x66')]=function(_0x546c3e,_0x29b287,_0x7c2246){return db[_0x31c6('0x2c')][_0x31c6('0x46')]({'where':{'id':_0x546c3e[_0x31c6('0x41')]['id']}})[_0x31c6('0x28')](handleEntityNotFound(_0x29b287,null))[_0x31c6('0x28')](function(_0x5a5a68){if(_0x5a5a68){return _0x5a5a68['removeResources'](_0x546c3e[_0x31c6('0x30')][_0x31c6('0x5b')]);}})['then'](respondWithStatusCode(_0x29b287,null))[_0x31c6('0x3f')](handleError(_0x29b287,null));};exports[_0x31c6('0x67')]=function(_0x212bc3,_0x3aa56a){var _0x49d2af={};if(!_0x212bc3['query'][_0x31c6('0x68')])throw new Error(_0x31c6('0x69'));if(!_0x212bc3[_0x31c6('0x30')]['hasOwnProperty']('nolimit')){_0x49d2af[_0x31c6('0x21')]=qs[_0x31c6('0x21')](_0x212bc3[_0x31c6('0x30')][_0x31c6('0x21')]);_0x49d2af[_0x31c6('0x1f')]=qs[_0x31c6('0x1f')](_0x212bc3[_0x31c6('0x30')][_0x31c6('0x1f')]);}return db[_0x31c6('0x2c')][_0x31c6('0x46')]({'where':{'id':_0x212bc3[_0x31c6('0x41')]['id']}})['then'](function(_0x135bf5){if(!_0x135bf5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x212bc3[_0x31c6('0x41')]['id']);return db[_0x31c6('0x2c')][_0x31c6('0x67')](_0x212bc3);})['then'](respondWithFilteredResult(_0x3aa56a,_0x49d2af))[_0x31c6('0x3f')](handleError(_0x3aa56a,null));};
\ No newline at end of file
+var _0x8f25=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','length','options','find','body','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','create','get','UserProfileSection','autoAssociation','UserProfileResource','userProfileId','destroy','describe','sectionId','Resources','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x8f25,0x14b));var _0x58f2=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x8f25[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x58f2('0x0'));var rimraf=require(_0x58f2('0x1'));var zipdir=require(_0x58f2('0x2'));var jsonpatch=require(_0x58f2('0x3'));var rp=require(_0x58f2('0x4'));var moment=require(_0x58f2('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x58f2('0x6'));var sox=require(_0x58f2('0x7'));var csv=require(_0x58f2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x58f2('0x9'));var _=require(_0x58f2('0xa'));var squel=require(_0x58f2('0xb'));var crypto=require(_0x58f2('0xc'));var jsforce=require(_0x58f2('0xd'));var deskjs=require(_0x58f2('0xe'));var toCsv=require(_0x58f2('0x8'));var querystring=require(_0x58f2('0xf'));var Papa=require('papaparse');var Redis=require(_0x58f2('0x10'));var authService=require(_0x58f2('0x11'));var qs=require(_0x58f2('0x12'));var as=require(_0x58f2('0x13'));var hardwareService=require(_0x58f2('0x14'));var logger=require('../../config/logger')(_0x58f2('0x15'));var utils=require(_0x58f2('0x16'));var config=require(_0x58f2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x58f2('0x18'))['db'];config[_0x58f2('0x19')]=_['defaults'](config[_0x58f2('0x19')],{'host':_0x58f2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58f2('0x19')]));require(_0x58f2('0x1b'))[_0x58f2('0x1c')](socket);function respondWithStatusCode(_0x250c1c,_0x879d54){_0x879d54=_0x879d54||0xcc;return function(_0x1dc4ac){if(_0x1dc4ac){return _0x250c1c[_0x58f2('0x1d')](_0x879d54);}return _0x250c1c[_0x58f2('0x1e')](_0x879d54)[_0x58f2('0x1f')]();};}function respondWithResult(_0x21db0c,_0x256f1f){_0x256f1f=_0x256f1f||0xc8;return function(_0x3f9991){if(_0x3f9991){return _0x21db0c['status'](_0x256f1f)[_0x58f2('0x20')](_0x3f9991);}};}function respondWithFilteredResult(_0x4e7fc9,_0x2042bf){return function(_0x1db4ad){if(_0x1db4ad){var _0x4e66a4=typeof _0x2042bf['offset']==='undefined'&&typeof _0x2042bf['limit']===_0x58f2('0x21');var _0x16523e=_0x1db4ad[_0x58f2('0x22')];var _0xf66efd=_0x4e66a4?0x0:_0x2042bf[_0x58f2('0x23')];var _0x1db5fd=_0x4e66a4?_0x1db4ad['count']:_0x2042bf[_0x58f2('0x23')]+_0x2042bf[_0x58f2('0x24')];var _0x4c537f;if(_0x1db5fd>=_0x16523e){_0x1db5fd=_0x16523e;_0x4c537f=0xc8;}else{_0x4c537f=0xce;}_0x4e7fc9[_0x58f2('0x1e')](_0x4c537f);return _0x4e7fc9[_0x58f2('0x25')]('Content-Range',_0xf66efd+'-'+_0x1db5fd+'/'+_0x16523e)[_0x58f2('0x20')](_0x1db4ad);}return null;};}function patchUpdates(_0xdee848){return function(_0x38e0b8){try{jsonpatch[_0x58f2('0x26')](_0x38e0b8,_0xdee848,!![]);}catch(_0x16fa72){return BPromise[_0x58f2('0x27')](_0x16fa72);}return _0x38e0b8[_0x58f2('0x28')]();};}function saveUpdates(_0x29d70b,_0x3f81c1){return function(_0x8fad73){if(_0x8fad73){return _0x8fad73[_0x58f2('0x29')](_0x29d70b)[_0x58f2('0x2a')](function(_0x34a2e2){return _0x34a2e2;});}return null;};}function removeEntity(_0xb5f201,_0x1224f1){return function(_0x422aa0){if(_0x422aa0){return _0x422aa0['destroy']()[_0x58f2('0x2a')](function(){_0xb5f201['status'](0xcc)[_0x58f2('0x1f')]();});}};}function handleEntityNotFound(_0x1692cb,_0x2ec718){return function(_0x55e50a){if(!_0x55e50a){_0x1692cb[_0x58f2('0x1d')](0x194);}return _0x55e50a;};}function handleError(_0x44700f,_0x46db2e){_0x46db2e=_0x46db2e||0x1f4;return function(_0x58433b){logger[_0x58f2('0x2b')](_0x58433b[_0x58f2('0x2c')]);if(_0x58433b['name']){delete _0x58433b[_0x58f2('0x2d')];}_0x44700f[_0x58f2('0x1e')](_0x46db2e)[_0x58f2('0x2e')](_0x58433b);};}exports[_0x58f2('0x2f')]=function(_0x5a6296,_0x46386a){var _0x492db5={},_0x2633f8={},_0x128af8={'count':0x0,'rows':[]};var _0x8f339d=_[_0x58f2('0x30')](db[_0x58f2('0x31')][_0x58f2('0x32')],function(_0x5f3b55){return{'name':_0x5f3b55[_0x58f2('0x33')],'type':_0x5f3b55[_0x58f2('0x34')][_0x58f2('0x35')]};});_0x2633f8['model']=_[_0x58f2('0x30')](_0x8f339d,_0x58f2('0x2d'));_0x2633f8['query']=_[_0x58f2('0x36')](_0x5a6296[_0x58f2('0x37')]);_0x2633f8[_0x58f2('0x38')]=_[_0x58f2('0x39')](_0x2633f8[_0x58f2('0x3a')],_0x2633f8['query']);_0x492db5[_0x58f2('0x3b')]=_[_0x58f2('0x39')](_0x2633f8[_0x58f2('0x3a')],qs[_0x58f2('0x3c')](_0x5a6296[_0x58f2('0x37')][_0x58f2('0x3c')]));_0x492db5[_0x58f2('0x3b')]=_0x492db5['attributes']['length']?_0x492db5[_0x58f2('0x3b')]:_0x2633f8[_0x58f2('0x3a')];if(!_0x5a6296[_0x58f2('0x37')][_0x58f2('0x3d')]('nolimit')){_0x492db5[_0x58f2('0x24')]=qs['limit'](_0x5a6296['query'][_0x58f2('0x24')]);_0x492db5[_0x58f2('0x23')]=qs['offset'](_0x5a6296[_0x58f2('0x37')][_0x58f2('0x23')]);}_0x492db5[_0x58f2('0x3e')]=qs[_0x58f2('0x3f')](_0x5a6296[_0x58f2('0x37')][_0x58f2('0x3f')]);_0x492db5[_0x58f2('0x40')]=qs['filters'](_[_0x58f2('0x41')](_0x5a6296['query'],_0x2633f8[_0x58f2('0x38')]),_0x8f339d);if(_0x5a6296[_0x58f2('0x37')][_0x58f2('0x42')]){_0x492db5[_0x58f2('0x40')]=_['merge'](_0x492db5[_0x58f2('0x40')],{'$or':_[_0x58f2('0x30')](_0x8f339d,function(_0x3f0af2){if(_0x3f0af2[_0x58f2('0x34')]!==_0x58f2('0x43')){var _0x20a3c8={};_0x20a3c8[_0x3f0af2[_0x58f2('0x2d')]]={'$like':'%'+_0x5a6296[_0x58f2('0x37')][_0x58f2('0x42')]+'%'};return _0x20a3c8;}})});}_0x492db5=_[_0x58f2('0x44')]({},_0x492db5,_0x5a6296['options']);var _0x5299ab={'where':_0x492db5[_0x58f2('0x40')]};return db[_0x58f2('0x31')]['count'](_0x5299ab)[_0x58f2('0x2a')](function(_0x2891f6){_0x128af8[_0x58f2('0x22')]=_0x2891f6;if(_0x5a6296[_0x58f2('0x37')][_0x58f2('0x45')]){_0x492db5[_0x58f2('0x46')]=[{'all':!![]}];}return db['UserProfile'][_0x58f2('0x47')](_0x492db5);})[_0x58f2('0x2a')](function(_0x966735){_0x128af8[_0x58f2('0x48')]=_0x966735;return _0x128af8;})[_0x58f2('0x2a')](respondWithFilteredResult(_0x46386a,_0x492db5))[_0x58f2('0x49')](handleError(_0x46386a,null));};exports['show']=function(_0x1e78d6,_0x5255ab){var _0x11a8be={'raw':![],'where':{'id':_0x1e78d6[_0x58f2('0x4a')]['id']}},_0x492970={};_0x492970[_0x58f2('0x3a')]=_[_0x58f2('0x36')](db[_0x58f2('0x31')]['rawAttributes']);_0x492970['query']=_[_0x58f2('0x36')](_0x1e78d6[_0x58f2('0x37')]);_0x492970[_0x58f2('0x38')]=_[_0x58f2('0x39')](_0x492970['model'],_0x492970['query']);_0x11a8be[_0x58f2('0x3b')]=_[_0x58f2('0x39')](_0x492970[_0x58f2('0x3a')],qs[_0x58f2('0x3c')](_0x1e78d6['query'][_0x58f2('0x3c')]));_0x11a8be[_0x58f2('0x3b')]=_0x11a8be[_0x58f2('0x3b')][_0x58f2('0x4b')]?_0x11a8be[_0x58f2('0x3b')]:_0x492970[_0x58f2('0x3a')];if(_0x1e78d6[_0x58f2('0x37')][_0x58f2('0x45')]){_0x11a8be['include']=[{'all':!![]}];}_0x11a8be=_[_0x58f2('0x44')]({},_0x11a8be,_0x1e78d6[_0x58f2('0x4c')]);return db[_0x58f2('0x31')][_0x58f2('0x4d')](_0x11a8be)[_0x58f2('0x2a')](handleEntityNotFound(_0x5255ab,null))[_0x58f2('0x2a')](respondWithResult(_0x5255ab,null))[_0x58f2('0x49')](handleError(_0x5255ab,null));};exports['create']=function(_0x318c81,_0x28a4b4){return db[_0x58f2('0x31')]['create'](_0x318c81[_0x58f2('0x4e')],{})[_0x58f2('0x2a')](respondWithResult(_0x28a4b4,0xc9))[_0x58f2('0x49')](handleError(_0x28a4b4,null));};exports['clone']=function(_0x45d10e,_0x3dba49){var _0x60b507={'where':{'id':_0x45d10e[_0x58f2('0x4a')]['id']}},_0x1f6868={};_0x1f6868[_0x58f2('0x3a')]=_['keys'](db[_0x58f2('0x31')][_0x58f2('0x32')]);_0x60b507[_0x58f2('0x3b')]=_[_0x58f2('0x39')](_0x1f6868[_0x58f2('0x3a')],qs[_0x58f2('0x3c')](_0x45d10e['query'][_0x58f2('0x3c')]));_0x60b507[_0x58f2('0x3b')]=_0x60b507[_0x58f2('0x3b')]['length']?_0x60b507[_0x58f2('0x3b')]:_0x1f6868[_0x58f2('0x3a')];if(_0x45d10e['query'][_0x58f2('0x45')]){_0x60b507[_0x58f2('0x46')]=[{'all':!![]}];}_0x60b507=_[_0x58f2('0x44')]({},_0x60b507,_0x45d10e[_0x58f2('0x4c')]);return db[_0x58f2('0x31')][_0x58f2('0x4d')](_0x60b507)[_0x58f2('0x2a')](handleEntityNotFound(_0x3dba49,null))['then'](function(_0x5ace9f){if(_0x5ace9f){var _0xe77a7a=_0x5ace9f['get']({'plain':!![]});_0xe77a7a=qs[_0x58f2('0x4f')](_0xe77a7a,['id','createdAt',_0x58f2('0x50'),_0x58f2('0x51')]);_0x45d10e['body']=_[_0x58f2('0x4f')](_0x45d10e['body'],['id',_0x58f2('0x52'),_0x58f2('0x50')]);return db[_0x58f2('0x53')][_0x58f2('0x54')](function(_0x929fe){return db[_0x58f2('0x31')][_0x58f2('0x55')](_[_0x58f2('0x44')](_0xe77a7a,_0x45d10e[_0x58f2('0x4e')]),{'include':_0x45d10e['query'][_0x58f2('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x929fe})[_0x58f2('0x2a')](function(_0x4c54ae){var _0x2ae8fb=_0x4c54ae[_0x58f2('0x56')]({'plain':!![]});return db[_0x58f2('0x57')][_0x58f2('0x47')]({'where':{'userProfileId':_0x45d10e[_0x58f2('0x4a')]['id']},'raw':!![]})[_0x58f2('0x2a')](function(_0x2f56ca){if(_0x2f56ca){return BPromise['each'](_0x2f56ca,function(_0x5df62b){return new BPromise(function(_0x3ddbf6,_0x59bfa9){if(_0x5df62b[_0x58f2('0x58')]===null||_0x5df62b[_0x58f2('0x58')]===0x1)_0x3ddbf6(null);return db[_0x58f2('0x59')]['findAll']({'where':{'sectionId':_0x5df62b['id']},'raw':!![]})[_0x58f2('0x2a')](function(_0x550dd9){var _0x555870=_[_0x58f2('0x30')](_0x550dd9,function(_0x489872){return qs[_0x58f2('0x4f')](_0x489872,['id',_0x58f2('0x52'),_0x58f2('0x50'),'sectionId']);});_0x3ddbf6(_0x555870);})[_0x58f2('0x49')](function(_0x129d47){_0x59bfa9(_0x129d47);});})[_0x58f2('0x2a')](function(_0x45f61d){var _0x560e62=qs[_0x58f2('0x4f')](_0x5df62b,['id','createdAt','updatedAt']);_0x560e62[_0x58f2('0x5a')]=_0x2ae8fb['id'];if(_0x45f61d)_0x560e62['Resources']=_0x45f61d;return _0x560e62;})[_0x58f2('0x2a')](function(_0x2791d7){return db[_0x58f2('0x57')]['create'](_0x2791d7,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x929fe});});})[_0x58f2('0x2a')](function(){return _0x2ae8fb;});}});});});}})[_0x58f2('0x2a')](respondWithResult(_0x3dba49,0xc9))[_0x58f2('0x49')](handleError(_0x3dba49,null));};exports['update']=function(_0x24290d,_0x4fb9d7){if(_0x24290d[_0x58f2('0x4e')]['id']){delete _0x24290d['body']['id'];}return db[_0x58f2('0x31')][_0x58f2('0x4d')]({'where':{'id':_0x24290d[_0x58f2('0x4a')]['id']}})[_0x58f2('0x2a')](handleEntityNotFound(_0x4fb9d7,null))[_0x58f2('0x2a')](saveUpdates(_0x24290d[_0x58f2('0x4e')],null))[_0x58f2('0x2a')](respondWithResult(_0x4fb9d7,null))[_0x58f2('0x49')](handleError(_0x4fb9d7,null));};exports[_0x58f2('0x5b')]=function(_0x10b6e1,_0x3bbf17){return db['UserProfile'][_0x58f2('0x4d')]({'where':{'id':_0x10b6e1[_0x58f2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3bbf17,null))['then'](removeEntity(_0x3bbf17,null))['catch'](handleError(_0x3bbf17,null));};exports[_0x58f2('0x5c')]=function(_0x285c3b,_0x42370d){return db[_0x58f2('0x31')]['describe']()[_0x58f2('0x2a')](respondWithResult(_0x42370d,null))[_0x58f2('0x49')](handleError(_0x42370d,null));};exports['addSections']=function(_0x4f7885,_0x4cbab1){var _0x41750f=_0x4f7885[_0x58f2('0x4e')];return db['UserProfile'][_0x58f2('0x4d')]({'where':{'id':_0x4f7885[_0x58f2('0x4a')]['id']}})[_0x58f2('0x2a')](handleEntityNotFound(_0x4cbab1,null))[_0x58f2('0x2a')](function(_0x40d941){if(_0x40d941){return db[_0x58f2('0x53')][_0x58f2('0x54')](function(_0x16ec6f){return db['UserProfileSection'][_0x58f2('0x5b')]({'where':{'userProfileId':_0x4f7885[_0x58f2('0x4a')]['id'],'sectionId':_[_0x58f2('0x30')](_0x41750f,function(_0x2b934b){return _0x2b934b[_0x58f2('0x5d')];})},'transaction':_0x16ec6f})[_0x58f2('0x2a')](function(){var _0x45c6df=_['map'](_0x41750f,function(_0x39d5c3){_0x39d5c3[_0x58f2('0x5a')]=_0x4f7885['params']['id'];return _0x39d5c3;});var _0x17edf4=[];return BPromise['each'](_0x45c6df,function(_0x29ba1e){return db[_0x58f2('0x57')][_0x58f2('0x55')](_0x29ba1e,{'include':[{'model':db[_0x58f2('0x59')],'as':_0x58f2('0x5e')}],'raw':!![],'transaction':_0x16ec6f})['then'](function(_0x27e791){_0x17edf4[_0x58f2('0x5f')](_0x27e791[_0x58f2('0x56')]({'plain':!![]}));});})['then'](function(){return _0x17edf4;});});});}})['then'](function(_0x1c2ff5){return _0x1c2ff5;})[_0x58f2('0x2a')](respondWithResult(_0x4cbab1,null))[_0x58f2('0x49')](handleError(_0x4cbab1,null));};exports[_0x58f2('0x60')]=function(_0x25c95b,_0x543945){var _0x1ffa27;return db[_0x58f2('0x31')][_0x58f2('0x4d')]({'where':{'id':_0x25c95b['params']['id']},'attributes':['id',_0x58f2('0x2d')]})[_0x58f2('0x2a')](handleEntityNotFound(_0x543945,null))[_0x58f2('0x2a')](function(_0x1c5cea){if(_0x1c5cea){_0x1ffa27=_0x1c5cea;return db[_0x58f2('0x57')]['destroy']({'where':{'userProfileId':_0x25c95b[_0x58f2('0x4a')]['id'],'sectionId':_0x25c95b[_0x58f2('0x37')][_0x58f2('0x61')]}});}})['then'](function(){return _0x1ffa27;})[_0x58f2('0x2a')](respondWithStatusCode(_0x543945,null))['catch'](handleError(_0x543945,null));};exports[_0x58f2('0x62')]=function(_0x1fbafa,_0x49f320){var _0x2287f6=[];var _0x12ba26=[];return db[_0x58f2('0x57')][_0x58f2('0x47')]({'where':{'userProfileId':_0x1fbafa[_0x58f2('0x4a')]['id']},'raw':!![]})[_0x58f2('0x2a')](function(_0x3c0282){_0x2287f6=_[_0x58f2('0x42')](_0x3c0282,function(_0x26d22c){return _0x26d22c[_0x58f2('0x63')]===0x1||_[_0x58f2('0x64')]([0x3eb,0x709],_0x26d22c[_0x58f2('0x5d')]);});if(!_[_0x58f2('0x65')](_0x2287f6)){return _[_0x58f2('0x30')](_0x2287f6,function(_0x325632){return _0x325632['sectionId'];});}else{return;}})[_0x58f2('0x2a')](function(_0x5bd852){if(_0x5bd852)_0x12ba26=_0x5bd852;if(_['includes'](_0x12ba26,0x64)){var _0x3d6b8e=_[_0x58f2('0x4d')](_0x2287f6,{'sectionId':0x64});return hasDefaultDashboard(_0x3d6b8e)['then'](function(_0x3b77b4){return _['map'](_0x2287f6,function(_0x5380f5){if(_0x5380f5[_0x58f2('0x5d')]===0x64){_0x5380f5[_0x58f2('0x66')]=_0x3b77b4;}return _0x5380f5;});});}else{return;}})['then'](function(_0x59d566){if(_0x59d566)_0x2287f6=_0x59d566;if(_[_0x58f2('0x64')](_0x12ba26,0x3eb)){var _0x4f9c9c=_[_0x58f2('0x4d')](_0x2287f6,{'sectionId':0x3eb});return getCustomDashboards(_0x4f9c9c)['then'](function(_0x104a53){return _[_0x58f2('0x30')](_0x2287f6,function(_0x4db4dd){if(_0x4f9c9c[_0x58f2('0x63')]){if(_0x4db4dd[_0x58f2('0x5d')]===0x3eb){_0x4db4dd['subsections']=_0x104a53;}}else{if(_0x4db4dd[_0x58f2('0x5d')]===0x64){_0x4db4dd[_0x58f2('0x66')]=_0x104a53;}}return _0x4db4dd;});});}else{return;}})[_0x58f2('0x2a')](function(_0x1bafde){if(_0x1bafde)_0x2287f6=_0x1bafde;if(_[_0x58f2('0x64')](_0x12ba26,0x709)){var _0x301b24=_[_0x58f2('0x4d')](_0x2287f6,{'sectionId':0x709});return getPlugins(_0x301b24)[_0x58f2('0x2a')](function(_0x457a63){if(_0x301b24[_0x58f2('0x63')]){return _[_0x58f2('0x30')](_0x2287f6,function(_0x4c3da5){if(_0x4c3da5['sectionId']===0x709){_0x4c3da5[_0x58f2('0x66')]=_0x457a63;}return _0x4c3da5;});}else{var _0x1b6ae0={'sectionId':0x76c,'enabled':0x1,'subsections':_0x457a63};var _0x5f422a=_[_0x58f2('0x30')](_0x2287f6);_0x5f422a['push'](_0x1b6ae0);return _0x5f422a;}});}else{return;}})[_0x58f2('0x2a')](function(_0x5ae521){if(_0x5ae521)_0x2287f6=_0x5ae521;return _[_0x58f2('0x42')](_0x2287f6,[_0x58f2('0x63'),0x1]);})[_0x58f2('0x2a')](respondWithResult(_0x49f320,null))['catch'](handleError(_0x49f320,null));};function hasDefaultDashboard(_0x51e3a9){var _0xf58d68=[0x65];return new BPromise(function(_0x4c1cae,_0xaed07d){try{if(_0x51e3a9[_0x58f2('0x58')]){_0x4c1cae(_0xf58d68);}else{return db[_0x58f2('0x59')][_0x58f2('0x67')]({'where':{'sectionId':_0x51e3a9['id']},'raw':!![]})['then'](function(_0x48c102){_0x48c102?_0x4c1cae(_0xf58d68):_0x4c1cae();});}}catch(_0x15612f){_0xaed07d(_0x15612f);}});}function getCustomDashboards(_0x5e8b95){var _0x118ce1=[];return new BPromise(function(_0x29b122,_0x257783){try{if(_0x5e8b95[_0x58f2('0x58')]){return db[_0x58f2('0x68')]['findAll']({'raw':!![]})['then'](function(_0xd74443){_0xd74443['forEach'](function(_0x3e7529){_0x118ce1[_0x58f2('0x5f')](_0x3e7529['id']+0x1869f);});_0x29b122(_0x118ce1);});}else{return db[_0x58f2('0x59')]['findAll']({'where':{'sectionId':_0x5e8b95['id']},'raw':!![]})['then'](function(_0x3027f4){_0x3027f4[_0x58f2('0x69')](function(_0x4c3388){_0x118ce1[_0x58f2('0x5f')](_0x4c3388[_0x58f2('0x6a')]+0x1869f);});_0x29b122(_0x118ce1);});}}catch(_0x214134){_0x257783(_0x214134);}});}function getPlugins(_0x30e54e){var _0x5f2357=[];return new BPromise(function(_0x2e5ec6,_0x4b4bd6){try{if(_0x30e54e[_0x58f2('0x58')]){return db[_0x58f2('0x6b')][_0x58f2('0x47')]({'raw':!![]})[_0x58f2('0x2a')](function(_0x29890b){_0x29890b[_0x58f2('0x69')](function(_0x9360c0){_0x5f2357[_0x58f2('0x5f')](_0x9360c0['id']+0x15b38);});_0x2e5ec6(_0x5f2357);});}else{return db[_0x58f2('0x59')][_0x58f2('0x47')]({'where':{'sectionId':_0x30e54e['id']},'raw':!![]})[_0x58f2('0x2a')](function(_0x55850f){_0x55850f['forEach'](function(_0x1df694){_0x5f2357[_0x58f2('0x5f')](_0x1df694[_0x58f2('0x6a')]+0x15b38);});_0x2e5ec6(_0x5f2357);});}}catch(_0x1945ae){_0x4b4bd6(_0x1945ae);}});}exports[_0x58f2('0x6c')]=function(_0x2ae32a,_0x55eee5){return db[_0x58f2('0x31')][_0x58f2('0x4d')]({'where':{'id':_0x2ae32a['params']['id']}})[_0x58f2('0x2a')](handleEntityNotFound(_0x55eee5,null))[_0x58f2('0x2a')](function(_0x291a14){if(_0x291a14){return db['sequelize'][_0x58f2('0x54')](function(_0x28fb68){return db[_0x58f2('0x57')][_0x58f2('0x47')]({'where':{'userProfileId':_0x2ae32a['params']['id']},'attributes':['id'],'raw':!![]})[_0x58f2('0x2a')](function(_0x514d54){if(_0x514d54){return db[_0x58f2('0x57')]['destroy']({'where':{'userProfileId':_0x2ae32a[_0x58f2('0x4a')]['id'],'id':_[_0x58f2('0x30')](_0x514d54,function(_0xd6c35){return _0xd6c35['id'];})},'transaction':_0x28fb68});}})[_0x58f2('0x2a')](function(_0x5800a1){var _0x4f134a=_['map'](_0x2ae32a[_0x58f2('0x4e')],function(_0xabfa7b){_0xabfa7b[_0x58f2('0x5a')]=_0x2ae32a[_0x58f2('0x4a')]['id'];return _0xabfa7b;});return db[_0x58f2('0x57')][_0x58f2('0x6d')](_0x4f134a,{'raw':!![],'transaction':_0x28fb68});})['then'](function(_0x5ea0d5){var _0x597b9e=_[_0x58f2('0x42')](_[_0x58f2('0x30')](_0x5ea0d5,function(_0x399e64){return _0x399e64[_0x58f2('0x56')]({'plain':!![]});}),{'includeAll':![]});if(_0x597b9e){return db[_0x58f2('0x57')][_0x58f2('0x47')]({'where':{'userProfileId':_0x2ae32a[_0x58f2('0x4a')]['id'],'sectionId':_['map'](_0x597b9e,function(_0x479ffe){return _0x479ffe['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x58f2('0x2a')](function(_0x3fd916){var _0xbd3540=_['map'](_0x2ae32a[_0x58f2('0x4e')],function(_0x95990a){_0x95990a[_0x58f2('0x5a')]=_0x2ae32a[_0x58f2('0x4a')]['id'];return _0x95990a;});return db['UserProfileResource'][_0x58f2('0x6d')](_0xbd3540,{'raw':!![],'transaction':_0x28fb68});});}})[_0x58f2('0x49')](handleError(_0x55eee5,null));});}})[_0x58f2('0x2a')](function(_0x3ee3f6){var _0x483f43=_[_0x58f2('0x30')](_0x3ee3f6,function(_0x3d0dfb){return _0x3d0dfb[_0x58f2('0x56')]({'plain':!![]});});})[_0x58f2('0x2a')](respondWithResult(_0x55eee5,null))[_0x58f2('0x49')](handleError(_0x55eee5,null));};exports[_0x58f2('0x6e')]=function(_0x4a45a5,_0x4d9a76,_0x3cc808){return db[_0x58f2('0x31')]['find']({'where':{'id':_0x4a45a5[_0x58f2('0x4a')]['id']}})[_0x58f2('0x2a')](handleEntityNotFound(_0x4d9a76,null))[_0x58f2('0x2a')](function(_0x59ab71){if(_0x59ab71){return _0x59ab71[_0x58f2('0x6e')](_0x4a45a5[_0x58f2('0x37')]['ids']);}})[_0x58f2('0x2a')](respondWithStatusCode(_0x4d9a76,null))[_0x58f2('0x49')](handleError(_0x4d9a76,null));};exports[_0x58f2('0x6f')]=function(_0x3a80fc,_0x252851){var _0x1026f5={};if(!_0x3a80fc['query'][_0x58f2('0x70')])throw new Error(_0x58f2('0x71'));if(!_0x3a80fc[_0x58f2('0x37')][_0x58f2('0x3d')](_0x58f2('0x72'))){_0x1026f5[_0x58f2('0x24')]=qs[_0x58f2('0x24')](_0x3a80fc[_0x58f2('0x37')][_0x58f2('0x24')]);_0x1026f5[_0x58f2('0x23')]=qs[_0x58f2('0x23')](_0x3a80fc[_0x58f2('0x37')][_0x58f2('0x23')]);}return db[_0x58f2('0x31')][_0x58f2('0x4d')]({'where':{'id':_0x3a80fc['params']['id']}})[_0x58f2('0x2a')](function(_0x15b6d3){if(!_0x15b6d3)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3a80fc[_0x58f2('0x4a')]['id']);return db[_0x58f2('0x31')][_0x58f2('0x6f')](_0x3a80fc);})[_0x58f2('0x2a')](respondWithFilteredResult(_0x252851,_0x1026f5))[_0x58f2('0x49')](handleError(_0x252851,null));};
\ No newline at end of file
index ca7ca0d..75b0c02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd6=['../../mysqldb','UserProfile','update','remove','emit','hook','exports','events'];(function(_0x4c321c,_0x3e9da0){var _0x25accb=function(_0x21bf7a){while(--_0x21bf7a){_0x4c321c['push'](_0x4c321c['shift']());}};_0x25accb(++_0x3e9da0);}(_0xffd6,0x97));var _0x6ffd=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0xffd6[_0x593752];return _0x4612be;};'use strict';var EventEmitter=require(_0x6ffd('0x0'));var UserProfile=require(_0x6ffd('0x1'))['db'][_0x6ffd('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6ffd('0x3'),'afterDestroy':_0x6ffd('0x4')};function emitEvent(_0x39fd49){return function(_0x560afa,_0x1d12e3,_0x173979){UserProfileEvents[_0x6ffd('0x5')](_0x39fd49+':'+_0x560afa['id'],_0x560afa);UserProfileEvents[_0x6ffd('0x5')](_0x39fd49,_0x560afa);_0x173979(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6ffd('0x6')](e,emitEvent(event));}}module[_0x6ffd('0x7')]=UserProfileEvents;
\ No newline at end of file
+var _0x2b29=['emit','hasOwnProperty','exports','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x75eef5,_0x34e2dd){var _0x265fe7=function(_0x37292a){while(--_0x37292a){_0x75eef5['push'](_0x75eef5['shift']());}};_0x265fe7(++_0x34e2dd);}(_0x2b29,0x163));var _0x92b2=function(_0x542c30,_0x1abf33){_0x542c30=_0x542c30-0x0;var _0x55626c=_0x2b29[_0x542c30];return _0x55626c;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x92b2('0x0'))['db'][_0x92b2('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x92b2('0x2')](0x0);var events={'afterCreate':_0x92b2('0x3'),'afterUpdate':'update','afterDestroy':_0x92b2('0x4')};function emitEvent(_0xdb5991){return function(_0xbc7de4,_0x3963eb,_0x16c1b0){UserProfileEvents[_0x92b2('0x5')](_0xdb5991+':'+_0xbc7de4['id'],_0xbc7de4);UserProfileEvents['emit'](_0xdb5991,_0xbc7de4);_0x16c1b0(null);};}for(var e in events){if(events[_0x92b2('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x92b2('0x7')]=UserProfileEvents;
\ No newline at end of file
index 73089ce..b8f8548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2675=['outbound','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','agents','Users','admin','user','Telephones','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Tag','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','reportId','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','InteractionId','ui.createdAt','from','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','all','ignore','autoAssociation','keys','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filters','merge','key','foreignKey','options','includeAll','include','forEach','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tags','color','ThroughTags','tag','true','sms','dataValues','fax','lodash','exports','models','filter','value','then','associatedResources','map','catch','field','model','findAll','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','lists','CmList','CmCompany','globalcustomfields','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','name','membername','User','agent','role','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2675,0x75));var _0x5267=function(_0x2fb1df,_0x5a576c){_0x2fb1df=_0x2fb1df-0x0;var _0x19210e=_0x2675[_0x2fb1df];return _0x19210e;};'use strict';var _=require(_0x5267('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x5267('0x1')]=function(_0x2ae442){var _0x57c95a=_0x2ae442[_0x5267('0x2')];function _0x36bdf0(_0x4e2548,_0x328776){return new Promise(function(_0xf2b350,_0x4bd042){if(!_0x328776)return _0xf2b350(null);var _0x10f92c=_0x328776[_0x5267('0x3')]?{[_0x328776[_0x5267('0x3')]['field']]:_0x328776[_0x5267('0x3')][_0x5267('0x4')]}:undefined;return _0x57c95a[_0x4e2548]['findAll']({'where':_0x10f92c,'raw':!![]})[_0x5267('0x5')](function(_0x5d6645){_0x328776[_0x5267('0x6')]=_[_0x5267('0x7')](_0x5d6645,'id');_0xf2b350(_0x328776);})[_0x5267('0x8')](function(_0x534c2b){_0x4bd042(_0x534c2b);});});}function _0x3e6964(_0x5060b3,_0x445151){return new Promise(function(_0x5bbf00,_0x31ea34){var _0x23d71b=_0x5060b3[_0x5267('0x3')]?{[_0x5060b3[_0x5267('0x3')][_0x5267('0x9')]]:_0x5060b3[_0x5267('0x3')][_0x5267('0x4')]}:undefined;return _0x57c95a[_0x5060b3[_0x5267('0xa')]][_0x5267('0xb')]({'where':_0x23d71b,'raw':!![]})[_0x5267('0x5')](function(_0x16e5a7){_0x445151[_0x5267('0x6')]=_[_0x5267('0x7')](_0x16e5a7,function(_0x548040){return _0x548040['name'];});_0x5bbf00(_0x445151);})[_0x5267('0x8')](function(_0x40d897){_0x31ea34(_0x40d897);});});}function _0x38a147(_0x3f5344,_0x46b2c2,_0x27e5c6){if(!_0x46b2c2)return Promise[_0x5267('0xc')](null);return new Promise(function(_0x6831e0,_0x15d81e){return _0x57c95a[_0x5267('0xd')][_0x5267('0xb')]({'where':{'sectionId':_0x46b2c2['id']},'raw':!![]})[_0x5267('0x5')](function(_0x528d61){if(_0x3f5344[_0x5267('0x9')]&&_0x3f5344[_0x5267('0x9')]!=='id'){_0x46b2c2['associatedResources']=_[_0x5267('0x7')](_0x528d61,function(_0x56733e){return _0x56733e[_0x3f5344[_0x5267('0x9')]];});}else{if(_0x27e5c6===_0x5267('0xe')){_0x46b2c2[_0x5267('0x6')]=_[_0x5267('0x7')](_0x528d61,function(_0x5ca9c6){return{'id':_0x5ca9c6['resourceId'],'type':_0x5ca9c6[_0x5267('0xf')]};});}else{_0x46b2c2['associatedResources']=_[_0x5267('0x7')](_0x528d61,function(_0x420fb8){return _0x420fb8[_0x5267('0x10')];});}}_0x6831e0(_0x46b2c2);})['catch'](function(_0x499f19){_0x15d81e(_0x499f19);});});}function _0x5546e2(_0x4a17c7,_0x5ea6a6){var _0x26c7f8={'parentSections':[]};switch(_0x4a17c7[_0x5267('0x11')]()){case _0x5267('0x12'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x14');break;case _0x5267('0x15'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x16');break;case _0x5267('0x17'):_0x26c7f8['childModel']='SquareRecording';_0x26c7f8[_0x5267('0x18')]=[{'name':_0x5267('0x19'),'field':'name','foreignKey':_0x5267('0x1a')}];break;case'projects':_0x26c7f8['childModel']=_0x5267('0x1b');break;case _0x5267('0x1c'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x1d');_0x26c7f8[_0x5267('0x18')]=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0x5267('0x1e'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x1f');break;case'companies':_0x26c7f8['childModel']=_0x5267('0x20');break;case _0x5267('0x21'):_0x26c7f8[_0x5267('0x13')]='CmCustomField';break;case'chatqueues':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x22');break;case _0x5267('0x23'):_0x26c7f8[_0x5267('0x13')]='ChatWebsite';break;case _0x5267('0x24'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x25');break;case _0x5267('0x26'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x27');break;case _0x5267('0x28'):case _0x5267('0x29'):case'outboundroutes':_0x26c7f8['childModel']=_0x5267('0x2a');break;case'contexts':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x2b');break;case _0x5267('0x2c'):_0x26c7f8[_0x5267('0x13')]='VoiceMail';break;case _0x5267('0x2d'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x2e');_0x26c7f8[_0x5267('0x18')]=[{'name':_0x5267('0x2f'),'field':_0x5267('0x30'),'foreignKey':_0x5267('0x31'),'model':_0x5267('0x32'),'filter':{'field':'role','value':[_0x5267('0x33')]}},{'name':'Telephones','field':_0x5267('0x30'),'foreignKey':_0x5267('0x31'),'model':_0x5267('0x32'),'filter':{'field':_0x5267('0x34'),'value':[_0x5267('0x35')]}},{'name':_0x5267('0x36'),'field':_0x5267('0x30'),'foreignKey':'queue','model':_0x5267('0x37'),'filter':{'field':_0x5267('0xf'),'value':[_0x5267('0x38')]}},{'name':_0x5267('0x39'),'field':_0x5267('0x30'),'foreignKey':_0x5267('0x3a'),'model':_0x5267('0x37'),'filter':{'field':'type','value':[_0x5267('0x3b')]}}];break;case'musiconholds':_0x26c7f8[_0x5267('0x13')]='VoiceMusicOnHold';break;case'chanspies':_0x26c7f8['childModel']=_0x5267('0x3c');break;case'voiceprefixes':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x3d');break;case _0x5267('0x3e'):_0x26c7f8[_0x5267('0x13')]='Campaign';break;case _0x5267('0x3f'):_0x26c7f8[_0x5267('0x13')]='MailQueue';break;case'mailaccounts':_0x26c7f8[_0x5267('0x13')]='MailAccount';break;case _0x5267('0x40'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x41');break;case _0x5267('0x42'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x43');break;case _0x5267('0x44'):_0x26c7f8['childModel']='OpenchannelAccount';break;case _0x5267('0x45'):_0x26c7f8['childModel']=_0x5267('0x46');break;case _0x5267('0x47'):_0x26c7f8['childModel']=_0x5267('0x48');break;case _0x5267('0x49'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x4a');break;case _0x5267('0x4b'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x4c');break;case _0x5267('0x4d'):_0x26c7f8[_0x5267('0x13')]='Team';break;case _0x5267('0x4e'):case _0x5267('0x4f'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x37');if(_0x5ea6a6){_0x26c7f8[_0x5267('0x18')]=[{'name':'VoiceQueues'},{'name':_0x5267('0x39')}];}break;case'users':case _0x5267('0x50'):case'telephones':_0x26c7f8['childModel']=_0x5267('0x32');if(_0x5ea6a6){_0x26c7f8['parentSections']=[{'name':_0x5267('0x51'),'filter':{'field':_0x5267('0x34'),'value':[_0x5267('0x52'),_0x5267('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':_0x5267('0x54')}];}break;case'zendeskaccounts':_0x26c7f8['childModel']=_0x5267('0x55');break;case _0x5267('0x56'):_0x26c7f8['childModel']='SalesforceAccount';break;case _0x5267('0x57'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x58');break;case _0x5267('0x59'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x5a');break;case _0x5267('0x5b'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x5c');break;case _0x5267('0x5d'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x5e');break;case _0x5267('0x5f'):_0x26c7f8[_0x5267('0x13')]='User';break;case _0x5267('0x60'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x61');break;case'dispositions':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x62');break;case _0x5267('0x63'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x64');break;case _0x5267('0x65'):_0x26c7f8['childModel']=_0x5267('0x66');break;case'pauses':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x67');break;case _0x5267('0x68'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x69');break;case _0x5267('0x6a'):_0x26c7f8[_0x5267('0x13')]='Sound';break;case'tags':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x6b');break;case'templates':_0x26c7f8[_0x5267('0x13')]='Template';break;case'triggers':_0x26c7f8[_0x5267('0x13')]=_0x5267('0x6c');break;case _0x5267('0x6d'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x6e');break;case _0x5267('0x6f'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0x70');break;case _0x5267('0x71'):_0x26c7f8[_0x5267('0x13')]='Plugin';break;case _0x5267('0x72'):_0x26c7f8[_0x5267('0x13')]=_0x5267('0xe');_0x26c7f8[_0x5267('0x18')]=[{'name':_0x5267('0x73'),'field':'id','foreignKey':_0x5267('0x74')}];break;case'metrics':_0x26c7f8[_0x5267('0x13')]='AnalyticMetric';break;}return _0x26c7f8;}function _0x1522d6(_0x3b0b6a,_0x19fd1c){var _0x4a72c3=_0x3b0b6a[_0x5267('0x75')](0x0)[_0x5267('0x76')]()+_0x3b0b6a[_0x5267('0x77')](0x1);var _0x213bdc={'type':_0x57c95a[_0x5267('0x78')][_0x5267('0x79')]['SELECT'],'raw':!![]};return new Promise(function(_0x1ef14e,_0x190d02){var _0x186667=squel[_0x5267('0x7a')]()['field']('ui.'+_0x4a72c3+_0x5267('0x7b'),'id')['field'](_0x5267('0x7c'))[_0x5267('0x7d')]('user_has_'+_0x3b0b6a+'_interactions','ui')[_0x5267('0x7e')](_0x5267('0x7f'),_0x19fd1c['id']);return _0x57c95a[_0x5267('0x80')]['query'](_0x186667[_0x5267('0x81')](),_0x213bdc)[_0x5267('0x5')](function(_0x293e61){_0x19fd1c[_0x4a72c3+_0x5267('0x82')]=_0x293e61;_0x1ef14e(_0x293e61);})['catch'](function(_0x5a87b5){_0x190d02(_0x5a87b5);});});}return _0x2ae442['define'](_0x5267('0x83'),attributes,{'tableName':_0x5267('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x45ee25){var _0x378068={'raw':![],'where':{}};var _0x456e94={};var _0x446ba4={'count':0x0,'rows':[]};var _0x2a032a=_0x45ee25[_0x5267('0x85')]['section'];var _0x1ddfad=_0x45ee25[_0x5267('0x85')]['mergeResources']||![];var _0x412511=_0x5546e2(_0x2a032a,_0x1ddfad);if(!_0x412511[_0x5267('0x13')])throw new Error(_0x5267('0x86')+_0x2a032a+'\x27');var _0x1b6dd7=[{'name':_0x2a032a}];if(!_[_0x5267('0x87')](_0x412511[_0x5267('0x18')]))_0x1b6dd7=_0x412511['parentSections'];var _0x2ca259=[];for(var _0x726410=0x0;_0x726410<_0x1b6dd7[_0x5267('0x88')];_0x726410++){_0x2ca259[_0x5267('0x89')](_0x57c95a[_0x5267('0x8a')][_0x5267('0x8b')]({'where':{'userProfileId':_0x45ee25['params']['id'],'name':_0x1b6dd7[_0x726410][_0x5267('0x30')]},'raw':!![]}));}return Promise[_0x5267('0x8c')](_0x2ca259)[_0x5267('0x5')](function(_0x14c3ac){var _0x1a4016=_[_0x5267('0x3')](_0x14c3ac,function(_0x47d359){return _0x47d359?_0x47d359:undefined;});var _0x283423=_[_0x5267('0x3')](_0x1b6dd7,[_0x5267('0x8d'),!![]]);var _0x3bedcf=_['isEmpty'](_0x1a4016)&&_['isEmpty'](_0x283423)?null:_['union'](_0x283423,_0x1a4016);if(!_0x3bedcf)return null;var _0x910f97=[];for(var _0x5cca85=0x0;_0x5cca85<_0x3bedcf[_0x5267('0x88')];_0x5cca85++){var _0x580748=_[_0x5267('0x8b')](_0x1b6dd7,function(_0x1150ba){return _0x3bedcf[_0x5cca85]?_0x1150ba[_0x5267('0x30')]===_0x3bedcf[_0x5cca85][_0x5267('0x30')]:null;});if(_0x580748){if(_0x3bedcf[_0x5cca85][_0x5267('0x8d')]){_0x910f97[_0x5267('0x89')](_0x36bdf0(_0x412511[_0x5267('0x13')],_0x3bedcf[_0x5cca85]));}else{if(!_0x3bedcf[_0x5cca85][_0x5267('0x8e')]){_0x910f97['push'](_0x38a147(_0x580748,_0x3bedcf[_0x5cca85],_0x412511['childModel']));}else{if(_0x580748['model']){_0x910f97[_0x5267('0x89')](_0x3e6964(_0x580748,_0x3bedcf[_0x5cca85]));}}}}}return Promise[_0x5267('0x8c')](_0x910f97);})[_0x5267('0x5')](function(_0x457d84){var _0x4974d1=_0x457d84;var _0x3f2b5d=null;if(_0x4974d1){_0x3f2b5d=_0x4974d1[_0x5267('0x88')]===0x1?_0x4974d1[0x0]:null;}if(!_0x3f2b5d&&!_0x4974d1)return _0x446ba4;var _0x3c547f=_0x57c95a[_0x412511[_0x5267('0x13')]]['rawAttributes'];_0x456e94[_0x5267('0xa')]=_[_0x5267('0x8f')](_0x3c547f);_0x456e94['query']=_[_0x5267('0x8f')](_0x45ee25[_0x5267('0x85')]);_0x456e94['filters']=_['intersection'](_0x456e94[_0x5267('0xa')],_0x456e94[_0x5267('0x85')]);_0x378068['attributes']=_['intersection'](_0x456e94[_0x5267('0xa')],qs[_0x5267('0x90')](_0x45ee25[_0x5267('0x85')][_0x5267('0x90')]));_0x378068[_0x5267('0x91')]=_0x378068['attributes'][_0x5267('0x88')]?_0x378068[_0x5267('0x91')]:_0x456e94['model'];if(!_0x45ee25[_0x5267('0x85')][_0x5267('0x92')](_0x5267('0x93'))){_0x378068[_0x5267('0x94')]=qs[_0x5267('0x94')](_0x45ee25[_0x5267('0x85')][_0x5267('0x94')]);_0x378068[_0x5267('0x95')]=qs['offset'](_0x45ee25['query'][_0x5267('0x95')]);}_0x378068[_0x5267('0x96')]=qs[_0x5267('0x97')](_0x45ee25[_0x5267('0x85')]['sort']);_0x378068[_0x5267('0x7e')]=qs['filters'](_[_0x5267('0x98')](_0x45ee25[_0x5267('0x85')],_0x456e94[_0x5267('0x99')]));if(_0x45ee25[_0x5267('0x85')]['filter']){_0x378068['where']=_[_0x5267('0x9a')](_0x378068[_0x5267('0x7e')],{'$or':_[_0x5267('0x7')](_0x3c547f,function(_0x360a1b){if(_0x360a1b[_0x5267('0xf')][_0x5267('0x9b')]!=='VIRTUAL'){var _0x1b8d72={};_0x1b8d72[_0x360a1b['field']]={'$like':'%'+_0x45ee25[_0x5267('0x85')]['filter']+'%'};return _0x1b8d72;}})});}var _0x2c2b95=[];var _0x20888d=null;var _0x3f31ac={};if(_0x3f2b5d){_0x20888d=_[_0x5267('0x8b')](_0x1b6dd7,[_0x5267('0x30'),_0x3f2b5d[_0x5267('0x30')]]);if(_0x20888d[_0x5267('0x9')]){_0x3f31ac={};if(_0x412511[_0x5267('0x13')]===_0x5267('0xe')){_0x3f31ac[_0x20888d[_0x5267('0x9c')]]=_[_0x5267('0x7')](_0x3f2b5d['associatedResources'],'id');}else{_0x3f31ac[_0x20888d[_0x5267('0x9c')]]=_0x3f2b5d[_0x5267('0x6')];}_0x2c2b95['push'](_0x3f31ac);}else{_0x378068[_0x5267('0x7e')]['id']=_0x3f2b5d[_0x5267('0x6')];}}else{for(var _0x3ebda6=0x0;_0x3ebda6<_0x4974d1[_0x5267('0x88')];_0x3ebda6++){_0x20888d=_[_0x5267('0x8b')](_0x1b6dd7,[_0x5267('0x30'),_0x4974d1[_0x3ebda6][_0x5267('0x30')]]);if(_0x20888d['field']){_0x3f31ac={};_0x3f31ac[_0x20888d[_0x5267('0x9c')]]=_0x4974d1[_0x3ebda6][_0x5267('0x6')];_0x2c2b95[_0x5267('0x89')](_0x3f31ac);}else{if(!_0x378068[_0x5267('0x7e')]['id'])_0x378068[_0x5267('0x7e')]['id']=[];_0x4974d1[_0x3ebda6]['associatedResources']['forEach'](function(_0x34d446){_0x378068[_0x5267('0x7e')]['id'][_0x5267('0x89')](_0x34d446);});}}}if(!_[_0x5267('0x87')](_0x2c2b95)){_0x378068['where']=_[_0x5267('0x9a')](_0x378068[_0x5267('0x7e')],{'$and':{'$or':_0x2c2b95}});}_0x378068=_[_0x5267('0x9a')]({},_0x378068,_0x45ee25[_0x5267('0x9d')]);if(_0x3f2b5d&&!_0x3f2b5d[_0x5267('0x8e')]&&_0x412511[_0x5267('0x13')]===_0x5267('0xe')){if(_0x45ee25[_0x5267('0x85')][_0x5267('0x9e')]){_0x378068[_0x5267('0x9f')]=[{'all':!![]}];}return _0x57c95a[_0x412511[_0x5267('0x13')]][_0x5267('0xb')](_0x378068)[_0x5267('0x5')](function(_0x4a0422){var _0x29c114=[];_0x4a0422[_0x5267('0xa0')](function(_0x45d1cc){var _0x16374d;switch(_0x45d1cc[_0x5267('0xa1')]){case _0x5267('0xa2'):_0x16374d=_[_0x5267('0x8b')](_0x3f2b5d[_0x5267('0x6')],function(_0x42694a){return _0x42694a['id']===_0x45d1cc[_0x5267('0x74')]&&_0x42694a[_0x5267('0xf')]===_0x5267('0xa3');});break;case _0x5267('0xa4'):_0x16374d=_[_0x5267('0x8b')](_0x3f2b5d[_0x5267('0x6')],function(_0x78a2a4){return _0x78a2a4['id']===_0x45d1cc[_0x5267('0x74')]&&_0x78a2a4[_0x5267('0xf')]===_0x5267('0xa5');});break;}if(_0x16374d)_0x29c114[_0x5267('0x89')](_0x45d1cc);});_0x446ba4[_0x5267('0xa6')]=_0x29c114[_0x5267('0x88')];_0x446ba4[_0x5267('0xa7')]=_0x29c114;return _0x446ba4;});}else{return _0x57c95a[_0x412511['childModel']][_0x5267('0xa6')]({'where':_0x378068[_0x5267('0x7e')]})[_0x5267('0x5')](function(_0x405eb4){_0x446ba4[_0x5267('0xa6')]=_0x405eb4;if(_0x45ee25['query'][_0x5267('0x9e')]){if(_0x412511[_0x5267('0x13')]==='CmContact'){_0x378068['include']=[{'model':_0x57c95a['Tag'],'as':_0x5267('0xa8'),'attributes':['id','name',_0x5267('0xa9')],'required':_0x45ee25['query']['tag']?!![]:![]},{'model':_0x57c95a[_0x5267('0x6b')],'as':_0x5267('0xaa'),'attributes':['id',_0x5267('0x30'),_0x5267('0xa9')],'through':_0x45ee25[_0x5267('0x85')]['tag']?{'attributes':[],'where':{'TagId':_0x45ee25['query'][_0x5267('0xab')]||undefined}}:{},'required':_0x45ee25[_0x5267('0x85')][_0x5267('0xab')]?!![]:![]}];}else{_0x378068[_0x5267('0x9f')]=[{'all':!![]}];}}return _0x57c95a[_0x412511[_0x5267('0x13')]]['findAll'](_0x378068);})[_0x5267('0x5')](function(_0x5bece1){_0x446ba4['rows']=_0x5bece1;if(_0x2a032a===_0x5267('0x2f')&&_0x45ee25['query']['openTabs']===_0x5267('0xac')){var _0x321322=[];for(var _0x5085d8=0x0;_0x5085d8<_0x446ba4['rows']['length'];_0x5085d8++){_0x321322[_0x5267('0x89')](_0x1522d6('chat',_0x446ba4[_0x5267('0xa7')][_0x5085d8]['dataValues']));_0x321322[_0x5267('0x89')](_0x1522d6(_0x5267('0xad'),_0x446ba4['rows'][_0x5085d8][_0x5267('0xae')]));_0x321322[_0x5267('0x89')](_0x1522d6(_0x5267('0xaf'),_0x446ba4[_0x5267('0xa7')][_0x5085d8][_0x5267('0xae')]));_0x321322[_0x5267('0x89')](_0x1522d6('mail',_0x446ba4['rows'][_0x5085d8][_0x5267('0xae')]));_0x321322['push'](_0x1522d6('openchannel',_0x446ba4[_0x5267('0xa7')][_0x5085d8]['dataValues']));_0x321322[_0x5267('0x89')](_0x1522d6('whatsapp',_0x446ba4[_0x5267('0xa7')][_0x5085d8]['dataValues']));}return Promise[_0x5267('0x8c')](_0x321322)[_0x5267('0x5')](function(){return _0x446ba4;});}return _0x446ba4;});}});}}});};
\ No newline at end of file
+var _0x7a54=['dispositions','Disposition','Dashboard','intervals','Interval','Pause','scheduler','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','variables','Variable','Plugin','extractedreports','Reports','charAt','slice','SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','define','UserProfile','query','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','AnalyticExtractedReport','includeAll','include','reportType','default','reportId','DefaultReports','CustomReports','count','Tags','color','tag','ThroughTags','openTabs','true','rows','chat','dataValues','sms','fax','mail','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','associatedResources','map','model','findAll','then','catch','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','name','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','faxaccounts','inboundroutes','outboundroutes','voicemails','VoiceMail','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceChanSpy','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer'];(function(_0x546778,_0x5a5dfb){var _0x16b445=function(_0x283628){while(--_0x283628){_0x546778['push'](_0x546778['shift']());}};_0x16b445(++_0x5a5dfb);}(_0x7a54,0x106));var _0x47a5=function(_0x56b054,_0x3b8aea){_0x56b054=_0x56b054-0x0;var _0x8ea90a=_0x7a54[_0x56b054];return _0x8ea90a;};'use strict';var _=require(_0x47a5('0x0'));var attributes=require(_0x47a5('0x1'));var qs=require(_0x47a5('0x2'));var squel=require('squel');module[_0x47a5('0x3')]=function(_0x4086cd){var _0x4880bf=_0x4086cd[_0x47a5('0x4')];function _0x11bf85(_0x2a1a7e,_0x3717e1){return new Promise(function(_0xfdf934,_0x545a97){if(!_0x3717e1)return _0xfdf934(null);var _0x3d5629=_0x3717e1['filter']?{[_0x3717e1[_0x47a5('0x5')][_0x47a5('0x6')]]:_0x3717e1['filter'][_0x47a5('0x7')]}:undefined;return _0x4880bf[_0x2a1a7e]['findAll']({'where':_0x3d5629,'raw':!![]})['then'](function(_0x582352){_0x3717e1[_0x47a5('0x8')]=_[_0x47a5('0x9')](_0x582352,'id');_0xfdf934(_0x3717e1);})['catch'](function(_0x2eb0dd){_0x545a97(_0x2eb0dd);});});}function _0x49e844(_0x5de6d7,_0x1f47f4){return new Promise(function(_0x69e4d4,_0x2f399b){var _0x250fad=_0x5de6d7[_0x47a5('0x5')]?{[_0x5de6d7[_0x47a5('0x5')][_0x47a5('0x6')]]:_0x5de6d7['filter'][_0x47a5('0x7')]}:undefined;return _0x4880bf[_0x5de6d7[_0x47a5('0xa')]][_0x47a5('0xb')]({'where':_0x250fad,'raw':!![]})[_0x47a5('0xc')](function(_0x139f25){_0x1f47f4[_0x47a5('0x8')]=_[_0x47a5('0x9')](_0x139f25,function(_0x190faa){return _0x190faa['name'];});_0x69e4d4(_0x1f47f4);})[_0x47a5('0xd')](function(_0x11faf5){_0x2f399b(_0x11faf5);});});}function _0x3b001e(_0x2a2cbb,_0x1ef44c,_0x574af6){if(!_0x1ef44c)return Promise['resolve'](null);return new Promise(function(_0x138bc0,_0x4b966e){return _0x4880bf['UserProfileResource'][_0x47a5('0xb')]({'where':{'sectionId':_0x1ef44c['id']},'raw':!![]})[_0x47a5('0xc')](function(_0x2ce454){if(_0x2a2cbb[_0x47a5('0x6')]&&_0x2a2cbb[_0x47a5('0x6')]!=='id'){_0x1ef44c[_0x47a5('0x8')]=_[_0x47a5('0x9')](_0x2ce454,function(_0xe3c618){return _0xe3c618[_0x2a2cbb[_0x47a5('0x6')]];});}else{if(_0x574af6==='AnalyticExtractedReport'){_0x1ef44c[_0x47a5('0x8')]=_[_0x47a5('0x9')](_0x2ce454,function(_0x47cf3c){return{'id':_0x47cf3c[_0x47a5('0xe')],'type':_0x47cf3c[_0x47a5('0xf')]};});}else{_0x1ef44c[_0x47a5('0x8')]=_['map'](_0x2ce454,function(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0xe')];});}}_0x138bc0(_0x1ef44c);})[_0x47a5('0xd')](function(_0x7a9f9e){_0x4b966e(_0x7a9f9e);});});}function _0x5ef1b1(_0xe2dea9,_0x385687){var _0x513981={'parentSections':[]};switch(_0xe2dea9[_0x47a5('0x10')]()){case _0x47a5('0x11'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x13');break;case _0x47a5('0x14'):_0x513981['childModel']='SquareOdbc';break;case _0x47a5('0x15'):_0x513981['childModel']=_0x47a5('0x16');_0x513981['parentSections']=[{'name':_0x47a5('0x17'),'field':_0x47a5('0x18'),'foreignKey':_0x47a5('0x19')}];break;case _0x47a5('0x1a'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x1b');break;case _0x47a5('0x1c'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x1d');_0x513981[_0x47a5('0x1e')]=[{'name':_0x47a5('0x1f'),'field':'id','foreignKey':_0x47a5('0x20')}];break;case _0x47a5('0x21'):_0x513981['childModel']=_0x47a5('0x22');break;case'companies':_0x513981[_0x47a5('0x12')]=_0x47a5('0x23');break;case _0x47a5('0x24'):_0x513981['childModel']=_0x47a5('0x25');break;case _0x47a5('0x26'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x27');break;case'chatwebsites':_0x513981['childModel']=_0x47a5('0x28');break;case _0x47a5('0x29'):_0x513981['childModel']='FaxQueue';break;case _0x47a5('0x2a'):_0x513981[_0x47a5('0x12')]='FaxAccount';break;case _0x47a5('0x2b'):case'internalroutes':case _0x47a5('0x2c'):_0x513981[_0x47a5('0x12')]='VoiceExtension';break;case'contexts':_0x513981[_0x47a5('0x12')]='VoiceContext';break;case _0x47a5('0x2d'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x2e');break;case'voicerecordings':_0x513981[_0x47a5('0x12')]='VoiceRecording';_0x513981['parentSections']=[{'name':_0x47a5('0x2f'),'field':'name','foreignKey':_0x47a5('0x30'),'model':'User','filter':{'field':_0x47a5('0x31'),'value':[_0x47a5('0x32')]}},{'name':_0x47a5('0x33'),'field':_0x47a5('0x18'),'foreignKey':_0x47a5('0x30'),'model':_0x47a5('0x34'),'filter':{'field':_0x47a5('0x31'),'value':[_0x47a5('0x35')]}},{'name':_0x47a5('0x36'),'field':'name','foreignKey':_0x47a5('0x37'),'model':_0x47a5('0x38'),'filter':{'field':'type','value':[_0x47a5('0x39')]}},{'name':_0x47a5('0x3a'),'field':_0x47a5('0x18'),'foreignKey':'queue','model':_0x47a5('0x38'),'filter':{'field':_0x47a5('0xf'),'value':['outbound']}}];break;case _0x47a5('0x3b'):_0x513981[_0x47a5('0x12')]='VoiceMusicOnHold';break;case'chanspies':_0x513981['childModel']=_0x47a5('0x3c');break;case'voiceprefixes':_0x513981[_0x47a5('0x12')]=_0x47a5('0x3d');break;case _0x47a5('0x3e'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x3f');break;case _0x47a5('0x40'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x41');break;case _0x47a5('0x42'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x43');break;case _0x47a5('0x44'):_0x513981[_0x47a5('0x12')]='MailSubstatus';break;case _0x47a5('0x45'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x46');break;case _0x47a5('0x47'):_0x513981['childModel']=_0x47a5('0x48');break;case'smsqueues':_0x513981['childModel']='SmsQueue';break;case'smsaccounts':_0x513981[_0x47a5('0x12')]='SmsAccount';break;case _0x47a5('0x49'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x4a');break;case'whatsappaccounts':_0x513981[_0x47a5('0x12')]=_0x47a5('0x4b');break;case'teams':_0x513981['childModel']=_0x47a5('0x4c');break;case'voicequeues':case _0x47a5('0x4d'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x38');if(_0x385687){_0x513981[_0x47a5('0x1e')]=[{'name':_0x47a5('0x36')},{'name':_0x47a5('0x3a')}];}break;case _0x47a5('0x4e'):case _0x47a5('0x4f'):case _0x47a5('0x50'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x34');if(_0x385687){_0x513981[_0x47a5('0x1e')]=[{'name':_0x47a5('0x51'),'filter':{'field':_0x47a5('0x31'),'value':[_0x47a5('0x52'),_0x47a5('0x53')]},'ignore':!![]},{'name':'Agents'},{'name':_0x47a5('0x33')}];}break;case _0x47a5('0x54'):_0x513981['childModel']='ZendeskAccount';break;case _0x47a5('0x55'):_0x513981['childModel']=_0x47a5('0x56');break;case _0x47a5('0x57'):_0x513981['childModel']='FreshdeskAccount';break;case _0x47a5('0x58'):_0x513981['childModel']=_0x47a5('0x59');break;case _0x47a5('0x5a'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x5b');break;case _0x47a5('0x5c'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x5d');break;case'vtigeraccounts':_0x513981['childModel']=_0x47a5('0x34');break;case _0x47a5('0x5e'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x5f');break;case _0x47a5('0x60'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x61');break;case'customdashboards':_0x513981[_0x47a5('0x12')]=_0x47a5('0x62');break;case _0x47a5('0x63'):_0x513981['childModel']=_0x47a5('0x64');break;case'pauses':_0x513981[_0x47a5('0x12')]=_0x47a5('0x65');break;case _0x47a5('0x66'):_0x513981[_0x47a5('0x12')]='Schedule';break;case _0x47a5('0x67'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x68');break;case _0x47a5('0x69'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x6a');break;case _0x47a5('0x6b'):_0x513981['childModel']=_0x47a5('0x6c');break;case _0x47a5('0x6d'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x6e');break;case _0x47a5('0x6f'):_0x513981[_0x47a5('0x12')]='Trunk';break;case _0x47a5('0x70'):_0x513981[_0x47a5('0x12')]=_0x47a5('0x71');break;case'plugins':_0x513981[_0x47a5('0x12')]=_0x47a5('0x72');break;case _0x47a5('0x73'):_0x513981['childModel']='AnalyticExtractedReport';_0x513981[_0x47a5('0x1e')]=[{'name':_0x47a5('0x74'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x513981[_0x47a5('0x12')]='AnalyticMetric';break;}return _0x513981;}function _0x16bb8a(_0x5d383d,_0x482de6){var _0x389ed9=_0x5d383d[_0x47a5('0x75')](0x0)['toUpperCase']()+_0x5d383d[_0x47a5('0x76')](0x1);var _0x72fe={'type':_0x4880bf['Sequelize']['QueryTypes'][_0x47a5('0x77')],'raw':!![]};return new Promise(function(_0x30d482,_0x867da0){var _0x2931e4=squel['select']()[_0x47a5('0x6')](_0x47a5('0x78')+_0x389ed9+_0x47a5('0x79'),'id')['field'](_0x47a5('0x7a'))['from'](_0x47a5('0x7b')+_0x5d383d+_0x47a5('0x7c'),'ui')[_0x47a5('0x7d')](_0x47a5('0x7e'),_0x482de6['id']);return _0x4880bf[_0x47a5('0x7f')]['query'](_0x2931e4[_0x47a5('0x80')](),_0x72fe)['then'](function(_0x5cbe97){_0x482de6[_0x389ed9+'OpenTabs']=_0x5cbe97;_0x30d482(_0x5cbe97);})['catch'](function(_0x212d92){_0x867da0(_0x212d92);});});}return _0x4086cd[_0x47a5('0x81')](_0x47a5('0x82'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4d3db1){var _0x139229={'raw':![],'where':{}};var _0x23020b={};var _0x45d4b6={'count':0x0,'rows':[]};var _0x3c2b46=_0x4d3db1[_0x47a5('0x83')]['section'];var _0x3474b7=_0x4d3db1['query'][_0x47a5('0x84')]||![];var _0x274d31=_0x5ef1b1(_0x3c2b46,_0x3474b7);if(!_0x274d31['childModel'])throw new Error(_0x47a5('0x85')+_0x3c2b46+'\x27');var _0x345104=[{'name':_0x3c2b46}];if(!_[_0x47a5('0x86')](_0x274d31[_0x47a5('0x1e')]))_0x345104=_0x274d31[_0x47a5('0x1e')];var _0x215634=[];for(var _0x35cca8=0x0;_0x35cca8<_0x345104[_0x47a5('0x87')];_0x35cca8++){_0x215634['push'](_0x4880bf[_0x47a5('0x88')][_0x47a5('0x89')]({'where':{'userProfileId':_0x4d3db1[_0x47a5('0x8a')]['id'],'name':_0x345104[_0x35cca8][_0x47a5('0x18')]},'raw':!![]}));}return Promise[_0x47a5('0x8b')](_0x215634)['then'](function(_0xbec033){var _0xdfcecc=_[_0x47a5('0x5')](_0xbec033,function(_0x144aaa){return _0x144aaa?_0x144aaa:undefined;});var _0x4228a3=_[_0x47a5('0x5')](_0x345104,[_0x47a5('0x8c'),!![]]);var _0x149d34=_[_0x47a5('0x86')](_0xdfcecc)&&_[_0x47a5('0x86')](_0x4228a3)?null:_[_0x47a5('0x8d')](_0x4228a3,_0xdfcecc);if(!_0x149d34)return null;var _0x44fda9=[];for(var _0x3c0006=0x0;_0x3c0006<_0x149d34[_0x47a5('0x87')];_0x3c0006++){var _0x3edd17=_['find'](_0x345104,function(_0x42dd7d){return _0x149d34[_0x3c0006]?_0x42dd7d[_0x47a5('0x18')]===_0x149d34[_0x3c0006][_0x47a5('0x18')]:null;});if(_0x3edd17){if(_0x149d34[_0x3c0006]['ignore']){_0x44fda9[_0x47a5('0x8e')](_0x11bf85(_0x274d31[_0x47a5('0x12')],_0x149d34[_0x3c0006]));}else{if(!_0x149d34[_0x3c0006][_0x47a5('0x8f')]){_0x44fda9[_0x47a5('0x8e')](_0x3b001e(_0x3edd17,_0x149d34[_0x3c0006],_0x274d31['childModel']));}else{if(_0x3edd17[_0x47a5('0xa')]){_0x44fda9['push'](_0x49e844(_0x3edd17,_0x149d34[_0x3c0006]));}}}}}return Promise[_0x47a5('0x8b')](_0x44fda9);})['then'](function(_0x43f649){var _0x4cf7c5=_0x43f649;var _0x7c1190=null;if(_0x4cf7c5){_0x7c1190=_0x4cf7c5[_0x47a5('0x87')]===0x1?_0x4cf7c5[0x0]:null;}if(!_0x7c1190&&!_0x4cf7c5)return _0x45d4b6;var _0x2578d6=_0x4880bf[_0x274d31['childModel']]['rawAttributes'];_0x23020b['model']=_[_0x47a5('0x90')](_0x2578d6);_0x23020b[_0x47a5('0x83')]=_[_0x47a5('0x90')](_0x4d3db1[_0x47a5('0x83')]);_0x23020b['filters']=_[_0x47a5('0x91')](_0x23020b[_0x47a5('0xa')],_0x23020b[_0x47a5('0x83')]);_0x139229[_0x47a5('0x92')]=_[_0x47a5('0x91')](_0x23020b[_0x47a5('0xa')],qs[_0x47a5('0x93')](_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x93')]));_0x139229[_0x47a5('0x92')]=_0x139229[_0x47a5('0x92')][_0x47a5('0x87')]?_0x139229['attributes']:_0x23020b[_0x47a5('0xa')];if(!_0x4d3db1['query'][_0x47a5('0x94')](_0x47a5('0x95'))){_0x139229[_0x47a5('0x96')]=qs[_0x47a5('0x96')](_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x96')]);_0x139229[_0x47a5('0x97')]=qs[_0x47a5('0x97')](_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x97')]);}_0x139229[_0x47a5('0x98')]=qs[_0x47a5('0x99')](_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x99')]);_0x139229[_0x47a5('0x7d')]=qs['filters'](_['pick'](_0x4d3db1['query'],_0x23020b['filters']));if(_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x5')]){_0x139229['where']=_[_0x47a5('0x9a')](_0x139229[_0x47a5('0x7d')],{'$or':_[_0x47a5('0x9')](_0x2578d6,function(_0x396102){if(_0x396102[_0x47a5('0xf')][_0x47a5('0x9b')]!==_0x47a5('0x9c')){var _0x1c7302={};_0x1c7302[_0x396102[_0x47a5('0x6')]]={'$like':'%'+_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x5')]+'%'};return _0x1c7302;}})});}var _0x5e5f16=[];var _0x18fa31=null;var _0x1fbd42={};if(_0x7c1190){_0x18fa31=_[_0x47a5('0x89')](_0x345104,['name',_0x7c1190[_0x47a5('0x18')]]);if(_0x18fa31[_0x47a5('0x6')]){_0x1fbd42={};if(_0x274d31[_0x47a5('0x12')]==='AnalyticExtractedReport'){_0x1fbd42[_0x18fa31[_0x47a5('0x9d')]]=_['map'](_0x7c1190['associatedResources'],'id');}else{_0x1fbd42[_0x18fa31[_0x47a5('0x9d')]]=_0x7c1190[_0x47a5('0x8')];}_0x5e5f16[_0x47a5('0x8e')](_0x1fbd42);}else{_0x139229[_0x47a5('0x7d')]['id']=_0x7c1190[_0x47a5('0x8')];}}else{for(var _0xea50f3=0x0;_0xea50f3<_0x4cf7c5['length'];_0xea50f3++){_0x18fa31=_['find'](_0x345104,[_0x47a5('0x18'),_0x4cf7c5[_0xea50f3]['name']]);if(_0x18fa31[_0x47a5('0x6')]){_0x1fbd42={};_0x1fbd42[_0x18fa31[_0x47a5('0x9d')]]=_0x4cf7c5[_0xea50f3][_0x47a5('0x8')];_0x5e5f16[_0x47a5('0x8e')](_0x1fbd42);}else{if(!_0x139229['where']['id'])_0x139229[_0x47a5('0x7d')]['id']=[];_0x4cf7c5[_0xea50f3]['associatedResources']['forEach'](function(_0x139c79){_0x139229[_0x47a5('0x7d')]['id']['push'](_0x139c79);});}}}if(!_[_0x47a5('0x86')](_0x5e5f16)){_0x139229[_0x47a5('0x7d')]=_[_0x47a5('0x9a')](_0x139229['where'],{'$and':{'$or':_0x5e5f16}});}_0x139229=_[_0x47a5('0x9a')]({},_0x139229,_0x4d3db1['options']);if(_0x7c1190&&!_0x7c1190[_0x47a5('0x8f')]&&_0x274d31[_0x47a5('0x12')]===_0x47a5('0x9e')){if(_0x4d3db1['query'][_0x47a5('0x9f')]){_0x139229[_0x47a5('0xa0')]=[{'all':!![]}];}return _0x4880bf[_0x274d31[_0x47a5('0x12')]]['findAll'](_0x139229)[_0x47a5('0xc')](function(_0x4f2fbb){var _0x3c012b=[];_0x4f2fbb['forEach'](function(_0x135d2e){var _0x20d8bd;switch(_0x135d2e[_0x47a5('0xa1')]){case _0x47a5('0xa2'):_0x20d8bd=_['find'](_0x7c1190[_0x47a5('0x8')],function(_0x2ae130){return _0x2ae130['id']===_0x135d2e[_0x47a5('0xa3')]&&_0x2ae130[_0x47a5('0xf')]===_0x47a5('0xa4');});break;case'custom':_0x20d8bd=_['find'](_0x7c1190[_0x47a5('0x8')],function(_0x4ab01f){return _0x4ab01f['id']===_0x135d2e[_0x47a5('0xa3')]&&_0x4ab01f[_0x47a5('0xf')]===_0x47a5('0xa5');});break;}if(_0x20d8bd)_0x3c012b['push'](_0x135d2e);});_0x45d4b6[_0x47a5('0xa6')]=_0x3c012b[_0x47a5('0x87')];_0x45d4b6['rows']=_0x3c012b;return _0x45d4b6;});}else{return _0x4880bf[_0x274d31[_0x47a5('0x12')]][_0x47a5('0xa6')]({'where':_0x139229[_0x47a5('0x7d')]})[_0x47a5('0xc')](function(_0x58dacd){_0x45d4b6['count']=_0x58dacd;if(_0x4d3db1[_0x47a5('0x83')][_0x47a5('0x9f')]){if(_0x274d31['childModel']===_0x47a5('0x1d')){_0x139229[_0x47a5('0xa0')]=[{'model':_0x4880bf['Tag'],'as':_0x47a5('0xa7'),'attributes':['id',_0x47a5('0x18'),_0x47a5('0xa8')],'required':_0x4d3db1['query'][_0x47a5('0xa9')]?!![]:![]},{'model':_0x4880bf['Tag'],'as':_0x47a5('0xaa'),'attributes':['id','name',_0x47a5('0xa8')],'through':_0x4d3db1[_0x47a5('0x83')]['tag']?{'attributes':[],'where':{'TagId':_0x4d3db1[_0x47a5('0x83')]['tag']||undefined}}:{},'required':_0x4d3db1[_0x47a5('0x83')][_0x47a5('0xa9')]?!![]:![]}];}else{_0x139229[_0x47a5('0xa0')]=[{'all':!![]}];}}return _0x4880bf[_0x274d31[_0x47a5('0x12')]]['findAll'](_0x139229);})[_0x47a5('0xc')](function(_0x593426){_0x45d4b6['rows']=_0x593426;if(_0x3c2b46===_0x47a5('0x2f')&&_0x4d3db1[_0x47a5('0x83')][_0x47a5('0xab')]===_0x47a5('0xac')){var _0x380c8b=[];for(var _0x5b1f5e=0x0;_0x5b1f5e<_0x45d4b6[_0x47a5('0xad')][_0x47a5('0x87')];_0x5b1f5e++){_0x380c8b[_0x47a5('0x8e')](_0x16bb8a(_0x47a5('0xae'),_0x45d4b6['rows'][_0x5b1f5e][_0x47a5('0xaf')]));_0x380c8b['push'](_0x16bb8a(_0x47a5('0xb0'),_0x45d4b6[_0x47a5('0xad')][_0x5b1f5e][_0x47a5('0xaf')]));_0x380c8b[_0x47a5('0x8e')](_0x16bb8a(_0x47a5('0xb1'),_0x45d4b6[_0x47a5('0xad')][_0x5b1f5e][_0x47a5('0xaf')]));_0x380c8b[_0x47a5('0x8e')](_0x16bb8a(_0x47a5('0xb2'),_0x45d4b6['rows'][_0x5b1f5e][_0x47a5('0xaf')]));_0x380c8b[_0x47a5('0x8e')](_0x16bb8a('openchannel',_0x45d4b6[_0x47a5('0xad')][_0x5b1f5e][_0x47a5('0xaf')]));_0x380c8b[_0x47a5('0x8e')](_0x16bb8a('whatsapp',_0x45d4b6['rows'][_0x5b1f5e][_0x47a5('0xaf')]));}return Promise[_0x47a5('0x8b')](_0x380c8b)['then'](function(){return _0x45d4b6;});}return _0x45d4b6;});}});}}});};
\ No newline at end of file
index 20164c7..da40b77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b7=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','error','message','catch','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userProfile.socket','register'];(function(_0xe5011a,_0x10e87f){var _0x444fd5=function(_0x464bf6){while(--_0x464bf6){_0xe5011a['push'](_0xe5011a['shift']());}};_0x444fd5(++_0x10e87f);}(_0x21b7,0xef));var _0x721b=function(_0x51e01a,_0x39bae4){_0x51e01a=_0x51e01a-0x0;var _0x187997=_0x21b7[_0x51e01a];return _0x187997;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x721b('0x0'));var rs=require(_0x721b('0x1'));var fs=require('fs');var Redis=require(_0x721b('0x2'));var db=require(_0x721b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x721b('0x4'));var config=require(_0x721b('0x5'));var jayson=require(_0x721b('0x6'));var client=jayson[_0x721b('0x7')][_0x721b('0x8')]({'port':0x232a});config[_0x721b('0x9')]=_['defaults'](config[_0x721b('0x9')],{'host':_0x721b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x721b('0xb'))[_0x721b('0xc')](socket);function respondWithRpcPromise(_0xe13699,_0x35f524,_0xfcc6d7){return new BPromise(function(_0x5e11e3,_0x302bfd){return client[_0x721b('0xd')](_0xe13699,_0xfcc6d7)[_0x721b('0xe')](function(_0x2c6f5a){logger[_0x721b('0xf')](_0x721b('0x10'),_0x35f524,_0x721b('0x11'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x35f524,_0x721b('0x11'),JSON['stringify'](_0x2c6f5a));if(_0x2c6f5a[_0x721b('0x12')]){if(_0x2c6f5a[_0x721b('0x12')]['code']===0x1f4){logger['error'](_0x721b('0x10'),_0x35f524,_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);return _0x302bfd(_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);}logger[_0x721b('0x12')](_0x721b('0x10'),_0x35f524,_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);return _0x5e11e3(_0x2c6f5a[_0x721b('0x12')][_0x721b('0x13')]);}else{logger[_0x721b('0xf')](_0x721b('0x10'),_0x35f524,_0x721b('0x11'));_0x5e11e3(_0x2c6f5a['result'][_0x721b('0x13')]);}})[_0x721b('0x14')](function(_0x821d77){logger[_0x721b('0x12')](_0x721b('0x10'),_0x35f524,_0x821d77);_0x302bfd(_0x821d77);});});}
\ No newline at end of file
+var _0x6dc0=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','UserProfile,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x2e8fa2,_0x3a2167){var _0x4f0b50=function(_0x582e44){while(--_0x582e44){_0x2e8fa2['push'](_0x2e8fa2['shift']());}};_0x4f0b50(++_0x3a2167);}(_0x6dc0,0xb6));var _0x06dc=function(_0x10244a,_0x3e96f4){_0x10244a=_0x10244a-0x0;var _0x4daacd=_0x6dc0[_0x10244a];return _0x4daacd;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});config[_0x06dc('0xa')]=_[_0x06dc('0xb')](config[_0x06dc('0xa')],{'host':_0x06dc('0xc'),'port':0x18eb});var socket=require(_0x06dc('0xd'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x128ea7,_0x1f2041,_0x4ec0aa){return new BPromise(function(_0x45693d,_0x1e7abd){return client[_0x06dc('0xe')](_0x128ea7,_0x4ec0aa)[_0x06dc('0xf')](function(_0x4fa7fc){logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x1f2041,'request\x20sent',JSON[_0x06dc('0x12')](_0x4fa7fc));if(_0x4fa7fc['error']){if(_0x4fa7fc['error']['code']===0x1f4){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc[_0x06dc('0x13')]['message']);return _0x1e7abd(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc['error'][_0x06dc('0x14')]);return _0x45693d(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}else{logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');_0x45693d(_0x4fa7fc[_0x06dc('0x15')][_0x06dc('0x14')]);}})[_0x06dc('0x16')](function(_0xc658ea){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0xc658ea);_0x1e7abd(_0xc658ea);});});}
\ No newline at end of file
index 4367361..9c6ef3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1f0=['length','userProfile:','./userProfile.events','save','remove','emit','removeListener','register'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0xa1f0,0x162));var _0x0a1f=function(_0x2f3f58,_0xdd6784){_0x2f3f58=_0x2f3f58-0x0;var _0x19fdd1=_0xa1f0[_0x2f3f58];return _0x19fdd1;};'use strict';var UserProfileEvents=require(_0x0a1f('0x0'));var events=[_0x0a1f('0x1'),_0x0a1f('0x2'),'update'];function createListener(_0x2dc645,_0x5530ac){return function(_0x9511ff){_0x5530ac[_0x0a1f('0x3')](_0x2dc645,_0x9511ff);};}function removeListener(_0x49532d,_0x40ee06){return function(){UserProfileEvents[_0x0a1f('0x4')](_0x49532d,_0x40ee06);};}exports[_0x0a1f('0x5')]=function(_0x36626c){for(var _0x421298=0x0,_0xa9f624=events[_0x0a1f('0x6')];_0x421298<_0xa9f624;_0x421298++){var _0x5c36fa=events[_0x421298];var _0x4dfb3b=createListener(_0x0a1f('0x7')+_0x5c36fa,_0x36626c);UserProfileEvents['on'](_0x5c36fa,_0x4dfb3b);}};
\ No newline at end of file
+var _0x36d1=['emit','removeListener','length','userProfile:','remove','update'];(function(_0x17cca1,_0x4cd1f6){var _0x2a1d4a=function(_0x33c8a1){while(--_0x33c8a1){_0x17cca1['push'](_0x17cca1['shift']());}};_0x2a1d4a(++_0x4cd1f6);}(_0x36d1,0x13c));var _0x136d=function(_0x197ac2,_0x11d9e6){_0x197ac2=_0x197ac2-0x0;var _0x5a00e3=_0x36d1[_0x197ac2];return _0x5a00e3;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=['save',_0x136d('0x0'),_0x136d('0x1')];function createListener(_0x52d8cf,_0x4077a4){return function(_0x4108eb){_0x4077a4[_0x136d('0x2')](_0x52d8cf,_0x4108eb);};}function removeListener(_0x2834c7,_0x432487){return function(){UserProfileEvents[_0x136d('0x3')](_0x2834c7,_0x432487);};}exports['register']=function(_0x32343c){for(var _0x22390f=0x0,_0x1d435c=events[_0x136d('0x4')];_0x22390f<_0x1d435c;_0x22390f++){var _0x542d55=events[_0x22390f];var _0x1b9d17=createListener(_0x136d('0x5')+_0x542d55,_0x32343c);UserProfileEvents['on'](_0x542d55,_0x1b9d17);}};
\ No newline at end of file
index cb394a5..95bc12f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73fa=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x2a3698,_0x1d96d3){var _0x3a20c2=function(_0x1fffc1){while(--_0x1fffc1){_0x2a3698['push'](_0x2a3698['shift']());}};_0x3a20c2(++_0x1d96d3);}(_0x73fa,0x1f4));var _0xa73f=function(_0x43f585,_0x3f8ba8){_0x43f585=_0x43f585-0x0;var _0x399005=_0x73fa[_0x43f585];return _0x399005;};'use strict';var multer=require(_0xa73f('0x0'));var util=require(_0xa73f('0x1'));var path=require('path');var timeout=require(_0xa73f('0x2'));var express=require(_0xa73f('0x3'));var router=express[_0xa73f('0x4')]();var fs_extra=require(_0xa73f('0x5'));var auth=require(_0xa73f('0x6'));var interaction=require(_0xa73f('0x7'));var config=require(_0xa73f('0x8'));var controller=require('./userProfileResource.controller');router[_0xa73f('0x9')]('/',auth[_0xa73f('0xa')](),controller['index']);router[_0xa73f('0x9')]('/describe',auth[_0xa73f('0xa')](),controller[_0xa73f('0xb')]);router[_0xa73f('0x9')](_0xa73f('0xc'),auth['isAuthenticated'](),controller[_0xa73f('0xd')]);router[_0xa73f('0xe')]('/',auth[_0xa73f('0xa')](),controller[_0xa73f('0xf')]);router[_0xa73f('0x10')](_0xa73f('0xc'),auth['isAuthenticated'](),controller[_0xa73f('0x11')]);router['delete'](_0xa73f('0xc'),auth['isAuthenticated'](),controller[_0xa73f('0x12')]);module[_0xa73f('0x13')]=router;
\ No newline at end of file
+var _0x5c6d=['/:id','show','create','put','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated'];(function(_0x5b808b,_0x2c652b){var _0x1d1859=function(_0x5604af){while(--_0x5604af){_0x5b808b['push'](_0x5b808b['shift']());}};_0x1d1859(++_0x2c652b);}(_0x5c6d,0x195));var _0xd5c6=function(_0x49004c,_0x279390){_0x49004c=_0x49004c-0x0;var _0x4e9898=_0x5c6d[_0x49004c];return _0x4e9898;};'use strict';var multer=require(_0xd5c6('0x0'));var util=require(_0xd5c6('0x1'));var path=require('path');var timeout=require(_0xd5c6('0x2'));var express=require(_0xd5c6('0x3'));var router=express[_0xd5c6('0x4')]();var fs_extra=require(_0xd5c6('0x5'));var auth=require(_0xd5c6('0x6'));var interaction=require(_0xd5c6('0x7'));var config=require('../../config/environment');var controller=require(_0xd5c6('0x8'));router[_0xd5c6('0x9')]('/',auth[_0xd5c6('0xa')](),controller['index']);router[_0xd5c6('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd5c6('0x9')](_0xd5c6('0xb'),auth[_0xd5c6('0xa')](),controller[_0xd5c6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd5c6('0xd')]);router[_0xd5c6('0xe')](_0xd5c6('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd5c6('0xb'),auth[_0xd5c6('0xa')](),controller['destroy']);module[_0xd5c6('0xf')]=router;
\ No newline at end of file
index 68de3cb..7ce7c56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb0b=['INTEGER','STRING','sequelize'];(function(_0x34c3f3,_0x15f139){var _0x3ca5cb=function(_0x1c7ed6){while(--_0x1c7ed6){_0x34c3f3['push'](_0x34c3f3['shift']());}};_0x3ca5cb(++_0x15f139);}(_0xbb0b,0x1af));var _0xbbb0=function(_0x1c14e6,_0x12c86d){_0x1c14e6=_0x1c14e6-0x0;var _0x243c81=_0xbb0b[_0x1c14e6];return _0x243c81;};'use strict';var Sequelize=require(_0xbbb0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xbbb0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbbb0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xe36a=['STRING','INTEGER','exports'];(function(_0x21eef2,_0x1480ea){var _0x32f106=function(_0x409e7e){while(--_0x409e7e){_0x21eef2['push'](_0x21eef2['shift']());}};_0x32f106(++_0x1480ea);}(_0xe36a,0x119));var _0xae36=function(_0x2598f0,_0x3d61ff){_0x2598f0=_0x2598f0-0x0;var _0x4448c8=_0xe36a[_0x2598f0];return _0x4448c8;};'use strict';var Sequelize=require('sequelize');module[_0xae36('0x0')]={'name':{'type':Sequelize[_0xae36('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xae36('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xae36('0x1')],'allowNull':![]}};
\ No newline at end of file
index 4f7f625..34ccc0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x438434,_0x36f21f){var _0x3b97c9=function(_0x1ecb7b){while(--_0x1ecb7b){_0x438434['push'](_0x438434['shift']());}};_0x3b97c9(++_0x36f21f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1237d4,_0x20bbfc){_0x1237d4=_0x1237d4-0x0;var _0x441fb6=_0x5f2f[_0x1237d4];return _0x441fb6;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));};exports['describe']=function(_0x22b645,_0xe0ce7f){return db[_0xf5f2('0x29')][_0xf5f2('0x46')]()['then'](respondWithResult(_0xe0ce7f,null))['catch'](handleError(_0xe0ce7f,null));};
\ No newline at end of file
+var _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','UserProfileResource','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x2974b3,_0xb7923c){var _0x675266=function(_0x41ad89){while(--_0x41ad89){_0x2974b3['push'](_0x2974b3['shift']());}};_0x675266(++_0xb7923c);}(_0xf61e,0x191));var _0xef61=function(_0x40b11b,_0x2d1710){_0x40b11b=_0x40b11b-0x0;var _0x53d11e=_0xf61e[_0x40b11b];return _0x53d11e;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['UserProfileResource']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['UserProfileResource'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));};
\ No newline at end of file
index 8534899..42a4523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82ac=['resourceId','sectionId','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0x12fc43,_0x5b4d63){var _0x572142=function(_0x4d5855){while(--_0x4d5855){_0x12fc43['push'](_0x12fc43['shift']());}};_0x572142(++_0x5b4d63);}(_0x82ac,0x179));var _0xc82a=function(_0x3e154e,_0x18d45c){_0x3e154e=_0x3e154e-0x0;var _0x1c387a=_0x82ac[_0x3e154e];return _0x1c387a;};'use strict';var _=require(_0xc82a('0x0'));var util=require(_0xc82a('0x1'));var logger=require('../../config/logger')(_0xc82a('0x2'));var moment=require(_0xc82a('0x3'));var BPromise=require(_0xc82a('0x4'));var rp=require(_0xc82a('0x5'));var fs=require('fs');var path=require(_0xc82a('0x6'));var rimraf=require('rimraf');var config=require(_0xc82a('0x7'));var attributes=require(_0xc82a('0x8'));module[_0xc82a('0x9')]=function(_0x174d32,_0x122498){return _0x174d32[_0xc82a('0xa')](_0xc82a('0xb'),attributes,{'tableName':_0xc82a('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xc82a('0xd'),_0xc82a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b5b=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment'];(function(_0x43d8c1,_0x5ed732){var _0x1f79fc=function(_0x24fcaf){while(--_0x24fcaf){_0x43d8c1['push'](_0x43d8c1['shift']());}};_0x1f79fc(++_0x5ed732);}(_0x2b5b,0x10c));var _0xb2b5=function(_0x26e322,_0x56b29c){_0x26e322=_0x26e322-0x0;var _0x56ed11=_0x2b5b[_0x26e322];return _0x56ed11;};'use strict';var _=require('lodash');var util=require(_0xb2b5('0x0'));var logger=require(_0xb2b5('0x1'))(_0xb2b5('0x2'));var moment=require(_0xb2b5('0x3'));var BPromise=require('bluebird');var rp=require(_0xb2b5('0x4'));var fs=require('fs');var path=require(_0xb2b5('0x5'));var rimraf=require(_0xb2b5('0x6'));var config=require(_0xb2b5('0x7'));var attributes=require(_0xb2b5('0x8'));module[_0xb2b5('0x9')]=function(_0x3653d9,_0x44420d){return _0x3653d9[_0xb2b5('0xa')](_0xb2b5('0xb'),attributes,{'tableName':_0xb2b5('0xc'),'paranoid':![],'indexes':[{'name':_0xb2b5('0xd'),'fields':[_0xb2b5('0xe'),_0xb2b5('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 0d6b059..7b961e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x624d=['info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x624d,0x1ed));var _0xd624=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x624d[_0x590b61];return _0x1a14dc;};'use strict';var _=require(_0xd624('0x0'));var util=require(_0xd624('0x1'));var moment=require(_0xd624('0x2'));var BPromise=require(_0xd624('0x3'));var rs=require(_0xd624('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd624('0x5'))(_0xd624('0x6'));var config=require(_0xd624('0x7'));var jayson=require(_0xd624('0x8'));var client=jayson[_0xd624('0x9')][_0xd624('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d8b1e,_0x3fa6af,_0x1f43b1){return new BPromise(function(_0x916e0b,_0x2bf2d7){return client[_0xd624('0xb')](_0x2d8b1e,_0x1f43b1)[_0xd624('0xc')](function(_0x2d7791){logger[_0xd624('0xd')](_0xd624('0xe'),_0x3fa6af,'request\x20sent');logger['debug'](_0xd624('0xf'),_0x3fa6af,_0xd624('0x10'),JSON[_0xd624('0x11')](_0x2d7791));if(_0x2d7791[_0xd624('0x12')]){if(_0x2d7791[_0xd624('0x12')][_0xd624('0x13')]===0x1f4){logger[_0xd624('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x3fa6af,_0x2d7791[_0xd624('0x12')]['message']);return _0x2bf2d7(_0x2d7791[_0xd624('0x12')]['message']);}logger[_0xd624('0x12')](_0xd624('0xe'),_0x3fa6af,_0x2d7791[_0xd624('0x12')][_0xd624('0x14')]);return _0x916e0b(_0x2d7791['error'][_0xd624('0x14')]);}else{logger[_0xd624('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x3fa6af,_0xd624('0x10'));_0x916e0b(_0x2d7791[_0xd624('0x15')][_0xd624('0x14')]);}})[_0xd624('0x16')](function(_0x23b0a2){logger[_0xd624('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x3fa6af,_0x23b0a2);_0x2bf2d7(_0x23b0a2);});});}
\ No newline at end of file
+var _0x165f=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x165f,0x162));var _0xf165=function(_0x2b68d9,_0x43c119){_0x2b68d9=_0x2b68d9-0x0;var _0x2f7983=_0x165f[_0x2b68d9];return _0x2f7983;};'use strict';var _=require(_0xf165('0x0'));var util=require(_0xf165('0x1'));var moment=require(_0xf165('0x2'));var BPromise=require(_0xf165('0x3'));var rs=require(_0xf165('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf165('0x5'))['db'];var utils=require(_0xf165('0x6'));var logger=require('../../config/logger')(_0xf165('0x7'));var config=require('../../config/environment');var jayson=require(_0xf165('0x8'));var client=jayson[_0xf165('0x9')][_0xf165('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2143ce,_0x4e0f8d,_0x914342){return new BPromise(function(_0x52f1ed,_0x565cc5){return client[_0xf165('0xb')](_0x2143ce,_0x914342)[_0xf165('0xc')](function(_0x5990bb){logger[_0xf165('0xd')](_0xf165('0xe'),_0x4e0f8d,_0xf165('0xf'));logger[_0xf165('0x10')](_0xf165('0x11'),_0x4e0f8d,_0xf165('0xf'),JSON[_0xf165('0x12')](_0x5990bb));if(_0x5990bb[_0xf165('0x13')]){if(_0x5990bb[_0xf165('0x13')]['code']===0x1f4){logger[_0xf165('0x13')](_0xf165('0xe'),_0x4e0f8d,_0x5990bb[_0xf165('0x13')][_0xf165('0x14')]);return _0x565cc5(_0x5990bb['error'][_0xf165('0x14')]);}logger[_0xf165('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x4e0f8d,_0x5990bb['error'][_0xf165('0x14')]);return _0x52f1ed(_0x5990bb[_0xf165('0x13')][_0xf165('0x14')]);}else{logger[_0xf165('0xd')](_0xf165('0xe'),_0x4e0f8d,_0xf165('0xf'));_0x52f1ed(_0x5990bb[_0xf165('0x15')][_0xf165('0x14')]);}})[_0xf165('0x16')](function(_0x1c4939){logger[_0xf165('0x13')](_0xf165('0xe'),_0x4e0f8d,_0x1c4939);_0x565cc5(_0x1c4939);});});}
\ No newline at end of file
index 285fb03..876fdb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f22=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x9f22,0x96));var _0x29f2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9f22[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x29f2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29f2('0x1'));var express=require(_0x29f2('0x2'));var router=express[_0x29f2('0x3')]();var fs_extra=require(_0x29f2('0x4'));var auth=require(_0x29f2('0x5'));var interaction=require(_0x29f2('0x6'));var config=require(_0x29f2('0x7'));var controller=require(_0x29f2('0x8'));router[_0x29f2('0x9')]('/',auth[_0x29f2('0xa')](),controller[_0x29f2('0xb')]);router[_0x29f2('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x29f2('0xc'),auth['isAuthenticated'](),controller[_0x29f2('0xd')]);router[_0x29f2('0xe')]('/',auth[_0x29f2('0xa')](),controller['create']);router[_0x29f2('0xf')](_0x29f2('0xc'),auth['isAuthenticated'](),controller[_0x29f2('0x10')]);router[_0x29f2('0x11')](_0x29f2('0xc'),auth[_0x29f2('0xa')](),controller[_0x29f2('0x12')]);module[_0x29f2('0x13')]=router;
\ No newline at end of file
+var _0xb3c9=['../../config/environment','./userProfileSection.controller','get','/describe','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e8af2,_0x29d4b7){var _0xbf64be=function(_0x10275d){while(--_0x10275d){_0x4e8af2['push'](_0x4e8af2['shift']());}};_0xbf64be(++_0x29d4b7);}(_0xb3c9,0x8b));var _0x9b3c=function(_0x1d4202,_0x350cea){_0x1d4202=_0x1d4202-0x0;var _0x301d41=_0xb3c9[_0x1d4202];return _0x301d41;};'use strict';var multer=require(_0x9b3c('0x0'));var util=require(_0x9b3c('0x1'));var path=require(_0x9b3c('0x2'));var timeout=require(_0x9b3c('0x3'));var express=require(_0x9b3c('0x4'));var router=express[_0x9b3c('0x5')]();var fs_extra=require(_0x9b3c('0x6'));var auth=require(_0x9b3c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9b3c('0x8'));var controller=require(_0x9b3c('0x9'));router[_0x9b3c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9b3c('0xa')](_0x9b3c('0xb'),auth[_0x9b3c('0xc')](),controller['describe']);router[_0x9b3c('0xa')](_0x9b3c('0xd'),auth[_0x9b3c('0xc')](),controller[_0x9b3c('0xe')]);router[_0x9b3c('0xf')]('/',auth['isAuthenticated'](),controller[_0x9b3c('0x10')]);router['put'](_0x9b3c('0xd'),auth[_0x9b3c('0xc')](),controller[_0x9b3c('0x11')]);router[_0x9b3c('0x12')]('/:id',auth[_0x9b3c('0xc')](),controller[_0x9b3c('0x13')]);module[_0x9b3c('0x14')]=router;
\ No newline at end of file
index 2b6e8fe..1c9ffde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x560a4d,_0x4a2527){var _0x2cd885=function(_0x3708e8){while(--_0x3708e8){_0x560a4d['push'](_0x560a4d['shift']());}};_0x2cd885(++_0x4a2527);}(_0xac4a,0x13f));var _0xaac4=function(_0x412b24,_0x3bec97){_0x412b24=_0x412b24-0x0;var _0x83af99=_0xac4a[_0x412b24];return _0x83af99;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'name':{'type':Sequelize[_0xaac4('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xaac4('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaac4('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xaac4('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2af0f6){this[_0xaac4('0x5')](_0xaac4('0x6'),_0x2af0f6?_0x2af0f6['join'](''):[]);},'get':function(){return this[_0xaac4('0x7')]('crudPermissions')?this[_0xaac4('0x7')]('crudPermissions')[_0xaac4('0x8')](''):[];}}};
\ No newline at end of file
+var _0xe511=['exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x4cff95,_0x1aa076){var _0x1c9b72=function(_0x39eeb8){while(--_0x39eeb8){_0x4cff95['push'](_0x4cff95['shift']());}};_0x1c9b72(++_0x1aa076);}(_0xe511,0x16f));var _0x1e51=function(_0x3bf36d,_0x271147){_0x3bf36d=_0x3bf36d-0x0;var _0x1dd0f3=_0xe511[_0x3bf36d];return _0x1dd0f3;};'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 9b1c16d..ec637be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6be=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0xa6be,0xdd));var _0xea6b=function(_0x117109,_0x1c8d5f){_0x117109=_0x117109-0x0;var _0x56b766=_0xa6be[_0x117109];return _0x56b766;};'use strict';var emlformat=require(_0xea6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea6b('0x2'));var moment=require(_0xea6b('0x3'));var BPromise=require(_0xea6b('0x4'));var Mustache=require(_0xea6b('0x5'));var util=require(_0xea6b('0x6'));var path=require(_0xea6b('0x7'));var sox=require(_0xea6b('0x8'));var csv=require(_0xea6b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea6b('0xa'));var squel=require(_0xea6b('0xb'));var crypto=require(_0xea6b('0xc'));var jsforce=require(_0xea6b('0xd'));var deskjs=require(_0xea6b('0xe'));var toCsv=require(_0xea6b('0x9'));var querystring=require(_0xea6b('0xf'));var Papa=require(_0xea6b('0x10'));var Redis=require(_0xea6b('0x11'));var authService=require(_0xea6b('0x12'));var qs=require(_0xea6b('0x13'));var as=require(_0xea6b('0x14'));var hardwareService=require(_0xea6b('0x15'));var logger=require(_0xea6b('0x16'))(_0xea6b('0x17'));var utils=require(_0xea6b('0x18'));var config=require(_0xea6b('0x19'));var licenseUtil=require(_0xea6b('0x1a'));var db=require(_0xea6b('0x1b'))['db'];function respondWithStatusCode(_0xaffc1c,_0x1c5113){_0x1c5113=_0x1c5113||0xcc;return function(_0x267d32){if(_0x267d32){return _0xaffc1c[_0xea6b('0x1c')](_0x1c5113);}return _0xaffc1c[_0xea6b('0x1d')](_0x1c5113)[_0xea6b('0x1e')]();};}function respondWithResult(_0x360273,_0x1c9c1a){_0x1c9c1a=_0x1c9c1a||0xc8;return function(_0xf8487){if(_0xf8487){return _0x360273['status'](_0x1c9c1a)['json'](_0xf8487);}};}function respondWithFilteredResult(_0x392131,_0x11ccd2){return function(_0x5a78b6){if(_0x5a78b6){var _0x4a2203=typeof _0x11ccd2['offset']===_0xea6b('0x1f')&&typeof _0x11ccd2[_0xea6b('0x20')]===_0xea6b('0x1f');var _0x13f4ef=_0x5a78b6[_0xea6b('0x21')];var _0x352674=_0x4a2203?0x0:_0x11ccd2['offset'];var _0x1095b3=_0x4a2203?_0x5a78b6[_0xea6b('0x21')]:_0x11ccd2[_0xea6b('0x22')]+_0x11ccd2[_0xea6b('0x20')];var _0x2ee1d6;if(_0x1095b3>=_0x13f4ef){_0x1095b3=_0x13f4ef;_0x2ee1d6=0xc8;}else{_0x2ee1d6=0xce;}_0x392131[_0xea6b('0x1d')](_0x2ee1d6);return _0x392131['set'](_0xea6b('0x23'),_0x352674+'-'+_0x1095b3+'/'+_0x13f4ef)[_0xea6b('0x24')](_0x5a78b6);}return null;};}function patchUpdates(_0x500c7e){return function(_0x23cc1e){try{jsonpatch[_0xea6b('0x25')](_0x23cc1e,_0x500c7e,!![]);}catch(_0x151b92){return BPromise[_0xea6b('0x26')](_0x151b92);}return _0x23cc1e[_0xea6b('0x27')]();};}function saveUpdates(_0x507152,_0x5cc3f2){return function(_0x361ab4){if(_0x361ab4){return _0x361ab4['update'](_0x507152)[_0xea6b('0x28')](function(_0x42de59){return _0x42de59;});}return null;};}function removeEntity(_0x490d73,_0x197e90){return function(_0x439ac3){if(_0x439ac3){return _0x439ac3['destroy']()['then'](function(){_0x490d73[_0xea6b('0x1d')](0xcc)[_0xea6b('0x1e')]();});}};}function handleEntityNotFound(_0x2c4975,_0x578ded){return function(_0x2c000e){if(!_0x2c000e){_0x2c4975[_0xea6b('0x1c')](0x194);}return _0x2c000e;};}function handleError(_0x192984,_0x7d5d73){_0x7d5d73=_0x7d5d73||0x1f4;return function(_0x28e40b){logger[_0xea6b('0x29')](_0x28e40b[_0xea6b('0x2a')]);if(_0x28e40b[_0xea6b('0x2b')]){delete _0x28e40b[_0xea6b('0x2b')];}_0x192984['status'](_0x7d5d73)[_0xea6b('0x2c')](_0x28e40b);};}exports['index']=function(_0x2cdf83,_0x858af0){var _0xd57a94={},_0x1d5d25={},_0x25b78d={'count':0x0,'rows':[]};var _0x73f789=_[_0xea6b('0x2d')](db[_0xea6b('0x2e')][_0xea6b('0x2f')],function(_0x1db5c1){return{'name':_0x1db5c1[_0xea6b('0x30')],'type':_0x1db5c1[_0xea6b('0x31')][_0xea6b('0x32')]};});_0x1d5d25['model']=_[_0xea6b('0x2d')](_0x73f789,_0xea6b('0x2b'));_0x1d5d25[_0xea6b('0x33')]=_['keys'](_0x2cdf83['query']);_0x1d5d25[_0xea6b('0x34')]=_[_0xea6b('0x35')](_0x1d5d25[_0xea6b('0x36')],_0x1d5d25[_0xea6b('0x33')]);_0xd57a94[_0xea6b('0x37')]=_[_0xea6b('0x35')](_0x1d5d25[_0xea6b('0x36')],qs[_0xea6b('0x38')](_0x2cdf83[_0xea6b('0x33')][_0xea6b('0x38')]));_0xd57a94[_0xea6b('0x37')]=_0xd57a94[_0xea6b('0x37')][_0xea6b('0x39')]?_0xd57a94[_0xea6b('0x37')]:_0x1d5d25['model'];if(!_0x2cdf83[_0xea6b('0x33')][_0xea6b('0x3a')](_0xea6b('0x3b'))){_0xd57a94['limit']=qs[_0xea6b('0x20')](_0x2cdf83[_0xea6b('0x33')]['limit']);_0xd57a94['offset']=qs['offset'](_0x2cdf83[_0xea6b('0x33')][_0xea6b('0x22')]);}_0xd57a94[_0xea6b('0x3c')]=qs[_0xea6b('0x3d')](_0x2cdf83['query'][_0xea6b('0x3d')]);_0xd57a94[_0xea6b('0x3e')]=qs[_0xea6b('0x34')](_[_0xea6b('0x3f')](_0x2cdf83[_0xea6b('0x33')],_0x1d5d25['filters']),_0x73f789);if(_0x2cdf83[_0xea6b('0x33')][_0xea6b('0x40')]){_0xd57a94[_0xea6b('0x3e')]=_['merge'](_0xd57a94[_0xea6b('0x3e')],{'$or':_[_0xea6b('0x2d')](_0x73f789,function(_0x135fd9){if(_0x135fd9['type']!==_0xea6b('0x41')){var _0x1be029={};_0x1be029[_0x135fd9[_0xea6b('0x2b')]]={'$like':'%'+_0x2cdf83[_0xea6b('0x33')]['filter']+'%'};return _0x1be029;}})});}_0xd57a94=_[_0xea6b('0x42')]({},_0xd57a94,_0x2cdf83[_0xea6b('0x43')]);var _0x3c5a27={'where':_0xd57a94[_0xea6b('0x3e')]};return db[_0xea6b('0x2e')][_0xea6b('0x21')](_0x3c5a27)[_0xea6b('0x28')](function(_0x2d2e69){_0x25b78d[_0xea6b('0x21')]=_0x2d2e69;if(_0x2cdf83[_0xea6b('0x33')][_0xea6b('0x44')]){_0xd57a94[_0xea6b('0x45')]=[{'all':!![]}];}return db[_0xea6b('0x2e')][_0xea6b('0x46')](_0xd57a94);})[_0xea6b('0x28')](function(_0x2eebff){_0x25b78d[_0xea6b('0x47')]=_0x2eebff;return _0x25b78d;})['then'](respondWithFilteredResult(_0x858af0,_0xd57a94))[_0xea6b('0x48')](handleError(_0x858af0,null));};exports[_0xea6b('0x49')]=function(_0x19c4a7,_0x4cd67a){var _0x68241={'raw':![],'where':{'id':_0x19c4a7[_0xea6b('0x4a')]['id']}},_0x33a484={};_0x33a484['model']=_[_0xea6b('0x4b')](db[_0xea6b('0x2e')][_0xea6b('0x2f')]);_0x33a484[_0xea6b('0x33')]=_[_0xea6b('0x4b')](_0x19c4a7[_0xea6b('0x33')]);_0x33a484[_0xea6b('0x34')]=_['intersection'](_0x33a484['model'],_0x33a484[_0xea6b('0x33')]);_0x68241['attributes']=_[_0xea6b('0x35')](_0x33a484[_0xea6b('0x36')],qs[_0xea6b('0x38')](_0x19c4a7[_0xea6b('0x33')][_0xea6b('0x38')]));_0x68241[_0xea6b('0x37')]=_0x68241['attributes'][_0xea6b('0x39')]?_0x68241['attributes']:_0x33a484[_0xea6b('0x36')];if(_0x19c4a7[_0xea6b('0x33')][_0xea6b('0x44')]){_0x68241[_0xea6b('0x45')]=[{'all':!![]}];}_0x68241=_[_0xea6b('0x42')]({},_0x68241,_0x19c4a7[_0xea6b('0x43')]);return db['UserProfileSection'][_0xea6b('0x4c')](_0x68241)[_0xea6b('0x28')](handleEntityNotFound(_0x4cd67a,null))[_0xea6b('0x28')](respondWithResult(_0x4cd67a,null))[_0xea6b('0x48')](handleError(_0x4cd67a,null));};exports['create']=function(_0x46f26e,_0x318465){return db['UserProfileSection'][_0xea6b('0x4d')](_0x46f26e[_0xea6b('0x4e')],{})[_0xea6b('0x28')](respondWithResult(_0x318465,0xc9))[_0xea6b('0x48')](handleError(_0x318465,null));};exports[_0xea6b('0x4f')]=function(_0xd9eeec,_0x59e485){if(_0xd9eeec[_0xea6b('0x4e')]['id']){delete _0xd9eeec[_0xea6b('0x4e')]['id'];}return db[_0xea6b('0x2e')][_0xea6b('0x4c')]({'where':{'id':_0xd9eeec['params']['id']}})[_0xea6b('0x28')](handleEntityNotFound(_0x59e485,null))[_0xea6b('0x28')](saveUpdates(_0xd9eeec[_0xea6b('0x4e')],null))[_0xea6b('0x28')](respondWithResult(_0x59e485,null))[_0xea6b('0x48')](handleError(_0x59e485,null));};exports[_0xea6b('0x50')]=function(_0x377b78,_0x1b55a7){return db[_0xea6b('0x2e')][_0xea6b('0x4c')]({'where':{'id':_0x377b78['params']['id']}})['then'](handleEntityNotFound(_0x1b55a7,null))[_0xea6b('0x28')](removeEntity(_0x1b55a7,null))[_0xea6b('0x48')](handleError(_0x1b55a7,null));};exports[_0xea6b('0x51')]=function(_0x166bba,_0x3335ee){return db[_0xea6b('0x2e')]['describe']()[_0xea6b('0x28')](respondWithResult(_0x3335ee,null))[_0xea6b('0x48')](handleError(_0x3335ee,null));};
\ No newline at end of file
+var _0x934e=['lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','UserProfileSection','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','options','find','create','body','update','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra'];(function(_0x4a4fb8,_0x1c8af){var _0x1d27c8=function(_0x56ae4f){while(--_0x56ae4f){_0x4a4fb8['push'](_0x4a4fb8['shift']());}};_0x1d27c8(++_0x1c8af);}(_0x934e,0x81));var _0xe934=function(_0x9afd13,_0x43e63d){_0x9afd13=_0x9afd13-0x0;var _0x4e50e8=_0x934e[_0x9afd13];return _0x4e50e8;};'use strict';var emlformat=require(_0xe934('0x0'));var rimraf=require(_0xe934('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe934('0x2'));var rp=require(_0xe934('0x3'));var moment=require('moment');var BPromise=require(_0xe934('0x4'));var Mustache=require('mustache');var util=require(_0xe934('0x5'));var path=require('path');var sox=require(_0xe934('0x6'));var csv=require(_0xe934('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe934('0x8'));var _=require(_0xe934('0x9'));var squel=require(_0xe934('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe934('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe934('0xc'));var Papa=require(_0xe934('0xd'));var Redis=require('ioredis');var authService=require(_0xe934('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe934('0xf'));var hardwareService=require(_0xe934('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe934('0x11'));var licenseUtil=require(_0xe934('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa5cd5e,_0x4a34ad){_0x4a34ad=_0x4a34ad||0xcc;return function(_0x219e33){if(_0x219e33){return _0xa5cd5e['sendStatus'](_0x4a34ad);}return _0xa5cd5e[_0xe934('0x13')](_0x4a34ad)[_0xe934('0x14')]();};}function respondWithResult(_0x1a7f84,_0x2520ca){_0x2520ca=_0x2520ca||0xc8;return function(_0x11b361){if(_0x11b361){return _0x1a7f84['status'](_0x2520ca)[_0xe934('0x15')](_0x11b361);}};}function respondWithFilteredResult(_0x59dfb2,_0x53b9ae){return function(_0x2651a9){if(_0x2651a9){var _0x533935=typeof _0x53b9ae['offset']===_0xe934('0x16')&&typeof _0x53b9ae[_0xe934('0x17')]===_0xe934('0x16');var _0x5b54b4=_0x2651a9['count'];var _0xc21db7=_0x533935?0x0:_0x53b9ae['offset'];var _0x23ff7e=_0x533935?_0x2651a9[_0xe934('0x18')]:_0x53b9ae[_0xe934('0x19')]+_0x53b9ae[_0xe934('0x17')];var _0x4d6f5a;if(_0x23ff7e>=_0x5b54b4){_0x23ff7e=_0x5b54b4;_0x4d6f5a=0xc8;}else{_0x4d6f5a=0xce;}_0x59dfb2[_0xe934('0x13')](_0x4d6f5a);return _0x59dfb2[_0xe934('0x1a')](_0xe934('0x1b'),_0xc21db7+'-'+_0x23ff7e+'/'+_0x5b54b4)['json'](_0x2651a9);}return null;};}function patchUpdates(_0x16be6c){return function(_0x4e53a1){try{jsonpatch['apply'](_0x4e53a1,_0x16be6c,!![]);}catch(_0x1d24ee){return BPromise['reject'](_0x1d24ee);}return _0x4e53a1[_0xe934('0x1c')]();};}function saveUpdates(_0x55b047,_0x3e7ac3){return function(_0x41bc55){if(_0x41bc55){return _0x41bc55['update'](_0x55b047)[_0xe934('0x1d')](function(_0x26dd5e){return _0x26dd5e;});}return null;};}function removeEntity(_0x1e5e28,_0x1dab9b){return function(_0x34fa75){if(_0x34fa75){return _0x34fa75[_0xe934('0x1e')]()[_0xe934('0x1d')](function(){_0x1e5e28[_0xe934('0x13')](0xcc)[_0xe934('0x14')]();});}};}function handleEntityNotFound(_0xde3836,_0x5ec7d6){return function(_0x28a218){if(!_0x28a218){_0xde3836[_0xe934('0x1f')](0x194);}return _0x28a218;};}function handleError(_0x4435a0,_0x9d5a3c){_0x9d5a3c=_0x9d5a3c||0x1f4;return function(_0x4f15ac){logger[_0xe934('0x20')](_0x4f15ac[_0xe934('0x21')]);if(_0x4f15ac[_0xe934('0x22')]){delete _0x4f15ac[_0xe934('0x22')];}_0x4435a0[_0xe934('0x13')](_0x9d5a3c)[_0xe934('0x23')](_0x4f15ac);};}exports[_0xe934('0x24')]=function(_0x3cc1a1,_0x523e67){var _0x4b503c={},_0x227d07={},_0x4229f0={'count':0x0,'rows':[]};var _0xcccc40=_[_0xe934('0x25')](db[_0xe934('0x26')]['rawAttributes'],function(_0x16220c){return{'name':_0x16220c[_0xe934('0x27')],'type':_0x16220c['type'][_0xe934('0x28')]};});_0x227d07[_0xe934('0x29')]=_[_0xe934('0x25')](_0xcccc40,_0xe934('0x22'));_0x227d07[_0xe934('0x2a')]=_[_0xe934('0x2b')](_0x3cc1a1[_0xe934('0x2a')]);_0x227d07['filters']=_[_0xe934('0x2c')](_0x227d07[_0xe934('0x29')],_0x227d07['query']);_0x4b503c[_0xe934('0x2d')]=_[_0xe934('0x2c')](_0x227d07[_0xe934('0x29')],qs[_0xe934('0x2e')](_0x3cc1a1[_0xe934('0x2a')]['fields']));_0x4b503c[_0xe934('0x2d')]=_0x4b503c[_0xe934('0x2d')][_0xe934('0x2f')]?_0x4b503c[_0xe934('0x2d')]:_0x227d07[_0xe934('0x29')];if(!_0x3cc1a1[_0xe934('0x2a')][_0xe934('0x30')]('nolimit')){_0x4b503c['limit']=qs[_0xe934('0x17')](_0x3cc1a1[_0xe934('0x2a')][_0xe934('0x17')]);_0x4b503c['offset']=qs[_0xe934('0x19')](_0x3cc1a1['query'][_0xe934('0x19')]);}_0x4b503c['order']=qs[_0xe934('0x31')](_0x3cc1a1[_0xe934('0x2a')]['sort']);_0x4b503c[_0xe934('0x32')]=qs[_0xe934('0x33')](_['pick'](_0x3cc1a1['query'],_0x227d07[_0xe934('0x33')]),_0xcccc40);if(_0x3cc1a1[_0xe934('0x2a')][_0xe934('0x34')]){_0x4b503c['where']=_[_0xe934('0x35')](_0x4b503c[_0xe934('0x32')],{'$or':_[_0xe934('0x25')](_0xcccc40,function(_0x330076){if(_0x330076[_0xe934('0x36')]!==_0xe934('0x37')){var _0xfb5e67={};_0xfb5e67[_0x330076[_0xe934('0x22')]]={'$like':'%'+_0x3cc1a1[_0xe934('0x2a')][_0xe934('0x34')]+'%'};return _0xfb5e67;}})});}_0x4b503c=_['merge']({},_0x4b503c,_0x3cc1a1['options']);var _0x13e777={'where':_0x4b503c[_0xe934('0x32')]};return db[_0xe934('0x26')][_0xe934('0x18')](_0x13e777)[_0xe934('0x1d')](function(_0x19f5b4){_0x4229f0[_0xe934('0x18')]=_0x19f5b4;if(_0x3cc1a1[_0xe934('0x2a')][_0xe934('0x38')]){_0x4b503c[_0xe934('0x39')]=[{'all':!![]}];}return db[_0xe934('0x26')][_0xe934('0x3a')](_0x4b503c);})['then'](function(_0x1b9852){_0x4229f0[_0xe934('0x3b')]=_0x1b9852;return _0x4229f0;})[_0xe934('0x1d')](respondWithFilteredResult(_0x523e67,_0x4b503c))[_0xe934('0x3c')](handleError(_0x523e67,null));};exports['show']=function(_0x4aea95,_0x40ea8b){var _0x34a586={'raw':![],'where':{'id':_0x4aea95['params']['id']}},_0x5a90c8={};_0x5a90c8[_0xe934('0x29')]=_[_0xe934('0x2b')](db[_0xe934('0x26')][_0xe934('0x3d')]);_0x5a90c8[_0xe934('0x2a')]=_[_0xe934('0x2b')](_0x4aea95[_0xe934('0x2a')]);_0x5a90c8[_0xe934('0x33')]=_[_0xe934('0x2c')](_0x5a90c8[_0xe934('0x29')],_0x5a90c8[_0xe934('0x2a')]);_0x34a586[_0xe934('0x2d')]=_[_0xe934('0x2c')](_0x5a90c8[_0xe934('0x29')],qs[_0xe934('0x2e')](_0x4aea95['query'][_0xe934('0x2e')]));_0x34a586[_0xe934('0x2d')]=_0x34a586['attributes'][_0xe934('0x2f')]?_0x34a586[_0xe934('0x2d')]:_0x5a90c8[_0xe934('0x29')];if(_0x4aea95['query'][_0xe934('0x38')]){_0x34a586[_0xe934('0x39')]=[{'all':!![]}];}_0x34a586=_[_0xe934('0x35')]({},_0x34a586,_0x4aea95[_0xe934('0x3e')]);return db[_0xe934('0x26')][_0xe934('0x3f')](_0x34a586)[_0xe934('0x1d')](handleEntityNotFound(_0x40ea8b,null))['then'](respondWithResult(_0x40ea8b,null))['catch'](handleError(_0x40ea8b,null));};exports[_0xe934('0x40')]=function(_0x5593c8,_0x56d4e0){return db[_0xe934('0x26')]['create'](_0x5593c8[_0xe934('0x41')],{})[_0xe934('0x1d')](respondWithResult(_0x56d4e0,0xc9))[_0xe934('0x3c')](handleError(_0x56d4e0,null));};exports[_0xe934('0x42')]=function(_0x405bf7,_0x3e8b75){if(_0x405bf7['body']['id']){delete _0x405bf7[_0xe934('0x41')]['id'];}return db[_0xe934('0x26')][_0xe934('0x3f')]({'where':{'id':_0x405bf7[_0xe934('0x43')]['id']}})[_0xe934('0x1d')](handleEntityNotFound(_0x3e8b75,null))[_0xe934('0x1d')](saveUpdates(_0x405bf7[_0xe934('0x41')],null))[_0xe934('0x1d')](respondWithResult(_0x3e8b75,null))[_0xe934('0x3c')](handleError(_0x3e8b75,null));};exports[_0xe934('0x1e')]=function(_0x1ff81d,_0x5a4064){return db[_0xe934('0x26')]['find']({'where':{'id':_0x1ff81d[_0xe934('0x43')]['id']}})[_0xe934('0x1d')](handleEntityNotFound(_0x5a4064,null))[_0xe934('0x1d')](removeEntity(_0x5a4064,null))['catch'](handleError(_0x5a4064,null));};exports[_0xe934('0x44')]=function(_0x28513d,_0x38b023){return db[_0xe934('0x26')]['describe']()['then'](respondWithResult(_0x38b023,null))[_0xe934('0x3c')](handleError(_0x38b023,null));};
\ No newline at end of file
index b61fca6..a4c8912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43bd=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x33187b,_0x591a68){var _0x5155fb=function(_0xb5e52b){while(--_0xb5e52b){_0x33187b['push'](_0x33187b['shift']());}};_0x5155fb(++_0x591a68);}(_0x43bd,0xa0));var _0xd43b=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x43bd[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xd43b('0x0'));var util=require('util');var logger=require(_0xd43b('0x1'))(_0xd43b('0x2'));var moment=require(_0xd43b('0x3'));var BPromise=require(_0xd43b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd43b('0x5'));var rimraf=require(_0xd43b('0x6'));var config=require(_0xd43b('0x7'));var attributes=require(_0xd43b('0x8'));module[_0xd43b('0x9')]=function(_0x48493d,_0x4c5f40){return _0x48493d[_0xd43b('0xa')](_0xd43b('0xb'),attributes,{'tableName':_0xd43b('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xd43b('0xd'),_0xd43b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b84=['moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api'];(function(_0x525d46,_0x4043e3){var _0x36dfe6=function(_0x5a365a){while(--_0x5a365a){_0x525d46['push'](_0x525d46['shift']());}};_0x36dfe6(++_0x4043e3);}(_0x7b84,0x17c));var _0x47b8=function(_0xdc637d,_0x3b6d97){_0xdc637d=_0xdc637d-0x0;var _0x1bd5f6=_0x7b84[_0xdc637d];return _0x1bd5f6;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var logger=require(_0x47b8('0x2'))(_0x47b8('0x3'));var moment=require(_0x47b8('0x4'));var BPromise=require(_0x47b8('0x5'));var rp=require(_0x47b8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x47b8('0x7'));var config=require(_0x47b8('0x8'));var attributes=require(_0x47b8('0x9'));module[_0x47b8('0xa')]=function(_0x2e6853,_0xafe88a){return _0x2e6853['define'](_0x47b8('0xb'),attributes,{'tableName':_0x47b8('0xc'),'paranoid':![],'indexes':[{'name':_0x47b8('0xd'),'fields':[_0x47b8('0xe'),_0x47b8('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 8f8968d..307ed9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f97=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x2fdb78,_0x885ca5){var _0x1fec71=function(_0x2ecd88){while(--_0x2ecd88){_0x2fdb78['push'](_0x2fdb78['shift']());}};_0x1fec71(++_0x885ca5);}(_0x4f97,0x132));var _0x74f9=function(_0xf322f2,_0x1d1616){_0xf322f2=_0xf322f2-0x0;var _0x5a924c=_0x4f97[_0xf322f2];return _0x5a924c;};'use strict';var _=require(_0x74f9('0x0'));var util=require(_0x74f9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74f9('0x2'))['db'];var utils=require(_0x74f9('0x3'));var logger=require(_0x74f9('0x4'))(_0x74f9('0x5'));var config=require(_0x74f9('0x6'));var jayson=require(_0x74f9('0x7'));var client=jayson[_0x74f9('0x8')][_0x74f9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bf791,_0x2036cf,_0x43ee5d){return new BPromise(function(_0x35d50d,_0x5c317b){return client['request'](_0x3bf791,_0x43ee5d)[_0x74f9('0xa')](function(_0x58c05c){logger[_0x74f9('0xb')](_0x74f9('0xc'),_0x2036cf,'request\x20sent');logger[_0x74f9('0xd')](_0x74f9('0xe'),_0x2036cf,_0x74f9('0xf'),JSON[_0x74f9('0x10')](_0x58c05c));if(_0x58c05c[_0x74f9('0x11')]){if(_0x58c05c[_0x74f9('0x11')][_0x74f9('0x12')]===0x1f4){logger[_0x74f9('0x11')](_0x74f9('0xc'),_0x2036cf,_0x58c05c[_0x74f9('0x11')][_0x74f9('0x13')]);return _0x5c317b(_0x58c05c['error']['message']);}logger[_0x74f9('0x11')](_0x74f9('0xc'),_0x2036cf,_0x58c05c[_0x74f9('0x11')]['message']);return _0x35d50d(_0x58c05c['error']['message']);}else{logger[_0x74f9('0xb')](_0x74f9('0xc'),_0x2036cf,_0x74f9('0xf'));_0x35d50d(_0x58c05c[_0x74f9('0x14')][_0x74f9('0x13')]);}})[_0x74f9('0x15')](function(_0x305e1b){logger[_0x74f9('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2036cf,_0x305e1b);_0x5c317b(_0x305e1b);});});}
\ No newline at end of file
+var _0xa15a=['UserProfileSection,\x20%s,\x20%s','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x21a354,_0x83b80c){var _0x1bc034=function(_0x368e4a){while(--_0x368e4a){_0x21a354['push'](_0x21a354['shift']());}};_0x1bc034(++_0x83b80c);}(_0xa15a,0x108));var _0xaa15=function(_0x290b2f,_0x536fb4){_0x290b2f=_0x290b2f-0x0;var _0x2483e5=_0xa15a[_0x290b2f];return _0x2483e5;};'use strict';var _=require('lodash');var util=require(_0xaa15('0x0'));var moment=require(_0xaa15('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa15('0x2'));var fs=require('fs');var Redis=require(_0xaa15('0x3'));var db=require(_0xaa15('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa15('0x5'))(_0xaa15('0x6'));var config=require(_0xaa15('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaa15('0x8')][_0xaa15('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x250938,_0x5495b1,_0x5d1d0f){return new BPromise(function(_0x364172,_0x1e6806){return client['request'](_0x250938,_0x5d1d0f)['then'](function(_0x40ae54){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x5495b1,_0xaa15('0xa'));logger[_0xaa15('0xb')](_0xaa15('0xc'),_0x5495b1,_0xaa15('0xa'),JSON[_0xaa15('0xd')](_0x40ae54));if(_0x40ae54['error']){if(_0x40ae54[_0xaa15('0xe')][_0xaa15('0xf')]===0x1f4){logger[_0xaa15('0xe')](_0xaa15('0x10'),_0x5495b1,_0x40ae54[_0xaa15('0xe')]['message']);return _0x1e6806(_0x40ae54['error'][_0xaa15('0x11')]);}logger[_0xaa15('0xe')](_0xaa15('0x10'),_0x5495b1,_0x40ae54[_0xaa15('0xe')][_0xaa15('0x11')]);return _0x364172(_0x40ae54[_0xaa15('0xe')][_0xaa15('0x11')]);}else{logger[_0xaa15('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5495b1,_0xaa15('0xa'));_0x364172(_0x40ae54[_0xaa15('0x13')][_0xaa15('0x11')]);}})['catch'](function(_0x2fdf0e){logger['error'](_0xaa15('0x10'),_0x5495b1,_0x2fdf0e);_0x1e6806(_0x2fdf0e);});});}
\ No newline at end of file
index 72de924..3f389e4 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(_0x17cb36,_0x3cfc3e){var _0x3ae236=function(_0x47530f){while(--_0x47530f){_0x17cb36['push'](_0x17cb36['shift']());}};_0x3ae236(++_0x3cfc3e);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x292ab5,_0x4f48f2){var _0x4c5eaa=function(_0x810b66){while(--_0x810b66){_0x292ab5['push'](_0x292ab5['shift']());}};_0x4c5eaa(++_0x4f48f2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index f3275d7..59af370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df5=['INTEGER','sequelize','exports'];(function(_0x11d08e,_0x1cd670){var _0x19c8cb=function(_0xbc63bc){while(--_0xbc63bc){_0x11d08e['push'](_0x11d08e['shift']());}};_0x19c8cb(++_0x1cd670);}(_0x6df5,0x154));var _0x56df=function(_0x1ec6b3,_0x4d613c){_0x1ec6b3=_0x1ec6b3-0x0;var _0x7f842c=_0x6df5[_0x1ec6b3];return _0x7f842c;};'use strict';var Sequelize=require(_0x56df('0x0'));module[_0x56df('0x1')]={'penalty':{'type':Sequelize[_0x56df('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd29c=['exports','sequelize'];(function(_0x2d2a33,_0x2d1d1f){var _0x32d8ba=function(_0x566914){while(--_0x566914){_0x2d2a33['push'](_0x2d2a33['shift']());}};_0x32d8ba(++_0x2d1d1f);}(_0xd29c,0xc9));var _0xcd29=function(_0x2b21d5,_0x497bde){_0x2b21d5=_0x2b21d5-0x0;var _0x2941de=_0xd29c[_0x2b21d5];return _0x2941de;};'use strict';var Sequelize=require(_0xcd29('0x0'));module[_0xcd29('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 62d4c3b..b492ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cad=['UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x24b724,_0x5a5a2f){var _0xa308ef=function(_0x578c75){while(--_0x578c75){_0x24b724['push'](_0x24b724['shift']());}};_0xa308ef(++_0x5a5a2f);}(_0x8cad,0xfe));var _0xd8ca=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x8cad[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var logger=require(_0xd8ca('0x2'))(_0xd8ca('0x3'));var moment=require(_0xd8ca('0x4'));var BPromise=require(_0xd8ca('0x5'));var rp=require(_0xd8ca('0x6'));var fs=require('fs');var path=require(_0xd8ca('0x7'));var rimraf=require(_0xd8ca('0x8'));var config=require(_0xd8ca('0x9'));var attributes=require(_0xd8ca('0xa'));module[_0xd8ca('0xb')]=function(_0x14c73e,_0x6d5070){return _0x14c73e['define'](_0xd8ca('0xc'),attributes,{'tableName':_0xd8ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66fa=['define','UserSmsQueue','user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x66fa,0x117));var _0xa66f=function(_0x177a56,_0x162f1e){_0x177a56=_0x177a56-0x0;var _0x7ce19d=_0x66fa[_0x177a56];return _0x7ce19d;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9746b47..9ff7f2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9541=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util'];(function(_0xe16fcf,_0x2b5918){var _0x5981e9=function(_0x494df2){while(--_0x494df2){_0xe16fcf['push'](_0xe16fcf['shift']());}};_0x5981e9(++_0x2b5918);}(_0x9541,0x9e));var _0x1954=function(_0x570b36,_0x36fe12){_0x570b36=_0x570b36-0x0;var _0x4e229f=_0x9541[_0x570b36];return _0x4e229f;};'use strict';var _=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var moment=require(_0x1954('0x2'));var BPromise=require(_0x1954('0x3'));var rs=require(_0x1954('0x4'));var fs=require('fs');var Redis=require(_0x1954('0x5'));var db=require(_0x1954('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1954('0x7'))(_0x1954('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1954('0x9')][_0x1954('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16c629,_0x2dafed,_0x3a258b){return new BPromise(function(_0x100f61,_0x3cdea7){return client[_0x1954('0xb')](_0x16c629,_0x3a258b)[_0x1954('0xc')](function(_0x2869f5){logger['info'](_0x1954('0xd'),_0x2dafed,_0x1954('0xe'));logger[_0x1954('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2dafed,_0x1954('0xe'),JSON['stringify'](_0x2869f5));if(_0x2869f5[_0x1954('0x10')]){if(_0x2869f5[_0x1954('0x10')]['code']===0x1f4){logger[_0x1954('0x10')](_0x1954('0xd'),_0x2dafed,_0x2869f5[_0x1954('0x10')][_0x1954('0x11')]);return _0x3cdea7(_0x2869f5['error'][_0x1954('0x11')]);}logger[_0x1954('0x10')](_0x1954('0xd'),_0x2dafed,_0x2869f5[_0x1954('0x10')]['message']);return _0x100f61(_0x2869f5[_0x1954('0x10')]['message']);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x2dafed,_0x1954('0xe'));_0x100f61(_0x2869f5[_0x1954('0x12')][_0x1954('0x11')]);}})[_0x1954('0x13')](function(_0x5d2441){logger[_0x1954('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x2dafed,_0x5d2441);_0x3cdea7(_0x5d2441);});});}
\ No newline at end of file
+var _0xeca4=['../../config/utils','rpc','jayson/promise','client','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x4be754,_0x1aae01){var _0x22db1e=function(_0x52d624){while(--_0x52d624){_0x4be754['push'](_0x4be754['shift']());}};_0x22db1e(++_0x1aae01);}(_0xeca4,0x1db));var _0x4eca=function(_0x550cfd,_0xbcf3b8){_0x550cfd=_0x550cfd-0x0;var _0x524acc=_0xeca4[_0x550cfd];return _0x524acc;};'use strict';var _=require(_0x4eca('0x0'));var util=require('util');var moment=require(_0x4eca('0x1'));var BPromise=require(_0x4eca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4eca('0x3'));var db=require(_0x4eca('0x4'))['db'];var utils=require(_0x4eca('0x5'));var logger=require('../../config/logger')(_0x4eca('0x6'));var config=require('../../config/environment');var jayson=require(_0x4eca('0x7'));var client=jayson[_0x4eca('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b526d,_0x41d421,_0xad8d5a){return new BPromise(function(_0x167721,_0xbe8c25){return client['request'](_0x2b526d,_0xad8d5a)['then'](function(_0xda2b00){logger[_0x4eca('0x9')]('UserSmsQueue,\x20%s,\x20%s',_0x41d421,_0x4eca('0xa'));logger[_0x4eca('0xb')](_0x4eca('0xc'),_0x41d421,'request\x20sent',JSON[_0x4eca('0xd')](_0xda2b00));if(_0xda2b00['error']){if(_0xda2b00[_0x4eca('0xe')][_0x4eca('0xf')]===0x1f4){logger[_0x4eca('0xe')](_0x4eca('0x10'),_0x41d421,_0xda2b00['error'][_0x4eca('0x11')]);return _0xbe8c25(_0xda2b00['error'][_0x4eca('0x11')]);}logger['error'](_0x4eca('0x10'),_0x41d421,_0xda2b00[_0x4eca('0xe')][_0x4eca('0x11')]);return _0x167721(_0xda2b00[_0x4eca('0xe')]['message']);}else{logger[_0x4eca('0x9')]('UserSmsQueue,\x20%s,\x20%s',_0x41d421,_0x4eca('0xa'));_0x167721(_0xda2b00[_0x4eca('0x12')][_0x4eca('0x11')]);}})[_0x4eca('0x13')](function(_0xdc415e){logger[_0x4eca('0xe')](_0x4eca('0x10'),_0x41d421,_0xdc415e);_0xbe8c25(_0xdc415e);});});}
\ No newline at end of file
index e1f2fbf..a1dbf17 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(_0x592eaa,_0x26d920){var _0x502849=function(_0x21fcfb){while(--_0x21fcfb){_0x592eaa['push'](_0x592eaa['shift']());}};_0x502849(++_0x26d920);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dc40b,_0x3ee3dc){var _0x227825=function(_0x10b5e3){while(--_0x10b5e3){_0x3dc40b['push'](_0x3dc40b['shift']());}};_0x227825(++_0x3ee3dc);}(_0xe706,0xa3));var _0x6e70=function(_0x292423,_0x1759b7){_0x292423=_0x292423-0x0;var _0x2801cb=_0xe706[_0x292423];return _0x2801cb;};'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 647d864..c53e32d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3204=['exports','INTEGER','sequelize'];(function(_0x2dfeb8,_0x3daa57){var _0x22e6ba=function(_0x142b3a){while(--_0x142b3a){_0x2dfeb8['push'](_0x2dfeb8['shift']());}};_0x22e6ba(++_0x3daa57);}(_0x3204,0x12e));var _0x4320=function(_0x32ee5e,_0xbc70a0){_0x32ee5e=_0x32ee5e-0x0;var _0x160b2b=_0x3204[_0x32ee5e];return _0x160b2b;};'use strict';var Sequelize=require(_0x4320('0x0'));module[_0x4320('0x1')]={'penalty':{'type':Sequelize[_0x4320('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xba12=['exports'];(function(_0x2ddea4,_0x3b4d83){var _0xb3eb2=function(_0x11ab0a){while(--_0x11ab0a){_0x2ddea4['push'](_0x2ddea4['shift']());}};_0xb3eb2(++_0x3b4d83);}(_0xba12,0xa4));var _0x2ba1=function(_0x1b736b,_0x417fca){_0x1b736b=_0x1b736b-0x0;var _0x435d0d=_0xba12[_0x1b736b];return _0x435d0d;};'use strict';var Sequelize=require('sequelize');module[_0x2ba1('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index bc07ed0..47a52e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger'];(function(_0x2d324d,_0x1fb855){var _0x44b2cc=function(_0x44ed74){while(--_0x44ed74){_0x2d324d['push'](_0x2d324d['shift']());}};_0x44b2cc(++_0x1fb855);}(_0x0bd4,0x6d));var _0x40bd=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x0bd4[_0x25cd2c];return _0x1e364c;};'use strict';var _=require(_0x40bd('0x0'));var util=require(_0x40bd('0x1'));var logger=require(_0x40bd('0x2'))(_0x40bd('0x3'));var moment=require(_0x40bd('0x4'));var BPromise=require(_0x40bd('0x5'));var rp=require(_0x40bd('0x6'));var fs=require('fs');var path=require(_0x40bd('0x7'));var rimraf=require(_0x40bd('0x8'));var config=require(_0x40bd('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0x40bd('0xa')]=function(_0x179aa6,_0x29f21e){return _0x179aa6[_0x40bd('0xb')](_0x40bd('0xc'),attributes,{'tableName':_0x40bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x823b=['lodash','util','../../config/logger','api','moment','path','rimraf','./userVoiceQueue.attributes','exports','define','user_has_voice_queues'];(function(_0x21f9eb,_0x3c6621){var _0x4bfd24=function(_0x5d67b8){while(--_0x5d67b8){_0x21f9eb['push'](_0x21f9eb['shift']());}};_0x4bfd24(++_0x3c6621);}(_0x823b,0x1d9));var _0xb823=function(_0x150a7e,_0x3bd0f1){_0x150a7e=_0x150a7e-0x0;var _0x12fd12=_0x823b[_0x150a7e];return _0x12fd12;};'use strict';var _=require(_0xb823('0x0'));var util=require(_0xb823('0x1'));var logger=require(_0xb823('0x2'))(_0xb823('0x3'));var moment=require(_0xb823('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb823('0x5'));var rimraf=require(_0xb823('0x6'));var config=require('../../config/environment');var attributes=require(_0xb823('0x7'));module[_0xb823('0x8')]=function(_0x5c6b89,_0x4deb74){return _0x5c6b89[_0xb823('0x9')]('UserVoiceQueue',attributes,{'tableName':_0xb823('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be52669..af4060c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d9=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0xd1d9,0x174));var _0x9d1d=function(_0x260862,_0x219290){_0x260862=_0x260862-0x0;var _0x115f6=_0xd1d9[_0x260862];return _0x115f6;};'use strict';var _=require(_0x9d1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9d1d('0x1'));var rs=require(_0x9d1d('0x2'));var fs=require('fs');var Redis=require(_0x9d1d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d1d('0x4'));var logger=require(_0x9d1d('0x5'))(_0x9d1d('0x6'));var config=require(_0x9d1d('0x7'));var jayson=require(_0x9d1d('0x8'));var client=jayson[_0x9d1d('0x9')][_0x9d1d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x210367,_0x1bf906,_0x390ee3){return new BPromise(function(_0x1fe865,_0x25977d){return client[_0x9d1d('0xb')](_0x210367,_0x390ee3)['then'](function(_0x1fbcd2){logger['info'](_0x9d1d('0xc'),_0x1bf906,_0x9d1d('0xd'));logger[_0x9d1d('0xe')](_0x9d1d('0xf'),_0x1bf906,_0x9d1d('0xd'),JSON[_0x9d1d('0x10')](_0x1fbcd2));if(_0x1fbcd2[_0x9d1d('0x11')]){if(_0x1fbcd2['error'][_0x9d1d('0x12')]===0x1f4){logger[_0x9d1d('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x1bf906,_0x1fbcd2[_0x9d1d('0x11')][_0x9d1d('0x13')]);return _0x25977d(_0x1fbcd2['error']['message']);}logger[_0x9d1d('0x11')](_0x9d1d('0xc'),_0x1bf906,_0x1fbcd2[_0x9d1d('0x11')][_0x9d1d('0x13')]);return _0x1fe865(_0x1fbcd2[_0x9d1d('0x11')][_0x9d1d('0x13')]);}else{logger['info'](_0x9d1d('0xc'),_0x1bf906,'request\x20sent');_0x1fe865(_0x1fbcd2[_0x9d1d('0x14')]['message']);}})[_0x9d1d('0x15')](function(_0x362d42){logger[_0x9d1d('0x11')](_0x9d1d('0xc'),_0x1bf906,_0x362d42);_0x25977d(_0x362d42);});});}
\ No newline at end of file
+var _0xcd3f=['../../config/logger','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x172ed7,_0x3d08fd){var _0xfa8f61=function(_0xe07a21){while(--_0xe07a21){_0x172ed7['push'](_0x172ed7['shift']());}};_0xfa8f61(++_0x3d08fd);}(_0xcd3f,0x6e));var _0xfcd3=function(_0x292102,_0x427efa){_0x292102=_0x292102-0x0;var _0x54c775=_0xcd3f[_0x292102];return _0x54c775;};'use strict';var _=require(_0xfcd3('0x0'));var util=require('util');var moment=require(_0xfcd3('0x1'));var BPromise=require(_0xfcd3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfcd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xfcd3('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfcd3('0x5'));var client=jayson[_0xfcd3('0x6')][_0xfcd3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f385e,_0xf6b66d,_0x17b8aa){return new BPromise(function(_0x212169,_0x3ea4c5){return client[_0xfcd3('0x8')](_0x2f385e,_0x17b8aa)['then'](function(_0x4ac298){logger[_0xfcd3('0x9')](_0xfcd3('0xa'),_0xf6b66d,'request\x20sent');logger['debug'](_0xfcd3('0xb'),_0xf6b66d,_0xfcd3('0xc'),JSON[_0xfcd3('0xd')](_0x4ac298));if(_0x4ac298[_0xfcd3('0xe')]){if(_0x4ac298[_0xfcd3('0xe')][_0xfcd3('0xf')]===0x1f4){logger[_0xfcd3('0xe')](_0xfcd3('0xa'),_0xf6b66d,_0x4ac298['error'][_0xfcd3('0x10')]);return _0x3ea4c5(_0x4ac298[_0xfcd3('0xe')][_0xfcd3('0x10')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xf6b66d,_0x4ac298['error'][_0xfcd3('0x10')]);return _0x212169(_0x4ac298[_0xfcd3('0xe')][_0xfcd3('0x10')]);}else{logger[_0xfcd3('0x9')]('UserVoiceQueue,\x20%s,\x20%s',_0xf6b66d,_0xfcd3('0xc'));_0x212169(_0x4ac298[_0xfcd3('0x11')]['message']);}})[_0xfcd3('0x12')](function(_0x5d5ab0){logger['error'](_0xfcd3('0xa'),_0xf6b66d,_0x5d5ab0);_0x3ea4c5(_0x5d5ab0);});});}
\ No newline at end of file
index db58ce9..7f0fb85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x14ca26,_0xf6f7c2){var _0x2061e9=function(_0x4883bc){while(--_0x4883bc){_0x14ca26['push'](_0x14ca26['shift']());}};_0x2061e9(++_0xf6f7c2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4d7638,_0x1f6f21){var _0x2bc330=function(_0x2009df){while(--_0x2009df){_0x4d7638['push'](_0x4d7638['shift']());}};_0x2bc330(++_0x1f6f21);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0xcb91[_0x44b3bd];return _0x1efc4a;};'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 6fc91f8..184488d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f52=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0x7f52,0x1cc));var _0x27f5=function(_0x5de255,_0x2bd804){_0x5de255=_0x5de255-0x0;var _0x440d42=_0x7f52[_0x5de255];return _0x440d42;};'use strict';var Sequelize=require(_0x27f5('0x0'));module[_0x27f5('0x1')]={'uniqueid':{'type':Sequelize[_0x27f5('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x27f5('0x3')},'UserId':{'type':Sequelize[_0x27f5('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x27f5('0x4')],'allowNull':![],'unique':_0x27f5('0x5'),'comment':_0x27f5('0x3')},'VoiceQueueId':{'type':Sequelize[_0x27f5('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x27f5('0x5'),'comment':_0x27f5('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x27f5('0x3')},'paused':{'type':Sequelize[_0x27f5('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0x7ba0=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x26da4f,_0x3fb61b){var _0x36c865=function(_0x505b82){while(--_0x505b82){_0x26da4f['push'](_0x26da4f['shift']());}};_0x36c865(++_0x3fb61b);}(_0x7ba0,0x1bc));var _0x07ba=function(_0x34c268,_0x5ae7a1){_0x34c268=_0x34c268-0x0;var _0x480f25=_0x7ba0[_0x34c268];return _0x480f25;};'use strict';var Sequelize=require(_0x07ba('0x0'));module[_0x07ba('0x1')]={'uniqueid':{'type':Sequelize[_0x07ba('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x07ba('0x3')},'membername':{'type':Sequelize[_0x07ba('0x4')],'allowNull':![],'comment':_0x07ba('0x3')},'UserId':{'type':Sequelize[_0x07ba('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x07ba('0x4')],'allowNull':![],'unique':_0x07ba('0x5'),'comment':_0x07ba('0x3')},'VoiceQueueId':{'type':Sequelize[_0x07ba('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x07ba('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x07ba('0x2')](0xb),'defaultValue':0x0,'comment':_0x07ba('0x3')}};
\ No newline at end of file
index a9f2e02..07946b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0265=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x13bd2c,_0x4fac72){var _0x52a10b=function(_0x4d94b8){while(--_0x4d94b8){_0x13bd2c['push'](_0x13bd2c['shift']());}};_0x52a10b(++_0x4fac72);}(_0x0265,0x6c));var _0x5026=function(_0x255b4e,_0xdf14cb){_0x255b4e=_0x255b4e-0x0;var _0x41363f=_0x0265[_0x255b4e];return _0x41363f;};'use strict';var EventEmitter=require(_0x5026('0x0'));var UserVoiceQueueRt=require(_0x5026('0x1'))['db'][_0x5026('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5026('0x3')](0x0);var events={'afterCreate':_0x5026('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x35aaf7){return function(_0x192fe9,_0x44e113,_0x7aafa6){UserVoiceQueueRtEvents['emit'](_0x35aaf7+':'+_0x192fe9['id'],_0x192fe9);UserVoiceQueueRtEvents[_0x5026('0x5')](_0x35aaf7,_0x192fe9);_0x7aafa6(null);};}for(var e in events){if(events[_0x5026('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5026('0x7')](e,emitEvent(event));}}module[_0x5026('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x1162=['exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x51aa5f,_0x2a745e){var _0x23fd65=function(_0x27b4f5){while(--_0x27b4f5){_0x51aa5f['push'](_0x51aa5f['shift']());}};_0x23fd65(++_0x2a745e);}(_0x1162,0x9a));var _0x2116=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1162[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x2116('0x0'))['db'][_0x2116('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2116('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2116('0x3'),'afterDestroy':_0x2116('0x4')};function emitEvent(_0x4b6113){return function(_0x3ecaee,_0x4c1201,_0x4b8884){UserVoiceQueueRtEvents[_0x2116('0x5')](_0x4b6113+':'+_0x3ecaee['id'],_0x3ecaee);UserVoiceQueueRtEvents[_0x2116('0x5')](_0x4b6113,_0x3ecaee);_0x4b8884(null);};}for(var e in events){if(events[_0x2116('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x2116('0x7')](e,emitEvent(event));}}module[_0x2116('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 8f3f13a..60d4914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x158f=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','lodash','moment','bluebird'];(function(_0x26bccf,_0x21da48){var _0x568320=function(_0x3b8d05){while(--_0x3b8d05){_0x26bccf['push'](_0x26bccf['shift']());}};_0x568320(++_0x21da48);}(_0x158f,0xc3));var _0xf158=function(_0xe04198,_0x1bd4ab){_0xe04198=_0xe04198-0x0;var _0x1a9526=_0x158f[_0xe04198];return _0x1a9526;};'use strict';var _=require(_0xf158('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf158('0x1'));var BPromise=require(_0xf158('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf158('0x3'));var rimraf=require(_0xf158('0x4'));var config=require(_0xf158('0x5'));var attributes=require(_0xf158('0x6'));module[_0xf158('0x7')]=function(_0x17b6dc,_0x1183cc){return _0x17b6dc[_0xf158('0x8')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b94=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x6aa5b,_0x41480d){var _0x4e7479=function(_0x1d629a){while(--_0x1d629a){_0x6aa5b['push'](_0x6aa5b['shift']());}};_0x4e7479(++_0x41480d);}(_0x9b94,0xc6));var _0x49b9=function(_0x11f997,_0xd00577){_0x11f997=_0x11f997-0x0;var _0x1c82b1=_0x9b94[_0x11f997];return _0x1c82b1;};'use strict';var _=require('lodash');var util=require(_0x49b9('0x0'));var logger=require(_0x49b9('0x1'))('api');var moment=require('moment');var BPromise=require(_0x49b9('0x2'));var rp=require(_0x49b9('0x3'));var fs=require('fs');var path=require(_0x49b9('0x4'));var rimraf=require(_0x49b9('0x5'));var config=require(_0x49b9('0x6'));var attributes=require(_0x49b9('0x7'));module[_0x49b9('0x8')]=function(_0x58c95a,_0x3f2777){return _0x58c95a[_0x49b9('0x9')](_0x49b9('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8000ea3..f9c0a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7067=['rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','redis','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x20d4e7,_0x5f29f7){var _0x125131=function(_0x10dc57){while(--_0x10dc57){_0x20d4e7['push'](_0x20d4e7['shift']());}};_0x125131(++_0x5f29f7);}(_0x7067,0xb2));var _0x7706=function(_0x2f4f36,_0x2d892e){_0x2f4f36=_0x2f4f36-0x0;var _0x145963=_0x7067[_0x2f4f36];return _0x145963;};'use strict';var _=require(_0x7706('0x0'));var util=require('util');var moment=require(_0x7706('0x1'));var BPromise=require(_0x7706('0x2'));var rs=require(_0x7706('0x3'));var fs=require('fs');var Redis=require(_0x7706('0x4'));var db=require(_0x7706('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7706('0x6'))(_0x7706('0x7'));var config=require(_0x7706('0x8'));var jayson=require(_0x7706('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7706('0xa')](config['redis'],{'host':_0x7706('0xb'),'port':0x18eb});var socket=require(_0x7706('0xc'))(new Redis(config[_0x7706('0xd')]));require('./userVoiceQueueRt.socket')[_0x7706('0xe')](socket);function respondWithRpcPromise(_0x5e8d4c,_0x290d55,_0x29eaea){return new BPromise(function(_0x923f07,_0x53a68c){return client[_0x7706('0xf')](_0x5e8d4c,_0x29eaea)['then'](function(_0x543f2c){logger[_0x7706('0x10')](_0x7706('0x11'),_0x290d55,_0x7706('0x12'));logger[_0x7706('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x290d55,'request\x20sent',JSON[_0x7706('0x14')](_0x543f2c));if(_0x543f2c[_0x7706('0x15')]){if(_0x543f2c[_0x7706('0x15')][_0x7706('0x16')]===0x1f4){logger['error'](_0x7706('0x11'),_0x290d55,_0x543f2c[_0x7706('0x15')]['message']);return _0x53a68c(_0x543f2c[_0x7706('0x15')]['message']);}logger[_0x7706('0x15')](_0x7706('0x11'),_0x290d55,_0x543f2c[_0x7706('0x15')][_0x7706('0x17')]);return _0x923f07(_0x543f2c['error'][_0x7706('0x17')]);}else{logger[_0x7706('0x10')](_0x7706('0x11'),_0x290d55,_0x7706('0x12'));_0x923f07(_0x543f2c[_0x7706('0x18')][_0x7706('0x17')]);}})[_0x7706('0x19')](function(_0x40fdd1){logger[_0x7706('0x15')](_0x7706('0x11'),_0x290d55,_0x40fdd1);_0x53a68c(_0x40fdd1);});});}exports[_0x7706('0x1a')]=function(_0x3ac4ad){var _0x4857c6=this;return new Promise(function(_0x925ab6,_0x4b71d3){return db[_0x7706('0x1b')][_0x7706('0x1c')]({'raw':_0x3ac4ad[_0x7706('0x1d')]?_0x3ac4ad[_0x7706('0x1d')][_0x7706('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ac4ad['options']?_0x3ac4ad[_0x7706('0x1d')][_0x7706('0x1f')]||null:null,'attributes':[[db[_0x7706('0x20')]['fn'](_0x7706('0x21'),db[_0x7706('0x20')]['fn']('IF',db['sequelize']['literal'](_0x7706('0x22')))),_0x7706('0x23')]]})[_0x7706('0x24')](function(_0x5e5d02){logger[_0x7706('0x10')](_0x7706('0x1a'),_0x3ac4ad);logger[_0x7706('0x13')]('GetVoiceQueueRtPauses',_0x3ac4ad,JSON[_0x7706('0x14')](_0x5e5d02));_0x925ab6(_0x5e5d02);})[_0x7706('0x19')](function(_0x2ef54c){logger['error'](_0x7706('0x1a'),_0x2ef54c[_0x7706('0x17')],_0x3ac4ad);_0x4b71d3(_0x4857c6[_0x7706('0x15')](0x1f4,_0x2ef54c[_0x7706('0x17')]));});});};
\ No newline at end of file
+var _0x844a=['register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','COUNT','sequelize','outboundQueuePauses','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0x844a,0x1ac));var _0xa844=function(_0x6fd5c9,_0x157369){_0x6fd5c9=_0x6fd5c9-0x0;var _0x5db83f=_0x844a[_0x6fd5c9];return _0x5db83f;};'use strict';var _=require('lodash');var util=require(_0xa844('0x0'));var moment=require('moment');var BPromise=require(_0xa844('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa844('0x2'));var db=require(_0xa844('0x3'))['db'];var utils=require(_0xa844('0x4'));var logger=require(_0xa844('0x5'))(_0xa844('0x6'));var config=require(_0xa844('0x7'));var jayson=require(_0xa844('0x8'));var client=jayson[_0xa844('0x9')][_0xa844('0xa')]({'port':0x232a});config[_0xa844('0xb')]=_[_0xa844('0xc')](config['redis'],{'host':_0xa844('0xd'),'port':0x18eb});var socket=require(_0xa844('0xe'))(new Redis(config[_0xa844('0xb')]));require(_0xa844('0xf'))[_0xa844('0x10')](socket);function respondWithRpcPromise(_0x301e4a,_0x1f1910,_0x4648b2){return new BPromise(function(_0xc8e068,_0x59527b){return client[_0xa844('0x11')](_0x301e4a,_0x4648b2)[_0xa844('0x12')](function(_0x6f0ec8){logger[_0xa844('0x13')](_0xa844('0x14'),_0x1f1910,'request\x20sent');logger[_0xa844('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x1f1910,_0xa844('0x16'),JSON[_0xa844('0x17')](_0x6f0ec8));if(_0x6f0ec8[_0xa844('0x18')]){if(_0x6f0ec8[_0xa844('0x18')][_0xa844('0x19')]===0x1f4){logger[_0xa844('0x18')](_0xa844('0x14'),_0x1f1910,_0x6f0ec8['error'][_0xa844('0x1a')]);return _0x59527b(_0x6f0ec8['error']['message']);}logger[_0xa844('0x18')](_0xa844('0x14'),_0x1f1910,_0x6f0ec8[_0xa844('0x18')][_0xa844('0x1a')]);return _0xc8e068(_0x6f0ec8[_0xa844('0x18')][_0xa844('0x1a')]);}else{logger['info'](_0xa844('0x14'),_0x1f1910,_0xa844('0x16'));_0xc8e068(_0x6f0ec8[_0xa844('0x1b')][_0xa844('0x1a')]);}})[_0xa844('0x1c')](function(_0x22620d){logger[_0xa844('0x18')](_0xa844('0x14'),_0x1f1910,_0x22620d);_0x59527b(_0x22620d);});});}exports[_0xa844('0x1d')]=function(_0x46070f){var _0x4b2099=this;return new Promise(function(_0x2959c0,_0x52a068){return db['UserVoiceQueueRt'][_0xa844('0x1e')]({'raw':_0x46070f['options']?_0x46070f[_0xa844('0x1f')][_0xa844('0x20')]===undefined?!![]:![]:!![],'where':_0x46070f[_0xa844('0x1f')]?_0x46070f[_0xa844('0x1f')][_0xa844('0x21')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa844('0x22'),db[_0xa844('0x23')]['fn']('IF',db[_0xa844('0x23')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0xa844('0x24')]]})['then'](function(_0x353ac9){logger['info'](_0xa844('0x1d'),_0x46070f);logger[_0xa844('0x15')](_0xa844('0x1d'),_0x46070f,JSON[_0xa844('0x17')](_0x353ac9));_0x2959c0(_0x353ac9);})[_0xa844('0x1c')](function(_0x6649d8){logger[_0xa844('0x18')](_0xa844('0x1d'),_0x6649d8[_0xa844('0x1a')],_0x46070f);_0x52a068(_0x4b2099[_0xa844('0x18')](0x1f4,_0x6649d8[_0xa844('0x1a')]));});});};
\ No newline at end of file
index 60ba094..885247a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc43c=['length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','removeListener','register'];(function(_0xac8ea3,_0x2d9fc9){var _0x1c1354=function(_0x161740){while(--_0x161740){_0xac8ea3['push'](_0xac8ea3['shift']());}};_0x1c1354(++_0x2d9fc9);}(_0xc43c,0xd4));var _0xcc43=function(_0x2d49d9,_0x27dd59){_0x2d49d9=_0x2d49d9-0x0;var _0x4ac193=_0xc43c[_0x2d49d9];return _0x4ac193;};'use strict';var UserVoiceQueueRtEvents=require(_0xcc43('0x0'));var events=[_0xcc43('0x1'),_0xcc43('0x2'),'update'];function createListener(_0x508584,_0x4796a8){return function(_0x3f0c49){_0x4796a8['emit'](_0x508584,_0x3f0c49);};}function removeListener(_0x484b53,_0x4c59cc){return function(){UserVoiceQueueRtEvents[_0xcc43('0x3')](_0x484b53,_0x4c59cc);};}exports[_0xcc43('0x4')]=function(_0x13d329){for(var _0x5e818f=0x0,_0x359663=events[_0xcc43('0x5')];_0x5e818f<_0x359663;_0x5e818f++){var _0x36e3a5=events[_0x5e818f];var _0x25528e=createListener(_0xcc43('0x6')+_0x36e3a5,_0x13d329);UserVoiceQueueRtEvents['on'](_0x36e3a5,_0x25528e);}};
\ No newline at end of file
+var _0xecb2=['userVoiceQueueRt:','./userVoiceQueueRt.events','update','emit','removeListener','register','length'];(function(_0x18b4d3,_0x252c46){var _0x455feb=function(_0x407f83){while(--_0x407f83){_0x18b4d3['push'](_0x18b4d3['shift']());}};_0x455feb(++_0x252c46);}(_0xecb2,0xf6));var _0x2ecb=function(_0x3fdc28,_0x15dd04){_0x3fdc28=_0x3fdc28-0x0;var _0x4ec388=_0xecb2[_0x3fdc28];return _0x4ec388;};'use strict';var UserVoiceQueueRtEvents=require(_0x2ecb('0x0'));var events=['save','remove',_0x2ecb('0x1')];function createListener(_0x548b3c,_0x59d894){return function(_0x1bb230){_0x59d894[_0x2ecb('0x2')](_0x548b3c,_0x1bb230);};}function removeListener(_0x393e7c,_0x2a4fe5){return function(){UserVoiceQueueRtEvents[_0x2ecb('0x3')](_0x393e7c,_0x2a4fe5);};}exports[_0x2ecb('0x4')]=function(_0x4c169f){for(var _0x51b28c=0x0,_0x49de99=events[_0x2ecb('0x5')];_0x51b28c<_0x49de99;_0x51b28c++){var _0x3df4a0=events[_0x51b28c];var _0x15a959=createListener(_0x2ecb('0x6')+_0x3df4a0,_0x4c169f);UserVoiceQueueRtEvents['on'](_0x3df4a0,_0x15a959);}};
\ No newline at end of file
index e541e97..7f0100c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x409d89,_0x4687c8){var _0xdd0bb7=function(_0x28704b){while(--_0x28704b){_0x409d89['push'](_0x409d89['shift']());}};_0xdd0bb7(++_0x4687c8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xcb91[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x251d48,_0x3f883b){var _0x2873a6=function(_0x453fca){while(--_0x453fca){_0x251d48['push'](_0x251d48['shift']());}};_0x2873a6(++_0x3f883b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 8e5a634..9006424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['sequelize','exports','INTEGER'];(function(_0x53e548,_0x345863){var _0x124c39=function(_0x175328){while(--_0x175328){_0x53e548['push'](_0x53e548['shift']());}};_0x124c39(++_0x345863);}(_0xd943,0x114));var _0x3d94=function(_0x13b384,_0x274645){_0x13b384=_0x13b384-0x0;var _0x305031=_0xd943[_0x13b384];return _0x305031;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'penalty':{'type':Sequelize[_0x3d94('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 1b248db..580b297 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97e2=['path','rimraf','./userWhatsappQueue.attributes','UserWhatsappQueue','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x97e2,0x1bd));var _0x297e=function(_0x1948d8,_0x1ed6f4){_0x1948d8=_0x1948d8-0x0;var _0x3ac510=_0x97e2[_0x1948d8];return _0x3ac510;};'use strict';var _=require(_0x297e('0x0'));var util=require(_0x297e('0x1'));var logger=require(_0x297e('0x2'))('api');var moment=require(_0x297e('0x3'));var BPromise=require(_0x297e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x297e('0x5'));var rimraf=require(_0x297e('0x6'));var config=require('../../config/environment');var attributes=require(_0x297e('0x7'));module['exports']=function(_0x50758a,_0x39b439){return _0x50758a['define'](_0x297e('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfa58=['./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xfa58,0x9e));var _0x8fa5=function(_0x843880,_0x1516d1){_0x843880=_0x843880-0x0;var _0x49943f=_0xfa58[_0x843880];return _0x49943f;};'use strict';var _=require(_0x8fa5('0x0'));var util=require(_0x8fa5('0x1'));var logger=require('../../config/logger')(_0x8fa5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8fa5('0x3'));var fs=require('fs');var path=require(_0x8fa5('0x4'));var rimraf=require(_0x8fa5('0x5'));var config=require(_0x8fa5('0x6'));var attributes=require(_0x8fa5('0x7'));module['exports']=function(_0x35c16e,_0x1a6cb6){return _0x35c16e[_0x8fa5('0x8')](_0x8fa5('0x9'),attributes,{'tableName':_0x8fa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9cfc1c0..10e579f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08f2=['code','message','info','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a38ac,_0x533316){var _0x382218=function(_0x3509a9){while(--_0x3509a9){_0x2a38ac['push'](_0x2a38ac['shift']());}};_0x382218(++_0x533316);}(_0x08f2,0x17a));var _0x208f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x08f2[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x208f('0x0'));var util=require(_0x208f('0x1'));var moment=require('moment');var BPromise=require(_0x208f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x208f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x208f('0x4'));var logger=require(_0x208f('0x5'))(_0x208f('0x6'));var config=require(_0x208f('0x7'));var jayson=require(_0x208f('0x8'));var client=jayson['client'][_0x208f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b86d6,_0xf496ee,_0x558f2d){return new BPromise(function(_0x2da3e6,_0x3b9eb4){return client[_0x208f('0xa')](_0x3b86d6,_0x558f2d)[_0x208f('0xb')](function(_0x286271){logger['info'](_0x208f('0xc'),_0xf496ee,_0x208f('0xd'));logger[_0x208f('0xe')](_0x208f('0xf'),_0xf496ee,_0x208f('0xd'),JSON[_0x208f('0x10')](_0x286271));if(_0x286271[_0x208f('0x11')]){if(_0x286271[_0x208f('0x11')][_0x208f('0x12')]===0x1f4){logger[_0x208f('0x11')](_0x208f('0xc'),_0xf496ee,_0x286271[_0x208f('0x11')][_0x208f('0x13')]);return _0x3b9eb4(_0x286271['error'][_0x208f('0x13')]);}logger[_0x208f('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0xf496ee,_0x286271[_0x208f('0x11')][_0x208f('0x13')]);return _0x2da3e6(_0x286271['error'][_0x208f('0x13')]);}else{logger[_0x208f('0x14')](_0x208f('0xc'),_0xf496ee,_0x208f('0xd'));_0x2da3e6(_0x286271['result']['message']);}})[_0x208f('0x15')](function(_0x5aa180){logger[_0x208f('0x11')](_0x208f('0xc'),_0xf496ee,_0x5aa180);_0x3b9eb4(_0x5aa180);});});}
\ No newline at end of file
+var _0x8f64=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ioredis','../../mysqldb'];(function(_0x14dbc4,_0x261bb6){var _0x472c9e=function(_0x473d62){while(--_0x473d62){_0x14dbc4['push'](_0x14dbc4['shift']());}};_0x472c9e(++_0x261bb6);}(_0x8f64,0x12e));var _0x48f6=function(_0x18a8ba,_0x443975){_0x18a8ba=_0x18a8ba-0x0;var _0x9bc929=_0x8f64[_0x18a8ba];return _0x9bc929;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48f6('0x0'));var db=require(_0x48f6('0x1'))['db'];var utils=require(_0x48f6('0x2'));var logger=require(_0x48f6('0x3'))('rpc');var config=require(_0x48f6('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x48f6('0x5')][_0x48f6('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x42f91d,_0x479b1b,_0x2fb089){return new BPromise(function(_0xe16900,_0x3ae2e9){return client[_0x48f6('0x7')](_0x42f91d,_0x2fb089)[_0x48f6('0x8')](function(_0x4077c5){logger[_0x48f6('0x9')](_0x48f6('0xa'),_0x479b1b,_0x48f6('0xb'));logger['debug'](_0x48f6('0xc'),_0x479b1b,'request\x20sent',JSON[_0x48f6('0xd')](_0x4077c5));if(_0x4077c5[_0x48f6('0xe')]){if(_0x4077c5[_0x48f6('0xe')][_0x48f6('0xf')]===0x1f4){logger[_0x48f6('0xe')](_0x48f6('0xa'),_0x479b1b,_0x4077c5[_0x48f6('0xe')][_0x48f6('0x10')]);return _0x3ae2e9(_0x4077c5['error'][_0x48f6('0x10')]);}logger[_0x48f6('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x479b1b,_0x4077c5[_0x48f6('0xe')][_0x48f6('0x10')]);return _0xe16900(_0x4077c5[_0x48f6('0xe')][_0x48f6('0x10')]);}else{logger[_0x48f6('0x9')]('UserWhatsappQueue,\x20%s,\x20%s',_0x479b1b,_0x48f6('0xb'));_0xe16900(_0x4077c5[_0x48f6('0x11')][_0x48f6('0x10')]);}})[_0x48f6('0x12')](function(_0xb592ab){logger['error'](_0x48f6('0xa'),_0x479b1b,_0xb592ab);_0x3ae2e9(_0xb592ab);});});}
\ No newline at end of file
index dc2d96f..d0afce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x861c=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x260d3f,_0x5c0c51){var _0x1bbb43=function(_0x3f6393){while(--_0x3f6393){_0x260d3f['push'](_0x260d3f['shift']());}};_0x1bbb43(++_0x5c0c51);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var path=require(_0xc861('0x2'));var timeout=require(_0xc861('0x3'));var express=require(_0xc861('0x4'));var router=express[_0xc861('0x5')]();var fs_extra=require(_0xc861('0x6'));var auth=require(_0xc861('0x7'));var interaction=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var controller=require(_0xc861('0xa'));router[_0xc861('0xb')]('/',auth['isAuthenticated'](),controller[_0xc861('0xc')]);router[_0xc861('0xb')](_0xc861('0xd'),auth[_0xc861('0xe')](),controller[_0xc861('0xf')]);router[_0xc861('0x10')]('/',auth[_0xc861('0xe')](),controller[_0xc861('0x11')]);router[_0xc861('0x12')](_0xc861('0xd'),auth[_0xc861('0xe')](),controller[_0xc861('0x13')]);router[_0xc861('0x14')]('/:id',auth[_0xc861('0xe')](),controller[_0xc861('0x15')]);module[_0xc861('0x16')]=router;
\ No newline at end of file
+var _0x98d3=['update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x31e95a,_0x1a3619){var _0x292cef=function(_0x6e8530){while(--_0x6e8530){_0x31e95a['push'](_0x31e95a['shift']());}};_0x292cef(++_0x1a3619);}(_0x98d3,0x173));var _0x398d=function(_0x8ad372,_0x398278){_0x8ad372=_0x8ad372-0x0;var _0x3ec287=_0x98d3[_0x8ad372];return _0x3ec287;};'use strict';var multer=require(_0x398d('0x0'));var util=require(_0x398d('0x1'));var path=require('path');var timeout=require(_0x398d('0x2'));var express=require('express');var router=express[_0x398d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x398d('0x4'));var interaction=require(_0x398d('0x5'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x398d('0x6')]('/',auth[_0x398d('0x7')](),controller[_0x398d('0x8')]);router['get'](_0x398d('0x9'),auth[_0x398d('0x7')](),controller[_0x398d('0xa')]);router[_0x398d('0xb')]('/',auth[_0x398d('0x7')](),controller['create']);router[_0x398d('0xc')](_0x398d('0x9'),auth[_0x398d('0x7')](),controller[_0x398d('0xd')]);router[_0x398d('0xe')](_0x398d('0x9'),auth[_0x398d('0x7')](),controller[_0x398d('0xf')]);module['exports']=router;
\ No newline at end of file
index b2de0ba..29a8f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb31a=['sequelize','exports','STRING','name'];(function(_0x323dea,_0x3f00a4){var _0x5a3494=function(_0xc94c90){while(--_0xc94c90){_0x323dea['push'](_0x323dea['shift']());}};_0x5a3494(++_0x3f00a4);}(_0xb31a,0xd4));var _0xab31=function(_0x148eef,_0x732161){_0x148eef=_0x148eef-0x0;var _0x35c4fd=_0xb31a[_0x148eef];return _0x35c4fd;};'use strict';var Sequelize=require(_0xab31('0x0'));module[_0xab31('0x1')]={'name':{'type':Sequelize[_0xab31('0x2')],'unique':_0xab31('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xab31('0x2')]}};
\ No newline at end of file
+var _0x2c90=['STRING','sequelize'];(function(_0x15685a,_0x7208fe){var _0x1a6345=function(_0x29bdd9){while(--_0x29bdd9){_0x15685a['push'](_0x15685a['shift']());}};_0x1a6345(++_0x7208fe);}(_0x2c90,0xe5));var _0x02c9=function(_0x21aa61,_0x3c1dc2){_0x21aa61=_0x21aa61-0x0;var _0x573f06=_0x2c90[_0x21aa61];return _0x573f06;};'use strict';var Sequelize=require(_0x02c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x02c9('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x02c9('0x1')]}};
\ No newline at end of file
index c6d307c..f793872 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc548=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','set','Content-Range','json','reject','then','destroy','get','Variables','UserProfileResource','error','name','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','options','Variable','count','includeAll','include','rows','catch','show','params','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0xc548,0xd3));var _0x8c54=function(_0x11a95c,_0x3f5a3e){_0x11a95c=_0x11a95c-0x0;var _0x27b8ed=_0xc548[_0x11a95c];return _0x27b8ed;};'use strict';var emlformat=require(_0x8c54('0x0'));var rimraf=require(_0x8c54('0x1'));var zipdir=require(_0x8c54('0x2'));var jsonpatch=require(_0x8c54('0x3'));var rp=require(_0x8c54('0x4'));var moment=require(_0x8c54('0x5'));var BPromise=require(_0x8c54('0x6'));var Mustache=require(_0x8c54('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8c54('0x8'));var csv=require(_0x8c54('0x9'));var ejs=require(_0x8c54('0xa'));var fs=require('fs');var fs_extra=require(_0x8c54('0xb'));var _=require('lodash');var squel=require(_0x8c54('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8c54('0xd'));var toCsv=require(_0x8c54('0x9'));var querystring=require(_0x8c54('0xe'));var Papa=require(_0x8c54('0xf'));var Redis=require(_0x8c54('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8c54('0x11'));var as=require(_0x8c54('0x12'));var hardwareService=require(_0x8c54('0x13'));var logger=require(_0x8c54('0x14'))('api');var utils=require(_0x8c54('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8c54('0x16'));var db=require(_0x8c54('0x17'))['db'];function respondWithStatusCode(_0x3d5c5a,_0x1cba4f){_0x1cba4f=_0x1cba4f||0xcc;return function(_0x237d9a){if(_0x237d9a){return _0x3d5c5a[_0x8c54('0x18')](_0x1cba4f);}return _0x3d5c5a[_0x8c54('0x19')](_0x1cba4f)[_0x8c54('0x1a')]();};}function respondWithResult(_0x344ae0,_0x30b0e8){_0x30b0e8=_0x30b0e8||0xc8;return function(_0x50394d){if(_0x50394d){return _0x344ae0['status'](_0x30b0e8)['json'](_0x50394d);}};}function respondWithFilteredResult(_0x28314e,_0x2161c5){return function(_0x5e4f1f){if(_0x5e4f1f){var _0x26135c=typeof _0x2161c5['offset']==='undefined'&&typeof _0x2161c5[_0x8c54('0x1b')]===_0x8c54('0x1c');var _0x34de9c=_0x5e4f1f['count'];var _0x291d33=_0x26135c?0x0:_0x2161c5[_0x8c54('0x1d')];var _0x340175=_0x26135c?_0x5e4f1f['count']:_0x2161c5[_0x8c54('0x1d')]+_0x2161c5['limit'];var _0x16c36e;if(_0x340175>=_0x34de9c){_0x340175=_0x34de9c;_0x16c36e=0xc8;}else{_0x16c36e=0xce;}_0x28314e[_0x8c54('0x19')](_0x16c36e);return _0x28314e[_0x8c54('0x1e')](_0x8c54('0x1f'),_0x291d33+'-'+_0x340175+'/'+_0x34de9c)[_0x8c54('0x20')](_0x5e4f1f);}return null;};}function patchUpdates(_0x56d2db){return function(_0x622a93){try{jsonpatch['apply'](_0x622a93,_0x56d2db,!![]);}catch(_0x3eebb2){return BPromise[_0x8c54('0x21')](_0x3eebb2);}return _0x622a93['save']();};}function saveUpdates(_0x5f07e6,_0x5c3f9a){return function(_0x28b0b4){if(_0x28b0b4){return _0x28b0b4['update'](_0x5f07e6)[_0x8c54('0x22')](function(_0xf5014f){return _0xf5014f;});}return null;};}function removeEntity(_0x148844,_0xeed4){return function(_0x2a3178){if(_0x2a3178){return _0x2a3178[_0x8c54('0x23')]()[_0x8c54('0x22')](function(){var _0x293165=_0x2a3178[_0x8c54('0x24')]({'plain':!![]});var _0x3dd3f7=_0x8c54('0x25');return db[_0x8c54('0x26')][_0x8c54('0x23')]({'where':{'type':_0x3dd3f7,'resourceId':_0x293165['id']}})[_0x8c54('0x22')](function(){return _0x2a3178;});})['then'](function(){_0x148844[_0x8c54('0x19')](0xcc)[_0x8c54('0x1a')]();});}};}function handleEntityNotFound(_0x59c361,_0x2f7770){return function(_0x232804){if(!_0x232804){_0x59c361[_0x8c54('0x18')](0x194);}return _0x232804;};}function handleError(_0x5d8846,_0x25741f){_0x25741f=_0x25741f||0x1f4;return function(_0x1592fb){logger[_0x8c54('0x27')](_0x1592fb['stack']);if(_0x1592fb[_0x8c54('0x28')]){delete _0x1592fb[_0x8c54('0x28')];}_0x5d8846[_0x8c54('0x19')](_0x25741f)['send'](_0x1592fb);};}exports['index']=function(_0x4a1a9b,_0x456fd4){var _0x416348={},_0x57d2f5={},_0x266fa0={'count':0x0,'rows':[]};var _0x1b5f2a=_[_0x8c54('0x29')](db['Variable'][_0x8c54('0x2a')],function(_0x502111){return{'name':_0x502111[_0x8c54('0x2b')],'type':_0x502111[_0x8c54('0x2c')]['key']};});_0x57d2f5[_0x8c54('0x2d')]=_['map'](_0x1b5f2a,_0x8c54('0x28'));_0x57d2f5[_0x8c54('0x2e')]=_[_0x8c54('0x2f')](_0x4a1a9b[_0x8c54('0x2e')]);_0x57d2f5[_0x8c54('0x30')]=_['intersection'](_0x57d2f5['model'],_0x57d2f5[_0x8c54('0x2e')]);_0x416348[_0x8c54('0x31')]=_[_0x8c54('0x32')](_0x57d2f5['model'],qs[_0x8c54('0x33')](_0x4a1a9b[_0x8c54('0x2e')][_0x8c54('0x33')]));_0x416348[_0x8c54('0x31')]=_0x416348[_0x8c54('0x31')]['length']?_0x416348['attributes']:_0x57d2f5[_0x8c54('0x2d')];if(!_0x4a1a9b[_0x8c54('0x2e')]['hasOwnProperty'](_0x8c54('0x34'))){_0x416348[_0x8c54('0x1b')]=qs['limit'](_0x4a1a9b[_0x8c54('0x2e')]['limit']);_0x416348['offset']=qs[_0x8c54('0x1d')](_0x4a1a9b[_0x8c54('0x2e')]['offset']);}_0x416348['order']=qs[_0x8c54('0x35')](_0x4a1a9b[_0x8c54('0x2e')][_0x8c54('0x35')]);_0x416348[_0x8c54('0x36')]=qs[_0x8c54('0x30')](_[_0x8c54('0x37')](_0x4a1a9b[_0x8c54('0x2e')],_0x57d2f5[_0x8c54('0x30')]),_0x1b5f2a);if(_0x4a1a9b[_0x8c54('0x2e')][_0x8c54('0x38')]){_0x416348[_0x8c54('0x36')]=_[_0x8c54('0x39')](_0x416348[_0x8c54('0x36')],{'$or':_['map'](_0x1b5f2a,function(_0x16eac5){if(_0x16eac5['type']!=='VIRTUAL'){var _0x3d7aaa={};_0x3d7aaa[_0x16eac5[_0x8c54('0x28')]]={'$like':'%'+_0x4a1a9b['query'][_0x8c54('0x38')]+'%'};return _0x3d7aaa;}})});}_0x416348=_[_0x8c54('0x39')]({},_0x416348,_0x4a1a9b[_0x8c54('0x3a')]);var _0x1c8e91={'where':_0x416348['where']};return db[_0x8c54('0x3b')][_0x8c54('0x3c')](_0x1c8e91)['then'](function(_0x4c5b29){_0x266fa0[_0x8c54('0x3c')]=_0x4c5b29;if(_0x4a1a9b[_0x8c54('0x2e')][_0x8c54('0x3d')]){_0x416348[_0x8c54('0x3e')]=[{'all':!![]}];}return db[_0x8c54('0x3b')]['findAll'](_0x416348);})['then'](function(_0x2941ed){_0x266fa0[_0x8c54('0x3f')]=_0x2941ed;return _0x266fa0;})[_0x8c54('0x22')](respondWithFilteredResult(_0x456fd4,_0x416348))[_0x8c54('0x40')](handleError(_0x456fd4,null));};exports[_0x8c54('0x41')]=function(_0x3cac2b,_0x2ac470){var _0x4e26c6={'raw':!![],'where':{'id':_0x3cac2b[_0x8c54('0x42')]['id']}},_0x3b189f={};_0x3b189f[_0x8c54('0x2d')]=_[_0x8c54('0x2f')](db[_0x8c54('0x3b')][_0x8c54('0x2a')]);_0x3b189f[_0x8c54('0x2e')]=_[_0x8c54('0x2f')](_0x3cac2b[_0x8c54('0x2e')]);_0x3b189f['filters']=_[_0x8c54('0x32')](_0x3b189f[_0x8c54('0x2d')],_0x3b189f[_0x8c54('0x2e')]);_0x4e26c6[_0x8c54('0x31')]=_['intersection'](_0x3b189f[_0x8c54('0x2d')],qs['fields'](_0x3cac2b[_0x8c54('0x2e')][_0x8c54('0x33')]));_0x4e26c6['attributes']=_0x4e26c6['attributes'][_0x8c54('0x43')]?_0x4e26c6['attributes']:_0x3b189f[_0x8c54('0x2d')];if(_0x3cac2b[_0x8c54('0x2e')][_0x8c54('0x3d')]){_0x4e26c6[_0x8c54('0x3e')]=[{'all':!![]}];}_0x4e26c6=_[_0x8c54('0x39')]({},_0x4e26c6,_0x3cac2b[_0x8c54('0x3a')]);return db[_0x8c54('0x3b')][_0x8c54('0x44')](_0x4e26c6)[_0x8c54('0x22')](handleEntityNotFound(_0x2ac470,null))[_0x8c54('0x22')](respondWithResult(_0x2ac470,null))[_0x8c54('0x40')](handleError(_0x2ac470,null));};exports['create']=function(_0x5bdb5a,_0x4b94f3){return db[_0x8c54('0x3b')]['create'](_0x5bdb5a[_0x8c54('0x45')],{})['then'](function(_0x54ff10){var _0x3c24cf=_0x5bdb5a[_0x8c54('0x46')]['get']({'plain':!![]});if(!_0x3c24cf)throw new Error(_0x8c54('0x47'));if(_0x3c24cf[_0x8c54('0x48')]==='user'){var _0x1fd11a=_0x54ff10[_0x8c54('0x24')]({'plain':!![]});var _0x4ae28c='Variables';return db[_0x8c54('0x49')]['find']({'where':{'name':_0x4ae28c,'userProfileId':_0x3c24cf['userProfileId']},'raw':!![]})['then'](function(_0x576280){if(_0x576280&&_0x576280[_0x8c54('0x4a')]===0x0){return db[_0x8c54('0x26')]['create']({'name':_0x1fd11a[_0x8c54('0x28')],'resourceId':_0x1fd11a['id'],'type':_0x576280[_0x8c54('0x28')],'sectionId':_0x576280['id']},{})['then'](function(){return _0x54ff10;});}else{return _0x54ff10;}})[_0x8c54('0x40')](function(_0x1a180b){logger[_0x8c54('0x27')](_0x8c54('0x4b'),_0x1a180b);throw _0x1a180b;});}return _0x54ff10;})[_0x8c54('0x22')](respondWithResult(_0x4b94f3,0xc9))['catch'](handleError(_0x4b94f3,null));};exports[_0x8c54('0x4c')]=function(_0x11d92a,_0x23333c){if(_0x11d92a['body']['id']){delete _0x11d92a[_0x8c54('0x45')]['id'];}return db['Variable'][_0x8c54('0x44')]({'where':{'id':_0x11d92a[_0x8c54('0x42')]['id']}})[_0x8c54('0x22')](handleEntityNotFound(_0x23333c,null))[_0x8c54('0x22')](saveUpdates(_0x11d92a[_0x8c54('0x45')],null))[_0x8c54('0x22')](respondWithResult(_0x23333c,null))[_0x8c54('0x40')](handleError(_0x23333c,null));};exports[_0x8c54('0x23')]=function(_0x73737f,_0x176fd8){return db[_0x8c54('0x3b')][_0x8c54('0x44')]({'where':{'id':_0x73737f['params']['id']}})[_0x8c54('0x22')](handleEntityNotFound(_0x176fd8,null))[_0x8c54('0x22')](removeEntity(_0x176fd8,null))[_0x8c54('0x40')](handleError(_0x176fd8,null));};
\ No newline at end of file
+var _0x75e3=['then','destroy','get','Variables','UserProfileResource','error','name','send','Variable','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','rows','catch','show','params','keys','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','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','offset','undefined','count','set','Content-Range','json','reject','save'];(function(_0x3125e3,_0x829e6f){var _0x306456=function(_0x54ea30){while(--_0x54ea30){_0x3125e3['push'](_0x3125e3['shift']());}};_0x306456(++_0x829e6f);}(_0x75e3,0x7d));var _0x375e=function(_0x3de92c,_0x411ef9){_0x3de92c=_0x3de92c-0x0;var _0x47a28b=_0x75e3[_0x3de92c];return _0x47a28b;};'use strict';var emlformat=require(_0x375e('0x0'));var rimraf=require(_0x375e('0x1'));var zipdir=require(_0x375e('0x2'));var jsonpatch=require(_0x375e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x375e('0x4'));var util=require(_0x375e('0x5'));var path=require('path');var sox=require(_0x375e('0x6'));var csv=require(_0x375e('0x7'));var ejs=require(_0x375e('0x8'));var fs=require('fs');var fs_extra=require(_0x375e('0x9'));var _=require(_0x375e('0xa'));var squel=require(_0x375e('0xb'));var crypto=require(_0x375e('0xc'));var jsforce=require(_0x375e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x375e('0xe'));var authService=require(_0x375e('0xf'));var qs=require(_0x375e('0x10'));var as=require(_0x375e('0x11'));var hardwareService=require(_0x375e('0x12'));var logger=require(_0x375e('0x13'))(_0x375e('0x14'));var utils=require(_0x375e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x375e('0x16'));var db=require(_0x375e('0x17'))['db'];function respondWithStatusCode(_0xed5e44,_0x3f20b0){_0x3f20b0=_0x3f20b0||0xcc;return function(_0x48a0e5){if(_0x48a0e5){return _0xed5e44[_0x375e('0x18')](_0x3f20b0);}return _0xed5e44[_0x375e('0x19')](_0x3f20b0)[_0x375e('0x1a')]();};}function respondWithResult(_0x59db43,_0x31261c){_0x31261c=_0x31261c||0xc8;return function(_0x173c3d){if(_0x173c3d){return _0x59db43[_0x375e('0x19')](_0x31261c)['json'](_0x173c3d);}};}function respondWithFilteredResult(_0x13991f,_0x3ff8e7){return function(_0x237857){if(_0x237857){var _0x560053=typeof _0x3ff8e7[_0x375e('0x1b')]==='undefined'&&typeof _0x3ff8e7['limit']===_0x375e('0x1c');var _0x149ae7=_0x237857[_0x375e('0x1d')];var _0x3ed5ea=_0x560053?0x0:_0x3ff8e7[_0x375e('0x1b')];var _0x54b2c5=_0x560053?_0x237857[_0x375e('0x1d')]:_0x3ff8e7[_0x375e('0x1b')]+_0x3ff8e7['limit'];var _0x43c52b;if(_0x54b2c5>=_0x149ae7){_0x54b2c5=_0x149ae7;_0x43c52b=0xc8;}else{_0x43c52b=0xce;}_0x13991f[_0x375e('0x19')](_0x43c52b);return _0x13991f[_0x375e('0x1e')](_0x375e('0x1f'),_0x3ed5ea+'-'+_0x54b2c5+'/'+_0x149ae7)[_0x375e('0x20')](_0x237857);}return null;};}function patchUpdates(_0x2e765f){return function(_0x534698){try{jsonpatch['apply'](_0x534698,_0x2e765f,!![]);}catch(_0x16c961){return BPromise[_0x375e('0x21')](_0x16c961);}return _0x534698[_0x375e('0x22')]();};}function saveUpdates(_0x327f7b,_0x27e3d8){return function(_0x48de76){if(_0x48de76){return _0x48de76['update'](_0x327f7b)[_0x375e('0x23')](function(_0x5b827e){return _0x5b827e;});}return null;};}function removeEntity(_0x332387,_0xc1fdc9){return function(_0x377a51){if(_0x377a51){return _0x377a51[_0x375e('0x24')]()[_0x375e('0x23')](function(){var _0x16dbb1=_0x377a51[_0x375e('0x25')]({'plain':!![]});var _0x3fc275=_0x375e('0x26');return db[_0x375e('0x27')][_0x375e('0x24')]({'where':{'type':_0x3fc275,'resourceId':_0x16dbb1['id']}})['then'](function(){return _0x377a51;});})['then'](function(){_0x332387['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc08161,_0x55213f){return function(_0x32b4f0){if(!_0x32b4f0){_0xc08161[_0x375e('0x18')](0x194);}return _0x32b4f0;};}function handleError(_0x3ceff4,_0x403bee){_0x403bee=_0x403bee||0x1f4;return function(_0x8b7629){logger[_0x375e('0x28')](_0x8b7629['stack']);if(_0x8b7629[_0x375e('0x29')]){delete _0x8b7629['name'];}_0x3ceff4[_0x375e('0x19')](_0x403bee)[_0x375e('0x2a')](_0x8b7629);};}exports['index']=function(_0x5a0249,_0x586aa9){var _0x13c6a3={},_0x5807cf={},_0x121f55={'count':0x0,'rows':[]};var _0x4e8d63=_['map'](db[_0x375e('0x2b')][_0x375e('0x2c')],function(_0x289440){return{'name':_0x289440[_0x375e('0x2d')],'type':_0x289440[_0x375e('0x2e')]['key']};});_0x5807cf[_0x375e('0x2f')]=_['map'](_0x4e8d63,_0x375e('0x29'));_0x5807cf[_0x375e('0x30')]=_['keys'](_0x5a0249[_0x375e('0x30')]);_0x5807cf[_0x375e('0x31')]=_['intersection'](_0x5807cf[_0x375e('0x2f')],_0x5807cf['query']);_0x13c6a3[_0x375e('0x32')]=_['intersection'](_0x5807cf[_0x375e('0x2f')],qs['fields'](_0x5a0249[_0x375e('0x30')][_0x375e('0x33')]));_0x13c6a3[_0x375e('0x32')]=_0x13c6a3['attributes'][_0x375e('0x34')]?_0x13c6a3[_0x375e('0x32')]:_0x5807cf[_0x375e('0x2f')];if(!_0x5a0249[_0x375e('0x30')][_0x375e('0x35')](_0x375e('0x36'))){_0x13c6a3[_0x375e('0x37')]=qs[_0x375e('0x37')](_0x5a0249[_0x375e('0x30')][_0x375e('0x37')]);_0x13c6a3[_0x375e('0x1b')]=qs['offset'](_0x5a0249[_0x375e('0x30')][_0x375e('0x1b')]);}_0x13c6a3[_0x375e('0x38')]=qs[_0x375e('0x39')](_0x5a0249['query']['sort']);_0x13c6a3[_0x375e('0x3a')]=qs[_0x375e('0x31')](_[_0x375e('0x3b')](_0x5a0249['query'],_0x5807cf[_0x375e('0x31')]),_0x4e8d63);if(_0x5a0249[_0x375e('0x30')][_0x375e('0x3c')]){_0x13c6a3[_0x375e('0x3a')]=_[_0x375e('0x3d')](_0x13c6a3[_0x375e('0x3a')],{'$or':_[_0x375e('0x3e')](_0x4e8d63,function(_0xa15c41){if(_0xa15c41[_0x375e('0x2e')]!==_0x375e('0x3f')){var _0x175366={};_0x175366[_0xa15c41[_0x375e('0x29')]]={'$like':'%'+_0x5a0249[_0x375e('0x30')][_0x375e('0x3c')]+'%'};return _0x175366;}})});}_0x13c6a3=_[_0x375e('0x3d')]({},_0x13c6a3,_0x5a0249['options']);var _0xb97679={'where':_0x13c6a3[_0x375e('0x3a')]};return db[_0x375e('0x2b')][_0x375e('0x1d')](_0xb97679)['then'](function(_0x47945c){_0x121f55['count']=_0x47945c;if(_0x5a0249[_0x375e('0x30')]['includeAll']){_0x13c6a3[_0x375e('0x40')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x13c6a3);})[_0x375e('0x23')](function(_0x287235){_0x121f55[_0x375e('0x41')]=_0x287235;return _0x121f55;})['then'](respondWithFilteredResult(_0x586aa9,_0x13c6a3))[_0x375e('0x42')](handleError(_0x586aa9,null));};exports[_0x375e('0x43')]=function(_0x29c5b4,_0x3c3a62){var _0x3796c5={'raw':!![],'where':{'id':_0x29c5b4[_0x375e('0x44')]['id']}},_0x318be0={};_0x318be0[_0x375e('0x2f')]=_[_0x375e('0x45')](db['Variable'][_0x375e('0x2c')]);_0x318be0['query']=_[_0x375e('0x45')](_0x29c5b4[_0x375e('0x30')]);_0x318be0['filters']=_[_0x375e('0x46')](_0x318be0[_0x375e('0x2f')],_0x318be0['query']);_0x3796c5[_0x375e('0x32')]=_[_0x375e('0x46')](_0x318be0[_0x375e('0x2f')],qs['fields'](_0x29c5b4[_0x375e('0x30')][_0x375e('0x33')]));_0x3796c5[_0x375e('0x32')]=_0x3796c5[_0x375e('0x32')][_0x375e('0x34')]?_0x3796c5['attributes']:_0x318be0[_0x375e('0x2f')];if(_0x29c5b4[_0x375e('0x30')][_0x375e('0x47')]){_0x3796c5[_0x375e('0x40')]=[{'all':!![]}];}_0x3796c5=_[_0x375e('0x3d')]({},_0x3796c5,_0x29c5b4['options']);return db[_0x375e('0x2b')][_0x375e('0x48')](_0x3796c5)[_0x375e('0x23')](handleEntityNotFound(_0x3c3a62,null))[_0x375e('0x23')](respondWithResult(_0x3c3a62,null))[_0x375e('0x42')](handleError(_0x3c3a62,null));};exports[_0x375e('0x49')]=function(_0x3f1f30,_0x3fd8ed){return db['Variable'][_0x375e('0x49')](_0x3f1f30[_0x375e('0x4a')],{})[_0x375e('0x23')](function(_0x491ff7){var _0x494051=_0x3f1f30[_0x375e('0x4b')][_0x375e('0x25')]({'plain':!![]});if(!_0x494051)throw new Error(_0x375e('0x4c'));if(_0x494051[_0x375e('0x4d')]==='user'){var _0x50247f=_0x491ff7[_0x375e('0x25')]({'plain':!![]});var _0x455585=_0x375e('0x26');return db['UserProfileSection'][_0x375e('0x48')]({'where':{'name':_0x455585,'userProfileId':_0x494051['userProfileId']},'raw':!![]})[_0x375e('0x23')](function(_0x1dc23a){if(_0x1dc23a&&_0x1dc23a[_0x375e('0x4e')]===0x0){return db[_0x375e('0x27')][_0x375e('0x49')]({'name':_0x50247f[_0x375e('0x29')],'resourceId':_0x50247f['id'],'type':_0x1dc23a['name'],'sectionId':_0x1dc23a['id']},{})[_0x375e('0x23')](function(){return _0x491ff7;});}else{return _0x491ff7;}})[_0x375e('0x42')](function(_0x57080b){logger[_0x375e('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57080b);throw _0x57080b;});}return _0x491ff7;})[_0x375e('0x23')](respondWithResult(_0x3fd8ed,0xc9))['catch'](handleError(_0x3fd8ed,null));};exports[_0x375e('0x4f')]=function(_0x4526bf,_0x353bd3){if(_0x4526bf[_0x375e('0x4a')]['id']){delete _0x4526bf[_0x375e('0x4a')]['id'];}return db['Variable'][_0x375e('0x48')]({'where':{'id':_0x4526bf[_0x375e('0x44')]['id']}})[_0x375e('0x23')](handleEntityNotFound(_0x353bd3,null))[_0x375e('0x23')](saveUpdates(_0x4526bf[_0x375e('0x4a')],null))['then'](respondWithResult(_0x353bd3,null))[_0x375e('0x42')](handleError(_0x353bd3,null));};exports[_0x375e('0x24')]=function(_0x36104e,_0x5204b8){return db['Variable']['find']({'where':{'id':_0x36104e['params']['id']}})['then'](handleEntityNotFound(_0x5204b8,null))[_0x375e('0x23')](removeEntity(_0x5204b8,null))[_0x375e('0x42')](handleError(_0x5204b8,null));};
\ No newline at end of file
index 0af4cf0..51c5425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81e9=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables'];(function(_0x32e4b8,_0x450750){var _0x8dc057=function(_0x4720aa){while(--_0x4720aa){_0x32e4b8['push'](_0x32e4b8['shift']());}};_0x8dc057(++_0x450750);}(_0x81e9,0xd0));var _0x981e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x81e9[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x981e('0x0'));var util=require(_0x981e('0x1'));var logger=require(_0x981e('0x2'))('api');var moment=require(_0x981e('0x3'));var BPromise=require(_0x981e('0x4'));var rp=require(_0x981e('0x5'));var fs=require('fs');var path=require(_0x981e('0x6'));var rimraf=require('rimraf');var config=require(_0x981e('0x7'));var attributes=require(_0x981e('0x8'));module[_0x981e('0x9')]=function(_0x2a6549,_0x5ab8db){return _0x2a6549[_0x981e('0xa')](_0x981e('0xb'),attributes,{'tableName':_0x981e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf651=['tools_variables','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x8ce8f3,_0x243827){var _0x5719b0=function(_0x4d881b){while(--_0x4d881b){_0x8ce8f3['push'](_0x8ce8f3['shift']());}};_0x5719b0(++_0x243827);}(_0xf651,0xac));var _0x1f65=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xf651[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1f65('0x0'))('api');var moment=require(_0x1f65('0x1'));var BPromise=require('bluebird');var rp=require(_0x1f65('0x2'));var fs=require('fs');var path=require(_0x1f65('0x3'));var rimraf=require(_0x1f65('0x4'));var config=require(_0x1f65('0x5'));var attributes=require('./variable.attributes');module[_0x1f65('0x6')]=function(_0x5d74ac,_0x179aa3){return _0x5d74ac[_0x1f65('0x7')]('Variable',attributes,{'tableName':_0x1f65('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c359ff2..1154815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x23a770,_0x2228e4){var _0x43cd3f=function(_0x41cd3e){while(--_0x41cd3e){_0x23a770['push'](_0x23a770['shift']());}};_0x43cd3f(++_0x2228e4);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});};
\ No newline at end of file
+var _0x4b84=['catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','http','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model'];(function(_0x3b6d12,_0x59a8b3){var _0x361b27=function(_0x178c33){while(--_0x178c33){_0x3b6d12['push'](_0x3b6d12['shift']());}};_0x361b27(++_0x59a8b3);}(_0x4b84,0x1cc));var _0x44b8=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0x4b84[_0x16bb0e];return _0x102b8b;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('Variable,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('Variable,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});}exports[_0x44b8('0x10')]=function(_0x55e258){var _0x36743e=this;return new Promise(function(_0xe3de8f,_0x5103f5){return db[_0x44b8('0x11')][_0x44b8('0x12')]({'raw':_0x55e258['options']?_0x55e258[_0x44b8('0x13')][_0x44b8('0x14')]===undefined?!![]:![]:!![],'where':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x15')]||null:null,'attributes':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x16')]||null:null,'include':_0x55e258[_0x44b8('0x13')]?_0x55e258[_0x44b8('0x13')][_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x55e258['options'][_0x44b8('0x17')],function(_0x3a8aa4){return{'model':db[_0x3a8aa4[_0x44b8('0x19')]],'as':_0x3a8aa4['as'],'attributes':_0x3a8aa4[_0x44b8('0x16')],'include':_0x3a8aa4[_0x44b8('0x17')]?_['map'](_0x3a8aa4[_0x44b8('0x17')],function(_0x54677c){return{'model':db[_0x54677c[_0x44b8('0x19')]],'as':_0x54677c['as'],'attributes':_0x54677c[_0x44b8('0x16')],'include':_0x54677c[_0x44b8('0x17')]?_[_0x44b8('0x18')](_0x54677c[_0x44b8('0x17')],function(_0x59acbc){return{'model':db[_0x59acbc[_0x44b8('0x19')]],'as':_0x59acbc['as'],'attributes':_0x59acbc['attributes']};}):[]};}):[]};}):[]:[]})[_0x44b8('0x7')](function(_0x350482){logger['info'](_0x44b8('0x10'),_0x55e258);logger[_0x44b8('0xa')](_0x44b8('0x10'),_0x55e258,JSON['stringify'](_0x350482));_0xe3de8f(_0x350482);})[_0x44b8('0x1a')](function(_0x242342){logger['error'](_0x44b8('0x10'),_0x242342['message'],_0x55e258);_0x5103f5(_0x36743e[_0x44b8('0xd')](0x1f4,_0x242342['message']));});});};
\ No newline at end of file
index b0273c4..7605014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d1=['Router','../../components/auth/service','get','index','/fetch','fetch','/reset','/pull','canUpdate','pull','/restart','isAuthenticated','migrations','exports'];(function(_0x4dcb77,_0x2a15d1){var _0x24f17e=function(_0x357a67){while(--_0x357a67){_0x4dcb77['push'](_0x4dcb77['shift']());}};_0x24f17e(++_0x2a15d1);}(_0x61d1,0x8c));var _0x161d=function(_0x5df036,_0x5064d7){_0x5df036=_0x5df036-0x0;var _0x433c8d=_0x61d1[_0x5df036];return _0x433c8d;};'use strict';var express=require('express');var router=express[_0x161d('0x0')]();var auth=require(_0x161d('0x1'));var controller=require('./version.controller');router[_0x161d('0x2')]('/',controller[_0x161d('0x3')]);router[_0x161d('0x2')](_0x161d('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x161d('0x5')]);router[_0x161d('0x2')](_0x161d('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller['reset']);router['get'](_0x161d('0x7'),auth['isAuthenticated'](),auth[_0x161d('0x8')](),controller[_0x161d('0x9')]);router[_0x161d('0x2')](_0x161d('0xa'),auth[_0x161d('0xb')](),controller['restart']);router[_0x161d('0x2')]('/migrations',controller[_0x161d('0xc')]);module[_0x161d('0xd')]=router;
\ No newline at end of file
+var _0x4f98=['Router','../../components/auth/service','./version.controller','index','get','/fetch','fetch','/reset','isAuthenticated','canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express'];(function(_0x373202,_0x1a1fd4){var _0x5e90ab=function(_0x20da9b){while(--_0x20da9b){_0x373202['push'](_0x373202['shift']());}};_0x5e90ab(++_0x1a1fd4);}(_0x4f98,0x97));var _0x84f9=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x4f98[_0x479160];return _0x47ac6d;};'use strict';var express=require(_0x84f9('0x0'));var router=express[_0x84f9('0x1')]();var auth=require(_0x84f9('0x2'));var controller=require(_0x84f9('0x3'));router['get']('/',controller[_0x84f9('0x4')]);router[_0x84f9('0x5')](_0x84f9('0x6'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x84f9('0x7')]);router['get'](_0x84f9('0x8'),auth[_0x84f9('0x9')](),auth[_0x84f9('0xa')](),controller[_0x84f9('0xb')]);router[_0x84f9('0x5')](_0x84f9('0xc'),auth[_0x84f9('0x9')](),auth[_0x84f9('0xa')](),controller[_0x84f9('0xd')]);router[_0x84f9('0x5')](_0x84f9('0xe'),auth[_0x84f9('0x9')](),controller[_0x84f9('0xf')]);router['get'](_0x84f9('0x10'),controller[_0x84f9('0x11')]);module[_0x84f9('0x12')]=router;
\ No newline at end of file
index dcbdcc2..6537884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffe1=['umzug','lodash','pkginfo','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','query','latest','exports','2.0.0','status','json','fetch','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','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','length','replace','.js','version','push','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','server','map','then','\x20to\x20','last','UniqueConstraintError'];(function(_0x2d120e,_0x3ce8bf){var _0x49c7e7=function(_0xe23153){while(--_0xe23153){_0x2d120e['push'](_0x2d120e['shift']());}};_0x49c7e7(++_0x3ce8bf);}(_0xffe1,0x1a0));var _0x1ffe=function(_0x458595,_0x37c456){_0x458595=_0x458595-0x0;var _0x5edd95=_0xffe1[_0x458595];return _0x5edd95;};'use strict';var Umzug=require(_0x1ffe('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1ffe('0x1'));var pkginfo=require(_0x1ffe('0x2'))(module,'version');var compareVersions=require(_0x1ffe('0x3'));var exec=require('child_process')['exec'];var db=require(_0x1ffe('0x4'))['db'];var config=require(_0x1ffe('0x5'));var pm2=require(_0x1ffe('0x6'));var logger=require(_0x1ffe('0x7'))('update');var git=require(_0x1ffe('0x8'))(config[_0x1ffe('0x9')]);exports['index']=function(_0x33237b,_0x2cd547){var _0x2c149f={'current':module['exports']['version'],'phonebar':0x2};if(_0x33237b[_0x1ffe('0xa')]&&_0x33237b[_0x1ffe('0xa')]['latest']){return git['fetch']()['tags'](function(_0x503bb7,_0xc752a6){_0x2c149f[_0x1ffe('0xb')]=(_0x503bb7?module[_0x1ffe('0xc')]['version']:_0xc752a6['latest'])||_0x1ffe('0xd');return _0x2cd547[_0x1ffe('0xe')](0xc8)['json'](_0x2c149f);});}else{return _0x2cd547[_0x1ffe('0xe')](0xc8)[_0x1ffe('0xf')](_0x2c149f);}};exports[_0x1ffe('0x10')]=function(_0x5d4ffb,_0x3f4ec4){return git[_0x1ffe('0x10')]([_0x1ffe('0x11'),_0x1ffe('0x12')],function(_0x9cc0fc){if(_0x9cc0fc){logger[_0x1ffe('0x13')](_0x9cc0fc);return _0x3f4ec4[_0x1ffe('0xe')](0x1f4)['json'](_0x9cc0fc);}logger[_0x1ffe('0x14')](_0x1ffe('0x15'));return _0x3f4ec4['status'](0xc8)['json']({'output':_0x1ffe('0x16')});});};exports[_0x1ffe('0x17')]=function(_0x25715b,_0x4962f9){return git[_0x1ffe('0x17')]([_0x1ffe('0x18'),_0x1ffe('0x19')],function(_0x3f481e){if(_0x3f481e){logger[_0x1ffe('0x13')](_0x3f481e);return _0x4962f9[_0x1ffe('0xe')](0x1f4)[_0x1ffe('0xf')](_0x3f481e);}logger[_0x1ffe('0x14')](_0x1ffe('0x1a'));return _0x4962f9[_0x1ffe('0xe')](0xc8)[_0x1ffe('0xf')]({'output':_0x1ffe('0x1b')});});};exports['pull']=function(_0x32d3ab,_0x52770e){exec(_0x1ffe('0x1c'),function(_0x44cf2d,_0x427581,_0xb4cd17){logger[_0x1ffe('0x14')](_0x427581);logger['info'](_0xb4cd17);if(_0x44cf2d){logger[_0x1ffe('0x13')](_0x44cf2d);return _0x52770e[_0x1ffe('0xe')](0x1f4)[_0x1ffe('0xf')](_0x44cf2d);}return _0x52770e[_0x1ffe('0xe')](0xc8)['json']({'output':_0x427581});});};exports[_0x1ffe('0x1d')]=function(_0x3a6203,_0xbc45a6){return pm2[_0x1ffe('0x1d')](_0x1ffe('0x1e'))['then'](function(_0x5b4dbb){logger['info'](_0x1ffe('0x1f'),_0x5b4dbb);return _0xbc45a6[_0x1ffe('0xe')](0xc8)[_0x1ffe('0xf')]({'output':_0x1ffe('0x20')});})[_0x1ffe('0x21')](function(_0x2fb942){logger['error'](_0x2fb942);return _0xbc45a6['status'](0x1f4)[_0x1ffe('0xf')](_0x2fb942);});};exports[_0x1ffe('0x22')]=function(_0x42a13e,_0x25b21c){var _0x270f57=fs[_0x1ffe('0x23')](path['join'](config[_0x1ffe('0x9')],'server','migrations'));var _0x148109=[];for(var _0x3ea83c=0x0;_0x3ea83c<_0x270f57[_0x1ffe('0x24')];_0x3ea83c++){var _0x3bea29=_0x270f57[_0x3ea83c][_0x1ffe('0x25')](_0x1ffe('0x26'),'');if(compareVersions(module[_0x1ffe('0xc')][_0x1ffe('0x27')],_0x3bea29)===-0x1){_0x148109[_0x1ffe('0x28')](_0x3bea29);}}if(_0x148109['length']){var _0x4d2277=_0x148109['sort'](compareVersions);var _0x54399e=new Umzug({'storage':_0x1ffe('0x29'),'storageOptions':{'model':db[_0x1ffe('0x2a')],'modelName':'Migration','columnName':_0x1ffe('0x27')},'migrations':{'params':[db[_0x1ffe('0x29')][_0x1ffe('0x2b')](),db['sequelize']['constructor'],function(){throw new Error(_0x1ffe('0x2c'));}],'path':path[_0x1ffe('0x2d')](config[_0x1ffe('0x9')],_0x1ffe('0x2e'),'migrations'),'pattern':/\.js$/}});_0x54399e['up']({'migrations':_[_0x1ffe('0x2f')](_0x4d2277,function(_0x529ce2){return _0x529ce2+_0x1ffe('0x26');})})[_0x1ffe('0x30')](function(){return _0x25b21c[_0x1ffe('0xe')](0xc8)[_0x1ffe('0xf')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x1ffe('0x27')]+_0x1ffe('0x31')+_[_0x1ffe('0x32')](_0x4d2277),'migrations':_[_0x1ffe('0x2d')](_0x4d2277)});})['catch'](function(_0x4e5709){if(_0x4e5709 instanceof db[_0x1ffe('0x29')][_0x1ffe('0x33')]){return _0x25b21c[_0x1ffe('0xe')](0xc8)[_0x1ffe('0xf')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x25b21c['status'](0x1f4)[_0x1ffe('0xf')](_0x4e5709);}});}else{return _0x25b21c[_0x1ffe('0xe')](0xc8)[_0x1ffe('0xf')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0x4b2a=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','child_process','exec','../../config/environment','../../config/logger','update','simple-git','index','exports','version','latest','2.0.0','json','status','fetch','origin','master','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','error','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','.js','push','sequelize','Migration'];(function(_0x2b2acd,_0x26a3df){var _0xf49494=function(_0x473d2a){while(--_0x473d2a){_0x2b2acd['push'](_0x2b2acd['shift']());}};_0xf49494(++_0x26a3df);}(_0x4b2a,0x9f));var _0xa4b2=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4b2a[_0x3ab51d];return _0x29a04e;};'use strict';var Umzug=require('umzug');var path=require(_0xa4b2('0x0'));var fs=require('fs');var _=require(_0xa4b2('0x1'));var pkginfo=require(_0xa4b2('0x2'))(module,'version');var compareVersions=require(_0xa4b2('0x3'));var exec=require(_0xa4b2('0x4'))[_0xa4b2('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0xa4b2('0x6'));var pm2=require('../../config/pm2');var logger=require(_0xa4b2('0x7'))(_0xa4b2('0x8'));var git=require(_0xa4b2('0x9'))(config['root']);exports[_0xa4b2('0xa')]=function(_0x5d99ee,_0x34983e){var _0x4ff808={'current':module[_0xa4b2('0xb')][_0xa4b2('0xc')],'phonebar':0x2};if(_0x5d99ee['query']&&_0x5d99ee['query']['latest']){return git['fetch']()['tags'](function(_0x53ca7c,_0xd2ab41){_0x4ff808[_0xa4b2('0xd')]=(_0x53ca7c?module[_0xa4b2('0xb')][_0xa4b2('0xc')]:_0xd2ab41[_0xa4b2('0xd')])||_0xa4b2('0xe');return _0x34983e['status'](0xc8)[_0xa4b2('0xf')](_0x4ff808);});}else{return _0x34983e[_0xa4b2('0x10')](0xc8)[_0xa4b2('0xf')](_0x4ff808);}};exports['fetch']=function(_0x33a27d,_0x20c78e){return git[_0xa4b2('0x11')]([_0xa4b2('0x12'),_0xa4b2('0x13')],function(_0x3742af){if(_0x3742af){logger['error'](_0x3742af);return _0x20c78e[_0xa4b2('0x10')](0x1f4)['json'](_0x3742af);}logger[_0xa4b2('0x14')](_0xa4b2('0x15'));return _0x20c78e[_0xa4b2('0x10')](0xc8)['json']({'output':_0xa4b2('0x16')});});};exports['reset']=function(_0x20b2b5,_0x12aabd){return git[_0xa4b2('0x17')]([_0xa4b2('0x18'),_0xa4b2('0x19')],function(_0x5d9205){if(_0x5d9205){logger['error'](_0x5d9205);return _0x12aabd[_0xa4b2('0x10')](0x1f4)[_0xa4b2('0xf')](_0x5d9205);}logger[_0xa4b2('0x14')](_0xa4b2('0x1a'));return _0x12aabd['status'](0xc8)[_0xa4b2('0xf')]({'output':_0xa4b2('0x1b')});});};exports[_0xa4b2('0x1c')]=function(_0x22038d,_0x52dcaf){exec(_0xa4b2('0x1d'),function(_0x2baad1,_0x2a4ef9,_0x282844){logger[_0xa4b2('0x14')](_0x2a4ef9);logger[_0xa4b2('0x14')](_0x282844);if(_0x2baad1){logger[_0xa4b2('0x1e')](_0x2baad1);return _0x52dcaf[_0xa4b2('0x10')](0x1f4)[_0xa4b2('0xf')](_0x2baad1);}return _0x52dcaf[_0xa4b2('0x10')](0xc8)[_0xa4b2('0xf')]({'output':_0x2a4ef9});});};exports['restart']=function(_0x42f18d,_0xfe16c4){return pm2['restart'](_0xa4b2('0x1f'))['then'](function(_0x350b37){logger[_0xa4b2('0x14')](_0xa4b2('0x20'),_0x350b37);return _0xfe16c4['status'](0xc8)[_0xa4b2('0xf')]({'output':_0xa4b2('0x21')});})[_0xa4b2('0x22')](function(_0x1adee6){logger[_0xa4b2('0x1e')](_0x1adee6);return _0xfe16c4[_0xa4b2('0x10')](0x1f4)[_0xa4b2('0xf')](_0x1adee6);});};exports[_0xa4b2('0x23')]=function(_0x9180ef,_0xa52248){var _0x1b8ecc=fs[_0xa4b2('0x24')](path[_0xa4b2('0x25')](config[_0xa4b2('0x26')],_0xa4b2('0x27'),_0xa4b2('0x23')));var _0x2478d9=[];for(var _0x4b163c=0x0;_0x4b163c<_0x1b8ecc[_0xa4b2('0x28')];_0x4b163c++){var _0x2c3ae0=_0x1b8ecc[_0x4b163c]['replace'](_0xa4b2('0x29'),'');if(compareVersions(module['exports']['version'],_0x2c3ae0)===-0x1){_0x2478d9[_0xa4b2('0x2a')](_0x2c3ae0);}}if(_0x2478d9[_0xa4b2('0x28')]){var _0x2c111b=_0x2478d9['sort'](compareVersions);var _0x184f94=new Umzug({'storage':_0xa4b2('0x2b'),'storageOptions':{'model':db[_0xa4b2('0x2c')],'modelName':'Migration','columnName':_0xa4b2('0xc')},'migrations':{'params':[db[_0xa4b2('0x2b')]['getQueryInterface'](),db[_0xa4b2('0x2b')][_0xa4b2('0x2d')],function(){throw new Error(_0xa4b2('0x2e'));}],'path':path['join'](config[_0xa4b2('0x26')],'server','migrations'),'pattern':/\.js$/}});_0x184f94['up']({'migrations':_['map'](_0x2c111b,function(_0x5e5a21){return _0x5e5a21+_0xa4b2('0x29');})})['then'](function(){return _0xa52248['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xa4b2('0xb')]['version']+_0xa4b2('0x2f')+_[_0xa4b2('0x30')](_0x2c111b),'migrations':_[_0xa4b2('0x25')](_0x2c111b)});})[_0xa4b2('0x22')](function(_0x3e3e74){if(_0x3e3e74 instanceof db[_0xa4b2('0x2b')][_0xa4b2('0x31')]){return _0xa52248[_0xa4b2('0x10')](0xc8)['json']({'output':_0xa4b2('0x32')});}else{return _0xa52248[_0xa4b2('0x10')](0x1f4)[_0xa4b2('0xf')](_0x3e3e74);}});}else{return _0xa52248[_0xa4b2('0x10')](0xc8)[_0xa4b2('0xf')]({'output':_0xa4b2('0x32')});}};
\ No newline at end of file
index 0727955..738c3cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd12a=['/describe','describe','/:id','show','post','create','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xd12a,0xaa));var _0xad12=function(_0x15bf58,_0x170ea4){_0x15bf58=_0x15bf58-0x0;var _0x5d6c96=_0xd12a[_0x15bf58];return _0x5d6c96;};'use strict';var multer=require('multer');var util=require(_0xad12('0x0'));var path=require('path');var timeout=require(_0xad12('0x1'));var express=require('express');var router=express[_0xad12('0x2')]();var fs_extra=require(_0xad12('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xad12('0x4'));var config=require(_0xad12('0x5'));var controller=require(_0xad12('0x6'));router[_0xad12('0x7')]('/',auth[_0xad12('0x8')](),controller[_0xad12('0x9')]);router[_0xad12('0x7')](_0xad12('0xa'),auth[_0xad12('0x8')](),controller[_0xad12('0xb')]);router[_0xad12('0x7')](_0xad12('0xc'),auth['isAuthenticated'](),controller[_0xad12('0xd')]);router[_0xad12('0xe')]('/',auth['isAuthenticated'](),controller[_0xad12('0xf')]);router['put'](_0xad12('0xc'),auth[_0xad12('0x8')](),controller['update']);router['delete'](_0xad12('0xc'),auth[_0xad12('0x8')](),controller[_0xad12('0x10')]);module[_0xad12('0x11')]=router;
\ No newline at end of file
+var _0x6923=['util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','exports','multer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6923,0x109));var _0x3692=function(_0x1a1e48,_0x38cf4f){_0x1a1e48=_0x1a1e48-0x0;var _0x27af1d=_0x6923[_0x1a1e48];return _0x27af1d;};'use strict';var multer=require(_0x3692('0x0'));var util=require(_0x3692('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3692('0x2'));var router=express[_0x3692('0x3')]();var fs_extra=require(_0x3692('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3692('0x5'));var config=require(_0x3692('0x6'));var controller=require(_0x3692('0x7'));router[_0x3692('0x8')]('/',auth[_0x3692('0x9')](),controller['index']);router['get'](_0x3692('0xa'),auth[_0x3692('0x9')](),controller[_0x3692('0xb')]);router[_0x3692('0x8')](_0x3692('0xc'),auth[_0x3692('0x9')](),controller[_0x3692('0xd')]);router[_0x3692('0xe')]('/',auth['isAuthenticated'](),controller[_0x3692('0xf')]);router[_0x3692('0x10')](_0x3692('0xc'),auth[_0x3692('0x9')](),controller['update']);router[_0x3692('0x11')](_0x3692('0xc'),auth[_0x3692('0x9')](),controller['destroy']);module[_0x3692('0x12')]=router;
\ No newline at end of file
index 9594f51..9e86964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x065e=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x41886e,_0x2f9b3e){var _0x10e7f4=function(_0x267c43){while(--_0x267c43){_0x41886e['push'](_0x41886e['shift']());}};_0x10e7f4(++_0x2f9b3e);}(_0x065e,0x1a7));var _0xe065=function(_0x48def0,_0x2a17c4){_0x48def0=_0x48def0-0x0;var _0x3a896c=_0x065e[_0x48def0];return _0x3a896c;};'use strict';var Sequelize=require(_0xe065('0x0'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe065('0x1')]},'calleridname':{'type':Sequelize[_0xe065('0x1')]},'queue':{'type':Sequelize[_0xe065('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xe065('0x2')]},'agentconnectAt':{'type':Sequelize[_0xe065('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xe065('0x2')]},'agentdumpAt':{'type':Sequelize[_0xe065('0x2')]},'holdtime':{'type':Sequelize[_0xe065('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xe065('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xe065('0x3')]},'agentacw':{'type':Sequelize[_0xe065('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe065('0x3')]},'reason':{'type':Sequelize[_0xe065('0x1')]},'lastevent':{'type':Sequelize[_0xe065('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xe065('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe065('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe065('0x1')]},'connectedlinename':{'type':Sequelize[_0xe065('0x1')]},'language':{'type':Sequelize[_0xe065('0x1')]},'accountcode':{'type':Sequelize[_0xe065('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe065('0x1')]},'destchannel':{'type':Sequelize[_0xe065('0x1')]},'destchannelstate':{'type':Sequelize[_0xe065('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe065('0x1')]},'destcalleridname':{'type':Sequelize[_0xe065('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe065('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xe065('0x1')]},'destlanguage':{'type':Sequelize[_0xe065('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe065('0x1')]},'destexten':{'type':Sequelize[_0xe065('0x1')]},'destpriority':{'type':Sequelize[_0xe065('0x1')]},'destuniqueid':{'type':Sequelize[_0xe065('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe065('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xe065('0x1')]},'transfer':{'type':Sequelize[_0xe065('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xe065('0x5')},'transferexten':{'type':Sequelize[_0xe065('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe065('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdef9=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0xdef9,0x1ed));var _0x9def=function(_0x27097a,_0x1b7f8b){_0x27097a=_0x27097a-0x0;var _0x26378b=_0xdef9[_0x27097a];return _0x26378b;};'use strict';var Sequelize=require(_0x9def('0x0'));module[_0x9def('0x1')]={'type':{'type':Sequelize[_0x9def('0x2')]},'uniqueid':{'type':Sequelize[_0x9def('0x2')]},'calleridnum':{'type':Sequelize[_0x9def('0x2')]},'calleridname':{'type':Sequelize[_0x9def('0x2')]},'queue':{'type':Sequelize[_0x9def('0x2')]},'interface':{'type':Sequelize[_0x9def('0x2')]},'membername':{'type':Sequelize[_0x9def('0x2')]},'agentcalledAt':{'type':Sequelize[_0x9def('0x3')]},'agentconnectAt':{'type':Sequelize[_0x9def('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x9def('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x9def('0x3')]},'agentdumpAt':{'type':Sequelize[_0x9def('0x3')]},'holdtime':{'type':Sequelize[_0x9def('0x4')]},'agentcomplete':{'type':Sequelize[_0x9def('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9def('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9def('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9def('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9def('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9def('0x2')]},'channelstate':{'type':Sequelize[_0x9def('0x4')]},'channelstatedesc':{'type':Sequelize[_0x9def('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9def('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9def('0x2')]},'accountcode':{'type':Sequelize[_0x9def('0x2')]},'context':{'type':Sequelize[_0x9def('0x2')]},'exten':{'type':Sequelize[_0x9def('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x9def('0x2')]},'destchannelstate':{'type':Sequelize[_0x9def('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9def('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9def('0x2')]},'destlanguage':{'type':Sequelize[_0x9def('0x2')]},'destaccountcode':{'type':Sequelize[_0x9def('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9def('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9def('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9def('0x2')]},'transfer':{'type':Sequelize[_0x9def('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9def('0x2')],'comment':_0x9def('0x6')},'transferexten':{'type':Sequelize[_0x9def('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9def('0x2')]},'agententerreason':{'type':Sequelize[_0x9def('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 283273c..d7ea4aa 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(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'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 590ca31..2ea5a53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc59=['./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x24edef,_0x3012f1){var _0xb87be8=function(_0x58f38f){while(--_0x58f38f){_0x24edef['push'](_0x24edef['shift']());}};_0xb87be8(++_0x3012f1);}(_0xdc59,0x12c));var _0x9dc5=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0xdc59[_0x14fad0];return _0x5c665f;};'use strict';var _=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var logger=require(_0x9dc5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9dc5('0x3'));var rp=require(_0x9dc5('0x4'));var fs=require('fs');var path=require(_0x9dc5('0x5'));var rimraf=require(_0x9dc5('0x6'));var config=require(_0x9dc5('0x7'));var attributes=require(_0x9dc5('0x8'));module[_0x9dc5('0x9')]=function(_0xf17598,_0x13e31c){return _0xf17598['define'](_0x9dc5('0xa'),attributes,{'tableName':_0x9dc5('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9dc5('0xc'),_0x9dc5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8a7=['VoiceAgentReport','report_agent','destuniqueid','lodash','moment','bluebird','request-promise','rimraf','./voiceAgentReport.attributes','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd8a7,0xdf));var _0x7d8a=function(_0x4dd8df,_0x527071){_0x4dd8df=_0x4dd8df-0x0;var _0x21628a=_0xd8a7[_0x4dd8df];return _0x21628a;};'use strict';var _=require(_0x7d8a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7d8a('0x1'));var BPromise=require(_0x7d8a('0x2'));var rp=require(_0x7d8a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d8a('0x4'));var config=require('../../config/environment');var attributes=require(_0x7d8a('0x5'));module['exports']=function(_0x27ef8e,_0x530308){return _0x27ef8e[_0x7d8a('0x6')](_0x7d8a('0x7'),attributes,{'tableName':_0x7d8a('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x7d8a('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index f5a33b6..70815cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2c3=['CreateVoiceAgentReport','update','where','attributes','limit','UpdateVoiceAgentReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceAgentReport,\x20%s,\x20%s','catch','VoiceAgentReport','body','options','raw'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd2c3,0x1e6));var _0x3d2c=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xd2c3[_0x342baa];return _0x1208f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3d2c('0x0'));var BPromise=require(_0x3d2c('0x1'));var rs=require(_0x3d2c('0x2'));var fs=require('fs');var Redis=require(_0x3d2c('0x3'));var db=require(_0x3d2c('0x4'))['db'];var utils=require(_0x3d2c('0x5'));var logger=require(_0x3d2c('0x6'))(_0x3d2c('0x7'));var config=require(_0x3d2c('0x8'));var jayson=require(_0x3d2c('0x9'));var client=jayson['client'][_0x3d2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fa5b5,_0x1b3558,_0x8eb5ff){return new BPromise(function(_0x42043b,_0x7782cd){return client[_0x3d2c('0xb')](_0x4fa5b5,_0x8eb5ff)[_0x3d2c('0xc')](function(_0x2b5550){logger[_0x3d2c('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x1b3558,'request\x20sent');logger[_0x3d2c('0xe')](_0x3d2c('0xf'),_0x1b3558,_0x3d2c('0x10'),JSON[_0x3d2c('0x11')](_0x2b5550));if(_0x2b5550[_0x3d2c('0x12')]){if(_0x2b5550[_0x3d2c('0x12')]['code']===0x1f4){logger[_0x3d2c('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x1b3558,_0x2b5550['error'][_0x3d2c('0x13')]);return _0x7782cd(_0x2b5550['error']['message']);}logger[_0x3d2c('0x12')](_0x3d2c('0x14'),_0x1b3558,_0x2b5550[_0x3d2c('0x12')][_0x3d2c('0x13')]);return _0x42043b(_0x2b5550['error'][_0x3d2c('0x13')]);}else{logger['info'](_0x3d2c('0x14'),_0x1b3558,_0x3d2c('0x10'));_0x42043b(_0x2b5550['result'][_0x3d2c('0x13')]);}})[_0x3d2c('0x15')](function(_0x18f446){logger[_0x3d2c('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x1b3558,_0x18f446);_0x7782cd(_0x18f446);});});}exports['CreateVoiceAgentReport']=function(_0x208500){var _0x4acdf9=this;return new Promise(function(_0x17f7fc,_0x1f0eb1){return db[_0x3d2c('0x16')]['create'](_0x208500[_0x3d2c('0x17')],{'raw':_0x208500[_0x3d2c('0x18')]?_0x208500[_0x3d2c('0x18')][_0x3d2c('0x19')]===undefined?!![]:![]:!![]})[_0x3d2c('0xc')](function(_0x4cf26b){logger[_0x3d2c('0xd')](_0x3d2c('0x1a'),_0x208500);logger[_0x3d2c('0xe')](_0x3d2c('0x1a'),_0x208500,JSON[_0x3d2c('0x11')](_0x4cf26b));_0x17f7fc(_0x4cf26b);})[_0x3d2c('0x15')](function(_0x241d29){logger[_0x3d2c('0x12')](_0x3d2c('0x1a'),_0x241d29['message'],_0x208500);_0x1f0eb1(_0x4acdf9[_0x3d2c('0x12')](0x1f4,_0x241d29['message']));});});};exports['UpdateVoiceAgentReport']=function(_0x27820c){var _0x47f4e4=this;return new Promise(function(_0x3d0204,_0x963006){return db['VoiceAgentReport'][_0x3d2c('0x1b')](_0x27820c[_0x3d2c('0x17')],{'raw':_0x27820c['options']?_0x27820c['options'][_0x3d2c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27820c[_0x3d2c('0x18')]?_0x27820c[_0x3d2c('0x18')][_0x3d2c('0x1c')]||null:null,'attributes':_0x27820c[_0x3d2c('0x18')]?_0x27820c[_0x3d2c('0x18')][_0x3d2c('0x1d')]||null:null,'limit':_0x27820c[_0x3d2c('0x18')]?_0x27820c[_0x3d2c('0x18')][_0x3d2c('0x1e')]||null:null})[_0x3d2c('0xc')](function(_0x55bd38){logger['info']('UpdateVoiceAgentReport',_0x27820c);logger[_0x3d2c('0xe')]('UpdateVoiceAgentReport',_0x27820c,JSON[_0x3d2c('0x11')](_0x55bd38));_0x3d0204(_0x55bd38);})[_0x3d2c('0x15')](function(_0x200092){logger[_0x3d2c('0x12')](_0x3d2c('0x1f'),_0x200092[_0x3d2c('0x13')],_0x27820c);_0x963006(_0x47f4e4['error'](0x1f4,_0x200092[_0x3d2c('0x13')]));});});};
\ No newline at end of file
+var _0x0319=['raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceAgentReport','create','options'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0319,0x167));var _0x9031=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0319[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x9031('0x0'));var util=require(_0x9031('0x1'));var moment=require('moment');var BPromise=require(_0x9031('0x2'));var rs=require(_0x9031('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9031('0x4'));var logger=require(_0x9031('0x5'))('rpc');var config=require(_0x9031('0x6'));var jayson=require(_0x9031('0x7'));var client=jayson[_0x9031('0x8')][_0x9031('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf53fd9,_0x1d27a2,_0x289b66){return new BPromise(function(_0x104434,_0x268834){return client['request'](_0xf53fd9,_0x289b66)[_0x9031('0xa')](function(_0xb8e830){logger[_0x9031('0xb')](_0x9031('0xc'),_0x1d27a2,_0x9031('0xd'));logger[_0x9031('0xe')](_0x9031('0xf'),_0x1d27a2,_0x9031('0xd'),JSON[_0x9031('0x10')](_0xb8e830));if(_0xb8e830['error']){if(_0xb8e830[_0x9031('0x11')][_0x9031('0x12')]===0x1f4){logger[_0x9031('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d27a2,_0xb8e830['error'][_0x9031('0x13')]);return _0x268834(_0xb8e830['error'][_0x9031('0x13')]);}logger[_0x9031('0x11')](_0x9031('0xc'),_0x1d27a2,_0xb8e830[_0x9031('0x11')]['message']);return _0x104434(_0xb8e830['error']['message']);}else{logger['info'](_0x9031('0xc'),_0x1d27a2,'request\x20sent');_0x104434(_0xb8e830[_0x9031('0x14')]['message']);}})[_0x9031('0x15')](function(_0x20317b){logger[_0x9031('0x11')](_0x9031('0xc'),_0x1d27a2,_0x20317b);_0x268834(_0x20317b);});});}exports['CreateVoiceAgentReport']=function(_0x31dd0f){var _0x5ef604=this;return new Promise(function(_0x560b9b,_0x17ac2e){return db[_0x9031('0x16')][_0x9031('0x17')](_0x31dd0f['body'],{'raw':_0x31dd0f[_0x9031('0x18')]?_0x31dd0f[_0x9031('0x18')][_0x9031('0x19')]===undefined?!![]:![]:!![]})[_0x9031('0xa')](function(_0x321363){logger[_0x9031('0xb')]('CreateVoiceAgentReport',_0x31dd0f);logger[_0x9031('0xe')](_0x9031('0x1a'),_0x31dd0f,JSON[_0x9031('0x10')](_0x321363));_0x560b9b(_0x321363);})['catch'](function(_0x36bbdb){logger[_0x9031('0x11')](_0x9031('0x1a'),_0x36bbdb[_0x9031('0x13')],_0x31dd0f);_0x17ac2e(_0x5ef604[_0x9031('0x11')](0x1f4,_0x36bbdb[_0x9031('0x13')]));});});};exports[_0x9031('0x1b')]=function(_0xf37a0){var _0x22bb6f=this;return new Promise(function(_0x1ce33e,_0x571c4c){return db[_0x9031('0x16')][_0x9031('0x1c')](_0xf37a0['body'],{'raw':_0xf37a0[_0x9031('0x18')]?_0xf37a0[_0x9031('0x18')][_0x9031('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf37a0[_0x9031('0x18')]?_0xf37a0[_0x9031('0x18')][_0x9031('0x1d')]||null:null,'attributes':_0xf37a0[_0x9031('0x18')]?_0xf37a0[_0x9031('0x18')][_0x9031('0x1e')]||null:null,'limit':_0xf37a0[_0x9031('0x18')]?_0xf37a0[_0x9031('0x18')][_0x9031('0x1f')]||null:null})[_0x9031('0xa')](function(_0x40195b){logger['info'](_0x9031('0x1b'),_0xf37a0);logger[_0x9031('0xe')](_0x9031('0x1b'),_0xf37a0,JSON[_0x9031('0x10')](_0x40195b));_0x1ce33e(_0x40195b);})[_0x9031('0x15')](function(_0x421bd6){logger[_0x9031('0x11')](_0x9031('0x1b'),_0x421bd6['message'],_0xf37a0);_0x571c4c(_0x22bb6f[_0x9031('0x11')](0x1f4,_0x421bd6[_0x9031('0x13')]));});});};
\ No newline at end of file
index b64f668..4d03cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer'];(function(_0x3869c8,_0x2ff137){var _0x4caf60=function(_0x224384){while(--_0x224384){_0x3869c8['push'](_0x3869c8['shift']());}};_0x4caf60(++_0x2ff137);}(_0x46ed,0x168));var _0xd46e=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x46ed[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')]('/',auth[_0xd46e('0x9')](),controller[_0xd46e('0xa')]);router[_0xd46e('0x8')](_0xd46e('0xb'),auth[_0xd46e('0x9')](),controller[_0xd46e('0xc')]);router[_0xd46e('0x8')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller['show']);router[_0xd46e('0xe')]('/',auth[_0xd46e('0x9')](),controller['create']);router[_0xd46e('0xf')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller[_0xd46e('0x10')]);router[_0xd46e('0x11')](_0xd46e('0xd'),auth['isAuthenticated'](),controller[_0xd46e('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xc949=['show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x58961c,_0x501d71){var _0x33114c=function(_0x4ddcb3){while(--_0x4ddcb3){_0x58961c['push'](_0x58961c['shift']());}};_0x33114c(++_0x501d71);}(_0xc949,0x181));var _0x9c94=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xc949[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c94('0x5'));var interaction=require(_0x9c94('0x6'));var config=require('../../config/environment');var controller=require(_0x9c94('0x7'));router[_0x9c94('0x8')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0xa')]);router['get'](_0x9c94('0xb'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x8')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0xe')]);router[_0x9c94('0xf')]('/',auth[_0x9c94('0x9')](),controller[_0x9c94('0x10')]);router['put'](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x11')]);router[_0x9c94('0x12')](_0x9c94('0xd'),auth[_0x9c94('0x9')](),controller[_0x9c94('0x13')]);module[_0x9c94('0x14')]=router;
\ No newline at end of file
index 0f48ce0..5268bc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ee8=['internal','outbound','inbound-fax','outbound-fax','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound'];(function(_0x389b0d,_0x2be94b){var _0x534eae=function(_0x2409b0){while(--_0x2409b0){_0x389b0d['push'](_0x389b0d['shift']());}};_0x534eae(++_0x2be94b);}(_0x8ee8,0xe4));var _0x88ee=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0x8ee8[_0x208b7a];return _0x37b7ec;};'use strict';var Sequelize=require(_0x88ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x88ee('0x1')](_0x88ee('0x2'),_0x88ee('0x3'),_0x88ee('0x4'),_0x88ee('0x5'),_0x88ee('0x6'),'dialer')},'tag':{'type':Sequelize[_0x88ee('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0x88ee('0x7')]},'destination':{'type':Sequelize[_0x88ee('0x7')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x88ee('0x7')]},'channel':{'type':Sequelize[_0x88ee('0x7')]},'destinationchannel':{'type':Sequelize[_0x88ee('0x7')]},'lastapplication':{'type':Sequelize[_0x88ee('0x7')]},'lastdata':{'type':Sequelize[_0x88ee('0x8')]},'starttime':{'type':Sequelize[_0x88ee('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x88ee('0x9')]},'endtime':{'type':Sequelize[_0x88ee('0x9')]},'duration':{'type':Sequelize[_0x88ee('0xa')]},'billableseconds':{'type':Sequelize[_0x88ee('0xa')]},'mohtime':{'type':Sequelize[_0x88ee('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x88ee('0x7')]},'userfield':{'type':Sequelize[_0x88ee('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x88ee('0x7')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x88ee('0x7')]},'routeid':{'type':Sequelize[_0x88ee('0xa')]},'sipcallid':{'type':Sequelize[_0x88ee('0x7')]}};
\ No newline at end of file
+var _0x27f4=['ENUM','inbound','internal','dialer','DATE','INTEGER','exports','STRING'];(function(_0x42569e,_0x20fd08){var _0x5159a=function(_0x405ff2){while(--_0x405ff2){_0x42569e['push'](_0x42569e['shift']());}};_0x5159a(++_0x20fd08);}(_0x27f4,0x14e));var _0x427f=function(_0x28d885,_0x22d916){_0x28d885=_0x28d885-0x0;var _0x54e080=_0x27f4[_0x28d885];return _0x54e080;};'use strict';var Sequelize=require('sequelize');module[_0x427f('0x0')]={'uniqueid':{'type':Sequelize[_0x427f('0x1')]},'type':{'type':Sequelize[_0x427f('0x2')](_0x427f('0x3'),_0x427f('0x4'),'outbound','inbound-fax','outbound-fax',_0x427f('0x5'))},'tag':{'type':Sequelize[_0x427f('0x1')]},'accountcode':{'type':Sequelize[_0x427f('0x1')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x427f('0x1')]},'destinationcontext':{'type':Sequelize[_0x427f('0x1')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x427f('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x427f('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x427f('0x6')]},'answertime':{'type':Sequelize[_0x427f('0x6')]},'endtime':{'type':Sequelize[_0x427f('0x6')]},'duration':{'type':Sequelize[_0x427f('0x7')]},'billableseconds':{'type':Sequelize[_0x427f('0x7')]},'mohtime':{'type':Sequelize[_0x427f('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x427f('0x1')]},'amaflags':{'type':Sequelize[_0x427f('0x1')]},'userfield':{'type':Sequelize[_0x427f('0x1')]},'userDisposition':{'type':Sequelize[_0x427f('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x427f('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x427f('0x1')]},'note':{'type':Sequelize[_0x427f('0x1')]},'prefix':{'type':Sequelize[_0x427f('0x1')]},'routeid':{'type':Sequelize[_0x427f('0x7')]},'sipcallid':{'type':Sequelize[_0x427f('0x1')]}};
\ No newline at end of file
index 96d77ec..8802a70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x45da14,_0xcef03d){var _0x17844c=function(_0x5d0c2d){while(--_0x5d0c2d){_0x45da14['push'](_0x45da14['shift']());}};_0x17844c(++_0xcef03d);}(_0xdb28,0x106));var _0x8db2=function(_0x46def6,_0x1ab6e6){_0x46def6=_0x46def6-0x0;var _0x55afdc=_0xdb28[_0x46def6];return _0x55afdc;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));};
\ No newline at end of file
+var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
index 419397b..b4882c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c85=['exports','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x31ded7,_0x4dcc52){var _0x21c75e=function(_0x37ce73){while(--_0x37ce73){_0x31ded7['push'](_0x31ded7['shift']());}};_0x21c75e(++_0x4dcc52);}(_0x7c85,0x108));var _0x57c8=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0x7c85[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x57c8('0x0'));var util=require(_0x57c8('0x1'));var logger=require(_0x57c8('0x2'))('api');var moment=require(_0x57c8('0x3'));var BPromise=require(_0x57c8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57c8('0x5'));var rimraf=require(_0x57c8('0x6'));var config=require(_0x57c8('0x7'));var attributes=require(_0x57c8('0x8'));module[_0x57c8('0x9')]=function(_0x3c3fc6,_0x55543d){return _0x3c3fc6[_0x57c8('0xa')](_0x57c8('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x57c8('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e90=['exports','VoiceCallReport','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x5d4cb5,_0x22025e){var _0x25561e=function(_0x4d792a){while(--_0x4d792a){_0x5d4cb5['push'](_0x5d4cb5['shift']());}};_0x25561e(++_0x22025e);}(_0x1e90,0x1c5));var _0x01e9=function(_0x169a73,_0x182f58){_0x169a73=_0x169a73-0x0;var _0x2480be=_0x1e90[_0x169a73];return _0x2480be;};'use strict';var _=require(_0x01e9('0x0'));var util=require(_0x01e9('0x1'));var logger=require(_0x01e9('0x2'))(_0x01e9('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x01e9('0x4'));var fs=require('fs');var path=require(_0x01e9('0x5'));var rimraf=require(_0x01e9('0x6'));var config=require(_0x01e9('0x7'));var attributes=require(_0x01e9('0x8'));module[_0x01e9('0x9')]=function(_0x50cff9,_0x3291f9){return _0x50cff9['define'](_0x01e9('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index bd892a5..2789286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9070=['map','attributes','CreateVoiceCallReport','VoiceCallReport','create','UpdateVoiceCallReport','update','body','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','limit','include','model'];(function(_0x342fa0,_0x308796){var _0x1f954c=function(_0x30261c){while(--_0x30261c){_0x342fa0['push'](_0x342fa0['shift']());}};_0x1f954c(++_0x308796);}(_0x9070,0x128));var _0x0907=function(_0x4492af,_0x47e25d){_0x4492af=_0x4492af-0x0;var _0x216729=_0x9070[_0x4492af];return _0x216729;};'use strict';var _=require(_0x0907('0x0'));var util=require(_0x0907('0x1'));var moment=require(_0x0907('0x2'));var BPromise=require(_0x0907('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0907('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0907('0x5'));var logger=require('../../config/logger')(_0x0907('0x6'));var config=require('../../config/environment');var jayson=require(_0x0907('0x7'));var client=jayson[_0x0907('0x8')][_0x0907('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e9259,_0x325fe7,_0x4a0c33){return new BPromise(function(_0x13ea72,_0x72518d){return client['request'](_0x2e9259,_0x4a0c33)[_0x0907('0xa')](function(_0x17b6d8){logger['info'](_0x0907('0xb'),_0x325fe7,_0x0907('0xc'));logger[_0x0907('0xd')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x325fe7,_0x0907('0xc'),JSON[_0x0907('0xe')](_0x17b6d8));if(_0x17b6d8['error']){if(_0x17b6d8[_0x0907('0xf')]['code']===0x1f4){logger[_0x0907('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x325fe7,_0x17b6d8[_0x0907('0xf')][_0x0907('0x10')]);return _0x72518d(_0x17b6d8['error'][_0x0907('0x10')]);}logger[_0x0907('0xf')](_0x0907('0xb'),_0x325fe7,_0x17b6d8[_0x0907('0xf')]['message']);return _0x13ea72(_0x17b6d8['error'][_0x0907('0x10')]);}else{logger[_0x0907('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x325fe7,_0x0907('0xc'));_0x13ea72(_0x17b6d8[_0x0907('0x12')][_0x0907('0x10')]);}})[_0x0907('0x13')](function(_0x133801){logger[_0x0907('0xf')](_0x0907('0xb'),_0x325fe7,_0x133801);_0x72518d(_0x133801);});});}exports[_0x0907('0x14')]=function(_0x673e62){var _0x4549f7=this;return new Promise(function(_0x41e6e5,_0x415449){return db['VoiceCallReport'][_0x0907('0x15')]({'raw':_0x673e62['options']?_0x673e62[_0x0907('0x16')][_0x0907('0x17')]===undefined?!![]:![]:!![],'where':_0x673e62[_0x0907('0x16')]?_0x673e62['options'][_0x0907('0x18')]||null:null,'attributes':_0x673e62['options']?_0x673e62[_0x0907('0x16')]['attributes']||null:null,'limit':_0x673e62['options']?_0x673e62[_0x0907('0x16')][_0x0907('0x19')]||null:null,'include':_0x673e62[_0x0907('0x16')]?_0x673e62[_0x0907('0x16')][_0x0907('0x1a')]?_['map'](_0x673e62[_0x0907('0x16')]['include'],function(_0x5c457d){return{'model':db[_0x5c457d[_0x0907('0x1b')]],'as':_0x5c457d['as'],'attributes':_0x5c457d['attributes'],'include':_0x5c457d[_0x0907('0x1a')]?_[_0x0907('0x1c')](_0x5c457d[_0x0907('0x1a')],function(_0xf5b39c){return{'model':db[_0xf5b39c['model']],'as':_0xf5b39c['as'],'attributes':_0xf5b39c[_0x0907('0x1d')],'include':_0xf5b39c[_0x0907('0x1a')]?_['map'](_0xf5b39c[_0x0907('0x1a')],function(_0x53d9a6){return{'model':db[_0x53d9a6[_0x0907('0x1b')]],'as':_0x53d9a6['as'],'attributes':_0x53d9a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe1c42){logger[_0x0907('0x11')]('GetVoiceCallReport',_0x673e62);logger[_0x0907('0xd')](_0x0907('0x14'),_0x673e62,JSON[_0x0907('0xe')](_0xe1c42));_0x41e6e5(_0xe1c42);})[_0x0907('0x13')](function(_0x2585a7){logger['error'](_0x0907('0x14'),_0x2585a7[_0x0907('0x10')],_0x673e62);_0x415449(_0x4549f7['error'](0x1f4,_0x2585a7[_0x0907('0x10')]));});});};exports[_0x0907('0x1e')]=function(_0x3914f6){var _0x3cc5a2=this;return new Promise(function(_0x2f84b2,_0x411903){return db[_0x0907('0x1f')][_0x0907('0x20')](_0x3914f6['body'],{'raw':_0x3914f6['options']?_0x3914f6[_0x0907('0x16')][_0x0907('0x17')]===undefined?!![]:![]:!![]})[_0x0907('0xa')](function(_0x1a1428){logger['info'](_0x0907('0x1e'),_0x3914f6);logger['debug'](_0x0907('0x1e'),_0x3914f6,JSON['stringify'](_0x1a1428));_0x2f84b2(_0x1a1428);})['catch'](function(_0x2e4efc){logger[_0x0907('0xf')](_0x0907('0x1e'),_0x2e4efc[_0x0907('0x10')],_0x3914f6);_0x411903(_0x3cc5a2[_0x0907('0xf')](0x1f4,_0x2e4efc[_0x0907('0x10')]));});});};exports[_0x0907('0x21')]=function(_0x594896){var _0xe0e4f4=this;return new Promise(function(_0x336986,_0x3c05d7){return db[_0x0907('0x1f')][_0x0907('0x22')](_0x594896[_0x0907('0x23')],{'raw':_0x594896[_0x0907('0x16')]?_0x594896[_0x0907('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x594896[_0x0907('0x16')]?_0x594896[_0x0907('0x16')][_0x0907('0x18')]||null:null,'attributes':_0x594896[_0x0907('0x16')]?_0x594896[_0x0907('0x16')]['attributes']||null:null,'limit':_0x594896[_0x0907('0x16')]?_0x594896['options']['limit']||null:null})[_0x0907('0xa')](function(_0x42a05a){logger[_0x0907('0x11')]('UpdateVoiceCallReport',_0x594896);logger[_0x0907('0xd')](_0x0907('0x21'),_0x594896,JSON[_0x0907('0xe')](_0x42a05a));_0x336986(_0x42a05a);})[_0x0907('0x13')](function(_0x42d6fc){logger[_0x0907('0xf')](_0x0907('0x21'),_0x42d6fc[_0x0907('0x10')],_0x594896);_0x3c05d7(_0xe0e4f4['error'](0x1f4,_0x42d6fc[_0x0907('0x10')]));});});};
\ No newline at end of file
+var _0xc17b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xc17b,0x105));var _0xbc17=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xc17b[_0x36c5b0];return _0xf19333;};'use strict';var _=require('lodash');var util=require(_0xbc17('0x0'));var moment=require('moment');var BPromise=require(_0xbc17('0x1'));var rs=require(_0xbc17('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc17('0x3'))['db'];var utils=require(_0xbc17('0x4'));var logger=require('../../config/logger')(_0xbc17('0x5'));var config=require(_0xbc17('0x6'));var jayson=require(_0xbc17('0x7'));var client=jayson[_0xbc17('0x8')][_0xbc17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15e681,_0x3be286,_0x464a72){return new BPromise(function(_0x250c46,_0x2c99b0){return client[_0xbc17('0xa')](_0x15e681,_0x464a72)[_0xbc17('0xb')](function(_0x14eec4){logger[_0xbc17('0xc')](_0xbc17('0xd'),_0x3be286,_0xbc17('0xe'));logger[_0xbc17('0xf')](_0xbc17('0x10'),_0x3be286,_0xbc17('0xe'),JSON[_0xbc17('0x11')](_0x14eec4));if(_0x14eec4[_0xbc17('0x12')]){if(_0x14eec4[_0xbc17('0x12')]['code']===0x1f4){logger[_0xbc17('0x12')](_0xbc17('0xd'),_0x3be286,_0x14eec4['error'][_0xbc17('0x13')]);return _0x2c99b0(_0x14eec4[_0xbc17('0x12')][_0xbc17('0x13')]);}logger[_0xbc17('0x12')](_0xbc17('0xd'),_0x3be286,_0x14eec4[_0xbc17('0x12')]['message']);return _0x250c46(_0x14eec4[_0xbc17('0x12')][_0xbc17('0x13')]);}else{logger['info'](_0xbc17('0xd'),_0x3be286,_0xbc17('0xe'));_0x250c46(_0x14eec4[_0xbc17('0x14')]['message']);}})[_0xbc17('0x15')](function(_0x495c1e){logger[_0xbc17('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x3be286,_0x495c1e);_0x2c99b0(_0x495c1e);});});}exports[_0xbc17('0x16')]=function(_0x4d6fce){var _0x5a7b75=this;return new Promise(function(_0x1f2e35,_0x35cdac){return db[_0xbc17('0x17')][_0xbc17('0x18')]({'raw':_0x4d6fce[_0xbc17('0x19')]?_0x4d6fce[_0xbc17('0x19')][_0xbc17('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d6fce[_0xbc17('0x19')]?_0x4d6fce[_0xbc17('0x19')][_0xbc17('0x1b')]||null:null,'attributes':_0x4d6fce['options']?_0x4d6fce[_0xbc17('0x19')][_0xbc17('0x1c')]||null:null,'limit':_0x4d6fce[_0xbc17('0x19')]?_0x4d6fce['options'][_0xbc17('0x1d')]||null:null,'include':_0x4d6fce[_0xbc17('0x19')]?_0x4d6fce[_0xbc17('0x19')]['include']?_[_0xbc17('0x1e')](_0x4d6fce[_0xbc17('0x19')][_0xbc17('0x1f')],function(_0x286afe){return{'model':db[_0x286afe[_0xbc17('0x20')]],'as':_0x286afe['as'],'attributes':_0x286afe[_0xbc17('0x1c')],'include':_0x286afe[_0xbc17('0x1f')]?_[_0xbc17('0x1e')](_0x286afe[_0xbc17('0x1f')],function(_0x48d36a){return{'model':db[_0x48d36a[_0xbc17('0x20')]],'as':_0x48d36a['as'],'attributes':_0x48d36a['attributes'],'include':_0x48d36a[_0xbc17('0x1f')]?_[_0xbc17('0x1e')](_0x48d36a[_0xbc17('0x1f')],function(_0x29f353){return{'model':db[_0x29f353[_0xbc17('0x20')]],'as':_0x29f353['as'],'attributes':_0x29f353[_0xbc17('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b7564){logger[_0xbc17('0xc')](_0xbc17('0x16'),_0x4d6fce);logger['debug'](_0xbc17('0x16'),_0x4d6fce,JSON['stringify'](_0x4b7564));_0x1f2e35(_0x4b7564);})[_0xbc17('0x15')](function(_0xf78eea){logger['error'](_0xbc17('0x16'),_0xf78eea[_0xbc17('0x13')],_0x4d6fce);_0x35cdac(_0x5a7b75[_0xbc17('0x12')](0x1f4,_0xf78eea[_0xbc17('0x13')]));});});};exports[_0xbc17('0x21')]=function(_0x4fe418){var _0x759b57=this;return new Promise(function(_0x3e26dc,_0x4aa0e5){return db[_0xbc17('0x17')][_0xbc17('0x22')](_0x4fe418[_0xbc17('0x23')],{'raw':_0x4fe418['options']?_0x4fe418[_0xbc17('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbc17('0xb')](function(_0x3b8a55){logger[_0xbc17('0xc')](_0xbc17('0x21'),_0x4fe418);logger['debug'](_0xbc17('0x21'),_0x4fe418,JSON[_0xbc17('0x11')](_0x3b8a55));_0x3e26dc(_0x3b8a55);})[_0xbc17('0x15')](function(_0x1dd152){logger[_0xbc17('0x12')](_0xbc17('0x21'),_0x1dd152['message'],_0x4fe418);_0x4aa0e5(_0x759b57[_0xbc17('0x12')](0x1f4,_0x1dd152[_0xbc17('0x13')]));});});};exports[_0xbc17('0x24')]=function(_0x14284e){var _0x42ce2f=this;return new Promise(function(_0x2a027c,_0x43118a){return db[_0xbc17('0x17')][_0xbc17('0x25')](_0x14284e[_0xbc17('0x23')],{'raw':_0x14284e[_0xbc17('0x19')]?_0x14284e[_0xbc17('0x19')][_0xbc17('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14284e[_0xbc17('0x19')]?_0x14284e[_0xbc17('0x19')]['where']||null:null,'attributes':_0x14284e[_0xbc17('0x19')]?_0x14284e['options'][_0xbc17('0x1c')]||null:null,'limit':_0x14284e[_0xbc17('0x19')]?_0x14284e[_0xbc17('0x19')][_0xbc17('0x1d')]||null:null})[_0xbc17('0xb')](function(_0x4f57ed){logger[_0xbc17('0xc')](_0xbc17('0x24'),_0x14284e);logger['debug'](_0xbc17('0x24'),_0x14284e,JSON['stringify'](_0x4f57ed));_0x2a027c(_0x4f57ed);})[_0xbc17('0x15')](function(_0x4f01ed){logger[_0xbc17('0x12')](_0xbc17('0x24'),_0x4f01ed['message'],_0x14284e);_0x43118a(_0x42ce2f[_0xbc17('0x12')](0x1f4,_0x4f01ed['message']));});});};
\ No newline at end of file
index 4e621be..37d4dcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefa8=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xefa8,0x76));var _0x8efa=function(_0x5e0baa,_0x14f1e7){_0x5e0baa=_0x5e0baa-0x0;var _0x2c8957=_0xefa8[_0x5e0baa];return _0x2c8957;};'use strict';var multer=require(_0x8efa('0x0'));var util=require(_0x8efa('0x1'));var path=require('path');var timeout=require(_0x8efa('0x2'));var express=require(_0x8efa('0x3'));var router=express[_0x8efa('0x4')]();var fs_extra=require(_0x8efa('0x5'));var auth=require(_0x8efa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8efa('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x8efa('0x8')]('/',auth['isAuthenticated'](),controller[_0x8efa('0x9')]);router[_0x8efa('0x8')](_0x8efa('0xa'),auth['isAuthenticated'](),controller[_0x8efa('0xb')]);router[_0x8efa('0xc')]('/',auth[_0x8efa('0xd')](),controller[_0x8efa('0xe')]);router[_0x8efa('0xf')](_0x8efa('0xa'),auth[_0x8efa('0xd')](),controller[_0x8efa('0x10')]);router[_0x8efa('0x11')](_0x8efa('0xa'),auth[_0x8efa('0xd')](),controller['destroy']);module[_0x8efa('0x12')]=router;
\ No newline at end of file
+var _0x261d=['../../config/environment','./voiceChanSpy.controller','index','/:id','isAuthenticated','show','create','delete','exports','multer','util','connect-timeout','Router','../../components/interaction/service'];(function(_0xdf26c5,_0x11465d){var _0x34d10e=function(_0x4c70de){while(--_0x4c70de){_0xdf26c5['push'](_0xdf26c5['shift']());}};_0x34d10e(++_0x11465d);}(_0x261d,0x19f));var _0xd261=function(_0x53db91,_0x29a9c0){_0x53db91=_0x53db91-0x0;var _0x5ccf61=_0x261d[_0x53db91];return _0x5ccf61;};'use strict';var multer=require(_0xd261('0x0'));var util=require(_0xd261('0x1'));var path=require('path');var timeout=require(_0xd261('0x2'));var express=require('express');var router=express[_0xd261('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd261('0x4'));var config=require(_0xd261('0x5'));var controller=require(_0xd261('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd261('0x7')]);router['get'](_0xd261('0x8'),auth[_0xd261('0x9')](),controller[_0xd261('0xa')]);router['post']('/',auth[_0xd261('0x9')](),controller[_0xd261('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd261('0xc')](_0xd261('0x8'),auth[_0xd261('0x9')](),controller['destroy']);module[_0xd261('0xd')]=router;
\ No newline at end of file
index a505d9a..8c9c2c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x573e=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','options','join'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x573e,0x193));var _0xe573=function(_0x148045,_0x592b68){_0x148045=_0x148045-0x0;var _0x277d39=_0x573e[_0x148045];return _0x277d39;};'use strict';var Sequelize=require(_0xe573('0x0'));module[_0xe573('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xe573('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xe573('0x2')],'set':function(_0x5b58a7){this['setDataValue'](_0xe573('0x3'),_0x5b58a7?_0x5b58a7[_0xe573('0x4')](''):[]);},'get':function(){return this[_0xe573('0x5')](_0xe573('0x3'))?this[_0xe573('0x5')](_0xe573('0x3'))[_0xe573('0x6')](''):[];}},'auth':{'type':Sequelize[_0xe573('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xe573('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe573('0x2')]},'description':{'type':Sequelize[_0xe573('0x2')]}};
\ No newline at end of file
+var _0x07d8=['setDataValue','options','join','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x07d8,0x1f4));var _0x807d=function(_0x35b0bf,_0x216f69){_0x35b0bf=_0x35b0bf-0x0;var _0x3c3329=_0x07d8[_0x35b0bf];return _0x3c3329;};'use strict';var Sequelize=require(_0x807d('0x0'));module[_0x807d('0x1')]={'name':{'type':Sequelize[_0x807d('0x2')]},'prefix':{'type':Sequelize[_0x807d('0x2')],'unique':_0x807d('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x807d('0x2')],'set':function(_0x3737dc){this[_0x807d('0x4')](_0x807d('0x5'),_0x3737dc?_0x3737dc[_0x807d('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x807d('0x5'))?this['getDataValue'](_0x807d('0x5'))[_0x807d('0x7')](''):[];}},'auth':{'type':Sequelize[_0x807d('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x807d('0x2')]},'record':{'type':Sequelize[_0x807d('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fbd56df..bdc6914 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bbb=['json','offset','undefined','limit','count','Content-Range','reject','update','then','get','UserProfileResource','destroy','sendStatus','error','name','send','map','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChanSpies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x132903,_0x5f451a){var _0x11211b=function(_0x3d6b76){while(--_0x3d6b76){_0x132903['push'](_0x132903['shift']());}};_0x11211b(++_0x5f451a);}(_0x2bbb,0x85));var _0xb2bb=function(_0x23fc74,_0x5c3b14){_0x23fc74=_0x23fc74-0x0;var _0x30cd9f=_0x2bbb[_0x23fc74];return _0x30cd9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb2bb('0x0'));var zipdir=require(_0xb2bb('0x1'));var jsonpatch=require(_0xb2bb('0x2'));var rp=require('request-promise');var moment=require(_0xb2bb('0x3'));var BPromise=require(_0xb2bb('0x4'));var Mustache=require(_0xb2bb('0x5'));var util=require(_0xb2bb('0x6'));var path=require(_0xb2bb('0x7'));var sox=require(_0xb2bb('0x8'));var csv=require('to-csv');var ejs=require(_0xb2bb('0x9'));var fs=require('fs');var fs_extra=require(_0xb2bb('0xa'));var _=require('lodash');var squel=require(_0xb2bb('0xb'));var crypto=require(_0xb2bb('0xc'));var jsforce=require(_0xb2bb('0xd'));var deskjs=require(_0xb2bb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb2bb('0xf'));var Papa=require('papaparse');var Redis=require(_0xb2bb('0x10'));var authService=require(_0xb2bb('0x11'));var qs=require(_0xb2bb('0x12'));var as=require(_0xb2bb('0x13'));var hardwareService=require(_0xb2bb('0x14'));var logger=require('../../config/logger')(_0xb2bb('0x15'));var utils=require('../../config/utils');var config=require(_0xb2bb('0x16'));var licenseUtil=require(_0xb2bb('0x17'));var db=require(_0xb2bb('0x18'))['db'];function respondWithStatusCode(_0x43950f,_0x38ea15){_0x38ea15=_0x38ea15||0xcc;return function(_0x14c05e){if(_0x14c05e){return _0x43950f['sendStatus'](_0x38ea15);}return _0x43950f[_0xb2bb('0x19')](_0x38ea15)[_0xb2bb('0x1a')]();};}function respondWithResult(_0x332903,_0x2905e2){_0x2905e2=_0x2905e2||0xc8;return function(_0x50a32e){if(_0x50a32e){return _0x332903[_0xb2bb('0x19')](_0x2905e2)[_0xb2bb('0x1b')](_0x50a32e);}};}function respondWithFilteredResult(_0x3bb017,_0x28b73c){return function(_0x367c6f){if(_0x367c6f){var _0x48d630=typeof _0x28b73c[_0xb2bb('0x1c')]===_0xb2bb('0x1d')&&typeof _0x28b73c[_0xb2bb('0x1e')]===_0xb2bb('0x1d');var _0x2dcb2d=_0x367c6f[_0xb2bb('0x1f')];var _0x35c4de=_0x48d630?0x0:_0x28b73c[_0xb2bb('0x1c')];var _0x8d2033=_0x48d630?_0x367c6f[_0xb2bb('0x1f')]:_0x28b73c[_0xb2bb('0x1c')]+_0x28b73c[_0xb2bb('0x1e')];var _0x5e8d6a;if(_0x8d2033>=_0x2dcb2d){_0x8d2033=_0x2dcb2d;_0x5e8d6a=0xc8;}else{_0x5e8d6a=0xce;}_0x3bb017[_0xb2bb('0x19')](_0x5e8d6a);return _0x3bb017['set'](_0xb2bb('0x20'),_0x35c4de+'-'+_0x8d2033+'/'+_0x2dcb2d)['json'](_0x367c6f);}return null;};}function patchUpdates(_0x3e7028){return function(_0x8f37d9){try{jsonpatch['apply'](_0x8f37d9,_0x3e7028,!![]);}catch(_0x302cd4){return BPromise[_0xb2bb('0x21')](_0x302cd4);}return _0x8f37d9['save']();};}function saveUpdates(_0x5ab483,_0x4a428f){return function(_0x2f1e0f){if(_0x2f1e0f){return _0x2f1e0f[_0xb2bb('0x22')](_0x5ab483)[_0xb2bb('0x23')](function(_0x494344){return _0x494344;});}return null;};}function removeEntity(_0x297d52,_0x2b1f94){return function(_0x250c3f){if(_0x250c3f){return _0x250c3f['destroy']()[_0xb2bb('0x23')](function(){var _0x962b0a=_0x250c3f[_0xb2bb('0x24')]({'plain':!![]});var _0x14aba5='ChanSpies';return db[_0xb2bb('0x25')][_0xb2bb('0x26')]({'where':{'type':_0x14aba5,'resourceId':_0x962b0a['id']}})[_0xb2bb('0x23')](function(){return _0x250c3f;});})['then'](function(){_0x297d52[_0xb2bb('0x19')](0xcc)[_0xb2bb('0x1a')]();});}};}function handleEntityNotFound(_0x400fff,_0x35949b){return function(_0x149ab2){if(!_0x149ab2){_0x400fff[_0xb2bb('0x27')](0x194);}return _0x149ab2;};}function handleError(_0x4a1b3d,_0x279baa){_0x279baa=_0x279baa||0x1f4;return function(_0x48d96f){logger[_0xb2bb('0x28')](_0x48d96f['stack']);if(_0x48d96f[_0xb2bb('0x29')]){delete _0x48d96f[_0xb2bb('0x29')];}_0x4a1b3d['status'](_0x279baa)[_0xb2bb('0x2a')](_0x48d96f);};}exports['index']=function(_0x232f27,_0x115202){var _0x51a013={},_0xef2655={},_0x8cbc9f={'count':0x0,'rows':[]};var _0x214649=_[_0xb2bb('0x2b')](db[_0xb2bb('0x2c')][_0xb2bb('0x2d')],function(_0x289d11){return{'name':_0x289d11[_0xb2bb('0x2e')],'type':_0x289d11[_0xb2bb('0x2f')][_0xb2bb('0x30')]};});_0xef2655[_0xb2bb('0x31')]=_['map'](_0x214649,_0xb2bb('0x29'));_0xef2655[_0xb2bb('0x32')]=_[_0xb2bb('0x33')](_0x232f27[_0xb2bb('0x32')]);_0xef2655[_0xb2bb('0x34')]=_['intersection'](_0xef2655[_0xb2bb('0x31')],_0xef2655[_0xb2bb('0x32')]);_0x51a013[_0xb2bb('0x35')]=_[_0xb2bb('0x36')](_0xef2655[_0xb2bb('0x31')],qs['fields'](_0x232f27['query'][_0xb2bb('0x37')]));_0x51a013[_0xb2bb('0x35')]=_0x51a013['attributes'][_0xb2bb('0x38')]?_0x51a013[_0xb2bb('0x35')]:_0xef2655['model'];if(!_0x232f27[_0xb2bb('0x32')]['hasOwnProperty'](_0xb2bb('0x39'))){_0x51a013[_0xb2bb('0x1e')]=qs['limit'](_0x232f27[_0xb2bb('0x32')][_0xb2bb('0x1e')]);_0x51a013[_0xb2bb('0x1c')]=qs[_0xb2bb('0x1c')](_0x232f27['query'][_0xb2bb('0x1c')]);}_0x51a013[_0xb2bb('0x3a')]=qs[_0xb2bb('0x3b')](_0x232f27[_0xb2bb('0x32')][_0xb2bb('0x3b')]);_0x51a013[_0xb2bb('0x3c')]=qs[_0xb2bb('0x34')](_[_0xb2bb('0x3d')](_0x232f27[_0xb2bb('0x32')],_0xef2655['filters']),_0x214649);if(_0x232f27[_0xb2bb('0x32')][_0xb2bb('0x3e')]){_0x51a013[_0xb2bb('0x3c')]=_[_0xb2bb('0x3f')](_0x51a013[_0xb2bb('0x3c')],{'$or':_[_0xb2bb('0x2b')](_0x214649,function(_0x397589){if(_0x397589[_0xb2bb('0x2f')]!=='VIRTUAL'){var _0x24888c={};_0x24888c[_0x397589['name']]={'$like':'%'+_0x232f27[_0xb2bb('0x32')][_0xb2bb('0x3e')]+'%'};return _0x24888c;}})});}_0x51a013=_[_0xb2bb('0x3f')]({},_0x51a013,_0x232f27[_0xb2bb('0x40')]);var _0x546945={'where':_0x51a013[_0xb2bb('0x3c')]};return db['VoiceChanSpy']['count'](_0x546945)[_0xb2bb('0x23')](function(_0x51c19b){_0x8cbc9f[_0xb2bb('0x1f')]=_0x51c19b;if(_0x232f27['query']['includeAll']){_0x51a013['include']=[{'all':!![]}];}return db[_0xb2bb('0x2c')][_0xb2bb('0x41')](_0x51a013);})[_0xb2bb('0x23')](function(_0x5dab12){_0x8cbc9f['rows']=_0x5dab12;return _0x8cbc9f;})[_0xb2bb('0x23')](respondWithFilteredResult(_0x115202,_0x51a013))[_0xb2bb('0x42')](handleError(_0x115202,null));};exports['show']=function(_0x1f808d,_0xd7b090){var _0x500918={'raw':![],'where':{'id':_0x1f808d[_0xb2bb('0x43')]['id']}},_0x44b65f={};_0x44b65f['model']=_['keys'](db[_0xb2bb('0x2c')][_0xb2bb('0x2d')]);_0x44b65f[_0xb2bb('0x32')]=_[_0xb2bb('0x33')](_0x1f808d['query']);_0x44b65f[_0xb2bb('0x34')]=_[_0xb2bb('0x36')](_0x44b65f[_0xb2bb('0x31')],_0x44b65f[_0xb2bb('0x32')]);_0x500918[_0xb2bb('0x35')]=_[_0xb2bb('0x36')](_0x44b65f['model'],qs[_0xb2bb('0x37')](_0x1f808d['query'][_0xb2bb('0x37')]));_0x500918[_0xb2bb('0x35')]=_0x500918[_0xb2bb('0x35')][_0xb2bb('0x38')]?_0x500918[_0xb2bb('0x35')]:_0x44b65f[_0xb2bb('0x31')];if(_0x1f808d[_0xb2bb('0x32')][_0xb2bb('0x44')]){_0x500918['include']=[{'all':!![]}];}_0x500918=_[_0xb2bb('0x3f')]({},_0x500918,_0x1f808d['options']);return db[_0xb2bb('0x2c')][_0xb2bb('0x45')](_0x500918)[_0xb2bb('0x23')](handleEntityNotFound(_0xd7b090,null))['then'](respondWithResult(_0xd7b090,null))[_0xb2bb('0x42')](handleError(_0xd7b090,null));};exports[_0xb2bb('0x46')]=function(_0x4a3fb2,_0x47ac7d){return db['VoiceChanSpy'][_0xb2bb('0x46')](_0x4a3fb2['body'],{})[_0xb2bb('0x23')](function(_0x2cbeb3){var _0x5f351e=_0x4a3fb2[_0xb2bb('0x47')][_0xb2bb('0x24')]({'plain':!![]});if(!_0x5f351e)throw new Error(_0xb2bb('0x48'));if(_0x5f351e[_0xb2bb('0x49')]===_0xb2bb('0x47')){var _0xb883ef=_0x2cbeb3[_0xb2bb('0x24')]({'plain':!![]});var _0x52d100=_0xb2bb('0x4a');return db[_0xb2bb('0x4b')][_0xb2bb('0x45')]({'where':{'name':_0x52d100,'userProfileId':_0x5f351e[_0xb2bb('0x4c')]},'raw':!![]})['then'](function(_0x444426){if(_0x444426&&_0x444426[_0xb2bb('0x4d')]===0x0){return db['UserProfileResource'][_0xb2bb('0x46')]({'name':_0xb883ef[_0xb2bb('0x29')],'resourceId':_0xb883ef['id'],'type':_0x444426[_0xb2bb('0x29')],'sectionId':_0x444426['id']},{})[_0xb2bb('0x23')](function(){return _0x2cbeb3;});}else{return _0x2cbeb3;}})['catch'](function(_0x38e6df){logger[_0xb2bb('0x28')](_0xb2bb('0x4e'),_0x38e6df);throw _0x38e6df;});}return _0x2cbeb3;})['then'](respondWithResult(_0x47ac7d,0xc9))[_0xb2bb('0x42')](handleError(_0x47ac7d,null));};exports[_0xb2bb('0x22')]=function(_0x48222c,_0x165cee){if(_0x48222c[_0xb2bb('0x4f')]['id']){delete _0x48222c[_0xb2bb('0x4f')]['id'];}return db[_0xb2bb('0x2c')][_0xb2bb('0x45')]({'where':{'id':_0x48222c[_0xb2bb('0x43')]['id']}})[_0xb2bb('0x23')](handleEntityNotFound(_0x165cee,null))[_0xb2bb('0x23')](saveUpdates(_0x48222c[_0xb2bb('0x4f')],null))[_0xb2bb('0x23')](respondWithResult(_0x165cee,null))['catch'](handleError(_0x165cee,null));};exports[_0xb2bb('0x26')]=function(_0x341ee3,_0x231b42){return db['VoiceChanSpy'][_0xb2bb('0x45')]({'where':{'id':_0x341ee3['params']['id']}})[_0xb2bb('0x23')](handleEntityNotFound(_0x231b42,null))['then'](removeEntity(_0x231b42,null))[_0xb2bb('0x42')](handleError(_0x231b42,null));};
\ No newline at end of file
+var _0xec56=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xec56,0x1bd));var _0x6ec5=function(_0x4c6230,_0x5b4e2a){_0x4c6230=_0x4c6230-0x0;var _0x3a0d13=_0xec56[_0x4c6230];return _0x3a0d13;};'use strict';var emlformat=require(_0x6ec5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ec5('0x1'));var rp=require(_0x6ec5('0x2'));var moment=require(_0x6ec5('0x3'));var BPromise=require(_0x6ec5('0x4'));var Mustache=require(_0x6ec5('0x5'));var util=require(_0x6ec5('0x6'));var path=require(_0x6ec5('0x7'));var sox=require(_0x6ec5('0x8'));var csv=require(_0x6ec5('0x9'));var ejs=require(_0x6ec5('0xa'));var fs=require('fs');var fs_extra=require(_0x6ec5('0xb'));var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0x9'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var Redis=require('ioredis');var authService=require(_0x6ec5('0x13'));var qs=require(_0x6ec5('0x14'));var as=require(_0x6ec5('0x15'));var hardwareService=require(_0x6ec5('0x16'));var logger=require(_0x6ec5('0x17'))(_0x6ec5('0x18'));var utils=require(_0x6ec5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6ec5('0x1a'));var db=require(_0x6ec5('0x1b'))['db'];function respondWithStatusCode(_0x2b1f61,_0xb04ab6){_0xb04ab6=_0xb04ab6||0xcc;return function(_0x135aaf){if(_0x135aaf){return _0x2b1f61[_0x6ec5('0x1c')](_0xb04ab6);}return _0x2b1f61[_0x6ec5('0x1d')](_0xb04ab6)[_0x6ec5('0x1e')]();};}function respondWithResult(_0x5166ad,_0x3ed07a){_0x3ed07a=_0x3ed07a||0xc8;return function(_0x4d1510){if(_0x4d1510){return _0x5166ad[_0x6ec5('0x1d')](_0x3ed07a)[_0x6ec5('0x1f')](_0x4d1510);}};}function respondWithFilteredResult(_0x4a4e3c,_0x9fc0e7){return function(_0xdc0b10){if(_0xdc0b10){var _0x4d09fe=typeof _0x9fc0e7[_0x6ec5('0x20')]===_0x6ec5('0x21')&&typeof _0x9fc0e7[_0x6ec5('0x22')]===_0x6ec5('0x21');var _0x23b3e3=_0xdc0b10[_0x6ec5('0x23')];var _0x1dbee9=_0x4d09fe?0x0:_0x9fc0e7[_0x6ec5('0x20')];var _0x2608c0=_0x4d09fe?_0xdc0b10[_0x6ec5('0x23')]:_0x9fc0e7[_0x6ec5('0x20')]+_0x9fc0e7[_0x6ec5('0x22')];var _0x437f0f;if(_0x2608c0>=_0x23b3e3){_0x2608c0=_0x23b3e3;_0x437f0f=0xc8;}else{_0x437f0f=0xce;}_0x4a4e3c[_0x6ec5('0x1d')](_0x437f0f);return _0x4a4e3c[_0x6ec5('0x24')](_0x6ec5('0x25'),_0x1dbee9+'-'+_0x2608c0+'/'+_0x23b3e3)[_0x6ec5('0x1f')](_0xdc0b10);}return null;};}function patchUpdates(_0x4abd5d){return function(_0x272532){try{jsonpatch[_0x6ec5('0x26')](_0x272532,_0x4abd5d,!![]);}catch(_0xd045b){return BPromise[_0x6ec5('0x27')](_0xd045b);}return _0x272532[_0x6ec5('0x28')]();};}function saveUpdates(_0x38a821,_0x18243f){return function(_0x48733b){if(_0x48733b){return _0x48733b[_0x6ec5('0x29')](_0x38a821)[_0x6ec5('0x2a')](function(_0x358d18){return _0x358d18;});}return null;};}function removeEntity(_0x1560c6,_0x57060c){return function(_0x27f631){if(_0x27f631){return _0x27f631[_0x6ec5('0x2b')]()['then'](function(){var _0x2dc0a7=_0x27f631[_0x6ec5('0x2c')]({'plain':!![]});var _0xb4d269='ChanSpies';return db[_0x6ec5('0x2d')][_0x6ec5('0x2b')]({'where':{'type':_0xb4d269,'resourceId':_0x2dc0a7['id']}})[_0x6ec5('0x2a')](function(){return _0x27f631;});})[_0x6ec5('0x2a')](function(){_0x1560c6[_0x6ec5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x171e2a,_0x267a30){return function(_0x4a9860){if(!_0x4a9860){_0x171e2a[_0x6ec5('0x1c')](0x194);}return _0x4a9860;};}function handleError(_0x3f5ee0,_0x5c8c7d){_0x5c8c7d=_0x5c8c7d||0x1f4;return function(_0x3d36cb){logger[_0x6ec5('0x2e')](_0x3d36cb[_0x6ec5('0x2f')]);if(_0x3d36cb[_0x6ec5('0x30')]){delete _0x3d36cb[_0x6ec5('0x30')];}_0x3f5ee0['status'](_0x5c8c7d)[_0x6ec5('0x31')](_0x3d36cb);};}exports[_0x6ec5('0x32')]=function(_0x24aff9,_0x174164){var _0x3e6d33={},_0x22c3d3={},_0x394132={'count':0x0,'rows':[]};var _0x59a6de=_[_0x6ec5('0x33')](db['VoiceChanSpy'][_0x6ec5('0x34')],function(_0x5c6517){return{'name':_0x5c6517[_0x6ec5('0x35')],'type':_0x5c6517[_0x6ec5('0x36')]['key']};});_0x22c3d3['model']=_[_0x6ec5('0x33')](_0x59a6de,_0x6ec5('0x30'));_0x22c3d3['query']=_[_0x6ec5('0x37')](_0x24aff9[_0x6ec5('0x38')]);_0x22c3d3['filters']=_[_0x6ec5('0x39')](_0x22c3d3[_0x6ec5('0x3a')],_0x22c3d3[_0x6ec5('0x38')]);_0x3e6d33[_0x6ec5('0x3b')]=_[_0x6ec5('0x39')](_0x22c3d3[_0x6ec5('0x3a')],qs[_0x6ec5('0x3c')](_0x24aff9[_0x6ec5('0x38')]['fields']));_0x3e6d33[_0x6ec5('0x3b')]=_0x3e6d33['attributes'][_0x6ec5('0x3d')]?_0x3e6d33[_0x6ec5('0x3b')]:_0x22c3d3[_0x6ec5('0x3a')];if(!_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x3e')](_0x6ec5('0x3f'))){_0x3e6d33[_0x6ec5('0x22')]=qs[_0x6ec5('0x22')](_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x22')]);_0x3e6d33[_0x6ec5('0x20')]=qs['offset'](_0x24aff9['query'][_0x6ec5('0x20')]);}_0x3e6d33['order']=qs[_0x6ec5('0x40')](_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x40')]);_0x3e6d33[_0x6ec5('0x41')]=qs[_0x6ec5('0x42')](_[_0x6ec5('0x43')](_0x24aff9[_0x6ec5('0x38')],_0x22c3d3['filters']),_0x59a6de);if(_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x44')]){_0x3e6d33[_0x6ec5('0x41')]=_[_0x6ec5('0x45')](_0x3e6d33[_0x6ec5('0x41')],{'$or':_[_0x6ec5('0x33')](_0x59a6de,function(_0x74e78b){if(_0x74e78b[_0x6ec5('0x36')]!==_0x6ec5('0x46')){var _0x53dcd8={};_0x53dcd8[_0x74e78b[_0x6ec5('0x30')]]={'$like':'%'+_0x24aff9['query'][_0x6ec5('0x44')]+'%'};return _0x53dcd8;}})});}_0x3e6d33=_['merge']({},_0x3e6d33,_0x24aff9[_0x6ec5('0x47')]);var _0x45de3c={'where':_0x3e6d33['where']};return db[_0x6ec5('0x48')][_0x6ec5('0x23')](_0x45de3c)[_0x6ec5('0x2a')](function(_0x48c019){_0x394132[_0x6ec5('0x23')]=_0x48c019;if(_0x24aff9[_0x6ec5('0x38')]['includeAll']){_0x3e6d33[_0x6ec5('0x49')]=[{'all':!![]}];}return db[_0x6ec5('0x48')][_0x6ec5('0x4a')](_0x3e6d33);})[_0x6ec5('0x2a')](function(_0x43d858){_0x394132[_0x6ec5('0x4b')]=_0x43d858;return _0x394132;})[_0x6ec5('0x2a')](respondWithFilteredResult(_0x174164,_0x3e6d33))[_0x6ec5('0x4c')](handleError(_0x174164,null));};exports[_0x6ec5('0x4d')]=function(_0x5a7b9c,_0x96340b){var _0x4ee5f5={'raw':![],'where':{'id':_0x5a7b9c[_0x6ec5('0x4e')]['id']}},_0x17cfed={};_0x17cfed[_0x6ec5('0x3a')]=_[_0x6ec5('0x37')](db['VoiceChanSpy'][_0x6ec5('0x34')]);_0x17cfed[_0x6ec5('0x38')]=_['keys'](_0x5a7b9c[_0x6ec5('0x38')]);_0x17cfed['filters']=_[_0x6ec5('0x39')](_0x17cfed[_0x6ec5('0x3a')],_0x17cfed[_0x6ec5('0x38')]);_0x4ee5f5[_0x6ec5('0x3b')]=_['intersection'](_0x17cfed['model'],qs[_0x6ec5('0x3c')](_0x5a7b9c['query'][_0x6ec5('0x3c')]));_0x4ee5f5[_0x6ec5('0x3b')]=_0x4ee5f5[_0x6ec5('0x3b')][_0x6ec5('0x3d')]?_0x4ee5f5[_0x6ec5('0x3b')]:_0x17cfed['model'];if(_0x5a7b9c['query'][_0x6ec5('0x4f')]){_0x4ee5f5[_0x6ec5('0x49')]=[{'all':!![]}];}_0x4ee5f5=_[_0x6ec5('0x45')]({},_0x4ee5f5,_0x5a7b9c[_0x6ec5('0x47')]);return db[_0x6ec5('0x48')][_0x6ec5('0x50')](_0x4ee5f5)[_0x6ec5('0x2a')](handleEntityNotFound(_0x96340b,null))[_0x6ec5('0x2a')](respondWithResult(_0x96340b,null))[_0x6ec5('0x4c')](handleError(_0x96340b,null));};exports[_0x6ec5('0x51')]=function(_0xd265c,_0x1c5e2f){return db[_0x6ec5('0x48')][_0x6ec5('0x51')](_0xd265c['body'],{})[_0x6ec5('0x2a')](function(_0x51709d){var _0x40b9cc=_0xd265c[_0x6ec5('0x52')]['get']({'plain':!![]});if(!_0x40b9cc)throw new Error(_0x6ec5('0x53'));if(_0x40b9cc[_0x6ec5('0x54')]==='user'){var _0x23a64d=_0x51709d[_0x6ec5('0x2c')]({'plain':!![]});var _0x486552='ChanSpies';return db[_0x6ec5('0x55')]['find']({'where':{'name':_0x486552,'userProfileId':_0x40b9cc['userProfileId']},'raw':!![]})[_0x6ec5('0x2a')](function(_0x101966){if(_0x101966&&_0x101966[_0x6ec5('0x56')]===0x0){return db[_0x6ec5('0x2d')]['create']({'name':_0x23a64d[_0x6ec5('0x30')],'resourceId':_0x23a64d['id'],'type':_0x101966[_0x6ec5('0x30')],'sectionId':_0x101966['id']},{})[_0x6ec5('0x2a')](function(){return _0x51709d;});}else{return _0x51709d;}})[_0x6ec5('0x4c')](function(_0x9bde51){logger[_0x6ec5('0x2e')](_0x6ec5('0x57'),_0x9bde51);throw _0x9bde51;});}return _0x51709d;})[_0x6ec5('0x2a')](respondWithResult(_0x1c5e2f,0xc9))[_0x6ec5('0x4c')](handleError(_0x1c5e2f,null));};exports[_0x6ec5('0x29')]=function(_0x29317f,_0x4370f2){if(_0x29317f[_0x6ec5('0x58')]['id']){delete _0x29317f['body']['id'];}return db[_0x6ec5('0x48')][_0x6ec5('0x50')]({'where':{'id':_0x29317f['params']['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x4370f2,null))[_0x6ec5('0x2a')](saveUpdates(_0x29317f[_0x6ec5('0x58')],null))[_0x6ec5('0x2a')](respondWithResult(_0x4370f2,null))[_0x6ec5('0x4c')](handleError(_0x4370f2,null));};exports['destroy']=function(_0x5f3d3f,_0x282cbc){return db['VoiceChanSpy'][_0x6ec5('0x50')]({'where':{'id':_0x5f3d3f[_0x6ec5('0x4e')]['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x282cbc,null))[_0x6ec5('0x2a')](removeEntity(_0x282cbc,null))[_0x6ec5('0x4c')](handleError(_0x282cbc,null));};
\ No newline at end of file
index 9805ae1..ab8e5c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xade2=['VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','merge','format','chanspy','record','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','then','catch','models','VoiceChanSpy','voice_chanspy','bulkCreate','destroy'];(function(_0x4726ff,_0x5c5c3d){var _0x4274f1=function(_0x9d4b0d){while(--_0x9d4b0d){_0x4726ff['push'](_0x4726ff['shift']());}};_0x4274f1(++_0x5c5c3d);}(_0xade2,0x173));var _0x2ade=function(_0x46e4ce,_0x493d12){_0x46e4ce=_0x46e4ce-0x0;var _0x310e17=_0xade2[_0x46e4ce];return _0x310e17;};'use strict';var _=require(_0x2ade('0x0'));var util=require(_0x2ade('0x1'));var BPromise=require(_0x2ade('0x2'));var attributes=require(_0x2ade('0x3'));var getUserApplications=function(_0xe28c43,_0x20d0f0,_0x5b092c){var _0x47e424=0x1;var _0x5a1098=[];var _0x18e636={'context':_0x20d0f0[_0x2ade('0x4')]||_0x2ade('0x5'),'exten':util['format'](_0x2ade('0x6'),_0xe28c43[_0x2ade('0x7')],_0x5b092c),'type':_0x2ade('0x8'),'isApp':![],'ChanSpyId':_0xe28c43['id'],'UserId':_0x20d0f0['id']};_0x5a1098[_0x2ade('0x9')](_[_0x2ade('0xa')]({'app':'Set','appdata':util[_0x2ade('0xb')]('CDR(type)=%s',_0x2ade('0xc')),'priority':_0x47e424++},_0x18e636));if(_0xe28c43[_0x2ade('0xd')]){_0x5a1098['push'](_[_0x2ade('0xa')]({'app':'MixMonitor','appdata':util[_0x2ade('0xb')](_0x2ade('0xe'),_0xe28c43[_0x2ade('0xf')]),'priority':_0x47e424++},_0x18e636));}if(_0xe28c43['auth']){_0x5a1098['push'](_['merge']({'app':_0x2ade('0x10'),'appdata':_0xe28c43[_0x2ade('0x11')],'priority':_0x47e424++},_0x18e636));}_0x5a1098[_0x2ade('0x9')](_[_0x2ade('0xa')]({'app':_0x2ade('0x12'),'appdata':util['format'](_0x2ade('0x13'),_0x20d0f0[_0x2ade('0x14')],_0xe28c43[_0x2ade('0x15')]?_0xe28c43[_0x2ade('0x15')][_0x2ade('0x16')](''):''),'priority':_0x47e424++},_0x18e636));if(_0xe28c43[_0x2ade('0xd')]){_0x5a1098['push'](_['merge']({'app':_0x2ade('0x17'),'priority':_0x47e424++},_0x18e636));}return _0x5a1098;};var getChanSpyApplications=function(_0x3839c7,_0x2e5403){var _0x2aa766=[];for(var _0x46bfa1=0x0,_0x53d1dc=0x1;_0x46bfa1<_0x2e5403[_0x2ade('0x18')];_0x46bfa1++,_0x53d1dc=0x1){_0x2aa766=_0x2aa766[_0x2ade('0x19')](getUserApplications(_0x3839c7,_0x2e5403[_0x46bfa1],_0x2e5403[_0x46bfa1][_0x2ade('0x1a')]));if(_0x2e5403[_0x46bfa1][_0x2ade('0x1a')]!=_0x2e5403[_0x46bfa1]['name']){_0x2aa766=_0x2aa766[_0x2ade('0x19')](getUserApplications(_0x3839c7,_0x2e5403[_0x46bfa1],_0x2e5403[_0x46bfa1][_0x2ade('0x14')]));}}return _0x2aa766;};var getChanSpyPromise=function(_0x4f06c1,_0x5c1907){return new BPromise(function(_0x1b541e,_0x550574){return _0x4f06c1[_0x2ade('0x1b')]['findAll']({'attributes':['id',_0x2ade('0x14'),_0x2ade('0x1a')],'where':{'role':_0x2ade('0x1c'),'chanspy':!![]},'raw':!![]})[_0x2ade('0x1d')](function(_0x2ef23e){if(_0x2ef23e){return _0x1b541e(getChanSpyApplications(_0x5c1907,_0x2ef23e));}return _0x1b541e([]);})[_0x2ade('0x1e')](function(_0x34fc9d){_0x550574(_0x34fc9d);});});};module['exports']=function(_0x45af8d,_0x4a9408){var _0x420fc2=_0x45af8d[_0x2ade('0x1f')];return _0x45af8d['define'](_0x2ade('0x20'),attributes,{'tableName':_0x2ade('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b6d13,_0x4d0647,_0x1b6adf){return getChanSpyPromise(_0x420fc2,_0x4b6d13)[_0x2ade('0x1d')](function(_0x24e94c){if(_0x24e94c&&_0x24e94c[_0x2ade('0x18')]){return _0x420fc2['VoiceExtension'][_0x2ade('0x22')](_0x24e94c);}})['then'](function(){_0x1b6adf();})[_0x2ade('0x1e')](function(_0x10c1a9){_0x1b6adf(_0x10c1a9);});},'afterUpdate':function(_0x25b929,_0x3c0d70,_0x49fe09){return _0x420fc2['VoiceExtension'][_0x2ade('0x23')]({'where':{'ChanSpyId':_0x25b929['id']}})[_0x2ade('0x1d')](function(){return getChanSpyPromise(_0x420fc2,_0x25b929);})[_0x2ade('0x1d')](function(_0x498af5){if(_0x498af5&&_0x498af5[_0x2ade('0x18')]){return _0x420fc2[_0x2ade('0x24')][_0x2ade('0x22')](_0x498af5);}})[_0x2ade('0x1d')](function(){_0x49fe09();})[_0x2ade('0x1e')](function(_0x5d8817){_0x49fe09(_0x5d8817);});},'afterDestroy':function(_0x5fd392,_0x1fa433,_0x4e6f62){return _0x420fc2[_0x2ade('0x24')]['destroy']({'where':{'ChanSpyId':_0x5fd392['id']}})[_0x2ade('0x1d')](function(){_0x4e6f62();})['catch'](function(_0x27ab1a){_0x4e6f62(_0x27ab1a);});}}});};
\ No newline at end of file
+var _0x9002=['bulkCreate','destroy','bluebird','context','%s%s','prefix','system','push','merge','format','chanspy','record','MixMonitor','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','agent','catch','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension'];(function(_0x111c00,_0x5df487){var _0xb1af07=function(_0x1e82f4){while(--_0x1e82f4){_0x111c00['push'](_0x111c00['shift']());}};_0xb1af07(++_0x5df487);}(_0x9002,0x160));var _0x2900=function(_0x3482e0,_0x5b65bb){_0x3482e0=_0x3482e0-0x0;var _0x4ab6b9=_0x9002[_0x3482e0];return _0x4ab6b9;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x2900('0x0'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x2e582c,_0x114051,_0x69ba85){var _0x18cec2=0x1;var _0x12fce3=[];var _0x4e3b72={'context':_0x114051[_0x2900('0x1')]||'from-sip','exten':util['format'](_0x2900('0x2'),_0x2e582c[_0x2900('0x3')],_0x69ba85),'type':_0x2900('0x4'),'isApp':![],'ChanSpyId':_0x2e582c['id'],'UserId':_0x114051['id']};_0x12fce3[_0x2900('0x5')](_[_0x2900('0x6')]({'app':'Set','appdata':util[_0x2900('0x7')]('CDR(type)=%s',_0x2900('0x8')),'priority':_0x18cec2++},_0x4e3b72));if(_0x2e582c[_0x2900('0x9')]){_0x12fce3[_0x2900('0x5')](_[_0x2900('0x6')]({'app':_0x2900('0xa'),'appdata':util[_0x2900('0x7')]('${UNIQUEID}.%s,a',_0x2e582c[_0x2900('0xb')]),'priority':_0x18cec2++},_0x4e3b72));}if(_0x2e582c[_0x2900('0xc')]){_0x12fce3[_0x2900('0x5')](_[_0x2900('0x6')]({'app':'Authenticate','appdata':_0x2e582c[_0x2900('0xd')],'priority':_0x18cec2++},_0x4e3b72));}_0x12fce3[_0x2900('0x5')](_[_0x2900('0x6')]({'app':_0x2900('0xe'),'appdata':util[_0x2900('0x7')](_0x2900('0xf'),_0x114051[_0x2900('0x10')],_0x2e582c[_0x2900('0x11')]?_0x2e582c[_0x2900('0x11')][_0x2900('0x12')](''):''),'priority':_0x18cec2++},_0x4e3b72));if(_0x2e582c['record']){_0x12fce3[_0x2900('0x5')](_[_0x2900('0x6')]({'app':_0x2900('0x13'),'priority':_0x18cec2++},_0x4e3b72));}return _0x12fce3;};var getChanSpyApplications=function(_0x4250d9,_0x598fe7){var _0xcaaa5f=[];for(var _0x4eaec9=0x0,_0x5313e9=0x1;_0x4eaec9<_0x598fe7[_0x2900('0x14')];_0x4eaec9++,_0x5313e9=0x1){_0xcaaa5f=_0xcaaa5f[_0x2900('0x15')](getUserApplications(_0x4250d9,_0x598fe7[_0x4eaec9],_0x598fe7[_0x4eaec9][_0x2900('0x16')]));if(_0x598fe7[_0x4eaec9]['internal']!=_0x598fe7[_0x4eaec9][_0x2900('0x10')]){_0xcaaa5f=_0xcaaa5f[_0x2900('0x15')](getUserApplications(_0x4250d9,_0x598fe7[_0x4eaec9],_0x598fe7[_0x4eaec9][_0x2900('0x10')]));}}return _0xcaaa5f;};var getChanSpyPromise=function(_0x37c0a1,_0x410ea7){return new BPromise(function(_0x250af0,_0x3d2350){return _0x37c0a1[_0x2900('0x17')]['findAll']({'attributes':['id',_0x2900('0x10'),_0x2900('0x16')],'where':{'role':_0x2900('0x18'),'chanspy':!![]},'raw':!![]})['then'](function(_0x5a400e){if(_0x5a400e){return _0x250af0(getChanSpyApplications(_0x410ea7,_0x5a400e));}return _0x250af0([]);})[_0x2900('0x19')](function(_0x3b5e4b){_0x3d2350(_0x3b5e4b);});});};module[_0x2900('0x1a')]=function(_0x2aaf40,_0x54f43b){var _0x1e51f2=_0x2aaf40[_0x2900('0x1b')];return _0x2aaf40[_0x2900('0x1c')](_0x2900('0x1d'),attributes,{'tableName':_0x2900('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x8cb4f6,_0x534bff,_0x53b6be){return getChanSpyPromise(_0x1e51f2,_0x8cb4f6)[_0x2900('0x1f')](function(_0x1536fa){if(_0x1536fa&&_0x1536fa[_0x2900('0x14')]){return _0x1e51f2[_0x2900('0x20')][_0x2900('0x21')](_0x1536fa);}})['then'](function(){_0x53b6be();})[_0x2900('0x19')](function(_0x3f2c0f){_0x53b6be(_0x3f2c0f);});},'afterUpdate':function(_0x37e26d,_0x5d6251,_0x17ff9c){return _0x1e51f2[_0x2900('0x20')][_0x2900('0x22')]({'where':{'ChanSpyId':_0x37e26d['id']}})[_0x2900('0x1f')](function(){return getChanSpyPromise(_0x1e51f2,_0x37e26d);})[_0x2900('0x1f')](function(_0x4347af){if(_0x4347af&&_0x4347af[_0x2900('0x14')]){return _0x1e51f2['VoiceExtension'][_0x2900('0x21')](_0x4347af);}})[_0x2900('0x1f')](function(){_0x17ff9c();})[_0x2900('0x19')](function(_0x41e37f){_0x17ff9c(_0x41e37f);});},'afterDestroy':function(_0x102049,_0xb545d4,_0x500c56){return _0x1e51f2[_0x2900('0x20')][_0x2900('0x22')]({'where':{'ChanSpyId':_0x102049['id']}})[_0x2900('0x1f')](function(){_0x500c56();})[_0x2900('0x19')](function(_0x19c979){_0x500c56(_0x19c979);});}}});};
\ No newline at end of file
index fc0f0ae..feb6fa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eec=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','VoiceChanSpy,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x3eec,0x1e9));var _0xc3ee=function(_0x55af6b,_0x391a1d){_0x55af6b=_0x55af6b-0x0;var _0x18a2bd=_0x3eec[_0x55af6b];return _0x18a2bd;};'use strict';var _=require(_0xc3ee('0x0'));var util=require(_0xc3ee('0x1'));var moment=require(_0xc3ee('0x2'));var BPromise=require(_0xc3ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc3ee('0x4'));var db=require(_0xc3ee('0x5'))['db'];var utils=require(_0xc3ee('0x6'));var logger=require(_0xc3ee('0x7'))(_0xc3ee('0x8'));var config=require(_0xc3ee('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc3ee('0xa')][_0xc3ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xea4318,_0x2cc750,_0x356374){return new BPromise(function(_0x3d74c0,_0xd88f6){return client[_0xc3ee('0xc')](_0xea4318,_0x356374)[_0xc3ee('0xd')](function(_0x23e9c0){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x2cc750,_0xc3ee('0xe'));logger[_0xc3ee('0xf')](_0xc3ee('0x10'),_0x2cc750,_0xc3ee('0xe'),JSON['stringify'](_0x23e9c0));if(_0x23e9c0[_0xc3ee('0x11')]){if(_0x23e9c0['error'][_0xc3ee('0x12')]===0x1f4){logger[_0xc3ee('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0xd88f6(_0x23e9c0['error'][_0xc3ee('0x13')]);}logger['error'](_0xc3ee('0x14'),_0x2cc750,_0x23e9c0['error'][_0xc3ee('0x13')]);return _0x3d74c0(_0x23e9c0[_0xc3ee('0x11')][_0xc3ee('0x13')]);}else{logger[_0xc3ee('0x15')](_0xc3ee('0x14'),_0x2cc750,_0xc3ee('0xe'));_0x3d74c0(_0x23e9c0[_0xc3ee('0x16')]['message']);}})[_0xc3ee('0x17')](function(_0x4eea89){logger[_0xc3ee('0x11')](_0xc3ee('0x14'),_0x2cc750,_0x4eea89);_0xd88f6(_0x4eea89);});});}
\ No newline at end of file
+var _0xa5fa=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x2622ac,_0x44f576){var _0x281996=function(_0x3d60f5){while(--_0x3d60f5){_0x2622ac['push'](_0x2622ac['shift']());}};_0x281996(++_0x44f576);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x51a182,_0x5639a7){_0x51a182=_0x51a182-0x0;var _0x46aa3e=_0xa5fa[_0x51a182];return _0x46aa3e;};'use strict';var _=require('lodash');var util=require(_0xaa5f('0x0'));var moment=require(_0xaa5f('0x1'));var BPromise=require(_0xaa5f('0x2'));var rs=require(_0xaa5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5f('0x4'))['db'];var utils=require(_0xaa5f('0x5'));var logger=require('../../config/logger')(_0xaa5f('0x6'));var config=require(_0xaa5f('0x7'));var jayson=require(_0xaa5f('0x8'));var client=jayson[_0xaa5f('0x9')][_0xaa5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13b606,_0x302138,_0xc326df){return new BPromise(function(_0x74f64f,_0x3f550e){return client[_0xaa5f('0xb')](_0x13b606,_0xc326df)['then'](function(_0x1674c2){logger[_0xaa5f('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x302138,'request\x20sent',JSON[_0xaa5f('0xe')](_0x1674c2));if(_0x1674c2['error']){if(_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x10')]===0x1f4){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')]['message']);return _0x3f550e(_0x1674c2[_0xaa5f('0xf')]['message']);}logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1674c2[_0xaa5f('0xf')][_0xaa5f('0x12')]);return _0x74f64f(_0x1674c2[_0xaa5f('0xf')]['message']);}else{logger['info'](_0xaa5f('0x11'),_0x302138,_0xaa5f('0x13'));_0x74f64f(_0x1674c2[_0xaa5f('0x14')][_0xaa5f('0x12')]);}})[_0xaa5f('0x15')](function(_0x1fa36a){logger[_0xaa5f('0xf')](_0xaa5f('0x11'),_0x302138,_0x1fa36a);_0x3f550e(_0x1fa36a);});});}
\ No newline at end of file
index 25c00be..2c41543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x756d=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create','update'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x756d,0x80));var _0xd756=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x756d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd756('0x0'));var util=require(_0xd756('0x1'));var path=require(_0xd756('0x2'));var timeout=require('connect-timeout');var express=require(_0xd756('0x3'));var router=express[_0xd756('0x4')]();var fs_extra=require(_0xd756('0x5'));var auth=require(_0xd756('0x6'));var interaction=require(_0xd756('0x7'));var config=require(_0xd756('0x8'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd756('0x9')]);router['get'](_0xd756('0xa'),auth[_0xd756('0xb')](),controller[_0xd756('0xc')]);router[_0xd756('0xd')]('/',auth[_0xd756('0xb')](),controller[_0xd756('0xe')]);router['put']('/:id',auth[_0xd756('0xb')](),controller[_0xd756('0xf')]);router[_0xd756('0x10')]('/:id',auth[_0xd756('0xb')](),controller[_0xd756('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x0071=['util','path','express','Router','fs-extra','../../components/auth/service','./voiceContext.controller','get','isAuthenticated','index','/:id','delete','exports','multer'];(function(_0x3cb260,_0x17977d){var _0x4426e8=function(_0x1eaeeb){while(--_0x1eaeeb){_0x3cb260['push'](_0x3cb260['shift']());}};_0x4426e8(++_0x17977d);}(_0x0071,0x1bf));var _0x1007=function(_0x1b4d51,_0x30f986){_0x1b4d51=_0x1b4d51-0x0;var _0x58e3e1=_0x0071[_0x1b4d51];return _0x58e3e1;};'use strict';var multer=require(_0x1007('0x0'));var util=require(_0x1007('0x1'));var path=require(_0x1007('0x2'));var timeout=require('connect-timeout');var express=require(_0x1007('0x3'));var router=express[_0x1007('0x4')]();var fs_extra=require(_0x1007('0x5'));var auth=require(_0x1007('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1007('0x7'));router[_0x1007('0x8')]('/',auth[_0x1007('0x9')](),controller[_0x1007('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x1007('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1007('0xc')]('/:id',auth[_0x1007('0x9')](),controller['destroy']);module[_0x1007('0xd')]=router;
\ No newline at end of file
index 9044d35..ba7a1e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3319=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x342553,_0x1df1a1){var _0x19e6a0=function(_0x11e6e0){while(--_0x11e6e0){_0x342553['push'](_0x342553['shift']());}};_0x19e6a0(++_0x1df1a1);}(_0x3319,0x1e7));var _0x9331=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3319[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x9331('0x0'));module[_0x9331('0x1')]={'name':{'type':Sequelize[_0x9331('0x2')],'unique':_0x9331('0x3')},'description':{'type':Sequelize[_0x9331('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9331('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd0e3=['exports','STRING','name','sequelize'];(function(_0x1f58cb,_0x47a4b9){var _0x1a1bde=function(_0x564d35){while(--_0x564d35){_0x1f58cb['push'](_0x1f58cb['shift']());}};_0x1a1bde(++_0x47a4b9);}(_0xd0e3,0x14b));var _0x3d0e=function(_0x5c56e1,_0x4a4ac3){_0x5c56e1=_0x5c56e1-0x0;var _0xdfc8c9=_0xd0e3[_0x5c56e1];return _0xdfc8c9;};'use strict';var Sequelize=require(_0x3d0e('0x0'));module[_0x3d0e('0x1')]={'name':{'type':Sequelize[_0x3d0e('0x2')],'unique':_0x3d0e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index 681833d..112608c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8296=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','info','catch','end','status','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','find','create','body','readFileSync','join','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','root','utf8','rimraf'];(function(_0x3bb2e7,_0x32c33a){var _0x2f7207=function(_0x561856){while(--_0x561856){_0x3bb2e7['push'](_0x3bb2e7['shift']());}};_0x2f7207(++_0x32c33a);}(_0x8296,0x140));var _0x6829=function(_0xf11c6e,_0x4a4132){_0xf11c6e=_0xf11c6e-0x0;var _0x1b4e3d=_0x8296[_0xf11c6e];return _0x1b4e3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6829('0x0'));var zipdir=require(_0x6829('0x1'));var jsonpatch=require(_0x6829('0x2'));var rp=require(_0x6829('0x3'));var moment=require(_0x6829('0x4'));var BPromise=require(_0x6829('0x5'));var Mustache=require(_0x6829('0x6'));var util=require(_0x6829('0x7'));var path=require('path');var sox=require(_0x6829('0x8'));var csv=require(_0x6829('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6829('0xa'));var _=require(_0x6829('0xb'));var squel=require(_0x6829('0xc'));var crypto=require(_0x6829('0xd'));var jsforce=require(_0x6829('0xe'));var deskjs=require(_0x6829('0xf'));var toCsv=require(_0x6829('0x9'));var querystring=require(_0x6829('0x10'));var Papa=require(_0x6829('0x11'));var Redis=require('ioredis');var authService=require(_0x6829('0x12'));var qs=require(_0x6829('0x13'));var as=require(_0x6829('0x14'));var hardwareService=require(_0x6829('0x15'));var logger=require(_0x6829('0x16'))(_0x6829('0x17'));var utils=require(_0x6829('0x18'));var config=require(_0x6829('0x19'));var licenseUtil=require(_0x6829('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6829('0x1b'));var client=jayson[_0x6829('0x1c')][_0x6829('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x599671,_0x32c466,_0x2d3577,_0x70fc0c){return new BPromise(function(_0x2da5d7,_0x1132c4){var _0x164205=_0x70fc0c||client;return _0x164205[_0x6829('0x1e')](_0x599671,_0x2d3577)[_0x6829('0x1f')](function(_0x47ca0b){logger['info']('VoiceContext,\x20%s,\x20%s',_0x32c466,_0x6829('0x20'));logger[_0x6829('0x21')](_0x6829('0x22'),_0x32c466,'request\x20sent',JSON[_0x6829('0x23')](_0x47ca0b));if(_0x47ca0b[_0x6829('0x24')]){if(_0x47ca0b[_0x6829('0x24')][_0x6829('0x25')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x32c466,_0x47ca0b[_0x6829('0x24')][_0x6829('0x26')]);return _0x1132c4(_0x47ca0b['error'][_0x6829('0x26')]);}logger[_0x6829('0x24')](_0x6829('0x27'),_0x32c466,_0x47ca0b[_0x6829('0x24')][_0x6829('0x26')]);return _0x2da5d7(_0x47ca0b[_0x6829('0x24')]['message']);}else{logger[_0x6829('0x28')](_0x6829('0x27'),_0x32c466,'request\x20sent');_0x2da5d7(_0x47ca0b['result'][_0x6829('0x26')]);}})[_0x6829('0x29')](function(_0x4cd02f){logger[_0x6829('0x24')](_0x6829('0x27'),_0x32c466,_0x4cd02f);_0x1132c4(_0x4cd02f);});});}function respondWithStatusCode(_0x25962b,_0x568240){_0x568240=_0x568240||0xcc;return function(_0x5bc36c){if(_0x5bc36c){return _0x25962b['sendStatus'](_0x568240);}return _0x25962b['status'](_0x568240)[_0x6829('0x2a')]();};}function respondWithResult(_0x4f9a1f,_0x283f19){_0x283f19=_0x283f19||0xc8;return function(_0x30f8c6){if(_0x30f8c6){return _0x4f9a1f[_0x6829('0x2b')](_0x283f19)[_0x6829('0x2c')](_0x30f8c6);}};}function respondWithFilteredResult(_0x5a7471,_0x1c30ba){return function(_0x2422d1){if(_0x2422d1){var _0x1197d1=typeof _0x1c30ba['offset']==='undefined'&&typeof _0x1c30ba[_0x6829('0x2d')]===_0x6829('0x2e');var _0x395db7=_0x2422d1['count'];var _0x3a2c21=_0x1197d1?0x0:_0x1c30ba[_0x6829('0x2f')];var _0x3249ab=_0x1197d1?_0x2422d1[_0x6829('0x30')]:_0x1c30ba['offset']+_0x1c30ba[_0x6829('0x2d')];var _0x2c5670;if(_0x3249ab>=_0x395db7){_0x3249ab=_0x395db7;_0x2c5670=0xc8;}else{_0x2c5670=0xce;}_0x5a7471[_0x6829('0x2b')](_0x2c5670);return _0x5a7471[_0x6829('0x31')](_0x6829('0x32'),_0x3a2c21+'-'+_0x3249ab+'/'+_0x395db7)['json'](_0x2422d1);}return null;};}function patchUpdates(_0x534122){return function(_0x233f46){try{jsonpatch['apply'](_0x233f46,_0x534122,!![]);}catch(_0x44da03){return BPromise[_0x6829('0x33')](_0x44da03);}return _0x233f46[_0x6829('0x34')]();};}function saveUpdates(_0x2e9ef5,_0x20ae64){return function(_0xfb5392){if(_0xfb5392){return _0xfb5392[_0x6829('0x35')](_0x2e9ef5)[_0x6829('0x1f')](function(_0x555962){return _0x555962;});}return null;};}function removeEntity(_0x18d9b5,_0x31af37){return function(_0x4947cc){if(_0x4947cc){return _0x4947cc[_0x6829('0x36')]()[_0x6829('0x1f')](function(){var _0x54d0df=_0x4947cc['get']({'plain':!![]});var _0x23738c=_0x6829('0x37');return db[_0x6829('0x38')][_0x6829('0x36')]({'where':{'type':_0x23738c,'resourceId':_0x54d0df['id']}})['then'](function(){return _0x4947cc;});})[_0x6829('0x1f')](function(){_0x18d9b5[_0x6829('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x247dfa,_0x119d50){return function(_0x488c55){if(!_0x488c55){_0x247dfa['sendStatus'](0x194);}return _0x488c55;};}function handleError(_0x599ed5,_0x485314){_0x485314=_0x485314||0x1f4;return function(_0x312dd0){logger['error'](_0x312dd0[_0x6829('0x39')]);if(_0x312dd0[_0x6829('0x3a')]){delete _0x312dd0[_0x6829('0x3a')];}_0x599ed5['status'](_0x485314)['send'](_0x312dd0);};}exports[_0x6829('0x3b')]=function(_0x441c84,_0x42efec){var _0x2c5944={},_0x124482={},_0x2d836a={'count':0x0,'rows':[]};var _0x43c04e=_[_0x6829('0x3c')](db[_0x6829('0x3d')][_0x6829('0x3e')],function(_0x27a0a9){return{'name':_0x27a0a9[_0x6829('0x3f')],'type':_0x27a0a9[_0x6829('0x40')]['key']};});_0x124482[_0x6829('0x41')]=_[_0x6829('0x3c')](_0x43c04e,_0x6829('0x3a'));_0x124482[_0x6829('0x42')]=_[_0x6829('0x43')](_0x441c84[_0x6829('0x42')]);_0x124482[_0x6829('0x44')]=_['intersection'](_0x124482[_0x6829('0x41')],_0x124482[_0x6829('0x42')]);_0x2c5944[_0x6829('0x45')]=_[_0x6829('0x46')](_0x124482[_0x6829('0x41')],qs[_0x6829('0x47')](_0x441c84['query'][_0x6829('0x47')]));_0x2c5944[_0x6829('0x45')]=_0x2c5944[_0x6829('0x45')][_0x6829('0x48')]?_0x2c5944['attributes']:_0x124482[_0x6829('0x41')];if(!_0x441c84['query'][_0x6829('0x49')](_0x6829('0x4a'))){_0x2c5944['limit']=qs['limit'](_0x441c84['query']['limit']);_0x2c5944['offset']=qs[_0x6829('0x2f')](_0x441c84[_0x6829('0x42')][_0x6829('0x2f')]);}_0x2c5944[_0x6829('0x4b')]=qs['sort'](_0x441c84[_0x6829('0x42')][_0x6829('0x4c')]);_0x2c5944['where']=qs[_0x6829('0x44')](_[_0x6829('0x4d')](_0x441c84[_0x6829('0x42')],_0x124482[_0x6829('0x44')]),_0x43c04e);if(_0x441c84['query'][_0x6829('0x4e')]){_0x2c5944['where']=_[_0x6829('0x4f')](_0x2c5944[_0x6829('0x50')],{'$or':_['map'](_0x43c04e,function(_0x293c2f){if(_0x293c2f['type']!=='VIRTUAL'){var _0xd58a31={};_0xd58a31[_0x293c2f[_0x6829('0x3a')]]={'$like':'%'+_0x441c84[_0x6829('0x42')][_0x6829('0x4e')]+'%'};return _0xd58a31;}})});}_0x2c5944=_[_0x6829('0x4f')]({},_0x2c5944,_0x441c84[_0x6829('0x51')]);var _0x116b17={'where':_0x2c5944[_0x6829('0x50')]};return db[_0x6829('0x3d')][_0x6829('0x30')](_0x116b17)['then'](function(_0xed93cb){_0x2d836a[_0x6829('0x30')]=_0xed93cb;if(_0x441c84['query'][_0x6829('0x52')]){_0x2c5944[_0x6829('0x53')]=[{'all':!![]}];}return db['VoiceContext'][_0x6829('0x54')](_0x2c5944);})[_0x6829('0x1f')](function(_0x24f4dc){_0x2d836a[_0x6829('0x55')]=_0x24f4dc;return _0x2d836a;})[_0x6829('0x1f')](respondWithFilteredResult(_0x42efec,_0x2c5944))[_0x6829('0x29')](handleError(_0x42efec,null));};exports[_0x6829('0x56')]=function(_0x592845,_0x256368){var _0x57a0d9={'raw':![],'where':{'id':_0x592845['params']['id']}},_0x17b4c5={};_0x17b4c5['model']=_[_0x6829('0x43')](db[_0x6829('0x3d')]['rawAttributes']);_0x17b4c5[_0x6829('0x42')]=_[_0x6829('0x43')](_0x592845[_0x6829('0x42')]);_0x17b4c5[_0x6829('0x44')]=_[_0x6829('0x46')](_0x17b4c5[_0x6829('0x41')],_0x17b4c5['query']);_0x57a0d9[_0x6829('0x45')]=_[_0x6829('0x46')](_0x17b4c5[_0x6829('0x41')],qs[_0x6829('0x47')](_0x592845[_0x6829('0x42')][_0x6829('0x47')]));_0x57a0d9[_0x6829('0x45')]=_0x57a0d9[_0x6829('0x45')]['length']?_0x57a0d9[_0x6829('0x45')]:_0x17b4c5[_0x6829('0x41')];if(_0x592845[_0x6829('0x42')][_0x6829('0x52')]){_0x57a0d9[_0x6829('0x53')]=[{'all':!![]}];}_0x57a0d9=_[_0x6829('0x4f')]({},_0x57a0d9,_0x592845[_0x6829('0x51')]);return db[_0x6829('0x3d')][_0x6829('0x57')](_0x57a0d9)[_0x6829('0x1f')](handleEntityNotFound(_0x256368,null))[_0x6829('0x1f')](respondWithResult(_0x256368,null))[_0x6829('0x29')](handleError(_0x256368,null));};exports[_0x6829('0x58')]=function(_0x324362,_0x2d62ae,_0x3322a6){var _0x106aca;return db[_0x6829('0x3d')][_0x6829('0x58')](_0x324362[_0x6829('0x59')],{'raw':!![]})[_0x6829('0x1f')](function(_0x10e5d2){_0x106aca=_0x10e5d2;return db[_0x6829('0x3d')]['findAll']({'raw':!![]});})['then'](function(_0x1b06e2){var _0x57c12a=fs[_0x6829('0x5a')](path[_0x6829('0x5b')](config['root'],_0x6829('0x5c')),'utf8');var _0x3b16fe=ejs[_0x6829('0x5d')](_0x57c12a,{'contexts':_0x1b06e2||[]});fs[_0x6829('0x5e')](_0x6829('0x5f'),_0x3b16fe);})[_0x6829('0x1f')](function(){return respondWithRpcPromise(_0x6829('0x60'),_0x6829('0x58'),{'module':_0x6829('0x61')});})[_0x6829('0x1f')](function(){var _0x412522=_0x324362['user'][_0x6829('0x62')]({'plain':!![]});if(!_0x412522)throw new Error(_0x6829('0x63'));if(_0x412522['role']===_0x6829('0x64')){var _0xc090fd=_0x106aca['get']({'plain':!![]});return db[_0x6829('0x65')][_0x6829('0x57')]({'where':{'name':_0x6829('0x37'),'userProfileId':_0x412522[_0x6829('0x66')]},'raw':!![]})['then'](function(_0x4c618b){if(_0x4c618b&&_0x4c618b['autoAssociation']===0x0){return db[_0x6829('0x38')][_0x6829('0x58')]({'name':_0xc090fd[_0x6829('0x3a')],'resourceId':_0xc090fd['id'],'type':_0x4c618b[_0x6829('0x3a')],'sectionId':_0x4c618b['id']},{})['then'](function(){return _0x106aca;});}else{return _0x106aca;}})[_0x6829('0x29')](function(_0x3426ef){logger[_0x6829('0x24')](_0x6829('0x67'),_0x3426ef);throw _0x3426ef;});}return _0x106aca;})[_0x6829('0x1f')](respondWithResult(_0x2d62ae,0xc9))['catch'](handleError(_0x2d62ae,null));};exports[_0x6829('0x35')]=function(_0x50723a,_0x1bf485,_0xfa2c48){var _0xec606f;return db[_0x6829('0x3d')][_0x6829('0x57')]({'where':{'id':_0x50723a[_0x6829('0x68')]['id']}})[_0x6829('0x1f')](handleEntityNotFound(_0x1bf485,null))[_0x6829('0x1f')](saveUpdates(_0x50723a[_0x6829('0x59')],null))[_0x6829('0x1f')](function(_0x181550){if(_0x181550){_0xec606f=_0x181550;return db[_0x6829('0x3d')][_0x6829('0x54')]({'raw':!![]});}})[_0x6829('0x1f')](function(_0x4b7939){var _0x7581d4=fs[_0x6829('0x5a')](path[_0x6829('0x5b')](config['root'],_0x6829('0x5c')),'utf8');var _0x2410a4=ejs[_0x6829('0x5d')](_0x7581d4,{'contexts':_0x4b7939||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2410a4);})[_0x6829('0x1f')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x6829('0x61')});})[_0x6829('0x1f')](function(){return _0xec606f;})['then'](respondWithResult(_0x1bf485,null))[_0x6829('0x29')](handleError(_0x1bf485,null));};exports[_0x6829('0x36')]=function(_0xae1323,_0x124512,_0x487949){var _0x323b63;return db[_0x6829('0x3d')]['find']({'where':{'id':_0xae1323[_0x6829('0x68')]['id']}})['then'](handleEntityNotFound(_0x124512,null))[_0x6829('0x1f')](removeEntity(_0x124512,null))[_0x6829('0x1f')](function(){return db['VoiceContext'][_0x6829('0x54')]({'raw':!![]});})['then'](function(_0x3fc2f4){var _0x35efcd=fs[_0x6829('0x5a')](path['join'](config[_0x6829('0x69')],_0x6829('0x5c')),_0x6829('0x6a'));var _0x6e8be0=ejs[_0x6829('0x5d')](_0x35efcd,{'contexts':_0x3fc2f4});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x6e8be0);return respondWithRpcPromise(_0x6829('0x60'),'destroy',{'module':_0x6829('0x61')});})[_0x6829('0x29')](handleError(_0x124512,null));};
\ No newline at end of file
+var _0x79da=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','sendStatus','status','end','json','offset','undefined','limit','apply','reject','save','update','destroy','get','Contexts','name','VoiceContext','rawAttributes','fieldName','key','map','query','filters','model','attributes','fields','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','findAll','catch','show','params','keys','intersection','includeAll','include','find','create','body','root','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','readFileSync','join','server/files/templates/context.ejs','render','writeFileSync','eml-format'];(function(_0x2deefb,_0xfb2fd2){var _0x35dc94=function(_0x285d59){while(--_0x285d59){_0x2deefb['push'](_0x2deefb['shift']());}};_0x35dc94(++_0xfb2fd2);}(_0x79da,0x1ee));var _0xa79d=function(_0x221800,_0x4654be){_0x221800=_0x221800-0x0;var _0xc9f38d=_0x79da[_0x221800];return _0xc9f38d;};'use strict';var emlformat=require(_0xa79d('0x0'));var rimraf=require(_0xa79d('0x1'));var zipdir=require(_0xa79d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa79d('0x3'));var BPromise=require(_0xa79d('0x4'));var Mustache=require(_0xa79d('0x5'));var util=require(_0xa79d('0x6'));var path=require(_0xa79d('0x7'));var sox=require(_0xa79d('0x8'));var csv=require(_0xa79d('0x9'));var ejs=require(_0xa79d('0xa'));var fs=require('fs');var fs_extra=require(_0xa79d('0xb'));var _=require(_0xa79d('0xc'));var squel=require(_0xa79d('0xd'));var crypto=require(_0xa79d('0xe'));var jsforce=require(_0xa79d('0xf'));var deskjs=require(_0xa79d('0x10'));var toCsv=require(_0xa79d('0x9'));var querystring=require(_0xa79d('0x11'));var Papa=require(_0xa79d('0x12'));var Redis=require('ioredis');var authService=require(_0xa79d('0x13'));var qs=require(_0xa79d('0x14'));var as=require(_0xa79d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa79d('0x16'))(_0xa79d('0x17'));var utils=require(_0xa79d('0x18'));var config=require(_0xa79d('0x19'));var licenseUtil=require(_0xa79d('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa79d('0x1b'));var client=jayson[_0xa79d('0x1c')][_0xa79d('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5b37da,_0x2bead5,_0x165041,_0x43eaff){return new BPromise(function(_0x194f89,_0x58bd75){var _0x211328=_0x43eaff||client;return _0x211328['request'](_0x5b37da,_0x165041)[_0xa79d('0x1e')](function(_0x54ff08){logger['info'](_0xa79d('0x1f'),_0x2bead5,_0xa79d('0x20'));logger[_0xa79d('0x21')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x2bead5,'request\x20sent',JSON[_0xa79d('0x22')](_0x54ff08));if(_0x54ff08[_0xa79d('0x23')]){if(_0x54ff08[_0xa79d('0x23')][_0xa79d('0x24')]===0x1f4){logger[_0xa79d('0x23')](_0xa79d('0x1f'),_0x2bead5,_0x54ff08['error'][_0xa79d('0x25')]);return _0x58bd75(_0x54ff08[_0xa79d('0x23')]['message']);}logger[_0xa79d('0x23')](_0xa79d('0x1f'),_0x2bead5,_0x54ff08[_0xa79d('0x23')]['message']);return _0x194f89(_0x54ff08[_0xa79d('0x23')]['message']);}else{logger[_0xa79d('0x26')](_0xa79d('0x1f'),_0x2bead5,'request\x20sent');_0x194f89(_0x54ff08['result'][_0xa79d('0x25')]);}})['catch'](function(_0x2cf133){logger[_0xa79d('0x23')](_0xa79d('0x1f'),_0x2bead5,_0x2cf133);_0x58bd75(_0x2cf133);});});}function respondWithStatusCode(_0x238588,_0x22e3f1){_0x22e3f1=_0x22e3f1||0xcc;return function(_0x101627){if(_0x101627){return _0x238588[_0xa79d('0x27')](_0x22e3f1);}return _0x238588[_0xa79d('0x28')](_0x22e3f1)[_0xa79d('0x29')]();};}function respondWithResult(_0x222953,_0x565726){_0x565726=_0x565726||0xc8;return function(_0xa4051f){if(_0xa4051f){return _0x222953['status'](_0x565726)[_0xa79d('0x2a')](_0xa4051f);}};}function respondWithFilteredResult(_0x1a100d,_0x42da5b){return function(_0x5f0456){if(_0x5f0456){var _0x47f9e7=typeof _0x42da5b[_0xa79d('0x2b')]===_0xa79d('0x2c')&&typeof _0x42da5b[_0xa79d('0x2d')]==='undefined';var _0x571f44=_0x5f0456['count'];var _0x32e95a=_0x47f9e7?0x0:_0x42da5b[_0xa79d('0x2b')];var _0x241f00=_0x47f9e7?_0x5f0456['count']:_0x42da5b['offset']+_0x42da5b[_0xa79d('0x2d')];var _0x47a690;if(_0x241f00>=_0x571f44){_0x241f00=_0x571f44;_0x47a690=0xc8;}else{_0x47a690=0xce;}_0x1a100d[_0xa79d('0x28')](_0x47a690);return _0x1a100d['set']('Content-Range',_0x32e95a+'-'+_0x241f00+'/'+_0x571f44)[_0xa79d('0x2a')](_0x5f0456);}return null;};}function patchUpdates(_0x4b8785){return function(_0x39703b){try{jsonpatch[_0xa79d('0x2e')](_0x39703b,_0x4b8785,!![]);}catch(_0x3179a0){return BPromise[_0xa79d('0x2f')](_0x3179a0);}return _0x39703b[_0xa79d('0x30')]();};}function saveUpdates(_0x5c356b,_0x556d32){return function(_0xd1a26c){if(_0xd1a26c){return _0xd1a26c[_0xa79d('0x31')](_0x5c356b)[_0xa79d('0x1e')](function(_0x5c278f){return _0x5c278f;});}return null;};}function removeEntity(_0x56eddd,_0x42a504){return function(_0x514307){if(_0x514307){return _0x514307[_0xa79d('0x32')]()[_0xa79d('0x1e')](function(){var _0x4061ad=_0x514307[_0xa79d('0x33')]({'plain':!![]});var _0x992f9e=_0xa79d('0x34');return db['UserProfileResource']['destroy']({'where':{'type':_0x992f9e,'resourceId':_0x4061ad['id']}})['then'](function(){return _0x514307;});})[_0xa79d('0x1e')](function(){_0x56eddd[_0xa79d('0x28')](0xcc)[_0xa79d('0x29')]();});}};}function handleEntityNotFound(_0x32cd15,_0xcee083){return function(_0x5d06db){if(!_0x5d06db){_0x32cd15[_0xa79d('0x27')](0x194);}return _0x5d06db;};}function handleError(_0x22c2cb,_0x3ea04e){_0x3ea04e=_0x3ea04e||0x1f4;return function(_0x5c0be0){logger[_0xa79d('0x23')](_0x5c0be0['stack']);if(_0x5c0be0['name']){delete _0x5c0be0[_0xa79d('0x35')];}_0x22c2cb[_0xa79d('0x28')](_0x3ea04e)['send'](_0x5c0be0);};}exports['index']=function(_0xf267ed,_0x4c0159){var _0x2e7527={},_0x203fcf={},_0x3a0af8={'count':0x0,'rows':[]};var _0x277769=_['map'](db[_0xa79d('0x36')][_0xa79d('0x37')],function(_0x4de781){return{'name':_0x4de781[_0xa79d('0x38')],'type':_0x4de781['type'][_0xa79d('0x39')]};});_0x203fcf['model']=_[_0xa79d('0x3a')](_0x277769,_0xa79d('0x35'));_0x203fcf[_0xa79d('0x3b')]=_['keys'](_0xf267ed['query']);_0x203fcf[_0xa79d('0x3c')]=_['intersection'](_0x203fcf[_0xa79d('0x3d')],_0x203fcf['query']);_0x2e7527[_0xa79d('0x3e')]=_['intersection'](_0x203fcf[_0xa79d('0x3d')],qs[_0xa79d('0x3f')](_0xf267ed[_0xa79d('0x3b')][_0xa79d('0x3f')]));_0x2e7527[_0xa79d('0x3e')]=_0x2e7527[_0xa79d('0x3e')]['length']?_0x2e7527[_0xa79d('0x3e')]:_0x203fcf[_0xa79d('0x3d')];if(!_0xf267ed[_0xa79d('0x3b')]['hasOwnProperty'](_0xa79d('0x40'))){_0x2e7527['limit']=qs[_0xa79d('0x2d')](_0xf267ed['query']['limit']);_0x2e7527['offset']=qs[_0xa79d('0x2b')](_0xf267ed[_0xa79d('0x3b')][_0xa79d('0x2b')]);}_0x2e7527[_0xa79d('0x41')]=qs['sort'](_0xf267ed['query'][_0xa79d('0x42')]);_0x2e7527[_0xa79d('0x43')]=qs['filters'](_['pick'](_0xf267ed[_0xa79d('0x3b')],_0x203fcf[_0xa79d('0x3c')]),_0x277769);if(_0xf267ed[_0xa79d('0x3b')][_0xa79d('0x44')]){_0x2e7527[_0xa79d('0x43')]=_['merge'](_0x2e7527['where'],{'$or':_[_0xa79d('0x3a')](_0x277769,function(_0x34a156){if(_0x34a156[_0xa79d('0x45')]!==_0xa79d('0x46')){var _0x1f4c24={};_0x1f4c24[_0x34a156['name']]={'$like':'%'+_0xf267ed[_0xa79d('0x3b')][_0xa79d('0x44')]+'%'};return _0x1f4c24;}})});}_0x2e7527=_[_0xa79d('0x47')]({},_0x2e7527,_0xf267ed[_0xa79d('0x48')]);var _0x239eb5={'where':_0x2e7527[_0xa79d('0x43')]};return db[_0xa79d('0x36')]['count'](_0x239eb5)['then'](function(_0xe7726e){_0x3a0af8['count']=_0xe7726e;if(_0xf267ed['query']['includeAll']){_0x2e7527['include']=[{'all':!![]}];}return db['VoiceContext'][_0xa79d('0x49')](_0x2e7527);})[_0xa79d('0x1e')](function(_0x2c046c){_0x3a0af8['rows']=_0x2c046c;return _0x3a0af8;})['then'](respondWithFilteredResult(_0x4c0159,_0x2e7527))[_0xa79d('0x4a')](handleError(_0x4c0159,null));};exports[_0xa79d('0x4b')]=function(_0x70e615,_0x49aa32){var _0x115abf={'raw':![],'where':{'id':_0x70e615[_0xa79d('0x4c')]['id']}},_0x217664={};_0x217664[_0xa79d('0x3d')]=_[_0xa79d('0x4d')](db[_0xa79d('0x36')][_0xa79d('0x37')]);_0x217664[_0xa79d('0x3b')]=_[_0xa79d('0x4d')](_0x70e615['query']);_0x217664['filters']=_['intersection'](_0x217664[_0xa79d('0x3d')],_0x217664[_0xa79d('0x3b')]);_0x115abf['attributes']=_[_0xa79d('0x4e')](_0x217664[_0xa79d('0x3d')],qs[_0xa79d('0x3f')](_0x70e615[_0xa79d('0x3b')][_0xa79d('0x3f')]));_0x115abf[_0xa79d('0x3e')]=_0x115abf[_0xa79d('0x3e')]['length']?_0x115abf[_0xa79d('0x3e')]:_0x217664[_0xa79d('0x3d')];if(_0x70e615[_0xa79d('0x3b')][_0xa79d('0x4f')]){_0x115abf[_0xa79d('0x50')]=[{'all':!![]}];}_0x115abf=_[_0xa79d('0x47')]({},_0x115abf,_0x70e615[_0xa79d('0x48')]);return db[_0xa79d('0x36')][_0xa79d('0x51')](_0x115abf)['then'](handleEntityNotFound(_0x49aa32,null))[_0xa79d('0x1e')](respondWithResult(_0x49aa32,null))[_0xa79d('0x4a')](handleError(_0x49aa32,null));};exports[_0xa79d('0x52')]=function(_0x41212d,_0x1415f7,_0x3e827b){var _0x1d18c0;return db[_0xa79d('0x36')][_0xa79d('0x52')](_0x41212d[_0xa79d('0x53')],{'raw':!![]})[_0xa79d('0x1e')](function(_0x1fd1f9){_0x1d18c0=_0x1fd1f9;return db[_0xa79d('0x36')][_0xa79d('0x49')]({'raw':!![]});})['then'](function(_0x20efcb){var _0x4fd7d5=fs['readFileSync'](path['join'](config[_0xa79d('0x54')],'server/files/templates/context.ejs'),_0xa79d('0x55'));var _0x407ed8=ejs['render'](_0x4fd7d5,{'contexts':_0x20efcb||[]});fs['writeFileSync'](_0xa79d('0x56'),_0x407ed8);})[_0xa79d('0x1e')](function(){return respondWithRpcPromise(_0xa79d('0x57'),'create',{'module':_0xa79d('0x58')});})[_0xa79d('0x1e')](function(){var _0x1f9867=_0x41212d[_0xa79d('0x59')][_0xa79d('0x33')]({'plain':!![]});if(!_0x1f9867)throw new Error(_0xa79d('0x5a'));if(_0x1f9867['role']==='user'){var _0x22eaff=_0x1d18c0[_0xa79d('0x33')]({'plain':!![]});return db[_0xa79d('0x5b')][_0xa79d('0x51')]({'where':{'name':_0xa79d('0x34'),'userProfileId':_0x1f9867['userProfileId']},'raw':!![]})[_0xa79d('0x1e')](function(_0x237c14){if(_0x237c14&&_0x237c14[_0xa79d('0x5c')]===0x0){return db[_0xa79d('0x5d')][_0xa79d('0x52')]({'name':_0x22eaff['name'],'resourceId':_0x22eaff['id'],'type':_0x237c14[_0xa79d('0x35')],'sectionId':_0x237c14['id']},{})[_0xa79d('0x1e')](function(){return _0x1d18c0;});}else{return _0x1d18c0;}})[_0xa79d('0x4a')](function(_0x4f5244){logger[_0xa79d('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f5244);throw _0x4f5244;});}return _0x1d18c0;})['then'](respondWithResult(_0x1415f7,0xc9))[_0xa79d('0x4a')](handleError(_0x1415f7,null));};exports[_0xa79d('0x31')]=function(_0x49bea8,_0x1ceee3,_0x4597ed){var _0x86d3c7;return db[_0xa79d('0x36')][_0xa79d('0x51')]({'where':{'id':_0x49bea8[_0xa79d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ceee3,null))[_0xa79d('0x1e')](saveUpdates(_0x49bea8[_0xa79d('0x53')],null))['then'](function(_0x537068){if(_0x537068){_0x86d3c7=_0x537068;return db[_0xa79d('0x36')][_0xa79d('0x49')]({'raw':!![]});}})[_0xa79d('0x1e')](function(_0x5a4483){var _0x4fdf23=fs[_0xa79d('0x5e')](path[_0xa79d('0x5f')](config[_0xa79d('0x54')],_0xa79d('0x60')),_0xa79d('0x55'));var _0x3b6187=ejs[_0xa79d('0x61')](_0x4fdf23,{'contexts':_0x5a4483||[]});fs[_0xa79d('0x62')](_0xa79d('0x56'),_0x3b6187);})[_0xa79d('0x1e')](function(){return respondWithRpcPromise(_0xa79d('0x57'),_0xa79d('0x31'),{'module':_0xa79d('0x58')});})[_0xa79d('0x1e')](function(){return _0x86d3c7;})[_0xa79d('0x1e')](respondWithResult(_0x1ceee3,null))[_0xa79d('0x4a')](handleError(_0x1ceee3,null));};exports[_0xa79d('0x32')]=function(_0x545799,_0x2e38d0,_0x1b1158){var _0x6c0a33;return db['VoiceContext']['find']({'where':{'id':_0x545799[_0xa79d('0x4c')]['id']}})[_0xa79d('0x1e')](handleEntityNotFound(_0x2e38d0,null))[_0xa79d('0x1e')](removeEntity(_0x2e38d0,null))[_0xa79d('0x1e')](function(){return db[_0xa79d('0x36')][_0xa79d('0x49')]({'raw':!![]});})[_0xa79d('0x1e')](function(_0x1f77cf){var _0x431a2b=fs[_0xa79d('0x5e')](path[_0xa79d('0x5f')](config[_0xa79d('0x54')],'server/files/templates/context.ejs'),_0xa79d('0x55'));var _0x4373d8=ejs[_0xa79d('0x61')](_0x431a2b,{'contexts':_0x1f77cf});fs[_0xa79d('0x62')](_0xa79d('0x56'),_0x4373d8);return respondWithRpcPromise(_0xa79d('0x57'),'destroy',{'module':_0xa79d('0x58')});})[_0xa79d('0x4a')](handleError(_0x2e38d0,null));};
\ No newline at end of file
index 82196ec..8291ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd91c=['define','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x543a4e,_0x544f2e){var _0x27a3a9=function(_0x5aac67){while(--_0x5aac67){_0x543a4e['push'](_0x543a4e['shift']());}};_0x27a3a9(++_0x544f2e);}(_0xd91c,0x17b));var _0xcd91=function(_0x24a105,_0x5c3246){_0x24a105=_0x24a105-0x0;var _0x497c26=_0xd91c[_0x24a105];return _0x497c26;};'use strict';var _=require(_0xcd91('0x0'));var util=require(_0xcd91('0x1'));var logger=require(_0xcd91('0x2'))(_0xcd91('0x3'));var moment=require('moment');var BPromise=require(_0xcd91('0x4'));var rp=require(_0xcd91('0x5'));var fs=require('fs');var path=require(_0xcd91('0x6'));var rimraf=require(_0xcd91('0x7'));var config=require(_0xcd91('0x8'));var attributes=require(_0xcd91('0x9'));module[_0xcd91('0xa')]=function(_0x41d25e,_0x3be965){return _0x41d25e[_0xcd91('0xb')]('VoiceContext',attributes,{'tableName':_0xcd91('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c38=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','util','../../config/logger','api'];(function(_0x418ce4,_0xf342d5){var _0x1ec3cd=function(_0x203db1){while(--_0x203db1){_0x418ce4['push'](_0x418ce4['shift']());}};_0x1ec3cd(++_0xf342d5);}(_0x1c38,0x72));var _0x81c3=function(_0x5b312a,_0x4dc09b){_0x5b312a=_0x5b312a-0x0;var _0x448b0b=_0x1c38[_0x5b312a];return _0x448b0b;};'use strict';var _=require('lodash');var util=require(_0x81c3('0x0'));var logger=require(_0x81c3('0x1'))(_0x81c3('0x2'));var moment=require(_0x81c3('0x3'));var BPromise=require(_0x81c3('0x4'));var rp=require(_0x81c3('0x5'));var fs=require('fs');var path=require(_0x81c3('0x6'));var rimraf=require(_0x81c3('0x7'));var config=require(_0x81c3('0x8'));var attributes=require(_0x81c3('0x9'));module['exports']=function(_0x36df38,_0x270fe3){return _0x36df38[_0x81c3('0xa')](_0x81c3('0xb'),attributes,{'tableName':_0x81c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3169f59..2bece53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a86=['then','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4384df,_0x51b065){var _0x690d2e=function(_0xd4736a){while(--_0xd4736a){_0x4384df['push'](_0x4384df['shift']());}};_0x690d2e(++_0x51b065);}(_0x9a86,0x1ed));var _0x69a8=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x9a86[_0x408e38];return _0x426b0e;};'use strict';var _=require(_0x69a8('0x0'));var util=require(_0x69a8('0x1'));var moment=require('moment');var BPromise=require(_0x69a8('0x2'));var rs=require(_0x69a8('0x3'));var fs=require('fs');var Redis=require(_0x69a8('0x4'));var db=require(_0x69a8('0x5'))['db'];var utils=require(_0x69a8('0x6'));var logger=require(_0x69a8('0x7'))(_0x69a8('0x8'));var config=require(_0x69a8('0x9'));var jayson=require(_0x69a8('0xa'));var client=jayson[_0x69a8('0xb')][_0x69a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47592b,_0x40d196,_0x308ef9){return new BPromise(function(_0x1909fc,_0x1c826b){return client['request'](_0x47592b,_0x308ef9)[_0x69a8('0xd')](function(_0xaf3ed6){logger['info'](_0x69a8('0xe'),_0x40d196,_0x69a8('0xf'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x40d196,_0x69a8('0xf'),JSON[_0x69a8('0x10')](_0xaf3ed6));if(_0xaf3ed6[_0x69a8('0x11')]){if(_0xaf3ed6[_0x69a8('0x11')]['code']===0x1f4){logger['error'](_0x69a8('0xe'),_0x40d196,_0xaf3ed6['error'][_0x69a8('0x12')]);return _0x1c826b(_0xaf3ed6[_0x69a8('0x11')][_0x69a8('0x12')]);}logger[_0x69a8('0x11')](_0x69a8('0xe'),_0x40d196,_0xaf3ed6['error'][_0x69a8('0x12')]);return _0x1909fc(_0xaf3ed6['error'][_0x69a8('0x12')]);}else{logger[_0x69a8('0x13')]('VoiceContext,\x20%s,\x20%s',_0x40d196,_0x69a8('0xf'));_0x1909fc(_0xaf3ed6[_0x69a8('0x14')][_0x69a8('0x12')]);}})[_0x69a8('0x15')](function(_0x1d3ebf){logger[_0x69a8('0x11')](_0x69a8('0xe'),_0x40d196,_0x1d3ebf);_0x1c826b(_0x1d3ebf);});});}
\ No newline at end of file
+var _0xf485=['rpc','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x41bd78,_0x9798b6){var _0x555a78=function(_0x5c3c50){while(--_0x5c3c50){_0x41bd78['push'](_0x41bd78['shift']());}};_0x555a78(++_0x9798b6);}(_0xf485,0x1af));var _0x5f48=function(_0x56f147,_0x3b83a9){_0x56f147=_0x56f147-0x0;var _0x444eb9=_0xf485[_0x56f147];return _0x444eb9;};'use strict';var _=require(_0x5f48('0x0'));var util=require('util');var moment=require(_0x5f48('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f48('0x2'));var fs=require('fs');var Redis=require(_0x5f48('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f48('0x4'));var logger=require(_0x5f48('0x5'))(_0x5f48('0x6'));var config=require('../../config/environment');var jayson=require(_0x5f48('0x7'));var client=jayson[_0x5f48('0x8')][_0x5f48('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427713,_0x2013b2,_0x475a1a){return new BPromise(function(_0x1c33dd,_0x3ea948){return client[_0x5f48('0xa')](_0x427713,_0x475a1a)['then'](function(_0x1cfc7f){logger[_0x5f48('0xb')](_0x5f48('0xc'),_0x2013b2,_0x5f48('0xd'));logger[_0x5f48('0xe')](_0x5f48('0xf'),_0x2013b2,_0x5f48('0xd'),JSON['stringify'](_0x1cfc7f));if(_0x1cfc7f[_0x5f48('0x10')]){if(_0x1cfc7f[_0x5f48('0x10')]['code']===0x1f4){logger[_0x5f48('0x10')](_0x5f48('0xc'),_0x2013b2,_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);return _0x3ea948(_0x1cfc7f[_0x5f48('0x10')]['message']);}logger['error'](_0x5f48('0xc'),_0x2013b2,_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);return _0x1c33dd(_0x1cfc7f[_0x5f48('0x10')][_0x5f48('0x11')]);}else{logger[_0x5f48('0xb')](_0x5f48('0xc'),_0x2013b2,_0x5f48('0xd'));_0x1c33dd(_0x1cfc7f['result'][_0x5f48('0x11')]);}})[_0x5f48('0x12')](function(_0x29adc2){logger[_0x5f48('0x10')](_0x5f48('0xc'),_0x2013b2,_0x29adc2);_0x3ea948(_0x29adc2);});});}
\ No newline at end of file
index b21167a..9c5a320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba40=['create','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','post'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xba40,0x7b));var _0x0ba4=function(_0x4606be,_0x55649e){_0x4606be=_0x4606be-0x0;var _0x22fec4=_0xba40[_0x4606be];return _0x22fec4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ba4('0x0'));var timeout=require(_0x0ba4('0x1'));var express=require('express');var router=express[_0x0ba4('0x2')]();var fs_extra=require(_0x0ba4('0x3'));var auth=require(_0x0ba4('0x4'));var interaction=require(_0x0ba4('0x5'));var config=require(_0x0ba4('0x6'));var controller=require(_0x0ba4('0x7'));router[_0x0ba4('0x8')]('/',auth[_0x0ba4('0x9')](),controller['index']);router[_0x0ba4('0x8')](_0x0ba4('0xa'),auth[_0x0ba4('0x9')](),controller['describe']);router[_0x0ba4('0x8')](_0x0ba4('0xb'),auth[_0x0ba4('0x9')](),controller['show']);router[_0x0ba4('0xc')]('/',auth[_0x0ba4('0x9')](),controller[_0x0ba4('0xd')]);router['put'](_0x0ba4('0xb'),auth['isAuthenticated'](),controller[_0x0ba4('0xe')]);router[_0x0ba4('0xf')](_0x0ba4('0xb'),auth[_0x0ba4('0x9')](),controller[_0x0ba4('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x05fd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/:id','post','put','update','multer','util','connect-timeout','fs-extra'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x05fd,0x173));var _0xd05f=function(_0x985317,_0x2b0f1a){_0x985317=_0x985317-0x0;var _0x5aaf8d=_0x05fd[_0x985317];return _0x5aaf8d;};'use strict';var multer=require(_0xd05f('0x0'));var util=require(_0xd05f('0x1'));var path=require('path');var timeout=require(_0xd05f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd05f('0x3'));var auth=require(_0xd05f('0x4'));var interaction=require(_0xd05f('0x5'));var config=require(_0xd05f('0x6'));var controller=require(_0xd05f('0x7'));router[_0xd05f('0x8')]('/',auth[_0xd05f('0x9')](),controller[_0xd05f('0xa')]);router[_0xd05f('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xd05f('0x8')](_0xd05f('0xb'),auth[_0xd05f('0x9')](),controller['show']);router[_0xd05f('0xc')]('/',auth[_0xd05f('0x9')](),controller['create']);router[_0xd05f('0xd')]('/:id',auth[_0xd05f('0x9')](),controller[_0xd05f('0xe')]);router['delete'](_0xd05f('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index c13c8d8..31a5bf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x41393a,_0xb93e63){var _0x9d51cd=function(_0x378b37){while(--_0x378b37){_0x41393a['push'](_0x41393a['shift']());}};_0x9d51cd(++_0xb93e63);}(_0xe5b3,0x133));var _0x3e5b=function(_0x33c0b0,_0x412ecc){_0x33c0b0=_0x33c0b0-0x0;var _0x30296b=_0xe5b3[_0x33c0b0];return _0x30296b;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xd6d6=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x1ff275,_0x12b011){var _0x156912=function(_0x47bf8b){while(--_0x47bf8b){_0x1ff275['push'](_0x1ff275['shift']());}};_0x156912(++_0x12b011);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x17a8b0,_0x4a2e8d){_0x17a8b0=_0x17a8b0-0x0;var _0x1358ee=_0xd6d6[_0x17a8b0];return _0x1358ee;};'use strict';var Sequelize=require(_0x6d6d('0x0'));module[_0x6d6d('0x1')]={'privilege':{'type':Sequelize[_0x6d6d('0x2')]},'channel':{'type':Sequelize[_0x6d6d('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'calleridnum':{'type':Sequelize[_0x6d6d('0x2')]},'calleridname':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'connectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'language':{'type':Sequelize[_0x6d6d('0x2')]},'accountcode':{'type':Sequelize[_0x6d6d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x6d6d('0x2')]},'priority':{'type':Sequelize[_0x6d6d('0x3')]},'uniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'linkedid':{'type':Sequelize[_0x6d6d('0x2')]},'destchannel':{'type':Sequelize[_0x6d6d('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d6d('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6d6d('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x6d6d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d6d('0x2')]},'destlanguage':{'type':Sequelize[_0x6d6d('0x2')]},'destaccountcode':{'type':Sequelize[_0x6d6d('0x2')]},'destcontext':{'type':Sequelize[_0x6d6d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d6d('0x3')]},'destuniqueid':{'type':Sequelize[_0x6d6d('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x6d6d('0x2')]},'starttime':{'type':Sequelize[_0x6d6d('0x4')]},'answertime':{'type':Sequelize[_0x6d6d('0x4')]},'endtime':{'type':Sequelize[_0x6d6d('0x4')]},'lastevent':{'type':Sequelize[_0x6d6d('0x2')],'comment':_0x6d6d('0x5')},'routeId':{'type':Sequelize[_0x6d6d('0x3')]},'duration':{'type':Sequelize[_0x6d6d('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x6d6d('0x3')]}};
\ No newline at end of file
index 284f71c..6e8c6dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x891b=['includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','length'];(function(_0x2443aa,_0xf16068){var _0x52af88=function(_0x5ac633){while(--_0x5ac633){_0x2443aa['push'](_0x2443aa['shift']());}};_0x52af88(++_0xf16068);}(_0x891b,0x1c2));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xb891('0x0'));var rimraf=require(_0xb891('0x1'));var zipdir=require(_0xb891('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb891('0x3'));var moment=require(_0xb891('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb891('0x5'));var util=require('util');var path=require(_0xb891('0x6'));var sox=require(_0xb891('0x7'));var csv=require(_0xb891('0x8'));var ejs=require(_0xb891('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb891('0xa'));var crypto=require(_0xb891('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb891('0x8'));var querystring=require('querystring');var Papa=require(_0xb891('0xc'));var Redis=require(_0xb891('0xd'));var authService=require(_0xb891('0xe'));var qs=require(_0xb891('0xf'));var as=require(_0xb891('0x10'));var hardwareService=require(_0xb891('0x11'));var logger=require(_0xb891('0x12'))(_0xb891('0x13'));var utils=require('../../config/utils');var config=require(_0xb891('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb891('0x15'))['db'];function respondWithStatusCode(_0x5817fa,_0x389335){_0x389335=_0x389335||0xcc;return function(_0x525fd6){if(_0x525fd6){return _0x5817fa['sendStatus'](_0x389335);}return _0x5817fa[_0xb891('0x16')](_0x389335)[_0xb891('0x17')]();};}function respondWithResult(_0x535c94,_0x5f079d){_0x5f079d=_0x5f079d||0xc8;return function(_0x32e8bf){if(_0x32e8bf){return _0x535c94[_0xb891('0x16')](_0x5f079d)[_0xb891('0x18')](_0x32e8bf);}};}function respondWithFilteredResult(_0x3344f2,_0x298716){return function(_0x2da5c3){if(_0x2da5c3){var _0x17a69e=typeof _0x298716['offset']===_0xb891('0x19')&&typeof _0x298716[_0xb891('0x1a')]===_0xb891('0x19');var _0x444110=_0x2da5c3[_0xb891('0x1b')];var _0x416d70=_0x17a69e?0x0:_0x298716[_0xb891('0x1c')];var _0x320fde=_0x17a69e?_0x2da5c3['count']:_0x298716[_0xb891('0x1c')]+_0x298716[_0xb891('0x1a')];var _0x441e58;if(_0x320fde>=_0x444110){_0x320fde=_0x444110;_0x441e58=0xc8;}else{_0x441e58=0xce;}_0x3344f2[_0xb891('0x16')](_0x441e58);return _0x3344f2['set'](_0xb891('0x1d'),_0x416d70+'-'+_0x320fde+'/'+_0x444110)[_0xb891('0x18')](_0x2da5c3);}return null;};}function patchUpdates(_0x5996a4){return function(_0x6a7cbe){try{jsonpatch[_0xb891('0x1e')](_0x6a7cbe,_0x5996a4,!![]);}catch(_0x3f29c6){return BPromise['reject'](_0x3f29c6);}return _0x6a7cbe[_0xb891('0x1f')]();};}function saveUpdates(_0x4b3010,_0x4a9800){return function(_0x171a82){if(_0x171a82){return _0x171a82[_0xb891('0x20')](_0x4b3010)[_0xb891('0x21')](function(_0x18798c){return _0x18798c;});}return null;};}function removeEntity(_0x34ab19,_0x3e553c){return function(_0x34ab17){if(_0x34ab17){return _0x34ab17['destroy']()['then'](function(){_0x34ab19[_0xb891('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca6cc,_0x120390){return function(_0x5d01){if(!_0x5d01){_0x2ca6cc[_0xb891('0x22')](0x194);}return _0x5d01;};}function handleError(_0x3d5aa0,_0x539373){_0x539373=_0x539373||0x1f4;return function(_0x5daf32){logger[_0xb891('0x23')](_0x5daf32[_0xb891('0x24')]);if(_0x5daf32[_0xb891('0x25')]){delete _0x5daf32['name'];}_0x3d5aa0[_0xb891('0x16')](_0x539373)[_0xb891('0x26')](_0x5daf32);};}exports['index']=function(_0x3282a9,_0x17b9a4){var _0x53046f={},_0x11737b={},_0x3577bb={'count':0x0,'rows':[]};var _0x3976b6=_[_0xb891('0x27')](db[_0xb891('0x28')][_0xb891('0x29')],function(_0x5122aa){return{'name':_0x5122aa[_0xb891('0x2a')],'type':_0x5122aa[_0xb891('0x2b')][_0xb891('0x2c')]};});_0x11737b[_0xb891('0x2d')]=_[_0xb891('0x27')](_0x3976b6,_0xb891('0x25'));_0x11737b[_0xb891('0x2e')]=_[_0xb891('0x2f')](_0x3282a9[_0xb891('0x2e')]);_0x11737b['filters']=_[_0xb891('0x30')](_0x11737b[_0xb891('0x2d')],_0x11737b[_0xb891('0x2e')]);_0x53046f['attributes']=_[_0xb891('0x30')](_0x11737b[_0xb891('0x2d')],qs[_0xb891('0x31')](_0x3282a9['query'][_0xb891('0x31')]));_0x53046f[_0xb891('0x32')]=_0x53046f[_0xb891('0x32')]['length']?_0x53046f[_0xb891('0x32')]:_0x11737b[_0xb891('0x2d')];if(!_0x3282a9[_0xb891('0x2e')]['hasOwnProperty'](_0xb891('0x33'))){_0x53046f[_0xb891('0x1a')]=qs['limit'](_0x3282a9[_0xb891('0x2e')][_0xb891('0x1a')]);_0x53046f['offset']=qs[_0xb891('0x1c')](_0x3282a9[_0xb891('0x2e')]['offset']);}_0x53046f[_0xb891('0x34')]=qs[_0xb891('0x35')](_0x3282a9[_0xb891('0x2e')][_0xb891('0x35')]);_0x53046f[_0xb891('0x36')]=qs[_0xb891('0x37')](_[_0xb891('0x38')](_0x3282a9['query'],_0x11737b[_0xb891('0x37')]),_0x3976b6);if(_0x3282a9[_0xb891('0x2e')]['filter']){_0x53046f[_0xb891('0x36')]=_[_0xb891('0x39')](_0x53046f[_0xb891('0x36')],{'$or':_[_0xb891('0x27')](_0x3976b6,function(_0x115146){if(_0x115146[_0xb891('0x2b')]!==_0xb891('0x3a')){var _0x59c500={};_0x59c500[_0x115146['name']]={'$like':'%'+_0x3282a9['query'][_0xb891('0x3b')]+'%'};return _0x59c500;}})});}_0x53046f=_[_0xb891('0x39')]({},_0x53046f,_0x3282a9[_0xb891('0x3c')]);var _0x216928={'where':_0x53046f['where']};return db[_0xb891('0x28')]['count'](_0x216928)[_0xb891('0x21')](function(_0xdffc3a){_0x3577bb[_0xb891('0x1b')]=_0xdffc3a;if(_0x3282a9[_0xb891('0x2e')]['includeAll']){_0x53046f[_0xb891('0x3d')]=[{'all':!![]}];}return db[_0xb891('0x28')][_0xb891('0x3e')](_0x53046f);})[_0xb891('0x21')](function(_0x5c9e5e){_0x3577bb[_0xb891('0x3f')]=_0x5c9e5e;return _0x3577bb;})[_0xb891('0x21')](respondWithFilteredResult(_0x17b9a4,_0x53046f))[_0xb891('0x40')](handleError(_0x17b9a4,null));};exports[_0xb891('0x41')]=function(_0x1ac4f9,_0x5e73ac){var _0x2b5836={'raw':!![],'where':{'id':_0x1ac4f9[_0xb891('0x42')]['id']}},_0xa172bb={};_0xa172bb['model']=_['keys'](db['VoiceDialReport'][_0xb891('0x29')]);_0xa172bb['query']=_[_0xb891('0x2f')](_0x1ac4f9['query']);_0xa172bb[_0xb891('0x37')]=_[_0xb891('0x30')](_0xa172bb[_0xb891('0x2d')],_0xa172bb[_0xb891('0x2e')]);_0x2b5836[_0xb891('0x32')]=_[_0xb891('0x30')](_0xa172bb[_0xb891('0x2d')],qs['fields'](_0x1ac4f9[_0xb891('0x2e')]['fields']));_0x2b5836['attributes']=_0x2b5836[_0xb891('0x32')][_0xb891('0x43')]?_0x2b5836[_0xb891('0x32')]:_0xa172bb[_0xb891('0x2d')];if(_0x1ac4f9[_0xb891('0x2e')][_0xb891('0x44')]){_0x2b5836[_0xb891('0x3d')]=[{'all':!![]}];}_0x2b5836=_[_0xb891('0x39')]({},_0x2b5836,_0x1ac4f9['options']);return db['VoiceDialReport'][_0xb891('0x45')](_0x2b5836)[_0xb891('0x21')](handleEntityNotFound(_0x5e73ac,null))[_0xb891('0x21')](respondWithResult(_0x5e73ac,null))[_0xb891('0x40')](handleError(_0x5e73ac,null));};exports[_0xb891('0x46')]=function(_0x3f4eb2,_0x3a29b5){return db['VoiceDialReport'][_0xb891('0x46')](_0x3f4eb2[_0xb891('0x47')],{})['then'](respondWithResult(_0x3a29b5,0xc9))['catch'](handleError(_0x3a29b5,null));};exports[_0xb891('0x20')]=function(_0x4d67a2,_0xa52d83){if(_0x4d67a2[_0xb891('0x47')]['id']){delete _0x4d67a2[_0xb891('0x47')]['id'];}return db[_0xb891('0x28')][_0xb891('0x45')]({'where':{'id':_0x4d67a2[_0xb891('0x42')]['id']}})[_0xb891('0x21')](handleEntityNotFound(_0xa52d83,null))[_0xb891('0x21')](saveUpdates(_0x4d67a2['body'],null))['then'](respondWithResult(_0xa52d83,null))['catch'](handleError(_0xa52d83,null));};exports[_0xb891('0x48')]=function(_0x4c3130,_0x16524c){return db[_0xb891('0x28')]['find']({'where':{'id':_0x4c3130[_0xb891('0x42')]['id']}})[_0xb891('0x21')](handleEntityNotFound(_0x16524c,null))[_0xb891('0x21')](removeEntity(_0x16524c,null))[_0xb891('0x40')](handleError(_0x16524c,null));};exports[_0xb891('0x49')]=function(_0x1d400a,_0x72cf6c){return db['VoiceDialReport'][_0xb891('0x49')]()['then'](respondWithResult(_0x72cf6c,null))[_0xb891('0x40')](handleError(_0x72cf6c,null));};
\ No newline at end of file
+var _0xddb6=['../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','update','then','destroy','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','pick','merge','where','VIRTUAL','filter','VoiceDialReport','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x209b13,_0x508ad5){var _0x1428a6=function(_0x491cc9){while(--_0x491cc9){_0x209b13['push'](_0x209b13['shift']());}};_0x1428a6(++_0x508ad5);}(_0xddb6,0x1d3));var _0x6ddb=function(_0xc88652,_0xa60371){_0xc88652=_0xc88652-0x0;var _0x5ee5ce=_0xddb6[_0xc88652];return _0x5ee5ce;};'use strict';var emlformat=require(_0x6ddb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ddb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ddb('0x2'));var moment=require(_0x6ddb('0x3'));var BPromise=require(_0x6ddb('0x4'));var Mustache=require('mustache');var util=require(_0x6ddb('0x5'));var path=require(_0x6ddb('0x6'));var sox=require(_0x6ddb('0x7'));var csv=require('to-csv');var ejs=require(_0x6ddb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ddb('0x9'));var squel=require(_0x6ddb('0xa'));var crypto=require(_0x6ddb('0xb'));var jsforce=require(_0x6ddb('0xc'));var deskjs=require(_0x6ddb('0xd'));var toCsv=require(_0x6ddb('0xe'));var querystring=require(_0x6ddb('0xf'));var Papa=require('papaparse');var Redis=require(_0x6ddb('0x10'));var authService=require(_0x6ddb('0x11'));var qs=require(_0x6ddb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6ddb('0x13'));var logger=require(_0x6ddb('0x14'))(_0x6ddb('0x15'));var utils=require(_0x6ddb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6ddb('0x17'));var db=require(_0x6ddb('0x18'))['db'];function respondWithStatusCode(_0x21f0ac,_0xc3af25){_0xc3af25=_0xc3af25||0xcc;return function(_0x280955){if(_0x280955){return _0x21f0ac['sendStatus'](_0xc3af25);}return _0x21f0ac[_0x6ddb('0x19')](_0xc3af25)['end']();};}function respondWithResult(_0xcd4923,_0x49931f){_0x49931f=_0x49931f||0xc8;return function(_0x198c67){if(_0x198c67){return _0xcd4923[_0x6ddb('0x19')](_0x49931f)['json'](_0x198c67);}};}function respondWithFilteredResult(_0xa2f5e7,_0x39d958){return function(_0x183ca6){if(_0x183ca6){var _0x3842ce=typeof _0x39d958[_0x6ddb('0x1a')]===_0x6ddb('0x1b')&&typeof _0x39d958[_0x6ddb('0x1c')]===_0x6ddb('0x1b');var _0x1a9c4e=_0x183ca6[_0x6ddb('0x1d')];var _0x433dc4=_0x3842ce?0x0:_0x39d958['offset'];var _0x582aed=_0x3842ce?_0x183ca6[_0x6ddb('0x1d')]:_0x39d958[_0x6ddb('0x1a')]+_0x39d958[_0x6ddb('0x1c')];var _0xdc6bff;if(_0x582aed>=_0x1a9c4e){_0x582aed=_0x1a9c4e;_0xdc6bff=0xc8;}else{_0xdc6bff=0xce;}_0xa2f5e7[_0x6ddb('0x19')](_0xdc6bff);return _0xa2f5e7['set']('Content-Range',_0x433dc4+'-'+_0x582aed+'/'+_0x1a9c4e)[_0x6ddb('0x1e')](_0x183ca6);}return null;};}function patchUpdates(_0x1977f2){return function(_0x5c7896){try{jsonpatch['apply'](_0x5c7896,_0x1977f2,!![]);}catch(_0x1f5edc){return BPromise['reject'](_0x1f5edc);}return _0x5c7896['save']();};}function saveUpdates(_0x38f112,_0x5f3790){return function(_0x106352){if(_0x106352){return _0x106352[_0x6ddb('0x1f')](_0x38f112)[_0x6ddb('0x20')](function(_0x17d211){return _0x17d211;});}return null;};}function removeEntity(_0x59beda,_0x9b216f){return function(_0x2c1559){if(_0x2c1559){return _0x2c1559[_0x6ddb('0x21')]()[_0x6ddb('0x20')](function(){_0x59beda[_0x6ddb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1afae5,_0x1a534f){return function(_0x26f2ed){if(!_0x26f2ed){_0x1afae5[_0x6ddb('0x22')](0x194);}return _0x26f2ed;};}function handleError(_0xcdb94,_0x59b5a2){_0x59b5a2=_0x59b5a2||0x1f4;return function(_0x1a3725){logger[_0x6ddb('0x23')](_0x1a3725['stack']);if(_0x1a3725[_0x6ddb('0x24')]){delete _0x1a3725[_0x6ddb('0x24')];}_0xcdb94[_0x6ddb('0x19')](_0x59b5a2)['send'](_0x1a3725);};}exports[_0x6ddb('0x25')]=function(_0x150355,_0x4fe12d){var _0x5e4fa7={},_0x85eb1a={},_0x3e1932={'count':0x0,'rows':[]};var _0x1f1d18=_[_0x6ddb('0x26')](db['VoiceDialReport'][_0x6ddb('0x27')],function(_0x1befcf){return{'name':_0x1befcf[_0x6ddb('0x28')],'type':_0x1befcf[_0x6ddb('0x29')][_0x6ddb('0x2a')]};});_0x85eb1a[_0x6ddb('0x2b')]=_[_0x6ddb('0x26')](_0x1f1d18,_0x6ddb('0x24'));_0x85eb1a[_0x6ddb('0x2c')]=_[_0x6ddb('0x2d')](_0x150355['query']);_0x85eb1a[_0x6ddb('0x2e')]=_[_0x6ddb('0x2f')](_0x85eb1a[_0x6ddb('0x2b')],_0x85eb1a[_0x6ddb('0x2c')]);_0x5e4fa7['attributes']=_[_0x6ddb('0x2f')](_0x85eb1a[_0x6ddb('0x2b')],qs['fields'](_0x150355['query'][_0x6ddb('0x30')]));_0x5e4fa7[_0x6ddb('0x31')]=_0x5e4fa7[_0x6ddb('0x31')]['length']?_0x5e4fa7[_0x6ddb('0x31')]:_0x85eb1a[_0x6ddb('0x2b')];if(!_0x150355[_0x6ddb('0x2c')]['hasOwnProperty'](_0x6ddb('0x32'))){_0x5e4fa7[_0x6ddb('0x1c')]=qs[_0x6ddb('0x1c')](_0x150355[_0x6ddb('0x2c')]['limit']);_0x5e4fa7[_0x6ddb('0x1a')]=qs[_0x6ddb('0x1a')](_0x150355[_0x6ddb('0x2c')][_0x6ddb('0x1a')]);}_0x5e4fa7[_0x6ddb('0x33')]=qs['sort'](_0x150355['query']['sort']);_0x5e4fa7['where']=qs[_0x6ddb('0x2e')](_[_0x6ddb('0x34')](_0x150355[_0x6ddb('0x2c')],_0x85eb1a[_0x6ddb('0x2e')]),_0x1f1d18);if(_0x150355['query']['filter']){_0x5e4fa7['where']=_[_0x6ddb('0x35')](_0x5e4fa7[_0x6ddb('0x36')],{'$or':_[_0x6ddb('0x26')](_0x1f1d18,function(_0x385d0b){if(_0x385d0b[_0x6ddb('0x29')]!==_0x6ddb('0x37')){var _0x10dc65={};_0x10dc65[_0x385d0b[_0x6ddb('0x24')]]={'$like':'%'+_0x150355[_0x6ddb('0x2c')][_0x6ddb('0x38')]+'%'};return _0x10dc65;}})});}_0x5e4fa7=_[_0x6ddb('0x35')]({},_0x5e4fa7,_0x150355['options']);var _0x10b05a={'where':_0x5e4fa7['where']};return db[_0x6ddb('0x39')][_0x6ddb('0x1d')](_0x10b05a)['then'](function(_0x314267){_0x3e1932['count']=_0x314267;if(_0x150355[_0x6ddb('0x2c')]['includeAll']){_0x5e4fa7[_0x6ddb('0x3a')]=[{'all':!![]}];}return db[_0x6ddb('0x39')][_0x6ddb('0x3b')](_0x5e4fa7);})['then'](function(_0x3360ff){_0x3e1932[_0x6ddb('0x3c')]=_0x3360ff;return _0x3e1932;})[_0x6ddb('0x20')](respondWithFilteredResult(_0x4fe12d,_0x5e4fa7))[_0x6ddb('0x3d')](handleError(_0x4fe12d,null));};exports[_0x6ddb('0x3e')]=function(_0x5d5c0a,_0x383506){var _0x12bbd0={'raw':!![],'where':{'id':_0x5d5c0a[_0x6ddb('0x3f')]['id']}},_0x54c09a={};_0x54c09a[_0x6ddb('0x2b')]=_[_0x6ddb('0x2d')](db['VoiceDialReport'][_0x6ddb('0x27')]);_0x54c09a[_0x6ddb('0x2c')]=_[_0x6ddb('0x2d')](_0x5d5c0a[_0x6ddb('0x2c')]);_0x54c09a['filters']=_[_0x6ddb('0x2f')](_0x54c09a['model'],_0x54c09a[_0x6ddb('0x2c')]);_0x12bbd0[_0x6ddb('0x31')]=_[_0x6ddb('0x2f')](_0x54c09a['model'],qs['fields'](_0x5d5c0a[_0x6ddb('0x2c')][_0x6ddb('0x30')]));_0x12bbd0[_0x6ddb('0x31')]=_0x12bbd0[_0x6ddb('0x31')]['length']?_0x12bbd0[_0x6ddb('0x31')]:_0x54c09a[_0x6ddb('0x2b')];if(_0x5d5c0a[_0x6ddb('0x2c')][_0x6ddb('0x40')]){_0x12bbd0[_0x6ddb('0x3a')]=[{'all':!![]}];}_0x12bbd0=_[_0x6ddb('0x35')]({},_0x12bbd0,_0x5d5c0a[_0x6ddb('0x41')]);return db[_0x6ddb('0x39')]['find'](_0x12bbd0)['then'](handleEntityNotFound(_0x383506,null))[_0x6ddb('0x20')](respondWithResult(_0x383506,null))[_0x6ddb('0x3d')](handleError(_0x383506,null));};exports[_0x6ddb('0x42')]=function(_0x31b2f2,_0x1d0a0b){return db[_0x6ddb('0x39')][_0x6ddb('0x42')](_0x31b2f2['body'],{})[_0x6ddb('0x20')](respondWithResult(_0x1d0a0b,0xc9))['catch'](handleError(_0x1d0a0b,null));};exports[_0x6ddb('0x1f')]=function(_0x33ede8,_0x4fc568){if(_0x33ede8[_0x6ddb('0x43')]['id']){delete _0x33ede8[_0x6ddb('0x43')]['id'];}return db[_0x6ddb('0x39')][_0x6ddb('0x44')]({'where':{'id':_0x33ede8['params']['id']}})[_0x6ddb('0x20')](handleEntityNotFound(_0x4fc568,null))[_0x6ddb('0x20')](saveUpdates(_0x33ede8['body'],null))[_0x6ddb('0x20')](respondWithResult(_0x4fc568,null))[_0x6ddb('0x3d')](handleError(_0x4fc568,null));};exports[_0x6ddb('0x21')]=function(_0x5295e6,_0x38a1ec){return db['VoiceDialReport'][_0x6ddb('0x44')]({'where':{'id':_0x5295e6[_0x6ddb('0x3f')]['id']}})[_0x6ddb('0x20')](handleEntityNotFound(_0x38a1ec,null))[_0x6ddb('0x20')](removeEntity(_0x38a1ec,null))['catch'](handleError(_0x38a1ec,null));};exports[_0x6ddb('0x45')]=function(_0x24410d,_0x47db6d){return db['VoiceDialReport']['describe']()[_0x6ddb('0x20')](respondWithResult(_0x47db6d,null))['catch'](handleError(_0x47db6d,null));};
\ No newline at end of file
index b3bc55f..624deeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ff=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x1b1b2c,_0x3ebae4){var _0x55e805=function(_0x1ee3f3){while(--_0x1ee3f3){_0x1b1b2c['push'](_0x1b1b2c['shift']());}};_0x55e805(++_0x3ebae4);}(_0xd7ff,0x100));var _0xfd7f=function(_0x9e6a6e,_0x33d8c3){_0x9e6a6e=_0x9e6a6e-0x0;var _0x2a5bee=_0xd7ff[_0x9e6a6e];return _0x2a5bee;};'use strict';var _=require(_0xfd7f('0x0'));var util=require(_0xfd7f('0x1'));var logger=require(_0xfd7f('0x2'))(_0xfd7f('0x3'));var moment=require(_0xfd7f('0x4'));var BPromise=require(_0xfd7f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfd7f('0x6'));var config=require(_0xfd7f('0x7'));var attributes=require(_0xfd7f('0x8'));module[_0xfd7f('0x9')]=function(_0x552335,_0x38bdfe){return _0x552335[_0xfd7f('0xa')](_0xfd7f('0xb'),attributes,{'tableName':_0xfd7f('0xc'),'paranoid':![],'indexes':[{'fields':[_0xfd7f('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5173=['./voiceDialReport.attributes','exports','define','VoiceDialReport','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x59405a,_0x540604){var _0x5adf5b=function(_0x454b1f){while(--_0x454b1f){_0x59405a['push'](_0x59405a['shift']());}};_0x5adf5b(++_0x540604);}(_0x5173,0x109));var _0x3517=function(_0x486c56,_0x523826){_0x486c56=_0x486c56-0x0;var _0x85864e=_0x5173[_0x486c56];return _0x85864e;};'use strict';var _=require(_0x3517('0x0'));var util=require(_0x3517('0x1'));var logger=require(_0x3517('0x2'))('api');var moment=require(_0x3517('0x3'));var BPromise=require('bluebird');var rp=require(_0x3517('0x4'));var fs=require('fs');var path=require(_0x3517('0x5'));var rimraf=require(_0x3517('0x6'));var config=require(_0x3517('0x7'));var attributes=require(_0x3517('0x8'));module[_0x3517('0x9')]=function(_0x46d835,_0x2a0b0c){return _0x46d835[_0x3517('0xa')](_0x3517('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x3517('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 77bc30f..59bfcb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x934b=['limit','UpdateVoiceDialReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','options','raw','update','body','where'];(function(_0x176144,_0x5d86bf){var _0x5e7ba7=function(_0xf754f3){while(--_0xf754f3){_0x176144['push'](_0x176144['shift']());}};_0x5e7ba7(++_0x5d86bf);}(_0x934b,0x176));var _0xb934=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0x934b[_0x5c846d];return _0xd064e4;};'use strict';var _=require(_0xb934('0x0'));var util=require(_0xb934('0x1'));var moment=require('moment');var BPromise=require(_0xb934('0x2'));var rs=require(_0xb934('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb934('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb934('0x5'))('rpc');var config=require(_0xb934('0x6'));var jayson=require(_0xb934('0x7'));var client=jayson[_0xb934('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x480399,_0x50ceaf,_0xf736e1){return new BPromise(function(_0x1cfb1b,_0x5732a2){return client[_0xb934('0x9')](_0x480399,_0xf736e1)[_0xb934('0xa')](function(_0x3267d1){logger[_0xb934('0xb')](_0xb934('0xc'),_0x50ceaf,_0xb934('0xd'));logger[_0xb934('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x50ceaf,_0xb934('0xd'),JSON[_0xb934('0xf')](_0x3267d1));if(_0x3267d1[_0xb934('0x10')]){if(_0x3267d1['error'][_0xb934('0x11')]===0x1f4){logger['error'](_0xb934('0xc'),_0x50ceaf,_0x3267d1[_0xb934('0x10')][_0xb934('0x12')]);return _0x5732a2(_0x3267d1[_0xb934('0x10')][_0xb934('0x12')]);}logger[_0xb934('0x10')](_0xb934('0xc'),_0x50ceaf,_0x3267d1[_0xb934('0x10')][_0xb934('0x12')]);return _0x1cfb1b(_0x3267d1['error'][_0xb934('0x12')]);}else{logger[_0xb934('0xb')](_0xb934('0xc'),_0x50ceaf,'request\x20sent');_0x1cfb1b(_0x3267d1[_0xb934('0x13')][_0xb934('0x12')]);}})[_0xb934('0x14')](function(_0x5e20d0){logger[_0xb934('0x10')](_0xb934('0xc'),_0x50ceaf,_0x5e20d0);_0x5732a2(_0x5e20d0);});});}exports[_0xb934('0x15')]=function(_0x69b453){var _0xa29515=this;return new Promise(function(_0x3643ab,_0x4eb51a){return db[_0xb934('0x16')][_0xb934('0x17')](_0x69b453['body'],{'raw':_0x69b453['options']?_0x69b453[_0xb934('0x18')][_0xb934('0x19')]===undefined?!![]:![]:!![]})[_0xb934('0xa')](function(_0x4cf985){logger[_0xb934('0xb')](_0xb934('0x15'),_0x69b453);logger[_0xb934('0xe')](_0xb934('0x15'),_0x69b453,JSON[_0xb934('0xf')](_0x4cf985));_0x3643ab(_0x4cf985);})[_0xb934('0x14')](function(_0x4864ab){logger[_0xb934('0x10')](_0xb934('0x15'),_0x4864ab['message'],_0x69b453);_0x4eb51a(_0xa29515[_0xb934('0x10')](0x1f4,_0x4864ab[_0xb934('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0x41be9c){var _0x517c4f=this;return new Promise(function(_0x2f059c,_0x3fe1d2){return db[_0xb934('0x16')][_0xb934('0x1a')](_0x41be9c[_0xb934('0x1b')],{'raw':_0x41be9c['options']?_0x41be9c[_0xb934('0x18')][_0xb934('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41be9c[_0xb934('0x18')]?_0x41be9c['options'][_0xb934('0x1c')]||null:null,'attributes':_0x41be9c[_0xb934('0x18')]?_0x41be9c[_0xb934('0x18')]['attributes']||null:null,'limit':_0x41be9c[_0xb934('0x18')]?_0x41be9c[_0xb934('0x18')][_0xb934('0x1d')]||null:null})[_0xb934('0xa')](function(_0x5e9afa){logger[_0xb934('0xb')]('UpdateVoiceDialReport',_0x41be9c);logger[_0xb934('0xe')](_0xb934('0x1e'),_0x41be9c,JSON['stringify'](_0x5e9afa));_0x2f059c(_0x5e9afa);})[_0xb934('0x14')](function(_0x376892){logger[_0xb934('0x10')](_0xb934('0x1e'),_0x376892[_0xb934('0x12')],_0x41be9c);_0x3fe1d2(_0x517c4f[_0xb934('0x10')](0x1f4,_0x376892[_0xb934('0x12')]));});});};
\ No newline at end of file
+var _0xa833=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw','catch','update','body','where','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5ba9dd,_0x7f59bf){var _0xf9d2e5=function(_0x2c991b){while(--_0x2c991b){_0x5ba9dd['push'](_0x5ba9dd['shift']());}};_0xf9d2e5(++_0x7f59bf);}(_0xa833,0x1cd));var _0x3a83=function(_0x152493,_0x437242){_0x152493=_0x152493-0x0;var _0x47233a=_0xa833[_0x152493];return _0x47233a;};'use strict';var _=require(_0x3a83('0x0'));var util=require(_0x3a83('0x1'));var moment=require(_0x3a83('0x2'));var BPromise=require(_0x3a83('0x3'));var rs=require(_0x3a83('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a83('0x5'))['db'];var utils=require(_0x3a83('0x6'));var logger=require(_0x3a83('0x7'))(_0x3a83('0x8'));var config=require(_0x3a83('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3a83('0xa')][_0x3a83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19e7ac,_0x246c50,_0x2eea8c){return new BPromise(function(_0x3ddf4a,_0xd3d9f8){return client[_0x3a83('0xc')](_0x19e7ac,_0x2eea8c)[_0x3a83('0xd')](function(_0x25cd60){logger[_0x3a83('0xe')](_0x3a83('0xf'),_0x246c50,'request\x20sent');logger[_0x3a83('0x10')](_0x3a83('0x11'),_0x246c50,_0x3a83('0x12'),JSON[_0x3a83('0x13')](_0x25cd60));if(_0x25cd60[_0x3a83('0x14')]){if(_0x25cd60[_0x3a83('0x14')][_0x3a83('0x15')]===0x1f4){logger['error'](_0x3a83('0xf'),_0x246c50,_0x25cd60[_0x3a83('0x14')][_0x3a83('0x16')]);return _0xd3d9f8(_0x25cd60[_0x3a83('0x14')][_0x3a83('0x16')]);}logger['error'](_0x3a83('0xf'),_0x246c50,_0x25cd60[_0x3a83('0x14')]['message']);return _0x3ddf4a(_0x25cd60[_0x3a83('0x14')][_0x3a83('0x16')]);}else{logger[_0x3a83('0xe')](_0x3a83('0xf'),_0x246c50,'request\x20sent');_0x3ddf4a(_0x25cd60[_0x3a83('0x17')][_0x3a83('0x16')]);}})['catch'](function(_0xedfeb1){logger[_0x3a83('0x14')](_0x3a83('0xf'),_0x246c50,_0xedfeb1);_0xd3d9f8(_0xedfeb1);});});}exports[_0x3a83('0x18')]=function(_0x5f2634){var _0x56ff1b=this;return new Promise(function(_0x466b3e,_0x3b0546){return db[_0x3a83('0x19')][_0x3a83('0x1a')](_0x5f2634['body'],{'raw':_0x5f2634[_0x3a83('0x1b')]?_0x5f2634[_0x3a83('0x1b')][_0x3a83('0x1c')]===undefined?!![]:![]:!![]})[_0x3a83('0xd')](function(_0x3a32d3){logger[_0x3a83('0xe')]('CreateVoiceDialReport',_0x5f2634);logger[_0x3a83('0x10')](_0x3a83('0x18'),_0x5f2634,JSON['stringify'](_0x3a32d3));_0x466b3e(_0x3a32d3);})[_0x3a83('0x1d')](function(_0x4b8fc9){logger['error'](_0x3a83('0x18'),_0x4b8fc9['message'],_0x5f2634);_0x3b0546(_0x56ff1b[_0x3a83('0x14')](0x1f4,_0x4b8fc9[_0x3a83('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0xd43244){var _0x3fe63f=this;return new Promise(function(_0x3c5e5e,_0x3c8135){return db[_0x3a83('0x19')][_0x3a83('0x1e')](_0xd43244[_0x3a83('0x1f')],{'raw':_0xd43244[_0x3a83('0x1b')]?_0xd43244[_0x3a83('0x1b')][_0x3a83('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd43244[_0x3a83('0x1b')]?_0xd43244['options'][_0x3a83('0x20')]||null:null,'attributes':_0xd43244[_0x3a83('0x1b')]?_0xd43244[_0x3a83('0x1b')][_0x3a83('0x21')]||null:null,'limit':_0xd43244[_0x3a83('0x1b')]?_0xd43244[_0x3a83('0x1b')][_0x3a83('0x22')]||null:null})['then'](function(_0x396fcc){logger[_0x3a83('0xe')](_0x3a83('0x23'),_0xd43244);logger[_0x3a83('0x10')](_0x3a83('0x23'),_0xd43244,JSON['stringify'](_0x396fcc));_0x3c5e5e(_0x396fcc);})[_0x3a83('0x1d')](function(_0x42e352){logger[_0x3a83('0x14')](_0x3a83('0x23'),_0x42e352[_0x3a83('0x16')],_0xd43244);_0x3c8135(_0x3fe63f['error'](0x1f4,_0x42e352[_0x3a83('0x16')]));});});};
\ No newline at end of file
index 8b2c3f1..33ae48b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ba=['isAuthenticated','index','/:id','post','create','/:id/applications','addApplications','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xf6ba,0x10e));var _0xaf6b=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xf6ba[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0xaf6b('0x0'));var util=require(_0xaf6b('0x1'));var path=require('path');var timeout=require(_0xaf6b('0x2'));var express=require(_0xaf6b('0x3'));var router=express[_0xaf6b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf6b('0x5'));var interaction=require(_0xaf6b('0x6'));var config=require(_0xaf6b('0x7'));var controller=require(_0xaf6b('0x8'));router[_0xaf6b('0x9')]('/',auth[_0xaf6b('0xa')](),controller[_0xaf6b('0xb')]);router[_0xaf6b('0x9')](_0xaf6b('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xaf6b('0xd')]('/',auth[_0xaf6b('0xa')](),controller[_0xaf6b('0xe')]);router['post'](_0xaf6b('0xf'),auth[_0xaf6b('0xa')](),controller[_0xaf6b('0x10')]);router['put'](_0xaf6b('0xc'),auth[_0xaf6b('0xa')](),controller[_0xaf6b('0x11')]);router['delete']('/:id',auth[_0xaf6b('0xa')](),controller[_0xaf6b('0x12')]);module[_0xaf6b('0x13')]=router;
\ No newline at end of file
+var _0x44d9=['show','post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x44d9,0x183));var _0x944d=function(_0x5ca6bb,_0x5585d6){_0x5ca6bb=_0x5ca6bb-0x0;var _0x5a6fba=_0x44d9[_0x5ca6bb];return _0x5a6fba;};'use strict';var multer=require(_0x944d('0x0'));var util=require(_0x944d('0x1'));var path=require(_0x944d('0x2'));var timeout=require('connect-timeout');var express=require(_0x944d('0x3'));var router=express[_0x944d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x944d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x944d('0x6'));var controller=require(_0x944d('0x7'));router[_0x944d('0x8')]('/',auth['isAuthenticated'](),controller[_0x944d('0x9')]);router['get'](_0x944d('0xa'),auth[_0x944d('0xb')](),controller[_0x944d('0xc')]);router[_0x944d('0xd')]('/',auth[_0x944d('0xb')](),controller[_0x944d('0xe')]);router[_0x944d('0xd')]('/:id/applications',auth[_0x944d('0xb')](),controller['addApplications']);router[_0x944d('0xf')](_0x944d('0xa'),auth[_0x944d('0xb')](),controller[_0x944d('0x10')]);router['delete'](_0x944d('0xa'),auth[_0x944d('0xb')](),controller[_0x944d('0x11')]);module[_0x944d('0x12')]=router;
\ No newline at end of file
index 3b9a052..1dbfbaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b3d=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','inbound-fax','outbound-fax','system'];(function(_0x63a22,_0x5107ab){var _0x44a5f7=function(_0x24be7e){while(--_0x24be7e){_0x63a22['push'](_0x63a22['shift']());}};_0x44a5f7(++_0x5107ab);}(_0x4b3d,0x1e3));var _0xd4b3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4b3d[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xd4b3('0x0'));module[_0xd4b3('0x1')]={'context':{'type':Sequelize[_0xd4b3('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd4b3('0x2')],'allowNull':![],'unique':_0xd4b3('0x3')},'priority':{'type':Sequelize[_0xd4b3('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xd4b3('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd4b3('0x4')},'appdata':{'type':Sequelize[_0xd4b3('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd4b3('0x5')](_0xd4b3('0x6'),_0xd4b3('0x7'),'internal',_0xd4b3('0x8'),_0xd4b3('0x9'),_0xd4b3('0xa'),_0xd4b3('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd4b3('0xc')},'IntervalId':{'type':Sequelize[_0xd4b3('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xd4b3('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xd4b3('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd4b3('0xd')]},'recordingFormat':{'type':Sequelize[_0xd4b3('0x2')],'defaultValue':_0xd4b3('0xf')},'answer':{'type':Sequelize[_0xd4b3('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd4b3('0x10')],'get':function(_0x57b53a){return this[_0xd4b3('0x11')](_0xd4b3('0x12'));}},'alias':{'type':Sequelize[_0xd4b3('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xaa28=['internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound'];(function(_0x5e738a,_0x2b0ab4){var _0x27d917=function(_0x35ffb5){while(--_0x35ffb5){_0x5e738a['push'](_0x5e738a['shift']());}};_0x27d917(++_0x2b0ab4);}(_0xaa28,0x1ca));var _0x8aa2=function(_0x1e91eb,_0x5829a3){_0x1e91eb=_0x1e91eb-0x0;var _0x2af75a=_0xaa28[_0x1e91eb];return _0x2af75a;};'use strict';var Sequelize=require(_0x8aa2('0x0'));module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x8aa2('0x1')],'allowNull':![],'unique':_0x8aa2('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x8aa2('0x2')},'tag':{'type':Sequelize[_0x8aa2('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x8aa2('0x1')],'allowNull':![],'defaultValue':_0x8aa2('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x8aa2('0x4')](_0x8aa2('0x5'),'outbound',_0x8aa2('0x6'),_0x8aa2('0x7'),'outbound-fax',_0x8aa2('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x8aa2('0x1')]},'interval':{'type':Sequelize[_0x8aa2('0x1')],'allowNull':![],'defaultValue':_0x8aa2('0x9')},'IntervalId':{'type':Sequelize[_0x8aa2('0xa')]},'isApp':{'type':Sequelize[_0x8aa2('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x8aa2('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x8aa2('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x8aa2('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x8aa2('0xa')]},'recordingFormat':{'type':Sequelize[_0x8aa2('0x1')],'defaultValue':_0x8aa2('0xc')},'answer':{'type':Sequelize[_0x8aa2('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x8aa2('0xd')],'get':function(_0x57af65){return this[_0x8aa2('0xe')](_0x8aa2('0xf'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 437404c..629741e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2b5=['sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','show','params','create','startsWith','body','exten','user','role','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','update','context','mandatoryDisposition','alias','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x1d73a5,_0x3fe1c2){var _0x1a7511=function(_0x5c47d4){while(--_0x5c47d4){_0x1d73a5['push'](_0x1d73a5['shift']());}};_0x1a7511(++_0x3fe1c2);}(_0xc2b5,0x129));var _0x5c2b=function(_0x32346a,_0x138d23){_0x32346a=_0x32346a-0x0;var _0x518ddd=_0xc2b5[_0x32346a];return _0x518ddd;};'use strict';var emlformat=require(_0x5c2b('0x0'));var rimraf=require(_0x5c2b('0x1'));var zipdir=require(_0x5c2b('0x2'));var jsonpatch=require(_0x5c2b('0x3'));var rp=require(_0x5c2b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c2b('0x5'));var util=require(_0x5c2b('0x6'));var path=require(_0x5c2b('0x7'));var sox=require(_0x5c2b('0x8'));var csv=require(_0x5c2b('0x9'));var ejs=require(_0x5c2b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c2b('0xb'));var squel=require(_0x5c2b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5c2b('0xd'));var toCsv=require(_0x5c2b('0x9'));var querystring=require(_0x5c2b('0xe'));var Papa=require(_0x5c2b('0xf'));var Redis=require(_0x5c2b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c2b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5c2b('0x12'));var config=require(_0x5c2b('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c2b('0x14'))['db'];config['redis']=_[_0x5c2b('0x15')](config[_0x5c2b('0x16')],{'host':_0x5c2b('0x17'),'port':0x18eb});var socket=require(_0x5c2b('0x18'))(new Redis(config[_0x5c2b('0x16')]));require(_0x5c2b('0x19'))[_0x5c2b('0x1a')](socket);function respondWithStatusCode(_0xd51537,_0xc3c28f){_0xc3c28f=_0xc3c28f||0xcc;return function(_0x341cf0){if(_0x341cf0){return _0xd51537[_0x5c2b('0x1b')](_0xc3c28f);}return _0xd51537[_0x5c2b('0x1c')](_0xc3c28f)[_0x5c2b('0x1d')]();};}function respondWithResult(_0x25d06c,_0x335f6f){_0x335f6f=_0x335f6f||0xc8;return function(_0x271744){if(_0x271744){return _0x25d06c[_0x5c2b('0x1c')](_0x335f6f)[_0x5c2b('0x1e')](_0x271744);}};}function respondWithFilteredResult(_0x1b69a4,_0x1d1727){return function(_0x410d3b){if(_0x410d3b){var _0x13ccec=typeof _0x1d1727['offset']===_0x5c2b('0x1f')&&typeof _0x1d1727[_0x5c2b('0x20')]==='undefined';var _0x50d81b=_0x410d3b[_0x5c2b('0x21')];var _0x2796c0=_0x13ccec?0x0:_0x1d1727[_0x5c2b('0x22')];var _0x3e1c11=_0x13ccec?_0x410d3b[_0x5c2b('0x21')]:_0x1d1727[_0x5c2b('0x22')]+_0x1d1727[_0x5c2b('0x20')];var _0x550728;if(_0x3e1c11>=_0x50d81b){_0x3e1c11=_0x50d81b;_0x550728=0xc8;}else{_0x550728=0xce;}_0x1b69a4['status'](_0x550728);return _0x1b69a4[_0x5c2b('0x23')]('Content-Range',_0x2796c0+'-'+_0x3e1c11+'/'+_0x50d81b)[_0x5c2b('0x1e')](_0x410d3b);}return null;};}function patchUpdates(_0x34fa4d){return function(_0x28d3b0){try{jsonpatch[_0x5c2b('0x24')](_0x28d3b0,_0x34fa4d,!![]);}catch(_0x223b91){return BPromise[_0x5c2b('0x25')](_0x223b91);}return _0x28d3b0[_0x5c2b('0x26')]();};}function saveUpdates(_0x4683d7,_0x5b5a33){return function(_0x516e5e){if(_0x516e5e){return _0x516e5e['update'](_0x4683d7)[_0x5c2b('0x27')](function(_0xb9f8a2){return _0xb9f8a2;});}return null;};}function removeEntity(_0x2d5e51,_0x3ebd56){return function(_0x2cfeb1){if(_0x2cfeb1){return _0x2cfeb1[_0x5c2b('0x28')]()['then'](function(){var _0x4e32f7=_0x2cfeb1[_0x5c2b('0x29')]({'plain':!![]});var _0x4fc0d8=[{'name':'InboundRoutes','value':_0x5c2b('0x2a'),'ignore':![]},{'name':_0x5c2b('0x2b'),'value':_0x5c2b('0x2c'),'ignore':![]},{'name':_0x5c2b('0x2d'),'value':_0x5c2b('0x2e'),'ignore':![]}];var _0x5cb642=_(_0x4fc0d8)[_0x5c2b('0x2f')](_0x5c2b('0x30'))[_0x5c2b('0x31')]('value')[_0x5c2b('0x32')]();if(_[_0x5c2b('0x33')](_0x5cb642,_0x4e32f7['type'])){return;}var _0x49c278=_[_0x5c2b('0x34')](_0x4fc0d8,[_0x5c2b('0x32'),_0x4e32f7[_0x5c2b('0x35')]])[_0x5c2b('0x36')];return db[_0x5c2b('0x37')]['destroy']({'where':{'type':_0x49c278,'resourceId':_0x4e32f7['id']}})[_0x5c2b('0x27')](function(){return _0x2cfeb1;});})[_0x5c2b('0x27')](function(){_0x2d5e51['status'](0xcc)[_0x5c2b('0x1d')]();});}};}function handleEntityNotFound(_0x47a1ef,_0x47f915){return function(_0x2b78e9){if(!_0x2b78e9){_0x47a1ef[_0x5c2b('0x1b')](0x194);}return _0x2b78e9;};}function handleError(_0x489f68,_0x3c0c6b){_0x3c0c6b=_0x3c0c6b||0x1f4;return function(_0x261003){logger[_0x5c2b('0x38')](_0x261003[_0x5c2b('0x39')]);if(_0x261003[_0x5c2b('0x36')]){delete _0x261003['name'];}_0x489f68[_0x5c2b('0x1c')](_0x3c0c6b)[_0x5c2b('0x3a')](_0x261003);};}exports[_0x5c2b('0x3b')]=function(_0xae2413,_0x104c03){var _0x2affb3={},_0xa484c7={},_0x19b31c={'count':0x0,'rows':[]};var _0x44e3f0=_[_0x5c2b('0x31')](db[_0x5c2b('0x3c')][_0x5c2b('0x3d')],function(_0x5e3e7b){return{'name':_0x5e3e7b[_0x5c2b('0x3e')],'type':_0x5e3e7b['type'][_0x5c2b('0x3f')]};});_0xa484c7['model']=_[_0x5c2b('0x31')](_0x44e3f0,_0x5c2b('0x36'));_0xa484c7[_0x5c2b('0x40')]=_[_0x5c2b('0x41')](_0xae2413[_0x5c2b('0x40')]);_0xa484c7[_0x5c2b('0x42')]=_[_0x5c2b('0x43')](_0xa484c7[_0x5c2b('0x44')],_0xa484c7[_0x5c2b('0x40')]);_0x2affb3['attributes']=_[_0x5c2b('0x43')](_0xa484c7[_0x5c2b('0x44')],qs['fields'](_0xae2413[_0x5c2b('0x40')][_0x5c2b('0x45')]));_0x2affb3['attributes']=_0x2affb3[_0x5c2b('0x46')][_0x5c2b('0x47')]?_0x2affb3[_0x5c2b('0x46')]:_0xa484c7[_0x5c2b('0x44')];if(!_0xae2413['query'][_0x5c2b('0x48')]('nolimit')){_0x2affb3[_0x5c2b('0x20')]=qs[_0x5c2b('0x20')](_0xae2413[_0x5c2b('0x40')][_0x5c2b('0x20')]);_0x2affb3[_0x5c2b('0x22')]=qs[_0x5c2b('0x22')](_0xae2413[_0x5c2b('0x40')][_0x5c2b('0x22')]);}_0x2affb3[_0x5c2b('0x49')]=qs['sort'](_0xae2413[_0x5c2b('0x40')][_0x5c2b('0x4a')]);_0x2affb3[_0x5c2b('0x4b')]=qs[_0x5c2b('0x42')](_[_0x5c2b('0x4c')](_0xae2413[_0x5c2b('0x40')],_0xa484c7[_0x5c2b('0x42')]),_0x44e3f0);if(_0xae2413[_0x5c2b('0x40')][_0x5c2b('0x2f')]){_0x2affb3[_0x5c2b('0x4b')]=_['merge'](_0x2affb3[_0x5c2b('0x4b')],{'$or':_[_0x5c2b('0x31')](_0x44e3f0,function(_0x3e1ecc){if(_0x3e1ecc['type']!=='VIRTUAL'){var _0x460fc7={};_0x460fc7[_0x3e1ecc['name']]={'$like':'%'+_0xae2413['query'][_0x5c2b('0x2f')]+'%'};return _0x460fc7;}})});}_0x2affb3=_[_0x5c2b('0x4d')]({},_0x2affb3,_0xae2413['options']);var _0x3bb549={'where':_0x2affb3[_0x5c2b('0x4b')]};return db[_0x5c2b('0x3c')][_0x5c2b('0x21')](_0x3bb549)[_0x5c2b('0x27')](function(_0x3ea186){_0x19b31c[_0x5c2b('0x21')]=_0x3ea186;if(_0xae2413[_0x5c2b('0x40')][_0x5c2b('0x4e')]){_0x2affb3[_0x5c2b('0x4f')]=[{'all':!![]}];}return db[_0x5c2b('0x3c')][_0x5c2b('0x50')](_0x2affb3);})[_0x5c2b('0x27')](function(_0xcc03b4){_0x19b31c[_0x5c2b('0x51')]=_0xcc03b4;return _0x19b31c;})[_0x5c2b('0x27')](respondWithFilteredResult(_0x104c03,_0x2affb3))[_0x5c2b('0x52')](handleError(_0x104c03,null));};exports[_0x5c2b('0x53')]=function(_0x4c7392,_0x16908c){var _0x205eb1={'raw':![],'where':{'id':_0x4c7392[_0x5c2b('0x54')]['id']}},_0x3ae88d={};_0x3ae88d['model']=_['keys'](db[_0x5c2b('0x3c')][_0x5c2b('0x3d')]);_0x3ae88d['query']=_[_0x5c2b('0x41')](_0x4c7392[_0x5c2b('0x40')]);_0x3ae88d[_0x5c2b('0x42')]=_[_0x5c2b('0x43')](_0x3ae88d[_0x5c2b('0x44')],_0x3ae88d['query']);_0x205eb1['attributes']=_[_0x5c2b('0x43')](_0x3ae88d[_0x5c2b('0x44')],qs['fields'](_0x4c7392['query'][_0x5c2b('0x45')]));_0x205eb1[_0x5c2b('0x46')]=_0x205eb1[_0x5c2b('0x46')][_0x5c2b('0x47')]?_0x205eb1[_0x5c2b('0x46')]:_0x3ae88d[_0x5c2b('0x44')];if(_0x4c7392['query'][_0x5c2b('0x4e')]){_0x205eb1[_0x5c2b('0x4f')]=[{'all':!![]}];}_0x205eb1=_[_0x5c2b('0x4d')]({},_0x205eb1,_0x4c7392['options']);return db[_0x5c2b('0x3c')][_0x5c2b('0x34')](_0x205eb1)[_0x5c2b('0x27')](handleEntityNotFound(_0x16908c,null))['then'](respondWithResult(_0x16908c,null))[_0x5c2b('0x52')](handleError(_0x16908c,null));};exports[_0x5c2b('0x28')]=function(_0x580333,_0x4cdc9b){return db[_0x5c2b('0x3c')]['find']({'where':{'id':_0x580333[_0x5c2b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4cdc9b,null))[_0x5c2b('0x27')](removeEntity(_0x4cdc9b,null))[_0x5c2b('0x52')](handleError(_0x4cdc9b,null));};exports[_0x5c2b('0x55')]=function(_0x57a2f0,_0x21fac3){if(_0x57a2f0['body'][_0x5c2b('0x35')]===_0x5c2b('0x2c')&&!_[_0x5c2b('0x56')](_0x57a2f0[_0x5c2b('0x57')][_0x5c2b('0x58')],'_')){_0x57a2f0[_0x5c2b('0x57')][_0x5c2b('0x58')]='_'['concat'](_0x57a2f0[_0x5c2b('0x57')][_0x5c2b('0x58')]);}return db[_0x5c2b('0x3c')][_0x5c2b('0x55')](_0x57a2f0[_0x5c2b('0x57')],{'raw':![]})[_0x5c2b('0x27')](function(_0x4b4330){var _0x30f576=_0x57a2f0[_0x5c2b('0x59')][_0x5c2b('0x29')]({'plain':!![]});if(!_0x30f576)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30f576[_0x5c2b('0x5a')]===_0x5c2b('0x59')){var _0x3cfbd1=_0x4b4330['get']({'plain':!![]});var _0x2c65f0=[{'name':_0x5c2b('0x5b'),'value':_0x5c2b('0x2a')},{'name':'OutboundRoutes','value':_0x5c2b('0x2c')},{'name':_0x5c2b('0x2d'),'value':_0x5c2b('0x2e')}];var _0x2f78cd=_[_0x5c2b('0x34')](_0x2c65f0,[_0x5c2b('0x32'),_0x3cfbd1[_0x5c2b('0x35')]])['name'];return db[_0x5c2b('0x5c')][_0x5c2b('0x34')]({'where':{'name':_0x2f78cd,'userProfileId':_0x30f576[_0x5c2b('0x5d')]},'raw':!![]})['then'](function(_0x177dfa){if(_0x177dfa&&_0x177dfa[_0x5c2b('0x5e')]===0x0){return db[_0x5c2b('0x37')][_0x5c2b('0x55')]({'name':_0x3cfbd1[_0x5c2b('0x36')],'resourceId':_0x3cfbd1['id'],'type':_0x177dfa['name'],'sectionId':_0x177dfa['id']},{})[_0x5c2b('0x27')](function(){return _0x4b4330;});}else{return _0x4b4330;}})[_0x5c2b('0x52')](function(_0x173aab){logger[_0x5c2b('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x173aab);throw _0x173aab;});}return _0x4b4330;})[_0x5c2b('0x27')](respondWithResult(_0x21fac3,0xc9))[_0x5c2b('0x52')](handleError(_0x21fac3,null));};exports[_0x5c2b('0x5f')]=function(_0x5c3b18,_0x200005){if(_0x5c3b18['body']['id']){delete _0x5c3b18[_0x5c2b('0x57')]['id'];}return db[_0x5c2b('0x3c')][_0x5c2b('0x34')]({'where':{'id':_0x5c3b18[_0x5c2b('0x54')]['id']}})[_0x5c2b('0x27')](handleEntityNotFound(_0x200005,null))[_0x5c2b('0x27')](function(_0xc97b09){if(_0xc97b09){return db['VoiceExtension']['update'](_[_0x5c2b('0x4c')](_0x5c3b18[_0x5c2b('0x57')],[_0x5c2b('0x58'),_0x5c2b('0x60'),'description','recordingFormat','cutdigits',_0x5c2b('0x61'),_0x5c2b('0x62')]),{'where':{'context':_0xc97b09['context'],'exten':_0xc97b09[_0x5c2b('0x58')]},'individualHooks':!![]})[_0x5c2b('0x27')](function(_0x26adfd){return _0x26adfd;});}return null;})['then'](respondWithStatusCode(_0x200005,null))[_0x5c2b('0x52')](handleError(_0x200005,null));};exports['addApplications']=function(_0x25347f,_0x57cf9c){return db['VoiceExtension']['findOne']({'where':{'id':_0x25347f[_0x5c2b('0x54')]['id']}})['then'](function(_0x578889){if(_0x578889){return db['sequelize'][_0x5c2b('0x63')](function(_0x14919b){return db[_0x5c2b('0x3c')][_0x5c2b('0x28')]({'where':{'VoiceExtensionId':_0x25347f[_0x5c2b('0x54')]['id']},'transaction':_0x14919b})[_0x5c2b('0x27')](function(){var _0xfea792=_[_0x5c2b('0x31')](_0x25347f[_0x5c2b('0x57')],function(_0x2f5fca){_0x2f5fca[_0x5c2b('0x64')]=_0x25347f[_0x5c2b('0x54')]['id'];_0x2f5fca[_0x5c2b('0x65')]=!![];return _0x2f5fca;});var _0x3e40d8=_0x25347f[_0x5c2b('0x40')][_0x5c2b('0x66')]&&_0x25347f[_0x5c2b('0x40')]['rewriteDial'][_0x5c2b('0x67')]()===_0x5c2b('0x68')?!![]:![];return _0x578889[_0x5c2b('0x69')](_0xfea792,_0x3e40d8);})[_0x5c2b('0x27')](function(_0x38093f){return db['VoiceExtension']['bulkCreate'](_0x38093f,{'transaction':_0x14919b});});})[_0x5c2b('0x27')](function(){return db[_0x5c2b('0x3c')][_0x5c2b('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x25347f[_0x5c2b('0x54')]['id']},'order':_0x5c2b('0x6b')});});}})[_0x5c2b('0x27')](respondWithResult(_0x57cf9c,null))['catch'](handleError(_0x57cf9c,null));};
\ No newline at end of file
+var _0x34af=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','redis','defaults','localhost','./voiceExtension.socket','register','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','find','type','name','sendStatus','error','send','index','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceExtension','include','findAll','rows','catch','params','length','includeAll','create','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','internal','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','description','cutdigits','mandatoryDisposition','alias','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','true','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x45825e,_0x2f44e4){var _0x4d2330=function(_0x1a6921){while(--_0x1a6921){_0x45825e['push'](_0x45825e['shift']());}};_0x4d2330(++_0x2f44e4);}(_0x34af,0x1a8));var _0xf34a=function(_0x4f464b,_0x3f42ec){_0x4f464b=_0x4f464b-0x0;var _0x4b75ab=_0x34af[_0x4f464b];return _0x4b75ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf34a('0x0'));var zipdir=require(_0xf34a('0x1'));var jsonpatch=require(_0xf34a('0x2'));var rp=require(_0xf34a('0x3'));var moment=require(_0xf34a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf34a('0x5'));var util=require(_0xf34a('0x6'));var path=require(_0xf34a('0x7'));var sox=require(_0xf34a('0x8'));var csv=require(_0xf34a('0x9'));var ejs=require(_0xf34a('0xa'));var fs=require('fs');var fs_extra=require(_0xf34a('0xb'));var _=require(_0xf34a('0xc'));var squel=require(_0xf34a('0xd'));var crypto=require(_0xf34a('0xe'));var jsforce=require(_0xf34a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf34a('0x9'));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(_0xf34a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf34a('0x11'))(_0xf34a('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf34a('0x13'));var db=require('../../mysqldb')['db'];config[_0xf34a('0x14')]=_[_0xf34a('0x15')](config[_0xf34a('0x14')],{'host':_0xf34a('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf34a('0x17'))[_0xf34a('0x18')](socket);function respondWithStatusCode(_0x16a949,_0x315dc5){_0x315dc5=_0x315dc5||0xcc;return function(_0xdba470){if(_0xdba470){return _0x16a949['sendStatus'](_0x315dc5);}return _0x16a949[_0xf34a('0x19')](_0x315dc5)['end']();};}function respondWithResult(_0x1f2f22,_0x36e8fe){_0x36e8fe=_0x36e8fe||0xc8;return function(_0x563fd8){if(_0x563fd8){return _0x1f2f22['status'](_0x36e8fe)['json'](_0x563fd8);}};}function respondWithFilteredResult(_0x33cda3,_0xf1aaaa){return function(_0x4e35de){if(_0x4e35de){var _0x187075=typeof _0xf1aaaa[_0xf34a('0x1a')]===_0xf34a('0x1b')&&typeof _0xf1aaaa[_0xf34a('0x1c')]===_0xf34a('0x1b');var _0x240fc0=_0x4e35de[_0xf34a('0x1d')];var _0x20751f=_0x187075?0x0:_0xf1aaaa[_0xf34a('0x1a')];var _0x34fae8=_0x187075?_0x4e35de[_0xf34a('0x1d')]:_0xf1aaaa['offset']+_0xf1aaaa[_0xf34a('0x1c')];var _0x37b4af;if(_0x34fae8>=_0x240fc0){_0x34fae8=_0x240fc0;_0x37b4af=0xc8;}else{_0x37b4af=0xce;}_0x33cda3[_0xf34a('0x19')](_0x37b4af);return _0x33cda3[_0xf34a('0x1e')](_0xf34a('0x1f'),_0x20751f+'-'+_0x34fae8+'/'+_0x240fc0)[_0xf34a('0x20')](_0x4e35de);}return null;};}function patchUpdates(_0x6bac45){return function(_0x24c552){try{jsonpatch[_0xf34a('0x21')](_0x24c552,_0x6bac45,!![]);}catch(_0xca5fc4){return BPromise['reject'](_0xca5fc4);}return _0x24c552[_0xf34a('0x22')]();};}function saveUpdates(_0xcf5331,_0x3bbec9){return function(_0x2c84c2){if(_0x2c84c2){return _0x2c84c2[_0xf34a('0x23')](_0xcf5331)[_0xf34a('0x24')](function(_0x7fc2bc){return _0x7fc2bc;});}return null;};}function removeEntity(_0x758a3f,_0x7cfa11){return function(_0x2d131c){if(_0x2d131c){return _0x2d131c[_0xf34a('0x25')]()[_0xf34a('0x24')](function(){var _0x154005=_0x2d131c[_0xf34a('0x26')]({'plain':!![]});var _0x1deb62=[{'name':_0xf34a('0x27'),'value':_0xf34a('0x28'),'ignore':![]},{'name':_0xf34a('0x29'),'value':_0xf34a('0x2a'),'ignore':![]},{'name':_0xf34a('0x2b'),'value':'internal','ignore':![]}];var _0x377783=_(_0x1deb62)[_0xf34a('0x2c')](_0xf34a('0x2d'))[_0xf34a('0x2e')](_0xf34a('0x2f'))[_0xf34a('0x2f')]();if(_[_0xf34a('0x30')](_0x377783,_0x154005['type'])){return;}var _0x35cd86=_[_0xf34a('0x31')](_0x1deb62,[_0xf34a('0x2f'),_0x154005[_0xf34a('0x32')]])[_0xf34a('0x33')];return db['UserProfileResource']['destroy']({'where':{'type':_0x35cd86,'resourceId':_0x154005['id']}})[_0xf34a('0x24')](function(){return _0x2d131c;});})[_0xf34a('0x24')](function(){_0x758a3f[_0xf34a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x789ec1,_0xa119fd){return function(_0x35d66a){if(!_0x35d66a){_0x789ec1[_0xf34a('0x34')](0x194);}return _0x35d66a;};}function handleError(_0x32e368,_0x3ef597){_0x3ef597=_0x3ef597||0x1f4;return function(_0x2d4ecd){logger[_0xf34a('0x35')](_0x2d4ecd['stack']);if(_0x2d4ecd[_0xf34a('0x33')]){delete _0x2d4ecd[_0xf34a('0x33')];}_0x32e368[_0xf34a('0x19')](_0x3ef597)[_0xf34a('0x36')](_0x2d4ecd);};}exports[_0xf34a('0x37')]=function(_0x5cc124,_0x68e425){var _0xe536f0={},_0x2bda85={},_0x2d1676={'count':0x0,'rows':[]};var _0x225924=_[_0xf34a('0x2e')](db['VoiceExtension'][_0xf34a('0x38')],function(_0x180e11){return{'name':_0x180e11[_0xf34a('0x39')],'type':_0x180e11['type'][_0xf34a('0x3a')]};});_0x2bda85['model']=_[_0xf34a('0x2e')](_0x225924,_0xf34a('0x33'));_0x2bda85['query']=_[_0xf34a('0x3b')](_0x5cc124[_0xf34a('0x3c')]);_0x2bda85[_0xf34a('0x3d')]=_[_0xf34a('0x3e')](_0x2bda85['model'],_0x2bda85['query']);_0xe536f0[_0xf34a('0x3f')]=_[_0xf34a('0x3e')](_0x2bda85[_0xf34a('0x40')],qs['fields'](_0x5cc124[_0xf34a('0x3c')][_0xf34a('0x41')]));_0xe536f0['attributes']=_0xe536f0['attributes']['length']?_0xe536f0[_0xf34a('0x3f')]:_0x2bda85[_0xf34a('0x40')];if(!_0x5cc124[_0xf34a('0x3c')]['hasOwnProperty'](_0xf34a('0x42'))){_0xe536f0[_0xf34a('0x1c')]=qs[_0xf34a('0x1c')](_0x5cc124[_0xf34a('0x3c')][_0xf34a('0x1c')]);_0xe536f0[_0xf34a('0x1a')]=qs[_0xf34a('0x1a')](_0x5cc124['query'][_0xf34a('0x1a')]);}_0xe536f0['order']=qs['sort'](_0x5cc124[_0xf34a('0x3c')][_0xf34a('0x43')]);_0xe536f0[_0xf34a('0x44')]=qs['filters'](_[_0xf34a('0x45')](_0x5cc124[_0xf34a('0x3c')],_0x2bda85['filters']),_0x225924);if(_0x5cc124[_0xf34a('0x3c')][_0xf34a('0x2c')]){_0xe536f0[_0xf34a('0x44')]=_[_0xf34a('0x46')](_0xe536f0[_0xf34a('0x44')],{'$or':_['map'](_0x225924,function(_0x3428a7){if(_0x3428a7[_0xf34a('0x32')]!==_0xf34a('0x47')){var _0x1966c9={};_0x1966c9[_0x3428a7[_0xf34a('0x33')]]={'$like':'%'+_0x5cc124['query'][_0xf34a('0x2c')]+'%'};return _0x1966c9;}})});}_0xe536f0=_[_0xf34a('0x46')]({},_0xe536f0,_0x5cc124[_0xf34a('0x48')]);var _0x4329c9={'where':_0xe536f0[_0xf34a('0x44')]};return db[_0xf34a('0x49')][_0xf34a('0x1d')](_0x4329c9)[_0xf34a('0x24')](function(_0x3503e1){_0x2d1676['count']=_0x3503e1;if(_0x5cc124['query']['includeAll']){_0xe536f0[_0xf34a('0x4a')]=[{'all':!![]}];}return db[_0xf34a('0x49')][_0xf34a('0x4b')](_0xe536f0);})[_0xf34a('0x24')](function(_0x3489f5){_0x2d1676[_0xf34a('0x4c')]=_0x3489f5;return _0x2d1676;})[_0xf34a('0x24')](respondWithFilteredResult(_0x68e425,_0xe536f0))[_0xf34a('0x4d')](handleError(_0x68e425,null));};exports['show']=function(_0x10f86d,_0x11fc58){var _0x33066a={'raw':![],'where':{'id':_0x10f86d[_0xf34a('0x4e')]['id']}},_0x1c0207={};_0x1c0207['model']=_[_0xf34a('0x3b')](db['VoiceExtension'][_0xf34a('0x38')]);_0x1c0207[_0xf34a('0x3c')]=_[_0xf34a('0x3b')](_0x10f86d['query']);_0x1c0207[_0xf34a('0x3d')]=_[_0xf34a('0x3e')](_0x1c0207[_0xf34a('0x40')],_0x1c0207[_0xf34a('0x3c')]);_0x33066a['attributes']=_[_0xf34a('0x3e')](_0x1c0207['model'],qs[_0xf34a('0x41')](_0x10f86d[_0xf34a('0x3c')][_0xf34a('0x41')]));_0x33066a['attributes']=_0x33066a[_0xf34a('0x3f')][_0xf34a('0x4f')]?_0x33066a['attributes']:_0x1c0207[_0xf34a('0x40')];if(_0x10f86d[_0xf34a('0x3c')][_0xf34a('0x50')]){_0x33066a[_0xf34a('0x4a')]=[{'all':!![]}];}_0x33066a=_[_0xf34a('0x46')]({},_0x33066a,_0x10f86d[_0xf34a('0x48')]);return db['VoiceExtension'][_0xf34a('0x31')](_0x33066a)[_0xf34a('0x24')](handleEntityNotFound(_0x11fc58,null))[_0xf34a('0x24')](respondWithResult(_0x11fc58,null))[_0xf34a('0x4d')](handleError(_0x11fc58,null));};exports['destroy']=function(_0x35dd51,_0x2dafc7){return db[_0xf34a('0x49')][_0xf34a('0x31')]({'where':{'id':_0x35dd51[_0xf34a('0x4e')]['id']}})[_0xf34a('0x24')](handleEntityNotFound(_0x2dafc7,null))[_0xf34a('0x24')](removeEntity(_0x2dafc7,null))[_0xf34a('0x4d')](handleError(_0x2dafc7,null));};exports[_0xf34a('0x51')]=function(_0x43eb8a,_0x36bbba){if(_0x43eb8a[_0xf34a('0x52')][_0xf34a('0x32')]===_0xf34a('0x2a')&&!_['startsWith'](_0x43eb8a['body'][_0xf34a('0x53')],'_')){_0x43eb8a['body']['exten']='_'[_0xf34a('0x54')](_0x43eb8a['body'][_0xf34a('0x53')]);}return db[_0xf34a('0x49')][_0xf34a('0x51')](_0x43eb8a[_0xf34a('0x52')],{'raw':![]})['then'](function(_0x21b988){var _0x320072=_0x43eb8a['user'][_0xf34a('0x26')]({'plain':!![]});if(!_0x320072)throw new Error(_0xf34a('0x55'));if(_0x320072[_0xf34a('0x56')]===_0xf34a('0x57')){var _0x3a8692=_0x21b988[_0xf34a('0x26')]({'plain':!![]});var _0x492975=[{'name':'InboundRoutes','value':_0xf34a('0x28')},{'name':_0xf34a('0x29'),'value':_0xf34a('0x2a')},{'name':_0xf34a('0x2b'),'value':_0xf34a('0x58')}];var _0x402f06=_[_0xf34a('0x31')](_0x492975,[_0xf34a('0x2f'),_0x3a8692[_0xf34a('0x32')]])[_0xf34a('0x33')];return db[_0xf34a('0x59')][_0xf34a('0x31')]({'where':{'name':_0x402f06,'userProfileId':_0x320072[_0xf34a('0x5a')]},'raw':!![]})[_0xf34a('0x24')](function(_0x2d9215){if(_0x2d9215&&_0x2d9215[_0xf34a('0x5b')]===0x0){return db[_0xf34a('0x5c')]['create']({'name':_0x3a8692[_0xf34a('0x33')],'resourceId':_0x3a8692['id'],'type':_0x2d9215[_0xf34a('0x33')],'sectionId':_0x2d9215['id']},{})[_0xf34a('0x24')](function(){return _0x21b988;});}else{return _0x21b988;}})['catch'](function(_0x5236da){logger[_0xf34a('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5236da);throw _0x5236da;});}return _0x21b988;})['then'](respondWithResult(_0x36bbba,0xc9))['catch'](handleError(_0x36bbba,null));};exports[_0xf34a('0x23')]=function(_0x5eae96,_0x267177){if(_0x5eae96['body']['id']){delete _0x5eae96[_0xf34a('0x52')]['id'];}return db[_0xf34a('0x49')][_0xf34a('0x31')]({'where':{'id':_0x5eae96[_0xf34a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x267177,null))[_0xf34a('0x24')](function(_0x3d5b8c){if(_0x3d5b8c){return db['VoiceExtension'][_0xf34a('0x23')](_[_0xf34a('0x45')](_0x5eae96['body'],[_0xf34a('0x53'),'context',_0xf34a('0x5d'),'recordingFormat',_0xf34a('0x5e'),_0xf34a('0x5f'),_0xf34a('0x60')]),{'where':{'context':_0x3d5b8c[_0xf34a('0x61')],'exten':_0x3d5b8c[_0xf34a('0x53')]},'individualHooks':!![]})['then'](function(_0x516f34){return _0x516f34;});}return null;})[_0xf34a('0x24')](respondWithStatusCode(_0x267177,null))['catch'](handleError(_0x267177,null));};exports[_0xf34a('0x62')]=function(_0x740bff,_0x4c2cd7){return db[_0xf34a('0x49')][_0xf34a('0x63')]({'where':{'id':_0x740bff['params']['id']}})[_0xf34a('0x24')](function(_0x357f86){if(_0x357f86){return db[_0xf34a('0x64')][_0xf34a('0x65')](function(_0x170d3f){return db[_0xf34a('0x49')][_0xf34a('0x25')]({'where':{'VoiceExtensionId':_0x740bff['params']['id']},'transaction':_0x170d3f})[_0xf34a('0x24')](function(){var _0x516fec=_[_0xf34a('0x2e')](_0x740bff[_0xf34a('0x52')],function(_0x423d82){_0x423d82[_0xf34a('0x66')]=_0x740bff[_0xf34a('0x4e')]['id'];_0x423d82[_0xf34a('0x67')]=!![];return _0x423d82;});var _0x17a3c4=_0x740bff[_0xf34a('0x3c')]['rewriteDial']&&_0x740bff[_0xf34a('0x3c')]['rewriteDial']['toLowerCase']()===_0xf34a('0x68')?!![]:![];return _0x357f86[_0xf34a('0x69')](_0x516fec,_0x17a3c4);})[_0xf34a('0x24')](function(_0x572faa){return db[_0xf34a('0x49')]['bulkCreate'](_0x572faa,{'transaction':_0x170d3f});});})['then'](function(){return db[_0xf34a('0x49')][_0xf34a('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x740bff[_0xf34a('0x4e')]['id']},'order':_0xf34a('0x6b')});});}})['then'](respondWithResult(_0x4c2cd7,null))[_0xf34a('0x4d')](handleError(_0x4c2cd7,null));};
\ No newline at end of file
index 0010209..0da57ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f67=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','update','remove'];(function(_0x1a1e8c,_0x3d2df3){var _0x29b0c9=function(_0xb4f77e){while(--_0xb4f77e){_0x1a1e8c['push'](_0x1a1e8c['shift']());}};_0x29b0c9(++_0x3d2df3);}(_0x9f67,0x11b));var _0x79f6=function(_0x5245ab,_0x469723){_0x5245ab=_0x5245ab-0x0;var _0x247dc8=_0x9f67[_0x5245ab];return _0x247dc8;};'use strict';var EventEmitter=require(_0x79f6('0x0'));var VoiceExtension=require(_0x79f6('0x1'))['db'][_0x79f6('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x79f6('0x3'),'afterDestroy':_0x79f6('0x4')};function emitEvent(_0x8595bd){return function(_0x3d41cc,_0xb5be25,_0x12b847){VoiceExtensionEvents[_0x79f6('0x5')](_0x8595bd+':'+_0x3d41cc['id'],_0x3d41cc);VoiceExtensionEvents['emit'](_0x8595bd,_0x3d41cc);_0x12b847(null);};}for(var e in events){if(events[_0x79f6('0x6')](e)){var event=events[e];VoiceExtension[_0x79f6('0x7')](e,emitEvent(event));}}module[_0x79f6('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x1373=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','emit'];(function(_0xe18a03,_0x34d03c){var _0x5a56e4=function(_0x278508){while(--_0x278508){_0xe18a03['push'](_0xe18a03['shift']());}};_0x5a56e4(++_0x34d03c);}(_0x1373,0x139));var _0x3137=function(_0x57ad68,_0x4a2577){_0x57ad68=_0x57ad68-0x0;var _0x1158dd=_0x1373[_0x57ad68];return _0x1158dd;};'use strict';var EventEmitter=require(_0x3137('0x0'));var VoiceExtension=require(_0x3137('0x1'))['db'][_0x3137('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x3137('0x3')](0x0);var events={'afterCreate':_0x3137('0x4'),'afterUpdate':_0x3137('0x5'),'afterDestroy':'remove'};function emitEvent(_0xcb2bd0){return function(_0x5c13f2,_0x3c51e7,_0x3a71c2){VoiceExtensionEvents[_0x3137('0x6')](_0xcb2bd0+':'+_0x5c13f2['id'],_0x5c13f2);VoiceExtensionEvents[_0x3137('0x6')](_0xcb2bd0,_0x5c13f2);_0x3a71c2(null);};}for(var e in events){if(events[_0x3137('0x7')](e)){var event=events[e];VoiceExtension[_0x3137('0x8')](e,emitEvent(event));}}module[_0x3137('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
index 05912a4..3101468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc026=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','voice_extensions','Hangup','util','lodash','./voiceExtension.attributes','models','type','CDR(type)=','context','exten','Set','NoOp','alias','CDR(routeAlias)=','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','${EXTEN:','cutdigits','${EXTEN}','ExecIf','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','options','split','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x285ae2,_0x47d83c){var _0x653ee8=function(_0x284d45){while(--_0x284d45){_0x285ae2['push'](_0x285ae2['shift']());}};_0x653ee8(++_0x47d83c);}(_0xc026,0x154));var _0x6c02=function(_0x5cacd6,_0x28cec1){_0x5cacd6=_0x5cacd6-0x0;var _0x2f85d6=_0xc026[_0x5cacd6];return _0x2f85d6;};'use strict';var util=require(_0x6c02('0x0'));var _=require(_0x6c02('0x1'));var attributes=require(_0x6c02('0x2'));module['exports']=function(_0x38bdb1){var _0x41f3da=_0x38bdb1[_0x6c02('0x3')];function _0x4c0e02(_0x47d89a){var _0x217846=0x2;var _0xfe61df=[{'type':_0x47d89a[_0x6c02('0x4')],'app':'Set','appdata':_0x6c02('0x5')+_0x47d89a[_0x6c02('0x4')],'context':_0x47d89a[_0x6c02('0x6')],'exten':_0x47d89a[_0x6c02('0x7')],'priority':_0x217846++,'VoiceExtensionId':_0x47d89a['id']},{'type':_0x47d89a[_0x6c02('0x4')],'app':_0x47d89a['alias']?_0x6c02('0x8'):_0x6c02('0x9'),'appdata':_0x47d89a[_0x6c02('0xa')]?_0x6c02('0xb')+_0x47d89a['alias']:'No\x20alias\x20set','context':_0x47d89a[_0x6c02('0x6')],'exten':_0x47d89a['exten'],'priority':_0x217846++,'VoiceExtensionId':_0x47d89a['id']}];if(_0x47d89a['type']===_0x6c02('0xc')){_0xfe61df['push']({'type':_0x6c02('0xc'),'app':'Set','appdata':_0x6c02('0xd')+_0x47d89a['id'],'context':_0x47d89a[_0x6c02('0x6')],'exten':_0x47d89a[_0x6c02('0x7')],'priority':_0x217846++,'VoiceExtensionId':_0x47d89a['id']});}_0xfe61df[_0x6c02('0xe')]({'type':_0x47d89a[_0x6c02('0x4')],'app':_0x6c02('0x8'),'appdata':_0x6c02('0xf'),'context':_0x47d89a['context'],'exten':_0x47d89a['exten'],'priority':_0x217846++,'VoiceExtensionId':_0x47d89a['id']},{'type':_0x47d89a['type'],'app':_0x6c02('0x8'),'appdata':_0x6c02('0x10'),'context':_0x47d89a[_0x6c02('0x6')],'exten':_0x47d89a['exten'],'priority':_0x217846++,'VoiceExtensionId':_0x47d89a['id']},{'type':_0x47d89a[_0x6c02('0x4')],'app':_0x6c02('0x8'),'appdata':_0x6c02('0x11'),'context':_0x47d89a[_0x6c02('0x6')],'exten':_0x47d89a[_0x6c02('0x7')],'priority':_0x217846++,'VoiceExtensionId':_0x47d89a['id']});return _0xfe61df;}function _0x2cde36(_0x109976){var _0x1255e6=0x2;var _0x54dd53=[{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':'CDR(type)=outbound','context':_0x109976['context'],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x109976[_0x6c02('0xa')]?_0x6c02('0x8'):_0x6c02('0x9'),'appdata':_0x109976['alias']?_0x6c02('0xb')+_0x109976['alias']:'No\x20alias\x20set','context':_0x109976['context'],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':'CDR(destination)='+(_0x109976['cutdigits']?_0x6c02('0x13')+_0x109976[_0x6c02('0x14')]+'}':_0x6c02('0x15')),'context':_0x109976['context'],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':_0x6c02('0xd')+_0x109976['id'],'context':_0x109976[_0x6c02('0x6')],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1255e6+0x2)+'):Goto('+(_0x1255e6+0x1)+')','context':_0x109976[_0x6c02('0x6')],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':_0x109976[_0x6c02('0x14')]?_0x6c02('0x17')+_0x109976[_0x6c02('0x14')]+'}':'CDR(prefix)=noprefix','context':_0x109976[_0x6c02('0x6')],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':_0x6c02('0xf'),'context':_0x109976[_0x6c02('0x6')],'exten':_0x109976['exten'],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':'outbound','app':'Set','appdata':_0x6c02('0x10'),'context':_0x109976[_0x6c02('0x6')],'exten':_0x109976['exten'],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':'outbound','app':_0x6c02('0x8'),'appdata':_0x6c02('0x11'),'context':_0x109976['context'],'exten':_0x109976['exten'],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':_0x6c02('0x18')+_0x109976['id'],'context':_0x109976['context'],'exten':_0x109976['exten'],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']}];if(_0x109976[_0x6c02('0x19')](_0x6c02('0x1a'))&&_0x109976[_0x6c02('0x1a')]!==_0x6c02('0x1b')){_0x54dd53[_0x6c02('0xe')]({'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x109976[_0x6c02('0x6')],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']},{'type':_0x6c02('0x12'),'app':_0x6c02('0x8'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x109976['recordingFormat']||_0x6c02('0x1c'),'context':_0x109976['context'],'exten':_0x109976[_0x6c02('0x7')],'priority':_0x1255e6++,'VoiceExtensionId':_0x109976['id']});}return _0x54dd53;}function _0x410002(_0x535a53){var _0xeb03b4=[{'name':_0x6c02('0x1d'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x6c02('0x1e'),'param':0x2},{'name':'url','param':0x3}];var _0x3fc80d={};var _0x3d0143=_0x535a53[_0x6c02('0x1f')](',');var _0x4e65d2=[];for(var _0x2165f5=0x0;_0x2165f5<_0xeb03b4['length'];_0x2165f5++){switch(_0xeb03b4[_0x2165f5][_0x6c02('0x20')]){case _0x6c02('0x1d'):_0x3fc80d['trunk']=_0x3d0143[_0xeb03b4[_0x2165f5][_0x6c02('0x21')]][_0x6c02('0x1f')]('/')[0x1];_0x3fc80d[_0x6c02('0x22')]=_0x3d0143[_0xeb03b4[_0x2165f5][_0x6c02('0x21')]][_0x6c02('0x1f')]('/')[0x2];_0x3fc80d[_0x6c02('0x23')]=_0x3fc80d[_0x6c02('0x22')]?_0x3fc80d[_0x6c02('0x22')]['split']('$')[0x0]:undefined;_0x3fc80d[_0x6c02('0x22')]=route[_0x6c02('0x14')]?(_0x3fc80d[_0x6c02('0x23')]||'')+'${EXTEN:'+route[_0x6c02('0x14')]+'}':(_0x3fc80d[_0x6c02('0x23')]||'')+'${EXTEN}';_0x4e65d2[_0xeb03b4[_0x2165f5]['param']]=[_0x6c02('0x24'),_0x3fc80d['trunk'],_0x3fc80d['phone']][_0x6c02('0x25')]('/');break;case _0x6c02('0x1e'):_0x3fc80d['options']=_0x3d0143[_0xeb03b4[_0x2165f5][_0x6c02('0x21')]];if(route[_0x6c02('0x1a')]!==_0x6c02('0x1b')){if(_0x3fc80d[_0x6c02('0x1e')][_0x6c02('0x26')](_0x6c02('0x27'))<0x0){_0x3fc80d['options']+=_0x6c02('0x27');}}else{_0x3fc80d[_0x6c02('0x1e')]=_0x3fc80d['options']['replace'](_0x6c02('0x27'),'');}_0x4e65d2[_0xeb03b4[_0x2165f5][_0x6c02('0x21')]]=_0x3fc80d[_0x6c02('0x1e')];break;default:_0x4e65d2[_0xeb03b4[_0x2165f5][_0x6c02('0x21')]]=_0x3d0143[_0xeb03b4[_0x2165f5][_0x6c02('0x21')]];}}return _0x4e65d2[_0x6c02('0x25')](',');}function _0x5f2919(_0x28fac2,_0x318e99,_0x342c9b,_0x1a4ab2){return new Promise(function(_0x2c22d7,_0x2a00bc){var _0x5285c0=[];if(_[_0x6c02('0x28')](_0x318e99))return _0x2c22d7(_0x5285c0);_0x41f3da[_0x6c02('0x29')][_0x6c02('0x2a')]({'attributes':['id',_0x6c02('0x2b'),_0x6c02('0x2c')],'raw':!![]})[_0x6c02('0x2d')](function(_0x3300cb){for(var _0x511ab6=0x0,_0x1b27db=0x0;_0x511ab6<_0x318e99[_0x6c02('0x2e')];_0x511ab6++,_0x1b27db=0x0){var _0x29d60e=_0x318e99[_0x511ab6];var _0x1f6259=[];var _0x1847a5=[];if(_0x29d60e['interval']!==_0x6c02('0x2f')){_0x29d60e['intervals']=[_0x29d60e[_0x6c02('0x2b')]];}else{_0x29d60e[_0x6c02('0x30')]=_0x29d60e[_0x6c02('0x2c')]?_[_0x6c02('0x31')](_[_0x6c02('0x32')](_0x3300cb,{'IntervalId':_0x29d60e[_0x6c02('0x2c')]}),_0x6c02('0x2b')):[];}_0x29d60e[_0x6c02('0x6')]=_0x28fac2['context'];_0x29d60e['exten']=_0x28fac2[_0x6c02('0x7')];if(_0x29d60e[_0x6c02('0x4')])_0x29d60e[_0x6c02('0x4')]=_0x29d60e[_0x6c02('0x4')][_0x6c02('0x33')]();if(_0x28fac2['type']===_0x6c02('0x12')){if(_0x29d60e[_0x6c02('0x19')]('tag')&&_0x29d60e[_0x6c02('0x34')]&&_0x29d60e[_0x6c02('0x34')]!=='--'){_0x1f6259['push']({'type':_0x29d60e[_0x6c02('0x4')][_0x6c02('0x33')](),'app':_0x6c02('0x8'),'appdata':'CDR(tag)='+_0x29d60e[_0x6c02('0x34')],'context':_0x28fac2[_0x6c02('0x6')],'exten':_0x28fac2[_0x6c02('0x7')],'priority':_0x29d60e[_0x6c02('0x30')][_0x6c02('0x2e')]+_0x342c9b+_0x1b27db++,'VoiceExtensionId':_0x28fac2['id']});}_0x1f6259['push']({'type':_0x29d60e[_0x6c02('0x4')][_0x6c02('0x33')](),'app':_0x6c02('0x16'),'appdata':_0x6c02('0x35')+(_0x29d60e[_0x6c02('0x36')]?_0x6c02('0x37')+_0x29d60e[_0x6c02('0x36')]+')':_0x6c02('0x38')),'context':_0x28fac2[_0x6c02('0x6')],'exten':_0x28fac2['exten'],'priority':_0x29d60e['intervals'][_0x6c02('0x2e')]+_0x342c9b+_0x1b27db++,'VoiceExtensionId':_0x28fac2['id']});}else{if(_0x29d60e[_0x6c02('0x19')]('answer')){if([_0x6c02('0x39'),_0x6c02('0x3a')][_0x6c02('0x3b')](_0x29d60e[_0x6c02('0x3c')][_0x6c02('0x33')]())&&_0x29d60e['appType']!==_0x6c02('0x3d')){if(_0x29d60e[_0x6c02('0x3e')]){_0x1f6259[_0x6c02('0xe')]({'type':_0x29d60e['type'][_0x6c02('0x33')](),'app':_0x6c02('0x16'),'appdata':_0x6c02('0x3f'),'context':_0x28fac2[_0x6c02('0x6')],'exten':_0x28fac2[_0x6c02('0x7')],'priority':_0x29d60e[_0x6c02('0x30')][_0x6c02('0x2e')]+_0x342c9b+_0x1b27db++,'VoiceExtensionId':_0x28fac2['id']});_0x1f6259[_0x6c02('0xe')]({'type':_0x29d60e['type'][_0x6c02('0x33')](),'app':'Set','appdata':_0x6c02('0x40'),'context':_0x28fac2['context'],'exten':_0x28fac2[_0x6c02('0x7')],'priority':_0x29d60e[_0x6c02('0x30')]['length']+_0x342c9b+_0x1b27db++,'VoiceExtensionId':_0x28fac2['id']});}else{_0x1f6259[_0x6c02('0xe')]({'type':_0x29d60e['type'][_0x6c02('0x33')](),'app':'ExecIf','appdata':_0x6c02('0x41'),'context':_0x28fac2[_0x6c02('0x6')],'exten':_0x28fac2[_0x6c02('0x7')],'priority':_0x29d60e[_0x6c02('0x30')][_0x6c02('0x2e')]+_0x342c9b+_0x1b27db++,'VoiceExtensionId':_0x28fac2['id']});_0x1f6259['push']({'type':_0x29d60e[_0x6c02('0x4')][_0x6c02('0x33')](),'app':'Set','appdata':_0x6c02('0x42'),'context':_0x28fac2[_0x6c02('0x6')],'exten':_0x28fac2['exten'],'priority':_0x29d60e[_0x6c02('0x30')][_0x6c02('0x2e')]+_0x342c9b+_0x1b27db++,'VoiceExtensionId':_0x28fac2['id']});}}}}for(var _0x45f9de=0x0;_0x45f9de<_0x29d60e['intervals'][_0x6c02('0x2e')];_0x45f9de++){var _0x21fd68=_0x342c9b+_0x29d60e['intervals'][_0x6c02('0x2e')];var _0x175e95=_0x45f9de===_0x29d60e[_0x6c02('0x30')]['length']-0x1?_0x342c9b+_0x1f6259[_0x6c02('0x2e')]+_0x1847a5['length']+0x2:_0x342c9b+_0x45f9de+0x1;_0x1f6259[_0x6c02('0x43')](_0x45f9de,0x0,{'type':_0x28fac2[_0x6c02('0x4')],'app':_0x6c02('0x44'),'appdata':_0x29d60e[_0x6c02('0x30')][_0x45f9de]+'?'+_0x28fac2['context']+_0x6c02('0x45')+_0x21fd68+':'+_0x28fac2['context']+_0x6c02('0x45')+_0x175e95,'exten':_0x28fac2['exten'],'context':_0x28fac2[_0x6c02('0x6')],'priority':_0x342c9b+_0x45f9de,'VoiceExtensionId':_0x28fac2['id']});}if(_0x1a4ab2&&_0x29d60e[_0x6c02('0x46')]===_0x6c02('0x47'))_0x29d60e[_0x6c02('0x48')]=_0x410002(_0x29d60e['appdata']);_0x29d60e['priority']=_0x1f6259[_0x6c02('0x2e')]?_[_0x6c02('0x49')](_0x1f6259)[_0x6c02('0x4a')]+0x1:_0x342c9b;_0x5285c0=_[_0x6c02('0x4b')](_0x5285c0,_0x1f6259,[_0x29d60e],_0x1847a5);_0x342c9b=_['last'](_0x5285c0)[_0x6c02('0x4a')]+0x1;}return _0x2c22d7(_0x5285c0);})[_0x6c02('0x4c')](function(_0x3acb2a){_0x2a00bc(_0x3acb2a);});});}return _0x38bdb1[_0x6c02('0x4d')](_0x6c02('0x4e'),attributes,{'tableName':_0x6c02('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3f5029,_0x218495){var _0x21b54f=this;var _0xfc7a9b=_0x21b54f[_0x6c02('0x4')]===_0x6c02('0x12')?_0x2cde36(_0x21b54f):_0x4c0e02(_0x21b54f);return _0x5f2919(_0x21b54f,_0x3f5029,_[_0x6c02('0x49')](_0xfc7a9b)[_0x6c02('0x4a')]+0x1,_0x218495)['then'](function(_0x462919){var _0x1257af=_[_0x6c02('0x4b')](_0xfc7a9b,_0x462919);_0x1257af[_0x6c02('0xe')]({'type':_0x21b54f['type'],'app':_0x6c02('0x50'),'exten':_0x21b54f['exten'],'context':_0x21b54f[_0x6c02('0x6')],'priority':_[_0x6c02('0x49')](_0x1257af)[_0x6c02('0x4a')]+0x1,'VoiceExtensionId':_0x21b54f['id']});return _0x1257af;});}}});};
\ No newline at end of file
+var _0x4905=['push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','trunk','timeout','options','url','length','param','split','phone','prefix','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','playback','includes','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','define','Hangup','util','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound'];(function(_0x505a7d,_0x25e11f){var _0x17d880=function(_0x213c2){while(--_0x213c2){_0x505a7d['push'](_0x505a7d['shift']());}};_0x17d880(++_0x25e11f);}(_0x4905,0x1dd));var _0x5490=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x4905[_0x18cd5b];return _0x5eaa52;};'use strict';var util=require(_0x5490('0x0'));var _=require(_0x5490('0x1'));var attributes=require(_0x5490('0x2'));module[_0x5490('0x3')]=function(_0xccc9d6){var _0x105bc4=_0xccc9d6[_0x5490('0x4')];function _0x3b611b(_0x1481d6){var _0x3ee948=0x2;var _0x517755=[{'type':_0x1481d6[_0x5490('0x5')],'app':_0x5490('0x6'),'appdata':_0x5490('0x7')+_0x1481d6[_0x5490('0x5')],'context':_0x1481d6['context'],'exten':_0x1481d6[_0x5490('0x8')],'priority':_0x3ee948++,'VoiceExtensionId':_0x1481d6['id']},{'type':_0x1481d6['type'],'app':_0x1481d6[_0x5490('0x9')]?'Set':_0x5490('0xa'),'appdata':_0x1481d6[_0x5490('0x9')]?_0x5490('0xb')+_0x1481d6[_0x5490('0x9')]:_0x5490('0xc'),'context':_0x1481d6[_0x5490('0xd')],'exten':_0x1481d6['exten'],'priority':_0x3ee948++,'VoiceExtensionId':_0x1481d6['id']}];if(_0x1481d6[_0x5490('0x5')]===_0x5490('0xe')){_0x517755[_0x5490('0xf')]({'type':'inbound','app':_0x5490('0x6'),'appdata':_0x5490('0x10')+_0x1481d6['id'],'context':_0x1481d6[_0x5490('0xd')],'exten':_0x1481d6[_0x5490('0x8')],'priority':_0x3ee948++,'VoiceExtensionId':_0x1481d6['id']});}_0x517755['push']({'type':_0x1481d6[_0x5490('0x5')],'app':_0x5490('0x6'),'appdata':_0x5490('0x11'),'context':_0x1481d6[_0x5490('0xd')],'exten':_0x1481d6[_0x5490('0x8')],'priority':_0x3ee948++,'VoiceExtensionId':_0x1481d6['id']},{'type':_0x1481d6[_0x5490('0x5')],'app':_0x5490('0x6'),'appdata':_0x5490('0x12'),'context':_0x1481d6[_0x5490('0xd')],'exten':_0x1481d6[_0x5490('0x8')],'priority':_0x3ee948++,'VoiceExtensionId':_0x1481d6['id']},{'type':_0x1481d6[_0x5490('0x5')],'app':_0x5490('0x6'),'appdata':_0x5490('0x13'),'context':_0x1481d6[_0x5490('0xd')],'exten':_0x1481d6[_0x5490('0x8')],'priority':_0x3ee948++,'VoiceExtensionId':_0x1481d6['id']});return _0x517755;}function _0x20c760(_0xe83865){var _0x2f6bbe=0x2;var _0xae682f=[{'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':_0x5490('0x15'),'context':_0xe83865['context'],'exten':_0xe83865['exten'],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':'outbound','app':_0xe83865[_0x5490('0x9')]?_0x5490('0x6'):_0x5490('0xa'),'appdata':_0xe83865['alias']?_0x5490('0xb')+_0xe83865['alias']:_0x5490('0xc'),'context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':_0x5490('0x16')+(_0xe83865[_0x5490('0x17')]?_0x5490('0x18')+_0xe83865['cutdigits']+'}':'${EXTEN}'),'context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':'CDR(routeid)='+_0xe83865['id'],'context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':_0x5490('0x19'),'appdata':_0x5490('0x1a')+(_0x2f6bbe+0x2)+'):Goto('+(_0x2f6bbe+0x1)+')','context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':'Set','appdata':_0xe83865[_0x5490('0x17')]?_0x5490('0x1b')+_0xe83865['cutdigits']+'}':_0x5490('0x1c'),'context':_0xe83865['context'],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':'Set','appdata':_0x5490('0x11'),'context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865['exten'],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':_0x5490('0x12'),'context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':_0x5490('0x13'),'context':_0xe83865['context'],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':'Set','appdata':_0x5490('0x1d')+_0xe83865['id'],'context':_0xe83865['context'],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']}];if(_0xe83865[_0x5490('0x1e')]('recordingFormat')&&_0xe83865['recordingFormat']!==_0x5490('0x1f')){_0xae682f[_0x5490('0xf')]({'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xe83865['context'],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']},{'type':_0x5490('0x14'),'app':_0x5490('0x6'),'appdata':_0x5490('0x20')+_0xe83865[_0x5490('0x21')]||_0x5490('0x22'),'context':_0xe83865[_0x5490('0xd')],'exten':_0xe83865[_0x5490('0x8')],'priority':_0x2f6bbe++,'VoiceExtensionId':_0xe83865['id']});}return _0xae682f;}function _0x7ae656(_0x1ccd28){var _0x540aab=[{'name':_0x5490('0x23'),'param':0x0},{'name':_0x5490('0x24'),'param':0x1},{'name':_0x5490('0x25'),'param':0x2},{'name':_0x5490('0x26'),'param':0x3}];var _0x6a8a2e={};var _0xec8cb7=_0x1ccd28['split'](',');var _0x2a7cd0=[];for(var _0x8f497a=0x0;_0x8f497a<_0x540aab[_0x5490('0x27')];_0x8f497a++){switch(_0x540aab[_0x8f497a]['name']){case _0x5490('0x23'):_0x6a8a2e[_0x5490('0x23')]=_0xec8cb7[_0x540aab[_0x8f497a][_0x5490('0x28')]][_0x5490('0x29')]('/')[0x1];_0x6a8a2e[_0x5490('0x2a')]=_0xec8cb7[_0x540aab[_0x8f497a][_0x5490('0x28')]]['split']('/')[0x2];_0x6a8a2e[_0x5490('0x2b')]=_0x6a8a2e[_0x5490('0x2a')]?_0x6a8a2e['phone']['split']('$')[0x0]:undefined;_0x6a8a2e[_0x5490('0x2a')]=route[_0x5490('0x17')]?(_0x6a8a2e[_0x5490('0x2b')]||'')+_0x5490('0x18')+route[_0x5490('0x17')]+'}':(_0x6a8a2e[_0x5490('0x2b')]||'')+_0x5490('0x2c');_0x2a7cd0[_0x540aab[_0x8f497a][_0x5490('0x28')]]=[_0x5490('0x2d'),_0x6a8a2e[_0x5490('0x23')],_0x6a8a2e['phone']][_0x5490('0x2e')]('/');break;case _0x5490('0x25'):_0x6a8a2e[_0x5490('0x25')]=_0xec8cb7[_0x540aab[_0x8f497a][_0x5490('0x28')]];if(route['recordingFormat']!==_0x5490('0x1f')){if(_0x6a8a2e[_0x5490('0x25')][_0x5490('0x2f')](_0x5490('0x30'))<0x0){_0x6a8a2e[_0x5490('0x25')]+='U(xcally-mixmonitor-context)';}}else{_0x6a8a2e[_0x5490('0x25')]=_0x6a8a2e[_0x5490('0x25')][_0x5490('0x31')]('U(xcally-mixmonitor-context)','');}_0x2a7cd0[_0x540aab[_0x8f497a][_0x5490('0x28')]]=_0x6a8a2e[_0x5490('0x25')];break;default:_0x2a7cd0[_0x540aab[_0x8f497a][_0x5490('0x28')]]=_0xec8cb7[_0x540aab[_0x8f497a][_0x5490('0x28')]];}}return _0x2a7cd0['join'](',');}function _0x33f4ef(_0xab7a7a,_0x44fc04,_0x2fe5ee,_0x1981c2){return new Promise(function(_0x20b97c,_0x2aa245){var _0x385e80=[];if(_[_0x5490('0x32')](_0x44fc04))return _0x20b97c(_0x385e80);_0x105bc4[_0x5490('0x33')][_0x5490('0x34')]({'attributes':['id',_0x5490('0x35'),_0x5490('0x36')],'raw':!![]})[_0x5490('0x37')](function(_0x139996){for(var _0x59d260=0x0,_0x4b4f3d=0x0;_0x59d260<_0x44fc04[_0x5490('0x27')];_0x59d260++,_0x4b4f3d=0x0){var _0x204c9e=_0x44fc04[_0x59d260];var _0x5f4a60=[];var _0x3a8336=[];if(_0x204c9e['interval']!==_0x5490('0x38')){_0x204c9e[_0x5490('0x39')]=[_0x204c9e[_0x5490('0x35')]];}else{_0x204c9e['intervals']=_0x204c9e[_0x5490('0x36')]?_['map'](_['filter'](_0x139996,{'IntervalId':_0x204c9e[_0x5490('0x36')]}),_0x5490('0x35')):[];}_0x204c9e['context']=_0xab7a7a['context'];_0x204c9e[_0x5490('0x8')]=_0xab7a7a[_0x5490('0x8')];if(_0x204c9e[_0x5490('0x5')])_0x204c9e[_0x5490('0x5')]=_0x204c9e[_0x5490('0x5')][_0x5490('0x3a')]();if(_0xab7a7a[_0x5490('0x5')]===_0x5490('0x14')){if(_0x204c9e['hasOwnProperty']('tag')&&_0x204c9e['tag']&&_0x204c9e[_0x5490('0x3b')]!=='--'){_0x5f4a60[_0x5490('0xf')]({'type':_0x204c9e['type'][_0x5490('0x3a')](),'app':_0x5490('0x6'),'appdata':_0x5490('0x3c')+_0x204c9e[_0x5490('0x3b')],'context':_0xab7a7a['context'],'exten':_0xab7a7a[_0x5490('0x8')],'priority':_0x204c9e['intervals'][_0x5490('0x27')]+_0x2fe5ee+_0x4b4f3d++,'VoiceExtensionId':_0xab7a7a['id']});}_0x5f4a60[_0x5490('0xf')]({'type':_0x204c9e['type'][_0x5490('0x3a')](),'app':_0x5490('0x19'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x204c9e['callerID']?_0x5490('0x3d')+_0x204c9e['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0xab7a7a[_0x5490('0xd')],'exten':_0xab7a7a[_0x5490('0x8')],'priority':_0x204c9e[_0x5490('0x39')][_0x5490('0x27')]+_0x2fe5ee+_0x4b4f3d++,'VoiceExtensionId':_0xab7a7a['id']});}else{if(_0x204c9e[_0x5490('0x1e')]('answer')){if(['queue',_0x5490('0x3e')][_0x5490('0x3f')](_0x204c9e[_0x5490('0x40')][_0x5490('0x3a')]())&&_0x204c9e[_0x5490('0x41')]!==_0x5490('0x42')){if(_0x204c9e[_0x5490('0x43')]){_0x5f4a60['push']({'type':_0x204c9e[_0x5490('0x5')]['toLowerCase'](),'app':_0x5490('0x19'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0xab7a7a[_0x5490('0xd')],'exten':_0xab7a7a[_0x5490('0x8')],'priority':_0x204c9e[_0x5490('0x39')][_0x5490('0x27')]+_0x2fe5ee+_0x4b4f3d++,'VoiceExtensionId':_0xab7a7a['id']});_0x5f4a60['push']({'type':_0x204c9e[_0x5490('0x5')][_0x5490('0x3a')](),'app':_0x5490('0x6'),'appdata':_0x5490('0x44'),'context':_0xab7a7a[_0x5490('0xd')],'exten':_0xab7a7a[_0x5490('0x8')],'priority':_0x204c9e['intervals'][_0x5490('0x27')]+_0x2fe5ee+_0x4b4f3d++,'VoiceExtensionId':_0xab7a7a['id']});}else{_0x5f4a60[_0x5490('0xf')]({'type':_0x204c9e[_0x5490('0x5')][_0x5490('0x3a')](),'app':_0x5490('0x19'),'appdata':_0x5490('0x45'),'context':_0xab7a7a['context'],'exten':_0xab7a7a[_0x5490('0x8')],'priority':_0x204c9e[_0x5490('0x39')][_0x5490('0x27')]+_0x2fe5ee+_0x4b4f3d++,'VoiceExtensionId':_0xab7a7a['id']});_0x5f4a60[_0x5490('0xf')]({'type':_0x204c9e[_0x5490('0x5')][_0x5490('0x3a')](),'app':_0x5490('0x6'),'appdata':_0x5490('0x46'),'context':_0xab7a7a['context'],'exten':_0xab7a7a[_0x5490('0x8')],'priority':_0x204c9e[_0x5490('0x39')]['length']+_0x2fe5ee+_0x4b4f3d++,'VoiceExtensionId':_0xab7a7a['id']});}}}}for(var _0x4e89e6=0x0;_0x4e89e6<_0x204c9e[_0x5490('0x39')]['length'];_0x4e89e6++){var _0x4cb4f8=_0x2fe5ee+_0x204c9e[_0x5490('0x39')][_0x5490('0x27')];var _0x318dc7=_0x4e89e6===_0x204c9e[_0x5490('0x39')][_0x5490('0x27')]-0x1?_0x2fe5ee+_0x5f4a60[_0x5490('0x27')]+_0x3a8336[_0x5490('0x27')]+0x2:_0x2fe5ee+_0x4e89e6+0x1;_0x5f4a60[_0x5490('0x47')](_0x4e89e6,0x0,{'type':_0xab7a7a['type'],'app':_0x5490('0x48'),'appdata':_0x204c9e[_0x5490('0x39')][_0x4e89e6]+'?'+_0xab7a7a[_0x5490('0xd')]+',${EXTEN},'+_0x4cb4f8+':'+_0xab7a7a[_0x5490('0xd')]+_0x5490('0x49')+_0x318dc7,'exten':_0xab7a7a[_0x5490('0x8')],'context':_0xab7a7a[_0x5490('0xd')],'priority':_0x2fe5ee+_0x4e89e6,'VoiceExtensionId':_0xab7a7a['id']});}if(_0x1981c2&&_0x204c9e[_0x5490('0x41')]===_0x5490('0x4a'))_0x204c9e[_0x5490('0x4b')]=_0x7ae656(_0x204c9e[_0x5490('0x4b')]);_0x204c9e['priority']=_0x5f4a60[_0x5490('0x27')]?_[_0x5490('0x4c')](_0x5f4a60)[_0x5490('0x4d')]+0x1:_0x2fe5ee;_0x385e80=_[_0x5490('0x4e')](_0x385e80,_0x5f4a60,[_0x204c9e],_0x3a8336);_0x2fe5ee=_[_0x5490('0x4c')](_0x385e80)[_0x5490('0x4d')]+0x1;}return _0x20b97c(_0x385e80);})[_0x5490('0x4f')](function(_0x426604){_0x2aa245(_0x426604);});});}return _0xccc9d6[_0x5490('0x50')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xb8d649,_0x8a3c92){var _0x1759ae=this;var _0x976302=_0x1759ae['type']===_0x5490('0x14')?_0x20c760(_0x1759ae):_0x3b611b(_0x1759ae);return _0x33f4ef(_0x1759ae,_0xb8d649,_['last'](_0x976302)[_0x5490('0x4d')]+0x1,_0x8a3c92)[_0x5490('0x37')](function(_0x466d94){var _0x57689d=_[_0x5490('0x4e')](_0x976302,_0x466d94);_0x57689d[_0x5490('0xf')]({'type':_0x1759ae['type'],'app':_0x5490('0x51'),'exten':_0x1759ae[_0x5490('0x8')],'context':_0x1759ae[_0x5490('0xd')],'priority':_[_0x5490('0x4c')](_0x57689d)[_0x5490('0x4d')]+0x1,'VoiceExtensionId':_0x1759ae['id']});return _0x57689d;});}}});};
\ No newline at end of file
index 2bf1f8c..6774393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31af=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','limit','map','include','model','attributes'];(function(_0x465aa9,_0x1bf1c8){var _0x4104e4=function(_0x388bb8){while(--_0x388bb8){_0x465aa9['push'](_0x465aa9['shift']());}};_0x4104e4(++_0x1bf1c8);}(_0x31af,0xde));var _0xf31a=function(_0x26f4d4,_0x7e5472){_0x26f4d4=_0x26f4d4-0x0;var _0xaead60=_0x31af[_0x26f4d4];return _0xaead60;};'use strict';var _=require(_0xf31a('0x0'));var util=require(_0xf31a('0x1'));var moment=require(_0xf31a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf31a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf31a('0x4'));var logger=require(_0xf31a('0x5'))(_0xf31a('0x6'));var config=require(_0xf31a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf31a('0x8')][_0xf31a('0x9')]({'port':0x232a});config[_0xf31a('0xa')]=_[_0xf31a('0xb')](config['redis'],{'host':_0xf31a('0xc'),'port':0x18eb});var socket=require(_0xf31a('0xd'))(new Redis(config[_0xf31a('0xa')]));require(_0xf31a('0xe'))['register'](socket);function respondWithRpcPromise(_0x1c56e9,_0x138d52,_0xcff55c){return new BPromise(function(_0x1ceac2,_0xf2e284){return client['request'](_0x1c56e9,_0xcff55c)[_0xf31a('0xf')](function(_0x1e31d3){logger[_0xf31a('0x10')](_0xf31a('0x11'),_0x138d52,'request\x20sent');logger[_0xf31a('0x12')](_0xf31a('0x13'),_0x138d52,'request\x20sent',JSON[_0xf31a('0x14')](_0x1e31d3));if(_0x1e31d3[_0xf31a('0x15')]){if(_0x1e31d3[_0xf31a('0x15')][_0xf31a('0x16')]===0x1f4){logger[_0xf31a('0x15')](_0xf31a('0x11'),_0x138d52,_0x1e31d3[_0xf31a('0x15')][_0xf31a('0x17')]);return _0xf2e284(_0x1e31d3[_0xf31a('0x15')][_0xf31a('0x17')]);}logger[_0xf31a('0x15')](_0xf31a('0x11'),_0x138d52,_0x1e31d3[_0xf31a('0x15')][_0xf31a('0x17')]);return _0x1ceac2(_0x1e31d3[_0xf31a('0x15')]['message']);}else{logger[_0xf31a('0x10')](_0xf31a('0x11'),_0x138d52,_0xf31a('0x18'));_0x1ceac2(_0x1e31d3[_0xf31a('0x19')]['message']);}})[_0xf31a('0x1a')](function(_0x15f6a9){logger[_0xf31a('0x15')](_0xf31a('0x11'),_0x138d52,_0x15f6a9);_0xf2e284(_0x15f6a9);});});}exports[_0xf31a('0x1b')]=function(_0x516672){var _0xcd2148=this;return new Promise(function(_0xd3ac94,_0x5861df){return db[_0xf31a('0x1c')][_0xf31a('0x1d')]({'raw':_0x516672['options']?_0x516672[_0xf31a('0x1e')][_0xf31a('0x1f')]===undefined?!![]:![]:!![],'where':_0x516672['options']?_0x516672['options']['where']||null:null,'attributes':_0x516672[_0xf31a('0x1e')]?_0x516672[_0xf31a('0x1e')]['attributes']||null:null,'limit':_0x516672[_0xf31a('0x1e')]?_0x516672[_0xf31a('0x1e')][_0xf31a('0x20')]||null:null,'include':_0x516672[_0xf31a('0x1e')]?_0x516672['options']['include']?_[_0xf31a('0x21')](_0x516672[_0xf31a('0x1e')]['include'],function(_0x4e115c){return{'model':db[_0x4e115c['model']],'as':_0x4e115c['as'],'attributes':_0x4e115c['attributes'],'include':_0x4e115c[_0xf31a('0x22')]?_[_0xf31a('0x21')](_0x4e115c[_0xf31a('0x22')],function(_0x595db6){return{'model':db[_0x595db6[_0xf31a('0x23')]],'as':_0x595db6['as'],'attributes':_0x595db6[_0xf31a('0x24')],'include':_0x595db6[_0xf31a('0x22')]?_[_0xf31a('0x21')](_0x595db6[_0xf31a('0x22')],function(_0x5a55c6){return{'model':db[_0x5a55c6[_0xf31a('0x23')]],'as':_0x5a55c6['as'],'attributes':_0x5a55c6[_0xf31a('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52da7d){logger[_0xf31a('0x10')](_0xf31a('0x1b'),_0x516672);logger['debug'](_0xf31a('0x1b'),_0x516672,JSON[_0xf31a('0x14')](_0x52da7d));_0xd3ac94(_0x52da7d);})[_0xf31a('0x1a')](function(_0x5385ba){logger[_0xf31a('0x15')](_0xf31a('0x1b'),_0x5385ba[_0xf31a('0x17')],_0x516672);_0x5861df(_0xcd2148[_0xf31a('0x15')](0x1f4,_0x5385ba[_0xf31a('0x17')]));});});};
\ No newline at end of file
+var _0x37c5=['rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','findAll','options','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x38f4c8,_0x488833){var _0x28f567=function(_0x411729){while(--_0x411729){_0x38f4c8['push'](_0x38f4c8['shift']());}};_0x28f567(++_0x488833);}(_0x37c5,0xa7));var _0x537c=function(_0x2bc550,_0x5c44fc){_0x2bc550=_0x2bc550-0x0;var _0x453fda=_0x37c5[_0x2bc550];return _0x453fda;};'use strict';var _=require('lodash');var util=require(_0x537c('0x0'));var moment=require(_0x537c('0x1'));var BPromise=require(_0x537c('0x2'));var rs=require(_0x537c('0x3'));var fs=require('fs');var Redis=require(_0x537c('0x4'));var db=require(_0x537c('0x5'))['db'];var utils=require(_0x537c('0x6'));var logger=require(_0x537c('0x7'))(_0x537c('0x8'));var config=require(_0x537c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x537c('0xa')][_0x537c('0xb')]({'port':0x232a});config[_0x537c('0xc')]=_['defaults'](config[_0x537c('0xc')],{'host':_0x537c('0xd'),'port':0x18eb});var socket=require(_0x537c('0xe'))(new Redis(config[_0x537c('0xc')]));require('./voiceExtension.socket')[_0x537c('0xf')](socket);function respondWithRpcPromise(_0x1d8c6f,_0x29c294,_0x579666){return new BPromise(function(_0x1459e0,_0x48fdeb){return client['request'](_0x1d8c6f,_0x579666)[_0x537c('0x10')](function(_0x53004e){logger[_0x537c('0x11')](_0x537c('0x12'),_0x29c294,_0x537c('0x13'));logger[_0x537c('0x14')](_0x537c('0x15'),_0x29c294,_0x537c('0x13'),JSON[_0x537c('0x16')](_0x53004e));if(_0x53004e[_0x537c('0x17')]){if(_0x53004e[_0x537c('0x17')]['code']===0x1f4){logger[_0x537c('0x17')](_0x537c('0x12'),_0x29c294,_0x53004e[_0x537c('0x17')][_0x537c('0x18')]);return _0x48fdeb(_0x53004e[_0x537c('0x17')][_0x537c('0x18')]);}logger[_0x537c('0x17')](_0x537c('0x12'),_0x29c294,_0x53004e[_0x537c('0x17')]['message']);return _0x1459e0(_0x53004e[_0x537c('0x17')]['message']);}else{logger['info'](_0x537c('0x12'),_0x29c294,_0x537c('0x13'));_0x1459e0(_0x53004e[_0x537c('0x19')]['message']);}})[_0x537c('0x1a')](function(_0x229ffd){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x29c294,_0x229ffd);_0x48fdeb(_0x229ffd);});});}exports[_0x537c('0x1b')]=function(_0x49641d){var _0x59a481=this;return new Promise(function(_0x2307c7,_0x32be40){return db['VoiceExtension'][_0x537c('0x1c')]({'raw':_0x49641d[_0x537c('0x1d')]?_0x49641d['options']['raw']===undefined?!![]:![]:!![],'where':_0x49641d[_0x537c('0x1d')]?_0x49641d['options']['where']||null:null,'attributes':_0x49641d[_0x537c('0x1d')]?_0x49641d[_0x537c('0x1d')][_0x537c('0x1e')]||null:null,'limit':_0x49641d[_0x537c('0x1d')]?_0x49641d[_0x537c('0x1d')][_0x537c('0x1f')]||null:null,'include':_0x49641d['options']?_0x49641d[_0x537c('0x1d')][_0x537c('0x20')]?_[_0x537c('0x21')](_0x49641d[_0x537c('0x1d')][_0x537c('0x20')],function(_0x4b6af1){return{'model':db[_0x4b6af1['model']],'as':_0x4b6af1['as'],'attributes':_0x4b6af1['attributes'],'include':_0x4b6af1[_0x537c('0x20')]?_[_0x537c('0x21')](_0x4b6af1['include'],function(_0x3005a4){return{'model':db[_0x3005a4[_0x537c('0x22')]],'as':_0x3005a4['as'],'attributes':_0x3005a4[_0x537c('0x1e')],'include':_0x3005a4['include']?_['map'](_0x3005a4[_0x537c('0x20')],function(_0x44cc94){return{'model':db[_0x44cc94[_0x537c('0x22')]],'as':_0x44cc94['as'],'attributes':_0x44cc94[_0x537c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x537c('0x10')](function(_0x5ca8f6){logger[_0x537c('0x11')](_0x537c('0x1b'),_0x49641d);logger['debug']('GetVoiceExtension',_0x49641d,JSON['stringify'](_0x5ca8f6));_0x2307c7(_0x5ca8f6);})['catch'](function(_0x254996){logger[_0x537c('0x17')](_0x537c('0x1b'),_0x254996['message'],_0x49641d);_0x32be40(_0x59a481[_0x537c('0x17')](0x1f4,_0x254996[_0x537c('0x18')]));});});};
\ No newline at end of file
index 19db9c6..d0e5c15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x54c0d2,_0x1972c1){var _0x349f85=function(_0x360c46){while(--_0x360c46){_0x54c0d2['push'](_0x54c0d2['shift']());}};_0x349f85(++_0x1972c1);}(_0x1261,0x144));var _0x1126=function(_0x332109,_0x474add){_0x332109=_0x332109-0x0;var _0x7a6ab2=_0x1261[_0x332109];return _0x7a6ab2;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}};
\ No newline at end of file
+var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x3070ca,_0xf2d053){var _0x38ecd1=function(_0x2c176e){while(--_0x2c176e){_0x3070ca['push'](_0x3070ca['shift']());}};_0x38ecd1(++_0xf2d053);}(_0x326f,0xd1));var _0xf326=function(_0x54360a,_0x33ad7a){_0x54360a=_0x54360a-0x0;var _0x3d6270=_0x326f[_0x54360a];return _0x3d6270;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}};
\ No newline at end of file
index a809ad8..4971efb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','/:id/messages','getMessages','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x5a3511,_0x1318b4){var _0x575df5=function(_0x5046a4){while(--_0x5046a4){_0x5a3511['push'](_0x5a3511['shift']());}};_0x575df5(++_0x1318b4);}(_0x5fab,0x177));var _0xb5fa=function(_0x2027f5,_0x5a68c1){_0x2027f5=_0x2027f5-0x0;var _0x346d21=_0x5fab[_0x2027f5];return _0x346d21;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
+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(_0x59f26e,_0xfcde74){var _0x246428=function(_0x2e2989){while(--_0x2e2989){_0x59f26e['push'](_0x59f26e['shift']());}};_0x246428(++_0xfcde74);}(_0x1893,0xa2));var _0x3189=function(_0x5c1ddc,_0x587040){_0x5c1ddc=_0x5c1ddc-0x0;var _0x542a11=_0x1893[_0x5c1ddc];return _0x542a11;};'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
index e828e7d..b93cd48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0e5=['TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','ENUM','yes'];(function(_0x241fd8,_0x568e21){var _0x3c260e=function(_0x3dfc17){while(--_0x3dfc17){_0x241fd8['push'](_0x241fd8['shift']());}};_0x3c260e(++_0x568e21);}(_0xd0e5,0xab));var _0x5d0e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xd0e5[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require('sequelize');module[_0x5d0e('0x0')]={'customer_id':{'type':Sequelize[_0x5d0e('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x5d0e('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x5d0e('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5d0e('0x3')},'password':{'type':Sequelize[_0x5d0e('0x1')]},'fullname':{'type':Sequelize[_0x5d0e('0x1')]},'email':{'type':Sequelize[_0x5d0e('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1e3a64){this[_0x5d0e('0x4')](_0x5d0e('0x5'),typeof _0x1e3a64===_0x5d0e('0x6')&&_0x1e3a64['trim']()?_0x1e3a64['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x5d0e('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x5d0e('0x7')]('yes','no'),'defaultValue':_0x5d0e('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5d0e('0x7')]('yes','no'),'defaultValue':_0x5d0e('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x5d0e('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x5d0e('0x7')](_0x5d0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5d0e('0x7')](_0x5d0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5d0e('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x5d0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5d0e('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5d0e('0x7')](_0x5d0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5d0e('0x7')](_0x5d0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x5d0e('0x8'),'no'),'defaultValue':_0x5d0e('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5d0e('0x7')](_0x5d0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5d0e('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5d0e('0x7')](_0x5d0e('0x8'),'no'),'defaultValue':_0x5d0e('0x8'),'allowNull':![]},'stamp':{'type':_0x5d0e('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x5d0e('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5d0e('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5d0e('0xc')],'get':function(){return this['getDataValue']('fullname')+'\x20-\x20'+this[_0x5d0e('0xd')](_0x5d0e('0xe'));}}};
\ No newline at end of file
+var _0x3e43=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','sequelize','STRING','from-voicemail','contest_mailbox'];(function(_0x17711f,_0x27f87b){var _0x41b27c=function(_0x55fa2d){while(--_0x55fa2d){_0x17711f['push'](_0x17711f['shift']());}};_0x41b27c(++_0x27f87b);}(_0x3e43,0x84));var _0x33e4=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3e43[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x33e4('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x33e4('0x1')]},'context':{'type':Sequelize[_0x33e4('0x1')],'defaultValue':_0x33e4('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x33e4('0x1')],'defaultValue':'','allowNull':![],'unique':_0x33e4('0x3')},'password':{'type':Sequelize[_0x33e4('0x1')]},'fullname':{'type':Sequelize[_0x33e4('0x1')]},'email':{'type':Sequelize[_0x33e4('0x1')],'validate':{'isEmail':!![]},'set':function(_0x5616bf){this[_0x33e4('0x4')](_0x33e4('0x5'),typeof _0x5616bf===_0x33e4('0x6')&&_0x5616bf[_0x33e4('0x7')]()?_0x5616bf['trim']():null);}},'pager':{'type':Sequelize[_0x33e4('0x1')]},'tz':{'type':Sequelize[_0x33e4('0x1')],'defaultValue':_0x33e4('0x8')},'attach':{'type':Sequelize[_0x33e4('0x9')](_0x33e4('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x33e4('0x9')]('yes','no'),'defaultValue':_0x33e4('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x33e4('0x1')]},'callback':{'type':Sequelize[_0x33e4('0x1')]},'review':{'type':Sequelize[_0x33e4('0x9')](_0x33e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x33e4('0x9')](_0x33e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x33e4('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x33e4('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x33e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x33e4('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x33e4('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x33e4('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x33e4('0x9')]('yes','no'),'defaultValue':_0x33e4('0xa'),'allowNull':![]},'stamp':{'type':_0x33e4('0xc')},'emailsubject':{'type':Sequelize[_0x33e4('0x1')]},'emailbody':{'type':Sequelize[_0x33e4('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x33e4('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x33e4('0xe')],'get':function(){return this[_0x33e4('0xf')](_0x33e4('0x10'))+'\x20-\x20'+this[_0x33e4('0xf')]('mailbox');}}};
\ No newline at end of file
index 4bc3fc4..4fea250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','Voicemails','destroy','then','sendStatus','error','stack','name','send','index','VoiceMail','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','update','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll'];(function(_0x32a4a3,_0x59db5b){var _0xed38ac=function(_0x457eba){while(--_0x457eba){_0x32a4a3['push'](_0x32a4a3['shift']());}};_0xed38ac(++_0x59db5b);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5c766f,_0x277f11){_0x5c766f=_0x5c766f-0x0;var _0x234a69=_0x6f7a[_0x5c766f];return _0x234a69;};'use strict';var emlformat=require(_0xa6f7('0x0'));var rimraf=require(_0xa6f7('0x1'));var zipdir=require(_0xa6f7('0x2'));var jsonpatch=require(_0xa6f7('0x3'));var rp=require('request-promise');var moment=require(_0xa6f7('0x4'));var BPromise=require(_0xa6f7('0x5'));var Mustache=require(_0xa6f7('0x6'));var util=require(_0xa6f7('0x7'));var path=require(_0xa6f7('0x8'));var sox=require(_0xa6f7('0x9'));var csv=require(_0xa6f7('0xa'));var ejs=require(_0xa6f7('0xb'));var fs=require('fs');var fs_extra=require(_0xa6f7('0xc'));var _=require(_0xa6f7('0xd'));var squel=require(_0xa6f7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa6f7('0xf'));var toCsv=require(_0xa6f7('0xa'));var querystring=require(_0xa6f7('0x10'));var Papa=require(_0xa6f7('0x11'));var Redis=require(_0xa6f7('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa6f7('0x13'));var hardwareService=require(_0xa6f7('0x14'));var logger=require('../../config/logger')(_0xa6f7('0x15'));var utils=require('../../config/utils');var config=require(_0xa6f7('0x16'));var licenseUtil=require(_0xa6f7('0x17'));var db=require(_0xa6f7('0x18'))['db'];function respondWithStatusCode(_0xd5558b,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x3fc7f1){if(_0x3fc7f1){return _0xd5558b['sendStatus'](_0x5a3035);}return _0xd5558b[_0xa6f7('0x19')](_0x5a3035)[_0xa6f7('0x1a')]();};}function respondWithResult(_0x25c123,_0x4d3d59){_0x4d3d59=_0x4d3d59||0xc8;return function(_0x34c02d){if(_0x34c02d){return _0x25c123['status'](_0x4d3d59)[_0xa6f7('0x1b')](_0x34c02d);}};}function respondWithFilteredResult(_0x57308a,_0x17b814){return function(_0x17f9c5){if(_0x17f9c5){var _0x6efd38=typeof _0x17b814['offset']===_0xa6f7('0x1c')&&typeof _0x17b814[_0xa6f7('0x1d')]===_0xa6f7('0x1c');var _0x2401b9=_0x17f9c5['count'];var _0x4a8827=_0x6efd38?0x0:_0x17b814[_0xa6f7('0x1e')];var _0x5298ba=_0x6efd38?_0x17f9c5[_0xa6f7('0x1f')]:_0x17b814[_0xa6f7('0x1e')]+_0x17b814['limit'];var _0x18fc4a;if(_0x5298ba>=_0x2401b9){_0x5298ba=_0x2401b9;_0x18fc4a=0xc8;}else{_0x18fc4a=0xce;}_0x57308a[_0xa6f7('0x19')](_0x18fc4a);return _0x57308a[_0xa6f7('0x20')](_0xa6f7('0x21'),_0x4a8827+'-'+_0x5298ba+'/'+_0x2401b9)[_0xa6f7('0x1b')](_0x17f9c5);}return null;};}function patchUpdates(_0x1aa8dc){return function(_0x4887ad){try{jsonpatch[_0xa6f7('0x22')](_0x4887ad,_0x1aa8dc,!![]);}catch(_0x45d79e){return BPromise['reject'](_0x45d79e);}return _0x4887ad['save']();};}function saveUpdates(_0x5ddc8d,_0x1de6c9){return function(_0x119950){if(_0x119950){return _0x119950['update'](_0x5ddc8d)['then'](function(_0x50e2be){return _0x50e2be;});}return null;};}function removeEntity(_0x2b6a84,_0xc77e8e){return function(_0x28263e){if(_0x28263e){return _0x28263e['destroy']()['then'](function(){var _0x2f4907=_0x28263e['get']({'plain':!![]});var _0x47ef97=_0xa6f7('0x23');return db['UserProfileResource'][_0xa6f7('0x24')]({'where':{'type':_0x47ef97,'resourceId':_0x2f4907['id']}})[_0xa6f7('0x25')](function(){return _0x28263e;});})[_0xa6f7('0x25')](function(){_0x2b6a84[_0xa6f7('0x19')](0xcc)[_0xa6f7('0x1a')]();});}};}function handleEntityNotFound(_0x4b8d2b,_0x51db47){return function(_0x1c419b){if(!_0x1c419b){_0x4b8d2b[_0xa6f7('0x26')](0x194);}return _0x1c419b;};}function handleError(_0x55d45a,_0x267917){_0x267917=_0x267917||0x1f4;return function(_0x27babb){logger[_0xa6f7('0x27')](_0x27babb[_0xa6f7('0x28')]);if(_0x27babb[_0xa6f7('0x29')]){delete _0x27babb[_0xa6f7('0x29')];}_0x55d45a[_0xa6f7('0x19')](_0x267917)[_0xa6f7('0x2a')](_0x27babb);};}exports[_0xa6f7('0x2b')]=function(_0x3dee2e,_0x40b0f8){var _0x278bad={},_0x52f9c1={},_0x442ccf={'count':0x0,'rows':[]};var _0x42dc49=_['map'](db[_0xa6f7('0x2c')][_0xa6f7('0x2d')],function(_0x4d79d8){return{'name':_0x4d79d8['fieldName'],'type':_0x4d79d8[_0xa6f7('0x2e')][_0xa6f7('0x2f')]};});_0x52f9c1[_0xa6f7('0x30')]=_[_0xa6f7('0x31')](_0x42dc49,_0xa6f7('0x29'));_0x52f9c1['query']=_['keys'](_0x3dee2e[_0xa6f7('0x32')]);_0x52f9c1['filters']=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],_0x52f9c1[_0xa6f7('0x32')]);_0x278bad[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x52f9c1[_0xa6f7('0x30')],qs['fields'](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x35')]));_0x278bad[_0xa6f7('0x34')]=_0x278bad['attributes'][_0xa6f7('0x36')]?_0x278bad['attributes']:_0x52f9c1[_0xa6f7('0x30')];if(!_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x37')]('nolimit')){_0x278bad[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x1d')]);_0x278bad[_0xa6f7('0x1e')]=qs[_0xa6f7('0x1e')](_0x3dee2e['query'][_0xa6f7('0x1e')]);}_0x278bad[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x278bad[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x3dee2e['query'],_0x52f9c1[_0xa6f7('0x3b')]),_0x42dc49);if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x278bad['where']=_[_0xa6f7('0x3e')](_0x278bad[_0xa6f7('0x3a')],{'$or':_['map'](_0x42dc49,function(_0x39349a){if(_0x39349a[_0xa6f7('0x2e')]!==_0xa6f7('0x3f')){var _0x14d532={};_0x14d532[_0x39349a[_0xa6f7('0x29')]]={'$like':'%'+_0x3dee2e['query'][_0xa6f7('0x3d')]+'%'};return _0x14d532;}})});}_0x278bad=_[_0xa6f7('0x3e')]({},_0x278bad,_0x3dee2e[_0xa6f7('0x40')]);var _0x1b8bf3={'where':_0x278bad[_0xa6f7('0x3a')]};return db[_0xa6f7('0x2c')][_0xa6f7('0x1f')](_0x1b8bf3)[_0xa6f7('0x25')](function(_0x5646b9){_0x442ccf['count']=_0x5646b9;if(_0x3dee2e[_0xa6f7('0x32')][_0xa6f7('0x41')]){_0x278bad[_0xa6f7('0x42')]=[{'all':!![]}];}return db[_0xa6f7('0x2c')][_0xa6f7('0x43')](_0x278bad);})[_0xa6f7('0x25')](function(_0x21fdd7){_0x442ccf[_0xa6f7('0x44')]=_0x21fdd7;return _0x442ccf;})[_0xa6f7('0x25')](respondWithFilteredResult(_0x40b0f8,_0x278bad))[_0xa6f7('0x45')](handleError(_0x40b0f8,null));};exports['show']=function(_0x41917c,_0x30be3b){var _0x4d5846={'raw':!![],'where':{'id':_0x41917c[_0xa6f7('0x46')]['id']}},_0x22d500={};_0x22d500[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db['VoiceMail'][_0xa6f7('0x2d')]);_0x22d500['query']=_['keys'](_0x41917c[_0xa6f7('0x32')]);_0x22d500[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x22d500[_0xa6f7('0x30')],_0x22d500[_0xa6f7('0x32')]);_0x4d5846[_0xa6f7('0x34')]=_[_0xa6f7('0x33')](_0x22d500['model'],qs[_0xa6f7('0x35')](_0x41917c[_0xa6f7('0x32')]['fields']));_0x4d5846[_0xa6f7('0x34')]=_0x4d5846[_0xa6f7('0x34')][_0xa6f7('0x36')]?_0x4d5846['attributes']:_0x22d500[_0xa6f7('0x30')];if(_0x41917c['query'][_0xa6f7('0x41')]){_0x4d5846[_0xa6f7('0x42')]=[{'all':!![]}];}_0x4d5846=_[_0xa6f7('0x3e')]({},_0x4d5846,_0x41917c['options']);return db['VoiceMail'][_0xa6f7('0x48')](_0x4d5846)['then'](handleEntityNotFound(_0x30be3b,null))[_0xa6f7('0x25')](respondWithResult(_0x30be3b,null))['catch'](handleError(_0x30be3b,null));};exports['create']=function(_0x1e7089,_0x2e3a04){return db[_0xa6f7('0x2c')][_0xa6f7('0x49')](_0x1e7089[_0xa6f7('0x4a')],{})[_0xa6f7('0x25')](function(_0x5d9b6f){var _0x4032fc=_0x1e7089[_0xa6f7('0x4b')]['get']({'plain':!![]});if(!_0x4032fc)throw new Error(_0xa6f7('0x4c'));if(_0x4032fc['role']===_0xa6f7('0x4b')){var _0x59091a=_0x5d9b6f['get']({'plain':!![]});var _0x60eacc=_0xa6f7('0x23');return db[_0xa6f7('0x4d')][_0xa6f7('0x48')]({'where':{'name':_0x60eacc,'userProfileId':_0x4032fc[_0xa6f7('0x4e')]},'raw':!![]})['then'](function(_0x340d3f){if(_0x340d3f&&_0x340d3f[_0xa6f7('0x4f')]===0x0){return db['UserProfileResource'][_0xa6f7('0x49')]({'name':_0x59091a['name'],'resourceId':_0x59091a['id'],'type':_0x340d3f[_0xa6f7('0x29')],'sectionId':_0x340d3f['id']},{})[_0xa6f7('0x25')](function(){return _0x5d9b6f;});}else{return _0x5d9b6f;}})[_0xa6f7('0x45')](function(_0x55369a){logger[_0xa6f7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55369a);throw _0x55369a;});}return _0x5d9b6f;})[_0xa6f7('0x25')](respondWithResult(_0x2e3a04,0xc9))[_0xa6f7('0x45')](handleError(_0x2e3a04,null));};exports[_0xa6f7('0x50')]=function(_0x1dcb45,_0xa6bff9){if(_0x1dcb45['body']['id']){delete _0x1dcb45['body']['id'];}return db[_0xa6f7('0x2c')][_0xa6f7('0x48')]({'where':{'id':_0x1dcb45[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0xa6bff9,null))['then'](saveUpdates(_0x1dcb45[_0xa6f7('0x4a')],null))[_0xa6f7('0x25')](respondWithResult(_0xa6bff9,null))[_0xa6f7('0x45')](handleError(_0xa6bff9,null));};exports[_0xa6f7('0x24')]=function(_0x1b33a5,_0x39538e){return db['VoiceMail'][_0xa6f7('0x48')]({'where':{'id':_0x1b33a5[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x39538e,null))['then'](removeEntity(_0x39538e,null))[_0xa6f7('0x45')](handleError(_0x39538e,null));};exports[_0xa6f7('0x51')]=function(_0x139192,_0x4496f1,_0x5908e3){return db['VoiceMail'][_0xa6f7('0x52')]({'where':{'id':_0x139192[_0xa6f7('0x46')]['id']}})[_0xa6f7('0x25')](handleEntityNotFound(_0x4496f1,null))[_0xa6f7('0x25')](function(_0x301327){var _0x269249;var _0x1fcb72={},_0x5efd49={};_0x5efd49[_0xa6f7('0x30')]=_[_0xa6f7('0x47')](db[_0xa6f7('0x53')][_0xa6f7('0x2d')]);_0x5efd49[_0xa6f7('0x32')]=_[_0xa6f7('0x47')](_0x139192[_0xa6f7('0x32')]);_0x5efd49[_0xa6f7('0x3b')]=_[_0xa6f7('0x33')](_0x5efd49[_0xa6f7('0x30')],_0x5efd49[_0xa6f7('0x32')]);_0x1fcb72['attributes']=_[_0xa6f7('0x33')](_0x5efd49['model'],qs[_0xa6f7('0x35')](_0x139192['query'][_0xa6f7('0x35')]));_0x1fcb72[_0xa6f7('0x34')]=_0x1fcb72['attributes'][_0xa6f7('0x36')]?_0x1fcb72[_0xa6f7('0x34')]:_0x5efd49[_0xa6f7('0x30')];if(!_0x139192['query'][_0xa6f7('0x37')]('nolimit')){_0x1fcb72[_0xa6f7('0x1d')]=qs[_0xa6f7('0x1d')](_0x139192['query'][_0xa6f7('0x1d')]);_0x1fcb72['offset']=qs[_0xa6f7('0x1e')](_0x139192['query'][_0xa6f7('0x1e')]);}_0x1fcb72[_0xa6f7('0x38')]=qs[_0xa6f7('0x39')](_0x139192[_0xa6f7('0x32')][_0xa6f7('0x39')]);_0x1fcb72[_0xa6f7('0x3a')]=qs[_0xa6f7('0x3b')](_[_0xa6f7('0x3c')](_0x139192[_0xa6f7('0x32')],_0x5efd49[_0xa6f7('0x3b')]));if(_0x139192[_0xa6f7('0x32')][_0xa6f7('0x3d')]){_0x1fcb72['where']=_[_0xa6f7('0x3e')](_0x1fcb72[_0xa6f7('0x3a')],{'$or':_[_0xa6f7('0x31')](_0x1fcb72[_0xa6f7('0x34')],function(_0x154c78){var _0x3a464e={};_0x3a464e[_0x154c78]={'$like':'%'+_0x139192[_0xa6f7('0x32')][_0xa6f7('0x3d')]+'%'};return _0x3a464e;})});}_0x1fcb72['where']=_[_0xa6f7('0x3e')](_0x1fcb72[_0xa6f7('0x3a')],{'mailboxuser':_0x301327[_0xa6f7('0x54')]});_0x1fcb72=_['merge']({},_0x1fcb72,_0x139192[_0xa6f7('0x40')]);return db[_0xa6f7('0x53')][_0xa6f7('0x55')](_0x1fcb72)[_0xa6f7('0x25')](respondWithFilteredResult(_0x4496f1,_0x1fcb72));})[_0xa6f7('0x45')](handleError(_0x4496f1,null));};
\ No newline at end of file
+var _0x750a=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','set','json','destroy','then','get','Voicemails','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceMail','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','body','getMessages','findOne','VoiceMailMessage','length','findAndCountAll','rimraf','request-promise','moment','bluebird'];(function(_0x55dbdc,_0x2a203a){var _0x5d7a04=function(_0x44621e){while(--_0x44621e){_0x55dbdc['push'](_0x55dbdc['shift']());}};_0x5d7a04(++_0x2a203a);}(_0x750a,0x140));var _0xa750=function(_0x3208d6,_0x5e0b42){_0x3208d6=_0x3208d6-0x0;var _0x165fc1=_0x750a[_0x3208d6];return _0x165fc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa750('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa750('0x1'));var moment=require(_0xa750('0x2'));var BPromise=require(_0xa750('0x3'));var Mustache=require(_0xa750('0x4'));var util=require(_0xa750('0x5'));var path=require(_0xa750('0x6'));var sox=require(_0xa750('0x7'));var csv=require(_0xa750('0x8'));var ejs=require(_0xa750('0x9'));var fs=require('fs');var fs_extra=require(_0xa750('0xa'));var _=require(_0xa750('0xb'));var squel=require(_0xa750('0xc'));var crypto=require(_0xa750('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa750('0x8'));var querystring=require('querystring');var Papa=require(_0xa750('0xe'));var Redis=require(_0xa750('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa750('0x10'));var as=require(_0xa750('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa750('0x12'));var utils=require('../../config/utils');var config=require(_0xa750('0x13'));var licenseUtil=require(_0xa750('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ec62,_0x1c5657){_0x1c5657=_0x1c5657||0xcc;return function(_0x344c67){if(_0x344c67){return _0x24ec62['sendStatus'](_0x1c5657);}return _0x24ec62[_0xa750('0x15')](_0x1c5657)[_0xa750('0x16')]();};}function respondWithResult(_0x2d3421,_0x24e48a){_0x24e48a=_0x24e48a||0xc8;return function(_0xa66181){if(_0xa66181){return _0x2d3421[_0xa750('0x15')](_0x24e48a)['json'](_0xa66181);}};}function respondWithFilteredResult(_0x3ae2a1,_0x8488ea){return function(_0x290d46){if(_0x290d46){var _0x49fe3b=typeof _0x8488ea[_0xa750('0x17')]===_0xa750('0x18')&&typeof _0x8488ea['limit']==='undefined';var _0x321eb2=_0x290d46['count'];var _0x433dbd=_0x49fe3b?0x0:_0x8488ea[_0xa750('0x17')];var _0x4f1faa=_0x49fe3b?_0x290d46[_0xa750('0x19')]:_0x8488ea['offset']+_0x8488ea['limit'];var _0x25e335;if(_0x4f1faa>=_0x321eb2){_0x4f1faa=_0x321eb2;_0x25e335=0xc8;}else{_0x25e335=0xce;}_0x3ae2a1['status'](_0x25e335);return _0x3ae2a1[_0xa750('0x1a')]('Content-Range',_0x433dbd+'-'+_0x4f1faa+'/'+_0x321eb2)[_0xa750('0x1b')](_0x290d46);}return null;};}function patchUpdates(_0x4a007d){return function(_0x3dc7f1){try{jsonpatch['apply'](_0x3dc7f1,_0x4a007d,!![]);}catch(_0x1efb68){return BPromise['reject'](_0x1efb68);}return _0x3dc7f1['save']();};}function saveUpdates(_0xaa9d3e,_0x52da84){return function(_0x216fbf){if(_0x216fbf){return _0x216fbf['update'](_0xaa9d3e)['then'](function(_0x5b433d){return _0x5b433d;});}return null;};}function removeEntity(_0x5d758e,_0x15d72f){return function(_0x2ec6c4){if(_0x2ec6c4){return _0x2ec6c4[_0xa750('0x1c')]()[_0xa750('0x1d')](function(){var _0x1b80a5=_0x2ec6c4[_0xa750('0x1e')]({'plain':!![]});var _0x3001bc=_0xa750('0x1f');return db[_0xa750('0x20')][_0xa750('0x1c')]({'where':{'type':_0x3001bc,'resourceId':_0x1b80a5['id']}})[_0xa750('0x1d')](function(){return _0x2ec6c4;});})[_0xa750('0x1d')](function(){_0x5d758e[_0xa750('0x15')](0xcc)[_0xa750('0x16')]();});}};}function handleEntityNotFound(_0x310e2d,_0x4ffff4){return function(_0x3d3923){if(!_0x3d3923){_0x310e2d[_0xa750('0x21')](0x194);}return _0x3d3923;};}function handleError(_0x21cd2c,_0x4cceee){_0x4cceee=_0x4cceee||0x1f4;return function(_0x35ab53){logger[_0xa750('0x22')](_0x35ab53[_0xa750('0x23')]);if(_0x35ab53[_0xa750('0x24')]){delete _0x35ab53['name'];}_0x21cd2c[_0xa750('0x15')](_0x4cceee)[_0xa750('0x25')](_0x35ab53);};}exports[_0xa750('0x26')]=function(_0x2aef3a,_0x2c5253){var _0x59ab33={},_0x46cc11={},_0x4c2c9e={'count':0x0,'rows':[]};var _0x2d0e93=_[_0xa750('0x27')](db['VoiceMail'][_0xa750('0x28')],function(_0x6bc25d){return{'name':_0x6bc25d[_0xa750('0x29')],'type':_0x6bc25d[_0xa750('0x2a')][_0xa750('0x2b')]};});_0x46cc11[_0xa750('0x2c')]=_[_0xa750('0x27')](_0x2d0e93,_0xa750('0x24'));_0x46cc11['query']=_[_0xa750('0x2d')](_0x2aef3a['query']);_0x46cc11[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],_0x46cc11[_0xa750('0x30')]);_0x59ab33['attributes']=_[_0xa750('0x2f')](_0x46cc11[_0xa750('0x2c')],qs['fields'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x31')]));_0x59ab33[_0xa750('0x32')]=_0x59ab33[_0xa750('0x32')]['length']?_0x59ab33[_0xa750('0x32')]:_0x46cc11['model'];if(!_0x2aef3a['query'][_0xa750('0x33')](_0xa750('0x34'))){_0x59ab33[_0xa750('0x35')]=qs['limit'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x35')]);_0x59ab33[_0xa750('0x17')]=qs['offset'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x17')]);}_0x59ab33[_0xa750('0x36')]=qs['sort'](_0x2aef3a[_0xa750('0x30')][_0xa750('0x37')]);_0x59ab33[_0xa750('0x38')]=qs['filters'](_[_0xa750('0x39')](_0x2aef3a[_0xa750('0x30')],_0x46cc11[_0xa750('0x2e')]),_0x2d0e93);if(_0x2aef3a[_0xa750('0x30')]['filter']){_0x59ab33['where']=_[_0xa750('0x3a')](_0x59ab33[_0xa750('0x38')],{'$or':_['map'](_0x2d0e93,function(_0x43dc3a){if(_0x43dc3a[_0xa750('0x2a')]!==_0xa750('0x3b')){var _0x1166ff={};_0x1166ff[_0x43dc3a[_0xa750('0x24')]]={'$like':'%'+_0x2aef3a['query'][_0xa750('0x3c')]+'%'};return _0x1166ff;}})});}_0x59ab33=_[_0xa750('0x3a')]({},_0x59ab33,_0x2aef3a[_0xa750('0x3d')]);var _0x134874={'where':_0x59ab33[_0xa750('0x38')]};return db[_0xa750('0x3e')][_0xa750('0x19')](_0x134874)['then'](function(_0x3daa38){_0x4c2c9e['count']=_0x3daa38;if(_0x2aef3a[_0xa750('0x30')]['includeAll']){_0x59ab33[_0xa750('0x3f')]=[{'all':!![]}];}return db[_0xa750('0x3e')][_0xa750('0x40')](_0x59ab33);})[_0xa750('0x1d')](function(_0x430d60){_0x4c2c9e[_0xa750('0x41')]=_0x430d60;return _0x4c2c9e;})[_0xa750('0x1d')](respondWithFilteredResult(_0x2c5253,_0x59ab33))[_0xa750('0x42')](handleError(_0x2c5253,null));};exports[_0xa750('0x43')]=function(_0x108a1a,_0x36a8d6){var _0x1458f1={'raw':!![],'where':{'id':_0x108a1a[_0xa750('0x44')]['id']}},_0x3ec860={};_0x3ec860[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x3e')][_0xa750('0x28')]);_0x3ec860[_0xa750('0x30')]=_[_0xa750('0x2d')](_0x108a1a['query']);_0x3ec860[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],_0x3ec860[_0xa750('0x30')]);_0x1458f1[_0xa750('0x32')]=_[_0xa750('0x2f')](_0x3ec860[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x108a1a[_0xa750('0x30')]['fields']));_0x1458f1[_0xa750('0x32')]=_0x1458f1[_0xa750('0x32')]['length']?_0x1458f1[_0xa750('0x32')]:_0x3ec860[_0xa750('0x2c')];if(_0x108a1a[_0xa750('0x30')][_0xa750('0x45')]){_0x1458f1[_0xa750('0x3f')]=[{'all':!![]}];}_0x1458f1=_[_0xa750('0x3a')]({},_0x1458f1,_0x108a1a[_0xa750('0x3d')]);return db[_0xa750('0x3e')][_0xa750('0x46')](_0x1458f1)[_0xa750('0x1d')](handleEntityNotFound(_0x36a8d6,null))['then'](respondWithResult(_0x36a8d6,null))[_0xa750('0x42')](handleError(_0x36a8d6,null));};exports[_0xa750('0x47')]=function(_0x58afd2,_0x93e49f){return db[_0xa750('0x3e')][_0xa750('0x47')](_0x58afd2['body'],{})[_0xa750('0x1d')](function(_0x3fc623){var _0x1e5a9a=_0x58afd2[_0xa750('0x48')]['get']({'plain':!![]});if(!_0x1e5a9a)throw new Error(_0xa750('0x49'));if(_0x1e5a9a[_0xa750('0x4a')]===_0xa750('0x48')){var _0xed4f88=_0x3fc623['get']({'plain':!![]});var _0x203f2a=_0xa750('0x1f');return db['UserProfileSection'][_0xa750('0x46')]({'where':{'name':_0x203f2a,'userProfileId':_0x1e5a9a['userProfileId']},'raw':!![]})[_0xa750('0x1d')](function(_0x69995b){if(_0x69995b&&_0x69995b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xed4f88[_0xa750('0x24')],'resourceId':_0xed4f88['id'],'type':_0x69995b[_0xa750('0x24')],'sectionId':_0x69995b['id']},{})['then'](function(){return _0x3fc623;});}else{return _0x3fc623;}})[_0xa750('0x42')](function(_0x1a79a9){logger[_0xa750('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a79a9);throw _0x1a79a9;});}return _0x3fc623;})['then'](respondWithResult(_0x93e49f,0xc9))['catch'](handleError(_0x93e49f,null));};exports['update']=function(_0x3c34d4,_0x4a1b5d){if(_0x3c34d4[_0xa750('0x4b')]['id']){delete _0x3c34d4[_0xa750('0x4b')]['id'];}return db['VoiceMail'][_0xa750('0x46')]({'where':{'id':_0x3c34d4['params']['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x4a1b5d,null))['then'](saveUpdates(_0x3c34d4['body'],null))['then'](respondWithResult(_0x4a1b5d,null))['catch'](handleError(_0x4a1b5d,null));};exports[_0xa750('0x1c')]=function(_0x40dac2,_0x5f1313){return db['VoiceMail']['find']({'where':{'id':_0x40dac2[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x5f1313,null))[_0xa750('0x1d')](removeEntity(_0x5f1313,null))[_0xa750('0x42')](handleError(_0x5f1313,null));};exports[_0xa750('0x4c')]=function(_0x13528a,_0x599e7e,_0x590b1c){return db[_0xa750('0x3e')][_0xa750('0x4d')]({'where':{'id':_0x13528a[_0xa750('0x44')]['id']}})[_0xa750('0x1d')](handleEntityNotFound(_0x599e7e,null))[_0xa750('0x1d')](function(_0x5a3cd5){var _0x4030b3;var _0xaa63be={},_0x2c7dd0={};_0x2c7dd0[_0xa750('0x2c')]=_[_0xa750('0x2d')](db[_0xa750('0x4e')][_0xa750('0x28')]);_0x2c7dd0[_0xa750('0x30')]=_['keys'](_0x13528a[_0xa750('0x30')]);_0x2c7dd0[_0xa750('0x2e')]=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],_0x2c7dd0[_0xa750('0x30')]);_0xaa63be['attributes']=_[_0xa750('0x2f')](_0x2c7dd0[_0xa750('0x2c')],qs[_0xa750('0x31')](_0x13528a[_0xa750('0x30')][_0xa750('0x31')]));_0xaa63be[_0xa750('0x32')]=_0xaa63be[_0xa750('0x32')][_0xa750('0x4f')]?_0xaa63be[_0xa750('0x32')]:_0x2c7dd0[_0xa750('0x2c')];if(!_0x13528a[_0xa750('0x30')][_0xa750('0x33')](_0xa750('0x34'))){_0xaa63be[_0xa750('0x35')]=qs[_0xa750('0x35')](_0x13528a[_0xa750('0x30')]['limit']);_0xaa63be[_0xa750('0x17')]=qs['offset'](_0x13528a[_0xa750('0x30')][_0xa750('0x17')]);}_0xaa63be[_0xa750('0x36')]=qs['sort'](_0x13528a[_0xa750('0x30')][_0xa750('0x37')]);_0xaa63be[_0xa750('0x38')]=qs[_0xa750('0x2e')](_[_0xa750('0x39')](_0x13528a[_0xa750('0x30')],_0x2c7dd0['filters']));if(_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]){_0xaa63be['where']=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'$or':_[_0xa750('0x27')](_0xaa63be[_0xa750('0x32')],function(_0x3255c7){var _0x1b7597={};_0x1b7597[_0x3255c7]={'$like':'%'+_0x13528a[_0xa750('0x30')][_0xa750('0x3c')]+'%'};return _0x1b7597;})});}_0xaa63be[_0xa750('0x38')]=_[_0xa750('0x3a')](_0xaa63be[_0xa750('0x38')],{'mailboxuser':_0x5a3cd5['mailbox']});_0xaa63be=_['merge']({},_0xaa63be,_0x13528a[_0xa750('0x3d')]);return db[_0xa750('0x4e')][_0xa750('0x50')](_0xaa63be)[_0xa750('0x1d')](respondWithFilteredResult(_0x599e7e,_0xaa63be));})['catch'](handleError(_0x599e7e,null));};
\ No newline at end of file
index 69cb349..16ab7b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2cd=['VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc2cd,0x1b7));var _0xdc2c=function(_0x1af4bc,_0x1761e5){_0x1af4bc=_0x1af4bc-0x0;var _0x17459a=_0xc2cd[_0x1af4bc];return _0x17459a;};'use strict';var _=require(_0xdc2c('0x0'));var util=require(_0xdc2c('0x1'));var logger=require(_0xdc2c('0x2'))(_0xdc2c('0x3'));var moment=require(_0xdc2c('0x4'));var BPromise=require(_0xdc2c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc2c('0x6'));var rimraf=require(_0xdc2c('0x7'));var config=require(_0xdc2c('0x8'));var attributes=require(_0xdc2c('0x9'));module[_0xdc2c('0xa')]=function(_0x28f01d,_0x44efc4){return _0x28f01d['define'](_0xdc2c('0xb'),attributes,{'tableName':_0xdc2c('0xc'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xdc2c('0xd'),_0xdc2c('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb891=['request-promise','path','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5510af,_0x1d5b4c){var _0x4e727a=function(_0xbd9830){while(--_0xbd9830){_0x5510af['push'](_0x5510af['shift']());}};_0x4e727a(++_0x1d5b4c);}(_0xb891,0xbd));var _0x1b89=function(_0x213213,_0x337d60){_0x213213=_0x213213-0x0;var _0x204b9b=_0xb891[_0x213213];return _0x204b9b;};'use strict';var _=require(_0x1b89('0x0'));var util=require(_0x1b89('0x1'));var logger=require(_0x1b89('0x2'))(_0x1b89('0x3'));var moment=require(_0x1b89('0x4'));var BPromise=require(_0x1b89('0x5'));var rp=require(_0x1b89('0x6'));var fs=require('fs');var path=require(_0x1b89('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b89('0x8'));module[_0x1b89('0x9')]=function(_0x5016e4,_0x5755c0){return _0x5016e4[_0x1b89('0xa')]('VoiceMail',attributes,{'tableName':_0x1b89('0xb'),'paranoid':![],'indexes':[{'name':_0x1b89('0xc'),'fields':['mailbox','context']}],'timestamps':!![]});};
\ No newline at end of file
index 512942d..1cebcb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a40=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x475c60,_0x1209c9){var _0x225a7b=function(_0x1241b4){while(--_0x1241b4){_0x475c60['push'](_0x475c60['shift']());}};_0x225a7b(++_0x1209c9);}(_0x5a40,0xf5));var _0x05a4=function(_0x351056,_0x4a65fa){_0x351056=_0x351056-0x0;var _0x236a39=_0x5a40[_0x351056];return _0x236a39;};'use strict';var _=require(_0x05a4('0x0'));var util=require(_0x05a4('0x1'));var moment=require(_0x05a4('0x2'));var BPromise=require(_0x05a4('0x3'));var rs=require(_0x05a4('0x4'));var fs=require('fs');var Redis=require(_0x05a4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x05a4('0x6'));var config=require(_0x05a4('0x7'));var jayson=require(_0x05a4('0x8'));var client=jayson['client'][_0x05a4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2404e2,_0x2aa926,_0x4be311){return new BPromise(function(_0xab414d,_0x2ffbcd){return client[_0x05a4('0xa')](_0x2404e2,_0x4be311)['then'](function(_0x3fb59d){logger[_0x05a4('0xb')](_0x05a4('0xc'),_0x2aa926,_0x05a4('0xd'));logger[_0x05a4('0xe')](_0x05a4('0xf'),_0x2aa926,'request\x20sent',JSON[_0x05a4('0x10')](_0x3fb59d));if(_0x3fb59d['error']){if(_0x3fb59d[_0x05a4('0x11')][_0x05a4('0x12')]===0x1f4){logger[_0x05a4('0x11')](_0x05a4('0xc'),_0x2aa926,_0x3fb59d[_0x05a4('0x11')]['message']);return _0x2ffbcd(_0x3fb59d[_0x05a4('0x11')][_0x05a4('0x13')]);}logger[_0x05a4('0x11')](_0x05a4('0xc'),_0x2aa926,_0x3fb59d['error']['message']);return _0xab414d(_0x3fb59d[_0x05a4('0x11')][_0x05a4('0x13')]);}else{logger['info'](_0x05a4('0xc'),_0x2aa926,_0x05a4('0xd'));_0xab414d(_0x3fb59d[_0x05a4('0x14')][_0x05a4('0x13')]);}})[_0x05a4('0x15')](function(_0x350c1a){logger[_0x05a4('0x11')](_0x05a4('0xc'),_0x2aa926,_0x350c1a);_0x2ffbcd(_0x350c1a);});});}
\ No newline at end of file
+var _0xe597=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceMail,\x20%s,\x20%s','message','info','catch'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xe597,0xa8));var _0x7e59=function(_0x62f502,_0x1b4638){_0x62f502=_0x62f502-0x0;var _0x2568c4=_0xe597[_0x62f502];return _0x2568c4;};'use strict';var _=require('lodash');var util=require(_0x7e59('0x0'));var moment=require(_0x7e59('0x1'));var BPromise=require('bluebird');var rs=require(_0x7e59('0x2'));var fs=require('fs');var Redis=require(_0x7e59('0x3'));var db=require(_0x7e59('0x4'))['db'];var utils=require(_0x7e59('0x5'));var logger=require(_0x7e59('0x6'))(_0x7e59('0x7'));var config=require(_0x7e59('0x8'));var jayson=require(_0x7e59('0x9'));var client=jayson['client'][_0x7e59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b9ca6,_0x4219d9,_0x16cc4d){return new BPromise(function(_0x184ca5,_0x2d7cff){return client[_0x7e59('0xb')](_0x1b9ca6,_0x16cc4d)[_0x7e59('0xc')](function(_0x3ebd40){logger['info']('VoiceMail,\x20%s,\x20%s',_0x4219d9,'request\x20sent');logger[_0x7e59('0xd')](_0x7e59('0xe'),_0x4219d9,_0x7e59('0xf'),JSON['stringify'](_0x3ebd40));if(_0x3ebd40[_0x7e59('0x10')]){if(_0x3ebd40[_0x7e59('0x10')]['code']===0x1f4){logger[_0x7e59('0x10')](_0x7e59('0x11'),_0x4219d9,_0x3ebd40['error'][_0x7e59('0x12')]);return _0x2d7cff(_0x3ebd40[_0x7e59('0x10')][_0x7e59('0x12')]);}logger['error'](_0x7e59('0x11'),_0x4219d9,_0x3ebd40[_0x7e59('0x10')]['message']);return _0x184ca5(_0x3ebd40['error'][_0x7e59('0x12')]);}else{logger[_0x7e59('0x13')](_0x7e59('0x11'),_0x4219d9,_0x7e59('0xf'));_0x184ca5(_0x3ebd40['result'][_0x7e59('0x12')]);}})[_0x7e59('0x14')](function(_0x4f06e6){logger[_0x7e59('0x10')](_0x7e59('0x11'),_0x4219d9,_0x4f06e6);_0x2d7cff(_0x4f06e6);});});}
\ No newline at end of file
index db604ee..fa7f6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b3c=['show','/:id/download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0x2b3c,0x1ac));var _0xc2b3=function(_0x359f25,_0x15f761){_0x359f25=_0x359f25-0x0;var _0x3c4fc2=_0x2b3c[_0x359f25];return _0x3c4fc2;};'use strict';var multer=require(_0xc2b3('0x0'));var util=require(_0xc2b3('0x1'));var path=require(_0xc2b3('0x2'));var timeout=require(_0xc2b3('0x3'));var express=require('express');var router=express[_0xc2b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc2b3('0x5'));var interaction=require(_0xc2b3('0x6'));var config=require(_0xc2b3('0x7'));var controller=require(_0xc2b3('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc2b3('0x9')](_0xc2b3('0xa'),auth[_0xc2b3('0xb')](),controller[_0xc2b3('0xc')]);router['get'](_0xc2b3('0xd'),auth['isAuthenticated'](),controller['download']);router[_0xc2b3('0xe')]('/',auth[_0xc2b3('0xb')](),controller[_0xc2b3('0xf')]);router[_0xc2b3('0x10')](_0xc2b3('0xa'),auth['isAuthenticated'](),controller[_0xc2b3('0x11')]);router[_0xc2b3('0x12')](_0xc2b3('0xa'),auth[_0xc2b3('0xb')](),controller[_0xc2b3('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x3d50=['../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x32e188,_0x5258b1){var _0x286892=function(_0x4a4fc0){while(--_0x4a4fc0){_0x32e188['push'](_0x32e188['shift']());}};_0x286892(++_0x5258b1);}(_0x3d50,0x14a));var _0x03d5=function(_0x1e086b,_0x14a6c3){_0x1e086b=_0x1e086b-0x0;var _0x2592d8=_0x3d50[_0x1e086b];return _0x2592d8;};'use strict';var multer=require(_0x03d5('0x0'));var util=require(_0x03d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x03d5('0x2'));var router=express[_0x03d5('0x3')]();var fs_extra=require(_0x03d5('0x4'));var auth=require(_0x03d5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x03d5('0x6'));var controller=require('./voiceMailMessage.controller');router[_0x03d5('0x7')]('/',auth[_0x03d5('0x8')](),controller[_0x03d5('0x9')]);router['get'](_0x03d5('0xa'),auth[_0x03d5('0x8')](),controller['show']);router[_0x03d5('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x03d5('0xb')]('/',auth[_0x03d5('0x8')](),controller[_0x03d5('0xc')]);router[_0x03d5('0xd')](_0x03d5('0xa'),auth[_0x03d5('0x8')](),controller[_0x03d5('0xe')]);router[_0x03d5('0xf')](_0x03d5('0xa'),auth[_0x03d5('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4888050..270d534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eba=['VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x6eba,0x143));var _0xa6eb=function(_0x4072fa,_0x46c0f8){_0x4072fa=_0x4072fa-0x0;var _0x10e45a=_0x6eba[_0x4072fa];return _0x10e45a;};'use strict';var Sequelize=require('sequelize');module[_0xa6eb('0x0')]={'name':{'type':Sequelize[_0xa6eb('0x1')],'get':function(_0x4f25d7){return this[_0xa6eb('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa6eb('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa6eb('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa6eb('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xa6eb('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa6eb('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xa6eb('0x4')](_0xa6eb('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa6eb('0x3')],'defaultValue':''},'stamp':{'type':_0xa6eb('0x6'),'defaultValue':Sequelize[_0xa6eb('0x7')](_0xa6eb('0x8'))}};
\ No newline at end of file
+var _0x06dd=['TIMESTAMP','literal','sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06dd,0xda));var _0xd06d=function(_0x2c1fc6,_0x292eab){_0x2c1fc6=_0x2c1fc6-0x0;var _0x59335b=_0x06dd[_0x2c1fc6];return _0x59335b;};'use strict';var Sequelize=require(_0xd06d('0x0'));module[_0xd06d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x241154){return this[_0xd06d('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd06d('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xd06d('0x5')](_0xd06d('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd06d('0x4')],'defaultValue':''},'stamp':{'type':_0xd06d('0x7'),'defaultValue':Sequelize[_0xd06d('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 3f5cfc1..d4b1b80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x125d=['ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','set','Content-Range','apply','update','destroy','then','end','error','stack','index','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','map','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','catch','create','body','find','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x2fb8e8,_0xda5c71){var _0x4e5d03=function(_0x4fe370){while(--_0x4fe370){_0x2fb8e8['push'](_0x2fb8e8['shift']());}};_0x4e5d03(++_0xda5c71);}(_0x125d,0x94));var _0xd125=function(_0x2a3f36,_0x494ff3){_0x2a3f36=_0x2a3f36-0x0;var _0x2d5690=_0x125d[_0x2a3f36];return _0x2d5690;};'use strict';var emlformat=require(_0xd125('0x0'));var rimraf=require(_0xd125('0x1'));var zipdir=require(_0xd125('0x2'));var jsonpatch=require(_0xd125('0x3'));var rp=require(_0xd125('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd125('0x5'));var util=require('util');var path=require(_0xd125('0x6'));var sox=require(_0xd125('0x7'));var csv=require(_0xd125('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd125('0x9'));var _=require('lodash');var squel=require(_0xd125('0xa'));var crypto=require(_0xd125('0xb'));var jsforce=require(_0xd125('0xc'));var deskjs=require(_0xd125('0xd'));var toCsv=require(_0xd125('0x8'));var querystring=require(_0xd125('0xe'));var Papa=require(_0xd125('0xf'));var Redis=require(_0xd125('0x10'));var authService=require(_0xd125('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd125('0x12'))(_0xd125('0x13'));var utils=require(_0xd125('0x14'));var config=require(_0xd125('0x15'));var licenseUtil=require(_0xd125('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d6f36,_0x31f8ad){_0x31f8ad=_0x31f8ad||0xcc;return function(_0x5f2a6f){if(_0x5f2a6f){return _0x5d6f36[_0xd125('0x17')](_0x31f8ad);}return _0x5d6f36[_0xd125('0x18')](_0x31f8ad)['end']();};}function respondWithResult(_0x49b72e,_0xf2c93){_0xf2c93=_0xf2c93||0xc8;return function(_0x198b79){if(_0x198b79){return _0x49b72e['status'](_0xf2c93)[_0xd125('0x19')](_0x198b79);}};}function respondWithFilteredResult(_0x27f4e8,_0x4209a5){return function(_0x5840b5){if(_0x5840b5){var _0x36097a=typeof _0x4209a5[_0xd125('0x1a')]==='undefined'&&typeof _0x4209a5[_0xd125('0x1b')]===_0xd125('0x1c');var _0x202391=_0x5840b5['count'];var _0xd09f6=_0x36097a?0x0:_0x4209a5[_0xd125('0x1a')];var _0x212785=_0x36097a?_0x5840b5['count']:_0x4209a5[_0xd125('0x1a')]+_0x4209a5['limit'];var _0x3492f7;if(_0x212785>=_0x202391){_0x212785=_0x202391;_0x3492f7=0xc8;}else{_0x3492f7=0xce;}_0x27f4e8['status'](_0x3492f7);return _0x27f4e8[_0xd125('0x1d')](_0xd125('0x1e'),_0xd09f6+'-'+_0x212785+'/'+_0x202391)[_0xd125('0x19')](_0x5840b5);}return null;};}function patchUpdates(_0x45df27){return function(_0x602dca){try{jsonpatch[_0xd125('0x1f')](_0x602dca,_0x45df27,!![]);}catch(_0x34326a){return BPromise['reject'](_0x34326a);}return _0x602dca['save']();};}function saveUpdates(_0x493d7d,_0x14b275){return function(_0x3e25d5){if(_0x3e25d5){return _0x3e25d5[_0xd125('0x20')](_0x493d7d)['then'](function(_0x3a9311){return _0x3a9311;});}return null;};}function removeEntity(_0x21e7a2,_0x5e64eb){return function(_0x49dc99){if(_0x49dc99){return _0x49dc99[_0xd125('0x21')]()[_0xd125('0x22')](function(){_0x21e7a2['status'](0xcc)[_0xd125('0x23')]();});}};}function handleEntityNotFound(_0xdae5b7,_0x20695e){return function(_0x37114b){if(!_0x37114b){_0xdae5b7[_0xd125('0x17')](0x194);}return _0x37114b;};}function handleError(_0x49a0cd,_0x4f4480){_0x4f4480=_0x4f4480||0x1f4;return function(_0x1eeb28){logger[_0xd125('0x24')](_0x1eeb28[_0xd125('0x25')]);if(_0x1eeb28['name']){delete _0x1eeb28['name'];}_0x49a0cd[_0xd125('0x18')](_0x4f4480)['send'](_0x1eeb28);};}exports[_0xd125('0x26')]=function(_0x4b35c4,_0x16fb0a){var _0xfba0b={},_0x1e88b2={},_0x338212={'count':0x0,'rows':[]};var _0x290ac3=_['map'](db[_0xd125('0x27')][_0xd125('0x28')],function(_0x1495aa){return{'name':_0x1495aa[_0xd125('0x29')],'type':_0x1495aa[_0xd125('0x2a')]['key']};});_0x1e88b2[_0xd125('0x2b')]=_[_0xd125('0x2c')](_[_0xd125('0x2d')](_0x290ac3,_0xd125('0x2e')),[_0xd125('0x2e')]);_0x1e88b2[_0xd125('0x2f')]=_[_0xd125('0x30')](_0x4b35c4[_0xd125('0x2f')]);_0x1e88b2[_0xd125('0x31')]=_[_0xd125('0x32')](_0x1e88b2[_0xd125('0x2b')],_0x1e88b2['query']);_0xfba0b['attributes']=_['intersection'](_0x1e88b2[_0xd125('0x2b')],qs[_0xd125('0x33')](_0x4b35c4[_0xd125('0x2f')][_0xd125('0x33')]));_0xfba0b[_0xd125('0x34')]=_0xfba0b['attributes'][_0xd125('0x35')]?_0xfba0b['attributes']:_0x1e88b2[_0xd125('0x2b')];if(!_0x4b35c4[_0xd125('0x2f')][_0xd125('0x36')]('nolimit')){_0xfba0b[_0xd125('0x1b')]=qs[_0xd125('0x1b')](_0x4b35c4['query']['limit']);_0xfba0b['offset']=qs['offset'](_0x4b35c4[_0xd125('0x2f')][_0xd125('0x1a')]);}_0xfba0b[_0xd125('0x37')]=qs[_0xd125('0x38')](_0x4b35c4['query']['sort']);_0xfba0b[_0xd125('0x39')]=qs[_0xd125('0x31')](_[_0xd125('0x3a')](_0x4b35c4['query'],_0x1e88b2[_0xd125('0x31')]),_0x290ac3);if(_0x4b35c4[_0xd125('0x2f')][_0xd125('0x3b')]){_0xfba0b[_0xd125('0x39')]=_[_0xd125('0x3c')](_0xfba0b['where'],{'$or':_['map'](_0x290ac3,function(_0x2f653c){if(_0x2f653c[_0xd125('0x2a')]!==_0xd125('0x3d')){var _0x2ab667={};_0x2ab667[_0x2f653c[_0xd125('0x2e')]]={'$like':'%'+_0x4b35c4['query'][_0xd125('0x3b')]+'%'};return _0x2ab667;}})});}_0xfba0b=_[_0xd125('0x3c')]({},_0xfba0b,_0x4b35c4[_0xd125('0x3e')]);var _0x3bd675={'where':_0xfba0b['where']};return db['VoiceMailMessage'][_0xd125('0x3f')](_0x3bd675)[_0xd125('0x22')](function(_0x1092d4){_0x338212['count']=_0x1092d4;if(_0x4b35c4[_0xd125('0x2f')][_0xd125('0x40')]){_0xfba0b[_0xd125('0x41')]=[{'all':!![]}];}return db[_0xd125('0x27')][_0xd125('0x42')](_0xfba0b);})[_0xd125('0x22')](function(_0x32ad83){_0x338212[_0xd125('0x43')]=_0x32ad83;return _0x338212;})['then'](respondWithFilteredResult(_0x16fb0a,_0xfba0b))['catch'](handleError(_0x16fb0a,null));};exports['show']=function(_0x2fe38a,_0x140eff){var _0x2ed445={'raw':!![],'where':{'id':_0x2fe38a[_0xd125('0x44')]['id']}},_0x42c93c={};_0x42c93c['model']=_[_0xd125('0x30')](db[_0xd125('0x27')]['rawAttributes']);_0x42c93c[_0xd125('0x2f')]=_[_0xd125('0x30')](_0x2fe38a[_0xd125('0x2f')]);_0x42c93c[_0xd125('0x31')]=_[_0xd125('0x32')](_0x42c93c[_0xd125('0x2b')],_0x42c93c[_0xd125('0x2f')]);_0x2ed445[_0xd125('0x34')]=_[_0xd125('0x32')](_0x42c93c[_0xd125('0x2b')],qs[_0xd125('0x33')](_0x2fe38a[_0xd125('0x2f')]['fields']));_0x2ed445['attributes']=_0x2ed445['attributes'][_0xd125('0x35')]?_0x2ed445[_0xd125('0x34')]:_0x42c93c['model'];if(_0x2fe38a[_0xd125('0x2f')][_0xd125('0x40')]){_0x2ed445[_0xd125('0x41')]=[{'all':!![]}];}_0x2ed445=_['merge']({},_0x2ed445,_0x2fe38a['options']);return db['VoiceMailMessage']['find'](_0x2ed445)['then'](handleEntityNotFound(_0x140eff,null))[_0xd125('0x22')](respondWithResult(_0x140eff,null))[_0xd125('0x45')](handleError(_0x140eff,null));};exports[_0xd125('0x46')]=function(_0x42025b,_0x49f1ff){return db[_0xd125('0x27')][_0xd125('0x46')](_0x42025b['body'],{})['then'](respondWithResult(_0x49f1ff,0xc9))['catch'](handleError(_0x49f1ff,null));};exports[_0xd125('0x20')]=function(_0x1b9b7b,_0x2f13bb){if(_0x1b9b7b[_0xd125('0x47')]['id']){delete _0x1b9b7b[_0xd125('0x47')]['id'];}return db[_0xd125('0x27')][_0xd125('0x48')]({'where':{'id':_0x1b9b7b[_0xd125('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f13bb,null))[_0xd125('0x22')](saveUpdates(_0x1b9b7b[_0xd125('0x47')],null))[_0xd125('0x22')](respondWithResult(_0x2f13bb,null))[_0xd125('0x45')](handleError(_0x2f13bb,null));};exports[_0xd125('0x21')]=function(_0x4ce363,_0x3fe275){return db[_0xd125('0x27')][_0xd125('0x48')]({'where':{'id':_0x4ce363['params']['id']}})[_0xd125('0x22')](handleEntityNotFound(_0x3fe275,null))[_0xd125('0x22')](removeEntity(_0x3fe275,null))[_0xd125('0x45')](handleError(_0x3fe275,null));};exports[_0xd125('0x49')]=function(_0x22cd40,_0x2fee05,_0x3d089d){return db[_0xd125('0x27')][_0xd125('0x48')]({'where':{'id':_0x22cd40[_0xd125('0x44')]['id']},'attributes':['id',_0xd125('0x4a'),'msg_id']})[_0xd125('0x22')](handleEntityNotFound(_0x2fee05,null))['then'](function(_0x4c4f23){if(_0x4c4f23){if(!_0x4c4f23[_0xd125('0x4a')]){throw new db[(_0xd125('0x4b'))]['ValidationError'](_0xd125('0x4c'));}var _0x5ab979={'Content-Type':_0xd125('0x4d'),'Content-Disposition':'attachment'};if(_0x4c4f23[_0xd125('0x4e')]){_0x5ab979['Content-Disposition']=_0xd125('0x4f')+_0x4c4f23[_0xd125('0x4e')]+_0xd125('0x50');}_0x2fee05[_0xd125('0x1d')](_0x5ab979);return _0x2fee05[_0xd125('0x51')](new Buffer(_0x4c4f23[_0xd125('0x4a')]));}})[_0xd125('0x45')](handleError(_0x2fee05,null));};
\ No newline at end of file
+var _0xbd92=['destroy','end','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','type','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','find','download','recording','VoiceMailMessage\x20not\x20found','attachment','msg_id','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','then'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0xbd92,0xd6));var _0x2bd9=function(_0x2d48f5,_0x49d2ac){_0x2d48f5=_0x2d48f5-0x0;var _0x1432a9=_0xbd92[_0x2d48f5];return _0x1432a9;};'use strict';var emlformat=require(_0x2bd9('0x0'));var rimraf=require(_0x2bd9('0x1'));var zipdir=require(_0x2bd9('0x2'));var jsonpatch=require(_0x2bd9('0x3'));var rp=require(_0x2bd9('0x4'));var moment=require(_0x2bd9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2bd9('0x6'));var util=require(_0x2bd9('0x7'));var path=require('path');var sox=require(_0x2bd9('0x8'));var csv=require('to-csv');var ejs=require(_0x2bd9('0x9'));var fs=require('fs');var fs_extra=require(_0x2bd9('0xa'));var _=require('lodash');var squel=require(_0x2bd9('0xb'));var crypto=require(_0x2bd9('0xc'));var jsforce=require(_0x2bd9('0xd'));var deskjs=require(_0x2bd9('0xe'));var toCsv=require(_0x2bd9('0xf'));var querystring=require(_0x2bd9('0x10'));var Papa=require(_0x2bd9('0x11'));var Redis=require(_0x2bd9('0x12'));var authService=require(_0x2bd9('0x13'));var qs=require(_0x2bd9('0x14'));var as=require(_0x2bd9('0x15'));var hardwareService=require(_0x2bd9('0x16'));var logger=require(_0x2bd9('0x17'))(_0x2bd9('0x18'));var utils=require(_0x2bd9('0x19'));var config=require(_0x2bd9('0x1a'));var licenseUtil=require(_0x2bd9('0x1b'));var db=require(_0x2bd9('0x1c'))['db'];function respondWithStatusCode(_0x5d42df,_0x105eac){_0x105eac=_0x105eac||0xcc;return function(_0x24a646){if(_0x24a646){return _0x5d42df[_0x2bd9('0x1d')](_0x105eac);}return _0x5d42df[_0x2bd9('0x1e')](_0x105eac)['end']();};}function respondWithResult(_0x89493c,_0x1191a2){_0x1191a2=_0x1191a2||0xc8;return function(_0x212d93){if(_0x212d93){return _0x89493c[_0x2bd9('0x1e')](_0x1191a2)[_0x2bd9('0x1f')](_0x212d93);}};}function respondWithFilteredResult(_0x2e0ccc,_0x43656d){return function(_0x39d407){if(_0x39d407){var _0x3f9fe5=typeof _0x43656d['offset']===_0x2bd9('0x20')&&typeof _0x43656d[_0x2bd9('0x21')]==='undefined';var _0x4758ff=_0x39d407['count'];var _0x50701c=_0x3f9fe5?0x0:_0x43656d[_0x2bd9('0x22')];var _0x2193c8=_0x3f9fe5?_0x39d407[_0x2bd9('0x23')]:_0x43656d[_0x2bd9('0x22')]+_0x43656d[_0x2bd9('0x21')];var _0x19e1a9;if(_0x2193c8>=_0x4758ff){_0x2193c8=_0x4758ff;_0x19e1a9=0xc8;}else{_0x19e1a9=0xce;}_0x2e0ccc['status'](_0x19e1a9);return _0x2e0ccc[_0x2bd9('0x24')](_0x2bd9('0x25'),_0x50701c+'-'+_0x2193c8+'/'+_0x4758ff)[_0x2bd9('0x1f')](_0x39d407);}return null;};}function patchUpdates(_0x375a28){return function(_0x35d3b9){try{jsonpatch['apply'](_0x35d3b9,_0x375a28,!![]);}catch(_0x362ea7){return BPromise[_0x2bd9('0x26')](_0x362ea7);}return _0x35d3b9[_0x2bd9('0x27')]();};}function saveUpdates(_0xb48e08,_0x1e9f1b){return function(_0xa1debd){if(_0xa1debd){return _0xa1debd['update'](_0xb48e08)[_0x2bd9('0x28')](function(_0x17e44c){return _0x17e44c;});}return null;};}function removeEntity(_0x766144,_0x5d74d6){return function(_0x2a2ce1){if(_0x2a2ce1){return _0x2a2ce1[_0x2bd9('0x29')]()[_0x2bd9('0x28')](function(){_0x766144[_0x2bd9('0x1e')](0xcc)[_0x2bd9('0x2a')]();});}};}function handleEntityNotFound(_0x337358,_0x53aff8){return function(_0x41c3bb){if(!_0x41c3bb){_0x337358[_0x2bd9('0x1d')](0x194);}return _0x41c3bb;};}function handleError(_0x57d227,_0x1e1ba1){_0x1e1ba1=_0x1e1ba1||0x1f4;return function(_0x5566ad){logger[_0x2bd9('0x2b')](_0x5566ad['stack']);if(_0x5566ad[_0x2bd9('0x2c')]){delete _0x5566ad['name'];}_0x57d227[_0x2bd9('0x1e')](_0x1e1ba1)[_0x2bd9('0x2d')](_0x5566ad);};}exports[_0x2bd9('0x2e')]=function(_0x12a8c0,_0x2b8f4a){var _0x15e90d={},_0x2e9e94={},_0x483fb8={'count':0x0,'rows':[]};var _0x370cb5=_[_0x2bd9('0x2f')](db[_0x2bd9('0x30')][_0x2bd9('0x31')],function(_0x9bac6b){return{'name':_0x9bac6b[_0x2bd9('0x32')],'type':_0x9bac6b['type'][_0x2bd9('0x33')]};});_0x2e9e94[_0x2bd9('0x34')]=_[_0x2bd9('0x35')](_['map'](_0x370cb5,_0x2bd9('0x2c')),[_0x2bd9('0x2c')]);_0x2e9e94['query']=_['keys'](_0x12a8c0['query']);_0x2e9e94[_0x2bd9('0x36')]=_[_0x2bd9('0x37')](_0x2e9e94[_0x2bd9('0x34')],_0x2e9e94[_0x2bd9('0x38')]);_0x15e90d['attributes']=_[_0x2bd9('0x37')](_0x2e9e94[_0x2bd9('0x34')],qs['fields'](_0x12a8c0[_0x2bd9('0x38')][_0x2bd9('0x39')]));_0x15e90d['attributes']=_0x15e90d[_0x2bd9('0x3a')][_0x2bd9('0x3b')]?_0x15e90d[_0x2bd9('0x3a')]:_0x2e9e94['model'];if(!_0x12a8c0['query'][_0x2bd9('0x3c')](_0x2bd9('0x3d'))){_0x15e90d['limit']=qs[_0x2bd9('0x21')](_0x12a8c0['query'][_0x2bd9('0x21')]);_0x15e90d['offset']=qs[_0x2bd9('0x22')](_0x12a8c0[_0x2bd9('0x38')][_0x2bd9('0x22')]);}_0x15e90d['order']=qs[_0x2bd9('0x3e')](_0x12a8c0[_0x2bd9('0x38')]['sort']);_0x15e90d[_0x2bd9('0x3f')]=qs['filters'](_['pick'](_0x12a8c0[_0x2bd9('0x38')],_0x2e9e94[_0x2bd9('0x36')]),_0x370cb5);if(_0x12a8c0[_0x2bd9('0x38')][_0x2bd9('0x40')]){_0x15e90d[_0x2bd9('0x3f')]=_['merge'](_0x15e90d['where'],{'$or':_[_0x2bd9('0x2f')](_0x370cb5,function(_0x26b2e8){if(_0x26b2e8[_0x2bd9('0x41')]!=='VIRTUAL'){var _0x4dd693={};_0x4dd693[_0x26b2e8[_0x2bd9('0x2c')]]={'$like':'%'+_0x12a8c0[_0x2bd9('0x38')][_0x2bd9('0x40')]+'%'};return _0x4dd693;}})});}_0x15e90d=_[_0x2bd9('0x42')]({},_0x15e90d,_0x12a8c0[_0x2bd9('0x43')]);var _0x2ff72c={'where':_0x15e90d['where']};return db['VoiceMailMessage'][_0x2bd9('0x23')](_0x2ff72c)[_0x2bd9('0x28')](function(_0x46e3b0){_0x483fb8[_0x2bd9('0x23')]=_0x46e3b0;if(_0x12a8c0[_0x2bd9('0x38')]['includeAll']){_0x15e90d[_0x2bd9('0x44')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2bd9('0x45')](_0x15e90d);})['then'](function(_0x2abbea){_0x483fb8[_0x2bd9('0x46')]=_0x2abbea;return _0x483fb8;})[_0x2bd9('0x28')](respondWithFilteredResult(_0x2b8f4a,_0x15e90d))[_0x2bd9('0x47')](handleError(_0x2b8f4a,null));};exports[_0x2bd9('0x48')]=function(_0xdb21e9,_0x2e98ac){var _0x3f2b36={'raw':!![],'where':{'id':_0xdb21e9[_0x2bd9('0x49')]['id']}},_0x5713b0={};_0x5713b0[_0x2bd9('0x34')]=_[_0x2bd9('0x4a')](db[_0x2bd9('0x30')]['rawAttributes']);_0x5713b0['query']=_['keys'](_0xdb21e9[_0x2bd9('0x38')]);_0x5713b0[_0x2bd9('0x36')]=_[_0x2bd9('0x37')](_0x5713b0[_0x2bd9('0x34')],_0x5713b0[_0x2bd9('0x38')]);_0x3f2b36['attributes']=_[_0x2bd9('0x37')](_0x5713b0[_0x2bd9('0x34')],qs[_0x2bd9('0x39')](_0xdb21e9[_0x2bd9('0x38')]['fields']));_0x3f2b36[_0x2bd9('0x3a')]=_0x3f2b36[_0x2bd9('0x3a')][_0x2bd9('0x3b')]?_0x3f2b36[_0x2bd9('0x3a')]:_0x5713b0[_0x2bd9('0x34')];if(_0xdb21e9[_0x2bd9('0x38')][_0x2bd9('0x4b')]){_0x3f2b36[_0x2bd9('0x44')]=[{'all':!![]}];}_0x3f2b36=_[_0x2bd9('0x42')]({},_0x3f2b36,_0xdb21e9[_0x2bd9('0x43')]);return db['VoiceMailMessage']['find'](_0x3f2b36)['then'](handleEntityNotFound(_0x2e98ac,null))[_0x2bd9('0x28')](respondWithResult(_0x2e98ac,null))[_0x2bd9('0x47')](handleError(_0x2e98ac,null));};exports[_0x2bd9('0x4c')]=function(_0x2911c1,_0x399b79){return db[_0x2bd9('0x30')][_0x2bd9('0x4c')](_0x2911c1[_0x2bd9('0x4d')],{})['then'](respondWithResult(_0x399b79,0xc9))['catch'](handleError(_0x399b79,null));};exports['update']=function(_0x20bd96,_0x355dcd){if(_0x20bd96['body']['id']){delete _0x20bd96[_0x2bd9('0x4d')]['id'];}return db[_0x2bd9('0x30')][_0x2bd9('0x4e')]({'where':{'id':_0x20bd96[_0x2bd9('0x49')]['id']}})[_0x2bd9('0x28')](handleEntityNotFound(_0x355dcd,null))[_0x2bd9('0x28')](saveUpdates(_0x20bd96[_0x2bd9('0x4d')],null))[_0x2bd9('0x28')](respondWithResult(_0x355dcd,null))[_0x2bd9('0x47')](handleError(_0x355dcd,null));};exports[_0x2bd9('0x29')]=function(_0x4ec66e,_0x3d7eab){return db[_0x2bd9('0x30')][_0x2bd9('0x4e')]({'where':{'id':_0x4ec66e[_0x2bd9('0x49')]['id']}})[_0x2bd9('0x28')](handleEntityNotFound(_0x3d7eab,null))[_0x2bd9('0x28')](removeEntity(_0x3d7eab,null))[_0x2bd9('0x47')](handleError(_0x3d7eab,null));};exports[_0x2bd9('0x4f')]=function(_0x177d72,_0x520cc1,_0x582866){return db[_0x2bd9('0x30')]['find']({'where':{'id':_0x177d72[_0x2bd9('0x49')]['id']},'attributes':['id',_0x2bd9('0x50'),'msg_id']})[_0x2bd9('0x28')](handleEntityNotFound(_0x520cc1,null))[_0x2bd9('0x28')](function(_0x9543a9){if(_0x9543a9){if(!_0x9543a9[_0x2bd9('0x50')]){throw new db['Sequelize']['ValidationError'](_0x2bd9('0x51'));}var _0x55e70a={'Content-Type':'audio/wav','Content-Disposition':_0x2bd9('0x52')};if(_0x9543a9[_0x2bd9('0x53')]){_0x55e70a['Content-Disposition']='attachment;\x20filename=\x22'+_0x9543a9[_0x2bd9('0x53')]+_0x2bd9('0x54');}_0x520cc1['set'](_0x55e70a);return _0x520cc1[_0x2bd9('0x2d')](new Buffer(_0x9543a9['recording']));}})[_0x2bd9('0x47')](handleError(_0x520cc1,null));};
\ No newline at end of file
index a55bd65..5bc0973 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dcf=['VoiceMailMessage','dir','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define'];(function(_0x3babca,_0x4a2446){var _0x29ad52=function(_0x37c1f1){while(--_0x37c1f1){_0x3babca['push'](_0x3babca['shift']());}};_0x29ad52(++_0x4a2446);}(_0x3dcf,0x17b));var _0xf3dc=function(_0xa3ecb,_0x58927e){_0xa3ecb=_0xa3ecb-0x0;var _0x5eca79=_0x3dcf[_0xa3ecb];return _0x5eca79;};'use strict';var _=require(_0xf3dc('0x0'));var util=require(_0xf3dc('0x1'));var logger=require(_0xf3dc('0x2'))('api');var moment=require(_0xf3dc('0x3'));var BPromise=require(_0xf3dc('0x4'));var rp=require(_0xf3dc('0x5'));var fs=require('fs');var path=require(_0xf3dc('0x6'));var rimraf=require(_0xf3dc('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3dc('0x8'));module[_0xf3dc('0x9')]=function(_0x2800bf,_0xa7f3bf){return _0x2800bf[_0xf3dc('0xa')](_0xf3dc('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xf3dc('0xc'),'fields':[_0xf3dc('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xa268=['VoiceMailMessage','voice_voicemail_messages','dir','util','moment','bluebird','path','../../config/environment','./voiceMailMessage.attributes'];(function(_0x3a4e18,_0xd83726){var _0x34dd5e=function(_0x579f40){while(--_0x579f40){_0x3a4e18['push'](_0x3a4e18['shift']());}};_0x34dd5e(++_0xd83726);}(_0xa268,0x81));var _0x8a26=function(_0x51b05d,_0x4a6691){_0x51b05d=_0x51b05d-0x0;var _0x31bcb8=_0xa268[_0x51b05d];return _0x31bcb8;};'use strict';var _=require('lodash');var util=require(_0x8a26('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8a26('0x1'));var BPromise=require(_0x8a26('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a26('0x3'));var rimraf=require('rimraf');var config=require(_0x8a26('0x4'));var attributes=require(_0x8a26('0x5'));module['exports']=function(_0x50ee8e,_0x49fee9){return _0x50ee8e['define'](_0x8a26('0x6'),attributes,{'tableName':_0x8a26('0x7'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x8a26('0x8')]}],'timestamps':![]});};
\ No newline at end of file
index 2f5cb43..e86b962 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a8b=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x51a7d9,_0x491943){var _0x348796=function(_0x5bf85d){while(--_0x5bf85d){_0x51a7d9['push'](_0x51a7d9['shift']());}};_0x348796(++_0x491943);}(_0x6a8b,0x153));var _0xb6a8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x6a8b[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xb6a8('0x0'));var util=require(_0xb6a8('0x1'));var moment=require(_0xb6a8('0x2'));var BPromise=require(_0xb6a8('0x3'));var rs=require(_0xb6a8('0x4'));var fs=require('fs');var Redis=require(_0xb6a8('0x5'));var db=require(_0xb6a8('0x6'))['db'];var utils=require(_0xb6a8('0x7'));var logger=require(_0xb6a8('0x8'))(_0xb6a8('0x9'));var config=require('../../config/environment');var jayson=require(_0xb6a8('0xa'));var client=jayson[_0xb6a8('0xb')][_0xb6a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4da8ab,_0x13d79f,_0x51d3f4){return new BPromise(function(_0x2c7641,_0x1c0abf){return client[_0xb6a8('0xd')](_0x4da8ab,_0x51d3f4)[_0xb6a8('0xe')](function(_0x4d791c){logger[_0xb6a8('0xf')](_0xb6a8('0x10'),_0x13d79f,_0xb6a8('0x11'));logger[_0xb6a8('0x12')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x13d79f,_0xb6a8('0x11'),JSON[_0xb6a8('0x13')](_0x4d791c));if(_0x4d791c['error']){if(_0x4d791c[_0xb6a8('0x14')][_0xb6a8('0x15')]===0x1f4){logger[_0xb6a8('0x14')](_0xb6a8('0x10'),_0x13d79f,_0x4d791c['error'][_0xb6a8('0x16')]);return _0x1c0abf(_0x4d791c[_0xb6a8('0x14')][_0xb6a8('0x16')]);}logger[_0xb6a8('0x14')](_0xb6a8('0x10'),_0x13d79f,_0x4d791c[_0xb6a8('0x14')][_0xb6a8('0x16')]);return _0x2c7641(_0x4d791c[_0xb6a8('0x14')][_0xb6a8('0x16')]);}else{logger[_0xb6a8('0xf')](_0xb6a8('0x10'),_0x13d79f,'request\x20sent');_0x2c7641(_0x4d791c[_0xb6a8('0x17')][_0xb6a8('0x16')]);}})['catch'](function(_0x957e11){logger['error'](_0xb6a8('0x10'),_0x13d79f,_0x957e11);_0x1c0abf(_0x957e11);});});}
\ No newline at end of file
+var _0x34e4=['http','then','info','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x18fc2d,_0x3d356a){var _0x409fc8=function(_0x432710){while(--_0x432710){_0x18fc2d['push'](_0x18fc2d['shift']());}};_0x409fc8(++_0x3d356a);}(_0x34e4,0xa0));var _0x434e=function(_0xa8868c,_0x148c73){_0xa8868c=_0xa8868c-0x0;var _0x1cef75=_0x34e4[_0xa8868c];return _0x1cef75;};'use strict';var _=require('lodash');var util=require(_0x434e('0x0'));var moment=require(_0x434e('0x1'));var BPromise=require(_0x434e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x434e('0x3'));var db=require(_0x434e('0x4'))['db'];var utils=require(_0x434e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x434e('0x6'));var jayson=require(_0x434e('0x7'));var client=jayson['client'][_0x434e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b6cfd,_0x493e22,_0x2d1790){return new BPromise(function(_0x5b14a0,_0x306c96){return client['request'](_0x2b6cfd,_0x2d1790)[_0x434e('0x9')](function(_0x24b04b){logger[_0x434e('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x493e22,'request\x20sent');logger[_0x434e('0xb')](_0x434e('0xc'),_0x493e22,'request\x20sent',JSON[_0x434e('0xd')](_0x24b04b));if(_0x24b04b[_0x434e('0xe')]){if(_0x24b04b[_0x434e('0xe')][_0x434e('0xf')]===0x1f4){logger['error'](_0x434e('0x10'),_0x493e22,_0x24b04b[_0x434e('0xe')][_0x434e('0x11')]);return _0x306c96(_0x24b04b[_0x434e('0xe')][_0x434e('0x11')]);}logger[_0x434e('0xe')](_0x434e('0x10'),_0x493e22,_0x24b04b[_0x434e('0xe')]['message']);return _0x5b14a0(_0x24b04b[_0x434e('0xe')][_0x434e('0x11')]);}else{logger[_0x434e('0xa')](_0x434e('0x10'),_0x493e22,_0x434e('0x12'));_0x5b14a0(_0x24b04b[_0x434e('0x13')]['message']);}})[_0x434e('0x14')](function(_0x36ccd0){logger[_0x434e('0xe')](_0x434e('0x10'),_0x493e22,_0x36ccd0);_0x306c96(_0x36ccd0);});});}
\ No newline at end of file
index 1075842..934c45a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b4=['update','delete','destroy','/:id/sounds/:id2','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','getSounds','post','create','addSound','/:id'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x90b4,0x8e));var _0x490b=function(_0x500fcb,_0x42dcf9){_0x500fcb=_0x500fcb-0x0;var _0x3f6a78=_0x90b4[_0x500fcb];return _0x3f6a78;};'use strict';var multer=require(_0x490b('0x0'));var util=require(_0x490b('0x1'));var path=require(_0x490b('0x2'));var timeout=require(_0x490b('0x3'));var express=require(_0x490b('0x4'));var router=express[_0x490b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x490b('0x6'));var config=require(_0x490b('0x7'));var controller=require(_0x490b('0x8'));router[_0x490b('0x9')]('/',auth[_0x490b('0xa')](),controller[_0x490b('0xb')]);router[_0x490b('0x9')]('/:id',auth[_0x490b('0xa')](),controller[_0x490b('0xc')]);router['get'](_0x490b('0xd'),auth[_0x490b('0xa')](),controller[_0x490b('0xe')]);router[_0x490b('0xf')]('/',auth['isAuthenticated'](),controller[_0x490b('0x10')]);router[_0x490b('0xf')](_0x490b('0xd'),auth['isAuthenticated'](),controller[_0x490b('0x11')]);router['put'](_0x490b('0x12'),auth[_0x490b('0xa')](),controller[_0x490b('0x13')]);router[_0x490b('0x14')](_0x490b('0x12'),auth['isAuthenticated'](),controller[_0x490b('0x15')]);router['delete'](_0x490b('0x16'),auth[_0x490b('0xa')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
+var _0xb586=['exports','multer','util','connect-timeout','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated','index','get','show','/:id/sounds','getSounds','post','create','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound'];(function(_0x26531f,_0x286ca7){var _0x133c8c=function(_0x3ee8cc){while(--_0x3ee8cc){_0x26531f['push'](_0x26531f['shift']());}};_0x133c8c(++_0x286ca7);}(_0xb586,0x6a));var _0x6b58=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0xb586[_0x589f71];return _0x5763bd;};'use strict';var multer=require(_0x6b58('0x0'));var util=require(_0x6b58('0x1'));var path=require('path');var timeout=require(_0x6b58('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6b58('0x3'));var config=require('../../config/environment');var controller=require(_0x6b58('0x4'));router['get']('/',auth[_0x6b58('0x5')](),controller[_0x6b58('0x6')]);router[_0x6b58('0x7')]('/:id',auth[_0x6b58('0x5')](),controller[_0x6b58('0x8')]);router[_0x6b58('0x7')](_0x6b58('0x9'),auth['isAuthenticated'](),controller[_0x6b58('0xa')]);router[_0x6b58('0xb')]('/',auth[_0x6b58('0x5')](),controller[_0x6b58('0xc')]);router[_0x6b58('0xb')](_0x6b58('0x9'),auth[_0x6b58('0x5')](),controller['addSound']);router[_0x6b58('0xd')](_0x6b58('0xe'),auth['isAuthenticated'](),controller[_0x6b58('0xf')]);router[_0x6b58('0x10')]('/:id',auth[_0x6b58('0x5')](),controller[_0x6b58('0x11')]);router[_0x6b58('0x10')](_0x6b58('0x12'),auth[_0x6b58('0x5')](),controller[_0x6b58('0x13')]);module[_0x6b58('0x14')]=router;
\ No newline at end of file
index 75eb17d..21c1dc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2306=['files','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','custom'];(function(_0x635744,_0x2e1d27){var _0x15c7f5=function(_0x180242){while(--_0x180242){_0x635744['push'](_0x635744['shift']());}};_0x15c7f5(++_0x2e1d27);}(_0x2306,0xf8));var _0x6230=function(_0x4d2c3a,_0x506a93){_0x4d2c3a=_0x4d2c3a-0x0;var _0x480e0d=_0x2306[_0x4d2c3a];return _0x480e0d;};'use strict';var Sequelize=require(_0x6230('0x0'));module[_0x6230('0x1')]={'name':{'type':Sequelize[_0x6230('0x2')],'allowNull':![],'unique':_0x6230('0x3')},'mode':{'type':Sequelize['ENUM'](_0x6230('0x4'),_0x6230('0x5'),'mp3nb',_0x6230('0x6'),'quietmp3',_0x6230('0x7')),'allowNull':!![],'defaultValue':_0x6230('0x5')},'directory':{'type':Sequelize[_0x6230('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x6230('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6230('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6230('0x2')],'allowNull':!![],'defaultValue':_0x6230('0x8')},'format':{'type':Sequelize[_0x6230('0x2')],'allowNull':!![]},'stamp':{'type':_0x6230('0x9')},'defaultEntry':{'type':Sequelize[_0x6230('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0469=['custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x4120c8,_0x2dc453){var _0x4310de=function(_0x11554c){while(--_0x11554c){_0x4120c8['push'](_0x4120c8['shift']());}};_0x4310de(++_0x2dc453);}(_0x0469,0xbf));var _0x9046=function(_0x226a41,_0x11ab55){_0x226a41=_0x226a41-0x0;var _0x42451e=_0x0469[_0x226a41];return _0x42451e;};'use strict';var Sequelize=require(_0x9046('0x0'));module[_0x9046('0x1')]={'name':{'type':Sequelize[_0x9046('0x2')],'allowNull':![],'unique':_0x9046('0x3')},'mode':{'type':Sequelize[_0x9046('0x4')](_0x9046('0x5'),_0x9046('0x6'),_0x9046('0x7'),_0x9046('0x8'),_0x9046('0x9'),_0x9046('0xa')),'allowNull':!![],'defaultValue':_0x9046('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x9046('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x9046('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x9046('0x2')],'allowNull':!![],'defaultValue':_0x9046('0xb')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x9046('0xc')},'defaultEntry':{'type':Sequelize[_0x9046('0xd')],'defaultValue':0x0}};
\ No newline at end of file
index 0977106..00017d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf58=['findAll','rows','catch','show','params','length','find','body','create','sequelize','files','directory','join','root','server/files/moh','mkdirSync','0777','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','unlinkSync','rmdirSync','Sequelize','ValidationError','message','Sound','basename','save_name','converted_format','format','%s.%s','symlinkSync','removeSound','findOne','id2','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','get','MusicOnHolds','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include'];(function(_0x481aad,_0x15d51d){var _0x118709=function(_0x576724){while(--_0x576724){_0x481aad['push'](_0x481aad['shift']());}};_0x118709(++_0x15d51d);}(_0xaf58,0x1d7));var _0x8af5=function(_0x31ea15,_0x3064bb){_0x31ea15=_0x31ea15-0x0;var _0x2dc294=_0xaf58[_0x31ea15];return _0x2dc294;};'use strict';var emlformat=require(_0x8af5('0x0'));var rimraf=require(_0x8af5('0x1'));var zipdir=require(_0x8af5('0x2'));var jsonpatch=require(_0x8af5('0x3'));var rp=require(_0x8af5('0x4'));var moment=require(_0x8af5('0x5'));var BPromise=require(_0x8af5('0x6'));var Mustache=require(_0x8af5('0x7'));var util=require('util');var path=require(_0x8af5('0x8'));var sox=require(_0x8af5('0x9'));var csv=require(_0x8af5('0xa'));var ejs=require(_0x8af5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8af5('0xc'));var squel=require('squel');var crypto=require(_0x8af5('0xd'));var jsforce=require(_0x8af5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8af5('0xf'));var Papa=require(_0x8af5('0x10'));var Redis=require('ioredis');var authService=require(_0x8af5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8af5('0x12'));var hardwareService=require(_0x8af5('0x13'));var logger=require(_0x8af5('0x14'))('api');var utils=require(_0x8af5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8af5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e701e,_0x1626b1){_0x1626b1=_0x1626b1||0xcc;return function(_0x460c30){if(_0x460c30){return _0x3e701e[_0x8af5('0x17')](_0x1626b1);}return _0x3e701e[_0x8af5('0x18')](_0x1626b1)['end']();};}function respondWithResult(_0x4a9268,_0x3ff16a){_0x3ff16a=_0x3ff16a||0xc8;return function(_0x4d14b9){if(_0x4d14b9){return _0x4a9268[_0x8af5('0x18')](_0x3ff16a)[_0x8af5('0x19')](_0x4d14b9);}};}function respondWithFilteredResult(_0x22d4f5,_0x3a4b82){return function(_0x5e7e8b){if(_0x5e7e8b){var _0x59b7d9=typeof _0x3a4b82['offset']===_0x8af5('0x1a')&&typeof _0x3a4b82[_0x8af5('0x1b')]===_0x8af5('0x1a');var _0x50cf06=_0x5e7e8b[_0x8af5('0x1c')];var _0x5ef134=_0x59b7d9?0x0:_0x3a4b82[_0x8af5('0x1d')];var _0x47b0cc=_0x59b7d9?_0x5e7e8b['count']:_0x3a4b82[_0x8af5('0x1d')]+_0x3a4b82[_0x8af5('0x1b')];var _0x1ce499;if(_0x47b0cc>=_0x50cf06){_0x47b0cc=_0x50cf06;_0x1ce499=0xc8;}else{_0x1ce499=0xce;}_0x22d4f5['status'](_0x1ce499);return _0x22d4f5[_0x8af5('0x1e')]('Content-Range',_0x5ef134+'-'+_0x47b0cc+'/'+_0x50cf06)[_0x8af5('0x19')](_0x5e7e8b);}return null;};}function patchUpdates(_0x521972){return function(_0x42df66){try{jsonpatch[_0x8af5('0x1f')](_0x42df66,_0x521972,!![]);}catch(_0x5d3eeb){return BPromise[_0x8af5('0x20')](_0x5d3eeb);}return _0x42df66[_0x8af5('0x21')]();};}function saveUpdates(_0x44b3c8,_0x1d3b82){return function(_0x326285){if(_0x326285){return _0x326285[_0x8af5('0x22')](_0x44b3c8)['then'](function(_0x26811f){return _0x26811f;});}return null;};}function removeEntity(_0x35ff9c,_0x55c1eb){return function(_0x520303){if(_0x520303){return _0x520303[_0x8af5('0x23')]()[_0x8af5('0x24')](function(){var _0x2987d0=_0x520303[_0x8af5('0x25')]({'plain':!![]});var _0x485de1=_0x8af5('0x26');return db[_0x8af5('0x27')][_0x8af5('0x23')]({'where':{'type':_0x485de1,'resourceId':_0x2987d0['id']}})['then'](function(){return _0x520303;});})['then'](function(){_0x35ff9c[_0x8af5('0x18')](0xcc)[_0x8af5('0x28')]();});}};}function handleEntityNotFound(_0x33d320,_0x3f27cf){return function(_0x5f3221){if(!_0x5f3221){_0x33d320[_0x8af5('0x17')](0x194);}return _0x5f3221;};}function handleError(_0x4f118e,_0x48e6b8){_0x48e6b8=_0x48e6b8||0x1f4;return function(_0xdda823){logger['error'](_0xdda823[_0x8af5('0x29')]);if(_0xdda823[_0x8af5('0x2a')]){delete _0xdda823['name'];}_0x4f118e[_0x8af5('0x18')](_0x48e6b8)[_0x8af5('0x2b')](_0xdda823);};}exports[_0x8af5('0x2c')]=function(_0x20bea8,_0x5a0084){var _0x5c31cc={},_0x92a382={},_0x27744c={'count':0x0,'rows':[]};var _0x13486e=_[_0x8af5('0x2d')](db['VoiceMusicOnHold'][_0x8af5('0x2e')],function(_0x18ea7f){return{'name':_0x18ea7f[_0x8af5('0x2f')],'type':_0x18ea7f[_0x8af5('0x30')][_0x8af5('0x31')]};});_0x92a382[_0x8af5('0x32')]=_[_0x8af5('0x2d')](_0x13486e,_0x8af5('0x2a'));_0x92a382[_0x8af5('0x33')]=_[_0x8af5('0x34')](_0x20bea8[_0x8af5('0x33')]);_0x92a382[_0x8af5('0x35')]=_[_0x8af5('0x36')](_0x92a382[_0x8af5('0x32')],_0x92a382[_0x8af5('0x33')]);_0x5c31cc[_0x8af5('0x37')]=_['intersection'](_0x92a382[_0x8af5('0x32')],qs[_0x8af5('0x38')](_0x20bea8[_0x8af5('0x33')][_0x8af5('0x38')]));_0x5c31cc[_0x8af5('0x37')]=_0x5c31cc[_0x8af5('0x37')]['length']?_0x5c31cc[_0x8af5('0x37')]:_0x92a382[_0x8af5('0x32')];if(!_0x20bea8[_0x8af5('0x33')][_0x8af5('0x39')]('nolimit')){_0x5c31cc['limit']=qs[_0x8af5('0x1b')](_0x20bea8['query']['limit']);_0x5c31cc[_0x8af5('0x1d')]=qs[_0x8af5('0x1d')](_0x20bea8[_0x8af5('0x33')][_0x8af5('0x1d')]);}_0x5c31cc[_0x8af5('0x3a')]=qs[_0x8af5('0x3b')](_0x20bea8['query'][_0x8af5('0x3b')]);delete _0x20bea8['query']['sort'];_0x5c31cc[_0x8af5('0x3c')]=qs[_0x8af5('0x35')](_[_0x8af5('0x3d')](_0x20bea8[_0x8af5('0x33')],_0x92a382[_0x8af5('0x35')]),_0x13486e);if(_0x20bea8[_0x8af5('0x33')][_0x8af5('0x3e')]){_0x5c31cc[_0x8af5('0x3c')]=_[_0x8af5('0x3f')](_0x5c31cc[_0x8af5('0x3c')],{'$or':_['map'](_0x13486e,function(_0x28adba){if(_0x28adba[_0x8af5('0x30')]!==_0x8af5('0x40')){var _0x591e1a={};_0x591e1a[_0x28adba[_0x8af5('0x2a')]]={'$like':'%'+_0x20bea8[_0x8af5('0x33')][_0x8af5('0x3e')]+'%'};return _0x591e1a;}})});}_0x5c31cc=_[_0x8af5('0x3f')]({},_0x5c31cc,_0x20bea8[_0x8af5('0x41')]);var _0x146d95={'where':_0x5c31cc[_0x8af5('0x3c')]};return db[_0x8af5('0x42')][_0x8af5('0x1c')](_0x146d95)[_0x8af5('0x24')](function(_0x2a2a57){_0x27744c['count']=_0x2a2a57;if(_0x20bea8[_0x8af5('0x33')][_0x8af5('0x43')]){_0x5c31cc[_0x8af5('0x44')]=[{'all':!![]}];}return db[_0x8af5('0x42')][_0x8af5('0x45')](_0x5c31cc);})[_0x8af5('0x24')](function(_0x5562ac){_0x27744c[_0x8af5('0x46')]=_0x5562ac;return _0x27744c;})[_0x8af5('0x24')](respondWithFilteredResult(_0x5a0084,_0x5c31cc))[_0x8af5('0x47')](handleError(_0x5a0084,null));};exports[_0x8af5('0x48')]=function(_0x57ddbb,_0x5843f7){var _0x49bdc5={'raw':![],'where':{'id':_0x57ddbb[_0x8af5('0x49')]['id']}},_0x53f980={};_0x53f980[_0x8af5('0x32')]=_[_0x8af5('0x34')](db[_0x8af5('0x42')][_0x8af5('0x2e')]);_0x53f980['query']=_[_0x8af5('0x34')](_0x57ddbb[_0x8af5('0x33')]);_0x53f980[_0x8af5('0x35')]=_[_0x8af5('0x36')](_0x53f980[_0x8af5('0x32')],_0x53f980[_0x8af5('0x33')]);_0x49bdc5[_0x8af5('0x37')]=_[_0x8af5('0x36')](_0x53f980['model'],qs[_0x8af5('0x38')](_0x57ddbb[_0x8af5('0x33')]['fields']));_0x49bdc5['attributes']=_0x49bdc5[_0x8af5('0x37')][_0x8af5('0x4a')]?_0x49bdc5[_0x8af5('0x37')]:_0x53f980['model'];if(_0x57ddbb[_0x8af5('0x33')]['includeAll']){_0x49bdc5[_0x8af5('0x44')]=[{'all':!![]}];}_0x49bdc5=_[_0x8af5('0x3f')]({},_0x49bdc5,_0x57ddbb['options']);return db[_0x8af5('0x42')][_0x8af5('0x4b')](_0x49bdc5)[_0x8af5('0x24')](handleEntityNotFound(_0x5843f7,null))[_0x8af5('0x24')](respondWithResult(_0x5843f7,null))['catch'](handleError(_0x5843f7,null));};exports[_0x8af5('0x22')]=function(_0x493a0f,_0x3d67aa){if(_0x493a0f[_0x8af5('0x4c')]['id']){delete _0x493a0f['body']['id'];}return db[_0x8af5('0x42')][_0x8af5('0x4b')]({'where':{'id':_0x493a0f[_0x8af5('0x49')]['id']}})['then'](handleEntityNotFound(_0x3d67aa,null))[_0x8af5('0x24')](saveUpdates(_0x493a0f['body'],null))['then'](respondWithResult(_0x3d67aa,null))['catch'](handleError(_0x3d67aa,null));};exports[_0x8af5('0x4d')]=function(_0x1b2ccd,_0x5f03dd,_0x173fe4){return db[_0x8af5('0x4e')]['transaction'](function(_0x5d14ab){if(_0x1b2ccd[_0x8af5('0x4c')]['mode']===_0x8af5('0x4f')){_0x1b2ccd[_0x8af5('0x4c')][_0x8af5('0x50')]=path[_0x8af5('0x51')](config[_0x8af5('0x52')],_0x8af5('0x53'),_0x1b2ccd[_0x8af5('0x4c')]['name']);}return db['VoiceMusicOnHold'][_0x8af5('0x4d')](_0x1b2ccd['body'],{'transaction':_0x5d14ab})['then'](function(_0x4812de){if(_0x1b2ccd[_0x8af5('0x4c')]['mode']===_0x8af5('0x4f')){fs[_0x8af5('0x54')](_0x4812de['directory'],parseInt(_0x8af5('0x55'),0x8));}var _0x464cc9=_0x1b2ccd['user'][_0x8af5('0x25')]({'plain':!![]});if(!_0x464cc9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x464cc9['role']===_0x8af5('0x56')){var _0x2b4767=_0x4812de[_0x8af5('0x25')]({'plain':!![]});return db['UserProfileSection'][_0x8af5('0x4b')]({'where':{'name':_0x8af5('0x26'),'userProfileId':_0x464cc9[_0x8af5('0x57')]},'raw':!![]})['then'](function(_0x56a13b){if(_0x56a13b&&_0x56a13b[_0x8af5('0x58')]===0x0){return db['UserProfileResource'][_0x8af5('0x4d')]({'name':_0x2b4767[_0x8af5('0x2a')],'resourceId':_0x2b4767['id'],'type':_0x56a13b['name'],'sectionId':_0x56a13b['id']},{})[_0x8af5('0x24')](function(){return _0x4812de;});}else{return _0x4812de;}})['catch'](function(_0x2bcdee){logger[_0x8af5('0x59')](_0x8af5('0x5a'),_0x2bcdee);});}return _0x4812de;});})[_0x8af5('0x24')](respondWithResult(_0x5f03dd,0xc9))[_0x8af5('0x47')](handleError(_0x5f03dd,null));};exports[_0x8af5('0x23')]=function(_0xedd79f,_0x4137aa,_0xc1be92){var _0x2fa509;return db['VoiceMusicOnHold']['find']({'where':{'id':_0xedd79f['params']['id']}})[_0x8af5('0x24')](function(_0x32dcab){if(_0x32dcab){return db['sequelize'][_0x8af5('0x5b')](function(_0x58fee2){return _0x32dcab[_0x8af5('0x23')]({'transaction':_0x58fee2,'raw':!![]})['then'](function(_0x574ea6){if(_0x574ea6['directory']){fs['readdirSync'](_0x574ea6[_0x8af5('0x50')])['forEach'](function(_0x337f6c){fs[_0x8af5('0x5c')](path[_0x8af5('0x51')](_0x574ea6[_0x8af5('0x50')],_0x337f6c));});fs[_0x8af5('0x5d')](_0x574ea6[_0x8af5('0x50')]);}return _0x574ea6;});})[_0x8af5('0x47')](function(_0x451974){throw new db[(_0x8af5('0x5e'))][(_0x8af5('0x5f'))](_0x451974[_0x8af5('0x60')]);});}})['then'](handleEntityNotFound(_0x4137aa,null))[_0x8af5('0x24')](removeEntity(_0x4137aa,null))[_0x8af5('0x47')](handleError(_0x4137aa,null));};exports['addSound']=function(_0x215349,_0x1e46bb,_0x16dce4){return db[_0x8af5('0x4e')][_0x8af5('0x5b')](function(_0x34b604){var _0x539bdf;return db[_0x8af5('0x42')][_0x8af5('0x4b')]({'where':{'id':_0x215349[_0x8af5('0x49')]['id']}})['then'](function(_0x8334a7){if(_0x8334a7){_0x539bdf=_0x8334a7;return _0x8334a7['addSound'](_0x215349['body']['id'],{'transaction':_0x34b604});}})[_0x8af5('0x24')](function(_0x5e1c66){if(_0x5e1c66){return db[_0x8af5('0x61')]['findOne']({'where':{'id':_0x215349[_0x8af5('0x4c')]['id']},'attributes':['id',_0x8af5('0x2a'),'save_name','converted_format','createdAt'],'raw':!![]});}})[_0x8af5('0x24')](function(_0x24056d){if(_0x24056d){var _0x49e5a3=path[_0x8af5('0x51')](config[_0x8af5('0x52')],'server/files/sounds/converted',util['format']('%s.%s',path[_0x8af5('0x62')](_0x24056d[_0x8af5('0x63')],path['extname'](_0x24056d[_0x8af5('0x63')])),_0x24056d[_0x8af5('0x64')]));var _0x4bc9ee=path[_0x8af5('0x51')](config[_0x8af5('0x52')],_0x8af5('0x53'),_0x539bdf[_0x8af5('0x2a')],util[_0x8af5('0x65')](_0x8af5('0x66'),_0x24056d[_0x8af5('0x2a')],_0x24056d[_0x8af5('0x64')]));fs[_0x8af5('0x67')](_0x49e5a3,_0x4bc9ee);return _0x24056d;}})[_0x8af5('0x47')](function(_0x32a36f){throw new db['Sequelize'][(_0x8af5('0x5f'))](_0x32a36f[_0x8af5('0x60')]);});})[_0x8af5('0x24')](handleEntityNotFound(_0x1e46bb,null))[_0x8af5('0x24')](respondWithResult(_0x1e46bb,0xc9))[_0x8af5('0x47')](handleError(_0x1e46bb,null));};exports[_0x8af5('0x68')]=function(_0x1087c2,_0x49270f,_0x28727e){return db[_0x8af5('0x4e')][_0x8af5('0x5b')](function(_0x4d1800){var _0x3eb783;return db[_0x8af5('0x42')][_0x8af5('0x69')]({'where':{'id':_0x1087c2[_0x8af5('0x49')]['id']}})[_0x8af5('0x24')](handleEntityNotFound(_0x49270f,null))['then'](function(_0x16320d){if(_0x16320d){_0x3eb783=_0x16320d;return _0x16320d[_0x8af5('0x68')](_0x1087c2[_0x8af5('0x49')][_0x8af5('0x6a')]);}})[_0x8af5('0x24')](function(_0x553ee6){if(_0x553ee6){return db[_0x8af5('0x61')][_0x8af5('0x69')]({'where':{'id':_0x1087c2[_0x8af5('0x49')]['id2']},'attributes':['id',_0x8af5('0x2a'),_0x8af5('0x63'),_0x8af5('0x64'),'createdAt'],'raw':!![]});}})[_0x8af5('0x24')](function(_0x46440d){if(_0x46440d){fs[_0x8af5('0x5c')](path['join'](_0x3eb783['directory'],util['format'](_0x8af5('0x66'),_0x46440d[_0x8af5('0x2a')],_0x46440d[_0x8af5('0x64')])));return _0x46440d;}})[_0x8af5('0x47')](function(_0x323313){throw new db[(_0x8af5('0x5e'))][(_0x8af5('0x5f'))](_0x323313[_0x8af5('0x60')]);});})[_0x8af5('0x24')](handleEntityNotFound(_0x49270f,null))[_0x8af5('0x24')](respondWithStatusCode(_0x49270f,0xcc))['catch'](handleError(_0x49270f,null));};exports[_0x8af5('0x6b')]=function(_0x37ca55,_0xab499,_0x20be50){var _0x4c9a31={};var _0x2c24cb={};var _0x27f6a7;var _0xaf4669;return db[_0x8af5('0x42')][_0x8af5('0x69')]({'where':{'id':_0x37ca55[_0x8af5('0x49')]['id']}})[_0x8af5('0x24')](handleEntityNotFound(_0xab499,null))['then'](function(_0x52b0a0){if(_0x52b0a0){_0x27f6a7=_0x52b0a0;_0x2c24cb[_0x8af5('0x32')]=_['keys'](db['Sound'][_0x8af5('0x2e')]);_0x2c24cb['query']=_[_0x8af5('0x34')](_0x37ca55['query']);_0x2c24cb['filters']=_['intersection'](_0x2c24cb[_0x8af5('0x32')],_0x2c24cb[_0x8af5('0x33')]);_0x4c9a31['attributes']=_[_0x8af5('0x36')](_0x2c24cb[_0x8af5('0x32')],qs[_0x8af5('0x38')](_0x37ca55[_0x8af5('0x33')][_0x8af5('0x38')]));_0x4c9a31[_0x8af5('0x37')]=_0x4c9a31[_0x8af5('0x37')]['length']?_0x4c9a31[_0x8af5('0x37')]:_0x2c24cb[_0x8af5('0x32')];_0x4c9a31['order']=qs[_0x8af5('0x3b')](_0x37ca55['query'][_0x8af5('0x3b')]);_0x4c9a31[_0x8af5('0x3c')]=qs[_0x8af5('0x35')](_[_0x8af5('0x3d')](_0x37ca55['query'],_0x2c24cb[_0x8af5('0x35')]));if(_0x37ca55[_0x8af5('0x33')][_0x8af5('0x3e')]){_0x4c9a31[_0x8af5('0x3c')]=_[_0x8af5('0x3f')](_0x4c9a31['where'],{'$or':_['map'](_0x4c9a31['attributes'],function(_0xab671){var _0x196534={};_0x196534[_0xab671]={'$like':'%'+_0x37ca55[_0x8af5('0x33')][_0x8af5('0x3e')]+'%'};return _0x196534;})});}_0x4c9a31=_['merge']({},_0x4c9a31,_0x37ca55[_0x8af5('0x41')]);return _0x27f6a7[_0x8af5('0x6b')](_0x4c9a31);}})[_0x8af5('0x24')](function(_0x23a583){if(_0x23a583){_0xaf4669=_0x23a583['length'];if(!_0x37ca55['query'][_0x8af5('0x39')]('nolimit')){_0x4c9a31[_0x8af5('0x1b')]=qs['limit'](_0x37ca55[_0x8af5('0x33')][_0x8af5('0x1b')]);_0x4c9a31[_0x8af5('0x1d')]=qs[_0x8af5('0x1d')](_0x37ca55['query'][_0x8af5('0x1d')]);}return _0x27f6a7[_0x8af5('0x6b')](_0x4c9a31);}})[_0x8af5('0x24')](function(_0x483479){if(_0x483479){return _0x483479?{'count':_0xaf4669,'rows':_0x483479}:null;}})[_0x8af5('0x24')](respondWithResult(_0xab499,null))['catch'](handleError(_0xab499,null));};
\ No newline at end of file
+var _0x86de=['directory','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','Sound','save_name','converted_format','createdAt','join','server/files/sounds/converted','%s.%s','extname','server/files/moh','format','message','removeSound','findOne','id2','getSounds','pick','eml-format','rimraf','zip-dir','bluebird','mustache','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','MusicOnHolds','end','error','stack','name','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','intersection','find','body','create','sequelize','transaction','mode','files','root','mkdirSync'];(function(_0x1e9887,_0x3dba5e){var _0x31ec1d=function(_0x4bd73a){while(--_0x4bd73a){_0x1e9887['push'](_0x1e9887['shift']());}};_0x31ec1d(++_0x3dba5e);}(_0x86de,0x150));var _0xe86d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x86de[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe86d('0x0'));var rimraf=require(_0xe86d('0x1'));var zipdir=require(_0xe86d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe86d('0x3'));var Mustache=require(_0xe86d('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe86d('0x5'));var csv=require(_0xe86d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe86d('0x7'));var squel=require(_0xe86d('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe86d('0x9'));var toCsv=require('to-csv');var querystring=require(_0xe86d('0xa'));var Papa=require(_0xe86d('0xb'));var Redis=require('ioredis');var authService=require(_0xe86d('0xc'));var qs=require(_0xe86d('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe86d('0xe'))(_0xe86d('0xf'));var utils=require('../../config/utils');var config=require(_0xe86d('0x10'));var licenseUtil=require(_0xe86d('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x386f54,_0x57dd5){_0x57dd5=_0x57dd5||0xcc;return function(_0x3e00d0){if(_0x3e00d0){return _0x386f54[_0xe86d('0x12')](_0x57dd5);}return _0x386f54[_0xe86d('0x13')](_0x57dd5)['end']();};}function respondWithResult(_0x4de29e,_0x19147e){_0x19147e=_0x19147e||0xc8;return function(_0x41f87d){if(_0x41f87d){return _0x4de29e[_0xe86d('0x13')](_0x19147e)[_0xe86d('0x14')](_0x41f87d);}};}function respondWithFilteredResult(_0x16f4ac,_0x417819){return function(_0x22eff0){if(_0x22eff0){var _0x4c7b43=typeof _0x417819[_0xe86d('0x15')]===_0xe86d('0x16')&&typeof _0x417819[_0xe86d('0x17')]===_0xe86d('0x16');var _0x23a3e0=_0x22eff0[_0xe86d('0x18')];var _0xd75c5=_0x4c7b43?0x0:_0x417819[_0xe86d('0x15')];var _0x329e59=_0x4c7b43?_0x22eff0[_0xe86d('0x18')]:_0x417819['offset']+_0x417819[_0xe86d('0x17')];var _0x1671f9;if(_0x329e59>=_0x23a3e0){_0x329e59=_0x23a3e0;_0x1671f9=0xc8;}else{_0x1671f9=0xce;}_0x16f4ac[_0xe86d('0x13')](_0x1671f9);return _0x16f4ac[_0xe86d('0x19')](_0xe86d('0x1a'),_0xd75c5+'-'+_0x329e59+'/'+_0x23a3e0)[_0xe86d('0x14')](_0x22eff0);}return null;};}function patchUpdates(_0x42410e){return function(_0x1740db){try{jsonpatch['apply'](_0x1740db,_0x42410e,!![]);}catch(_0x3606dd){return BPromise['reject'](_0x3606dd);}return _0x1740db[_0xe86d('0x1b')]();};}function saveUpdates(_0x240a00,_0x455f4f){return function(_0x1a7e98){if(_0x1a7e98){return _0x1a7e98[_0xe86d('0x1c')](_0x240a00)[_0xe86d('0x1d')](function(_0x53968b){return _0x53968b;});}return null;};}function removeEntity(_0x1e1faa,_0x5bd45f){return function(_0x3b7cf6){if(_0x3b7cf6){return _0x3b7cf6[_0xe86d('0x1e')]()[_0xe86d('0x1d')](function(){var _0x420a73=_0x3b7cf6[_0xe86d('0x1f')]({'plain':!![]});var _0x4b4780=_0xe86d('0x20');return db['UserProfileResource'][_0xe86d('0x1e')]({'where':{'type':_0x4b4780,'resourceId':_0x420a73['id']}})[_0xe86d('0x1d')](function(){return _0x3b7cf6;});})['then'](function(){_0x1e1faa[_0xe86d('0x13')](0xcc)[_0xe86d('0x21')]();});}};}function handleEntityNotFound(_0x4d2de9,_0x3b2419){return function(_0x2c03ed){if(!_0x2c03ed){_0x4d2de9[_0xe86d('0x12')](0x194);}return _0x2c03ed;};}function handleError(_0xc3c7ab,_0x4d0c73){_0x4d0c73=_0x4d0c73||0x1f4;return function(_0x372d1f){logger[_0xe86d('0x22')](_0x372d1f[_0xe86d('0x23')]);if(_0x372d1f['name']){delete _0x372d1f[_0xe86d('0x24')];}_0xc3c7ab[_0xe86d('0x13')](_0x4d0c73)['send'](_0x372d1f);};}exports['index']=function(_0x97197a,_0x1744a1){var _0x4fea8b={},_0x3d7e0f={},_0x4ba1b7={'count':0x0,'rows':[]};var _0x554a9a=_[_0xe86d('0x25')](db[_0xe86d('0x26')][_0xe86d('0x27')],function(_0x21f129){return{'name':_0x21f129[_0xe86d('0x28')],'type':_0x21f129[_0xe86d('0x29')][_0xe86d('0x2a')]};});_0x3d7e0f[_0xe86d('0x2b')]=_['map'](_0x554a9a,'name');_0x3d7e0f[_0xe86d('0x2c')]=_['keys'](_0x97197a[_0xe86d('0x2c')]);_0x3d7e0f[_0xe86d('0x2d')]=_['intersection'](_0x3d7e0f[_0xe86d('0x2b')],_0x3d7e0f['query']);_0x4fea8b[_0xe86d('0x2e')]=_['intersection'](_0x3d7e0f[_0xe86d('0x2b')],qs['fields'](_0x97197a[_0xe86d('0x2c')][_0xe86d('0x2f')]));_0x4fea8b[_0xe86d('0x2e')]=_0x4fea8b[_0xe86d('0x2e')][_0xe86d('0x30')]?_0x4fea8b['attributes']:_0x3d7e0f[_0xe86d('0x2b')];if(!_0x97197a['query'][_0xe86d('0x31')](_0xe86d('0x32'))){_0x4fea8b[_0xe86d('0x17')]=qs[_0xe86d('0x17')](_0x97197a['query'][_0xe86d('0x17')]);_0x4fea8b['offset']=qs[_0xe86d('0x15')](_0x97197a[_0xe86d('0x2c')]['offset']);}_0x4fea8b[_0xe86d('0x33')]=qs[_0xe86d('0x34')](_0x97197a['query'][_0xe86d('0x34')]);delete _0x97197a[_0xe86d('0x2c')][_0xe86d('0x34')];_0x4fea8b[_0xe86d('0x35')]=qs[_0xe86d('0x2d')](_['pick'](_0x97197a['query'],_0x3d7e0f[_0xe86d('0x2d')]),_0x554a9a);if(_0x97197a[_0xe86d('0x2c')]['filter']){_0x4fea8b[_0xe86d('0x35')]=_[_0xe86d('0x36')](_0x4fea8b[_0xe86d('0x35')],{'$or':_[_0xe86d('0x25')](_0x554a9a,function(_0x103994){if(_0x103994['type']!==_0xe86d('0x37')){var _0x3c09cb={};_0x3c09cb[_0x103994[_0xe86d('0x24')]]={'$like':'%'+_0x97197a[_0xe86d('0x2c')][_0xe86d('0x38')]+'%'};return _0x3c09cb;}})});}_0x4fea8b=_[_0xe86d('0x36')]({},_0x4fea8b,_0x97197a[_0xe86d('0x39')]);var _0x58b125={'where':_0x4fea8b[_0xe86d('0x35')]};return db[_0xe86d('0x26')][_0xe86d('0x18')](_0x58b125)[_0xe86d('0x1d')](function(_0x4c8fbf){_0x4ba1b7[_0xe86d('0x18')]=_0x4c8fbf;if(_0x97197a['query'][_0xe86d('0x3a')]){_0x4fea8b[_0xe86d('0x3b')]=[{'all':!![]}];}return db[_0xe86d('0x26')][_0xe86d('0x3c')](_0x4fea8b);})[_0xe86d('0x1d')](function(_0x43fc30){_0x4ba1b7[_0xe86d('0x3d')]=_0x43fc30;return _0x4ba1b7;})['then'](respondWithFilteredResult(_0x1744a1,_0x4fea8b))[_0xe86d('0x3e')](handleError(_0x1744a1,null));};exports[_0xe86d('0x3f')]=function(_0x2c52cd,_0x4f711f){var _0x282d92={'raw':![],'where':{'id':_0x2c52cd[_0xe86d('0x40')]['id']}},_0x591742={};_0x591742['model']=_[_0xe86d('0x41')](db['VoiceMusicOnHold'][_0xe86d('0x27')]);_0x591742[_0xe86d('0x2c')]=_[_0xe86d('0x41')](_0x2c52cd['query']);_0x591742[_0xe86d('0x2d')]=_[_0xe86d('0x42')](_0x591742[_0xe86d('0x2b')],_0x591742[_0xe86d('0x2c')]);_0x282d92[_0xe86d('0x2e')]=_['intersection'](_0x591742[_0xe86d('0x2b')],qs[_0xe86d('0x2f')](_0x2c52cd['query'][_0xe86d('0x2f')]));_0x282d92[_0xe86d('0x2e')]=_0x282d92[_0xe86d('0x2e')][_0xe86d('0x30')]?_0x282d92[_0xe86d('0x2e')]:_0x591742[_0xe86d('0x2b')];if(_0x2c52cd[_0xe86d('0x2c')][_0xe86d('0x3a')]){_0x282d92[_0xe86d('0x3b')]=[{'all':!![]}];}_0x282d92=_[_0xe86d('0x36')]({},_0x282d92,_0x2c52cd[_0xe86d('0x39')]);return db[_0xe86d('0x26')][_0xe86d('0x43')](_0x282d92)[_0xe86d('0x1d')](handleEntityNotFound(_0x4f711f,null))['then'](respondWithResult(_0x4f711f,null))['catch'](handleError(_0x4f711f,null));};exports['update']=function(_0x13dca7,_0x75bdc1){if(_0x13dca7[_0xe86d('0x44')]['id']){delete _0x13dca7[_0xe86d('0x44')]['id'];}return db[_0xe86d('0x26')][_0xe86d('0x43')]({'where':{'id':_0x13dca7[_0xe86d('0x40')]['id']}})['then'](handleEntityNotFound(_0x75bdc1,null))[_0xe86d('0x1d')](saveUpdates(_0x13dca7[_0xe86d('0x44')],null))['then'](respondWithResult(_0x75bdc1,null))['catch'](handleError(_0x75bdc1,null));};exports[_0xe86d('0x45')]=function(_0x1c98f4,_0x1a308b,_0x493099){return db[_0xe86d('0x46')][_0xe86d('0x47')](function(_0x1fce93){if(_0x1c98f4[_0xe86d('0x44')][_0xe86d('0x48')]===_0xe86d('0x49')){_0x1c98f4[_0xe86d('0x44')]['directory']=path['join'](config[_0xe86d('0x4a')],'server/files/moh',_0x1c98f4[_0xe86d('0x44')][_0xe86d('0x24')]);}return db[_0xe86d('0x26')][_0xe86d('0x45')](_0x1c98f4[_0xe86d('0x44')],{'transaction':_0x1fce93})[_0xe86d('0x1d')](function(_0x1e17b2){if(_0x1c98f4[_0xe86d('0x44')][_0xe86d('0x48')]===_0xe86d('0x49')){fs[_0xe86d('0x4b')](_0x1e17b2[_0xe86d('0x4c')],parseInt(_0xe86d('0x4d'),0x8));}var _0x14c666=_0x1c98f4['user'][_0xe86d('0x1f')]({'plain':!![]});if(!_0x14c666)throw new Error(_0xe86d('0x4e'));if(_0x14c666[_0xe86d('0x4f')]==='user'){var _0x456ab3=_0x1e17b2[_0xe86d('0x1f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe86d('0x20'),'userProfileId':_0x14c666['userProfileId']},'raw':!![]})[_0xe86d('0x1d')](function(_0x29e28a){if(_0x29e28a&&_0x29e28a[_0xe86d('0x50')]===0x0){return db['UserProfileResource'][_0xe86d('0x45')]({'name':_0x456ab3[_0xe86d('0x24')],'resourceId':_0x456ab3['id'],'type':_0x29e28a[_0xe86d('0x24')],'sectionId':_0x29e28a['id']},{})[_0xe86d('0x1d')](function(){return _0x1e17b2;});}else{return _0x1e17b2;}})['catch'](function(_0x419d68){logger[_0xe86d('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x419d68);});}return _0x1e17b2;});})[_0xe86d('0x1d')](respondWithResult(_0x1a308b,0xc9))['catch'](handleError(_0x1a308b,null));};exports[_0xe86d('0x1e')]=function(_0x5adb5d,_0xa548c,_0x5e963b){var _0x23e6c6;return db['VoiceMusicOnHold'][_0xe86d('0x43')]({'where':{'id':_0x5adb5d[_0xe86d('0x40')]['id']}})[_0xe86d('0x1d')](function(_0x34d1de){if(_0x34d1de){return db[_0xe86d('0x46')][_0xe86d('0x47')](function(_0x5e25e3){return _0x34d1de[_0xe86d('0x1e')]({'transaction':_0x5e25e3,'raw':!![]})[_0xe86d('0x1d')](function(_0x21ebf6){if(_0x21ebf6[_0xe86d('0x4c')]){fs[_0xe86d('0x51')](_0x21ebf6[_0xe86d('0x4c')])[_0xe86d('0x52')](function(_0x45f03f){fs[_0xe86d('0x53')](path['join'](_0x21ebf6['directory'],_0x45f03f));});fs[_0xe86d('0x54')](_0x21ebf6[_0xe86d('0x4c')]);}return _0x21ebf6;});})[_0xe86d('0x3e')](function(_0x389844){throw new db[(_0xe86d('0x55'))][(_0xe86d('0x56'))](_0x389844['message']);});}})[_0xe86d('0x1d')](handleEntityNotFound(_0xa548c,null))[_0xe86d('0x1d')](removeEntity(_0xa548c,null))[_0xe86d('0x3e')](handleError(_0xa548c,null));};exports['addSound']=function(_0x44031d,_0xd8633c,_0x282cb9){return db[_0xe86d('0x46')][_0xe86d('0x47')](function(_0x108bbc){var _0x45fd99;return db[_0xe86d('0x26')][_0xe86d('0x43')]({'where':{'id':_0x44031d[_0xe86d('0x40')]['id']}})['then'](function(_0x38abbb){if(_0x38abbb){_0x45fd99=_0x38abbb;return _0x38abbb['addSound'](_0x44031d['body']['id'],{'transaction':_0x108bbc});}})[_0xe86d('0x1d')](function(_0x5dee56){if(_0x5dee56){return db[_0xe86d('0x57')]['findOne']({'where':{'id':_0x44031d[_0xe86d('0x44')]['id']},'attributes':['id','name',_0xe86d('0x58'),_0xe86d('0x59'),_0xe86d('0x5a')],'raw':!![]});}})[_0xe86d('0x1d')](function(_0x4c430c){if(_0x4c430c){var _0x3aab76=path[_0xe86d('0x5b')](config[_0xe86d('0x4a')],_0xe86d('0x5c'),util['format'](_0xe86d('0x5d'),path['basename'](_0x4c430c['save_name'],path[_0xe86d('0x5e')](_0x4c430c[_0xe86d('0x58')])),_0x4c430c['converted_format']));var _0x14d073=path[_0xe86d('0x5b')](config['root'],_0xe86d('0x5f'),_0x45fd99[_0xe86d('0x24')],util[_0xe86d('0x60')](_0xe86d('0x5d'),_0x4c430c[_0xe86d('0x24')],_0x4c430c[_0xe86d('0x59')]));fs['symlinkSync'](_0x3aab76,_0x14d073);return _0x4c430c;}})[_0xe86d('0x3e')](function(_0x253d62){throw new db[(_0xe86d('0x55'))][(_0xe86d('0x56'))](_0x253d62[_0xe86d('0x61')]);});})[_0xe86d('0x1d')](handleEntityNotFound(_0xd8633c,null))[_0xe86d('0x1d')](respondWithResult(_0xd8633c,0xc9))[_0xe86d('0x3e')](handleError(_0xd8633c,null));};exports[_0xe86d('0x62')]=function(_0x528ec2,_0x36be23,_0x506f22){return db[_0xe86d('0x46')][_0xe86d('0x47')](function(_0x1f3b90){var _0x910583;return db[_0xe86d('0x26')][_0xe86d('0x63')]({'where':{'id':_0x528ec2['params']['id']}})[_0xe86d('0x1d')](handleEntityNotFound(_0x36be23,null))[_0xe86d('0x1d')](function(_0x29054d){if(_0x29054d){_0x910583=_0x29054d;return _0x29054d[_0xe86d('0x62')](_0x528ec2[_0xe86d('0x40')][_0xe86d('0x64')]);}})[_0xe86d('0x1d')](function(_0x27dd47){if(_0x27dd47){return db[_0xe86d('0x57')][_0xe86d('0x63')]({'where':{'id':_0x528ec2[_0xe86d('0x40')][_0xe86d('0x64')]},'attributes':['id','name','save_name','converted_format',_0xe86d('0x5a')],'raw':!![]});}})[_0xe86d('0x1d')](function(_0x29e3e1){if(_0x29e3e1){fs[_0xe86d('0x53')](path[_0xe86d('0x5b')](_0x910583[_0xe86d('0x4c')],util[_0xe86d('0x60')](_0xe86d('0x5d'),_0x29e3e1[_0xe86d('0x24')],_0x29e3e1[_0xe86d('0x59')])));return _0x29e3e1;}})[_0xe86d('0x3e')](function(_0x5d7234){throw new db[(_0xe86d('0x55'))]['ValidationError'](_0x5d7234[_0xe86d('0x61')]);});})['then'](handleEntityNotFound(_0x36be23,null))[_0xe86d('0x1d')](respondWithStatusCode(_0x36be23,0xcc))['catch'](handleError(_0x36be23,null));};exports[_0xe86d('0x65')]=function(_0x1e8716,_0x42b1af,_0x5f5ba3){var _0x3e35c0={};var _0x8a3668={};var _0x5d4df2;var _0x6321d8;return db[_0xe86d('0x26')][_0xe86d('0x63')]({'where':{'id':_0x1e8716['params']['id']}})[_0xe86d('0x1d')](handleEntityNotFound(_0x42b1af,null))[_0xe86d('0x1d')](function(_0x2daf33){if(_0x2daf33){_0x5d4df2=_0x2daf33;_0x8a3668['model']=_['keys'](db[_0xe86d('0x57')][_0xe86d('0x27')]);_0x8a3668['query']=_[_0xe86d('0x41')](_0x1e8716[_0xe86d('0x2c')]);_0x8a3668[_0xe86d('0x2d')]=_['intersection'](_0x8a3668[_0xe86d('0x2b')],_0x8a3668[_0xe86d('0x2c')]);_0x3e35c0[_0xe86d('0x2e')]=_[_0xe86d('0x42')](_0x8a3668[_0xe86d('0x2b')],qs[_0xe86d('0x2f')](_0x1e8716[_0xe86d('0x2c')][_0xe86d('0x2f')]));_0x3e35c0[_0xe86d('0x2e')]=_0x3e35c0[_0xe86d('0x2e')][_0xe86d('0x30')]?_0x3e35c0['attributes']:_0x8a3668['model'];_0x3e35c0[_0xe86d('0x33')]=qs['sort'](_0x1e8716[_0xe86d('0x2c')][_0xe86d('0x34')]);_0x3e35c0['where']=qs[_0xe86d('0x2d')](_[_0xe86d('0x66')](_0x1e8716['query'],_0x8a3668[_0xe86d('0x2d')]));if(_0x1e8716[_0xe86d('0x2c')][_0xe86d('0x38')]){_0x3e35c0[_0xe86d('0x35')]=_[_0xe86d('0x36')](_0x3e35c0[_0xe86d('0x35')],{'$or':_[_0xe86d('0x25')](_0x3e35c0['attributes'],function(_0x1a984e){var _0x35dd5e={};_0x35dd5e[_0x1a984e]={'$like':'%'+_0x1e8716[_0xe86d('0x2c')][_0xe86d('0x38')]+'%'};return _0x35dd5e;})});}_0x3e35c0=_[_0xe86d('0x36')]({},_0x3e35c0,_0x1e8716[_0xe86d('0x39')]);return _0x5d4df2[_0xe86d('0x65')](_0x3e35c0);}})[_0xe86d('0x1d')](function(_0x57791c){if(_0x57791c){_0x6321d8=_0x57791c['length'];if(!_0x1e8716[_0xe86d('0x2c')]['hasOwnProperty'](_0xe86d('0x32'))){_0x3e35c0[_0xe86d('0x17')]=qs[_0xe86d('0x17')](_0x1e8716['query']['limit']);_0x3e35c0['offset']=qs['offset'](_0x1e8716[_0xe86d('0x2c')]['offset']);}return _0x5d4df2[_0xe86d('0x65')](_0x3e35c0);}})[_0xe86d('0x1d')](function(_0x18efd2){if(_0x18efd2){return _0x18efd2?{'count':_0x6321d8,'rows':_0x18efd2}:null;}})['then'](respondWithResult(_0x42b1af,null))[_0xe86d('0x3e')](handleError(_0x42b1af,null));};
\ No newline at end of file
index 1002832..c1bfb78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb32=['voice_musiconhold','lodash','api','moment','bluebird','request-promise','../../config/environment','./voiceMusicOnHold.attributes','exports','define'];(function(_0x165ce3,_0x32671b){var _0x2c67b7=function(_0x5b6c8a){while(--_0x5b6c8a){_0x165ce3['push'](_0x165ce3['shift']());}};_0x2c67b7(++_0x32671b);}(_0xbb32,0x1c3));var _0x2bb3=function(_0x3951ff,_0x4a06e0){_0x3951ff=_0x3951ff-0x0;var _0x487314=_0xbb32[_0x3951ff];return _0x487314;};'use strict';var _=require(_0x2bb3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2bb3('0x1'));var moment=require(_0x2bb3('0x2'));var BPromise=require(_0x2bb3('0x3'));var rp=require(_0x2bb3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2bb3('0x5'));var attributes=require(_0x2bb3('0x6'));module[_0x2bb3('0x7')]=function(_0xa5ecab,_0x274f2f){return _0xa5ecab[_0x2bb3('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x2bb3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc7d=['../../config/environment','exports','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xdc7d,0xd5));var _0xddc7=function(_0x3acc95,_0x5ddf98){_0x3acc95=_0x3acc95-0x0;var _0x157112=_0xdc7d[_0x3acc95];return _0x157112;};'use strict';var _=require('lodash');var util=require(_0xddc7('0x0'));var logger=require(_0xddc7('0x1'))(_0xddc7('0x2'));var moment=require(_0xddc7('0x3'));var BPromise=require(_0xddc7('0x4'));var rp=require(_0xddc7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xddc7('0x6'));var config=require(_0xddc7('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xddc7('0x8')]=function(_0x524fd5,_0x42f95b){return _0x524fd5['define'](_0xddc7('0x9'),attributes,{'tableName':_0xddc7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f1f43a..7eb4f5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4a8a80,_0x15d0be){var _0xf6308=function(_0x5e7bd0){while(--_0x5e7bd0){_0x4a8a80['push'](_0x4a8a80['shift']());}};_0xf6308(++_0x15d0be);}(_0x70e0,0x17b));var _0x070e=function(_0x32bb80,_0x4ad480){_0x32bb80=_0x32bb80-0x0;var _0x22469b=_0x70e0[_0x32bb80];return _0x22469b;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
+var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x14b0bb,_0x212233){var _0x2a42aa=function(_0x4c45d7){while(--_0x4c45d7){_0x14b0bb['push'](_0x14b0bb['shift']());}};_0x2a42aa(++_0x212233);}(_0x70e0,0x17b));var _0x070e=function(_0x16086e,_0x3287e8){_0x16086e=_0x16086e-0x0;var _0x119062=_0x70e0[_0x16086e];return _0x119062;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
index b316af4..4488a93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3afe=['removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','/:id/users','getAgents','create','post','put','delete','destroy'];(function(_0x201da2,_0x152fdc){var _0x2afdcb=function(_0x4de387){while(--_0x4de387){_0x201da2['push'](_0x201da2['shift']());}};_0x2afdcb(++_0x152fdc);}(_0x3afe,0x135));var _0xe3af=function(_0x1c1081,_0xe2cb8c){_0x1c1081=_0x1c1081-0x0;var _0x506a1a=_0x3afe[_0x1c1081];return _0x506a1a;};'use strict';var multer=require(_0xe3af('0x0'));var util=require(_0xe3af('0x1'));var path=require(_0xe3af('0x2'));var timeout=require(_0xe3af('0x3'));var express=require(_0xe3af('0x4'));var router=express['Router']();var fs_extra=require(_0xe3af('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe3af('0x6'));var config=require(_0xe3af('0x7'));var controller=require(_0xe3af('0x8'));router[_0xe3af('0x9')]('/',auth[_0xe3af('0xa')](),controller['index']);router[_0xe3af('0x9')](_0xe3af('0xb'),auth[_0xe3af('0xa')](),controller[_0xe3af('0xc')]);router[_0xe3af('0x9')](_0xe3af('0xd'),auth[_0xe3af('0xa')](),controller['show']);router[_0xe3af('0x9')](_0xe3af('0xe'),auth[_0xe3af('0xa')](),controller[_0xe3af('0xf')]);router['post']('/',auth[_0xe3af('0xa')](),controller[_0xe3af('0x10')]);router[_0xe3af('0x11')](_0xe3af('0xe'),auth[_0xe3af('0xa')](),controller['addAgents']);router[_0xe3af('0x12')](_0xe3af('0xd'),auth[_0xe3af('0xa')](),controller['update']);router[_0xe3af('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe3af('0x14')]);router[_0xe3af('0x13')](_0xe3af('0xe'),auth[_0xe3af('0xa')](),controller[_0xe3af('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xcf4f=['../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','/:id/users','addAgents','update','destroy','delete','removeAgents','exports','multer','util','path','express','fs-extra'];(function(_0x334d52,_0x40d32b){var _0x32aacf=function(_0x2a904e){while(--_0x2a904e){_0x334d52['push'](_0x334d52['shift']());}};_0x32aacf(++_0x40d32b);}(_0xcf4f,0x163));var _0xfcf4=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcf4f[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require(_0xfcf4('0x0'));var util=require(_0xfcf4('0x1'));var path=require(_0xfcf4('0x2'));var timeout=require('connect-timeout');var express=require(_0xfcf4('0x3'));var router=express['Router']();var fs_extra=require(_0xfcf4('0x4'));var auth=require(_0xfcf4('0x5'));var interaction=require(_0xfcf4('0x6'));var config=require('../../config/environment');var controller=require(_0xfcf4('0x7'));router[_0xfcf4('0x8')]('/',auth[_0xfcf4('0x9')](),controller[_0xfcf4('0xa')]);router[_0xfcf4('0x8')](_0xfcf4('0xb'),auth[_0xfcf4('0x9')](),controller[_0xfcf4('0xc')]);router[_0xfcf4('0x8')](_0xfcf4('0xd'),auth[_0xfcf4('0x9')](),controller[_0xfcf4('0xe')]);router['get']('/:id/users',auth[_0xfcf4('0x9')](),controller['getAgents']);router[_0xfcf4('0xf')]('/',auth['isAuthenticated'](),controller[_0xfcf4('0x10')]);router['post'](_0xfcf4('0x11'),auth[_0xfcf4('0x9')](),controller[_0xfcf4('0x12')]);router['put'](_0xfcf4('0xd'),auth['isAuthenticated'](),controller[_0xfcf4('0x13')]);router['delete'](_0xfcf4('0xd'),auth[_0xfcf4('0x9')](),controller[_0xfcf4('0x14')]);router[_0xfcf4('0x15')]('/:id/users',auth[_0xfcf4('0x9')](),controller[_0xfcf4('0x16')]);module[_0xfcf4('0x17')]=router;
\ No newline at end of file
index 8c2fde9..7944a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c77=['STRING','VIRTUAL','system-','getDataValue','INTEGER','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c77,0x1cd));var _0x73c7=function(_0x3aca41,_0x49ff3a){_0x3aca41=_0x3aca41-0x0;var _0x1a3042=_0x3c77[_0x3aca41];return _0x1a3042;};'use strict';var Sequelize=require(_0x73c7('0x0'));module['exports']={'name':{'type':Sequelize[_0x73c7('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x73c7('0x2')],'get':function(_0x3cd1d5){return _0x73c7('0x3')+this[_0x73c7('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x73c7('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x73c7('0x5')]}};
\ No newline at end of file
+var _0x6c40=['sequelize','exports','STRING','name','VIRTUAL','system-','INTEGER'];(function(_0x86e316,_0x2d1fde){var _0x4d014d=function(_0x589905){while(--_0x589905){_0x86e316['push'](_0x86e316['shift']());}};_0x4d014d(++_0x2d1fde);}(_0x6c40,0x111));var _0x06c4=function(_0x46f4a7,_0x5b6334){_0x46f4a7=_0x46f4a7-0x0;var _0x1b584f=_0x6c40[_0x46f4a7];return _0x1b584f;};'use strict';var Sequelize=require(_0x06c4('0x0'));module[_0x06c4('0x1')]={'name':{'type':Sequelize[_0x06c4('0x2')],'allowNull':![],'unique':_0x06c4('0x3')},'prefix':{'type':Sequelize[_0x06c4('0x4')],'get':function(_0x2b33a2){return _0x06c4('0x5')+this['getDataValue'](_0x06c4('0x3'))+'-';}},'description':{'type':Sequelize[_0x06c4('0x2')]},'callerIdAll':{'type':Sequelize[_0x06c4('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x06c4('0x6')]}};
\ No newline at end of file
index 9601c2f..14f225b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3d4=['error','name','index','VoicePrefix','rawAttributes','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','UserProfileResource','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','push','callerIdAll','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','VoicePrefixes','destroy'];(function(_0x29fd78,_0x1d66d2){var _0x44ad0e=function(_0x10ede4){while(--_0x10ede4){_0x29fd78['push'](_0x29fd78['shift']());}};_0x44ad0e(++_0x1d66d2);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x71185f,_0x371d74){_0x71185f=_0x71185f-0x0;var _0x160ffe=_0xe3d4[_0x71185f];return _0x160ffe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require('mustache');var util=require(_0x4e3d('0x5'));var path=require('path');var sox=require(_0x4e3d('0x6'));var csv=require(_0x4e3d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e3d('0x8'));var _=require(_0x4e3d('0x9'));var squel=require('squel');var crypto=require(_0x4e3d('0xa'));var jsforce=require(_0x4e3d('0xb'));var deskjs=require(_0x4e3d('0xc'));var toCsv=require(_0x4e3d('0x7'));var querystring=require(_0x4e3d('0xd'));var Papa=require(_0x4e3d('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4e3d('0xf'));var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require(_0x4e3d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e3d('0x15'));var db=require(_0x4e3d('0x16'))['db'];config[_0x4e3d('0x17')]=_[_0x4e3d('0x18')](config[_0x4e3d('0x17')],{'host':_0x4e3d('0x19'),'port':0x18eb});var socket=require(_0x4e3d('0x1a'))(new Redis(config[_0x4e3d('0x17')]));require('./voicePrefix.socket')[_0x4e3d('0x1b')](socket);function respondWithStatusCode(_0x4325b4,_0x3b7b45){_0x3b7b45=_0x3b7b45||0xcc;return function(_0x5e0d2c){if(_0x5e0d2c){return _0x4325b4[_0x4e3d('0x1c')](_0x3b7b45);}return _0x4325b4[_0x4e3d('0x1d')](_0x3b7b45)[_0x4e3d('0x1e')]();};}function respondWithResult(_0xc20768,_0x1b829e){_0x1b829e=_0x1b829e||0xc8;return function(_0x364798){if(_0x364798){return _0xc20768[_0x4e3d('0x1d')](_0x1b829e)[_0x4e3d('0x1f')](_0x364798);}};}function respondWithFilteredResult(_0x554ba6,_0x2aab75){return function(_0x5129d5){if(_0x5129d5){var _0x4b74cb=typeof _0x2aab75[_0x4e3d('0x20')]==='undefined'&&typeof _0x2aab75['limit']===_0x4e3d('0x21');var _0x2e37ad=_0x5129d5[_0x4e3d('0x22')];var _0x318bd4=_0x4b74cb?0x0:_0x2aab75['offset'];var _0x35d75c=_0x4b74cb?_0x5129d5['count']:_0x2aab75[_0x4e3d('0x20')]+_0x2aab75['limit'];var _0x170f88;if(_0x35d75c>=_0x2e37ad){_0x35d75c=_0x2e37ad;_0x170f88=0xc8;}else{_0x170f88=0xce;}_0x554ba6[_0x4e3d('0x1d')](_0x170f88);return _0x554ba6[_0x4e3d('0x23')](_0x4e3d('0x24'),_0x318bd4+'-'+_0x35d75c+'/'+_0x2e37ad)[_0x4e3d('0x1f')](_0x5129d5);}return null;};}function patchUpdates(_0x2c8186){return function(_0x575c72){try{jsonpatch['apply'](_0x575c72,_0x2c8186,!![]);}catch(_0x18271a){return BPromise[_0x4e3d('0x25')](_0x18271a);}return _0x575c72[_0x4e3d('0x26')]();};}function saveUpdates(_0x49301f,_0x3e6b53){return function(_0x58a9cb){if(_0x58a9cb){return _0x58a9cb[_0x4e3d('0x27')](_0x49301f)[_0x4e3d('0x28')](function(_0x43bc1b){return _0x43bc1b;});}return null;};}function removeEntity(_0x50d9db,_0x2434ea){return function(_0xa6569b){if(_0xa6569b){return _0xa6569b['destroy']()[_0x4e3d('0x28')](function(){var _0x21d7e4=_0xa6569b[_0x4e3d('0x29')]({'plain':!![]});var _0x4a7820=_0x4e3d('0x2a');return db['UserProfileResource'][_0x4e3d('0x2b')]({'where':{'type':_0x4a7820,'resourceId':_0x21d7e4['id']}})['then'](function(){return _0xa6569b;});})[_0x4e3d('0x28')](function(){_0x50d9db[_0x4e3d('0x1d')](0xcc)[_0x4e3d('0x1e')]();});}};}function handleEntityNotFound(_0x4dfc6b,_0x2c5935){return function(_0x9133f9){if(!_0x9133f9){_0x4dfc6b['sendStatus'](0x194);}return _0x9133f9;};}function handleError(_0x57816d,_0x27983d){_0x27983d=_0x27983d||0x1f4;return function(_0x333fff){logger[_0x4e3d('0x2c')](_0x333fff['stack']);if(_0x333fff[_0x4e3d('0x2d')]){delete _0x333fff[_0x4e3d('0x2d')];}_0x57816d['status'](_0x27983d)['send'](_0x333fff);};}exports[_0x4e3d('0x2e')]=function(_0x21c9d1,_0x575957){var _0xefeafa={},_0x521cb5={},_0x2b00f6={'count':0x0,'rows':[]};var _0x14853f=_['map'](db[_0x4e3d('0x2f')][_0x4e3d('0x30')],function(_0x199070){return{'name':_0x199070['fieldName'],'type':_0x199070[_0x4e3d('0x31')][_0x4e3d('0x32')]};});_0x521cb5['model']=_[_0x4e3d('0x33')](_0x14853f,_0x4e3d('0x2d'));_0x521cb5['query']=_[_0x4e3d('0x34')](_0x21c9d1[_0x4e3d('0x35')]);_0x521cb5[_0x4e3d('0x36')]=_[_0x4e3d('0x37')](_0x521cb5[_0x4e3d('0x38')],_0x521cb5[_0x4e3d('0x35')]);_0xefeafa[_0x4e3d('0x39')]=_[_0x4e3d('0x37')](_0x521cb5[_0x4e3d('0x38')],qs[_0x4e3d('0x3a')](_0x21c9d1[_0x4e3d('0x35')]['fields']));_0xefeafa[_0x4e3d('0x39')]=_0xefeafa[_0x4e3d('0x39')][_0x4e3d('0x3b')]?_0xefeafa[_0x4e3d('0x39')]:_0x521cb5[_0x4e3d('0x38')];if(!_0x21c9d1[_0x4e3d('0x35')]['hasOwnProperty'](_0x4e3d('0x3c'))){_0xefeafa[_0x4e3d('0x3d')]=qs[_0x4e3d('0x3d')](_0x21c9d1[_0x4e3d('0x35')][_0x4e3d('0x3d')]);_0xefeafa[_0x4e3d('0x20')]=qs[_0x4e3d('0x20')](_0x21c9d1[_0x4e3d('0x35')][_0x4e3d('0x20')]);}_0xefeafa[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3f')](_0x21c9d1[_0x4e3d('0x35')][_0x4e3d('0x3f')]);_0xefeafa[_0x4e3d('0x40')]=qs[_0x4e3d('0x36')](_['pick'](_0x21c9d1[_0x4e3d('0x35')],_0x521cb5['filters']),_0x14853f);if(_0x21c9d1[_0x4e3d('0x35')][_0x4e3d('0x41')]){_0xefeafa[_0x4e3d('0x40')]=_[_0x4e3d('0x42')](_0xefeafa[_0x4e3d('0x40')],{'$or':_[_0x4e3d('0x33')](_0x14853f,function(_0x501d59){if(_0x501d59[_0x4e3d('0x31')]!==_0x4e3d('0x43')){var _0x452451={};_0x452451[_0x501d59[_0x4e3d('0x2d')]]={'$like':'%'+_0x21c9d1[_0x4e3d('0x35')]['filter']+'%'};return _0x452451;}})});}_0xefeafa=_['merge']({},_0xefeafa,_0x21c9d1[_0x4e3d('0x44')]);var _0x146227={'where':_0xefeafa[_0x4e3d('0x40')]};return db['VoicePrefix'][_0x4e3d('0x22')](_0x146227)[_0x4e3d('0x28')](function(_0x572134){_0x2b00f6[_0x4e3d('0x22')]=_0x572134;if(_0x21c9d1['query'][_0x4e3d('0x45')]){_0xefeafa[_0x4e3d('0x46')]=[{'all':!![]}];}return db[_0x4e3d('0x2f')]['findAll'](_0xefeafa);})[_0x4e3d('0x28')](function(_0x523c2b){_0x2b00f6[_0x4e3d('0x47')]=_0x523c2b;return _0x2b00f6;})[_0x4e3d('0x28')](respondWithFilteredResult(_0x575957,_0xefeafa))[_0x4e3d('0x48')](handleError(_0x575957,null));};exports['show']=function(_0x1f34b6,_0x29ca44){var _0x2dd481={'raw':![],'where':{'id':_0x1f34b6[_0x4e3d('0x49')]['id']}},_0x8e807d={};_0x8e807d[_0x4e3d('0x38')]=_[_0x4e3d('0x34')](db[_0x4e3d('0x2f')][_0x4e3d('0x30')]);_0x8e807d[_0x4e3d('0x35')]=_['keys'](_0x1f34b6[_0x4e3d('0x35')]);_0x8e807d[_0x4e3d('0x36')]=_[_0x4e3d('0x37')](_0x8e807d[_0x4e3d('0x38')],_0x8e807d[_0x4e3d('0x35')]);_0x2dd481[_0x4e3d('0x39')]=_[_0x4e3d('0x37')](_0x8e807d[_0x4e3d('0x38')],qs[_0x4e3d('0x3a')](_0x1f34b6[_0x4e3d('0x35')][_0x4e3d('0x3a')]));_0x2dd481[_0x4e3d('0x39')]=_0x2dd481['attributes']['length']?_0x2dd481[_0x4e3d('0x39')]:_0x8e807d['model'];if(_0x1f34b6[_0x4e3d('0x35')][_0x4e3d('0x45')]){_0x2dd481[_0x4e3d('0x46')]=[{'all':!![]}];}_0x2dd481=_[_0x4e3d('0x42')]({},_0x2dd481,_0x1f34b6[_0x4e3d('0x44')]);return db['VoicePrefix'][_0x4e3d('0x4a')](_0x2dd481)[_0x4e3d('0x28')](handleEntityNotFound(_0x29ca44,null))['then'](respondWithResult(_0x29ca44,null))['catch'](handleError(_0x29ca44,null));};exports['destroy']=function(_0x5e1f2e,_0x393854){return db[_0x4e3d('0x2f')][_0x4e3d('0x4a')]({'where':{'id':_0x5e1f2e[_0x4e3d('0x49')]['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x393854,null))[_0x4e3d('0x28')](removeEntity(_0x393854,null))[_0x4e3d('0x48')](handleError(_0x393854,null));};exports['describe']=function(_0x2ca8b5,_0x1aead6){return db[_0x4e3d('0x2f')][_0x4e3d('0x4b')]()['then'](respondWithResult(_0x1aead6,null))[_0x4e3d('0x48')](handleError(_0x1aead6,null));};exports[_0x4e3d('0x4c')]=function(_0x433c70,_0x17683d){var _0x4b074a;return db[_0x4e3d('0x4d')][_0x4e3d('0x4e')](function(_0x16f081){return db['VoicePrefix'][_0x4e3d('0x4c')](_0x433c70[_0x4e3d('0x4f')],{'transaction':_0x16f081})['then'](function(_0x5c1783){_0x4b074a=_0x5c1783[_0x4e3d('0x29')]({'plain':!![]});return db[_0x4e3d('0x50')][_0x4e3d('0x4a')]({'where':{'id':_0x4b074a[_0x4e3d('0x51')]},'raw':!![]})[_0x4e3d('0x28')](function(_0x490d8e){return createVoicePrefixExtensions(_0x4b074a,_0x490d8e,_0x16f081);});});})['then'](function(){var _0x1f6e6d=_0x433c70['user'][_0x4e3d('0x29')]({'plain':!![]});if(!_0x1f6e6d)throw new Error(_0x4e3d('0x52'));if(_0x1f6e6d['role']===_0x4e3d('0x53')){var _0x392003=_0x4b074a;return db['UserProfileSection'][_0x4e3d('0x4a')]({'where':{'name':'VoicePrefixes','userProfileId':_0x1f6e6d[_0x4e3d('0x54')]},'raw':!![]})[_0x4e3d('0x28')](function(_0x1dbef0){if(_0x1dbef0&&_0x1dbef0['autoAssociation']===0x0){return db[_0x4e3d('0x55')]['create']({'name':_0x392003['name'],'resourceId':_0x392003['id'],'type':_0x1dbef0[_0x4e3d('0x2d')],'sectionId':_0x1dbef0['id']},{})[_0x4e3d('0x28')](function(){return _0x4b074a;});}else{return _0x4b074a;}})[_0x4e3d('0x48')](function(_0x30cbb0){logger[_0x4e3d('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30cbb0);throw _0x30cbb0;});}return _0x4b074a;})[_0x4e3d('0x28')](respondWithResult(_0x17683d,null))['catch'](handleError(_0x17683d,null));};function Extension(_0x55c001,_0x515c9b,_0x5b7d99,_0x2958ca){this[_0x4e3d('0x56')]=_0x4e3d('0x57');this[_0x4e3d('0x58')]=_0x55c001;this[_0x4e3d('0x59')]=_0x5b7d99;this[_0x4e3d('0x31')]=_0x4e3d('0x5a');this[_0x4e3d('0x5b')]=_0x4e3d('0x5c');this['priority']=_0x515c9b;this[_0x4e3d('0x5d')]=_0x2958ca;}function createVoicePrefixExtensions(_0xde4cff,_0x1e983a,_0x53ab18){return new BPromise(function(_0x5f150a,_0xdf0610){var _0x62e7a4=new Extension(formatPrefixName(_0xde4cff[_0x4e3d('0x5e')]),0x1,_0x4e3d('0x5f'),_0x4e3d('0x60'));_0x62e7a4[_0x4e3d('0x61')]=_0xde4cff['id'];return db[_0x4e3d('0x50')][_0x4e3d('0x4c')](_0x62e7a4,{'transaction':_0x53ab18})[_0x4e3d('0x28')](function(_0x1530d1){var _0x45095f=_0x1530d1['get']({'plain':!![]});var _0x1bb8cf=_[_0x4e3d('0x33')](addVoicePrefixExtensions(_0xde4cff,_0x1e983a),function(_0x3d069f){_0x3d069f['VoiceExtensionId']=_0x45095f['id'];_0x3d069f[_0x4e3d('0x61')]=_0xde4cff['id'];return _0x3d069f;});return db[_0x4e3d('0x50')][_0x4e3d('0x62')](_0x1bb8cf,{'transaction':_0x53ab18})[_0x4e3d('0x28')](function(_0x1f47eb){if(!_0x1f47eb){return _0xdf0610(_0x4e3d('0x63'));}else{return _0x5f150a(_0x1f47eb);}})['catch'](function(_0xcf666b){return _0xdf0610(_0xcf666b);});});;});};function addVoicePrefixExtensions(_0x2d527f,_0x4e26ff){var _0xc2acc4=[];var _0x3839e0=formatPrefixName(_0x2d527f['prefix']);_0xc2acc4['push'](new Extension(_0x3839e0,0x2,_0x4e3d('0x64'),_0x4e3d('0x65')+_0x2d527f[_0x4e3d('0x2d')]));if(_0x2d527f['callerIdAll']){_0xc2acc4[_0x4e3d('0x66')](new Extension(_0x3839e0,0x3,'Set','PREFIX-CALLERIDALL='+_0x2d527f[_0x4e3d('0x67')]));}else{_0xc2acc4[_0x4e3d('0x66')](new Extension(_0x3839e0,0x3,'NoOp','No\x20callerid\x20available'));}_0xc2acc4[_0x4e3d('0x66')](new Extension(_0x3839e0,0x4,_0x4e3d('0x68'),_0x4e26ff[_0x4e3d('0x56')]+','+_0x4e3d('0x69')+(0x8+_0x2d527f[_0x4e3d('0x2d')][_0x4e3d('0x3b')])+'}'+','+0x1));return _0xc2acc4;}function formatPrefixName(_0x272382){var _0x597ec0='_';for(var _0x32a969=0x0;_0x32a969<_0x272382[_0x4e3d('0x3b')];_0x32a969++){if(_0x272382[_0x4e3d('0x6a')](_0x32a969)=='-'){_0x597ec0+=_0x272382[_0x4e3d('0x6a')](_0x32a969);}else{_0x597ec0+='['+_0x272382['charAt'](_0x32a969)+']';}}_0x597ec0+='.';return _0x597ec0;}exports['update']=function(_0x41f6db,_0x1a70d6,_0x10bb8f){var _0x160d3f=_0x41f6db[_0x4e3d('0x4f')];_0x160d3f[_0x4e3d('0x5e')]=_0x4e3d('0x6b')+_0x160d3f['name']+'-';return db[_0x4e3d('0x4d')][_0x4e3d('0x4e')](function(_0x29c290){return db[_0x4e3d('0x2f')][_0x4e3d('0x27')](_0x160d3f,{'where':{'id':_0x160d3f['id']},'transaction':_0x29c290})[_0x4e3d('0x28')](function(){return db[_0x4e3d('0x50')][_0x4e3d('0x2b')]({'where':{'VoicePrefixId':_0x160d3f['id']},'transaction':_0x29c290})[_0x4e3d('0x28')](function(){return db[_0x4e3d('0x50')][_0x4e3d('0x4a')]({'where':{'id':_0x160d3f[_0x4e3d('0x51')]},'raw':!![]})[_0x4e3d('0x28')](function(_0x35c824){return createVoicePrefixExtensions(_0x160d3f,_0x35c824,_0x29c290);});});});})['then'](function(){return db[_0x4e3d('0x2f')][_0x4e3d('0x6c')](_0x160d3f['id']);})[_0x4e3d('0x28')](respondWithResult(_0x1a70d6,null))['catch'](handleError(_0x1a70d6,null));};exports[_0x4e3d('0x6d')]=function(_0x373566,_0x1b45b9,_0x17b8a0){return db[_0x4e3d('0x2f')][_0x4e3d('0x4a')]({'where':{'id':_0x373566[_0x4e3d('0x49')]['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x1b45b9,null))[_0x4e3d('0x28')](function(_0x577bfc){if(_0x577bfc){return _0x577bfc[_0x4e3d('0x6d')](_0x373566[_0x4e3d('0x4f')][_0x4e3d('0x6e')],_[_0x4e3d('0x6f')](_0x373566['body'],['ids','id'])||{})[_0x4e3d('0x70')](function(_0xc33deb){for(var _0x268297=0x0;_0x268297<_0x373566['body'][_0x4e3d('0x6e')][_0x4e3d('0x3b')];_0x268297+=0x1){socket['emit'](_0x4e3d('0x71'),{'UserId':Number(_0x373566[_0x4e3d('0x4f')][_0x4e3d('0x6e')][_0x268297]),'VoicePrefixId':Number(_0x373566[_0x4e3d('0x49')]['id'])});}return _0xc33deb;});}})['then'](respondWithResult(_0x1b45b9,null))['catch'](handleError(_0x1b45b9,null));};exports['removeAgents']=function(_0x363f71,_0x5895f7,_0x5a26a6){return db['VoicePrefix'][_0x4e3d('0x4a')]({'where':{'id':_0x363f71[_0x4e3d('0x49')]['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x5895f7,null))[_0x4e3d('0x28')](function(_0x342098){if(_0x342098){return _0x342098[_0x4e3d('0x72')](_0x363f71[_0x4e3d('0x35')][_0x4e3d('0x6e')])[_0x4e3d('0x28')](function(){if(_[_0x4e3d('0x73')](_0x363f71['query'][_0x4e3d('0x6e')])){for(var _0x2e8f57=0x0;_0x2e8f57<_0x363f71[_0x4e3d('0x35')][_0x4e3d('0x6e')][_0x4e3d('0x3b')];_0x2e8f57+=0x1){socket[_0x4e3d('0x74')](_0x4e3d('0x75'),{'UserId':Number(_0x363f71[_0x4e3d('0x35')]['ids'][_0x2e8f57]),'VoicePrefixId':Number(_0x363f71[_0x4e3d('0x49')]['id'])});}}else{socket[_0x4e3d('0x74')](_0x4e3d('0x75'),{'UserId':Number(_0x363f71[_0x4e3d('0x35')]['ids']),'VoicePrefixId':Number(_0x363f71[_0x4e3d('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x5895f7,null))[_0x4e3d('0x48')](handleError(_0x5895f7,null));};exports[_0x4e3d('0x76')]=function(_0x3a3ebc,_0x2ceb09,_0xb3f80e){var _0x202805={};var _0x42a7b0={};var _0x29e020;var _0x2b15a5;return db[_0x4e3d('0x2f')][_0x4e3d('0x77')]({'where':{'id':_0x3a3ebc[_0x4e3d('0x49')]['id']}})[_0x4e3d('0x28')](handleEntityNotFound(_0x2ceb09,null))[_0x4e3d('0x28')](function(_0x14f259){if(_0x14f259){_0x29e020=_0x14f259;_0x42a7b0[_0x4e3d('0x38')]=_[_0x4e3d('0x34')](db[_0x4e3d('0x78')][_0x4e3d('0x30')]);_0x42a7b0[_0x4e3d('0x35')]=_[_0x4e3d('0x34')](_0x3a3ebc[_0x4e3d('0x35')]);_0x42a7b0[_0x4e3d('0x36')]=_[_0x4e3d('0x37')](_0x42a7b0[_0x4e3d('0x38')],_0x42a7b0[_0x4e3d('0x35')]);_0x202805[_0x4e3d('0x39')]=_[_0x4e3d('0x37')](_0x42a7b0['model'],qs['fields'](_0x3a3ebc[_0x4e3d('0x35')][_0x4e3d('0x3a')]));_0x202805[_0x4e3d('0x39')]=_0x202805[_0x4e3d('0x39')][_0x4e3d('0x3b')]?_0x202805[_0x4e3d('0x39')]:_0x42a7b0[_0x4e3d('0x38')];_0x202805[_0x4e3d('0x3e')]=qs[_0x4e3d('0x3f')](_0x3a3ebc[_0x4e3d('0x35')][_0x4e3d('0x3f')]);_0x202805[_0x4e3d('0x40')]=qs[_0x4e3d('0x36')](_['pick'](_0x3a3ebc['query'],_0x42a7b0['filters']));if(_0x3a3ebc[_0x4e3d('0x35')][_0x4e3d('0x41')]){_0x202805['where']=_['merge'](_0x202805[_0x4e3d('0x40')],{'$or':_[_0x4e3d('0x33')](_0x202805[_0x4e3d('0x39')],function(_0x448716){var _0x5549e9={};_0x5549e9[_0x448716]={'$like':'%'+_0x3a3ebc['query']['filter']+'%'};return _0x5549e9;})});}_0x202805=_[_0x4e3d('0x42')]({},_0x202805,_0x3a3ebc[_0x4e3d('0x44')]);return _0x29e020[_0x4e3d('0x76')](_0x202805);}})[_0x4e3d('0x28')](function(_0x5ad2e3){if(_0x5ad2e3){_0x2b15a5=_0x5ad2e3['length'];if(!_0x3a3ebc[_0x4e3d('0x35')]['hasOwnProperty'](_0x4e3d('0x3c'))){_0x202805['limit']=qs['limit'](_0x3a3ebc[_0x4e3d('0x35')]['limit']);_0x202805[_0x4e3d('0x20')]=qs[_0x4e3d('0x20')](_0x3a3ebc[_0x4e3d('0x35')][_0x4e3d('0x20')]);}return _0x29e020[_0x4e3d('0x76')](_0x202805);}})[_0x4e3d('0x28')](function(_0x224874){if(_0x224874){return _0x224874?{'count':_0x2b15a5,'rows':_0x224874}:null;}})[_0x4e3d('0x28')](respondWithResult(_0x2ceb09,null))['catch'](handleError(_0x2ceb09,null));};
\ No newline at end of file
+var _0x3aee=['filter','where','merge','type','options','include','catch','show','params','find','describe','transaction','create','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','sequelize','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','findOne','User','rawAttributes','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','index','map','VoicePrefix','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3ff2f9,_0x544ba1){var _0x3b0913=function(_0x554288){while(--_0x554288){_0x3ff2f9['push'](_0x3ff2f9['shift']());}};_0x3b0913(++_0x544ba1);}(_0x3aee,0x131));var _0xe3ae=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x3aee[_0x1d930e];return _0x5bbd66;};'use strict';var emlformat=require(_0xe3ae('0x0'));var rimraf=require(_0xe3ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ae('0x2'));var rp=require(_0xe3ae('0x3'));var moment=require(_0xe3ae('0x4'));var BPromise=require(_0xe3ae('0x5'));var Mustache=require(_0xe3ae('0x6'));var util=require(_0xe3ae('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe3ae('0x8'));var ejs=require(_0xe3ae('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ae('0xa'));var _=require(_0xe3ae('0xb'));var squel=require(_0xe3ae('0xc'));var crypto=require(_0xe3ae('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe3ae('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe3ae('0xf'));var Papa=require(_0xe3ae('0x10'));var Redis=require(_0xe3ae('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe3ae('0x12'));var logger=require(_0xe3ae('0x13'))(_0xe3ae('0x14'));var utils=require(_0xe3ae('0x15'));var config=require(_0xe3ae('0x16'));var licenseUtil=require(_0xe3ae('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xe3ae('0x18')](config[_0xe3ae('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe3ae('0x19')]));require('./voicePrefix.socket')[_0xe3ae('0x1a')](socket);function respondWithStatusCode(_0x16eb0d,_0x6ecd9b){_0x6ecd9b=_0x6ecd9b||0xcc;return function(_0x22c790){if(_0x22c790){return _0x16eb0d[_0xe3ae('0x1b')](_0x6ecd9b);}return _0x16eb0d['status'](_0x6ecd9b)[_0xe3ae('0x1c')]();};}function respondWithResult(_0x4b5826,_0x4e505a){_0x4e505a=_0x4e505a||0xc8;return function(_0x34ba70){if(_0x34ba70){return _0x4b5826[_0xe3ae('0x1d')](_0x4e505a)[_0xe3ae('0x1e')](_0x34ba70);}};}function respondWithFilteredResult(_0x5a2c7c,_0x23c395){return function(_0x1cd220){if(_0x1cd220){var _0x5b6872=typeof _0x23c395[_0xe3ae('0x1f')]==='undefined'&&typeof _0x23c395[_0xe3ae('0x20')]===_0xe3ae('0x21');var _0xd380f=_0x1cd220[_0xe3ae('0x22')];var _0x2272c0=_0x5b6872?0x0:_0x23c395[_0xe3ae('0x1f')];var _0x5dba66=_0x5b6872?_0x1cd220['count']:_0x23c395[_0xe3ae('0x1f')]+_0x23c395[_0xe3ae('0x20')];var _0x42ce83;if(_0x5dba66>=_0xd380f){_0x5dba66=_0xd380f;_0x42ce83=0xc8;}else{_0x42ce83=0xce;}_0x5a2c7c['status'](_0x42ce83);return _0x5a2c7c[_0xe3ae('0x23')](_0xe3ae('0x24'),_0x2272c0+'-'+_0x5dba66+'/'+_0xd380f)[_0xe3ae('0x1e')](_0x1cd220);}return null;};}function patchUpdates(_0x14aa59){return function(_0x2b07e8){try{jsonpatch[_0xe3ae('0x25')](_0x2b07e8,_0x14aa59,!![]);}catch(_0x2606db){return BPromise[_0xe3ae('0x26')](_0x2606db);}return _0x2b07e8[_0xe3ae('0x27')]();};}function saveUpdates(_0x36225b,_0x56b4f2){return function(_0x9e7ce0){if(_0x9e7ce0){return _0x9e7ce0[_0xe3ae('0x28')](_0x36225b)[_0xe3ae('0x29')](function(_0x5c1efa){return _0x5c1efa;});}return null;};}function removeEntity(_0xe3afdb,_0x2eaeed){return function(_0x2b5da5){if(_0x2b5da5){return _0x2b5da5[_0xe3ae('0x2a')]()['then'](function(){var _0xdc345a=_0x2b5da5[_0xe3ae('0x2b')]({'plain':!![]});var _0x437a51=_0xe3ae('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x437a51,'resourceId':_0xdc345a['id']}})[_0xe3ae('0x29')](function(){return _0x2b5da5;});})[_0xe3ae('0x29')](function(){_0xe3afdb[_0xe3ae('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d67e1,_0x5c4e65){return function(_0x3d4f53){if(!_0x3d4f53){_0x3d67e1['sendStatus'](0x194);}return _0x3d4f53;};}function handleError(_0x2021f7,_0x1c3bf9){_0x1c3bf9=_0x1c3bf9||0x1f4;return function(_0x243921){logger[_0xe3ae('0x2d')](_0x243921[_0xe3ae('0x2e')]);if(_0x243921[_0xe3ae('0x2f')]){delete _0x243921[_0xe3ae('0x2f')];}_0x2021f7[_0xe3ae('0x1d')](_0x1c3bf9)[_0xe3ae('0x30')](_0x243921);};}exports[_0xe3ae('0x31')]=function(_0x39341e,_0x2f1321){var _0x2e2147={},_0x265f8e={},_0x4c71fc={'count':0x0,'rows':[]};var _0xabf9f7=_[_0xe3ae('0x32')](db[_0xe3ae('0x33')]['rawAttributes'],function(_0x47a8f3){return{'name':_0x47a8f3[_0xe3ae('0x34')],'type':_0x47a8f3['type'][_0xe3ae('0x35')]};});_0x265f8e[_0xe3ae('0x36')]=_[_0xe3ae('0x32')](_0xabf9f7,'name');_0x265f8e[_0xe3ae('0x37')]=_[_0xe3ae('0x38')](_0x39341e[_0xe3ae('0x37')]);_0x265f8e[_0xe3ae('0x39')]=_[_0xe3ae('0x3a')](_0x265f8e[_0xe3ae('0x36')],_0x265f8e['query']);_0x2e2147[_0xe3ae('0x3b')]=_[_0xe3ae('0x3a')](_0x265f8e[_0xe3ae('0x36')],qs[_0xe3ae('0x3c')](_0x39341e[_0xe3ae('0x37')]['fields']));_0x2e2147['attributes']=_0x2e2147[_0xe3ae('0x3b')][_0xe3ae('0x3d')]?_0x2e2147[_0xe3ae('0x3b')]:_0x265f8e[_0xe3ae('0x36')];if(!_0x39341e[_0xe3ae('0x37')][_0xe3ae('0x3e')](_0xe3ae('0x3f'))){_0x2e2147[_0xe3ae('0x20')]=qs[_0xe3ae('0x20')](_0x39341e['query'][_0xe3ae('0x20')]);_0x2e2147['offset']=qs[_0xe3ae('0x1f')](_0x39341e[_0xe3ae('0x37')][_0xe3ae('0x1f')]);}_0x2e2147[_0xe3ae('0x40')]=qs[_0xe3ae('0x41')](_0x39341e[_0xe3ae('0x37')][_0xe3ae('0x41')]);_0x2e2147['where']=qs[_0xe3ae('0x39')](_[_0xe3ae('0x42')](_0x39341e[_0xe3ae('0x37')],_0x265f8e[_0xe3ae('0x39')]),_0xabf9f7);if(_0x39341e[_0xe3ae('0x37')][_0xe3ae('0x43')]){_0x2e2147[_0xe3ae('0x44')]=_[_0xe3ae('0x45')](_0x2e2147[_0xe3ae('0x44')],{'$or':_[_0xe3ae('0x32')](_0xabf9f7,function(_0x5419f6){if(_0x5419f6[_0xe3ae('0x46')]!=='VIRTUAL'){var _0x151fa6={};_0x151fa6[_0x5419f6[_0xe3ae('0x2f')]]={'$like':'%'+_0x39341e[_0xe3ae('0x37')][_0xe3ae('0x43')]+'%'};return _0x151fa6;}})});}_0x2e2147=_['merge']({},_0x2e2147,_0x39341e[_0xe3ae('0x47')]);var _0x3d2d11={'where':_0x2e2147[_0xe3ae('0x44')]};return db[_0xe3ae('0x33')][_0xe3ae('0x22')](_0x3d2d11)['then'](function(_0x2f08b4){_0x4c71fc[_0xe3ae('0x22')]=_0x2f08b4;if(_0x39341e[_0xe3ae('0x37')]['includeAll']){_0x2e2147[_0xe3ae('0x48')]=[{'all':!![]}];}return db[_0xe3ae('0x33')]['findAll'](_0x2e2147);})[_0xe3ae('0x29')](function(_0x28f8eb){_0x4c71fc['rows']=_0x28f8eb;return _0x4c71fc;})[_0xe3ae('0x29')](respondWithFilteredResult(_0x2f1321,_0x2e2147))[_0xe3ae('0x49')](handleError(_0x2f1321,null));};exports[_0xe3ae('0x4a')]=function(_0x51c3f6,_0x506066){var _0x591106={'raw':![],'where':{'id':_0x51c3f6[_0xe3ae('0x4b')]['id']}},_0x5ed912={};_0x5ed912[_0xe3ae('0x36')]=_[_0xe3ae('0x38')](db['VoicePrefix']['rawAttributes']);_0x5ed912['query']=_[_0xe3ae('0x38')](_0x51c3f6[_0xe3ae('0x37')]);_0x5ed912['filters']=_[_0xe3ae('0x3a')](_0x5ed912[_0xe3ae('0x36')],_0x5ed912[_0xe3ae('0x37')]);_0x591106[_0xe3ae('0x3b')]=_['intersection'](_0x5ed912[_0xe3ae('0x36')],qs['fields'](_0x51c3f6['query'][_0xe3ae('0x3c')]));_0x591106[_0xe3ae('0x3b')]=_0x591106['attributes'][_0xe3ae('0x3d')]?_0x591106[_0xe3ae('0x3b')]:_0x5ed912[_0xe3ae('0x36')];if(_0x51c3f6['query']['includeAll']){_0x591106[_0xe3ae('0x48')]=[{'all':!![]}];}_0x591106=_[_0xe3ae('0x45')]({},_0x591106,_0x51c3f6['options']);return db[_0xe3ae('0x33')][_0xe3ae('0x4c')](_0x591106)['then'](handleEntityNotFound(_0x506066,null))[_0xe3ae('0x29')](respondWithResult(_0x506066,null))[_0xe3ae('0x49')](handleError(_0x506066,null));};exports['destroy']=function(_0x46bc95,_0x41f07d){return db['VoicePrefix'][_0xe3ae('0x4c')]({'where':{'id':_0x46bc95[_0xe3ae('0x4b')]['id']}})[_0xe3ae('0x29')](handleEntityNotFound(_0x41f07d,null))['then'](removeEntity(_0x41f07d,null))[_0xe3ae('0x49')](handleError(_0x41f07d,null));};exports[_0xe3ae('0x4d')]=function(_0x2b1c17,_0x73cf35){return db[_0xe3ae('0x33')][_0xe3ae('0x4d')]()[_0xe3ae('0x29')](respondWithResult(_0x73cf35,null))['catch'](handleError(_0x73cf35,null));};exports['create']=function(_0x4b488e,_0x373029){var _0x1986ab;return db['sequelize'][_0xe3ae('0x4e')](function(_0x5b03b0){return db[_0xe3ae('0x33')][_0xe3ae('0x4f')](_0x4b488e['body'],{'transaction':_0x5b03b0})[_0xe3ae('0x29')](function(_0x480298){_0x1986ab=_0x480298[_0xe3ae('0x2b')]({'plain':!![]});return db[_0xe3ae('0x50')][_0xe3ae('0x4c')]({'where':{'id':_0x1986ab[_0xe3ae('0x51')]},'raw':!![]})[_0xe3ae('0x29')](function(_0x17658e){return createVoicePrefixExtensions(_0x1986ab,_0x17658e,_0x5b03b0);});});})[_0xe3ae('0x29')](function(){var _0x4d8327=_0x4b488e['user'][_0xe3ae('0x2b')]({'plain':!![]});if(!_0x4d8327)throw new Error(_0xe3ae('0x52'));if(_0x4d8327[_0xe3ae('0x53')]===_0xe3ae('0x54')){var _0x3c0a32=_0x1986ab;return db[_0xe3ae('0x55')][_0xe3ae('0x4c')]({'where':{'name':_0xe3ae('0x2c'),'userProfileId':_0x4d8327[_0xe3ae('0x56')]},'raw':!![]})[_0xe3ae('0x29')](function(_0x2a99fe){if(_0x2a99fe&&_0x2a99fe[_0xe3ae('0x57')]===0x0){return db[_0xe3ae('0x58')][_0xe3ae('0x4f')]({'name':_0x3c0a32['name'],'resourceId':_0x3c0a32['id'],'type':_0x2a99fe[_0xe3ae('0x2f')],'sectionId':_0x2a99fe['id']},{})[_0xe3ae('0x29')](function(){return _0x1986ab;});}else{return _0x1986ab;}})[_0xe3ae('0x49')](function(_0x52f49f){logger[_0xe3ae('0x2d')](_0xe3ae('0x59'),_0x52f49f);throw _0x52f49f;});}return _0x1986ab;})['then'](respondWithResult(_0x373029,null))[_0xe3ae('0x49')](handleError(_0x373029,null));};function Extension(_0x47a824,_0xeadfec,_0x42bc4f,_0x9236f5){this['context']=_0xe3ae('0x5a');this['exten']=_0x47a824;this[_0xe3ae('0x5b')]=_0x42bc4f;this['type']=_0xe3ae('0x5c');this[_0xe3ae('0x5d')]=_0xe3ae('0x5e');this['priority']=_0xeadfec;this['appdata']=_0x9236f5;}function createVoicePrefixExtensions(_0x1ee28b,_0x2e07af,_0x58f361){return new BPromise(function(_0x4d8daf,_0x16c7d8){var _0x59861d=new Extension(formatPrefixName(_0x1ee28b[_0xe3ae('0x5f')]),0x1,_0xe3ae('0x60'),'Voice\x20Prefix');_0x59861d[_0xe3ae('0x61')]=_0x1ee28b['id'];return db[_0xe3ae('0x50')][_0xe3ae('0x4f')](_0x59861d,{'transaction':_0x58f361})[_0xe3ae('0x29')](function(_0x4b153d){var _0x21b6bf=_0x4b153d['get']({'plain':!![]});var _0x3e82e8=_[_0xe3ae('0x32')](addVoicePrefixExtensions(_0x1ee28b,_0x2e07af),function(_0x50f2a3){_0x50f2a3[_0xe3ae('0x51')]=_0x21b6bf['id'];_0x50f2a3['VoicePrefixId']=_0x1ee28b['id'];return _0x50f2a3;});return db['VoiceExtension']['bulkCreate'](_0x3e82e8,{'transaction':_0x58f361})['then'](function(_0x14e91b){if(!_0x14e91b){return _0x16c7d8(_0xe3ae('0x62'));}else{return _0x4d8daf(_0x14e91b);}})[_0xe3ae('0x49')](function(_0x3f9e94){return _0x16c7d8(_0x3f9e94);});});;});};function addVoicePrefixExtensions(_0x2f77b3,_0x5daf9d){var _0x226533=[];var _0x170745=formatPrefixName(_0x2f77b3[_0xe3ae('0x5f')]);_0x226533[_0xe3ae('0x63')](new Extension(_0x170745,0x2,_0xe3ae('0x64'),'CDR(prefix)='+_0x2f77b3[_0xe3ae('0x2f')]));if(_0x2f77b3[_0xe3ae('0x65')]){_0x226533[_0xe3ae('0x63')](new Extension(_0x170745,0x3,'Set',_0xe3ae('0x66')+_0x2f77b3['callerIdAll']));}else{_0x226533[_0xe3ae('0x63')](new Extension(_0x170745,0x3,'NoOp',_0xe3ae('0x67')));}_0x226533[_0xe3ae('0x63')](new Extension(_0x170745,0x4,_0xe3ae('0x68'),_0x5daf9d[_0xe3ae('0x69')]+','+_0xe3ae('0x6a')+(0x8+_0x2f77b3['name'][_0xe3ae('0x3d')])+'}'+','+0x1));return _0x226533;}function formatPrefixName(_0x336645){var _0x37730f='_';for(var _0x6c558b=0x0;_0x6c558b<_0x336645[_0xe3ae('0x3d')];_0x6c558b++){if(_0x336645[_0xe3ae('0x6b')](_0x6c558b)=='-'){_0x37730f+=_0x336645[_0xe3ae('0x6b')](_0x6c558b);}else{_0x37730f+='['+_0x336645['charAt'](_0x6c558b)+']';}}_0x37730f+='.';return _0x37730f;}exports['update']=function(_0x4b4b4d,_0x293345,_0x552419){var _0x21fa9c=_0x4b4b4d[_0xe3ae('0x6c')];_0x21fa9c[_0xe3ae('0x5f')]=_0xe3ae('0x6d')+_0x21fa9c[_0xe3ae('0x2f')]+'-';return db[_0xe3ae('0x6e')][_0xe3ae('0x4e')](function(_0x2568d2){return db[_0xe3ae('0x33')]['update'](_0x21fa9c,{'where':{'id':_0x21fa9c['id']},'transaction':_0x2568d2})['then'](function(){return db['VoiceExtension'][_0xe3ae('0x2a')]({'where':{'VoicePrefixId':_0x21fa9c['id']},'transaction':_0x2568d2})[_0xe3ae('0x29')](function(){return db[_0xe3ae('0x50')][_0xe3ae('0x4c')]({'where':{'id':_0x21fa9c[_0xe3ae('0x51')]},'raw':!![]})[_0xe3ae('0x29')](function(_0x1c38eb){return createVoicePrefixExtensions(_0x21fa9c,_0x1c38eb,_0x2568d2);});});});})[_0xe3ae('0x29')](function(){return db[_0xe3ae('0x33')][_0xe3ae('0x6f')](_0x21fa9c['id']);})[_0xe3ae('0x29')](respondWithResult(_0x293345,null))[_0xe3ae('0x49')](handleError(_0x293345,null));};exports[_0xe3ae('0x70')]=function(_0x2dfd5c,_0x217de6,_0x34ee76){return db[_0xe3ae('0x33')]['find']({'where':{'id':_0x2dfd5c[_0xe3ae('0x4b')]['id']}})[_0xe3ae('0x29')](handleEntityNotFound(_0x217de6,null))[_0xe3ae('0x29')](function(_0x2b0aa2){if(_0x2b0aa2){return _0x2b0aa2[_0xe3ae('0x70')](_0x2dfd5c['body'][_0xe3ae('0x71')],_[_0xe3ae('0x72')](_0x2dfd5c['body'],['ids','id'])||{})[_0xe3ae('0x73')](function(_0x2a5d81){for(var _0x4451ea=0x0;_0x4451ea<_0x2dfd5c['body'][_0xe3ae('0x71')][_0xe3ae('0x3d')];_0x4451ea+=0x1){socket[_0xe3ae('0x74')](_0xe3ae('0x75'),{'UserId':Number(_0x2dfd5c[_0xe3ae('0x6c')][_0xe3ae('0x71')][_0x4451ea]),'VoicePrefixId':Number(_0x2dfd5c[_0xe3ae('0x4b')]['id'])});}return _0x2a5d81;});}})[_0xe3ae('0x29')](respondWithResult(_0x217de6,null))[_0xe3ae('0x49')](handleError(_0x217de6,null));};exports['removeAgents']=function(_0x1b995e,_0xd154cd,_0x5e3cca){return db[_0xe3ae('0x33')]['find']({'where':{'id':_0x1b995e[_0xe3ae('0x4b')]['id']}})[_0xe3ae('0x29')](handleEntityNotFound(_0xd154cd,null))[_0xe3ae('0x29')](function(_0x4b23a0){if(_0x4b23a0){return _0x4b23a0['removeAgents'](_0x1b995e[_0xe3ae('0x37')][_0xe3ae('0x71')])[_0xe3ae('0x29')](function(){if(_[_0xe3ae('0x76')](_0x1b995e[_0xe3ae('0x37')][_0xe3ae('0x71')])){for(var _0x5dc21d=0x0;_0x5dc21d<_0x1b995e[_0xe3ae('0x37')][_0xe3ae('0x71')][_0xe3ae('0x3d')];_0x5dc21d+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x1b995e['query'][_0xe3ae('0x71')][_0x5dc21d]),'VoicePrefixId':Number(_0x1b995e[_0xe3ae('0x4b')]['id'])});}}else{socket[_0xe3ae('0x74')](_0xe3ae('0x77'),{'UserId':Number(_0x1b995e['query'][_0xe3ae('0x71')]),'VoicePrefixId':Number(_0x1b995e[_0xe3ae('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0xd154cd,null))[_0xe3ae('0x49')](handleError(_0xd154cd,null));};exports[_0xe3ae('0x78')]=function(_0x556e45,_0x5a3601,_0xd57587){var _0x4fc4f9={};var _0xe139a6={};var _0x34168e;var _0x3a4c7a;return db[_0xe3ae('0x33')][_0xe3ae('0x79')]({'where':{'id':_0x556e45['params']['id']}})[_0xe3ae('0x29')](handleEntityNotFound(_0x5a3601,null))[_0xe3ae('0x29')](function(_0x80a451){if(_0x80a451){_0x34168e=_0x80a451;_0xe139a6[_0xe3ae('0x36')]=_[_0xe3ae('0x38')](db[_0xe3ae('0x7a')][_0xe3ae('0x7b')]);_0xe139a6[_0xe3ae('0x37')]=_['keys'](_0x556e45['query']);_0xe139a6[_0xe3ae('0x39')]=_[_0xe3ae('0x3a')](_0xe139a6[_0xe3ae('0x36')],_0xe139a6['query']);_0x4fc4f9[_0xe3ae('0x3b')]=_[_0xe3ae('0x3a')](_0xe139a6[_0xe3ae('0x36')],qs[_0xe3ae('0x3c')](_0x556e45[_0xe3ae('0x37')]['fields']));_0x4fc4f9[_0xe3ae('0x3b')]=_0x4fc4f9['attributes'][_0xe3ae('0x3d')]?_0x4fc4f9[_0xe3ae('0x3b')]:_0xe139a6[_0xe3ae('0x36')];_0x4fc4f9['order']=qs[_0xe3ae('0x41')](_0x556e45[_0xe3ae('0x37')][_0xe3ae('0x41')]);_0x4fc4f9['where']=qs['filters'](_['pick'](_0x556e45[_0xe3ae('0x37')],_0xe139a6[_0xe3ae('0x39')]));if(_0x556e45[_0xe3ae('0x37')][_0xe3ae('0x43')]){_0x4fc4f9[_0xe3ae('0x44')]=_[_0xe3ae('0x45')](_0x4fc4f9['where'],{'$or':_['map'](_0x4fc4f9[_0xe3ae('0x3b')],function(_0x9b68fb){var _0x4f4c09={};_0x4f4c09[_0x9b68fb]={'$like':'%'+_0x556e45[_0xe3ae('0x37')]['filter']+'%'};return _0x4f4c09;})});}_0x4fc4f9=_[_0xe3ae('0x45')]({},_0x4fc4f9,_0x556e45[_0xe3ae('0x47')]);return _0x34168e[_0xe3ae('0x78')](_0x4fc4f9);}})[_0xe3ae('0x29')](function(_0x405609){if(_0x405609){_0x3a4c7a=_0x405609[_0xe3ae('0x3d')];if(!_0x556e45['query'][_0xe3ae('0x3e')](_0xe3ae('0x3f'))){_0x4fc4f9[_0xe3ae('0x20')]=qs[_0xe3ae('0x20')](_0x556e45[_0xe3ae('0x37')][_0xe3ae('0x20')]);_0x4fc4f9[_0xe3ae('0x1f')]=qs['offset'](_0x556e45[_0xe3ae('0x37')][_0xe3ae('0x1f')]);}return _0x34168e['getAgents'](_0x4fc4f9);}})[_0xe3ae('0x29')](function(_0x3a6e7f){if(_0x3a6e7f){return _0x3a6e7f?{'count':_0x3a4c7a,'rows':_0x3a6e7f}:null;}})['then'](respondWithResult(_0x5a3601,null))[_0xe3ae('0x49')](handleError(_0x5a3601,null));};
\ No newline at end of file
index 5e97f12..8b43ad7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ff=['../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x23652f,_0x1ee2bb){var _0x423a54=function(_0x1fb655){while(--_0x1fb655){_0x23652f['push'](_0x23652f['shift']());}};_0x423a54(++_0x1ee2bb);}(_0x22ff,0xbd));var _0xf22f=function(_0x409582,_0x1f0415){_0x409582=_0x409582-0x0;var _0xc9369d=_0x22ff[_0x409582];return _0xc9369d;};'use strict';var EventEmitter=require(_0xf22f('0x0'));var VoicePrefix=require(_0xf22f('0x1'))['db'][_0xf22f('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xf22f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf22f('0x4'),'afterDestroy':_0xf22f('0x5')};function emitEvent(_0x5ad975){return function(_0x30d87c,_0x39fac9,_0x579eba){VoicePrefixEvents[_0xf22f('0x6')](_0x5ad975+':'+_0x30d87c['id'],_0x30d87c);VoicePrefixEvents[_0xf22f('0x6')](_0x5ad975,_0x30d87c);_0x579eba(null);};}for(var e in events){if(events[_0xf22f('0x7')](e)){var event=events[e];VoicePrefix[_0xf22f('0x8')](e,emitEvent(event));}}module[_0xf22f('0x9')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x2ddc=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','save','update'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2ddc,0x148));var _0xc2dd=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x2ddc[_0x2e4e19];return _0x9ba20b;};'use strict';var EventEmitter=require(_0xc2dd('0x0'));var VoicePrefix=require(_0xc2dd('0x1'))['db'][_0xc2dd('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc2dd('0x3'),'afterUpdate':_0xc2dd('0x4'),'afterDestroy':_0xc2dd('0x5')};function emitEvent(_0x3d543c){return function(_0xc67612,_0x36bb03,_0x36b39d){VoicePrefixEvents[_0xc2dd('0x6')](_0x3d543c+':'+_0xc67612['id'],_0xc67612);VoicePrefixEvents['emit'](_0x3d543c,_0xc67612);_0x36b39d(null);};}for(var e in events){if(events[_0xc2dd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xc2dd('0x8')]=VoicePrefixEvents;
\ No newline at end of file
index dad6a0e..8168877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3738=['request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util','../../config/logger'];(function(_0x5ec482,_0x1e5eac){var _0x4b3a20=function(_0x1775e1){while(--_0x1775e1){_0x5ec482['push'](_0x5ec482['shift']());}};_0x4b3a20(++_0x1e5eac);}(_0x3738,0x1ab));var _0x8373=function(_0x28c2ed,_0x1e0ca7){_0x28c2ed=_0x28c2ed-0x0;var _0x4213ec=_0x3738[_0x28c2ed];return _0x4213ec;};'use strict';var _=require(_0x8373('0x0'));var util=require(_0x8373('0x1'));var logger=require(_0x8373('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8373('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8373('0x4'));var config=require(_0x8373('0x5'));var attributes=require(_0x8373('0x6'));module[_0x8373('0x7')]=function(_0x5a524f,_0x24d718){return _0x5a524f[_0x8373('0x8')]('VoicePrefix',attributes,{'tableName':_0x8373('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x41d8=['./voicePrefix.attributes','exports','voice_prefixes','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0x41d8,0x179));var _0x841d=function(_0x1fa873,_0x1319ab){_0x1fa873=_0x1fa873-0x0;var _0x599fbc=_0x41d8[_0x1fa873];return _0x599fbc;};'use strict';var _=require(_0x841d('0x0'));var util=require(_0x841d('0x1'));var logger=require('../../config/logger')(_0x841d('0x2'));var moment=require('moment');var BPromise=require(_0x841d('0x3'));var rp=require(_0x841d('0x4'));var fs=require('fs');var path=require(_0x841d('0x5'));var rimraf=require(_0x841d('0x6'));var config=require(_0x841d('0x7'));var attributes=require(_0x841d('0x8'));module[_0x841d('0x9')]=function(_0x5e650f,_0x537e72){return _0x5e650f['define']('VoicePrefix',attributes,{'tableName':_0x841d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ec2ffed..4f7bb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ad3=['socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','client','http','redis','defaults','localhost'];(function(_0x5b95ec,_0x16e0d0){var _0x2af647=function(_0x4f7a18){while(--_0x4f7a18){_0x5b95ec['push'](_0x5b95ec['shift']());}};_0x2af647(++_0x16e0d0);}(_0x7ad3,0x108));var _0x37ad=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x7ad3[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0x37ad('0x0'));var util=require(_0x37ad('0x1'));var moment=require(_0x37ad('0x2'));var BPromise=require(_0x37ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37ad('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37ad('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x37ad('0x6')][_0x37ad('0x7')]({'port':0x232a});config[_0x37ad('0x8')]=_[_0x37ad('0x9')](config[_0x37ad('0x8')],{'host':_0x37ad('0xa'),'port':0x18eb});var socket=require(_0x37ad('0xb'))(new Redis(config[_0x37ad('0x8')]));require(_0x37ad('0xc'))['register'](socket);function respondWithRpcPromise(_0x6d601e,_0x5444ab,_0x5864f9){return new BPromise(function(_0x4c4bed,_0x4da3b7){return client[_0x37ad('0xd')](_0x6d601e,_0x5864f9)[_0x37ad('0xe')](function(_0x1a4487){logger[_0x37ad('0xf')](_0x37ad('0x10'),_0x5444ab,_0x37ad('0x11'));logger[_0x37ad('0x12')](_0x37ad('0x13'),_0x5444ab,_0x37ad('0x11'),JSON[_0x37ad('0x14')](_0x1a4487));if(_0x1a4487[_0x37ad('0x15')]){if(_0x1a4487['error']['code']===0x1f4){logger[_0x37ad('0x15')](_0x37ad('0x10'),_0x5444ab,_0x1a4487['error'][_0x37ad('0x16')]);return _0x4da3b7(_0x1a4487[_0x37ad('0x15')]['message']);}logger[_0x37ad('0x15')](_0x37ad('0x10'),_0x5444ab,_0x1a4487['error'][_0x37ad('0x16')]);return _0x4c4bed(_0x1a4487[_0x37ad('0x15')][_0x37ad('0x16')]);}else{logger['info'](_0x37ad('0x10'),_0x5444ab,_0x37ad('0x11'));_0x4c4bed(_0x1a4487[_0x37ad('0x17')]['message']);}})[_0x37ad('0x18')](function(_0x21927d){logger['error'](_0x37ad('0x10'),_0x5444ab,_0x21927d);_0x4da3b7(_0x21927d);});});}
\ No newline at end of file
+var _0x6dc0=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','VoicePrefix,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x2f20f8,_0x54a3f2){var _0xfcb1b7=function(_0xfd0c0d){while(--_0xfd0c0d){_0x2f20f8['push'](_0x2f20f8['shift']());}};_0xfcb1b7(++_0x54a3f2);}(_0x6dc0,0xb6));var _0x06dc=function(_0x4997fb,_0x2f40cb){_0x4997fb=_0x4997fb-0x0;var _0x427eb9=_0x6dc0[_0x4997fb];return _0x427eb9;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var moment=require(_0x06dc('0x2'));var BPromise=require('bluebird');var rs=require(_0x06dc('0x3'));var fs=require('fs');var Redis=require(_0x06dc('0x4'));var db=require(_0x06dc('0x5'))['db'];var utils=require(_0x06dc('0x6'));var logger=require('../../config/logger')(_0x06dc('0x7'));var config=require(_0x06dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x06dc('0x9')]['http']({'port':0x232a});config[_0x06dc('0xa')]=_[_0x06dc('0xb')](config[_0x06dc('0xa')],{'host':_0x06dc('0xc'),'port':0x18eb});var socket=require(_0x06dc('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x128ea7,_0x1f2041,_0x4ec0aa){return new BPromise(function(_0x45693d,_0x1e7abd){return client[_0x06dc('0xe')](_0x128ea7,_0x4ec0aa)[_0x06dc('0xf')](function(_0x4fa7fc){logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1f2041,'request\x20sent',JSON[_0x06dc('0x12')](_0x4fa7fc));if(_0x4fa7fc['error']){if(_0x4fa7fc['error']['code']===0x1f4){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc[_0x06dc('0x13')]['message']);return _0x1e7abd(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0x4fa7fc['error'][_0x06dc('0x14')]);return _0x45693d(_0x4fa7fc[_0x06dc('0x13')][_0x06dc('0x14')]);}else{logger[_0x06dc('0x10')](_0x06dc('0x11'),_0x1f2041,'request\x20sent');_0x45693d(_0x4fa7fc[_0x06dc('0x15')][_0x06dc('0x14')]);}})[_0x06dc('0x16')](function(_0xc658ea){logger[_0x06dc('0x13')](_0x06dc('0x11'),_0x1f2041,_0xc658ea);_0x1e7abd(_0xc658ea);});});}
\ No newline at end of file
index aa24a47..6abe536 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9bc=['save','remove','update','emit','removeListener','length','voicePrefix:'];(function(_0x111bed,_0x109f8f){var _0x578935=function(_0x1a69eb){while(--_0x1a69eb){_0x111bed['push'](_0x111bed['shift']());}};_0x578935(++_0x109f8f);}(_0xf9bc,0x7e));var _0xcf9b=function(_0x1e2746,_0x2f63ca){_0x1e2746=_0x1e2746-0x0;var _0x468807=_0xf9bc[_0x1e2746];return _0x468807;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xcf9b('0x0'),_0xcf9b('0x1'),_0xcf9b('0x2')];function createListener(_0x19ad1b,_0x2c385a){return function(_0x2dd51e){_0x2c385a[_0xcf9b('0x3')](_0x19ad1b,_0x2dd51e);};}function removeListener(_0x373f46,_0x6d522){return function(){VoicePrefixEvents[_0xcf9b('0x4')](_0x373f46,_0x6d522);};}exports['register']=function(_0x48a202){for(var _0x3595ac=0x0,_0x2ba407=events[_0xcf9b('0x5')];_0x3595ac<_0x2ba407;_0x3595ac++){var _0x2493f0=events[_0x3595ac];var _0x1ec363=createListener(_0xcf9b('0x6')+_0x2493f0,_0x48a202);VoicePrefixEvents['on'](_0x2493f0,_0x1ec363);}};
\ No newline at end of file
+var _0x7229=['voicePrefix:','./voicePrefix.events','save','remove','update','emit','removeListener','register','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7229,0x76));var _0x9722=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x7229[_0x2bf141];return _0x48277b;};'use strict';var VoicePrefixEvents=require(_0x9722('0x0'));var events=[_0x9722('0x1'),_0x9722('0x2'),_0x9722('0x3')];function createListener(_0x18f480,_0x5eccad){return function(_0x5226eb){_0x5eccad[_0x9722('0x4')](_0x18f480,_0x5226eb);};}function removeListener(_0x255678,_0x43fcea){return function(){VoicePrefixEvents[_0x9722('0x5')](_0x255678,_0x43fcea);};}exports[_0x9722('0x6')]=function(_0x43e0ed){for(var _0x2689b3=0x0,_0x541b0c=events[_0x9722('0x7')];_0x2689b3<_0x541b0c;_0x2689b3++){var _0x5a5bd1=events[_0x2689b3];var _0x237c3e=createListener(_0x9722('0x8')+_0x5a5bd1,_0x43e0ed);VoicePrefixEvents['on'](_0x5a5bd1,_0x237c3e);}};
\ No newline at end of file
index 3d2ff05..6fc30c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f8d=['/:id/blacklists','getBlackLists','post','create','clone','addTeams','addLists','put','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','express','Router','get','isAuthenticated','index','/:id','/:id/hoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/lists'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1f8d,0x1eb));var _0xd1f8=function(_0x25886e,_0x50bb00){_0x25886e=_0x25886e-0x0;var _0x22ba74=_0x1f8d[_0x25886e];return _0x22ba74;};'use strict';var multer=require(_0xd1f8('0x0'));var util=require(_0xd1f8('0x1'));var path=require(_0xd1f8('0x2'));var timeout=require('connect-timeout');var express=require(_0xd1f8('0x3'));var router=express[_0xd1f8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router[_0xd1f8('0x5')]('/',auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x7')]);router[_0xd1f8('0x5')](_0xd1f8('0x8'),auth[_0xd1f8('0x6')](),controller['show']);router['get'](_0xd1f8('0x9'),auth[_0xd1f8('0x6')](),controller['getHoppers']);router[_0xd1f8('0x5')](_0xd1f8('0xa'),auth[_0xd1f8('0x6')](),controller[_0xd1f8('0xb')]);router[_0xd1f8('0x5')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xd1f8('0xc')]);router[_0xd1f8('0x5')]('/:id/hopper_black',auth[_0xd1f8('0x6')](),controller[_0xd1f8('0xd')]);router[_0xd1f8('0x5')](_0xd1f8('0xe'),auth[_0xd1f8('0x6')](),controller[_0xd1f8('0xf')]);router[_0xd1f8('0x5')](_0xd1f8('0x10'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0xd1f8('0x11'),auth[_0xd1f8('0x6')](),controller['getMembers']);router['get'](_0xd1f8('0x12'),auth[_0xd1f8('0x6')](),controller['getLists']);router[_0xd1f8('0x5')](_0xd1f8('0x13'),auth['isAuthenticated'](),controller[_0xd1f8('0x14')]);router[_0xd1f8('0x15')]('/',auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x16')]);router[_0xd1f8('0x15')]('/:id/clone',auth['isAuthenticated'](),controller[_0xd1f8('0x17')]);router[_0xd1f8('0x15')](_0xd1f8('0xe'),auth['isAuthenticated'](),controller[_0xd1f8('0x18')]);router[_0xd1f8('0x15')]('/:id/users',auth[_0xd1f8('0x6')](),controller['addAgents']);router[_0xd1f8('0x15')](_0xd1f8('0x12'),auth['isAuthenticated'](),controller[_0xd1f8('0x19')]);router[_0xd1f8('0x15')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xd1f8('0x1a')](_0xd1f8('0x8'),auth[_0xd1f8('0x6')](),controller['update']);router['delete'](_0xd1f8('0x8'),auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x1b')]);router[_0xd1f8('0x1c')](_0xd1f8('0xe'),auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x1d')]);router[_0xd1f8('0x1c')]('/:id/users',auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x1e')]);router[_0xd1f8('0x1c')]('/:id/lists',auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x1f')]);router[_0xd1f8('0x1c')](_0xd1f8('0x13'),auth[_0xd1f8('0x6')](),controller[_0xd1f8('0x20')]);module[_0xd1f8('0x21')]=router;
\ No newline at end of file
+var _0x7c6c=['delete','destroy','removeTeams','removeLists','removeBlackLists','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','/:id/users','addAgents','addLists','addBlackLists','put','/:id','update'];(function(_0x13bea0,_0x210a0c){var _0x3f12df=function(_0x11ef1c){while(--_0x11ef1c){_0x13bea0['push'](_0x13bea0['shift']());}};_0x3f12df(++_0x210a0c);}(_0x7c6c,0xb9));var _0xc7c6=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7c6c[_0x199572];return _0x13cfa3;};'use strict';var multer=require(_0xc7c6('0x0'));var util=require('util');var path=require(_0xc7c6('0x1'));var timeout=require(_0xc7c6('0x2'));var express=require('express');var router=express[_0xc7c6('0x3')]();var fs_extra=require(_0xc7c6('0x4'));var auth=require(_0xc7c6('0x5'));var interaction=require(_0xc7c6('0x6'));var config=require(_0xc7c6('0x7'));var controller=require(_0xc7c6('0x8'));router['get']('/',auth[_0xc7c6('0x9')](),controller[_0xc7c6('0xa')]);router[_0xc7c6('0xb')]('/:id',auth[_0xc7c6('0x9')](),controller['show']);router[_0xc7c6('0xb')](_0xc7c6('0xc'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0xd')]);router[_0xc7c6('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xc7c6('0xe')]);router['get'](_0xc7c6('0xf'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x10')]);router['get'](_0xc7c6('0x11'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x12')]);router[_0xc7c6('0xb')](_0xc7c6('0x13'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x14')]);router[_0xc7c6('0xb')]('/:id/users',auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x15')]);router[_0xc7c6('0xb')](_0xc7c6('0x16'),auth['isAuthenticated'](),controller[_0xc7c6('0x17')]);router[_0xc7c6('0xb')](_0xc7c6('0x18'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x19')]);router[_0xc7c6('0xb')](_0xc7c6('0x1a'),auth['isAuthenticated'](),controller[_0xc7c6('0x1b')]);router[_0xc7c6('0x1c')]('/',auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x1d')]);router[_0xc7c6('0x1c')](_0xc7c6('0x1e'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x1f')]);router[_0xc7c6('0x1c')](_0xc7c6('0x13'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x20')]);router[_0xc7c6('0x1c')](_0xc7c6('0x21'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x22')]);router[_0xc7c6('0x1c')](_0xc7c6('0x18'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x23')]);router['post'](_0xc7c6('0x1a'),auth['isAuthenticated'](),controller[_0xc7c6('0x24')]);router[_0xc7c6('0x25')](_0xc7c6('0x26'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x27')]);router[_0xc7c6('0x28')]('/:id',auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x29')]);router['delete'](_0xc7c6('0x13'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x2a')]);router[_0xc7c6('0x28')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0xc7c6('0x18'),auth['isAuthenticated'](),controller[_0xc7c6('0x2b')]);router['delete'](_0xc7c6('0x1a'),auth[_0xc7c6('0x9')](),controller[_0xc7c6('0x2c')]);module['exports']=router;
\ No newline at end of file
index b9c07ad..16566cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53f3=['strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\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)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','ENUM','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue'];(function(_0x4ca41c,_0x392e85){var _0x2921fb=function(_0x4560e7){while(--_0x4560e7){_0x4ca41c['push'](_0x4ca41c['shift']());}};_0x2921fb(++_0x392e85);}(_0x53f3,0xe0));var _0x353f=function(_0x3e9bca,_0x28d703){_0x3e9bca=_0x3e9bca-0x0;var _0x1e2469=_0x53f3[_0x3e9bca];return _0x1e2469;};'use strict';var Sequelize=require(_0x353f('0x0'));module[_0x353f('0x1')]={'name':{'type':Sequelize[_0x353f('0x2')],'allowNull':![],'unique':_0x353f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x353f('0x4'),_0x353f('0x5')),'allowNull':![],'defaultValue':_0x353f('0x4')},'musiconhold':{'type':Sequelize[_0x353f('0x2')],'defaultValue':_0x353f('0x6')},'announce':{'type':Sequelize[_0x353f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x353f('0x7')]('rr',_0x353f('0x8'),_0x353f('0x9'),_0x353f('0xa'),_0x353f('0xb'),'rrmemory',_0x353f('0xc'),_0x353f('0xd'),_0x353f('0xe')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2f41f4){this[_0x353f('0xf')](_0x353f('0x10'),_0x2f41f4?_0x2f41f4:_0x353f('0x11'));},'get':function(){var _0x555e89=this[_0x353f('0x12')](_0x353f('0x13'));var _0xaefdb1=this[_0x353f('0x12')](_0x353f('0x14'));var _0x3afaf5=this[_0x353f('0x12')](_0x353f('0x10'));if(_0x555e89===_0x353f('0x4')){return _0x3afaf5;}if(_0xaefdb1===_0x353f('0x15')&&_0x3afaf5===_0x353f('0x11')||_0xaefdb1===_0x353f('0x15')&&_0x3afaf5===_0x353f('0x16')){return _0x3afaf5;}if(_0xaefdb1==='progressive'||_0xaefdb1===_0x353f('0x17')||_0xaefdb1===_0x353f('0x18')){return _0x3afaf5;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x353f('0x19')](0xb)},'timeout':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x353f('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no'),'defaultValue':_0x353f('0x1a')},'autopause':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no',_0x353f('0x1b')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x353f('0x19')](0xb)},'autopausebusy':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x353f('0x1a'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x353f('0x1a'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x353f('0x7')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x353f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x353f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x353f('0x1a'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no'),'defaultValue':_0x353f('0x1a')},'announce_holdtime':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no',_0x353f('0x1c')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x353f('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x353f('0x1a'),'no')},'announce_position_limit':{'type':Sequelize[_0x353f('0x19')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x353f('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x353f('0x2')]},'queue_youarenext':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x353f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x353f('0x2')]},'queue_quantity2':{'type':Sequelize[_0x353f('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x353f('0x2')]},'queue_less_than':{'type':Sequelize[_0x353f('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x34a0ec){this['setDataValue'](_0x353f('0x1d'),_0x34a0ec?_0x34a0ec[_0x353f('0x1e')](','):[]);},'get':function(){return this[_0x353f('0x12')]('periodic_announce')?this[_0x353f('0x12')]('periodic_announce')[_0x353f('0x1f')](','):[];}},'joinempty':{'type':Sequelize[_0x353f('0x2')],'defaultValue':'yes','set':function(_0x322893){this[_0x353f('0xf')](_0x353f('0x20'),_0x322893?_0x322893[_0x353f('0x1e')](','):undefined);},'get':function(){return this[_0x353f('0x12')](_0x353f('0x20'))?this['getDataValue'](_0x353f('0x20'))[_0x353f('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x353f('0x2')],'defaultValue':'no','set':function(_0x224c70){this['setDataValue'](_0x353f('0x21'),_0x224c70?_0x224c70[_0x353f('0x1e')](','):undefined);},'get':function(){return this['getDataValue'](_0x353f('0x21'))?this[_0x353f('0x12')](_0x353f('0x21'))[_0x353f('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x353f('0x7')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x353f('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x1a'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x353f('0x2')]},'description':{'type':Sequelize[_0x353f('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x2aac66){this[_0x353f('0xf')]('acw',_0x2aac66);if(_0x2aac66){if(this['getDataValue'](_0x353f('0x22'))<0x2){this[_0x353f('0xf')](_0x353f('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x353f('0x19')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x353f('0x23')],'defaultValue':0x0,'comment':_0x353f('0x24')},'dialMethod':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x25'),_0x353f('0x26'),'power',_0x353f('0x17'),'booked'),'defaultValue':'progressive','comment':_0x353f('0x27')},'dialLimitChannel':{'type':Sequelize[_0x353f('0x19')](0x4)[_0x353f('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x353f('0x29')},'dialLimitQueue':{'type':Sequelize[_0x353f('0x19')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x353f('0x2a')](0x2)[_0x353f('0x28')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x353f('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0x353f('0x7')]('agentBusyFactor','dropRate'),'defaultValue':_0x353f('0x2c'),'comment':_0x353f('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x353f('0x2a')](0x2)[_0x353f('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x353f('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x353f('0x2f')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x353f('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x353f('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x353f('0x30'),'comment':_0x353f('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x353f('0x2')],'comment':_0x353f('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x353f('0x19')](0x5)[_0x353f('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x353f('0x33')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x353f('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x353f('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x353f('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x353f('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0x3,'comment':_0x353f('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x353f('0x19')](0x5)[_0x353f('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x353f('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x353f('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x353f('0x2')],'defaultValue':_0x353f('0x39')},'dialPrefix':{'type':Sequelize[_0x353f('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x3a'),_0x353f('0x3b'),_0x353f('0x3c')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x353f('0x23')],'defaultValue':0x0,'comment':_0x353f('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0x353f('0x19')](0x9)[_0x353f('0x28')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x353f('0x19')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x353f('0x19')](0x9)[_0x353f('0x28')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x353f('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x353f('0x19')](0x9)[_0x353f('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x353f('0x19')](0x9)[_0x353f('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x353f('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x353f('0x19')](0x9)[_0x353f('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x353f('0x19')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x353f('0x19')](0x5)[_0x353f('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x353f('0x19')](0x9)[_0x353f('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x353f('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x353f('0x19')](0x5)[_0x353f('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x353f('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x353f('0x23')],'defaultValue':0x0,'comment':_0x353f('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x353f('0x7')](_0x353f('0x43'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x353f('0x2')],'comment':_0x353f('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x353f('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x353f('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x353f('0x19')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x353f('0x44')},'dialCutDigit':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x353f('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x353f('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x353f('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x353f('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x353f('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x353f('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x353f('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x353f('0x48')},'dialMachineMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x353f('0x49')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x353f('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x353f('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x353f('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x353f('0x19')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x353f('0x19')],'allowNull':!![],'comment':_0x353f('0x4c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x353f('0x4d'),'set':function(_0x498c32){if(!_0x498c32)this['setDataValue'](_0x353f('0x4e'),null);this[_0x353f('0xf')](_0x353f('0x4f'),_0x498c32);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x353f('0x19')](0x3)[_0x353f('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x3e9d=['#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','default','STRING','ringall','random','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','roundrobin','progressive','predictive','power','INTEGER','yes','once','TEXT','periodic_announce','split','setDataValue','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','booked','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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','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)'];(function(_0x565d82,_0x292255){var _0x34e7ee=function(_0x5ee66e){while(--_0x5ee66e){_0x565d82['push'](_0x565d82['shift']());}};_0x34e7ee(++_0x292255);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x274818,_0x38c734){_0x274818=_0x274818-0x0;var _0x584b30=_0x3e9d[_0x274818];return _0x584b30;};'use strict';var Sequelize=require(_0xd3e9('0x0'));module[_0xd3e9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd3e9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x4'),_0xd3e9('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xd3e9('0x6')},'announce':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':''},'strategy':{'type':Sequelize[_0xd3e9('0x3')]('rr',_0xd3e9('0x8'),'leastrecent','fewestcalls',_0xd3e9('0x9'),_0xd3e9('0xa'),_0xd3e9('0xb'),_0xd3e9('0xc'),_0xd3e9('0xd')),'allowNull':![],'defaultValue':_0xd3e9('0x8'),'set':function(_0x2944cd){this['setDataValue'](_0xd3e9('0xe'),_0x2944cd?_0x2944cd:_0xd3e9('0xa'));},'get':function(){var _0x45bfda=this[_0xd3e9('0xf')](_0xd3e9('0x10'));var _0x17175a=this[_0xd3e9('0xf')](_0xd3e9('0x11'));var _0x34dca9=this[_0xd3e9('0xf')]('strategy');if(_0x45bfda===_0xd3e9('0x4')){return _0x34dca9;}if(_0x17175a==='booked'&&_0x34dca9==='rrmemory'||_0x17175a==='booked'&&_0x34dca9===_0xd3e9('0x12')){return _0x34dca9;}if(_0x17175a===_0xd3e9('0x13')||_0x17175a===_0xd3e9('0x14')||_0x17175a===_0xd3e9('0x15')){return _0x34dca9;}return null;}},'servicelevel':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xd3e9('0x16')](0xb)},'timeout':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xd3e9('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xd3e9('0x3')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xd3e9('0x3')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xd3e9('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0xd3e9('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xd3e9('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xd3e9('0x3')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xd3e9('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xd3e9('0x7')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xd3e9('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x17'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xd3e9('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xd3e9('0x7')]},'queue_youarenext':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xd3e9('0x7')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xd3e9('0x7')]},'queue_quantity1':{'type':Sequelize[_0xd3e9('0x7')]},'queue_quantity2':{'type':Sequelize[_0xd3e9('0x7')]},'queue_periodic_announce':{'type':Sequelize[_0xd3e9('0x7')]},'queue_less_than':{'type':Sequelize[_0xd3e9('0x7')]},'periodic_announce':{'type':Sequelize[_0xd3e9('0x19')],'set':function(_0x605ace){this['setDataValue']('periodic_announce',_0x605ace?_0x605ace['join'](','):[]);},'get':function(){return this[_0xd3e9('0xf')](_0xd3e9('0x1a'))?this[_0xd3e9('0xf')]('periodic_announce')[_0xd3e9('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xd3e9('0x17'),'set':function(_0x599d54){this[_0xd3e9('0x1c')](_0xd3e9('0x1d'),_0x599d54?_0x599d54[_0xd3e9('0x1e')](','):undefined);},'get':function(){return this[_0xd3e9('0xf')](_0xd3e9('0x1d'))?this['getDataValue'](_0xd3e9('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':'no','set':function(_0x1c141d){this['setDataValue'](_0xd3e9('0x1f'),_0x1c141d?_0x1c141d[_0xd3e9('0x1e')](','):undefined);},'get':function(){return this[_0xd3e9('0xf')]('leavewhenempty')?this[_0xd3e9('0xf')](_0xd3e9('0x1f'))[_0xd3e9('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xd3e9('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xd3e9('0x7')]},'description':{'type':Sequelize[_0xd3e9('0x7')]},'acw':{'type':Sequelize[_0xd3e9('0x20')],'defaultValue':0x0,'set':function(_0x5c002f){this['setDataValue'](_0xd3e9('0x21'),_0x5c002f);if(_0x5c002f){if(this[_0xd3e9('0xf')](_0xd3e9('0x22'))<0x2){this['setDataValue'](_0xd3e9('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xd3e9('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xd3e9('0x20')],'defaultValue':0x0,'comment':_0xd3e9('0x23')},'dialMethod':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x24'),_0xd3e9('0x13'),'power','predictive',_0xd3e9('0x25')),'defaultValue':_0xd3e9('0x13'),'comment':_0xd3e9('0x26')},'dialLimitChannel':{'type':Sequelize[_0xd3e9('0x16')](0x4)[_0xd3e9('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd3e9('0x28')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xd3e9('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xd3e9('0x29')},'dialPowerLevel':{'type':Sequelize[_0xd3e9('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xd3e9('0x2b')},'dialPredictiveOptimization':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x2c'),_0xd3e9('0x2d')),'defaultValue':'dropRate','comment':_0xd3e9('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xd3e9('0x2f')},'dialPredictiveInterval':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xd3e9('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd3e9('0x7')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd3e9('0x7')]},'dialOriginateTimeout':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x31')},'dialQueueOptions':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':_0xd3e9('0x32'),'comment':_0xd3e9('0x33')},'dialQueueTimeout':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x34')},'dialQueueProject':{'type':Sequelize[_0xd3e9('0x7')],'comment':_0xd3e9('0x35')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x36')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3e9('0x37')},'dialBusyMaxRetry':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x38')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3e9('0x39')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'comment':_0xd3e9('0x3a')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3e9('0x3b')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd3e9('0x3c')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':_0xd3e9('0x3d')},'dialPrefix':{'type':Sequelize[_0xd3e9('0x7')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xd3e9('0x3')](_0xd3e9('0x3e'),_0xd3e9('0x3f'),_0xd3e9('0x40')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xd3e9('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xd3e9('0x16')](0x9)[_0xd3e9('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd3e9('0x16')](0x9)[_0xd3e9('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd3e9('0x41')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd3e9('0x42')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd3e9('0x16')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd3e9('0x43')},'dialAMDMinWordLength':{'type':Sequelize[_0xd3e9('0x16')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd3e9('0x44')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd3e9('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd3e9('0x45')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xd3e9('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd3e9('0x46')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd3e9('0x16')](0x9)[_0xd3e9('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd3e9('0x47')},'dialRecallMeTimeout':{'type':Sequelize[_0xd3e9('0x16')](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xd3e9('0x48')},'dialRecallInQueue':{'type':Sequelize[_0xd3e9('0x20')],'defaultValue':0x0,'comment':_0xd3e9('0x49')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd3e9('0x3')]('DESC',_0xd3e9('0x4a')),'defaultValue':_0xd3e9('0x4b')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0xd3e9('0x35')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xd3e9('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3e9('0x4c')},'dialDropMaxRetry':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x4d')},'dialDropRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3e9('0x4e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x4f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd3e9('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x50')},'dialMachineRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)[_0xd3e9('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3e9('0x51')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd3e9('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3e9('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd3e9('0x16')],'allowNull':!![],'comment':_0xd3e9('0x53')},'mandatoryDisposition':{'type':Sequelize[_0xd3e9('0x20')],'defaultValue':![],'comment':_0xd3e9('0x54'),'set':function(_0x429eb8){if(!_0x429eb8)this[_0xd3e9('0x1c')](_0xd3e9('0x55'),null);this['setDataValue'](_0xd3e9('0x56'),_0x429eb8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xd3e9('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xd3e9('0x16')](0x3)[_0xd3e9('0x27')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index d147e7b..e1568d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cbb=['getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','NOW()','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','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','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','filter','ignore','map','value','includes','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','includeAll','catch','fields','include','options','create','body','user','role','inbound','userProfileId','autoAssociation','UserProfileResource','clone','params','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','outbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','pick','findAll','rows','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','User','Agents','voicePause','interface','flatMap','penalty','sequelize','transaction','addTeams','TeamVoiceQueue','findOrCreate','each','UserVoiceQueueRt','isNil','format','forEach','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','omit','spread','online','push','SIP/%s','getAgents','getMembers'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x3cbb,0x198));var _0xb3cb=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x3cbb[_0xb833b1];return _0x1ab87a;};'use strict';var emlformat=require(_0xb3cb('0x0'));var rimraf=require(_0xb3cb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3cb('0x2'));var rp=require(_0xb3cb('0x3'));var moment=require(_0xb3cb('0x4'));var BPromise=require(_0xb3cb('0x5'));var Mustache=require(_0xb3cb('0x6'));var util=require(_0xb3cb('0x7'));var path=require(_0xb3cb('0x8'));var sox=require(_0xb3cb('0x9'));var csv=require(_0xb3cb('0xa'));var ejs=require(_0xb3cb('0xb'));var fs=require('fs');var fs_extra=require(_0xb3cb('0xc'));var _=require(_0xb3cb('0xd'));var squel=require(_0xb3cb('0xe'));var crypto=require(_0xb3cb('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xb3cb('0x10'));var toCsv=require(_0xb3cb('0xa'));var querystring=require(_0xb3cb('0x11'));var Papa=require(_0xb3cb('0x12'));var Redis=require(_0xb3cb('0x13'));var authService=require(_0xb3cb('0x14'));var qs=require(_0xb3cb('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3cb('0x16'));var logger=require(_0xb3cb('0x17'))(_0xb3cb('0x18'));var utils=require(_0xb3cb('0x19'));var config=require(_0xb3cb('0x1a'));var licenseUtil=require(_0xb3cb('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xb3cb('0x1c')](config[_0xb3cb('0x1d')],{'host':_0xb3cb('0x1e'),'port':0x18eb});var socket=require(_0xb3cb('0x1f'))(new Redis(config[_0xb3cb('0x1d')]));require(_0xb3cb('0x20'))[_0xb3cb('0x21')](socket);function respondWithStatusCode(_0x3ec8ed,_0x55a5a9){_0x55a5a9=_0x55a5a9||0xcc;return function(_0x223116){if(_0x223116){return _0x3ec8ed[_0xb3cb('0x22')](_0x55a5a9);}return _0x3ec8ed[_0xb3cb('0x23')](_0x55a5a9)['end']();};}function respondWithResult(_0xcb1cd2,_0x30ccaa){_0x30ccaa=_0x30ccaa||0xc8;return function(_0x147691){if(_0x147691){return _0xcb1cd2[_0xb3cb('0x23')](_0x30ccaa)['json'](_0x147691);}};}function respondWithFilteredResult(_0x47f75f,_0x25e720){return function(_0x48d3a0){if(_0x48d3a0){var _0x2322fc=typeof _0x25e720[_0xb3cb('0x24')]==='undefined'&&typeof _0x25e720['limit']===_0xb3cb('0x25');var _0x579b59=_0x48d3a0['count'];var _0x4e83db=_0x2322fc?0x0:_0x25e720['offset'];var _0x195e87=_0x2322fc?_0x48d3a0[_0xb3cb('0x26')]:_0x25e720[_0xb3cb('0x24')]+_0x25e720[_0xb3cb('0x27')];var _0x2d3939;if(_0x195e87>=_0x579b59){_0x195e87=_0x579b59;_0x2d3939=0xc8;}else{_0x2d3939=0xce;}_0x47f75f[_0xb3cb('0x23')](_0x2d3939);return _0x47f75f['set'](_0xb3cb('0x28'),_0x4e83db+'-'+_0x195e87+'/'+_0x579b59)[_0xb3cb('0x29')](_0x48d3a0);}return null;};}function patchUpdates(_0x18f659){return function(_0x3fbce0){try{jsonpatch[_0xb3cb('0x2a')](_0x3fbce0,_0x18f659,!![]);}catch(_0x1f6006){return BPromise[_0xb3cb('0x2b')](_0x1f6006);}return _0x3fbce0[_0xb3cb('0x2c')]();};}function saveUpdates(_0x51e29f,_0x37d082){return function(_0x36fbba){if(_0x36fbba){return _0x36fbba[_0xb3cb('0x2d')](_0x51e29f)[_0xb3cb('0x2e')](function(_0x2eb43d){return _0x2eb43d;});}return null;};}function removeEntity(_0x33c2b5,_0x2cb586){return function(_0x3e4057){if(_0x3e4057){return _0x3e4057[_0xb3cb('0x2f')]()['then'](function(){var _0x523448=_0x3e4057[_0xb3cb('0x30')]({'plain':!![]});var _0x5269d2=[{'name':_0xb3cb('0x31'),'value':'inbound','ignore':![]},{'name':_0xb3cb('0x32'),'value':'outbound','ignore':![]}];var _0x419ddc=_(_0x5269d2)[_0xb3cb('0x33')](_0xb3cb('0x34'))[_0xb3cb('0x35')](_0xb3cb('0x36'))[_0xb3cb('0x36')]();if(_[_0xb3cb('0x37')](_0x419ddc,_0x523448[_0xb3cb('0x38')])){return;}var _0x504f28=_[_0xb3cb('0x39')](_0x5269d2,['value',_0x523448['type']])[_0xb3cb('0x3a')];return db['UserProfileResource']['destroy']({'where':{'type':_0x504f28,'resourceId':_0x523448['id']}})[_0xb3cb('0x2e')](function(){return _0x3e4057;});})[_0xb3cb('0x2e')](function(){_0x33c2b5[_0xb3cb('0x23')](0xcc)[_0xb3cb('0x3b')]();});}};}function handleEntityNotFound(_0x359b2a,_0xd21405){return function(_0x15de5a){if(!_0x15de5a){_0x359b2a['sendStatus'](0x194);}return _0x15de5a;};}function handleError(_0x5071e2,_0x328544){_0x328544=_0x328544||0x1f4;return function(_0x3c6036){logger[_0xb3cb('0x3c')](_0x3c6036[_0xb3cb('0x3d')]);if(_0x3c6036[_0xb3cb('0x3a')]){delete _0x3c6036[_0xb3cb('0x3a')];}_0x5071e2[_0xb3cb('0x23')](_0x328544)['send'](_0x3c6036);};}exports[_0xb3cb('0x3e')]=function(_0x3067d8,_0x29e844){var _0x241bbd={},_0x4499ca={},_0x1b86c1={'count':0x0,'rows':[]};var _0x573f1c=_['map'](db[_0xb3cb('0x3f')][_0xb3cb('0x40')],function(_0x2bab38){return{'name':_0x2bab38[_0xb3cb('0x41')],'type':_0x2bab38[_0xb3cb('0x38')][_0xb3cb('0x42')]};});_0x4499ca[_0xb3cb('0x43')]=_[_0xb3cb('0x35')](_0x573f1c,_0xb3cb('0x3a'));_0x4499ca[_0xb3cb('0x44')]=_[_0xb3cb('0x45')](_0x3067d8[_0xb3cb('0x44')]);_0x4499ca[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x4499ca[_0xb3cb('0x43')],_0x4499ca['query']);_0x241bbd[_0xb3cb('0x48')]=_[_0xb3cb('0x47')](_0x4499ca[_0xb3cb('0x43')],qs['fields'](_0x3067d8[_0xb3cb('0x44')]['fields']));_0x241bbd[_0xb3cb('0x48')]=_0x241bbd[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0x241bbd[_0xb3cb('0x48')]:_0x4499ca['model'];if(!_0x3067d8[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x241bbd[_0xb3cb('0x27')]=qs[_0xb3cb('0x27')](_0x3067d8[_0xb3cb('0x44')]['limit']);_0x241bbd['offset']=qs[_0xb3cb('0x24')](_0x3067d8[_0xb3cb('0x44')][_0xb3cb('0x24')]);}_0x241bbd[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x3067d8[_0xb3cb('0x44')][_0xb3cb('0x4d')]);_0x241bbd[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_['pick'](_0x3067d8['query'],_0x4499ca[_0xb3cb('0x46')]),_0x573f1c);if(_0x3067d8[_0xb3cb('0x44')][_0xb3cb('0x33')]){_0x241bbd[_0xb3cb('0x4e')]=_[_0xb3cb('0x4f')](_0x241bbd[_0xb3cb('0x4e')],{'$or':_[_0xb3cb('0x35')](_0x573f1c,function(_0x498991){if(_0x498991[_0xb3cb('0x38')]!=='VIRTUAL'){var _0x461b55={};_0x461b55[_0x498991[_0xb3cb('0x3a')]]={'$like':'%'+_0x3067d8[_0xb3cb('0x44')]['filter']+'%'};return _0x461b55;}})});}_0x241bbd=_['merge']({},_0x241bbd,_0x3067d8['options']);var _0x5b4281={'where':_0x241bbd[_0xb3cb('0x4e')]};return db[_0xb3cb('0x3f')]['count'](_0x5b4281)['then'](function(_0x3cb544){_0x1b86c1['count']=_0x3cb544;if(_0x3067d8[_0xb3cb('0x44')][_0xb3cb('0x50')]){_0x241bbd['include']=[{'all':!![]}];}return db[_0xb3cb('0x3f')]['findAll'](_0x241bbd);})[_0xb3cb('0x2e')](function(_0x46b1de){_0x1b86c1['rows']=_0x46b1de;return _0x1b86c1;})['then'](respondWithFilteredResult(_0x29e844,_0x241bbd))[_0xb3cb('0x51')](handleError(_0x29e844,null));};exports['show']=function(_0x39a2bb,_0x123d3d){var _0x2f59a0={'raw':![],'where':{'id':_0x39a2bb['params']['id']}},_0xa717b0={};_0xa717b0[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db['VoiceQueue'][_0xb3cb('0x40')]);_0xa717b0['query']=_[_0xb3cb('0x45')](_0x39a2bb[_0xb3cb('0x44')]);_0xa717b0['filters']=_['intersection'](_0xa717b0[_0xb3cb('0x43')],_0xa717b0[_0xb3cb('0x44')]);_0x2f59a0[_0xb3cb('0x48')]=_[_0xb3cb('0x47')](_0xa717b0[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x39a2bb[_0xb3cb('0x44')][_0xb3cb('0x52')]));_0x2f59a0['attributes']=_0x2f59a0[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0x2f59a0['attributes']:_0xa717b0[_0xb3cb('0x43')];if(_0x39a2bb['query'][_0xb3cb('0x50')]){_0x2f59a0[_0xb3cb('0x53')]=[{'all':!![]}];}_0x2f59a0=_[_0xb3cb('0x4f')]({},_0x2f59a0,_0x39a2bb[_0xb3cb('0x54')]);return db[_0xb3cb('0x3f')][_0xb3cb('0x39')](_0x2f59a0)[_0xb3cb('0x2e')](handleEntityNotFound(_0x123d3d,null))[_0xb3cb('0x2e')](respondWithResult(_0x123d3d,null))[_0xb3cb('0x51')](handleError(_0x123d3d,null));};exports[_0xb3cb('0x55')]=function(_0x24f7da,_0x2dcb13){return db['VoiceQueue'][_0xb3cb('0x55')](_0x24f7da[_0xb3cb('0x56')],{})['then'](function(_0x1582e3){var _0x6798ac=_0x24f7da[_0xb3cb('0x57')][_0xb3cb('0x30')]({'plain':!![]});if(!_0x6798ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6798ac[_0xb3cb('0x58')]===_0xb3cb('0x57')){var _0xc8461d=_0x1582e3['get']({'plain':!![]});var _0x2dbe28=[{'name':_0xb3cb('0x31'),'value':_0xb3cb('0x59')},{'name':_0xb3cb('0x32'),'value':'outbound'}];var _0x3bc0e2=_[_0xb3cb('0x39')](_0x2dbe28,[_0xb3cb('0x36'),_0xc8461d['type']])[_0xb3cb('0x3a')];return db['UserProfileSection']['find']({'where':{'name':_0x3bc0e2,'userProfileId':_0x6798ac[_0xb3cb('0x5a')]},'raw':!![]})[_0xb3cb('0x2e')](function(_0x439c8d){if(_0x439c8d&&_0x439c8d[_0xb3cb('0x5b')]===0x0){return db[_0xb3cb('0x5c')][_0xb3cb('0x55')]({'name':_0xc8461d['name'],'resourceId':_0xc8461d['id'],'type':_0x439c8d[_0xb3cb('0x3a')],'sectionId':_0x439c8d['id']},{})[_0xb3cb('0x2e')](function(){return _0x1582e3;});}else{return _0x1582e3;}})[_0xb3cb('0x51')](function(_0x4ca720){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ca720);throw _0x4ca720;});}return _0x1582e3;})[_0xb3cb('0x2e')](respondWithResult(_0x2dcb13,0xc9))['catch'](handleError(_0x2dcb13,null));};exports[_0xb3cb('0x5d')]=function(_0x54b96e,_0x5b1004){var _0x1ff87c={'where':{'id':_0x54b96e[_0xb3cb('0x5e')]['id']}},_0x350a0e={};_0x350a0e[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db['VoiceQueue'][_0xb3cb('0x40')]);_0x1ff87c['attributes']=_[_0xb3cb('0x47')](_0x350a0e[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x54b96e['query'][_0xb3cb('0x52')]));_0x1ff87c['attributes']=_0x1ff87c[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0x1ff87c[_0xb3cb('0x48')]:_0x350a0e[_0xb3cb('0x43')];if(_0x54b96e[_0xb3cb('0x44')][_0xb3cb('0x50')]){_0x1ff87c['include']=[{'all':!![]}];}_0x1ff87c=_['merge']({},_0x1ff87c,_0x54b96e[_0xb3cb('0x54')]);return db[_0xb3cb('0x3f')][_0xb3cb('0x39')](_0x1ff87c)[_0xb3cb('0x2e')](handleEntityNotFound(_0x5b1004,null))[_0xb3cb('0x2e')](function(_0x252506){if(_0x252506){var _0x5824a4=_0x252506[_0xb3cb('0x30')]({'plain':!![]});_0x5824a4=qs['omit'](_0x5824a4,['id',_0xb3cb('0x5f'),'updatedAt']);_0x54b96e[_0xb3cb('0x56')]=_['omit'](_0x54b96e[_0xb3cb('0x56')],['id',_0xb3cb('0x5f'),'updatedAt']);return db[_0xb3cb('0x3f')]['create'](_[_0xb3cb('0x4f')](_0x5824a4,_0x54b96e[_0xb3cb('0x56')]),{'include':_0x54b96e[_0xb3cb('0x44')][_0xb3cb('0x50')]?[{'all':!![]}]:undefined})[_0xb3cb('0x2e')](function(_0x348ddf){var _0x28876e=_0x54b96e[_0xb3cb('0x57')][_0xb3cb('0x30')]({'plain':!![]});if(!_0x28876e)throw new Error(_0xb3cb('0x60'));if(_0x28876e[_0xb3cb('0x58')]===_0xb3cb('0x57')){var _0x58bf1b=_0x348ddf['get']({'plain':!![]});var _0x5ad2d1=[{'name':_0xb3cb('0x31'),'value':'inbound'},{'name':_0xb3cb('0x32'),'value':_0xb3cb('0x61')}];var _0x8733a7=_['find'](_0x5ad2d1,[_0xb3cb('0x36'),_0x58bf1b['type']])[_0xb3cb('0x3a')];return db[_0xb3cb('0x62')][_0xb3cb('0x39')]({'where':{'name':_0x8733a7,'userProfileId':_0x28876e['userProfileId']},'raw':!![]})[_0xb3cb('0x2e')](function(_0x529c6d){if(_0x529c6d&&_0x529c6d[_0xb3cb('0x5b')]===0x0){return db['UserProfileResource'][_0xb3cb('0x55')]({'name':_0x58bf1b[_0xb3cb('0x3a')],'resourceId':_0x58bf1b['id'],'type':_0x529c6d['name'],'sectionId':_0x529c6d['id']},{})[_0xb3cb('0x2e')](function(){return _0x348ddf;});}else{return _0x348ddf;}})[_0xb3cb('0x51')](function(_0x3a98e5){logger[_0xb3cb('0x3c')](_0xb3cb('0x63'),_0x3a98e5);throw _0x3a98e5;});}return _0x348ddf;});}})['then'](respondWithResult(_0x5b1004,0xc9))[_0xb3cb('0x51')](handleError(_0x5b1004,null));};exports['update']=function(_0xcf6a84,_0x244277){if(_0xcf6a84['body']['id']){delete _0xcf6a84[_0xb3cb('0x56')]['id'];}return db[_0xb3cb('0x3f')]['find']({'where':{'id':_0xcf6a84[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x244277,null))[_0xb3cb('0x2e')](saveUpdates(_0xcf6a84['body'],null))['then'](respondWithResult(_0x244277,null))[_0xb3cb('0x51')](handleError(_0x244277,null));};exports['destroy']=function(_0x54a072,_0x4f9f13){return db[_0xb3cb('0x3f')]['find']({'where':{'id':_0x54a072['params']['id']}})['then'](handleEntityNotFound(_0x4f9f13,null))[_0xb3cb('0x2e')](removeEntity(_0x4f9f13,null))[_0xb3cb('0x51')](handleError(_0x4f9f13,null));};exports['getHoppers']=function(_0x1149de,_0x1b9bdd,_0x269fac){var _0x4d132f={'raw':![],'where':{}};var _0x25c50c={};var _0x5d7416={'count':0x0,'rows':[]};return db[_0xb3cb('0x3f')][_0xb3cb('0x64')]({'where':{'id':_0x1149de[_0xb3cb('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1b9bdd,null))[_0xb3cb('0x2e')](function(_0x1c92a3){if(_0x1c92a3){_0x25c50c['model']=_[_0xb3cb('0x45')](db[_0xb3cb('0x65')][_0xb3cb('0x40')]);_0x25c50c[_0xb3cb('0x44')]=_[_0xb3cb('0x45')](_0x1149de[_0xb3cb('0x44')]);_0x25c50c[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x25c50c[_0xb3cb('0x43')],_0x25c50c[_0xb3cb('0x44')]);_0x4d132f['attributes']=_[_0xb3cb('0x47')](_0x25c50c[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x1149de['query'][_0xb3cb('0x52')]));_0x4d132f['attributes']=_0x4d132f['attributes'][_0xb3cb('0x49')]?_0x4d132f['attributes']:_0x25c50c[_0xb3cb('0x43')];if(!_0x1149de['query']['hasOwnProperty'](_0xb3cb('0x4b'))){_0x4d132f[_0xb3cb('0x27')]=qs[_0xb3cb('0x27')](_0x1149de[_0xb3cb('0x44')][_0xb3cb('0x27')]);_0x4d132f['offset']=qs[_0xb3cb('0x24')](_0x1149de[_0xb3cb('0x44')]['offset']);}_0x4d132f[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x1149de[_0xb3cb('0x44')][_0xb3cb('0x4d')]);_0x4d132f[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x1149de[_0xb3cb('0x44')],_0x25c50c['filters']));_0x4d132f[_0xb3cb('0x4e')]['VoiceQueueId']=_0x1c92a3['id'];if(_0x1149de[_0xb3cb('0x44')][_0xb3cb('0x33')]){_0x4d132f[_0xb3cb('0x4e')]=_['merge'](_0x4d132f['where'],{'$or':_[_0xb3cb('0x35')](_0x4d132f[_0xb3cb('0x48')],function(_0x5896cb){var _0x25d281={};_0x25d281[_0x5896cb]={'$like':'%'+_0x1149de[_0xb3cb('0x44')][_0xb3cb('0x33')]+'%'};return _0x25d281;})});}_0x4d132f=_[_0xb3cb('0x4f')]({},_0x4d132f,_0x1149de[_0xb3cb('0x54')]);return db['CmHopper'][_0xb3cb('0x26')]({'where':_0x4d132f['where']})[_0xb3cb('0x2e')](function(_0x28e348){_0x5d7416['count']=_0x28e348;if(_0x1149de['query'][_0xb3cb('0x50')]){_0x4d132f[_0xb3cb('0x53')]=[{'all':!![]}];}return db[_0xb3cb('0x65')][_0xb3cb('0x67')](_0x4d132f);})['then'](function(_0x2c9eaa){_0x5d7416[_0xb3cb('0x68')]=_0x2c9eaa;return _0x5d7416;});}})[_0xb3cb('0x2e')](respondWithFilteredResult(_0x1b9bdd,_0x4d132f))['catch'](handleError(_0x1b9bdd,null));};exports['getHopperHistories']=function(_0x100ec1,_0x109c58,_0x264274){var _0x4b440e={'raw':!![],'where':{}};var _0x3b6f00={};var _0x498baf={'count':0x0,'rows':[]};return db[_0xb3cb('0x3f')][_0xb3cb('0x64')]({'where':{'id':_0x100ec1['params']['id']}})['then'](handleEntityNotFound(_0x109c58,null))[_0xb3cb('0x2e')](function(_0x1770c7){if(_0x1770c7){_0x3b6f00[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db['CmHopperHistory'][_0xb3cb('0x40')]);_0x3b6f00['query']=_[_0xb3cb('0x45')](_0x100ec1[_0xb3cb('0x44')]);_0x3b6f00[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x3b6f00['model'],_0x3b6f00[_0xb3cb('0x44')]);_0x4b440e[_0xb3cb('0x48')]=_[_0xb3cb('0x47')](_0x3b6f00[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x100ec1[_0xb3cb('0x44')]['fields']));_0x4b440e[_0xb3cb('0x48')]=_0x4b440e[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0x4b440e[_0xb3cb('0x48')]:_0x3b6f00['model'];if(!_0x100ec1['query'][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x4b440e[_0xb3cb('0x27')]=qs['limit'](_0x100ec1['query'][_0xb3cb('0x27')]);_0x4b440e[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x100ec1[_0xb3cb('0x44')][_0xb3cb('0x24')]);}_0x4b440e[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x100ec1[_0xb3cb('0x44')][_0xb3cb('0x4d')]);_0x4b440e[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x100ec1[_0xb3cb('0x44')],_0x3b6f00[_0xb3cb('0x46')]));_0x4b440e[_0xb3cb('0x4e')][_0xb3cb('0x69')]=_0x1770c7['id'];if(_0x100ec1[_0xb3cb('0x44')][_0xb3cb('0x33')]){_0x4b440e[_0xb3cb('0x4e')]=_['merge'](_0x4b440e[_0xb3cb('0x4e')],{'$or':_[_0xb3cb('0x35')](_0x4b440e[_0xb3cb('0x48')],function(_0x2d91ef){var _0x1375c5={};_0x1375c5[_0x2d91ef]={'$like':'%'+_0x100ec1[_0xb3cb('0x44')][_0xb3cb('0x33')]+'%'};return _0x1375c5;})});}_0x4b440e=_[_0xb3cb('0x4f')]({},_0x4b440e,_0x100ec1[_0xb3cb('0x54')]);return db[_0xb3cb('0x6a')][_0xb3cb('0x26')]({'where':_0x4b440e[_0xb3cb('0x4e')]})[_0xb3cb('0x2e')](function(_0x936a82){_0x498baf[_0xb3cb('0x26')]=_0x936a82;if(_0x100ec1[_0xb3cb('0x44')][_0xb3cb('0x50')]){_0x4b440e['include']=[{'all':!![]}];}return db[_0xb3cb('0x6a')][_0xb3cb('0x67')](_0x4b440e);})['then'](function(_0x1ef386){_0x498baf[_0xb3cb('0x68')]=_0x1ef386;return _0x498baf;});}})[_0xb3cb('0x2e')](respondWithFilteredResult(_0x109c58,_0x4b440e))['catch'](handleError(_0x109c58,null));};exports[_0xb3cb('0x6b')]=function(_0xf8a5c3,_0x409bd3,_0x1d7d04){var _0x3430a9={'raw':!![],'where':{}};var _0x2b0b1e={};var _0x4409bf={'count':0x0,'rows':[]};return db[_0xb3cb('0x3f')][_0xb3cb('0x64')]({'where':{'id':_0xf8a5c3[_0xb3cb('0x5e')]['id']}})['then'](handleEntityNotFound(_0x409bd3,null))[_0xb3cb('0x2e')](function(_0x4570f6){if(_0x4570f6){_0x2b0b1e[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db['CmHopperFinal'][_0xb3cb('0x40')]);_0x2b0b1e[_0xb3cb('0x44')]=_[_0xb3cb('0x45')](_0xf8a5c3[_0xb3cb('0x44')]);_0x2b0b1e[_0xb3cb('0x46')]=_['intersection'](_0x2b0b1e['model'],_0x2b0b1e[_0xb3cb('0x44')]);_0x3430a9['attributes']=_[_0xb3cb('0x47')](_0x2b0b1e[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0xf8a5c3[_0xb3cb('0x44')][_0xb3cb('0x52')]));_0x3430a9[_0xb3cb('0x48')]=_0x3430a9['attributes']['length']?_0x3430a9['attributes']:_0x2b0b1e['model'];if(!_0xf8a5c3[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x3430a9[_0xb3cb('0x27')]=qs['limit'](_0xf8a5c3[_0xb3cb('0x44')]['limit']);_0x3430a9[_0xb3cb('0x24')]=qs['offset'](_0xf8a5c3[_0xb3cb('0x44')][_0xb3cb('0x24')]);}_0x3430a9[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0xf8a5c3[_0xb3cb('0x44')][_0xb3cb('0x4d')]);_0x3430a9[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0xf8a5c3[_0xb3cb('0x44')],_0x2b0b1e[_0xb3cb('0x46')]));_0x3430a9[_0xb3cb('0x4e')][_0xb3cb('0x69')]=_0x4570f6['id'];if(_0xf8a5c3[_0xb3cb('0x44')]['filter']){_0x3430a9['where']=_[_0xb3cb('0x4f')](_0x3430a9['where'],{'$or':_[_0xb3cb('0x35')](_0x3430a9[_0xb3cb('0x48')],function(_0x5a086){var _0x1dc6b9={};_0x1dc6b9[_0x5a086]={'$like':'%'+_0xf8a5c3[_0xb3cb('0x44')][_0xb3cb('0x33')]+'%'};return _0x1dc6b9;})});}_0x3430a9=_[_0xb3cb('0x4f')]({},_0x3430a9,_0xf8a5c3['options']);return db[_0xb3cb('0x6c')][_0xb3cb('0x26')]({'where':_0x3430a9[_0xb3cb('0x4e')]})['then'](function(_0x3839d1){_0x4409bf[_0xb3cb('0x26')]=_0x3839d1;if(_0xf8a5c3[_0xb3cb('0x44')][_0xb3cb('0x50')]){_0x3430a9[_0xb3cb('0x53')]=[{'all':!![]}];}return db[_0xb3cb('0x6c')][_0xb3cb('0x67')](_0x3430a9);})[_0xb3cb('0x2e')](function(_0x1fb8ea){_0x4409bf[_0xb3cb('0x68')]=_0x1fb8ea;return _0x4409bf;});}})[_0xb3cb('0x2e')](respondWithFilteredResult(_0x409bd3,_0x3430a9))[_0xb3cb('0x51')](handleError(_0x409bd3,null));};exports[_0xb3cb('0x6d')]=function(_0x15d5ed,_0x653102,_0xb01d00){var _0xf8efb9={'raw':!![],'where':{}};var _0x10b162={};var _0x295018={'count':0x0,'rows':[]};return db[_0xb3cb('0x3f')][_0xb3cb('0x64')]({'where':{'id':_0x15d5ed[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x653102,null))[_0xb3cb('0x2e')](function(_0x46d9d4){if(_0x46d9d4){_0x10b162[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db['CmHopperBlack'][_0xb3cb('0x40')]);_0x10b162[_0xb3cb('0x44')]=_['keys'](_0x15d5ed['query']);_0x10b162[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x10b162[_0xb3cb('0x43')],_0x10b162[_0xb3cb('0x44')]);_0xf8efb9['attributes']=_[_0xb3cb('0x47')](_0x10b162[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x15d5ed[_0xb3cb('0x44')][_0xb3cb('0x52')]));_0xf8efb9[_0xb3cb('0x48')]=_0xf8efb9[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0xf8efb9['attributes']:_0x10b162[_0xb3cb('0x43')];if(!_0x15d5ed[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0xf8efb9[_0xb3cb('0x27')]=qs[_0xb3cb('0x27')](_0x15d5ed[_0xb3cb('0x44')][_0xb3cb('0x27')]);_0xf8efb9[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x15d5ed['query']['offset']);}_0xf8efb9[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x15d5ed['query'][_0xb3cb('0x4d')]);_0xf8efb9[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x15d5ed[_0xb3cb('0x44')],_0x10b162['filters']));_0xf8efb9[_0xb3cb('0x4e')][_0xb3cb('0x69')]=_0x46d9d4['id'];if(_0x15d5ed[_0xb3cb('0x44')][_0xb3cb('0x33')]){_0xf8efb9[_0xb3cb('0x4e')]=_['merge'](_0xf8efb9['where'],{'$or':_[_0xb3cb('0x35')](_0xf8efb9[_0xb3cb('0x48')],function(_0x1cbe53){var _0x5a39f8={};_0x5a39f8[_0x1cbe53]={'$like':'%'+_0x15d5ed['query']['filter']+'%'};return _0x5a39f8;})});}_0xf8efb9=_['merge']({},_0xf8efb9,_0x15d5ed[_0xb3cb('0x54')]);return db['CmHopperBlack'][_0xb3cb('0x26')]({'where':_0xf8efb9[_0xb3cb('0x4e')]})[_0xb3cb('0x2e')](function(_0x22ce02){_0x295018[_0xb3cb('0x26')]=_0x22ce02;if(_0x15d5ed[_0xb3cb('0x44')]['includeAll']){_0xf8efb9[_0xb3cb('0x53')]=[{'all':!![]}];}return db[_0xb3cb('0x6e')][_0xb3cb('0x67')](_0xf8efb9);})['then'](function(_0x256c10){_0x295018['rows']=_0x256c10;return _0x295018;});}})['then'](respondWithFilteredResult(_0x653102,_0xf8efb9))['catch'](handleError(_0x653102,null));};exports[_0xb3cb('0x6f')]=function(_0x15b641,_0x37f8c4,_0xb76532){var _0x12a80b={};var _0x17f181={};var _0x45e94e;var _0x46b672;return db[_0xb3cb('0x3f')]['findOne']({'where':{'id':_0x15b641[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x37f8c4,null))[_0xb3cb('0x2e')](function(_0x2af1be){if(_0x2af1be){_0x45e94e=_0x2af1be;_0x17f181[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db[_0xb3cb('0x70')][_0xb3cb('0x40')]);_0x17f181['query']=_['keys'](_0x15b641[_0xb3cb('0x44')]);_0x17f181[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x17f181['model'],_0x17f181[_0xb3cb('0x44')]);_0x12a80b[_0xb3cb('0x48')]=_['intersection'](_0x17f181['model'],qs['fields'](_0x15b641['query']['fields']));_0x12a80b[_0xb3cb('0x48')]=_0x12a80b['attributes']['length']?_0x12a80b[_0xb3cb('0x48')]:_0x17f181[_0xb3cb('0x43')];_0x12a80b[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x15b641[_0xb3cb('0x44')][_0xb3cb('0x4d')]);_0x12a80b[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x15b641[_0xb3cb('0x44')],_0x17f181[_0xb3cb('0x46')]));if(_0x15b641[_0xb3cb('0x44')][_0xb3cb('0x33')]){_0x12a80b['where']=_['merge'](_0x12a80b[_0xb3cb('0x4e')],{'$or':_[_0xb3cb('0x35')](_0x12a80b[_0xb3cb('0x48')],function(_0x4ad994){var _0x405a37={};_0x405a37[_0x4ad994]={'$like':'%'+_0x15b641[_0xb3cb('0x44')][_0xb3cb('0x33')]+'%'};return _0x405a37;})});}_0x12a80b=_[_0xb3cb('0x4f')]({},_0x12a80b,_0x15b641[_0xb3cb('0x54')]);return _0x45e94e[_0xb3cb('0x6f')](_0x12a80b);}})['then'](function(_0x1af693){if(_0x1af693){_0x46b672=_0x1af693[_0xb3cb('0x49')];if(!_0x15b641[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x12a80b[_0xb3cb('0x27')]=qs[_0xb3cb('0x27')](_0x15b641['query'][_0xb3cb('0x27')]);_0x12a80b[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x15b641[_0xb3cb('0x44')][_0xb3cb('0x24')]);}return _0x45e94e[_0xb3cb('0x6f')](_0x12a80b);}})[_0xb3cb('0x2e')](function(_0x7b8177){if(_0x7b8177){return _0x7b8177?{'count':_0x46b672,'rows':_0x7b8177}:null;}})[_0xb3cb('0x2e')](respondWithResult(_0x37f8c4,null))[_0xb3cb('0x51')](handleError(_0x37f8c4,null));};exports['addTeams']=function(_0x4c1a49,_0x505370,_0x52119a){var _0x51cb8c=_0x4c1a49[_0xb3cb('0x56')][_0xb3cb('0x71')];var _0x5fdf6b=_[_0xb3cb('0x35')](_0x51cb8c,'id');return db['Team']['findAll']({'where':{'id':_0x5fdf6b},'attributes':['id'],'include':[{'model':db[_0xb3cb('0x72')],'as':_0xb3cb('0x73'),'attributes':['id','name','online',_0xb3cb('0x74'),_0xb3cb('0x75')],'raw':!![]}]})[_0xb3cb('0x2e')](function(_0x404378){if(_0x404378){var _0x33de85=_[_0xb3cb('0x76')](_0x404378,function(_0x35514b){var _0x2549ac=_0x35514b['get']({'plain':!![]});_0x2549ac['Agents']['forEach'](function(_0x4012dd){_0x4012dd[_0xb3cb('0x77')]=_['find'](_0x51cb8c,{'id':_0x2549ac['id']})[_0xb3cb('0x77')];});return _0x2549ac[_0xb3cb('0x73')];});return db['VoiceQueue']['find']({'where':{'id':_0x4c1a49[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](function(_0x6d047a){return db[_0xb3cb('0x78')][_0xb3cb('0x79')](function(_0x49facc){return _0x6d047a[_0xb3cb('0x7a')](_0x5fdf6b,{'transaction':_0x49facc})[_0xb3cb('0x2e')](function(){return BPromise['each'](_0x51cb8c,function(_0x4b068b){return db[_0xb3cb('0x7b')]['upsert']({'TeamId':_0x4b068b['id'],'VoiceQueueId':_0x4c1a49[_0xb3cb('0x5e')]['id'],'penalty':_0x4b068b['penalty']},{'transaction':_0x49facc});});})[_0xb3cb('0x2e')](function(){return BPromise['each'](_0x33de85,function(_0x524efe){return db['UserVoiceQueue'][_0xb3cb('0x7c')]({'where':{'UserId':_0x524efe['id'],'VoiceQueueId':_0x4c1a49[_0xb3cb('0x5e')]['id']},'defaults':{'penalty':_0x524efe[_0xb3cb('0x77')]},'transaction':_0x49facc});});})[_0xb3cb('0x2e')](function(){return BPromise[_0xb3cb('0x7d')](_[_0xb3cb('0x33')](_0x33de85,{'online':!![]}),function(_0x4c6036){return db[_0xb3cb('0x7e')]['upsert']({'membername':_0x4c6036[_0xb3cb('0x3a')],'UserId':_0x4c6036['id'],'queue_name':_0x6d047a[_0xb3cb('0x3a')],'VoiceQueueId':_0x6d047a['id'],'interface':_[_0xb3cb('0x7f')](_0x4c6036[_0xb3cb('0x75')])?util[_0xb3cb('0x80')]('SIP/%s',_0x4c6036[_0xb3cb('0x3a')]):_0x4c6036['interface'],'paused':_0x4c6036['voicePause']||![],'penalty':_0x4c6036[_0xb3cb('0x77')]},{'transaction':_0x49facc});});})[_0xb3cb('0x2e')](function(){_0x33de85[_0xb3cb('0x81')](function(_0x300113){socket[_0xb3cb('0x82')](_0xb3cb('0x83'),{'UserId':_0x300113['id'],'VoiceQueueId':_0x6d047a['id']});});});});});}})['then'](respondWithStatusCode(_0x505370,null))[_0xb3cb('0x51')](handleError(_0x505370,null));};exports[_0xb3cb('0x84')]=function(_0x58b3ea,_0x1d62d3,_0x2d1930){return db[_0xb3cb('0x70')]['findAll']({'where':{'id':_0x58b3ea[_0xb3cb('0x44')][_0xb3cb('0x85')]},'attributes':['id'],'include':[{'model':db[_0xb3cb('0x72')],'as':_0xb3cb('0x73'),'attributes':['id'],'raw':!![]}]})[_0xb3cb('0x2e')](handleEntityNotFound(_0x1d62d3,null))['then'](function(_0x3e0e5e){var _0x4afd6a=_[_0xb3cb('0x35')](_0x3e0e5e,'id');var _0x913982=[];var _0x2ae17a=[];var _0x5cf64d=squel[_0xb3cb('0x86')]();_0x5cf64d[_0xb3cb('0x87')](_0xb3cb('0x88'))['from'](_0xb3cb('0x89'),'tq')[_0xb3cb('0x8a')](_0xb3cb('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb3cb('0x8c'),_0x58b3ea[_0xb3cb('0x5e')]['id']);for(var _0xab8ce1=0x0;_0xab8ce1<_0x3e0e5e[_0xb3cb('0x49')];_0xab8ce1+=0x1){let _0x8dadaa=_0x3e0e5e[_0xab8ce1];for(var _0x26e7a9=0x0;_0x26e7a9<_0x8dadaa[_0xb3cb('0x73')]['length'];_0x26e7a9+=0x1){let _0x3a03a6=_0x8dadaa['Agents'][_0x26e7a9];var _0x14117a=_0x5cf64d['clone']();_0x14117a['where'](_0xb3cb('0x8d'),_0x3a03a6['id']);_0x2ae17a['push'](db['sequelize']['query'](_0x14117a[_0xb3cb('0x8e')](),{'type':db[_0xb3cb('0x78')][_0xb3cb('0x8f')]['SELECT']})[_0xb3cb('0x2e')](function(_0x5cb194){if(_0x5cb194[_0xb3cb('0x49')]===0x1){return _0x3a03a6['id'];}else{var _0x43a9c7=_['every'](_[_0xb3cb('0x35')](_0x5cb194,_0xb3cb('0x90')),function(_0x403529){return _[_0xb3cb('0x37')](_0x4afd6a,_0x403529);});if(_0x43a9c7){return _0x3a03a6['id'];}}}));}}return BPromise[_0xb3cb('0x91')](_0x2ae17a)[_0xb3cb('0x2e')](function(_0x500701){_0x913982=_(_0x913982)[_0xb3cb('0x92')](_0x500701)[_0xb3cb('0x93')]()[_0xb3cb('0x36')]();return db[_0xb3cb('0x3f')][_0xb3cb('0x39')]({'where':{'id':_0x58b3ea[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](function(_0x9f5af7){return db[_0xb3cb('0x78')][_0xb3cb('0x79')](function(_0x292751){return _0x9f5af7['removeTeams'](_0x58b3ea[_0xb3cb('0x44')][_0xb3cb('0x85')],{'transaction':_0x292751})[_0xb3cb('0x2e')](function(){if(!_[_0xb3cb('0x94')](_0x913982)){return _0x9f5af7[_0xb3cb('0x95')](_0x913982,{'transaction':_0x292751})[_0xb3cb('0x2e')](function(){return db[_0xb3cb('0x7e')]['destroy']({'where':{'VoiceQueueId':_0x58b3ea['params']['id'],'UserId':_0x913982},'transaction':_0x292751});});}})[_0xb3cb('0x2e')](function(){_0x913982[_0xb3cb('0x81')](function(_0x1bfaed){socket[_0xb3cb('0x82')](_0xb3cb('0x96'),{'UserId':_0x1bfaed,'VoiceQueueId':_0x9f5af7['id']});});});});});});})[_0xb3cb('0x2e')](respondWithStatusCode(_0x1d62d3,null))[_0xb3cb('0x51')](handleError(_0x1d62d3,null));};exports[_0xb3cb('0x97')]=function(_0x345cfd,_0x33e712,_0x3d5a15){var _0x1e4d5f,_0x46352e;return db[_0xb3cb('0x3f')][_0xb3cb('0x39')]({'where':{'id':_0x345cfd[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x33e712,null))[_0xb3cb('0x2e')](function(_0x2c4b6e){if(_0x2c4b6e){_0x46352e=_0x2c4b6e;return _0x2c4b6e[_0xb3cb('0x97')](_0x345cfd[_0xb3cb('0x56')][_0xb3cb('0x85')],_[_0xb3cb('0x98')](_0x345cfd[_0xb3cb('0x56')],[_0xb3cb('0x85'),'id'])||{})[_0xb3cb('0x99')](function(_0x3f6256){for(var _0x399907=0x0;_0x399907<_0x345cfd['body'][_0xb3cb('0x85')][_0xb3cb('0x49')];_0x399907+=0x1){socket[_0xb3cb('0x82')]('userVoiceQueue:save',{'UserId':Number(_0x345cfd[_0xb3cb('0x56')][_0xb3cb('0x85')][_0x399907]),'VoiceQueueId':Number(_0x345cfd[_0xb3cb('0x5e')]['id'])});}return _0x3f6256;});}})[_0xb3cb('0x2e')](function(_0x11b183){_0x1e4d5f=_0x11b183||[];if(_0x46352e){return db['User'][_0xb3cb('0x67')]({'where':{'id':_0x345cfd[_0xb3cb('0x56')][_0xb3cb('0x85')]},'attributes':['id',_0xb3cb('0x3a'),_0xb3cb('0x9a'),_0xb3cb('0x74'),'interface'],'raw':!![]});}})[_0xb3cb('0x2e')](function(_0x5f59bb){if(!_['isEmpty'](_0x5f59bb)){var _0x285e6f=[];for(var _0x150373=0x0;_0x150373<_0x5f59bb[_0xb3cb('0x49')];_0x150373++){if(_0x5f59bb[_0x150373][_0xb3cb('0x9a')]){_0x285e6f[_0xb3cb('0x9b')](db[_0xb3cb('0x7e')]['upsert']({'membername':_0x5f59bb[_0x150373][_0xb3cb('0x3a')],'UserId':_0x5f59bb[_0x150373]['id'],'queue_name':_0x46352e[_0xb3cb('0x3a')],'VoiceQueueId':_0x46352e['id'],'interface':_[_0xb3cb('0x7f')](_0x5f59bb[_0x150373][_0xb3cb('0x75')])?util[_0xb3cb('0x80')](_0xb3cb('0x9c'),_0x5f59bb[_0x150373][_0xb3cb('0x3a')]):_0x5f59bb[_0x150373][_0xb3cb('0x75')],'paused':_0x5f59bb[_0x150373][_0xb3cb('0x74')]||![],'penalty':_0x345cfd[_0xb3cb('0x56')][_0xb3cb('0x77')]||0x0}));}}return BPromise[_0xb3cb('0x91')](_0x285e6f);}})[_0xb3cb('0x2e')](function(){return _0x1e4d5f;})[_0xb3cb('0x2e')](respondWithResult(_0x33e712,null))['catch'](handleError(_0x33e712,null));};exports[_0xb3cb('0x95')]=function(_0x4a204a,_0x4c2950,_0x1cf879){return db[_0xb3cb('0x3f')][_0xb3cb('0x39')]({'where':{'id':_0x4a204a[_0xb3cb('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4c2950,null))[_0xb3cb('0x2e')](function(_0x1b997c){if(_0x1b997c){return _0x1b997c[_0xb3cb('0x95')](_0x4a204a[_0xb3cb('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x4a204a['query'][_0xb3cb('0x85')])){for(var _0x4e45c7=0x0;_0x4e45c7<_0x4a204a[_0xb3cb('0x44')][_0xb3cb('0x85')]['length'];_0x4e45c7+=0x1){socket[_0xb3cb('0x82')](_0xb3cb('0x96'),{'UserId':Number(_0x4a204a[_0xb3cb('0x44')][_0xb3cb('0x85')][_0x4e45c7]),'VoiceQueueId':Number(_0x4a204a[_0xb3cb('0x5e')]['id'])});}}else{socket[_0xb3cb('0x82')](_0xb3cb('0x96'),{'UserId':Number(_0x4a204a[_0xb3cb('0x44')][_0xb3cb('0x85')]),'VoiceQueueId':Number(_0x4a204a[_0xb3cb('0x5e')]['id'])});}});}})[_0xb3cb('0x2e')](function(_0x56780a){return db[_0xb3cb('0x7e')][_0xb3cb('0x2f')]({'where':{'VoiceQueueId':_0x4a204a[_0xb3cb('0x5e')]['id'],'UserId':_0x4a204a[_0xb3cb('0x44')][_0xb3cb('0x85')]}})[_0xb3cb('0x2e')](function(){return _0x56780a;});})[_0xb3cb('0x2e')](respondWithStatusCode(_0x4c2950,null))['catch'](handleError(_0x4c2950,null));};exports[_0xb3cb('0x9d')]=function(_0x4fd9bd,_0x1bb56f,_0x14a8a6){var _0x3c7f00={};var _0x220e5e={};var _0x4d9e31;var _0x4a64c4;return db[_0xb3cb('0x3f')]['findOne']({'where':{'id':_0x4fd9bd[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x1bb56f,null))[_0xb3cb('0x2e')](function(_0x298e51){if(_0x298e51){_0x4d9e31=_0x298e51;_0x220e5e[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db['User'][_0xb3cb('0x40')]);_0x220e5e[_0xb3cb('0x44')]=_[_0xb3cb('0x45')](_0x4fd9bd[_0xb3cb('0x44')]);_0x220e5e[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x220e5e[_0xb3cb('0x43')],_0x220e5e[_0xb3cb('0x44')]);_0x3c7f00[_0xb3cb('0x48')]=_['intersection'](_0x220e5e[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x4fd9bd[_0xb3cb('0x44')][_0xb3cb('0x52')]));_0x3c7f00[_0xb3cb('0x48')]=_0x3c7f00['attributes'][_0xb3cb('0x49')]?_0x3c7f00[_0xb3cb('0x48')]:_0x220e5e[_0xb3cb('0x43')];_0x3c7f00[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x4fd9bd[_0xb3cb('0x44')]['sort']);_0x3c7f00[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x4fd9bd[_0xb3cb('0x44')],_0x220e5e[_0xb3cb('0x46')]));if(_0x4fd9bd['query'][_0xb3cb('0x33')]){_0x3c7f00[_0xb3cb('0x4e')]=_[_0xb3cb('0x4f')](_0x3c7f00[_0xb3cb('0x4e')],{'$or':_[_0xb3cb('0x35')](_0x3c7f00[_0xb3cb('0x48')],function(_0x36b12a){var _0x1622f3={};_0x1622f3[_0x36b12a]={'$like':'%'+_0x4fd9bd[_0xb3cb('0x44')][_0xb3cb('0x33')]+'%'};return _0x1622f3;})});}_0x3c7f00=_[_0xb3cb('0x4f')]({},_0x3c7f00,_0x4fd9bd[_0xb3cb('0x54')]);return _0x4d9e31['getAgents'](_0x3c7f00);}})['then'](function(_0x743239){if(_0x743239){_0x4a64c4=_0x743239[_0xb3cb('0x49')];if(!_0x4fd9bd[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x3c7f00['limit']=qs['limit'](_0x4fd9bd['query'][_0xb3cb('0x27')]);_0x3c7f00[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x4fd9bd[_0xb3cb('0x44')]['offset']);}return _0x4d9e31[_0xb3cb('0x9d')](_0x3c7f00);}})['then'](function(_0x3eb2f4){if(_0x3eb2f4){return _0x3eb2f4?{'count':_0x4a64c4,'rows':_0x3eb2f4}:null;}})[_0xb3cb('0x2e')](respondWithResult(_0x1bb56f,null))[_0xb3cb('0x51')](handleError(_0x1bb56f,null));};exports[_0xb3cb('0x9e')]=function(_0x1b8f55,_0x556907,_0x4aee85){var _0x296744={};var _0x2eb61f={};var _0x487057;var _0x3108f2;return db[_0xb3cb('0x3f')][_0xb3cb('0x64')]({'where':{'id':_0x1b8f55[_0xb3cb('0x5e')]['id']}})['then'](handleEntityNotFound(_0x556907,null))[_0xb3cb('0x2e')](function(_0x5de250){if(_0x5de250){_0x487057=_0x5de250;_0x2eb61f[_0xb3cb('0x43')]=_['keys'](db[_0xb3cb('0x7e')][_0xb3cb('0x40')]);_0x2eb61f[_0xb3cb('0x44')]=_['keys'](_0x1b8f55[_0xb3cb('0x44')]);_0x2eb61f[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x2eb61f[_0xb3cb('0x43')],_0x2eb61f['query']);_0x296744[_0xb3cb('0x48')]=_[_0xb3cb('0x47')](_0x2eb61f['model'],qs[_0xb3cb('0x52')](_0x1b8f55[_0xb3cb('0x44')][_0xb3cb('0x52')]));_0x296744[_0xb3cb('0x48')]=_0x296744[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0x296744['attributes']:_0x2eb61f[_0xb3cb('0x43')];_0x296744['order']=qs[_0xb3cb('0x4d')](_0x1b8f55['query']['sort']);_0x296744['where']=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x1b8f55[_0xb3cb('0x44')],_0x2eb61f[_0xb3cb('0x46')]));if(_0x1b8f55['query'][_0xb3cb('0x33')]){_0x296744['where']=_[_0xb3cb('0x4f')](_0x296744['where'],{'$or':_[_0xb3cb('0x35')](_0x296744[_0xb3cb('0x48')],function(_0xb54cc2){var _0x2bfe80={};_0x2bfe80[_0xb54cc2]={'$like':'%'+_0x1b8f55[_0xb3cb('0x44')]['filter']+'%'};return _0x2bfe80;})});}_0x296744=_[_0xb3cb('0x4f')]({},_0x296744,_0x1b8f55[_0xb3cb('0x54')]);return _0x487057[_0xb3cb('0x9e')](_0x296744);}})['then'](function(_0x9b6a2a){if(_0x9b6a2a){_0x3108f2=_0x9b6a2a[_0xb3cb('0x49')];if(!_0x1b8f55[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x296744[_0xb3cb('0x27')]=qs[_0xb3cb('0x27')](_0x1b8f55[_0xb3cb('0x44')][_0xb3cb('0x27')]);_0x296744[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x1b8f55[_0xb3cb('0x44')][_0xb3cb('0x24')]);}return _0x487057[_0xb3cb('0x9e')](_0x296744);}})[_0xb3cb('0x2e')](function(_0x262511){return _0x262511?{'count':_0x3108f2,'rows':_0x262511}:null;})[_0xb3cb('0x2e')](respondWithResult(_0x556907,null))[_0xb3cb('0x51')](handleError(_0x556907,null));};exports[_0xb3cb('0x9f')]=function(_0x133d36,_0x5d21d9,_0x2d3a6f){var _0x412600={};var _0x14465c={};var _0x13655b;var _0x1ffba4;return db[_0xb3cb('0x3f')][_0xb3cb('0x64')]({'where':{'id':_0x133d36[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x5d21d9,null))[_0xb3cb('0x2e')](function(_0x264f17){if(_0x264f17){_0x13655b=_0x264f17;_0x14465c[_0xb3cb('0x43')]=_[_0xb3cb('0x45')](db[_0xb3cb('0xa0')][_0xb3cb('0x40')]);_0x14465c[_0xb3cb('0x44')]=_[_0xb3cb('0x45')](_0x133d36[_0xb3cb('0x44')]);_0x14465c[_0xb3cb('0x46')]=_[_0xb3cb('0x47')](_0x14465c[_0xb3cb('0x43')],_0x14465c[_0xb3cb('0x44')]);_0x412600[_0xb3cb('0x48')]=_[_0xb3cb('0x47')](_0x14465c[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x133d36[_0xb3cb('0x44')]['fields']));_0x412600[_0xb3cb('0x48')]=_0x412600[_0xb3cb('0x48')]['length']?_0x412600[_0xb3cb('0x48')]:_0x14465c[_0xb3cb('0x43')];_0x412600[_0xb3cb('0x4c')]=qs[_0xb3cb('0x4d')](_0x133d36[_0xb3cb('0x44')]['sort']);_0x412600[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x133d36['query'],_0x14465c[_0xb3cb('0x46')]));if(_0x133d36[_0xb3cb('0x44')]['filter']){_0x412600[_0xb3cb('0x4e')]=_[_0xb3cb('0x4f')](_0x412600[_0xb3cb('0x4e')],{'$or':_[_0xb3cb('0x35')](_0x412600['attributes'],function(_0xd9542a){var _0x11bf24={};_0x11bf24[_0xd9542a]={'$like':'%'+_0x133d36[_0xb3cb('0x44')][_0xb3cb('0x33')]+'%'};return _0x11bf24;})});}_0x412600=_['merge']({},_0x412600,_0x133d36[_0xb3cb('0x54')]);return _0x13655b[_0xb3cb('0x9f')](_0x412600);}})[_0xb3cb('0x2e')](function(_0x53e62b){if(_0x53e62b){_0x1ffba4=_0x53e62b['length'];if(!_0x133d36[_0xb3cb('0x44')]['hasOwnProperty']('nolimit')){_0x412600[_0xb3cb('0x27')]=qs['limit'](_0x133d36[_0xb3cb('0x44')][_0xb3cb('0x27')]);_0x412600[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x133d36[_0xb3cb('0x44')][_0xb3cb('0x24')]);}return _0x13655b['getLists'](_0x412600);}})[_0xb3cb('0x2e')](function(_0x9a0e61){if(_0x9a0e61){return _0x9a0e61?{'count':_0x1ffba4,'rows':_0x9a0e61}:null;}})['then'](respondWithResult(_0x5d21d9,null))[_0xb3cb('0x51')](handleError(_0x5d21d9,null));};exports[_0xb3cb('0xa1')]=function(_0x555c59,_0x5e4f1c,_0x50f17e){var _0x5ed3a3,_0x454660;return db['VoiceQueue'][_0xb3cb('0x39')]({'where':{'id':_0x555c59['params']['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x5e4f1c,null))[_0xb3cb('0x2e')](function(_0x13ca15){if(_0x13ca15){_0x454660=_0x13ca15;return _0x13ca15['addLists'](_0x555c59[_0xb3cb('0x56')][_0xb3cb('0x85')],_['omit'](_0x555c59[_0xb3cb('0x56')],[_0xb3cb('0x85'),'id'])||{});}return null;})[_0xb3cb('0x99')](function(_0xf9a2cc){var _0x35e291;_0x5ed3a3=_0xf9a2cc||[];var _0x1eaac6=[];if(_0xf9a2cc){for(var _0x47e0e8=0x0;_0x47e0e8<_0xf9a2cc['length'];_0x47e0e8+=0x1){var _0x551e8f=_0xf9a2cc[_0x47e0e8][_0xb3cb('0x30')]({'plain':!![]});_0x454660[_0xb3cb('0xa2')]=_0x555c59[_0xb3cb('0x56')][_0xb3cb('0xa2')]?_0x555c59[_0xb3cb('0x56')]['dialCheckDuplicateType']:_0x454660[_0xb3cb('0xa2')];switch(_0x454660[_0xb3cb('0xa2')]){case'always':_0x35e291=squel[_0xb3cb('0xa3')]()[_0xb3cb('0xa4')](_0xb3cb('0xa5'))[_0xb3cb('0xa6')]([_0xb3cb('0xa7'),_0xb3cb('0xa8'),'ContactId',_0xb3cb('0xa9'),_0xb3cb('0x69'),_0xb3cb('0x5f'),_0xb3cb('0xaa')],squel[_0xb3cb('0x86')]()[_0xb3cb('0x87')](_0xb3cb('0xa7'),_0xb3cb('0xa7'))[_0xb3cb('0x87')](_0xb3cb('0xab'),'scheduledAt')['field']('id',_0xb3cb('0xac'))[_0xb3cb('0x87')](_0x551e8f[_0xb3cb('0xad')][_0xb3cb('0x8e')](),'ListId')[_0xb3cb('0x87')](_0x555c59['params']['id'][_0xb3cb('0x8e')](),'VoiceQueueId')[_0xb3cb('0x87')](_0xb3cb('0xab'),'createdAt')[_0xb3cb('0x87')](_0xb3cb('0xab'),_0xb3cb('0xaa'))[_0xb3cb('0xae')](_0xb3cb('0xaf'))[_0xb3cb('0x4e')](_0xb3cb('0xb0'))[_0xb3cb('0x4e')](_0xb3cb('0xb1'),_0x551e8f[_0xb3cb('0xad')][_0xb3cb('0x8e')]())[_0xb3cb('0x4e')](_0xb3cb('0xb2'))[_0xb3cb('0x4e')](_0xb3cb('0xb3'),squel['select']()['field'](_0xb3cb('0xb4'))['from'](_0xb3cb('0xb5'))[_0xb3cb('0x4e')](_0xb3cb('0x8c'),_0x555c59[_0xb3cb('0x5e')]['id'][_0xb3cb('0x8e')]()))[_0xb3cb('0x4e')](_0xb3cb('0xb3'),squel['select']()[_0xb3cb('0x87')](_0xb3cb('0xb6'))['from']('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x555c59['params']['id']['toString']())))['toString']();break;case _0xb3cb('0xb7'):_0x35e291=squel[_0xb3cb('0xa3')]()[_0xb3cb('0xa4')](_0xb3cb('0xa5'))[_0xb3cb('0xa6')]([_0xb3cb('0xa7'),_0xb3cb('0xa8'),'ContactId',_0xb3cb('0xa9'),_0xb3cb('0x69'),_0xb3cb('0x5f'),_0xb3cb('0xaa')],squel['select']()['field'](_0xb3cb('0xa7'),'phone')[_0xb3cb('0x87')](_0xb3cb('0xab'),'scheduledAt')[_0xb3cb('0x87')]('id',_0xb3cb('0xac'))[_0xb3cb('0x87')](_0x551e8f[_0xb3cb('0xad')]['toString'](),_0xb3cb('0xa9'))[_0xb3cb('0x87')](_0x555c59[_0xb3cb('0x5e')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xb3cb('0x5f'))[_0xb3cb('0x87')](_0xb3cb('0xab'),_0xb3cb('0xaa'))['from'](_0xb3cb('0xaf'))[_0xb3cb('0x4e')](_0xb3cb('0xb0'))[_0xb3cb('0x4e')](_0xb3cb('0xb1'),_0x551e8f['CmListId']['toString']())[_0xb3cb('0x4e')](_0xb3cb('0xb2'))['where'](_0xb3cb('0xb3'),squel[_0xb3cb('0x86')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0xb3cb('0xa5'))[_0xb3cb('0x4e')]('VoiceQueueId\x20=\x20?',_0x555c59[_0xb3cb('0x5e')]['id'][_0xb3cb('0x8e')]())))[_0xb3cb('0x8e')]();break;default:_0x35e291=squel[_0xb3cb('0xa3')]()[_0xb3cb('0xa4')]('cm_hopper')[_0xb3cb('0xa6')]([_0xb3cb('0xa7'),_0xb3cb('0xa8'),'ContactId',_0xb3cb('0xa9'),'VoiceQueueId','createdAt','updatedAt'],squel[_0xb3cb('0x86')]()[_0xb3cb('0x87')](_0xb3cb('0xa7'),_0xb3cb('0xa7'))[_0xb3cb('0x87')](_0xb3cb('0xab'),_0xb3cb('0xa8'))[_0xb3cb('0x87')]('id',_0xb3cb('0xac'))['field'](_0x551e8f[_0xb3cb('0xad')]['toString'](),'ListId')[_0xb3cb('0x87')](_0x555c59['params']['id'][_0xb3cb('0x8e')](),_0xb3cb('0x69'))[_0xb3cb('0x87')]('NOW()',_0xb3cb('0x5f'))[_0xb3cb('0x87')](_0xb3cb('0xab'),_0xb3cb('0xaa'))[_0xb3cb('0xae')](_0xb3cb('0xaf'))[_0xb3cb('0x4e')]('deletedAt\x20IS\x20NULL')[_0xb3cb('0x4e')](_0xb3cb('0xb1'),_0x551e8f[_0xb3cb('0xad')][_0xb3cb('0x8e')]())['where'](_0xb3cb('0xb2')))[_0xb3cb('0x8e')]();}_0x1eaac6[_0xb3cb('0x9b')](db[_0xb3cb('0x78')][_0xb3cb('0x44')](_0x35e291));}return BPromise[_0xb3cb('0x91')](_0x1eaac6);}})['then'](function(){return _0x5ed3a3;})[_0xb3cb('0x2e')](respondWithResult(_0x5e4f1c,null))['catch'](handleError(_0x5e4f1c,null));};exports[_0xb3cb('0xb8')]=function(_0x335511,_0x18ad74,_0x5f1c33){return db[_0xb3cb('0x3f')][_0xb3cb('0x39')]({'where':{'id':_0x335511[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x18ad74,null))[_0xb3cb('0x2e')](function(_0x387960){if(_0x387960){return _0x387960['removeLists'](_0x335511[_0xb3cb('0x44')][_0xb3cb('0x85')]);}})['then'](function(_0x1a12d6){if(_0x1a12d6){return db[_0xb3cb('0x65')][_0xb3cb('0x2f')]({'where':{'ListId':_0x335511[_0xb3cb('0x44')][_0xb3cb('0x85')],'VoiceQueueId':_0x335511[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](function(){return _0x1a12d6;});}})[_0xb3cb('0x2e')](respondWithStatusCode(_0x18ad74,null))[_0xb3cb('0x51')](handleError(_0x18ad74,null));};exports[_0xb3cb('0xb9')]=function(_0x41d8a0,_0x21ed56,_0x5b1456){var _0x12e7d7={};var _0x5554ea={};var _0x4517f5;var _0x1c7b2b;return db['VoiceQueue'][_0xb3cb('0x64')]({'where':{'id':_0x41d8a0[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x21ed56,null))['then'](function(_0x2e1b87){if(_0x2e1b87){_0x4517f5=_0x2e1b87;_0x5554ea['model']=_[_0xb3cb('0x45')](db['CmList'][_0xb3cb('0x40')]);_0x5554ea[_0xb3cb('0x44')]=_['keys'](_0x41d8a0[_0xb3cb('0x44')]);_0x5554ea[_0xb3cb('0x46')]=_['intersection'](_0x5554ea['model'],_0x5554ea[_0xb3cb('0x44')]);_0x12e7d7[_0xb3cb('0x48')]=_['intersection'](_0x5554ea[_0xb3cb('0x43')],qs[_0xb3cb('0x52')](_0x41d8a0[_0xb3cb('0x44')][_0xb3cb('0x52')]));_0x12e7d7[_0xb3cb('0x48')]=_0x12e7d7[_0xb3cb('0x48')][_0xb3cb('0x49')]?_0x12e7d7[_0xb3cb('0x48')]:_0x5554ea['model'];_0x12e7d7['order']=qs['sort'](_0x41d8a0[_0xb3cb('0x44')][_0xb3cb('0x4d')]);_0x12e7d7[_0xb3cb('0x4e')]=qs[_0xb3cb('0x46')](_[_0xb3cb('0x66')](_0x41d8a0[_0xb3cb('0x44')],_0x5554ea[_0xb3cb('0x46')]));if(_0x41d8a0[_0xb3cb('0x44')][_0xb3cb('0x33')]){_0x12e7d7[_0xb3cb('0x4e')]=_[_0xb3cb('0x4f')](_0x12e7d7[_0xb3cb('0x4e')],{'$or':_['map'](_0x12e7d7['attributes'],function(_0x34da34){var _0x38d325={};_0x38d325[_0x34da34]={'$like':'%'+_0x41d8a0['query'][_0xb3cb('0x33')]+'%'};return _0x38d325;})});}_0x12e7d7=_['merge']({},_0x12e7d7,_0x41d8a0[_0xb3cb('0x54')]);return _0x4517f5[_0xb3cb('0xb9')](_0x12e7d7);}})[_0xb3cb('0x2e')](function(_0x4c500c){if(_0x4c500c){_0x1c7b2b=_0x4c500c[_0xb3cb('0x49')];if(!_0x41d8a0[_0xb3cb('0x44')][_0xb3cb('0x4a')](_0xb3cb('0x4b'))){_0x12e7d7['limit']=qs['limit'](_0x41d8a0[_0xb3cb('0x44')][_0xb3cb('0x27')]);_0x12e7d7[_0xb3cb('0x24')]=qs[_0xb3cb('0x24')](_0x41d8a0[_0xb3cb('0x44')][_0xb3cb('0x24')]);}return _0x4517f5[_0xb3cb('0xb9')](_0x12e7d7);}})[_0xb3cb('0x2e')](function(_0x2f8177){if(_0x2f8177){return _0x2f8177?{'count':_0x1c7b2b,'rows':_0x2f8177}:null;}})[_0xb3cb('0x2e')](respondWithResult(_0x21ed56,null))[_0xb3cb('0x51')](handleError(_0x21ed56,null));};exports[_0xb3cb('0xba')]=function(_0x47807f,_0x1d940f,_0x2a54fb){var _0x56915a,_0x564dc1;return db[_0xb3cb('0x3f')][_0xb3cb('0x39')]({'where':{'id':_0x47807f[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x1d940f,null))[_0xb3cb('0x2e')](function(_0x452d21){if(_0x452d21){_0x564dc1=_0x452d21;return _0x452d21[_0xb3cb('0xba')](_0x47807f[_0xb3cb('0x56')][_0xb3cb('0x85')],_['omit'](_0x47807f[_0xb3cb('0x56')],[_0xb3cb('0x85'),'id'])||{});}return null;})[_0xb3cb('0x99')](function(_0x1b9a7f){var _0x5e808e;_0x56915a=_0x1b9a7f||[];var _0x532a73=[];if(_0x1b9a7f){for(var _0x2d66f5=0x0;_0x2d66f5<_0x1b9a7f['length'];_0x2d66f5+=0x1){var _0x762c40=_0x1b9a7f[_0x2d66f5][_0xb3cb('0x30')]({'plain':!![]});_0x5e808e=squel['insert']()[_0xb3cb('0xa4')](_0xb3cb('0xbb'))['fromQuery']([_0xb3cb('0xa7'),_0xb3cb('0xac'),_0xb3cb('0xa9'),_0xb3cb('0x69'),_0xb3cb('0x5f'),'updatedAt'],squel['select']()['field'](_0xb3cb('0xa7'),_0xb3cb('0xa7'))[_0xb3cb('0x87')]('id',_0xb3cb('0xac'))['field'](_0x762c40['CmListId']['toString'](),_0xb3cb('0xa9'))[_0xb3cb('0x87')](_0x47807f[_0xb3cb('0x5e')]['id'][_0xb3cb('0x8e')](),_0xb3cb('0x69'))[_0xb3cb('0x87')](_0xb3cb('0xab'),_0xb3cb('0x5f'))[_0xb3cb('0x87')]('NOW()','updatedAt')[_0xb3cb('0xae')](_0xb3cb('0xaf'))['where']('deletedAt\x20IS\x20NULL')[_0xb3cb('0x4e')](_0xb3cb('0xb1'),_0x762c40[_0xb3cb('0xad')]['toString']())[_0xb3cb('0x4e')](_0xb3cb('0xb2')))[_0xb3cb('0x8e')]();_0x532a73['push'](db[_0xb3cb('0x78')][_0xb3cb('0x44')](_0x5e808e));}return BPromise[_0xb3cb('0x91')](_0x532a73);}})[_0xb3cb('0x2e')](function(){return _0x56915a;})[_0xb3cb('0x2e')](respondWithResult(_0x1d940f,null))['catch'](handleError(_0x1d940f,null));};exports[_0xb3cb('0xbc')]=function(_0x3ff7b7,_0x4a07b4,_0x16bdb6){return db[_0xb3cb('0x3f')][_0xb3cb('0x39')]({'where':{'id':_0x3ff7b7['params']['id']}})[_0xb3cb('0x2e')](handleEntityNotFound(_0x4a07b4,null))[_0xb3cb('0x2e')](function(_0x5d9b81){if(_0x5d9b81){return _0x5d9b81['removeBlackLists'](_0x3ff7b7[_0xb3cb('0x44')][_0xb3cb('0x85')]);}})[_0xb3cb('0x2e')](function(_0x23754c){if(_0x23754c){return db[_0xb3cb('0x6e')]['destroy']({'where':{'ListId':_0x3ff7b7[_0xb3cb('0x44')][_0xb3cb('0x85')],'VoiceQueueId':_0x3ff7b7[_0xb3cb('0x5e')]['id']}})[_0xb3cb('0x2e')](function(){return _0x23754c;});}})[_0xb3cb('0x2e')](respondWithStatusCode(_0x4a07b4,null))['catch'](handleError(_0x4a07b4,null));};
\ No newline at end of file
+var _0xfb8e=['UserProfileResource','destroy','end','sendStatus','error','stack','send','map','VoiceQueue','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','count','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','include','options','createdAt','updatedAt','UserProfileSection','findOne','CmHopper','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','UserVoiceQueue','each','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','userVoiceQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','NOW()','CmListId','ListId','deletedAt\x20IS\x20NULL','toString','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','cm_contacts','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','status','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','find','type','name'];(function(_0x27dfe7,_0x3acd6f){var _0x9d647c=function(_0x200340){while(--_0x200340){_0x27dfe7['push'](_0x27dfe7['shift']());}};_0x9d647c(++_0x3acd6f);}(_0xfb8e,0x1ef));var _0xefb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfb8e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xefb8('0x0'));var rimraf=require(_0xefb8('0x1'));var zipdir=require(_0xefb8('0x2'));var jsonpatch=require(_0xefb8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xefb8('0x4'));var Mustache=require(_0xefb8('0x5'));var util=require('util');var path=require(_0xefb8('0x6'));var sox=require('sox');var csv=require(_0xefb8('0x7'));var ejs=require(_0xefb8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xefb8('0x9'));var crypto=require('crypto');var jsforce=require(_0xefb8('0xa'));var deskjs=require(_0xefb8('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xefb8('0xc'));var Redis=require(_0xefb8('0xd'));var authService=require(_0xefb8('0xe'));var qs=require(_0xefb8('0xf'));var as=require(_0xefb8('0x10'));var hardwareService=require(_0xefb8('0x11'));var logger=require('../../config/logger')(_0xefb8('0x12'));var utils=require(_0xefb8('0x13'));var config=require(_0xefb8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xefb8('0x15'))['db'];config[_0xefb8('0x16')]=_[_0xefb8('0x17')](config[_0xefb8('0x16')],{'host':_0xefb8('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xefb8('0x16')]));require(_0xefb8('0x19'))[_0xefb8('0x1a')](socket);function respondWithStatusCode(_0x5159de,_0x465f71){_0x465f71=_0x465f71||0xcc;return function(_0x261edd){if(_0x261edd){return _0x5159de['sendStatus'](_0x465f71);}return _0x5159de['status'](_0x465f71)['end']();};}function respondWithResult(_0x56aa06,_0x22b63c){_0x22b63c=_0x22b63c||0xc8;return function(_0x5e63ae){if(_0x5e63ae){return _0x56aa06[_0xefb8('0x1b')](_0x22b63c)['json'](_0x5e63ae);}};}function respondWithFilteredResult(_0x302792,_0x1a91da){return function(_0x5d27ba){if(_0x5d27ba){var _0x12eac7=typeof _0x1a91da[_0xefb8('0x1c')]===_0xefb8('0x1d')&&typeof _0x1a91da[_0xefb8('0x1e')]==='undefined';var _0x414f6b=_0x5d27ba['count'];var _0x5e4a6a=_0x12eac7?0x0:_0x1a91da['offset'];var _0x35e354=_0x12eac7?_0x5d27ba['count']:_0x1a91da[_0xefb8('0x1c')]+_0x1a91da['limit'];var _0x1078dc;if(_0x35e354>=_0x414f6b){_0x35e354=_0x414f6b;_0x1078dc=0xc8;}else{_0x1078dc=0xce;}_0x302792[_0xefb8('0x1b')](_0x1078dc);return _0x302792[_0xefb8('0x1f')](_0xefb8('0x20'),_0x5e4a6a+'-'+_0x35e354+'/'+_0x414f6b)[_0xefb8('0x21')](_0x5d27ba);}return null;};}function patchUpdates(_0x520db6){return function(_0x861c66){try{jsonpatch[_0xefb8('0x22')](_0x861c66,_0x520db6,!![]);}catch(_0x2ed627){return BPromise[_0xefb8('0x23')](_0x2ed627);}return _0x861c66[_0xefb8('0x24')]();};}function saveUpdates(_0x1ebd9f,_0x25f752){return function(_0xec403a){if(_0xec403a){return _0xec403a[_0xefb8('0x25')](_0x1ebd9f)[_0xefb8('0x26')](function(_0x24c5d7){return _0x24c5d7;});}return null;};}function removeEntity(_0x434b0a,_0x29a1bf){return function(_0x3b9232){if(_0x3b9232){return _0x3b9232['destroy']()[_0xefb8('0x26')](function(){var _0x4a6f7f=_0x3b9232[_0xefb8('0x27')]({'plain':!![]});var _0xeb9c02=[{'name':_0xefb8('0x28'),'value':_0xefb8('0x29'),'ignore':![]},{'name':_0xefb8('0x2a'),'value':_0xefb8('0x2b'),'ignore':![]}];var _0x1d9f55=_(_0xeb9c02)[_0xefb8('0x2c')](_0xefb8('0x2d'))['map']('value')[_0xefb8('0x2e')]();if(_[_0xefb8('0x2f')](_0x1d9f55,_0x4a6f7f['type'])){return;}var _0x440ce8=_[_0xefb8('0x30')](_0xeb9c02,[_0xefb8('0x2e'),_0x4a6f7f[_0xefb8('0x31')]])[_0xefb8('0x32')];return db[_0xefb8('0x33')][_0xefb8('0x34')]({'where':{'type':_0x440ce8,'resourceId':_0x4a6f7f['id']}})[_0xefb8('0x26')](function(){return _0x3b9232;});})[_0xefb8('0x26')](function(){_0x434b0a[_0xefb8('0x1b')](0xcc)[_0xefb8('0x35')]();});}};}function handleEntityNotFound(_0x14150,_0x3f1619){return function(_0x5a0981){if(!_0x5a0981){_0x14150[_0xefb8('0x36')](0x194);}return _0x5a0981;};}function handleError(_0xb57ff0,_0x1a8fc){_0x1a8fc=_0x1a8fc||0x1f4;return function(_0xb1e064){logger[_0xefb8('0x37')](_0xb1e064[_0xefb8('0x38')]);if(_0xb1e064[_0xefb8('0x32')]){delete _0xb1e064[_0xefb8('0x32')];}_0xb57ff0[_0xefb8('0x1b')](_0x1a8fc)[_0xefb8('0x39')](_0xb1e064);};}exports['index']=function(_0x875ece,_0x325b87){var _0x380e91={},_0x19c3f7={},_0x22873a={'count':0x0,'rows':[]};var _0x893a05=_[_0xefb8('0x3a')](db[_0xefb8('0x3b')][_0xefb8('0x3c')],function(_0x122e31){return{'name':_0x122e31['fieldName'],'type':_0x122e31[_0xefb8('0x31')]['key']};});_0x19c3f7['model']=_[_0xefb8('0x3a')](_0x893a05,'name');_0x19c3f7['query']=_[_0xefb8('0x3d')](_0x875ece[_0xefb8('0x3e')]);_0x19c3f7[_0xefb8('0x3f')]=_[_0xefb8('0x40')](_0x19c3f7[_0xefb8('0x41')],_0x19c3f7[_0xefb8('0x3e')]);_0x380e91[_0xefb8('0x42')]=_[_0xefb8('0x40')](_0x19c3f7[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x875ece[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x380e91[_0xefb8('0x42')]=_0x380e91['attributes']['length']?_0x380e91[_0xefb8('0x42')]:_0x19c3f7[_0xefb8('0x41')];if(!_0x875ece['query'][_0xefb8('0x44')](_0xefb8('0x45'))){_0x380e91[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0x875ece['query'][_0xefb8('0x1e')]);_0x380e91[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x875ece[_0xefb8('0x3e')][_0xefb8('0x1c')]);}_0x380e91[_0xefb8('0x46')]=qs[_0xefb8('0x47')](_0x875ece[_0xefb8('0x3e')]['sort']);_0x380e91[_0xefb8('0x48')]=qs[_0xefb8('0x3f')](_[_0xefb8('0x49')](_0x875ece[_0xefb8('0x3e')],_0x19c3f7['filters']),_0x893a05);if(_0x875ece[_0xefb8('0x3e')][_0xefb8('0x2c')]){_0x380e91[_0xefb8('0x48')]=_[_0xefb8('0x4a')](_0x380e91[_0xefb8('0x48')],{'$or':_[_0xefb8('0x3a')](_0x893a05,function(_0xb7a403){if(_0xb7a403['type']!==_0xefb8('0x4b')){var _0x3a644d={};_0x3a644d[_0xb7a403[_0xefb8('0x32')]]={'$like':'%'+_0x875ece[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0x3a644d;}})});}_0x380e91=_['merge']({},_0x380e91,_0x875ece['options']);var _0x4af7c2={'where':_0x380e91['where']};return db['VoiceQueue'][_0xefb8('0x4c')](_0x4af7c2)[_0xefb8('0x26')](function(_0x1686c3){_0x22873a[_0xefb8('0x4c')]=_0x1686c3;if(_0x875ece['query']['includeAll']){_0x380e91['include']=[{'all':!![]}];}return db[_0xefb8('0x3b')]['findAll'](_0x380e91);})[_0xefb8('0x26')](function(_0x74d3eb){_0x22873a['rows']=_0x74d3eb;return _0x22873a;})['then'](respondWithFilteredResult(_0x325b87,_0x380e91))[_0xefb8('0x4d')](handleError(_0x325b87,null));};exports[_0xefb8('0x4e')]=function(_0x1734e6,_0x32f910){var _0x33ff15={'raw':![],'where':{'id':_0x1734e6[_0xefb8('0x4f')]['id']}},_0x54aec7={};_0x54aec7[_0xefb8('0x41')]=_[_0xefb8('0x3d')](db[_0xefb8('0x3b')]['rawAttributes']);_0x54aec7[_0xefb8('0x3e')]=_[_0xefb8('0x3d')](_0x1734e6[_0xefb8('0x3e')]);_0x54aec7[_0xefb8('0x3f')]=_['intersection'](_0x54aec7[_0xefb8('0x41')],_0x54aec7['query']);_0x33ff15[_0xefb8('0x42')]=_['intersection'](_0x54aec7[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x1734e6[_0xefb8('0x3e')]['fields']));_0x33ff15[_0xefb8('0x42')]=_0x33ff15[_0xefb8('0x42')][_0xefb8('0x50')]?_0x33ff15[_0xefb8('0x42')]:_0x54aec7['model'];if(_0x1734e6[_0xefb8('0x3e')]['includeAll']){_0x33ff15['include']=[{'all':!![]}];}_0x33ff15=_[_0xefb8('0x4a')]({},_0x33ff15,_0x1734e6['options']);return db[_0xefb8('0x3b')][_0xefb8('0x30')](_0x33ff15)[_0xefb8('0x26')](handleEntityNotFound(_0x32f910,null))[_0xefb8('0x26')](respondWithResult(_0x32f910,null))[_0xefb8('0x4d')](handleError(_0x32f910,null));};exports[_0xefb8('0x51')]=function(_0x5ec5a2,_0x5f235a){return db[_0xefb8('0x3b')]['create'](_0x5ec5a2[_0xefb8('0x52')],{})['then'](function(_0x1a2b9d){var _0x132cef=_0x5ec5a2[_0xefb8('0x53')][_0xefb8('0x27')]({'plain':!![]});if(!_0x132cef)throw new Error(_0xefb8('0x54'));if(_0x132cef[_0xefb8('0x55')]===_0xefb8('0x53')){var _0xdc2094=_0x1a2b9d[_0xefb8('0x27')]({'plain':!![]});var _0x448989=[{'name':_0xefb8('0x28'),'value':_0xefb8('0x29')},{'name':_0xefb8('0x2a'),'value':'outbound'}];var _0x19690c=_[_0xefb8('0x30')](_0x448989,[_0xefb8('0x2e'),_0xdc2094[_0xefb8('0x31')]])['name'];return db['UserProfileSection'][_0xefb8('0x30')]({'where':{'name':_0x19690c,'userProfileId':_0x132cef[_0xefb8('0x56')]},'raw':!![]})[_0xefb8('0x26')](function(_0xbcbf77){if(_0xbcbf77&&_0xbcbf77[_0xefb8('0x57')]===0x0){return db[_0xefb8('0x33')][_0xefb8('0x51')]({'name':_0xdc2094[_0xefb8('0x32')],'resourceId':_0xdc2094['id'],'type':_0xbcbf77['name'],'sectionId':_0xbcbf77['id']},{})[_0xefb8('0x26')](function(){return _0x1a2b9d;});}else{return _0x1a2b9d;}})[_0xefb8('0x4d')](function(_0x3ec5ce){logger['error'](_0xefb8('0x58'),_0x3ec5ce);throw _0x3ec5ce;});}return _0x1a2b9d;})['then'](respondWithResult(_0x5f235a,0xc9))[_0xefb8('0x4d')](handleError(_0x5f235a,null));};exports[_0xefb8('0x59')]=function(_0x302b7a,_0xf1b9c2){var _0x31512e={'where':{'id':_0x302b7a[_0xefb8('0x4f')]['id']}},_0x288a07={};_0x288a07[_0xefb8('0x41')]=_[_0xefb8('0x3d')](db[_0xefb8('0x3b')][_0xefb8('0x3c')]);_0x31512e[_0xefb8('0x42')]=_[_0xefb8('0x40')](_0x288a07[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x302b7a[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x31512e[_0xefb8('0x42')]=_0x31512e[_0xefb8('0x42')][_0xefb8('0x50')]?_0x31512e[_0xefb8('0x42')]:_0x288a07[_0xefb8('0x41')];if(_0x302b7a[_0xefb8('0x3e')][_0xefb8('0x5a')]){_0x31512e[_0xefb8('0x5b')]=[{'all':!![]}];}_0x31512e=_[_0xefb8('0x4a')]({},_0x31512e,_0x302b7a[_0xefb8('0x5c')]);return db[_0xefb8('0x3b')]['find'](_0x31512e)[_0xefb8('0x26')](handleEntityNotFound(_0xf1b9c2,null))[_0xefb8('0x26')](function(_0xb4b101){if(_0xb4b101){var _0x2bd582=_0xb4b101['get']({'plain':!![]});_0x2bd582=qs['omit'](_0x2bd582,['id','createdAt','updatedAt']);_0x302b7a[_0xefb8('0x52')]=_['omit'](_0x302b7a[_0xefb8('0x52')],['id',_0xefb8('0x5d'),_0xefb8('0x5e')]);return db[_0xefb8('0x3b')]['create'](_[_0xefb8('0x4a')](_0x2bd582,_0x302b7a[_0xefb8('0x52')]),{'include':_0x302b7a['query'][_0xefb8('0x5a')]?[{'all':!![]}]:undefined})[_0xefb8('0x26')](function(_0x35d3a7){var _0x4855fa=_0x302b7a[_0xefb8('0x53')][_0xefb8('0x27')]({'plain':!![]});if(!_0x4855fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4855fa[_0xefb8('0x55')]===_0xefb8('0x53')){var _0x3d820c=_0x35d3a7[_0xefb8('0x27')]({'plain':!![]});var _0xac6e82=[{'name':_0xefb8('0x28'),'value':_0xefb8('0x29')},{'name':_0xefb8('0x2a'),'value':_0xefb8('0x2b')}];var _0x3ca661=_['find'](_0xac6e82,[_0xefb8('0x2e'),_0x3d820c['type']])[_0xefb8('0x32')];return db[_0xefb8('0x5f')][_0xefb8('0x30')]({'where':{'name':_0x3ca661,'userProfileId':_0x4855fa[_0xefb8('0x56')]},'raw':!![]})['then'](function(_0x3b8af6){if(_0x3b8af6&&_0x3b8af6[_0xefb8('0x57')]===0x0){return db[_0xefb8('0x33')][_0xefb8('0x51')]({'name':_0x3d820c['name'],'resourceId':_0x3d820c['id'],'type':_0x3b8af6[_0xefb8('0x32')],'sectionId':_0x3b8af6['id']},{})['then'](function(){return _0x35d3a7;});}else{return _0x35d3a7;}})[_0xefb8('0x4d')](function(_0x487e73){logger[_0xefb8('0x37')](_0xefb8('0x58'),_0x487e73);throw _0x487e73;});}return _0x35d3a7;});}})['then'](respondWithResult(_0xf1b9c2,0xc9))[_0xefb8('0x4d')](handleError(_0xf1b9c2,null));};exports[_0xefb8('0x25')]=function(_0x2316f6,_0x10dcb9){if(_0x2316f6[_0xefb8('0x52')]['id']){delete _0x2316f6['body']['id'];}return db[_0xefb8('0x3b')]['find']({'where':{'id':_0x2316f6[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x10dcb9,null))['then'](saveUpdates(_0x2316f6[_0xefb8('0x52')],null))[_0xefb8('0x26')](respondWithResult(_0x10dcb9,null))[_0xefb8('0x4d')](handleError(_0x10dcb9,null));};exports[_0xefb8('0x34')]=function(_0x1fe327,_0x3d6c82){return db[_0xefb8('0x3b')][_0xefb8('0x30')]({'where':{'id':_0x1fe327[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d6c82,null))[_0xefb8('0x26')](removeEntity(_0x3d6c82,null))[_0xefb8('0x4d')](handleError(_0x3d6c82,null));};exports['getHoppers']=function(_0xbd1b00,_0x27137b,_0x58cb3e){var _0x174a05={'raw':![],'where':{}};var _0x3d19ee={};var _0x89bcb6={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xefb8('0x60')]({'where':{'id':_0xbd1b00[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x27137b,null))['then'](function(_0x38d196){if(_0x38d196){_0x3d19ee[_0xefb8('0x41')]=_[_0xefb8('0x3d')](db[_0xefb8('0x61')][_0xefb8('0x3c')]);_0x3d19ee['query']=_[_0xefb8('0x3d')](_0xbd1b00[_0xefb8('0x3e')]);_0x3d19ee['filters']=_['intersection'](_0x3d19ee[_0xefb8('0x41')],_0x3d19ee['query']);_0x174a05['attributes']=_['intersection'](_0x3d19ee[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0xbd1b00[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x174a05[_0xefb8('0x42')]=_0x174a05[_0xefb8('0x42')][_0xefb8('0x50')]?_0x174a05[_0xefb8('0x42')]:_0x3d19ee['model'];if(!_0xbd1b00[_0xefb8('0x3e')][_0xefb8('0x44')](_0xefb8('0x45'))){_0x174a05[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0xbd1b00['query'][_0xefb8('0x1e')]);_0x174a05[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0xbd1b00[_0xefb8('0x3e')][_0xefb8('0x1c')]);}_0x174a05[_0xefb8('0x46')]=qs[_0xefb8('0x47')](_0xbd1b00[_0xefb8('0x3e')][_0xefb8('0x47')]);_0x174a05[_0xefb8('0x48')]=qs['filters'](_['pick'](_0xbd1b00[_0xefb8('0x3e')],_0x3d19ee[_0xefb8('0x3f')]));_0x174a05[_0xefb8('0x48')][_0xefb8('0x62')]=_0x38d196['id'];if(_0xbd1b00[_0xefb8('0x3e')]['filter']){_0x174a05[_0xefb8('0x48')]=_['merge'](_0x174a05['where'],{'$or':_[_0xefb8('0x3a')](_0x174a05[_0xefb8('0x42')],function(_0x4a8c3c){var _0x726dab={};_0x726dab[_0x4a8c3c]={'$like':'%'+_0xbd1b00[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0x726dab;})});}_0x174a05=_[_0xefb8('0x4a')]({},_0x174a05,_0xbd1b00[_0xefb8('0x5c')]);return db[_0xefb8('0x61')][_0xefb8('0x4c')]({'where':_0x174a05[_0xefb8('0x48')]})[_0xefb8('0x26')](function(_0x50756b){_0x89bcb6[_0xefb8('0x4c')]=_0x50756b;if(_0xbd1b00[_0xefb8('0x3e')][_0xefb8('0x5a')]){_0x174a05[_0xefb8('0x5b')]=[{'all':!![]}];}return db[_0xefb8('0x61')][_0xefb8('0x63')](_0x174a05);})[_0xefb8('0x26')](function(_0x28bc59){_0x89bcb6[_0xefb8('0x64')]=_0x28bc59;return _0x89bcb6;});}})[_0xefb8('0x26')](respondWithFilteredResult(_0x27137b,_0x174a05))[_0xefb8('0x4d')](handleError(_0x27137b,null));};exports[_0xefb8('0x65')]=function(_0x4ad199,_0x1005cb,_0x39302a){var _0x49ca7a={'raw':!![],'where':{}};var _0x295628={};var _0x12fe88={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xefb8('0x60')]({'where':{'id':_0x4ad199[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x1005cb,null))[_0xefb8('0x26')](function(_0xea760b){if(_0xea760b){_0x295628[_0xefb8('0x41')]=_[_0xefb8('0x3d')](db[_0xefb8('0x66')][_0xefb8('0x3c')]);_0x295628['query']=_['keys'](_0x4ad199[_0xefb8('0x3e')]);_0x295628[_0xefb8('0x3f')]=_['intersection'](_0x295628['model'],_0x295628['query']);_0x49ca7a[_0xefb8('0x42')]=_[_0xefb8('0x40')](_0x295628[_0xefb8('0x41')],qs['fields'](_0x4ad199[_0xefb8('0x3e')]['fields']));_0x49ca7a[_0xefb8('0x42')]=_0x49ca7a['attributes'][_0xefb8('0x50')]?_0x49ca7a[_0xefb8('0x42')]:_0x295628[_0xefb8('0x41')];if(!_0x4ad199[_0xefb8('0x3e')][_0xefb8('0x44')](_0xefb8('0x45'))){_0x49ca7a[_0xefb8('0x1e')]=qs['limit'](_0x4ad199[_0xefb8('0x3e')][_0xefb8('0x1e')]);_0x49ca7a['offset']=qs[_0xefb8('0x1c')](_0x4ad199[_0xefb8('0x3e')]['offset']);}_0x49ca7a['order']=qs[_0xefb8('0x47')](_0x4ad199['query']['sort']);_0x49ca7a[_0xefb8('0x48')]=qs[_0xefb8('0x3f')](_['pick'](_0x4ad199['query'],_0x295628[_0xefb8('0x3f')]));_0x49ca7a[_0xefb8('0x48')][_0xefb8('0x62')]=_0xea760b['id'];if(_0x4ad199[_0xefb8('0x3e')][_0xefb8('0x2c')]){_0x49ca7a[_0xefb8('0x48')]=_['merge'](_0x49ca7a['where'],{'$or':_[_0xefb8('0x3a')](_0x49ca7a['attributes'],function(_0x5bce28){var _0xce95c0={};_0xce95c0[_0x5bce28]={'$like':'%'+_0x4ad199[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0xce95c0;})});}_0x49ca7a=_['merge']({},_0x49ca7a,_0x4ad199[_0xefb8('0x5c')]);return db[_0xefb8('0x66')]['count']({'where':_0x49ca7a[_0xefb8('0x48')]})[_0xefb8('0x26')](function(_0x397204){_0x12fe88[_0xefb8('0x4c')]=_0x397204;if(_0x4ad199[_0xefb8('0x3e')][_0xefb8('0x5a')]){_0x49ca7a[_0xefb8('0x5b')]=[{'all':!![]}];}return db[_0xefb8('0x66')][_0xefb8('0x63')](_0x49ca7a);})[_0xefb8('0x26')](function(_0x56a838){_0x12fe88[_0xefb8('0x64')]=_0x56a838;return _0x12fe88;});}})[_0xefb8('0x26')](respondWithFilteredResult(_0x1005cb,_0x49ca7a))['catch'](handleError(_0x1005cb,null));};exports[_0xefb8('0x67')]=function(_0x4e5d68,_0xcb1dc4,_0x534389){var _0x511349={'raw':!![],'where':{}};var _0x4c7f12={};var _0x36d4cc={'count':0x0,'rows':[]};return db[_0xefb8('0x3b')][_0xefb8('0x60')]({'where':{'id':_0x4e5d68['params']['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0xcb1dc4,null))['then'](function(_0x5c46d3){if(_0x5c46d3){_0x4c7f12[_0xefb8('0x41')]=_['keys'](db[_0xefb8('0x68')][_0xefb8('0x3c')]);_0x4c7f12['query']=_[_0xefb8('0x3d')](_0x4e5d68['query']);_0x4c7f12['filters']=_['intersection'](_0x4c7f12[_0xefb8('0x41')],_0x4c7f12[_0xefb8('0x3e')]);_0x511349[_0xefb8('0x42')]=_[_0xefb8('0x40')](_0x4c7f12[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x4e5d68[_0xefb8('0x3e')]['fields']));_0x511349[_0xefb8('0x42')]=_0x511349['attributes'][_0xefb8('0x50')]?_0x511349[_0xefb8('0x42')]:_0x4c7f12[_0xefb8('0x41')];if(!_0x4e5d68[_0xefb8('0x3e')][_0xefb8('0x44')](_0xefb8('0x45'))){_0x511349[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0x4e5d68[_0xefb8('0x3e')]['limit']);_0x511349[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x4e5d68[_0xefb8('0x3e')][_0xefb8('0x1c')]);}_0x511349[_0xefb8('0x46')]=qs['sort'](_0x4e5d68[_0xefb8('0x3e')]['sort']);_0x511349[_0xefb8('0x48')]=qs[_0xefb8('0x3f')](_[_0xefb8('0x49')](_0x4e5d68[_0xefb8('0x3e')],_0x4c7f12[_0xefb8('0x3f')]));_0x511349['where'][_0xefb8('0x62')]=_0x5c46d3['id'];if(_0x4e5d68[_0xefb8('0x3e')][_0xefb8('0x2c')]){_0x511349['where']=_[_0xefb8('0x4a')](_0x511349[_0xefb8('0x48')],{'$or':_[_0xefb8('0x3a')](_0x511349['attributes'],function(_0x25b6e3){var _0x282836={};_0x282836[_0x25b6e3]={'$like':'%'+_0x4e5d68[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0x282836;})});}_0x511349=_[_0xefb8('0x4a')]({},_0x511349,_0x4e5d68[_0xefb8('0x5c')]);return db[_0xefb8('0x68')]['count']({'where':_0x511349[_0xefb8('0x48')]})[_0xefb8('0x26')](function(_0x57faf2){_0x36d4cc[_0xefb8('0x4c')]=_0x57faf2;if(_0x4e5d68[_0xefb8('0x3e')]['includeAll']){_0x511349[_0xefb8('0x5b')]=[{'all':!![]}];}return db[_0xefb8('0x68')][_0xefb8('0x63')](_0x511349);})[_0xefb8('0x26')](function(_0x2c0ffc){_0x36d4cc[_0xefb8('0x64')]=_0x2c0ffc;return _0x36d4cc;});}})[_0xefb8('0x26')](respondWithFilteredResult(_0xcb1dc4,_0x511349))[_0xefb8('0x4d')](handleError(_0xcb1dc4,null));};exports['getHopperBlacks']=function(_0x26be24,_0x309541,_0x13f329){var _0x2318fe={'raw':!![],'where':{}};var _0x1507a8={};var _0x1633f7={'count':0x0,'rows':[]};return db[_0xefb8('0x3b')][_0xefb8('0x60')]({'where':{'id':_0x26be24[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x309541,null))[_0xefb8('0x26')](function(_0x173b64){if(_0x173b64){_0x1507a8[_0xefb8('0x41')]=_['keys'](db[_0xefb8('0x69')][_0xefb8('0x3c')]);_0x1507a8['query']=_[_0xefb8('0x3d')](_0x26be24[_0xefb8('0x3e')]);_0x1507a8[_0xefb8('0x3f')]=_[_0xefb8('0x40')](_0x1507a8[_0xefb8('0x41')],_0x1507a8['query']);_0x2318fe['attributes']=_[_0xefb8('0x40')](_0x1507a8['model'],qs[_0xefb8('0x43')](_0x26be24[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x2318fe[_0xefb8('0x42')]=_0x2318fe[_0xefb8('0x42')]['length']?_0x2318fe[_0xefb8('0x42')]:_0x1507a8[_0xefb8('0x41')];if(!_0x26be24['query'][_0xefb8('0x44')]('nolimit')){_0x2318fe[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0x26be24['query'][_0xefb8('0x1e')]);_0x2318fe['offset']=qs[_0xefb8('0x1c')](_0x26be24['query'][_0xefb8('0x1c')]);}_0x2318fe[_0xefb8('0x46')]=qs[_0xefb8('0x47')](_0x26be24[_0xefb8('0x3e')][_0xefb8('0x47')]);_0x2318fe[_0xefb8('0x48')]=qs['filters'](_['pick'](_0x26be24[_0xefb8('0x3e')],_0x1507a8[_0xefb8('0x3f')]));_0x2318fe[_0xefb8('0x48')][_0xefb8('0x62')]=_0x173b64['id'];if(_0x26be24['query'][_0xefb8('0x2c')]){_0x2318fe[_0xefb8('0x48')]=_[_0xefb8('0x4a')](_0x2318fe[_0xefb8('0x48')],{'$or':_[_0xefb8('0x3a')](_0x2318fe['attributes'],function(_0x4b737b){var _0x54a3fa={};_0x54a3fa[_0x4b737b]={'$like':'%'+_0x26be24[_0xefb8('0x3e')]['filter']+'%'};return _0x54a3fa;})});}_0x2318fe=_[_0xefb8('0x4a')]({},_0x2318fe,_0x26be24[_0xefb8('0x5c')]);return db[_0xefb8('0x69')][_0xefb8('0x4c')]({'where':_0x2318fe[_0xefb8('0x48')]})['then'](function(_0xced631){_0x1633f7['count']=_0xced631;if(_0x26be24['query'][_0xefb8('0x5a')]){_0x2318fe[_0xefb8('0x5b')]=[{'all':!![]}];}return db[_0xefb8('0x69')][_0xefb8('0x63')](_0x2318fe);})[_0xefb8('0x26')](function(_0x4a084b){_0x1633f7[_0xefb8('0x64')]=_0x4a084b;return _0x1633f7;});}})[_0xefb8('0x26')](respondWithFilteredResult(_0x309541,_0x2318fe))['catch'](handleError(_0x309541,null));};exports[_0xefb8('0x6a')]=function(_0x412ebc,_0x4e7a24,_0x5ee867){var _0x32a3d4={};var _0x28528c={};var _0x5c48b7;var _0x568c06;return db[_0xefb8('0x3b')][_0xefb8('0x60')]({'where':{'id':_0x412ebc[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x4e7a24,null))['then'](function(_0x26925a){if(_0x26925a){_0x5c48b7=_0x26925a;_0x28528c[_0xefb8('0x41')]=_[_0xefb8('0x3d')](db['Team'][_0xefb8('0x3c')]);_0x28528c[_0xefb8('0x3e')]=_['keys'](_0x412ebc['query']);_0x28528c[_0xefb8('0x3f')]=_['intersection'](_0x28528c['model'],_0x28528c[_0xefb8('0x3e')]);_0x32a3d4['attributes']=_[_0xefb8('0x40')](_0x28528c['model'],qs[_0xefb8('0x43')](_0x412ebc[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x32a3d4['attributes']=_0x32a3d4[_0xefb8('0x42')][_0xefb8('0x50')]?_0x32a3d4[_0xefb8('0x42')]:_0x28528c[_0xefb8('0x41')];_0x32a3d4[_0xefb8('0x46')]=qs['sort'](_0x412ebc[_0xefb8('0x3e')]['sort']);_0x32a3d4['where']=qs[_0xefb8('0x3f')](_[_0xefb8('0x49')](_0x412ebc[_0xefb8('0x3e')],_0x28528c['filters']));if(_0x412ebc[_0xefb8('0x3e')]['filter']){_0x32a3d4[_0xefb8('0x48')]=_['merge'](_0x32a3d4[_0xefb8('0x48')],{'$or':_[_0xefb8('0x3a')](_0x32a3d4['attributes'],function(_0x34b001){var _0x167f99={};_0x167f99[_0x34b001]={'$like':'%'+_0x412ebc[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0x167f99;})});}_0x32a3d4=_['merge']({},_0x32a3d4,_0x412ebc['options']);return _0x5c48b7['getTeams'](_0x32a3d4);}})[_0xefb8('0x26')](function(_0x5a1da9){if(_0x5a1da9){_0x568c06=_0x5a1da9['length'];if(!_0x412ebc[_0xefb8('0x3e')]['hasOwnProperty'](_0xefb8('0x45'))){_0x32a3d4[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0x412ebc[_0xefb8('0x3e')][_0xefb8('0x1e')]);_0x32a3d4[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x412ebc[_0xefb8('0x3e')][_0xefb8('0x1c')]);}return _0x5c48b7[_0xefb8('0x6a')](_0x32a3d4);}})[_0xefb8('0x26')](function(_0x169961){if(_0x169961){return _0x169961?{'count':_0x568c06,'rows':_0x169961}:null;}})[_0xefb8('0x26')](respondWithResult(_0x4e7a24,null))[_0xefb8('0x4d')](handleError(_0x4e7a24,null));};exports[_0xefb8('0x6b')]=function(_0x44431c,_0xabec55,_0x449258){var _0x3c4916=_0x44431c[_0xefb8('0x52')][_0xefb8('0x6c')];var _0x3735b2=_[_0xefb8('0x3a')](_0x3c4916,'id');return db[_0xefb8('0x6d')]['findAll']({'where':{'id':_0x3735b2},'attributes':['id'],'include':[{'model':db[_0xefb8('0x6e')],'as':_0xefb8('0x6f'),'attributes':['id','name',_0xefb8('0x70'),_0xefb8('0x71'),_0xefb8('0x72')],'raw':!![]}]})['then'](function(_0x8095a6){if(_0x8095a6){var _0x5b615a=_['flatMap'](_0x8095a6,function(_0x384840){var _0x2aa462=_0x384840[_0xefb8('0x27')]({'plain':!![]});_0x2aa462['Agents'][_0xefb8('0x73')](function(_0x463885){_0x463885[_0xefb8('0x74')]=_['find'](_0x3c4916,{'id':_0x2aa462['id']})['penalty'];});return _0x2aa462['Agents'];});return db['VoiceQueue'][_0xefb8('0x30')]({'where':{'id':_0x44431c[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](function(_0x4e2371){return db[_0xefb8('0x75')][_0xefb8('0x76')](function(_0x38385a){return _0x4e2371['addTeams'](_0x3735b2,{'transaction':_0x38385a})[_0xefb8('0x26')](function(){return BPromise['each'](_0x3c4916,function(_0x4c73fe){return db[_0xefb8('0x77')][_0xefb8('0x78')]({'TeamId':_0x4c73fe['id'],'VoiceQueueId':_0x44431c[_0xefb8('0x4f')]['id'],'penalty':_0x4c73fe[_0xefb8('0x74')]},{'transaction':_0x38385a});});})[_0xefb8('0x26')](function(){return BPromise['each'](_0x5b615a,function(_0x3e4946){return db[_0xefb8('0x79')]['findOrCreate']({'where':{'UserId':_0x3e4946['id'],'VoiceQueueId':_0x44431c[_0xefb8('0x4f')]['id']},'defaults':{'penalty':_0x3e4946['penalty']},'transaction':_0x38385a});});})[_0xefb8('0x26')](function(){return BPromise[_0xefb8('0x7a')](_['filter'](_0x5b615a,{'online':!![]}),function(_0x2d381d){return db[_0xefb8('0x7b')]['upsert']({'membername':_0x2d381d[_0xefb8('0x32')],'UserId':_0x2d381d['id'],'queue_name':_0x4e2371[_0xefb8('0x32')],'VoiceQueueId':_0x4e2371['id'],'interface':_[_0xefb8('0x7c')](_0x2d381d[_0xefb8('0x72')])?util[_0xefb8('0x7d')](_0xefb8('0x7e'),_0x2d381d['name']):_0x2d381d[_0xefb8('0x72')],'paused':_0x2d381d['voicePause']||![],'penalty':_0x2d381d[_0xefb8('0x74')]},{'transaction':_0x38385a});});})[_0xefb8('0x26')](function(){_0x5b615a[_0xefb8('0x73')](function(_0x162f6d){socket[_0xefb8('0x7f')](_0xefb8('0x80'),{'UserId':_0x162f6d['id'],'VoiceQueueId':_0x4e2371['id']});});});});});}})[_0xefb8('0x26')](respondWithStatusCode(_0xabec55,null))['catch'](handleError(_0xabec55,null));};exports[_0xefb8('0x81')]=function(_0x2a8437,_0x11d683,_0x21b443){return db['Team'][_0xefb8('0x63')]({'where':{'id':_0x2a8437[_0xefb8('0x3e')][_0xefb8('0x82')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xefb8('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xefb8('0x26')](handleEntityNotFound(_0x11d683,null))[_0xefb8('0x26')](function(_0x165790){var _0x412005=_['map'](_0x165790,'id');var _0x32b8e5=[];var _0x117ca4=[];var _0x523fcc=squel[_0xefb8('0x83')]();_0x523fcc['field'](_0xefb8('0x84'))[_0xefb8('0x85')](_0xefb8('0x86'),'tq')['join']('user_has_teams','ut',_0xefb8('0x87'))[_0xefb8('0x48')](_0xefb8('0x88'),_0x2a8437[_0xefb8('0x4f')]['id']);for(var _0x388bc8=0x0;_0x388bc8<_0x165790[_0xefb8('0x50')];_0x388bc8+=0x1){let _0x31ac32=_0x165790[_0x388bc8];for(var _0x2d8c46=0x0;_0x2d8c46<_0x31ac32[_0xefb8('0x6f')][_0xefb8('0x50')];_0x2d8c46+=0x1){let _0xfa9994=_0x31ac32['Agents'][_0x2d8c46];var _0x49d245=_0x523fcc['clone']();_0x49d245[_0xefb8('0x48')](_0xefb8('0x89'),_0xfa9994['id']);_0x117ca4[_0xefb8('0x8a')](db[_0xefb8('0x75')][_0xefb8('0x3e')](_0x49d245['toString'](),{'type':db[_0xefb8('0x75')][_0xefb8('0x8b')][_0xefb8('0x8c')]})[_0xefb8('0x26')](function(_0x352762){if(_0x352762[_0xefb8('0x50')]===0x1){return _0xfa9994['id'];}else{var _0x174abd=_[_0xefb8('0x8d')](_[_0xefb8('0x3a')](_0x352762,_0xefb8('0x8e')),function(_0x149010){return _[_0xefb8('0x2f')](_0x412005,_0x149010);});if(_0x174abd){return _0xfa9994['id'];}}}));}}return BPromise[_0xefb8('0x8f')](_0x117ca4)['then'](function(_0x2b7aaf){_0x32b8e5=_(_0x32b8e5)['union'](_0x2b7aaf)[_0xefb8('0x90')]()[_0xefb8('0x2e')]();return db[_0xefb8('0x3b')][_0xefb8('0x30')]({'where':{'id':_0x2a8437[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](function(_0x299bee){return db[_0xefb8('0x75')][_0xefb8('0x76')](function(_0x5f0222){return _0x299bee['removeTeams'](_0x2a8437[_0xefb8('0x3e')]['ids'],{'transaction':_0x5f0222})[_0xefb8('0x26')](function(){if(!_[_0xefb8('0x91')](_0x32b8e5)){return _0x299bee['removeAgents'](_0x32b8e5,{'transaction':_0x5f0222})[_0xefb8('0x26')](function(){return db['UserVoiceQueueRt'][_0xefb8('0x34')]({'where':{'VoiceQueueId':_0x2a8437[_0xefb8('0x4f')]['id'],'UserId':_0x32b8e5},'transaction':_0x5f0222});});}})[_0xefb8('0x26')](function(){_0x32b8e5[_0xefb8('0x73')](function(_0x543a14){socket[_0xefb8('0x7f')](_0xefb8('0x92'),{'UserId':_0x543a14,'VoiceQueueId':_0x299bee['id']});});});});});});})[_0xefb8('0x26')](respondWithStatusCode(_0x11d683,null))[_0xefb8('0x4d')](handleError(_0x11d683,null));};exports['addAgents']=function(_0x122660,_0xf2d5bd,_0x35c80e){var _0x1d160c,_0xf7d054;return db[_0xefb8('0x3b')][_0xefb8('0x30')]({'where':{'id':_0x122660[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0xf2d5bd,null))[_0xefb8('0x26')](function(_0x11b49a){if(_0x11b49a){_0xf7d054=_0x11b49a;return _0x11b49a[_0xefb8('0x93')](_0x122660[_0xefb8('0x52')][_0xefb8('0x82')],_[_0xefb8('0x94')](_0x122660['body'],['ids','id'])||{})['spread'](function(_0x18ce62){for(var _0x31af83=0x0;_0x31af83<_0x122660[_0xefb8('0x52')][_0xefb8('0x82')]['length'];_0x31af83+=0x1){socket[_0xefb8('0x7f')](_0xefb8('0x80'),{'UserId':Number(_0x122660[_0xefb8('0x52')][_0xefb8('0x82')][_0x31af83]),'VoiceQueueId':Number(_0x122660[_0xefb8('0x4f')]['id'])});}return _0x18ce62;});}})[_0xefb8('0x26')](function(_0x39b78c){_0x1d160c=_0x39b78c||[];if(_0xf7d054){return db['User'][_0xefb8('0x63')]({'where':{'id':_0x122660['body'][_0xefb8('0x82')]},'attributes':['id',_0xefb8('0x32'),_0xefb8('0x70'),_0xefb8('0x71'),'interface'],'raw':!![]});}})['then'](function(_0x3375da){if(!_[_0xefb8('0x91')](_0x3375da)){var _0x1dedfb=[];for(var _0x58d36a=0x0;_0x58d36a<_0x3375da[_0xefb8('0x50')];_0x58d36a++){if(_0x3375da[_0x58d36a][_0xefb8('0x70')]){_0x1dedfb[_0xefb8('0x8a')](db[_0xefb8('0x7b')][_0xefb8('0x78')]({'membername':_0x3375da[_0x58d36a][_0xefb8('0x32')],'UserId':_0x3375da[_0x58d36a]['id'],'queue_name':_0xf7d054[_0xefb8('0x32')],'VoiceQueueId':_0xf7d054['id'],'interface':_[_0xefb8('0x7c')](_0x3375da[_0x58d36a][_0xefb8('0x72')])?util[_0xefb8('0x7d')](_0xefb8('0x7e'),_0x3375da[_0x58d36a]['name']):_0x3375da[_0x58d36a]['interface'],'paused':_0x3375da[_0x58d36a][_0xefb8('0x71')]||![],'penalty':_0x122660[_0xefb8('0x52')][_0xefb8('0x74')]||0x0}));}}return BPromise[_0xefb8('0x8f')](_0x1dedfb);}})[_0xefb8('0x26')](function(){return _0x1d160c;})['then'](respondWithResult(_0xf2d5bd,null))[_0xefb8('0x4d')](handleError(_0xf2d5bd,null));};exports[_0xefb8('0x95')]=function(_0x585ea0,_0x3d1714,_0x144eb5){return db['VoiceQueue'][_0xefb8('0x30')]({'where':{'id':_0x585ea0[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3d1714,null))[_0xefb8('0x26')](function(_0x3dde83){if(_0x3dde83){return _0x3dde83[_0xefb8('0x95')](_0x585ea0[_0xefb8('0x3e')][_0xefb8('0x82')])['then'](function(){if(_[_0xefb8('0x96')](_0x585ea0[_0xefb8('0x3e')][_0xefb8('0x82')])){for(var _0x5e15ca=0x0;_0x5e15ca<_0x585ea0[_0xefb8('0x3e')]['ids']['length'];_0x5e15ca+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x585ea0['query']['ids'][_0x5e15ca]),'VoiceQueueId':Number(_0x585ea0['params']['id'])});}}else{socket[_0xefb8('0x7f')](_0xefb8('0x92'),{'UserId':Number(_0x585ea0['query'][_0xefb8('0x82')]),'VoiceQueueId':Number(_0x585ea0[_0xefb8('0x4f')]['id'])});}});}})[_0xefb8('0x26')](function(_0x1d6896){return db[_0xefb8('0x7b')][_0xefb8('0x34')]({'where':{'VoiceQueueId':_0x585ea0[_0xefb8('0x4f')]['id'],'UserId':_0x585ea0[_0xefb8('0x3e')]['ids']}})[_0xefb8('0x26')](function(){return _0x1d6896;});})[_0xefb8('0x26')](respondWithStatusCode(_0x3d1714,null))[_0xefb8('0x4d')](handleError(_0x3d1714,null));};exports[_0xefb8('0x97')]=function(_0x2c5898,_0x20a9f1,_0x379dd7){var _0x29303b={};var _0x3458fa={};var _0x449615;var _0x1612c8;return db['VoiceQueue'][_0xefb8('0x60')]({'where':{'id':_0x2c5898['params']['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x20a9f1,null))[_0xefb8('0x26')](function(_0x2833cc){if(_0x2833cc){_0x449615=_0x2833cc;_0x3458fa['model']=_[_0xefb8('0x3d')](db[_0xefb8('0x6e')][_0xefb8('0x3c')]);_0x3458fa['query']=_[_0xefb8('0x3d')](_0x2c5898[_0xefb8('0x3e')]);_0x3458fa[_0xefb8('0x3f')]=_[_0xefb8('0x40')](_0x3458fa[_0xefb8('0x41')],_0x3458fa['query']);_0x29303b['attributes']=_['intersection'](_0x3458fa[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x2c5898[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x29303b[_0xefb8('0x42')]=_0x29303b[_0xefb8('0x42')][_0xefb8('0x50')]?_0x29303b[_0xefb8('0x42')]:_0x3458fa[_0xefb8('0x41')];_0x29303b[_0xefb8('0x46')]=qs['sort'](_0x2c5898[_0xefb8('0x3e')][_0xefb8('0x47')]);_0x29303b[_0xefb8('0x48')]=qs[_0xefb8('0x3f')](_['pick'](_0x2c5898[_0xefb8('0x3e')],_0x3458fa[_0xefb8('0x3f')]));if(_0x2c5898[_0xefb8('0x3e')][_0xefb8('0x2c')]){_0x29303b[_0xefb8('0x48')]=_['merge'](_0x29303b['where'],{'$or':_[_0xefb8('0x3a')](_0x29303b['attributes'],function(_0x36e751){var _0x5a57f3={};_0x5a57f3[_0x36e751]={'$like':'%'+_0x2c5898[_0xefb8('0x3e')]['filter']+'%'};return _0x5a57f3;})});}_0x29303b=_[_0xefb8('0x4a')]({},_0x29303b,_0x2c5898[_0xefb8('0x5c')]);return _0x449615[_0xefb8('0x97')](_0x29303b);}})[_0xefb8('0x26')](function(_0x307d32){if(_0x307d32){_0x1612c8=_0x307d32[_0xefb8('0x50')];if(!_0x2c5898['query']['hasOwnProperty'](_0xefb8('0x45'))){_0x29303b['limit']=qs[_0xefb8('0x1e')](_0x2c5898[_0xefb8('0x3e')][_0xefb8('0x1e')]);_0x29303b[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x2c5898['query'][_0xefb8('0x1c')]);}return _0x449615[_0xefb8('0x97')](_0x29303b);}})[_0xefb8('0x26')](function(_0x4ef36c){if(_0x4ef36c){return _0x4ef36c?{'count':_0x1612c8,'rows':_0x4ef36c}:null;}})[_0xefb8('0x26')](respondWithResult(_0x20a9f1,null))[_0xefb8('0x4d')](handleError(_0x20a9f1,null));};exports['getMembers']=function(_0x3ea921,_0x3a98e1,_0x392ada){var _0x575de5={};var _0xb45b64={};var _0x57c38b;var _0x53d1d0;return db[_0xefb8('0x3b')][_0xefb8('0x60')]({'where':{'id':_0x3ea921['params']['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x3a98e1,null))['then'](function(_0x372127){if(_0x372127){_0x57c38b=_0x372127;_0xb45b64[_0xefb8('0x41')]=_[_0xefb8('0x3d')](db['UserVoiceQueueRt'][_0xefb8('0x3c')]);_0xb45b64[_0xefb8('0x3e')]=_[_0xefb8('0x3d')](_0x3ea921[_0xefb8('0x3e')]);_0xb45b64[_0xefb8('0x3f')]=_['intersection'](_0xb45b64[_0xefb8('0x41')],_0xb45b64[_0xefb8('0x3e')]);_0x575de5['attributes']=_[_0xefb8('0x40')](_0xb45b64[_0xefb8('0x41')],qs['fields'](_0x3ea921[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x575de5['attributes']=_0x575de5[_0xefb8('0x42')]['length']?_0x575de5[_0xefb8('0x42')]:_0xb45b64[_0xefb8('0x41')];_0x575de5['order']=qs[_0xefb8('0x47')](_0x3ea921['query'][_0xefb8('0x47')]);_0x575de5[_0xefb8('0x48')]=qs[_0xefb8('0x3f')](_[_0xefb8('0x49')](_0x3ea921[_0xefb8('0x3e')],_0xb45b64[_0xefb8('0x3f')]));if(_0x3ea921[_0xefb8('0x3e')][_0xefb8('0x2c')]){_0x575de5['where']=_['merge'](_0x575de5[_0xefb8('0x48')],{'$or':_[_0xefb8('0x3a')](_0x575de5[_0xefb8('0x42')],function(_0x2c3cab){var _0x5a81cf={};_0x5a81cf[_0x2c3cab]={'$like':'%'+_0x3ea921[_0xefb8('0x3e')]['filter']+'%'};return _0x5a81cf;})});}_0x575de5=_['merge']({},_0x575de5,_0x3ea921[_0xefb8('0x5c')]);return _0x57c38b[_0xefb8('0x98')](_0x575de5);}})[_0xefb8('0x26')](function(_0x1bdb4a){if(_0x1bdb4a){_0x53d1d0=_0x1bdb4a[_0xefb8('0x50')];if(!_0x3ea921['query'][_0xefb8('0x44')](_0xefb8('0x45'))){_0x575de5[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0x3ea921['query']['limit']);_0x575de5[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x3ea921[_0xefb8('0x3e')][_0xefb8('0x1c')]);}return _0x57c38b[_0xefb8('0x98')](_0x575de5);}})[_0xefb8('0x26')](function(_0x1f756c){return _0x1f756c?{'count':_0x53d1d0,'rows':_0x1f756c}:null;})['then'](respondWithResult(_0x3a98e1,null))[_0xefb8('0x4d')](handleError(_0x3a98e1,null));};exports[_0xefb8('0x99')]=function(_0x435f26,_0x366913,_0x52147b){var _0x3acd08={};var _0x52bdec={};var _0x352634;var _0x43c2f4;return db[_0xefb8('0x3b')][_0xefb8('0x60')]({'where':{'id':_0x435f26[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x366913,null))[_0xefb8('0x26')](function(_0x29957f){if(_0x29957f){_0x352634=_0x29957f;_0x52bdec['model']=_['keys'](db[_0xefb8('0x9a')][_0xefb8('0x3c')]);_0x52bdec[_0xefb8('0x3e')]=_[_0xefb8('0x3d')](_0x435f26[_0xefb8('0x3e')]);_0x52bdec[_0xefb8('0x3f')]=_[_0xefb8('0x40')](_0x52bdec[_0xefb8('0x41')],_0x52bdec[_0xefb8('0x3e')]);_0x3acd08[_0xefb8('0x42')]=_[_0xefb8('0x40')](_0x52bdec[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x435f26[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x3acd08[_0xefb8('0x42')]=_0x3acd08[_0xefb8('0x42')]['length']?_0x3acd08['attributes']:_0x52bdec[_0xefb8('0x41')];_0x3acd08['order']=qs['sort'](_0x435f26[_0xefb8('0x3e')][_0xefb8('0x47')]);_0x3acd08['where']=qs[_0xefb8('0x3f')](_[_0xefb8('0x49')](_0x435f26[_0xefb8('0x3e')],_0x52bdec[_0xefb8('0x3f')]));if(_0x435f26['query'][_0xefb8('0x2c')]){_0x3acd08['where']=_[_0xefb8('0x4a')](_0x3acd08['where'],{'$or':_['map'](_0x3acd08[_0xefb8('0x42')],function(_0x397be0){var _0x1d7705={};_0x1d7705[_0x397be0]={'$like':'%'+_0x435f26[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0x1d7705;})});}_0x3acd08=_[_0xefb8('0x4a')]({},_0x3acd08,_0x435f26[_0xefb8('0x5c')]);return _0x352634['getLists'](_0x3acd08);}})['then'](function(_0xa232f1){if(_0xa232f1){_0x43c2f4=_0xa232f1[_0xefb8('0x50')];if(!_0x435f26[_0xefb8('0x3e')][_0xefb8('0x44')](_0xefb8('0x45'))){_0x3acd08[_0xefb8('0x1e')]=qs[_0xefb8('0x1e')](_0x435f26['query']['limit']);_0x3acd08[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x435f26['query'][_0xefb8('0x1c')]);}return _0x352634[_0xefb8('0x99')](_0x3acd08);}})[_0xefb8('0x26')](function(_0x584b1e){if(_0x584b1e){return _0x584b1e?{'count':_0x43c2f4,'rows':_0x584b1e}:null;}})[_0xefb8('0x26')](respondWithResult(_0x366913,null))['catch'](handleError(_0x366913,null));};exports[_0xefb8('0x9b')]=function(_0x36ec6e,_0x132017,_0x58b217){var _0x2cfe53,_0x5a571b;return db[_0xefb8('0x3b')][_0xefb8('0x30')]({'where':{'id':_0x36ec6e[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x132017,null))['then'](function(_0x223cd1){if(_0x223cd1){_0x5a571b=_0x223cd1;return _0x223cd1['addLists'](_0x36ec6e[_0xefb8('0x52')]['ids'],_[_0xefb8('0x94')](_0x36ec6e[_0xefb8('0x52')],[_0xefb8('0x82'),'id'])||{});}return null;})['spread'](function(_0x1e8cf6){var _0x27ac1d;_0x2cfe53=_0x1e8cf6||[];var _0x3b6b1b=[];if(_0x1e8cf6){for(var _0x28e37f=0x0;_0x28e37f<_0x1e8cf6[_0xefb8('0x50')];_0x28e37f+=0x1){var _0x310bc5=_0x1e8cf6[_0x28e37f][_0xefb8('0x27')]({'plain':!![]});_0x5a571b['dialCheckDuplicateType']=_0x36ec6e[_0xefb8('0x52')][_0xefb8('0x9c')]?_0x36ec6e[_0xefb8('0x52')][_0xefb8('0x9c')]:_0x5a571b[_0xefb8('0x9c')];switch(_0x5a571b['dialCheckDuplicateType']){case _0xefb8('0x9d'):_0x27ac1d=squel[_0xefb8('0x9e')]()[_0xefb8('0x9f')](_0xefb8('0xa0'))[_0xefb8('0xa1')]([_0xefb8('0xa2'),_0xefb8('0xa3'),_0xefb8('0xa4'),'ListId',_0xefb8('0x62'),'createdAt',_0xefb8('0x5e')],squel[_0xefb8('0x83')]()['field'](_0xefb8('0xa2'),_0xefb8('0xa2'))[_0xefb8('0xa5')](_0xefb8('0xa6'),'scheduledAt')[_0xefb8('0xa5')]('id',_0xefb8('0xa4'))[_0xefb8('0xa5')](_0x310bc5[_0xefb8('0xa7')]['toString'](),_0xefb8('0xa8'))[_0xefb8('0xa5')](_0x36ec6e[_0xefb8('0x4f')]['id']['toString'](),'VoiceQueueId')['field'](_0xefb8('0xa6'),_0xefb8('0x5d'))[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0x5e'))[_0xefb8('0x85')]('cm_contacts')[_0xefb8('0x48')](_0xefb8('0xa9'))[_0xefb8('0x48')]('ListId\x20=\x20?',_0x310bc5[_0xefb8('0xa7')][_0xefb8('0xaa')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xefb8('0x48')](_0xefb8('0xab'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0xefb8('0x85')](_0xefb8('0xac'))[_0xefb8('0x48')](_0xefb8('0x88'),_0x36ec6e['params']['id'][_0xefb8('0xaa')]()))[_0xefb8('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0xefb8('0x83')]()['field'](_0xefb8('0xad'))[_0xefb8('0x85')](_0xefb8('0xa0'))[_0xefb8('0x48')](_0xefb8('0x88'),_0x36ec6e[_0xefb8('0x4f')]['id'][_0xefb8('0xaa')]())))[_0xefb8('0xaa')]();break;case _0xefb8('0xae'):_0x27ac1d=squel[_0xefb8('0x9e')]()[_0xefb8('0x9f')](_0xefb8('0xa0'))['fromQuery']([_0xefb8('0xa2'),'scheduledAt','ContactId',_0xefb8('0xa8'),_0xefb8('0x62'),'createdAt',_0xefb8('0x5e')],squel[_0xefb8('0x83')]()['field']('phone',_0xefb8('0xa2'))[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0xa3'))[_0xefb8('0xa5')]('id',_0xefb8('0xa4'))[_0xefb8('0xa5')](_0x310bc5['CmListId']['toString'](),'ListId')[_0xefb8('0xa5')](_0x36ec6e[_0xefb8('0x4f')]['id'][_0xefb8('0xaa')](),'VoiceQueueId')[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0x5d'))[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0x5e'))['from']('cm_contacts')[_0xefb8('0x48')](_0xefb8('0xa9'))[_0xefb8('0x48')]('ListId\x20=\x20?',_0x310bc5[_0xefb8('0xa7')][_0xefb8('0xaa')]())['where'](_0xefb8('0xaf'))[_0xefb8('0x48')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xefb8('0xad'))[_0xefb8('0x85')]('cm_hopper')[_0xefb8('0x48')]('VoiceQueueId\x20=\x20?',_0x36ec6e[_0xefb8('0x4f')]['id'][_0xefb8('0xaa')]())))[_0xefb8('0xaa')]();break;default:_0x27ac1d=squel[_0xefb8('0x9e')]()[_0xefb8('0x9f')](_0xefb8('0xa0'))[_0xefb8('0xa1')](['phone',_0xefb8('0xa3'),_0xefb8('0xa4'),_0xefb8('0xa8'),'VoiceQueueId',_0xefb8('0x5d'),_0xefb8('0x5e')],squel['select']()[_0xefb8('0xa5')](_0xefb8('0xa2'),_0xefb8('0xa2'))[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0xa3'))['field']('id',_0xefb8('0xa4'))['field'](_0x310bc5[_0xefb8('0xa7')][_0xefb8('0xaa')](),_0xefb8('0xa8'))[_0xefb8('0xa5')](_0x36ec6e[_0xefb8('0x4f')]['id'][_0xefb8('0xaa')](),'VoiceQueueId')[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0x5d'))[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0x5e'))[_0xefb8('0x85')](_0xefb8('0xb0'))[_0xefb8('0x48')](_0xefb8('0xa9'))[_0xefb8('0x48')](_0xefb8('0xb1'),_0x310bc5['CmListId']['toString']())[_0xefb8('0x48')](_0xefb8('0xaf')))[_0xefb8('0xaa')]();}_0x3b6b1b[_0xefb8('0x8a')](db['sequelize'][_0xefb8('0x3e')](_0x27ac1d));}return BPromise['all'](_0x3b6b1b);}})[_0xefb8('0x26')](function(){return _0x2cfe53;})[_0xefb8('0x26')](respondWithResult(_0x132017,null))['catch'](handleError(_0x132017,null));};exports[_0xefb8('0xb2')]=function(_0x41da77,_0x3cada9,_0x54fad7){return db[_0xefb8('0x3b')]['find']({'where':{'id':_0x41da77['params']['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x3cada9,null))[_0xefb8('0x26')](function(_0x55b863){if(_0x55b863){return _0x55b863[_0xefb8('0xb2')](_0x41da77[_0xefb8('0x3e')][_0xefb8('0x82')]);}})[_0xefb8('0x26')](function(_0x5582a6){if(_0x5582a6){return db[_0xefb8('0x61')][_0xefb8('0x34')]({'where':{'ListId':_0x41da77[_0xefb8('0x3e')][_0xefb8('0x82')],'VoiceQueueId':_0x41da77['params']['id']}})[_0xefb8('0x26')](function(){return _0x5582a6;});}})[_0xefb8('0x26')](respondWithStatusCode(_0x3cada9,null))['catch'](handleError(_0x3cada9,null));};exports[_0xefb8('0xb3')]=function(_0x40f3e8,_0x4b5883,_0x5d3470){var _0x25dd92={};var _0x140e3a={};var _0x362f95;var _0x1f639d;return db[_0xefb8('0x3b')][_0xefb8('0x60')]({'where':{'id':_0x40f3e8['params']['id']}})['then'](handleEntityNotFound(_0x4b5883,null))[_0xefb8('0x26')](function(_0x4534d7){if(_0x4534d7){_0x362f95=_0x4534d7;_0x140e3a[_0xefb8('0x41')]=_['keys'](db[_0xefb8('0x9a')]['rawAttributes']);_0x140e3a[_0xefb8('0x3e')]=_['keys'](_0x40f3e8['query']);_0x140e3a[_0xefb8('0x3f')]=_[_0xefb8('0x40')](_0x140e3a[_0xefb8('0x41')],_0x140e3a[_0xefb8('0x3e')]);_0x25dd92[_0xefb8('0x42')]=_[_0xefb8('0x40')](_0x140e3a[_0xefb8('0x41')],qs[_0xefb8('0x43')](_0x40f3e8[_0xefb8('0x3e')][_0xefb8('0x43')]));_0x25dd92[_0xefb8('0x42')]=_0x25dd92[_0xefb8('0x42')][_0xefb8('0x50')]?_0x25dd92[_0xefb8('0x42')]:_0x140e3a[_0xefb8('0x41')];_0x25dd92[_0xefb8('0x46')]=qs[_0xefb8('0x47')](_0x40f3e8['query']['sort']);_0x25dd92[_0xefb8('0x48')]=qs[_0xefb8('0x3f')](_[_0xefb8('0x49')](_0x40f3e8[_0xefb8('0x3e')],_0x140e3a['filters']));if(_0x40f3e8[_0xefb8('0x3e')]['filter']){_0x25dd92[_0xefb8('0x48')]=_['merge'](_0x25dd92[_0xefb8('0x48')],{'$or':_[_0xefb8('0x3a')](_0x25dd92[_0xefb8('0x42')],function(_0x4ff0f3){var _0x27a3d3={};_0x27a3d3[_0x4ff0f3]={'$like':'%'+_0x40f3e8[_0xefb8('0x3e')][_0xefb8('0x2c')]+'%'};return _0x27a3d3;})});}_0x25dd92=_[_0xefb8('0x4a')]({},_0x25dd92,_0x40f3e8[_0xefb8('0x5c')]);return _0x362f95[_0xefb8('0xb3')](_0x25dd92);}})[_0xefb8('0x26')](function(_0x21d77f){if(_0x21d77f){_0x1f639d=_0x21d77f['length'];if(!_0x40f3e8[_0xefb8('0x3e')]['hasOwnProperty'](_0xefb8('0x45'))){_0x25dd92['limit']=qs['limit'](_0x40f3e8['query']['limit']);_0x25dd92[_0xefb8('0x1c')]=qs[_0xefb8('0x1c')](_0x40f3e8[_0xefb8('0x3e')][_0xefb8('0x1c')]);}return _0x362f95['getBlackLists'](_0x25dd92);}})[_0xefb8('0x26')](function(_0x5b42ee){if(_0x5b42ee){return _0x5b42ee?{'count':_0x1f639d,'rows':_0x5b42ee}:null;}})[_0xefb8('0x26')](respondWithResult(_0x4b5883,null))[_0xefb8('0x4d')](handleError(_0x4b5883,null));};exports[_0xefb8('0xb4')]=function(_0x32f2a6,_0x78ed39,_0x470af0){var _0xbc94f5,_0x12a150;return db[_0xefb8('0x3b')][_0xefb8('0x30')]({'where':{'id':_0x32f2a6[_0xefb8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x78ed39,null))[_0xefb8('0x26')](function(_0x1b87d9){if(_0x1b87d9){_0x12a150=_0x1b87d9;return _0x1b87d9['addBlackLists'](_0x32f2a6[_0xefb8('0x52')]['ids'],_[_0xefb8('0x94')](_0x32f2a6[_0xefb8('0x52')],[_0xefb8('0x82'),'id'])||{});}return null;})['spread'](function(_0x2043dc){var _0x156e0e;_0xbc94f5=_0x2043dc||[];var _0x327772=[];if(_0x2043dc){for(var _0x227eb7=0x0;_0x227eb7<_0x2043dc[_0xefb8('0x50')];_0x227eb7+=0x1){var _0x189047=_0x2043dc[_0x227eb7]['get']({'plain':!![]});_0x156e0e=squel[_0xefb8('0x9e')]()[_0xefb8('0x9f')]('cm_hopper_black')['fromQuery']([_0xefb8('0xa2'),'ContactId',_0xefb8('0xa8'),_0xefb8('0x62'),_0xefb8('0x5d'),'updatedAt'],squel[_0xefb8('0x83')]()[_0xefb8('0xa5')](_0xefb8('0xa2'),_0xefb8('0xa2'))['field']('id',_0xefb8('0xa4'))['field'](_0x189047[_0xefb8('0xa7')][_0xefb8('0xaa')](),_0xefb8('0xa8'))[_0xefb8('0xa5')](_0x32f2a6[_0xefb8('0x4f')]['id'][_0xefb8('0xaa')](),_0xefb8('0x62'))[_0xefb8('0xa5')](_0xefb8('0xa6'),_0xefb8('0x5d'))['field'](_0xefb8('0xa6'),'updatedAt')[_0xefb8('0x85')]('cm_contacts')[_0xefb8('0x48')](_0xefb8('0xa9'))['where'](_0xefb8('0xb1'),_0x189047[_0xefb8('0xa7')][_0xefb8('0xaa')]())[_0xefb8('0x48')](_0xefb8('0xaf')))[_0xefb8('0xaa')]();_0x327772[_0xefb8('0x8a')](db['sequelize'][_0xefb8('0x3e')](_0x156e0e));}return BPromise[_0xefb8('0x8f')](_0x327772);}})[_0xefb8('0x26')](function(){return _0xbc94f5;})[_0xefb8('0x26')](respondWithResult(_0x78ed39,null))[_0xefb8('0x4d')](handleError(_0x78ed39,null));};exports[_0xefb8('0xb5')]=function(_0x324392,_0x5925f4,_0x1a987b){return db[_0xefb8('0x3b')][_0xefb8('0x30')]({'where':{'id':_0x324392[_0xefb8('0x4f')]['id']}})[_0xefb8('0x26')](handleEntityNotFound(_0x5925f4,null))[_0xefb8('0x26')](function(_0x31a516){if(_0x31a516){return _0x31a516[_0xefb8('0xb5')](_0x324392['query'][_0xefb8('0x82')]);}})[_0xefb8('0x26')](function(_0x501c9e){if(_0x501c9e){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x324392[_0xefb8('0x3e')]['ids'],'VoiceQueueId':_0x324392['params']['id']}})[_0xefb8('0x26')](function(){return _0x501c9e;});}})[_0xefb8('0x26')](respondWithStatusCode(_0x5925f4,null))[_0xefb8('0x4d')](handleError(_0x5925f4,null));};
\ No newline at end of file
index 5f20132..a4f0f3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8b0=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0xb8b0,0x123));var _0x0b8b=function(_0x16c467,_0x53d6fa){_0x16c467=_0x16c467-0x0;var _0x22db4f=_0xb8b0[_0x16c467];return _0x22db4f;};'use strict';var EventEmitter=require(_0x0b8b('0x0'));var VoiceQueue=require(_0x0b8b('0x1'))['db'][_0x0b8b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0b8b('0x3')](0x0);var events={'afterCreate':_0x0b8b('0x4'),'afterUpdate':_0x0b8b('0x5'),'afterDestroy':_0x0b8b('0x6')};function emitEvent(_0x49c021){return function(_0x22ca46,_0x30576a,_0x43eac5){VoiceQueueEvents[_0x0b8b('0x7')](_0x49c021+':'+_0x22ca46['id'],_0x22ca46);VoiceQueueEvents[_0x0b8b('0x7')](_0x49c021,_0x22ca46);_0x43eac5(null);};}for(var e in events){if(events[_0x0b8b('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x0b8b('0x9')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x9f56=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x6465b0,_0x45653a){var _0x4884fe=function(_0x427085){while(--_0x427085){_0x6465b0['push'](_0x6465b0['shift']());}};_0x4884fe(++_0x45653a);}(_0x9f56,0x96));var _0x69f5=function(_0x57d13b,_0x52d8cb){_0x57d13b=_0x57d13b-0x0;var _0x467696=_0x9f56[_0x57d13b];return _0x467696;};'use strict';var EventEmitter=require(_0x69f5('0x0'));var VoiceQueue=require(_0x69f5('0x1'))['db'][_0x69f5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x69f5('0x3')](0x0);var events={'afterCreate':_0x69f5('0x4'),'afterUpdate':_0x69f5('0x5'),'afterDestroy':_0x69f5('0x6')};function emitEvent(_0x1d45f0){return function(_0x3f6d0b,_0x3bd0ee,_0x55687c){VoiceQueueEvents[_0x69f5('0x7')](_0x1d45f0+':'+_0x3f6d0b['id'],_0x3f6d0b);VoiceQueueEvents[_0x69f5('0x7')](_0x1d45f0,_0x3f6d0b);_0x55687c(null);};}for(var e in events){if(events[_0x69f5('0x8')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x69f5('0x9')]=VoiceQueueEvents;
\ No newline at end of file
index ef1274c..9a23f12 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','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x25425c,_0xfb75cf){var _0x50d5fe=function(_0x4c520a){while(--_0x4c520a){_0x25425c['push'](_0x25425c['shift']());}};_0x50d5fe(++_0xfb75cf);}(_0xedd9,0xfc));var _0x9edd=function(_0xfafd3f,_0x32cae3){_0xfafd3f=_0xfafd3f-0x0;var _0x52e0f4=_0xedd9[_0xfafd3f];return _0x52e0f4;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x55a76a,_0x2d0203){var _0x45885a=function(_0x4348d5){while(--_0x4348d5){_0x55a76a['push'](_0x55a76a['shift']());}};_0x45885a(++_0x2d0203);}(_0x008c,0x188));var _0xc008=function(_0x4c4136,_0x1e74ae){_0x4c4136=_0x4c4136-0x0;var _0x11fa28=_0x008c[_0x4c4136];return _0x11fa28;};'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
index 8e0d50b..85a2a44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8112=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','findAll','options','raw','include','model','map','attributes','find','ShowVoiceQueue','lodash','util','bluebird'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x8112,0x1eb));var _0x2811=function(_0x45c981,_0x2ad2d4){_0x45c981=_0x45c981-0x0;var _0x4f62c8=_0x8112[_0x45c981];return _0x4f62c8;};'use strict';var _=require(_0x2811('0x0'));var util=require(_0x2811('0x1'));var moment=require('moment');var BPromise=require(_0x2811('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2811('0x3'));var db=require(_0x2811('0x4'))['db'];var utils=require(_0x2811('0x5'));var logger=require(_0x2811('0x6'))(_0x2811('0x7'));var config=require(_0x2811('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2811('0x9')][_0x2811('0xa')]({'port':0x232a});config[_0x2811('0xb')]=_[_0x2811('0xc')](config[_0x2811('0xb')],{'host':_0x2811('0xd'),'port':0x18eb});var socket=require(_0x2811('0xe'))(new Redis(config[_0x2811('0xb')]));require('./voiceQueue.socket')[_0x2811('0xf')](socket);function respondWithRpcPromise(_0x28b2cd,_0x2f6bfd,_0x56832d){return new BPromise(function(_0x1a4b28,_0x3ff446){return client[_0x2811('0x10')](_0x28b2cd,_0x56832d)[_0x2811('0x11')](function(_0x588128){logger[_0x2811('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x2f6bfd,_0x2811('0x13'));logger[_0x2811('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x2f6bfd,_0x2811('0x13'),JSON[_0x2811('0x15')](_0x588128));if(_0x588128[_0x2811('0x16')]){if(_0x588128[_0x2811('0x16')][_0x2811('0x17')]===0x1f4){logger[_0x2811('0x16')](_0x2811('0x18'),_0x2f6bfd,_0x588128[_0x2811('0x16')][_0x2811('0x19')]);return _0x3ff446(_0x588128[_0x2811('0x16')][_0x2811('0x19')]);}logger[_0x2811('0x16')](_0x2811('0x18'),_0x2f6bfd,_0x588128[_0x2811('0x16')][_0x2811('0x19')]);return _0x1a4b28(_0x588128['error']['message']);}else{logger[_0x2811('0x12')](_0x2811('0x18'),_0x2f6bfd,_0x2811('0x13'));_0x1a4b28(_0x588128[_0x2811('0x1a')][_0x2811('0x19')]);}})[_0x2811('0x1b')](function(_0x5cede9){logger['error'](_0x2811('0x18'),_0x2f6bfd,_0x5cede9);_0x3ff446(_0x5cede9);});});}exports[_0x2811('0x1c')]=function(_0xc1ea42){var _0x57a5f8=this;return new Promise(function(_0x2425a7,_0x2e4307){return db['VoiceQueue'][_0x2811('0x1d')]({'raw':_0xc1ea42[_0x2811('0x1e')]?_0xc1ea42[_0x2811('0x1e')][_0x2811('0x1f')]===undefined?!![]:![]:!![],'where':_0xc1ea42[_0x2811('0x1e')]?_0xc1ea42[_0x2811('0x1e')]['where']||null:null,'attributes':_0xc1ea42[_0x2811('0x1e')]?_0xc1ea42[_0x2811('0x1e')]['attributes']||null:null,'limit':_0xc1ea42[_0x2811('0x1e')]?_0xc1ea42[_0x2811('0x1e')]['limit']||null:null,'include':_0xc1ea42[_0x2811('0x1e')]?_0xc1ea42[_0x2811('0x1e')][_0x2811('0x20')]?_['map'](_0xc1ea42[_0x2811('0x1e')]['include'],function(_0xdc0b49){return{'model':db[_0xdc0b49[_0x2811('0x21')]],'as':_0xdc0b49['as'],'attributes':_0xdc0b49['attributes'],'include':_0xdc0b49[_0x2811('0x20')]?_[_0x2811('0x22')](_0xdc0b49['include'],function(_0x5df29b){return{'model':db[_0x5df29b[_0x2811('0x21')]],'as':_0x5df29b['as'],'attributes':_0x5df29b['attributes'],'include':_0x5df29b[_0x2811('0x20')]?_[_0x2811('0x22')](_0x5df29b[_0x2811('0x20')],function(_0x3669e5){return{'model':db[_0x3669e5[_0x2811('0x21')]],'as':_0x3669e5['as'],'attributes':_0x3669e5[_0x2811('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2811('0x11')](function(_0x343cf1){logger[_0x2811('0x12')](_0x2811('0x1c'),_0xc1ea42);logger[_0x2811('0x14')]('GetVoiceQueue',_0xc1ea42,JSON[_0x2811('0x15')](_0x343cf1));_0x2425a7(_0x343cf1);})[_0x2811('0x1b')](function(_0x37d1ee){logger[_0x2811('0x16')](_0x2811('0x1c'),_0x37d1ee['message'],_0xc1ea42);_0x2e4307(_0x57a5f8['error'](0x1f4,_0x37d1ee[_0x2811('0x19')]));});});};exports['ShowVoiceQueue']=function(_0x1dfb8d){var _0x3ac1c7=this;return new Promise(function(_0x527503,_0x42fd60){return db['VoiceQueue'][_0x2811('0x24')]({'raw':_0x1dfb8d[_0x2811('0x1e')]?_0x1dfb8d[_0x2811('0x1e')][_0x2811('0x1f')]===undefined?!![]:![]:!![],'where':_0x1dfb8d[_0x2811('0x1e')]?_0x1dfb8d[_0x2811('0x1e')]['where']||null:null,'attributes':_0x1dfb8d[_0x2811('0x1e')]?_0x1dfb8d[_0x2811('0x1e')][_0x2811('0x23')]||null:null,'include':_0x1dfb8d[_0x2811('0x1e')]?_0x1dfb8d[_0x2811('0x1e')][_0x2811('0x20')]?_[_0x2811('0x22')](_0x1dfb8d[_0x2811('0x1e')][_0x2811('0x20')],function(_0x4671dc){return{'model':db[_0x4671dc[_0x2811('0x21')]],'as':_0x4671dc['as'],'attributes':_0x4671dc[_0x2811('0x23')],'include':_0x4671dc[_0x2811('0x20')]?_[_0x2811('0x22')](_0x4671dc[_0x2811('0x20')],function(_0x481d74){return{'model':db[_0x481d74['model']],'as':_0x481d74['as'],'attributes':_0x481d74['attributes'],'include':_0x481d74['include']?_[_0x2811('0x22')](_0x481d74[_0x2811('0x20')],function(_0x3695e2){return{'model':db[_0x3695e2['model']],'as':_0x3695e2['as'],'attributes':_0x3695e2[_0x2811('0x23')]};}):[]};}):[]};}):[]:[]})[_0x2811('0x11')](function(_0x4e6b11){logger[_0x2811('0x12')](_0x2811('0x25'),_0x1dfb8d);logger['debug']('ShowVoiceQueue',_0x1dfb8d,JSON[_0x2811('0x15')](_0x4e6b11));_0x527503(_0x4e6b11);})[_0x2811('0x1b')](function(_0x15ebca){logger[_0x2811('0x16')](_0x2811('0x25'),_0x15ebca[_0x2811('0x19')],_0x1dfb8d);_0x42fd60(_0x3ac1c7[_0x2811('0x16')](0x1f4,_0x15ebca[_0x2811('0x19')]));});});};
\ No newline at end of file
+var _0x4b66=['model','then','GetVoiceQueue','ShowVoiceQueue','where','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceQueue','findAll','options','raw','attributes','include','map'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x4b66,0xe4));var _0x64b6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4b66[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x64b6('0x0'));var util=require('util');var moment=require(_0x64b6('0x1'));var BPromise=require(_0x64b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64b6('0x3'));var db=require(_0x64b6('0x4'))['db'];var utils=require(_0x64b6('0x5'));var logger=require('../../config/logger')(_0x64b6('0x6'));var config=require(_0x64b6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x64b6('0x8')][_0x64b6('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x64b6('0xa')],{'host':_0x64b6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64b6('0xa')]));require(_0x64b6('0xc'))[_0x64b6('0xd')](socket);function respondWithRpcPromise(_0x58b2b7,_0x53b446,_0x442b5b){return new BPromise(function(_0x3d3017,_0x2cb44c){return client[_0x64b6('0xe')](_0x58b2b7,_0x442b5b)['then'](function(_0x5aa9df){logger[_0x64b6('0xf')](_0x64b6('0x10'),_0x53b446,_0x64b6('0x11'));logger['debug'](_0x64b6('0x12'),_0x53b446,_0x64b6('0x11'),JSON[_0x64b6('0x13')](_0x5aa9df));if(_0x5aa9df['error']){if(_0x5aa9df[_0x64b6('0x14')]['code']===0x1f4){logger[_0x64b6('0x14')](_0x64b6('0x10'),_0x53b446,_0x5aa9df[_0x64b6('0x14')][_0x64b6('0x15')]);return _0x2cb44c(_0x5aa9df[_0x64b6('0x14')][_0x64b6('0x15')]);}logger[_0x64b6('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x53b446,_0x5aa9df[_0x64b6('0x14')][_0x64b6('0x15')]);return _0x3d3017(_0x5aa9df[_0x64b6('0x14')][_0x64b6('0x15')]);}else{logger[_0x64b6('0xf')](_0x64b6('0x10'),_0x53b446,_0x64b6('0x11'));_0x3d3017(_0x5aa9df[_0x64b6('0x16')][_0x64b6('0x15')]);}})[_0x64b6('0x17')](function(_0x92a7ef){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x53b446,_0x92a7ef);_0x2cb44c(_0x92a7ef);});});}exports['GetVoiceQueue']=function(_0x3fa808){var _0x41dd3d=this;return new Promise(function(_0x379c4a,_0x14bc5e){return db[_0x64b6('0x18')][_0x64b6('0x19')]({'raw':_0x3fa808[_0x64b6('0x1a')]?_0x3fa808[_0x64b6('0x1a')][_0x64b6('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fa808[_0x64b6('0x1a')]?_0x3fa808[_0x64b6('0x1a')]['where']||null:null,'attributes':_0x3fa808['options']?_0x3fa808['options'][_0x64b6('0x1c')]||null:null,'limit':_0x3fa808[_0x64b6('0x1a')]?_0x3fa808[_0x64b6('0x1a')]['limit']||null:null,'include':_0x3fa808[_0x64b6('0x1a')]?_0x3fa808['options'][_0x64b6('0x1d')]?_[_0x64b6('0x1e')](_0x3fa808[_0x64b6('0x1a')]['include'],function(_0x548b74){return{'model':db[_0x548b74['model']],'as':_0x548b74['as'],'attributes':_0x548b74['attributes'],'include':_0x548b74[_0x64b6('0x1d')]?_[_0x64b6('0x1e')](_0x548b74['include'],function(_0x1526d7){return{'model':db[_0x1526d7[_0x64b6('0x1f')]],'as':_0x1526d7['as'],'attributes':_0x1526d7[_0x64b6('0x1c')],'include':_0x1526d7[_0x64b6('0x1d')]?_[_0x64b6('0x1e')](_0x1526d7[_0x64b6('0x1d')],function(_0x391cb2){return{'model':db[_0x391cb2[_0x64b6('0x1f')]],'as':_0x391cb2['as'],'attributes':_0x391cb2[_0x64b6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64b6('0x20')](function(_0xa5779){logger[_0x64b6('0xf')](_0x64b6('0x21'),_0x3fa808);logger['debug'](_0x64b6('0x21'),_0x3fa808,JSON['stringify'](_0xa5779));_0x379c4a(_0xa5779);})['catch'](function(_0x3d52dd){logger[_0x64b6('0x14')](_0x64b6('0x21'),_0x3d52dd[_0x64b6('0x15')],_0x3fa808);_0x14bc5e(_0x41dd3d[_0x64b6('0x14')](0x1f4,_0x3d52dd[_0x64b6('0x15')]));});});};exports[_0x64b6('0x22')]=function(_0x3a8faa){var _0x33f05a=this;return new Promise(function(_0x32412a,_0x3453f9){return db['VoiceQueue']['find']({'raw':_0x3a8faa['options']?_0x3a8faa['options'][_0x64b6('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a8faa['options']?_0x3a8faa[_0x64b6('0x1a')][_0x64b6('0x23')]||null:null,'attributes':_0x3a8faa[_0x64b6('0x1a')]?_0x3a8faa[_0x64b6('0x1a')][_0x64b6('0x1c')]||null:null,'include':_0x3a8faa['options']?_0x3a8faa['options'][_0x64b6('0x1d')]?_[_0x64b6('0x1e')](_0x3a8faa[_0x64b6('0x1a')][_0x64b6('0x1d')],function(_0x8deeab){return{'model':db[_0x8deeab['model']],'as':_0x8deeab['as'],'attributes':_0x8deeab[_0x64b6('0x1c')],'include':_0x8deeab[_0x64b6('0x1d')]?_[_0x64b6('0x1e')](_0x8deeab[_0x64b6('0x1d')],function(_0x4ffb6d){return{'model':db[_0x4ffb6d[_0x64b6('0x1f')]],'as':_0x4ffb6d['as'],'attributes':_0x4ffb6d[_0x64b6('0x1c')],'include':_0x4ffb6d[_0x64b6('0x1d')]?_[_0x64b6('0x1e')](_0x4ffb6d[_0x64b6('0x1d')],function(_0x5f01f9){return{'model':db[_0x5f01f9[_0x64b6('0x1f')]],'as':_0x5f01f9['as'],'attributes':_0x5f01f9[_0x64b6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64b6('0x20')](function(_0x5c48e6){logger['info']('ShowVoiceQueue',_0x3a8faa);logger[_0x64b6('0x24')](_0x64b6('0x22'),_0x3a8faa,JSON[_0x64b6('0x13')](_0x5c48e6));_0x32412a(_0x5c48e6);})[_0x64b6('0x17')](function(_0x3389d8){logger[_0x64b6('0x14')](_0x64b6('0x22'),_0x3389d8[_0x64b6('0x15')],_0x3a8faa);_0x3453f9(_0x33f05a[_0x64b6('0x14')](0x1f4,_0x3389d8[_0x64b6('0x15')]));});});};
\ No newline at end of file
index 1f7fa32..d8ffe92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x000d=['./voiceQueue.events','save','update','emit','removeListener','register','length','voiceQueue:'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0x000d,0x140));var _0xd000=function(_0x1b1888,_0x3e2fd2){_0x1b1888=_0x1b1888-0x0;var _0x42e090=_0x000d[_0x1b1888];return _0x42e090;};'use strict';var VoiceQueueEvents=require(_0xd000('0x0'));var events=[_0xd000('0x1'),'remove',_0xd000('0x2')];function createListener(_0x58bcf2,_0x3fb142){return function(_0x5dea3a){_0x3fb142[_0xd000('0x3')](_0x58bcf2,_0x5dea3a);};}function removeListener(_0x5b1e6d,_0x96dcd5){return function(){VoiceQueueEvents[_0xd000('0x4')](_0x5b1e6d,_0x96dcd5);};}exports[_0xd000('0x5')]=function(_0x4e7225){for(var _0x24f407=0x0,_0x37cdbc=events[_0xd000('0x6')];_0x24f407<_0x37cdbc;_0x24f407++){var _0x4f57ff=events[_0x24f407];var _0x38a746=createListener(_0xd000('0x7')+_0x4f57ff,_0x4e7225);VoiceQueueEvents['on'](_0x4f57ff,_0x38a746);}};
\ No newline at end of file
+var _0x6e61=['./voiceQueue.events','remove','update','emit','removeListener','register','voiceQueue:'];(function(_0x25ddbd,_0x47e65a){var _0x424386=function(_0x357c1b){while(--_0x357c1b){_0x25ddbd['push'](_0x25ddbd['shift']());}};_0x424386(++_0x47e65a);}(_0x6e61,0x188));var _0x16e6=function(_0x1ef4dc,_0x26c59e){_0x1ef4dc=_0x1ef4dc-0x0;var _0x2f8bb6=_0x6e61[_0x1ef4dc];return _0x2f8bb6;};'use strict';var VoiceQueueEvents=require(_0x16e6('0x0'));var events=['save',_0x16e6('0x1'),_0x16e6('0x2')];function createListener(_0x56a5dd,_0x34a9ba){return function(_0x45fccd){_0x34a9ba[_0x16e6('0x3')](_0x56a5dd,_0x45fccd);};}function removeListener(_0x22926a,_0x36ea26){return function(){VoiceQueueEvents[_0x16e6('0x4')](_0x22926a,_0x36ea26);};}exports[_0x16e6('0x5')]=function(_0x11a0a4){for(var _0x3d0582=0x0,_0x5d3f60=events['length'];_0x3d0582<_0x5d3f60;_0x3d0582++){var _0x39211c=events[_0x3d0582];var _0x231cba=createListener(_0x16e6('0x6')+_0x39211c,_0x11a0a4);VoiceQueueEvents['on'](_0x39211c,_0x231cba);}};
\ No newline at end of file
index dbcd915..a193104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show','post','create','update','delete','exports','multer','util','path'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x263b,0x87));var _0xb263=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x263b[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xb263('0x0'));var util=require(_0xb263('0x1'));var path=require(_0xb263('0x2'));var timeout=require(_0xb263('0x3'));var express=require('express');var router=express[_0xb263('0x4')]();var fs_extra=require(_0xb263('0x5'));var auth=require(_0xb263('0x6'));var interaction=require(_0xb263('0x7'));var config=require(_0xb263('0x8'));var controller=require(_0xb263('0x9'));router[_0xb263('0xa')]('/',auth[_0xb263('0xb')](),controller[_0xb263('0xc')]);router[_0xb263('0xa')]('/describe',auth[_0xb263('0xb')](),controller[_0xb263('0xd')]);router[_0xb263('0xa')](_0xb263('0xe'),auth['isAuthenticated'](),controller[_0xb263('0xf')]);router[_0xb263('0xa')](_0xb263('0x10'),auth[_0xb263('0xb')](),controller[_0xb263('0x11')]);router[_0xb263('0x12')]('/',auth['isAuthenticated'](),controller[_0xb263('0x13')]);router['put'](_0xb263('0x10'),auth[_0xb263('0xb')](),controller[_0xb263('0x14')]);router[_0xb263('0x15')](_0xb263('0x10'),auth[_0xb263('0xb')](),controller['destroy']);module[_0xb263('0x16')]=router;
\ No newline at end of file
+var _0x5cb6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','/:id','create','update','delete','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5cb6,0x67));var _0x65cb=function(_0x32c57d,_0x4b455a){_0x32c57d=_0x32c57d-0x0;var _0x353d7f=_0x5cb6[_0x32c57d];return _0x353d7f;};'use strict';var multer=require(_0x65cb('0x0'));var util=require('util');var path=require(_0x65cb('0x1'));var timeout=require(_0x65cb('0x2'));var express=require('express');var router=express[_0x65cb('0x3')]();var fs_extra=require(_0x65cb('0x4'));var auth=require(_0x65cb('0x5'));var interaction=require(_0x65cb('0x6'));var config=require(_0x65cb('0x7'));var controller=require(_0x65cb('0x8'));router[_0x65cb('0x9')]('/',auth[_0x65cb('0xa')](),controller['index']);router[_0x65cb('0x9')]('/describe',auth[_0x65cb('0xa')](),controller[_0x65cb('0xb')]);router[_0x65cb('0x9')](_0x65cb('0xc'),auth[_0x65cb('0xa')](),controller['getVoiceQueuesReport']);router[_0x65cb('0x9')](_0x65cb('0xd'),auth[_0x65cb('0xa')](),controller['show']);router['post']('/',auth[_0x65cb('0xa')](),controller[_0x65cb('0xe')]);router['put'](_0x65cb('0xd'),auth['isAuthenticated'](),controller[_0x65cb('0xf')]);router[_0x65cb('0x10')](_0x65cb('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x65cb('0x11')]=router;
\ No newline at end of file
index 148a276..786415e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bc9=['DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x4bc9,0xa4));var _0x94bc=function(_0x300449,_0x34b08f){_0x300449=_0x300449-0x0;var _0x589824=_0x4bc9[_0x300449];return _0x589824;};'use strict';var Sequelize=require(_0x94bc('0x0'));var moment=require(_0x94bc('0x1'));module[_0x94bc('0x2')]={'type':{'type':Sequelize[_0x94bc('0x3')]},'uniqueid':{'type':Sequelize[_0x94bc('0x3')]},'calleridnum':{'type':Sequelize[_0x94bc('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x94bc('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x94bc('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x94bc('0x4')],'set':function(_0xe58eeb){var _0x2fd063=moment(_0xe58eeb);var _0x1797d8=moment(this[_0x94bc('0x5')]('queuecallerjoinAt'))['format'](_0x94bc('0x6'));var _0x47aeb0=_0x2fd063['diff'](_0x1797d8,_0x94bc('0x7'));this[_0x94bc('0x8')](_0x94bc('0x9'),_0xe58eeb);this[_0x94bc('0x8')]('holdtime',_0x47aeb0||null);}},'position':{'type':Sequelize[_0x94bc('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x94bc('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x94bc('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x94bc('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x94bc('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x94bc('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x94bc('0x3')]},'connectedlinenum':{'type':Sequelize[_0x94bc('0x3')]},'connectedlinename':{'type':Sequelize[_0x94bc('0x3')]},'accountcode':{'type':Sequelize[_0x94bc('0x3')]},'context':{'type':Sequelize[_0x94bc('0x3')]},'exten':{'type':Sequelize[_0x94bc('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x94bc('0xa')]},'mohtime':{'type':Sequelize[_0x94bc('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x94bc('0x3')]},'transfer':{'type':Sequelize[_0x94bc('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x94bc('0xd')},'transferexten':{'type':Sequelize[_0x94bc('0x3')]},'transferuniqueid':{'type':Sequelize[_0x94bc('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x94bc('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x94bc('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x391c=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','getDataValue','format','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x391c,0x199));var _0xc391=function(_0x131b4b,_0x5f3de3){_0x131b4b=_0x131b4b-0x0;var _0x4ac9bd=_0x391c[_0x131b4b];return _0x4ac9bd;};'use strict';var Sequelize=require(_0xc391('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc391('0x1')]},'calleridnum':{'type':Sequelize[_0xc391('0x1')]},'calleridname':{'type':Sequelize[_0xc391('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xc391('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0xc391('0x2')],'set':function(_0x5c2838){var _0x296072=moment(_0x5c2838);var _0x158f9a=moment(this[_0xc391('0x3')]('queuecallerjoinAt'))[_0xc391('0x4')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2ba61b=_0x296072['diff'](_0x158f9a,'seconds');this[_0xc391('0x5')](_0xc391('0x6'),_0x5c2838);this[_0xc391('0x5')](_0xc391('0x7'),_0x2ba61b||null);}},'position':{'type':Sequelize[_0xc391('0x8')]},'count':{'type':Sequelize[_0xc391('0x8')]},'queuecallerabandon':{'type':Sequelize[_0xc391('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc391('0x2')]},'queuecallercomplete':{'type':Sequelize[_0xc391('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc391('0x2')]},'queuecallerexit':{'type':Sequelize[_0xc391('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xc391('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xc391('0x1')],'comment':_0xc391('0xa')},'originalposition':{'type':Sequelize[_0xc391('0x8')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xc391('0x1')]},'connectedlinename':{'type':Sequelize[_0xc391('0x1')]},'accountcode':{'type':Sequelize[_0xc391('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xc391('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xc391('0x8')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc391('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xc391('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xc391('0xb')},'transferexten':{'type':Sequelize[_0xc391('0x1')]},'transferuniqueid':{'type':Sequelize[_0xc391('0x1')]},'disposition':{'type':Sequelize[_0xc391('0x1')]},'secondDisposition':{'type':Sequelize[_0xc391('0x1')]},'thirdDisposition':{'type':Sequelize[_0xc391('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xc391('0x8')],'defaultValue':0x0}};
\ No newline at end of file
index d46d149..9956c54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b00=['includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','length','hasOwnProperty','nolimit','order','rows','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','key','model','query','intersection','fields','attributes','sort','filters','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0xe68140,_0x13c91a){var _0x3af9dd=function(_0x48faad){while(--_0x48faad){_0xe68140['push'](_0xe68140['shift']());}};_0x3af9dd(++_0x13c91a);}(_0x3b00,0xb9));var _0x03b0=function(_0x2be614,_0x3210a3){_0x2be614=_0x2be614-0x0;var _0x52a768=_0x3b00[_0x2be614];return _0x52a768;};'use strict';var emlformat=require(_0x03b0('0x0'));var rimraf=require(_0x03b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03b0('0x2'));var rp=require('request-promise');var moment=require(_0x03b0('0x3'));var BPromise=require(_0x03b0('0x4'));var Mustache=require('mustache');var util=require(_0x03b0('0x5'));var path=require('path');var sox=require(_0x03b0('0x6'));var csv=require(_0x03b0('0x7'));var ejs=require(_0x03b0('0x8'));var fs=require('fs');var fs_extra=require(_0x03b0('0x9'));var _=require(_0x03b0('0xa'));var squel=require(_0x03b0('0xb'));var crypto=require('crypto');var jsforce=require(_0x03b0('0xc'));var deskjs=require(_0x03b0('0xd'));var toCsv=require(_0x03b0('0x7'));var querystring=require('querystring');var Papa=require(_0x03b0('0xe'));var Redis=require(_0x03b0('0xf'));var authService=require(_0x03b0('0x10'));var qs=require(_0x03b0('0x11'));var as=require(_0x03b0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03b0('0x13'))(_0x03b0('0x14'));var utils=require(_0x03b0('0x15'));var config=require(_0x03b0('0x16'));var licenseUtil=require(_0x03b0('0x17'));var db=require(_0x03b0('0x18'))['db'];config[_0x03b0('0x19')]=_['defaults'](config[_0x03b0('0x19')],{'host':_0x03b0('0x1a'),'port':0x18eb});var socket=require(_0x03b0('0x1b'))(new Redis(config['redis']));require(_0x03b0('0x1c'))[_0x03b0('0x1d')](socket);function respondWithStatusCode(_0x2814b2,_0x1a09b1){_0x1a09b1=_0x1a09b1||0xcc;return function(_0x15c3b7){if(_0x15c3b7){return _0x2814b2[_0x03b0('0x1e')](_0x1a09b1);}return _0x2814b2[_0x03b0('0x1f')](_0x1a09b1)[_0x03b0('0x20')]();};}function respondWithResult(_0x59e3e3,_0x4f0926){_0x4f0926=_0x4f0926||0xc8;return function(_0x29139a){if(_0x29139a){return _0x59e3e3[_0x03b0('0x1f')](_0x4f0926)['json'](_0x29139a);}};}function respondWithFilteredResult(_0x2a5135,_0x496d54){return function(_0x4fb2cc){if(_0x4fb2cc){var _0xe9b61d=typeof _0x496d54[_0x03b0('0x21')]==='undefined'&&typeof _0x496d54[_0x03b0('0x22')]===_0x03b0('0x23');var _0x5d6c0f=_0x4fb2cc['count'];var _0x2181cd=_0xe9b61d?0x0:_0x496d54[_0x03b0('0x21')];var _0x1024d5=_0xe9b61d?_0x4fb2cc[_0x03b0('0x24')]:_0x496d54[_0x03b0('0x21')]+_0x496d54['limit'];var _0x5215a1;if(_0x1024d5>=_0x5d6c0f){_0x1024d5=_0x5d6c0f;_0x5215a1=0xc8;}else{_0x5215a1=0xce;}_0x2a5135['status'](_0x5215a1);return _0x2a5135['set'](_0x03b0('0x25'),_0x2181cd+'-'+_0x1024d5+'/'+_0x5d6c0f)[_0x03b0('0x26')](_0x4fb2cc);}return null;};}function patchUpdates(_0x90950c){return function(_0x2b4407){try{jsonpatch[_0x03b0('0x27')](_0x2b4407,_0x90950c,!![]);}catch(_0x3fc8e5){return BPromise[_0x03b0('0x28')](_0x3fc8e5);}return _0x2b4407[_0x03b0('0x29')]();};}function saveUpdates(_0xc5639e,_0x4d55ed){return function(_0xc12906){if(_0xc12906){return _0xc12906[_0x03b0('0x2a')](_0xc5639e)[_0x03b0('0x2b')](function(_0x486232){return _0x486232;});}return null;};}function removeEntity(_0x5b1851,_0x5da586){return function(_0x55f0fb){if(_0x55f0fb){return _0x55f0fb[_0x03b0('0x2c')]()['then'](function(){_0x5b1851[_0x03b0('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48a20a,_0x407ad8){return function(_0x3cf9f1){if(!_0x3cf9f1){_0x48a20a['sendStatus'](0x194);}return _0x3cf9f1;};}function handleError(_0x598224,_0x6a26e9){_0x6a26e9=_0x6a26e9||0x1f4;return function(_0x81748f){logger[_0x03b0('0x2d')](_0x81748f['stack']);if(_0x81748f['name']){delete _0x81748f[_0x03b0('0x2e')];}_0x598224[_0x03b0('0x1f')](_0x6a26e9)[_0x03b0('0x2f')](_0x81748f);};}exports[_0x03b0('0x30')]=function(_0x1faa8b,_0x201948){var _0x524fe7={},_0x467173={},_0xd00af4={'count':0x0,'rows':[]};var _0x2875f7=_[_0x03b0('0x31')](db[_0x03b0('0x32')][_0x03b0('0x33')],function(_0x248969){return{'name':_0x248969['fieldName'],'type':_0x248969['type'][_0x03b0('0x34')]};});_0x467173[_0x03b0('0x35')]=_['map'](_0x2875f7,_0x03b0('0x2e'));_0x467173[_0x03b0('0x36')]=_['keys'](_0x1faa8b['query']);_0x467173['filters']=_['intersection'](_0x467173[_0x03b0('0x35')],_0x467173[_0x03b0('0x36')]);_0x524fe7['attributes']=_[_0x03b0('0x37')](_0x467173[_0x03b0('0x35')],qs['fields'](_0x1faa8b[_0x03b0('0x36')][_0x03b0('0x38')]));_0x524fe7['attributes']=_0x524fe7[_0x03b0('0x39')]['length']?_0x524fe7[_0x03b0('0x39')]:_0x467173[_0x03b0('0x35')];if(!_0x1faa8b['query']['hasOwnProperty']('nolimit')){_0x524fe7[_0x03b0('0x22')]=qs['limit'](_0x1faa8b[_0x03b0('0x36')][_0x03b0('0x22')]);_0x524fe7[_0x03b0('0x21')]=qs[_0x03b0('0x21')](_0x1faa8b[_0x03b0('0x36')]['offset']);}_0x524fe7['order']=qs['sort'](_0x1faa8b[_0x03b0('0x36')][_0x03b0('0x3a')]);_0x524fe7['where']=qs[_0x03b0('0x3b')](_[_0x03b0('0x3c')](_0x1faa8b['query'],_0x467173[_0x03b0('0x3b')]),_0x2875f7);if(_0x1faa8b[_0x03b0('0x36')][_0x03b0('0x3d')]){_0x524fe7[_0x03b0('0x3e')]=_[_0x03b0('0x3f')](_0x524fe7[_0x03b0('0x3e')],{'$or':_[_0x03b0('0x31')](_0x2875f7,function(_0x3d61f4){if(_0x3d61f4[_0x03b0('0x40')]!==_0x03b0('0x41')){var _0x5b26b3={};_0x5b26b3[_0x3d61f4['name']]={'$like':'%'+_0x1faa8b[_0x03b0('0x36')][_0x03b0('0x3d')]+'%'};return _0x5b26b3;}})});}_0x524fe7=_[_0x03b0('0x3f')]({},_0x524fe7,_0x1faa8b[_0x03b0('0x42')]);var _0x293d27={'where':_0x524fe7['where']};return db[_0x03b0('0x32')][_0x03b0('0x24')](_0x293d27)[_0x03b0('0x2b')](function(_0x48163c){_0xd00af4[_0x03b0('0x24')]=_0x48163c;if(_0x1faa8b[_0x03b0('0x36')][_0x03b0('0x43')]){_0x524fe7[_0x03b0('0x44')]=[{'all':!![]}];}return db[_0x03b0('0x32')][_0x03b0('0x45')](_0x524fe7);})[_0x03b0('0x2b')](function(_0x475aca){_0xd00af4['rows']=_0x475aca;return _0xd00af4;})[_0x03b0('0x2b')](respondWithFilteredResult(_0x201948,_0x524fe7))[_0x03b0('0x46')](handleError(_0x201948,null));};exports[_0x03b0('0x47')]=function(_0x3d9201,_0x47fffa){var _0x1bec82={'raw':![],'where':{'id':_0x3d9201[_0x03b0('0x48')]['id']}},_0x3d5f91={};_0x3d5f91['model']=_['keys'](db[_0x03b0('0x32')][_0x03b0('0x33')]);_0x3d5f91[_0x03b0('0x36')]=_[_0x03b0('0x49')](_0x3d9201[_0x03b0('0x36')]);_0x3d5f91[_0x03b0('0x3b')]=_[_0x03b0('0x37')](_0x3d5f91[_0x03b0('0x35')],_0x3d5f91[_0x03b0('0x36')]);_0x1bec82[_0x03b0('0x39')]=_[_0x03b0('0x37')](_0x3d5f91[_0x03b0('0x35')],qs[_0x03b0('0x38')](_0x3d9201[_0x03b0('0x36')][_0x03b0('0x38')]));_0x1bec82[_0x03b0('0x39')]=_0x1bec82[_0x03b0('0x39')]['length']?_0x1bec82['attributes']:_0x3d5f91['model'];if(_0x3d9201[_0x03b0('0x36')][_0x03b0('0x43')]){_0x1bec82['include']=[{'all':!![]}];}_0x1bec82=_[_0x03b0('0x3f')]({},_0x1bec82,_0x3d9201['options']);return db[_0x03b0('0x32')][_0x03b0('0x4a')](_0x1bec82)[_0x03b0('0x2b')](handleEntityNotFound(_0x47fffa,null))['then'](respondWithResult(_0x47fffa,null))[_0x03b0('0x46')](handleError(_0x47fffa,null));};exports[_0x03b0('0x4b')]=function(_0x2653a4,_0x2a1609){return db[_0x03b0('0x32')][_0x03b0('0x4b')](_0x2653a4[_0x03b0('0x4c')],{})[_0x03b0('0x2b')](respondWithResult(_0x2a1609,0xc9))[_0x03b0('0x46')](handleError(_0x2a1609,null));};exports[_0x03b0('0x2a')]=function(_0x144aac,_0xdc7838){if(_0x144aac[_0x03b0('0x4c')]['id']){delete _0x144aac[_0x03b0('0x4c')]['id'];}return db['VoiceQueueReport'][_0x03b0('0x4a')]({'where':{'id':_0x144aac[_0x03b0('0x48')]['id']}})['then'](handleEntityNotFound(_0xdc7838,null))['then'](saveUpdates(_0x144aac[_0x03b0('0x4c')],null))[_0x03b0('0x2b')](respondWithResult(_0xdc7838,null))['catch'](handleError(_0xdc7838,null));};exports['destroy']=function(_0x3cd400,_0x4b73ff){return db['VoiceQueueReport'][_0x03b0('0x4a')]({'where':{'id':_0x3cd400[_0x03b0('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b73ff,null))[_0x03b0('0x2b')](removeEntity(_0x4b73ff,null))[_0x03b0('0x46')](handleError(_0x4b73ff,null));};exports[_0x03b0('0x4d')]=function(_0x3b7718,_0x1397bf){return db[_0x03b0('0x32')]['describe']()['then'](respondWithResult(_0x1397bf,null))[_0x03b0('0x46')](handleError(_0x1397bf,null));};exports[_0x03b0('0x4e')]=function(_0x25a368,_0x4caa66){var _0x238986={},_0x286ce0={},_0x5a7129={'count':0x0,'rows':[]};_0x286ce0['model']=_[_0x03b0('0x49')](db[_0x03b0('0x32')][_0x03b0('0x33')]);_0x286ce0[_0x03b0('0x36')]=_[_0x03b0('0x49')](_0x25a368[_0x03b0('0x36')]);_0x286ce0[_0x03b0('0x3b')]=_[_0x03b0('0x37')](_0x286ce0[_0x03b0('0x35')],_0x286ce0['query']);_0x238986['attributes']=_[_0x03b0('0x37')](_0x286ce0[_0x03b0('0x35')],qs[_0x03b0('0x38')](_0x25a368[_0x03b0('0x36')][_0x03b0('0x38')]));_0x238986[_0x03b0('0x39')]=_0x238986[_0x03b0('0x39')][_0x03b0('0x4f')]?_0x238986[_0x03b0('0x39')]:_0x286ce0[_0x03b0('0x35')];if(!_0x25a368[_0x03b0('0x36')][_0x03b0('0x50')](_0x03b0('0x51'))){_0x238986[_0x03b0('0x22')]=qs[_0x03b0('0x22')](_0x25a368[_0x03b0('0x36')][_0x03b0('0x22')]);_0x238986[_0x03b0('0x21')]=qs[_0x03b0('0x21')](_0x25a368[_0x03b0('0x36')][_0x03b0('0x21')]);}_0x238986[_0x03b0('0x52')]=qs[_0x03b0('0x3a')](_0x25a368[_0x03b0('0x36')]['sort']);_0x238986[_0x03b0('0x3e')]=qs['filters'](_['pick'](_0x25a368[_0x03b0('0x36')],_0x286ce0[_0x03b0('0x3b')]));if(_0x25a368[_0x03b0('0x36')][_0x03b0('0x3d')]){_0x238986[_0x03b0('0x3e')]=_[_0x03b0('0x3f')](_0x238986[_0x03b0('0x3e')],{'$or':_[_0x03b0('0x31')](_0x238986[_0x03b0('0x39')],function(_0x4d2bac){var _0x357875={};_0x357875[_0x4d2bac]={'$like':'%'+_0x25a368[_0x03b0('0x36')][_0x03b0('0x3d')]+'%'};return _0x357875;})});}_0x238986=_['merge']({},_0x238986,_0x25a368['options']);var _0x4c186e={'where':_0x238986[_0x03b0('0x3e')]};return db[_0x03b0('0x32')][_0x03b0('0x24')](_0x4c186e)[_0x03b0('0x2b')](function(_0xf05844){_0x5a7129[_0x03b0('0x24')]=_0xf05844;if(_0x25a368[_0x03b0('0x36')][_0x03b0('0x43')]){_0x238986['include']=[{'all':!![]}];}return db[_0x03b0('0x32')][_0x03b0('0x45')](_0x238986);})[_0x03b0('0x2b')](function(_0x50d21a){_0x5a7129[_0x03b0('0x53')]=_0x50d21a;return _0x5a7129;})[_0x03b0('0x2b')](respondWithFilteredResult(_0x4caa66,_0x238986,_0x03b0('0x4e')))[_0x03b0('0x46')](handleError(_0x4caa66,null,_0x03b0('0x4e')));};
\ No newline at end of file
+var _0xa9b5=['key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','find','create','body','destroy','catch','describe','getVoiceQueuesReport','sort','pick','include','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','end','status','offset','undefined','limit','count','set','reject','update','then','sendStatus','error','stack','name','send','map','VoiceQueueReport','rawAttributes','fieldName','type'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xa9b5,0x1d4));var _0x5a9b=function(_0x282553,_0x62a377){_0x282553=_0x282553-0x0;var _0x3420dc=_0xa9b5[_0x282553];return _0x3420dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a9b('0x0'));var zipdir=require(_0x5a9b('0x1'));var jsonpatch=require(_0x5a9b('0x2'));var rp=require('request-promise');var moment=require(_0x5a9b('0x3'));var BPromise=require(_0x5a9b('0x4'));var Mustache=require(_0x5a9b('0x5'));var util=require('util');var path=require(_0x5a9b('0x6'));var sox=require(_0x5a9b('0x7'));var csv=require('to-csv');var ejs=require(_0x5a9b('0x8'));var fs=require('fs');var fs_extra=require(_0x5a9b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a9b('0xa'));var jsforce=require(_0x5a9b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a9b('0xc'));var querystring=require(_0x5a9b('0xd'));var Papa=require(_0x5a9b('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5a9b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5a9b('0x10'));var config=require(_0x5a9b('0x11'));var licenseUtil=require(_0x5a9b('0x12'));var db=require('../../mysqldb')['db'];config[_0x5a9b('0x13')]=_[_0x5a9b('0x14')](config[_0x5a9b('0x13')],{'host':_0x5a9b('0x15'),'port':0x18eb});var socket=require(_0x5a9b('0x16'))(new Redis(config['redis']));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x3ef27a,_0x263a55){_0x263a55=_0x263a55||0xcc;return function(_0x24eb52){if(_0x24eb52){return _0x3ef27a['sendStatus'](_0x263a55);}return _0x3ef27a['status'](_0x263a55)[_0x5a9b('0x17')]();};}function respondWithResult(_0x2f934d,_0x4173b7){_0x4173b7=_0x4173b7||0xc8;return function(_0x11f810){if(_0x11f810){return _0x2f934d[_0x5a9b('0x18')](_0x4173b7)['json'](_0x11f810);}};}function respondWithFilteredResult(_0x1de32b,_0x2b70df){return function(_0xb62a91){if(_0xb62a91){var _0x1f4c80=typeof _0x2b70df[_0x5a9b('0x19')]===_0x5a9b('0x1a')&&typeof _0x2b70df[_0x5a9b('0x1b')]===_0x5a9b('0x1a');var _0x3e56ea=_0xb62a91['count'];var _0x4501bf=_0x1f4c80?0x0:_0x2b70df[_0x5a9b('0x19')];var _0x5ea00d=_0x1f4c80?_0xb62a91[_0x5a9b('0x1c')]:_0x2b70df[_0x5a9b('0x19')]+_0x2b70df[_0x5a9b('0x1b')];var _0x12f0f5;if(_0x5ea00d>=_0x3e56ea){_0x5ea00d=_0x3e56ea;_0x12f0f5=0xc8;}else{_0x12f0f5=0xce;}_0x1de32b['status'](_0x12f0f5);return _0x1de32b[_0x5a9b('0x1d')]('Content-Range',_0x4501bf+'-'+_0x5ea00d+'/'+_0x3e56ea)['json'](_0xb62a91);}return null;};}function patchUpdates(_0x1d687e){return function(_0x284865){try{jsonpatch['apply'](_0x284865,_0x1d687e,!![]);}catch(_0x250418){return BPromise[_0x5a9b('0x1e')](_0x250418);}return _0x284865['save']();};}function saveUpdates(_0x4a8d00,_0x4e8557){return function(_0x45710e){if(_0x45710e){return _0x45710e[_0x5a9b('0x1f')](_0x4a8d00)[_0x5a9b('0x20')](function(_0x3d7dae){return _0x3d7dae;});}return null;};}function removeEntity(_0xe3fc91,_0x142efc){return function(_0x379343){if(_0x379343){return _0x379343['destroy']()['then'](function(){_0xe3fc91[_0x5a9b('0x18')](0xcc)[_0x5a9b('0x17')]();});}};}function handleEntityNotFound(_0x5cd630,_0x149a2a){return function(_0x532474){if(!_0x532474){_0x5cd630[_0x5a9b('0x21')](0x194);}return _0x532474;};}function handleError(_0x208fbb,_0x231d1f){_0x231d1f=_0x231d1f||0x1f4;return function(_0x227df9){logger[_0x5a9b('0x22')](_0x227df9[_0x5a9b('0x23')]);if(_0x227df9['name']){delete _0x227df9[_0x5a9b('0x24')];}_0x208fbb[_0x5a9b('0x18')](_0x231d1f)[_0x5a9b('0x25')](_0x227df9);};}exports['index']=function(_0x3f367f,_0x8e2478){var _0x5f052c={},_0x51b43b={},_0xca634b={'count':0x0,'rows':[]};var _0x4bc2ac=_[_0x5a9b('0x26')](db[_0x5a9b('0x27')][_0x5a9b('0x28')],function(_0x2cfdb6){return{'name':_0x2cfdb6[_0x5a9b('0x29')],'type':_0x2cfdb6[_0x5a9b('0x2a')][_0x5a9b('0x2b')]};});_0x51b43b['model']=_[_0x5a9b('0x26')](_0x4bc2ac,_0x5a9b('0x24'));_0x51b43b[_0x5a9b('0x2c')]=_[_0x5a9b('0x2d')](_0x3f367f[_0x5a9b('0x2c')]);_0x51b43b[_0x5a9b('0x2e')]=_[_0x5a9b('0x2f')](_0x51b43b[_0x5a9b('0x30')],_0x51b43b[_0x5a9b('0x2c')]);_0x5f052c['attributes']=_[_0x5a9b('0x2f')](_0x51b43b['model'],qs[_0x5a9b('0x31')](_0x3f367f[_0x5a9b('0x2c')][_0x5a9b('0x31')]));_0x5f052c[_0x5a9b('0x32')]=_0x5f052c[_0x5a9b('0x32')][_0x5a9b('0x33')]?_0x5f052c[_0x5a9b('0x32')]:_0x51b43b[_0x5a9b('0x30')];if(!_0x3f367f['query']['hasOwnProperty'](_0x5a9b('0x34'))){_0x5f052c[_0x5a9b('0x1b')]=qs[_0x5a9b('0x1b')](_0x3f367f[_0x5a9b('0x2c')][_0x5a9b('0x1b')]);_0x5f052c[_0x5a9b('0x19')]=qs[_0x5a9b('0x19')](_0x3f367f[_0x5a9b('0x2c')]['offset']);}_0x5f052c[_0x5a9b('0x35')]=qs['sort'](_0x3f367f['query']['sort']);_0x5f052c['where']=qs[_0x5a9b('0x2e')](_['pick'](_0x3f367f[_0x5a9b('0x2c')],_0x51b43b['filters']),_0x4bc2ac);if(_0x3f367f[_0x5a9b('0x2c')][_0x5a9b('0x36')]){_0x5f052c[_0x5a9b('0x37')]=_[_0x5a9b('0x38')](_0x5f052c[_0x5a9b('0x37')],{'$or':_[_0x5a9b('0x26')](_0x4bc2ac,function(_0x5c0107){if(_0x5c0107[_0x5a9b('0x2a')]!==_0x5a9b('0x39')){var _0x554455={};_0x554455[_0x5c0107['name']]={'$like':'%'+_0x3f367f[_0x5a9b('0x2c')][_0x5a9b('0x36')]+'%'};return _0x554455;}})});}_0x5f052c=_[_0x5a9b('0x38')]({},_0x5f052c,_0x3f367f[_0x5a9b('0x3a')]);var _0x5affa1={'where':_0x5f052c[_0x5a9b('0x37')]};return db[_0x5a9b('0x27')][_0x5a9b('0x1c')](_0x5affa1)[_0x5a9b('0x20')](function(_0x2eec49){_0xca634b['count']=_0x2eec49;if(_0x3f367f[_0x5a9b('0x2c')][_0x5a9b('0x3b')]){_0x5f052c['include']=[{'all':!![]}];}return db[_0x5a9b('0x27')][_0x5a9b('0x3c')](_0x5f052c);})[_0x5a9b('0x20')](function(_0x2a0846){_0xca634b[_0x5a9b('0x3d')]=_0x2a0846;return _0xca634b;})['then'](respondWithFilteredResult(_0x8e2478,_0x5f052c))['catch'](handleError(_0x8e2478,null));};exports['show']=function(_0x3a143e,_0x5f0ef8){var _0x19b69e={'raw':![],'where':{'id':_0x3a143e[_0x5a9b('0x3e')]['id']}},_0xd73505={};_0xd73505[_0x5a9b('0x30')]=_[_0x5a9b('0x2d')](db[_0x5a9b('0x27')][_0x5a9b('0x28')]);_0xd73505['query']=_[_0x5a9b('0x2d')](_0x3a143e['query']);_0xd73505[_0x5a9b('0x2e')]=_[_0x5a9b('0x2f')](_0xd73505[_0x5a9b('0x30')],_0xd73505[_0x5a9b('0x2c')]);_0x19b69e['attributes']=_[_0x5a9b('0x2f')](_0xd73505[_0x5a9b('0x30')],qs[_0x5a9b('0x31')](_0x3a143e['query'][_0x5a9b('0x31')]));_0x19b69e[_0x5a9b('0x32')]=_0x19b69e[_0x5a9b('0x32')]['length']?_0x19b69e[_0x5a9b('0x32')]:_0xd73505[_0x5a9b('0x30')];if(_0x3a143e[_0x5a9b('0x2c')]['includeAll']){_0x19b69e['include']=[{'all':!![]}];}_0x19b69e=_['merge']({},_0x19b69e,_0x3a143e[_0x5a9b('0x3a')]);return db['VoiceQueueReport'][_0x5a9b('0x3f')](_0x19b69e)['then'](handleEntityNotFound(_0x5f0ef8,null))[_0x5a9b('0x20')](respondWithResult(_0x5f0ef8,null))['catch'](handleError(_0x5f0ef8,null));};exports[_0x5a9b('0x40')]=function(_0x1a297d,_0xc5bd6e){return db['VoiceQueueReport'][_0x5a9b('0x40')](_0x1a297d['body'],{})[_0x5a9b('0x20')](respondWithResult(_0xc5bd6e,0xc9))['catch'](handleError(_0xc5bd6e,null));};exports[_0x5a9b('0x1f')]=function(_0x24fd9b,_0x308e80){if(_0x24fd9b[_0x5a9b('0x41')]['id']){delete _0x24fd9b[_0x5a9b('0x41')]['id'];}return db[_0x5a9b('0x27')][_0x5a9b('0x3f')]({'where':{'id':_0x24fd9b[_0x5a9b('0x3e')]['id']}})[_0x5a9b('0x20')](handleEntityNotFound(_0x308e80,null))[_0x5a9b('0x20')](saveUpdates(_0x24fd9b[_0x5a9b('0x41')],null))[_0x5a9b('0x20')](respondWithResult(_0x308e80,null))['catch'](handleError(_0x308e80,null));};exports[_0x5a9b('0x42')]=function(_0x3f35b2,_0x4f0c26){return db[_0x5a9b('0x27')][_0x5a9b('0x3f')]({'where':{'id':_0x3f35b2[_0x5a9b('0x3e')]['id']}})[_0x5a9b('0x20')](handleEntityNotFound(_0x4f0c26,null))['then'](removeEntity(_0x4f0c26,null))[_0x5a9b('0x43')](handleError(_0x4f0c26,null));};exports['describe']=function(_0x527a34,_0x5078a7){return db[_0x5a9b('0x27')][_0x5a9b('0x44')]()[_0x5a9b('0x20')](respondWithResult(_0x5078a7,null))[_0x5a9b('0x43')](handleError(_0x5078a7,null));};exports[_0x5a9b('0x45')]=function(_0x51aefd,_0x31331b){var _0x861c5={},_0x4ba1a4={},_0x35724e={'count':0x0,'rows':[]};_0x4ba1a4[_0x5a9b('0x30')]=_[_0x5a9b('0x2d')](db[_0x5a9b('0x27')][_0x5a9b('0x28')]);_0x4ba1a4[_0x5a9b('0x2c')]=_[_0x5a9b('0x2d')](_0x51aefd[_0x5a9b('0x2c')]);_0x4ba1a4[_0x5a9b('0x2e')]=_[_0x5a9b('0x2f')](_0x4ba1a4[_0x5a9b('0x30')],_0x4ba1a4[_0x5a9b('0x2c')]);_0x861c5[_0x5a9b('0x32')]=_[_0x5a9b('0x2f')](_0x4ba1a4[_0x5a9b('0x30')],qs['fields'](_0x51aefd[_0x5a9b('0x2c')][_0x5a9b('0x31')]));_0x861c5[_0x5a9b('0x32')]=_0x861c5[_0x5a9b('0x32')][_0x5a9b('0x33')]?_0x861c5[_0x5a9b('0x32')]:_0x4ba1a4['model'];if(!_0x51aefd[_0x5a9b('0x2c')]['hasOwnProperty']('nolimit')){_0x861c5[_0x5a9b('0x1b')]=qs['limit'](_0x51aefd['query'][_0x5a9b('0x1b')]);_0x861c5[_0x5a9b('0x19')]=qs['offset'](_0x51aefd[_0x5a9b('0x2c')]['offset']);}_0x861c5['order']=qs[_0x5a9b('0x46')](_0x51aefd['query'][_0x5a9b('0x46')]);_0x861c5[_0x5a9b('0x37')]=qs[_0x5a9b('0x2e')](_[_0x5a9b('0x47')](_0x51aefd[_0x5a9b('0x2c')],_0x4ba1a4[_0x5a9b('0x2e')]));if(_0x51aefd[_0x5a9b('0x2c')]['filter']){_0x861c5[_0x5a9b('0x37')]=_[_0x5a9b('0x38')](_0x861c5[_0x5a9b('0x37')],{'$or':_[_0x5a9b('0x26')](_0x861c5['attributes'],function(_0x1c5941){var _0x1ed318={};_0x1ed318[_0x1c5941]={'$like':'%'+_0x51aefd['query'][_0x5a9b('0x36')]+'%'};return _0x1ed318;})});}_0x861c5=_['merge']({},_0x861c5,_0x51aefd[_0x5a9b('0x3a')]);var _0x5cfc52={'where':_0x861c5[_0x5a9b('0x37')]};return db[_0x5a9b('0x27')][_0x5a9b('0x1c')](_0x5cfc52)['then'](function(_0x4792b5){_0x35724e[_0x5a9b('0x1c')]=_0x4792b5;if(_0x51aefd['query'][_0x5a9b('0x3b')]){_0x861c5[_0x5a9b('0x48')]=[{'all':!![]}];}return db[_0x5a9b('0x27')][_0x5a9b('0x3c')](_0x861c5);})['then'](function(_0x19266c){_0x35724e[_0x5a9b('0x3d')]=_0x19266c;return _0x35724e;})[_0x5a9b('0x20')](respondWithFilteredResult(_0x31331b,_0x861c5,_0x5a9b('0x45')))[_0x5a9b('0x43')](handleError(_0x31331b,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index ee1779d..d197c17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa957=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x4de39f,_0x2e86a7){var _0x369041=function(_0x18cd6c){while(--_0x18cd6c){_0x4de39f['push'](_0x4de39f['shift']());}};_0x369041(++_0x2e86a7);}(_0xa957,0x1d6));var _0x7a95=function(_0x328419,_0x4ab653){_0x328419=_0x328419-0x0;var _0x342aa7=_0xa957[_0x328419];return _0x342aa7;};'use strict';var EventEmitter=require(_0x7a95('0x0'));var VoiceQueueReport=require(_0x7a95('0x1'))['db'][_0x7a95('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x7a95('0x3')](0x0);var events={'afterCreate':_0x7a95('0x4'),'afterUpdate':_0x7a95('0x5'),'afterDestroy':_0x7a95('0x6')};function emitEvent(_0x3e167e){return function(_0x3846cf,_0xbe96c1,_0x45b2cc){VoiceQueueReportEvents['emit'](_0x3e167e+':'+_0x3846cf['id'],_0x3846cf);VoiceQueueReportEvents[_0x7a95('0x7')](_0x3e167e,_0x3846cf);_0x45b2cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x7a95('0x8')](e,emitEvent(event));}}module[_0x7a95('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xf174=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','save'];(function(_0x49bc13,_0x247635){var _0x5453c=function(_0xf18df3){while(--_0xf18df3){_0x49bc13['push'](_0x49bc13['shift']());}};_0x5453c(++_0x247635);}(_0xf174,0x1be));var _0x4f17=function(_0x4b0c29,_0x40b576){_0x4b0c29=_0x4b0c29-0x0;var _0x44de8e=_0xf174[_0x4b0c29];return _0x44de8e;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x4f17('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f17('0x1'),'afterUpdate':_0x4f17('0x2'),'afterDestroy':_0x4f17('0x3')};function emitEvent(_0x46b931){return function(_0xaf25f8,_0x42deae,_0x41a8d9){VoiceQueueReportEvents[_0x4f17('0x4')](_0x46b931+':'+_0xaf25f8['id'],_0xaf25f8);VoiceQueueReportEvents[_0x4f17('0x4')](_0x46b931,_0xaf25f8);_0x41a8d9(null);};}for(var e in events){if(events[_0x4f17('0x5')](e)){var event=events[e];VoiceQueueReport[_0x4f17('0x6')](e,emitEvent(event));}}module[_0x4f17('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index 07c31a2..6083a59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cad=['VoiceQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define'];(function(_0x3d2fbb,_0x302994){var _0x3f7dff=function(_0x35bdc6){while(--_0x35bdc6){_0x3d2fbb['push'](_0x3d2fbb['shift']());}};_0x3f7dff(++_0x302994);}(_0x3cad,0xc6));var _0xd3ca=function(_0x67d15a,_0x25159f){_0x67d15a=_0x67d15a-0x0;var _0x3b7f21=_0x3cad[_0x67d15a];return _0x3b7f21;};'use strict';var _=require(_0xd3ca('0x0'));var util=require(_0xd3ca('0x1'));var logger=require(_0xd3ca('0x2'))(_0xd3ca('0x3'));var moment=require(_0xd3ca('0x4'));var BPromise=require(_0xd3ca('0x5'));var rp=require(_0xd3ca('0x6'));var fs=require('fs');var path=require(_0xd3ca('0x7'));var rimraf=require('rimraf');var config=require(_0xd3ca('0x8'));var attributes=require(_0xd3ca('0x9'));module[_0xd3ca('0xa')]=function(_0x20cbba,_0x3ff377){return _0x20cbba[_0xd3ca('0xb')](_0xd3ca('0xc'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xd3ca('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xded3=['bluebird','request-promise','../../config/environment','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','api','moment'];(function(_0x211418,_0x4f08b1){var _0x23280e=function(_0x436902){while(--_0x436902){_0x211418['push'](_0x211418['shift']());}};_0x23280e(++_0x4f08b1);}(_0xded3,0xc8));var _0x3ded=function(_0x345087,_0x53b1e6){_0x345087=_0x345087-0x0;var _0x453863=_0xded3[_0x345087];return _0x453863;};'use strict';var _=require(_0x3ded('0x0'));var util=require(_0x3ded('0x1'));var logger=require('../../config/logger')(_0x3ded('0x2'));var moment=require(_0x3ded('0x3'));var BPromise=require(_0x3ded('0x4'));var rp=require(_0x3ded('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3ded('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x70a0fc,_0x13c02e){return _0x70a0fc[_0x3ded('0x7')](_0x3ded('0x8'),attributes,{'tableName':_0x3ded('0x9'),'paranoid':![],'indexes':[{'fields':[_0x3ded('0xa')]},{'fields':[_0x3ded('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 6429a67..f19f817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf209=['VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','model','map','CreateVoiceQueueReport','create','body','update','limit','debug','UpdateVoiceQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x10507f,_0x40ab76){var _0x3e8892=function(_0x3b4ad9){while(--_0x3b4ad9){_0x10507f['push'](_0x10507f['shift']());}};_0x3e8892(++_0x40ab76);}(_0xf209,0xa2));var _0x9f20=function(_0x39c12e,_0x585534){_0x39c12e=_0x39c12e-0x0;var _0x58dbf4=_0xf209[_0x39c12e];return _0x58dbf4;};'use strict';var _=require(_0x9f20('0x0'));var util=require(_0x9f20('0x1'));var moment=require(_0x9f20('0x2'));var BPromise=require(_0x9f20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f20('0x4'));var db=require(_0x9f20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f20('0x6'))(_0x9f20('0x7'));var config=require(_0x9f20('0x8'));var jayson=require(_0x9f20('0x9'));var client=jayson[_0x9f20('0xa')][_0x9f20('0xb')]({'port':0x232a});config[_0x9f20('0xc')]=_[_0x9f20('0xd')](config[_0x9f20('0xc')],{'host':_0x9f20('0xe'),'port':0x18eb});var socket=require(_0x9f20('0xf'))(new Redis(config[_0x9f20('0xc')]));require(_0x9f20('0x10'))[_0x9f20('0x11')](socket);function respondWithRpcPromise(_0x211d8e,_0x571cf0,_0x588391){return new BPromise(function(_0x382f9c,_0x512430){return client[_0x9f20('0x12')](_0x211d8e,_0x588391)[_0x9f20('0x13')](function(_0x21ad7a){logger[_0x9f20('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x571cf0,_0x9f20('0x15'));logger['debug'](_0x9f20('0x16'),_0x571cf0,_0x9f20('0x15'),JSON[_0x9f20('0x17')](_0x21ad7a));if(_0x21ad7a['error']){if(_0x21ad7a[_0x9f20('0x18')][_0x9f20('0x19')]===0x1f4){logger['error'](_0x9f20('0x1a'),_0x571cf0,_0x21ad7a['error'][_0x9f20('0x1b')]);return _0x512430(_0x21ad7a[_0x9f20('0x18')]['message']);}logger[_0x9f20('0x18')](_0x9f20('0x1a'),_0x571cf0,_0x21ad7a[_0x9f20('0x18')][_0x9f20('0x1b')]);return _0x382f9c(_0x21ad7a['error']['message']);}else{logger[_0x9f20('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x571cf0,_0x9f20('0x15'));_0x382f9c(_0x21ad7a[_0x9f20('0x1c')][_0x9f20('0x1b')]);}})[_0x9f20('0x1d')](function(_0x3ee9a5){logger[_0x9f20('0x18')](_0x9f20('0x1a'),_0x571cf0,_0x3ee9a5);_0x512430(_0x3ee9a5);});});}exports[_0x9f20('0x1e')]=function(_0x7f8b6a){var _0x4d4122=this;return new Promise(function(_0x48947d,_0x564d21){return db[_0x9f20('0x1f')][_0x9f20('0x20')]({'raw':_0x7f8b6a[_0x9f20('0x21')]?_0x7f8b6a[_0x9f20('0x21')][_0x9f20('0x22')]===undefined?!![]:![]:!![],'where':_0x7f8b6a[_0x9f20('0x21')]?_0x7f8b6a[_0x9f20('0x21')][_0x9f20('0x23')]||null:null,'attributes':_0x7f8b6a[_0x9f20('0x21')]?_0x7f8b6a[_0x9f20('0x21')][_0x9f20('0x24')]||null:null,'limit':_0x7f8b6a['options']?_0x7f8b6a[_0x9f20('0x21')]['limit']||null:null,'include':_0x7f8b6a['options']?_0x7f8b6a[_0x9f20('0x21')][_0x9f20('0x25')]?_['map'](_0x7f8b6a['options']['include'],function(_0x180fee){return{'model':db[_0x180fee[_0x9f20('0x26')]],'as':_0x180fee['as'],'attributes':_0x180fee[_0x9f20('0x24')],'include':_0x180fee[_0x9f20('0x25')]?_[_0x9f20('0x27')](_0x180fee['include'],function(_0x413310){return{'model':db[_0x413310[_0x9f20('0x26')]],'as':_0x413310['as'],'attributes':_0x413310[_0x9f20('0x24')],'include':_0x413310['include']?_['map'](_0x413310['include'],function(_0x409469){return{'model':db[_0x409469[_0x9f20('0x26')]],'as':_0x409469['as'],'attributes':_0x409469['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f20('0x13')](function(_0x25986c){logger['info']('GetVoiceQueueReport',_0x7f8b6a);logger['debug'](_0x9f20('0x1e'),_0x7f8b6a,JSON['stringify'](_0x25986c));_0x48947d(_0x25986c);})[_0x9f20('0x1d')](function(_0x584729){logger[_0x9f20('0x18')]('GetVoiceQueueReport',_0x584729[_0x9f20('0x1b')],_0x7f8b6a);_0x564d21(_0x4d4122[_0x9f20('0x18')](0x1f4,_0x584729[_0x9f20('0x1b')]));});});};exports[_0x9f20('0x28')]=function(_0x252923){var _0x1cdf64=this;return new Promise(function(_0x3d79f3,_0x49924a){return db[_0x9f20('0x1f')][_0x9f20('0x29')](_0x252923[_0x9f20('0x2a')],{'raw':_0x252923['options']?_0x252923[_0x9f20('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x9f20('0x13')](function(_0x1595c2){logger[_0x9f20('0x14')]('CreateVoiceQueueReport',_0x252923);logger['debug'](_0x9f20('0x28'),_0x252923,JSON[_0x9f20('0x17')](_0x1595c2));_0x3d79f3(_0x1595c2);})['catch'](function(_0x3e4dc5){logger[_0x9f20('0x18')]('CreateVoiceQueueReport',_0x3e4dc5[_0x9f20('0x1b')],_0x252923);_0x49924a(_0x1cdf64['error'](0x1f4,_0x3e4dc5[_0x9f20('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x2e9553){var _0x50e4ae=this;return new Promise(function(_0x1409db,_0x35a1cd){return db[_0x9f20('0x1f')][_0x9f20('0x2b')](_0x2e9553[_0x9f20('0x2a')],{'raw':_0x2e9553['options']?_0x2e9553[_0x9f20('0x21')][_0x9f20('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e9553['options']?_0x2e9553[_0x9f20('0x21')][_0x9f20('0x23')]||null:null,'attributes':_0x2e9553[_0x9f20('0x21')]?_0x2e9553['options']['attributes']||null:null,'limit':_0x2e9553[_0x9f20('0x21')]?_0x2e9553[_0x9f20('0x21')][_0x9f20('0x2c')]||null:null})['then'](function(_0x3b7707){logger['info']('UpdateVoiceQueueReport',_0x2e9553);logger[_0x9f20('0x2d')](_0x9f20('0x2e'),_0x2e9553,JSON[_0x9f20('0x17')](_0x3b7707));_0x1409db(_0x3b7707);})[_0x9f20('0x1d')](function(_0x43b08b){logger[_0x9f20('0x18')](_0x9f20('0x2e'),_0x43b08b[_0x9f20('0x1b')],_0x2e9553);_0x35a1cd(_0x50e4ae[_0x9f20('0x18')](0x1f4,_0x43b08b['message']));});});};
\ No newline at end of file
+var _0x43b7=['findAll','options','raw','where','limit','map','include','model','attributes','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','GetVoiceQueueReport'];(function(_0x547aea,_0x1ad376){var _0x595ad4=function(_0xaee464){while(--_0xaee464){_0x547aea['push'](_0x547aea['shift']());}};_0x595ad4(++_0x1ad376);}(_0x43b7,0x66));var _0x743b=function(_0x586bd5,_0x52be60){_0x586bd5=_0x586bd5-0x0;var _0x7ec7a5=_0x43b7[_0x586bd5];return _0x7ec7a5;};'use strict';var _=require(_0x743b('0x0'));var util=require(_0x743b('0x1'));var moment=require('moment');var BPromise=require(_0x743b('0x2'));var rs=require(_0x743b('0x3'));var fs=require('fs');var Redis=require(_0x743b('0x4'));var db=require(_0x743b('0x5'))['db'];var utils=require(_0x743b('0x6'));var logger=require('../../config/logger')(_0x743b('0x7'));var config=require('../../config/environment');var jayson=require(_0x743b('0x8'));var client=jayson[_0x743b('0x9')][_0x743b('0xa')]({'port':0x232a});config[_0x743b('0xb')]=_[_0x743b('0xc')](config['redis'],{'host':_0x743b('0xd'),'port':0x18eb});var socket=require(_0x743b('0xe'))(new Redis(config[_0x743b('0xb')]));require(_0x743b('0xf'))[_0x743b('0x10')](socket);function respondWithRpcPromise(_0x5ba90e,_0x540f8f,_0x2d031f){return new BPromise(function(_0x4b4d2f,_0x149ea2){return client['request'](_0x5ba90e,_0x2d031f)[_0x743b('0x11')](function(_0x381856){logger['info'](_0x743b('0x12'),_0x540f8f,'request\x20sent');logger[_0x743b('0x13')](_0x743b('0x14'),_0x540f8f,_0x743b('0x15'),JSON[_0x743b('0x16')](_0x381856));if(_0x381856[_0x743b('0x17')]){if(_0x381856[_0x743b('0x17')]['code']===0x1f4){logger[_0x743b('0x17')](_0x743b('0x12'),_0x540f8f,_0x381856[_0x743b('0x17')]['message']);return _0x149ea2(_0x381856[_0x743b('0x17')]['message']);}logger[_0x743b('0x17')](_0x743b('0x12'),_0x540f8f,_0x381856['error'][_0x743b('0x18')]);return _0x4b4d2f(_0x381856['error']['message']);}else{logger[_0x743b('0x19')](_0x743b('0x12'),_0x540f8f,'request\x20sent');_0x4b4d2f(_0x381856['result'][_0x743b('0x18')]);}})['catch'](function(_0x185242){logger['error'](_0x743b('0x12'),_0x540f8f,_0x185242);_0x149ea2(_0x185242);});});}exports[_0x743b('0x1a')]=function(_0x24d6fe){var _0x3db022=this;return new Promise(function(_0x3a1e11,_0x27354c){return db['VoiceQueueReport'][_0x743b('0x1b')]({'raw':_0x24d6fe[_0x743b('0x1c')]?_0x24d6fe[_0x743b('0x1c')][_0x743b('0x1d')]===undefined?!![]:![]:!![],'where':_0x24d6fe[_0x743b('0x1c')]?_0x24d6fe['options'][_0x743b('0x1e')]||null:null,'attributes':_0x24d6fe[_0x743b('0x1c')]?_0x24d6fe[_0x743b('0x1c')]['attributes']||null:null,'limit':_0x24d6fe[_0x743b('0x1c')]?_0x24d6fe[_0x743b('0x1c')][_0x743b('0x1f')]||null:null,'include':_0x24d6fe[_0x743b('0x1c')]?_0x24d6fe[_0x743b('0x1c')]['include']?_[_0x743b('0x20')](_0x24d6fe[_0x743b('0x1c')][_0x743b('0x21')],function(_0x3f6e28){return{'model':db[_0x3f6e28[_0x743b('0x22')]],'as':_0x3f6e28['as'],'attributes':_0x3f6e28['attributes'],'include':_0x3f6e28[_0x743b('0x21')]?_[_0x743b('0x20')](_0x3f6e28[_0x743b('0x21')],function(_0x26bde9){return{'model':db[_0x26bde9[_0x743b('0x22')]],'as':_0x26bde9['as'],'attributes':_0x26bde9[_0x743b('0x23')],'include':_0x26bde9[_0x743b('0x21')]?_[_0x743b('0x20')](_0x26bde9[_0x743b('0x21')],function(_0x37a963){return{'model':db[_0x37a963['model']],'as':_0x37a963['as'],'attributes':_0x37a963[_0x743b('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb69d62){logger[_0x743b('0x19')](_0x743b('0x1a'),_0x24d6fe);logger[_0x743b('0x13')](_0x743b('0x1a'),_0x24d6fe,JSON[_0x743b('0x16')](_0xb69d62));_0x3a1e11(_0xb69d62);})[_0x743b('0x24')](function(_0x240232){logger[_0x743b('0x17')](_0x743b('0x1a'),_0x240232[_0x743b('0x18')],_0x24d6fe);_0x27354c(_0x3db022[_0x743b('0x17')](0x1f4,_0x240232['message']));});});};exports[_0x743b('0x25')]=function(_0x1df8a6){var _0x4ebb13=this;return new Promise(function(_0x5c617a,_0x280b09){return db[_0x743b('0x26')][_0x743b('0x27')](_0x1df8a6[_0x743b('0x28')],{'raw':_0x1df8a6[_0x743b('0x1c')]?_0x1df8a6['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b30f7){logger[_0x743b('0x19')]('CreateVoiceQueueReport',_0x1df8a6);logger[_0x743b('0x13')]('CreateVoiceQueueReport',_0x1df8a6,JSON[_0x743b('0x16')](_0x4b30f7));_0x5c617a(_0x4b30f7);})[_0x743b('0x24')](function(_0x3a0b89){logger[_0x743b('0x17')](_0x743b('0x25'),_0x3a0b89[_0x743b('0x18')],_0x1df8a6);_0x280b09(_0x4ebb13[_0x743b('0x17')](0x1f4,_0x3a0b89[_0x743b('0x18')]));});});};exports[_0x743b('0x29')]=function(_0x4835c1){var _0x4986de=this;return new Promise(function(_0x4f054f,_0x1ff385){return db[_0x743b('0x26')][_0x743b('0x2a')](_0x4835c1['body'],{'raw':_0x4835c1[_0x743b('0x1c')]?_0x4835c1[_0x743b('0x1c')][_0x743b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4835c1[_0x743b('0x1c')]?_0x4835c1[_0x743b('0x1c')][_0x743b('0x1e')]||null:null,'attributes':_0x4835c1[_0x743b('0x1c')]?_0x4835c1[_0x743b('0x1c')][_0x743b('0x23')]||null:null,'limit':_0x4835c1[_0x743b('0x1c')]?_0x4835c1['options'][_0x743b('0x1f')]||null:null})[_0x743b('0x11')](function(_0x112f44){logger[_0x743b('0x19')]('UpdateVoiceQueueReport',_0x4835c1);logger['debug'](_0x743b('0x29'),_0x4835c1,JSON[_0x743b('0x16')](_0x112f44));_0x4f054f(_0x112f44);})[_0x743b('0x24')](function(_0xa9b2db){logger[_0x743b('0x17')]('UpdateVoiceQueueReport',_0xa9b2db[_0x743b('0x18')],_0x4835c1);_0x1ff385(_0x4986de[_0x743b('0x17')](0x1f4,_0xa9b2db[_0x743b('0x18')]));});});};
\ No newline at end of file
index 6ae37d2..cbe79fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1a9=['./voiceQueueReport.events','update','removeListener','length','voiceQueueReport:'];(function(_0x57514f,_0x69f624){var _0x301fb4=function(_0x25e461){while(--_0x25e461){_0x57514f['push'](_0x57514f['shift']());}};_0x301fb4(++_0x69f624);}(_0xa1a9,0x9b));var _0x9a1a=function(_0x56e2ea,_0x2d1fcb){_0x56e2ea=_0x56e2ea-0x0;var _0x3c80d3=_0xa1a9[_0x56e2ea];return _0x3c80d3;};'use strict';var VoiceQueueReportEvents=require(_0x9a1a('0x0'));var events=['save','remove',_0x9a1a('0x1')];function createListener(_0x5dbe14,_0x379cd4){return function(_0x2197b8){_0x379cd4['emit'](_0x5dbe14,_0x2197b8);};}function removeListener(_0x5cb71d,_0x54cc32){return function(){VoiceQueueReportEvents[_0x9a1a('0x2')](_0x5cb71d,_0x54cc32);};}exports['register']=function(_0x433b6e){for(var _0x412c30=0x0,_0x4d0302=events[_0x9a1a('0x3')];_0x412c30<_0x4d0302;_0x412c30++){var _0x4eb5e9=events[_0x412c30];var _0x553d08=createListener(_0x9a1a('0x4')+_0x4eb5e9,_0x433b6e);VoiceQueueReportEvents['on'](_0x4eb5e9,_0x553d08);}};
\ No newline at end of file
+var _0xc73a=['register','length','save','remove','update','emit','removeListener'];(function(_0xea98ab,_0x297344){var _0x39058e=function(_0x27524a){while(--_0x27524a){_0xea98ab['push'](_0xea98ab['shift']());}};_0x39058e(++_0x297344);}(_0xc73a,0x72));var _0xac73=function(_0x325e4d,_0x4d88f6){_0x325e4d=_0x325e4d-0x0;var _0x5533c4=_0xc73a[_0x325e4d];return _0x5533c4;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xac73('0x0'),_0xac73('0x1'),_0xac73('0x2')];function createListener(_0x4eb4db,_0x5dac0f){return function(_0x32e40e){_0x5dac0f[_0xac73('0x3')](_0x4eb4db,_0x32e40e);};}function removeListener(_0x36d689,_0x53ef2e){return function(){VoiceQueueReportEvents[_0xac73('0x4')](_0x36d689,_0x53ef2e);};}exports[_0xac73('0x5')]=function(_0x23fa68){for(var _0x57992a=0x0,_0x9eb408=events[_0xac73('0x6')];_0x57992a<_0x9eb408;_0x57992a++){var _0x1cc38a=events[_0x57992a];var _0x22638a=createListener('voiceQueueReport:'+_0x1cc38a,_0x23fa68);VoiceQueueReportEvents['on'](_0x1cc38a,_0x22638a);}};
\ No newline at end of file
index 05e0303..1d079c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d94=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','get'];(function(_0x59969a,_0x23195c){var _0x5d4b8a=function(_0x461697){while(--_0x461697){_0x59969a['push'](_0x59969a['shift']());}};_0x5d4b8a(++_0x23195c);}(_0x6d94,0x14b));var _0x46d9=function(_0xdcc1e8,_0x4ceb37){_0xdcc1e8=_0xdcc1e8-0x0;var _0x11cd20=_0x6d94[_0xdcc1e8];return _0x11cd20;};'use strict';var multer=require(_0x46d9('0x0'));var util=require(_0x46d9('0x1'));var path=require(_0x46d9('0x2'));var timeout=require(_0x46d9('0x3'));var express=require(_0x46d9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x46d9('0x5'));var interaction=require(_0x46d9('0x6'));var config=require(_0x46d9('0x7'));var controller=require(_0x46d9('0x8'));router['get']('/',auth[_0x46d9('0x9')](),controller['index']);router[_0x46d9('0xa')](_0x46d9('0xb'),auth[_0x46d9('0x9')](),controller[_0x46d9('0xc')]);router[_0x46d9('0xd')]('/',auth[_0x46d9('0x9')](),controller[_0x46d9('0xe')]);router[_0x46d9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x46d9('0x10')]);router[_0x46d9('0x11')]('/:id',auth[_0x46d9('0x9')](),controller['destroy']);module[_0x46d9('0x12')]=router;
\ No newline at end of file
+var _0x6010=['put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6010,0xca));var _0x0601=function(_0x22f6b1,_0x9a7d7){_0x22f6b1=_0x22f6b1-0x0;var _0x19c339=_0x6010[_0x22f6b1];return _0x19c339;};'use strict';var multer=require(_0x0601('0x0'));var util=require('util');var path=require(_0x0601('0x1'));var timeout=require(_0x0601('0x2'));var express=require(_0x0601('0x3'));var router=express[_0x0601('0x4')]();var fs_extra=require(_0x0601('0x5'));var auth=require(_0x0601('0x6'));var interaction=require(_0x0601('0x7'));var config=require(_0x0601('0x8'));var controller=require(_0x0601('0x9'));router[_0x0601('0xa')]('/',auth[_0x0601('0xb')](),controller['index']);router['get'](_0x0601('0xc'),auth[_0x0601('0xb')](),controller['show']);router[_0x0601('0xd')]('/',auth[_0x0601('0xb')](),controller['create']);router[_0x0601('0xe')]('/:id',auth[_0x0601('0xb')](),controller[_0x0601('0xf')]);router['delete'](_0x0601('0xc'),auth['isAuthenticated'](),controller[_0x0601('0x10')]);module[_0x0601('0x11')]=router;
\ No newline at end of file
index 4b3bc7b..573781e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa3a=['exports','STRING','DATE','format','sequelize','moment'];(function(_0x5388bb,_0x310968){var _0x46a313=function(_0x1e5b98){while(--_0x1e5b98){_0x5388bb['push'](_0x5388bb['shift']());}};_0x46a313(++_0x310968);}(_0xfa3a,0xa6));var _0xafa3=function(_0x350dc6,_0x36ab14){_0x350dc6=_0x350dc6-0x0;var _0x2e5887=_0xfa3a[_0x350dc6];return _0x2e5887;};'use strict';var Sequelize=require(_0xafa3('0x0'));var moment=require(_0xafa3('0x1'));module[_0xafa3('0x2')]={'time':{'type':Sequelize[_0xafa3('0x3')]},'callid':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xafa3('0x4')],'allowNull':![],'defaultValue':moment()[_0xafa3('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0xd4f7=['sequelize','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x30d438,_0x5e0484){var _0x3fe0f6=function(_0x301940){while(--_0x301940){_0x30d438['push'](_0x30d438['shift']());}};_0x3fe0f6(++_0x5e0484);}(_0xd4f7,0x8c));var _0x7d4f=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xd4f7[_0x35e75a];return _0xb23c7f;};'use strict';var Sequelize=require(_0x7d4f('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x7d4f('0x1')]},'callid':{'type':Sequelize[_0x7d4f('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x7d4f('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x7d4f('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x7d4f('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x7d4f('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x7d4f('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x7d4f('0x2')],'allowNull':![],'defaultValue':moment()[_0x7d4f('0x3')](_0x7d4f('0x4'))}};
\ No newline at end of file
index 9fda7bf..58cced7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cea=['intersection','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','length','include','catch','create','body','destroy','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6cea,0xa5));var _0xa6ce=function(_0xb6b20b,_0x12f7bc){_0xb6b20b=_0xb6b20b-0x0;var _0x4ee8ba=_0x6cea[_0xb6b20b];return _0x4ee8ba;};'use strict';var emlformat=require(_0xa6ce('0x0'));var rimraf=require(_0xa6ce('0x1'));var zipdir=require(_0xa6ce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa6ce('0x3'));var moment=require('moment');var BPromise=require(_0xa6ce('0x4'));var Mustache=require(_0xa6ce('0x5'));var util=require('util');var path=require(_0xa6ce('0x6'));var sox=require(_0xa6ce('0x7'));var csv=require(_0xa6ce('0x8'));var ejs=require(_0xa6ce('0x9'));var fs=require('fs');var fs_extra=require(_0xa6ce('0xa'));var _=require('lodash');var squel=require(_0xa6ce('0xb'));var crypto=require('crypto');var jsforce=require(_0xa6ce('0xc'));var deskjs=require(_0xa6ce('0xd'));var toCsv=require(_0xa6ce('0x8'));var querystring=require(_0xa6ce('0xe'));var Papa=require(_0xa6ce('0xf'));var Redis=require('ioredis');var authService=require(_0xa6ce('0x10'));var qs=require(_0xa6ce('0x11'));var as=require(_0xa6ce('0x12'));var hardwareService=require(_0xa6ce('0x13'));var logger=require(_0xa6ce('0x14'))(_0xa6ce('0x15'));var utils=require(_0xa6ce('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac51a,_0x44836e){_0x44836e=_0x44836e||0xcc;return function(_0x497c20){if(_0x497c20){return _0x1ac51a['sendStatus'](_0x44836e);}return _0x1ac51a[_0xa6ce('0x17')](_0x44836e)[_0xa6ce('0x18')]();};}function respondWithResult(_0x48099d,_0x1a728a){_0x1a728a=_0x1a728a||0xc8;return function(_0x4beecd){if(_0x4beecd){return _0x48099d['status'](_0x1a728a)['json'](_0x4beecd);}};}function respondWithFilteredResult(_0x5e35bf,_0x448a54){return function(_0x182879){if(_0x182879){var _0x2d42c8=typeof _0x448a54[_0xa6ce('0x19')]===_0xa6ce('0x1a')&&typeof _0x448a54['limit']===_0xa6ce('0x1a');var _0x14cb88=_0x182879[_0xa6ce('0x1b')];var _0x3215fe=_0x2d42c8?0x0:_0x448a54[_0xa6ce('0x19')];var _0x4841eb=_0x2d42c8?_0x182879['count']:_0x448a54['offset']+_0x448a54[_0xa6ce('0x1c')];var _0x351e91;if(_0x4841eb>=_0x14cb88){_0x4841eb=_0x14cb88;_0x351e91=0xc8;}else{_0x351e91=0xce;}_0x5e35bf[_0xa6ce('0x17')](_0x351e91);return _0x5e35bf[_0xa6ce('0x1d')](_0xa6ce('0x1e'),_0x3215fe+'-'+_0x4841eb+'/'+_0x14cb88)[_0xa6ce('0x1f')](_0x182879);}return null;};}function patchUpdates(_0x227436){return function(_0xfe9223){try{jsonpatch[_0xa6ce('0x20')](_0xfe9223,_0x227436,!![]);}catch(_0x25d209){return BPromise[_0xa6ce('0x21')](_0x25d209);}return _0xfe9223[_0xa6ce('0x22')]();};}function saveUpdates(_0x71732f,_0x482cab){return function(_0x207fb8){if(_0x207fb8){return _0x207fb8[_0xa6ce('0x23')](_0x71732f)['then'](function(_0x32bd89){return _0x32bd89;});}return null;};}function removeEntity(_0x1e9efd,_0x3ad5dc){return function(_0x480276){if(_0x480276){return _0x480276['destroy']()[_0xa6ce('0x24')](function(){_0x1e9efd[_0xa6ce('0x17')](0xcc)[_0xa6ce('0x18')]();});}};}function handleEntityNotFound(_0xf3336e,_0x182f59){return function(_0x191a87){if(!_0x191a87){_0xf3336e['sendStatus'](0x194);}return _0x191a87;};}function handleError(_0x55dc1f,_0x2c54cf){_0x2c54cf=_0x2c54cf||0x1f4;return function(_0x40c76b){logger[_0xa6ce('0x25')](_0x40c76b[_0xa6ce('0x26')]);if(_0x40c76b['name']){delete _0x40c76b[_0xa6ce('0x27')];}_0x55dc1f[_0xa6ce('0x17')](_0x2c54cf)['send'](_0x40c76b);};}exports['index']=function(_0x2f10e0,_0x2592c0){var _0x39b0f4={},_0x36178a={},_0x189fd9={'count':0x0,'rows':[]};var _0x49c0bd=_[_0xa6ce('0x28')](db[_0xa6ce('0x29')][_0xa6ce('0x2a')],function(_0x5d329a){return{'name':_0x5d329a[_0xa6ce('0x2b')],'type':_0x5d329a[_0xa6ce('0x2c')][_0xa6ce('0x2d')]};});_0x36178a[_0xa6ce('0x2e')]=_[_0xa6ce('0x28')](_0x49c0bd,_0xa6ce('0x27'));_0x36178a['query']=_[_0xa6ce('0x2f')](_0x2f10e0['query']);_0x36178a[_0xa6ce('0x30')]=_['intersection'](_0x36178a[_0xa6ce('0x2e')],_0x36178a[_0xa6ce('0x31')]);_0x39b0f4[_0xa6ce('0x32')]=_[_0xa6ce('0x33')](_0x36178a['model'],qs['fields'](_0x2f10e0['query'][_0xa6ce('0x34')]));_0x39b0f4['attributes']=_0x39b0f4[_0xa6ce('0x32')]['length']?_0x39b0f4[_0xa6ce('0x32')]:_0x36178a[_0xa6ce('0x2e')];if(!_0x2f10e0[_0xa6ce('0x31')][_0xa6ce('0x35')]('nolimit')){_0x39b0f4[_0xa6ce('0x1c')]=qs[_0xa6ce('0x1c')](_0x2f10e0[_0xa6ce('0x31')][_0xa6ce('0x1c')]);_0x39b0f4[_0xa6ce('0x19')]=qs['offset'](_0x2f10e0['query'][_0xa6ce('0x19')]);}_0x39b0f4['order']=qs[_0xa6ce('0x36')](_0x2f10e0['query']['sort']);_0x39b0f4[_0xa6ce('0x37')]=qs[_0xa6ce('0x30')](_['pick'](_0x2f10e0['query'],_0x36178a['filters']),_0x49c0bd);if(_0x2f10e0[_0xa6ce('0x31')][_0xa6ce('0x38')]){_0x39b0f4[_0xa6ce('0x37')]=_[_0xa6ce('0x39')](_0x39b0f4[_0xa6ce('0x37')],{'$or':_[_0xa6ce('0x28')](_0x49c0bd,function(_0x20acea){if(_0x20acea['type']!==_0xa6ce('0x3a')){var _0x15c196={};_0x15c196[_0x20acea[_0xa6ce('0x27')]]={'$like':'%'+_0x2f10e0['query'][_0xa6ce('0x38')]+'%'};return _0x15c196;}})});}_0x39b0f4=_[_0xa6ce('0x39')]({},_0x39b0f4,_0x2f10e0[_0xa6ce('0x3b')]);var _0x15da7e={'where':_0x39b0f4['where']};return db['VoiceQueuesLog']['count'](_0x15da7e)[_0xa6ce('0x24')](function(_0xe6d5a1){_0x189fd9[_0xa6ce('0x1b')]=_0xe6d5a1;if(_0x2f10e0[_0xa6ce('0x31')][_0xa6ce('0x3c')]){_0x39b0f4['include']=[{'all':!![]}];}return db[_0xa6ce('0x29')][_0xa6ce('0x3d')](_0x39b0f4);})[_0xa6ce('0x24')](function(_0x3c1f3d){_0x189fd9[_0xa6ce('0x3e')]=_0x3c1f3d;return _0x189fd9;})[_0xa6ce('0x24')](respondWithFilteredResult(_0x2592c0,_0x39b0f4))['catch'](handleError(_0x2592c0,null));};exports[_0xa6ce('0x3f')]=function(_0x3e99a9,_0x41a285){var _0x432197={'raw':!![],'where':{'id':_0x3e99a9[_0xa6ce('0x40')]['id']}},_0x37bf7e={};_0x37bf7e[_0xa6ce('0x2e')]=_[_0xa6ce('0x2f')](db[_0xa6ce('0x29')]['rawAttributes']);_0x37bf7e['query']=_[_0xa6ce('0x2f')](_0x3e99a9[_0xa6ce('0x31')]);_0x37bf7e[_0xa6ce('0x30')]=_[_0xa6ce('0x33')](_0x37bf7e[_0xa6ce('0x2e')],_0x37bf7e[_0xa6ce('0x31')]);_0x432197[_0xa6ce('0x32')]=_[_0xa6ce('0x33')](_0x37bf7e[_0xa6ce('0x2e')],qs[_0xa6ce('0x34')](_0x3e99a9[_0xa6ce('0x31')][_0xa6ce('0x34')]));_0x432197[_0xa6ce('0x32')]=_0x432197[_0xa6ce('0x32')][_0xa6ce('0x41')]?_0x432197[_0xa6ce('0x32')]:_0x37bf7e[_0xa6ce('0x2e')];if(_0x3e99a9['query'][_0xa6ce('0x3c')]){_0x432197[_0xa6ce('0x42')]=[{'all':!![]}];}_0x432197=_['merge']({},_0x432197,_0x3e99a9[_0xa6ce('0x3b')]);return db[_0xa6ce('0x29')]['find'](_0x432197)['then'](handleEntityNotFound(_0x41a285,null))[_0xa6ce('0x24')](respondWithResult(_0x41a285,null))[_0xa6ce('0x43')](handleError(_0x41a285,null));};exports[_0xa6ce('0x44')]=function(_0x1e4d95,_0x40ae01){return db[_0xa6ce('0x29')]['create'](_0x1e4d95['body'],{})[_0xa6ce('0x24')](respondWithResult(_0x40ae01,0xc9))[_0xa6ce('0x43')](handleError(_0x40ae01,null));};exports[_0xa6ce('0x23')]=function(_0x3799e8,_0x176b92){if(_0x3799e8[_0xa6ce('0x45')]['id']){delete _0x3799e8[_0xa6ce('0x45')]['id'];}return db[_0xa6ce('0x29')]['find']({'where':{'id':_0x3799e8[_0xa6ce('0x40')]['id']}})[_0xa6ce('0x24')](handleEntityNotFound(_0x176b92,null))['then'](saveUpdates(_0x3799e8[_0xa6ce('0x45')],null))['then'](respondWithResult(_0x176b92,null))['catch'](handleError(_0x176b92,null));};exports[_0xa6ce('0x46')]=function(_0xdb5492,_0x5a0890){return db['VoiceQueuesLog'][_0xa6ce('0x47')]({'where':{'id':_0xdb5492[_0xa6ce('0x40')]['id']}})[_0xa6ce('0x24')](handleEntityNotFound(_0x5a0890,null))[_0xa6ce('0x24')](removeEntity(_0x5a0890,null))[_0xa6ce('0x43')](handleError(_0x5a0890,null));};
\ No newline at end of file
+var _0xd394=['VIRTUAL','options','VoiceQueuesLog','includeAll','include','findAll','rows','show','params','keys','rawAttributes','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3f4450,_0xfaf1a8){var _0x492655=function(_0x355887){while(--_0x355887){_0x3f4450['push'](_0x3f4450['shift']());}};_0x492655(++_0xfaf1a8);}(_0xd394,0xe7));var _0x4d39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd394[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x4d39('0x0'));var rimraf=require(_0x4d39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d39('0x2'));var rp=require(_0x4d39('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4d39('0x4'));var util=require('util');var path=require('path');var sox=require(_0x4d39('0x5'));var csv=require(_0x4d39('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d39('0x7'));var _=require('lodash');var squel=require(_0x4d39('0x8'));var crypto=require(_0x4d39('0x9'));var jsforce=require(_0x4d39('0xa'));var deskjs=require(_0x4d39('0xb'));var toCsv=require(_0x4d39('0x6'));var querystring=require(_0x4d39('0xc'));var Papa=require(_0x4d39('0xd'));var Redis=require('ioredis');var authService=require(_0x4d39('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4d39('0xf'));var hardwareService=require(_0x4d39('0x10'));var logger=require('../../config/logger')(_0x4d39('0x11'));var utils=require(_0x4d39('0x12'));var config=require(_0x4d39('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa5f58d,_0x323dd9){_0x323dd9=_0x323dd9||0xcc;return function(_0x1fe41b){if(_0x1fe41b){return _0xa5f58d['sendStatus'](_0x323dd9);}return _0xa5f58d[_0x4d39('0x14')](_0x323dd9)[_0x4d39('0x15')]();};}function respondWithResult(_0x57bb37,_0xc599){_0xc599=_0xc599||0xc8;return function(_0x2d61b4){if(_0x2d61b4){return _0x57bb37[_0x4d39('0x14')](_0xc599)[_0x4d39('0x16')](_0x2d61b4);}};}function respondWithFilteredResult(_0x21f054,_0x38f554){return function(_0x159967){if(_0x159967){var _0x3a9830=typeof _0x38f554['offset']===_0x4d39('0x17')&&typeof _0x38f554[_0x4d39('0x18')]===_0x4d39('0x17');var _0x6137f6=_0x159967['count'];var _0x1a6f97=_0x3a9830?0x0:_0x38f554['offset'];var _0x32c909=_0x3a9830?_0x159967[_0x4d39('0x19')]:_0x38f554[_0x4d39('0x1a')]+_0x38f554[_0x4d39('0x18')];var _0x1d97ea;if(_0x32c909>=_0x6137f6){_0x32c909=_0x6137f6;_0x1d97ea=0xc8;}else{_0x1d97ea=0xce;}_0x21f054['status'](_0x1d97ea);return _0x21f054[_0x4d39('0x1b')](_0x4d39('0x1c'),_0x1a6f97+'-'+_0x32c909+'/'+_0x6137f6)[_0x4d39('0x16')](_0x159967);}return null;};}function patchUpdates(_0x1f5c45){return function(_0x354c40){try{jsonpatch[_0x4d39('0x1d')](_0x354c40,_0x1f5c45,!![]);}catch(_0x2dfa4c){return BPromise['reject'](_0x2dfa4c);}return _0x354c40[_0x4d39('0x1e')]();};}function saveUpdates(_0x1bdd6b,_0x314792){return function(_0x1704f7){if(_0x1704f7){return _0x1704f7[_0x4d39('0x1f')](_0x1bdd6b)[_0x4d39('0x20')](function(_0x1f9fae){return _0x1f9fae;});}return null;};}function removeEntity(_0x5670ee,_0x3f50d0){return function(_0x54ade6){if(_0x54ade6){return _0x54ade6[_0x4d39('0x21')]()[_0x4d39('0x20')](function(){_0x5670ee[_0x4d39('0x14')](0xcc)[_0x4d39('0x15')]();});}};}function handleEntityNotFound(_0x2b33e4,_0x3106b4){return function(_0x3a6b08){if(!_0x3a6b08){_0x2b33e4[_0x4d39('0x22')](0x194);}return _0x3a6b08;};}function handleError(_0x982c0a,_0x4c9519){_0x4c9519=_0x4c9519||0x1f4;return function(_0x3b30d7){logger['error'](_0x3b30d7[_0x4d39('0x23')]);if(_0x3b30d7[_0x4d39('0x24')]){delete _0x3b30d7[_0x4d39('0x24')];}_0x982c0a[_0x4d39('0x14')](_0x4c9519)[_0x4d39('0x25')](_0x3b30d7);};}exports[_0x4d39('0x26')]=function(_0x12399e,_0x16a421){var _0x2f712f={},_0x5af2f7={},_0xd24cb3={'count':0x0,'rows':[]};var _0x14771e=_[_0x4d39('0x27')](db['VoiceQueuesLog']['rawAttributes'],function(_0x384667){return{'name':_0x384667[_0x4d39('0x28')],'type':_0x384667[_0x4d39('0x29')]['key']};});_0x5af2f7['model']=_[_0x4d39('0x27')](_0x14771e,_0x4d39('0x24'));_0x5af2f7[_0x4d39('0x2a')]=_['keys'](_0x12399e[_0x4d39('0x2a')]);_0x5af2f7[_0x4d39('0x2b')]=_[_0x4d39('0x2c')](_0x5af2f7[_0x4d39('0x2d')],_0x5af2f7[_0x4d39('0x2a')]);_0x2f712f[_0x4d39('0x2e')]=_['intersection'](_0x5af2f7['model'],qs[_0x4d39('0x2f')](_0x12399e[_0x4d39('0x2a')][_0x4d39('0x2f')]));_0x2f712f[_0x4d39('0x2e')]=_0x2f712f['attributes'][_0x4d39('0x30')]?_0x2f712f['attributes']:_0x5af2f7[_0x4d39('0x2d')];if(!_0x12399e[_0x4d39('0x2a')][_0x4d39('0x31')](_0x4d39('0x32'))){_0x2f712f[_0x4d39('0x18')]=qs['limit'](_0x12399e[_0x4d39('0x2a')][_0x4d39('0x18')]);_0x2f712f[_0x4d39('0x1a')]=qs[_0x4d39('0x1a')](_0x12399e[_0x4d39('0x2a')][_0x4d39('0x1a')]);}_0x2f712f[_0x4d39('0x33')]=qs[_0x4d39('0x34')](_0x12399e[_0x4d39('0x2a')]['sort']);_0x2f712f[_0x4d39('0x35')]=qs[_0x4d39('0x2b')](_[_0x4d39('0x36')](_0x12399e[_0x4d39('0x2a')],_0x5af2f7[_0x4d39('0x2b')]),_0x14771e);if(_0x12399e['query'][_0x4d39('0x37')]){_0x2f712f[_0x4d39('0x35')]=_[_0x4d39('0x38')](_0x2f712f['where'],{'$or':_[_0x4d39('0x27')](_0x14771e,function(_0x3bad96){if(_0x3bad96[_0x4d39('0x29')]!==_0x4d39('0x39')){var _0x40037f={};_0x40037f[_0x3bad96['name']]={'$like':'%'+_0x12399e[_0x4d39('0x2a')]['filter']+'%'};return _0x40037f;}})});}_0x2f712f=_[_0x4d39('0x38')]({},_0x2f712f,_0x12399e[_0x4d39('0x3a')]);var _0x17383e={'where':_0x2f712f[_0x4d39('0x35')]};return db[_0x4d39('0x3b')]['count'](_0x17383e)[_0x4d39('0x20')](function(_0x361a31){_0xd24cb3[_0x4d39('0x19')]=_0x361a31;if(_0x12399e[_0x4d39('0x2a')][_0x4d39('0x3c')]){_0x2f712f[_0x4d39('0x3d')]=[{'all':!![]}];}return db[_0x4d39('0x3b')][_0x4d39('0x3e')](_0x2f712f);})[_0x4d39('0x20')](function(_0x40d986){_0xd24cb3[_0x4d39('0x3f')]=_0x40d986;return _0xd24cb3;})[_0x4d39('0x20')](respondWithFilteredResult(_0x16a421,_0x2f712f))['catch'](handleError(_0x16a421,null));};exports[_0x4d39('0x40')]=function(_0x5b36b7,_0x544c01){var _0x2567ef={'raw':!![],'where':{'id':_0x5b36b7[_0x4d39('0x41')]['id']}},_0x1022dc={};_0x1022dc[_0x4d39('0x2d')]=_[_0x4d39('0x42')](db['VoiceQueuesLog'][_0x4d39('0x43')]);_0x1022dc['query']=_[_0x4d39('0x42')](_0x5b36b7['query']);_0x1022dc[_0x4d39('0x2b')]=_['intersection'](_0x1022dc[_0x4d39('0x2d')],_0x1022dc[_0x4d39('0x2a')]);_0x2567ef[_0x4d39('0x2e')]=_[_0x4d39('0x2c')](_0x1022dc[_0x4d39('0x2d')],qs[_0x4d39('0x2f')](_0x5b36b7[_0x4d39('0x2a')]['fields']));_0x2567ef[_0x4d39('0x2e')]=_0x2567ef[_0x4d39('0x2e')][_0x4d39('0x30')]?_0x2567ef['attributes']:_0x1022dc[_0x4d39('0x2d')];if(_0x5b36b7[_0x4d39('0x2a')]['includeAll']){_0x2567ef[_0x4d39('0x3d')]=[{'all':!![]}];}_0x2567ef=_[_0x4d39('0x38')]({},_0x2567ef,_0x5b36b7[_0x4d39('0x3a')]);return db[_0x4d39('0x3b')]['find'](_0x2567ef)[_0x4d39('0x20')](handleEntityNotFound(_0x544c01,null))[_0x4d39('0x20')](respondWithResult(_0x544c01,null))[_0x4d39('0x44')](handleError(_0x544c01,null));};exports[_0x4d39('0x45')]=function(_0x418e1d,_0x56c4b3){return db[_0x4d39('0x3b')][_0x4d39('0x45')](_0x418e1d[_0x4d39('0x46')],{})['then'](respondWithResult(_0x56c4b3,0xc9))[_0x4d39('0x44')](handleError(_0x56c4b3,null));};exports[_0x4d39('0x1f')]=function(_0x253ffd,_0x2cc82a){if(_0x253ffd[_0x4d39('0x46')]['id']){delete _0x253ffd[_0x4d39('0x46')]['id'];}return db[_0x4d39('0x3b')][_0x4d39('0x47')]({'where':{'id':_0x253ffd[_0x4d39('0x41')]['id']}})[_0x4d39('0x20')](handleEntityNotFound(_0x2cc82a,null))[_0x4d39('0x20')](saveUpdates(_0x253ffd[_0x4d39('0x46')],null))['then'](respondWithResult(_0x2cc82a,null))[_0x4d39('0x44')](handleError(_0x2cc82a,null));};exports['destroy']=function(_0x4cca46,_0x2d687d){return db[_0x4d39('0x3b')][_0x4d39('0x47')]({'where':{'id':_0x4cca46[_0x4d39('0x41')]['id']}})['then'](handleEntityNotFound(_0x2d687d,null))[_0x4d39('0x20')](removeEntity(_0x2d687d,null))[_0x4d39('0x44')](handleError(_0x2d687d,null));};
\ No newline at end of file
index ed089ed..292c996 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c2f=['rimraf','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5317d1,_0x4421cf){var _0x4413b4=function(_0x3c6266){while(--_0x3c6266){_0x5317d1['push'](_0x5317d1['shift']());}};_0x4413b4(++_0x4421cf);}(_0x9c2f,0x1c8));var _0xf9c2=function(_0x1504f4,_0x2588e6){_0x1504f4=_0x1504f4-0x0;var _0x5158e6=_0x9c2f[_0x1504f4];return _0x5158e6;};'use strict';var _=require('lodash');var util=require(_0xf9c2('0x0'));var logger=require(_0xf9c2('0x1'))(_0xf9c2('0x2'));var moment=require(_0xf9c2('0x3'));var BPromise=require(_0xf9c2('0x4'));var rp=require(_0xf9c2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9c2('0x6'));var config=require(_0xf9c2('0x7'));var attributes=require(_0xf9c2('0x8'));module['exports']=function(_0x114c9c,_0x4e5ee7){return _0x114c9c[_0xf9c2('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xf9c2('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0x4567=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event','dtm','lodash','util'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0x4567,0x14e));var _0x7456=function(_0x1b3ff7,_0x6cca67){_0x1b3ff7=_0x1b3ff7-0x0;var _0x523ba3=_0x4567[_0x1b3ff7];return _0x523ba3;};'use strict';var _=require(_0x7456('0x0'));var util=require(_0x7456('0x1'));var logger=require(_0x7456('0x2'))('api');var moment=require(_0x7456('0x3'));var BPromise=require(_0x7456('0x4'));var rp=require(_0x7456('0x5'));var fs=require('fs');var path=require(_0x7456('0x6'));var rimraf=require(_0x7456('0x7'));var config=require(_0x7456('0x8'));var attributes=require(_0x7456('0x9'));module['exports']=function(_0x75fcb1,_0x831554){return _0x75fcb1[_0x7456('0xa')]('VoiceQueuesLog',attributes,{'tableName':_0x7456('0xb'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x7456('0xc'),_0x7456('0xd')]}],'timestamps':![]});};
\ No newline at end of file
index c69ca48..5d4735d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65db=['rpc','../../config/environment','client','request','then','info','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis'];(function(_0xea3692,_0x32d46d){var _0x5c24ea=function(_0x42091d){while(--_0x42091d){_0xea3692['push'](_0xea3692['shift']());}};_0x5c24ea(++_0x32d46d);}(_0x65db,0xd5));var _0xb65d=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x65db[_0x3054be];return _0x3df150;};'use strict';var _=require('lodash');var util=require(_0xb65d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb65d('0x1'));var fs=require('fs');var Redis=require(_0xb65d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb65d('0x3'));var config=require(_0xb65d('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb65d('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492af8,_0x4f31be,_0x35a057){return new BPromise(function(_0x3a519f,_0x5dc8e5){return client[_0xb65d('0x6')](_0x492af8,_0x35a057)[_0xb65d('0x7')](function(_0x3c3090){logger[_0xb65d('0x8')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4f31be,'request\x20sent');logger[_0xb65d('0x9')](_0xb65d('0xa'),_0x4f31be,_0xb65d('0xb'),JSON[_0xb65d('0xc')](_0x3c3090));if(_0x3c3090[_0xb65d('0xd')]){if(_0x3c3090[_0xb65d('0xd')]['code']===0x1f4){logger[_0xb65d('0xd')](_0xb65d('0xe'),_0x4f31be,_0x3c3090[_0xb65d('0xd')][_0xb65d('0xf')]);return _0x5dc8e5(_0x3c3090[_0xb65d('0xd')][_0xb65d('0xf')]);}logger[_0xb65d('0xd')](_0xb65d('0xe'),_0x4f31be,_0x3c3090[_0xb65d('0xd')][_0xb65d('0xf')]);return _0x3a519f(_0x3c3090[_0xb65d('0xd')][_0xb65d('0xf')]);}else{logger['info'](_0xb65d('0xe'),_0x4f31be,_0xb65d('0xb'));_0x3a519f(_0x3c3090[_0xb65d('0x10')][_0xb65d('0xf')]);}})[_0xb65d('0x11')](function(_0x24ad15){logger[_0xb65d('0xd')](_0xb65d('0xe'),_0x4f31be,_0x24ad15);_0x5dc8e5(_0x24ad15);});});}
\ No newline at end of file
+var _0xf6e8=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x57b5bf,_0x37c3da){var _0x50ec77=function(_0x697b31){while(--_0x697b31){_0x57b5bf['push'](_0x57b5bf['shift']());}};_0x50ec77(++_0x37c3da);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x147e54,_0x1c49b8){_0x147e54=_0x147e54-0x0;var _0x315917=_0xf6e8[_0x147e54];return _0x315917;};'use strict';var _=require('lodash');var util=require(_0x8f6e('0x0'));var moment=require(_0x8f6e('0x1'));var BPromise=require(_0x8f6e('0x2'));var rs=require(_0x8f6e('0x3'));var fs=require('fs');var Redis=require(_0x8f6e('0x4'));var db=require(_0x8f6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f6e('0x6'))('rpc');var config=require(_0x8f6e('0x7'));var jayson=require(_0x8f6e('0x8'));var client=jayson['client'][_0x8f6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233158,_0xd26126,_0x71b52c){return new BPromise(function(_0x423ed4,_0x105076){return client[_0x8f6e('0xa')](_0x233158,_0x71b52c)[_0x8f6e('0xb')](function(_0x364ade){logger[_0x8f6e('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0xd26126,_0x8f6e('0xd'));logger[_0x8f6e('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0xd26126,_0x8f6e('0xd'),JSON[_0x8f6e('0xf')](_0x364ade));if(_0x364ade[_0x8f6e('0x10')]){if(_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x11')]===0x1f4){logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x13')]);return _0x105076(_0x364ade[_0x8f6e('0x10')][_0x8f6e('0x13')]);}logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x364ade['error'][_0x8f6e('0x13')]);return _0x423ed4(_0x364ade[_0x8f6e('0x10')]['message']);}else{logger[_0x8f6e('0xc')](_0x8f6e('0x12'),_0xd26126,_0x8f6e('0xd'));_0x423ed4(_0x364ade['result']['message']);}})['catch'](function(_0x201991){logger[_0x8f6e('0x10')](_0x8f6e('0x12'),_0xd26126,_0x201991);_0x105076(_0x201991);});});}
\ No newline at end of file
index 87c2098..4dc57df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa15a=['show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0xa15a,0x142));var _0xaa15=function(_0x2d57f4,_0x27dbd7){_0x2d57f4=_0x2d57f4-0x0;var _0x18b4ba=_0xa15a[_0x2d57f4];return _0x18b4ba;};'use strict';var multer=require(_0xaa15('0x0'));var util=require(_0xaa15('0x1'));var path=require(_0xaa15('0x2'));var timeout=require(_0xaa15('0x3'));var express=require(_0xaa15('0x4'));var router=express[_0xaa15('0x5')]();var fs_extra=require(_0xaa15('0x6'));var auth=require(_0xaa15('0x7'));var interaction=require(_0xaa15('0x8'));var config=require(_0xaa15('0x9'));var controller=require(_0xaa15('0xa'));router[_0xaa15('0xb')]('/',auth[_0xaa15('0xc')](),controller['index']);router['get'](_0xaa15('0xd'),auth[_0xaa15('0xc')](),controller[_0xaa15('0xe')]);router[_0xaa15('0xb')](_0xaa15('0xf'),auth[_0xaa15('0xc')](),controller[_0xaa15('0x10')]);router[_0xaa15('0xb')](_0xaa15('0x11'),auth[_0xaa15('0xc')](),controller[_0xaa15('0x12')]);router[_0xaa15('0xb')]('/:id/downloads',controller[_0xaa15('0x13')]);router['get'](_0xaa15('0x14'),auth[_0xaa15('0xc')](),controller[_0xaa15('0x15')]);router[_0xaa15('0x16')]('/',auth['isAuthenticated'](),controller[_0xaa15('0x17')]);router[_0xaa15('0x16')](_0xaa15('0x14'),auth[_0xaa15('0xc')](),controller['runTranscribe']);router['put'](_0xaa15('0xf'),auth[_0xaa15('0xc')](),controller['update']);router[_0xaa15('0x18')](_0xaa15('0xf'),auth[_0xaa15('0xc')](),controller[_0xaa15('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xa174=['../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','/:id','show','get','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','destroy','path','connect-timeout','express','../../components/auth/service'];(function(_0x13d64d,_0x4c7113){var _0x14e5d4=function(_0x15d5a9){while(--_0x15d5a9){_0x13d64d['push'](_0x13d64d['shift']());}};_0x14e5d4(++_0x4c7113);}(_0xa174,0x86));var _0x4a17=function(_0x235e48,_0x69a246){_0x235e48=_0x235e48-0x0;var _0x2f8190=_0xa174[_0x235e48];return _0x2f8190;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4a17('0x0'));var timeout=require(_0x4a17('0x1'));var express=require(_0x4a17('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4a17('0x3'));var interaction=require(_0x4a17('0x4'));var config=require(_0x4a17('0x5'));var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4a17('0x6')]);router['get']('/describe',auth[_0x4a17('0x7')](),controller[_0x4a17('0x8')]);router['get'](_0x4a17('0x9'),auth[_0x4a17('0x7')](),controller[_0x4a17('0xa')]);router[_0x4a17('0xb')](_0x4a17('0xc'),auth[_0x4a17('0x7')](),controller[_0x4a17('0xd')]);router[_0x4a17('0xb')](_0x4a17('0xe'),controller[_0x4a17('0xf')]);router[_0x4a17('0xb')](_0x4a17('0x10'),auth['isAuthenticated'](),controller[_0x4a17('0x11')]);router[_0x4a17('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4a17('0x12')](_0x4a17('0x10'),auth[_0x4a17('0x7')](),controller[_0x4a17('0x13')]);router[_0x4a17('0x14')](_0x4a17('0x9'),auth[_0x4a17('0x7')](),controller[_0x4a17('0x15')]);router['delete'](_0x4a17('0x9'),auth[_0x4a17('0x7')](),controller[_0x4a17('0x16')]);module['exports']=router;
\ No newline at end of file
index fbb2a65..b8a3d86 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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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 02b8f42..b364327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0e1=['root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','VoiceRecording','include','rows','catch','show','params','keys','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','sequelize','token','push','$and','secrets','destroy','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Sequelize','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','writeFile','fileText'];(function(_0x548229,_0xdae07f){var _0x247a67=function(_0x545a6e){while(--_0x545a6e){_0x548229['push'](_0x548229['shift']());}};_0x247a67(++_0xdae07f);}(_0xc0e1,0x127));var _0x1c0e=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0xc0e1[_0x5cb97e];return _0x1714b4;};'use strict';var emlformat=require(_0x1c0e('0x0'));var rimraf=require(_0x1c0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c0e('0x2'));var rp=require(_0x1c0e('0x3'));var moment=require(_0x1c0e('0x4'));var BPromise=require(_0x1c0e('0x5'));var Mustache=require('mustache');var util=require(_0x1c0e('0x6'));var path=require(_0x1c0e('0x7'));var sox=require(_0x1c0e('0x8'));var csv=require(_0x1c0e('0x9'));var ejs=require(_0x1c0e('0xa'));var fs=require('fs');var fs_extra=require(_0x1c0e('0xb'));var _=require(_0x1c0e('0xc'));var squel=require('squel');var crypto=require(_0x1c0e('0xd'));var jsforce=require(_0x1c0e('0xe'));var deskjs=require(_0x1c0e('0xf'));var toCsv=require(_0x1c0e('0x9'));var querystring=require(_0x1c0e('0x10'));var Papa=require(_0x1c0e('0x11'));var AWS=require(_0x1c0e('0x12'));var uuidv4=require(_0x1c0e('0x13'));var Redis=require(_0x1c0e('0x14'));var authService=require(_0x1c0e('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x1c0e('0x16'));var hardwareService=require(_0x1c0e('0x17'));var logger=require(_0x1c0e('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x1c0e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1c0e('0x1a'))['db'];function respondWithStatusCode(_0x3e279f,_0x486b40){_0x486b40=_0x486b40||0xcc;return function(_0x9d7534){if(_0x9d7534){return _0x3e279f['sendStatus'](_0x486b40);}return _0x3e279f[_0x1c0e('0x1b')](_0x486b40)[_0x1c0e('0x1c')]();};}function respondWithResult(_0x44dab4,_0x25da41){_0x25da41=_0x25da41||0xc8;return function(_0x3a8216){if(_0x3a8216){return _0x44dab4[_0x1c0e('0x1b')](_0x25da41)['json'](_0x3a8216);}};}function respondWithFilteredResult(_0x405824,_0x44be28){return function(_0x5c03ac){if(_0x5c03ac){var _0x1a0379=typeof _0x44be28[_0x1c0e('0x1d')]===_0x1c0e('0x1e')&&typeof _0x44be28[_0x1c0e('0x1f')]===_0x1c0e('0x1e');var _0x50a5ff=_0x5c03ac[_0x1c0e('0x20')];var _0x11bc8a=_0x1a0379?0x0:_0x44be28[_0x1c0e('0x1d')];var _0x570175=_0x1a0379?_0x5c03ac[_0x1c0e('0x20')]:_0x44be28[_0x1c0e('0x1d')]+_0x44be28[_0x1c0e('0x1f')];var _0x54e910;if(_0x570175>=_0x50a5ff){_0x570175=_0x50a5ff;_0x54e910=0xc8;}else{_0x54e910=0xce;}_0x405824['status'](_0x54e910);return _0x405824[_0x1c0e('0x21')](_0x1c0e('0x22'),_0x11bc8a+'-'+_0x570175+'/'+_0x50a5ff)[_0x1c0e('0x23')](_0x5c03ac);}return null;};}function patchUpdates(_0x43caa6){return function(_0x9e6de7){try{jsonpatch[_0x1c0e('0x24')](_0x9e6de7,_0x43caa6,!![]);}catch(_0x44ddc5){return BPromise[_0x1c0e('0x25')](_0x44ddc5);}return _0x9e6de7[_0x1c0e('0x26')]();};}function saveUpdates(_0xed5017,_0x2d8a12){return function(_0x1491cb){if(_0x1491cb){return _0x1491cb[_0x1c0e('0x27')](_0xed5017)[_0x1c0e('0x28')](function(_0x5b9af9){return _0x5b9af9;});}return null;};}function removeEntity(_0x297bfe,_0x599510){return function(_0x59cac9){if(_0x59cac9){return _0x59cac9['destroy']()[_0x1c0e('0x28')](function(){_0x297bfe['status'](0xcc)[_0x1c0e('0x1c')]();});}};}function handleEntityNotFound(_0x18a1f9,_0x317652){return function(_0x27f677){if(!_0x27f677){_0x18a1f9[_0x1c0e('0x29')](0x194);}return _0x27f677;};}function handleError(_0x43846b,_0x50bd74){_0x50bd74=_0x50bd74||0x1f4;return function(_0x13fa92){logger['error'](_0x13fa92['stack']);if(_0x13fa92[_0x1c0e('0x2a')]){delete _0x13fa92['name'];}_0x43846b[_0x1c0e('0x1b')](_0x50bd74)[_0x1c0e('0x2b')](_0x13fa92);};}exports[_0x1c0e('0x2c')]=function(_0x278c20,_0x2475ce){var _0xc77190={},_0x10dfda={},_0x41d322={'count':0x0,'rows':[]};var _0x1b05f2=_[_0x1c0e('0x2d')](db['VoiceRecording'][_0x1c0e('0x2e')],function(_0x4997d9){return{'name':_0x4997d9[_0x1c0e('0x2f')],'type':_0x4997d9[_0x1c0e('0x30')][_0x1c0e('0x31')]};});_0x10dfda[_0x1c0e('0x32')]=_[_0x1c0e('0x33')](_['map'](_0x1b05f2,_0x1c0e('0x2a')),['format']);_0x10dfda[_0x1c0e('0x34')]=_['keys'](_0x278c20[_0x1c0e('0x34')]);_0x10dfda[_0x1c0e('0x35')]=_[_0x1c0e('0x36')](_0x10dfda[_0x1c0e('0x32')],_0x10dfda[_0x1c0e('0x34')]);_0xc77190[_0x1c0e('0x37')]=_[_0x1c0e('0x36')](_0x10dfda[_0x1c0e('0x32')],qs['fields'](_0x278c20[_0x1c0e('0x34')][_0x1c0e('0x38')]));_0xc77190[_0x1c0e('0x37')]=_0xc77190[_0x1c0e('0x37')]['length']?_0xc77190[_0x1c0e('0x37')]:_0x10dfda[_0x1c0e('0x32')];if(!_0x278c20[_0x1c0e('0x34')]['hasOwnProperty'](_0x1c0e('0x39'))){_0xc77190['limit']=qs[_0x1c0e('0x1f')](_0x278c20[_0x1c0e('0x34')]['limit']);_0xc77190[_0x1c0e('0x1d')]=qs[_0x1c0e('0x1d')](_0x278c20[_0x1c0e('0x34')][_0x1c0e('0x1d')]);}_0xc77190[_0x1c0e('0x3a')]=qs[_0x1c0e('0x3b')](_0x278c20[_0x1c0e('0x34')][_0x1c0e('0x3b')]);_0xc77190[_0x1c0e('0x3c')]=qs[_0x1c0e('0x35')](_[_0x1c0e('0x3d')](_0x278c20[_0x1c0e('0x34')],_0x10dfda['filters']),_0x1b05f2);if(_0x278c20[_0x1c0e('0x34')]['filter']){_0xc77190[_0x1c0e('0x3c')]=_[_0x1c0e('0x3e')](_0xc77190[_0x1c0e('0x3c')],{'$or':_[_0x1c0e('0x2d')](_0x1b05f2,function(_0x32d3eb){if(_0x32d3eb[_0x1c0e('0x30')]!==_0x1c0e('0x3f')){var _0x3fcafc={};_0x3fcafc[_0x32d3eb[_0x1c0e('0x2a')]]={'$like':'%'+_0x278c20[_0x1c0e('0x34')][_0x1c0e('0x40')]+'%'};return _0x3fcafc;}})});}_0xc77190=_['merge']({},_0xc77190,_0x278c20['options']);var _0x1a93e3={'where':_0xc77190[_0x1c0e('0x3c')]};return db[_0x1c0e('0x41')]['count'](_0x1a93e3)[_0x1c0e('0x28')](function(_0x1d301a){_0x41d322[_0x1c0e('0x20')]=_0x1d301a;if(_0x278c20[_0x1c0e('0x34')]['includeAll']){_0xc77190[_0x1c0e('0x42')]=[{'all':!![]}];}return db[_0x1c0e('0x41')]['findAll'](_0xc77190);})[_0x1c0e('0x28')](function(_0x12f8de){_0x41d322[_0x1c0e('0x43')]=_0x12f8de;return _0x41d322;})['then'](respondWithFilteredResult(_0x2475ce,_0xc77190))[_0x1c0e('0x44')](handleError(_0x2475ce,null));};exports[_0x1c0e('0x45')]=function(_0xf92de7,_0x4bcb87){var _0x4c04fb={'raw':![],'where':{'id':_0xf92de7[_0x1c0e('0x46')]['id']}},_0x41acc3={};_0x41acc3[_0x1c0e('0x32')]=_[_0x1c0e('0x47')](db[_0x1c0e('0x41')][_0x1c0e('0x2e')]);_0x41acc3[_0x1c0e('0x34')]=_[_0x1c0e('0x47')](_0xf92de7['query']);_0x41acc3[_0x1c0e('0x35')]=_['intersection'](_0x41acc3['model'],_0x41acc3[_0x1c0e('0x34')]);_0x4c04fb[_0x1c0e('0x37')]=_[_0x1c0e('0x36')](_0x41acc3[_0x1c0e('0x32')],qs[_0x1c0e('0x38')](_0xf92de7[_0x1c0e('0x34')][_0x1c0e('0x38')]));_0x4c04fb[_0x1c0e('0x37')]=_0x4c04fb[_0x1c0e('0x37')]['length']?_0x4c04fb[_0x1c0e('0x37')]:_0x41acc3[_0x1c0e('0x32')];if(_0xf92de7[_0x1c0e('0x34')][_0x1c0e('0x48')]){_0x4c04fb[_0x1c0e('0x42')]=[{'all':!![]}];}_0x4c04fb=_[_0x1c0e('0x3e')]({},_0x4c04fb,_0xf92de7['options']);return db['VoiceRecording'][_0x1c0e('0x49')](_0x4c04fb)[_0x1c0e('0x28')](handleEntityNotFound(_0x4bcb87,null))[_0x1c0e('0x28')](respondWithResult(_0x4bcb87,null))[_0x1c0e('0x44')](handleError(_0x4bcb87,null));};exports[_0x1c0e('0x4a')]=function(_0x4dd561,_0x586bcf){return db[_0x1c0e('0x41')]['create'](_0x4dd561[_0x1c0e('0x4b')],{})['then'](respondWithResult(_0x586bcf,0xc9))[_0x1c0e('0x44')](handleError(_0x586bcf,null));};exports[_0x1c0e('0x27')]=function(_0x52c0fe,_0x2cfe8d){if(_0x52c0fe[_0x1c0e('0x4b')]['id']){delete _0x52c0fe[_0x1c0e('0x4b')]['id'];}return db[_0x1c0e('0x41')]['find']({'where':{'id':_0x52c0fe[_0x1c0e('0x46')]['id']}})[_0x1c0e('0x28')](handleEntityNotFound(_0x2cfe8d,null))[_0x1c0e('0x28')](saveUpdates(_0x52c0fe[_0x1c0e('0x4b')],null))[_0x1c0e('0x28')](respondWithResult(_0x2cfe8d,null))[_0x1c0e('0x44')](handleError(_0x2cfe8d,null));};exports[_0x1c0e('0x4c')]=function(_0x3abacd,_0x2229cc){return db['VoiceRecording'][_0x1c0e('0x4c')]()['then'](respondWithResult(_0x2229cc,null))['catch'](handleError(_0x2229cc,null));};exports[_0x1c0e('0x4d')]=function(_0x1bad4b,_0x3eb3c5,_0x14409d){var _0x29c5ab=require(_0x1c0e('0x4e'));var _0x2784ab=![];var _0x20198c={};if(_0x1bad4b[_0x1c0e('0x34')][_0x1c0e('0x30')]&&_0x1bad4b[_0x1c0e('0x34')][_0x1c0e('0x30')]==='uniqueid'){_0x20198c[_0x1c0e('0x4f')]=_0x1bad4b[_0x1c0e('0x46')]['id'];}else{_0x20198c['id']=_0x1bad4b[_0x1c0e('0x46')]['id'];}return db[_0x1c0e('0x41')][_0x1c0e('0x49')]({'where':_0x20198c,'attributes':['id',_0x1c0e('0x50')],'raw':!![]})[_0x1c0e('0x28')](handleEntityNotFound(_0x3eb3c5,null))['then'](function(_0x21c10a){if(_0x21c10a){var _0x554654=_0x21c10a[_0x1c0e('0x50')];var _0x57d312=util[_0x1c0e('0x51')](_0x1c0e('0x52'),_0x554654);if(fs[_0x1c0e('0x53')](_0x57d312)){_0x2784ab=!![];return _0x29c5ab[_0x1c0e('0x54')](_0x57d312,_0x554654,config['secrets'][_0x1c0e('0x55')])[_0x1c0e('0x28')](function(){return _0x21c10a;});}return _0x21c10a;}})['then'](function(_0x580075){if(_0x580075){var _0x263290=_0x580075[_0x1c0e('0x50')];if(!fs[_0x1c0e('0x53')](_0x263290)){throw new db['Sequelize'][(_0x1c0e('0x56'))](_0x1c0e('0x57'));}if(_0x580075['filename']){return _0x3eb3c5[_0x1c0e('0x4d')](_0x263290,_0x580075[_0x1c0e('0x58')]+path[_0x1c0e('0x59')](_0x263290),function(){if(_0x2784ab){fs[_0x1c0e('0x5a')](_0x263290);}});}else{return _0x3eb3c5['download'](_0x263290,function(_0x4af9f6){if(_0x2784ab){fs[_0x1c0e('0x5a')](_0x263290);}});}}})['catch'](function(_0x27ad51){if(_0x27ad51[_0x1c0e('0x5b')]===_0x1c0e('0x57')){_0x3eb3c5['status'](0x194)[_0x1c0e('0x2b')](_0x1c0e('0x5c'));}else{return handleError(_0x3eb3c5,null);}});};exports['downloads']=function(_0x2bc6a9,_0xc2a84e,_0x462944){var _0x198062=require(_0x1c0e('0x4e'));var _0x1bfb15=![];var _0x495330={'$and':[db['sequelize'][_0x1c0e('0x3c')](db['sequelize']['fn']('MD5',db[_0x1c0e('0x5d')]['col'](_0x1c0e('0x4f'))),_0x2bc6a9[_0x1c0e('0x34')][_0x1c0e('0x5e')])]};if(_0x2bc6a9[_0x1c0e('0x34')][_0x1c0e('0x30')]&&_0x2bc6a9[_0x1c0e('0x34')]['type']===_0x1c0e('0x4f')){_0x495330['$and'][_0x1c0e('0x5f')]({'uniqueid':_0x2bc6a9[_0x1c0e('0x46')]['id']});}else{_0x495330[_0x1c0e('0x60')][_0x1c0e('0x5f')]({'id':_0x2bc6a9[_0x1c0e('0x46')]['id']});}return db[_0x1c0e('0x41')][_0x1c0e('0x49')]({'where':_0x495330,'attributes':['id',_0x1c0e('0x50')],'raw':!![]})[_0x1c0e('0x28')](handleEntityNotFound(_0xc2a84e,null))[_0x1c0e('0x28')](function(_0x108655){if(_0x108655){var _0x26ccf1=util[_0x1c0e('0x51')](_0x1c0e('0x52'),_0x108655[_0x1c0e('0x50')]);if(fs[_0x1c0e('0x53')](_0x26ccf1)){_0x1bfb15=!![];return _0x198062['decryptFile'](_0x26ccf1,_0x108655[_0x1c0e('0x50')],config[_0x1c0e('0x61')]['recording'])['then'](function(){return _0x108655;});}return _0x108655;}})[_0x1c0e('0x28')](function(_0x1b1777){if(_0x1b1777){if(!fs['existsSync'](_0x1b1777[_0x1c0e('0x50')])){throw new db['Sequelize'][(_0x1c0e('0x56'))](_0x1c0e('0x57'));}if(_0x1b1777[_0x1c0e('0x58')]){return _0xc2a84e[_0x1c0e('0x4d')](_0x1b1777['value'],_0x1b1777[_0x1c0e('0x58')]+path['extname'](_0x1b1777[_0x1c0e('0x50')]),function(){if(_0x1bfb15){fs[_0x1c0e('0x5a')](_0x1b1777[_0x1c0e('0x50')]);}});}else{return _0xc2a84e[_0x1c0e('0x4d')](_0x1b1777['value'],function(_0x3d4042){if(_0x1bfb15){fs['unlink'](_0x1b1777['value']);}});}}})['catch'](handleError(_0xc2a84e,null));};exports[_0x1c0e('0x62')]=function(_0x57d99f,_0x4dd23d){return db['VoiceRecording'][_0x1c0e('0x49')]({'where':{'id':_0x57d99f['params']['id']}})['then'](function(_0x3692e4){if(_[_0x1c0e('0x63')](_0x3692e4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3692e4;})[_0x1c0e('0x28')](function(_0x3f932d){var _0x2e9059=_0x3f932d[_0x1c0e('0x50')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2e9059);if(!_['isNil'](_0x3f932d[_0x1c0e('0x50')])&&fs[_0x1c0e('0x53')](_0x2e9059)){logger[_0x1c0e('0x64')]('File:\x20\x22'+_0x2e9059+_0x1c0e('0x65'));fs[_0x1c0e('0x66')](_0x2e9059);}_0x2e9059=_0x2e9059+_0x1c0e('0x67');if(!_[_0x1c0e('0x63')](_0x3f932d[_0x1c0e('0x50')])&&fs[_0x1c0e('0x53')](_0x2e9059)){logger['info']('File:\x20\x22'+_0x2e9059+_0x1c0e('0x65'));fs[_0x1c0e('0x66')](_0x2e9059);}return _0x3f932d;})[_0x1c0e('0x28')](function(_0x297fbc){if(!_0x297fbc)throw new InternalError();return _0x297fbc['destroy']();})[_0x1c0e('0x28')](function(){_0x4dd23d[_0x1c0e('0x1b')](0xcc)[_0x1c0e('0x1c')]();})[_0x1c0e('0x44')](handleError(_0x4dd23d,null));};function getBucketslist(_0x4a92d9,_0x3a0123,_0x5703d0){return new Promise(function(_0x4d07de,_0x50b38b){var _0x45ad71=new AWS['S3']({'accessKeyId':_0x3a0123,'secretAccessKey':_0x4a92d9,'region':_0x5703d0});_0x45ad71['listBuckets']({},function(_0x185984,_0x2ad197){if(_0x185984){return _0x50b38b(_0x185984);}else{return _0x4d07de(_0x2ad197);}});});}function createBucket(_0x440933,_0x7e6948,_0x586dff,_0x1535f2){return new Promise(function(_0x1248ba,_0x189b43){var _0x77f830=new AWS['S3']({'accessKeyId':_0x7e6948,'secretAccessKey':_0x440933,'region':_0x586dff});_0x77f830['createBucket']({'Bucket':_0x1535f2},function(_0x3f2b56,_0x4af7fe){if(_0x3f2b56){return _0x189b43(_0x3f2b56);}else{return _0x1248ba(_0x4af7fe);}});});}function uploadFile(_0x2fd820,_0x5d4797,_0xf50d8c,_0x9e14fa,_0x1b7be1,_0x42577a){return new Promise(function(_0x15f16a,_0x3ab4d9){var _0x398a1a=new AWS['S3']({'accessKeyId':_0x5d4797,'secretAccessKey':_0x2fd820,'region':_0xf50d8c});_0x398a1a['upload']({'Bucket':_0x9e14fa,'Key':_0x1b7be1,'Body':_0x42577a},function(_0x254fac,_0x2eddda){if(_0x254fac){return _0x3ab4d9(_0x254fac);}else{return _0x15f16a(_0x2eddda);}});});}function startTranscribe(_0x115b78,_0x4fa78f,_0xfe1380,_0x254dcf,_0x6d2b5d,_0xf15321){return new Promise(function(_0x6db219,_0x3b8d00){var _0x2d5d0b=new AWS[(_0x1c0e('0x68'))]({'accessKeyId':_0x4fa78f,'secretAccessKey':_0x115b78,'region':_0xfe1380});_0x2d5d0b['startTranscriptionJob']({'TranscriptionJobName':_0x254dcf,'LanguageCode':_0x6d2b5d,'Media':{'MediaFileUri':_0xf15321}},function(_0x383865,_0x46a395){if(_0x383865){return _0x3b8d00(_0x383865);}else{return _0x6db219(_0x46a395);}});});}function transcribe(_0x7dcb69,_0xe34bc9,_0x23b158,_0x15c99f,_0x188d85,_0x1f0f58,_0x1ac00d){return new Promise(function(_0x28c5c7,_0x35eac8){var _0x290af4={};logger[_0x1c0e('0x64')](util['format'](_0x1c0e('0x69'),_0x7dcb69,_0x188d85));return uploadFile(_0xe34bc9,_0x23b158,_0x15c99f,_0x188d85,path[_0x1c0e('0x6a')](_0x1f0f58),fs[_0x1c0e('0x6b')](_0x1f0f58))['then'](function(_0x331ab3){logger[_0x1c0e('0x64')](util['format'](_0x1c0e('0x6c'),_0x7dcb69,_0x188d85,_0x331ab3[_0x1c0e('0x6d')]));_0x290af4[_0x1c0e('0x6e')]=_0x331ab3[_0x1c0e('0x6f')];_0x290af4[_0x1c0e('0x70')]=_0x331ab3[_0x1c0e('0x6d')];logger[_0x1c0e('0x64')](util[_0x1c0e('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x7dcb69));return startTranscribe(_0xe34bc9,_0x23b158,_0x15c99f,uuidv4(),_0x1ac00d,_0x331ab3[_0x1c0e('0x6d')]);})[_0x1c0e('0x28')](function(_0x862908){logger[_0x1c0e('0x64')](util['format'](_0x1c0e('0x71'),_0x7dcb69,_0x862908[_0x1c0e('0x72')][_0x1c0e('0x73')]));_0x290af4['transcribeName']=_0x862908[_0x1c0e('0x72')]['TranscriptionJobName'];_0x290af4[_0x1c0e('0x74')]=_0x862908[_0x1c0e('0x72')][_0x1c0e('0x75')];return _0x28c5c7(_0x290af4);})[_0x1c0e('0x44')](function(_0x4b0bc3){return _0x35eac8(_0x4b0bc3);});});}exports[_0x1c0e('0x76')]=function(_0x26bae9,_0x13b899,_0x28ff5c){var _0x26fddb;var _0x5bf062;var _0x2c07f8;var _0x46dac0=require('../../components/encryptor');return db['VoiceRecording'][_0x1c0e('0x77')]({'where':{'id':_0x26bae9[_0x1c0e('0x46')]['id']}})[_0x1c0e('0x28')](function(_0x52f292){if(_0x52f292){var _0xf7f97e=util['format'](_0x1c0e('0x52'),_0x52f292[_0x1c0e('0x50')]);if(fs[_0x1c0e('0x53')](_0xf7f97e)){cypher=!![];return _0x46dac0['decryptFile'](_0xf7f97e,_0x52f292[_0x1c0e('0x50')],config[_0x1c0e('0x61')][_0x1c0e('0x55')])[_0x1c0e('0x28')](function(){return _0x52f292;});}return _0x52f292;}})[_0x1c0e('0x28')](function(_0x4f6319){if(!_0x4f6319){throw new db[(_0x1c0e('0x78'))]['ValidationError'](_0x1c0e('0x79'));}_0x5bf062=_0x4f6319;return db[_0x1c0e('0x7a')][_0x1c0e('0x77')]({'where':{'id':0x1}});})[_0x1c0e('0x28')](handleEntityNotFound(_0x13b899,null))[_0x1c0e('0x28')](function(_0x5edd95){if(_0x5edd95){_0x26fddb=_0x5edd95;if(!_0x26fddb[_0x1c0e('0x7b')]||!_0x26fddb[_0x1c0e('0x7c')]||!_0x26fddb['transcribeRegion']||!_0x26fddb[_0x1c0e('0x7d')]||!_0x26fddb[_0x1c0e('0x6e')]){throw new db['Sequelize']['ValidationError'](_0x1c0e('0x7e'));}if(_0x26bae9[_0x1c0e('0x4b')][_0x1c0e('0x7f')]&&(!_0x26fddb['sentiment']||!_0x26fddb[_0x1c0e('0x80')]||!_0x26fddb['sentimentRegion']||!_0x26fddb[_0x1c0e('0x7d')]||!_0x26fddb[_0x1c0e('0x6e')])){throw new db[(_0x1c0e('0x78'))][(_0x1c0e('0x56'))](_0x1c0e('0x81'));}return db[_0x1c0e('0x82')][_0x1c0e('0x77')]({'where':{'id':_0x26fddb['transcribeAccountId']}});}})[_0x1c0e('0x28')](function(_0x453022){if(!_0x453022){throw new db[(_0x1c0e('0x78'))][(_0x1c0e('0x56'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x453022[_0x1c0e('0x83')]||!_0x453022[_0x1c0e('0x84')]){throw new db[(_0x1c0e('0x78'))][(_0x1c0e('0x56'))](_0x1c0e('0x85'));}_0x2c07f8=_0x453022;return getBucketslist(_0x2c07f8['data1'],_0x2c07f8[_0x1c0e('0x84')],_0x26fddb[_0x1c0e('0x86')]);})['then'](function(_0x3ac3a6){if(_0x3ac3a6&&_0x3ac3a6[_0x1c0e('0x87')]){var _0x1c3e03=_[_0x1c0e('0x49')](_0x3ac3a6[_0x1c0e('0x87')],function(_0x1dbf66){return _0x1dbf66[_0x1c0e('0x88')]===_0x26fddb['bucket'];});if(!_0x1c3e03){logger[_0x1c0e('0x64')](util[_0x1c0e('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x26bae9[_0x1c0e('0x46')]['id'],_0x26fddb[_0x1c0e('0x6e')]));return createBucket(_0x2c07f8['data1'],_0x2c07f8[_0x1c0e('0x84')],_0x26fddb[_0x1c0e('0x86')],_0x26fddb['bucket']);}logger[_0x1c0e('0x64')](util[_0x1c0e('0x51')](_0x1c0e('0x89'),_0x26bae9['params']['id'],_0x26fddb[_0x1c0e('0x6e')]));return;}})[_0x1c0e('0x28')](function(_0x59b79f){if(_0x5bf062['transcribeStatus']===_0x1c0e('0x8a')){return transcribe(_0x26bae9[_0x1c0e('0x46')]['id'],_0x2c07f8[_0x1c0e('0x83')],_0x2c07f8[_0x1c0e('0x84')],_0x26fddb[_0x1c0e('0x86')],_0x26fddb[_0x1c0e('0x6e')],_0x5bf062[_0x1c0e('0x50')],_0x26fddb[_0x1c0e('0x7d')]);}else{logger[_0x1c0e('0x64')](util[_0x1c0e('0x51')](_0x1c0e('0x8b'),_0x26bae9[_0x1c0e('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x1c0e('0x28')](function(_0x58063c){if(_0x58063c){_0x58063c['tempSentiment']=_0x26bae9[_0x1c0e('0x4b')][_0x1c0e('0x7f')];return _0x5bf062[_0x1c0e('0x8c')](_0x58063c);}})[_0x1c0e('0x28')](respondWithResult(_0x13b899,null))[_0x1c0e('0x44')](handleError(_0x13b899,null));};function writeFile(_0xe54a33,_0x4ea2e0){return new Promise(function(_0x3951ec,_0x5ead66){fs[_0x1c0e('0x8d')](_0x4ea2e0,_0xe54a33,function(_0x57e83e,_0x4fd97e){if(_0x57e83e){return _0x5ead66(_0x57e83e);}else{return _0x3951ec(_0x4fd97e);}});});}exports['downloadTranscribe']=function(_0x16bf43,_0x24477c,_0x1e1b5c){return db[_0x1c0e('0x41')][_0x1c0e('0x77')]({'where':{'id':_0x16bf43[_0x1c0e('0x46')]['id']}})['then'](handleEntityNotFound(_0x24477c))[_0x1c0e('0x28')](function(_0x234fdd){if(_0x234fdd&&_0x234fdd[_0x1c0e('0x8e')]){var _0x28c338=_0x234fdd[_0x1c0e('0x8e')];var _0x3e67a9=config[_0x1c0e('0x8f')]+_0x1c0e('0x90')+_0x234fdd['id']+_0x1c0e('0x91');if(fs[_0x1c0e('0x53')](_0x3e67a9)){return _0x3e67a9;}return writeFile(_0x28c338,_0x3e67a9)[_0x1c0e('0x28')](function(){return _0x3e67a9;});}else{throw new db[(_0x1c0e('0x78'))]['ValidationError']('Transcript\x20not\x20available');}})[_0x1c0e('0x28')](function(_0x1152e9){return _0x24477c[_0x1c0e('0x4d')](_0x1152e9);})[_0x1c0e('0x44')](handleError(_0x24477c));};
\ No newline at end of file
+var _0x095c=['fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','destroy','then','error','stack','name','send','map','fieldName','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','VoiceRecording','count','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','describe','download','../../components/encryptor','uniqueid','value','existsSync','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','token','$and','push','decryptFile','secrets','Sequelize','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x3d39e3,_0x138d4d){var _0x5799d2=function(_0x280dab){while(--_0x280dab){_0x3d39e3['push'](_0x3d39e3['shift']());}};_0x5799d2(++_0x138d4d);}(_0x095c,0x1d2));var _0xc095=function(_0x50ed57,_0x4b813d){_0x50ed57=_0x50ed57-0x0;var _0x575784=_0x095c[_0x50ed57];return _0x575784;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc095('0x0'));var zipdir=require(_0xc095('0x1'));var jsonpatch=require(_0xc095('0x2'));var rp=require(_0xc095('0x3'));var moment=require(_0xc095('0x4'));var BPromise=require(_0xc095('0x5'));var Mustache=require(_0xc095('0x6'));var util=require(_0xc095('0x7'));var path=require(_0xc095('0x8'));var sox=require(_0xc095('0x9'));var csv=require('to-csv');var ejs=require(_0xc095('0xa'));var fs=require('fs');var fs_extra=require(_0xc095('0xb'));var _=require(_0xc095('0xc'));var squel=require(_0xc095('0xd'));var crypto=require(_0xc095('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc095('0xf'));var toCsv=require(_0xc095('0x10'));var querystring=require(_0xc095('0x11'));var Papa=require(_0xc095('0x12'));var AWS=require(_0xc095('0x13'));var uuidv4=require(_0xc095('0x14'));var Redis=require(_0xc095('0x15'));var authService=require(_0xc095('0x16'));var qs=require(_0xc095('0x17'));var as=require(_0xc095('0x18'));var hardwareService=require(_0xc095('0x19'));var logger=require('../../config/logger')(_0xc095('0x1a'));var utils=require(_0xc095('0x1b'));var config=require(_0xc095('0x1c'));var licenseUtil=require(_0xc095('0x1d'));var db=require(_0xc095('0x1e'))['db'];function respondWithStatusCode(_0x3ffe70,_0x4ae221){_0x4ae221=_0x4ae221||0xcc;return function(_0x1c9a4f){if(_0x1c9a4f){return _0x3ffe70[_0xc095('0x1f')](_0x4ae221);}return _0x3ffe70['status'](_0x4ae221)[_0xc095('0x20')]();};}function respondWithResult(_0x19dc56,_0x90ed9b){_0x90ed9b=_0x90ed9b||0xc8;return function(_0x16f09c){if(_0x16f09c){return _0x19dc56[_0xc095('0x21')](_0x90ed9b)['json'](_0x16f09c);}};}function respondWithFilteredResult(_0x4e8399,_0x12c9ee){return function(_0x538284){if(_0x538284){var _0x38ce25=typeof _0x12c9ee[_0xc095('0x22')]===_0xc095('0x23')&&typeof _0x12c9ee['limit']===_0xc095('0x23');var _0x4cd0c0=_0x538284['count'];var _0x4fb5c4=_0x38ce25?0x0:_0x12c9ee[_0xc095('0x22')];var _0x7e083a=_0x38ce25?_0x538284['count']:_0x12c9ee[_0xc095('0x22')]+_0x12c9ee[_0xc095('0x24')];var _0x11518b;if(_0x7e083a>=_0x4cd0c0){_0x7e083a=_0x4cd0c0;_0x11518b=0xc8;}else{_0x11518b=0xce;}_0x4e8399[_0xc095('0x21')](_0x11518b);return _0x4e8399[_0xc095('0x25')](_0xc095('0x26'),_0x4fb5c4+'-'+_0x7e083a+'/'+_0x4cd0c0)[_0xc095('0x27')](_0x538284);}return null;};}function patchUpdates(_0x28e5d3){return function(_0x2e419a){try{jsonpatch[_0xc095('0x28')](_0x2e419a,_0x28e5d3,!![]);}catch(_0x66acf1){return BPromise['reject'](_0x66acf1);}return _0x2e419a[_0xc095('0x29')]();};}function saveUpdates(_0x37880b,_0x1417ec){return function(_0x21f5ad){if(_0x21f5ad){return _0x21f5ad['update'](_0x37880b)['then'](function(_0x91478){return _0x91478;});}return null;};}function removeEntity(_0x2e7357,_0x2a193){return function(_0xd1e74){if(_0xd1e74){return _0xd1e74[_0xc095('0x2a')]()[_0xc095('0x2b')](function(){_0x2e7357[_0xc095('0x21')](0xcc)[_0xc095('0x20')]();});}};}function handleEntityNotFound(_0x4d9813,_0x211ebf){return function(_0x2eb0ab){if(!_0x2eb0ab){_0x4d9813[_0xc095('0x1f')](0x194);}return _0x2eb0ab;};}function handleError(_0x2401d3,_0x48b718){_0x48b718=_0x48b718||0x1f4;return function(_0x2eae09){logger[_0xc095('0x2c')](_0x2eae09[_0xc095('0x2d')]);if(_0x2eae09[_0xc095('0x2e')]){delete _0x2eae09[_0xc095('0x2e')];}_0x2401d3[_0xc095('0x21')](_0x48b718)[_0xc095('0x2f')](_0x2eae09);};}exports['index']=function(_0x2952aa,_0xe2ce78){var _0x20e8f4={},_0x1a6f23={},_0x64cbf={'count':0x0,'rows':[]};var _0x3a9388=_[_0xc095('0x30')](db['VoiceRecording']['rawAttributes'],function(_0x10ca2f){return{'name':_0x10ca2f[_0xc095('0x31')],'type':_0x10ca2f['type'][_0xc095('0x32')]};});_0x1a6f23[_0xc095('0x33')]=_[_0xc095('0x34')](_[_0xc095('0x30')](_0x3a9388,_0xc095('0x2e')),[_0xc095('0x35')]);_0x1a6f23[_0xc095('0x36')]=_[_0xc095('0x37')](_0x2952aa['query']);_0x1a6f23['filters']=_[_0xc095('0x38')](_0x1a6f23[_0xc095('0x33')],_0x1a6f23[_0xc095('0x36')]);_0x20e8f4[_0xc095('0x39')]=_[_0xc095('0x38')](_0x1a6f23[_0xc095('0x33')],qs[_0xc095('0x3a')](_0x2952aa[_0xc095('0x36')][_0xc095('0x3a')]));_0x20e8f4[_0xc095('0x39')]=_0x20e8f4['attributes'][_0xc095('0x3b')]?_0x20e8f4['attributes']:_0x1a6f23[_0xc095('0x33')];if(!_0x2952aa[_0xc095('0x36')][_0xc095('0x3c')]('nolimit')){_0x20e8f4['limit']=qs[_0xc095('0x24')](_0x2952aa[_0xc095('0x36')][_0xc095('0x24')]);_0x20e8f4['offset']=qs[_0xc095('0x22')](_0x2952aa[_0xc095('0x36')][_0xc095('0x22')]);}_0x20e8f4['order']=qs[_0xc095('0x3d')](_0x2952aa[_0xc095('0x36')][_0xc095('0x3d')]);_0x20e8f4[_0xc095('0x3e')]=qs['filters'](_[_0xc095('0x3f')](_0x2952aa[_0xc095('0x36')],_0x1a6f23[_0xc095('0x40')]),_0x3a9388);if(_0x2952aa[_0xc095('0x36')]['filter']){_0x20e8f4[_0xc095('0x3e')]=_[_0xc095('0x41')](_0x20e8f4[_0xc095('0x3e')],{'$or':_['map'](_0x3a9388,function(_0x5b61f2){if(_0x5b61f2[_0xc095('0x42')]!==_0xc095('0x43')){var _0x11da54={};_0x11da54[_0x5b61f2[_0xc095('0x2e')]]={'$like':'%'+_0x2952aa[_0xc095('0x36')][_0xc095('0x44')]+'%'};return _0x11da54;}})});}_0x20e8f4=_['merge']({},_0x20e8f4,_0x2952aa[_0xc095('0x45')]);var _0x1fd76f={'where':_0x20e8f4[_0xc095('0x3e')]};return db[_0xc095('0x46')][_0xc095('0x47')](_0x1fd76f)[_0xc095('0x2b')](function(_0x55ade1){_0x64cbf[_0xc095('0x47')]=_0x55ade1;if(_0x2952aa[_0xc095('0x36')]['includeAll']){_0x20e8f4[_0xc095('0x48')]=[{'all':!![]}];}return db[_0xc095('0x46')]['findAll'](_0x20e8f4);})[_0xc095('0x2b')](function(_0x1484d0){_0x64cbf[_0xc095('0x49')]=_0x1484d0;return _0x64cbf;})[_0xc095('0x2b')](respondWithFilteredResult(_0xe2ce78,_0x20e8f4))[_0xc095('0x4a')](handleError(_0xe2ce78,null));};exports[_0xc095('0x4b')]=function(_0x335956,_0x1ca48a){var _0x43ba17={'raw':![],'where':{'id':_0x335956[_0xc095('0x4c')]['id']}},_0xdf3309={};_0xdf3309['model']=_[_0xc095('0x37')](db[_0xc095('0x46')][_0xc095('0x4d')]);_0xdf3309[_0xc095('0x36')]=_[_0xc095('0x37')](_0x335956[_0xc095('0x36')]);_0xdf3309[_0xc095('0x40')]=_[_0xc095('0x38')](_0xdf3309['model'],_0xdf3309[_0xc095('0x36')]);_0x43ba17[_0xc095('0x39')]=_['intersection'](_0xdf3309[_0xc095('0x33')],qs[_0xc095('0x3a')](_0x335956['query'][_0xc095('0x3a')]));_0x43ba17[_0xc095('0x39')]=_0x43ba17[_0xc095('0x39')]['length']?_0x43ba17[_0xc095('0x39')]:_0xdf3309[_0xc095('0x33')];if(_0x335956['query'][_0xc095('0x4e')]){_0x43ba17['include']=[{'all':!![]}];}_0x43ba17=_[_0xc095('0x41')]({},_0x43ba17,_0x335956[_0xc095('0x45')]);return db['VoiceRecording'][_0xc095('0x4f')](_0x43ba17)[_0xc095('0x2b')](handleEntityNotFound(_0x1ca48a,null))[_0xc095('0x2b')](respondWithResult(_0x1ca48a,null))[_0xc095('0x4a')](handleError(_0x1ca48a,null));};exports['create']=function(_0x4b7533,_0x4c8b1a){return db[_0xc095('0x46')][_0xc095('0x50')](_0x4b7533[_0xc095('0x51')],{})[_0xc095('0x2b')](respondWithResult(_0x4c8b1a,0xc9))[_0xc095('0x4a')](handleError(_0x4c8b1a,null));};exports[_0xc095('0x52')]=function(_0x35272f,_0x9ca8a5){if(_0x35272f[_0xc095('0x51')]['id']){delete _0x35272f[_0xc095('0x51')]['id'];}return db[_0xc095('0x46')][_0xc095('0x4f')]({'where':{'id':_0x35272f[_0xc095('0x4c')]['id']}})['then'](handleEntityNotFound(_0x9ca8a5,null))['then'](saveUpdates(_0x35272f[_0xc095('0x51')],null))['then'](respondWithResult(_0x9ca8a5,null))['catch'](handleError(_0x9ca8a5,null));};exports[_0xc095('0x53')]=function(_0x5025f9,_0xd7a1c9){return db[_0xc095('0x46')][_0xc095('0x53')]()[_0xc095('0x2b')](respondWithResult(_0xd7a1c9,null))[_0xc095('0x4a')](handleError(_0xd7a1c9,null));};exports[_0xc095('0x54')]=function(_0x14a820,_0x15ad8f,_0x315f7a){var _0x46fd4d=require(_0xc095('0x55'));var _0x2261e2=![];var _0x5ce8c8={};if(_0x14a820[_0xc095('0x36')][_0xc095('0x42')]&&_0x14a820['query'][_0xc095('0x42')]===_0xc095('0x56')){_0x5ce8c8[_0xc095('0x56')]=_0x14a820[_0xc095('0x4c')]['id'];}else{_0x5ce8c8['id']=_0x14a820[_0xc095('0x4c')]['id'];}return db[_0xc095('0x46')][_0xc095('0x4f')]({'where':_0x5ce8c8,'attributes':['id','value'],'raw':!![]})[_0xc095('0x2b')](handleEntityNotFound(_0x15ad8f,null))[_0xc095('0x2b')](function(_0x56fd43){if(_0x56fd43){var _0x2bca8c=_0x56fd43[_0xc095('0x57')];var _0x559a7d=util[_0xc095('0x35')]('%s.cypher',_0x2bca8c);if(fs[_0xc095('0x58')](_0x559a7d)){_0x2261e2=!![];return _0x46fd4d['decryptFile'](_0x559a7d,_0x2bca8c,config['secrets'][_0xc095('0x59')])[_0xc095('0x2b')](function(){return _0x56fd43;});}return _0x56fd43;}})[_0xc095('0x2b')](function(_0x2a693f){if(_0x2a693f){var _0x2c22ab=_0x2a693f[_0xc095('0x57')];if(!fs[_0xc095('0x58')](_0x2c22ab)){throw new db['Sequelize'][(_0xc095('0x5a'))](_0xc095('0x5b'));}if(_0x2a693f['filename']){return _0x15ad8f[_0xc095('0x54')](_0x2c22ab,_0x2a693f[_0xc095('0x5c')]+path[_0xc095('0x5d')](_0x2c22ab),function(){if(_0x2261e2){fs[_0xc095('0x5e')](_0x2c22ab);}});}else{return _0x15ad8f['download'](_0x2c22ab,function(_0x2baf6b){if(_0x2261e2){fs[_0xc095('0x5e')](_0x2c22ab);}});}}})[_0xc095('0x4a')](function(_0x33be67){if(_0x33be67['message']===_0xc095('0x5b')){_0x15ad8f[_0xc095('0x21')](0x194)[_0xc095('0x2f')](_0xc095('0x5f'));}else{return handleError(_0x15ad8f,null);}});};exports[_0xc095('0x60')]=function(_0x19144a,_0x18b336,_0x519c7a){var _0xb1f4fa=require(_0xc095('0x55'));var _0x2a660c=![];var _0x1ff6bd={'$and':[db['sequelize']['where'](db['sequelize']['fn']('MD5',db[_0xc095('0x61')]['col']('uniqueid')),_0x19144a[_0xc095('0x36')][_0xc095('0x62')])]};if(_0x19144a[_0xc095('0x36')][_0xc095('0x42')]&&_0x19144a[_0xc095('0x36')]['type']===_0xc095('0x56')){_0x1ff6bd[_0xc095('0x63')][_0xc095('0x64')]({'uniqueid':_0x19144a[_0xc095('0x4c')]['id']});}else{_0x1ff6bd[_0xc095('0x63')][_0xc095('0x64')]({'id':_0x19144a['params']['id']});}return db[_0xc095('0x46')][_0xc095('0x4f')]({'where':_0x1ff6bd,'attributes':['id',_0xc095('0x57')],'raw':!![]})[_0xc095('0x2b')](handleEntityNotFound(_0x18b336,null))[_0xc095('0x2b')](function(_0x35b9cc){if(_0x35b9cc){var _0x4091fe=util['format']('%s.cypher',_0x35b9cc[_0xc095('0x57')]);if(fs[_0xc095('0x58')](_0x4091fe)){_0x2a660c=!![];return _0xb1f4fa[_0xc095('0x65')](_0x4091fe,_0x35b9cc['value'],config[_0xc095('0x66')][_0xc095('0x59')])['then'](function(){return _0x35b9cc;});}return _0x35b9cc;}})[_0xc095('0x2b')](function(_0x5d8c31){if(_0x5d8c31){if(!fs['existsSync'](_0x5d8c31[_0xc095('0x57')])){throw new db[(_0xc095('0x67'))]['ValidationError'](_0xc095('0x5b'));}if(_0x5d8c31[_0xc095('0x5c')]){return _0x18b336[_0xc095('0x54')](_0x5d8c31[_0xc095('0x57')],_0x5d8c31[_0xc095('0x5c')]+path[_0xc095('0x5d')](_0x5d8c31['value']),function(){if(_0x2a660c){fs[_0xc095('0x5e')](_0x5d8c31[_0xc095('0x57')]);}});}else{return _0x18b336['download'](_0x5d8c31[_0xc095('0x57')],function(_0x5159f5){if(_0x2a660c){fs[_0xc095('0x5e')](_0x5d8c31[_0xc095('0x57')]);}});}}})[_0xc095('0x4a')](handleError(_0x18b336,null));};exports['destroy']=function(_0x540e74,_0x13f891){return db[_0xc095('0x46')]['find']({'where':{'id':_0x540e74['params']['id']}})[_0xc095('0x2b')](function(_0x1ef9fe){if(_[_0xc095('0x68')](_0x1ef9fe)){throw new ReferenceError(_0xc095('0x69'));}return _0x1ef9fe;})['then'](function(_0x45c02d){var _0x594729=_0x45c02d[_0xc095('0x57')];logger[_0xc095('0x6a')](_0xc095('0x6b'),_0x594729);if(!_['isNil'](_0x45c02d[_0xc095('0x57')])&&fs['existsSync'](_0x594729)){logger[_0xc095('0x6a')]('File:\x20\x22'+_0x594729+_0xc095('0x6c'));fs[_0xc095('0x6d')](_0x594729);}_0x594729=_0x594729+_0xc095('0x6e');if(!_[_0xc095('0x68')](_0x45c02d[_0xc095('0x57')])&&fs[_0xc095('0x58')](_0x594729)){logger[_0xc095('0x6a')]('File:\x20\x22'+_0x594729+_0xc095('0x6c'));fs[_0xc095('0x6d')](_0x594729);}return _0x45c02d;})[_0xc095('0x2b')](function(_0xc8647e){if(!_0xc8647e)throw new InternalError();return _0xc8647e[_0xc095('0x2a')]();})[_0xc095('0x2b')](function(){_0x13f891[_0xc095('0x21')](0xcc)['end']();})[_0xc095('0x4a')](handleError(_0x13f891,null));};function getBucketslist(_0x30e700,_0x431490,_0x2fdf84){return new Promise(function(_0x4f38e7,_0x3bf0a5){var _0x1f5b73=new AWS['S3']({'accessKeyId':_0x431490,'secretAccessKey':_0x30e700,'region':_0x2fdf84});_0x1f5b73[_0xc095('0x6f')]({},function(_0x52bfbd,_0x33223a){if(_0x52bfbd){return _0x3bf0a5(_0x52bfbd);}else{return _0x4f38e7(_0x33223a);}});});}function createBucket(_0x56ec8a,_0x4eee05,_0x72153a,_0xefe3ca){return new Promise(function(_0x33a194,_0x4b9e87){var _0x348714=new AWS['S3']({'accessKeyId':_0x4eee05,'secretAccessKey':_0x56ec8a,'region':_0x72153a});_0x348714[_0xc095('0x70')]({'Bucket':_0xefe3ca},function(_0x24df82,_0x531b0f){if(_0x24df82){return _0x4b9e87(_0x24df82);}else{return _0x33a194(_0x531b0f);}});});}function uploadFile(_0x3cefee,_0x328ce6,_0x2f2e11,_0x2eb744,_0x49eaf5,_0x13a172){return new Promise(function(_0x54259f,_0x4140c6){var _0x697833=new AWS['S3']({'accessKeyId':_0x328ce6,'secretAccessKey':_0x3cefee,'region':_0x2f2e11});_0x697833[_0xc095('0x71')]({'Bucket':_0x2eb744,'Key':_0x49eaf5,'Body':_0x13a172},function(_0x2306bb,_0x2938ae){if(_0x2306bb){return _0x4140c6(_0x2306bb);}else{return _0x54259f(_0x2938ae);}});});}function startTranscribe(_0x310f16,_0x24fbd5,_0x695d16,_0x2b976c,_0x545426,_0x5b34f7){return new Promise(function(_0x412f6d,_0x11d3e2){var _0x11380d=new AWS[(_0xc095('0x72'))]({'accessKeyId':_0x24fbd5,'secretAccessKey':_0x310f16,'region':_0x695d16});_0x11380d['startTranscriptionJob']({'TranscriptionJobName':_0x2b976c,'LanguageCode':_0x545426,'Media':{'MediaFileUri':_0x5b34f7}},function(_0x1dc106,_0x2529a7){if(_0x1dc106){return _0x11d3e2(_0x1dc106);}else{return _0x412f6d(_0x2529a7);}});});}function transcribe(_0x2944e5,_0xa93236,_0x434367,_0x37ad9b,_0x508b09,_0xb21067,_0x3e017b){return new Promise(function(_0x4269d1,_0x592e20){var _0x93e744={};logger[_0xc095('0x6a')](util[_0xc095('0x35')](_0xc095('0x73'),_0x2944e5,_0x508b09));return uploadFile(_0xa93236,_0x434367,_0x37ad9b,_0x508b09,path[_0xc095('0x74')](_0xb21067),fs[_0xc095('0x75')](_0xb21067))['then'](function(_0x54e0ce){logger[_0xc095('0x6a')](util[_0xc095('0x35')](_0xc095('0x76'),_0x2944e5,_0x508b09,_0x54e0ce[_0xc095('0x77')]));_0x93e744[_0xc095('0x78')]=_0x54e0ce[_0xc095('0x79')];_0x93e744['location']=_0x54e0ce[_0xc095('0x77')];logger[_0xc095('0x6a')](util[_0xc095('0x35')](_0xc095('0x7a'),_0x2944e5));return startTranscribe(_0xa93236,_0x434367,_0x37ad9b,uuidv4(),_0x3e017b,_0x54e0ce['Location']);})['then'](function(_0x54c277){logger['info'](util[_0xc095('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x2944e5,_0x54c277[_0xc095('0x7b')][_0xc095('0x7c')]));_0x93e744[_0xc095('0x7d')]=_0x54c277[_0xc095('0x7b')][_0xc095('0x7c')];_0x93e744[_0xc095('0x7e')]=_0x54c277[_0xc095('0x7b')][_0xc095('0x7f')];return _0x4269d1(_0x93e744);})[_0xc095('0x4a')](function(_0x49cb5a){return _0x592e20(_0x49cb5a);});});}exports[_0xc095('0x80')]=function(_0x4ad4b8,_0x424fec,_0x1f0389){var _0x1b3104;var _0x57cf72;var _0x80bb8e;var _0x300a63=require(_0xc095('0x55'));return db[_0xc095('0x46')][_0xc095('0x81')]({'where':{'id':_0x4ad4b8[_0xc095('0x4c')]['id']}})[_0xc095('0x2b')](function(_0x58cd4e){if(_0x58cd4e){var _0x452515=util['format'](_0xc095('0x82'),_0x58cd4e[_0xc095('0x57')]);if(fs['existsSync'](_0x452515)){cypher=!![];return _0x300a63['decryptFile'](_0x452515,_0x58cd4e['value'],config['secrets'][_0xc095('0x59')])[_0xc095('0x2b')](function(){return _0x58cd4e;});}return _0x58cd4e;}})[_0xc095('0x2b')](function(_0x35d960){if(!_0x35d960){throw new db[(_0xc095('0x67'))][(_0xc095('0x5a'))](_0xc095('0x83'));}_0x57cf72=_0x35d960;return db['Setting']['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x424fec,null))[_0xc095('0x2b')](function(_0x4c4e7a){if(_0x4c4e7a){_0x1b3104=_0x4c4e7a;if(!_0x1b3104[_0xc095('0x84')]||!_0x1b3104[_0xc095('0x85')]||!_0x1b3104[_0xc095('0x86')]||!_0x1b3104[_0xc095('0x87')]||!_0x1b3104[_0xc095('0x78')]){throw new db[(_0xc095('0x67'))][(_0xc095('0x5a'))](_0xc095('0x88'));}if(_0x4ad4b8[_0xc095('0x51')][_0xc095('0x89')]&&(!_0x1b3104['sentiment']||!_0x1b3104[_0xc095('0x8a')]||!_0x1b3104[_0xc095('0x8b')]||!_0x1b3104['language']||!_0x1b3104[_0xc095('0x78')])){throw new db[(_0xc095('0x67'))][(_0xc095('0x5a'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xc095('0x8c')][_0xc095('0x81')]({'where':{'id':_0x1b3104[_0xc095('0x85')]}});}})['then'](function(_0x4347a2){if(!_0x4347a2){throw new db[(_0xc095('0x67'))]['ValidationError'](_0xc095('0x8d'));}if(!_0x4347a2[_0xc095('0x8e')]||!_0x4347a2['data2']){throw new db[(_0xc095('0x67'))][(_0xc095('0x5a'))](_0xc095('0x8f'));}_0x80bb8e=_0x4347a2;return getBucketslist(_0x80bb8e[_0xc095('0x8e')],_0x80bb8e[_0xc095('0x90')],_0x1b3104[_0xc095('0x86')]);})['then'](function(_0x51c621){if(_0x51c621&&_0x51c621['Buckets']){var _0x1a3e8e=_[_0xc095('0x4f')](_0x51c621[_0xc095('0x91')],function(_0x2a12de){return _0x2a12de[_0xc095('0x92')]===_0x1b3104[_0xc095('0x78')];});if(!_0x1a3e8e){logger['info'](util[_0xc095('0x35')](_0xc095('0x93'),_0x4ad4b8[_0xc095('0x4c')]['id'],_0x1b3104[_0xc095('0x78')]));return createBucket(_0x80bb8e['data1'],_0x80bb8e['data2'],_0x1b3104['transcribeRegion'],_0x1b3104[_0xc095('0x78')]);}logger['info'](util['format'](_0xc095('0x94'),_0x4ad4b8[_0xc095('0x4c')]['id'],_0x1b3104[_0xc095('0x78')]));return;}})['then'](function(_0x4e0602){if(_0x57cf72[_0xc095('0x7e')]===_0xc095('0x95')){return transcribe(_0x4ad4b8[_0xc095('0x4c')]['id'],_0x80bb8e['data1'],_0x80bb8e[_0xc095('0x90')],_0x1b3104['transcribeRegion'],_0x1b3104['bucket'],_0x57cf72[_0xc095('0x57')],_0x1b3104['language']);}else{logger[_0xc095('0x6a')](util['format'](_0xc095('0x96'),_0x4ad4b8[_0xc095('0x4c')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x17fd87){if(_0x17fd87){_0x17fd87[_0xc095('0x97')]=_0x4ad4b8[_0xc095('0x51')][_0xc095('0x89')];return _0x57cf72['updateAttributes'](_0x17fd87);}})['then'](respondWithResult(_0x424fec,null))[_0xc095('0x4a')](handleError(_0x424fec,null));};function writeFile(_0x51e2f6,_0x4de8bb){return new Promise(function(_0x25bcf1,_0x4e070c){fs[_0xc095('0x98')](_0x4de8bb,_0x51e2f6,function(_0xbdc641,_0xe7a566){if(_0xbdc641){return _0x4e070c(_0xbdc641);}else{return _0x25bcf1(_0xe7a566);}});});}exports[_0xc095('0x99')]=function(_0x86f5d6,_0x33b127,_0x57313b){return db[_0xc095('0x46')][_0xc095('0x81')]({'where':{'id':_0x86f5d6['params']['id']}})[_0xc095('0x2b')](handleEntityNotFound(_0x33b127))[_0xc095('0x2b')](function(_0x2f7800){if(_0x2f7800&&_0x2f7800[_0xc095('0x9a')]){var _0x76f49a=_0x2f7800[_0xc095('0x9a')];var _0x5b225e=config[_0xc095('0x9b')]+_0xc095('0x9c')+_0x2f7800['id']+_0xc095('0x9d');if(fs[_0xc095('0x58')](_0x5b225e)){return _0x5b225e;}return writeFile(_0x76f49a,_0x5b225e)[_0xc095('0x2b')](function(){return _0x5b225e;});}else{throw new db[(_0xc095('0x67'))][(_0xc095('0x5a'))](_0xc095('0x9e'));}})[_0xc095('0x2b')](function(_0x1eeae2){return _0x33b127[_0xc095('0x54')](_0x1eeae2);})[_0xc095('0x4a')](handleError(_0x33b127));};
\ No newline at end of file
index c03fb81..df12cbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9b=['uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings'];(function(_0x2e2a10,_0x55f9f5){var _0x5ad6cd=function(_0x44c0a3){while(--_0x44c0a3){_0x2e2a10['push'](_0x2e2a10['shift']());}};_0x5ad6cd(++_0x55f9f5);}(_0xca9b,0x194));var _0xbca9=function(_0x2c8b24,_0x34ed0b){_0x2c8b24=_0x2c8b24-0x0;var _0x14bbfe=_0xca9b[_0x2c8b24];return _0x14bbfe;};'use strict';var _=require(_0xbca9('0x0'));var util=require(_0xbca9('0x1'));var logger=require(_0xbca9('0x2'))(_0xbca9('0x3'));var moment=require(_0xbca9('0x4'));var BPromise=require('bluebird');var rp=require(_0xbca9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbca9('0x6'));var config=require(_0xbca9('0x7'));var attributes=require(_0xbca9('0x8'));module['exports']=function(_0x138fcc,_0x71d0a3){return _0x138fcc[_0xbca9('0x9')](_0xbca9('0xa'),attributes,{'tableName':_0xbca9('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbca9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xaae4=['voice_recordings','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','VoiceRecording'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xaae4,0x120));var _0x4aae=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaae4[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4aae('0x0'));var util=require(_0x4aae('0x1'));var logger=require(_0x4aae('0x2'))('api');var moment=require(_0x4aae('0x3'));var BPromise=require(_0x4aae('0x4'));var rp=require(_0x4aae('0x5'));var fs=require('fs');var path=require(_0x4aae('0x6'));var rimraf=require(_0x4aae('0x7'));var config=require(_0x4aae('0x8'));var attributes=require(_0x4aae('0x9'));module['exports']=function(_0xb5135a,_0x32b1fc){return _0xb5135a['define'](_0x4aae('0xa'),attributes,{'tableName':_0x4aae('0xb'),'paranoid':![],'indexes':[{'name':_0x4aae('0xc'),'fields':[_0x4aae('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 32c5051..16e3e39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0598=['catch','UpdateVoiceRecording','VoiceRecording','body','options','where','limit','then','CreateVoiceRecording','../../components/encryptor','callRecordingEncryption','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x0598,0x92));var _0x8059=function(_0x2bd3f,_0x48c5a1){_0x2bd3f=_0x2bd3f-0x0;var _0x4242e7=_0x0598[_0x2bd3f];return _0x4242e7;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['update'](_0x4b6d55[_0x8059('0x11')],{'raw':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6d55[_0x8059('0x12')]?_0x4b6d55['options'][_0x8059('0x13')]||null:null,'attributes':_0x4b6d55[_0x8059('0x12')]?_0x4b6d55[_0x8059('0x12')]['attributes']||null:null,'limit':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x12')][_0x8059('0x14')]||null:null})[_0x8059('0x15')](function(_0x1585a3){logger['info'](_0x8059('0xf'),_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON['stringify'](_0x1585a3));_0x2bb670(_0x1585a3);})[_0x8059('0xe')](function(_0x2256b1){logger[_0x8059('0xc')](_0x8059('0xf'),_0x2256b1['message'],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x2256b1[_0x8059('0xd')]));});});};exports[_0x8059('0x16')]=function(_0x3e2d2b){var _0x202b30=this;return new Promise(function(_0x54b88b,_0x387350){var _0x19b95a=require(_0x8059('0x17'));var _0x4a294f;return db['Setting']['findOne']({'attributes':['id',_0x8059('0x18')],'where':{'id':0x1},'raw':!![]})[_0x8059('0x15')](function(_0xc32b1f){_0x4a294f=_0xc32b1f;return db[_0x8059('0x10')]['create'](_0x3e2d2b[_0x8059('0x11')]);})['then'](function(_0x2f887c){if(_0x4a294f[_0x8059('0x18')]&&fs['existsSync'](_0x2f887c[_0x8059('0x19')])){var _0x1aead2=util[_0x8059('0x1a')](_0x8059('0x1b'),_0x2f887c[_0x8059('0x19')]);return _0x19b95a[_0x8059('0x1c')](_0x2f887c[_0x8059('0x19')],_0x1aead2,config[_0x8059('0x1d')]['recording'])[_0x8059('0x15')](function(){fs[_0x8059('0x1e')](_0x2f887c[_0x8059('0x19')]);logger[_0x8059('0x7')](_0x8059('0x1f'));return _0x2f887c;});}return _0x2f887c;})['then'](function(_0x39f1c4){logger[_0x8059('0x7')](_0x8059('0x16'),_0x3e2d2b);logger[_0x8059('0xa')](_0x8059('0x16'),_0x3e2d2b,JSON[_0x8059('0xb')](_0x39f1c4));_0x54b88b(_0x39f1c4);})[_0x8059('0xe')](function(_0x175d57){logger[_0x8059('0xc')](_0x8059('0x16'),_0x175d57['message'],_0x3e2d2b);_0x387350(_0x202b30[_0x8059('0xc')](0x1f4,_0x175d57['message']));});});};
\ No newline at end of file
+var _0xadb5=['encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateVoiceRecording','update','options','raw','where','limit','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','body','value','format','%s.cypher'];(function(_0x3a587a,_0xe30987){var _0x3222de=function(_0x440322){while(--_0x440322){_0x3a587a['push'](_0x3a587a['shift']());}};_0x3222de(++_0xe30987);}(_0xadb5,0xad));var _0x5adb=function(_0x308151,_0x1e5f98){_0x308151=_0x308151-0x0;var _0x3f175c=_0xadb5[_0x308151];return _0x3f175c;};'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']('VoiceRecording,\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['VoiceRecording'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529b65[_0x5adb('0x17')]?_0x529b65[_0x5adb('0x17')][_0x5adb('0x19')]||null:null,'attributes':_0x529b65['options']?_0x529b65[_0x5adb('0x17')]['attributes']||null:null,'limit':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x1a')]||null:null})[_0x5adb('0xb')](function(_0x1a8014){logger[_0x5adb('0xc')](_0x5adb('0x15'),_0x529b65);logger[_0x5adb('0x1b')]('UpdateVoiceRecording',_0x529b65,JSON[_0x5adb('0xf')](_0x1a8014));_0x5de028(_0x1a8014);})[_0x5adb('0x14')](function(_0x3220cd){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x3220cd['message'],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x3220cd[_0x5adb('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x1feecf){var _0x1ded9f=this;return new Promise(function(_0x1a0acd,_0x55b40a){var _0x13ad1d=require(_0x5adb('0x1c'));var _0x3a4fca;return db[_0x5adb('0x1d')][_0x5adb('0x1e')]({'attributes':['id',_0x5adb('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x49992e){_0x3a4fca=_0x49992e;return db['VoiceRecording'][_0x5adb('0x20')](_0x1feecf[_0x5adb('0x21')]);})[_0x5adb('0xb')](function(_0x512bab){if(_0x3a4fca[_0x5adb('0x1f')]&&fs['existsSync'](_0x512bab[_0x5adb('0x22')])){var _0x34b793=util[_0x5adb('0x23')](_0x5adb('0x24'),_0x512bab[_0x5adb('0x22')]);return _0x13ad1d[_0x5adb('0x25')](_0x512bab[_0x5adb('0x22')],_0x34b793,config[_0x5adb('0x26')][_0x5adb('0x27')])[_0x5adb('0xb')](function(){fs['unlink'](_0x512bab[_0x5adb('0x22')]);logger['info'](_0x5adb('0x28'));return _0x512bab;});}return _0x512bab;})[_0x5adb('0xb')](function(_0x5d1441){logger[_0x5adb('0xc')](_0x5adb('0x29'),_0x1feecf);logger[_0x5adb('0x1b')]('CreateVoiceRecording',_0x1feecf,JSON[_0x5adb('0xf')](_0x5d1441));_0x1a0acd(_0x5d1441);})[_0x5adb('0x14')](function(_0x4b5887){logger['error'](_0x5adb('0x29'),_0x4b5887['message'],_0x1feecf);_0x55b40a(_0x1ded9f[_0x5adb('0x10')](0x1f4,_0x4b5887[_0x5adb('0x12')]));});});};
\ No newline at end of file
index e67527f..ee91577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9e2=['fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','exports','multer','path','connect-timeout','express','Router'];(function(_0x42176a,_0x36762c){var _0x1ca3d3=function(_0x17dc76){while(--_0x17dc76){_0x42176a['push'](_0x42176a['shift']());}};_0x1ca3d3(++_0x36762c);}(_0xc9e2,0xe2));var _0x2c9e=function(_0x5af2ba,_0x56ada7){_0x5af2ba=_0x5af2ba-0x0;var _0xfb6b87=_0xc9e2[_0x5af2ba];return _0xfb6b87;};'use strict';var multer=require(_0x2c9e('0x0'));var util=require('util');var path=require(_0x2c9e('0x1'));var timeout=require(_0x2c9e('0x2'));var express=require(_0x2c9e('0x3'));var router=express[_0x2c9e('0x4')]();var fs_extra=require(_0x2c9e('0x5'));var auth=require(_0x2c9e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2c9e('0x7'));var controller=require(_0x2c9e('0x8'));router['get']('/',auth[_0x2c9e('0x9')](),controller[_0x2c9e('0xa')]);router[_0x2c9e('0xb')](_0x2c9e('0xc'),auth[_0x2c9e('0x9')](),controller[_0x2c9e('0xd')]);router[_0x2c9e('0xb')]('/:id',auth[_0x2c9e('0x9')](),controller[_0x2c9e('0xe')]);router[_0x2c9e('0xf')]('/',auth[_0x2c9e('0x9')](),controller[_0x2c9e('0x10')]);router[_0x2c9e('0x11')](_0x2c9e('0x12'),auth[_0x2c9e('0x9')](),controller[_0x2c9e('0x13')]);router['delete'](_0x2c9e('0x12'),auth[_0x2c9e('0x9')](),controller['destroy']);module[_0x2c9e('0x14')]=router;
\ No newline at end of file
+var _0x8e71=['describe','create','put','/:id','update','delete','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x529f79,_0x5b4c85){var _0x21e1d5=function(_0x31226f){while(--_0x31226f){_0x529f79['push'](_0x529f79['shift']());}};_0x21e1d5(++_0x5b4c85);}(_0x8e71,0x16c));var _0x18e7=function(_0x4ab866,_0x40e607){_0x4ab866=_0x4ab866-0x0;var _0x56047a=_0x8e71[_0x4ab866];return _0x56047a;};'use strict';var multer=require(_0x18e7('0x0'));var util=require(_0x18e7('0x1'));var path=require('path');var timeout=require(_0x18e7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x18e7('0x3'));var auth=require(_0x18e7('0x4'));var interaction=require(_0x18e7('0x5'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x18e7('0x6')]('/',auth[_0x18e7('0x7')](),controller[_0x18e7('0x8')]);router[_0x18e7('0x6')](_0x18e7('0x9'),auth[_0x18e7('0x7')](),controller[_0x18e7('0xa')]);router[_0x18e7('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x18e7('0xb')]);router[_0x18e7('0xc')](_0x18e7('0xd'),auth[_0x18e7('0x7')](),controller[_0x18e7('0xe')]);router[_0x18e7('0xf')](_0x18e7('0xd'),auth[_0x18e7('0x7')](),controller['destroy']);module[_0x18e7('0x10')]=router;
\ No newline at end of file
index 588004f..ee470e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1219=['ENUM','STRING','Yes','sequelize','moment','exports'];(function(_0x201ecb,_0x2cdec3){var _0x3e8a2e=function(_0x43a55d){while(--_0x43a55d){_0x201ecb['push'](_0x201ecb['shift']());}};_0x3e8a2e(++_0x2cdec3);}(_0x1219,0xa5));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9121('0x0'));var moment=require(_0x9121('0x1'));module[_0x9121('0x2')]={'type':{'type':Sequelize[_0x9121('0x3')]('blind','attended')},'result':{'type':Sequelize[_0x9121('0x4')]},'transfererchannel':{'type':Sequelize[_0x9121('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x9121('0x4')]},'transferercalleridname':{'type':Sequelize[_0x9121('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x9121('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x9121('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x9121('0x4')]},'transferercontext':{'type':Sequelize[_0x9121('0x4')]},'transfererexten':{'type':Sequelize[_0x9121('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x9121('0x4')]},'transfereechannel':{'type':Sequelize[_0x9121('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x9121('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x9121('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9121('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x9121('0x4')]},'transfereeexten':{'type':Sequelize[_0x9121('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x9121('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x9121('0x5'),'No')},'context':{'type':Sequelize[_0x9121('0x4')]},'extension':{'type':Sequelize[_0x9121('0x4')]}};
\ No newline at end of file
+var _0x148d=['STRING','ENUM','Yes','sequelize','moment','exports','blind'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x148d,0x81));var _0xd148=function(_0x5ee984,_0x4b8fcb){_0x5ee984=_0x5ee984-0x0;var _0x35fc1d=_0x148d[_0x5ee984];return _0x35fc1d;};'use strict';var Sequelize=require(_0xd148('0x0'));var moment=require(_0xd148('0x1'));module[_0xd148('0x2')]={'type':{'type':Sequelize['ENUM'](_0xd148('0x3'),'attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xd148('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xd148('0x4')]},'transferercalleridname':{'type':Sequelize[_0xd148('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0xd148('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0xd148('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xd148('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xd148('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xd148('0x4')]},'transfereechannel':{'type':Sequelize[_0xd148('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xd148('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0xd148('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xd148('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xd148('0x4')]},'transfereecontext':{'type':Sequelize[_0xd148('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0xd148('0x5')](_0xd148('0x6'),'No')},'context':{'type':Sequelize[_0xd148('0x4')]},'extension':{'type':Sequelize[_0xd148('0x4')]}};
\ No newline at end of file
index 111d41b..6f3970f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c1=['sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','save','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','VoiceTransferReport','include','findAll','show','params','keys','includeAll','catch','create','body','update','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x88c1,0x111));var _0x188c=function(_0x4628da,_0x5064c8){_0x4628da=_0x4628da-0x0;var _0x42829e=_0x88c1[_0x4628da];return _0x42829e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x188c('0x0'));var zipdir=require(_0x188c('0x1'));var jsonpatch=require(_0x188c('0x2'));var rp=require(_0x188c('0x3'));var moment=require('moment');var BPromise=require(_0x188c('0x4'));var Mustache=require(_0x188c('0x5'));var util=require(_0x188c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x188c('0x7'));var ejs=require(_0x188c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x188c('0x9'));var squel=require(_0x188c('0xa'));var crypto=require('crypto');var jsforce=require(_0x188c('0xb'));var deskjs=require(_0x188c('0xc'));var toCsv=require(_0x188c('0x7'));var querystring=require('querystring');var Papa=require(_0x188c('0xd'));var Redis=require('ioredis');var authService=require(_0x188c('0xe'));var qs=require(_0x188c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x188c('0x10'));var logger=require(_0x188c('0x11'))(_0x188c('0x12'));var utils=require(_0x188c('0x13'));var config=require(_0x188c('0x14'));var licenseUtil=require(_0x188c('0x15'));var db=require(_0x188c('0x16'))['db'];function respondWithStatusCode(_0x16f8fa,_0x1fd076){_0x1fd076=_0x1fd076||0xcc;return function(_0x1143da){if(_0x1143da){return _0x16f8fa[_0x188c('0x17')](_0x1fd076);}return _0x16f8fa['status'](_0x1fd076)[_0x188c('0x18')]();};}function respondWithResult(_0x27e865,_0x2b432b){_0x2b432b=_0x2b432b||0xc8;return function(_0x20491e){if(_0x20491e){return _0x27e865[_0x188c('0x19')](_0x2b432b)[_0x188c('0x1a')](_0x20491e);}};}function respondWithFilteredResult(_0x29e493,_0x5f2c50){return function(_0x3b0fff){if(_0x3b0fff){var _0x35d400=typeof _0x5f2c50[_0x188c('0x1b')]==='undefined'&&typeof _0x5f2c50[_0x188c('0x1c')]===_0x188c('0x1d');var _0x275979=_0x3b0fff[_0x188c('0x1e')];var _0x116b8d=_0x35d400?0x0:_0x5f2c50[_0x188c('0x1b')];var _0x582aaf=_0x35d400?_0x3b0fff['count']:_0x5f2c50[_0x188c('0x1b')]+_0x5f2c50[_0x188c('0x1c')];var _0x51025e;if(_0x582aaf>=_0x275979){_0x582aaf=_0x275979;_0x51025e=0xc8;}else{_0x51025e=0xce;}_0x29e493[_0x188c('0x19')](_0x51025e);return _0x29e493['set']('Content-Range',_0x116b8d+'-'+_0x582aaf+'/'+_0x275979)[_0x188c('0x1a')](_0x3b0fff);}return null;};}function patchUpdates(_0x5aeb98){return function(_0x542fe5){try{jsonpatch[_0x188c('0x1f')](_0x542fe5,_0x5aeb98,!![]);}catch(_0x5cfb60){return BPromise[_0x188c('0x20')](_0x5cfb60);}return _0x542fe5[_0x188c('0x21')]();};}function saveUpdates(_0x236253,_0x4ecd07){return function(_0x2a5eed){if(_0x2a5eed){return _0x2a5eed['update'](_0x236253)['then'](function(_0x3db5be){return _0x3db5be;});}return null;};}function removeEntity(_0x19993c,_0x30750d){return function(_0x1d6c05){if(_0x1d6c05){return _0x1d6c05['destroy']()[_0x188c('0x22')](function(){_0x19993c[_0x188c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d20d2,_0x4c4087){return function(_0x573cdd){if(!_0x573cdd){_0x2d20d2[_0x188c('0x17')](0x194);}return _0x573cdd;};}function handleError(_0x5ea35d,_0x5385ae){_0x5385ae=_0x5385ae||0x1f4;return function(_0x16f7ea){logger[_0x188c('0x23')](_0x16f7ea[_0x188c('0x24')]);if(_0x16f7ea[_0x188c('0x25')]){delete _0x16f7ea['name'];}_0x5ea35d[_0x188c('0x19')](_0x5385ae)[_0x188c('0x26')](_0x16f7ea);};}exports[_0x188c('0x27')]=function(_0x2dccae,_0x3e4683){var _0x9a94a2={},_0x247151={},_0x1218e8={'count':0x0,'rows':[]};var _0x370714=_['map'](db['VoiceTransferReport'][_0x188c('0x28')],function(_0x19635c){return{'name':_0x19635c[_0x188c('0x29')],'type':_0x19635c['type'][_0x188c('0x2a')]};});_0x247151[_0x188c('0x2b')]=_[_0x188c('0x2c')](_0x370714,_0x188c('0x25'));_0x247151[_0x188c('0x2d')]=_['keys'](_0x2dccae[_0x188c('0x2d')]);_0x247151[_0x188c('0x2e')]=_[_0x188c('0x2f')](_0x247151[_0x188c('0x2b')],_0x247151[_0x188c('0x2d')]);_0x9a94a2[_0x188c('0x30')]=_[_0x188c('0x2f')](_0x247151[_0x188c('0x2b')],qs[_0x188c('0x31')](_0x2dccae['query'][_0x188c('0x31')]));_0x9a94a2[_0x188c('0x30')]=_0x9a94a2[_0x188c('0x30')][_0x188c('0x32')]?_0x9a94a2[_0x188c('0x30')]:_0x247151[_0x188c('0x2b')];if(!_0x2dccae[_0x188c('0x2d')][_0x188c('0x33')]('nolimit')){_0x9a94a2[_0x188c('0x1c')]=qs[_0x188c('0x1c')](_0x2dccae[_0x188c('0x2d')][_0x188c('0x1c')]);_0x9a94a2[_0x188c('0x1b')]=qs[_0x188c('0x1b')](_0x2dccae[_0x188c('0x2d')]['offset']);}_0x9a94a2[_0x188c('0x34')]=qs[_0x188c('0x35')](_0x2dccae[_0x188c('0x2d')][_0x188c('0x35')]);_0x9a94a2[_0x188c('0x36')]=qs['filters'](_[_0x188c('0x37')](_0x2dccae[_0x188c('0x2d')],_0x247151['filters']),_0x370714);if(_0x2dccae[_0x188c('0x2d')][_0x188c('0x38')]){_0x9a94a2['where']=_[_0x188c('0x39')](_0x9a94a2[_0x188c('0x36')],{'$or':_[_0x188c('0x2c')](_0x370714,function(_0x108957){if(_0x108957[_0x188c('0x3a')]!=='VIRTUAL'){var _0x55a66f={};_0x55a66f[_0x108957['name']]={'$like':'%'+_0x2dccae[_0x188c('0x2d')][_0x188c('0x38')]+'%'};return _0x55a66f;}})});}_0x9a94a2=_['merge']({},_0x9a94a2,_0x2dccae[_0x188c('0x3b')]);var _0x3a9179={'where':_0x9a94a2[_0x188c('0x36')]};return db[_0x188c('0x3c')][_0x188c('0x1e')](_0x3a9179)['then'](function(_0x1deb3f){_0x1218e8['count']=_0x1deb3f;if(_0x2dccae[_0x188c('0x2d')]['includeAll']){_0x9a94a2[_0x188c('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x188c('0x3e')](_0x9a94a2);})[_0x188c('0x22')](function(_0x458640){_0x1218e8['rows']=_0x458640;return _0x1218e8;})['then'](respondWithFilteredResult(_0x3e4683,_0x9a94a2))['catch'](handleError(_0x3e4683,null));};exports[_0x188c('0x3f')]=function(_0xcdef55,_0x38d2e9){var _0x443377={'raw':!![],'where':{'id':_0xcdef55[_0x188c('0x40')]['id']}},_0x1516d4={};_0x1516d4['model']=_[_0x188c('0x41')](db[_0x188c('0x3c')][_0x188c('0x28')]);_0x1516d4[_0x188c('0x2d')]=_[_0x188c('0x41')](_0xcdef55[_0x188c('0x2d')]);_0x1516d4[_0x188c('0x2e')]=_[_0x188c('0x2f')](_0x1516d4[_0x188c('0x2b')],_0x1516d4['query']);_0x443377['attributes']=_[_0x188c('0x2f')](_0x1516d4[_0x188c('0x2b')],qs[_0x188c('0x31')](_0xcdef55[_0x188c('0x2d')]['fields']));_0x443377[_0x188c('0x30')]=_0x443377['attributes'][_0x188c('0x32')]?_0x443377[_0x188c('0x30')]:_0x1516d4[_0x188c('0x2b')];if(_0xcdef55['query'][_0x188c('0x42')]){_0x443377[_0x188c('0x3d')]=[{'all':!![]}];}_0x443377=_[_0x188c('0x39')]({},_0x443377,_0xcdef55[_0x188c('0x3b')]);return db[_0x188c('0x3c')]['find'](_0x443377)[_0x188c('0x22')](handleEntityNotFound(_0x38d2e9,null))['then'](respondWithResult(_0x38d2e9,null))[_0x188c('0x43')](handleError(_0x38d2e9,null));};exports[_0x188c('0x44')]=function(_0x1946fa,_0x32cfde){return db[_0x188c('0x3c')][_0x188c('0x44')](_0x1946fa[_0x188c('0x45')],{})['then'](respondWithResult(_0x32cfde,0xc9))[_0x188c('0x43')](handleError(_0x32cfde,null));};exports[_0x188c('0x46')]=function(_0x2ee923,_0x274fd1){if(_0x2ee923['body']['id']){delete _0x2ee923[_0x188c('0x45')]['id'];}return db['VoiceTransferReport'][_0x188c('0x47')]({'where':{'id':_0x2ee923[_0x188c('0x40')]['id']}})[_0x188c('0x22')](handleEntityNotFound(_0x274fd1,null))[_0x188c('0x22')](saveUpdates(_0x2ee923[_0x188c('0x45')],null))[_0x188c('0x22')](respondWithResult(_0x274fd1,null))[_0x188c('0x43')](handleError(_0x274fd1,null));};exports[_0x188c('0x48')]=function(_0x4d0e3e,_0x1d47f0){return db[_0x188c('0x3c')][_0x188c('0x47')]({'where':{'id':_0x4d0e3e['params']['id']}})['then'](handleEntityNotFound(_0x1d47f0,null))[_0x188c('0x22')](removeEntity(_0x1d47f0,null))[_0x188c('0x43')](handleError(_0x1d47f0,null));};exports[_0x188c('0x49')]=function(_0x4a01fe,_0x445c6f){return db[_0x188c('0x3c')][_0x188c('0x49')]()[_0x188c('0x22')](respondWithResult(_0x445c6f,null))[_0x188c('0x43')](handleError(_0x445c6f,null));};
\ No newline at end of file
+var _0xb83a=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','name','send','index','map','VoiceTransferReport','rawAttributes','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','type','merge','includeAll','include','findAll','rows','params','keys','length','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0xb83a,0x184));var _0xab83=function(_0x3ee348,_0x1dc943){_0x3ee348=_0x3ee348-0x0;var _0x2e72be=_0xb83a[_0x3ee348];return _0x2e72be;};'use strict';var emlformat=require(_0xab83('0x0'));var rimraf=require(_0xab83('0x1'));var zipdir=require(_0xab83('0x2'));var jsonpatch=require(_0xab83('0x3'));var rp=require(_0xab83('0x4'));var moment=require('moment');var BPromise=require(_0xab83('0x5'));var Mustache=require(_0xab83('0x6'));var util=require(_0xab83('0x7'));var path=require(_0xab83('0x8'));var sox=require(_0xab83('0x9'));var csv=require(_0xab83('0xa'));var ejs=require(_0xab83('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab83('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xab83('0xd'));var toCsv=require(_0xab83('0xa'));var querystring=require(_0xab83('0xe'));var Papa=require('papaparse');var Redis=require(_0xab83('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xab83('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab83('0x11'));var logger=require(_0xab83('0x12'))(_0xab83('0x13'));var utils=require(_0xab83('0x14'));var config=require(_0xab83('0x15'));var licenseUtil=require(_0xab83('0x16'));var db=require(_0xab83('0x17'))['db'];function respondWithStatusCode(_0x373c64,_0x24bdef){_0x24bdef=_0x24bdef||0xcc;return function(_0x21776b){if(_0x21776b){return _0x373c64[_0xab83('0x18')](_0x24bdef);}return _0x373c64[_0xab83('0x19')](_0x24bdef)[_0xab83('0x1a')]();};}function respondWithResult(_0x11ec85,_0x428c4a){_0x428c4a=_0x428c4a||0xc8;return function(_0x227c77){if(_0x227c77){return _0x11ec85[_0xab83('0x19')](_0x428c4a)[_0xab83('0x1b')](_0x227c77);}};}function respondWithFilteredResult(_0x1f4198,_0x36c1e5){return function(_0x5c55ef){if(_0x5c55ef){var _0x11ccd0=typeof _0x36c1e5['offset']===_0xab83('0x1c')&&typeof _0x36c1e5[_0xab83('0x1d')]===_0xab83('0x1c');var _0x3f6366=_0x5c55ef['count'];var _0x369317=_0x11ccd0?0x0:_0x36c1e5[_0xab83('0x1e')];var _0x566fd3=_0x11ccd0?_0x5c55ef[_0xab83('0x1f')]:_0x36c1e5[_0xab83('0x1e')]+_0x36c1e5[_0xab83('0x1d')];var _0x40d3f0;if(_0x566fd3>=_0x3f6366){_0x566fd3=_0x3f6366;_0x40d3f0=0xc8;}else{_0x40d3f0=0xce;}_0x1f4198[_0xab83('0x19')](_0x40d3f0);return _0x1f4198[_0xab83('0x20')](_0xab83('0x21'),_0x369317+'-'+_0x566fd3+'/'+_0x3f6366)['json'](_0x5c55ef);}return null;};}function patchUpdates(_0x6b8465){return function(_0x2cd86a){try{jsonpatch[_0xab83('0x22')](_0x2cd86a,_0x6b8465,!![]);}catch(_0x2b862b){return BPromise['reject'](_0x2b862b);}return _0x2cd86a['save']();};}function saveUpdates(_0x25d2c1,_0x22302d){return function(_0x2f17c9){if(_0x2f17c9){return _0x2f17c9[_0xab83('0x23')](_0x25d2c1)[_0xab83('0x24')](function(_0x129ac8){return _0x129ac8;});}return null;};}function removeEntity(_0x57d4ca,_0x5dd6ad){return function(_0x149f39){if(_0x149f39){return _0x149f39['destroy']()[_0xab83('0x24')](function(){_0x57d4ca[_0xab83('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2338b8,_0x1c7f50){return function(_0x30a608){if(!_0x30a608){_0x2338b8['sendStatus'](0x194);}return _0x30a608;};}function handleError(_0x1bdd1f,_0x26fa39){_0x26fa39=_0x26fa39||0x1f4;return function(_0x541c69){logger['error'](_0x541c69['stack']);if(_0x541c69[_0xab83('0x25')]){delete _0x541c69[_0xab83('0x25')];}_0x1bdd1f[_0xab83('0x19')](_0x26fa39)[_0xab83('0x26')](_0x541c69);};}exports[_0xab83('0x27')]=function(_0x573acf,_0x4f042d){var _0x5507c7={},_0x774c85={},_0x4889f1={'count':0x0,'rows':[]};var _0x123176=_[_0xab83('0x28')](db[_0xab83('0x29')][_0xab83('0x2a')],function(_0x46614b){return{'name':_0x46614b['fieldName'],'type':_0x46614b['type']['key']};});_0x774c85[_0xab83('0x2b')]=_[_0xab83('0x28')](_0x123176,_0xab83('0x25'));_0x774c85[_0xab83('0x2c')]=_['keys'](_0x573acf[_0xab83('0x2c')]);_0x774c85[_0xab83('0x2d')]=_[_0xab83('0x2e')](_0x774c85[_0xab83('0x2b')],_0x774c85[_0xab83('0x2c')]);_0x5507c7['attributes']=_[_0xab83('0x2e')](_0x774c85[_0xab83('0x2b')],qs[_0xab83('0x2f')](_0x573acf[_0xab83('0x2c')][_0xab83('0x2f')]));_0x5507c7[_0xab83('0x30')]=_0x5507c7[_0xab83('0x30')]['length']?_0x5507c7['attributes']:_0x774c85[_0xab83('0x2b')];if(!_0x573acf[_0xab83('0x2c')][_0xab83('0x31')]('nolimit')){_0x5507c7[_0xab83('0x1d')]=qs[_0xab83('0x1d')](_0x573acf[_0xab83('0x2c')][_0xab83('0x1d')]);_0x5507c7[_0xab83('0x1e')]=qs[_0xab83('0x1e')](_0x573acf[_0xab83('0x2c')]['offset']);}_0x5507c7['order']=qs['sort'](_0x573acf[_0xab83('0x2c')][_0xab83('0x32')]);_0x5507c7[_0xab83('0x33')]=qs['filters'](_[_0xab83('0x34')](_0x573acf[_0xab83('0x2c')],_0x774c85[_0xab83('0x2d')]),_0x123176);if(_0x573acf[_0xab83('0x2c')][_0xab83('0x35')]){_0x5507c7['where']=_['merge'](_0x5507c7[_0xab83('0x33')],{'$or':_[_0xab83('0x28')](_0x123176,function(_0xc0efb8){if(_0xc0efb8[_0xab83('0x36')]!=='VIRTUAL'){var _0x53ecb5={};_0x53ecb5[_0xc0efb8[_0xab83('0x25')]]={'$like':'%'+_0x573acf[_0xab83('0x2c')][_0xab83('0x35')]+'%'};return _0x53ecb5;}})});}_0x5507c7=_[_0xab83('0x37')]({},_0x5507c7,_0x573acf['options']);var _0x4fbfb3={'where':_0x5507c7[_0xab83('0x33')]};return db[_0xab83('0x29')][_0xab83('0x1f')](_0x4fbfb3)[_0xab83('0x24')](function(_0x36cb56){_0x4889f1['count']=_0x36cb56;if(_0x573acf[_0xab83('0x2c')][_0xab83('0x38')]){_0x5507c7[_0xab83('0x39')]=[{'all':!![]}];}return db[_0xab83('0x29')][_0xab83('0x3a')](_0x5507c7);})[_0xab83('0x24')](function(_0x29e2bd){_0x4889f1[_0xab83('0x3b')]=_0x29e2bd;return _0x4889f1;})['then'](respondWithFilteredResult(_0x4f042d,_0x5507c7))['catch'](handleError(_0x4f042d,null));};exports['show']=function(_0x25928a,_0x1c3a6a){var _0x3f4de4={'raw':!![],'where':{'id':_0x25928a[_0xab83('0x3c')]['id']}},_0x410cb6={};_0x410cb6[_0xab83('0x2b')]=_[_0xab83('0x3d')](db['VoiceTransferReport'][_0xab83('0x2a')]);_0x410cb6[_0xab83('0x2c')]=_[_0xab83('0x3d')](_0x25928a['query']);_0x410cb6[_0xab83('0x2d')]=_[_0xab83('0x2e')](_0x410cb6[_0xab83('0x2b')],_0x410cb6[_0xab83('0x2c')]);_0x3f4de4['attributes']=_[_0xab83('0x2e')](_0x410cb6['model'],qs[_0xab83('0x2f')](_0x25928a[_0xab83('0x2c')][_0xab83('0x2f')]));_0x3f4de4[_0xab83('0x30')]=_0x3f4de4['attributes'][_0xab83('0x3e')]?_0x3f4de4['attributes']:_0x410cb6[_0xab83('0x2b')];if(_0x25928a['query']['includeAll']){_0x3f4de4[_0xab83('0x39')]=[{'all':!![]}];}_0x3f4de4=_['merge']({},_0x3f4de4,_0x25928a['options']);return db['VoiceTransferReport']['find'](_0x3f4de4)['then'](handleEntityNotFound(_0x1c3a6a,null))[_0xab83('0x24')](respondWithResult(_0x1c3a6a,null))['catch'](handleError(_0x1c3a6a,null));};exports[_0xab83('0x3f')]=function(_0x6cb3c2,_0x5e8427){return db[_0xab83('0x29')]['create'](_0x6cb3c2[_0xab83('0x40')],{})['then'](respondWithResult(_0x5e8427,0xc9))[_0xab83('0x41')](handleError(_0x5e8427,null));};exports['update']=function(_0x7bb088,_0x1ee308){if(_0x7bb088['body']['id']){delete _0x7bb088['body']['id'];}return db[_0xab83('0x29')][_0xab83('0x42')]({'where':{'id':_0x7bb088['params']['id']}})['then'](handleEntityNotFound(_0x1ee308,null))[_0xab83('0x24')](saveUpdates(_0x7bb088[_0xab83('0x40')],null))[_0xab83('0x24')](respondWithResult(_0x1ee308,null))[_0xab83('0x41')](handleError(_0x1ee308,null));};exports['destroy']=function(_0x2feadb,_0x4f9d92){return db[_0xab83('0x29')][_0xab83('0x42')]({'where':{'id':_0x2feadb[_0xab83('0x3c')]['id']}})[_0xab83('0x24')](handleEntityNotFound(_0x4f9d92,null))[_0xab83('0x24')](removeEntity(_0x4f9d92,null))[_0xab83('0x41')](handleError(_0x4f9d92,null));};exports[_0xab83('0x43')]=function(_0xb89229,_0x560336){return db[_0xab83('0x29')]['describe']()[_0xab83('0x24')](respondWithResult(_0x560336,null))[_0xab83('0x41')](handleError(_0x560336,null));};
\ No newline at end of file
index 13ca167..6ebda40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2df1=['exports','report_call_transfer','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0x2df1,0x1e2));var _0x12df=function(_0x5475af,_0x46cc50){_0x5475af=_0x5475af-0x0;var _0x384bb2=_0x2df1[_0x5475af];return _0x384bb2;};'use strict';var _=require('lodash');var util=require(_0x12df('0x0'));var logger=require(_0x12df('0x1'))('api');var moment=require(_0x12df('0x2'));var BPromise=require(_0x12df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x12df('0x4'));var rimraf=require(_0x12df('0x5'));var config=require(_0x12df('0x6'));var attributes=require(_0x12df('0x7'));module[_0x12df('0x8')]=function(_0x39cc54,_0x529958){return _0x39cc54['define']('VoiceTransferReport',attributes,{'tableName':_0x12df('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x431a=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer'];(function(_0x746f4d,_0xb3b407){var _0x2b1e31=function(_0x270f64){while(--_0x270f64){_0x746f4d['push'](_0x746f4d['shift']());}};_0x2b1e31(++_0xb3b407);}(_0x431a,0x174));var _0xa431=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x431a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa431('0x0'));var util=require(_0xa431('0x1'));var logger=require('../../config/logger')(_0xa431('0x2'));var moment=require(_0xa431('0x3'));var BPromise=require(_0xa431('0x4'));var rp=require(_0xa431('0x5'));var fs=require('fs');var path=require(_0xa431('0x6'));var rimraf=require('rimraf');var config=require(_0xa431('0x7'));var attributes=require(_0xa431('0x8'));module[_0xa431('0x9')]=function(_0x521b62,_0xb6f6c4){return _0x521b62['define'](_0xa431('0xa'),attributes,{'tableName':_0xa431('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b640b09..d67cb5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac5c=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateVoiceTransferReport','body','options','then','catch','lodash','util'];(function(_0x4d9d57,_0x3f6a67){var _0x3bd393=function(_0x2a8828){while(--_0x2a8828){_0x4d9d57['push'](_0x4d9d57['shift']());}};_0x3bd393(++_0x3f6a67);}(_0xac5c,0x178));var _0xcac5=function(_0x598174,_0x258e72){_0x598174=_0x598174-0x0;var _0x4e1fcf=_0xac5c[_0x598174];return _0x4e1fcf;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require(_0xcac5('0x2'));var BPromise=require(_0xcac5('0x3'));var rs=require(_0xcac5('0x4'));var fs=require('fs');var Redis=require(_0xcac5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcac5('0x6'));var logger=require(_0xcac5('0x7'))(_0xcac5('0x8'));var config=require(_0xcac5('0x9'));var jayson=require(_0xcac5('0xa'));var client=jayson[_0xcac5('0xb')][_0xcac5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6affb,_0x4159c7,_0x1cc728){return new BPromise(function(_0x395f30,_0xd3d65c){return client['request'](_0xe6affb,_0x1cc728)['then'](function(_0x4e35c7){logger[_0xcac5('0xd')](_0xcac5('0xe'),_0x4159c7,_0xcac5('0xf'));logger[_0xcac5('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x4159c7,_0xcac5('0xf'),JSON[_0xcac5('0x11')](_0x4e35c7));if(_0x4e35c7[_0xcac5('0x12')]){if(_0x4e35c7[_0xcac5('0x12')][_0xcac5('0x13')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x4159c7,_0x4e35c7['error'][_0xcac5('0x14')]);return _0xd3d65c(_0x4e35c7[_0xcac5('0x12')][_0xcac5('0x14')]);}logger[_0xcac5('0x12')](_0xcac5('0xe'),_0x4159c7,_0x4e35c7[_0xcac5('0x12')][_0xcac5('0x14')]);return _0x395f30(_0x4e35c7[_0xcac5('0x12')][_0xcac5('0x14')]);}else{logger['info'](_0xcac5('0xe'),_0x4159c7,'request\x20sent');_0x395f30(_0x4e35c7[_0xcac5('0x15')][_0xcac5('0x14')]);}})['catch'](function(_0x1b5daf){logger[_0xcac5('0x12')](_0xcac5('0xe'),_0x4159c7,_0x1b5daf);_0xd3d65c(_0x1b5daf);});});}exports[_0xcac5('0x16')]=function(_0x59f410){var _0x40f5d3=this;return new Promise(function(_0x2f65cb,_0x2ac3ee){return db['VoiceTransferReport']['create'](_0x59f410[_0xcac5('0x17')],{'raw':_0x59f410[_0xcac5('0x18')]?_0x59f410[_0xcac5('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xcac5('0x19')](function(_0x57b156){logger[_0xcac5('0xd')](_0xcac5('0x16'),_0x59f410);logger[_0xcac5('0x10')]('CreateVoiceTransferReport',_0x59f410,JSON[_0xcac5('0x11')](_0x57b156));_0x2f65cb(_0x57b156);})[_0xcac5('0x1a')](function(_0xcf8c18){logger[_0xcac5('0x12')](_0xcac5('0x16'),_0xcf8c18[_0xcac5('0x14')],_0x59f410);_0x2ac3ee(_0x40f5d3[_0xcac5('0x12')](0x1f4,_0xcf8c18[_0xcac5('0x14')]));});});};
\ No newline at end of file
+var _0xc0d0=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceTransferReport,\x20%s,\x20%s','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','then','stringify','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','info'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0xc0d0,0x1db));var _0x0c0d=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xc0d0[_0x122e9b];return _0x22c247;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c0d('0x0'));var BPromise=require('bluebird');var rs=require(_0x0c0d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c0d('0x2'))['db'];var utils=require(_0x0c0d('0x3'));var logger=require(_0x0c0d('0x4'))(_0x0c0d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c0d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x380b18,_0x24d563,_0x5897dd){return new BPromise(function(_0x29dd83,_0x22cb8e){return client['request'](_0x380b18,_0x5897dd)['then'](function(_0x2d4bcc){logger[_0x0c0d('0x7')]('VoiceTransferReport,\x20%s,\x20%s',_0x24d563,'request\x20sent');logger[_0x0c0d('0x8')](_0x0c0d('0x9'),_0x24d563,_0x0c0d('0xa'),JSON['stringify'](_0x2d4bcc));if(_0x2d4bcc['error']){if(_0x2d4bcc[_0x0c0d('0xb')][_0x0c0d('0xc')]===0x1f4){logger[_0x0c0d('0xb')](_0x0c0d('0xd'),_0x24d563,_0x2d4bcc[_0x0c0d('0xb')]['message']);return _0x22cb8e(_0x2d4bcc[_0x0c0d('0xb')][_0x0c0d('0xe')]);}logger[_0x0c0d('0xb')](_0x0c0d('0xd'),_0x24d563,_0x2d4bcc[_0x0c0d('0xb')][_0x0c0d('0xe')]);return _0x29dd83(_0x2d4bcc[_0x0c0d('0xb')][_0x0c0d('0xe')]);}else{logger[_0x0c0d('0x7')]('VoiceTransferReport,\x20%s,\x20%s',_0x24d563,'request\x20sent');_0x29dd83(_0x2d4bcc['result'][_0x0c0d('0xe')]);}})[_0x0c0d('0xf')](function(_0x1815b3){logger[_0x0c0d('0xb')](_0x0c0d('0xd'),_0x24d563,_0x1815b3);_0x22cb8e(_0x1815b3);});});}exports[_0x0c0d('0x10')]=function(_0x273759){var _0x2e470f=this;return new Promise(function(_0x33e66b,_0x1c920c){return db[_0x0c0d('0x11')][_0x0c0d('0x12')](_0x273759[_0x0c0d('0x13')],{'raw':_0x273759[_0x0c0d('0x14')]?_0x273759[_0x0c0d('0x14')]['raw']===undefined?!![]:![]:!![]})[_0x0c0d('0x15')](function(_0x259644){logger[_0x0c0d('0x7')]('CreateVoiceTransferReport',_0x273759);logger[_0x0c0d('0x8')](_0x0c0d('0x10'),_0x273759,JSON[_0x0c0d('0x16')](_0x259644));_0x33e66b(_0x259644);})[_0x0c0d('0xf')](function(_0x3622fe){logger['error'](_0x0c0d('0x10'),_0x3622fe[_0x0c0d('0xe')],_0x273759);_0x1c920c(_0x2e470f[_0x0c0d('0xb')](0x1f4,_0x3622fe[_0x0c0d('0xe')]));});});};
\ No newline at end of file
index 7ad40b6..fecc312 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaee=['/calls','calls','/transfer','transfer','express','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','canUpdate','originate','post','hangup','/answer','answer','hold','/unhold','unhold'];(function(_0x51edca,_0x18ad70){var _0x2b77ec=function(_0x55a549){while(--_0x55a549){_0x51edca['push'](_0x51edca['shift']());}};_0x2b77ec(++_0x18ad70);}(_0xcaee,0xee));var _0xecae=function(_0x2f4112,_0x4a2758){_0x2f4112=_0x2f4112-0x0;var _0x12d4a0=_0xcaee[_0x2f4112];return _0x12d4a0;};'use strict';var express=require(_0xecae('0x0'));var router=express['Router']();var auth=require(_0xecae('0x1'));var controller=require(_0xecae('0x2'));router['post'](_0xecae('0x3'),auth[_0xecae('0x4')](),auth[_0xecae('0x5')](),controller[_0xecae('0x6')]);router[_0xecae('0x7')]('/hangup',auth['isAuthenticated'](),auth[_0xecae('0x5')](),controller[_0xecae('0x8')]);router[_0xecae('0x7')](_0xecae('0x9'),auth[_0xecae('0x4')](),auth['canUpdate'](),controller[_0xecae('0xa')]);router[_0xecae('0x7')]('/hold',auth[_0xecae('0x4')](),auth[_0xecae('0x5')](),controller[_0xecae('0xb')]);router[_0xecae('0x7')](_0xecae('0xc'),auth[_0xecae('0x4')](),auth['canUpdate'](),controller[_0xecae('0xd')]);router[_0xecae('0x7')](_0xecae('0xe'),auth[_0xecae('0x4')](),auth['canUpdate'](),controller[_0xecae('0xf')]);router[_0xecae('0x7')](_0xecae('0x10'),auth[_0xecae('0x4')](),auth[_0xecae('0x5')](),controller[_0xecae('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x24b3=['/transfer','exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','/answer','/hold','hold','/unhold','unhold','/calls','calls'];(function(_0x382df0,_0x216777){var _0x94b5df=function(_0x145ca0){while(--_0x145ca0){_0x382df0['push'](_0x382df0['shift']());}};_0x94b5df(++_0x216777);}(_0x24b3,0x1b2));var _0x324b=function(_0x2faa72,_0x3ad645){_0x2faa72=_0x2faa72-0x0;var _0x524276=_0x24b3[_0x2faa72];return _0x524276;};'use strict';var express=require(_0x324b('0x0'));var router=express[_0x324b('0x1')]();var auth=require(_0x324b('0x2'));var controller=require('./webbar.controller');router[_0x324b('0x3')](_0x324b('0x4'),auth[_0x324b('0x5')](),auth[_0x324b('0x6')](),controller[_0x324b('0x7')]);router['post'](_0x324b('0x8'),auth['isAuthenticated'](),auth[_0x324b('0x6')](),controller['hangup']);router[_0x324b('0x3')](_0x324b('0x9'),auth[_0x324b('0x5')](),auth[_0x324b('0x6')](),controller['answer']);router[_0x324b('0x3')](_0x324b('0xa'),auth[_0x324b('0x5')](),auth['canUpdate'](),controller[_0x324b('0xb')]);router[_0x324b('0x3')](_0x324b('0xc'),auth[_0x324b('0x5')](),auth[_0x324b('0x6')](),controller[_0x324b('0xd')]);router[_0x324b('0x3')](_0x324b('0xe'),auth[_0x324b('0x5')](),auth[_0x324b('0x6')](),controller[_0x324b('0xf')]);router[_0x324b('0x3')](_0x324b('0x10'),auth['isAuthenticated'](),auth['canUpdate'](),controller['transfer']);module[_0x324b('0x11')]=router;
\ No newline at end of file
index 735063e..6ec1591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x131e=['error','stack','name','status','send','NotFound','request','then','code','message','User','findOne','VoiceChannels','all','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','validate','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','catch','user:%s','hangup\x20executed!','answer','answer\x20fired:','sessionId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','filter','conference','conference\x20fired:','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','../../config/environment','util','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis','defaults','number','userId\x20is\x20required','callNumber\x20is\x20required','string','transferNumber\x20is\x20required','info','stringify','log','handleError:'];(function(_0x25873e,_0x3771d5){var _0x348a49=function(_0x36605f){while(--_0x36605f){_0x25873e['push'](_0x25873e['shift']());}};_0x348a49(++_0x3771d5);}(_0x131e,0x1ec));var _0xe131=function(_0x847067,_0x2a2002){_0x847067=_0x847067-0x0;var _0x19c4ba=_0x131e[_0x847067];return _0x19c4ba;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xe131('0x0'));var util=require(_0xe131('0x1'));var BPromise=require(_0xe131('0x2'));var jayson=require(_0xe131('0x3'));var amiClient=jayson[_0xe131('0x4')][_0xe131('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0xe131('0x6'));var Redis=require(_0xe131('0x7'));config[_0xe131('0x8')]=_[_0xe131('0x9')](config[_0xe131('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'callNumber':{'type':'string','required':[!![],_0xe131('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xe131('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xe131('0xd'),'required':[!![],_0xe131('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],_0xe131('0xb')]},'sessionId':{'type':_0xe131('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe131('0xa'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x5a6ca9,_0x4987dc,_0x2628e7){logger[_0xe131('0xf')](_0x5a6ca9,_0x4987dc,JSON[_0xe131('0x10')](_0x2628e7));io['to'](_0x5a6ca9)['emit'](_0x4987dc,_0x2628e7);}function handleError(_0x503e86){return function(_0x400f6b){console[_0xe131('0x11')](_0xe131('0x12'),_0x400f6b,_0x400f6b instanceof RangeError);logger[_0xe131('0x13')](_0x400f6b[_0xe131('0x14')]);if(_0x400f6b instanceof RangeError){if(_0x400f6b[_0xe131('0x15')]){delete _0x400f6b['name'];}_0x503e86[_0xe131('0x16')](0x194)[_0xe131('0x17')](_0x400f6b);}else{if(_0x400f6b[_0xe131('0x15')]){delete _0x400f6b[_0xe131('0x15')];}_0x503e86[_0xe131('0x16')](0x1f4)['send'](_0x400f6b);}};}function checkError(){return function(_0x4c24e5){if(!_0x4c24e5){throw new RangeError(_0xe131('0x18'));}return _0x4c24e5;};}function respondWithRpcPromise(_0x41c4e1,_0x5207c6){return new BPromise(function(_0x42df0a,_0x55b0c5){var _0x49f304=amiClient;return _0x49f304[_0xe131('0x19')](_0x41c4e1,_0x5207c6)[_0xe131('0x1a')](function(_0x473bb4){if(_0x473bb4[_0xe131('0x13')]){if(_0x473bb4[_0xe131('0x13')][_0xe131('0x1b')]===0x1f4){return _0x55b0c5(_0x473bb4[_0xe131('0x13')]['message']);}return _0x42df0a(_0x473bb4[_0xe131('0x13')][_0xe131('0x1c')]);}else{_0x42df0a(_0x473bb4['result']);}})['catch'](function(_0x330638){_0x55b0c5(_0x330638);});});}function getAgent(_0x5b2f47){return db[_0xe131('0x1d')][_0xe131('0x1e')]({'where':{'id':_0x5b2f47,'role':'agent'}})[_0xe131('0x1a')](checkError());}function getAgentCheckSession(_0x3959ac,_0x41a3e9){return new BPromise(function(_0x499ca8,_0x29243d){var _0x442279=respondWithRpcPromise(_0xe131('0x1f'));var _0x10d504=getAgent(_0x3959ac);Promise[_0xe131('0x20')]([_0x442279,_0x10d504])[_0xe131('0x1a')](function(_0x1ff557){var _0x3414f1=_0x1ff557[0x0];var _0x9f8c66=_0x1ff557[0x1];var _0x341294=_['filter'](_0x3414f1[_0xe131('0x21')],function(_0x554b62){return _0x554b62[_0xe131('0x22')]==_0x9f8c66['id']&&_0x554b62['sessionId']==_0x41a3e9;});if(_0x341294[_0xe131('0x23')]==0x1){_0x499ca8(_0x9f8c66);}else{_0x29243d(new RangeError('sessionId\x20'+_0x41a3e9+_0xe131('0x24')));}});});}exports[_0xe131('0x25')]=function(_0x306082,_0x481e50){logger['info'](_0xe131('0x26'),_0x306082[_0xe131('0x27')]);var _0x11f163=originateValidation[_0xe131('0x28')](_0x306082[_0xe131('0x27')]);if(_0x11f163[_0xe131('0x23')]>0x0){return _0x481e50[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x11f163);}var _0x5347ee=_0x306082['body'][_0xe131('0x2a')];var _0x6c7586=_0x306082[_0xe131('0x27')][_0xe131('0x2b')];var _0x2c17f6=_0x306082[_0xe131('0x27')][_0xe131('0x2c')];var _0x4d2327=_0x306082['body'][_0xe131('0x2d')];return getAgent(_0x5347ee)['then'](function(_0x26bf39){logger['info'](_0xe131('0x2e'),_0x26bf39['name']);emit(util[_0xe131('0x2f')]('user:%s',_0x26bf39[_0xe131('0x15')]),_0xe131('0x30'),{'callNumber':_0x6c7586,'callerId':_0x2c17f6,'callbackUrl':_0x4d2327});return _0x481e50[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x31')});})[_0xe131('0x32')](handleError(_0x481e50));};exports['hangup']=function(_0x2ecc0c,_0x4dafaf){logger[_0xe131('0xf')]('hangup\x20fired:',_0x2ecc0c[_0xe131('0x27')]);var _0x26a679=hangupValidation[_0xe131('0x28')](_0x2ecc0c[_0xe131('0x27')]);if(_0x26a679[_0xe131('0x23')]>0x0){return _0x4dafaf[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x26a679);}var _0x5a5498=_0x2ecc0c[_0xe131('0x27')]['userId'];var _0x1103fc=_0x2ecc0c[_0xe131('0x27')]['sessionId'];return getAgent(_0x5a5498)['then'](function(_0x205fa2){logger['info']('entityFound:',_0x205fa2[_0xe131('0x15')]);emit(util['format'](_0xe131('0x33'),_0x205fa2[_0xe131('0x15')]),'webbar:hangup',{'sessionId':_0x1103fc});return _0x4dafaf[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x34')});})[_0xe131('0x32')](handleError(_0x4dafaf));};exports[_0xe131('0x35')]=function(_0x4985d9,_0x512409){logger[_0xe131('0xf')](_0xe131('0x36'),_0x4985d9[_0xe131('0x27')]);var _0x58fe5c=answerValidation[_0xe131('0x28')](_0x4985d9[_0xe131('0x27')]);if(_0x58fe5c[_0xe131('0x23')]>0x0){return _0x512409['status'](0x190)[_0xe131('0x29')](_0x58fe5c);}var _0x1c9c6d=_0x4985d9[_0xe131('0x27')]['userId'];var _0x1da932=_0x4985d9[_0xe131('0x27')][_0xe131('0x37')];return getAgent(_0x1c9c6d)['then'](function(_0x1663a9){logger[_0xe131('0xf')](_0xe131('0x2e'),_0x1663a9[_0xe131('0x15')]);emit(util[_0xe131('0x2f')](_0xe131('0x33'),_0x1663a9[_0xe131('0x15')]),'webbar:answer',{'sessionId':_0x1da932});return _0x512409['status'](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x38')});})[_0xe131('0x32')](handleError(_0x512409));};exports[_0xe131('0x39')]=function(_0xb1c607,_0x402767){logger['info'](_0xe131('0x3a'),_0xb1c607[_0xe131('0x27')]);var _0x268cc6=holdValidation[_0xe131('0x28')](_0xb1c607[_0xe131('0x27')]);if(_0x268cc6[_0xe131('0x23')]>0x0){return _0x402767['status'](0x190)[_0xe131('0x29')](_0x268cc6);}var _0x1ce9b7=_0xb1c607[_0xe131('0x27')][_0xe131('0x2a')];var _0x1a9e5c=_0xb1c607[_0xe131('0x27')][_0xe131('0x37')];return getAgent(_0x1ce9b7)[_0xe131('0x1a')](function(_0x3d7ae8){logger[_0xe131('0xf')](_0xe131('0x2e'),_0x3d7ae8['name']);emit(util[_0xe131('0x2f')]('user:%s',_0x3d7ae8['name']),_0xe131('0x3b'),{'sessionId':_0x1a9e5c});return _0x402767[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x3c')});})[_0xe131('0x32')](handleError(_0x402767));};exports[_0xe131('0x3d')]=function(_0xf4dbe4,_0x398c39){logger[_0xe131('0xf')](_0xe131('0x3e'),_0xf4dbe4[_0xe131('0x27')]);var _0x509992=unholdValidation['validate'](_0xf4dbe4[_0xe131('0x27')]);if(_0x509992[_0xe131('0x23')]>0x0){return _0x398c39['status'](0x190)['json'](_0x509992);}var _0x2b934b=_0xf4dbe4['body']['userId'];var _0xe0d786=_0xf4dbe4[_0xe131('0x27')][_0xe131('0x37')];return getAgent(_0x2b934b)[_0xe131('0x1a')](function(_0x3d6f45){logger[_0xe131('0xf')]('entityFound:',_0x3d6f45['name']);emit(util[_0xe131('0x2f')](_0xe131('0x33'),_0x3d6f45['name']),_0xe131('0x3f'),{'sessionId':_0xe0d786});return _0x398c39[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x40')});})[_0xe131('0x32')](handleError(_0x398c39));};exports[_0xe131('0x41')]=function(_0x4a9ad6,_0x23d880){logger['info']('calls\x20fired:',_0x23d880[_0xe131('0x27')]);var _0x3ff68b=callsValidation['validate'](_0x4a9ad6['body']);if(_0x3ff68b[_0xe131('0x23')]>0x0){return _0x23d880[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x3ff68b);}var _0x51628f=_0x4a9ad6[_0xe131('0x27')][_0xe131('0x2a')];var _0x45d00d=respondWithRpcPromise(_0xe131('0x1f'));var _0x2a65fd=getAgent(_0x51628f);return Promise['all']([_0x45d00d,_0x2a65fd])[_0xe131('0x1a')](function(_0x5185dd){var _0x4347f0=_0x5185dd[0x0];var _0x45ac9c=_0x5185dd[0x1];var _0xc398e5=_[_0xe131('0x42')](_0x4347f0['rows'],function(_0x498fe0){return _0x498fe0['UserId']==_0x45ac9c['id'];});return _0x23d880[_0xe131('0x16')](0xc8)['json']({'count':_0xc398e5[_0xe131('0x23')],'rows':_0xc398e5});})[_0xe131('0x32')](handleError(_0x23d880));};exports[_0xe131('0x43')]=function(_0x160f60,_0x61ea25){logger[_0xe131('0xf')](_0xe131('0x44'),_0x160f60[_0xe131('0x27')]);var _0x1e388e=conferenceValidation[_0xe131('0x28')](_0x160f60['body']);if(_0x1e388e['length']>0x0){return _0x61ea25['status'](0x190)[_0xe131('0x29')](_0x1e388e);}var _0x41932a=_0x160f60[_0xe131('0x27')][_0xe131('0x2a')];return getAgent(_0x41932a)['then'](function(_0x11e2c9){logger[_0xe131('0xf')](_0xe131('0x2e'),_0x11e2c9[_0xe131('0x15')]);emit(util[_0xe131('0x2f')](_0xe131('0x33'),_0x11e2c9['name']),'webbar:conference');return _0x61ea25[_0xe131('0x16')](0xc8)['json']({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x61ea25));};exports[_0xe131('0x45')]=function(_0x4edb0f,_0x2e6f99){logger['info'](_0xe131('0x46'),_0x4edb0f[_0xe131('0x27')]);var _0x2b6cdc=transferValidation[_0xe131('0x28')](_0x4edb0f['body']);if(_0x2b6cdc[_0xe131('0x23')]>0x0){return _0x2e6f99[_0xe131('0x16')](0x190)[_0xe131('0x29')](_0x2b6cdc);}var _0x3c1fe4=_0x4edb0f[_0xe131('0x27')][_0xe131('0x2a')];var _0x497b76=_0x4edb0f[_0xe131('0x27')][_0xe131('0x37')];var _0x4f3b0d=_0x4edb0f[_0xe131('0x27')]['transferNumber'];return getAgent(_0x3c1fe4)['then'](function(_0x6794a){logger['info'](_0xe131('0x2e'),_0x6794a[_0xe131('0x15')]);emit(util[_0xe131('0x2f')]('user:%s',_0x6794a[_0xe131('0x15')]),_0xe131('0x47'),{'sessionId':_0x497b76,'transferNumber':_0x4f3b0d});return _0x2e6f99[_0xe131('0x16')](0xc8)[_0xe131('0x29')]({'error':![],'message':_0xe131('0x48')});})[_0xe131('0x32')](handleError(_0x2e6f99));};
\ No newline at end of file
+var _0x6737=['answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','catch','User','VoiceChannels','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','webbar:hangup','answer\x20fired:','webbar:answer'];(function(_0x17767c,_0x3466d6){var _0x42a70e=function(_0x5834ea){while(--_0x5834ea){_0x17767c['push'](_0x17767c['shift']());}};_0x42a70e(++_0x3466d6);}(_0x6737,0xe2));var _0x7673=function(_0x28c2d7,_0x3ca88e){_0x28c2d7=_0x28c2d7-0x0;var _0x37afa5=_0x6737[_0x28c2d7];return _0x37afa5;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x7673('0x0'));var db=require(_0x7673('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var jayson=require(_0x7673('0x4'));var amiClient=jayson[_0x7673('0x5')]['http']({'port':0x232a});var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var Redis=require('ioredis');config[_0x7673('0x8')]=_[_0x7673('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x7673('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'callNumber':{'type':_0x7673('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x7673('0xc')},'callbackUrl':{'type':_0x7673('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xe')]},'transferNumber':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});function emit(_0x2a2840,_0x4a8ea0,_0x5ed354){logger[_0x7673('0x10')](_0x2a2840,_0x4a8ea0,JSON[_0x7673('0x11')](_0x5ed354));io['to'](_0x2a2840)['emit'](_0x4a8ea0,_0x5ed354);}function handleError(_0x3afbb3){return function(_0x17699a){console['log'](_0x7673('0x12'),_0x17699a,_0x17699a instanceof RangeError);logger[_0x7673('0x13')](_0x17699a[_0x7673('0x14')]);if(_0x17699a instanceof RangeError){if(_0x17699a['name']){delete _0x17699a['name'];}_0x3afbb3[_0x7673('0x15')](0x194)[_0x7673('0x16')](_0x17699a);}else{if(_0x17699a['name']){delete _0x17699a[_0x7673('0x17')];}_0x3afbb3[_0x7673('0x15')](0x1f4)[_0x7673('0x16')](_0x17699a);}};}function checkError(){return function(_0x33eb47){if(!_0x33eb47){throw new RangeError(_0x7673('0x18'));}return _0x33eb47;};}function respondWithRpcPromise(_0x3e28ca,_0x59879a){return new BPromise(function(_0x557161,_0xea9b37){var _0x21774f=amiClient;return _0x21774f[_0x7673('0x19')](_0x3e28ca,_0x59879a)[_0x7673('0x1a')](function(_0x16bb16){if(_0x16bb16['error']){if(_0x16bb16[_0x7673('0x13')][_0x7673('0x1b')]===0x1f4){return _0xea9b37(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}return _0x557161(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}else{_0x557161(_0x16bb16['result']);}})[_0x7673('0x1d')](function(_0xaca974){_0xea9b37(_0xaca974);});});}function getAgent(_0x425897){return db[_0x7673('0x1e')]['findOne']({'where':{'id':_0x425897,'role':'agent'}})[_0x7673('0x1a')](checkError());}function getAgentCheckSession(_0x11b42b,_0x291d10){return new BPromise(function(_0x9d9eab,_0x119a21){var _0x45a045=respondWithRpcPromise(_0x7673('0x1f'));var _0x5a59f9=getAgent(_0x11b42b);Promise['all']([_0x45a045,_0x5a59f9])[_0x7673('0x1a')](function(_0x2d4c0a){var _0x1dd436=_0x2d4c0a[0x0];var _0x335743=_0x2d4c0a[0x1];var _0x12ac6b=_[_0x7673('0x20')](_0x1dd436[_0x7673('0x21')],function(_0x4f12b9){return _0x4f12b9['UserId']==_0x335743['id']&&_0x4f12b9[_0x7673('0x22')]==_0x291d10;});if(_0x12ac6b[_0x7673('0x23')]==0x1){_0x9d9eab(_0x335743);}else{_0x119a21(new RangeError(_0x7673('0x24')+_0x291d10+_0x7673('0x25')));}});});}exports['originate']=function(_0x3aa249,_0x497760){logger[_0x7673('0x10')](_0x7673('0x26'),_0x3aa249[_0x7673('0x27')]);var _0x1b924f=originateValidation[_0x7673('0xa')](_0x3aa249[_0x7673('0x27')]);if(_0x1b924f[_0x7673('0x23')]>0x0){return _0x497760[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1b924f);}var _0x1b6061=_0x3aa249[_0x7673('0x27')][_0x7673('0x29')];var _0x26cccd=_0x3aa249['body'][_0x7673('0x2a')];var _0x42f658=_0x3aa249[_0x7673('0x27')][_0x7673('0x2b')];var _0x30ddec=_0x3aa249[_0x7673('0x27')][_0x7673('0x2c')];return getAgent(_0x1b6061)['then'](function(_0x563e2d){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x563e2d[_0x7673('0x17')]);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x563e2d[_0x7673('0x17')]),_0x7673('0x30'),{'callNumber':_0x26cccd,'callerId':_0x42f658,'callbackUrl':_0x30ddec});return _0x497760['status'](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x31')});})['catch'](handleError(_0x497760));};exports[_0x7673('0x32')]=function(_0x400f3c,_0x287eee){logger[_0x7673('0x10')]('hangup\x20fired:',_0x400f3c[_0x7673('0x27')]);var _0x1f77c0=hangupValidation['validate'](_0x400f3c[_0x7673('0x27')]);if(_0x1f77c0[_0x7673('0x23')]>0x0){return _0x287eee[_0x7673('0x15')](0x190)['json'](_0x1f77c0);}var _0xe50aa5=_0x400f3c[_0x7673('0x27')][_0x7673('0x29')];var _0x5dfb9a=_0x400f3c['body'][_0x7673('0x22')];return getAgent(_0xe50aa5)['then'](function(_0x4ba2b4){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4ba2b4['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4ba2b4[_0x7673('0x17')]),_0x7673('0x33'),{'sessionId':_0x5dfb9a});return _0x287eee[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x7673('0x1d')](handleError(_0x287eee));};exports['answer']=function(_0xf43bb7,_0x52f803){logger[_0x7673('0x10')](_0x7673('0x34'),_0xf43bb7['body']);var _0x5b2e69=answerValidation[_0x7673('0xa')](_0xf43bb7['body']);if(_0x5b2e69[_0x7673('0x23')]>0x0){return _0x52f803[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x5b2e69);}var _0x3b6223=_0xf43bb7[_0x7673('0x27')]['userId'];var _0x4ea8b3=_0xf43bb7[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x3b6223)['then'](function(_0x4005ee){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4005ee['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4005ee[_0x7673('0x17')]),_0x7673('0x35'),{'sessionId':_0x4ea8b3});return _0x52f803[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x36')});})[_0x7673('0x1d')](handleError(_0x52f803));};exports[_0x7673('0x37')]=function(_0x4ed31d,_0x126981){logger[_0x7673('0x10')](_0x7673('0x38'),_0x4ed31d[_0x7673('0x27')]);var _0x332b5a=holdValidation[_0x7673('0xa')](_0x4ed31d[_0x7673('0x27')]);if(_0x332b5a['length']>0x0){return _0x126981[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x332b5a);}var _0x461ac3=_0x4ed31d[_0x7673('0x27')][_0x7673('0x29')];var _0x4b844d=_0x4ed31d[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x461ac3)[_0x7673('0x1a')](function(_0x2397fb){logger[_0x7673('0x10')]('entityFound:',_0x2397fb['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x2397fb['name']),_0x7673('0x39'),{'sessionId':_0x4b844d});return _0x126981[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3a')});})[_0x7673('0x1d')](handleError(_0x126981));};exports['unhold']=function(_0x23789d,_0x3afffa){logger[_0x7673('0x10')](_0x7673('0x3b'),_0x23789d['body']);var _0x1691a5=unholdValidation[_0x7673('0xa')](_0x23789d[_0x7673('0x27')]);if(_0x1691a5[_0x7673('0x23')]>0x0){return _0x3afffa[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1691a5);}var _0x115eef=_0x23789d[_0x7673('0x27')][_0x7673('0x29')];var _0x362409=_0x23789d[_0x7673('0x27')]['sessionId'];return getAgent(_0x115eef)[_0x7673('0x1a')](function(_0x4a0d99){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4a0d99[_0x7673('0x17')]);emit(util['format'](_0x7673('0x2f'),_0x4a0d99[_0x7673('0x17')]),_0x7673('0x3c'),{'sessionId':_0x362409});return _0x3afffa[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3d')});})[_0x7673('0x1d')](handleError(_0x3afffa));};exports[_0x7673('0x3e')]=function(_0x375bca,_0x1064d5){logger[_0x7673('0x10')](_0x7673('0x3f'),_0x1064d5[_0x7673('0x27')]);var _0xb3c9e9=callsValidation['validate'](_0x375bca[_0x7673('0x27')]);if(_0xb3c9e9['length']>0x0){return _0x1064d5[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xb3c9e9);}var _0x1d424a=_0x375bca['body'][_0x7673('0x29')];var _0x5d71b7=respondWithRpcPromise('VoiceChannels');var _0x1804a4=getAgent(_0x1d424a);return Promise['all']([_0x5d71b7,_0x1804a4])['then'](function(_0x1dd141){var _0x3f6ef3=_0x1dd141[0x0];var _0x215a32=_0x1dd141[0x1];var _0xeaa731=_[_0x7673('0x20')](_0x3f6ef3[_0x7673('0x21')],function(_0x151276){return _0x151276[_0x7673('0x40')]==_0x215a32['id'];});return _0x1064d5[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'count':_0xeaa731[_0x7673('0x23')],'rows':_0xeaa731});})['catch'](handleError(_0x1064d5));};exports['conference']=function(_0x2aa032,_0x297744){logger[_0x7673('0x10')](_0x7673('0x41'),_0x2aa032[_0x7673('0x27')]);var _0x48e51c=conferenceValidation['validate'](_0x2aa032[_0x7673('0x27')]);if(_0x48e51c[_0x7673('0x23')]>0x0){return _0x297744[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x48e51c);}var _0x51c617=_0x2aa032['body'][_0x7673('0x29')];return getAgent(_0x51c617)[_0x7673('0x1a')](function(_0x1cf039){logger['info'](_0x7673('0x2d'),_0x1cf039['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x1cf039[_0x7673('0x17')]),'webbar:conference');return _0x297744[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x297744));};exports['transfer']=function(_0x32dcfc,_0x2dd367){logger[_0x7673('0x10')](_0x7673('0x42'),_0x32dcfc['body']);var _0xed9040=transferValidation['validate'](_0x32dcfc[_0x7673('0x27')]);if(_0xed9040[_0x7673('0x23')]>0x0){return _0x2dd367[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xed9040);}var _0x5abb12=_0x32dcfc[_0x7673('0x27')][_0x7673('0x29')];var _0x308a9e=_0x32dcfc['body']['sessionId'];var _0x2d21f2=_0x32dcfc[_0x7673('0x27')][_0x7673('0x43')];return getAgent(_0x5abb12)[_0x7673('0x1a')](function(_0x20e9bd){logger['info'](_0x7673('0x2d'),_0x20e9bd[_0x7673('0x17')]);emit(util['format']('user:%s',_0x20e9bd['name']),_0x7673('0x44'),{'sessionId':_0x308a9e,'transferNumber':_0x2d21f2});return _0x2dd367[_0x7673('0x15')](0xc8)['json']({'error':![],'message':_0x7673('0x45')});})['catch'](handleError(_0x2dd367));};
\ No newline at end of file
index 809180c..2428878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x7880,0x1f4));var _0x0788=function(_0x4749bc,_0xd777b9){_0x4749bc=_0x4749bc-0x0;var _0x4b5918=_0x7880[_0x4749bc];return _0x4b5918;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router;
\ No newline at end of file
+var _0x2ef3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','addDisposition','addAnswer','/:id/notify','/:id/send','send','put','update','delete','removeAnswers'];(function(_0x17d573,_0x28b545){var _0x1d138c=function(_0x4e5028){while(--_0x4e5028){_0x17d573['push'](_0x17d573['shift']());}};_0x1d138c(++_0x28b545);}(_0x2ef3,0xba));var _0x32ef=function(_0xfa245c,_0x5002f0){_0xfa245c=_0xfa245c-0x0;var _0x328fab=_0x2ef3[_0xfa245c];return _0x328fab;};'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['getDispositions']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['get'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['get'](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['getApplications']);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x15')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x16')]);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x32ef('0x17')]);router[_0x32ef('0x15')](_0x32ef('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x32ef('0x15')](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['addApplications']);router[_0x32ef('0x15')](_0x32ef('0x18'),controller['notify']);router[_0x32ef('0x15')](_0x32ef('0x19'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1a')]);router[_0x32ef('0x1b')](_0x32ef('0xd'),auth['isAuthenticated'](),controller[_0x32ef('0x1c')]);router['delete'](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller['destroy']);router[_0x32ef('0x1d')](_0x32ef('0xf'),auth[_0x32ef('0xb')](),controller['removeDispositions']);router['delete'](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x1e')]);router['delete']('/:id/users',auth[_0x32ef('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 8a25a0c..4c41912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca8a=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1306b0,_0x1e6e09){var _0x36790c=function(_0x1f3a19){while(--_0x1f3a19){_0x1306b0['push'](_0x1306b0['shift']());}};_0x36790c(++_0x1e6e09);}(_0xca8a,0xe4));var _0xaca8=function(_0x2f14bb,_0x4133a7){_0x2f14bb=_0x2f14bb-0x0;var _0x595cc9=_0xca8a[_0x2f14bb];return _0x595cc9;};'use strict';var Sequelize=require(_0xaca8('0x0'));var rs=require(_0xaca8('0x1'));module['exports']={'name':{'type':Sequelize[_0xaca8('0x2')],'unique':_0xaca8('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xaca8('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xaca8('0x2')],'defaultValue':function(){return rs[_0xaca8('0x4')]();}},'phone':{'type':Sequelize[_0xaca8('0x2')]},'type':{'type':Sequelize[_0xaca8('0x5')](_0xaca8('0x6'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xaca8('0x7')],'defaultValue':function(){return _0xaca8('0x8');}},'notificationSound':{'type':Sequelize[_0xaca8('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaca8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaca8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaca8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaca8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaca8('0xa')],'comment':_0xaca8('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1d36b2){if(!_0x1d36b2){this[_0xaca8('0xc')](_0xaca8('0xd'),null);}this['setDataValue'](_0xaca8('0xe'),_0x1d36b2);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5047=['ENUM','twilio','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x5047,0x117));var _0x7504=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0x5047[_0x314a8c];return _0x1d4607;};'use strict';var Sequelize=require(_0x7504('0x0'));var rs=require(_0x7504('0x1'));module[_0x7504('0x2')]={'name':{'type':Sequelize[_0x7504('0x3')],'unique':_0x7504('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x7504('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7504('0x3')],'defaultValue':function(){return rs[_0x7504('0x5')]();}},'phone':{'type':Sequelize[_0x7504('0x3')]},'type':{'type':Sequelize[_0x7504('0x6')](_0x7504('0x7'))},'accountSid':{'type':Sequelize[_0x7504('0x3')]},'authToken':{'type':Sequelize[_0x7504('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7504('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x7504('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7504('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7504('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7504('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7504('0x9')],'comment':_0x7504('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7504('0xb'),'set':function(_0x50638f){if(!_0x50638f){this[_0x7504('0xc')](_0x7504('0xd'),null);}this[_0x7504('0xc')](_0x7504('0xe'),_0x50638f);}},'description':{'type':Sequelize[_0x7504('0x3')]}};
\ No newline at end of file
index 58c6e52..43524a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e11=['get','role','WhatsappAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','spread','removeAgents','isArray','userWhatsappAccount:remove','emit','getAgents','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','whatsapp','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','DESC','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','debug','entity\x20found','stringify','twilio','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','register','http','request','then','info','request\x20sent','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','status','undefined','limit','count','offset','Content-Range','json','apply','save','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','WhatsappAccount','findAll','rows','show','params','rawAttributes','include','find','create','body','user'];(function(_0x43b4dc,_0x1fa993){var _0x4c5f77=function(_0x190e14){while(--_0x190e14){_0x43b4dc['push'](_0x43b4dc['shift']());}};_0x4c5f77(++_0x1fa993);}(_0x8e11,0x11d));var _0x18e1=function(_0xa0717d,_0x5e00c2){_0xa0717d=_0xa0717d-0x0;var _0x348eff=_0x8e11[_0xa0717d];return _0x348eff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x18e1('0x0'));var zipdir=require(_0x18e1('0x1'));var jsonpatch=require(_0x18e1('0x2'));var rp=require(_0x18e1('0x3'));var moment=require(_0x18e1('0x4'));var BPromise=require(_0x18e1('0x5'));var Mustache=require('mustache');var util=require(_0x18e1('0x6'));var path=require(_0x18e1('0x7'));var sox=require(_0x18e1('0x8'));var csv=require(_0x18e1('0x9'));var ejs=require(_0x18e1('0xa'));var fs=require('fs');var fs_extra=require(_0x18e1('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x18e1('0xc'));var jsforce=require(_0x18e1('0xd'));var deskjs=require(_0x18e1('0xe'));var toCsv=require(_0x18e1('0x9'));var querystring=require('querystring');var Papa=require(_0x18e1('0xf'));var Redis=require(_0x18e1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x18e1('0x11'));var as=require(_0x18e1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18e1('0x13'))('api');var utils=require(_0x18e1('0x14'));var config=require(_0x18e1('0x15'));var licenseUtil=require(_0x18e1('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x18e1('0x17')](config[_0x18e1('0x18')],{'host':_0x18e1('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18e1('0x18')]));require('./whatsappAccount.socket')[_0x18e1('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x18e1('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x31c0dc,_0x3c8e50,_0x47e05c,_0x4a198c){return new BPromise(function(_0x596628,_0x32c086){var _0x4c866b=_0x4a198c||client;return _0x4c866b[_0x18e1('0x1c')](_0x31c0dc,_0x47e05c)[_0x18e1('0x1d')](function(_0xbf7c93){logger[_0x18e1('0x1e')]('WhatsappAccount,\x20%s,\x20%s',_0x3c8e50,_0x18e1('0x1f'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3c8e50,'request\x20sent',JSON['stringify'](_0xbf7c93));if(_0xbf7c93[_0x18e1('0x20')]){if(_0xbf7c93[_0x18e1('0x20')][_0x18e1('0x21')]===0x1f4){logger[_0x18e1('0x20')](_0x18e1('0x22'),_0x3c8e50,_0xbf7c93[_0x18e1('0x20')][_0x18e1('0x23')]);return _0x32c086(_0xbf7c93[_0x18e1('0x20')][_0x18e1('0x23')]);}logger[_0x18e1('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x3c8e50,_0xbf7c93['error']['message']);return _0x596628(_0xbf7c93[_0x18e1('0x20')][_0x18e1('0x23')]);}else{logger[_0x18e1('0x1e')](_0x18e1('0x22'),_0x3c8e50,'request\x20sent');_0x596628(_0xbf7c93[_0x18e1('0x24')][_0x18e1('0x23')]);}})[_0x18e1('0x25')](function(_0x3138e1){logger[_0x18e1('0x20')](_0x18e1('0x22'),_0x3c8e50,_0x3138e1);_0x32c086(_0x3138e1);});});}function respondWithStatusCode(_0x2140f5,_0x330a3b){_0x330a3b=_0x330a3b||0xcc;return function(_0x1be49a){if(_0x1be49a){return _0x2140f5['sendStatus'](_0x330a3b);}return _0x2140f5[_0x18e1('0x26')](_0x330a3b)['end']();};}function respondWithResult(_0x1efbc9,_0x451b92){_0x451b92=_0x451b92||0xc8;return function(_0x41282b){if(_0x41282b){return _0x1efbc9[_0x18e1('0x26')](_0x451b92)['json'](_0x41282b);}};}function respondWithFilteredResult(_0x3c82d7,_0x4aebd7){return function(_0x645876){if(_0x645876){var _0x253eb6=typeof _0x4aebd7['offset']===_0x18e1('0x27')&&typeof _0x4aebd7[_0x18e1('0x28')]===_0x18e1('0x27');var _0x4cf1d7=_0x645876[_0x18e1('0x29')];var _0x49e54f=_0x253eb6?0x0:_0x4aebd7[_0x18e1('0x2a')];var _0x4ee62b=_0x253eb6?_0x645876[_0x18e1('0x29')]:_0x4aebd7[_0x18e1('0x2a')]+_0x4aebd7['limit'];var _0x422970;if(_0x4ee62b>=_0x4cf1d7){_0x4ee62b=_0x4cf1d7;_0x422970=0xc8;}else{_0x422970=0xce;}_0x3c82d7[_0x18e1('0x26')](_0x422970);return _0x3c82d7['set'](_0x18e1('0x2b'),_0x49e54f+'-'+_0x4ee62b+'/'+_0x4cf1d7)[_0x18e1('0x2c')](_0x645876);}return null;};}function patchUpdates(_0x51182c){return function(_0x6c62d7){try{jsonpatch[_0x18e1('0x2d')](_0x6c62d7,_0x51182c,!![]);}catch(_0x285fad){return BPromise['reject'](_0x285fad);}return _0x6c62d7[_0x18e1('0x2e')]();};}function saveUpdates(_0x4219cd,_0x3f331e){return function(_0x34ff3a){if(_0x34ff3a){return _0x34ff3a[_0x18e1('0x2f')](_0x4219cd)['then'](function(_0x19b462){return _0x19b462;});}return null;};}function removeEntity(_0x1342e4,_0x46caac){return function(_0x29dfb0){if(_0x29dfb0){return _0x29dfb0[_0x18e1('0x30')]()[_0x18e1('0x1d')](function(){var _0x355467=_0x29dfb0['get']({'plain':!![]});var _0x913ef0='WhatsappAccounts';return db[_0x18e1('0x31')][_0x18e1('0x30')]({'where':{'type':_0x913ef0,'resourceId':_0x355467['id']}})[_0x18e1('0x1d')](function(){return _0x29dfb0;});})[_0x18e1('0x1d')](function(){_0x1342e4[_0x18e1('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4643d4,_0x3bfec8){return function(_0x5127fa){if(!_0x5127fa){_0x4643d4[_0x18e1('0x32')](0x194);}return _0x5127fa;};}function handleError(_0x2f9add,_0x3059bd){_0x3059bd=_0x3059bd||0x1f4;return function(_0x35e53c){logger[_0x18e1('0x20')](_0x35e53c[_0x18e1('0x33')]);if(_0x35e53c[_0x18e1('0x34')]){delete _0x35e53c['name'];}_0x2f9add[_0x18e1('0x26')](_0x3059bd)[_0x18e1('0x35')](_0x35e53c);};}exports[_0x18e1('0x36')]=function(_0x24cc20,_0x53d573){var _0x251901={'include':[{'model':db[_0x18e1('0x37')],'as':'mandatoryDispositionPause'}]},_0x240fef={},_0x25ac34={'count':0x0,'rows':[]};var _0xf50b71=_[_0x18e1('0x38')](db['WhatsappAccount']['rawAttributes'],function(_0x26ab56){return{'name':_0x26ab56[_0x18e1('0x39')],'type':_0x26ab56[_0x18e1('0x3a')][_0x18e1('0x3b')]};});_0x240fef[_0x18e1('0x3c')]=_[_0x18e1('0x38')](_0xf50b71,_0x18e1('0x34'));_0x240fef['query']=_[_0x18e1('0x3d')](_0x24cc20[_0x18e1('0x3e')]);_0x240fef[_0x18e1('0x3f')]=_[_0x18e1('0x40')](_0x240fef[_0x18e1('0x3c')],_0x240fef['query']);_0x251901[_0x18e1('0x41')]=_[_0x18e1('0x40')](_0x240fef[_0x18e1('0x3c')],qs[_0x18e1('0x42')](_0x24cc20[_0x18e1('0x3e')][_0x18e1('0x42')]));_0x251901[_0x18e1('0x41')]=_0x251901['attributes'][_0x18e1('0x43')]?_0x251901[_0x18e1('0x41')]:_0x240fef[_0x18e1('0x3c')];if(!_0x24cc20['query'][_0x18e1('0x44')](_0x18e1('0x45'))){_0x251901[_0x18e1('0x28')]=qs[_0x18e1('0x28')](_0x24cc20['query']['limit']);_0x251901[_0x18e1('0x2a')]=qs[_0x18e1('0x2a')](_0x24cc20[_0x18e1('0x3e')][_0x18e1('0x2a')]);}_0x251901[_0x18e1('0x46')]=qs['sort'](_0x24cc20['query'][_0x18e1('0x47')]);_0x251901['where']=qs[_0x18e1('0x3f')](_['pick'](_0x24cc20['query'],_0x240fef[_0x18e1('0x3f')]),_0xf50b71);if(_0x24cc20[_0x18e1('0x3e')][_0x18e1('0x48')]){_0x251901['where']=_[_0x18e1('0x49')](_0x251901[_0x18e1('0x4a')],{'$or':_[_0x18e1('0x38')](_0xf50b71,function(_0x3b1614){if(_0x3b1614['type']!==_0x18e1('0x4b')){var _0x10877b={};_0x10877b[_0x3b1614['name']]={'$like':'%'+_0x24cc20[_0x18e1('0x3e')][_0x18e1('0x48')]+'%'};return _0x10877b;}})});}_0x251901=_[_0x18e1('0x49')]({},_0x251901,_0x24cc20[_0x18e1('0x4c')]);var _0x93d7bb={'where':_0x251901[_0x18e1('0x4a')]};return db['WhatsappAccount']['count'](_0x93d7bb)['then'](function(_0x5128ff){_0x25ac34[_0x18e1('0x29')]=_0x5128ff;if(_0x24cc20[_0x18e1('0x3e')][_0x18e1('0x4d')]){_0x251901['include']=[{'all':!![]}];}return db[_0x18e1('0x4e')][_0x18e1('0x4f')](_0x251901);})['then'](function(_0x1900dc){_0x25ac34[_0x18e1('0x50')]=_0x1900dc;return _0x25ac34;})[_0x18e1('0x1d')](respondWithFilteredResult(_0x53d573,_0x251901))[_0x18e1('0x25')](handleError(_0x53d573,null));};exports[_0x18e1('0x51')]=function(_0x147718,_0x85ad92){var _0x286f37={'raw':![],'where':{'id':_0x147718[_0x18e1('0x52')]['id']},'include':[{'model':db[_0x18e1('0x37')],'as':'mandatoryDispositionPause'}]},_0x1be2b4={};_0x1be2b4[_0x18e1('0x3c')]=_['keys'](db['WhatsappAccount'][_0x18e1('0x53')]);_0x1be2b4[_0x18e1('0x3e')]=_[_0x18e1('0x3d')](_0x147718['query']);_0x1be2b4['filters']=_[_0x18e1('0x40')](_0x1be2b4[_0x18e1('0x3c')],_0x1be2b4['query']);_0x286f37[_0x18e1('0x41')]=_[_0x18e1('0x40')](_0x1be2b4[_0x18e1('0x3c')],qs[_0x18e1('0x42')](_0x147718[_0x18e1('0x3e')][_0x18e1('0x42')]));_0x286f37[_0x18e1('0x41')]=_0x286f37[_0x18e1('0x41')][_0x18e1('0x43')]?_0x286f37[_0x18e1('0x41')]:_0x1be2b4[_0x18e1('0x3c')];if(_0x147718[_0x18e1('0x3e')][_0x18e1('0x4d')]){_0x286f37[_0x18e1('0x54')]=[{'all':!![]}];}_0x286f37=_[_0x18e1('0x49')]({},_0x286f37,_0x147718[_0x18e1('0x4c')]);return db[_0x18e1('0x4e')][_0x18e1('0x55')](_0x286f37)[_0x18e1('0x1d')](handleEntityNotFound(_0x85ad92,null))[_0x18e1('0x1d')](respondWithResult(_0x85ad92,null))['catch'](handleError(_0x85ad92,null));};exports[_0x18e1('0x56')]=function(_0x2aa0bb,_0x2d5351){return db[_0x18e1('0x4e')][_0x18e1('0x56')](_0x2aa0bb[_0x18e1('0x57')],{})['then'](function(_0x479c52){var _0x383071=_0x2aa0bb[_0x18e1('0x58')][_0x18e1('0x59')]({'plain':!![]});if(!_0x383071)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x383071[_0x18e1('0x5a')]===_0x18e1('0x58')){var _0x437bcb=_0x479c52['get']({'plain':!![]});var _0x3eab7b=_0x18e1('0x5b');return db['UserProfileSection'][_0x18e1('0x55')]({'where':{'name':_0x3eab7b,'userProfileId':_0x383071[_0x18e1('0x5c')]},'raw':!![]})['then'](function(_0x57e4d5){if(_0x57e4d5&&_0x57e4d5[_0x18e1('0x5d')]===0x0){return db[_0x18e1('0x31')]['create']({'name':_0x437bcb[_0x18e1('0x34')],'resourceId':_0x437bcb['id'],'type':_0x57e4d5[_0x18e1('0x34')],'sectionId':_0x57e4d5['id']},{})[_0x18e1('0x1d')](function(){return _0x479c52;});}else{return _0x479c52;}})[_0x18e1('0x25')](function(_0xfead0d){logger['error'](_0x18e1('0x5e'),_0xfead0d);throw _0xfead0d;});}return _0x479c52;})[_0x18e1('0x1d')](respondWithResult(_0x2d5351,0xc9))[_0x18e1('0x25')](handleError(_0x2d5351,null));};exports['update']=function(_0x44840c,_0xcd2d40){if(_0x44840c[_0x18e1('0x57')]['id']){delete _0x44840c[_0x18e1('0x57')]['id'];}return db['WhatsappAccount'][_0x18e1('0x55')]({'where':{'id':_0x44840c[_0x18e1('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0xcd2d40,null))['then'](saveUpdates(_0x44840c[_0x18e1('0x57')],null))[_0x18e1('0x1d')](respondWithResult(_0xcd2d40,null))['catch'](handleError(_0xcd2d40,null));};exports['destroy']=function(_0x115fa1,_0x1b382f){return db['WhatsappAccount'][_0x18e1('0x55')]({'where':{'id':_0x115fa1['params']['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x1b382f,null))[_0x18e1('0x1d')](removeEntity(_0x1b382f,null))[_0x18e1('0x25')](handleError(_0x1b382f,null));};exports[_0x18e1('0x5f')]=function(_0x57526b,_0x54322d){return db[_0x18e1('0x4e')][_0x18e1('0x5f')]()[_0x18e1('0x1d')](respondWithResult(_0x54322d,null))[_0x18e1('0x25')](handleError(_0x54322d,null));};exports[_0x18e1('0x60')]=function(_0x433b6f,_0x35c67a,_0x1a09fe){if(_0x433b6f[_0x18e1('0x57')]['id']){delete _0x433b6f[_0x18e1('0x57')]['id'];}return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0x433b6f[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x35c67a,null))[_0x18e1('0x1d')](function(_0x36242f){if(_0x36242f){_0x433b6f['body'][_0x18e1('0x61')]=_0x36242f['id'];return db[_0x18e1('0x62')]['create'](_0x433b6f[_0x18e1('0x57')]);}})[_0x18e1('0x1d')](respondWithResult(_0x35c67a,null))['catch'](handleError(_0x35c67a,null));};exports[_0x18e1('0x63')]=function(_0x57cc9d,_0x3cda2f,_0x4662a4){var _0x4fb3b9={'raw':![],'where':{}};var _0x11e5b9={};var _0x2e940b={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x18e1('0x64')]({'where':{'id':_0x57cc9d[_0x18e1('0x52')]['id']}})['then'](handleEntityNotFound(_0x3cda2f,null))[_0x18e1('0x1d')](function(_0x14a0d5){if(_0x14a0d5){_0x11e5b9[_0x18e1('0x3c')]=_[_0x18e1('0x3d')](db['Disposition']['rawAttributes']);_0x11e5b9[_0x18e1('0x3e')]=_[_0x18e1('0x3d')](_0x57cc9d[_0x18e1('0x3e')]);_0x11e5b9[_0x18e1('0x3f')]=_['intersection'](_0x11e5b9['model'],_0x11e5b9['query']);_0x4fb3b9['attributes']=_['intersection'](_0x11e5b9[_0x18e1('0x3c')],qs['fields'](_0x57cc9d['query'][_0x18e1('0x42')]));_0x4fb3b9[_0x18e1('0x41')]=_0x4fb3b9[_0x18e1('0x41')][_0x18e1('0x43')]?_0x4fb3b9[_0x18e1('0x41')]:_0x11e5b9[_0x18e1('0x3c')];if(!_0x57cc9d[_0x18e1('0x3e')][_0x18e1('0x44')](_0x18e1('0x45'))){_0x4fb3b9[_0x18e1('0x28')]=qs[_0x18e1('0x28')](_0x57cc9d['query']['limit']);_0x4fb3b9[_0x18e1('0x2a')]=qs['offset'](_0x57cc9d[_0x18e1('0x3e')][_0x18e1('0x2a')]);}_0x4fb3b9['order']=qs[_0x18e1('0x47')](_0x57cc9d[_0x18e1('0x3e')][_0x18e1('0x47')]);_0x4fb3b9[_0x18e1('0x4a')]=qs[_0x18e1('0x3f')](_[_0x18e1('0x65')](_0x57cc9d[_0x18e1('0x3e')],_0x11e5b9[_0x18e1('0x3f')]));_0x4fb3b9[_0x18e1('0x4a')][_0x18e1('0x61')]=_0x14a0d5['id'];if(_0x57cc9d['query'][_0x18e1('0x48')]){_0x4fb3b9['where']=_[_0x18e1('0x49')](_0x4fb3b9[_0x18e1('0x4a')],{'$or':_[_0x18e1('0x38')](_0x4fb3b9[_0x18e1('0x41')],function(_0x435f3d){var _0x211727={};_0x211727[_0x435f3d]={'$like':'%'+_0x57cc9d[_0x18e1('0x3e')]['filter']+'%'};return _0x211727;})});}_0x4fb3b9=_[_0x18e1('0x49')]({},_0x4fb3b9,_0x57cc9d[_0x18e1('0x4c')]);return db['Disposition']['count']({'where':_0x4fb3b9[_0x18e1('0x4a')]})[_0x18e1('0x1d')](function(_0x451dd1){_0x2e940b['count']=_0x451dd1;if(_0x57cc9d[_0x18e1('0x3e')][_0x18e1('0x4d')]){_0x4fb3b9[_0x18e1('0x54')]=[{'all':!![]}];}return db[_0x18e1('0x62')][_0x18e1('0x4f')](_0x4fb3b9);})[_0x18e1('0x1d')](function(_0x3b85b2){_0x2e940b[_0x18e1('0x50')]=_0x3b85b2;return _0x2e940b;});}})[_0x18e1('0x1d')](respondWithFilteredResult(_0x3cda2f,_0x4fb3b9))[_0x18e1('0x25')](handleError(_0x3cda2f,null));};exports[_0x18e1('0x66')]=function(_0x560810,_0x1bea7f,_0x5d9ab6){return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0x560810[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x1bea7f,null))[_0x18e1('0x1d')](function(_0x3b65ee){if(_0x3b65ee){return _0x3b65ee['removeDispositions'](_0x560810[_0x18e1('0x3e')]['ids']);}})[_0x18e1('0x1d')](respondWithStatusCode(_0x1bea7f,null))[_0x18e1('0x25')](handleError(_0x1bea7f,null));};exports[_0x18e1('0x67')]=function(_0xfb98c6,_0x10f296,_0x1ee18e){if(_0xfb98c6['body']['id']){delete _0xfb98c6['body']['id'];}return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0xfb98c6[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x10f296,null))[_0x18e1('0x1d')](function(_0x478259){if(_0x478259){_0xfb98c6[_0x18e1('0x57')][_0x18e1('0x61')]=_0x478259['id'];return db[_0x18e1('0x68')][_0x18e1('0x56')](_0xfb98c6[_0x18e1('0x57')]);}})[_0x18e1('0x1d')](respondWithResult(_0x10f296,null))['catch'](handleError(_0x10f296,null));};exports[_0x18e1('0x69')]=function(_0x35391b,_0x254e7b,_0x49da82){var _0x559283={'raw':![],'where':{}};var _0x2f9178={};var _0x1898a2={'count':0x0,'rows':[]};return db[_0x18e1('0x4e')][_0x18e1('0x64')]({'where':{'id':_0x35391b[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x254e7b,null))[_0x18e1('0x1d')](function(_0x32e7b0){if(_0x32e7b0){_0x2f9178[_0x18e1('0x3c')]=_['keys'](db['CannedAnswer'][_0x18e1('0x53')]);_0x2f9178[_0x18e1('0x3e')]=_['keys'](_0x35391b['query']);_0x2f9178[_0x18e1('0x3f')]=_[_0x18e1('0x40')](_0x2f9178[_0x18e1('0x3c')],_0x2f9178[_0x18e1('0x3e')]);_0x559283[_0x18e1('0x41')]=_[_0x18e1('0x40')](_0x2f9178[_0x18e1('0x3c')],qs['fields'](_0x35391b[_0x18e1('0x3e')][_0x18e1('0x42')]));_0x559283['attributes']=_0x559283[_0x18e1('0x41')]['length']?_0x559283[_0x18e1('0x41')]:_0x2f9178[_0x18e1('0x3c')];if(!_0x35391b['query'][_0x18e1('0x44')](_0x18e1('0x45'))){_0x559283[_0x18e1('0x28')]=qs['limit'](_0x35391b[_0x18e1('0x3e')][_0x18e1('0x28')]);_0x559283[_0x18e1('0x2a')]=qs['offset'](_0x35391b[_0x18e1('0x3e')][_0x18e1('0x2a')]);}_0x559283[_0x18e1('0x46')]=qs[_0x18e1('0x47')](_0x35391b[_0x18e1('0x3e')][_0x18e1('0x47')]);_0x559283[_0x18e1('0x4a')]=qs[_0x18e1('0x3f')](_[_0x18e1('0x65')](_0x35391b[_0x18e1('0x3e')],_0x2f9178['filters']));_0x559283['where']['WhatsappAccountId']=_0x32e7b0['id'];if(_0x35391b[_0x18e1('0x3e')][_0x18e1('0x48')]){_0x559283['where']=_[_0x18e1('0x49')](_0x559283[_0x18e1('0x4a')],{'$or':_['map'](_0x559283[_0x18e1('0x41')],function(_0x240c00){var _0x38647b={};_0x38647b[_0x240c00]={'$like':'%'+_0x35391b[_0x18e1('0x3e')][_0x18e1('0x48')]+'%'};return _0x38647b;})});}_0x559283=_[_0x18e1('0x49')]({},_0x559283,_0x35391b[_0x18e1('0x4c')]);return db[_0x18e1('0x68')][_0x18e1('0x29')]({'where':_0x559283[_0x18e1('0x4a')]})['then'](function(_0x18362c){_0x1898a2['count']=_0x18362c;if(_0x35391b['query']['includeAll']){_0x559283['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x559283);})['then'](function(_0x19d254){_0x1898a2[_0x18e1('0x50')]=_0x19d254;return _0x1898a2;});}})['then'](respondWithFilteredResult(_0x254e7b,_0x559283))[_0x18e1('0x25')](handleError(_0x254e7b,null));};exports[_0x18e1('0x6a')]=function(_0x48bd27,_0x405130,_0x5c6e9b){return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0x48bd27[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x405130,null))[_0x18e1('0x1d')](function(_0x46268f){if(_0x46268f){return _0x46268f['removeAnswers'](_0x48bd27[_0x18e1('0x3e')][_0x18e1('0x6b')]);}})[_0x18e1('0x1d')](respondWithStatusCode(_0x405130,null))[_0x18e1('0x25')](handleError(_0x405130,null));};exports['addAgents']=function(_0x2a8b37,_0x2e7264,_0x23350f){return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0x2a8b37[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x2e7264,null))[_0x18e1('0x1d')](function(_0x50ac11){if(_0x50ac11){return _0x50ac11[_0x18e1('0x6c')](_0x2a8b37['body'][_0x18e1('0x6b')],_['omit'](_0x2a8b37['body'],[_0x18e1('0x6b'),'id'])||{})[_0x18e1('0x6d')](function(_0x50705d){for(var _0x1a37db=0x0;_0x1a37db<_0x2a8b37[_0x18e1('0x57')]['ids'][_0x18e1('0x43')];_0x1a37db+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x2a8b37[_0x18e1('0x57')][_0x18e1('0x6b')][_0x1a37db]),'WhatsappAccountId':Number(_0x2a8b37['params']['id'])});}return _0x50705d;});}})[_0x18e1('0x1d')](respondWithResult(_0x2e7264,null))['catch'](handleError(_0x2e7264,null));};exports['removeAgents']=function(_0x112f71,_0x392f7d,_0x16dbcf){return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0x112f71[_0x18e1('0x52')]['id']}})['then'](handleEntityNotFound(_0x392f7d,null))[_0x18e1('0x1d')](function(_0x173ab9){if(_0x173ab9){return _0x173ab9[_0x18e1('0x6e')](_0x112f71['query'][_0x18e1('0x6b')])[_0x18e1('0x1d')](function(){if(_[_0x18e1('0x6f')](_0x112f71[_0x18e1('0x3e')][_0x18e1('0x6b')])){for(var _0x60946e=0x0;_0x60946e<_0x112f71[_0x18e1('0x3e')][_0x18e1('0x6b')][_0x18e1('0x43')];_0x60946e+=0x1){socket['emit'](_0x18e1('0x70'),{'UserId':Number(_0x112f71['query'][_0x18e1('0x6b')][_0x60946e]),'WhatsappAccountId':Number(_0x112f71[_0x18e1('0x52')]['id'])});}}else{socket[_0x18e1('0x71')](_0x18e1('0x70'),{'UserId':Number(_0x112f71[_0x18e1('0x3e')][_0x18e1('0x6b')]),'WhatsappAccountId':Number(_0x112f71[_0x18e1('0x52')]['id'])});}});}})[_0x18e1('0x1d')](respondWithStatusCode(_0x392f7d,null))['catch'](handleError(_0x392f7d,null));};exports[_0x18e1('0x72')]=function(_0x28bf60,_0x57da71,_0x2a9582){var _0x567e0d={};var _0x391887={};var _0x337ef2;var _0x12b61a;return db[_0x18e1('0x4e')][_0x18e1('0x64')]({'where':{'id':_0x28bf60[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x57da71,null))[_0x18e1('0x1d')](function(_0x25e2ba){if(_0x25e2ba){_0x337ef2=_0x25e2ba;_0x391887['model']=_['keys'](db['User'][_0x18e1('0x53')]);_0x391887[_0x18e1('0x3e')]=_[_0x18e1('0x3d')](_0x28bf60[_0x18e1('0x3e')]);_0x391887[_0x18e1('0x3f')]=_[_0x18e1('0x40')](_0x391887['model'],_0x391887[_0x18e1('0x3e')]);_0x567e0d[_0x18e1('0x41')]=_[_0x18e1('0x40')](_0x391887[_0x18e1('0x3c')],qs[_0x18e1('0x42')](_0x28bf60[_0x18e1('0x3e')][_0x18e1('0x42')]));_0x567e0d[_0x18e1('0x41')]=_0x567e0d['attributes'][_0x18e1('0x43')]?_0x567e0d['attributes']:_0x391887[_0x18e1('0x3c')];_0x567e0d[_0x18e1('0x46')]=qs[_0x18e1('0x47')](_0x28bf60[_0x18e1('0x3e')][_0x18e1('0x47')]);_0x567e0d[_0x18e1('0x4a')]=qs[_0x18e1('0x3f')](_[_0x18e1('0x65')](_0x28bf60[_0x18e1('0x3e')],_0x391887['filters']));if(_0x28bf60[_0x18e1('0x3e')][_0x18e1('0x48')]){_0x567e0d['where']=_[_0x18e1('0x49')](_0x567e0d[_0x18e1('0x4a')],{'$or':_['map'](_0x567e0d[_0x18e1('0x41')],function(_0x1fdfa8){var _0x570aff={};_0x570aff[_0x1fdfa8]={'$like':'%'+_0x28bf60['query']['filter']+'%'};return _0x570aff;})});}_0x567e0d=_['merge']({},_0x567e0d,_0x28bf60['options']);return _0x337ef2[_0x18e1('0x72')](_0x567e0d);}})['then'](function(_0x5752df){if(_0x5752df){_0x12b61a=_0x5752df[_0x18e1('0x43')];if(!_0x28bf60[_0x18e1('0x3e')][_0x18e1('0x44')](_0x18e1('0x45'))){_0x567e0d['limit']=qs[_0x18e1('0x28')](_0x28bf60[_0x18e1('0x3e')][_0x18e1('0x28')]);_0x567e0d[_0x18e1('0x2a')]=qs[_0x18e1('0x2a')](_0x28bf60[_0x18e1('0x3e')][_0x18e1('0x2a')]);}return _0x337ef2[_0x18e1('0x72')](_0x567e0d);}})['then'](function(_0x78a4ce){if(_0x78a4ce){return _0x78a4ce?{'count':_0x12b61a,'rows':_0x78a4ce}:null;}})[_0x18e1('0x1d')](respondWithResult(_0x57da71,null))['catch'](handleError(_0x57da71,null));};exports[_0x18e1('0x73')]=function(_0x1cfd50,_0x304075,_0x590aba){return db['WhatsappAccount'][_0x18e1('0x64')]({'where':{'id':_0x1cfd50[_0x18e1('0x52')]['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x304075,null))[_0x18e1('0x1d')](function(_0x249a34){if(_0x249a34){return db[_0x18e1('0x74')][_0x18e1('0x75')](function(_0x573d70){return db['WhatsappApplication'][_0x18e1('0x30')]({'where':{'WhatsappAccountId':_0x1cfd50[_0x18e1('0x52')]['id']},'transaction':_0x573d70})['then'](function(_0x1cc5e5){var _0x588af1=_['map'](_0x1cfd50[_0x18e1('0x57')],function(_0x152943){_0x152943['WhatsappAccountId']=_0x1cfd50['params']['id'];return _0x152943;});return db[_0x18e1('0x76')]['bulkCreate'](_0x588af1,{'transaction':_0x573d70});});})[_0x18e1('0x1d')](function(){return db[_0x18e1('0x76')][_0x18e1('0x77')]({'where':{'WhatsappAccountId':_0x1cfd50[_0x18e1('0x52')]['id']},'order':_0x18e1('0x78')});});}})['then'](respondWithResult(_0x304075,null))[_0x18e1('0x25')](handleError(_0x304075,null));};exports[_0x18e1('0x79')]=function(_0x505d8d,_0x2cc5ae,_0x4e2bf5){var _0x592a95={};var _0x35cbb7={};var _0x396fa5;var _0x3d895f;return db[_0x18e1('0x4e')]['findOne']({'where':{'id':_0x505d8d['params']['id']}})[_0x18e1('0x1d')](handleEntityNotFound(_0x2cc5ae,null))[_0x18e1('0x1d')](function(_0xc0308d){if(_0xc0308d){_0x396fa5=_0xc0308d;_0x35cbb7[_0x18e1('0x3c')]=_[_0x18e1('0x3d')](db[_0x18e1('0x76')][_0x18e1('0x53')]);_0x35cbb7[_0x18e1('0x3e')]=_[_0x18e1('0x3d')](_0x505d8d['query']);_0x35cbb7[_0x18e1('0x3f')]=_[_0x18e1('0x40')](_0x35cbb7[_0x18e1('0x3c')],_0x35cbb7[_0x18e1('0x3e')]);_0x592a95[_0x18e1('0x41')]=_[_0x18e1('0x40')](_0x35cbb7['model'],qs['fields'](_0x505d8d[_0x18e1('0x3e')]['fields']));_0x592a95[_0x18e1('0x41')]=_0x592a95['attributes'][_0x18e1('0x43')]?_0x592a95[_0x18e1('0x41')]:_0x35cbb7[_0x18e1('0x3c')];_0x592a95['order']=qs['sort'](_0x505d8d[_0x18e1('0x3e')]['sort']);_0x592a95[_0x18e1('0x4a')]=qs[_0x18e1('0x3f')](_[_0x18e1('0x65')](_0x505d8d['query'],_0x35cbb7[_0x18e1('0x3f')]));if(_0x505d8d[_0x18e1('0x3e')][_0x18e1('0x48')]){_0x592a95['where']=_['merge'](_0x592a95[_0x18e1('0x4a')],{'$or':_[_0x18e1('0x38')](_0x592a95[_0x18e1('0x41')],function(_0x190a38){var _0x4cac56={};_0x4cac56[_0x190a38]={'$like':'%'+_0x505d8d[_0x18e1('0x3e')]['filter']+'%'};return _0x4cac56;})});}_0x592a95=_['merge']({},_0x592a95,_0x505d8d[_0x18e1('0x4c')]);return _0x396fa5[_0x18e1('0x79')](_0x592a95);}})[_0x18e1('0x1d')](function(_0x3f9200){if(_0x3f9200){_0x3d895f=_0x3f9200[_0x18e1('0x43')];if(!_0x505d8d[_0x18e1('0x3e')][_0x18e1('0x44')](_0x18e1('0x45'))){_0x592a95[_0x18e1('0x28')]=qs[_0x18e1('0x28')](_0x505d8d['query'][_0x18e1('0x28')]);_0x592a95[_0x18e1('0x2a')]=qs['offset'](_0x505d8d[_0x18e1('0x3e')]['offset']);}return _0x396fa5[_0x18e1('0x79')](_0x592a95);}})[_0x18e1('0x1d')](function(_0x5071bb){if(_0x5071bb){return _0x5071bb?{'count':_0x3d895f,'rows':_0x5071bb}:null;}})[_0x18e1('0x1d')](respondWithResult(_0x2cc5ae,null))[_0x18e1('0x25')](handleError(_0x2cc5ae,null));};exports['notify']=function(_0x594125,_0x48404b,_0x187324){var _0x4fefda={'channel':_0x18e1('0x7a')};var _0xe6d0b6=[];var _0x2615fa=[];var _0x124165={};return db[_0x18e1('0x4e')]['find']({'where':{'id':_0x594125['params']['id']},'include':[{'model':db[_0x18e1('0x76')],'as':_0x18e1('0x7b')}]})[_0x18e1('0x1d')](handleEntityNotFound(_0x48404b,null))['then'](function(_0x3b1d63){_0x4fefda[_0x18e1('0x7c')]=_0x3b1d63;_0x4fefda[_0x18e1('0x7d')]=_['orderBy'](_0x3b1d63[_0x18e1('0x7b')],[_0x18e1('0x78')],[_0x18e1('0x7e')]);if(_0x4fefda[_0x18e1('0x7c')][_0x18e1('0x7b')]){delete _0x4fefda[_0x18e1('0x7c')][_0x18e1('0x7b')];}return db[_0x18e1('0x7f')][_0x18e1('0x5f')]();})[_0x18e1('0x1d')](function(_0x3baffb){if(!_0x3baffb){throw new db[(_0x18e1('0x80'))][(_0x18e1('0x81'))](_0x18e1('0x82'));}_0xe6d0b6=_[_0x18e1('0x83')](_[_0x18e1('0x3d')](_0x3baffb),[_0x18e1('0x84'),_0x18e1('0x85')]);_0x2615fa=_[_0x18e1('0x83')](_[_0x18e1('0x3d')](_0x3baffb),[_0x18e1('0x84'),_0x18e1('0x85'),_0x18e1('0x86'),'ListId']);_0x4fefda[_0x18e1('0x57')]={'mapKey':_0x18e1('0x87')};if(_0x4fefda[_0x18e1('0x7c')]['type']&&_0x4fefda[_0x18e1('0x7c')]['type']==='twilio'){_0x4fefda['body'][_0x18e1('0x88')]=_0x594125['body'][_0x18e1('0x89')][_0x18e1('0x8a')](_0x18e1('0x8b'),'');_0x4fefda['body'][_0x18e1('0x57')]=_0x594125[_0x18e1('0x57')][_0x18e1('0x8c')];_0x4fefda[_0x18e1('0x57')][_0x18e1('0x8d')]=_0x594125['body'][_0x18e1('0x8e')];}if(_0x4fefda[_0x18e1('0x57')]['id']){delete _0x4fefda[_0x18e1('0x57')]['id'];}if(_[_0x18e1('0x8f')](_0x4fefda[_0x18e1('0x57')][_0x18e1('0x88')])){throw new db[(_0x18e1('0x80'))][(_0x18e1('0x81'))]('from\x20is\x20mandatory');}if(_[_0x18e1('0x8f')](_0x4fefda[_0x18e1('0x57')][_0x18e1('0x57')])||_0x4fefda[_0x18e1('0x57')][_0x18e1('0x57')]===''){throw new db[(_0x18e1('0x80'))][(_0x18e1('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x18e1('0x8f')](_0x4fefda['body'][_0x18e1('0x90')])){throw new db[(_0x18e1('0x80'))][(_0x18e1('0x81'))](_0x18e1('0x91')+_0x2615fa);}if(!_[_0x18e1('0x92')](_0x2615fa,_0x4fefda['body']['mapKey'])){throw new db[(_0x18e1('0x80'))]['ValidationError'](_0x18e1('0x93')+_0x2615fa);}_0x124165[_0x4fefda['body']['mapKey']]=_0x4fefda[_0x18e1('0x57')][_0x18e1('0x88')];return db['CmList'][_0x18e1('0x55')]({'where':{'id':_0x4fefda['account'][_0x18e1('0x94')]},'include':[{'model':db[_0x18e1('0x7f')],'as':'Contacts','where':_0x124165,'limit':0x1,'order':[[_0x18e1('0x85'),_0x18e1('0x95')]]}]});})[_0x18e1('0x1d')](handleEntityNotFound(_0x48404b,null))['then'](function(_0x73496){if(_0x73496){_0x4fefda[_0x18e1('0x96')]=_[_0x18e1('0x97')](_0x73496,[_0x18e1('0x98')]);if(_0x73496[_0x18e1('0x98')][_0x18e1('0x43')]){return _0x73496[_0x18e1('0x98')][0x0];}var _0x3e3ddb=_[_0x18e1('0x17')](_0x4fefda[_0x18e1('0x57')],{'firstName':_0x4fefda['body'][_0x18e1('0x88')],'ListId':_0x73496['id']});_0x3e3ddb[_0x4fefda[_0x18e1('0x57')][_0x18e1('0x90')]]=_0x4fefda['body'][_0x18e1('0x88')];return db[_0x18e1('0x7f')][_0x18e1('0x56')](_0x3e3ddb,{'fields':_0xe6d0b6,'raw':!![]});}})[_0x18e1('0x1d')](handleEntityNotFound(_0x48404b,null))[_0x18e1('0x1d')](function(_0x2bc338){if(_0x2bc338){_0x4fefda[_0x18e1('0x99')]=_0x2bc338;var _0x49d11c={'ContactId':_0x2bc338['id'],'phone':_0x4fefda[_0x18e1('0x57')][_0x18e1('0x88')],'WhatsappAccountId':_0x594125[_0x18e1('0x52')]['id']};var _0x4119b8={'ContactId':_0x2bc338['id'],'WhatsappAccountId':_0x594125[_0x18e1('0x52')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x18e1('0x55')]({'where':_0x4119b8})['then'](function(_0x1d605a){if(_0x1d605a){return[_0x1d605a,![]];}return db[_0x18e1('0x9a')][_0x18e1('0x56')](_0x49d11c)[_0x18e1('0x1d')](function(_0x17a0b9){return[_0x17a0b9,!![]];});});}})[_0x18e1('0x6d')](function(_0x2eb17e,_0x4ee03c){_0x4fefda['interaction']=_0x2eb17e[_0x18e1('0x59')]({'plain':!![]});_0x4fefda[_0x18e1('0x9b')][_0x18e1('0x9c')]=![];if(_0x4ee03c){if(_0x4fefda[_0x18e1('0x7c')][_0x18e1('0x9d')]){_0x4fefda[_0x18e1('0x7d')][_0x18e1('0x9e')]({'id':0x0,'priority':_0x4fefda[_0x18e1('0x7d')][_0x18e1('0x43')]+0x1,'app':_0x18e1('0x9f'),'appdata':_0x18e1('0xa0'),'interval':_0x18e1('0xa1')});}_0x4fefda[_0x18e1('0x9b')]['created']=!![];}return db[_0x18e1('0xa2')][_0x18e1('0x56')]({'phone':_0x4fefda[_0x18e1('0x57')]['from'],'messageId':_0x4fefda[_0x18e1('0x57')][_0x18e1('0x8d')],'body':_0x4fefda[_0x18e1('0x57')][_0x18e1('0x57')],'WhatsappAccountId':_0x594125[_0x18e1('0x52')]['id'],'WhatsappInteractionId':_0x2eb17e['id'],'direction':'in','ContactId':_0x2eb17e[_0x18e1('0xa3')],'AttachmentId':_0x4fefda[_0x18e1('0x57')][_0x18e1('0xa4')]});})[_0x18e1('0x1d')](function(_0x38369a){_0x4fefda['message']=_0x38369a;if(_0x4fefda['interaction'][_0x18e1('0xa5')]){return db['User'][_0x18e1('0x55')]({'attributes':['id',_0x18e1('0x34')],'where':{'id':_0x4fefda[_0x18e1('0x9b')][_0x18e1('0xa5')]}})[_0x18e1('0x1d')](function(_0x1d48a9){if(_0x1d48a9){_0x4fefda[_0x18e1('0x7d')][_0x18e1('0xa6')]({'id':0x0,'priority':0x0,'app':_0x18e1('0xa7'),'appdata':_0x1d48a9[_0x18e1('0x34')]+','+(_0x4fefda['account'][_0x18e1('0xa8')]||0xa),'interval':_0x18e1('0xa1')});}return respondWithRpcPromise(_0x18e1('0xa9'),_0x18e1('0xaa'),_0x4fefda);});}return respondWithRpcPromise(_0x18e1('0xa9'),'startRouting',_0x4fefda);})[_0x18e1('0x1d')](function(_0x3dd04a){if(_0x3dd04a){var _0x4c54d9=0xc8;var _0x559ca9='receiveMessage';logger[_0x18e1('0x1e')](_0x18e1('0xab'),_0x559ca9,_0x4c54d9,'entity\x20found');logger[_0x18e1('0xac')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x559ca9,_0x4c54d9,_0x18e1('0xad'),JSON[_0x18e1('0xae')](_0x3dd04a));if(_0x4fefda[_0x18e1('0x7c')][_0x18e1('0x3a')]===_0x18e1('0xaf')){return _0x48404b[_0x18e1('0x26')](_0x4c54d9)[_0x18e1('0xb0')](_0x18e1('0xb1'),_0x18e1('0xb2'))['send'](_0x18e1('0xb3'));}else{return _0x48404b[_0x18e1('0x26')](_0x4c54d9)['json'](_0x3dd04a);}}})[_0x18e1('0x25')](handleError(_0x48404b,null));};exports[_0x18e1('0x35')]=function(_0x4e7deb,_0x3b1534,_0x30abc2){var _0x41b4c7,_0x247ad4,_0x4ad2f3;if(_[_0x18e1('0x8f')](_0x4e7deb['body']['body'])||_0x4e7deb['body'][_0x18e1('0x57')]===''){throw new db['Sequelize']['ValidationError'](_0x18e1('0xb4'));}if(_[_0x18e1('0x8f')](_0x4e7deb[_0x18e1('0x57')]['to'])){throw new db[(_0x18e1('0x80'))]['ValidationError'](_0x18e1('0xb5'));}_0x41b4c7=_0x4e7deb[_0x18e1('0x57')]['to'];return db[_0x18e1('0x4e')][_0x18e1('0x55')]({'where':{'id':_0x4e7deb[_0x18e1('0x52')]['id']},'include':[{'model':db[_0x18e1('0xb6')],'as':'List','include':[{'model':db[_0x18e1('0x7f')],'as':'Contacts','where':{'mobile':_0x41b4c7},'limit':0x1,'order':[[_0x18e1('0x85'),'DESC']]}]}]})[_0x18e1('0x1d')](handleEntityNotFound(_0x3b1534,null))['then'](function(_0x40de93){if(_0x40de93&&_0x40de93[_0x18e1('0xb7')]){_0x247ad4=_0x40de93[_0x18e1('0x59')]({'plain':!![]});if(_0x247ad4['List']&&_0x247ad4[_0x18e1('0xb7')]['Contacts']['length']){return _0x247ad4[_0x18e1('0xb7')]['Contacts'][0x0];}return db[_0x18e1('0x7f')][_0x18e1('0x56')](_[_0x18e1('0x17')](_0x4e7deb[_0x18e1('0x57')],{'firstName':_0x41b4c7,'mobile':_0x41b4c7,'phone':_0x41b4c7,'ListId':_0x247ad4[_0x18e1('0x94')]}));}})[_0x18e1('0x1d')](handleEntityNotFound(_0x3b1534,null))[_0x18e1('0x1d')](function(_0x861b65){if(_0x861b65){_0x4ad2f3=_0x861b65;return db[_0x18e1('0x9a')][_0x18e1('0x55')]({'where':{'ContactId':_0x4ad2f3['id'],'closed':![],'WhatsappAccountId':_0x247ad4['id']}})[_0x18e1('0x1d')](function(_0x3d0d24){if(_0x3d0d24){return[_0x3d0d24,![]];}return db[_0x18e1('0x9a')][_0x18e1('0x56')]({'UserId':_0x4e7deb['user']['id'],'ContactId':_0x4ad2f3['id'],'WhatsappAccountId':_0x247ad4['id'],'phone':_0x41b4c7,'firstMsgDirection':_0x18e1('0xb8'),'Messages':[_['merge'](_0x4e7deb[_0x18e1('0x57')],{'read':![],'body':_0x4e7deb[_0x18e1('0x57')][_0x18e1('0x57')],'phone':_0x41b4c7,'WhatsappAccountId':_0x247ad4['id'],'UserId':_0x4e7deb[_0x18e1('0x58')]['id'],'ContactId':_0x4ad2f3['id']})]},{'include':[{'model':db[_0x18e1('0xa2')],'as':_0x18e1('0xb9')}]})[_0x18e1('0x1d')](function(_0xce035b){return[_0xce035b,!![]];});});}})[_0x18e1('0x6d')](function(_0x2005e5,_0x53bb88){if(_0x53bb88){return _0x2005e5;}return db[_0x18e1('0xa2')][_0x18e1('0x56')](_[_0x18e1('0x49')](_0x4e7deb[_0x18e1('0x57')],{'read':![],'body':_0x4e7deb[_0x18e1('0x57')][_0x18e1('0x57')],'phone':_0x41b4c7,'WhatsappAccountId':_0x247ad4['id'],'WhatsappInteractionId':_0x2005e5['id'],'UserId':_0x4e7deb[_0x18e1('0x58')]['id'],'ContactId':_0x4ad2f3['id']}))['then'](function(_0x16db21){_0x2005e5[_0x18e1('0xba')][_0x18e1('0xb9')]=[];_0x2005e5[_0x18e1('0xba')][_0x18e1('0xb9')][_0x18e1('0x9e')](_0x16db21[_0x18e1('0xba')]);return _0x2005e5;});})[_0x18e1('0x1d')](respondWithResult(_0x3b1534,null))[_0x18e1('0x25')](handleError(_0x3b1534,null));};
\ No newline at end of file
+var _0x6ff2=['request-promise','moment','bluebird','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/license/util','redis','localhost','socket.io-emitter','register','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','Pause','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','WhatsappApplication','findAndCountAll','priority','getApplications','notify','Applications','account','applications','orderBy','asc','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','type','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','defaults','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','CmList','List','DESC','out','dataValues','Messages','push','eml-format','fast-json-patch'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_0x6ff2,0xba));var _0x26ff=function(_0x161f72,_0x4f6b71){_0x161f72=_0x161f72-0x0;var _0x444d61=_0x6ff2[_0x161f72];return _0x444d61;};'use strict';var emlformat=require(_0x26ff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x26ff('0x1'));var rp=require(_0x26ff('0x2'));var moment=require(_0x26ff('0x3'));var BPromise=require(_0x26ff('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26ff('0x5'));var sox=require(_0x26ff('0x6'));var csv=require(_0x26ff('0x7'));var ejs=require(_0x26ff('0x8'));var fs=require('fs');var fs_extra=require(_0x26ff('0x9'));var _=require(_0x26ff('0xa'));var squel=require(_0x26ff('0xb'));var crypto=require(_0x26ff('0xc'));var jsforce=require(_0x26ff('0xd'));var deskjs=require(_0x26ff('0xe'));var toCsv=require(_0x26ff('0x7'));var querystring=require(_0x26ff('0xf'));var Papa=require('papaparse');var Redis=require(_0x26ff('0x10'));var authService=require(_0x26ff('0x11'));var qs=require(_0x26ff('0x12'));var as=require(_0x26ff('0x13'));var hardwareService=require(_0x26ff('0x14'));var logger=require(_0x26ff('0x15'))(_0x26ff('0x16'));var utils=require(_0x26ff('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x26ff('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x26ff('0x19')],{'host':_0x26ff('0x1a'),'port':0x18eb});var socket=require(_0x26ff('0x1b'))(new Redis(config[_0x26ff('0x19')]));require('./whatsappAccount.socket')[_0x26ff('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x26ff('0x1d')][_0x26ff('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3e611b,_0x443ed8,_0x2d4092,_0x23197c){return new BPromise(function(_0x39bb5d,_0x59b68c){var _0x9f8907=_0x23197c||client;return _0x9f8907[_0x26ff('0x1f')](_0x3e611b,_0x2d4092)[_0x26ff('0x20')](function(_0x5c1137){logger[_0x26ff('0x21')](_0x26ff('0x22'),_0x443ed8,_0x26ff('0x23'));logger[_0x26ff('0x24')](_0x26ff('0x25'),_0x443ed8,_0x26ff('0x23'),JSON[_0x26ff('0x26')](_0x5c1137));if(_0x5c1137[_0x26ff('0x27')]){if(_0x5c1137[_0x26ff('0x27')][_0x26ff('0x28')]===0x1f4){logger[_0x26ff('0x27')](_0x26ff('0x22'),_0x443ed8,_0x5c1137['error']['message']);return _0x59b68c(_0x5c1137['error'][_0x26ff('0x29')]);}logger[_0x26ff('0x27')](_0x26ff('0x22'),_0x443ed8,_0x5c1137['error'][_0x26ff('0x29')]);return _0x39bb5d(_0x5c1137[_0x26ff('0x27')]['message']);}else{logger['info'](_0x26ff('0x22'),_0x443ed8,_0x26ff('0x23'));_0x39bb5d(_0x5c1137[_0x26ff('0x2a')][_0x26ff('0x29')]);}})['catch'](function(_0x160dbb){logger['error'](_0x26ff('0x22'),_0x443ed8,_0x160dbb);_0x59b68c(_0x160dbb);});});}function respondWithStatusCode(_0x4dd0a1,_0x483c64){_0x483c64=_0x483c64||0xcc;return function(_0x1cd8a6){if(_0x1cd8a6){return _0x4dd0a1[_0x26ff('0x2b')](_0x483c64);}return _0x4dd0a1[_0x26ff('0x2c')](_0x483c64)[_0x26ff('0x2d')]();};}function respondWithResult(_0x4b359e,_0x2b962d){_0x2b962d=_0x2b962d||0xc8;return function(_0x12908b){if(_0x12908b){return _0x4b359e[_0x26ff('0x2c')](_0x2b962d)['json'](_0x12908b);}};}function respondWithFilteredResult(_0x53e0a4,_0x136357){return function(_0x1074bb){if(_0x1074bb){var _0x458ede=typeof _0x136357[_0x26ff('0x2e')]===_0x26ff('0x2f')&&typeof _0x136357[_0x26ff('0x30')]===_0x26ff('0x2f');var _0x14fd3f=_0x1074bb[_0x26ff('0x31')];var _0x2aa84b=_0x458ede?0x0:_0x136357['offset'];var _0x53bf22=_0x458ede?_0x1074bb['count']:_0x136357[_0x26ff('0x2e')]+_0x136357[_0x26ff('0x30')];var _0x5f672;if(_0x53bf22>=_0x14fd3f){_0x53bf22=_0x14fd3f;_0x5f672=0xc8;}else{_0x5f672=0xce;}_0x53e0a4['status'](_0x5f672);return _0x53e0a4[_0x26ff('0x32')](_0x26ff('0x33'),_0x2aa84b+'-'+_0x53bf22+'/'+_0x14fd3f)[_0x26ff('0x34')](_0x1074bb);}return null;};}function patchUpdates(_0x2ce75e){return function(_0x23734b){try{jsonpatch[_0x26ff('0x35')](_0x23734b,_0x2ce75e,!![]);}catch(_0x327f4c){return BPromise['reject'](_0x327f4c);}return _0x23734b[_0x26ff('0x36')]();};}function saveUpdates(_0x25a2a7,_0x134e73){return function(_0x1d1321){if(_0x1d1321){return _0x1d1321[_0x26ff('0x37')](_0x25a2a7)[_0x26ff('0x20')](function(_0x3fddc6){return _0x3fddc6;});}return null;};}function removeEntity(_0x430f3d,_0x4d2711){return function(_0x2d78a2){if(_0x2d78a2){return _0x2d78a2[_0x26ff('0x38')]()[_0x26ff('0x20')](function(){var _0x4eef38=_0x2d78a2[_0x26ff('0x39')]({'plain':!![]});var _0x273b28=_0x26ff('0x3a');return db[_0x26ff('0x3b')][_0x26ff('0x38')]({'where':{'type':_0x273b28,'resourceId':_0x4eef38['id']}})[_0x26ff('0x20')](function(){return _0x2d78a2;});})[_0x26ff('0x20')](function(){_0x430f3d[_0x26ff('0x2c')](0xcc)[_0x26ff('0x2d')]();});}};}function handleEntityNotFound(_0x5673d2,_0x34b480){return function(_0x4e8b3f){if(!_0x4e8b3f){_0x5673d2[_0x26ff('0x2b')](0x194);}return _0x4e8b3f;};}function handleError(_0x54c16a,_0x18ca2a){_0x18ca2a=_0x18ca2a||0x1f4;return function(_0x4b3254){logger['error'](_0x4b3254[_0x26ff('0x3c')]);if(_0x4b3254[_0x26ff('0x3d')]){delete _0x4b3254[_0x26ff('0x3d')];}_0x54c16a[_0x26ff('0x2c')](_0x18ca2a)[_0x26ff('0x3e')](_0x4b3254);};}exports[_0x26ff('0x3f')]=function(_0xade417,_0x3c807c){var _0x536a3f={'include':[{'model':db['Pause'],'as':_0x26ff('0x40')}]},_0x36a75c={},_0x50789b={'count':0x0,'rows':[]};var _0x2e59ab=_[_0x26ff('0x41')](db[_0x26ff('0x42')]['rawAttributes'],function(_0x406834){return{'name':_0x406834['fieldName'],'type':_0x406834['type']['key']};});_0x36a75c[_0x26ff('0x43')]=_['map'](_0x2e59ab,_0x26ff('0x3d'));_0x36a75c['query']=_[_0x26ff('0x44')](_0xade417[_0x26ff('0x45')]);_0x36a75c[_0x26ff('0x46')]=_[_0x26ff('0x47')](_0x36a75c[_0x26ff('0x43')],_0x36a75c[_0x26ff('0x45')]);_0x536a3f['attributes']=_[_0x26ff('0x47')](_0x36a75c['model'],qs[_0x26ff('0x48')](_0xade417[_0x26ff('0x45')][_0x26ff('0x48')]));_0x536a3f[_0x26ff('0x49')]=_0x536a3f[_0x26ff('0x49')]['length']?_0x536a3f['attributes']:_0x36a75c[_0x26ff('0x43')];if(!_0xade417[_0x26ff('0x45')][_0x26ff('0x4a')](_0x26ff('0x4b'))){_0x536a3f['limit']=qs[_0x26ff('0x30')](_0xade417[_0x26ff('0x45')][_0x26ff('0x30')]);_0x536a3f[_0x26ff('0x2e')]=qs['offset'](_0xade417[_0x26ff('0x45')][_0x26ff('0x2e')]);}_0x536a3f[_0x26ff('0x4c')]=qs[_0x26ff('0x4d')](_0xade417[_0x26ff('0x45')][_0x26ff('0x4d')]);_0x536a3f['where']=qs[_0x26ff('0x46')](_[_0x26ff('0x4e')](_0xade417['query'],_0x36a75c['filters']),_0x2e59ab);if(_0xade417[_0x26ff('0x45')][_0x26ff('0x4f')]){_0x536a3f[_0x26ff('0x50')]=_[_0x26ff('0x51')](_0x536a3f['where'],{'$or':_['map'](_0x2e59ab,function(_0x313a8a){if(_0x313a8a['type']!==_0x26ff('0x52')){var _0x2ea557={};_0x2ea557[_0x313a8a[_0x26ff('0x3d')]]={'$like':'%'+_0xade417[_0x26ff('0x45')][_0x26ff('0x4f')]+'%'};return _0x2ea557;}})});}_0x536a3f=_[_0x26ff('0x51')]({},_0x536a3f,_0xade417[_0x26ff('0x53')]);var _0x50b6ae={'where':_0x536a3f[_0x26ff('0x50')]};return db[_0x26ff('0x42')][_0x26ff('0x31')](_0x50b6ae)[_0x26ff('0x20')](function(_0x2b199c){_0x50789b[_0x26ff('0x31')]=_0x2b199c;if(_0xade417[_0x26ff('0x45')][_0x26ff('0x54')]){_0x536a3f['include']=[{'all':!![]}];}return db[_0x26ff('0x42')][_0x26ff('0x55')](_0x536a3f);})[_0x26ff('0x20')](function(_0xfb8b1c){_0x50789b[_0x26ff('0x56')]=_0xfb8b1c;return _0x50789b;})[_0x26ff('0x20')](respondWithFilteredResult(_0x3c807c,_0x536a3f))[_0x26ff('0x57')](handleError(_0x3c807c,null));};exports['show']=function(_0x1bb490,_0x60992e){var _0x130fd3={'raw':![],'where':{'id':_0x1bb490[_0x26ff('0x58')]['id']},'include':[{'model':db[_0x26ff('0x59')],'as':_0x26ff('0x40')}]},_0x50bcc1={};_0x50bcc1[_0x26ff('0x43')]=_[_0x26ff('0x44')](db['WhatsappAccount'][_0x26ff('0x5a')]);_0x50bcc1[_0x26ff('0x45')]=_['keys'](_0x1bb490['query']);_0x50bcc1[_0x26ff('0x46')]=_[_0x26ff('0x47')](_0x50bcc1['model'],_0x50bcc1[_0x26ff('0x45')]);_0x130fd3['attributes']=_['intersection'](_0x50bcc1['model'],qs['fields'](_0x1bb490[_0x26ff('0x45')]['fields']));_0x130fd3[_0x26ff('0x49')]=_0x130fd3[_0x26ff('0x49')]['length']?_0x130fd3[_0x26ff('0x49')]:_0x50bcc1[_0x26ff('0x43')];if(_0x1bb490['query'][_0x26ff('0x54')]){_0x130fd3[_0x26ff('0x5b')]=[{'all':!![]}];}_0x130fd3=_[_0x26ff('0x51')]({},_0x130fd3,_0x1bb490['options']);return db[_0x26ff('0x42')][_0x26ff('0x5c')](_0x130fd3)['then'](handleEntityNotFound(_0x60992e,null))[_0x26ff('0x20')](respondWithResult(_0x60992e,null))[_0x26ff('0x57')](handleError(_0x60992e,null));};exports[_0x26ff('0x5d')]=function(_0x574a71,_0x87ec5d){return db[_0x26ff('0x42')][_0x26ff('0x5d')](_0x574a71[_0x26ff('0x5e')],{})[_0x26ff('0x20')](function(_0x26c6bb){var _0x34d0d6=_0x574a71[_0x26ff('0x5f')][_0x26ff('0x39')]({'plain':!![]});if(!_0x34d0d6)throw new Error(_0x26ff('0x60'));if(_0x34d0d6[_0x26ff('0x61')]==='user'){var _0x2f2d69=_0x26c6bb[_0x26ff('0x39')]({'plain':!![]});var _0x566d9a='WhatsappAccounts';return db[_0x26ff('0x62')][_0x26ff('0x5c')]({'where':{'name':_0x566d9a,'userProfileId':_0x34d0d6[_0x26ff('0x63')]},'raw':!![]})['then'](function(_0x299867){if(_0x299867&&_0x299867[_0x26ff('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x2f2d69[_0x26ff('0x3d')],'resourceId':_0x2f2d69['id'],'type':_0x299867[_0x26ff('0x3d')],'sectionId':_0x299867['id']},{})[_0x26ff('0x20')](function(){return _0x26c6bb;});}else{return _0x26c6bb;}})[_0x26ff('0x57')](function(_0x1490f7){logger[_0x26ff('0x27')](_0x26ff('0x65'),_0x1490f7);throw _0x1490f7;});}return _0x26c6bb;})[_0x26ff('0x20')](respondWithResult(_0x87ec5d,0xc9))[_0x26ff('0x57')](handleError(_0x87ec5d,null));};exports[_0x26ff('0x37')]=function(_0xad91f8,_0x290316){if(_0xad91f8['body']['id']){delete _0xad91f8['body']['id'];}return db[_0x26ff('0x42')][_0x26ff('0x5c')]({'where':{'id':_0xad91f8[_0x26ff('0x58')]['id']},'include':[{'model':db[_0x26ff('0x59')],'as':_0x26ff('0x40')}]})[_0x26ff('0x20')](handleEntityNotFound(_0x290316,null))[_0x26ff('0x20')](saveUpdates(_0xad91f8['body'],null))[_0x26ff('0x20')](respondWithResult(_0x290316,null))[_0x26ff('0x57')](handleError(_0x290316,null));};exports[_0x26ff('0x38')]=function(_0x354ab6,_0xb28348){return db['WhatsappAccount'][_0x26ff('0x5c')]({'where':{'id':_0x354ab6['params']['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0xb28348,null))[_0x26ff('0x20')](removeEntity(_0xb28348,null))[_0x26ff('0x57')](handleError(_0xb28348,null));};exports[_0x26ff('0x66')]=function(_0x2dffd8,_0x1ea295){return db[_0x26ff('0x42')][_0x26ff('0x66')]()[_0x26ff('0x20')](respondWithResult(_0x1ea295,null))[_0x26ff('0x57')](handleError(_0x1ea295,null));};exports[_0x26ff('0x67')]=function(_0x1215af,_0x2cfb9b,_0x1ae407){if(_0x1215af['body']['id']){delete _0x1215af[_0x26ff('0x5e')]['id'];}return db[_0x26ff('0x42')][_0x26ff('0x5c')]({'where':{'id':_0x1215af['params']['id']}})['then'](handleEntityNotFound(_0x2cfb9b,null))[_0x26ff('0x20')](function(_0x3d3459){if(_0x3d3459){_0x1215af['body'][_0x26ff('0x68')]=_0x3d3459['id'];return db['Disposition'][_0x26ff('0x5d')](_0x1215af[_0x26ff('0x5e')]);}})[_0x26ff('0x20')](respondWithResult(_0x2cfb9b,null))[_0x26ff('0x57')](handleError(_0x2cfb9b,null));};exports[_0x26ff('0x69')]=function(_0x3ccf28,_0x2bf6e4,_0x55e0f4){var _0x2bf0a4={'raw':![],'where':{}};var _0x3f86d8={};var _0x5859f8={'count':0x0,'rows':[]};return db[_0x26ff('0x42')]['findOne']({'where':{'id':_0x3ccf28[_0x26ff('0x58')]['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0x2bf6e4,null))[_0x26ff('0x20')](function(_0x2fd431){if(_0x2fd431){_0x3f86d8[_0x26ff('0x43')]=_[_0x26ff('0x44')](db[_0x26ff('0x6a')]['rawAttributes']);_0x3f86d8[_0x26ff('0x45')]=_['keys'](_0x3ccf28[_0x26ff('0x45')]);_0x3f86d8[_0x26ff('0x46')]=_[_0x26ff('0x47')](_0x3f86d8[_0x26ff('0x43')],_0x3f86d8[_0x26ff('0x45')]);_0x2bf0a4[_0x26ff('0x49')]=_[_0x26ff('0x47')](_0x3f86d8[_0x26ff('0x43')],qs[_0x26ff('0x48')](_0x3ccf28[_0x26ff('0x45')][_0x26ff('0x48')]));_0x2bf0a4['attributes']=_0x2bf0a4['attributes'][_0x26ff('0x6b')]?_0x2bf0a4[_0x26ff('0x49')]:_0x3f86d8[_0x26ff('0x43')];if(!_0x3ccf28['query']['hasOwnProperty'](_0x26ff('0x4b'))){_0x2bf0a4[_0x26ff('0x30')]=qs[_0x26ff('0x30')](_0x3ccf28[_0x26ff('0x45')][_0x26ff('0x30')]);_0x2bf0a4[_0x26ff('0x2e')]=qs[_0x26ff('0x2e')](_0x3ccf28['query'][_0x26ff('0x2e')]);}_0x2bf0a4[_0x26ff('0x4c')]=qs[_0x26ff('0x4d')](_0x3ccf28['query']['sort']);_0x2bf0a4[_0x26ff('0x50')]=qs[_0x26ff('0x46')](_[_0x26ff('0x4e')](_0x3ccf28['query'],_0x3f86d8['filters']));_0x2bf0a4[_0x26ff('0x50')][_0x26ff('0x68')]=_0x2fd431['id'];if(_0x3ccf28[_0x26ff('0x45')][_0x26ff('0x4f')]){_0x2bf0a4[_0x26ff('0x50')]=_['merge'](_0x2bf0a4['where'],{'$or':_[_0x26ff('0x41')](_0x2bf0a4['attributes'],function(_0x34e16d){var _0x21c15e={};_0x21c15e[_0x34e16d]={'$like':'%'+_0x3ccf28[_0x26ff('0x45')][_0x26ff('0x4f')]+'%'};return _0x21c15e;})});}_0x2bf0a4=_[_0x26ff('0x51')]({},_0x2bf0a4,_0x3ccf28[_0x26ff('0x53')]);return db[_0x26ff('0x6a')]['count']({'where':_0x2bf0a4[_0x26ff('0x50')]})[_0x26ff('0x20')](function(_0x3d297f){_0x5859f8[_0x26ff('0x31')]=_0x3d297f;if(_0x3ccf28['query'][_0x26ff('0x54')]){_0x2bf0a4[_0x26ff('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2bf0a4);})[_0x26ff('0x20')](function(_0x5e883c){_0x5859f8[_0x26ff('0x56')]=_0x5e883c;return _0x5859f8;});}})['then'](respondWithFilteredResult(_0x2bf6e4,_0x2bf0a4))['catch'](handleError(_0x2bf6e4,null));};exports[_0x26ff('0x6c')]=function(_0x4392b1,_0x486cdc,_0x23189d){return db['WhatsappAccount']['find']({'where':{'id':_0x4392b1['params']['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0x486cdc,null))[_0x26ff('0x20')](function(_0x2666b9){if(_0x2666b9){return _0x2666b9[_0x26ff('0x6c')](_0x4392b1['query'][_0x26ff('0x6d')]);}})[_0x26ff('0x20')](respondWithStatusCode(_0x486cdc,null))[_0x26ff('0x57')](handleError(_0x486cdc,null));};exports[_0x26ff('0x6e')]=function(_0x3eabae,_0x42c0e7,_0x1424af){if(_0x3eabae['body']['id']){delete _0x3eabae['body']['id'];}return db[_0x26ff('0x42')][_0x26ff('0x5c')]({'where':{'id':_0x3eabae[_0x26ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x42c0e7,null))[_0x26ff('0x20')](function(_0x3013cb){if(_0x3013cb){_0x3eabae[_0x26ff('0x5e')][_0x26ff('0x68')]=_0x3013cb['id'];return db[_0x26ff('0x6f')][_0x26ff('0x5d')](_0x3eabae[_0x26ff('0x5e')]);}})['then'](respondWithResult(_0x42c0e7,null))[_0x26ff('0x57')](handleError(_0x42c0e7,null));};exports[_0x26ff('0x70')]=function(_0x1b54d9,_0x4ecfab,_0x14fcab){var _0x4ba2e2={'raw':![],'where':{}};var _0x2cd11a={};var _0x55a807={'count':0x0,'rows':[]};return db[_0x26ff('0x42')][_0x26ff('0x71')]({'where':{'id':_0x1b54d9[_0x26ff('0x58')]['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0x4ecfab,null))[_0x26ff('0x20')](function(_0xd82eed){if(_0xd82eed){_0x2cd11a[_0x26ff('0x43')]=_[_0x26ff('0x44')](db[_0x26ff('0x6f')]['rawAttributes']);_0x2cd11a[_0x26ff('0x45')]=_['keys'](_0x1b54d9['query']);_0x2cd11a[_0x26ff('0x46')]=_['intersection'](_0x2cd11a['model'],_0x2cd11a['query']);_0x4ba2e2['attributes']=_[_0x26ff('0x47')](_0x2cd11a['model'],qs[_0x26ff('0x48')](_0x1b54d9[_0x26ff('0x45')][_0x26ff('0x48')]));_0x4ba2e2[_0x26ff('0x49')]=_0x4ba2e2[_0x26ff('0x49')]['length']?_0x4ba2e2[_0x26ff('0x49')]:_0x2cd11a[_0x26ff('0x43')];if(!_0x1b54d9[_0x26ff('0x45')][_0x26ff('0x4a')](_0x26ff('0x4b'))){_0x4ba2e2['limit']=qs[_0x26ff('0x30')](_0x1b54d9[_0x26ff('0x45')][_0x26ff('0x30')]);_0x4ba2e2[_0x26ff('0x2e')]=qs[_0x26ff('0x2e')](_0x1b54d9[_0x26ff('0x45')]['offset']);}_0x4ba2e2[_0x26ff('0x4c')]=qs['sort'](_0x1b54d9[_0x26ff('0x45')]['sort']);_0x4ba2e2[_0x26ff('0x50')]=qs[_0x26ff('0x46')](_['pick'](_0x1b54d9[_0x26ff('0x45')],_0x2cd11a[_0x26ff('0x46')]));_0x4ba2e2[_0x26ff('0x50')][_0x26ff('0x68')]=_0xd82eed['id'];if(_0x1b54d9[_0x26ff('0x45')][_0x26ff('0x4f')]){_0x4ba2e2[_0x26ff('0x50')]=_[_0x26ff('0x51')](_0x4ba2e2[_0x26ff('0x50')],{'$or':_['map'](_0x4ba2e2[_0x26ff('0x49')],function(_0xe6ede0){var _0x36d7ab={};_0x36d7ab[_0xe6ede0]={'$like':'%'+_0x1b54d9[_0x26ff('0x45')][_0x26ff('0x4f')]+'%'};return _0x36d7ab;})});}_0x4ba2e2=_[_0x26ff('0x51')]({},_0x4ba2e2,_0x1b54d9[_0x26ff('0x53')]);return db[_0x26ff('0x6f')][_0x26ff('0x31')]({'where':_0x4ba2e2['where']})[_0x26ff('0x20')](function(_0xc8ae5){_0x55a807[_0x26ff('0x31')]=_0xc8ae5;if(_0x1b54d9[_0x26ff('0x45')]['includeAll']){_0x4ba2e2[_0x26ff('0x5b')]=[{'all':!![]}];}return db[_0x26ff('0x6f')][_0x26ff('0x55')](_0x4ba2e2);})[_0x26ff('0x20')](function(_0xaf971a){_0x55a807[_0x26ff('0x56')]=_0xaf971a;return _0x55a807;});}})[_0x26ff('0x20')](respondWithFilteredResult(_0x4ecfab,_0x4ba2e2))[_0x26ff('0x57')](handleError(_0x4ecfab,null));};exports[_0x26ff('0x72')]=function(_0x1751c5,_0x52d73f,_0x14a8a6){return db['WhatsappAccount'][_0x26ff('0x5c')]({'where':{'id':_0x1751c5[_0x26ff('0x58')]['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0x52d73f,null))[_0x26ff('0x20')](function(_0x34e3c1){if(_0x34e3c1){return _0x34e3c1[_0x26ff('0x72')](_0x1751c5[_0x26ff('0x45')][_0x26ff('0x6d')]);}})[_0x26ff('0x20')](respondWithStatusCode(_0x52d73f,null))[_0x26ff('0x57')](handleError(_0x52d73f,null));};exports['addAgents']=function(_0x274012,_0x57a4fe,_0x3e3814){return db[_0x26ff('0x42')][_0x26ff('0x5c')]({'where':{'id':_0x274012['params']['id']}})['then'](handleEntityNotFound(_0x57a4fe,null))[_0x26ff('0x20')](function(_0x5b703e){if(_0x5b703e){return _0x5b703e[_0x26ff('0x73')](_0x274012[_0x26ff('0x5e')][_0x26ff('0x6d')],_[_0x26ff('0x74')](_0x274012[_0x26ff('0x5e')],[_0x26ff('0x6d'),'id'])||{})[_0x26ff('0x75')](function(_0x20923b){for(var _0x5d51be=0x0;_0x5d51be<_0x274012['body'][_0x26ff('0x6d')][_0x26ff('0x6b')];_0x5d51be+=0x1){socket[_0x26ff('0x76')](_0x26ff('0x77'),{'UserId':Number(_0x274012[_0x26ff('0x5e')][_0x26ff('0x6d')][_0x5d51be]),'WhatsappAccountId':Number(_0x274012['params']['id'])});}return _0x20923b;});}})['then'](respondWithResult(_0x57a4fe,null))[_0x26ff('0x57')](handleError(_0x57a4fe,null));};exports[_0x26ff('0x78')]=function(_0x18d06c,_0x1671c2,_0x2e0dac){return db[_0x26ff('0x42')][_0x26ff('0x5c')]({'where':{'id':_0x18d06c[_0x26ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x1671c2,null))[_0x26ff('0x20')](function(_0x2562b0){if(_0x2562b0){return _0x2562b0[_0x26ff('0x78')](_0x18d06c[_0x26ff('0x45')]['ids'])[_0x26ff('0x20')](function(){if(_['isArray'](_0x18d06c['query'][_0x26ff('0x6d')])){for(var _0x171347=0x0;_0x171347<_0x18d06c[_0x26ff('0x45')]['ids'][_0x26ff('0x6b')];_0x171347+=0x1){socket['emit'](_0x26ff('0x79'),{'UserId':Number(_0x18d06c[_0x26ff('0x45')][_0x26ff('0x6d')][_0x171347]),'WhatsappAccountId':Number(_0x18d06c[_0x26ff('0x58')]['id'])});}}else{socket['emit'](_0x26ff('0x79'),{'UserId':Number(_0x18d06c[_0x26ff('0x45')][_0x26ff('0x6d')]),'WhatsappAccountId':Number(_0x18d06c[_0x26ff('0x58')]['id'])});}});}})[_0x26ff('0x20')](respondWithStatusCode(_0x1671c2,null))['catch'](handleError(_0x1671c2,null));};exports['getAgents']=function(_0x22b089,_0x29c066,_0xff0b6b){var _0x171bd7={};var _0x11acdf={};var _0x2f8581;var _0x2a5fe2;return db[_0x26ff('0x42')]['findOne']({'where':{'id':_0x22b089['params']['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0x29c066,null))[_0x26ff('0x20')](function(_0x41fc65){if(_0x41fc65){_0x2f8581=_0x41fc65;_0x11acdf[_0x26ff('0x43')]=_[_0x26ff('0x44')](db[_0x26ff('0x7a')][_0x26ff('0x5a')]);_0x11acdf[_0x26ff('0x45')]=_['keys'](_0x22b089[_0x26ff('0x45')]);_0x11acdf[_0x26ff('0x46')]=_[_0x26ff('0x47')](_0x11acdf[_0x26ff('0x43')],_0x11acdf[_0x26ff('0x45')]);_0x171bd7[_0x26ff('0x49')]=_[_0x26ff('0x47')](_0x11acdf[_0x26ff('0x43')],qs[_0x26ff('0x48')](_0x22b089[_0x26ff('0x45')]['fields']));_0x171bd7[_0x26ff('0x49')]=_0x171bd7[_0x26ff('0x49')][_0x26ff('0x6b')]?_0x171bd7['attributes']:_0x11acdf[_0x26ff('0x43')];_0x171bd7['order']=qs[_0x26ff('0x4d')](_0x22b089[_0x26ff('0x45')][_0x26ff('0x4d')]);_0x171bd7[_0x26ff('0x50')]=qs[_0x26ff('0x46')](_[_0x26ff('0x4e')](_0x22b089[_0x26ff('0x45')],_0x11acdf[_0x26ff('0x46')]));if(_0x22b089[_0x26ff('0x45')][_0x26ff('0x4f')]){_0x171bd7[_0x26ff('0x50')]=_[_0x26ff('0x51')](_0x171bd7[_0x26ff('0x50')],{'$or':_[_0x26ff('0x41')](_0x171bd7[_0x26ff('0x49')],function(_0x16a0a6){var _0xefb7e7={};_0xefb7e7[_0x16a0a6]={'$like':'%'+_0x22b089[_0x26ff('0x45')][_0x26ff('0x4f')]+'%'};return _0xefb7e7;})});}_0x171bd7=_[_0x26ff('0x51')]({},_0x171bd7,_0x22b089['options']);return _0x2f8581[_0x26ff('0x7b')](_0x171bd7);}})[_0x26ff('0x20')](function(_0x557201){if(_0x557201){_0x2a5fe2=_0x557201['length'];if(!_0x22b089['query'][_0x26ff('0x4a')](_0x26ff('0x4b'))){_0x171bd7[_0x26ff('0x30')]=qs[_0x26ff('0x30')](_0x22b089[_0x26ff('0x45')][_0x26ff('0x30')]);_0x171bd7['offset']=qs[_0x26ff('0x2e')](_0x22b089[_0x26ff('0x45')]['offset']);}return _0x2f8581[_0x26ff('0x7b')](_0x171bd7);}})[_0x26ff('0x20')](function(_0x2491d0){if(_0x2491d0){return _0x2491d0?{'count':_0x2a5fe2,'rows':_0x2491d0}:null;}})[_0x26ff('0x20')](respondWithResult(_0x29c066,null))[_0x26ff('0x57')](handleError(_0x29c066,null));};exports[_0x26ff('0x7c')]=function(_0x32dad1,_0x56ee34,_0xc1aa8a){return db['WhatsappAccount'][_0x26ff('0x71')]({'where':{'id':_0x32dad1['params']['id']}})[_0x26ff('0x20')](handleEntityNotFound(_0x56ee34,null))['then'](function(_0x4c3a50){if(_0x4c3a50){return db[_0x26ff('0x7d')]['transaction'](function(_0x2bcebc){return db[_0x26ff('0x7e')][_0x26ff('0x38')]({'where':{'WhatsappAccountId':_0x32dad1[_0x26ff('0x58')]['id']},'transaction':_0x2bcebc})[_0x26ff('0x20')](function(_0x1be213){var _0x50790c=_[_0x26ff('0x41')](_0x32dad1[_0x26ff('0x5e')],function(_0x2a12b9){_0x2a12b9[_0x26ff('0x68')]=_0x32dad1[_0x26ff('0x58')]['id'];return _0x2a12b9;});return db['WhatsappApplication']['bulkCreate'](_0x50790c,{'transaction':_0x2bcebc});});})['then'](function(){return db[_0x26ff('0x7e')][_0x26ff('0x7f')]({'where':{'WhatsappAccountId':_0x32dad1[_0x26ff('0x58')]['id']},'order':_0x26ff('0x80')});});}})[_0x26ff('0x20')](respondWithResult(_0x56ee34,null))['catch'](handleError(_0x56ee34,null));};exports[_0x26ff('0x81')]=function(_0x30bb12,_0x431c99,_0x315c64){var _0x2be72a={};var _0x104a56={};var _0x57f006;var _0x2b1a26;return db[_0x26ff('0x42')][_0x26ff('0x71')]({'where':{'id':_0x30bb12[_0x26ff('0x58')]['id']}})['then'](handleEntityNotFound(_0x431c99,null))[_0x26ff('0x20')](function(_0x32e6c8){if(_0x32e6c8){_0x57f006=_0x32e6c8;_0x104a56[_0x26ff('0x43')]=_[_0x26ff('0x44')](db[_0x26ff('0x7e')][_0x26ff('0x5a')]);_0x104a56['query']=_[_0x26ff('0x44')](_0x30bb12[_0x26ff('0x45')]);_0x104a56[_0x26ff('0x46')]=_['intersection'](_0x104a56[_0x26ff('0x43')],_0x104a56['query']);_0x2be72a['attributes']=_[_0x26ff('0x47')](_0x104a56[_0x26ff('0x43')],qs['fields'](_0x30bb12[_0x26ff('0x45')][_0x26ff('0x48')]));_0x2be72a[_0x26ff('0x49')]=_0x2be72a[_0x26ff('0x49')][_0x26ff('0x6b')]?_0x2be72a[_0x26ff('0x49')]:_0x104a56['model'];_0x2be72a[_0x26ff('0x4c')]=qs['sort'](_0x30bb12[_0x26ff('0x45')][_0x26ff('0x4d')]);_0x2be72a['where']=qs['filters'](_[_0x26ff('0x4e')](_0x30bb12['query'],_0x104a56[_0x26ff('0x46')]));if(_0x30bb12[_0x26ff('0x45')][_0x26ff('0x4f')]){_0x2be72a[_0x26ff('0x50')]=_[_0x26ff('0x51')](_0x2be72a[_0x26ff('0x50')],{'$or':_[_0x26ff('0x41')](_0x2be72a[_0x26ff('0x49')],function(_0x2476fe){var _0x3bd13e={};_0x3bd13e[_0x2476fe]={'$like':'%'+_0x30bb12[_0x26ff('0x45')]['filter']+'%'};return _0x3bd13e;})});}_0x2be72a=_['merge']({},_0x2be72a,_0x30bb12['options']);return _0x57f006[_0x26ff('0x81')](_0x2be72a);}})[_0x26ff('0x20')](function(_0x220657){if(_0x220657){_0x2b1a26=_0x220657[_0x26ff('0x6b')];if(!_0x30bb12[_0x26ff('0x45')][_0x26ff('0x4a')](_0x26ff('0x4b'))){_0x2be72a[_0x26ff('0x30')]=qs[_0x26ff('0x30')](_0x30bb12[_0x26ff('0x45')][_0x26ff('0x30')]);_0x2be72a['offset']=qs[_0x26ff('0x2e')](_0x30bb12[_0x26ff('0x45')][_0x26ff('0x2e')]);}return _0x57f006[_0x26ff('0x81')](_0x2be72a);}})['then'](function(_0x4cf957){if(_0x4cf957){return _0x4cf957?{'count':_0x2b1a26,'rows':_0x4cf957}:null;}})['then'](respondWithResult(_0x431c99,null))[_0x26ff('0x57')](handleError(_0x431c99,null));};exports[_0x26ff('0x82')]=function(_0x1a59e2,_0x206907,_0xfd3214){var _0x2974a3={'channel':'whatsapp'};var _0xdda614=[];var _0x3613e1=[];var _0x2cecd1={};return db['WhatsappAccount'][_0x26ff('0x5c')]({'where':{'id':_0x1a59e2[_0x26ff('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x26ff('0x83')}]})[_0x26ff('0x20')](handleEntityNotFound(_0x206907,null))[_0x26ff('0x20')](function(_0x15581a){_0x2974a3[_0x26ff('0x84')]=_0x15581a;_0x2974a3[_0x26ff('0x85')]=_[_0x26ff('0x86')](_0x15581a[_0x26ff('0x83')],[_0x26ff('0x80')],[_0x26ff('0x87')]);if(_0x2974a3[_0x26ff('0x84')][_0x26ff('0x83')]){delete _0x2974a3['account'][_0x26ff('0x83')];}return db[_0x26ff('0x88')][_0x26ff('0x66')]();})[_0x26ff('0x20')](function(_0x37b278){if(!_0x37b278){throw new db['Sequelize'][(_0x26ff('0x89'))](_0x26ff('0x8a'));}_0xdda614=_['difference'](_['keys'](_0x37b278),[_0x26ff('0x8b'),_0x26ff('0x8c')]);_0x3613e1=_['difference'](_[_0x26ff('0x44')](_0x37b278),[_0x26ff('0x8b'),_0x26ff('0x8c'),_0x26ff('0x8d'),_0x26ff('0x8e')]);_0x2974a3[_0x26ff('0x5e')]={'mapKey':_0x26ff('0x8f')};if(_0x2974a3[_0x26ff('0x84')][_0x26ff('0x90')]&&_0x2974a3[_0x26ff('0x84')]['type']===_0x26ff('0x91')){_0x2974a3[_0x26ff('0x5e')]['from']=_0x1a59e2[_0x26ff('0x5e')][_0x26ff('0x92')][_0x26ff('0x93')](_0x26ff('0x94'),'');_0x2974a3['body'][_0x26ff('0x5e')]=_0x1a59e2['body'][_0x26ff('0x95')];_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x96')]=_0x1a59e2[_0x26ff('0x5e')][_0x26ff('0x97')];}if(_0x2974a3['body']['id']){delete _0x2974a3[_0x26ff('0x5e')]['id'];}if(_[_0x26ff('0x98')](_0x2974a3[_0x26ff('0x5e')]['from'])){throw new db[(_0x26ff('0x99'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x26ff('0x98')](_0x2974a3[_0x26ff('0x5e')]['body'])||_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x5e')]===''){throw new db[(_0x26ff('0x99'))]['ValidationError'](_0x26ff('0x9a'));}if(_[_0x26ff('0x98')](_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9b')])){throw new db[(_0x26ff('0x99'))][(_0x26ff('0x89'))](_0x26ff('0x9c')+_0x3613e1);}if(!_['includes'](_0x3613e1,_0x2974a3[_0x26ff('0x5e')]['mapKey'])){throw new db[(_0x26ff('0x99'))][(_0x26ff('0x89'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3613e1);}_0x2cecd1[_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9b')]]=_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9d')];return db['CmList'][_0x26ff('0x5c')]({'where':{'id':_0x2974a3[_0x26ff('0x84')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x26ff('0x9e'),'where':_0x2cecd1,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x26ff('0x20')](handleEntityNotFound(_0x206907,null))[_0x26ff('0x20')](function(_0x2e0a26){if(_0x2e0a26){_0x2974a3['list']=_[_0x26ff('0x74')](_0x2e0a26,[_0x26ff('0x9e')]);if(_0x2e0a26['Contacts'][_0x26ff('0x6b')]){return _0x2e0a26[_0x26ff('0x9e')][0x0];}var _0x53679c=_[_0x26ff('0x9f')](_0x2974a3[_0x26ff('0x5e')],{'firstName':_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9d')],'ListId':_0x2e0a26['id']});_0x53679c[_0x2974a3['body'][_0x26ff('0x9b')]]=_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9d')];return db['CmContact']['create'](_0x53679c,{'fields':_0xdda614,'raw':!![]});}})[_0x26ff('0x20')](handleEntityNotFound(_0x206907,null))[_0x26ff('0x20')](function(_0x1e1be9){if(_0x1e1be9){_0x2974a3[_0x26ff('0xa0')]=_0x1e1be9;var _0x457b20={'ContactId':_0x1e1be9['id'],'phone':_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9d')],'WhatsappAccountId':_0x1a59e2['params']['id']};var _0x4a268d={'ContactId':_0x1e1be9['id'],'WhatsappAccountId':_0x1a59e2['params']['id'],'closed':![]};return db[_0x26ff('0xa1')][_0x26ff('0x5c')]({'where':_0x4a268d})[_0x26ff('0x20')](function(_0x250b6f){if(_0x250b6f){return[_0x250b6f,![]];}return db[_0x26ff('0xa1')][_0x26ff('0x5d')](_0x457b20)['then'](function(_0x4973d5){return[_0x4973d5,!![]];});});}})[_0x26ff('0x75')](function(_0x35489f,_0x43ad98){_0x2974a3[_0x26ff('0xa2')]=_0x35489f[_0x26ff('0x39')]({'plain':!![]});_0x2974a3[_0x26ff('0xa2')][_0x26ff('0xa3')]=![];if(_0x43ad98){if(_0x2974a3['account'][_0x26ff('0xa4')]){_0x2974a3[_0x26ff('0x85')]['push']({'id':0x0,'priority':_0x2974a3[_0x26ff('0x85')][_0x26ff('0x6b')]+0x1,'app':_0x26ff('0xa5'),'appdata':_0x26ff('0xa6'),'interval':'*,*,*,*'});}_0x2974a3[_0x26ff('0xa2')][_0x26ff('0xa3')]=!![];}return db[_0x26ff('0xa7')]['create']({'phone':_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x9d')],'messageId':_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x96')],'body':_0x2974a3[_0x26ff('0x5e')][_0x26ff('0x5e')],'WhatsappAccountId':_0x1a59e2[_0x26ff('0x58')]['id'],'WhatsappInteractionId':_0x35489f['id'],'direction':'in','ContactId':_0x35489f[_0x26ff('0xa8')],'AttachmentId':_0x2974a3[_0x26ff('0x5e')][_0x26ff('0xa9')]});})[_0x26ff('0x20')](function(_0x4f68b2){_0x2974a3[_0x26ff('0x29')]=_0x4f68b2;if(_0x2974a3[_0x26ff('0xa2')][_0x26ff('0xaa')]){return db[_0x26ff('0x7a')]['find']({'attributes':['id',_0x26ff('0x3d')],'where':{'id':_0x2974a3[_0x26ff('0xa2')][_0x26ff('0xaa')]}})[_0x26ff('0x20')](function(_0x967996){if(_0x967996){_0x2974a3[_0x26ff('0x85')][_0x26ff('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x967996[_0x26ff('0x3d')]+','+(_0x2974a3[_0x26ff('0x84')][_0x26ff('0xac')]||0xa),'interval':_0x26ff('0xad')});}return respondWithRpcPromise('Start',_0x26ff('0xae'),_0x2974a3);});}return respondWithRpcPromise(_0x26ff('0xaf'),'startRouting',_0x2974a3);})[_0x26ff('0x20')](function(_0x361999){if(_0x361999){var _0x2998f8=0xc8;var _0x52d933=_0x26ff('0xb0');logger[_0x26ff('0x21')](_0x26ff('0x25'),_0x52d933,_0x2998f8,_0x26ff('0xb1'));logger[_0x26ff('0x24')](_0x26ff('0xb2'),_0x52d933,_0x2998f8,_0x26ff('0xb1'),JSON[_0x26ff('0x26')](_0x361999));if(_0x2974a3['account'][_0x26ff('0x90')]==='twilio'){return _0x206907[_0x26ff('0x2c')](_0x2998f8)[_0x26ff('0x32')]('Content-Type',_0x26ff('0xb3'))[_0x26ff('0x3e')](_0x26ff('0xb4'));}else{return _0x206907[_0x26ff('0x2c')](_0x2998f8)['json'](_0x361999);}}})['catch'](handleError(_0x206907,null));};exports[_0x26ff('0x3e')]=function(_0x203dc9,_0x52e848,_0x4d0afb){var _0x31473d,_0x587666,_0x2620b0;if(_[_0x26ff('0x98')](_0x203dc9[_0x26ff('0x5e')]['body'])||_0x203dc9['body']['body']===''){throw new db[(_0x26ff('0x99'))][(_0x26ff('0x89'))](_0x26ff('0x9a'));}if(_[_0x26ff('0x98')](_0x203dc9[_0x26ff('0x5e')]['to'])){throw new db['Sequelize'][(_0x26ff('0x89'))]('to\x20is\x20mandatory');}_0x31473d=_0x203dc9[_0x26ff('0x5e')]['to'];return db[_0x26ff('0x42')][_0x26ff('0x5c')]({'where':{'id':_0x203dc9[_0x26ff('0x58')]['id']},'include':[{'model':db[_0x26ff('0xb5')],'as':_0x26ff('0xb6'),'include':[{'model':db[_0x26ff('0x88')],'as':'Contacts','where':{'mobile':_0x31473d},'limit':0x1,'order':[[_0x26ff('0x8c'),_0x26ff('0xb7')]]}]}]})[_0x26ff('0x20')](handleEntityNotFound(_0x52e848,null))[_0x26ff('0x20')](function(_0x2b87f){if(_0x2b87f&&_0x2b87f['List']){_0x587666=_0x2b87f[_0x26ff('0x39')]({'plain':!![]});if(_0x587666[_0x26ff('0xb6')]&&_0x587666[_0x26ff('0xb6')][_0x26ff('0x9e')]['length']){return _0x587666['List'][_0x26ff('0x9e')][0x0];}return db[_0x26ff('0x88')][_0x26ff('0x5d')](_[_0x26ff('0x9f')](_0x203dc9['body'],{'firstName':_0x31473d,'mobile':_0x31473d,'phone':_0x31473d,'ListId':_0x587666[_0x26ff('0x8e')]}));}})[_0x26ff('0x20')](handleEntityNotFound(_0x52e848,null))['then'](function(_0x4217a3){if(_0x4217a3){_0x2620b0=_0x4217a3;return db[_0x26ff('0xa1')]['find']({'where':{'ContactId':_0x2620b0['id'],'closed':![],'WhatsappAccountId':_0x587666['id']}})[_0x26ff('0x20')](function(_0xf3621b){if(_0xf3621b){return[_0xf3621b,![]];}return db[_0x26ff('0xa1')][_0x26ff('0x5d')]({'UserId':_0x203dc9['user']['id'],'ContactId':_0x2620b0['id'],'WhatsappAccountId':_0x587666['id'],'phone':_0x31473d,'firstMsgDirection':_0x26ff('0xb8'),'Messages':[_[_0x26ff('0x51')](_0x203dc9[_0x26ff('0x5e')],{'read':![],'body':_0x203dc9[_0x26ff('0x5e')][_0x26ff('0x5e')],'phone':_0x31473d,'WhatsappAccountId':_0x587666['id'],'UserId':_0x203dc9['user']['id'],'ContactId':_0x2620b0['id']})]},{'include':[{'model':db[_0x26ff('0xa7')],'as':'Messages'}]})['then'](function(_0x4db88a){return[_0x4db88a,!![]];});});}})['spread'](function(_0x1761c9,_0x5dce8b){if(_0x5dce8b){return _0x1761c9;}return db['WhatsappMessage']['create'](_[_0x26ff('0x51')](_0x203dc9[_0x26ff('0x5e')],{'read':![],'body':_0x203dc9[_0x26ff('0x5e')]['body'],'phone':_0x31473d,'WhatsappAccountId':_0x587666['id'],'WhatsappInteractionId':_0x1761c9['id'],'UserId':_0x203dc9[_0x26ff('0x5f')]['id'],'ContactId':_0x2620b0['id']}))[_0x26ff('0x20')](function(_0x3d19c0){_0x1761c9[_0x26ff('0xb9')][_0x26ff('0xba')]=[];_0x1761c9[_0x26ff('0xb9')]['Messages'][_0x26ff('0xbb')](_0x3d19c0[_0x26ff('0xb9')]);return _0x1761c9;});})[_0x26ff('0x20')](respondWithResult(_0x52e848,null))['catch'](handleError(_0x52e848,null));};
\ No newline at end of file
index d6b2f6b..a7950de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06b2=['remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x3faf77,_0x3a81d6){var _0x307c43=function(_0x1f4ae2){while(--_0x1f4ae2){_0x3faf77['push'](_0x3faf77['shift']());}};_0x307c43(++_0x3a81d6);}(_0x06b2,0xe4));var _0x206b=function(_0x5dd611,_0x1c959e){_0x5dd611=_0x5dd611-0x0;var _0x1ebeca=_0x06b2[_0x5dd611];return _0x1ebeca;};'use strict';var EventEmitter=require(_0x206b('0x0'));var WhatsappAccount=require(_0x206b('0x1'))['db'][_0x206b('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x206b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x206b('0x4')};function emitEvent(_0x3b08d7){return function(_0x598998,_0x4aa91f,_0x28606e){WhatsappAccountEvents[_0x206b('0x5')](_0x3b08d7+':'+_0x598998['id'],_0x598998);WhatsappAccountEvents[_0x206b('0x5')](_0x3b08d7,_0x598998);_0x28606e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x206b('0x6')](e,emitEvent(event));}}module[_0x206b('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x69cb=['emit','hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','remove'];(function(_0x5819fb,_0x47943a){var _0x79c3c1=function(_0x3d9d11){while(--_0x3d9d11){_0x5819fb['push'](_0x5819fb['shift']());}};_0x79c3c1(++_0x47943a);}(_0x69cb,0x183));var _0xb69c=function(_0x105a8e,_0x12dd9a){_0x105a8e=_0x105a8e-0x0;var _0x298729=_0x69cb[_0x105a8e];return _0x298729;};'use strict';var EventEmitter=require(_0xb69c('0x0'));var WhatsappAccount=require(_0xb69c('0x1'))['db'][_0xb69c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb69c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb69c('0x4')};function emitEvent(_0x55b2bb){return function(_0x18f6e0,_0x526bcd,_0x297f55){WhatsappAccountEvents[_0xb69c('0x5')](_0x55b2bb+':'+_0x18f6e0['id'],_0x18f6e0);WhatsappAccountEvents['emit'](_0x55b2bb,_0x18f6e0);_0x297f55(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xb69c('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
index 709cb02..0fe31b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bc9=['../../config/logger','bluebird','path','rimraf','../../config/environment','whatsapp_accounts','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1bc9,0xe6));var _0x91bc=function(_0x224c45,_0x16fa17){_0x224c45=_0x224c45-0x0;var _0x31dedd=_0x1bc9[_0x224c45];return _0x31dedd;};'use strict';var _=require('lodash');var util=require(_0x91bc('0x0'));var logger=require(_0x91bc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x91bc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91bc('0x3'));var rimraf=require(_0x91bc('0x4'));var config=require(_0x91bc('0x5'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x2e77f2,_0x193a03){return _0x2e77f2['define']('WhatsappAccount',attributes,{'tableName':_0x91bc('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b15=['exports','WhatsappAccount','whatsapp_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7b15,0xf5));var _0x57b1=function(_0x5c5673,_0x1d67c0){_0x5c5673=_0x5c5673-0x0;var _0x482dce=_0x7b15[_0x5c5673];return _0x482dce;};'use strict';var _=require(_0x57b1('0x0'));var util=require(_0x57b1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x57b1('0x2'));var rp=require(_0x57b1('0x3'));var fs=require('fs');var path=require(_0x57b1('0x4'));var rimraf=require(_0x57b1('0x5'));var config=require(_0x57b1('0x6'));var attributes=require(_0x57b1('0x7'));module[_0x57b1('0x8')]=function(_0x235b48,_0xc6b519){return _0x235b48['define'](_0x57b1('0x9'),attributes,{'tableName':_0x57b1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f945a5..b377c26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4f8=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','request\x20sent','debug','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','result','catch','options','raw','attributes','map','include','model','then','ShowWhatsappAccount','util','moment','bluebird','randomstring','ioredis'];(function(_0x55db25,_0x21f288){var _0x778834=function(_0x30c026){while(--_0x30c026){_0x55db25['push'](_0x55db25['shift']());}};_0x778834(++_0x21f288);}(_0xb4f8,0x83));var _0x8b4f=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xb4f8[_0x4b7895];return _0x264180;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var moment=require(_0x8b4f('0x1'));var BPromise=require(_0x8b4f('0x2'));var rs=require(_0x8b4f('0x3'));var fs=require('fs');var Redis=require(_0x8b4f('0x4'));var db=require(_0x8b4f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b4f('0x6'))('rpc');var config=require(_0x8b4f('0x7'));var jayson=require(_0x8b4f('0x8'));var client=jayson[_0x8b4f('0x9')][_0x8b4f('0xa')]({'port':0x232a});config[_0x8b4f('0xb')]=_['defaults'](config[_0x8b4f('0xb')],{'host':_0x8b4f('0xc'),'port':0x18eb});var socket=require(_0x8b4f('0xd'))(new Redis(config['redis']));require(_0x8b4f('0xe'))[_0x8b4f('0xf')](socket);function respondWithRpcPromise(_0x1132ce,_0x358cf2,_0x26b169){return new BPromise(function(_0x499db2,_0x328cd1){return client[_0x8b4f('0x10')](_0x1132ce,_0x26b169)['then'](function(_0xe5652d){logger[_0x8b4f('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x358cf2,_0x8b4f('0x12'));logger[_0x8b4f('0x13')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x358cf2,_0x8b4f('0x12'),JSON[_0x8b4f('0x14')](_0xe5652d));if(_0xe5652d[_0x8b4f('0x15')]){if(_0xe5652d[_0x8b4f('0x15')]['code']===0x1f4){logger[_0x8b4f('0x15')](_0x8b4f('0x16'),_0x358cf2,_0xe5652d[_0x8b4f('0x15')][_0x8b4f('0x17')]);return _0x328cd1(_0xe5652d[_0x8b4f('0x15')][_0x8b4f('0x17')]);}logger['error'](_0x8b4f('0x16'),_0x358cf2,_0xe5652d[_0x8b4f('0x15')][_0x8b4f('0x17')]);return _0x499db2(_0xe5652d[_0x8b4f('0x15')][_0x8b4f('0x17')]);}else{logger[_0x8b4f('0x11')](_0x8b4f('0x16'),_0x358cf2,'request\x20sent');_0x499db2(_0xe5652d[_0x8b4f('0x18')][_0x8b4f('0x17')]);}})[_0x8b4f('0x19')](function(_0x15a219){logger['error'](_0x8b4f('0x16'),_0x358cf2,_0x15a219);_0x328cd1(_0x15a219);});});}exports['ShowWhatsappAccount']=function(_0x39c8d4){var _0x3eb2b0=this;return new Promise(function(_0x5dda4c,_0x3bd3e1){return db['WhatsappAccount']['find']({'raw':_0x39c8d4['options']?_0x39c8d4[_0x8b4f('0x1a')][_0x8b4f('0x1b')]===undefined?!![]:![]:!![],'where':_0x39c8d4[_0x8b4f('0x1a')]?_0x39c8d4[_0x8b4f('0x1a')]['where']||null:null,'attributes':_0x39c8d4[_0x8b4f('0x1a')]?_0x39c8d4[_0x8b4f('0x1a')][_0x8b4f('0x1c')]||null:null,'include':_0x39c8d4[_0x8b4f('0x1a')]?_0x39c8d4[_0x8b4f('0x1a')]['include']?_[_0x8b4f('0x1d')](_0x39c8d4[_0x8b4f('0x1a')][_0x8b4f('0x1e')],function(_0x1ae110){return{'model':db[_0x1ae110['model']],'as':_0x1ae110['as'],'attributes':_0x1ae110[_0x8b4f('0x1c')],'include':_0x1ae110['include']?_['map'](_0x1ae110['include'],function(_0x559867){return{'model':db[_0x559867['model']],'as':_0x559867['as'],'attributes':_0x559867['attributes'],'include':_0x559867['include']?_[_0x8b4f('0x1d')](_0x559867[_0x8b4f('0x1e')],function(_0x5a1226){return{'model':db[_0x5a1226[_0x8b4f('0x1f')]],'as':_0x5a1226['as'],'attributes':_0x5a1226[_0x8b4f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8b4f('0x20')](function(_0x450824){logger[_0x8b4f('0x11')](_0x8b4f('0x21'),_0x39c8d4);logger[_0x8b4f('0x13')](_0x8b4f('0x21'),_0x39c8d4,JSON[_0x8b4f('0x14')](_0x450824));_0x5dda4c(_0x450824);})[_0x8b4f('0x19')](function(_0x2b9981){logger['error'](_0x8b4f('0x21'),_0x2b9981['message'],_0x39c8d4);_0x3bd3e1(_0x3eb2b0['error'](0x1f4,_0x2b9981[_0x8b4f('0x17')]));});});};
\ No newline at end of file
+var _0x9d66=['find','options','raw','include','map','model','attributes','then','ShowWhatsappAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','WhatsappAccount,\x20%s,\x20%s','catch','WhatsappAccount'];(function(_0x60fb77,_0x207152){var _0x29bba5=function(_0x23516a){while(--_0x23516a){_0x60fb77['push'](_0x60fb77['shift']());}};_0x29bba5(++_0x207152);}(_0x9d66,0x106));var _0x69d6=function(_0x9a7940,_0x483207){_0x9a7940=_0x9a7940-0x0;var _0x431f65=_0x9d66[_0x9a7940];return _0x431f65;};'use strict';var _=require(_0x69d6('0x0'));var util=require(_0x69d6('0x1'));var moment=require(_0x69d6('0x2'));var BPromise=require(_0x69d6('0x3'));var rs=require(_0x69d6('0x4'));var fs=require('fs');var Redis=require(_0x69d6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x69d6('0x6'));var logger=require(_0x69d6('0x7'))(_0x69d6('0x8'));var config=require('../../config/environment');var jayson=require(_0x69d6('0x9'));var client=jayson[_0x69d6('0xa')]['http']({'port':0x232a});config[_0x69d6('0xb')]=_['defaults'](config[_0x69d6('0xb')],{'host':_0x69d6('0xc'),'port':0x18eb});var socket=require(_0x69d6('0xd'))(new Redis(config[_0x69d6('0xb')]));require(_0x69d6('0xe'))[_0x69d6('0xf')](socket);function respondWithRpcPromise(_0x15f65f,_0x39d231,_0x2bb798){return new BPromise(function(_0x526286,_0x1ae278){return client['request'](_0x15f65f,_0x2bb798)['then'](function(_0x1dd467){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x39d231,_0x69d6('0x10'));logger[_0x69d6('0x11')](_0x69d6('0x12'),_0x39d231,'request\x20sent',JSON['stringify'](_0x1dd467));if(_0x1dd467[_0x69d6('0x13')]){if(_0x1dd467[_0x69d6('0x13')][_0x69d6('0x14')]===0x1f4){logger[_0x69d6('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x39d231,_0x1dd467[_0x69d6('0x13')][_0x69d6('0x15')]);return _0x1ae278(_0x1dd467[_0x69d6('0x13')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x39d231,_0x1dd467[_0x69d6('0x13')][_0x69d6('0x15')]);return _0x526286(_0x1dd467[_0x69d6('0x13')][_0x69d6('0x15')]);}else{logger[_0x69d6('0x16')](_0x69d6('0x17'),_0x39d231,'request\x20sent');_0x526286(_0x1dd467['result'][_0x69d6('0x15')]);}})[_0x69d6('0x18')](function(_0x481605){logger[_0x69d6('0x13')](_0x69d6('0x17'),_0x39d231,_0x481605);_0x1ae278(_0x481605);});});}exports['ShowWhatsappAccount']=function(_0x1f9f61){var _0x302e77=this;return new Promise(function(_0x5819d4,_0x4d4e55){return db[_0x69d6('0x19')][_0x69d6('0x1a')]({'raw':_0x1f9f61[_0x69d6('0x1b')]?_0x1f9f61[_0x69d6('0x1b')][_0x69d6('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f9f61[_0x69d6('0x1b')]?_0x1f9f61[_0x69d6('0x1b')]['where']||null:null,'attributes':_0x1f9f61[_0x69d6('0x1b')]?_0x1f9f61[_0x69d6('0x1b')]['attributes']||null:null,'include':_0x1f9f61[_0x69d6('0x1b')]?_0x1f9f61[_0x69d6('0x1b')][_0x69d6('0x1d')]?_[_0x69d6('0x1e')](_0x1f9f61[_0x69d6('0x1b')]['include'],function(_0x15c7f7){return{'model':db[_0x15c7f7[_0x69d6('0x1f')]],'as':_0x15c7f7['as'],'attributes':_0x15c7f7['attributes'],'include':_0x15c7f7['include']?_[_0x69d6('0x1e')](_0x15c7f7[_0x69d6('0x1d')],function(_0x39c89a){return{'model':db[_0x39c89a['model']],'as':_0x39c89a['as'],'attributes':_0x39c89a[_0x69d6('0x20')],'include':_0x39c89a['include']?_[_0x69d6('0x1e')](_0x39c89a[_0x69d6('0x1d')],function(_0x357b43){return{'model':db[_0x357b43[_0x69d6('0x1f')]],'as':_0x357b43['as'],'attributes':_0x357b43[_0x69d6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x69d6('0x21')](function(_0x525339){logger[_0x69d6('0x16')]('ShowWhatsappAccount',_0x1f9f61);logger[_0x69d6('0x11')](_0x69d6('0x22'),_0x1f9f61,JSON[_0x69d6('0x23')](_0x525339));_0x5819d4(_0x525339);})[_0x69d6('0x18')](function(_0x380b1c){logger[_0x69d6('0x13')]('ShowWhatsappAccount',_0x380b1c['message'],_0x1f9f61);_0x4d4e55(_0x302e77[_0x69d6('0x13')](0x1f4,_0x380b1c[_0x69d6('0x15')]));});});};
\ No newline at end of file
index 5637193..f8a5368 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64a1=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0x70b7da,_0x349155){var _0x1839cd=function(_0x4dd333){while(--_0x4dd333){_0x70b7da['push'](_0x70b7da['shift']());}};_0x1839cd(++_0x349155);}(_0x64a1,0x89));var _0x164a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x64a1[_0x32f7d7];return _0x133d09;};'use strict';var WhatsappAccountEvents=require(_0x164a('0x0'));var events=[_0x164a('0x1'),_0x164a('0x2'),'update'];function createListener(_0x2fe71b,_0x1a9597){return function(_0x392382){_0x1a9597['emit'](_0x2fe71b,_0x392382);};}function removeListener(_0x1d60fc,_0x5711da){return function(){WhatsappAccountEvents[_0x164a('0x3')](_0x1d60fc,_0x5711da);};}exports[_0x164a('0x4')]=function(_0x56f99b){for(var _0x2ccaae=0x0,_0x4cde38=events[_0x164a('0x5')];_0x2ccaae<_0x4cde38;_0x2ccaae++){var _0x55cc2f=events[_0x2ccaae];var _0x3df641=createListener(_0x164a('0x6')+_0x55cc2f,_0x56f99b);WhatsappAccountEvents['on'](_0x55cc2f,_0x3df641);}};
\ No newline at end of file
+var _0x8705=['save','emit','register','whatsappAccount:','./whatsappAccount.events'];(function(_0x5aa76c,_0x642ac2){var _0xed7a54=function(_0x136ec9){while(--_0x136ec9){_0x5aa76c['push'](_0x5aa76c['shift']());}};_0xed7a54(++_0x642ac2);}(_0x8705,0x1d0));var _0x5870=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8705[_0x2641f9];return _0x585741;};'use strict';var WhatsappAccountEvents=require(_0x5870('0x0'));var events=[_0x5870('0x1'),'remove','update'];function createListener(_0x326bf8,_0x259966){return function(_0x947b8d){_0x259966[_0x5870('0x2')](_0x326bf8,_0x947b8d);};}function removeListener(_0x555fb1,_0x2e27da){return function(){WhatsappAccountEvents['removeListener'](_0x555fb1,_0x2e27da);};}exports[_0x5870('0x3')]=function(_0x8127a){for(var _0x24f18c=0x0,_0x1b145e=events['length'];_0x24f18c<_0x1b145e;_0x24f18c++){var _0x4fd5de=events[_0x24f18c];var _0x28b956=createListener(_0x5870('0x4')+_0x4fd5de,_0x8127a);WhatsappAccountEvents['on'](_0x4fd5de,_0x28b956);}};
\ No newline at end of file
index 05245fc..f8968cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1eb=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update','delete','exports','multer','util'];(function(_0x36a970,_0x3c9f51){var _0x1c1708=function(_0x1e7cd5){while(--_0x1e7cd5){_0x36a970['push'](_0x36a970['shift']());}};_0x1c1708(++_0x3c9f51);}(_0xb1eb,0x1eb));var _0xbb1e=function(_0x5b1fb7,_0x2e0fb2){_0x5b1fb7=_0x5b1fb7-0x0;var _0x494b20=_0xb1eb[_0x5b1fb7];return _0x494b20;};'use strict';var multer=require(_0xbb1e('0x0'));var util=require(_0xbb1e('0x1'));var path=require(_0xbb1e('0x2'));var timeout=require(_0xbb1e('0x3'));var express=require(_0xbb1e('0x4'));var router=express['Router']();var fs_extra=require(_0xbb1e('0x5'));var auth=require(_0xbb1e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb1e('0x7'));var controller=require('./whatsappApplication.controller');router[_0xbb1e('0x8')]('/',auth[_0xbb1e('0x9')](),controller[_0xbb1e('0xa')]);router[_0xbb1e('0x8')](_0xbb1e('0xb'),auth[_0xbb1e('0x9')](),controller[_0xbb1e('0xc')]);router[_0xbb1e('0xd')]('/',auth[_0xbb1e('0x9')](),controller['create']);router['put'](_0xbb1e('0xb'),auth[_0xbb1e('0x9')](),controller[_0xbb1e('0xe')]);router[_0xbb1e('0xf')](_0xbb1e('0xb'),auth[_0xbb1e('0x9')](),controller['destroy']);module[_0xbb1e('0x10')]=router;
\ No newline at end of file
+var _0x19f7=['index','/:id','show','post','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappApplication.controller','isAuthenticated'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x19f7,0xa6));var _0x719f=function(_0x2e197d,_0x68d43d){_0x2e197d=_0x2e197d-0x0;var _0x1d7d1c=_0x19f7[_0x2e197d];return _0x1d7d1c;};'use strict';var multer=require(_0x719f('0x0'));var util=require(_0x719f('0x1'));var path=require(_0x719f('0x2'));var timeout=require(_0x719f('0x3'));var express=require(_0x719f('0x4'));var router=express[_0x719f('0x5')]();var fs_extra=require(_0x719f('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x719f('0x7'));var controller=require(_0x719f('0x8'));router['get']('/',auth[_0x719f('0x9')](),controller[_0x719f('0xa')]);router['get'](_0x719f('0xb'),auth[_0x719f('0x9')](),controller[_0x719f('0xc')]);router[_0x719f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x719f('0xb'),auth[_0x719f('0x9')](),controller['update']);router[_0x719f('0xe')]('/:id',auth[_0x719f('0x9')](),controller[_0x719f('0xf')]);module['exports']=router;
\ No newline at end of file
index 15f9e39..8f45d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28c2=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x28c2,0x111));var _0x228c=function(_0xefdc91,_0x4c1eec){_0xefdc91=_0xefdc91-0x0;var _0x2b4f18=_0x28c2[_0xefdc91];return _0x2b4f18;};'use strict';var Sequelize=require(_0x228c('0x0'));module[_0x228c('0x1')]={'priority':{'type':Sequelize[_0x228c('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x228c('0x3')},'appdata':{'type':Sequelize[_0x228c('0x4')]()},'description':{'type':Sequelize[_0x228c('0x5')]},'interval':{'type':Sequelize[_0x228c('0x5')],'defaultValue':_0x228c('0x6')}};
\ No newline at end of file
+var _0x562f=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x5ba107,_0x475f5e){var _0x3530ec=function(_0x32fa14){while(--_0x32fa14){_0x5ba107['push'](_0x5ba107['shift']());}};_0x3530ec(++_0x475f5e);}(_0x562f,0x10b));var _0xf562=function(_0x3d7fb5,_0x16eb5c){_0x3d7fb5=_0x3d7fb5-0x0;var _0x3a9642=_0x562f[_0x3d7fb5];return _0x3a9642;};'use strict';var Sequelize=require(_0xf562('0x0'));module[_0xf562('0x1')]={'priority':{'type':Sequelize[_0xf562('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf562('0x3')],'allowNull':![],'defaultValue':_0xf562('0x4')},'appdata':{'type':Sequelize[_0xf562('0x5')]()},'description':{'type':Sequelize[_0xf562('0x3')]},'interval':{'type':Sequelize[_0xf562('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 95276e9..03a9a9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32b6=['sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','catch','create','body','find','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','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x32b6,0x1d1));var _0x632b=function(_0x3285df,_0x22518d){_0x3285df=_0x3285df-0x0;var _0x1e67f9=_0x32b6[_0x3285df];return _0x1e67f9;};'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'];function respondWithStatusCode(_0xe81378,_0x3d8bed){_0x3d8bed=_0x3d8bed||0xcc;return function(_0x22c182){if(_0x22c182){return _0xe81378['sendStatus'](_0x3d8bed);}return _0xe81378[_0x632b('0x18')](_0x3d8bed)[_0x632b('0x19')]();};}function respondWithResult(_0x9246a6,_0x5a97da){_0x5a97da=_0x5a97da||0xc8;return function(_0x721883){if(_0x721883){return _0x9246a6[_0x632b('0x18')](_0x5a97da)[_0x632b('0x1a')](_0x721883);}};}function respondWithFilteredResult(_0x17ff9b,_0x40d410){return function(_0x21cdd3){if(_0x21cdd3){var _0x4efe39=typeof _0x40d410[_0x632b('0x1b')]==='undefined'&&typeof _0x40d410['limit']===_0x632b('0x1c');var _0x5afa1e=_0x21cdd3[_0x632b('0x1d')];var _0x3bb27f=_0x4efe39?0x0:_0x40d410[_0x632b('0x1b')];var _0x51c894=_0x4efe39?_0x21cdd3[_0x632b('0x1d')]:_0x40d410[_0x632b('0x1b')]+_0x40d410[_0x632b('0x1e')];var _0x3683e4;if(_0x51c894>=_0x5afa1e){_0x51c894=_0x5afa1e;_0x3683e4=0xc8;}else{_0x3683e4=0xce;}_0x17ff9b['status'](_0x3683e4);return _0x17ff9b[_0x632b('0x1f')](_0x632b('0x20'),_0x3bb27f+'-'+_0x51c894+'/'+_0x5afa1e)['json'](_0x21cdd3);}return null;};}function patchUpdates(_0x116f62){return function(_0x50b930){try{jsonpatch['apply'](_0x50b930,_0x116f62,!![]);}catch(_0x1b1092){return BPromise['reject'](_0x1b1092);}return _0x50b930[_0x632b('0x21')]();};}function saveUpdates(_0x1c4530,_0x2a6833){return function(_0x540bfb){if(_0x540bfb){return _0x540bfb[_0x632b('0x22')](_0x1c4530)[_0x632b('0x23')](function(_0x59d83a){return _0x59d83a;});}return null;};}function removeEntity(_0x1db8f5,_0x379dc2){return function(_0x30ffb9){if(_0x30ffb9){return _0x30ffb9[_0x632b('0x24')]()[_0x632b('0x23')](function(){_0x1db8f5[_0x632b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e7b20,_0x11fe61){return function(_0x4d3a70){if(!_0x4d3a70){_0x5e7b20[_0x632b('0x25')](0x194);}return _0x4d3a70;};}function handleError(_0x954fa0,_0x5d6855){_0x5d6855=_0x5d6855||0x1f4;return function(_0x273e89){logger[_0x632b('0x26')](_0x273e89[_0x632b('0x27')]);if(_0x273e89[_0x632b('0x28')]){delete _0x273e89[_0x632b('0x28')];}_0x954fa0[_0x632b('0x18')](_0x5d6855)[_0x632b('0x29')](_0x273e89);};}exports[_0x632b('0x2a')]=function(_0x33a625,_0x4f8410){var _0x1bb484={},_0x35348e={},_0x1819fa={'count':0x0,'rows':[]};var _0x3999aa=_[_0x632b('0x2b')](db[_0x632b('0x2c')][_0x632b('0x2d')],function(_0x417d62){return{'name':_0x417d62[_0x632b('0x2e')],'type':_0x417d62[_0x632b('0x2f')][_0x632b('0x30')]};});_0x35348e[_0x632b('0x31')]=_[_0x632b('0x2b')](_0x3999aa,_0x632b('0x28'));_0x35348e[_0x632b('0x32')]=_[_0x632b('0x33')](_0x33a625[_0x632b('0x32')]);_0x35348e[_0x632b('0x34')]=_[_0x632b('0x35')](_0x35348e[_0x632b('0x31')],_0x35348e['query']);_0x1bb484[_0x632b('0x36')]=_[_0x632b('0x35')](_0x35348e[_0x632b('0x31')],qs[_0x632b('0x37')](_0x33a625['query'][_0x632b('0x37')]));_0x1bb484['attributes']=_0x1bb484[_0x632b('0x36')][_0x632b('0x38')]?_0x1bb484['attributes']:_0x35348e[_0x632b('0x31')];if(!_0x33a625[_0x632b('0x32')][_0x632b('0x39')](_0x632b('0x3a'))){_0x1bb484[_0x632b('0x1e')]=qs[_0x632b('0x1e')](_0x33a625[_0x632b('0x32')][_0x632b('0x1e')]);_0x1bb484['offset']=qs['offset'](_0x33a625[_0x632b('0x32')][_0x632b('0x1b')]);}_0x1bb484[_0x632b('0x3b')]=qs[_0x632b('0x3c')](_0x33a625[_0x632b('0x32')][_0x632b('0x3c')]);_0x1bb484[_0x632b('0x3d')]=qs[_0x632b('0x34')](_['pick'](_0x33a625['query'],_0x35348e[_0x632b('0x34')]),_0x3999aa);if(_0x33a625['query'][_0x632b('0x3e')]){_0x1bb484[_0x632b('0x3d')]=_[_0x632b('0x3f')](_0x1bb484[_0x632b('0x3d')],{'$or':_[_0x632b('0x2b')](_0x3999aa,function(_0x38266c){if(_0x38266c[_0x632b('0x2f')]!==_0x632b('0x40')){var _0x2730c2={};_0x2730c2[_0x38266c[_0x632b('0x28')]]={'$like':'%'+_0x33a625[_0x632b('0x32')][_0x632b('0x3e')]+'%'};return _0x2730c2;}})});}_0x1bb484=_[_0x632b('0x3f')]({},_0x1bb484,_0x33a625[_0x632b('0x41')]);var _0x13beaa={'where':_0x1bb484[_0x632b('0x3d')]};return db[_0x632b('0x2c')]['count'](_0x13beaa)['then'](function(_0x58e3cc){_0x1819fa['count']=_0x58e3cc;if(_0x33a625['query'][_0x632b('0x42')]){_0x1bb484['include']=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x1bb484);})[_0x632b('0x23')](function(_0x4490d4){_0x1819fa[_0x632b('0x43')]=_0x4490d4;return _0x1819fa;})[_0x632b('0x23')](respondWithFilteredResult(_0x4f8410,_0x1bb484))['catch'](handleError(_0x4f8410,null));};exports[_0x632b('0x44')]=function(_0x238297,_0x387fce){var _0x4dbe4b={'raw':!![],'where':{'id':_0x238297[_0x632b('0x45')]['id']}},_0x15bb30={};_0x15bb30[_0x632b('0x31')]=_[_0x632b('0x33')](db[_0x632b('0x2c')][_0x632b('0x2d')]);_0x15bb30['query']=_[_0x632b('0x33')](_0x238297[_0x632b('0x32')]);_0x15bb30[_0x632b('0x34')]=_[_0x632b('0x35')](_0x15bb30['model'],_0x15bb30['query']);_0x4dbe4b[_0x632b('0x36')]=_[_0x632b('0x35')](_0x15bb30[_0x632b('0x31')],qs[_0x632b('0x37')](_0x238297[_0x632b('0x32')][_0x632b('0x37')]));_0x4dbe4b['attributes']=_0x4dbe4b[_0x632b('0x36')][_0x632b('0x38')]?_0x4dbe4b[_0x632b('0x36')]:_0x15bb30[_0x632b('0x31')];if(_0x238297[_0x632b('0x32')][_0x632b('0x42')]){_0x4dbe4b[_0x632b('0x46')]=[{'all':!![]}];}_0x4dbe4b=_[_0x632b('0x3f')]({},_0x4dbe4b,_0x238297['options']);return db[_0x632b('0x2c')]['find'](_0x4dbe4b)[_0x632b('0x23')](handleEntityNotFound(_0x387fce,null))['then'](respondWithResult(_0x387fce,null))[_0x632b('0x47')](handleError(_0x387fce,null));};exports[_0x632b('0x48')]=function(_0x16dfc7,_0x2c4561){return db[_0x632b('0x2c')]['create'](_0x16dfc7[_0x632b('0x49')],{})[_0x632b('0x23')](respondWithResult(_0x2c4561,0xc9))[_0x632b('0x47')](handleError(_0x2c4561,null));};exports['update']=function(_0x253aec,_0x16eb80){if(_0x253aec[_0x632b('0x49')]['id']){delete _0x253aec[_0x632b('0x49')]['id'];}return db[_0x632b('0x2c')]['find']({'where':{'id':_0x253aec[_0x632b('0x45')]['id']}})['then'](handleEntityNotFound(_0x16eb80,null))[_0x632b('0x23')](saveUpdates(_0x253aec[_0x632b('0x49')],null))[_0x632b('0x23')](respondWithResult(_0x16eb80,null))[_0x632b('0x47')](handleError(_0x16eb80,null));};exports[_0x632b('0x24')]=function(_0x52785a,_0x4c9b4e){return db[_0x632b('0x2c')][_0x632b('0x4a')]({'where':{'id':_0x52785a[_0x632b('0x45')]['id']}})[_0x632b('0x23')](handleEntityNotFound(_0x4c9b4e,null))[_0x632b('0x23')](removeEntity(_0x4c9b4e,null))[_0x632b('0x47')](handleError(_0x4c9b4e,null));};
\ No newline at end of file
+var _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2c7,0x134));var _0x7c2c=function(_0x53fe45,_0x2ee3a2){_0x53fe45=_0x53fe45-0x0;var _0x70ae8a=_0xc2c7[_0x53fe45];return _0x70ae8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['WhatsappApplication'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};
\ No newline at end of file
index da9eea3..00f7e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ea=['lodash','../../config/logger','api','moment','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x335998,_0x2bcc76){var _0xc83fff=function(_0x2b950f){while(--_0x2b950f){_0x335998['push'](_0x335998['shift']());}};_0xc83fff(++_0x2bcc76);}(_0x48ea,0x9c));var _0xa48e=function(_0x4e2567,_0x430ecc){_0x4e2567=_0x4e2567-0x0;var _0xee6932=_0x48ea[_0x4e2567];return _0xee6932;};'use strict';var _=require(_0xa48e('0x0'));var util=require('util');var logger=require(_0xa48e('0x1'))(_0xa48e('0x2'));var moment=require(_0xa48e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa48e('0x4'));var rimraf=require('rimraf');var config=require(_0xa48e('0x5'));var attributes=require(_0xa48e('0x6'));module[_0xa48e('0x7')]=function(_0x4387b5,_0x2b058d){return _0x4387b5[_0xa48e('0x8')](_0xa48e('0x9'),attributes,{'tableName':_0xa48e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa48e('0xb'),'collate':_0xa48e('0xc')});};
\ No newline at end of file
+var _0xe015=['path','rimraf','../../config/environment','./whatsappApplication.attributes','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird'];(function(_0x5ecd68,_0x7a5e8e){var _0x34bc7b=function(_0x2234d7){while(--_0x2234d7){_0x5ecd68['push'](_0x5ecd68['shift']());}};_0x34bc7b(++_0x7a5e8e);}(_0xe015,0x13b));var _0x5e01=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe015[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var logger=require(_0x5e01('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5e01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e01('0x4'));var rimraf=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var attributes=require(_0x5e01('0x7'));module['exports']=function(_0x1814cb,_0x3d2da2){return _0x1814cb['define']('WhatsappApplication',attributes,{'tableName':_0x5e01('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5e01('0x9'),'collate':_0x5e01('0xa')});};
\ No newline at end of file
index 3a9fe8e..83b6e35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x27deaf,_0x533b1f){var _0x2452e9=function(_0x2e5a42){while(--_0x2e5a42){_0x27deaf['push'](_0x27deaf['shift']());}};_0x2452e9(++_0x533b1f);}(_0xedd9,0xfc));var _0x9edd=function(_0x17be6f,_0x4dd921){_0x17be6f=_0x17be6f-0x0;var _0x2e6a6a=_0xedd9[_0x17be6f];return _0x2e6a6a;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
+var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x166e5a,_0x8b0f57){var _0x5335cf=function(_0x2c87ea){while(--_0x2c87ea){_0x166e5a['push'](_0x166e5a['shift']());}};_0x5335cf(++_0x8b0f57);}(_0x6aa7,0x178));var _0x76aa=function(_0x1f4c87,_0x152fde){_0x1f4c87=_0x1f4c87-0x0;var _0x37a774=_0x6aa7[_0x1f4c87];return _0x37a774;};'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 d13b7b8..ebcac82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2bc=['destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','whatsapp','whatsappinteraction:addtags','tracked','delete','whatsappinteraction:destroy'];(function(_0x5e4c9b,_0x168735){var _0x153457=function(_0x4f6550){while(--_0x4f6550){_0x5e4c9b['push'](_0x5e4c9b['shift']());}};_0x153457(++_0x168735);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xe2bc[_0x31a371];return _0x2a5bd6;};'use strict';var multer=require(_0xce2b('0x0'));var util=require('util');var path=require(_0xce2b('0x1'));var timeout=require('connect-timeout');var express=require(_0xce2b('0x2'));var router=express[_0xce2b('0x3')]();var fs_extra=require(_0xce2b('0x4'));var auth=require(_0xce2b('0x5'));var interaction=require(_0xce2b('0x6'));var config=require('../../config/environment');var controller=require(_0xce2b('0x7'));router[_0xce2b('0x8')]('/',auth[_0xce2b('0x9')](),controller[_0xce2b('0xa')]);router[_0xce2b('0x8')]('/describe',auth[_0xce2b('0x9')](),controller[_0xce2b('0xb')]);router['get'](_0xce2b('0xc'),auth[_0xce2b('0x9')](),controller[_0xce2b('0xd')]);router[_0xce2b('0x8')](_0xce2b('0xe'),auth[_0xce2b('0x9')](),controller[_0xce2b('0xf')]);router[_0xce2b('0x8')](_0xce2b('0x10'),auth[_0xce2b('0x9')](),controller['download']);router[_0xce2b('0x11')]('/',auth['isAuthenticated'](),controller[_0xce2b('0x12')]);router[_0xce2b('0x11')](_0xce2b('0xe'),auth[_0xce2b('0x9')](),controller[_0xce2b('0x13')]);router[_0xce2b('0x11')](_0xce2b('0x14'),auth[_0xce2b('0x9')](),interaction['tracked'](_0xce2b('0x15'),_0xce2b('0x16')),controller['addTags']);router['put']('/:id',auth[_0xce2b('0x9')](),interaction[_0xce2b('0x17')](_0xce2b('0x15'),'whatsappinteraction:update'),controller['update']);router[_0xce2b('0x18')](_0xce2b('0xc'),auth[_0xce2b('0x9')](),interaction[_0xce2b('0x17')](_0xce2b('0x15'),_0xce2b('0x19')),controller[_0xce2b('0x1a')]);router[_0xce2b('0x18')](_0xce2b('0x14'),auth[_0xce2b('0x9')](),controller['removeTags']);module[_0xce2b('0x1b')]=router;
\ No newline at end of file
+var _0xe626=['whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe','/:id','show','post','create','/:id/messages','addMessage','tracked','whatsappinteraction:addtags','addTags','put'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xe626,0x9d));var _0x6e62=function(_0x5461c5,_0x3e0848){_0x5461c5=_0x5461c5-0x0;var _0x13b12f=_0xe626[_0x5461c5];return _0x13b12f;};'use strict';var multer=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var path=require(_0x6e62('0x2'));var timeout=require(_0x6e62('0x3'));var express=require('express');var router=express[_0x6e62('0x4')]();var fs_extra=require(_0x6e62('0x5'));var auth=require(_0x6e62('0x6'));var interaction=require(_0x6e62('0x7'));var config=require(_0x6e62('0x8'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x6e62('0x9')]);router[_0x6e62('0xa')]('/describe',auth[_0x6e62('0xb')](),controller[_0x6e62('0xc')]);router[_0x6e62('0xa')](_0x6e62('0xd'),auth['isAuthenticated'](),controller[_0x6e62('0xe')]);router[_0x6e62('0xa')]('/:id/messages',auth[_0x6e62('0xb')](),controller['getMessages']);router[_0x6e62('0xa')]('/:id/download',auth[_0x6e62('0xb')](),controller['download']);router[_0x6e62('0xf')]('/',auth[_0x6e62('0xb')](),controller[_0x6e62('0x10')]);router[_0x6e62('0xf')](_0x6e62('0x11'),auth[_0x6e62('0xb')](),controller[_0x6e62('0x12')]);router['post']('/:id/tags',auth[_0x6e62('0xb')](),interaction[_0x6e62('0x13')]('whatsapp',_0x6e62('0x14')),controller[_0x6e62('0x15')]);router[_0x6e62('0x16')](_0x6e62('0xd'),auth['isAuthenticated'](),interaction[_0x6e62('0x13')](_0x6e62('0x17'),_0x6e62('0x18')),controller[_0x6e62('0x19')]);router[_0x6e62('0x1a')](_0x6e62('0xd'),auth[_0x6e62('0xb')](),interaction[_0x6e62('0x13')](_0x6e62('0x17'),_0x6e62('0x1b')),controller['destroy']);router[_0x6e62('0x1a')](_0x6e62('0x1c'),auth['isAuthenticated'](),controller[_0x6e62('0x1d')]);module['exports']=router;
\ No newline at end of file
index aed3879..9cc8811 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49df=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x532850,_0x3a100a){var _0x4ea53f=function(_0x243531){while(--_0x243531){_0x532850['push'](_0x532850['shift']());}};_0x4ea53f(++_0x3a100a);}(_0x49df,0xad));var _0xf49d=function(_0x4cb03b,_0x47d402){_0x4cb03b=_0x4cb03b-0x0;var _0x132ba4=_0x49df[_0x4cb03b];return _0x132ba4;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf49d('0x0')]={'closed':{'type':Sequelize[_0xf49d('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf49d('0x2')]},'disposition':{'type':Sequelize[_0xf49d('0x3')]},'secondDisposition':{'type':Sequelize[_0xf49d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf49d('0x3')]},'note':{'type':Sequelize[_0xf49d('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf49d('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xf49d('0x4')]('in',_0xf49d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf49d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf49d('0x4')]('in',_0xf49d('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x78d3=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78d3,0x73));var _0x378d=function(_0x4e24c7,_0x439fb1){_0x4e24c7=_0x4e24c7-0x0;var _0x371808=_0x78d3[_0x4e24c7];return _0x371808;};'use strict';var Sequelize=require(_0x378d('0x0'));var moment=require(_0x378d('0x1'));module[_0x378d('0x2')]={'closed':{'type':Sequelize[_0x378d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x378d('0x4')]},'disposition':{'type':Sequelize[_0x378d('0x5')]},'secondDisposition':{'type':Sequelize[_0x378d('0x5')]},'thirdDisposition':{'type':Sequelize[_0x378d('0x5')]},'note':{'type':Sequelize[_0x378d('0x5')]},'phone':{'type':Sequelize[_0x378d('0x5')]},'read1stAt':{'type':Sequelize[_0x378d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x378d('0x6')]('in',_0x378d('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x378d('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x378d('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 9b78791..a7dd769 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d4=['disposition','existsSync','createReadStream','pipe','createWriteStream','out','basename','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','unlinkSync','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','name','send','Users','map','TagIds','forEach','push','index','WhatsappInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','from','tools_tags','select','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','clone','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','rows','catch','show','includeAll','include','options','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','WhatsappInteractionId','merge','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','addTags','setTags','removeTags','download','unix','join','server','files','tmp','root','attachments','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','fullname','N.A.','closed','closedAt'];(function(_0x19d288,_0x46dae3){var _0x4fdebf=function(_0x6b4ba3){while(--_0x6b4ba3){_0x19d288['push'](_0x19d288['shift']());}};_0x4fdebf(++_0x46dae3);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xd1d4[_0x1477ef];return _0x164acd;};'use strict';var emlformat=require(_0x4d1d('0x0'));var rimraf=require(_0x4d1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d1d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4d1d('0x3'));var Mustache=require(_0x4d1d('0x4'));var util=require(_0x4d1d('0x5'));var path=require(_0x4d1d('0x6'));var sox=require(_0x4d1d('0x7'));var csv=require(_0x4d1d('0x8'));var ejs=require(_0x4d1d('0x9'));var fs=require('fs');var fs_extra=require(_0x4d1d('0xa'));var _=require(_0x4d1d('0xb'));var squel=require(_0x4d1d('0xc'));var crypto=require(_0x4d1d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d1d('0x8'));var querystring=require(_0x4d1d('0xe'));var Papa=require('papaparse');var Redis=require(_0x4d1d('0xf'));var authService=require(_0x4d1d('0x10'));var qs=require(_0x4d1d('0x11'));var as=require(_0x4d1d('0x12'));var pdf=require(_0x4d1d('0x13'));var hardwareService=require(_0x4d1d('0x14'));var logger=require(_0x4d1d('0x15'))(_0x4d1d('0x16'));var utils=require(_0x4d1d('0x17'));var config=require(_0x4d1d('0x18'));var licenseUtil=require(_0x4d1d('0x19'));var db=require(_0x4d1d('0x1a'))['db'];config[_0x4d1d('0x1b')]=_['defaults'](config[_0x4d1d('0x1b')],{'host':_0x4d1d('0x1c'),'port':0x18eb});var socket=require(_0x4d1d('0x1d'))(new Redis(config[_0x4d1d('0x1b')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x58ef11,_0x1e5897){_0x1e5897=_0x1e5897||0xcc;return function(_0x1db7a6){if(_0x1db7a6){return _0x58ef11['sendStatus'](_0x1e5897);}return _0x58ef11[_0x4d1d('0x1e')](_0x1e5897)[_0x4d1d('0x1f')]();};}function respondWithResult(_0x3c1f04,_0xe7c5da){_0xe7c5da=_0xe7c5da||0xc8;return function(_0x5d232d){if(_0x5d232d){return _0x3c1f04['status'](_0xe7c5da)['json'](_0x5d232d);}};}function respondWithFilteredResult(_0x45f981,_0x83eb5a){return function(_0x3bea29){if(_0x3bea29){var _0x38d465=typeof _0x83eb5a[_0x4d1d('0x20')]==='undefined'&&typeof _0x83eb5a[_0x4d1d('0x21')]===_0x4d1d('0x22');var _0x40250e=_0x3bea29[_0x4d1d('0x23')];var _0x10c894=_0x38d465?0x0:_0x83eb5a[_0x4d1d('0x20')];var _0x1a5dae=_0x38d465?_0x3bea29['count']:_0x83eb5a[_0x4d1d('0x20')]+_0x83eb5a['limit'];var _0x32089d;if(_0x1a5dae>=_0x40250e){_0x1a5dae=_0x40250e;_0x32089d=0xc8;}else{_0x32089d=0xce;}_0x45f981[_0x4d1d('0x1e')](_0x32089d);return _0x45f981[_0x4d1d('0x24')](_0x4d1d('0x25'),_0x10c894+'-'+_0x1a5dae+'/'+_0x40250e)[_0x4d1d('0x26')](_0x3bea29);}return null;};}function patchUpdates(_0x2e0b46){return function(_0x1a93e5){try{jsonpatch['apply'](_0x1a93e5,_0x2e0b46,!![]);}catch(_0x410916){return BPromise[_0x4d1d('0x27')](_0x410916);}return _0x1a93e5[_0x4d1d('0x28')]();};}function saveUpdates(_0x7b13a5,_0x2d060b){return function(_0x50e7b0){if(_0x50e7b0){return _0x50e7b0[_0x4d1d('0x29')](_0x7b13a5)[_0x4d1d('0x2a')](function(_0x33f17e){return _0x33f17e;});}return null;};}function removeEntity(_0x2a49a8,_0x20ac5b){return function(_0x5cf5f3){if(_0x5cf5f3){return _0x5cf5f3[_0x4d1d('0x2b')]()['then'](function(){_0x2a49a8[_0x4d1d('0x1e')](0xcc)[_0x4d1d('0x1f')]();});}};}function handleEntityNotFound(_0x3f672b,_0xc33dea){return function(_0x476ee3){if(!_0x476ee3){_0x3f672b[_0x4d1d('0x2c')](0x194);}return _0x476ee3;};}function handleError(_0x54e905,_0x666c88){_0x666c88=_0x666c88||0x1f4;return function(_0x322e0f){logger[_0x4d1d('0x2d')](_0x322e0f['stack']);if(_0x322e0f[_0x4d1d('0x2e')]){delete _0x322e0f[_0x4d1d('0x2e')];}_0x54e905['status'](_0x666c88)[_0x4d1d('0x2f')](_0x322e0f);};}function getInteractionUsers(_0x3298f4,_0x3bd19b){return new BPromise(function(_0x3400b3,_0x475773){try{if(_0x3bd19b[_0x3298f4['id']]){_0x3298f4[_0x4d1d('0x30')]=_[_0x4d1d('0x31')](_0x3bd19b[_0x3298f4['id']],function(_0x664a6e){return{'id':_0x664a6e['id'],'fullname':_0x664a6e['fullname']};});}}catch(_0x5118d1){_0x475773(_0x5118d1);}_0x3400b3(_0x3298f4);});}function getInteractionTags(_0x2276d3,_0x497472){return new BPromise(function(_0x51c501,_0x3cd88d){try{if(_0x2276d3['TagIds']){_0x2276d3['Tags']=[];_0x2276d3[_0x4d1d('0x32')]['split'](',')[_0x4d1d('0x33')](function(_0x5079e8){_0x2276d3['Tags'][_0x4d1d('0x34')](_0x497472[_0x5079e8]);});}delete _0x2276d3[_0x4d1d('0x32')];}catch(_0xfc40cc){_0x3cd88d(_0xfc40cc);}_0x51c501(_0x2276d3);});}function updateWhatsappInteraction(_0x1dbf43,_0x5b05a2,_0x4f15a7){return new BPromise(function(_0x2aa965,_0x2ef12c){return getInteractionUsers(_0x1dbf43,_0x4f15a7)[_0x4d1d('0x2a')](function(_0x10d509){return getInteractionTags(_0x10d509,_0x5b05a2);})[_0x4d1d('0x2a')](function(_0x11f638){_0x2aa965(_0x11f638);})['catch'](function(_0x9682e8){_0x2ef12c(_0x9682e8);});});}exports[_0x4d1d('0x35')]=function(_0xf306e4,_0x3332c3){var _0x15bd75={},_0x24bd80={},_0x5e3f8e={'count':0x0,'rows':[]};var _0x20c657=_[_0x4d1d('0x31')](db[_0x4d1d('0x36')][_0x4d1d('0x37')],function(_0x5579ca){return{'name':_0x5579ca[_0x4d1d('0x38')],'type':_0x5579ca[_0x4d1d('0x39')]['key']};});_0x24bd80['model']=_[_0x4d1d('0x31')](_0x20c657,_0x4d1d('0x2e'));_0x24bd80['query']=_[_0x4d1d('0x3a')](_0xf306e4[_0x4d1d('0x3b')]);_0x24bd80[_0x4d1d('0x3c')]=_[_0x4d1d('0x3d')](_0x24bd80[_0x4d1d('0x3e')],_0x24bd80[_0x4d1d('0x3b')]);_0x15bd75[_0x4d1d('0x3f')]=_[_0x4d1d('0x3d')](_0x24bd80[_0x4d1d('0x3e')],qs[_0x4d1d('0x40')](_0xf306e4[_0x4d1d('0x3b')]['fields']));_0x15bd75[_0x4d1d('0x3f')]=_0x15bd75[_0x4d1d('0x3f')][_0x4d1d('0x41')]?_0x15bd75['attributes']:_0x24bd80[_0x4d1d('0x3e')];if(!_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x42')](_0x4d1d('0x43'))){_0x15bd75[_0x4d1d('0x21')]=qs[_0x4d1d('0x21')](_0xf306e4['query'][_0x4d1d('0x21')]);_0x15bd75[_0x4d1d('0x20')]=qs[_0x4d1d('0x20')](_0xf306e4['query']['offset']);}_0x15bd75[_0x4d1d('0x44')]=qs['sort'](_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x45')]);_0x15bd75['where']=qs['filters'](_[_0x4d1d('0x46')](_0xf306e4[_0x4d1d('0x3b')],_0x24bd80[_0x4d1d('0x3c')]),_0x20c657);var _0x206993=[];var _0xc8e512=squel['select']()[_0x4d1d('0x47')]('id')[_0x4d1d('0x47')](_0x4d1d('0x2e'))[_0x4d1d('0x47')]('color')[_0x4d1d('0x48')](_0x4d1d('0x49'));var _0x1a153c=squel[_0x4d1d('0x4a')]()[_0x4d1d('0x47')](_0x4d1d('0x4b'))['field'](_0x4d1d('0x4c'))[_0x4d1d('0x47')](_0x4d1d('0x4d'))[_0x4d1d('0x48')](_0x4d1d('0x4e'),'ui')[_0x4d1d('0x4f')](_0x4d1d('0x50'),'u',_0x4d1d('0x51'));var _0x57a7ed=squel[_0x4d1d('0x4a')]()['from'](_0x4d1d('0x52'),'i')[_0x4d1d('0x4f')](_0x4d1d('0x53'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x4d1d('0x50'),'o',_0x4d1d('0x54'))['left_join'](_0x4d1d('0x55'),'a',_0x4d1d('0x56'))[_0x4d1d('0x4f')](_0x4d1d('0x57'),'me',_0x4d1d('0x58'))['left_join'](_0x4d1d('0x59'),'it','it.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x4d1d('0x49'),'t',_0x4d1d('0x5a'));var _0xa218ee=squel[_0x4d1d('0x5b')]();var _0x3cd194=[];var _0xd60459=squel['expr']();var _0x2f9da0;if(_0xf306e4[_0x4d1d('0x3b')]['search']){_0x2f9da0=as[_0x4d1d('0x5c')](_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x5d')]);var _0x1f91bc=_0x2f9da0['sqlOperator'];for(var _0x30378f=0x0;_0x30378f<_0x2f9da0[_0x4d1d('0x5e')][_0x4d1d('0x41')];_0x30378f++){var _0x12b9ce=_0x2f9da0[_0x4d1d('0x5e')][_0x30378f];var _0x61acde='i';var _0x58a58c=_['find'](_0x20c657,[_0x4d1d('0x2e'),_0x12b9ce[_0x4d1d('0x47')]]);if(!_0x58a58c){switch(_0x12b9ce[_0x4d1d('0x47')]){case _0x4d1d('0x5f'):if(_0x12b9ce['value']==0x1){_0x57a7ed['having']('`'+_0x12b9ce[_0x4d1d('0x47')]+_0x4d1d('0x60'));}else{_0x57a7ed[_0x4d1d('0x61')]('`'+_0x12b9ce[_0x4d1d('0x47')]+_0x4d1d('0x62'));}break;case _0x4d1d('0x63'):if(_0x12b9ce[_0x4d1d('0x64')]===_0x4d1d('0x65')){if(_0x12b9ce[_0x4d1d('0x66')][_0x4d1d('0x67')]('\x20')[_0x4d1d('0x41')]>0x1){_0xa218ee[_0x1f91bc]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x4d1d('0x68')](_0x12b9ce[_0x4d1d('0x66')]),null);}else{var _0x2537b1='%'+_0x12b9ce[_0x4d1d('0x66')]+'%';_0xa218ee[_0x1f91bc](_0x4d1d('0x69'),_0x2537b1,_0x2537b1,_0x2537b1);}}else{_0x58a58c=_[_0x4d1d('0x6a')](_0x20c657,[_0x4d1d('0x2e'),_0x4d1d('0x6b')]);_0x12b9ce['field']=_0x4d1d('0x6b');_0x22cc82=as[_0x4d1d('0x6c')](_0x61acde,_0x58a58c['type'],_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82[_0x4d1d('0x6d')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x6e')],_0x22cc82['value'][_0x4d1d('0x1f')]);}break;case _0x4d1d('0x6f'):var _0x268ed3=_0x12b9ce[_0x4d1d('0x66')][_0x4d1d('0x67')](',')[_0x4d1d('0x31')](function(_0x55ce2f){return Number(_0x55ce2f);});_0x268ed3['forEach'](function(_0x2b049e){_0xd60459['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b049e+',%');});_0x3cd194=_[_0x4d1d('0x70')](_0x3cd194,_0x268ed3);break;case _0x4d1d('0x71'):if(_0x12b9ce[_0x4d1d('0x64')]===_0x4d1d('0x65')){_0xa218ee[_0x1f91bc](_0x4d1d('0x72'),'%'+_0x12b9ce['value']+'%',null);}else{_0x58a58c=_[_0x4d1d('0x6a')](_0x20c657,[_0x4d1d('0x2e'),_0x4d1d('0x73')]);_0x12b9ce['field']=_0x4d1d('0x73');_0x22cc82=as[_0x4d1d('0x6c')](_0x61acde,_0x58a58c[_0x4d1d('0x39')],_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82[_0x4d1d('0x6d')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x6e')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x1f')]);}break;case'body':_0x22cc82=as[_0x4d1d('0x6c')]('me',null,_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82[_0x4d1d('0x6d')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x6e')],_0x22cc82[_0x4d1d('0x66')][_0x4d1d('0x1f')]);break;}}else{var _0x22cc82=as[_0x4d1d('0x6c')](_0x61acde,_0x58a58c[_0x4d1d('0x39')],_0x12b9ce);_0xa218ee[_0x1f91bc](_0x22cc82['text'],_0x22cc82['value']['start'],_0x22cc82[_0x4d1d('0x66')]['end']);}}}else{var _0x4546fc=_(_0xf306e4['query'])[_0x4d1d('0x3a')]()[_0x4d1d('0x31')](function(_0x202a6a){return _[_0x4d1d('0x74')](_0x20c657,[_0x4d1d('0x2e'),_0x202a6a])?_0x202a6a:undefined;})[_0x4d1d('0x75')]()['value']();if(!_[_0x4d1d('0x76')](_0x4546fc)){_0x4546fc[_0x4d1d('0x33')](function(_0x5ea7cb){if(_0x5ea7cb==='WhatsappAccountId'){_0x57a7ed[_0x4d1d('0x77')]('i.WhatsappAccountId\x20IN\x20?',[][_0x4d1d('0x78')](_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb]));}else if(_0x5ea7cb===_0x4d1d('0x79')){var _0x5a3c36=JSON[_0x4d1d('0x7a')](_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb])[_0x4d1d('0x7b')];var _0x130036=JSON['parse'](_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb])[_0x4d1d('0x7c')];_0x57a7ed[_0x4d1d('0x77')](_0x4d1d('0x7d'),_0x5a3c36,_0x130036);}else{if(_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb]===_0x4d1d('0x7e')){_0x57a7ed[_0x4d1d('0x77')]('i.'+_0x5ea7cb+_0x4d1d('0x7f'));}else{_0x57a7ed[_0x4d1d('0x77')]('i.'+_0x5ea7cb+_0x4d1d('0x80'),_0xf306e4[_0x4d1d('0x3b')][_0x5ea7cb]);}}});}if(_0xf306e4[_0x4d1d('0x3b')]['read']){if(_0xf306e4['query'][_0x4d1d('0x81')]==0x1){_0x57a7ed['having'](_0x4d1d('0x82'));}else{_0x57a7ed[_0x4d1d('0x61')](_0x4d1d('0x83'));}}if(_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x84')]){_0x3cd194=_[_0x4d1d('0x85')](_0xf306e4[_0x4d1d('0x3b')]['tag'])?_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x84')]:new Array(_0xf306e4[_0x4d1d('0x3b')]['tag']);_0x3cd194[_0x4d1d('0x33')](function(_0x1ef51f){_0xd60459['or'](_0x4d1d('0x86'),'%,'+_0x1ef51f+',%');});}if(_0xf306e4['query']['filter']){var _0x112db7=_0xf306e4['query'][_0x4d1d('0x87')][_0x4d1d('0x88')]('\x5c','\x5c\x5c')[_0x4d1d('0x88')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x112db7)){_0xa218ee['or'](_0x4d1d('0x89'),_0x112db7+'%')['or'](_0x4d1d('0x8a'),_0x112db7+'%');}else{_0xa218ee['or'](_0x4d1d('0x8b'),qs['getFullTextValue'](_0x112db7))['or'](_0x4d1d('0x8c'),_0x112db7+'%');}}}_0x57a7ed[_0x4d1d('0x77')](_0xa218ee);_0x57a7ed['group'](_0x4d1d('0x8d'));var _0x5dad19={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x532ef3=_0x57a7ed[_0x4d1d('0x8e')]();_0x532ef3[_0x4d1d('0x47')](_0x4d1d('0x8d'));_0x532ef3[_0x4d1d('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x4d1d('0x5f'));if(_0x15bd75[_0x4d1d('0x44')]){_0x15bd75['order'][_0x4d1d('0x33')](function(_0x1c0791){var _0x52fe31=_0x1c0791[0x0]===_0x4d1d('0x8f')?_0x1c0791[0x0]:'i.'+_0x1c0791[0x0];_0x57a7ed['order'](_0x52fe31,_0x1c0791[0x1]===_0x4d1d('0x90')?![]:!![]);});}if(!_[_0x4d1d('0x76')](_0x3cd194)){_0x57a7ed[_0x4d1d('0x61')](_0xd60459);_0x532ef3[_0x4d1d('0x77')](_0x4d1d('0x91'),_0x3cd194);}BPromise[_0x4d1d('0x92')]()[_0x4d1d('0x2a')](function(){if(!_0x2f9da0){if(_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x93')])return;_0x532ef3[_0x4d1d('0x77')](_0x4d1d('0x94'));_0x57a7ed['where'](_0x4d1d('0x94'));return;}if(_0xf306e4[_0x4d1d('0x95')]['role']!==_0x4d1d('0x96'))return;return _0xf306e4['user'][_0x4d1d('0x97')]({'attributes':['id'],'raw':!![]})['then'](function(_0x596739){if(_[_0x4d1d('0x76')](_0x596739)){_0x532ef3[_0x4d1d('0x77')](_0x4d1d('0x98'));_0x57a7ed[_0x4d1d('0x77')](_0x4d1d('0x98'));}else{_0x532ef3[_0x4d1d('0x77')]('i.WhatsappAccountId\x20IN\x20?',_[_0x4d1d('0x31')](_0x596739,'id'));_0x57a7ed['where'](_0x4d1d('0x99'),_['map'](_0x596739,'id'));}});})[_0x4d1d('0x2a')](function(){if(_0xf306e4[_0x4d1d('0x95')][_0x4d1d('0x9a')]===_0x4d1d('0x96')&&!_0x2f9da0&&!_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x93')])return[];return db[_0x4d1d('0x9b')][_0x4d1d('0x3b')](_0x532ef3['toString'](),_0x5dad19);})[_0x4d1d('0x2a')](function(_0x493046){_0x5e3f8e[_0x4d1d('0x23')]=_0x493046['length'];if(_0x5e3f8e[_0x4d1d('0x23')]===0x0)return[];return db[_0x4d1d('0x9b')][_0x4d1d('0x3b')](_0xc8e512[_0x4d1d('0x9c')](),_0x5dad19)[_0x4d1d('0x2a')](function(_0x4ab25d){_0x206993=_[_0x4d1d('0x9d')](_0x4ab25d,'id');_0x5dad19=_['merge'](_0x5dad19,{'model':db[_0x4d1d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xf306e4[_0x4d1d('0x3b')][_0x4d1d('0x40')]){_0x15bd75['attributes'][_0x4d1d('0x33')](function(_0x4a0c18){_0x57a7ed[_0x4d1d('0x47')]('i.'+_0x4a0c18);});}else{_0x57a7ed['field'](_0x4d1d('0x9e'),_0x4d1d('0x5f'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0x9f'),_0x4d1d('0xa0'));_0x57a7ed['field'](_0x4d1d('0xa1'),_0x4d1d('0xa2'));_0x57a7ed['field'](_0x4d1d('0xa3'),'contactName');_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa4'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa5'),_0x4d1d('0xa6'));_0x57a7ed[_0x4d1d('0x47')]('c.lastName',_0x4d1d('0xa7'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa8'),'Contact.email');_0x57a7ed[_0x4d1d('0x47')]('c.phone','Contact.phone');_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xa9'),_0x4d1d('0xaa'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xab'),_0x4d1d('0xac'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xad'),_0x4d1d('0xae'));_0x57a7ed[_0x4d1d('0x47')]('o.internal',_0x4d1d('0xaf'));_0x57a7ed[_0x4d1d('0x47')](_0x4d1d('0xb0'),'TagIds');}if(_0x15bd75[_0x4d1d('0x21')])_0x57a7ed[_0x4d1d('0x21')](_0x15bd75['limit']);if(_0x15bd75['offset'])_0x57a7ed[_0x4d1d('0x20')](_0x15bd75[_0x4d1d('0x20')]);return db['sequelize']['query'](_0x57a7ed[_0x4d1d('0x9c')](),_0x5dad19);})[_0x4d1d('0x2a')](function(_0x4c4dfc){if(_0x4c4dfc[_0x4d1d('0x41')]>0x0)_0x1a153c['where'](_0x4d1d('0xb1'),_['map'](_0x4c4dfc,'id'));return db[_0x4d1d('0x9b')][_0x4d1d('0x3b')](_0x1a153c[_0x4d1d('0x9c')](),_0x5dad19)[_0x4d1d('0x2a')](function(_0x4f840c){var _0x4883c8=_['groupBy'](_0x4f840c,'WhatsappInteractionId');var _0x47656e=[];_0x4c4dfc['forEach'](function(_0x472a23){_0x47656e[_0x4d1d('0x34')](updateWhatsappInteraction(_0x472a23,_0x206993,_0x4883c8));});return BPromise['all'](_0x47656e);});});})[_0x4d1d('0x2a')](function(_0x145327){_0x5e3f8e[_0x4d1d('0xb2')]=_0x145327;return _0x5e3f8e;})[_0x4d1d('0x2a')](respondWithFilteredResult(_0x3332c3,_0x15bd75))[_0x4d1d('0xb3')](handleError(_0x3332c3,null));};exports[_0x4d1d('0xb4')]=function(_0x28b064,_0x89c52b){var _0x10d275={'raw':![],'where':{'id':_0x28b064['params']['id']}},_0x328a15={};_0x328a15[_0x4d1d('0x3e')]=_[_0x4d1d('0x3a')](db[_0x4d1d('0x36')][_0x4d1d('0x37')]);_0x328a15[_0x4d1d('0x3b')]=_[_0x4d1d('0x3a')](_0x28b064[_0x4d1d('0x3b')]);_0x328a15[_0x4d1d('0x3c')]=_[_0x4d1d('0x3d')](_0x328a15[_0x4d1d('0x3e')],_0x328a15[_0x4d1d('0x3b')]);_0x10d275[_0x4d1d('0x3f')]=_[_0x4d1d('0x3d')](_0x328a15['model'],qs[_0x4d1d('0x40')](_0x28b064[_0x4d1d('0x3b')][_0x4d1d('0x40')]));_0x10d275[_0x4d1d('0x3f')]=_0x10d275[_0x4d1d('0x3f')]['length']?_0x10d275['attributes']:_0x328a15['model'];if(_0x28b064['query'][_0x4d1d('0xb5')]){_0x10d275[_0x4d1d('0xb6')]=[{'all':!![]}];}_0x10d275=_['merge']({},_0x10d275,_0x28b064[_0x4d1d('0xb7')]);return db[_0x4d1d('0x36')][_0x4d1d('0x6a')](_0x10d275)[_0x4d1d('0x2a')](handleEntityNotFound(_0x89c52b,null))['then'](respondWithResult(_0x89c52b,null))['catch'](handleError(_0x89c52b,null));};exports[_0x4d1d('0xb8')]=function(_0x184447,_0x30b323){return db[_0x4d1d('0x36')][_0x4d1d('0xb8')](_0x184447[_0x4d1d('0xb9')],{})[_0x4d1d('0x2a')](respondWithResult(_0x30b323,0xc9))['catch'](handleError(_0x30b323,null));};exports['update']=function(_0x44292c,_0x447a25){if(_0x44292c[_0x4d1d('0xb9')]['id']){delete _0x44292c[_0x4d1d('0xb9')]['id'];}return db[_0x4d1d('0x36')]['find']({'where':{'id':_0x44292c[_0x4d1d('0xba')]['id']}})[_0x4d1d('0x2a')](handleEntityNotFound(_0x447a25,null))['then'](saveUpdates(_0x44292c[_0x4d1d('0xb9')],null))[_0x4d1d('0x2a')](respondWithResult(_0x447a25,null))['catch'](handleError(_0x447a25,null));};exports[_0x4d1d('0x2b')]=function(_0x35c563,_0x312080){return db[_0x4d1d('0x36')]['find']({'where':{'id':_0x35c563[_0x4d1d('0xba')]['id']}})['then'](handleEntityNotFound(_0x312080,null))[_0x4d1d('0x2a')](removeEntity(_0x312080,null))[_0x4d1d('0xb3')](handleError(_0x312080,null));};exports['describe']=function(_0x1a405c,_0x2e6148){return db[_0x4d1d('0x36')][_0x4d1d('0xbb')]()[_0x4d1d('0x2a')](respondWithResult(_0x2e6148,null))[_0x4d1d('0xb3')](handleError(_0x2e6148,null));};exports[_0x4d1d('0xbc')]=function(_0x35adbd,_0xa843b0,_0x5daab2){return db['WhatsappMessage']['find']({'where':{'id':_0x35adbd[_0x4d1d('0xba')]['id']}})[_0x4d1d('0x2a')](handleEntityNotFound(_0xa843b0,null))[_0x4d1d('0x2a')](function(_0x2df59e){if(_0x2df59e){return _0x2df59e[_0x4d1d('0xbc')](_0x35adbd[_0x4d1d('0xb9')][_0x4d1d('0xbd')],_[_0x4d1d('0xbe')](_0x35adbd[_0x4d1d('0xb9')],[_0x4d1d('0xbd'),'id'])||{});}})[_0x4d1d('0x2a')](respondWithResult(_0xa843b0,null))[_0x4d1d('0xb3')](handleError(_0xa843b0,null));};exports[_0x4d1d('0xbf')]=function(_0x364b23,_0xc8c458,_0x4b37eb){var _0x45f3f3={'raw':![],'where':{}};var _0x6349a0={};var _0x3abc03={'count':0x0,'rows':[]};return db[_0x4d1d('0x36')][_0x4d1d('0xc0')]({'where':{'id':_0x364b23[_0x4d1d('0xba')]['id']}})['then'](handleEntityNotFound(_0xc8c458,null))[_0x4d1d('0x2a')](function(_0x240a78){if(_0x240a78){_0x6349a0['model']=_['keys'](db['WhatsappMessage'][_0x4d1d('0x37')]);_0x6349a0[_0x4d1d('0x3b')]=_[_0x4d1d('0x3a')](_0x364b23[_0x4d1d('0x3b')]);_0x6349a0[_0x4d1d('0x3c')]=_[_0x4d1d('0x3d')](_0x6349a0[_0x4d1d('0x3e')],_0x6349a0['query']);_0x45f3f3[_0x4d1d('0x3f')]=_['intersection'](_0x6349a0[_0x4d1d('0x3e')],qs[_0x4d1d('0x40')](_0x364b23[_0x4d1d('0x3b')]['fields']));_0x45f3f3['attributes']=_0x45f3f3['attributes'][_0x4d1d('0x41')]?_0x45f3f3[_0x4d1d('0x3f')]:_0x6349a0[_0x4d1d('0x3e')];if(!_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x42')](_0x4d1d('0x43'))){_0x45f3f3[_0x4d1d('0x21')]=qs[_0x4d1d('0x21')](_0x364b23['query'][_0x4d1d('0x21')]);_0x45f3f3[_0x4d1d('0x20')]=qs[_0x4d1d('0x20')](_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x20')]);}_0x45f3f3[_0x4d1d('0x44')]=qs['sort'](_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x45')]);_0x45f3f3[_0x4d1d('0x77')]=qs['filters'](_[_0x4d1d('0x46')](_0x364b23['query'],_0x6349a0['filters']));_0x45f3f3['where'][_0x4d1d('0xc1')]=_0x240a78['id'];if(_0x364b23['query'][_0x4d1d('0x87')]){_0x45f3f3[_0x4d1d('0x77')]=_[_0x4d1d('0xc2')](_0x45f3f3[_0x4d1d('0x77')],{'$or':_['map'](_0x45f3f3['attributes'],function(_0x5cac86){var _0x41f474={};_0x41f474[_0x5cac86]={'$like':'%'+_0x364b23[_0x4d1d('0x3b')]['filter']+'%'};return _0x41f474;})});}if(_0x364b23['query']['$gte']){var _0x4f2d8f=_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0x7b')][_0x4d1d('0x67')](',');var _0x567a15={};_0x567a15[_0x4f2d8f[0x0]]={'$gte':moment(_0x4f2d8f[0x1])[_0x4d1d('0xc3')](_0x4d1d('0xc4'))};_0x45f3f3[_0x4d1d('0x77')]=_[_0x4d1d('0xc2')](_0x45f3f3['where'],_0x567a15);}_0x45f3f3=_[_0x4d1d('0xc2')]({},_0x45f3f3,_0x364b23[_0x4d1d('0xb7')]);return db[_0x4d1d('0xc5')][_0x4d1d('0x23')]({'where':_0x45f3f3['where']})['then'](function(_0xc21e33){_0x3abc03[_0x4d1d('0x23')]=_0xc21e33;if(_0x364b23[_0x4d1d('0x3b')][_0x4d1d('0xb5')]){_0x45f3f3[_0x4d1d('0xb6')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x4d1d('0xc6')](_0x45f3f3);})[_0x4d1d('0x2a')](function(_0x26fac0){_0x3abc03[_0x4d1d('0xb2')]=_0x26fac0;return _0x3abc03;});}})[_0x4d1d('0x2a')](respondWithFilteredResult(_0xc8c458,_0x45f3f3))['catch'](handleError(_0xc8c458,null));};exports[_0x4d1d('0xc7')]=function(_0x74809d,_0x3b298a,_0x2a3bc8){return db[_0x4d1d('0x36')][_0x4d1d('0x6a')]({'where':{'id':_0x74809d['params']['id']}})['then'](handleEntityNotFound(_0x3b298a,null))[_0x4d1d('0x2a')](function(_0x5afa65){if(_0x5afa65){return _0x5afa65[_0x4d1d('0xc8')](_0x74809d[_0x4d1d('0xb9')][_0x4d1d('0xbd')],_[_0x4d1d('0xbe')](_0x74809d[_0x4d1d('0xb9')],[_0x4d1d('0xbd'),'id'])||{})['spread'](function(){return db[_0x4d1d('0x6f')][_0x4d1d('0xc6')]({'attributes':['id',_0x4d1d('0x2e'),'color'],'where':{'id':_0x74809d[_0x4d1d('0xb9')]['ids']}});})[_0x4d1d('0x2a')](function(_0x5b90c4){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x74809d[_0x4d1d('0xba')]['id']),'tags':_0x5b90c4||[]});return{'id':Number(_0x74809d[_0x4d1d('0xba')]['id']),'tags':_0x5b90c4||[]};});}})[_0x4d1d('0x2a')](respondWithResult(_0x3b298a,null))[_0x4d1d('0xb3')](handleError(_0x3b298a,null));};exports[_0x4d1d('0xc9')]=function(_0xba64b1,_0xd0b9fb,_0x434ea7){return db['WhatsappInteraction']['find']({'where':{'id':_0xba64b1[_0x4d1d('0xba')]['id']}})['then'](handleEntityNotFound(_0xd0b9fb,null))['then'](function(_0x50b323){if(_0x50b323){return _0x50b323[_0x4d1d('0xc9')](_0xba64b1[_0x4d1d('0x3b')][_0x4d1d('0xbd')]);}})[_0x4d1d('0x2a')](respondWithStatusCode(_0xd0b9fb,null))[_0x4d1d('0xb3')](handleError(_0xd0b9fb,null));};exports[_0x4d1d('0xca')]=function(_0x1ef80f,_0x344d22){var _0x4d0b6e=moment()[_0x4d1d('0xcb')]()['toString']();var _0x14f0c1=path[_0x4d1d('0xcc')](config['root'],_0x4d1d('0xcd'),_0x4d1d('0xce'),_0x4d1d('0xcf'));var _0x573a3f=path[_0x4d1d('0xcc')](config[_0x4d1d('0xd0')],'server',_0x4d1d('0xce'),_0x4d1d('0xd1'));var _0x4c0ad5=path[_0x4d1d('0xcc')](_0x14f0c1,_0x4d0b6e);var _0x56fdc3=util[_0x4d1d('0xc3')]('transcript-%d-%s.zip',_0x1ef80f[_0x4d1d('0xba')]['id'],_0x4d0b6e);var _0x46c542=path[_0x4d1d('0xcc')](_0x14f0c1,_0x56fdc3);var _0x526445=[];_0x526445[_0x4d1d('0x34')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x526445[_0x4d1d('0x34')]({'model':db['CmContact'],'as':_0x4d1d('0x63'),'attributes':['id',_0x4d1d('0xd2'),_0x4d1d('0xd3')],'raw':!![]});if(_0x1ef80f[_0x4d1d('0x3b')][_0x4d1d('0xd1')]){_0x526445[_0x4d1d('0x34')]({'model':db['Attachment'],'as':_0x4d1d('0xd4'),'raw':!![]});}var _0x149df1=[{'model':db[_0x4d1d('0xc5')],'as':_0x4d1d('0xd5'),'attributes':['id',_0x4d1d('0xb9'),_0x4d1d('0x79'),_0x4d1d('0xd6'),_0x4d1d('0xd7'),'read'],'include':_0x526445}];_0x149df1[_0x4d1d('0x34')]({'model':db[_0x4d1d('0xd8')],'as':'Account','attributes':['id',_0x4d1d('0x2e')]});_0x149df1['push']({'model':db[_0x4d1d('0x71')],'as':_0x4d1d('0xd9'),'attributes':['id','fullname']});return db[_0x4d1d('0x36')][_0x4d1d('0x6a')]({'where':{'id':_0x1ef80f['params']['id']},'include':_0x149df1})['then'](handleEntityNotFound(_0x344d22,null))[_0x4d1d('0x2a')](function(_0x49bb26){if(_0x49bb26){var _0x85dcb5=_0x49bb26[_0x4d1d('0xda')]({'plain':!![]});fs[_0x4d1d('0xdb')](_0x4c0ad5);var _0x1b2f61={'channel':_0x4d1d('0xdc'),'account':_0x85dcb5['Account'][_0x4d1d('0x2e')],'agent':_0x85dcb5[_0x4d1d('0xd9')]?_0x85dcb5[_0x4d1d('0xd9')][_0x4d1d('0xdd')]:_0x4d1d('0xde'),'createdAt':moment(_0x85dcb5[_0x4d1d('0x79')])[_0x4d1d('0xc3')](_0x4d1d('0xc4'))[_0x4d1d('0x9c')](),'closedAt':_0x85dcb5[_0x4d1d('0xdf')]?moment(_0x85dcb5[_0x4d1d('0xe0')])['format'](_0x4d1d('0xc4'))[_0x4d1d('0x9c')]():'','disposition':_0x85dcb5[_0x4d1d('0xe1')],'messages':_(_0x85dcb5[_0x4d1d('0xd5')])[_0x4d1d('0x87')]({'secret':![]})['map'](function(_0x5a7248){if(_0x5a7248['Attachment']){var _0x6f7c6=path['join'](_0x573a3f,_0x5a7248[_0x4d1d('0xd4')]['basename']);if(fs[_0x4d1d('0xe2')](_0x6f7c6)){fs[_0x4d1d('0xe3')](_0x6f7c6)[_0x4d1d('0xe4')](fs[_0x4d1d('0xe5')](path[_0x4d1d('0xcc')](_0x4c0ad5,_0x5a7248[_0x4d1d('0xd4')]['basename'])));}}return{'date':moment(_0x5a7248['createdAt'])[_0x4d1d('0xc3')](_0x4d1d('0xc4'))[_0x4d1d('0x9c')](),'sender':_0x5a7248[_0x4d1d('0xd6')]===_0x4d1d('0xe6')?_0x5a7248[_0x4d1d('0x71')]?_0x5a7248[_0x4d1d('0x71')][_0x4d1d('0xdd')]:'System':_0x5a7248[_0x4d1d('0x63')][_0x4d1d('0xd2')]+(_0x5a7248[_0x4d1d('0x63')][_0x4d1d('0xd3')]?'\x20'+_0x5a7248[_0x4d1d('0x63')][_0x4d1d('0xd3')]:''),'body':_0x5a7248['Attachment']?_0x5a7248[_0x4d1d('0xd4')][_0x4d1d('0xe7')]:_0x5a7248[_0x4d1d('0xb9')],'direction':_0x5a7248[_0x4d1d('0xd6')]==='out'?'A':'C','secret':_0x5a7248[_0x4d1d('0xd7')],'read':_0x5a7248['read'],'attachment':_0x5a7248[_0x4d1d('0xd4')]};})[_0x4d1d('0x66')]()};return ejs[_0x4d1d('0xe8')](path[_0x4d1d('0xcc')](config[_0x4d1d('0xd0')],_0x4d1d('0xcd'),_0x4d1d('0xe9'),_0x4d1d('0xea')),{'interaction':_0x1b2f61})[_0x4d1d('0x2a')](function(_0x1770ce){var _0x51d3a5=path[_0x4d1d('0xcc')](_0x4c0ad5,_0x4d1d('0xeb')+_0x85dcb5['id']+'-'+_0x4d0b6e+_0x4d1d('0xec'));var _0x38c72a={'path':_0x51d3a5,'channel':'Whatsapp','interactionId':_0x85dcb5['id']};return pdf['createPdfFromHTML'](_0x1770ce,_0x38c72a);})[_0x4d1d('0x2a')](function(){return new BPromise(function(_0x346e1e,_0x8dca2a){zipdir(_0x4c0ad5,{'saveTo':_0x46c542},function(_0x472188,_0x310505){if(_0x472188)return _0x8dca2a(_0x472188);return _0x346e1e(_0x310505);});})[_0x4d1d('0x2a')](function(){return new BPromise(function(_0x4c3df6,_0x598328){rimraf(_0x4c0ad5,function(_0x3f8319){if(_0x3f8319)_0x598328(_0x3f8319);return _0x4c3df6();});});})[_0x4d1d('0x2a')](function(){return _0x344d22['download'](_0x46c542,_0x56fdc3,function(_0x1360c9){if(_0x1360c9){console['log']('err',_0x1360c9);}else{fs[_0x4d1d('0xed')](_0x46c542);}});});});}else{return _0x344d22[_0x4d1d('0x2c')](0xc8);}})[_0x4d1d('0xb3')](handleError(_0x344d22,null));};
\ No newline at end of file
+var _0xc0c2=['redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','reject','then','stack','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','WhatsappInteraction','rawAttributes','type','key','model','name','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','count','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','includeAll','options','create','body','update','params','destroy','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','format','YYYY-MM-DD\x20HH:mm:ss','include','addTags','spread','whatsappInteractionTags:save','removeTags','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Attachment','Messages','secret','WhatsappAccount','Account','User','Owner','get','mkdirSync','closedAt','disposition','basename','createWriteStream','System','lastName','direction','out','views','downloadInteraction.ejs','transcript-','Whatsapp','download','log','err','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1022ed,_0x2ac525){var _0x959b70=function(_0x432441){while(--_0x432441){_0x1022ed['push'](_0x1022ed['shift']());}};_0x959b70(++_0x2ac525);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x4ece58,_0x50922a){_0x4ece58=_0x4ece58-0x0;var _0x20d209=_0xc0c2[_0x4ece58];return _0x20d209;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2c0c('0x0'));var zipdir=require(_0x2c0c('0x1'));var jsonpatch=require(_0x2c0c('0x2'));var rp=require(_0x2c0c('0x3'));var moment=require('moment');var BPromise=require(_0x2c0c('0x4'));var Mustache=require(_0x2c0c('0x5'));var util=require(_0x2c0c('0x6'));var path=require(_0x2c0c('0x7'));var sox=require(_0x2c0c('0x8'));var csv=require(_0x2c0c('0x9'));var ejs=require(_0x2c0c('0xa'));var fs=require('fs');var fs_extra=require(_0x2c0c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c0c('0xc'));var jsforce=require(_0x2c0c('0xd'));var deskjs=require(_0x2c0c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2c0c('0xf'));var Papa=require('papaparse');var Redis=require(_0x2c0c('0x10'));var authService=require(_0x2c0c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c0c('0x12'));var pdf=require(_0x2c0c('0x13'));var hardwareService=require(_0x2c0c('0x14'));var logger=require(_0x2c0c('0x15'))(_0x2c0c('0x16'));var utils=require(_0x2c0c('0x17'));var config=require(_0x2c0c('0x18'));var licenseUtil=require(_0x2c0c('0x19'));var db=require(_0x2c0c('0x1a'))['db'];config[_0x2c0c('0x1b')]=_[_0x2c0c('0x1c')](config[_0x2c0c('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c0c('0x1d'))(new Redis(config['redis']));require(_0x2c0c('0x1e'))[_0x2c0c('0x1f')](socket);function respondWithStatusCode(_0x26c4d7,_0x39c43f){_0x39c43f=_0x39c43f||0xcc;return function(_0x21432d){if(_0x21432d){return _0x26c4d7[_0x2c0c('0x20')](_0x39c43f);}return _0x26c4d7[_0x2c0c('0x21')](_0x39c43f)['end']();};}function respondWithResult(_0x1b2841,_0x1f560a){_0x1f560a=_0x1f560a||0xc8;return function(_0x4e3703){if(_0x4e3703){return _0x1b2841['status'](_0x1f560a)[_0x2c0c('0x22')](_0x4e3703);}};}function respondWithFilteredResult(_0x5c967b,_0x159f2e){return function(_0x1d2cda){if(_0x1d2cda){var _0x13b21f=typeof _0x159f2e[_0x2c0c('0x23')]==='undefined'&&typeof _0x159f2e[_0x2c0c('0x24')]==='undefined';var _0x240701=_0x1d2cda['count'];var _0x39dcc9=_0x13b21f?0x0:_0x159f2e[_0x2c0c('0x23')];var _0x4b2ebf=_0x13b21f?_0x1d2cda['count']:_0x159f2e['offset']+_0x159f2e[_0x2c0c('0x24')];var _0x5c0fb9;if(_0x4b2ebf>=_0x240701){_0x4b2ebf=_0x240701;_0x5c0fb9=0xc8;}else{_0x5c0fb9=0xce;}_0x5c967b['status'](_0x5c0fb9);return _0x5c967b[_0x2c0c('0x25')](_0x2c0c('0x26'),_0x39dcc9+'-'+_0x4b2ebf+'/'+_0x240701)[_0x2c0c('0x22')](_0x1d2cda);}return null;};}function patchUpdates(_0x26206c){return function(_0x3e8a99){try{jsonpatch['apply'](_0x3e8a99,_0x26206c,!![]);}catch(_0x2432f1){return BPromise[_0x2c0c('0x27')](_0x2432f1);}return _0x3e8a99['save']();};}function saveUpdates(_0x5aa5df,_0x4a1180){return function(_0xd7c07b){if(_0xd7c07b){return _0xd7c07b['update'](_0x5aa5df)['then'](function(_0x5313e2){return _0x5313e2;});}return null;};}function removeEntity(_0x22084a,_0x4aa5f3){return function(_0xf70384){if(_0xf70384){return _0xf70384['destroy']()[_0x2c0c('0x28')](function(){_0x22084a[_0x2c0c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf94192,_0xcb0cb2){return function(_0x3fb6f9){if(!_0x3fb6f9){_0xf94192[_0x2c0c('0x20')](0x194);}return _0x3fb6f9;};}function handleError(_0x2e34ed,_0x16330f){_0x16330f=_0x16330f||0x1f4;return function(_0x26a90d){logger['error'](_0x26a90d[_0x2c0c('0x29')]);if(_0x26a90d['name']){delete _0x26a90d['name'];}_0x2e34ed[_0x2c0c('0x21')](_0x16330f)['send'](_0x26a90d);};}function getInteractionUsers(_0x28c2fa,_0x47e0c9){return new BPromise(function(_0xcde80,_0x1a32ef){try{if(_0x47e0c9[_0x28c2fa['id']]){_0x28c2fa[_0x2c0c('0x2a')]=_[_0x2c0c('0x2b')](_0x47e0c9[_0x28c2fa['id']],function(_0x50fde0){return{'id':_0x50fde0['id'],'fullname':_0x50fde0[_0x2c0c('0x2c')]};});}}catch(_0x5accb0){_0x1a32ef(_0x5accb0);}_0xcde80(_0x28c2fa);});}function getInteractionTags(_0x343e8e,_0x9dcfe8){return new BPromise(function(_0x29ffd6,_0x3519b3){try{if(_0x343e8e['TagIds']){_0x343e8e[_0x2c0c('0x2d')]=[];_0x343e8e[_0x2c0c('0x2e')][_0x2c0c('0x2f')](',')[_0x2c0c('0x30')](function(_0x40f37e){_0x343e8e[_0x2c0c('0x2d')][_0x2c0c('0x31')](_0x9dcfe8[_0x40f37e]);});}delete _0x343e8e[_0x2c0c('0x2e')];}catch(_0xba5540){_0x3519b3(_0xba5540);}_0x29ffd6(_0x343e8e);});}function updateWhatsappInteraction(_0x364f19,_0x351e2a,_0x1b3d7c){return new BPromise(function(_0x554a45,_0x45406d){return getInteractionUsers(_0x364f19,_0x1b3d7c)[_0x2c0c('0x28')](function(_0x2840f6){return getInteractionTags(_0x2840f6,_0x351e2a);})[_0x2c0c('0x28')](function(_0x12dd28){_0x554a45(_0x12dd28);})[_0x2c0c('0x32')](function(_0x8128b3){_0x45406d(_0x8128b3);});});}exports['index']=function(_0x15d14b,_0x4d9380){var _0x41153d={},_0x308c29={},_0x3a921e={'count':0x0,'rows':[]};var _0x5b40a1=_['map'](db[_0x2c0c('0x33')][_0x2c0c('0x34')],function(_0x5091f5){return{'name':_0x5091f5['fieldName'],'type':_0x5091f5[_0x2c0c('0x35')][_0x2c0c('0x36')]};});_0x308c29[_0x2c0c('0x37')]=_['map'](_0x5b40a1,_0x2c0c('0x38'));_0x308c29[_0x2c0c('0x39')]=_[_0x2c0c('0x3a')](_0x15d14b[_0x2c0c('0x39')]);_0x308c29['filters']=_[_0x2c0c('0x3b')](_0x308c29[_0x2c0c('0x37')],_0x308c29[_0x2c0c('0x39')]);_0x41153d['attributes']=_[_0x2c0c('0x3b')](_0x308c29[_0x2c0c('0x37')],qs[_0x2c0c('0x3c')](_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x3c')]));_0x41153d['attributes']=_0x41153d[_0x2c0c('0x3d')][_0x2c0c('0x3e')]?_0x41153d[_0x2c0c('0x3d')]:_0x308c29['model'];if(!_0x15d14b[_0x2c0c('0x39')]['hasOwnProperty'](_0x2c0c('0x3f'))){_0x41153d[_0x2c0c('0x24')]=qs[_0x2c0c('0x24')](_0x15d14b['query']['limit']);_0x41153d['offset']=qs[_0x2c0c('0x23')](_0x15d14b['query'][_0x2c0c('0x23')]);}_0x41153d[_0x2c0c('0x40')]=qs[_0x2c0c('0x41')](_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x41')]);_0x41153d[_0x2c0c('0x42')]=qs[_0x2c0c('0x43')](_[_0x2c0c('0x44')](_0x15d14b[_0x2c0c('0x39')],_0x308c29[_0x2c0c('0x43')]),_0x5b40a1);var _0xf79571=[];var _0x1c7d0d=squel['select']()[_0x2c0c('0x45')]('id')['field'](_0x2c0c('0x38'))[_0x2c0c('0x45')](_0x2c0c('0x46'))[_0x2c0c('0x47')](_0x2c0c('0x48'));var _0x1e16d1=squel['select']()[_0x2c0c('0x45')](_0x2c0c('0x49'))[_0x2c0c('0x45')](_0x2c0c('0x4a'))[_0x2c0c('0x45')](_0x2c0c('0x4b'))[_0x2c0c('0x47')](_0x2c0c('0x4c'),'ui')['left_join'](_0x2c0c('0x4d'),'u',_0x2c0c('0x4e'));var _0x257655=squel['select']()[_0x2c0c('0x47')](_0x2c0c('0x4f'),'i')[_0x2c0c('0x50')](_0x2c0c('0x51'),'c',_0x2c0c('0x52'))[_0x2c0c('0x50')](_0x2c0c('0x4d'),'o',_0x2c0c('0x53'))[_0x2c0c('0x50')](_0x2c0c('0x54'),'a',_0x2c0c('0x55'))[_0x2c0c('0x50')]('whatsapp_messages','me',_0x2c0c('0x56'))[_0x2c0c('0x50')](_0x2c0c('0x57'),'it',_0x2c0c('0x58'))[_0x2c0c('0x50')](_0x2c0c('0x48'),'t','t.id\x20=\x20it.TagId');var _0x3477c6=squel[_0x2c0c('0x59')]();var _0x46d012=[];var _0x50d348=squel[_0x2c0c('0x59')]();var _0x512971;if(_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x5a')]){_0x512971=as[_0x2c0c('0x5b')](_0x15d14b[_0x2c0c('0x39')]['search']);var _0x32996a=_0x512971['sqlOperator'];for(var _0x217002=0x0;_0x217002<_0x512971[_0x2c0c('0x5c')]['length'];_0x217002++){var _0x595183=_0x512971[_0x2c0c('0x5c')][_0x217002];var _0x11f01f='i';var _0x3bf1e2=_[_0x2c0c('0x5d')](_0x5b40a1,[_0x2c0c('0x38'),_0x595183[_0x2c0c('0x45')]]);if(!_0x3bf1e2){switch(_0x595183[_0x2c0c('0x45')]){case _0x2c0c('0x5e'):if(_0x595183[_0x2c0c('0x5f')]==0x1){_0x257655['having']('`'+_0x595183[_0x2c0c('0x45')]+_0x2c0c('0x60'));}else{_0x257655[_0x2c0c('0x61')]('`'+_0x595183['field']+_0x2c0c('0x62'));}break;case _0x2c0c('0x63'):if(_0x595183[_0x2c0c('0x64')]===_0x2c0c('0x65')){if(_0x595183['value']['split']('\x20')[_0x2c0c('0x3e')]>0x1){_0x3477c6[_0x32996a](_0x2c0c('0x66'),qs[_0x2c0c('0x67')](_0x595183[_0x2c0c('0x5f')]),null);}else{var _0x23b11a='%'+_0x595183[_0x2c0c('0x5f')]+'%';_0x3477c6[_0x32996a](_0x2c0c('0x68'),_0x23b11a,_0x23b11a,_0x23b11a);}}else{_0x3bf1e2=_[_0x2c0c('0x5d')](_0x5b40a1,[_0x2c0c('0x38'),_0x2c0c('0x69')]);_0x595183[_0x2c0c('0x45')]='ContactId';_0xa8fecc=as[_0x2c0c('0x6a')](_0x11f01f,_0x3bf1e2[_0x2c0c('0x35')],_0x595183);_0x3477c6[_0x32996a](_0xa8fecc['text'],_0xa8fecc[_0x2c0c('0x5f')][_0x2c0c('0x6b')],_0xa8fecc[_0x2c0c('0x5f')][_0x2c0c('0x6c')]);}break;case _0x2c0c('0x6d'):var _0x1ded79=_0x595183['value'][_0x2c0c('0x2f')](',')[_0x2c0c('0x2b')](function(_0x361d37){return Number(_0x361d37);});_0x1ded79[_0x2c0c('0x30')](function(_0x1cfc1b){_0x50d348['or'](_0x2c0c('0x6e'),'%,'+_0x1cfc1b+',%');});_0x46d012=_[_0x2c0c('0x6f')](_0x46d012,_0x1ded79);break;case'User':if(_0x595183['operator']===_0x2c0c('0x65')){_0x3477c6[_0x32996a](_0x2c0c('0x70'),'%'+_0x595183[_0x2c0c('0x5f')]+'%',null);}else{_0x3bf1e2=_['find'](_0x5b40a1,[_0x2c0c('0x38'),_0x2c0c('0x71')]);_0x595183[_0x2c0c('0x45')]='UserId';_0xa8fecc=as[_0x2c0c('0x6a')](_0x11f01f,_0x3bf1e2[_0x2c0c('0x35')],_0x595183);_0x3477c6[_0x32996a](_0xa8fecc['text'],_0xa8fecc[_0x2c0c('0x5f')][_0x2c0c('0x6b')],_0xa8fecc[_0x2c0c('0x5f')]['end']);}break;case'body':_0xa8fecc=as['buildExpression']('me',null,_0x595183);_0x3477c6[_0x32996a](_0xa8fecc[_0x2c0c('0x72')],_0xa8fecc[_0x2c0c('0x5f')]['start'],_0xa8fecc[_0x2c0c('0x5f')][_0x2c0c('0x6c')]);break;}}else{var _0xa8fecc=as[_0x2c0c('0x6a')](_0x11f01f,_0x3bf1e2[_0x2c0c('0x35')],_0x595183);_0x3477c6[_0x32996a](_0xa8fecc[_0x2c0c('0x72')],_0xa8fecc['value']['start'],_0xa8fecc[_0x2c0c('0x5f')][_0x2c0c('0x6c')]);}}}else{var _0x1c2860=_(_0x15d14b['query'])[_0x2c0c('0x3a')]()[_0x2c0c('0x2b')](function(_0x259fa0){return _[_0x2c0c('0x73')](_0x5b40a1,[_0x2c0c('0x38'),_0x259fa0])?_0x259fa0:undefined;})[_0x2c0c('0x74')]()[_0x2c0c('0x5f')]();if(!_['isEmpty'](_0x1c2860)){_0x1c2860[_0x2c0c('0x30')](function(_0x3cf0ee){if(_0x3cf0ee===_0x2c0c('0x75')){_0x257655[_0x2c0c('0x42')](_0x2c0c('0x76'),[][_0x2c0c('0x77')](_0x15d14b['query'][_0x3cf0ee]));}else if(_0x3cf0ee===_0x2c0c('0x78')){var _0x367dfb=JSON['parse'](_0x15d14b[_0x2c0c('0x39')][_0x3cf0ee])[_0x2c0c('0x79')];var _0xc6b975=JSON[_0x2c0c('0x7a')](_0x15d14b[_0x2c0c('0x39')][_0x3cf0ee])[_0x2c0c('0x7b')];_0x257655[_0x2c0c('0x42')](_0x2c0c('0x7c'),_0x367dfb,_0xc6b975);}else{if(_0x15d14b[_0x2c0c('0x39')][_0x3cf0ee]===_0x2c0c('0x7d')){_0x257655[_0x2c0c('0x42')]('i.'+_0x3cf0ee+_0x2c0c('0x7e'));}else{_0x257655['where']('i.'+_0x3cf0ee+_0x2c0c('0x7f'),_0x15d14b[_0x2c0c('0x39')][_0x3cf0ee]);}}});}if(_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x80')]){if(_0x15d14b[_0x2c0c('0x39')]['read']==0x1){_0x257655[_0x2c0c('0x61')]('`unreadMessages`\x20=\x200');}else{_0x257655[_0x2c0c('0x61')](_0x2c0c('0x81'));}}if(_0x15d14b[_0x2c0c('0x39')]['tag']){_0x46d012=_[_0x2c0c('0x82')](_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x83')])?_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x83')]:new Array(_0x15d14b['query'][_0x2c0c('0x83')]);_0x46d012[_0x2c0c('0x30')](function(_0x1ad558){_0x50d348['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1ad558+',%');});}if(_0x15d14b[_0x2c0c('0x39')]['filter']){var _0x39d56=_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x84')][_0x2c0c('0x85')]('\x5c','\x5c\x5c')[_0x2c0c('0x85')](/'/g,'\x27\x27');if(qs[_0x2c0c('0x86')](_0x39d56)){_0x3477c6['or'](_0x2c0c('0x87'),_0x39d56+'%')['or'](_0x2c0c('0x88'),_0x39d56+'%');}else{_0x3477c6['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2c0c('0x67')](_0x39d56))['or'](_0x2c0c('0x89'),_0x39d56+'%');}}}_0x257655[_0x2c0c('0x42')](_0x3477c6);_0x257655['group'](_0x2c0c('0x8a'));var _0x458243={'type':db['Sequelize'][_0x2c0c('0x8b')]['SELECT'],'raw':!![]};var _0x16908b=_0x257655[_0x2c0c('0x8c')]();_0x16908b[_0x2c0c('0x45')](_0x2c0c('0x8a'));_0x16908b[_0x2c0c('0x45')](_0x2c0c('0x8d'),_0x2c0c('0x5e'));if(_0x41153d[_0x2c0c('0x40')]){_0x41153d['order'][_0x2c0c('0x30')](function(_0x48c68b){var _0x592edc=_0x48c68b[0x0]==='contactName'?_0x48c68b[0x0]:'i.'+_0x48c68b[0x0];_0x257655['order'](_0x592edc,_0x48c68b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2c0c('0x8e')](_0x46d012)){_0x257655[_0x2c0c('0x61')](_0x50d348);_0x16908b[_0x2c0c('0x42')](_0x2c0c('0x8f'),_0x46d012);}BPromise[_0x2c0c('0x90')]()['then'](function(){if(!_0x512971){if(_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x75')])return;_0x16908b[_0x2c0c('0x42')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x257655['where'](_0x2c0c('0x91'));return;}if(_0x15d14b[_0x2c0c('0x92')]['role']!==_0x2c0c('0x93'))return;return _0x15d14b[_0x2c0c('0x92')][_0x2c0c('0x94')]({'attributes':['id'],'raw':!![]})[_0x2c0c('0x28')](function(_0x353232){if(_[_0x2c0c('0x8e')](_0x353232)){_0x16908b[_0x2c0c('0x42')](_0x2c0c('0x95'));_0x257655['where'](_0x2c0c('0x95'));}else{_0x16908b[_0x2c0c('0x42')](_0x2c0c('0x76'),_[_0x2c0c('0x2b')](_0x353232,'id'));_0x257655['where']('i.WhatsappAccountId\x20IN\x20?',_[_0x2c0c('0x2b')](_0x353232,'id'));}});})[_0x2c0c('0x28')](function(){if(_0x15d14b['user'][_0x2c0c('0x96')]===_0x2c0c('0x93')&&!_0x512971&&!_0x15d14b['query'][_0x2c0c('0x75')])return[];return db[_0x2c0c('0x97')][_0x2c0c('0x39')](_0x16908b['toString'](),_0x458243);})[_0x2c0c('0x28')](function(_0x385318){_0x3a921e[_0x2c0c('0x98')]=_0x385318['length'];if(_0x3a921e[_0x2c0c('0x98')]===0x0)return[];return db['sequelize'][_0x2c0c('0x39')](_0x1c7d0d['toString'](),_0x458243)['then'](function(_0x168d95){_0xf79571=_['keyBy'](_0x168d95,'id');_0x458243=_[_0x2c0c('0x99')](_0x458243,{'model':db[_0x2c0c('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15d14b[_0x2c0c('0x39')][_0x2c0c('0x3c')]){_0x41153d[_0x2c0c('0x3d')][_0x2c0c('0x30')](function(_0x20e0c8){_0x257655[_0x2c0c('0x45')]('i.'+_0x20e0c8);});}else{_0x257655[_0x2c0c('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x257655['field'](_0x2c0c('0x9a'),'Account.key');_0x257655[_0x2c0c('0x45')](_0x2c0c('0x9b'),_0x2c0c('0x9c'));_0x257655[_0x2c0c('0x45')](_0x2c0c('0x9d'),'contactName');_0x257655[_0x2c0c('0x45')](_0x2c0c('0x9e'));_0x257655['field'](_0x2c0c('0x9f'),_0x2c0c('0xa0'));_0x257655[_0x2c0c('0x45')](_0x2c0c('0xa1'),_0x2c0c('0xa2'));_0x257655[_0x2c0c('0x45')]('c.email',_0x2c0c('0xa3'));_0x257655[_0x2c0c('0x45')](_0x2c0c('0xa4'),'Contact.phone');_0x257655['field'](_0x2c0c('0xa5'),_0x2c0c('0xa6'));_0x257655['field'](_0x2c0c('0xa7'),'Contact.fax');_0x257655[_0x2c0c('0x45')]('o.fullname',_0x2c0c('0xa8'));_0x257655[_0x2c0c('0x45')](_0x2c0c('0xa9'),_0x2c0c('0xaa'));_0x257655[_0x2c0c('0x45')](_0x2c0c('0xab'),_0x2c0c('0x2e'));}if(_0x41153d['limit'])_0x257655[_0x2c0c('0x24')](_0x41153d['limit']);if(_0x41153d[_0x2c0c('0x23')])_0x257655[_0x2c0c('0x23')](_0x41153d[_0x2c0c('0x23')]);return db[_0x2c0c('0x97')][_0x2c0c('0x39')](_0x257655[_0x2c0c('0xac')](),_0x458243);})[_0x2c0c('0x28')](function(_0x33ca32){if(_0x33ca32[_0x2c0c('0x3e')]>0x0)_0x1e16d1[_0x2c0c('0x42')](_0x2c0c('0xad'),_[_0x2c0c('0x2b')](_0x33ca32,'id'));return db[_0x2c0c('0x97')][_0x2c0c('0x39')](_0x1e16d1[_0x2c0c('0xac')](),_0x458243)[_0x2c0c('0x28')](function(_0xaed0a7){var _0x7092e3=_[_0x2c0c('0xae')](_0xaed0a7,_0x2c0c('0xaf'));var _0x5aa42f=[];_0x33ca32['forEach'](function(_0x2eef69){_0x5aa42f[_0x2c0c('0x31')](updateWhatsappInteraction(_0x2eef69,_0xf79571,_0x7092e3));});return BPromise[_0x2c0c('0xb0')](_0x5aa42f);});});})[_0x2c0c('0x28')](function(_0x25bd70){_0x3a921e[_0x2c0c('0xb1')]=_0x25bd70;return _0x3a921e;})['then'](respondWithFilteredResult(_0x4d9380,_0x41153d))[_0x2c0c('0x32')](handleError(_0x4d9380,null));};exports[_0x2c0c('0xb2')]=function(_0x576b26,_0x537140){var _0x10f844={'raw':![],'where':{'id':_0x576b26['params']['id']}},_0x44e81d={};_0x44e81d['model']=_['keys'](db[_0x2c0c('0x33')][_0x2c0c('0x34')]);_0x44e81d[_0x2c0c('0x39')]=_[_0x2c0c('0x3a')](_0x576b26[_0x2c0c('0x39')]);_0x44e81d[_0x2c0c('0x43')]=_[_0x2c0c('0x3b')](_0x44e81d['model'],_0x44e81d[_0x2c0c('0x39')]);_0x10f844[_0x2c0c('0x3d')]=_['intersection'](_0x44e81d['model'],qs[_0x2c0c('0x3c')](_0x576b26[_0x2c0c('0x39')][_0x2c0c('0x3c')]));_0x10f844[_0x2c0c('0x3d')]=_0x10f844[_0x2c0c('0x3d')][_0x2c0c('0x3e')]?_0x10f844[_0x2c0c('0x3d')]:_0x44e81d[_0x2c0c('0x37')];if(_0x576b26[_0x2c0c('0x39')][_0x2c0c('0xb3')]){_0x10f844['include']=[{'all':!![]}];}_0x10f844=_[_0x2c0c('0x99')]({},_0x10f844,_0x576b26[_0x2c0c('0xb4')]);return db[_0x2c0c('0x33')][_0x2c0c('0x5d')](_0x10f844)[_0x2c0c('0x28')](handleEntityNotFound(_0x537140,null))[_0x2c0c('0x28')](respondWithResult(_0x537140,null))[_0x2c0c('0x32')](handleError(_0x537140,null));};exports[_0x2c0c('0xb5')]=function(_0x12c227,_0x24dbc0){return db[_0x2c0c('0x33')]['create'](_0x12c227[_0x2c0c('0xb6')],{})['then'](respondWithResult(_0x24dbc0,0xc9))[_0x2c0c('0x32')](handleError(_0x24dbc0,null));};exports[_0x2c0c('0xb7')]=function(_0x295cdd,_0x35f00c){if(_0x295cdd[_0x2c0c('0xb6')]['id']){delete _0x295cdd[_0x2c0c('0xb6')]['id'];}return db[_0x2c0c('0x33')][_0x2c0c('0x5d')]({'where':{'id':_0x295cdd[_0x2c0c('0xb8')]['id']}})[_0x2c0c('0x28')](handleEntityNotFound(_0x35f00c,null))[_0x2c0c('0x28')](saveUpdates(_0x295cdd[_0x2c0c('0xb6')],null))[_0x2c0c('0x28')](respondWithResult(_0x35f00c,null))['catch'](handleError(_0x35f00c,null));};exports[_0x2c0c('0xb9')]=function(_0x36b5b8,_0x1a1004){return db['WhatsappInteraction'][_0x2c0c('0x5d')]({'where':{'id':_0x36b5b8['params']['id']}})[_0x2c0c('0x28')](handleEntityNotFound(_0x1a1004,null))[_0x2c0c('0x28')](removeEntity(_0x1a1004,null))[_0x2c0c('0x32')](handleError(_0x1a1004,null));};exports[_0x2c0c('0xba')]=function(_0x20fe0f,_0x113e67){return db['WhatsappInteraction'][_0x2c0c('0xba')]()['then'](respondWithResult(_0x113e67,null))[_0x2c0c('0x32')](handleError(_0x113e67,null));};exports[_0x2c0c('0xbb')]=function(_0x2b6044,_0x4ea9c4,_0x20ed04){return db['WhatsappMessage']['find']({'where':{'id':_0x2b6044[_0x2c0c('0xb8')]['id']}})[_0x2c0c('0x28')](handleEntityNotFound(_0x4ea9c4,null))['then'](function(_0x1daf01){if(_0x1daf01){return _0x1daf01[_0x2c0c('0xbb')](_0x2b6044['body'][_0x2c0c('0xbc')],_[_0x2c0c('0xbd')](_0x2b6044['body'],[_0x2c0c('0xbc'),'id'])||{});}})[_0x2c0c('0x28')](respondWithResult(_0x4ea9c4,null))[_0x2c0c('0x32')](handleError(_0x4ea9c4,null));};exports[_0x2c0c('0xbe')]=function(_0x3d4398,_0x378a45,_0x55d3c1){var _0x54395b={'raw':![],'where':{}};var _0x6105df={};var _0x11e483={'count':0x0,'rows':[]};return db[_0x2c0c('0x33')][_0x2c0c('0xbf')]({'where':{'id':_0x3d4398[_0x2c0c('0xb8')]['id']}})[_0x2c0c('0x28')](handleEntityNotFound(_0x378a45,null))[_0x2c0c('0x28')](function(_0x6b2f7c){if(_0x6b2f7c){_0x6105df[_0x2c0c('0x37')]=_[_0x2c0c('0x3a')](db[_0x2c0c('0xc0')][_0x2c0c('0x34')]);_0x6105df[_0x2c0c('0x39')]=_[_0x2c0c('0x3a')](_0x3d4398['query']);_0x6105df[_0x2c0c('0x43')]=_[_0x2c0c('0x3b')](_0x6105df[_0x2c0c('0x37')],_0x6105df[_0x2c0c('0x39')]);_0x54395b[_0x2c0c('0x3d')]=_['intersection'](_0x6105df['model'],qs['fields'](_0x3d4398[_0x2c0c('0x39')][_0x2c0c('0x3c')]));_0x54395b['attributes']=_0x54395b['attributes'][_0x2c0c('0x3e')]?_0x54395b[_0x2c0c('0x3d')]:_0x6105df[_0x2c0c('0x37')];if(!_0x3d4398[_0x2c0c('0x39')]['hasOwnProperty']('nolimit')){_0x54395b[_0x2c0c('0x24')]=qs[_0x2c0c('0x24')](_0x3d4398[_0x2c0c('0x39')][_0x2c0c('0x24')]);_0x54395b[_0x2c0c('0x23')]=qs['offset'](_0x3d4398[_0x2c0c('0x39')][_0x2c0c('0x23')]);}_0x54395b['order']=qs[_0x2c0c('0x41')](_0x3d4398[_0x2c0c('0x39')]['sort']);_0x54395b[_0x2c0c('0x42')]=qs[_0x2c0c('0x43')](_[_0x2c0c('0x44')](_0x3d4398[_0x2c0c('0x39')],_0x6105df[_0x2c0c('0x43')]));_0x54395b[_0x2c0c('0x42')][_0x2c0c('0xaf')]=_0x6b2f7c['id'];if(_0x3d4398[_0x2c0c('0x39')][_0x2c0c('0x84')]){_0x54395b[_0x2c0c('0x42')]=_[_0x2c0c('0x99')](_0x54395b[_0x2c0c('0x42')],{'$or':_[_0x2c0c('0x2b')](_0x54395b[_0x2c0c('0x3d')],function(_0x1a876d){var _0x4f6f75={};_0x4f6f75[_0x1a876d]={'$like':'%'+_0x3d4398[_0x2c0c('0x39')][_0x2c0c('0x84')]+'%'};return _0x4f6f75;})});}if(_0x3d4398[_0x2c0c('0x39')]['$gte']){var _0x24dc20=_0x3d4398['query'][_0x2c0c('0x79')][_0x2c0c('0x2f')](',');var _0x431f4a={};_0x431f4a[_0x24dc20[0x0]]={'$gte':moment(_0x24dc20[0x1])[_0x2c0c('0xc1')](_0x2c0c('0xc2'))};_0x54395b[_0x2c0c('0x42')]=_[_0x2c0c('0x99')](_0x54395b['where'],_0x431f4a);}_0x54395b=_['merge']({},_0x54395b,_0x3d4398[_0x2c0c('0xb4')]);return db[_0x2c0c('0xc0')][_0x2c0c('0x98')]({'where':_0x54395b[_0x2c0c('0x42')]})[_0x2c0c('0x28')](function(_0x358e70){_0x11e483[_0x2c0c('0x98')]=_0x358e70;if(_0x3d4398[_0x2c0c('0x39')][_0x2c0c('0xb3')]){_0x54395b[_0x2c0c('0xc3')]=[{'all':!![]}];}return db[_0x2c0c('0xc0')]['findAll'](_0x54395b);})[_0x2c0c('0x28')](function(_0x592197){_0x11e483[_0x2c0c('0xb1')]=_0x592197;return _0x11e483;});}})['then'](respondWithFilteredResult(_0x378a45,_0x54395b))[_0x2c0c('0x32')](handleError(_0x378a45,null));};exports[_0x2c0c('0xc4')]=function(_0x5ba5d4,_0x4756ee,_0x48720f){return db[_0x2c0c('0x33')][_0x2c0c('0x5d')]({'where':{'id':_0x5ba5d4[_0x2c0c('0xb8')]['id']}})['then'](handleEntityNotFound(_0x4756ee,null))['then'](function(_0x2bb9ce){if(_0x2bb9ce){return _0x2bb9ce['setTags'](_0x5ba5d4[_0x2c0c('0xb6')]['ids'],_[_0x2c0c('0xbd')](_0x5ba5d4['body'],[_0x2c0c('0xbc'),'id'])||{})[_0x2c0c('0xc5')](function(){return db[_0x2c0c('0x6d')]['findAll']({'attributes':['id',_0x2c0c('0x38'),_0x2c0c('0x46')],'where':{'id':_0x5ba5d4[_0x2c0c('0xb6')][_0x2c0c('0xbc')]}});})[_0x2c0c('0x28')](function(_0x29bf66){socket['emit'](_0x2c0c('0xc6'),{'id':Number(_0x5ba5d4['params']['id']),'tags':_0x29bf66||[]});return{'id':Number(_0x5ba5d4[_0x2c0c('0xb8')]['id']),'tags':_0x29bf66||[]};});}})[_0x2c0c('0x28')](respondWithResult(_0x4756ee,null))[_0x2c0c('0x32')](handleError(_0x4756ee,null));};exports[_0x2c0c('0xc7')]=function(_0x52d96b,_0x4cda51,_0x182c03){return db['WhatsappInteraction']['find']({'where':{'id':_0x52d96b['params']['id']}})[_0x2c0c('0x28')](handleEntityNotFound(_0x4cda51,null))[_0x2c0c('0x28')](function(_0x930357){if(_0x930357){return _0x930357['removeTags'](_0x52d96b[_0x2c0c('0x39')]['ids']);}})[_0x2c0c('0x28')](respondWithStatusCode(_0x4cda51,null))[_0x2c0c('0x32')](handleError(_0x4cda51,null));};exports['download']=function(_0x580839,_0x55e743){var _0x2dc4f1=moment()['unix']()['toString']();var _0x5831e6=path[_0x2c0c('0xc8')](config[_0x2c0c('0xc9')],_0x2c0c('0xca'),_0x2c0c('0xcb'),_0x2c0c('0xcc'));var _0x3359bf=path['join'](config[_0x2c0c('0xc9')],_0x2c0c('0xca'),'files',_0x2c0c('0xcd'));var _0x418b1f=path[_0x2c0c('0xc8')](_0x5831e6,_0x2dc4f1);var _0xf696d8=util[_0x2c0c('0xc1')](_0x2c0c('0xce'),_0x580839[_0x2c0c('0xb8')]['id'],_0x2dc4f1);var _0x38add1=path[_0x2c0c('0xc8')](_0x5831e6,_0xf696d8);var _0x1e42be=[];_0x1e42be[_0x2c0c('0x31')]({'model':db['User'],'as':'User','attributes':['id',_0x2c0c('0x2c')],'raw':!![]});_0x1e42be[_0x2c0c('0x31')]({'model':db[_0x2c0c('0xcf')],'as':_0x2c0c('0x63'),'attributes':['id',_0x2c0c('0xd0'),'lastName'],'raw':!![]});if(_0x580839[_0x2c0c('0x39')]['attachments']){_0x1e42be[_0x2c0c('0x31')]({'model':db[_0x2c0c('0xd1')],'as':_0x2c0c('0xd1'),'raw':!![]});}var _0x3622fa=[{'model':db[_0x2c0c('0xc0')],'as':_0x2c0c('0xd2'),'attributes':['id',_0x2c0c('0xb6'),_0x2c0c('0x78'),'direction',_0x2c0c('0xd3'),'read'],'include':_0x1e42be}];_0x3622fa['push']({'model':db[_0x2c0c('0xd4')],'as':_0x2c0c('0xd5'),'attributes':['id',_0x2c0c('0x38')]});_0x3622fa[_0x2c0c('0x31')]({'model':db[_0x2c0c('0xd6')],'as':_0x2c0c('0xd7'),'attributes':['id',_0x2c0c('0x2c')]});return db[_0x2c0c('0x33')][_0x2c0c('0x5d')]({'where':{'id':_0x580839[_0x2c0c('0xb8')]['id']},'include':_0x3622fa})[_0x2c0c('0x28')](handleEntityNotFound(_0x55e743,null))[_0x2c0c('0x28')](function(_0x429f71){if(_0x429f71){var _0x3caebd=_0x429f71[_0x2c0c('0xd8')]({'plain':!![]});fs[_0x2c0c('0xd9')](_0x418b1f);var _0x2df693={'channel':'Whatsapp','account':_0x3caebd[_0x2c0c('0xd5')][_0x2c0c('0x38')],'agent':_0x3caebd[_0x2c0c('0xd7')]?_0x3caebd[_0x2c0c('0xd7')][_0x2c0c('0x2c')]:'N.A.','createdAt':moment(_0x3caebd['createdAt'])[_0x2c0c('0xc1')](_0x2c0c('0xc2'))[_0x2c0c('0xac')](),'closedAt':_0x3caebd['closed']?moment(_0x3caebd[_0x2c0c('0xda')])[_0x2c0c('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2c0c('0xac')]():'','disposition':_0x3caebd[_0x2c0c('0xdb')],'messages':_(_0x3caebd['Messages'])[_0x2c0c('0x84')]({'secret':![]})['map'](function(_0x1cc012){if(_0x1cc012['Attachment']){var _0x11fa3f=path[_0x2c0c('0xc8')](_0x3359bf,_0x1cc012[_0x2c0c('0xd1')][_0x2c0c('0xdc')]);if(fs['existsSync'](_0x11fa3f)){fs['createReadStream'](_0x11fa3f)['pipe'](fs[_0x2c0c('0xdd')](path['join'](_0x418b1f,_0x1cc012[_0x2c0c('0xd1')][_0x2c0c('0xdc')])));}}return{'date':moment(_0x1cc012[_0x2c0c('0x78')])[_0x2c0c('0xc1')](_0x2c0c('0xc2'))['toString'](),'sender':_0x1cc012['direction']==='out'?_0x1cc012['User']?_0x1cc012[_0x2c0c('0xd6')][_0x2c0c('0x2c')]:_0x2c0c('0xde'):_0x1cc012[_0x2c0c('0x63')][_0x2c0c('0xd0')]+(_0x1cc012[_0x2c0c('0x63')][_0x2c0c('0xdf')]?'\x20'+_0x1cc012[_0x2c0c('0x63')]['lastName']:''),'body':_0x1cc012[_0x2c0c('0xd1')]?_0x1cc012[_0x2c0c('0xd1')][_0x2c0c('0xdc')]:_0x1cc012[_0x2c0c('0xb6')],'direction':_0x1cc012[_0x2c0c('0xe0')]===_0x2c0c('0xe1')?'A':'C','secret':_0x1cc012['secret'],'read':_0x1cc012['read'],'attachment':_0x1cc012['Attachment']};})[_0x2c0c('0x5f')]()};return ejs['renderFile'](path['join'](config[_0x2c0c('0xc9')],_0x2c0c('0xca'),_0x2c0c('0xe2'),_0x2c0c('0xe3')),{'interaction':_0x2df693})[_0x2c0c('0x28')](function(_0x320b10){var _0x11b815=path[_0x2c0c('0xc8')](_0x418b1f,_0x2c0c('0xe4')+_0x3caebd['id']+'-'+_0x2dc4f1+'.pdf');var _0x3e1276={'path':_0x11b815,'channel':_0x2c0c('0xe5'),'interactionId':_0x3caebd['id']};return pdf['createPdfFromHTML'](_0x320b10,_0x3e1276);})[_0x2c0c('0x28')](function(){return new BPromise(function(_0x46967d,_0x2256c3){zipdir(_0x418b1f,{'saveTo':_0x38add1},function(_0xc6e32c,_0x5c8a6f){if(_0xc6e32c)return _0x2256c3(_0xc6e32c);return _0x46967d(_0x5c8a6f);});})[_0x2c0c('0x28')](function(){return new BPromise(function(_0x1e1052,_0x2ea38a){rimraf(_0x418b1f,function(_0x4b993b){if(_0x4b993b)_0x2ea38a(_0x4b993b);return _0x1e1052();});});})[_0x2c0c('0x28')](function(){return _0x55e743[_0x2c0c('0xe6')](_0x38add1,_0xf696d8,function(_0x13e56f){if(_0x13e56f){console[_0x2c0c('0xe7')](_0x2c0c('0xe8'),_0x13e56f);}else{fs['unlinkSync'](_0x38add1);}});});});}else{return _0x55e743[_0x2c0c('0x20')](0xc8);}})[_0x2c0c('0x32')](handleError(_0x55e743,null));};
\ No newline at end of file
index 4e9fa94..405e9e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30fe=['setDataValue','Users','map','findAll','length','emit','catch','hook','exports','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then'];(function(_0x3b4ee1,_0x2290c9){var _0x22c913=function(_0x176483){while(--_0x176483){_0x3b4ee1['push'](_0x3b4ee1['shift']());}};_0x22c913(++_0x2290c9);}(_0x30fe,0x149));var _0xe30f=function(_0x4efe7a,_0xa51c27){_0x4efe7a=_0x4efe7a-0x0;var _0x421ffc=_0x30fe[_0x4efe7a];return _0x421ffc;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xe30f('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xe30f('0x0'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe30f('0x1')](0x0);var events={'afterCreate':_0xe30f('0x2'),'afterUpdate':_0xe30f('0x3'),'afterDestroy':_0xe30f('0x4')};function emitEvent(_0x21059a){return function(_0x5090a2,_0x45649b,_0x1e2055){_0x5090a2[_0xe30f('0x5')]({'attributes':['id'],'raw':!![]})[_0xe30f('0x6')](function(_0x442a51){_0x5090a2[_0xe30f('0x7')](_0xe30f('0x8'),_0x442a51[_0xe30f('0x9')](function(_0x28a134){return{'id':_0x28a134['id']};}));return WhatsappMessage[_0xe30f('0xa')]({'where':{'WhatsappInteractionId':_0x5090a2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2c5eab){_0x5090a2[_0xe30f('0x7')]('unreadMessages',_0x2c5eab[_0xe30f('0xb')]);WhatsappInteractionEvents[_0xe30f('0xc')](_0x21059a+':'+_0x5090a2['id'],_0x5090a2);WhatsappInteractionEvents[_0xe30f('0xc')](_0x21059a,_0x5090a2);_0x1e2055(null);})[_0xe30f('0xd')](_0x1e2055(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xe30f('0xe')](e,emitEvent(event));}}module[_0xe30f('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xa74f=['exports','WhatsappInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x34756e,_0x3c036a){var _0x365e63=function(_0xc96601){while(--_0xc96601){_0x34756e['push'](_0x34756e['shift']());}};_0x365e63(++_0x3c036a);}(_0xa74f,0x9a));var _0xfa74=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xa74f[_0x210603];return _0x1bcb7d;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0xfa74('0x0')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfa74('0x1')](0x0);var events={'afterCreate':_0xfa74('0x2'),'afterUpdate':_0xfa74('0x3'),'afterDestroy':_0xfa74('0x4')};function emitEvent(_0x5b367b){return function(_0x141625,_0x4efc79,_0x543cfe){_0x141625[_0xfa74('0x5')]({'attributes':['id'],'raw':!![]})[_0xfa74('0x6')](function(_0x3ac32e){_0x141625[_0xfa74('0x7')](_0xfa74('0x8'),_0x3ac32e[_0xfa74('0x9')](function(_0x5c0eb2){return{'id':_0x5c0eb2['id']};}));return WhatsappMessage[_0xfa74('0xa')]({'where':{'WhatsappInteractionId':_0x141625['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfa74('0x6')](function(_0x355e37){_0x141625[_0xfa74('0x7')]('unreadMessages',_0x355e37[_0xfa74('0xb')]);WhatsappInteractionEvents[_0xfa74('0xc')](_0x5b367b+':'+_0x141625['id'],_0x141625);WhatsappInteractionEvents['emit'](_0x5b367b,_0x141625);_0x543cfe(null);})[_0xfa74('0xd')](_0x543cfe(null));};}for(var e in events){if(events[_0xfa74('0xe')](e)){var event=events[e];WhatsappInteraction[_0xfa74('0xf')](e,emitEvent(event));}}module[_0xfa74('0x10')]=WhatsappInteractionEvents;
\ No newline at end of file
index 0e66b5e..53d55c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0a0=['WhatsappInteraction','whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x30af23,_0x1b9d6a){var _0x5cea96=function(_0x31be06){while(--_0x31be06){_0x30af23['push'](_0x30af23['shift']());}};_0x5cea96(++_0x1b9d6a);}(_0xc0a0,0x14f));var _0x0c0a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xc0a0[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x0c0a('0x0'));var util=require(_0x0c0a('0x1'));var logger=require('../../config/logger')(_0x0c0a('0x2'));var moment=require('moment');var BPromise=require(_0x0c0a('0x3'));var rp=require(_0x0c0a('0x4'));var fs=require('fs');var path=require(_0x0c0a('0x5'));var rimraf=require(_0x0c0a('0x6'));var config=require(_0x0c0a('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0x0c0a('0x8')]=function(_0x442048,_0x25386f){return _0x442048[_0x0c0a('0x9')](_0x0c0a('0xa'),attributes,{'tableName':_0x0c0a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x448393,_0x680274,_0x1ac50e){if(_0x448393['changed']('closed')){_0x448393[_0x0c0a('0xc')]=moment()[_0x0c0a('0xd')](_0x0c0a('0xe'));}_0x1ac50e(null,_0x448393);}}});};
\ No newline at end of file
+var _0x3f23=['rimraf','../../config/environment','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x16533f,_0x3de254){var _0x372567=function(_0xfbc00f){while(--_0xfbc00f){_0x16533f['push'](_0x16533f['shift']());}};_0x372567(++_0x3de254);}(_0x3f23,0x189));var _0x33f2=function(_0x300048,_0x202bae){_0x300048=_0x300048-0x0;var _0x4385fa=_0x3f23[_0x300048];return _0x4385fa;};'use strict';var _=require(_0x33f2('0x0'));var util=require('util');var logger=require(_0x33f2('0x1'))(_0x33f2('0x2'));var moment=require(_0x33f2('0x3'));var BPromise=require(_0x33f2('0x4'));var rp=require(_0x33f2('0x5'));var fs=require('fs');var path=require(_0x33f2('0x6'));var rimraf=require(_0x33f2('0x7'));var config=require(_0x33f2('0x8'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x1e534e,_0x999b42){return _0x1e534e[_0x33f2('0x9')](_0x33f2('0xa'),attributes,{'tableName':_0x33f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x26fb89,_0x40fa4f,_0x36d037){if(_0x26fb89['changed'](_0x33f2('0xc'))){_0x26fb89[_0x33f2('0xd')]=moment()[_0x33f2('0xe')](_0x33f2('0xf'));}_0x36d037(null,_0x26fb89);}}});};
\ No newline at end of file
index 1fb8d29..5945a7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7693=['debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','catch','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','ids','AddTags','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappInteraction.socket','request','then','info','request\x20sent'];(function(_0x2bbe14,_0x5a3e62){var _0x19d01d=function(_0x49a18c){while(--_0x49a18c){_0x2bbe14['push'](_0x2bbe14['shift']());}};_0x19d01d(++_0x5a3e62);}(_0x7693,0x1b7));var _0x3769=function(_0x2b19a5,_0x189ec9){_0x2b19a5=_0x2b19a5-0x0;var _0x429e96=_0x7693[_0x2b19a5];return _0x429e96;};'use strict';var _=require(_0x3769('0x0'));var util=require(_0x3769('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3769('0x2'));var fs=require('fs');var Redis=require(_0x3769('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3769('0x4'));var logger=require('../../config/logger')(_0x3769('0x5'));var config=require(_0x3769('0x6'));var jayson=require(_0x3769('0x7'));var client=jayson[_0x3769('0x8')]['http']({'port':0x232a});config[_0x3769('0x9')]=_[_0x3769('0xa')](config['redis'],{'host':_0x3769('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3769('0x9')]));require(_0x3769('0xc'))['register'](socket);function respondWithRpcPromise(_0x1edad1,_0x1d101c,_0xa253b5){return new BPromise(function(_0x22358e,_0x18d702){return client[_0x3769('0xd')](_0x1edad1,_0xa253b5)[_0x3769('0xe')](function(_0x4e3c72){logger[_0x3769('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d101c,_0x3769('0x10'));logger[_0x3769('0x11')](_0x3769('0x12'),_0x1d101c,'request\x20sent',JSON[_0x3769('0x13')](_0x4e3c72));if(_0x4e3c72[_0x3769('0x14')]){if(_0x4e3c72['error'][_0x3769('0x15')]===0x1f4){logger[_0x3769('0x14')](_0x3769('0x16'),_0x1d101c,_0x4e3c72[_0x3769('0x14')][_0x3769('0x17')]);return _0x18d702(_0x4e3c72[_0x3769('0x14')][_0x3769('0x17')]);}logger['error'](_0x3769('0x16'),_0x1d101c,_0x4e3c72[_0x3769('0x14')][_0x3769('0x17')]);return _0x22358e(_0x4e3c72[_0x3769('0x14')][_0x3769('0x17')]);}else{logger[_0x3769('0xf')](_0x3769('0x16'),_0x1d101c,_0x3769('0x10'));_0x22358e(_0x4e3c72['result'][_0x3769('0x17')]);}})[_0x3769('0x18')](function(_0x545984){logger[_0x3769('0x14')](_0x3769('0x16'),_0x1d101c,_0x545984);_0x18d702(_0x545984);});});}exports['UpdateWhatsappInteraction']=function(_0xca80bc){var _0x24228e=this;return new Promise(function(_0xefdcd6,_0x46220c){return db['WhatsappInteraction'][_0x3769('0x19')](_0xca80bc[_0x3769('0x1a')],{'raw':_0xca80bc[_0x3769('0x1b')]?_0xca80bc[_0x3769('0x1b')][_0x3769('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xca80bc[_0x3769('0x1b')]?_0xca80bc[_0x3769('0x1b')][_0x3769('0x1d')]||null:null,'attributes':_0xca80bc[_0x3769('0x1b')]?_0xca80bc[_0x3769('0x1b')][_0x3769('0x1e')]||null:null,'limit':_0xca80bc[_0x3769('0x1b')]?_0xca80bc[_0x3769('0x1b')][_0x3769('0x1f')]||null:null})[_0x3769('0xe')](function(_0x41c9ba){logger['info'](_0x3769('0x20'),_0xca80bc);logger[_0x3769('0x11')](_0x3769('0x20'),_0xca80bc,JSON['stringify'](_0x41c9ba));_0xefdcd6(_0x41c9ba);})[_0x3769('0x18')](function(_0x54aedb){logger[_0x3769('0x14')](_0x3769('0x20'),_0x54aedb['message'],_0xca80bc);_0x46220c(_0x24228e['error'](0x1f4,_0x54aedb[_0x3769('0x17')]));});});};exports[_0x3769('0x21')]=function(_0x7ab145){return new Promise(function(_0x5e2771,_0xaef70){return db[_0x3769('0x22')]['find']({'where':_0x7ab145[_0x3769('0x1b')]?_0x7ab145['options']['where']||null:null})[_0x3769('0xe')](function(_0x47d3f5){if(_0x47d3f5){return _0x47d3f5[_0x3769('0x23')](_0x7ab145['body']['ids'],_['omit'](_0x7ab145[_0x3769('0x1a')],[_0x3769('0x24'),'id'])||{});}})['spread'](function(_0x8ba3c9){logger[_0x3769('0xf')](_0x3769('0x25'),_0x7ab145);logger[_0x3769('0x11')](_0x3769('0x25'),_0x7ab145,JSON[_0x3769('0x13')](_0x8ba3c9));_0x5e2771(_0x8ba3c9);})[_0x3769('0x18')](function(_0x2e8e8f){logger[_0x3769('0x14')](_0x3769('0x25'),_0x2e8e8f[_0x3769('0x17')],_0x7ab145);_0xaef70(_this[_0x3769('0x14')](0x1f4,_0x2e8e8f[_0x3769('0x17')]));});});};
\ No newline at end of file
+var _0x2004=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappInteraction','update','body','options','raw','where','attributes','then','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags'];(function(_0x1d864c,_0x23e41e){var _0x1aaefd=function(_0x359e69){while(--_0x359e69){_0x1d864c['push'](_0x1d864c['shift']());}};_0x1aaefd(++_0x23e41e);}(_0x2004,0x13f));var _0x4200=function(_0x919629,_0x2edc8c){_0x919629=_0x919629-0x0;var _0x2e8c2b=_0x2004[_0x919629];return _0x2e8c2b;};'use strict';var _=require(_0x4200('0x0'));var util=require(_0x4200('0x1'));var moment=require(_0x4200('0x2'));var BPromise=require(_0x4200('0x3'));var rs=require(_0x4200('0x4'));var fs=require('fs');var Redis=require(_0x4200('0x5'));var db=require(_0x4200('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4200('0x7'))(_0x4200('0x8'));var config=require(_0x4200('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4200('0xa')][_0x4200('0xb')]({'port':0x232a});config[_0x4200('0xc')]=_[_0x4200('0xd')](config[_0x4200('0xc')],{'host':_0x4200('0xe'),'port':0x18eb});var socket=require(_0x4200('0xf'))(new Redis(config[_0x4200('0xc')]));require(_0x4200('0x10'))[_0x4200('0x11')](socket);function respondWithRpcPromise(_0x1f20fe,_0x3a511d,_0x466fff){return new BPromise(function(_0x23ab88,_0x2fa8ad){return client[_0x4200('0x12')](_0x1f20fe,_0x466fff)['then'](function(_0x3e8535){logger[_0x4200('0x13')](_0x4200('0x14'),_0x3a511d,_0x4200('0x15'));logger[_0x4200('0x16')](_0x4200('0x17'),_0x3a511d,_0x4200('0x15'),JSON[_0x4200('0x18')](_0x3e8535));if(_0x3e8535[_0x4200('0x19')]){if(_0x3e8535[_0x4200('0x19')]['code']===0x1f4){logger[_0x4200('0x19')](_0x4200('0x14'),_0x3a511d,_0x3e8535[_0x4200('0x19')]['message']);return _0x2fa8ad(_0x3e8535['error'][_0x4200('0x1a')]);}logger[_0x4200('0x19')](_0x4200('0x14'),_0x3a511d,_0x3e8535[_0x4200('0x19')][_0x4200('0x1a')]);return _0x23ab88(_0x3e8535[_0x4200('0x19')][_0x4200('0x1a')]);}else{logger[_0x4200('0x13')](_0x4200('0x14'),_0x3a511d,_0x4200('0x15'));_0x23ab88(_0x3e8535[_0x4200('0x1b')][_0x4200('0x1a')]);}})[_0x4200('0x1c')](function(_0x9f7261){logger[_0x4200('0x19')](_0x4200('0x14'),_0x3a511d,_0x9f7261);_0x2fa8ad(_0x9f7261);});});}exports['UpdateWhatsappInteraction']=function(_0x45a879){var _0x37bb68=this;return new Promise(function(_0x49bea9,_0x55168d){return db[_0x4200('0x1d')][_0x4200('0x1e')](_0x45a879[_0x4200('0x1f')],{'raw':_0x45a879[_0x4200('0x20')]?_0x45a879[_0x4200('0x20')][_0x4200('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45a879['options']?_0x45a879[_0x4200('0x20')][_0x4200('0x22')]||null:null,'attributes':_0x45a879['options']?_0x45a879[_0x4200('0x20')][_0x4200('0x23')]||null:null,'limit':_0x45a879[_0x4200('0x20')]?_0x45a879['options']['limit']||null:null})[_0x4200('0x24')](function(_0x54a84e){logger[_0x4200('0x13')](_0x4200('0x25'),_0x45a879);logger[_0x4200('0x16')]('UpdateWhatsappInteraction',_0x45a879,JSON[_0x4200('0x18')](_0x54a84e));_0x49bea9(_0x54a84e);})[_0x4200('0x1c')](function(_0x55b29a){logger['error']('UpdateWhatsappInteraction',_0x55b29a[_0x4200('0x1a')],_0x45a879);_0x55168d(_0x37bb68[_0x4200('0x19')](0x1f4,_0x55b29a[_0x4200('0x1a')]));});});};exports[_0x4200('0x26')]=function(_0x2a82f3){return new Promise(function(_0x447f91,_0x103104){return db['WhatsappInteraction'][_0x4200('0x27')]({'where':_0x2a82f3['options']?_0x2a82f3['options'][_0x4200('0x22')]||null:null})[_0x4200('0x24')](function(_0x198bd8){if(_0x198bd8){return _0x198bd8[_0x4200('0x28')](_0x2a82f3[_0x4200('0x1f')][_0x4200('0x29')],_[_0x4200('0x2a')](_0x2a82f3['body'],['ids','id'])||{});}})[_0x4200('0x2b')](function(_0x4e0747){logger[_0x4200('0x13')]('AddTags',_0x2a82f3);logger[_0x4200('0x16')]('AddTags',_0x2a82f3,JSON[_0x4200('0x18')](_0x4e0747));_0x447f91(_0x4e0747);})[_0x4200('0x1c')](function(_0xd6bfd8){logger[_0x4200('0x19')](_0x4200('0x2c'),_0xd6bfd8[_0x4200('0x1a')],_0x2a82f3);_0x103104(_this[_0x4200('0x19')](0x1f4,_0xd6bfd8[_0x4200('0x1a')]));});});};
\ No newline at end of file
index f51852d..5d7acde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5251=['removeListener','length','whatsappInteraction:','./whatsappInteraction.events','emit'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x5251,0x99));var _0x1525=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5251[_0x14add3];return _0x4a174f;};'use strict';var WhatsappInteractionEvents=require(_0x1525('0x0'));var events=['save','remove','update'];function createListener(_0x34a7d7,_0x56a86e){return function(_0x3ec29f){_0x56a86e[_0x1525('0x1')](_0x34a7d7,_0x3ec29f);};}function removeListener(_0x2210fd,_0x5878fb){return function(){WhatsappInteractionEvents[_0x1525('0x2')](_0x2210fd,_0x5878fb);};}exports['register']=function(_0x4a5413){for(var _0x5e0a96=0x0,_0x2226ff=events[_0x1525('0x3')];_0x5e0a96<_0x2226ff;_0x5e0a96++){var _0x23df9b=events[_0x5e0a96];var _0x1e8cec=createListener(_0x1525('0x4')+_0x23df9b,_0x4a5413);WhatsappInteractionEvents['on'](_0x23df9b,_0x1e8cec);}};
\ No newline at end of file
+var _0x5a8f=['remove','update','emit','removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x1ba19c,_0x3975e2){var _0x4e069b=function(_0xd95964){while(--_0xd95964){_0x1ba19c['push'](_0x1ba19c['shift']());}};_0x4e069b(++_0x3975e2);}(_0x5a8f,0x130));var _0xf5a8=function(_0x3b9545,_0x820de2){_0x3b9545=_0x3b9545-0x0;var _0x3ab80a=_0x5a8f[_0x3b9545];return _0x3ab80a;};'use strict';var WhatsappInteractionEvents=require(_0xf5a8('0x0'));var events=[_0xf5a8('0x1'),_0xf5a8('0x2'),_0xf5a8('0x3')];function createListener(_0x43609b,_0x200a93){return function(_0x52494e){_0x200a93[_0xf5a8('0x4')](_0x43609b,_0x52494e);};}function removeListener(_0x4c43bb,_0x1dd3b0){return function(){WhatsappInteractionEvents[_0xf5a8('0x5')](_0x4c43bb,_0x1dd3b0);};}exports[_0xf5a8('0x6')]=function(_0x592b09){for(var _0x3fc0f4=0x0,_0x5e7b09=events[_0xf5a8('0x7')];_0x3fc0f4<_0x5e7b09;_0x3fc0f4++){var _0x3bfd10=events[_0x3fc0f4];var _0x36f02e=createListener(_0xf5a8('0x8')+_0x3bfd10,_0x592b09);WhatsappInteractionEvents['on'](_0x3bfd10,_0x36f02e);}};
\ No newline at end of file
index 43bd9f3..d619905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x921b=['./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x921b,0x106));var _0xb921=function(_0x42d9ee,_0x82847c){_0x42d9ee=_0x42d9ee-0x0;var _0x5d20de=_0x921b[_0x42d9ee];return _0x5d20de;};'use strict';var multer=require(_0xb921('0x0'));var util=require(_0xb921('0x1'));var path=require('path');var timeout=require(_0xb921('0x2'));var express=require('express');var router=express[_0xb921('0x3')]();var fs_extra=require(_0xb921('0x4'));var auth=require(_0xb921('0x5'));var interaction=require(_0xb921('0x6'));var config=require(_0xb921('0x7'));var controller=require(_0xb921('0x8'));router[_0xb921('0x9')]('/',auth[_0xb921('0xa')](),controller[_0xb921('0xb')]);router[_0xb921('0x9')](_0xb921('0xc'),auth[_0xb921('0xa')](),controller['describe']);router[_0xb921('0x9')](_0xb921('0xd'),auth[_0xb921('0xa')](),controller[_0xb921('0xe')]);router[_0xb921('0xf')]('/',auth[_0xb921('0xa')](),interaction[_0xb921('0x10')](_0xb921('0x11'),_0xb921('0x12')),controller[_0xb921('0x13')]);router[_0xb921('0xf')](_0xb921('0x14'),controller[_0xb921('0x15')]);router[_0xb921('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xb921('0x17')]);router[_0xb921('0x16')](_0xb921('0x18'),auth[_0xb921('0xa')](),controller[_0xb921('0x19')]);router[_0xb921('0x16')]('/:id/reject',auth[_0xb921('0xa')](),controller[_0xb921('0x1a')]);router[_0xb921('0x1b')](_0xb921('0xd'),auth[_0xb921('0xa')](),controller[_0xb921('0x1c')]);module[_0xb921('0x1d')]=router;
\ No newline at end of file
+var _0xa80a=['/:id','show','whatsapp','create','post','/:id/status','status','put','update','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','/describe','describe'];(function(_0x36a91e,_0x1040db){var _0x38f28d=function(_0x2c5581){while(--_0x2c5581){_0x36a91e['push'](_0x36a91e['shift']());}};_0x38f28d(++_0x1040db);}(_0xa80a,0x8f));var _0xaa80=function(_0x1f1648,_0x77e8ca){_0x1f1648=_0x1f1648-0x0;var _0x2cb313=_0xa80a[_0x1f1648];return _0x2cb313;};'use strict';var multer=require(_0xaa80('0x0'));var util=require(_0xaa80('0x1'));var path=require(_0xaa80('0x2'));var timeout=require(_0xaa80('0x3'));var express=require('express');var router=express[_0xaa80('0x4')]();var fs_extra=require(_0xaa80('0x5'));var auth=require(_0xaa80('0x6'));var interaction=require(_0xaa80('0x7'));var config=require('../../config/environment');var controller=require(_0xaa80('0x8'));router[_0xaa80('0x9')]('/',auth[_0xaa80('0xa')](),controller['index']);router['get'](_0xaa80('0xb'),auth[_0xaa80('0xa')](),controller[_0xaa80('0xc')]);router[_0xaa80('0x9')](_0xaa80('0xd'),auth[_0xaa80('0xa')](),controller[_0xaa80('0xe')]);router['post']('/',auth[_0xaa80('0xa')](),interaction['tracked'](_0xaa80('0xf'),'whatsappmessage:create'),controller[_0xaa80('0x10')]);router[_0xaa80('0x11')](_0xaa80('0x12'),controller[_0xaa80('0x13')]);router[_0xaa80('0x14')](_0xaa80('0xd'),auth[_0xaa80('0xa')](),controller[_0xaa80('0x15')]);router[_0xaa80('0x14')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router['put'](_0xaa80('0x16'),auth[_0xaa80('0xa')](),controller[_0xaa80('0x17')]);router[_0xaa80('0x18')]('/:id',auth[_0xaa80('0xa')](),controller['destroy']);module[_0xaa80('0x19')]=router;
\ No newline at end of file
index dad575d..f9c10f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d83=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x538117,_0x16615e){var _0x576eaf=function(_0x5d33cb){while(--_0x5d33cb){_0x538117['push'](_0x538117['shift']());}};_0x576eaf(++_0x16615e);}(_0x2d83,0x1dc));var _0x32d8=function(_0x1cdac8,_0x5e237a){_0x1cdac8=_0x1cdac8-0x0;var _0x354a62=_0x2d83[_0x1cdac8];return _0x354a62;};'use strict';var Sequelize=require(_0x32d8('0x0'));module[_0x32d8('0x1')]={'body':{'type':Sequelize[_0x32d8('0x2')](_0x32d8('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x32d8('0x5')]('in',_0x32d8('0x6')),'defaultValue':_0x32d8('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x32d8('0x7')]},'readAt':{'type':Sequelize[_0x32d8('0x8')]},'secret':{'type':Sequelize[_0x32d8('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x32d8('0x7')]},'providerResponse':{'type':Sequelize[_0x32d8('0x2')]}};
\ No newline at end of file
+var _0x6ffc=['STRING','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6ffc,0x11c));var _0xc6ff=function(_0x400238,_0x34fa3c){_0x400238=_0x400238-0x0;var _0x1d0f05=_0x6ffc[_0x400238];return _0x1d0f05;};'use strict';var Sequelize=require(_0xc6ff('0x0'));module[_0xc6ff('0x1')]={'body':{'type':Sequelize['TEXT'](_0xc6ff('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc6ff('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xc6ff('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xc6ff('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc6ff('0x4')]},'providerResponse':{'type':Sequelize[_0xc6ff('0x5')]}};
\ No newline at end of file
index 839d9af..5082879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5228=['MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','reject','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','WhatsappMessage','find','body','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[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','QueryTypes','SELECT','contact','User','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','WhatsappInteractionId','RejectMessage','rejectMessage','fullname','rejectmessage','WhatsappAccount','WhatsappAccountId','inspect','twilio'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5228,0x10e));var _0x8522=function(_0x3723a7,_0x673192){_0x3723a7=_0x3723a7-0x0;var _0x4dcb27=_0x5228[_0x3723a7];return _0x4dcb27;};'use strict';var emlformat=require(_0x8522('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8522('0x1'));var jsonpatch=require(_0x8522('0x2'));var rp=require(_0x8522('0x3'));var moment=require(_0x8522('0x4'));var BPromise=require(_0x8522('0x5'));var Mustache=require(_0x8522('0x6'));var util=require(_0x8522('0x7'));var path=require(_0x8522('0x8'));var sox=require('sox');var csv=require(_0x8522('0x9'));var ejs=require(_0x8522('0xa'));var fs=require('fs');var fs_extra=require(_0x8522('0xb'));var _=require(_0x8522('0xc'));var squel=require(_0x8522('0xd'));var crypto=require(_0x8522('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8522('0xf'));var toCsv=require(_0x8522('0x9'));var querystring=require(_0x8522('0x10'));var Papa=require('papaparse');var Redis=require(_0x8522('0x11'));var authService=require(_0x8522('0x12'));var qs=require(_0x8522('0x13'));var as=require(_0x8522('0x14'));var hardwareService=require(_0x8522('0x15'));var logger=require(_0x8522('0x16'))(_0x8522('0x17'));var utils=require('../../config/utils');var config=require(_0x8522('0x18'));var licenseUtil=require(_0x8522('0x19'));var db=require('../../mysqldb')['db'];config[_0x8522('0x1a')]=_[_0x8522('0x1b')](config[_0x8522('0x1a')],{'host':_0x8522('0x1c'),'port':0x18eb});var socket=require(_0x8522('0x1d'))(new Redis(config[_0x8522('0x1a')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8522('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x8522('0x1e')][_0x8522('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4dfd8a,_0xdadf62,_0x79a2c3,_0xaa3be0){return new BPromise(function(_0x59beb9,_0xb9ab1c){var _0x5cab38=_0xaa3be0||client;return _0x5cab38['request'](_0x4dfd8a,_0x79a2c3)[_0x8522('0x20')](function(_0x3ecbec){logger[_0x8522('0x21')](_0x8522('0x22'),_0xdadf62,_0x8522('0x23'));logger[_0x8522('0x24')](_0x8522('0x25'),_0xdadf62,_0x8522('0x23'),JSON['stringify'](_0x3ecbec));if(_0x3ecbec[_0x8522('0x26')]){if(_0x3ecbec[_0x8522('0x26')][_0x8522('0x27')]===0x1f4){logger[_0x8522('0x26')](_0x8522('0x22'),_0xdadf62,_0x3ecbec[_0x8522('0x26')][_0x8522('0x28')]);return _0xb9ab1c(_0x3ecbec['error'][_0x8522('0x28')]);}logger[_0x8522('0x26')](_0x8522('0x22'),_0xdadf62,_0x3ecbec[_0x8522('0x26')]['message']);return _0x59beb9(_0x3ecbec[_0x8522('0x26')][_0x8522('0x28')]);}else{logger[_0x8522('0x21')](_0x8522('0x22'),_0xdadf62,_0x8522('0x23'));_0x59beb9(_0x3ecbec[_0x8522('0x29')][_0x8522('0x28')]);}})['catch'](function(_0x466e73){logger[_0x8522('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0xdadf62,_0x466e73);_0xb9ab1c(_0x466e73);});});}function respondWithStatusCode(_0x1a83a1,_0x2398ae){_0x2398ae=_0x2398ae||0xcc;return function(_0x569ec8){if(_0x569ec8){return _0x1a83a1[_0x8522('0x2a')](_0x2398ae);}return _0x1a83a1[_0x8522('0x2b')](_0x2398ae)[_0x8522('0x2c')]();};}function respondWithResult(_0x5ae1d2,_0x2c726b){_0x2c726b=_0x2c726b||0xc8;return function(_0x394e44){if(_0x394e44){return _0x5ae1d2[_0x8522('0x2b')](_0x2c726b)['json'](_0x394e44);}};}function respondWithFilteredResult(_0x6c28c8,_0x4e4cee){return function(_0x2e4cd9){if(_0x2e4cd9){var _0x306728=typeof _0x4e4cee['offset']===_0x8522('0x2d')&&typeof _0x4e4cee['limit']==='undefined';var _0x304d48=_0x2e4cd9[_0x8522('0x2e')];var _0x1964b7=_0x306728?0x0:_0x4e4cee[_0x8522('0x2f')];var _0x2e8c14=_0x306728?_0x2e4cd9[_0x8522('0x2e')]:_0x4e4cee[_0x8522('0x2f')]+_0x4e4cee[_0x8522('0x30')];var _0x3419db;if(_0x2e8c14>=_0x304d48){_0x2e8c14=_0x304d48;_0x3419db=0xc8;}else{_0x3419db=0xce;}_0x6c28c8[_0x8522('0x2b')](_0x3419db);return _0x6c28c8[_0x8522('0x31')](_0x8522('0x32'),_0x1964b7+'-'+_0x2e8c14+'/'+_0x304d48)['json'](_0x2e4cd9);}return null;};}function patchUpdates(_0x5cc811){return function(_0x3ab66e){try{jsonpatch['apply'](_0x3ab66e,_0x5cc811,!![]);}catch(_0x71cb33){return BPromise[_0x8522('0x33')](_0x71cb33);}return _0x3ab66e['save']();};}function saveUpdates(_0x3f4434,_0x2ea8aa){return function(_0x14f7dd){if(_0x14f7dd){return _0x14f7dd[_0x8522('0x34')](_0x3f4434)['then'](function(_0x2a4439){return _0x2a4439;});}return null;};}function removeEntity(_0x4cc189,_0x251f1f){return function(_0x785245){if(_0x785245){return _0x785245[_0x8522('0x35')]()['then'](function(){_0x4cc189['status'](0xcc)[_0x8522('0x2c')]();});}};}function handleEntityNotFound(_0x2f865f,_0x3484a0){return function(_0x35ffff){if(!_0x35ffff){_0x2f865f[_0x8522('0x2a')](0x194);}return _0x35ffff;};}function handleError(_0x1c0411,_0x286326){_0x286326=_0x286326||0x1f4;return function(_0x12640e){logger[_0x8522('0x26')](_0x12640e['stack']);if(_0x12640e['name']){delete _0x12640e[_0x8522('0x36')];}_0x1c0411['status'](_0x286326)[_0x8522('0x37')](_0x12640e);};}exports[_0x8522('0x38')]=function(_0x21b615,_0x59511e){var _0xdefe3d={},_0x5bfc0f={},_0x3d99dd={'count':0x0,'rows':[]};var _0xdf1575=_[_0x8522('0x39')](db['WhatsappMessage'][_0x8522('0x3a')],function(_0x27e2cc){return{'name':_0x27e2cc[_0x8522('0x3b')],'type':_0x27e2cc[_0x8522('0x3c')][_0x8522('0x3d')]};});_0x5bfc0f[_0x8522('0x3e')]=_[_0x8522('0x39')](_0xdf1575,_0x8522('0x36'));_0x5bfc0f[_0x8522('0x3f')]=_[_0x8522('0x40')](_0x21b615[_0x8522('0x3f')]);_0x5bfc0f['filters']=_[_0x8522('0x41')](_0x5bfc0f['model'],_0x5bfc0f[_0x8522('0x3f')]);_0xdefe3d['attributes']=_[_0x8522('0x41')](_0x5bfc0f['model'],qs[_0x8522('0x42')](_0x21b615[_0x8522('0x3f')][_0x8522('0x42')]));_0xdefe3d[_0x8522('0x43')]=_0xdefe3d[_0x8522('0x43')][_0x8522('0x44')]?_0xdefe3d[_0x8522('0x43')]:_0x5bfc0f[_0x8522('0x3e')];if(!_0x21b615[_0x8522('0x3f')]['hasOwnProperty'](_0x8522('0x45'))){_0xdefe3d[_0x8522('0x30')]=qs['limit'](_0x21b615[_0x8522('0x3f')][_0x8522('0x30')]);_0xdefe3d[_0x8522('0x2f')]=qs[_0x8522('0x2f')](_0x21b615['query'][_0x8522('0x2f')]);}_0xdefe3d[_0x8522('0x46')]=qs[_0x8522('0x47')](_0x21b615['query'][_0x8522('0x47')]);_0xdefe3d[_0x8522('0x48')]=qs['filters'](_['pick'](_0x21b615[_0x8522('0x3f')],_0x5bfc0f[_0x8522('0x49')]),_0xdf1575);if(_0x21b615[_0x8522('0x3f')][_0x8522('0x4a')]){_0xdefe3d[_0x8522('0x48')]=_[_0x8522('0x4b')](_0xdefe3d[_0x8522('0x48')],{'$or':_['map'](_0xdf1575,function(_0x58b6cd){if(_0x58b6cd[_0x8522('0x3c')]!=='VIRTUAL'){var _0x28e09a={};_0x28e09a[_0x58b6cd[_0x8522('0x36')]]={'$like':'%'+_0x21b615[_0x8522('0x3f')]['filter']+'%'};return _0x28e09a;}})});}_0xdefe3d=_[_0x8522('0x4b')]({},_0xdefe3d,_0x21b615[_0x8522('0x4c')]);var _0x3d17fc={'where':_0xdefe3d[_0x8522('0x48')]};return db['WhatsappMessage'][_0x8522('0x2e')](_0x3d17fc)['then'](function(_0x41f29c){_0x3d99dd[_0x8522('0x2e')]=_0x41f29c;if(_0x21b615[_0x8522('0x3f')][_0x8522('0x4d')]){_0xdefe3d['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x8522('0x4e')](_0xdefe3d);})[_0x8522('0x20')](function(_0x3e60f4){_0x3d99dd[_0x8522('0x4f')]=_0x3e60f4;return _0x3d99dd;})[_0x8522('0x20')](respondWithFilteredResult(_0x59511e,_0xdefe3d))[_0x8522('0x50')](handleError(_0x59511e,null));};exports[_0x8522('0x51')]=function(_0x16fc17,_0xf12a55){var _0x5ebec4={'raw':!![],'where':{'id':_0x16fc17[_0x8522('0x52')]['id']}},_0x5eea0f={};_0x5eea0f[_0x8522('0x3e')]=_[_0x8522('0x40')](db[_0x8522('0x53')][_0x8522('0x3a')]);_0x5eea0f[_0x8522('0x3f')]=_[_0x8522('0x40')](_0x16fc17[_0x8522('0x3f')]);_0x5eea0f[_0x8522('0x49')]=_['intersection'](_0x5eea0f[_0x8522('0x3e')],_0x5eea0f['query']);_0x5ebec4[_0x8522('0x43')]=_[_0x8522('0x41')](_0x5eea0f[_0x8522('0x3e')],qs[_0x8522('0x42')](_0x16fc17['query'][_0x8522('0x42')]));_0x5ebec4[_0x8522('0x43')]=_0x5ebec4[_0x8522('0x43')][_0x8522('0x44')]?_0x5ebec4[_0x8522('0x43')]:_0x5eea0f[_0x8522('0x3e')];if(_0x16fc17[_0x8522('0x3f')][_0x8522('0x4d')]){_0x5ebec4['include']=[{'all':!![]}];}_0x5ebec4=_[_0x8522('0x4b')]({},_0x5ebec4,_0x16fc17['options']);return db[_0x8522('0x53')][_0x8522('0x54')](_0x5ebec4)[_0x8522('0x20')](handleEntityNotFound(_0xf12a55,null))['then'](respondWithResult(_0xf12a55,null))[_0x8522('0x50')](handleError(_0xf12a55,null));};exports['create']=function(_0x136979,_0x325b10){return db[_0x8522('0x53')]['create'](_0x136979[_0x8522('0x55')],{})[_0x8522('0x20')](respondWithResult(_0x325b10,0xc9))[_0x8522('0x50')](handleError(_0x325b10,null));};exports[_0x8522('0x34')]=function(_0x25b0f7,_0x398f88){if(_0x25b0f7['body']['id']){delete _0x25b0f7[_0x8522('0x55')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x25b0f7[_0x8522('0x52')]['id']}})[_0x8522('0x20')](handleEntityNotFound(_0x398f88,null))[_0x8522('0x20')](saveUpdates(_0x25b0f7[_0x8522('0x55')],null))['then'](respondWithResult(_0x398f88,null))[_0x8522('0x50')](handleError(_0x398f88,null));};exports['destroy']=function(_0x5aab45,_0x3379db){return db[_0x8522('0x53')][_0x8522('0x54')]({'where':{'id':_0x5aab45[_0x8522('0x52')]['id']}})[_0x8522('0x20')](handleEntityNotFound(_0x3379db,null))[_0x8522('0x20')](removeEntity(_0x3379db,null))[_0x8522('0x50')](handleError(_0x3379db,null));};exports['describe']=function(_0x5d3f45,_0x27e391){return db[_0x8522('0x53')]['describe']()[_0x8522('0x20')](respondWithResult(_0x27e391,null))[_0x8522('0x50')](handleError(_0x27e391,null));};var interaction_log=require('../../config/logger')(_0x8522('0x56'));exports[_0x8522('0x57')]=function(_0x285280,_0x80e04b,_0x41cb21){var _0x1be2bb={'agent':{},'channel':_0x8522('0x58')};if(_0x285280[_0x8522('0x55')]['id']){delete _0x285280[_0x8522('0x55')]['id'];}_0x285280['body'][_0x8522('0x59')]=!![];_0x285280[_0x8522('0x55')][_0x8522('0x5a')]=moment()[_0x8522('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x285280[_0x8522('0x55')][_0x8522('0x5c')]=_0x285280[_0x8522('0x55')][_0x8522('0x5c')]||_0x285280[_0x8522('0x5d')]['id'];_0x1be2bb[_0x8522('0x5e')]['id']=_0x285280[_0x8522('0x55')][_0x8522('0x5c')];return db['WhatsappMessage'][_0x8522('0x54')]({'where':{'id':_0x285280['params']['id'],'UserId':null}})[_0x8522('0x20')](handleEntityNotFound(_0x80e04b,null))[_0x8522('0x20')](saveUpdates(_0x285280[_0x8522('0x55')],null))[_0x8522('0x20')](function(_0x361704){if(_0x361704){_0x1be2bb[_0x8522('0x28')]=_0x361704[_0x8522('0x5f')]({'plain':!![]});return db[_0x8522('0x60')]['find']({'where':{'id':_0x361704['WhatsappInteractionId']}});}return null;})[_0x8522('0x20')](handleEntityNotFound(_0x80e04b,null))['then'](function(_0xe706bc){if(_0xe706bc){return _0xe706bc[_0x8522('0x34')]({'UserId':_0x285280[_0x8522('0x55')][_0x8522('0x5c')],'read1stAt':_['isNil'](_0xe706bc[_0x8522('0x61')])?moment()[_0x8522('0x5b')](_0x8522('0x62')):undefined});}return null;})[_0x8522('0x20')](function(_0x440a4e){if(_0x440a4e){_0x1be2bb['interaction']=_0x440a4e[_0x8522('0x5f')]({'plain':!![]});interaction_log[_0x8522('0x21')](_0x8522('0x63'),_0x285280['user']['id'],_0x285280[_0x8522('0x5d')][_0x8522('0x36')],_0x285280[_0x8522('0x5d')]['role'],_0x1be2bb[_0x8522('0x64')]['id'],_0x285280['body']?JSON[_0x8522('0x65')](_0x285280[_0x8522('0x55')]):_0x8522('0x66'));return respondWithRpcPromise(_0x8522('0x67'),_0x8522('0x68'),_0x1be2bb);}return null;})[_0x8522('0x20')](function(_0x399b69){var _0x14d3ad=_0x8522('0x69')+_0x399b69[_0x8522('0x28')][_0x8522('0x6a')];return db[_0x8522('0x6b')][_0x8522('0x3f')](_0x14d3ad,{'type':db['Sequelize'][_0x8522('0x6c')][_0x8522('0x6d')],'raw':!![]})[_0x8522('0x20')](function(_0x2dcc83){return _0x2dcc83;});})[_0x8522('0x20')](function(_0x119330){if(_0x119330){_0x1be2bb[_0x8522('0x28')][_0x8522('0x6e')]=_0x119330[0x0];if(!_0x285280[_0x8522('0x55')][_0x8522('0x5c')])return;return db[_0x8522('0x6f')]['find']({'where':{'id':_0x285280['body'][_0x8522('0x5c')],'role':_0x8522('0x5e')},'attributes':['id',_0x8522('0x36'),'fullname',_0x8522('0x70'),_0x8522('0x71')],'raw':!![]});}return null;})[_0x8522('0x20')](function(_0x155d2d){if(!_0x155d2d)return null;_0x1be2bb[_0x8522('0x28')][_0x8522('0x5e')]=_0x155d2d;return _0x1be2bb;})[_0x8522('0x20')](function(_0x42239e){if(_0x42239e){if(_0x285280[_0x8522('0x55')]['manual']){_0x1be2bb['message'][_0x8522('0x72')]=util[_0x8522('0x5b')](_0x8522('0x73'),_0x285280['user'][_0x8522('0x36')]);_0x1be2bb['message'][_0x8522('0x74')]=_0x1be2bb[_0x8522('0x74')];_0x1be2bb['message'][_0x8522('0x75')]=_0x8522('0x57');return respondWithRpcPromise(_0x8522('0x76'),_0x8522('0x76'),{'event':_0x8522('0x77'),'message':_0x1be2bb[_0x8522('0x28')]},client9002)['then'](function(){return _0x1be2bb;});}return _0x1be2bb;}return null;})[_0x8522('0x20')](respondWithResult(_0x80e04b,null))[_0x8522('0x50')](handleError(_0x80e04b,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x8522('0x33')]=function(_0x2e2277,_0x1f61ce,_0x587eb9){var _0x405961={'agent':{},'channel':_0x8522('0x58')};if(_0x2e2277['body']['id']){delete _0x2e2277['body']['id'];}_0x2e2277[_0x8522('0x55')]['UserId']=_0x2e2277['body']['UserId']||_0x2e2277['user']['id'];_0x405961['agent']['id']=_0x2e2277[_0x8522('0x55')][_0x8522('0x5c')];return db[_0x8522('0x53')][_0x8522('0x54')]({'where':{'id':_0x2e2277['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1f61ce,null))[_0x8522('0x20')](function(_0xeb756){if(_0xeb756){_0x405961[_0x8522('0x28')]=_0xeb756[_0x8522('0x5f')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0xeb756[_0x8522('0x78')]}});}return null;})[_0x8522('0x20')](handleEntityNotFound(_0x1f61ce,null))['then'](function(_0x54b987){if(_0x54b987){_0x405961[_0x8522('0x64')]=_0x54b987[_0x8522('0x5f')]({'plain':!![]});interaction_log[_0x8522('0x21')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e2277['user']['id'],_0x2e2277[_0x8522('0x5d')][_0x8522('0x36')],_0x2e2277['user']['role'],_0x405961[_0x8522('0x64')]['id'],_0x2e2277[_0x8522('0x55')]?JSON[_0x8522('0x65')](_0x2e2277[_0x8522('0x55')]):_0x8522('0x66'));return respondWithRpcPromise(_0x8522('0x79'),_0x8522('0x7a'),_0x405961);}return null;})[_0x8522('0x20')](function(_0x5402fe){var _0x3bc34a=_0x8522('0x69')+_0x5402fe[_0x8522('0x28')][_0x8522('0x6a')];return db[_0x8522('0x6b')]['query'](_0x3bc34a,{'type':db['Sequelize'][_0x8522('0x6c')][_0x8522('0x6d')],'raw':!![]})[_0x8522('0x20')](function(_0x5c6cc9){return _0x5c6cc9;});})[_0x8522('0x20')](function(_0x2fecb6){if(_0x2fecb6){_0x405961['message'][_0x8522('0x6e')]=_0x2fecb6[0x0];if(!_0x2e2277[_0x8522('0x55')][_0x8522('0x5c')])return;return db[_0x8522('0x6f')][_0x8522('0x54')]({'where':{'id':_0x2e2277[_0x8522('0x55')][_0x8522('0x5c')],'role':_0x8522('0x5e')},'attributes':['id',_0x8522('0x36'),_0x8522('0x7b'),_0x8522('0x70'),_0x8522('0x71')],'raw':!![]});}return null;})['then'](function(_0x424ea0){if(!_0x424ea0)return null;_0x405961[_0x8522('0x28')]['agent']=_0x424ea0;return _0x405961;})[_0x8522('0x20')](function(_0x589ddc){if(_0x589ddc){_0x589ddc[_0x8522('0x28')]['interface']=util[_0x8522('0x5b')](_0x8522('0x73'),_0x2e2277[_0x8522('0x5d')][_0x8522('0x36')]);_0x589ddc[_0x8522('0x28')]['channel']=_0x405961[_0x8522('0x74')];_0x589ddc[_0x8522('0x28')][_0x8522('0x75')]=_0x8522('0x33');respondWithRpcPromise(_0x8522('0x76'),_0x8522('0x76'),{'event':_0x8522('0x7c'),'message':_0x589ddc[_0x8522('0x28')]},client9002);return _0x405961;}return null;})['then'](respondWithResult(_0x1f61ce,null))[_0x8522('0x50')](handleError(_0x1f61ce,null));};exports[_0x8522('0x2b')]=function(_0x319ef4,_0x3772e3,_0x24b460){if(_0x319ef4[_0x8522('0x55')]['id']){delete _0x319ef4['body']['id'];}var _0x4b6e62;return db['WhatsappMessage'][_0x8522('0x54')]({'where':{'id':_0x319ef4[_0x8522('0x52')]['id']}})['then'](handleEntityNotFound(_0x3772e3,null))[_0x8522('0x20')](function(_0x490fd9){if(_0x490fd9){_0x4b6e62=_0x490fd9;return db[_0x8522('0x7d')][_0x8522('0x54')]({'where':{'id':_0x490fd9[_0x8522('0x7e')]}});}})['then'](handleEntityNotFound(_0x3772e3,null))[_0x8522('0x20')](function(_0x556c78){if(_0x556c78){logger['debug']('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x8522('0x2b'),'received\x20delivery\x20report\x20from',_0x556c78[_0x8522('0x3c')],util[_0x8522('0x7f')](_0x319ef4['body'],{'showHidden':![],'depth':null}));switch(_0x556c78[_0x8522('0x3c')]){case _0x8522('0x80'):if(_0x319ef4[_0x8522('0x55')][_0x8522('0x81')]&&_0x319ef4[_0x8522('0x55')][_0x8522('0x81')]===_0x4b6e62[_0x8522('0x82')]&&_0x319ef4['body'][_0x8522('0x83')]&&_0x319ef4[_0x8522('0x55')][_0x8522('0x83')]===_0x8522('0x59')){return _0x4b6e62['update']({'read':!![]});}else{logger[_0x8522('0x26')](_0x8522('0x84'),'status',_0x8522('0x80'),util[_0x8522('0x7f')](_0x319ef4[_0x8522('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x4b6e62;}})[_0x8522('0x20')](respondWithResult(_0x3772e3,null))['catch'](handleError(_0x3772e3,null));};
\ No newline at end of file
+var _0xa4a9=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','name','send','index','map','WhatsappMessage','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','rawAttributes','intersection','include','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','whatsapp','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','User','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','messageId','MessageStatus','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0xa4a9,0x7a));var _0x9a4a=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xa4a9[_0x7b173];return _0x1c598c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a4a('0x0'));var zipdir=require(_0x9a4a('0x1'));var jsonpatch=require(_0x9a4a('0x2'));var rp=require(_0x9a4a('0x3'));var moment=require('moment');var BPromise=require(_0x9a4a('0x4'));var Mustache=require('mustache');var util=require(_0x9a4a('0x5'));var path=require(_0x9a4a('0x6'));var sox=require(_0x9a4a('0x7'));var csv=require(_0x9a4a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a4a('0x9'));var _=require('lodash');var squel=require(_0x9a4a('0xa'));var crypto=require(_0x9a4a('0xb'));var jsforce=require(_0x9a4a('0xc'));var deskjs=require(_0x9a4a('0xd'));var toCsv=require(_0x9a4a('0x8'));var querystring=require(_0x9a4a('0xe'));var Papa=require(_0x9a4a('0xf'));var Redis=require(_0x9a4a('0x10'));var authService=require(_0x9a4a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9a4a('0x12'));var hardwareService=require(_0x9a4a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9a4a('0x14'));var config=require(_0x9a4a('0x15'));var licenseUtil=require(_0x9a4a('0x16'));var db=require(_0x9a4a('0x17'))['db'];config[_0x9a4a('0x18')]=_[_0x9a4a('0x19')](config[_0x9a4a('0x18')],{'host':_0x9a4a('0x1a'),'port':0x18eb});var socket=require(_0x9a4a('0x1b'))(new Redis(config[_0x9a4a('0x18')]));require(_0x9a4a('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9a4a('0x1d')][_0x9a4a('0x1e')]({'port':0x232c});var client9002=jayson[_0x9a4a('0x1d')][_0x9a4a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x324284,_0xe6233c,_0x3a630f,_0x11d6c0){return new BPromise(function(_0x4d0827,_0x4581d9){var _0x15d09b=_0x11d6c0||client;return _0x15d09b['request'](_0x324284,_0x3a630f)[_0x9a4a('0x1f')](function(_0x141fea){logger[_0x9a4a('0x20')](_0x9a4a('0x21'),_0xe6233c,'request\x20sent');logger['debug'](_0x9a4a('0x22'),_0xe6233c,_0x9a4a('0x23'),JSON[_0x9a4a('0x24')](_0x141fea));if(_0x141fea['error']){if(_0x141fea['error'][_0x9a4a('0x25')]===0x1f4){logger[_0x9a4a('0x26')](_0x9a4a('0x21'),_0xe6233c,_0x141fea[_0x9a4a('0x26')]['message']);return _0x4581d9(_0x141fea[_0x9a4a('0x26')][_0x9a4a('0x27')]);}logger[_0x9a4a('0x26')](_0x9a4a('0x21'),_0xe6233c,_0x141fea[_0x9a4a('0x26')][_0x9a4a('0x27')]);return _0x4d0827(_0x141fea[_0x9a4a('0x26')]['message']);}else{logger[_0x9a4a('0x20')](_0x9a4a('0x21'),_0xe6233c,_0x9a4a('0x23'));_0x4d0827(_0x141fea['result'][_0x9a4a('0x27')]);}})[_0x9a4a('0x28')](function(_0x1e9a9e){logger[_0x9a4a('0x26')](_0x9a4a('0x21'),_0xe6233c,_0x1e9a9e);_0x4581d9(_0x1e9a9e);});});}function respondWithStatusCode(_0x1db908,_0x1af2e1){_0x1af2e1=_0x1af2e1||0xcc;return function(_0x58a1a2){if(_0x58a1a2){return _0x1db908[_0x9a4a('0x29')](_0x1af2e1);}return _0x1db908[_0x9a4a('0x2a')](_0x1af2e1)[_0x9a4a('0x2b')]();};}function respondWithResult(_0x4eacac,_0x1c22d7){_0x1c22d7=_0x1c22d7||0xc8;return function(_0x72ec93){if(_0x72ec93){return _0x4eacac[_0x9a4a('0x2a')](_0x1c22d7)[_0x9a4a('0x2c')](_0x72ec93);}};}function respondWithFilteredResult(_0x565c08,_0x5adccc){return function(_0x58b562){if(_0x58b562){var _0xfa6e89=typeof _0x5adccc[_0x9a4a('0x2d')]===_0x9a4a('0x2e')&&typeof _0x5adccc[_0x9a4a('0x2f')]==='undefined';var _0x4eee71=_0x58b562[_0x9a4a('0x30')];var _0x21ea44=_0xfa6e89?0x0:_0x5adccc[_0x9a4a('0x2d')];var _0x3e55ba=_0xfa6e89?_0x58b562['count']:_0x5adccc[_0x9a4a('0x2d')]+_0x5adccc[_0x9a4a('0x2f')];var _0xaa3187;if(_0x3e55ba>=_0x4eee71){_0x3e55ba=_0x4eee71;_0xaa3187=0xc8;}else{_0xaa3187=0xce;}_0x565c08[_0x9a4a('0x2a')](_0xaa3187);return _0x565c08['set'](_0x9a4a('0x31'),_0x21ea44+'-'+_0x3e55ba+'/'+_0x4eee71)[_0x9a4a('0x2c')](_0x58b562);}return null;};}function patchUpdates(_0x4983dc){return function(_0x102275){try{jsonpatch[_0x9a4a('0x32')](_0x102275,_0x4983dc,!![]);}catch(_0x20f33a){return BPromise[_0x9a4a('0x33')](_0x20f33a);}return _0x102275['save']();};}function saveUpdates(_0x4fb253,_0xd7eb26){return function(_0x44f76a){if(_0x44f76a){return _0x44f76a[_0x9a4a('0x34')](_0x4fb253)['then'](function(_0x2cec9){return _0x2cec9;});}return null;};}function removeEntity(_0x4986dd,_0x1b3ce3){return function(_0x5c63f2){if(_0x5c63f2){return _0x5c63f2[_0x9a4a('0x35')]()[_0x9a4a('0x1f')](function(){_0x4986dd[_0x9a4a('0x2a')](0xcc)[_0x9a4a('0x2b')]();});}};}function handleEntityNotFound(_0x536502,_0x492749){return function(_0x3ea2e2){if(!_0x3ea2e2){_0x536502[_0x9a4a('0x29')](0x194);}return _0x3ea2e2;};}function handleError(_0x40b0f6,_0x460aea){_0x460aea=_0x460aea||0x1f4;return function(_0x1e7d95){logger['error'](_0x1e7d95['stack']);if(_0x1e7d95[_0x9a4a('0x36')]){delete _0x1e7d95['name'];}_0x40b0f6[_0x9a4a('0x2a')](_0x460aea)[_0x9a4a('0x37')](_0x1e7d95);};}exports[_0x9a4a('0x38')]=function(_0x48dd9f,_0x5a0822){var _0x5236bd={},_0x57fcf5={},_0x1f7068={'count':0x0,'rows':[]};var _0x5ac6d1=_[_0x9a4a('0x39')](db[_0x9a4a('0x3a')]['rawAttributes'],function(_0x500a69){return{'name':_0x500a69[_0x9a4a('0x3b')],'type':_0x500a69[_0x9a4a('0x3c')][_0x9a4a('0x3d')]};});_0x57fcf5[_0x9a4a('0x3e')]=_[_0x9a4a('0x39')](_0x5ac6d1,'name');_0x57fcf5[_0x9a4a('0x3f')]=_[_0x9a4a('0x40')](_0x48dd9f[_0x9a4a('0x3f')]);_0x57fcf5[_0x9a4a('0x41')]=_['intersection'](_0x57fcf5[_0x9a4a('0x3e')],_0x57fcf5[_0x9a4a('0x3f')]);_0x5236bd[_0x9a4a('0x42')]=_['intersection'](_0x57fcf5['model'],qs[_0x9a4a('0x43')](_0x48dd9f[_0x9a4a('0x3f')][_0x9a4a('0x43')]));_0x5236bd['attributes']=_0x5236bd[_0x9a4a('0x42')][_0x9a4a('0x44')]?_0x5236bd[_0x9a4a('0x42')]:_0x57fcf5[_0x9a4a('0x3e')];if(!_0x48dd9f[_0x9a4a('0x3f')][_0x9a4a('0x45')](_0x9a4a('0x46'))){_0x5236bd[_0x9a4a('0x2f')]=qs['limit'](_0x48dd9f['query'][_0x9a4a('0x2f')]);_0x5236bd['offset']=qs[_0x9a4a('0x2d')](_0x48dd9f['query'][_0x9a4a('0x2d')]);}_0x5236bd[_0x9a4a('0x47')]=qs['sort'](_0x48dd9f[_0x9a4a('0x3f')][_0x9a4a('0x48')]);_0x5236bd[_0x9a4a('0x49')]=qs[_0x9a4a('0x41')](_[_0x9a4a('0x4a')](_0x48dd9f[_0x9a4a('0x3f')],_0x57fcf5[_0x9a4a('0x41')]),_0x5ac6d1);if(_0x48dd9f[_0x9a4a('0x3f')][_0x9a4a('0x4b')]){_0x5236bd[_0x9a4a('0x49')]=_[_0x9a4a('0x4c')](_0x5236bd[_0x9a4a('0x49')],{'$or':_['map'](_0x5ac6d1,function(_0x176e8d){if(_0x176e8d[_0x9a4a('0x3c')]!==_0x9a4a('0x4d')){var _0x223faa={};_0x223faa[_0x176e8d[_0x9a4a('0x36')]]={'$like':'%'+_0x48dd9f['query'][_0x9a4a('0x4b')]+'%'};return _0x223faa;}})});}_0x5236bd=_[_0x9a4a('0x4c')]({},_0x5236bd,_0x48dd9f[_0x9a4a('0x4e')]);var _0x1d0470={'where':_0x5236bd[_0x9a4a('0x49')]};return db['WhatsappMessage'][_0x9a4a('0x30')](_0x1d0470)[_0x9a4a('0x1f')](function(_0x4e9288){_0x1f7068[_0x9a4a('0x30')]=_0x4e9288;if(_0x48dd9f['query'][_0x9a4a('0x4f')]){_0x5236bd['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x9a4a('0x50')](_0x5236bd);})[_0x9a4a('0x1f')](function(_0x39a71e){_0x1f7068['rows']=_0x39a71e;return _0x1f7068;})[_0x9a4a('0x1f')](respondWithFilteredResult(_0x5a0822,_0x5236bd))['catch'](handleError(_0x5a0822,null));};exports['show']=function(_0x6825e8,_0xc8d1da){var _0x250254={'raw':!![],'where':{'id':_0x6825e8[_0x9a4a('0x51')]['id']}},_0xb787ad={};_0xb787ad[_0x9a4a('0x3e')]=_[_0x9a4a('0x40')](db['WhatsappMessage'][_0x9a4a('0x52')]);_0xb787ad[_0x9a4a('0x3f')]=_['keys'](_0x6825e8[_0x9a4a('0x3f')]);_0xb787ad[_0x9a4a('0x41')]=_[_0x9a4a('0x53')](_0xb787ad['model'],_0xb787ad[_0x9a4a('0x3f')]);_0x250254[_0x9a4a('0x42')]=_[_0x9a4a('0x53')](_0xb787ad[_0x9a4a('0x3e')],qs[_0x9a4a('0x43')](_0x6825e8['query'][_0x9a4a('0x43')]));_0x250254[_0x9a4a('0x42')]=_0x250254['attributes']['length']?_0x250254[_0x9a4a('0x42')]:_0xb787ad[_0x9a4a('0x3e')];if(_0x6825e8[_0x9a4a('0x3f')][_0x9a4a('0x4f')]){_0x250254[_0x9a4a('0x54')]=[{'all':!![]}];}_0x250254=_[_0x9a4a('0x4c')]({},_0x250254,_0x6825e8[_0x9a4a('0x4e')]);return db[_0x9a4a('0x3a')][_0x9a4a('0x55')](_0x250254)[_0x9a4a('0x1f')](handleEntityNotFound(_0xc8d1da,null))[_0x9a4a('0x1f')](respondWithResult(_0xc8d1da,null))[_0x9a4a('0x28')](handleError(_0xc8d1da,null));};exports[_0x9a4a('0x56')]=function(_0x37d098,_0x460b51){return db[_0x9a4a('0x3a')][_0x9a4a('0x56')](_0x37d098[_0x9a4a('0x57')],{})[_0x9a4a('0x1f')](respondWithResult(_0x460b51,0xc9))[_0x9a4a('0x28')](handleError(_0x460b51,null));};exports['update']=function(_0x43fbf3,_0x373750){if(_0x43fbf3[_0x9a4a('0x57')]['id']){delete _0x43fbf3[_0x9a4a('0x57')]['id'];}return db[_0x9a4a('0x3a')][_0x9a4a('0x55')]({'where':{'id':_0x43fbf3[_0x9a4a('0x51')]['id']}})[_0x9a4a('0x1f')](handleEntityNotFound(_0x373750,null))[_0x9a4a('0x1f')](saveUpdates(_0x43fbf3[_0x9a4a('0x57')],null))[_0x9a4a('0x1f')](respondWithResult(_0x373750,null))['catch'](handleError(_0x373750,null));};exports[_0x9a4a('0x35')]=function(_0x5f1ba0,_0x3a1a54){return db['WhatsappMessage'][_0x9a4a('0x55')]({'where':{'id':_0x5f1ba0[_0x9a4a('0x51')]['id']}})[_0x9a4a('0x1f')](handleEntityNotFound(_0x3a1a54,null))['then'](removeEntity(_0x3a1a54,null))[_0x9a4a('0x28')](handleError(_0x3a1a54,null));};exports[_0x9a4a('0x58')]=function(_0x40a387,_0x3cba4d){return db['WhatsappMessage'][_0x9a4a('0x58')]()[_0x9a4a('0x1f')](respondWithResult(_0x3cba4d,null))[_0x9a4a('0x28')](handleError(_0x3cba4d,null));};var interaction_log=require(_0x9a4a('0x59'))(_0x9a4a('0x5a'));exports[_0x9a4a('0x5b')]=function(_0x195cdb,_0x352898,_0x18f75d){var _0x43d422={'agent':{},'channel':'whatsapp'};if(_0x195cdb[_0x9a4a('0x57')]['id']){delete _0x195cdb[_0x9a4a('0x57')]['id'];}_0x195cdb[_0x9a4a('0x57')][_0x9a4a('0x5c')]=!![];_0x195cdb[_0x9a4a('0x57')][_0x9a4a('0x5d')]=moment()[_0x9a4a('0x5e')](_0x9a4a('0x5f'));_0x195cdb['body']['UserId']=_0x195cdb[_0x9a4a('0x57')][_0x9a4a('0x60')]||_0x195cdb[_0x9a4a('0x61')]['id'];_0x43d422[_0x9a4a('0x62')]['id']=_0x195cdb[_0x9a4a('0x57')][_0x9a4a('0x60')];return db[_0x9a4a('0x3a')]['find']({'where':{'id':_0x195cdb[_0x9a4a('0x51')]['id'],'UserId':null}})[_0x9a4a('0x1f')](handleEntityNotFound(_0x352898,null))[_0x9a4a('0x1f')](saveUpdates(_0x195cdb['body'],null))[_0x9a4a('0x1f')](function(_0x3d7665){if(_0x3d7665){_0x43d422[_0x9a4a('0x27')]=_0x3d7665[_0x9a4a('0x63')]({'plain':!![]});return db[_0x9a4a('0x64')][_0x9a4a('0x55')]({'where':{'id':_0x3d7665[_0x9a4a('0x65')]}});}return null;})[_0x9a4a('0x1f')](handleEntityNotFound(_0x352898,null))[_0x9a4a('0x1f')](function(_0x2c97f1){if(_0x2c97f1){return _0x2c97f1[_0x9a4a('0x34')]({'UserId':_0x195cdb[_0x9a4a('0x57')][_0x9a4a('0x60')],'read1stAt':_[_0x9a4a('0x66')](_0x2c97f1[_0x9a4a('0x67')])?moment()[_0x9a4a('0x5e')](_0x9a4a('0x5f')):undefined});}return null;})[_0x9a4a('0x1f')](function(_0xe8c800){if(_0xe8c800){_0x43d422[_0x9a4a('0x68')]=_0xe8c800['get']({'plain':!![]});interaction_log[_0x9a4a('0x20')](_0x9a4a('0x69'),_0x195cdb[_0x9a4a('0x61')]['id'],_0x195cdb['user']['name'],_0x195cdb[_0x9a4a('0x61')]['role'],_0x43d422[_0x9a4a('0x68')]['id'],_0x195cdb['body']?JSON['stringify'](_0x195cdb[_0x9a4a('0x57')]):_0x9a4a('0x6a'));return respondWithRpcPromise(_0x9a4a('0x6b'),'acceptMessage',_0x43d422);}return null;})[_0x9a4a('0x1f')](function(_0x1f41d0){var _0x4ccca1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f41d0[_0x9a4a('0x27')][_0x9a4a('0x6c')];return db[_0x9a4a('0x6d')]['query'](_0x4ccca1,{'type':db[_0x9a4a('0x6e')][_0x9a4a('0x6f')][_0x9a4a('0x70')],'raw':!![]})[_0x9a4a('0x1f')](function(_0x5b7289){return _0x5b7289;});})[_0x9a4a('0x1f')](function(_0xb71201){if(_0xb71201){_0x43d422[_0x9a4a('0x27')]['contact']=_0xb71201[0x0];if(!_0x195cdb[_0x9a4a('0x57')]['UserId'])return;return db['User'][_0x9a4a('0x55')]({'where':{'id':_0x195cdb[_0x9a4a('0x57')]['UserId'],'role':_0x9a4a('0x62')},'attributes':['id',_0x9a4a('0x36'),_0x9a4a('0x71'),'email',_0x9a4a('0x72')],'raw':!![]});}return null;})[_0x9a4a('0x1f')](function(_0x4701c5){if(!_0x4701c5)return null;_0x43d422[_0x9a4a('0x27')]['agent']=_0x4701c5;return _0x43d422;})['then'](function(_0x15ca69){if(_0x15ca69){if(_0x195cdb[_0x9a4a('0x57')][_0x9a4a('0x73')]){_0x43d422['message'][_0x9a4a('0x74')]=util[_0x9a4a('0x5e')](_0x9a4a('0x75'),_0x195cdb[_0x9a4a('0x61')]['name']);_0x43d422[_0x9a4a('0x27')]['channel']=_0x43d422[_0x9a4a('0x76')];_0x43d422[_0x9a4a('0x27')][_0x9a4a('0x77')]=_0x9a4a('0x5b');return respondWithRpcPromise('EventManager',_0x9a4a('0x78'),{'event':'acceptmessage','message':_0x43d422['message']},client9002)[_0x9a4a('0x1f')](function(){return _0x43d422;});}return _0x43d422;}return null;})['then'](respondWithResult(_0x352898,null))[_0x9a4a('0x28')](handleError(_0x352898,null));};var interaction_log=require(_0x9a4a('0x59'))(_0x9a4a('0x5a'));exports[_0x9a4a('0x33')]=function(_0x34bf34,_0x4675c5,_0x144266){var _0x5336f8={'agent':{},'channel':_0x9a4a('0x79')};if(_0x34bf34[_0x9a4a('0x57')]['id']){delete _0x34bf34[_0x9a4a('0x57')]['id'];}_0x34bf34['body'][_0x9a4a('0x60')]=_0x34bf34[_0x9a4a('0x57')][_0x9a4a('0x60')]||_0x34bf34['user']['id'];_0x5336f8[_0x9a4a('0x62')]['id']=_0x34bf34['body']['UserId'];return db[_0x9a4a('0x3a')][_0x9a4a('0x55')]({'where':{'id':_0x34bf34[_0x9a4a('0x51')]['id'],'UserId':null}})[_0x9a4a('0x1f')](handleEntityNotFound(_0x4675c5,null))['then'](function(_0x40185d){if(_0x40185d){_0x5336f8[_0x9a4a('0x27')]=_0x40185d['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x40185d['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4675c5,null))[_0x9a4a('0x1f')](function(_0x3ec5ac){if(_0x3ec5ac){_0x5336f8['interaction']=_0x3ec5ac['get']({'plain':!![]});interaction_log[_0x9a4a('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34bf34[_0x9a4a('0x61')]['id'],_0x34bf34['user']['name'],_0x34bf34[_0x9a4a('0x61')][_0x9a4a('0x7a')],_0x5336f8[_0x9a4a('0x68')]['id'],_0x34bf34[_0x9a4a('0x57')]?JSON[_0x9a4a('0x24')](_0x34bf34['body']):_0x9a4a('0x6a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5336f8);}return null;})[_0x9a4a('0x1f')](function(_0x2337eb){var _0x4aa68e=_0x9a4a('0x7b')+_0x2337eb[_0x9a4a('0x27')][_0x9a4a('0x6c')];return db[_0x9a4a('0x6d')][_0x9a4a('0x3f')](_0x4aa68e,{'type':db[_0x9a4a('0x6e')][_0x9a4a('0x6f')]['SELECT'],'raw':!![]})[_0x9a4a('0x1f')](function(_0x581ce6){return _0x581ce6;});})[_0x9a4a('0x1f')](function(_0x47347f){if(_0x47347f){_0x5336f8[_0x9a4a('0x27')][_0x9a4a('0x7c')]=_0x47347f[0x0];if(!_0x34bf34[_0x9a4a('0x57')]['UserId'])return;return db[_0x9a4a('0x7d')][_0x9a4a('0x55')]({'where':{'id':_0x34bf34[_0x9a4a('0x57')][_0x9a4a('0x60')],'role':_0x9a4a('0x62')},'attributes':['id','name',_0x9a4a('0x71'),'email','internal'],'raw':!![]});}return null;})[_0x9a4a('0x1f')](function(_0x33d3b9){if(!_0x33d3b9)return null;_0x5336f8[_0x9a4a('0x27')][_0x9a4a('0x62')]=_0x33d3b9;return _0x5336f8;})[_0x9a4a('0x1f')](function(_0x1c8dbd){if(_0x1c8dbd){_0x1c8dbd[_0x9a4a('0x27')][_0x9a4a('0x74')]=util['format'](_0x9a4a('0x75'),_0x34bf34[_0x9a4a('0x61')][_0x9a4a('0x36')]);_0x1c8dbd[_0x9a4a('0x27')][_0x9a4a('0x76')]=_0x5336f8['channel'];_0x1c8dbd[_0x9a4a('0x27')]['event']=_0x9a4a('0x33');respondWithRpcPromise(_0x9a4a('0x78'),_0x9a4a('0x78'),{'event':_0x9a4a('0x7e'),'message':_0x1c8dbd[_0x9a4a('0x27')]},client9002);return _0x5336f8;}return null;})[_0x9a4a('0x1f')](respondWithResult(_0x4675c5,null))[_0x9a4a('0x28')](handleError(_0x4675c5,null));};exports[_0x9a4a('0x2a')]=function(_0x58eab6,_0x419207,_0x1ad149){if(_0x58eab6['body']['id']){delete _0x58eab6[_0x9a4a('0x57')]['id'];}var _0x2ddd63;return db['WhatsappMessage'][_0x9a4a('0x55')]({'where':{'id':_0x58eab6[_0x9a4a('0x51')]['id']}})[_0x9a4a('0x1f')](handleEntityNotFound(_0x419207,null))['then'](function(_0x55db73){if(_0x55db73){_0x2ddd63=_0x55db73;return db[_0x9a4a('0x7f')]['find']({'where':{'id':_0x55db73[_0x9a4a('0x80')]}});}})[_0x9a4a('0x1f')](handleEntityNotFound(_0x419207,null))[_0x9a4a('0x1f')](function(_0x5212a4){if(_0x5212a4){logger['debug'](_0x9a4a('0x81'),_0x9a4a('0x2a'),'received\x20delivery\x20report\x20from',_0x5212a4[_0x9a4a('0x3c')],util[_0x9a4a('0x82')](_0x58eab6[_0x9a4a('0x57')],{'showHidden':![],'depth':null}));switch(_0x5212a4[_0x9a4a('0x3c')]){case _0x9a4a('0x83'):if(_0x58eab6[_0x9a4a('0x57')]['MessageSid']&&_0x58eab6['body']['MessageSid']===_0x2ddd63[_0x9a4a('0x84')]&&_0x58eab6[_0x9a4a('0x57')][_0x9a4a('0x85')]&&_0x58eab6[_0x9a4a('0x57')]['MessageStatus']==='read'){return _0x2ddd63[_0x9a4a('0x34')]({'read':!![]});}else{logger[_0x9a4a('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x9a4a('0x83'),util[_0x9a4a('0x82')](_0x58eab6['body'],{'showHidden':![],'depth':null}));}break;}return _0x2ddd63;}})[_0x9a4a('0x1f')](respondWithResult(_0x419207,null))[_0x9a4a('0x28')](handleError(_0x419207,null));};
\ No newline at end of file
index 39e4847..f117731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f8=['emit','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0xc1f96a,_0x2424e8){var _0x401785=function(_0x5a31fc){while(--_0x5a31fc){_0xc1f96a['push'](_0xc1f96a['shift']());}};_0x401785(++_0x2424e8);}(_0x57f8,0x198));var _0x857f=function(_0x11a84d,_0x4dbd0e){_0x11a84d=_0x11a84d-0x0;var _0x1e6b48=_0x57f8[_0x11a84d];return _0x1e6b48;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x857f('0x0'))['db'][_0x857f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x857f('0x2')](0x0);var events={'afterCreate':_0x857f('0x3'),'afterUpdate':_0x857f('0x4'),'afterDestroy':_0x857f('0x5')};function emitEvent(_0x2ff336){return function(_0x6f054b,_0x318050,_0xced48e){WhatsappMessageEvents[_0x857f('0x6')](_0x2ff336+':'+_0x6f054b['id'],_0x6f054b);WhatsappMessageEvents[_0x857f('0x6')](_0x2ff336,_0x6f054b);_0xced48e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x857f('0x7')](e,emitEvent(event));}}module[_0x857f('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x23a3=['update','remove','emit','hasOwnProperty','exports','setMaxListeners'];(function(_0x4c96b9,_0x3aa7fd){var _0x1f4aaa=function(_0x282308){while(--_0x282308){_0x4c96b9['push'](_0x4c96b9['shift']());}};_0x1f4aaa(++_0x3aa7fd);}(_0x23a3,0x131));var _0x323a=function(_0x404460,_0x53dcf8){_0x404460=_0x404460-0x0;var _0x423a08=_0x23a3[_0x404460];return _0x423a08;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x323a('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x323a('0x1'),'afterDestroy':_0x323a('0x2')};function emitEvent(_0x122b97){return function(_0x250485,_0x46030e,_0x180066){WhatsappMessageEvents[_0x323a('0x3')](_0x122b97+':'+_0x250485['id'],_0x250485);WhatsappMessageEvents[_0x323a('0x3')](_0x122b97,_0x250485);_0x180066(null);};}for(var e in events){if(events[_0x323a('0x4')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x323a('0x5')]=WhatsappMessageEvents;
\ No newline at end of file
index 422c261..9a825ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca04=['WhatsappMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','WhatsappAccount','find','WhatsappAccountId','then','type','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','catch','error'];(function(_0x210027,_0x3a533a){var _0x46da16=function(_0x424c53){while(--_0x424c53){_0x210027['push'](_0x210027['shift']());}};_0x46da16(++_0x3a533a);}(_0xca04,0x99));var _0x4ca0=function(_0x411478,_0x57db63){_0x411478=_0x411478-0x0;var _0x5ab0d2=_0xca04[_0x411478];return _0x5ab0d2;};'use strict';var _=require(_0x4ca0('0x0'));var util=require(_0x4ca0('0x1'));var logger=require(_0x4ca0('0x2'))(_0x4ca0('0x3'));var moment=require(_0x4ca0('0x4'));var BPromise=require(_0x4ca0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ca0('0x6'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x4ca0('0x7')]=function(_0xe951c2,_0x10083f){return _0xe951c2[_0x4ca0('0x8')](_0x4ca0('0x9'),attributes,{'tableName':_0x4ca0('0xa'),'paranoid':![],'indexes':[{'name':_0x4ca0('0xb'),'fields':[_0x4ca0('0xb')]},{'name':_0x4ca0('0xc'),'fields':[_0x4ca0('0xd')],'type':_0x4ca0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xdd4725,_0x5dd9e2,_0x3ad530){var _0x3d90a5=_0xe951c2[_0x4ca0('0xf')];var _0x2c9114=_0xdd4725[_0x4ca0('0x10')]({'plain':!![]});if(_0x2c9114[_0x4ca0('0x11')][_0x4ca0('0x12')]()==='in'||_0x2c9114['direction'][_0x4ca0('0x12')]()===_0x4ca0('0x13')&&!_0x2c9114[_0x4ca0('0x14')]&&!_['isNil'](_0x2c9114[_0x4ca0('0x15')])){_0x3d90a5[_0x4ca0('0x16')][_0x4ca0('0x17')]({'where':{'id':_0x2c9114[_0x4ca0('0x18')]}})['then'](function(_0x5439fd){if(_0x5439fd){_0x5439fd[_0x4ca0('0x19')]({'lastMsgAt':_0x2c9114['createdAt'],'lastMsgDirection':_0x2c9114[_0x4ca0('0x11')][_0x4ca0('0x12')]()});}})['catch'](function(_0x66b944){console['error'](_0x66b944);});}if(_0x2c9114[_0x4ca0('0x11')]===_0x4ca0('0x13')&&!_0x2c9114[_0x4ca0('0x14')]){var _0x9d420d;_0x3d90a5[_0x4ca0('0x1a')][_0x4ca0('0x1b')]({'where':{'id':_0x2c9114[_0x4ca0('0x1c')]},'raw':!![]})[_0x4ca0('0x1d')](function(_0x59074c){_0x9d420d=_0x59074c;if(_0x9d420d&&_0x9d420d[_0x4ca0('0x1e')]){switch(_0x9d420d[_0x4ca0('0x1e')]){case'twilio':var _0x406d25=require('twilio');if(_0x9d420d[_0x4ca0('0x1f')]&&_0x9d420d[_0x4ca0('0x20')]&&_0x9d420d[_0x4ca0('0x21')]){var _0x5c20a1=new _0x406d25(_0x9d420d['accountSid'],_0x9d420d[_0x4ca0('0x20')]);_0x5c20a1[_0x4ca0('0x22')][_0x4ca0('0x23')]({'body':_0x2c9114[_0x4ca0('0xd')],'to':_0x4ca0('0x24')+_0x2c9114['phone'],'from':_0x4ca0('0x24')+_0x9d420d[_0x4ca0('0x21')],'statusCallback':_0x9d420d[_0x4ca0('0x25')]+_0x4ca0('0x26')+_0x2c9114['id']+'/status?token='+_0x9d420d[_0x4ca0('0x27')]})[_0x4ca0('0x1d')](function(_0x59b92d){if(_0x59b92d[_0x4ca0('0x28')]){return _0xdd4725[_0x4ca0('0x19')]({'messageId':_0x59b92d[_0x4ca0('0x28')]});}})[_0x4ca0('0x29')](function(_0x129e23){logger[_0x4ca0('0x2a')](_0x4ca0('0x2b'),'afterCreate',_0x4ca0('0x2c'),util[_0x4ca0('0x2d')](_0x129e23,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4ca0('0x2b'),_0x4ca0('0x2e'),_0x4ca0('0x2c'),_0x4ca0('0x2f'));}break;}}})[_0x4ca0('0x30')](function(){_0x3ad530();});}else{_0x3ad530();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x92ab=['WhatsappAccountId','type','accountSid','authToken','create','whatsapp:','phone','remote','/status?token=','token','sid','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','createdAt','error','WhatsappAccount','find'];(function(_0x130011,_0x4e9d3e){var _0x4f0423=function(_0x5e3bb8){while(--_0x5e3bb8){_0x130011['push'](_0x130011['shift']());}};_0x4f0423(++_0x4e9d3e);}(_0x92ab,0x193));var _0xb92a=function(_0x48f10a,_0x27f895){_0x48f10a=_0x48f10a-0x0;var _0xc0dfe2=_0x92ab[_0x48f10a];return _0xc0dfe2;};'use strict';var _=require(_0xb92a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb92a('0x1'));var moment=require(_0xb92a('0x2'));var BPromise=require('bluebird');var rp=require(_0xb92a('0x3'));var fs=require('fs');var path=require(_0xb92a('0x4'));var rimraf=require(_0xb92a('0x5'));var config=require(_0xb92a('0x6'));var attributes=require(_0xb92a('0x7'));module['exports']=function(_0x15a645,_0x11acba){return _0x15a645['define'](_0xb92a('0x8'),attributes,{'tableName':_0xb92a('0x9'),'paranoid':![],'indexes':[{'name':_0xb92a('0xa'),'fields':[_0xb92a('0xa')]},{'name':_0xb92a('0xb'),'fields':[_0xb92a('0xc')],'type':_0xb92a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7e941d,_0x3f5f9d,_0x4aedce){var _0xffda36=_0x15a645['models'];var _0x4c5594=_0x7e941d[_0xb92a('0xe')]({'plain':!![]});if(_0x4c5594[_0xb92a('0xf')][_0xb92a('0x10')]()==='in'||_0x4c5594['direction'][_0xb92a('0x10')]()===_0xb92a('0x11')&&!_0x4c5594[_0xb92a('0x12')]&&!_[_0xb92a('0x13')](_0x4c5594[_0xb92a('0x14')])){_0xffda36[_0xb92a('0x15')]['findOne']({'where':{'id':_0x4c5594[_0xb92a('0x16')]}})[_0xb92a('0x17')](function(_0x2b6fae){if(_0x2b6fae){_0x2b6fae[_0xb92a('0x18')]({'lastMsgAt':_0x4c5594[_0xb92a('0x19')],'lastMsgDirection':_0x4c5594[_0xb92a('0xf')]['toLowerCase']()});}})['catch'](function(_0x3e49c8){console[_0xb92a('0x1a')](_0x3e49c8);});}if(_0x4c5594[_0xb92a('0xf')]===_0xb92a('0x11')&&!_0x4c5594[_0xb92a('0x12')]){var _0x5c368b;_0xffda36[_0xb92a('0x1b')][_0xb92a('0x1c')]({'where':{'id':_0x4c5594[_0xb92a('0x1d')]},'raw':!![]})[_0xb92a('0x17')](function(_0x4e3cb2){_0x5c368b=_0x4e3cb2;if(_0x5c368b&&_0x5c368b[_0xb92a('0x1e')]){switch(_0x5c368b[_0xb92a('0x1e')]){case'twilio':var _0x20b26f=require('twilio');if(_0x5c368b['accountSid']&&_0x5c368b['authToken']&&_0x5c368b['phone']){var _0x2a6d9e=new _0x20b26f(_0x5c368b[_0xb92a('0x1f')],_0x5c368b[_0xb92a('0x20')]);_0x2a6d9e['messages'][_0xb92a('0x21')]({'body':_0x4c5594[_0xb92a('0xc')],'to':_0xb92a('0x22')+_0x4c5594[_0xb92a('0x23')],'from':'whatsapp:'+_0x5c368b[_0xb92a('0x23')],'statusCallback':_0x5c368b[_0xb92a('0x24')]+'/api/whatsapp/messages/'+_0x4c5594['id']+_0xb92a('0x25')+_0x5c368b[_0xb92a('0x26')]})[_0xb92a('0x17')](function(_0x20fd41){if(_0x20fd41[_0xb92a('0x27')]){return _0x7e941d[_0xb92a('0x18')]({'messageId':_0x20fd41['sid']});}})[_0xb92a('0x28')](function(_0x29805a){logger[_0xb92a('0x1a')](_0xb92a('0x29'),_0xb92a('0x2a'),_0xb92a('0x2b'),util[_0xb92a('0x2c')](_0x29805a,{'showHidden':![],'depth':null}));});}else{logger[_0xb92a('0x1a')](_0xb92a('0x29'),_0xb92a('0x2a'),_0xb92a('0x2b'),_0xb92a('0x2d'));}break;}}})[_0xb92a('0x2e')](function(){_0x4aedce();});}else{_0x4aedce();}}},'charset':_0xb92a('0x2f'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7bfc5e3..5a43572 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccf7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappMessage.socket','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappMessage','create','body','options','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccf7,0x180));var _0x7ccf=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0xccf7[_0x40a825];return _0x273a54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ccf('0x0'));var BPromise=require(_0x7ccf('0x1'));var rs=require(_0x7ccf('0x2'));var fs=require('fs');var Redis=require(_0x7ccf('0x3'));var db=require(_0x7ccf('0x4'))['db'];var utils=require(_0x7ccf('0x5'));var logger=require(_0x7ccf('0x6'))(_0x7ccf('0x7'));var config=require(_0x7ccf('0x8'));var jayson=require(_0x7ccf('0x9'));var client=jayson[_0x7ccf('0xa')]['http']({'port':0x232a});config[_0x7ccf('0xb')]=_[_0x7ccf('0xc')](config[_0x7ccf('0xb')],{'host':_0x7ccf('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ccf('0xb')]));require(_0x7ccf('0xe'))['register'](socket);function respondWithRpcPromise(_0x26b256,_0x57fddc,_0x59077e){return new BPromise(function(_0x491d26,_0x2c646){return client['request'](_0x26b256,_0x59077e)[_0x7ccf('0xf')](function(_0x1a25d5){logger[_0x7ccf('0x10')](_0x7ccf('0x11'),_0x57fddc,_0x7ccf('0x12'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x57fddc,'request\x20sent',JSON[_0x7ccf('0x13')](_0x1a25d5));if(_0x1a25d5['error']){if(_0x1a25d5[_0x7ccf('0x14')][_0x7ccf('0x15')]===0x1f4){logger[_0x7ccf('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x57fddc,_0x1a25d5[_0x7ccf('0x14')]['message']);return _0x2c646(_0x1a25d5[_0x7ccf('0x14')]['message']);}logger[_0x7ccf('0x14')](_0x7ccf('0x11'),_0x57fddc,_0x1a25d5[_0x7ccf('0x14')][_0x7ccf('0x16')]);return _0x491d26(_0x1a25d5[_0x7ccf('0x14')][_0x7ccf('0x16')]);}else{logger[_0x7ccf('0x10')](_0x7ccf('0x11'),_0x57fddc,_0x7ccf('0x12'));_0x491d26(_0x1a25d5[_0x7ccf('0x17')][_0x7ccf('0x16')]);}})[_0x7ccf('0x18')](function(_0x27982e){logger[_0x7ccf('0x14')](_0x7ccf('0x11'),_0x57fddc,_0x27982e);_0x2c646(_0x27982e);});});}exports[_0x7ccf('0x19')]=function(_0x5958aa){var _0x25cf1c=this;return new Promise(function(_0x89ed66,_0x39fd81){return db['WhatsappMessage'][_0x7ccf('0x1a')](_0x5958aa[_0x7ccf('0x1b')],{'raw':_0x5958aa[_0x7ccf('0x1c')]?_0x5958aa['options']['raw']===undefined?!![]:![]:!![]})[_0x7ccf('0xf')](function(_0x852d2d){logger['info'](_0x7ccf('0x19'),_0x5958aa);logger[_0x7ccf('0x1d')]('CreateWhatsappMessage',_0x5958aa,JSON['stringify'](_0x852d2d));_0x89ed66(_0x852d2d);})['catch'](function(_0x4da652){logger[_0x7ccf('0x14')]('CreateWhatsappMessage',_0x4da652[_0x7ccf('0x16')],_0x5958aa);_0x39fd81(_0x25cf1c['error'](0x1f4,_0x4da652[_0x7ccf('0x16')]));});});};
\ No newline at end of file
+var _0x9868=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','create','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x38feee,_0x3b14c5){var _0x615531=function(_0x45b4de){while(--_0x45b4de){_0x38feee['push'](_0x38feee['shift']());}};_0x615531(++_0x3b14c5);}(_0x9868,0x1d3));var _0x8986=function(_0x265351,_0x4aa6ad){_0x265351=_0x265351-0x0;var _0x10fc41=_0x9868[_0x265351];return _0x10fc41;};'use strict';var _=require(_0x8986('0x0'));var util=require(_0x8986('0x1'));var moment=require(_0x8986('0x2'));var BPromise=require('bluebird');var rs=require(_0x8986('0x3'));var fs=require('fs');var Redis=require(_0x8986('0x4'));var db=require(_0x8986('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8986('0x6'))(_0x8986('0x7'));var config=require(_0x8986('0x8'));var jayson=require(_0x8986('0x9'));var client=jayson[_0x8986('0xa')][_0x8986('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x8986('0xc')],{'host':_0x8986('0xd'),'port':0x18eb});var socket=require(_0x8986('0xe'))(new Redis(config[_0x8986('0xc')]));require(_0x8986('0xf'))[_0x8986('0x10')](socket);function respondWithRpcPromise(_0x2ce938,_0x448537,_0x5e135e){return new BPromise(function(_0x286c8b,_0x47597e){return client[_0x8986('0x11')](_0x2ce938,_0x5e135e)[_0x8986('0x12')](function(_0x1762ee){logger[_0x8986('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x448537,_0x8986('0x14'));logger[_0x8986('0x15')](_0x8986('0x16'),_0x448537,_0x8986('0x14'),JSON[_0x8986('0x17')](_0x1762ee));if(_0x1762ee['error']){if(_0x1762ee[_0x8986('0x18')][_0x8986('0x19')]===0x1f4){logger['error'](_0x8986('0x1a'),_0x448537,_0x1762ee[_0x8986('0x18')][_0x8986('0x1b')]);return _0x47597e(_0x1762ee['error'][_0x8986('0x1b')]);}logger[_0x8986('0x18')](_0x8986('0x1a'),_0x448537,_0x1762ee['error']['message']);return _0x286c8b(_0x1762ee[_0x8986('0x18')][_0x8986('0x1b')]);}else{logger[_0x8986('0x13')](_0x8986('0x1a'),_0x448537,_0x8986('0x14'));_0x286c8b(_0x1762ee[_0x8986('0x1c')][_0x8986('0x1b')]);}})[_0x8986('0x1d')](function(_0x573d22){logger[_0x8986('0x18')](_0x8986('0x1a'),_0x448537,_0x573d22);_0x47597e(_0x573d22);});});}exports[_0x8986('0x1e')]=function(_0x3113dc){var _0x30bc00=this;return new Promise(function(_0x276676,_0x1fc888){return db['WhatsappMessage'][_0x8986('0x1f')](_0x3113dc[_0x8986('0x20')],{'raw':_0x3113dc[_0x8986('0x21')]?_0x3113dc[_0x8986('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x8986('0x12')](function(_0x35bc60){logger[_0x8986('0x13')](_0x8986('0x1e'),_0x3113dc);logger[_0x8986('0x15')](_0x8986('0x1e'),_0x3113dc,JSON[_0x8986('0x17')](_0x35bc60));_0x276676(_0x35bc60);})[_0x8986('0x1d')](function(_0x25c03e){logger[_0x8986('0x18')](_0x8986('0x1e'),_0x25c03e[_0x8986('0x1b')],_0x3113dc);_0x1fc888(_0x30bc00[_0x8986('0x18')](0x1f4,_0x25c03e[_0x8986('0x1b')]));});});};
\ No newline at end of file
index 0777274..7e1a07d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec18=['emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x15079a,_0xc12b1a){var _0x1daf40=function(_0x247889){while(--_0x247889){_0x15079a['push'](_0x15079a['shift']());}};_0x1daf40(++_0xc12b1a);}(_0xec18,0x12e));var _0x8ec1=function(_0x384fa7,_0x359d36){_0x384fa7=_0x384fa7-0x0;var _0x3fbd13=_0xec18[_0x384fa7];return _0x3fbd13;};'use strict';var WhatsappMessageEvents=require(_0x8ec1('0x0'));var events=[_0x8ec1('0x1'),_0x8ec1('0x2'),_0x8ec1('0x3')];function createListener(_0x3bfb2c,_0x34efbb){return function(_0x171f5b){_0x34efbb[_0x8ec1('0x4')](_0x3bfb2c,_0x171f5b);};}function removeListener(_0x24250e,_0x3e797e){return function(){WhatsappMessageEvents[_0x8ec1('0x5')](_0x24250e,_0x3e797e);};}exports[_0x8ec1('0x6')]=function(_0x14f114){for(var _0x2c984d=0x0,_0x4e7363=events[_0x8ec1('0x7')];_0x2c984d<_0x4e7363;_0x2c984d++){var _0xd3a2bd=events[_0x2c984d];var _0x362cae=createListener(_0x8ec1('0x8')+_0xd3a2bd,_0x14f114);WhatsappMessageEvents['on'](_0xd3a2bd,_0x362cae);}};
\ No newline at end of file
+var _0x6491=['remove','update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x6491,0x1ed));var _0x1649=function(_0x330740,_0x5516b5){_0x330740=_0x330740-0x0;var _0x819248=_0x6491[_0x330740];return _0x819248;};'use strict';var WhatsappMessageEvents=require(_0x1649('0x0'));var events=[_0x1649('0x1'),_0x1649('0x2'),_0x1649('0x3')];function createListener(_0x11a720,_0x117eb5){return function(_0x4e85d0){_0x117eb5[_0x1649('0x4')](_0x11a720,_0x4e85d0);};}function removeListener(_0x755af5,_0xaaa1bf){return function(){WhatsappMessageEvents[_0x1649('0x5')](_0x755af5,_0xaaa1bf);};}exports[_0x1649('0x6')]=function(_0x5421bc){for(var _0x1a84f=0x0,_0x4752bd=events[_0x1649('0x7')];_0x1a84f<_0x4752bd;_0x1a84f++){var _0x1a25e2=events[_0x1a84f];var _0x3b541b=createListener(_0x1649('0x8')+_0x1a25e2,_0x5421bc);WhatsappMessageEvents['on'](_0x1a25e2,_0x3b541b);}};
\ No newline at end of file
index 7af4240..91535d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc762=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','destroy','delete','removeAgents','exports','multer','util','path','Router'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xc762,0x9e));var _0x2c76=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0xc762[_0x5c768b];return _0x335af8;};'use strict';var multer=require(_0x2c76('0x0'));var util=require(_0x2c76('0x1'));var path=require(_0x2c76('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c76('0x3')]();var fs_extra=require(_0x2c76('0x4'));var auth=require(_0x2c76('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c76('0x6'));var controller=require('./whatsappQueue.controller');router[_0x2c76('0x7')]('/',auth[_0x2c76('0x8')](),controller[_0x2c76('0x9')]);router[_0x2c76('0x7')](_0x2c76('0xa'),auth['isAuthenticated'](),controller[_0x2c76('0xb')]);router[_0x2c76('0x7')]('/:id',auth[_0x2c76('0x8')](),controller[_0x2c76('0xc')]);router[_0x2c76('0x7')]('/:id/members',auth[_0x2c76('0x8')](),controller[_0x2c76('0xd')]);router[_0x2c76('0x7')]('/:id/teams',auth[_0x2c76('0x8')](),controller[_0x2c76('0xe')]);router[_0x2c76('0x7')](_0x2c76('0xf'),auth[_0x2c76('0x8')](),controller[_0x2c76('0x10')]);router[_0x2c76('0x11')]('/',auth[_0x2c76('0x8')](),controller[_0x2c76('0x12')]);router[_0x2c76('0x11')]('/:id/teams',auth[_0x2c76('0x8')](),controller[_0x2c76('0x13')]);router['post'](_0x2c76('0xf'),auth[_0x2c76('0x8')](),controller[_0x2c76('0x14')]);router['put'](_0x2c76('0x15'),auth[_0x2c76('0x8')](),controller[_0x2c76('0x16')]);router['delete'](_0x2c76('0x15'),auth[_0x2c76('0x8')](),controller[_0x2c76('0x17')]);router[_0x2c76('0x18')]('/:id/teams',auth[_0x2c76('0x8')](),controller['removeTeams']);router[_0x2c76('0x18')](_0x2c76('0xf'),auth['isAuthenticated'](),controller[_0x2c76('0x19')]);module[_0x2c76('0x1a')]=router;
\ No newline at end of file
+var _0x89f4=['../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1eda6a,_0x3ab0f3){var _0xaf152b=function(_0x4d4798){while(--_0x4d4798){_0x1eda6a['push'](_0x1eda6a['shift']());}};_0xaf152b(++_0x3ab0f3);}(_0x89f4,0xf8));var _0x489f=function(_0x3a1fa1,_0x55ef50){_0x3a1fa1=_0x3a1fa1-0x0;var _0x1bebca=_0x89f4[_0x3a1fa1];return _0x1bebca;};'use strict';var multer=require(_0x489f('0x0'));var util=require(_0x489f('0x1'));var path=require(_0x489f('0x2'));var timeout=require(_0x489f('0x3'));var express=require(_0x489f('0x4'));var router=express[_0x489f('0x5')]();var fs_extra=require(_0x489f('0x6'));var auth=require(_0x489f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x489f('0x8'));var controller=require(_0x489f('0x9'));router[_0x489f('0xa')]('/',auth[_0x489f('0xb')](),controller[_0x489f('0xc')]);router[_0x489f('0xa')](_0x489f('0xd'),auth[_0x489f('0xb')](),controller['describe']);router[_0x489f('0xa')](_0x489f('0xe'),auth[_0x489f('0xb')](),controller[_0x489f('0xf')]);router['get'](_0x489f('0x10'),auth[_0x489f('0xb')](),controller[_0x489f('0x11')]);router[_0x489f('0xa')](_0x489f('0x12'),auth[_0x489f('0xb')](),controller[_0x489f('0x13')]);router[_0x489f('0xa')](_0x489f('0x14'),auth[_0x489f('0xb')](),controller['getAgents']);router[_0x489f('0x15')]('/',auth['isAuthenticated'](),controller[_0x489f('0x16')]);router['post'](_0x489f('0x12'),auth[_0x489f('0xb')](),controller[_0x489f('0x17')]);router['post'](_0x489f('0x14'),auth[_0x489f('0xb')](),controller[_0x489f('0x18')]);router[_0x489f('0x19')](_0x489f('0xe'),auth[_0x489f('0xb')](),controller[_0x489f('0x1a')]);router['delete'](_0x489f('0xe'),auth[_0x489f('0xb')](),controller[_0x489f('0x1b')]);router[_0x489f('0x1c')](_0x489f('0x12'),auth[_0x489f('0xb')](),controller[_0x489f('0x1d')]);router['delete'](_0x489f('0x14'),auth['isAuthenticated'](),controller[_0x489f('0x1e')]);module[_0x489f('0x1f')]=router;
\ No newline at end of file
index d94d395..aa51c2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadec=['sequelize','exports','STRING','name','INTEGER','roundrobin'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0xadec,0x156));var _0xcade=function(_0x104486,_0x3a3c7a){_0x104486=_0x104486-0x0;var _0xf0756=_0xadec[_0x104486];return _0xf0756;};'use strict';var Sequelize=require(_0xcade('0x0'));module[_0xcade('0x1')]={'name':{'type':Sequelize[_0xcade('0x2')],'unique':_0xcade('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcade('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xcade('0x5'))},'description':{'type':Sequelize[_0xcade('0x2')]}};
\ No newline at end of file
+var _0xde50=['STRING','name','INTEGER','ENUM','beepall'];(function(_0x37f594,_0x40aa2c){var _0x1782c5=function(_0x14751e){while(--_0x14751e){_0x37f594['push'](_0x37f594['shift']());}};_0x1782c5(++_0x40aa2c);}(_0xde50,0x140));var _0x0de5=function(_0x4aff86,_0x54007b){_0x4aff86=_0x4aff86-0x0;var _0x16c1e7=_0xde50[_0x4aff86];return _0x16c1e7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0de5('0x0')],'unique':_0x0de5('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0de5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0de5('0x3')]('rrmemory',_0x0de5('0x4'),'roundrobin')},'description':{'type':Sequelize[_0x0de5('0x0')]}};
\ No newline at end of file
index 4d0db96..2a61b38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2faf=['to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','WhatsappQueues','UserProfileResource','stack','name','send','index','map','WhatsappQueue','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','include','findAll','params','includeAll','find','catch','create','body','user','get','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','UserWhatsappQueue','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','%s/%s','SIP','getTeams','Team','rawAttributes','addTeams','User','online','interface','flatMap','Agents','sequelize','transaction','each','ids','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','forEach','emit','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','removeAgents','isArray','getAgents','findOne','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util'];(function(_0x4ed267,_0x4733f2){var _0x2c00ef=function(_0x12baa9){while(--_0x12baa9){_0x4ed267['push'](_0x4ed267['shift']());}};_0x2c00ef(++_0x4733f2);}(_0x2faf,0x85));var _0xf2fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2faf[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf2fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2fa('0x1'));var jsonpatch=require(_0xf2fa('0x2'));var rp=require(_0xf2fa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf2fa('0x4'));var util=require(_0xf2fa('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xf2fa('0x6'));var ejs=require(_0xf2fa('0x7'));var fs=require('fs');var fs_extra=require(_0xf2fa('0x8'));var _=require('lodash');var squel=require(_0xf2fa('0x9'));var crypto=require(_0xf2fa('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf2fa('0xb'));var toCsv=require(_0xf2fa('0x6'));var querystring=require(_0xf2fa('0xc'));var Papa=require(_0xf2fa('0xd'));var Redis=require(_0xf2fa('0xe'));var authService=require(_0xf2fa('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf2fa('0x10'));var hardwareService=require(_0xf2fa('0x11'));var logger=require(_0xf2fa('0x12'))(_0xf2fa('0x13'));var utils=require(_0xf2fa('0x14'));var config=require(_0xf2fa('0x15'));var licenseUtil=require(_0xf2fa('0x16'));var db=require(_0xf2fa('0x17'))['db'];config[_0xf2fa('0x18')]=_[_0xf2fa('0x19')](config[_0xf2fa('0x18')],{'host':_0xf2fa('0x1a'),'port':0x18eb});var socket=require(_0xf2fa('0x1b'))(new Redis(config[_0xf2fa('0x18')]));require(_0xf2fa('0x1c'))[_0xf2fa('0x1d')](socket);function respondWithStatusCode(_0x102c8d,_0x282f56){_0x282f56=_0x282f56||0xcc;return function(_0x1e76e1){if(_0x1e76e1){return _0x102c8d[_0xf2fa('0x1e')](_0x282f56);}return _0x102c8d[_0xf2fa('0x1f')](_0x282f56)['end']();};}function respondWithResult(_0x38c50d,_0x153622){_0x153622=_0x153622||0xc8;return function(_0x764d9d){if(_0x764d9d){return _0x38c50d[_0xf2fa('0x1f')](_0x153622)[_0xf2fa('0x20')](_0x764d9d);}};}function respondWithFilteredResult(_0x1cc881,_0x18b594){return function(_0x43a869){if(_0x43a869){var _0x1ce1ae=typeof _0x18b594[_0xf2fa('0x21')]===_0xf2fa('0x22')&&typeof _0x18b594['limit']===_0xf2fa('0x22');var _0x441e9c=_0x43a869[_0xf2fa('0x23')];var _0x92cc3a=_0x1ce1ae?0x0:_0x18b594[_0xf2fa('0x21')];var _0x55c907=_0x1ce1ae?_0x43a869[_0xf2fa('0x23')]:_0x18b594[_0xf2fa('0x21')]+_0x18b594[_0xf2fa('0x24')];var _0x88e824;if(_0x55c907>=_0x441e9c){_0x55c907=_0x441e9c;_0x88e824=0xc8;}else{_0x88e824=0xce;}_0x1cc881[_0xf2fa('0x1f')](_0x88e824);return _0x1cc881[_0xf2fa('0x25')](_0xf2fa('0x26'),_0x92cc3a+'-'+_0x55c907+'/'+_0x441e9c)['json'](_0x43a869);}return null;};}function patchUpdates(_0x2aa5f1){return function(_0x40ef1a){try{jsonpatch[_0xf2fa('0x27')](_0x40ef1a,_0x2aa5f1,!![]);}catch(_0xca19d7){return BPromise[_0xf2fa('0x28')](_0xca19d7);}return _0x40ef1a['save']();};}function saveUpdates(_0x4636ef,_0x5a5c87){return function(_0x2d888a){if(_0x2d888a){return _0x2d888a['update'](_0x4636ef)[_0xf2fa('0x29')](function(_0xa2c7ab){return _0xa2c7ab;});}return null;};}function removeEntity(_0x2d934a,_0x39d74c){return function(_0xcc07df){if(_0xcc07df){return _0xcc07df[_0xf2fa('0x2a')]()[_0xf2fa('0x29')](function(){var _0x1e43e4=_0xcc07df['get']({'plain':!![]});var _0x236d11=_0xf2fa('0x2b');return db[_0xf2fa('0x2c')]['destroy']({'where':{'type':_0x236d11,'resourceId':_0x1e43e4['id']}})[_0xf2fa('0x29')](function(){return _0xcc07df;});})[_0xf2fa('0x29')](function(){_0x2d934a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a2562,_0x19ed42){return function(_0xe34a18){if(!_0xe34a18){_0x2a2562[_0xf2fa('0x1e')](0x194);}return _0xe34a18;};}function handleError(_0xf44487,_0x403720){_0x403720=_0x403720||0x1f4;return function(_0x42b325){logger['error'](_0x42b325[_0xf2fa('0x2d')]);if(_0x42b325[_0xf2fa('0x2e')]){delete _0x42b325[_0xf2fa('0x2e')];}_0xf44487[_0xf2fa('0x1f')](_0x403720)[_0xf2fa('0x2f')](_0x42b325);};}exports[_0xf2fa('0x30')]=function(_0x4ec672,_0x27d6b8){var _0xba88f9={},_0x15f9f1={},_0x274d5f={'count':0x0,'rows':[]};var _0x3265c5=_[_0xf2fa('0x31')](db[_0xf2fa('0x32')]['rawAttributes'],function(_0x236e9f){return{'name':_0x236e9f[_0xf2fa('0x33')],'type':_0x236e9f['type'][_0xf2fa('0x34')]};});_0x15f9f1['model']=_[_0xf2fa('0x31')](_0x3265c5,_0xf2fa('0x2e'));_0x15f9f1[_0xf2fa('0x35')]=_[_0xf2fa('0x36')](_0x4ec672[_0xf2fa('0x35')]);_0x15f9f1[_0xf2fa('0x37')]=_[_0xf2fa('0x38')](_0x15f9f1['model'],_0x15f9f1[_0xf2fa('0x35')]);_0xba88f9[_0xf2fa('0x39')]=_[_0xf2fa('0x38')](_0x15f9f1[_0xf2fa('0x3a')],qs[_0xf2fa('0x3b')](_0x4ec672[_0xf2fa('0x35')][_0xf2fa('0x3b')]));_0xba88f9[_0xf2fa('0x39')]=_0xba88f9[_0xf2fa('0x39')][_0xf2fa('0x3c')]?_0xba88f9[_0xf2fa('0x39')]:_0x15f9f1['model'];if(!_0x4ec672[_0xf2fa('0x35')][_0xf2fa('0x3d')](_0xf2fa('0x3e'))){_0xba88f9[_0xf2fa('0x24')]=qs['limit'](_0x4ec672[_0xf2fa('0x35')][_0xf2fa('0x24')]);_0xba88f9[_0xf2fa('0x21')]=qs['offset'](_0x4ec672[_0xf2fa('0x35')][_0xf2fa('0x21')]);}_0xba88f9[_0xf2fa('0x3f')]=qs[_0xf2fa('0x40')](_0x4ec672[_0xf2fa('0x35')]['sort']);_0xba88f9['where']=qs[_0xf2fa('0x37')](_[_0xf2fa('0x41')](_0x4ec672[_0xf2fa('0x35')],_0x15f9f1['filters']),_0x3265c5);if(_0x4ec672[_0xf2fa('0x35')][_0xf2fa('0x42')]){_0xba88f9[_0xf2fa('0x43')]=_[_0xf2fa('0x44')](_0xba88f9['where'],{'$or':_[_0xf2fa('0x31')](_0x3265c5,function(_0x2cd6da){if(_0x2cd6da[_0xf2fa('0x45')]!=='VIRTUAL'){var _0xc626f9={};_0xc626f9[_0x2cd6da[_0xf2fa('0x2e')]]={'$like':'%'+_0x4ec672[_0xf2fa('0x35')][_0xf2fa('0x42')]+'%'};return _0xc626f9;}})});}_0xba88f9=_[_0xf2fa('0x44')]({},_0xba88f9,_0x4ec672[_0xf2fa('0x46')]);var _0x527011={'where':_0xba88f9['where']};return db[_0xf2fa('0x32')][_0xf2fa('0x23')](_0x527011)[_0xf2fa('0x29')](function(_0x182ea8){_0x274d5f[_0xf2fa('0x23')]=_0x182ea8;if(_0x4ec672[_0xf2fa('0x35')]['includeAll']){_0xba88f9[_0xf2fa('0x47')]=[{'all':!![]}];}return db[_0xf2fa('0x32')][_0xf2fa('0x48')](_0xba88f9);})['then'](function(_0x3651c0){_0x274d5f['rows']=_0x3651c0;return _0x274d5f;})[_0xf2fa('0x29')](respondWithFilteredResult(_0x27d6b8,_0xba88f9))['catch'](handleError(_0x27d6b8,null));};exports['show']=function(_0x127e6a,_0x40e325){var _0x494bbb={'raw':!![],'where':{'id':_0x127e6a[_0xf2fa('0x49')]['id']}},_0x35f977={};_0x35f977['model']=_['keys'](db['WhatsappQueue']['rawAttributes']);_0x35f977[_0xf2fa('0x35')]=_[_0xf2fa('0x36')](_0x127e6a['query']);_0x35f977[_0xf2fa('0x37')]=_[_0xf2fa('0x38')](_0x35f977['model'],_0x35f977['query']);_0x494bbb[_0xf2fa('0x39')]=_[_0xf2fa('0x38')](_0x35f977['model'],qs[_0xf2fa('0x3b')](_0x127e6a[_0xf2fa('0x35')][_0xf2fa('0x3b')]));_0x494bbb[_0xf2fa('0x39')]=_0x494bbb['attributes'][_0xf2fa('0x3c')]?_0x494bbb[_0xf2fa('0x39')]:_0x35f977[_0xf2fa('0x3a')];if(_0x127e6a[_0xf2fa('0x35')][_0xf2fa('0x4a')]){_0x494bbb[_0xf2fa('0x47')]=[{'all':!![]}];}_0x494bbb=_[_0xf2fa('0x44')]({},_0x494bbb,_0x127e6a[_0xf2fa('0x46')]);return db[_0xf2fa('0x32')][_0xf2fa('0x4b')](_0x494bbb)[_0xf2fa('0x29')](handleEntityNotFound(_0x40e325,null))[_0xf2fa('0x29')](respondWithResult(_0x40e325,null))[_0xf2fa('0x4c')](handleError(_0x40e325,null));};exports[_0xf2fa('0x4d')]=function(_0x49b337,_0x4a5eee){return db[_0xf2fa('0x32')]['create'](_0x49b337[_0xf2fa('0x4e')],{})[_0xf2fa('0x29')](function(_0x40ca27){var _0x110b40=_0x49b337[_0xf2fa('0x4f')][_0xf2fa('0x50')]({'plain':!![]});if(!_0x110b40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x110b40[_0xf2fa('0x51')]===_0xf2fa('0x4f')){var _0x405004=_0x40ca27[_0xf2fa('0x50')]({'plain':!![]});var _0x15addb=_0xf2fa('0x2b');return db[_0xf2fa('0x52')][_0xf2fa('0x4b')]({'where':{'name':_0x15addb,'userProfileId':_0x110b40[_0xf2fa('0x53')]},'raw':!![]})[_0xf2fa('0x29')](function(_0x460f7c){if(_0x460f7c&&_0x460f7c['autoAssociation']===0x0){return db[_0xf2fa('0x2c')][_0xf2fa('0x4d')]({'name':_0x405004[_0xf2fa('0x2e')],'resourceId':_0x405004['id'],'type':_0x460f7c['name'],'sectionId':_0x460f7c['id']},{})[_0xf2fa('0x29')](function(){return _0x40ca27;});}else{return _0x40ca27;}})[_0xf2fa('0x4c')](function(_0x118257){logger[_0xf2fa('0x54')](_0xf2fa('0x55'),_0x118257);throw _0x118257;});}return _0x40ca27;})['then'](respondWithResult(_0x4a5eee,0xc9))[_0xf2fa('0x4c')](handleError(_0x4a5eee,null));};exports[_0xf2fa('0x56')]=function(_0x33b6d9,_0x526ddd){if(_0x33b6d9[_0xf2fa('0x4e')]['id']){delete _0x33b6d9[_0xf2fa('0x4e')]['id'];}return db[_0xf2fa('0x32')][_0xf2fa('0x4b')]({'where':{'id':_0x33b6d9['params']['id']}})[_0xf2fa('0x29')](handleEntityNotFound(_0x526ddd,null))[_0xf2fa('0x29')](saveUpdates(_0x33b6d9[_0xf2fa('0x4e')],null))[_0xf2fa('0x29')](respondWithResult(_0x526ddd,null))[_0xf2fa('0x4c')](handleError(_0x526ddd,null));};exports[_0xf2fa('0x2a')]=function(_0x50497d,_0x106789){return db['WhatsappQueue'][_0xf2fa('0x4b')]({'where':{'id':_0x50497d['params']['id']}})[_0xf2fa('0x29')](handleEntityNotFound(_0x106789,null))[_0xf2fa('0x29')](removeEntity(_0x106789,null))[_0xf2fa('0x4c')](handleError(_0x106789,null));};exports['describe']=function(_0x46eaa5,_0x2de54e){return db[_0xf2fa('0x32')]['describe']()[_0xf2fa('0x29')](respondWithResult(_0x2de54e,null))[_0xf2fa('0x4c')](handleError(_0x2de54e,null));};exports[_0xf2fa('0x57')]=function(_0x38aca9,_0x5bf84a,_0x1f4618){var _0x2ea837={'raw':!![],'where':{}},_0x2c5217={},_0x89698e;return db[_0xf2fa('0x32')]['findOne']({'where':{'id':_0x38aca9['params']['id']}})[_0xf2fa('0x29')](handleEntityNotFound(_0x5bf84a,null))[_0xf2fa('0x29')](function(_0x3a07db){if(_0x3a07db){_0x89698e=_0x3a07db[_0xf2fa('0x50')]({'plain':!![]});_0x2c5217[_0xf2fa('0x3a')]=_[_0xf2fa('0x36')](db[_0xf2fa('0x58')]['rawAttributes']);_0x2c5217[_0xf2fa('0x35')]=_['keys'](_0x38aca9[_0xf2fa('0x35')]);_0x2c5217['filters']=_[_0xf2fa('0x38')](_0x2c5217[_0xf2fa('0x3a')],_0x2c5217['query']);_0x2ea837[_0xf2fa('0x39')]=_[_0xf2fa('0x38')](_0x2c5217[_0xf2fa('0x3a')],qs['fields'](_0x38aca9[_0xf2fa('0x35')][_0xf2fa('0x3b')]));_0x2ea837[_0xf2fa('0x39')]=_0x2ea837[_0xf2fa('0x39')][_0xf2fa('0x3c')]?_0x2ea837['attributes']:_0x2c5217[_0xf2fa('0x3a')];if(!_0x38aca9[_0xf2fa('0x35')][_0xf2fa('0x3d')](_0xf2fa('0x3e'))){_0x2ea837[_0xf2fa('0x24')]=qs[_0xf2fa('0x24')](_0x38aca9[_0xf2fa('0x35')][_0xf2fa('0x24')]);_0x2ea837[_0xf2fa('0x21')]=qs['offset'](_0x38aca9['query'][_0xf2fa('0x21')]);}_0x2ea837[_0xf2fa('0x3f')]=qs[_0xf2fa('0x40')](_0x38aca9[_0xf2fa('0x35')][_0xf2fa('0x40')]);_0x2ea837[_0xf2fa('0x43')]=qs[_0xf2fa('0x37')](_[_0xf2fa('0x41')](_0x38aca9['query'],_0x2c5217[_0xf2fa('0x37')]));_0x2ea837['where'][_0xf2fa('0x59')]=_0x3a07db['id'];if(_0x38aca9[_0xf2fa('0x35')]['filter']){_0x2ea837[_0xf2fa('0x43')]=_['merge'](_0x2ea837['where'],{'$or':_[_0xf2fa('0x31')](_0x2ea837[_0xf2fa('0x39')],function(_0xa53405){var _0x205005={};_0x205005[_0xa53405]={'$like':'%'+_0x38aca9[_0xf2fa('0x35')]['filter']+'%'};return _0x205005;})});}_0x2ea837=_[_0xf2fa('0x44')]({},_0x2ea837,_0x38aca9[_0xf2fa('0x46')]);return db[_0xf2fa('0x58')]['findAll'](_0x2ea837);}})[_0xf2fa('0x29')](function(_0x37616b){if(_0x37616b){return db['User'][_0xf2fa('0x5a')]({'where':{'id':_[_0xf2fa('0x31')](_0x37616b,_0xf2fa('0x5b')),'role':_0xf2fa('0x5c')},'attributes':['id',_0xf2fa('0x2e'),_0xf2fa('0x5d'),_0xf2fa('0x5e'),'createdAt']});}})[_0xf2fa('0x29')](function(_0x386d80){if(_0x386d80){return{'count':_0x386d80['count'],'rows':_[_0xf2fa('0x31')](_0x386d80['rows'],function(_0x402a13){return{'membername':_0x402a13[_0xf2fa('0x2e')],'UserId':_0x402a13['id'],'queue_name':_0x89698e[_0xf2fa('0x2e')],'WhatsappQueueId':_0x89698e['id'],'interface':util['format'](_0xf2fa('0x5f'),_0xf2fa('0x60'),_0x402a13['name']),'penalty':0x0,'paused':_0x402a13[_0xf2fa('0x5d')],'createdAt':_0x402a13['createdAt'],'updatedAt':_0x402a13['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf2fa('0x29')](respondWithFilteredResult(_0x5bf84a,_0x2ea837))[_0xf2fa('0x4c')](handleError(_0x5bf84a,null));};exports[_0xf2fa('0x61')]=function(_0x4fe4ab,_0x39003c,_0x4bc20e){var _0x14b1e5={};var _0x389db7={};var _0x5cf874;var _0x3da2fd;return db['WhatsappQueue']['findOne']({'where':{'id':_0x4fe4ab[_0xf2fa('0x49')]['id']}})[_0xf2fa('0x29')](handleEntityNotFound(_0x39003c,null))[_0xf2fa('0x29')](function(_0x138ab9){if(_0x138ab9){_0x5cf874=_0x138ab9;_0x389db7[_0xf2fa('0x3a')]=_['keys'](db[_0xf2fa('0x62')][_0xf2fa('0x63')]);_0x389db7['query']=_[_0xf2fa('0x36')](_0x4fe4ab[_0xf2fa('0x35')]);_0x389db7['filters']=_[_0xf2fa('0x38')](_0x389db7[_0xf2fa('0x3a')],_0x389db7[_0xf2fa('0x35')]);_0x14b1e5[_0xf2fa('0x39')]=_[_0xf2fa('0x38')](_0x389db7[_0xf2fa('0x3a')],qs[_0xf2fa('0x3b')](_0x4fe4ab[_0xf2fa('0x35')][_0xf2fa('0x3b')]));_0x14b1e5[_0xf2fa('0x39')]=_0x14b1e5['attributes'][_0xf2fa('0x3c')]?_0x14b1e5[_0xf2fa('0x39')]:_0x389db7[_0xf2fa('0x3a')];_0x14b1e5[_0xf2fa('0x3f')]=qs[_0xf2fa('0x40')](_0x4fe4ab['query'][_0xf2fa('0x40')]);_0x14b1e5[_0xf2fa('0x43')]=qs['filters'](_[_0xf2fa('0x41')](_0x4fe4ab['query'],_0x389db7['filters']));if(_0x4fe4ab[_0xf2fa('0x35')][_0xf2fa('0x42')]){_0x14b1e5['where']=_[_0xf2fa('0x44')](_0x14b1e5[_0xf2fa('0x43')],{'$or':_[_0xf2fa('0x31')](_0x14b1e5[_0xf2fa('0x39')],function(_0x70b70d){var _0x3cf404={};_0x3cf404[_0x70b70d]={'$like':'%'+_0x4fe4ab[_0xf2fa('0x35')]['filter']+'%'};return _0x3cf404;})});}_0x14b1e5=_[_0xf2fa('0x44')]({},_0x14b1e5,_0x4fe4ab[_0xf2fa('0x46')]);return _0x5cf874[_0xf2fa('0x61')](_0x14b1e5);}})['then'](function(_0x79d6c5){if(_0x79d6c5){_0x3da2fd=_0x79d6c5['length'];if(!_0x4fe4ab['query'][_0xf2fa('0x3d')](_0xf2fa('0x3e'))){_0x14b1e5[_0xf2fa('0x24')]=qs[_0xf2fa('0x24')](_0x4fe4ab[_0xf2fa('0x35')][_0xf2fa('0x24')]);_0x14b1e5['offset']=qs[_0xf2fa('0x21')](_0x4fe4ab[_0xf2fa('0x35')][_0xf2fa('0x21')]);}return _0x5cf874[_0xf2fa('0x61')](_0x14b1e5);}})[_0xf2fa('0x29')](function(_0x112085){if(_0x112085){return _0x112085?{'count':_0x3da2fd,'rows':_0x112085}:null;}})[_0xf2fa('0x29')](respondWithResult(_0x39003c,null))[_0xf2fa('0x4c')](handleError(_0x39003c,null));};exports[_0xf2fa('0x64')]=function(_0x21936d,_0x578f6a,_0x127282){var _0xc39fa1=_0x21936d['body']['ids'];return db['Team']['findAll']({'where':{'id':_0xc39fa1},'attributes':['id'],'include':[{'model':db[_0xf2fa('0x65')],'as':'Agents','attributes':['id',_0xf2fa('0x2e'),_0xf2fa('0x66'),'voicePause',_0xf2fa('0x67')],'raw':!![]}]})[_0xf2fa('0x29')](function(_0x53d921){if(_0x53d921){var _0x5da9ed=_[_0xf2fa('0x68')](_0x53d921,function(_0x3118ea){var _0x4cbc43=_0x3118ea[_0xf2fa('0x50')]({'plain':!![]});return _0x4cbc43[_0xf2fa('0x69')];});return db[_0xf2fa('0x32')][_0xf2fa('0x4b')]({'where':{'id':_0x21936d['params']['id']}})[_0xf2fa('0x29')](function(_0x39c93b){return db[_0xf2fa('0x6a')][_0xf2fa('0x6b')](function(_0x20df69){return _0x39c93b[_0xf2fa('0x64')](_0xc39fa1,{'transaction':_0x20df69})[_0xf2fa('0x29')](function(){return BPromise[_0xf2fa('0x6c')](_0x5da9ed,function(_0x485e01){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x485e01['id'],'WhatsappQueueId':_0x21936d['params']['id']},'transaction':_0x20df69});});})[_0xf2fa('0x29')](function(){_0x5da9ed['forEach'](function(_0x789efc){socket['emit']('userWhatsappQueue:save',{'UserId':_0x789efc['id'],'WhatsappQueueId':_0x39c93b['id']});});});});});}})[_0xf2fa('0x29')](respondWithStatusCode(_0x578f6a,null))[_0xf2fa('0x4c')](handleError(_0x578f6a,null));};exports['removeTeams']=function(_0x10bcf8,_0x5959b1,_0x4d749d){return db[_0xf2fa('0x62')][_0xf2fa('0x48')]({'where':{'id':_0x10bcf8[_0xf2fa('0x35')][_0xf2fa('0x6d')]},'attributes':['id'],'include':[{'model':db[_0xf2fa('0x65')],'as':_0xf2fa('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5959b1,null))[_0xf2fa('0x29')](function(_0x7805f2){var _0x4e1e58=_[_0xf2fa('0x31')](_0x7805f2,'id');var _0x413a4d=[];var _0x5c3a9f=[];var _0x1c0099=squel[_0xf2fa('0x6e')]();_0x1c0099['field'](_0xf2fa('0x6f'))[_0xf2fa('0x70')](_0xf2fa('0x71'),'tq')[_0xf2fa('0x72')]('user_has_teams','ut',_0xf2fa('0x73'))[_0xf2fa('0x43')]('WhatsappQueueId\x20=\x20?',_0x10bcf8[_0xf2fa('0x49')]['id']);for(var _0x56e3d3=0x0;_0x56e3d3<_0x7805f2[_0xf2fa('0x3c')];_0x56e3d3+=0x1){let _0xfa28b4=_0x7805f2[_0x56e3d3];for(var _0x35077c=0x0;_0x35077c<_0xfa28b4['Agents'][_0xf2fa('0x3c')];_0x35077c+=0x1){let _0x2947cc=_0xfa28b4[_0xf2fa('0x69')][_0x35077c];var _0x4c8d6d=_0x1c0099['clone']();_0x4c8d6d['where'](_0xf2fa('0x74'),_0x2947cc['id']);_0x5c3a9f[_0xf2fa('0x75')](db[_0xf2fa('0x6a')][_0xf2fa('0x35')](_0x4c8d6d[_0xf2fa('0x76')](),{'type':db[_0xf2fa('0x6a')][_0xf2fa('0x77')]['SELECT']})[_0xf2fa('0x29')](function(_0x5a5deb){if(_0x5a5deb[_0xf2fa('0x3c')]===0x1){return _0x2947cc['id'];}else{var _0x1f6b5e=_[_0xf2fa('0x78')](_[_0xf2fa('0x31')](_0x5a5deb,_0xf2fa('0x79')),function(_0x3398df){return _[_0xf2fa('0x7a')](_0x4e1e58,_0x3398df);});if(_0x1f6b5e){return _0x2947cc['id'];}}}));}}return BPromise[_0xf2fa('0x7b')](_0x5c3a9f)[_0xf2fa('0x29')](function(_0x598a85){_0x413a4d=_(_0x413a4d)[_0xf2fa('0x7c')](_0x598a85)[_0xf2fa('0x7d')]()[_0xf2fa('0x7e')]();return db['WhatsappQueue'][_0xf2fa('0x4b')]({'where':{'id':_0x10bcf8[_0xf2fa('0x49')]['id']}})['then'](function(_0x16139c){return db[_0xf2fa('0x6a')][_0xf2fa('0x6b')](function(_0x198c12){return _0x16139c[_0xf2fa('0x7f')](_0x10bcf8[_0xf2fa('0x35')][_0xf2fa('0x6d')],{'transaction':_0x198c12})[_0xf2fa('0x29')](function(){if(!_[_0xf2fa('0x80')](_0x413a4d)){return _0x16139c['removeAgents'](_0x413a4d,{'transaction':_0x198c12});}})[_0xf2fa('0x29')](function(){_0x413a4d[_0xf2fa('0x81')](function(_0x534559){socket[_0xf2fa('0x82')](_0xf2fa('0x83'),{'UserId':_0x534559,'WhatsappQueueId':_0x16139c['id']});});});});});});})[_0xf2fa('0x29')](respondWithStatusCode(_0x5959b1,null))[_0xf2fa('0x4c')](handleError(_0x5959b1,null));};exports[_0xf2fa('0x84')]=function(_0x551834,_0x5f1a60,_0x130345){return db[_0xf2fa('0x32')]['find']({'where':{'id':_0x551834[_0xf2fa('0x49')]['id']}})[_0xf2fa('0x29')](handleEntityNotFound(_0x5f1a60,null))[_0xf2fa('0x29')](function(_0x1cddb4){if(_0x1cddb4){return _0x1cddb4[_0xf2fa('0x84')](_0x551834[_0xf2fa('0x4e')][_0xf2fa('0x6d')],_[_0xf2fa('0x85')](_0x551834[_0xf2fa('0x4e')],[_0xf2fa('0x6d'),'id'])||{})['spread'](function(_0xd4cc3d){for(var _0x4b8b90=0x0;_0x4b8b90<_0x551834[_0xf2fa('0x4e')]['ids'][_0xf2fa('0x3c')];_0x4b8b90+=0x1){socket[_0xf2fa('0x82')](_0xf2fa('0x86'),{'UserId':Number(_0x551834['body']['ids'][_0x4b8b90]),'WhatsappQueueId':Number(_0x551834[_0xf2fa('0x49')]['id'])});}return _0xd4cc3d;});}})['then'](respondWithResult(_0x5f1a60,null))[_0xf2fa('0x4c')](handleError(_0x5f1a60,null));};exports[_0xf2fa('0x87')]=function(_0x4a1969,_0x19fed2,_0x44ebbe){return db['WhatsappQueue']['find']({'where':{'id':_0x4a1969['params']['id']}})[_0xf2fa('0x29')](handleEntityNotFound(_0x19fed2,null))[_0xf2fa('0x29')](function(_0x223eb4){if(_0x223eb4){return _0x223eb4[_0xf2fa('0x87')](_0x4a1969[_0xf2fa('0x35')]['ids'])[_0xf2fa('0x29')](function(){if(_[_0xf2fa('0x88')](_0x4a1969[_0xf2fa('0x35')][_0xf2fa('0x6d')])){for(var _0x3f91fd=0x0;_0x3f91fd<_0x4a1969['query'][_0xf2fa('0x6d')][_0xf2fa('0x3c')];_0x3f91fd+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x4a1969[_0xf2fa('0x35')][_0xf2fa('0x6d')][_0x3f91fd]),'WhatsappQueueId':Number(_0x4a1969['params']['id'])});}}else{socket[_0xf2fa('0x82')](_0xf2fa('0x83'),{'UserId':Number(_0x4a1969[_0xf2fa('0x35')][_0xf2fa('0x6d')]),'WhatsappQueueId':Number(_0x4a1969['params']['id'])});}});}})[_0xf2fa('0x29')](respondWithStatusCode(_0x19fed2,null))[_0xf2fa('0x4c')](handleError(_0x19fed2,null));};exports[_0xf2fa('0x89')]=function(_0x1c1319,_0x224446,_0x25c016){var _0xf4d7e0={};var _0x57ab72={};var _0x314645;var _0x5decda;return db['WhatsappQueue'][_0xf2fa('0x8a')]({'where':{'id':_0x1c1319[_0xf2fa('0x49')]['id']}})['then'](handleEntityNotFound(_0x224446,null))[_0xf2fa('0x29')](function(_0x5bfa2a){if(_0x5bfa2a){_0x314645=_0x5bfa2a;_0x57ab72[_0xf2fa('0x3a')]=_['keys'](db[_0xf2fa('0x65')][_0xf2fa('0x63')]);_0x57ab72['query']=_[_0xf2fa('0x36')](_0x1c1319[_0xf2fa('0x35')]);_0x57ab72[_0xf2fa('0x37')]=_['intersection'](_0x57ab72['model'],_0x57ab72[_0xf2fa('0x35')]);_0xf4d7e0['attributes']=_[_0xf2fa('0x38')](_0x57ab72[_0xf2fa('0x3a')],qs[_0xf2fa('0x3b')](_0x1c1319[_0xf2fa('0x35')][_0xf2fa('0x3b')]));_0xf4d7e0['attributes']=_0xf4d7e0[_0xf2fa('0x39')][_0xf2fa('0x3c')]?_0xf4d7e0['attributes']:_0x57ab72[_0xf2fa('0x3a')];_0xf4d7e0['order']=qs['sort'](_0x1c1319[_0xf2fa('0x35')][_0xf2fa('0x40')]);_0xf4d7e0[_0xf2fa('0x43')]=qs[_0xf2fa('0x37')](_[_0xf2fa('0x41')](_0x1c1319[_0xf2fa('0x35')],_0x57ab72[_0xf2fa('0x37')]));if(_0x1c1319[_0xf2fa('0x35')][_0xf2fa('0x42')]){_0xf4d7e0['where']=_[_0xf2fa('0x44')](_0xf4d7e0[_0xf2fa('0x43')],{'$or':_[_0xf2fa('0x31')](_0xf4d7e0[_0xf2fa('0x39')],function(_0x5c9996){var _0x2d276e={};_0x2d276e[_0x5c9996]={'$like':'%'+_0x1c1319['query'][_0xf2fa('0x42')]+'%'};return _0x2d276e;})});}_0xf4d7e0=_[_0xf2fa('0x44')]({},_0xf4d7e0,_0x1c1319[_0xf2fa('0x46')]);return _0x314645[_0xf2fa('0x89')](_0xf4d7e0);}})[_0xf2fa('0x29')](function(_0x207996){if(_0x207996){_0x5decda=_0x207996[_0xf2fa('0x3c')];if(!_0x1c1319[_0xf2fa('0x35')][_0xf2fa('0x3d')]('nolimit')){_0xf4d7e0[_0xf2fa('0x24')]=qs[_0xf2fa('0x24')](_0x1c1319['query'][_0xf2fa('0x24')]);_0xf4d7e0[_0xf2fa('0x21')]=qs[_0xf2fa('0x21')](_0x1c1319[_0xf2fa('0x35')][_0xf2fa('0x21')]);}return _0x314645[_0xf2fa('0x89')](_0xf4d7e0);}})[_0xf2fa('0x29')](function(_0x513f91){if(_0x513f91){return _0x513f91?{'count':_0x5decda,'rows':_0x513f91}:null;}})[_0xf2fa('0x29')](respondWithResult(_0x224446,null))[_0xf2fa('0x4c')](handleError(_0x224446,null));};
\ No newline at end of file
+var _0xac9a=['%s/%s','whatsappPause','getTeams','Team','addTeams','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','toString','sequelize','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','name','send','index','WhatsappQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappQueues','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserWhatsappQueue','sort','merge','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xac9a,0x1ce));var _0xaac9=function(_0x339acf,_0x55bb46){_0x339acf=_0x339acf-0x0;var _0x5d66f4=_0xac9a[_0x339acf];return _0x5d66f4;};'use strict';var emlformat=require(_0xaac9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaac9('0x1'));var jsonpatch=require(_0xaac9('0x2'));var rp=require('request-promise');var moment=require(_0xaac9('0x3'));var BPromise=require(_0xaac9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaac9('0x5'));var sox=require(_0xaac9('0x6'));var csv=require(_0xaac9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaac9('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaac9('0x9'));var jsforce=require(_0xaac9('0xa'));var deskjs=require(_0xaac9('0xb'));var toCsv=require(_0xaac9('0x7'));var querystring=require(_0xaac9('0xc'));var Papa=require(_0xaac9('0xd'));var Redis=require(_0xaac9('0xe'));var authService=require(_0xaac9('0xf'));var qs=require(_0xaac9('0x10'));var as=require(_0xaac9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaac9('0x12'))(_0xaac9('0x13'));var utils=require(_0xaac9('0x14'));var config=require(_0xaac9('0x15'));var licenseUtil=require(_0xaac9('0x16'));var db=require(_0xaac9('0x17'))['db'];config['redis']=_[_0xaac9('0x18')](config[_0xaac9('0x19')],{'host':_0xaac9('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaac9('0x19')]));require(_0xaac9('0x1b'))[_0xaac9('0x1c')](socket);function respondWithStatusCode(_0x193dc5,_0xc29ee0){_0xc29ee0=_0xc29ee0||0xcc;return function(_0x1dad81){if(_0x1dad81){return _0x193dc5[_0xaac9('0x1d')](_0xc29ee0);}return _0x193dc5[_0xaac9('0x1e')](_0xc29ee0)['end']();};}function respondWithResult(_0x26649b,_0x576ae3){_0x576ae3=_0x576ae3||0xc8;return function(_0x5a730d){if(_0x5a730d){return _0x26649b[_0xaac9('0x1e')](_0x576ae3)[_0xaac9('0x1f')](_0x5a730d);}};}function respondWithFilteredResult(_0x557119,_0x37ef41){return function(_0x760ad5){if(_0x760ad5){var _0x26b511=typeof _0x37ef41[_0xaac9('0x20')]===_0xaac9('0x21')&&typeof _0x37ef41[_0xaac9('0x22')]==='undefined';var _0x2ad28b=_0x760ad5[_0xaac9('0x23')];var _0x366528=_0x26b511?0x0:_0x37ef41[_0xaac9('0x20')];var _0x5b1941=_0x26b511?_0x760ad5[_0xaac9('0x23')]:_0x37ef41[_0xaac9('0x20')]+_0x37ef41[_0xaac9('0x22')];var _0x4a0c01;if(_0x5b1941>=_0x2ad28b){_0x5b1941=_0x2ad28b;_0x4a0c01=0xc8;}else{_0x4a0c01=0xce;}_0x557119[_0xaac9('0x1e')](_0x4a0c01);return _0x557119[_0xaac9('0x24')](_0xaac9('0x25'),_0x366528+'-'+_0x5b1941+'/'+_0x2ad28b)[_0xaac9('0x1f')](_0x760ad5);}return null;};}function patchUpdates(_0x486af3){return function(_0x42a295){try{jsonpatch[_0xaac9('0x26')](_0x42a295,_0x486af3,!![]);}catch(_0x1003b2){return BPromise['reject'](_0x1003b2);}return _0x42a295[_0xaac9('0x27')]();};}function saveUpdates(_0x5a5658,_0x2a0178){return function(_0x9593ff){if(_0x9593ff){return _0x9593ff[_0xaac9('0x28')](_0x5a5658)[_0xaac9('0x29')](function(_0x5248e7){return _0x5248e7;});}return null;};}function removeEntity(_0x212d7c,_0xe048b4){return function(_0x5dc441){if(_0x5dc441){return _0x5dc441[_0xaac9('0x2a')]()[_0xaac9('0x29')](function(){var _0x49cb00=_0x5dc441[_0xaac9('0x2b')]({'plain':!![]});var _0x23f7ba='WhatsappQueues';return db[_0xaac9('0x2c')][_0xaac9('0x2a')]({'where':{'type':_0x23f7ba,'resourceId':_0x49cb00['id']}})['then'](function(){return _0x5dc441;});})[_0xaac9('0x29')](function(){_0x212d7c[_0xaac9('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8abdec,_0x394f61){return function(_0x12a005){if(!_0x12a005){_0x8abdec[_0xaac9('0x1d')](0x194);}return _0x12a005;};}function handleError(_0x574bad,_0x4b1116){_0x4b1116=_0x4b1116||0x1f4;return function(_0xb19bc9){logger['error'](_0xb19bc9['stack']);if(_0xb19bc9['name']){delete _0xb19bc9[_0xaac9('0x2d')];}_0x574bad[_0xaac9('0x1e')](_0x4b1116)[_0xaac9('0x2e')](_0xb19bc9);};}exports[_0xaac9('0x2f')]=function(_0x5d1d46,_0x1b22f6){var _0x383b88={},_0xa13911={},_0x359ef5={'count':0x0,'rows':[]};var _0x1c1f3a=_['map'](db[_0xaac9('0x30')][_0xaac9('0x31')],function(_0x1d3591){return{'name':_0x1d3591['fieldName'],'type':_0x1d3591[_0xaac9('0x32')][_0xaac9('0x33')]};});_0xa13911[_0xaac9('0x34')]=_[_0xaac9('0x35')](_0x1c1f3a,_0xaac9('0x2d'));_0xa13911[_0xaac9('0x36')]=_[_0xaac9('0x37')](_0x5d1d46[_0xaac9('0x36')]);_0xa13911[_0xaac9('0x38')]=_[_0xaac9('0x39')](_0xa13911[_0xaac9('0x34')],_0xa13911[_0xaac9('0x36')]);_0x383b88[_0xaac9('0x3a')]=_[_0xaac9('0x39')](_0xa13911[_0xaac9('0x34')],qs[_0xaac9('0x3b')](_0x5d1d46[_0xaac9('0x36')][_0xaac9('0x3b')]));_0x383b88[_0xaac9('0x3a')]=_0x383b88['attributes'][_0xaac9('0x3c')]?_0x383b88['attributes']:_0xa13911[_0xaac9('0x34')];if(!_0x5d1d46[_0xaac9('0x36')][_0xaac9('0x3d')](_0xaac9('0x3e'))){_0x383b88['limit']=qs['limit'](_0x5d1d46[_0xaac9('0x36')][_0xaac9('0x22')]);_0x383b88[_0xaac9('0x20')]=qs[_0xaac9('0x20')](_0x5d1d46[_0xaac9('0x36')][_0xaac9('0x20')]);}_0x383b88[_0xaac9('0x3f')]=qs['sort'](_0x5d1d46['query']['sort']);_0x383b88[_0xaac9('0x40')]=qs[_0xaac9('0x38')](_[_0xaac9('0x41')](_0x5d1d46[_0xaac9('0x36')],_0xa13911[_0xaac9('0x38')]),_0x1c1f3a);if(_0x5d1d46['query']['filter']){_0x383b88[_0xaac9('0x40')]=_['merge'](_0x383b88[_0xaac9('0x40')],{'$or':_[_0xaac9('0x35')](_0x1c1f3a,function(_0x56fc56){if(_0x56fc56[_0xaac9('0x32')]!==_0xaac9('0x42')){var _0x544ae4={};_0x544ae4[_0x56fc56['name']]={'$like':'%'+_0x5d1d46[_0xaac9('0x36')][_0xaac9('0x43')]+'%'};return _0x544ae4;}})});}_0x383b88=_['merge']({},_0x383b88,_0x5d1d46[_0xaac9('0x44')]);var _0x488243={'where':_0x383b88[_0xaac9('0x40')]};return db['WhatsappQueue']['count'](_0x488243)[_0xaac9('0x29')](function(_0x36e23e){_0x359ef5[_0xaac9('0x23')]=_0x36e23e;if(_0x5d1d46[_0xaac9('0x36')][_0xaac9('0x45')]){_0x383b88[_0xaac9('0x46')]=[{'all':!![]}];}return db[_0xaac9('0x30')][_0xaac9('0x47')](_0x383b88);})[_0xaac9('0x29')](function(_0x34629b){_0x359ef5[_0xaac9('0x48')]=_0x34629b;return _0x359ef5;})['then'](respondWithFilteredResult(_0x1b22f6,_0x383b88))[_0xaac9('0x49')](handleError(_0x1b22f6,null));};exports[_0xaac9('0x4a')]=function(_0x3fcd62,_0x41b7ee){var _0xc3c8aa={'raw':!![],'where':{'id':_0x3fcd62[_0xaac9('0x4b')]['id']}},_0x201b33={};_0x201b33['model']=_[_0xaac9('0x37')](db[_0xaac9('0x30')][_0xaac9('0x31')]);_0x201b33[_0xaac9('0x36')]=_[_0xaac9('0x37')](_0x3fcd62[_0xaac9('0x36')]);_0x201b33[_0xaac9('0x38')]=_[_0xaac9('0x39')](_0x201b33['model'],_0x201b33['query']);_0xc3c8aa[_0xaac9('0x3a')]=_[_0xaac9('0x39')](_0x201b33[_0xaac9('0x34')],qs[_0xaac9('0x3b')](_0x3fcd62['query'][_0xaac9('0x3b')]));_0xc3c8aa[_0xaac9('0x3a')]=_0xc3c8aa['attributes']['length']?_0xc3c8aa['attributes']:_0x201b33[_0xaac9('0x34')];if(_0x3fcd62[_0xaac9('0x36')]['includeAll']){_0xc3c8aa['include']=[{'all':!![]}];}_0xc3c8aa=_['merge']({},_0xc3c8aa,_0x3fcd62[_0xaac9('0x44')]);return db[_0xaac9('0x30')][_0xaac9('0x4c')](_0xc3c8aa)['then'](handleEntityNotFound(_0x41b7ee,null))[_0xaac9('0x29')](respondWithResult(_0x41b7ee,null))['catch'](handleError(_0x41b7ee,null));};exports[_0xaac9('0x4d')]=function(_0x177af1,_0x3bedee){return db[_0xaac9('0x30')][_0xaac9('0x4d')](_0x177af1['body'],{})[_0xaac9('0x29')](function(_0x4cd42c){var _0x124a6c=_0x177af1['user'][_0xaac9('0x2b')]({'plain':!![]});if(!_0x124a6c)throw new Error(_0xaac9('0x4e'));if(_0x124a6c[_0xaac9('0x4f')]===_0xaac9('0x50')){var _0xe97efc=_0x4cd42c[_0xaac9('0x2b')]({'plain':!![]});var _0x4c6a33=_0xaac9('0x51');return db['UserProfileSection'][_0xaac9('0x4c')]({'where':{'name':_0x4c6a33,'userProfileId':_0x124a6c[_0xaac9('0x52')]},'raw':!![]})['then'](function(_0x5bb2ce){if(_0x5bb2ce&&_0x5bb2ce['autoAssociation']===0x0){return db[_0xaac9('0x2c')][_0xaac9('0x4d')]({'name':_0xe97efc['name'],'resourceId':_0xe97efc['id'],'type':_0x5bb2ce[_0xaac9('0x2d')],'sectionId':_0x5bb2ce['id']},{})[_0xaac9('0x29')](function(){return _0x4cd42c;});}else{return _0x4cd42c;}})[_0xaac9('0x49')](function(_0x3d189a){logger[_0xaac9('0x53')](_0xaac9('0x54'),_0x3d189a);throw _0x3d189a;});}return _0x4cd42c;})[_0xaac9('0x29')](respondWithResult(_0x3bedee,0xc9))[_0xaac9('0x49')](handleError(_0x3bedee,null));};exports[_0xaac9('0x28')]=function(_0x3726fa,_0x5a7c66){if(_0x3726fa[_0xaac9('0x55')]['id']){delete _0x3726fa[_0xaac9('0x55')]['id'];}return db['WhatsappQueue'][_0xaac9('0x4c')]({'where':{'id':_0x3726fa[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](handleEntityNotFound(_0x5a7c66,null))['then'](saveUpdates(_0x3726fa[_0xaac9('0x55')],null))[_0xaac9('0x29')](respondWithResult(_0x5a7c66,null))[_0xaac9('0x49')](handleError(_0x5a7c66,null));};exports[_0xaac9('0x2a')]=function(_0x57a690,_0x522e6f){return db['WhatsappQueue'][_0xaac9('0x4c')]({'where':{'id':_0x57a690[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](handleEntityNotFound(_0x522e6f,null))[_0xaac9('0x29')](removeEntity(_0x522e6f,null))['catch'](handleError(_0x522e6f,null));};exports[_0xaac9('0x56')]=function(_0x260c48,_0x59f2d3){return db[_0xaac9('0x30')]['describe']()[_0xaac9('0x29')](respondWithResult(_0x59f2d3,null))['catch'](handleError(_0x59f2d3,null));};exports['getMembers']=function(_0x7744de,_0x1c8bd1,_0xbf813){var _0xb91957={'raw':!![],'where':{}},_0x225181={},_0x4b7e91;return db[_0xaac9('0x30')][_0xaac9('0x57')]({'where':{'id':_0x7744de[_0xaac9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1c8bd1,null))[_0xaac9('0x29')](function(_0xbee9bd){if(_0xbee9bd){_0x4b7e91=_0xbee9bd[_0xaac9('0x2b')]({'plain':!![]});_0x225181[_0xaac9('0x34')]=_[_0xaac9('0x37')](db[_0xaac9('0x58')][_0xaac9('0x31')]);_0x225181[_0xaac9('0x36')]=_[_0xaac9('0x37')](_0x7744de[_0xaac9('0x36')]);_0x225181[_0xaac9('0x38')]=_[_0xaac9('0x39')](_0x225181['model'],_0x225181[_0xaac9('0x36')]);_0xb91957[_0xaac9('0x3a')]=_[_0xaac9('0x39')](_0x225181['model'],qs[_0xaac9('0x3b')](_0x7744de[_0xaac9('0x36')][_0xaac9('0x3b')]));_0xb91957[_0xaac9('0x3a')]=_0xb91957[_0xaac9('0x3a')][_0xaac9('0x3c')]?_0xb91957[_0xaac9('0x3a')]:_0x225181[_0xaac9('0x34')];if(!_0x7744de[_0xaac9('0x36')][_0xaac9('0x3d')](_0xaac9('0x3e'))){_0xb91957[_0xaac9('0x22')]=qs['limit'](_0x7744de[_0xaac9('0x36')][_0xaac9('0x22')]);_0xb91957['offset']=qs['offset'](_0x7744de[_0xaac9('0x36')][_0xaac9('0x20')]);}_0xb91957[_0xaac9('0x3f')]=qs[_0xaac9('0x59')](_0x7744de[_0xaac9('0x36')][_0xaac9('0x59')]);_0xb91957[_0xaac9('0x40')]=qs['filters'](_[_0xaac9('0x41')](_0x7744de[_0xaac9('0x36')],_0x225181[_0xaac9('0x38')]));_0xb91957[_0xaac9('0x40')]['WhatsappQueueId']=_0xbee9bd['id'];if(_0x7744de[_0xaac9('0x36')][_0xaac9('0x43')]){_0xb91957[_0xaac9('0x40')]=_[_0xaac9('0x5a')](_0xb91957[_0xaac9('0x40')],{'$or':_[_0xaac9('0x35')](_0xb91957['attributes'],function(_0x29eee1){var _0x14e1e1={};_0x14e1e1[_0x29eee1]={'$like':'%'+_0x7744de[_0xaac9('0x36')]['filter']+'%'};return _0x14e1e1;})});}_0xb91957=_['merge']({},_0xb91957,_0x7744de['options']);return db['UserWhatsappQueue'][_0xaac9('0x47')](_0xb91957);}})[_0xaac9('0x29')](function(_0x210e35){if(_0x210e35){return db[_0xaac9('0x5b')][_0xaac9('0x5c')]({'where':{'id':_[_0xaac9('0x35')](_0x210e35,_0xaac9('0x5d')),'role':_0xaac9('0x5e')},'attributes':['id',_0xaac9('0x2d'),'whatsappPause',_0xaac9('0x5f'),_0xaac9('0x60')]});}})[_0xaac9('0x29')](function(_0x578366){if(_0x578366){return{'count':_0x578366[_0xaac9('0x23')],'rows':_['map'](_0x578366['rows'],function(_0x2d5d9b){return{'membername':_0x2d5d9b[_0xaac9('0x2d')],'UserId':_0x2d5d9b['id'],'queue_name':_0x4b7e91[_0xaac9('0x2d')],'WhatsappQueueId':_0x4b7e91['id'],'interface':util[_0xaac9('0x61')](_0xaac9('0x62'),'SIP',_0x2d5d9b[_0xaac9('0x2d')]),'penalty':0x0,'paused':_0x2d5d9b[_0xaac9('0x63')],'createdAt':_0x2d5d9b[_0xaac9('0x60')],'updatedAt':_0x2d5d9b[_0xaac9('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaac9('0x29')](respondWithFilteredResult(_0x1c8bd1,_0xb91957))[_0xaac9('0x49')](handleError(_0x1c8bd1,null));};exports[_0xaac9('0x64')]=function(_0x1ffaba,_0x5ca9b,_0x27e1cd){var _0x3b79a5={};var _0x2f3fe5={};var _0x4714e4;var _0x189310;return db[_0xaac9('0x30')][_0xaac9('0x57')]({'where':{'id':_0x1ffaba[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](handleEntityNotFound(_0x5ca9b,null))[_0xaac9('0x29')](function(_0x1e74e3){if(_0x1e74e3){_0x4714e4=_0x1e74e3;_0x2f3fe5[_0xaac9('0x34')]=_[_0xaac9('0x37')](db[_0xaac9('0x65')][_0xaac9('0x31')]);_0x2f3fe5[_0xaac9('0x36')]=_['keys'](_0x1ffaba[_0xaac9('0x36')]);_0x2f3fe5[_0xaac9('0x38')]=_[_0xaac9('0x39')](_0x2f3fe5[_0xaac9('0x34')],_0x2f3fe5['query']);_0x3b79a5[_0xaac9('0x3a')]=_['intersection'](_0x2f3fe5[_0xaac9('0x34')],qs[_0xaac9('0x3b')](_0x1ffaba['query'][_0xaac9('0x3b')]));_0x3b79a5['attributes']=_0x3b79a5[_0xaac9('0x3a')][_0xaac9('0x3c')]?_0x3b79a5[_0xaac9('0x3a')]:_0x2f3fe5['model'];_0x3b79a5['order']=qs[_0xaac9('0x59')](_0x1ffaba[_0xaac9('0x36')][_0xaac9('0x59')]);_0x3b79a5[_0xaac9('0x40')]=qs[_0xaac9('0x38')](_[_0xaac9('0x41')](_0x1ffaba['query'],_0x2f3fe5[_0xaac9('0x38')]));if(_0x1ffaba[_0xaac9('0x36')][_0xaac9('0x43')]){_0x3b79a5[_0xaac9('0x40')]=_['merge'](_0x3b79a5[_0xaac9('0x40')],{'$or':_[_0xaac9('0x35')](_0x3b79a5[_0xaac9('0x3a')],function(_0x43d417){var _0xd295cd={};_0xd295cd[_0x43d417]={'$like':'%'+_0x1ffaba['query']['filter']+'%'};return _0xd295cd;})});}_0x3b79a5=_['merge']({},_0x3b79a5,_0x1ffaba[_0xaac9('0x44')]);return _0x4714e4[_0xaac9('0x64')](_0x3b79a5);}})['then'](function(_0x1e71c8){if(_0x1e71c8){_0x189310=_0x1e71c8[_0xaac9('0x3c')];if(!_0x1ffaba[_0xaac9('0x36')][_0xaac9('0x3d')](_0xaac9('0x3e'))){_0x3b79a5[_0xaac9('0x22')]=qs[_0xaac9('0x22')](_0x1ffaba[_0xaac9('0x36')]['limit']);_0x3b79a5['offset']=qs[_0xaac9('0x20')](_0x1ffaba[_0xaac9('0x36')][_0xaac9('0x20')]);}return _0x4714e4['getTeams'](_0x3b79a5);}})['then'](function(_0x1f50ce){if(_0x1f50ce){return _0x1f50ce?{'count':_0x189310,'rows':_0x1f50ce}:null;}})[_0xaac9('0x29')](respondWithResult(_0x5ca9b,null))['catch'](handleError(_0x5ca9b,null));};exports[_0xaac9('0x66')]=function(_0x5d4578,_0x531a15,_0x5571d1){var _0x2c5e6e=_0x5d4578[_0xaac9('0x55')]['ids'];return db[_0xaac9('0x65')][_0xaac9('0x47')]({'where':{'id':_0x2c5e6e},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xaac9('0x2d'),'online',_0xaac9('0x67'),_0xaac9('0x68')],'raw':!![]}]})[_0xaac9('0x29')](function(_0x101aa0){if(_0x101aa0){var _0x161914=_[_0xaac9('0x69')](_0x101aa0,function(_0x452c18){var _0x2db523=_0x452c18[_0xaac9('0x2b')]({'plain':!![]});return _0x2db523[_0xaac9('0x6a')];});return db['WhatsappQueue'][_0xaac9('0x4c')]({'where':{'id':_0x5d4578[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](function(_0x15a433){return db['sequelize'][_0xaac9('0x6b')](function(_0x5a397f){return _0x15a433[_0xaac9('0x66')](_0x2c5e6e,{'transaction':_0x5a397f})['then'](function(){return BPromise[_0xaac9('0x6c')](_0x161914,function(_0x41d4bc){return db['UserWhatsappQueue'][_0xaac9('0x6d')]({'where':{'UserId':_0x41d4bc['id'],'WhatsappQueueId':_0x5d4578['params']['id']},'transaction':_0x5a397f});});})['then'](function(){_0x161914[_0xaac9('0x6e')](function(_0x303257){socket[_0xaac9('0x6f')](_0xaac9('0x70'),{'UserId':_0x303257['id'],'WhatsappQueueId':_0x15a433['id']});});});});});}})[_0xaac9('0x29')](respondWithStatusCode(_0x531a15,null))[_0xaac9('0x49')](handleError(_0x531a15,null));};exports['removeTeams']=function(_0x81c409,_0xf5bc16,_0x504f7f){return db[_0xaac9('0x65')][_0xaac9('0x47')]({'where':{'id':_0x81c409[_0xaac9('0x36')][_0xaac9('0x71')]},'attributes':['id'],'include':[{'model':db[_0xaac9('0x5b')],'as':_0xaac9('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xaac9('0x29')](handleEntityNotFound(_0xf5bc16,null))['then'](function(_0x252d4d){var _0x3f005d=_['map'](_0x252d4d,'id');var _0x506e79=[];var _0x20dc73=[];var _0x52181b=squel[_0xaac9('0x72')]();_0x52181b[_0xaac9('0x73')]('tq.TeamId')[_0xaac9('0x74')](_0xaac9('0x75'),'tq')[_0xaac9('0x76')](_0xaac9('0x77'),'ut',_0xaac9('0x78'))[_0xaac9('0x40')](_0xaac9('0x79'),_0x81c409[_0xaac9('0x4b')]['id']);for(var _0x474cc5=0x0;_0x474cc5<_0x252d4d[_0xaac9('0x3c')];_0x474cc5+=0x1){let _0x55891c=_0x252d4d[_0x474cc5];for(var _0x19193d=0x0;_0x19193d<_0x55891c[_0xaac9('0x6a')][_0xaac9('0x3c')];_0x19193d+=0x1){let _0x2aba85=_0x55891c[_0xaac9('0x6a')][_0x19193d];var _0x1f1867=_0x52181b[_0xaac9('0x7a')]();_0x1f1867[_0xaac9('0x40')]('ut.UserId\x20=\x20?',_0x2aba85['id']);_0x20dc73['push'](db['sequelize'][_0xaac9('0x36')](_0x1f1867[_0xaac9('0x7b')](),{'type':db[_0xaac9('0x7c')][_0xaac9('0x7d')][_0xaac9('0x7e')]})[_0xaac9('0x29')](function(_0x28b156){if(_0x28b156[_0xaac9('0x3c')]===0x1){return _0x2aba85['id'];}else{var _0x1ee3d1=_[_0xaac9('0x7f')](_[_0xaac9('0x35')](_0x28b156,_0xaac9('0x80')),function(_0x1a2a9a){return _['includes'](_0x3f005d,_0x1a2a9a);});if(_0x1ee3d1){return _0x2aba85['id'];}}}));}}return BPromise['all'](_0x20dc73)['then'](function(_0xa48667){_0x506e79=_(_0x506e79)[_0xaac9('0x81')](_0xa48667)[_0xaac9('0x82')]()[_0xaac9('0x83')]();return db[_0xaac9('0x30')][_0xaac9('0x4c')]({'where':{'id':_0x81c409[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](function(_0x2b9d41){return db['sequelize']['transaction'](function(_0x13a172){return _0x2b9d41['removeTeams'](_0x81c409[_0xaac9('0x36')]['ids'],{'transaction':_0x13a172})[_0xaac9('0x29')](function(){if(!_[_0xaac9('0x84')](_0x506e79)){return _0x2b9d41[_0xaac9('0x85')](_0x506e79,{'transaction':_0x13a172});}})['then'](function(){_0x506e79[_0xaac9('0x6e')](function(_0x2c113b){socket[_0xaac9('0x6f')](_0xaac9('0x86'),{'UserId':_0x2c113b,'WhatsappQueueId':_0x2b9d41['id']});});});});});});})['then'](respondWithStatusCode(_0xf5bc16,null))[_0xaac9('0x49')](handleError(_0xf5bc16,null));};exports[_0xaac9('0x87')]=function(_0x55473a,_0xc68fdc,_0x1e8998){return db['WhatsappQueue']['find']({'where':{'id':_0x55473a['params']['id']}})[_0xaac9('0x29')](handleEntityNotFound(_0xc68fdc,null))[_0xaac9('0x29')](function(_0x3a3944){if(_0x3a3944){return _0x3a3944[_0xaac9('0x87')](_0x55473a[_0xaac9('0x55')][_0xaac9('0x71')],_[_0xaac9('0x88')](_0x55473a[_0xaac9('0x55')],[_0xaac9('0x71'),'id'])||{})[_0xaac9('0x89')](function(_0x2774c0){for(var _0x3b7ae3=0x0;_0x3b7ae3<_0x55473a[_0xaac9('0x55')][_0xaac9('0x71')][_0xaac9('0x3c')];_0x3b7ae3+=0x1){socket[_0xaac9('0x6f')](_0xaac9('0x70'),{'UserId':Number(_0x55473a['body'][_0xaac9('0x71')][_0x3b7ae3]),'WhatsappQueueId':Number(_0x55473a[_0xaac9('0x4b')]['id'])});}return _0x2774c0;});}})[_0xaac9('0x29')](respondWithResult(_0xc68fdc,null))[_0xaac9('0x49')](handleError(_0xc68fdc,null));};exports[_0xaac9('0x85')]=function(_0x1f94c5,_0x1c8d36,_0x5ce3e2){return db[_0xaac9('0x30')][_0xaac9('0x4c')]({'where':{'id':_0x1f94c5[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](handleEntityNotFound(_0x1c8d36,null))[_0xaac9('0x29')](function(_0x2f25be){if(_0x2f25be){return _0x2f25be[_0xaac9('0x85')](_0x1f94c5[_0xaac9('0x36')][_0xaac9('0x71')])[_0xaac9('0x29')](function(){if(_[_0xaac9('0x8a')](_0x1f94c5[_0xaac9('0x36')][_0xaac9('0x71')])){for(var _0x3fa36b=0x0;_0x3fa36b<_0x1f94c5[_0xaac9('0x36')][_0xaac9('0x71')][_0xaac9('0x3c')];_0x3fa36b+=0x1){socket[_0xaac9('0x6f')](_0xaac9('0x86'),{'UserId':Number(_0x1f94c5[_0xaac9('0x36')]['ids'][_0x3fa36b]),'WhatsappQueueId':Number(_0x1f94c5['params']['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x1f94c5[_0xaac9('0x36')]['ids']),'WhatsappQueueId':Number(_0x1f94c5[_0xaac9('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c8d36,null))[_0xaac9('0x49')](handleError(_0x1c8d36,null));};exports[_0xaac9('0x8b')]=function(_0x816748,_0x3ee46d,_0x89a742){var _0x557a2d={};var _0x3ced60={};var _0xeb88;var _0x498880;return db[_0xaac9('0x30')][_0xaac9('0x57')]({'where':{'id':_0x816748[_0xaac9('0x4b')]['id']}})[_0xaac9('0x29')](handleEntityNotFound(_0x3ee46d,null))[_0xaac9('0x29')](function(_0x4c850a){if(_0x4c850a){_0xeb88=_0x4c850a;_0x3ced60[_0xaac9('0x34')]=_[_0xaac9('0x37')](db[_0xaac9('0x5b')][_0xaac9('0x31')]);_0x3ced60[_0xaac9('0x36')]=_[_0xaac9('0x37')](_0x816748['query']);_0x3ced60['filters']=_[_0xaac9('0x39')](_0x3ced60['model'],_0x3ced60[_0xaac9('0x36')]);_0x557a2d['attributes']=_[_0xaac9('0x39')](_0x3ced60[_0xaac9('0x34')],qs['fields'](_0x816748[_0xaac9('0x36')][_0xaac9('0x3b')]));_0x557a2d[_0xaac9('0x3a')]=_0x557a2d['attributes']['length']?_0x557a2d[_0xaac9('0x3a')]:_0x3ced60[_0xaac9('0x34')];_0x557a2d['order']=qs[_0xaac9('0x59')](_0x816748['query'][_0xaac9('0x59')]);_0x557a2d[_0xaac9('0x40')]=qs[_0xaac9('0x38')](_['pick'](_0x816748[_0xaac9('0x36')],_0x3ced60['filters']));if(_0x816748['query'][_0xaac9('0x43')]){_0x557a2d[_0xaac9('0x40')]=_[_0xaac9('0x5a')](_0x557a2d['where'],{'$or':_['map'](_0x557a2d[_0xaac9('0x3a')],function(_0x6d3712){var _0x349f2f={};_0x349f2f[_0x6d3712]={'$like':'%'+_0x816748[_0xaac9('0x36')][_0xaac9('0x43')]+'%'};return _0x349f2f;})});}_0x557a2d=_[_0xaac9('0x5a')]({},_0x557a2d,_0x816748[_0xaac9('0x44')]);return _0xeb88[_0xaac9('0x8b')](_0x557a2d);}})[_0xaac9('0x29')](function(_0x5f5d67){if(_0x5f5d67){_0x498880=_0x5f5d67[_0xaac9('0x3c')];if(!_0x816748[_0xaac9('0x36')][_0xaac9('0x3d')](_0xaac9('0x3e'))){_0x557a2d[_0xaac9('0x22')]=qs[_0xaac9('0x22')](_0x816748['query'][_0xaac9('0x22')]);_0x557a2d[_0xaac9('0x20')]=qs[_0xaac9('0x20')](_0x816748['query'][_0xaac9('0x20')]);}return _0xeb88[_0xaac9('0x8b')](_0x557a2d);}})[_0xaac9('0x29')](function(_0x4de93f){if(_0x4de93f){return _0x4de93f?{'count':_0x498880,'rows':_0x4de93f}:null;}})[_0xaac9('0x29')](respondWithResult(_0x3ee46d,null))[_0xaac9('0x49')](handleError(_0x3ee46d,null));};
\ No newline at end of file
index 98d0ac7..0a7a228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd75=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x539303,_0x2a692e){var _0x5f2e4e=function(_0x40d0d2){while(--_0x40d0d2){_0x539303['push'](_0x539303['shift']());}};_0x5f2e4e(++_0x2a692e);}(_0xfd75,0xb0));var _0x5fd7=function(_0x42c958,_0x377024){_0x42c958=_0x42c958-0x0;var _0x322a53=_0xfd75[_0x42c958];return _0x322a53;};'use strict';var EventEmitter=require(_0x5fd7('0x0'));var WhatsappQueue=require(_0x5fd7('0x1'))['db'][_0x5fd7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5fd7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5fd7('0x4'),'afterDestroy':'remove'};function emitEvent(_0xba9481){return function(_0x5a4ae7,_0x499e78,_0x1f5306){WhatsappQueueEvents[_0x5fd7('0x5')](_0xba9481+':'+_0x5a4ae7['id'],_0x5a4ae7);WhatsappQueueEvents['emit'](_0xba9481,_0x5a4ae7);_0x1f5306(null);};}for(var e in events){if(events[_0x5fd7('0x6')](e)){var event=events[e];WhatsappQueue[_0x5fd7('0x7')](e,emitEvent(event));}}module[_0x5fd7('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x7254=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5c85d2,_0x3165af){var _0x2d2d10=function(_0x550a26){while(--_0x550a26){_0x5c85d2['push'](_0x5c85d2['shift']());}};_0x2d2d10(++_0x3165af);}(_0x7254,0xf7));var _0x4725=function(_0x4a628a,_0x52b3a7){_0x4a628a=_0x4a628a-0x0;var _0x25b28d=_0x7254[_0x4a628a];return _0x25b28d;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x4725('0x0'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4725('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4725('0x2'),'afterDestroy':_0x4725('0x3')};function emitEvent(_0x1705d1){return function(_0x50c4d0,_0x2cbd0c,_0x5d8a6f){WhatsappQueueEvents[_0x4725('0x4')](_0x1705d1+':'+_0x50c4d0['id'],_0x50c4d0);WhatsappQueueEvents[_0x4725('0x4')](_0x1705d1,_0x50c4d0);_0x5d8a6f(null);};}for(var e in events){if(events[_0x4725('0x5')](e)){var event=events[e];WhatsappQueue[_0x4725('0x6')](e,emitEvent(event));}}module[_0x4725('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
index 3450d86..97cf7e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3a4=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0xd3a4,0x15c));var _0x4d3a=function(_0x16d4c3,_0x1d78d8){_0x16d4c3=_0x16d4c3-0x0;var _0x195daa=_0xd3a4[_0x16d4c3];return _0x195daa;};'use strict';var _=require(_0x4d3a('0x0'));var util=require(_0x4d3a('0x1'));var logger=require(_0x4d3a('0x2'))(_0x4d3a('0x3'));var moment=require('moment');var BPromise=require(_0x4d3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d3a('0x5'));var rimraf=require(_0x4d3a('0x6'));var config=require(_0x4d3a('0x7'));var attributes=require(_0x4d3a('0x8'));module[_0x4d3a('0x9')]=function(_0x5e4a71,_0x407b3f){return _0x5e4a71[_0x4d3a('0xa')]('WhatsappQueue',attributes,{'tableName':_0x4d3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ae3=['define','WhatsappQueue','whatsapp_queues','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports'];(function(_0x3fb07b,_0x2920ca){var _0x15cdb4=function(_0x93d9d5){while(--_0x93d9d5){_0x3fb07b['push'](_0x3fb07b['shift']());}};_0x15cdb4(++_0x2920ca);}(_0x5ae3,0xac));var _0x35ae=function(_0x552582,_0x4f82c1){_0x552582=_0x552582-0x0;var _0x364753=_0x5ae3[_0x552582];return _0x364753;};'use strict';var _=require('lodash');var util=require(_0x35ae('0x0'));var logger=require(_0x35ae('0x1'))('api');var moment=require(_0x35ae('0x2'));var BPromise=require(_0x35ae('0x3'));var rp=require(_0x35ae('0x4'));var fs=require('fs');var path=require(_0x35ae('0x5'));var rimraf=require(_0x35ae('0x6'));var config=require(_0x35ae('0x7'));var attributes=require(_0x35ae('0x8'));module[_0x35ae('0x9')]=function(_0xd6ddc8,_0x37a22e){return _0xd6ddc8[_0x35ae('0xa')](_0x35ae('0xb'),attributes,{'tableName':_0x35ae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e93d26..4a645d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfce0=['findAll','options','raw','attributes','include','map','model','then','ShowWhatsappQueue','WhatsappQueue','where','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','register','request','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetWhatsappQueue'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xfce0,0x108));var _0x0fce=function(_0x2859b0,_0x7a0771){_0x2859b0=_0x2859b0-0x0;var _0x5dc854=_0xfce0[_0x2859b0];return _0x5dc854;};'use strict';var _=require(_0x0fce('0x0'));var util=require(_0x0fce('0x1'));var moment=require(_0x0fce('0x2'));var BPromise=require(_0x0fce('0x3'));var rs=require(_0x0fce('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fce('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fce('0x6'))(_0x0fce('0x7'));var config=require('../../config/environment');var jayson=require(_0x0fce('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x0fce('0x9')]=_[_0x0fce('0xa')](config['redis'],{'host':_0x0fce('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fce('0x9')]));require('./whatsappQueue.socket')[_0x0fce('0xc')](socket);function respondWithRpcPromise(_0x2cba98,_0x184bdb,_0x4b8548){return new BPromise(function(_0x2fe467,_0x15415a){return client[_0x0fce('0xd')](_0x2cba98,_0x4b8548)['then'](function(_0x3fe9d6){logger[_0x0fce('0xe')](_0x0fce('0xf'),_0x184bdb,'request\x20sent');logger['debug'](_0x0fce('0x10'),_0x184bdb,_0x0fce('0x11'),JSON[_0x0fce('0x12')](_0x3fe9d6));if(_0x3fe9d6[_0x0fce('0x13')]){if(_0x3fe9d6[_0x0fce('0x13')][_0x0fce('0x14')]===0x1f4){logger['error'](_0x0fce('0xf'),_0x184bdb,_0x3fe9d6[_0x0fce('0x13')][_0x0fce('0x15')]);return _0x15415a(_0x3fe9d6[_0x0fce('0x13')][_0x0fce('0x15')]);}logger['error'](_0x0fce('0xf'),_0x184bdb,_0x3fe9d6['error'][_0x0fce('0x15')]);return _0x2fe467(_0x3fe9d6[_0x0fce('0x13')][_0x0fce('0x15')]);}else{logger[_0x0fce('0xe')](_0x0fce('0xf'),_0x184bdb,_0x0fce('0x11'));_0x2fe467(_0x3fe9d6['result'][_0x0fce('0x15')]);}})[_0x0fce('0x16')](function(_0x32ce08){logger[_0x0fce('0x13')](_0x0fce('0xf'),_0x184bdb,_0x32ce08);_0x15415a(_0x32ce08);});});}exports[_0x0fce('0x17')]=function(_0x53c05f){var _0x221b10=this;return new Promise(function(_0x567fa3,_0x51d0a0){return db['WhatsappQueue'][_0x0fce('0x18')]({'raw':_0x53c05f[_0x0fce('0x19')]?_0x53c05f[_0x0fce('0x19')][_0x0fce('0x1a')]===undefined?!![]:![]:!![],'where':_0x53c05f[_0x0fce('0x19')]?_0x53c05f['options']['where']||null:null,'attributes':_0x53c05f[_0x0fce('0x19')]?_0x53c05f[_0x0fce('0x19')][_0x0fce('0x1b')]||null:null,'limit':_0x53c05f[_0x0fce('0x19')]?_0x53c05f[_0x0fce('0x19')]['limit']||null:null,'include':_0x53c05f[_0x0fce('0x19')]?_0x53c05f[_0x0fce('0x19')][_0x0fce('0x1c')]?_[_0x0fce('0x1d')](_0x53c05f[_0x0fce('0x19')][_0x0fce('0x1c')],function(_0x3116e2){return{'model':db[_0x3116e2[_0x0fce('0x1e')]],'as':_0x3116e2['as'],'attributes':_0x3116e2[_0x0fce('0x1b')],'include':_0x3116e2['include']?_[_0x0fce('0x1d')](_0x3116e2[_0x0fce('0x1c')],function(_0x530440){return{'model':db[_0x530440[_0x0fce('0x1e')]],'as':_0x530440['as'],'attributes':_0x530440[_0x0fce('0x1b')],'include':_0x530440[_0x0fce('0x1c')]?_[_0x0fce('0x1d')](_0x530440['include'],function(_0x598846){return{'model':db[_0x598846[_0x0fce('0x1e')]],'as':_0x598846['as'],'attributes':_0x598846[_0x0fce('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0fce('0x1f')](function(_0x28e610){logger['info']('GetWhatsappQueue',_0x53c05f);logger['debug']('GetWhatsappQueue',_0x53c05f,JSON['stringify'](_0x28e610));_0x567fa3(_0x28e610);})[_0x0fce('0x16')](function(_0x58f466){logger[_0x0fce('0x13')](_0x0fce('0x17'),_0x58f466['message'],_0x53c05f);_0x51d0a0(_0x221b10['error'](0x1f4,_0x58f466[_0x0fce('0x15')]));});});};exports[_0x0fce('0x20')]=function(_0x2c3735){var _0x561eb4=this;return new Promise(function(_0x4f1e78,_0x29aa7a){return db[_0x0fce('0x21')]['find']({'raw':_0x2c3735[_0x0fce('0x19')]?_0x2c3735[_0x0fce('0x19')][_0x0fce('0x1a')]===undefined?!![]:![]:!![],'where':_0x2c3735[_0x0fce('0x19')]?_0x2c3735[_0x0fce('0x19')][_0x0fce('0x22')]||null:null,'attributes':_0x2c3735[_0x0fce('0x19')]?_0x2c3735['options'][_0x0fce('0x1b')]||null:null,'include':_0x2c3735[_0x0fce('0x19')]?_0x2c3735['options']['include']?_['map'](_0x2c3735['options'][_0x0fce('0x1c')],function(_0x240dbc){return{'model':db[_0x240dbc[_0x0fce('0x1e')]],'as':_0x240dbc['as'],'attributes':_0x240dbc['attributes'],'include':_0x240dbc[_0x0fce('0x1c')]?_[_0x0fce('0x1d')](_0x240dbc[_0x0fce('0x1c')],function(_0x378192){return{'model':db[_0x378192[_0x0fce('0x1e')]],'as':_0x378192['as'],'attributes':_0x378192['attributes'],'include':_0x378192['include']?_[_0x0fce('0x1d')](_0x378192[_0x0fce('0x1c')],function(_0x53b5fc){return{'model':db[_0x53b5fc[_0x0fce('0x1e')]],'as':_0x53b5fc['as'],'attributes':_0x53b5fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x0fce('0x1f')](function(_0x241c07){logger['info'](_0x0fce('0x20'),_0x2c3735);logger[_0x0fce('0x23')](_0x0fce('0x20'),_0x2c3735,JSON[_0x0fce('0x12')](_0x241c07));_0x4f1e78(_0x241c07);})[_0x0fce('0x16')](function(_0x3151b1){logger['error'](_0x0fce('0x20'),_0x3151b1[_0x0fce('0x15')],_0x2c3735);_0x29aa7a(_0x561eb4['error'](0x1f4,_0x3151b1[_0x0fce('0x15')]));});});};
\ No newline at end of file
+var _0xbd4b=['model','then','debug','stringify','ShowWhatsappQueue','WhatsappQueue','raw','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappQueue,\x20%s,\x20%s','result','catch','GetWhatsappQueue','options','where','attributes','limit','include','map'];(function(_0x219e9b,_0x295d91){var _0x332e80=function(_0x567792){while(--_0x567792){_0x219e9b['push'](_0x219e9b['shift']());}};_0x332e80(++_0x295d91);}(_0xbd4b,0x73));var _0xbbd4=function(_0x596271,_0x37f34b){_0x596271=_0x596271-0x0;var _0x543081=_0xbd4b[_0x596271];return _0x543081;};'use strict';var _=require('lodash');var util=require(_0xbbd4('0x0'));var moment=require(_0xbbd4('0x1'));var BPromise=require('bluebird');var rs=require(_0xbbd4('0x2'));var fs=require('fs');var Redis=require(_0xbbd4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbd4('0x4'));var logger=require(_0xbbd4('0x5'))('rpc');var config=require(_0xbbd4('0x6'));var jayson=require(_0xbbd4('0x7'));var client=jayson['client'][_0xbbd4('0x8')]({'port':0x232a});config[_0xbbd4('0x9')]=_[_0xbbd4('0xa')](config[_0xbbd4('0x9')],{'host':_0xbbd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbd4('0x9')]));require(_0xbbd4('0xc'))[_0xbbd4('0xd')](socket);function respondWithRpcPromise(_0x379971,_0x3746be,_0x18926d){return new BPromise(function(_0x5394ab,_0x14caba){return client['request'](_0x379971,_0x18926d)['then'](function(_0x44a227){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x3746be,_0xbbd4('0xe'));logger['debug'](_0xbbd4('0xf'),_0x3746be,_0xbbd4('0xe'),JSON['stringify'](_0x44a227));if(_0x44a227[_0xbbd4('0x10')]){if(_0x44a227[_0xbbd4('0x10')][_0xbbd4('0x11')]===0x1f4){logger[_0xbbd4('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x3746be,_0x44a227[_0xbbd4('0x10')][_0xbbd4('0x12')]);return _0x14caba(_0x44a227[_0xbbd4('0x10')]['message']);}logger[_0xbbd4('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x3746be,_0x44a227[_0xbbd4('0x10')][_0xbbd4('0x12')]);return _0x5394ab(_0x44a227[_0xbbd4('0x10')]['message']);}else{logger['info'](_0xbbd4('0x13'),_0x3746be,'request\x20sent');_0x5394ab(_0x44a227[_0xbbd4('0x14')][_0xbbd4('0x12')]);}})[_0xbbd4('0x15')](function(_0x3b8f2e){logger[_0xbbd4('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x3746be,_0x3b8f2e);_0x14caba(_0x3b8f2e);});});}exports[_0xbbd4('0x16')]=function(_0x15735a){var _0x971077=this;return new Promise(function(_0x3545d2,_0xafb010){return db['WhatsappQueue']['findAll']({'raw':_0x15735a[_0xbbd4('0x17')]?_0x15735a[_0xbbd4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x15735a[_0xbbd4('0x17')]?_0x15735a[_0xbbd4('0x17')][_0xbbd4('0x18')]||null:null,'attributes':_0x15735a[_0xbbd4('0x17')]?_0x15735a[_0xbbd4('0x17')][_0xbbd4('0x19')]||null:null,'limit':_0x15735a['options']?_0x15735a[_0xbbd4('0x17')][_0xbbd4('0x1a')]||null:null,'include':_0x15735a[_0xbbd4('0x17')]?_0x15735a[_0xbbd4('0x17')][_0xbbd4('0x1b')]?_[_0xbbd4('0x1c')](_0x15735a[_0xbbd4('0x17')]['include'],function(_0x45b528){return{'model':db[_0x45b528['model']],'as':_0x45b528['as'],'attributes':_0x45b528[_0xbbd4('0x19')],'include':_0x45b528[_0xbbd4('0x1b')]?_['map'](_0x45b528[_0xbbd4('0x1b')],function(_0x4ecd5d){return{'model':db[_0x4ecd5d[_0xbbd4('0x1d')]],'as':_0x4ecd5d['as'],'attributes':_0x4ecd5d[_0xbbd4('0x19')],'include':_0x4ecd5d[_0xbbd4('0x1b')]?_[_0xbbd4('0x1c')](_0x4ecd5d[_0xbbd4('0x1b')],function(_0x3a477b){return{'model':db[_0x3a477b[_0xbbd4('0x1d')]],'as':_0x3a477b['as'],'attributes':_0x3a477b[_0xbbd4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x1e')](function(_0x202b88){logger['info'](_0xbbd4('0x16'),_0x15735a);logger[_0xbbd4('0x1f')](_0xbbd4('0x16'),_0x15735a,JSON[_0xbbd4('0x20')](_0x202b88));_0x3545d2(_0x202b88);})[_0xbbd4('0x15')](function(_0x527369){logger[_0xbbd4('0x10')](_0xbbd4('0x16'),_0x527369['message'],_0x15735a);_0xafb010(_0x971077[_0xbbd4('0x10')](0x1f4,_0x527369[_0xbbd4('0x12')]));});});};exports[_0xbbd4('0x21')]=function(_0x1d1ee5){var _0x480b31=this;return new Promise(function(_0x52d66b,_0x3d800e){return db[_0xbbd4('0x22')]['find']({'raw':_0x1d1ee5[_0xbbd4('0x17')]?_0x1d1ee5['options'][_0xbbd4('0x23')]===undefined?!![]:![]:!![],'where':_0x1d1ee5[_0xbbd4('0x17')]?_0x1d1ee5[_0xbbd4('0x17')][_0xbbd4('0x18')]||null:null,'attributes':_0x1d1ee5['options']?_0x1d1ee5[_0xbbd4('0x17')]['attributes']||null:null,'include':_0x1d1ee5[_0xbbd4('0x17')]?_0x1d1ee5[_0xbbd4('0x17')][_0xbbd4('0x1b')]?_[_0xbbd4('0x1c')](_0x1d1ee5[_0xbbd4('0x17')][_0xbbd4('0x1b')],function(_0x1fbae1){return{'model':db[_0x1fbae1['model']],'as':_0x1fbae1['as'],'attributes':_0x1fbae1[_0xbbd4('0x19')],'include':_0x1fbae1[_0xbbd4('0x1b')]?_[_0xbbd4('0x1c')](_0x1fbae1[_0xbbd4('0x1b')],function(_0xa6ab73){return{'model':db[_0xa6ab73[_0xbbd4('0x1d')]],'as':_0xa6ab73['as'],'attributes':_0xa6ab73[_0xbbd4('0x19')],'include':_0xa6ab73[_0xbbd4('0x1b')]?_[_0xbbd4('0x1c')](_0xa6ab73[_0xbbd4('0x1b')],function(_0x235856){return{'model':db[_0x235856[_0xbbd4('0x1d')]],'as':_0x235856['as'],'attributes':_0x235856[_0xbbd4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x1e')](function(_0x44a0dc){logger['info'](_0xbbd4('0x21'),_0x1d1ee5);logger[_0xbbd4('0x1f')](_0xbbd4('0x21'),_0x1d1ee5,JSON[_0xbbd4('0x20')](_0x44a0dc));_0x52d66b(_0x44a0dc);})[_0xbbd4('0x15')](function(_0x17d6a1){logger['error'](_0xbbd4('0x21'),_0x17d6a1[_0xbbd4('0x12')],_0x1d1ee5);_0x3d800e(_0x480b31['error'](0x1f4,_0x17d6a1[_0xbbd4('0x12')]));});});};
\ No newline at end of file
index 485b545..22aa910 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa222=['update','emit','removeListener','register','length','whatsappQueue:','remove'];(function(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xa222,0x1aa));var _0x2a22=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0xa222[_0x1857d0];return _0x3e3c46;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x2a22('0x0'),_0x2a22('0x1')];function createListener(_0x4345e0,_0x184e15){return function(_0x1b45a3){_0x184e15[_0x2a22('0x2')](_0x4345e0,_0x1b45a3);};}function removeListener(_0x369a32,_0x515939){return function(){WhatsappQueueEvents[_0x2a22('0x3')](_0x369a32,_0x515939);};}exports[_0x2a22('0x4')]=function(_0x46405a){for(var _0x1b5059=0x0,_0xf10127=events[_0x2a22('0x5')];_0x1b5059<_0xf10127;_0x1b5059++){var _0x4a3e63=events[_0x1b5059];var _0x253797=createListener(_0x2a22('0x6')+_0x4a3e63,_0x46405a);WhatsappQueueEvents['on'](_0x4a3e63,_0x253797);}};
\ No newline at end of file
+var _0x4f4e=['remove','update','removeListener','length','whatsappQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f4e,0x168));var _0xe4f4=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0x4f4e[_0x4d9bb2];return _0x3179fe;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0xe4f4('0x0'),_0xe4f4('0x1')];function createListener(_0x271b8f,_0x481b33){return function(_0x1b27f4){_0x481b33['emit'](_0x271b8f,_0x1b27f4);};}function removeListener(_0x20c2e5,_0x26bc24){return function(){WhatsappQueueEvents[_0xe4f4('0x2')](_0x20c2e5,_0x26bc24);};}exports['register']=function(_0x209e97){for(var _0x4db25a=0x0,_0x16abde=events[_0xe4f4('0x3')];_0x4db25a<_0x16abde;_0x4db25a++){var _0x30e968=events[_0x4db25a];var _0x5eb79b=createListener(_0xe4f4('0x4')+_0x30e968,_0x209e97);WhatsappQueueEvents['on'](_0x30e968,_0x5eb79b);}};
\ No newline at end of file
index bfd3616..b396ad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd34=['show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0xcd34,0x10a));var _0x4cd3=function(_0x4a945d,_0x150b72){_0x4a945d=_0x4a945d-0x0;var _0x400c6f=_0xcd34[_0x4a945d];return _0x400c6f;};'use strict';var multer=require(_0x4cd3('0x0'));var util=require(_0x4cd3('0x1'));var path=require(_0x4cd3('0x2'));var timeout=require(_0x4cd3('0x3'));var express=require('express');var router=express[_0x4cd3('0x4')]();var fs_extra=require(_0x4cd3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4cd3('0x6'));var config=require(_0x4cd3('0x7'));var controller=require(_0x4cd3('0x8'));router[_0x4cd3('0x9')]('/',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xb')]);router[_0x4cd3('0x9')]('/describe',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xc')]);router[_0x4cd3('0x9')](_0x4cd3('0xd'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xe')]);router[_0x4cd3('0xf')]('/',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0x10')]);router['put'](_0x4cd3('0xd'),auth[_0x4cd3('0xa')](),controller['update']);router[_0x4cd3('0x11')](_0x4cd3('0xd'),auth['isAuthenticated'](),controller[_0x4cd3('0x12')]);module[_0x4cd3('0x13')]=router;
\ No newline at end of file
+var _0x0a7f=['./whatsappQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','update','destroy','multer','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0a7f,0x1b5));var _0xf0a7=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0x0a7f[_0x208749];return _0x3e0042;};'use strict';var multer=require(_0xf0a7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf0a7('0x1'));var router=express[_0xf0a7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf0a7('0x3'));var config=require(_0xf0a7('0x4'));var controller=require(_0xf0a7('0x5'));router[_0xf0a7('0x6')]('/',auth['isAuthenticated'](),controller[_0xf0a7('0x7')]);router[_0xf0a7('0x6')](_0xf0a7('0x8'),auth[_0xf0a7('0x9')](),controller[_0xf0a7('0xa')]);router['get'](_0xf0a7('0xb'),auth[_0xf0a7('0x9')](),controller['show']);router[_0xf0a7('0xc')]('/',auth[_0xf0a7('0x9')](),controller[_0xf0a7('0xd')]);router[_0xf0a7('0xe')](_0xf0a7('0xb'),auth[_0xf0a7('0x9')](),controller[_0xf0a7('0xf')]);router['delete'](_0xf0a7('0xb'),auth[_0xf0a7('0x9')](),controller[_0xf0a7('0x10')]);module['exports']=router;
\ No newline at end of file
index 917707f..c2fe676 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x41852e,_0x332ae5){var _0x1f6ef2=function(_0x5ace04){while(--_0x5ace04){_0x41852e['push'](_0x41852e['shift']());}};_0x1f6ef2(++_0x332ae5);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4f29c2,_0x4a7b4b){var _0x5310b3=function(_0x236126){while(--_0x236126){_0x4f29c2['push'](_0x4f29c2['shift']());}};_0x5310b3(++_0x4a7b4b);}(_0x7a54,0x106));var _0x47a5=function(_0x11d322,_0x43790b){_0x11d322=_0x11d322-0x0;var _0x2c45c1=_0x7a54[_0x11d322];return _0x2c45c1;};'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 3db6cea..5890a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['then','destroy','error','name','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update'];(function(_0x9973d9,_0x8a1e84){var _0x1af0fa=function(_0x3a88c1){while(--_0x3a88c1){_0x9973d9['push'](_0x9973d9['shift']());}};_0x1af0fa(++_0x8a1e84);}(_0x02ce,0x1ac));var _0xe02c=function(_0x3217f0,_0x115b9f){_0x3217f0=_0x3217f0-0x0;var _0x5ae3d1=_0x02ce[_0x3217f0];return _0x5ae3d1;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];function respondWithStatusCode(_0x23d886,_0x32fc45){_0x32fc45=_0x32fc45||0xcc;return function(_0x5d6d13){if(_0x5d6d13){return _0x23d886[_0xe02c('0x1c')](_0x32fc45);}return _0x23d886['status'](_0x32fc45)['end']();};}function respondWithResult(_0x3f4e28,_0x56405a){_0x56405a=_0x56405a||0xc8;return function(_0x221910){if(_0x221910){return _0x3f4e28['status'](_0x56405a)[_0xe02c('0x1d')](_0x221910);}};}function respondWithFilteredResult(_0x4e9c6d,_0x256311){return function(_0x366893){if(_0x366893){var _0x59f2f6=typeof _0x256311[_0xe02c('0x1e')]===_0xe02c('0x1f')&&typeof _0x256311['limit']===_0xe02c('0x1f');var _0x20f492=_0x366893['count'];var _0x52917f=_0x59f2f6?0x0:_0x256311[_0xe02c('0x1e')];var _0x49604a=_0x59f2f6?_0x366893[_0xe02c('0x20')]:_0x256311[_0xe02c('0x1e')]+_0x256311[_0xe02c('0x21')];var _0x36fed0;if(_0x49604a>=_0x20f492){_0x49604a=_0x20f492;_0x36fed0=0xc8;}else{_0x36fed0=0xce;}_0x4e9c6d[_0xe02c('0x22')](_0x36fed0);return _0x4e9c6d['set'](_0xe02c('0x23'),_0x52917f+'-'+_0x49604a+'/'+_0x20f492)['json'](_0x366893);}return null;};}function patchUpdates(_0x4ea9b5){return function(_0x393621){try{jsonpatch[_0xe02c('0x24')](_0x393621,_0x4ea9b5,!![]);}catch(_0x480b9a){return BPromise[_0xe02c('0x25')](_0x480b9a);}return _0x393621[_0xe02c('0x26')]();};}function saveUpdates(_0x4ce5ee,_0x38dce2){return function(_0x45fd82){if(_0x45fd82){return _0x45fd82[_0xe02c('0x27')](_0x4ce5ee)[_0xe02c('0x28')](function(_0x2d44c8){return _0x2d44c8;});}return null;};}function removeEntity(_0x557142,_0x3e80e3){return function(_0xf41d4c){if(_0xf41d4c){return _0xf41d4c[_0xe02c('0x29')]()[_0xe02c('0x28')](function(){_0x557142[_0xe02c('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xefd882,_0x4411d8){return function(_0x3592ca){if(!_0x3592ca){_0xefd882[_0xe02c('0x1c')](0x194);}return _0x3592ca;};}function handleError(_0x16dfa3,_0x303d24){_0x303d24=_0x303d24||0x1f4;return function(_0x43dc78){logger[_0xe02c('0x2a')](_0x43dc78['stack']);if(_0x43dc78[_0xe02c('0x2b')]){delete _0x43dc78[_0xe02c('0x2b')];}_0x16dfa3[_0xe02c('0x22')](_0x303d24)['send'](_0x43dc78);};}exports[_0xe02c('0x2c')]=function(_0x2d1d98,_0x445421){var _0x287f7e={},_0x1e7eab={},_0x35a309={'count':0x0,'rows':[]};var _0x22a285=_[_0xe02c('0x2d')](db[_0xe02c('0x2e')][_0xe02c('0x2f')],function(_0x17d5b3){return{'name':_0x17d5b3['fieldName'],'type':_0x17d5b3[_0xe02c('0x30')][_0xe02c('0x31')]};});_0x1e7eab[_0xe02c('0x32')]=_[_0xe02c('0x2d')](_0x22a285,_0xe02c('0x2b'));_0x1e7eab[_0xe02c('0x33')]=_['keys'](_0x2d1d98[_0xe02c('0x33')]);_0x1e7eab[_0xe02c('0x34')]=_['intersection'](_0x1e7eab[_0xe02c('0x32')],_0x1e7eab[_0xe02c('0x33')]);_0x287f7e[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x1e7eab[_0xe02c('0x32')],qs['fields'](_0x2d1d98['query'][_0xe02c('0x37')]));_0x287f7e[_0xe02c('0x35')]=_0x287f7e['attributes'][_0xe02c('0x38')]?_0x287f7e['attributes']:_0x1e7eab[_0xe02c('0x32')];if(!_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x39')](_0xe02c('0x3a'))){_0x287f7e[_0xe02c('0x21')]=qs['limit'](_0x2d1d98[_0xe02c('0x33')]['limit']);_0x287f7e[_0xe02c('0x1e')]=qs[_0xe02c('0x1e')](_0x2d1d98[_0xe02c('0x33')][_0xe02c('0x1e')]);}_0x287f7e[_0xe02c('0x3b')]=qs[_0xe02c('0x3c')](_0x2d1d98['query'][_0xe02c('0x3c')]);_0x287f7e[_0xe02c('0x3d')]=qs['filters'](_[_0xe02c('0x3e')](_0x2d1d98[_0xe02c('0x33')],_0x1e7eab['filters']),_0x22a285);if(_0x2d1d98[_0xe02c('0x33')]['filter']){_0x287f7e[_0xe02c('0x3d')]=_[_0xe02c('0x3f')](_0x287f7e['where'],{'$or':_[_0xe02c('0x2d')](_0x22a285,function(_0x1eeddb){if(_0x1eeddb[_0xe02c('0x30')]!==_0xe02c('0x40')){var _0x3c4a65={};_0x3c4a65[_0x1eeddb[_0xe02c('0x2b')]]={'$like':'%'+_0x2d1d98['query'][_0xe02c('0x41')]+'%'};return _0x3c4a65;}})});}_0x287f7e=_['merge']({},_0x287f7e,_0x2d1d98['options']);var _0x3db057={'where':_0x287f7e[_0xe02c('0x3d')]};return db[_0xe02c('0x2e')][_0xe02c('0x20')](_0x3db057)['then'](function(_0x37e4fe){_0x35a309[_0xe02c('0x20')]=_0x37e4fe;if(_0x2d1d98[_0xe02c('0x33')]['includeAll']){_0x287f7e['include']=[{'all':!![]}];}return db[_0xe02c('0x2e')][_0xe02c('0x42')](_0x287f7e);})[_0xe02c('0x28')](function(_0x2313d2){_0x35a309[_0xe02c('0x43')]=_0x2313d2;return _0x35a309;})[_0xe02c('0x28')](respondWithFilteredResult(_0x445421,_0x287f7e))[_0xe02c('0x44')](handleError(_0x445421,null));};exports[_0xe02c('0x45')]=function(_0x21d66e,_0x53d123){var _0xc7e935={'raw':!![],'where':{'id':_0x21d66e['params']['id']}},_0x5ef4a1={};_0x5ef4a1[_0xe02c('0x32')]=_[_0xe02c('0x46')](db[_0xe02c('0x2e')][_0xe02c('0x2f')]);_0x5ef4a1[_0xe02c('0x33')]=_[_0xe02c('0x46')](_0x21d66e[_0xe02c('0x33')]);_0x5ef4a1[_0xe02c('0x34')]=_['intersection'](_0x5ef4a1['model'],_0x5ef4a1[_0xe02c('0x33')]);_0xc7e935[_0xe02c('0x35')]=_[_0xe02c('0x36')](_0x5ef4a1['model'],qs[_0xe02c('0x37')](_0x21d66e[_0xe02c('0x33')][_0xe02c('0x37')]));_0xc7e935[_0xe02c('0x35')]=_0xc7e935[_0xe02c('0x35')][_0xe02c('0x38')]?_0xc7e935[_0xe02c('0x35')]:_0x5ef4a1[_0xe02c('0x32')];if(_0x21d66e[_0xe02c('0x33')][_0xe02c('0x47')]){_0xc7e935['include']=[{'all':!![]}];}_0xc7e935=_[_0xe02c('0x3f')]({},_0xc7e935,_0x21d66e[_0xe02c('0x48')]);return db[_0xe02c('0x2e')][_0xe02c('0x49')](_0xc7e935)[_0xe02c('0x28')](handleEntityNotFound(_0x53d123,null))[_0xe02c('0x28')](respondWithResult(_0x53d123,null))[_0xe02c('0x44')](handleError(_0x53d123,null));};exports[_0xe02c('0x4a')]=function(_0x30dc90,_0x1176c9){return db[_0xe02c('0x2e')][_0xe02c('0x4a')](_0x30dc90[_0xe02c('0x4b')],{})['then'](respondWithResult(_0x1176c9,0xc9))[_0xe02c('0x44')](handleError(_0x1176c9,null));};exports['update']=function(_0x15b05c,_0x324911){if(_0x15b05c[_0xe02c('0x4b')]['id']){delete _0x15b05c[_0xe02c('0x4b')]['id'];}return db[_0xe02c('0x2e')][_0xe02c('0x49')]({'where':{'id':_0x15b05c[_0xe02c('0x4c')]['id']}})[_0xe02c('0x28')](handleEntityNotFound(_0x324911,null))[_0xe02c('0x28')](saveUpdates(_0x15b05c[_0xe02c('0x4b')],null))['then'](respondWithResult(_0x324911,null))[_0xe02c('0x44')](handleError(_0x324911,null));};exports[_0xe02c('0x29')]=function(_0xeb4214,_0x536cf7){return db[_0xe02c('0x2e')]['find']({'where':{'id':_0xeb4214[_0xe02c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x536cf7,null))['then'](removeEntity(_0x536cf7,null))['catch'](handleError(_0x536cf7,null));};exports['describe']=function(_0x51d540,_0x5740df){return db[_0xe02c('0x2e')][_0xe02c('0x4d')]()[_0xe02c('0x28')](respondWithResult(_0x5740df,null))[_0xe02c('0x44')](handleError(_0x5740df,null));};
\ No newline at end of file
+var _0x57f8=['filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x57f8,0x198));var _0x857f=function(_0x20e5d4,_0x4ae460){_0x20e5d4=_0x20e5d4-0x0;var _0x54d52a=_0x57f8[_0x20e5d4];return _0x54d52a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];function respondWithStatusCode(_0x533631,_0x2e1eda){_0x2e1eda=_0x2e1eda||0xcc;return function(_0x2d5e26){if(_0x2d5e26){return _0x533631[_0x857f('0x1b')](_0x2e1eda);}return _0x533631[_0x857f('0x1c')](_0x2e1eda)[_0x857f('0x1d')]();};}function respondWithResult(_0x4a25ec,_0x4bc590){_0x4bc590=_0x4bc590||0xc8;return function(_0x3b09d9){if(_0x3b09d9){return _0x4a25ec['status'](_0x4bc590)[_0x857f('0x1e')](_0x3b09d9);}};}function respondWithFilteredResult(_0x4ac81f,_0x1d47bf){return function(_0x134a4f){if(_0x134a4f){var _0x5c3a69=typeof _0x1d47bf[_0x857f('0x1f')]===_0x857f('0x20')&&typeof _0x1d47bf[_0x857f('0x21')]===_0x857f('0x20');var _0x279e74=_0x134a4f[_0x857f('0x22')];var _0x1a9ef8=_0x5c3a69?0x0:_0x1d47bf[_0x857f('0x1f')];var _0x1014ca=_0x5c3a69?_0x134a4f[_0x857f('0x22')]:_0x1d47bf[_0x857f('0x1f')]+_0x1d47bf['limit'];var _0x1729d8;if(_0x1014ca>=_0x279e74){_0x1014ca=_0x279e74;_0x1729d8=0xc8;}else{_0x1729d8=0xce;}_0x4ac81f[_0x857f('0x1c')](_0x1729d8);return _0x4ac81f['set'](_0x857f('0x23'),_0x1a9ef8+'-'+_0x1014ca+'/'+_0x279e74)[_0x857f('0x1e')](_0x134a4f);}return null;};}function patchUpdates(_0x377587){return function(_0x484035){try{jsonpatch['apply'](_0x484035,_0x377587,!![]);}catch(_0x12ee77){return BPromise[_0x857f('0x24')](_0x12ee77);}return _0x484035[_0x857f('0x25')]();};}function saveUpdates(_0x4fa031,_0x118237){return function(_0x17a98e){if(_0x17a98e){return _0x17a98e[_0x857f('0x26')](_0x4fa031)['then'](function(_0x1961ea){return _0x1961ea;});}return null;};}function removeEntity(_0x14a8ce,_0x50bfb7){return function(_0x3bc543){if(_0x3bc543){return _0x3bc543[_0x857f('0x27')]()[_0x857f('0x28')](function(){_0x14a8ce[_0x857f('0x1c')](0xcc)[_0x857f('0x1d')]();});}};}function handleEntityNotFound(_0x3b23a7,_0x233a68){return function(_0x2a89ba){if(!_0x2a89ba){_0x3b23a7[_0x857f('0x1b')](0x194);}return _0x2a89ba;};}function handleError(_0xcd1ee9,_0x72f0aa){_0x72f0aa=_0x72f0aa||0x1f4;return function(_0x4782ab){logger[_0x857f('0x29')](_0x4782ab[_0x857f('0x2a')]);if(_0x4782ab['name']){delete _0x4782ab[_0x857f('0x2b')];}_0xcd1ee9[_0x857f('0x1c')](_0x72f0aa)[_0x857f('0x2c')](_0x4782ab);};}exports[_0x857f('0x2d')]=function(_0x58c2de,_0x40c306){var _0x57ceaa={},_0x1b405a={},_0x234048={'count':0x0,'rows':[]};var _0x45a37f=_[_0x857f('0x2e')](db[_0x857f('0x2f')][_0x857f('0x30')],function(_0x1c4fff){return{'name':_0x1c4fff[_0x857f('0x31')],'type':_0x1c4fff[_0x857f('0x32')][_0x857f('0x33')]};});_0x1b405a[_0x857f('0x34')]=_[_0x857f('0x2e')](_0x45a37f,_0x857f('0x2b'));_0x1b405a['query']=_[_0x857f('0x35')](_0x58c2de[_0x857f('0x36')]);_0x1b405a['filters']=_[_0x857f('0x37')](_0x1b405a[_0x857f('0x34')],_0x1b405a['query']);_0x57ceaa[_0x857f('0x38')]=_[_0x857f('0x37')](_0x1b405a['model'],qs[_0x857f('0x39')](_0x58c2de[_0x857f('0x36')][_0x857f('0x39')]));_0x57ceaa[_0x857f('0x38')]=_0x57ceaa['attributes']['length']?_0x57ceaa[_0x857f('0x38')]:_0x1b405a[_0x857f('0x34')];if(!_0x58c2de['query'][_0x857f('0x3a')]('nolimit')){_0x57ceaa[_0x857f('0x21')]=qs[_0x857f('0x21')](_0x58c2de[_0x857f('0x36')][_0x857f('0x21')]);_0x57ceaa[_0x857f('0x1f')]=qs['offset'](_0x58c2de['query'][_0x857f('0x1f')]);}_0x57ceaa['order']=qs[_0x857f('0x3b')](_0x58c2de[_0x857f('0x36')][_0x857f('0x3b')]);_0x57ceaa['where']=qs[_0x857f('0x3c')](_[_0x857f('0x3d')](_0x58c2de[_0x857f('0x36')],_0x1b405a[_0x857f('0x3c')]),_0x45a37f);if(_0x58c2de[_0x857f('0x36')][_0x857f('0x3e')]){_0x57ceaa[_0x857f('0x3f')]=_['merge'](_0x57ceaa[_0x857f('0x3f')],{'$or':_[_0x857f('0x2e')](_0x45a37f,function(_0x1f285c){if(_0x1f285c[_0x857f('0x32')]!==_0x857f('0x40')){var _0x2356fb={};_0x2356fb[_0x1f285c[_0x857f('0x2b')]]={'$like':'%'+_0x58c2de['query'][_0x857f('0x3e')]+'%'};return _0x2356fb;}})});}_0x57ceaa=_[_0x857f('0x41')]({},_0x57ceaa,_0x58c2de[_0x857f('0x42')]);var _0xc2ac41={'where':_0x57ceaa[_0x857f('0x3f')]};return db[_0x857f('0x2f')]['count'](_0xc2ac41)[_0x857f('0x28')](function(_0x354678){_0x234048[_0x857f('0x22')]=_0x354678;if(_0x58c2de[_0x857f('0x36')][_0x857f('0x43')]){_0x57ceaa[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2f')][_0x857f('0x45')](_0x57ceaa);})['then'](function(_0x40fb37){_0x234048[_0x857f('0x46')]=_0x40fb37;return _0x234048;})[_0x857f('0x28')](respondWithFilteredResult(_0x40c306,_0x57ceaa))[_0x857f('0x47')](handleError(_0x40c306,null));};exports[_0x857f('0x48')]=function(_0x1bbf9f,_0x374b9f){var _0x42d922={'raw':!![],'where':{'id':_0x1bbf9f[_0x857f('0x49')]['id']}},_0xb4d7c2={};_0xb4d7c2[_0x857f('0x34')]=_[_0x857f('0x35')](db[_0x857f('0x2f')][_0x857f('0x30')]);_0xb4d7c2['query']=_[_0x857f('0x35')](_0x1bbf9f['query']);_0xb4d7c2[_0x857f('0x3c')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],_0xb4d7c2[_0x857f('0x36')]);_0x42d922[_0x857f('0x38')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],qs[_0x857f('0x39')](_0x1bbf9f[_0x857f('0x36')][_0x857f('0x39')]));_0x42d922[_0x857f('0x38')]=_0x42d922['attributes']['length']?_0x42d922[_0x857f('0x38')]:_0xb4d7c2['model'];if(_0x1bbf9f[_0x857f('0x36')]['includeAll']){_0x42d922[_0x857f('0x44')]=[{'all':!![]}];}_0x42d922=_[_0x857f('0x41')]({},_0x42d922,_0x1bbf9f[_0x857f('0x42')]);return db[_0x857f('0x2f')][_0x857f('0x4a')](_0x42d922)[_0x857f('0x28')](handleEntityNotFound(_0x374b9f,null))[_0x857f('0x28')](respondWithResult(_0x374b9f,null))[_0x857f('0x47')](handleError(_0x374b9f,null));};exports['create']=function(_0x42cf05,_0x3b431d){return db[_0x857f('0x2f')][_0x857f('0x4b')](_0x42cf05['body'],{})[_0x857f('0x28')](respondWithResult(_0x3b431d,0xc9))[_0x857f('0x47')](handleError(_0x3b431d,null));};exports[_0x857f('0x26')]=function(_0x736ef6,_0x67563){if(_0x736ef6['body']['id']){delete _0x736ef6[_0x857f('0x4c')]['id'];}return db[_0x857f('0x2f')]['find']({'where':{'id':_0x736ef6[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x67563,null))['then'](saveUpdates(_0x736ef6[_0x857f('0x4c')],null))['then'](respondWithResult(_0x67563,null))[_0x857f('0x47')](handleError(_0x67563,null));};exports[_0x857f('0x27')]=function(_0x446fe9,_0x2008d5){return db[_0x857f('0x2f')][_0x857f('0x4a')]({'where':{'id':_0x446fe9[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x2008d5,null))[_0x857f('0x28')](removeEntity(_0x2008d5,null))[_0x857f('0x47')](handleError(_0x2008d5,null));};exports['describe']=function(_0x5464f4,_0x13ef75){return db[_0x857f('0x2f')][_0x857f('0x4d')]()[_0x857f('0x28')](respondWithResult(_0x13ef75,null))[_0x857f('0x47')](handleError(_0x13ef75,null));};
\ No newline at end of file
index fddf824..0f4e9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd567=['request-promise','path','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xd567,0x1b6));var _0x7d56=function(_0x28e7ce,_0x365b2c){_0x28e7ce=_0x28e7ce-0x0;var _0x17cc45=_0xd567[_0x28e7ce];return _0x17cc45;};'use strict';var _=require(_0x7d56('0x0'));var util=require(_0x7d56('0x1'));var logger=require(_0x7d56('0x2'))(_0x7d56('0x3'));var moment=require(_0x7d56('0x4'));var BPromise=require(_0x7d56('0x5'));var rp=require(_0x7d56('0x6'));var fs=require('fs');var path=require(_0x7d56('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module['exports']=function(_0x4186d6,_0x18c9d5){return _0x4186d6[_0x7d56('0x8')](_0x7d56('0x9'),attributes,{'tableName':_0x7d56('0xa'),'paranoid':![],'indexes':[{'name':_0x7d56('0xb'),'fields':[_0x7d56('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2cc=['moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x46fbce,_0x199584){var _0x1e9a7e=function(_0x11866c){while(--_0x11866c){_0x46fbce['push'](_0x46fbce['shift']());}};_0x1e9a7e(++_0x199584);}(_0xb2cc,0xf9));var _0xcb2c=function(_0x58d98a,_0x3040c3){_0x58d98a=_0x58d98a-0x0;var _0x4274ba=_0xb2cc[_0x58d98a];return _0x4274ba;};'use strict';var _=require(_0xcb2c('0x0'));var util=require(_0xcb2c('0x1'));var logger=require(_0xcb2c('0x2'))('api');var moment=require(_0xcb2c('0x3'));var BPromise=require(_0xcb2c('0x4'));var rp=require(_0xcb2c('0x5'));var fs=require('fs');var path=require(_0xcb2c('0x6'));var rimraf=require('rimraf');var config=require(_0xcb2c('0x7'));var attributes=require(_0xcb2c('0x8'));module[_0xcb2c('0x9')]=function(_0x21d38c,_0x2682fe){return _0x21d38c['define'](_0xcb2c('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xcb2c('0xb'),'fields':[_0xcb2c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 87f1f4f..bdd89e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8846=['WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','stringify','update','body','where','attributes','limit','UpdateWhatsappQueueReport','util','moment','bluebird','randomstring','../../config/utils','jayson/promise','client','request','then','info'];(function(_0x3a0df1,_0x528918){var _0x4e9295=function(_0x2ccdd1){while(--_0x2ccdd1){_0x3a0df1['push'](_0x3a0df1['shift']());}};_0x4e9295(++_0x528918);}(_0x8846,0x19a));var _0x6884=function(_0x15f87e,_0x1d12ea){_0x15f87e=_0x15f87e-0x0;var _0x7b4bf=_0x8846[_0x15f87e];return _0x7b4bf;};'use strict';var _=require('lodash');var util=require(_0x6884('0x0'));var moment=require(_0x6884('0x1'));var BPromise=require(_0x6884('0x2'));var rs=require(_0x6884('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6884('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6884('0x5'));var client=jayson[_0x6884('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a912d,_0x49485d,_0x8f3b9){return new BPromise(function(_0x3e6e60,_0x12e889){return client[_0x6884('0x7')](_0x4a912d,_0x8f3b9)[_0x6884('0x8')](function(_0x1dbdd0){logger[_0x6884('0x9')](_0x6884('0xa'),_0x49485d,'request\x20sent');logger[_0x6884('0xb')](_0x6884('0xc'),_0x49485d,'request\x20sent',JSON['stringify'](_0x1dbdd0));if(_0x1dbdd0[_0x6884('0xd')]){if(_0x1dbdd0[_0x6884('0xd')]['code']===0x1f4){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x49485d,_0x1dbdd0[_0x6884('0xd')][_0x6884('0xe')]);return _0x12e889(_0x1dbdd0[_0x6884('0xd')]['message']);}logger[_0x6884('0xd')](_0x6884('0xa'),_0x49485d,_0x1dbdd0['error'][_0x6884('0xe')]);return _0x3e6e60(_0x1dbdd0[_0x6884('0xd')][_0x6884('0xe')]);}else{logger[_0x6884('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x49485d,_0x6884('0xf'));_0x3e6e60(_0x1dbdd0[_0x6884('0x10')][_0x6884('0xe')]);}})[_0x6884('0x11')](function(_0x572c59){logger[_0x6884('0xd')](_0x6884('0xa'),_0x49485d,_0x572c59);_0x12e889(_0x572c59);});});}exports[_0x6884('0x12')]=function(_0x4334c0){var _0x431fad=this;return new Promise(function(_0xb416f9,_0x32d049){return db[_0x6884('0x13')][_0x6884('0x14')](_0x4334c0['body'],{'raw':_0x4334c0['options']?_0x4334c0[_0x6884('0x15')][_0x6884('0x16')]===undefined?!![]:![]:!![]})[_0x6884('0x8')](function(_0x5c544f){logger[_0x6884('0x9')]('CreateWhatsappQueueReport',_0x4334c0);logger[_0x6884('0xb')](_0x6884('0x12'),_0x4334c0,JSON[_0x6884('0x17')](_0x5c544f));_0xb416f9(_0x5c544f);})['catch'](function(_0x5115b4){logger[_0x6884('0xd')]('CreateWhatsappQueueReport',_0x5115b4['message'],_0x4334c0);_0x32d049(_0x431fad['error'](0x1f4,_0x5115b4[_0x6884('0xe')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xbab846){var _0x248ad8=this;return new Promise(function(_0x250a1c,_0x2cb9fb){return db['WhatsappQueueReport'][_0x6884('0x18')](_0xbab846[_0x6884('0x19')],{'raw':_0xbab846[_0x6884('0x15')]?_0xbab846[_0x6884('0x15')][_0x6884('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbab846[_0x6884('0x15')]?_0xbab846[_0x6884('0x15')][_0x6884('0x1a')]||null:null,'attributes':_0xbab846[_0x6884('0x15')]?_0xbab846[_0x6884('0x15')][_0x6884('0x1b')]||null:null,'limit':_0xbab846[_0x6884('0x15')]?_0xbab846[_0x6884('0x15')][_0x6884('0x1c')]||null:null})[_0x6884('0x8')](function(_0x3226d1){logger[_0x6884('0x9')]('UpdateWhatsappQueueReport',_0xbab846);logger[_0x6884('0xb')]('UpdateWhatsappQueueReport',_0xbab846,JSON['stringify'](_0x3226d1));_0x250a1c(_0x3226d1);})[_0x6884('0x11')](function(_0x2e5c48){logger[_0x6884('0xd')](_0x6884('0x1d'),_0x2e5c48[_0x6884('0xe')],_0xbab846);_0x2cb9fb(_0x248ad8[_0x6884('0xd')](0x1f4,_0x2e5c48[_0x6884('0xe')]));});});};
\ No newline at end of file
+var _0xe688=['../../config/environment','client','http','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','then','UpdateWhatsappQueueReport','update','where','attributes','util','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xe688,0x144));var _0x8e68=function(_0xad859e,_0x262932){_0xad859e=_0xad859e-0x0;var _0x26d938=_0xe688[_0xad859e];return _0x26d938;};'use strict';var _=require('lodash');var util=require(_0x8e68('0x0'));var moment=require(_0x8e68('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e68('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x8e68('0x3'));var logger=require(_0x8e68('0x4'))(_0x8e68('0x5'));var config=require(_0x8e68('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8e68('0x7')][_0x8e68('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x240027,_0x46af2a,_0x2082aa){return new BPromise(function(_0x4e4023,_0x1c53b5){return client['request'](_0x240027,_0x2082aa)['then'](function(_0x157ac7){logger[_0x8e68('0x9')](_0x8e68('0xa'),_0x46af2a,_0x8e68('0xb'));logger[_0x8e68('0xc')](_0x8e68('0xd'),_0x46af2a,_0x8e68('0xb'),JSON[_0x8e68('0xe')](_0x157ac7));if(_0x157ac7[_0x8e68('0xf')]){if(_0x157ac7['error'][_0x8e68('0x10')]===0x1f4){logger[_0x8e68('0xf')](_0x8e68('0xa'),_0x46af2a,_0x157ac7['error']['message']);return _0x1c53b5(_0x157ac7[_0x8e68('0xf')][_0x8e68('0x11')]);}logger[_0x8e68('0xf')](_0x8e68('0xa'),_0x46af2a,_0x157ac7[_0x8e68('0xf')][_0x8e68('0x11')]);return _0x4e4023(_0x157ac7['error'][_0x8e68('0x11')]);}else{logger[_0x8e68('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x46af2a,'request\x20sent');_0x4e4023(_0x157ac7[_0x8e68('0x12')]['message']);}})[_0x8e68('0x13')](function(_0x15c319){logger[_0x8e68('0xf')](_0x8e68('0xa'),_0x46af2a,_0x15c319);_0x1c53b5(_0x15c319);});});}exports[_0x8e68('0x14')]=function(_0x738f42){var _0xa0d1eb=this;return new Promise(function(_0x12ac5c,_0x2206b6){return db[_0x8e68('0x15')]['create'](_0x738f42[_0x8e68('0x16')],{'raw':_0x738f42[_0x8e68('0x17')]?_0x738f42[_0x8e68('0x17')][_0x8e68('0x18')]===undefined?!![]:![]:!![]})[_0x8e68('0x19')](function(_0x1f9b99){logger[_0x8e68('0x9')](_0x8e68('0x14'),_0x738f42);logger[_0x8e68('0xc')]('CreateWhatsappQueueReport',_0x738f42,JSON[_0x8e68('0xe')](_0x1f9b99));_0x12ac5c(_0x1f9b99);})[_0x8e68('0x13')](function(_0x2c1d7e){logger[_0x8e68('0xf')](_0x8e68('0x14'),_0x2c1d7e[_0x8e68('0x11')],_0x738f42);_0x2206b6(_0xa0d1eb[_0x8e68('0xf')](0x1f4,_0x2c1d7e[_0x8e68('0x11')]));});});};exports[_0x8e68('0x1a')]=function(_0x1d088d){var _0x5a6832=this;return new Promise(function(_0x3b3cda,_0x3cd96f){return db[_0x8e68('0x15')][_0x8e68('0x1b')](_0x1d088d[_0x8e68('0x16')],{'raw':_0x1d088d['options']?_0x1d088d[_0x8e68('0x17')][_0x8e68('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d088d[_0x8e68('0x17')]?_0x1d088d[_0x8e68('0x17')][_0x8e68('0x1c')]||null:null,'attributes':_0x1d088d[_0x8e68('0x17')]?_0x1d088d[_0x8e68('0x17')][_0x8e68('0x1d')]||null:null,'limit':_0x1d088d[_0x8e68('0x17')]?_0x1d088d[_0x8e68('0x17')]['limit']||null:null})[_0x8e68('0x19')](function(_0x4b18ed){logger[_0x8e68('0x9')]('UpdateWhatsappQueueReport',_0x1d088d);logger[_0x8e68('0xc')](_0x8e68('0x1a'),_0x1d088d,JSON[_0x8e68('0xe')](_0x4b18ed));_0x3b3cda(_0x4b18ed);})[_0x8e68('0x13')](function(_0x3b41c6){logger['error'](_0x8e68('0x1a'),_0x3b41c6['message'],_0x1d088d);_0x3cd96f(_0x5a6832[_0x8e68('0xf')](0x1f4,_0x3b41c6[_0x8e68('0x11')]));});});};
\ No newline at end of file
index 4b0ec79..db941cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73ed=['../../config/environment','get','isAuthenticated','index','describe','/:id','post','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0x73ed,0x89));var _0xd73e=function(_0x233c3e,_0x260c20){_0x233c3e=_0x233c3e-0x0;var _0x37f1c3=_0x73ed[_0x233c3e];return _0x37f1c3;};'use strict';var multer=require(_0xd73e('0x0'));var util=require(_0xd73e('0x1'));var path=require(_0xd73e('0x2'));var timeout=require('connect-timeout');var express=require(_0xd73e('0x3'));var router=express[_0xd73e('0x4')]();var fs_extra=require(_0xd73e('0x5'));var auth=require(_0xd73e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd73e('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0xd73e('0x8')]('/',auth[_0xd73e('0x9')](),controller[_0xd73e('0xa')]);router[_0xd73e('0x8')]('/describe',auth[_0xd73e('0x9')](),controller[_0xd73e('0xb')]);router['get'](_0xd73e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xd73e('0xd')]('/',auth[_0xd73e('0x9')](),controller['create']);router['put'](_0xd73e('0xc'),auth[_0xd73e('0x9')](),controller[_0xd73e('0xe')]);router[_0xd73e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd73e('0x10')]);module[_0xd73e('0x11')]=router;
\ No newline at end of file
+var _0xad5c=['show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad5c,0x7a));var _0xcad5=function(_0xef0cd6,_0x468c3c){_0xef0cd6=_0xef0cd6-0x0;var _0x2461f4=_0xad5c[_0xef0cd6];return _0x2461f4;};'use strict';var multer=require(_0xcad5('0x0'));var util=require('util');var path=require(_0xcad5('0x1'));var timeout=require(_0xcad5('0x2'));var express=require(_0xcad5('0x3'));var router=express[_0xcad5('0x4')]();var fs_extra=require(_0xcad5('0x5'));var auth=require(_0xcad5('0x6'));var interaction=require(_0xcad5('0x7'));var config=require(_0xcad5('0x8'));var controller=require(_0xcad5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xcad5('0xa')]);router[_0xcad5('0xb')](_0xcad5('0xc'),auth[_0xcad5('0xd')](),controller[_0xcad5('0xe')]);router[_0xcad5('0xb')](_0xcad5('0xf'),auth[_0xcad5('0xd')](),controller[_0xcad5('0x10')]);router[_0xcad5('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcad5('0x12')](_0xcad5('0xf'),auth[_0xcad5('0xd')](),controller[_0xcad5('0x13')]);router[_0xcad5('0x14')](_0xcad5('0xf'),auth[_0xcad5('0xd')](),controller[_0xcad5('0x15')]);module[_0xcad5('0x16')]=router;
\ No newline at end of file
index 4cb318f..7c596b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cae=['account','agent','DATE','sequelize','exports'];(function(_0x1559a5,_0x41924e){var _0x17a783=function(_0x152c63){while(--_0x152c63){_0x1559a5['push'](_0x1559a5['shift']());}};_0x17a783(++_0x41924e);}(_0x2cae,0x16b));var _0xe2ca=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x2cae[_0x22f8ab];return _0x2a70e5;};'use strict';var Sequelize=require(_0xe2ca('0x0'));module[_0xe2ca('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe2ca('0x2'),_0xe2ca('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe2ca('0x4')]}};
\ No newline at end of file
+var _0xbca0=['exports','agent','queue','DATE','sequelize'];(function(_0x2e314c,_0x1e23bc){var _0x3470bd=function(_0x168244){while(--_0x168244){_0x2e314c['push'](_0x2e314c['shift']());}};_0x3470bd(++_0x1e23bc);}(_0xbca0,0x8b));var _0x0bca=function(_0x571a96,_0x5d1034){_0x571a96=_0x571a96-0x0;var _0x506d60=_0xbca0[_0x571a96];return _0x506d60;};'use strict';var Sequelize=require(_0x0bca('0x0'));module[_0x0bca('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x0bca('0x2'),_0x0bca('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x0bca('0x4')]}};
\ No newline at end of file
index fc7e825..355dbe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66e5=['fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','then','destroy','end','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','catch','show','params','keys','length','create','update','body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x244231,_0x3a11f3){var _0x22e73a=function(_0x353c62){while(--_0x353c62){_0x244231['push'](_0x244231['shift']());}};_0x22e73a(++_0x3a11f3);}(_0x66e5,0x1a1));var _0x566e=function(_0xf02353,_0x5d599b){_0xf02353=_0xf02353-0x0;var _0x59f7df=_0x66e5[_0xf02353];return _0x59f7df;};'use strict';var emlformat=require(_0x566e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x566e('0x1'));var rp=require('request-promise');var moment=require(_0x566e('0x2'));var BPromise=require(_0x566e('0x3'));var Mustache=require(_0x566e('0x4'));var util=require(_0x566e('0x5'));var path=require(_0x566e('0x6'));var sox=require('sox');var csv=require(_0x566e('0x7'));var ejs=require(_0x566e('0x8'));var fs=require('fs');var fs_extra=require(_0x566e('0x9'));var _=require(_0x566e('0xa'));var squel=require('squel');var crypto=require(_0x566e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x566e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x566e('0xd'));var Papa=require(_0x566e('0xe'));var Redis=require(_0x566e('0xf'));var authService=require(_0x566e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x566e('0x11'));var logger=require(_0x566e('0x12'))(_0x566e('0x13'));var utils=require(_0x566e('0x14'));var config=require(_0x566e('0x15'));var licenseUtil=require(_0x566e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c0ef8,_0x4e2f16){_0x4e2f16=_0x4e2f16||0xcc;return function(_0x5de6b6){if(_0x5de6b6){return _0x5c0ef8[_0x566e('0x17')](_0x4e2f16);}return _0x5c0ef8[_0x566e('0x18')](_0x4e2f16)['end']();};}function respondWithResult(_0x442069,_0xc3c237){_0xc3c237=_0xc3c237||0xc8;return function(_0x4f05db){if(_0x4f05db){return _0x442069[_0x566e('0x18')](_0xc3c237)[_0x566e('0x19')](_0x4f05db);}};}function respondWithFilteredResult(_0x58bd4d,_0x2c14f0){return function(_0xb7653e){if(_0xb7653e){var _0x5d373a=typeof _0x2c14f0[_0x566e('0x1a')]==='undefined'&&typeof _0x2c14f0[_0x566e('0x1b')]===_0x566e('0x1c');var _0x41bf1d=_0xb7653e[_0x566e('0x1d')];var _0x162b51=_0x5d373a?0x0:_0x2c14f0[_0x566e('0x1a')];var _0x326017=_0x5d373a?_0xb7653e['count']:_0x2c14f0[_0x566e('0x1a')]+_0x2c14f0[_0x566e('0x1b')];var _0x3a114a;if(_0x326017>=_0x41bf1d){_0x326017=_0x41bf1d;_0x3a114a=0xc8;}else{_0x3a114a=0xce;}_0x58bd4d[_0x566e('0x18')](_0x3a114a);return _0x58bd4d[_0x566e('0x1e')]('Content-Range',_0x162b51+'-'+_0x326017+'/'+_0x41bf1d)[_0x566e('0x19')](_0xb7653e);}return null;};}function patchUpdates(_0x52e5a0){return function(_0x2da3d8){try{jsonpatch['apply'](_0x2da3d8,_0x52e5a0,!![]);}catch(_0x3010f8){return BPromise['reject'](_0x3010f8);}return _0x2da3d8['save']();};}function saveUpdates(_0x51946d,_0x462279){return function(_0x500ca4){if(_0x500ca4){return _0x500ca4['update'](_0x51946d)[_0x566e('0x1f')](function(_0x307360){return _0x307360;});}return null;};}function removeEntity(_0x208a3c,_0x33e243){return function(_0x29a187){if(_0x29a187){return _0x29a187[_0x566e('0x20')]()[_0x566e('0x1f')](function(){_0x208a3c[_0x566e('0x18')](0xcc)[_0x566e('0x21')]();});}};}function handleEntityNotFound(_0x46365a,_0xdae9e1){return function(_0x4ed6e8){if(!_0x4ed6e8){_0x46365a[_0x566e('0x17')](0x194);}return _0x4ed6e8;};}function handleError(_0x12379c,_0x86e6e7){_0x86e6e7=_0x86e6e7||0x1f4;return function(_0x174d30){logger['error'](_0x174d30['stack']);if(_0x174d30[_0x566e('0x22')]){delete _0x174d30[_0x566e('0x22')];}_0x12379c['status'](_0x86e6e7)[_0x566e('0x23')](_0x174d30);};}exports[_0x566e('0x24')]=function(_0x443465,_0xa86122){var _0x1bd117={},_0x5154a1={},_0x96717f={'count':0x0,'rows':[]};var _0x4c229a=_['map'](db['WhatsappTransferReport'][_0x566e('0x25')],function(_0xb0027a){return{'name':_0xb0027a[_0x566e('0x26')],'type':_0xb0027a[_0x566e('0x27')][_0x566e('0x28')]};});_0x5154a1[_0x566e('0x29')]=_[_0x566e('0x2a')](_0x4c229a,_0x566e('0x22'));_0x5154a1[_0x566e('0x2b')]=_['keys'](_0x443465[_0x566e('0x2b')]);_0x5154a1[_0x566e('0x2c')]=_[_0x566e('0x2d')](_0x5154a1[_0x566e('0x29')],_0x5154a1[_0x566e('0x2b')]);_0x1bd117[_0x566e('0x2e')]=_['intersection'](_0x5154a1[_0x566e('0x29')],qs[_0x566e('0x2f')](_0x443465[_0x566e('0x2b')][_0x566e('0x2f')]));_0x1bd117['attributes']=_0x1bd117[_0x566e('0x2e')]['length']?_0x1bd117[_0x566e('0x2e')]:_0x5154a1[_0x566e('0x29')];if(!_0x443465[_0x566e('0x2b')]['hasOwnProperty'](_0x566e('0x30'))){_0x1bd117['limit']=qs[_0x566e('0x1b')](_0x443465[_0x566e('0x2b')][_0x566e('0x1b')]);_0x1bd117[_0x566e('0x1a')]=qs[_0x566e('0x1a')](_0x443465[_0x566e('0x2b')][_0x566e('0x1a')]);}_0x1bd117[_0x566e('0x31')]=qs[_0x566e('0x32')](_0x443465[_0x566e('0x2b')]['sort']);_0x1bd117[_0x566e('0x33')]=qs['filters'](_[_0x566e('0x34')](_0x443465[_0x566e('0x2b')],_0x5154a1[_0x566e('0x2c')]),_0x4c229a);if(_0x443465[_0x566e('0x2b')][_0x566e('0x35')]){_0x1bd117[_0x566e('0x33')]=_[_0x566e('0x36')](_0x1bd117[_0x566e('0x33')],{'$or':_[_0x566e('0x2a')](_0x4c229a,function(_0x1b3abb){if(_0x1b3abb[_0x566e('0x27')]!==_0x566e('0x37')){var _0x394518={};_0x394518[_0x1b3abb[_0x566e('0x22')]]={'$like':'%'+_0x443465[_0x566e('0x2b')][_0x566e('0x35')]+'%'};return _0x394518;}})});}_0x1bd117=_[_0x566e('0x36')]({},_0x1bd117,_0x443465[_0x566e('0x38')]);var _0x282ac2={'where':_0x1bd117[_0x566e('0x33')]};return db[_0x566e('0x39')][_0x566e('0x1d')](_0x282ac2)[_0x566e('0x1f')](function(_0x4f6491){_0x96717f[_0x566e('0x1d')]=_0x4f6491;if(_0x443465['query'][_0x566e('0x3a')]){_0x1bd117[_0x566e('0x3b')]=[{'all':!![]}];}return db[_0x566e('0x39')][_0x566e('0x3c')](_0x1bd117);})[_0x566e('0x1f')](function(_0x2cdacc){_0x96717f['rows']=_0x2cdacc;return _0x96717f;})['then'](respondWithFilteredResult(_0xa86122,_0x1bd117))[_0x566e('0x3d')](handleError(_0xa86122,null));};exports[_0x566e('0x3e')]=function(_0x6d03d0,_0x31b904){var _0x86ee97={'raw':!![],'where':{'id':_0x6d03d0[_0x566e('0x3f')]['id']}},_0x213a42={};_0x213a42['model']=_[_0x566e('0x40')](db[_0x566e('0x39')]['rawAttributes']);_0x213a42['query']=_['keys'](_0x6d03d0[_0x566e('0x2b')]);_0x213a42[_0x566e('0x2c')]=_[_0x566e('0x2d')](_0x213a42[_0x566e('0x29')],_0x213a42[_0x566e('0x2b')]);_0x86ee97[_0x566e('0x2e')]=_[_0x566e('0x2d')](_0x213a42[_0x566e('0x29')],qs[_0x566e('0x2f')](_0x6d03d0[_0x566e('0x2b')][_0x566e('0x2f')]));_0x86ee97[_0x566e('0x2e')]=_0x86ee97[_0x566e('0x2e')][_0x566e('0x41')]?_0x86ee97['attributes']:_0x213a42[_0x566e('0x29')];if(_0x6d03d0[_0x566e('0x2b')][_0x566e('0x3a')]){_0x86ee97[_0x566e('0x3b')]=[{'all':!![]}];}_0x86ee97=_[_0x566e('0x36')]({},_0x86ee97,_0x6d03d0[_0x566e('0x38')]);return db[_0x566e('0x39')]['find'](_0x86ee97)[_0x566e('0x1f')](handleEntityNotFound(_0x31b904,null))[_0x566e('0x1f')](respondWithResult(_0x31b904,null))[_0x566e('0x3d')](handleError(_0x31b904,null));};exports[_0x566e('0x42')]=function(_0x5ba5f0,_0x3d6b0e){return db[_0x566e('0x39')]['create'](_0x5ba5f0['body'],{})['then'](respondWithResult(_0x3d6b0e,0xc9))[_0x566e('0x3d')](handleError(_0x3d6b0e,null));};exports[_0x566e('0x43')]=function(_0x2aaf46,_0x3e02c2){if(_0x2aaf46['body']['id']){delete _0x2aaf46[_0x566e('0x44')]['id'];}return db[_0x566e('0x39')]['find']({'where':{'id':_0x2aaf46['params']['id']}})[_0x566e('0x1f')](handleEntityNotFound(_0x3e02c2,null))[_0x566e('0x1f')](saveUpdates(_0x2aaf46[_0x566e('0x44')],null))[_0x566e('0x1f')](respondWithResult(_0x3e02c2,null))[_0x566e('0x3d')](handleError(_0x3e02c2,null));};exports[_0x566e('0x20')]=function(_0xe7565b,_0x20aadb){return db['WhatsappTransferReport'][_0x566e('0x45')]({'where':{'id':_0xe7565b['params']['id']}})[_0x566e('0x1f')](handleEntityNotFound(_0x20aadb,null))[_0x566e('0x1f')](removeEntity(_0x20aadb,null))[_0x566e('0x3d')](handleError(_0x20aadb,null));};exports[_0x566e('0x46')]=function(_0x3d1216,_0x8cecc5){return db['WhatsappTransferReport'][_0x566e('0x46')]()['then'](respondWithResult(_0x8cecc5,null))[_0x566e('0x3d')](handleError(_0x8cecc5,null));};
\ No newline at end of file
+var _0xd8e6=['filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','WhatsappTransferReport','fieldName','key','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x7a0641,_0x453180){var _0x485e82=function(_0x2a2784){while(--_0x2a2784){_0x7a0641['push'](_0x7a0641['shift']());}};_0x485e82(++_0x453180);}(_0xd8e6,0xb7));var _0x6d8e=function(_0x328886,_0x1faa46){_0x328886=_0x328886-0x0;var _0x1d0e73=_0xd8e6[_0x328886];return _0x1d0e73;};'use strict';var emlformat=require(_0x6d8e('0x0'));var rimraf=require(_0x6d8e('0x1'));var zipdir=require(_0x6d8e('0x2'));var jsonpatch=require(_0x6d8e('0x3'));var rp=require(_0x6d8e('0x4'));var moment=require('moment');var BPromise=require(_0x6d8e('0x5'));var Mustache=require(_0x6d8e('0x6'));var util=require('util');var path=require(_0x6d8e('0x7'));var sox=require(_0x6d8e('0x8'));var csv=require(_0x6d8e('0x9'));var ejs=require(_0x6d8e('0xa'));var fs=require('fs');var fs_extra=require(_0x6d8e('0xb'));var _=require(_0x6d8e('0xc'));var squel=require(_0x6d8e('0xd'));var crypto=require(_0x6d8e('0xe'));var jsforce=require(_0x6d8e('0xf'));var deskjs=require(_0x6d8e('0x10'));var toCsv=require(_0x6d8e('0x9'));var querystring=require(_0x6d8e('0x11'));var Papa=require(_0x6d8e('0x12'));var Redis=require(_0x6d8e('0x13'));var authService=require(_0x6d8e('0x14'));var qs=require(_0x6d8e('0x15'));var as=require(_0x6d8e('0x16'));var hardwareService=require(_0x6d8e('0x17'));var logger=require(_0x6d8e('0x18'))(_0x6d8e('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6d8e('0x1a'));var db=require(_0x6d8e('0x1b'))['db'];function respondWithStatusCode(_0x3031e1,_0x2b141f){_0x2b141f=_0x2b141f||0xcc;return function(_0x5e0049){if(_0x5e0049){return _0x3031e1[_0x6d8e('0x1c')](_0x2b141f);}return _0x3031e1[_0x6d8e('0x1d')](_0x2b141f)[_0x6d8e('0x1e')]();};}function respondWithResult(_0x3057e8,_0x10ec80){_0x10ec80=_0x10ec80||0xc8;return function(_0x107c9b){if(_0x107c9b){return _0x3057e8[_0x6d8e('0x1d')](_0x10ec80)[_0x6d8e('0x1f')](_0x107c9b);}};}function respondWithFilteredResult(_0x362f52,_0x47644b){return function(_0xa14a1){if(_0xa14a1){var _0x418567=typeof _0x47644b[_0x6d8e('0x20')]===_0x6d8e('0x21')&&typeof _0x47644b[_0x6d8e('0x22')]===_0x6d8e('0x21');var _0x47cbf2=_0xa14a1[_0x6d8e('0x23')];var _0x5022d4=_0x418567?0x0:_0x47644b[_0x6d8e('0x20')];var _0x3ccd9b=_0x418567?_0xa14a1['count']:_0x47644b[_0x6d8e('0x20')]+_0x47644b[_0x6d8e('0x22')];var _0x4cd989;if(_0x3ccd9b>=_0x47cbf2){_0x3ccd9b=_0x47cbf2;_0x4cd989=0xc8;}else{_0x4cd989=0xce;}_0x362f52[_0x6d8e('0x1d')](_0x4cd989);return _0x362f52[_0x6d8e('0x24')](_0x6d8e('0x25'),_0x5022d4+'-'+_0x3ccd9b+'/'+_0x47cbf2)[_0x6d8e('0x1f')](_0xa14a1);}return null;};}function patchUpdates(_0x201355){return function(_0x11d42e){try{jsonpatch[_0x6d8e('0x26')](_0x11d42e,_0x201355,!![]);}catch(_0x7d17b3){return BPromise['reject'](_0x7d17b3);}return _0x11d42e[_0x6d8e('0x27')]();};}function saveUpdates(_0x467887,_0x3268ca){return function(_0x23a604){if(_0x23a604){return _0x23a604[_0x6d8e('0x28')](_0x467887)[_0x6d8e('0x29')](function(_0xa26158){return _0xa26158;});}return null;};}function removeEntity(_0x49efc8,_0x3276c9){return function(_0x6e9cec){if(_0x6e9cec){return _0x6e9cec[_0x6d8e('0x2a')]()['then'](function(){_0x49efc8[_0x6d8e('0x1d')](0xcc)[_0x6d8e('0x1e')]();});}};}function handleEntityNotFound(_0x43339b,_0x13ada5){return function(_0x53655c){if(!_0x53655c){_0x43339b[_0x6d8e('0x1c')](0x194);}return _0x53655c;};}function handleError(_0x263d8e,_0xf37b5b){_0xf37b5b=_0xf37b5b||0x1f4;return function(_0xeeb611){logger[_0x6d8e('0x2b')](_0xeeb611[_0x6d8e('0x2c')]);if(_0xeeb611['name']){delete _0xeeb611['name'];}_0x263d8e['status'](_0xf37b5b)[_0x6d8e('0x2d')](_0xeeb611);};}exports[_0x6d8e('0x2e')]=function(_0x4b1d6a,_0x4d86f6){var _0x483887={},_0x1b16b7={},_0x177088={'count':0x0,'rows':[]};var _0x49423b=_['map'](db[_0x6d8e('0x2f')]['rawAttributes'],function(_0x36f11c){return{'name':_0x36f11c[_0x6d8e('0x30')],'type':_0x36f11c['type'][_0x6d8e('0x31')]};});_0x1b16b7[_0x6d8e('0x32')]=_[_0x6d8e('0x33')](_0x49423b,_0x6d8e('0x34'));_0x1b16b7['query']=_[_0x6d8e('0x35')](_0x4b1d6a[_0x6d8e('0x36')]);_0x1b16b7['filters']=_[_0x6d8e('0x37')](_0x1b16b7[_0x6d8e('0x32')],_0x1b16b7[_0x6d8e('0x36')]);_0x483887[_0x6d8e('0x38')]=_[_0x6d8e('0x37')](_0x1b16b7[_0x6d8e('0x32')],qs[_0x6d8e('0x39')](_0x4b1d6a[_0x6d8e('0x36')][_0x6d8e('0x39')]));_0x483887[_0x6d8e('0x38')]=_0x483887[_0x6d8e('0x38')][_0x6d8e('0x3a')]?_0x483887['attributes']:_0x1b16b7[_0x6d8e('0x32')];if(!_0x4b1d6a[_0x6d8e('0x36')][_0x6d8e('0x3b')](_0x6d8e('0x3c'))){_0x483887[_0x6d8e('0x22')]=qs[_0x6d8e('0x22')](_0x4b1d6a[_0x6d8e('0x36')][_0x6d8e('0x22')]);_0x483887[_0x6d8e('0x20')]=qs[_0x6d8e('0x20')](_0x4b1d6a[_0x6d8e('0x36')]['offset']);}_0x483887[_0x6d8e('0x3d')]=qs[_0x6d8e('0x3e')](_0x4b1d6a[_0x6d8e('0x36')][_0x6d8e('0x3e')]);_0x483887[_0x6d8e('0x3f')]=qs[_0x6d8e('0x40')](_[_0x6d8e('0x41')](_0x4b1d6a[_0x6d8e('0x36')],_0x1b16b7[_0x6d8e('0x40')]),_0x49423b);if(_0x4b1d6a['query'][_0x6d8e('0x42')]){_0x483887[_0x6d8e('0x3f')]=_[_0x6d8e('0x43')](_0x483887[_0x6d8e('0x3f')],{'$or':_['map'](_0x49423b,function(_0x4033ff){if(_0x4033ff[_0x6d8e('0x44')]!==_0x6d8e('0x45')){var _0x5b221a={};_0x5b221a[_0x4033ff['name']]={'$like':'%'+_0x4b1d6a[_0x6d8e('0x36')][_0x6d8e('0x42')]+'%'};return _0x5b221a;}})});}_0x483887=_['merge']({},_0x483887,_0x4b1d6a[_0x6d8e('0x46')]);var _0xb5fd0b={'where':_0x483887['where']};return db[_0x6d8e('0x2f')][_0x6d8e('0x23')](_0xb5fd0b)[_0x6d8e('0x29')](function(_0x14dea8){_0x177088['count']=_0x14dea8;if(_0x4b1d6a[_0x6d8e('0x36')][_0x6d8e('0x47')]){_0x483887[_0x6d8e('0x48')]=[{'all':!![]}];}return db[_0x6d8e('0x2f')][_0x6d8e('0x49')](_0x483887);})[_0x6d8e('0x29')](function(_0x2a5c19){_0x177088[_0x6d8e('0x4a')]=_0x2a5c19;return _0x177088;})['then'](respondWithFilteredResult(_0x4d86f6,_0x483887))[_0x6d8e('0x4b')](handleError(_0x4d86f6,null));};exports[_0x6d8e('0x4c')]=function(_0x38cba0,_0x2cba6d){var _0x3b240a={'raw':!![],'where':{'id':_0x38cba0['params']['id']}},_0x3acac1={};_0x3acac1['model']=_[_0x6d8e('0x35')](db[_0x6d8e('0x2f')][_0x6d8e('0x4d')]);_0x3acac1[_0x6d8e('0x36')]=_['keys'](_0x38cba0[_0x6d8e('0x36')]);_0x3acac1[_0x6d8e('0x40')]=_[_0x6d8e('0x37')](_0x3acac1[_0x6d8e('0x32')],_0x3acac1[_0x6d8e('0x36')]);_0x3b240a['attributes']=_['intersection'](_0x3acac1['model'],qs[_0x6d8e('0x39')](_0x38cba0[_0x6d8e('0x36')]['fields']));_0x3b240a[_0x6d8e('0x38')]=_0x3b240a[_0x6d8e('0x38')]['length']?_0x3b240a['attributes']:_0x3acac1[_0x6d8e('0x32')];if(_0x38cba0[_0x6d8e('0x36')][_0x6d8e('0x47')]){_0x3b240a[_0x6d8e('0x48')]=[{'all':!![]}];}_0x3b240a=_[_0x6d8e('0x43')]({},_0x3b240a,_0x38cba0[_0x6d8e('0x46')]);return db[_0x6d8e('0x2f')][_0x6d8e('0x4e')](_0x3b240a)['then'](handleEntityNotFound(_0x2cba6d,null))[_0x6d8e('0x29')](respondWithResult(_0x2cba6d,null))[_0x6d8e('0x4b')](handleError(_0x2cba6d,null));};exports[_0x6d8e('0x4f')]=function(_0x409e5a,_0x387d9f){return db[_0x6d8e('0x2f')][_0x6d8e('0x4f')](_0x409e5a['body'],{})['then'](respondWithResult(_0x387d9f,0xc9))[_0x6d8e('0x4b')](handleError(_0x387d9f,null));};exports[_0x6d8e('0x28')]=function(_0x510668,_0x404c4e){if(_0x510668[_0x6d8e('0x50')]['id']){delete _0x510668['body']['id'];}return db[_0x6d8e('0x2f')]['find']({'where':{'id':_0x510668[_0x6d8e('0x51')]['id']}})['then'](handleEntityNotFound(_0x404c4e,null))[_0x6d8e('0x29')](saveUpdates(_0x510668[_0x6d8e('0x50')],null))['then'](respondWithResult(_0x404c4e,null))[_0x6d8e('0x4b')](handleError(_0x404c4e,null));};exports[_0x6d8e('0x2a')]=function(_0x3202ff,_0x54c107){return db['WhatsappTransferReport']['find']({'where':{'id':_0x3202ff[_0x6d8e('0x51')]['id']}})[_0x6d8e('0x29')](handleEntityNotFound(_0x54c107,null))[_0x6d8e('0x29')](removeEntity(_0x54c107,null))[_0x6d8e('0x4b')](handleError(_0x54c107,null));};exports[_0x6d8e('0x52')]=function(_0x46c5d3,_0x5d1f76){return db[_0x6d8e('0x2f')][_0x6d8e('0x52')]()[_0x6d8e('0x29')](respondWithResult(_0x5d1f76,null))[_0x6d8e('0x4b')](handleError(_0x5d1f76,null));};
\ No newline at end of file
index be9f7ec..7775d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29a1=['rimraf','../../config/environment','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','moment','request-promise','path'];(function(_0x134448,_0x591d7b){var _0x2d52a1=function(_0x56b840){while(--_0x56b840){_0x134448['push'](_0x134448['shift']());}};_0x2d52a1(++_0x591d7b);}(_0x29a1,0xe2));var _0x129a=function(_0x43ff8c,_0x51976f){_0x43ff8c=_0x43ff8c-0x0;var _0x4de11c=_0x29a1[_0x43ff8c];return _0x4de11c;};'use strict';var _=require(_0x129a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x129a('0x1'));var BPromise=require('bluebird');var rp=require(_0x129a('0x2'));var fs=require('fs');var path=require(_0x129a('0x3'));var rimraf=require(_0x129a('0x4'));var config=require(_0x129a('0x5'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x956e5c,_0x1e986b){return _0x956e5c[_0x129a('0x6')](_0x129a('0x7'),attributes,{'tableName':_0x129a('0x8'),'paranoid':![],'indexes':[{'name':_0x129a('0x9'),'fields':[_0x129a('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x722c=['exports','uniqueid','util','api','request-promise','path','../../config/environment'];(function(_0x29d824,_0x24a09d){var _0x39d80c=function(_0x528b30){while(--_0x528b30){_0x29d824['push'](_0x29d824['shift']());}};_0x39d80c(++_0x24a09d);}(_0x722c,0xaa));var _0xc722=function(_0x258d3a,_0x349fb3){_0x258d3a=_0x258d3a-0x0;var _0x1cf7fd=_0x722c[_0x258d3a];return _0x1cf7fd;};'use strict';var _=require('lodash');var util=require(_0xc722('0x0'));var logger=require('../../config/logger')(_0xc722('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc722('0x2'));var fs=require('fs');var path=require(_0xc722('0x3'));var rimraf=require('rimraf');var config=require(_0xc722('0x4'));var attributes=require('./whatsappTransferReport.attributes');module[_0xc722('0x5')]=function(_0x35c36b,_0x3f73cf){return _0x35c36b['define']('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xc722('0x6'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 34b2e6b..d85b501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f1=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','WhatsappTransferReport,\x20%s,\x20%s','error','message'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x26f1,0xb4));var _0x126f=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x26f1[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x126f('0x0'));var BPromise=require('bluebird');var rs=require(_0x126f('0x1'));var fs=require('fs');var Redis=require(_0x126f('0x2'));var db=require(_0x126f('0x3'))['db'];var utils=require(_0x126f('0x4'));var logger=require(_0x126f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x126f('0x6'));var client=jayson[_0x126f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314bfa,_0x265511,_0x38646e){return new BPromise(function(_0x3e6c12,_0x4d820c){return client[_0x126f('0x8')](_0x314bfa,_0x38646e)['then'](function(_0x1a6d08){logger[_0x126f('0x9')]('WhatsappTransferReport,\x20%s,\x20%s',_0x265511,_0x126f('0xa'));logger[_0x126f('0xb')](_0x126f('0xc'),_0x265511,_0x126f('0xa'),JSON[_0x126f('0xd')](_0x1a6d08));if(_0x1a6d08['error']){if(_0x1a6d08['error'][_0x126f('0xe')]===0x1f4){logger['error'](_0x126f('0xf'),_0x265511,_0x1a6d08[_0x126f('0x10')][_0x126f('0x11')]);return _0x4d820c(_0x1a6d08[_0x126f('0x10')][_0x126f('0x11')]);}logger['error'](_0x126f('0xf'),_0x265511,_0x1a6d08[_0x126f('0x10')][_0x126f('0x11')]);return _0x3e6c12(_0x1a6d08['error'][_0x126f('0x11')]);}else{logger['info'](_0x126f('0xf'),_0x265511,_0x126f('0xa'));_0x3e6c12(_0x1a6d08['result']['message']);}})['catch'](function(_0x3d92c8){logger[_0x126f('0x10')]('WhatsappTransferReport,\x20%s,\x20%s',_0x265511,_0x3d92c8);_0x4d820c(_0x3d92c8);});});}
\ No newline at end of file
+var _0xce8f=['then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x41ec2f,_0xedb083){var _0x2abd9f=function(_0x14ce42){while(--_0x14ce42){_0x41ec2f['push'](_0x41ec2f['shift']());}};_0x2abd9f(++_0xedb083);}(_0xce8f,0x17c));var _0xfce8=function(_0xe3bbea,_0x3ae4d3){_0xe3bbea=_0xe3bbea-0x0;var _0x18713d=_0xce8f[_0xe3bbea];return _0x18713d;};'use strict';var _=require(_0xfce8('0x0'));var util=require('util');var moment=require(_0xfce8('0x1'));var BPromise=require('bluebird');var rs=require(_0xfce8('0x2'));var fs=require('fs');var Redis=require(_0xfce8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfce8('0x4'));var logger=require(_0xfce8('0x5'))(_0xfce8('0x6'));var config=require(_0xfce8('0x7'));var jayson=require(_0xfce8('0x8'));var client=jayson[_0xfce8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x557a29,_0x39c2e7,_0x2d88d6){return new BPromise(function(_0xe8dcbc,_0x1503d4){return client[_0xfce8('0xa')](_0x557a29,_0x2d88d6)[_0xfce8('0xb')](function(_0x9a21da){logger['info'](_0xfce8('0xc'),_0x39c2e7,_0xfce8('0xd'));logger[_0xfce8('0xe')](_0xfce8('0xf'),_0x39c2e7,_0xfce8('0xd'),JSON[_0xfce8('0x10')](_0x9a21da));if(_0x9a21da[_0xfce8('0x11')]){if(_0x9a21da[_0xfce8('0x11')][_0xfce8('0x12')]===0x1f4){logger[_0xfce8('0x11')](_0xfce8('0xc'),_0x39c2e7,_0x9a21da[_0xfce8('0x11')]['message']);return _0x1503d4(_0x9a21da[_0xfce8('0x11')]['message']);}logger[_0xfce8('0x11')](_0xfce8('0xc'),_0x39c2e7,_0x9a21da[_0xfce8('0x11')][_0xfce8('0x13')]);return _0xe8dcbc(_0x9a21da['error']['message']);}else{logger[_0xfce8('0x14')](_0xfce8('0xc'),_0x39c2e7,_0xfce8('0xd'));_0xe8dcbc(_0x9a21da[_0xfce8('0x15')][_0xfce8('0x13')]);}})[_0xfce8('0x16')](function(_0x25885e){logger['error'](_0xfce8('0xc'),_0x39c2e7,_0x25885e);_0x1503d4(_0x25885e);});});}
\ No newline at end of file
index a4714c1..869336f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf393=['seedDB','./config/seedDB','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','info','start','then','Online\x20apps:','map','name','join','Offline\x20apps:','filter','status','online','None'];(function(_0x6f279d,_0x44eb44){var _0x55dd18=function(_0x3dcf4c){while(--_0x3dcf4c){_0x6f279d['push'](_0x6f279d['shift']());}};_0x55dd18(++_0x44eb44);}(_0xf393,0x189));var _0x3f39=function(_0x268f68,_0x5e8daf){_0x268f68=_0x268f68-0x0;var _0x4d76c8=_0xf393[_0x268f68];return _0x4d76c8;};'use strict';var _=require(_0x3f39('0x0'));var mysqldb=require(_0x3f39('0x1'));var rpc=require(_0x3f39('0x2'));var config=require(_0x3f39('0x3'));var logger=require('./config/logger')(_0x3f39('0x4'));var pm2=require(_0x3f39('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x3f39('0x6'));var chat=require(_0x3f39('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x3f39('0x8'));function main(){return mysqldb['db'][_0x3f39('0x9')][_0x3f39('0xa')]()['then'](function(){return rpc['listen']();})['then'](function(_0x3fa07f){logger[_0x3f39('0xb')](_0x3fa07f);return chat[_0x3f39('0xc')]();})[_0x3f39('0xd')](function(){return whatsapp[_0x3f39('0xc')]();})[_0x3f39('0xd')](function(){return schedule[_0x3f39('0xc')]();})[_0x3f39('0xd')](function(){return transcribe[_0x3f39('0xc')]();})[_0x3f39('0xd')](function(_0x5c6798){logger[_0x3f39('0xb')](_0x5c6798);return pm2[_0x3f39('0xc')](pm2Config);})[_0x3f39('0xd')](function(_0x1745ef){logger[_0x3f39('0xb')](_0x3f39('0xe'),_[_0x3f39('0xf')](_['filter'](_0x1745ef,{'status':'online'}),_0x3f39('0x10'))[_0x3f39('0x11')]());logger[_0x3f39('0xb')](_0x3f39('0x12'),_[_0x3f39('0xf')](_[_0x3f39('0x13')](_0x1745ef,function(_0x1df8bb){return _0x1df8bb[_0x3f39('0x14')]!==_0x3f39('0x15');}),_0x3f39('0x10'))[_0x3f39('0x11')]()||_0x3f39('0x16'));config[_0x3f39('0x17')]&&require(_0x3f39('0x18'))['default']();require('./config/license')['default']();})['catch'](function(_0x1898a1){logger['error'](_0x3f39('0x19'),_0x1898a1);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0x00da=['map','status','online','None','seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync','then','start','info','filter','name','join'];(function(_0x5ba8b7,_0x38235e){var _0x102981=function(_0x548479){while(--_0x548479){_0x5ba8b7['push'](_0x5ba8b7['shift']());}};_0x102981(++_0x38235e);}(_0x00da,0x1cb));var _0xa00d=function(_0x37c6c0,_0x5dc424){_0x37c6c0=_0x37c6c0-0x0;var _0x5974d4=_0x00da[_0x37c6c0];return _0x5974d4;};'use strict';var _=require(_0xa00d('0x0'));var mysqldb=require(_0xa00d('0x1'));var rpc=require(_0xa00d('0x2'));var config=require(_0xa00d('0x3'));var logger=require('./config/logger')('app');var pm2=require(_0xa00d('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xa00d('0x5'));var chat=require(_0xa00d('0x6'));var whatsapp=require(_0xa00d('0x7'));var transcribe=require(_0xa00d('0x8'));function main(){return mysqldb['db']['sequelize'][_0xa00d('0x9')]()[_0xa00d('0xa')](function(){return rpc['listen']();})['then'](function(_0x550c0d){logger['info'](_0x550c0d);return chat[_0xa00d('0xb')]();})['then'](function(){return whatsapp[_0xa00d('0xb')]();})[_0xa00d('0xa')](function(){return schedule[_0xa00d('0xb')]();})[_0xa00d('0xa')](function(){return transcribe[_0xa00d('0xb')]();})[_0xa00d('0xa')](function(_0xcd4fd0){logger[_0xa00d('0xc')](_0xcd4fd0);return pm2['start'](pm2Config);})['then'](function(_0x5d21e6){logger['info']('Online\x20apps:',_['map'](_[_0xa00d('0xd')](_0x5d21e6,{'status':'online'}),_0xa00d('0xe'))[_0xa00d('0xf')]());logger[_0xa00d('0xc')]('Offline\x20apps:',_[_0xa00d('0x10')](_[_0xa00d('0xd')](_0x5d21e6,function(_0x322fb6){return _0x322fb6[_0xa00d('0x11')]!==_0xa00d('0x12');}),'name')[_0xa00d('0xf')]()||_0xa00d('0x13'));config[_0xa00d('0x14')]&&require('./config/seedDB')['default']();require('./config/license')[_0xa00d('0x15')]();})['catch'](function(_0x3c9baf){logger[_0xa00d('0x16')](_0xa00d('0x17'),_0x3c9baf);process[_0xa00d('0x18')](0x1);});}main();
\ No newline at end of file
index ad912b0..00603cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a17=['headers','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','User','find','sub','Setting','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','Invalid\x20API\x20access\x20key','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','apiKeyNonce','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secrets','payload','verify','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','util','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','then','closed','status','disposition','unmanaged','json','Forbidden.','catch','authorization','Basic','authenticate','pass','Wrong\x20credentials.','user','startsWith'];(function(_0x4bacb6,_0x2b299d){var _0x58c029=function(_0x2faaf5){while(--_0x2faaf5){_0x4bacb6['push'](_0x4bacb6['shift']());}};_0x58c029(++_0x2b299d);}(_0x5a17,0xb9));var _0x75a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a17[_0x3dd15e];return _0x231fd0;};'use strict';var db=require(_0x75a1('0x0'))['db'];var config=require(_0x75a1('0x1'));var hardwareConf=require(_0x75a1('0x2'));var licenseUtil=require(_0x75a1('0x3'));var encryptor=require(_0x75a1('0x4'));var _=require(_0x75a1('0x5'));var jwt=require(_0x75a1('0x6'));var expressJwt=require(_0x75a1('0x7'));var compose=require(_0x75a1('0x8'));var basicAuth=require('basic-auth');var crypto=require(_0x75a1('0x9'));var BPromise=require(_0x75a1('0xa'));var util=require(_0x75a1('0xb'));var moment=require(_0x75a1('0xc'));var validateJwt=expressJwt({'secret':config['secrets'][_0x75a1('0xd')]});var userAttributes=['id',_0x75a1('0xe'),_0x75a1('0xf'),_0x75a1('0x10'),_0x75a1('0x11'),_0x75a1('0x12'),_0x75a1('0x13'),_0x75a1('0x14'),_0x75a1('0x15'),'voicePause',_0x75a1('0x16'),_0x75a1('0x17'),_0x75a1('0x18'),_0x75a1('0x19'),_0x75a1('0x1a'),_0x75a1('0x1b'),_0x75a1('0x1c'),'lastLoginAt',_0x75a1('0x1d'),_0x75a1('0x1e'),_0x75a1('0x1f'),_0x75a1('0x20'),_0x75a1('0x21'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0x75a1('0x22'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x75a1('0x23'),_0x75a1('0x24'),_0x75a1('0x25'),_0x75a1('0x26'),_0x75a1('0x27'),_0x75a1('0x28'),'interface',_0x75a1('0x29'),'privacyEnabled',_0x75a1('0x2a'),_0x75a1('0x2b'),'downloadVoiceRecordings',_0x75a1('0x2c'),_0x75a1('0x2d')];exports[_0x75a1('0x2e')]=function(){return this[_0x75a1('0x2f')](!![])[_0x75a1('0x30')](function(_0x493d8f,_0x4ebd96,_0xf49a4a){if(_0x493d8f['user']){_0xf49a4a();}else{return db[_0x75a1('0x31')][_0x75a1('0x32')]({'where':{'id':_0x493d8f[_0x75a1('0x33')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x75a1('0x34')](function(_0x1c0c1d){if(_0x1c0c1d&&_0x1c0c1d[_0x75a1('0x35')]){return _0x4ebd96[_0x75a1('0x36')](_0x1c0c1d[_0x75a1('0x37')]===_0x75a1('0x38')?0x195:0x193)[_0x75a1('0x39')]({'message':_0x1c0c1d[_0x75a1('0x37')]===_0x75a1('0x38')?'Unmanaged.':_0x75a1('0x3a')});}else{_0xf49a4a();}})[_0x75a1('0x3b')](function(_0x3778d9){_0xf49a4a(_0x3778d9);});}});};exports[_0x75a1('0x2f')]=function isAuthenticated(_0x460c6d){return compose()[_0x75a1('0x30')](function(_0x5c0fbf,_0x5a5aac,_0x35ef92){var _0x29bc08;if(_0x5c0fbf['headers'][_0x75a1('0x3c')]){if(_['startsWith'](_0x5c0fbf['headers'][_0x75a1('0x3c')],_0x75a1('0x3d'))){var _0x49743d=basicAuth(_0x5c0fbf);db['User']['find']({'where':{'name':_0x49743d[_0x75a1('0x10')]}})[_0x75a1('0x34')](function(_0x19e4ce){if(!_0x19e4ce||!_0x19e4ce[_0x75a1('0x3e')](_0x49743d[_0x75a1('0x3f')])){return _0x5a5aac[_0x75a1('0x36')](0x191)[_0x75a1('0x39')]({'message':_0x75a1('0x40')});}_0x5c0fbf[_0x75a1('0x41')]={'id':_0x19e4ce['id']};_0x35ef92();})[_0x75a1('0x3b')](function(_0x25ec31){_0x35ef92(_0x25ec31);});}else if(_[_0x75a1('0x42')](_0x5c0fbf[_0x75a1('0x43')][_0x75a1('0x3c')],_0x75a1('0x44'))){validateJwt(_0x5c0fbf,_0x5a5aac,_0x35ef92);}else{if(_0x460c6d){_0x35ef92();}else{return _0x5a5aac[_0x75a1('0x36')](0x193)[_0x75a1('0x39')]({'message':_0x75a1('0x45')});}}}else if(_0x5c0fbf[_0x75a1('0x46')]['apikey']){try{var _0x2dcfe2={'audience':hardwareConf[_0x75a1('0x47')](),'issuer':hardwareConf[_0x75a1('0x47')]()};verifyJwt(_0x5c0fbf['query'][_0x75a1('0x48')],_0x2dcfe2)[_0x75a1('0x34')](function(_0xa66d7c){return db[_0x75a1('0x49')][_0x75a1('0x4a')]({'where':{'id':_0xa66d7c[_0x75a1('0x4b')]}})[_0x75a1('0x34')](function(_0x5f54d7){_0x29bc08=_0x5f54d7;return db[_0x75a1('0x4c')][_0x75a1('0x32')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x75a1('0x4d')],'raw':!![]});})[_0x75a1('0x34')](function(_0x7a878c){if(!_0x29bc08||!_[_0x75a1('0x4e')](_0x29bc08['apiKeyNonce'],_0xa66d7c['nonce'])){return _0x5a5aac[_0x75a1('0x36')](0x191)[_0x75a1('0x39')]({'message':_0x75a1('0x4f')});}if(_0x29bc08[_0x75a1('0x50')]){return _0x5a5aac['status'](0x191)[_0x75a1('0x39')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x29bc08[_0x75a1('0x51')]){if(_0x7a878c['blockDuration']>0x0){if(moment(_0x29bc08[_0x75a1('0x52')])['add'](_0x7a878c[_0x75a1('0x4d')],'minutes')>moment()){return _0x5a5aac[_0x75a1('0x36')](0x191)['json']({'message':_0x75a1('0x53')});}}else{return _0x5a5aac[_0x75a1('0x36')](0x191)[_0x75a1('0x39')]({'message':_0x75a1('0x53')});}}_0x5c0fbf[_0x75a1('0x41')]={'id':_0x29bc08['id']};_0x35ef92();});})[_0x75a1('0x3b')](function(){return _0x5a5aac['status'](0x191)[_0x75a1('0x39')]({'message':_0x75a1('0x53')});});}catch(_0x52cc95){_0x35ef92(_0x52cc95);}}else if(_0x460c6d){_0x35ef92();}else{return _0x5a5aac['status'](0x193)[_0x75a1('0x39')]({'message':'Unknown\x20authorization\x20format'});}})['use'](function(_0xc6e7b1,_0x4656c8,_0x147ee6){if(_0xc6e7b1[_0x75a1('0x41')]){db[_0x75a1('0x49')][_0x75a1('0x4a')]({'where':{'id':_0xc6e7b1['user']['id']},'attributes':userAttributes})[_0x75a1('0x34')](function(_0x29d4cc){if(!_0x29d4cc){return _0x4656c8[_0x75a1('0x36')](0x194)[_0x75a1('0x39')]({'message':_0x75a1('0x54')});}_0xc6e7b1[_0x75a1('0x41')]=_0x29d4cc;_0x147ee6();})[_0x75a1('0x3b')](function(_0x89ff79){_0x147ee6(_0x89ff79);});}else if(_0x460c6d){_0x147ee6();}else{return _0x4656c8[_0x75a1('0x36')](0x194)[_0x75a1('0x39')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x75a1('0x55')]=function canUpdate(){return compose()[_0x75a1('0x30')](function(_0x372e33,_0x11abb9,_0x4ff7af){return licenseUtil[_0x75a1('0x56')]()[_0x75a1('0x34')](function(_0x12819c){if(_0x12819c[_0x75a1('0x57')]){_0x4ff7af();}else{return _0x11abb9[_0x75a1('0x36')](0x193)[_0x75a1('0x39')]({'message':_0x75a1('0x58')});}})[_0x75a1('0x3b')](function(_0x2e7af6){_0x4ff7af(_0x2e7af6);});});};exports[_0x75a1('0x59')]=function(_0x304901,_0x5695d2,_0x530295){_0x304901[_0x75a1('0x59')]=!![];return _0x530295();};exports[_0x75a1('0x5a')]=function signToken(_0x4ef3e9){return signJwt(_0x4ef3e9);};exports[_0x75a1('0x5b')]=function(_0x21fd45,_0x1c3443){if(!_0x21fd45[_0x75a1('0x41')]){return _0x1c3443[_0x75a1('0x36')](0x194)[_0x75a1('0x39')]({'message':_0x75a1('0x5c')});}var _0x5cbda5={'payload':{'id':_0x21fd45['user']['id'],'role':_0x21fd45[_0x75a1('0x41')][_0x75a1('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5cbda5)[_0x75a1('0x34')](function(_0x10fab8){_0x1c3443['cookie'](_0x75a1('0x5d'),_0x10fab8);_0x1c3443[_0x75a1('0x5e')]('/dashboards/general');})[_0x75a1('0x3b')](function(_0x573ac8){return _0x1c3443[_0x75a1('0x36')](0x1f4)[_0x75a1('0x5f')](_0x573ac8);});};exports['retrieveApiKey']=function(_0x205935){if(_[_0x75a1('0x60')](_0x205935[_0x75a1('0x61')])||_[_0x75a1('0x60')](_0x205935['apiKeyIat'])){return null;}else{return createJwt(_0x205935);}};exports[_0x75a1('0x62')]=function(_0x7d3e13){_0x7d3e13['apiKeyNonce']=generateNonce();_0x7d3e13[_0x75a1('0x63')]=generateIssuedAt();return createJwt(_0x7d3e13);};exports[_0x75a1('0x64')]=function(_0x3612a9,_0x5333fd){var _0x22fdda=_0x3612a9['query'][_0x75a1('0x48')];if(_0x22fdda){var _0x6b4303={'nonce':_0x5333fd[_0x75a1('0x61')],'iat':_0x5333fd[_0x75a1('0x63')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x75a1('0x47')]()};return verifyJwt(_0x22fdda,_0x6b4303)[_0x75a1('0x34')](function(){return generateApiKey(_0x5333fd);});}else{throw{'message':_0x75a1('0x65')};}};exports['validatePasswordPattern']=function(_0x2877bb){var _0x1377cb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1377cb[_0x75a1('0x66')](_0x2877bb))throw new db[(_0x75a1('0x67'))][(_0x75a1('0x68'))]('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[_0x75a1('0x69')]=function(_0x3f4fe4,_0x4a07d9,_0x2e826a){var _0x5bece7=encryptor[_0x75a1('0x6a')](_0x4a07d9)[_0x75a1('0x6b')](',');for(var _0x28f9dd=0x0;_0x28f9dd<_0x2e826a;_0x28f9dd++){if(!_0x5bece7[_0x28f9dd])break;if(_0x3f4fe4[_0x75a1('0x6c')]()===_0x5bece7[_0x28f9dd][_0x75a1('0x6c')]()){var _0x3a6802=util[_0x75a1('0x6d')](_0x75a1('0x6e'),_0x2e826a);if(_0x2e826a===0x1){_0x3a6802=_0x75a1('0x6f');}throw new db['Sequelize'][(_0x75a1('0x68'))](_0x3a6802);}}return;};exports[_0x75a1('0x70')]=function(_0x209228,_0x1f9cc4){var _0x50aa3f=_0x1f9cc4?encryptor[_0x75a1('0x6a')](_0x1f9cc4)[_0x75a1('0x6b')](','):[];if(_0x50aa3f[_0x75a1('0x71')]===0x5){_0x50aa3f[_0x75a1('0x72')](-0x1,0x1);}_0x50aa3f[_0x75a1('0x73')](_0x209228);return encryptor[_0x75a1('0x74')](_0x50aa3f[_0x75a1('0x75')](','));};function signJwt(_0x1dd128){var _0x35ef04=BPromise[_0x75a1('0x76')](jwt[_0x75a1('0x77')],{'context':jwt});var _0x491e55=_0x1dd128['secret']||config[_0x75a1('0x78')][_0x75a1('0xd')];return new BPromise(function(_0x42f1fb,_0x32efcd){_0x35ef04(_0x1dd128[_0x75a1('0x79')],_0x491e55,_0x1dd128['options'])[_0x75a1('0x34')](function(_0x34a966){_0x42f1fb(_0x34a966);})[_0x75a1('0x3b')](function(_0x4b773a){_0x32efcd(_0x4b773a);});});}function verifyJwt(_0x33e21e,_0x37c844,_0xc3adc8){var _0x2d5e4d=BPromise[_0x75a1('0x76')](jwt[_0x75a1('0x7a')],{'context':jwt});var _0x22850f=_0xc3adc8||config['secrets'][_0x75a1('0xd')];return new BPromise(function(_0x30ad70,_0x28234e){_0x2d5e4d(_0x33e21e,_0x22850f,_0x37c844)[_0x75a1('0x34')](function(_0x5534c8){_0x30ad70(_0x5534c8);})['catch'](function(_0x53da00){_0x28234e(_0x53da00);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x75a1('0x7b')](_0x75a1('0x7c'));}function generateIssuedAt(){return Math[_0x75a1('0x7d')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1612c7){var _0x1af57b={'payload':{'iat':_0x1612c7[_0x75a1('0x63')],'nonce':_0x1612c7[_0x75a1('0x61')]},'options':{'algorithm':'HS512','subject':_0x1612c7['id']['toString'](),'issuer':hardwareConf[_0x75a1('0x47')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1af57b)['then'](function(_0x4a7019){return{'iat':_0x1612c7['apiKeyIat'],'nonce':_0x1612c7[_0x75a1('0x61')],'token':_0x4a7019};});}
\ No newline at end of file
+var _0x0bbc=['lastPauseAt','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','find','authenticate','pass','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','User','sub','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','apiKeyNonce','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','split','toLowerCase','format','updatePasswordsHistory','decryptString','length','unshift','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','secrets','session','role','name','internal','email','permissions','md5secret','voicePause','smsPause','openchannelPause'];(function(_0x298064,_0x1d2bfb){var _0x2512ea=function(_0x3e5b28){while(--_0x3e5b28){_0x298064['push'](_0x298064['shift']());}};_0x2512ea(++_0x1d2bfb);}(_0x0bbc,0xdd));var _0xc0bb=function(_0x1d9bd2,_0x3e6ee4){_0x1d9bd2=_0x1d9bd2-0x0;var _0x5921a3=_0x0bbc[_0x1d9bd2];return _0x5921a3;};'use strict';var db=require(_0xc0bb('0x0'))['db'];var config=require(_0xc0bb('0x1'));var hardwareConf=require(_0xc0bb('0x2'));var licenseUtil=require(_0xc0bb('0x3'));var encryptor=require('../encryptor');var _=require(_0xc0bb('0x4'));var jwt=require(_0xc0bb('0x5'));var expressJwt=require(_0xc0bb('0x6'));var compose=require(_0xc0bb('0x7'));var basicAuth=require(_0xc0bb('0x8'));var crypto=require(_0xc0bb('0x9'));var BPromise=require('bluebird');var util=require(_0xc0bb('0xa'));var moment=require(_0xc0bb('0xb'));var validateJwt=expressJwt({'secret':config[_0xc0bb('0xc')][_0xc0bb('0xd')]});var userAttributes=['id',_0xc0bb('0xe'),'fullname',_0xc0bb('0xf'),_0xc0bb('0x10'),_0xc0bb('0x11'),'userpic',_0xc0bb('0x12'),_0xc0bb('0x13'),_0xc0bb('0x14'),'chatPause','mailPause','faxPause',_0xc0bb('0x15'),_0xc0bb('0x16'),'pauseType','showWebBar','lastLoginAt',_0xc0bb('0x17'),'crudPermissions',_0xc0bb('0x18'),'passwordResetAt',_0xc0bb('0x19'),_0xc0bb('0x1a'),_0xc0bb('0x1b'),'phoneBarDnd',_0xc0bb('0x1c'),_0xc0bb('0x1d'),_0xc0bb('0x1e'),_0xc0bb('0x1f'),'phoneBarPrefixRequired',_0xc0bb('0x20'),_0xc0bb('0x21'),'hotdesk',_0xc0bb('0x22'),_0xc0bb('0x23'),_0xc0bb('0x24'),'settingsEnabled','wssPort',_0xc0bb('0x25'),_0xc0bb('0x26'),_0xc0bb('0x27')];exports['isChatInteractionAuthorized']=function(){return this[_0xc0bb('0x28')](!![])[_0xc0bb('0x29')](function(_0x36ce5b,_0x4b5524,_0x227ebb){if(_0x36ce5b[_0xc0bb('0x2a')]){_0x227ebb();}else{return db[_0xc0bb('0x2b')][_0xc0bb('0x2c')]({'where':{'id':_0x36ce5b[_0xc0bb('0x2d')]['id']},'attributes':['id',_0xc0bb('0x2e'),_0xc0bb('0x2f')],'raw':!![]})[_0xc0bb('0x30')](function(_0x187827){if(_0x187827&&_0x187827[_0xc0bb('0x2e')]){return _0x4b5524[_0xc0bb('0x31')](_0x187827[_0xc0bb('0x2f')]===_0xc0bb('0x32')?0x195:0x193)[_0xc0bb('0x33')]({'message':_0x187827['disposition']===_0xc0bb('0x32')?_0xc0bb('0x34'):_0xc0bb('0x35')});}else{_0x227ebb();}})[_0xc0bb('0x36')](function(_0x407d22){_0x227ebb(_0x407d22);});}});};exports[_0xc0bb('0x28')]=function isAuthenticated(_0x4d4a76){return compose()[_0xc0bb('0x29')](function(_0x28da8e,_0x924b33,_0x35515a){var _0x475c5a;if(_0x28da8e[_0xc0bb('0x37')][_0xc0bb('0x38')]){if(_[_0xc0bb('0x39')](_0x28da8e[_0xc0bb('0x37')]['authorization'],_0xc0bb('0x3a'))){var _0x360f01=basicAuth(_0x28da8e);db['User'][_0xc0bb('0x3b')]({'where':{'name':_0x360f01['name']}})[_0xc0bb('0x30')](function(_0x33ece5){if(!_0x33ece5||!_0x33ece5[_0xc0bb('0x3c')](_0x360f01[_0xc0bb('0x3d')])){return _0x924b33['status'](0x191)[_0xc0bb('0x33')]({'message':_0xc0bb('0x3e')});}_0x28da8e['user']={'id':_0x33ece5['id']};_0x35515a();})['catch'](function(_0x1c78aa){_0x35515a(_0x1c78aa);});}else if(_[_0xc0bb('0x39')](_0x28da8e[_0xc0bb('0x37')][_0xc0bb('0x38')],'Bearer')){validateJwt(_0x28da8e,_0x924b33,_0x35515a);}else{if(_0x4d4a76){_0x35515a();}else{return _0x924b33[_0xc0bb('0x31')](0x193)[_0xc0bb('0x33')]({'message':_0xc0bb('0x3f')});}}}else if(_0x28da8e[_0xc0bb('0x40')]['apikey']){try{var _0x417ba4={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xc0bb('0x41')]()};verifyJwt(_0x28da8e['query']['apikey'],_0x417ba4)['then'](function(_0xbf63f5){return db[_0xc0bb('0x42')][_0xc0bb('0x3b')]({'where':{'id':_0xbf63f5[_0xc0bb('0x43')]}})['then'](function(_0x18a9b1){_0x475c5a=_0x18a9b1;return db['Setting'][_0xc0bb('0x2c')]({'where':{'id':0x1},'attributes':[_0xc0bb('0x44'),_0xc0bb('0x45')],'raw':!![]});})[_0xc0bb('0x30')](function(_0x1b4278){if(!_0x475c5a||!_[_0xc0bb('0x46')](_0x475c5a['apiKeyNonce'],_0xbf63f5[_0xc0bb('0x47')])){return _0x924b33[_0xc0bb('0x31')](0x191)[_0xc0bb('0x33')]({'message':_0xc0bb('0x48')});}if(_0x475c5a['disabled']){return _0x924b33[_0xc0bb('0x31')](0x191)[_0xc0bb('0x33')]({'message':_0xc0bb('0x49')});}if(_0x475c5a[_0xc0bb('0x4a')]){if(_0x1b4278[_0xc0bb('0x45')]>0x0){if(moment(_0x475c5a['blockedAt'])[_0xc0bb('0x4b')](_0x1b4278[_0xc0bb('0x45')],_0xc0bb('0x4c'))>moment()){return _0x924b33[_0xc0bb('0x31')](0x191)['json']({'message':_0xc0bb('0x49')});}}else{return _0x924b33['status'](0x191)[_0xc0bb('0x33')]({'message':_0xc0bb('0x49')});}}_0x28da8e[_0xc0bb('0x2a')]={'id':_0x475c5a['id']};_0x35515a();});})['catch'](function(){return _0x924b33[_0xc0bb('0x31')](0x191)[_0xc0bb('0x33')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x23ca21){_0x35515a(_0x23ca21);}}else if(_0x4d4a76){_0x35515a();}else{return _0x924b33[_0xc0bb('0x31')](0x193)[_0xc0bb('0x33')]({'message':_0xc0bb('0x3f')});}})[_0xc0bb('0x29')](function(_0x44bc15,_0x54fb9f,_0x213fba){if(_0x44bc15[_0xc0bb('0x2a')]){db[_0xc0bb('0x42')][_0xc0bb('0x3b')]({'where':{'id':_0x44bc15[_0xc0bb('0x2a')]['id']},'attributes':userAttributes})[_0xc0bb('0x30')](function(_0x4e5a84){if(!_0x4e5a84){return _0x54fb9f[_0xc0bb('0x31')](0x194)[_0xc0bb('0x33')]({'message':_0xc0bb('0x4d')});}_0x44bc15[_0xc0bb('0x2a')]=_0x4e5a84;_0x213fba();})[_0xc0bb('0x36')](function(_0x589d89){_0x213fba(_0x589d89);});}else if(_0x4d4a76){_0x213fba();}else{return _0x54fb9f['status'](0x194)['json']({'message':_0xc0bb('0x4e')});}});};exports[_0xc0bb('0x4f')]=function canUpdate(){return compose()[_0xc0bb('0x29')](function(_0x14cb2c,_0x1a4fcd,_0x5bf3bc){return licenseUtil[_0xc0bb('0x50')]()[_0xc0bb('0x30')](function(_0x40365){if(_0x40365[_0xc0bb('0x51')]){_0x5bf3bc();}else{return _0x1a4fcd[_0xc0bb('0x31')](0x193)[_0xc0bb('0x33')]({'message':_0xc0bb('0x52')});}})[_0xc0bb('0x36')](function(_0x437ace){_0x5bf3bc(_0x437ace);});});};exports['isMiddleware']=function(_0x1bbb6e,_0x385d17,_0x44c061){_0x1bbb6e[_0xc0bb('0x53')]=!![];return _0x44c061();};exports[_0xc0bb('0x54')]=function signToken(_0x1e51c9){return signJwt(_0x1e51c9);};exports[_0xc0bb('0x55')]=function(_0x55b885,_0x3528ea){if(!_0x55b885[_0xc0bb('0x2a')]){return _0x3528ea['status'](0x194)[_0xc0bb('0x33')]({'message':_0xc0bb('0x56')});}var _0x3a1f8a={'payload':{'id':_0x55b885[_0xc0bb('0x2a')]['id'],'role':_0x55b885['user'][_0xc0bb('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3a1f8a)[_0xc0bb('0x30')](function(_0x2f2fdb){_0x3528ea['cookie'](_0xc0bb('0x57'),_0x2f2fdb);_0x3528ea[_0xc0bb('0x58')](_0xc0bb('0x59'));})['catch'](function(_0x267612){return _0x3528ea[_0xc0bb('0x31')](0x1f4)[_0xc0bb('0x5a')](_0x267612);});};exports['retrieveApiKey']=function(_0x974de3){if(_[_0xc0bb('0x5b')](_0x974de3['apiKeyNonce'])||_[_0xc0bb('0x5b')](_0x974de3[_0xc0bb('0x5c')])){return null;}else{return createJwt(_0x974de3);}};exports[_0xc0bb('0x5d')]=function(_0x3b08fd){_0x3b08fd[_0xc0bb('0x5e')]=generateNonce();_0x3b08fd[_0xc0bb('0x5c')]=generateIssuedAt();return createJwt(_0x3b08fd);};exports['regenerateApiKey']=function(_0x12657,_0x4f03f3){var _0x39f60e=_0x12657[_0xc0bb('0x40')]['apikey'];if(_0x39f60e){var _0xa421fc={'nonce':_0x4f03f3[_0xc0bb('0x5e')],'iat':_0x4f03f3[_0xc0bb('0x5c')],'audience':hardwareConf[_0xc0bb('0x41')](),'issuer':hardwareConf[_0xc0bb('0x41')]()};return verifyJwt(_0x39f60e,_0xa421fc)[_0xc0bb('0x30')](function(){return generateApiKey(_0x4f03f3);});}else{throw{'message':_0xc0bb('0x5f')};}};exports[_0xc0bb('0x60')]=function(_0x292b25){var _0x5caf77=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x5caf77[_0xc0bb('0x61')](_0x292b25))throw new db[(_0xc0bb('0x62'))][(_0xc0bb('0x63'))](_0xc0bb('0x64'));return;};exports['validatePasswordHistory']=function(_0x652afc,_0x56f0b0,_0x49e209){var _0x1973de=encryptor['decryptString'](_0x56f0b0)[_0xc0bb('0x65')](',');for(var _0x408cd9=0x0;_0x408cd9<_0x49e209;_0x408cd9++){if(!_0x1973de[_0x408cd9])break;if(_0x652afc[_0xc0bb('0x66')]()===_0x1973de[_0x408cd9][_0xc0bb('0x66')]()){var _0x2ad31f=util[_0xc0bb('0x67')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x49e209);if(_0x49e209===0x1){_0x2ad31f='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xc0bb('0x62'))]['ValidationError'](_0x2ad31f);}}return;};exports[_0xc0bb('0x68')]=function(_0xc08c26,_0x5b7cca){var _0x14a507=_0x5b7cca?encryptor[_0xc0bb('0x69')](_0x5b7cca)[_0xc0bb('0x65')](','):[];if(_0x14a507[_0xc0bb('0x6a')]===0x5){_0x14a507['splice'](-0x1,0x1);}_0x14a507[_0xc0bb('0x6b')](_0xc08c26);return encryptor[_0xc0bb('0x6c')](_0x14a507[_0xc0bb('0x6d')](','));};function signJwt(_0x4fb7e8){var _0x3218f4=BPromise[_0xc0bb('0x6e')](jwt[_0xc0bb('0x6f')],{'context':jwt});var _0x2cecac=_0x4fb7e8[_0xc0bb('0x70')]||config['secrets'][_0xc0bb('0xd')];return new BPromise(function(_0x37ee6e,_0xa19317){_0x3218f4(_0x4fb7e8[_0xc0bb('0x71')],_0x2cecac,_0x4fb7e8[_0xc0bb('0x72')])[_0xc0bb('0x30')](function(_0x109e56){_0x37ee6e(_0x109e56);})[_0xc0bb('0x36')](function(_0x2f8285){_0xa19317(_0x2f8285);});});}function verifyJwt(_0x5a30f6,_0x5310c7,_0x1af6e0){var _0x1e9679=BPromise[_0xc0bb('0x6e')](jwt[_0xc0bb('0x73')],{'context':jwt});var _0x5227ec=_0x1af6e0||config[_0xc0bb('0xc')]['session'];return new BPromise(function(_0x3f8822,_0x1ec373){_0x1e9679(_0x5a30f6,_0x5227ec,_0x5310c7)['then'](function(_0x369382){_0x3f8822(_0x369382);})[_0xc0bb('0x36')](function(_0xc6eb60){_0x1ec373(_0xc6eb60);});});}function generateNonce(){return crypto[_0xc0bb('0x74')](0x10)[_0xc0bb('0x75')](_0xc0bb('0x76'));}function generateIssuedAt(){return Math[_0xc0bb('0x77')](Date[_0xc0bb('0x78')]()/0x3e8)[_0xc0bb('0x75')]();}function createJwt(_0x2e8f58){var _0xed6dda={'payload':{'iat':_0x2e8f58[_0xc0bb('0x5c')],'nonce':_0x2e8f58[_0xc0bb('0x5e')]},'options':{'algorithm':_0xc0bb('0x79'),'subject':_0x2e8f58['id'][_0xc0bb('0x75')](),'issuer':hardwareConf[_0xc0bb('0x41')](),'audience':hardwareConf[_0xc0bb('0x41')]()}};return signJwt(_0xed6dda)['then'](function(_0x4b2e97){return{'iat':_0x2e8f58[_0xc0bb('0x5c')],'nonce':_0x2e8f58[_0xc0bb('0x5e')],'token':_0x4b2e97};});}
\ No newline at end of file
index d19b64f..bf31fd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe79a=['secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','hasOwnProperty','createReadStream','createWriteStream','createCipher','write','final','binary','end','close','decryptFile','createDecipher','update','encryptString','secret','utf8','base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe79a,0xd4));var _0xae79=function(_0x147078,_0x4e509c){_0x147078=_0x147078-0x0;var _0x2d2f5c=_0xe79a[_0x147078];return _0x2d2f5c;};'use strict';var crypto=require(_0xae79('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xae79('0x1'));var config=require(_0xae79('0x2'));var logger=require(_0xae79('0x3'))(_0xae79('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xae79('0x5')][_0xae79('0x6')],'algorithm':_0xae79('0x7')};const fileOptions={'algorithm':_0xae79('0x8')};if(config[_0xae79('0x9')]&&config[_0xae79('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xae79('0x9')][_0xae79('0xa')]);if(isSupported){fileOptions[_0xae79('0xa')]=config[_0xae79('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xae79('0xb')](',\x20');logger['error'](config['encrypt'][_0xae79('0xa')],_0xae79('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x4c3ec9){return AES_SUPPORTED_RX['test'](_0x4c3ec9);}function getSupportedCiphers(){return crypto[_0xae79('0xd')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x48d718){return getSupportedCiphers()['indexOf'](_0x48d718)>-0x1;}function combineOptions(_0x2adfe0){var _0x2485b6={};for(var _0x1aba0b in fileOptions){if(fileOptions[_0xae79('0xe')](_0x1aba0b)){_0x2485b6[_0x1aba0b]=fileOptions[_0x1aba0b];}}if(_0x2adfe0){for(var _0x14b6c3 in _0x2adfe0){if(_0x2adfe0[_0xae79('0xe')](_0x14b6c3)){_0x2485b6[_0x14b6c3]=_0x2adfe0[_0x14b6c3];}}}return _0x2485b6;}exports['encryptFile']=function(_0x3d6b21,_0x12b3a7,_0x23dc65,_0x146514){return new BPromise(function(_0x3c2495,_0x15d159){_0x146514=combineOptions(_0x146514);var _0x10ac68=new Buffer(_0x23dc65);var _0x448dff=fs[_0xae79('0xf')](_0x3d6b21);var _0x440565=fs[_0xae79('0x10')](_0x12b3a7);var _0x4d7a60=crypto[_0xae79('0x11')](_0x146514[_0xae79('0xa')],_0x10ac68);_0x448dff['on']('data',function(_0x3f0fc9){var _0x19dcdf=new Buffer(_0x4d7a60['update'](_0x3f0fc9),'binary');_0x440565[_0xae79('0x12')](_0x19dcdf);});_0x448dff['on']('end',function(){try{var _0x1ac52d=new Buffer(_0x4d7a60[_0xae79('0x13')](_0xae79('0x14')),_0xae79('0x14'));_0x440565['write'](_0x1ac52d);_0x440565[_0xae79('0x15')]();_0x440565['on'](_0xae79('0x16'),function(){return _0x3c2495(_0x12b3a7);});}catch(_0x5a0610){fs['unlink'](_0x12b3a7);return _0x15d159(_0x5a0610);}});});};exports[_0xae79('0x17')]=function(_0x4e59eb,_0x50310e,_0x466f8b,_0x48c99f){return new BPromise(function(_0x249b7f,_0x7ba546){_0x48c99f=combineOptions(_0x48c99f);var _0x59618a=new Buffer(_0x466f8b);var _0x370a84=fs['createReadStream'](_0x4e59eb);var _0x5df27b=fs[_0xae79('0x10')](_0x50310e);var _0x15fb45=crypto[_0xae79('0x18')](_0x48c99f['algorithm'],_0x59618a);_0x370a84['on']('data',function(_0x2f4a36){var _0x7972d5=new Buffer(_0x15fb45[_0xae79('0x19')](_0x2f4a36),'binary');_0x5df27b[_0xae79('0x12')](_0x7972d5);});_0x370a84['on'](_0xae79('0x15'),function(){try{var _0x31a0b2=new Buffer(_0x15fb45['final'](_0xae79('0x14')),_0xae79('0x14'));_0x5df27b['write'](_0x31a0b2);_0x5df27b[_0xae79('0x15')]();_0x5df27b['on']('close',function(){return _0x249b7f(_0x50310e);});}catch(_0x1466de){fs['unlink'](_0x50310e);return _0x7ba546(_0x1466de);}});});};exports[_0xae79('0x1a')]=function(_0x4e7e2a,_0x5b7123,_0x115293){var _0x5ba7cc=_0x115293||stringOptions[_0xae79('0xa')];var _0x2073a9=_0x5b7123||stringOptions[_0xae79('0x1b')];var _0x378ba8=crypto[_0xae79('0x11')](_0x5ba7cc,_0x2073a9);var _0x5378d9=_0x378ba8[_0xae79('0x19')](_0x4e7e2a,_0xae79('0x1c'),_0xae79('0x1d'));_0x5378d9+=_0x378ba8['final'](_0xae79('0x1d'));return _0x5378d9;};exports[_0xae79('0x1e')]=function(_0x347440,_0x2871c4,_0x3a9082){var _0x1c73f9=_0x3a9082||stringOptions[_0xae79('0xa')];var _0x3a81db=_0x2871c4||stringOptions[_0xae79('0x1b')];var _0x24d102=crypto['createDecipher'](_0x1c73f9,_0x3a81db);var _0x203304=_0x24d102[_0xae79('0x19')](_0x347440,_0xae79('0x1d'),'utf8');_0x203304+=_0x24d102[_0xae79('0x13')]('utf8');return _0x203304;};
\ No newline at end of file
+var _0x1bc3=['algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','binary','write','end','final','close','decryptFile','unlink','createCipher','base64','decryptString','createDecipher','update','utf8','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1bc3,0xe4));var _0x31bc=function(_0x371c8a,_0xe8ca1d){_0x371c8a=_0x371c8a-0x0;var _0xef613c=_0x1bc3[_0x371c8a];return _0xef613c;};'use strict';var crypto=require(_0x31bc('0x0'));var fs=require('fs');var BPromise=require(_0x31bc('0x1'));var _=require('lodash');var config=require(_0x31bc('0x2'));var logger=require(_0x31bc('0x3'))(_0x31bc('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x31bc('0x5')][_0x31bc('0x6')],'algorithm':_0x31bc('0x7')};const fileOptions={'algorithm':_0x31bc('0x8')};if(config['encrypt']&&config['encrypt']['algorithm']){var isSupported=isAlgorithmSupported(config[_0x31bc('0x9')][_0x31bc('0xa')]);if(isSupported){fileOptions[_0x31bc('0xa')]=config['encrypt'][_0x31bc('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x31bc('0xb')](config[_0x31bc('0x9')][_0x31bc('0xa')],_0x31bc('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x4a9b27){return AES_SUPPORTED_RX[_0x31bc('0xd')](_0x4a9b27);}function getSupportedCiphers(){return crypto[_0x31bc('0xe')]()[_0x31bc('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x3b59c6){return getSupportedCiphers()['indexOf'](_0x3b59c6)>-0x1;}function combineOptions(_0x1e0fde){var _0x3e7cf6={};for(var _0x2c068b in fileOptions){if(fileOptions[_0x31bc('0x10')](_0x2c068b)){_0x3e7cf6[_0x2c068b]=fileOptions[_0x2c068b];}}if(_0x1e0fde){for(var _0x4abb84 in _0x1e0fde){if(_0x1e0fde[_0x31bc('0x10')](_0x4abb84)){_0x3e7cf6[_0x4abb84]=_0x1e0fde[_0x4abb84];}}}return _0x3e7cf6;}exports[_0x31bc('0x11')]=function(_0x59b93d,_0x588d46,_0x341587,_0xbfdb1c){return new BPromise(function(_0x4a96d9,_0x3c08d8){_0xbfdb1c=combineOptions(_0xbfdb1c);var _0x18390a=new Buffer(_0x341587);var _0x31513b=fs[_0x31bc('0x12')](_0x59b93d);var _0x1742f3=fs[_0x31bc('0x13')](_0x588d46);var _0x3e8a30=crypto['createCipher'](_0xbfdb1c[_0x31bc('0xa')],_0x18390a);_0x31513b['on'](_0x31bc('0x14'),function(_0x1b3389){var _0x1dd4ee=new Buffer(_0x3e8a30['update'](_0x1b3389),_0x31bc('0x15'));_0x1742f3[_0x31bc('0x16')](_0x1dd4ee);});_0x31513b['on'](_0x31bc('0x17'),function(){try{var _0x44045c=new Buffer(_0x3e8a30[_0x31bc('0x18')](_0x31bc('0x15')),'binary');_0x1742f3[_0x31bc('0x16')](_0x44045c);_0x1742f3[_0x31bc('0x17')]();_0x1742f3['on'](_0x31bc('0x19'),function(){return _0x4a96d9(_0x588d46);});}catch(_0x44407d){fs['unlink'](_0x588d46);return _0x3c08d8(_0x44407d);}});});};exports[_0x31bc('0x1a')]=function(_0x291887,_0xf4dc19,_0x285c4d,_0xe74a5d){return new BPromise(function(_0x5f4aca,_0x59affc){_0xe74a5d=combineOptions(_0xe74a5d);var _0x1b32b7=new Buffer(_0x285c4d);var _0x21c4be=fs['createReadStream'](_0x291887);var _0xb8053a=fs[_0x31bc('0x13')](_0xf4dc19);var _0x1ef90b=crypto['createDecipher'](_0xe74a5d[_0x31bc('0xa')],_0x1b32b7);_0x21c4be['on'](_0x31bc('0x14'),function(_0x28b41f){var _0x38be40=new Buffer(_0x1ef90b['update'](_0x28b41f),'binary');_0xb8053a[_0x31bc('0x16')](_0x38be40);});_0x21c4be['on'](_0x31bc('0x17'),function(){try{var _0x392a6b=new Buffer(_0x1ef90b[_0x31bc('0x18')](_0x31bc('0x15')),_0x31bc('0x15'));_0xb8053a[_0x31bc('0x16')](_0x392a6b);_0xb8053a[_0x31bc('0x17')]();_0xb8053a['on']('close',function(){return _0x5f4aca(_0xf4dc19);});}catch(_0x5b4dbd){fs[_0x31bc('0x1b')](_0xf4dc19);return _0x59affc(_0x5b4dbd);}});});};exports['encryptString']=function(_0x38776f,_0x59b23e,_0x3753d8){var _0x14e672=_0x3753d8||stringOptions['algorithm'];var _0x9c0538=_0x59b23e||stringOptions['secret'];var _0x3ac363=crypto[_0x31bc('0x1c')](_0x14e672,_0x9c0538);var _0x113493=_0x3ac363['update'](_0x38776f,'utf8',_0x31bc('0x1d'));_0x113493+=_0x3ac363[_0x31bc('0x18')](_0x31bc('0x1d'));return _0x113493;};exports[_0x31bc('0x1e')]=function(_0x2fe8df,_0x4cb792,_0x5b4942){var _0x244646=_0x5b4942||stringOptions['algorithm'];var _0x5a17ad=_0x4cb792||stringOptions['secret'];var _0x3b97a1=crypto[_0x31bc('0x1f')](_0x244646,_0x5a17ad);var _0x4a02d1=_0x3b97a1[_0x31bc('0x20')](_0x2fe8df,_0x31bc('0x1d'),_0x31bc('0x21'));_0x4a02d1+=_0x3b97a1[_0x31bc('0x18')](_0x31bc('0x21'));return _0x4a02d1;};
\ No newline at end of file
index d6208e3..2841bce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb1=['savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','join','mkdirSync','each','%s.%s','csv','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eb1,0x7c));var _0x15eb=function(_0x181dfe,_0xf84557){_0x181dfe=_0x181dfe-0x0;var _0x40c38f=_0x5eb1[_0x181dfe];return _0x40c38f;};'use strict';var util=require('util');var path=require(_0x15eb('0x0'));var _=require(_0x15eb('0x1'));var csv=require(_0x15eb('0x2'));var fs=require('fs');var BPromise=require(_0x15eb('0x3'));var zipdir=require(_0x15eb('0x4'));var rimraf=require(_0x15eb('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x15eb('0x6'))[_0x15eb('0x7')];var logger=require(_0x15eb('0x8'))(_0x15eb('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x15eb('0xa')][0x3];var PATH=process[_0x15eb('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x594f54,_0xe4d8ce){var _0x160879={'status':_0x594f54};var _0x730b12={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe4d8ce){_0x160879[_0x15eb('0xb')]=_0xe4d8ce;}return db[_0x15eb('0xc')][_0x15eb('0xd')](_0x160879,_0x730b12);}function main(){var _0x412db6=0x1388;var _0x1481ae;logger[_0x15eb('0xe')](util[_0x15eb('0xf')](_0x15eb('0x10'),EXTRACTED_REPORT_ID,_0x15eb('0x11')));return db[_0x15eb('0x12')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x15eb('0x13'),'splitSizeCsv']})['then'](function(_0x498a0c){if(_0x498a0c){_0x1481ae=_0x498a0c;_0x412db6=_0x1481ae[_0x15eb('0x14')]||0x1388;}})[_0x15eb('0x15')](function(){return dbH[_0x15eb('0x16')][_0x15eb('0x17')](util['format'](_0x15eb('0x18'),QUERY),{'type':dbH[_0x15eb('0x16')][_0x15eb('0x19')][_0x15eb('0x1a')]});})['then'](function(_0x48aed7){if(!_0x48aed7[0x0]['num']){return analyticExtractedReport('Empty');}var _0x1188e0=[];var _0x52223c=0x0;var _0x53efa1=!![];if(_0x48aed7&&_0x48aed7[_0x15eb('0x1b')]){var _0x5b9a6b=_0x48aed7[0x0][_0x15eb('0x1c')]%(_0x52223c+_0x412db6);if(_0x1481ae['split']){for(;_0x53efa1;_0x52223c+=_0x412db6,_0x5b9a6b=_0x48aed7[0x0][_0x15eb('0x1c')]%(_0x52223c+_0x412db6)){if(_0x5b9a6b==0x0||_0x5b9a6b==_0x48aed7[0x0]['num']){_0x53efa1=![];}_0x1188e0[_0x15eb('0x1d')](dbH[_0x15eb('0x16')]['query'](util[_0x15eb('0xf')](_0x15eb('0x1e'),QUERY,_0x412db6,_0x52223c),{'type':dbH['sequelize'][_0x15eb('0x19')][_0x15eb('0x1a')]}));}}else{_0x1188e0[_0x15eb('0x1d')](dbH[_0x15eb('0x16')][_0x15eb('0x17')](QUERY,{'type':dbH[_0x15eb('0x16')]['QueryTypes'][_0x15eb('0x1a')]}));}}var _0x4e4d75=path[_0x15eb('0x1f')](PATH);var _0x49915b=path[_0x15eb('0x20')](PATH,'.csv');var _0x27449b=_0x1481ae[_0x15eb('0x13')]&&_0x1188e0[_0x15eb('0x1b')]>0x1;var _0x9b0a52=[];if(!fs[_0x15eb('0x21')](path[_0x15eb('0x22')](_0x4e4d75,_0x49915b))&&_0x27449b){fs[_0x15eb('0x23')](path[_0x15eb('0x22')](_0x4e4d75,_0x49915b));}return BPromise[_0x15eb('0x24')](_0x1188e0,function(_0x17c2ef){_0x9b0a52['push'](_0x17c2ef);})[_0x15eb('0x15')](function(){for(var _0x419cf8=0x0;_0x419cf8<_0x9b0a52[_0x15eb('0x1b')];_0x419cf8+=0x1){var _0x3f655b;var _0x1fcb1a=_0x9b0a52[_0x419cf8];if(_0x27449b){_0x3f655b=path[_0x15eb('0x22')](_0x4e4d75,_0x49915b,util[_0x15eb('0xf')]('%s%d.%s',_0x49915b,_0x419cf8,'csv'));}else{_0x3f655b=path[_0x15eb('0x22')](_0x4e4d75,util[_0x15eb('0xf')](_0x15eb('0x25'),_0x49915b,_0x15eb('0x26')));}fs['writeFileSync'](_0x3f655b,csv(_0x1fcb1a));}})[_0x15eb('0x15')](function(){if(_0x27449b){zipdir(path['join'](_0x4e4d75,_0x49915b),{'saveTo':path[_0x15eb('0x22')](_0x4e4d75,util['format'](_0x15eb('0x25'),_0x49915b,_0x15eb('0x27')))},function(_0x413861,_0x153d86){});rimraf(path[_0x15eb('0x22')](_0x4e4d75,_0x49915b),function(){});}})[_0x15eb('0x15')](function(){logger['info'](util[_0x15eb('0xf')](_0x15eb('0x28'),EXTRACTED_REPORT_ID,_0x15eb('0x11')));return analyticExtractedReport('Completed',_0x27449b?util['format'](_0x15eb('0x25'),_0x49915b,_0x27449b?_0x15eb('0x27'):'csv'):null);});})['catch'](function(_0x4fdcfb){logger[_0x15eb('0xe')](util['format'](_0x15eb('0x29'),EXTRACTED_REPORT_ID,_0x15eb('0x11')),util['inspect'](_0x4fdcfb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x15eb('0x2a'));})[_0x15eb('0x2b')](function(){process[_0x15eb('0x2c')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xf4eb=['%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','basename','existsSync','join','mkdirSync','then','%s%d.%s','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Setting','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xf4eb,0xec));var _0xbf4e=function(_0x54ec54,_0x239b19){_0x54ec54=_0x54ec54-0x0;var _0x577804=_0xf4eb[_0x54ec54];return _0x577804;};'use strict';var util=require(_0xbf4e('0x0'));var path=require('path');var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbf4e('0x1'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xbf4e('0x2'))[_0xbf4e('0x3')];var logger=require(_0xbf4e('0x4'))(_0xbf4e('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0xbf4e('0x6')][0x2]);var QUERY=process[_0xbf4e('0x6')][0x3];var PATH=process[_0xbf4e('0x6')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x540736,_0x449d55){var _0x5013c2={'status':_0x540736};var _0x5e23d4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x449d55){_0x5013c2[_0xbf4e('0x7')]=_0x449d55;}return db[_0xbf4e('0x8')][_0xbf4e('0x9')](_0x5013c2,_0x5e23d4);}function main(){var _0xc86f04=0x1388;var _0x5da823;logger[_0xbf4e('0xa')](util[_0xbf4e('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xbf4e('0xc')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbf4e('0xd'),_0xbf4e('0xe')]})['then'](function(_0x17fd01){if(_0x17fd01){_0x5da823=_0x17fd01;_0xc86f04=_0x5da823['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0xbf4e('0xf')][_0xbf4e('0x10')](util[_0xbf4e('0xb')](_0xbf4e('0x11'),QUERY),{'type':dbH[_0xbf4e('0xf')][_0xbf4e('0x12')]['SELECT']});})['then'](function(_0x180432){if(!_0x180432[0x0][_0xbf4e('0x13')]){return analyticExtractedReport(_0xbf4e('0x14'));}var _0x542909=[];var _0x14110b=0x0;var _0x2c292c=!![];if(_0x180432&&_0x180432[_0xbf4e('0x15')]){var _0x320e7d=_0x180432[0x0]['num']%(_0x14110b+_0xc86f04);if(_0x5da823[_0xbf4e('0xd')]){for(;_0x2c292c;_0x14110b+=_0xc86f04,_0x320e7d=_0x180432[0x0]['num']%(_0x14110b+_0xc86f04)){if(_0x320e7d==0x0||_0x320e7d==_0x180432[0x0]['num']){_0x2c292c=![];}_0x542909['push'](dbH['sequelize'][_0xbf4e('0x10')](util[_0xbf4e('0xb')](_0xbf4e('0x16'),QUERY,_0xc86f04,_0x14110b),{'type':dbH['sequelize']['QueryTypes'][_0xbf4e('0x17')]}));}}else{_0x542909[_0xbf4e('0x18')](dbH[_0xbf4e('0xf')][_0xbf4e('0x10')](QUERY,{'type':dbH[_0xbf4e('0xf')][_0xbf4e('0x12')][_0xbf4e('0x17')]}));}}var _0x3d642a=path[_0xbf4e('0x19')](PATH);var _0x376832=path[_0xbf4e('0x1a')](PATH,'.csv');var _0x1ff2ec=_0x5da823[_0xbf4e('0xd')]&&_0x542909['length']>0x1;var _0x31e3f5=[];if(!fs[_0xbf4e('0x1b')](path[_0xbf4e('0x1c')](_0x3d642a,_0x376832))&&_0x1ff2ec){fs[_0xbf4e('0x1d')](path[_0xbf4e('0x1c')](_0x3d642a,_0x376832));}return BPromise['each'](_0x542909,function(_0x90635e){_0x31e3f5[_0xbf4e('0x18')](_0x90635e);})[_0xbf4e('0x1e')](function(){for(var _0x5766d4=0x0;_0x5766d4<_0x31e3f5[_0xbf4e('0x15')];_0x5766d4+=0x1){var _0x5e08b1;var _0x5bcf71=_0x31e3f5[_0x5766d4];if(_0x1ff2ec){_0x5e08b1=path[_0xbf4e('0x1c')](_0x3d642a,_0x376832,util['format'](_0xbf4e('0x1f'),_0x376832,_0x5766d4,_0xbf4e('0x20')));}else{_0x5e08b1=path[_0xbf4e('0x1c')](_0x3d642a,util[_0xbf4e('0xb')]('%s.%s',_0x376832,_0xbf4e('0x20')));}fs[_0xbf4e('0x21')](_0x5e08b1,csv(_0x5bcf71));}})[_0xbf4e('0x1e')](function(){if(_0x1ff2ec){zipdir(path['join'](_0x3d642a,_0x376832),{'saveTo':path[_0xbf4e('0x1c')](_0x3d642a,util['format'](_0xbf4e('0x22'),_0x376832,_0xbf4e('0x23')))},function(_0xb8b58e,_0x498dbd){});rimraf(path[_0xbf4e('0x1c')](_0x3d642a,_0x376832),function(){});}})[_0xbf4e('0x1e')](function(){logger[_0xbf4e('0xa')](util[_0xbf4e('0xb')](_0xbf4e('0x24'),EXTRACTED_REPORT_ID,_0xbf4e('0x25')));return analyticExtractedReport('Completed',_0x1ff2ec?util[_0xbf4e('0xb')](_0xbf4e('0x22'),_0x376832,_0x1ff2ec?'zip':_0xbf4e('0x20')):null);});})[_0xbf4e('0x26')](function(_0x5473ed){logger[_0xbf4e('0xa')](util['format'](_0xbf4e('0x27'),EXTRACTED_REPORT_ID,'CSV'),util[_0xbf4e('0x28')](_0x5473ed,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbf4e('0x29'));})[_0xbf4e('0x2a')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 1cb3fed..bf5b7a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93c0=['push','body','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','dirname','.pdf','%s.%s','pdf','Setting','find','split','splitSizePdf','then','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','all','flatten','createPdfKitDocument','%s%d.%s','zip','info','CSV','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','toString','center','Interaction\x20Transcript','pipe','createWriteStream','finish','end','createPdfFromHTML','catch','lodash','util','path','moment','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','value','fill','length','auto'];(function(_0xfceb75,_0x597684){var _0x4890dd=function(_0x118763){while(--_0x118763){_0xfceb75['push'](_0xfceb75['shift']());}};_0x4890dd(++_0x597684);}(_0x93c0,0x1b6));var _0x093c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x93c0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x093c('0x0'));var fs=require('fs');var util=require(_0x093c('0x1'));var path=require(_0x093c('0x2'));var moment=require(_0x093c('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x093c('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x093c('0x5'));var JSDOM=require(_0x093c('0x6'))[_0x093c('0x7')];var window=new JSDOM('')[_0x093c('0x8')];var db=require(_0x093c('0x9'))['db'];var dbH=require('../../mysqldb')[_0x093c('0xa')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x093c('0xb')][0x4];var NAME=process[_0x093c('0xb')][0x5];var FORMAT=_0x093c('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x825469,_0x326351){var _0x5728eb={'status':_0x825469};var _0x782122={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x326351){_0x5728eb[_0x093c('0xd')]=_0x326351;}return db[_0x093c('0xe')][_0x093c('0xf')](_0x5728eb,_0x782122);}function getHeaders(_0x4c98e3){return _[_0x093c('0x10')](_0x4c98e3,function(_0x41ad71){return{'text':_0x41ad71,'style':_0x093c('0x11')};});}function getRows(_0x5e9380,_0x32a1f7){return _[_0x093c('0x10')](_0x32a1f7,function(_0x320c58){return _(_0x320c58)['pick'](_0x5e9380)['map'](function(_0x1e8152){return _0x1e8152?_['toString'](_0x1e8152):'';})[_0x093c('0x12')]();});}function createTable(_0x38998b,_0x3d94e5){var _0x1297c1={'widths':_[_0x093c('0x13')](Array(_0x38998b[_0x093c('0x14')]),0x91),'heights':function(_0x374ab0){return _0x374ab0===0x0?_0x093c('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3e3c30=getHeaders(_0x38998b);_0x1297c1['body'][_0x093c('0x16')](_0x3e3c30);var _0x17379b=getRows(_0x38998b,_0x3d94e5);_0x1297c1[_0x093c('0x17')]=_0x1297c1[_0x093c('0x17')][_0x093c('0x18')](_0x17379b);return _0x1297c1;}function createTables(_0x2505a2){var _0x598342=[];var _0x34b1fe=_['chunk'](Object[_0x093c('0x19')](_0x2505a2[0x0]),0x5);_0x34b1fe[_0x093c('0x1a')](function(_0x5e638e){_0x598342[_0x093c('0x16')](createTable(_0x5e638e,_0x2505a2));});return _0x598342;}function getPDFDocDefinition(_0x376f15){var _0x3c33c0=util[_0x093c('0x1b')](_0x093c('0x1c'),NAME,EXTRACTED_REPORT[_0x093c('0x1d')],moment(EXTRACTED_REPORT[_0x093c('0x1e')])[_0x093c('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x093c('0x1f')])[_0x093c('0x1b')](FORMAT));var _0x11a676=[];for(var _0x2100f8=0x0;_0x2100f8<_0x376f15['length'];_0x2100f8++){var _0x3d5c10=[];if(_0x2100f8===0x0){_0x3d5c10[_0x093c('0x16')]({'text':_0x3c33c0,'style':_0x093c('0x20')});}var _0x5873f3={'table':_0x376f15[_0x2100f8]};if(_0x2100f8>0x0){_0x5873f3[_0x093c('0x21')]=_0x093c('0x22');_0x5873f3[_0x093c('0x23')]=[0x0,0x46,0x0,0x0];}_0x3d5c10[_0x093c('0x16')](_0x5873f3);_0x11a676[_0x093c('0x16')](_0x3d5c10);}return{'pageSize':'A4','pageOrientation':_0x093c('0x24'),'content':_0x11a676,'footer':function(_0x1ba984,_0x106ccd){return{'text':_0x1ba984['toString']()+_0x093c('0x25')+_0x106ccd,'style':_0x093c('0x26')};},'defaultStyle':{'font':_0x093c('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x093c('0x28')},'footer':{'alignment':_0x093c('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x196f3c){var _0x140703=0x1388;var _0x37176a;if(!_0x196f3c[0x0][_0x093c('0x2a')]){return analyticExtractedReport(_0x093c('0x2b'));}var _0x28fb41=[];var _0x17d877=0x0;var _0x299559=!![];var _0x49b2e3=path[_0x093c('0x2c')](PATH);var _0x307a29=path['basename'](PATH,_0x093c('0x2d'));var _0x9c2046=path['join'](_0x49b2e3,util[_0x093c('0x1b')](_0x093c('0x2e'),_0x307a29,_0x093c('0x2f')));var _0x25db75=![];return db[_0x093c('0x30')][_0x093c('0x31')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x093c('0x32'),_0x093c('0x33')]})[_0x093c('0x34')](function(_0x3a37ce){if(_0x3a37ce){_0x37176a=_0x3a37ce;_0x140703=_0x37176a[_0x093c('0x33')]||0x3e8;}})[_0x093c('0x34')](function(){if(_0x196f3c&&_0x196f3c['length']){var _0xa61cea=_0x196f3c[0x0][_0x093c('0x2a')]%(_0x17d877+_0x140703);if(_0x37176a['split']){for(;_0x299559;_0x17d877+=_0x140703,_0xa61cea=_0x196f3c[0x0][_0x093c('0x2a')]%(_0x17d877+_0x140703)){if(_0xa61cea==0x0||_0xa61cea==_0x196f3c[0x0][_0x093c('0x2a')]){_0x299559=![];}_0x28fb41[_0x093c('0x16')](dbH[_0x093c('0x35')][_0x093c('0x36')](util[_0x093c('0x1b')](_0x093c('0x37'),QUERY,_0x140703,_0x17d877),{'type':dbH[_0x093c('0x35')][_0x093c('0x38')][_0x093c('0x39')]}));}}else{_0x28fb41['push'](dbH[_0x093c('0x35')][_0x093c('0x36')](QUERY,{'type':dbH[_0x093c('0x35')][_0x093c('0x38')][_0x093c('0x39')]}));}}_0x25db75=_0x37176a[_0x093c('0x32')]&&_0x28fb41[_0x093c('0x14')]>0x1;if(!fs[_0x093c('0x3a')](path['join'](_0x49b2e3,_0x307a29))&&_0x25db75){fs['mkdirSync'](path[_0x093c('0x3b')](_0x49b2e3,_0x307a29));}return Promise[_0x093c('0x3c')](_0x28fb41);})[_0x093c('0x34')](function(_0x2817d5){return createTables(_[_0x093c('0x3d')](_0x2817d5));})[_0x093c('0x34')](function(_0x46a695){var _0x5e032d=getPDFDocDefinition(_0x46a695);var _0x295c59=getPDFPrinter();var _0x1a40a2=_0x295c59[_0x093c('0x3e')](_0x5e032d);if(_0x25db75)_0x9c2046=path[_0x093c('0x3b')](_0x49b2e3,_0x307a29,util['format'](_0x093c('0x3f'),_0x307a29,index,'pdf'));return writePDFDocument(_0x1a40a2,_0x9c2046);})[_0x093c('0x34')](function(){if(!_0x25db75)return;zipdir(path[_0x093c('0x3b')](_0x49b2e3,_0x307a29),{'saveTo':path['join'](_0x49b2e3,util[_0x093c('0x1b')](_0x093c('0x2e'),_0x307a29,_0x093c('0x40')))},function(_0x6157c8){if(_0x6157c8)throw _0x6157c8;return;});})[_0x093c('0x34')](function(){if(!_0x25db75)return;rimraf(path[_0x093c('0x3b')](_0x49b2e3,_0x307a29),function(){});})[_0x093c('0x34')](function(){logger[_0x093c('0x41')](util[_0x093c('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x093c('0x42')));return analyticExtractedReport(_0x093c('0x43'),_0x25db75?util[_0x093c('0x1b')](_0x093c('0x2e'),_0x307a29,_0x25db75?_0x093c('0x40'):_0x093c('0x2f')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x093c('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x093c('0xe')][_0x093c('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1a6b67){EXTRACTED_REPORT=_0x1a6b67;return dbH[_0x093c('0x35')][_0x093c('0x36')](util['format'](_0x093c('0x45'),QUERY),{'type':dbH[_0x093c('0x35')][_0x093c('0x38')]['SELECT']});})[_0x093c('0x34')](extractReport)['catch'](function(_0x2f1d59){logger[_0x093c('0x41')](util['format'](_0x093c('0x46'),EXTRACTED_REPORT_ID,_0x093c('0x47')),util[_0x093c('0x48')](_0x2f1d59,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x093c('0x49'));})[_0x093c('0x4a')](function(){process[_0x093c('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x34bed0=new PdfPrinter({'Arial':{'normal':__dirname+_0x093c('0x4c'),'bold':__dirname+_0x093c('0x4d'),'italics':__dirname+_0x093c('0x4e'),'bolditalics':__dirname+_0x093c('0x4f')}});return _0x34bed0;}function getPDFDocDefinitionFromHTML(_0x8b61b4,_0x2c0011){var _0x2d8dba=util['format'](_0x093c('0x50'),_0x2c0011[_0x093c('0x51')],_0x2c0011['interactionId']);var _0x1c9b73=moment()[_0x093c('0x1b')](_0x093c('0x52'))[_0x093c('0x53')]();var _0x35a8d1=htmlToPdfmake(_0x8b61b4,{'window':window,'tableAutoSize':!![]});return{'content':[_0x35a8d1],'defaultStyle':{'font':_0x093c('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x093c('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x093c('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x093c('0x54')}},'header':function(){return[{'text':_0x093c('0x55'),'style':_0x093c('0x20')}];},'footer':function(_0xace0a7,_0x95c8dc){return[{'text':util[_0x093c('0x1b')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2d8dba,_0xace0a7,_0x95c8dc,_0x1c9b73),'style':_0x093c('0x26')}];}};}function writePDFDocument(_0x1fb30e,_0x23b7c8){return new Promise(function(_0x19b318,_0x58b14b){var _0x6ed0b2=_0x1fb30e[_0x093c('0x56')](fs[_0x093c('0x57')](_0x23b7c8));_0x6ed0b2['on'](_0x093c('0x58'),function(){_0x19b318(_0x093c('0x58'));});_0x6ed0b2['on']('error',function(_0x48085a){_0x58b14b(_0x48085a);});_0x1fb30e[_0x093c('0x59')]();});}exports[_0x093c('0x5a')]=function(_0xa89d5,_0x5d9348){var _0x126e55=getPDFPrinter();var _0x12502a=getPDFDocDefinitionFromHTML(_0xa89d5,_0x5d9348);var _0x4cd0c7=_0x126e55[_0x093c('0x3e')](_0x12502a);return writePDFDocument(_0x4cd0c7,_0x5d9348[_0x093c('0x2')])[_0x093c('0x5b')](function(_0x15a258){throw _0x15a258;});};
\ No newline at end of file
+var _0xfa90=['QueryTypes','SELECT','mkdirSync','all','flatten','createPdfKitDocument','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','interactionId','YYYY-MM-DD','center','header','footer','pipe','createWriteStream','finish','error','catch','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','toString','fill','length','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','pageBreak','margin','landscape','Arial','black','right','num','dirname','basename','.pdf','join','%s.%s','pdf','find','then','splitSizePdf','split','sequelize','query'];(function(_0x1c9c24,_0x2a517b){var _0x349c69=function(_0x259ff7){while(--_0x259ff7){_0x1c9c24['push'](_0x1c9c24['shift']());}};_0x349c69(++_0x2a517b);}(_0xfa90,0x198));var _0x0fa9=function(_0x36486c,_0x4b6c51){_0x36486c=_0x36486c-0x0;var _0x3d84e1=_0xfa90[_0x36486c];return _0x3d84e1;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x0fa9('0x0'));var path=require(_0x0fa9('0x1'));var moment=require(_0x0fa9('0x2'));var htmlToPdfmake=require(_0x0fa9('0x3'));var PdfPrinter=require(_0x0fa9('0x4'));var zipdir=require(_0x0fa9('0x5'));var rimraf=require(_0x0fa9('0x6'));var JSDOM=require(_0x0fa9('0x7'))['JSDOM'];var window=new JSDOM('')[_0x0fa9('0x8')];var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x0fa9('0x9')];var logger=require('../../config/logger')(_0x0fa9('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x0fa9('0xb')][0x2]);var QUERY=process[_0x0fa9('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0fa9('0xb')][0x5];var FORMAT=_0x0fa9('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x58d6bc,_0x5a145d){var _0x59f24f={'status':_0x58d6bc};var _0x5a83fa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a145d){_0x59f24f[_0x0fa9('0xd')]=_0x5a145d;}return db[_0x0fa9('0xe')][_0x0fa9('0xf')](_0x59f24f,_0x5a83fa);}function getHeaders(_0xd3a99a){return _[_0x0fa9('0x10')](_0xd3a99a,function(_0x16aa9c){return{'text':_0x16aa9c,'style':'tableHeader'};});}function getRows(_0x49f9a3,_0x4dd6cc){return _[_0x0fa9('0x10')](_0x4dd6cc,function(_0x413040){return _(_0x413040)['pick'](_0x49f9a3)[_0x0fa9('0x10')](function(_0x351a53){return _0x351a53?_[_0x0fa9('0x11')](_0x351a53):'';})['value']();});}function createTable(_0x139254,_0xbe66e7){var _0x5c9df6={'widths':_[_0x0fa9('0x12')](Array(_0x139254[_0x0fa9('0x13')]),0x91),'heights':function(_0x59a828){return _0x59a828===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xc0cb8d=getHeaders(_0x139254);_0x5c9df6[_0x0fa9('0x14')][_0x0fa9('0x15')](_0xc0cb8d);var _0x5df85e=getRows(_0x139254,_0xbe66e7);_0x5c9df6['body']=_0x5c9df6['body']['concat'](_0x5df85e);return _0x5c9df6;}function createTables(_0x429f1d){var _0x102822=[];var _0x7ba987=_[_0x0fa9('0x16')](Object[_0x0fa9('0x17')](_0x429f1d[0x0]),0x5);_0x7ba987[_0x0fa9('0x18')](function(_0x993db5){_0x102822['push'](createTable(_0x993db5,_0x429f1d));});return _0x102822;}function getPDFDocDefinition(_0x34d4e6){var _0x8a7508=util[_0x0fa9('0x19')](_0x0fa9('0x1a'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x0fa9('0x1b')])[_0x0fa9('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x0fa9('0x1c')])['format'](FORMAT));var _0x52dbda=[];for(var _0x3ee5c2=0x0;_0x3ee5c2<_0x34d4e6[_0x0fa9('0x13')];_0x3ee5c2++){var _0x1e17a9=[];if(_0x3ee5c2===0x0){_0x1e17a9[_0x0fa9('0x15')]({'text':_0x8a7508,'style':'header'});}var _0x51fcfa={'table':_0x34d4e6[_0x3ee5c2]};if(_0x3ee5c2>0x0){_0x51fcfa[_0x0fa9('0x1d')]='before';_0x51fcfa[_0x0fa9('0x1e')]=[0x0,0x46,0x0,0x0];}_0x1e17a9[_0x0fa9('0x15')](_0x51fcfa);_0x52dbda['push'](_0x1e17a9);}return{'pageSize':'A4','pageOrientation':_0x0fa9('0x1f'),'content':_0x52dbda,'footer':function(_0x11dfbe,_0x25a7fe){return{'text':_0x11dfbe['toString']()+'\x20/\x20'+_0x25a7fe,'style':'footer'};},'defaultStyle':{'font':_0x0fa9('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0fa9('0x21')},'footer':{'alignment':_0x0fa9('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2ff09e){var _0x57204e=0x1388;var _0x3e5527;if(!_0x2ff09e[0x0][_0x0fa9('0x23')]){return analyticExtractedReport('Empty');}var _0x470914=[];var _0x16e6c9=0x0;var _0x4db49e=!![];var _0x38ea11=path[_0x0fa9('0x24')](PATH);var _0x20eeb6=path[_0x0fa9('0x25')](PATH,_0x0fa9('0x26'));var _0x2bbb18=path[_0x0fa9('0x27')](_0x38ea11,util[_0x0fa9('0x19')](_0x0fa9('0x28'),_0x20eeb6,_0x0fa9('0x29')));var _0x43addc=![];return db['Setting'][_0x0fa9('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizePdf']})[_0x0fa9('0x2b')](function(_0x4f12a3){if(_0x4f12a3){_0x3e5527=_0x4f12a3;_0x57204e=_0x3e5527[_0x0fa9('0x2c')]||0x3e8;}})[_0x0fa9('0x2b')](function(){if(_0x2ff09e&&_0x2ff09e[_0x0fa9('0x13')]){var _0x447f98=_0x2ff09e[0x0][_0x0fa9('0x23')]%(_0x16e6c9+_0x57204e);if(_0x3e5527[_0x0fa9('0x2d')]){for(;_0x4db49e;_0x16e6c9+=_0x57204e,_0x447f98=_0x2ff09e[0x0][_0x0fa9('0x23')]%(_0x16e6c9+_0x57204e)){if(_0x447f98==0x0||_0x447f98==_0x2ff09e[0x0][_0x0fa9('0x23')]){_0x4db49e=![];}_0x470914[_0x0fa9('0x15')](dbH[_0x0fa9('0x2e')][_0x0fa9('0x2f')](util[_0x0fa9('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x57204e,_0x16e6c9),{'type':dbH[_0x0fa9('0x2e')]['QueryTypes']['SELECT']}));}}else{_0x470914[_0x0fa9('0x15')](dbH[_0x0fa9('0x2e')][_0x0fa9('0x2f')](QUERY,{'type':dbH[_0x0fa9('0x2e')][_0x0fa9('0x30')][_0x0fa9('0x31')]}));}}_0x43addc=_0x3e5527[_0x0fa9('0x2d')]&&_0x470914[_0x0fa9('0x13')]>0x1;if(!fs['existsSync'](path[_0x0fa9('0x27')](_0x38ea11,_0x20eeb6))&&_0x43addc){fs[_0x0fa9('0x32')](path['join'](_0x38ea11,_0x20eeb6));}return Promise[_0x0fa9('0x33')](_0x470914);})[_0x0fa9('0x2b')](function(_0x50334f){return createTables(_[_0x0fa9('0x34')](_0x50334f));})['then'](function(_0x11219a){var _0x3e1d53=getPDFDocDefinition(_0x11219a);var _0x278782=getPDFPrinter();var _0x2755c6=_0x278782[_0x0fa9('0x35')](_0x3e1d53);if(_0x43addc)_0x2bbb18=path['join'](_0x38ea11,_0x20eeb6,util[_0x0fa9('0x19')]('%s%d.%s',_0x20eeb6,index,_0x0fa9('0x29')));return writePDFDocument(_0x2755c6,_0x2bbb18);})['then'](function(){if(!_0x43addc)return;zipdir(path['join'](_0x38ea11,_0x20eeb6),{'saveTo':path[_0x0fa9('0x27')](_0x38ea11,util['format'](_0x0fa9('0x28'),_0x20eeb6,_0x0fa9('0x36')))},function(_0x275edd){if(_0x275edd)throw _0x275edd;return;});})[_0x0fa9('0x2b')](function(){if(!_0x43addc)return;rimraf(path[_0x0fa9('0x27')](_0x38ea11,_0x20eeb6),function(){});})[_0x0fa9('0x2b')](function(){logger['info'](util[_0x0fa9('0x19')](_0x0fa9('0x37'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0fa9('0x38'),_0x43addc?util[_0x0fa9('0x19')]('%s.%s',_0x20eeb6,_0x43addc?_0x0fa9('0x36'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x0fa9('0x19')](_0x0fa9('0x39'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x0fa9('0x3a')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x0fa9('0x2b')](function(_0xf71e1b){EXTRACTED_REPORT=_0xf71e1b;return dbH['sequelize'][_0x0fa9('0x2f')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0fa9('0x2e')][_0x0fa9('0x30')]['SELECT']});})[_0x0fa9('0x2b')](extractReport)['catch'](function(_0x5bcfe9){logger['info'](util[_0x0fa9('0x19')](_0x0fa9('0x3b'),EXTRACTED_REPORT_ID,_0x0fa9('0x3c')),util['inspect'](_0x5bcfe9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0fa9('0x3d'));})[_0x0fa9('0x3e')](function(){process[_0x0fa9('0x3f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3c6b51=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x0fa9('0x40'),'italics':__dirname+_0x0fa9('0x41'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x3c6b51;}function getPDFDocDefinitionFromHTML(_0x40e550,_0x4a54c3){var _0x58ad9a=util[_0x0fa9('0x19')]('%s\x20#%d',_0x4a54c3['channel'],_0x4a54c3[_0x0fa9('0x42')]);var _0x3c9678=moment()[_0x0fa9('0x19')](_0x0fa9('0x43'))[_0x0fa9('0x11')]();var _0x3a2620=htmlToPdfmake(_0x40e550,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3a2620],'defaultStyle':{'font':_0x0fa9('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x0fa9('0x44'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x0fa9('0x44')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x0fa9('0x45')}];},'footer':function(_0x201304,_0x1a4d46){return[{'text':util[_0x0fa9('0x19')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x58ad9a,_0x201304,_0x1a4d46,_0x3c9678),'style':_0x0fa9('0x46')}];}};}function writePDFDocument(_0x477184,_0x42b12b){return new Promise(function(_0x28b603,_0x2f0b11){var _0x500e37=_0x477184[_0x0fa9('0x47')](fs[_0x0fa9('0x48')](_0x42b12b));_0x500e37['on'](_0x0fa9('0x49'),function(){_0x28b603(_0x0fa9('0x49'));});_0x500e37['on'](_0x0fa9('0x4a'),function(_0xc6fa2f){_0x2f0b11(_0xc6fa2f);});_0x477184['end']();});}exports['createPdfFromHTML']=function(_0x59c5f6,_0x2d5e3a){var _0x39e9b8=getPDFPrinter();var _0x257e2d=getPDFDocDefinitionFromHTML(_0x59c5f6,_0x2d5e3a);var _0x4faac9=_0x39e9b8['createPdfKitDocument'](_0x257e2d);return writePDFDocument(_0x4faac9,_0x2d5e3a[_0x0fa9('0x1')])[_0x0fa9('0x4b')](function(_0x580132){throw _0x580132;});};
\ No newline at end of file
index d8b4aad..6d80d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d81=['sequelize','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','query','QueryTypes','push','basename','existsSync','join','%s%d.%s','xlsx','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','exit','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then'];(function(_0x1e93bc,_0x8464e){var _0x22b0a9=function(_0x11e583){while(--_0x11e583){_0x1e93bc['push'](_0x1e93bc['shift']());}};_0x22b0a9(++_0x8464e);}(_0x6d81,0x188));var _0x16d8=function(_0x445e6e,_0xb06aca){_0x445e6e=_0x445e6e-0x0;var _0x3d7222=_0x6d81[_0x445e6e];return _0x3d7222;};'use strict';var util=require('util');var path=require(_0x16d8('0x0'));var _=require(_0x16d8('0x1'));var fs=require('fs');var json2xls=require(_0x16d8('0x2'));var BPromise=require(_0x16d8('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x16d8('0x4'));var db=require(_0x16d8('0x5'))['db'];var dbH=require('../../mysqldb')[_0x16d8('0x6')];var logger=require(_0x16d8('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x16d8('0x8')][0x2]);var QUERY=process[_0x16d8('0x8')][0x3];var PATH=process[_0x16d8('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3a4ed1,_0xe6af9a){var _0x51ad94={'status':_0x3a4ed1};var _0x2a2b7a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xe6af9a){_0x51ad94[_0x16d8('0x9')]=_0xe6af9a;}return db['AnalyticExtractedReport'][_0x16d8('0xa')](_0x51ad94,_0x2a2b7a);}function main(){var _0x3ae550=0x1388;var _0x306de6;logger[_0x16d8('0xb')](util['format'](_0x16d8('0xc'),EXTRACTED_REPORT_ID,_0x16d8('0xd')));return db[_0x16d8('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x16d8('0xf'),_0x16d8('0x10')]})[_0x16d8('0x11')](function(_0x2d71d7){if(_0x2d71d7){_0x306de6=_0x2d71d7;_0x3ae550=_0x306de6['splitSizeXlsx']||0x1388;}})[_0x16d8('0x11')](function(){return dbH[_0x16d8('0x12')]['query'](util[_0x16d8('0x13')](_0x16d8('0x14'),QUERY),{'type':dbH[_0x16d8('0x12')]['QueryTypes'][_0x16d8('0x15')]});})[_0x16d8('0x11')](function(_0x77d65a){if(!_0x77d65a[0x0][_0x16d8('0x16')]){return analyticExtractedReport(_0x16d8('0x17'));}var _0x5df8f6=[];var _0x2c15ec=0x0;var _0x21e281=!![];if(_0x306de6['split']){if(_0x77d65a&&_0x77d65a[_0x16d8('0x18')]){var _0x10f11e=_0x77d65a[0x0][_0x16d8('0x16')]%(_0x2c15ec+_0x3ae550);for(;_0x21e281;_0x2c15ec+=_0x3ae550,_0x10f11e=_0x77d65a[0x0][_0x16d8('0x16')]%(_0x2c15ec+_0x3ae550)){if(_0x10f11e==0x0||_0x10f11e==_0x77d65a[0x0][_0x16d8('0x16')]){_0x21e281=![];}_0x5df8f6['push'](dbH[_0x16d8('0x12')][_0x16d8('0x19')](util[_0x16d8('0x13')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3ae550,_0x2c15ec),{'type':dbH[_0x16d8('0x12')][_0x16d8('0x1a')][_0x16d8('0x15')]}));}}}else{_0x5df8f6[_0x16d8('0x1b')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x16d8('0x12')][_0x16d8('0x1a')][_0x16d8('0x15')]}));}var _0x1cef8e=path['dirname'](PATH);var _0x17dfa8=path[_0x16d8('0x1c')](PATH,'.xlsx');var _0x14d788=_0x306de6['split']&&_0x5df8f6[_0x16d8('0x18')]>0x1;var _0x153159=[];if(!fs[_0x16d8('0x1d')](path['join'](_0x1cef8e,_0x17dfa8))&&_0x14d788){fs['mkdirSync'](path[_0x16d8('0x1e')](_0x1cef8e,_0x17dfa8));}return BPromise['each'](_0x5df8f6,function(_0x47ffb5){_0x153159['push'](_0x47ffb5);})[_0x16d8('0x11')](function(){for(var _0x53e00a=0x0;_0x53e00a<_0x153159[_0x16d8('0x18')];_0x53e00a+=0x1){var _0x437f0b;var _0x2c1745=_0x153159[_0x53e00a];if(_0x14d788){_0x437f0b=path['join'](_0x1cef8e,_0x17dfa8,util[_0x16d8('0x13')](_0x16d8('0x1f'),_0x17dfa8,_0x53e00a,_0x16d8('0x20')));}else{_0x437f0b=path[_0x16d8('0x1e')](_0x1cef8e,util['format'](_0x16d8('0x21'),_0x17dfa8,_0x16d8('0x20')));}fs[_0x16d8('0x22')](_0x437f0b,json2xls(_0x2c1745),'binary');}})[_0x16d8('0x11')](function(){if(_0x14d788){zipdir(path[_0x16d8('0x1e')](_0x1cef8e,_0x17dfa8),{'saveTo':path[_0x16d8('0x1e')](_0x1cef8e,util[_0x16d8('0x13')](_0x16d8('0x21'),_0x17dfa8,'zip'))},function(_0x4b8072,_0x2a87da){});rimraf(path[_0x16d8('0x1e')](_0x1cef8e,_0x17dfa8),function(){});}})[_0x16d8('0x11')](function(){logger[_0x16d8('0xb')](util[_0x16d8('0x13')](_0x16d8('0x23'),EXTRACTED_REPORT_ID,_0x16d8('0xd')));return analyticExtractedReport(_0x16d8('0x24'),_0x14d788?util[_0x16d8('0x13')](_0x16d8('0x21'),_0x17dfa8,_0x14d788?_0x16d8('0x25'):_0x16d8('0x20')):null);});})[_0x16d8('0x26')](function(_0x8b3826){logger['info'](util[_0x16d8('0x13')](_0x16d8('0x27'),EXTRACTED_REPORT_ID,_0x16d8('0xd')),util['inspect'](_0x8b3826,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0x16d8('0x28')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x56e7=['existsSync','join','each','%s%d.%s','xlsx','%s.%s','binary','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','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','then','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','length'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x56e7,0x166));var _0x756e=function(_0x2008ee,_0xe5f904){_0x2008ee=_0x2008ee-0x0;var _0x25dede=_0x56e7[_0x2008ee];return _0x25dede;};'use strict';var util=require(_0x756e('0x0'));var path=require(_0x756e('0x1'));var _=require(_0x756e('0x2'));var fs=require('fs');var json2xls=require(_0x756e('0x3'));var BPromise=require(_0x756e('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x756e('0x5'));var db=require(_0x756e('0x6'))['db'];var dbH=require(_0x756e('0x6'))[_0x756e('0x7')];var logger=require(_0x756e('0x8'))(_0x756e('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x756e('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16f24b,_0xf7ecba){var _0x14d84e={'status':_0x16f24b};var _0x22eebb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xf7ecba){_0x14d84e['savename']=_0xf7ecba;}return db[_0x756e('0xb')][_0x756e('0xc')](_0x14d84e,_0x22eebb);}function main(){var _0x20cda3=0x1388;var _0x521279;logger[_0x756e('0xd')](util[_0x756e('0xe')](_0x756e('0xf'),EXTRACTED_REPORT_ID,_0x756e('0x10')));return db[_0x756e('0x11')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x756e('0x12'),_0x756e('0x13')]})['then'](function(_0xd267f4){if(_0xd267f4){_0x521279=_0xd267f4;_0x20cda3=_0x521279['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH['sequelize'][_0x756e('0x14')](util[_0x756e('0xe')](_0x756e('0x15'),QUERY),{'type':dbH[_0x756e('0x16')][_0x756e('0x17')]['SELECT']});})[_0x756e('0x18')](function(_0x2dfbe4){if(!_0x2dfbe4[0x0][_0x756e('0x19')]){return analyticExtractedReport(_0x756e('0x1a'));}var _0x25fc1c=[];var _0xa8e504=0x0;var _0xf8f208=!![];if(_0x521279[_0x756e('0x12')]){if(_0x2dfbe4&&_0x2dfbe4['length']){var _0x32cfc8=_0x2dfbe4[0x0][_0x756e('0x19')]%(_0xa8e504+_0x20cda3);for(;_0xf8f208;_0xa8e504+=_0x20cda3,_0x32cfc8=_0x2dfbe4[0x0]['num']%(_0xa8e504+_0x20cda3)){if(_0x32cfc8==0x0||_0x32cfc8==_0x2dfbe4[0x0]['num']){_0xf8f208=![];}_0x25fc1c[_0x756e('0x1b')](dbH[_0x756e('0x16')][_0x756e('0x14')](util[_0x756e('0xe')](_0x756e('0x1c'),QUERY,_0x20cda3,_0xa8e504),{'type':dbH[_0x756e('0x16')]['QueryTypes'][_0x756e('0x1d')]}));}}}else{_0x25fc1c[_0x756e('0x1b')](dbH[_0x756e('0x16')]['query'](QUERY,{'type':dbH[_0x756e('0x16')][_0x756e('0x17')][_0x756e('0x1d')]}));}var _0x12a99b=path[_0x756e('0x1e')](PATH);var _0xd8628e=path[_0x756e('0x1f')](PATH,_0x756e('0x20'));var _0x460b84=_0x521279[_0x756e('0x12')]&&_0x25fc1c[_0x756e('0x21')]>0x1;var _0x126718=[];if(!fs[_0x756e('0x22')](path[_0x756e('0x23')](_0x12a99b,_0xd8628e))&&_0x460b84){fs['mkdirSync'](path[_0x756e('0x23')](_0x12a99b,_0xd8628e));}return BPromise[_0x756e('0x24')](_0x25fc1c,function(_0x2f8b92){_0x126718[_0x756e('0x1b')](_0x2f8b92);})['then'](function(){for(var _0x2416ca=0x0;_0x2416ca<_0x126718[_0x756e('0x21')];_0x2416ca+=0x1){var _0x1bbac0;var _0x131af3=_0x126718[_0x2416ca];if(_0x460b84){_0x1bbac0=path[_0x756e('0x23')](_0x12a99b,_0xd8628e,util[_0x756e('0xe')](_0x756e('0x25'),_0xd8628e,_0x2416ca,_0x756e('0x26')));}else{_0x1bbac0=path['join'](_0x12a99b,util[_0x756e('0xe')](_0x756e('0x27'),_0xd8628e,'xlsx'));}fs['writeFileSync'](_0x1bbac0,json2xls(_0x131af3),_0x756e('0x28'));}})[_0x756e('0x18')](function(){if(_0x460b84){zipdir(path[_0x756e('0x23')](_0x12a99b,_0xd8628e),{'saveTo':path['join'](_0x12a99b,util[_0x756e('0xe')](_0x756e('0x27'),_0xd8628e,_0x756e('0x29')))},function(_0x17a203,_0x46a97d){});rimraf(path['join'](_0x12a99b,_0xd8628e),function(){});}})['then'](function(){logger[_0x756e('0xd')](util[_0x756e('0xe')](_0x756e('0x2a'),EXTRACTED_REPORT_ID,_0x756e('0x10')));return analyticExtractedReport(_0x756e('0x2b'),_0x460b84?util['format'](_0x756e('0x27'),_0xd8628e,_0x460b84?_0x756e('0x29'):_0x756e('0x26')):null);});})[_0x756e('0x2c')](function(_0xf5c73c){logger[_0x756e('0xd')](util[_0x756e('0xe')](_0x756e('0x2d'),EXTRACTED_REPORT_ID,_0x756e('0x10')),util[_0x756e('0x2e')](_0xf5c73c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x756e('0x2f'));})[_0x756e('0x30')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 1edf27a..14d2a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x875c=['destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','hasOwnProperty','priority','extensions','find','push','type','Set','format','VoiceExtensionId','inbound','CDR(routeid)=','context','outbound','extension','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction'];(function(_0x2b87c9,_0x59671a){var _0x328684=function(_0xbeabd4){while(--_0xbeabd4){_0x2b87c9['push'](_0x2b87c9['shift']());}};_0x328684(++_0x59671a);}(_0x875c,0x12e));var _0xc875=function(_0x5e9079,_0x9f5971){_0x5e9079=_0x5e9079-0x0;var _0x2ca1a1=_0x875c[_0x5e9079];return _0x2ca1a1;};'use strict';var _=require(_0xc875('0x0'));var util=require(_0xc875('0x1'));function rewrite(_0x52ef53,_0x4c1e17){var _0x10df5b=this;return _0x52ef53[_0xc875('0x2')][_0xc875('0x3')][_0xc875('0x4')]({'raw':!![]})['then'](function(_0x458c32){_0x10df5b[_0xc875('0x5')]=_0x458c32;return _0x52ef53['models'][_0xc875('0x6')][_0xc875('0x4')]({'where':{'IntervalId':_0x4c1e17[_0xc875('0x7')]},'raw':!![]});})[_0xc875('0x8')](function(_0xa363bf){return _0x52ef53[_0xc875('0x2')][_0xc875('0x6')][_0xc875('0x4')]({'where':{'exten':{'$in':_[_0xc875('0x9')](_[_0xc875('0xa')](_0xa363bf,_0xc875('0xb')))}},'order':[{'raw':_0xc875('0xc')}],'raw':!![]});})[_0xc875('0x8')](function(_0x3e5400){var _0x3894a2=_['filter'](_0x3e5400,{'priority':'1'});var _0x25dabc=_[_0xc875('0xd')](_0x3e5400,{'isApp':0x1});var _0x314230=_[_0xc875('0xe')](_0x25dabc,_0xc875('0xb'));var _0x4413be=['queue','playback'];var _0x15010=[];var _0x41828f=[];for(var _0x33d55e in _0x314230){if(_0x314230[_0xc875('0xf')](_0x33d55e)){_0x10df5b[_0xc875('0x10')]=0x2;_0x10df5b[_0xc875('0x11')]=[];_0x10df5b['extension']=_[_0xc875('0x12')](_0x3894a2,{'exten':_0x314230[_0x33d55e][0x0]['exten']});_0x10df5b[_0xc875('0x11')][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':util[_0xc875('0x16')]('CDR(type)=%s',_0x314230[_0x33d55e][0x0][_0xc875('0x14')]),'context':_0x314230[_0x33d55e][0x0]['context'],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b['priority']++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});if(_0x314230[_0x33d55e][0x0][_0xc875('0x14')]===_0xc875('0x18')){_0x10df5b[_0xc875('0x11')]['push']({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':_0xc875('0x19')+_0x314230[_0x33d55e][0x0][_0xc875('0x17')],'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0]['VoiceExtensionId']});}else if(_0x314230[_0x33d55e][0x0]['type']===_0xc875('0x1b')){if(_0x10df5b[_0xc875('0x1c')]){_0x10df5b['extensions'][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':'CDR(destination)='+(_0x10df5b['extension']['cutdigits']?_0xc875('0x1d')+_0x10df5b[_0xc875('0x1c')][_0xc875('0x1e')]+'}':_0xc875('0x1f')),'context':_0x314230[_0x33d55e][0x0]['context'],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});}_0x10df5b['extensions'][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0]['type'],'app':_0xc875('0x15'),'appdata':'CDR(routeid)='+_0x314230[_0x33d55e][0x0]['VoiceExtensionId'],'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b['priority']++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});var _0x31abfa=_0x10df5b[_0xc875('0x10')]++;_0x10df5b[_0xc875('0x11')]['push']({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':'ExecIf','appdata':_0xc875('0x20')+(_0x31abfa+0x2)+'):Goto('+(_0x31abfa+0x1)+')','context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x31abfa,'VoiceExtensionId':_0x314230[_0x33d55e][0x0]['VoiceExtensionId']});if(_0x10df5b[_0xc875('0x1c')]){_0x10df5b[_0xc875('0x11')][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':'Set','appdata':_0x10df5b[_0xc875('0x1c')]['cutdigits']?_0xc875('0x21')+_0x10df5b['extension'][_0xc875('0x1e')]+'}':'CDR(prefix)=noprefix','context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0]['VoiceExtensionId']});}_0x10df5b[_0xc875('0x11')][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':_0xc875('0x22')+_0x314230[_0x33d55e][0x0][_0xc875('0x17')],'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0]['exten'],'priority':_0x10df5b['priority']++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0]['VoiceExtensionId']});if(_0x10df5b['extension']&&_0x10df5b[_0xc875('0x1c')][_0xc875('0xf')]('recordingFormat')&&_0x10df5b[_0xc875('0x1c')]['recordingFormat']!==_0xc875('0x23')){_0x10df5b[_0xc875('0x11')][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':_0xc875('0x24'),'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0]['VoiceExtensionId']});_0x10df5b[_0xc875('0x11')]['push']({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':'Set','appdata':_0xc875('0x25')+_0x10df5b[_0xc875('0x1c')][_0xc875('0x26')]||_0xc875('0x27'),'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b['priority']++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});}}_0x10df5b[_0xc875('0x11')]['push']({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':_0xc875('0x28'),'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});_0x10df5b[_0xc875('0x11')]['push']({'type':_0x314230[_0x33d55e][0x0]['type'],'app':_0xc875('0x15'),'appdata':_0xc875('0x29'),'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});_0x10df5b[_0xc875('0x11')][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':_0xc875('0x2a'),'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'priority':_0x10df5b[_0xc875('0x10')]++,'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});for(var _0x120808=0x0,_0x255062=0x0;_0x120808<_0x314230[_0x33d55e]['length'];_0x120808+=0x1,_0x255062=0x0){var _0x1a701c=_0x314230[_0x33d55e][_0x120808];if(_0x1a701c[_0xc875('0x14')]){_0x1a701c[_0xc875('0x14')]=_0x1a701c['type'][_0xc875('0x2b')]();}var _0x4ad323=[];var _0x1f09a3=[];delete _0x1a701c['id'];delete _0x1a701c[_0xc875('0x2c')];delete _0x1a701c[_0xc875('0x2d')];var _0x407db0=_0x1a701c[_0xc875('0x2e')]!==_0xc875('0x2f')?[_0x1a701c[_0xc875('0x2e')]]:_0x1a701c['IntervalId']?_[_0xc875('0xa')](_[_0xc875('0xd')](_0x10df5b['intervals'],{'IntervalId':_0x1a701c[_0xc875('0x7')]}),'interval'):[];if(_0x1a701c[_0xc875('0xf')](_0xc875('0x30'))){if(_0x1a701c[_0xc875('0x30')]&&_0x1a701c['tag']!=='--'){_0x4ad323[_0xc875('0x13')]({'type':_0x1a701c[_0xc875('0x14')],'app':'Set','appdata':_0xc875('0x31')+_0x1a701c[_0xc875('0x30')],'context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c[_0xc875('0xb')],'priority':_0x407db0[_0xc875('0x32')]+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});}}if(_0x1a701c['type']===_0xc875('0x1b')&&_0x1a701c[_0xc875('0xf')](_0xc875('0x33'))){if(_0x1a701c[_0xc875('0x33')]){_0x4ad323['push']({'type':_0x1a701c[_0xc875('0x14')],'app':_0xc875('0x34'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x1a701c['callerID']+')','context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c['exten'],'priority':_0x407db0[_0xc875('0x32')]+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});}else{_0x4ad323['push']({'type':_0x1a701c[_0xc875('0x14')],'app':_0xc875('0x34'),'appdata':_0xc875('0x35'),'context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c[_0xc875('0xb')],'priority':_0x407db0[_0xc875('0x32')]+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});}}if(_0x1a701c[_0xc875('0xf')]('answer')){if(_0x4413be[_0xc875('0x36')](_0x1a701c[_0xc875('0x37')][_0xc875('0x2b')]())>=0x0&&_0x1a701c['appType']!==_0xc875('0x38')){if(_0x1a701c[_0xc875('0x39')]){_0x4ad323[_0xc875('0x13')]({'type':_0x1a701c['type'],'app':_0xc875('0x34'),'appdata':_0xc875('0x3a'),'context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c['exten'],'priority':_0x407db0['length']+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});_0x4ad323[_0xc875('0x13')]({'type':_0x1a701c[_0xc875('0x14')],'app':_0xc875('0x15'),'appdata':_0xc875('0x3b'),'context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c['exten'],'priority':_0x407db0['length']+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});}else{_0x4ad323[_0xc875('0x13')]({'type':_0x1a701c[_0xc875('0x14')],'app':_0xc875('0x34'),'appdata':_0xc875('0x3c'),'context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c[_0xc875('0xb')],'priority':_0x407db0[_0xc875('0x32')]+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});_0x4ad323[_0xc875('0x13')]({'type':_0x1a701c[_0xc875('0x14')],'app':'Set','appdata':_0xc875('0x3d'),'context':_0x1a701c[_0xc875('0x1a')],'exten':_0x1a701c[_0xc875('0xb')],'priority':_0x407db0[_0xc875('0x32')]+_0x10df5b[_0xc875('0x10')]+_0x255062++,'VoiceExtensionId':_0x1a701c[_0xc875('0x17')]});}}}for(var _0xb798e=0x0;_0xb798e<_0x407db0['length'];_0xb798e+=0x1){var _0x454537=_0x10df5b[_0xc875('0x10')]+_0x407db0['length'];var _0x3892ba=_0xb798e===_0x407db0[_0xc875('0x32')]-0x1?_0x10df5b['priority']+_0x4ad323[_0xc875('0x32')]+_0x1f09a3[_0xc875('0x32')]+0x2:_0x10df5b['priority']+_0xb798e+0x1;_0x4ad323['splice'](_0xb798e,0x0,{'type':_0x1a701c[_0xc875('0x14')],'app':_0xc875('0x3e'),'appdata':_0x407db0[_0xb798e]+'?'+_0x1a701c[_0xc875('0x1a')]+_0xc875('0x3f')+_0x454537+':'+_0x1a701c[_0xc875('0x1a')]+',${EXTEN},'+_0x3892ba,'exten':_0x1a701c[_0xc875('0xb')],'context':_0x1a701c[_0xc875('0x1a')],'priority':_0x10df5b[_0xc875('0x10')]+_0xb798e,'VoiceExtensionId':_0x314230[_0x33d55e][0x0]['VoiceExtensionId']});}_0x1a701c[_0xc875('0x10')]=_0x4ad323[_0xc875('0x32')]?_[_0xc875('0x40')](_0x4ad323)[_0xc875('0x10')]+0x1:_0x10df5b[_0xc875('0x10')];_0x10df5b[_0xc875('0x10')]=(_0x1f09a3[_0xc875('0x32')]?_[_0xc875('0x40')](_0x1f09a3)[_0xc875('0x10')]:_0x1a701c[_0xc875('0x10')])+0x1;_0x10df5b[_0xc875('0x11')]=_[_0xc875('0x41')](_0x10df5b['extensions'],_0x4ad323,[_0x1a701c],_0x1f09a3);}_0x10df5b[_0xc875('0x11')][_0xc875('0x13')]({'type':_0x314230[_0x33d55e][0x0][_0xc875('0x14')],'app':_0xc875('0x42'),'exten':_0x314230[_0x33d55e][0x0][_0xc875('0xb')],'context':_0x314230[_0x33d55e][0x0][_0xc875('0x1a')],'priority':_0x10df5b[_0xc875('0x10')],'VoiceExtensionId':_0x314230[_0x33d55e][0x0][_0xc875('0x17')]});_0x15010[_0xc875('0x13')](_0x314230[_0x33d55e][0x0][_0xc875('0x17')]);_0x41828f=_['concat'](_0x41828f,_0x10df5b[_0xc875('0x11')]);}}return _0x52ef53[_0xc875('0x43')](function(_0x55287e){return _0x52ef53[_0xc875('0x2')][_0xc875('0x6')][_0xc875('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x15010}},'transaction':_0x55287e})[_0xc875('0x8')](function(_0x4c40b4){return _0x52ef53[_0xc875('0x2')][_0xc875('0x6')][_0xc875('0x45')](_[_0xc875('0x46')](_0x41828f,_0xc875('0x10')),{'transaction':_0x55287e});});});})[_0xc875('0x47')](function(_0x2f38ee){console[_0xc875('0x48')](_0x2f38ee);});}exports[_0xc875('0x49')]=rewrite;
\ No newline at end of file
+var _0xe050=['IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','queue','hasOwnProperty','priority','extension','find','extensions','push','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','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-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','error','rewrite','util','models','Interval','findAll','intervals','VoiceExtension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe050,0x88));var _0x0e05=function(_0x2bf953,_0x48e9fb){_0x2bf953=_0x2bf953-0x0;var _0x5ea18d=_0xe050[_0x2bf953];return _0x5ea18d;};'use strict';var _=require('lodash');var util=require(_0x0e05('0x0'));function rewrite(_0x287743,_0x2049e6){var _0x16711b=this;return _0x287743[_0x0e05('0x1')][_0x0e05('0x2')][_0x0e05('0x3')]({'raw':!![]})['then'](function(_0x3a03b8){_0x16711b[_0x0e05('0x4')]=_0x3a03b8;return _0x287743[_0x0e05('0x1')][_0x0e05('0x5')][_0x0e05('0x3')]({'where':{'IntervalId':_0x2049e6[_0x0e05('0x6')]},'raw':!![]});})['then'](function(_0x259ee9){return _0x287743[_0x0e05('0x1')][_0x0e05('0x5')][_0x0e05('0x3')]({'where':{'exten':{'$in':_[_0x0e05('0x7')](_[_0x0e05('0x8')](_0x259ee9,_0x0e05('0x9')))}},'order':[{'raw':_0x0e05('0xa')}],'raw':!![]});})[_0x0e05('0xb')](function(_0xc713ed){var _0x3b937f=_[_0x0e05('0xc')](_0xc713ed,{'priority':'1'});var _0x4b2b4b=_['filter'](_0xc713ed,{'isApp':0x1});var _0x242af4=_['groupBy'](_0x4b2b4b,_0x0e05('0x9'));var _0x3abfd8=[_0x0e05('0xd'),'playback'];var _0x251525=[];var _0x3c140e=[];for(var _0x5b3585 in _0x242af4){if(_0x242af4[_0x0e05('0xe')](_0x5b3585)){_0x16711b[_0x0e05('0xf')]=0x2;_0x16711b['extensions']=[];_0x16711b[_0x0e05('0x10')]=_[_0x0e05('0x11')](_0x3b937f,{'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')]});_0x16711b[_0x0e05('0x12')][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':'Set','appdata':util[_0x0e05('0x15')](_0x0e05('0x16'),_0x242af4[_0x5b3585][0x0]['type']),'context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b['priority']++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});if(_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')]===_0x0e05('0x19')){_0x16711b['extensions'][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0]['type'],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x1b')+_0x242af4[_0x5b3585][0x0]['VoiceExtensionId'],'context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0]['exten'],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});}else if(_0x242af4[_0x5b3585][0x0]['type']===_0x0e05('0x1c')){if(_0x16711b[_0x0e05('0x10')]){_0x16711b[_0x0e05('0x12')][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0]['type'],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x1d')+(_0x16711b[_0x0e05('0x10')][_0x0e05('0x1e')]?_0x0e05('0x1f')+_0x16711b[_0x0e05('0x10')][_0x0e05('0x1e')]+'}':'${EXTEN}'),'context':_0x242af4[_0x5b3585][0x0]['context'],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});}_0x16711b['extensions']['push']({'type':_0x242af4[_0x5b3585][0x0]['type'],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x1b')+_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')],'context':_0x242af4[_0x5b3585][0x0]['context'],'exten':_0x242af4[_0x5b3585][0x0]['exten'],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0]['VoiceExtensionId']});var _0x56ed60=_0x16711b[_0x0e05('0xf')]++;_0x16711b[_0x0e05('0x12')]['push']({'type':_0x242af4[_0x5b3585][0x0]['type'],'app':_0x0e05('0x20'),'appdata':_0x0e05('0x21')+(_0x56ed60+0x2)+_0x0e05('0x22')+(_0x56ed60+0x1)+')','context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0]['exten'],'priority':_0x56ed60,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});if(_0x16711b[_0x0e05('0x10')]){_0x16711b[_0x0e05('0x12')][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x16711b[_0x0e05('0x10')][_0x0e05('0x1e')]?_0x0e05('0x23')+_0x16711b['extension'][_0x0e05('0x1e')]+'}':_0x0e05('0x24'),'context':_0x242af4[_0x5b3585][0x0]['context'],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});}_0x16711b['extensions']['push']({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x25')+_0x242af4[_0x5b3585][0x0]['VoiceExtensionId'],'context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0]['exten'],'priority':_0x16711b['priority']++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});if(_0x16711b[_0x0e05('0x10')]&&_0x16711b['extension']['hasOwnProperty'](_0x0e05('0x26'))&&_0x16711b[_0x0e05('0x10')][_0x0e05('0x26')]!==_0x0e05('0x27')){_0x16711b['extensions'][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x28'),'context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0]['VoiceExtensionId']});_0x16711b['extensions'][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x29')+_0x16711b[_0x0e05('0x10')]['recordingFormat']||_0x0e05('0x2a'),'context':_0x242af4[_0x5b3585][0x0]['context'],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});}}_0x16711b['extensions']['push']({'type':_0x242af4[_0x5b3585][0x0]['type'],'app':_0x0e05('0x1a'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0]['exten'],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});_0x16711b['extensions'][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x2b'),'context':_0x242af4[_0x5b3585][0x0]['context'],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b['priority']++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});_0x16711b[_0x0e05('0x12')][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0]['type'],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x2c'),'context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'exten':_0x242af4[_0x5b3585][0x0][_0x0e05('0x9')],'priority':_0x16711b[_0x0e05('0xf')]++,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});for(var _0x554fe2=0x0,_0x114726=0x0;_0x554fe2<_0x242af4[_0x5b3585][_0x0e05('0x2d')];_0x554fe2+=0x1,_0x114726=0x0){var _0x5b7315=_0x242af4[_0x5b3585][_0x554fe2];if(_0x5b7315['type']){_0x5b7315[_0x0e05('0x14')]=_0x5b7315[_0x0e05('0x14')]['toLowerCase']();}var _0x3f5812=[];var _0x2d72fd=[];delete _0x5b7315['id'];delete _0x5b7315[_0x0e05('0x2e')];delete _0x5b7315[_0x0e05('0x2f')];var _0x447ac8=_0x5b7315[_0x0e05('0x30')]!==_0x0e05('0x31')?[_0x5b7315[_0x0e05('0x30')]]:_0x5b7315[_0x0e05('0x6')]?_['map'](_[_0x0e05('0xc')](_0x16711b[_0x0e05('0x4')],{'IntervalId':_0x5b7315[_0x0e05('0x6')]}),_0x0e05('0x30')):[];if(_0x5b7315[_0x0e05('0xe')](_0x0e05('0x32'))){if(_0x5b7315[_0x0e05('0x32')]&&_0x5b7315[_0x0e05('0x32')]!=='--'){_0x3f5812['push']({'type':_0x5b7315[_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x33')+_0x5b7315['tag'],'context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315[_0x0e05('0x9')],'priority':_0x447ac8['length']+_0x16711b['priority']+_0x114726++,'VoiceExtensionId':_0x5b7315['VoiceExtensionId']});}}if(_0x5b7315[_0x0e05('0x14')]===_0x0e05('0x1c')&&_0x5b7315[_0x0e05('0xe')](_0x0e05('0x34'))){if(_0x5b7315['callerID']){_0x3f5812[_0x0e05('0x13')]({'type':_0x5b7315[_0x0e05('0x14')],'app':'ExecIf','appdata':_0x0e05('0x35')+_0x5b7315[_0x0e05('0x34')]+')','context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315[_0x0e05('0x9')],'priority':_0x447ac8[_0x0e05('0x2d')]+_0x16711b[_0x0e05('0xf')]+_0x114726++,'VoiceExtensionId':_0x5b7315['VoiceExtensionId']});}else{_0x3f5812[_0x0e05('0x13')]({'type':_0x5b7315['type'],'app':_0x0e05('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315['exten'],'priority':_0x447ac8['length']+_0x16711b[_0x0e05('0xf')]+_0x114726++,'VoiceExtensionId':_0x5b7315[_0x0e05('0x18')]});}}if(_0x5b7315[_0x0e05('0xe')](_0x0e05('0x36'))){if(_0x3abfd8[_0x0e05('0x37')](_0x5b7315[_0x0e05('0x38')]['toLowerCase']())>=0x0&&_0x5b7315['appType']!==_0x0e05('0x39')){if(_0x5b7315['answer']){_0x3f5812[_0x0e05('0x13')]({'type':_0x5b7315['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315['exten'],'priority':_0x447ac8[_0x0e05('0x2d')]+_0x16711b[_0x0e05('0xf')]+_0x114726++,'VoiceExtensionId':_0x5b7315[_0x0e05('0x18')]});_0x3f5812[_0x0e05('0x13')]({'type':_0x5b7315[_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x3a'),'context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315['exten'],'priority':_0x447ac8[_0x0e05('0x2d')]+_0x16711b['priority']+_0x114726++,'VoiceExtensionId':_0x5b7315[_0x0e05('0x18')]});}else{_0x3f5812['push']({'type':_0x5b7315[_0x0e05('0x14')],'app':_0x0e05('0x20'),'appdata':_0x0e05('0x3b'),'context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315['exten'],'priority':_0x447ac8[_0x0e05('0x2d')]+_0x16711b[_0x0e05('0xf')]+_0x114726++,'VoiceExtensionId':_0x5b7315[_0x0e05('0x18')]});_0x3f5812[_0x0e05('0x13')]({'type':_0x5b7315[_0x0e05('0x14')],'app':_0x0e05('0x1a'),'appdata':_0x0e05('0x3c'),'context':_0x5b7315[_0x0e05('0x17')],'exten':_0x5b7315[_0x0e05('0x9')],'priority':_0x447ac8[_0x0e05('0x2d')]+_0x16711b[_0x0e05('0xf')]+_0x114726++,'VoiceExtensionId':_0x5b7315['VoiceExtensionId']});}}}for(var _0x2e9cd7=0x0;_0x2e9cd7<_0x447ac8['length'];_0x2e9cd7+=0x1){var _0x3c12c5=_0x16711b[_0x0e05('0xf')]+_0x447ac8[_0x0e05('0x2d')];var _0x10cfd7=_0x2e9cd7===_0x447ac8[_0x0e05('0x2d')]-0x1?_0x16711b[_0x0e05('0xf')]+_0x3f5812['length']+_0x2d72fd[_0x0e05('0x2d')]+0x2:_0x16711b[_0x0e05('0xf')]+_0x2e9cd7+0x1;_0x3f5812[_0x0e05('0x3d')](_0x2e9cd7,0x0,{'type':_0x5b7315[_0x0e05('0x14')],'app':'GotoIfTime','appdata':_0x447ac8[_0x2e9cd7]+'?'+_0x5b7315[_0x0e05('0x17')]+_0x0e05('0x3e')+_0x3c12c5+':'+_0x5b7315['context']+_0x0e05('0x3e')+_0x10cfd7,'exten':_0x5b7315[_0x0e05('0x9')],'context':_0x5b7315[_0x0e05('0x17')],'priority':_0x16711b[_0x0e05('0xf')]+_0x2e9cd7,'VoiceExtensionId':_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]});}_0x5b7315[_0x0e05('0xf')]=_0x3f5812[_0x0e05('0x2d')]?_[_0x0e05('0x3f')](_0x3f5812)[_0x0e05('0xf')]+0x1:_0x16711b[_0x0e05('0xf')];_0x16711b[_0x0e05('0xf')]=(_0x2d72fd[_0x0e05('0x2d')]?_['last'](_0x2d72fd)['priority']:_0x5b7315[_0x0e05('0xf')])+0x1;_0x16711b[_0x0e05('0x12')]=_[_0x0e05('0x40')](_0x16711b[_0x0e05('0x12')],_0x3f5812,[_0x5b7315],_0x2d72fd);}_0x16711b[_0x0e05('0x12')][_0x0e05('0x13')]({'type':_0x242af4[_0x5b3585][0x0][_0x0e05('0x14')],'app':_0x0e05('0x41'),'exten':_0x242af4[_0x5b3585][0x0]['exten'],'context':_0x242af4[_0x5b3585][0x0][_0x0e05('0x17')],'priority':_0x16711b['priority'],'VoiceExtensionId':_0x242af4[_0x5b3585][0x0]['VoiceExtensionId']});_0x251525[_0x0e05('0x13')](_0x242af4[_0x5b3585][0x0][_0x0e05('0x18')]);_0x3c140e=_['concat'](_0x3c140e,_0x16711b[_0x0e05('0x12')]);}}return _0x287743[_0x0e05('0x42')](function(_0x2097d4){return _0x287743['models'][_0x0e05('0x5')][_0x0e05('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x251525}},'transaction':_0x2097d4})[_0x0e05('0xb')](function(_0x4f9327){return _0x287743[_0x0e05('0x1')][_0x0e05('0x5')][_0x0e05('0x44')](_['sortBy'](_0x3c140e,_0x0e05('0xf')),{'transaction':_0x2097d4});});});})['catch'](function(_0x2a0196){console[_0x0e05('0x45')](_0x2a0196);});}exports[_0x0e05('0x46')]=rewrite;
\ No newline at end of file
index cccb355..368d0da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a6=['null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','field','toString','NOW()','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','\x20=\x20?','into','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','insert','cm_hopper_black','findAll','dialCheckDuplicateType','CmList','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','outbound','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','exit','CSV\x20import\x20process\x20stopped!','parse','pause','info','CSV\x20parse\x20error','util','lodash','squel','ioredis','../../../mysqldb','../../../config/environment','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x21a6,0x13c));var _0x621a=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0x21a6[_0xe896bf];return _0x4c7a8a;};'use strict';var BPromise=require('bluebird');var util=require(_0x621a('0x0'));var _=require(_0x621a('0x1'));var fs=require('fs');var squel=require(_0x621a('0x2'));var Papa=require('papaparse');var Redis=require(_0x621a('0x3'));var db=require(_0x621a('0x4'))['db'];var config=require(_0x621a('0x5'));var logger=require('../../../config/logger')(_0x621a('0x6'));config[_0x621a('0x7')]=_['defaults'](config[_0x621a('0x7')],{'host':_0x621a('0x8'),'port':0x18eb});var socket=require(_0x621a('0x9'))(new Redis(config['redis']));require(_0x621a('0xa'))[_0x621a('0xb')](socket);try{if(!process[_0x621a('0xc')][0x2]||process[_0x621a('0xc')][0x2]==='undefined'||process[_0x621a('0xc')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x621a('0xc')][0x2];if(!process[_0x621a('0xc')][0x3]||process[_0x621a('0xc')][0x3]==='undefined'||process[_0x621a('0xc')][0x3]==='null'||!process[_0x621a('0xc')][0x4]||process[_0x621a('0xc')][0x4]===_0x621a('0xd')||process[_0x621a('0xc')][0x4]===_0x621a('0xe')){throw new Error(_0x621a('0xf'));}var FIELDS=_[_0x621a('0x10')](process[_0x621a('0xc')][0x3]['split'](','),process[_0x621a('0xc')][0x4][_0x621a('0x11')](','));if(!process[_0x621a('0xc')][0x5]||process[_0x621a('0xc')][0x5]===_0x621a('0xd')||process['argv'][0x5]===_0x621a('0xe')){throw new Error(_0x621a('0x12'));}var LISTID=process[_0x621a('0xc')][0x5];var COMPANYID=process[_0x621a('0xc')][0x6]&&process[_0x621a('0xc')][0x6]!==_0x621a('0xd')&&process[_0x621a('0xc')][0x6]!==_0x621a('0xe')?process[_0x621a('0xc')][0x6]:null;var DUPLICATES=process[_0x621a('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x621a('0xc')][0x7]!==_0x621a('0xe')?process['argv'][0x7]:null;if(!process[_0x621a('0xc')][0x8]||process[_0x621a('0xc')][0x8]===_0x621a('0xd')||process['argv'][0x8]===_0x621a('0xe')){throw new Error(_0x621a('0x13'));}var SOCKET_TIMESTAMP=process[_0x621a('0xc')][0x8];}catch(_0x4a5d22){logger[_0x621a('0x14')](_0x4a5d22);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(_0x2842fe,_0x35512f,_0xcd6708,_0x303f2d){var _0x19d6bc={'message':_0x35512f};_0x19d6bc[_0x2842fe]=!![];if(_0xcd6708){_0x19d6bc[_0x621a('0x15')]=_0xcd6708;}if(_0x303f2d){_0x19d6bc['index']=_0x303f2d;}return _0x19d6bc;}function isEmail(_0x147a64){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))*$/[_0x621a('0x16')](_0x147a64);}function checkRow(_0x5400d5,_0x574fe2,_0x1f0514){return new BPromise(function(_0x309d21,_0x2a7868){if(_[_0x621a('0x17')](_0x5400d5)){return _0x2a7868(handleCheckRowError(_0x621a('0x14'),_0x621a('0x18'),null,_0x1f0514));}if(_0x5400d5['errors']&&_0x5400d5[_0x621a('0x19')][_0x621a('0x1a')]){var _0x495c2c=_[_0x621a('0x1b')](_0x5400d5['errors'],'message')[_0x621a('0x1c')](';');return _0x2a7868(handleCheckRowError(_0x621a('0x14'),_0x495c2c,null,_0x1f0514));}var _0x44bed2={};for(var _0xb10232 in FIELDS){if(FIELDS[_0x621a('0x1d')](_0xb10232)&&FIELDS[_0xb10232]){_0x44bed2[_0xb10232]=_0x5400d5[_0x621a('0x1e')][0x0][FIELDS[_0xb10232]]||_0x5400d5['data'][0x0]['\ufeff'+FIELDS[_0xb10232]];}}if(!_0x44bed2[_0x621a('0x1f')]){return _0x2a7868(handleCheckRowError('error',_0x621a('0x20'),null,_0x1f0514));}if(!_0x44bed2[_0x621a('0x21')]){return _0x2a7868(handleCheckRowError('error',_0x621a('0x22'),null,_0x1f0514));}if(_0x44bed2[_0x621a('0x23')]){var _0x373e6a=moment(_0x44bed2['birthDate'],'YYYY-MM-DD');if(!_0x373e6a[_0x621a('0x24')]()){return _0x2a7868(handleCheckRowError(_0x621a('0x14'),_0x621a('0x25'),null,_0x1f0514));}}if(_0x44bed2[_0x621a('0x26')]){if(!isEmail(_0x44bed2[_0x621a('0x26')])){return _0x2a7868(handleCheckRowError(_0x621a('0x14'),_0x621a('0x27'),null,_0x1f0514));}}_0x44bed2[_0x621a('0x28')]=LISTID;_0x44bed2['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x574fe2){var _0x19f703={};for(var _0x1ee183=0x0,_0x4d046c=DUPLICATES[_0x621a('0x1a')];_0x1ee183<_0x4d046c;_0x1ee183+=0x1){_0x19f703[DUPLICATES[_0x1ee183]]=_0x44bed2[DUPLICATES[_0x1ee183]];}var _0x3b7909=_[_0x621a('0x29')](_0x574fe2,_0x19f703);if(_0x3b7909){return _0x2a7868(handleCheckRowError(_0x621a('0x2a'),_0x621a('0x2b'),_0x3b7909,_0x1f0514));}}return db[_0x621a('0x2c')][_0x621a('0x2d')](_0x44bed2,{'raw':!![],'hooks':![],'fields':_[_0x621a('0x2e')](_0x44bed2)})[_0x621a('0x2f')](function(_0x4c363b){if(DUPLICATES&&DUPLICATES[_0x621a('0x1a')]&&_0x574fe2){_0x574fe2[_0x621a('0x30')](_[_0x621a('0x31')](_0x44bed2,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4c363b['id'];return _0x309d21();})[_0x621a('0x32')](function(_0x2f66e3){return _0x2a7868(handleCheckRowError('error',_0x621a('0x33')+(_0x2f66e3[_0x621a('0x34')]||JSON[_0x621a('0x35')](_0x2f66e3)),null,_0x1f0514));});});}function checkHopper(){function _0x297584(){return function(_0x10cd58){logger[_0x621a('0x14')](_0x621a('0x36'),_0x621a('0x37'),util[_0x621a('0x38')](_0x10cd58,{'showHidden':![],'depth':null}));};}var _0x2610fc=function(_0x23824c,_0x116e99){var _0x1e8313=squel['insert']()['into'](_0x621a('0x39'))[_0x621a('0x3a')]([_0x621a('0x21'),_0x621a('0x3b'),_0x621a('0x3c'),_0x621a('0x28'),_0x116e99,_0x621a('0x3d'),_0x621a('0x3e')],squel['select']()[_0x621a('0x3f')](_0x621a('0x21'),_0x621a('0x21'))[_0x621a('0x3f')]('NOW()',_0x621a('0x3b'))[_0x621a('0x3f')]('id',_0x621a('0x3c'))[_0x621a('0x3f')](LISTID[_0x621a('0x40')](),_0x621a('0x28'))[_0x621a('0x3f')](_0x23824c['id'][_0x621a('0x40')](),_0x116e99)[_0x621a('0x3f')](_0x621a('0x41'),_0x621a('0x3d'))[_0x621a('0x3f')]('NOW()',_0x621a('0x3e'))[_0x621a('0x42')](_0x621a('0x43'))[_0x621a('0x44')](_0x621a('0x45'))[_0x621a('0x44')](_0x621a('0x46'),LISTID[_0x621a('0x40')]())[_0x621a('0x44')](_0x621a('0x47'))[_0x621a('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x621a('0x48')]()['field'](_0x621a('0x21'))[_0x621a('0x42')](_0x621a('0x39'))[_0x621a('0x44')](_0x116e99+_0x621a('0x49'),_0x23824c['id'][_0x621a('0x40')]())))[_0x621a('0x40')]();return _0x1e8313;};var _0x31811d=function(_0x377041,_0x2f4138){var _0x482c2a=squel['insert']()[_0x621a('0x4a')](_0x621a('0x39'))[_0x621a('0x3a')](['phone','scheduledAt',_0x621a('0x3c'),_0x621a('0x28'),_0x2f4138,_0x621a('0x3d'),'updatedAt'],squel[_0x621a('0x48')]()['field'](_0x621a('0x21'),_0x621a('0x21'))['field']('NOW()',_0x621a('0x3b'))[_0x621a('0x3f')]('id',_0x621a('0x3c'))[_0x621a('0x3f')](LISTID['toString'](),_0x621a('0x28'))[_0x621a('0x3f')](_0x377041['id'][_0x621a('0x40')](),_0x2f4138)['field'](_0x621a('0x41'),'createdAt')[_0x621a('0x3f')]('NOW()',_0x621a('0x3e'))[_0x621a('0x42')]('cm_contacts')[_0x621a('0x44')](_0x621a('0x45'))[_0x621a('0x44')]('ListId\x20=\x20?',LISTID[_0x621a('0x40')]())['where'](_0x621a('0x4b'),squel[_0x621a('0x4c')](hopperContacts))[_0x621a('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x621a('0x44')](_0x621a('0x4d'),squel['select']()[_0x621a('0x3f')](_0x621a('0x4e'))[_0x621a('0x42')](_0x621a('0x4f'))[_0x621a('0x44')](_0x2f4138+_0x621a('0x49'),_0x377041['id'][_0x621a('0x40')]()))['where'](_0x621a('0x4d'),squel[_0x621a('0x48')]()['field']('phone')[_0x621a('0x42')](_0x621a('0x39'))[_0x621a('0x44')](_0x2f4138+_0x621a('0x49'),_0x377041['id'][_0x621a('0x40')]())))[_0x621a('0x40')]();return _0x482c2a;};function _0x15d4bd(_0x2282b3,_0x5b8eaa){var _0x31d589=squel['insert']()[_0x621a('0x4a')](_0x621a('0x39'))[_0x621a('0x3a')]([_0x621a('0x21'),'scheduledAt',_0x621a('0x3c'),_0x621a('0x28'),_0x5b8eaa,_0x621a('0x3d'),'updatedAt'],squel[_0x621a('0x48')]()[_0x621a('0x3f')](_0x621a('0x21'),'phone')[_0x621a('0x3f')](_0x621a('0x41'),_0x621a('0x3b'))[_0x621a('0x3f')]('id',_0x621a('0x3c'))[_0x621a('0x3f')](LISTID['toString'](),_0x621a('0x28'))[_0x621a('0x3f')](_0x2282b3['id'][_0x621a('0x40')](),_0x5b8eaa)[_0x621a('0x3f')](_0x621a('0x41'),_0x621a('0x3d'))[_0x621a('0x3f')]('NOW()',_0x621a('0x3e'))[_0x621a('0x42')](_0x621a('0x43'))['where'](_0x621a('0x45'))['where'](_0x621a('0x46'),LISTID[_0x621a('0x40')]())[_0x621a('0x44')](_0x621a('0x4b'),squel[_0x621a('0x4c')](hopperContacts))[_0x621a('0x44')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x31d589;}function _0x13ab02(_0x4e1622,_0x2f18be){var _0x28a059=squel[_0x621a('0x50')]()[_0x621a('0x4a')](_0x621a('0x51'))[_0x621a('0x3a')]([_0x621a('0x21'),_0x621a('0x3c'),_0x621a('0x28'),_0x2f18be,_0x621a('0x3d'),_0x621a('0x3e')],squel['select']()[_0x621a('0x3f')](_0x621a('0x21'),_0x621a('0x21'))[_0x621a('0x3f')]('id',_0x621a('0x3c'))[_0x621a('0x3f')](LISTID[_0x621a('0x40')](),_0x621a('0x28'))['field'](_0x4e1622['id'][_0x621a('0x40')](),_0x2f18be)[_0x621a('0x3f')](_0x621a('0x41'),_0x621a('0x3d'))[_0x621a('0x3f')](_0x621a('0x41'),_0x621a('0x3e'))[_0x621a('0x42')](_0x621a('0x43'))[_0x621a('0x44')](_0x621a('0x45'))[_0x621a('0x44')](_0x621a('0x46'),LISTID['toString']())[_0x621a('0x44')](_0x621a('0x4b'),squel[_0x621a('0x4c')](hopperContacts))[_0x621a('0x44')](_0x621a('0x47')))[_0x621a('0x40')]();return _0x28a059;}return db['VoiceQueue'][_0x621a('0x52')]({'where':{'type':'outbound'},'attributes':['id',_0x621a('0x53')],'include':[{'model':db[_0x621a('0x54')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x578a93){var _0x26f32c=[];if(_0x578a93){var _0x2c02c5;for(var _0x1c56cc=0x0,_0x11fe3a;_0x1c56cc<_0x578a93[_0x621a('0x1a')];_0x1c56cc+=0x1){_0x11fe3a=_0x578a93[_0x1c56cc][_0x621a('0x55')]({'plain':!![]});switch(_0x11fe3a[_0x621a('0x53')]){case _0x621a('0x56'):_0x26f32c['push'](db[_0x621a('0x57')][_0x621a('0x58')](_0x31811d(_0x11fe3a,_0x621a('0x59')))['then'](function(){})[_0x621a('0x32')](_0x297584()));break;case _0x621a('0x5a'):_0x26f32c[_0x621a('0x30')](db['sequelize'][_0x621a('0x58')](_0x2610fc(_0x11fe3a,_0x621a('0x59')))[_0x621a('0x2f')](function(){})[_0x621a('0x32')](_0x297584()));break;default:_0x26f32c[_0x621a('0x30')](db[_0x621a('0x57')][_0x621a('0x58')](_0x15d4bd(_0x11fe3a,_0x621a('0x59')))[_0x621a('0x2f')](function(){})['catch'](_0x297584()));}}}return _0x26f32c;})[_0x621a('0x5b')]()[_0x621a('0x2f')](function(){return db[_0x621a('0x5c')][_0x621a('0x52')]({'where':{'type':_0x621a('0x5d')},'attributes':['id'],'include':[{'model':db[_0x621a('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x621a('0x2f')](function(_0x58446d){var _0x57bda4=[];if(_0x58446d){var _0x115a10;for(var _0x837e6f=0x0,_0x3c74b7;_0x837e6f<_0x58446d['length'];_0x837e6f+=0x1){_0x3c74b7=_0x58446d[_0x837e6f]['get']({'plain':!![]});_0x57bda4[_0x621a('0x30')](db[_0x621a('0x57')][_0x621a('0x58')](_0x13ab02(_0x3c74b7,_0x621a('0x59')))[_0x621a('0x2f')](function(){})[_0x621a('0x32')](_0x297584()));}}return _0x57bda4;})[_0x621a('0x5b')]();})[_0x621a('0x2f')](function(){return db['Campaign'][_0x621a('0x52')]({'attributes':['id',_0x621a('0x53')],'include':[{'model':db[_0x621a('0x54')],'as':_0x621a('0x5e'),'where':{'id':LISTID}}]})['then'](function(_0x1f7146){var _0x1009ab=[];if(_0x1f7146){for(var _0x5559f9=0x0,_0x39e609;_0x5559f9<_0x1f7146[_0x621a('0x1a')];_0x5559f9+=0x1){_0x39e609=_0x1f7146[_0x5559f9][_0x621a('0x55')]({'plain':!![]});switch(_0x39e609[_0x621a('0x53')]){case _0x621a('0x56'):_0x1009ab[_0x621a('0x30')](db['sequelize'][_0x621a('0x58')](_0x31811d(_0x39e609,_0x621a('0x5f')))[_0x621a('0x2f')](function(){})['catch'](_0x297584()));break;case _0x621a('0x5a'):_0x1009ab[_0x621a('0x30')](db[_0x621a('0x57')]['query'](_0x2610fc(_0x39e609,_0x621a('0x5f')))[_0x621a('0x2f')](function(){})[_0x621a('0x32')](_0x297584()));break;default:_0x1009ab[_0x621a('0x30')](db[_0x621a('0x57')][_0x621a('0x58')](_0x15d4bd(_0x39e609,_0x621a('0x5f')))[_0x621a('0x2f')](function(){})[_0x621a('0x32')](_0x297584()));}}}return _0x1009ab;})[_0x621a('0x5b')]();})[_0x621a('0x2f')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x621a('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x621a('0x2f')](function(_0x40d7e3){var _0x5d7f97=[];if(_0x40d7e3){for(var _0x4e31cc=0x0,_0xed4c16;_0x4e31cc<_0x40d7e3[_0x621a('0x1a')];_0x4e31cc+=0x1){_0xed4c16=_0x40d7e3[_0x4e31cc][_0x621a('0x55')]({'plain':!![]});_0x5d7f97['push'](db[_0x621a('0x57')][_0x621a('0x58')](_0x13ab02(_0xed4c16,_0x621a('0x5f')))[_0x621a('0x2f')](function(){})['catch'](_0x297584()));}}return _0x5d7f97;})['all']();})[_0x621a('0x32')](function(_0x21afc3){logger[_0x621a('0x14')](_0x621a('0x60'),_0x621a('0x61'),_0x21afc3[_0x621a('0x34')]);});}var processPromises=function(_0x40f0f4){return BPromise[_0x621a('0x5b')](promises)[_0x621a('0x2f')](function(_0x3255c5){})[_0x621a('0x32')](function(_0x49b441){logger[_0x621a('0x14')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x49b441));})[_0x621a('0x62')](function(){socket[_0x621a('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x40f0f4){return _0x40f0f4[_0x621a('0x64')]();}});};var endCsv=function(){return BPromise[_0x621a('0x65')]()[_0x621a('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x621a('0x63')](_0x621a('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x621a('0x67')](FILEPATH);}catch(_0x547532){logger[_0x621a('0x14')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x621a('0x35')](_0x547532));}finally{process[_0x621a('0x68')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x621a('0x69'));endCsv();});function main(){return BPromise[_0x621a('0x65')]()[_0x621a('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x621a('0x11')](',');return db[_0x621a('0x2c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x4cc521){var _0x54f0c1=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x621a('0x6a')](_0x54f0c1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1d69da,_0x19d0f6){total+=0x1;var _0x17dbb2=total;promises[_0x621a('0x30')](checkRow(_0x1d69da,_0x4cc521,_0x17dbb2)[_0x621a('0x2f')](function(){success+=0x1;})[_0x621a('0x32')](function(_0x294901){if(_0x294901[_0x621a('0x14')]){errors+=0x1;delete _0x294901[_0x621a('0x14')];}else if(_0x294901[_0x621a('0x2a')]){duplicates+=0x1;delete _0x294901[_0x621a('0x2a')];}rows[_0x621a('0x30')](_0x294901);}));if(total%0xc8===0x0){_0x19d0f6[_0x621a('0x6b')]();return processPromises(_0x19d0f6);}},'complete':function(){return processPromises()[_0x621a('0x2f')](function(){logger[_0x621a('0x6c')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x537815,_0x4f0252){logger['info'](_0x621a('0x6d'),JSON[_0x621a('0x35')](_0x537815));endCsv();}});})[_0x621a('0x32')](function(_0x14d4e8){logger[_0x621a('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x621a('0x35')](_0x14d4e8));});}main();
\ No newline at end of file
+var _0x7c14=['dialCheckDuplicateType','CmList','Lists','get','sequelize','onlyIfOpen','query','VoiceQueueId','catch','all','outbound','BlackLists','Campaign','always','CampaignId','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','isNil','errors','length','map','message','hasOwnProperty','data','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','field','toString','NOW()','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7c14,0x8e));var _0x47c1=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x7c14[_0x5d6456];return _0x4d66c1;};'use strict';var BPromise=require(_0x47c1('0x0'));var util=require(_0x47c1('0x1'));var _=require(_0x47c1('0x2'));var fs=require('fs');var squel=require(_0x47c1('0x3'));var Papa=require(_0x47c1('0x4'));var Redis=require('ioredis');var db=require(_0x47c1('0x5'))['db'];var config=require(_0x47c1('0x6'));var logger=require(_0x47c1('0x7'))(_0x47c1('0x8'));config[_0x47c1('0x9')]=_[_0x47c1('0xa')](config[_0x47c1('0x9')],{'host':_0x47c1('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x47c1('0xc'))[_0x47c1('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x47c1('0xe')][0x2]==='undefined'||process['argv'][0x2]===_0x47c1('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x47c1('0xe')][0x2];if(!process['argv'][0x3]||process[_0x47c1('0xe')][0x3]===_0x47c1('0x10')||process[_0x47c1('0xe')][0x3]===_0x47c1('0xf')||!process['argv'][0x4]||process['argv'][0x4]==='undefined'||process[_0x47c1('0xe')][0x4]==='null'){throw new Error(_0x47c1('0x11'));}var FIELDS=_[_0x47c1('0x12')](process[_0x47c1('0xe')][0x3][_0x47c1('0x13')](','),process['argv'][0x4][_0x47c1('0x13')](','));if(!process[_0x47c1('0xe')][0x5]||process[_0x47c1('0xe')][0x5]==='undefined'||process[_0x47c1('0xe')][0x5]===_0x47c1('0xf')){throw new Error(_0x47c1('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x47c1('0xe')][0x6]&&process[_0x47c1('0xe')][0x6]!==_0x47c1('0x10')&&process[_0x47c1('0xe')][0x6]!==_0x47c1('0xf')?process[_0x47c1('0xe')][0x6]:null;var DUPLICATES=process[_0x47c1('0xe')][0x7]&&process[_0x47c1('0xe')][0x7]!==_0x47c1('0x10')&&process[_0x47c1('0xe')][0x7]!==_0x47c1('0xf')?process[_0x47c1('0xe')][0x7]:null;if(!process[_0x47c1('0xe')][0x8]||process[_0x47c1('0xe')][0x8]==='undefined'||process[_0x47c1('0xe')][0x8]==='null'){throw new Error(_0x47c1('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x24e6a5){logger[_0x47c1('0x16')](_0x24e6a5);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(_0x288c19,_0x5879e5,_0x3ebfe4,_0x5ae3ed){var _0x53697e={'message':_0x5879e5};_0x53697e[_0x288c19]=!![];if(_0x3ebfe4){_0x53697e['contact']=_0x3ebfe4;}if(_0x5ae3ed){_0x53697e[_0x47c1('0x17')]=_0x5ae3ed;}return _0x53697e;}function isEmail(_0x5077ac){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'](_0x5077ac);}function checkRow(_0x7da574,_0x51c722,_0x22dba2){return new BPromise(function(_0xfdea3a,_0x107993){if(_[_0x47c1('0x18')](_0x7da574)){return _0x107993(handleCheckRowError(_0x47c1('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x22dba2));}if(_0x7da574['errors']&&_0x7da574[_0x47c1('0x19')][_0x47c1('0x1a')]){var _0x1a1073=_[_0x47c1('0x1b')](_0x7da574[_0x47c1('0x19')],_0x47c1('0x1c'))['join'](';');return _0x107993(handleCheckRowError('error',_0x1a1073,null,_0x22dba2));}var _0x226b08={};for(var _0x5cd2d2 in FIELDS){if(FIELDS[_0x47c1('0x1d')](_0x5cd2d2)&&FIELDS[_0x5cd2d2]){_0x226b08[_0x5cd2d2]=_0x7da574['data'][0x0][FIELDS[_0x5cd2d2]]||_0x7da574[_0x47c1('0x1e')][0x0]['\ufeff'+FIELDS[_0x5cd2d2]];}}if(!_0x226b08['firstName']){return _0x107993(handleCheckRowError(_0x47c1('0x16'),_0x47c1('0x1f'),null,_0x22dba2));}if(!_0x226b08[_0x47c1('0x20')]){return _0x107993(handleCheckRowError(_0x47c1('0x16'),_0x47c1('0x21'),null,_0x22dba2));}if(_0x226b08[_0x47c1('0x22')]){var _0x3164f4=moment(_0x226b08[_0x47c1('0x22')],_0x47c1('0x23'));if(!_0x3164f4[_0x47c1('0x24')]()){return _0x107993(handleCheckRowError(_0x47c1('0x16'),_0x47c1('0x25'),null,_0x22dba2));}}if(_0x226b08[_0x47c1('0x26')]){if(!isEmail(_0x226b08['email'])){return _0x107993(handleCheckRowError(_0x47c1('0x16'),_0x47c1('0x27'),null,_0x22dba2));}}_0x226b08[_0x47c1('0x28')]=LISTID;_0x226b08[_0x47c1('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x51c722){var _0x1842c6={};for(var _0x507860=0x0,_0x19d129=DUPLICATES[_0x47c1('0x1a')];_0x507860<_0x19d129;_0x507860+=0x1){_0x1842c6[DUPLICATES[_0x507860]]=_0x226b08[DUPLICATES[_0x507860]];}var _0x3490d4=_[_0x47c1('0x2a')](_0x51c722,_0x1842c6);if(_0x3490d4){return _0x107993(handleCheckRowError(_0x47c1('0x2b'),_0x47c1('0x2c'),_0x3490d4,_0x22dba2));}}return db[_0x47c1('0x2d')][_0x47c1('0x2e')](_0x226b08,{'raw':!![],'hooks':![],'fields':_[_0x47c1('0x2f')](_0x226b08)})[_0x47c1('0x30')](function(_0x2d57af){if(DUPLICATES&&DUPLICATES[_0x47c1('0x1a')]&&_0x51c722){_0x51c722[_0x47c1('0x31')](_[_0x47c1('0x32')](_0x226b08,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2d57af['id'];return _0xfdea3a();})['catch'](function(_0x2ef4a6){return _0x107993(handleCheckRowError('error',_0x47c1('0x33')+(_0x2ef4a6[_0x47c1('0x1c')]||JSON[_0x47c1('0x34')](_0x2ef4a6)),null,_0x22dba2));});});}function checkHopper(){function _0x48347c(){return function(_0x18bac5){logger[_0x47c1('0x16')](_0x47c1('0x35'),'checkHopper',util[_0x47c1('0x36')](_0x18bac5,{'showHidden':![],'depth':null}));};}var _0x1bce62=function(_0x3d9582,_0x5ac391){var _0x5e1165=squel[_0x47c1('0x37')]()[_0x47c1('0x38')](_0x47c1('0x39'))[_0x47c1('0x3a')]([_0x47c1('0x20'),_0x47c1('0x3b'),_0x47c1('0x3c'),_0x47c1('0x28'),_0x5ac391,_0x47c1('0x3d'),'updatedAt'],squel['select']()[_0x47c1('0x3e')]('phone',_0x47c1('0x20'))[_0x47c1('0x3e')]('NOW()',_0x47c1('0x3b'))[_0x47c1('0x3e')]('id',_0x47c1('0x3c'))[_0x47c1('0x3e')](LISTID['toString'](),'ListId')[_0x47c1('0x3e')](_0x3d9582['id'][_0x47c1('0x3f')](),_0x5ac391)[_0x47c1('0x3e')](_0x47c1('0x40'),_0x47c1('0x3d'))[_0x47c1('0x3e')]('NOW()',_0x47c1('0x41'))[_0x47c1('0x42')](_0x47c1('0x43'))[_0x47c1('0x44')](_0x47c1('0x45'))['where'](_0x47c1('0x46'),LISTID[_0x47c1('0x3f')]())[_0x47c1('0x44')](_0x47c1('0x47'))['where'](_0x47c1('0x48'),squel[_0x47c1('0x49')]()['field']('phone')[_0x47c1('0x42')](_0x47c1('0x39'))[_0x47c1('0x44')](_0x5ac391+'\x20=\x20?',_0x3d9582['id'][_0x47c1('0x3f')]())))[_0x47c1('0x3f')]();return _0x5e1165;};var _0x1ef6e2=function(_0x7acf67,_0x2c9c47){var _0x3559e9=squel[_0x47c1('0x37')]()['into'](_0x47c1('0x39'))['fromQuery'](['phone',_0x47c1('0x3b'),_0x47c1('0x3c'),_0x47c1('0x28'),_0x2c9c47,_0x47c1('0x3d'),_0x47c1('0x41')],squel[_0x47c1('0x49')]()[_0x47c1('0x3e')](_0x47c1('0x20'),_0x47c1('0x20'))[_0x47c1('0x3e')](_0x47c1('0x40'),_0x47c1('0x3b'))[_0x47c1('0x3e')]('id',_0x47c1('0x3c'))[_0x47c1('0x3e')](LISTID['toString'](),_0x47c1('0x28'))[_0x47c1('0x3e')](_0x7acf67['id'][_0x47c1('0x3f')](),_0x2c9c47)[_0x47c1('0x3e')](_0x47c1('0x40'),_0x47c1('0x3d'))[_0x47c1('0x3e')](_0x47c1('0x40'),_0x47c1('0x41'))[_0x47c1('0x42')](_0x47c1('0x43'))[_0x47c1('0x44')](_0x47c1('0x45'))[_0x47c1('0x44')](_0x47c1('0x46'),LISTID[_0x47c1('0x3f')]())[_0x47c1('0x44')]('id\x20IN\x20?',squel[_0x47c1('0x4a')](hopperContacts))[_0x47c1('0x44')](_0x47c1('0x47'))['where'](_0x47c1('0x48'),squel[_0x47c1('0x49')]()['field'](_0x47c1('0x4b'))[_0x47c1('0x42')](_0x47c1('0x4c'))[_0x47c1('0x44')](_0x2c9c47+_0x47c1('0x4d'),_0x7acf67['id']['toString']()))[_0x47c1('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x47c1('0x49')]()[_0x47c1('0x3e')](_0x47c1('0x20'))['from'](_0x47c1('0x39'))[_0x47c1('0x44')](_0x2c9c47+_0x47c1('0x4d'),_0x7acf67['id'][_0x47c1('0x3f')]())))[_0x47c1('0x3f')]();return _0x3559e9;};function _0x4e8302(_0x7fbcfc,_0x71c792){var _0x398c06=squel[_0x47c1('0x37')]()[_0x47c1('0x38')](_0x47c1('0x39'))['fromQuery']([_0x47c1('0x20'),_0x47c1('0x3b'),_0x47c1('0x3c'),_0x47c1('0x28'),_0x71c792,_0x47c1('0x3d'),'updatedAt'],squel['select']()[_0x47c1('0x3e')](_0x47c1('0x20'),'phone')[_0x47c1('0x3e')](_0x47c1('0x40'),_0x47c1('0x3b'))[_0x47c1('0x3e')]('id',_0x47c1('0x3c'))[_0x47c1('0x3e')](LISTID[_0x47c1('0x3f')](),_0x47c1('0x28'))[_0x47c1('0x3e')](_0x7fbcfc['id'][_0x47c1('0x3f')](),_0x71c792)['field'](_0x47c1('0x40'),_0x47c1('0x3d'))[_0x47c1('0x3e')]('NOW()',_0x47c1('0x41'))[_0x47c1('0x42')](_0x47c1('0x43'))[_0x47c1('0x44')](_0x47c1('0x45'))[_0x47c1('0x44')]('ListId\x20=\x20?',LISTID['toString']())[_0x47c1('0x44')]('id\x20IN\x20?',squel[_0x47c1('0x4a')](hopperContacts))[_0x47c1('0x44')](_0x47c1('0x47')))['toString']();return _0x398c06;}function _0x49a1e8(_0x426d9a,_0x3e9262){var _0x11622d=squel[_0x47c1('0x37')]()[_0x47c1('0x38')](_0x47c1('0x4e'))[_0x47c1('0x3a')]([_0x47c1('0x20'),_0x47c1('0x3c'),'ListId',_0x3e9262,_0x47c1('0x3d'),_0x47c1('0x41')],squel[_0x47c1('0x49')]()[_0x47c1('0x3e')](_0x47c1('0x20'),_0x47c1('0x20'))[_0x47c1('0x3e')]('id',_0x47c1('0x3c'))[_0x47c1('0x3e')](LISTID[_0x47c1('0x3f')](),'ListId')['field'](_0x426d9a['id']['toString'](),_0x3e9262)[_0x47c1('0x3e')](_0x47c1('0x40'),_0x47c1('0x3d'))[_0x47c1('0x3e')]('NOW()',_0x47c1('0x41'))[_0x47c1('0x42')](_0x47c1('0x43'))['where'](_0x47c1('0x45'))[_0x47c1('0x44')]('ListId\x20=\x20?',LISTID[_0x47c1('0x3f')]())[_0x47c1('0x44')](_0x47c1('0x4f'),squel[_0x47c1('0x4a')](hopperContacts))[_0x47c1('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x47c1('0x3f')]();return _0x11622d;}return db[_0x47c1('0x50')][_0x47c1('0x51')]({'where':{'type':'outbound'},'attributes':['id',_0x47c1('0x52')],'include':[{'model':db[_0x47c1('0x53')],'as':_0x47c1('0x54'),'where':{'id':LISTID}}]})['then'](function(_0x26f137){var _0x46d5eb=[];if(_0x26f137){var _0x420174;for(var _0x2eea12=0x0,_0x3d495e;_0x2eea12<_0x26f137[_0x47c1('0x1a')];_0x2eea12+=0x1){_0x3d495e=_0x26f137[_0x2eea12][_0x47c1('0x55')]({'plain':!![]});switch(_0x3d495e[_0x47c1('0x52')]){case'always':_0x46d5eb['push'](db[_0x47c1('0x56')]['query'](_0x1ef6e2(_0x3d495e,'VoiceQueueId'))['then'](function(){})['catch'](_0x48347c()));break;case _0x47c1('0x57'):_0x46d5eb[_0x47c1('0x31')](db[_0x47c1('0x56')][_0x47c1('0x58')](_0x1bce62(_0x3d495e,_0x47c1('0x59')))[_0x47c1('0x30')](function(){})[_0x47c1('0x5a')](_0x48347c()));break;default:_0x46d5eb[_0x47c1('0x31')](db[_0x47c1('0x56')][_0x47c1('0x58')](_0x4e8302(_0x3d495e,_0x47c1('0x59')))[_0x47c1('0x30')](function(){})[_0x47c1('0x5a')](_0x48347c()));}}}return _0x46d5eb;})[_0x47c1('0x5b')]()[_0x47c1('0x30')](function(){return db[_0x47c1('0x50')][_0x47c1('0x51')]({'where':{'type':_0x47c1('0x5c')},'attributes':['id'],'include':[{'model':db[_0x47c1('0x53')],'as':_0x47c1('0x5d'),'where':{'id':LISTID}}]})[_0x47c1('0x30')](function(_0x5c2756){var _0x55ed91=[];if(_0x5c2756){var _0x1a8597;for(var _0x11b403=0x0,_0x2eb8d7;_0x11b403<_0x5c2756['length'];_0x11b403+=0x1){_0x2eb8d7=_0x5c2756[_0x11b403][_0x47c1('0x55')]({'plain':!![]});_0x55ed91[_0x47c1('0x31')](db['sequelize'][_0x47c1('0x58')](_0x49a1e8(_0x2eb8d7,_0x47c1('0x59')))[_0x47c1('0x30')](function(){})['catch'](_0x48347c()));}}return _0x55ed91;})[_0x47c1('0x5b')]();})['then'](function(){return db[_0x47c1('0x5e')][_0x47c1('0x51')]({'attributes':['id',_0x47c1('0x52')],'include':[{'model':db[_0x47c1('0x53')],'as':_0x47c1('0x54'),'where':{'id':LISTID}}]})[_0x47c1('0x30')](function(_0x248a6d){var _0xb9d116=[];if(_0x248a6d){for(var _0x510653=0x0,_0x2088e4;_0x510653<_0x248a6d[_0x47c1('0x1a')];_0x510653+=0x1){_0x2088e4=_0x248a6d[_0x510653][_0x47c1('0x55')]({'plain':!![]});switch(_0x2088e4[_0x47c1('0x52')]){case _0x47c1('0x5f'):_0xb9d116[_0x47c1('0x31')](db['sequelize'][_0x47c1('0x58')](_0x1ef6e2(_0x2088e4,_0x47c1('0x60')))[_0x47c1('0x30')](function(){})[_0x47c1('0x5a')](_0x48347c()));break;case'onlyIfOpen':_0xb9d116[_0x47c1('0x31')](db['sequelize']['query'](_0x1bce62(_0x2088e4,_0x47c1('0x60')))[_0x47c1('0x30')](function(){})['catch'](_0x48347c()));break;default:_0xb9d116[_0x47c1('0x31')](db[_0x47c1('0x56')]['query'](_0x4e8302(_0x2088e4,_0x47c1('0x60')))[_0x47c1('0x30')](function(){})[_0x47c1('0x5a')](_0x48347c()));}}}return _0xb9d116;})[_0x47c1('0x5b')]();})['then'](function(){return db['Campaign'][_0x47c1('0x51')]({'attributes':['id'],'include':[{'model':db[_0x47c1('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x47c1('0x30')](function(_0x42025f){var _0x28bbf2=[];if(_0x42025f){for(var _0xb1fb6c=0x0,_0x3afee4;_0xb1fb6c<_0x42025f[_0x47c1('0x1a')];_0xb1fb6c+=0x1){_0x3afee4=_0x42025f[_0xb1fb6c][_0x47c1('0x55')]({'plain':!![]});_0x28bbf2['push'](db[_0x47c1('0x56')]['query'](_0x49a1e8(_0x3afee4,_0x47c1('0x60')))[_0x47c1('0x30')](function(){})[_0x47c1('0x5a')](_0x48347c()));}}return _0x28bbf2;})[_0x47c1('0x5b')]();})[_0x47c1('0x5a')](function(_0x239c32){logger[_0x47c1('0x16')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x239c32[_0x47c1('0x1c')]);});}var processPromises=function(_0x4ed14b){return BPromise[_0x47c1('0x5b')](promises)[_0x47c1('0x30')](function(_0x1bc89e){})['catch'](function(_0x24fe8a){logger[_0x47c1('0x16')](_0x47c1('0x61'),JSON['stringify'](_0x24fe8a));})[_0x47c1('0x62')](function(){socket[_0x47c1('0x63')](_0x47c1('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4ed14b){return _0x4ed14b[_0x47c1('0x65')]();}});};var endCsv=function(){return BPromise[_0x47c1('0x66')]()[_0x47c1('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0x47c1('0x30')](function(){socket[_0x47c1('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x47c1('0x67')](FILEPATH);}catch(_0x43c6f1){logger[_0x47c1('0x16')](_0x47c1('0x68'),JSON[_0x47c1('0x34')](_0x43c6f1));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x47c1('0x69')](_0x47c1('0x6a'));endCsv();});function main(){return BPromise[_0x47c1('0x66')]()[_0x47c1('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x47c1('0x2d')][_0x47c1('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x47c1('0x30')](function(_0x151fbb){var _0x1faa93=fs[_0x47c1('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x47c1('0x6c')](_0x1faa93,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2d5393,_0x398db3){total+=0x1;var _0x592a23=total;promises[_0x47c1('0x31')](checkRow(_0x2d5393,_0x151fbb,_0x592a23)[_0x47c1('0x30')](function(){success+=0x1;})[_0x47c1('0x5a')](function(_0x439597){if(_0x439597[_0x47c1('0x16')]){errors+=0x1;delete _0x439597['error'];}else if(_0x439597[_0x47c1('0x2b')]){duplicates+=0x1;delete _0x439597[_0x47c1('0x2b')];}rows[_0x47c1('0x31')](_0x439597);}));if(total%0xc8===0x0){_0x398db3[_0x47c1('0x6d')]();return processPromises(_0x398db3);}},'complete':function(){return processPromises()[_0x47c1('0x30')](function(){logger[_0x47c1('0x69')](_0x47c1('0x6e'));endCsv();});},'error':function(_0x17f543,_0x1dca92){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x17f543));endCsv();}});})[_0x47c1('0x5a')](function(_0xcc7b3){logger[_0x47c1('0x16')](_0x47c1('0x6f'),JSON['stringify'](_0xcc7b3));});}main();
\ No newline at end of file
index d96d4a5..e7a4948 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe099=['dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','length','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','binding\x20doesn\x27t\x20exists','binding','firstName\x20is\x20mandatory','UserId','map','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ContactId','ListId','createdAt','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.createdAt','cm_hopper_black','fromQuery','updatedAt','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','toString','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','field','MIN(id)','min_id','group','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','push','catch','info','main','stringify','send','start','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','includes','email','email\x20wrong\x20format'];(function(_0x4e6afe,_0x1b4f03){var _0x7f6cc3=function(_0x363ee4){while(--_0x363ee4){_0x4e6afe['push'](_0x4e6afe['shift']());}};_0x7f6cc3(++_0x1b4f03);}(_0xe099,0x1c3));var _0x9e09=function(_0x58bcf9,_0x3fdddf){_0x58bcf9=_0x58bcf9-0x0;var _0x39209b=_0xe099[_0x58bcf9];return _0x39209b;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x9e09('0x0'));var Papa=require(_0x9e09('0x1'));var util=require(_0x9e09('0x2'));var BPromise=require(_0x9e09('0x3'));var moment=require(_0x9e09('0x4'));var squel=require('squel');var Redis=require(_0x9e09('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x9e09('0x6'));var logger=require(_0x9e09('0x7'))(_0x9e09('0x8'));config[_0x9e09('0x9')]=_[_0x9e09('0xa')](config[_0x9e09('0x9')],{'host':_0x9e09('0xb'),'port':0x18eb});var socket=require(_0x9e09('0xc'))(new Redis(config[_0x9e09('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x9e09('0xd')](_0x9e09('0xe'));function isEmail(_0xa3cbe7){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'](_0xa3cbe7);}function selectNotIn(_0x1ef0dc,_0x3414bb,_0x5da3c6,_0x3410c6,_0x1d6c66){return squel[_0x9e09('0xf')]()['field']('phone')[_0x9e09('0x10')](_0x3410c6)[_0x9e09('0x11')](_0x3414bb,null,_0x3414bb+_0x9e09('0x12')+_0x3410c6+'.'+_0x5da3c6)[_0x9e09('0x13')](_0x3410c6+'.'+_0x5da3c6+'\x20=\x20'+_0x1ef0dc+'.'+_0x5da3c6)[_0x9e09('0x13')](_0x3414bb+_0x9e09('0x14')+_0x1d6c66[_0x9e09('0x11')]()+')');}function insertCmHopper(_0x4b5585,_0x14dbda,_0x2bf705,_0x353caf,_0xb211b2){var _0x21e4f2=[_0x9e09('0x15'),'cm_contacts.scheduledat',_0x9e09('0x16'),_0x9e09('0x17'),_0x14dbda+'.'+_0x353caf,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x9e09('0x18'),_0x9e09('0x19'),'\x22'+_0xb211b2+'\x22'];return squel[_0x9e09('0x1a')]()[_0x9e09('0x1b')](_0x9e09('0x1c'))['fromQuery']([_0x9e09('0x1d'),_0x9e09('0x1e'),_0x9e09('0x1f'),_0x9e09('0x20'),_0x353caf,_0x9e09('0x21'),'updatedAt','priority','UserId','recallme'],squel[_0x9e09('0xf')]()[_0x9e09('0x22')](_0x21e4f2)[_0x9e09('0x10')](_0x14dbda)[_0x9e09('0x11')](_0x9e09('0x23'),null,'cm_contacts.ListId\x20=\x20'+_0x14dbda+_0x9e09('0x24'))[_0x9e09('0x11')](_0x2bf705,null,_0x2bf705+_0x9e09('0x12')+_0x14dbda+'.'+_0x353caf)['where'](_0x14dbda+_0x9e09('0x25'),_0x4b5585)['where'](_0x9e09('0x26'),NOW)['where'](_0x9e09('0x27'),selectNotIn(_0x14dbda,_0x2bf705,_0x353caf,'cm_hopper',[_0x9e09('0x28'),_0x9e09('0x29')]))[_0x9e09('0x13')](_0x9e09('0x27'),selectNotIn(_0x14dbda,_0x2bf705,_0x353caf,'cm_hopper',[_0x9e09('0x28')])))['toString']();}function insertCmHopperBlack(_0x29d02e,_0x2c30ba,_0x46cf78,_0x211ed2){var _0x3fd13d=['cm_contacts.phone',_0x9e09('0x16'),_0x9e09('0x17'),_0x2c30ba+'.'+_0x211ed2,_0x9e09('0x2a'),'cm_contacts.updatedAt'];return squel[_0x9e09('0x1a')]()['into'](_0x9e09('0x2b'))[_0x9e09('0x2c')](['phone',_0x9e09('0x1f'),_0x9e09('0x20'),_0x211ed2,_0x9e09('0x21'),_0x9e09('0x2d')],squel[_0x9e09('0xf')]()[_0x9e09('0x22')](_0x3fd13d)[_0x9e09('0x10')](_0x2c30ba)[_0x9e09('0x11')](_0x9e09('0x23'),null,_0x9e09('0x2e')+_0x2c30ba+_0x9e09('0x24'))[_0x9e09('0x11')](_0x46cf78,null,_0x46cf78+_0x9e09('0x12')+_0x2c30ba+'.'+_0x211ed2)[_0x9e09('0x13')](_0x2c30ba+_0x9e09('0x25'),_0x29d02e)[_0x9e09('0x13')](_0x9e09('0x26'),NOW)[_0x9e09('0x13')](_0x9e09('0x27'),squel[_0x9e09('0xf')]()['field'](_0x9e09('0x1d'))[_0x9e09('0x10')](_0x9e09('0x2b'))['where'](_0x9e09('0x2f'),_0x29d02e)[_0x9e09('0x13')](_0x211ed2+_0x9e09('0x30'),_0x2c30ba+'.'+_0x211ed2)))[_0x9e09('0x31')]();}function insertCmContact(_0x4d4ff1,_0x39ce8e,_0x32035d,_0x311758){var _0x6c15ef=_['concat'](_[_0x9e09('0x32')](_0x311758),[_0x9e09('0x20'),'CompanyId',_0x9e09('0x21'),_0x9e09('0x2d')]);return squel['insert']()[_0x9e09('0x1b')](_0x9e09('0x23'))['fromQuery'](_0x6c15ef,squel[_0x9e09('0xf')]()['fields'](_0x6c15ef)[_0x9e09('0x10')](_0x39ce8e)[_0x9e09('0x13')]('('+_0x32035d[_0x9e09('0x11')](',')+_0x9e09('0x33'),squel[_0x9e09('0xf')]()[_0x9e09('0x22')](_0x32035d)[_0x9e09('0x10')](_0x9e09('0x23'))[_0x9e09('0x13')]('ListId\x20=\x20?',_0x4d4ff1)['where'](_0x9e09('0x34')))[_0x9e09('0x13')](_0x9e09('0x35'),squel['select']()[_0x9e09('0x36')](_0x9e09('0x37'),_0x9e09('0x38'))[_0x9e09('0x10')](_0x39ce8e)[_0x9e09('0x39')](_0x32035d[_0x9e09('0x11')](','))))[_0x9e09('0x31')]();}function handleStop(){logger['info'](_0x9e09('0x3a'));stopped=!![];}function handleUncaughtException(_0x432f4f){logger[_0x9e09('0x3b')](_0x432f4f[_0x9e09('0x3c')]);process[_0x9e09('0x3d')](0x1);}function handleError(_0x1d4bc3,_0x2cc867){stats[_0x9e09('0x3e')]['push']({'name':_0x2cc867[_0x9e09('0x3f')],'message':_0x2cc867[_0x9e09('0x3c')],'row':_0x1d4bc3});}function handleQuery(_0x5933c2){logger['info'](_0x5933c2);return db[_0x9e09('0x40')][_0x9e09('0x41')](_0x5933c2)[_0x9e09('0x42')](function(_0x1f55a2){results[_0x9e09('0x43')](_0x1f55a2);})[_0x9e09('0x44')](function(_0x408e29){logger[_0x9e09('0x3b')](_0x408e29[_0x9e09('0x3c')]);});}function main(_0x3d314d,_0x388ffc,_0x49301b,_0x715e86){logger[_0x9e09('0x45')](_0x9e09('0x46'),_0x3d314d,JSON[_0x9e09('0x47')](_0x388ffc));process[_0x9e09('0x48')](_0x9e09('0x49'));var _0x20bdb9=_0x388ffc['binding'];var _0x4e9d07=_0x388ffc['socket_timestamp'];var _0x475660=path[_0x9e09('0x11')](config['root'],_0x9e09('0x4a'),_0x4e9d07+_0x9e09('0x4b'));var _0x872952=_['keys'](_0x20bdb9)[_0x9e09('0x11')]();logger[_0x9e09('0x45')](_0x9e09('0x4c'),_0x872952);fs[_0x9e09('0x4d')](_0x475660,_0x872952+'\x0a');Papa[_0x9e09('0x4e')](fs[_0x9e09('0x4f')](_0x3d314d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2be66c,_0x761e8a){try{for(var _0x2402d4=0x0,_0x1db9ec=[];_0x2402d4<_0x2be66c[_0x9e09('0x50')]['length'];_0x2402d4++){stats[_0x9e09('0x51')]+=0x1;if(_0x2be66c[_0x9e09('0x3e')][_0x2402d4]){handleError(_0x2be66c[_0x9e09('0x50')][_0x2402d4],_0x2be66c['errors'][_0x2402d4]);}else{var _0x24ee79=[];for(var _0x55beba in _0x20bdb9){if(_0x20bdb9[_0x9e09('0x52')](_0x55beba)){if(_0x2be66c[_0x9e09('0x50')][_0x2402d4][_0x20bdb9[_0x55beba]]){var _0xee0c47=_[_0x9e09('0x53')](_0x2be66c['data'][_0x2402d4][_0x20bdb9[_0x55beba]][_0x9e09('0x54')](/"/g,'\x27'));switch(_0x55beba){case _0x9e09('0x1e'):var _0x4daf9c=moment(_0xee0c47,_0x9e09('0xe'),!![]);if(_0x4daf9c[_0x9e09('0x55')]()){_0x1db9ec[_0x9e09('0x43')]('\x22'+_0xee0c47+'\x22');}else{_0x24ee79['push'](_0x9e09('0x56'));}break;case _0x9e09('0x57'):var _0x4e5567=parseInt(_0xee0c47);_0xee0c47=_[_0x9e09('0x58')](_0x4e5567)||_0x4e5567<0x0||_0x4e5567>0x4?_0x715e86?0x3:0x2:_0x4e5567;_0x1db9ec[_0x9e09('0x43')]('\x22'+_0xee0c47+'\x22');break;case'UserId':var _0x28412a=parseInt(_0xee0c47);if(_[_0x9e09('0x59')](_0x28412a)&&_[_0x9e09('0x5a')](_0x49301b,_0x28412a)){_0x1db9ec['push']('\x22'+_0x28412a+'\x22');}else{_0x24ee79[_0x9e09('0x43')]('agent\x20not\x20exists');}break;case _0x9e09('0x5b'):if(isEmail(_0xee0c47)){_0x1db9ec['push']('\x22'+_0xee0c47+'\x22');}else{_0x24ee79[_0x9e09('0x43')](_0x9e09('0x5c'));}break;case _0x9e09('0x5d'):var _0x2e036d=moment(_0xee0c47,_0x9e09('0x5e'),!![]);if(_0x2e036d[_0x9e09('0x55')]()){_0x1db9ec[_0x9e09('0x43')]('\x22'+_0xee0c47+'\x22');}else{_0x24ee79['push'](_0x9e09('0x5f'));}break;default:_0x1db9ec[_0x9e09('0x43')]('\x22'+_0xee0c47+'\x22');}}else{switch(_0x55beba){case _0x9e09('0x60'):case _0x9e09('0x1d'):_0x24ee79['push'](_0x55beba+'\x20not\x20specified');break;default:_0x1db9ec[_0x9e09('0x43')]('\x22\x22');}}}}if(_0x24ee79[_0x9e09('0x61')]){handleError(_0x2be66c[_0x9e09('0x50')][_0x2402d4],{'code':_0x9e09('0x62'),'message':_0x24ee79[_0x9e09('0x11')]()});}else{fs[_0x9e09('0x63')](_0x475660,_0x1db9ec[_0x9e09('0x11')]()+'\x0a');}_0x1db9ec=[];}if(!(stats[_0x9e09('0x51')]%0xc8)){socket[_0x9e09('0x64')]('contact:import:'+_0x4e9d07,stats);stats[_0x9e09('0x3e')]=[];}}if(stopped){logger[_0x9e09('0x45')](_0x9e09('0x65'));_0x761e8a[_0x9e09('0x66')]();}}catch(_0x4cea0c){handleError(_0x2be66c[_0x9e09('0x50')][_0x2402d4],{'code':_0x9e09('0x67'),'message':_0x4cea0c['message']});logger[_0x9e09('0x3b')](_0x9e09('0x68'),_0x4cea0c[_0x9e09('0x3c')]);}},'complete':function(){try{var _0x418e4c=[];var _0x424bb9=_0x9e09('0x23');if(_0x388ffc['duplicates']&&_0x388ffc[_0x9e09('0x69')][_0x9e09('0x61')]){_0x424bb9=_0x9e09('0x6a')+_0x4e9d07;_0x418e4c[_0x9e09('0x43')](_0x9e09('0x6b')+_0x424bb9+_0x9e09('0x6c'));}var _0x258452=util[_0x9e09('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',_0x475660,_0x424bb9,_0x872952,_0x388ffc[_0x9e09('0x20')],_0x388ffc[_0x9e09('0x6d')]||null,NOW,NOW);if(_[_0x9e09('0x6e')](_0x20bdb9[_0x9e09('0x1e')])){_0x258452+=_0x9e09('0x6f');}_0x418e4c[_0x9e09('0x43')](_0x258452);if(_0x388ffc[_0x9e09('0x69')]&&_0x388ffc[_0x9e09('0x69')][_0x9e09('0x61')]){_0x418e4c[_0x9e09('0x43')](insertCmContact(_0x388ffc[_0x9e09('0x20')],_0x424bb9,_0x388ffc[_0x9e09('0x69')],_0x20bdb9));_0x418e4c[_0x9e09('0x43')](_0x9e09('0x70')+_0x424bb9+';');}_0x418e4c['push'](insertCmHopper(_0x388ffc[_0x9e09('0x20')],'voice_queues_has_cm_lists',_0x9e09('0x71'),_0x9e09('0x72'),_0x715e86));_0x418e4c[_0x9e09('0x43')](insertCmHopperBlack(_0x388ffc[_0x9e09('0x20')],'voice_queues_has_cm_blacklists',_0x9e09('0x71'),_0x9e09('0x72')));_0x418e4c[_0x9e09('0x43')](insertCmHopper(_0x388ffc[_0x9e09('0x20')],_0x9e09('0x73'),_0x9e09('0x74'),'CampaignId',_0x715e86));_0x418e4c['push'](insertCmHopperBlack(_0x388ffc['ListId'],_0x9e09('0x75'),'campaigns',_0x9e09('0x76')));BPromise['each'](_0x418e4c,handleQuery)[_0x9e09('0x77')](function(_0x3bb6d4){stats[_0x9e09('0x78')]=!![];stats[_0x9e09('0x79')]=_0x388ffc[_0x9e09('0x69')]&&_0x388ffc['duplicates'][_0x9e09('0x61')]?results[0x2][_0x9e09('0x79')]:results[0x0]['affectedRows'];socket[_0x9e09('0x64')](_0x9e09('0x7a')+_0x4e9d07,stats);fs['unlink'](_0x3d314d);fs[_0x9e09('0x7b')](_0x475660);process[_0x9e09('0x3d')](0x0);})[_0x9e09('0x44')](function(_0x59dfdf){logger[_0x9e09('0x3b')](_0x59dfdf[_0x9e09('0x3c')]);process['exit'](0x1);});}catch(_0x14b3e5){logger[_0x9e09('0x3b')](_0x9e09('0x7c'),_0x14b3e5[_0x9e09('0x3c')]);process[_0x9e09('0x3d')](0x1);}},'error':function(_0x30b994,_0x191352,_0x1ead2e,_0x529c9e){throw new Error(_0x529c9e);}});}function validate(){if(process[_0x9e09('0x7d')]&&process[_0x9e09('0x7d')]['length']<0x4){throw new Error(_0x9e09('0x7e'));}var _0x778f76=path[_0x9e09('0x11')](config[_0x9e09('0x7f')],'server/files/tmp',process[_0x9e09('0x7d')][0x2]);if(!fs[_0x9e09('0x80')](_0x778f76)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x38a897={};try{_0x38a897=JSON['parse'](process['argv'][0x3]);if(!_0x38a897['binding']){throw new Error(_0x9e09('0x81'));}if(!_0x38a897[_0x9e09('0x82')][_0x9e09('0x1d')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x38a897[_0x9e09('0x82')][_0x9e09('0x60')]){throw new Error(_0x9e09('0x83'));}var _0x15b735=0x0;if(_0x38a897[_0x9e09('0x82')][_0x9e09('0x84')]){_0x15b735=0x1;}if(!_0x38a897['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x22f7c){throw new Error('body\x20id\x20mandatory');}var _0x235493=[];try{_0x235493=_[_0x9e09('0x85')](JSON[_0x9e09('0x4e')](process[_0x9e09('0x7d')][0x4]),'id');}catch(_0x3e464f){logger['info']('No\x20agent\x20available');}main(_0x778f76,_0x38a897,_0x235493,_0x15b735);}validate();process['on'](_0x9e09('0x86'),handleStop);process['on'](_0x9e09('0x87'),handleUncaughtException);
\ No newline at end of file
+var _0xe37d=['cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','createdAt','fields','cm_contacts.ListId\x20=\x20','cm_hopper_black','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','info','Received\x20SIGINT','error','message','exit','errors','sequelize','query','spread','push','main','stringify','send','start','socket_timestamp','root','.csv','writeFileSync','parse','createReadStream','data','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','appendFileSync','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil','scheduledat',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','each','then','affectedRows','emit','contact:import:','unlink','catch','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','existsSync','binding','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xe37d,0x1ee));var _0xde37=function(_0x54a0d5,_0x151c25){_0x54a0d5=_0x54a0d5-0x0;var _0x135b85=_0xe37d[_0x54a0d5];return _0x135b85;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xde37('0x0'));var Papa=require(_0xde37('0x1'));var util=require(_0xde37('0x2'));var BPromise=require(_0xde37('0x3'));var moment=require(_0xde37('0x4'));var squel=require(_0xde37('0x5'));var Redis=require(_0xde37('0x6'));var db=require(_0xde37('0x7'))['db'];var config=require(_0xde37('0x8'));var logger=require(_0xde37('0x9'))('import');config[_0xde37('0xa')]=_['defaults'](config[_0xde37('0xa')],{'host':_0xde37('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xde37('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xde37('0xc')](_0xde37('0xd'));function isEmail(_0x2b6289){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'](_0x2b6289);}function selectNotIn(_0x212852,_0x4b603e,_0x23a295,_0x2ab3da,_0x5694a6){return squel[_0xde37('0xe')]()[_0xde37('0xf')]('phone')[_0xde37('0x10')](_0x2ab3da)[_0xde37('0x11')](_0x4b603e,null,_0x4b603e+_0xde37('0x12')+_0x2ab3da+'.'+_0x23a295)[_0xde37('0x13')](_0x2ab3da+'.'+_0x23a295+_0xde37('0x14')+_0x212852+'.'+_0x23a295)[_0xde37('0x13')](_0x4b603e+_0xde37('0x15')+_0x5694a6['join']()+')');}function insertCmHopper(_0xb74d58,_0xc4441f,_0x2c39f1,_0x5a4b0a,_0x4194e7){var _0x116a82=[_0xde37('0x16'),_0xde37('0x17'),_0xde37('0x18'),_0xde37('0x19'),_0xc4441f+'.'+_0x5a4b0a,'cm_contacts.createdAt',_0xde37('0x1a'),_0xde37('0x1b'),_0xde37('0x1c'),'\x22'+_0x4194e7+'\x22'];return squel[_0xde37('0x1d')]()[_0xde37('0x1e')](_0xde37('0x1f'))[_0xde37('0x20')]([_0xde37('0x21'),'scheduledat',_0xde37('0x22'),_0xde37('0x23'),_0x5a4b0a,'createdAt',_0xde37('0x24'),_0xde37('0x25'),_0xde37('0x26'),_0xde37('0x27')],squel[_0xde37('0xe')]()['fields'](_0x116a82)[_0xde37('0x10')](_0xc4441f)[_0xde37('0x11')](_0xde37('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0xc4441f+_0xde37('0x29'))[_0xde37('0x11')](_0x2c39f1,null,_0x2c39f1+_0xde37('0x12')+_0xc4441f+'.'+_0x5a4b0a)[_0xde37('0x13')](_0xc4441f+_0xde37('0x2a'),_0xb74d58)['where'](_0xde37('0x2b'),NOW)[_0xde37('0x13')](_0xde37('0x2c'),selectNotIn(_0xc4441f,_0x2c39f1,_0x5a4b0a,'cm_hopper',[_0xde37('0x2d'),'\x22onlyIfOpen\x22']))['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xc4441f,_0x2c39f1,_0x5a4b0a,_0xde37('0x1f'),[_0xde37('0x2d')])))[_0xde37('0x2e')]();}function insertCmHopperBlack(_0x25945b,_0x2855c3,_0x2cd63b,_0x245b8f){var _0x19394f=[_0xde37('0x16'),_0xde37('0x18'),_0xde37('0x19'),_0x2855c3+'.'+_0x245b8f,'cm_contacts.createdAt',_0xde37('0x1a')];return squel[_0xde37('0x1d')]()[_0xde37('0x1e')]('cm_hopper_black')['fromQuery']([_0xde37('0x21'),'ContactId',_0xde37('0x23'),_0x245b8f,_0xde37('0x2f'),_0xde37('0x24')],squel['select']()[_0xde37('0x30')](_0x19394f)[_0xde37('0x10')](_0x2855c3)[_0xde37('0x11')]('cm_contacts',null,_0xde37('0x31')+_0x2855c3+'.CmListId')[_0xde37('0x11')](_0x2cd63b,null,_0x2cd63b+_0xde37('0x12')+_0x2855c3+'.'+_0x245b8f)[_0xde37('0x13')](_0x2855c3+'.CmListId\x20=\x20?',_0x25945b)[_0xde37('0x13')](_0xde37('0x2b'),NOW)[_0xde37('0x13')](_0xde37('0x2c'),squel[_0xde37('0xe')]()[_0xde37('0xf')](_0xde37('0x21'))[_0xde37('0x10')](_0xde37('0x32'))[_0xde37('0x13')]('ListId\x20=\x20?',_0x25945b)[_0xde37('0x13')](_0x245b8f+_0xde37('0x33'),_0x2855c3+'.'+_0x245b8f)))[_0xde37('0x2e')]();}function insertCmContact(_0x332f5a,_0x237729,_0x14543b,_0x1412e4){var _0x5a4fff=_[_0xde37('0x34')](_[_0xde37('0x35')](_0x1412e4),[_0xde37('0x23'),'CompanyId','createdAt','updatedAt']);return squel['insert']()[_0xde37('0x1e')](_0xde37('0x28'))[_0xde37('0x20')](_0x5a4fff,squel[_0xde37('0xe')]()['fields'](_0x5a4fff)[_0xde37('0x10')](_0x237729)[_0xde37('0x13')]('('+_0x14543b[_0xde37('0x11')](',')+_0xde37('0x36'),squel[_0xde37('0xe')]()['fields'](_0x14543b)[_0xde37('0x10')](_0xde37('0x28'))['where'](_0xde37('0x37'),_0x332f5a)[_0xde37('0x13')](_0xde37('0x38')))['where']('id\x20IN\x20?',squel[_0xde37('0xe')]()[_0xde37('0xf')](_0xde37('0x39'),'min_id')[_0xde37('0x10')](_0x237729)['group'](_0x14543b[_0xde37('0x11')](','))))[_0xde37('0x2e')]();}function handleStop(){logger[_0xde37('0x3a')](_0xde37('0x3b'));stopped=!![];}function handleUncaughtException(_0xd3ed70){logger[_0xde37('0x3c')](_0xd3ed70[_0xde37('0x3d')]);process[_0xde37('0x3e')](0x1);}function handleError(_0x49b3b2,_0x1d25bb){stats[_0xde37('0x3f')]['push']({'name':_0x1d25bb['code'],'message':_0x1d25bb[_0xde37('0x3d')],'row':_0x49b3b2});}function handleQuery(_0x5118c1){logger[_0xde37('0x3a')](_0x5118c1);return db[_0xde37('0x40')][_0xde37('0x41')](_0x5118c1)[_0xde37('0x42')](function(_0x43115a){results[_0xde37('0x43')](_0x43115a);})['catch'](function(_0xc2bdc5){logger[_0xde37('0x3c')](_0xc2bdc5[_0xde37('0x3d')]);});}function main(_0x34eb15,_0x3be3fd,_0x32b599,_0x5d1058){logger[_0xde37('0x3a')](_0xde37('0x44'),_0x34eb15,JSON[_0xde37('0x45')](_0x3be3fd));process[_0xde37('0x46')](_0xde37('0x47'));var _0xcebf7=_0x3be3fd['binding'];var _0x293bfd=_0x3be3fd[_0xde37('0x48')];var _0x652add=path[_0xde37('0x11')](config[_0xde37('0x49')],'server/files/tmp',_0x293bfd+_0xde37('0x4a'));var _0x1aa6d4=_[_0xde37('0x35')](_0xcebf7)[_0xde37('0x11')]();logger[_0xde37('0x3a')]('header',_0x1aa6d4);fs[_0xde37('0x4b')](_0x652add,_0x1aa6d4+'\x0a');Papa[_0xde37('0x4c')](fs[_0xde37('0x4d')](_0x34eb15),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5ed687,_0x3fb18a){try{for(var _0x5dddf5=0x0,_0x2f911b=[];_0x5dddf5<_0x5ed687[_0xde37('0x4e')]['length'];_0x5dddf5++){stats[_0xde37('0x4f')]+=0x1;if(_0x5ed687[_0xde37('0x3f')][_0x5dddf5]){handleError(_0x5ed687[_0xde37('0x4e')][_0x5dddf5],_0x5ed687[_0xde37('0x3f')][_0x5dddf5]);}else{var _0x29b7c2=[];for(var _0x28a2d9 in _0xcebf7){if(_0xcebf7['hasOwnProperty'](_0x28a2d9)){if(_0x5ed687[_0xde37('0x4e')][_0x5dddf5][_0xcebf7[_0x28a2d9]]){var _0x55af99=_[_0xde37('0x50')](_0x5ed687['data'][_0x5dddf5][_0xcebf7[_0x28a2d9]][_0xde37('0x51')](/"/g,'\x27'));switch(_0x28a2d9){case'scheduledat':var _0x3aa2a7=moment(_0x55af99,_0xde37('0xd'),!![]);if(_0x3aa2a7[_0xde37('0x52')]()){_0x2f911b[_0xde37('0x43')]('\x22'+_0x55af99+'\x22');}else{_0x29b7c2[_0xde37('0x43')](_0xde37('0x53'));}break;case _0xde37('0x25'):var _0x432aee=parseInt(_0x55af99);_0x55af99=_['isNaN'](_0x432aee)||_0x432aee<0x0||_0x432aee>0x4?_0x5d1058?0x3:0x2:_0x432aee;_0x2f911b['push']('\x22'+_0x55af99+'\x22');break;case _0xde37('0x26'):var _0x59c6f9=parseInt(_0x55af99);if(_[_0xde37('0x54')](_0x59c6f9)&&_[_0xde37('0x55')](_0x32b599,_0x59c6f9)){_0x2f911b[_0xde37('0x43')]('\x22'+_0x59c6f9+'\x22');}else{_0x29b7c2[_0xde37('0x43')](_0xde37('0x56'));}break;case _0xde37('0x57'):if(isEmail(_0x55af99)){_0x2f911b[_0xde37('0x43')]('\x22'+_0x55af99+'\x22');}else{_0x29b7c2['push'](_0xde37('0x58'));}break;case'dateOfBirth':var _0x30def5=moment(_0x55af99,_0xde37('0x59'),!![]);if(_0x30def5[_0xde37('0x52')]()){_0x2f911b[_0xde37('0x43')]('\x22'+_0x55af99+'\x22');}else{_0x29b7c2['push'](_0xde37('0x5a'));}break;default:_0x2f911b[_0xde37('0x43')]('\x22'+_0x55af99+'\x22');}}else{switch(_0x28a2d9){case _0xde37('0x5b'):case _0xde37('0x21'):_0x29b7c2[_0xde37('0x43')](_0x28a2d9+_0xde37('0x5c'));break;default:_0x2f911b[_0xde37('0x43')]('\x22\x22');}}}}if(_0x29b7c2[_0xde37('0x5d')]){handleError(_0x5ed687['data'][_0x5dddf5],{'code':'SystemRow','message':_0x29b7c2[_0xde37('0x11')]()});}else{fs[_0xde37('0x5e')](_0x652add,_0x2f911b[_0xde37('0x11')]()+'\x0a');}_0x2f911b=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x293bfd,stats);stats[_0xde37('0x3f')]=[];}}if(stopped){logger[_0xde37('0x3a')](_0xde37('0x5f'));_0x3fb18a['abort']();}}catch(_0x4876c8){handleError(_0x5ed687[_0xde37('0x4e')][_0x5dddf5],{'code':_0xde37('0x60'),'message':_0x4876c8['message']});logger[_0xde37('0x3c')](_0xde37('0x61'),_0x4876c8[_0xde37('0x3d')]);}},'complete':function(){try{var _0x65fa3d=[];var _0x76972=_0xde37('0x28');if(_0x3be3fd['duplicates']&&_0x3be3fd[_0xde37('0x62')][_0xde37('0x5d')]){_0x76972=_0xde37('0x63')+_0x293bfd;_0x65fa3d['push'](_0xde37('0x64')+_0x76972+_0xde37('0x65'));}var _0x1e9fd6=util[_0xde37('0xc')](_0xde37('0x66'),_0x652add,_0x76972,_0x1aa6d4,_0x3be3fd[_0xde37('0x23')],_0x3be3fd[_0xde37('0x67')]||null,NOW,NOW);if(_[_0xde37('0x68')](_0xcebf7[_0xde37('0x69')])){_0x1e9fd6+=_0xde37('0x6a');}_0x65fa3d[_0xde37('0x43')](_0x1e9fd6);if(_0x3be3fd[_0xde37('0x62')]&&_0x3be3fd[_0xde37('0x62')][_0xde37('0x5d')]){_0x65fa3d[_0xde37('0x43')](insertCmContact(_0x3be3fd[_0xde37('0x23')],_0x76972,_0x3be3fd['duplicates'],_0xcebf7));_0x65fa3d[_0xde37('0x43')]('DROP\x20TABLE\x20'+_0x76972+';');}_0x65fa3d[_0xde37('0x43')](insertCmHopper(_0x3be3fd[_0xde37('0x23')],_0xde37('0x6b'),_0xde37('0x6c'),_0xde37('0x6d'),_0x5d1058));_0x65fa3d[_0xde37('0x43')](insertCmHopperBlack(_0x3be3fd[_0xde37('0x23')],_0xde37('0x6e'),_0xde37('0x6c'),_0xde37('0x6d')));_0x65fa3d['push'](insertCmHopper(_0x3be3fd[_0xde37('0x23')],_0xde37('0x6f'),_0xde37('0x70'),'CampaignId',_0x5d1058));_0x65fa3d[_0xde37('0x43')](insertCmHopperBlack(_0x3be3fd[_0xde37('0x23')],'campaigns_has_cm_blacklists',_0xde37('0x70'),'CampaignId'));BPromise[_0xde37('0x71')](_0x65fa3d,handleQuery)[_0xde37('0x72')](function(_0x427b33){stats['finish']=!![];stats[_0xde37('0x73')]=_0x3be3fd[_0xde37('0x62')]&&_0x3be3fd['duplicates'][_0xde37('0x5d')]?results[0x2][_0xde37('0x73')]:results[0x0]['affectedRows'];socket[_0xde37('0x74')](_0xde37('0x75')+_0x293bfd,stats);fs[_0xde37('0x76')](_0x34eb15);fs['unlink'](_0x652add);process[_0xde37('0x3e')](0x0);})[_0xde37('0x77')](function(_0xffc9fc){logger[_0xde37('0x3c')](_0xffc9fc[_0xde37('0x3d')]);process[_0xde37('0x3e')](0x1);});}catch(_0x41ac33){logger[_0xde37('0x3c')](_0xde37('0x78'),_0x41ac33[_0xde37('0x3d')]);process[_0xde37('0x3e')](0x1);}},'error':function(_0x2212ee,_0x47d5e1,_0xa01414,_0x4fb296){throw new Error(_0x4fb296);}});}function validate(){if(process[_0xde37('0x79')]&&process[_0xde37('0x79')][_0xde37('0x5d')]<0x4){throw new Error(_0xde37('0x7a'));}var _0x1f670f=path[_0xde37('0x11')](config['root'],_0xde37('0x7b'),process[_0xde37('0x79')][0x2]);if(!fs[_0xde37('0x7c')](_0x1f670f)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x35ae37={};try{_0x35ae37=JSON[_0xde37('0x4c')](process[_0xde37('0x79')][0x3]);if(!_0x35ae37[_0xde37('0x7d')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x35ae37[_0xde37('0x7d')][_0xde37('0x21')]){throw new Error(_0xde37('0x7e'));}if(!_0x35ae37[_0xde37('0x7d')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x3eaea0=0x0;if(_0x35ae37['binding'][_0xde37('0x26')]){_0x3eaea0=0x1;}if(!_0x35ae37['ListId']){throw new Error(_0xde37('0x7f'));}}catch(_0x3a75e5){throw new Error('body\x20id\x20mandatory');}var _0x296166=[];try{_0x296166=_['map'](JSON[_0xde37('0x4c')](process['argv'][0x4]),'id');}catch(_0x4fd1c3){logger[_0xde37('0x3a')]('No\x20agent\x20available');}main(_0x1f670f,_0x35ae37,_0x296166,_0x3eaea0);}validate();process['on'](_0xde37('0x80'),handleStop);process['on'](_0xde37('0x81'),handleUncaughtException);
\ No newline at end of file
index c90f5d0..fc5abc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x582a=['agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','voice','push','queue','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','toLowerCase','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Call\x20To','destexten','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete'];(function(_0x50c68a,_0x51dfce){var _0x4cd7ca=function(_0x17c95b){while(--_0x17c95b){_0x50c68a['push'](_0x50c68a['shift']());}};_0x4cd7ca(++_0x51dfce);}(_0x582a,0xf7));var _0xa582=function(_0x2b6c91,_0x34c301){_0x2b6c91=_0x2b6c91-0x0;var _0x5a7c40=_0x582a[_0x2b6c91];return _0x5a7c40;};'use strict';exports[_0xa582('0x0')]=function(_0x584f8c,_0x44d241){var _0x1480db=[{'type':_0xa582('0x1'),'content':_0xa582('0x2'),'variableName':null}];switch(_0x584f8c['toLowerCase']()){case _0xa582('0x3'):switch(_0x44d241['toLowerCase']()){case'inbound':_0x1480db[_0xa582('0x4')]({'type':'variable','content':'','variableName':_0xa582('0x5')});_0x1480db[_0xa582('0x4')]({'type':_0xa582('0x6'),'content':'','variableName':_0xa582('0x7')});break;case _0xa582('0x8'):_0x1480db[_0xa582('0x4')]({'type':_0xa582('0x1'),'content':_0xa582('0x9'),'variableName':null});_0x1480db[_0xa582('0x4')]({'type':_0xa582('0x6'),'content':'','variableName':_0xa582('0xa')});break;}}return _0x1480db;};exports['getDescriptions']=function(_0x4d1e35,_0x414186){var _0x555a8c=[];switch(_0x4d1e35[_0xa582('0xb')]()){case'voice':switch(_0x414186[_0xa582('0xb')]()){case'inbound':_0x555a8c=[{'type':_0xa582('0x1'),'content':_0xa582('0xc'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa582('0xd'),'keyType':_0xa582('0x6'),'variableName':_0xa582('0x7')},{'type':_0xa582('0xe'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':'calleridname'},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0xf'),'keyType':'variable','variableName':_0xa582('0x10')},{'type':'keyValue','content':'','key':'Queue','keyType':_0xa582('0x6'),'variableName':_0xa582('0x5')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x11'),'keyType':_0xa582('0x6'),'variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xa582('0x12'),'keyType':_0xa582('0x6'),'variableName':_0xa582('0x13')},{'type':'string','content':_0xa582('0x14'),'key':null,'keyType':null,'variableName':null},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x15'),'keyType':'variable','variableName':_0xa582('0x16')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x17'),'keyType':'variable','variableName':_0xa582('0xa')},{'type':'string','content':_0xa582('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x19'),'keyType':'variable','variableName':_0xa582('0x13')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x1a'),'keyType':_0xa582('0x6'),'variableName':_0xa582('0x1b')},{'type':'keyValue','content':'','key':_0xa582('0x1c'),'keyType':'variable','variableName':_0xa582('0x1d')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x1e'),'keyType':'variable','variableName':_0xa582('0x1f')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x20'),'keyType':_0xa582('0x6'),'variableName':_0xa582('0x21')}];break;case'outbound':_0x555a8c=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x22'),'keyType':_0xa582('0x6'),'keyContent':'','variableName':_0xa582('0xa')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x23'),'keyType':_0xa582('0x6'),'keyContent':'','variableName':_0xa582('0x24')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x11'),'keyType':_0xa582('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0xa582('0xe'),'content':'','key':'Date','keyType':_0xa582('0x6'),'keyContent':'','variableName':_0xa582('0x25')},{'type':_0xa582('0x1'),'content':_0xa582('0x18')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x26'),'keyType':_0xa582('0x6'),'keyContent':'','variableName':_0xa582('0x27')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x28'),'keyType':_0xa582('0x6'),'keyContent':'','variableName':_0xa582('0x29')},{'type':_0xa582('0xe'),'content':'','key':_0xa582('0x2a'),'keyType':'variable','keyContent':'','variableName':_0xa582('0x2b')},{'type':'keyValue','content':'','key':_0xa582('0x2c'),'keyType':_0xa582('0x6'),'keyContent':'','variableName':_0xa582('0x2d')}];break;}}return _0x555a8c;};
\ No newline at end of file
+var _0x15a4=['Date','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','getSubjects','toLowerCase','push','variable','calleridnum','string','Outbound\x20Call','getDescriptions','voice','inbound','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','queue','uniqueid','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridnum','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','UniqueId'];(function(_0x28be69,_0x2aadcf){var _0x549629=function(_0x3273e3){while(--_0x3273e3){_0x28be69['push'](_0x28be69['shift']());}};_0x549629(++_0x2aadcf);}(_0x15a4,0x1f2));var _0x415a=function(_0x4961d2,_0x3d44fb){_0x4961d2=_0x4961d2-0x0;var _0x2bb015=_0x15a4[_0x4961d2];return _0x2bb015;};'use strict';exports[_0x415a('0x0')]=function(_0x4cfb39,_0x335ccd){var _0x4986e1=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4cfb39['toLowerCase']()){case'voice':switch(_0x335ccd[_0x415a('0x1')]()){case'inbound':_0x4986e1[_0x415a('0x2')]({'type':_0x415a('0x3'),'content':'','variableName':'queue'});_0x4986e1['push']({'type':_0x415a('0x3'),'content':'','variableName':_0x415a('0x4')});break;case'outbound':_0x4986e1['push']({'type':_0x415a('0x5'),'content':_0x415a('0x6'),'variableName':null});_0x4986e1[_0x415a('0x2')]({'type':_0x415a('0x3'),'content':'','variableName':'destcalleridnum'});break;}}return _0x4986e1;};exports[_0x415a('0x7')]=function(_0x203b8c,_0x213cd7){var _0x21abe8=[];switch(_0x203b8c['toLowerCase']()){case _0x415a('0x8'):switch(_0x213cd7['toLowerCase']()){case _0x415a('0x9'):_0x21abe8=[{'type':_0x415a('0x5'),'content':_0x415a('0xa'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x415a('0xb'),'keyType':_0x415a('0x3'),'variableName':'calleridnum'},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0xd'),'keyType':_0x415a('0x3'),'variableName':_0x415a('0xe')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0xf'),'keyType':_0x415a('0x3'),'variableName':'destexten'},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x10'),'keyType':'variable','variableName':_0x415a('0x11')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x415a('0x3'),'variableName':_0x415a('0x12')},{'type':_0x415a('0xc'),'content':'','key':'Date','keyType':_0x415a('0x3'),'variableName':'agentcalledAt'},{'type':_0x415a('0x5'),'content':_0x415a('0x13'),'key':null,'keyType':null,'variableName':null},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x14'),'keyType':_0x415a('0x3'),'variableName':'destcalleridname'},{'type':_0x415a('0xc'),'content':'','key':'Agent\x20Number','keyType':_0x415a('0x3'),'variableName':_0x415a('0x15')},{'type':_0x415a('0x5'),'content':_0x415a('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x415a('0x3'),'variableName':_0x415a('0x17')},{'type':'keyValue','content':'','key':_0x415a('0x18'),'keyType':_0x415a('0x3'),'variableName':_0x415a('0x19')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x1a'),'keyType':_0x415a('0x3'),'variableName':'agentcompleteAt'},{'type':_0x415a('0xc'),'content':'','key':'Hold\x20Time','keyType':_0x415a('0x3'),'variableName':_0x415a('0x1b')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x1c'),'keyType':_0x415a('0x3'),'variableName':_0x415a('0x1d')}];break;case _0x415a('0x1e'):_0x21abe8=[{'type':_0x415a('0x5'),'content':_0x415a('0xa'),'variableName':null},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x1f'),'keyType':_0x415a('0x3'),'keyContent':'','variableName':_0x415a('0x15')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x20'),'keyType':_0x415a('0x3'),'keyContent':'','variableName':_0x415a('0x21')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x22'),'keyType':'variable','keyContent':'','variableName':_0x415a('0x12')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x23'),'keyType':_0x415a('0x3'),'keyContent':'','variableName':_0x415a('0x24')},{'type':_0x415a('0x5'),'content':_0x415a('0x16')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x25'),'keyType':_0x415a('0x3'),'keyContent':'','variableName':_0x415a('0x26')},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x27'),'keyType':_0x415a('0x3'),'keyContent':'','variableName':'endtime'},{'type':_0x415a('0xc'),'content':'','key':_0x415a('0x28'),'keyType':_0x415a('0x3'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':'billableseconds'}];break;}}return _0x21abe8;};
\ No newline at end of file
index c50babe..09bbc0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee93=['upperFirst','InteractionId','unknown','toUpperCase','name','stringify','findOne','info','catch','error','user','body','html','phone','lodash','../../mysqldb','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','chat-interactions'];(function(_0x6cf618,_0x359752){var _0x268365=function(_0x26ea5c){while(--_0x26ea5c){_0x6cf618['push'](_0x6cf618['shift']());}};_0x268365(++_0x359752);}(_0xee93,0x77));var _0x3ee9=function(_0x2742a5,_0x3706fc){_0x2742a5=_0x2742a5-0x0;var _0x144658=_0xee93[_0x2742a5];return _0x144658;};'use strict';var _=require(_0x3ee9('0x0'));var db=require(_0x3ee9('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x3ee9('0x2')),'mail':require(_0x3ee9('0x3'))(_0x3ee9('0x4')),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0x3ee9('0x5')),'chat':require(_0x3ee9('0x3'))(_0x3ee9('0x6')),'whatsapp':require(_0x3ee9('0x3'))('whatsapp-interactions')};function getInteractionId(_0x32bac6,_0x50764a,_0x5732de){if(_0x32bac6&&_0x32bac6[_[_0x3ee9('0x7')](_0x5732de)+_0x3ee9('0x8')]){return _0x32bac6[_[_0x3ee9('0x7')](_0x5732de)+'InteractionId'];}else if(_0x32bac6&&_0x32bac6['id']){return _0x32bac6['id'];}else if(_0x50764a&&_0x50764a['id']){return _0x50764a['id'];}else{return _0x3ee9('0x9');}}function log(_0x1e2359,_0x4a96f5,_0x1f9bbb,_0x1f7464,_0x581d2f,_0x5021de){loggers[_0x581d2f['toLowerCase']()][_0x1e2359]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5021de[_0x3ee9('0xa')](),_0x4a96f5?_0x4a96f5['id']:null,_0x4a96f5?_0x4a96f5[_0x3ee9('0xb')]:null,_0x4a96f5?_0x4a96f5['role']:null,getInteractionId(_0x1f9bbb,_0x1f7464,_0x581d2f),_0x1f9bbb?JSON[_0x3ee9('0xc')](_0x1f9bbb):'null');}function updateUser(_0x2ac2fd,_0x12ef23,_0x51eb1e,_0x4e8b15,_0x47ddb5){db[_['upperFirst'](_0x4e8b15)+'Interaction'][_0x3ee9('0xd')]({'where':{'id':getInteractionId(_0x12ef23,_0x51eb1e,_0x4e8b15)}})['then'](function(_0x51fdf6){if(_0x51fdf6){return _0x51fdf6['update']({'UserId':_0x2ac2fd?_0x2ac2fd['id']:null});}})['then'](function(_0x5707e2){if(_0x5707e2){log(_0x3ee9('0xe'),_0x2ac2fd,_0x12ef23,_0x51eb1e,_0x4e8b15,_0x47ddb5);}})[_0x3ee9('0xf')](function(){log(_0x3ee9('0x10'),_0x2ac2fd,_0x12ef23,_0x51eb1e,_0x4e8b15,_0x47ddb5);});}exports['tracked']=function(_0x3e314f,_0x4a62c3){return function(_0x4d714a,_0x17c7b2,_0x572358){var _0x4ebef8=_0x4d714a[_0x3ee9('0x11')];var _0x108df5={};var _0x3ced7c=_0x4d714a['query'];if(_0x108df5){_0x108df5=_['clone'](_0x4d714a[_0x3ee9('0x12')]);_0x108df5=_['omit'](_0x108df5,[_0x3ee9('0x12'),_0x3ee9('0x13'),_0x3ee9('0x14'),'fax','mobile']);}updateUser(_0x4ebef8,_0x108df5,_0x3ced7c,_0x3e314f,_0x4a62c3);_0x572358(null);};};
\ No newline at end of file
+var _0x859a=['fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','InteractionId','unknown','toUpperCase','name','role','stringify','null','Interaction','findOne','then','info','catch','user','body','html','mobile','lodash','../../mysqldb','openchannel-interactions','../../config/logger'];(function(_0x49b87f,_0x2ff92b){var _0x23cfe6=function(_0x36922a){while(--_0x36922a){_0x49b87f['push'](_0x49b87f['shift']());}};_0x23cfe6(++_0x2ff92b);}(_0x859a,0x1c4));var _0xa859=function(_0x381337,_0x280148){_0x381337=_0x381337-0x0;var _0x3959e2=_0x859a[_0x381337];return _0x3959e2;};'use strict';var _=require(_0xa859('0x0'));var db=require(_0xa859('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0xa859('0x2')),'mail':require(_0xa859('0x3'))('mail-interactions'),'fax':require(_0xa859('0x3'))(_0xa859('0x4')),'sms':require(_0xa859('0x3'))(_0xa859('0x5')),'chat':require(_0xa859('0x3'))(_0xa859('0x6')),'whatsapp':require('../../config/logger')(_0xa859('0x7'))};function getInteractionId(_0x456c17,_0x44fc70,_0xfcff1b){if(_0x456c17&&_0x456c17[_['upperFirst'](_0xfcff1b)+_0xa859('0x8')]){return _0x456c17[_['upperFirst'](_0xfcff1b)+_0xa859('0x8')];}else if(_0x456c17&&_0x456c17['id']){return _0x456c17['id'];}else if(_0x44fc70&&_0x44fc70['id']){return _0x44fc70['id'];}else{return _0xa859('0x9');}}function log(_0x581459,_0x668197,_0x168ff2,_0x47eef2,_0xf85657,_0x2e973e){loggers[_0xf85657['toLowerCase']()][_0x581459]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2e973e[_0xa859('0xa')](),_0x668197?_0x668197['id']:null,_0x668197?_0x668197[_0xa859('0xb')]:null,_0x668197?_0x668197[_0xa859('0xc')]:null,getInteractionId(_0x168ff2,_0x47eef2,_0xf85657),_0x168ff2?JSON[_0xa859('0xd')](_0x168ff2):_0xa859('0xe'));}function updateUser(_0x5e956d,_0x417876,_0x25f5db,_0x274be6,_0x8d0c70){db[_['upperFirst'](_0x274be6)+_0xa859('0xf')][_0xa859('0x10')]({'where':{'id':getInteractionId(_0x417876,_0x25f5db,_0x274be6)}})[_0xa859('0x11')](function(_0x1524ee){if(_0x1524ee){return _0x1524ee['update']({'UserId':_0x5e956d?_0x5e956d['id']:null});}})[_0xa859('0x11')](function(_0x4df43e){if(_0x4df43e){log(_0xa859('0x12'),_0x5e956d,_0x417876,_0x25f5db,_0x274be6,_0x8d0c70);}})[_0xa859('0x13')](function(){log('error',_0x5e956d,_0x417876,_0x25f5db,_0x274be6,_0x8d0c70);});}exports['tracked']=function(_0x44f1c6,_0x2c4418){return function(_0x45e925,_0xcc680d,_0x30053b){var _0xf26f66=_0x45e925[_0xa859('0x14')];var _0x244c94={};var _0x542c65=_0x45e925['query'];if(_0x244c94){_0x244c94=_['clone'](_0x45e925[_0xa859('0x15')]);_0x244c94=_['omit'](_0x244c94,[_0xa859('0x15'),_0xa859('0x16'),'phone','fax',_0xa859('0x17')]);}updateUser(_0xf26f66,_0x244c94,_0x542c65,_0x44f1c6,_0x2c4418);_0x30053b(null);};};
\ No newline at end of file
index 5be7503..bc1f9cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa55d=['%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','findOne','then','count','status','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr'];(function(_0x4b9803,_0x177fcb){var _0x18e58e=function(_0x3e91df){while(--_0x3e91df){_0x4b9803['push'](_0x4b9803['shift']());}};_0x18e58e(++_0x177fcb);}(_0xa55d,0xc9));var _0xda55=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa55d[_0x501510];return _0x1e6ee5;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require('composable-middleware');var db=require(_0xda55('0x0'))['db'];var config=require(_0xda55('0x1'));function getValueFromLicense(_0x1fab41,_0x25b7d9){if(_0x1fab41&&_0x25b7d9){if(_0x25b7d9[_0xda55('0x2')]&&_0x25b7d9['license']){var _0x3ef585=_0x25b7d9[_0xda55('0x2')];var _0x220331=_0x25b7d9[_0xda55('0x3')];var _0x44132c=_0x3ef585[_0xda55('0x4')]('-')[0x4];var _0x2a7ad4=_0x3ef585[_0xda55('0x4')]('-')[0x0];var _0x2a8721=crypto['createDecipher'](_0xda55('0x5'),util['format'](_0xda55('0x6'),_0x44132c,_0x3ef585,_0x2a7ad4));var _0x193eb5=_0x2a8721[_0xda55('0x7')](_0x220331,_0xda55('0x8'),'utf8');_0x193eb5+=_0x2a8721['final'](_0xda55('0x9'));var _0x1daaa7=JSON[_0xda55('0xa')](_0x193eb5);return _0x1daaa7[_0xda55('0xb')](_0x1fab41)?_0x1daaa7[_0x1fab41]:null;}}return null;}function isLimit(_0x1dabc5,_0x545573,_0x21c42e,_0x35e02d){var _0x30f452=_0x545573;return compose()['use'](function(_0x869bbc,_0x3fefff,_0xf060ba){return db['License'][_0xda55('0xc')]({'where':{'id':0x1},'raw':!![]})[_0xda55('0xd')](function(_0x5da643){var _0x23f649=getValueFromLicense(_0x1dabc5,_0x5da643);return _0x23f649?_0x23f649:_0x30f452;})[_0xda55('0xd')](function(_0x16db28){_0x30f452=_0x16db28;return _0x21c42e[_0xda55('0xe')](_0x35e02d);})[_0xda55('0xd')](function(_0x2c50b6){if(_0x2c50b6>=_0x30f452){return _0x3fefff[_0xda55('0xf')](0x193)[_0xda55('0x10')]({'message':util[_0xda55('0x11')](_0xda55('0x12'),_0x1dabc5)});}_0xf060ba();})[_0xda55('0x13')](function(_0x3d8fdc){_0xf060ba(_0x3d8fdc);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xda55('0x14')],{'where':{'$or':[{'role':_0xda55('0x15')},{'role':_0xda55('0x16')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
+var _0x81b3=['admin','isUserLimit','crypto','util','../../mysqldb','data1','license','split','aes-256-ctr','%s:%s:%s','update','base64','final','utf8','parse','hasOwnProperty','License','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x4c21ff,_0x384b66){var _0x5185ec=function(_0x245b5c){while(--_0x245b5c){_0x4c21ff['push'](_0x4c21ff['shift']());}};_0x5185ec(++_0x384b66);}(_0x81b3,0x98));var _0x381b=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x81b3[_0x173441];return _0x2423a8;};'use strict';var crypto=require(_0x381b('0x0'));var util=require(_0x381b('0x1'));var compose=require('composable-middleware');var db=require(_0x381b('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x59a8d0,_0x17f421){if(_0x59a8d0&&_0x17f421){if(_0x17f421[_0x381b('0x3')]&&_0x17f421[_0x381b('0x4')]){var _0x5f1a18=_0x17f421[_0x381b('0x3')];var _0x258c48=_0x17f421[_0x381b('0x4')];var _0x34eba2=_0x5f1a18[_0x381b('0x5')]('-')[0x4];var _0x5528b0=_0x5f1a18['split']('-')[0x0];var _0x4a1fc4=crypto['createDecipher'](_0x381b('0x6'),util['format'](_0x381b('0x7'),_0x34eba2,_0x5f1a18,_0x5528b0));var _0x2b558b=_0x4a1fc4[_0x381b('0x8')](_0x258c48,_0x381b('0x9'),'utf8');_0x2b558b+=_0x4a1fc4[_0x381b('0xa')](_0x381b('0xb'));var _0x4992ce=JSON[_0x381b('0xc')](_0x2b558b);return _0x4992ce[_0x381b('0xd')](_0x59a8d0)?_0x4992ce[_0x59a8d0]:null;}}return null;}function isLimit(_0x39b406,_0x53453f,_0x172bcb,_0x38a12b){var _0x41b0b8=_0x53453f;return compose()['use'](function(_0x5109ac,_0x121e9b,_0x1846a4){return db[_0x381b('0xe')][_0x381b('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x57c62b){var _0x2aaadd=getValueFromLicense(_0x39b406,_0x57c62b);return _0x2aaadd?_0x2aaadd:_0x41b0b8;})['then'](function(_0x40b9e5){_0x41b0b8=_0x40b9e5;return _0x172bcb[_0x381b('0x10')](_0x38a12b);})[_0x381b('0x11')](function(_0x509d1e){if(_0x509d1e>=_0x41b0b8){return _0x121e9b[_0x381b('0x12')](0x193)[_0x381b('0x13')]({'message':util['format'](_0x381b('0x14'),_0x39b406)});}_0x1846a4();})[_0x381b('0x15')](function(_0x3d77bc){_0x1846a4(_0x3d77bc);});});}function isUserLimit(){return isLimit(_0x381b('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x381b('0x17')},{'role':'user'}]}});}exports[_0x381b('0x18')]=isUserLimit;
\ No newline at end of file
index 49bb536..4cb1a44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0df6=['and','replace','[$and]','split','length','forEach','shift','filter','indexOf','buildExpression','operator','$between','value','includes','$lte','days','format','YYYY-MM-DD','castTo','CAST(','field','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','DATE','utcOffset','add','hours','minutes','seconds','lodash','moment','startsWith','[$or]'];(function(_0x485f6c,_0x5f354e){var _0x2800ff=function(_0xdaee4d){while(--_0xdaee4d){_0x485f6c['push'](_0x485f6c['shift']());}};_0x2800ff(++_0x5f354e);}(_0x0df6,0x134));var _0x60df=function(_0x1753e0,_0x411e0f){_0x1753e0=_0x1753e0-0x0;var _0x55a963=_0x0df6[_0x1753e0];return _0x55a963;};'use strict';var _=require(_0x60df('0x0'));var moment=require(_0x60df('0x1'));exports['parseSearch']=function(_0x416b7d){var _0x168863={'conditions':[]};_0x168863['sqlOperator']=_[_0x60df('0x2')](_0x416b7d,_0x60df('0x3'))?'or':_0x60df('0x4');var _0x232c12=_0x416b7d[_0x60df('0x5')](_0x60df('0x6'),'')[_0x60df('0x5')](_0x60df('0x3'),'')[_0x60df('0x7')]('||');for(var _0x8d2003=0x0;_0x8d2003<_0x232c12[_0x60df('0x8')];_0x8d2003++){var _0x34c98a=_0x232c12[_0x8d2003]['split'](':=');var _0x1b4f94=_0x34c98a[0x0];var _0x46e16c=_0x34c98a['slice'](0x1);_0x46e16c[_0x60df('0x9')](function(_0x4068b9){var _0x1eab4f=_0x4068b9[_0x60df('0x7')]('[')[_0x60df('0xa')]();var _0x4bf0b6=_0x4068b9['match'](/\[(.*?)\]/g);_0x4bf0b6['forEach'](function(_0x1b823e){var _0x4b2f50=_0x1b823e[_0x60df('0x7')]('[')[_0x60df('0xb')](function(_0x17e335){return _0x17e335[_0x60df('0xc')](']')>-0x1;})['map'](function(_0x48edd3){return _0x48edd3[_0x60df('0x7')](']')[0x0];})[0x0];_0x168863['conditions']['push']({'field':_0x1b4f94,'operator':_0x1eab4f,'value':_0x4b2f50});});});}return _0x168863;};exports[_0x60df('0xd')]=function(_0x5bf1ab,_0x4a9056,_0x140f4e){var _0x3e0a51={};if(_0x4a9056==='DATE'){if(_0x140f4e[_0x60df('0xe')]==='$eq'){_0x140f4e[_0x60df('0xe')]=_0x60df('0xf');_0x140f4e[_0x60df('0x10')]+=','+_0x140f4e[_0x60df('0x10')];}else if(_[_0x60df('0x11')](['$gt',_0x60df('0x12')],_0x140f4e[_0x60df('0xe')])){_0x140f4e[_0x60df('0x10')]=moment(_0x140f4e[_0x60df('0x10')])['add'](0x1,_0x60df('0x13'))[_0x60df('0x14')](_0x60df('0x15'));}}if(_0x140f4e[_0x60df('0x16')]){_0x4a9056=_0x140f4e['castTo'];_0x3e0a51['text']=_0x60df('0x17')+_0x5bf1ab+'.'+_0x140f4e[_0x60df('0x18')]+'\x20AS\x20'+_0x140f4e[_0x60df('0x16')]+')\x20'+parseOperator(_0x140f4e[_0x60df('0xe')]);}else{_0x3e0a51['text']=_0x5bf1ab+'.'+_0x140f4e[_0x60df('0x18')]+'\x20'+parseOperator(_0x140f4e[_0x60df('0xe')]);}if(_[_0x60df('0x11')]([_0x60df('0x19'),_0x60df('0x1a')],_0x140f4e[_0x60df('0xe')]))_0x3e0a51[_0x60df('0x1b')]='('+_0x3e0a51[_0x60df('0x1b')]+_0x60df('0x1c')+_0x5bf1ab+'.'+_0x140f4e[_0x60df('0x18')]+_0x60df('0x1d');_0x3e0a51[_0x60df('0x10')]=parseValue(_0x4a9056,_0x140f4e[_0x60df('0xe')],_0x140f4e['value']);return _0x3e0a51;};function parseOperator(_0x19d8e5){var _0x58e02b;switch(_0x19d8e5){case _0x60df('0x1e'):_0x58e02b='IN\x20?';break;case _0x60df('0x1a'):_0x58e02b=_0x60df('0x1f');break;case _0x60df('0x20'):_0x58e02b=_0x60df('0x21');break;case'$ne':_0x58e02b='<>\x20?';break;case _0x60df('0x22'):case _0x60df('0x23'):case _0x60df('0x24'):_0x58e02b=_0x60df('0x25');break;case _0x60df('0x26'):_0x58e02b=_0x60df('0x27');break;case'$gt':_0x58e02b=_0x60df('0x28');break;case'$lte':_0x58e02b=_0x60df('0x29');break;case'$gte':_0x58e02b=_0x60df('0x2a');break;case _0x60df('0xf'):_0x58e02b=_0x60df('0x2b');break;}return _0x58e02b;}function parseValue(_0x3f7654,_0x55e8a7,_0x42b4ea){var _0x4dd36e={'start':undefined,'end':undefined};switch(_0x55e8a7){case'$in':case _0x60df('0x1a'):_0x4dd36e['start']=_0x42b4ea[_0x60df('0x7')](',');break;case _0x60df('0x22'):_0x4dd36e[_0x60df('0x2c')]='%'+_0x42b4ea+'%';break;case _0x60df('0x23'):_0x4dd36e[_0x60df('0x2c')]=_0x42b4ea+'%';break;case _0x60df('0x24'):_0x4dd36e['start']='%'+_0x42b4ea;break;case _0x60df('0xf'):var _0x5d4938=_0x42b4ea['split'](',');var _0x42b4ea=_0x5d4938[_0x60df('0xa')]();var _0x296049=_0x5d4938[_0x60df('0x2d')]();if(_0x3f7654===_0x60df('0x2e')){_0x42b4ea=moment(_0x42b4ea)[_0x60df('0x2f')](0x0,!![])[_0x60df('0x14')]();_0x296049=moment(_0x296049)[_0x60df('0x2f')](0x0,!![])[_0x60df('0x30')](0x17,_0x60df('0x31'))[_0x60df('0x30')](0x3b,_0x60df('0x32'))[_0x60df('0x30')](0x3b,_0x60df('0x33'))[_0x60df('0x14')]();}_0x4dd36e={'start':_0x42b4ea,'end':_0x296049};break;default:_0x4dd36e[_0x60df('0x2c')]=_0x42b4ea;break;}return _0x4dd36e;}
\ No newline at end of file
+var _0x34f5=['YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','add','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','and','replace','[$and]','split','length','slice','match','forEach','indexOf','conditions','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','format'];(function(_0x1c7502,_0x5d2c70){var _0x2165fa=function(_0x5a64a2){while(--_0x5a64a2){_0x1c7502['push'](_0x1c7502['shift']());}};_0x2165fa(++_0x5d2c70);}(_0x34f5,0x89));var _0x534f=function(_0x395f19,_0x3629d1){_0x395f19=_0x395f19-0x0;var _0x3e44ea=_0x34f5[_0x395f19];return _0x3e44ea;};'use strict';var _=require(_0x534f('0x0'));var moment=require(_0x534f('0x1'));exports[_0x534f('0x2')]=function(_0x41a50f){var _0x189d4f={'conditions':[]};_0x189d4f['sqlOperator']=_[_0x534f('0x3')](_0x41a50f,_0x534f('0x4'))?'or':_0x534f('0x5');var _0x5b310f=_0x41a50f[_0x534f('0x6')](_0x534f('0x7'),'')[_0x534f('0x6')](_0x534f('0x4'),'')[_0x534f('0x8')]('||');for(var _0x1f6f29=0x0;_0x1f6f29<_0x5b310f[_0x534f('0x9')];_0x1f6f29++){var _0x5634bb=_0x5b310f[_0x1f6f29][_0x534f('0x8')](':=');var _0xe6756a=_0x5634bb[0x0];var _0x3f0dcf=_0x5634bb[_0x534f('0xa')](0x1);_0x3f0dcf['forEach'](function(_0x103a28){var _0x20086e=_0x103a28['split']('[')['shift']();var _0x9eb055=_0x103a28[_0x534f('0xb')](/\[(.*?)\]/g);_0x9eb055[_0x534f('0xc')](function(_0x24e8e8){var _0x4c7a6e=_0x24e8e8[_0x534f('0x8')]('[')['filter'](function(_0x5958b1){return _0x5958b1[_0x534f('0xd')](']')>-0x1;})['map'](function(_0x130cf7){return _0x130cf7[_0x534f('0x8')](']')[0x0];})[0x0];_0x189d4f[_0x534f('0xe')][_0x534f('0xf')]({'field':_0xe6756a,'operator':_0x20086e,'value':_0x4c7a6e});});});}return _0x189d4f;};exports[_0x534f('0x10')]=function(_0x25ad03,_0x65d2e,_0x1a8cf6){var _0x41f390={};if(_0x65d2e===_0x534f('0x11')){if(_0x1a8cf6[_0x534f('0x12')]==='$eq'){_0x1a8cf6[_0x534f('0x12')]=_0x534f('0x13');_0x1a8cf6[_0x534f('0x14')]+=','+_0x1a8cf6[_0x534f('0x14')];}else if(_[_0x534f('0x15')]([_0x534f('0x16'),_0x534f('0x17')],_0x1a8cf6[_0x534f('0x12')])){_0x1a8cf6['value']=moment(_0x1a8cf6['value'])['add'](0x1,'days')[_0x534f('0x18')](_0x534f('0x19'));}}if(_0x1a8cf6[_0x534f('0x1a')]){_0x65d2e=_0x1a8cf6['castTo'];_0x41f390[_0x534f('0x1b')]='CAST('+_0x25ad03+'.'+_0x1a8cf6[_0x534f('0x1c')]+_0x534f('0x1d')+_0x1a8cf6['castTo']+')\x20'+parseOperator(_0x1a8cf6[_0x534f('0x12')]);}else{_0x41f390[_0x534f('0x1b')]=_0x25ad03+'.'+_0x1a8cf6['field']+'\x20'+parseOperator(_0x1a8cf6[_0x534f('0x12')]);}if(_[_0x534f('0x15')]([_0x534f('0x1e'),_0x534f('0x1f')],_0x1a8cf6['operator']))_0x41f390['text']='('+_0x41f390['text']+_0x534f('0x20')+_0x25ad03+'.'+_0x1a8cf6[_0x534f('0x1c')]+_0x534f('0x21');_0x41f390[_0x534f('0x14')]=parseValue(_0x65d2e,_0x1a8cf6['operator'],_0x1a8cf6['value']);return _0x41f390;};function parseOperator(_0x378a13){var _0x366297;switch(_0x378a13){case'$in':_0x366297=_0x534f('0x22');break;case _0x534f('0x1f'):_0x366297=_0x534f('0x23');break;case'$eq':_0x366297=_0x534f('0x24');break;case'$ne':_0x366297=_0x534f('0x25');break;case _0x534f('0x26'):case _0x534f('0x27'):case _0x534f('0x28'):_0x366297='LIKE\x20?';break;case _0x534f('0x29'):_0x366297=_0x534f('0x2a');break;case _0x534f('0x16'):_0x366297=_0x534f('0x2b');break;case'$lte':_0x366297='<=\x20?';break;case _0x534f('0x2c'):_0x366297=_0x534f('0x2d');break;case _0x534f('0x13'):_0x366297=_0x534f('0x2e');break;}return _0x366297;}function parseValue(_0x1ee3f7,_0x4dc4d2,_0x38fdb7){var _0x258559={'start':undefined,'end':undefined};switch(_0x4dc4d2){case _0x534f('0x2f'):case'$notIn':_0x258559[_0x534f('0x30')]=_0x38fdb7['split'](',');break;case _0x534f('0x26'):_0x258559[_0x534f('0x30')]='%'+_0x38fdb7+'%';break;case _0x534f('0x27'):_0x258559['start']=_0x38fdb7+'%';break;case _0x534f('0x28'):_0x258559['start']='%'+_0x38fdb7;break;case _0x534f('0x13'):var _0x434d19=_0x38fdb7[_0x534f('0x8')](',');var _0x38fdb7=_0x434d19['shift']();var _0x24b831=_0x434d19['pop']();if(_0x1ee3f7===_0x534f('0x11')){_0x38fdb7=moment(_0x38fdb7)[_0x534f('0x31')](0x0,!![])['format']();_0x24b831=moment(_0x24b831)['utcOffset'](0x0,!![])[_0x534f('0x32')](0x17,_0x534f('0x33'))['add'](0x3b,_0x534f('0x34'))[_0x534f('0x32')](0x3b,_0x534f('0x35'))[_0x534f('0x18')]();}_0x258559={'start':_0x38fdb7,'end':_0x24b831};break;default:_0x258559['start']=_0x38fdb7;break;}return _0x258559;}
\ No newline at end of file
index 55280f8..9434cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4105=['isNumeric','match','^[+]?[0-9]*$','getFullTextValue','replace','includes','push','getOptions','query','$id','model','attributes','intersection','nolimit','order','filter','where','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','subtract','name','uniqueid','isArray','limit','offset','sort','map','priority','cast','unsigned','substr','col','ASC','omit','length','isObject','isString','unset','hasOwnProperty'];(function(_0x12ea10,_0x26117c){var _0x20589e=function(_0x2400da){while(--_0x2400da){_0x12ea10['push'](_0x12ea10['shift']());}};_0x20589e(++_0x26117c);}(_0x4105,0xc3));var _0x5410=function(_0x2ef41c,_0x2e5086){_0x2ef41c=_0x2ef41c-0x0;var _0x1998b8=_0x4105[_0x2ef41c];return _0x1998b8;};'use strict';var _=require(_0x5410('0x0'));var sequelize=require('sequelize');var moment=require(_0x5410('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5efb30){var _0x5c17a1=['ne'];try{var _0x42ef0b=JSON[_0x5410('0x2')](_0x5efb30);var _0x14fcff=Object[_0x5410('0x3')](_0x42ef0b)[0x0];return _0x5c17a1['includes'](_0x14fcff);}catch(_0x4f5f03){return![];}}function getOperatorValue(_0x16cb94){var _0x337950=JSON[_0x5410('0x2')](_0x16cb94);var _0x39c44b=Object[_0x5410('0x3')](_0x337950)[0x0];var _0x516569=_0x337950[_0x39c44b];return{['$'+_0x39c44b]:_0x516569};}exports[_0x5410('0x4')]=function(_0x59cdc9){var _0x3bd208=null;if(_0x59cdc9){_0x3bd208=_0x59cdc9[_0x5410('0x5')](',');}return _0x3bd208;};exports[_0x5410('0x6')]=function(_0x5c5b89,_0x29337e){var _0x22c956={};if(!_[_0x5410('0x7')](_0x5c5b89)){_[_0x5410('0x8')](_0x5c5b89,function(_0x5e6f66,_0x1ea350){try{if(_0x29337e){var _0x54b140=_[_0x5410('0x9')](_0x29337e,{'name':_0x1ea350})||{};if(hasSequelizeOperator(_0x5e6f66)){_0x22c956[_0x1ea350]=getOperatorValue(_0x5e6f66);}else if(_0x54b140[_0x5410('0xa')]===_0x5410('0xb')&&_[_0x5410('0xc')](_0x5e6f66)){var _0x2925b8=JSON[_0x5410('0x2')](_0x5e6f66);var _0x43d599={'$gte':moment(moment(_0x2925b8['$gte'])[_0x5410('0xd')](_0x5410('0xe')))['utc']()[_0x5410('0xd')](),'$lte':moment(moment(_0x2925b8[_0x5410('0xf')])[_0x5410('0xd')](_0x5410('0xe')))[_0x5410('0x10')]()[_0x5410('0x11')](0x1,'s')[_0x5410('0xd')]()};_0x22c956[_0x1ea350]=_0x43d599;}else if(_0x54b140[_0x5410('0x12')]===_0x5410('0x13')){_0x22c956[_0x1ea350]=_0x5e6f66;}else{_0x22c956[_0x1ea350]=_[_0x5410('0x14')](_0x5e6f66)?_0x5e6f66:JSON['parse'](_0x5e6f66);}}else{_0x22c956[_0x1ea350]=_['isArray'](_0x5e6f66)?_0x5e6f66:JSON[_0x5410('0x2')](_0x5e6f66);}}catch(_0x462bfb){_0x22c956[_0x1ea350]=_0x5e6f66['split'](',');}});}return _0x22c956;};exports[_0x5410('0x15')]=function(_0x5bcbd0){_0x5bcbd0=parseInt(_0x5bcbd0,0xa);if(!_0x5bcbd0||_0x5bcbd0<0x0){_0x5bcbd0=LIMIT_VALUE;}return _0x5bcbd0;};exports[_0x5410('0x16')]=function(_0x116135){_0x116135=parseInt(_0x116135,0xa);if(!_0x116135||_0x116135<0x0){_0x116135=0x0;}return _0x116135;};exports[_0x5410('0x17')]=function(_0x4e11e0){var _0x478bea,_0x4097f1=null;if(_0x4e11e0){_0x478bea=_0x4e11e0[_0x5410('0x5')](',');_0x4097f1=_[_0x5410('0x18')](_0x478bea,function(_0x14f8bd){if(_0x14f8bd['indexOf']('-')===0x0){return[_0x14f8bd===_0x5410('0x19')?sequelize[_0x5410('0x1a')](sequelize['col'](_0x5410('0x19')),_0x5410('0x1b')):_0x14f8bd[_0x5410('0x1c')](0x1),'DESC'];}else{return[_0x14f8bd==='priority'?sequelize['cast'](sequelize[_0x5410('0x1d')](_0x5410('0x19')),'unsigned'):_0x14f8bd,_0x5410('0x1e')];}});}return _0x4097f1;};exports[_0x5410('0x1f')]=function(_0x367ce8,_0x145562){if(_[_0x5410('0x7')](_0x367ce8)){return _0x367ce8;}if(_[_0x5410('0x14')](_0x367ce8)){for(var _0xcfe712=0x0;_0xcfe712<_0x367ce8[_0x5410('0x20')];_0xcfe712+=0x1){_0x367ce8[_0xcfe712]=this['omit'](_0x367ce8[_0xcfe712],_0x145562);}return _0x367ce8;}if(!_[_0x5410('0x21')](_0x367ce8)){return _0x367ce8;}if(_[_0x5410('0x22')](_0x145562)){_0x145562=[_0x145562];}if(!_[_0x5410('0x14')](_0x145562)){return _0x367ce8;}for(var _0x374658=0x0;_0x374658<_0x145562[_0x5410('0x20')];_0x374658+=0x1){_[_0x5410('0x23')](_0x367ce8,_0x145562[_0x374658]);}for(var _0x286dca in _0x367ce8){if(_0x367ce8[_0x5410('0x24')](_0x286dca)){_0x367ce8[_0x286dca]=this['omit'](_0x367ce8[_0x286dca],_0x145562);}}return _0x367ce8;};exports[_0x5410('0x25')]=function(_0x465568){return _0x465568[_0x5410('0x26')](RegExp(_0x5410('0x27')))?!![]:![];};exports['isEmail']=function(_0xfb34e6){return _0xfb34e6['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x5410('0x28')]=function(_0x442b4f){var _0x438c52=[];_0x442b4f[_0x5410('0x5')](/[ ,]+/)['forEach'](function(_0x5120c4){_0x5120c4=_0x5120c4[_0x5410('0x29')](/([^:]")"+/g,'$1');_0x5120c4='+'+_0x5120c4+'*';if(_0x5120c4[_0x5410('0x2a')]('@'))_0x5120c4='\x22'+_0x5120c4+'\x22';_0x438c52[_0x5410('0x2b')](_0x5120c4);});return _0x438c52['join']('\x20');};exports[_0x5410('0x2c')]=function(_0x204ed7,_0x4bc1c7,_0x3ca20e){var _0x3bdfa5={},_0x3b1e8c={};if(_0x4bc1c7['query']['$id']){_0x4bc1c7[_0x5410('0x2d')]['id']=_0x4bc1c7['query'][_0x5410('0x2e')];delete _0x4bc1c7[_0x5410('0x2d')][_0x5410('0x2e')];}_0x3bdfa5[_0x5410('0x2f')]=_['map'](_0x204ed7,_0x5410('0x12'));_0x3bdfa5[_0x5410('0x2d')]=_[_0x5410('0x3')](_0x4bc1c7['query']);_0x3bdfa5['filters']=_['intersection'](_0x3bdfa5[_0x5410('0x2f')],_0x3bdfa5['query']);_0x3b1e8c[_0x5410('0x30')]=_[_0x5410('0x31')](_0x3bdfa5['model'],this[_0x5410('0x4')](_0x4bc1c7[_0x5410('0x2d')][_0x5410('0x4')]));_0x3b1e8c['attributes']=_0x3b1e8c['attributes'][_0x5410('0x20')]?_0x3b1e8c[_0x5410('0x30')]:_0x3bdfa5['model'];if(!_0x4bc1c7[_0x5410('0x2d')][_0x5410('0x24')](_0x5410('0x32'))){_0x3b1e8c['limit']=this[_0x5410('0x15')](_0x4bc1c7['query'][_0x5410('0x15')]);_0x3b1e8c[_0x5410('0x16')]=this['offset'](_0x4bc1c7[_0x5410('0x2d')]['offset']);}_0x3b1e8c[_0x5410('0x33')]=this[_0x5410('0x17')](_0x4bc1c7[_0x5410('0x2d')][_0x5410('0x17')]);_0x3b1e8c['where']=this[_0x5410('0x6')](_['pick'](_0x4bc1c7[_0x5410('0x2d')],_0x3bdfa5['filters']),_0x204ed7);if(_0x4bc1c7[_0x5410('0x2d')][_0x5410('0x34')]){_0x3b1e8c[_0x5410('0x35')]=_[_0x5410('0x36')](_0x3b1e8c[_0x5410('0x35')],{'$or':_[_0x5410('0x18')](_0x204ed7,function(_0x150c45){if(_0x150c45[_0x5410('0xa')]!==_0x5410('0x37')){if(_0x3ca20e){return sequelize['where'](sequelize['fn'](_0x5410('0x38'),sequelize[_0x5410('0x1d')](_0x150c45[_0x5410('0x12')])),{'$like':sequelize['fn'](_0x5410('0x38'),'%'+_0x4bc1c7[_0x5410('0x2d')][_0x5410('0x34')]+'%')});}else{var _0x2afab9={};_0x2afab9[_0x150c45[_0x5410('0x12')]]={'$like':'%'+_0x4bc1c7[_0x5410('0x2d')][_0x5410('0x34')]+'%'};return _0x2afab9;}}})});}_0x3b1e8c=_[_0x5410('0x36')]({},_0x3b1e8c,_0x4bc1c7[_0x5410('0x39')]);return _0x3b1e8c;};
\ No newline at end of file
+var _0x77a9=['lodash','moment','parse','keys','includes','fields','split','isEmpty','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','subtract','uniqueid','isArray','offset','map','priority','cast','substr','DESC','unsigned','omit','length','isObject','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','join','query','$id','model','name','filters','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','lower','options'];(function(_0x474a69,_0x44881f){var _0x477544=function(_0xb2ecda){while(--_0xb2ecda){_0x474a69['push'](_0x474a69['shift']());}};_0x477544(++_0x44881f);}(_0x77a9,0x122));var _0x977a=function(_0x2e6ac2,_0x3baa57){_0x2e6ac2=_0x2e6ac2-0x0;var _0x3635ef=_0x77a9[_0x2e6ac2];return _0x3635ef;};'use strict';var _=require(_0x977a('0x0'));var sequelize=require('sequelize');var moment=require(_0x977a('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x389dfc){var _0x805268=['ne'];try{var _0x1d5171=JSON[_0x977a('0x2')](_0x389dfc);var _0x6a1c1c=Object[_0x977a('0x3')](_0x1d5171)[0x0];return _0x805268[_0x977a('0x4')](_0x6a1c1c);}catch(_0x534336){return![];}}function getOperatorValue(_0x4d9295){var _0x45684a=JSON['parse'](_0x4d9295);var _0x5cab17=Object[_0x977a('0x3')](_0x45684a)[0x0];var _0x20a928=_0x45684a[_0x5cab17];return{['$'+_0x5cab17]:_0x20a928};}exports[_0x977a('0x5')]=function(_0x120691){var _0x34cdf2=null;if(_0x120691){_0x34cdf2=_0x120691[_0x977a('0x6')](',');}return _0x34cdf2;};exports['filters']=function(_0x7afad8,_0x5d5e8a){var _0x242efa={};if(!_[_0x977a('0x7')](_0x7afad8)){_['forOwn'](_0x7afad8,function(_0xa44b81,_0x58c767){try{if(_0x5d5e8a){var _0x1d176e=_['find'](_0x5d5e8a,{'name':_0x58c767})||{};if(hasSequelizeOperator(_0xa44b81)){_0x242efa[_0x58c767]=getOperatorValue(_0xa44b81);}else if(_0x1d176e[_0x977a('0x8')]===_0x977a('0x9')&&_[_0x977a('0xa')](_0xa44b81)){var _0x169d10=JSON['parse'](_0xa44b81);var _0x5697c9={'$gte':moment(moment(_0x169d10[_0x977a('0xb')])[_0x977a('0xc')](_0x977a('0xd')))['utc']()[_0x977a('0xc')](),'$lte':moment(moment(_0x169d10[_0x977a('0xe')])[_0x977a('0xc')](_0x977a('0xd')))[_0x977a('0xf')]()[_0x977a('0x10')](0x1,'s')[_0x977a('0xc')]()};_0x242efa[_0x58c767]=_0x5697c9;}else if(_0x1d176e['name']===_0x977a('0x11')){_0x242efa[_0x58c767]=_0xa44b81;}else{_0x242efa[_0x58c767]=_[_0x977a('0x12')](_0xa44b81)?_0xa44b81:JSON['parse'](_0xa44b81);}}else{_0x242efa[_0x58c767]=_[_0x977a('0x12')](_0xa44b81)?_0xa44b81:JSON[_0x977a('0x2')](_0xa44b81);}}catch(_0x2badbf){_0x242efa[_0x58c767]=_0xa44b81['split'](',');}});}return _0x242efa;};exports['limit']=function(_0x493c78){_0x493c78=parseInt(_0x493c78,0xa);if(!_0x493c78||_0x493c78<0x0){_0x493c78=LIMIT_VALUE;}return _0x493c78;};exports[_0x977a('0x13')]=function(_0x5848bf){_0x5848bf=parseInt(_0x5848bf,0xa);if(!_0x5848bf||_0x5848bf<0x0){_0x5848bf=0x0;}return _0x5848bf;};exports['sort']=function(_0x4bbcc4){var _0x815243,_0x1481a8=null;if(_0x4bbcc4){_0x815243=_0x4bbcc4[_0x977a('0x6')](',');_0x1481a8=_[_0x977a('0x14')](_0x815243,function(_0x308e76){if(_0x308e76['indexOf']('-')===0x0){return[_0x308e76===_0x977a('0x15')?sequelize[_0x977a('0x16')](sequelize['col']('priority'),'unsigned'):_0x308e76[_0x977a('0x17')](0x1),_0x977a('0x18')];}else{return[_0x308e76===_0x977a('0x15')?sequelize[_0x977a('0x16')](sequelize['col']('priority'),_0x977a('0x19')):_0x308e76,'ASC'];}});}return _0x1481a8;};exports[_0x977a('0x1a')]=function(_0x35ad89,_0x3c00fb){if(_[_0x977a('0x7')](_0x35ad89)){return _0x35ad89;}if(_[_0x977a('0x12')](_0x35ad89)){for(var _0x21308a=0x0;_0x21308a<_0x35ad89[_0x977a('0x1b')];_0x21308a+=0x1){_0x35ad89[_0x21308a]=this[_0x977a('0x1a')](_0x35ad89[_0x21308a],_0x3c00fb);}return _0x35ad89;}if(!_[_0x977a('0x1c')](_0x35ad89)){return _0x35ad89;}if(_[_0x977a('0x1d')](_0x3c00fb)){_0x3c00fb=[_0x3c00fb];}if(!_[_0x977a('0x12')](_0x3c00fb)){return _0x35ad89;}for(var _0x2ef2bc=0x0;_0x2ef2bc<_0x3c00fb[_0x977a('0x1b')];_0x2ef2bc+=0x1){_[_0x977a('0x1e')](_0x35ad89,_0x3c00fb[_0x2ef2bc]);}for(var _0x498112 in _0x35ad89){if(_0x35ad89['hasOwnProperty'](_0x498112)){_0x35ad89[_0x498112]=this['omit'](_0x35ad89[_0x498112],_0x3c00fb);}}return _0x35ad89;};exports[_0x977a('0x1f')]=function(_0x357bb1){return _0x357bb1[_0x977a('0x20')](RegExp(_0x977a('0x21')))?!![]:![];};exports[_0x977a('0x22')]=function(_0x2179ca){return _0x2179ca[_0x977a('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0x977a('0x23')]=function(_0x1ae0e8){var _0x43390c=[];_0x1ae0e8[_0x977a('0x6')](/[ ,]+/)[_0x977a('0x24')](function(_0x5982e7){_0x5982e7=_0x5982e7[_0x977a('0x25')](/([^:]")"+/g,'$1');_0x5982e7='+'+_0x5982e7+'*';if(_0x5982e7[_0x977a('0x4')]('@'))_0x5982e7='\x22'+_0x5982e7+'\x22';_0x43390c[_0x977a('0x26')](_0x5982e7);});return _0x43390c[_0x977a('0x27')]('\x20');};exports['getOptions']=function(_0x2a79a5,_0x150038,_0x3f6aad){var _0x2b8bf5={},_0x43b6ae={};if(_0x150038[_0x977a('0x28')][_0x977a('0x29')]){_0x150038[_0x977a('0x28')]['id']=_0x150038['query'][_0x977a('0x29')];delete _0x150038[_0x977a('0x28')][_0x977a('0x29')];}_0x2b8bf5[_0x977a('0x2a')]=_[_0x977a('0x14')](_0x2a79a5,_0x977a('0x2b'));_0x2b8bf5[_0x977a('0x28')]=_[_0x977a('0x3')](_0x150038['query']);_0x2b8bf5[_0x977a('0x2c')]=_['intersection'](_0x2b8bf5[_0x977a('0x2a')],_0x2b8bf5[_0x977a('0x28')]);_0x43b6ae[_0x977a('0x2d')]=_[_0x977a('0x2e')](_0x2b8bf5['model'],this[_0x977a('0x5')](_0x150038['query'][_0x977a('0x5')]));_0x43b6ae['attributes']=_0x43b6ae['attributes'][_0x977a('0x1b')]?_0x43b6ae[_0x977a('0x2d')]:_0x2b8bf5[_0x977a('0x2a')];if(!_0x150038[_0x977a('0x28')][_0x977a('0x2f')](_0x977a('0x30'))){_0x43b6ae[_0x977a('0x31')]=this['limit'](_0x150038['query']['limit']);_0x43b6ae[_0x977a('0x13')]=this[_0x977a('0x13')](_0x150038[_0x977a('0x28')][_0x977a('0x13')]);}_0x43b6ae[_0x977a('0x32')]=this[_0x977a('0x33')](_0x150038['query'][_0x977a('0x33')]);_0x43b6ae['where']=this[_0x977a('0x2c')](_['pick'](_0x150038[_0x977a('0x28')],_0x2b8bf5[_0x977a('0x2c')]),_0x2a79a5);if(_0x150038['query'][_0x977a('0x34')]){_0x43b6ae['where']=_[_0x977a('0x35')](_0x43b6ae[_0x977a('0x36')],{'$or':_[_0x977a('0x14')](_0x2a79a5,function(_0x2b0f79){if(_0x2b0f79[_0x977a('0x8')]!==_0x977a('0x37')){if(_0x3f6aad){return sequelize['where'](sequelize['fn'](_0x977a('0x38'),sequelize['col'](_0x2b0f79[_0x977a('0x2b')])),{'$like':sequelize['fn'](_0x977a('0x38'),'%'+_0x150038[_0x977a('0x28')][_0x977a('0x34')]+'%')});}else{var _0x272bb4={};_0x272bb4[_0x2b0f79['name']]={'$like':'%'+_0x150038['query'][_0x977a('0x34')]+'%'};return _0x272bb4;}}})});}_0x43b6ae=_[_0x977a('0x35')]({},_0x43b6ae,_0x150038[_0x977a('0x39')]);return _0x43b6ae;};
\ No newline at end of file
index 2ca37e5..dc581c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf21f=['html','ejs','renderFile','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser','errorhandler','path','cors','./environment','../mysqldb','get','env','production','set','join','public','development','test','appPath','client','split','use','static','views','root','/server/views','engine'];(function(_0x422a67,_0x42ae28){var _0x2df932=function(_0xfe1cb2){while(--_0xfe1cb2){_0x422a67['push'](_0x422a67['shift']());}};_0x2df932(++_0x42ae28);}(_0xf21f,0x147));var _0xff21=function(_0x573836,_0x599996){_0x573836=_0x573836-0x0;var _0x3d9709=_0xf21f[_0x573836];return _0x3d9709;};'use strict';var express=require(_0xff21('0x0'));var favicon=require(_0xff21('0x1'));var bodyParser=require(_0xff21('0x2'));var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require(_0xff21('0x3'));var path=require(_0xff21('0x4'));var passport=require('passport');var cors=require(_0xff21('0x5'));var moment=require('moment');var config=require(_0xff21('0x6'));var db=require(_0xff21('0x7'))['db'];exports['default']=function(_0x4ec1ea){var _0x245c0d=_0x4ec1ea[_0xff21('0x8')](_0xff21('0x9'));if(_0x245c0d===_0xff21('0xa')){_0x4ec1ea[_0xff21('0xb')]('appPath',path[_0xff21('0xc')](config['root'],_0xff21('0xd')));}if(_0x245c0d===_0xff21('0xe')||_0x245c0d===_0xff21('0xf')){_0x4ec1ea['set'](_0xff21('0x10'),path['join'](config['root'],_0xff21('0x11')));_0x4ec1ea['use'](errorHandler());}_0x4ec1ea['set']('json\x20replacer',function(_0xab8fb8,_0x2d99fb){if(this[_0xab8fb8]instanceof Date){_0x2d99fb=this[_0xab8fb8]['toISOString']()[_0xff21('0x12')]('.')[0x0]+'Z';}return _0x2d99fb;});_0x4ec1ea[_0xff21('0x13')](express[_0xff21('0x14')](_0x4ec1ea[_0xff21('0x8')](_0xff21('0x10'))));_0x4ec1ea[_0xff21('0xb')](_0xff21('0x15'),config[_0xff21('0x16')]+_0xff21('0x17'));_0x4ec1ea[_0xff21('0x18')](_0xff21('0x19'),require(_0xff21('0x1a'))[_0xff21('0x1b')]);_0x4ec1ea['set'](_0xff21('0x1c'),'html');_0x4ec1ea[_0xff21('0x13')](bodyParser['urlencoded']({'limit':_0xff21('0x1d'),'extended':!![]}));_0x4ec1ea['use'](bodyParser[_0xff21('0x1e')]({'limit':_0xff21('0x1d')}));_0x4ec1ea['use'](cors());_0x4ec1ea[_0xff21('0x13')](methodOverride());_0x4ec1ea[_0xff21('0x13')](cookieParser());_0x4ec1ea[_0xff21('0x13')](passport[_0xff21('0x1f')]());};
\ No newline at end of file
+var _0x2aca=['client','use','json\x20replacer','toISOString','get','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','body-parser','method-override','errorhandler','path','moment','./environment','../mysqldb','default','env','production','set','appPath','join','public','development','test','root'];(function(_0x11aa40,_0x26774d){var _0x3f24a5=function(_0x55ae10){while(--_0x55ae10){_0x11aa40['push'](_0x11aa40['shift']());}};_0x3f24a5(++_0x26774d);}(_0x2aca,0x164));var _0xa2ac=function(_0x3fe4c4,_0x29a5b5){_0x3fe4c4=_0x3fe4c4-0x0;var _0x470479=_0x2aca[_0x3fe4c4];return _0x470479;};'use strict';var express=require(_0xa2ac('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xa2ac('0x1'));var methodOverride=require(_0xa2ac('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xa2ac('0x3'));var path=require(_0xa2ac('0x4'));var passport=require('passport');var cors=require('cors');var moment=require(_0xa2ac('0x5'));var config=require(_0xa2ac('0x6'));var db=require(_0xa2ac('0x7'))['db'];exports[_0xa2ac('0x8')]=function(_0x332238){var _0x3eab94=_0x332238['get'](_0xa2ac('0x9'));if(_0x3eab94===_0xa2ac('0xa')){_0x332238[_0xa2ac('0xb')](_0xa2ac('0xc'),path[_0xa2ac('0xd')](config['root'],_0xa2ac('0xe')));}if(_0x3eab94===_0xa2ac('0xf')||_0x3eab94===_0xa2ac('0x10')){_0x332238['set']('appPath',path[_0xa2ac('0xd')](config[_0xa2ac('0x11')],_0xa2ac('0x12')));_0x332238[_0xa2ac('0x13')](errorHandler());}_0x332238['set'](_0xa2ac('0x14'),function(_0x25555d,_0x50aac5){if(this[_0x25555d]instanceof Date){_0x50aac5=this[_0x25555d][_0xa2ac('0x15')]()['split']('.')[0x0]+'Z';}return _0x50aac5;});_0x332238['use'](express['static'](_0x332238[_0xa2ac('0x16')](_0xa2ac('0xc'))));_0x332238[_0xa2ac('0xb')](_0xa2ac('0x17'),config[_0xa2ac('0x11')]+_0xa2ac('0x18'));_0x332238[_0xa2ac('0x19')](_0xa2ac('0x1a'),require(_0xa2ac('0x1b'))[_0xa2ac('0x1c')]);_0x332238[_0xa2ac('0xb')](_0xa2ac('0x1d'),_0xa2ac('0x1a'));_0x332238[_0xa2ac('0x13')](bodyParser[_0xa2ac('0x1e')]({'limit':_0xa2ac('0x1f'),'extended':!![]}));_0x332238[_0xa2ac('0x13')](bodyParser[_0xa2ac('0x20')]({'limit':_0xa2ac('0x1f')}));_0x332238['use'](cors());_0x332238['use'](methodOverride());_0x332238[_0xa2ac('0x13')](cookieParser());_0x332238[_0xa2ac('0x13')](passport[_0xa2ac('0x21')]());};
\ No newline at end of file
index 5b483f1..8b9358a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ea5=['join','md5','update','digest','hex','licenseToken','test','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','family','internal','concat','head','mac','address','getFirstInterface','cpus','map','model'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8ea5,0x88));var _0x58ea=function(_0x10c50b,_0x5edebd){_0x10c50b=_0x10c50b-0x0;var _0x4c186a=_0x8ea5[_0x10c50b];return _0x4c186a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x58ea('0x0'));var machine=require(_0x58ea('0x1'));var exec=require(_0x58ea('0x2'))[_0x58ea('0x3')];var config=require(_0x58ea('0x4'));function getInterfaces(){var _0x3d4ab0=[];var _0x1651a6=os[_0x58ea('0x5')]();var _0x595c17=_[_0x58ea('0x6')](_[_0x58ea('0x7')](_0x1651a6));for(var _0x480b81=0x0;_0x480b81<_0x595c17[_0x58ea('0x8')];_0x480b81++){var _0x276903=_0x1651a6[_0x595c17[_0x480b81]]['filter'](function(_0x536ec9){return _0x536ec9[_0x58ea('0x9')]==='IPv4'&&_0x536ec9[_0x58ea('0xa')]===![];});_0x3d4ab0=_0x3d4ab0[_0x58ea('0xb')](_0x276903);}return _0x3d4ab0;}function getFirstInterface(){var _0x21bfaa=_[_0x58ea('0xc')](getInterfaces());return{'macAddress':_0x21bfaa&&_0x21bfaa[_0x58ea('0xd')]?_0x21bfaa[_0x58ea('0xd')]:'00:00:00:00:00:00','ipAddress':_0x21bfaa&&_0x21bfaa['address']?_0x21bfaa[_0x58ea('0xe')]:'127.0.0.1'};}exports[_0x58ea('0xf')]=getFirstInterface;function getCPUhash(){var _0x3db6b3=_[_0x58ea('0x6')](os[_0x58ea('0x10')]()[_0x58ea('0x11')](function(_0x16859a){return _0x16859a[_0x58ea('0x12')];}))[_0x58ea('0x13')](':');return crypto['createHash'](_0x58ea('0x14'))[_0x58ea('0x15')](_0x3db6b3)[_0x58ea('0x16')](_0x58ea('0x17'));}exports['getUuid']=function(){var _0x2bf96d=os['platform']();var _0x5716e5=/[0-9a-f-]{36}/;if(config[_0x58ea('0x18')]&&_0x5716e5[_0x58ea('0x19')](config[_0x58ea('0x18')])){return config[_0x58ea('0x18')];}else if(_0x2bf96d==='win32'){return exec(_0x58ea('0x1a'),{'encoding':_0x58ea('0x1b')})['replace']('\x0d\x0a','');}else{var _0x4417c1=getFirstInterface();var _0x3b8dee=getCPUhash();var _0x2aa086=_0x3b8dee+'|'+os[_0x58ea('0x1c')]()+'|'+_0x4417c1[_0x58ea('0x1d')]+'|'+_0x4417c1['ipAddress'];var _0x86452=crypto['createHash'](_0x58ea('0x14'))[_0x58ea('0x15')](_0x2aa086)[_0x58ea('0x16')](_0x58ea('0x17'));return _0x86452[_0x58ea('0x1e')](0x0,0x8)+'-'+_0x86452['substring'](0x8,0xc)+'-'+_0x86452[_0x58ea('0x1e')](0xc,0x10)+'-'+_0x86452[_0x58ea('0x1e')](0x10,0x14)+'-'+_0x86452[_0x58ea('0x1e')](0x14);}};
\ No newline at end of file
+var _0xb0e0=['digest','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','IPv4','concat','head','mac','address','127.0.0.1','getFirstInterface','model','join','createHash','md5','update','hex','getUuid','platform','licenseToken','win32','utf8','replace','ipAddress'];(function(_0x2eacda,_0x370587){var _0x174b2f=function(_0x59f133){while(--_0x59f133){_0x2eacda['push'](_0x2eacda['shift']());}};_0x174b2f(++_0x370587);}(_0xb0e0,0x1b4));var _0x0b0e=function(_0x1e5fef,_0x11f4f8){_0x1e5fef=_0x1e5fef-0x0;var _0x193f7a=_0xb0e0[_0x1e5fef];return _0x193f7a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x0b0e('0x0'));var machine=require(_0x0b0e('0x1'));var exec=require(_0x0b0e('0x2'))[_0x0b0e('0x3')];var config=require(_0x0b0e('0x4'));function getInterfaces(){var _0x36ed32=[];var _0x286d47=os[_0x0b0e('0x5')]();var _0xc644a7=_[_0x0b0e('0x6')](_[_0x0b0e('0x7')](_0x286d47));for(var _0x234338=0x0;_0x234338<_0xc644a7[_0x0b0e('0x8')];_0x234338++){var _0x5d4132=_0x286d47[_0xc644a7[_0x234338]]['filter'](function(_0x2fd93e){return _0x2fd93e['family']===_0x0b0e('0x9')&&_0x2fd93e['internal']===![];});_0x36ed32=_0x36ed32[_0x0b0e('0xa')](_0x5d4132);}return _0x36ed32;}function getFirstInterface(){var _0x5c2a6=_[_0x0b0e('0xb')](getInterfaces());return{'macAddress':_0x5c2a6&&_0x5c2a6[_0x0b0e('0xc')]?_0x5c2a6[_0x0b0e('0xc')]:'00:00:00:00:00:00','ipAddress':_0x5c2a6&&_0x5c2a6[_0x0b0e('0xd')]?_0x5c2a6[_0x0b0e('0xd')]:_0x0b0e('0xe')};}exports[_0x0b0e('0xf')]=getFirstInterface;function getCPUhash(){var _0x3601df=_[_0x0b0e('0x6')](os['cpus']()['map'](function(_0x499eb9){return _0x499eb9[_0x0b0e('0x10')];}))[_0x0b0e('0x11')](':');return crypto[_0x0b0e('0x12')](_0x0b0e('0x13'))[_0x0b0e('0x14')](_0x3601df)['digest'](_0x0b0e('0x15'));}exports[_0x0b0e('0x16')]=function(){var _0x4796a2=os[_0x0b0e('0x17')]();var _0x2f9cf3=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x2f9cf3['test'](config[_0x0b0e('0x18')])){return config[_0x0b0e('0x18')];}else if(_0x4796a2===_0x0b0e('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x0b0e('0x1a')})[_0x0b0e('0x1b')]('\x0d\x0a','');}else{var _0xa1b4ec=getFirstInterface();var _0x36bc36=getCPUhash();var _0x8d4438=_0x36bc36+'|'+os['hostname']()+'|'+_0xa1b4ec['macAddress']+'|'+_0xa1b4ec[_0x0b0e('0x1c')];var _0x6fba4c=crypto[_0x0b0e('0x12')](_0x0b0e('0x13'))['update'](_0x8d4438)[_0x0b0e('0x1d')](_0x0b0e('0x15'));return _0x6fba4c['substring'](0x0,0x8)+'-'+_0x6fba4c[_0x0b0e('0x1e')](0x8,0xc)+'-'+_0x6fba4c[_0x0b0e('0x1e')](0xc,0x10)+'-'+_0x6fba4c[_0x0b0e('0x1e')](0x10,0x14)+'-'+_0x6fba4c['substring'](0x14);}};
\ No newline at end of file
index 7b651fc..c1fafab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a14=['license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a14,0xdd));var _0x49a1=function(_0x551802,_0x39e2af){_0x551802=_0x551802-0x0;var _0x37387f=_0x9a14[_0x551802];return _0x37387f;};'use strict';var util=require(_0x49a1('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require(_0x49a1('0x1'))(module,_0x49a1('0x2'));var db=require(_0x49a1('0x3'))['db'];var encryptor=require(_0x49a1('0x4'));var hardware=require(_0x49a1('0x5'));var logger=require(_0x49a1('0x6'))(_0x49a1('0x7'));var HOST=_0x49a1('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2557ab){return new BPromise(function(_0x5d2337,_0x2c414a){var _0x568491=util[_0x49a1('0x9')](_0x49a1('0xa'),HOST,_0x2557ab,module[_0x49a1('0xb')]['version']);if(oldToken){_0x568491=util['format'](_0x49a1('0xc'),HOST,_0x2557ab,module[_0x49a1('0xb')][_0x49a1('0x2')],oldToken);}var _0x417e03={'uri':_0x568491,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x417e03)[_0x49a1('0xd')](function(_0x24d7e4){_0x5d2337(_0x24d7e4);})[_0x49a1('0xe')](function(_0x1ebcd6){_0x2c414a(_0x1ebcd6);});});}function manageLicense(_0x46810a,_0x3437d3){var _0x21738b=_0x3437d3[_0x49a1('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x21738b[_0x49a1('0x10')]!==_0x46810a&&!_0x21738b['data2']){oldToken=_0x21738b[_0x49a1('0x10')];}httpRequest(_0x46810a)[_0x49a1('0xd')](function(_0x1d8cb3){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1d8cb3[_0x49a1('0x11')]){isOldTokenSent=![];if(!_0x21738b['license']&&_0x21738b[_0x49a1('0x7')]!=_0x1d8cb3[_0x49a1('0x7')]||_0x21738b['license']&&_0x21738b[_0x49a1('0x12')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x21738b[_0x49a1('0x7')]&&!_0x21738b[_0x49a1('0x12')]&&_0x21738b[_0x49a1('0x7')]!=_0x1d8cb3['license']){logger[_0x49a1('0x13')](_0x49a1('0x14'));}if(_0x21738b['license']&&!_0x21738b[_0x49a1('0x12')]&&_0x21738b[_0x49a1('0x7')]==_0x1d8cb3['license']){return _0x3437d3;}return _0x3437d3[_0x49a1('0x15')]({'data1':_0x46810a,'data2':null,'license':_0x1d8cb3[_0x49a1('0x7')]});}else{if(_0x1d8cb3[_0x49a1('0x7')]||_0x21738b[_0x49a1('0x7')]){if(!_0x21738b[_0x49a1('0x12')]){if(_0x21738b[_0x49a1('0x10')]==_0x46810a){GRAY_PERIOD_REASON='Disabled';logger[_0x49a1('0x13')](_0x49a1('0x16'));}else{GRAY_PERIOD_REASON=_0x49a1('0x17');logger[_0x49a1('0x13')](_0x49a1('0x18'),_0x21738b['data1'],_0x46810a);}logger[_0x49a1('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x49a1('0x19')](),moment()['format'](_0x49a1('0x1a')));return _0x3437d3[_0x49a1('0x15')]({'data2':encryptor[_0x49a1('0x1b')](moment()[_0x49a1('0x9')](_0x49a1('0x1a')))});}else{if(moment()[_0x49a1('0x1c')](encryptor[_0x49a1('0x1d')](_0x21738b[_0x49a1('0x12')]),_0x49a1('0x1e'))>DAYS){logger[_0x49a1('0x13')](_0x49a1('0x1f'),moment()[_0x49a1('0x9')](_0x49a1('0x1a')));isOldTokenSent=![];return _0x3437d3['update']({'data1':_0x46810a,'data2':null,'license':null});}}}else{if(_0x21738b['data1']!=_0x46810a){logger['info'](_0x49a1('0x18'),_0x21738b[_0x49a1('0x10')],_0x46810a);return _0x3437d3[_0x49a1('0x15')]({'data1':_0x46810a,'data2':null,'license':null});}}}return _0x3437d3;})[_0x49a1('0xd')](function(_0x202915){_0x3437d3=_0x202915;})[_0x49a1('0xe')](function(_0x5d7e49){logger[_0x49a1('0x20')](_0x5d7e49['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x3437d3);},TIME);});}function defaultLicense(){var _0x342dc2=hardware[_0x49a1('0x21')]();if(_0x342dc2){return db[_0x49a1('0x22')][_0x49a1('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x342dc2}})[_0x49a1('0x24')](function(_0x5191c7,_0x357752){logger[_0x49a1('0x13')](_0x49a1('0x25'),_0x342dc2);manageLicense(_0x342dc2,_0x5191c7);})[_0x49a1('0xe')](function(_0x19dd15){logger[_0x49a1('0x20')](_0x19dd15['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x3900=['%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','data2','then','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','update','error','message','finally','getUuid','findOrCreate','spread','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../logger','license','format'];(function(_0x175219,_0x23ec66){var _0x416369=function(_0x9e96a2){while(--_0x9e96a2){_0x175219['push'](_0x175219['shift']());}};_0x416369(++_0x23ec66);}(_0x3900,0x1f1));var _0x0390=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0x3900[_0x37e845];return _0x59e55b;};'use strict';var util=require(_0x0390('0x0'));var moment=require(_0x0390('0x1'));var rp=require(_0x0390('0x2'));var BPromise=require(_0x0390('0x3'));var pkginfo=require(_0x0390('0x4'))(module,_0x0390('0x5'));var db=require(_0x0390('0x6'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x0390('0x7'))(_0x0390('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x14fad2){return new BPromise(function(_0x529cab,_0x4cf3a3){var _0x2e0fbd=util[_0x0390('0x9')](_0x0390('0xa'),HOST,_0x14fad2,module[_0x0390('0xb')][_0x0390('0x5')]);if(oldToken){_0x2e0fbd=util['format'](_0x0390('0xc'),HOST,_0x14fad2,module[_0x0390('0xb')][_0x0390('0x5')],oldToken);}var _0x1675e3={'uri':_0x2e0fbd,'method':_0x0390('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x1675e3)['then'](function(_0x18810c){_0x529cab(_0x18810c);})[_0x0390('0xe')](function(_0x979724){_0x4cf3a3(_0x979724);});});}function manageLicense(_0x1e80b4,_0x3f9822){var _0x1d7cbf=_0x3f9822[_0x0390('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x1d7cbf[_0x0390('0x10')]!==_0x1e80b4&&!_0x1d7cbf[_0x0390('0x11')]){oldToken=_0x1d7cbf[_0x0390('0x10')];}httpRequest(_0x1e80b4)[_0x0390('0x12')](function(_0x40dffa){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x40dffa['active']){isOldTokenSent=![];if(!_0x1d7cbf[_0x0390('0x8')]&&_0x1d7cbf[_0x0390('0x8')]!=_0x40dffa[_0x0390('0x8')]||_0x1d7cbf['license']&&_0x1d7cbf['data2']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x1d7cbf[_0x0390('0x8')]&&!_0x1d7cbf[_0x0390('0x11')]&&_0x1d7cbf[_0x0390('0x8')]!=_0x40dffa['license']){logger['info'](_0x0390('0x13'));}if(_0x1d7cbf[_0x0390('0x8')]&&!_0x1d7cbf[_0x0390('0x11')]&&_0x1d7cbf[_0x0390('0x8')]==_0x40dffa[_0x0390('0x8')]){return _0x3f9822;}return _0x3f9822['update']({'data1':_0x1e80b4,'data2':null,'license':_0x40dffa[_0x0390('0x8')]});}else{if(_0x40dffa[_0x0390('0x8')]||_0x1d7cbf['license']){if(!_0x1d7cbf[_0x0390('0x11')]){if(_0x1d7cbf['data1']==_0x1e80b4){GRAY_PERIOD_REASON=_0x0390('0x14');logger[_0x0390('0x15')](_0x0390('0x16'));}else{GRAY_PERIOD_REASON=_0x0390('0x17');logger['info'](_0x0390('0x18'),_0x1d7cbf['data1'],_0x1e80b4);}logger[_0x0390('0x15')](_0x0390('0x19'),GRAY_PERIOD_REASON[_0x0390('0x1a')](),moment()[_0x0390('0x9')](_0x0390('0x1b')));return _0x3f9822['update']({'data2':encryptor['encryptString'](moment()['format'](_0x0390('0x1b')))});}else{if(moment()[_0x0390('0x1c')](encryptor[_0x0390('0x1d')](_0x1d7cbf[_0x0390('0x11')]),_0x0390('0x1e'))>DAYS){logger[_0x0390('0x15')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0390('0x9')](_0x0390('0x1b')));isOldTokenSent=![];return _0x3f9822[_0x0390('0x1f')]({'data1':_0x1e80b4,'data2':null,'license':null});}}}else{if(_0x1d7cbf[_0x0390('0x10')]!=_0x1e80b4){logger[_0x0390('0x15')](_0x0390('0x18'),_0x1d7cbf[_0x0390('0x10')],_0x1e80b4);return _0x3f9822[_0x0390('0x1f')]({'data1':_0x1e80b4,'data2':null,'license':null});}}}return _0x3f9822;})['then'](function(_0x17775d){_0x3f9822=_0x17775d;})[_0x0390('0xe')](function(_0x5b407b){logger[_0x0390('0x20')](_0x5b407b[_0x0390('0x21')]);})[_0x0390('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0x0390('0x23')](),_0x3f9822);},TIME);});}function defaultLicense(){var _0x16e640=hardware[_0x0390('0x23')]();if(_0x16e640){return db['License'][_0x0390('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x16e640}})[_0x0390('0x25')](function(_0x54ac52,_0x578bac){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x16e640);manageLicense(_0x16e640,_0x54ac52);})[_0x0390('0xe')](function(_0x2343e1){logger[_0x0390('0x20')](_0x2343e1[_0x0390('0x21')]);});}}exports[_0x0390('0x26')]=defaultLicense;
\ No newline at end of file
index b9c1fa0..3054f72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ee1=['format','parse','machineUuid','getUuid','gray','deadline','add','days','uuid','changed','disabled','message','User','role','col','count','admin','user','users','telephones','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','License','find','then','catch','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString'];(function(_0x3b50f3,_0x38a154){var _0x2eb4a5=function(_0x380077){while(--_0x380077){_0x3b50f3['push'](_0x3b50f3['shift']());}};_0x2eb4a5(++_0x38a154);}(_0x8ee1,0x1bd));var _0x18ee=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x8ee1[_0x51674a];return _0x13fca6;};'use strict';var util=require(_0x18ee('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0x18ee('0x1'));var hardware=require(_0x18ee('0x2'));var encryptor=require(_0x18ee('0x3'));var db=require(_0x18ee('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x18ee('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x186f73){return new BPromise(function(_0xec0771,_0x17acc5){return db[_0x18ee('0x6')][_0x18ee('0x7')](_['defaults'](_0x186f73,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xc88e78){return checkLicense(_0xc88e78,null);})[_0x18ee('0x8')](function(_0x121803){_0xec0771(_0x121803);return;})[_0x18ee('0x9')](function(_0x2d7853){_0x17acc5(_0x2d7853);});});}function checkLicense(_0x5984c4,_0x53e125){if(!_0x5984c4){demoLicense['uuid']=_0x5984c4['data1'];return demoLicense;}try{var _0xe15026=_0x53e125||_0x5984c4[_0x18ee('0xa')];if(_[_0x18ee('0xb')](_0xe15026)){throw new Error(_0x18ee('0xc'));}var _0x54a31d=_0x5984c4[_0x18ee('0xd')];var _0x44a073=_0x5984c4[_0x18ee('0xe')];var _0x58b010=_0x54a31d[_0x18ee('0xf')]('-')[0x4];var _0x513fac=_0x54a31d['split']('-')[0x0];var _0x593277=encryptor[_0x18ee('0x10')](_0xe15026,util[_0x18ee('0x11')]('%s:%s:%s',_0x58b010,_0x54a31d,_0x513fac));var _0x1abd7a=JSON[_0x18ee('0x12')](_0x593277);_0x1abd7a['demo']=![];_0x1abd7a['uuid']=_0x54a31d;_0x1abd7a[_0x18ee('0x13')]=hardware[_0x18ee('0x14')]();if(_0x44a073){var _0x224f3c=encryptor[_0x18ee('0x10')](_0x44a073);_0x1abd7a[_0x18ee('0x15')]=_0x224f3c;_0x1abd7a[_0x18ee('0x16')]=moment(_0x224f3c)[_0x18ee('0x17')](0x7,_0x18ee('0x18'))[_0x18ee('0x11')]();_0x1abd7a['grayReason']=_0x1abd7a[_0x18ee('0x19')]!=_0x1abd7a[_0x18ee('0x13')]?_0x18ee('0x1a'):_0x18ee('0x1b');}return _0x1abd7a;}catch(_0x38f3b9){breakingLicense[_0x18ee('0x19')]=_0x5984c4[_0x18ee('0xd')];breakingLicense[_0x18ee('0x1c')]=_0x38f3b9['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4715a9,_0xddfd11){getLicense()[_0x18ee('0x8')](function(_0x46028f){return db[_0x18ee('0x1d')]['findAll']({'attributes':[_0x18ee('0x1e'),[db['sequelize']['fn']('COUNT',db['sequelize'][_0x18ee('0x1f')](_0x18ee('0x1e'))),_0x18ee('0x20')]],'group':_0x18ee('0x1e'),'where':{'role':{'$or':[_0x18ee('0x21'),_0x18ee('0x22'),'telephone']}},'raw':!![]})[_0x18ee('0x8')](function(_0x1e66d0){var _0x4bcbd8={'user':_0x46028f[_0x18ee('0x23')]||0x0,'telephone':_0x46028f[_0x18ee('0x24')]||0x0};_0x1e66d0['forEach'](function(_0x59c301){var _0x4c602b=_0x59c301['role']==='admin'?_0x18ee('0x22'):_0x59c301[_0x18ee('0x1e')];_0x4bcbd8[_0x4c602b]-=_0x59c301[_0x18ee('0x20')];if(_0x4bcbd8[_0x4c602b]<0x0)_0x4bcbd8[_0x4c602b]=0x0;});_0x4715a9(_0x4bcbd8);return;});})['catch'](function(_0x3a26f6){_0xddfd11(_0x3a26f6);});});}function checkUserLimits(_0x1edaab){return new BPromise(function(_0x2b4299,_0x49d626){getLimits()[_0x18ee('0x8')](function(_0x5385d1){var _0x46fdf0=_[_0x18ee('0x25')](_['countBy'](_0x1edaab,_0x18ee('0x1e')),[_0x18ee('0x21'),_0x18ee('0x22'),_0x18ee('0x26')]);var _0x496951=(_0x46fdf0[_0x18ee('0x21')]||0x0)+(_0x46fdf0[_0x18ee('0x22')]||0x0);var _0xd6a2cc=_0x46fdf0[_0x18ee('0x26')]||0x0;if(_0x496951>_0x5385d1['user'])return _0x49d626(_0x18ee('0x27'));if(_0xd6a2cc>_0x5385d1[_0x18ee('0x26')])return _0x49d626(_0x18ee('0x28'));return _0x2b4299();})[_0x18ee('0x9')](function(_0x5bea6e){_0x49d626(_0x5bea6e);});});}module[_0x18ee('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xec0d=['users','telephones','forEach','countBy','user','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','format','%s:%s:%s','parse','demo','uuid','machineUuid','days','grayReason','changed','disabled','message','User','findAll','sequelize','COUNT','role','admin','telephone'];(function(_0x33845d,_0x2fc3e5){var _0x7a184f=function(_0x3c5e69){while(--_0x3c5e69){_0x33845d['push'](_0x33845d['shift']());}};_0x7a184f(++_0x2fc3e5);}(_0xec0d,0x1ec));var _0xdec0=function(_0x2aa93f,_0x4dce40){_0x2aa93f=_0x2aa93f-0x0;var _0x194c71=_0xec0d[_0x2aa93f];return _0x194c71;};'use strict';var util=require(_0xdec0('0x0'));var _=require(_0xdec0('0x1'));var moment=require(_0xdec0('0x2'));var BPromise=require(_0xdec0('0x3'));var hardware=require(_0xdec0('0x4'));var encryptor=require('../../components/encryptor');var db=require(_0xdec0('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdec0('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xdec0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdec0('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdec0('0x8'),'machineUuid':hardware[_0xdec0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5782e5){return new BPromise(function(_0x483c92,_0x33cd29){return db[_0xdec0('0x9')][_0xdec0('0xa')](_[_0xdec0('0xb')](_0x5782e5,{'raw':!![],'where':{'id':0x1}}))[_0xdec0('0xc')](function(_0x60741f){return checkLicense(_0x60741f,null);})['then'](function(_0x1c1d90){_0x483c92(_0x1c1d90);return;})[_0xdec0('0xd')](function(_0x22ec61){_0x33cd29(_0x22ec61);});});}function checkLicense(_0x364713,_0x193e98){if(!_0x364713){demoLicense['uuid']=_0x364713[_0xdec0('0xe')];return demoLicense;}try{var _0x251d13=_0x193e98||_0x364713[_0xdec0('0xf')];if(_[_0xdec0('0x10')](_0x251d13)){throw new Error(_0xdec0('0x11'));}var _0x203165=_0x364713[_0xdec0('0xe')];var _0x3af428=_0x364713['data2'];var _0x230fe6=_0x203165['split']('-')[0x4];var _0x5247c3=_0x203165['split']('-')[0x0];var _0x4820be=encryptor['decryptString'](_0x251d13,util[_0xdec0('0x12')](_0xdec0('0x13'),_0x230fe6,_0x203165,_0x5247c3));var _0x400e38=JSON[_0xdec0('0x14')](_0x4820be);_0x400e38[_0xdec0('0x15')]=![];_0x400e38[_0xdec0('0x16')]=_0x203165;_0x400e38[_0xdec0('0x17')]=hardware[_0xdec0('0x7')]();if(_0x3af428){var _0x3564c2=encryptor['decryptString'](_0x3af428);_0x400e38['gray']=_0x3564c2;_0x400e38['deadline']=moment(_0x3564c2)['add'](0x7,_0xdec0('0x18'))[_0xdec0('0x12')]();_0x400e38[_0xdec0('0x19')]=_0x400e38[_0xdec0('0x16')]!=_0x400e38[_0xdec0('0x17')]?_0xdec0('0x1a'):_0xdec0('0x1b');}return _0x400e38;}catch(_0x382329){breakingLicense[_0xdec0('0x16')]=_0x364713[_0xdec0('0xe')];breakingLicense['message']=_0x382329[_0xdec0('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x5d91c7,_0x2a6cb7){getLicense()[_0xdec0('0xc')](function(_0x54dc9e){return db[_0xdec0('0x1d')][_0xdec0('0x1e')]({'attributes':['role',[db[_0xdec0('0x1f')]['fn'](_0xdec0('0x20'),db[_0xdec0('0x1f')]['col'](_0xdec0('0x21'))),'count']],'group':_0xdec0('0x21'),'where':{'role':{'$or':[_0xdec0('0x22'),'user',_0xdec0('0x23')]}},'raw':!![]})[_0xdec0('0xc')](function(_0x79ef81){var _0x366f87={'user':_0x54dc9e[_0xdec0('0x24')]||0x0,'telephone':_0x54dc9e[_0xdec0('0x25')]||0x0};_0x79ef81[_0xdec0('0x26')](function(_0x1dc501){var _0x5cfba5=_0x1dc501[_0xdec0('0x21')]===_0xdec0('0x22')?'user':_0x1dc501[_0xdec0('0x21')];_0x366f87[_0x5cfba5]-=_0x1dc501['count'];if(_0x366f87[_0x5cfba5]<0x0)_0x366f87[_0x5cfba5]=0x0;});_0x5d91c7(_0x366f87);return;});})[_0xdec0('0xd')](function(_0xbda2a5){_0x2a6cb7(_0xbda2a5);});});}function checkUserLimits(_0x110c69){return new BPromise(function(_0x3e9ac9,_0x1ec5aa){getLimits()[_0xdec0('0xc')](function(_0x3a35cf){var _0x3718bc=_['pick'](_[_0xdec0('0x27')](_0x110c69,_0xdec0('0x21')),['admin',_0xdec0('0x28'),'telephone']);var _0x5dd332=(_0x3718bc[_0xdec0('0x22')]||0x0)+(_0x3718bc['user']||0x0);var _0x35df95=_0x3718bc[_0xdec0('0x23')]||0x0;if(_0x5dd332>_0x3a35cf[_0xdec0('0x28')])return _0x1ec5aa(_0xdec0('0x29'));if(_0x35df95>_0x3a35cf[_0xdec0('0x23')])return _0x1ec5aa(_0xdec0('0x2a'));return _0x3e9ac9();})[_0xdec0('0xd')](function(_0x35716e){_0x1ec5aa(_0x35716e);});});}module[_0xdec0('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 1e8d1db..890ee70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2cf=['app-id','http://localhost:9000'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x2af504,_0x46a924){_0x2af504=_0x2af504-0x0;var _0x2abb2e=_0xe2cf[_0x2af504];return _0x2abb2e;};'use strict';module['exports']={'DOMAIN':_0xfe2c('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xfe2c('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0xefda=['exports','app-id','secret'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xefda,0x96));var _0xaefd=function(_0x4cce3d,_0x1e84ea){_0x4cce3d=_0x4cce3d-0x0;var _0x39b6df=_0xefda[_0x4cce3d];return _0x39b6df;};'use strict';module[_0xaefd('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xaefd('0x1'),'GOOGLE_SECRET':_0xaefd('0x2'),'DEBUG':''};
\ No newline at end of file
index 0d51f17..52d7d26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47f3=['env','debugLevel','moment','winston','INFO','join','log','xcally','format','%s-%s.log','message','replace','{{{','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','transports','File','error','info'];(function(_0x45b275,_0x19500a){var _0x3f5781=function(_0x2d4bc5){while(--_0x2d4bc5){_0x45b275['push'](_0x45b275['shift']());}};_0x3f5781(++_0x19500a);}(_0x47f3,0x13d));var _0x347f=function(_0x5986bc,_0x54e5f7){_0x5986bc=_0x5986bc-0x0;var _0x48d058=_0x47f3[_0x5986bc];return _0x48d058;};'use strict';var moment=require(_0x347f('0x0'));var winston=require(_0x347f('0x1'));var util=require('util');var path=require('path');var debugLevel=_0x347f('0x2');function filename(_0x58222c,_0x266b2d){return path[_0x347f('0x3')]('/var',_0x347f('0x4'),_0x347f('0x5'),util[_0x347f('0x6')](_0x347f('0x7'),_0x58222c,_0x266b2d));}function formatter(_0x1e56c0,_0x119a89){_0x119a89[_0x347f('0x8')]=_0x119a89[_0x347f('0x8')][_0x347f('0x9')](/@@{/g,_0x347f('0xa'))['replace'](/}@@/g,'}}}')[_0x347f('0x9')](/@{/g,'{{')[_0x347f('0x9')](/}@/g,'}}');return util[_0x347f('0x6')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x347f('0x6')](_0x347f('0xb')),_0x119a89[_0x347f('0xc')][_0x347f('0xd')](),_0x1e56c0,_0x119a89[_0x347f('0x8')]);}module[_0x347f('0xe')]=function(_0x3bcabb){return new winston['Logger']({'transports':[new winston[(_0x347f('0xf'))][(_0x347f('0x10'))]({'name':util['format']('%s-%s',_0x3bcabb,_0x347f('0x11')),'filename':filename(_0x3bcabb,'error'),'level':_0x347f('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5b5e09){return formatter(_0x3bcabb,_0x5b5e09);}}),new winston[(_0x347f('0xf'))]['File']({'name':util[_0x347f('0x6')]('%s-%s',_0x3bcabb,'info'),'filename':filename(_0x3bcabb,_0x347f('0x12')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x29baaf){return formatter(_0x3bcabb,_0x29baaf);}}),new winston[(_0x347f('0xf'))]['Console']({'level':process[_0x347f('0x13')][_0x347f('0x14')]||debugLevel,'json':![],'formatter':function(_0x4d4861){return formatter(_0x3bcabb,_0x4d4861);}})]});};
\ No newline at end of file
+var _0x0765=['YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','winston','INFO','join','/var','xcally','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x0765,0xee));var _0x5076=function(_0x485820,_0x42c10b){_0x485820=_0x485820-0x0;var _0x2dab83=_0x0765[_0x485820];return _0x2dab83;};'use strict';var moment=require('moment');var winston=require(_0x5076('0x0'));var util=require('util');var path=require('path');var debugLevel=_0x5076('0x1');function filename(_0x3103e6,_0x498e65){return path[_0x5076('0x2')](_0x5076('0x3'),'log',_0x5076('0x4'),util[_0x5076('0x5')](_0x5076('0x6'),_0x3103e6,_0x498e65));}function formatter(_0x2ec9e7,_0x26ea39){_0x26ea39[_0x5076('0x7')]=_0x26ea39[_0x5076('0x7')]['replace'](/@@{/g,_0x5076('0x8'))[_0x5076('0x9')](/}@@/g,_0x5076('0xa'))['replace'](/@{/g,'{{')[_0x5076('0x9')](/}@/g,'}}');return util[_0x5076('0x5')](_0x5076('0xb'),moment()['format'](_0x5076('0xc')),_0x26ea39[_0x5076('0xd')][_0x5076('0xe')](),_0x2ec9e7,_0x26ea39[_0x5076('0x7')]);}module[_0x5076('0xf')]=function(_0x5019a3){return new winston[(_0x5076('0x10'))]({'transports':[new winston[(_0x5076('0x11'))][(_0x5076('0x12'))]({'name':util[_0x5076('0x5')](_0x5076('0x13'),_0x5019a3,_0x5076('0x14')),'filename':filename(_0x5019a3,_0x5076('0x14')),'level':_0x5076('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb64a91){return formatter(_0x5019a3,_0xb64a91);}}),new winston['transports'][(_0x5076('0x12'))]({'name':util[_0x5076('0x5')](_0x5076('0x13'),_0x5019a3,_0x5076('0x15')),'filename':filename(_0x5019a3,_0x5076('0x15')),'level':_0x5076('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x712ebf){return formatter(_0x5019a3,_0x712ebf);}}),new winston[(_0x5076('0x11'))][(_0x5076('0x16'))]({'level':process[_0x5076('0x17')][_0x5076('0x18')]||debugLevel,'json':![],'formatter':function(_0x43d185){return formatter(_0x5019a3,_0x43d185);}})]});};
\ No newline at end of file
index 9bc3a06..5a0a38c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4e=['express','join','../../services/express/index.js','ami','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xee4e,0x1ac));var _0xeee4=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xee4e[_0x376b45];return _0x2341b3;};'use strict';var path=require(_0xeee4('0x0'));var os=require('os');var config={'apps':[{'name':_0xeee4('0x1'),'script':path[_0xeee4('0x2')](__dirname,_0xeee4('0x3'))},{'name':_0xeee4('0x4'),'script':path[_0xeee4('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xeee4('0x5'),'script':path['join'](__dirname,_0xeee4('0x6'))},{'name':_0xeee4('0x7'),'script':path['join'](__dirname,_0xeee4('0x8'))},{'name':'xdr','script':path[_0xeee4('0x2')](__dirname,_0xeee4('0x9'))}]};module[_0xeee4('0xa')]=config;
\ No newline at end of file
+var _0x322c=['agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','exports','path','express','ami','join'];(function(_0x39d69e,_0x40ae0c){var _0x42c581=function(_0x4b5c42){while(--_0x4b5c42){_0x39d69e['push'](_0x39d69e['shift']());}};_0x42c581(++_0x40ae0c);}(_0x322c,0xe3));var _0xc322=function(_0x2c8bc6,_0x1115a3){_0x2c8bc6=_0x2c8bc6-0x0;var _0x1de4d1=_0x322c[_0x2c8bc6];return _0x1de4d1;};'use strict';var path=require(_0xc322('0x0'));var os=require('os');var config={'apps':[{'name':_0xc322('0x1'),'script':path['join'](__dirname,'../../services/express/index.js')},{'name':_0xc322('0x2'),'script':path[_0xc322('0x3')](__dirname,'../../services/ami/index.js')},{'name':_0xc322('0x4'),'script':path[_0xc322('0x3')](__dirname,_0xc322('0x5'))},{'name':_0xc322('0x6'),'script':path[_0xc322('0x3')](__dirname,_0xc322('0x7'))},{'name':'routing','script':path[_0xc322('0x3')](__dirname,_0xc322('0x8'))},{'name':_0xc322('0x9'),'script':path[_0xc322('0x3')](__dirname,'../../services/xdr/index.js')}]};module[_0xc322('0xa')]=config;
\ No newline at end of file
index 32c84eb..7814922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d0d=['pm2','bluebird','./config','connected','start','then','stop','disconnect','restart','list','describe','delete','dump'];(function(_0x39ac73,_0x3194c8){var _0x49ea65=function(_0x2ebb20){while(--_0x2ebb20){_0x39ac73['push'](_0x39ac73['shift']());}};_0x49ea65(++_0x3194c8);}(_0x4d0d,0xd0));var _0xd4d0=function(_0x142c59,_0x42acaf){_0x142c59=_0x142c59-0x0;var _0x32d3a0=_0x4d0d[_0x142c59];return _0x32d3a0;};'use strict';var pm2=require(_0xd4d0('0x0'));var BPromise=require(_0xd4d0('0x1'));var config=require(_0xd4d0('0x2'));function connect(){return new BPromise(function(_0x54d176,_0x5575e7){return pm2['connect'](function(_0x292fcb){if(_0x292fcb){return _0x5575e7(_0x292fcb);}return _0x54d176(_0xd4d0('0x3'));});});};exports[_0xd4d0('0x4')]=function(_0x4ef7a6){return connect()[_0xd4d0('0x5')](function(){return new BPromise(function(_0x38e626,_0xbf2ea4){return pm2[_0xd4d0('0x4')](_0x4ef7a6,function(_0x3a11ad,_0x4124b4){if(_0x3a11ad){return _0xbf2ea4(_0x3a11ad);}pm2['disconnect']();return _0x38e626(_0x4124b4);});});});};exports[_0xd4d0('0x6')]=function(_0x3c996e){return connect()['then'](function(){return new BPromise(function(_0x146211,_0x2b56fd){return pm2[_0xd4d0('0x6')](_0x3c996e,function(_0x43b3aa,_0x84c01f){if(_0x43b3aa){return _0x2b56fd(_0x43b3aa);}pm2[_0xd4d0('0x7')]();return _0x146211(_0x84c01f);});});});};exports['restart']=function(_0x2e978e){return connect()['then'](function(){return new BPromise(function(_0x523a71,_0x141d97){return pm2[_0xd4d0('0x8')](_0x2e978e,function(_0x10638c,_0x2ddb4f){if(_0x10638c){return _0x141d97(_0x10638c);}pm2[_0xd4d0('0x7')]();return _0x523a71(_0x2ddb4f);});});});};exports[_0xd4d0('0x9')]=function(){return connect()[_0xd4d0('0x5')](function(){return new BPromise(function(_0x4ea630,_0x5efbc5){return pm2['list'](function(_0x32367f,_0x47959b){if(_0x32367f){return _0x5efbc5(_0x32367f);}pm2[_0xd4d0('0x7')]();return _0x4ea630(_0x47959b);});});});};exports['describe']=function(_0x511339){return connect()['then'](function(){return new BPromise(function(_0x1fe0a2,_0x28cef8){return pm2[_0xd4d0('0xa')](_0x511339,function(_0x4e7040,_0x29664f){if(_0x4e7040){return _0x28cef8(_0x4e7040);}pm2['disconnect']();return _0x1fe0a2(_0x29664f);});});});};exports[_0xd4d0('0xb')]=function(_0x112d94){return connect()[_0xd4d0('0x5')](function(){return new BPromise(function(_0x14aa36,_0x52d3b2){return pm2[_0xd4d0('0xb')](_0x112d94,function(_0x5447a2,_0x4594b2){if(_0x5447a2){return _0x52d3b2(_0x5447a2);}pm2['disconnect']();return _0x14aa36(_0x4594b2);});});});};exports[_0xd4d0('0xc')]=function(){return connect()[_0xd4d0('0x5')](function(){return new BPromise(function(_0x3ea371,_0x84e307){return pm2[_0xd4d0('0xc')](function(_0x3aa79b){if(_0x3aa79b){return _0x84e307(_0x3aa79b);}return _0x3ea371('saved');});});});};
\ No newline at end of file
+var _0x7738=['saved','pm2','bluebird','connect','connected','start','then','disconnect','stop','restart','list','delete','dump'];(function(_0x5db129,_0x151303){var _0x5ec143=function(_0x245b33){while(--_0x245b33){_0x5db129['push'](_0x5db129['shift']());}};_0x5ec143(++_0x151303);}(_0x7738,0x1c8));var _0x8773=function(_0x44b0de,_0x213afa){_0x44b0de=_0x44b0de-0x0;var _0x21da2a=_0x7738[_0x44b0de];return _0x21da2a;};'use strict';var pm2=require(_0x8773('0x0'));var BPromise=require(_0x8773('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x1efb26,_0x1d77a4){return pm2[_0x8773('0x2')](function(_0x1e307c){if(_0x1e307c){return _0x1d77a4(_0x1e307c);}return _0x1efb26(_0x8773('0x3'));});});};exports[_0x8773('0x4')]=function(_0x10a2d1){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x5bc227,_0x137744){return pm2[_0x8773('0x4')](_0x10a2d1,function(_0x13338c,_0x31edde){if(_0x13338c){return _0x137744(_0x13338c);}pm2[_0x8773('0x6')]();return _0x5bc227(_0x31edde);});});});};exports[_0x8773('0x7')]=function(_0x173bec){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x3d333a,_0x3f9605){return pm2[_0x8773('0x7')](_0x173bec,function(_0x413954,_0x318031){if(_0x413954){return _0x3f9605(_0x413954);}pm2[_0x8773('0x6')]();return _0x3d333a(_0x318031);});});});};exports[_0x8773('0x8')]=function(_0x51bc01){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x198486,_0x409d5e){return pm2[_0x8773('0x8')](_0x51bc01,function(_0x4662e6,_0x390339){if(_0x4662e6){return _0x409d5e(_0x4662e6);}pm2[_0x8773('0x6')]();return _0x198486(_0x390339);});});});};exports[_0x8773('0x9')]=function(){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x32bac4,_0x244de5){return pm2[_0x8773('0x9')](function(_0xff2038,_0x3928f2){if(_0xff2038){return _0x244de5(_0xff2038);}pm2['disconnect']();return _0x32bac4(_0x3928f2);});});});};exports['describe']=function(_0x17a308){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x1cb5ed,_0x55f73a){return pm2['describe'](_0x17a308,function(_0x1d4650,_0x151677){if(_0x1d4650){return _0x55f73a(_0x1d4650);}pm2['disconnect']();return _0x1cb5ed(_0x151677);});});});};exports[_0x8773('0xa')]=function(_0x183100){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x1bf2e6,_0x28d5ff){return pm2['delete'](_0x183100,function(_0x4e2f09,_0x1dc55c){if(_0x4e2f09){return _0x28d5ff(_0x4e2f09);}pm2[_0x8773('0x6')]();return _0x1bf2e6(_0x1dc55c);});});});};exports['dump']=function(){return connect()[_0x8773('0x5')](function(){return new BPromise(function(_0x556526,_0x15c54f){return pm2[_0x8773('0xb')](function(_0x46c0fd){if(_0x46c0fd){return _0x15c54f(_0x46c0fd);}return _0x556526(_0x8773('0xc'));});});});};
\ No newline at end of file
index cb74177..4bf945b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x725f=['timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','ioredis','util','../../mysqldb','schedule','defaults','redis','localhost','socket.io-emitter','Setting','chatTimeout','findAll','lastMsgAt','subtract','minutes','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system'];(function(_0x37f32e,_0x216a0a){var _0x4c651d=function(_0x31f90b){while(--_0x31f90b){_0x37f32e['push'](_0x37f32e['shift']());}};_0x4c651d(++_0x216a0a);}(_0x725f,0x1e6));var _0xf725=function(_0x471e4c,_0x1400ce){_0x471e4c=_0x471e4c-0x0;var _0x1b8136=_0x725f[_0x471e4c];return _0x1b8136;};'use strict';var _=require('lodash');var moment=require(_0xf725('0x0'));var Redis=require(_0xf725('0x1'));var util=require(_0xf725('0x2'));var config=require('../../config/environment');var db=require(_0xf725('0x3'))['db'];var logger=require('../logger')(_0xf725('0x4'));config['redis']=_[_0xf725('0x5')](config[_0xf725('0x6')],{'host':_0xf725('0x7'),'port':0x18eb});var io=require(_0xf725('0x8'))(new Redis(config[_0xf725('0x6')]));function closeInteractions(){var _0x4b4902=0x0;var _0x315c54=[];return db[_0xf725('0x9')]['find']({'raw':!![],'attributes':['id',_0xf725('0xa')],'where':{'id':0x1}})['then'](function(_0x447820){_0x4b4902=_0x447820[_0xf725('0xa')];if(_0x4b4902){return db['ChatInteraction'][_0xf725('0xb')]({'raw':!![],'attributes':['id',_0xf725('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf725('0xd')](_0x447820['chatTimeout'],_0xf725('0xe'))}}});}else{return[];}})[_0xf725('0xf')](function(_0x22479b){if(_0x22479b&&_0x22479b[_0xf725('0x10')]){_0x315c54=_[_0xf725('0x11')](_0x22479b||[],'id');logger[_0xf725('0x12')](_0xf725('0x13'),_0x315c54[_0xf725('0x14')]());return db[_0xf725('0x15')][_0xf725('0x16')]({'closeReason':_0xf725('0x17'),'disposition':_0xf725('0x18'),'closed':!![],'closedAt':moment()[_0xf725('0x19')](_0xf725('0x1a'))},{'where':{'id':_0x315c54}});}})[_0xf725('0xf')](function(){if(_0x315c54&&_0x315c54[_0xf725('0x10')]){logger[_0xf725('0x12')](_0xf725('0x1b'),_0x315c54[_0xf725('0x14')]());for(var _0x1a2b6d=0x0;_0x1a2b6d<_0x315c54[_0xf725('0x10')];_0x1a2b6d++){io[_0xf725('0x1c')](_0xf725('0x1d'),{'id':_0x315c54[_0x1a2b6d],'closed':!![]});}}})[_0xf725('0x1e')](function(_0x23b615){logger[_0xf725('0x1f')](_0xf725('0x20'),_0x23b615?util['inspect'](_0x23b615,{'showHidden':![],'depth':null}):'');});}exports[_0xf725('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xa02c=['update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','socket.io-emitter','find','chatTimeout','then','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0x265894,_0x3327ed){var _0x5a1a0d=function(_0x41c047){while(--_0x41c047){_0x265894['push'](_0x265894['shift']());}};_0x5a1a0d(++_0x3327ed);}(_0xa02c,0xf9));var _0xca02=function(_0x2c9962,_0x81cea5){_0x2c9962=_0x2c9962-0x0;var _0x6726f1=_0xa02c[_0x2c9962];return _0x6726f1;};'use strict';var _=require(_0xca02('0x0'));var moment=require(_0xca02('0x1'));var Redis=require(_0xca02('0x2'));var util=require('util');var config=require(_0xca02('0x3'));var db=require(_0xca02('0x4'))['db'];var logger=require(_0xca02('0x5'))(_0xca02('0x6'));config['redis']=_['defaults'](config[_0xca02('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xca02('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x53660a=0x0;var _0x5bfa7b=[];return db['Setting'][_0xca02('0x9')]({'raw':!![],'attributes':['id',_0xca02('0xa')],'where':{'id':0x1}})[_0xca02('0xb')](function(_0x2d9a0a){_0x53660a=_0x2d9a0a['chatTimeout'];if(_0x53660a){return db['ChatInteraction'][_0xca02('0xc')]({'raw':!![],'attributes':['id',_0xca02('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xca02('0xe')](_0x2d9a0a[_0xca02('0xa')],_0xca02('0xf'))}}});}else{return[];}})['then'](function(_0x58f542){if(_0x58f542&&_0x58f542[_0xca02('0x10')]){_0x5bfa7b=_[_0xca02('0x11')](_0x58f542||[],'id');logger[_0xca02('0x12')](_0xca02('0x13'),_0x5bfa7b[_0xca02('0x14')]());return db['ChatInteraction'][_0xca02('0x15')]({'closeReason':'system','disposition':_0xca02('0x16'),'closed':!![],'closedAt':moment()[_0xca02('0x17')](_0xca02('0x18'))},{'where':{'id':_0x5bfa7b}});}})[_0xca02('0xb')](function(){if(_0x5bfa7b&&_0x5bfa7b[_0xca02('0x10')]){logger[_0xca02('0x12')](_0xca02('0x19'),_0x5bfa7b[_0xca02('0x14')]());for(var _0x5ce4b7=0x0;_0x5ce4b7<_0x5bfa7b[_0xca02('0x10')];_0x5ce4b7++){io['emit'](_0xca02('0x1a'),{'id':_0x5bfa7b[_0x5ce4b7],'closed':!![]});}}})[_0xca02('0x1b')](function(_0x346ecb){logger[_0xca02('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x346ecb?util['inspect'](_0x346ecb,{'showHidden':![],'depth':null}):'');});}exports[_0xca02('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 71b7bd4..39f135a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df4=['join','existsSync','status','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','message','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','difference','length','stop','delete\x20cron','index','my\x20id','run\x20job','cron','active','isBetween','add','add\x20cron','deleteJob','stop\x20cron','exists','update','update\x20cron','run','start','util','path','jayson/promise','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','../../files/reports','%s.%s','basename','savename','extname','zip'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6df4,0x190));var _0x46df=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x6df4[_0x40a825];return _0x273a54;};'use strict';var fs=require('fs');var util=require(_0x46df('0x0'));var path=require(_0x46df('0x1'));var _=require('lodash');var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x46df('0x2'));var BPromise=require('bluebird');var logger=require('../logger')(_0x46df('0x3'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x46df('0x4'));var client=jayson['client'][_0x46df('0x5')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x463729,_0x3a37b5){return function(){logger[_0x46df('0x6')](_0x46df('0x7'),_0x463729[_0x46df('0x8')]);var _0xd3ca3d=!![];var _0x1c06d1={'tls':{'rejectUnauthorized':![]}};if(_0x463729[_0x46df('0x9')][_0x46df('0xa')]['service']){_0x1c06d1['service']=_0x463729[_0x46df('0x9')][_0x46df('0xa')][_0x46df('0xb')];}else{_0x1c06d1[_0x46df('0xc')]=_0x463729[_0x46df('0x9')][_0x46df('0xa')]['host'];_0x1c06d1[_0x46df('0xd')]=_0x463729['MailAccount']['Smtp']['port'];_0x1c06d1['secure']=_0x463729[_0x46df('0x9')][_0x46df('0xa')][_0x46df('0xe')];}if(_0x463729[_0x46df('0x9')][_0x46df('0xa')][_0x46df('0xf')]){_0x1c06d1[_0x46df('0x10')]={'user':_0x463729['MailAccount'][_0x46df('0xa')][_0x46df('0x11')],'pass':_0x463729['MailAccount'][_0x46df('0xa')][_0x46df('0x12')]};}var _0x3de7b1={'account':_0x1c06d1,'message':{'from':util[_0x46df('0x13')](_0x46df('0x14'),_0x463729['MailAccount'][_0x46df('0x15')],_0x463729['MailAccount'][_0x46df('0x8')]||_0x463729[_0x46df('0x9')][_0x46df('0xa')]['user']),'to':_0x463729['email'],'cc':_0x463729['cc'],'bcc':_0x463729[_0x46df('0x16')],'subject':util[_0x46df('0x13')](_0x46df('0x17'),_0x3a37b5['name'],_0x463729['subtractNumber'],_0x463729['subtractUnit'])}};var _0x53f273=path['join'](__dirname,_0x46df('0x18'));var _0x14c4ff=_0x3a37b5['savename'];var _0x28a44e=util[_0x46df('0x13')](_0x46df('0x19'),path[_0x46df('0x1a')](_0x3a37b5[_0x46df('0x1b')],path[_0x46df('0x1c')](_0x3a37b5[_0x46df('0x1b')])),_0x46df('0x1d'));var _0x1f9ed8=path[_0x46df('0x1e')](_0x53f273,_0x14c4ff);var _0x27de0b=path[_0x46df('0x1e')](_0x53f273,_0x28a44e);if(fs[_0x46df('0x1f')](_0x1f9ed8)){_0x3a37b5[_0x46df('0x20')]='Sent';_0x3de7b1['message'][_0x46df('0x21')]=[{'filename':_0x14c4ff,'path':_0x1f9ed8}];_0x3de7b1['message']['text']=util[_0x46df('0x13')](_0x46df('0x22'),JSON[_0x46df('0x23')](_0x3a37b5,null,0x2));}else if(fs[_0x46df('0x1f')](_0x27de0b)){_0x3a37b5[_0x46df('0x20')]='Sent';_0x3de7b1[_0x46df('0x24')]['attachments']=[{'filename':_0x28a44e,'path':_0x27de0b}];}else{_0x3de7b1[_0x46df('0x24')][_0x46df('0x25')]=_0x46df('0x26');if(!_0x463729[_0x46df('0x27')]){_0xd3ca3d=![];logger[_0x46df('0x6')](_0x46df('0x28'));}}if(_0xd3ca3d){return client[_0x46df('0x29')](_0x46df('0x2a'),_0x3de7b1)[_0x46df('0x2b')](function(_0x10712e){if(_0x10712e['error']){return logger[_0x46df('0x2c')](_0x46df('0x2d'),JSON[_0x46df('0x23')](_0x10712e));}return logger[_0x46df('0x6')](_0x46df('0x2e'));})['catch'](function(_0x5f50ff){return logger[_0x46df('0x2c')](_0x46df('0x2d'),JSON[_0x46df('0x23')](_0x5f50ff));});}};}function handleError(){return function(_0x532684){return logger['error'](JSON['stringify'](_0x532684));};}function handleResult(_0x3b3763){return function(_0x30192d){logger['info']('data',JSON['stringify'](_0x30192d));if(_0x3b3763['MailAccount']&&_0x3b3763[_0x46df('0x9')][_0x46df('0xa')]&&!_[_0x46df('0x2f')](_0x3b3763[_0x46df('0x8')])){setTimeout(handleSendEmail(_0x3b3763,_0x30192d),0x3c*0x3e8);}};}function handleJob(_0x8ea7d4){return function(){try{if(_[_0x46df('0x2f')](_0x8ea7d4[_0x46df('0x30')])){return logger[_0x46df('0x6')](_0x46df('0x31'));}if(_[_0x46df('0x2f')](_0x8ea7d4['subtractUnit'])){return logger[_0x46df('0x6')](_0x46df('0x32'));}var _0x51f46e={'startDate':moment()[_0x46df('0x33')](_0x8ea7d4['subtractNumber'],_0x8ea7d4['subtractUnit'])['format'](_0x46df('0x34')),'endDate':moment()[_0x46df('0x13')](_0x46df('0x34')),'type':_0x46df('0x35'),'output':_0x8ea7d4['output'],'name':_0x8ea7d4[_0x46df('0x15')]};if(!_['isNil'](_0x8ea7d4['DefaultReportId'])){logger[_0x46df('0x6')](_0x46df('0x36'),_0x8ea7d4[_0x46df('0x37')]);return analyticDefaultReportController[_0x46df('0x38')]({'id':_0x8ea7d4[_0x46df('0x37')]},_0x51f46e)[_0x46df('0x2b')](handleResult(_0x8ea7d4))[_0x46df('0x39')](handleError());}if(!_['isNil'](_0x8ea7d4['CustomReportId'])){logger['info'](_0x46df('0x3a'),_0x8ea7d4[_0x46df('0x3b')]);return analyticCustomReportController[_0x46df('0x38')]({'id':_0x8ea7d4[_0x46df('0x3b')]},_0x51f46e)[_0x46df('0x2b')](handleResult(_0x8ea7d4))['catch'](handleError());}}catch(_0x320013){logger['error'](JSON['stringify'](_0x320013));}return logger[_0x46df('0x6')]('no\x20report\x20id');};}function getJobs(_0x3498a2){var _0x44a618={};if(_0x3498a2){_0x44a618['id']=_0x3498a2;}return db[_0x46df('0x3c')][_0x46df('0x3d')]({'where':_0x44a618,'include':[{'model':db[_0x46df('0x9')],'attributes':['id',_0x46df('0x15'),'email'],'include':[{'model':db[_0x46df('0x3e')],'as':_0x46df('0xa')}]}]})[_0x46df('0x2b')](function(_0x4c83e0){var _0x1b47f1=_[_0x46df('0x3f')](manager[_0x46df('0x40')]);var _0xca84bf=_['map'](_0x4c83e0,function(_0x4432e2){return _0x4432e2['id'][_0x46df('0x41')]();});var _0x326bf9=_[_0x46df('0x42')](_0x4c83e0,function(_0x1855f7){return _0x1855f7['id'][_0x46df('0x41')]();});var _0x71f2d2=_0x3498a2?_0xca84bf:_['difference'](_0xca84bf,_0x1b47f1);var _0x5b96e1=_['intersection'](_0xca84bf,_0x1b47f1);var _0x33e05c=_[_0x46df('0x43')](_0x1b47f1,_0xca84bf);var _0x5b9497;var _0x6b4542;for(_0x5b9497=0x0;_0x5b9497<_0x33e05c[_0x46df('0x44')]&&!_0x3498a2;_0x5b9497+=0x1){_0x6b4542=_0x33e05c[_0x5b9497]['toString']();if(manager['exists'](_0x6b4542)){manager[_0x46df('0x45')](_0x6b4542);manager['deleteJob'](_0x6b4542);logger['info'](_0x46df('0x46'),_0x6b4542);}}logger[_0x46df('0x6')]('toRun',JSON['stringify'](_0x71f2d2));for(_0x5b9497=0x0;_0x5b9497<_0x71f2d2[_0x46df('0x44')];_0x5b9497+=0x1){_0x6b4542=_0x71f2d2[_0x5b9497]['toString']();logger['info'](_0x46df('0x47'),_0x6b4542);if(_0x3498a2){logger[_0x46df('0x6')](_0x46df('0x48'),_0x3498a2);logger[_0x46df('0x6')](JSON['stringify'](_0x326bf9[_0x6b4542]));BPromise['resolve']()['then'](handleJob(_0x326bf9[_0x6b4542]));logger['info'](_0x46df('0x49'),_0x326bf9[_0x6b4542][_0x46df('0x15')],_0x326bf9[_0x6b4542][_0x46df('0x4a')]);}else if(_0x326bf9[_0x6b4542][_0x46df('0x4a')]&&_0x326bf9[_0x6b4542][_0x46df('0x4b')]&&moment()[_0x46df('0x4c')](_0x326bf9[_0x6b4542]['startAt'],_0x326bf9[_0x6b4542]['endAt'])){manager[_0x46df('0x4d')](_0x6b4542,_0x326bf9[_0x6b4542][_0x46df('0x4a')],handleJob(_0x326bf9[_0x6b4542]));manager['start'](_0x6b4542);logger['info'](_0x46df('0x4e'),_0x326bf9[_0x6b4542][_0x46df('0x15')],_0x326bf9[_0x6b4542][_0x46df('0x4a')]);}else if(manager['exists'](_0x6b4542)){manager[_0x46df('0x45')](_0x6b4542);manager[_0x46df('0x4f')](_0x6b4542);logger['info'](_0x46df('0x50'),_0x326bf9[_0x6b4542][_0x46df('0x15')],_0x326bf9[_0x6b4542][_0x46df('0x4a')]);}}for(_0x5b9497=0x0,_0x6b4542;_0x5b9497<_0x5b96e1[_0x46df('0x44')]&&!_0x3498a2;_0x5b9497+=0x1){_0x6b4542=_0x5b96e1[_0x5b9497][_0x46df('0x41')]();if(manager[_0x46df('0x51')](_0x6b4542)){if(_0x326bf9[_0x6b4542][_0x46df('0x4a')]&&_0x326bf9[_0x6b4542][_0x46df('0x4b')]&&moment()['isBetween'](_0x326bf9[_0x6b4542]['startAt'],_0x326bf9[_0x6b4542]['endAt'])){manager[_0x46df('0x52')](_0x6b4542,_0x326bf9[_0x6b4542][_0x46df('0x4a')],handleJob(_0x326bf9[_0x6b4542]));logger[_0x46df('0x6')](_0x46df('0x53'),_0x326bf9[_0x6b4542][_0x46df('0x15')],_0x326bf9[_0x6b4542][_0x46df('0x4a')]);}else{manager[_0x46df('0x45')](_0x6b4542);manager[_0x46df('0x4f')](_0x6b4542);logger[_0x46df('0x6')](_0x46df('0x50'),_0x326bf9[_0x6b4542][_0x46df('0x15')],_0x326bf9[_0x6b4542]['cron']);}}}})[_0x46df('0x39')](function(_0x348ce7){logger[_0x46df('0x2c')](JSON[_0x46df('0x23')](_0x348ce7));});}exports[_0x46df('0x54')]=function(_0x232b9e){return getJobs(_0x232b9e);};exports[_0x46df('0x55')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xeb81=['isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','toString','keyBy','difference','intersection','length','exists','deleteJob','toRun','my\x20id','resolve','run\x20job','cron','isBetween','endAt','add','start','stop\x20cron','active','startAt','update','update\x20cron','stop','run','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','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','request','SendMail','then','error','email\x20sent','catch','error\x20mail','data'];(function(_0x23fed1,_0x386883){var _0x379429=function(_0x51a75d){while(--_0x51a75d){_0x23fed1['push'](_0x23fed1['shift']());}};_0x379429(++_0x386883);}(_0xeb81,0x1e9));var _0x1eb8=function(_0x293e7a,_0x1792a2){_0x293e7a=_0x293e7a-0x0;var _0xb78342=_0xeb81[_0x293e7a];return _0xb78342;};'use strict';var fs=require('fs');var util=require(_0x1eb8('0x0'));var path=require(_0x1eb8('0x1'));var _=require('lodash');var moment=require(_0x1eb8('0x2'));var CronJobManager=require(_0x1eb8('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x1eb8('0x4'));var logger=require(_0x1eb8('0x5'))(_0x1eb8('0x6'));var db=require(_0x1eb8('0x7'))['db'];var analyticCustomReportController=require(_0x1eb8('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x1eb8('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x188c1a,_0x2d1113){return function(){logger[_0x1eb8('0xa')](_0x1eb8('0xb'),_0x188c1a[_0x1eb8('0xc')]);var _0x260b07=!![];var _0x1adbef={'tls':{'rejectUnauthorized':![]}};if(_0x188c1a['MailAccount'][_0x1eb8('0xd')][_0x1eb8('0xe')]){_0x1adbef['service']=_0x188c1a[_0x1eb8('0xf')]['Smtp'][_0x1eb8('0xe')];}else{_0x1adbef[_0x1eb8('0x10')]=_0x188c1a['MailAccount']['Smtp'][_0x1eb8('0x10')];_0x1adbef[_0x1eb8('0x11')]=_0x188c1a['MailAccount'][_0x1eb8('0xd')][_0x1eb8('0x11')];_0x1adbef['secure']=_0x188c1a[_0x1eb8('0xf')][_0x1eb8('0xd')]['secure'];}if(_0x188c1a[_0x1eb8('0xf')][_0x1eb8('0xd')]['authentication']){_0x1adbef[_0x1eb8('0x12')]={'user':_0x188c1a[_0x1eb8('0xf')]['Smtp'][_0x1eb8('0x13')],'pass':_0x188c1a[_0x1eb8('0xf')][_0x1eb8('0xd')][_0x1eb8('0x14')]};}var _0x1b1ebe={'account':_0x1adbef,'message':{'from':util[_0x1eb8('0x15')](_0x1eb8('0x16'),_0x188c1a[_0x1eb8('0xf')][_0x1eb8('0x17')],_0x188c1a[_0x1eb8('0xf')]['email']||_0x188c1a[_0x1eb8('0xf')][_0x1eb8('0xd')][_0x1eb8('0x13')]),'to':_0x188c1a[_0x1eb8('0xc')],'cc':_0x188c1a['cc'],'bcc':_0x188c1a[_0x1eb8('0x18')],'subject':util[_0x1eb8('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x2d1113[_0x1eb8('0x17')],_0x188c1a['subtractNumber'],_0x188c1a[_0x1eb8('0x19')])}};var _0x8e2885=path[_0x1eb8('0x1a')](__dirname,_0x1eb8('0x1b'));var _0x4716d7=_0x2d1113[_0x1eb8('0x1c')];var _0x2d0408=util['format'](_0x1eb8('0x1d'),path[_0x1eb8('0x1e')](_0x2d1113[_0x1eb8('0x1c')],path[_0x1eb8('0x1f')](_0x2d1113[_0x1eb8('0x1c')])),_0x1eb8('0x20'));var _0x514a22=path[_0x1eb8('0x1a')](_0x8e2885,_0x4716d7);var _0x5e3453=path[_0x1eb8('0x1a')](_0x8e2885,_0x2d0408);if(fs[_0x1eb8('0x21')](_0x514a22)){_0x2d1113[_0x1eb8('0x22')]=_0x1eb8('0x23');_0x1b1ebe['message']['attachments']=[{'filename':_0x4716d7,'path':_0x514a22}];_0x1b1ebe[_0x1eb8('0x24')][_0x1eb8('0x25')]=util[_0x1eb8('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x1eb8('0x26')](_0x2d1113,null,0x2));}else if(fs['existsSync'](_0x5e3453)){_0x2d1113[_0x1eb8('0x22')]=_0x1eb8('0x23');_0x1b1ebe[_0x1eb8('0x24')][_0x1eb8('0x27')]=[{'filename':_0x2d0408,'path':_0x5e3453}];}else{_0x1b1ebe[_0x1eb8('0x24')][_0x1eb8('0x25')]=_0x1eb8('0x28');if(!_0x188c1a[_0x1eb8('0x29')]){_0x260b07=![];logger['info'](_0x1eb8('0x2a'));}}if(_0x260b07){return client[_0x1eb8('0x2b')](_0x1eb8('0x2c'),_0x1b1ebe)[_0x1eb8('0x2d')](function(_0x2f988f){if(_0x2f988f[_0x1eb8('0x2e')]){return logger['error']('error\x20mail',JSON[_0x1eb8('0x26')](_0x2f988f));}return logger[_0x1eb8('0xa')](_0x1eb8('0x2f'));})[_0x1eb8('0x30')](function(_0x1725cf){return logger[_0x1eb8('0x2e')](_0x1eb8('0x31'),JSON['stringify'](_0x1725cf));});}};}function handleError(){return function(_0x205204){return logger[_0x1eb8('0x2e')](JSON[_0x1eb8('0x26')](_0x205204));};}function handleResult(_0x2a8392){return function(_0x194d34){logger[_0x1eb8('0xa')](_0x1eb8('0x32'),JSON[_0x1eb8('0x26')](_0x194d34));if(_0x2a8392[_0x1eb8('0xf')]&&_0x2a8392[_0x1eb8('0xf')]['Smtp']&&!_[_0x1eb8('0x33')](_0x2a8392[_0x1eb8('0xc')])){setTimeout(handleSendEmail(_0x2a8392,_0x194d34),0x3c*0x3e8);}};}function handleJob(_0x592d2a){return function(){try{if(_['isNil'](_0x592d2a[_0x1eb8('0x34')])){return logger[_0x1eb8('0xa')](_0x1eb8('0x35'));}if(_['isNil'](_0x592d2a['subtractUnit'])){return logger[_0x1eb8('0xa')](_0x1eb8('0x36'));}var _0x4c56d5={'startDate':moment()['subtract'](_0x592d2a[_0x1eb8('0x34')],_0x592d2a[_0x1eb8('0x19')])[_0x1eb8('0x15')](_0x1eb8('0x37')),'endDate':moment()[_0x1eb8('0x15')](_0x1eb8('0x37')),'type':_0x1eb8('0x38'),'output':_0x592d2a[_0x1eb8('0x39')],'name':_0x592d2a['name']};if(!_[_0x1eb8('0x33')](_0x592d2a[_0x1eb8('0x3a')])){logger['info'](_0x1eb8('0x3b'),_0x592d2a[_0x1eb8('0x3a')]);return analyticDefaultReportController[_0x1eb8('0x3c')]({'id':_0x592d2a[_0x1eb8('0x3a')]},_0x4c56d5)[_0x1eb8('0x2d')](handleResult(_0x592d2a))[_0x1eb8('0x30')](handleError());}if(!_[_0x1eb8('0x33')](_0x592d2a[_0x1eb8('0x3d')])){logger['info'](_0x1eb8('0x3e'),_0x592d2a['CustomReportId']);return analyticCustomReportController[_0x1eb8('0x3c')]({'id':_0x592d2a['CustomReportId']},_0x4c56d5)[_0x1eb8('0x2d')](handleResult(_0x592d2a))[_0x1eb8('0x30')](handleError());}}catch(_0x44b089){logger[_0x1eb8('0x2e')](JSON[_0x1eb8('0x26')](_0x44b089));}return logger['info'](_0x1eb8('0x3f'));};}function getJobs(_0x44c993){var _0x4e1b9f={};if(_0x44c993){_0x4e1b9f['id']=_0x44c993;}return db[_0x1eb8('0x40')][_0x1eb8('0x41')]({'where':_0x4e1b9f,'include':[{'model':db[_0x1eb8('0xf')],'attributes':['id','name','email'],'include':[{'model':db[_0x1eb8('0x42')],'as':'Smtp'}]}]})[_0x1eb8('0x2d')](function(_0x1fe05d){var _0xb2661d=_['keys'](manager['jobs']);var _0x323b0f=_['map'](_0x1fe05d,function(_0x22ac6c){return _0x22ac6c['id'][_0x1eb8('0x43')]();});var _0xa8487d=_[_0x1eb8('0x44')](_0x1fe05d,function(_0x46ad9a){return _0x46ad9a['id'][_0x1eb8('0x43')]();});var _0x2db8b7=_0x44c993?_0x323b0f:_[_0x1eb8('0x45')](_0x323b0f,_0xb2661d);var _0x381f07=_[_0x1eb8('0x46')](_0x323b0f,_0xb2661d);var _0x39dded=_[_0x1eb8('0x45')](_0xb2661d,_0x323b0f);var _0x2ed5a5;var _0x3ab3ad;for(_0x2ed5a5=0x0;_0x2ed5a5<_0x39dded[_0x1eb8('0x47')]&&!_0x44c993;_0x2ed5a5+=0x1){_0x3ab3ad=_0x39dded[_0x2ed5a5]['toString']();if(manager[_0x1eb8('0x48')](_0x3ab3ad)){manager['stop'](_0x3ab3ad);manager[_0x1eb8('0x49')](_0x3ab3ad);logger['info']('delete\x20cron',_0x3ab3ad);}}logger['info'](_0x1eb8('0x4a'),JSON[_0x1eb8('0x26')](_0x2db8b7));for(_0x2ed5a5=0x0;_0x2ed5a5<_0x2db8b7[_0x1eb8('0x47')];_0x2ed5a5+=0x1){_0x3ab3ad=_0x2db8b7[_0x2ed5a5][_0x1eb8('0x43')]();logger[_0x1eb8('0xa')]('index',_0x3ab3ad);if(_0x44c993){logger[_0x1eb8('0xa')](_0x1eb8('0x4b'),_0x44c993);logger[_0x1eb8('0xa')](JSON[_0x1eb8('0x26')](_0xa8487d[_0x3ab3ad]));BPromise[_0x1eb8('0x4c')]()[_0x1eb8('0x2d')](handleJob(_0xa8487d[_0x3ab3ad]));logger[_0x1eb8('0xa')](_0x1eb8('0x4d'),_0xa8487d[_0x3ab3ad][_0x1eb8('0x17')],_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')]);}else if(_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')]&&_0xa8487d[_0x3ab3ad]['active']&&moment()[_0x1eb8('0x4f')](_0xa8487d[_0x3ab3ad]['startAt'],_0xa8487d[_0x3ab3ad][_0x1eb8('0x50')])){manager[_0x1eb8('0x51')](_0x3ab3ad,_0xa8487d[_0x3ab3ad]['cron'],handleJob(_0xa8487d[_0x3ab3ad]));manager[_0x1eb8('0x52')](_0x3ab3ad);logger[_0x1eb8('0xa')]('add\x20cron',_0xa8487d[_0x3ab3ad][_0x1eb8('0x17')],_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')]);}else if(manager['exists'](_0x3ab3ad)){manager['stop'](_0x3ab3ad);manager[_0x1eb8('0x49')](_0x3ab3ad);logger[_0x1eb8('0xa')](_0x1eb8('0x53'),_0xa8487d[_0x3ab3ad]['name'],_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')]);}}for(_0x2ed5a5=0x0,_0x3ab3ad;_0x2ed5a5<_0x381f07[_0x1eb8('0x47')]&&!_0x44c993;_0x2ed5a5+=0x1){_0x3ab3ad=_0x381f07[_0x2ed5a5][_0x1eb8('0x43')]();if(manager[_0x1eb8('0x48')](_0x3ab3ad)){if(_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')]&&_0xa8487d[_0x3ab3ad][_0x1eb8('0x54')]&&moment()['isBetween'](_0xa8487d[_0x3ab3ad][_0x1eb8('0x55')],_0xa8487d[_0x3ab3ad]['endAt'])){manager[_0x1eb8('0x56')](_0x3ab3ad,_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')],handleJob(_0xa8487d[_0x3ab3ad]));logger[_0x1eb8('0xa')](_0x1eb8('0x57'),_0xa8487d[_0x3ab3ad][_0x1eb8('0x17')],_0xa8487d[_0x3ab3ad]['cron']);}else{manager[_0x1eb8('0x58')](_0x3ab3ad);manager[_0x1eb8('0x49')](_0x3ab3ad);logger[_0x1eb8('0xa')](_0x1eb8('0x53'),_0xa8487d[_0x3ab3ad][_0x1eb8('0x17')],_0xa8487d[_0x3ab3ad][_0x1eb8('0x4e')]);}}}})['catch'](function(_0x44238c){logger['error'](JSON[_0x1eb8('0x26')](_0x44238c));});}exports[_0x1eb8('0x59')]=function(_0x1a2f87){return getJobs(_0x1a2f87);};exports[_0x1eb8('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index d613410..fb63400 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8efc=['transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','resolve','tempSentiment','sentiment','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','bucket','transcribeAccountId','push','all','inspect','aws-sdk','request-promise','util','bluebird','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','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','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length'];(function(_0x231362,_0x1b3085){var _0x523090=function(_0x9973df){while(--_0x9973df){_0x231362['push'](_0x231362['shift']());}};_0x523090(++_0x1b3085);}(_0x8efc,0xb3));var _0xc8ef=function(_0x277fa3,_0x3b2dde){_0x277fa3=_0x277fa3-0x0;var _0x2e4520=_0x8efc[_0x277fa3];return _0x2e4520;};var _=require('lodash');var AWS=require(_0xc8ef('0x0'));var rp=require(_0xc8ef('0x1'));var util=require(_0xc8ef('0x2'));var BPromise=require(_0xc8ef('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xc8ef('0x4'))(_0xc8ef('0x5'));function getTranscriptionJob(_0x33b9c9,_0x50d1f6,_0x2910b5,_0x3c6189){return new Promise(function(_0x1cd466,_0x13b433){var _0x576ff9=new AWS[(_0xc8ef('0x6'))]({'accessKeyId':_0x50d1f6,'secretAccessKey':_0x33b9c9,'region':_0x2910b5});_0x576ff9[_0xc8ef('0x7')]({'TranscriptionJobName':_0x3c6189},function(_0x1c8931,_0x489778){if(_0x1c8931){return _0x13b433(_0x1c8931);}else{return _0x1cd466(_0x489778);}});});}function sentiment(_0x11f3ba,_0x443ee3,_0x1a9a5f,_0xcc3c21,_0x56cfb1){return new Promise(function(_0x315d93,_0x574588){var _0x45dbd3=new AWS[(_0xc8ef('0x8'))]({'accessKeyId':_0x443ee3,'secretAccessKey':_0x11f3ba,'region':_0x1a9a5f});_0x45dbd3[_0xc8ef('0x9')]({'Text':_0xcc3c21,'LanguageCode':_0x56cfb1[_0xc8ef('0xa')](0x0,0x2)},function(_0xa76b59,_0x44d7da){if(_0xa76b59){return _0x574588(_0xa76b59);}else{return _0x315d93(_0x44d7da);}});});}function checkTranscribeJob(_0x18213f,_0x1c6744,_0xb90ed0){var _0x15669b;return new BPromise(function(_0x3e7c04,_0x1207d8){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')](_0xc8ef('0xd'),_0x18213f['id'],_0x18213f[_0xc8ef('0xe')]));return getTranscriptionJob(_0xb90ed0[_0xc8ef('0xf')],_0xb90ed0[_0xc8ef('0x10')],_0x1c6744[_0xc8ef('0x11')],_0x18213f[_0xc8ef('0xe')])[_0xc8ef('0x12')](function(_0x45eb4b){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x13'),_0x18213f['id'],_0x18213f[_0xc8ef('0xe')],_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x15')]));if(!_0x18213f[_0xc8ef('0x16')]){switch(_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x15')]){case _0xc8ef('0x17'):var _0x3591c={'transcribeStatus':_0x45eb4b['TranscriptionJob'][_0xc8ef('0x15')],'fileUri':_0x45eb4b['TranscriptionJob'][_0xc8ef('0x18')]['TranscriptFileUri']};logger[_0xc8ef('0xb')](util['format'](_0xc8ef('0x19'),_0x18213f['id']));return rp({'uri':_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x18')][_0xc8ef('0x1a')],'json':!![]})[_0xc8ef('0x12')](function(_0x4c57e3){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')](_0xc8ef('0x1b'),_0x18213f['id']));if(_0x4c57e3&&_0x4c57e3['results']&&_0x4c57e3[_0xc8ef('0x1c')]['transcripts']&&_0x4c57e3['results']['transcripts']['length']){_0x3591c[_0xc8ef('0x16')]='';for(var _0x128556=0x0;_0x128556<_0x4c57e3[_0xc8ef('0x1c')][_0xc8ef('0x1d')][_0xc8ef('0x1e')];_0x128556++){_0x3591c[_0xc8ef('0x16')]+=_0x4c57e3[_0xc8ef('0x1c')][_0xc8ef('0x1d')][_0x128556][_0xc8ef('0x1f')]+'';}}return _0x18213f[_0xc8ef('0x20')](_0x3591c);})[_0xc8ef('0x12')](function(){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')](_0xc8ef('0x21'),_0x18213f['id']));if(!_0x18213f['tempSentiment']){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1c6744['sentiment']||!_0x1c6744[_0xc8ef('0x24')]||!_0x1c6744['sentimentRegion']||!_0x1c6744[_0xc8ef('0x25')]||!_0x1c6744['bucket']){throw new db[(_0xc8ef('0x22'))]['ValidationError'](_0xc8ef('0x26'));}if(!_0x3591c[_0xc8ef('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x1c6744['sentimentAccountId']===_0xb90ed0['id']){return _0xb90ed0;}else{return db[_0xc8ef('0x27')][_0xc8ef('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xc8ef('0x12')](function(_0x3bde31){if(!_0x3bde31){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))](_0xc8ef('0x29'));}if(!_0x3bde31[_0xc8ef('0xf')]||!_0x3bde31[_0xc8ef('0x10')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))](_0xc8ef('0x2a'));}_0x15669b=_0x3bde31;logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x18213f['id']));return sentiment(_0x15669b[_0xc8ef('0xf')],_0x15669b[_0xc8ef('0x10')],_0x1c6744[_0xc8ef('0x2b')],_0x3591c[_0xc8ef('0x16')],_0x1c6744['language']);})[_0xc8ef('0x12')](function(_0x1890de){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x2c'),_0x18213f['id']));return _0x18213f['update']({'sentiment':_0x1890de['Sentiment'],'sPositive':_0x1890de[_0xc8ef('0x2d')][_0xc8ef('0x2e')],'sNegative':_0x1890de[_0xc8ef('0x2d')]['Negative'],'sMixed':_0x1890de['SentimentScore'][_0xc8ef('0x2f')],'sNeutral':_0x1890de[_0xc8ef('0x2d')][_0xc8ef('0x30')]});})[_0xc8ef('0x12')](function(){logger[_0xc8ef('0xb')](util['format'](_0xc8ef('0x21'),_0x18213f['id']));_0x3e7c04();});case _0xc8ef('0x31'):return _0x18213f[_0xc8ef('0x20')]({'transcribeStatus':_0xc8ef('0x31'),'failureReason':_0x45eb4b[_0xc8ef('0x14')][_0xc8ef('0x32')]})['then'](function(){logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x18213f['id']));_0x3e7c04();});default:logger['info'](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x18213f['id']));break;}}else{return BPromise[_0xc8ef('0x33')]()['then'](function(){if(!_0x18213f[_0xc8ef('0x34')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1c6744[_0xc8ef('0x35')]||!_0x1c6744[_0xc8ef('0x24')]||!_0x1c6744[_0xc8ef('0x2b')]||!_0x1c6744[_0xc8ef('0x25')]||!_0x1c6744['bucket']){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))](_0xc8ef('0x26'));}if(!_0x18213f[_0xc8ef('0x16')]){throw new Error('Transcript\x20not\x20available');}if(_0x1c6744['sentimentAccountId']===_0xb90ed0['id']){return _0xb90ed0;}else{return db[_0xc8ef('0x27')][_0xc8ef('0x28')]({'where':{'id':_settings[_0xc8ef('0x24')]}});}})[_0xc8ef('0x12')](function(_0x351109){if(!_0x351109){throw new db['Sequelize']['ValidationError'](_0xc8ef('0x29'));}if(!_0x351109['data1']||!_0x351109[_0xc8ef('0x10')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x15669b=_0x351109;logger[_0xc8ef('0xb')](util[_0xc8ef('0xc')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x18213f['id']));return sentiment(_0x15669b[_0xc8ef('0xf')],_0x15669b['data2'],_0x1c6744[_0xc8ef('0x2b')],_0x18213f[_0xc8ef('0x16')],_0x1c6744[_0xc8ef('0x25')]);})['then'](function(_0x5b1ef1){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x2c'),_0x18213f['id']));return _0x18213f[_0xc8ef('0x20')]({'sentiment':_0x5b1ef1[_0xc8ef('0x36')],'sPositive':_0x5b1ef1[_0xc8ef('0x2d')][_0xc8ef('0x2e')],'sNegative':_0x5b1ef1[_0xc8ef('0x2d')]['Negative'],'sMixed':_0x5b1ef1['SentimentScore'][_0xc8ef('0x2f')],'sNeutral':_0x5b1ef1[_0xc8ef('0x2d')][_0xc8ef('0x30')],'transcribeStatus':_0xc8ef('0x17')});})[_0xc8ef('0x12')](function(){logger['info'](util[_0xc8ef('0xc')](_0xc8ef('0x21'),_0x18213f['id']));_0x3e7c04();});}})[_0xc8ef('0x37')](function(_0xc932df){if(_0xc932df){if(!_0xc932df['name']||_0xc932df[_0xc8ef('0x38')]!==_0xc8ef('0x39')){logger[_0xc8ef('0x3a')](util['format'](_0xc8ef('0x3b'),_0x18213f['id']),util['inspect'](_0xc932df,{'showHidden':![],'depth':null}));}}_0x3e7c04();});});}function checkTranscribe(){var _0x7e5c5a;var _0x52eac7;var _0x3dbb7a;return db[_0xc8ef('0x3c')][_0xc8ef('0x3d')]({'where':{'transcribeStatus':_0xc8ef('0x3e')}})[_0xc8ef('0x12')](function(_0x3e0398){if(!_0x3e0398||!_0x3e0398[_0xc8ef('0x1e')]){throw new db[(_0xc8ef('0x22'))]['ValidationError'](_0xc8ef('0x3f'));}_0x7e5c5a=_0x3e0398;return db[_0xc8ef('0x40')]['findOne']({'where':{'id':0x1}});})['then'](function(_0xe997a){if(!_0xe997a){throw new db['Sequelize'][(_0xc8ef('0x23'))]('Settings\x20not\x20available');}_0x52eac7=_0xe997a;if(!_0x52eac7[_0xc8ef('0x5')]||!_0x52eac7['transcribeAccountId']||!_0x52eac7[_0xc8ef('0x11')]||!_0x52eac7[_0xc8ef('0x25')]||!_0x52eac7[_0xc8ef('0x41')]){throw new db[(_0xc8ef('0x22'))][(_0xc8ef('0x23'))]('Transcribe\x20not\x20configured');}return db[_0xc8ef('0x27')][_0xc8ef('0x28')]({'where':{'id':_0x52eac7[_0xc8ef('0x42')]}});})[_0xc8ef('0x12')](function(_0x1b460a){if(!_0x1b460a){throw new db[(_0xc8ef('0x22'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1b460a[_0xc8ef('0xf')]||!_0x1b460a[_0xc8ef('0x10')]){throw new db['Sequelize']['ValidationError'](_0xc8ef('0x2a'));}_0x3dbb7a=_0x1b460a;var _0x1cfab1=[];_0x7e5c5a['forEach'](function(_0x479742){_0x1cfab1[_0xc8ef('0x43')](checkTranscribeJob(_0x479742,_0x52eac7,_0x3dbb7a));});return BPromise[_0xc8ef('0x44')](_0x1cfab1);})[_0xc8ef('0x37')](function(_0xb58103){if(_0xb58103){if(!_0xb58103[_0xc8ef('0x38')]||_0xb58103['name']!==_0xc8ef('0x39')){logger[_0xc8ef('0x3a')](util[_0xc8ef('0x45')](_0xb58103,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x544a=['lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','detectSentiment','substring','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','info','format','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','Mixed','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push'];(function(_0x4f45ef,_0x404d10){var _0x49978d=function(_0x5a1209){while(--_0x5a1209){_0x4f45ef['push'](_0x4f45ef['shift']());}};_0x49978d(++_0x404d10);}(_0x544a,0x118));var _0xa544=function(_0x18b8fb,_0x378e67){_0x18b8fb=_0x18b8fb-0x0;var _0x3327ab=_0x544a[_0x18b8fb];return _0x3327ab;};var _=require(_0xa544('0x0'));var AWS=require(_0xa544('0x1'));var rp=require(_0xa544('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0xa544('0x3'))['db'];var logger=require(_0xa544('0x4'))(_0xa544('0x5'));function getTranscriptionJob(_0xf2d6a0,_0x4b4677,_0x4cfd38,_0x4ec0e3){return new Promise(function(_0x2cb8c5,_0x3690ce){var _0x9609d4=new AWS['TranscribeService']({'accessKeyId':_0x4b4677,'secretAccessKey':_0xf2d6a0,'region':_0x4cfd38});_0x9609d4[_0xa544('0x6')]({'TranscriptionJobName':_0x4ec0e3},function(_0x13ce7a,_0x35abfd){if(_0x13ce7a){return _0x3690ce(_0x13ce7a);}else{return _0x2cb8c5(_0x35abfd);}});});}function sentiment(_0x4a0b98,_0x3e48cd,_0x3066dd,_0x35abd7,_0x9e886d){return new Promise(function(_0x4d2796,_0x295267){var _0x1c961e=new AWS[(_0xa544('0x7'))]({'accessKeyId':_0x3e48cd,'secretAccessKey':_0x4a0b98,'region':_0x3066dd});_0x1c961e[_0xa544('0x8')]({'Text':_0x35abd7,'LanguageCode':_0x9e886d[_0xa544('0x9')](0x0,0x2)},function(_0x49e946,_0x36fa98){if(_0x49e946){return _0x295267(_0x49e946);}else{return _0x4d2796(_0x36fa98);}});});}function checkTranscribeJob(_0x4aa358,_0x5c5388,_0x49bdea){var _0x3de77b;return new BPromise(function(_0x4251ce,_0x498ce4){logger['info'](util['format'](_0xa544('0xa'),_0x4aa358['id'],_0x4aa358[_0xa544('0xb')]));return getTranscriptionJob(_0x49bdea[_0xa544('0xc')],_0x49bdea['data2'],_0x5c5388[_0xa544('0xd')],_0x4aa358[_0xa544('0xb')])[_0xa544('0xe')](function(_0x25c611){logger[_0xa544('0xf')](util[_0xa544('0x10')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4aa358['id'],_0x4aa358[_0xa544('0xb')],_0x25c611[_0xa544('0x11')]['TranscriptionJobStatus']));if(!_0x4aa358['fileText']){switch(_0x25c611[_0xa544('0x11')][_0xa544('0x12')]){case _0xa544('0x13'):var _0x112262={'transcribeStatus':_0x25c611[_0xa544('0x11')][_0xa544('0x12')],'fileUri':_0x25c611[_0xa544('0x11')][_0xa544('0x14')][_0xa544('0x15')]};logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x16'),_0x4aa358['id']));return rp({'uri':_0x25c611[_0xa544('0x11')][_0xa544('0x14')][_0xa544('0x15')],'json':!![]})['then'](function(_0x4d9a8f){logger[_0xa544('0xf')](util[_0xa544('0x10')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4aa358['id']));if(_0x4d9a8f&&_0x4d9a8f[_0xa544('0x17')]&&_0x4d9a8f[_0xa544('0x17')][_0xa544('0x18')]&&_0x4d9a8f[_0xa544('0x17')][_0xa544('0x18')]['length']){_0x112262['fileText']='';for(var _0xe9bea3=0x0;_0xe9bea3<_0x4d9a8f[_0xa544('0x17')][_0xa544('0x18')][_0xa544('0x19')];_0xe9bea3++){_0x112262[_0xa544('0x1a')]+=_0x4d9a8f[_0xa544('0x17')]['transcripts'][_0xe9bea3][_0xa544('0x1b')]+'';}}return _0x4aa358[_0xa544('0x1c')](_0x112262);})[_0xa544('0xe')](function(){logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x1d'),_0x4aa358['id']));if(!_0x4aa358[_0xa544('0x1e')]){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))](_0xa544('0x21'));}if(!_0x5c5388['sentiment']||!_0x5c5388['sentimentAccountId']||!_0x5c5388[_0xa544('0x22')]||!_0x5c5388[_0xa544('0x23')]||!_0x5c5388[_0xa544('0x24')]){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))](_0xa544('0x25'));}if(!_0x112262['fileText']){throw new Error(_0xa544('0x26'));}if(_0x5c5388[_0xa544('0x27')]===_0x49bdea['id']){return _0x49bdea;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa544('0xe')](function(_0x371f4c){if(!_0x371f4c){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))](_0xa544('0x28'));}if(!_0x371f4c['data1']||!_0x371f4c[_0xa544('0x29')]){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x3de77b=_0x371f4c;logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x2a'),_0x4aa358['id']));return sentiment(_0x3de77b[_0xa544('0xc')],_0x3de77b[_0xa544('0x29')],_0x5c5388[_0xa544('0x22')],_0x112262['fileText'],_0x5c5388[_0xa544('0x23')]);})[_0xa544('0xe')](function(_0x4d3c05){logger['info'](util[_0xa544('0x10')](_0xa544('0x2b'),_0x4aa358['id']));return _0x4aa358[_0xa544('0x1c')]({'sentiment':_0x4d3c05[_0xa544('0x2c')],'sPositive':_0x4d3c05[_0xa544('0x2d')][_0xa544('0x2e')],'sNegative':_0x4d3c05[_0xa544('0x2d')][_0xa544('0x2f')],'sMixed':_0x4d3c05['SentimentScore']['Mixed'],'sNeutral':_0x4d3c05[_0xa544('0x2d')][_0xa544('0x30')]});})[_0xa544('0xe')](function(){logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x1d'),_0x4aa358['id']));_0x4251ce();});case _0xa544('0x31'):return _0x4aa358[_0xa544('0x1c')]({'transcribeStatus':_0xa544('0x31'),'failureReason':_0x25c611[_0xa544('0x11')]['FailureReason']})[_0xa544('0xe')](function(){logger['info'](util['format'](_0xa544('0x1d'),_0x4aa358['id']));_0x4251ce();});default:logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x32'),_0x4aa358['id']));break;}}else{return BPromise[_0xa544('0x33')]()[_0xa544('0xe')](function(){if(!_0x4aa358[_0xa544('0x1e')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5c5388[_0xa544('0x34')]||!_0x5c5388[_0xa544('0x27')]||!_0x5c5388['sentimentRegion']||!_0x5c5388[_0xa544('0x23')]||!_0x5c5388['bucket']){throw new db[(_0xa544('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4aa358[_0xa544('0x1a')]){throw new Error(_0xa544('0x26'));}if(_0x5c5388[_0xa544('0x27')]===_0x49bdea['id']){return _0x49bdea;}else{return db[_0xa544('0x35')][_0xa544('0x36')]({'where':{'id':_settings[_0xa544('0x27')]}});}})[_0xa544('0xe')](function(_0x9c8585){if(!_0x9c8585){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x9c8585[_0xa544('0xc')]||!_0x9c8585[_0xa544('0x29')]){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))](_0xa544('0x37'));}_0x3de77b=_0x9c8585;logger[_0xa544('0xf')](util[_0xa544('0x10')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aa358['id']));return sentiment(_0x3de77b[_0xa544('0xc')],_0x3de77b[_0xa544('0x29')],_0x5c5388[_0xa544('0x22')],_0x4aa358['fileText'],_0x5c5388['language']);})[_0xa544('0xe')](function(_0x4ee475){logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x2b'),_0x4aa358['id']));return _0x4aa358[_0xa544('0x1c')]({'sentiment':_0x4ee475['Sentiment'],'sPositive':_0x4ee475[_0xa544('0x2d')][_0xa544('0x2e')],'sNegative':_0x4ee475['SentimentScore'][_0xa544('0x2f')],'sMixed':_0x4ee475[_0xa544('0x2d')][_0xa544('0x38')],'sNeutral':_0x4ee475[_0xa544('0x2d')][_0xa544('0x30')],'transcribeStatus':'COMPLETED'});})[_0xa544('0xe')](function(){logger[_0xa544('0xf')](util[_0xa544('0x10')](_0xa544('0x1d'),_0x4aa358['id']));_0x4251ce();});}})[_0xa544('0x39')](function(_0x571db9){if(_0x571db9){if(!_0x571db9[_0xa544('0x3a')]||_0x571db9['name']!=='SequelizeValidationError'){logger[_0xa544('0x3b')](util[_0xa544('0x10')](_0xa544('0x3c'),_0x4aa358['id']),util['inspect'](_0x571db9,{'showHidden':![],'depth':null}));}}_0x4251ce();});});}function checkTranscribe(){var _0x1e85c9;var _0x36eb24;var _0x2b0f4a;return db[_0xa544('0x3d')][_0xa544('0x3e')]({'where':{'transcribeStatus':_0xa544('0x3f')}})[_0xa544('0xe')](function(_0x4e1459){if(!_0x4e1459||!_0x4e1459[_0xa544('0x19')]){throw new db['Sequelize'][(_0xa544('0x20'))](_0xa544('0x40'));}_0x1e85c9=_0x4e1459;return db[_0xa544('0x41')]['findOne']({'where':{'id':0x1}});})[_0xa544('0xe')](function(_0x2890d2){if(!_0x2890d2){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))](_0xa544('0x42'));}_0x36eb24=_0x2890d2;if(!_0x36eb24[_0xa544('0x5')]||!_0x36eb24['transcribeAccountId']||!_0x36eb24['transcribeRegion']||!_0x36eb24[_0xa544('0x23')]||!_0x36eb24['bucket']){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))]('Transcribe\x20not\x20configured');}return db[_0xa544('0x35')][_0xa544('0x36')]({'where':{'id':_0x36eb24[_0xa544('0x43')]}});})[_0xa544('0xe')](function(_0x14cc36){if(!_0x14cc36){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))](_0xa544('0x28'));}if(!_0x14cc36[_0xa544('0xc')]||!_0x14cc36[_0xa544('0x29')]){throw new db[(_0xa544('0x1f'))][(_0xa544('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x2b0f4a=_0x14cc36;var _0x47e320=[];_0x1e85c9[_0xa544('0x44')](function(_0x222503){_0x47e320[_0xa544('0x45')](checkTranscribeJob(_0x222503,_0x36eb24,_0x2b0f4a));});return BPromise['all'](_0x47e320);})['catch'](function(_0x5e74e9){if(_0x5e74e9){if(!_0x5e74e9[_0xa544('0x3a')]||_0x5e74e9[_0xa544('0x3a')]!=='SequelizeValidationError'){logger[_0xa544('0x3b')](util['inspect'](_0x5e74e9,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 6945d67..4504830 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1d7=['emit','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x48205e,_0x47606c){var _0x4b3981=function(_0x1759c0){while(--_0x1759c0){_0x48205e['push'](_0x48205e['shift']());}};_0x4b3981(++_0x47606c);}(_0xf1d7,0x17e));var _0x7f1d=function(_0x65348d,_0x24f251){_0x65348d=_0x65348d-0x0;var _0x472a48=_0xf1d7[_0x65348d];return _0x472a48;};'use strict';var _=require(_0x7f1d('0x0'));var moment=require(_0x7f1d('0x1'));var Redis=require(_0x7f1d('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0x7f1d('0x3'))['db'];var logger=require(_0x7f1d('0x4'))('schedule');config[_0x7f1d('0x5')]=_['defaults'](config['redis'],{'host':_0x7f1d('0x6'),'port':0x18eb});var io=require(_0x7f1d('0x7'))(new Redis(config[_0x7f1d('0x5')]));function closeInteractions(){var _0x51177a=[];return db[_0x7f1d('0x8')][_0x7f1d('0x9')]({'raw':!![],'attributes':['id',_0x7f1d('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7f1d('0xb')](0x18,_0x7f1d('0xc'))}}})['then'](function(_0x168bb4){if(_0x168bb4&&_0x168bb4[_0x7f1d('0xd')]){_0x51177a=_[_0x7f1d('0xe')](_0x168bb4||[],'id');logger[_0x7f1d('0xf')](_0x7f1d('0x10'),_0x51177a[_0x7f1d('0x11')]());return db[_0x7f1d('0x8')][_0x7f1d('0x12')]({'closeReason':_0x7f1d('0x13'),'disposition':_0x7f1d('0x14'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x51177a}});}})[_0x7f1d('0x15')](function(){if(_0x51177a&&_0x51177a[_0x7f1d('0xd')]){logger[_0x7f1d('0xf')](_0x7f1d('0x16'),_0x51177a[_0x7f1d('0x11')]());for(var _0x5e923b=0x0;_0x5e923b<_0x51177a[_0x7f1d('0xd')];_0x5e923b++){io[_0x7f1d('0x17')]('whatsappInteraction:update',{'id':_0x51177a[_0x5e923b],'closed':!![]});}}})['catch'](function(_0x18326b){logger['error'](_0x7f1d('0x18'),_0x18326b?util[_0x7f1d('0x19')](_0x18326b,{'showHidden':![],'depth':null}):'');});}exports[_0x7f1d('0x1a')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x69ee=['join','WhatsappInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0x69ee,0x167));var _0xe69e=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x69ee[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var moment=require(_0xe69e('0x0'));var Redis=require(_0xe69e('0x1'));var util=require('util');var config=require(_0xe69e('0x2'));var db=require(_0xe69e('0x3'))['db'];var logger=require(_0xe69e('0x4'))('schedule');config[_0xe69e('0x5')]=_[_0xe69e('0x6')](config[_0xe69e('0x5')],{'host':_0xe69e('0x7'),'port':0x18eb});var io=require(_0xe69e('0x8'))(new Redis(config[_0xe69e('0x5')]));function closeInteractions(){var _0x476bab=[];return db['WhatsappInteraction'][_0xe69e('0x9')]({'raw':!![],'attributes':['id',_0xe69e('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xe69e('0xb')](0x18,_0xe69e('0xc'))}}})[_0xe69e('0xd')](function(_0x4f3089){if(_0x4f3089&&_0x4f3089[_0xe69e('0xe')]){_0x476bab=_[_0xe69e('0xf')](_0x4f3089||[],'id');logger[_0xe69e('0x10')](_0xe69e('0x11'),_0x476bab[_0xe69e('0x12')]());return db[_0xe69e('0x13')][_0xe69e('0x14')]({'closeReason':_0xe69e('0x15'),'disposition':_0xe69e('0x16'),'closed':!![],'closedAt':moment()[_0xe69e('0x17')](_0xe69e('0x18'))},{'where':{'id':_0x476bab}});}})[_0xe69e('0xd')](function(){if(_0x476bab&&_0x476bab[_0xe69e('0xe')]){logger[_0xe69e('0x10')](_0xe69e('0x19'),_0x476bab[_0xe69e('0x12')]());for(var _0x16c158=0x0;_0x16c158<_0x476bab[_0xe69e('0xe')];_0x16c158++){io['emit']('whatsappInteraction:update',{'id':_0x476bab[_0x16c158],'closed':!![]});}}})['catch'](function(_0x3c337d){logger[_0xe69e('0x1a')](_0xe69e('0x1b'),_0x3c337d?util[_0xe69e('0x1c')](_0x3c337d,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 5d41a58..b41adeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x109d=['Innocenzo','innocenzo.biondo','now','Biondo','CmContact','destroy','bulkCreate','finished\x20populating','contacts1','CmHopper','then','log','contacts2','hopper2','catch','util','../mysqldb','push'];(function(_0x3060e3,_0x14f2c6){var _0x497d2c=function(_0x2a274a){while(--_0x2a274a){_0x3060e3['push'](_0x3060e3['shift']());}};_0x497d2c(++_0x14f2c6);}(_0x109d,0xf9));var _0xd109=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x109d[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0xd109('0x0'));var db=require(_0xd109('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd109('0x2')]({'id':i,'firstName':_0xd109('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xd109('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd109('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd109('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd109('0x5')](),'updatedAt':Date[_0xd109('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd109('0x2')]({'id':i,'firstName':_0xd109('0x3')+i,'lastName':_0xd109('0x6')+i,'phone':0xf879fb460+i,'email':_0xd109('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd109('0x5')](),'updatedAt':Date['now']()});}db[_0xd109('0x7')][_0xd109('0x8')]({'where':{}})['then'](function(){return db[_0xd109('0x7')][_0xd109('0x9')](contacts);})['then'](function(){console['log'](_0xd109('0xa'),_0xd109('0xb'));return db[_0xd109('0xc')]['destroy']({'where':{}});})['then'](function(){return db[_0xd109('0xc')][_0xd109('0x9')](hopper);})[_0xd109('0xd')](function(){console[_0xd109('0xe')](_0xd109('0xa'),'hopper1');return db[_0xd109('0x7')][_0xd109('0x9')](contacts2);})[_0xd109('0xd')](function(){console[_0xd109('0xe')]('finished\x20populating',_0xd109('0xf'));return db[_0xd109('0xc')][_0xd109('0x9')](hopper2);})[_0xd109('0xd')](function(){console[_0xd109('0xe')](_0xd109('0xa'),_0xd109('0x10'));})[_0xd109('0x11')](function(_0x411641){console[_0xd109('0xe')](_0x411641);});
\ No newline at end of file
+var _0x7fbf=['then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','push','Innocenzo','now','Biondo','@xcally.com','destroy','CmContact','bulkCreate'];(function(_0xef9f7f,_0x259a17){var _0x6ca606=function(_0x1c200f){while(--_0x1c200f){_0xef9f7f['push'](_0xef9f7f['shift']());}};_0x6ca606(++_0x259a17);}(_0x7fbf,0x15d));var _0xf7fb=function(_0xf492bb,_0x536b60){_0xf492bb=_0xf492bb-0x0;var _0x134b20=_0x7fbf[_0xf492bb];return _0x134b20;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf7fb('0x0')]({'id':i,'firstName':_0xf7fb('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf7fb('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xf7fb('0x2')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xf7fb('0x2')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf7fb('0x0')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf7fb('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xf7fb('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf7fb('0x0')]({'id':i,'active':![],'scheduledat':Date[_0xf7fb('0x2')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf7fb('0x2')](),'updatedAt':Date['now']()});}db['CmContact'][_0xf7fb('0x5')]({'where':{}})['then'](function(){return db[_0xf7fb('0x6')][_0xf7fb('0x7')](contacts);})[_0xf7fb('0x8')](function(){console[_0xf7fb('0x9')](_0xf7fb('0xa'),_0xf7fb('0xb'));return db[_0xf7fb('0xc')][_0xf7fb('0x5')]({'where':{}});})['then'](function(){return db[_0xf7fb('0xc')][_0xf7fb('0x7')](hopper);})['then'](function(){console['log'](_0xf7fb('0xa'),_0xf7fb('0xd'));return db[_0xf7fb('0x6')]['bulkCreate'](contacts2);})[_0xf7fb('0x8')](function(){console[_0xf7fb('0x9')]('finished\x20populating',_0xf7fb('0xe'));return db['CmHopper'][_0xf7fb('0x7')](hopper2);})[_0xf7fb('0x8')](function(){console['log'](_0xf7fb('0xa'),_0xf7fb('0xf'));})[_0xf7fb('0x10')](function(_0x1161dd){console[_0xf7fb('0x9')](_0x1161dd);});
\ No newline at end of file
index 0d9a127..3a6cb86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1e7=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','log','../mysqldb','format','%s%s','agent','password','friend','udp','wss','all'];(function(_0x23c46f,_0xb8c6f9){var _0x35ec91=function(_0x4d1d5f){while(--_0x4d1d5f){_0x23c46f['push'](_0x23c46f['shift']());}};_0x35ec91(++_0xb8c6f9);}(_0xf1e7,0x137));var _0x7f1e=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xf1e7[_0x5f309e];return _0x487b5e;};'use strict';var util=require('util');var db=require(_0x7f1e('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x7f1e('0x1')](_0x7f1e('0x2'),_0x7f1e('0x3'),i),'fullname':util[_0x7f1e('0x1')]('%s%s',_0x7f1e('0x3'),i),'email':util[_0x7f1e('0x1')]('%s%s@xcally.com',_0x7f1e('0x3'),i),'role':_0x7f1e('0x3'),'password':_0x7f1e('0x4'),'internal':0xfa0+i,'type':_0x7f1e('0x5'),'transport':[_0x7f1e('0x6'),'ws',_0x7f1e('0x7')],'disallow':[_0x7f1e('0x8')],'allow':[_0x7f1e('0x9')],'defaultuser':util[_0x7f1e('0x1')](_0x7f1e('0x2'),'agent',i),'encryption':_0x7f1e('0xa'),'avpf':_0x7f1e('0xa'),'force_avp':_0x7f1e('0xa'),'icesupport':'yes','dtlsenable':_0x7f1e('0xa'),'dtlsverify':'no','dtlscertfile':_0x7f1e('0xb'),'dtlsprivatekey':_0x7f1e('0xc'),'dtlssetup':'actpass','callerid':util[_0x7f1e('0x1')](_0x7f1e('0xd'),util['format'](_0x7f1e('0x2'),_0x7f1e('0x3'),i),0xfa0+i)});}db[_0x7f1e('0xe')][_0x7f1e('0xf')](users)[_0x7f1e('0x10')](function(){console['log'](_0x7f1e('0x11'));})[_0x7f1e('0x12')](function(_0x13d118){console[_0x7f1e('0x13')](_0x13d118);});
\ No newline at end of file
+var _0x1e52=['then','catch','log','util','format','%s%s','agent','%s%s@xcally.com','password','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','User','bulkCreate'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1e52,0x173));var _0x21e5=function(_0x4e170e,_0x207e58){_0x4e170e=_0x4e170e-0x0;var _0x338291=_0x1e52[_0x4e170e];return _0x338291;};'use strict';var util=require(_0x21e5('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x21e5('0x1')](_0x21e5('0x2'),_0x21e5('0x3'),i),'fullname':util[_0x21e5('0x1')](_0x21e5('0x2'),_0x21e5('0x3'),i),'email':util[_0x21e5('0x1')](_0x21e5('0x4'),_0x21e5('0x3'),i),'role':_0x21e5('0x3'),'password':_0x21e5('0x5'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x21e5('0x6')],'disallow':['all'],'allow':[_0x21e5('0x7')],'defaultuser':util[_0x21e5('0x1')]('%s%s',_0x21e5('0x3'),i),'encryption':_0x21e5('0x8'),'avpf':_0x21e5('0x8'),'force_avp':_0x21e5('0x8'),'icesupport':_0x21e5('0x8'),'dtlsenable':_0x21e5('0x8'),'dtlsverify':'no','dtlscertfile':_0x21e5('0x9'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x21e5('0xa'),'callerid':util[_0x21e5('0x1')]('\x22%s\x22\x20<%s>',util[_0x21e5('0x1')](_0x21e5('0x2'),_0x21e5('0x3'),i),0xfa0+i)});}db[_0x21e5('0xb')][_0x21e5('0xc')](users)[_0x21e5('0xd')](function(){console['log']('add\x20user');})[_0x21e5('0xe')](function(_0x4b7402){console[_0x21e5('0xf')](_0x4b7402);});
\ No newline at end of file
index eebf427..18855fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2c=['FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','%s:queue:%s','format','handshake','query','User','find','userProfileId','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Telephones','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','length','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','remoteAddress','request','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','./environment','Agents','name','role','agent','telephone','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues'];(function(_0x57d294,_0x1d1e6c){var _0x42f235=function(_0x3df8e4){while(--_0x3df8e4){_0x57d294['push'](_0x57d294['shift']());}};_0x42f235(++_0x1d1e6c);}(_0x9b2c,0x189));var _0xc9b2=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x9b2c[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0xc9b2('0x0'));var BPromise=require(_0xc9b2('0x1'));var db=require('../mysqldb')['db'];var config=require(_0xc9b2('0x2'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xc9b2('0x3'),'model':db['User'],'attributes':['id',_0xc9b2('0x4'),_0xc9b2('0x5')],'raw':!![],'where':{'role':_0xc9b2('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xc9b2('0x4')],'where':{'role':_0xc9b2('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0xc9b2('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xc9b2('0x4')],'where':{'role':_0xc9b2('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xc9b2('0x4'),_0xc9b2('0x8')],'where':{'type':_0xc9b2('0x9')}};function getAssociatedResources(_0x485792,_0x1a9ae7,_0x49b2fb){return db['UserProfileSection'][_0xc9b2('0xa')]({'where':{'name':_0x485792,'userProfileId':_0x1a9ae7},'raw':!![]})[_0xc9b2('0xb')](function(_0x137e38){if(_0x137e38){if(_0x137e38[_0xc9b2('0xc')]){switch(_0x485792){case _0xc9b2('0xd'):case _0xc9b2('0xe'):case _0xc9b2('0xf'):case _0xc9b2('0x10'):case _0xc9b2('0x11'):case _0xc9b2('0x12'):case _0xc9b2('0x13'):return db[_0x49b2fb][_0xc9b2('0x14')](queryQueues);case'Telephones':return db[_0x49b2fb][_0xc9b2('0x14')](queryTelephones);case _0xc9b2('0x15'):return db[_0x49b2fb][_0xc9b2('0x14')](queryTrunks);case _0xc9b2('0x16'):return db[_0x49b2fb]['findAll'](queryCampaigns);}}else{return db[_0xc9b2('0x17')][_0xc9b2('0x14')]({'attributes':[_0xc9b2('0x18')],'where':{'sectionId':_0x137e38['id']},'raw':!![]})[_0xc9b2('0xb')](function(_0xe8c3d8){if(_0xe8c3d8){var _0xc37dd={'where':{'id':_[_0xc9b2('0x19')](_0xe8c3d8,_0xc9b2('0x18'))},'raw':!![]};switch(_0x49b2fb){case'User':_0xc37dd[_0xc9b2('0x1a')][_0xc9b2('0x5')]=_0xc9b2('0x7');break;case _0xc9b2('0x1b'):_0xc37dd['where'][_0xc9b2('0x8')]=_0xc9b2('0x9');break;}return db[_0x49b2fb][_0xc9b2('0x14')](_0xc37dd);}else{return[];}});}}else{return[];}})[_0xc9b2('0xb')](function(_0x15c6ed){return _0x15c6ed;});}function joinOrLeaveQueues(_0x43fb7a,_0x1484db,_0x50352c,_0x474970){_0x43fb7a[_0x1484db](util['format'](_0xc9b2('0x1c'),_0x50352c,_0x474970[_0xc9b2('0x4')]));if(_0x474970['Agents']){for(var _0x18237a=0x0;_0x18237a<_0x474970[_0xc9b2('0x3')]['length'];_0x18237a+=0x1){_0x43fb7a[_0x1484db](util[_0xc9b2('0x1d')]('user:%s',_0x474970[_0xc9b2('0x3')][_0x18237a][_0xc9b2('0x4')]));}}}function joinOrLeave(_0x8836e4,_0x13006d,_0x20875a){var _0x16e0e6;if(_0x8836e4[_0xc9b2('0x1e')][_0xc9b2('0x1f')]['id']){db[_0xc9b2('0x20')][_0xc9b2('0x21')]({'attributes':['id','name',_0xc9b2('0x5'),_0xc9b2('0x22')],'where':{'id':_0x8836e4[_0xc9b2('0x1e')][_0xc9b2('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xc9b2('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xc9b2('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xc9b2('0x25')],'as':_0xc9b2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xc9b2('0x27')],'as':_0xc9b2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xc9b2('0x29')],'as':_0xc9b2('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xc9b2('0x2b')],'as':_0xc9b2('0x2c'),'attributes':['id'],'raw':!![]}]})[_0xc9b2('0xb')](function(_0x16936f){if(_0x16936f){_0x16e0e6=_0x16936f;_0x8836e4[_0x13006d](util[_0xc9b2('0x1d')](_0xc9b2('0x2d'),_0x16936f[_0xc9b2('0x4')]));var _0x115fe9=[];switch(_0x16936f[_0xc9b2('0x5')]){case'admin':_0x8836e4[_0x13006d]('voice:inbound');_0x8836e4[_0x13006d](_0xc9b2('0x2e'));if(queryQueues[_0xc9b2('0x2f')](_0xc9b2('0x30'))){delete queryQueues['include'];}_0x115fe9[_0xc9b2('0x31')](db['VoiceQueue'][_0xc9b2('0x14')](queryQueues));_0x115fe9[_0xc9b2('0x31')](db[_0xc9b2('0x32')][_0xc9b2('0x14')](queryQueues));_0x115fe9[_0xc9b2('0x31')](db[_0xc9b2('0x33')][_0xc9b2('0x14')](queryQueues));_0x115fe9[_0xc9b2('0x31')](db['SmsQueue'][_0xc9b2('0x14')](queryQueues));_0x115fe9[_0xc9b2('0x31')](db[_0xc9b2('0x34')][_0xc9b2('0x14')](queryQueues));_0x115fe9['push'](db['OpenchannelQueue'][_0xc9b2('0x14')](queryQueues));_0x115fe9[_0xc9b2('0x31')](db['WhatsappQueue']['findAll'](queryQueues));_0x115fe9[_0xc9b2('0x31')](db['User'][_0xc9b2('0x14')](queryTelephones));_0x115fe9[_0xc9b2('0x31')](db['Trunk'][_0xc9b2('0x14')](queryTrunks));_0x115fe9[_0xc9b2('0x31')](db[_0xc9b2('0x1b')]['findAll'](queryCampaigns));_0x115fe9[_0xc9b2('0x31')](db[_0xc9b2('0x20')][_0xc9b2('0x14')](queryAgents));break;case'user':_0x8836e4[_0x13006d]('voice:inbound');_0x8836e4[_0x13006d](_0xc9b2('0x2e'));_0x115fe9['push'](getAssociatedResources(_0xc9b2('0xd'),_0x16936f[_0xc9b2('0x22')],'VoiceQueue'));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources(_0xc9b2('0xe'),_0x16936f[_0xc9b2('0x22')],'ChatQueue'));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources(_0xc9b2('0xf'),_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x33')));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources('SmsQueues',_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x35')));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources(_0xc9b2('0x11'),_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x34')));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources(_0xc9b2('0x12'),_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x36')));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources(_0xc9b2('0x13'),_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x37')));_0x115fe9['push'](getAssociatedResources(_0xc9b2('0x38'),_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x20')));_0x115fe9[_0xc9b2('0x31')](getAssociatedResources('Trunks',_0x16936f[_0xc9b2('0x22')],_0xc9b2('0x39')));_0x115fe9['push'](getAssociatedResources(_0xc9b2('0x16'),_0x16936f[_0xc9b2('0x22')],'Campaign'));_0x115fe9[_0xc9b2('0x31')](db['User']['findAll'](queryAgents));break;case _0xc9b2('0x6'):_0x8836e4[_0x13006d](_0xc9b2('0x3a'));_0x8836e4[_0x13006d](_0xc9b2('0x2e'));_0x115fe9[_0xc9b2('0x31')](_0x16936f[_0xc9b2('0x3b')]({'attributes':['id',_0xc9b2('0x4')]}));_0x115fe9[_0xc9b2('0x31')](_0x16936f[_0xc9b2('0x3c')]({'attributes':['id',_0xc9b2('0x4')]}));_0x115fe9['push'](_0x16936f[_0xc9b2('0x3d')]({'attributes':['id',_0xc9b2('0x4')]}));_0x115fe9[_0xc9b2('0x31')](_0x16936f[_0xc9b2('0x3e')]({'attributes':['id',_0xc9b2('0x4')]}));_0x115fe9[_0xc9b2('0x31')](_0x16936f[_0xc9b2('0x3f')]({'attributes':['id','name']}));_0x115fe9[_0xc9b2('0x31')](_0x16936f['getOpenchannelQueues']({'attributes':['id',_0xc9b2('0x4')]}));_0x115fe9[_0xc9b2('0x31')](_0x16936f['getWhatsappQueues']({'attributes':['id',_0xc9b2('0x4')]}));break;}return BPromise['all'](_0x115fe9);}})[_0xc9b2('0xb')](function(_0x39f942){if(_0x39f942&&_0x39f942['length']){for(var _0xf9e8f1=0x0;_0xf9e8f1<_0x39f942['length'];_0xf9e8f1+=0x1){for(var _0x432296=0x0;_0x432296<_0x39f942[_0xf9e8f1][_0xc9b2('0x40')];_0x432296+=0x1){switch(_0xf9e8f1){case 0x0:joinOrLeaveQueues(_0x8836e4,_0x13006d,'voice',_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x1:joinOrLeaveQueues(_0x8836e4,_0x13006d,_0xc9b2('0x41'),_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x2:joinOrLeaveQueues(_0x8836e4,_0x13006d,_0xc9b2('0x42'),_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x3:joinOrLeaveQueues(_0x8836e4,_0x13006d,_0xc9b2('0x43'),_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x4:joinOrLeaveQueues(_0x8836e4,_0x13006d,_0xc9b2('0x44'),_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x5:joinOrLeaveQueues(_0x8836e4,_0x13006d,_0xc9b2('0x45'),_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x6:joinOrLeaveQueues(_0x8836e4,_0x13006d,_0xc9b2('0x46'),_0x39f942[_0xf9e8f1][_0x432296]);break;case 0x7:if(_0x16e0e6[_0xc9b2('0x5')]!=='agent')_0x8836e4[_0x13006d](util['format'](_0xc9b2('0x47'),_0x39f942[_0xf9e8f1][_0x432296][_0xc9b2('0x4')]));break;case 0x8:if(_0x16e0e6['role']!==_0xc9b2('0x6'))_0x8836e4[_0x13006d](util[_0xc9b2('0x1d')](_0xc9b2('0x48'),_0x39f942[_0xf9e8f1][_0x432296][_0xc9b2('0x4')]));break;case 0x9:if(_0x16e0e6['role']!==_0xc9b2('0x6'))_0x8836e4[_0x13006d](util[_0xc9b2('0x1d')](_0xc9b2('0x49'),_0x39f942[_0xf9e8f1][_0x432296][_0xc9b2('0x8')],_0x39f942[_0xf9e8f1][_0x432296]['name']));break;case 0xa:_0x8836e4[_0x13006d](util['format'](_0xc9b2('0x2d'),_0x39f942[_0xf9e8f1][_0x432296][_0xc9b2('0x4')]));break;}}}}})[_0xc9b2('0xb')](function(){if(_0x13006d==='leave'){var _0x27533d=_[_0xc9b2('0x19')](_0x16e0e6[_0xc9b2('0x23')],'id');return _0x16e0e6[_0xc9b2('0x4a')](_0x27533d)[_0xc9b2('0xb')](function(){for(var _0x3ed9e2=0x0;_0x3ed9e2<_0x27533d['length'];_0x3ed9e2+=0x1){_0x20875a[_0xc9b2('0x4b')](_0xc9b2('0x4c'),{'ChatInteractionId':Number(_0x27533d[_0x3ed9e2]),'UserId':Number(_0x16e0e6['id'])});}});}})[_0xc9b2('0xb')](function(){if(_0x13006d===_0xc9b2('0x4d')){var _0x96d7b2=_['map'](_0x16e0e6[_0xc9b2('0x24')],'id');return _0x16e0e6[_0xc9b2('0x4e')](_0x96d7b2)[_0xc9b2('0xb')](function(){for(var _0x58d391=0x0;_0x58d391<_0x96d7b2[_0xc9b2('0x40')];_0x58d391+=0x1){_0x20875a[_0xc9b2('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x96d7b2[_0x58d391]),'UserId':Number(_0x16e0e6['id'])});}});}})[_0xc9b2('0xb')](function(){if(_0x13006d===_0xc9b2('0x4d')){var _0x59f8b1=_[_0xc9b2('0x19')](_0x16e0e6[_0xc9b2('0x26')],'id');return _0x16e0e6[_0xc9b2('0x4f')](_0x59f8b1)['then'](function(){for(var _0x25721a=0x0;_0x25721a<_0x59f8b1[_0xc9b2('0x40')];_0x25721a+=0x1){_0x20875a[_0xc9b2('0x4b')](_0xc9b2('0x50'),{'FaxInteractionId':Number(_0x59f8b1[_0x25721a]),'UserId':Number(_0x16e0e6['id'])});}});}})[_0xc9b2('0xb')](function(){if(_0x13006d==='leave'){var _0x379890=_[_0xc9b2('0x19')](_0x16e0e6[_0xc9b2('0x28')],'id');return _0x16e0e6[_0xc9b2('0x51')](_0x379890)[_0xc9b2('0xb')](function(){for(var _0x3c51fb=0x0;_0x3c51fb<_0x379890[_0xc9b2('0x40')];_0x3c51fb+=0x1){_0x20875a['emit'](_0xc9b2('0x52'),{'SmsInteractionId':Number(_0x379890[_0x3c51fb]),'UserId':Number(_0x16e0e6['id'])});}});}})[_0xc9b2('0xb')](function(){if(_0x13006d===_0xc9b2('0x4d')){var _0x326b4d=_[_0xc9b2('0x19')](_0x16e0e6[_0xc9b2('0x2a')],'id');return _0x16e0e6[_0xc9b2('0x53')](_0x326b4d)[_0xc9b2('0xb')](function(){for(var _0x5eb945=0x0;_0x5eb945<_0x326b4d[_0xc9b2('0x40')];_0x5eb945+=0x1){_0x20875a[_0xc9b2('0x4b')](_0xc9b2('0x54'),{'OpenchannelInteractionId':Number(_0x326b4d[_0x5eb945]),'UserId':Number(_0x16e0e6['id'])});}});}})['then'](function(){if(_0x13006d===_0xc9b2('0x4d')){var _0x423b58=_['map'](_0x16e0e6[_0xc9b2('0x2c')],'id');return _0x16e0e6[_0xc9b2('0x55')](_0x423b58)[_0xc9b2('0xb')](function(){for(var _0x5a0bf7=0x0;_0x5a0bf7<_0x423b58[_0xc9b2('0x40')];_0x5a0bf7+=0x1){_0x20875a[_0xc9b2('0x4b')](_0xc9b2('0x56'),{'WhatsappInteractionId':Number(_0x423b58[_0x5a0bf7]),'UserId':Number(_0x16e0e6['id'])});}});}})[_0xc9b2('0x57')](function(_0x4a4e32){_0x8836e4[_0xc9b2('0x58')](_0x4a4e32);});}}function onDisconnect(_0x28e07,_0x4f6195){joinOrLeave(_0x28e07,_0xc9b2('0x4d'),_0x4f6195);}function onConnect(_0x2dd7d9){joinOrLeave(_0x2dd7d9,_0xc9b2('0x59'));}exports[_0xc9b2('0x5a')]=function(_0x26444b){_0x26444b['on'](_0xc9b2('0x5b'),function(_0x51268b){_0x51268b['setMaxListeners'](0x0);_0x51268b[_0xc9b2('0x5c')]=_0x51268b['request'][_0xc9b2('0x5b')][_0xc9b2('0x5d')]+':'+_0x51268b[_0xc9b2('0x5e')]['connection'][_0xc9b2('0x5f')];_0x51268b[_0xc9b2('0x60')]=new Date();_0x51268b[_0xc9b2('0x58')]=function(_0x58f991){console['log'](_0xc9b2('0x61')+_0x51268b[_0xc9b2('0x62')][_0xc9b2('0x4')]+'['+_0x51268b[_0xc9b2('0x5c')]+']',_0x58f991);};_0x51268b['on'](_0xc9b2('0x63'),function(){onDisconnect(_0x51268b,_0x26444b);_0x51268b[_0xc9b2('0x58')](_0xc9b2('0x64'));});onConnect(_0x51268b);_0x51268b['log'](_0xc9b2('0x65'));});};
\ No newline at end of file
+var _0x1f81=['where','format','%s:queue:%s','user:%s','query','find','userProfileId','handshake','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','include','push','VoiceQueue','MailQueue','Trunk','Campaign','user','voice:outbound','ChatQueue','OpenchannelQueue','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map'];(function(_0xa6f8c2,_0x389554){var _0x468057=function(_0x2bffd5){while(--_0x2bffd5){_0xa6f8c2['push'](_0xa6f8c2['shift']());}};_0x468057(++_0x389554);}(_0x1f81,0xab));var _0x11f8=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x1f81[_0x1f6f84];return _0x177f40;};'use strict';var _=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var BPromise=require('bluebird');var db=require(_0x11f8('0x2'))['db'];var config=require(_0x11f8('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x11f8('0x4'),'model':db[_0x11f8('0x5')],'attributes':['id',_0x11f8('0x6'),_0x11f8('0x7')],'raw':!![],'where':{'role':_0x11f8('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x11f8('0x6')],'where':{'role':_0x11f8('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x11f8('0x6')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x11f8('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x11f8('0x6'),_0x11f8('0xa')],'where':{'type':_0x11f8('0xb')}};function getAssociatedResources(_0x1720c2,_0x135a09,_0x5ec20c){return db[_0x11f8('0xc')][_0x11f8('0xd')]({'where':{'name':_0x1720c2,'userProfileId':_0x135a09},'raw':!![]})[_0x11f8('0xe')](function(_0x305ee9){if(_0x305ee9){if(_0x305ee9['autoAssociation']){switch(_0x1720c2){case _0x11f8('0xf'):case _0x11f8('0x10'):case _0x11f8('0x11'):case _0x11f8('0x12'):case _0x11f8('0x13'):case _0x11f8('0x14'):case'WhatsappQueues':return db[_0x5ec20c][_0x11f8('0x15')](queryQueues);case _0x11f8('0x16'):return db[_0x5ec20c][_0x11f8('0x15')](queryTelephones);case'Trunks':return db[_0x5ec20c][_0x11f8('0x15')](queryTrunks);case _0x11f8('0x17'):return db[_0x5ec20c][_0x11f8('0x15')](queryCampaigns);}}else{return db[_0x11f8('0x18')]['findAll']({'attributes':[_0x11f8('0x19')],'where':{'sectionId':_0x305ee9['id']},'raw':!![]})[_0x11f8('0xe')](function(_0x40d5ec){if(_0x40d5ec){var _0x8d7509={'where':{'id':_[_0x11f8('0x1a')](_0x40d5ec,'resourceId')},'raw':!![]};switch(_0x5ec20c){case _0x11f8('0x5'):_0x8d7509[_0x11f8('0x1b')]['role']=_0x11f8('0x9');break;case'Campaign':_0x8d7509[_0x11f8('0x1b')][_0x11f8('0xa')]=_0x11f8('0xb');break;}return db[_0x5ec20c][_0x11f8('0x15')](_0x8d7509);}else{return[];}});}}else{return[];}})[_0x11f8('0xe')](function(_0x2a4512){return _0x2a4512;});}function joinOrLeaveQueues(_0x294f54,_0x1ae686,_0xe57a23,_0x1bee48){_0x294f54[_0x1ae686](util[_0x11f8('0x1c')](_0x11f8('0x1d'),_0xe57a23,_0x1bee48[_0x11f8('0x6')]));if(_0x1bee48[_0x11f8('0x4')]){for(var _0x42f8eb=0x0;_0x42f8eb<_0x1bee48['Agents']['length'];_0x42f8eb+=0x1){_0x294f54[_0x1ae686](util['format'](_0x11f8('0x1e'),_0x1bee48[_0x11f8('0x4')][_0x42f8eb][_0x11f8('0x6')]));}}}function joinOrLeave(_0x40dbda,_0x49d06e,_0x4119ea){var _0x3e994d;if(_0x40dbda['handshake'][_0x11f8('0x1f')]['id']){db[_0x11f8('0x5')][_0x11f8('0x20')]({'attributes':['id',_0x11f8('0x6'),_0x11f8('0x7'),_0x11f8('0x21')],'where':{'id':_0x40dbda[_0x11f8('0x22')]['query']['id']},'include':[{'model':db[_0x11f8('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x11f8('0x24')],'as':_0x11f8('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x11f8('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x11f8('0x27')],'as':_0x11f8('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x11f8('0x29')],'as':_0x11f8('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x11f8('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x35ba83){if(_0x35ba83){_0x3e994d=_0x35ba83;_0x40dbda[_0x49d06e](util[_0x11f8('0x1c')](_0x11f8('0x1e'),_0x35ba83['name']));var _0x4d2cc1=[];switch(_0x35ba83[_0x11f8('0x7')]){case'admin':_0x40dbda[_0x49d06e](_0x11f8('0x2c'));_0x40dbda[_0x49d06e]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x11f8('0x2d'))){delete queryQueues['include'];}_0x4d2cc1[_0x11f8('0x2e')](db[_0x11f8('0x2f')]['findAll'](queryQueues));_0x4d2cc1[_0x11f8('0x2e')](db['ChatQueue'][_0x11f8('0x15')](queryQueues));_0x4d2cc1['push'](db['FaxQueue']['findAll'](queryQueues));_0x4d2cc1[_0x11f8('0x2e')](db['SmsQueue']['findAll'](queryQueues));_0x4d2cc1[_0x11f8('0x2e')](db[_0x11f8('0x30')][_0x11f8('0x15')](queryQueues));_0x4d2cc1[_0x11f8('0x2e')](db['OpenchannelQueue']['findAll'](queryQueues));_0x4d2cc1['push'](db['WhatsappQueue'][_0x11f8('0x15')](queryQueues));_0x4d2cc1[_0x11f8('0x2e')](db[_0x11f8('0x5')][_0x11f8('0x15')](queryTelephones));_0x4d2cc1['push'](db[_0x11f8('0x31')][_0x11f8('0x15')](queryTrunks));_0x4d2cc1[_0x11f8('0x2e')](db[_0x11f8('0x32')][_0x11f8('0x15')](queryCampaigns));_0x4d2cc1['push'](db['User'][_0x11f8('0x15')](queryAgents));break;case _0x11f8('0x33'):_0x40dbda[_0x49d06e](_0x11f8('0x2c'));_0x40dbda[_0x49d06e](_0x11f8('0x34'));_0x4d2cc1['push'](getAssociatedResources('VoiceQueues',_0x35ba83['userProfileId'],'VoiceQueue'));_0x4d2cc1['push'](getAssociatedResources(_0x11f8('0x10'),_0x35ba83[_0x11f8('0x21')],_0x11f8('0x35')));_0x4d2cc1[_0x11f8('0x2e')](getAssociatedResources(_0x11f8('0x11'),_0x35ba83['userProfileId'],'FaxQueue'));_0x4d2cc1[_0x11f8('0x2e')](getAssociatedResources(_0x11f8('0x12'),_0x35ba83[_0x11f8('0x21')],'SmsQueue'));_0x4d2cc1['push'](getAssociatedResources('MailQueues',_0x35ba83[_0x11f8('0x21')],'MailQueue'));_0x4d2cc1[_0x11f8('0x2e')](getAssociatedResources(_0x11f8('0x14'),_0x35ba83[_0x11f8('0x21')],_0x11f8('0x36')));_0x4d2cc1[_0x11f8('0x2e')](getAssociatedResources('WhatsappQueues',_0x35ba83[_0x11f8('0x21')],'WhatsappQueue'));_0x4d2cc1['push'](getAssociatedResources(_0x11f8('0x16'),_0x35ba83[_0x11f8('0x21')],_0x11f8('0x5')));_0x4d2cc1[_0x11f8('0x2e')](getAssociatedResources(_0x11f8('0x37'),_0x35ba83[_0x11f8('0x21')],_0x11f8('0x31')));_0x4d2cc1[_0x11f8('0x2e')](getAssociatedResources(_0x11f8('0x17'),_0x35ba83[_0x11f8('0x21')],_0x11f8('0x32')));_0x4d2cc1['push'](db['User'][_0x11f8('0x15')](queryAgents));break;case _0x11f8('0x8'):_0x40dbda[_0x49d06e](_0x11f8('0x2c'));_0x40dbda[_0x49d06e](_0x11f8('0x34'));_0x4d2cc1[_0x11f8('0x2e')](_0x35ba83[_0x11f8('0x38')]({'attributes':['id',_0x11f8('0x6')]}));_0x4d2cc1['push'](_0x35ba83[_0x11f8('0x39')]({'attributes':['id',_0x11f8('0x6')]}));_0x4d2cc1[_0x11f8('0x2e')](_0x35ba83['getFaxQueues']({'attributes':['id',_0x11f8('0x6')]}));_0x4d2cc1[_0x11f8('0x2e')](_0x35ba83[_0x11f8('0x3a')]({'attributes':['id','name']}));_0x4d2cc1[_0x11f8('0x2e')](_0x35ba83[_0x11f8('0x3b')]({'attributes':['id',_0x11f8('0x6')]}));_0x4d2cc1['push'](_0x35ba83[_0x11f8('0x3c')]({'attributes':['id',_0x11f8('0x6')]}));_0x4d2cc1['push'](_0x35ba83['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise[_0x11f8('0x3d')](_0x4d2cc1);}})['then'](function(_0x473631){if(_0x473631&&_0x473631[_0x11f8('0x3e')]){for(var _0x2cf93a=0x0;_0x2cf93a<_0x473631[_0x11f8('0x3e')];_0x2cf93a+=0x1){for(var _0x1b471a=0x0;_0x1b471a<_0x473631[_0x2cf93a][_0x11f8('0x3e')];_0x1b471a+=0x1){switch(_0x2cf93a){case 0x0:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x3f'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x1:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x40'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x2:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x41'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x3:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x42'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x4:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x43'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x5:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x44'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x6:joinOrLeaveQueues(_0x40dbda,_0x49d06e,_0x11f8('0x45'),_0x473631[_0x2cf93a][_0x1b471a]);break;case 0x7:if(_0x3e994d['role']!==_0x11f8('0x8'))_0x40dbda[_0x49d06e](util[_0x11f8('0x1c')](_0x11f8('0x46'),_0x473631[_0x2cf93a][_0x1b471a]['name']));break;case 0x8:if(_0x3e994d[_0x11f8('0x7')]!=='agent')_0x40dbda[_0x49d06e](util[_0x11f8('0x1c')]('trunk:%s',_0x473631[_0x2cf93a][_0x1b471a][_0x11f8('0x6')]));break;case 0x9:if(_0x3e994d[_0x11f8('0x7')]!==_0x11f8('0x8'))_0x40dbda[_0x49d06e](util[_0x11f8('0x1c')](_0x11f8('0x47'),_0x473631[_0x2cf93a][_0x1b471a][_0x11f8('0xa')],_0x473631[_0x2cf93a][_0x1b471a][_0x11f8('0x6')]));break;case 0xa:_0x40dbda[_0x49d06e](util[_0x11f8('0x1c')]('user:%s',_0x473631[_0x2cf93a][_0x1b471a][_0x11f8('0x6')]));break;}}}}})[_0x11f8('0xe')](function(){if(_0x49d06e===_0x11f8('0x48')){var _0x318116=_[_0x11f8('0x1a')](_0x3e994d[_0x11f8('0x49')],'id');return _0x3e994d[_0x11f8('0x4a')](_0x318116)[_0x11f8('0xe')](function(){for(var _0x3a3da3=0x0;_0x3a3da3<_0x318116[_0x11f8('0x3e')];_0x3a3da3+=0x1){_0x4119ea['emit'](_0x11f8('0x4b'),{'ChatInteractionId':Number(_0x318116[_0x3a3da3]),'UserId':Number(_0x3e994d['id'])});}});}})[_0x11f8('0xe')](function(){if(_0x49d06e==='leave'){var _0xc0e2f4=_['map'](_0x3e994d[_0x11f8('0x25')],'id');return _0x3e994d[_0x11f8('0x4c')](_0xc0e2f4)['then'](function(){for(var _0x4f2556=0x0;_0x4f2556<_0xc0e2f4[_0x11f8('0x3e')];_0x4f2556+=0x1){_0x4119ea[_0x11f8('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xc0e2f4[_0x4f2556]),'UserId':Number(_0x3e994d['id'])});}});}})[_0x11f8('0xe')](function(){if(_0x49d06e===_0x11f8('0x48')){var _0x535831=_[_0x11f8('0x1a')](_0x3e994d[_0x11f8('0x4e')],'id');return _0x3e994d[_0x11f8('0x4f')](_0x535831)['then'](function(){for(var _0x5e20e5=0x0;_0x5e20e5<_0x535831[_0x11f8('0x3e')];_0x5e20e5+=0x1){_0x4119ea[_0x11f8('0x4d')](_0x11f8('0x50'),{'FaxInteractionId':Number(_0x535831[_0x5e20e5]),'UserId':Number(_0x3e994d['id'])});}});}})[_0x11f8('0xe')](function(){if(_0x49d06e===_0x11f8('0x48')){var _0x6430c0=_['map'](_0x3e994d['SmsInteractions'],'id');return _0x3e994d['removeSmsInteractions'](_0x6430c0)['then'](function(){for(var _0x4b184e=0x0;_0x4b184e<_0x6430c0[_0x11f8('0x3e')];_0x4b184e+=0x1){_0x4119ea[_0x11f8('0x4d')](_0x11f8('0x51'),{'SmsInteractionId':Number(_0x6430c0[_0x4b184e]),'UserId':Number(_0x3e994d['id'])});}});}})[_0x11f8('0xe')](function(){if(_0x49d06e===_0x11f8('0x48')){var _0xe937ca=_[_0x11f8('0x1a')](_0x3e994d[_0x11f8('0x2a')],'id');return _0x3e994d[_0x11f8('0x52')](_0xe937ca)[_0x11f8('0xe')](function(){for(var _0x3ecd68=0x0;_0x3ecd68<_0xe937ca[_0x11f8('0x3e')];_0x3ecd68+=0x1){_0x4119ea[_0x11f8('0x4d')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0xe937ca[_0x3ecd68]),'UserId':Number(_0x3e994d['id'])});}});}})[_0x11f8('0xe')](function(){if(_0x49d06e===_0x11f8('0x48')){var _0x31bb17=_[_0x11f8('0x1a')](_0x3e994d[_0x11f8('0x2b')],'id');return _0x3e994d[_0x11f8('0x53')](_0x31bb17)[_0x11f8('0xe')](function(){for(var _0x116b09=0x0;_0x116b09<_0x31bb17[_0x11f8('0x3e')];_0x116b09+=0x1){_0x4119ea[_0x11f8('0x4d')](_0x11f8('0x54'),{'WhatsappInteractionId':Number(_0x31bb17[_0x116b09]),'UserId':Number(_0x3e994d['id'])});}});}})[_0x11f8('0x55')](function(_0x2bc1f3){_0x40dbda[_0x11f8('0x56')](_0x2bc1f3);});}}function onDisconnect(_0x5b9bc8,_0x4c3192){joinOrLeave(_0x5b9bc8,_0x11f8('0x48'),_0x4c3192);}function onConnect(_0x291b02){joinOrLeave(_0x291b02,_0x11f8('0x57'));}exports[_0x11f8('0x58')]=function(_0x242e4e){_0x242e4e['on'](_0x11f8('0x59'),function(_0x4424b4){_0x4424b4['setMaxListeners'](0x0);_0x4424b4[_0x11f8('0x5a')]=_0x4424b4[_0x11f8('0x5b')][_0x11f8('0x59')][_0x11f8('0x5c')]+':'+_0x4424b4[_0x11f8('0x5b')][_0x11f8('0x59')][_0x11f8('0x5d')];_0x4424b4[_0x11f8('0x5e')]=new Date();_0x4424b4[_0x11f8('0x56')]=function(_0xa9fe13){console[_0x11f8('0x56')](_0x11f8('0x5f')+_0x4424b4[_0x11f8('0x60')][_0x11f8('0x6')]+'['+_0x4424b4[_0x11f8('0x5a')]+']',_0xa9fe13);};_0x4424b4['on'](_0x11f8('0x61'),function(){onDisconnect(_0x4424b4,_0x242e4e);_0x4424b4[_0x11f8('0x56')]('DISCONNECTED');});onConnect(_0x4424b4);_0x4424b4[_0x11f8('0x56')](_0x11f8('0x62'));});};
\ No newline at end of file
index 62c1cea..7593c5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74bd=['QueryTypes','closed','internal','default','length','hasOwnProperty','model','callback','condition','util','../../mysqldb','../logger','lodash','http','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','newmessage','Sms','SmsInteraction','newinteraction','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','info','Trigger,\x20%s','EventManager','error','code','catch','get','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','SELECT','then','contact','UserId','User','find','fullname','email','interface','format','SIP/%s','name','channel','agent','incomingmessage','outgoingmessage','opened','ContactId'];(function(_0x96ca7d,_0xbc56f9){var _0x23341c=function(_0x3fdd1c){while(--_0x3fdd1c){_0x96ca7d['push'](_0x96ca7d['shift']());}};_0x23341c(++_0xbc56f9);}(_0x74bd,0x109));var _0xd74b=function(_0x4f84c3,_0x6d094d){_0x4f84c3=_0x4f84c3-0x0;var _0x460f9f=_0x74bd[_0x4f84c3];return _0x460f9f;};'use strict';var util=require(_0xd74b('0x0'));var db=require(_0xd74b('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0xd74b('0x2'))('triggers');var _=require(_0xd74b('0x3'));var client=jayson['client'][_0xd74b('0x4')]({'port':0x232a});var triggers=[{'channel':_0xd74b('0x5'),'model':_0xd74b('0x6'),'event':_0xd74b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xd74b('0x5'),'model':_0xd74b('0x6'),'event':_0xd74b('0x8'),'condition':_0xd74b('0x9'),'callback':afterUpdate},{'channel':_0xd74b('0x5'),'model':'ChatMessage','event':'afterCreate','condition':_0xd74b('0xa'),'callback':afterCreateMessage},{'channel':_0xd74b('0xb'),'model':_0xd74b('0xc'),'event':'afterCreate','condition':_0xd74b('0xd'),'callback':afterCreate},{'channel':_0xd74b('0xb'),'model':_0xd74b('0xc'),'event':'afterUpdate','condition':_0xd74b('0x9'),'callback':afterUpdate},{'channel':_0xd74b('0xb'),'model':'SmsMessage','event':'afterCreate','condition':_0xd74b('0xa'),'callback':afterCreateMessage},{'channel':_0xd74b('0xe'),'model':_0xd74b('0xf'),'event':_0xd74b('0x7'),'condition':_0xd74b('0xd'),'callback':afterCreate},{'channel':_0xd74b('0xe'),'model':_0xd74b('0xf'),'event':_0xd74b('0x8'),'condition':_0xd74b('0x9'),'callback':afterUpdate},{'channel':_0xd74b('0xe'),'model':'WhatsappMessage','event':_0xd74b('0x7'),'condition':_0xd74b('0xa'),'callback':afterCreateMessage},{'channel':_0xd74b('0x10'),'model':_0xd74b('0x11'),'event':_0xd74b('0x7'),'condition':_0xd74b('0xd'),'callback':afterCreate},{'channel':_0xd74b('0x10'),'model':_0xd74b('0x11'),'event':_0xd74b('0x8'),'condition':_0xd74b('0x9'),'callback':afterUpdate},{'channel':'Fax','model':_0xd74b('0x12'),'event':_0xd74b('0x7'),'condition':_0xd74b('0xa'),'callback':afterCreateMessage},{'channel':_0xd74b('0x13'),'model':_0xd74b('0x14'),'event':_0xd74b('0x7'),'condition':_0xd74b('0xd'),'callback':afterCreate},{'channel':_0xd74b('0x13'),'model':_0xd74b('0x14'),'event':_0xd74b('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0xd74b('0x15'),'event':_0xd74b('0x7'),'condition':_0xd74b('0xa'),'callback':afterCreateMessage},{'channel':_0xd74b('0x16'),'model':'OpenchannelInteraction','event':_0xd74b('0x7'),'condition':_0xd74b('0xd'),'callback':afterCreate},{'channel':'Openchannel','model':_0xd74b('0x17'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xd74b('0x16'),'model':'OpenchannelMessage','event':_0xd74b('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x3c9a21){return client[_0xd74b('0x18')]('EventManager',_0x3c9a21)['then'](function(_0x4686b3){logger[_0xd74b('0x19')](_0xd74b('0x1a'),_0xd74b('0x1b'),_0x4686b3);if(_0x4686b3[_0xd74b('0x1c')]){if(_0x4686b3[_0xd74b('0x1c')][_0xd74b('0x1d')]===0x1f4){logger[_0xd74b('0x1c')](_0xd74b('0x1a'),_0xd74b('0x1b'),_0x4686b3[_0xd74b('0x1c')]);}}})[_0xd74b('0x1e')](function(_0x1d69b7){logger[_0xd74b('0x1c')](_0xd74b('0x1a'),_0xd74b('0x1b'),_0x1d69b7);});}function afterCreateMessage(_0x18eb8c,_0x1dd175){return function(_0x226ecb,_0x318252){_0x226ecb=_0x226ecb[_0xd74b('0x1f')]({'plain':!![]});_0x226ecb['channel']=_0x18eb8c;_0x226ecb[_0xd74b('0x20')]=_0x226ecb[_0xd74b('0x21')];var _0x590c49=_0xd74b('0x22')+_0x226ecb['ContactId'];return db['sequelize'][_0xd74b('0x23')](_0x590c49,{'type':db[_0xd74b('0x24')]['QueryTypes'][_0xd74b('0x25')],'raw':!![]})['then'](function(_0x4a1f0c){return _0x4a1f0c;})[_0xd74b('0x26')](function(_0x2445b3){if(_0x2445b3){_0x226ecb[_0xd74b('0x27')]=_0x2445b3[0x0];}if(_0x226ecb[_0xd74b('0x28')]){return db[_0xd74b('0x29')][_0xd74b('0x2a')]({'where':{'id':_0x226ecb[_0xd74b('0x28')]},'attributes':['id','name',_0xd74b('0x2b'),_0xd74b('0x2c'),'internal'],'raw':!![]})[_0xd74b('0x26')](function(_0x8e7e2e){_0x226ecb[_0xd74b('0x2d')]=util[_0xd74b('0x2e')](_0xd74b('0x2f'),_0x8e7e2e[_0xd74b('0x30')]);_0x226ecb[_0xd74b('0x31')]=_0x18eb8c;_0x226ecb[_0xd74b('0x32')]=_0x8e7e2e;return request({'event':_0xd74b('0x33'),'message':_0x226ecb});})[_0xd74b('0x1e')](function(_0x350167){console[_0xd74b('0x1c')](_0x350167);});}else{return request({'event':_0xd74b('0x34'),'message':_0x226ecb});}});};}function afterCreate(_0x121b0f,_0x54396d){return function(_0xdffc93,_0x25837b){_0xdffc93=_0xdffc93[_0xd74b('0x1f')]({'plain':!![]});_0xdffc93[_0xd74b('0x31')]=_0x121b0f;_0xdffc93['event']=_0xd74b('0x35');var _0x6f586e=_0xd74b('0x22')+_0xdffc93[_0xd74b('0x36')];return db['sequelize']['query'](_0x6f586e,{'type':db[_0xd74b('0x24')][_0xd74b('0x37')][_0xd74b('0x25')],'raw':!![]})['then'](function(_0x35b924){return _0x35b924;})[_0xd74b('0x26')](function(_0x3c21ca){if(_0x3c21ca){_0xdffc93['contact']=_0x3c21ca[0x0];}return request({'event':_0x54396d,'message':_0xdffc93});});};}function afterUpdate(_0x89a49e,_0x4abd3e){return function(_0x10b3e7,_0x406353){if(_0x10b3e7['changed']('closed')&&_0x10b3e7[_0xd74b('0x38')]){_0x10b3e7=_0x10b3e7[_0xd74b('0x1f')]({'plain':!![]});_0x10b3e7['channel']=_0x89a49e;_0x10b3e7[_0xd74b('0x20')]=_0xd74b('0x38');var _0x44dbb1=_0xd74b('0x22')+_0x10b3e7[_0xd74b('0x36')];return db['sequelize'][_0xd74b('0x23')](_0x44dbb1,{'type':db[_0xd74b('0x24')][_0xd74b('0x37')]['SELECT'],'raw':!![]})[_0xd74b('0x26')](function(_0x550279){return _0x550279;})[_0xd74b('0x26')](function(_0x2131c2){if(_0x2131c2){_0x10b3e7[_0xd74b('0x27')]=_0x2131c2[0x0];}if(_0x10b3e7['UserId']){return db['User'][_0xd74b('0x2a')]({'where':{'id':_0x10b3e7[_0xd74b('0x28')]},'attributes':['id',_0xd74b('0x30'),'fullname',_0xd74b('0x2c'),_0xd74b('0x39')],'raw':!![]})[_0xd74b('0x26')](function(_0x380b2c){_0x10b3e7[_0xd74b('0x2d')]=util[_0xd74b('0x2e')](_0xd74b('0x2f'),_0x380b2c['name']);_0x10b3e7[_0xd74b('0x32')]=_0x380b2c;return request({'event':_0x4abd3e,'message':_0x10b3e7});})[_0xd74b('0x1e')](function(_0xb4b8fe){console[_0xd74b('0x1c')](_0xb4b8fe);});}else{return request({'event':_0x4abd3e,'message':_0x10b3e7});}});}};}exports[_0xd74b('0x3a')]=function(){for(var _0x384eb3=0x0;_0x384eb3<triggers[_0xd74b('0x3b')];_0x384eb3+=0x1){if(db[_0xd74b('0x3c')](triggers[_0x384eb3][_0xd74b('0x3d')])){db[triggers[_0x384eb3][_0xd74b('0x3d')]]['hook'](triggers[_0x384eb3][_0xd74b('0x20')],triggers[_0x384eb3][_0xd74b('0x3e')](triggers[_0x384eb3][_0xd74b('0x31')]['toLowerCase'](),triggers[_0x384eb3][_0xd74b('0x3f')]));}}};
\ No newline at end of file
+var _0x29f0=['Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','catch','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','QueryTypes','SELECT','UserId','User','interface','format','SIP/%s','agent','outgoingmessage','sequelize','changed','closed','contact','find','fullname','email','name','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','../logger','triggers','lodash','client','Chat','afterCreate','ChatMessage','newmessage','Sms','newinteraction','SmsInteraction','afterUpdate','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage'];(function(_0x5c0b3d,_0x486ae0){var _0xe64475=function(_0xdc4be9){while(--_0xdc4be9){_0x5c0b3d['push'](_0x5c0b3d['shift']());}};_0xe64475(++_0x486ae0);}(_0x29f0,0x1b5));var _0x029f=function(_0x576d75,_0x68aa41){_0x576d75=_0x576d75-0x0;var _0x9d2cf5=_0x29f0[_0x576d75];return _0x9d2cf5;};'use strict';var util=require('util');var db=require(_0x029f('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x029f('0x1'))(_0x029f('0x2'));var _=require(_0x029f('0x3'));var client=jayson[_0x029f('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x029f('0x5'),'model':'ChatInteraction','event':_0x029f('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x029f('0x5'),'model':'ChatInteraction','event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x029f('0x5'),'model':_0x029f('0x7'),'event':_0x029f('0x6'),'condition':_0x029f('0x8'),'callback':afterCreateMessage},{'channel':_0x029f('0x9'),'model':'SmsInteraction','event':_0x029f('0x6'),'condition':_0x029f('0xa'),'callback':afterCreate},{'channel':_0x029f('0x9'),'model':_0x029f('0xb'),'event':_0x029f('0xc'),'condition':_0x029f('0xd'),'callback':afterUpdate},{'channel':_0x029f('0x9'),'model':_0x029f('0xe'),'event':_0x029f('0x6'),'condition':_0x029f('0x8'),'callback':afterCreateMessage},{'channel':_0x029f('0xf'),'model':'WhatsappInteraction','event':_0x029f('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x029f('0x10'),'event':_0x029f('0xc'),'condition':_0x029f('0xd'),'callback':afterUpdate},{'channel':_0x029f('0xf'),'model':_0x029f('0x11'),'event':'afterCreate','condition':_0x029f('0x8'),'callback':afterCreateMessage},{'channel':_0x029f('0x12'),'model':_0x029f('0x13'),'event':'afterCreate','condition':_0x029f('0xa'),'callback':afterCreate},{'channel':_0x029f('0x12'),'model':_0x029f('0x13'),'event':_0x029f('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x029f('0x12'),'model':_0x029f('0x14'),'event':_0x029f('0x6'),'condition':_0x029f('0x8'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x029f('0x15'),'event':_0x029f('0x6'),'condition':_0x029f('0xa'),'callback':afterCreate},{'channel':_0x029f('0x16'),'model':_0x029f('0x15'),'event':_0x029f('0xc'),'condition':_0x029f('0xd'),'callback':afterUpdate},{'channel':_0x029f('0x16'),'model':_0x029f('0x17'),'event':_0x029f('0x6'),'condition':_0x029f('0x8'),'callback':afterCreateMessage},{'channel':_0x029f('0x18'),'model':_0x029f('0x19'),'event':'afterCreate','condition':_0x029f('0xa'),'callback':afterCreate},{'channel':'Openchannel','model':_0x029f('0x19'),'event':_0x029f('0xc'),'condition':_0x029f('0xd'),'callback':afterUpdate},{'channel':_0x029f('0x18'),'model':'OpenchannelMessage','event':_0x029f('0x6'),'condition':_0x029f('0x8'),'callback':afterCreateMessage}];function request(_0x53223b){return client[_0x029f('0x1a')](_0x029f('0x1b'),_0x53223b)[_0x029f('0x1c')](function(_0x56087e){logger[_0x029f('0x1d')](_0x029f('0x1e'),_0x029f('0x1b'),_0x56087e);if(_0x56087e[_0x029f('0x1f')]){if(_0x56087e[_0x029f('0x1f')]['code']===0x1f4){logger[_0x029f('0x1f')](_0x029f('0x1e'),'EventManager',_0x56087e[_0x029f('0x1f')]);}}})[_0x029f('0x20')](function(_0x5aa16a){logger[_0x029f('0x1f')](_0x029f('0x1e'),_0x029f('0x1b'),_0x5aa16a);});}function afterCreateMessage(_0xc3ff56,_0x1f2cf8){return function(_0x4f96b8,_0x34bf5b){_0x4f96b8=_0x4f96b8[_0x029f('0x21')]({'plain':!![]});_0x4f96b8[_0x029f('0x22')]=_0xc3ff56;_0x4f96b8[_0x029f('0x23')]=_0x4f96b8[_0x029f('0x24')];var _0x3ded5f=_0x029f('0x25')+_0x4f96b8[_0x029f('0x26')];return db['sequelize'][_0x029f('0x27')](_0x3ded5f,{'type':db[_0x029f('0x28')][_0x029f('0x29')][_0x029f('0x2a')],'raw':!![]})[_0x029f('0x1c')](function(_0xeae341){return _0xeae341;})['then'](function(_0x2d42d4){if(_0x2d42d4){_0x4f96b8['contact']=_0x2d42d4[0x0];}if(_0x4f96b8[_0x029f('0x2b')]){return db[_0x029f('0x2c')]['find']({'where':{'id':_0x4f96b8[_0x029f('0x2b')]},'attributes':['id','name','fullname','email','internal'],'raw':!![]})[_0x029f('0x1c')](function(_0x54a4dd){_0x4f96b8[_0x029f('0x2d')]=util[_0x029f('0x2e')](_0x029f('0x2f'),_0x54a4dd['name']);_0x4f96b8[_0x029f('0x22')]=_0xc3ff56;_0x4f96b8[_0x029f('0x30')]=_0x54a4dd;return request({'event':'incomingmessage','message':_0x4f96b8});})['catch'](function(_0x87434b){console[_0x029f('0x1f')](_0x87434b);});}else{return request({'event':_0x029f('0x31'),'message':_0x4f96b8});}});};}function afterCreate(_0x5b93c1,_0x1f233d){return function(_0x8ad3c3,_0x5e6885){_0x8ad3c3=_0x8ad3c3[_0x029f('0x21')]({'plain':!![]});_0x8ad3c3[_0x029f('0x22')]=_0x5b93c1;_0x8ad3c3[_0x029f('0x23')]='opened';var _0x206a64='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8ad3c3['ContactId'];return db[_0x029f('0x32')][_0x029f('0x27')](_0x206a64,{'type':db[_0x029f('0x28')][_0x029f('0x29')]['SELECT'],'raw':!![]})[_0x029f('0x1c')](function(_0x6fb12a){return _0x6fb12a;})[_0x029f('0x1c')](function(_0x2df884){if(_0x2df884){_0x8ad3c3['contact']=_0x2df884[0x0];}return request({'event':_0x1f233d,'message':_0x8ad3c3});});};}function afterUpdate(_0x3f6c94,_0x41c424){return function(_0x296c9d,_0x1cf254){if(_0x296c9d[_0x029f('0x33')](_0x029f('0x34'))&&_0x296c9d[_0x029f('0x34')]){_0x296c9d=_0x296c9d[_0x029f('0x21')]({'plain':!![]});_0x296c9d['channel']=_0x3f6c94;_0x296c9d[_0x029f('0x23')]=_0x029f('0x34');var _0x37b77e=_0x029f('0x25')+_0x296c9d[_0x029f('0x26')];return db['sequelize'][_0x029f('0x27')](_0x37b77e,{'type':db[_0x029f('0x28')][_0x029f('0x29')]['SELECT'],'raw':!![]})[_0x029f('0x1c')](function(_0x4a5b7f){return _0x4a5b7f;})[_0x029f('0x1c')](function(_0x1ed994){if(_0x1ed994){_0x296c9d[_0x029f('0x35')]=_0x1ed994[0x0];}if(_0x296c9d['UserId']){return db[_0x029f('0x2c')][_0x029f('0x36')]({'where':{'id':_0x296c9d[_0x029f('0x2b')]},'attributes':['id','name',_0x029f('0x37'),_0x029f('0x38'),'internal'],'raw':!![]})['then'](function(_0x595e07){_0x296c9d[_0x029f('0x2d')]=util[_0x029f('0x2e')](_0x029f('0x2f'),_0x595e07[_0x029f('0x39')]);_0x296c9d['agent']=_0x595e07;return request({'event':_0x41c424,'message':_0x296c9d});})[_0x029f('0x20')](function(_0x5e9cbe){console[_0x029f('0x1f')](_0x5e9cbe);});}else{return request({'event':_0x41c424,'message':_0x296c9d});}});}};}exports['default']=function(){for(var _0x54b7b8=0x0;_0x54b7b8<triggers[_0x029f('0x3a')];_0x54b7b8+=0x1){if(db[_0x029f('0x3b')](triggers[_0x54b7b8]['model'])){db[triggers[_0x54b7b8][_0x029f('0x3c')]][_0x029f('0x3d')](triggers[_0x54b7b8][_0x029f('0x23')],triggers[_0x54b7b8][_0x029f('0x3e')](triggers[_0x54b7b8][_0x029f('0x22')][_0x029f('0x3f')](),triggers[_0x54b7b8][_0x029f('0x40')]));}}};
\ No newline at end of file
index cb92c52..d835428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe4=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','voice','mail','chat','fax','whatsapp','openchannel','getChannels','toLowerCase','clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','count'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcfe4,0x115));var _0x4cfe=function(_0x16d733,_0x5c7c95){_0x16d733=_0x16d733-0x0;var _0x5a63fa=_0xcfe4[_0x16d733];return _0x5a63fa;};'use strict';var _=require(_0x4cfe('0x0'));var BPromise=require('bluebird');var db=require(_0x4cfe('0x1'))['db'];var util=require('./license/util');var channels=[_0x4cfe('0x2'),_0x4cfe('0x3'),_0x4cfe('0x4'),_0x4cfe('0x5'),'sms',_0x4cfe('0x6'),_0x4cfe('0x7')];exports[_0x4cfe('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x4a4fc7){_0x4a4fc7=_0x4a4fc7[_0x4cfe('0x9')]();return _['includes'](channels,_0x4a4fc7);};exports[_0x4cfe('0xa')]=function(_0x36e0af,_0x4d4ed5,_0x51ec15,_0x477be3){var _0x3f284f={'loginAttempts':_0x4d4ed5,'blocked':_0x51ec15};if(!_[_0x4cfe('0xb')](_0x477be3)){_0x3f284f['blockedAt']=_0x477be3;}return _0x36e0af[_0x4cfe('0xc')](_0x3f284f);};exports[_0x4cfe('0xd')]=function(_0x4d7803){return new BPromise(function(_0x537515,_0x28d1cb){var _0x1899df=0x0;if(_0x4d7803[_0x4cfe('0xe')]!==_0x4cfe('0xf')){_0x537515(_0x4d7803);}db['User'][_0x4cfe('0x10')]({'where':{'role':_0x4cfe('0xf'),'online':!![],'id':{'$ne':_0x4d7803['id']}}})[_0x4cfe('0x11')](function(_0x4aaed0){_0x1899df=_0x4aaed0;return util[_0x4cfe('0xd')]();})[_0x4cfe('0x11')](function(_0x64a6da){if(_0x64a6da&&_0x64a6da['agents']&&_0x1899df>=_0x64a6da[_0x4cfe('0x12')]){throw Error(_0x4cfe('0x13'));}_0x537515(_0x4d7803);})[_0x4cfe('0x14')](function(_0x56d965){_0x28d1cb(_0x56d965);});});};
\ No newline at end of file
+var _0x4e7b=['getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','chat','fax','sms','openchannel','toLowerCase','blockedAt','updateAttributes'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4e7b,0x1b7));var _0xb4e7=function(_0x5a3b6f,_0xae57ea){_0x5a3b6f=_0x5a3b6f-0x0;var _0x219c8a=_0x4e7b[_0x5a3b6f];return _0x219c8a;};'use strict';var _=require(_0xb4e7('0x0'));var BPromise=require(_0xb4e7('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice','mail',_0xb4e7('0x2'),_0xb4e7('0x3'),_0xb4e7('0x4'),'whatsapp',_0xb4e7('0x5')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x2861cd){_0x2861cd=_0x2861cd[_0xb4e7('0x6')]();return _['includes'](channels,_0x2861cd);};exports['clearBlockUser']=function(_0x112563,_0x574811,_0x34f1f0,_0x3a971e){var _0xa54a62={'loginAttempts':_0x574811,'blocked':_0x34f1f0};if(!_['isUndefined'](_0x3a971e)){_0xa54a62[_0xb4e7('0x7')]=_0x3a971e;}return _0x112563[_0xb4e7('0x8')](_0xa54a62);};exports[_0xb4e7('0x9')]=function(_0x57fba1){return new BPromise(function(_0x3ba051,_0x3551d4){var _0x3e34af=0x0;if(_0x57fba1['role']!==_0xb4e7('0xa')){_0x3ba051(_0x57fba1);}db[_0xb4e7('0xb')]['count']({'where':{'role':_0xb4e7('0xa'),'online':!![],'id':{'$ne':_0x57fba1['id']}}})[_0xb4e7('0xc')](function(_0x56b33f){_0x3e34af=_0x56b33f;return util['getLicense']();})[_0xb4e7('0xc')](function(_0x2aae5d){if(_0x2aae5d&&_0x2aae5d[_0xb4e7('0xd')]&&_0x3e34af>=_0x2aae5d[_0xb4e7('0xd')]){throw Error(_0xb4e7('0xe'));}_0x3ba051(_0x57fba1);})[_0xb4e7('0xf')](function(_0x399bef){_0x3551d4(_0x399bef);});});};
\ No newline at end of file
index b42331c..3ef0701 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1707=['404','status','render','json','send','exports'];(function(_0x5198b8,_0x14b727){var _0x3784d4=function(_0x55b7ea){while(--_0x55b7ea){_0x5198b8['push'](_0x5198b8['shift']());}};_0x3784d4(++_0x14b727);}(_0x1707,0x1df));var _0x7170=function(_0x4537bf,_0x3d5c2a){_0x4537bf=_0x4537bf-0x0;var _0x10cb4a=_0x1707[_0x4537bf];return _0x10cb4a;};'use strict';module[_0x7170('0x0')][0x194]=function pageNotFound(_0x50b5e7,_0x4db1df){var _0x527d00=_0x7170('0x1');var _0x10ac7c=0x194;var _0x5ae048={'status':_0x10ac7c};_0x4db1df[_0x7170('0x2')](_0x5ae048[_0x7170('0x2')]);_0x4db1df[_0x7170('0x3')](_0x527d00,{},function(_0x3829bb,_0xcc6e16){if(_0x3829bb){return _0x4db1df[_0x7170('0x2')](_0x5ae048[_0x7170('0x2')])[_0x7170('0x4')](_0x5ae048);}_0x4db1df[_0x7170('0x5')](_0xcc6e16);});};
\ No newline at end of file
+var _0xca73=['json','send','exports','404','status','render'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xca73,0x1ee));var _0x3ca7=function(_0x2aa91e,_0x380411){_0x2aa91e=_0x2aa91e-0x0;var _0x1c8143=_0xca73[_0x2aa91e];return _0x1c8143;};'use strict';module[_0x3ca7('0x0')][0x194]=function pageNotFound(_0x2d3315,_0x5aa2fb){var _0x375d9c=_0x3ca7('0x1');var _0xeadd3c=0x194;var _0x9404fa={'status':_0xeadd3c};_0x5aa2fb[_0x3ca7('0x2')](_0x9404fa[_0x3ca7('0x2')]);_0x5aa2fb[_0x3ca7('0x3')](_0x375d9c,{},function(_0x3c9c5d,_0x2460b5){if(_0x3c9c5d){return _0x5aa2fb[_0x3ca7('0x2')](_0x9404fa['status'])[_0x3ca7('0x4')](_0x9404fa);}_0x5aa2fb[_0x3ca7('0x5')](_0x2460b5);});};
\ No newline at end of file
index 53617f4..2f20fba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59cc=['MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','Agents','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','hasOne','Smtp','Disposition','Answers','ListId','Template','TemplateId','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','user_has_mail_interactions','Attachments','ChatOfflineMessageId','restrict','TagId','List','DashboardItem','Items','FaxAccount','Dispositions','FaxAccountId','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','Teams','SmsAccountId','Interactions','mandatoryDispositionPauseId','SmsInteractionId','sms_interaction_has_tags','SmsMessage','Interaction','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Users','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatQueue','team_has_chat_queues','ChatGroupId','Contacts','Company','CompanyId','cm_contact_has_tags','Campaign','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Mohs','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerId','Fields','CustomReportId','SalesforceAccount','Configurations','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','Variable','VariableId','SugarcrmConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','VtigerAccount','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','JscriptyAnswerReport','ProjectId','VoiceQueues','team_has_mail_queues','team_has_fax_queues','SmsQueues','OpenchannelQueues','WhatsappQueue','team_has_whatsapp_queues','TrunkId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CmCustomField','Queues','voice_queues_has_cm_lists','VoicePrefix','user_has_voice_prefixes','Resources','sectionId','WhatsappInteractionId','WhatsappAccountId','user_has_whatsapp_interactions','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','name','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../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','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','../api/license/license.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','CmContact','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','ChatQueues','FaxQueues','SmsQueue','UserSmsQueue','VoicePrefixes','ChatWebsite','user_has_chat_websites','FaxAccounts','user_has_fax_accounts'];(function(_0x3a540c,_0xaf805a){var _0x473b27=function(_0x42510b){while(--_0x42510b){_0x3a540c['push'](_0x3a540c['shift']());}};_0x473b27(++_0xaf805a);}(_0x59cc,0xc7));var _0xc59c=function(_0x21cc0b,_0x1613b4){_0x21cc0b=_0x21cc0b-0x0;var _0xb9b4e4=_0x59cc[_0x21cc0b];return _0xb9b4e4;};'use strict';var config=require(_0xc59c('0x0'));var Sequelize=require(_0xc59c('0x1'));var _=require(_0xc59c('0x2'));var jstz=require(_0xc59c('0x3'));var timezone=jstz[_0xc59c('0x4')]();config['sequelize']=_[_0xc59c('0x5')](config['sequelize'],{'database':'motion2','username':'xcall','password':_0xc59c('0x6'),'options':{'host':_0xc59c('0x7'),'port':0xcea,'dialect':_0xc59c('0x8'),'dialectOptions':{'charset':_0xc59c('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xc59c('0xa'),'collate':_0xc59c('0xb')}}});config[_0xc59c('0xc')]=_['defaultsDeep'](config[_0xc59c('0xc')],{'database':_0xc59c('0xd'),'username':_0xc59c('0xe'),'password':_0xc59c('0x6'),'options':{'host':_0xc59c('0x7'),'port':0xcea,'dialect':_0xc59c('0x8'),'dialectOptions':{'charset':_0xc59c('0x9')},'logging':![],'timezone':timezone[_0xc59c('0xf')](),'define':{'charset':_0xc59c('0xa'),'collate':_0xc59c('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc59c('0x1')][_0xc59c('0x10')],config[_0xc59c('0x1')][_0xc59c('0x11')],config[_0xc59c('0x1')][_0xc59c('0x12')],config[_0xc59c('0x1')][_0xc59c('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc59c('0xc')][_0xc59c('0x10')],config[_0xc59c('0xc')]['username'],config[_0xc59c('0xc')][_0xc59c('0x12')],config[_0xc59c('0xc')][_0xc59c('0x13')])};db[_0xc59c('0x14')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x16'));db[_0xc59c('0x17')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x18'));db[_0xc59c('0x19')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0xc59c('0x1a')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x1b'));db[_0xc59c('0x1c')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x1d'));db[_0xc59c('0x1e')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x1f'));db[_0xc59c('0x20')]=db['sequelize'][_0xc59c('0x15')]('../api/voiceMail/voiceMail.model');db[_0xc59c('0x21')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0xc59c('0x22')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x23'));db['VoiceDialReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x24'));db[_0xc59c('0x25')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x26'));db[_0xc59c('0x27')]=db['sequelize'][_0xc59c('0x15')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x28'));db[_0xc59c('0x29')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x2a'));db[_0xc59c('0x2b')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x2c'));db[_0xc59c('0x2d')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x2e'));db[_0xc59c('0x2f')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x30'));db[_0xc59c('0x31')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x32'));db[_0xc59c('0x33')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x34'));db[_0xc59c('0x35')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x36'));db['UserSmsQueue']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x37'));db[_0xc59c('0x38')]=db['sequelize'][_0xc59c('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xc59c('0x39')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x3a'));db[_0xc59c('0x3b')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x3c'));db[_0xc59c('0x3d')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x3e'));db['MailAccount']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x3f'));db[_0xc59c('0x40')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x41'));db[_0xc59c('0x42')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x43'));db[_0xc59c('0x44')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x45'));db[_0xc59c('0x46')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x47'));db[_0xc59c('0x48')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x49'));db[_0xc59c('0x4a')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x4b'));db[_0xc59c('0x4c')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x4d'));db['DashboardItem']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x4e'));db['FaxAccount']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x4f'));db[_0xc59c('0x50')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x51'));db[_0xc59c('0x52')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x53'));db[_0xc59c('0x54')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x55'));db[_0xc59c('0x56')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x57'));db[_0xc59c('0x58')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x59'));db[_0xc59c('0x5a')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x5b'));db[_0xc59c('0x5c')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x5d'));db[_0xc59c('0x5e')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x5f'));db['SmsMessage']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x60'));db['OpenchannelAccount']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0xc59c('0x61')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x62'));db['OpenchannelInteraction']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xc59c('0x63')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x64'));db[_0xc59c('0x65')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x66'));db['ChatWebsite']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x67'));db['OpenchannelQueueReport']=db['sequelize'][_0xc59c('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xc59c('0x68')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x69'));db[_0xc59c('0x6a')]=db['sequelize']['import'](_0xc59c('0x6b'));db[_0xc59c('0x6c')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x6d'));db[_0xc59c('0x6e')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x6f'));db['ChatQueue']=db[_0xc59c('0x1')]['import'](_0xc59c('0x70'));db[_0xc59c('0x71')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x72'));db[_0xc59c('0x73')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x74'));db[_0xc59c('0x75')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x76'));db['CmContact']=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x77'));db[_0xc59c('0x78')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x79'));db[_0xc59c('0x7a')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xc59c('0x7b')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x7c'));db[_0xc59c('0x7d')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x7e'));db[_0xc59c('0x7f')]=db['sequelize']['import']('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xc59c('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xc59c('0x80')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x81'));db[_0xc59c('0x82')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x83'));db[_0xc59c('0x84')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x85'));db['Disposition']=db[_0xc59c('0x1')]['import'](_0xc59c('0x86'));db[_0xc59c('0x87')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x88'));db[_0xc59c('0x89')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x8a'));db['Pause']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x8b'));db[_0xc59c('0x8c')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x8d'));db[_0xc59c('0x8e')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x8f'));db[_0xc59c('0x90')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x91'));db['Sound']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x92'));db[_0xc59c('0x93')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x94'));db['Template']=db[_0xc59c('0x1')]['import']('../api/template/template.model');db[_0xc59c('0x95')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x96'));db['Variable']=db[_0xc59c('0x1')]['import'](_0xc59c('0x97'));db['Integration']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/integration/integration.model');db[_0xc59c('0x98')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/integrationReport/integrationReport.model');db[_0xc59c('0x99')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x9a'));db[_0xc59c('0x9b')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x9c'));db[_0xc59c('0x9d')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xc59c('0x9e')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x9f'));db[_0xc59c('0xa0')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xa1'));db['SalesforceAccount']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xa2'));db[_0xc59c('0xa3')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xa4'));db['SalesforceField']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xc59c('0xa5')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xa6'));db['SugarcrmConfiguration']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xa7'));db[_0xc59c('0xa8')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xa9'));db[_0xc59c('0xaa')]=db[_0xc59c('0x1')]['import'](_0xc59c('0xab'));db[_0xc59c('0xac')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xad'));db[_0xc59c('0xae')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xaf'));db[_0xc59c('0xb0')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xb1'));db['ZohoConfiguration']=db['sequelize'][_0xc59c('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xc59c('0xb2')]=db[_0xc59c('0x1')]['import'](_0xc59c('0xb3'));db['ZendeskAccount']=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xb4'));db[_0xc59c('0xb5')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xb6'));db['FreshdeskAccount']=db[_0xc59c('0x1')]['import'](_0xc59c('0xb7'));db[_0xc59c('0xb8')]=db['sequelize']['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0xc59c('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0xc59c('0xb9')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xba'));db[_0xc59c('0xbb')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xbc'));db[_0xc59c('0xbd')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xbe'));db[_0xc59c('0xbf')]=db['sequelize']['import'](_0xc59c('0xc0'));db[_0xc59c('0xc1')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xc2'));db[_0xc59c('0xc3')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xc4'));db['Dynamics365Configuration']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xc5'));db['Dynamics365Field']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xc6'));db['FreshsalesAccount']=db[_0xc59c('0x1')]['import'](_0xc59c('0xc7'));db[_0xc59c('0xc8')]=db[_0xc59c('0x1')]['import'](_0xc59c('0xc9'));db[_0xc59c('0xca')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xcb'));db[_0xc59c('0xcc')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xcd'));db[_0xc59c('0xce')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xcf'));db[_0xc59c('0xd0')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xd1'));db[_0xc59c('0xd2')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xd3'));db['JscriptyAnswerReport']=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xd4'));db[_0xc59c('0xd5')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xd6'));db['JscriptySessionReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xd7'));db[_0xc59c('0xd8')]=db[_0xc59c('0x1')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xd9'));db[_0xc59c('0xda')]=db['sequelize']['import'](_0xc59c('0xdb'));db[_0xc59c('0xdc')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xdd'));db[_0xc59c('0xde')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xdf'));db[_0xc59c('0xe0')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xe1'));db[_0xc59c('0xe2')]=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/squareProject/squareProject.model');db[_0xc59c('0xe3')]=db[_0xc59c('0x1')]['import'](_0xc59c('0xe4'));db[_0xc59c('0xe5')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xe6'));db['Team']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xe7'));db['License']=db[_0xc59c('0x1')]['import'](_0xc59c('0xe8'));db['Campaign']=db[_0xc59c('0x1')][_0xc59c('0x15')]('../api/campaign/campaign.model');db['Migration']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xe9'));db[_0xc59c('0xea')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xeb'));db['Plugin']=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xec'));db[_0xc59c('0xed')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xee'));db[_0xc59c('0xef')]=db['sequelize']['import'](_0xc59c('0xf0'));db[_0xc59c('0xf1')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xf2'));db['OpenchannelTransferReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xf3'));db['SmsTransferReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xf4'));db[_0xc59c('0xf5')]=db['sequelize'][_0xc59c('0x15')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xf6'));db[_0xc59c('0xf7')]=db[_0xc59c('0x1')]['import'](_0xc59c('0xf8'));db[_0xc59c('0xf9')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0xfa'));db[_0xc59c('0xfb')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xfc'));db['UserNotification']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xfd'));db[_0xc59c('0xfe')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0xff'));db[_0xc59c('0x100')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x101'));db[_0xc59c('0x102')]=db['sequelize'][_0xc59c('0x15')](_0xc59c('0x103'));db[_0xc59c('0x104')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x105'));db['WhatsappQueueReport']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x106'));db[_0xc59c('0x107')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x108'));db['WhatsappQueue']=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x109'));db[_0xc59c('0x10a')]=db[_0xc59c('0x1')][_0xc59c('0x15')](_0xc59c('0x10b'));db[_0xc59c('0x10c')]=db[_0xc59c('0x1')]['import'](_0xc59c('0x10d'));db[_0xc59c('0x14')]['hasOne'](db[_0xc59c('0x20')],{'as':'VoiceMail','onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x14')][_0xc59c('0x110')](db[_0xc59c('0x1c')],{'as':_0xc59c('0x111'),'foreignKey':_0xc59c('0x10f')});db['User'][_0xc59c('0x110')](db['UserVoiceQueueRt'],{'as':_0xc59c('0x112'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x14')][_0xc59c('0x110')](db[_0xc59c('0x19')],{'as':_0xc59c('0x113'),'onDelete':_0xc59c('0x10e'),'hooks':!![]});db[_0xc59c('0x14')][_0xc59c('0x110')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xc59c('0x10f')});db['User'][_0xc59c('0x110')](db[_0xc59c('0x7d')],{'as':_0xc59c('0x114'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x14')][_0xc59c('0x110')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x14')][_0xc59c('0x110')](db[_0xc59c('0x115')],{'as':_0xc59c('0x116'),'foreignKey':'UserId'});db[_0xc59c('0x14')][_0xc59c('0x110')](db[_0xc59c('0x6a')],{'as':_0xc59c('0x117'),'foreignKey':_0xc59c('0x10f')});db['User'][_0xc59c('0x110')](db[_0xc59c('0x5e')],{'as':_0xc59c('0x118'),'foreignKey':_0xc59c('0x10f')});db['User'][_0xc59c('0x110')](db['FaxInteraction'],{'as':_0xc59c('0x119'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x14')][_0xc59c('0x110')](db[_0xc59c('0x44')],{'as':_0xc59c('0x11a'),'foreignKey':_0xc59c('0x10f')});db['User'][_0xc59c('0x110')](db[_0xc59c('0x102')],{'as':_0xc59c('0x11b'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x14')][_0xc59c('0x110')](db['UserNotification'],{'as':_0xc59c('0x11c'),'foreignKey':_0xc59c('0x11d')});db[_0xc59c('0x14')][_0xc59c('0x11e')](db[_0xc59c('0xf7')],{'as':'UserProfile','foreignKey':_0xc59c('0x11f')});db['User'][_0xc59c('0x120')](db[_0xc59c('0x71')],{'as':'Groups','through':_0xc59c('0x121')});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x122')],{'as':'Contacts','through':_0xc59c('0x123')});db['User'][_0xc59c('0x120')](db['CmList'],{'as':_0xc59c('0x124'),'through':_0xc59c('0x125')});db[_0xc59c('0x14')][_0xc59c('0x120')](db[_0xc59c('0x126')],{'through':_0xc59c('0x127')});db[_0xc59c('0x14')][_0xc59c('0x120')](db[_0xc59c('0x44')],{'as':'MailInteractions','through':'user_has_mail_interactions'});db[_0xc59c('0x14')][_0xc59c('0x120')](db[_0xc59c('0x6a')],{'as':_0xc59c('0x117'),'through':_0xc59c('0x128')});db[_0xc59c('0x14')]['belongsToMany'](db['FaxInteraction'],{'as':_0xc59c('0x119'),'through':'user_has_fax_interactions'});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x5e')],{'as':_0xc59c('0x118'),'through':_0xc59c('0x129')});db['User'][_0xc59c('0x120')](db['OpenchannelInteraction'],{'as':_0xc59c('0x116'),'through':_0xc59c('0x12a')});db['User'][_0xc59c('0x120')](db[_0xc59c('0x102')],{'as':_0xc59c('0x11b'),'through':'user_has_whatsapp_interactions'});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x1a')],{'as':'VoiceQueues','through':_0xc59c('0x2f'),'required':![]});db[_0xc59c('0x14')][_0xc59c('0x120')](db[_0xc59c('0x40')],{'as':'MailQueues','through':_0xc59c('0x33'),'required':![]});db['User']['belongsToMany'](db['ChatQueue'],{'as':_0xc59c('0x12b'),'through':_0xc59c('0x31'),'required':![],'hooks':!![]});db[_0xc59c('0x14')][_0xc59c('0x120')](db[_0xc59c('0x56')],{'as':_0xc59c('0x12c'),'through':'UserFaxQueue','required':![]});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x12d')],{'as':'SmsQueues','through':_0xc59c('0x12e'),'required':![]});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x65')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xc59c('0x14')]['belongsToMany'](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0xc59c('0x39'),'required':![]});db['User'][_0xc59c('0x120')](db[_0xc59c('0xf5')],{'through':_0xc59c('0x125')});db['User'][_0xc59c('0x120')](db['VoicePrefix'],{'as':_0xc59c('0x12f'),'through':'user_has_voice_prefixes','required':![]});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x130')],{'as':'ChatWebsites','through':_0xc59c('0x131')});db[_0xc59c('0x14')][_0xc59c('0x120')](db['FaxAccount'],{'as':_0xc59c('0x132'),'through':_0xc59c('0x133')});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0x134')],{'as':_0xc59c('0x135'),'through':_0xc59c('0x136')});db['User'][_0xc59c('0x120')](db['OpenchannelAccount'],{'as':_0xc59c('0x137'),'through':'user_has_openchannel_accounts'});db['User'][_0xc59c('0x120')](db[_0xc59c('0x5a')],{'as':_0xc59c('0x138'),'through':_0xc59c('0x139')});db[_0xc59c('0x14')]['belongsToMany'](db[_0xc59c('0xfe')],{'as':_0xc59c('0x13a'),'through':_0xc59c('0x13b')});db['User'][_0xc59c('0x120')](db[_0xc59c('0xe2')],{'as':'SquareProjects','through':_0xc59c('0x13c')});db[_0xc59c('0x17')]['hasMany'](db['VoiceExtension'],{'as':_0xc59c('0x13d'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x13e')});db['VoiceContext'][_0xc59c('0x110')](db['VoiceExtension'],{'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x19')][_0xc59c('0x110')](db[_0xc59c('0x19')],{'as':_0xc59c('0x13f'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x140')][_0xc59c('0x120')](db['Sound'],{'as':_0xc59c('0x141'),'through':_0xc59c('0x142')});db['VoiceQueue']['hasMany'](db[_0xc59c('0x2d')],{'as':_0xc59c('0x143'),'foreignKey':'VoiceQueueId'});db[_0xc59c('0x1a')][_0xc59c('0x110')](db[_0xc59c('0x78')],{'as':_0xc59c('0x144'),'foreignKey':_0xc59c('0x145')});db[_0xc59c('0x1a')]['hasMany'](db['CmHopperFinal'],{'as':_0xc59c('0x146'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xc59c('0x110')](db[_0xc59c('0x7d')],{'as':_0xc59c('0x147'),'foreignKey':_0xc59c('0x145')});db['VoiceQueue']['hasMany'](db[_0xc59c('0x7f')],{'as':_0xc59c('0x7f'),'foreignKey':_0xc59c('0x145')});db[_0xc59c('0x1a')][_0xc59c('0x110')](db[_0xc59c('0x7a')],{'as':_0xc59c('0x148'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xc59c('0x110')](db[_0xc59c('0x149')],{'as':_0xc59c('0x14a'),'foreignKey':'VoiceQueueId'});db[_0xc59c('0x1a')][_0xc59c('0x11e')](db[_0xc59c('0x29')],{'as':_0xc59c('0x29'),'foreignKey':'TrunkId'});db[_0xc59c('0x1a')]['belongsTo'](db[_0xc59c('0x29')],{'as':_0xc59c('0x14b'),'foreignKey':_0xc59c('0x14c')});db[_0xc59c('0x1a')][_0xc59c('0x11e')](db['Interval'],{'as':_0xc59c('0x89'),'foreignKey':_0xc59c('0x14d')});db[_0xc59c('0x1a')][_0xc59c('0x11e')](db[_0xc59c('0x14e')],{'as':_0xc59c('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xc59c('0x120')](db[_0xc59c('0xf5')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xc59c('0x1a')][_0xc59c('0x120')](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x2f')});db[_0xc59c('0x1a')]['belongsToMany'](db['Team'],{'as':'Teams','through':_0xc59c('0x10c')});db[_0xc59c('0x1a')][_0xc59c('0x120')](db['CmList'],{'as':'BlackLists','through':_0xc59c('0x151')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0xc59c('0x14'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x1e')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':'User','foreignKey':'UserId'});db['VoiceMail']['hasMany'](db[_0xc59c('0x21')],{'as':_0xc59c('0x152'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x153'),'sourceKey':_0xc59c('0x154')});db[_0xc59c('0x21')][_0xc59c('0x11e')](db[_0xc59c('0x20')],{'foreignKey':_0xc59c('0x153'),'targetKey':_0xc59c('0x154')});db['VoiceCallReport']['hasMany'](db[_0xc59c('0x27')],{'as':_0xc59c('0x155'),'foreignKey':_0xc59c('0x156'),'constraints':![]});db[_0xc59c('0x22')][_0xc59c('0x110')](db[_0xc59c('0x25')],{'as':_0xc59c('0x157'),'foreignKey':_0xc59c('0x156'),'constraints':![]});db['VoiceCallReport'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x14'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x22')][_0xc59c('0x11e')](db['CmContact'],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x3b')][_0xc59c('0x11e')](db[_0xc59c('0x134')],{'as':'MailAccount','foreignKey':_0xc59c('0x15a')});db['MailServerOut']['belongsTo'](db['MailAccount'],{'as':_0xc59c('0x134'),'foreignKey':_0xc59c('0x15a')});db[_0xc59c('0x134')][_0xc59c('0x15b')](db[_0xc59c('0x3b')],{'as':'Imap','onDelete':_0xc59c('0x10e')});db['MailAccount'][_0xc59c('0x15b')](db['MailServerOut'],{'as':_0xc59c('0x15c'),'onDelete':_0xc59c('0x10e')});db['MailAccount'][_0xc59c('0x110')](db[_0xc59c('0x15d')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':_0xc59c('0x10e')});db[_0xc59c('0x134')]['hasMany'](db[_0xc59c('0x84')],{'as':_0xc59c('0x15e'),'foreignKey':_0xc59c('0x15a')});db[_0xc59c('0x134')][_0xc59c('0x110')](db[_0xc59c('0x46')],{'as':_0xc59c('0x152'),'foreignKey':_0xc59c('0x15a')});db[_0xc59c('0x134')][_0xc59c('0x110')](db[_0xc59c('0x44')],{'as':'Interactions'});db[_0xc59c('0x134')][_0xc59c('0x110')](db[_0xc59c('0x48')],{'as':_0xc59c('0x13f')});db[_0xc59c('0x134')][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':'List','foreignKey':_0xc59c('0x15f')});db[_0xc59c('0x134')][_0xc59c('0x11e')](db['Template'],{'as':_0xc59c('0x160'),'foreignKey':_0xc59c('0x161')});db[_0xc59c('0x134')][_0xc59c('0x11e')](db[_0xc59c('0x14e')],{'as':_0xc59c('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc59c('0x134')][_0xc59c('0x120')](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x136')});db[_0xc59c('0x40')][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x150'),'through':_0xc59c('0x33')});db[_0xc59c('0x40')][_0xc59c('0x120')](db[_0xc59c('0x126')],{'through':'team_has_mail_queues','as':'Teams'});db[_0xc59c('0x44')][_0xc59c('0x110')](db[_0xc59c('0x46')],{'as':_0xc59c('0x152'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x162')});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x15a')});db['MailInteraction'][_0xc59c('0x11e')](db['CmContact'],{'as':_0xc59c('0x158'),'foreignKey':'ContactId'});db['MailInteraction']['belongsTo'](db[_0xc59c('0x14')],{'as':_0xc59c('0x164'),'foreignKey':'UserId'});db[_0xc59c('0x44')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':_0xc59c('0x165'),'as':_0xc59c('0x166')});db[_0xc59c('0x44')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':_0xc59c('0x165'),'as':_0xc59c('0x167')});db[_0xc59c('0x44')][_0xc59c('0x120')](db['User'],{'as':'Users','through':_0xc59c('0x168'),'foreignKey':_0xc59c('0x162')});db[_0xc59c('0x46')]['hasMany'](db[_0xc59c('0xea')],{'as':_0xc59c('0x169'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x46')][_0xc59c('0x11e')](db['User'],{'as':'User'});db['MailMessage'][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x158')});db[_0xc59c('0x46')]['belongsTo'](db[_0xc59c('0x44')],{'as':'Interaction','foreignKey':_0xc59c('0x162')});db[_0xc59c('0x46')]['belongsTo'](db[_0xc59c('0x134')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x15a')});db[_0xc59c('0x46')][_0xc59c('0x11e')](db[_0xc59c('0x130')],{'as':_0xc59c('0x130'),'foreignKey':'ChatWebsiteId'});db[_0xc59c('0x46')][_0xc59c('0x11e')](db['ChatOfflineMessage'],{'as':_0xc59c('0x6e'),'foreignKey':_0xc59c('0x16a')});db['MailApplication'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x48')][_0xc59c('0x11e')](db['MailQueue'],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x48')]['belongsTo'](db[_0xc59c('0x134')],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x48')]['belongsTo'](db[_0xc59c('0x89')],{'onDelete':_0xc59c('0x16b'),'foreignKey':_0xc59c('0x14d')});db[_0xc59c('0x48')]['belongsTo'](db[_0xc59c('0x93')],{'onDelete':_0xc59c('0x16b'),'foreignKey':_0xc59c('0x16c')});db[_0xc59c('0x4a')][_0xc59c('0x11e')](db[_0xc59c('0x134')],{});db[_0xc59c('0x4a')][_0xc59c('0x11e')](db['CmList'],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0x4a')][_0xc59c('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':_0xc59c('0x159')});db['MailQueueReport']['belongsTo'](db[_0xc59c('0x44')],{});db[_0xc59c('0x4a')]['belongsTo'](db[_0xc59c('0x46')],{});db[_0xc59c('0x4a')]['belongsTo'](db[_0xc59c('0x14')],{});db[_0xc59c('0x4a')][_0xc59c('0x11e')](db[_0xc59c('0x40')],{});db[_0xc59c('0x4c')][_0xc59c('0x110')](db[_0xc59c('0x16e')],{'as':_0xc59c('0x16f'),'onDelete':'cascade'});db[_0xc59c('0x170')]['hasMany'](db[_0xc59c('0x15d')],{'as':_0xc59c('0x171'),'foreignKey':_0xc59c('0x172'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x170')][_0xc59c('0x110')](db['CannedAnswer'],{'as':_0xc59c('0x15e'),'foreignKey':_0xc59c('0x172')});db[_0xc59c('0x170')][_0xc59c('0x110')](db[_0xc59c('0x52')],{'as':'Interactions'});db[_0xc59c('0x170')][_0xc59c('0x110')](db['FaxApplication'],{'as':_0xc59c('0x13f')});db['FaxAccount'][_0xc59c('0x110')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db[_0xc59c('0x170')][_0xc59c('0x110')](db['FaxMessage'],{'as':_0xc59c('0x152')});db['FaxAccount'][_0xc59c('0x11e')](db[_0xc59c('0x29')],{'as':_0xc59c('0x29')});db['FaxAccount'][_0xc59c('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xc59c('0x15f')});db['FaxAccount'][_0xc59c('0x11e')](db['Pause'],{'as':_0xc59c('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x150'),'through':_0xc59c('0x133')});db[_0xc59c('0x50')][_0xc59c('0x11e')](db['User'],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x50')][_0xc59c('0x11e')](db[_0xc59c('0x56')],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x50')][_0xc59c('0x11e')](db[_0xc59c('0x170')],{'onDelete':'restrict'});db[_0xc59c('0x50')][_0xc59c('0x11e')](db[_0xc59c('0x93')],{'onDelete':'restrict','foreignKey':_0xc59c('0x16c')});db[_0xc59c('0x52')]['hasMany'](db[_0xc59c('0x54')],{'as':_0xc59c('0x152'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x173')});db[_0xc59c('0x52')][_0xc59c('0x11e')](db[_0xc59c('0x170')],{'as':'Account','foreignKey':_0xc59c('0x172')});db[_0xc59c('0x52')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x52')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x164'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x52')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':_0xc59c('0x174'),'as':'Tags'});db[_0xc59c('0x52')]['belongsToMany'](db[_0xc59c('0x93')],{'through':_0xc59c('0x174'),'as':_0xc59c('0x167')});db['FaxInteraction'][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':'Users','through':_0xc59c('0x175'),'foreignKey':'FaxInteractionId'});db[_0xc59c('0x54')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x14')});db['FaxMessage']['belongsTo'](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xc59c('0x173')});db[_0xc59c('0x54')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'onDelete':'cascade','as':_0xc59c('0x158')});db['FaxMessage'][_0xc59c('0x11e')](db['Attachment'],{'as':'Attachment','foreignKey':_0xc59c('0x176')});db[_0xc59c('0x54')][_0xc59c('0x11e')](db[_0xc59c('0x170')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x172')});db[_0xc59c('0x56')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xc59c('0x35')});db[_0xc59c('0x56')]['belongsToMany'](db['Team'],{'through':'team_has_fax_queues','as':_0xc59c('0x177')});db[_0xc59c('0x58')][_0xc59c('0x11e')](db['FaxAccount'],{});db[_0xc59c('0x58')][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':'List','foreignKey':'ListId'});db[_0xc59c('0x58')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xc59c('0x159')});db[_0xc59c('0x58')][_0xc59c('0x11e')](db['FaxInteraction'],{});db[_0xc59c('0x58')]['belongsTo'](db['FaxMessage'],{});db[_0xc59c('0x58')]['belongsTo'](db[_0xc59c('0x14')],{});db[_0xc59c('0x58')][_0xc59c('0x11e')](db[_0xc59c('0x56')],{});db['SmsAccount'][_0xc59c('0x110')](db[_0xc59c('0x15d')],{'as':_0xc59c('0x171'),'foreignKey':_0xc59c('0x178'),'onDelete':_0xc59c('0x10e')});db['SmsAccount'][_0xc59c('0x110')](db['CannedAnswer'],{'as':_0xc59c('0x15e'),'foreignKey':_0xc59c('0x178')});db[_0xc59c('0x5a')][_0xc59c('0x110')](db['SmsMessage'],{'as':_0xc59c('0x152'),'foreignKey':_0xc59c('0x178')});db[_0xc59c('0x5a')]['hasMany'](db[_0xc59c('0x5e')],{'as':_0xc59c('0x179')});db[_0xc59c('0x5a')][_0xc59c('0x110')](db[_0xc59c('0x5c')],{'as':'Applications'});db['SmsAccount'][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0x5a')][_0xc59c('0x11e')](db[_0xc59c('0x14e')],{'as':_0xc59c('0x14f'),'foreignKey':_0xc59c('0x17a')});db[_0xc59c('0x5a')][_0xc59c('0x120')](db['User'],{'as':'Agents','through':_0xc59c('0x139')});db['SmsApplication'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x5c')][_0xc59c('0x11e')](db['SmsQueue'],{'onDelete':'restrict'});db[_0xc59c('0x5c')][_0xc59c('0x11e')](db['SmsAccount'],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x5c')][_0xc59c('0x11e')](db[_0xc59c('0x89')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xc59c('0x5c')]['belongsTo'](db[_0xc59c('0x93')],{'onDelete':_0xc59c('0x16b'),'foreignKey':_0xc59c('0x16c')});db['SmsInteraction'][_0xc59c('0x110')](db['SmsMessage'],{'as':_0xc59c('0x152'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x17b')});db[_0xc59c('0x5e')]['belongsTo'](db[_0xc59c('0x5a')],{'as':'Account','foreignKey':_0xc59c('0x178')});db[_0xc59c('0x5e')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db['SmsInteraction'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x164'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x5e')]['belongsToMany'](db['Tag'],{'through':_0xc59c('0x17c'),'as':_0xc59c('0x166')});db['SmsInteraction'][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db[_0xc59c('0x14')],{'as':'Users','through':_0xc59c('0x129'),'foreignKey':_0xc59c('0x17b')});db[_0xc59c('0x17d')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x14')});db['SmsMessage']['belongsTo'](db[_0xc59c('0x122')],{'onDelete':'cascade','as':_0xc59c('0x158')});db[_0xc59c('0x17d')]['belongsTo'](db[_0xc59c('0x5e')],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x17e'),'foreignKey':_0xc59c('0x17b')});db[_0xc59c('0x17d')]['belongsTo'](db[_0xc59c('0x5a')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x178')});db[_0xc59c('0x12d')]['belongsToMany'](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x12e'),'foreignKey':'SmsQueueId'});db[_0xc59c('0x12d')]['belongsToMany'](db[_0xc59c('0x126')],{'through':_0xc59c('0x17f'),'as':_0xc59c('0x177')});db[_0xc59c('0x180')][_0xc59c('0x110')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xc59c('0x181'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x180')]['hasMany'](db['CannedAnswer'],{'as':_0xc59c('0x15e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xc59c('0x110')](db['OpenchannelInteraction'],{'as':_0xc59c('0x179'),'foreignKey':_0xc59c('0x181')});db[_0xc59c('0x180')][_0xc59c('0x110')](db[_0xc59c('0x63')],{'as':_0xc59c('0x152'),'foreignKey':_0xc59c('0x181')});db['OpenchannelAccount'][_0xc59c('0x110')](db[_0xc59c('0x61')],{'as':_0xc59c('0x13f'),'foreignKey':_0xc59c('0x181')});db['OpenchannelAccount'][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0x180')][_0xc59c('0x11e')](db[_0xc59c('0x14e')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xc59c('0x180')][_0xc59c('0x120')](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x182')});db[_0xc59c('0x61')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x61')][_0xc59c('0x11e')](db[_0xc59c('0x65')],{'onDelete':'restrict','foreignKey':_0xc59c('0x183')});db['OpenchannelApplication'][_0xc59c('0x11e')](db[_0xc59c('0x180')],{'onDelete':'restrict','foreignKey':_0xc59c('0x181')});db[_0xc59c('0x61')][_0xc59c('0x11e')](db[_0xc59c('0x89')],{'onDelete':_0xc59c('0x16b'),'foreignKey':'IntervalId'});db[_0xc59c('0x61')][_0xc59c('0x11e')](db[_0xc59c('0x93')],{'onDelete':_0xc59c('0x16b'),'foreignKey':_0xc59c('0x16c')});db['OpenchannelInteraction'][_0xc59c('0x110')](db['OpenchannelMessage'],{'as':_0xc59c('0x152'),'onDelete':'cascade','foreignKey':_0xc59c('0x184')});db[_0xc59c('0x115')][_0xc59c('0x11e')](db[_0xc59c('0x180')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x181')});db[_0xc59c('0x115')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db['OpenchannelInteraction'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x164'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x115')][_0xc59c('0x120')](db['Tag'],{'through':_0xc59c('0x185'),'as':_0xc59c('0x166')});db[_0xc59c('0x115')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':'openchannel_interaction_has_tags','as':_0xc59c('0x167')});db[_0xc59c('0x115')][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x186'),'through':_0xc59c('0x12a'),'foreignKey':_0xc59c('0x184')});db[_0xc59c('0x63')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x10e'),'as':'User'});db[_0xc59c('0x63')]['belongsTo'](db[_0xc59c('0x122')],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x158')});db['OpenchannelMessage'][_0xc59c('0x11e')](db[_0xc59c('0x115')],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x17e'),'foreignKey':_0xc59c('0x184')});db[_0xc59c('0x63')]['belongsTo'](db[_0xc59c('0xea')],{'as':_0xc59c('0xea'),'foreignKey':_0xc59c('0x176')});db[_0xc59c('0x63')][_0xc59c('0x11e')](db[_0xc59c('0x180')],{'as':_0xc59c('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xc59c('0x65')][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x150'),'through':_0xc59c('0x38'),'foreignKey':'OpenchannelQueueId'});db[_0xc59c('0x65')][_0xc59c('0x120')](db[_0xc59c('0x126')],{'through':_0xc59c('0x187'),'as':_0xc59c('0x177')});db[_0xc59c('0x130')][_0xc59c('0x110')](db[_0xc59c('0x15d')],{'as':_0xc59c('0x171'),'foreignKey':'ChatWebsiteId','onDelete':_0xc59c('0x10e')});db['ChatWebsite'][_0xc59c('0x110')](db[_0xc59c('0x84')],{'as':_0xc59c('0x15e'),'foreignKey':_0xc59c('0x188')});db[_0xc59c('0x130')][_0xc59c('0x110')](db[_0xc59c('0x73')],{'as':_0xc59c('0x189')});db[_0xc59c('0x130')][_0xc59c('0x110')](db[_0xc59c('0x6a')],{'as':_0xc59c('0x179')});db[_0xc59c('0x130')][_0xc59c('0x110')](db[_0xc59c('0x68')],{'as':'Applications'});db['ChatWebsite'][_0xc59c('0x110')](db[_0xc59c('0x6c')],{'as':_0xc59c('0x152')});db[_0xc59c('0x130')][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db['ChatWebsite'][_0xc59c('0x11e')](db[_0xc59c('0x89')],{'as':_0xc59c('0x89'),'foreignKey':_0xc59c('0x14d')});db['ChatWebsite'][_0xc59c('0x11e')](db[_0xc59c('0x134')],{'as':_0xc59c('0x134'),'foreignKey':_0xc59c('0x15a')});db[_0xc59c('0x130')][_0xc59c('0x11e')](db[_0xc59c('0x14e')],{'as':_0xc59c('0x14f'),'foreignKey':_0xc59c('0x17a')});db[_0xc59c('0x130')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db[_0xc59c('0x180')],{});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':'ContactId'});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db[_0xc59c('0x115')],{});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db[_0xc59c('0x63')],{});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{});db[_0xc59c('0x18a')][_0xc59c('0x11e')](db['OpenchannelQueue'],{});db[_0xc59c('0x68')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x18b'),'foreignKey':'UserId','onDelete':_0xc59c('0x16b')});db['ChatApplication'][_0xc59c('0x11e')](db['ChatQueue'],{'as':_0xc59c('0x18c'),'foreignKey':'ChatQueueId','onDelete':_0xc59c('0x16b')});db[_0xc59c('0x68')][_0xc59c('0x11e')](db[_0xc59c('0x130')],{'as':_0xc59c('0x18d'),'foreignKey':_0xc59c('0x188'),'onDelete':_0xc59c('0x16b')});db['ChatApplication'][_0xc59c('0x11e')](db[_0xc59c('0x93')],{'onDelete':'restrict','foreignKey':'TagId'});db['ChatInteraction'][_0xc59c('0x110')](db[_0xc59c('0x6c')],{'as':_0xc59c('0x152'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x18e')});db[_0xc59c('0x6a')]['belongsTo'](db[_0xc59c('0x130')],{'as':_0xc59c('0x163'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0xc59c('0x122')],{'as':'Contact','foreignKey':_0xc59c('0x159')});db['ChatInteraction'][_0xc59c('0x11e')](db['User'],{'as':_0xc59c('0x164'),'foreignKey':'UserId'});db[_0xc59c('0x6a')][_0xc59c('0x120')](db['Tag'],{'through':_0xc59c('0x18f'),'as':_0xc59c('0x166')});db[_0xc59c('0x6a')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':'chat_interaction_has_tags','as':_0xc59c('0x167')});db['ChatInteraction'][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x186'),'through':_0xc59c('0x128'),'foreignKey':_0xc59c('0x18e')});db['ChatMessage'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x14')});db[_0xc59c('0x6c')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'onDelete':'cascade','as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x6c')][_0xc59c('0x11e')](db['ChatInteraction'],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x17e'),'foreignKey':_0xc59c('0x18e')});db[_0xc59c('0x6c')][_0xc59c('0x11e')](db[_0xc59c('0xea')],{'as':_0xc59c('0xea'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xc59c('0x11e')](db[_0xc59c('0x130')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x188')});db[_0xc59c('0x6e')]['hasMany'](db[_0xc59c('0xea')],{'as':_0xc59c('0x169'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0xc59c('0x6e')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'onDelete':'cascade','as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x6e')][_0xc59c('0x11e')](db['ChatWebsite'],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x188')});db[_0xc59c('0x190')]['belongsToMany'](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x31'),'hooks':!![]});db[_0xc59c('0x190')][_0xc59c('0x120')](db[_0xc59c('0x126')],{'through':_0xc59c('0x191'),'as':'Teams'});db[_0xc59c('0x71')]['hasMany'](db[_0xc59c('0xd2')],{'as':'Messages','foreignKey':_0xc59c('0x192'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x71')][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x143'),'through':_0xc59c('0x121')});db[_0xc59c('0x73')][_0xc59c('0x11e')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xc59c('0x188')});db[_0xc59c('0x75')][_0xc59c('0x110')](db['CmContact'],{'as':_0xc59c('0x193'),'foreignKey':'CompanyId'});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x78')],{'as':_0xc59c('0x144'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x7b')],{'as':_0xc59c('0x146'),'foreignKey':_0xc59c('0x159')});db['CmContact'][_0xc59c('0x110')](db[_0xc59c('0x7d')],{'as':'HopperHistories','foreignKey':_0xc59c('0x159')});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x7f')],{'as':_0xc59c('0x7f'),'foreignKey':'ContactId'});db[_0xc59c('0x122')]['hasMany'](db[_0xc59c('0x149')],{'as':_0xc59c('0x14a'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x115')],{'as':_0xc59c('0x116'),'foreignKey':_0xc59c('0x159'),'onDelete':'restrict'});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x6a')],{'as':_0xc59c('0x117'),'foreignKey':_0xc59c('0x159'),'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x5e')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0xc59c('0x16b')});db[_0xc59c('0x122')][_0xc59c('0x110')](db[_0xc59c('0x52')],{'as':_0xc59c('0x119'),'foreignKey':_0xc59c('0x159'),'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x122')]['hasMany'](db[_0xc59c('0x44')],{'as':_0xc59c('0x11a'),'foreignKey':_0xc59c('0x159'),'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x122')]['belongsTo'](db[_0xc59c('0x75')],{'as':_0xc59c('0x194'),'foreignKey':_0xc59c('0x195')});db[_0xc59c('0x122')][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':'List','foreignKey':_0xc59c('0x15f'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x122')][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x186'),'through':_0xc59c('0x123')});db[_0xc59c('0x122')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'as':'Tags','through':_0xc59c('0x196')});db[_0xc59c('0x122')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':_0xc59c('0x196'),'as':_0xc59c('0x167')});db[_0xc59c('0x78')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x78')]['belongsTo'](db[_0xc59c('0xf5')],{'as':'List','foreignKey':_0xc59c('0x15f'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x78')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x18b'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x78')][_0xc59c('0x11e')](db[_0xc59c('0x1a')],{'as':_0xc59c('0x18c'),'foreignKey':_0xc59c('0x145'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x78')][_0xc59c('0x11e')](db[_0xc59c('0x197')],{'as':_0xc59c('0x197'),'foreignKey':_0xc59c('0x198'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x78')]['belongsTo'](db[_0xc59c('0x14')],{'as':_0xc59c('0x164'),'foreignKey':_0xc59c('0x199')});db[_0xc59c('0x7a')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159'),'onDelete':'cascade'});db['CmHopperBlack'][_0xc59c('0x11e')](db[_0xc59c('0xf5')],{'as':'List','foreignKey':_0xc59c('0x15f'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x7a')]['belongsTo'](db[_0xc59c('0x1a')],{'as':_0xc59c('0x18c'),'foreignKey':_0xc59c('0x145'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x7a')][_0xc59c('0x11e')](db['Campaign'],{'as':_0xc59c('0x197'),'foreignKey':_0xc59c('0x198'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0x82')][_0xc59c('0x110')](db[_0xc59c('0x87')],{'as':{'plural':_0xc59c('0x19a'),'singular':_0xc59c('0x19b')},'foreignKey':_0xc59c('0x19c'),'onDelete':'cascade','hooks':!![]});db[_0xc59c('0x82')][_0xc59c('0x110')](db[_0xc59c('0x87')],{'as':{'plural':_0xc59c('0x19d'),'singular':_0xc59c('0x19e')},'foreignKey':_0xc59c('0x19f'),'onDelete':_0xc59c('0x10e'),'hooks':!![]});db[_0xc59c('0x82')][_0xc59c('0x110')](db['Action'],{'as':_0xc59c('0x1a0'),'foreignKey':_0xc59c('0x1a1'),'onDelete':_0xc59c('0x10e'),'hooks':!![]});db['Disposition'][_0xc59c('0x110')](db['Disposition'],{'as':_0xc59c('0x171'),'foreignKey':_0xc59c('0x1a2'),'onDelete':'cascade'});db['Interval'][_0xc59c('0x110')](db['Interval'],{'as':_0xc59c('0x1a3'),'foreignKey':_0xc59c('0x14d'),'onDelete':_0xc59c('0x10e'),'hooks':!![],'required':![]});db[_0xc59c('0x89')][_0xc59c('0x110')](db[_0xc59c('0x19')],{'as':'Extensions','foreignKey':_0xc59c('0x14d'),'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x89')][_0xc59c('0x110')](db[_0xc59c('0x48')],{'as':_0xc59c('0x1a4'),'foreignKey':_0xc59c('0x14d')});db[_0xc59c('0x89')]['hasMany'](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0xc59c('0x14d')});db[_0xc59c('0x89')][_0xc59c('0x110')](db[_0xc59c('0x50')],{'as':_0xc59c('0x1a5'),'foreignKey':'IntervalId'});db['Interval'][_0xc59c('0x110')](db[_0xc59c('0x5c')],{'as':_0xc59c('0x1a6'),'foreignKey':_0xc59c('0x14d')});db[_0xc59c('0x90')][_0xc59c('0x11e')](db[_0xc59c('0x134')],{});db[_0xc59c('0x90')][_0xc59c('0x11e')](db[_0xc59c('0x9b')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xc59c('0x11e')](db[_0xc59c('0x99')],{'foreignKey':'CustomReportId'});db['Sound']['belongsToMany'](db[_0xc59c('0x140')],{'as':_0xc59c('0x1a7'),'through':'moh_has_sounds','onDelete':_0xc59c('0x16b')});db[_0xc59c('0x93')]['belongsToMany'](db[_0xc59c('0x122')],{'through':'cm_contact_has_tags'});db[_0xc59c('0x93')][_0xc59c('0x120')](db[_0xc59c('0x6a')],{'through':'chat_interaction_has_tags'});db[_0xc59c('0x93')]['belongsToMany'](db[_0xc59c('0x44')],{'through':_0xc59c('0x165')});db[_0xc59c('0x93')][_0xc59c('0x120')](db[_0xc59c('0x5e')],{'through':_0xc59c('0x17c')});db[_0xc59c('0x93')][_0xc59c('0x120')](db[_0xc59c('0x52')],{'through':_0xc59c('0x174')});db[_0xc59c('0x93')][_0xc59c('0x120')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xc59c('0x102')],{'through':_0xc59c('0x1a8')});db['Trigger'][_0xc59c('0x110')](db[_0xc59c('0x87')],{'as':{'plural':'AllConditions','singular':_0xc59c('0x1a9')},'foreignKey':_0xc59c('0x1aa'),'onDelete':_0xc59c('0x10e'),'hooks':!![]});db[_0xc59c('0x95')][_0xc59c('0x110')](db[_0xc59c('0x87')],{'as':{'plural':_0xc59c('0x1ab'),'singular':_0xc59c('0x1ac')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0xc59c('0x1a0'),'foreignKey':_0xc59c('0x1ad'),'onDelete':_0xc59c('0x10e'),'hooks':!![]});db[_0xc59c('0x99')][_0xc59c('0x110')](db[_0xc59c('0xa0')],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1af'),'hooks':!![]});db[_0xc59c('0x9b')][_0xc59c('0x110')](db[_0xc59c('0xa0')],{'as':'Fields','onDelete':_0xc59c('0x10e'),'foreignKey':'DefaultReportId'});db[_0xc59c('0x9e')][_0xc59c('0x110')](db['AnalyticFieldReport'],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':'MetricId'});db[_0xc59c('0xa0')]['belongsTo'](db[_0xc59c('0x9e')],{'foreignKey':'MetricId'});db[_0xc59c('0x1b0')]['hasMany'](db[_0xc59c('0xa3')],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xa3')]['hasMany'](db[_0xc59c('0x1b3')],{'as':_0xc59c('0x1b4'),'onDelete':_0xc59c('0x10e'),'foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0xc59c('0x110')](db[_0xc59c('0x1b3')],{'as':_0xc59c('0x1b5'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xa3')][_0xc59c('0x110')](db[_0xc59c('0x1b3')],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xa3')][_0xc59c('0x11e')](db[_0xc59c('0x1b0')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x1b2')});db['SalesforceField']['hasMany'](db[_0xc59c('0x1b3')],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0x1b3')][_0xc59c('0x110')](db['SalesforceField'],{'as':_0xc59c('0x1ba'),'foreignKey':_0xc59c('0x1b6')});db['SalesforceField']['hasMany'](db[_0xc59c('0x1b3')],{'as':_0xc59c('0x1bb'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0x1b3')][_0xc59c('0x11e')](db['Variable'],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0xa5')][_0xc59c('0x110')](db['SugarcrmConfiguration'],{'as':_0xc59c('0x1b1'),'onDelete':'cascade','foreignKey':_0xc59c('0x1b2')});db['SugarcrmConfiguration'][_0xc59c('0x110')](db[_0xc59c('0xa8')],{'as':_0xc59c('0x1b4'),'onDelete':_0xc59c('0x10e'),'foreignKey':'SubjectId'});db[_0xc59c('0x1be')][_0xc59c('0x110')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0x1be')][_0xc59c('0x110')](db['SugarcrmField'],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0x1be')]['belongsTo'](db['SugarcrmAccount'],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xa8')][_0xc59c('0x110')](db[_0xc59c('0xa8')],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0xa8')][_0xc59c('0x110')](db[_0xc59c('0xa8')],{'as':_0xc59c('0x1ba'),'foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xa8')]['hasMany'](db[_0xc59c('0xa8')],{'as':'Field','foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xa8')][_0xc59c('0x11e')](db['Variable'],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0xaa')][_0xc59c('0x110')](db[_0xc59c('0xac')],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':'AccountId'});db[_0xc59c('0xac')][_0xc59c('0x110')](db['DeskField'],{'as':'Subjects','onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b9')});db['DeskConfiguration'][_0xc59c('0x110')](db[_0xc59c('0xae')],{'as':_0xc59c('0x1b5'),'onDelete':'cascade','foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xac')]['hasMany'](db[_0xc59c('0xae')],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xac')][_0xc59c('0x11e')](db['DeskAccount'],{'as':_0xc59c('0x163'),'foreignKey':'AccountId'});db[_0xc59c('0xac')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':_0xc59c('0x1bf')});db['DeskField'][_0xc59c('0x110')](db['DeskField'],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db['DeskField'][_0xc59c('0x110')](db['DeskField'],{'as':_0xc59c('0x1ba'),'foreignKey':'DescriptionId'});db[_0xc59c('0xae')][_0xc59c('0x110')](db['DeskField'],{'as':_0xc59c('0x1bb'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xae')][_0xc59c('0x11e')](db['Variable'],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0xb0')][_0xc59c('0x110')](db['ZohoConfiguration'],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0x1c0')][_0xc59c('0x110')](db[_0xc59c('0xb2')],{'as':_0xc59c('0x1b4'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0xc59c('0xb2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xc59c('0x1b6')});db['ZohoConfiguration'][_0xc59c('0x110')](db[_0xc59c('0xb2')],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':'FieldId'});db[_0xc59c('0x1c0')][_0xc59c('0x11e')](db[_0xc59c('0xb0')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xb2')][_0xc59c('0x110')](db['ZohoField'],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0xb2')]['hasMany'](db[_0xc59c('0xb2')],{'as':_0xc59c('0x1ba'),'foreignKey':'DescriptionId'});db[_0xc59c('0xb2')]['hasMany'](db[_0xc59c('0xb2')],{'as':_0xc59c('0x1bb'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xb2')]['belongsTo'](db[_0xc59c('0x1bc')],{'as':_0xc59c('0x1bc'),'foreignKey':'VariableId'});db['ZendeskAccount'][_0xc59c('0x110')](db[_0xc59c('0xb5')],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':'AccountId'});db[_0xc59c('0xb5')][_0xc59c('0x110')](db[_0xc59c('0x1c1')],{'as':_0xc59c('0x1b4'),'foreignKey':_0xc59c('0x1b9')});db['ZendeskConfiguration'][_0xc59c('0x110')](db[_0xc59c('0x1c1')],{'as':_0xc59c('0x1b5'),'foreignKey':'DescriptionId'});db[_0xc59c('0xb5')][_0xc59c('0x110')](db['ZendeskField'],{'as':_0xc59c('0x1ae'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xb5')][_0xc59c('0x11e')](db[_0xc59c('0x1c2')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x1b2')});db['ZendeskConfiguration'][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':_0xc59c('0x1c3')});db[_0xc59c('0x1c1')][_0xc59c('0x110')](db[_0xc59c('0x1c1')],{'as':_0xc59c('0x1b8'),'foreignKey':'SubjectId'});db[_0xc59c('0x1c1')][_0xc59c('0x110')](db[_0xc59c('0x1c1')],{'as':_0xc59c('0x1ba'),'foreignKey':_0xc59c('0x1b6')});db['ZendeskField'][_0xc59c('0x110')](db[_0xc59c('0x1c1')],{'as':_0xc59c('0x1bb'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0x1c1')][_0xc59c('0x11e')](db['Variable'],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0x1c4')][_0xc59c('0x110')](db[_0xc59c('0xb8')],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xb8')][_0xc59c('0x110')](db[_0xc59c('0x1c5')],{'as':_0xc59c('0x1b4'),'onDelete':_0xc59c('0x10e'),'foreignKey':'SubjectId'});db[_0xc59c('0xb8')][_0xc59c('0x110')](db['FreshdeskField'],{'as':_0xc59c('0x1b5'),'onDelete':'cascade','foreignKey':_0xc59c('0x1b6')});db['FreshdeskConfiguration']['hasMany'](db[_0xc59c('0x1c5')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xb8')][_0xc59c('0x11e')](db[_0xc59c('0x1c4')],{'as':'Account','foreignKey':'AccountId'});db[_0xc59c('0xb8')][_0xc59c('0x120')](db[_0xc59c('0x93')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xc59c('0x1c5')][_0xc59c('0x110')](db['FreshdeskField'],{'as':'Subject','foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0x1c5')][_0xc59c('0x110')](db[_0xc59c('0x1c5')],{'as':_0xc59c('0x1ba'),'foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0x1c5')][_0xc59c('0x110')](db['FreshdeskField'],{'as':_0xc59c('0x1bb'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0x1c5')][_0xc59c('0x11e')](db[_0xc59c('0x1bc')],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0x1c6')][_0xc59c('0x110')](db[_0xc59c('0xb9')],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xb9')]['hasMany'](db['VtigerField'],{'as':_0xc59c('0x1b4'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0xb9')][_0xc59c('0x110')](db[_0xc59c('0xbb')],{'as':'Descriptions','foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xb9')][_0xc59c('0x110')](db[_0xc59c('0xbb')],{'as':_0xc59c('0x1ae'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xb9')][_0xc59c('0x11e')](db[_0xc59c('0x1c6')],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x1b2')});db['VtigerField'][_0xc59c('0x110')](db['VtigerField'],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0xbb')][_0xc59c('0x110')](db[_0xc59c('0xbb')],{'as':_0xc59c('0x1ba'),'foreignKey':'DescriptionId'});db[_0xc59c('0xbb')]['hasMany'](db['VtigerField'],{'as':'Field','foreignKey':'FieldId'});db[_0xc59c('0xbb')][_0xc59c('0x11e')](db[_0xc59c('0x1bc')],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0xbd')]['hasMany'](db[_0xc59c('0xbf')],{'as':_0xc59c('0x1b1'),'onDelete':'cascade','foreignKey':_0xc59c('0x1b2')});db['ServicenowConfiguration']['hasMany'](db[_0xc59c('0xc1')],{'as':_0xc59c('0x1b4'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0xbf')]['hasMany'](db[_0xc59c('0xc1')],{'as':'Descriptions','foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xbf')][_0xc59c('0x110')](db[_0xc59c('0xc1')],{'as':_0xc59c('0x1ae'),'foreignKey':_0xc59c('0x1b7')});db['ServicenowConfiguration'][_0xc59c('0x11e')](db[_0xc59c('0xbd')],{'as':'Account','foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xc1')][_0xc59c('0x110')](db['ServicenowField'],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db['ServicenowField'][_0xc59c('0x110')](db[_0xc59c('0xc1')],{'as':_0xc59c('0x1ba'),'foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xc1')][_0xc59c('0x110')](db[_0xc59c('0xc1')],{'as':_0xc59c('0x1bb'),'foreignKey':_0xc59c('0x1b7')});db['ServicenowField'][_0xc59c('0x11e')](db[_0xc59c('0x1bc')],{'as':'Variable','foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0xc3')][_0xc59c('0x110')](db['Dynamics365Configuration'],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0x1c7')]['hasMany'](db[_0xc59c('0x1c8')],{'as':_0xc59c('0x1b4'),'onDelete':_0xc59c('0x10e'),'foreignKey':'SubjectId'});db[_0xc59c('0x1c7')][_0xc59c('0x110')](db[_0xc59c('0x1c8')],{'as':'Descriptions','onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b6')});db['Dynamics365Configuration'][_0xc59c('0x110')](db[_0xc59c('0x1c8')],{'as':_0xc59c('0x1ae'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0x1c7')][_0xc59c('0x11e')](db[_0xc59c('0xc3')],{'as':_0xc59c('0x163'),'foreignKey':'AccountId'});db[_0xc59c('0x1c8')]['hasMany'](db[_0xc59c('0x1c8')],{'as':'Subject','foreignKey':_0xc59c('0x1b9')});db['Dynamics365Field'][_0xc59c('0x110')](db[_0xc59c('0x1c8')],{'as':_0xc59c('0x1ba'),'foreignKey':'DescriptionId'});db[_0xc59c('0x1c8')][_0xc59c('0x110')](db['Dynamics365Field'],{'as':_0xc59c('0x1bb'),'foreignKey':'FieldId'});db['Dynamics365Field']['belongsTo'](db[_0xc59c('0x1bc')],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db[_0xc59c('0x1c9')]['hasMany'](db[_0xc59c('0xc8')],{'as':_0xc59c('0x1b1'),'onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xc8')][_0xc59c('0x110')](db[_0xc59c('0xca')],{'as':_0xc59c('0x1b4'),'foreignKey':'SubjectId'});db[_0xc59c('0xc8')]['hasMany'](db[_0xc59c('0xca')],{'as':_0xc59c('0x1b5'),'foreignKey':_0xc59c('0x1b6')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0xc59c('0x1ae'),'foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0xc59c('0x11e')](db[_0xc59c('0x1c9')],{'as':'Account','foreignKey':_0xc59c('0x1b2')});db[_0xc59c('0xca')]['hasMany'](db[_0xc59c('0xca')],{'as':_0xc59c('0x1b8'),'foreignKey':_0xc59c('0x1b9')});db[_0xc59c('0xca')]['hasMany'](db[_0xc59c('0xca')],{'as':'Description','foreignKey':_0xc59c('0x1b6')});db[_0xc59c('0xca')][_0xc59c('0x110')](db[_0xc59c('0xca')],{'as':'Field','foreignKey':_0xc59c('0x1b7')});db[_0xc59c('0xca')]['belongsTo'](db[_0xc59c('0x1bc')],{'as':_0xc59c('0x1bc'),'foreignKey':_0xc59c('0x1bd')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0xc59c('0xd0')][_0xc59c('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xc59c('0x15f')});db['ChatQueueReport'][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':'Contact','foreignKey':_0xc59c('0x159')});db['ChatQueueReport'][_0xc59c('0x11e')](db[_0xc59c('0x6a')],{});db['ChatQueueReport'][_0xc59c('0x11e')](db[_0xc59c('0x6c')],{});db[_0xc59c('0xd0')][_0xc59c('0x11e')](db['User'],{});db[_0xc59c('0xd0')][_0xc59c('0x11e')](db[_0xc59c('0x190')],{});db[_0xc59c('0xd2')][_0xc59c('0x11e')](db['User'],{'onDelete':_0xc59c('0x10e'),'foreignKey':'FromId'});db[_0xc59c('0xd2')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'onDelete':_0xc59c('0x10e'),'foreignKey':'ToId'});db[_0xc59c('0x149')]['hasMany'](db[_0xc59c('0xd5')],{'foreignKey':'SessionId','onDelete':_0xc59c('0x10e')});db[_0xc59c('0x149')]['hasMany'](db[_0xc59c('0x1ca')],{'foreignKey':'SessionId','onDelete':_0xc59c('0x10e')});db['SmsQueueReport'][_0xc59c('0x11e')](db[_0xc59c('0x5a')],{});db['SmsQueueReport'][_0xc59c('0x11e')](db['CmList'],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0xd8')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0xd8')][_0xc59c('0x11e')](db[_0xc59c('0x5e')],{});db[_0xc59c('0xd8')]['belongsTo'](db[_0xc59c('0x17d')],{});db[_0xc59c('0xd8')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{});db['SmsQueueReport'][_0xc59c('0x11e')](db[_0xc59c('0x12d')],{});db[_0xc59c('0xdc')]['hasMany'](db[_0xc59c('0x149')],{'foreignKey':_0xc59c('0x1cb')});db[_0xc59c('0xdc')][_0xc59c('0x110')](db[_0xc59c('0xd5')],{'foreignKey':_0xc59c('0x1cb')});db[_0xc59c('0xdc')][_0xc59c('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0xc59c('0x1cb')});db[_0xc59c('0xe2')][_0xc59c('0x120')](db['User'],{'as':_0xc59c('0x186'),'through':_0xc59c('0x13c')});db['Team']['belongsToMany'](db[_0xc59c('0x14')],{'as':'Agents','through':_0xc59c('0x127')});db[_0xc59c('0x126')]['belongsToMany'](db[_0xc59c('0x1a')],{'through':'TeamVoiceQueue','as':_0xc59c('0x1cc')});db[_0xc59c('0x126')][_0xc59c('0x120')](db[_0xc59c('0x40')],{'through':_0xc59c('0x1cd'),'as':'MailQueues'});db['Team'][_0xc59c('0x120')](db[_0xc59c('0x190')],{'through':_0xc59c('0x191'),'as':'ChatQueues'});db[_0xc59c('0x126')][_0xc59c('0x120')](db[_0xc59c('0x56')],{'through':_0xc59c('0x1ce'),'as':_0xc59c('0x12c')});db[_0xc59c('0x126')][_0xc59c('0x120')](db[_0xc59c('0x12d')],{'through':_0xc59c('0x17f'),'as':_0xc59c('0x1cf')});db[_0xc59c('0x126')]['belongsToMany'](db[_0xc59c('0x65')],{'through':_0xc59c('0x187'),'as':_0xc59c('0x1d0')});db[_0xc59c('0x126')][_0xc59c('0x120')](db[_0xc59c('0x1d1')],{'through':_0xc59c('0x1d2'),'as':'WhatsappQueues'});db[_0xc59c('0x197')][_0xc59c('0x110')](db[_0xc59c('0x78')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xc59c('0x197')][_0xc59c('0x110')](db[_0xc59c('0x7b')],{'as':_0xc59c('0x146'),'foreignKey':'CampaignId'});db[_0xc59c('0x197')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xc59c('0x198')});db[_0xc59c('0x197')][_0xc59c('0x110')](db[_0xc59c('0x7a')],{'as':_0xc59c('0x148'),'foreignKey':_0xc59c('0x198')});db[_0xc59c('0x197')][_0xc59c('0x11e')](db[_0xc59c('0x29')],{'as':_0xc59c('0x29'),'foreignKey':_0xc59c('0x1d3')});db[_0xc59c('0x197')][_0xc59c('0x11e')](db[_0xc59c('0x29')],{'as':'TrunkBackup','foreignKey':_0xc59c('0x14c')});db[_0xc59c('0x197')]['belongsTo'](db[_0xc59c('0x89')],{'as':_0xc59c('0x89'),'foreignKey':_0xc59c('0x14d')});db['Campaign'][_0xc59c('0x11e')](db[_0xc59c('0xe2')],{'as':_0xc59c('0xe2'),'foreignKey':_0xc59c('0x1d4')});db[_0xc59c('0x197')][_0xc59c('0x120')](db['CmList'],{'as':_0xc59c('0x124'),'through':_0xc59c('0x1d5')});db[_0xc59c('0x197')][_0xc59c('0x120')](db[_0xc59c('0xf5')],{'as':'BlackLists','through':_0xc59c('0x1d6')});db[_0xc59c('0xea')][_0xc59c('0x11e')](db['ChatOfflineMessage'],{'as':_0xc59c('0x6e'),'foreignKey':_0xc59c('0x16a')});db[_0xc59c('0xed')][_0xc59c('0x11e')](db['MailMessage'],{});db[_0xc59c('0xed')][_0xc59c('0x11e')](db['MailInteraction'],{});db['MailTransferReport']['belongsTo'](db[_0xc59c('0x134')],{'foreignKey':_0xc59c('0x1d7'),'as':_0xc59c('0x1d8')});db['MailTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1d9'),'as':_0xc59c('0x1da')});db[_0xc59c('0xed')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1db'),'as':_0xc59c('0x1dc')});db['MailTransferReport']['belongsTo'](db[_0xc59c('0x40')],{'foreignKey':_0xc59c('0x1dd'),'as':_0xc59c('0x1de')});db[_0xc59c('0xed')][_0xc59c('0x11e')](db[_0xc59c('0x134')],{'foreignKey':_0xc59c('0x1df'),'as':_0xc59c('0x1e0')});db[_0xc59c('0xef')][_0xc59c('0x11e')](db[_0xc59c('0x6c')],{});db[_0xc59c('0xef')][_0xc59c('0x11e')](db[_0xc59c('0x6a')],{});db[_0xc59c('0xef')][_0xc59c('0x11e')](db[_0xc59c('0x130')],{'foreignKey':_0xc59c('0x1e1'),'as':_0xc59c('0x1d8')});db[_0xc59c('0xef')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1d9'),'as':_0xc59c('0x1da')});db[_0xc59c('0xef')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1db'),'as':_0xc59c('0x1dc')});db['ChatTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x190')],{'foreignKey':_0xc59c('0x1e2'),'as':_0xc59c('0x1de')});db[_0xc59c('0xef')]['belongsTo'](db[_0xc59c('0x130')],{'foreignKey':_0xc59c('0x1e3'),'as':_0xc59c('0x1e0')});db['FaxTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x54')],{});db[_0xc59c('0xf1')][_0xc59c('0x11e')](db['FaxInteraction'],{});db[_0xc59c('0xf1')][_0xc59c('0x11e')](db[_0xc59c('0x170')],{'foreignKey':_0xc59c('0x1e4'),'as':'FromAccount'});db[_0xc59c('0xf1')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1d9'),'as':_0xc59c('0x1da')});db[_0xc59c('0xf1')][_0xc59c('0x11e')](db['User'],{'foreignKey':_0xc59c('0x1db'),'as':'ToAgent'});db[_0xc59c('0xf1')][_0xc59c('0x11e')](db[_0xc59c('0x56')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x170')],{'foreignKey':'ToFaxAccountId','as':_0xc59c('0x1e0')});db['OpenchannelTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x63')],{});db[_0xc59c('0x1e5')]['belongsTo'](db[_0xc59c('0x115')],{});db[_0xc59c('0x1e5')]['belongsTo'](db[_0xc59c('0x180')],{'foreignKey':_0xc59c('0x1e6'),'as':_0xc59c('0x1d8')});db[_0xc59c('0x1e5')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1d9'),'as':_0xc59c('0x1da')});db[_0xc59c('0x1e5')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1db'),'as':_0xc59c('0x1dc')});db[_0xc59c('0x1e5')][_0xc59c('0x11e')](db[_0xc59c('0x65')],{'foreignKey':_0xc59c('0x1e7'),'as':_0xc59c('0x1de')});db['OpenchannelTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x180')],{'foreignKey':_0xc59c('0x1e8'),'as':'ToAccount'});db[_0xc59c('0x1e9')]['belongsTo'](db[_0xc59c('0x17d')],{});db[_0xc59c('0x1e9')][_0xc59c('0x11e')](db[_0xc59c('0x5e')],{});db['SmsTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x5a')],{'foreignKey':'FromSmsAccountId','as':_0xc59c('0x1d8')});db['SmsTransferReport']['belongsTo'](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1d9'),'as':_0xc59c('0x1da')});db[_0xc59c('0x1e9')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1db'),'as':_0xc59c('0x1dc')});db[_0xc59c('0x1e9')]['belongsTo'](db[_0xc59c('0x12d')],{'foreignKey':_0xc59c('0x1ea'),'as':'ToQueue'});db['SmsTransferReport'][_0xc59c('0x11e')](db[_0xc59c('0x5a')],{'foreignKey':_0xc59c('0x1eb'),'as':_0xc59c('0x1e0')});db[_0xc59c('0xf5')]['hasMany'](db[_0xc59c('0x15d')],{'as':_0xc59c('0x171'),'foreignKey':_0xc59c('0x15f'),'onDelete':'cascade'});db[_0xc59c('0xf5')][_0xc59c('0x110')](db[_0xc59c('0x1ec')],{'as':'CustomFields','foreignKey':'ListId'});db[_0xc59c('0xf5')][_0xc59c('0x110')](db['CmContact'],{'as':'Contacts','onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0xf5')]['hasMany'](db['CmHopperFinal'],{'as':_0xc59c('0x146'),'foreignKey':_0xc59c('0x15f')});db['CmList'][_0xc59c('0x110')](db['CmHopperHistory'],{'as':_0xc59c('0x114'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0xf5')][_0xc59c('0x110')](db[_0xc59c('0x7f')],{'as':_0xc59c('0x7f'),'foreignKey':'ListId'});db[_0xc59c('0xf5')][_0xc59c('0x120')](db[_0xc59c('0x1a')],{'as':_0xc59c('0x1ed'),'through':_0xc59c('0x1ee')});db['CmList'][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x150'),'through':'cm_user_has_lists'});db[_0xc59c('0x1ef')][_0xc59c('0x110')](db[_0xc59c('0x19')],{'as':'Extensions','onDelete':_0xc59c('0x10e')});db[_0xc59c('0x1ef')][_0xc59c('0x120')](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x1f0')});db[_0xc59c('0xf7')][_0xc59c('0x110')](db[_0xc59c('0x14')],{'as':_0xc59c('0x186'),'foreignKey':_0xc59c('0x11f')});db[_0xc59c('0xf7')][_0xc59c('0x110')](db[_0xc59c('0xf9')],{'as':'UserProfileSections','foreignKey':_0xc59c('0x11f'),'onDelete':_0xc59c('0x10e')});db['UserProfileSection'][_0xc59c('0x110')](db['UserProfileResource'],{'as':_0xc59c('0x1f1'),'foreignKey':_0xc59c('0x1f2'),'onDelete':_0xc59c('0x10e')});db[_0xc59c('0xfe')]['hasMany'](db[_0xc59c('0x15d')],{'as':_0xc59c('0x171'),'foreignKey':'WhatsappAccountId','onDelete':_0xc59c('0x10e')});db['WhatsappAccount'][_0xc59c('0x110')](db[_0xc59c('0x84')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xc59c('0xfe')][_0xc59c('0x110')](db['WhatsappMessage'],{'as':_0xc59c('0x152'),'foreignKey':'WhatsappAccountId'});db[_0xc59c('0xfe')][_0xc59c('0x110')](db['WhatsappInteraction'],{'as':_0xc59c('0x179')});db['WhatsappAccount'][_0xc59c('0x110')](db[_0xc59c('0x100')],{'as':'Applications'});db['WhatsappAccount'][_0xc59c('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xc59c('0x15f')});db[_0xc59c('0xfe')][_0xc59c('0x11e')](db[_0xc59c('0x14e')],{'as':_0xc59c('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc59c('0xfe')][_0xc59c('0x120')](db[_0xc59c('0x14')],{'as':_0xc59c('0x150'),'through':_0xc59c('0x13b')});db[_0xc59c('0x100')][_0xc59c('0x11e')](db['User'],{'onDelete':'restrict'});db[_0xc59c('0x100')]['belongsTo'](db[_0xc59c('0x1d1')],{'onDelete':_0xc59c('0x16b')});db['WhatsappApplication']['belongsTo'](db[_0xc59c('0xfe')],{'onDelete':_0xc59c('0x16b')});db[_0xc59c('0x100')][_0xc59c('0x11e')](db[_0xc59c('0x89')],{'onDelete':'restrict','foreignKey':_0xc59c('0x14d')});db[_0xc59c('0x100')][_0xc59c('0x11e')](db[_0xc59c('0x93')],{'onDelete':_0xc59c('0x16b'),'foreignKey':_0xc59c('0x16c')});db[_0xc59c('0x102')][_0xc59c('0x110')](db[_0xc59c('0x104')],{'as':'Messages','onDelete':_0xc59c('0x10e'),'foreignKey':_0xc59c('0x1f3')});db['WhatsappInteraction']['belongsTo'](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xc59c('0x1f4')});db['WhatsappInteraction'][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':'Contact','foreignKey':_0xc59c('0x159')});db['WhatsappInteraction'][_0xc59c('0x11e')](db[_0xc59c('0x14')],{'as':_0xc59c('0x164'),'foreignKey':_0xc59c('0x10f')});db[_0xc59c('0x102')]['belongsToMany'](db[_0xc59c('0x93')],{'through':_0xc59c('0x1a8'),'as':'Tags'});db[_0xc59c('0x102')][_0xc59c('0x120')](db['Tag'],{'through':_0xc59c('0x1a8'),'as':_0xc59c('0x167')});db[_0xc59c('0x102')]['belongsToMany'](db[_0xc59c('0x14')],{'as':_0xc59c('0x186'),'through':_0xc59c('0x1f5'),'foreignKey':_0xc59c('0x1f3')});db[_0xc59c('0x104')][_0xc59c('0x11e')](db['User'],{'as':'User'});db[_0xc59c('0x104')][_0xc59c('0x11e')](db['CmContact'],{'onDelete':_0xc59c('0x10e'),'as':_0xc59c('0x158')});db[_0xc59c('0x104')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0xc59c('0x104')][_0xc59c('0x11e')](db['WhatsappAccount'],{'as':_0xc59c('0x163'),'foreignKey':_0xc59c('0x1f4')});db['WhatsappQueueReport'][_0xc59c('0x11e')](db['WhatsappAccount'],{});db['WhatsappQueueReport']['belongsTo'](db[_0xc59c('0xf5')],{'as':_0xc59c('0x16d'),'foreignKey':_0xc59c('0x15f')});db[_0xc59c('0x1f6')][_0xc59c('0x11e')](db[_0xc59c('0x122')],{'as':_0xc59c('0x158'),'foreignKey':_0xc59c('0x159')});db[_0xc59c('0x1f6')][_0xc59c('0x11e')](db[_0xc59c('0x102')],{});db[_0xc59c('0x1f6')][_0xc59c('0x11e')](db['WhatsappQueue'],{});db[_0xc59c('0x1f6')][_0xc59c('0x11e')](db['WhatsappMessage'],{});db[_0xc59c('0x1f6')][_0xc59c('0x11e')](db[_0xc59c('0x14')],{});db[_0xc59c('0x107')]['belongsTo'](db['WhatsappMessage'],{});db[_0xc59c('0x107')][_0xc59c('0x11e')](db[_0xc59c('0x102')],{});db['WhatsappTransferReport'][_0xc59c('0x11e')](db['WhatsappAccount'],{'foreignKey':_0xc59c('0x1f7'),'as':'FromAccount'});db[_0xc59c('0x107')][_0xc59c('0x11e')](db[_0xc59c('0xfe')],{'foreignKey':'ToWhatsappAccountId','as':_0xc59c('0x1e0')});db[_0xc59c('0x107')][_0xc59c('0x11e')](db[_0xc59c('0x1d1')],{'foreignKey':_0xc59c('0x1f8'),'as':_0xc59c('0x1de')});db['WhatsappTransferReport']['belongsTo'](db[_0xc59c('0x14')],{'foreignKey':_0xc59c('0x1d9'),'as':_0xc59c('0x1da')});db[_0xc59c('0x107')][_0xc59c('0x11e')](db['User'],{'foreignKey':_0xc59c('0x1db'),'as':_0xc59c('0x1dc')});db[_0xc59c('0x1d1')][_0xc59c('0x120')](db['User'],{'as':_0xc59c('0x150'),'through':_0xc59c('0x39'),'foreignKey':_0xc59c('0x1f9')});db[_0xc59c('0x1d1')]['belongsToMany'](db[_0xc59c('0x126')],{'through':_0xc59c('0x1d2'),'as':'Teams'});module[_0xc59c('0x1fa')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x662a=['UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_chat_interactions','FaxInteraction','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','UserChatQueue','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','VoicePrefixes','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','Sounds','Members','VoiceQueueId','CmHopper','CmHopperBlack','HopperBlacks','Trunk','TrunkId','TrunkBackup','mandatoryDispositionPauseId','Agents','Teams','BlackLists','Messages','mailbox','mailboxuser','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','Imap','Smtp','Answers','Interactions','List','Template','TemplateId','mandatoryDispositionPause','MailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','user_has_mail_interactions','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','restrict','IntervalId','TagId','ListId','Dispositions','FaxAccountId','FaxApplication','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','Users','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_chat_websites','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','chat_group_has_users','CmCompany','CompanyId','JscriptySessions','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','moh_has_sounds','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','Fields','Subject','SubjectId','FieldId','VariableId','SugarcrmField','Description','Field','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','FromId','ToId','ProjectId','user_has_teams','team_has_whatsapp_queues','HopperHistories','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToUserId','ToChatQueueId','ToQueue','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CmCustomField','HopperHistory','Queues','voice_queues_has_cm_lists','VoicePrefix','user_has_voice_prefixes','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','database','options','password','import','../api/user/user.model','VoiceChanSpy','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','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','Schedule','../api/sound/sound.model','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x662a,0xff));var _0xa662=function(_0x17f52e,_0x4da384){_0x17f52e=_0x17f52e-0x0;var _0x27b3a9=_0x662a[_0x17f52e];return _0x27b3a9;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xa662('0x0'));var _=require(_0xa662('0x1'));var jstz=require(_0xa662('0x2'));var timezone=jstz[_0xa662('0x3')]();config[_0xa662('0x0')]=_[_0xa662('0x4')](config['sequelize'],{'database':_0xa662('0x5'),'username':_0xa662('0x6'),'password':_0xa662('0x7'),'options':{'host':_0xa662('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa662('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa662('0xa'),'collate':_0xa662('0xb')}}});config[_0xa662('0xc')]=_[_0xa662('0x4')](config[_0xa662('0xc')],{'database':_0xa662('0x5'),'username':_0xa662('0x6'),'password':_0xa662('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa662('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xa662('0xa'),'collate':_0xa662('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa662('0x0')][_0xa662('0xd')],config[_0xa662('0x0')]['username'],config['sequelize']['password'],config['sequelize'][_0xa662('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa662('0xc')][_0xa662('0xd')],config[_0xa662('0xc')]['username'],config['sequelizeHistory'][_0xa662('0xf')],config[_0xa662('0xc')][_0xa662('0xe')])};db['User']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x11'));db[_0xa662('0x12')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x13'));db['VoiceExtension']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x14'));db[_0xa662('0x15')]=db[_0xa662('0x0')]['import'](_0xa662('0x16'));db[_0xa662('0x17')]=db[_0xa662('0x0')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xa662('0x18')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/voiceRecording/voiceRecording.model');db[_0xa662('0x19')]=db['sequelize'][_0xa662('0x10')]('../api/screenRecording/screenRecording.model');db[_0xa662('0x1a')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x1b'));db[_0xa662('0x1c')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x1d'));db[_0xa662('0x1e')]=db[_0xa662('0x0')]['import'](_0xa662('0x1f'));db[_0xa662('0x20')]=db['sequelize']['import']('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa662('0x21')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x22'));db['MemberReport']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x23'));db['Trunk']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/trunk/trunk.model');db['VoiceTransferReport']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x24'));db[_0xa662('0x25')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x26'));db[_0xa662('0x27')]=db['sequelize'][_0xa662('0x10')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/userChatQueue/userChatQueue.model');db[_0xa662('0x28')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/userMailQueue/userMailQueue.model');db[_0xa662('0x29')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x2a'));db['UserSmsQueue']=db['sequelize'][_0xa662('0x10')](_0xa662('0x2b'));db[_0xa662('0x2c')]=db[_0xa662('0x0')]['import'](_0xa662('0x2d'));db['UserWhatsappQueue']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xa662('0x2e')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x2f'));db[_0xa662('0x30')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x31'));db['MailAccount']=db[_0xa662('0x0')]['import'](_0xa662('0x32'));db['MailQueue']=db['sequelize'][_0xa662('0x10')](_0xa662('0x33'));db[_0xa662('0x34')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x35'));db['MailInteraction']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x36'));db[_0xa662('0x37')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x38'));db[_0xa662('0x39')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x3a'));db[_0xa662('0x3b')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x3c'));db[_0xa662('0x3d')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x3e'));db[_0xa662('0x3f')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/dashboardItem/dashboardItem.model');db[_0xa662('0x40')]=db[_0xa662('0x0')]['import'](_0xa662('0x41'));db['FaxApplication']=db['sequelize']['import'](_0xa662('0x42'));db['FaxInteraction']=db[_0xa662('0x0')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0xa662('0x0')]['import'](_0xa662('0x43'));db[_0xa662('0x44')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x45'));db['FaxQueueReport']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x46'));db[_0xa662('0x47')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x48'));db['SmsApplication']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x49'));db[_0xa662('0x4a')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x4b'));db[_0xa662('0x4c')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x4d'));db[_0xa662('0x4e')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x4f'));db['OpenchannelAccount']=db[_0xa662('0x0')]['import'](_0xa662('0x50'));db[_0xa662('0x51')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db['sequelize'][_0xa662('0x10')](_0xa662('0x52'));db[_0xa662('0x53')]=db[_0xa662('0x0')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xa662('0x54')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x55'));db[_0xa662('0x56')]=db['sequelize']['import'](_0xa662('0x57'));db[_0xa662('0x58')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x59'));db[_0xa662('0x5a')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x5b'));db[_0xa662('0x5c')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x5d'));db[_0xa662('0x5e')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x5f'));db['ChatOfflineMessage']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x60'));db[_0xa662('0x61')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x62'));db[_0xa662('0x63')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x64'));db[_0xa662('0x65')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x66'));db['CmCompany']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x67'));db[_0xa662('0x68')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x69'));db['CmHopper']=db[_0xa662('0x0')]['import'](_0xa662('0x6a'));db['CmHopperBlack']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x6b'));db[_0xa662('0x6c')]=db[_0xa662('0x0')]['import'](_0xa662('0x6d'));db[_0xa662('0x6e')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x6f'));db[_0xa662('0x70')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x71'));db['CmCustomField']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x72'));db[_0xa662('0x73')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x74'));db[_0xa662('0x75')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x76'));db[_0xa662('0x77')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x78'));db[_0xa662('0x79')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x7a'));db[_0xa662('0x7b')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x7c'));db[_0xa662('0x7d')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x7e'));db[_0xa662('0x7f')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x80'));db[_0xa662('0x81')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xa662('0x0')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xa662('0x82')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/schedule/schedule.model');db['Sound']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x83'));db['Tag']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x84'));db['Template']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x85'));db['Trigger']=db['sequelize'][_0xa662('0x10')](_0xa662('0x86'));db[_0xa662('0x87')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x88'));db[_0xa662('0x89')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x8a'));db[_0xa662('0x8b')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x8c'));db[_0xa662('0x8d')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x8e'));db[_0xa662('0x8f')]=db[_0xa662('0x0')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xa662('0x90')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x91'));db[_0xa662('0x92')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x93'));db['AnalyticTreeReport']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x94'));db[_0xa662('0x95')]=db[_0xa662('0x0')]['import'](_0xa662('0x96'));db[_0xa662('0x97')]=db[_0xa662('0x0')]['import'](_0xa662('0x98'));db[_0xa662('0x99')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x9a'));db[_0xa662('0x9b')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x9c'));db[_0xa662('0x9d')]=db['sequelize'][_0xa662('0x10')](_0xa662('0x9e'));db['SugarcrmField']=db[_0xa662('0x0')]['import']('../api/intSugarcrmField/intSugarcrmField.model');db[_0xa662('0x9f')]=db[_0xa662('0x0')]['import'](_0xa662('0xa0'));db[_0xa662('0xa1')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xa2'));db[_0xa662('0xa3')]=db[_0xa662('0x0')]['import'](_0xa662('0xa4'));db[_0xa662('0xa5')]=db['sequelize'][_0xa662('0x10')](_0xa662('0xa6'));db['ZohoConfiguration']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/intZohoConfiguration/intZohoConfiguration.model');db['ZohoField']=db[_0xa662('0x0')][_0xa662('0x10')]('../api/intZohoField/intZohoField.model');db[_0xa662('0xa7')]=db[_0xa662('0x0')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xa662('0xa8')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa662('0xa9')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xaa'));db[_0xa662('0xab')]=db[_0xa662('0x0')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xa662('0xac')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xad'));db['VtigerAccount']=db['sequelize'][_0xa662('0x10')](_0xa662('0xae'));db['VtigerConfiguration']=db['sequelize'][_0xa662('0x10')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xa662('0xaf')]=db['sequelize']['import']('../api/intVtigerField/intVtigerField.model');db[_0xa662('0xb0')]=db['sequelize'][_0xa662('0x10')](_0xa662('0xb1'));db[_0xa662('0xb2')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xb3'));db[_0xa662('0xb4')]=db[_0xa662('0x0')]['import'](_0xa662('0xb5'));db[_0xa662('0xb6')]=db[_0xa662('0x0')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xa662('0xb7')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xa662('0xb8')]=db[_0xa662('0x0')]['import'](_0xa662('0xb9'));db[_0xa662('0xba')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xa662('0xbb')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xbc'));db[_0xa662('0xbd')]=db[_0xa662('0x0')]['import'](_0xa662('0xbe'));db[_0xa662('0x89')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x8a'));db['Network']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xbf'));db[_0xa662('0xc0')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xc1'));db[_0xa662('0xc2')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xa662('0xc3')]=db[_0xa662('0x0')]['import'](_0xa662('0xc4'));db[_0xa662('0xc5')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xc6'));db[_0xa662('0xc7')]=db['sequelize'][_0xa662('0x10')](_0xa662('0xc8'));db[_0xa662('0xc9')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xca'));db[_0xa662('0xcb')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xcc'));db['SquareDetailsReport']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xcd'));db['JscriptyProject']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xce'));db[_0xa662('0xcf')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xd0'));db[_0xa662('0xd1')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xd2'));db[_0xa662('0xd3')]=db['sequelize']['import'](_0xa662('0xd4'));db[_0xa662('0xd5')]=db[_0xa662('0x0')]['import']('../api/squareRecording/squareRecording.model');db[_0xa662('0xd6')]=db[_0xa662('0x0')][_0xa662('0x10')]('../api/squareMessage/squareMessage.model');db[_0xa662('0xd7')]=db[_0xa662('0x0')]['import'](_0xa662('0xd8'));db[_0xa662('0xd9')]=db[_0xa662('0x0')]['import']('../api/license/license.model');db[_0xa662('0xda')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xdb'));db['Migration']=db['sequelize'][_0xa662('0x10')](_0xa662('0xdc'));db['Attachment']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xdd'));db['Plugin']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xde'));db[_0xa662('0xdf')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xe0'));db['ChatTransferReport']=db['sequelize']['import'](_0xa662('0xe1'));db[_0xa662('0xe2')]=db['sequelize']['import'](_0xa662('0xe3'));db[_0xa662('0xe4')]=db['sequelize']['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xa662('0xe5')]=db[_0xa662('0x0')]['import'](_0xa662('0xe6'));db[_0xa662('0xe7')]=db['sequelize']['import'](_0xa662('0xe8'));db['VoicePrefix']=db[_0xa662('0x0')]['import'](_0xa662('0xe9'));db[_0xa662('0xea')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xeb'));db['UserProfileSection']=db[_0xa662('0x0')]['import'](_0xa662('0xec'));db[_0xa662('0xed')]=db['sequelize']['import'](_0xa662('0xee'));db[_0xa662('0xef')]=db[_0xa662('0x0')]['import'](_0xa662('0xf0'));db[_0xa662('0xf1')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xf2'));db[_0xa662('0xf3')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xf4'));db[_0xa662('0xf5')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xf6'));db['WhatsappMessage']=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xf7'));db[_0xa662('0xf8')]=db['sequelize'][_0xa662('0x10')](_0xa662('0xf9'));db[_0xa662('0xfa')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0xfb'));db[_0xa662('0xfc')]=db['sequelize']['import'](_0xa662('0xfd'));db['CloudProvider']=db['sequelize']['import'](_0xa662('0xfe'));db[_0xa662('0xff')]=db[_0xa662('0x0')][_0xa662('0x10')](_0xa662('0x100'));db[_0xa662('0x101')][_0xa662('0x102')](db[_0xa662('0x1a')],{'as':'VoiceMail','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x104')});db['User'][_0xa662('0x105')](db[_0xa662('0x18')],{'as':_0xa662('0x106'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x101')][_0xa662('0x105')](db['UserVoiceQueueRt'],{'as':_0xa662('0x107'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x101')][_0xa662('0x105')](db[_0xa662('0x108')],{'as':_0xa662('0x109'),'onDelete':_0xa662('0x103'),'hooks':!![]});db[_0xa662('0x101')][_0xa662('0x105')](db[_0xa662('0x6c')],{'as':_0xa662('0x10a'),'foreignKey':'UserId'});db[_0xa662('0x101')][_0xa662('0x105')](db[_0xa662('0x6e')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xa662('0x101')][_0xa662('0x105')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'UserId'});db['User'][_0xa662('0x105')](db[_0xa662('0x10b')],{'as':_0xa662('0x10c'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xa662('0x5c')],{'as':_0xa662('0x10d'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x101')][_0xa662('0x105')](db['SmsInteraction'],{'as':_0xa662('0x10e'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x101')][_0xa662('0x105')](db['FaxInteraction'],{'as':_0xa662('0x10f'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x101')]['hasMany'](db[_0xa662('0x110')],{'as':_0xa662('0x111'),'foreignKey':'UserId'});db[_0xa662('0x101')][_0xa662('0x105')](db[_0xa662('0xf5')],{'as':_0xa662('0x112'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x101')][_0xa662('0x105')](db['UserNotification'],{'as':_0xa662('0x113'),'foreignKey':_0xa662('0x114')});db[_0xa662('0x101')][_0xa662('0x115')](db[_0xa662('0xea')],{'as':_0xa662('0xea'),'foreignKey':_0xa662('0x116')});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x63')],{'as':_0xa662('0x118'),'through':'chat_group_has_users'});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x68')],{'as':_0xa662('0x119'),'through':_0xa662('0x11a')});db[_0xa662('0x101')][_0xa662('0x117')](db['CmList'],{'as':_0xa662('0x11b'),'through':_0xa662('0x11c')});db[_0xa662('0x101')]['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0xa662('0x101')]['belongsToMany'](db[_0xa662('0x110')],{'as':_0xa662('0x111'),'through':'user_has_mail_interactions'});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x5c')],{'as':_0xa662('0x10d'),'through':_0xa662('0x11d')});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x11e')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x4a')],{'as':_0xa662('0x10e'),'through':_0xa662('0x11f')});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x10b')],{'as':_0xa662('0x10c'),'through':_0xa662('0x120')});db['User'][_0xa662('0x117')](db[_0xa662('0xf5')],{'as':_0xa662('0x112'),'through':_0xa662('0x121')});db['User'][_0xa662('0x117')](db['VoiceQueue'],{'as':_0xa662('0x122'),'through':'UserVoiceQueue','required':![]});db['User']['belongsToMany'](db['MailQueue'],{'as':_0xa662('0x123'),'through':_0xa662('0x28'),'required':![]});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x61')],{'as':_0xa662('0x124'),'through':_0xa662('0x125'),'required':![],'hooks':!![]});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x44')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0xa662('0x101')]['belongsToMany'](db[_0xa662('0x4e')],{'as':_0xa662('0x126'),'through':_0xa662('0x127'),'required':![]});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x54')],{'as':_0xa662('0x128'),'through':'UserOpenchannelQueue','required':![]});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0xfc')],{'as':_0xa662('0x129'),'through':_0xa662('0x12a'),'required':![]});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0xe7')],{'through':_0xa662('0x11c')});db['User']['belongsToMany'](db['VoicePrefix'],{'as':_0xa662('0x12b'),'through':'user_has_voice_prefixes','required':![]});db['User'][_0xa662('0x117')](db[_0xa662('0x56')],{'as':_0xa662('0x12c'),'through':'user_has_chat_websites'});db['User'][_0xa662('0x117')](db[_0xa662('0x40')],{'as':_0xa662('0x12d'),'through':_0xa662('0x12e')});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x12f')],{'as':_0xa662('0x130'),'through':_0xa662('0x131')});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0x132')],{'as':'OpenchannelAccounts','through':_0xa662('0x133')});db[_0xa662('0x101')][_0xa662('0x117')](db['SmsAccount'],{'as':_0xa662('0x134'),'through':'user_has_sms_accounts'});db[_0xa662('0x101')][_0xa662('0x117')](db['WhatsappAccount'],{'as':_0xa662('0x135'),'through':_0xa662('0x136')});db[_0xa662('0x101')][_0xa662('0x117')](db[_0xa662('0xd3')],{'as':_0xa662('0x137'),'through':_0xa662('0x138')});db[_0xa662('0x12')][_0xa662('0x105')](db['VoiceExtension'],{'as':_0xa662('0x139'),'onDelete':'cascade','foreignKey':_0xa662('0x13a')});db[_0xa662('0x13b')][_0xa662('0x105')](db[_0xa662('0x108')],{'onDelete':_0xa662('0x103')});db[_0xa662('0x108')][_0xa662('0x105')](db[_0xa662('0x108')],{'as':_0xa662('0x13c'),'onDelete':_0xa662('0x103')});db[_0xa662('0x15')][_0xa662('0x117')](db[_0xa662('0x13d')],{'as':_0xa662('0x13e'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xa662('0x105')](db[_0xa662('0x25')],{'as':_0xa662('0x13f'),'foreignKey':_0xa662('0x140')});db[_0xa662('0x17')][_0xa662('0x105')](db[_0xa662('0x141')],{'as':'Hoppers','foreignKey':_0xa662('0x140')});db['VoiceQueue'][_0xa662('0x105')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xa662('0x140')});db[_0xa662('0x17')][_0xa662('0x105')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xa662('0x140')});db[_0xa662('0x17')][_0xa662('0x105')](db['ReportAgentPreview'],{'as':_0xa662('0x70'),'foreignKey':_0xa662('0x140')});db[_0xa662('0x17')]['hasMany'](db[_0xa662('0x142')],{'as':_0xa662('0x143'),'foreignKey':_0xa662('0x140')});db[_0xa662('0x17')][_0xa662('0x105')](db[_0xa662('0xc7')],{'as':'JscriptySessions','foreignKey':_0xa662('0x140')});db[_0xa662('0x17')][_0xa662('0x115')](db[_0xa662('0x144')],{'as':_0xa662('0x144'),'foreignKey':_0xa662('0x145')});db[_0xa662('0x17')][_0xa662('0x115')](db['Trunk'],{'as':_0xa662('0x146'),'foreignKey':'TrunkBackupId'});db[_0xa662('0x17')]['belongsTo'](db[_0xa662('0x7d')],{'as':_0xa662('0x7d'),'foreignKey':'IntervalId'});db[_0xa662('0x17')][_0xa662('0x115')](db[_0xa662('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0xa662('0x147')});db[_0xa662('0x17')]['belongsToMany'](db[_0xa662('0xe7')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xa662('0x17')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x27')});db['VoiceQueue'][_0xa662('0x117')](db[_0xa662('0xd7')],{'as':_0xa662('0x149'),'through':_0xa662('0xff')});db[_0xa662('0x17')]['belongsToMany'](db['CmList'],{'as':_0xa662('0x14a'),'through':'voice_queues_has_cm_blacklists'});db[_0xa662('0x18')][_0xa662('0x115')](db['User'],{'as':_0xa662('0x101'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x19')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x101'),'foreignKey':_0xa662('0x104')});db['VoiceMail'][_0xa662('0x105')](db[_0xa662('0x1c')],{'as':_0xa662('0x14b'),'onDelete':_0xa662('0x103'),'foreignKey':'mailboxuser','sourceKey':_0xa662('0x14c')});db['VoiceMailMessage'][_0xa662('0x115')](db[_0xa662('0x1a')],{'foreignKey':_0xa662('0x14d'),'targetKey':_0xa662('0x14c')});db[_0xa662('0x1e')][_0xa662('0x105')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0xa662('0x14e'),'constraints':![]});db['VoiceCallReport'][_0xa662('0x105')](db[_0xa662('0x14f')],{'as':'AgentReports','foreignKey':_0xa662('0x14e'),'constraints':![]});db[_0xa662('0x1e')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x101'),'foreignKey':'UserId'});db[_0xa662('0x1e')][_0xa662('0x115')](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0x2e')]['belongsTo'](db[_0xa662('0x12f')],{'as':_0xa662('0x12f'),'foreignKey':'MailAccountId'});db[_0xa662('0x30')][_0xa662('0x115')](db[_0xa662('0x12f')],{'as':_0xa662('0x12f'),'foreignKey':_0xa662('0x152')});db[_0xa662('0x12f')]['hasOne'](db[_0xa662('0x2e')],{'as':_0xa662('0x153'),'onDelete':_0xa662('0x103')});db[_0xa662('0x12f')]['hasOne'](db[_0xa662('0x30')],{'as':_0xa662('0x154'),'onDelete':'cascade'});db[_0xa662('0x12f')][_0xa662('0x105')](db[_0xa662('0x79')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':_0xa662('0x103')});db[_0xa662('0x12f')][_0xa662('0x105')](db[_0xa662('0x77')],{'as':_0xa662('0x155'),'foreignKey':_0xa662('0x152')});db['MailAccount']['hasMany'](db[_0xa662('0x37')],{'as':_0xa662('0x14b'),'foreignKey':_0xa662('0x152')});db[_0xa662('0x12f')][_0xa662('0x105')](db[_0xa662('0x110')],{'as':_0xa662('0x156')});db[_0xa662('0x12f')][_0xa662('0x105')](db[_0xa662('0x39')],{'as':_0xa662('0x13c')});db[_0xa662('0x12f')][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':'ListId'});db[_0xa662('0x12f')][_0xa662('0x115')](db[_0xa662('0x158')],{'as':'Template','foreignKey':_0xa662('0x159')});db['MailAccount'][_0xa662('0x115')](db[_0xa662('0x7f')],{'as':_0xa662('0x15a'),'foreignKey':_0xa662('0x147')});db[_0xa662('0x12f')][_0xa662('0x117')](db['User'],{'as':_0xa662('0x148'),'through':_0xa662('0x131')});db[_0xa662('0x15b')][_0xa662('0x117')](db['User'],{'as':_0xa662('0x148'),'through':'UserMailQueue'});db['MailQueue'][_0xa662('0x117')](db[_0xa662('0xd7')],{'through':_0xa662('0x15c'),'as':_0xa662('0x149')});db[_0xa662('0x110')][_0xa662('0x105')](db[_0xa662('0x37')],{'as':_0xa662('0x14b'),'onDelete':'cascade','foreignKey':_0xa662('0x15d')});db[_0xa662('0x110')][_0xa662('0x115')](db[_0xa662('0x12f')],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x152')});db[_0xa662('0x110')]['belongsTo'](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0x110')][_0xa662('0x115')](db['User'],{'as':_0xa662('0x15f'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x110')]['belongsToMany'](db[_0xa662('0x160')],{'through':_0xa662('0x161'),'as':_0xa662('0x162')});db[_0xa662('0x110')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':'mail_interaction_has_tags','as':_0xa662('0x163')});db[_0xa662('0x110')][_0xa662('0x117')](db['User'],{'as':'Users','through':_0xa662('0x164'),'foreignKey':_0xa662('0x15d')});db[_0xa662('0x37')]['hasMany'](db[_0xa662('0x165')],{'as':_0xa662('0x166'),'onDelete':'cascade'});db[_0xa662('0x37')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x101')});db[_0xa662('0x37')][_0xa662('0x115')](db[_0xa662('0x68')],{'onDelete':'cascade','as':'Contact'});db[_0xa662('0x37')][_0xa662('0x115')](db['MailInteraction'],{'as':_0xa662('0x167'),'foreignKey':_0xa662('0x15d')});db[_0xa662('0x37')][_0xa662('0x115')](db['MailAccount'],{'as':_0xa662('0x15e'),'foreignKey':'MailAccountId'});db[_0xa662('0x37')][_0xa662('0x115')](db[_0xa662('0x56')],{'as':'ChatWebsite','foreignKey':_0xa662('0x168')});db[_0xa662('0x37')][_0xa662('0x115')](db[_0xa662('0x169')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0xa662('0x39')][_0xa662('0x115')](db['User'],{'onDelete':_0xa662('0x16a')});db[_0xa662('0x39')]['belongsTo'](db[_0xa662('0x15b')],{'onDelete':'restrict'});db[_0xa662('0x39')][_0xa662('0x115')](db['MailAccount'],{'onDelete':_0xa662('0x16a')});db[_0xa662('0x39')][_0xa662('0x115')](db[_0xa662('0x7d')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0x39')][_0xa662('0x115')](db[_0xa662('0x160')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16c')});db[_0xa662('0x3b')]['belongsTo'](db['MailAccount'],{});db['MailQueueReport'][_0xa662('0x115')](db['CmList'],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d')});db[_0xa662('0x3b')][_0xa662('0x115')](db['CmContact'],{'as':_0xa662('0x150'),'foreignKey':'ContactId'});db[_0xa662('0x3b')]['belongsTo'](db['MailInteraction'],{});db[_0xa662('0x3b')]['belongsTo'](db[_0xa662('0x37')],{});db['MailQueueReport'][_0xa662('0x115')](db['User'],{});db[_0xa662('0x3b')][_0xa662('0x115')](db[_0xa662('0x15b')],{});db[_0xa662('0x3d')][_0xa662('0x105')](db[_0xa662('0x3f')],{'as':'Items','onDelete':_0xa662('0x103')});db[_0xa662('0x40')][_0xa662('0x105')](db['Disposition'],{'as':_0xa662('0x16e'),'foreignKey':'FaxAccountId','onDelete':_0xa662('0x103')});db['FaxAccount'][_0xa662('0x105')](db[_0xa662('0x77')],{'as':'Answers','foreignKey':_0xa662('0x16f')});db['FaxAccount'][_0xa662('0x105')](db['FaxInteraction'],{'as':_0xa662('0x156')});db[_0xa662('0x40')]['hasMany'](db[_0xa662('0x170')],{'as':_0xa662('0x13c')});db['FaxAccount'][_0xa662('0x105')](db[_0xa662('0x108')],{'as':_0xa662('0x171'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db[_0xa662('0x172')],{'as':_0xa662('0x14b')});db[_0xa662('0x40')][_0xa662('0x115')](db['Trunk'],{'as':'Trunk'});db[_0xa662('0x40')][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':'List','foreignKey':_0xa662('0x16d')});db[_0xa662('0x40')]['belongsTo'](db[_0xa662('0x7f')],{'as':_0xa662('0x15a'),'foreignKey':'mandatoryDispositionPauseId'});db['FaxAccount'][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':'user_has_fax_accounts'});db[_0xa662('0x170')][_0xa662('0x115')](db[_0xa662('0x101')],{'onDelete':'restrict'});db[_0xa662('0x170')][_0xa662('0x115')](db[_0xa662('0x44')],{'onDelete':_0xa662('0x16a')});db[_0xa662('0x170')][_0xa662('0x115')](db[_0xa662('0x40')],{'onDelete':'restrict'});db[_0xa662('0x170')][_0xa662('0x115')](db[_0xa662('0x160')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16c')});db[_0xa662('0x11e')][_0xa662('0x105')](db[_0xa662('0x172')],{'as':'Messages','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x173')});db['FaxInteraction'][_0xa662('0x115')](db[_0xa662('0x40')],{'as':_0xa662('0x15e'),'foreignKey':'FaxAccountId'});db[_0xa662('0x11e')]['belongsTo'](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0x11e')][_0xa662('0x115')](db['User'],{'as':_0xa662('0x15f'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x11e')][_0xa662('0x117')](db['Tag'],{'through':_0xa662('0x174'),'as':_0xa662('0x162')});db[_0xa662('0x11e')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x174'),'as':_0xa662('0x163')});db[_0xa662('0x11e')]['belongsToMany'](db[_0xa662('0x101')],{'as':'Users','through':_0xa662('0x175'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xa662('0x115')](db[_0xa662('0x101')],{'onDelete':_0xa662('0x103'),'as':_0xa662('0x101')});db[_0xa662('0x172')][_0xa662('0x115')](db[_0xa662('0x11e')],{'as':_0xa662('0x167'),'foreignKey':'FaxInteractionId'});db[_0xa662('0x172')][_0xa662('0x115')](db[_0xa662('0x68')],{'onDelete':_0xa662('0x103'),'as':_0xa662('0x150')});db['FaxMessage'][_0xa662('0x115')](db[_0xa662('0x165')],{'as':_0xa662('0x165'),'foreignKey':_0xa662('0x176')});db[_0xa662('0x172')][_0xa662('0x115')](db['FaxAccount'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x16f')});db[_0xa662('0x44')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x29')});db[_0xa662('0x44')]['belongsToMany'](db[_0xa662('0xd7')],{'through':_0xa662('0x177'),'as':_0xa662('0x149')});db[_0xa662('0x178')][_0xa662('0x115')](db[_0xa662('0x40')],{});db[_0xa662('0x178')][_0xa662('0x115')](db['CmList'],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d')});db['FaxQueueReport'][_0xa662('0x115')](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0x178')][_0xa662('0x115')](db[_0xa662('0x11e')],{});db[_0xa662('0x178')]['belongsTo'](db['FaxMessage'],{});db[_0xa662('0x178')]['belongsTo'](db['User'],{});db['FaxQueueReport'][_0xa662('0x115')](db['FaxQueue'],{});db[_0xa662('0x47')][_0xa662('0x105')](db[_0xa662('0x79')],{'as':_0xa662('0x16e'),'foreignKey':_0xa662('0x179'),'onDelete':'cascade'});db[_0xa662('0x47')]['hasMany'](db[_0xa662('0x77')],{'as':'Answers','foreignKey':_0xa662('0x179')});db[_0xa662('0x47')][_0xa662('0x105')](db[_0xa662('0x4c')],{'as':_0xa662('0x14b'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xa662('0x105')](db[_0xa662('0x4a')],{'as':'Interactions'});db[_0xa662('0x47')][_0xa662('0x105')](db[_0xa662('0x17a')],{'as':_0xa662('0x13c')});db[_0xa662('0x47')]['belongsTo'](db['CmList'],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d')});db[_0xa662('0x47')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa662('0x147')});db[_0xa662('0x47')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':'user_has_sms_accounts'});db[_0xa662('0x17a')][_0xa662('0x115')](db[_0xa662('0x101')],{'onDelete':'restrict'});db['SmsApplication'][_0xa662('0x115')](db['SmsQueue'],{'onDelete':_0xa662('0x16a')});db[_0xa662('0x17a')][_0xa662('0x115')](db[_0xa662('0x47')],{'onDelete':_0xa662('0x16a')});db[_0xa662('0x17a')][_0xa662('0x115')](db[_0xa662('0x7d')],{'onDelete':_0xa662('0x16a'),'foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db[_0xa662('0x160')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16c')});db[_0xa662('0x4a')][_0xa662('0x105')](db['SmsMessage'],{'as':_0xa662('0x14b'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x17b')});db[_0xa662('0x4a')][_0xa662('0x115')](db[_0xa662('0x47')],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x179')});db['SmsInteraction'][_0xa662('0x115')](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':'ContactId'});db[_0xa662('0x4a')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x15f'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x4a')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x17c'),'as':_0xa662('0x162')});db['SmsInteraction'][_0xa662('0x117')](db[_0xa662('0x160')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0xa662('0x4a')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x17d'),'through':_0xa662('0x11f'),'foreignKey':_0xa662('0x17b')});db['SmsMessage'][_0xa662('0x115')](db[_0xa662('0x101')],{'as':'User'});db['SmsMessage'][_0xa662('0x115')](db[_0xa662('0x68')],{'onDelete':_0xa662('0x103'),'as':_0xa662('0x150')});db[_0xa662('0x4c')]['belongsTo'](db[_0xa662('0x4a')],{'onDelete':_0xa662('0x103'),'as':_0xa662('0x167'),'foreignKey':_0xa662('0x17b')});db[_0xa662('0x4c')][_0xa662('0x115')](db[_0xa662('0x47')],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x179')});db[_0xa662('0x4e')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x127'),'foreignKey':_0xa662('0x17e')});db[_0xa662('0x4e')]['belongsToMany'](db['Team'],{'through':_0xa662('0x17f'),'as':_0xa662('0x149')});db[_0xa662('0x132')][_0xa662('0x105')](db[_0xa662('0x79')],{'as':_0xa662('0x16e'),'foreignKey':_0xa662('0x180'),'onDelete':_0xa662('0x103')});db[_0xa662('0x132')]['hasMany'](db[_0xa662('0x77')],{'as':_0xa662('0x155'),'foreignKey':_0xa662('0x180')});db[_0xa662('0x132')][_0xa662('0x105')](db[_0xa662('0x10b')],{'as':_0xa662('0x156'),'foreignKey':_0xa662('0x180')});db[_0xa662('0x132')][_0xa662('0x105')](db[_0xa662('0x53')],{'as':_0xa662('0x14b'),'foreignKey':_0xa662('0x180')});db['OpenchannelAccount'][_0xa662('0x105')](db[_0xa662('0x51')],{'as':_0xa662('0x13c'),'foreignKey':_0xa662('0x180')});db[_0xa662('0x132')][_0xa662('0x115')](db['CmList'],{'as':'List','foreignKey':_0xa662('0x16d')});db[_0xa662('0x132')][_0xa662('0x115')](db['Pause'],{'as':_0xa662('0x15a'),'foreignKey':_0xa662('0x147')});db[_0xa662('0x132')][_0xa662('0x117')](db['User'],{'as':_0xa662('0x148'),'through':_0xa662('0x133')});db[_0xa662('0x51')][_0xa662('0x115')](db[_0xa662('0x101')],{'onDelete':_0xa662('0x16a')});db[_0xa662('0x51')][_0xa662('0x115')](db['OpenchannelQueue'],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x181')});db[_0xa662('0x51')][_0xa662('0x115')](db['OpenchannelAccount'],{'onDelete':_0xa662('0x16a'),'foreignKey':'OpenchannelAccountId'});db[_0xa662('0x51')][_0xa662('0x115')](db[_0xa662('0x7d')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0x51')][_0xa662('0x115')](db[_0xa662('0x160')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16c')});db[_0xa662('0x10b')][_0xa662('0x105')](db['OpenchannelMessage'],{'as':_0xa662('0x14b'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x182')});db[_0xa662('0x10b')]['belongsTo'](db[_0xa662('0x132')],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x180')});db['OpenchannelInteraction']['belongsTo'](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0x10b')][_0xa662('0x115')](db['User'],{'as':'Owner','foreignKey':_0xa662('0x104')});db[_0xa662('0x10b')][_0xa662('0x117')](db['Tag'],{'through':_0xa662('0x183'),'as':_0xa662('0x162')});db[_0xa662('0x10b')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x183'),'as':_0xa662('0x163')});db[_0xa662('0x10b')][_0xa662('0x117')](db['User'],{'as':'Users','through':_0xa662('0x120'),'foreignKey':'OpenchannelInteractionId'});db[_0xa662('0x53')]['belongsTo'](db[_0xa662('0x101')],{'onDelete':_0xa662('0x103'),'as':'User'});db[_0xa662('0x53')][_0xa662('0x115')](db['CmContact'],{'onDelete':'cascade','as':_0xa662('0x150')});db[_0xa662('0x53')][_0xa662('0x115')](db[_0xa662('0x10b')],{'onDelete':_0xa662('0x103'),'as':'Interaction','foreignKey':_0xa662('0x182')});db[_0xa662('0x53')][_0xa662('0x115')](db[_0xa662('0x165')],{'as':_0xa662('0x165'),'foreignKey':_0xa662('0x176')});db[_0xa662('0x53')][_0xa662('0x115')](db[_0xa662('0x132')],{'as':'Account','foreignKey':_0xa662('0x180')});db[_0xa662('0x54')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x2c'),'foreignKey':_0xa662('0x181')});db[_0xa662('0x54')]['belongsToMany'](db[_0xa662('0xd7')],{'through':'team_has_openchannel_queues','as':_0xa662('0x149')});db['ChatWebsite']['hasMany'](db[_0xa662('0x79')],{'as':_0xa662('0x16e'),'foreignKey':_0xa662('0x168'),'onDelete':_0xa662('0x103')});db[_0xa662('0x56')]['hasMany'](db['CannedAnswer'],{'as':_0xa662('0x155'),'foreignKey':_0xa662('0x168')});db['ChatWebsite']['hasMany'](db[_0xa662('0x65')],{'as':'ProactiveActions'});db[_0xa662('0x56')][_0xa662('0x105')](db['ChatInteraction'],{'as':_0xa662('0x156')});db['ChatWebsite'][_0xa662('0x105')](db['ChatApplication'],{'as':_0xa662('0x13c')});db[_0xa662('0x56')][_0xa662('0x105')](db['ChatMessage'],{'as':_0xa662('0x14b')});db[_0xa662('0x56')][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d')});db[_0xa662('0x56')][_0xa662('0x115')](db[_0xa662('0x7d')],{'as':_0xa662('0x7d'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0x56')][_0xa662('0x115')](db[_0xa662('0x12f')],{'as':_0xa662('0x12f'),'foreignKey':_0xa662('0x152')});db['ChatWebsite'][_0xa662('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa662('0x147')});db[_0xa662('0x56')]['belongsToMany'](db['User'],{'as':_0xa662('0x148'),'through':_0xa662('0x184')});db['OpenchannelQueueReport'][_0xa662('0x115')](db[_0xa662('0x132')],{});db['OpenchannelQueueReport'][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d')});db['OpenchannelQueueReport'][_0xa662('0x115')](db['CmContact'],{'as':_0xa662('0x150'),'foreignKey':'ContactId'});db[_0xa662('0x58')][_0xa662('0x115')](db[_0xa662('0x10b')],{});db[_0xa662('0x58')][_0xa662('0x115')](db['OpenchannelMessage'],{});db[_0xa662('0x58')][_0xa662('0x115')](db[_0xa662('0x101')],{});db['OpenchannelQueueReport'][_0xa662('0x115')](db['OpenchannelQueue'],{});db[_0xa662('0x5a')]['belongsTo'](db[_0xa662('0x101')],{'as':_0xa662('0x185'),'foreignKey':_0xa662('0x104'),'onDelete':_0xa662('0x16a')});db[_0xa662('0x5a')]['belongsTo'](db['ChatQueue'],{'as':_0xa662('0x186'),'foreignKey':_0xa662('0x187'),'onDelete':_0xa662('0x16a')});db[_0xa662('0x5a')][_0xa662('0x115')](db[_0xa662('0x56')],{'as':_0xa662('0x188'),'foreignKey':'ChatWebsiteId','onDelete':_0xa662('0x16a')});db['ChatApplication'][_0xa662('0x115')](db[_0xa662('0x160')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xa662('0x5c')]['hasMany'](db['ChatMessage'],{'as':_0xa662('0x14b'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x189')});db[_0xa662('0x5c')]['belongsTo'](db['ChatWebsite'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x168')});db[_0xa662('0x5c')][_0xa662('0x115')](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0x5c')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x15f'),'foreignKey':'UserId'});db[_0xa662('0x5c')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0xa662('0x5c')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x18a'),'as':'ThroughTags'});db[_0xa662('0x5c')][_0xa662('0x117')](db['User'],{'as':'Users','through':'user_has_chat_interactions','foreignKey':'ChatInteractionId'});db[_0xa662('0x5e')][_0xa662('0x115')](db['User'],{'onDelete':'cascade','as':_0xa662('0x101')});db[_0xa662('0x5e')][_0xa662('0x115')](db['CmContact'],{'onDelete':_0xa662('0x103'),'as':'Contact','foreignKey':_0xa662('0x151')});db[_0xa662('0x5e')][_0xa662('0x115')](db[_0xa662('0x5c')],{'onDelete':_0xa662('0x103'),'as':_0xa662('0x167'),'foreignKey':'ChatInteractionId'});db[_0xa662('0x5e')][_0xa662('0x115')](db[_0xa662('0x165')],{'as':_0xa662('0x165'),'foreignKey':_0xa662('0x176')});db[_0xa662('0x5e')][_0xa662('0x115')](db[_0xa662('0x56')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xa662('0x169')][_0xa662('0x105')](db[_0xa662('0x165')],{'as':_0xa662('0x166'),'foreignKey':_0xa662('0x18b'),'onDelete':_0xa662('0x103'),'hooks':!![]});db[_0xa662('0x169')][_0xa662('0x115')](db[_0xa662('0x68')],{'onDelete':_0xa662('0x103'),'as':_0xa662('0x150'),'foreignKey':'ContactId'});db[_0xa662('0x169')][_0xa662('0x115')](db[_0xa662('0x56')],{'as':'Account','foreignKey':_0xa662('0x168')});db['ChatQueue']['belongsToMany'](db['User'],{'as':_0xa662('0x148'),'through':_0xa662('0x125'),'hooks':!![]});db[_0xa662('0x61')][_0xa662('0x117')](db['Team'],{'through':_0xa662('0x18c'),'as':_0xa662('0x149')});db[_0xa662('0x63')]['hasMany'](db[_0xa662('0xc2')],{'as':_0xa662('0x14b'),'foreignKey':'ChatGroupId','onDelete':_0xa662('0x103')});db[_0xa662('0x63')]['belongsToMany'](db[_0xa662('0x101')],{'as':_0xa662('0x13f'),'through':_0xa662('0x18d')});db[_0xa662('0x65')][_0xa662('0x115')](db[_0xa662('0x56')],{'as':_0xa662('0x188'),'foreignKey':_0xa662('0x168')});db[_0xa662('0x18e')][_0xa662('0x105')](db[_0xa662('0x68')],{'as':'Contacts','foreignKey':_0xa662('0x18f')});db[_0xa662('0x68')][_0xa662('0x105')](db[_0xa662('0x141')],{'as':'Hoppers','foreignKey':_0xa662('0x151')});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':_0xa662('0x10a'),'foreignKey':'ContactId'});db[_0xa662('0x68')][_0xa662('0x105')](db[_0xa662('0x6e')],{'as':'HopperHistories','foreignKey':'ContactId'});db[_0xa662('0x68')][_0xa662('0x105')](db[_0xa662('0x70')],{'as':_0xa662('0x70'),'foreignKey':'ContactId'});db[_0xa662('0x68')]['hasMany'](db[_0xa662('0xc7')],{'as':_0xa662('0x190'),'foreignKey':'ContactId'});db[_0xa662('0x68')][_0xa662('0x105')](db[_0xa662('0x10b')],{'as':_0xa662('0x10c'),'foreignKey':_0xa662('0x151'),'onDelete':_0xa662('0x16a')});db[_0xa662('0x68')][_0xa662('0x105')](db[_0xa662('0x5c')],{'as':_0xa662('0x10d'),'foreignKey':_0xa662('0x151'),'onDelete':'restrict'});db[_0xa662('0x68')][_0xa662('0x105')](db[_0xa662('0x4a')],{'as':_0xa662('0x10e'),'foreignKey':'ContactId','onDelete':_0xa662('0x16a')});db['CmContact'][_0xa662('0x105')](db[_0xa662('0x11e')],{'as':_0xa662('0x10f'),'foreignKey':_0xa662('0x151'),'onDelete':_0xa662('0x16a')});db[_0xa662('0x68')]['hasMany'](db['MailInteraction'],{'as':_0xa662('0x111'),'foreignKey':'ContactId','onDelete':_0xa662('0x16a')});db[_0xa662('0x68')][_0xa662('0x115')](db[_0xa662('0x18e')],{'as':_0xa662('0x191'),'foreignKey':'CompanyId'});db[_0xa662('0x68')][_0xa662('0x115')](db['CmList'],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d'),'onDelete':_0xa662('0x103')});db[_0xa662('0x68')]['belongsToMany'](db[_0xa662('0x101')],{'as':_0xa662('0x17d'),'through':_0xa662('0x11a')});db[_0xa662('0x68')][_0xa662('0x117')](db[_0xa662('0x160')],{'as':_0xa662('0x162'),'through':_0xa662('0x192')});db[_0xa662('0x68')]['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':_0xa662('0x163')});db['CmHopper'][_0xa662('0x115')](db['CmContact'],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151'),'onDelete':_0xa662('0x103')});db[_0xa662('0x141')][_0xa662('0x115')](db['CmList'],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d'),'onDelete':'cascade'});db['CmHopper'][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x185'),'foreignKey':_0xa662('0x104')});db[_0xa662('0x141')][_0xa662('0x115')](db[_0xa662('0x17')],{'as':_0xa662('0x186'),'foreignKey':_0xa662('0x140'),'onDelete':'cascade'});db['CmHopper'][_0xa662('0x115')](db[_0xa662('0xda')],{'as':'Campaign','foreignKey':_0xa662('0x193'),'onDelete':_0xa662('0x103')});db['CmHopper'][_0xa662('0x115')](db['User'],{'as':_0xa662('0x15f'),'foreignKey':_0xa662('0x194')});db['CmHopperBlack'][_0xa662('0x115')](db['CmContact'],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151'),'onDelete':_0xa662('0x103')});db[_0xa662('0x142')][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':_0xa662('0x16d'),'onDelete':_0xa662('0x103')});db['CmHopperBlack'][_0xa662('0x115')](db[_0xa662('0x17')],{'as':_0xa662('0x186'),'foreignKey':'VoiceQueueId','onDelete':_0xa662('0x103')});db[_0xa662('0x142')]['belongsTo'](db[_0xa662('0xda')],{'as':_0xa662('0xda'),'foreignKey':_0xa662('0x193'),'onDelete':_0xa662('0x103')});db['Automation'][_0xa662('0x105')](db['Condition'],{'as':{'plural':_0xa662('0x195'),'singular':_0xa662('0x196')},'foreignKey':_0xa662('0x197'),'onDelete':'cascade','hooks':!![]});db[_0xa662('0x75')][_0xa662('0x105')](db[_0xa662('0x7b')],{'as':{'plural':_0xa662('0x198'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':_0xa662('0x103'),'hooks':!![]});db[_0xa662('0x75')][_0xa662('0x105')](db[_0xa662('0x73')],{'as':_0xa662('0x199'),'foreignKey':_0xa662('0x19a'),'onDelete':'cascade','hooks':!![]});db[_0xa662('0x79')][_0xa662('0x105')](db['Disposition'],{'as':_0xa662('0x16e'),'foreignKey':_0xa662('0x19b'),'onDelete':'cascade'});db[_0xa662('0x7d')][_0xa662('0x105')](db['Interval'],{'as':'Intervals','foreignKey':_0xa662('0x16b'),'onDelete':_0xa662('0x103'),'hooks':!![],'required':![]});db[_0xa662('0x7d')][_0xa662('0x105')](db[_0xa662('0x108')],{'as':_0xa662('0x109'),'foreignKey':_0xa662('0x16b'),'onDelete':_0xa662('0x16a')});db[_0xa662('0x7d')][_0xa662('0x105')](db[_0xa662('0x39')],{'as':_0xa662('0x19c'),'foreignKey':_0xa662('0x16b')});db['Interval']['hasMany'](db['ChatApplication'],{'as':_0xa662('0x19d'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0x7d')][_0xa662('0x105')](db[_0xa662('0x170')],{'as':_0xa662('0x19e'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0x7d')][_0xa662('0x105')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0xa662('0x16b')});db['Schedule'][_0xa662('0x115')](db[_0xa662('0x12f')],{});db[_0xa662('0x82')][_0xa662('0x115')](db[_0xa662('0x8f')],{'foreignKey':_0xa662('0x19f')});db['Schedule'][_0xa662('0x115')](db['AnalyticCustomReport'],{'foreignKey':_0xa662('0x1a0')});db[_0xa662('0x13d')]['belongsToMany'](db[_0xa662('0x15')],{'as':'Mohs','through':_0xa662('0x1a1'),'onDelete':'restrict'});db['Tag']['belongsToMany'](db[_0xa662('0x68')],{'through':_0xa662('0x192')});db[_0xa662('0x160')][_0xa662('0x117')](db[_0xa662('0x5c')],{'through':_0xa662('0x18a')});db['Tag']['belongsToMany'](db[_0xa662('0x110')],{'through':_0xa662('0x161')});db['Tag'][_0xa662('0x117')](db[_0xa662('0x4a')],{'through':_0xa662('0x17c')});db[_0xa662('0x160')][_0xa662('0x117')](db[_0xa662('0x11e')],{'through':_0xa662('0x174')});db[_0xa662('0x160')][_0xa662('0x117')](db[_0xa662('0x10b')],{'through':_0xa662('0x183')});db['Tag'][_0xa662('0x117')](db['WhatsappInteraction'],{'through':_0xa662('0x1a2')});db[_0xa662('0x1a3')][_0xa662('0x105')](db[_0xa662('0x7b')],{'as':{'plural':_0xa662('0x1a4'),'singular':_0xa662('0x1a5')},'foreignKey':_0xa662('0x1a6'),'onDelete':_0xa662('0x103'),'hooks':!![]});db['Trigger'][_0xa662('0x105')](db[_0xa662('0x7b')],{'as':{'plural':_0xa662('0x1a7'),'singular':_0xa662('0x1a8')},'foreignKey':_0xa662('0x1a9'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0xa662('0x105')](db[_0xa662('0x73')],{'as':'Actions','foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db[_0xa662('0x8d')][_0xa662('0x105')](db[_0xa662('0x92')],{'as':'Fields','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1a0'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x19f')});db[_0xa662('0x90')][_0xa662('0x105')](db[_0xa662('0x92')],{'as':'Fields','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1aa')});db[_0xa662('0x92')][_0xa662('0x115')](db[_0xa662('0x90')],{'foreignKey':'MetricId'});db[_0xa662('0x95')]['hasMany'](db[_0xa662('0x97')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0x97')]['hasMany'](db[_0xa662('0x99')],{'as':_0xa662('0x1ad'),'onDelete':_0xa662('0x103'),'foreignKey':'SubjectId'});db[_0xa662('0x97')][_0xa662('0x105')](db[_0xa662('0x99')],{'as':_0xa662('0x1ae'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1af')});db[_0xa662('0x97')][_0xa662('0x105')](db[_0xa662('0x99')],{'as':_0xa662('0x1b0'),'onDelete':_0xa662('0x103'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0xa662('0x115')](db['SalesforceAccount'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0x99')][_0xa662('0x105')](db['SalesforceField'],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0x99')][_0xa662('0x105')](db[_0xa662('0x99')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa662('0x99')][_0xa662('0x105')](db['SalesforceField'],{'as':'Field','foreignKey':_0xa662('0x1b3')});db[_0xa662('0x99')][_0xa662('0x115')](db['Variable'],{'as':_0xa662('0x87'),'foreignKey':_0xa662('0x1b4')});db[_0xa662('0x9b')]['hasMany'](db[_0xa662('0x9d')],{'as':'Configurations','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0x9d')][_0xa662('0x105')](db[_0xa662('0x1b5')],{'as':_0xa662('0x1ad'),'onDelete':_0xa662('0x103'),'foreignKey':'SubjectId'});db[_0xa662('0x9d')][_0xa662('0x105')](db[_0xa662('0x1b5')],{'as':'Descriptions','onDelete':_0xa662('0x103'),'foreignKey':'DescriptionId'});db[_0xa662('0x9d')]['hasMany'](db[_0xa662('0x1b5')],{'as':_0xa662('0x1b0'),'onDelete':_0xa662('0x103'),'foreignKey':'FieldId'});db[_0xa662('0x9d')]['belongsTo'](db[_0xa662('0x9b')],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1ac')});db['SugarcrmField'][_0xa662('0x105')](db[_0xa662('0x1b5')],{'as':_0xa662('0x1b1'),'foreignKey':'SubjectId'});db['SugarcrmField'][_0xa662('0x105')](db[_0xa662('0x1b5')],{'as':_0xa662('0x1b6'),'foreignKey':_0xa662('0x1af')});db['SugarcrmField'][_0xa662('0x105')](db[_0xa662('0x1b5')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db['SugarcrmField'][_0xa662('0x115')](db[_0xa662('0x87')],{'as':_0xa662('0x87'),'foreignKey':_0xa662('0x1b4')});db[_0xa662('0x9f')][_0xa662('0x105')](db[_0xa662('0xa1')],{'as':'Configurations','onDelete':_0xa662('0x103'),'foreignKey':'AccountId'});db[_0xa662('0xa1')][_0xa662('0x105')](db[_0xa662('0xa3')],{'as':_0xa662('0x1ad'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0xa1')]['hasMany'](db[_0xa662('0xa3')],{'as':'Descriptions','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1af')});db['DeskConfiguration'][_0xa662('0x105')](db[_0xa662('0xa3')],{'as':_0xa662('0x1b0'),'onDelete':'cascade','foreignKey':_0xa662('0x1b3')});db[_0xa662('0xa1')]['belongsTo'](db['DeskAccount'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xa1')]['belongsToMany'](db[_0xa662('0x160')],{'through':_0xa662('0x1b8')});db[_0xa662('0xa3')][_0xa662('0x105')](db[_0xa662('0xa3')],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db['DeskField'][_0xa662('0x105')](db[_0xa662('0xa3')],{'as':_0xa662('0x1b6'),'foreignKey':'DescriptionId'});db[_0xa662('0xa3')][_0xa662('0x105')](db[_0xa662('0xa3')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0xa3')][_0xa662('0x115')](db[_0xa662('0x87')],{'as':_0xa662('0x87'),'foreignKey':_0xa662('0x1b4')});db[_0xa662('0xa5')][_0xa662('0x105')](db[_0xa662('0x1b9')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0x1b9')][_0xa662('0x105')](db[_0xa662('0x1ba')],{'as':_0xa662('0x1ad'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0x1b9')][_0xa662('0x105')](db[_0xa662('0x1ba')],{'as':_0xa662('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xa662('0x1b9')][_0xa662('0x105')](db[_0xa662('0x1ba')],{'as':_0xa662('0x1b0'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0x1b9')]['belongsTo'](db[_0xa662('0xa5')],{'as':'Account','foreignKey':_0xa662('0x1ac')});db[_0xa662('0x1ba')][_0xa662('0x105')](db[_0xa662('0x1ba')],{'as':_0xa662('0x1b1'),'foreignKey':'SubjectId'});db['ZohoField'][_0xa662('0x105')](db[_0xa662('0x1ba')],{'as':_0xa662('0x1b6'),'foreignKey':'DescriptionId'});db[_0xa662('0x1ba')][_0xa662('0x105')](db[_0xa662('0x1ba')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0x1ba')][_0xa662('0x115')](db['Variable'],{'as':_0xa662('0x87'),'foreignKey':_0xa662('0x1b4')});db[_0xa662('0xa7')][_0xa662('0x105')](db[_0xa662('0xa8')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xa8')]['hasMany'](db[_0xa662('0xa9')],{'as':'Subjects','foreignKey':_0xa662('0x1b2')});db['ZendeskConfiguration'][_0xa662('0x105')](db[_0xa662('0xa9')],{'as':'Descriptions','foreignKey':_0xa662('0x1af')});db['ZendeskConfiguration'][_0xa662('0x105')](db[_0xa662('0xa9')],{'as':'Fields','foreignKey':_0xa662('0x1b3')});db['ZendeskConfiguration'][_0xa662('0x115')](db[_0xa662('0xa7')],{'as':_0xa662('0x15e'),'foreignKey':'AccountId'});db[_0xa662('0xa8')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x1bb')});db[_0xa662('0xa9')]['hasMany'](db[_0xa662('0xa9')],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db['ZendeskField'][_0xa662('0x105')](db[_0xa662('0xa9')],{'as':_0xa662('0x1b6'),'foreignKey':_0xa662('0x1af')});db[_0xa662('0xa9')][_0xa662('0x105')](db[_0xa662('0xa9')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0xa9')][_0xa662('0x115')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xa662('0xab')][_0xa662('0x105')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xac')][_0xa662('0x105')](db['FreshdeskField'],{'as':_0xa662('0x1ad'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0xac')][_0xa662('0x105')](db[_0xa662('0x1bc')],{'as':'Descriptions','onDelete':_0xa662('0x103'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xa662('0x105')](db[_0xa662('0x1bc')],{'as':_0xa662('0x1b0'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0xac')][_0xa662('0x115')](db['FreshdeskAccount'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xac')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x1bd')});db[_0xa662('0x1bc')][_0xa662('0x105')](db[_0xa662('0x1bc')],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0x1bc')][_0xa662('0x105')](db[_0xa662('0x1bc')],{'as':_0xa662('0x1b6'),'foreignKey':'DescriptionId'});db[_0xa662('0x1bc')]['hasMany'](db[_0xa662('0x1bc')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0x1bc')][_0xa662('0x115')](db[_0xa662('0x87')],{'as':'Variable','foreignKey':_0xa662('0x1b4')});db[_0xa662('0x1be')][_0xa662('0x105')](db[_0xa662('0x1bf')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0x1bf')][_0xa662('0x105')](db['VtigerField'],{'as':_0xa662('0x1ad'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0x1bf')][_0xa662('0x105')](db[_0xa662('0xaf')],{'as':_0xa662('0x1ae'),'foreignKey':'DescriptionId'});db[_0xa662('0x1bf')][_0xa662('0x105')](db[_0xa662('0xaf')],{'as':'Fields','foreignKey':_0xa662('0x1b3')});db['VtigerConfiguration'][_0xa662('0x115')](db[_0xa662('0x1be')],{'as':'Account','foreignKey':_0xa662('0x1ac')});db[_0xa662('0xaf')]['hasMany'](db['VtigerField'],{'as':'Subject','foreignKey':_0xa662('0x1b2')});db[_0xa662('0xaf')]['hasMany'](db[_0xa662('0xaf')],{'as':_0xa662('0x1b6'),'foreignKey':_0xa662('0x1af')});db[_0xa662('0xaf')][_0xa662('0x105')](db[_0xa662('0xaf')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0xaf')]['belongsTo'](db['Variable'],{'as':_0xa662('0x87'),'foreignKey':_0xa662('0x1b4')});db[_0xa662('0xb0')]['hasMany'](db[_0xa662('0xb2')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xb2')][_0xa662('0x105')](db[_0xa662('0xb4')],{'as':_0xa662('0x1ad'),'foreignKey':_0xa662('0x1b2')});db['ServicenowConfiguration'][_0xa662('0x105')](db[_0xa662('0xb4')],{'as':_0xa662('0x1ae'),'foreignKey':_0xa662('0x1af')});db['ServicenowConfiguration'][_0xa662('0x105')](db[_0xa662('0xb4')],{'as':'Fields','foreignKey':'FieldId'});db[_0xa662('0xb2')][_0xa662('0x115')](db[_0xa662('0xb0')],{'as':'Account','foreignKey':'AccountId'});db[_0xa662('0xb4')][_0xa662('0x105')](db[_0xa662('0xb4')],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0xb4')]['hasMany'](db[_0xa662('0xb4')],{'as':_0xa662('0x1b6'),'foreignKey':_0xa662('0x1af')});db[_0xa662('0xb4')][_0xa662('0x105')](db[_0xa662('0xb4')],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0xb4')][_0xa662('0x115')](db[_0xa662('0x87')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa662('0xb6')][_0xa662('0x105')](db[_0xa662('0xb7')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xb7')][_0xa662('0x105')](db[_0xa662('0xb8')],{'as':_0xa662('0x1ad'),'onDelete':_0xa662('0x103'),'foreignKey':'SubjectId'});db[_0xa662('0xb7')]['hasMany'](db[_0xa662('0xb8')],{'as':'Descriptions','onDelete':_0xa662('0x103'),'foreignKey':'DescriptionId'});db[_0xa662('0xb7')][_0xa662('0x105')](db[_0xa662('0xb8')],{'as':_0xa662('0x1b0'),'onDelete':_0xa662('0x103'),'foreignKey':'FieldId'});db[_0xa662('0xb7')][_0xa662('0x115')](db[_0xa662('0xb6')],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xb8')][_0xa662('0x105')](db[_0xa662('0xb8')],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0xb8')]['hasMany'](db[_0xa662('0xb8')],{'as':_0xa662('0x1b6'),'foreignKey':'DescriptionId'});db['Dynamics365Field'][_0xa662('0x105')](db['Dynamics365Field'],{'as':_0xa662('0x1b7'),'foreignKey':_0xa662('0x1b3')});db['Dynamics365Field'][_0xa662('0x115')](db[_0xa662('0x87')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa662('0xba')]['hasMany'](db[_0xa662('0xbb')],{'as':_0xa662('0x1ab'),'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1ac')});db[_0xa662('0xbb')][_0xa662('0x105')](db[_0xa662('0xbd')],{'as':_0xa662('0x1ad'),'foreignKey':_0xa662('0x1b2')});db['FreshsalesConfiguration'][_0xa662('0x105')](db[_0xa662('0xbd')],{'as':_0xa662('0x1ae'),'foreignKey':'DescriptionId'});db[_0xa662('0xbb')][_0xa662('0x105')](db[_0xa662('0xbd')],{'as':_0xa662('0x1b0'),'foreignKey':_0xa662('0x1b3')});db[_0xa662('0xbb')][_0xa662('0x115')](db[_0xa662('0xba')],{'as':'Account','foreignKey':_0xa662('0x1ac')});db[_0xa662('0xbd')][_0xa662('0x105')](db[_0xa662('0xbd')],{'as':_0xa662('0x1b1'),'foreignKey':_0xa662('0x1b2')});db[_0xa662('0xbd')][_0xa662('0x105')](db[_0xa662('0xbd')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xa662('0xbd')]['hasMany'](db[_0xa662('0xbd')],{'as':_0xa662('0x1b7'),'foreignKey':'FieldId'});db[_0xa662('0xbd')][_0xa662('0x115')](db['Variable'],{'as':'Variable','foreignKey':_0xa662('0x1b4')});db[_0xa662('0xc0')][_0xa662('0x115')](db['ChatWebsite'],{});db[_0xa662('0xc0')][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':'List','foreignKey':_0xa662('0x16d')});db[_0xa662('0xc0')]['belongsTo'](db['CmContact'],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db['ChatQueueReport'][_0xa662('0x115')](db[_0xa662('0x5c')],{});db[_0xa662('0xc0')][_0xa662('0x115')](db[_0xa662('0x5e')],{});db[_0xa662('0xc0')][_0xa662('0x115')](db[_0xa662('0x101')],{});db[_0xa662('0xc0')][_0xa662('0x115')](db[_0xa662('0x61')],{});db['ChatInternalMessage']['belongsTo'](db[_0xa662('0x101')],{'onDelete':'cascade','foreignKey':_0xa662('0x1c0')});db['ChatInternalMessage'][_0xa662('0x115')](db[_0xa662('0x101')],{'onDelete':_0xa662('0x103'),'foreignKey':_0xa662('0x1c1')});db[_0xa662('0xc7')][_0xa662('0x105')](db[_0xa662('0xc5')],{'foreignKey':'SessionId','onDelete':_0xa662('0x103')});db[_0xa662('0xc7')][_0xa662('0x105')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xa662('0xc9')][_0xa662('0x115')](db[_0xa662('0x47')],{});db[_0xa662('0xc9')]['belongsTo'](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xa662('0x115')](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0xc9')][_0xa662('0x115')](db['SmsInteraction'],{});db[_0xa662('0xc9')][_0xa662('0x115')](db['SmsMessage'],{});db['SmsQueueReport'][_0xa662('0x115')](db['User'],{});db[_0xa662('0xc9')][_0xa662('0x115')](db[_0xa662('0x4e')],{});db['JscriptyProject'][_0xa662('0x105')](db[_0xa662('0xc7')],{'foreignKey':_0xa662('0x1c2')});db['JscriptyProject'][_0xa662('0x105')](db[_0xa662('0xc5')],{'foreignKey':_0xa662('0x1c2')});db['JscriptyProject']['hasMany'](db[_0xa662('0xc3')],{'foreignKey':_0xa662('0x1c2')});db[_0xa662('0xd3')]['belongsToMany'](db[_0xa662('0x101')],{'as':_0xa662('0x17d'),'through':_0xa662('0x138')});db['Team'][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x1c3')});db[_0xa662('0xd7')]['belongsToMany'](db[_0xa662('0x17')],{'through':_0xa662('0xff'),'as':_0xa662('0x122')});db[_0xa662('0xd7')]['belongsToMany'](db['MailQueue'],{'through':_0xa662('0x15c'),'as':'MailQueues'});db[_0xa662('0xd7')][_0xa662('0x117')](db[_0xa662('0x61')],{'through':_0xa662('0x18c'),'as':_0xa662('0x124')});db['Team'][_0xa662('0x117')](db['FaxQueue'],{'through':_0xa662('0x177'),'as':'FaxQueues'});db['Team'][_0xa662('0x117')](db['SmsQueue'],{'through':_0xa662('0x17f'),'as':'SmsQueues'});db[_0xa662('0xd7')]['belongsToMany'](db[_0xa662('0x54')],{'through':'team_has_openchannel_queues','as':_0xa662('0x128')});db[_0xa662('0xd7')]['belongsToMany'](db[_0xa662('0xfc')],{'through':_0xa662('0x1c4'),'as':'WhatsappQueues'});db[_0xa662('0xda')][_0xa662('0x105')](db[_0xa662('0x141')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign'][_0xa662('0x105')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xa662('0xda')][_0xa662('0x105')](db['CmHopperHistory'],{'as':_0xa662('0x1c5'),'foreignKey':'CampaignId'});db[_0xa662('0xda')][_0xa662('0x105')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xa662('0x193')});db[_0xa662('0xda')][_0xa662('0x115')](db[_0xa662('0x144')],{'as':'Trunk','foreignKey':_0xa662('0x145')});db['Campaign'][_0xa662('0x115')](db[_0xa662('0x144')],{'as':_0xa662('0x146'),'foreignKey':'TrunkBackupId'});db[_0xa662('0xda')][_0xa662('0x115')](db[_0xa662('0x7d')],{'as':_0xa662('0x7d'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0xda')][_0xa662('0x115')](db['SquareProject'],{'as':_0xa662('0xd3'),'foreignKey':_0xa662('0x1c6')});db['Campaign'][_0xa662('0x117')](db['CmList'],{'as':'Lists','through':_0xa662('0x1c7')});db['Campaign']['belongsToMany'](db[_0xa662('0xe7')],{'as':_0xa662('0x14a'),'through':_0xa662('0x1c8')});db[_0xa662('0x165')][_0xa662('0x115')](db[_0xa662('0x169')],{'as':_0xa662('0x169'),'foreignKey':_0xa662('0x18b')});db[_0xa662('0xdf')][_0xa662('0x115')](db[_0xa662('0x37')],{});db[_0xa662('0xdf')]['belongsTo'](db['MailInteraction'],{});db[_0xa662('0xdf')][_0xa662('0x115')](db[_0xa662('0x12f')],{'foreignKey':_0xa662('0x1c9'),'as':_0xa662('0x1ca')});db[_0xa662('0xdf')][_0xa662('0x115')](db[_0xa662('0x101')],{'foreignKey':_0xa662('0x1cb'),'as':_0xa662('0x1cc')});db[_0xa662('0xdf')][_0xa662('0x115')](db[_0xa662('0x101')],{'foreignKey':'ToUserId','as':_0xa662('0x1cd')});db[_0xa662('0xdf')][_0xa662('0x115')](db[_0xa662('0x15b')],{'foreignKey':_0xa662('0x1ce'),'as':'ToQueue'});db['MailTransferReport'][_0xa662('0x115')](db[_0xa662('0x12f')],{'foreignKey':'ToMailAccountId','as':_0xa662('0x1cf')});db['ChatTransferReport'][_0xa662('0x115')](db[_0xa662('0x5e')],{});db[_0xa662('0x1d0')][_0xa662('0x115')](db[_0xa662('0x5c')],{});db[_0xa662('0x1d0')][_0xa662('0x115')](db['ChatWebsite'],{'foreignKey':_0xa662('0x1d1'),'as':_0xa662('0x1ca')});db[_0xa662('0x1d0')][_0xa662('0x115')](db['User'],{'foreignKey':_0xa662('0x1cb'),'as':_0xa662('0x1cc')});db[_0xa662('0x1d0')][_0xa662('0x115')](db['User'],{'foreignKey':_0xa662('0x1d2'),'as':_0xa662('0x1cd')});db[_0xa662('0x1d0')]['belongsTo'](db[_0xa662('0x61')],{'foreignKey':_0xa662('0x1d3'),'as':_0xa662('0x1d4')});db['ChatTransferReport'][_0xa662('0x115')](db[_0xa662('0x56')],{'foreignKey':'ToChatWebsiteId','as':_0xa662('0x1cf')});db['FaxTransferReport'][_0xa662('0x115')](db[_0xa662('0x172')],{});db[_0xa662('0xe2')][_0xa662('0x115')](db[_0xa662('0x11e')],{});db[_0xa662('0xe2')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xa662('0x1d5'),'as':_0xa662('0x1ca')});db[_0xa662('0xe2')][_0xa662('0x115')](db['User'],{'foreignKey':_0xa662('0x1cb'),'as':_0xa662('0x1cc')});db[_0xa662('0xe2')]['belongsTo'](db[_0xa662('0x101')],{'foreignKey':_0xa662('0x1d2'),'as':_0xa662('0x1cd')});db[_0xa662('0xe2')][_0xa662('0x115')](db['FaxQueue'],{'foreignKey':_0xa662('0x1d6'),'as':_0xa662('0x1d4')});db[_0xa662('0xe2')]['belongsTo'](db[_0xa662('0x40')],{'foreignKey':_0xa662('0x1d7'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0xa662('0x115')](db[_0xa662('0x53')],{});db[_0xa662('0xe4')][_0xa662('0x115')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xa662('0x132')],{'foreignKey':_0xa662('0x1d8'),'as':_0xa662('0x1ca')});db[_0xa662('0xe4')][_0xa662('0x115')](db[_0xa662('0x101')],{'foreignKey':_0xa662('0x1cb'),'as':_0xa662('0x1cc')});db[_0xa662('0xe4')]['belongsTo'](db[_0xa662('0x101')],{'foreignKey':'ToUserId','as':_0xa662('0x1cd')});db['OpenchannelTransferReport'][_0xa662('0x115')](db['OpenchannelQueue'],{'foreignKey':_0xa662('0x1d9'),'as':_0xa662('0x1d4')});db['OpenchannelTransferReport']['belongsTo'](db[_0xa662('0x132')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0xa662('0xe5')][_0xa662('0x115')](db[_0xa662('0x4c')],{});db[_0xa662('0xe5')][_0xa662('0x115')](db[_0xa662('0x4a')],{});db['SmsTransferReport'][_0xa662('0x115')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0xa662('0x1ca')});db[_0xa662('0xe5')][_0xa662('0x115')](db['User'],{'foreignKey':_0xa662('0x1cb'),'as':_0xa662('0x1cc')});db['SmsTransferReport'][_0xa662('0x115')](db[_0xa662('0x101')],{'foreignKey':_0xa662('0x1d2'),'as':'ToAgent'});db[_0xa662('0xe5')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0xa662('0x1da'),'as':_0xa662('0x1d4')});db[_0xa662('0xe5')][_0xa662('0x115')](db['SmsAccount'],{'foreignKey':_0xa662('0x1db'),'as':'ToAccount'});db[_0xa662('0xe7')][_0xa662('0x105')](db[_0xa662('0x79')],{'as':_0xa662('0x16e'),'foreignKey':'ListId','onDelete':_0xa662('0x103')});db[_0xa662('0xe7')][_0xa662('0x105')](db[_0xa662('0x1dc')],{'as':'CustomFields','foreignKey':_0xa662('0x16d')});db[_0xa662('0xe7')][_0xa662('0x105')](db['CmContact'],{'as':'Contacts','onDelete':_0xa662('0x103'),'foreignKey':'ListId'});db[_0xa662('0xe7')][_0xa662('0x105')](db[_0xa662('0x6c')],{'as':_0xa662('0x10a'),'foreignKey':_0xa662('0x16d')});db[_0xa662('0xe7')][_0xa662('0x105')](db[_0xa662('0x6e')],{'as':_0xa662('0x1dd'),'foreignKey':_0xa662('0x16d')});db[_0xa662('0xe7')][_0xa662('0x105')](db[_0xa662('0x70')],{'as':_0xa662('0x70'),'foreignKey':'ListId'});db[_0xa662('0xe7')][_0xa662('0x117')](db['VoiceQueue'],{'as':_0xa662('0x1de'),'through':_0xa662('0x1df')});db[_0xa662('0xe7')]['belongsToMany'](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':'cm_user_has_lists'});db[_0xa662('0x1e0')][_0xa662('0x105')](db[_0xa662('0x108')],{'as':'Extensions','onDelete':_0xa662('0x103')});db[_0xa662('0x1e0')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x1e1')});db['UserProfile'][_0xa662('0x105')](db[_0xa662('0x101')],{'as':_0xa662('0x17d'),'foreignKey':'userProfileId'});db['UserProfile'][_0xa662('0x105')](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xa662('0x116'),'onDelete':_0xa662('0x103')});db[_0xa662('0x1e2')][_0xa662('0x105')](db[_0xa662('0xed')],{'as':_0xa662('0x1e3'),'foreignKey':_0xa662('0x1e4'),'onDelete':_0xa662('0x103')});db[_0xa662('0xf1')][_0xa662('0x105')](db[_0xa662('0x79')],{'as':_0xa662('0x16e'),'foreignKey':_0xa662('0x1e5'),'onDelete':_0xa662('0x103')});db[_0xa662('0xf1')][_0xa662('0x105')](db[_0xa662('0x77')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xa662('0xf1')][_0xa662('0x105')](db[_0xa662('0x1e6')],{'as':_0xa662('0x14b'),'foreignKey':_0xa662('0x1e5')});db[_0xa662('0xf1')]['hasMany'](db[_0xa662('0xf5')],{'as':_0xa662('0x156')});db['WhatsappAccount']['hasMany'](db[_0xa662('0xf3')],{'as':_0xa662('0x13c')});db['WhatsappAccount']['belongsTo'](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':'ListId'});db[_0xa662('0xf1')][_0xa662('0x115')](db['Pause'],{'as':_0xa662('0x15a'),'foreignKey':_0xa662('0x147')});db['WhatsappAccount'][_0xa662('0x117')](db['User'],{'as':_0xa662('0x148'),'through':'user_has_whatsapp_accounts'});db[_0xa662('0xf3')][_0xa662('0x115')](db[_0xa662('0x101')],{'onDelete':_0xa662('0x16a')});db['WhatsappApplication'][_0xa662('0x115')](db[_0xa662('0xfc')],{'onDelete':_0xa662('0x16a')});db[_0xa662('0xf3')][_0xa662('0x115')](db[_0xa662('0xf1')],{'onDelete':_0xa662('0x16a')});db[_0xa662('0xf3')][_0xa662('0x115')](db[_0xa662('0x7d')],{'onDelete':_0xa662('0x16a'),'foreignKey':_0xa662('0x16b')});db[_0xa662('0xf3')][_0xa662('0x115')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xa662('0x16c')});db['WhatsappInteraction']['hasMany'](db[_0xa662('0x1e6')],{'as':_0xa662('0x14b'),'onDelete':'cascade','foreignKey':_0xa662('0x1e7')});db[_0xa662('0xf5')][_0xa662('0x115')](db['WhatsappAccount'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1e5')});db['WhatsappInteraction']['belongsTo'](db[_0xa662('0x68')],{'as':_0xa662('0x150'),'foreignKey':'ContactId'});db[_0xa662('0xf5')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':'Owner','foreignKey':_0xa662('0x104')});db[_0xa662('0xf5')]['belongsToMany'](db['Tag'],{'through':_0xa662('0x1a2'),'as':_0xa662('0x162')});db[_0xa662('0xf5')][_0xa662('0x117')](db[_0xa662('0x160')],{'through':_0xa662('0x1a2'),'as':_0xa662('0x163')});db['WhatsappInteraction'][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x17d'),'through':_0xa662('0x121'),'foreignKey':'WhatsappInteractionId'});db[_0xa662('0x1e6')][_0xa662('0x115')](db[_0xa662('0x101')],{'as':_0xa662('0x101')});db[_0xa662('0x1e6')][_0xa662('0x115')](db[_0xa662('0x68')],{'onDelete':_0xa662('0x103'),'as':'Contact'});db[_0xa662('0x1e6')][_0xa662('0x115')](db['WhatsappInteraction'],{'onDelete':_0xa662('0x103'),'as':'Interaction','foreignKey':_0xa662('0x1e7')});db[_0xa662('0x1e6')][_0xa662('0x115')](db['WhatsappAccount'],{'as':_0xa662('0x15e'),'foreignKey':_0xa662('0x1e5')});db[_0xa662('0xf8')][_0xa662('0x115')](db['WhatsappAccount'],{});db[_0xa662('0xf8')][_0xa662('0x115')](db[_0xa662('0xe7')],{'as':_0xa662('0x157'),'foreignKey':'ListId'});db[_0xa662('0xf8')][_0xa662('0x115')](db['CmContact'],{'as':_0xa662('0x150'),'foreignKey':_0xa662('0x151')});db[_0xa662('0xf8')][_0xa662('0x115')](db['WhatsappInteraction'],{});db[_0xa662('0xf8')][_0xa662('0x115')](db[_0xa662('0xfc')],{});db[_0xa662('0xf8')]['belongsTo'](db[_0xa662('0x1e6')],{});db[_0xa662('0xf8')]['belongsTo'](db[_0xa662('0x101')],{});db[_0xa662('0xfa')][_0xa662('0x115')](db['WhatsappMessage'],{});db[_0xa662('0xfa')]['belongsTo'](db[_0xa662('0xf5')],{});db[_0xa662('0xfa')][_0xa662('0x115')](db[_0xa662('0xf1')],{'foreignKey':'FromWhatsappAccountId','as':_0xa662('0x1ca')});db[_0xa662('0xfa')]['belongsTo'](db[_0xa662('0xf1')],{'foreignKey':_0xa662('0x1e8'),'as':_0xa662('0x1cf')});db[_0xa662('0xfa')][_0xa662('0x115')](db[_0xa662('0xfc')],{'foreignKey':_0xa662('0x1e9'),'as':_0xa662('0x1d4')});db[_0xa662('0xfa')][_0xa662('0x115')](db['User'],{'foreignKey':_0xa662('0x1cb'),'as':_0xa662('0x1cc')});db['WhatsappTransferReport'][_0xa662('0x115')](db[_0xa662('0x101')],{'foreignKey':'ToUserId','as':_0xa662('0x1cd')});db[_0xa662('0xfc')][_0xa662('0x117')](db[_0xa662('0x101')],{'as':_0xa662('0x148'),'through':_0xa662('0x12a'),'foreignKey':_0xa662('0x1ea')});db[_0xa662('0xfc')][_0xa662('0x117')](db[_0xa662('0xd7')],{'through':_0xa662('0x1c4'),'as':'Teams'});module[_0xa662('0x1eb')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 1ad3887..4a2eb32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4273=['/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatInteraction','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperHistory','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./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/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','/demo','static','/snippet','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','username','password','newPassword','apiKey','lastName','street','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','exten','clientEmail','accesskeyid','secretaccesskey','pass','localstationid','secret','registry','isPlainObject','isArray','replace','@@{','}@@','includes','lodash','path','express-winston','util','./errors','./config/environment','./config/logger','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','name','user','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','role','agent_name','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./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/voiceQueueReport','./api/memberReport','./api/trunk','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/queues','./api/smsQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4273,0xf2));var _0x3427=function(_0x153ad9,_0x2e36e1){_0x153ad9=_0x153ad9-0x0;var _0x163760=_0x4273[_0x153ad9];return _0x163760;};'use strict';var _=require(_0x3427('0x0'));var path=require(_0x3427('0x1'));var express=require('express');var ewinston=require(_0x3427('0x2'));var util=require(_0x3427('0x3'));var errors=require(_0x3427('0x4'));var config=require(_0x3427('0x5'));var logger=require(_0x3427('0x6'))('api');var authLogger=require(_0x3427('0x6'))(_0x3427('0x7'));exports[_0x3427('0x8')]=function(_0x5e3fea){_0x5e3fea['use'](ewinston[_0x3427('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5bc392,_0x82dd47){var _0x107af8=_0x3427('0xa');if(!_[_0x3427('0xb')](_0x5bc392['body'])){_0x107af8+=_0x3427('0xc');var _0x33e330=_0x5bc392[_0x3427('0xd')];maskSensitiveData(_0x33e330);}return util['format'](_0x107af8,_0x5bc392['method'],_0x5bc392[_0x3427('0xe')][_0x3427('0xf')]?_0x5bc392[_0x3427('0xe')][_0x3427('0xf')]:_0x5bc392[_0x3427('0x10')][_0x3427('0x11')]||_0x5bc392['ip'],_0x5bc392[_0x3427('0x12')],_0x82dd47[_0x3427('0x13')],_0x82dd47['responseTime'],_0x5bc392['user']?_0x5bc392['user']['id']:null,_0x5bc392['user']?_0x5bc392['user'][_0x3427('0x14')]:null,_0x5bc392[_0x3427('0x15')]?_0x5bc392['user']['role']:null,_0x33e330?util[_0x3427('0x16')](_0x33e330,![],null):'');}}));_0x5e3fea[_0x3427('0x17')](ewinston[_0x3427('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x16ef28,_0x22cbce){var _0x44c299=_0x3427('0x18');if(_0x16ef28[_0x3427('0xd')]&&_0x16ef28[_0x3427('0xd')][_0x3427('0x19')]&&_0x16ef28[_0x3427('0xd')][_0x3427('0x1a')]){_0x44c299=_0x3427('0x1b');}return util[_0x3427('0x1c')](_0x44c299,_0x16ef28[_0x3427('0x1d')],_0x16ef28['headers'][_0x3427('0xf')]?_0x16ef28['headers']['x-forwarded-for']:_0x16ef28[_0x3427('0x10')]['remoteAddress']||_0x16ef28['ip'],_0x16ef28['url'],_0x22cbce[_0x3427('0x13')],_0x22cbce['responseTime'],_0x16ef28[_0x3427('0x15')]?_0x16ef28[_0x3427('0x15')]['id']:null,_0x16ef28[_0x3427('0x15')]?_0x16ef28[_0x3427('0x15')][_0x3427('0x14')]:null,_0x16ef28['user']?_0x16ef28[_0x3427('0x15')][_0x3427('0x1e')]:null,_0x16ef28[_0x3427('0xd')]&&_0x16ef28[_0x3427('0xd')]['device']?_0x16ef28['body']['device']:'other',_0x16ef28[_0x3427('0xd')]&&_0x16ef28[_0x3427('0xd')][_0x3427('0x1a')]?_0x16ef28[_0x3427('0xd')][_0x3427('0x1a')]:'',_0x16ef28[_0x3427('0xd')]&&_0x16ef28[_0x3427('0xd')][_0x3427('0x1f')]?_0x16ef28[_0x3427('0xd')]['agent_name']:'');},'ignoreRoute':function(_0x4e9678){var _0x388cda=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x388cda['test'](_0x4e9678[_0x3427('0x12')]);}}));_0x5e3fea[_0x3427('0x17')]('/api/users',require('./api/user'));_0x5e3fea[_0x3427('0x17')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x5e3fea['use'](_0x3427('0x20'),require(_0x3427('0x21')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x22'),require(_0x3427('0x23')));_0x5e3fea[_0x3427('0x17')]('/api/voice/mohs',require(_0x3427('0x24')));_0x5e3fea['use'](_0x3427('0x25'),require(_0x3427('0x26')));_0x5e3fea[_0x3427('0x17')]('/api/voice/recordings',require(_0x3427('0x27')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x28'),require(_0x3427('0x29')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x2a'),require(_0x3427('0x2b')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x2c'),require(_0x3427('0x2d')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x2e'),require(_0x3427('0x2f')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x30'),require(_0x3427('0x31')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x32'),require(_0x3427('0x33')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x34'),require(_0x3427('0x35')));_0x5e3fea[_0x3427('0x17')]('/api/members/reports',require(_0x3427('0x36')));_0x5e3fea[_0x3427('0x17')]('/api/trunks',require(_0x3427('0x37')));_0x5e3fea[_0x3427('0x17')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x5e3fea[_0x3427('0x17')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x38'),require('./api/mailAccount'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x39'),require(_0x3427('0x3a')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x3b'),require('./api/mailSubstatus'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x3c'),require('./api/mailInteraction'));_0x5e3fea['use']('/api/mail/messages',require(_0x3427('0x3d')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x3e'),require(_0x3427('0x3f')));_0x5e3fea['use'](_0x3427('0x40'),require(_0x3427('0x41')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x42'),require(_0x3427('0x43')));_0x5e3fea[_0x3427('0x17')]('/api/dashboards/items',require(_0x3427('0x44')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x45'),require(_0x3427('0x46')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x47'),require('./api/faxApplication'));_0x5e3fea['use']('/api/fax/interactions',require(_0x3427('0x48')));_0x5e3fea[_0x3427('0x17')]('/api/fax/messages',require(_0x3427('0x49')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x4a'),require(_0x3427('0x4b')));_0x5e3fea[_0x3427('0x17')]('/api/fax/reports/queue',require(_0x3427('0x4c')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x4d'),require(_0x3427('0x4e')));_0x5e3fea['use'](_0x3427('0x4f'),require(_0x3427('0x50')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x51'),require('./api/smsInteraction'));_0x5e3fea[_0x3427('0x17')]('/api/sms/messages',require('./api/smsMessage'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x52'),require(_0x3427('0x53')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x54'),require(_0x3427('0x55')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x56'),require(_0x3427('0x57')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x58'),require('./api/openchannelInteraction'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x59'),require('./api/openchannelMessage'));_0x5e3fea['use'](_0x3427('0x5a'),require(_0x3427('0x5b')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x5c'),require(_0x3427('0x5d')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x5e'),require(_0x3427('0x5f')));_0x5e3fea[_0x3427('0x17')]('/api/chat/applications',require('./api/chatApplication'));_0x5e3fea[_0x3427('0x17')]('/api/chat/interactions',require(_0x3427('0x60')));_0x5e3fea['use']('/api/chat/messages',require('./api/chatMessage'));_0x5e3fea['use'](_0x3427('0x61'),require('./api/chatOfflineMessage'));_0x5e3fea['use']('/api/chat/queues',require(_0x3427('0x62')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x63'),require(_0x3427('0x64')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x65'),require(_0x3427('0x66')));_0x5e3fea[_0x3427('0x17')]('/api/cm/companies',require(_0x3427('0x67')));_0x5e3fea['use'](_0x3427('0x68'),require(_0x3427('0x69')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x6a'),require(_0x3427('0x6b')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x6c'),require(_0x3427('0x6d')));_0x5e3fea['use'](_0x3427('0x6e'),require('./api/cmHopperFinal'));_0x5e3fea[_0x3427('0x17')]('/api/cm/hopper_history',require(_0x3427('0x6f')));_0x5e3fea[_0x3427('0x17')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x5e3fea[_0x3427('0x17')]('/api/actions',require('./api/action'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x70'),require(_0x3427('0x71')));_0x5e3fea[_0x3427('0x17')]('/api/canned_answers',require('./api/cannedAnswer'));_0x5e3fea[_0x3427('0x17')](_0x3427('0x72'),require(_0x3427('0x73')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x74'),require(_0x3427('0x75')));_0x5e3fea['use'](_0x3427('0x76'),require(_0x3427('0x77')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x78'),require(_0x3427('0x79')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x7a'),require('./api/cdr'));_0x5e3fea['use'](_0x3427('0x7b'),require(_0x3427('0x7c')));_0x5e3fea[_0x3427('0x17')]('/api/schedules',require(_0x3427('0x7d')));_0x5e3fea['use']('/api/sounds',require(_0x3427('0x7e')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x7f'),require(_0x3427('0x80')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x81'),require('./api/template'));_0x5e3fea['use'](_0x3427('0x82'),require(_0x3427('0x83')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x84'),require(_0x3427('0x85')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x86'),require(_0x3427('0x87')));_0x5e3fea['use'](_0x3427('0x88'),require(_0x3427('0x89')));_0x5e3fea['use']('/api/analytics/custom_reports',require(_0x3427('0x8a')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x8b'),require(_0x3427('0x8c')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x8d'),require(_0x3427('0x8e')));_0x5e3fea['use'](_0x3427('0x8f'),require(_0x3427('0x90')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x91'),require(_0x3427('0x92')));_0x5e3fea[_0x3427('0x17')]('/api/analytics/tree_reports',require(_0x3427('0x93')));_0x5e3fea['use'](_0x3427('0x94'),require(_0x3427('0x95')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x96'),require(_0x3427('0x97')));_0x5e3fea[_0x3427('0x17')]('/api/integrations/salesforce/fields',require(_0x3427('0x98')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x99'),require(_0x3427('0x9a')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x9b'),require(_0x3427('0x9c')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x9d'),require(_0x3427('0x9e')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x9f'),require('./api/intDeskAccount'));_0x5e3fea[_0x3427('0x17')](_0x3427('0xa0'),require('./api/intDeskConfiguration'));_0x5e3fea[_0x3427('0x17')]('/api/integrations/desk/fields',require(_0x3427('0xa1')));_0x5e3fea['use']('/api/integrations/zoho/accounts',require(_0x3427('0xa2')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xa3'),require('./api/intZohoConfiguration'));_0x5e3fea['use'](_0x3427('0xa4'),require(_0x3427('0xa5')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xa6'),require(_0x3427('0xa7')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xa8'),require('./api/intZendeskConfiguration'));_0x5e3fea[_0x3427('0x17')](_0x3427('0xa9'),require(_0x3427('0xaa')));_0x5e3fea['use'](_0x3427('0xab'),require(_0x3427('0xac')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xad'),require(_0x3427('0xae')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xaf'),require(_0x3427('0xb0')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xb1'),require(_0x3427('0xb2')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xb3'),require(_0x3427('0xb4')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xb5'),require(_0x3427('0xb6')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xb7'),require(_0x3427('0xb8')));_0x5e3fea[_0x3427('0x17')]('/api/integrations/servicenow/configurations',require(_0x3427('0xb9')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xba'),require(_0x3427('0xbb')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xbc'),require(_0x3427('0xbd')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xbe'),require(_0x3427('0xbf')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xc0'),require(_0x3427('0xc1')));_0x5e3fea['use'](_0x3427('0xc2'),require(_0x3427('0xc3')));_0x5e3fea['use'](_0x3427('0xc4'),require(_0x3427('0xc5')));_0x5e3fea[_0x3427('0x17')]('/api/integrations/freshsales/fields',require(_0x3427('0xc6')));_0x5e3fea[_0x3427('0x17')]('/api/networks',require(_0x3427('0xc7')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xc8'),require(_0x3427('0xc9')));_0x5e3fea['use'](_0x3427('0xca'),require(_0x3427('0xcb')));_0x5e3fea['use'](_0x3427('0xcc'),require(_0x3427('0xcd')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xce'),require(_0x3427('0xcf')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xd0'),require(_0x3427('0xd1')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xd2'),require(_0x3427('0xd3')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xd4'),require(_0x3427('0xd5')));_0x5e3fea['use']('/api/square/details/reports',require('./api/squareReportDetail'));_0x5e3fea[_0x3427('0x17')](_0x3427('0xd6'),require(_0x3427('0xd7')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xd8'),require(_0x3427('0xd9')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xda'),require(_0x3427('0xdb')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xdc'),require('./api/squareProject'));_0x5e3fea['use'](_0x3427('0xdd'),require(_0x3427('0xde')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xdf'),require(_0x3427('0xe0')));_0x5e3fea['use'](_0x3427('0xe1'),require(_0x3427('0xe2')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xe3'),require(_0x3427('0xe4')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xe5'),require('./api/campaign'));_0x5e3fea[_0x3427('0x17')](_0x3427('0xe6'),require(_0x3427('0xe7')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xe8'),require(_0x3427('0xe9')));_0x5e3fea['use'](_0x3427('0xea'),require('./api/plugin'));_0x5e3fea['use'](_0x3427('0xeb'),require(_0x3427('0xec')));_0x5e3fea[_0x3427('0x17')]('/api/chat/reports/transfer',require(_0x3427('0xed')));_0x5e3fea['use']('/api/fax/reports/transfer',require(_0x3427('0xee')));_0x5e3fea['use'](_0x3427('0xef'),require(_0x3427('0xf0')));_0x5e3fea[_0x3427('0x17')]('/api/sms/reports/transfer',require(_0x3427('0xf1')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xf2'),require('./api/cmList'));_0x5e3fea[_0x3427('0x17')](_0x3427('0xf3'),require(_0x3427('0xf4')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xf5'),require(_0x3427('0xf6')));_0x5e3fea[_0x3427('0x17')]('/api/userProfile/sections',require(_0x3427('0xf7')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xf8'),require(_0x3427('0xf9')));_0x5e3fea['use'](_0x3427('0xfa'),require(_0x3427('0xfb')));_0x5e3fea[_0x3427('0x17')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x5e3fea[_0x3427('0x17')]('/api/whatsapp/applications',require('./api/whatsappApplication'));_0x5e3fea[_0x3427('0x17')](_0x3427('0xfc'),require('./api/whatsappInteraction'));_0x5e3fea[_0x3427('0x17')]('/api/whatsapp/messages',require(_0x3427('0xfd')));_0x5e3fea[_0x3427('0x17')](_0x3427('0xfe'),require(_0x3427('0xff')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x100'),require(_0x3427('0x101')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x102'),require(_0x3427('0x103')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x104'),require(_0x3427('0x105')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x106'),require(_0x3427('0x107')));_0x5e3fea['use']('/api/auth/local',require(_0x3427('0x108')));_0x5e3fea[_0x3427('0x17')]('/api/auth/google',require(_0x3427('0x109')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x10a'),require(_0x3427('0x10b')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x10c'),require(_0x3427('0x10d')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x10e'),require(_0x3427('0x10f')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x110'),require(_0x3427('0x111')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x112'),require('./api/pm2'));_0x5e3fea['use'](_0x3427('0x113'),require(_0x3427('0x114')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x115'),express['static'](path[_0x3427('0x116')](config[_0x3427('0x117')],'/apidoc')));_0x5e3fea[_0x3427('0x17')](_0x3427('0x118'),express['static'](path[_0x3427('0x116')](config[_0x3427('0x117')],_0x3427('0x118'))));_0x5e3fea[_0x3427('0x17')](_0x3427('0x119'),express[_0x3427('0x11a')](path[_0x3427('0x116')](config[_0x3427('0x117')],_0x3427('0x119'))));_0x5e3fea[_0x3427('0x17')](_0x3427('0x11b'),express['static'](path[_0x3427('0x116')](config['root'],_0x3427('0x11c'),_0x3427('0x11d'))));_0x5e3fea[_0x3427('0x17')]('/plugins',express[_0x3427('0x11a')](path[_0x3427('0x116')](config['root'],_0x3427('0x11e'))));_0x5e3fea[_0x3427('0x11f')](_0x3427('0x120'))[_0x3427('0x121')](errors[0x194]);_0x5e3fea[_0x3427('0x11f')]('/*')[_0x3427('0x121')](function(_0x3e0af3,_0x3b4560){_0x3b4560['sendFile'](path[_0x3427('0x122')](_0x5e3fea[_0x3427('0x121')](_0x3427('0x123'))+'/index.html'));});};var sensitiveFields=[_0x3427('0x124'),_0x3427('0x125'),_0x3427('0x126'),_0x3427('0x127'),'firstName',_0x3427('0x128'),_0x3427('0x129'),'phone',_0x3427('0x12a'),_0x3427('0x12b'),'email',_0x3427('0x12c'),_0x3427('0x12d'),_0x3427('0x12e'),_0x3427('0x12f'),_0x3427('0x130'),_0x3427('0x131'),'token',_0x3427('0x132'),_0x3427('0x133'),_0x3427('0x134'),_0x3427('0x135'),_0x3427('0x136'),'consumerSecret','membername',_0x3427('0x137'),'calleridnum',_0x3427('0x138'),'vidaooApiKey',_0x3427('0x139'),'privateKey',_0x3427('0x13a'),_0x3427('0x13b'),'key',_0x3427('0x15'),_0x3427('0x13c'),'accountSid',_0x3427('0x13d'),'dsn',_0x3427('0x13e'),_0x3427('0x13f'),'oldPassword'];function maskSensitiveData(_0x1754a4){var _0x1f36c2=/(?!^)[\s\S](?!$)/g;if(!_[_0x3427('0x140')](_0x1754a4))return;for(var _0x416358 in _0x1754a4){if(_[_0x3427('0x141')](_0x1754a4[_0x416358])){for(var _0x5c22c2=0x0;_0x5c22c2<_0x1754a4[_0x416358]['length'];_0x5c22c2++){maskSensitiveData(_0x1754a4[_0x416358][_0x5c22c2]);}}else if(_['isPlainObject'](_0x1754a4[_0x416358])){maskSensitiveData(_0x1754a4[_0x416358]);}else if(_['isString'](_0x1754a4[_0x416358])){_0x1754a4[_0x416358]=_0x1754a4[_0x416358][_0x3427('0x142')](/{{{/g,_0x3427('0x143'))[_0x3427('0x142')](/}}}/g,_0x3427('0x144'))[_0x3427('0x142')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x3427('0x145')](sensitiveFields,_0x416358)){_0x1754a4[_0x416358]=_0x1754a4[_0x416358][_0x3427('0x142')](_0x1f36c2,'*');}}}}
\ No newline at end of file
+var _0x53ad=['/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./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/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/auth/local','./api/authLocal','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','/index.html','username','password','apiKey','firstName','lastName','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','isArray','length','replace','@@{','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceAgentReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport'];(function(_0x2ecfdc,_0x5d1ced){var _0x526ccc=function(_0x40fe7f){while(--_0x40fe7f){_0x2ecfdc['push'](_0x2ecfdc['shift']());}};_0x526ccc(++_0x5d1ced);}(_0x53ad,0xb2));var _0xd53a=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x53ad[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var path=require(_0xd53a('0x0'));var express=require(_0xd53a('0x1'));var ewinston=require(_0xd53a('0x2'));var util=require(_0xd53a('0x3'));var errors=require(_0xd53a('0x4'));var config=require(_0xd53a('0x5'));var logger=require('./config/logger')(_0xd53a('0x6'));var authLogger=require(_0xd53a('0x7'))('auth');exports['default']=function(_0x250e42){_0x250e42[_0xd53a('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x48a570,_0x4c984b){var _0x57aaa0=_0xd53a('0x9');if(!_[_0xd53a('0xa')](_0x48a570[_0xd53a('0xb')])){_0x57aaa0+=_0xd53a('0xc');var _0xe04662=_0x48a570[_0xd53a('0xb')];maskSensitiveData(_0xe04662);}return util[_0xd53a('0xd')](_0x57aaa0,_0x48a570[_0xd53a('0xe')],_0x48a570[_0xd53a('0xf')][_0xd53a('0x10')]?_0x48a570[_0xd53a('0xf')]['x-forwarded-for']:_0x48a570[_0xd53a('0x11')][_0xd53a('0x12')]||_0x48a570['ip'],_0x48a570[_0xd53a('0x13')],_0x4c984b[_0xd53a('0x14')],_0x4c984b[_0xd53a('0x15')],_0x48a570[_0xd53a('0x16')]?_0x48a570[_0xd53a('0x16')]['id']:null,_0x48a570[_0xd53a('0x16')]?_0x48a570[_0xd53a('0x16')][_0xd53a('0x17')]:null,_0x48a570['user']?_0x48a570[_0xd53a('0x16')]['role']:null,_0xe04662?util[_0xd53a('0x18')](_0xe04662,![],null):'');}}));_0x250e42[_0xd53a('0x8')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x418475,_0x4d896f){var _0x25b421=_0xd53a('0x19');if(_0x418475[_0xd53a('0xb')]&&_0x418475[_0xd53a('0xb')][_0xd53a('0x1a')]&&_0x418475[_0xd53a('0xb')][_0xd53a('0x1b')]){_0x25b421=_0xd53a('0x1c');}return util['format'](_0x25b421,_0x418475[_0xd53a('0xe')],_0x418475[_0xd53a('0xf')][_0xd53a('0x10')]?_0x418475[_0xd53a('0xf')]['x-forwarded-for']:_0x418475[_0xd53a('0x11')]['remoteAddress']||_0x418475['ip'],_0x418475[_0xd53a('0x13')],_0x4d896f[_0xd53a('0x14')],_0x4d896f[_0xd53a('0x15')],_0x418475[_0xd53a('0x16')]?_0x418475[_0xd53a('0x16')]['id']:null,_0x418475[_0xd53a('0x16')]?_0x418475['user']['name']:null,_0x418475[_0xd53a('0x16')]?_0x418475[_0xd53a('0x16')]['role']:null,_0x418475[_0xd53a('0xb')]&&_0x418475[_0xd53a('0xb')][_0xd53a('0x1a')]?_0x418475['body'][_0xd53a('0x1a')]:_0xd53a('0x1d'),_0x418475['body']&&_0x418475[_0xd53a('0xb')][_0xd53a('0x1b')]?_0x418475[_0xd53a('0xb')][_0xd53a('0x1b')]:'',_0x418475[_0xd53a('0xb')]&&_0x418475[_0xd53a('0xb')]['agent_name']?_0x418475[_0xd53a('0xb')][_0xd53a('0x1e')]:'');},'ignoreRoute':function(_0x38773d){var _0x2cd15b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2cd15b[_0xd53a('0x1f')](_0x38773d[_0xd53a('0x13')]);}}));_0x250e42[_0xd53a('0x8')]('/api/users',require('./api/user'));_0x250e42['use'](_0xd53a('0x20'),require(_0xd53a('0x21')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x22'),require(_0xd53a('0x23')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x24'),require(_0xd53a('0x25')));_0x250e42['use']('/api/voice/mohs',require(_0xd53a('0x26')));_0x250e42['use'](_0xd53a('0x27'),require('./api/voiceQueue'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x28'),require(_0xd53a('0x29')));_0x250e42[_0xd53a('0x8')]('/api/screen/recordings',require(_0xd53a('0x2a')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x2b'),require(_0xd53a('0x2c')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x2d'),require(_0xd53a('0x2e')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x2f'),require(_0xd53a('0x30')));_0x250e42[_0xd53a('0x8')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x250e42[_0xd53a('0x8')]('/api/voice/agents/reports',require(_0xd53a('0x31')));_0x250e42[_0xd53a('0x8')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x32'),require(_0xd53a('0x33')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x34'),require(_0xd53a('0x35')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x36'),require(_0xd53a('0x37')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x38'),require('./api/mailServerOut'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x39'),require(_0xd53a('0x3a')));_0x250e42['use'](_0xd53a('0x3b'),require(_0xd53a('0x3c')));_0x250e42['use'](_0xd53a('0x3d'),require(_0xd53a('0x3e')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x3f'),require('./api/mailInteraction'));_0x250e42['use'](_0xd53a('0x40'),require(_0xd53a('0x41')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x42'),require(_0xd53a('0x43')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x44'),require(_0xd53a('0x45')));_0x250e42['use'](_0xd53a('0x46'),require(_0xd53a('0x47')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x48'),require('./api/dashboardItem'));_0x250e42['use']('/api/fax/accounts',require(_0xd53a('0x49')));_0x250e42['use'](_0xd53a('0x4a'),require(_0xd53a('0x4b')));_0x250e42[_0xd53a('0x8')]('/api/fax/interactions',require(_0xd53a('0x4c')));_0x250e42[_0xd53a('0x8')]('/api/fax/messages',require('./api/faxMessage'));_0x250e42[_0xd53a('0x8')]('/api/fax/queues',require(_0xd53a('0x4d')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x4e'),require(_0xd53a('0x4f')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x50'),require('./api/smsAccount'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x51'),require(_0xd53a('0x52')));_0x250e42['use'](_0xd53a('0x53'),require('./api/smsInteraction'));_0x250e42['use']('/api/sms/messages',require(_0xd53a('0x54')));_0x250e42['use'](_0xd53a('0x55'),require(_0xd53a('0x56')));_0x250e42['use'](_0xd53a('0x57'),require(_0xd53a('0x58')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x59'),require(_0xd53a('0x5a')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x5b'),require(_0xd53a('0x5c')));_0x250e42[_0xd53a('0x8')]('/api/openchannel/messages',require(_0xd53a('0x5d')));_0x250e42['use'](_0xd53a('0x5e'),require(_0xd53a('0x5f')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x60'),require(_0xd53a('0x61')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x62'),require('./api/openchannelQueueReport'));_0x250e42[_0xd53a('0x8')]('/api/chat/applications',require(_0xd53a('0x63')));_0x250e42['use'](_0xd53a('0x64'),require(_0xd53a('0x65')));_0x250e42['use'](_0xd53a('0x66'),require(_0xd53a('0x67')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x68'),require(_0xd53a('0x69')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x6a'),require(_0xd53a('0x6b')));_0x250e42[_0xd53a('0x8')]('/api/chat/groups',require(_0xd53a('0x6c')));_0x250e42['use'](_0xd53a('0x6d'),require(_0xd53a('0x6e')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x6f'),require(_0xd53a('0x70')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x71'),require(_0xd53a('0x72')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x73'),require(_0xd53a('0x74')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x75'),require(_0xd53a('0x76')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x77'),require(_0xd53a('0x78')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x79'),require(_0xd53a('0x7a')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x7b'),require(_0xd53a('0x7c')));_0x250e42['use'](_0xd53a('0x7d'),require('./api/action'));_0x250e42[_0xd53a('0x8')]('/api/automations',require(_0xd53a('0x7e')));_0x250e42['use']('/api/canned_answers',require(_0xd53a('0x7f')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x80'),require(_0xd53a('0x81')));_0x250e42[_0xd53a('0x8')]('/api/conditions',require(_0xd53a('0x82')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x83'),require(_0xd53a('0x84')));_0x250e42[_0xd53a('0x8')]('/api/pauses',require('./api/pause'));_0x250e42['use']('/api/cdr',require(_0xd53a('0x85')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x86'),require(_0xd53a('0x87')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x88'),require('./api/schedule'));_0x250e42[_0xd53a('0x8')]('/api/sounds',require(_0xd53a('0x89')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x8a'),require(_0xd53a('0x8b')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x8c'),require(_0xd53a('0x8d')));_0x250e42['use']('/api/triggers',require(_0xd53a('0x8e')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x8f'),require('./api/variable'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x90'),require('./api/integration'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x91'),require('./api/integrationReport'));_0x250e42[_0xd53a('0x8')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x250e42[_0xd53a('0x8')]('/api/analytics/default_reports',require(_0xd53a('0x92')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x93'),require('./api/analyticExtractedReport'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x94'),require(_0xd53a('0x95')));_0x250e42[_0xd53a('0x8')]('/api/analytics/field_reports',require(_0xd53a('0x96')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x97'),require(_0xd53a('0x98')));_0x250e42['use']('/api/integrations/salesforce/accounts',require(_0xd53a('0x99')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x9a'),require('./api/intSalesforceConfiguration'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x9b'),require(_0xd53a('0x9c')));_0x250e42['use'](_0xd53a('0x9d'),require(_0xd53a('0x9e')));_0x250e42[_0xd53a('0x8')]('/api/integrations/sugarcrm/configurations',require(_0xd53a('0x9f')));_0x250e42['use'](_0xd53a('0xa0'),require(_0xd53a('0xa1')));_0x250e42[_0xd53a('0x8')]('/api/integrations/desk/accounts',require(_0xd53a('0xa2')));_0x250e42['use'](_0xd53a('0xa3'),require(_0xd53a('0xa4')));_0x250e42[_0xd53a('0x8')]('/api/integrations/desk/fields',require(_0xd53a('0xa5')));_0x250e42[_0xd53a('0x8')]('/api/integrations/zoho/accounts',require(_0xd53a('0xa6')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xa7'),require(_0xd53a('0xa8')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xa9'),require('./api/intZohoField'));_0x250e42[_0xd53a('0x8')](_0xd53a('0xaa'),require('./api/intZendeskAccount'));_0x250e42['use']('/api/integrations/zendesk/configurations',require(_0xd53a('0xab')));_0x250e42['use'](_0xd53a('0xac'),require(_0xd53a('0xad')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xae'),require(_0xd53a('0xaf')));_0x250e42['use'](_0xd53a('0xb0'),require(_0xd53a('0xb1')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xb2'),require(_0xd53a('0xb3')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xb4'),require(_0xd53a('0xb5')));_0x250e42['use']('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x250e42[_0xd53a('0x8')](_0xd53a('0xb6'),require(_0xd53a('0xb7')));_0x250e42[_0xd53a('0x8')]('/api/integrations/servicenow/accounts',require(_0xd53a('0xb8')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xb9'),require(_0xd53a('0xba')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xbb'),require(_0xd53a('0xbc')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xbd'),require('./api/intDynamics365Account'));_0x250e42[_0xd53a('0x8')](_0xd53a('0xbe'),require(_0xd53a('0xbf')));_0x250e42[_0xd53a('0x8')]('/api/integrations/dynamics365/fields',require(_0xd53a('0xc0')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xc1'),require('./api/intFreshsalesAccount'));_0x250e42[_0xd53a('0x8')]('/api/integrations/freshsales/configurations',require(_0xd53a('0xc2')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xc3'),require(_0xd53a('0xc4')));_0x250e42['use'](_0xd53a('0xc5'),require(_0xd53a('0xc6')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xc7'),require(_0xd53a('0xc8')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xc9'),require(_0xd53a('0xca')));_0x250e42['use'](_0xd53a('0xcb'),require('./api/jscriptyAnswerReport'));_0x250e42[_0xd53a('0x8')](_0xd53a('0xcc'),require(_0xd53a('0xcd')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xce'),require(_0xd53a('0xcf')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xd0'),require('./api/smsQueueReport'));_0x250e42['use'](_0xd53a('0xd1'),require(_0xd53a('0xd2')));_0x250e42[_0xd53a('0x8')]('/api/square/details/reports',require(_0xd53a('0xd3')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xd4'),require(_0xd53a('0xd5')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xd6'),require(_0xd53a('0xd7')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xd8'),require(_0xd53a('0xd9')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xda'),require(_0xd53a('0xdb')));_0x250e42[_0xd53a('0x8')]('/api/square/recordings',require(_0xd53a('0xdc')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xdd'),require(_0xd53a('0xde')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xdf'),require(_0xd53a('0xe0')));_0x250e42['use'](_0xd53a('0xe1'),require(_0xd53a('0xe2')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xe3'),require(_0xd53a('0xe4')));_0x250e42['use'](_0xd53a('0xe5'),require(_0xd53a('0xe6')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xe7'),require(_0xd53a('0xe8')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xe9'),require(_0xd53a('0xea')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xeb'),require('./api/mailTransferReport'));_0x250e42[_0xd53a('0x8')](_0xd53a('0xec'),require(_0xd53a('0xed')));_0x250e42[_0xd53a('0x8')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x250e42['use'](_0xd53a('0xee'),require(_0xd53a('0xef')));_0x250e42[_0xd53a('0x8')]('/api/sms/reports/transfer',require(_0xd53a('0xf0')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xf1'),require('./api/cmList'));_0x250e42['use'](_0xd53a('0xf2'),require('./api/voicePrefix'));_0x250e42[_0xd53a('0x8')](_0xd53a('0xf3'),require(_0xd53a('0xf4')));_0x250e42[_0xd53a('0x8')]('/api/userProfile/sections',require(_0xd53a('0xf5')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xf6'),require(_0xd53a('0xf7')));_0x250e42[_0xd53a('0x8')]('/api/userNotifications',require(_0xd53a('0xf8')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xf9'),require(_0xd53a('0xfa')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xfb'),require(_0xd53a('0xfc')));_0x250e42[_0xd53a('0x8')](_0xd53a('0xfd'),require(_0xd53a('0xfe')));_0x250e42['use']('/api/whatsapp/messages',require(_0xd53a('0xff')));_0x250e42[_0xd53a('0x8')]('/api/whatsapp/reports/queue',require(_0xd53a('0x100')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x101'),require(_0xd53a('0x102')));_0x250e42['use'](_0xd53a('0x103'),require(_0xd53a('0x104')));_0x250e42['use'](_0xd53a('0x105'),require(_0xd53a('0x106')));_0x250e42['use']('/api/realtime',require(_0xd53a('0x107')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x108'),require(_0xd53a('0x109')));_0x250e42[_0xd53a('0x8')]('/api/auth/google',require(_0xd53a('0x10a')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x10b'),require(_0xd53a('0x10c')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x10d'),require('./api/rpc'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x10e'),require(_0xd53a('0x10f')));_0x250e42['use'](_0xd53a('0x110'),require(_0xd53a('0x111')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x112'),require('./api/pm2'));_0x250e42[_0xd53a('0x8')](_0xd53a('0x113'),require(_0xd53a('0x114')));_0x250e42[_0xd53a('0x8')](_0xd53a('0x115'),express[_0xd53a('0x116')](path[_0xd53a('0x117')](config[_0xd53a('0x118')],_0xd53a('0x115'))));_0x250e42[_0xd53a('0x8')](_0xd53a('0x119'),express['static'](path[_0xd53a('0x117')](config['root'],_0xd53a('0x119'))));_0x250e42[_0xd53a('0x8')]('/demo',express['static'](path['join'](config[_0xd53a('0x118')],'/demo')));_0x250e42['use'](_0xd53a('0x11a'),express['static'](path[_0xd53a('0x117')](config[_0xd53a('0x118')],_0xd53a('0x11b'),'3.0.0')));_0x250e42['use'](_0xd53a('0x11c'),express[_0xd53a('0x116')](path[_0xd53a('0x117')](config[_0xd53a('0x118')],_0xd53a('0x11d'))));_0x250e42[_0xd53a('0x11e')](_0xd53a('0x11f'))['get'](errors[0x194]);_0x250e42[_0xd53a('0x11e')]('/*')[_0xd53a('0x120')](function(_0x352f96,_0x290472){_0x290472['sendFile'](path[_0xd53a('0x121')](_0x250e42[_0xd53a('0x120')]('appPath')+_0xd53a('0x122')));});};var sensitiveFields=[_0xd53a('0x123'),_0xd53a('0x124'),'newPassword',_0xd53a('0x125'),_0xd53a('0x126'),_0xd53a('0x127'),'street',_0xd53a('0x128'),_0xd53a('0x129'),_0xd53a('0x12a'),'email',_0xd53a('0x12b'),_0xd53a('0x12c'),_0xd53a('0x12d'),_0xd53a('0x12e'),_0xd53a('0x12f'),'tenantId',_0xd53a('0x130'),'channelSecret',_0xd53a('0x131'),_0xd53a('0x132'),_0xd53a('0x133'),_0xd53a('0x134'),_0xd53a('0x135'),_0xd53a('0x136'),'calleridname',_0xd53a('0x137'),_0xd53a('0x138'),_0xd53a('0x139'),'clientEmail',_0xd53a('0x13a'),_0xd53a('0x13b'),_0xd53a('0x13c'),_0xd53a('0x13d'),_0xd53a('0x16'),_0xd53a('0x13e'),_0xd53a('0x13f'),_0xd53a('0x140'),_0xd53a('0x141'),_0xd53a('0x142'),_0xd53a('0x143'),_0xd53a('0x144')];function maskSensitiveData(_0xeb9daf){var _0x226259=/(?!^)[\s\S](?!$)/g;if(!_['isPlainObject'](_0xeb9daf))return;for(var _0x5de7da in _0xeb9daf){if(_[_0xd53a('0x145')](_0xeb9daf[_0x5de7da])){for(var _0x8c7f9c=0x0;_0x8c7f9c<_0xeb9daf[_0x5de7da][_0xd53a('0x146')];_0x8c7f9c++){maskSensitiveData(_0xeb9daf[_0x5de7da][_0x8c7f9c]);}}else if(_['isPlainObject'](_0xeb9daf[_0x5de7da])){maskSensitiveData(_0xeb9daf[_0x5de7da]);}else if(_['isString'](_0xeb9daf[_0x5de7da])){_0xeb9daf[_0x5de7da]=_0xeb9daf[_0x5de7da][_0xd53a('0x147')](/{{{/g,_0xd53a('0x148'))['replace'](/}}}/g,'}@@')[_0xd53a('0x147')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5de7da)){_0xeb9daf[_0x5de7da]=_0xeb9daf[_0x5de7da][_0xd53a('0x147')](_0x226259,'*');}}}}
\ No newline at end of file
index c9799ed..1794144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d8b=['../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.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/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','port','localhost','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.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'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9d8b,0x1dc));var _0xb9d8=function(_0x3240ff,_0x3b9c3d){_0x3240ff=_0x3240ff-0x0;var _0x514858=_0x9d8b[_0x3240ff];return _0x514858;};'use strict';var jayson=require(_0xb9d8('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xb9d8('0x1'));exports[_0xb9d8('0x2')]=function(){return new BPromise(function(_0x1307cf,_0x4fbc85){var _0x1e0828={};_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x4')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x5')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x6')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x7')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x8')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x9')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0xa')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0xb')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/memberReport/memberReport.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0xc')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0xd')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0xe')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0xf')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x10')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x11')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x12')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x13')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x14')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x15')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x16')));_0x1e0828=_['merge'](_0x1e0828,require('../api/faxApplication/faxApplication.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x17')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/faxMessage/faxMessage.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x18')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x19')));_0x1e0828=_['merge'](_0x1e0828,require('../api/smsAccount/smsAccount.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x1a')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x1b')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x1c')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x1d')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x1e')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x1f')));_0x1e0828=_['merge'](_0x1e0828,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x20')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x21')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/chatMessage/chatMessage.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x22')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x23')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x24')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x25')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x26')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x27')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x28')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x29')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x2a')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/sound/sound.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/template/template.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x2b')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x2c')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x2d')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x2e')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x2f')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x30')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x31')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x32')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x33')));_0x1e0828=_['merge'](_0x1e0828,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x34')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x35')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x36')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x37')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/squareProject/squareProject.rpc'));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x38')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require('../api/squareMessage/squareMessage.rpc'));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x39')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x3a')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x3b')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x3c')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x3d')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x3e')));_0x1e0828=_['merge'](_0x1e0828,require(_0xb9d8('0x3f')));_0x1e0828=_[_0xb9d8('0x3')](_0x1e0828,require(_0xb9d8('0x40')));var _0x22dada=jayson['server'](_0x1e0828)['http']();var _0x3b8bb7=config['rpc']['port']||config[_0xb9d8('0x41')]+0x1;var _0x13ff97=config['rpc']['ip']||_0xb9d8('0x42');_0x22dada['on']('error',function(_0x4e7aa4){return _0x4fbc85(_0x4e7aa4);});_0x22dada['listen'](_0x3b8bb7,_0x13ff97,function(){console['log'](_0xb9d8('0x43'),_0x13ff97,_0x3b8bb7);require(_0xb9d8('0x44'))[_0xb9d8('0x45')]();return _0x1307cf(_0xb9d8('0x46')+_0x13ff97+':'+_0x3b8bb7);});});};
\ No newline at end of file
+var _0xcba6=['default','jayson/promise','bluebird','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/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/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','listen','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers'];(function(_0x5af2fb,_0x2d8cb3){var _0x660927=function(_0x1c7cf7){while(--_0x1c7cf7){_0x5af2fb['push'](_0x5af2fb['shift']());}};_0x660927(++_0x2d8cb3);}(_0xcba6,0xd6));var _0x6cba=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xcba6[_0x68ee8b];return _0x5148f7;};'use strict';var jayson=require(_0x6cba('0x0'));var BPromise=require(_0x6cba('0x1'));var _=require(_0x6cba('0x2'));var config=require(_0x6cba('0x3'));exports['listen']=function(){return new BPromise(function(_0x2d2bd3,_0x437b70){var _0x4a8a3c={};_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/user/user.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x5')));_0x4a8a3c=_['merge'](_0x4a8a3c,require('../api/voiceQueue/voiceQueue.rpc'));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x6')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x7')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x8')));_0x4a8a3c=_['merge'](_0x4a8a3c,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x9')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0xa')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0xb')));_0x4a8a3c=_['merge'](_0x4a8a3c,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0xc')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0xd')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0xe')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0xf')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x10')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/mailApplication/mailApplication.rpc'));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x11')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/faxAccount/faxAccount.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/faxApplication/faxApplication.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x12')));_0x4a8a3c=_['merge'](_0x4a8a3c,require('../api/faxMessage/faxMessage.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x13')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x14')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x15')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x16')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x17')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/smsQueue/smsQueue.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x18')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x19')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x1a')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x1b')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x1c')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x1d')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x1e')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x1f')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x20')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/cmHopper/cmHopper.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x21')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x22')));_0x4a8a3c=_['merge'](_0x4a8a3c,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x23')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x24')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x25')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x26')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x27')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x28')));_0x4a8a3c=_['merge'](_0x4a8a3c,require('../api/variable/variable.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x29')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x2a')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x2b')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x2c')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x2d')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x2e')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x2f')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x30')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x31')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x32')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x33')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/squareReport/squareReport.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x34')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/setting/setting.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x35')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/squareProject/squareProject.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x36')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x37')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x38')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x39')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x3a')));_0x4a8a3c=_['merge'](_0x4a8a3c,require(_0x6cba('0x3b')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x3c')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require(_0x6cba('0x3d')));_0x4a8a3c=_[_0x6cba('0x4')](_0x4a8a3c,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x1ae5e1=jayson[_0x6cba('0x3e')](_0x4a8a3c)[_0x6cba('0x3f')]();var _0x531be7=config[_0x6cba('0x40')][_0x6cba('0x41')]||config[_0x6cba('0x41')]+0x1;var _0x2c8adf=config[_0x6cba('0x40')]['ip']||'localhost';_0x1ae5e1['on'](_0x6cba('0x42'),function(_0x3a52e9){return _0x437b70(_0x3a52e9);});_0x1ae5e1[_0x6cba('0x43')](_0x531be7,_0x2c8adf,function(){console['log'](_0x6cba('0x44'),_0x2c8adf,_0x531be7);require(_0x6cba('0x45'))[_0x6cba('0x46')]();return _0x2d2bd3('RPC\x20listening\x20on\x20'+_0x2c8adf+':'+_0x531be7);});});};
\ No newline at end of file
index 42bb34f..ce3c09d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceca=['E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','HANGUP','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','label','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','emit','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','length','match','error','E_AGI_SOCKET_ERROR','code','close'];(function(_0x164066,_0x1f1d40){var _0xa816f0=function(_0x17b29e){while(--_0x17b29e){_0x164066['push'](_0x164066['shift']());}};_0xa816f0(++_0x1f1d40);}(_0xceca,0xfd));var _0xacec=function(_0x398470,_0x594e95){_0x398470=_0x398470-0x0;var _0x5f1436=_0xceca[_0x398470];return _0x5f1436;};'use strict';var util=require(_0xacec('0x0'));var _=require('lodash');var EventEmitter=require(_0xacec('0x1'))[_0xacec('0x2')];var AGIReply=require(_0xacec('0x3'));var AGIError=require(_0xacec('0x4'));function AGIChannel(_0x12a47a){var _0x30d0f8=this,_0x5716b6=new AGIReply(),_0x5c05a0=![],_0xc31768={};EventEmitter[_0xacec('0x5')](_0x30d0f8);_0x12a47a[_0xacec('0x6')]('utf8');_0x12a47a['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5716b6['setEncoding'](_0xacec('0x7'));_0x5716b6['on'](_0xacec('0x8'),function(_0x159d88){for(var _0xe310c0 in _0x159d88){_0x30d0f8[_0xe310c0]=_0x159d88[_0xe310c0];}_0x30d0f8[_0xacec('0x9')]('ready');});_0x5716b6['on'](_0xacec('0xa'),function(_0xa9324a){if(_0xa9324a[_0xacec('0xb')]()==_0xacec('0xc')){_0x30d0f8['emit'](_0xacec('0xc'));return;}if(_0xa9324a[_0xacec('0xd')](0x0,0xb)==_0xacec('0xe')){_0x5c05a0=!![];}if(_0x5c05a0){_0xc31768['rx']+=_0xa9324a+'\x0a';if(_0xa9324a['search'](_0xacec('0xf'))!=-0x1){_0x5c05a0=![];}}else{_0xc31768['rx']=_0xa9324a;}if(_0x5c05a0){return;}if(typeof _0xc31768['cb']==_0xacec('0x10')){var _0x16ffd9=_0xc31768['rx'][_0xacec('0xd')](0x0,0x3),_0x20bb47=null,_0x19091a=null;_0x16ffd9=parseInt(_0x16ffd9);if(isNaN(_0x16ffd9)){_0xc31768['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xacec('0x11')});return;}if(_0x16ffd9!=0xc8){_0xc31768['cb'](null,{'code':_0x16ffd9,'result':-0x1,'extra':'KO'});return;}_0x20bb47=_0xc31768['rx'][_0xacec('0xd')](0x4)[_0xacec('0x12')](_0xacec('0x13'),'');if(_0x20bb47[_0xacec('0x14')]('\x20')!=-0x1){_0x20bb47=_0x20bb47['substr'](0x0,_0x20bb47[_0xacec('0x14')]('\x20'));}if(_['startsWith'](_0x20bb47,'-1')){_0x20bb47=parseInt(_0x20bb47);}_0x19091a=_0xc31768['rx']['split']('\x20');if(_0x19091a[_0xacec('0x15')]==0x3){_0x19091a=_0x19091a[0x2][_0xacec('0xd')](0x1,_0x19091a[0x2][_0xacec('0x15')]-0x1);}else if(_0x19091a['length']>0x3){var _0x34247e=/\((.+)\)/;var _0x1e40b4=_0xc31768['rx'][_0xacec('0x16')](_0x34247e);if(_0x1e40b4){_0x19091a=_0x1e40b4[0x1];}else{_0x19091a=null;}}else{_0x19091a=null;}_0xc31768['cb'](null,{'code':_0x16ffd9,'result':_0x20bb47,'extra':_0x19091a});}});_0x12a47a['on'](_0xacec('0x17'),function(_0x16cb67){_0x30d0f8[_0xacec('0x9')]('error',new AGIError(_0xacec('0x18'),_0x16cb67[_0xacec('0x19')]));});_0x12a47a['on']('close',function(){_0x30d0f8[_0xacec('0x9')](_0xacec('0x1a'),new AGIError(_0xacec('0x1b')));});_0x12a47a['on'](_0xacec('0x1c'),function(){_0x30d0f8[_0xacec('0x9')](_0xacec('0x1c'),new AGIError(_0xacec('0x1d')));_0x12a47a[_0xacec('0x1e')]();});_0x12a47a[_0xacec('0x1f')](_0x5716b6);this[_0xacec('0x20')]=function(_0x197050,_0x46607f){var _0x197050=_0x197050||'',_0x46607f=typeof _0x46607f=='function'?_0x46607f:new Function();_0xc31768={'tx':_0x197050,'rx':'','cb':_0x46607f};_0x12a47a[_0xacec('0x21')](_0x197050+'\x0a');},this['close']=function(){_0x12a47a['destroy']();};}util[_0xacec('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xacec('0x23')][_0xacec('0x24')]=function(_0x5b720a){return this['command']['sync'](this,_0x5b720a);};AGIChannel[_0xacec('0x23')][_0xacec('0x25')]=function(){return this['sendRequest'](_0xacec('0x26'));};AGIChannel[_0xacec('0x23')][_0xacec('0x27')]=function(_0x3575f5,_0x5cf65d,_0x2ff92f){_0x3575f5=_0x3575f5===undefined?_0xacec('0x28'):_0x3575f5;_0x5cf65d=_0x5cf65d===undefined?'5':_0x5cf65d;_0x2ff92f=_0x2ff92f===undefined?'1':_0x2ff92f;return this['sendRequest'](util[_0xacec('0x29')](_0xacec('0x2a'),_0x3575f5,_0x5cf65d*0x3e8,_0x2ff92f));};AGIChannel[_0xacec('0x23')][_0xacec('0x2b')]=function(_0x48055a){_0x48055a=_0x48055a||'NO\x20MESSAGE';return this[_0xacec('0x24')](util['format'](_0xacec('0x2c'),_0x48055a));};AGIChannel[_0xacec('0x23')][_0xacec('0x2d')]=function(_0x44777,_0x845f31){if(_['isArray'](_0x845f31)){return this['sendRequest'](util['format'](_0xacec('0x2e'),_0x44777,_0x845f31[_0xacec('0x2f')](',')));}return this[_0xacec('0x24')](util['format'](_0xacec('0x2e'),_0x44777,_0x845f31));};AGIChannel[_0xacec('0x23')][_0xacec('0x30')]=function(_0x5b1862){return this[_0xacec('0x24')](util['format'](_0xacec('0x31'),_0x5b1862));};AGIChannel[_0xacec('0x23')]['setExtension']=function(_0x526f8f){return this[_0xacec('0x24')](util[_0xacec('0x29')](_0xacec('0x32'),_0x526f8f));};AGIChannel[_0xacec('0x23')][_0xacec('0x33')]=function(_0x26572b){return this['sendRequest'](util['format']('SET\x20PRIORITY\x20%s',_0x26572b));};AGIChannel['prototype']['hangup']=function(){return this[_0xacec('0x24')](_0xacec('0x34'));};AGIChannel[_0xacec('0x23')]['setVariable']=function(_0x52c6c0,_0x471a3a){var _0x4b1781=_[_0xacec('0x35')](_0x471a3a)||_['isNumber'](_0x471a3a)?_0x471a3a['toString']():_0x471a3a;return this['sendRequest'](util[_0xacec('0x29')](_0xacec('0x36'),_0x52c6c0,_0x4b1781?_0x4b1781['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xacec('0x23')]['sayNumber']=function(_0x31fe93,_0x40e92e){return this[_0xacec('0x24')](util[_0xacec('0x29')](_0xacec('0x37'),_0x31fe93,_0x40e92e));};AGIChannel[_0xacec('0x23')][_0xacec('0x38')]=function(_0x42c6bf,_0x387cf2){return this[_0xacec('0x24')](util[_0xacec('0x29')](_0xacec('0x39'),_0x42c6bf,_0x387cf2));};AGIChannel[_0xacec('0x23')]['sayPhonetic']=function(_0x1d3cda,_0x48419d){return this[_0xacec('0x24')](util['format'](_0xacec('0x3a'),_0x1d3cda,_0x48419d));};AGIChannel['prototype']['continueAt']=function(_0x586317,_0x25ad23,_0x407b00){_0x25ad23=_0x25ad23||this[_0xacec('0x3b')];_0x407b00=_0x407b00||0x1;this[_0xacec('0x30')](_0x586317);this['setExtension'](_0x25ad23);this[_0xacec('0x33')](_0x407b00);return this[_0xacec('0x2b')](util['format'](_0xacec('0x3c'),_0x586317,_0x25ad23,_0x407b00));};AGIChannel['prototype'][_0xacec('0x3d')]=function(_0x40cbbe){return this['sendRequest'](util[_0xacec('0x29')](_0xacec('0x3e'),_0x40cbbe));};AGIChannel[_0xacec('0x23')]['recordFile']=function(_0x4cbdde,_0x24d877,_0x220716,_0x542f80,_0x14c96f,_0xd2aa4a){_0x24d877=_0x24d877||'wav';_0x220716=_0x220716||'';_0x542f80=_0x542f80===undefined?-0x1:_0x542f80==='-1'?-0x1:_0x542f80*0x3e8;_0x14c96f=_0x14c96f===undefined?'':'s='+_0x14c96f;_0xd2aa4a=_0xd2aa4a?_0xacec('0x3f'):'';return this['sendRequest'](util[_0xacec('0x29')](_0xacec('0x40'),_0x4cbdde,_0x24d877,_0x220716,_0x542f80,_0xd2aa4a,_0x14c96f));};AGIChannel[_0xacec('0x23')][_0xacec('0x41')]=function(_0x12ebc1,_0x3d3c74){_0x3d3c74=_0x3d3c74||'';return this[_0xacec('0x24')](util[_0xacec('0x29')](_0xacec('0x42'),_0x12ebc1,_0x3d3c74));};AGIChannel['prototype'][_0xacec('0x43')]=function(_0x130d32){return this[_0xacec('0x2d')](_0xacec('0x44'),_0x130d32);};AGIChannel[_0xacec('0x23')]['wait']=function(_0x39ce95){return this[_0xacec('0x2d')]('WAIT',_0x39ce95);};AGIChannel[_0xacec('0x23')][_0xacec('0x17')]=function(_0x322224,_0x47d3d3){this[_0xacec('0x2b')](util[_0xacec('0x29')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x322224['id'],_0x322224[_0xacec('0x45')],_0x47d3d3));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0xc5e5=['./error','call','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','indexOf','substr','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','write','destroy','prototype','sendRequest','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','events','./reply'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc5e5,0xdc));var _0x5c5e=function(_0x3403c7,_0x11d960){_0x3403c7=_0x3403c7-0x0;var _0x26a82=_0xc5e5[_0x3403c7];return _0x26a82;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x5c5e('0x0'))['EventEmitter'];var AGIReply=require(_0x5c5e('0x1'));var AGIError=require(_0x5c5e('0x2'));function AGIChannel(_0x6c0acb){var _0x32d8f5=this,_0x49029d=new AGIReply(),_0x41ee97=![],_0x42c1c2={};EventEmitter[_0x5c5e('0x3')](_0x32d8f5);_0x6c0acb['setEncoding'](_0x5c5e('0x4'));_0x6c0acb[_0x5c5e('0x5')](0x8*0x3c*0x3c*0x3e8);_0x49029d['setEncoding'](_0x5c5e('0x4'));_0x49029d['on'](_0x5c5e('0x6'),function(_0x14ff17){for(var _0x35aceb in _0x14ff17){_0x32d8f5[_0x35aceb]=_0x14ff17[_0x35aceb];}_0x32d8f5[_0x5c5e('0x7')](_0x5c5e('0x8'));});_0x49029d['on'](_0x5c5e('0x9'),function(_0x583b7e){if(_0x583b7e[_0x5c5e('0xa')]()==_0x5c5e('0xb')){_0x32d8f5['emit'](_0x5c5e('0xb'));return;}if(_0x583b7e['substring'](0x0,0xb)==_0x5c5e('0xc')){_0x41ee97=!![];}if(_0x41ee97){_0x42c1c2['rx']+=_0x583b7e+'\x0a';if(_0x583b7e[_0x5c5e('0xd')](_0x5c5e('0xe'))!=-0x1){_0x41ee97=![];}}else{_0x42c1c2['rx']=_0x583b7e;}if(_0x41ee97){return;}if(typeof _0x42c1c2['cb']==_0x5c5e('0xf')){var _0x44ff59=_0x42c1c2['rx'][_0x5c5e('0x10')](0x0,0x3),_0x593aad=null,_0x3ad274=null;_0x44ff59=parseInt(_0x44ff59);if(isNaN(_0x44ff59)){_0x42c1c2['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5c5e('0x11')});return;}if(_0x44ff59!=0xc8){_0x42c1c2['cb'](null,{'code':_0x44ff59,'result':-0x1,'extra':'KO'});return;}_0x593aad=_0x42c1c2['rx']['substring'](0x4)[_0x5c5e('0x12')]('result=','');if(_0x593aad[_0x5c5e('0x13')]('\x20')!=-0x1){_0x593aad=_0x593aad[_0x5c5e('0x14')](0x0,_0x593aad[_0x5c5e('0x13')]('\x20'));}if(_['startsWith'](_0x593aad,'-1')){_0x593aad=parseInt(_0x593aad);}_0x3ad274=_0x42c1c2['rx'][_0x5c5e('0x15')]('\x20');if(_0x3ad274[_0x5c5e('0x16')]==0x3){_0x3ad274=_0x3ad274[0x2][_0x5c5e('0x10')](0x1,_0x3ad274[0x2][_0x5c5e('0x16')]-0x1);}else if(_0x3ad274[_0x5c5e('0x16')]>0x3){var _0x579b00=/\((.+)\)/;var _0x274714=_0x42c1c2['rx'][_0x5c5e('0x17')](_0x579b00);if(_0x274714){_0x3ad274=_0x274714[0x1];}else{_0x3ad274=null;}}else{_0x3ad274=null;}_0x42c1c2['cb'](null,{'code':_0x44ff59,'result':_0x593aad,'extra':_0x3ad274});}});_0x6c0acb['on'](_0x5c5e('0x18'),function(_0xebbb89){_0x32d8f5[_0x5c5e('0x7')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0xebbb89['code']));});_0x6c0acb['on'](_0x5c5e('0x19'),function(){_0x32d8f5[_0x5c5e('0x7')](_0x5c5e('0x19'),new AGIError(_0x5c5e('0x1a')));});_0x6c0acb['on'](_0x5c5e('0x1b'),function(){_0x32d8f5[_0x5c5e('0x7')](_0x5c5e('0x1b'),new AGIError(_0x5c5e('0x1c')));_0x6c0acb['destroy']();});_0x6c0acb[_0x5c5e('0x1d')](_0x49029d);this[_0x5c5e('0x1e')]=function(_0x2e1bcd,_0x4111ea){var _0x2e1bcd=_0x2e1bcd||'',_0x4111ea=typeof _0x4111ea=='function'?_0x4111ea:new Function();_0x42c1c2={'tx':_0x2e1bcd,'rx':'','cb':_0x4111ea};_0x6c0acb[_0x5c5e('0x1f')](_0x2e1bcd+'\x0a');},this[_0x5c5e('0x19')]=function(){_0x6c0acb[_0x5c5e('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x22')]=function(_0x10e343){return this[_0x5c5e('0x1e')]['sync'](this,_0x10e343);};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x23')]=function(){return this['sendRequest'](_0x5c5e('0x24'));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x25')]=function(_0x23879c,_0x5e8588,_0xbbb083){_0x23879c=_0x23879c===undefined?_0x5c5e('0x26'):_0x23879c;_0x5e8588=_0x5e8588===undefined?'5':_0x5e8588;_0xbbb083=_0xbbb083===undefined?'1':_0xbbb083;return this['sendRequest'](util[_0x5c5e('0x27')](_0x5c5e('0x28'),_0x23879c,_0x5e8588*0x3e8,_0xbbb083));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x29')]=function(_0x2f7a0d){_0x2f7a0d=_0x2f7a0d||_0x5c5e('0x2a');return this[_0x5c5e('0x22')](util[_0x5c5e('0x27')]('VERBOSE\x20\x22%s\x22',_0x2f7a0d));};AGIChannel[_0x5c5e('0x21')]['exec']=function(_0x322ff3,_0x3b7737){if(_[_0x5c5e('0x2b')](_0x3b7737)){return this['sendRequest'](util[_0x5c5e('0x27')](_0x5c5e('0x2c'),_0x322ff3,_0x3b7737[_0x5c5e('0x2d')](',')));}return this['sendRequest'](util[_0x5c5e('0x27')]('EXEC\x20%s\x20%s',_0x322ff3,_0x3b7737));};AGIChannel['prototype'][_0x5c5e('0x2e')]=function(_0x4b1dae){return this['sendRequest'](util[_0x5c5e('0x27')](_0x5c5e('0x2f'),_0x4b1dae));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x30')]=function(_0x38f1ee){return this[_0x5c5e('0x22')](util[_0x5c5e('0x27')](_0x5c5e('0x31'),_0x38f1ee));};AGIChannel[_0x5c5e('0x21')]['setPriority']=function(_0xdf2d70){return this['sendRequest'](util[_0x5c5e('0x27')](_0x5c5e('0x32'),_0xdf2d70));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0xb')]=function(){return this[_0x5c5e('0x22')](_0x5c5e('0x33'));};AGIChannel[_0x5c5e('0x21')]['setVariable']=function(_0x304707,_0x1efa26){var _0x44896b=_[_0x5c5e('0x34')](_0x1efa26)||_['isNumber'](_0x1efa26)?_0x1efa26[_0x5c5e('0x35')]():_0x1efa26;return this[_0x5c5e('0x22')](util['format'](_0x5c5e('0x36'),_0x304707,_0x44896b?_0x44896b[_0x5c5e('0x35')]()[_0x5c5e('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x37')]=function(_0x513f03,_0x10d739){return this['sendRequest'](util['format'](_0x5c5e('0x38'),_0x513f03,_0x10d739));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x39')]=function(_0x25980,_0x18bd11){return this[_0x5c5e('0x22')](util[_0x5c5e('0x27')](_0x5c5e('0x3a'),_0x25980,_0x18bd11));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x3b')]=function(_0x1b8bad,_0x5be51b){return this[_0x5c5e('0x22')](util[_0x5c5e('0x27')](_0x5c5e('0x3c'),_0x1b8bad,_0x5be51b));};AGIChannel[_0x5c5e('0x21')]['continueAt']=function(_0x5e5233,_0x9ad6b9,_0x3c50bb){_0x9ad6b9=_0x9ad6b9||this['extension'];_0x3c50bb=_0x3c50bb||0x1;this[_0x5c5e('0x2e')](_0x5e5233);this[_0x5c5e('0x30')](_0x9ad6b9);this[_0x5c5e('0x3d')](_0x3c50bb);return this[_0x5c5e('0x29')](util[_0x5c5e('0x27')](_0x5c5e('0x3e'),_0x5e5233,_0x9ad6b9,_0x3c50bb));};AGIChannel['prototype'][_0x5c5e('0x3f')]=function(_0x53d821){return this[_0x5c5e('0x22')](util[_0x5c5e('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x53d821));};AGIChannel['prototype']['recordFile']=function(_0x206d23,_0x1984b4,_0x24bec1,_0x1d1c2b,_0x452d71,_0x5dc658){_0x1984b4=_0x1984b4||_0x5c5e('0x40');_0x24bec1=_0x24bec1||'';_0x1d1c2b=_0x1d1c2b===undefined?-0x1:_0x1d1c2b==='-1'?-0x1:_0x1d1c2b*0x3e8;_0x452d71=_0x452d71===undefined?'':'s='+_0x452d71;_0x5dc658=_0x5dc658?_0x5c5e('0x41'):'';return this[_0x5c5e('0x22')](util['format'](_0x5c5e('0x42'),_0x206d23,_0x1984b4,_0x24bec1,_0x1d1c2b,_0x5dc658,_0x452d71));};AGIChannel[_0x5c5e('0x21')]['streamFile']=function(_0x26cbca,_0x1ac28a){_0x1ac28a=_0x1ac28a||'';return this[_0x5c5e('0x22')](util[_0x5c5e('0x27')](_0x5c5e('0x43'),_0x26cbca,_0x1ac28a));};AGIChannel[_0x5c5e('0x21')][_0x5c5e('0x44')]=function(_0x355d13){return this[_0x5c5e('0x45')](_0x5c5e('0x46'),_0x355d13);};AGIChannel[_0x5c5e('0x21')]['wait']=function(_0x51d1b1){return this[_0x5c5e('0x45')](_0x5c5e('0x47'),_0x51d1b1);};AGIChannel[_0x5c5e('0x21')]['error']=function(_0x529afd,_0x26a72f){this[_0x5c5e('0x29')](util[_0x5c5e('0x27')](_0x5c5e('0x48'),_0x529afd['id'],_0x529afd[_0x5c5e('0x49')],_0x26a72f));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
index 0480627..98c4923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2a8=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','util','Undefined\x20error.'];(function(_0x3bd5ee,_0x4699fd){var _0x20b1ef=function(_0x28e091){while(--_0x28e091){_0x3bd5ee['push'](_0x3bd5ee['shift']());}};_0x20b1ef(++_0x4699fd);}(_0xf2a8,0xfd));var _0x8f2a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2a8[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x8f2a('0x0'));var error={'E_AGI_UNDEFINED':_0x8f2a('0x1'),'E_AGI_ARGUMENT_PORT':_0x8f2a('0x2'),'E_AGI_SERVER_ERROR':_0x8f2a('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x8f2a('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x8f2a('0x5'),'E_AGI_SOCKET_ERROR':_0x8f2a('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x8f2a('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x8f2a('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3b1a15){var _0x3b1a15=_0x3b1a15||null,_0x189dc1=_0x189dc1||[],_0x567407=0x1,_0x4228fe='';if(!error[_0x3b1a15]){_0x3b1a15=_0x8f2a('0x9');}_0x189dc1[_0x8f2a('0xa')](error[_0x3b1a15]);while(arguments[_0x567407]){_0x189dc1['push'](arguments[_0x567407]);_0x567407++;}_0x4228fe=util[_0x8f2a('0xb')][_0x8f2a('0xc')](util,_0x189dc1);this[_0x8f2a('0xd')]=_0x4228fe;this[_0x8f2a('0xe')]=_0x3b1a15;}module['exports']=AGIError;
\ No newline at end of file
+var _0x869d=['apply','message','name','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','format'];(function(_0x38330d,_0x2f0b1d){var _0x5023c5=function(_0x5c16bf){while(--_0x5c16bf){_0x38330d['push'](_0x38330d['shift']());}};_0x5023c5(++_0x2f0b1d);}(_0x869d,0x1bd));var _0xd869=function(_0x16a6bc,_0x52c641){_0x16a6bc=_0x16a6bc-0x0;var _0x38aa93=_0x869d[_0x16a6bc];return _0x38aa93;};'use strict';var util=require(_0xd869('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xd869('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xd869('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xd869('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xd869('0x4'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xd869('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xd869('0x6'),'E_AGI_COMMAND_EMPTY':_0xd869('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xd869('0x8')};function AGIError(_0x14df58){var _0x14df58=_0x14df58||null,_0x4e3789=_0x4e3789||[],_0x23e96a=0x1,_0x191f87='';if(!error[_0x14df58]){_0x14df58='E_AGI_UNDEFINED';}_0x4e3789['push'](error[_0x14df58]);while(arguments[_0x23e96a]){_0x4e3789['push'](arguments[_0x23e96a]);_0x23e96a++;}_0x191f87=util[_0xd869('0x9')][_0xd869('0xa')](util,_0x4e3789);this[_0xd869('0xb')]=_0x191f87;this[_0xd869('0xc')]=_0x14df58;}module['exports']=AGIError;
\ No newline at end of file
index 7ff0f0c..143f6d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a28=['target','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','edges','numberOfEdges','prototype','addVertex','push','size','vertices','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','default'];(function(_0x3ef17c,_0x5e47d6){var _0x1cd32e=function(_0x55bc8c){while(--_0x55bc8c){_0x3ef17c['push'](_0x3ef17c['shift']());}};_0x1cd32e(++_0x5e47d6);}(_0x9a28,0x13a));var _0x89a2=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x9a28[_0x4b2863];return _0x567d67;};'use strict';var _=require(_0x89a2('0x0'));var logger=require(_0x89a2('0x1'))(_0x89a2('0x2'));var verticesWithRetry=[_0x89a2('0x3'),'getdigits',_0x89a2('0x4')];var Graph=function(){this['vertices']={};this[_0x89a2('0x5')]={};this[_0x89a2('0x6')]=0x0;};Graph[_0x89a2('0x7')][_0x89a2('0x8')]=function(_0x33ca8e){this['vertices'][_0x33ca8e['id']]=_0x33ca8e;this[_0x89a2('0x5')][_0x33ca8e['id']]=[];};Graph[_0x89a2('0x7')]['addEdge']=function(_0x1f61d4,_0x79628a,_0x12e4ce){this[_0x89a2('0x5')][_0x1f61d4][_0x89a2('0x9')]({'target':_0x79628a,'condition':_0x12e4ce});this['numberOfEdges']+=0x1;};Graph['prototype'][_0x89a2('0xa')]=function(){return _['size'](this[_0x89a2('0xb')]);};Graph['prototype'][_0x89a2('0xc')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x89a2('0xd')]=function(_0x269cf1){return this[_0x89a2('0xb')][_0x269cf1];};Graph[_0x89a2('0x7')][_0x89a2('0xe')]=function(_0x1b1cc5,_0x470bf){if(!this[_0x89a2('0xb')][_0x1b1cc5]){return logger[_0x89a2('0xf')]('no\x20vertex\x20found');}var _0x271428=_0x470bf(this[_0x89a2('0xb')][_0x1b1cc5]);if(!_0x271428){return logger[_0x89a2('0xf')](_0x89a2('0x10'));}if(this[_0x89a2('0x5')][_0x1b1cc5][_0x89a2('0x11')]===0x0){return logger['info'](_0x89a2('0x12'));}for(var _0x2c3693=0x0,_0x374ead=[],_0x2c8185=![];_0x2c3693<this[_0x89a2('0x5')][_0x1b1cc5][_0x89a2('0x11')];_0x2c3693+=0x1){if(this['edges'][_0x1b1cc5][_0x2c3693][_0x89a2('0x13')]){_0x374ead=this[_0x89a2('0x5')][_0x1b1cc5][_0x2c3693][_0x89a2('0x13')]['split'](',');for(var _0x2c9b29=0x0;_0x2c9b29<_0x374ead[_0x89a2('0x11')];_0x2c9b29+=0x1){if(this[_0x89a2('0xb')][_0x1b1cc5][_0x89a2('0x14')]==='vswitch'&&_0x374ead[_0x2c9b29]==='-'){_0x2c8185=this['edges'][_0x1b1cc5][_0x2c3693]['target'];logger['info'](_0x89a2('0x15'),_0x374ead[_0x2c9b29],this[_0x89a2('0x5')][_0x1b1cc5][_0x2c3693][_0x89a2('0x16')]);}else if(this[_0x89a2('0xb')][_0x1b1cc5][_0x89a2('0x14')]===_0x89a2('0x3')&&_0x374ead[_0x2c9b29]==='i'){_0x2c8185=this[_0x89a2('0x5')][_0x1b1cc5][_0x2c3693][_0x89a2('0x16')];logger['info']('invalid',_0x374ead[_0x2c9b29],this[_0x89a2('0x5')][_0x1b1cc5][_0x2c3693]['target']);}if(_0x374ead[_0x2c9b29]===_0x271428){return this[_0x89a2('0xe')](this[_0x89a2('0x5')][_0x1b1cc5][_0x2c3693][_0x89a2('0x16')],_0x470bf);}}}else{return this[_0x89a2('0xe')](this[_0x89a2('0x5')][_0x1b1cc5][_0x2c3693][_0x89a2('0x16')],_0x470bf);}}if(_0x374ead[_0x89a2('0x11')]){if(this[_0x89a2('0xb')][_0x1b1cc5][_0x89a2('0x14')]==='vswitch'){if(_0x2c8185){return this[_0x89a2('0xe')](_0x2c8185,_0x470bf);}return logger['info'](_0x89a2('0x17'));}else if(_[_0x89a2('0x18')](verticesWithRetry,this['vertices'][_0x1b1cc5]['agicommand'])){if(_0x271428==='-'){return logger[_0x89a2('0xf')](_0x89a2('0x19'));}if(_0x2c8185&&_0x271428!=='t'){return this['traverseBFS'](_0x2c8185,_0x470bf);}return this[_0x89a2('0xe')](_0x1b1cc5,_0x470bf);}return logger[_0x89a2('0xf')](_0x89a2('0x1a'));}};module[_0x89a2('0x1b')]=Graph;
\ No newline at end of file
+var _0xfef9=['info','no\x20edge/s\x20available','condition','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','lodash','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','getVertex','traverseBFS','no\x20vertex\x20found','length'];(function(_0x37cf21,_0x2972a5){var _0x2c8fe8=function(_0x1cd279){while(--_0x1cd279){_0x37cf21['push'](_0x37cf21['shift']());}};_0x2c8fe8(++_0x2972a5);}(_0xfef9,0x9f));var _0x9fef=function(_0x3a3afe,_0x15da25){_0x3a3afe=_0x3a3afe-0x0;var _0x262dab=_0xfef9[_0x3a3afe];return _0x262dab;};'use strict';var _=require(_0x9fef('0x0'));var logger=require(_0x9fef('0x1'))(_0x9fef('0x2'));var verticesWithRetry=[_0x9fef('0x3'),'getdigits',_0x9fef('0x4')];var Graph=function(){this[_0x9fef('0x5')]={};this[_0x9fef('0x6')]={};this[_0x9fef('0x7')]=0x0;};Graph[_0x9fef('0x8')][_0x9fef('0x9')]=function(_0x1fd645){this[_0x9fef('0x5')][_0x1fd645['id']]=_0x1fd645;this[_0x9fef('0x6')][_0x1fd645['id']]=[];};Graph[_0x9fef('0x8')][_0x9fef('0xa')]=function(_0x2290b0,_0x271bcb,_0x2282f9){this[_0x9fef('0x6')][_0x2290b0]['push']({'target':_0x271bcb,'condition':_0x2282f9});this[_0x9fef('0x7')]+=0x1;};Graph[_0x9fef('0x8')][_0x9fef('0xb')]=function(){return _[_0x9fef('0xb')](this['vertices']);};Graph[_0x9fef('0x8')]['relations']=function(){return this[_0x9fef('0x7')];};Graph['prototype'][_0x9fef('0xc')]=function(_0x4379ff){return this[_0x9fef('0x5')][_0x4379ff];};Graph[_0x9fef('0x8')][_0x9fef('0xd')]=function(_0x99265c,_0x3b734d){if(!this[_0x9fef('0x5')][_0x99265c]){return logger['info'](_0x9fef('0xe'));}var _0xb8560b=_0x3b734d(this[_0x9fef('0x5')][_0x99265c]);if(!_0xb8560b){return logger['info']('stop\x20traverse');}if(this['edges'][_0x99265c][_0x9fef('0xf')]===0x0){return logger[_0x9fef('0x10')](_0x9fef('0x11'));}for(var _0x43851c=0x0,_0x54e754=[],_0x2c8b67=![];_0x43851c<this[_0x9fef('0x6')][_0x99265c][_0x9fef('0xf')];_0x43851c+=0x1){if(this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x12')]){_0x54e754=this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x12')]['split'](',');for(var _0x1cff14=0x0;_0x1cff14<_0x54e754[_0x9fef('0xf')];_0x1cff14+=0x1){if(this[_0x9fef('0x5')][_0x99265c][_0x9fef('0x13')]===_0x9fef('0x14')&&_0x54e754[_0x1cff14]==='-'){_0x2c8b67=this[_0x9fef('0x6')][_0x99265c][_0x43851c]['target'];logger[_0x9fef('0x10')](_0x9fef('0x15'),_0x54e754[_0x1cff14],this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x16')]);}else if(this['vertices'][_0x99265c][_0x9fef('0x13')]===_0x9fef('0x3')&&_0x54e754[_0x1cff14]==='i'){_0x2c8b67=this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x16')];logger[_0x9fef('0x10')](_0x9fef('0x17'),_0x54e754[_0x1cff14],this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x16')]);}if(_0x54e754[_0x1cff14]===_0xb8560b){return this['traverseBFS'](this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x16')],_0x3b734d);}}}else{return this['traverseBFS'](this[_0x9fef('0x6')][_0x99265c][_0x43851c][_0x9fef('0x16')],_0x3b734d);}}if(_0x54e754[_0x9fef('0xf')]){if(this['vertices'][_0x99265c]['agicommand']===_0x9fef('0x14')){if(_0x2c8b67){return this[_0x9fef('0xd')](_0x2c8b67,_0x3b734d);}return logger[_0x9fef('0x10')](_0x9fef('0x18'));}else if(_['includes'](verticesWithRetry,this[_0x9fef('0x5')][_0x99265c]['agicommand'])){if(_0xb8560b==='-'){return logger[_0x9fef('0x10')]('max\x20retry\x20reach');}if(_0x2c8b67&&_0xb8560b!=='t'){return this['traverseBFS'](_0x2c8b67,_0x3b734d);}return this[_0x9fef('0xd')](_0x99265c,_0x3b734d);}return logger[_0x9fef('0x10')]('condition\x20not\x20found');}};module['exports']=Graph;
\ No newline at end of file
index 64bd095..e5977e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc1d=['catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','sync','start','joinAt','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','isUndefined','toString','response','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','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','util','moment','../../config/environment','agi','./rpc','./mailRpc','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','toJson','mxGraphModel','root','agicommand','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','getSquareProject','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc1d,0x132));var _0xdcc1=function(_0x32c649,_0x4401e0){_0x32c649=_0x32c649-0x0;var _0x440a0a=_0xcc1d[_0x32c649];return _0x440a0a;};'use strict';var parser=require(_0xdcc1('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xdcc1('0x1'));var moment=require(_0xdcc1('0x2'));var config=require(_0xdcc1('0x3'));var logger=require('../../config/logger')(_0xdcc1('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0xdcc1('0x5'));var mailRpc=require(_0xdcc1('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xdcc1('0x4')]=_[_0xdcc1('0x7')](config['agi'],{'ip':_0xdcc1('0x8'),'port':0x11dd});function connectionHandler(_0x3f55a){process[_0xdcc1('0x9')](function(){syncho(function(){try{setChannelVariables(_0x3f55a);agiHandler(_0x3f55a);}catch(_0x238d3b){logger[_0xdcc1('0xa')](_0x238d3b[_0xdcc1('0xb')]);}});});}function listeningHandler(){console[_0xdcc1('0xc')](_0xdcc1('0xd'),config['agi'][_0xdcc1('0xe')]);logger['info'](util[_0xdcc1('0xf')](_0xdcc1('0x10'),config[_0xdcc1('0x4')]['ip'],config['agi'][_0xdcc1('0xe')]));}function errorHandler(_0x53cb6a){if(_0x53cb6a&&_0x53cb6a[_0xdcc1('0x11')]&&_0x53cb6a[_0xdcc1('0x12')]){logger['error'](util[_0xdcc1('0xf')](_0xdcc1('0x13'),_0x53cb6a[_0xdcc1('0x11')],_0x53cb6a[_0xdcc1('0x12')]));}else{logger[_0xdcc1('0xa')](util['format'](_0xdcc1('0x14'),_0x53cb6a[_0xdcc1('0xb')]));}}function closeHandler(){logger['info'](util['format'](_0xdcc1('0x15'),this['arg_1'],this[_0xdcc1('0x16')],this[_0xdcc1('0x17')],this[_0xdcc1('0x18')],this[_0xdcc1('0x19')]));try{createSquareReport(this);}catch(_0x389418){logger[_0xdcc1('0xa')](_0x389418[_0xdcc1('0xb')]);}}function timeoutHandler(){logger[_0xdcc1('0x1a')](util[_0xdcc1('0xf')](_0xdcc1('0x1b'),this[_0xdcc1('0x1c')],this[_0xdcc1('0x16')],this[_0xdcc1('0x17')],this['dnid'],this[_0xdcc1('0x19')]));}function hangupHandler(){logger[_0xdcc1('0x1a')](util[_0xdcc1('0xf')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xdcc1('0x1c')],this[_0xdcc1('0x16')],this[_0xdcc1('0x17')],this['dnid'],this[_0xdcc1('0x19')]));this[_0xdcc1('0x1d')]=!![];}function getRoot(_0x3c5ad3){return parser[_0xdcc1('0x1e')](_0x3c5ad3,{'object':!![]})[_0xdcc1('0x1f')][_0xdcc1('0x20')];}function addVertex(_0x3954f5,_0x5075ae,_0x11642a){_0x5075ae[_0xdcc1('0x21')]=_0x11642a;if(_0x5075ae['hasOwnProperty']('retry')){_0x5075ae['maxRetry']=parseInt(_0x5075ae['retry'],0xa);}_0x3954f5[_0xdcc1('0x22')](_[_0xdcc1('0x23')](_0x5075ae,_0xdcc1('0x24')));}function initGraph(_0x33374d,_0x223669){var _0x32e7e4=new Graph();for(var _0x4f1587 in _0x33374d){if(_0x33374d[_0xdcc1('0x25')](_0x4f1587)){if(_[_0xdcc1('0x26')](_0x33374d[_0x4f1587])){for(var _0x14d5a8=0x0;_0x14d5a8<_0x33374d[_0x4f1587][_0xdcc1('0x27')];_0x14d5a8+=0x1){addVertex(_0x32e7e4,_0x33374d[_0x4f1587][_0x14d5a8],_0x4f1587);}}else{addVertex(_0x32e7e4,_0x33374d[_0x4f1587],_0x4f1587);}}}for(var _0x5d1837=0x0;_0x5d1837<_0x223669[_0xdcc1('0x27')];_0x5d1837+=0x1){if(_0x223669[_0x5d1837][_0xdcc1('0x28')]&&_0x223669[_0x5d1837][_0xdcc1('0x29')]){_0x32e7e4[_0xdcc1('0x2a')](_0x223669[_0x5d1837][_0xdcc1('0x28')],_0x223669[_0x5d1837][_0xdcc1('0x29')],_0x223669[_0x5d1837][_0xdcc1('0x2b')]);}}return _0x32e7e4;}function getSquareProject(_0x5006c7,_0x148e10){rpc[_0xdcc1('0x2c')](_0x5006c7)[_0xdcc1('0x2d')](function(_0x513c42){_0x148e10(null,_0x513c42);})[_0xdcc1('0x2e')](function(_0x203b18){_0x148e10(null,_0x203b18);});}function createSquareReport(_0x38ff02,_0x37d181){rpc['createSquareReport'](_0x38ff02)['then'](function(_0x104068){if(_0x37d181){_0x37d181(null,_0x104068);}})[_0xdcc1('0x2e')](function(_0x32d420){if(_0x37d181){_0x37d181(null,_0x32d420);}});}function setChannelVariables(_0x17a10d){for(var _0x1b48d0 in _0x17a10d){if(_0x17a10d[_0xdcc1('0x25')](_0x1b48d0)){if(_0x1b48d0[_0xdcc1('0x2f')](_0xdcc1('0x30'))===0x0){_0x17a10d[_0x1b48d0[_0xdcc1('0x31')](0x4)]=_0x17a10d[_0x1b48d0];delete _0x17a10d[_0x1b48d0];}}}}function getLogFromObject(_0x5b19bf){return util[_0xdcc1('0x32')](_0x5b19bf,{'showHidden':![],'depth':null});}function agiHandler(_0x31ec2c){var _0x5ead04,_0xbd14e3,_0x1cbc6a,_0x47f362,_0x2fee7b;logger[_0xdcc1('0x33')](_0xdcc1('0x34'),JSON[_0xdcc1('0x35')](_0x31ec2c,null,0x2));logger[_0xdcc1('0x1a')](util[_0xdcc1('0xf')](_0xdcc1('0x36'),_0x31ec2c['arg_1'],_0x31ec2c[_0xdcc1('0x16')],_0x31ec2c['callerid'],_0x31ec2c[_0xdcc1('0x18')],_0x31ec2c[_0xdcc1('0x19')]));_0x31ec2c['on'](_0xdcc1('0xa'),errorHandler);_0x31ec2c['on'](_0xdcc1('0x37'),closeHandler);_0x31ec2c['on']('timeout',timeoutHandler);_0x31ec2c['evtHangup']=![];_0x31ec2c['on'](_0xdcc1('0x38'),hangupHandler);var _0x252f4d=getSquareProject[_0xdcc1('0x39')](null,_0x31ec2c[_0xdcc1('0x1c')]);if(_0x252f4d){if(_0x252f4d['production']){_0x5ead04=getRoot(_0x252f4d['production']);if(_0x5ead04&&_0x5ead04[_0xdcc1('0x3a')]){logger[_0xdcc1('0x33')](_0xdcc1('0x20'),JSON[_0xdcc1('0x35')](_0x5ead04,null,0x2));_0x31ec2c[_0xdcc1('0x3b')]=moment()[_0xdcc1('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0xbd14e3=initGraph(_['omit'](_0x5ead04,_0xdcc1('0x24')),_0x5ead04[_0xdcc1('0x24')]);_0x1cbc6a=new Vertices(_0x31ec2c,rpc,mailRpc);logger['info'](util[_0xdcc1('0xf')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x31ec2c[_0xdcc1('0x1c')],_0x31ec2c[_0xdcc1('0x16')],_0x31ec2c['callerid'],_0x31ec2c[_0xdcc1('0x18')],_0x31ec2c[_0xdcc1('0x19')]));_0xbd14e3['traverseBFS'](_0x5ead04[_0xdcc1('0x3a')]['id'],function(_0x1d3dee){try{_0x1d3dee=_0x1cbc6a[_0xdcc1('0x3c')](_0x1d3dee);logger['debug'](_0xdcc1('0x3d'),JSON[_0xdcc1('0x35')](_0x1d3dee,null,0x2));if(_0x1d3dee[_0xdcc1('0x21')]===_0xdcc1('0x3e')){logger[_0xdcc1('0x1a')](_0xdcc1('0x3f'));_0x31ec2c[_0xdcc1('0x40')]=_0x1d3dee[_0xdcc1('0x40')]||_0x31ec2c[_0xdcc1('0x40')];_0x31ec2c[_0xdcc1('0x41')]=_0x1d3dee['extension'];_0x31ec2c[_0xdcc1('0x42')]=_0x1d3dee[_0xdcc1('0x42')]?_0x1d3dee[_0xdcc1('0x42')]-0x1:0x1;return null;}else if(_0x1d3dee&&_0x1cbc6a[_0x1d3dee[_0xdcc1('0x21')]]){_0x2fee7b=_0x1cbc6a[_0x1d3dee[_0xdcc1('0x21')]](_0x1d3dee);logger['info']('response',JSON[_0xdcc1('0x35')](_0x2fee7b,null,0x2));if(_0x2fee7b&&_0x2fee7b[_0xdcc1('0x43')]===AGI_CODE_SUCCESS&&_0x2fee7b[_0xdcc1('0x44')]!==AGI_RESULT_ERROR&&!_0x31ec2c[_0xdcc1('0x1d')]){logger[_0xdcc1('0x33')]('response',getLogFromObject(_0x2fee7b));return _[_0xdcc1('0x45')](_0x2fee7b[_0xdcc1('0x44')])?null:_0x2fee7b[_0xdcc1('0x44')][_0xdcc1('0x46')]();}else{logger['error'](_0xdcc1('0x47'),getLogFromObject(_0x2fee7b));return null;}}else{logger[_0xdcc1('0xa')](_0xdcc1('0x48'));return null;}}catch(_0x5a6ac5){logger['error'](_0x5a6ac5[_0xdcc1('0xb')]);return null;}});if(_0x5ead04[_0xdcc1('0x49')]){logger[_0xdcc1('0x1a')](util[_0xdcc1('0xf')](_0xdcc1('0x4a'),_0x31ec2c[_0xdcc1('0x1c')],_0x31ec2c['calleridname'],_0x31ec2c[_0xdcc1('0x17')],_0x31ec2c[_0xdcc1('0x18')],_0x31ec2c[_0xdcc1('0x19')]));_0xbd14e3[_0xdcc1('0x4b')](_0x5ead04['finally']['id'],function(_0x1836da){try{_0x1836da=_0x1cbc6a[_0xdcc1('0x3c')](_0x1836da);logger[_0xdcc1('0x33')](_0xdcc1('0x3d'),JSON[_0xdcc1('0x35')](_0x1836da,null,0x2));if(_0x1836da&&_0x1cbc6a[_0x1836da[_0xdcc1('0x21')]]){_0x2fee7b=_0x1cbc6a[_0x1836da[_0xdcc1('0x21')]](_0x1836da);if(_0x2fee7b){logger[_0xdcc1('0x33')]('response',getLogFromObject(_0x2fee7b));return _[_0xdcc1('0x45')](_0x2fee7b['result'])?null:_0x2fee7b[_0xdcc1('0x44')][_0xdcc1('0x46')]();}else{logger['error']('response',getLogFromObject(_0x2fee7b));return null;}}else{logger[_0xdcc1('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x373146){logger[_0xdcc1('0xa')](_0x373146['stack']);return null;}});}logger[_0xdcc1('0x1a')](util[_0xdcc1('0xf')](_0xdcc1('0x4c'),_0x31ec2c[_0xdcc1('0x1c')],_0x31ec2c['calleridname'],_0x31ec2c[_0xdcc1('0x17')],_0x31ec2c[_0xdcc1('0x18')],_0x31ec2c[_0xdcc1('0x19')]));logger[_0xdcc1('0x1a')](util[_0xdcc1('0xf')](_0xdcc1('0x4d'),_0x31ec2c[_0xdcc1('0x40')],_0x31ec2c[_0xdcc1('0x41')],parseInt(_0x31ec2c[_0xdcc1('0x42')],0xa)+0x1));_0x31ec2c[_0xdcc1('0x4e')](_0x31ec2c[_0xdcc1('0x40')],_0x31ec2c[_0xdcc1('0x41')],parseInt(_0x31ec2c[_0xdcc1('0x42')],0xa)+0x1);_0x31ec2c[_0xdcc1('0x37')]();}}else{logger[_0xdcc1('0xa')](util[_0xdcc1('0xf')](_0xdcc1('0x4f'),_0x31ec2c['arg_1']));_0x31ec2c[_0xdcc1('0x4e')](_0x31ec2c[_0xdcc1('0x40')],_0x31ec2c['extension'],parseInt(_0x31ec2c['priority'],0xa)+0x1);_0x31ec2c['close']();}}else{logger[_0xdcc1('0xa')](util[_0xdcc1('0xf')]('Project\x20%s\x20not\x20found',_0x31ec2c['arg_1']));_0x31ec2c[_0xdcc1('0x4e')](_0x31ec2c[_0xdcc1('0x40')],_0x31ec2c[_0xdcc1('0x41')],parseInt(_0x31ec2c[_0xdcc1('0x42')],0xa)+0x1);_0x31ec2c['close']();}}function main(){var _0x335b3c;return utilLicense[_0xdcc1('0x50')]()[_0xdcc1('0x2d')](function(_0xd8426){if(_0xd8426){if(_0xd8426['voice']){if(_0xd8426[_0xdcc1('0x51')]&&_0xd8426['callysquare']>0x0){logger['info'](util[_0xdcc1('0xf')](_0xdcc1('0x52'),_0xd8426['callysquare']));_0x335b3c=_0xd8426[_0xdcc1('0x51')];}else{logger['info'](_0xdcc1('0x53'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x335b3c=-0x1;}}})[_0xdcc1('0x2e')](function(_0x4d6800){logger[_0xdcc1('0xa')](_0xdcc1('0x54'),_0x4d6800[_0xdcc1('0xb')]);})['finally'](function(){var _0x78224e=require(_0xdcc1('0x55'))(config['agi'][_0xdcc1('0xe')],config[_0xdcc1('0x4')]['ip'],_0x335b3c);_0x78224e['on'](_0xdcc1('0xa'),errorHandler);_0x78224e['on'](_0xdcc1('0x56'),listeningHandler);_0x78224e['on'](_0xdcc1('0x57'),connectionHandler);_0x78224e['on'](_0xdcc1('0x37'),closeHandler);});}main();
\ No newline at end of file
+var _0x9710=['format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','catch','createSquareReport','then','indexOf','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','code','result','response','isUndefined','agicommand\x20not\x20found','finally','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','port','listening','connection','xml2json','lodash','syncho','util','moment','../../config/logger','agi','./mailRpc','./graph','./vertices','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info'];(function(_0x213b27,_0x3a531a){var _0x2c04ee=function(_0x538d00){while(--_0x538d00){_0x213b27['push'](_0x213b27['shift']());}};_0x2c04ee(++_0x3a531a);}(_0x9710,0x15f));var _0x0971=function(_0xa378fa,_0x25f844){_0xa378fa=_0xa378fa-0x0;var _0x5c8183=_0x9710[_0xa378fa];return _0x5c8183;};'use strict';var parser=require(_0x0971('0x0'));var _=require(_0x0971('0x1'));var syncho=require(_0x0971('0x2'));var util=require(_0x0971('0x3'));var moment=require(_0x0971('0x4'));var config=require('../../config/environment');var logger=require(_0x0971('0x5'))(_0x0971('0x6'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require(_0x0971('0x7'));var Graph=require(_0x0971('0x8'));var Vertices=require(_0x0971('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0971('0x6')]=_[_0x0971('0xa')](config[_0x0971('0x6')],{'ip':_0x0971('0xb'),'port':0x11dd});function connectionHandler(_0x1b02a3){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x1b02a3);agiHandler(_0x1b02a3);}catch(_0xfa5ee6){logger[_0x0971('0xc')](_0xfa5ee6[_0x0971('0xd')]);}});});}function listeningHandler(){console[_0x0971('0xe')](_0x0971('0xf'),config['agi']['port']);logger[_0x0971('0x10')](util[_0x0971('0x11')](_0x0971('0x12'),config[_0x0971('0x6')]['ip'],config[_0x0971('0x6')]['port']));}function errorHandler(_0x1a06f9){if(_0x1a06f9&&_0x1a06f9[_0x0971('0x13')]&&_0x1a06f9[_0x0971('0x14')]){logger['error'](util['format'](_0x0971('0x15'),_0x1a06f9[_0x0971('0x13')],_0x1a06f9[_0x0971('0x14')]));}else{logger[_0x0971('0xc')](util[_0x0971('0x11')]('[ERROR]\x20%s',_0x1a06f9[_0x0971('0xd')]));}}function closeHandler(){logger[_0x0971('0x10')](util[_0x0971('0x11')](_0x0971('0x16'),this[_0x0971('0x17')],this[_0x0971('0x18')],this[_0x0971('0x19')],this[_0x0971('0x1a')],this['uniqueid']));try{createSquareReport(this);}catch(_0x4e2d98){logger['error'](_0x4e2d98[_0x0971('0xd')]);}}function timeoutHandler(){logger[_0x0971('0x10')](util[_0x0971('0x11')](_0x0971('0x1b'),this['arg_1'],this[_0x0971('0x18')],this['callerid'],this['dnid'],this[_0x0971('0x1c')]));}function hangupHandler(){logger['info'](util[_0x0971('0x11')](_0x0971('0x1d'),this[_0x0971('0x17')],this[_0x0971('0x18')],this['callerid'],this[_0x0971('0x1a')],this[_0x0971('0x1c')]));this[_0x0971('0x1e')]=!![];}function getRoot(_0x128912){return parser[_0x0971('0x1f')](_0x128912,{'object':!![]})[_0x0971('0x20')][_0x0971('0x21')];}function addVertex(_0x3bca08,_0x52fd55,_0x578e17){_0x52fd55[_0x0971('0x22')]=_0x578e17;if(_0x52fd55[_0x0971('0x23')](_0x0971('0x24'))){_0x52fd55[_0x0971('0x25')]=parseInt(_0x52fd55[_0x0971('0x24')],0xa);}_0x3bca08[_0x0971('0x26')](_[_0x0971('0x27')](_0x52fd55,_0x0971('0x28')));}function initGraph(_0x991acc,_0x10a6df){var _0x3a5aa0=new Graph();for(var _0x13968d in _0x991acc){if(_0x991acc[_0x0971('0x23')](_0x13968d)){if(_[_0x0971('0x29')](_0x991acc[_0x13968d])){for(var _0x3771b7=0x0;_0x3771b7<_0x991acc[_0x13968d][_0x0971('0x2a')];_0x3771b7+=0x1){addVertex(_0x3a5aa0,_0x991acc[_0x13968d][_0x3771b7],_0x13968d);}}else{addVertex(_0x3a5aa0,_0x991acc[_0x13968d],_0x13968d);}}}for(var _0x4d9e4b=0x0;_0x4d9e4b<_0x10a6df[_0x0971('0x2a')];_0x4d9e4b+=0x1){if(_0x10a6df[_0x4d9e4b][_0x0971('0x2b')]&&_0x10a6df[_0x4d9e4b][_0x0971('0x2c')]){_0x3a5aa0[_0x0971('0x2d')](_0x10a6df[_0x4d9e4b][_0x0971('0x2b')],_0x10a6df[_0x4d9e4b][_0x0971('0x2c')],_0x10a6df[_0x4d9e4b][_0x0971('0x2e')]);}}return _0x3a5aa0;}function getSquareProject(_0x35bcc9,_0x2024c9){rpc['getSquareProject'](_0x35bcc9)['then'](function(_0x390ffe){_0x2024c9(null,_0x390ffe);})[_0x0971('0x2f')](function(_0x67201d){_0x2024c9(null,_0x67201d);});}function createSquareReport(_0x1132ac,_0x2a8f69){rpc[_0x0971('0x30')](_0x1132ac)[_0x0971('0x31')](function(_0x3e7860){if(_0x2a8f69){_0x2a8f69(null,_0x3e7860);}})[_0x0971('0x2f')](function(_0x1d12ef){if(_0x2a8f69){_0x2a8f69(null,_0x1d12ef);}});}function setChannelVariables(_0x133b23){for(var _0xf0272b in _0x133b23){if(_0x133b23['hasOwnProperty'](_0xf0272b)){if(_0xf0272b[_0x0971('0x32')]('agi_')===0x0){_0x133b23[_0xf0272b['substring'](0x4)]=_0x133b23[_0xf0272b];delete _0x133b23[_0xf0272b];}}}}function getLogFromObject(_0xcedcda){return util[_0x0971('0x33')](_0xcedcda,{'showHidden':![],'depth':null});}function agiHandler(_0x27a13b){var _0x3163a5,_0x59790f,_0x8cf133,_0x3cb72e,_0x377af2;logger[_0x0971('0x34')](_0x0971('0x35'),JSON[_0x0971('0x36')](_0x27a13b,null,0x2));logger['info'](util[_0x0971('0x11')](_0x0971('0x37'),_0x27a13b[_0x0971('0x17')],_0x27a13b[_0x0971('0x18')],_0x27a13b[_0x0971('0x19')],_0x27a13b[_0x0971('0x1a')],_0x27a13b[_0x0971('0x1c')]));_0x27a13b['on'](_0x0971('0xc'),errorHandler);_0x27a13b['on'](_0x0971('0x38'),closeHandler);_0x27a13b['on'](_0x0971('0x39'),timeoutHandler);_0x27a13b[_0x0971('0x1e')]=![];_0x27a13b['on']('hangup',hangupHandler);var _0x14a2aa=getSquareProject[_0x0971('0x3a')](null,_0x27a13b[_0x0971('0x17')]);if(_0x14a2aa){if(_0x14a2aa[_0x0971('0x3b')]){_0x3163a5=getRoot(_0x14a2aa[_0x0971('0x3b')]);if(_0x3163a5&&_0x3163a5[_0x0971('0x3c')]){logger[_0x0971('0x34')](_0x0971('0x21'),JSON[_0x0971('0x36')](_0x3163a5,null,0x2));_0x27a13b[_0x0971('0x3d')]=moment()[_0x0971('0x11')](_0x0971('0x3e'));_0x59790f=initGraph(_[_0x0971('0x27')](_0x3163a5,'mxCell'),_0x3163a5['mxCell']);_0x8cf133=new Vertices(_0x27a13b,rpc,mailRpc);logger['info'](util['format'](_0x0971('0x3f'),_0x27a13b[_0x0971('0x17')],_0x27a13b[_0x0971('0x18')],_0x27a13b['callerid'],_0x27a13b['dnid'],_0x27a13b[_0x0971('0x1c')]));_0x59790f[_0x0971('0x40')](_0x3163a5[_0x0971('0x3c')]['id'],function(_0x1228c7){try{_0x1228c7=_0x8cf133[_0x0971('0x41')](_0x1228c7);logger['debug'](_0x0971('0x42'),JSON['stringify'](_0x1228c7,null,0x2));if(_0x1228c7['agicommand']===_0x0971('0x43')){logger[_0x0971('0x10')](_0x0971('0x44'));_0x27a13b[_0x0971('0x45')]=_0x1228c7['context']||_0x27a13b[_0x0971('0x45')];_0x27a13b['extension']=_0x1228c7['extension'];_0x27a13b[_0x0971('0x46')]=_0x1228c7[_0x0971('0x46')]?_0x1228c7['priority']-0x1:0x1;return null;}else if(_0x1228c7&&_0x8cf133[_0x1228c7[_0x0971('0x22')]]){_0x377af2=_0x8cf133[_0x1228c7[_0x0971('0x22')]](_0x1228c7);logger[_0x0971('0x10')]('response',JSON[_0x0971('0x36')](_0x377af2,null,0x2));if(_0x377af2&&_0x377af2[_0x0971('0x47')]===AGI_CODE_SUCCESS&&_0x377af2[_0x0971('0x48')]!==AGI_RESULT_ERROR&&!_0x27a13b[_0x0971('0x1e')]){logger[_0x0971('0x34')](_0x0971('0x49'),getLogFromObject(_0x377af2));return _[_0x0971('0x4a')](_0x377af2[_0x0971('0x48')])?null:_0x377af2[_0x0971('0x48')]['toString']();}else{logger[_0x0971('0xc')](_0x0971('0x49'),getLogFromObject(_0x377af2));return null;}}else{logger['error'](_0x0971('0x4b'));return null;}}catch(_0xe532d3){logger[_0x0971('0xc')](_0xe532d3[_0x0971('0xd')]);return null;}});if(_0x3163a5[_0x0971('0x4c')]){logger[_0x0971('0x10')](util[_0x0971('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x27a13b[_0x0971('0x17')],_0x27a13b[_0x0971('0x18')],_0x27a13b[_0x0971('0x19')],_0x27a13b[_0x0971('0x1a')],_0x27a13b['uniqueid']));_0x59790f[_0x0971('0x40')](_0x3163a5[_0x0971('0x4c')]['id'],function(_0x2fe2b1){try{_0x2fe2b1=_0x8cf133[_0x0971('0x41')](_0x2fe2b1);logger['debug'](_0x0971('0x42'),JSON[_0x0971('0x36')](_0x2fe2b1,null,0x2));if(_0x2fe2b1&&_0x8cf133[_0x2fe2b1[_0x0971('0x22')]]){_0x377af2=_0x8cf133[_0x2fe2b1['agicommand']](_0x2fe2b1);if(_0x377af2){logger[_0x0971('0x34')](_0x0971('0x49'),getLogFromObject(_0x377af2));return _['isUndefined'](_0x377af2[_0x0971('0x48')])?null:_0x377af2[_0x0971('0x48')][_0x0971('0x4d')]();}else{logger[_0x0971('0xc')](_0x0971('0x49'),getLogFromObject(_0x377af2));return null;}}else{logger[_0x0971('0xc')](_0x0971('0x4b'));return null;}}catch(_0x44b450){logger[_0x0971('0xc')](_0x44b450[_0x0971('0xd')]);return null;}});}logger['info'](util[_0x0971('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x27a13b[_0x0971('0x17')],_0x27a13b['calleridname'],_0x27a13b[_0x0971('0x19')],_0x27a13b['dnid'],_0x27a13b[_0x0971('0x1c')]));logger[_0x0971('0x10')](util[_0x0971('0x11')](_0x0971('0x4e'),_0x27a13b['context'],_0x27a13b[_0x0971('0x4f')],parseInt(_0x27a13b[_0x0971('0x46')],0xa)+0x1));_0x27a13b[_0x0971('0x50')](_0x27a13b['context'],_0x27a13b[_0x0971('0x4f')],parseInt(_0x27a13b[_0x0971('0x46')],0xa)+0x1);_0x27a13b[_0x0971('0x38')]();}}else{logger[_0x0971('0xc')](util[_0x0971('0x11')](_0x0971('0x51'),_0x27a13b['arg_1']));_0x27a13b[_0x0971('0x50')](_0x27a13b[_0x0971('0x45')],_0x27a13b[_0x0971('0x4f')],parseInt(_0x27a13b[_0x0971('0x46')],0xa)+0x1);_0x27a13b[_0x0971('0x38')]();}}else{logger[_0x0971('0xc')](util[_0x0971('0x11')](_0x0971('0x52'),_0x27a13b['arg_1']));_0x27a13b[_0x0971('0x50')](_0x27a13b['context'],_0x27a13b[_0x0971('0x4f')],parseInt(_0x27a13b[_0x0971('0x46')],0xa)+0x1);_0x27a13b[_0x0971('0x38')]();}}function main(){var _0x744947;return utilLicense[_0x0971('0x53')]()[_0x0971('0x31')](function(_0x507187){if(_0x507187){if(_0x507187['voice']){if(_0x507187[_0x0971('0x54')]&&_0x507187[_0x0971('0x54')]>0x0){logger[_0x0971('0x10')](util[_0x0971('0x11')](_0x0971('0x55'),_0x507187[_0x0971('0x54')]));_0x744947=_0x507187[_0x0971('0x54')];}else{logger['info'](_0x0971('0x56'));}}else{logger[_0x0971('0x10')](_0x0971('0x57'));_0x744947=-0x1;}}})[_0x0971('0x2f')](function(_0x1ee2c2){logger[_0x0971('0xc')](_0x0971('0x58'),_0x1ee2c2['stack']);})[_0x0971('0x4c')](function(){var _0x44d991=require('./server')(config[_0x0971('0x6')][_0x0971('0x59')],config[_0x0971('0x6')]['ip'],_0x744947);_0x44d991['on'](_0x0971('0xc'),errorHandler);_0x44d991['on'](_0x0971('0x5a'),listeningHandler);_0x44d991['on'](_0x0971('0x5b'),connectionHandler);_0x44d991['on'](_0x0971('0x38'),closeHandler);});}main();
\ No newline at end of file
index fe01a3c..308f0e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa697=['catch','sendMailMessage','SendMail','jayson/promise','client','http','then','message','result'];(function(_0x26a20e,_0x397ab0){var _0x454043=function(_0x433a72){while(--_0x433a72){_0x26a20e['push'](_0x26a20e['shift']());}};_0x454043(++_0x397ab0);}(_0xa697,0x162));var _0x7a69=function(_0x47d02e,_0x33211b){_0x47d02e=_0x47d02e-0x0;var _0x2edb9a=_0xa697[_0x47d02e];return _0x2edb9a;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x7a69('0x0'));var client=jayson[_0x7a69('0x1')][_0x7a69('0x2')]({'port':0x232b});function request(_0x1a137c,_0x158212){return new BPromise(function(_0x3d7aa4,_0x1df614){return client['request'](_0x1a137c,_0x158212)[_0x7a69('0x3')](function(_0x358688){if(_0x358688['error']){return _0x1df614(_0x358688['error'][_0x7a69('0x4')]);}else{return _0x3d7aa4(_0x358688[_0x7a69('0x5')]);}})[_0x7a69('0x6')](function(_0x431e65){return _0x1df614(_0x431e65);});});}exports[_0x7a69('0x7')]=function(_0x475451,_0x46450c){return request(_0x7a69('0x8'),{'account':_0x475451,'message':_0x46450c});};
\ No newline at end of file
+var _0x58c6=['message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','error'];(function(_0x5c7198,_0x198b54){var _0x530b11=function(_0x5f5f1a){while(--_0x5f5f1a){_0x5c7198['push'](_0x5c7198['shift']());}};_0x530b11(++_0x198b54);}(_0x58c6,0x16c));var _0x658c=function(_0x4695ba,_0x5a7f2a){_0x4695ba=_0x4695ba-0x0;var _0x524b7d=_0x58c6[_0x4695ba];return _0x524b7d;};'use strict';var BPromise=require(_0x658c('0x0'));var jayson=require(_0x658c('0x1'));var client=jayson[_0x658c('0x2')]['http']({'port':0x232b});function request(_0x294d47,_0x377ef8){return new BPromise(function(_0x9d7b32,_0x3e2944){return client['request'](_0x294d47,_0x377ef8)['then'](function(_0x60e11){if(_0x60e11[_0x658c('0x3')]){return _0x3e2944(_0x60e11[_0x658c('0x3')][_0x658c('0x4')]);}else{return _0x9d7b32(_0x60e11['result']);}})[_0x658c('0x5')](function(_0x18a890){return _0x3e2944(_0x18a890);});});}exports[_0x658c('0x6')]=function(_0x1ece2b,_0x3f0937){return request(_0x658c('0x7'),{'account':_0x1ece2b,'message':_0x3f0937});};
\ No newline at end of file
index f57c791..618295c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5884=['util','stream','call','_inBody','inherits','prototype','_transform','_localBuffer','indexOf','substring','length','split','slice','trim','headers','emit','line','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5884,0x144));var _0x4588=function(_0x4a9e89,_0x7529fc){_0x4a9e89=_0x4a9e89-0x0;var _0x24007d=_0x5884[_0x4a9e89];return _0x24007d;};'use strict';var util=require(_0x4588('0x0'));var Transform=require(_0x4588('0x1'))['Transform'];function AGIReply(_0x51c268){Transform[_0x4588('0x2')](this,_0x51c268);this['_localBuffer']='';this[_0x4588('0x3')]=![];}util[_0x4588('0x4')](AGIReply,Transform);AGIReply[_0x4588('0x5')][_0x4588('0x6')]=function(_0x4a8bec,_0x16a4ee,_0x4d0829){var _0x50b183='\x0a',_0x2c7457=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0xac0b6=-0x1,_0x4487a5=-0x1,_0x315c59='',_0x34de9c=0x0,_0x14ce57='',_0x38d233='';this[_0x4588('0x7')]+=_0x4a8bec['toString']();_0x14ce57=this['_localBuffer'];if(!this[_0x4588('0x3')]){_0x34de9c=0x0;while(_0x2c7457[_0x34de9c]){while((_0x4487a5=_0x14ce57[_0x4588('0x8')](_0x2c7457[_0x34de9c]))!=-0x1){_0x315c59=_0x2c7457[_0x34de9c];_0x38d233=_0x14ce57[_0x4588('0x9')](0x0,_0x4487a5);_0x14ce57=_0x14ce57[_0x4588('0x9')](_0x4487a5+_0x315c59[_0x4588('0xa')]);var _0x4eb3b=_0x38d233[_0x4588('0xb')](_0x50b183),_0x44516e=0x0,_0x3a12d4={},_0x356099='',_0x452bf6='',_0x306001=-0x1;while(_0x4eb3b[_0x44516e]){_0x306001=_0x4eb3b[_0x44516e][_0x4588('0x8')](':');if(_0x306001!=-0x1){_0x356099=_0x4eb3b[_0x44516e]['slice'](0x0,_0x306001)['trim']();_0x452bf6=_0x4eb3b[_0x44516e][_0x4588('0xc')](_0x306001+0x1)[_0x4588('0xd')]();if(_0x356099[_0x4588('0xa')]>0x0){_0x3a12d4[_0x356099]=_0x452bf6;}}else{}_0x44516e++;}this['emit'](_0x4588('0xe'),_0x3a12d4);this['_inBody']=!![];}_0x34de9c++;}this[_0x4588('0x7')]=_0x14ce57;}else{while((_0xac0b6=_0x14ce57['indexOf'](_0x50b183))!=-0x1){_0x38d233=_0x14ce57[_0x4588('0x9')](0x0,_0xac0b6);this[_0x4588('0xf')](_0x4588('0x10'),_0x38d233);_0x14ce57=_0x14ce57[_0x4588('0x9')](_0xac0b6+_0x50b183[_0x4588('0xa')]);}this[_0x4588('0x7')]=_0x14ce57;}_0x4d0829();};module[_0x4588('0x11')]=AGIReply;
\ No newline at end of file
+var _0xfa9d=['toString','_localBuffer','indexOf','substring','trim','length','emit','headers','exports','Transform','call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x140b0f,_0x507fce){var _0x5b22ee=function(_0x407922){while(--_0x407922){_0x140b0f['push'](_0x140b0f['shift']());}};_0x5b22ee(++_0x507fce);}(_0xfa9d,0x1c9));var _0xdfa9=function(_0x60cf2,_0x4c1433){_0x60cf2=_0x60cf2-0x0;var _0x23aa18=_0xfa9d[_0x60cf2];return _0x23aa18;};'use strict';var util=require('util');var Transform=require('stream')[_0xdfa9('0x0')];function AGIReply(_0x28afd7){Transform[_0xdfa9('0x1')](this,_0x28afd7);this['_localBuffer']='';this[_0xdfa9('0x2')]=![];}util[_0xdfa9('0x3')](AGIReply,Transform);AGIReply[_0xdfa9('0x4')][_0xdfa9('0x5')]=function(_0x3fc3b5,_0x2e4c54,_0x5e2a06){var _0x47a38c='\x0a',_0x3f89cb=['\x0a\x0a',_0xdfa9('0x6')],_0xa9322e=-0x1,_0x5aa32f=-0x1,_0x4bd3ad='',_0x12a54e=0x0,_0x40f844='',_0x308a3f='';this['_localBuffer']+=_0x3fc3b5[_0xdfa9('0x7')]();_0x40f844=this[_0xdfa9('0x8')];if(!this[_0xdfa9('0x2')]){_0x12a54e=0x0;while(_0x3f89cb[_0x12a54e]){while((_0x5aa32f=_0x40f844[_0xdfa9('0x9')](_0x3f89cb[_0x12a54e]))!=-0x1){_0x4bd3ad=_0x3f89cb[_0x12a54e];_0x308a3f=_0x40f844[_0xdfa9('0xa')](0x0,_0x5aa32f);_0x40f844=_0x40f844[_0xdfa9('0xa')](_0x5aa32f+_0x4bd3ad['length']);var _0x54a7ec=_0x308a3f['split'](_0x47a38c),_0x595f75=0x0,_0x5c595d={},_0x4a2b47='',_0x5618ce='',_0x23d095=-0x1;while(_0x54a7ec[_0x595f75]){_0x23d095=_0x54a7ec[_0x595f75][_0xdfa9('0x9')](':');if(_0x23d095!=-0x1){_0x4a2b47=_0x54a7ec[_0x595f75]['slice'](0x0,_0x23d095)[_0xdfa9('0xb')]();_0x5618ce=_0x54a7ec[_0x595f75]['slice'](_0x23d095+0x1)[_0xdfa9('0xb')]();if(_0x4a2b47[_0xdfa9('0xc')]>0x0){_0x5c595d[_0x4a2b47]=_0x5618ce;}}else{}_0x595f75++;}this[_0xdfa9('0xd')](_0xdfa9('0xe'),_0x5c595d);this[_0xdfa9('0x2')]=!![];}_0x12a54e++;}this[_0xdfa9('0x8')]=_0x40f844;}else{while((_0xa9322e=_0x40f844[_0xdfa9('0x9')](_0x47a38c))!=-0x1){_0x308a3f=_0x40f844[_0xdfa9('0xa')](0x0,_0xa9322e);this['emit']('line',_0x308a3f);_0x40f844=_0x40f844[_0xdfa9('0xa')](_0xa9322e+_0x47a38c['length']);}this[_0xdfa9('0x8')]=_0x40f844;}_0x5e2a06();};module[_0xdfa9('0xf')]=AGIReply;
\ No newline at end of file
index 099c442..bab6aad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf31e=['getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareReport','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn'];(function(_0x57dbce,_0x2a4604){var _0x2ab396=function(_0x321f80){while(--_0x321f80){_0x57dbce['push'](_0x57dbce['shift']());}};_0x2ab396(++_0x2a4604);}(_0xf31e,0x16f));var _0xef31=function(_0x1cccb6,_0x5703d2){_0x1cccb6=_0x1cccb6-0x0;var _0x220cc7=_0xf31e[_0x1cccb6];return _0x220cc7;};'use strict';var BPromise=require(_0xef31('0x0'));var moment=require(_0xef31('0x1'));var _=require('lodash');var util=require(_0xef31('0x2'));var jayson=require(_0xef31('0x3'));var client=jayson['client'][_0xef31('0x4')]({'port':0x2329});function request(_0x1f52db,_0x2ffe1e){return new BPromise(function(_0x10c7c7,_0x4c187f){return client[_0xef31('0x5')](_0x1f52db,_0x2ffe1e)[_0xef31('0x6')](function(_0x14d63a){if(_0x14d63a['error']){return _0x4c187f(_0x14d63a[_0xef31('0x7')]['message']);}else{return _0x10c7c7(_0x14d63a[_0xef31('0x8')]);}})[_0xef31('0x9')](function(_0x3dab14){return _0x4c187f(_0x3dab14);});});}exports[_0xef31('0xa')]=function(_0x47092b){return request(_0xef31('0xb'),{'options':{'raw':![],'where':{'name':_0x47092b},'attributes':[_0xef31('0xc')]}});};exports[_0xef31('0xd')]=function(_0x1c2686){return request(_0xef31('0xe'),{'options':{'raw':![],'where':{'id':_0x1c2686},'include':[{'model':_0xef31('0xf'),'as':'Smtp'}],'attributes':['id',_0xef31('0x10'),_0xef31('0x11')]}});};exports[_0xef31('0x12')]=function(_0x1c72cd){return request(_0xef31('0xb'),{'options':{'where':{'id':_0x1c72cd},'attributes':[_0xef31('0x10')]}});};exports[_0xef31('0x13')]=function(_0x8b6b69){return request(_0xef31('0x14'),{'options':{'where':{'id':_0x8b6b69},'attributes':[_0xef31('0x10')]}});};exports[_0xef31('0x15')]=function(_0x5ba8d2){return request(_0xef31('0x16'),{'options':{'where':{'id':_0x5ba8d2},'attributes':[_0xef31('0x10')]}});};exports[_0xef31('0x17')]=function(_0x272e9d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x272e9d},'attributes':[_0xef31('0x18')]}});};exports[_0xef31('0x19')]=function(_0x3c44c3){return request(_0xef31('0x1a'),{'options':{'where':{'id':_0x3c44c3},'attributes':[_0xef31('0x10')]}});};exports[_0xef31('0x1b')]=function(_0x2c1058){return request(_0xef31('0x1c'),{'options':{'where':{'id':_0x2c1058},'attributes':[_0xef31('0x10')]}});};exports[_0xef31('0x1d')]=function(_0x576ccb){return request(_0xef31('0x1e'),{'options':{'where':{'id':_0x576ccb},'attributes':[_0xef31('0x1f')]}});};exports['getIntervalById']=function(_0x181952){return request(_0xef31('0x20'),{'options':{'raw':![],'where':{'id':_0x181952},'include':[{'model':_0xef31('0x21'),'as':_0xef31('0x22')}]}});};exports[_0xef31('0x23')]=function(_0x2b4461){return request(_0xef31('0x24'),{'options':{'where':{'id':_0x2b4461},'attributes':['id','name']}});};exports[_0xef31('0x25')]=function(_0x54aeb8){return request('CreateSmsMessage',{'body':_0x54aeb8});};exports[_0xef31('0x26')]=function(_0x5a9387){return request('CreateSquareDetailsReport',{'body':_0x5a9387});};exports['createSquareReport']=function(_0x18c759){return request(_0xef31('0x27'),{'body':_['merge'](_0x18c759,{'project_name':_0x18c759['arg_1'],'prev_project_name':_0x18c759[_0xef31('0x28')]||'','is_subproject':_0x18c759['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xef31('0x29'))})});};exports[_0xef31('0x2a')]=function(_0x1c6eeb){return request(_0xef31('0x2b'),{'body':_0x1c6eeb});};exports['createSquareMessage']=function(_0x4b958d){return request(_0xef31('0x2c'),{'body':_0x4b958d});};exports['createCmContact']=function(_0x532b78){return request(_0xef31('0x2d'),{'options':{'raw':![],'where':{'phone':_0x532b78['phone'],'ListId':_0x532b78['ListId']}}})['then'](function(_0xe24c31){if(_0xe24c31){return _0xe24c31;}return request('CreateCmContact',{'body':_0x532b78});});};exports[_0xef31('0x2e')]=function(_0x487c93){return request(_0xef31('0x2f'),{'options':{'where':{'id':_0x487c93},'attributes':[_0xef31('0x10')]}});};exports[_0xef31('0x30')]=function(_0x4a93ee,_0x3fbaba){return request(_0xef31('0x31'),{'body':{'interface':_0x3fbaba},'options':{'where':_0x4a93ee}});};exports[_0xef31('0x32')]=function(_0x4ceeb8,_0x415be7,_0x5c8197){return request(_0xef31('0x33'),{'body':{'type':_0x415be7,'uniqueid':_0x5c8197},'options':{'where':_0x4ceeb8}});};exports[_0xef31('0x34')]=function(_0x43a9fa){return request(_0xef31('0x35'),{'body':{},'options':{'where':_0x43a9fa}});};exports[_0xef31('0x36')]=function(_0x214369){return request(_0xef31('0x37'),{'body':{},'options':{'where':_0x214369}});};
\ No newline at end of file
+var _0x7e52=['name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','ShowUser','getSoundById','save_name','getIntervalById','ShowInterval','Interval','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','ShowCmHopper','phone','CreateCmContact','getPauseById','agentLogin','agentPause','PauseUser','LogoutUser','bluebird','moment','jayson/promise','client','http','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp'];(function(_0x3c16c2,_0x46b0a9){var _0x23f49c=function(_0x4b8c99){while(--_0x4b8c99){_0x3c16c2['push'](_0x3c16c2['shift']());}};_0x23f49c(++_0x46b0a9);}(_0x7e52,0x128));var _0x27e5=function(_0x564ca8,_0x44c738){_0x564ca8=_0x564ca8-0x0;var _0x28b4c3=_0x7e52[_0x564ca8];return _0x28b4c3;};'use strict';var BPromise=require(_0x27e5('0x0'));var moment=require(_0x27e5('0x1'));var _=require('lodash');var util=require('util');var jayson=require(_0x27e5('0x2'));var client=jayson[_0x27e5('0x3')][_0x27e5('0x4')]({'port':0x2329});function request(_0x56e43e,_0x2e8c68){return new BPromise(function(_0x365c94,_0x5a903f){return client['request'](_0x56e43e,_0x2e8c68)[_0x27e5('0x5')](function(_0x2df187){if(_0x2df187[_0x27e5('0x6')]){return _0x5a903f(_0x2df187[_0x27e5('0x6')][_0x27e5('0x7')]);}else{return _0x365c94(_0x2df187[_0x27e5('0x8')]);}})[_0x27e5('0x9')](function(_0x815b8f){return _0x5a903f(_0x815b8f);});});}exports[_0x27e5('0xa')]=function(_0x3d93dc){return request(_0x27e5('0xb'),{'options':{'raw':![],'where':{'name':_0x3d93dc},'attributes':[_0x27e5('0xc')]}});};exports[_0x27e5('0xd')]=function(_0x4b75c3){return request(_0x27e5('0xe'),{'options':{'raw':![],'where':{'id':_0x4b75c3},'include':[{'model':'MailServerOut','as':_0x27e5('0xf')}],'attributes':['id',_0x27e5('0x10'),_0x27e5('0x11')]}});};exports[_0x27e5('0x12')]=function(_0x59e1fa){return request(_0x27e5('0xb'),{'options':{'where':{'id':_0x59e1fa},'attributes':['name']}});};exports[_0x27e5('0x13')]=function(_0xfa30fc){return request(_0x27e5('0x14'),{'options':{'where':{'id':_0xfa30fc},'attributes':[_0x27e5('0x10')]}});};exports[_0x27e5('0x15')]=function(_0x5b9102){return request(_0x27e5('0x16'),{'options':{'where':{'id':_0x5b9102},'attributes':[_0x27e5('0x10')]}});};exports[_0x27e5('0x17')]=function(_0x10d290){return request(_0x27e5('0x18'),{'options':{'where':{'id':_0x10d290},'attributes':['dsn']}});};exports['getUserById']=function(_0x2c77c3){return request(_0x27e5('0x19'),{'options':{'where':{'id':_0x2c77c3},'attributes':[_0x27e5('0x10')]}});};exports['getTrunkById']=function(_0x1cde84){return request('ShowTrunk',{'options':{'where':{'id':_0x1cde84},'attributes':[_0x27e5('0x10')]}});};exports[_0x27e5('0x1a')]=function(_0x4174bd){return request('ShowSound',{'options':{'where':{'id':_0x4174bd},'attributes':[_0x27e5('0x1b')]}});};exports[_0x27e5('0x1c')]=function(_0x1696b4){return request(_0x27e5('0x1d'),{'options':{'raw':![],'where':{'id':_0x1696b4},'include':[{'model':_0x27e5('0x1e'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0xf1e676){return request(_0x27e5('0x1f'),{'options':{'where':{'id':_0xf1e676},'attributes':['id','name']}});};exports[_0x27e5('0x20')]=function(_0x171774){return request(_0x27e5('0x21'),{'body':_0x171774});};exports['createSquareDetailsReport']=function(_0x3ba4f8){return request(_0x27e5('0x22'),{'body':_0x3ba4f8});};exports[_0x27e5('0x23')]=function(_0x3bda8e){return request(_0x27e5('0x24'),{'body':_[_0x27e5('0x25')](_0x3bda8e,{'project_name':_0x3bda8e[_0x27e5('0x26')],'prev_project_name':_0x3bda8e[_0x27e5('0x27')]||'','is_subproject':_0x3bda8e[_0x27e5('0x27')]?!![]:![],'leaveAt':moment()[_0x27e5('0x28')](_0x27e5('0x29'))})});};exports[_0x27e5('0x2a')]=function(_0x57c126){return request(_0x27e5('0x2b'),{'body':_0x57c126});};exports['createSquareMessage']=function(_0x4f29aa){return request('CreateSquareMessage',{'body':_0x4f29aa});};exports['createCmContact']=function(_0x143261){return request(_0x27e5('0x2c'),{'options':{'raw':![],'where':{'phone':_0x143261[_0x27e5('0x2d')],'ListId':_0x143261['ListId']}}})[_0x27e5('0x5')](function(_0x52a9e5){if(_0x52a9e5){return _0x52a9e5;}return request(_0x27e5('0x2e'),{'body':_0x143261});});};exports[_0x27e5('0x2f')]=function(_0x4457c1){return request('ShowPause',{'options':{'where':{'id':_0x4457c1},'attributes':['name']}});};exports[_0x27e5('0x30')]=function(_0x1a6364,_0x1454df){return request('LoginUser',{'body':{'interface':_0x1454df},'options':{'where':_0x1a6364}});};exports[_0x27e5('0x31')]=function(_0x3e650d,_0x5899fc,_0x12c537){return request(_0x27e5('0x32'),{'body':{'type':_0x5899fc,'uniqueid':_0x12c537},'options':{'where':_0x3e650d}});};exports['agentUnpause']=function(_0x548e2e){return request('UnpauseUser',{'body':{},'options':{'where':_0x548e2e}});};exports['agentLogout']=function(_0x450d16){return request(_0x27e5('0x33'),{'body':{},'options':{'where':_0x450d16}});};
\ No newline at end of file
index 07816a9..ca18346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04e7=['exports','./polly','./lex'];(function(_0x1b7d3e,_0xa4cadf){var _0xe9147f=function(_0x4a5dad){while(--_0x4a5dad){_0x1b7d3e['push'](_0x1b7d3e['shift']());}};_0xe9147f(++_0xa4cadf);}(_0x04e7,0x121));var _0x704e=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x04e7[_0x4e4519];return _0x340044;};var polly=require(_0x704e('0x0'));var lex=require(_0x704e('0x1'));module[_0x704e('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xa498=['./lex','exports'];(function(_0x1d1dd9,_0x1f314b){var _0x5938a9=function(_0x32474e){while(--_0x32474e){_0x1d1dd9['push'](_0x1d1dd9['shift']());}};_0x5938a9(++_0x1f314b);}(_0xa498,0x1d6));var _0x8a49=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xa498[_0x18f152];return _0xa10b34;};var polly=require('./polly');var lex=require(_0x8a49('0x0'));module[_0x8a49('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index b2752cb..f86d10a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['./lib/api'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0x2750,0x13b));var _0x0275=function(_0x2da614,_0x3e0643){_0x2da614=_0x2da614-0x0;var _0xdebb83=_0x2750[_0x2da614];return _0xdebb83;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);};
\ No newline at end of file
+var _0x2547=['exports'];(function(_0x5bc28a,_0x4e4a83){var _0x22d5f8=function(_0x21d600){while(--_0x21d600){_0x5bc28a['push'](_0x5bc28a['shift']());}};_0x22d5f8(++_0x4e4a83);}(_0x2547,0x1cd));var _0x7254=function(_0x51e512,_0x17c5e3){_0x51e512=_0x51e512-0x0;var _0x45602e=_0x2547[_0x51e512];return _0x45602e;};'use strict';var lex=require('./lib/api');module[_0x7254('0x0')]=function(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435){return lex(_0x23e38c,_0x44b692,_0x3ea6e6,_0xbbc747,_0x1a36de,_0x9f3435);};
\ No newline at end of file
index 7ece3ff..bd79c19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1d3b2b,_0xb5f1d8){var _0xc8839f=function(_0x22f036){while(--_0x22f036){_0x1d3b2b['push'](_0x1d3b2b['shift']());}};_0xc8839f(++_0xb5f1d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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(_0x4a0194,_0x4df9af){var _0x32300f=function(_0xd535c3){while(--_0xd535c3){_0x4a0194['push'](_0x4a0194['shift']());}};_0x32300f(++_0x4df9af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 679648a..e4e200f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2f2=['./lib/api','exports'];(function(_0x571c00,_0x3ae028){var _0x2887df=function(_0x5ebe70){while(--_0x5ebe70){_0x571c00['push'](_0x571c00['shift']());}};_0x2887df(++_0x3ae028);}(_0xa2f2,0x1a8));var _0x2a2f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa2f2[_0x2f5ac5];return _0x37c9a8;};'use strict';var polly=require(_0x2a2f('0x0'));module[_0x2a2f('0x1')]=function(_0xd53f9b,_0x2457a7,_0x1ae79a,_0x259940,_0x38e530,_0x2f1a96,_0x256aea){return polly(_0xd53f9b,_0x2457a7,_0x1ae79a,_0x259940,_0x38e530,_0x2f1a96,_0x256aea);};
\ No newline at end of file
+var _0x7e05=['exports'];(function(_0x4d0e29,_0x540308){var _0x4f4845=function(_0x334c7e){while(--_0x334c7e){_0x4d0e29['push'](_0x4d0e29['shift']());}};_0x4f4845(++_0x540308);}(_0x7e05,0x1ad));var _0x57e0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7e05[_0x397e5f];return _0x5302b8;};'use strict';var polly=require('./lib/api');module[_0x57e0('0x0')]=function(_0x489ebb,_0x3a510e,_0x4daeb5,_0x4eb6b1,_0x54e258,_0x210829,_0x530107){return polly(_0x489ebb,_0x3a510e,_0x4daeb5,_0x4eb6b1,_0x54e258,_0x210829,_0x530107);};
\ No newline at end of file
index 2d774d6..98fa121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x288f=['bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x38db3a,_0x244702){var _0x2ead95=function(_0x558eab){while(--_0x558eab){_0x38db3a['push'](_0x38db3a['shift']());}};_0x2ead95(++_0x244702);}(_0x288f,0x19f));var _0xf288=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x288f[_0xad57ee];return _0x3eaea9;};'use strict';var fs=require('fs');var path=require(_0xf288('0x0'));var BPromise=require(_0xf288('0x1'));var rs=require(_0xf288('0x2'));var AWS=require(_0xf288('0x3'));function pollyResult(_0x6ce67c,_0x19fcc5,_0x1df5b0){return new BPromise(function(_0x53bd7d,_0x54a9d0){_0x6ce67c[_0xf288('0x4')](_0x19fcc5,function(_0x598bdd,_0x1b6fbf){if(_0x598bdd){_0x54a9d0(_0x598bdd);}else if(_0x1b6fbf){if(_0x1b6fbf[_0xf288('0x5')]instanceof Buffer){fs[_0xf288('0x6')](_0x1df5b0,_0x1b6fbf[_0xf288('0x5')],function(_0x2be416){if(_0x2be416){_0x54a9d0(_0x2be416);}else{_0x53bd7d();}});}else{_0x54a9d0(new Error(_0xf288('0x7')));}}else{_0x54a9d0(new Error(_0xf288('0x8')));}});});}module[_0xf288('0x9')]=function(_0xb2c40e,_0x23200e,_0x3fd8d6,_0x5ad409,_0x47ca1e,_0x113072,_0x2532d8){var _0xc0d9e0=new AWS[(_0xf288('0xa'))]({'accessKeyId':_0xb2c40e,'secretAccessKey':_0x23200e,'region':_0x3fd8d6});var _0x2daca3={'Text':_0x47ca1e,'TextType':_0x113072||_0xf288('0xb'),'OutputFormat':_0xf288('0xc'),'VoiceId':_0x5ad409};return pollyResult(_0xc0d9e0,_0x2daca3,_0x2532d8);};
\ No newline at end of file
+var _0x7ea5=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','path','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ea5,0x169));var _0x57ea=function(_0x5427c9,_0x1fce88){_0x5427c9=_0x5427c9-0x0;var _0x1f8c64=_0x7ea5[_0x5427c9];return _0x1f8c64;};'use strict';var fs=require('fs');var path=require(_0x57ea('0x0'));var BPromise=require(_0x57ea('0x1'));var rs=require(_0x57ea('0x2'));var AWS=require(_0x57ea('0x3'));function pollyResult(_0x3f6740,_0x35abdb,_0x28bbdc){return new BPromise(function(_0x40bb34,_0x554e0b){_0x3f6740[_0x57ea('0x4')](_0x35abdb,function(_0x217911,_0x3783f6){if(_0x217911){_0x554e0b(_0x217911);}else if(_0x3783f6){if(_0x3783f6[_0x57ea('0x5')]instanceof Buffer){fs['writeFile'](_0x28bbdc,_0x3783f6[_0x57ea('0x5')],function(_0x280404){if(_0x280404){_0x554e0b(_0x280404);}else{_0x40bb34();}});}else{_0x554e0b(new Error(_0x57ea('0x6')));}}else{_0x554e0b(new Error(_0x57ea('0x7')));}});});}module[_0x57ea('0x8')]=function(_0x16cf2d,_0x243432,_0x2a50d9,_0x382426,_0x1342b6,_0x2e8d30,_0x4e7565){var _0x1a7781=new AWS[(_0x57ea('0x9'))]({'accessKeyId':_0x16cf2d,'secretAccessKey':_0x243432,'region':_0x2a50d9});var _0x41af4c={'Text':_0x1342b6,'TextType':_0x2e8d30||_0x57ea('0xa'),'OutputFormat':'mp3','VoiceId':_0x382426};return pollyResult(_0x1a7781,_0x41af4c,_0x4e7565);};
\ No newline at end of file
index 88b2fa5..9de09e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb73=['./lib/api','exports'];(function(_0xfb9ff9,_0x2e768f){var _0xa1fda=function(_0x17fb1e){while(--_0x17fb1e){_0xfb9ff9['push'](_0xfb9ff9['shift']());}};_0xa1fda(++_0x2e768f);}(_0xdb73,0x122));var _0x3db7=function(_0x5dc922,_0x5bcfc5){_0x5dc922=_0x5dc922-0x0;var _0x20e540=_0xdb73[_0x5dc922];return _0x20e540;};'use strict';var asr=require(_0x3db7('0x0'));module[_0x3db7('0x1')]=function(_0x20f669,_0x199785,_0x191c98,_0x58fe23){return asr(_0x20f669,_0x199785,_0x191c98);};
\ No newline at end of file
+var _0xee1d=['./lib/api','exports'];(function(_0x206f02,_0x36f322){var _0x8a2663=function(_0x5ac031){while(--_0x5ac031){_0x206f02['push'](_0x206f02['shift']());}};_0x8a2663(++_0x36f322);}(_0xee1d,0x11c));var _0xdee1=function(_0x120b0a,_0x37b91e){_0x120b0a=_0x120b0a-0x0;var _0x6c8551=_0xee1d[_0x120b0a];return _0x6c8551;};'use strict';var asr=require(_0xdee1('0x0'));module[_0xdee1('0x1')]=function(_0x1bb904,_0x28821c,_0x1d0daa,_0x7ac3f0){return asr(_0x1bb904,_0x28821c,_0x1d0daa);};
\ No newline at end of file
index 0e41457..3deea40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdb=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x482b34,_0x438c69){var _0x2f730e=function(_0x4102be){while(--_0x4102be){_0x482b34['push'](_0x482b34['shift']());}};_0x2f730e(++_0x438c69);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x159194,_0x5e75ab){_0x159194=_0x159194-0x0;var _0xe77ba3=_0x4fdb[_0x159194];return _0xe77ba3;};'use strict';var url=require(_0xb4fd('0x0'));var BPromise=require(_0xb4fd('0x1'));var fs=require('fs');var host=_0xb4fd('0x2');module[_0xb4fd('0x3')]=function(_0x3b399e,_0xafe34b,_0x260a35){return new BPromise(function(_0xd55d8e,_0x1c0b08){var _0x5b73bb;if(typeof _0x3b399e!==_0xb4fd('0x4')||_0x3b399e['length']===0x0){return _0x1c0b08(_0xb4fd('0x5'));}if(typeof _0xafe34b!=='string'||_0xafe34b['length']===0x0){return _0x1c0b08(_0xb4fd('0x6'));}if(typeof _0x260a35!==_0xb4fd('0x7')&&(typeof _0x260a35!==_0xb4fd('0x4')||_0x260a35['length']===0x0)){return _0x1c0b08('lang\x20should\x20be\x20a\x20string');}try{_0x5b73bb=fs[_0xb4fd('0x8')](_0x3b399e)[_0xb4fd('0x9')](_0xb4fd('0xa'));}catch(_0x4eb1ae){return _0x1c0b08(_0x4eb1ae);}return _0xd55d8e({'method':_0xb4fd('0xb'),'uri':host+_0xb4fd('0xc')+_0xafe34b,'body':{'config':{'encoding':_0xb4fd('0xd'),'sampleRateHertz':_0xb4fd('0xe'),'languageCode':_0x260a35},'audio':{'content':_0x5b73bb}},'json':!![]});});};
\ No newline at end of file
+var _0x9d02=['lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined'];(function(_0xdb4c2,_0x6548e2){var _0x357cfb=function(_0x4e1e9c){while(--_0x4e1e9c){_0xdb4c2['push'](_0xdb4c2['shift']());}};_0x357cfb(++_0x6548e2);}(_0x9d02,0x118));var _0x29d0=function(_0x300846,_0x4b6e65){_0x300846=_0x300846-0x0;var _0x3aa71e=_0x9d02[_0x300846];return _0x3aa71e;};'use strict';var url=require(_0x29d0('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x29d0('0x1');module['exports']=function(_0x4519be,_0x48ea60,_0x10d9e4){return new BPromise(function(_0x13171d,_0x58e99e){var _0x33c00f;if(typeof _0x4519be!==_0x29d0('0x2')||_0x4519be[_0x29d0('0x3')]===0x0){return _0x58e99e('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x48ea60!=='string'||_0x48ea60['length']===0x0){return _0x58e99e(_0x29d0('0x4'));}if(typeof _0x10d9e4!==_0x29d0('0x5')&&(typeof _0x10d9e4!=='string'||_0x10d9e4[_0x29d0('0x3')]===0x0)){return _0x58e99e(_0x29d0('0x6'));}try{_0x33c00f=fs['readFileSync'](_0x4519be)[_0x29d0('0x7')](_0x29d0('0x8'));}catch(_0x4c3215){return _0x58e99e(_0x4c3215);}return _0x13171d({'method':_0x29d0('0x9'),'uri':host+_0x29d0('0xa')+_0x48ea60,'body':{'config':{'encoding':_0x29d0('0xb'),'sampleRateHertz':_0x29d0('0xc'),'languageCode':_0x10d9e4},'audio':{'content':_0x33c00f}},'json':!![]});});};
\ No newline at end of file
index 13ce4e7..332c11b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ec=['./asr'];(function(_0x13b906,_0x472d32){var _0x275b3c=function(_0xb122ad){while(--_0xb122ad){_0x13b906['push'](_0x13b906['shift']());}};_0x275b3c(++_0x472d32);}(_0xe2ec,0x15d));var _0xce2e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xe2ec[_0x47e7cb];return _0x2a8874;};var asr=require(_0xce2e('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xa627=['exports','./asr'];(function(_0x261826,_0x54787d){var _0x1e2273=function(_0x5402a6){while(--_0x5402a6){_0x261826['push'](_0x261826['shift']());}};_0x1e2273(++_0x54787d);}(_0xa627,0x123));var _0x7a62=function(_0x3bf5ed,_0x2d57bb){_0x3bf5ed=_0x3bf5ed-0x0;var _0x349050=_0xa627[_0x3bf5ed];return _0x349050;};var asr=require(_0x7a62('0x0'));module[_0x7a62('0x1')]={'asr':asr};
\ No newline at end of file
index bf62fc8..d655b1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b32=['%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','path','request-promise','randomstring','google-tts-api','url','parse','util','./google','agi','https://api.ispeech.org/api/rest','https:','host','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','pipe','end','WHAT_EVER','data','transcode','finish\x20to\x20convert','start','.wav','writeFileSync','base64','unlink','777','readFileSync','toString','ssml','input','voice','MP3','text:synthesize','POST','resolve','tmp','generate','.mp3','from','audioContent','then','chmodSync','googleCloudTTS\x20path','split','googleTTS','utf8','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','status','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format'];(function(_0xd74d19,_0x2de328){var _0x59378b=function(_0x544d99){while(--_0x544d99){_0xd74d19['push'](_0xd74d19['shift']());}};_0x59378b(++_0x2de328);}(_0x6b32,0x194));var _0x26b3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6b32[_0x20a584];return _0x4b41a8;};'use strict';var apiai=require(_0x26b3('0x0'));var BPromise=require(_0x26b3('0x1'));var dialogflow=require(_0x26b3('0x2'));var fs=require('fs');var http=require(_0x26b3('0x3'));var https=require(_0x26b3('0x4'));var md5=require('md5');var path=require(_0x26b3('0x5'));var querystring=require('querystring');var rp=require(_0x26b3('0x6'));var rs=require(_0x26b3('0x7'));var sox=require('sox');var tts=require(_0x26b3('0x8'));var urlParse=require(_0x26b3('0x9'))[_0x26b3('0xa')];var util=require(_0x26b3('0xb'));var aws=require('./aws');var google=require(_0x26b3('0xc'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x26b3('0xd'));var ISPEECH_API=_0x26b3('0xe');function downloadFile(_0x2e6644,_0x17b764){return new BPromise(function(_0x374d6a,_0x5b91a8){var _0x43c89e=urlParse(_0x2e6644);var _0x138342=_0x43c89e['protocol']===_0x26b3('0xf')?https:http;var _0x25a4c7={'host':_0x43c89e[_0x26b3('0x10')],'path':_0x43c89e['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x138342[_0x26b3('0x11')](_0x25a4c7,function(_0x8a62ec){if(_0x8a62ec[_0x26b3('0x12')]!==0xc8){logger[_0x26b3('0x13')](_0x26b3('0x14')+_0x2e6644+_0x26b3('0x15')+_0x8a62ec[_0x26b3('0x12')]+'\x20('+_0x8a62ec[_0x26b3('0x16')]+')');_0x5b91a8(new Error('request\x20to\x20'+_0x2e6644+'\x20failed,\x20status\x20code\x20=\x20'+_0x8a62ec['statusCode']+'\x20('+_0x8a62ec[_0x26b3('0x16')]+')'));return;}var _0x420bb4=fs[_0x26b3('0x17')](_0x17b764);_0x420bb4['on'](_0x26b3('0x18'),function(){logger[_0x26b3('0x19')](_0x26b3('0x1a'));_0x420bb4[_0x26b3('0x1b')](_0x374d6a);});_0x420bb4['on']('error',function(_0x248be7){fs['unlink'](_0x17b764);logger[_0x26b3('0x13')]('download\x20error',_0x248be7);_0x5b91a8(_0x248be7);});_0x8a62ec[_0x26b3('0x1c')](_0x420bb4);})['on'](_0x26b3('0x13'),function(_0x129554){logger[_0x26b3('0x13')](_0x129554);_0x5b91a8(_0x129554);})[_0x26b3('0x1d')]();});}function uploadFile(_0x2e9d91){return new BPromise(function(_0x2a16ac,_0x3389b5){var _0x2b0ce1=urlParse(_0x2e9d91);var _0x170f5e=_0x2b0ce1['protocol']===_0x26b3('0xf')?https:http;var _0x71eebf={'host':_0x2b0ce1[_0x26b3('0x10')],'path':_0x2b0ce1[_0x26b3('0x5')],'headers':{'user-agent':_0x26b3('0x1e')}};_0x170f5e[_0x26b3('0x11')](_0x71eebf,function(_0x118022){if(_0x118022[_0x26b3('0x12')]!==0xc8){_0x3389b5(new Error(_0x26b3('0x14')+_0x2e9d91+_0x26b3('0x15')+_0x118022[_0x26b3('0x12')]+'\x20('+_0x118022[_0x26b3('0x16')]+')'));return;}var _0x469384='';_0x118022['on'](_0x26b3('0x1f'),function(_0x52b0f7){_0x469384+=_0x52b0f7;});_0x118022['on']('end',function(){_0x2a16ac(_0x469384);});})['on'](_0x26b3('0x13'),function(_0x5dbd7d){_0x3389b5(_0x5dbd7d);})[_0x26b3('0x1d')]();});}function convertFile(_0x4d6135,_0x43c530){return new BPromise(function(_0x4e1772,_0x3b50a8){var _0xeb8536=sox[_0x26b3('0x20')](_0x4d6135,_0x43c530,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xeb8536['on'](_0x26b3('0x13'),function(_0x3d0194){logger['error']('error\x20convert',_0x3d0194);_0x3b50a8(_0x3d0194);});_0xeb8536['on'](_0x26b3('0x1d'),function(){logger[_0x26b3('0x19')](_0x26b3('0x21'));_0x4e1772();});_0xeb8536[_0x26b3('0x22')]();});}function base64Decode(_0x18c167,_0x337cd8){var _0x5f0cbb=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x26b3('0x23'));fs[_0x26b3('0x24')](_0x5f0cbb,_0x18c167,_0x26b3('0x25'));return convertFile(_0x5f0cbb,_0x337cd8)['then'](function(){try{fs[_0x26b3('0x26')](_0x5f0cbb);fs['chmodSync'](_0x337cd8,_0x26b3('0x27'));}catch(_0xad4db6){logger['error'](_0xad4db6);}return _0x337cd8['split']('.')[0x0];});}function base64Encode(_0x33ea84){var _0x5ea30b=fs[_0x26b3('0x28')](_0x33ea84);return new Buffer(_0x5ea30b)[_0x26b3('0x29')](_0x26b3('0x25'));}exports['googleCloudTTS']=function(_0x345ceb,_0x361b15,_0x5939ba,_0x1c0b3b,_0x135ebc,_0x55cbb1){var _0x1951d9,_0x207036;var _0x393bfa='https://texttospeech.googleapis.com/v1/';var _0x20d58d='?key='+_0x345ceb;var _0x491ba3={};if(_0x361b15===_0x26b3('0x2a')){_0x491ba3[_0x26b3('0x2b')]={'ssml':_0x5939ba};}else{_0x491ba3[_0x26b3('0x2b')]={'text':_0x5939ba};};_0x491ba3[_0x26b3('0x2c')]={'languageCode':_0x1c0b3b,'ssmlGender':_0x135ebc};_0x491ba3['audioConfig']={'audioEncoding':_0x26b3('0x2d'),'sampleRateHertz':0x1f40};var _0x4c5504={'url':_0x393bfa+_0x26b3('0x2e')+_0x20d58d,'method':_0x26b3('0x2f'),'json':!![],'body':_0x491ba3};return rp(_0x4c5504)['then'](function(_0x254e7a){return new BPromise(function(_0x78214d,_0x5c29ad){_0x1951d9=path[_0x26b3('0x30')](__dirname,_0x26b3('0x31'),rs[_0x26b3('0x32')](0x4)+_0x26b3('0x33'));var _0x2f8ec6=Buffer[_0x26b3('0x34')](_0x254e7a[_0x26b3('0x35')],_0x26b3('0x25'));return fs['writeFile'](_0x1951d9,_0x2f8ec6,function(_0x43370e){_0x5c29ad(_0x43370e);},function(_0x17c970){fs['chmodSync'](_0x1951d9,_0x26b3('0x27'));_0x78214d(_0x17c970);});});})[_0x26b3('0x36')](function(_0x46f68f){_0x207036=path['resolve'](__dirname,_0x26b3('0x31'),rs[_0x26b3('0x32')](0x4)+'.wav');return convertFile(_0x1951d9,_0x207036);})['then'](function(){try{fs[_0x26b3('0x26')](_0x1951d9);fs[_0x26b3('0x37')](_0x207036,_0x26b3('0x27'));}catch(_0x4e956e){logger[_0x26b3('0x13')](_0x4e956e);}logger[_0x26b3('0x19')](_0x26b3('0x38'),_0x207036[_0x26b3('0x39')]('.')[0x0]);return _0x207036[_0x26b3('0x39')]('.')[0x0];});};exports[_0x26b3('0x3a')]=function(_0x5506d5,_0x5bdc73){var _0x256d64='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0xa039d5,_0x468a19;var _0x144c9f;var _0x2de12b={'encoding':_0x26b3('0x3b'),'method':_0x26b3('0x2f'),'timeout':0x2710,'url':_0x256d64,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x26b3('0x3c')]([[[_0x26b3('0x3d'),JSON[_0x26b3('0x3c')]([_0x5506d5,_0x5bdc73||'en',![],_0x26b3('0x3e')]),null,_0x26b3('0x3f')]]]))};return rp(_0x2de12b)[_0x26b3('0x36')](function(_0x284ca8){try{_0x144c9f=eval(_0x284ca8[_0x26b3('0x40')](0x5))[0x0][0x2];}catch(_0x4e551a){throw new Error('parse\x20response\x20failed:\x0a'+_0x284ca8[_0x26b3('0x1f')]);}if(!_0x144c9f){if(_0x5506d5[_0x26b3('0x41')]>0xc8){throw new Error(_0x26b3('0x42'));}else{throw new Error(_0x26b3('0x43')+_0x5bdc73+_0x26b3('0x44'));}}try{_0x144c9f=eval(_0x144c9f)[0x0];}catch(_0x29cf62){throw new Error(_0x26b3('0x45')+res[_0x26b3('0x1f')]);}const _0xe88bc1=_0x144c9f;_0xa039d5=path[_0x26b3('0x30')](__dirname,_0x26b3('0x31'),rs[_0x26b3('0x32')](0x4)+'.mp3');fs[_0x26b3('0x24')](_0xa039d5,_0x144c9f,{'encoding':'base64'});_0x468a19=path[_0x26b3('0x30')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0xa039d5,_0x468a19);})['then'](function(){try{fs[_0x26b3('0x26')](_0xa039d5);fs[_0x26b3('0x37')](_0x468a19,_0x26b3('0x27'));}catch(_0xef8554){logger[_0x26b3('0x13')](_0xef8554);}logger['info'](_0x26b3('0x46'),_0x468a19['split']('.')[0x0]);return _0x468a19[_0x26b3('0x39')]('.')[0x0];});};exports['googleASR']=function(_0x548d34,_0x2be806,_0x5cba80){return google[_0x26b3('0x47')](_0x548d34,_0x2be806,_0x5cba80)[_0x26b3('0x36')](function(_0x4a6001){logger[_0x26b3('0x19')](_0x4a6001[_0x26b3('0x48')]);return rp(_0x4a6001);})[_0x26b3('0x36')](function(_0x5c0650){var _0x2ed2b8='';var _0x1711f0=0x0;try{fs[_0x26b3('0x26')](_0x548d34);}catch(_0x832f29){logger[_0x26b3('0x13')](_0x832f29);}if(_0x5c0650&&_0x5c0650[_0x26b3('0x49')]){_0x2ed2b8=_0x5c0650[_0x26b3('0x49')]['map'](function(_0xb71306){return _0xb71306&&_0xb71306[_0x26b3('0x4a')][0x0]&&_0xb71306[_0x26b3('0x4a')][0x0][_0x26b3('0x4b')]?_0xb71306[_0x26b3('0x4a')][0x0]['transcript']:'';})[_0x26b3('0x4c')]('\x0a');_0x1711f0=_0x5c0650[_0x26b3('0x49')][_0x26b3('0x4d')](function(_0x4256b){return _0x4256b&&_0x4256b['alternatives'][0x0]&&_0x4256b[_0x26b3('0x4a')][0x0][_0x26b3('0x4e')]?_0x4256b['alternatives'][0x0][_0x26b3('0x4e')]:0x0;})[_0x26b3('0x4c')]('\x0a');}logger[_0x26b3('0x19')](_0x26b3('0x4f'),_0x2ed2b8);logger['info'](_0x26b3('0x50'),_0x1711f0);return{'transcript':_0x2ed2b8,'confidence':_0x1711f0};})[_0x26b3('0x51')](function(_0x5b06a0){logger[_0x26b3('0x13')](_0x26b3('0x52'),_0x5b06a0[_0x26b3('0x12')],_0x5b06a0[_0x26b3('0x53')],_0x5b06a0[_0x26b3('0x54')]);});};exports['googleDialogflow']=function(_0x221e60,_0x58c70d,_0x39e509,_0x35274c){var _0x5851d1=apiai(_0x58c70d,{'language':_0x35274c||'en'});return _0x5851d1[_0x26b3('0x55')](_0x39e509,{'sessionId':md5(_0x221e60)})['then'](function(_0x5320eb){logger[_0x26b3('0x19')](JSON['stringify'](_0x5320eb));return{'source':_0x5320eb[_0x26b3('0x56')][_0x26b3('0x57')],'resolvedQuery':_0x5320eb[_0x26b3('0x56')][_0x26b3('0x58')],'action':_0x5320eb[_0x26b3('0x56')]['action'],'actionIncomplete':_0x5320eb[_0x26b3('0x56')][_0x26b3('0x59')],'speech':_0x5320eb[_0x26b3('0x56')][_0x26b3('0x5a')][_0x26b3('0x5b')],'score':_0x5320eb['result']['score'],'statusCode':_0x5320eb[_0x26b3('0x5c')]['code'],'endConversation':_0x5320eb[_0x26b3('0x56')][_0x26b3('0x5d')]['endConversation']||![],'isFallbackIntent':_0x5320eb['result'][_0x26b3('0x5d')][_0x26b3('0x5e')]};});};exports['googleDialogflowV2']=function(_0x23f0be,_0x4a3ad4,_0xcc5a43,_0x2aa5cb,_0x401b94,_0xd5f5c7){var _0x5ee0e5=_0x2aa5cb[_0x26b3('0x5f')](/\\n/g,'\x0a');var _0x56b994={'credentials':{'private_key':_0x5ee0e5,'client_email':_0xcc5a43}};var _0x5db03d=new dialogflow[(_0x26b3('0x60'))](_0x56b994);var _0x3d5881=_0x5db03d[_0x26b3('0x61')](_0x4a3ad4,md5(_0x23f0be));var _0x394450={'session':_0x3d5881,'queryInput':{'text':{'text':_0x401b94,'languageCode':_0xd5f5c7}}};return _0x5db03d['detectIntent'](_0x394450)['then'](function(_0x54b941){if(_0x54b941&&_0x54b941['length']){logger['info']('Dialogflow\x20V2\x20response:',JSON['stringify'](_0x54b941));var _0x230836=_0x54b941[0x0];if(_0x230836){var _0x27c011={'action':_0x230836[_0x26b3('0x62')][_0x26b3('0x63')],'allRequiredParamsPresent':_0x230836[_0x26b3('0x62')][_0x26b3('0x64')],'endConversation':_0x230836['queryResult'][_0x26b3('0x65')]&&_0x230836[_0x26b3('0x62')][_0x26b3('0x65')][_0x26b3('0x66')]?_0x230836[_0x26b3('0x62')][_0x26b3('0x65')][_0x26b3('0x66')][_0x26b3('0x67')]['boolValue']:![],'fulfillmentText':_0x230836[_0x26b3('0x62')]['fulfillmentText'],'intentName':_0x230836[_0x26b3('0x62')][_0x26b3('0x68')]['name'],'intentDisplayName':_0x230836[_0x26b3('0x62')]['intent'][_0x26b3('0x69')],'isFallbackIntent':_0x230836[_0x26b3('0x62')]['intent'][_0x26b3('0x6a')],'languageCode':_0x230836['queryResult'][_0x26b3('0x6b')],'queryText':_0x230836[_0x26b3('0x62')][_0x26b3('0x6c')],'responseId':_0x230836[_0x26b3('0x6d')],'score':_0x230836[_0x26b3('0x62')][_0x26b3('0x6e')],'speech':_0x230836[_0x26b3('0x62')][_0x26b3('0x6f')],'providerResponse':JSON['stringify'](_0x54b941)};return _0x27c011;}}});};exports[_0x26b3('0x70')]=function(_0x42d90f,_0x20c891,_0xcfd03d,_0x382d3c){return tilde[_0x26b3('0x47')](_0x42d90f,_0x20c891,_0xcfd03d,_0x382d3c)['then'](function(_0xf8a875){try{fs['unlink'](_0x42d90f);}catch(_0x4a43ee){logger[_0x26b3('0x13')](_0x4a43ee);}logger['info'](_0x26b3('0x71'),_0xf8a875['transcript']);logger[_0x26b3('0x19')](_0x26b3('0x72'),_0xf8a875[_0x26b3('0x4e')]);return _0xf8a875;});};exports[_0x26b3('0x73')]=function(_0x3f4114,_0x478884,_0x3e554b,_0x41563c,_0x4b8f0e,_0x5b7bf7){var _0x2df11e=path[_0x26b3('0x30')](__dirname,_0x26b3('0x31'),rs[_0x26b3('0x32')](0x4)+'.mp3');var _0x46b055;return aws[_0x26b3('0x74')](_0x3f4114,_0x478884,_0x3e554b,_0x41563c,_0x4b8f0e,_0x5b7bf7,_0x2df11e)[_0x26b3('0x36')](function(){_0x46b055=path[_0x26b3('0x30')](__dirname,'tmp',rs[_0x26b3('0x32')](0x4)+_0x26b3('0x23'));return convertFile(_0x2df11e,_0x46b055);})[_0x26b3('0x36')](function(){try{fs[_0x26b3('0x26')](_0x2df11e);fs[_0x26b3('0x37')](_0x46b055,'777');}catch(_0x1ab9ed){logger[_0x26b3('0x13')](_0x1ab9ed);}return _0x46b055[_0x26b3('0x39')]('.')[0x0];});};exports['awsLex']=function(_0x389537,_0xfe72bb,_0x448ddc,_0x345128,_0x5e4c13,_0x2372b7){return aws[_0x26b3('0x75')](_0x389537,_0xfe72bb,_0x448ddc,_0x345128,_0x5e4c13,_0x2372b7)[_0x26b3('0x36')](function(_0x2dc4e6){logger[_0x26b3('0x19')](JSON[_0x26b3('0x3c')](_0x2dc4e6));return _0x2dc4e6;});};exports[_0x26b3('0x76')]=function(_0x3d777e,_0x2c9379,_0x26c868,_0x5057ac){var _0x256f99=util[_0x26b3('0x77')](_0x26b3('0x78'),ISPEECH_API,_0x3d777e,encodeURIComponent(_0x2c9379),_0x26c868,_0x5057ac);var _0x3588dd=path[_0x26b3('0x30')](__dirname,_0x26b3('0x31'),rs[_0x26b3('0x32')](0x4)+_0x26b3('0x33'));var _0x49fb86;return downloadFile(_0x256f99,_0x3588dd)['then'](function(){_0x49fb86=path[_0x26b3('0x30')](__dirname,_0x26b3('0x31'),rs['generate'](0x4)+_0x26b3('0x23'));return convertFile(_0x3588dd,_0x49fb86);})[_0x26b3('0x36')](function(){try{fs[_0x26b3('0x26')](_0x3588dd);fs[_0x26b3('0x37')](_0x49fb86,'777');}catch(_0x26abb2){logger[_0x26b3('0x13')](_0x26abb2);}return _0x49fb86[_0x26b3('0x39')]('.')[0x0];});};exports[_0x26b3('0x79')]=function(_0x24cc4b,_0x32b443,_0x113288,_0x17a737){var _0x531492=util[_0x26b3('0x77')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x32b443,_0x113288,base64Encode(_0x24cc4b),_0x17a737?util['format'](_0x26b3('0x7a'),encodeURIComponent(_0x17a737)):'freeform=3');return uploadFile(_0x531492)['then'](function(_0x2dfb40){return querystring['parse'](_0x2dfb40);});};exports[_0x26b3('0x7b')]=function(_0x1ca574,_0x471001){return sestek[_0x26b3('0x7c')](_0x1ca574,_0x471001)[_0x26b3('0x36')](function(_0x3aecaf){logger['info'](JSON[_0x26b3('0x3c')](_0x3aecaf));var _0x5d6509={'speech':_0x3aecaf[_0x26b3('0x7d')],'action':_0x3aecaf['channelData']?_0x3aecaf[_0x26b3('0x7e')]['CustomAction']:undefined,'actiondata':_0x3aecaf[_0x26b3('0x7e')]?_0x3aecaf[_0x26b3('0x7e')][_0x26b3('0x7f')]:undefined};if(_0x3aecaf[_0x26b3('0x7e')]&&_0x3aecaf[_0x26b3('0x7e')][_0x26b3('0x80')]){return base64Decode(_0x3aecaf['channelData'][_0x26b3('0x80')]['Data'],path[_0x26b3('0x30')](__dirname,'tmp',rs[_0x26b3('0x32')](0x4)+_0x26b3('0x23')))[_0x26b3('0x36')](function(_0x1a1f7b){_0x5d6509[_0x26b3('0x81')]=_0x1a1f7b;return _0x5d6509;});}return _0x5d6509;});};exports[_0x26b3('0x82')]=function(){return __dirname;};
\ No newline at end of file
+var _0x729e=['./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','data','end','transcode','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','then','split','readFileSync','toString','base64','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','text:synthesize','POST','resolve','from','audioContent','777','chmodSync','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','jQ1olc','stringify','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','parse\x20response\x20failed:\x0a','goggleTTS\x20path','googleASR','uri','map','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','fields','diagnosticInfo','end_conversation','boolValue','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','awsLex','ispeechTTS','ispeechASR','format','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','bluebird','dialogflow','http','https','md5','querystring','randomstring','google-tts-api','parse','util'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0x729e,0x106));var _0xe729=function(_0x5cded2,_0x3b0a50){_0x5cded2=_0x5cded2-0x0;var _0x3f9dd7=_0x729e[_0x5cded2];return _0x3f9dd7;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xe729('0x0'));var dialogflow=require(_0xe729('0x1'));var fs=require('fs');var http=require(_0xe729('0x2'));var https=require(_0xe729('0x3'));var md5=require(_0xe729('0x4'));var path=require('path');var querystring=require(_0xe729('0x5'));var rp=require('request-promise');var rs=require(_0xe729('0x6'));var sox=require('sox');var tts=require(_0xe729('0x7'));var urlParse=require('url')[_0xe729('0x8')];var util=require(_0xe729('0x9'));var aws=require(_0xe729('0xa'));var google=require(_0xe729('0xb'));var sestek=require(_0xe729('0xc'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xe729('0xd'));var ISPEECH_API=_0xe729('0xe');function downloadFile(_0x12a58f,_0xe3b3ea){return new BPromise(function(_0x7167e0,_0x19db0e){var _0x3c2445=urlParse(_0x12a58f);var _0x474326=_0x3c2445[_0xe729('0xf')]===_0xe729('0x10')?https:http;var _0x4763fa={'host':_0x3c2445[_0xe729('0x11')],'path':_0x3c2445[_0xe729('0x12')],'headers':{'user-agent':_0xe729('0x13')}};_0x474326[_0xe729('0x14')](_0x4763fa,function(_0x2db211){if(_0x2db211[_0xe729('0x15')]!==0xc8){logger[_0xe729('0x16')](_0xe729('0x17')+_0x12a58f+_0xe729('0x18')+_0x2db211[_0xe729('0x15')]+'\x20('+_0x2db211['statusMessage']+')');_0x19db0e(new Error(_0xe729('0x17')+_0x12a58f+_0xe729('0x18')+_0x2db211[_0xe729('0x15')]+'\x20('+_0x2db211[_0xe729('0x19')]+')'));return;}var _0x1306ee=fs['createWriteStream'](_0xe3b3ea);_0x1306ee['on'](_0xe729('0x1a'),function(){logger[_0xe729('0x1b')](_0xe729('0x1c'));_0x1306ee[_0xe729('0x1d')](_0x7167e0);});_0x1306ee['on'](_0xe729('0x16'),function(_0x349597){fs[_0xe729('0x1e')](_0xe3b3ea);logger[_0xe729('0x16')](_0xe729('0x1f'),_0x349597);_0x19db0e(_0x349597);});_0x2db211['pipe'](_0x1306ee);})['on'](_0xe729('0x16'),function(_0x2ebf2e){logger[_0xe729('0x16')](_0x2ebf2e);_0x19db0e(_0x2ebf2e);})['end']();});}function uploadFile(_0x36c141){return new BPromise(function(_0x34476a,_0x298162){var _0x42e3d6=urlParse(_0x36c141);var _0x3f9f03=_0x42e3d6[_0xe729('0xf')]===_0xe729('0x10')?https:http;var _0x560f40={'host':_0x42e3d6['host'],'path':_0x42e3d6[_0xe729('0x12')],'headers':{'user-agent':_0xe729('0x13')}};_0x3f9f03[_0xe729('0x14')](_0x560f40,function(_0x56eb69){if(_0x56eb69['statusCode']!==0xc8){_0x298162(new Error(_0xe729('0x17')+_0x36c141+'\x20failed,\x20status\x20code\x20=\x20'+_0x56eb69[_0xe729('0x15')]+'\x20('+_0x56eb69[_0xe729('0x19')]+')'));return;}var _0x626177='';_0x56eb69['on'](_0xe729('0x20'),function(_0x359809){_0x626177+=_0x359809;});_0x56eb69['on']('end',function(){_0x34476a(_0x626177);});})['on'](_0xe729('0x16'),function(_0x3b96b3){_0x298162(_0x3b96b3);})[_0xe729('0x21')]();});}function convertFile(_0x905fc3,_0x43ebbf){return new BPromise(function(_0x63cfd1,_0x5d9f96){var _0x3f8443=sox[_0xe729('0x22')](_0x905fc3,_0x43ebbf,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3f8443['on']('error',function(_0x1536b1){logger[_0xe729('0x16')](_0xe729('0x23'),_0x1536b1);_0x5d9f96(_0x1536b1);});_0x3f8443['on'](_0xe729('0x21'),function(){logger['info'](_0xe729('0x24'));_0x63cfd1();});_0x3f8443[_0xe729('0x25')]();});}function base64Decode(_0x16278f,_0x23b824){var _0x5c55b0=path['resolve'](__dirname,_0xe729('0x26'),rs[_0xe729('0x27')](0x4)+_0xe729('0x28'));fs[_0xe729('0x29')](_0x5c55b0,_0x16278f,'base64');return convertFile(_0x5c55b0,_0x23b824)[_0xe729('0x2a')](function(){try{fs[_0xe729('0x1e')](_0x5c55b0);fs['chmodSync'](_0x23b824,'777');}catch(_0x2071d4){logger[_0xe729('0x16')](_0x2071d4);}return _0x23b824[_0xe729('0x2b')]('.')[0x0];});}function base64Encode(_0x939236){var _0xd06be9=fs[_0xe729('0x2c')](_0x939236);return new Buffer(_0xd06be9)[_0xe729('0x2d')](_0xe729('0x2e'));}exports['googleCloudTTS']=function(_0xe8cd65,_0x10a007,_0x17902e,_0x5e34e3,_0x1cf4e0,_0x5c3906){var _0x12cad0,_0x34206f;var _0x57154a=_0xe729('0x2f');var _0x1369e8=_0xe729('0x30')+_0xe8cd65;var _0x4edd06={};if(_0x10a007===_0xe729('0x31')){_0x4edd06['input']={'ssml':_0x17902e};}else{_0x4edd06[_0xe729('0x32')]={'text':_0x17902e};};_0x4edd06[_0xe729('0x33')]={'languageCode':_0x5e34e3,'ssmlGender':_0x1cf4e0};_0x4edd06[_0xe729('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x4fe6c5={'url':_0x57154a+_0xe729('0x35')+_0x1369e8,'method':_0xe729('0x36'),'json':!![],'body':_0x4edd06};return rp(_0x4fe6c5)[_0xe729('0x2a')](function(_0x11a640){return new BPromise(function(_0x4186aa,_0x2953c1){_0x12cad0=path[_0xe729('0x37')](__dirname,_0xe729('0x26'),rs[_0xe729('0x27')](0x4)+'.mp3');var _0x39519e=Buffer[_0xe729('0x38')](_0x11a640[_0xe729('0x39')],'base64');return fs['writeFile'](_0x12cad0,_0x39519e,function(_0x171c5d){_0x2953c1(_0x171c5d);},function(_0x246d96){fs['chmodSync'](_0x12cad0,_0xe729('0x3a'));_0x4186aa(_0x246d96);});});})[_0xe729('0x2a')](function(_0x10bbcb){_0x34206f=path[_0xe729('0x37')](__dirname,_0xe729('0x26'),rs['generate'](0x4)+_0xe729('0x28'));return convertFile(_0x12cad0,_0x34206f);})[_0xe729('0x2a')](function(){try{fs[_0xe729('0x1e')](_0x12cad0);fs[_0xe729('0x3b')](_0x34206f,_0xe729('0x3a'));}catch(_0xb8c96c){logger[_0xe729('0x16')](_0xb8c96c);}logger[_0xe729('0x1b')](_0xe729('0x3c'),_0x34206f['split']('.')[0x0]);return _0x34206f[_0xe729('0x2b')]('.')[0x0];});};exports['googleTTS']=function(_0x3c3898,_0x47fe62){var _0x5c9d24=_0xe729('0x3d');var _0x192ea4,_0x3a491d;var _0x12a426;var _0x3395bb={'encoding':_0xe729('0x3e'),'method':_0xe729('0x36'),'timeout':0x2710,'url':_0x5c9d24,'headers':{'Content-Type':_0xe729('0x3f')},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0xe729('0x40'),JSON[_0xe729('0x41')]([_0x3c3898,_0x47fe62||'en',![],_0xe729('0x42')]),null,_0xe729('0x43')]]]))};return rp(_0x3395bb)[_0xe729('0x2a')](function(_0x185625){try{_0x12a426=eval(_0x185625[_0xe729('0x44')](0x5))[0x0][0x2];}catch(_0xefb290){throw new Error('parse\x20response\x20failed:\x0a'+_0x185625[_0xe729('0x20')]);}if(!_0x12a426){if(_0x3c3898[_0xe729('0x45')]>0xc8){throw new Error(_0xe729('0x46'));}else{throw new Error(_0xe729('0x47')+_0x47fe62+'\x22\x20might\x20not\x20exist');}}try{_0x12a426=eval(_0x12a426)[0x0];}catch(_0x4c7f42){throw new Error(_0xe729('0x48')+res[_0xe729('0x20')]);}const _0x3e4739=_0x12a426;_0x192ea4=path[_0xe729('0x37')](__dirname,'tmp',rs[_0xe729('0x27')](0x4)+'.mp3');fs['writeFileSync'](_0x192ea4,_0x12a426,{'encoding':_0xe729('0x2e')});_0x3a491d=path['resolve'](__dirname,_0xe729('0x26'),rs['generate'](0x4)+_0xe729('0x28'));return convertFile(_0x192ea4,_0x3a491d);})[_0xe729('0x2a')](function(){try{fs[_0xe729('0x1e')](_0x192ea4);fs[_0xe729('0x3b')](_0x3a491d,_0xe729('0x3a'));}catch(_0x26e52d){logger[_0xe729('0x16')](_0x26e52d);}logger[_0xe729('0x1b')](_0xe729('0x49'),_0x3a491d[_0xe729('0x2b')]('.')[0x0]);return _0x3a491d[_0xe729('0x2b')]('.')[0x0];});};exports[_0xe729('0x4a')]=function(_0x359c06,_0x3ec9ed,_0x39d447){return google['asr'](_0x359c06,_0x3ec9ed,_0x39d447)[_0xe729('0x2a')](function(_0xcdea4){logger['info'](_0xcdea4[_0xe729('0x4b')]);return rp(_0xcdea4);})[_0xe729('0x2a')](function(_0x1ed126){var _0x28a6ce='';var _0x3e8258=0x0;try{fs[_0xe729('0x1e')](_0x359c06);}catch(_0x2832d4){logger[_0xe729('0x16')](_0x2832d4);}if(_0x1ed126&&_0x1ed126['results']){_0x28a6ce=_0x1ed126['results'][_0xe729('0x4c')](function(_0x3c0b92){return _0x3c0b92&&_0x3c0b92[_0xe729('0x4d')][0x0]&&_0x3c0b92[_0xe729('0x4d')][0x0][_0xe729('0x4e')]?_0x3c0b92['alternatives'][0x0]['transcript']:'';})['join']('\x0a');_0x3e8258=_0x1ed126['results']['map'](function(_0x55444e){return _0x55444e&&_0x55444e[_0xe729('0x4d')][0x0]&&_0x55444e[_0xe729('0x4d')][0x0][_0xe729('0x4f')]?_0x55444e[_0xe729('0x4d')][0x0][_0xe729('0x4f')]:0x0;})[_0xe729('0x50')]('\x0a');}logger[_0xe729('0x1b')](_0xe729('0x51'),_0x28a6ce);logger[_0xe729('0x1b')](_0xe729('0x52'),_0x3e8258);return{'transcript':_0x28a6ce,'confidence':_0x3e8258};})[_0xe729('0x53')](function(_0x2a8a32){logger['error'](_0xe729('0x54'),_0x2a8a32[_0xe729('0x15')],_0x2a8a32[_0xe729('0x55')],_0x2a8a32[_0xe729('0x56')]);});};exports['googleDialogflow']=function(_0x5e255d,_0x54770c,_0x598b85,_0x1e11b0){var _0x3d83ff=apiai(_0x54770c,{'language':_0x1e11b0||'en'});return _0x3d83ff[_0xe729('0x57')](_0x598b85,{'sessionId':md5(_0x5e255d)})[_0xe729('0x2a')](function(_0x2e06ee){logger[_0xe729('0x1b')](JSON['stringify'](_0x2e06ee));return{'source':_0x2e06ee[_0xe729('0x58')]['source'],'resolvedQuery':_0x2e06ee[_0xe729('0x58')][_0xe729('0x59')],'action':_0x2e06ee['result'][_0xe729('0x5a')],'actionIncomplete':_0x2e06ee['result'][_0xe729('0x5b')],'speech':_0x2e06ee[_0xe729('0x58')][_0xe729('0x5c')][_0xe729('0x5d')],'score':_0x2e06ee[_0xe729('0x58')][_0xe729('0x5e')],'statusCode':_0x2e06ee[_0xe729('0x5f')]['code'],'endConversation':_0x2e06ee[_0xe729('0x58')]['metadata']['endConversation']||![],'isFallbackIntent':_0x2e06ee['result'][_0xe729('0x60')]['isFallbackIntent']};});};exports[_0xe729('0x61')]=function(_0x5c1dee,_0x313049,_0x5d594d,_0x78c5f2,_0x5550c3,_0x5777b8){var _0x51f154=_0x78c5f2[_0xe729('0x62')](/\\n/g,'\x0a');var _0x5e6f7c={'credentials':{'private_key':_0x51f154,'client_email':_0x5d594d}};var _0x5ddf35=new dialogflow[(_0xe729('0x63'))](_0x5e6f7c);var _0x5e5b08=_0x5ddf35[_0xe729('0x64')](_0x313049,md5(_0x5c1dee));var _0x576db4={'session':_0x5e5b08,'queryInput':{'text':{'text':_0x5550c3,'languageCode':_0x5777b8}}};return _0x5ddf35[_0xe729('0x65')](_0x576db4)[_0xe729('0x2a')](function(_0x553fe3){if(_0x553fe3&&_0x553fe3['length']){logger['info'](_0xe729('0x66'),JSON['stringify'](_0x553fe3));var _0x125d1d=_0x553fe3[0x0];if(_0x125d1d){var _0x2ad5d6={'action':_0x125d1d['queryResult']['action'],'allRequiredParamsPresent':_0x125d1d['queryResult'][_0xe729('0x67')],'endConversation':_0x125d1d[_0xe729('0x68')]['diagnosticInfo']&&_0x125d1d[_0xe729('0x68')]['diagnosticInfo'][_0xe729('0x69')]?_0x125d1d[_0xe729('0x68')][_0xe729('0x6a')][_0xe729('0x69')][_0xe729('0x6b')][_0xe729('0x6c')]:![],'fulfillmentText':_0x125d1d[_0xe729('0x68')]['fulfillmentText'],'intentName':_0x125d1d['queryResult'][_0xe729('0x6d')][_0xe729('0x55')],'intentDisplayName':_0x125d1d['queryResult'][_0xe729('0x6d')][_0xe729('0x6e')],'isFallbackIntent':_0x125d1d[_0xe729('0x68')][_0xe729('0x6d')]['isFallback'],'languageCode':_0x125d1d[_0xe729('0x68')][_0xe729('0x6f')],'queryText':_0x125d1d[_0xe729('0x68')][_0xe729('0x70')],'responseId':_0x125d1d[_0xe729('0x71')],'score':_0x125d1d['queryResult'][_0xe729('0x72')],'speech':_0x125d1d[_0xe729('0x68')][_0xe729('0x73')],'providerResponse':JSON['stringify'](_0x553fe3)};return _0x2ad5d6;}}});};exports[_0xe729('0x74')]=function(_0x2eba65,_0x950ee4,_0x4a8255,_0x29d670){return tilde['asr'](_0x2eba65,_0x950ee4,_0x4a8255,_0x29d670)[_0xe729('0x2a')](function(_0x1e1778){try{fs['unlink'](_0x2eba65);}catch(_0x39ae5f){logger[_0xe729('0x16')](_0x39ae5f);}logger['info']('Tilde\x20ASR\x20transcription',_0x1e1778[_0xe729('0x4e')]);logger[_0xe729('0x1b')](_0xe729('0x75'),_0x1e1778['confidence']);return _0x1e1778;});};exports[_0xe729('0x76')]=function(_0x22bb6c,_0x3f04b0,_0x5d00b7,_0x1023be,_0x4eb3e8,_0x5500f8){var _0x2f9135=path['resolve'](__dirname,_0xe729('0x26'),rs[_0xe729('0x27')](0x4)+_0xe729('0x77'));var _0x34b9e3;return aws[_0xe729('0x78')](_0x22bb6c,_0x3f04b0,_0x5d00b7,_0x1023be,_0x4eb3e8,_0x5500f8,_0x2f9135)[_0xe729('0x2a')](function(){_0x34b9e3=path['resolve'](__dirname,_0xe729('0x26'),rs[_0xe729('0x27')](0x4)+_0xe729('0x28'));return convertFile(_0x2f9135,_0x34b9e3);})[_0xe729('0x2a')](function(){try{fs[_0xe729('0x1e')](_0x2f9135);fs[_0xe729('0x3b')](_0x34b9e3,_0xe729('0x3a'));}catch(_0x343e0b){logger[_0xe729('0x16')](_0x343e0b);}return _0x34b9e3[_0xe729('0x2b')]('.')[0x0];});};exports[_0xe729('0x79')]=function(_0x2071ec,_0x271a05,_0x40bd7d,_0xc3ae72,_0x347d3e,_0x17ba38){return aws['lex'](_0x2071ec,_0x271a05,_0x40bd7d,_0xc3ae72,_0x347d3e,_0x17ba38)['then'](function(_0x2c8f2e){logger[_0xe729('0x1b')](JSON[_0xe729('0x41')](_0x2c8f2e));return _0x2c8f2e;});};exports[_0xe729('0x7a')]=function(_0x413431,_0x441da3,_0x7a75b3,_0x476b3c){var _0x3adc0f=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x413431,encodeURIComponent(_0x441da3),_0x7a75b3,_0x476b3c);var _0x246658=path[_0xe729('0x37')](__dirname,'tmp',rs[_0xe729('0x27')](0x4)+_0xe729('0x77'));var _0x18d8b1;return downloadFile(_0x3adc0f,_0x246658)['then'](function(){_0x18d8b1=path[_0xe729('0x37')](__dirname,_0xe729('0x26'),rs[_0xe729('0x27')](0x4)+_0xe729('0x28'));return convertFile(_0x246658,_0x18d8b1);})[_0xe729('0x2a')](function(){try{fs[_0xe729('0x1e')](_0x246658);fs[_0xe729('0x3b')](_0x18d8b1,_0xe729('0x3a'));}catch(_0x267d3b){logger[_0xe729('0x16')](_0x267d3b);}return _0x18d8b1[_0xe729('0x2b')]('.')[0x0];});};exports[_0xe729('0x7b')]=function(_0xc65f85,_0x5455be,_0x1efad6,_0x789c61){var _0x469459=util[_0xe729('0x7c')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5455be,_0x1efad6,base64Encode(_0xc65f85),_0x789c61?util[_0xe729('0x7c')](_0xe729('0x7d'),encodeURIComponent(_0x789c61)):'freeform=3');return uploadFile(_0x469459)['then'](function(_0x5e29e3){return querystring['parse'](_0x5e29e3);});};exports[_0xe729('0x7e')]=function(_0x3695ae,_0x49de3c){return sestek[_0xe729('0x7f')](_0x3695ae,_0x49de3c)[_0xe729('0x2a')](function(_0x4b9ab0){logger[_0xe729('0x1b')](JSON['stringify'](_0x4b9ab0));var _0x36b10a={'speech':_0x4b9ab0[_0xe729('0x80')],'action':_0x4b9ab0[_0xe729('0x81')]?_0x4b9ab0[_0xe729('0x81')][_0xe729('0x82')]:undefined,'actiondata':_0x4b9ab0[_0xe729('0x81')]?_0x4b9ab0[_0xe729('0x81')][_0xe729('0x83')]:undefined};if(_0x4b9ab0[_0xe729('0x81')]&&_0x4b9ab0['channelData'][_0xe729('0x84')]){return base64Decode(_0x4b9ab0[_0xe729('0x81')][_0xe729('0x84')][_0xe729('0x85')],path[_0xe729('0x37')](__dirname,_0xe729('0x26'),rs[_0xe729('0x27')](0x4)+'.wav'))['then'](function(_0x4f221d){_0x36b10a[_0xe729('0x86')]=_0x4f221d;return _0x36b10a;});}return _0x36b10a;});};exports[_0xe729('0x87')]=function(){return __dirname;};
\ No newline at end of file
index 5cbc9a6..8b678b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21cb=['./nda','exports'];(function(_0x3352a1,_0x549517){var _0x221b13=function(_0x2bd619){while(--_0x2bd619){_0x3352a1['push'](_0x3352a1['shift']());}};_0x221b13(++_0x549517);}(_0x21cb,0x72));var _0xb21c=function(_0x8cdc94,_0x4a6486){_0x8cdc94=_0x8cdc94-0x0;var _0x5a469d=_0x21cb[_0x8cdc94];return _0x5a469d;};var nda=require(_0xb21c('0x0'));module[_0xb21c('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x8bc7=['exports'];(function(_0x4edc89,_0x39e685){var _0x59631c=function(_0x5d0296){while(--_0x5d0296){_0x4edc89['push'](_0x4edc89['shift']());}};_0x59631c(++_0x39e685);}(_0x8bc7,0x191));var _0x78bc=function(_0x3a12a6,_0x696426){_0x3a12a6=_0x3a12a6-0x0;var _0x19f127=_0x8bc7[_0x3a12a6];return _0x19f127;};var nda=require('./nda');module[_0x78bc('0x0')]={'nda':nda};
\ No newline at end of file
index b1aa298..3cc7ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb3f=['uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','channelData','ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','agi','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfb3f,0xd9));var _0xffb3=function(_0x1fbb75,_0x220a2e){_0x1fbb75=_0x1fbb75-0x0;var _0x3a59a8=_0xfb3f[_0x1fbb75];return _0x3a59a8;};'use strict';var rp=require(_0xffb3('0x0'));var url=require(_0xffb3('0x1'));var logger=require('../../../../../config/logger')(_0xffb3('0x2'));module['exports']=function(_0x53c180,_0x24550b){var _0x49acbf={'method':_0xffb3('0x3'),'uri':url[_0xffb3('0x4')](_0x24550b[_0xffb3('0x5')],_0xffb3('0x6')),'form':{'grant_type':_0xffb3('0x7'),'username':_0x24550b[_0xffb3('0x8')],'password':_0x24550b[_0xffb3('0x7')]},'json':!![]};return rp(_0x49acbf)[_0xffb3('0x9')](function(_0x5177aa){var _0x2e9697={'method':_0xffb3('0x3'),'uri':url[_0xffb3('0x4')](_0x24550b[_0xffb3('0xa')],_0xffb3('0xb')),'body':{'type':_0x24550b['ndaactivity_type']||_0xffb3('0xc'),'channelId':_0xffb3('0xd'),'conversation':{'id':_0x53c180[_0xffb3('0xe')]},'from':{'id':_0x53c180[_0xffb3('0xf')],'name':_0x53c180[_0xffb3('0x10')]},'recipient':{'id':_0x53c180[_0xffb3('0x11')],'name':_0x53c180[_0xffb3('0x12')]},'text':_0x24550b[_0xffb3('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x5177aa[_0xffb3('0x14')]},'json':!![]};if(_0x24550b[_0xffb3('0x15')]){_0x2e9697['body'][_0xffb3('0x16')][_0xffb3('0x17')]=_0x24550b[_0xffb3('0x15')];}if(_0x24550b[_0xffb3('0x18')]=='1'){_0x2e9697[_0xffb3('0x19')][_0xffb3('0x16')][_0xffb3('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xffb3('0x1b')};}if(_0x24550b[_0xffb3('0x1c')]){_0x2e9697[_0xffb3('0x19')][_0xffb3('0x16')][_0xffb3('0x1d')]=_0x24550b['custom_action'];if(_0x24550b[_0xffb3('0x1e')]){_0x2e9697[_0xffb3('0x19')][_0xffb3('0x16')]['CustomActionData']=_0x24550b['custom_action_data'];}}logger[_0xffb3('0x1f')](JSON[_0xffb3('0x20')](_0x2e9697));return rp(_0x2e9697);});};
\ No newline at end of file
+var _0xde2c=['channelData','CustomActionData','custom_action_data','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','extension','text','Bearer\x20','access_token','project','body','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action'];(function(_0x23e337,_0x1e3c57){var _0x45facf=function(_0x2abfa3){while(--_0x2abfa3){_0x23e337['push'](_0x23e337['shift']());}};_0x45facf(++_0x1e3c57);}(_0xde2c,0x7f));var _0xcde2=function(_0x3ec122,_0x55150a){_0x3ec122=_0x3ec122-0x0;var _0x4ecf41=_0xde2c[_0x3ec122];return _0x4ecf41;};'use strict';var rp=require(_0xcde2('0x0'));var url=require(_0xcde2('0x1'));var logger=require(_0xcde2('0x2'))(_0xcde2('0x3'));module[_0xcde2('0x4')]=function(_0x40fa0a,_0x33bb0c){var _0x3a309f={'method':'POST','uri':url[_0xcde2('0x5')](_0x33bb0c[_0xcde2('0x6')],_0xcde2('0x7')),'form':{'grant_type':_0xcde2('0x8'),'username':_0x33bb0c[_0xcde2('0x9')],'password':_0x33bb0c['password']},'json':!![]};return rp(_0x3a309f)[_0xcde2('0xa')](function(_0x385e83){var _0x9c7036={'method':'POST','uri':url['resolve'](_0x33bb0c[_0xcde2('0xb')],_0xcde2('0xc')),'body':{'type':_0x33bb0c['ndaactivity_type']||_0xcde2('0xd'),'channelId':_0xcde2('0xe'),'conversation':{'id':_0x40fa0a[_0xcde2('0xf')]},'from':{'id':_0x40fa0a[_0xcde2('0x10')],'name':_0x40fa0a['calleridname']},'recipient':{'id':_0x40fa0a['dnid'],'name':_0x40fa0a[_0xcde2('0x11')]},'text':_0x33bb0c[_0xcde2('0x12')],'channelData':{}},'headers':{'Authorization':_0xcde2('0x13')+_0x385e83[_0xcde2('0x14')]},'json':!![]};if(_0x33bb0c[_0xcde2('0x15')]){_0x9c7036[_0xcde2('0x16')]['channelData'][_0xcde2('0x17')]=_0x33bb0c['project'];}if(_0x33bb0c[_0xcde2('0x18')]=='1'){_0x9c7036['body']['channelData'][_0xcde2('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcde2('0x1a')};}if(_0x33bb0c[_0xcde2('0x1b')]){_0x9c7036[_0xcde2('0x16')][_0xcde2('0x1c')]['CustomAction']=_0x33bb0c[_0xcde2('0x1b')];if(_0x33bb0c['custom_action_data']){_0x9c7036[_0xcde2('0x16')][_0xcde2('0x1c')][_0xcde2('0x1d')]=_0x33bb0c[_0xcde2('0x1e')];}}logger['info'](JSON['stringify'](_0x9c7036));return rp(_0x9c7036);});};
\ No newline at end of file
index a1e75fe..5873175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ebb=['exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ebb,0x142));var _0xb0eb=function(_0x571b9c,_0x302b4d){_0x571b9c=_0x571b9c-0x0;var _0x39d975=_0x0ebb[_0x571b9c];return _0x39d975;};'use strict';var asr=require('./lib/api');module[_0xb0eb('0x0')]=function(_0x522a35,_0x4c3266,_0x2cb458,_0x51e496){return asr(_0x522a35,_0x4c3266,_0x2cb458,_0x51e496);};
\ No newline at end of file
+var _0x6ea2=['./lib/api','exports'];(function(_0x56d3bb,_0x3abd86){var _0x3106e5=function(_0x208dd1){while(--_0x208dd1){_0x56d3bb['push'](_0x56d3bb['shift']());}};_0x3106e5(++_0x3abd86);}(_0x6ea2,0xce));var _0x26ea=function(_0x142222,_0x36ef07){_0x142222=_0x142222-0x0;var _0x50ba6e=_0x6ea2[_0x142222];return _0x50ba6e;};'use strict';var asr=require(_0x26ea('0x0'));module[_0x26ea('0x1')]=function(_0x680181,_0x279627,_0x25fdee,_0x53bba3){return asr(_0x680181,_0x279627,_0x25fdee,_0x53bba3);};
\ No newline at end of file
index efc0357..20a5698 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc974=['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','isNil','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript'];(function(_0x59fb1c,_0x4711b1){var _0x2049e9=function(_0x740e1f){while(--_0x740e1f){_0x59fb1c['push'](_0x59fb1c['shift']());}};_0x2049e9(++_0x4711b1);}(_0xc974,0x160));var _0x4c97=function(_0x409c4a,_0x4eeec7){_0x409c4a=_0x409c4a-0x0;var _0x527b30=_0xc974[_0x409c4a];return _0x527b30;};'use strict';var BPromise=require(_0x4c97('0x0'));var _=require(_0x4c97('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x4c97('0x2'));var logger=require(_0x4c97('0x3'))(_0x4c97('0x4'));module['exports']=function(_0x4c123a,_0x5f0971,_0x390a58,_0x3605fe){return new BPromise(function(_0x1fad6a,_0x547197){logger[_0x4c97('0x5')](_0x4c97('0x6'),_0x3605fe||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x3cd90e=new WebSocket(_0x3605fe||_0x4c97('0x7'),{'perMessageDeflate':![]});var _0x133f27='';var _0x4d7fca='0';var _0x4d558='1';var _0x7a77cc='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x377b91(_0x418686){var _0x772c39=crypto[_0x4c97('0x8')](_0x4c97('0x9'));_0x772c39[_0x4c97('0xa')](_0x418686);return _0x772c39['digest']('hex');}function _0x2a69ab(){try{logger['info'](_0x4c97('0xb'));var _0x2d1137=moment()[_0x4c97('0xc')]();var _0xf8bb7d=_0x377b91(_0x2d1137+_0x5f0971+_0x390a58);_0x3cd90e[_0x4c97('0xd')](JSON['stringify']({'appID':_0x5f0971,'timestamp':_0x2d1137,'appKey':_0xf8bb7d}));var _0x50f78c=fs[_0x4c97('0xe')](_0x4c123a);_0x50f78c['on'](_0x4c97('0xf'),function(_0x400ab1){_0x3cd90e[_0x4c97('0xd')](_0x400ab1);});_0x50f78c['on'](_0x4c97('0x10'),function(){_0x3cd90e[_0x4c97('0xd')]('EOS');});}catch(_0x59175f){logger[_0x4c97('0x11')](_0x4c97('0x12'),JSON['stringify'](_0x59175f));_0x3cd90e[_0x4c97('0x13')]();}}function _0x5b3f68(_0x17eac2){try{if(_0x17eac2){var _0x18725e=JSON[_0x4c97('0x14')](_0x17eac2);switch(_0x18725e[_0x4c97('0x15')]){case 0x0:if(_0x18725e[_0x4c97('0x16')]){if(_0x18725e[_0x4c97('0x16')][_0x4c97('0x17')]){logger[_0x4c97('0x5')](_0x4c97('0x18'),JSON[_0x4c97('0x19')](_0x18725e[_0x4c97('0x16')][_0x4c97('0x1a')]));_0x133f27=_0x18725e[_0x4c97('0x16')][_0x4c97('0x1a')][0x0][_0x4c97('0x1b')];_0x4d7fca=_0x18725e[_0x4c97('0x16')][_0x4c97('0x1a')][0x0][_0x4c97('0x1c')];_0x4d558='0';_0x7a77cc=_0x4c97('0x1d');_0x3cd90e['terminate']();}}break;case 0x1:logger[_0x4c97('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4d558='1';_0x7a77cc='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x4c97('0x5')](_0x4c97('0x1e'));_0x4d558='2';_0x7a77cc=_0x4c97('0x1e');break;case 0x9:logger[_0x4c97('0x5')](_0x4c97('0x1f'));_0x4d558='9';_0x7a77cc=_0x4c97('0x1f');break;case 0xa:logger[_0x4c97('0x5')](_0x4c97('0x20'));_0x4d558='10';_0x7a77cc='Authentication\x20failed.';break;case 0xb:logger[_0x4c97('0x5')](_0x4c97('0x21'));_0x4d558='11';_0x7a77cc=_0x4c97('0x21');}}}catch(_0x2a015a){logger[_0x4c97('0x11')](_0x4c97('0x22'),JSON[_0x4c97('0x19')](_0x2a015a));_0x3cd90e[_0x4c97('0x13')]();}}function _0x1b5a04(){logger['info'](_0x4c97('0x23'));_0x1fad6a({'transcript':_0x133f27,'confidence':_0x4d7fca,'status':_0x4d558,'status_message':_0x7a77cc});}function _0x522f85(_0x5058c6){logger[_0x4c97('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x4c97('0x24')](_0x5058c6)){logger[_0x4c97('0x11')](_['isObject'](_0x5058c6)?JSON[_0x4c97('0x19')](_0x5058c6):_0x5058c6);}}_0x3cd90e['on']('open',_0x2a69ab);_0x3cd90e['on'](_0x4c97('0x25'),_0x5b3f68);_0x3cd90e['on']('close',_0x1b5a04);_0x3cd90e['on'](_0x4c97('0x11'),_0x522f85);});};
\ No newline at end of file
+var _0x7fb7=['Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','error','terminate','parse','status','result','final','hypotheses','transcript','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex'];(function(_0x79ed2f,_0x18a5fc){var _0x421792=function(_0x1869ca){while(--_0x1869ca){_0x79ed2f['push'](_0x79ed2f['shift']());}};_0x421792(++_0x18a5fc);}(_0x7fb7,0x11c));var _0x77fb=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0x7fb7[_0x3186aa];return _0x2d8c36;};'use strict';var BPromise=require('bluebird');var _=require(_0x77fb('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x77fb('0x1'));var crypto=require(_0x77fb('0x2'));var logger=require(_0x77fb('0x3'))('agi');module[_0x77fb('0x4')]=function(_0x445b86,_0x4dc8c2,_0x4de2f2,_0x243583){return new BPromise(function(_0x2fe69d,_0x19d1fc){logger[_0x77fb('0x5')](_0x77fb('0x6'),_0x243583||_0x77fb('0x7'));var _0x2dc117=new WebSocket(_0x243583||_0x77fb('0x7'),{'perMessageDeflate':![]});var _0x2e897c='';var _0x3073a8='0';var _0x9ff89c='1';var _0x38747c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x10f802(_0x3c5ba0){var _0x5406a8=crypto['createHash'](_0x77fb('0x8'));_0x5406a8[_0x77fb('0x9')](_0x3c5ba0);return _0x5406a8[_0x77fb('0xa')](_0x77fb('0xb'));}function _0x4f951c(){try{logger[_0x77fb('0x5')](_0x77fb('0xc'));var _0x1773ae=moment()[_0x77fb('0xd')]();var _0x17dad8=_0x10f802(_0x1773ae+_0x4dc8c2+_0x4de2f2);_0x2dc117[_0x77fb('0xe')](JSON[_0x77fb('0xf')]({'appID':_0x4dc8c2,'timestamp':_0x1773ae,'appKey':_0x17dad8}));var _0xfaf930=fs['createReadStream'](_0x445b86);_0xfaf930['on'](_0x77fb('0x10'),function(_0x1c8ad9){_0x2dc117[_0x77fb('0xe')](_0x1c8ad9);});_0xfaf930['on']('close',function(){_0x2dc117[_0x77fb('0xe')]('EOS');});}catch(_0x45d8a1){logger[_0x77fb('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0x77fb('0xf')](_0x45d8a1));_0x2dc117[_0x77fb('0x12')]();}}function _0x33e318(_0x5ec5f5){try{if(_0x5ec5f5){var _0x399ec0=JSON[_0x77fb('0x13')](_0x5ec5f5);switch(_0x399ec0[_0x77fb('0x14')]){case 0x0:if(_0x399ec0[_0x77fb('0x15')]){if(_0x399ec0[_0x77fb('0x15')][_0x77fb('0x16')]){logger[_0x77fb('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0x77fb('0xf')](_0x399ec0[_0x77fb('0x15')][_0x77fb('0x17')]));_0x2e897c=_0x399ec0[_0x77fb('0x15')][_0x77fb('0x17')][0x0][_0x77fb('0x18')];_0x3073a8=_0x399ec0['result']['hypotheses'][0x0]['likelihood'];_0x9ff89c='0';_0x38747c='Success.';_0x2dc117[_0x77fb('0x12')]();}}break;case 0x1:logger[_0x77fb('0x5')](_0x77fb('0x19'));_0x9ff89c='1';_0x38747c=_0x77fb('0x19');break;case 0x2:logger[_0x77fb('0x5')](_0x77fb('0x1a'));_0x9ff89c='2';_0x38747c=_0x77fb('0x1a');break;case 0x9:logger['info'](_0x77fb('0x1b'));_0x9ff89c='9';_0x38747c=_0x77fb('0x1b');break;case 0xa:logger['info'](_0x77fb('0x1c'));_0x9ff89c='10';_0x38747c=_0x77fb('0x1c');break;case 0xb:logger['info'](_0x77fb('0x1d'));_0x9ff89c='11';_0x38747c=_0x77fb('0x1d');}}}catch(_0x4b5fd5){logger[_0x77fb('0x11')](_0x77fb('0x1e'),JSON[_0x77fb('0xf')](_0x4b5fd5));_0x2dc117[_0x77fb('0x12')]();}}function _0x5b28f3(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x2fe69d({'transcript':_0x2e897c,'confidence':_0x3073a8,'status':_0x9ff89c,'status_message':_0x38747c});}function _0x308c1a(_0x2e7289){logger[_0x77fb('0x11')](_0x77fb('0x1f'));if(!_[_0x77fb('0x20')](_0x2e7289)){logger[_0x77fb('0x11')](_[_0x77fb('0x21')](_0x2e7289)?JSON[_0x77fb('0xf')](_0x2e7289):_0x2e7289);}}_0x2dc117['on'](_0x77fb('0x22'),_0x4f951c);_0x2dc117['on'](_0x77fb('0x23'),_0x33e318);_0x2dc117['on'](_0x77fb('0x24'),_0x5b28f3);_0x2dc117['on'](_0x77fb('0x11'),_0x308c1a);});};
\ No newline at end of file
index 84e9e49..85135e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01de=['./asr','exports'];(function(_0x1a458a,_0x4b141d){var _0x39a3dd=function(_0x342476){while(--_0x342476){_0x1a458a['push'](_0x1a458a['shift']());}};_0x39a3dd(++_0x4b141d);}(_0x01de,0x158));var _0xe01d=function(_0x3159b8,_0x46e0c0){_0x3159b8=_0x3159b8-0x0;var _0x3896fe=_0x01de[_0x3159b8];return _0x3896fe;};var asr=require(_0xe01d('0x0'));module[_0xe01d('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xf060=['exports','./asr'];(function(_0x1d17e4,_0x55d54f){var _0x5556b0=function(_0x1c3bb7){while(--_0x1c3bb7){_0x1d17e4['push'](_0x1d17e4['shift']());}};_0x5556b0(++_0x55d54f);}(_0xf060,0x1a3));var _0x0f06=function(_0x280cb6,_0x4b92fa){_0x280cb6=_0x280cb6-0x0;var _0xbaf53=_0xf060[_0x280cb6];return _0xbaf53;};var asr=require(_0x0f06('0x0'));module[_0x0f06('0x1')]={'asr':asr};
\ No newline at end of file
index e198abf..af1e3aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91e2=['error','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','events','EventEmitter','./error','127.0.0.1','emit','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR'];(function(_0x43625f,_0x4ab491){var _0x2988d1=function(_0x5059bf){while(--_0x5059bf){_0x43625f['push'](_0x43625f['shift']());}};_0x2988d1(++_0x4ab491);}(_0x91e2,0x181));var _0x291e=function(_0x4369ec,_0x959b0e){_0x4369ec=_0x4369ec-0x0;var _0x1369bb=_0x91e2[_0x4369ec];return _0x1369bb;};'use strict';var util=require('util');var net=require(_0x291e('0x0'));var EventEmitter=require(_0x291e('0x1'))[_0x291e('0x2')];var AGIError=require(_0x291e('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x2982cf,_0x415ad5,_0x2da65b){var _0x21add6=this,_0x2982cf=_0x2982cf||0x11dd,_0x415ad5=_0x415ad5||_0x291e('0x4'),_0x42cb84=null,_0x3cf66d=0x0;EventEmitter['call'](_0x21add6);function _0x5014b3(){if(!_0x2982cf){_0x21add6[_0x291e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x42cb84=net[_0x291e('0x6')]();_0x42cb84['listen'](_0x2982cf,_0x415ad5);_0x42cb84['on'](_0x291e('0x7'),function(){_0x21add6[_0x291e('0x5')]('listening');});_0x42cb84['on'](_0x291e('0x8'),function(_0x5c24fa){_0x42cb84[_0x291e('0x9')](function(_0x4cff70,_0x1f0774){if(_0x4cff70){_0x21add6[_0x291e('0x5')]('error',new AGIError(_0x291e('0xa'),_0x4cff70));}else if(_0x2da65b&&_0x2da65b<0x0){_0x21add6[_0x291e('0x5')](_0x291e('0xb'),new AGIError(_0x291e('0xc')));_0x5c24fa[_0x291e('0xd')]();}else if(_0x2da65b&&_0x2da65b>0x0&&_0x2da65b<_0x1f0774){_0x3cf66d+=0x1;_0x21add6[_0x291e('0x5')](_0x291e('0xb'),new AGIError(_0x291e('0xe'),_0x3cf66d));_0x5c24fa[_0x291e('0xd')]();}else{var _0x3af573=new AGIChannel(_0x5c24fa);_0x3af573['on'](_0x291e('0xf'),function(){_0x21add6['emit'](_0x291e('0x8'),_0x3af573);});}});});_0x42cb84['on'](_0x291e('0xb'),function(_0x53459a){_0x21add6[_0x291e('0x5')](_0x291e('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x53459a[_0x291e('0x10')]));});_0x42cb84['on'](_0x291e('0x11'),function(){_0x21add6['emit'](_0x291e('0x11'),new AGIError(_0x291e('0x12')));});}process[_0x291e('0x13')](function(){_0x5014b3();});};util[_0x291e('0x14')](AGIServer,EventEmitter);module[_0x291e('0x15')]=function(_0x169783,_0x2c8832,_0x1f91c8){return new AGIServer(_0x169783,_0x2c8832,_0x1f91c8);};
\ No newline at end of file
+var _0x0583=['E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','nextTick','inherits','exports','util','events','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','getConnections'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0x0583,0x1ad));var _0x3058=function(_0x242362,_0x1df5bc){_0x242362=_0x242362-0x0;var _0x162d3c=_0x0583[_0x242362];return _0x162d3c;};'use strict';var util=require(_0x3058('0x0'));var net=require('net');var EventEmitter=require(_0x3058('0x1'))['EventEmitter'];var AGIError=require(_0x3058('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x17b76e,_0x2ecaf1,_0x1074e0){var _0x485877=this,_0x17b76e=_0x17b76e||0x11dd,_0x2ecaf1=_0x2ecaf1||_0x3058('0x3'),_0x188bde=null,_0x111e3c=0x0;EventEmitter[_0x3058('0x4')](_0x485877);function _0x3c281f(){if(!_0x17b76e){_0x485877[_0x3058('0x5')](_0x3058('0x6'),new AGIError(_0x3058('0x7')));return![];}_0x188bde=net['createServer']();_0x188bde[_0x3058('0x8')](_0x17b76e,_0x2ecaf1);_0x188bde['on'](_0x3058('0x9'),function(){_0x485877['emit']('listening');});_0x188bde['on'](_0x3058('0xa'),function(_0x583f8d){_0x188bde[_0x3058('0xb')](function(_0x325138,_0x1a9d5c){if(_0x325138){_0x485877[_0x3058('0x5')]('error',new AGIError(_0x3058('0xc'),_0x325138));}else if(_0x1074e0&&_0x1074e0<0x0){_0x485877[_0x3058('0x5')](_0x3058('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x583f8d[_0x3058('0xd')]();}else if(_0x1074e0&&_0x1074e0>0x0&&_0x1074e0<_0x1a9d5c){_0x111e3c+=0x1;_0x485877[_0x3058('0x5')](_0x3058('0x6'),new AGIError(_0x3058('0xe'),_0x111e3c));_0x583f8d[_0x3058('0xd')]();}else{var _0x201a42=new AGIChannel(_0x583f8d);_0x201a42['on'](_0x3058('0xf'),function(){_0x485877[_0x3058('0x5')]('connection',_0x201a42);});}});});_0x188bde['on'](_0x3058('0x6'),function(_0x51c784){_0x485877['emit'](_0x3058('0x6'),new AGIError(_0x3058('0xc'),_0x51c784[_0x3058('0x10')]));});_0x188bde['on'](_0x3058('0x11'),function(){_0x485877['emit']('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x3058('0x12')](function(){_0x3c281f();});};util[_0x3058('0x13')](AGIServer,EventEmitter);module[_0x3058('0x14')]=function(_0x3386a6,_0x2db71a,_0x27bd23){return new AGIServer(_0x3386a6,_0x2db71a,_0x27bd23);};
\ No newline at end of file
index 8f2a5aa..e738d85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c64=['no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','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','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','hiddendigitsnum','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[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','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','%s/recordings/%s','generate','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','true','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeechASR','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','streamFile','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','authentication','auth','user','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','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','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','join','util','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariableById','then','name','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','priority','dnid','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','internal','format','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleCloudTTS','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','timeout','includes','POST','PUT','method','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','url','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeech_tts_language','speed','key','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','aws_bot_name','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar'];(function(_0x56a106,_0xdd347c){var _0xb202d9=function(_0x3022d5){while(--_0x3022d5){_0x56a106['push'](_0x56a106['shift']());}};_0xb202d9(++_0xdd347c);}(_0x1c64,0x11d));var _0x41c6=function(_0x5908b7,_0x5db689){_0x5908b7=_0x5908b7-0x0;var _0x260809=_0x1c64[_0x5908b7];return _0x260809;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x41c6('0x0'));var _=require('lodash');var sh=require(_0x41c6('0x1'));var odbc=require(_0x41c6('0x2'))();var rs=require(_0x41c6('0x3'));var moment=require(_0x41c6('0x4'));var Mustache=require(_0x41c6('0x5'));var rp=require('request-promise');var logger=require(_0x41c6('0x6'))(_0x41c6('0x7'));var config=require(_0x41c6('0x8'));var scripts=require(_0x41c6('0x9'));var FILES_PATH=_0x41c6('0xa');var recursiveMapAttributes=[_0x41c6('0xb'),_0x41c6('0xc')];var verticesWithRetry=[_0x41c6('0xd'),_0x41c6('0xe'),_0x41c6('0xf')];var AGIVertices=function(_0xf91198,_0x4244bd,_0xf8f335){this['channel']=_0xf91198;this[_0x41c6('0x10')]=_0x4244bd;this[_0x41c6('0x11')]=_0xf8f335;};AGIVertices['prototype']['getVariable']=function(_0x2d1044,_0x1bd954){this[_0x41c6('0x10')][_0x41c6('0x12')](_0x2d1044)[_0x41c6('0x13')](function(_0x1d1c78){_0x1bd954(null,_0x1d1c78?_0x1d1c78[_0x41c6('0x14')]:![]);})[_0x41c6('0x15')](function(_0x106904){_0x1bd954(_0x106904);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x17')]=function(_0x17b0b3,_0x2df32a){this[_0x41c6('0x10')][_0x41c6('0x18')](_0x17b0b3)[_0x41c6('0x13')](function(_0x201ff4){_0x2df32a(null,_0x201ff4?_0x201ff4[_0x41c6('0x14')]:![]);})[_0x41c6('0x15')](function(_0xd34d94){_0x2df32a(_0xd34d94);});};AGIVertices[_0x41c6('0x16')]['getSquareProject']=function(_0x2db159,_0x2d8ab3){this[_0x41c6('0x10')]['getSquareProjectById'](_0x2db159)[_0x41c6('0x13')](function(_0xb997d4){_0x2d8ab3(null,_0xb997d4?_0xb997d4['name']:![]);})[_0x41c6('0x15')](function(_0x18310d){_0x2d8ab3(_0x18310d);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x19')]=function(_0x4a5a2c,_0x2a94f9){this['rpc'][_0x41c6('0x1a')](_0x4a5a2c)[_0x41c6('0x13')](function(_0x30fa33){_0x2a94f9(null,_0x30fa33?_0x30fa33[_0x41c6('0x1b')]:![]);})[_0x41c6('0x15')](function(_0x5b5055){_0x2a94f9(_0x5b5055);});};AGIVertices[_0x41c6('0x16')]['getUser']=function(_0x4ee65a,_0x49ec66){this['rpc'][_0x41c6('0x1c')](_0x4ee65a)[_0x41c6('0x13')](function(_0x2f9eb5){_0x49ec66(null,_0x2f9eb5?_0x2f9eb5[_0x41c6('0x14')]:![]);})[_0x41c6('0x15')](function(_0x4b880c){_0x49ec66(_0x4b880c);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1d')]=function(_0x48d5a8,_0x4197e3){this['rpc'][_0x41c6('0x1e')](_0x48d5a8)[_0x41c6('0x13')](function(_0x38d26c){_0x4197e3(null,_0x38d26c?_0x38d26c['name']:![]);})[_0x41c6('0x15')](function(_0x1b89ce){_0x4197e3(_0x1b89ce);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1f')]=function(_0x1a8af4,_0x32c133){var _0x536c87=this;this[_0x41c6('0x10')][_0x41c6('0x20')](_0x1a8af4)[_0x41c6('0x13')](function(_0x1521e7){_0x32c133(null,_0x1521e7?_0x536c87[_0x41c6('0x21')](_0x1521e7[_0x41c6('0x22')]):![]);})[_0x41c6('0x15')](function(_0x513ded){_0x32c133(_0x513ded);});};AGIVertices[_0x41c6('0x16')]['getMailAccount']=function(_0x2fc80e,_0x447fd){this[_0x41c6('0x10')][_0x41c6('0x23')](_0x2fc80e)[_0x41c6('0x13')](function(_0x43555d){_0x447fd(null,_0x43555d?_0x43555d:![]);})[_0x41c6('0x15')](function(_0x202640){_0x447fd(_0x202640);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x24')]=function(_0x43ee1a,_0x539e4c,_0x213945){this[_0x41c6('0x11')][_0x41c6('0x24')](_0x43ee1a,_0x539e4c)[_0x41c6('0x13')](function(){_0x213945(null);})[_0x41c6('0x15')](function(_0x557a6f){_0x213945(_0x557a6f);});};AGIVertices['prototype'][_0x41c6('0x25')]=function(_0x17ecf6,_0x2d1ff0){this[_0x41c6('0x10')]['getIntervalById'](_0x17ecf6)[_0x41c6('0x13')](function(_0x4af16b){if(_0x4af16b){if(_0x4af16b[_0x41c6('0x26')]){_0x2d1ff0(null,[_0x4af16b[_0x41c6('0x27')]]);}else{_0x2d1ff0(null,_[_0x41c6('0x28')](_0x4af16b[_0x41c6('0x29')],'interval'));}}else{_0x2d1ff0(null,![]);}})[_0x41c6('0x15')](function(_0x3e5e41){_0x2d1ff0(_0x3e5e41);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x21')]=function(_0x1b758e){return util['format'](_0x41c6('0x2a'),FILES_PATH,_0x1b758e);};AGIVertices['prototype']['getQueryOdbc']=function(_0x570135,_0x4cb90e,_0x5935ae){odbc[_0x41c6('0x2b')](_0x570135,function(_0x173a56){if(_0x173a56){logger['error'](_0x41c6('0x2c'),_0x173a56);_0x5935ae(_0x173a56);}else{logger[_0x41c6('0x2d')](_0x41c6('0x2e'));odbc[_0x41c6('0x2f')](_0x4cb90e,function(_0x3386ae,_0x539537){if(_0x3386ae){logger[_0x41c6('0x2d')]('Error\x20executing\x20query\x20%s',_0x4cb90e);_0x5935ae(_0x3386ae);}else{logger[_0x41c6('0x2d')](_0x41c6('0x30'),_0x4cb90e);odbc[_0x41c6('0x31')](function(_0x41a96c){if(_0x41a96c){logger[_0x41c6('0x32')](_0x41c6('0x33'),_0x41a96c);}_0x5935ae(null,_0x539537);});}});}});};AGIVertices[_0x41c6('0x16')]['getSmsAccount']=function(_0x18cb2d,_0x16193b){this[_0x41c6('0x10')][_0x41c6('0x34')](_0x18cb2d)[_0x41c6('0x13')](function(_0x18bc61){_0x16193b(null,_0x18bc61?_0x18bc61:![]);})[_0x41c6('0x15')](function(_0x4ed46d){_0x16193b(_0x4ed46d);});};AGIVertices['prototype'][_0x41c6('0x35')]=function(_0x3fe298,_0x493841){this[_0x41c6('0x10')][_0x41c6('0x35')](_0x3fe298)[_0x41c6('0x13')](function(_0x1bda68){_0x493841(null,_0x1bda68);})[_0x41c6('0x15')](function(_0xb3a365){_0x493841(_0xb3a365);});};AGIVertices[_0x41c6('0x16')]['createSquareDetailsReport']=function(_0xaea4f1,_0x2d4d96,_0x3cd2a8){this[_0x41c6('0x10')][_0x41c6('0x36')]({'uniqueid':this['channel'][_0x41c6('0x37')],'node':_0xaea4f1[_0x41c6('0x38')],'application':_0xaea4f1[_0x41c6('0x39')],'data':_0x2d4d96||null,'project_name':this[_0x41c6('0x3a')][_0x41c6('0x3b')],'callerid':this[_0x41c6('0x3a')][_0x41c6('0x3c')]})[_0x41c6('0x13')](function(_0x3a73d7){if(_0x3cd2a8){_0x3cd2a8(null,_0x3a73d7);}})[_0x41c6('0x15')](function(_0x407947){if(_0x3cd2a8){_0x3cd2a8(_0x407947);}});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x3d')]=function(_0x250fd9,_0x59755d,_0x5b79bd,_0x35e88f){this[_0x41c6('0x10')][_0x41c6('0x3d')]({'uniqueid':this[_0x41c6('0x3a')]['uniqueid'],'callerid':this['channel'][_0x41c6('0x3c')],'calleridname':this[_0x41c6('0x3a')]['calleridname'],'context':this[_0x41c6('0x3a')]['context'],'extension':this[_0x41c6('0x3a')]['extension'],'priority':this['channel'][_0x41c6('0x3e')],'accountcode':this[_0x41c6('0x3a')]['accountcode'],'dnid':this[_0x41c6('0x3a')][_0x41c6('0x3f')],'projectName':this[_0x41c6('0x3a')][_0x41c6('0x3b')],'saveName':_0x59755d,'filename':_0x250fd9['file']||_0x59755d,'savePath':_0x5b79bd})[_0x41c6('0x13')](function(_0x3644ef){_0x35e88f(null,_0x3644ef);})[_0x41c6('0x15')](function(_0x2f733d){_0x35e88f(_0x2f733d);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x40')]=function(_0x437ced,_0x1c82bf,_0x10366f,_0x4adac2,_0x556c28){this[_0x41c6('0x10')]['createSquareMessage']({'uniqueid':this[_0x41c6('0x3a')][_0x41c6('0x37')],'body':_0x437ced,'direction':_0x1c82bf,'providerName':_0x10366f,'providerResponse':_0x4adac2})[_0x41c6('0x13')](function(_0x1e20b0){if(_0x556c28){_0x556c28(null,_0x1e20b0);}})['catch'](function(_0x144fbd){if(_0x556c28){_0x556c28(_0x144fbd);}});};AGIVertices['prototype']['createCmContact']=function(_0xc2dfea,_0x34e0a2){this[_0x41c6('0x10')][_0x41c6('0x41')]({'firstName':_['isEmpty'](_0xc2dfea['name'])||_[_0x41c6('0x42')](_0xc2dfea['name'])?_0x41c6('0x43')+Math[_0x41c6('0x44')]():_0xc2dfea['name'],'lastName':_[_0x41c6('0x45')](_0xc2dfea[_0x41c6('0x46')])||_['isNil'](_0xc2dfea[_0x41c6('0x46')])?null:_0xc2dfea[_0x41c6('0x46')],'phone':_0xc2dfea[_0x41c6('0x47')],'ListId':_0xc2dfea[_0x41c6('0x48')],'scheduledat':_0xc2dfea[_0x41c6('0x49')],'callbackUniqueid':this[_0x41c6('0x3a')]['uniqueid'],'tags':'callback','description':_0x41c6('0x4a')+_0xc2dfea['scheduledAt'][_0x41c6('0x4b')](),'priority':_0xc2dfea[_0x41c6('0x4c')]})[_0x41c6('0x13')](function(_0x1fe79b){_0x34e0a2(null,_0x1fe79b);})[_0x41c6('0x15')](function(_0x2c3a5b){_0x34e0a2(_0x2c3a5b);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x4d')]=function(_0x1733b3,_0x210a96){this['rpc'][_0x41c6('0x4e')](_0x1733b3)['then'](function(_0x5a862c){_0x210a96(null,_0x5a862c?_0x5a862c[_0x41c6('0x14')]:![]);})[_0x41c6('0x15')](function(_0x5dfc4a){_0x210a96(_0x5dfc4a);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x4f')]=function(_0x21cd2a,_0x4fe6be,_0x382da6){var _0x2d9035={'role':'agent'};_0x2d9035[_0x21cd2a]=this['channel'][_0x41c6('0x3c')];this[_0x41c6('0x10')][_0x41c6('0x4f')](_0x2d9035,_0x4fe6be,this['channel'][_0x41c6('0x37')])[_0x41c6('0x13')](function(_0x22983b){_0x382da6(null,_[_0x41c6('0x42')](_0x22983b)?![]:!![]);})[_0x41c6('0x15')](function(_0xb89703){logger[_0x41c6('0x32')](_0xb89703);_0x382da6(null,![]);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x50')]=function(_0x573db7,_0x28925f){var _0x40307e={'role':_0x41c6('0x51')};_0x40307e[_0x573db7]=this[_0x41c6('0x3a')][_0x41c6('0x3c')];this[_0x41c6('0x10')][_0x41c6('0x50')](_0x40307e)[_0x41c6('0x13')](function(_0x24a7b2){_0x28925f(null,_[_0x41c6('0x42')](_0x24a7b2)?![]:!![]);})[_0x41c6('0x15')](function(_0x24406d){logger[_0x41c6('0x32')](_0x24406d);_0x28925f(null,![]);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x52')]=function(_0x5ec842,_0x2801a7){var _0x2de095={'role':'agent'};_0x2de095[_0x5ec842]=this[_0x41c6('0x3a')][_0x41c6('0x3c')];this[_0x41c6('0x10')]['agentLogout'](_0x2de095)['then'](function(_0x3dbd88){_0x2801a7(null,_[_0x41c6('0x42')](_0x3dbd88)?![]:!![]);})['catch'](function(_0x5281ed){logger[_0x41c6('0x32')](_0x5281ed);_0x2801a7(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x4bedfc,_0x368700){var _0x3eaefb={'role':_0x41c6('0x51')};_0x3eaefb[_0x4bedfc]=this[_0x41c6('0x3a')]['callerid'];var _0x2fe0fe=_0x4bedfc!=_0x41c6('0x53')?util[_0x41c6('0x54')](_0x41c6('0x55'),_0x41c6('0x56'),this[_0x41c6('0x3a')]['callerid']):undefined;this[_0x41c6('0x10')][_0x41c6('0x57')](_0x3eaefb,_0x2fe0fe)[_0x41c6('0x13')](function(_0x5a537c){_0x368700(null,_[_0x41c6('0x42')](_0x5a537c)?![]:!![]);})[_0x41c6('0x15')](function(_0x51f4a9){logger[_0x41c6('0x32')](_0x51f4a9);_0x368700(null,![]);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x58')]=function(_0x1b6b41,_0x23cfb3){sh[_0x41c6('0x59')](_[_0x41c6('0x5a')](_0x1b6b41),function(_0x1cb4fb,_0x40b807){var _0x13a88f=_0x40b807['replace'](/(\r\n|\n|\r)/gm,'');_0x23cfb3(null,_0x13a88f);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x5b')]=function(_0x44abc1,_0x6b747){scripts[_0x41c6('0x5b')](_0x44abc1['apiKey'],_0x44abc1['google_cloud_tts_text_type']||_0x41c6('0x5c'),_0x44abc1[_0x41c6('0x5c')],_0x44abc1['languageCode']||_0x41c6('0x5d'),_0x44abc1[_0x41c6('0x5e')]||_0x41c6('0x5f'),_0x44abc1[_0x41c6('0x60')]||_0x41c6('0x61'))[_0x41c6('0x13')](function(_0x4e77f4){_0x6b747(null,_0x4e77f4);})[_0x41c6('0x15')](function(_0x2a1245){_0x6b747(_0x2a1245);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x62')]=function(_0x164531,_0x5da171){scripts['googleTTS'](_0x164531['text'],_0x164531[_0x41c6('0x63')]||'en',0x1)[_0x41c6('0x13')](function(_0x250642){_0x5da171(null,_0x250642);})[_0x41c6('0x15')](function(_0x3ed7a7){_0x5da171(_0x3ed7a7);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x64')]=function(_0x2ee0e0,_0x3764bb){var _0x3b2a95={'uri':_0x2ee0e0['url'],'method':_0x2ee0e0['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2ee0e0[_0x41c6('0x65')])==='number'&&parseInt(_0x2ee0e0[_0x41c6('0x65')])>=0x1?parseInt(_0x2ee0e0[_0x41c6('0x65')])*0x3e8:0x5*0x3e8};if(_[_0x41c6('0x66')]([_0x41c6('0x67'),_0x41c6('0x68')],_0x3b2a95[_0x41c6('0x69')][_0x41c6('0x6a')]())){try{_0x3b2a95['body']=_0x2ee0e0[_0x41c6('0xc')]?JSON[_0x41c6('0x6b')](_0x2ee0e0['rawBody']):{};}catch(_0x198ada){logger['error'](_0x41c6('0x6c'),_0x198ada);}}try{_0x3b2a95[_0x41c6('0x6d')]=_0x2ee0e0[_0x41c6('0xb')]?JSON[_0x41c6('0x6b')](_0x2ee0e0['rawHeaders']):{};}catch(_0x80df9){logger[_0x41c6('0x32')](_0x41c6('0x6e'),_0x80df9);}if(_0x2ee0e0['computedVariables']){try{var _0x13794e=require(_0x2ee0e0['computedVariables'])[_0x41c6('0x6f')](this,_0x3b2a95);_0x3b2a95[_0x41c6('0x70')]=Mustache[_0x41c6('0x71')](_0x2ee0e0[_0x41c6('0x72')],_0x13794e,{},['$$','$$']);if(_0x3b2a95['headers']){_0x3b2a95[_0x41c6('0x6d')]=JSON[_0x41c6('0x6b')](Mustache[_0x41c6('0x71')](JSON[_0x41c6('0x73')](_0x3b2a95[_0x41c6('0x6d')]),_0x13794e,{},['$$','$$']));}if(_0x3b2a95['body']){_0x3b2a95[_0x41c6('0x74')]=JSON[_0x41c6('0x6b')](Mustache['render'](JSON[_0x41c6('0x73')](_0x3b2a95[_0x41c6('0x74')]),_0x13794e,{},['$$','$$']));}}catch(_0x51dffe){logger[_0x41c6('0x32')](_0x41c6('0x75'),_0x51dffe);}}rp(_0x3b2a95)[_0x41c6('0x13')](function(_0x10e3f1){var _0x3cfb68={'statusCode':_0x10e3f1[_0x41c6('0x76')]||0xc8,'statusMessage':_0x10e3f1[_0x41c6('0x77')]||'OK','headers':_0x10e3f1[_0x41c6('0x6d')]||{},'body':_0x10e3f1[_0x41c6('0x74')]||{}};_0x3764bb(null,_0x3cfb68);})['catch'](function(_0x581c65){var _0x2ccf49={'statusCode':_0x581c65[_0x41c6('0x76')]||0x1f4,'statusMessage':_0x581c65[_0x41c6('0x78')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x581c65[_0x41c6('0x79')]['headers']||{},'body':_0x581c65[_0x41c6('0x79')][_0x41c6('0x74')]||{}};_0x3764bb(null,_0x2ccf49);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x7a')]=function(_0x32a749,_0x11264f){scripts['googleDialogflow'](this[_0x41c6('0x3a')][_0x41c6('0x37')],_0x32a749['key'],_0x32a749[_0x41c6('0x5c')],_0x32a749[_0x41c6('0x7b')]||'en')[_0x41c6('0x13')](function(_0x1952a4){_0x11264f(null,_0x1952a4);})[_0x41c6('0x15')](function(_0x3b4b94){_0x11264f(_0x3b4b94);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x7c')]=function(_0x11db0b,_0xf58e89){scripts[_0x41c6('0x7c')](this['channel'][_0x41c6('0x37')],_0x11db0b[_0x41c6('0x7d')],_0x11db0b[_0x41c6('0x7e')],_0x11db0b[_0x41c6('0x7f')],_0x11db0b[_0x41c6('0x5c')],_0x11db0b[_0x41c6('0x80')]||'en')[_0x41c6('0x13')](function(_0x1e6a7c){_0xf58e89(null,_0x1e6a7c);})[_0x41c6('0x15')](function(_0x114ed6){_0xf58e89(_0x114ed6);});};AGIVertices[_0x41c6('0x16')]['sestekNDA']=function(_0x21be84,_0x481523){scripts[_0x41c6('0x81')](this[_0x41c6('0x3a')],_0x21be84)['then'](function(_0x48479d){_0x481523(null,_0x48479d);})[_0x41c6('0x15')](function(_0x4c23ef){_0x481523(_0x4c23ef);});};AGIVertices['prototype']['ispeechTTS']=function(_0x46ca27,_0x5ab93a){scripts['ispeechTTS'](_0x46ca27['key'],_0x46ca27['text'],_0x46ca27[_0x41c6('0x82')]||_0x41c6('0x5d'),_0x46ca27[_0x41c6('0x83')])[_0x41c6('0x13')](function(_0x341d88){_0x5ab93a(null,_0x341d88);})[_0x41c6('0x15')](function(_0x132a04){_0x5ab93a(_0x132a04);});};AGIVertices['prototype']['ispeechASR']=function(_0x28cdfc,_0x3e323f,_0x4a4833){scripts['ispeechASR'](_0x3e323f,_0x28cdfc[_0x41c6('0x84')],_0x28cdfc[_0x41c6('0x85')]||'en-US',this[_0x41c6('0x86')](_0x28cdfc[_0x41c6('0x87')])?_0x28cdfc[_0x41c6('0x87')]:undefined)[_0x41c6('0x13')](function(_0x3e2f0c){_0x4a4833(null,_0x3e2f0c);})[_0x41c6('0x15')](function(_0x1e2402){_0x4a4833(_0x1e2402);});};AGIVertices['prototype'][_0x41c6('0x88')]=function(_0x5b2e5e,_0x264f7c){scripts[_0x41c6('0x88')](_0x5b2e5e[_0x41c6('0x89')],_0x5b2e5e[_0x41c6('0x8a')],_0x5b2e5e[_0x41c6('0x8b')],_0x5b2e5e['aws_polly_voice']||_0x41c6('0x8c'),_0x5b2e5e['text'],_0x5b2e5e['aws_text_type']||_0x41c6('0x5c'))['then'](function(_0x3e90ef){_0x264f7c(null,_0x3e90ef);})[_0x41c6('0x15')](function(_0x5bf4dc){_0x264f7c(_0x5bf4dc);});};AGIVertices['prototype'][_0x41c6('0x8d')]=function(_0x2e889b,_0x598532){scripts[_0x41c6('0x8d')](this[_0x41c6('0x3a')][_0x41c6('0x37')],_0x2e889b['aws_access_key_id'],_0x2e889b['aws_secret_access_key'],_0x2e889b[_0x41c6('0x8e')],_0x2e889b[_0x41c6('0x5c')],_0x2e889b[_0x41c6('0x8f')])[_0x41c6('0x13')](function(_0x574a69){_0x598532(null,_0x574a69);})[_0x41c6('0x15')](function(_0x468086){_0x598532(_0x468086);});};AGIVertices[_0x41c6('0x16')]['googleASR']=function(_0x367028,_0xe2ab98,_0x1f910a){scripts['googleASR'](_0xe2ab98,_0x367028[_0x41c6('0x84')],_0x367028[_0x41c6('0x90')]||_0x41c6('0x5d'))['then'](function(_0x21c6d5){_0x1f910a(null,_0x21c6d5);})['catch'](function(_0x477a09){_0x1f910a(_0x477a09);});};AGIVertices['prototype']['tildeASR']=function(_0xcbca93,_0x562c5e,_0x311ab5){scripts[_0x41c6('0x91')](_0x562c5e,_0xcbca93[_0x41c6('0x92')],_0xcbca93[_0x41c6('0x93')],_0xcbca93[_0x41c6('0x70')])[_0x41c6('0x13')](function(_0x305b57){_0x311ab5(null,_0x305b57);})[_0x41c6('0x15')](function(_0x372cf0){_0x311ab5(_0x372cf0);});};AGIVertices[_0x41c6('0x16')][_0x41c6('0x94')]=function(_0x421784){var _0x79b7bc=_['includes'](verticesWithRetry,_0x421784[_0x41c6('0x39')])?_0x421784:_[_0x41c6('0x95')](_0x421784);for(var _0xb8421 in _0x79b7bc){if(_0x79b7bc['hasOwnProperty'](_0xb8421)){if(_0x79b7bc[_0xb8421]&&_[_0x41c6('0x96')](_0x79b7bc[_0xb8421])){if(_[_0x41c6('0x66')](recursiveMapAttributes,_0xb8421)){_0x79b7bc[_0xb8421]=this[_0x41c6('0x97')](_0x79b7bc[_0xb8421]);}else{_0x79b7bc[_0xb8421]=this['replaceAllVariables'](_0x79b7bc[_0xb8421]);}}}}return _0x79b7bc;};AGIVertices[_0x41c6('0x16')][_0x41c6('0x98')]=function(_0x51fbb4){for(var _0x5216f9 in _0x51fbb4){if(_0x51fbb4[_0x41c6('0x99')](_0x5216f9)){if(_[_0x41c6('0x9a')](_0x51fbb4[_0x5216f9])){this['recursiveNodeIndex'](_0x51fbb4[_0x5216f9]);}else if(_[_0x41c6('0x9b')](_0x51fbb4[_0x5216f9])){for(var _0x22f91f=0x0;_0x22f91f<_0x51fbb4[_0x5216f9][_0x41c6('0x9c')];_0x22f91f++){this[_0x41c6('0x98')](_0x51fbb4[_0x5216f9][_0x22f91f]);}}else if(_[_0x41c6('0x96')](_0x51fbb4[_0x5216f9])){_0x51fbb4[_0x5216f9]=this[_0x41c6('0x9d')](_0x51fbb4[_0x5216f9]);}}}};AGIVertices['prototype'][_0x41c6('0x9e')]=function(_0x985d8b,_0x23e12f){for(var _0x43b6ec in _0x985d8b){if(_0x985d8b[_0x41c6('0x99')](_0x43b6ec)){if(_['isPlainObject'](_0x985d8b[_0x43b6ec])){if(!_['isEmpty'](_0x985d8b[_0x43b6ec])){this['saveRestApiResult'](_0x985d8b[_0x43b6ec],util[_0x41c6('0x54')](_0x41c6('0x9f'),_0x23e12f,_0x43b6ec));}}else if(_[_0x41c6('0x9b')](_0x985d8b[_0x43b6ec])){for(var _0x35d0a1=0x0;_0x35d0a1<_0x985d8b[_0x43b6ec][_0x41c6('0x9c')];_0x35d0a1++){this[_0x41c6('0x9e')](_0x985d8b[_0x43b6ec][_0x35d0a1],util[_0x41c6('0x54')](_0x41c6('0x9f'),_0x23e12f,_0x43b6ec+'['+_0x35d0a1+']'));}}else{if(!_[_0x41c6('0x42')](_0x985d8b[_0x43b6ec])){this[_0x41c6('0x3a')][_0x41c6('0xa0')](util[_0x41c6('0x54')]('%s.%s',_0x23e12f,_0x43b6ec),_0x985d8b[_0x43b6ec]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x546c38){try{var _0x24f06b=JSON['parse'](_0x546c38);this[_0x41c6('0x98')](_0x24f06b);return JSON[_0x41c6('0x73')](_0x24f06b);}catch(_0x3c894b){return this['replaceAllVariables'](_0x546c38);}};AGIVertices[_0x41c6('0x16')][_0x41c6('0x9d')]=function(_0x3f7a16){var _0x339e4c=_0x3f7a16[_0x41c6('0xa1')]('{');for(var _0x1449e3=0x1;_0x1449e3<_0x339e4c[_0x41c6('0x9c')];_0x1449e3+=0x1){var _0xf7e6ad=_0x339e4c[_0x1449e3][_0x41c6('0xa1')]('}');if(_0xf7e6ad[_0x41c6('0x9c')]>0x1){_0x3f7a16=_0x3f7a16[_0x41c6('0xa2')]('{'+_0xf7e6ad[0x0]+'}',this[_0x41c6('0x3a')][_0x41c6('0xa3')](_0xf7e6ad[0x0])[_0x41c6('0xa4')]||_0xf7e6ad[0x0]);}}if(_0x339e4c['length']===0x1){return _0x3f7a16[_0x41c6('0x4b')]();}return this[_0x41c6('0x9d')](_0x3f7a16);};AGIVertices['prototype'][_0x41c6('0xa5')]=function(_0x3e6d64,_0x2f98fb){var _0x5c8283=this['channel'][_0x41c6('0xa3')](_0x3e6d64);if(_0x5c8283[_0x41c6('0xa6')]===-0x1){return _0x5c8283;}logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2f98fb,_0x5c8283[_0x41c6('0xa4')]));return this['channel'][_0x41c6('0xa0')](_0x2f98fb,_0x5c8283[_0x41c6('0xa4')]);};AGIVertices[_0x41c6('0x16')][_0x41c6('0x86')]=function(_0x497ee9){return _0x497ee9&&_0x497ee9!=='0'&&_0x497ee9!=='-1'&&_0x497ee9!=='';};AGIVertices[_0x41c6('0x16')][_0x41c6('0xa7')]=function(_0x621932){this[_0x41c6('0x36')][_0x41c6('0x6f')](this,_0x621932,'-');_0x621932['retry']=_0x621932[_0x41c6('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x41c6('0xa8')]=function(_0x339b9e){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0xa9'),_0x339b9e[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x339b9e['text'])){return this['channel']['noop'](_0x41c6('0xaa'));}var _0x2a2ddf='\x22'+_0x339b9e['text']+'\x22';if(this[_0x41c6('0x86')](_0x339b9e[_0x41c6('0x79')])){_0x2a2ddf+=','+_0x339b9e[_0x41c6('0x79')];}var _0x33c687=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xab'),_0x2a2ddf);if(_0x33c687[_0x41c6('0xa6')]===-0x1){return _0x33c687;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xad'),_0x2a2ddf));};AGIVertices[_0x41c6('0x16')][_0x41c6('0xae')]=function(_0x431323){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x431323['label']));if(!this['isConfigured'](_0x431323[_0x41c6('0xaf')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xb0'));}var _0x20f8b0=_0x431323[_0x41c6('0xaf')];if(this[_0x41c6('0x86')](_0x431323[_0x41c6('0x79')])){_0x20f8b0+=','+_0x431323[_0x41c6('0x79')];}var _0x3f66c7=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xb1'),_0x20f8b0);if(_0x3f66c7[_0x41c6('0xa6')]===-0x1){return _0x3f66c7;}var _0x323368=this[_0x41c6('0xa5')]('RECOG_CONFIDENCE()',_0x41c6('0xb2'));if(_0x323368['result']===-0x1){return _0x323368;}var _0xcfeac5=this[_0x41c6('0xa5')](_0x41c6('0xb3'),_0x41c6('0xb4'));if(_0xcfeac5['result']===-0x1){return _0xcfeac5;}var _0x5b75f1=this[_0x41c6('0xa5')](_0x41c6('0xb5'),_0x41c6('0xb6'));if(_0x5b75f1['result']===-0x1){return _0x5b75f1;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xb7'),_0x20f8b0));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x7')]=function(_0x56e131){logger['info'](util[_0x41c6('0x54')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x56e131[_0x41c6('0x38')]));return this[_0x41c6('0x3a')][_0x41c6('0x7')]([_0x56e131[_0x41c6('0xb8')],_0x56e131['args']]);};AGIVertices[_0x41c6('0x16')][_0x41c6('0xb9')]=function(_0x45cfd2){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0xba'),_0x45cfd2[_0x41c6('0x38')]));if(this[_0x41c6('0x86')](_0x45cfd2[_0x41c6('0x65')])){logger['info'](util['format'](_0x41c6('0xbb'),_0x45cfd2['timeout']));var _0x5ce7fd=this[_0x41c6('0x3a')][_0x41c6('0xbc')](_0x45cfd2[_0x41c6('0x65')]);if(_0x5ce7fd[_0x41c6('0xa6')]===-0x1){return _0x5ce7fd;}}return this[_0x41c6('0x3a')][_0x41c6('0xb9')]();};AGIVertices[_0x41c6('0x16')]['callback']=function(_0x4b0188){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0xbd'),_0x4b0188['label']));if(!this[_0x41c6('0x86')](_0x4b0188['list_id'])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x4b0188,'no\x20list\x20selected');}_0x4b0188[_0x41c6('0x49')]=moment();if(this[_0x41c6('0x86')](_0x4b0188[_0x41c6('0xbe')])){_0x4b0188['scheduledAt']=moment()['add'](_0x4b0188['delay'],_0x41c6('0xbf'));}if(!this[_0x41c6('0x86')](_0x4b0188['callback_priority'])){_0x4b0188[_0x41c6('0x4c')]=0x2;}this[_0x41c6('0x41')][_0x41c6('0x6f')](this,_0x4b0188);return this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format'](_0x41c6('0xc0'),_0x4b0188[_0x41c6('0x47')],_0x4b0188[_0x41c6('0x48')],_0x4b0188['scheduledAt']));};AGIVertices[_0x41c6('0x16')]['custom_app']=function(_0x2a9844){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0xc1'),_0x2a9844['label']));var _0x36c764=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x2a9844[_0x41c6('0xc2')],_0x2a9844[_0x41c6('0x79')]);if(_0x36c764[_0x41c6('0xa6')]===-0x1){return _0x36c764;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xc3'),_0x2a9844[_0x41c6('0xc2')],_0x2a9844[_0x41c6('0x79')]));};AGIVertices[_0x41c6('0x16')][_0x41c6('0xc4')]=function(_0x1a6ed4){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0xc5'),_0x1a6ed4['label']));if(!this[_0x41c6('0x86')](_0x1a6ed4['text'])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xaa'));}var _0x3c761e='\x22'+_0x1a6ed4[_0x41c6('0x5c')]+'\x22';if(this[_0x41c6('0x86')](_0x1a6ed4[_0x41c6('0x79')])){_0x3c761e+=','+_0x1a6ed4[_0x41c6('0x79')];}var _0x57a530=this[_0x41c6('0x3a')][_0x41c6('0x59')]('MRCPSynth',_0x3c761e);if(_0x57a530[_0x41c6('0xa6')]===-0x1){return _0x57a530;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xad'),_0x3c761e));};AGIVertices[_0x41c6('0x16')][_0x41c6('0xc6')]=function(_0x5cba4c){logger['info'](util['format'](_0x41c6('0xc7'),_0x5cba4c[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x5cba4c['text'])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xaa'));}var _0x1e8167='\x22'+_0x5cba4c['text']+'\x22';if(this[_0x41c6('0x86')](_0x5cba4c[_0x41c6('0x79')])){_0x1e8167+=','+_0x5cba4c[_0x41c6('0x79')];}var _0x519a5d=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xab'),_0x1e8167);if(_0x519a5d[_0x41c6('0xa6')]===-0x1){return _0x519a5d;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format'](_0x41c6('0xad'),_0x1e8167));};AGIVertices['prototype'][_0x41c6('0xc8')]=function(_0x4d39d5){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0xc9'),_0x4d39d5['label']));if(!this[_0x41c6('0x86')](_0x4d39d5['grammar'])){return this['channel'][_0x41c6('0xac')]('no\x20grammar\x20configured');}var _0x675257=_0x4d39d5[_0x41c6('0xaf')];if(this[_0x41c6('0x86')](_0x4d39d5[_0x41c6('0x79')])){_0x675257+=','+_0x4d39d5['options'];}var _0x47ea75=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xb1'),_0x675257);if(_0x47ea75['result']===-0x1){return _0x47ea75;}var _0x146b50=this[_0x41c6('0xa5')](_0x41c6('0xca'),_0x41c6('0xcb'));if(_0x146b50[_0x41c6('0xa6')]===-0x1){return _0x146b50;}var _0xbb226a=this['getAndSetVariable']('RECOG_INPUT()',_0x41c6('0xcc'));if(_0xbb226a[_0x41c6('0xa6')]===-0x1){return _0xbb226a;}var _0x1f4f15=this['getAndSetVariable'](_0x41c6('0xb5'),_0x41c6('0xcd'));if(_0x1f4f15['result']===-0x1){return _0x1f4f15;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format'](_0x41c6('0xb7'),_0x675257));};AGIVertices[_0x41c6('0x16')]['sestekasr']=function(_0x596509){logger[_0x41c6('0x2d')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x596509[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x596509[_0x41c6('0xaf')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xb0'));}var _0x1febaf=_0x596509[_0x41c6('0xaf')];if(this[_0x41c6('0x86')](_0x596509[_0x41c6('0x79')])){_0x1febaf+=','+_0x596509['options'];}var _0x5477b8=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xb1'),_0x1febaf);if(_0x5477b8['result']===-0x1){return _0x5477b8;}var _0x5deb5b=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x41c6('0xce'));if(_0x5deb5b['result']===-0x1){return _0x5deb5b;}var _0x47d1ee=this[_0x41c6('0xa5')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x47d1ee[_0x41c6('0xa6')]===-0x1){return _0x47d1ee;}var _0xbae013=this[_0x41c6('0xa5')](_0x41c6('0xb5'),_0x41c6('0xcf'));if(_0xbae013[_0x41c6('0xa6')]===-0x1){return _0xbae013;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format'](_0x41c6('0xb7'),_0x1febaf));};AGIVertices['prototype']['database']=function(_0x827cd7){logger[_0x41c6('0x2d')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x827cd7[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x827cd7[_0x41c6('0xd0')])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x827cd7,_0x41c6('0xd1'));}var _0x4df051=this['getSquareOdbc'][_0x41c6('0x6f')](this,_0x827cd7[_0x41c6('0xd0')]);if(!_0x4df051){return this[_0x41c6('0x3a')]['error'](_0x827cd7,_0x41c6('0xd2'));}if(!this[_0x41c6('0x86')](_0x827cd7[_0x41c6('0x2f')])){return this[_0x41c6('0x3a')]['error'](_0x827cd7,_0x41c6('0xd3'));}var _0x1adb50=_0x827cd7[_0x41c6('0x2f')][_0x41c6('0xd4')](/(\r\n|\n|\r)/gm,'\x20');this[_0x41c6('0x3a')]['noop'](util['format']('query:\x20%s',_0x1adb50));var _0x1e81c9=this['getQueryOdbc'][_0x41c6('0x6f')](this,_0x4df051,_0x1adb50);this[_0x41c6('0x36')]['sync'](this,_0x827cd7,_0x1adb50);if(!this[_0x41c6('0x86')](_0x827cd7[_0x41c6('0xd5')])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xd6'));}var _0x1c4f31=this['getVariable'][_0x41c6('0x6f')](this,_0x827cd7[_0x41c6('0xd5')]);if(!_0x1c4f31){return this[_0x41c6('0x3a')]['error'](_0x827cd7,_0x41c6('0xd7'));}var _0x5af9cc=this;_0x1e81c9[_0x41c6('0xd8')](function(_0x31b9dc,_0x26ec20){Object[_0x41c6('0xd9')](_0x31b9dc)[_0x41c6('0xd8')](function(_0x272d87){_0x5af9cc[_0x41c6('0x3a')][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0xda'),_0x1c4f31,_0x26ec20,_0x272d87),_0x31b9dc[_0x272d87]);});});this['channel'][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0xdb'),_0x1c4f31),_0x1e81c9[_0x41c6('0x9c')]);return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xdc'),_0x1c4f31));};AGIVertices['prototype']['dial']=function(_0x147eeb){logger[_0x41c6('0xdd')](util[_0x41c6('0x54')](_0x41c6('0xde'),_0x147eeb[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x147eeb[_0x41c6('0xdf')])){return this['channel'][_0x41c6('0x32')](_0x147eeb,'no\x20user\x20selected');}var _0x183340=this[_0x41c6('0xe0')][_0x41c6('0x6f')](this,_0x147eeb[_0x41c6('0xdf')]);if(!_0x183340){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x147eeb,_0x41c6('0xe1'));}var _0x190617=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xe2'),[util[_0x41c6('0x54')]('SIP/%s',_0x183340),_0x147eeb[_0x41c6('0x65')],_0x147eeb[_0x41c6('0xe3')],_0x147eeb[_0x41c6('0x72')]]);if(_0x190617['result']===-0x1){return _0x190617;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format']('Executed\x20command\x20%s',_0x41c6('0xe2')));};AGIVertices[_0x41c6('0x16')][_0x41c6('0xe4')]=function(_0x134ded){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0xe5'),_0x134ded[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x134ded['key'])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xe6'));}if(!this[_0x41c6('0x86')](_0x134ded[_0x41c6('0x5c')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')]('no\x20text\x20configured');}this[_0x41c6('0x3a')][_0x41c6('0xe7')]=!![];this['createSquareDetailsReport'](_0x134ded);this[_0x41c6('0x40')](_0x134ded[_0x41c6('0x5c')],'in','','');this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xe8'),_0x134ded[_0x41c6('0x5c')]));var _0x4bc92c=this[_0x41c6('0x7a')]['sync'](this,_0x134ded);if(_0x4bc92c){for(var _0x37a4e5 in _0x4bc92c){if(_0x4bc92c[_0x41c6('0x99')](_0x37a4e5)){this['channel'][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0xe9'),_0x37a4e5[_0x41c6('0x6a')]()),_0x4bc92c[_0x37a4e5]);}}this[_0x41c6('0x40')](_0x4bc92c[_0x41c6('0xea')],_0x41c6('0xeb'),_0x41c6('0xe4'),'');return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')]('Dialogflow\x20Result\x20%s',_0x4bc92c['speech']));}return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x134ded,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x41c6('0xec')]=function(_0x51f9cf){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0xed'),_0x51f9cf['label']));if(!this[_0x41c6('0x86')](_0x51f9cf[_0x41c6('0x7d')])){return this['channel'][_0x41c6('0xac')]('no\x20project_id\x20configured');}if(!this[_0x41c6('0x86')](_0x51f9cf[_0x41c6('0x7e')])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xee'));}if(!this[_0x41c6('0x86')](_0x51f9cf[_0x41c6('0x7f')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xef'));}if(!this[_0x41c6('0x86')](_0x51f9cf[_0x41c6('0x80')])){return this['channel']['noop']('no\x20anguage\x20configured');}if(!this[_0x41c6('0x86')](_0x51f9cf[_0x41c6('0x5c')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xaa'));}this[_0x41c6('0x3a')][_0x41c6('0xe7')]=!![];this[_0x41c6('0x36')](_0x51f9cf);this[_0x41c6('0x40')](_0x51f9cf['text'],'in','','');this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xf0'),_0x51f9cf['text']));var _0x5bf865=this[_0x41c6('0x7c')][_0x41c6('0x6f')](this,_0x51f9cf);if(_0x5bf865){for(var _0x4cd3fb in _0x5bf865){if(_0x5bf865['hasOwnProperty'](_0x4cd3fb)){if(_0x4cd3fb!==_0x41c6('0xf1')){this[_0x41c6('0x3a')][_0x41c6('0xa0')](util['format'](_0x41c6('0xe9'),_0x4cd3fb[_0x41c6('0x6a')]()),_0x5bf865[_0x4cd3fb]);}}}this[_0x41c6('0x40')](_0x5bf865[_0x41c6('0xea')],_0x41c6('0xeb'),_0x41c6('0xec'),_0x5bf865[_0x41c6('0xf1')]);return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xf2'),_0x5bf865[_0x41c6('0xea')]));}return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x51f9cf,_0x41c6('0xf3'));};AGIVertices[_0x41c6('0x16')][_0x41c6('0xf4')]=function(_0x5ca2e5){logger['info'](util[_0x41c6('0x54')](_0x41c6('0xf5'),_0x5ca2e5[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x5ca2e5[_0x41c6('0xf6')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xf7'));}if(!this[_0x41c6('0x86')](_0x5ca2e5[_0x41c6('0xf8')])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xf9'));}if(!this[_0x41c6('0x86')](_0x5ca2e5['password'])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xfa'));}if(!this['isConfigured'](_0x5ca2e5[_0x41c6('0xfb')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xaa'));}this['channel']['bot']=!![];this[_0x41c6('0x36')](_0x5ca2e5);this[_0x41c6('0x40')](_0x5ca2e5[_0x41c6('0x5c')],'in','','');this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format'](_0x41c6('0xfc'),_0x5ca2e5[_0x41c6('0x5c')]));var _0x12a874=this[_0x41c6('0x81')][_0x41c6('0x6f')](this,_0x5ca2e5);if(_0x12a874){for(var _0x30c236 in _0x12a874){if(_0x12a874[_0x41c6('0x99')](_0x30c236)){this[_0x41c6('0x3a')][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0xfd'),_0x30c236[_0x41c6('0x6a')]()),_0x12a874[_0x30c236]);}}this['createSquareMessage'](_0x12a874[_0x41c6('0xea')],_0x41c6('0xeb'),_0x41c6('0xf4'),'');if(_0x12a874[_0x41c6('0xfe')]){this[_0x41c6('0x3a')][_0x41c6('0xac')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x12a874['audiofile']));var _0xe8d3f7=this[_0x41c6('0x3a')]['streamFile'](_0x12a874['audiofile']);try{fs[_0x41c6('0xff')](_0x12a874['audiofile']+_0x41c6('0x100'));}catch(_0x3a19f8){logger['error'](_0x3a19f8);}return _0xe8d3f7;}else{return this[_0x41c6('0x3a')]['noop'](util['format'](_0x41c6('0x101'),_0x12a874['speech']));}}return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x5ca2e5,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x41c6('0x102')]=function(_0x153136){logger['info'](util['format'](_0x41c6('0x103'),_0x153136['label']));return this['channel'][_0x41c6('0xac')]('end');};AGIVertices['prototype']['ext_dial']=function(_0x427799){logger['info'](util[_0x41c6('0x54')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x427799[_0x41c6('0x38')]));var _0x10e11e='';if(_0x427799['trunk_id']){if(!this[_0x41c6('0x86')](_0x427799[_0x41c6('0x104')])){return this[_0x41c6('0x3a')]['error'](_0x427799,_0x41c6('0x105'));}else{var _0x580087=parseInt(_0x427799[_0x41c6('0x104')],0xa);if(isNaN(_0x580087)){_0x10e11e=_0x427799[_0x41c6('0x104')];}else{_0x10e11e=this['getTrunk'][_0x41c6('0x6f')](this,_0x427799[_0x41c6('0x104')]);if(!_0x10e11e){return this['channel'][_0x41c6('0x32')](_0x427799,'no\x20trunk\x20found');}}}}else if(_0x427799[_0x41c6('0x106')]){_0x10e11e=_0x427799['trunk_name'];}else{return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x427799,'no\x20trunk\x20selected');}var _0x422e93=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0xe2'),[util[_0x41c6('0x54')](_0x41c6('0x107'),_0x10e11e,_0x427799[_0x41c6('0x47')]),_0x427799[_0x41c6('0x65')],_0x427799[_0x41c6('0xe3')],_0x427799[_0x41c6('0x72')]]);if(_0x422e93[_0x41c6('0xa6')]===-0x1){return _0x422e93;}return this['channel'][_0x41c6('0xac')](util['format']('Executed\x20command\x20%s',_0x41c6('0xe2')));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x108')]=function(_0x2c7caa){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2c7caa['label']));return this[_0x41c6('0x3a')][_0x41c6('0xac')]('finally');};AGIVertices[_0x41c6('0x16')][_0x41c6('0xe')]=function(_0x3fb36e){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x109'),_0x3fb36e['label']));if(_0x3fb36e[_0x41c6('0x10a')]===0x0){return this['maxRetry'](_0x3fb36e);}_0x3fb36e[_0x41c6('0x10a')]-=0x1;if(!this[_0x41c6('0x86')](_0x3fb36e[_0x41c6('0x10b')])){return this['channel']['error'](_0x3fb36e,_0x41c6('0x10c'));}var _0x4602e8=this[_0x41c6('0x1f')]['sync'](this,_0x3fb36e[_0x41c6('0x10b')]);if(!_0x4602e8){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x3fb36e,_0x41c6('0x10d'));}if(!this[_0x41c6('0x86')](_0x3fb36e[_0x41c6('0xd5')])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x41c6('0xd6'));}var _0x55ab3b=this[_0x41c6('0x3a')][_0x41c6('0x10e')](_0x4602e8,_0x3fb36e[_0x41c6('0x10f')],_0x3fb36e[_0x41c6('0x110')]);var _0x3339c6=_0x55ab3b[_0x41c6('0xa6')]?_0x55ab3b[_0x41c6('0xa6')][_0x41c6('0x4b')]():'';logger[_0x41c6('0x2d')](_0x41c6('0x111'),JSON[_0x41c6('0x73')](_0x55ab3b));if(_0x55ab3b[_0x41c6('0xa6')]===-0x1){this[_0x41c6('0x36')][_0x41c6('0x6f')](this,_0x3fb36e,_0x3339c6);return _0x55ab3b;}else if(_0x55ab3b[_0x41c6('0xa4')]==='timeout'){_0x55ab3b['result']=_0x3339c6[_0x41c6('0x9c')]>=parseInt(_0x3fb36e['mindigit'])?'x':'i';}else{_0x55ab3b[_0x41c6('0xa6')]=_0x3339c6[_0x41c6('0x9c')]>=parseInt(_0x3fb36e['mindigit'])&&_0x3339c6[_0x41c6('0x9c')]<=parseInt(_0x3fb36e[_0x41c6('0x110')])?'x':'i';}var _0x155e10=this['getVariable'][_0x41c6('0x6f')](this,_0x3fb36e[_0x41c6('0xd5')]);if(!_0x155e10){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x3fb36e,_0x41c6('0xd7'));}this['channel'][_0x41c6('0xa0')](_0x155e10,_0x3339c6);if(this[_0x41c6('0x86')](_0x3fb36e[_0x41c6('0x112')])){var _0x22c35e=parseInt(_0x3fb36e['hiddendigitsnum'],0xa);var _0x5a59b6=rs['generate']({'charset':'*','length':_0x22c35e});var _0xa83711=_0x3339c6[_0x41c6('0x9c')];if(_0xa83711>0x0){if(_0xa83711>_0x22c35e){this[_0x41c6('0x36')][_0x41c6('0x6f')](this,_0x3fb36e,_0x3fb36e[_0x41c6('0x113')]===_0x41c6('0x114')?_0x5a59b6+_0x3339c6['substr'](_0x22c35e):_0x3339c6[_0x41c6('0x115')](0x0,_0xa83711-_0x22c35e)+_0x5a59b6);}else{this[_0x41c6('0x36')][_0x41c6('0x6f')](this,_0x3fb36e,rs['generate']({'charset':'*','length':_0xa83711}));}}else{this[_0x41c6('0x36')][_0x41c6('0x6f')](this,_0x3fb36e,'');}}else{this[_0x41c6('0x36')][_0x41c6('0x6f')](this,_0x3fb36e,_0x3339c6);}return _0x55ab3b;};AGIVertices['prototype'][_0x41c6('0xf')]=function(_0x51e407){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x116'),_0x51e407[_0x41c6('0x38')]));return this[_0x41c6('0xe')](_0x51e407);};AGIVertices['prototype'][_0x41c6('0x117')]=function(_0x5ccec9){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x118'),_0x5ccec9[_0x41c6('0x38')]));this['createSquareDetailsReport'][_0x41c6('0x6f')](this,_0x5ccec9,_0x5ccec9[_0x41c6('0x119')]);return this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x11a'),_0x5ccec9[_0x41c6('0x119')]));};AGIVertices[_0x41c6('0x16')]['awspolly']=function(_0x28d0e6){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x11b'),_0x28d0e6[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x28d0e6[_0x41c6('0x89')])||!this[_0x41c6('0x86')](_0x28d0e6[_0x41c6('0x8a')])){return this[_0x41c6('0x3a')]['noop'](_0x41c6('0x11c'));}if(!this[_0x41c6('0x86')](_0x28d0e6[_0x41c6('0x5c')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xaa'));}this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x11d'),_0x28d0e6['text']));var _0x540bbb=this[_0x41c6('0x88')][_0x41c6('0x6f')](this,_0x28d0e6);if(_0x540bbb){this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x11e'),_0x540bbb));var _0x3d94a6=this[_0x41c6('0x3a')]['streamFile'](_0x540bbb);try{fs[_0x41c6('0xff')](_0x540bbb+_0x41c6('0x100'));}catch(_0x8cc1a5){logger[_0x41c6('0x32')](_0x8cc1a5);}return _0x3d94a6;}return this['channel']['error'](_0x28d0e6,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x41c6('0x16')][_0x41c6('0x11f')]=function(_0x2daef3){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x120'),_0x2daef3['label']));if(!this[_0x41c6('0x86')](_0x2daef3['aws_access_key_id'])||!this['isConfigured'](_0x2daef3[_0x41c6('0x8a')])){return this[_0x41c6('0x3a')]['noop'](_0x41c6('0x11c'));}if(!this[_0x41c6('0x86')](_0x2daef3['aws_bot_name'])){return this['channel'][_0x41c6('0xac')](_0x41c6('0x121'));}if(!this[_0x41c6('0x86')](_0x2daef3[_0x41c6('0x5c')])){return this[_0x41c6('0x3a')]['noop']('no\x20text\x20configured');}this[_0x41c6('0x3a')]['bot']=!![];this[_0x41c6('0x36')](_0x2daef3);this[_0x41c6('0x40')](_0x2daef3[_0x41c6('0x5c')],'in','','');this['channel'][_0x41c6('0xac')](util['format'](_0x41c6('0x122'),_0x2daef3[_0x41c6('0x5c')]));var _0x510b83=this['awsLex'][_0x41c6('0x6f')](this,_0x2daef3);if(_0x510b83){for(var _0x4d3a59 in _0x510b83){if(_0x510b83[_0x41c6('0x99')](_0x4d3a59)&&_[_0x41c6('0x96')](_0x510b83[_0x4d3a59])){this[_0x41c6('0x3a')][_0x41c6('0xa0')](util['format'](_0x41c6('0x123'),_0x4d3a59[_0x41c6('0x6a')]()),_0x510b83[_0x4d3a59]);}}if(_[_0x41c6('0x42')](_0x510b83[_0x41c6('0x78')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x124'));}else{this['createSquareMessage'](_0x510b83['message'],'out',_0x41c6('0x125'),'');return this[_0x41c6('0x3a')]['noop'](util['format'](_0x41c6('0x126'),_0x510b83[_0x41c6('0x78')]));}}return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x2daef3,_0x41c6('0x127'));};AGIVertices['prototype'][_0x41c6('0x128')]=function(_0x2d3f25){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x129'),_0x2d3f25[_0x41c6('0x38')],_0x2d3f25[_0x41c6('0x65')]));if(!this[_0x41c6('0x86')](_0x2d3f25[_0x41c6('0x84')])){return this[_0x41c6('0x3a')]['noop']('no\x20key\x20configured');}var _0x49d8bc=_0x41c6('0x12a');var _0x2daa36=util[_0x41c6('0x54')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x10c819=util['format'](_0x41c6('0x9f'),_0x2daa36,_0x49d8bc);var _0x13b646=!![];if(_0x2d3f25[_0x41c6('0x12b')]===_0x41c6('0x12c')){_0x13b646=![];}var _0x2467f2=this['channel'][_0x41c6('0x12d')](_0x2daa36,_0x49d8bc,_0x2d3f25[_0x41c6('0x12e')],_0x2d3f25['timeout'],undefined,_0x13b646);if(_0x2467f2['result']!==-0x1){this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x12f'),_0x10c819));var _0x4f493c=this['googleASR']['sync'](this,_0x2d3f25,_0x10c819);if(_0x4f493c){for(var _0x2004ae in _0x4f493c){if(_0x4f493c[_0x41c6('0x99')](_0x2004ae)){this[_0x41c6('0x3a')][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0x130'),_0x2004ae[_0x41c6('0x6a')]()),_0x4f493c[_0x2004ae]);}}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x131'),JSON[_0x41c6('0x73')](_0x4f493c)));}}return _0x2467f2;};AGIVertices[_0x41c6('0x16')]['tildeasr']=function(_0x320be4){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x132'),_0x320be4[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x320be4['appid'])){return this['channel']['noop']('no\x20appid\x20configured');}if(!this[_0x41c6('0x86')](_0x320be4[_0x41c6('0x93')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')]('no\x20appsecret\x20configured');}var _0x37ca61='wav';var _0x3a1a8e=util[_0x41c6('0x54')](_0x41c6('0x133'),FILES_PATH,rs[_0x41c6('0x134')](0x4));var _0x2922c8=util['format'](_0x41c6('0x9f'),_0x3a1a8e,_0x37ca61);var _0x290e74=!![];if(_0x320be4[_0x41c6('0x12b')]==='NOBEEP'){_0x290e74=![];}var _0x2d8dcf=this[_0x41c6('0x3a')][_0x41c6('0x12d')](_0x3a1a8e,_0x37ca61,_0x320be4[_0x41c6('0x12e')],_0x320be4[_0x41c6('0x65')],undefined,_0x290e74);if(_0x2d8dcf['result']!==-0x1){this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x135'),_0x2922c8));var _0x4e8fc9=this[_0x41c6('0x91')][_0x41c6('0x6f')](this,_0x320be4,_0x2922c8);if(_0x4e8fc9){for(var _0x201be4 in _0x4e8fc9){if(_0x4e8fc9[_0x41c6('0x99')](_0x201be4)){this['channel'][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0x136'),_0x201be4[_0x41c6('0x6a')]()),_0x4e8fc9[_0x201be4]);}}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x137'),JSON[_0x41c6('0x73')](_0x4e8fc9)));}}return _0x2d8dcf;};AGIVertices['prototype']['gotoc']=function(_0x121d7b){logger[_0x41c6('0x2d')](util['format']('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x121d7b['label']));return this[_0x41c6('0x3a')][_0x41c6('0x138')](_0x121d7b[_0x41c6('0x139')],_0x121d7b[_0x41c6('0x13a')],_0x121d7b[_0x41c6('0x3e')]);};AGIVertices['prototype'][_0x41c6('0x13b')]=function(_0x57f6b3){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x13c'),_0x57f6b3[_0x41c6('0x38')]));if(!this['isConfigured'](_0x57f6b3[_0x41c6('0x13d')])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x57f6b3,_0x41c6('0x13e'));}try{var _0x4e37e3=eval(_0x57f6b3['condition'])?'true':_0x41c6('0x13f');this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x140'),_0x57f6b3[_0x41c6('0x13d')],_0x4e37e3));return{'code':0xc8,'result':_0x4e37e3};}catch(_0x48d960){return{'code':0xc8,'result':_0x41c6('0x13f')};}};AGIVertices[_0x41c6('0x16')][_0x41c6('0x141')]=function(_0x5cd669){logger[_0x41c6('0x2d')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5cd669['label']));if(!this[_0x41c6('0x86')](_0x5cd669[_0x41c6('0x142')])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x5cd669,_0x41c6('0x143'));}var _0xd8ed16=this[_0x41c6('0x25')][_0x41c6('0x6f')](this,_0x5cd669[_0x41c6('0x142')]);if(!_0xd8ed16){return this['channel'][_0x41c6('0x32')](_0x5cd669,_0x41c6('0x144'));}for(var _0x3d8254=0x0;_0x3d8254<_0xd8ed16[_0x41c6('0x9c')];_0x3d8254+=0x1){var _0x481239=this['channel'][_0x41c6('0xa3')](util[_0x41c6('0x54')]('IFTIME(%s?true:false)',_0xd8ed16[_0x3d8254]));if(_0x481239['result']===-0x1){return _0x481239;}logger['info'](util[_0x41c6('0x54')](_0x41c6('0x145'),_0xd8ed16[_0x3d8254],_0x481239[_0x41c6('0xa4')]));if(_0x481239[_0x41c6('0xa4')]===_0x41c6('0x146')){logger['info'](util['format'](_0x41c6('0x145'),_0xd8ed16[_0x3d8254],_0x41c6('0x146')));this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')]('IFTIME\x20%s\x20%s',_0xd8ed16[_0x3d8254],_0x41c6('0x146')));return{'code':0xc8,'result':_0x41c6('0x146')};}else{logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('IFTIME\x20%s\x20%s',_0xd8ed16[_0x3d8254],_0x41c6('0x13f')));this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x145'),_0xd8ed16[_0x3d8254],_0x41c6('0x13f')));}}return{'code':0xc8,'result':_0x41c6('0x13f')};};AGIVertices['prototype']['hangup']=function(_0x380937){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x380937[_0x41c6('0x38')]));return this[_0x41c6('0x3a')][_0x41c6('0x147')]();};AGIVertices[_0x41c6('0x16')][_0x41c6('0x148')]=function(_0x52c6cb){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x149'),_0x52c6cb[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x52c6cb[_0x41c6('0x84')])){return this[_0x41c6('0x3a')]['noop'](_0x41c6('0xe6'));}var _0x4f1ac3=_0x41c6('0x12a');var _0x235a32=util[_0x41c6('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x41c6('0x134')](0x4));var _0x364296=util[_0x41c6('0x54')](_0x41c6('0x9f'),_0x235a32,_0x4f1ac3);var _0x33b4fb=!![];if(_0x52c6cb[_0x41c6('0x12b')]==='NOBEEP'){_0x33b4fb=![];}var _0xe8034e=this[_0x41c6('0x3a')]['recordFile'](_0x235a32,_0x4f1ac3,_0x52c6cb[_0x41c6('0x12e')],_0x52c6cb[_0x41c6('0x65')],undefined,_0x33b4fb);if(_0xe8034e[_0x41c6('0xa6')]!==-0x1){this[_0x41c6('0x3a')]['noop'](util['format']('ispeech\x20%s\x20file\x20created',_0x364296));var _0x3bb6ce=this[_0x41c6('0x14a')][_0x41c6('0x6f')](this,_0x52c6cb,_0x364296);if(_0x3bb6ce){for(var _0x2e3aa2 in _0x3bb6ce){if(_0x3bb6ce['hasOwnProperty'](_0x2e3aa2)){this[_0x41c6('0x3a')][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0x14b'),_0x2e3aa2[_0x41c6('0x6a')]()),_0x3bb6ce[_0x2e3aa2]);}}return this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x14c'),JSON[_0x41c6('0x73')](_0x3bb6ce)));}}return _0xe8034e;};AGIVertices[_0x41c6('0x16')][_0x41c6('0x14d')]=function(_0x964a5e){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x14e'),_0x964a5e[_0x41c6('0x38')]));if(!this['isConfigured'](_0x964a5e['key'])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xe6'));}if(!this[_0x41c6('0x86')](_0x964a5e[_0x41c6('0x5c')])){return this['channel'][_0x41c6('0xac')](_0x41c6('0xaa'));}this['channel'][_0x41c6('0xac')](util['format'](_0x41c6('0x14f'),_0x964a5e[_0x41c6('0x5c')]));var _0x14eb12=this['ispeechTTS']['sync'](this,_0x964a5e);if(_0x14eb12){this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x150'),_0x14eb12));var _0x1122ae=this[_0x41c6('0x3a')][_0x41c6('0x151')](_0x14eb12,_0x964a5e['intKey']);try{fs[_0x41c6('0xff')](_0x14eb12+_0x41c6('0x100'));}catch(_0xf362f5){logger[_0x41c6('0x32')](_0xf362f5);}return _0x1122ae;}return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x964a5e,_0x41c6('0x152'));};AGIVertices[_0x41c6('0x16')]['login']=function(_0x4f6d57){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x153'),_0x4f6d57[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x4f6d57['findBy'])){return this[_0x41c6('0x3a')]['error'](_0x4f6d57,_0x41c6('0x154'));}logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x155'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x4f6d57['findBy']));var _0x335a3e=this['agentLogin']['sync'](this,_0x4f6d57[_0x41c6('0x156')]);if(_0x335a3e){logger['info'](util[_0x41c6('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x41c6('0x3a')]['callerid'],_0x4f6d57[_0x41c6('0x156')]));this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x157'),this['channel'][_0x41c6('0x3c')],_0x4f6d57[_0x41c6('0x156')]));return{'code':0xc8,'result':_0x41c6('0x158')};}else{logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x4f6d57['findBy']));this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x159'),this['channel'][_0x41c6('0x3c')],_0x4f6d57[_0x41c6('0x156')]));return{'code':0xc8,'result':_0x41c6('0x15a')};}};AGIVertices[_0x41c6('0x16')][_0x41c6('0x15b')]=function(_0x3e9291){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3e9291['label']));if(!this['isConfigured'](_0x3e9291['findBy'])){return this[_0x41c6('0x3a')]['error'](_0x3e9291,_0x41c6('0x154'));}logger[_0x41c6('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x41c6('0x3a')]['callerid'],_0x3e9291[_0x41c6('0x156')]));var _0x238f30=this[_0x41c6('0x52')]['sync'](this,_0x3e9291[_0x41c6('0x156')]);if(_0x238f30){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x41c6('0x3c')],_0x3e9291[_0x41c6('0x156')]));this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x157'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x3e9291[_0x41c6('0x156')]));return{'code':0xc8,'result':_0x41c6('0x158')};}else{logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x159'),this['channel'][_0x41c6('0x3c')],_0x3e9291[_0x41c6('0x156')]));this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x159'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x3e9291[_0x41c6('0x156')]));return{'code':0xc8,'result':_0x41c6('0x15a')};}};AGIVertices[_0x41c6('0x16')][_0x41c6('0x15c')]=function(_0x35d09d){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x15d'),_0x35d09d[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x35d09d['operation'])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x35d09d,_0x41c6('0x15e'));}this['channel']['noop'](util[_0x41c6('0x54')](_0x41c6('0x15f'),_0x35d09d[_0x41c6('0x160')]));var _0x5b29f0=eval(_0x35d09d[_0x41c6('0x160')]);if(!this[_0x41c6('0x86')](_0x35d09d[_0x41c6('0xd5')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xd6'));}var _0x21e791=this['getVariable']['sync'](this,_0x35d09d[_0x41c6('0xd5')]);if(!_0x21e791){return this['channel'][_0x41c6('0x32')](_0x35d09d,_0x41c6('0xd7'));}if(_['isArray'](_0x5b29f0)){var _0x301ae9=this;_0x5b29f0[_0x41c6('0xd8')](function(_0x4f85b7,_0x3e2293){_0x301ae9[_0x41c6('0x3a')][_0x41c6('0xa0')](util['format']('%s[%s]',_0x21e791,_0x3e2293),_0x4f85b7);});return this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x161'),_0x21e791));}else{return this[_0x41c6('0x3a')][_0x41c6('0xa0')](_0x21e791,_0x5b29f0);}};AGIVertices[_0x41c6('0x16')][_0x41c6('0xd')]=function(_0xb72b03){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x162'),_0xb72b03[_0x41c6('0x38')]));if(_0xb72b03[_0x41c6('0x10a')]===0x0){return this[_0x41c6('0xa7')](_0xb72b03);}_0xb72b03['retry']-=0x1;if(!this[_0x41c6('0x86')](_0xb72b03['file_id'])){return this[_0x41c6('0x3a')]['error'](_0xb72b03,_0x41c6('0x10c'));}var _0x2028fd=this[_0x41c6('0x1f')]['sync'](this,_0xb72b03[_0x41c6('0x10b')]);if(!_0x2028fd){return this['channel'][_0x41c6('0x32')](_0xb72b03,_0x41c6('0x10d'));}var _0x5c1b0a=this[_0x41c6('0x3a')][_0x41c6('0x10e')](_0x2028fd,_0xb72b03['response'],_0xb72b03['digit']);var _0x5de5d8=_0x5c1b0a['result'];if(_0x5c1b0a[_0x41c6('0xa6')]===-0x1){this[_0x41c6('0x36')]['sync'](this,_0xb72b03,'-1');return _0x5c1b0a;}else if(_0x5c1b0a[_0x41c6('0xa4')]===_0x41c6('0x65')){_0x5c1b0a[_0x41c6('0xa6')]=_0x5c1b0a['result']['length']>0x0?_0x5c1b0a[_0x41c6('0xa6')]:'t';}else if(_[_0x41c6('0x45')](_0x5c1b0a[_0x41c6('0xa6')])){_0x5c1b0a[_0x41c6('0xa6')]='#';_0x5de5d8='#';}if(!this[_0x41c6('0x86')](_0xb72b03[_0x41c6('0xd5')])){this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xd6'));}else{var _0x57fe51=this[_0x41c6('0xa3')]['sync'](this,_0xb72b03[_0x41c6('0xd5')]);if(!_0x57fe51){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0xb72b03,_0x41c6('0xd7'));}this[_0x41c6('0x3a')][_0x41c6('0xa0')](_0x57fe51,_0x5de5d8);}this[_0x41c6('0x36')]['sync'](this,_0xb72b03,_0x5de5d8);return _0x5c1b0a;};AGIVertices[_0x41c6('0x16')]['noop']=function(_0xf79ced){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x163'),_0xf79ced['label']));return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0xf79ced[_0x41c6('0x164')]||_0xf79ced[_0x41c6('0x38')]);};AGIVertices[_0x41c6('0x16')][_0x41c6('0x165')]=function(_0x34b1b8){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x166'),_0x34b1b8[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x34b1b8['findBy'])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x34b1b8,'no\x20find\x20by\x20configured');}logger['info'](util[_0x41c6('0x54')](_0x41c6('0x155'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x34b1b8[_0x41c6('0x156')]));var _0x33be33=this[_0x41c6('0x4d')][_0x41c6('0x6f')](this,_0x34b1b8['pause_id']);var _0x113ff1=this[_0x41c6('0x4f')]['sync'](this,_0x34b1b8[_0x41c6('0x156')],_0x33be33);if(_0x113ff1){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x41c6('0x3c')],_0x34b1b8['findBy']));this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x157'),this['channel']['callerid'],_0x34b1b8['findBy']));return{'code':0xc8,'result':_0x41c6('0x158')};}else{logger['info'](util['format'](_0x41c6('0x159'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x34b1b8['findBy']));this['channel']['noop'](util[_0x41c6('0x54')](_0x41c6('0x157'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x34b1b8['findBy']));return{'code':0xc8,'result':_0x41c6('0x15a')};}};AGIVertices[_0x41c6('0x16')][_0x41c6('0x167')]=function(_0xea9cbf){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x168'),_0xea9cbf[_0x41c6('0x38')]));if(!this['isConfigured'](_0xea9cbf[_0x41c6('0x10b')])){return this['channel'][_0x41c6('0x32')](_0xea9cbf,_0x41c6('0x10c'));}var _0xa8a12a=this['getSound']['sync'](this,_0xea9cbf[_0x41c6('0x10b')]);if(!_0xa8a12a){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0xea9cbf,'no\x20file\x20audio\x20found');}var _0x1c76bf=this[_0x41c6('0x3a')][_0x41c6('0x59')]('PLAYBACK',[_0xa8a12a,_0xea9cbf['opts']]);if(_0x1c76bf[_0x41c6('0xa6')]===-0x1){return _0x1c76bf;}return this[_0x41c6('0x3a')]['noop'](util['format'](_0x41c6('0xc3'),'PLAYBACK',_0xa8a12a));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x169')]=function(_0x3ef339){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x16a'),_0x3ef339['label']));if(!this['isConfigured'](_0x3ef339[_0x41c6('0x16b')])){return this['channel'][_0x41c6('0x32')](_0x3ef339,_0x41c6('0x16c'));}var _0x65a24b='';var _0x507be4=parseInt(_0x3ef339[_0x41c6('0x16b')],0xa);if(isNaN(_0x507be4)){_0x65a24b=_0x3ef339[_0x41c6('0x16b')];}else{_0x65a24b=this[_0x41c6('0x17')][_0x41c6('0x6f')](this,_0x3ef339['queue_id']);if(!_0x65a24b){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x3ef339,_0x41c6('0x16d'));}}var _0x3e29f8='';if(this['isConfigured'](_0x3ef339[_0x41c6('0x10b')])){var _0x527c00=this[_0x41c6('0x1f')][_0x41c6('0x6f')](this,_0x3ef339[_0x41c6('0x10b')]);if(_0x527c00){_0x3e29f8=_0x527c00;}}this['createSquareDetailsReport']['sync'](this,_0x3ef339,_0x65a24b);if(_0x3ef339[_0x41c6('0xe3')][_0x41c6('0x16e')]('x')<0x0){_0x3ef339[_0x41c6('0xe3')]+='x';}if(_0x3ef339['opts'][_0x41c6('0x16e')]('X')<0x0){_0x3ef339[_0x41c6('0xe3')]+='X';}this[_0x41c6('0x3a')][_0x41c6('0xa0')](_0x41c6('0x16f'),_0x65a24b?_0x65a24b[_0x41c6('0x170')]():'');var _0x17a96e=this['channel']['exec']('QUEUE',[_0x65a24b,_0x3ef339['opts'],_0x3ef339[_0x41c6('0x72')],_0x3e29f8,_0x3ef339[_0x41c6('0x65')],_0x3ef339[_0x41c6('0x7')],_0x3ef339['macro'],_0x3ef339['gosub'],'',_0x3ef339[_0x41c6('0x171')]]);if(_0x17a96e[_0x41c6('0xa6')]===-0x1){return _0x17a96e;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')]('Executed\x20command\x20%s\x20%s',_0x41c6('0x172'),_0x65a24b));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x173')]=function(_0x9d589b){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x174'),_0x9d589b[_0x41c6('0x38')]));var _0x1597e8=_0x9d589b[_0x41c6('0x175')]||'wav';var _0x1ed11b=util[_0x41c6('0x54')](_0x41c6('0x176'),this[_0x41c6('0x3a')][_0x41c6('0x37')],rs['generate'](0x5));var _0x5e5b7f=util[_0x41c6('0x54')]('%s/recordings/%s.%s',FILES_PATH,_0x1ed11b,_0x1597e8);var _0x19ccd5=util[_0x41c6('0x54')]('%s/recordings/%s',FILES_PATH,_0x1ed11b);this[_0x41c6('0x3d')]['sync'](this,_0x9d589b,_0x1ed11b,_0x5e5b7f);this[_0x41c6('0x3a')][_0x41c6('0xa0')](_0x41c6('0x177'),_0x1ed11b);logger[_0x41c6('0x2d')](_0x41c6('0x178'),_0x19ccd5,_0x1597e8,_0x9d589b['escape_digits'],_0x9d589b['timeout']);return this[_0x41c6('0x3a')][_0x41c6('0x12d')](_0x19ccd5,_0x1597e8,_0x9d589b[_0x41c6('0x179')],_0x9d589b[_0x41c6('0x65')],undefined,!![]);};AGIVertices[_0x41c6('0x16')][_0x41c6('0x17a')]=function(_0x46d03f){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x17b'),_0x46d03f[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x46d03f[_0x41c6('0x72')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x17c'));}var _0x2474c7=this[_0x41c6('0x64')][_0x41c6('0x6f')](this,_0x46d03f);logger[_0x41c6('0x2d')](util['format']('Response:',util[_0x41c6('0x17d')](_0x2474c7,{'showHidden':![],'depth':null})));if(!this[_0x41c6('0x86')](_0x46d03f[_0x41c6('0xd5')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x17e'));}var _0x1a838c=this[_0x41c6('0xa3')][_0x41c6('0x6f')](this,_0x46d03f['variable_id']);if(!_0x1a838c){return this['channel'][_0x41c6('0x32')](_0x46d03f,_0x41c6('0xd7'));}this[_0x41c6('0x3a')][_0x41c6('0xa0')](util[_0x41c6('0x54')](_0x41c6('0x17f'),_0x1a838c),_0x2474c7['statusCode']?_0x2474c7[_0x41c6('0x76')]:'200');this['channel']['setVariable'](util['format'](_0x41c6('0x180'),_0x1a838c),_0x2474c7[_0x41c6('0x77')]?_0x2474c7[_0x41c6('0x77')]:'OK');if(_0x2474c7['body']){try{this['saveRestApiResult'](_0x2474c7[_0x41c6('0x74')],_0x1a838c);}catch(_0x406177){logger[_0x41c6('0x32')](util[_0x41c6('0x54')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x1a838c));}}return this[_0x41c6('0x3a')]['noop'](util['format'](_0x41c6('0xdc'),_0x1a838c));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x181')]=function(_0x1f6d91){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x182'),_0x1f6d91[_0x41c6('0x38')]));return this[_0x41c6('0x3a')][_0x41c6('0x183')](_0x1f6d91['digits']['replace'](/\s+/g,''),_0x1f6d91['escape_digits']);};AGIVertices[_0x41c6('0x16')][_0x41c6('0x184')]=function(_0x3567f9){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x185'),_0x3567f9[_0x41c6('0x38')]));return this[_0x41c6('0x3a')]['sayNumber'](_0x3567f9['number'][_0x41c6('0xd4')](/\s+/g,''),_0x3567f9[_0x41c6('0x179')]);};AGIVertices[_0x41c6('0x16')][_0x41c6('0x186')]=function(_0x394d6e){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x187'),_0x394d6e['label']));return this['channel'][_0x41c6('0x188')](_0x394d6e['text'],_0x394d6e[_0x41c6('0x179')]);};AGIVertices[_0x41c6('0x16')]['sendMail']=function(_0x4e6b30){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x189'),_0x4e6b30[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x4e6b30[_0x41c6('0x18a')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x18b'));}var _0x7a8fa8=this[_0x41c6('0x18c')][_0x41c6('0x6f')](this,_0x4e6b30[_0x41c6('0x18a')]);if(!_0x7a8fa8||!_0x7a8fa8[_0x41c6('0x18d')]){return this['channel'][_0x41c6('0x32')](_0x4e6b30,_0x41c6('0x18e'));}var _0x2c91e5={'from':util[_0x41c6('0x54')](_0x41c6('0x18f'),_0x7a8fa8[_0x41c6('0x14')],_0x7a8fa8[_0x41c6('0x190')]||_0x7a8fa8[_0x41c6('0x18d')]['user']),'to':_0x4e6b30['to']||'','cc':_0x4e6b30['cc']||'','bcc':_0x4e6b30['bcc']||'','subject':_0x4e6b30[_0x41c6('0x191')],'html':_0x4e6b30[_0x41c6('0x5c')],'text':_0x4e6b30[_0x41c6('0x5c')]};var _0x1f1a36={'tls':{'rejectUnauthorized':![]}};if(_0x7a8fa8[_0x41c6('0x18d')][_0x41c6('0x192')]){_0x1f1a36[_0x41c6('0x192')]=_0x7a8fa8[_0x41c6('0x18d')][_0x41c6('0x192')];}else{_0x1f1a36['host']=_0x7a8fa8[_0x41c6('0x18d')][_0x41c6('0x193')];_0x1f1a36['port']=_0x7a8fa8[_0x41c6('0x18d')][_0x41c6('0x194')];_0x1f1a36['secure']=_0x7a8fa8[_0x41c6('0x18d')][_0x41c6('0x195')];}if(_0x7a8fa8[_0x41c6('0x18d')][_0x41c6('0x196')]){_0x1f1a36[_0x41c6('0x197')]={'user':_0x7a8fa8['Smtp'][_0x41c6('0x198')],'pass':_0x7a8fa8[_0x41c6('0x18d')]['pass']};}if(this['isConfigured'](_0x4e6b30[_0x41c6('0x199')])){}logger[_0x41c6('0xdd')](_0x41c6('0x19a'),JSON['stringify'](_0x2c91e5));this[_0x41c6('0x36')]['sync'](this,_0x4e6b30,_0x4e6b30[_0x41c6('0x18a')]);this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x7a8fa8[_0x41c6('0x14')]));this['sendMailMessage']['sync'](this,_0x1f1a36,_0x2c91e5);return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x19b'));};AGIVertices['prototype'][_0x41c6('0x19c')]=function(_0x2f5e77){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x19d'),_0x2f5e77[_0x41c6('0x38')]));return this['channel'][_0x41c6('0xac')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x41c6('0x16')][_0x41c6('0x19e')]=function(_0x54627b){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x19f'),_0x54627b[_0x41c6('0x38')]));if(!this['isConfigured'](_0x54627b['sms_account_id'])){return this[_0x41c6('0x3a')]['noop'](_0x41c6('0x1a0'));}var _0x5e23c2=this[_0x41c6('0x1a1')][_0x41c6('0x6f')](this,_0x54627b[_0x41c6('0x1a2')]);if(!_0x5e23c2){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x54627b,'no\x20sms\x20account\x20found');}var _0x13184a={'body':_0x54627b[_0x41c6('0x1a3')],'phone':_0x54627b['to']||'','SmsAccountId':_0x5e23c2['id']};logger['debug'](_0x41c6('0x1a4'),JSON[_0x41c6('0x73')](_0x13184a));this['createSquareDetailsReport'][_0x41c6('0x6f')](this,_0x54627b,_0x54627b[_0x41c6('0x1a2')]);this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x1a5'),_0x5e23c2['name']));this['createSmsMessage'][_0x41c6('0x6f')](this,_0x13184a);return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x1a6'));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1a7')]=function(_0x2742bf){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x1a8'),_0x2742bf[_0x41c6('0x38')]));if(!this['isConfigured'](_0x2742bf[_0x41c6('0xd5')])){return this['channel']['error'](_0x2742bf,_0x41c6('0x1a9'));}var _0xdbe1a0=this['getVariable']['sync'](this,_0x2742bf[_0x41c6('0xd5')]);if(!_0xdbe1a0){return this[_0x41c6('0x3a')]['error'](_0x2742bf,_0x41c6('0xd7'));}return this[_0x41c6('0x3a')][_0x41c6('0xa0')](_0xdbe1a0,_0x2742bf[_0x41c6('0x1aa')]);};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1ab')]=function(_0x3ff8cf){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x1ac'),_0x3ff8cf[_0x41c6('0x38')]));this['channel'][_0x41c6('0xac')](_0x41c6('0x1ad'));if(_0x3ff8cf[_0x41c6('0xb9')]==='yes'){this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0x1ae'));return this[_0x41c6('0x3a')][_0x41c6('0xb9')]();}return this[_0x41c6('0x3a')][_0x41c6('0xac')]('Skipped\x20Answer');};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1af')]=function(_0x5cf6c4){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x1b0'),_0x5cf6c4[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x5cf6c4[_0x41c6('0x1b1')])){return this['channel'][_0x41c6('0x32')](_0x5cf6c4,_0x41c6('0x1b2'));}var _0x2a3dce=this[_0x41c6('0x1b3')][_0x41c6('0x6f')](this,_0x5cf6c4[_0x41c6('0x1b1')]);if(!this[_0x41c6('0x86')](_0x2a3dce)){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x5cf6c4,util['format'](_0x41c6('0x1b4'),_0x5cf6c4[_0x41c6('0x1b1')]));}if(_0x2a3dce===this[_0x41c6('0x3a')][_0x41c6('0x3b')]){return this['channel'][_0x41c6('0x32')](_0x5cf6c4,_0x41c6('0x1b5'));}this[_0x41c6('0x36')]['sync'](this,_0x5cf6c4,_0x2a3dce);var _0x8d04cd=this['channel'][_0x41c6('0x59')](_0x41c6('0x1b6'),util[_0x41c6('0x54')](_0x41c6('0x1b7'),config['agi']['host']||_0x41c6('0x1b8'),_0x2a3dce,this['channel'][_0x41c6('0x3b')]));if(_0x8d04cd[_0x41c6('0xa6')]===-0x1){return _0x8d04cd;}return this['channel'][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xc3'),'AGI',_0x2a3dce));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1b9')]=function(_0x5542d9){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5542d9[_0x41c6('0x38')]));var _0x1cd7f9=this['shellCommand'][_0x41c6('0x6f')](this,_0x5542d9[_0x41c6('0xb8')]);this[_0x41c6('0x36')]['sync'](this,_0x5542d9,_0x5542d9[_0x41c6('0xb8')]);if(this[_0x41c6('0x86')](_0x5542d9['variable_id'])){var _0x424740=this[_0x41c6('0xa3')]['sync'](this,_0x5542d9[_0x41c6('0xd5')]);if(_0x424740){this[_0x41c6('0x3a')]['setVariable'](_0x424740,_0x1cd7f9);return this[_0x41c6('0x3a')]['noop'](util['format'](_0x41c6('0x1ba'),_0x5542d9[_0x41c6('0xb8')],_0x424740));}}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x1bb'),_0x5542d9['command']));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1bc')]=function(_0x3e8166){logger[_0x41c6('0x2d')](util['format'](_0x41c6('0x1bd'),_0x3e8166[_0x41c6('0x38')]));_0x3e8166[_0x41c6('0x5c')]=_0x3e8166[_0x41c6('0x5c')][_0x41c6('0xd4')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x41c6('0x86')](_0x3e8166[_0x41c6('0x1be')])){return this['channel'][_0x41c6('0xac')](_0x41c6('0x1bf'));}if(!this['isConfigured'](_0x3e8166[_0x41c6('0x5c')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xaa'));}this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x1c0'),_0x3e8166[_0x41c6('0x5c')]));var _0x122630=this['googleCloudTTS']['sync'](this,_0x3e8166);if(_0x122630){this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0x1c1'),_0x122630));var _0x4f729a=this[_0x41c6('0x3a')]['streamFile'](_0x122630);try{fs['unlink'](_0x122630+_0x41c6('0x100'));}catch(_0xd2c3ca){logger[_0x41c6('0x32')](_0xd2c3ca);}return _0x4f729a;}return this['channel'][_0x41c6('0x32')](_0x3e8166,_0x41c6('0x1c2'));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1c3')]=function(_0x3bd491){logger['info'](util['format'](_0x41c6('0x1c4'),_0x3bd491[_0x41c6('0x38')]));_0x3bd491[_0x41c6('0x5c')]=_0x3bd491[_0x41c6('0x5c')][_0x41c6('0xd4')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x41c6('0x86')](_0x3bd491[_0x41c6('0x5c')])){return this[_0x41c6('0x3a')][_0x41c6('0xac')](_0x41c6('0xaa'));}this['channel']['noop'](util[_0x41c6('0x54')](_0x41c6('0x1c5'),_0x3bd491[_0x41c6('0x5c')]));var _0x17d24f=this[_0x41c6('0x62')][_0x41c6('0x6f')](this,_0x3bd491);if(_0x17d24f){this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x1c6'),_0x17d24f));var _0x5d09ff=this[_0x41c6('0x3a')][_0x41c6('0x151')](_0x17d24f);try{fs[_0x41c6('0xff')](_0x17d24f+_0x41c6('0x100'));}catch(_0x1fa4b3){logger[_0x41c6('0x32')](_0x1fa4b3);}return _0x5d09ff;}return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x3bd491,_0x41c6('0x1c7'));};AGIVertices[_0x41c6('0x16')]['unpause']=function(_0x43a812){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x1c8'),_0x43a812[_0x41c6('0x38')]));if(!this[_0x41c6('0x86')](_0x43a812['findBy'])){return this['channel'][_0x41c6('0x32')](_0x43a812,_0x41c6('0x154'));}logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x155'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x43a812[_0x41c6('0x156')]));var _0x848409=this[_0x41c6('0x50')][_0x41c6('0x6f')](this,_0x43a812['findBy']);if(_0x848409){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')](_0x41c6('0x157'),this[_0x41c6('0x3a')][_0x41c6('0x3c')],_0x43a812[_0x41c6('0x156')]));this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x41c6('0x3c')],_0x43a812[_0x41c6('0x156')]));return{'code':0xc8,'result':_0x41c6('0x158')};}else{logger['info'](util[_0x41c6('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x41c6('0x3c')],_0x43a812[_0x41c6('0x156')]));this[_0x41c6('0x3a')]['noop'](util[_0x41c6('0x54')](_0x41c6('0x159'),this[_0x41c6('0x3a')]['callerid'],_0x43a812[_0x41c6('0x156')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x41c6('0x16')]['voicemail']=function(_0x3b859f){logger['info'](util[_0x41c6('0x54')](_0x41c6('0x1c9'),_0x3b859f['label']));var _0x442514=this[_0x41c6('0x3a')][_0x41c6('0x59')](_0x41c6('0x1ca'),[_0x3b859f['mailbox'],_0x3b859f[_0x41c6('0x79')]]);if(_0x442514[_0x41c6('0xa6')]===-0x1){return _0x442514;}return this[_0x41c6('0x3a')][_0x41c6('0xac')](util[_0x41c6('0x54')](_0x41c6('0xc3'),_0x41c6('0x1ca'),_0x3b859f['mailbox']));};AGIVertices[_0x41c6('0x16')][_0x41c6('0x1cb')]=function(_0x44a7c0){logger[_0x41c6('0x2d')](util[_0x41c6('0x54')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x44a7c0[_0x41c6('0x38')]));if(!this['isConfigured'](_0x44a7c0[_0x41c6('0xd5')])){return this[_0x41c6('0x3a')][_0x41c6('0x32')](_0x44a7c0,_0x41c6('0x1a9'));}var _0x271c96=this[_0x41c6('0xa3')][_0x41c6('0x6f')](this,_0x44a7c0[_0x41c6('0xd5')]);if(!_0x271c96){return this['channel']['error'](_0x44a7c0,_0x41c6('0xd7'));}var _0xf3ed8e=this[_0x41c6('0x3a')][_0x41c6('0xa3')](_0x271c96);return{'code':0xc8,'result':_0xf3ed8e[_0x41c6('0xa4')]?_0xf3ed8e[_0x41c6('0xa4')]:'-'};};String[_0x41c6('0x16')]['replaceAll']=function(_0x3d75fe,_0x481849){return this[_0x41c6('0xa1')](_0x3d75fe)[_0x41c6('0x1cc')](_0x481849);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0x93c6=['format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','random','lastName','isNil','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','method','timeout','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','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','appid','appsecret','uri','clone','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','replaceObjectAllVariables','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','lumenvoxasr','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','dialogflowV2_language','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','toString','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','tildeASR','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','math','Enter\x20in\x20MATH\x20(%s)\x20block','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','email','bcc','service','host','port','secure','authentication','pass','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','no\x20variable\x20selected','join','exports','util','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','interval','map'];(function(_0x187924,_0x17e8e1){var _0x434cff=function(_0xf187eb){while(--_0xf187eb){_0x187924['push'](_0x187924['shift']());}};_0x434cff(++_0x17e8e1);}(_0x93c6,0x1a0));var _0x693c=function(_0x493f56,_0x22b249){_0x493f56=_0x493f56-0x0;var _0x4a3cce=_0x93c6[_0x493f56];return _0x4a3cce;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x693c('0x0'));var _=require('lodash');var sh=require(_0x693c('0x1'));var odbc=require(_0x693c('0x2'))();var rs=require(_0x693c('0x3'));var moment=require(_0x693c('0x4'));var Mustache=require(_0x693c('0x5'));var rp=require('request-promise');var logger=require(_0x693c('0x6'))(_0x693c('0x7'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x693c('0x8');var recursiveMapAttributes=[_0x693c('0x9'),_0x693c('0xa')];var verticesWithRetry=[_0x693c('0xb'),_0x693c('0xc'),'getsecretdigits'];var AGIVertices=function(_0x28e865,_0x9acdc6,_0xf8ab33){this[_0x693c('0xd')]=_0x28e865;this[_0x693c('0xe')]=_0x9acdc6;this[_0x693c('0xf')]=_0xf8ab33;};AGIVertices[_0x693c('0x10')][_0x693c('0x11')]=function(_0x58a724,_0x57e97e){this['rpc'][_0x693c('0x12')](_0x58a724)[_0x693c('0x13')](function(_0x33c460){_0x57e97e(null,_0x33c460?_0x33c460[_0x693c('0x14')]:![]);})[_0x693c('0x15')](function(_0x55c197){_0x57e97e(_0x55c197);});};AGIVertices[_0x693c('0x10')][_0x693c('0x16')]=function(_0x15fc35,_0x2d398f){this['rpc'][_0x693c('0x17')](_0x15fc35)[_0x693c('0x13')](function(_0x4a4d73){_0x2d398f(null,_0x4a4d73?_0x4a4d73[_0x693c('0x14')]:![]);})[_0x693c('0x15')](function(_0x31208f){_0x2d398f(_0x31208f);});};AGIVertices[_0x693c('0x10')][_0x693c('0x18')]=function(_0x2aa7f9,_0x49fa36){this[_0x693c('0xe')]['getSquareProjectById'](_0x2aa7f9)[_0x693c('0x13')](function(_0xa05557){_0x49fa36(null,_0xa05557?_0xa05557[_0x693c('0x14')]:![]);})['catch'](function(_0x46addc){_0x49fa36(_0x46addc);});};AGIVertices[_0x693c('0x10')][_0x693c('0x19')]=function(_0x2ff7e5,_0x63532c){this['rpc'][_0x693c('0x1a')](_0x2ff7e5)[_0x693c('0x13')](function(_0x341f6a){_0x63532c(null,_0x341f6a?_0x341f6a[_0x693c('0x1b')]:![]);})[_0x693c('0x15')](function(_0x52adf0){_0x63532c(_0x52adf0);});};AGIVertices[_0x693c('0x10')][_0x693c('0x1c')]=function(_0x170cca,_0x4afb0a){this[_0x693c('0xe')]['getUserById'](_0x170cca)[_0x693c('0x13')](function(_0x53458d){_0x4afb0a(null,_0x53458d?_0x53458d[_0x693c('0x14')]:![]);})['catch'](function(_0x3b0b9f){_0x4afb0a(_0x3b0b9f);});};AGIVertices[_0x693c('0x10')]['getTrunk']=function(_0x1d8b4e,_0x56782c){this[_0x693c('0xe')][_0x693c('0x1d')](_0x1d8b4e)[_0x693c('0x13')](function(_0x32889a){_0x56782c(null,_0x32889a?_0x32889a['name']:![]);})['catch'](function(_0x2a26c7){_0x56782c(_0x2a26c7);});};AGIVertices['prototype'][_0x693c('0x1e')]=function(_0x200cd9,_0x245ae7){var _0x364e78=this;this[_0x693c('0xe')][_0x693c('0x1f')](_0x200cd9)[_0x693c('0x13')](function(_0x155c0f){_0x245ae7(null,_0x155c0f?_0x364e78[_0x693c('0x20')](_0x155c0f[_0x693c('0x21')]):![]);})[_0x693c('0x15')](function(_0x181875){_0x245ae7(_0x181875);});};AGIVertices[_0x693c('0x10')]['getMailAccount']=function(_0x49ae62,_0x26febd){this[_0x693c('0xe')][_0x693c('0x22')](_0x49ae62)[_0x693c('0x13')](function(_0x21cdf7){_0x26febd(null,_0x21cdf7?_0x21cdf7:![]);})[_0x693c('0x15')](function(_0x3ad71f){_0x26febd(_0x3ad71f);});};AGIVertices[_0x693c('0x10')][_0x693c('0x23')]=function(_0x15610e,_0x276e12,_0x1a9e30){this['mailRpc'][_0x693c('0x23')](_0x15610e,_0x276e12)[_0x693c('0x13')](function(){_0x1a9e30(null);})[_0x693c('0x15')](function(_0x28e2b4){_0x1a9e30(_0x28e2b4);});};AGIVertices['prototype']['getIntervals']=function(_0x4e1347,_0x5b57ed){this[_0x693c('0xe')]['getIntervalById'](_0x4e1347)['then'](function(_0x4db20c){if(_0x4db20c){if(_0x4db20c['IntervalId']){_0x5b57ed(null,[_0x4db20c[_0x693c('0x24')]]);}else{_0x5b57ed(null,_[_0x693c('0x25')](_0x4db20c['Intervals'],_0x693c('0x24')));}}else{_0x5b57ed(null,![]);}})[_0x693c('0x15')](function(_0x16170a){_0x5b57ed(_0x16170a);});};AGIVertices[_0x693c('0x10')][_0x693c('0x20')]=function(_0x2d4adc){return util[_0x693c('0x26')](_0x693c('0x27'),FILES_PATH,_0x2d4adc);};AGIVertices[_0x693c('0x10')][_0x693c('0x28')]=function(_0x4c2715,_0x282361,_0x106b6b){odbc[_0x693c('0x29')](_0x4c2715,function(_0x58b294){if(_0x58b294){logger[_0x693c('0x2a')](_0x693c('0x2b'),_0x58b294);_0x106b6b(_0x58b294);}else{logger[_0x693c('0x2c')](_0x693c('0x2d'));odbc['query'](_0x282361,function(_0x1adcac,_0x119dc2){if(_0x1adcac){logger['info'](_0x693c('0x2e'),_0x282361);_0x106b6b(_0x1adcac);}else{logger[_0x693c('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x282361);odbc[_0x693c('0x2f')](function(_0x10c515){if(_0x10c515){logger[_0x693c('0x2a')](_0x693c('0x30'),_0x10c515);}_0x106b6b(null,_0x119dc2);});}});}});};AGIVertices[_0x693c('0x10')][_0x693c('0x31')]=function(_0x4f3e4c,_0x230e9a){this[_0x693c('0xe')][_0x693c('0x32')](_0x4f3e4c)[_0x693c('0x13')](function(_0x1f7265){_0x230e9a(null,_0x1f7265?_0x1f7265:![]);})[_0x693c('0x15')](function(_0x2e09ed){_0x230e9a(_0x2e09ed);});};AGIVertices[_0x693c('0x10')][_0x693c('0x33')]=function(_0x5130bd,_0x54d8d2){this[_0x693c('0xe')][_0x693c('0x33')](_0x5130bd)[_0x693c('0x13')](function(_0x1b8751){_0x54d8d2(null,_0x1b8751);})['catch'](function(_0x1e1b99){_0x54d8d2(_0x1e1b99);});};AGIVertices[_0x693c('0x10')][_0x693c('0x34')]=function(_0x4f2087,_0x5b84fc,_0x5d6c67){this[_0x693c('0xe')][_0x693c('0x34')]({'uniqueid':this[_0x693c('0xd')]['uniqueid'],'node':_0x4f2087['label'],'application':_0x4f2087[_0x693c('0x35')],'data':_0x5b84fc||null,'project_name':this[_0x693c('0xd')]['arg_1'],'callerid':this[_0x693c('0xd')][_0x693c('0x36')]})[_0x693c('0x13')](function(_0x438190){if(_0x5d6c67){_0x5d6c67(null,_0x438190);}})[_0x693c('0x15')](function(_0x11823b){if(_0x5d6c67){_0x5d6c67(_0x11823b);}});};AGIVertices[_0x693c('0x10')]['createSquareRecording']=function(_0x562f13,_0x43fb0c,_0x36ee58,_0x51e839){this[_0x693c('0xe')][_0x693c('0x37')]({'uniqueid':this[_0x693c('0xd')][_0x693c('0x38')],'callerid':this[_0x693c('0xd')][_0x693c('0x36')],'calleridname':this['channel'][_0x693c('0x39')],'context':this['channel'][_0x693c('0x3a')],'extension':this[_0x693c('0xd')]['extension'],'priority':this[_0x693c('0xd')][_0x693c('0x3b')],'accountcode':this['channel'][_0x693c('0x3c')],'dnid':this[_0x693c('0xd')][_0x693c('0x3d')],'projectName':this['channel'][_0x693c('0x3e')],'saveName':_0x43fb0c,'filename':_0x562f13[_0x693c('0x3f')]||_0x43fb0c,'savePath':_0x36ee58})[_0x693c('0x13')](function(_0x10f9c7){_0x51e839(null,_0x10f9c7);})[_0x693c('0x15')](function(_0x5adb4d){_0x51e839(_0x5adb4d);});};AGIVertices[_0x693c('0x10')]['createSquareMessage']=function(_0x3b7d93,_0x57b4a7,_0x53f39c,_0x2f168c,_0x3edb8e){this[_0x693c('0xe')][_0x693c('0x40')]({'uniqueid':this[_0x693c('0xd')][_0x693c('0x38')],'body':_0x3b7d93,'direction':_0x57b4a7,'providerName':_0x53f39c,'providerResponse':_0x2f168c})[_0x693c('0x13')](function(_0x389814){if(_0x3edb8e){_0x3edb8e(null,_0x389814);}})[_0x693c('0x15')](function(_0xf1d4e9){if(_0x3edb8e){_0x3edb8e(_0xf1d4e9);}});};AGIVertices[_0x693c('0x10')]['createCmContact']=function(_0x53b346,_0x14908f){this[_0x693c('0xe')][_0x693c('0x41')]({'firstName':_[_0x693c('0x42')](_0x53b346[_0x693c('0x14')])||_['isNil'](_0x53b346[_0x693c('0x14')])?'callback_'+Math[_0x693c('0x43')]():_0x53b346['name'],'lastName':_['isEmpty'](_0x53b346[_0x693c('0x44')])||_[_0x693c('0x45')](_0x53b346[_0x693c('0x44')])?null:_0x53b346[_0x693c('0x44')],'phone':_0x53b346[_0x693c('0x46')],'ListId':_0x53b346[_0x693c('0x47')],'scheduledat':_0x53b346[_0x693c('0x48')],'callbackUniqueid':this[_0x693c('0xd')]['uniqueid'],'tags':'callback','description':_0x693c('0x49')+_0x53b346[_0x693c('0x48')]['toString'](),'priority':_0x53b346[_0x693c('0x4a')]})[_0x693c('0x13')](function(_0x2ac5f7){_0x14908f(null,_0x2ac5f7);})['catch'](function(_0x4291d6){_0x14908f(_0x4291d6);});};AGIVertices['prototype']['getPause']=function(_0x3176de,_0x5102ed){this[_0x693c('0xe')]['getPauseById'](_0x3176de)[_0x693c('0x13')](function(_0x75f4cb){_0x5102ed(null,_0x75f4cb?_0x75f4cb[_0x693c('0x14')]:![]);})[_0x693c('0x15')](function(_0x49e4b1){_0x5102ed(_0x49e4b1);});};AGIVertices['prototype'][_0x693c('0x4b')]=function(_0x3c6be2,_0x505707,_0x59517f){var _0x4afd7a={'role':_0x693c('0x4c')};_0x4afd7a[_0x3c6be2]=this[_0x693c('0xd')]['callerid'];this[_0x693c('0xe')]['agentPause'](_0x4afd7a,_0x505707,this[_0x693c('0xd')][_0x693c('0x38')])[_0x693c('0x13')](function(_0x2bfcfd){_0x59517f(null,_[_0x693c('0x45')](_0x2bfcfd)?![]:!![]);})['catch'](function(_0x1240c8){logger['error'](_0x1240c8);_0x59517f(null,![]);});};AGIVertices[_0x693c('0x10')][_0x693c('0x4d')]=function(_0x1b7e54,_0x389cc8){var _0x7a6de3={'role':_0x693c('0x4c')};_0x7a6de3[_0x1b7e54]=this[_0x693c('0xd')]['callerid'];this[_0x693c('0xe')][_0x693c('0x4d')](_0x7a6de3)[_0x693c('0x13')](function(_0x3782e2){_0x389cc8(null,_['isNil'](_0x3782e2)?![]:!![]);})[_0x693c('0x15')](function(_0x4b3b19){logger[_0x693c('0x2a')](_0x4b3b19);_0x389cc8(null,![]);});};AGIVertices[_0x693c('0x10')][_0x693c('0x4e')]=function(_0xe591d3,_0x52d208){var _0x14764f={'role':_0x693c('0x4c')};_0x14764f[_0xe591d3]=this['channel'][_0x693c('0x36')];this[_0x693c('0xe')][_0x693c('0x4e')](_0x14764f)['then'](function(_0x1162e9){_0x52d208(null,_['isNil'](_0x1162e9)?![]:!![]);})['catch'](function(_0x28b7a8){logger[_0x693c('0x2a')](_0x28b7a8);_0x52d208(null,![]);});};AGIVertices[_0x693c('0x10')][_0x693c('0x4f')]=function(_0x57b347,_0x3c3d1c){var _0x38489d={'role':_0x693c('0x4c')};_0x38489d[_0x57b347]=this[_0x693c('0xd')]['callerid'];var _0x2e2877=_0x57b347!=_0x693c('0x50')?util[_0x693c('0x26')](_0x693c('0x51'),_0x693c('0x52'),this[_0x693c('0xd')][_0x693c('0x36')]):undefined;this[_0x693c('0xe')][_0x693c('0x4f')](_0x38489d,_0x2e2877)['then'](function(_0x14dccd){_0x3c3d1c(null,_[_0x693c('0x45')](_0x14dccd)?![]:!![]);})[_0x693c('0x15')](function(_0x439ceb){logger[_0x693c('0x2a')](_0x439ceb);_0x3c3d1c(null,![]);});};AGIVertices[_0x693c('0x10')][_0x693c('0x53')]=function(_0x4e4b70,_0x3329e9){sh[_0x693c('0x54')](_[_0x693c('0x55')](_0x4e4b70),function(_0x2baea7,_0x265390){var _0x54eaa2=_0x265390[_0x693c('0x56')](/(\r\n|\n|\r)/gm,'');_0x3329e9(null,_0x54eaa2);});};AGIVertices[_0x693c('0x10')][_0x693c('0x57')]=function(_0x3c13f1,_0x38f409){scripts[_0x693c('0x57')](_0x3c13f1[_0x693c('0x58')],_0x3c13f1[_0x693c('0x59')]||'text',_0x3c13f1[_0x693c('0x5a')],_0x3c13f1['languageCode']||_0x693c('0x5b'),_0x3c13f1[_0x693c('0x5c')]||_0x693c('0x5d'),_0x3c13f1[_0x693c('0x5e')]||_0x693c('0x5f'))[_0x693c('0x13')](function(_0x1b913e){_0x38f409(null,_0x1b913e);})[_0x693c('0x15')](function(_0x323065){_0x38f409(_0x323065);});};AGIVertices[_0x693c('0x10')][_0x693c('0x60')]=function(_0x147dd8,_0x585d91){scripts[_0x693c('0x60')](_0x147dd8[_0x693c('0x5a')],_0x147dd8['google_tts_language']||'en',0x1)[_0x693c('0x13')](function(_0x2eade0){_0x585d91(null,_0x2eade0);})[_0x693c('0x15')](function(_0xfb1445){_0x585d91(_0xfb1445);});};AGIVertices[_0x693c('0x10')][_0x693c('0x61')]=function(_0x4c4d3f,_0x400a66){var _0x563035={'uri':_0x4c4d3f['url'],'method':_0x4c4d3f[_0x693c('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4c4d3f[_0x693c('0x63')])==='number'&&parseInt(_0x4c4d3f['timeout'])>=0x1?parseInt(_0x4c4d3f[_0x693c('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x693c('0x64')]([_0x693c('0x65'),_0x693c('0x66')],_0x563035[_0x693c('0x62')][_0x693c('0x67')]())){try{_0x563035[_0x693c('0x68')]=_0x4c4d3f[_0x693c('0xa')]?JSON[_0x693c('0x69')](_0x4c4d3f[_0x693c('0xa')]):{};}catch(_0x2d271d){logger[_0x693c('0x2a')](_0x693c('0x6a'),_0x2d271d);}}try{_0x563035[_0x693c('0x6b')]=_0x4c4d3f[_0x693c('0x9')]?JSON[_0x693c('0x69')](_0x4c4d3f['rawHeaders']):{};}catch(_0x596171){logger[_0x693c('0x2a')](_0x693c('0x6c'),_0x596171);}if(_0x4c4d3f['computedVariables']){try{var _0x556639=require(_0x4c4d3f[_0x693c('0x6d')])[_0x693c('0x6e')](this,_0x563035);_0x563035['uri']=Mustache[_0x693c('0x6f')](_0x4c4d3f['url'],_0x556639,{},['$$','$$']);if(_0x563035[_0x693c('0x6b')]){_0x563035['headers']=JSON[_0x693c('0x69')](Mustache[_0x693c('0x6f')](JSON[_0x693c('0x70')](_0x563035['headers']),_0x556639,{},['$$','$$']));}if(_0x563035['body']){_0x563035[_0x693c('0x68')]=JSON[_0x693c('0x69')](Mustache[_0x693c('0x6f')](JSON[_0x693c('0x70')](_0x563035[_0x693c('0x68')]),_0x556639,{},['$$','$$']));}}catch(_0x56ebe1){logger[_0x693c('0x2a')](_0x693c('0x71'),_0x56ebe1);}}rp(_0x563035)['then'](function(_0x2cbe8d){var _0x193d5d={'statusCode':_0x2cbe8d[_0x693c('0x72')]||0xc8,'statusMessage':_0x2cbe8d[_0x693c('0x73')]||'OK','headers':_0x2cbe8d['headers']||{},'body':_0x2cbe8d[_0x693c('0x68')]||{}};_0x400a66(null,_0x193d5d);})['catch'](function(_0x251f22){var _0x42659b={'statusCode':_0x251f22[_0x693c('0x72')]||0x1f4,'statusMessage':_0x251f22[_0x693c('0x74')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x251f22['options'][_0x693c('0x6b')]||{},'body':_0x251f22[_0x693c('0x75')][_0x693c('0x68')]||{}};_0x400a66(null,_0x42659b);});};AGIVertices[_0x693c('0x10')][_0x693c('0x76')]=function(_0xcde0b5,_0x25c22e){scripts[_0x693c('0x76')](this['channel'][_0x693c('0x38')],_0xcde0b5[_0x693c('0x77')],_0xcde0b5[_0x693c('0x5a')],_0xcde0b5[_0x693c('0x78')]||'en')['then'](function(_0x2653ea){_0x25c22e(null,_0x2653ea);})[_0x693c('0x15')](function(_0x10b4dc){_0x25c22e(_0x10b4dc);});};AGIVertices[_0x693c('0x10')][_0x693c('0x79')]=function(_0x2deea4,_0x371daf){scripts[_0x693c('0x79')](this[_0x693c('0xd')][_0x693c('0x38')],_0x2deea4[_0x693c('0x7a')],_0x2deea4['client_email'],_0x2deea4['private_key'],_0x2deea4[_0x693c('0x5a')],_0x2deea4['dialogflowV2_language']||'en')[_0x693c('0x13')](function(_0x400279){_0x371daf(null,_0x400279);})['catch'](function(_0x4e02de){_0x371daf(_0x4e02de);});};AGIVertices[_0x693c('0x10')][_0x693c('0x7b')]=function(_0x483cee,_0x5c1961){scripts['sestekNDA'](this[_0x693c('0xd')],_0x483cee)[_0x693c('0x13')](function(_0x34d8ca){_0x5c1961(null,_0x34d8ca);})['catch'](function(_0x3515da){_0x5c1961(_0x3515da);});};AGIVertices[_0x693c('0x10')][_0x693c('0x7c')]=function(_0x460ab9,_0x955874){scripts[_0x693c('0x7c')](_0x460ab9[_0x693c('0x77')],_0x460ab9[_0x693c('0x5a')],_0x460ab9['ispeech_tts_language']||_0x693c('0x5b'),_0x460ab9[_0x693c('0x7d')])['then'](function(_0x19151a){_0x955874(null,_0x19151a);})[_0x693c('0x15')](function(_0x558f55){_0x955874(_0x558f55);});};AGIVertices[_0x693c('0x10')][_0x693c('0x7e')]=function(_0x498d7f,_0x3fc0e8,_0x118c66){scripts[_0x693c('0x7e')](_0x3fc0e8,_0x498d7f[_0x693c('0x77')],_0x498d7f[_0x693c('0x7f')]||'en-US',this[_0x693c('0x80')](_0x498d7f[_0x693c('0x81')])?_0x498d7f[_0x693c('0x81')]:undefined)[_0x693c('0x13')](function(_0x581d6b){_0x118c66(null,_0x581d6b);})['catch'](function(_0x32b9f6){_0x118c66(_0x32b9f6);});};AGIVertices[_0x693c('0x10')]['awsPolly']=function(_0x2342aa,_0x4274c8){scripts[_0x693c('0x82')](_0x2342aa[_0x693c('0x83')],_0x2342aa[_0x693c('0x84')],_0x2342aa[_0x693c('0x85')],_0x2342aa[_0x693c('0x86')]||_0x693c('0x87'),_0x2342aa[_0x693c('0x5a')],_0x2342aa[_0x693c('0x88')]||_0x693c('0x5a'))[_0x693c('0x13')](function(_0x4bb10f){_0x4274c8(null,_0x4bb10f);})[_0x693c('0x15')](function(_0x13e107){_0x4274c8(_0x13e107);});};AGIVertices[_0x693c('0x10')][_0x693c('0x89')]=function(_0x4eefb4,_0x2ab205){scripts[_0x693c('0x89')](this[_0x693c('0xd')][_0x693c('0x38')],_0x4eefb4[_0x693c('0x83')],_0x4eefb4[_0x693c('0x84')],_0x4eefb4[_0x693c('0x8a')],_0x4eefb4['text'],_0x4eefb4[_0x693c('0x8b')])[_0x693c('0x13')](function(_0x1a046c){_0x2ab205(null,_0x1a046c);})['catch'](function(_0x11e184){_0x2ab205(_0x11e184);});};AGIVertices[_0x693c('0x10')][_0x693c('0x8c')]=function(_0x1ca396,_0x3cf2dc,_0x4894cc){scripts[_0x693c('0x8c')](_0x3cf2dc,_0x1ca396[_0x693c('0x77')],_0x1ca396[_0x693c('0x8d')]||_0x693c('0x5b'))[_0x693c('0x13')](function(_0x177b76){_0x4894cc(null,_0x177b76);})[_0x693c('0x15')](function(_0x23dba4){_0x4894cc(_0x23dba4);});};AGIVertices['prototype']['tildeASR']=function(_0x337909,_0x30d5fd,_0xe853bd){scripts['tildeASR'](_0x30d5fd,_0x337909[_0x693c('0x8e')],_0x337909[_0x693c('0x8f')],_0x337909[_0x693c('0x90')])[_0x693c('0x13')](function(_0x4f265e){_0xe853bd(null,_0x4f265e);})['catch'](function(_0x4af3fb){_0xe853bd(_0x4af3fb);});};AGIVertices[_0x693c('0x10')]['clear']=function(_0x105c13){var _0x23b376=_['includes'](verticesWithRetry,_0x105c13[_0x693c('0x35')])?_0x105c13:_[_0x693c('0x91')](_0x105c13);for(var _0xbe34a9 in _0x23b376){if(_0x23b376[_0x693c('0x92')](_0xbe34a9)){if(_0x23b376[_0xbe34a9]&&_['isString'](_0x23b376[_0xbe34a9])){if(_['includes'](recursiveMapAttributes,_0xbe34a9)){_0x23b376[_0xbe34a9]=this['replaceObjectAllVariables'](_0x23b376[_0xbe34a9]);}else{_0x23b376[_0xbe34a9]=this[_0x693c('0x93')](_0x23b376[_0xbe34a9]);}}}}return _0x23b376;};AGIVertices[_0x693c('0x10')][_0x693c('0x94')]=function(_0x469017){for(var _0x52669b in _0x469017){if(_0x469017[_0x693c('0x92')](_0x52669b)){if(_[_0x693c('0x95')](_0x469017[_0x52669b])){this[_0x693c('0x94')](_0x469017[_0x52669b]);}else if(_['isArray'](_0x469017[_0x52669b])){for(var _0x4b49e1=0x0;_0x4b49e1<_0x469017[_0x52669b][_0x693c('0x96')];_0x4b49e1++){this['recursiveNodeIndex'](_0x469017[_0x52669b][_0x4b49e1]);}}else if(_['isString'](_0x469017[_0x52669b])){_0x469017[_0x52669b]=this['replaceAllVariables'](_0x469017[_0x52669b]);}}}};AGIVertices['prototype'][_0x693c('0x97')]=function(_0x2302de,_0x43b43e){for(var _0x3d85f6 in _0x2302de){if(_0x2302de[_0x693c('0x92')](_0x3d85f6)){if(_[_0x693c('0x95')](_0x2302de[_0x3d85f6])){if(!_['isEmpty'](_0x2302de[_0x3d85f6])){this['saveRestApiResult'](_0x2302de[_0x3d85f6],util[_0x693c('0x26')](_0x693c('0x98'),_0x43b43e,_0x3d85f6));}}else if(_[_0x693c('0x99')](_0x2302de[_0x3d85f6])){for(var _0x3ec5f4=0x0;_0x3ec5f4<_0x2302de[_0x3d85f6][_0x693c('0x96')];_0x3ec5f4++){this[_0x693c('0x97')](_0x2302de[_0x3d85f6][_0x3ec5f4],util['format'](_0x693c('0x98'),_0x43b43e,_0x3d85f6+'['+_0x3ec5f4+']'));}}else{if(!_['isNil'](_0x2302de[_0x3d85f6])){this[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0x98'),_0x43b43e,_0x3d85f6),_0x2302de[_0x3d85f6]);}}}}};AGIVertices[_0x693c('0x10')][_0x693c('0x9b')]=function(_0x347271){try{var _0x3ac6f7=JSON[_0x693c('0x69')](_0x347271);this[_0x693c('0x94')](_0x3ac6f7);return JSON[_0x693c('0x70')](_0x3ac6f7);}catch(_0x3b580e){return this[_0x693c('0x93')](_0x347271);}};AGIVertices[_0x693c('0x10')]['replaceAllVariables']=function(_0x51f591){var _0x5a8f1f=_0x51f591['split']('{');for(var _0x12fbdd=0x1;_0x12fbdd<_0x5a8f1f[_0x693c('0x96')];_0x12fbdd+=0x1){var _0x900a6f=_0x5a8f1f[_0x12fbdd][_0x693c('0x9c')]('}');if(_0x900a6f[_0x693c('0x96')]>0x1){_0x51f591=_0x51f591['replaceAll']('{'+_0x900a6f[0x0]+'}',this[_0x693c('0xd')][_0x693c('0x11')](_0x900a6f[0x0])[_0x693c('0x9d')]||_0x900a6f[0x0]);}}if(_0x5a8f1f[_0x693c('0x96')]===0x1){return _0x51f591['toString']();}return this[_0x693c('0x93')](_0x51f591);};AGIVertices[_0x693c('0x10')][_0x693c('0x9e')]=function(_0x48fd39,_0x355a6a){var _0x5c5a79=this[_0x693c('0xd')]['getVariable'](_0x48fd39);if(_0x5c5a79[_0x693c('0x9f')]===-0x1){return _0x5c5a79;}logger['info'](util[_0x693c('0x26')](_0x693c('0xa0'),_0x355a6a,_0x5c5a79[_0x693c('0x9d')]));return this[_0x693c('0xd')][_0x693c('0x9a')](_0x355a6a,_0x5c5a79[_0x693c('0x9d')]);};AGIVertices[_0x693c('0x10')]['isConfigured']=function(_0x3f030d){return _0x3f030d&&_0x3f030d!=='0'&&_0x3f030d!=='-1'&&_0x3f030d!=='';};AGIVertices[_0x693c('0x10')][_0x693c('0xa1')]=function(_0x4d6e98){this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x4d6e98,'-');_0x4d6e98[_0x693c('0xa2')]=_0x4d6e98['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x693c('0x10')][_0x693c('0xa3')]=function(_0x463f1e){logger[_0x693c('0x2c')](util['format'](_0x693c('0xa4'),_0x463f1e[_0x693c('0xa5')]));if(!this['isConfigured'](_0x463f1e[_0x693c('0x5a')])){return this[_0x693c('0xd')]['noop']('no\x20text\x20configured');}var _0x2aab3e='\x22'+_0x463f1e[_0x693c('0x5a')]+'\x22';if(this[_0x693c('0x80')](_0x463f1e[_0x693c('0x75')])){_0x2aab3e+=','+_0x463f1e[_0x693c('0x75')];}var _0x47c684=this[_0x693c('0xd')]['exec'](_0x693c('0xa6'),_0x2aab3e);if(_0x47c684[_0x693c('0x9f')]===-0x1){return _0x47c684;}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xa8'),_0x2aab3e));};AGIVertices[_0x693c('0x10')]['mrcprecog']=function(_0x3d5559){logger['info'](util[_0x693c('0x26')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3d5559[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x3d5559[_0x693c('0xa9')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xaa'));}var _0x47d0fa=_0x3d5559['grammar'];if(this[_0x693c('0x80')](_0x3d5559['options'])){_0x47d0fa+=','+_0x3d5559[_0x693c('0x75')];}var _0x33506b=this[_0x693c('0xd')]['exec'](_0x693c('0xab'),_0x47d0fa);if(_0x33506b[_0x693c('0x9f')]===-0x1){return _0x33506b;}var _0x195dd7=this['getAndSetVariable'](_0x693c('0xac'),_0x693c('0xad'));if(_0x195dd7[_0x693c('0x9f')]===-0x1){return _0x195dd7;}var _0x4d7fc1=this[_0x693c('0x9e')](_0x693c('0xae'),'MRCP_RECOG_TRANSCRIPT');if(_0x4d7fc1[_0x693c('0x9f')]===-0x1){return _0x4d7fc1;}var _0x12540f=this[_0x693c('0x9e')](_0x693c('0xaf'),_0x693c('0xb0'));if(_0x12540f[_0x693c('0x9f')]===-0x1){return _0x12540f;}return this['channel'][_0x693c('0xa7')](util['format'](_0x693c('0xb1'),_0x47d0fa));};AGIVertices[_0x693c('0x10')][_0x693c('0x7')]=function(_0x12c1ed){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xb2'),_0x12c1ed['label']));return this[_0x693c('0xd')]['agi']([_0x12c1ed[_0x693c('0xb3')],_0x12c1ed['args']]);};AGIVertices['prototype'][_0x693c('0xb4')]=function(_0x49280c){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xb5'),_0x49280c[_0x693c('0xa5')]));if(this[_0x693c('0x80')](_0x49280c[_0x693c('0x63')])){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x49280c[_0x693c('0x63')]));var _0x524887=this['channel'][_0x693c('0xb6')](_0x49280c['timeout']);if(_0x524887['result']===-0x1){return _0x524887;}}return this['channel']['answer']();};AGIVertices[_0x693c('0x10')][_0x693c('0xb7')]=function(_0x34d96b){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xb8'),_0x34d96b['label']));if(!this[_0x693c('0x80')](_0x34d96b[_0x693c('0x47')])){return this['channel'][_0x693c('0x2a')](_0x34d96b,'no\x20list\x20selected');}_0x34d96b[_0x693c('0x48')]=moment();if(this[_0x693c('0x80')](_0x34d96b[_0x693c('0xb9')])){_0x34d96b[_0x693c('0x48')]=moment()['add'](_0x34d96b[_0x693c('0xb9')],'minutes');}if(!this[_0x693c('0x80')](_0x34d96b[_0x693c('0x4a')])){_0x34d96b[_0x693c('0x4a')]=0x2;}this[_0x693c('0x41')][_0x693c('0x6e')](this,_0x34d96b);return this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xba'),_0x34d96b['phone'],_0x34d96b['list_id'],_0x34d96b['scheduledAt']));};AGIVertices['prototype'][_0x693c('0xbb')]=function(_0x11946b){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xbc'),_0x11946b[_0x693c('0xa5')]));var _0x5a877e=this[_0x693c('0xd')][_0x693c('0x54')](_0x11946b[_0x693c('0xbd')],_0x11946b[_0x693c('0x75')]);if(_0x5a877e['result']===-0x1){return _0x5a877e;}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xbe'),_0x11946b[_0x693c('0xbd')],_0x11946b[_0x693c('0x75')]));};AGIVertices[_0x693c('0x10')][_0x693c('0xbf')]=function(_0x3c390a){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xc0'),_0x3c390a[_0x693c('0xa5')]));if(!this['isConfigured'](_0x3c390a['text'])){return this['channel']['noop'](_0x693c('0xc1'));}var _0x49b52e='\x22'+_0x3c390a[_0x693c('0x5a')]+'\x22';if(this[_0x693c('0x80')](_0x3c390a['options'])){_0x49b52e+=','+_0x3c390a[_0x693c('0x75')];}var _0x2acfd4=this[_0x693c('0xd')][_0x693c('0x54')](_0x693c('0xa6'),_0x49b52e);if(_0x2acfd4['result']===-0x1){return _0x2acfd4;}return this[_0x693c('0xd')][_0x693c('0xa7')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x49b52e));};AGIVertices['prototype'][_0x693c('0xc2')]=function(_0x5630dd){logger['info'](util[_0x693c('0x26')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5630dd['label']));if(!this[_0x693c('0x80')](_0x5630dd[_0x693c('0x5a')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xc1'));}var _0x213252='\x22'+_0x5630dd[_0x693c('0x5a')]+'\x22';if(this[_0x693c('0x80')](_0x5630dd[_0x693c('0x75')])){_0x213252+=','+_0x5630dd[_0x693c('0x75')];}var _0x82bf16=this[_0x693c('0xd')]['exec'](_0x693c('0xa6'),_0x213252);if(_0x82bf16['result']===-0x1){return _0x82bf16;}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xa8'),_0x213252));};AGIVertices[_0x693c('0x10')][_0x693c('0xc3')]=function(_0x1f5ae6){logger[_0x693c('0x2c')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x1f5ae6[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x1f5ae6[_0x693c('0xa9')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x3e6049=_0x1f5ae6[_0x693c('0xa9')];if(this[_0x693c('0x80')](_0x1f5ae6[_0x693c('0x75')])){_0x3e6049+=','+_0x1f5ae6['options'];}var _0x388c48=this['channel']['exec'](_0x693c('0xab'),_0x3e6049);if(_0x388c48['result']===-0x1){return _0x388c48;}var _0x4b6850=this['getAndSetVariable'](_0x693c('0xac'),'LUMENVOX_ASR_CONFIDENCE');if(_0x4b6850[_0x693c('0x9f')]===-0x1){return _0x4b6850;}var _0x444b59=this[_0x693c('0x9e')]('RECOG_INPUT()',_0x693c('0xc4'));if(_0x444b59[_0x693c('0x9f')]===-0x1){return _0x444b59;}var _0xb78a5a=this[_0x693c('0x9e')](_0x693c('0xaf'),_0x693c('0xc5'));if(_0xb78a5a[_0x693c('0x9f')]===-0x1){return _0xb78a5a;}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xb1'),_0x3e6049));};AGIVertices[_0x693c('0x10')][_0x693c('0xc6')]=function(_0x4e9d16){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xc7'),_0x4e9d16['label']));if(!this[_0x693c('0x80')](_0x4e9d16[_0x693c('0xa9')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xaa'));}var _0x368f83=_0x4e9d16['grammar'];if(this[_0x693c('0x80')](_0x4e9d16[_0x693c('0x75')])){_0x368f83+=','+_0x4e9d16[_0x693c('0x75')];}var _0x2ac56e=this[_0x693c('0xd')][_0x693c('0x54')]('MRCPRecog',_0x368f83);if(_0x2ac56e[_0x693c('0x9f')]===-0x1){return _0x2ac56e;}var _0x239f1d=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x239f1d[_0x693c('0x9f')]===-0x1){return _0x239f1d;}var _0x1ea8e0=this[_0x693c('0x9e')]('RECOG_INPUT()',_0x693c('0xc8'));if(_0x1ea8e0[_0x693c('0x9f')]===-0x1){return _0x1ea8e0;}var _0x1142a7=this[_0x693c('0x9e')](_0x693c('0xaf'),_0x693c('0xc9'));if(_0x1142a7['result']===-0x1){return _0x1142a7;}return this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xb1'),_0x368f83));};AGIVertices[_0x693c('0x10')][_0x693c('0xca')]=function(_0x26d669){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0xcb'),_0x26d669['label']));if(!this['isConfigured'](_0x26d669[_0x693c('0xcc')])){return this['channel'][_0x693c('0x2a')](_0x26d669,_0x693c('0xcd'));}var _0x83956d=this[_0x693c('0x19')][_0x693c('0x6e')](this,_0x26d669['odbc_id']);if(!_0x83956d){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x26d669,_0x693c('0xce'));}if(!this['isConfigured'](_0x26d669[_0x693c('0xcf')])){return this['channel'][_0x693c('0x2a')](_0x26d669,_0x693c('0xd0'));}var _0x4b114e=_0x26d669['query'][_0x693c('0x56')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x693c('0xa7')](util['format'](_0x693c('0xd1'),_0x4b114e));var _0x72db8d=this[_0x693c('0x28')][_0x693c('0x6e')](this,_0x83956d,_0x4b114e);this[_0x693c('0x34')]['sync'](this,_0x26d669,_0x4b114e);if(!this['isConfigured'](_0x26d669['variable_id'])){return this['channel'][_0x693c('0xa7')](_0x693c('0xd2'));}var _0x7729cb=this[_0x693c('0x11')][_0x693c('0x6e')](this,_0x26d669[_0x693c('0xd3')]);if(!_0x7729cb){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x26d669,'no\x20variable\x20found');}var _0x2e0cf3=this;_0x72db8d[_0x693c('0xd4')](function(_0x531f87,_0x5e5b60){Object[_0x693c('0xd5')](_0x531f87)[_0x693c('0xd4')](function(_0x2281c7){_0x2e0cf3[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0xd6'),_0x7729cb,_0x5e5b60,_0x2281c7),_0x531f87[_0x2281c7]);});});this[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0xd7'),_0x7729cb),_0x72db8d[_0x693c('0x96')]);return this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xd8'),_0x7729cb));};AGIVertices[_0x693c('0x10')][_0x693c('0xd9')]=function(_0x34cc03){logger['debug'](util[_0x693c('0x26')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x34cc03['label']));if(!this[_0x693c('0x80')](_0x34cc03[_0x693c('0xda')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x34cc03,_0x693c('0xdb'));}var _0x3e843d=this['getUser']['sync'](this,_0x34cc03[_0x693c('0xda')]);if(!_0x3e843d){return this[_0x693c('0xd')]['error'](_0x34cc03,_0x693c('0xdc'));}var _0x32e030=this[_0x693c('0xd')][_0x693c('0x54')](_0x693c('0xdd'),[util['format'](_0x693c('0xde'),_0x3e843d),_0x34cc03['timeout'],_0x34cc03['opts'],_0x34cc03[_0x693c('0xdf')]]);if(_0x32e030[_0x693c('0x9f')]===-0x1){return _0x32e030;}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')]('Executed\x20command\x20%s',_0x693c('0xdd')));};AGIVertices[_0x693c('0x10')][_0x693c('0xe0')]=function(_0x314bff){logger['info'](util[_0x693c('0x26')](_0x693c('0xe1'),_0x314bff[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x314bff[_0x693c('0x77')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xe2'));}if(!this[_0x693c('0x80')](_0x314bff['text'])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xc1'));}this[_0x693c('0xd')][_0x693c('0xe3')]=!![];this[_0x693c('0x34')](_0x314bff);this['createSquareMessage'](_0x314bff[_0x693c('0x5a')],'in','','');this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')](_0x693c('0xe4'),_0x314bff[_0x693c('0x5a')]));var _0x329cab=this[_0x693c('0x76')]['sync'](this,_0x314bff);if(_0x329cab){for(var _0x487058 in _0x329cab){if(_0x329cab[_0x693c('0x92')](_0x487058)){this[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0xe5'),_0x487058[_0x693c('0x67')]()),_0x329cab[_0x487058]);}}this[_0x693c('0x40')](_0x329cab[_0x693c('0xe6')],_0x693c('0xe7'),_0x693c('0xe0'),'');return this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')](_0x693c('0xe8'),_0x329cab[_0x693c('0xe6')]));}return this[_0x693c('0xd')]['error'](_0x314bff,_0x693c('0xe9'));};AGIVertices[_0x693c('0x10')][_0x693c('0xea')]=function(_0x5af0ba){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x5af0ba['label']));if(!this['isConfigured'](_0x5af0ba[_0x693c('0x7a')])){return this['channel'][_0x693c('0xa7')]('no\x20project_id\x20configured');}if(!this[_0x693c('0x80')](_0x5af0ba['client_email'])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xeb'));}if(!this['isConfigured'](_0x5af0ba[_0x693c('0xec')])){return this[_0x693c('0xd')]['noop'](_0x693c('0xed'));}if(!this[_0x693c('0x80')](_0x5af0ba[_0x693c('0xee')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20anguage\x20configured');}if(!this[_0x693c('0x80')](_0x5af0ba[_0x693c('0x5a')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20text\x20configured');}this[_0x693c('0xd')]['bot']=!![];this[_0x693c('0x34')](_0x5af0ba);this['createSquareMessage'](_0x5af0ba['text'],'in','','');this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0xef'),_0x5af0ba['text']));var _0x4e8aeb=this[_0x693c('0x79')][_0x693c('0x6e')](this,_0x5af0ba);if(_0x4e8aeb){for(var _0x40e00 in _0x4e8aeb){if(_0x4e8aeb[_0x693c('0x92')](_0x40e00)){if(_0x40e00!==_0x693c('0xf0')){this[_0x693c('0xd')]['setVariable'](util['format'](_0x693c('0xe5'),_0x40e00['toUpperCase']()),_0x4e8aeb[_0x40e00]);}}}this[_0x693c('0x40')](_0x4e8aeb['speech'],_0x693c('0xe7'),_0x693c('0xea'),_0x4e8aeb[_0x693c('0xf0')]);return this[_0x693c('0xd')]['noop'](util['format']('DialogflowV2\x20Result\x20%s',_0x4e8aeb['speech']));}return this[_0x693c('0xd')]['error'](_0x5af0ba,_0x693c('0xf1'));};AGIVertices[_0x693c('0x10')][_0x693c('0xf2')]=function(_0x544d82){logger[_0x693c('0x2c')](util['format'](_0x693c('0xf3'),_0x544d82[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x544d82[_0x693c('0xf4')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x693c('0x80')](_0x544d82[_0x693c('0xf5')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xf6'));}if(!this[_0x693c('0x80')](_0x544d82[_0x693c('0xf7')])){return this['channel'][_0x693c('0xa7')](_0x693c('0xf8'));}if(!this['isConfigured'](_0x544d82[_0x693c('0xf9')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xc1'));}this[_0x693c('0xd')][_0x693c('0xe3')]=!![];this['createSquareDetailsReport'](_0x544d82);this[_0x693c('0x40')](_0x544d82[_0x693c('0x5a')],'in','','');this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xfa'),_0x544d82[_0x693c('0x5a')]));var _0x1b68c9=this[_0x693c('0x7b')][_0x693c('0x6e')](this,_0x544d82);if(_0x1b68c9){for(var _0x56931f in _0x1b68c9){if(_0x1b68c9[_0x693c('0x92')](_0x56931f)){this[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0xfb'),_0x56931f['toUpperCase']()),_0x1b68c9[_0x56931f]);}}this[_0x693c('0x40')](_0x1b68c9[_0x693c('0xe6')],'out',_0x693c('0xf2'),'');if(_0x1b68c9[_0x693c('0xfc')]){this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xfd'),_0x1b68c9[_0x693c('0xfc')]));var _0x470957=this[_0x693c('0xd')][_0x693c('0xfe')](_0x1b68c9[_0x693c('0xfc')]);try{fs['unlink'](_0x1b68c9[_0x693c('0xfc')]+_0x693c('0xff'));}catch(_0x6bfca2){logger['error'](_0x6bfca2);}return _0x470957;}else{return this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0x100'),_0x1b68c9['speech']));}}return this[_0x693c('0xd')]['error'](_0x544d82,_0x693c('0x101'));};AGIVertices[_0x693c('0x10')][_0x693c('0x102')]=function(_0x5414bb){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20END\x20(%s)\x20block',_0x5414bb[_0x693c('0xa5')]));return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x102'));};AGIVertices[_0x693c('0x10')][_0x693c('0x103')]=function(_0x12bbc0){logger[_0x693c('0x2c')](util['format'](_0x693c('0x104'),_0x12bbc0['label']));var _0x39a8e7='';if(_0x12bbc0[_0x693c('0x105')]){if(!this[_0x693c('0x80')](_0x12bbc0[_0x693c('0x105')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x12bbc0,'no\x20trunk\x20selected');}else{var _0x405c33=parseInt(_0x12bbc0[_0x693c('0x105')],0xa);if(isNaN(_0x405c33)){_0x39a8e7=_0x12bbc0[_0x693c('0x105')];}else{_0x39a8e7=this['getTrunk']['sync'](this,_0x12bbc0[_0x693c('0x105')]);if(!_0x39a8e7){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x12bbc0,_0x693c('0x106'));}}}}else if(_0x12bbc0['trunk_name']){_0x39a8e7=_0x12bbc0[_0x693c('0x107')];}else{return this[_0x693c('0xd')][_0x693c('0x2a')](_0x12bbc0,'no\x20trunk\x20selected');}var _0x907a6=this['channel'][_0x693c('0x54')](_0x693c('0xdd'),[util[_0x693c('0x26')](_0x693c('0x108'),_0x39a8e7,_0x12bbc0['phone']),_0x12bbc0[_0x693c('0x63')],_0x12bbc0[_0x693c('0x109')],_0x12bbc0['url']]);if(_0x907a6['result']===-0x1){return _0x907a6;}return this['channel'][_0x693c('0xa7')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x693c('0x10')][_0x693c('0x10a')]=function(_0x2ec41f){logger['info'](util['format'](_0x693c('0x10b'),_0x2ec41f[_0x693c('0xa5')]));return this['channel']['noop']('finally');};AGIVertices[_0x693c('0x10')][_0x693c('0xc')]=function(_0x2969cf){logger[_0x693c('0x2c')](util['format'](_0x693c('0x10c'),_0x2969cf[_0x693c('0xa5')]));if(_0x2969cf[_0x693c('0xa2')]===0x0){return this[_0x693c('0xa1')](_0x2969cf);}_0x2969cf['retry']-=0x1;if(!this[_0x693c('0x80')](_0x2969cf[_0x693c('0x10d')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x2969cf,'no\x20file\x20audio\x20selected');}var _0x297a19=this['getSound'][_0x693c('0x6e')](this,_0x2969cf[_0x693c('0x10d')]);if(!_0x297a19){return this['channel'][_0x693c('0x2a')](_0x2969cf,_0x693c('0x10e'));}if(!this['isConfigured'](_0x2969cf[_0x693c('0xd3')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x693c('0xd2'));}var _0x5bde4e=this[_0x693c('0xd')][_0x693c('0x10f')](_0x297a19,_0x2969cf[_0x693c('0x110')],_0x2969cf[_0x693c('0x111')]);var _0x5cda27=_0x5bde4e[_0x693c('0x9f')]?_0x5bde4e[_0x693c('0x9f')][_0x693c('0x112')]():'';logger[_0x693c('0x2c')](_0x693c('0x113'),JSON['stringify'](_0x5bde4e));if(_0x5bde4e[_0x693c('0x9f')]===-0x1){this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x2969cf,_0x5cda27);return _0x5bde4e;}else if(_0x5bde4e[_0x693c('0x9d')]==='timeout'){_0x5bde4e[_0x693c('0x9f')]=_0x5cda27[_0x693c('0x96')]>=parseInt(_0x2969cf['mindigit'])?'x':'i';}else{_0x5bde4e[_0x693c('0x9f')]=_0x5cda27[_0x693c('0x96')]>=parseInt(_0x2969cf[_0x693c('0x114')])&&_0x5cda27[_0x693c('0x96')]<=parseInt(_0x2969cf[_0x693c('0x111')])?'x':'i';}var _0x1e74fa=this[_0x693c('0x11')]['sync'](this,_0x2969cf[_0x693c('0xd3')]);if(!_0x1e74fa){return this['channel'][_0x693c('0x2a')](_0x2969cf,_0x693c('0x115'));}this[_0x693c('0xd')][_0x693c('0x9a')](_0x1e74fa,_0x5cda27);if(this[_0x693c('0x80')](_0x2969cf[_0x693c('0x116')])){var _0x1e7ece=parseInt(_0x2969cf[_0x693c('0x116')],0xa);var _0x30cb4e=rs[_0x693c('0x117')]({'charset':'*','length':_0x1e7ece});var _0x38c73c=_0x5cda27[_0x693c('0x96')];if(_0x38c73c>0x0){if(_0x38c73c>_0x1e7ece){this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x2969cf,_0x2969cf[_0x693c('0x118')]==='first'?_0x30cb4e+_0x5cda27['substr'](_0x1e7ece):_0x5cda27[_0x693c('0x119')](0x0,_0x38c73c-_0x1e7ece)+_0x30cb4e);}else{this[_0x693c('0x34')]['sync'](this,_0x2969cf,rs[_0x693c('0x117')]({'charset':'*','length':_0x38c73c}));}}else{this['createSquareDetailsReport'][_0x693c('0x6e')](this,_0x2969cf,'');}}else{this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x2969cf,_0x5cda27);}return _0x5bde4e;};AGIVertices[_0x693c('0x10')][_0x693c('0x11a')]=function(_0x41490b){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x11b'),_0x41490b[_0x693c('0xa5')]));return this[_0x693c('0xc')](_0x41490b);};AGIVertices[_0x693c('0x10')][_0x693c('0x11c')]=function(_0x4cae59){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x11d'),_0x4cae59[_0x693c('0xa5')]));this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x4cae59,_0x4cae59[_0x693c('0x11e')]);return this['channel']['noop'](util[_0x693c('0x26')](_0x693c('0x11f'),_0x4cae59[_0x693c('0x11e')]));};AGIVertices[_0x693c('0x10')][_0x693c('0x120')]=function(_0x414f96){logger['info'](util[_0x693c('0x26')](_0x693c('0x121'),_0x414f96['label']));if(!this[_0x693c('0x80')](_0x414f96['aws_access_key_id'])||!this['isConfigured'](_0x414f96['aws_secret_access_key'])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x122'));}if(!this['isConfigured'](_0x414f96[_0x693c('0x5a')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20text\x20configured');}this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x123'),_0x414f96[_0x693c('0x5a')]));var _0x3d85d9=this[_0x693c('0x82')]['sync'](this,_0x414f96);if(_0x3d85d9){this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x124'),_0x3d85d9));var _0x49b585=this[_0x693c('0xd')][_0x693c('0xfe')](_0x3d85d9);try{fs[_0x693c('0x125')](_0x3d85d9+_0x693c('0xff'));}catch(_0x1f66be){logger[_0x693c('0x2a')](_0x1f66be);}return _0x49b585;}return this[_0x693c('0xd')][_0x693c('0x2a')](_0x414f96,_0x693c('0x126'));};AGIVertices[_0x693c('0x10')]['awslex']=function(_0x512d83){logger['info'](util[_0x693c('0x26')](_0x693c('0x127'),_0x512d83[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x512d83[_0x693c('0x83')])||!this[_0x693c('0x80')](_0x512d83[_0x693c('0x84')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x693c('0x80')](_0x512d83[_0x693c('0x8b')])){return this['channel'][_0x693c('0xa7')](_0x693c('0x128'));}if(!this[_0x693c('0x80')](_0x512d83['text'])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xc1'));}this[_0x693c('0xd')][_0x693c('0xe3')]=!![];this[_0x693c('0x34')](_0x512d83);this[_0x693c('0x40')](_0x512d83[_0x693c('0x5a')],'in','','');this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x129'),_0x512d83['text']));var _0x405fe5=this[_0x693c('0x89')][_0x693c('0x6e')](this,_0x512d83);if(_0x405fe5){for(var _0x1a0025 in _0x405fe5){if(_0x405fe5['hasOwnProperty'](_0x1a0025)&&_['isString'](_0x405fe5[_0x1a0025])){this['channel'][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0x12a'),_0x1a0025[_0x693c('0x67')]()),_0x405fe5[_0x1a0025]);}}if(_[_0x693c('0x45')](_0x405fe5[_0x693c('0x74')])){return this['channel']['noop'](_0x693c('0x12b'));}else{this[_0x693c('0x40')](_0x405fe5[_0x693c('0x74')],_0x693c('0xe7'),_0x693c('0x12c'),'');return this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')](_0x693c('0x12d'),_0x405fe5[_0x693c('0x74')]));}}return this[_0x693c('0xd')]['error'](_0x512d83,_0x693c('0x12e'));};AGIVertices[_0x693c('0x10')][_0x693c('0x12f')]=function(_0x1b1e2d){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x130'),_0x1b1e2d[_0x693c('0xa5')],_0x1b1e2d['timeout']));if(!this[_0x693c('0x80')](_0x1b1e2d[_0x693c('0x77')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xe2'));}var _0x3cc7cd=_0x693c('0x131');var _0x1da464=util[_0x693c('0x26')](_0x693c('0x132'),FILES_PATH,rs[_0x693c('0x117')](0x4));var _0x3cfa62=util[_0x693c('0x26')]('%s.%s',_0x1da464,_0x3cc7cd);var _0x2f6c7b=!![];if(_0x1b1e2d[_0x693c('0x133')]==='NOBEEP'){_0x2f6c7b=![];}var _0x14ba69=this[_0x693c('0xd')][_0x693c('0x134')](_0x1da464,_0x3cc7cd,_0x1b1e2d[_0x693c('0x135')],_0x1b1e2d[_0x693c('0x63')],undefined,_0x2f6c7b);if(_0x14ba69[_0x693c('0x9f')]!==-0x1){this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')]('google\x20%s\x20file\x20created',_0x3cfa62));var _0x5a4874=this[_0x693c('0x8c')]['sync'](this,_0x1b1e2d,_0x3cfa62);if(_0x5a4874){for(var _0x290fe7 in _0x5a4874){if(_0x5a4874[_0x693c('0x92')](_0x290fe7)){this[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0x136'),_0x290fe7[_0x693c('0x67')]()),_0x5a4874[_0x290fe7]);}}return this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0x137'),JSON['stringify'](_0x5a4874)));}}return _0x14ba69;};AGIVertices[_0x693c('0x10')]['tildeasr']=function(_0x2144fe){logger['info'](util[_0x693c('0x26')](_0x693c('0x138'),_0x2144fe[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x2144fe['appid'])){return this[_0x693c('0xd')]['noop']('no\x20appid\x20configured');}if(!this['isConfigured'](_0x2144fe[_0x693c('0x8f')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20appsecret\x20configured');}var _0x2b1905=_0x693c('0x131');var _0x4bf100=util[_0x693c('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0x693c('0x117')](0x4));var _0x40521b=util['format'](_0x693c('0x98'),_0x4bf100,_0x2b1905);var _0x16ac2d=!![];if(_0x2144fe[_0x693c('0x133')]==='NOBEEP'){_0x16ac2d=![];}var _0xb6f18e=this['channel'][_0x693c('0x134')](_0x4bf100,_0x2b1905,_0x2144fe[_0x693c('0x135')],_0x2144fe[_0x693c('0x63')],undefined,_0x16ac2d);if(_0xb6f18e[_0x693c('0x9f')]!==-0x1){this['channel']['noop'](util[_0x693c('0x26')]('tilde\x20%s\x20file\x20created',_0x40521b));var _0x3ed21b=this[_0x693c('0x139')][_0x693c('0x6e')](this,_0x2144fe,_0x40521b);if(_0x3ed21b){for(var _0x569595 in _0x3ed21b){if(_0x3ed21b[_0x693c('0x92')](_0x569595)){this['channel'][_0x693c('0x9a')](util['format'](_0x693c('0x13a'),_0x569595[_0x693c('0x67')]()),_0x3ed21b[_0x569595]);}}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')]('TildeASR\x20Result\x20%s',JSON[_0x693c('0x70')](_0x3ed21b)));}}return _0xb6f18e;};AGIVertices[_0x693c('0x10')][_0x693c('0x13b')]=function(_0x3ec23d){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x13c'),_0x3ec23d[_0x693c('0xa5')]));return this['channel']['continueAt'](_0x3ec23d['context'],_0x3ec23d['extension'],_0x3ec23d['priority']);};AGIVertices['prototype'][_0x693c('0x13d')]=function(_0xe62cb1){logger['info'](util[_0x693c('0x26')](_0x693c('0x13e'),_0xe62cb1[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0xe62cb1[_0x693c('0x13f')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0xe62cb1,_0x693c('0x140'));}try{var _0xf2e08f=eval(_0xe62cb1[_0x693c('0x13f')])?'true':_0x693c('0x141');this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x142'),_0xe62cb1[_0x693c('0x13f')],_0xf2e08f));return{'code':0xc8,'result':_0xf2e08f};}catch(_0x8a7160){return{'code':0xc8,'result':_0x693c('0x141')};}};AGIVertices[_0x693c('0x10')][_0x693c('0x143')]=function(_0x3e1265){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3e1265[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x3e1265[_0x693c('0x144')])){return this[_0x693c('0xd')]['error'](_0x3e1265,_0x693c('0x145'));}var _0x2aff48=this['getIntervals']['sync'](this,_0x3e1265[_0x693c('0x144')]);if(!_0x2aff48){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x3e1265,_0x693c('0x146'));}for(var _0x38c053=0x0;_0x38c053<_0x2aff48[_0x693c('0x96')];_0x38c053+=0x1){var _0x4e7a13=this[_0x693c('0xd')][_0x693c('0x11')](util[_0x693c('0x26')](_0x693c('0x147'),_0x2aff48[_0x38c053]));if(_0x4e7a13[_0x693c('0x9f')]===-0x1){return _0x4e7a13;}logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x2aff48[_0x38c053],_0x4e7a13[_0x693c('0x9d')]));if(_0x4e7a13[_0x693c('0x9d')]===_0x693c('0x148')){logger['info'](util[_0x693c('0x26')](_0x693c('0x149'),_0x2aff48[_0x38c053],_0x693c('0x148')));this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x149'),_0x2aff48[_0x38c053],_0x693c('0x148')));return{'code':0xc8,'result':'true'};}else{logger[_0x693c('0x2c')](util[_0x693c('0x26')]('IFTIME\x20%s\x20%s',_0x2aff48[_0x38c053],'false'));this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x149'),_0x2aff48[_0x38c053],_0x693c('0x141')));}}return{'code':0xc8,'result':_0x693c('0x141')};};AGIVertices['prototype']['hangup']=function(_0x55a72f){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x55a72f[_0x693c('0xa5')]));return this[_0x693c('0xd')][_0x693c('0x14a')]();};AGIVertices[_0x693c('0x10')][_0x693c('0x14b')]=function(_0x59f391){logger['info'](util[_0x693c('0x26')](_0x693c('0x14c'),_0x59f391[_0x693c('0xa5')]));if(!this['isConfigured'](_0x59f391[_0x693c('0x77')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xe2'));}var _0x2a5b9c=_0x693c('0x131');var _0x2a5ee7=util[_0x693c('0x26')](_0x693c('0x132'),FILES_PATH,rs['generate'](0x4));var _0x5005f5=util['format']('%s.%s',_0x2a5ee7,_0x2a5b9c);var _0x1a84c9=!![];if(_0x59f391['beep']==='NOBEEP'){_0x1a84c9=![];}var _0x302b69=this[_0x693c('0xd')]['recordFile'](_0x2a5ee7,_0x2a5b9c,_0x59f391[_0x693c('0x135')],_0x59f391[_0x693c('0x63')],undefined,_0x1a84c9);if(_0x302b69['result']!==-0x1){this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0x14d'),_0x5005f5));var _0x5da807=this[_0x693c('0x7e')][_0x693c('0x6e')](this,_0x59f391,_0x5005f5);if(_0x5da807){for(var _0xaed353 in _0x5da807){if(_0x5da807['hasOwnProperty'](_0xaed353)){this[_0x693c('0xd')]['setVariable'](util[_0x693c('0x26')]('ISPEECH_ASR_%s',_0xaed353[_0x693c('0x67')]()),_0x5da807[_0xaed353]);}}return this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0x14e'),JSON[_0x693c('0x70')](_0x5da807)));}}return _0x302b69;};AGIVertices['prototype'][_0x693c('0x14f')]=function(_0x48ac7f){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x150'),_0x48ac7f[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x48ac7f[_0x693c('0x77')])){return this[_0x693c('0xd')]['noop'](_0x693c('0xe2'));}if(!this['isConfigured'](_0x48ac7f[_0x693c('0x5a')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xc1'));}this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x151'),_0x48ac7f[_0x693c('0x5a')]));var _0x1ce7dd=this[_0x693c('0x7c')][_0x693c('0x6e')](this,_0x48ac7f);if(_0x1ce7dd){this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x14d'),_0x1ce7dd));var _0x14b627=this[_0x693c('0xd')][_0x693c('0xfe')](_0x1ce7dd,_0x48ac7f[_0x693c('0x135')]);try{fs[_0x693c('0x125')](_0x1ce7dd+_0x693c('0xff'));}catch(_0x5a682a){logger['error'](_0x5a682a);}return _0x14b627;}return this[_0x693c('0xd')]['error'](_0x48ac7f,_0x693c('0x152'));};AGIVertices[_0x693c('0x10')][_0x693c('0x153')]=function(_0x32292c){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x154'),_0x32292c[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x32292c[_0x693c('0x155')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x32292c,'no\x20find\x20by\x20configured');}logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x156'),this[_0x693c('0xd')][_0x693c('0x36')],_0x32292c[_0x693c('0x155')]));var _0x535a9b=this[_0x693c('0x4f')]['sync'](this,_0x32292c[_0x693c('0x155')]);if(_0x535a9b){logger['info'](util[_0x693c('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x693c('0xd')][_0x693c('0x36')],_0x32292c[_0x693c('0x155')]));this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')](_0x693c('0x157'),this[_0x693c('0xd')][_0x693c('0x36')],_0x32292c[_0x693c('0x155')]));return{'code':0xc8,'result':_0x693c('0x158')};}else{logger[_0x693c('0x2c')](util[_0x693c('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x693c('0xd')][_0x693c('0x36')],_0x32292c[_0x693c('0x155')]));this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0x159'),this[_0x693c('0xd')]['callerid'],_0x32292c[_0x693c('0x155')]));return{'code':0xc8,'result':_0x693c('0x15a')};}};AGIVertices['prototype'][_0x693c('0x15b')]=function(_0x41eb70){logger[_0x693c('0x2c')](util['format']('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x41eb70[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x41eb70['findBy'])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x41eb70,'no\x20find\x20by\x20configured');}logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x156'),this['channel'][_0x693c('0x36')],_0x41eb70[_0x693c('0x155')]));var _0x1c9fda=this[_0x693c('0x4e')][_0x693c('0x6e')](this,_0x41eb70[_0x693c('0x155')]);if(_0x1c9fda){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x157'),this[_0x693c('0xd')][_0x693c('0x36')],_0x41eb70[_0x693c('0x155')]));this['channel']['noop'](util[_0x693c('0x26')](_0x693c('0x157'),this[_0x693c('0xd')][_0x693c('0x36')],_0x41eb70[_0x693c('0x155')]));return{'code':0xc8,'result':_0x693c('0x158')};}else{logger['info'](util[_0x693c('0x26')](_0x693c('0x159'),this[_0x693c('0xd')][_0x693c('0x36')],_0x41eb70[_0x693c('0x155')]));this['channel']['noop'](util[_0x693c('0x26')](_0x693c('0x159'),this[_0x693c('0xd')][_0x693c('0x36')],_0x41eb70['findBy']));return{'code':0xc8,'result':_0x693c('0x15a')};}};AGIVertices[_0x693c('0x10')][_0x693c('0x15c')]=function(_0x5a1f48){logger[_0x693c('0x2c')](util['format'](_0x693c('0x15d'),_0x5a1f48[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x5a1f48['operation'])){return this['channel'][_0x693c('0x2a')](_0x5a1f48,'no\x20operation\x20configured');}this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')](_0x693c('0x15e'),_0x5a1f48[_0x693c('0x15f')]));var _0x2f8053=eval(_0x5a1f48['operation']);if(!this['isConfigured'](_0x5a1f48[_0x693c('0xd3')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4b189c=this[_0x693c('0x11')]['sync'](this,_0x5a1f48[_0x693c('0xd3')]);if(!_0x4b189c){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x5a1f48,_0x693c('0x115'));}if(_['isArray'](_0x2f8053)){var _0x5cd280=this;_0x2f8053[_0x693c('0xd4')](function(_0x18b4cb,_0x2e2d16){_0x5cd280[_0x693c('0xd')][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0x160'),_0x4b189c,_0x2e2d16),_0x18b4cb);});return this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x161'),_0x4b189c));}else{return this[_0x693c('0xd')][_0x693c('0x9a')](_0x4b189c,_0x2f8053);}};AGIVertices[_0x693c('0x10')][_0x693c('0xb')]=function(_0x3d2f12){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x162'),_0x3d2f12[_0x693c('0xa5')]));if(_0x3d2f12[_0x693c('0xa2')]===0x0){return this[_0x693c('0xa1')](_0x3d2f12);}_0x3d2f12[_0x693c('0xa2')]-=0x1;if(!this[_0x693c('0x80')](_0x3d2f12[_0x693c('0x10d')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x3d2f12,_0x693c('0x163'));}var _0x51393f=this[_0x693c('0x1e')][_0x693c('0x6e')](this,_0x3d2f12[_0x693c('0x10d')]);if(!_0x51393f){return this['channel'][_0x693c('0x2a')](_0x3d2f12,_0x693c('0x10e'));}var _0x4bd171=this[_0x693c('0xd')][_0x693c('0x10f')](_0x51393f,_0x3d2f12[_0x693c('0x110')],_0x3d2f12[_0x693c('0x164')]);var _0x57944e=_0x4bd171[_0x693c('0x9f')];if(_0x4bd171['result']===-0x1){this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x3d2f12,'-1');return _0x4bd171;}else if(_0x4bd171[_0x693c('0x9d')]==='timeout'){_0x4bd171['result']=_0x4bd171[_0x693c('0x9f')]['length']>0x0?_0x4bd171['result']:'t';}else if(_[_0x693c('0x42')](_0x4bd171[_0x693c('0x9f')])){_0x4bd171[_0x693c('0x9f')]='#';_0x57944e='#';}if(!this[_0x693c('0x80')](_0x3d2f12[_0x693c('0xd3')])){this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0xd2'));}else{var _0x416848=this[_0x693c('0x11')]['sync'](this,_0x3d2f12[_0x693c('0xd3')]);if(!_0x416848){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x3d2f12,_0x693c('0x115'));}this[_0x693c('0xd')][_0x693c('0x9a')](_0x416848,_0x57944e);}this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x3d2f12,_0x57944e);return _0x4bd171;};AGIVertices[_0x693c('0x10')][_0x693c('0xa7')]=function(_0xbb5c87){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x165'),_0xbb5c87[_0x693c('0xa5')]));return this[_0x693c('0xd')][_0x693c('0xa7')](_0xbb5c87['output']||_0xbb5c87['label']);};AGIVertices[_0x693c('0x10')][_0x693c('0x166')]=function(_0x2fa07a){logger[_0x693c('0x2c')](util['format'](_0x693c('0x167'),_0x2fa07a[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x2fa07a[_0x693c('0x155')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x2fa07a,_0x693c('0x168'));}logger[_0x693c('0x2c')](util[_0x693c('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x693c('0x36')],_0x2fa07a[_0x693c('0x155')]));var _0x21535d=this[_0x693c('0x169')][_0x693c('0x6e')](this,_0x2fa07a['pause_id']);var _0x1c9b02=this[_0x693c('0x4b')][_0x693c('0x6e')](this,_0x2fa07a[_0x693c('0x155')],_0x21535d);if(_0x1c9b02){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x157'),this['channel'][_0x693c('0x36')],_0x2fa07a[_0x693c('0x155')]));this[_0x693c('0xd')]['noop'](util['format'](_0x693c('0x157'),this[_0x693c('0xd')]['callerid'],_0x2fa07a[_0x693c('0x155')]));return{'code':0xc8,'result':_0x693c('0x158')};}else{logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x159'),this['channel']['callerid'],_0x2fa07a['findBy']));this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x157'),this[_0x693c('0xd')]['callerid'],_0x2fa07a[_0x693c('0x155')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x693c('0x10')][_0x693c('0x16a')]=function(_0x4859ba){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x16b'),_0x4859ba[_0x693c('0xa5')]));if(!this['isConfigured'](_0x4859ba[_0x693c('0x10d')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x4859ba,'no\x20file\x20audio\x20selected');}var _0x545a4c=this[_0x693c('0x1e')][_0x693c('0x6e')](this,_0x4859ba[_0x693c('0x10d')]);if(!_0x545a4c){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x4859ba,_0x693c('0x10e'));}var _0x1162de=this['channel']['exec'](_0x693c('0x16c'),[_0x545a4c,_0x4859ba[_0x693c('0x109')]]);if(_0x1162de['result']===-0x1){return _0x1162de;}return this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0xbe'),_0x693c('0x16c'),_0x545a4c));};AGIVertices[_0x693c('0x10')][_0x693c('0x16d')]=function(_0x245388){logger[_0x693c('0x2c')](util['format'](_0x693c('0x16e'),_0x245388[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x245388['queue_id'])){return this['channel']['error'](_0x245388,_0x693c('0x16f'));}var _0x581055='';var _0x424d10=parseInt(_0x245388[_0x693c('0x170')],0xa);if(isNaN(_0x424d10)){_0x581055=_0x245388[_0x693c('0x170')];}else{_0x581055=this['getVoiceQueue']['sync'](this,_0x245388['queue_id']);if(!_0x581055){return this['channel']['error'](_0x245388,_0x693c('0x171'));}}var _0x10a32f='';if(this[_0x693c('0x80')](_0x245388['file_id'])){var _0x1a59df=this[_0x693c('0x1e')][_0x693c('0x6e')](this,_0x245388[_0x693c('0x10d')]);if(_0x1a59df){_0x10a32f=_0x1a59df;}}this[_0x693c('0x34')]['sync'](this,_0x245388,_0x581055);if(_0x245388[_0x693c('0x109')]['indexOf']('x')<0x0){_0x245388[_0x693c('0x109')]+='x';}if(_0x245388[_0x693c('0x109')][_0x693c('0x172')]('X')<0x0){_0x245388[_0x693c('0x109')]+='X';}this['channel']['setVariable'](_0x693c('0x173'),_0x581055?_0x581055[_0x693c('0x174')]():'');var _0x5cd9ba=this[_0x693c('0xd')][_0x693c('0x54')](_0x693c('0x175'),[_0x581055,_0x245388[_0x693c('0x109')],_0x245388[_0x693c('0xdf')],_0x10a32f,_0x245388[_0x693c('0x63')],_0x245388[_0x693c('0x7')],_0x245388[_0x693c('0x176')],_0x245388[_0x693c('0x177')],'',_0x245388['position']]);if(_0x5cd9ba[_0x693c('0x9f')]===-0x1){return _0x5cd9ba;}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xbe'),_0x693c('0x175'),_0x581055));};AGIVertices[_0x693c('0x10')][_0x693c('0x178')]=function(_0x984e06){logger['info'](util['format'](_0x693c('0x179'),_0x984e06[_0x693c('0xa5')]));var _0x1545ac=_0x984e06[_0x693c('0x17a')]||_0x693c('0x131');var _0x1e4f8b=util[_0x693c('0x26')](_0x693c('0x17b'),this[_0x693c('0xd')][_0x693c('0x38')],rs[_0x693c('0x117')](0x5));var _0x43b106=util[_0x693c('0x26')](_0x693c('0x17c'),FILES_PATH,_0x1e4f8b,_0x1545ac);var _0x6e80d8=util['format'](_0x693c('0x132'),FILES_PATH,_0x1e4f8b);this[_0x693c('0x37')][_0x693c('0x6e')](this,_0x984e06,_0x1e4f8b,_0x43b106);this[_0x693c('0xd')][_0x693c('0x9a')](_0x693c('0x17d'),_0x1e4f8b);logger['info'](_0x693c('0x17e'),_0x6e80d8,_0x1545ac,_0x984e06['escape_digits'],_0x984e06[_0x693c('0x63')]);return this[_0x693c('0xd')]['recordFile'](_0x6e80d8,_0x1545ac,_0x984e06[_0x693c('0x17f')],_0x984e06['timeout'],undefined,!![]);};AGIVertices['prototype']['restapi']=function(_0x3837c9){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x180'),_0x3837c9[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x3837c9[_0x693c('0xdf')])){return this['channel']['noop'](_0x693c('0x181'));}var _0x1267cb=this['restAPI']['sync'](this,_0x3837c9);logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Response:',util[_0x693c('0x182')](_0x1267cb,{'showHidden':![],'depth':null})));if(!this[_0x693c('0x80')](_0x3837c9['variable_id'])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x183'));}var _0x480ae2=this[_0x693c('0x11')][_0x693c('0x6e')](this,_0x3837c9[_0x693c('0xd3')]);if(!_0x480ae2){return this[_0x693c('0xd')]['error'](_0x3837c9,_0x693c('0x115'));}this['channel'][_0x693c('0x9a')](util[_0x693c('0x26')](_0x693c('0x184'),_0x480ae2),_0x1267cb[_0x693c('0x72')]?_0x1267cb[_0x693c('0x72')]:_0x693c('0x185'));this['channel'][_0x693c('0x9a')](util[_0x693c('0x26')]('%s_STATUS_MESSAGE',_0x480ae2),_0x1267cb[_0x693c('0x73')]?_0x1267cb[_0x693c('0x73')]:'OK');if(_0x1267cb['body']){try{this[_0x693c('0x97')](_0x1267cb['body'],_0x480ae2);}catch(_0x5a0a5f){logger['error'](util[_0x693c('0x26')](_0x693c('0x186'),_0x480ae2));}}return this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0xd8'),_0x480ae2));};AGIVertices[_0x693c('0x10')][_0x693c('0x187')]=function(_0x3baaa8){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x188'),_0x3baaa8[_0x693c('0xa5')]));return this[_0x693c('0xd')][_0x693c('0x189')](_0x3baaa8[_0x693c('0x18a')][_0x693c('0x56')](/\s+/g,''),_0x3baaa8[_0x693c('0x17f')]);};AGIVertices[_0x693c('0x10')][_0x693c('0x18b')]=function(_0x30a3e6){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x30a3e6['label']));return this[_0x693c('0xd')][_0x693c('0x18c')](_0x30a3e6['number'][_0x693c('0x56')](/\s+/g,''),_0x30a3e6[_0x693c('0x17f')]);};AGIVertices[_0x693c('0x10')][_0x693c('0x18d')]=function(_0x57a093){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x57a093[_0x693c('0xa5')]));return this[_0x693c('0xd')][_0x693c('0x18e')](_0x57a093[_0x693c('0x5a')],_0x57a093[_0x693c('0x17f')]);};AGIVertices['prototype'][_0x693c('0x18f')]=function(_0x284b39){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x284b39['label']));if(!this['isConfigured'](_0x284b39[_0x693c('0x190')])){return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x191'));}var _0x49e132=this['getMailAccount']['sync'](this,_0x284b39[_0x693c('0x190')]);if(!_0x49e132||!_0x49e132[_0x693c('0x192')]){return this[_0x693c('0xd')]['error'](_0x284b39,'no\x20mail\x20account\x20found');}var _0x1b2ebe={'from':util[_0x693c('0x26')]('\x22%s\x22\x20<%s>',_0x49e132[_0x693c('0x14')],_0x49e132[_0x693c('0x193')]||_0x49e132[_0x693c('0x192')]['user']),'to':_0x284b39['to']||'','cc':_0x284b39['cc']||'','bcc':_0x284b39[_0x693c('0x194')]||'','subject':_0x284b39['subject'],'html':_0x284b39[_0x693c('0x5a')],'text':_0x284b39[_0x693c('0x5a')]};var _0x140d0d={'tls':{'rejectUnauthorized':![]}};if(_0x49e132[_0x693c('0x192')][_0x693c('0x195')]){_0x140d0d[_0x693c('0x195')]=_0x49e132['Smtp'][_0x693c('0x195')];}else{_0x140d0d[_0x693c('0x196')]=_0x49e132[_0x693c('0x192')][_0x693c('0x196')];_0x140d0d[_0x693c('0x197')]=_0x49e132[_0x693c('0x192')][_0x693c('0x197')];_0x140d0d[_0x693c('0x198')]=_0x49e132[_0x693c('0x192')][_0x693c('0x198')];}if(_0x49e132[_0x693c('0x192')][_0x693c('0x199')]){_0x140d0d['auth']={'user':_0x49e132[_0x693c('0x192')]['user'],'pass':_0x49e132['Smtp'][_0x693c('0x19a')]};}if(this['isConfigured'](_0x284b39[_0x693c('0x19b')])){}logger[_0x693c('0x19c')](_0x693c('0x19d'),JSON[_0x693c('0x70')](_0x1b2ebe));this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x284b39,_0x284b39['account_id']);this['channel']['noop'](util[_0x693c('0x26')](_0x693c('0x19e'),_0x49e132[_0x693c('0x14')]));this[_0x693c('0x23')][_0x693c('0x6e')](this,_0x140d0d,_0x1b2ebe);return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x19f'));};AGIVertices[_0x693c('0x10')][_0x693c('0x1a0')]=function(_0x64d22){logger[_0x693c('0x2c')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x64d22[_0x693c('0xa5')]));return this[_0x693c('0xd')]['noop'](_0x693c('0x1a1'));};AGIVertices[_0x693c('0x10')]['sendSMS']=function(_0x4e7967){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x1a2'),_0x4e7967[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x4e7967[_0x693c('0x1a3')])){return this[_0x693c('0xd')][_0x693c('0xa7')]('no\x20sms\x20account\x20configured');}var _0x5611ef=this[_0x693c('0x31')][_0x693c('0x6e')](this,_0x4e7967[_0x693c('0x1a3')]);if(!_0x5611ef){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x4e7967,'no\x20sms\x20account\x20found');}var _0x128af7={'body':_0x4e7967[_0x693c('0x1a4')],'phone':_0x4e7967['to']||'','SmsAccountId':_0x5611ef['id']};logger[_0x693c('0x19c')]('sendSMS\x20message',JSON[_0x693c('0x70')](_0x128af7));this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x4e7967,_0x4e7967[_0x693c('0x1a3')]);this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x1a5'),_0x5611ef['name']));this[_0x693c('0x33')][_0x693c('0x6e')](this,_0x128af7);return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x1a6'));};AGIVertices[_0x693c('0x10')]['set']=function(_0x36fe98){logger[_0x693c('0x2c')](util['format'](_0x693c('0x1a7'),_0x36fe98[_0x693c('0xa5')]));if(!this['isConfigured'](_0x36fe98[_0x693c('0xd3')])){return this['channel'][_0x693c('0x2a')](_0x36fe98,'no\x20variable\x20selected');}var _0x675f8f=this[_0x693c('0x11')]['sync'](this,_0x36fe98[_0x693c('0xd3')]);if(!_0x675f8f){return this[_0x693c('0xd')]['error'](_0x36fe98,_0x693c('0x115'));}return this[_0x693c('0xd')][_0x693c('0x9a')](_0x675f8f,_0x36fe98[_0x693c('0x1a8')]);};AGIVertices[_0x693c('0x10')]['start']=function(_0x526433){logger['info'](util[_0x693c('0x26')]('Enter\x20in\x20START\x20(%s)\x20block',_0x526433[_0x693c('0xa5')]));this[_0x693c('0xd')]['noop'](_0x693c('0x1a9'));if(_0x526433[_0x693c('0xb4')]===_0x693c('0x1aa')){this[_0x693c('0xd')]['noop']('Answer');return this[_0x693c('0xd')][_0x693c('0xb4')]();}return this[_0x693c('0xd')][_0x693c('0xa7')](_0x693c('0x1ab'));};AGIVertices[_0x693c('0x10')][_0x693c('0x1ac')]=function(_0x2f6a81){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x1ad'),_0x2f6a81[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x2f6a81[_0x693c('0x1ae')])){return this['channel']['error'](_0x2f6a81,'no\x20subproject\x20selected');}var _0x15187c=this['getSquareProject'][_0x693c('0x6e')](this,_0x2f6a81['project_id']);if(!this[_0x693c('0x80')](_0x15187c)){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x2f6a81,util[_0x693c('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2f6a81[_0x693c('0x1ae')]));}if(_0x15187c===this[_0x693c('0xd')][_0x693c('0x3e')]){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x2f6a81,_0x693c('0x1af'));}this[_0x693c('0x34')][_0x693c('0x6e')](this,_0x2f6a81,_0x15187c);var _0x5d5c92=this[_0x693c('0xd')][_0x693c('0x54')](_0x693c('0x1b0'),util[_0x693c('0x26')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x693c('0x7')][_0x693c('0x196')]||'127.0.0.1',_0x15187c,this[_0x693c('0xd')][_0x693c('0x3e')]));if(_0x5d5c92[_0x693c('0x9f')]===-0x1){return _0x5d5c92;}return this['channel']['noop'](util['format'](_0x693c('0xbe'),'AGI',_0x15187c));};AGIVertices[_0x693c('0x10')][_0x693c('0x1b1')]=function(_0x3c121d){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x1b2'),_0x3c121d[_0x693c('0xa5')]));var _0x3aa070=this['shellCommand'][_0x693c('0x6e')](this,_0x3c121d[_0x693c('0xb3')]);this[_0x693c('0x34')]['sync'](this,_0x3c121d,_0x3c121d[_0x693c('0xb3')]);if(this[_0x693c('0x80')](_0x3c121d[_0x693c('0xd3')])){var _0x220dd7=this['getVariable'][_0x693c('0x6e')](this,_0x3c121d['variable_id']);if(_0x220dd7){this['channel'][_0x693c('0x9a')](_0x220dd7,_0x3aa070);return this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')](_0x693c('0x1b3'),_0x3c121d['command'],_0x220dd7));}}return this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x1b4'),_0x3c121d[_0x693c('0xb3')]));};AGIVertices[_0x693c('0x10')][_0x693c('0x1b5')]=function(_0xcab395){logger['info'](util[_0x693c('0x26')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xcab395[_0x693c('0xa5')]));_0xcab395[_0x693c('0x5a')]=_0xcab395[_0x693c('0x5a')][_0x693c('0x56')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x693c('0x80')](_0xcab395[_0x693c('0x58')])){return this[_0x693c('0xd')]['noop'](_0x693c('0x1b6'));}if(!this['isConfigured'](_0xcab395[_0x693c('0x5a')])){return this['channel'][_0x693c('0xa7')](_0x693c('0xc1'));}this[_0x693c('0xd')][_0x693c('0xa7')](util['format'](_0x693c('0x1b7'),_0xcab395['text']));var _0x2922e2=this[_0x693c('0x57')][_0x693c('0x6e')](this,_0xcab395);if(_0x2922e2){this['channel'][_0x693c('0xa7')](util[_0x693c('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2922e2));var _0x55aa4e=this[_0x693c('0xd')][_0x693c('0xfe')](_0x2922e2);try{fs[_0x693c('0x125')](_0x2922e2+_0x693c('0xff'));}catch(_0x4aaffa){logger[_0x693c('0x2a')](_0x4aaffa);}return _0x55aa4e;}return this['channel'][_0x693c('0x2a')](_0xcab395,_0x693c('0x1b8'));};AGIVertices[_0x693c('0x10')][_0x693c('0x1b9')]=function(_0x5299c6){logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x1ba'),_0x5299c6[_0x693c('0xa5')]));_0x5299c6['text']=_0x5299c6[_0x693c('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5299c6[_0x693c('0x5a')])){return this['channel'][_0x693c('0xa7')](_0x693c('0xc1'));}this[_0x693c('0xd')]['noop'](util[_0x693c('0x26')]('Trying\x20Google\x20TTS\x20%s',_0x5299c6[_0x693c('0x5a')]));var _0x1b4757=this[_0x693c('0x60')]['sync'](this,_0x5299c6);if(_0x1b4757){this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x1bb'),_0x1b4757));var _0x1ffd1c=this[_0x693c('0xd')][_0x693c('0xfe')](_0x1b4757);try{fs[_0x693c('0x125')](_0x1b4757+_0x693c('0xff'));}catch(_0x4890c6){logger[_0x693c('0x2a')](_0x4890c6);}return _0x1ffd1c;}return this[_0x693c('0xd')][_0x693c('0x2a')](_0x5299c6,_0x693c('0x1bc'));};AGIVertices[_0x693c('0x10')][_0x693c('0x1bd')]=function(_0x553af7){logger['info'](util[_0x693c('0x26')](_0x693c('0x1be'),_0x553af7[_0x693c('0xa5')]));if(!this[_0x693c('0x80')](_0x553af7[_0x693c('0x155')])){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x553af7,_0x693c('0x168'));}logger[_0x693c('0x2c')](util['format'](_0x693c('0x156'),this['channel'][_0x693c('0x36')],_0x553af7[_0x693c('0x155')]));var _0x53f284=this['agentUnpause'][_0x693c('0x6e')](this,_0x553af7[_0x693c('0x155')]);if(_0x53f284){logger[_0x693c('0x2c')](util['format'](_0x693c('0x157'),this[_0x693c('0xd')][_0x693c('0x36')],_0x553af7[_0x693c('0x155')]));this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x157'),this[_0x693c('0xd')][_0x693c('0x36')],_0x553af7[_0x693c('0x155')]));return{'code':0xc8,'result':_0x693c('0x158')};}else{logger[_0x693c('0x2c')](util[_0x693c('0x26')](_0x693c('0x159'),this[_0x693c('0xd')][_0x693c('0x36')],_0x553af7[_0x693c('0x155')]));this[_0x693c('0xd')][_0x693c('0xa7')](util[_0x693c('0x26')](_0x693c('0x159'),this['channel'][_0x693c('0x36')],_0x553af7['findBy']));return{'code':0xc8,'result':_0x693c('0x15a')};}};AGIVertices[_0x693c('0x10')][_0x693c('0x1bf')]=function(_0x4dcbf4){logger[_0x693c('0x2c')](util[_0x693c('0x26')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4dcbf4[_0x693c('0xa5')]));var _0x1ed146=this[_0x693c('0xd')][_0x693c('0x54')]('VOICEMAIL',[_0x4dcbf4[_0x693c('0x1c0')],_0x4dcbf4[_0x693c('0x75')]]);if(_0x1ed146['result']===-0x1){return _0x1ed146;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x693c('0x1c1'),_0x4dcbf4[_0x693c('0x1c0')]));};AGIVertices[_0x693c('0x10')][_0x693c('0x1c2')]=function(_0x47dac3){logger['info'](util[_0x693c('0x26')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x47dac3['label']));if(!this[_0x693c('0x80')](_0x47dac3[_0x693c('0xd3')])){return this[_0x693c('0xd')]['error'](_0x47dac3,_0x693c('0x1c3'));}var _0x49cbfd=this[_0x693c('0x11')][_0x693c('0x6e')](this,_0x47dac3[_0x693c('0xd3')]);if(!_0x49cbfd){return this[_0x693c('0xd')][_0x693c('0x2a')](_0x47dac3,_0x693c('0x115'));}var _0x4b7aca=this['channel'][_0x693c('0x11')](_0x49cbfd);return{'code':0xc8,'result':_0x4b7aca[_0x693c('0x9d')]?_0x4b7aca[_0x693c('0x9d')]:'-'};};String['prototype']['replaceAll']=function(_0x295c1e,_0x2a34b4){return this[_0x693c('0x9c')](_0x295c1e)[_0x693c('0x1c4')](_0x2a34b4);};module[_0x693c('0x1c5')]=AGIVertices;
\ No newline at end of file
index dee789d..6f00764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a12=['[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','acw','[ACW][syncAgentConnectPreview]\x20%s','prototype','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','YYYY-MM-DD\x20HH:mm:ss','updateAcw','lastPauseAt','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally'];(function(_0x1ee6a2,_0x5efc6a){var _0x1936e=function(_0xa60272){while(--_0xa60272){_0x1ee6a2['push'](_0x1ee6a2['shift']());}};_0x1936e(++_0x5efc6a);}(_0x6a12,0xcc));var _0x26a1=function(_0x4dbf55,_0x350391){_0x4dbf55=_0x4dbf55-0x0;var _0x2d3f92=_0x6a12[_0x4dbf55];return _0x2d3f92;};'use strict';var util=require(_0x26a1('0x0'));var _=require(_0x26a1('0x1'));var moment=require(_0x26a1('0x2'));var ami=require('../ami');var logger=require(_0x26a1('0x3'))('acw');var RpcUser=require(_0x26a1('0x4'));var RpcVoiceAgentReport=require(_0x26a1('0x5'));function Acw(_0x347504){this[_0x26a1('0x6')]=_0x347504[_0x26a1('0x6')];this[_0x26a1('0x7')]=_0x347504[_0x26a1('0x7')];this[_0x26a1('0x8')]=_0x347504[_0x26a1('0x8')];this[_0x26a1('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x26a1('0xa'),this['syncHangupRequest'][_0x26a1('0xb')](this));ami['on'](_0x26a1('0xc'),this[_0x26a1('0xd')][_0x26a1('0xb')](this));ami['on'](_0x26a1('0xe'),this[_0x26a1('0xf')][_0x26a1('0xb')](this));ami['on']('attendedtransfer',this[_0x26a1('0x10')][_0x26a1('0xb')](this));ami['on']('blindtransfer',this[_0x26a1('0x11')][_0x26a1('0xb')](this));ami['on'](_0x26a1('0x12'),this['syncAgentConnectPreview'][_0x26a1('0xb')](this));}function getDiff(_0x570ae7){var _0x4a4504=moment()[_0x26a1('0x13')](0x0);var _0x30f8e4=moment(_0x570ae7)['milliseconds'](0x0);return _0x4a4504[_0x26a1('0x14')](_0x30f8e4,_0x26a1('0x15'));}Acw['prototype'][_0x26a1('0x16')]=function(_0x180343){try{var _0x4ed5e9=this;var _0x32bcca=this[_0x26a1('0x9')][_0x180343][_0x26a1('0x17')];var _0x3d4163=this[_0x26a1('0x9')][_0x180343][_0x26a1('0x18')];var _0x12890f=this[_0x26a1('0x6')][_0x3d4163];var _0x5d8f63=![];var _0x486525=_0x26a1('0x19');if(_0x12890f[_0x26a1('0x1a')]){if(_0x12890f[_0x26a1('0x1b')][_0x26a1('0x1c')]){_0x5d8f63=!![];_0x486525=_0x12890f[_0x26a1('0x1b')][_0x26a1('0x1c')];}}ami[_0x26a1('0x1d')]({'action':_0x26a1('0x1e'),'interface':_0x32bcca,'paused':!![],'reason':_0x486525})[_0x26a1('0x1f')](function(_0x5d008b){if(_0x4ed5e9[_0x26a1('0x7')][_0x32bcca]){return RpcUser['getAgent'](_0x4ed5e9[_0x26a1('0x7')][_0x32bcca]['id'])[_0x26a1('0x1f')](function(_0xfcf036){if(_0xfcf036&&!_0xfcf036[_0x26a1('0x20')]){logger[_0x26a1('0x21')](_0x26a1('0x22'),_0x180343,_0x32bcca,_0x3d4163);var _0x529f48=_0x4ed5e9[_0x26a1('0x9')][_0x180343][_0x26a1('0x23')]&&_0x4ed5e9[_0x26a1('0x9')][_0x180343]['destlinkedid']?_0x4ed5e9[_0x26a1('0x9')][_0x180343][_0x26a1('0x24')]:_0x180343;return RpcUser[_0x26a1('0x25')](_0x4ed5e9[_0x26a1('0x7')][_0x32bcca],_0x486525,_0x529f48)[_0x26a1('0x1f')](function(_0x117247){if(!_0x5d8f63){_0x4ed5e9[_0x26a1('0x8')][_0x32bcca]={};logger[_0x26a1('0x21')](_0x26a1('0x26'),_0x180343,_0x4ed5e9[_0x26a1('0x6')][_0x3d4163][_0x26a1('0x27')],_0x32bcca,_0x3d4163);_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x28')]=setTimeout(_0x4ed5e9['stopAcw'][_0x26a1('0xb')](_0x4ed5e9,_0x32bcca),_0x4ed5e9[_0x26a1('0x6')][_0x3d4163][_0x26a1('0x27')]*0x3e8);_0x4ed5e9[_0x26a1('0x8')][_0x32bcca]['lastPauseAt']=moment()['format'](_0x26a1('0x29'));_0x4ed5e9[_0x26a1('0x8')][_0x32bcca]['uniqueid']=_0x180343;_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x18')]=_0x3d4163;_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x2a')]=function(){var _0x5c6751=getDiff(_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x2b')]);clearTimeout(_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x28')]);_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x28')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x5c6751},_0x4ed5e9[_0x26a1('0x8')][_0x32bcca][_0x26a1('0x2c')],_0x32bcca)[_0x26a1('0x1f')](function(_0x39dac0){logger[_0x26a1('0x21')](_0x26a1('0x2d'),_0x180343,_0x5c6751,_0x39dac0);})[_0x26a1('0x2e')](function(_0x2a6a04){logger[_0x26a1('0x2f')](_0x26a1('0x30'),_0x180343,_0x2a6a04);});delete _0x4ed5e9[_0x26a1('0x8')][_0x32bcca];};}});}else{logger['info'](_0x26a1('0x31'),_0x180343,_0x32bcca,_0x3d4163);}});}})[_0x26a1('0x2e')](function(_0x7b2b7d){logger[_0x26a1('0x2f')](_0x26a1('0x26'),_0x180343,_0x4ed5e9[_0x26a1('0x6')][_0x3d4163][_0x26a1('0x27')],_0x32bcca,_0x3d4163);})[_0x26a1('0x32')](function(){delete _0x4ed5e9[_0x26a1('0x9')][_0x180343];});}catch(_0x39cc85){logger['error']('[ACW][START]\x20%s',_0x39cc85['message']);}};Acw['prototype']['stopAcw']=function(_0x357b85){try{var _0x4f52af=this;if(_0x4f52af[_0x26a1('0x8')][_0x357b85]){_0x4f52af[_0x26a1('0x8')][_0x357b85][_0x26a1('0x28')]=![];var _0x3a6136=_0x4f52af[_0x26a1('0x8')][_0x357b85][_0x26a1('0x2c')];var _0x1de1e0=_0x4f52af[_0x26a1('0x8')][_0x357b85][_0x26a1('0x18')];var _0x5eae97=_0x4f52af[_0x26a1('0x6')][_0x1de1e0][_0x26a1('0x27')];logger[_0x26a1('0x21')](_0x26a1('0x33'),_0x3a6136,_0x357b85);RpcUser[_0x26a1('0x34')](this[_0x26a1('0x7')][_0x357b85]);RpcVoiceAgentReport[_0x26a1('0x35')]({'acwtime':_0x5eae97,'agentacw':!![]},_0x3a6136,_0x357b85)[_0x26a1('0x1f')](function(_0x4f36df){logger[_0x26a1('0x21')](_0x26a1('0x2d'),_0x3a6136,_0x5eae97,_0x4f36df);})[_0x26a1('0x2e')](function(_0x523fd1){logger[_0x26a1('0x2f')](_0x26a1('0x30'),_0x3a6136,_0x523fd1);});}else{logger[_0x26a1('0x2f')](_0x26a1('0x36'),_0x357b85);if(_0x4f52af['timers']){logger[_0x26a1('0x21')](_0x26a1('0x37'),JSON[_0x26a1('0x38')](_0x4f52af[_0x26a1('0x8')]));}}}catch(_0x268d19){logger[_0x26a1('0x2f')](_0x26a1('0x39'),_0x268d19[_0x26a1('0x3a')]);}};Acw['prototype']['syncAgentConnect']=function(_0x1b0348){try{if(this[_0x26a1('0x6')][_0x1b0348[_0x26a1('0x18')]]&&(this['voiceQueues'][_0x1b0348[_0x26a1('0x18')]]['acw']||this[_0x26a1('0x6')][_0x1b0348['queue']][_0x26a1('0x1a')])){if(this['agents'][_0x1b0348[_0x26a1('0x17')]]){this[_0x26a1('0x9')][_0x1b0348[_0x26a1('0x2c')]]={'queue':_0x1b0348[_0x26a1('0x18')],'interface':_0x1b0348[_0x26a1('0x17')],'destlinkedid':_0x1b0348[_0x26a1('0x24')]};}}}catch(_0x16850b){logger['error'](_0x26a1('0x3b'),_0x16850b[_0x26a1('0x3a')]);}};Acw['prototype'][_0x26a1('0x3c')]=function(_0x454a85){try{if(this[_0x26a1('0x6')][_0x454a85[_0x26a1('0x18')]]&&(this[_0x26a1('0x6')][_0x454a85[_0x26a1('0x18')]][_0x26a1('0x3d')]||this['voiceQueues'][_0x454a85['queue']]['mandatoryDisposition'])){if(this[_0x26a1('0x7')][_0x454a85[_0x26a1('0x17')]]){this[_0x26a1('0x9')][_0x454a85['uniqueid']]={'queue':_0x454a85[_0x26a1('0x18')],'interface':_0x454a85[_0x26a1('0x17')]};}}}catch(_0xca271d){logger['error'](_0x26a1('0x3e'),_0xca271d[_0x26a1('0x3a')]);}};Acw[_0x26a1('0x3f')][_0x26a1('0x40')]=function(_0x2fbc1f){try{if(this[_0x26a1('0x9')][_0x2fbc1f['uniqueid']]&&_['isUndefined'](this[_0x26a1('0x9')][_0x2fbc1f['uniqueid']][_0x26a1('0x23')])){logger[_0x26a1('0x21')](_0x26a1('0x41'),_0x2fbc1f[_0x26a1('0x2c')]);this[_0x26a1('0x16')](_0x2fbc1f[_0x26a1('0x2c')]);}else if(this[_0x26a1('0x9')][_0x2fbc1f[_0x26a1('0x42')]]&&_[_0x26a1('0x43')](this[_0x26a1('0x9')][_0x2fbc1f['linkedid']][_0x26a1('0x23')])){logger[_0x26a1('0x21')]('[%s][HANGUP:LINKEDID]',_0x2fbc1f[_0x26a1('0x42')]);this[_0x26a1('0x16')](_0x2fbc1f['linkedid']);}}catch(_0xdc576f){logger[_0x26a1('0x2f')](_0x26a1('0x44'),_0xdc576f[_0x26a1('0x3a')]);}};Acw['prototype'][_0x26a1('0xd')]=function(_0x2f0914){try{if(this[_0x26a1('0x9')][_0x2f0914['uniqueid']]&&this[_0x26a1('0x9')][_0x2f0914[_0x26a1('0x2c')]][_0x26a1('0x23')]){logger[_0x26a1('0x21')](_0x26a1('0x45'),_0x2f0914[_0x26a1('0x2c')]);this[_0x26a1('0x16')](_0x2f0914['uniqueid']);}else if(this[_0x26a1('0x9')][_0x2f0914[_0x26a1('0x42')]]&&this[_0x26a1('0x9')][_0x2f0914['linkedid']]['attended']){logger[_0x26a1('0x21')](_0x26a1('0x46'),_0x2f0914[_0x26a1('0x42')]);this['startAcw'](_0x2f0914[_0x26a1('0x42')]);}}catch(_0x1a2d69){logger['error'](_0x26a1('0x47'),_0x1a2d69[_0x26a1('0x3a')]);}};Acw[_0x26a1('0x3f')]['syncAttendedTransfer']=function(_0x213e3e){try{if(!_[_0x26a1('0x48')](this[_0x26a1('0x9')][_0x213e3e[_0x26a1('0x49')]])){this[_0x26a1('0x16')](_0x213e3e[_0x26a1('0x49')]);if(this[_0x26a1('0x9')][_0x213e3e['secondtransfereruniqueid']]){this[_0x26a1('0x9')][_0x213e3e['secondtransfereruniqueid']][_0x26a1('0x23')]=!![];this[_0x26a1('0x9')][_0x213e3e[_0x26a1('0x4a')]]=this['channels'][_0x213e3e[_0x26a1('0x4b')]];delete this[_0x26a1('0x9')][_0x213e3e['secondtransfereruniqueid']];}}else if(!_[_0x26a1('0x48')](this[_0x26a1('0x9')][_0x213e3e[_0x26a1('0x4a')]])){this[_0x26a1('0x16')](_0x213e3e[_0x26a1('0x4a')]);if(this['channels'][_0x213e3e[_0x26a1('0x4c')]]){this[_0x26a1('0x9')][_0x213e3e[_0x26a1('0x4c')]][_0x26a1('0x23')]=!![];this[_0x26a1('0x9')][_0x213e3e['transfereeuniqueid']]=this[_0x26a1('0x9')][_0x213e3e[_0x26a1('0x4c')]];delete this[_0x26a1('0x9')][_0x213e3e[_0x26a1('0x4c')]];}}}catch(_0x72fdc9){logger[_0x26a1('0x2f')]('[ACW][syncAttendedTransfer]\x20%s',_0x72fdc9['message']);}};Acw[_0x26a1('0x3f')][_0x26a1('0x11')]=function(_0x2967c1){try{if(this['channels'][_0x2967c1[_0x26a1('0x4d')]]){logger[_0x26a1('0x21')](_0x26a1('0x4e'),JSON['stringify'](_0x2967c1[_0x26a1('0x4d')]));this['startAcw'](_0x2967c1[_0x26a1('0x4d')]);}else if(this[_0x26a1('0x9')][_0x2967c1[_0x26a1('0x4f')]]){logger[_0x26a1('0x21')](_0x26a1('0x50'),JSON[_0x26a1('0x38')](_0x2967c1[_0x26a1('0x4f')]));this[_0x26a1('0x16')](_0x2967c1[_0x26a1('0x4f')]);}}catch(_0x48f5b2){logger[_0x26a1('0x2f')](_0x26a1('0x51'),_0x48f5b2['message']);}};Acw[_0x26a1('0x3f')][_0x26a1('0xf')]=function(_0x13c641){try{if(this['voiceQueues'][_0x13c641[_0x26a1('0x18')]]&&this[_0x26a1('0x6')][_0x13c641[_0x26a1('0x18')]][_0x26a1('0x52')]==='all'){if(this[_0x26a1('0x7')][_0x13c641['interface']]){logger[_0x26a1('0x21')](_0x26a1('0x53'),_0x13c641[_0x26a1('0x2c')],_0x13c641[_0x26a1('0x17')],_0x13c641[_0x26a1('0x18')]);return RpcUser[_0x26a1('0x25')](this[_0x26a1('0x7')][_0x13c641[_0x26a1('0x17')]],'Auto-Pause',_0x13c641[_0x26a1('0x2c')]);}}}catch(_0x3b370b){logger[_0x26a1('0x2f')](_0x26a1('0x54'),_0x3b370b['message']);}};module['exports']=Acw;
\ No newline at end of file
+var _0x56e3=['destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','queue','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','acw','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','secondtransfereruniqueid','transfertargetuniqueid','transfereeuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','moment','../ami','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','interface','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x56e3,0x17f));var _0x356e=function(_0x3bed29,_0x445f70){_0x3bed29=_0x3bed29-0x0;var _0x397c29=_0x56e3[_0x3bed29];return _0x397c29;};'use strict';var util=require(_0x356e('0x0'));var _=require('lodash');var moment=require(_0x356e('0x1'));var ami=require(_0x356e('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x356e('0x3'));function Acw(_0x436b14){this[_0x356e('0x4')]=_0x436b14[_0x356e('0x4')];this['agents']=_0x436b14[_0x356e('0x5')];this[_0x356e('0x6')]=_0x436b14['timers'];this[_0x356e('0x7')]={};ami['on'](_0x356e('0x8'),this[_0x356e('0x9')][_0x356e('0xa')](this));ami['on'](_0x356e('0xb'),this[_0x356e('0xc')][_0x356e('0xa')](this));ami['on'](_0x356e('0xd'),this[_0x356e('0xe')][_0x356e('0xa')](this));ami['on'](_0x356e('0xf'),this[_0x356e('0x10')][_0x356e('0xa')](this));ami['on'](_0x356e('0x11'),this[_0x356e('0x12')]['bind'](this));ami['on'](_0x356e('0x13'),this[_0x356e('0x14')]['bind'](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x356e('0xa')](this));}function getDiff(_0x234b71){var _0x3e46aa=moment()[_0x356e('0x15')](0x0);var _0x1c62a1=moment(_0x234b71)['milliseconds'](0x0);return _0x3e46aa[_0x356e('0x16')](_0x1c62a1,_0x356e('0x17'));}Acw[_0x356e('0x18')][_0x356e('0x19')]=function(_0x1214f4){try{var _0x22c11e=this;var _0x4aacca=this[_0x356e('0x7')][_0x1214f4][_0x356e('0x1a')];var _0x250354=this[_0x356e('0x7')][_0x1214f4]['queue'];var _0x14918f=this[_0x356e('0x4')][_0x250354];var _0x346473=![];var _0x30f38a='ACW';if(_0x14918f[_0x356e('0x1b')]){if(_0x14918f[_0x356e('0x1c')][_0x356e('0x1d')]){_0x346473=!![];_0x30f38a=_0x14918f[_0x356e('0x1c')][_0x356e('0x1d')];}}ami[_0x356e('0x1e')]({'action':'QueuePause','interface':_0x4aacca,'paused':!![],'reason':_0x30f38a})[_0x356e('0x1f')](function(_0x338ca5){if(_0x22c11e[_0x356e('0x5')][_0x4aacca]){return RpcUser[_0x356e('0x20')](_0x22c11e[_0x356e('0x5')][_0x4aacca]['id'])[_0x356e('0x1f')](function(_0x26c82c){if(_0x26c82c&&!_0x26c82c[_0x356e('0x21')]){logger[_0x356e('0x22')](_0x356e('0x23'),_0x1214f4,_0x4aacca,_0x250354);var _0xac4dd2=_0x22c11e[_0x356e('0x7')][_0x1214f4][_0x356e('0x24')]&&_0x22c11e[_0x356e('0x7')][_0x1214f4][_0x356e('0x25')]?_0x22c11e[_0x356e('0x7')][_0x1214f4][_0x356e('0x25')]:_0x1214f4;return RpcUser[_0x356e('0x26')](_0x22c11e['agents'][_0x4aacca],_0x30f38a,_0xac4dd2)[_0x356e('0x1f')](function(_0x50b00b){if(!_0x346473){_0x22c11e[_0x356e('0x6')][_0x4aacca]={};logger[_0x356e('0x22')](_0x356e('0x27'),_0x1214f4,_0x22c11e[_0x356e('0x4')][_0x250354][_0x356e('0x28')],_0x4aacca,_0x250354);_0x22c11e['timers'][_0x4aacca][_0x356e('0x29')]=setTimeout(_0x22c11e[_0x356e('0x2a')][_0x356e('0xa')](_0x22c11e,_0x4aacca),_0x22c11e[_0x356e('0x4')][_0x250354][_0x356e('0x28')]*0x3e8);_0x22c11e[_0x356e('0x6')][_0x4aacca][_0x356e('0x2b')]=moment()[_0x356e('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');_0x22c11e[_0x356e('0x6')][_0x4aacca][_0x356e('0x2d')]=_0x1214f4;_0x22c11e['timers'][_0x4aacca][_0x356e('0x2e')]=_0x250354;_0x22c11e[_0x356e('0x6')][_0x4aacca][_0x356e('0x2f')]=function(){var _0x5142a6=getDiff(_0x22c11e[_0x356e('0x6')][_0x4aacca][_0x356e('0x2b')]);clearTimeout(_0x22c11e[_0x356e('0x6')][_0x4aacca][_0x356e('0x29')]);_0x22c11e[_0x356e('0x6')][_0x4aacca]['timer']=![];RpcVoiceAgentReport[_0x356e('0x30')]({'acwtime':_0x5142a6},_0x22c11e[_0x356e('0x6')][_0x4aacca][_0x356e('0x2d')],_0x4aacca)['then'](function(_0xfbb9ef){logger[_0x356e('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x1214f4,_0x5142a6,_0xfbb9ef);})[_0x356e('0x31')](function(_0x16ccb1){logger[_0x356e('0x32')](_0x356e('0x33'),_0x1214f4,_0x16ccb1);});delete _0x22c11e[_0x356e('0x6')][_0x4aacca];};}});}else{logger[_0x356e('0x22')](_0x356e('0x34'),_0x1214f4,_0x4aacca,_0x250354);}});}})[_0x356e('0x31')](function(_0x4b5689){logger[_0x356e('0x32')](_0x356e('0x27'),_0x1214f4,_0x22c11e[_0x356e('0x4')][_0x250354][_0x356e('0x28')],_0x4aacca,_0x250354);})[_0x356e('0x35')](function(){delete _0x22c11e['channels'][_0x1214f4];});}catch(_0xbcc5d8){logger[_0x356e('0x32')](_0x356e('0x36'),_0xbcc5d8[_0x356e('0x37')]);}};Acw[_0x356e('0x18')][_0x356e('0x2a')]=function(_0xe11290){try{var _0x4a55e7=this;if(_0x4a55e7['timers'][_0xe11290]){_0x4a55e7[_0x356e('0x6')][_0xe11290][_0x356e('0x29')]=![];var _0x3fbf9c=_0x4a55e7[_0x356e('0x6')][_0xe11290]['uniqueid'];var _0x257ade=_0x4a55e7[_0x356e('0x6')][_0xe11290][_0x356e('0x2e')];var _0x5f1bcc=_0x4a55e7[_0x356e('0x4')][_0x257ade][_0x356e('0x28')];logger[_0x356e('0x22')](_0x356e('0x38'),_0x3fbf9c,_0xe11290);RpcUser['saveUnpause'](this['agents'][_0xe11290]);RpcVoiceAgentReport[_0x356e('0x30')]({'acwtime':_0x5f1bcc,'agentacw':!![]},_0x3fbf9c,_0xe11290)[_0x356e('0x1f')](function(_0x530007){logger[_0x356e('0x22')](_0x356e('0x39'),_0x3fbf9c,_0x5f1bcc,_0x530007);})[_0x356e('0x31')](function(_0x4b479c){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x3fbf9c,_0x4b479c);});}else{logger[_0x356e('0x32')](_0x356e('0x3a'),_0xe11290);if(_0x4a55e7[_0x356e('0x6')]){logger[_0x356e('0x22')]('[ACW][TIMERS]',JSON[_0x356e('0x3b')](_0x4a55e7[_0x356e('0x6')]));}}}catch(_0x4796a6){logger['error']('[ACW][STOP]\x20%s',_0x4796a6[_0x356e('0x37')]);}};Acw[_0x356e('0x18')]['syncAgentConnect']=function(_0x2ba9de){try{if(this[_0x356e('0x4')][_0x2ba9de[_0x356e('0x2e')]]&&(this[_0x356e('0x4')][_0x2ba9de[_0x356e('0x2e')]][_0x356e('0x3c')]||this['voiceQueues'][_0x2ba9de['queue']]['mandatoryDisposition'])){if(this[_0x356e('0x5')][_0x2ba9de[_0x356e('0x1a')]]){this[_0x356e('0x7')][_0x2ba9de[_0x356e('0x2d')]]={'queue':_0x2ba9de[_0x356e('0x2e')],'interface':_0x2ba9de[_0x356e('0x1a')],'destlinkedid':_0x2ba9de['destlinkedid']};}}}catch(_0x2d7292){logger[_0x356e('0x32')](_0x356e('0x3d'),_0x2d7292[_0x356e('0x37')]);}};Acw[_0x356e('0x18')][_0x356e('0x3e')]=function(_0x106156){try{if(this[_0x356e('0x4')][_0x106156[_0x356e('0x2e')]]&&(this[_0x356e('0x4')][_0x106156['queue']][_0x356e('0x3c')]||this['voiceQueues'][_0x106156['queue']][_0x356e('0x1b')])){if(this[_0x356e('0x5')][_0x106156['interface']]){this[_0x356e('0x7')][_0x106156['uniqueid']]={'queue':_0x106156[_0x356e('0x2e')],'interface':_0x106156[_0x356e('0x1a')]};}}}catch(_0x247720){logger[_0x356e('0x32')](_0x356e('0x3f'),_0x247720[_0x356e('0x37')]);}};Acw[_0x356e('0x18')][_0x356e('0xc')]=function(_0x21bf8a){try{if(this['channels'][_0x21bf8a['uniqueid']]&&_[_0x356e('0x40')](this['channels'][_0x21bf8a[_0x356e('0x2d')]]['attended'])){logger[_0x356e('0x22')](_0x356e('0x41'),_0x21bf8a[_0x356e('0x2d')]);this[_0x356e('0x19')](_0x21bf8a[_0x356e('0x2d')]);}else if(this['channels'][_0x21bf8a[_0x356e('0x42')]]&&_[_0x356e('0x40')](this[_0x356e('0x7')][_0x21bf8a[_0x356e('0x42')]][_0x356e('0x24')])){logger['info'](_0x356e('0x43'),_0x21bf8a[_0x356e('0x42')]);this[_0x356e('0x19')](_0x21bf8a[_0x356e('0x42')]);}}catch(_0x4b0333){logger[_0x356e('0x32')](_0x356e('0x44'),_0x4b0333[_0x356e('0x37')]);}};Acw[_0x356e('0x18')][_0x356e('0xe')]=function(_0x22ffd5){try{if(this['channels'][_0x22ffd5['uniqueid']]&&this[_0x356e('0x7')][_0x22ffd5[_0x356e('0x2d')]][_0x356e('0x24')]){logger[_0x356e('0x22')](_0x356e('0x45'),_0x22ffd5['uniqueid']);this[_0x356e('0x19')](_0x22ffd5[_0x356e('0x2d')]);}else if(this[_0x356e('0x7')][_0x22ffd5[_0x356e('0x42')]]&&this[_0x356e('0x7')][_0x22ffd5[_0x356e('0x42')]]['attended']){logger[_0x356e('0x22')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x22ffd5['linkedid']);this['startAcw'](_0x22ffd5[_0x356e('0x42')]);}}catch(_0x111c05){logger[_0x356e('0x32')](_0x356e('0x46'),_0x111c05[_0x356e('0x37')]);}};Acw[_0x356e('0x18')][_0x356e('0x12')]=function(_0x8c9d2a){try{if(!_[_0x356e('0x47')](this[_0x356e('0x7')][_0x8c9d2a['transfereeuniqueid']])){this[_0x356e('0x19')](_0x8c9d2a['transfereeuniqueid']);if(this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x48')]]){this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x48')]]['attended']=!![];this['channels'][_0x8c9d2a[_0x356e('0x49')]]=this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x48')]];delete this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x48')]];}}else if(!_['isNil'](this[_0x356e('0x7')][_0x8c9d2a['transfertargetuniqueid']])){this[_0x356e('0x19')](_0x8c9d2a[_0x356e('0x49')]);if(this['channels'][_0x8c9d2a['origtransfereruniqueid']]){this[_0x356e('0x7')][_0x8c9d2a['origtransfereruniqueid']][_0x356e('0x24')]=!![];this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x4a')]]=this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x4b')]];delete this[_0x356e('0x7')][_0x8c9d2a[_0x356e('0x4b')]];}}}catch(_0x4765aa){logger[_0x356e('0x32')](_0x356e('0x4c'),_0x4765aa[_0x356e('0x37')]);}};Acw['prototype']['syncBlindTransfer']=function(_0x14d6ac){try{if(this[_0x356e('0x7')][_0x14d6ac[_0x356e('0x4d')]]){logger[_0x356e('0x22')](_0x356e('0x4e'),JSON[_0x356e('0x3b')](_0x14d6ac[_0x356e('0x4d')]));this[_0x356e('0x19')](_0x14d6ac[_0x356e('0x4d')]);}else if(this['channels'][_0x14d6ac[_0x356e('0x4f')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x14d6ac[_0x356e('0x4f')]));this['startAcw'](_0x14d6ac['transfererlinkedid']);}}catch(_0xf1430b){logger[_0x356e('0x32')](_0x356e('0x50'),_0xf1430b['message']);}};Acw[_0x356e('0x18')]['syncAgentRingNoAnswer']=function(_0x313c73){try{if(this[_0x356e('0x4')][_0x313c73[_0x356e('0x2e')]]&&this[_0x356e('0x4')][_0x313c73[_0x356e('0x2e')]][_0x356e('0x51')]==='all'){if(this[_0x356e('0x5')][_0x313c73[_0x356e('0x1a')]]){logger[_0x356e('0x22')](_0x356e('0x52'),_0x313c73[_0x356e('0x2d')],_0x313c73[_0x356e('0x1a')],_0x313c73[_0x356e('0x2e')]);return RpcUser[_0x356e('0x26')](this[_0x356e('0x5')][_0x313c73[_0x356e('0x1a')]],_0x356e('0x53'),_0x313c73[_0x356e('0x2d')]);}}}catch(_0x120ce3){logger[_0x356e('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x120ce3['message']);}};module['exports']=Acw;
\ No newline at end of file
index ee42d4d..8350b36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x578e=['actionSipShowRegistry','actionQueueSummary','log','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','username','password','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','resolve','then'];(function(_0x57643b,_0x215ab4){var _0x402345=function(_0x242242){while(--_0x242242){_0x57643b['push'](_0x57643b['shift']());}};_0x402345(++_0x215ab4);}(_0x578e,0x1b1));var _0xe578=function(_0x1db9d2,_0x48b09b){_0x1db9d2=_0x1db9d2-0x0;var _0x38c2ae=_0x578e[_0x1db9d2];return _0x38c2ae;};'use strict';var Manager=require(_0xe578('0x0'));var BPromise=require(_0xe578('0x1'));var moment=require(_0xe578('0x2'));var util=require(_0xe578('0x3'));var _=require(_0xe578('0x4'));var logger=require(_0xe578('0x5'))(_0xe578('0x6'));var config=require('../../config/environment');var ami=new Manager(config[_0xe578('0x7')]['port'],config[_0xe578('0x7')]['ip'],config[_0xe578('0x7')][_0xe578('0x8')],config[_0xe578('0x7')][_0xe578('0x9')],!![]);ami['keepConnected']();ami[_0xe578('0xa')]=BPromise[_0xe578('0xb')](ami[_0xe578('0xc')]);function error(_0x409d41){logger[_0xe578('0xd')](util[_0xe578('0xe')](_0xe578('0xf'),config[_0xe578('0x7')][_0xe578('0x8')],config[_0xe578('0x7')]['ip'],config[_0xe578('0x7')][_0xe578('0x10')],util[_0xe578('0x11')](_0x409d41,![],null)));}function close(){logger[_0xe578('0xd')](util[_0xe578('0xe')](_0xe578('0x12'),config[_0xe578('0x7')][_0xe578('0x8')],config[_0xe578('0x7')]['ip'],config[_0xe578('0x7')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe578('0xa')]({'action':_0xe578('0x13')});};};ami[_0xe578('0x14')]=function(){return function(){return ami[_0xe578('0xa')]({'action':_0xe578('0x15')});};};ami[_0xe578('0x16')]=function(){return function(){return ami[_0xe578('0xa')]({'action':_0xe578('0x17')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0xe578('0x18')});};};ami[_0xe578('0x19')]=function(){return function(){return ami[_0xe578('0xa')]({'action':'coreshowchannels'});};};function connect(_0x316ca8){logger[_0xe578('0x1a')](util['format'](_0xe578('0x1b'),config[_0xe578('0x7')][_0xe578('0x8')],config['asterisk']['ip'],config[_0xe578('0x7')][_0xe578('0x10')]));ami[_0xe578('0x1c')](_0xe578('0xd'),error);ami['once'](_0xe578('0x1d'),close);}ami['on'](_0xe578('0x1e'),connect);ami['on'](_0xe578('0x1f'),function(_0x4b92f2){logger['info'](util[_0xe578('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xe578('0x7')][_0xe578('0x8')],config[_0xe578('0x7')]['ip'],config[_0xe578('0x7')][_0xe578('0x10')],util[_0xe578('0x11')](_0x4b92f2,![],null)));});ami['on'](_0xe578('0x20'),function(_0x4c0b4f){logger[_0xe578('0x1a')](util[_0xe578('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0xe578('0x8')],config[_0xe578('0x7')]['ip'],config[_0xe578('0x7')][_0xe578('0x10')]));return BPromise[_0xe578('0x21')]()[_0xe578('0x22')](ami[_0xe578('0x23')]())[_0xe578('0x22')](ami[_0xe578('0x14')]())[_0xe578('0x22')](ami[_0xe578('0x16')]())[_0xe578('0x22')](ami[_0xe578('0x24')]())[_0xe578('0x22')](ami[_0xe578('0x19')]())['catch'](function(_0x432603){console[_0xe578('0x25')](_0x432603);});});ami[_0xe578('0x1c')](_0xe578('0xd'),error);ami[_0xe578('0x1c')](_0xe578('0x1d'),close);module[_0xe578('0x26')]=ami;
\ No newline at end of file
+var _0x8d05=['resolve','then','catch','log','close','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','port','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','error','info','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x5b8ff3,_0x2b2a26){var _0x18236b=function(_0xe35960){while(--_0xe35960){_0x5b8ff3['push'](_0x5b8ff3['shift']());}};_0x18236b(++_0x2b2a26);}(_0x8d05,0xa6));var _0x58d0=function(_0x36c87a,_0x440257){_0x36c87a=_0x36c87a-0x0;var _0x238095=_0x8d05[_0x36c87a];return _0x238095;};'use strict';var Manager=require(_0x58d0('0x0'));var BPromise=require(_0x58d0('0x1'));var moment=require(_0x58d0('0x2'));var util=require(_0x58d0('0x3'));var _=require(_0x58d0('0x4'));var logger=require(_0x58d0('0x5'))(_0x58d0('0x6'));var config=require(_0x58d0('0x7'));var ami=new Manager(config['asterisk']['port'],config[_0x58d0('0x8')]['ip'],config['asterisk'][_0x58d0('0x9')],config[_0x58d0('0x8')][_0x58d0('0xa')],!![]);ami[_0x58d0('0xb')]();ami[_0x58d0('0xc')]=BPromise[_0x58d0('0xd')](ami[_0x58d0('0xe')]);function error(_0x5a785c){logger['error'](util[_0x58d0('0xf')](_0x58d0('0x10'),config[_0x58d0('0x8')]['username'],config[_0x58d0('0x8')]['ip'],config['asterisk']['port'],util['inspect'](_0x5a785c,![],null)));}function close(){logger['error'](util[_0x58d0('0xf')](_0x58d0('0x11'),config[_0x58d0('0x8')][_0x58d0('0x9')],config['asterisk']['ip'],config['asterisk'][_0x58d0('0x12')]));}ami[_0x58d0('0x13')]=function(){return function(){return ami[_0x58d0('0xc')]({'action':_0x58d0('0x14')});};};ami[_0x58d0('0x15')]=function(){return function(){return ami['Action']({'action':_0x58d0('0x16')});};};ami[_0x58d0('0x17')]=function(){return function(){return ami[_0x58d0('0xc')]({'action':_0x58d0('0x18')});};};ami[_0x58d0('0x19')]=function(){return function(){return ami[_0x58d0('0xc')]({'action':_0x58d0('0x1a')});};};ami[_0x58d0('0x1b')]=function(){return function(){return ami['Action']({'action':_0x58d0('0x1c')});};};function connect(_0x513b63){logger['info'](util[_0x58d0('0xf')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x58d0('0x8')]['username'],config[_0x58d0('0x8')]['ip'],config[_0x58d0('0x8')]['port']));ami[_0x58d0('0x1d')](_0x58d0('0x1e'),error);ami[_0x58d0('0x1d')]('close',close);}ami['on']('connect',connect);ami['on']('shutdown',function(_0x1c6c71){logger[_0x58d0('0x1f')](util[_0x58d0('0xf')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk']['username'],config[_0x58d0('0x8')]['ip'],config[_0x58d0('0x8')][_0x58d0('0x12')],util['inspect'](_0x1c6c71,![],null)));});ami['on'](_0x58d0('0x20'),function(_0x3497b0){logger['info'](util[_0x58d0('0xf')](_0x58d0('0x21'),config['asterisk'][_0x58d0('0x9')],config[_0x58d0('0x8')]['ip'],config['asterisk'][_0x58d0('0x12')]));return BPromise[_0x58d0('0x22')]()[_0x58d0('0x23')](ami[_0x58d0('0x13')]())[_0x58d0('0x23')](ami['actionDeviceStateList']())[_0x58d0('0x23')](ami[_0x58d0('0x17')]())[_0x58d0('0x23')](ami['actionQueueSummary']())[_0x58d0('0x23')](ami[_0x58d0('0x1b')]())[_0x58d0('0x24')](function(_0x2339c9){console[_0x58d0('0x25')](_0x2339c9);});});ami[_0x58d0('0x1d')](_0x58d0('0x1e'),error);ami[_0x58d0('0x1d')](_0x58d0('0x26'),close);module[_0x58d0('0x27')]=ami;
\ No newline at end of file
index 81265be..ccd6113 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client;
\ No newline at end of file
+var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x139b85,_0x5e0691){var _0x1e833f=function(_0xc97932){while(--_0xc97932){_0x139b85['push'](_0x139b85['shift']());}};_0x1e833f(++_0x5e0691);}(_0xac4a,0x13f));var _0xaac4=function(_0x3217b5,_0x47447a){_0x3217b5=_0x3217b5-0x0;var _0x55bb87=_0xac4a[_0x3217b5];return _0x55bb87;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client;
\ No newline at end of file
index 6b29968..91d3a16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d74=['voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','number','getQueue','exports','util','lodash','moment','isNil','string'];(function(_0x140e6d,_0x3000a2){var _0x4e5cb2=function(_0x4d20ee){while(--_0x4d20ee){_0x140e6d['push'](_0x140e6d['shift']());}};_0x4e5cb2(++_0x3000a2);}(_0x8d74,0x121));var _0x48d7=function(_0x2fbe2e,_0x44dc35){_0x2fbe2e=_0x2fbe2e-0x0;var _0x56f599=_0x8d74[_0x2fbe2e];return _0x56f599;};'use strict';var util=require(_0x48d7('0x0'));var _=require(_0x48d7('0x1'));var moment=require(_0x48d7('0x2'));function checkNameSurname(_0x25a364,_0x7e06eb,_0x1c7b39){var _0x3a6aaa='';if(!_[_0x48d7('0x3')](_0x7e06eb)&&_0x48d7('0x4')===typeof _0x7e06eb){_0x3a6aaa+=_0x7e06eb;}if(!_[_0x48d7('0x3')](_0x1c7b39)&&_0x48d7('0x4')===typeof _0x1c7b39){_0x3a6aaa+='\x20'+_0x1c7b39;}if(_0x3a6aaa!==''){return _0x3a6aaa;}return _0x25a364;}function Action(_0x1f957f,_0x19e784,_0x94fcc0){this[_0x48d7('0x5')]=_0x1f957f;this[_0x48d7('0x6')]=_0x94fcc0||undefined;this[_0x48d7('0x7')]=checkNameSurname(_0x19e784[_0x48d7('0x8')][_0x48d7('0x9')],_0x19e784['Contact'][_0x48d7('0xa')],_0x19e784[_0x48d7('0x8')][_0x48d7('0xb')]);this['number']=_0x19e784['Contact']['phone'];this[_0x48d7('0xc')]=_0x1f957f[_0x48d7('0x7')];this[_0x48d7('0xd')]=_0x19e784['active']||![];this[_0x48d7('0xe')]=_0x1f957f[_0x48d7('0xe')];this['dialQueueTimeout']=_0x1f957f[_0x48d7('0xf')]||0x3;this[_0x48d7('0x10')]=_0x19e784[_0x48d7('0x10')];this[_0x48d7('0x11')]=_0x19e784[_0x48d7('0x11')];this[_0x48d7('0x12')]=_0x19e784[_0x48d7('0x12')];this[_0x48d7('0x13')]=_0x19e784[_0x48d7('0x13')];this[_0x48d7('0x14')]=_0x19e784[_0x48d7('0x14')];this[_0x48d7('0x15')]=_0x19e784[_0x48d7('0x15')];this['countabandonedretry']=_0x19e784[_0x48d7('0x16')];this['countmachineretry']=_0x19e784[_0x48d7('0x17')];this[_0x48d7('0x18')]=_0x19e784['countagentrejectretry'];this['ContactId']=_0x19e784[_0x48d7('0x19')];this['ListId']=_0x19e784[_0x48d7('0x1a')];this[_0x48d7('0x1b')]=_0x19e784[_0x48d7('0x1b')];this[_0x48d7('0x1c')]=_0x19e784['VoiceQueueId'];this['CampaignId']=_0x19e784[_0x48d7('0x1d')];this[_0x48d7('0x1e')]=_0x19e784['id'];this[_0x48d7('0x1f')]=_0x19e784[_0x48d7('0x8')][_0x48d7('0xa')]||'';this[_0x48d7('0x20')]=moment()['format'](_0x48d7('0x21'));this[_0x48d7('0x22')]=_0x19e784[_0x48d7('0x22')];this[_0x48d7('0x23')]=_0x19e784['callbackuniqueid'];this[_0x48d7('0x24')]=_0x19e784[_0x48d7('0x24')];this[_0x48d7('0x25')]=_0x19e784['recallme'];this[_0x48d7('0x26')]='';this[_0x48d7('0x27')]='';}Action[_0x48d7('0x28')][_0x48d7('0x29')]=function(){return util[_0x48d7('0x2a')](_0x48d7('0x2b'),this[_0x48d7('0x7')],this[_0x48d7('0x5')][_0x48d7('0x2c')]>0x0?this['number'][_0x48d7('0x2d')](this[_0x48d7('0x5')][_0x48d7('0x2c')]):this[_0x48d7('0x2e')]);};Action[_0x48d7('0x28')][_0x48d7('0x2f')]=function(){return this[_0x48d7('0xc')];};module[_0x48d7('0x30')]=Action;
\ No newline at end of file
+var _0x8553=['isNil','string','voiceQueue','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','exports','lodash','moment'];(function(_0x2d2fcf,_0x5cfc08){var _0x4d0238=function(_0x527f9c){while(--_0x527f9c){_0x2d2fcf['push'](_0x2d2fcf['shift']());}};_0x4d0238(++_0x5cfc08);}(_0x8553,0x181));var _0x3855=function(_0xf8e27c,_0x47790d){_0xf8e27c=_0xf8e27c-0x0;var _0x1e3049=_0x8553[_0xf8e27c];return _0x1e3049;};'use strict';var util=require('util');var _=require(_0x3855('0x0'));var moment=require(_0x3855('0x1'));function checkNameSurname(_0x47bed1,_0x3a26ef,_0x2d2d83){var _0x1d88ec='';if(!_[_0x3855('0x2')](_0x3a26ef)&&_0x3855('0x3')===typeof _0x3a26ef){_0x1d88ec+=_0x3a26ef;}if(!_[_0x3855('0x2')](_0x2d2d83)&&_0x3855('0x3')===typeof _0x2d2d83){_0x1d88ec+='\x20'+_0x2d2d83;}if(_0x1d88ec!==''){return _0x1d88ec;}return _0x47bed1;}function Action(_0x5baab4,_0x40e25a,_0x55097a){this[_0x3855('0x4')]=_0x5baab4;this['uniqueid']=_0x55097a||undefined;this[_0x3855('0x5')]=checkNameSurname(_0x40e25a[_0x3855('0x6')]['phone'],_0x40e25a[_0x3855('0x6')][_0x3855('0x7')],_0x40e25a[_0x3855('0x6')][_0x3855('0x8')]);this[_0x3855('0x9')]=_0x40e25a['Contact'][_0x3855('0xa')];this[_0x3855('0xb')]=_0x5baab4['name'];this[_0x3855('0xc')]=_0x40e25a[_0x3855('0xc')]||![];this[_0x3855('0xd')]=_0x5baab4[_0x3855('0xd')];this['dialQueueTimeout']=_0x5baab4[_0x3855('0xe')]||0x3;this[_0x3855('0xf')]=_0x40e25a[_0x3855('0xf')];this[_0x3855('0x10')]=_0x40e25a[_0x3855('0x10')];this['countcongestionretry']=_0x40e25a[_0x3855('0x11')];this[_0x3855('0x12')]=_0x40e25a['countnoanswerretry'];this['countnosuchnumberretry']=_0x40e25a[_0x3855('0x13')];this[_0x3855('0x14')]=_0x40e25a[_0x3855('0x14')];this['countabandonedretry']=_0x40e25a[_0x3855('0x15')];this[_0x3855('0x16')]=_0x40e25a[_0x3855('0x16')];this['countagentrejectretry']=_0x40e25a[_0x3855('0x17')];this[_0x3855('0x18')]=_0x40e25a['ContactId'];this[_0x3855('0x19')]=_0x40e25a['ListId'];this[_0x3855('0x1a')]=_0x40e25a[_0x3855('0x1a')];this[_0x3855('0x1b')]=_0x40e25a[_0x3855('0x1b')];this[_0x3855('0x1c')]=_0x40e25a[_0x3855('0x1c')];this[_0x3855('0x1d')]=_0x40e25a['id'];this[_0x3855('0x1e')]=_0x40e25a[_0x3855('0x6')]['firstName']||'';this['starttime']=moment()[_0x3855('0x1f')](_0x3855('0x20'));this[_0x3855('0x21')]=_0x40e25a['callback'];this[_0x3855('0x22')]=_0x40e25a[_0x3855('0x22')];this[_0x3855('0x23')]=_0x40e25a[_0x3855('0x23')];this[_0x3855('0x24')]=_0x40e25a[_0x3855('0x24')];this[_0x3855('0x25')]='';this['originatecalleridname']='';}Action[_0x3855('0x26')][_0x3855('0x27')]=function(){return util[_0x3855('0x1f')](_0x3855('0x28'),this[_0x3855('0x5')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x3855('0x9')]['substring'](this['voiceQueue'][_0x3855('0x29')]):this[_0x3855('0x9')]);};Action[_0x3855('0x26')]['getQueue']=function(){return this[_0x3855('0xb')];};module[_0x3855('0x2a')]=Action;
\ No newline at end of file
index 41b44c8..65c7255 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10fe=['holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x230284,_0x1e5b98){var _0x379935=function(_0x17872a){while(--_0x17872a){_0x230284['push'](_0x230284['shift']());}};_0x379935(++_0x1e5b98);}(_0x10fe,0x159));var _0xe10f=function(_0x542f6a,_0x39e2fc){_0x542f6a=_0x542f6a-0x0;var _0xecdab5=_0x10fe[_0x542f6a];return _0xecdab5;};'use strict';var util=require(_0xe10f('0x0'));var _=require(_0xe10f('0x1'));var moment=require(_0xe10f('0x2'));function getSeconds(_0x5e506b,_0x2588b5){var _0xad2f19=moment(_0x5e506b)[_0xe10f('0x3')](0x0);var _0x317aaa=moment(_0x2588b5)['milliseconds'](0x0);return _0xad2f19[_0xe10f('0x4')](_0x317aaa,_0xe10f('0x5'));}function AgentComplete(_0x21a376,_0x53a3da){this[_0xe10f('0x6')]=0x4;this[_0xe10f('0x7')]=_0xe10f('0x8');this['scheduledat']=_0x21a376[_0xe10f('0x9')];this[_0xe10f('0xa')]=_0x21a376[_0xe10f('0xa')];this[_0xe10f('0xb')]=_0x21a376[_0xe10f('0xa')]===_0xe10f('0xc')?'queue':_0x21a376[_0xe10f('0xa')];this['countbusyretry']=_0x21a376[_0xe10f('0xd')];this['countcongestionretry']=_0x21a376[_0xe10f('0xe')];this[_0xe10f('0xf')]=_0x21a376[_0xe10f('0xf')];this['countglobal']=_0x21a376[_0xe10f('0xd')]+_0x21a376['countcongestionretry']+_0x21a376[_0xe10f('0xf')]+_0x21a376[_0xe10f('0x10')]+_0x21a376[_0xe10f('0x11')]+_0x21a376['countabandonedretry']+_0x21a376['countmachineretry']+_0x21a376[_0xe10f('0x12')];this[_0xe10f('0x10')]=_0x21a376[_0xe10f('0x10')];this[_0xe10f('0x11')]=_0x21a376['countdropretry'];this[_0xe10f('0x13')]=_0x21a376[_0xe10f('0x13')];this[_0xe10f('0x14')]=_0x21a376[_0xe10f('0x14')];this['countagentrejectretry']=_0x21a376[_0xe10f('0x12')];this['uniqueid']=_0x53a3da[_0xe10f('0x15')];this[_0xe10f('0x16')]=_0x21a376[_0xe10f('0x17')];this[_0xe10f('0x18')]=_0x21a376['number'];this[_0xe10f('0x19')]=_0x21a376['starttime'];this[_0xe10f('0x1a')]=_0x21a376['responsetime'];this['answertime']=_0x21a376[_0xe10f('0x1b')];this[_0xe10f('0x1c')]=moment()[_0xe10f('0x1d')](_0xe10f('0x1e'));this['ringtime']=getSeconds(_0x21a376['responsetime'],_0x21a376[_0xe10f('0x19')]);this[_0xe10f('0x1f')]=getSeconds(_0x21a376['answertime'],_0x21a376['responsetime']);this['talktime']=getSeconds(this['endtime'],_0x21a376[_0xe10f('0x1b')]);this['queue']=_0x53a3da[_0xe10f('0x20')];this[_0xe10f('0x21')]=_0x53a3da['membername'];this[_0xe10f('0x22')]=_0x53a3da[_0xe10f('0x22')];this[_0xe10f('0x23')]=_0x21a376[_0xe10f('0x23')];this[_0xe10f('0x24')]=_0x21a376[_0xe10f('0x24')];this[_0xe10f('0x25')]=_0x21a376[_0xe10f('0x25')];this[_0xe10f('0x26')]=_0x21a376[_0xe10f('0x26')];this[_0xe10f('0x27')]=_0x21a376[_0xe10f('0x27')];this['ListId']=_0x21a376[_0xe10f('0x28')];this[_0xe10f('0x29')]=_0x21a376[_0xe10f('0x29')];this['VoiceQueueId']=_0x21a376[_0xe10f('0x2a')];this[_0xe10f('0x2b')]=_0x21a376[_0xe10f('0x2b')];this[_0xe10f('0x2c')]=_0x21a376[_0xe10f('0x2c')]||'';this[_0xe10f('0x2d')]=_0x21a376[_0xe10f('0x2d')]||'';}module[_0xe10f('0x2e')]=AgentComplete;
\ No newline at end of file
+var _0xdc8b=['callbackuniqueid','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','campaigntype','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0xdc8b,0xe4));var _0xbdc8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdc8b[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0xbdc8('0x0'));var moment=require(_0xbdc8('0x1'));function getSeconds(_0x421f3d,_0x5a6909){var _0x52b1f1=moment(_0x421f3d)[_0xbdc8('0x2')](0x0);var _0x19222f=moment(_0x5a6909)[_0xbdc8('0x2')](0x0);return _0x52b1f1[_0xbdc8('0x3')](_0x19222f,_0xbdc8('0x4'));}function AgentComplete(_0x433e89,_0x1452a8){this[_0xbdc8('0x5')]=0x4;this[_0xbdc8('0x6')]=_0xbdc8('0x7');this['scheduledat']=_0x433e89['scheduledat'];this[_0xbdc8('0x8')]=_0x433e89[_0xbdc8('0x8')];this[_0xbdc8('0x9')]=_0x433e89[_0xbdc8('0x8')]==='outbound'?_0xbdc8('0xa'):_0x433e89[_0xbdc8('0x8')];this[_0xbdc8('0xb')]=_0x433e89[_0xbdc8('0xb')];this['countcongestionretry']=_0x433e89['countcongestionretry'];this[_0xbdc8('0xc')]=_0x433e89['countnoanswerretry'];this[_0xbdc8('0xd')]=_0x433e89['countbusyretry']+_0x433e89[_0xbdc8('0xe')]+_0x433e89[_0xbdc8('0xc')]+_0x433e89[_0xbdc8('0xf')]+_0x433e89[_0xbdc8('0x10')]+_0x433e89[_0xbdc8('0x11')]+_0x433e89['countmachineretry']+_0x433e89['countagentrejectretry'];this['countnosuchnumberretry']=_0x433e89['countnosuchnumberretry'];this[_0xbdc8('0x10')]=_0x433e89['countdropretry'];this[_0xbdc8('0x11')]=_0x433e89[_0xbdc8('0x11')];this[_0xbdc8('0x12')]=_0x433e89['countmachineretry'];this['countagentrejectretry']=_0x433e89[_0xbdc8('0x13')];this['uniqueid']=_0x1452a8[_0xbdc8('0x14')];this[_0xbdc8('0x15')]=_0x433e89[_0xbdc8('0x16')];this[_0xbdc8('0x17')]=_0x433e89[_0xbdc8('0x18')];this['starttime']=_0x433e89[_0xbdc8('0x19')];this[_0xbdc8('0x1a')]=_0x433e89[_0xbdc8('0x1a')];this[_0xbdc8('0x1b')]=_0x433e89[_0xbdc8('0x1b')];this[_0xbdc8('0x1c')]=moment()[_0xbdc8('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xbdc8('0x1e')]=getSeconds(_0x433e89[_0xbdc8('0x1a')],_0x433e89['starttime']);this[_0xbdc8('0x1f')]=getSeconds(_0x433e89[_0xbdc8('0x1b')],_0x433e89[_0xbdc8('0x1a')]);this[_0xbdc8('0x20')]=getSeconds(this[_0xbdc8('0x1c')],_0x433e89[_0xbdc8('0x1b')]);this['queue']=_0x1452a8[_0xbdc8('0xa')];this['membername']=_0x1452a8[_0xbdc8('0x21')];this[_0xbdc8('0x22')]=_0x1452a8['reason'];this[_0xbdc8('0x23')]=_0x433e89['callback'];this[_0xbdc8('0x24')]=_0x433e89[_0xbdc8('0x24')];this[_0xbdc8('0x25')]=_0x433e89['callbackat'];this['recallme']=_0x433e89['recallme'];this[_0xbdc8('0x26')]=_0x433e89[_0xbdc8('0x26')];this['ListId']=_0x433e89['ListId'];this[_0xbdc8('0x27')]=_0x433e89[_0xbdc8('0x27')];this['VoiceQueueId']=_0x433e89[_0xbdc8('0x28')];this[_0xbdc8('0x29')]=_0x433e89['CampaignId'];this[_0xbdc8('0x2a')]=_0x433e89[_0xbdc8('0x2a')]||'';this[_0xbdc8('0x2b')]=_0x433e89[_0xbdc8('0x2b')]||'';}module['exports']=AgentComplete;
\ No newline at end of file
index 30aa953..11fb72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2123=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x2123,0x190));var _0x3212=function(_0x86eb44,_0x1960f3){_0x86eb44=_0x86eb44-0x0;var _0x1f070b=_0x2123[_0x86eb44];return _0x1f070b;};'use strict';var util=require(_0x3212('0x0'));var _=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));function getSeconds(_0x3424c2,_0x7158b8){var _0x2ff863=moment(_0x3424c2)[_0x3212('0x3')](0x0);var _0x2e951f=moment(_0x7158b8)[_0x3212('0x3')](0x0);return _0x2ff863[_0x3212('0x4')](_0x2e951f,_0x3212('0x5'));}function Final(_0x265328){this['uniqueid']=_0x265328[_0x3212('0x6')];this[_0x3212('0x7')]=_0x265328[_0x3212('0x7')];this['type']=_0x265328[_0x3212('0x8')];this['campaigntype']=_0x265328[_0x3212('0x8')]===_0x3212('0x9')?_0x3212('0xa'):_0x265328[_0x3212('0x8')];this['countbusyretry']=_0x265328['countbusyretry'];this[_0x3212('0xb')]=_0x265328[_0x3212('0xb')];this[_0x3212('0xc')]=_0x265328[_0x3212('0xc')];this[_0x3212('0xd')]=_0x265328[_0x3212('0xe')]+_0x265328[_0x3212('0xb')]+_0x265328[_0x3212('0xc')]+_0x265328[_0x3212('0xf')]+_0x265328[_0x3212('0x10')]+_0x265328[_0x3212('0x11')]+_0x265328[_0x3212('0x12')]+_0x265328[_0x3212('0x13')];this[_0x3212('0xf')]=_0x265328[_0x3212('0xf')];this[_0x3212('0x10')]=_0x265328[_0x3212('0x10')];this[_0x3212('0x11')]=_0x265328[_0x3212('0x11')];this[_0x3212('0x12')]=_0x265328[_0x3212('0x12')];this[_0x3212('0x13')]=_0x265328['countagentrejectretry'];this[_0x3212('0xa')]=_0x265328[_0x3212('0xa')];this[_0x3212('0x14')]=_0x265328[_0x3212('0x14')];this[_0x3212('0x15')]=_0x265328[_0x3212('0x15')];this[_0x3212('0x16')]=_0x265328['starttime'];this['responsetime']=_0x265328[_0x3212('0x17')];this['endtime']=_0x265328[_0x3212('0x17')];this[_0x3212('0x18')]=_0x265328[_0x3212('0x18')]||0x0;this[_0x3212('0x19')]=_0x265328[_0x3212('0x19')]||0x0;this['talktime']=_0x265328[_0x3212('0x1a')]||0x0;this[_0x3212('0x1b')]=_0x265328['callback'];this[_0x3212('0x1c')]=_0x265328[_0x3212('0x1c')];this[_0x3212('0x1d')]=_0x265328['callbackat'];this['recallme']=_0x265328[_0x3212('0x1e')];this[_0x3212('0x1f')]=_0x265328[_0x3212('0x1f')];this[_0x3212('0x20')]=_0x265328[_0x3212('0x20')];this[_0x3212('0x21')]=_0x265328['UserId'];this['VoiceQueueId']=_0x265328[_0x3212('0x22')];this['CampaignId']=_0x265328[_0x3212('0x23')];this[_0x3212('0x24')]=_0x265328[_0x3212('0x24')]||'';this['originatecalleridname']=_0x265328[_0x3212('0x25')]||'';}module[_0x3212('0x26')]=Final;
\ No newline at end of file
+var _0x277c=['ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','responsetime','endtime'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x277c,0x153));var _0xc277=function(_0x1089fa,_0x4b4609){_0x1089fa=_0x1089fa-0x0;var _0x2004d0=_0x277c[_0x1089fa];return _0x2004d0;};'use strict';var util=require(_0xc277('0x0'));var _=require('lodash');var moment=require(_0xc277('0x1'));function getSeconds(_0x3420cf,_0x3cd265){var _0x21d6f2=moment(_0x3420cf)[_0xc277('0x2')](0x0);var _0x1fcae3=moment(_0x3cd265)[_0xc277('0x2')](0x0);return _0x21d6f2[_0xc277('0x3')](_0x1fcae3,'seconds');}function Final(_0x4bfaeb){this[_0xc277('0x4')]=_0x4bfaeb['uniqueid'];this[_0xc277('0x5')]=_0x4bfaeb['scheduledat'];this[_0xc277('0x6')]=_0x4bfaeb[_0xc277('0x6')];this['campaigntype']=_0x4bfaeb[_0xc277('0x6')]===_0xc277('0x7')?_0xc277('0x8'):_0x4bfaeb[_0xc277('0x6')];this[_0xc277('0x9')]=_0x4bfaeb[_0xc277('0x9')];this['countcongestionretry']=_0x4bfaeb['countcongestionretry'];this[_0xc277('0xa')]=_0x4bfaeb[_0xc277('0xa')];this[_0xc277('0xb')]=_0x4bfaeb[_0xc277('0x9')]+_0x4bfaeb['countcongestionretry']+_0x4bfaeb[_0xc277('0xa')]+_0x4bfaeb['countnosuchnumberretry']+_0x4bfaeb[_0xc277('0xc')]+_0x4bfaeb[_0xc277('0xd')]+_0x4bfaeb[_0xc277('0xe')]+_0x4bfaeb[_0xc277('0xf')];this['countnosuchnumberretry']=_0x4bfaeb[_0xc277('0x10')];this[_0xc277('0xc')]=_0x4bfaeb[_0xc277('0xc')];this['countabandonedretry']=_0x4bfaeb['countabandonedretry'];this[_0xc277('0xe')]=_0x4bfaeb['countmachineretry'];this[_0xc277('0xf')]=_0x4bfaeb['countagentrejectretry'];this[_0xc277('0x8')]=_0x4bfaeb[_0xc277('0x8')];this[_0xc277('0x11')]=_0x4bfaeb['calleridname'];this['calleridnum']=_0x4bfaeb[_0xc277('0x12')];this['starttime']=_0x4bfaeb['starttime'];this[_0xc277('0x13')]=_0x4bfaeb[_0xc277('0x13')];this[_0xc277('0x14')]=_0x4bfaeb[_0xc277('0x13')];this[_0xc277('0x15')]=_0x4bfaeb[_0xc277('0x15')]||0x0;this[_0xc277('0x16')]=_0x4bfaeb['holdtime']||0x0;this['talktime']=_0x4bfaeb[_0xc277('0x17')]||0x0;this[_0xc277('0x18')]=_0x4bfaeb[_0xc277('0x18')];this[_0xc277('0x19')]=_0x4bfaeb[_0xc277('0x19')];this[_0xc277('0x1a')]=_0x4bfaeb[_0xc277('0x1a')];this[_0xc277('0x1b')]=_0x4bfaeb[_0xc277('0x1b')];this[_0xc277('0x1c')]=_0x4bfaeb[_0xc277('0x1c')];this['ListId']=_0x4bfaeb[_0xc277('0x1d')];this[_0xc277('0x1e')]=_0x4bfaeb['UserId'];this[_0xc277('0x1f')]=_0x4bfaeb['VoiceQueueId'];this['CampaignId']=_0x4bfaeb[_0xc277('0x20')];this[_0xc277('0x21')]=_0x4bfaeb[_0xc277('0x21')]||'';this[_0xc277('0x22')]=_0x4bfaeb[_0xc277('0x22')]||'';}module[_0xc277('0x23')]=Final;
\ No newline at end of file
index 200ccca..790a8c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x734e=['CampaignId','exports','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','calleridnum','number','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','responsetime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x734e,0x13d));var _0xe734=function(_0x1cd51f,_0x297954){_0x1cd51f=_0x1cd51f-0x0;var _0x54208a=_0x734e[_0x1cd51f];return _0x54208a;};'use strict';var util=require('util');var _=require(_0xe734('0x0'));var moment=require(_0xe734('0x1'));function getSeconds(_0x3ac791,_0x23f613){var _0x2201df=moment(_0x3ac791)[_0xe734('0x2')](0x0);var _0x4ee4e8=moment(_0x23f613)[_0xe734('0x2')](0x0);return _0x2201df[_0xe734('0x3')](_0x4ee4e8,_0xe734('0x4'));}function Hangup(_0x2737eb,_0x875b53){this['state']=0x4;this['statedesc']=_0xe734('0x5');this[_0xe734('0x6')]=_0x2737eb[_0xe734('0x6')];this[_0xe734('0x7')]=_0x2737eb[_0xe734('0x7')];this[_0xe734('0x8')]=_0x2737eb[_0xe734('0x7')]===_0xe734('0x9')?_0xe734('0xa'):_0x2737eb[_0xe734('0x7')];this[_0xe734('0xb')]=_0x2737eb['countbusyretry'];this[_0xe734('0xc')]=_0x2737eb[_0xe734('0xc')];this[_0xe734('0xd')]=_0x2737eb['countnoanswerretry'];this[_0xe734('0xe')]=_0x2737eb[_0xe734('0xb')]+_0x2737eb['countcongestionretry']+_0x2737eb[_0xe734('0xd')]+_0x2737eb[_0xe734('0xf')]+_0x2737eb['countdropretry']+_0x2737eb[_0xe734('0x10')]+_0x2737eb[_0xe734('0x11')]+_0x2737eb[_0xe734('0x12')];this[_0xe734('0xf')]=_0x2737eb[_0xe734('0xf')];this['countdropretry']=_0x2737eb[_0xe734('0x13')];this[_0xe734('0x10')]=_0x2737eb[_0xe734('0x10')];this[_0xe734('0x11')]=_0x2737eb['countmachineretry'];this[_0xe734('0x12')]=_0x2737eb[_0xe734('0x12')];this[_0xe734('0x14')]=_0x875b53[_0xe734('0x14')];this['calleridname']=_0x2737eb[_0xe734('0x15')];this[_0xe734('0x16')]=_0x2737eb[_0xe734('0x17')];this[_0xe734('0x18')]=_0x2737eb[_0xe734('0x18')];this['responsetime']=_0x2737eb['responsetime'];this[_0xe734('0x19')]=moment()[_0xe734('0x1a')](_0xe734('0x1b'));this[_0xe734('0x1c')]=getSeconds(_0x2737eb[_0xe734('0x1d')],_0x2737eb['starttime']);this[_0xe734('0x1e')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x2737eb[_0xe734('0x1d')]);this['queue']=_0x2737eb[_0xe734('0xa')];this[_0xe734('0x1f')]=_0xe734('0x20');this[_0xe734('0x21')]=_0x875b53[_0xe734('0x22')];this[_0xe734('0x23')]=_0x2737eb[_0xe734('0x23')];this[_0xe734('0x24')]=_0x2737eb[_0xe734('0x24')];this[_0xe734('0x25')]=_0x2737eb[_0xe734('0x25')];this[_0xe734('0x26')]=_0x2737eb['recallme'];this[_0xe734('0x27')]=_0x2737eb[_0xe734('0x27')];this[_0xe734('0x28')]=_0x2737eb['ListId'];this[_0xe734('0x29')]=_0x2737eb['UserId'];this['VoiceQueueId']=_0x2737eb[_0xe734('0x2a')];this[_0xe734('0x2b')]=_0x2737eb[_0xe734('0x2b')];}module[_0xe734('0x2c')]=Hangup;
\ No newline at end of file
+var _0x8f29=['endtime','ringtime','holdtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8f29,0x1a1));var _0x98f2=function(_0xd2e3d1,_0x52240b){_0xd2e3d1=_0xd2e3d1-0x0;var _0x59c306=_0x8f29[_0xd2e3d1];return _0x59c306;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x98f2('0x0'));function getSeconds(_0x40e92d,_0x5aaa41){var _0x546926=moment(_0x40e92d)[_0x98f2('0x1')](0x0);var _0x153940=moment(_0x5aaa41)[_0x98f2('0x1')](0x0);return _0x546926[_0x98f2('0x2')](_0x153940,_0x98f2('0x3'));}function Hangup(_0x3e4e84,_0x6f495b){this['state']=0x4;this['statedesc']=_0x98f2('0x4');this[_0x98f2('0x5')]=_0x3e4e84[_0x98f2('0x5')];this[_0x98f2('0x6')]=_0x3e4e84[_0x98f2('0x6')];this['campaigntype']=_0x3e4e84[_0x98f2('0x6')]==='outbound'?_0x98f2('0x7'):_0x3e4e84[_0x98f2('0x6')];this[_0x98f2('0x8')]=_0x3e4e84[_0x98f2('0x8')];this[_0x98f2('0x9')]=_0x3e4e84[_0x98f2('0x9')];this[_0x98f2('0xa')]=_0x3e4e84['countnoanswerretry'];this[_0x98f2('0xb')]=_0x3e4e84[_0x98f2('0x8')]+_0x3e4e84[_0x98f2('0x9')]+_0x3e4e84[_0x98f2('0xa')]+_0x3e4e84[_0x98f2('0xc')]+_0x3e4e84[_0x98f2('0xd')]+_0x3e4e84['countabandonedretry']+_0x3e4e84[_0x98f2('0xe')]+_0x3e4e84[_0x98f2('0xf')];this[_0x98f2('0xc')]=_0x3e4e84[_0x98f2('0xc')];this[_0x98f2('0xd')]=_0x3e4e84[_0x98f2('0xd')];this[_0x98f2('0x10')]=_0x3e4e84[_0x98f2('0x10')];this[_0x98f2('0xe')]=_0x3e4e84[_0x98f2('0xe')];this[_0x98f2('0xf')]=_0x3e4e84[_0x98f2('0xf')];this['uniqueid']=_0x6f495b[_0x98f2('0x11')];this[_0x98f2('0x12')]=_0x3e4e84['name'];this[_0x98f2('0x13')]=_0x3e4e84[_0x98f2('0x14')];this[_0x98f2('0x15')]=_0x3e4e84[_0x98f2('0x15')];this[_0x98f2('0x16')]=_0x3e4e84[_0x98f2('0x16')];this[_0x98f2('0x17')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x98f2('0x18')]=getSeconds(_0x3e4e84['responsetime'],_0x3e4e84['starttime']);this[_0x98f2('0x19')]=0x0;this['talktime']=getSeconds(this[_0x98f2('0x17')],_0x3e4e84['responsetime']);this['queue']=_0x3e4e84[_0x98f2('0x7')];this[_0x98f2('0x1a')]=_0x98f2('0x1b');this[_0x98f2('0x1c')]=_0x6f495b[_0x98f2('0x1d')];this[_0x98f2('0x1e')]=_0x3e4e84[_0x98f2('0x1e')];this[_0x98f2('0x1f')]=_0x3e4e84[_0x98f2('0x1f')];this[_0x98f2('0x20')]=_0x3e4e84[_0x98f2('0x20')];this[_0x98f2('0x21')]=_0x3e4e84[_0x98f2('0x21')];this[_0x98f2('0x22')]=_0x3e4e84[_0x98f2('0x22')];this['ListId']=_0x3e4e84[_0x98f2('0x23')];this[_0x98f2('0x24')]=_0x3e4e84['UserId'];this[_0x98f2('0x25')]=_0x3e4e84[_0x98f2('0x25')];this[_0x98f2('0x26')]=_0x3e4e84[_0x98f2('0x26')];}module[_0x98f2('0x27')]=Hangup;
\ No newline at end of file
index af7bdd2..e12198c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e5b=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x313927,_0x2b3a6d){var _0x545b28=function(_0x1be96e){while(--_0x1be96e){_0x313927['push'](_0x313927['shift']());}};_0x545b28(++_0x2b3a6d);}(_0x7e5b,0xed));var _0xb7e5=function(_0x1f3003,_0x1f3f09){_0x1f3003=_0x1f3003-0x0;var _0x1e06a6=_0x7e5b[_0x1f3003];return _0x1e06a6;};'use strict';var util=require(_0xb7e5('0x0'));var _=require(_0xb7e5('0x1'));var moment=require(_0xb7e5('0x2'));function getSeconds(_0x446d49,_0x58450c){var _0x421ad1=moment(_0x446d49)[_0xb7e5('0x3')](0x0);var _0x259175=moment(_0x58450c)['milliseconds'](0x0);return _0x421ad1['diff'](_0x259175,_0xb7e5('0x4'));}function History(_0x2ebbad){this[_0xb7e5('0x5')]=_0x2ebbad[_0xb7e5('0x5')];this[_0xb7e5('0x6')]=_0x2ebbad[_0xb7e5('0x6')]||undefined;this['type']=_0x2ebbad['type'];this['campaigntype']=_0x2ebbad[_0xb7e5('0x7')]===_0xb7e5('0x8')?_0xb7e5('0x9'):_0x2ebbad[_0xb7e5('0x7')];this[_0xb7e5('0xa')]=_0x2ebbad['countbusyretry'];this[_0xb7e5('0xb')]=_0x2ebbad['countcongestionretry'];this['countnoanswerretry']=_0x2ebbad[_0xb7e5('0xc')];this[_0xb7e5('0xd')]=_0x2ebbad[_0xb7e5('0xa')]+_0x2ebbad[_0xb7e5('0xb')]+_0x2ebbad['countnoanswerretry']+_0x2ebbad[_0xb7e5('0xe')]+_0x2ebbad[_0xb7e5('0xf')]+_0x2ebbad[_0xb7e5('0x10')]+_0x2ebbad['countmachineretry']+_0x2ebbad[_0xb7e5('0x11')];this['countnosuchnumberretry']=_0x2ebbad['countnosuchnumberretry'];this[_0xb7e5('0xf')]=_0x2ebbad[_0xb7e5('0xf')];this['countabandonedretry']=_0x2ebbad[_0xb7e5('0x10')];this['countmachineretry']=_0x2ebbad[_0xb7e5('0x12')];this[_0xb7e5('0x11')]=_0x2ebbad[_0xb7e5('0x11')];this[_0xb7e5('0x9')]=_0x2ebbad['queue'];this['calleridname']=_0x2ebbad['name'];this[_0xb7e5('0x13')]=_0x2ebbad[_0xb7e5('0x14')];this[_0xb7e5('0x15')]=_0x2ebbad['starttime'];this[_0xb7e5('0x16')]=_0x2ebbad['responsetime'];this[_0xb7e5('0x17')]=_0x2ebbad[_0xb7e5('0x16')];this['ringtime']=getSeconds(_0x2ebbad[_0xb7e5('0x16')],_0x2ebbad[_0xb7e5('0x15')]);this[_0xb7e5('0x18')]=0x0;this[_0xb7e5('0x19')]=0x0;this[_0xb7e5('0x1a')]=_0x2ebbad[_0xb7e5('0x1a')];this[_0xb7e5('0x1b')]=_0x2ebbad[_0xb7e5('0x1b')];this[_0xb7e5('0x1c')]=_0x2ebbad['callbackat'];this[_0xb7e5('0x1d')]=_0x2ebbad[_0xb7e5('0x1d')];this[_0xb7e5('0x1e')]=_0x2ebbad[_0xb7e5('0x1e')];this[_0xb7e5('0x1f')]=_0x2ebbad[_0xb7e5('0x1f')];this[_0xb7e5('0x20')]=_0x2ebbad[_0xb7e5('0x20')];this[_0xb7e5('0x21')]=_0x2ebbad[_0xb7e5('0x21')];this[_0xb7e5('0x22')]=_0x2ebbad['CampaignId'];this[_0xb7e5('0x23')]=_0x2ebbad['originatecalleridnum']||'';this[_0xb7e5('0x24')]=_0x2ebbad[_0xb7e5('0x24')]||'';}module[_0xb7e5('0x25')]=History;
\ No newline at end of file
+var _0x3b67=['endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','number','starttime','responsetime'];(function(_0x174c90,_0x3b36c8){var _0x25a658=function(_0x47d6a9){while(--_0x47d6a9){_0x174c90['push'](_0x174c90['shift']());}};_0x25a658(++_0x3b36c8);}(_0x3b67,0xcc));var _0x73b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b67[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x73b6('0x0'));var _=require(_0x73b6('0x1'));var moment=require('moment');function getSeconds(_0x12850e,_0x485599){var _0x6008be=moment(_0x12850e)[_0x73b6('0x2')](0x0);var _0x2c0eba=moment(_0x485599)[_0x73b6('0x2')](0x0);return _0x6008be[_0x73b6('0x3')](_0x2c0eba,_0x73b6('0x4'));}function History(_0x29e2df){this['uniqueid']=_0x29e2df[_0x73b6('0x5')];this[_0x73b6('0x6')]=_0x29e2df['scheduledat']||undefined;this[_0x73b6('0x7')]=_0x29e2df['type'];this[_0x73b6('0x8')]=_0x29e2df[_0x73b6('0x7')]===_0x73b6('0x9')?'queue':_0x29e2df['type'];this[_0x73b6('0xa')]=_0x29e2df['countbusyretry'];this[_0x73b6('0xb')]=_0x29e2df[_0x73b6('0xb')];this['countnoanswerretry']=_0x29e2df[_0x73b6('0xc')];this[_0x73b6('0xd')]=_0x29e2df[_0x73b6('0xa')]+_0x29e2df[_0x73b6('0xb')]+_0x29e2df['countnoanswerretry']+_0x29e2df[_0x73b6('0xe')]+_0x29e2df[_0x73b6('0xf')]+_0x29e2df[_0x73b6('0x10')]+_0x29e2df[_0x73b6('0x11')]+_0x29e2df['countagentrejectretry'];this[_0x73b6('0xe')]=_0x29e2df[_0x73b6('0xe')];this['countdropretry']=_0x29e2df[_0x73b6('0xf')];this[_0x73b6('0x10')]=_0x29e2df['countabandonedretry'];this[_0x73b6('0x11')]=_0x29e2df[_0x73b6('0x11')];this[_0x73b6('0x12')]=_0x29e2df[_0x73b6('0x12')];this[_0x73b6('0x13')]=_0x29e2df[_0x73b6('0x13')];this[_0x73b6('0x14')]=_0x29e2df['name'];this['calleridnum']=_0x29e2df[_0x73b6('0x15')];this[_0x73b6('0x16')]=_0x29e2df[_0x73b6('0x16')];this[_0x73b6('0x17')]=_0x29e2df['responsetime'];this[_0x73b6('0x18')]=_0x29e2df[_0x73b6('0x17')];this[_0x73b6('0x19')]=getSeconds(_0x29e2df[_0x73b6('0x17')],_0x29e2df[_0x73b6('0x16')]);this['holdtime']=0x0;this[_0x73b6('0x1a')]=0x0;this['callback']=_0x29e2df[_0x73b6('0x1b')];this[_0x73b6('0x1c')]=_0x29e2df['callbackuniqueid'];this[_0x73b6('0x1d')]=_0x29e2df[_0x73b6('0x1d')];this[_0x73b6('0x1e')]=_0x29e2df[_0x73b6('0x1e')];this[_0x73b6('0x1f')]=_0x29e2df[_0x73b6('0x1f')];this[_0x73b6('0x20')]=_0x29e2df['ListId'];this['UserId']=_0x29e2df['UserId'];this[_0x73b6('0x21')]=_0x29e2df[_0x73b6('0x21')];this[_0x73b6('0x22')]=_0x29e2df[_0x73b6('0x22')];this[_0x73b6('0x23')]=_0x29e2df[_0x73b6('0x23')]||'';this[_0x73b6('0x24')]=_0x29e2df[_0x73b6('0x24')]||'';}module[_0x73b6('0x25')]=History;
\ No newline at end of file
index 208edb1..46bf0c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','true','content','indexOf','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','booked','Queue','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','replace','random','match','object','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','substring','trim','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate','originate\x20action\x20Error','syncOriginateResponse','responsetime','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','agentreject','reason\x2020\x20agentreject','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','abandonmentRate','[CatchErlangB]','outboundQueuePauses','busyFactor','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','reachable','Contact.phone','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','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','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','syncNewExten','syncVarSet','syncQueueMember','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','INTERVAL_IS_NULL','Interval','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','diff','seconds','emit','type','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','milliseconds','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','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','actions','[actions]','Action','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','isTrunkReachable','SIP/%s','status','unmonitored','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HangupInAMD','membername','AMD','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','campaigns','HANGUP','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countabandonedretry','countagentrejectretry','dialMachineRetryFrequency','[rescheduleContact][Machine]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','actionid','strategy','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr'];(function(_0x5a9259,_0x4ee26a){var _0x1e3c42=function(_0xae50a3){while(--_0xae50a3){_0x5a9259['push'](_0x5a9259['shift']());}};_0x1e3c42(++_0x4ee26a);}(_0xbec5,0xe5));var _0x5bec=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0xbec5[_0x39e283];return _0x7de89f;};'use strict';var util=require(_0x5bec('0x0'));var _=require(_0x5bec('0x1'));var BPromise=require('bluebird');var uuid=require(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var rr=require('rr');var md5=require(_0x5bec('0x4'));var Redis=require(_0x5bec('0x5'));var ut=require(_0x5bec('0x6'));var config=require('../../../config/environment/');var logger=require(_0x5bec('0x7'))(_0x5bec('0x8'));var loggerBooked=require(_0x5bec('0x7'))('booked');var loggerPredictive=require(_0x5bec('0x7'))(_0x5bec('0x9'));var loggerPredictiveCalls=require(_0x5bec('0x7'))(_0x5bec('0xa'));var loggerSyncQueueSummary=require(_0x5bec('0x7'))(_0x5bec('0xb'));var ami=require(_0x5bec('0xc'));config[_0x5bec('0xd')]=_['defaults'](config[_0x5bec('0xd')],{'host':'localhost','port':0x18eb});var io=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xd')]));var cmHopper=require(_0x5bec('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x5bec('0x10'));var voiceQueueRt=require(_0x5bec('0x11'));var Action=require(_0x5bec('0x12'));var History=require('./history');var Final=require(_0x5bec('0x13'));var AgentComplete=require(_0x5bec('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x5bec('0x15'));var ipAgi=process[_0x5bec('0x16')][_0x5bec('0x17')]||_0x5bec('0x18');var strategy={'rrmemory':_0x5bec('0x19'),'roundrobin':_0x5bec('0x1a')};var Sequence=function(){};Sequence[_0x5bec('0x1b')][_0x5bec('0x1c')]=function(_0x259588){this[_0x5bec('0x1d')]=this[_0x5bec('0x1d')]?this[_0x5bec('0x1d')][_0x5bec('0x1e')](_0x259588):_0x259588();};function Dialer(_0x506639,_0x4ab821){this[_0x5bec('0x1f')]=new Sequence();this[_0x5bec('0x20')]=_0x4ab821;this[_0x5bec('0x21')]=_0x506639[_0x5bec('0x21')];this['campaigns']=_0x506639['campaigns'];this[_0x5bec('0x22')]=_0x506639[_0x5bec('0x22')];this['trunks']=_0x506639[_0x5bec('0x23')];this[_0x5bec('0x24')]=config[_0x5bec('0x24')]||0x2;this[_0x5bec('0x25')]={};this['actions']={};this[_0x5bec('0x26')]={};this['uniqueId']={};this[_0x5bec('0x27')]={};this[_0x5bec('0x28')]={};this[_0x5bec('0x29')]={};this[_0x5bec('0x2a')]={};this[_0x5bec('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x5bec('0x2c'),this['syncAgentConnect'][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x2e'),this['syncQueueCallerAbandon'][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x2f'),this['syncOriginateResponse'][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x30'),this[_0x5bec('0x31')][_0x5bec('0x2d')](this));ami['on'](_0x5bec('0x32'),this[_0x5bec('0xb')][_0x5bec('0x2d')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x5bec('0x33'),this[_0x5bec('0x34')][_0x5bec('0x2d')](this));ami['on']('varset',this[_0x5bec('0x35')][_0x5bec('0x2d')](this));ami['on']('queuemember',this[_0x5bec('0x36')][_0x5bec('0x2d')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x5bec('0x2d')](this));this[_0x5bec('0x37')]();this[_0x5bec('0x38')]();}function isNotNull(_0x2c7a7b){return _0x2c7a7b!==null&&!_[_0x5bec('0x39')](_0x2c7a7b);}function checkIsLoggedIn(_0x3f224c,_0x5d6621){return function(){if(_0x5d6621<=0x0){_0x3f224c[_0x5bec('0x3a')]='AGENTS_NOT_LOGGED';throw _0x3f224c[_0x5bec('0x3b')]+_0x5bec('0x3c');}};}function isActive(_0x3034c9){return _0x3034c9;}function checkIsActive(_0x110bd4,_0x5128c0){return function(){if(!isActive(_0x5128c0)){_0x110bd4[_0x5bec('0x3a')]=_0x5bec('0x3d');throw _0x110bd4[_0x5bec('0x3b')]+'\x20NOT\x20Active';}};}function checkInterval(_0xf6ae6b){return function(){if(!isNotNull(_0xf6ae6b['Interval'])){_0xf6ae6b[_0x5bec('0x3a')]=_0x5bec('0x3e');throw _0xf6ae6b[_0x5bec('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0xf6ae6b[_0x5bec('0x3f')][_0x5bec('0x40')])){_0xf6ae6b['message']=_0x5bec('0x3e');throw _0xf6ae6b[_0x5bec('0x3b')]+_0x5bec('0x41');}if(!isNotNull(_[_0x5bec('0x42')](_0xf6ae6b[_0x5bec('0x3f')]['Intervals']))){_0xf6ae6b[_0x5bec('0x3a')]='INTERVAL_IS_NULL';throw _0xf6ae6b[_0x5bec('0x3b')]+_0x5bec('0x41');}};}function msgResponse(_0x182b86,_0x7598ab,_0x2e421e){return{'action':_0x182b86,'response':_0x7598ab,'message':_0x2e421e,'stack':_0x2e421e};}function myreject(_0x1923fc){return function(_0x49c8ef){return _0x1923fc(msgResponse(_0x5bec('0x43'),_0x5bec('0x44'),JSON[_0x5bec('0x45')](_0x49c8ef)));};}function getSeconds(_0x5de683,_0x40db29){var _0x355707=moment(_0x5de683)['milliseconds'](0x0);var _0xdb0430=moment(_0x40db29)['milliseconds'](0x0);return _0x355707[_0x5bec('0x46')](_0xdb0430,_0x5bec('0x47'));}function emit(_0x402e5d,_0x49cdfa,_0xd7b727){io['to'](_0x402e5d)[_0x5bec('0x48')](_0x49cdfa,_0xd7b727);}function emitVoiceQueueSummary(_0x43d4e9){if(_0x43d4e9[_0x5bec('0x49')]===_0x5bec('0x4a')){var _0x1be7a7={'id':_0x43d4e9['id'],'name':_0x43d4e9[_0x5bec('0x3b')],'strategy':_0x43d4e9['strategy'],'answered':_0x43d4e9[_0x5bec('0x4b')],'available':_0x43d4e9[_0x5bec('0x4c')],'loggedIn':_0x43d4e9[_0x5bec('0x4d')],'pTalking':_0x43d4e9[_0x5bec('0x4e')],'sumBillable':_0x43d4e9['sumBillable'],'sumDuration':_0x43d4e9[_0x5bec('0x4f')],'sumHoldTime':_0x43d4e9[_0x5bec('0x50')]||0x0,'talking':_0x43d4e9[_0x5bec('0x51')],'total':_0x43d4e9['total'],'type':_0x43d4e9['type'],'unmanaged':_0x43d4e9[_0x5bec('0x52')],'abandoned':_0x43d4e9[_0x5bec('0x53')],'waiting':_0x43d4e9[_0x5bec('0x54')],'loggedInDb':_0x43d4e9[_0x5bec('0x55')],'dialActive':_0x43d4e9[_0x5bec('0x56')],'dialMethod':_0x43d4e9['dialMethod'],'dialOriginateCallerIdName':_0x43d4e9['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x43d4e9[_0x5bec('0x57')],'dialOriginateTimeout':_0x43d4e9['dialOriginateTimeout'],'dialPrefix':_0x43d4e9[_0x5bec('0x58')],'outboundAnswerAgiCallsDay':_0x43d4e9[_0x5bec('0x59')],'outboundAnswerCallsDay':_0x43d4e9[_0x5bec('0x5a')],'outboundBlacklistCallsDay':_0x43d4e9['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x43d4e9[_0x5bec('0x5b')],'outboundCongestionCallsDay':_0x43d4e9[_0x5bec('0x5c')],'outboundDropCallsDayACS':_0x43d4e9['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x43d4e9[_0x5bec('0x5d')],'outboundDropCallsDayTimeout':_0x43d4e9[_0x5bec('0x5e')],'outboundNoAnswerCallsDay':_0x43d4e9[_0x5bec('0x5f')],'outboundNoSuchCallsDay':_0x43d4e9[_0x5bec('0x60')],'outboundOriginateFailureCallsDay':_0x43d4e9[_0x5bec('0x61')],'outboundReCallsDay':_0x43d4e9[_0x5bec('0x62')],'outboundRejectCallsDay':_0x43d4e9[_0x5bec('0x63')],'outboundUnknownCallsDay':_0x43d4e9['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x43d4e9['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x43d4e9[_0x5bec('0x64')],'predictiveIntervalAvgTalktime':_0x43d4e9['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x43d4e9['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x43d4e9[_0x5bec('0x65')],'predictiveIntervalErlangCalls':_0x43d4e9['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x43d4e9['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x43d4e9['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x43d4e9[_0x5bec('0x66')],'predictiveIntervalPauses':_0x43d4e9[_0x5bec('0x67')],'predictiveIntervalAvailable':_0x43d4e9[_0x5bec('0x68')],'predictiveIntervalTotalCalls':_0x43d4e9[_0x5bec('0x69')],'message':_0x43d4e9['message'],'originated':_0x43d4e9[_0x5bec('0x6a')],'erlangCalls':_0x43d4e9[_0x5bec('0x6b')],'erlangCallToSecond':_0x43d4e9[_0x5bec('0x6c')],'erlangAbandonmentRate':_0x43d4e9[_0x5bec('0x6d')],'erlangBusyFactor':_0x43d4e9['erlangBusyFactor'],'startPredictive':_0x43d4e9[_0x5bec('0x28')],'startProgressive':_0x43d4e9[_0x5bec('0x29')]};if(_0x43d4e9[_0x5bec('0x6e')]){_0x1be7a7['Trunk']={'id':_0x43d4e9[_0x5bec('0x6e')]['id'],'name':_0x43d4e9['Trunk'][_0x5bec('0x3b')],'active':_0x43d4e9[_0x5bec('0x6e')][_0x5bec('0x6f')],'callerid':_0x43d4e9[_0x5bec('0x6e')]['callerid']};}if(_0x43d4e9[_0x5bec('0x3f')]){_0x1be7a7[_0x5bec('0x3f')]={'id':_0x43d4e9[_0x5bec('0x3f')]['id'],'name':_0x43d4e9[_0x5bec('0x3f')][_0x5bec('0x3b')]};}var _0x123758=md5(JSON[_0x5bec('0x45')](_0x1be7a7));if(_0x43d4e9['md5']!==_0x123758){_0x43d4e9[_0x5bec('0x4')]=_0x123758;emit(util[_0x5bec('0x70')]('voice:queue:%s',_0x1be7a7[_0x5bec('0x3b')]),_0x5bec('0x71'),_0x1be7a7);}}}function emitCampaignSummary(_0x34ee24){if(_0x34ee24[_0x5bec('0x49')]===_0x5bec('0x72')){emit(util[_0x5bec('0x70')](_0x5bec('0x73'),_0x34ee24['name']),_0x5bec('0x74'),_0x34ee24);}}function checkGetDataPredictive(_0x579cd2){if(isNotNull(_0x579cd2)&&!_[_0x5bec('0x42')](_0x579cd2)){loggerPredictive[_0x5bec('0x75')](_0x5bec('0x76'));loggerPredictive[_0x5bec('0x75')](_0x5bec('0x77'),_0x579cd2[_0x5bec('0x69')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x78'),_0x579cd2[_0x5bec('0x79')]);loggerPredictive[_0x5bec('0x75')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579cd2[_0x5bec('0x65')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579cd2[_0x5bec('0x7a')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x579cd2[_0x5bec('0x64')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7b'),_0x579cd2['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7c'));if(_0x579cd2[_0x5bec('0x69')]>0x0){if(!_[_0x5bec('0x39')](_0x579cd2['predictiveIntervalAvgTalktime'])&&_0x579cd2[_0x5bec('0x7d')]>0x0){return!![];}loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7e'));if(!_[_0x5bec('0x39')](_0x579cd2[_0x5bec('0x64')])&&_0x579cd2[_0x5bec('0x64')]>0x0){return!![];}loggerPredictive[_0x5bec('0x75')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x5bec('0x7f'));}}else{loggerPredictive['info'](_0x5bec('0x80'));}return![];}function mergeDataErlangB(_0x7ad053){return function(_0x4bba85){loggerPredictive[_0x5bec('0x75')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x5bec('0x75')](_0x5bec('0x81'),_0x4bba85[_0x5bec('0x6b')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x82'),_0x4bba85[_0x5bec('0x6c')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x83'),_0x4bba85[_0x5bec('0x6d')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x84'),_0x4bba85[_0x5bec('0x85')]);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x83'),_0x4bba85['erlangAbandonmentRate']);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7c'));_[_0x5bec('0x86')](_0x7ad053,_0x4bba85);};}function getDiff(_0x56a539){var _0x3801e3=moment()[_0x5bec('0x87')](0x0);var _0xfc5d80=moment(_0x56a539)[_0x5bec('0x87')](0x0);return _0x3801e3[_0x5bec('0x46')](_0xfc5d80,'seconds');}function ifInterval(_0x3e3108,_0x11b30c){if(_[_0x5bec('0x39')](_0x11b30c)){return![];}return getDiff(_0x11b30c)<_0x3e3108*0x3c;}function freeVariablesPredictive(_0x2abc02){if(isNotNull(_0x2abc02)){if(!_['isUndefined'](_0x2abc02[_0x5bec('0x29')])){_0x2abc02['startProgressive']=undefined;loggerPredictive[_0x5bec('0x75')](_0x2abc02[_0x5bec('0x3b')],_0x5bec('0x88'));}if(!_[_0x5bec('0x39')](_0x2abc02['startPredictive'])){_0x2abc02[_0x5bec('0x28')]=undefined;loggerPredictive[_0x5bec('0x75')](_0x2abc02[_0x5bec('0x3b')],_0x5bec('0x89'));}if(!_[_0x5bec('0x39')](_0x2abc02[_0x5bec('0x8a')])){clearInterval(_0x2abc02[_0x5bec('0x8a')]);_0x2abc02[_0x5bec('0x8a')]=undefined;loggerPredictive[_0x5bec('0x75')](_0x2abc02[_0x5bec('0x3b')],_0x5bec('0x8b'));}}}function erlangb(_0x42d4e4,_0x65a9e2){if(_0x65a9e2===0x0){return 0x0;}var _0x5d3092=0x1;for(var _0x1e98ee=0x1;_0x1e98ee<=_0x65a9e2;_0x1e98ee+=0x1){_0x5d3092=0x1+_0x5d3092*_0x1e98ee/_0x42d4e4;}return 0x1/_0x5d3092;}function isVoiceQueueOutbound(_0x490d4b){return _0x490d4b===_0x5bec('0x4a');}function isNotPreview(_0x27c160){return _0x27c160!=='preview';}function isCampaignIvr(_0xa7a394){return _0xa7a394==='ivr';}function getCallerId(_0x1a5cb0,_0x1061d3,_0x540e96){if(!_['isUndefined'](_0x540e96)&&typeof _0x540e96===_0x5bec('0x8c')&&!_[_0x5bec('0x42')](_0x540e96)){if(!_[_0x5bec('0x39')](_0x1061d3)&&typeof _0x1061d3===_0x5bec('0x8c')&&!_[_0x5bec('0x42')](_0x1061d3)){return util['format'](_0x5bec('0x8d'),_0x1061d3,_0x540e96);}return util[_0x5bec('0x70')]('\x22%s\x22\x20<%s>',_0x540e96,_0x540e96);}if(!_[_0x5bec('0x39')](_0x1a5cb0)&&typeof _0x1a5cb0===_0x5bec('0x8c')&&!_[_0x5bec('0x42')](_0x1a5cb0)){return _0x1a5cb0;}return _0x5bec('0x8e');}function loggerCatchQueueSummary(_0x572dc5,_0x681503){return function(_0x5e4aae){freeVariablesPredictive(_0x681503);emitVoiceQueueSummary(_0x681503);emitCampaignSummary(_0x681503);loggerSyncQueueSummary[_0x5bec('0x8f')](_0x572dc5,util[_0x5bec('0x90')](_0x5e4aae,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3ede1d,_0x34e172){return function(_0x31b2c6){loggerPredictive[_0x5bec('0x8f')](_0x34e172[_0x5bec('0x3b')],_0x3ede1d);loggerPredictive[_0x5bec('0x8f')](_0x31b2c6[_0x5bec('0x91')]);freeVariablesPredictive(_0x34e172);};}function loggerCatch(_0x4483a0){return function(_0x36d6f6){logger['error'](_0x4483a0,util['inspect'](_0x36d6f6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3c305e){return _0x3c305e&&!_[_0x5bec('0x39')](_0x3c305e)&&_0x3c305e[_0x5bec('0x92')]>0x0;}function decremetOriginate(_0x41bf69){if(!_[_0x5bec('0x39')](_0x41bf69)&&_0x41bf69!==null){if(typeof _0x41bf69[_0x5bec('0x6a')]!==_0x5bec('0x93')){if(_0x41bf69['originated']>0x0){_0x41bf69['originated']-=0x1;}else{logger[_0x5bec('0x8f')](_0x5bec('0x94'));}}}else{logger[_0x5bec('0x8f')](_0x5bec('0x95'));}}function checkContactLowerLimitOriginate(_0x215f9b,_0x2c3baf,_0x17cd00){if(_0x2c3baf>_0x17cd00){for(var _0x31f45b=0x0;_0x31f45b<_0x2c3baf-_0x17cd00;_0x31f45b+=0x1){decremetOriginate(_0x215f9b);}}}function loggerGetContactDialer(_0x132c57,_0x29b7ae,_0x10550a){return function(_0x14b071){checkContactLowerLimitOriginate(_0x29b7ae,_0x10550a,0x0);logger[_0x5bec('0x8f')](_0x132c57,util[_0x5bec('0x90')](_0x14b071,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x282c3b){return function(_0x40a6f3){if(isNotNull(_0x40a6f3)&&isNotNull(_0x40a6f3[0x0])){if(_0x40a6f3[0x0][_0x5bec('0x96')]>0x0){_0x282c3b[_0x5bec('0x3a')]=_0x5bec('0x97');logger[_0x5bec('0x75')]('[getContactDialer2][ReScheduled]'+_0x282c3b[_0x5bec('0x3b')],_0x40a6f3[0x0]['contactsRescheduled'],'contacts');}else{_0x282c3b[_0x5bec('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5bec('0x75')]('[getContactDialer2][Empty]'+_0x282c3b['name']);}}};}function notSendMessagesQueue(_0x2e849b){if(_0x2e849b[_0x5bec('0x98')]){freeVariablesPredictive(_0x2e849b);if(_0x2e849b['originated']===0x0&&_0x2e849b[_0x5bec('0x51')]===0x0&&_0x2e849b[_0x5bec('0x54')]===0x0&&(_0x2e849b[_0x5bec('0x4e')]||0x0)===0x0){_0x2e849b[_0x5bec('0x98')]=![];_0x2e849b[_0x5bec('0x4c')]=0x0;_0x2e849b[_0x5bec('0x3a')]=_0x5bec('0x3d');loggerSyncQueueSummary[_0x5bec('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2e849b['name'],_0x5bec('0x99'));}else{_0x2e849b[_0x5bec('0x3a')]=_0x5bec('0x9a');loggerSyncQueueSummary[_0x5bec('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2e849b[_0x5bec('0x3b')],'is\x20disactive');}emitVoiceQueueSummary(_0x2e849b);}}function notSendMessagesCampaign(_0x44ceec){if(_0x44ceec[_0x5bec('0x98')]){if(_0x44ceec[_0x5bec('0x6a')]===0x0){_0x44ceec[_0x5bec('0x98')]=![];_0x44ceec[_0x5bec('0x3a')]=_0x5bec('0x3d');loggerSyncQueueSummary[_0x5bec('0x8f')](_0x5bec('0x9b'),_0x44ceec['name'],_0x5bec('0x99'));}else{_0x44ceec[_0x5bec('0x3a')]=_0x5bec('0x9a');loggerSyncQueueSummary[_0x5bec('0x8f')](_0x5bec('0x9b'),_0x44ceec['name'],_0x5bec('0x9c'));}emitCampaignSummary(_0x44ceec);}}function createObjHistory(_0x3d5e9d,_0x5c124d,_0x195c12,_0x56fa9d,_0xd93c70){_0x3d5e9d[_0x5bec('0x3a')]=_0x195c12;var _0x4646a3=new Action(_0x3d5e9d,_0x5c124d);var _0x313e1c=new History(_0x4646a3);_0x313e1c[_0x5bec('0x9d')]=_0x56fa9d;_0x313e1c[_0x5bec('0x9e')]=_0xd93c70;_0x313e1c[_0x5bec('0x9f')]=_0x4646a3[_0x5bec('0xa0')];return _0x313e1c;}Dialer[_0x5bec('0x1b')][_0x5bec('0x38')]=function(){var _0x1c44f5=this;setInterval(function(){_0x1c44f5[_0x5bec('0xa1')](_0x1c44f5[_0x5bec('0xa2')],_0x5bec('0xa3'));_0x1c44f5[_0x5bec('0xa1')](_0x1c44f5[_0x5bec('0xa4')],_0x5bec('0xa5'));},0x32c8);};Dialer[_0x5bec('0x1b')]['clearZombieChannels']=function(_0x1aa391,_0x4d178b){var _0x3c8ab9=this;for(var _0xfcef92 in _0x1aa391){if(typeof _0x1aa391[_0xfcef92]!=='undefined'){this['sequence'][_0x5bec('0x1c')](function(){if(!_['isNil'](_0x1aa391[_0xfcef92])){return ami[_0x5bec('0xa6')]({'action':'status','channel':_0x1aa391[_0xfcef92][_0x5bec('0xa7')]})[_0x5bec('0xa8')](function(_0x5c26b9){if(_0x5c26b9[_0x5bec('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1aa391[_0xfcef92]&&_0x1aa391[_0xfcef92][_0x5bec('0x49')]!=='ivr'){_0x3c8ab9[_0x5bec('0xa9')](_0x3c8ab9[_0x5bec('0x21')][_0x1aa391[_0xfcef92]['queue']]);logger[_0x5bec('0x8f')](_0x5bec('0xaa'),_0x4d178b,_0xfcef92,_0x1aa391[_0xfcef92][_0x5bec('0xab')]);delete _0x1aa391[_0xfcef92];}if(_0x1aa391[_0xfcef92]&&_0x1aa391[_0xfcef92][_0x5bec('0x49')]===_0x5bec('0x72')){_0x3c8ab9[_0x5bec('0xa9')](_0x3c8ab9['campaigns'][_0x1aa391[_0xfcef92][_0x5bec('0xab')]]);logger['error'](_0x5bec('0xac'),_0x4d178b,_0xfcef92,_0x1aa391[_0xfcef92]['queue']);delete _0x1aa391[_0xfcef92];}},0x2328);}});}});}}};Dialer['prototype'][_0x5bec('0xad')]=function(_0xf82ec2){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xad')](_0xf82ec2))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xaf')));};Dialer[_0x5bec('0x1b')]['checkIsBlackList']=function(_0x2c7ffa){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperBlack[_0x5bec('0xb1')](_0x2c7ffa))['catch'](loggerCatch(_0x5bec('0xb2')));};Dialer[_0x5bec('0x1b')][_0x5bec('0xb3')]=function(_0x268680){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperBlack[_0x5bec('0xb3')](_0x268680))[_0x5bec('0xa8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x5bec('0x1b')][_0x5bec('0xb4')]=function(_0x38815d){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperHistory['avgHandleTime'](_0x38815d))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xb5')));};Dialer['prototype'][_0x5bec('0xb6')]=function(_0x528102){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopper[_0x5bec('0xb6')](_0x528102))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xb7')));};Dialer['prototype'][_0x5bec('0xb8')]=function(_0x2db4fe,_0x3cee19,_0x98b146){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopper[_0x5bec('0xb8')](_0x2db4fe,_0x3cee19,_0x98b146))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xb9')));};Dialer['prototype'][_0x5bec('0xba')]=function(_0x160d40,_0x187416,_0x52b869,_0x56af8f,_0x1b7573){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xba')](_0x160d40,_0x187416,_0x52b869,_0x56af8f))['catch'](function(_0x862da3){_0x1b7573['temp']-=_0x52b869;_0x1b7573[_0x5bec('0xbb')]=_0x1b7573['temp']>0x0?_0x1b7573[_0x5bec('0xbb')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x862da3);});};Dialer[_0x5bec('0x1b')]['getContactDialerIvr']=function(_0x209f2d,_0x271067,_0x4c149f,_0x2b8227){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xbc')](_0x209f2d,_0x271067,_0x4c149f))[_0x5bec('0xa8')](function(_0x384aea){_0x2b8227[_0x5bec('0xbb')]-=_0x271067;_0x2b8227[_0x5bec('0xbb')]=_0x2b8227[_0x5bec('0xbb')]>0x0?_0x2b8227[_0x5bec('0xbb')]:0x0;loggerCatch(_0x5bec('0xbd'))(_0x384aea);});};Dialer[_0x5bec('0x1b')]['getVoiceQueueRtPauses']=function(_0x4e46ed){return BPromise['resolve']()['then'](voiceQueueRt[_0x5bec('0xbe')](_0x4e46ed))['catch'](loggerCatch(_0x5bec('0xbf')));};Dialer['prototype'][_0x5bec('0xc0')]=function(_0x36faae){return BPromise[_0x5bec('0xae')]()['then'](cmHopper[_0x5bec('0xc0')](_0x36faae))['catch'](loggerCatch(_0x5bec('0xc1')));};Dialer[_0x5bec('0x1b')][_0x5bec('0xc2')]=function(_0x4082c2){return BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](cmHopperHistory[_0x5bec('0xc2')](_0x4082c2))['catch'](loggerCatch(_0x5bec('0xc3')));};Dialer[_0x5bec('0x1b')][_0x5bec('0xa9')]=function(_0xadaafb){if(!_['isUndefined'](_0xadaafb)&&_0xadaafb!==null){if(typeof _0xadaafb[_0x5bec('0x6a')]!==_0x5bec('0x93')){if(_0xadaafb[_0x5bec('0x6a')]>0x0){_0xadaafb[_0x5bec('0x6a')]-=0x1;}else{logger[_0x5bec('0x8f')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0xd8e688,_0x4c9a52){var _0x3cbca3=this;return function(_0x1e7eec){_0x3cbca3['updateOriginated'](_0x4c9a52);logger[_0x5bec('0x8f')](_0xd8e688,util[_0x5bec('0x90')](_0x1e7eec,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x5bec('0xc4')]=function(_0x34931a,_0x4568fd,_0x1fe43c){var _0xc7c50a={'state':0x19,'statedesc':_0x5bec('0xc5')};this[_0x5bec('0xa9')](_0x4568fd);this[_0x5bec('0xc6')](_['merge'](_0xc7c50a,_[_0x5bec('0xc7')](_0x1fe43c,[_0x5bec('0xc8'),_0x5bec('0xc9'),_0x5bec('0xca'),_0x5bec('0xcb'),'CampaignId'])),'[emptyContact][createHistory]',_0x5bec('0xcc'));logger[_0x5bec('0x8f')](_0x34931a);};Dialer[_0x5bec('0x1b')][_0x5bec('0xcd')]=function(_0x3f40b8){return _0x3f40b8==='Success';};Dialer[_0x5bec('0x1b')][_0x5bec('0xce')]=function(_0x502346){return!_[_0x5bec('0x39')](_0x502346)&&_0x502346&&!_[_0x5bec('0x39')](_0x502346['name'])&&!_[_0x5bec('0x39')](_0x502346[_0x5bec('0x6f')])&&_0x502346[_0x5bec('0x6f')]&&(this[_0x5bec('0x23')][util[_0x5bec('0x70')]('SIP/%s',_0x502346['name'])]['status']==='reachable'||this[_0x5bec('0x23')][util[_0x5bec('0x70')](_0x5bec('0xcf'),_0x502346[_0x5bec('0x3b')])][_0x5bec('0xd0')]===_0x5bec('0xd1'));};Dialer['prototype']['saveInDb']=function(_0x3da745,_0x8d8363,_0x4b4142){this['createHistory'](_0x3da745)[_0x5bec('0xa8')](loggerCatch(_0x8d8363));this[_0x5bec('0xc0')](_0x3da745)['catch'](loggerCatch(_0x4b4142));};Dialer[_0x5bec('0x1b')][_0x5bec('0x35')]=function(_0x17214f){var _0xa8d9c3=this[_0x5bec('0xa2')][_0x17214f[_0x5bec('0xd2')]];var _0x113d2d;if(!_['isNil'](_0x17214f)&&!_[_0x5bec('0xd3')](_0x17214f['variable'])&&!_['isNil'](_0x17214f[_0x5bec('0xd4')][_0x5bec('0xd5')])&&_0x17214f[_0x5bec('0xd6')]==='xcally-motion-dialer'&&_0xa8d9c3){if(_0xa8d9c3['type']!==_0x5bec('0x72')&&this[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]==='HANGUP'){delete this[_0x5bec('0xa2')][_0x17214f[_0x5bec('0xd2')]];this[_0x5bec('0xa9')](this['voiceQueues'][_0xa8d9c3[_0x5bec('0xab')]]);this[_0x5bec('0x21')][_0xa8d9c3['queue']][_0x5bec('0x5a')]+=0x1;this[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0x59')]+=0x1;_0x113d2d=new Hangup(_0xa8d9c3,_0x17214f);_0x113d2d[_0x5bec('0x9d')]=0x12;_0x113d2d[_0x5bec('0x9e')]=_0x5bec('0xd9');_0x113d2d[_0x5bec('0xda')]=_0x5bec('0xdb');ami[_0x5bec('0x48')]('custom:amd',ut[_0x5bec('0xdc')](_0x113d2d,_0x5bec('0xdd')));this[_0x5bec('0xc6')](_0x113d2d,_0x5bec('0xde'),_0x5bec('0xdf'));}if(_0xa8d9c3['type']!==_0x5bec('0x72')&&this[_0x5bec('0x21')][_0xa8d9c3['queue']][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]==='MACHINE'){var _0xd008ba=this;return new BPromise(function(_0x45e155,_0x2b6322){delete _0xd008ba['uniqueId'][_0x17214f[_0x5bec('0xd2')]];_0xd008ba[_0x5bec('0xa9')](_0xd008ba[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]]);_0xd008ba['voiceQueues'][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0x5a')]+=0x1;_0xd008ba[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x44bf6d=_0xd008ba[_0x5bec('0x21')][_0xa8d9c3[_0x5bec('0xab')]];var _0x352c13=new Hangup(_0xa8d9c3,_0x17214f);_0x352c13[_0x5bec('0x9d')]=0x13;_0x352c13[_0x5bec('0x9e')]=_0x5bec('0xe0');_0x352c13[_0x5bec('0xda')]=_0x5bec('0xdb');_0x352c13[_0x5bec('0xe1')]+=0x1;_0x352c13[_0x5bec('0xe2')]+=0x1;_0x352c13[_0x5bec('0xdd')]=!![];ami[_0x5bec('0x48')]('custom:amd',ut['buildObj'](_0x352c13,_0x5bec('0xdd')));_0xd008ba['createHistory'](_0x352c13)['catch'](loggerCatch(_0x5bec('0xe3')));if(_0x352c13[_0x5bec('0xe4')]+_0x352c13[_0x5bec('0xe5')]+_0x352c13[_0x5bec('0xe6')]+_0x352c13[_0x5bec('0xe7')]+_0x352c13[_0x5bec('0xe8')]+_0x352c13['countabandonedretry']+_0x352c13[_0x5bec('0xe1')]+_0x352c13['countagentrejectretry']>=_0x44bf6d[_0x5bec('0xe9')]){_0xd008ba[_0x5bec('0xea')](_0x352c13,_0x45e155,_0x2b6322,_0x5bec('0xeb'));}else{if(_0x352c13['countmachineretry']>=_0x44bf6d[_0x5bec('0xec')]){_0xd008ba[_0x5bec('0xed')](_0x352c13,_0x45e155,_0x2b6322,_0x5bec('0xee'));}else{_0xd008ba['rescheduleContact']({'active':![],'countmachineretry':_0x352c13[_0x5bec('0xe1')],'scheduledat':moment()[_0x5bec('0xef')](_0x44bf6d['dialMachineRetryFrequency'],_0x5bec('0xf0'))['format'](_0x5bec('0xf1')),'ContactId':_0x352c13[_0x5bec('0xc8')],'ListId':_0x352c13['ListId'],'VoiceQueueId':_0x352c13[_0x5bec('0xcb')]||undefined,'CampaignId':_0x352c13[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch('[rescheduleContact][Machine]'));_0x45e155({'reschedule':0x1});}}});}if(_0xa8d9c3[_0x5bec('0x49')]===_0x5bec('0x72')&&this[_0x5bec('0xf3')][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]===_0x5bec('0xf4')){delete this[_0x5bec('0xa2')][_0x17214f[_0x5bec('0xd2')]];this[_0x5bec('0xa9')](this[_0x5bec('0xf3')][_0xa8d9c3['queue']]);_0x113d2d=new Hangup(_0xa8d9c3,_0x17214f);_0x113d2d['state']=0x12;_0x113d2d[_0x5bec('0x9e')]=_0x5bec('0xd9');_0x113d2d['membername']='AMD';ami[_0x5bec('0x48')](_0x5bec('0xf5'),ut[_0x5bec('0xdc')](_0x113d2d,_0x5bec('0xdd')));this[_0x5bec('0xc6')](_0x113d2d,_0x5bec('0xf6'),_0x5bec('0xf7'));}if(_0xa8d9c3['type']===_0x5bec('0x72')&&this['campaigns'][_0xa8d9c3[_0x5bec('0xab')]][_0x5bec('0xd7')]&&_0x17214f[_0x5bec('0xd8')]===_0x5bec('0xf8')){var _0xd008ba=this;return new BPromise(function(_0x3d89df,_0x3889a7){delete _0xd008ba['uniqueId'][_0x17214f[_0x5bec('0xd2')]];_0xd008ba['updateOriginated'](_0xd008ba[_0x5bec('0xf3')][_0xa8d9c3[_0x5bec('0xab')]]);_0xd008ba['campaigns'][_0xa8d9c3['queue']]['outboundAnswerCallsDay']+=0x1;_0xd008ba[_0x5bec('0xf3')][_0xa8d9c3['queue']][_0x5bec('0x59')]+=0x1;var _0x1c6d9c=_0xd008ba[_0x5bec('0xf3')][_0xa8d9c3[_0x5bec('0xab')]];var _0x5e70f7=new Hangup(_0xa8d9c3,_0x17214f);_0x5e70f7[_0x5bec('0x9d')]=0x13;_0x5e70f7[_0x5bec('0x9e')]='Machine';_0x5e70f7[_0x5bec('0xda')]=_0x5bec('0xdb');_0x5e70f7['countmachineretry']+=0x1;_0x5e70f7['countglobal']+=0x1;_0x5e70f7[_0x5bec('0xdd')]=!![];ami[_0x5bec('0x48')](_0x5bec('0xf5'),ut['buildObj'](_0x5e70f7,_0x5bec('0xdd')));_0xd008ba['createHistory'](_0x5e70f7)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5e70f7[_0x5bec('0xe4')]+_0x5e70f7['countcongestionretry']+_0x5e70f7['countnoanswerretry']+_0x5e70f7[_0x5bec('0xe7')]+_0x5e70f7['countdropretry']+_0x5e70f7[_0x5bec('0xf9')]+_0x5e70f7['countmachineretry']+_0x5e70f7[_0x5bec('0xfa')]>=_0x1c6d9c[_0x5bec('0xe9')]){_0xd008ba[_0x5bec('0xea')](_0x5e70f7,_0x3d89df,_0x3889a7,_0x5bec('0xeb'));}else{if(_0x5e70f7[_0x5bec('0xe1')]>=_0x1c6d9c[_0x5bec('0xec')]){_0xd008ba['createStateFinal'](_0x5e70f7,_0x3d89df,_0x3889a7,_0x5bec('0xee'));}else{_0xd008ba['rescheduleContact']({'active':![],'countmachineretry':_0x5e70f7[_0x5bec('0xe1')],'scheduledat':moment()[_0x5bec('0xef')](_0x1c6d9c[_0x5bec('0xfb')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x5e70f7[_0x5bec('0xc8')],'ListId':_0x5e70f7[_0x5bec('0xc9')],'VoiceQueueId':_0x5e70f7[_0x5bec('0xcb')]||undefined,'CampaignId':_0x5e70f7[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xfc')));_0x3d89df({'reschedule':0x1});}}});}}};Dialer[_0x5bec('0x1b')][_0x5bec('0xfd')]=function(_0x1ed888){var _0x3ee1e6=this[_0x5bec('0xa2')][_0x1ed888[_0x5bec('0xd2')]];var _0x32b146=this;var _0x36c5ba;if(_0x3ee1e6&&_0x3ee1e6[_0x5bec('0x49')]==='ivr'){delete this[_0x5bec('0xa2')][_0x1ed888['uniqueid']];this[_0x5bec('0xa9')](this[_0x5bec('0xf3')][_0x3ee1e6[_0x5bec('0xab')]]);this['campaigns'][_0x3ee1e6['queue']][_0x5bec('0xfe')]+=0x1;_0x36c5ba=new Hangup(_0x3ee1e6,_0x1ed888);this['createHistory'](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xff')));this['moveContactManagedDialer'](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch('[syncHangupIvr]'));}if(_0x3ee1e6&&_0x3ee1e6[_0x5bec('0x49')]!==_0x5bec('0x72')&&isNotNull(this['voiceQueues'][_0x3ee1e6[_0x5bec('0xab')]]['dialQueueProject'])){delete this[_0x5bec('0xa2')][_0x1ed888['uniqueid']];this[_0x5bec('0xa9')](this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]]);this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]]['outboundAnswerCallsDay']+=0x1;this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]][_0x5bec('0x59')]+=0x1;_0x36c5ba=new Hangup(_0x3ee1e6,_0x1ed888);_0x36c5ba['state']=0x10;_0x36c5ba[_0x5bec('0x9e')]='AnswerAGI';_0x36c5ba[_0x5bec('0xda')]='AGI';this[_0x5bec('0xc2')](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xff')));this['moveContactManagedDialer'](_0x36c5ba)['catch'](loggerCatch(_0x5bec('0x100')));}if(_0x3ee1e6&&_0x3ee1e6[_0x5bec('0x49')]!==_0x5bec('0x72')&&!isNotNull(this['voiceQueues'][_0x3ee1e6['queue']][_0x5bec('0x101')])){delete this[_0x5bec('0xa2')][_0x1ed888['uniqueid']];this[_0x5bec('0xa9')](this[_0x5bec('0x21')][_0x3ee1e6[_0x5bec('0xab')]]);this[_0x5bec('0x21')][_0x3ee1e6['queue']][_0x5bec('0x102')]+=0x1;_0x36c5ba=new Hangup(_0x3ee1e6,_0x1ed888);_0x36c5ba['state']=0xc;_0x36c5ba['statedesc']=_0x1ed888[_0x5bec('0x103')];_0x36c5ba[_0x5bec('0xda')]='Unknow';this[_0x5bec('0xc2')](_0x36c5ba)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xff')));this['moveContactManagedDialer'](_0x36c5ba)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x5bec('0x1b')][_0x5bec('0x31')]=function(_0x41b127){var _0x2839ad=this['uniqueId'][_0x41b127[_0x5bec('0xd2')]];var _0x5d8a40=this;if(this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]]){if(_0x2839ad&&_0x2839ad[_0x5bec('0x49')]!==_0x5bec('0x72')){delete this['uniqueId'][_0x41b127[_0x5bec('0xd2')]];this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]]['outboundAnswerCallsDay']+=0x1;var _0x2ab5f3=new AgentComplete(_0x2839ad,_0x41b127);if(_0x41b127[_0x5bec('0x104')]===_0x5bec('0x105')){_0x2ab5f3[_0x5bec('0x106')]=this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]][_0x5bec('0x107')]&&this[_0x5bec('0x21')][_0x41b127[_0x5bec('0xab')]][_0x5bec('0x108')]?moment()[_0x5bec('0x70')](_0x5bec('0xf1')):undefined;}this['createHistory'](_0x2ab5f3)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x109')));this[_0x5bec('0xc0')](_0x2ab5f3)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x10a')));}}};Dialer[_0x5bec('0x1b')][_0x5bec('0x10b')]=function(_0x40a94d){if(this[_0x5bec('0x21')][_0x40a94d['queue']]){if(this[_0x5bec('0xa2')][_0x40a94d[_0x5bec('0xd2')]]&&this[_0x5bec('0xa2')][_0x40a94d['uniqueid']]['type']!==_0x5bec('0x72')){this[_0x5bec('0xa9')](this['voiceQueues'][_0x40a94d[_0x5bec('0xab')]]);this[_0x5bec('0xa2')][_0x40a94d[_0x5bec('0xd2')]][_0x5bec('0x10c')]=moment()[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x5bec('0x1b')][_0x5bec('0x10d')]=function(_0x435f1f){this['createHistory'](_0x435f1f)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x5bec('0xc0')](_0x435f1f)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x10e')));};Dialer[_0x5bec('0x1b')]['syncQueueCallerAbandon']=function(_0x4e6f3e){var _0xa30c49=this[_0x5bec('0xa2')][_0x4e6f3e[_0x5bec('0xd2')]];var _0x41bb0c=this;if(this[_0x5bec('0x21')][_0x4e6f3e['queue']]){if(_0xa30c49&&_0xa30c49[_0x5bec('0x49')]!==_0x5bec('0x72')){delete this[_0x5bec('0xa2')][_0x4e6f3e[_0x5bec('0xd2')]];this['updateOriginated'](this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]]);_0xa30c49[_0x5bec('0x10f')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));var _0x3f02bb=new QueueCallerAbandon(_0xa30c49,_0x4e6f3e);if(getSeconds(_0xa30c49[_0x5bec('0x10f')],_0xa30c49['responsetime'])>=_0xa30c49[_0x5bec('0x110')]){this['voiceQueues'][_0x4e6f3e['queue']][_0x5bec('0x65')]+=0x1;this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x5e')]+=0x1;this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x111')]+=0x1;_0x3f02bb[_0x5bec('0x9d')]=0xa;_0x3f02bb['statedesc']=_0x5bec('0x112');_0x3f02bb[_0x5bec('0x113')]='TIMEOUT';_0x3f02bb[_0x5bec('0x106')]=this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x107')]?moment()[_0x5bec('0x70')](_0x5bec('0xf1')):undefined;_0x3f02bb[_0x5bec('0xe8')]+=0x1;_0x3f02bb['countglobal']+=0x1;if(_0x3f02bb[_0x5bec('0xe8')]>=this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x114')]){this[_0x5bec('0x10d')](_0x3f02bb);}else{this[_0x5bec('0xb6')]({'active':![],'countdropretry':_0x3f02bb[_0x5bec('0xe8')],'scheduledat':moment()[_0x5bec('0xef')](this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]]['dialDropRetryFrequency'],_0x5bec('0xf0'))[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xa30c49['ContactId'],'ListId':_0xa30c49[_0x5bec('0xc9')],'VoiceQueueId':_0xa30c49[_0x5bec('0xcb')]||undefined,'CampaignId':_0xa30c49[_0x5bec('0xf2')]||undefined})['catch'](loggerCatch(_0x5bec('0x115')));var _0x5221a8=new History(_0x3f02bb);_0x5221a8[_0x5bec('0x9d')]=0xa;_0x5221a8[_0x5bec('0x9e')]=_0x5bec('0x112');_0x5221a8[_0x5bec('0xa0')]=moment()['format'](_0x5bec('0xf1'));_0x5221a8[_0x5bec('0x9f')]=_0x5221a8[_0x5bec('0xa0')];_0x5221a8[_0x5bec('0x116')]=_0x3f02bb['calleridname'];_0x5221a8[_0x5bec('0x117')]=_0x3f02bb[_0x5bec('0x117')];this[_0x5bec('0xc2')](_0x5221a8)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x118')));}}else{this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x7a')]+=0x1;this['voiceQueues'][_0x4e6f3e[_0x5bec('0xab')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3f02bb[_0x5bec('0x9d')]=0xb;_0x3f02bb[_0x5bec('0x9e')]=_0x5bec('0x119');_0x3f02bb[_0x5bec('0x113')]=_0x5bec('0x11a');_0x3f02bb[_0x5bec('0xf9')]+=0x1;_0x3f02bb[_0x5bec('0xe2')]+=0x1;if(_0x3f02bb[_0x5bec('0xf9')]>=this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x11b')]){this[_0x5bec('0x10d')](_0x3f02bb);}else{this[_0x5bec('0xb6')]({'active':![],'countabandonedretry':_0x3f02bb[_0x5bec('0xf9')],'scheduledat':moment()[_0x5bec('0xef')](this[_0x5bec('0x21')][_0x4e6f3e[_0x5bec('0xab')]][_0x5bec('0x11c')],'minutes')[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0xa30c49['ContactId'],'ListId':_0xa30c49['ListId'],'VoiceQueueId':_0xa30c49[_0x5bec('0xcb')]||undefined,'CampaignId':_0xa30c49[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x11d')));var _0x5221a8=new History(_0x3f02bb);_0x5221a8[_0x5bec('0x9d')]=0xb;_0x5221a8[_0x5bec('0x9e')]='Abandoned';_0x5221a8[_0x5bec('0xa0')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));_0x5221a8[_0x5bec('0x9f')]=_0x5221a8[_0x5bec('0xa0')];_0x5221a8[_0x5bec('0x116')]=_0x3f02bb[_0x5bec('0x116')];_0x5221a8['calleridnum']=_0x3f02bb['calleridnum'];this[_0x5bec('0xc2')](_0x5221a8)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x5bec('0x1b')][_0x5bec('0x34')]=function(_0x568a42){if(this[_0x5bec('0xa4')][_0x568a42[_0x5bec('0xd2')]]){this[_0x5bec('0xa4')][_0x568a42['uniqueid']]['channel']=_0x568a42['channel'];}if(this[_0x5bec('0xa2')][_0x568a42[_0x5bec('0xd2')]]){this['uniqueId'][_0x568a42[_0x5bec('0xd2')]]['channel']=_0x568a42[_0x5bec('0xa7')];}};Dialer[_0x5bec('0x1b')][_0x5bec('0x36')]=function(_0x27fb59){if(strategy[this['voiceQueues'][this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x11f')]]===_0x5bec('0x1a')){if(this['actions'][_0x27fb59[_0x5bec('0x11e')]]&&_['isNil'](this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]]['locked'])&&_0x27fb59[_0x5bec('0xd0')]==='1'&&_0x27fb59[_0x5bec('0x120')]==='0'){if(this[_0x5bec('0x22')][_0x27fb59['stateinterface']]){if(!this[_0x5bec('0x22')][_0x27fb59[_0x5bec('0x121')]]['locked']){this[_0x5bec('0x22')][_0x27fb59[_0x5bec('0x121')]][_0x5bec('0x122')]=!![];this[_0x5bec('0xa4')][_0x27fb59['actionid']][_0x5bec('0x122')]=!![];this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0x121')]=_0x27fb59['stateinterface'];}}}}else if((strategy[this[_0x5bec('0x21')][this['actions'][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]]['strategy']]||_0x5bec('0x19'))===_0x5bec('0x19')){if(this[_0x5bec('0xa4')][_0x27fb59['actionid']]){if(this[_0x5bec('0x22')][_0x27fb59['stateinterface']]){this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]]['stateinterface']=_0x27fb59[_0x5bec('0x121')];if(_[_0x5bec('0xd3')](this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x27fb59['actionid']][_0x5bec('0xab')]])){this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]]=[];}this[_0x5bec('0x2b')][this['actions'][_0x27fb59[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x123')](_[_0x5bec('0x86')](_[_0x5bec('0xc7')](this[_0x5bec('0xa4')][_0x27fb59['actionid']],[_0x5bec('0x124'),_0x5bec('0x121')]),{'status':_0x27fb59['status'],'paused':_0x27fb59[_0x5bec('0x120')]}));}}}};function unlockQueueStatus(_0x5caeb7,_0x5e6281){setTimeout(function(){if(_[_0x5bec('0x39')](_0x5caeb7[_0x5bec('0x125')])){loggerBooked['error'](_0x5bec('0x126'),_0x5e6281);}_0x5caeb7['queueStatusComplete']=!![];loggerBooked[_0x5bec('0x75')](_0x5bec('0x127'),_0x5e6281,JSON[_0x5bec('0x45')](_[_0x5bec('0xc7')](_0x5caeb7,['name',_0x5bec('0x125')])));},0x1f3);}Dialer['prototype'][_0x5bec('0x128')]=function(_0x38fa44){var _0x5e632f=this;var _0x19d3cc=_0x5e632f[_0x5bec('0x21')][_0x5e632f['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]];if(strategy[this['voiceQueues'][this['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x11f')]]===_0x5bec('0x1a')){if(this['actions'][_0x38fa44[_0x5bec('0x11e')]]&&this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0x121')]){this[_0x5bec('0x20')][_0x5bec('0x129')](this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0x124')],this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0x121')])[_0x5bec('0xa8')](function(_0x52a7fd){logger[_0x5bec('0x8f')](_0x5bec('0x12a'),util[_0x5bec('0x90')](_0x52a7fd,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5e632f['updateOriginated'](_0x5e632f['voiceQueues'][_0x5e632f[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']]);_0x5e632f['agents'][_0x5e632f[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['stateinterface']][_0x5bec('0x122')]=![];delete _0x5e632f[_0x5bec('0xa4')][_0x38fa44['actionid']];unlockQueueStatus(_0x19d3cc);});}else{this[_0x5bec('0xa9')](this[_0x5bec('0x21')][this['actions'][_0x38fa44['actionid']][_0x5bec('0xab')]]);this[_0x5bec('0xb6')]({'active':![],'ContactId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xc8')],'ListId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xc9')],'VoiceQueueId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xcb')]||undefined,'CampaignId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x5bec('0x12b')));delete this['actions'][_0x38fa44['actionid']];unlockQueueStatus(_0x19d3cc);}}else if((strategy[this[_0x5bec('0x21')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']][_0x5bec('0x11f')]]||_0x5bec('0x19'))===_0x5bec('0x19')){var _0x2d73fb;if(this['actions'][_0x38fa44[_0x5bec('0x11e')]]&&!_[_0x5bec('0x42')](this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]])){if(this['queueBookedRR'][_0x5e632f['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]){this[_0x5bec('0x12c')][_0x5e632f[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]=this[_0x5bec('0x12c')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']]?this[_0x5bec('0x12c')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]:this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]?this[_0x5bec('0x2b')][this['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x12d')]||0x0:0x0;}this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x12d')]=this['queueBookedRR'][this['actions'][_0x38fa44['actionid']][_0x5bec('0xab')]];for(var _0x44306d=0x0;_0x44306d<this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]['length'];_0x44306d+=0x1){_0x2d73fb=rr(this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]);this[_0x5bec('0x12c')][_0x5e632f['actions'][_0x38fa44[_0x5bec('0x11e')]]['queue']]=this[_0x5bec('0x2b')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]][_0x5bec('0x12d')];if(_0x2d73fb[_0x5bec('0xd0')]==='1'&&_0x2d73fb[_0x5bec('0x120')]==='0'){break;}}if(!_[_0x5bec('0xd3')](_0x2d73fb)){this[_0x5bec('0x22')][_0x2d73fb[_0x5bec('0x121')]][_0x5bec('0x12e')]=_['isUndefined'](this['agents'][_0x2d73fb[_0x5bec('0x121')]][_0x5bec('0x12e')])?!![]:this['agents'][_0x2d73fb['stateinterface']][_0x5bec('0x12e')];}loggerBooked['info'](_0x5bec('0x12f'),_0x38fa44[_0x5bec('0x11e')],_0x5bec('0x130'),JSON['stringify'](_['pick'](this[_0x5bec('0x22')][_0x2d73fb['stateinterface']],[_0x5bec('0x3b'),_0x5bec('0x12e')])),_0x5bec('0x131'),JSON[_0x5bec('0x45')](_0x2d73fb[_0x5bec('0x124')]));if(!_[_0x5bec('0xd3')](_0x2d73fb)&&_0x2d73fb['status']==='1'&&_0x2d73fb['paused']==='0'&&this[_0x5bec('0x22')][_0x2d73fb[_0x5bec('0x121')]][_0x5bec('0x12e')]){this[_0x5bec('0x22')][_0x2d73fb[_0x5bec('0x121')]]['unlockRR']=![];this[_0x5bec('0x2b')][_0x5e632f[_0x5bec('0xa4')][_0x38fa44['actionid']]['queue']]=[];this[_0x5bec('0x20')][_0x5bec('0x129')](_0x2d73fb[_0x5bec('0x124')],_0x2d73fb[_0x5bec('0x121')])[_0x5bec('0xa8')](function(_0x23dd32){logger['error'](_0x5bec('0x12a'),util[_0x5bec('0x90')](_0x23dd32,{'showHidden':![],'depth':null}));})[_0x5bec('0x1e')](function(){_0x5e632f['updateOriginated'](_0x5e632f[_0x5bec('0x21')][_0x5e632f['actions'][_0x38fa44['actionid']][_0x5bec('0xab')]]);setTimeout(function(){_0x5e632f[_0x5bec('0x22')][_0x2d73fb[_0x5bec('0x121')]][_0x5bec('0x12e')]=!![];loggerBooked[_0x5bec('0x75')]('[booked][RR][finaly]',_0x38fa44[_0x5bec('0x11e')],'Agent:\x20',JSON[_0x5bec('0x45')](_[_0x5bec('0xc7')](_0x5e632f[_0x5bec('0x22')][_0x2d73fb['stateinterface']],['name','unlockRR'])),_0x5bec('0x131'),JSON[_0x5bec('0x45')](_0x2d73fb[_0x5bec('0x124')]));},0xc7);delete _0x5e632f['actions'][_0x38fa44[_0x5bec('0x11e')]];unlockQueueStatus(_0x19d3cc,_0x38fa44[_0x5bec('0x11e')]);});}else{loggerBooked[_0x5bec('0x75')](_0x5bec('0x132'));this['updateOriginated'](this[_0x5bec('0x21')][this[_0x5bec('0xa4')][_0x38fa44['actionid']][_0x5bec('0xab')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['ContactId'],'ListId':this[_0x5bec('0xa4')][_0x38fa44['actionid']][_0x5bec('0xc9')],'VoiceQueueId':this['actions'][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xcb')]||undefined,'CampaignId':this[_0x5bec('0xa4')][_0x38fa44['actionid']][_0x5bec('0xf2')]||undefined})['catch'](loggerCatch(_0x5bec('0x12b')));delete this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]];unlockQueueStatus(_0x19d3cc);}}else{loggerBooked[_0x5bec('0x75')]('[booked][unlock2]');this[_0x5bec('0xa9')](this[_0x5bec('0x21')][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xab')]]);this[_0x5bec('0xb6')]({'active':![],'ContactId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xc8')],'ListId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xc9')],'VoiceQueueId':this['actions'][_0x38fa44[_0x5bec('0x11e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]][_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x133')));delete this[_0x5bec('0xa4')][_0x38fa44['actionid']];unlockQueueStatus(_0x19d3cc);}}else{loggerBooked[_0x5bec('0x75')](_0x5bec('0x134'));this[_0x5bec('0xa9')](this['voiceQueues'][this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['queue']]);this[_0x5bec('0xb6')]({'active':![],'ContactId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['ContactId'],'ListId':this[_0x5bec('0xa4')][_0x38fa44['actionid']][_0x5bec('0xc9')],'VoiceQueueId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]]['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x135')));delete this[_0x5bec('0xa4')][_0x38fa44[_0x5bec('0x11e')]];unlockQueueStatus(_0x19d3cc);}};Dialer[_0x5bec('0x1b')][_0x5bec('0x37')]=function(){var _0xd52582=this;setInterval(function(){_0xd52582[_0x5bec('0x136')]();},0x3e8);};Dialer[_0x5bec('0x1b')][_0x5bec('0x137')]=function(_0x15bfb3){var _0x5dd50e=this;return function(){if(!_0x5dd50e[_0x5bec('0xce')](_0x15bfb3[_0x5bec('0x6e')])){if(!_0x5dd50e[_0x5bec('0xce')](_0x15bfb3[_0x5bec('0x138')])){_0x15bfb3[_0x5bec('0x3a')]=_0x5bec('0x139');throw _0x15bfb3['name']+_0x5bec('0x13a');}}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x13b')]=function(_0x403133,_0x477c69,_0x2b8c5f,_0x29cd4e){var _0x17ec65=this;return function(){var _0x143fd7=!![];return _0x17ec65[_0x5bec('0x13c')](_0x403133,_0x477c69,_0x2b8c5f,_0x29cd4e,_0x143fd7);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x76a338,_0x4ee4bc,_0x2d204c,_0x2ce22b){var _0x5de21e=this;return function(){var _0x56c48b=![];return _0x5de21e['ifTime'](_0x76a338[_0x5bec('0x40')],_0x4ee4bc,_0x2d204c,_0x2ce22b,_0x56c48b);};};Dialer['prototype'][_0x5bec('0x13c')]=function(_0x11ea81,_0x1bcfd3,_0x5a9874,_0x47dbd0,_0x5a0a86){var _0x402bcf=[];return new BPromise(function(_0xe98363,_0x3bcd32){if(!isNotNull(_0x11ea81)){_0x47dbd0[_0x5bec('0x3a')]=_0x5bec('0x3e');return _0x3bcd32(msgResponse(_0x5bec('0x13c'),_0x5bec('0x13d'),_0x5a9874+_0x5bec('0x13e')));}if(_[_0x5bec('0x42')](_0x11ea81)){_0x47dbd0[_0x5bec('0x3a')]=_0x5bec('0x13f');return _0x3bcd32(msgResponse(_0x5bec('0x13c'),_0x5bec('0x13d'),_0x5a9874+_0x5bec('0x140')));}if(_0x1bcfd3&&_['isUndefined'](config[_0x5bec('0x141')][_0x1bcfd3])){_0x47dbd0[_0x5bec('0x3a')]='TIMEZONE_UNKNOW';return _0x3bcd32(msgResponse(_0x5bec('0x13c'),'Failure',_0x5a9874+_0x5bec('0x142')+_0x1bcfd3));}if(_[_0x5bec('0x143')](_0x11ea81)){for(var _0x46c748=0x0;_0x46c748<_0x11ea81[_0x5bec('0x92')];_0x46c748+=0x1){_0x402bcf['push'](ami[_0x5bec('0xa6')]({'action':_0x5bec('0x144'),'command':util[_0x5bec('0x70')](_0x5bec('0x145'),_0x11ea81[_0x46c748][_0x5bec('0x146')],!_[_0x5bec('0x39')](config[_0x5bec('0x141')][_0x1bcfd3])?_0x1bcfd3:'')})['then'](function(_0x22844a){return _0x22844a['content']['indexOf'](_0x5bec('0x147'))>=0x0;})['catch'](myreject(_0x3bcd32)));}}else{_0x402bcf[_0x5bec('0x123')](ami['Action']({'action':_0x5bec('0x144'),'command':util[_0x5bec('0x70')](_0x5bec('0x145'),_0x11ea81,!_['isUndefined'](config['timezones'][_0x1bcfd3])?_0x1bcfd3:'')})['then'](function(_0x30bbf7){return _0x30bbf7[_0x5bec('0x148')][_0x5bec('0x149')](_0x5bec('0x147'))>=0x0;})[_0x5bec('0xa8')](myreject(_0x3bcd32)));}BPromise['all'](_0x402bcf)[_0x5bec('0xb0')](function(_0x47262c){var _0x215bbd=_['some'](_0x47262c);if(_0x215bbd){return _0xe98363(_0x215bbd);}else{_0x47dbd0['message']=_0x5a0a86?_0x5bec('0x14a'):_0x5bec('0x14b');return _0x3bcd32(msgResponse(_0x5bec('0x14c'),_0x5bec('0x13d'),_0x5bec('0x14d')+_0x5a0a86+'\x20'+_0x5a9874+_0x5bec('0x14e')+util[_0x5bec('0x90')](_0x11ea81,{'showHidden':![],'depth':null})+_0x5bec('0x14f')+_0x1bcfd3));}})[_0x5bec('0xa8')](function(_0x2ba43e){return _0x3bcd32(msgResponse('ifTime',_0x5bec('0x13d'),JSON[_0x5bec('0x45')](_0x2ba43e)));});});};Dialer[_0x5bec('0x1b')][_0x5bec('0x150')]=function(_0xd31995){var _0x2b3181=this;return function(){switch(_0xd31995[_0x5bec('0x151')]){case _0x5bec('0x152'):freeVariablesPredictive(_0xd31995);_0x2b3181[_0x5bec('0x153')](_0xd31995,0x1);break;case _0x5bec('0x154'):freeVariablesPredictive(_0xd31995);_0x2b3181[_0x5bec('0x153')](_0xd31995,_0xd31995['dialPowerLevel']);break;case _0x5bec('0x9'):_0x2b3181['predictive'](_0xd31995);break;case _0x5bec('0x155'):freeVariablesPredictive(_0xd31995);_0x2b3181['handlePower'](_0xd31995,0x1);break;default:freeVariablesPredictive(_0xd31995);logger[_0x5bec('0x8f')](_0x5bec('0x156'),_0xd31995[_0x5bec('0x3b')],'method\x20not\x20recognized');}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x157')]=function(_0x3281d5){var _0x30125d=this;return function(){_0x30125d[_0x5bec('0x158')](_0x3281d5);};};Dialer['prototype'][_0x5bec('0xb')]=function(_0x40d8e7){var _0x52cda2=this;if(isNotPreview(_0x40d8e7[_0x5bec('0x151')])){if(isVoiceQueueOutbound(_0x40d8e7[_0x5bec('0x49')])&&isActive(_0x40d8e7['dialActive'])){_0x40d8e7[_0x5bec('0x98')]=!![];BPromise[_0x5bec('0xae')]()[_0x5bec('0xb0')](checkIsLoggedIn(_0x40d8e7,_0x40d8e7[_0x5bec('0x4d')]))['then'](checkIsActive(_0x40d8e7,_0x40d8e7[_0x5bec('0x56')]))['then'](checkInterval(_0x40d8e7))[_0x5bec('0xb0')](_0x52cda2['checkIsTrunkReachable'](_0x40d8e7))[_0x5bec('0xb0')](_0x52cda2[_0x5bec('0x13b')](_0x40d8e7[_0x5bec('0x159')],_0x40d8e7[_0x5bec('0x15a')],_0x40d8e7[_0x5bec('0x3b')],_0x40d8e7))['then'](_0x52cda2['checkIfTimeIntervals'](_0x40d8e7[_0x5bec('0x3f')],_0x40d8e7[_0x5bec('0x15a')],_0x40d8e7['name'],_0x40d8e7))[_0x5bec('0xb0')](_0x52cda2[_0x5bec('0x150')](_0x40d8e7))[_0x5bec('0xa8')](loggerCatchQueueSummary(_0x5bec('0x15b'),_0x40d8e7));}else{notSendMessagesQueue(_0x40d8e7);}}else{freeVariablesPredictive(_0x40d8e7);}};Dialer[_0x5bec('0x1b')][_0x5bec('0x136')]=function(){var _0x3dd7ab=this;var _0x1da1e6;for(var _0x140748 in this[_0x5bec('0xf3')]){if(typeof this[_0x5bec('0xf3')][_0x140748]!==_0x5bec('0x93')){_0x1da1e6=this['campaigns'][_0x140748];if(isCampaignIvr(_0x1da1e6[_0x5bec('0x49')])&&isActive(_0x1da1e6['active'])){_0x1da1e6['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x5bec('0xb0')](checkIsActive(_0x1da1e6,_0x1da1e6[_0x5bec('0x6f')]))[_0x5bec('0xb0')](checkInterval(_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab['checkIsTrunkReachable'](_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab[_0x5bec('0x13b')](_0x1da1e6[_0x5bec('0x159')],_0x1da1e6[_0x5bec('0x15a')],_0x1da1e6[_0x5bec('0x3b')],_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab['checkIfTimeIntervals'](_0x1da1e6['Interval'],_0x1da1e6[_0x5bec('0x15a')],_0x1da1e6[_0x5bec('0x3b')],_0x1da1e6))[_0x5bec('0xb0')](_0x3dd7ab[_0x5bec('0x157')](_0x1da1e6))[_0x5bec('0xa8')](loggerCatchQueueSummary(_0x5bec('0x15c'),_0x1da1e6));}else{notSendMessagesCampaign(_0x1da1e6);}}}};function getCallerIdRandom(_0x3feee3,_0x486f98){var _0x28b63f;var _0xaefcd0;var _0xacf9dc;if(_0x486f98<=0x0){_0x486f98=0x1;}_0x28b63f=new RegExp('\x5cw{0,'+_0x486f98+'}$');_0xaefcd0=Math['pow'](0xa,_0x486f98-0x1);_0xacf9dc=Math['pow'](0xa,_0x486f98)-0x1;return util[_0x5bec('0x70')]('%s',_[_0x5bec('0x15d')](_0x3feee3,_0x28b63f,_[_0x5bec('0x15e')](_0xaefcd0,_0xacf9dc)));}function extractCalleridName(_0x4d7923){var _0x3e529c=_0x4d7923[_0x5bec('0x15f')](/"(.*?)"/);return _0x3e529c?_0x3e529c[0x1]:_0x4d7923;}function extractCalleridNumber(_0x27085f){var _0x323057=_0x27085f[_0x5bec('0x15f')](/<(.*?)>/);return _0x323057?_0x323057[0x1]:_0x27085f;}Dialer['prototype']['actionOriginate']=function(_0x244733,_0x179bfc){var _0x73f273=this;var _0x86dd64=uuid['v4']();this[_0x5bec('0xa4')][_0x86dd64]=new Action(_0x244733,_0x179bfc,_0x86dd64);return new BPromise(function(_0x1d34a5,_0x44480d){if(_[_0x5bec('0x39')](_0x244733)&&typeof _0x244733!==_0x5bec('0x160')){return _0x44480d(msgResponse('originate',_0x5bec('0x13d'),_0x5bec('0x161')));}if(_['isUndefined'](_0x179bfc['Contact'][_0x5bec('0x162')])||_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')]===null){return _0x44480d(msgResponse('originate',_0x5bec('0x13d'),_0x5bec('0x164')));}var _0x128778={'XMD-CALLERID':_0x73f273[_0x5bec('0xa4')][_0x86dd64]['getCaller'](),'XMD-AGI':_0x244733[_0x5bec('0x101')]?util['format'](_0x5bec('0x165'),ipAgi,_0x244733['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x244733[_0x5bec('0x107')]?util[_0x5bec('0x70')]('\x22agi://%s/square,%s\x22',ipAgi,_0x244733[_0x5bec('0x107')]):_0x5bec('0x166'),'XMD-QUEUE':_0x244733[_0x5bec('0x49')]===_0x5bec('0x4a')?util[_0x5bec('0x70')](_0x5bec('0x167'),_0x244733['name'],_0x244733[_0x5bec('0x168')]||'',_0x244733['dialAgiAfterHangupAgent']?'c':'',_0x244733[_0x5bec('0x110')]||0x3):_0x5bec('0x166'),'XMD-CONTACTID':_0x179bfc['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x73f273[_0x5bec('0xa4')][_0x86dd64][_0x5bec('0x169')](),'XMD-AMD':_0x244733[_0x5bec('0xd7')]?_0x5bec('0x16a'):_0x5bec('0x166'),'XMD-DESTINATION':_0x5bec('0x16b')};if(_0x244733[_0x5bec('0xd7')]){_0x128778[_0x5bec('0x16c')]=_0x244733[_0x5bec('0x16d')]||0x9c4;_0x128778['XMD-AMDGREETING']=_0x244733[_0x5bec('0x16e')]||0x5dc;_0x128778[_0x5bec('0x16f')]=_0x244733[_0x5bec('0x170')]||0x320;_0x128778[_0x5bec('0x171')]=_0x244733['dialAMDTotalAnalysisTime']||0x1388;_0x128778[_0x5bec('0x172')]=_0x244733[_0x5bec('0x173')]||0x64;_0x128778['XMD-AMDBETWEENWORDSSILENCE']=_0x244733['dialAMDBetweenWordsSilence']||0x32;_0x128778['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x244733[_0x5bec('0x174')]||0x3;_0x128778[_0x5bec('0x175')]=_0x244733[_0x5bec('0x176')]||0x100;_0x128778[_0x5bec('0x177')]=_0x244733['dialAMDMaximumWordLength']||0x1388;}if(_0x244733[_0x5bec('0x49')]===_0x5bec('0x4a')){_0x128778[_0x5bec('0x178')]=_0x179bfc['VoiceQueueId'];}else{_0x128778['XMD-CAMPAIGNID']=_0x179bfc[_0x5bec('0xf2')];}for(var _0x2342fd in _0x179bfc['Contact']){if(typeof _0x179bfc[_0x5bec('0x163')][_0x2342fd]!==_0x5bec('0x93')){if(isNotNull(_0x179bfc[_0x5bec('0x163')][_0x2342fd])&&_0x2342fd!=='id'&&_0x2342fd!==_0x5bec('0x179')&&_0x2342fd!==_0x5bec('0x17a')&&_0x2342fd!==_0x5bec('0x17b')){_0x128778[util[_0x5bec('0x70')](_0x5bec('0x17c'),_0x5bec('0x17d'),_['toUpper'](_0x2342fd))]=_0x179bfc[_0x5bec('0x163')][_0x2342fd];}}}var _0x2c7d0a=_0x73f273[_0x5bec('0xce')](_0x244733[_0x5bec('0x6e')])?getCallerId(_0x244733[_0x5bec('0x6e')][_0x5bec('0x17e')],_0x244733['dialOriginateCallerIdName'],_0x244733[_0x5bec('0x17f')]>0x0?getCallerIdRandom(_0x244733[_0x5bec('0x57')],_0x244733[_0x5bec('0x17f')]):_0x244733['dialOriginateCallerIdNumber']):getCallerId(_[_0x5bec('0xd3')](_0x244733[_0x5bec('0x138')])?_0x244733[_0x5bec('0x6e')][_0x5bec('0x17e')]:_0x244733['TrunkBackup']['callerid'],_0x244733[_0x5bec('0x180')],_0x244733[_0x5bec('0x17f')]>0x0?getCallerIdRandom(_0x244733[_0x5bec('0x57')],_0x244733[_0x5bec('0x17f')]):_0x244733['dialOriginateCallerIdNumber']);if(_0x2c7d0a){_0x128778[_0x5bec('0x181')]=_0x73f273[_0x5bec('0xa4')][_0x86dd64][_0x5bec('0x182')]=extractCalleridName(_0x2c7d0a);_0x128778[_0x5bec('0x183')]=_0x73f273[_0x5bec('0xa4')][_0x86dd64]['originatecalleridnum']=extractCalleridNumber(_0x2c7d0a);}return ami[_0x5bec('0xa6')]({'actionid':_0x86dd64,'action':'originate','channel':_0x73f273['isTrunkReachable'](_0x244733[_0x5bec('0x6e')])?util[_0x5bec('0x70')](_0x5bec('0x184'),_0x244733['Trunk']['name'],isNotNull(_0x244733[_0x5bec('0x58')])?_0x244733['dialPrefix']['trim']()||'':'',_0x244733[_0x5bec('0x185')]>0x0?_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')][_0x5bec('0x186')](_0x244733[_0x5bec('0x185')]):_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')]):util[_0x5bec('0x70')](_0x5bec('0x184'),_['isNil'](_0x244733[_0x5bec('0x138')])?_0x244733[_0x5bec('0x6e')][_0x5bec('0x3b')]:_0x244733[_0x5bec('0x138')][_0x5bec('0x3b')],isNotNull(_0x244733[_0x5bec('0x58')])?_0x244733['dialPrefix'][_0x5bec('0x187')]()||'':'',_0x244733['dialCutDigit']>0x0?_0x179bfc[_0x5bec('0x163')][_0x5bec('0x162')][_0x5bec('0x186')](_0x244733[_0x5bec('0x185')]):_0x179bfc['Contact'][_0x5bec('0x162')]),'callerid':_0x2c7d0a,'Exten':_0x5bec('0x16b'),'Context':'from-sip','Priority':'1','variable':_0x128778,'timeout':(_0x244733[_0x5bec('0x188')]||0x1e)*0x3e8,'async':!![],'channelid':_0x86dd64})[_0x5bec('0xb0')](function(_0x1ccbb4){return _0x1d34a5(_0x1ccbb4);})[_0x5bec('0xa8')](function(_0x4200cb){_0x244733[_0x5bec('0x61')]+=0x1;var _0x5e43d1=new History(_0x73f273['actions'][_0x86dd64]);logger[_0x5bec('0x8f')](util[_0x5bec('0x70')](_0x5bec('0x189'),JSON['stringify'](_0x4200cb)));_0x5e43d1[_0x5bec('0x9d')]=0xe;_0x5e43d1['statedesc']=_0x5bec('0x18a');_0x5e43d1[_0x5bec('0xa0')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));_0x5e43d1[_0x5bec('0x9f')]=_0x5e43d1[_0x5bec('0xa0')];_0x73f273[_0x5bec('0xc2')](_0x5e43d1)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x18b')));_0x73f273[_0x5bec('0xc0')](_0x5e43d1)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x18b')))[_0x5bec('0x1e')](function(){delete _0x73f273[_0x5bec('0xa4')][_0x86dd64];return _0x44480d(msgResponse(_0x5bec('0x18c'),'Error',_0x5bec('0x18d')));});});});};Dialer[_0x5bec('0x1b')][_0x5bec('0x18e')]=function(_0x31ee25){var _0x364569=this[_0x5bec('0xa4')][_0x31ee25['actionid']];if(_0x364569){delete this[_0x5bec('0xa4')][_0x31ee25[_0x5bec('0x11e')]];_0x364569[_0x5bec('0x18f')]=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));var _0x365b78=_0x364569[_0x5bec('0x49')]==='ivr'?this[_0x5bec('0xf3')][_0x364569[_0x5bec('0xab')]]:this['voiceQueues'][_0x364569['getQueue']()];if(!this[_0x5bec('0xcd')](_0x31ee25[_0x5bec('0x190')])){this[_0x5bec('0xa9')](_0x365b78);return this[_0x5bec('0x191')](_0x364569,_0x365b78,_0x31ee25)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x192')));}this[_0x5bec('0xa2')][_0x31ee25['uniqueid']]=_0x364569;}};Dialer[_0x5bec('0x1b')][_0x5bec('0x193')]=function(_0x51d625,_0xf4debc,_0xd23c8){var _0x17ed5f=new History(_0xf4debc);if(_0x17ed5f[_0x5bec('0xe4')]+_0x17ed5f['countcongestionretry']+_0x17ed5f[_0x5bec('0xe6')]+_0x17ed5f['countnosuchnumberretry']+_0x17ed5f[_0x5bec('0xe8')]+_0x17ed5f[_0x5bec('0xf9')]+_0x17ed5f[_0x5bec('0xe1')]+_0x17ed5f[_0x5bec('0xfa')]>=_0xd23c8[_0x5bec('0xe9')]-0x1){return!![];}switch(_0x51d625){case 0x3:if(_0x17ed5f[_0x5bec('0xe6')]>=_0xd23c8[_0x5bec('0x194')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x17ed5f[_0x5bec('0xe6')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x195')],_0x5bec('0xf0'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x196')));break;case 0x5:if(_0x17ed5f[_0x5bec('0xe4')]>=_0xd23c8['dialBusyMaxRetry']-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countbusyretry':_0x17ed5f[_0x5bec('0xe4')]+=0x1,'scheduledat':moment()['add'](_0xd23c8[_0x5bec('0x197')],'minutes')[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x198')));break;case 0x8:if(_0x17ed5f[_0x5bec('0xe5')]>=_0xd23c8[_0x5bec('0x199')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countcongestionretry':_0x17ed5f[_0x5bec('0xe5')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x19a')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f['ContactId'],'ListId':_0x17ed5f['ListId'],'VoiceQueueId':_0x17ed5f['VoiceQueueId']||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x19b')));break;case 0x0:if(_0x17ed5f['countnosuchnumberretry']>=_0xd23c8[_0x5bec('0x19c')]-0x1){return!![];}else{this[_0x5bec('0xb6')]({'active':![],'countnosuchnumberretry':_0x17ed5f[_0x5bec('0xe7')]+=0x1,'scheduledat':moment()['add'](_0xd23c8[_0x5bec('0x19d')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f['ContactId'],'ListId':_0x17ed5f['ListId'],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x19e')));}break;case 0xa:if(_0x17ed5f[_0x5bec('0xe8')]>=_0xd23c8[_0x5bec('0x114')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countdropretry':_0x17ed5f[_0x5bec('0xe8')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8['dialDropRetryFrequency'],_0x5bec('0xf0'))[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f['VoiceQueueId']||undefined,'CampaignId':_0x17ed5f[_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x115')));break;case 0xb:if(_0x17ed5f['countabandonedretry']>=_0xd23c8[_0x5bec('0x11b')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countabandonedretry':_0x17ed5f[_0x5bec('0xf9')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x11c')],_0x5bec('0xf0'))[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x17ed5f['ContactId'],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x11d')));break;case 0x13:if(_0x17ed5f[_0x5bec('0xe1')]>=_0xd23c8[_0x5bec('0xec')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countmachineretry':_0x17ed5f[_0x5bec('0xe1')]+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0xfb')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xfc')));break;case 0x14:if(_0x17ed5f[_0x5bec('0xfa')]>=_0xd23c8[_0x5bec('0x19f')]-0x1){return!![];}this[_0x5bec('0xb6')]({'active':![],'countagentrejectretry':_0x17ed5f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x5bec('0xef')](_0xd23c8[_0x5bec('0x1a0')],_0x5bec('0xf0'))[_0x5bec('0x70')](_0x5bec('0xf1')),'ContactId':_0x17ed5f[_0x5bec('0xc8')],'ListId':_0x17ed5f[_0x5bec('0xc9')],'VoiceQueueId':_0x17ed5f[_0x5bec('0xcb')]||undefined,'CampaignId':_0x17ed5f['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x5bec('0x1b')]['callProgressDetecting']=function(_0x560e1a,_0x35e7bc,_0x476ae9){var _0x55bfda=this;var _0xef2d8d=new History(_0x560e1a);return new BPromise(function(_0x2c9ab3,_0x5b2a52){if(_[_0x5bec('0x39')](_0x35e7bc)&&typeof _0x35e7bc!==_0x5bec('0x160')){return _0x5b2a52(msgResponse(_0x5bec('0x1a1'),_0x5bec('0x13d'),'entity\x20is\x20undefine'));}if(_[_0x5bec('0x39')](_0x476ae9)&&typeof _0x476ae9!==_0x5bec('0x160')){return _0x5b2a52(msgResponse(_0x5bec('0x1a1'),_0x5bec('0x13d'),_0x5bec('0x1a2')));}switch(_0x476ae9['reason']){case'0':_0x35e7bc[_0x5bec('0x60')]+=0x1;_0xef2d8d['state']=0x0;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1a3');_0xef2d8d['countnosuchnumberretry']+=0x1;_0xef2d8d['countglobal']+=0x1;ami['emit'](_0x5bec('0x1a4'),ut['buildObj'](_0x560e1a,_0x5bec('0x1a5')));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x55bfda[_0x5bec('0x193')](0x0,_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe7')]>=_0x35e7bc[_0x5bec('0x19c')]){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,'reason\x200\x20no\x20such\x20number....');}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1a6'));}}break;case'3':_0x35e7bc[_0x5bec('0x5f')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x3;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1a7');_0xef2d8d[_0x5bec('0xe6')]+=0x1;_0xef2d8d[_0x5bec('0xe2')]+=0x1;ami[_0x5bec('0x48')]('custom:agentnoanswer',ut[_0x5bec('0xdc')](_0x560e1a,_0x5bec('0x1a8')));_0x55bfda['createHistory'](_0xef2d8d)['catch'](loggerCatch(_0x5bec('0x1a9')));if(_0x55bfda[_0x5bec('0x193')](0x3,_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe6')]>=_0x35e7bc[_0x5bec('0x194')]){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1aa'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1aa'));}}break;case'5':_0x35e7bc[_0x5bec('0x5b')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x5;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1ab');_0xef2d8d[_0x5bec('0xe4')]+=0x1;_0xef2d8d[_0x5bec('0xe2')]+=0x1;ami[_0x5bec('0x48')](_0x5bec('0x1ac'),ut[_0x5bec('0xdc')](_0x560e1a,'busy'));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x1ad')));if(_0x55bfda[_0x5bec('0x193')](0x5,_0x560e1a,_0x35e7bc)){if(_0xef2d8d['countbusyretry']>=_0x35e7bc[_0x5bec('0x1ae')]){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1af'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1af'));}}break;case'8':_0x35e7bc['outboundCongestionCallsDay']+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x8;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x1b0');_0xef2d8d[_0x5bec('0xe5')]+=0x1;_0xef2d8d[_0x5bec('0xe2')]+=0x1;ami[_0x5bec('0x48')]('custom:agentcongestion',ut[_0x5bec('0xdc')](_0x560e1a,_0x5bec('0x1b1')));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x55bfda[_0x5bec('0x193')](0x8,_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe5')]>=_0x35e7bc[_0x5bec('0x199')]){_0x55bfda['createStateFinal'](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b2'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,'reason\x208\x20congestion');}}break;case'11':_0x35e7bc[_0x5bec('0x1b3')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0xb;_0xef2d8d[_0x5bec('0x9e')]=_0x5bec('0x119');_0xef2d8d['countabandonedretry']+=0x1;_0xef2d8d['countglobal']+=0x1;_0x55bfda['createHistory'](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x1b4')));if(_0x55bfda[_0x5bec('0x193')](0xb,_0x560e1a,_0x35e7bc)){if(_0xef2d8d['countabandonedretry']>=_0x35e7bc['dialAbandonedMaxRetry']){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b5'));}else{_0x55bfda['stateGlobal'](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b5'));}}break;case'20':_0x35e7bc[_0x5bec('0x63')]+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0x14;_0xef2d8d[_0x5bec('0x9e')]='AgentReject';_0xef2d8d[_0x5bec('0xfa')]+=0x1;_0xef2d8d['countglobal']+=0x1;ami[_0x5bec('0x48')]('custom:agentreject',ut['buildObj'](_0x560e1a,_0x5bec('0x1b6')));_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x55bfda['checkRetriveMax'](0x14,_0x560e1a,_0x35e7bc)){if(_0xef2d8d['countagentrejectretry']>=_0x35e7bc['dialAgentRejectMaxRetry']){_0x55bfda[_0x5bec('0xed')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b7'));}else{_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x5bec('0x1b7'));}}break;default:_0x35e7bc['outboundUnknownCallsDay']+=0x1;_0xef2d8d[_0x5bec('0x9d')]=0xc;_0xef2d8d['statedesc']=_0x476ae9[_0x5bec('0x104')];_0x55bfda[_0x5bec('0xc2')](_0xef2d8d)[_0x5bec('0xa8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x55bfda['checkRetriveMax'](_0x476ae9[_0x5bec('0x104')],_0x560e1a,_0x35e7bc)){if(_0xef2d8d[_0x5bec('0xe4')]+_0xef2d8d[_0x5bec('0xe5')]+_0xef2d8d['countnoanswerretry']+_0xef2d8d[_0x5bec('0xe7')]+_0xef2d8d[_0x5bec('0xe8')]+_0xef2d8d[_0x5bec('0xf9')]+_0xef2d8d[_0x5bec('0xe1')]+_0xef2d8d[_0x5bec('0xfa')]>=_0x35e7bc[_0x5bec('0xe9')]){_0x55bfda[_0x5bec('0xea')](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x476ae9[_0x5bec('0x104')]);}else{_0x55bfda['createStateFinal'](_0xef2d8d,_0x2c9ab3,_0x5b2a52,_0x476ae9[_0x5bec('0x104')]);}}}});};Dialer[_0x5bec('0x1b')][_0x5bec('0xea')]=function(_0x1d955c,_0x3421fa,_0x5847f5,_0x11d2af){var _0x10796f=new Final(_0x1d955c);_0x10796f[_0x5bec('0x9d')]=0xf;_0x10796f[_0x5bec('0x9e')]='Global';this['createStateFinal'](_0x10796f,_0x3421fa,_0x5847f5,_0x11d2af);};Dialer[_0x5bec('0x1b')][_0x5bec('0xed')]=function(_0x29e66e,_0x1fab21,_0x526705,_0x21f7a6){this[_0x5bec('0xc0')](_0x29e66e)['then'](function(){return _0x1fab21(msgResponse(_0x5bec('0x1a1'),_0x5bec('0x1b8'),_0x21f7a6));})[_0x5bec('0xa8')](function(){return _0x526705(msgResponse('[moveContactManagedDialer][0]','Failure',_0x5bec('0x1b9')));});};Dialer[_0x5bec('0x1b')]['predictive']=function(_0x277f5b){var _0x30fe46=_0x277f5b[_0x5bec('0x1ba')]/0x64;var _0x1cec75=_0x277f5b[_0x5bec('0x5e')]/(_0x277f5b[_0x5bec('0x5e')]+_0x277f5b[_0x5bec('0x5a')]);var _0x1c09ed=Math[_0x5bec('0x1bb')](_0x277f5b[_0x5bec('0x68')]*(_0x277f5b[_0x5bec('0x1bc')]/0x64));var _0x2bf530=Math[_0x5bec('0x1bb')](_0x277f5b['predictiveIntervalAvailable']*(_0x277f5b['predictiveIntervalMinThreshold']/0x64));var _0x263c4b=_0x277f5b[_0x5bec('0x4c')]+_0x277f5b[_0x5bec('0x51')];var _0x192d39=Math[_0x5bec('0x1bd')](_0x277f5b[_0x5bec('0x6b')]*_0x277f5b['erlangAbandonmentRate']*_0x277f5b[_0x5bec('0x1be')]*_0x277f5b[_0x5bec('0x66')]);if(_[_0x5bec('0x39')](_0x277f5b[_0x5bec('0x29')])){if(!_['isUndefined'](_0x277f5b[_0x5bec('0x28')])){_0x277f5b[_0x5bec('0x28')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x5bec('0x1bf'));}if(!_[_0x5bec('0x39')](_0x277f5b[_0x5bec('0x8a')])){loggerPredictive['error'](_0x5bec('0x1c0'),_0x5bec('0x1c1'));clearInterval(_0x277f5b[_0x5bec('0x8a')]);_0x277f5b[_0x5bec('0x8a')]=undefined;}_0x277f5b[_0x5bec('0x29')]=moment()['format'](_0x5bec('0xf1'));loggerPredictive['info'](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1c2'),_0x277f5b[_0x5bec('0x29')]);this['handlePower'](_0x277f5b,0x1);}else if(ifInterval(_0x277f5b[_0x5bec('0x1c3')],_0x277f5b[_0x5bec('0x29')])){this[_0x5bec('0x153')](_0x277f5b,0x1);loggerPredictiveCalls[_0x5bec('0x75')]('[startMethodPredictive][StartProgressive][Loop]',_0x277f5b[_0x5bec('0x29')],_0x277f5b[_0x5bec('0x3b')]);_0x277f5b[_0x5bec('0x6b')]=0x0;_0x277f5b[_0x5bec('0x111')]=0x0;}else if(_0x30fe46<_0x1cec75&&_0x277f5b[_0x5bec('0x1c4')]===_0x5bec('0x1c5')){freeVariablesPredictive(_0x277f5b);loggerPredictive['info'](_0x5bec('0x1c6'),_0x5bec('0x1c7'),_0x1cec75,_0x5bec('0x29'),_0x277f5b[_0x5bec('0x3b')]);}else if(_0x192d39<_0x277f5b[_0x5bec('0x111')]&&_0x277f5b[_0x5bec('0x1c4')]===_0x5bec('0x1c5')){freeVariablesPredictive(_0x277f5b);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x1c8'),_0x5bec('0x1c9'),_0x192d39,_0x5bec('0x1ca'),_0x277f5b[_0x5bec('0x111')],_0x5bec('0x29'),_0x277f5b[_0x5bec('0x3b')]);}else if(!ifInterval(_0x277f5b[_0x5bec('0x1c3')],_0x277f5b['startProgressive'])&&_[_0x5bec('0x39')](_0x277f5b['startPredictive'])&&!_[_0x5bec('0x39')](_0x277f5b[_0x5bec('0x29')])){_0x277f5b['startPredictive']=moment()[_0x5bec('0x70')](_0x5bec('0xf1'));loggerPredictive[_0x5bec('0x75')](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1cb'),_0x277f5b['startPredictive']);this[_0x5bec('0xb4')](_0x277f5b[_0x5bec('0x1c3')])[_0x5bec('0xb0')](this[_0x5bec('0x1cc')](_0x277f5b))[_0x5bec('0xb0')](mergeDataErlangB(_0x277f5b))[_0x5bec('0xb0')](this[_0x5bec('0x1cd')](_0x277f5b))[_0x5bec('0xa8')](loggerCatchPredictive(_0x5bec('0x1ce'),_0x277f5b));}else if(!ifInterval(_0x277f5b[_0x5bec('0x1c3')],_0x277f5b[_0x5bec('0x28')])){_0x277f5b[_0x5bec('0x111')]=0x0;_0x277f5b[_0x5bec('0x28')]=moment()[_0x5bec('0x70')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5bec('0x75')](_0x277f5b['name'],_0x5bec('0x1cf'),_0x277f5b[_0x5bec('0x28')]);clearInterval(_0x277f5b[_0x5bec('0x8a')]);_0x277f5b[_0x5bec('0x8a')]=undefined;this[_0x5bec('0xb4')](_0x277f5b[_0x5bec('0x1c3')])[_0x5bec('0xb0')](this[_0x5bec('0x1cc')](_0x277f5b))['then'](mergeDataErlangB(_0x277f5b))[_0x5bec('0xb0')](this[_0x5bec('0x1cd')](_0x277f5b))[_0x5bec('0xa8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x277f5b));}else if(_0x277f5b['predictiveIntervalAvailable']&&_0x263c4b<_0x277f5b['predictiveIntervalAvailable']-_0x2bf530){freeVariablesPredictive(_0x277f5b);loggerPredictive[_0x5bec('0x75')](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1d0'),_0x263c4b,_0x5bec('0x1d1'),_0x277f5b['predictiveIntervalAvailable'],'-',_0x2bf530,'=',_0x277f5b['predictiveIntervalAvailable']-_0x2bf530,')');}else if(_0x277f5b[_0x5bec('0x68')]&&_0x263c4b>_0x277f5b[_0x5bec('0x68')]+_0x1c09ed){freeVariablesPredictive(_0x277f5b);loggerPredictive['info'](_0x277f5b[_0x5bec('0x3b')],_0x5bec('0x1d0'),_0x263c4b,')\x20are\x20more\x20than\x20threshold\x20(',_0x277f5b[_0x5bec('0x68')],'+',_0x1c09ed,'=',_0x277f5b[_0x5bec('0x68')]+_0x1c09ed,')');}};Dialer[_0x5bec('0x1b')][_0x5bec('0x1cc')]=function(_0x3b7ccd){var _0x4f23a6=this;return function(_0x10e12c){return new BPromise(function(_0x1a2e85,_0x540cad){_[_0x5bec('0x86')](_0x3b7ccd,_0x10e12c[0x0]);if(checkGetDataPredictive(_0x10e12c[0x0])){var _0x150484=_0x3b7ccd[_0x5bec('0x68')]=_0x3b7ccd['talking']+_0x3b7ccd[_0x5bec('0x4c')];var _0x47133c=_0x3b7ccd[_0x5bec('0x1c3')]*0x3c;var _0x1a422d=_0x10e12c[0x0][_0x5bec('0x7d')]+_0x10e12c[0x0][_0x5bec('0x64')];var _0x44d261=(_0x10e12c[0x0]['predictiveIntervalAnsweredCalls']+_0x10e12c[0x0][_0x5bec('0x65')]+_0x10e12c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x10e12c[0x0][_0x5bec('0x69')];_0x3b7ccd['predictiveIntervalHitRate']=_0x44d261>0x0?_0x44d261:0x1;switch(_0x3b7ccd[_0x5bec('0x1c4')]){case _0x5bec('0x1c5'):var _0x55d14d=_0x3b7ccd['dialPredictiveOptimizationPercentage']/0x64;return _0x4f23a6['abandonmentRate'](_0x150484,_0x47133c,_0x1a422d,_0x44d261,_0x55d14d)['then'](function(_0x677d7f){return _0x1a2e85(_0x677d7f);});case _0x5bec('0x1d2'):var _0x2cc447=_0x3b7ccd['dialPredictiveOptimizationPercentage']/0x64;return _0x4f23a6['busyFactor'](_0x150484,_0x47133c,_0x1a422d,_0x44d261,_0x2cc447)['then'](function(_0x29fef7){return _0x1a2e85(_0x29fef7);});default:return _0x540cad(msgResponse(_0x5bec('0x1d3'),_0x5bec('0x13d'),_0x5bec('0x1d4')));}}else{return _0x540cad(msgResponse(_0x5bec('0x1d3'),_0x5bec('0x13d'),'check\x20failure'));}});};};Dialer['prototype'][_0x5bec('0x1d5')]=function(_0x1326f7){var _0xef8b54=this;return function(_0x6aa51c){return new BPromise(function(_0x219d15,_0x495a92){_['merge'](_0x1326f7,_0x6aa51c[0x0]);if(checkGetDataPredictive(_0x6aa51c[0x0])){loggerPredictive['info'](JSON[_0x5bec('0x45')](_0x6aa51c[0x0]));if(_0x1326f7[_0x5bec('0x1c4')]===_0x5bec('0x1c5')){return _0xef8b54[_0x5bec('0xbe')](_0x1326f7['id'])['then'](function(_0x439461){var _0x4fec9e=_0x1326f7['loggedIn']-_0x439461[0x0]['outboundQueuePauses'];var _0x591b1f=_0x1326f7[_0x5bec('0x1c3')]*0x3c;var _0x287ade=_0x6aa51c[0x0]['predictiveIntervalAvgTalktime']+_0x6aa51c[0x0][_0x5bec('0x64')];var _0x58fcd3=(_0x6aa51c[0x0][_0x5bec('0x79')]+_0x6aa51c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x6aa51c[0x0][_0x5bec('0x7a')])/_0x6aa51c[0x0][_0x5bec('0x69')];var _0x50a5ed=_0x1326f7[_0x5bec('0x1ba')]/0x64;_0x1326f7['predictiveIntervalPauses']=_0x439461[0x0]['outboundQueuePauses']||0x0;_0x1326f7['predictiveIntervalHitRate']=_0x58fcd3>0x0?_0x58fcd3:0x1;return _0xef8b54[_0x5bec('0x1d6')](_0x4fec9e,_0x591b1f,_0x287ade,_0x58fcd3,_0x50a5ed);})[_0x5bec('0xb0')](function(_0x1800db){return _0x219d15(_0x1800db);})[_0x5bec('0xa8')](function(_0x1acabe){return _0x495a92(msgResponse(_0x5bec('0x1d7'),_0x5bec('0x13d'),JSON[_0x5bec('0x45')](_0x1acabe)));});}if(_0x1326f7[_0x5bec('0x1c4')]==='agentBusyFactor'){return _0xef8b54[_0x5bec('0xbe')](_0x1326f7['id'])[_0x5bec('0xb0')](function(_0x555279){var _0x149e84=_0x1326f7[_0x5bec('0x4d')]-_0x555279[0x0][_0x5bec('0x1d8')];var _0x1b5889=_0x1326f7[_0x5bec('0x1c3')]*0x3c;var _0x3b27c0=_0x6aa51c[0x0]['predictiveIntervalAvgTalktime']+_0x6aa51c[0x0][_0x5bec('0x64')];var _0x67f9b9=(_0x6aa51c[0x0][_0x5bec('0x79')]+_0x6aa51c[0x0][_0x5bec('0x65')]+_0x6aa51c[0x0][_0x5bec('0x7a')])/_0x6aa51c[0x0][_0x5bec('0x69')];var _0x20c73a=_0x1326f7[_0x5bec('0x1ba')]/0x64;_0x1326f7[_0x5bec('0x67')]=_0x555279[0x0][_0x5bec('0x1d8')]||0x0;_0x1326f7[_0x5bec('0x1be')]=_0x67f9b9>0x0?_0x67f9b9:0x1;return _0xef8b54[_0x5bec('0x1d9')](_0x149e84,_0x1b5889,_0x3b27c0,_0x67f9b9,_0x20c73a);})[_0x5bec('0xb0')](function(_0x287a9d){return _0x219d15(_0x287a9d);})['catch'](function(_0x43b31e){return _0x495a92(msgResponse(_0x5bec('0x1d7'),'Failure',JSON[_0x5bec('0x45')](_0x43b31e)));});}}else{return _0x495a92(msgResponse(_0x5bec('0x1d3'),'Failure',_0x5bec('0x1da')));}});};};Dialer[_0x5bec('0x1b')][_0x5bec('0x1cd')]=function(_0x3cb589){var _0x596a2b=this;return function(){var _0xb0bd99=0x0;var _0x207604=Math[_0x5bec('0x1bd')](_0x3cb589[_0x5bec('0x6c')]*0x3e8);if(_0x207604>0x0){_0x207604=_0x207604<0x64?0x64:_0x207604;loggerPredictive[_0x5bec('0x75')](_0x3cb589['name'],_0x5bec('0x1db'),_0x207604,_0x5bec('0x87'));_0x3cb589[_0x5bec('0x8a')]=setInterval(function(){_0x596a2b['handlePredictive'](_0x3cb589);loggerPredictiveCalls['info'](_0x5bec('0x1dc'),_0xb0bd99+=0x1);},_0x207604);}else{loggerPredictive[_0x5bec('0x75')](_0x3cb589[_0x5bec('0x3b')],_0x5bec('0x1dd'));}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x1de')]=function(_0x3cdb72,_0x4b6990){var _0x5167fa=this;return function(_0x8df993){if(_[_0x5bec('0x42')](_0x8df993)){if(_[_0x5bec('0xd3')](_0x4b6990['UserId'])||!_0x4b6990[_0x5bec('0x1df')]){if(_0x3cdb72[_0x5bec('0x151')]===_0x5bec('0x155')){_0x3cdb72['queueStatusComplete']=_[_0x5bec('0x39')](_0x3cdb72[_0x5bec('0x125')])?!![]:_0x3cdb72['queueStatusComplete'];var _0x25ded3=uuid['v4']();_0x5167fa[_0x5bec('0xa4')][_0x25ded3]=new Action(_0x3cdb72,_0x4b6990,_0x25ded3);loggerBooked['info'](_0x5bec('0x1e0'),_0x25ded3,_0x5bec('0x1e1'),JSON[_0x5bec('0x45')](_0x3cdb72[_0x5bec('0x125')]),_0x5bec('0x1e2'),_0x3cdb72['name']);if(_0x3cdb72['queueStatusComplete']){_0x3cdb72['queueStatusComplete']=![];_0x5167fa['queueBooked'][_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xab')]]=[];ami[_0x5bec('0xa6')]({'actionid':_0x25ded3,'action':_0x5bec('0x1e3'),'queue':_0x3cdb72[_0x5bec('0x3b')]})[_0x5bec('0xa8')](function(){_0x5167fa[_0x5bec('0xa9')](_0x3cdb72);_0x5167fa[_0x5bec('0xb6')]({'active':![],'ContactId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xc8')],'ListId':_0x5167fa['actions'][_0x25ded3][_0x5bec('0xc9')],'VoiceQueueId':_0x5167fa['actions'][_0x25ded3][_0x5bec('0xcb')]||undefined,'CampaignId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xf2')]||undefined})[_0x5bec('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5167fa[_0x5bec('0xa4')][_0x25ded3];});}else{loggerBooked['info'](_0x5bec('0x1e4'),JSON[_0x5bec('0x45')](_0x3cdb72[_0x5bec('0x125')]),_0x5bec('0x1e2'),_0x3cdb72[_0x5bec('0x3b')]);_0x5167fa['updateOriginated'](_0x3cdb72);_0x5167fa['rescheduleContact']({'active':![],'ContactId':_0x5167fa['actions'][_0x25ded3][_0x5bec('0xc8')],'ListId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xc9')],'VoiceQueueId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xcb')]||undefined,'CampaignId':_0x5167fa[_0x5bec('0xa4')][_0x25ded3][_0x5bec('0xf2')]||undefined})['catch'](loggerCatch(_0x5bec('0x1e5')));delete _0x5167fa[_0x5bec('0xa4')][_0x25ded3];}}else{return _0x5167fa[_0x5bec('0x1e6')](_0x3cdb72,_0x4b6990);}}else{if(getDiff(_0x4b6990[_0x5bec('0x1e7')])<_0x3cdb72[_0x5bec('0x1e8')]*0x3c){if(_0x4b6990['Agent']&&!_0x4b6990['Agent'][_0x5bec('0x1e9')]){_0x5167fa[_0x5bec('0x20')][_0x5bec('0x129')](_0x4b6990['id'])['finally'](function(){_0x5167fa['updateOriginated'](_0x3cdb72);});}else{_0x5167fa['unlockContact']({'active':![]},_0x4b6990['id'],0x1)['finally'](function(){_0x5167fa[_0x5bec('0xa9')](_0x3cdb72);});}}else{_0x3cdb72[_0x5bec('0x62')]+=0x1;_0x5167fa[_0x5bec('0xa9')](_0x3cdb72);if(_0x3cdb72[_0x5bec('0x1ea')]){_0x5167fa[_0x5bec('0xb6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b6990[_0x5bec('0xc8')],'ListId':_0x4b6990['ListId'],'VoiceQueueId':_0x4b6990[_0x5bec('0xcb')]||undefined,'CampaignId':_0x4b6990['CampaignId']||undefined})[_0x5bec('0xa8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5167fa['createHistory'](createObjHistory(_0x3cdb72,_0x4b6990,'RECALLINQUEUE',0x17,_0x5bec('0x1eb')))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0x1ec')));}else{_0x5167fa[_0x5bec('0xc6')](createObjHistory(_0x3cdb72,_0x4b6990,'RECALLFAILEDTIMEOUT',0x16,_0x5bec('0x1ed')),'[Originate][HistoryRecallClose][historyCatch]',_0x5bec('0x1ee'));}}}}else{_0x3cdb72[_0x5bec('0x1ef')]+=0x1;_0x5167fa['saveInDb'](createObjHistory(_0x3cdb72,_0x4b6990,_0x5bec('0x1f0'),0xd,'Blacklist'),_0x5bec('0x1f1'),'[Originate][MoveBlacklist]');throw _0x5bec('0x1f2');}};};Dialer[_0x5bec('0x1b')][_0x5bec('0x158')]=function(_0x28efa6){var _0x8a57bc=this;var _0x2e8a65=_0x28efa6[_0x5bec('0x1f3')]-_0x28efa6[_0x5bec('0x6a')]-_0x28efa6[_0x5bec('0xbb')];emitCampaignSummary(_0x28efa6);if(_0x2e8a65>0x0){if(_0x2e8a65>this[_0x5bec('0x24')]){_0x2e8a65=this[_0x5bec('0x24')];}_0x28efa6[_0x5bec('0xbb')]+=_0x2e8a65;this[_0x5bec('0xbc')](_0x28efa6['id'],_0x2e8a65,_0x28efa6[_0x5bec('0x1f4')],_0x28efa6)['then'](function(_0x3c062b){_0x28efa6[_0x5bec('0xbb')]-=_0x2e8a65;_0x28efa6[_0x5bec('0xbb')]=_0x28efa6[_0x5bec('0xbb')]>0x0?_0x28efa6['temp']:0x0;if(!checkContactEmpty(_0x3c062b)){_0x28efa6[_0x5bec('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5bec('0x75')](_0x5bec('0x1f5')+_0x28efa6[_0x5bec('0x3b')]);}else{_0x28efa6[_0x5bec('0x6a')]+=_0x3c062b[_0x5bec('0x92')];_0x28efa6['message']=_0x5bec('0x1f6');for(var _0x5a4a21=0x0;_0x5a4a21<_0x3c062b['length'];_0x5a4a21+=0x1){_0x28efa6[_0x5bec('0x1f7')]+=0x1;if(_['isNil'](_0x3c062b[_0x5a4a21])||_[_0x5bec('0xd3')](_0x3c062b[_0x5a4a21]['Contact'])||_[_0x5bec('0xd3')](_0x3c062b[_0x5a4a21]['Contact']['phone'])){_0x8a57bc['emptyContact'](_0x5bec('0x1f8'),_0x28efa6,_0x3c062b[_0x5a4a21]);}else{_0x8a57bc['checkIsBlackListIvr'](_['pick'](_0x3c062b[_0x5a4a21],[_0x5bec('0xf2'),'Contact.phone']))[_0x5bec('0xb0')](_0x8a57bc[_0x5bec('0x1de')](_0x28efa6,_0x3c062b[_0x5a4a21]))['catch'](_0x8a57bc[_0x5bec('0x1f9')](_0x5bec('0x1fa'),_0x28efa6));}}}})[_0x5bec('0xa8')](loggerGetContactDialer('[getContactCampaign2]',_0x28efa6,_0x2e8a65));}};Dialer[_0x5bec('0x1b')][_0x5bec('0x153')]=function(_0x4b7e38,_0x3ca674){var _0x266f70=this;var _0x27eeab=[];var _0xa8547=_0x3ca674>=0x1?_0x3ca674:0x1;if(_0x4b7e38[_0x5bec('0x151')]===_0x5bec('0x155')){_0xa8547=0x1;}var _0x315ab6=Math['floor'](_0x4b7e38[_0x5bec('0x4c')]*_0xa8547)-_0x4b7e38[_0x5bec('0x6a')]-_0x4b7e38[_0x5bec('0xbb')];emitVoiceQueueSummary(_0x4b7e38);if(_0x4b7e38[_0x5bec('0x1fb')]>0x0){var _0x427e95=_0x4b7e38[_0x5bec('0x1fb')]-_0x4b7e38['originated']-_0x4b7e38['talking']-_0x4b7e38[_0x5bec('0xbb')]-_0x4b7e38['pTalking'];if(_0x315ab6>_0x427e95){_0x315ab6=_0x427e95;}}if(_0x315ab6>0x0){if(_0x4b7e38[_0x5bec('0x151')]===_0x5bec('0x155')){_0x315ab6=0x1;}if(_0x315ab6>this[_0x5bec('0x24')]){_0x315ab6=this[_0x5bec('0x24')];}_0x4b7e38['temp']+=_0x315ab6;for(var _0x48abf4 in this[_0x5bec('0x22')]){if(typeof this['agents'][_0x48abf4]!==_0x5bec('0x93')){if(this[_0x5bec('0x22')][_0x48abf4][_0x5bec('0x9d')]===_0x5bec('0x1fc')&&this[_0x5bec('0x22')][_0x48abf4][_0x5bec('0xd0')]===_0x5bec('0x1fd')){_0x27eeab[_0x5bec('0x123')](this['agents'][_0x48abf4]['id']);}}}this[_0x5bec('0xba')](_0x4b7e38['id'],_0x27eeab,_0x315ab6,_0x4b7e38[_0x5bec('0x1f4')],_0x4b7e38)[_0x5bec('0xb0')](function(_0x81f8b2){_0x4b7e38['temp']-=_0x315ab6;_0x4b7e38[_0x5bec('0xbb')]=_0x4b7e38['temp']>0x0?_0x4b7e38[_0x5bec('0xbb')]:0x0;if(!checkContactEmpty(_0x81f8b2)){_0x266f70['countReScheduled'](_0x4b7e38)['then'](sendMessageReschedule(_0x4b7e38))[_0x5bec('0xa8')](loggerCatch(_0x5bec('0xaf')));}else{_0x4b7e38['originated']+=_0x81f8b2[_0x5bec('0x92')];_0x4b7e38[_0x5bec('0x3a')]=_0x4b7e38[_0x5bec('0x151')]===_0x5bec('0x155')?_0x5bec('0x16a'):_0x5bec('0x1f6');for(var _0xa04e62=0x0;_0xa04e62<_0x81f8b2[_0x5bec('0x92')];_0xa04e62+=0x1){if(_['isNil'](_0x81f8b2[_0xa04e62])||_[_0x5bec('0xd3')](_0x81f8b2[_0xa04e62][_0x5bec('0x163')])||_[_0x5bec('0xd3')](_0x81f8b2[_0xa04e62][_0x5bec('0x163')][_0x5bec('0x162')])){_0x266f70[_0x5bec('0xc4')](_0x5bec('0x1f8'),_0x4b7e38,_0x81f8b2[_0xa04e62]);}else{_0x266f70[_0x5bec('0xb1')](_['pick'](_0x81f8b2[_0xa04e62],[_0x5bec('0xcb'),_0x5bec('0x1fe')]))[_0x5bec('0xb0')](_0x266f70[_0x5bec('0x1de')](_0x4b7e38,_0x81f8b2[_0xa04e62]))[_0x5bec('0xa8')](_0x266f70[_0x5bec('0x1f9')]('[actionOriginate]\x20',_0x4b7e38));}}}})[_0x5bec('0xa8')](loggerGetContactDialer('[getContactDialer2]',_0x4b7e38,_0x315ab6));}};Dialer['prototype'][_0x5bec('0x8a')]=function(_0x41d849){if(_0x41d849['dialLimitQueue']>0x0){var _0x2941ad=_0x41d849[_0x5bec('0x1fb')]-_0x41d849[_0x5bec('0x6a')]-_0x41d849[_0x5bec('0x51')];if(_0x2941ad>0x0){this[_0x5bec('0x1ff')](_0x41d849);}else{loggerPredictiveCalls[_0x5bec('0x75')](_0x5bec('0x200'));}}else{this[_0x5bec('0x1ff')](_0x41d849);}};Dialer['prototype'][_0x5bec('0x1ff')]=function(_0x57219a){var _0xa529d0=this;var _0x5cf78e=[];_0x57219a[_0x5bec('0x6a')]+=0x1;for(var _0x2b6120 in this[_0x5bec('0x22')]){if(typeof this['agents'][_0x2b6120]!==_0x5bec('0x93')){if(this['agents'][_0x2b6120][_0x5bec('0x9d')]==='not_inuse'&&this[_0x5bec('0x22')][_0x2b6120]['status']===_0x5bec('0x1fd')){_0x5cf78e[_0x5bec('0x123')](this[_0x5bec('0x22')][_0x2b6120]['id']);}}}this[_0x5bec('0xba')](_0x57219a['id'],_0x5cf78e,0x1,_0x57219a[_0x5bec('0x1f4')],_0x57219a)[_0x5bec('0xb0')](function(_0x25e200){if(!checkContactEmpty(_0x25e200)){checkContactLowerLimitOriginate(_0x57219a,0x1,0x0);_0xa529d0[_0x5bec('0xad')](_0x57219a)['then'](sendMessageReschedule(_0x57219a))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x57219a['message']='RUNNING';if(_[_0x5bec('0xd3')](_0x25e200[0x0])||_[_0x5bec('0xd3')](_0x25e200[0x0][_0x5bec('0x163')])||_[_0x5bec('0xd3')](_0x25e200[0x0][_0x5bec('0x163')][_0x5bec('0x162')])){_0xa529d0[_0x5bec('0xc4')](_0x5bec('0x1f8'),_0x57219a,_0x25e200[0x0]);}else{_0xa529d0[_0x5bec('0xb1')](_[_0x5bec('0xc7')](_0x25e200[0x0],[_0x5bec('0xcb'),_0x5bec('0x1fe')]))[_0x5bec('0xb0')](_0xa529d0[_0x5bec('0x1de')](_0x57219a,_0x25e200[0x0]))[_0x5bec('0xa8')](_0xa529d0['loggerHandler'](_0x5bec('0x201'),_0x57219a));}}})['catch'](loggerGetContactDialer(_0x5bec('0x202'),_0x57219a,0x1));emitVoiceQueueSummary(_0x57219a);};Dialer['prototype']['abandonmentRate']=function(_0x54358e,_0x420607,_0x3c11c0,_0x45acf3,_0x37f6fc,_0x34ca0d){loggerPredictive[_0x5bec('0x75')](_0x5bec('0x203'));loggerPredictive[_0x5bec('0x75')](_0x5bec('0x204'),_0x54358e);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x205'),_0x420607);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x206'),_0x3c11c0);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x207'),_0x45acf3);loggerPredictive[_0x5bec('0x75')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37f6fc);loggerPredictive['info'](_0x5bec('0x7c'));return new BPromise(function(_0x4d054d,_0x44e2fd){if(_0x54358e<=0x0||isNaN(_0x54358e)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),'Error','m\x20=\x20'+_0x54358e));}if(_0x3c11c0<=0x0||isNaN(_0x3c11c0)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),'Error',_0x5bec('0x209')+_0x3c11c0));}if(_0x45acf3<=0x0||isNaN(_0x45acf3)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),_0x5bec('0x44'),_0x5bec('0x20a')+_0x45acf3));}if(_0x420607<=0x0||isNaN(_0x420607)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),_0x5bec('0x44'),_0x5bec('0x20b')+_0x420607));}if(_0x37f6fc<=0x0||isNaN(_0x37f6fc)){return _0x44e2fd(msgResponse(_0x5bec('0x208'),'Error',_0x5bec('0x20c')+_0x37f6fc));}_0x34ca0d=_0x34ca0d||0x0;var _0xe37c48=0x1/_0x3c11c0;var _0x26f7df=0x0;var _0x4b91b8=0x0;var _0x50a527=0x0;var _0x287c61=0x0;for(var _0x45b5a4=0x0;_0x50a527<_0x37f6fc;_0x45b5a4+=0x1){_0x4b91b8=_0x45b5a4/_0x420607;_0x26f7df=(_0x45acf3*_0x4b91b8+_0x34ca0d)/_0xe37c48;_0x50a527=erlangb(_0x26f7df,_0x54358e);_0x287c61=_0x26f7df/_0x54358e*(0x1-erlangb(_0x26f7df,_0x54358e));}return _0x4d054d({'erlangCalls':_0x45b5a4,'erlangCallToSecond':_0x420607/_0x45b5a4,'erlangAbandonmentRate':_0x50a527,'erlangBusyFactor':_0x287c61});});};Dialer[_0x5bec('0x1b')][_0x5bec('0x1d9')]=function(_0x36d8bd,_0x1a652d,_0x2d19c2,_0x4942a0,_0x2a6194,_0x527e20){loggerPredictive[_0x5bec('0x75')](_0x5bec('0x20d'));loggerPredictive[_0x5bec('0x75')](_0x5bec('0x204'),_0x36d8bd);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x205'),_0x1a652d);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x206'),_0x2d19c2);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x207'),_0x4942a0);loggerPredictive['info'](_0x5bec('0x20e'),_0x2a6194);loggerPredictive[_0x5bec('0x75')](_0x5bec('0x7c'));return new BPromise(function(_0x1fcc94,_0x5f5218){if(_0x36d8bd<=0x0||isNaN(_0x36d8bd)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),_0x5bec('0x210')+_0x36d8bd));}if(_0x2d19c2<=0x0||isNaN(_0x2d19c2)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),_0x5bec('0x209')+_0x2d19c2));}if(_0x4942a0<=0x0||isNaN(_0x4942a0)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),'p\x20=\x20'+_0x4942a0));}if(_0x1a652d<=0x0||isNaN(_0x1a652d)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),_0x5bec('0x44'),'interval\x20=\x20'+_0x1a652d));}if(_0x2a6194<=0x0||isNaN(_0x2a6194)){return _0x5f5218(msgResponse(_0x5bec('0x20f'),'Error',_0x5bec('0x211')+_0x2a6194));}_0x527e20=_0x527e20||0x0;var _0x11fe93=0x1/_0x2d19c2;var _0x53f333=0x0;var _0x517daa=0x0;var _0x216c03=0x0;var _0x1e7d60=0x0;for(var _0x711204=0x0;_0x1e7d60<_0x2a6194;_0x711204+=0x1){_0x517daa=_0x711204/_0x1a652d;_0x53f333=(_0x4942a0*_0x517daa+_0x527e20)/_0x11fe93;_0x216c03=erlangb(_0x53f333,_0x36d8bd);_0x1e7d60=_0x53f333/_0x36d8bd*(0x1-erlangb(_0x53f333,_0x36d8bd));}return _0x1fcc94({'erlangCalls':_0x711204,'erlangCallToSecond':_0x1a652d/_0x711204,'erlangAbandonmentRate':_0x216c03,'erlangBusyFactor':_0x1e7d60});});};module[_0x5bec('0x212')]=Dialer;
\ No newline at end of file
+var _0xd3a8=['value','HANGUP','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','membername','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','cause-txt','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','roundrobin','paused','stateinterface','locked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','match','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialer','ACTIVE','NONE','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','trim','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','busyFactor','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','dialRecallMeTimeout','Agent','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','../preview/util/util','../../../config/environment/','booked','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','name','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','ivr','format','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','isUndefined','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','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','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','starttime','prototype','clearZombieChannels','[actions]','isNil','Action','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','merge','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','status','reachable','saveInDb','syncVarSet','uniqueid','exten','xcally-motion-dialer','dialAMDActive'];(function(_0x335a85,_0x1c17d6){var _0x1c33c3=function(_0x3ca712){while(--_0x3ca712){_0x335a85['push'](_0x335a85['shift']());}};_0x1c33c3(++_0x1c17d6);}(_0xd3a8,0x135));var _0x8d3a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xd3a8[_0x4b055c];return _0x4b62bb;};'use strict';var util=require(_0x8d3a('0x0'));var _=require('lodash');var BPromise=require(_0x8d3a('0x1'));var uuid=require(_0x8d3a('0x2'));var moment=require(_0x8d3a('0x3'));var rr=require('rr');var md5=require(_0x8d3a('0x4'));var Redis=require('ioredis');var ut=require(_0x8d3a('0x5'));var config=require(_0x8d3a('0x6'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require('../../../config/logger')(_0x8d3a('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x8d3a('0x8'))(_0x8d3a('0x9'));var loggerSyncQueueSummary=require(_0x8d3a('0x8'))(_0x8d3a('0xa'));var ami=require(_0x8d3a('0xb'));config[_0x8d3a('0xc')]=_[_0x8d3a('0xd')](config[_0x8d3a('0xc')],{'host':_0x8d3a('0xe'),'port':0x18eb});var io=require(_0x8d3a('0xf'))(new Redis(config[_0x8d3a('0xc')]));var cmHopper=require(_0x8d3a('0x10'));var cmHopperHistory=require(_0x8d3a('0x11'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x8d3a('0x12'));var Final=require(_0x8d3a('0x13'));var AgentComplete=require(_0x8d3a('0x14'));var QueueCallerAbandon=require(_0x8d3a('0x15'));var Hangup=require(_0x8d3a('0x16'));var ipAgi=process[_0x8d3a('0x17')]['XCALLY_IP_AGI']||_0x8d3a('0x18');var strategy={'rrmemory':_0x8d3a('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0x8d3a('0x1a')]=function(_0x560396){this[_0x8d3a('0x1b')]=this[_0x8d3a('0x1b')]?this[_0x8d3a('0x1b')]['finally'](_0x560396):_0x560396();};function Dialer(_0x33eefb,_0x483fea){this[_0x8d3a('0x1c')]=new Sequence();this['preview']=_0x483fea;this[_0x8d3a('0x1d')]=_0x33eefb[_0x8d3a('0x1d')];this[_0x8d3a('0x1e')]=_0x33eefb['campaigns'];this['agents']=_0x33eefb[_0x8d3a('0x1f')];this[_0x8d3a('0x20')]=_0x33eefb[_0x8d3a('0x20')];this[_0x8d3a('0x21')]=config[_0x8d3a('0x21')]||0x2;this['channels']={};this[_0x8d3a('0x22')]={};this[_0x8d3a('0x23')]={};this[_0x8d3a('0x24')]={};this[_0x8d3a('0x25')]={};this[_0x8d3a('0x26')]={};this[_0x8d3a('0x27')]={};this['ivrOriginated']={};this[_0x8d3a('0x28')]={};this[_0x8d3a('0x29')]={};ami['on'](_0x8d3a('0x2a'),this[_0x8d3a('0x2b')]['bind'](this));ami['on'](_0x8d3a('0x2c'),this[_0x8d3a('0x2d')][_0x8d3a('0x2e')](this));ami['on']('originateresponse',this[_0x8d3a('0x2f')][_0x8d3a('0x2e')](this));ami['on'](_0x8d3a('0x30'),this[_0x8d3a('0x31')][_0x8d3a('0x2e')](this));ami['on'](_0x8d3a('0x32'),this[_0x8d3a('0xa')]['bind'](this));ami['on'](_0x8d3a('0x33'),this[_0x8d3a('0x34')][_0x8d3a('0x2e')](this));ami['on'](_0x8d3a('0x35'),this[_0x8d3a('0x36')][_0x8d3a('0x2e')](this));ami['on']('varset',this['syncVarSet'][_0x8d3a('0x2e')](this));ami['on'](_0x8d3a('0x37'),this[_0x8d3a('0x38')][_0x8d3a('0x2e')](this));ami['on'](_0x8d3a('0x39'),this[_0x8d3a('0x3a')]['bind'](this));this[_0x8d3a('0x3b')]();this[_0x8d3a('0x3c')]();}function isNotNull(_0x18f710){return _0x18f710!==null&&!_['isUndefined'](_0x18f710);}function checkIsLoggedIn(_0x4349ad,_0x1b4530){return function(){if(_0x1b4530<=0x0){_0x4349ad[_0x8d3a('0x3d')]='AGENTS_NOT_LOGGED';throw _0x4349ad[_0x8d3a('0x3e')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x1b62e5){return _0x1b62e5;}function checkIsActive(_0x2a3aa8,_0x44dda3){return function(){if(!isActive(_0x44dda3)){_0x2a3aa8['message']=_0x8d3a('0x3f');throw _0x2a3aa8['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x2367b7){return function(){if(!isNotNull(_0x2367b7[_0x8d3a('0x40')])){_0x2367b7['message']=_0x8d3a('0x41');throw _0x2367b7['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x2367b7[_0x8d3a('0x40')][_0x8d3a('0x42')])){_0x2367b7['message']=_0x8d3a('0x41');throw _0x2367b7[_0x8d3a('0x3e')]+_0x8d3a('0x43');}if(!isNotNull(_[_0x8d3a('0x44')](_0x2367b7[_0x8d3a('0x40')][_0x8d3a('0x42')]))){_0x2367b7[_0x8d3a('0x3d')]=_0x8d3a('0x41');throw _0x2367b7[_0x8d3a('0x3e')]+_0x8d3a('0x43');}};}function msgResponse(_0x5933de,_0x214ced,_0x2df8e1){return{'action':_0x5933de,'response':_0x214ced,'message':_0x2df8e1,'stack':_0x2df8e1};}function myreject(_0x4d136f){return function(_0x56383e){return _0x4d136f(msgResponse(_0x8d3a('0x45'),_0x8d3a('0x46'),JSON[_0x8d3a('0x47')](_0x56383e)));};}function getSeconds(_0x5730ee,_0x7253af){var _0x6efa53=moment(_0x5730ee)['milliseconds'](0x0);var _0x3d3250=moment(_0x7253af)[_0x8d3a('0x48')](0x0);return _0x6efa53[_0x8d3a('0x49')](_0x3d3250,_0x8d3a('0x4a'));}function emit(_0x2fd933,_0x43e0aa,_0x562cde){io['to'](_0x2fd933)[_0x8d3a('0x4b')](_0x43e0aa,_0x562cde);}function emitVoiceQueueSummary(_0x1ff0fa){if(_0x1ff0fa[_0x8d3a('0x4c')]===_0x8d3a('0x4d')){var _0x34c34b={'id':_0x1ff0fa['id'],'name':_0x1ff0fa[_0x8d3a('0x3e')],'strategy':_0x1ff0fa[_0x8d3a('0x4e')],'answered':_0x1ff0fa[_0x8d3a('0x4f')],'available':_0x1ff0fa[_0x8d3a('0x50')],'loggedIn':_0x1ff0fa[_0x8d3a('0x51')],'pTalking':_0x1ff0fa['pTalking'],'sumBillable':_0x1ff0fa['sumBillable'],'sumDuration':_0x1ff0fa[_0x8d3a('0x52')],'sumHoldTime':_0x1ff0fa[_0x8d3a('0x53')]||0x0,'talking':_0x1ff0fa[_0x8d3a('0x54')],'total':_0x1ff0fa[_0x8d3a('0x55')],'type':_0x1ff0fa[_0x8d3a('0x4c')],'unmanaged':_0x1ff0fa[_0x8d3a('0x56')],'abandoned':_0x1ff0fa['abandoned'],'waiting':_0x1ff0fa[_0x8d3a('0x57')],'loggedInDb':_0x1ff0fa[_0x8d3a('0x58')],'dialActive':_0x1ff0fa[_0x8d3a('0x59')],'dialMethod':_0x1ff0fa[_0x8d3a('0x5a')],'dialOriginateCallerIdName':_0x1ff0fa[_0x8d3a('0x5b')],'dialOriginateCallerIdNumber':_0x1ff0fa[_0x8d3a('0x5c')],'dialOriginateTimeout':_0x1ff0fa[_0x8d3a('0x5d')],'dialPrefix':_0x1ff0fa[_0x8d3a('0x5e')],'outboundAnswerAgiCallsDay':_0x1ff0fa[_0x8d3a('0x5f')],'outboundAnswerCallsDay':_0x1ff0fa[_0x8d3a('0x60')],'outboundBlacklistCallsDay':_0x1ff0fa[_0x8d3a('0x61')],'outboundBusyCallsDay':_0x1ff0fa[_0x8d3a('0x62')],'outboundCongestionCallsDay':_0x1ff0fa['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1ff0fa[_0x8d3a('0x63')],'outboundDropCallsDayCallersExit':_0x1ff0fa[_0x8d3a('0x64')],'outboundDropCallsDayTimeout':_0x1ff0fa[_0x8d3a('0x65')],'outboundNoAnswerCallsDay':_0x1ff0fa['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1ff0fa[_0x8d3a('0x66')],'outboundOriginateFailureCallsDay':_0x1ff0fa[_0x8d3a('0x67')],'outboundReCallsDay':_0x1ff0fa[_0x8d3a('0x68')],'outboundRejectCallsDay':_0x1ff0fa['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1ff0fa['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x1ff0fa[_0x8d3a('0x69')],'predictiveIntervalAvgHoldtime':_0x1ff0fa[_0x8d3a('0x6a')],'predictiveIntervalAvgTalktime':_0x1ff0fa[_0x8d3a('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x1ff0fa[_0x8d3a('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x1ff0fa[_0x8d3a('0x6d')],'predictiveIntervalErlangCalls':_0x1ff0fa['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1ff0fa[_0x8d3a('0x6e')],'predictiveIntervalHitRate':_0x1ff0fa[_0x8d3a('0x6f')],'predictiveIntervalMultiplicativeFactor':_0x1ff0fa[_0x8d3a('0x70')],'predictiveIntervalPauses':_0x1ff0fa[_0x8d3a('0x71')],'predictiveIntervalAvailable':_0x1ff0fa['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1ff0fa['predictiveIntervalTotalCalls'],'message':_0x1ff0fa['message'],'originated':_0x1ff0fa[_0x8d3a('0x72')],'erlangCalls':_0x1ff0fa[_0x8d3a('0x73')],'erlangCallToSecond':_0x1ff0fa[_0x8d3a('0x74')],'erlangAbandonmentRate':_0x1ff0fa[_0x8d3a('0x75')],'erlangBusyFactor':_0x1ff0fa[_0x8d3a('0x76')],'startPredictive':_0x1ff0fa[_0x8d3a('0x26')],'startProgressive':_0x1ff0fa['startProgressive']};if(_0x1ff0fa[_0x8d3a('0x77')]){_0x34c34b[_0x8d3a('0x77')]={'id':_0x1ff0fa['Trunk']['id'],'name':_0x1ff0fa[_0x8d3a('0x77')][_0x8d3a('0x3e')],'active':_0x1ff0fa[_0x8d3a('0x77')][_0x8d3a('0x78')],'callerid':_0x1ff0fa['Trunk'][_0x8d3a('0x79')]};}if(_0x1ff0fa[_0x8d3a('0x40')]){_0x34c34b[_0x8d3a('0x40')]={'id':_0x1ff0fa[_0x8d3a('0x40')]['id'],'name':_0x1ff0fa[_0x8d3a('0x40')][_0x8d3a('0x3e')]};}var _0x1ffb91=md5(JSON[_0x8d3a('0x47')](_0x34c34b));if(_0x1ff0fa[_0x8d3a('0x4')]!==_0x1ffb91){_0x1ff0fa[_0x8d3a('0x4')]=_0x1ffb91;emit(util['format'](_0x8d3a('0x7a'),_0x34c34b[_0x8d3a('0x3e')]),'voice_queue:save',_0x34c34b);}}}function emitCampaignSummary(_0x254680){if(_0x254680['type']===_0x8d3a('0x7b')){emit(util[_0x8d3a('0x7c')](_0x8d3a('0x7d'),_0x254680[_0x8d3a('0x3e')]),'campaign:save',_0x254680);}}function checkGetDataPredictive(_0x2d0d27){if(isNotNull(_0x2d0d27)&&!_[_0x8d3a('0x44')](_0x2d0d27)){loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x7f'));loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x80'),_0x2d0d27[_0x8d3a('0x81')]);loggerPredictive[_0x8d3a('0x7e')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2d0d27['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x82'),_0x2d0d27[_0x8d3a('0x6d')]);loggerPredictive['info'](_0x8d3a('0x83'),_0x2d0d27[_0x8d3a('0x6c')]);loggerPredictive['info'](_0x8d3a('0x84'),_0x2d0d27[_0x8d3a('0x6a')]);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x85'),_0x2d0d27[_0x8d3a('0x6b')]);loggerPredictive[_0x8d3a('0x7e')]('---------------------------');if(_0x2d0d27[_0x8d3a('0x81')]>0x0){if(!_[_0x8d3a('0x86')](_0x2d0d27[_0x8d3a('0x6b')])&&_0x2d0d27['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x87'));if(!_['isUndefined'](_0x2d0d27['predictiveIntervalAvgHoldtime'])&&_0x2d0d27[_0x8d3a('0x6a')]>0x0){return!![];}loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x88'));}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x89'));}return![];}function mergeDataErlangB(_0x4f6114){return function(_0x1e7892){loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8a'));loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8b'),_0x1e7892['erlangCalls']);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8c'),_0x1e7892[_0x8d3a('0x74')]);loggerPredictive[_0x8d3a('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e7892['erlangAbandonmentRate']);loggerPredictive['info'](_0x8d3a('0x8d'),_0x1e7892['erlangBusyFactor']);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8e'),_0x1e7892['erlangAbandonmentRate']);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8f'));_['merge'](_0x4f6114,_0x1e7892);};}function getDiff(_0x542561){var _0x136ae3=moment()[_0x8d3a('0x48')](0x0);var _0x377b5a=moment(_0x542561)[_0x8d3a('0x48')](0x0);return _0x136ae3[_0x8d3a('0x49')](_0x377b5a,'seconds');}function ifInterval(_0x5b276c,_0x5174a7){if(_[_0x8d3a('0x86')](_0x5174a7)){return![];}return getDiff(_0x5174a7)<_0x5b276c*0x3c;}function freeVariablesPredictive(_0x574ca1){if(isNotNull(_0x574ca1)){if(!_[_0x8d3a('0x86')](_0x574ca1[_0x8d3a('0x27')])){_0x574ca1[_0x8d3a('0x27')]=undefined;loggerPredictive[_0x8d3a('0x7e')](_0x574ca1['name'],_0x8d3a('0x90'));}if(!_[_0x8d3a('0x86')](_0x574ca1[_0x8d3a('0x26')])){_0x574ca1[_0x8d3a('0x26')]=undefined;loggerPredictive['info'](_0x574ca1[_0x8d3a('0x3e')],_0x8d3a('0x91'));}if(!_[_0x8d3a('0x86')](_0x574ca1['handlePredictive'])){clearInterval(_0x574ca1[_0x8d3a('0x92')]);_0x574ca1['handlePredictive']=undefined;loggerPredictive[_0x8d3a('0x7e')](_0x574ca1[_0x8d3a('0x3e')],_0x8d3a('0x93'));}}}function erlangb(_0x5c84c4,_0x330801){if(_0x330801===0x0){return 0x0;}var _0x3892fd=0x1;for(var _0x420ea8=0x1;_0x420ea8<=_0x330801;_0x420ea8+=0x1){_0x3892fd=0x1+_0x3892fd*_0x420ea8/_0x5c84c4;}return 0x1/_0x3892fd;}function isVoiceQueueOutbound(_0x2a6471){return _0x2a6471===_0x8d3a('0x4d');}function isNotPreview(_0x36a69b){return _0x36a69b!==_0x8d3a('0x94');}function isCampaignIvr(_0x27ca33){return _0x27ca33===_0x8d3a('0x7b');}function getCallerId(_0x1a5c3c,_0x18830c,_0x1241bb){if(!_[_0x8d3a('0x86')](_0x1241bb)&&typeof _0x1241bb===_0x8d3a('0x95')&&!_['isEmpty'](_0x1241bb)){if(!_[_0x8d3a('0x86')](_0x18830c)&&typeof _0x18830c===_0x8d3a('0x95')&&!_[_0x8d3a('0x44')](_0x18830c)){return util[_0x8d3a('0x7c')](_0x8d3a('0x96'),_0x18830c,_0x1241bb);}return util['format']('\x22%s\x22\x20<%s>',_0x1241bb,_0x1241bb);}if(!_[_0x8d3a('0x86')](_0x1a5c3c)&&typeof _0x1a5c3c==='string'&&!_[_0x8d3a('0x44')](_0x1a5c3c)){return _0x1a5c3c;}return _0x8d3a('0x97');}function loggerCatchQueueSummary(_0x225576,_0x2d321b){return function(_0x2f2cf9){freeVariablesPredictive(_0x2d321b);emitVoiceQueueSummary(_0x2d321b);emitCampaignSummary(_0x2d321b);loggerSyncQueueSummary[_0x8d3a('0x98')](_0x225576,util[_0x8d3a('0x99')](_0x2f2cf9,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3554cc,_0x3a62bf){return function(_0x4f4a9c){loggerPredictive[_0x8d3a('0x98')](_0x3a62bf[_0x8d3a('0x3e')],_0x3554cc);loggerPredictive[_0x8d3a('0x98')](_0x4f4a9c[_0x8d3a('0x9a')]);freeVariablesPredictive(_0x3a62bf);};}function loggerCatch(_0x344bd9){return function(_0x5b46b6){logger[_0x8d3a('0x98')](_0x344bd9,util[_0x8d3a('0x99')](_0x5b46b6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x4525f5){return _0x4525f5&&!_[_0x8d3a('0x86')](_0x4525f5)&&_0x4525f5[_0x8d3a('0x9b')]>0x0;}function decremetOriginate(_0x47a2ca){if(!_[_0x8d3a('0x86')](_0x47a2ca)&&_0x47a2ca!==null){if(typeof _0x47a2ca[_0x8d3a('0x72')]!==_0x8d3a('0x9c')){if(_0x47a2ca[_0x8d3a('0x72')]>0x0){_0x47a2ca[_0x8d3a('0x72')]-=0x1;}else{logger['error'](_0x8d3a('0x9d'));}}}else{logger[_0x8d3a('0x98')](_0x8d3a('0x9e'));}}function checkContactLowerLimitOriginate(_0x5c58bb,_0x4c78b9,_0x34c1cc){if(_0x4c78b9>_0x34c1cc){for(var _0x5b34e2=0x0;_0x5b34e2<_0x4c78b9-_0x34c1cc;_0x5b34e2+=0x1){decremetOriginate(_0x5c58bb);}}}function loggerGetContactDialer(_0x690c31,_0x134377,_0x2e451e){return function(_0x14621a){checkContactLowerLimitOriginate(_0x134377,_0x2e451e,0x0);logger['error'](_0x690c31,util[_0x8d3a('0x99')](_0x14621a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5814a9){return function(_0x1a5b1c){if(isNotNull(_0x1a5b1c)&&isNotNull(_0x1a5b1c[0x0])){if(_0x1a5b1c[0x0]['contactsRescheduled']>0x0){_0x5814a9['message']=_0x8d3a('0x9f');logger[_0x8d3a('0x7e')](_0x8d3a('0xa0')+_0x5814a9[_0x8d3a('0x3e')],_0x1a5b1c[0x0][_0x8d3a('0xa1')],_0x8d3a('0xa2'));}else{_0x5814a9[_0x8d3a('0x3d')]=_0x8d3a('0xa3');logger[_0x8d3a('0x7e')](_0x8d3a('0xa4')+_0x5814a9[_0x8d3a('0x3e')]);}}};}function notSendMessagesQueue(_0x341696){if(_0x341696[_0x8d3a('0xa5')]){freeVariablesPredictive(_0x341696);if(_0x341696[_0x8d3a('0x72')]===0x0&&_0x341696[_0x8d3a('0x54')]===0x0&&_0x341696['waiting']===0x0&&(_0x341696['pTalking']||0x0)===0x0){_0x341696[_0x8d3a('0xa5')]=![];_0x341696[_0x8d3a('0x50')]=0x0;_0x341696['message']=_0x8d3a('0x3f');loggerSyncQueueSummary[_0x8d3a('0x98')](_0x8d3a('0xa6'),_0x341696[_0x8d3a('0x3e')],_0x8d3a('0xa7'));}else{_0x341696[_0x8d3a('0x3d')]=_0x8d3a('0xa8');loggerSyncQueueSummary[_0x8d3a('0x98')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x341696['name'],_0x8d3a('0xa9'));}emitVoiceQueueSummary(_0x341696);}}function notSendMessagesCampaign(_0x5c943b){if(_0x5c943b[_0x8d3a('0xa5')]){if(_0x5c943b[_0x8d3a('0x72')]===0x0){_0x5c943b['sendMessageOneNotActive']=![];_0x5c943b[_0x8d3a('0x3d')]=_0x8d3a('0x3f');loggerSyncQueueSummary['error'](_0x8d3a('0xaa'),_0x5c943b[_0x8d3a('0x3e')],'is\x20not\x20active');}else{_0x5c943b[_0x8d3a('0x3d')]=_0x8d3a('0xa8');loggerSyncQueueSummary['error'](_0x8d3a('0xaa'),_0x5c943b['name'],'is\x20disactive');}emitCampaignSummary(_0x5c943b);}}function createObjHistory(_0x53dad1,_0x2bb930,_0x178250,_0x5496d4,_0xa0260c){_0x53dad1['message']=_0x178250;var _0x10993b=new Action(_0x53dad1,_0x2bb930);var _0x5ad004=new History(_0x10993b);_0x5ad004[_0x8d3a('0xab')]=_0x5496d4;_0x5ad004[_0x8d3a('0xac')]=_0xa0260c;_0x5ad004[_0x8d3a('0xad')]=_0x10993b[_0x8d3a('0xae')];return _0x5ad004;}Dialer[_0x8d3a('0xaf')][_0x8d3a('0x3c')]=function(){var _0x4cb8e5=this;setInterval(function(){_0x4cb8e5[_0x8d3a('0xb0')](_0x4cb8e5[_0x8d3a('0x24')],'[uniqueid]');_0x4cb8e5[_0x8d3a('0xb0')](_0x4cb8e5['actions'],_0x8d3a('0xb1'));},0x32c8);};Dialer['prototype'][_0x8d3a('0xb0')]=function(_0x318ead,_0x1e956d){var _0x29f8ac=this;for(var _0x16b702 in _0x318ead){if(typeof _0x318ead[_0x16b702]!=='undefined'){this[_0x8d3a('0x1c')]['enqueue'](function(){if(!_[_0x8d3a('0xb2')](_0x318ead[_0x16b702])){return ami[_0x8d3a('0xb3')]({'action':'status','channel':_0x318ead[_0x16b702][_0x8d3a('0xb4')]})['catch'](function(_0x5fa21e){if(_0x5fa21e['message']===_0x8d3a('0xb5')){setTimeout(function(){if(_0x318ead[_0x16b702]&&_0x318ead[_0x16b702][_0x8d3a('0x4c')]!=='ivr'){_0x29f8ac[_0x8d3a('0xb6')](_0x29f8ac[_0x8d3a('0x1d')][_0x318ead[_0x16b702][_0x8d3a('0xb7')]]);logger[_0x8d3a('0x98')](_0x8d3a('0xb8'),_0x1e956d,_0x16b702,_0x318ead[_0x16b702][_0x8d3a('0xb7')]);delete _0x318ead[_0x16b702];}if(_0x318ead[_0x16b702]&&_0x318ead[_0x16b702]['type']===_0x8d3a('0x7b')){_0x29f8ac[_0x8d3a('0xb6')](_0x29f8ac[_0x8d3a('0x1e')][_0x318ead[_0x16b702][_0x8d3a('0xb7')]]);logger[_0x8d3a('0x98')]('[Dialer][checkChannel][ivr]',_0x1e956d,_0x16b702,_0x318ead[_0x16b702]['queue']);delete _0x318ead[_0x16b702];}},0x2328);}});}});}}};Dialer[_0x8d3a('0xaf')]['countReScheduled']=function(_0x5221d3){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopper['countReScheduled'](_0x5221d3))[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xbc')));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xbd')]=function(_0x54c5f4){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopperBlack[_0x8d3a('0xbd')](_0x54c5f4))[_0x8d3a('0xbb')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x8d3a('0xaf')]['checkIsBlackListIvr']=function(_0x3df1a4){return BPromise['resolve']()[_0x8d3a('0xba')](cmHopperBlack[_0x8d3a('0xbe')](_0x3df1a4))[_0x8d3a('0xbb')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xbf')]=function(_0x18af3b){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopperHistory[_0x8d3a('0xc0')](_0x18af3b))[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xc1')));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xc2')]=function(_0x50744c){return BPromise['resolve']()[_0x8d3a('0xba')](cmHopper[_0x8d3a('0xc2')](_0x50744c))['catch'](loggerCatch(_0x8d3a('0xc3')));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xc4')]=function(_0x5c9152,_0x19be2f,_0x76646d){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopper[_0x8d3a('0xc4')](_0x5c9152,_0x19be2f,_0x76646d))[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xc5')));};Dialer['prototype'][_0x8d3a('0xc6')]=function(_0x59003d,_0xd47d1c,_0x2432c1,_0x5d5444,_0x227f57){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopper[_0x8d3a('0xc6')](_0x59003d,_0xd47d1c,_0x2432c1,_0x5d5444))['catch'](function(_0x3f2c56){_0x227f57[_0x8d3a('0xc7')]-=_0x2432c1;_0x227f57[_0x8d3a('0xc7')]=_0x227f57[_0x8d3a('0xc7')]>0x0?_0x227f57['temp']:0x0;loggerCatch(_0x8d3a('0xc8'))(_0x3f2c56);});};Dialer['prototype'][_0x8d3a('0xc9')]=function(_0x5d3910,_0x583ebc,_0x3640ac,_0x10ce9c){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopper[_0x8d3a('0xc9')](_0x5d3910,_0x583ebc,_0x3640ac))[_0x8d3a('0xbb')](function(_0x4ee4f9){_0x10ce9c['temp']-=_0x583ebc;_0x10ce9c[_0x8d3a('0xc7')]=_0x10ce9c['temp']>0x0?_0x10ce9c[_0x8d3a('0xc7')]:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x4ee4f9);});};Dialer[_0x8d3a('0xaf')]['getVoiceQueueRtPauses']=function(_0x455aae){return BPromise[_0x8d3a('0xb9')]()['then'](voiceQueueRt[_0x8d3a('0xca')](_0x455aae))[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xcb')));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xcc')]=function(_0x2ae62c){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopper[_0x8d3a('0xcc')](_0x2ae62c))['catch'](loggerCatch(_0x8d3a('0xcd')));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xce')]=function(_0x12da42){return BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](cmHopperHistory[_0x8d3a('0xce')](_0x12da42))[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xcf')));};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xb6')]=function(_0x3e1616){if(!_[_0x8d3a('0x86')](_0x3e1616)&&_0x3e1616!==null){if(typeof _0x3e1616[_0x8d3a('0x72')]!=='undefined'){if(_0x3e1616[_0x8d3a('0x72')]>0x0){_0x3e1616['originated']-=0x1;}else{logger[_0x8d3a('0x98')](_0x8d3a('0xd0'));}}}else{logger[_0x8d3a('0x98')](_0x8d3a('0xd1'));}};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xd2')]=function(_0x39800b,_0x1250fe){var _0x3c888e=this;return function(_0x2918ca){_0x3c888e['updateOriginated'](_0x1250fe);logger['error'](_0x39800b,util[_0x8d3a('0x99')](_0x2918ca,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x8d3a('0xd3')]=function(_0x4ec901,_0x3f313b,_0x1dbfdb){var _0x19b0b2={'state':0x19,'statedesc':'notFound'};this[_0x8d3a('0xb6')](_0x3f313b);this['saveInDb'](_[_0x8d3a('0xd4')](_0x19b0b2,_[_0x8d3a('0xd5')](_0x1dbfdb,[_0x8d3a('0xd6'),_0x8d3a('0xd7'),'UserId',_0x8d3a('0xd8'),_0x8d3a('0xd9')])),_0x8d3a('0xda'),'[emptyContact]');logger[_0x8d3a('0x98')](_0x4ec901);};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xdb')]=function(_0x152195){return _0x152195==='Success';};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xdc')]=function(_0x1b0d05){return!_[_0x8d3a('0x86')](_0x1b0d05)&&_0x1b0d05&&!_[_0x8d3a('0x86')](_0x1b0d05[_0x8d3a('0x3e')])&&!_['isUndefined'](_0x1b0d05['active'])&&_0x1b0d05[_0x8d3a('0x78')]&&(this['trunks'][util['format'](_0x8d3a('0xdd'),_0x1b0d05[_0x8d3a('0x3e')])][_0x8d3a('0xde')]===_0x8d3a('0xdf')||this[_0x8d3a('0x20')][util['format'](_0x8d3a('0xdd'),_0x1b0d05[_0x8d3a('0x3e')])]['status']==='unmonitored');};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xe0')]=function(_0x5b41cc,_0x1cb63e,_0x107b75){this['createHistory'](_0x5b41cc)[_0x8d3a('0xbb')](loggerCatch(_0x1cb63e));this[_0x8d3a('0xcc')](_0x5b41cc)[_0x8d3a('0xbb')](loggerCatch(_0x107b75));};Dialer['prototype'][_0x8d3a('0xe1')]=function(_0x556b16){var _0x20d35b=this[_0x8d3a('0x24')][_0x556b16[_0x8d3a('0xe2')]];var _0x529aa7;if(!_[_0x8d3a('0xb2')](_0x556b16)&&!_[_0x8d3a('0xb2')](_0x556b16['variable'])&&!_[_0x8d3a('0xb2')](_0x556b16['variable']['amdstatus'])&&_0x556b16[_0x8d3a('0xe3')]===_0x8d3a('0xe4')&&_0x20d35b){if(_0x20d35b[_0x8d3a('0x4c')]!==_0x8d3a('0x7b')&&this[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0xe5')]&&_0x556b16[_0x8d3a('0xe6')]===_0x8d3a('0xe7')){delete this[_0x8d3a('0x24')][_0x556b16['uniqueid']];this['updateOriginated'](this[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]]);this[_0x8d3a('0x1d')][_0x20d35b['queue']][_0x8d3a('0x60')]+=0x1;this[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0x5f')]+=0x1;_0x529aa7=new Hangup(_0x20d35b,_0x556b16);_0x529aa7['state']=0x12;_0x529aa7[_0x8d3a('0xac')]='HangupInAMD';_0x529aa7['membername']=_0x8d3a('0xe8');ami['emit'](_0x8d3a('0xe9'),ut[_0x8d3a('0xea')](_0x529aa7,_0x8d3a('0xeb')));this[_0x8d3a('0xe0')](_0x529aa7,_0x8d3a('0xec'),_0x8d3a('0xed'));}if(_0x20d35b[_0x8d3a('0x4c')]!=='ivr'&&this[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0xe5')]&&_0x556b16[_0x8d3a('0xe6')]===_0x8d3a('0xee')){var _0x27cbfc=this;return new BPromise(function(_0x1dfc6f,_0xc725c3){delete _0x27cbfc[_0x8d3a('0x24')][_0x556b16[_0x8d3a('0xe2')]];_0x27cbfc[_0x8d3a('0xb6')](_0x27cbfc[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]]);_0x27cbfc[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0x60')]+=0x1;_0x27cbfc['voiceQueues'][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0x5f')]+=0x1;var _0xe48674=_0x27cbfc[_0x8d3a('0x1d')][_0x20d35b[_0x8d3a('0xb7')]];var _0x412e12=new Hangup(_0x20d35b,_0x556b16);_0x412e12[_0x8d3a('0xab')]=0x13;_0x412e12['statedesc']=_0x8d3a('0xef');_0x412e12[_0x8d3a('0xf0')]=_0x8d3a('0xe8');_0x412e12['countmachineretry']+=0x1;_0x412e12[_0x8d3a('0xf1')]+=0x1;_0x412e12[_0x8d3a('0xeb')]=!![];ami[_0x8d3a('0x4b')](_0x8d3a('0xe9'),ut[_0x8d3a('0xea')](_0x412e12,_0x8d3a('0xeb')));_0x27cbfc[_0x8d3a('0xce')](_0x412e12)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xf2')));if(_0x412e12[_0x8d3a('0xf3')]+_0x412e12['countcongestionretry']+_0x412e12[_0x8d3a('0xf4')]+_0x412e12[_0x8d3a('0xf5')]+_0x412e12[_0x8d3a('0xf6')]+_0x412e12[_0x8d3a('0xf7')]+_0x412e12[_0x8d3a('0xf8')]+_0x412e12[_0x8d3a('0xf9')]>=_0xe48674[_0x8d3a('0xfa')]){_0x27cbfc[_0x8d3a('0xfb')](_0x412e12,_0x1dfc6f,_0xc725c3,_0x8d3a('0xfc'));}else{if(_0x412e12[_0x8d3a('0xf8')]>=_0xe48674[_0x8d3a('0xfd')]){_0x27cbfc[_0x8d3a('0xfe')](_0x412e12,_0x1dfc6f,_0xc725c3,_0x8d3a('0xff'));}else{_0x27cbfc['rescheduleContact']({'active':![],'countmachineretry':_0x412e12[_0x8d3a('0xf8')],'scheduledat':moment()[_0x8d3a('0x100')](_0xe48674[_0x8d3a('0x101')],_0x8d3a('0x102'))[_0x8d3a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x412e12['ContactId'],'ListId':_0x412e12[_0x8d3a('0xd7')],'VoiceQueueId':_0x412e12['VoiceQueueId']||undefined,'CampaignId':_0x412e12['CampaignId']||undefined})['catch'](loggerCatch(_0x8d3a('0x103')));_0x1dfc6f({'reschedule':0x1});}}});}if(_0x20d35b[_0x8d3a('0x4c')]===_0x8d3a('0x7b')&&this[_0x8d3a('0x1e')][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0xe5')]&&_0x556b16['value']===_0x8d3a('0xe7')){delete this['uniqueId'][_0x556b16[_0x8d3a('0xe2')]];this[_0x8d3a('0xb6')](this[_0x8d3a('0x1e')][_0x20d35b[_0x8d3a('0xb7')]]);_0x529aa7=new Hangup(_0x20d35b,_0x556b16);_0x529aa7[_0x8d3a('0xab')]=0x12;_0x529aa7[_0x8d3a('0xac')]=_0x8d3a('0x104');_0x529aa7[_0x8d3a('0xf0')]=_0x8d3a('0xe8');ami[_0x8d3a('0x4b')](_0x8d3a('0xe9'),ut[_0x8d3a('0xea')](_0x529aa7,'amd'));this['saveInDb'](_0x529aa7,_0x8d3a('0x105'),'[syncHangupInAMDIvr]');}if(_0x20d35b['type']===_0x8d3a('0x7b')&&this['campaigns'][_0x20d35b[_0x8d3a('0xb7')]]['dialAMDActive']&&_0x556b16[_0x8d3a('0xe6')]===_0x8d3a('0xee')){var _0x27cbfc=this;return new BPromise(function(_0x59a75e,_0x51d4c6){delete _0x27cbfc[_0x8d3a('0x24')][_0x556b16['uniqueid']];_0x27cbfc[_0x8d3a('0xb6')](_0x27cbfc[_0x8d3a('0x1e')][_0x20d35b[_0x8d3a('0xb7')]]);_0x27cbfc['campaigns'][_0x20d35b[_0x8d3a('0xb7')]][_0x8d3a('0x60')]+=0x1;_0x27cbfc[_0x8d3a('0x1e')][_0x20d35b[_0x8d3a('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x135d78=_0x27cbfc[_0x8d3a('0x1e')][_0x20d35b[_0x8d3a('0xb7')]];var _0x378818=new Hangup(_0x20d35b,_0x556b16);_0x378818['state']=0x13;_0x378818['statedesc']=_0x8d3a('0xef');_0x378818[_0x8d3a('0xf0')]=_0x8d3a('0xe8');_0x378818[_0x8d3a('0xf8')]+=0x1;_0x378818['countglobal']+=0x1;_0x378818['amd']=!![];ami[_0x8d3a('0x4b')](_0x8d3a('0xe9'),ut['buildObj'](_0x378818,_0x8d3a('0xeb')));_0x27cbfc[_0x8d3a('0xce')](_0x378818)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xf2')));if(_0x378818[_0x8d3a('0xf3')]+_0x378818['countcongestionretry']+_0x378818[_0x8d3a('0xf4')]+_0x378818[_0x8d3a('0xf5')]+_0x378818[_0x8d3a('0xf6')]+_0x378818[_0x8d3a('0xf7')]+_0x378818[_0x8d3a('0xf8')]+_0x378818[_0x8d3a('0xf9')]>=_0x135d78['dialGlobalMaxRetry']){_0x27cbfc[_0x8d3a('0xfb')](_0x378818,_0x59a75e,_0x51d4c6,_0x8d3a('0xfc'));}else{if(_0x378818['countmachineretry']>=_0x135d78[_0x8d3a('0xfd')]){_0x27cbfc[_0x8d3a('0xfe')](_0x378818,_0x59a75e,_0x51d4c6,_0x8d3a('0xff'));}else{_0x27cbfc[_0x8d3a('0xc2')]({'active':![],'countmachineretry':_0x378818[_0x8d3a('0xf8')],'scheduledat':moment()[_0x8d3a('0x100')](_0x135d78['dialMachineRetryFrequency'],_0x8d3a('0x102'))[_0x8d3a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x378818[_0x8d3a('0xd6')],'ListId':_0x378818[_0x8d3a('0xd7')],'VoiceQueueId':_0x378818[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x378818[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x103')));_0x59a75e({'reschedule':0x1});}}});}}};Dialer[_0x8d3a('0xaf')]['syncHangup']=function(_0xf09a45){var _0x3548ec=this[_0x8d3a('0x24')][_0xf09a45[_0x8d3a('0xe2')]];var _0xaecbc8=this;var _0x1db1ea;if(_0x3548ec&&_0x3548ec[_0x8d3a('0x4c')]===_0x8d3a('0x7b')){delete this['uniqueId'][_0xf09a45[_0x8d3a('0xe2')]];this[_0x8d3a('0xb6')](this[_0x8d3a('0x1e')][_0x3548ec[_0x8d3a('0xb7')]]);this[_0x8d3a('0x1e')][_0x3548ec[_0x8d3a('0xb7')]][_0x8d3a('0x106')]+=0x1;_0x1db1ea=new Hangup(_0x3548ec,_0xf09a45);this[_0x8d3a('0xce')](_0x1db1ea)[_0x8d3a('0xbb')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x8d3a('0xcc')](_0x1db1ea)['catch'](loggerCatch(_0x8d3a('0x107')));}if(_0x3548ec&&_0x3548ec[_0x8d3a('0x4c')]!==_0x8d3a('0x7b')&&isNotNull(this[_0x8d3a('0x1d')][_0x3548ec[_0x8d3a('0xb7')]][_0x8d3a('0x108')])){delete this[_0x8d3a('0x24')][_0xf09a45[_0x8d3a('0xe2')]];this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][_0x3548ec[_0x8d3a('0xb7')]]);this[_0x8d3a('0x1d')][_0x3548ec['queue']]['outboundAnswerCallsDay']+=0x1;this[_0x8d3a('0x1d')][_0x3548ec[_0x8d3a('0xb7')]][_0x8d3a('0x5f')]+=0x1;_0x1db1ea=new Hangup(_0x3548ec,_0xf09a45);_0x1db1ea[_0x8d3a('0xab')]=0x10;_0x1db1ea[_0x8d3a('0xac')]=_0x8d3a('0x109');_0x1db1ea[_0x8d3a('0xf0')]=_0x8d3a('0x10a');this[_0x8d3a('0xce')](_0x1db1ea)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x10b')));this[_0x8d3a('0xcc')](_0x1db1ea)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x107')));}if(_0x3548ec&&_0x3548ec[_0x8d3a('0x4c')]!==_0x8d3a('0x7b')&&!isNotNull(this[_0x8d3a('0x1d')][_0x3548ec[_0x8d3a('0xb7')]][_0x8d3a('0x108')])){delete this[_0x8d3a('0x24')][_0xf09a45['uniqueid']];this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][_0x3548ec['queue']]);this['voiceQueues'][_0x3548ec[_0x8d3a('0xb7')]][_0x8d3a('0x10c')]+=0x1;_0x1db1ea=new Hangup(_0x3548ec,_0xf09a45);_0x1db1ea['state']=0xc;_0x1db1ea[_0x8d3a('0xac')]=_0xf09a45[_0x8d3a('0x10d')];_0x1db1ea['membername']='Unknow';this[_0x8d3a('0xce')](_0x1db1ea)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x10b')));this['moveContactManagedDialer'](_0x1db1ea)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x107')));}};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x31')]=function(_0x847fd3){var _0x39ed98=this['uniqueId'][_0x847fd3['uniqueid']];var _0x4bbd00=this;if(this['voiceQueues'][_0x847fd3[_0x8d3a('0xb7')]]){if(_0x39ed98&&_0x39ed98[_0x8d3a('0x4c')]!==_0x8d3a('0x7b')){delete this[_0x8d3a('0x24')][_0x847fd3[_0x8d3a('0xe2')]];this['voiceQueues'][_0x847fd3['queue']][_0x8d3a('0x60')]+=0x1;var _0x20f9d8=new AgentComplete(_0x39ed98,_0x847fd3);if(_0x847fd3['reason']==='agent'){_0x20f9d8[_0x8d3a('0x10e')]=this[_0x8d3a('0x1d')][_0x847fd3['queue']][_0x8d3a('0x10f')]&&this['voiceQueues'][_0x847fd3[_0x8d3a('0xb7')]][_0x8d3a('0x110')]?moment()['format'](_0x8d3a('0x111')):undefined;}this[_0x8d3a('0xce')](_0x20f9d8)['catch'](loggerCatch(_0x8d3a('0x112')));this[_0x8d3a('0xcc')](_0x20f9d8)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x113')));}}};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x2b')]=function(_0x5a0e5c){if(this[_0x8d3a('0x1d')][_0x5a0e5c[_0x8d3a('0xb7')]]){if(this[_0x8d3a('0x24')][_0x5a0e5c['uniqueid']]&&this[_0x8d3a('0x24')][_0x5a0e5c['uniqueid']][_0x8d3a('0x4c')]!=='ivr'){this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][_0x5a0e5c[_0x8d3a('0xb7')]]);this[_0x8d3a('0x24')][_0x5a0e5c['uniqueid']][_0x8d3a('0x114')]=moment()[_0x8d3a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x8d3a('0x115')]=function(_0x29c3ad){this[_0x8d3a('0xce')](_0x29c3ad)[_0x8d3a('0xbb')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x29c3ad)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x116')));};Dialer['prototype'][_0x8d3a('0x2d')]=function(_0x4046ca){var _0x30308f=this['uniqueId'][_0x4046ca[_0x8d3a('0xe2')]];var _0xcfa363=this;if(this[_0x8d3a('0x1d')][_0x4046ca[_0x8d3a('0xb7')]]){if(_0x30308f&&_0x30308f['type']!==_0x8d3a('0x7b')){delete this['uniqueId'][_0x4046ca[_0x8d3a('0xe2')]];this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][_0x4046ca['queue']]);_0x30308f[_0x8d3a('0x117')]=moment()['format'](_0x8d3a('0x111'));var _0x3467f7=new QueueCallerAbandon(_0x30308f,_0x4046ca);if(getSeconds(_0x30308f['droptime'],_0x30308f[_0x8d3a('0x118')])>=_0x30308f[_0x8d3a('0x119')]){this['voiceQueues'][_0x4046ca[_0x8d3a('0xb7')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x8d3a('0x1d')][_0x4046ca['queue']][_0x8d3a('0x65')]+=0x1;this[_0x8d3a('0x1d')][_0x4046ca[_0x8d3a('0xb7')]][_0x8d3a('0x6e')]+=0x1;_0x3467f7['state']=0xa;_0x3467f7[_0x8d3a('0xac')]=_0x8d3a('0x11a');_0x3467f7['dropreason']=_0x8d3a('0x11b');_0x3467f7[_0x8d3a('0x10e')]=this[_0x8d3a('0x1d')][_0x4046ca['queue']][_0x8d3a('0x10f')]?moment()[_0x8d3a('0x7c')](_0x8d3a('0x111')):undefined;_0x3467f7['countdropretry']+=0x1;_0x3467f7[_0x8d3a('0xf1')]+=0x1;if(_0x3467f7[_0x8d3a('0xf6')]>=this[_0x8d3a('0x1d')][_0x4046ca[_0x8d3a('0xb7')]][_0x8d3a('0x11c')]){this[_0x8d3a('0x115')](_0x3467f7);}else{this[_0x8d3a('0xc2')]({'active':![],'countdropretry':_0x3467f7['countdropretry'],'scheduledat':moment()[_0x8d3a('0x100')](this['voiceQueues'][_0x4046ca[_0x8d3a('0xb7')]][_0x8d3a('0x11d')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x30308f[_0x8d3a('0xd6')],'ListId':_0x30308f[_0x8d3a('0xd7')],'VoiceQueueId':_0x30308f[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x30308f[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x11e')));var _0x599a7e=new History(_0x3467f7);_0x599a7e[_0x8d3a('0xab')]=0xa;_0x599a7e[_0x8d3a('0xac')]=_0x8d3a('0x11a');_0x599a7e[_0x8d3a('0xae')]=moment()[_0x8d3a('0x7c')](_0x8d3a('0x111'));_0x599a7e['endtime']=_0x599a7e[_0x8d3a('0xae')];_0x599a7e[_0x8d3a('0x11f')]=_0x3467f7[_0x8d3a('0x11f')];_0x599a7e[_0x8d3a('0x120')]=_0x3467f7[_0x8d3a('0x120')];this[_0x8d3a('0xce')](_0x599a7e)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x121')));}}else{this[_0x8d3a('0x1d')][_0x4046ca[_0x8d3a('0xb7')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x8d3a('0x1d')][_0x4046ca[_0x8d3a('0xb7')]][_0x8d3a('0x64')]+=0x1;_0x3467f7[_0x8d3a('0xab')]=0xb;_0x3467f7[_0x8d3a('0xac')]=_0x8d3a('0x122');_0x3467f7[_0x8d3a('0x123')]='CALLEREXIT';_0x3467f7[_0x8d3a('0xf7')]+=0x1;_0x3467f7[_0x8d3a('0xf1')]+=0x1;if(_0x3467f7[_0x8d3a('0xf7')]>=this[_0x8d3a('0x1d')][_0x4046ca[_0x8d3a('0xb7')]][_0x8d3a('0x124')]){this[_0x8d3a('0x115')](_0x3467f7);}else{this[_0x8d3a('0xc2')]({'active':![],'countabandonedretry':_0x3467f7[_0x8d3a('0xf7')],'scheduledat':moment()['add'](this[_0x8d3a('0x1d')][_0x4046ca['queue']][_0x8d3a('0x125')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x30308f[_0x8d3a('0xd6')],'ListId':_0x30308f[_0x8d3a('0xd7')],'VoiceQueueId':_0x30308f[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x30308f[_0x8d3a('0xd9')]||undefined})['catch'](loggerCatch(_0x8d3a('0x126')));var _0x599a7e=new History(_0x3467f7);_0x599a7e[_0x8d3a('0xab')]=0xb;_0x599a7e[_0x8d3a('0xac')]=_0x8d3a('0x122');_0x599a7e[_0x8d3a('0xae')]=moment()[_0x8d3a('0x7c')](_0x8d3a('0x111'));_0x599a7e[_0x8d3a('0xad')]=_0x599a7e['starttime'];_0x599a7e['calleridname']=_0x3467f7[_0x8d3a('0x11f')];_0x599a7e['calleridnum']=_0x3467f7[_0x8d3a('0x120')];this[_0x8d3a('0xce')](_0x599a7e)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x127')));}}}}};Dialer['prototype']['syncNewExten']=function(_0x4ef00b){if(this['actions'][_0x4ef00b[_0x8d3a('0xe2')]]){this['actions'][_0x4ef00b[_0x8d3a('0xe2')]][_0x8d3a('0xb4')]=_0x4ef00b[_0x8d3a('0xb4')];}if(this[_0x8d3a('0x24')][_0x4ef00b[_0x8d3a('0xe2')]]){this[_0x8d3a('0x24')][_0x4ef00b['uniqueid']][_0x8d3a('0xb4')]=_0x4ef00b[_0x8d3a('0xb4')];}};Dialer['prototype'][_0x8d3a('0x38')]=function(_0x283482){if(strategy[this[_0x8d3a('0x1d')][this[_0x8d3a('0x22')][_0x283482[_0x8d3a('0x128')]][_0x8d3a('0xb7')]][_0x8d3a('0x4e')]]===_0x8d3a('0x129')){if(this[_0x8d3a('0x22')][_0x283482['actionid']]&&_[_0x8d3a('0xb2')](this[_0x8d3a('0x22')][_0x283482[_0x8d3a('0x128')]]['locked'])&&_0x283482[_0x8d3a('0xde')]==='1'&&_0x283482[_0x8d3a('0x12a')]==='0'){if(this[_0x8d3a('0x1f')][_0x283482[_0x8d3a('0x12b')]]){if(!this['agents'][_0x283482[_0x8d3a('0x12b')]][_0x8d3a('0x12c')]){this[_0x8d3a('0x1f')][_0x283482['stateinterface']][_0x8d3a('0x12c')]=!![];this[_0x8d3a('0x22')][_0x283482[_0x8d3a('0x128')]][_0x8d3a('0x12c')]=!![];this[_0x8d3a('0x22')][_0x283482['actionid']]['stateinterface']=_0x283482['stateinterface'];}}}}else if((strategy[this[_0x8d3a('0x1d')][this[_0x8d3a('0x22')][_0x283482['actionid']][_0x8d3a('0xb7')]][_0x8d3a('0x4e')]]||_0x8d3a('0x19'))===_0x8d3a('0x19')){if(this[_0x8d3a('0x22')][_0x283482[_0x8d3a('0x128')]]){if(this[_0x8d3a('0x1f')][_0x283482['stateinterface']]){this[_0x8d3a('0x22')][_0x283482['actionid']][_0x8d3a('0x12b')]=_0x283482[_0x8d3a('0x12b')];if(_[_0x8d3a('0xb2')](this['queueBooked'][this['actions'][_0x283482['actionid']][_0x8d3a('0xb7')]])){this[_0x8d3a('0x28')][this[_0x8d3a('0x22')][_0x283482[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]=[];}this['queueBooked'][this[_0x8d3a('0x22')][_0x283482[_0x8d3a('0x128')]][_0x8d3a('0xb7')]][_0x8d3a('0x12d')](_[_0x8d3a('0xd4')](_[_0x8d3a('0xd5')](this[_0x8d3a('0x22')][_0x283482['actionid']],[_0x8d3a('0x12e'),_0x8d3a('0x12b')]),{'status':_0x283482[_0x8d3a('0xde')],'paused':_0x283482[_0x8d3a('0x12a')]}));}}}};function unlockQueueStatus(_0x37ff40,_0x31396f){setTimeout(function(){if(_[_0x8d3a('0x86')](_0x37ff40[_0x8d3a('0x12f')])){loggerBooked['error'](_0x8d3a('0x130'),_0x31396f);}_0x37ff40[_0x8d3a('0x12f')]=!![];loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x131'),_0x31396f,JSON[_0x8d3a('0x47')](_[_0x8d3a('0xd5')](_0x37ff40,[_0x8d3a('0x3e'),_0x8d3a('0x12f')])));},0x1f3);}Dialer['prototype'][_0x8d3a('0x3a')]=function(_0x5f227a){var _0x3647ca=this;var _0x4aa618=_0x3647ca[_0x8d3a('0x1d')][_0x3647ca['actions'][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]];if(strategy[this[_0x8d3a('0x1d')][this[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0xb7')]][_0x8d3a('0x4e')]]===_0x8d3a('0x129')){if(this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]&&this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0x12b')]){this[_0x8d3a('0x94')][_0x8d3a('0x132')](this['actions'][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0x12e')],this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['stateinterface'])[_0x8d3a('0xbb')](function(_0x206cd9){logger[_0x8d3a('0x98')](_0x8d3a('0x133'),util[_0x8d3a('0x99')](_0x206cd9,{'showHidden':![],'depth':null}));})[_0x8d3a('0x134')](function(){_0x3647ca['updateOriginated'](_0x3647ca[_0x8d3a('0x1d')][_0x3647ca[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]);_0x3647ca[_0x8d3a('0x1f')][_0x3647ca[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0x12b')]][_0x8d3a('0x12c')]=![];delete _0x3647ca['actions'][_0x5f227a[_0x8d3a('0x128')]];unlockQueueStatus(_0x4aa618);});}else{this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]);this[_0x8d3a('0xc2')]({'active':![],'ContactId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd6')],'ListId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd7')],'VoiceQueueId':this['actions'][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd8')]||undefined,'CampaignId':this['actions'][_0x5f227a['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0x8d3a('0x135')));delete this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]];unlockQueueStatus(_0x4aa618);}}else if((strategy[this[_0x8d3a('0x1d')][this['actions'][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]][_0x8d3a('0x4e')]]||'rrmemory')===_0x8d3a('0x19')){var _0x3e2328;if(this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]&&!_[_0x8d3a('0x44')](this[_0x8d3a('0x28')][this['actions'][_0x5f227a['actionid']]['queue']])){if(this[_0x8d3a('0x29')][_0x3647ca[_0x8d3a('0x22')][_0x5f227a['actionid']]['queue']]){this[_0x8d3a('0x29')][_0x3647ca[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['queue']]=this[_0x8d3a('0x29')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]?this[_0x8d3a('0x29')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['queue']]:this[_0x8d3a('0x28')][this['actions'][_0x5f227a['actionid']][_0x8d3a('0xb7')]]?this[_0x8d3a('0x28')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]][_0x8d3a('0x136')]||0x0:0x0;}this['queueBooked'][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]['_rr']=this[_0x8d3a('0x29')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]];for(var _0x380489=0x0;_0x380489<this[_0x8d3a('0x28')][this[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0xb7')]][_0x8d3a('0x9b')];_0x380489+=0x1){_0x3e2328=rr(this[_0x8d3a('0x28')][this['actions'][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]);this[_0x8d3a('0x29')][_0x3647ca[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0xb7')]]=this['queueBooked'][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['queue']][_0x8d3a('0x136')];if(_0x3e2328[_0x8d3a('0xde')]==='1'&&_0x3e2328[_0x8d3a('0x12a')]==='0'){break;}}if(!_[_0x8d3a('0xb2')](_0x3e2328)){this[_0x8d3a('0x1f')][_0x3e2328[_0x8d3a('0x12b')]][_0x8d3a('0x137')]=_[_0x8d3a('0x86')](this[_0x8d3a('0x1f')][_0x3e2328[_0x8d3a('0x12b')]]['unlockRR'])?!![]:this[_0x8d3a('0x1f')][_0x3e2328[_0x8d3a('0x12b')]][_0x8d3a('0x137')];}loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x138'),_0x5f227a[_0x8d3a('0x128')],_0x8d3a('0x139'),JSON[_0x8d3a('0x47')](_[_0x8d3a('0xd5')](this[_0x8d3a('0x1f')][_0x3e2328[_0x8d3a('0x12b')]],[_0x8d3a('0x3e'),_0x8d3a('0x137')])),_0x8d3a('0x13a'),JSON[_0x8d3a('0x47')](_0x3e2328[_0x8d3a('0x12e')]));if(!_[_0x8d3a('0xb2')](_0x3e2328)&&_0x3e2328[_0x8d3a('0xde')]==='1'&&_0x3e2328[_0x8d3a('0x12a')]==='0'&&this[_0x8d3a('0x1f')][_0x3e2328[_0x8d3a('0x12b')]][_0x8d3a('0x137')]){this[_0x8d3a('0x1f')][_0x3e2328['stateinterface']]['unlockRR']=![];this['queueBooked'][_0x3647ca[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]=[];this['preview'][_0x8d3a('0x132')](_0x3e2328['idHopper'],_0x3e2328[_0x8d3a('0x12b')])[_0x8d3a('0xbb')](function(_0x22d3d9){logger[_0x8d3a('0x98')](_0x8d3a('0x133'),util[_0x8d3a('0x99')](_0x22d3d9,{'showHidden':![],'depth':null}));})[_0x8d3a('0x134')](function(){_0x3647ca[_0x8d3a('0xb6')](_0x3647ca[_0x8d3a('0x1d')][_0x3647ca[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['queue']]);setTimeout(function(){_0x3647ca['agents'][_0x3e2328[_0x8d3a('0x12b')]][_0x8d3a('0x137')]=!![];loggerBooked[_0x8d3a('0x7e')]('[booked][RR][finaly]',_0x5f227a[_0x8d3a('0x128')],_0x8d3a('0x139'),JSON[_0x8d3a('0x47')](_['pick'](_0x3647ca['agents'][_0x3e2328[_0x8d3a('0x12b')]],[_0x8d3a('0x3e'),_0x8d3a('0x137')])),_0x8d3a('0x13a'),JSON[_0x8d3a('0x47')](_0x3e2328[_0x8d3a('0x12e')]));},0xc7);delete _0x3647ca[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]];unlockQueueStatus(_0x4aa618,_0x5f227a['actionid']);});}else{loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x13b'));this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['queue']]);this[_0x8d3a('0xc2')]({'active':![],'ContactId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd6')],'ListId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd7')],'VoiceQueueId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x8d3a('0x22')][_0x5f227a['actionid']]['CampaignId']||undefined})[_0x8d3a('0xbb')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x8d3a('0x22')][_0x5f227a['actionid']];unlockQueueStatus(_0x4aa618);}}else{loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x13c'));this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][this['actions'][_0x5f227a[_0x8d3a('0x128')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]]['ContactId'],'ListId':this[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0xd7')],'VoiceQueueId':this[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0xd8')]||undefined,'CampaignId':this[_0x8d3a('0x22')][_0x5f227a['actionid']][_0x8d3a('0xd9')]||undefined})['catch'](loggerCatch(_0x8d3a('0x13d')));delete this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]];unlockQueueStatus(_0x4aa618);}}else{loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x13e'));this[_0x8d3a('0xb6')](this[_0x8d3a('0x1d')][this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xb7')]]);this[_0x8d3a('0xc2')]({'active':![],'ContactId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd6')],'ListId':this['actions'][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd7')],'VoiceQueueId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd8')]||undefined,'CampaignId':this[_0x8d3a('0x22')][_0x5f227a[_0x8d3a('0x128')]][_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x13f')));delete this['actions'][_0x5f227a[_0x8d3a('0x128')]];unlockQueueStatus(_0x4aa618);}};Dialer['prototype'][_0x8d3a('0x3b')]=function(){var _0x355730=this;setInterval(function(){_0x355730[_0x8d3a('0x140')]();},0x3e8);};Dialer['prototype'][_0x8d3a('0x141')]=function(_0xfa816a){var _0x4c1bb0=this;return function(){if(!_0x4c1bb0['isTrunkReachable'](_0xfa816a[_0x8d3a('0x77')])){if(!_0x4c1bb0[_0x8d3a('0xdc')](_0xfa816a[_0x8d3a('0x142')])){_0xfa816a[_0x8d3a('0x3d')]=_0x8d3a('0x143');throw _0xfa816a[_0x8d3a('0x3e')]+_0x8d3a('0x144');}}};};Dialer['prototype'][_0x8d3a('0x145')]=function(_0x746d50,_0x3c68a2,_0x406ff3,_0xef449d){var _0x5e323b=this;return function(){var _0x1930ff=!![];return _0x5e323b[_0x8d3a('0x146')](_0x746d50,_0x3c68a2,_0x406ff3,_0xef449d,_0x1930ff);};};Dialer['prototype'][_0x8d3a('0x147')]=function(_0x3a6935,_0x4ae83b,_0x9b6cf,_0x13d762){var _0x14d253=this;return function(){var _0x162450=![];return _0x14d253[_0x8d3a('0x146')](_0x3a6935[_0x8d3a('0x42')],_0x4ae83b,_0x9b6cf,_0x13d762,_0x162450);};};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x146')]=function(_0x5934e7,_0x309f14,_0x2eb8e5,_0x49236e,_0x45ecb0){var _0x53bc24=[];return new BPromise(function(_0x53bb5e,_0x22c7ef){if(!isNotNull(_0x5934e7)){_0x49236e[_0x8d3a('0x3d')]='INTERVAL_IS_NULL';return _0x22c7ef(msgResponse(_0x8d3a('0x146'),'Failure',_0x2eb8e5+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x8d3a('0x44')](_0x5934e7)){_0x49236e[_0x8d3a('0x3d')]=_0x8d3a('0x148');return _0x22c7ef(msgResponse(_0x8d3a('0x146'),_0x8d3a('0x149'),_0x2eb8e5+_0x8d3a('0x14a')));}if(_0x309f14&&_[_0x8d3a('0x86')](config['timezones'][_0x309f14])){_0x49236e[_0x8d3a('0x3d')]=_0x8d3a('0x14b');return _0x22c7ef(msgResponse('ifTime','Failure',_0x2eb8e5+_0x8d3a('0x14c')+_0x309f14));}if(_[_0x8d3a('0x14d')](_0x5934e7)){for(var _0x43119a=0x0;_0x43119a<_0x5934e7[_0x8d3a('0x9b')];_0x43119a+=0x1){_0x53bc24[_0x8d3a('0x12d')](ami[_0x8d3a('0xb3')]({'action':_0x8d3a('0x14e'),'command':util[_0x8d3a('0x7c')](_0x8d3a('0x14f'),_0x5934e7[_0x43119a][_0x8d3a('0x150')],!_[_0x8d3a('0x86')](config[_0x8d3a('0x151')][_0x309f14])?_0x309f14:'')})['then'](function(_0x61205c){return _0x61205c['content'][_0x8d3a('0x152')]('true')>=0x0;})[_0x8d3a('0xbb')](myreject(_0x22c7ef)));}}else{_0x53bc24[_0x8d3a('0x12d')](ami[_0x8d3a('0xb3')]({'action':_0x8d3a('0x14e'),'command':util['format'](_0x8d3a('0x14f'),_0x5934e7,!_['isUndefined'](config[_0x8d3a('0x151')][_0x309f14])?_0x309f14:'')})[_0x8d3a('0xba')](function(_0x208472){return _0x208472['content'][_0x8d3a('0x152')](_0x8d3a('0x153'))>=0x0;})[_0x8d3a('0xbb')](myreject(_0x22c7ef)));}BPromise[_0x8d3a('0x154')](_0x53bc24)[_0x8d3a('0xba')](function(_0x1d900c){var _0x241bdd=_['some'](_0x1d900c);if(_0x241bdd){return _0x53bb5e(_0x241bdd);}else{_0x49236e[_0x8d3a('0x3d')]=_0x45ecb0?_0x8d3a('0x155'):_0x8d3a('0x156');return _0x22c7ef(msgResponse('[ifTime][promiseAll]','Failure',_0x8d3a('0x157')+_0x45ecb0+'\x20'+_0x2eb8e5+_0x8d3a('0x158')+util[_0x8d3a('0x99')](_0x5934e7,{'showHidden':![],'depth':null})+_0x8d3a('0x159')+_0x309f14));}})['catch'](function(_0x54a9b7){return _0x22c7ef(msgResponse(_0x8d3a('0x146'),_0x8d3a('0x149'),JSON[_0x8d3a('0x47')](_0x54a9b7)));});});};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x15a')]=function(_0x52a88b){var _0x478bd4=this;return function(){switch(_0x52a88b[_0x8d3a('0x5a')]){case _0x8d3a('0x15b'):freeVariablesPredictive(_0x52a88b);_0x478bd4[_0x8d3a('0x15c')](_0x52a88b,0x1);break;case _0x8d3a('0x15d'):freeVariablesPredictive(_0x52a88b);_0x478bd4['handlePower'](_0x52a88b,_0x52a88b[_0x8d3a('0x15e')]);break;case _0x8d3a('0x15f'):_0x478bd4['predictive'](_0x52a88b);break;case _0x8d3a('0x7'):freeVariablesPredictive(_0x52a88b);_0x478bd4['handlePower'](_0x52a88b,0x1);break;default:freeVariablesPredictive(_0x52a88b);logger[_0x8d3a('0x98')](_0x8d3a('0x160'),_0x52a88b[_0x8d3a('0x3e')],_0x8d3a('0x161'));}};};Dialer[_0x8d3a('0xaf')]['launchHandleIvr']=function(_0x2a7204){var _0x11b235=this;return function(){_0x11b235[_0x8d3a('0x162')](_0x2a7204);};};Dialer[_0x8d3a('0xaf')][_0x8d3a('0xa')]=function(_0x59e658){var _0x4d861d=this;if(isNotPreview(_0x59e658[_0x8d3a('0x5a')])){if(isVoiceQueueOutbound(_0x59e658[_0x8d3a('0x4c')])&&isActive(_0x59e658['dialActive'])){_0x59e658[_0x8d3a('0xa5')]=!![];BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](checkIsLoggedIn(_0x59e658,_0x59e658[_0x8d3a('0x51')]))['then'](checkIsActive(_0x59e658,_0x59e658['dialActive']))[_0x8d3a('0xba')](checkInterval(_0x59e658))[_0x8d3a('0xba')](_0x4d861d[_0x8d3a('0x141')](_0x59e658))[_0x8d3a('0xba')](_0x4d861d[_0x8d3a('0x145')](_0x59e658[_0x8d3a('0x163')],_0x59e658[_0x8d3a('0x164')],_0x59e658[_0x8d3a('0x3e')],_0x59e658))[_0x8d3a('0xba')](_0x4d861d[_0x8d3a('0x147')](_0x59e658[_0x8d3a('0x40')],_0x59e658[_0x8d3a('0x164')],_0x59e658['name'],_0x59e658))[_0x8d3a('0xba')](_0x4d861d[_0x8d3a('0x15a')](_0x59e658))[_0x8d3a('0xbb')](loggerCatchQueueSummary(_0x8d3a('0x165'),_0x59e658));}else{notSendMessagesQueue(_0x59e658);}}else{freeVariablesPredictive(_0x59e658);}};Dialer['prototype'][_0x8d3a('0x140')]=function(){var _0xb3b6b4=this;var _0x2ee14f;for(var _0x443e31 in this[_0x8d3a('0x1e')]){if(typeof this[_0x8d3a('0x1e')][_0x443e31]!==_0x8d3a('0x9c')){_0x2ee14f=this['campaigns'][_0x443e31];if(isCampaignIvr(_0x2ee14f[_0x8d3a('0x4c')])&&isActive(_0x2ee14f[_0x8d3a('0x78')])){_0x2ee14f[_0x8d3a('0xa5')]=!![];BPromise[_0x8d3a('0xb9')]()[_0x8d3a('0xba')](checkIsActive(_0x2ee14f,_0x2ee14f['active']))[_0x8d3a('0xba')](checkInterval(_0x2ee14f))[_0x8d3a('0xba')](_0xb3b6b4[_0x8d3a('0x141')](_0x2ee14f))[_0x8d3a('0xba')](_0xb3b6b4[_0x8d3a('0x145')](_0x2ee14f[_0x8d3a('0x163')],_0x2ee14f[_0x8d3a('0x164')],_0x2ee14f[_0x8d3a('0x3e')],_0x2ee14f))['then'](_0xb3b6b4[_0x8d3a('0x147')](_0x2ee14f[_0x8d3a('0x40')],_0x2ee14f['dialTimezone'],_0x2ee14f[_0x8d3a('0x3e')],_0x2ee14f))[_0x8d3a('0xba')](_0xb3b6b4[_0x8d3a('0x166')](_0x2ee14f))[_0x8d3a('0xbb')](loggerCatchQueueSummary(_0x8d3a('0x167'),_0x2ee14f));}else{notSendMessagesCampaign(_0x2ee14f);}}}};function getCallerIdRandom(_0x4099a4,_0x57dd8e){var _0x21a121;var _0x28e0a1;var _0x2e45ec;if(_0x57dd8e<=0x0){_0x57dd8e=0x1;}_0x21a121=new RegExp(_0x8d3a('0x168')+_0x57dd8e+'}$');_0x28e0a1=Math[_0x8d3a('0x169')](0xa,_0x57dd8e-0x1);_0x2e45ec=Math[_0x8d3a('0x169')](0xa,_0x57dd8e)-0x1;return util[_0x8d3a('0x7c')]('%s',_[_0x8d3a('0x16a')](_0x4099a4,_0x21a121,_['random'](_0x28e0a1,_0x2e45ec)));}function extractCalleridName(_0x32620e){var _0x5f0c33=_0x32620e['match'](/"(.*?)"/);return _0x5f0c33?_0x5f0c33[0x1]:_0x32620e;}function extractCalleridNumber(_0x2f4db8){var _0x9750ce=_0x2f4db8[_0x8d3a('0x16b')](/<(.*?)>/);return _0x9750ce?_0x9750ce[0x1]:_0x2f4db8;}Dialer[_0x8d3a('0xaf')]['actionOriginate']=function(_0x5b8a16,_0xaabfb8){var _0x5d4507=this;var _0x2edadf=uuid['v4']();this[_0x8d3a('0x22')][_0x2edadf]=new Action(_0x5b8a16,_0xaabfb8,_0x2edadf);return new BPromise(function(_0x230b73,_0x558d6b){if(_[_0x8d3a('0x86')](_0x5b8a16)&&typeof _0x5b8a16!==_0x8d3a('0x16c')){return _0x558d6b(msgResponse('originate',_0x8d3a('0x149'),_0x8d3a('0x16d')));}if(_['isUndefined'](_0xaabfb8[_0x8d3a('0x16e')][_0x8d3a('0x16f')])||_0xaabfb8[_0x8d3a('0x16e')][_0x8d3a('0x16f')]===null){return _0x558d6b(msgResponse(_0x8d3a('0x170'),_0x8d3a('0x149'),_0x8d3a('0x171')));}var _0x484549={'XMD-CALLERID':_0x5d4507[_0x8d3a('0x22')][_0x2edadf][_0x8d3a('0x172')](),'XMD-AGI':_0x5b8a16['dialQueueProject']?util[_0x8d3a('0x7c')](_0x8d3a('0x173'),ipAgi,_0x5b8a16[_0x8d3a('0x108')]):'NONE','XMD-AGIAFTER':_0x5b8a16[_0x8d3a('0x10f')]?util[_0x8d3a('0x7c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5b8a16[_0x8d3a('0x10f')]):'NONE','XMD-QUEUE':_0x5b8a16[_0x8d3a('0x4c')]===_0x8d3a('0x4d')?util['format'](_0x8d3a('0x174'),_0x5b8a16[_0x8d3a('0x3e')],_0x5b8a16['dialQueueOptions']||'',_0x5b8a16['dialAgiAfterHangupAgent']?'c':'',_0x5b8a16['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0xaabfb8[_0x8d3a('0xd6')],'XMD-CDRTYPE':_0x8d3a('0x175'),'CALLERID(all)':_0x5d4507[_0x8d3a('0x22')][_0x2edadf]['getCaller'](),'XMD-AMD':_0x5b8a16[_0x8d3a('0xe5')]?_0x8d3a('0x176'):_0x8d3a('0x177'),'XMD-DESTINATION':_0x8d3a('0xe4')};if(_0x5b8a16[_0x8d3a('0xe5')]){_0x484549[_0x8d3a('0x178')]=_0x5b8a16['dialAMDInitialSilence']||0x9c4;_0x484549['XMD-AMDGREETING']=_0x5b8a16['dialAMDGreeting']||0x5dc;_0x484549[_0x8d3a('0x179')]=_0x5b8a16[_0x8d3a('0x17a')]||0x320;_0x484549[_0x8d3a('0x17b')]=_0x5b8a16['dialAMDTotalAnalysisTime']||0x1388;_0x484549['XMD-AMDMINWORDLENGTH']=_0x5b8a16[_0x8d3a('0x17c')]||0x64;_0x484549[_0x8d3a('0x17d')]=_0x5b8a16[_0x8d3a('0x17e')]||0x32;_0x484549[_0x8d3a('0x17f')]=_0x5b8a16[_0x8d3a('0x180')]||0x3;_0x484549[_0x8d3a('0x181')]=_0x5b8a16[_0x8d3a('0x182')]||0x100;_0x484549[_0x8d3a('0x183')]=_0x5b8a16['dialAMDMaximumWordLength']||0x1388;}if(_0x5b8a16[_0x8d3a('0x4c')]==='outbound'){_0x484549[_0x8d3a('0x184')]=_0xaabfb8[_0x8d3a('0xd8')];}else{_0x484549[_0x8d3a('0x185')]=_0xaabfb8[_0x8d3a('0xd9')];}for(var _0x5b0ad6 in _0xaabfb8['Contact']){if(typeof _0xaabfb8[_0x8d3a('0x16e')][_0x5b0ad6]!==_0x8d3a('0x9c')){if(isNotNull(_0xaabfb8[_0x8d3a('0x16e')][_0x5b0ad6])&&_0x5b0ad6!=='id'&&_0x5b0ad6!==_0x8d3a('0x186')&&_0x5b0ad6!==_0x8d3a('0x187')&&_0x5b0ad6!=='updatedAt'){_0x484549[util[_0x8d3a('0x7c')](_0x8d3a('0x188'),_0x8d3a('0x189'),_['toUpper'](_0x5b0ad6))]=_0xaabfb8[_0x8d3a('0x16e')][_0x5b0ad6];}}}var _0x415dc5=_0x5d4507[_0x8d3a('0xdc')](_0x5b8a16[_0x8d3a('0x77')])?getCallerId(_0x5b8a16[_0x8d3a('0x77')][_0x8d3a('0x79')],_0x5b8a16[_0x8d3a('0x5b')],_0x5b8a16[_0x8d3a('0x18a')]>0x0?getCallerIdRandom(_0x5b8a16[_0x8d3a('0x5c')],_0x5b8a16[_0x8d3a('0x18a')]):_0x5b8a16['dialOriginateCallerIdNumber']):getCallerId(_[_0x8d3a('0xb2')](_0x5b8a16[_0x8d3a('0x142')])?_0x5b8a16[_0x8d3a('0x77')][_0x8d3a('0x79')]:_0x5b8a16['TrunkBackup'][_0x8d3a('0x79')],_0x5b8a16[_0x8d3a('0x5b')],_0x5b8a16[_0x8d3a('0x18a')]>0x0?getCallerIdRandom(_0x5b8a16['dialOriginateCallerIdNumber'],_0x5b8a16[_0x8d3a('0x18a')]):_0x5b8a16[_0x8d3a('0x5c')]);if(_0x415dc5){_0x484549[_0x8d3a('0x18b')]=_0x5d4507['actions'][_0x2edadf][_0x8d3a('0x18c')]=extractCalleridName(_0x415dc5);_0x484549[_0x8d3a('0x18d')]=_0x5d4507[_0x8d3a('0x22')][_0x2edadf][_0x8d3a('0x18e')]=extractCalleridNumber(_0x415dc5);}return ami[_0x8d3a('0xb3')]({'actionid':_0x2edadf,'action':_0x8d3a('0x170'),'channel':_0x5d4507[_0x8d3a('0xdc')](_0x5b8a16[_0x8d3a('0x77')])?util[_0x8d3a('0x7c')](_0x8d3a('0x18f'),_0x5b8a16[_0x8d3a('0x77')]['name'],isNotNull(_0x5b8a16['dialPrefix'])?_0x5b8a16[_0x8d3a('0x5e')]['trim']()||'':'',_0x5b8a16['dialCutDigit']>0x0?_0xaabfb8['Contact'][_0x8d3a('0x16f')]['substring'](_0x5b8a16[_0x8d3a('0x190')]):_0xaabfb8['Contact'][_0x8d3a('0x16f')]):util['format'](_0x8d3a('0x18f'),_[_0x8d3a('0xb2')](_0x5b8a16[_0x8d3a('0x142')])?_0x5b8a16[_0x8d3a('0x77')][_0x8d3a('0x3e')]:_0x5b8a16[_0x8d3a('0x142')][_0x8d3a('0x3e')],isNotNull(_0x5b8a16['dialPrefix'])?_0x5b8a16['dialPrefix'][_0x8d3a('0x191')]()||'':'',_0x5b8a16[_0x8d3a('0x190')]>0x0?_0xaabfb8[_0x8d3a('0x16e')][_0x8d3a('0x16f')][_0x8d3a('0x192')](_0x5b8a16[_0x8d3a('0x190')]):_0xaabfb8['Contact'][_0x8d3a('0x16f')]),'callerid':_0x415dc5,'Exten':_0x8d3a('0xe4'),'Context':_0x8d3a('0x193'),'Priority':'1','variable':_0x484549,'timeout':(_0x5b8a16[_0x8d3a('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2edadf})[_0x8d3a('0xba')](function(_0x318fac){return _0x230b73(_0x318fac);})['catch'](function(_0x516392){_0x5b8a16['outboundOriginateFailureCallsDay']+=0x1;var _0x283a84=new History(_0x5d4507[_0x8d3a('0x22')][_0x2edadf]);logger['error'](util[_0x8d3a('0x7c')]('[originateError]:\x20%s',JSON[_0x8d3a('0x47')](_0x516392)));_0x283a84['state']=0xe;_0x283a84['statedesc']=_0x8d3a('0x194');_0x283a84[_0x8d3a('0xae')]=moment()[_0x8d3a('0x7c')](_0x8d3a('0x111'));_0x283a84[_0x8d3a('0xad')]=_0x283a84[_0x8d3a('0xae')];_0x5d4507[_0x8d3a('0xce')](_0x283a84)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x195')));_0x5d4507[_0x8d3a('0xcc')](_0x283a84)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x195')))['finally'](function(){delete _0x5d4507[_0x8d3a('0x22')][_0x2edadf];return _0x558d6b(msgResponse(_0x8d3a('0x170'),_0x8d3a('0x46'),_0x8d3a('0x196')));});});});};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x2f')]=function(_0x2ff561){var _0xaf250f=this[_0x8d3a('0x22')][_0x2ff561[_0x8d3a('0x128')]];if(_0xaf250f){delete this[_0x8d3a('0x22')][_0x2ff561[_0x8d3a('0x128')]];_0xaf250f[_0x8d3a('0x118')]=moment()[_0x8d3a('0x7c')](_0x8d3a('0x111'));var _0xf7eba1=_0xaf250f['type']===_0x8d3a('0x7b')?this[_0x8d3a('0x1e')][_0xaf250f[_0x8d3a('0xb7')]]:this['voiceQueues'][_0xaf250f[_0x8d3a('0x197')]()];if(!this[_0x8d3a('0xdb')](_0x2ff561['response'])){this[_0x8d3a('0xb6')](_0xf7eba1);return this[_0x8d3a('0x198')](_0xaf250f,_0xf7eba1,_0x2ff561)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x199')));}this[_0x8d3a('0x24')][_0x2ff561[_0x8d3a('0xe2')]]=_0xaf250f;}};Dialer['prototype'][_0x8d3a('0x19a')]=function(_0x3a5769,_0x5c0824,_0x377d9a){var _0x2a15ac=new History(_0x5c0824);if(_0x2a15ac[_0x8d3a('0xf3')]+_0x2a15ac[_0x8d3a('0x19b')]+_0x2a15ac[_0x8d3a('0xf4')]+_0x2a15ac[_0x8d3a('0xf5')]+_0x2a15ac['countdropretry']+_0x2a15ac['countabandonedretry']+_0x2a15ac[_0x8d3a('0xf8')]+_0x2a15ac['countagentrejectretry']>=_0x377d9a[_0x8d3a('0xfa')]-0x1){return!![];}switch(_0x3a5769){case 0x3:if(_0x2a15ac[_0x8d3a('0xf4')]>=_0x377d9a[_0x8d3a('0x19c')]-0x1){return!![];}this[_0x8d3a('0xc2')]({'active':![],'countnoanswerretry':_0x2a15ac[_0x8d3a('0xf4')]+=0x1,'scheduledat':moment()[_0x8d3a('0x100')](_0x377d9a[_0x8d3a('0x19d')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac['VoiceQueueId']||undefined,'CampaignId':_0x2a15ac['CampaignId']||undefined})[_0x8d3a('0xbb')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x2a15ac[_0x8d3a('0xf3')]>=_0x377d9a[_0x8d3a('0x19e')]-0x1){return!![];}this[_0x8d3a('0xc2')]({'active':![],'countbusyretry':_0x2a15ac[_0x8d3a('0xf3')]+=0x1,'scheduledat':moment()[_0x8d3a('0x100')](_0x377d9a[_0x8d3a('0x19f')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x2a15ac[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x2a15ac[_0x8d3a('0x19b')]>=_0x377d9a[_0x8d3a('0x1a0')]-0x1){return!![];}this[_0x8d3a('0xc2')]({'active':![],'countcongestionretry':_0x2a15ac[_0x8d3a('0x19b')]+=0x1,'scheduledat':moment()[_0x8d3a('0x100')](_0x377d9a[_0x8d3a('0x1a1')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x2a15ac['ContactId'],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac['VoiceQueueId']||undefined,'CampaignId':_0x2a15ac[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x2a15ac[_0x8d3a('0xf5')]>=_0x377d9a[_0x8d3a('0x1a2')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2a15ac[_0x8d3a('0xf5')]+=0x1,'scheduledat':moment()['add'](_0x377d9a[_0x8d3a('0x1a3')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x2a15ac[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x1a4')));}break;case 0xa:if(_0x2a15ac[_0x8d3a('0xf6')]>=_0x377d9a['dialDropMaxRetry']-0x1){return!![];}this[_0x8d3a('0xc2')]({'active':![],'countdropretry':_0x2a15ac[_0x8d3a('0xf6')]+=0x1,'scheduledat':moment()[_0x8d3a('0x100')](_0x377d9a[_0x8d3a('0x11d')],_0x8d3a('0x102'))['format'](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x2a15ac[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x11e')));break;case 0xb:if(_0x2a15ac[_0x8d3a('0xf7')]>=_0x377d9a[_0x8d3a('0x124')]-0x1){return!![];}this[_0x8d3a('0xc2')]({'active':![],'countabandonedretry':_0x2a15ac[_0x8d3a('0xf7')]+=0x1,'scheduledat':moment()[_0x8d3a('0x100')](_0x377d9a[_0x8d3a('0x125')],_0x8d3a('0x102'))['format'](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac['ListId'],'VoiceQueueId':_0x2a15ac['VoiceQueueId']||undefined,'CampaignId':_0x2a15ac[_0x8d3a('0xd9')]||undefined})['catch'](loggerCatch(_0x8d3a('0x126')));break;case 0x13:if(_0x2a15ac[_0x8d3a('0xf8')]>=_0x377d9a[_0x8d3a('0xfd')]-0x1){return!![];}this[_0x8d3a('0xc2')]({'active':![],'countmachineretry':_0x2a15ac[_0x8d3a('0xf8')]+=0x1,'scheduledat':moment()[_0x8d3a('0x100')](_0x377d9a[_0x8d3a('0x101')],'minutes')[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x2a15ac['CampaignId']||undefined})['catch'](loggerCatch(_0x8d3a('0x103')));break;case 0x14:if(_0x2a15ac[_0x8d3a('0xf9')]>=_0x377d9a[_0x8d3a('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x2a15ac[_0x8d3a('0xf9')]+=0x1,'scheduledat':moment()['add'](_0x377d9a[_0x8d3a('0x1a6')],_0x8d3a('0x102'))[_0x8d3a('0x7c')](_0x8d3a('0x111')),'ContactId':_0x2a15ac[_0x8d3a('0xd6')],'ListId':_0x2a15ac[_0x8d3a('0xd7')],'VoiceQueueId':_0x2a15ac['VoiceQueueId']||undefined,'CampaignId':_0x2a15ac[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x39b1b1,_0x2f7fe8,_0x34d92e){var _0x5945a6=this;var _0x1be852=new History(_0x39b1b1);return new BPromise(function(_0x55fc32,_0x108d9a){if(_[_0x8d3a('0x86')](_0x2f7fe8)&&typeof _0x2f7fe8!==_0x8d3a('0x16c')){return _0x108d9a(msgResponse(_0x8d3a('0x1a7'),_0x8d3a('0x149'),_0x8d3a('0x1a8')));}if(_[_0x8d3a('0x86')](_0x34d92e)&&typeof _0x34d92e!=='object'){return _0x108d9a(msgResponse(_0x8d3a('0x1a7'),_0x8d3a('0x149'),_0x8d3a('0x1a9')));}switch(_0x34d92e[_0x8d3a('0x1aa')]){case'0':_0x2f7fe8[_0x8d3a('0x66')]+=0x1;_0x1be852[_0x8d3a('0xab')]=0x0;_0x1be852['statedesc']=_0x8d3a('0x1ab');_0x1be852[_0x8d3a('0xf5')]+=0x1;_0x1be852[_0x8d3a('0xf1')]+=0x1;ami[_0x8d3a('0x4b')](_0x8d3a('0x1ac'),ut[_0x8d3a('0xea')](_0x39b1b1,_0x8d3a('0x1ad')));_0x5945a6[_0x8d3a('0xce')](_0x1be852)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xf2')));if(_0x5945a6[_0x8d3a('0x19a')](0x0,_0x39b1b1,_0x2f7fe8)){if(_0x1be852['countnosuchnumberretry']>=_0x2f7fe8[_0x8d3a('0x1a2')]){_0x5945a6[_0x8d3a('0xfe')](_0x1be852,_0x55fc32,_0x108d9a,'reason\x200\x20no\x20such\x20number....');}else{_0x5945a6[_0x8d3a('0xfb')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1ae'));}}break;case'3':_0x2f7fe8['outboundNoAnswerCallsDay']+=0x1;_0x1be852[_0x8d3a('0xab')]=0x3;_0x1be852[_0x8d3a('0xac')]=_0x8d3a('0x1af');_0x1be852[_0x8d3a('0xf4')]+=0x1;_0x1be852['countglobal']+=0x1;ami[_0x8d3a('0x4b')]('custom:agentnoanswer',ut['buildObj'](_0x39b1b1,_0x8d3a('0x1b0')));_0x5945a6[_0x8d3a('0xce')](_0x1be852)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x1b1')));if(_0x5945a6[_0x8d3a('0x19a')](0x3,_0x39b1b1,_0x2f7fe8)){if(_0x1be852[_0x8d3a('0xf4')]>=_0x2f7fe8['dialNoAnswerMaxRetry']){_0x5945a6[_0x8d3a('0xfe')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1b2'));}else{_0x5945a6[_0x8d3a('0xfb')](_0x1be852,_0x55fc32,_0x108d9a,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x2f7fe8[_0x8d3a('0x62')]+=0x1;_0x1be852[_0x8d3a('0xab')]=0x5;_0x1be852['statedesc']=_0x8d3a('0x1b3');_0x1be852[_0x8d3a('0xf3')]+=0x1;_0x1be852[_0x8d3a('0xf1')]+=0x1;ami['emit'](_0x8d3a('0x1b4'),ut[_0x8d3a('0xea')](_0x39b1b1,_0x8d3a('0x1b5')));_0x5945a6[_0x8d3a('0xce')](_0x1be852)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x1b6')));if(_0x5945a6['checkRetriveMax'](0x5,_0x39b1b1,_0x2f7fe8)){if(_0x1be852['countbusyretry']>=_0x2f7fe8[_0x8d3a('0x19e')]){_0x5945a6[_0x8d3a('0xfe')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1b7'));}else{_0x5945a6['stateGlobal'](_0x1be852,_0x55fc32,_0x108d9a,'reason\x205\x20busy');}}break;case'8':_0x2f7fe8[_0x8d3a('0x1b8')]+=0x1;_0x1be852[_0x8d3a('0xab')]=0x8;_0x1be852[_0x8d3a('0xac')]=_0x8d3a('0x1b9');_0x1be852[_0x8d3a('0x19b')]+=0x1;_0x1be852[_0x8d3a('0xf1')]+=0x1;ami[_0x8d3a('0x4b')]('custom:agentcongestion',ut['buildObj'](_0x39b1b1,'congestion'));_0x5945a6[_0x8d3a('0xce')](_0x1be852)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x1ba')));if(_0x5945a6[_0x8d3a('0x19a')](0x8,_0x39b1b1,_0x2f7fe8)){if(_0x1be852[_0x8d3a('0x19b')]>=_0x2f7fe8[_0x8d3a('0x1a0')]){_0x5945a6[_0x8d3a('0xfe')](_0x1be852,_0x55fc32,_0x108d9a,'reason\x208\x20congestion');}else{_0x5945a6[_0x8d3a('0xfb')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1bb'));}}break;case'11':_0x2f7fe8[_0x8d3a('0x1bc')]+=0x1;_0x1be852[_0x8d3a('0xab')]=0xb;_0x1be852[_0x8d3a('0xac')]='Abandoned';_0x1be852[_0x8d3a('0xf7')]+=0x1;_0x1be852[_0x8d3a('0xf1')]+=0x1;_0x5945a6[_0x8d3a('0xce')](_0x1be852)['catch'](loggerCatch(_0x8d3a('0x127')));if(_0x5945a6['checkRetriveMax'](0xb,_0x39b1b1,_0x2f7fe8)){if(_0x1be852[_0x8d3a('0xf7')]>=_0x2f7fe8[_0x8d3a('0x124')]){_0x5945a6['createStateFinal'](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1bd'));}else{_0x5945a6[_0x8d3a('0xfb')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1bd'));}}break;case'20':_0x2f7fe8[_0x8d3a('0x1be')]+=0x1;_0x1be852['state']=0x14;_0x1be852[_0x8d3a('0xac')]=_0x8d3a('0x1bf');_0x1be852[_0x8d3a('0xf9')]+=0x1;_0x1be852['countglobal']+=0x1;ami[_0x8d3a('0x4b')](_0x8d3a('0x1c0'),ut['buildObj'](_0x39b1b1,_0x8d3a('0x1c1')));_0x5945a6[_0x8d3a('0xce')](_0x1be852)[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x1c2')));if(_0x5945a6[_0x8d3a('0x19a')](0x14,_0x39b1b1,_0x2f7fe8)){if(_0x1be852[_0x8d3a('0xf9')]>=_0x2f7fe8[_0x8d3a('0x1a5')]){_0x5945a6[_0x8d3a('0xfe')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1c3'));}else{_0x5945a6[_0x8d3a('0xfb')](_0x1be852,_0x55fc32,_0x108d9a,_0x8d3a('0x1c3'));}}break;default:_0x2f7fe8['outboundUnknownCallsDay']+=0x1;_0x1be852[_0x8d3a('0xab')]=0xc;_0x1be852['statedesc']=_0x34d92e[_0x8d3a('0x1aa')];_0x5945a6[_0x8d3a('0xce')](_0x1be852)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5945a6[_0x8d3a('0x19a')](_0x34d92e['reason'],_0x39b1b1,_0x2f7fe8)){if(_0x1be852[_0x8d3a('0xf3')]+_0x1be852['countcongestionretry']+_0x1be852[_0x8d3a('0xf4')]+_0x1be852[_0x8d3a('0xf5')]+_0x1be852[_0x8d3a('0xf6')]+_0x1be852['countabandonedretry']+_0x1be852['countmachineretry']+_0x1be852['countagentrejectretry']>=_0x2f7fe8[_0x8d3a('0xfa')]){_0x5945a6[_0x8d3a('0xfb')](_0x1be852,_0x55fc32,_0x108d9a,_0x34d92e[_0x8d3a('0x1aa')]);}else{_0x5945a6[_0x8d3a('0xfe')](_0x1be852,_0x55fc32,_0x108d9a,_0x34d92e[_0x8d3a('0x1aa')]);}}}});};Dialer['prototype'][_0x8d3a('0xfb')]=function(_0x3dec7f,_0x1a7021,_0x3783f6,_0x1fafbb){var _0x2fdfc3=new Final(_0x3dec7f);_0x2fdfc3[_0x8d3a('0xab')]=0xf;_0x2fdfc3[_0x8d3a('0xac')]=_0x8d3a('0x1c4');this[_0x8d3a('0xfe')](_0x2fdfc3,_0x1a7021,_0x3783f6,_0x1fafbb);};Dialer['prototype'][_0x8d3a('0xfe')]=function(_0x459144,_0x24416f,_0x4f2869,_0x1303c7){this[_0x8d3a('0xcc')](_0x459144)['then'](function(){return _0x24416f(msgResponse(_0x8d3a('0x1a7'),'Success',_0x1303c7));})[_0x8d3a('0xbb')](function(){return _0x4f2869(msgResponse('[moveContactManagedDialer][0]',_0x8d3a('0x149'),_0x8d3a('0x1c5')));});};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x15f')]=function(_0xe9eae4){var _0x31c3b6=_0xe9eae4[_0x8d3a('0x1c6')]/0x64;var _0x39e54e=_0xe9eae4[_0x8d3a('0x65')]/(_0xe9eae4[_0x8d3a('0x65')]+_0xe9eae4[_0x8d3a('0x60')]);var _0x124613=Math[_0x8d3a('0x1c7')](_0xe9eae4[_0x8d3a('0x1c8')]*(_0xe9eae4[_0x8d3a('0x1c9')]/0x64));var _0x18c8ac=Math[_0x8d3a('0x1c7')](_0xe9eae4['predictiveIntervalAvailable']*(_0xe9eae4['predictiveIntervalMinThreshold']/0x64));var _0x3e1563=_0xe9eae4[_0x8d3a('0x50')]+_0xe9eae4[_0x8d3a('0x54')];var _0x5b664f=Math[_0x8d3a('0x1ca')](_0xe9eae4['erlangCalls']*_0xe9eae4[_0x8d3a('0x75')]*_0xe9eae4[_0x8d3a('0x6f')]*_0xe9eae4['predictiveIntervalMultiplicativeFactor']);if(_[_0x8d3a('0x86')](_0xe9eae4[_0x8d3a('0x27')])){if(!_[_0x8d3a('0x86')](_0xe9eae4[_0x8d3a('0x26')])){_0xe9eae4[_0x8d3a('0x26')]=undefined;loggerPredictive[_0x8d3a('0x98')](_0x8d3a('0x1cb'),_0x8d3a('0x1cc'));}if(!_[_0x8d3a('0x86')](_0xe9eae4[_0x8d3a('0x92')])){loggerPredictive[_0x8d3a('0x98')](_0x8d3a('0x1cb'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xe9eae4[_0x8d3a('0x92')]);_0xe9eae4[_0x8d3a('0x92')]=undefined;}_0xe9eae4[_0x8d3a('0x27')]=moment()[_0x8d3a('0x7c')](_0x8d3a('0x111'));loggerPredictive[_0x8d3a('0x7e')](_0xe9eae4['name'],_0x8d3a('0x1cd'),_0xe9eae4[_0x8d3a('0x27')]);this[_0x8d3a('0x15c')](_0xe9eae4,0x1);}else if(ifInterval(_0xe9eae4[_0x8d3a('0x1ce')],_0xe9eae4['startProgressive'])){this[_0x8d3a('0x15c')](_0xe9eae4,0x1);loggerPredictiveCalls[_0x8d3a('0x7e')](_0x8d3a('0x1cf'),_0xe9eae4[_0x8d3a('0x27')],_0xe9eae4[_0x8d3a('0x3e')]);_0xe9eae4['erlangCalls']=0x0;_0xe9eae4[_0x8d3a('0x6e')]=0x0;}else if(_0x31c3b6<_0x39e54e&&_0xe9eae4[_0x8d3a('0x1d0')]===_0x8d3a('0x1d1')){freeVariablesPredictive(_0xe9eae4);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x1d2'),'Dropped\x20calls\x20day',_0x39e54e,_0x8d3a('0x27'),_0xe9eae4[_0x8d3a('0x3e')]);}else if(_0x5b664f<_0xe9eae4['predictiveIntervalErlangCallsDroppedCalls']&&_0xe9eae4[_0x8d3a('0x1d0')]===_0x8d3a('0x1d1')){freeVariablesPredictive(_0xe9eae4);loggerPredictive['info'](_0x8d3a('0x1d3'),_0x8d3a('0x1d4'),_0x5b664f,_0x8d3a('0x1d5'),_0xe9eae4['predictiveIntervalErlangCallsDroppedCalls'],_0x8d3a('0x27'),_0xe9eae4[_0x8d3a('0x3e')]);}else if(!ifInterval(_0xe9eae4[_0x8d3a('0x1ce')],_0xe9eae4[_0x8d3a('0x27')])&&_[_0x8d3a('0x86')](_0xe9eae4[_0x8d3a('0x26')])&&!_[_0x8d3a('0x86')](_0xe9eae4['startProgressive'])){_0xe9eae4[_0x8d3a('0x26')]=moment()[_0x8d3a('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x8d3a('0x7e')](_0xe9eae4[_0x8d3a('0x3e')],_0x8d3a('0x1d6'),_0xe9eae4[_0x8d3a('0x26')]);this[_0x8d3a('0xbf')](_0xe9eae4[_0x8d3a('0x1ce')])[_0x8d3a('0xba')](this[_0x8d3a('0x1d7')](_0xe9eae4))[_0x8d3a('0xba')](mergeDataErlangB(_0xe9eae4))[_0x8d3a('0xba')](this[_0x8d3a('0x1d8')](_0xe9eae4))[_0x8d3a('0xbb')](loggerCatchPredictive(_0x8d3a('0x1d9'),_0xe9eae4));}else if(!ifInterval(_0xe9eae4[_0x8d3a('0x1ce')],_0xe9eae4['startPredictive'])){_0xe9eae4[_0x8d3a('0x6e')]=0x0;_0xe9eae4[_0x8d3a('0x26')]=moment()[_0x8d3a('0x7c')](_0x8d3a('0x111'));loggerPredictive[_0x8d3a('0x7e')](_0xe9eae4['name'],'recalculate\x20predictive\x20at',_0xe9eae4[_0x8d3a('0x26')]);clearInterval(_0xe9eae4[_0x8d3a('0x92')]);_0xe9eae4[_0x8d3a('0x92')]=undefined;this['averageHandleTime'](_0xe9eae4[_0x8d3a('0x1ce')])['then'](this['getDataPredictive'](_0xe9eae4))[_0x8d3a('0xba')](mergeDataErlangB(_0xe9eae4))['then'](this['startMethodPredictive'](_0xe9eae4))['catch'](loggerCatchPredictive(_0x8d3a('0x1da'),_0xe9eae4));}else if(_0xe9eae4[_0x8d3a('0x1c8')]&&_0x3e1563<_0xe9eae4[_0x8d3a('0x1c8')]-_0x18c8ac){freeVariablesPredictive(_0xe9eae4);loggerPredictive[_0x8d3a('0x7e')](_0xe9eae4[_0x8d3a('0x3e')],_0x8d3a('0x1db'),_0x3e1563,_0x8d3a('0x1dc'),_0xe9eae4[_0x8d3a('0x1c8')],'-',_0x18c8ac,'=',_0xe9eae4['predictiveIntervalAvailable']-_0x18c8ac,')');}else if(_0xe9eae4[_0x8d3a('0x1c8')]&&_0x3e1563>_0xe9eae4[_0x8d3a('0x1c8')]+_0x124613){freeVariablesPredictive(_0xe9eae4);loggerPredictive[_0x8d3a('0x7e')](_0xe9eae4['name'],_0x8d3a('0x1db'),_0x3e1563,')\x20are\x20more\x20than\x20threshold\x20(',_0xe9eae4[_0x8d3a('0x1c8')],'+',_0x124613,'=',_0xe9eae4[_0x8d3a('0x1c8')]+_0x124613,')');}};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x1d7')]=function(_0x3aeb30){var _0x457948=this;return function(_0x532ec6){return new BPromise(function(_0x46a2f0,_0x3f4909){_['merge'](_0x3aeb30,_0x532ec6[0x0]);if(checkGetDataPredictive(_0x532ec6[0x0])){var _0x263d05=_0x3aeb30[_0x8d3a('0x1c8')]=_0x3aeb30[_0x8d3a('0x54')]+_0x3aeb30['available'];var _0x52cd1f=_0x3aeb30[_0x8d3a('0x1ce')]*0x3c;var _0x4f5ab0=_0x532ec6[0x0][_0x8d3a('0x6b')]+_0x532ec6[0x0][_0x8d3a('0x6a')];var _0x821955=(_0x532ec6[0x0][_0x8d3a('0x69')]+_0x532ec6[0x0][_0x8d3a('0x6d')]+_0x532ec6[0x0][_0x8d3a('0x6c')])/_0x532ec6[0x0][_0x8d3a('0x81')];_0x3aeb30[_0x8d3a('0x6f')]=_0x821955>0x0?_0x821955:0x1;switch(_0x3aeb30[_0x8d3a('0x1d0')]){case _0x8d3a('0x1d1'):var _0x18c835=_0x3aeb30[_0x8d3a('0x1c6')]/0x64;return _0x457948[_0x8d3a('0x1dd')](_0x263d05,_0x52cd1f,_0x4f5ab0,_0x821955,_0x18c835)[_0x8d3a('0xba')](function(_0x55cc98){return _0x46a2f0(_0x55cc98);});case'agentBusyFactor':var _0x67fc6=_0x3aeb30[_0x8d3a('0x1c6')]/0x64;return _0x457948['busyFactor'](_0x263d05,_0x52cd1f,_0x4f5ab0,_0x821955,_0x67fc6)[_0x8d3a('0xba')](function(_0x46393a){return _0x46a2f0(_0x46393a);});default:return _0x3f4909(msgResponse(_0x8d3a('0x1de'),_0x8d3a('0x149'),_0x8d3a('0x1df')));}}else{return _0x3f4909(msgResponse(_0x8d3a('0x1de'),_0x8d3a('0x149'),_0x8d3a('0x1e0')));}});};};Dialer[_0x8d3a('0xaf')]['getDataPredictiveOld']=function(_0x2b322a){var _0x121d8d=this;return function(_0x38f25f){return new BPromise(function(_0x1bf95a,_0x370bd3){_[_0x8d3a('0xd4')](_0x2b322a,_0x38f25f[0x0]);if(checkGetDataPredictive(_0x38f25f[0x0])){loggerPredictive[_0x8d3a('0x7e')](JSON['stringify'](_0x38f25f[0x0]));if(_0x2b322a[_0x8d3a('0x1d0')]===_0x8d3a('0x1d1')){return _0x121d8d[_0x8d3a('0xca')](_0x2b322a['id'])[_0x8d3a('0xba')](function(_0x4312d4){var _0x354ee7=_0x2b322a[_0x8d3a('0x51')]-_0x4312d4[0x0][_0x8d3a('0x1e1')];var _0x244e3d=_0x2b322a[_0x8d3a('0x1ce')]*0x3c;var _0x5d69cf=_0x38f25f[0x0]['predictiveIntervalAvgTalktime']+_0x38f25f[0x0][_0x8d3a('0x6a')];var _0x3a56bf=(_0x38f25f[0x0][_0x8d3a('0x69')]+_0x38f25f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x38f25f[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x38f25f[0x0][_0x8d3a('0x81')];var _0x4d2ebd=_0x2b322a[_0x8d3a('0x1c6')]/0x64;_0x2b322a[_0x8d3a('0x71')]=_0x4312d4[0x0][_0x8d3a('0x1e1')]||0x0;_0x2b322a[_0x8d3a('0x6f')]=_0x3a56bf>0x0?_0x3a56bf:0x1;return _0x121d8d['abandonmentRate'](_0x354ee7,_0x244e3d,_0x5d69cf,_0x3a56bf,_0x4d2ebd);})[_0x8d3a('0xba')](function(_0x12e865){return _0x1bf95a(_0x12e865);})[_0x8d3a('0xbb')](function(_0x21f938){return _0x370bd3(msgResponse(_0x8d3a('0x1e2'),_0x8d3a('0x149'),JSON[_0x8d3a('0x47')](_0x21f938)));});}if(_0x2b322a[_0x8d3a('0x1d0')]===_0x8d3a('0x1e3')){return _0x121d8d[_0x8d3a('0xca')](_0x2b322a['id'])[_0x8d3a('0xba')](function(_0xe78c76){var _0x34b05e=_0x2b322a[_0x8d3a('0x51')]-_0xe78c76[0x0]['outboundQueuePauses'];var _0x57bd61=_0x2b322a[_0x8d3a('0x1ce')]*0x3c;var _0x5d603f=_0x38f25f[0x0][_0x8d3a('0x6b')]+_0x38f25f[0x0][_0x8d3a('0x6a')];var _0x58da07=(_0x38f25f[0x0][_0x8d3a('0x69')]+_0x38f25f[0x0][_0x8d3a('0x6d')]+_0x38f25f[0x0][_0x8d3a('0x6c')])/_0x38f25f[0x0][_0x8d3a('0x81')];var _0x3cfca2=_0x2b322a[_0x8d3a('0x1c6')]/0x64;_0x2b322a[_0x8d3a('0x71')]=_0xe78c76[0x0]['outboundQueuePauses']||0x0;_0x2b322a[_0x8d3a('0x6f')]=_0x58da07>0x0?_0x58da07:0x1;return _0x121d8d[_0x8d3a('0x1e4')](_0x34b05e,_0x57bd61,_0x5d603f,_0x58da07,_0x3cfca2);})['then'](function(_0x244f6e){return _0x1bf95a(_0x244f6e);})['catch'](function(_0x177ad0){return _0x370bd3(msgResponse(_0x8d3a('0x1e2'),'Failure',JSON[_0x8d3a('0x47')](_0x177ad0)));});}}else{return _0x370bd3(msgResponse(_0x8d3a('0x1de'),_0x8d3a('0x149'),_0x8d3a('0x1e0')));}});};};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x1d8')]=function(_0x6f69a2){var _0x233ffd=this;return function(){var _0x205007=0x0;var _0x940fb5=Math[_0x8d3a('0x1ca')](_0x6f69a2[_0x8d3a('0x74')]*0x3e8);if(_0x940fb5>0x0){_0x940fb5=_0x940fb5<0x64?0x64:_0x940fb5;loggerPredictive['info'](_0x6f69a2[_0x8d3a('0x3e')],'one\x20call\x20every:',_0x940fb5,_0x8d3a('0x48'));_0x6f69a2['handlePredictive']=setInterval(function(){_0x233ffd['handlePredictive'](_0x6f69a2);loggerPredictiveCalls[_0x8d3a('0x7e')](_0x8d3a('0x1e5'),_0x205007+=0x1);},_0x940fb5);}else{loggerPredictive[_0x8d3a('0x7e')](_0x6f69a2[_0x8d3a('0x3e')],_0x8d3a('0x1e6'));}};};Dialer[_0x8d3a('0xaf')]['checkContactBlack']=function(_0x1ebbe4,_0x65995d){var _0x3d9868=this;return function(_0x3aa160){if(_['isEmpty'](_0x3aa160)){if(_['isNil'](_0x65995d[_0x8d3a('0x1e7')])||!_0x65995d[_0x8d3a('0x1e8')]){if(_0x1ebbe4[_0x8d3a('0x5a')]===_0x8d3a('0x7')){_0x1ebbe4['queueStatusComplete']=_['isUndefined'](_0x1ebbe4[_0x8d3a('0x12f')])?!![]:_0x1ebbe4['queueStatusComplete'];var _0x2be110=uuid['v4']();_0x3d9868['actions'][_0x2be110]=new Action(_0x1ebbe4,_0x65995d,_0x2be110);loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x1e9'),_0x2be110,_0x8d3a('0x1ea'),JSON[_0x8d3a('0x47')](_0x1ebbe4[_0x8d3a('0x12f')]),_0x8d3a('0x1eb'),_0x1ebbe4[_0x8d3a('0x3e')]);if(_0x1ebbe4['queueStatusComplete']){_0x1ebbe4['queueStatusComplete']=![];_0x3d9868['queueBooked'][_0x3d9868[_0x8d3a('0x22')][_0x2be110][_0x8d3a('0xb7')]]=[];ami[_0x8d3a('0xb3')]({'actionid':_0x2be110,'action':_0x8d3a('0x1ec'),'queue':_0x1ebbe4[_0x8d3a('0x3e')]})['catch'](function(){_0x3d9868['updateOriginated'](_0x1ebbe4);_0x3d9868['rescheduleContact']({'active':![],'ContactId':_0x3d9868[_0x8d3a('0x22')][_0x2be110][_0x8d3a('0xd6')],'ListId':_0x3d9868[_0x8d3a('0x22')][_0x2be110]['ListId'],'VoiceQueueId':_0x3d9868['actions'][_0x2be110][_0x8d3a('0xd8')]||undefined,'CampaignId':_0x3d9868['actions'][_0x2be110]['CampaignId']||undefined})['catch'](loggerCatch(_0x8d3a('0x1ed')));delete _0x3d9868[_0x8d3a('0x22')][_0x2be110];});}else{loggerBooked[_0x8d3a('0x7e')](_0x8d3a('0x1ee'),JSON[_0x8d3a('0x47')](_0x1ebbe4[_0x8d3a('0x12f')]),_0x8d3a('0x1eb'),_0x1ebbe4[_0x8d3a('0x3e')]);_0x3d9868['updateOriginated'](_0x1ebbe4);_0x3d9868[_0x8d3a('0xc2')]({'active':![],'ContactId':_0x3d9868[_0x8d3a('0x22')][_0x2be110]['ContactId'],'ListId':_0x3d9868[_0x8d3a('0x22')][_0x2be110][_0x8d3a('0xd7')],'VoiceQueueId':_0x3d9868[_0x8d3a('0x22')][_0x2be110][_0x8d3a('0xd8')]||undefined,'CampaignId':_0x3d9868[_0x8d3a('0x22')][_0x2be110][_0x8d3a('0xd9')]||undefined})['catch'](loggerCatch(_0x8d3a('0x1ed')));delete _0x3d9868['actions'][_0x2be110];}}else{return _0x3d9868[_0x8d3a('0x1ef')](_0x1ebbe4,_0x65995d);}}else{if(getDiff(_0x65995d['scheduledat'])<_0x1ebbe4[_0x8d3a('0x1f0')]*0x3c){if(_0x65995d[_0x8d3a('0x1f1')]&&!_0x65995d[_0x8d3a('0x1f1')]['voicePause']){_0x3d9868[_0x8d3a('0x94')][_0x8d3a('0x132')](_0x65995d['id'])[_0x8d3a('0x134')](function(){_0x3d9868[_0x8d3a('0xb6')](_0x1ebbe4);});}else{_0x3d9868[_0x8d3a('0xc4')]({'active':![]},_0x65995d['id'],0x1)[_0x8d3a('0x134')](function(){_0x3d9868[_0x8d3a('0xb6')](_0x1ebbe4);});}}else{_0x1ebbe4[_0x8d3a('0x68')]+=0x1;_0x3d9868[_0x8d3a('0xb6')](_0x1ebbe4);if(_0x1ebbe4['dialRecallInQueue']){_0x3d9868[_0x8d3a('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x65995d[_0x8d3a('0xd6')],'ListId':_0x65995d['ListId'],'VoiceQueueId':_0x65995d[_0x8d3a('0xd8')]||undefined,'CampaignId':_0x65995d[_0x8d3a('0xd9')]||undefined})[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0x1f2')));_0x3d9868[_0x8d3a('0xce')](createObjHistory(_0x1ebbe4,_0x65995d,_0x8d3a('0x1f3'),0x17,_0x8d3a('0x1f4')))[_0x8d3a('0xbb')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3d9868[_0x8d3a('0xe0')](createObjHistory(_0x1ebbe4,_0x65995d,_0x8d3a('0x1f5'),0x16,_0x8d3a('0x1f6')),_0x8d3a('0x1f7'),'[Originate][HistoryRecallClose]');}}}}else{_0x1ebbe4[_0x8d3a('0x61')]+=0x1;_0x3d9868[_0x8d3a('0xe0')](createObjHistory(_0x1ebbe4,_0x65995d,_0x8d3a('0x1f8'),0xd,'Blacklist'),_0x8d3a('0x1f9'),_0x8d3a('0x1fa'));throw _0x8d3a('0x1fb');}};};Dialer[_0x8d3a('0xaf')]['handleIvr']=function(_0xe9213e){var _0x309465=this;var _0x5d345b=_0xe9213e['limitCalls']-_0xe9213e['originated']-_0xe9213e[_0x8d3a('0xc7')];emitCampaignSummary(_0xe9213e);if(_0x5d345b>0x0){if(_0x5d345b>this['maxNumberOriginate']){_0x5d345b=this[_0x8d3a('0x21')];}_0xe9213e[_0x8d3a('0xc7')]+=_0x5d345b;this[_0x8d3a('0xc9')](_0xe9213e['id'],_0x5d345b,_0xe9213e[_0x8d3a('0x1fc')],_0xe9213e)['then'](function(_0x2d72d3){_0xe9213e[_0x8d3a('0xc7')]-=_0x5d345b;_0xe9213e[_0x8d3a('0xc7')]=_0xe9213e[_0x8d3a('0xc7')]>0x0?_0xe9213e[_0x8d3a('0xc7')]:0x0;if(!checkContactEmpty(_0x2d72d3)){_0xe9213e[_0x8d3a('0x3d')]=_0x8d3a('0xa3');logger[_0x8d3a('0x7e')](_0x8d3a('0x1fd')+_0xe9213e[_0x8d3a('0x3e')]);}else{_0xe9213e[_0x8d3a('0x72')]+=_0x2d72d3[_0x8d3a('0x9b')];_0xe9213e[_0x8d3a('0x3d')]=_0x8d3a('0x1fe');for(var _0x51ca08=0x0;_0x51ca08<_0x2d72d3[_0x8d3a('0x9b')];_0x51ca08+=0x1){_0xe9213e[_0x8d3a('0x1ff')]+=0x1;if(_[_0x8d3a('0xb2')](_0x2d72d3[_0x51ca08])||_[_0x8d3a('0xb2')](_0x2d72d3[_0x51ca08][_0x8d3a('0x16e')])||_[_0x8d3a('0xb2')](_0x2d72d3[_0x51ca08][_0x8d3a('0x16e')][_0x8d3a('0x16f')])){_0x309465[_0x8d3a('0xd3')](_0x8d3a('0x200'),_0xe9213e,_0x2d72d3[_0x51ca08]);}else{_0x309465[_0x8d3a('0xbe')](_['pick'](_0x2d72d3[_0x51ca08],[_0x8d3a('0xd9'),_0x8d3a('0x201')]))[_0x8d3a('0xba')](_0x309465[_0x8d3a('0x202')](_0xe9213e,_0x2d72d3[_0x51ca08]))[_0x8d3a('0xbb')](_0x309465[_0x8d3a('0xd2')](_0x8d3a('0x203'),_0xe9213e));}}}})[_0x8d3a('0xbb')](loggerGetContactDialer(_0x8d3a('0x204'),_0xe9213e,_0x5d345b));}};Dialer[_0x8d3a('0xaf')][_0x8d3a('0x15c')]=function(_0x2f1680,_0x43c104){var _0x5574a5=this;var _0x5be739=[];var _0x1a3217=_0x43c104>=0x1?_0x43c104:0x1;if(_0x2f1680['dialMethod']==='booked'){_0x1a3217=0x1;}var _0x4f6444=Math[_0x8d3a('0x1ca')](_0x2f1680[_0x8d3a('0x50')]*_0x1a3217)-_0x2f1680[_0x8d3a('0x72')]-_0x2f1680[_0x8d3a('0xc7')];emitVoiceQueueSummary(_0x2f1680);if(_0x2f1680['dialLimitQueue']>0x0){var _0x32d6ed=_0x2f1680[_0x8d3a('0x205')]-_0x2f1680[_0x8d3a('0x72')]-_0x2f1680[_0x8d3a('0x54')]-_0x2f1680[_0x8d3a('0xc7')]-_0x2f1680['pTalking'];if(_0x4f6444>_0x32d6ed){_0x4f6444=_0x32d6ed;}}if(_0x4f6444>0x0){if(_0x2f1680[_0x8d3a('0x5a')]===_0x8d3a('0x7')){_0x4f6444=0x1;}if(_0x4f6444>this[_0x8d3a('0x21')]){_0x4f6444=this['maxNumberOriginate'];}_0x2f1680[_0x8d3a('0xc7')]+=_0x4f6444;for(var _0x1215e5 in this[_0x8d3a('0x1f')]){if(typeof this[_0x8d3a('0x1f')][_0x1215e5]!=='undefined'){if(this['agents'][_0x1215e5][_0x8d3a('0xab')]===_0x8d3a('0x206')&&this[_0x8d3a('0x1f')][_0x1215e5][_0x8d3a('0xde')]===_0x8d3a('0xdf')){_0x5be739[_0x8d3a('0x12d')](this[_0x8d3a('0x1f')][_0x1215e5]['id']);}}}this[_0x8d3a('0xc6')](_0x2f1680['id'],_0x5be739,_0x4f6444,_0x2f1680[_0x8d3a('0x1fc')],_0x2f1680)[_0x8d3a('0xba')](function(_0xd49226){_0x2f1680[_0x8d3a('0xc7')]-=_0x4f6444;_0x2f1680['temp']=_0x2f1680['temp']>0x0?_0x2f1680['temp']:0x0;if(!checkContactEmpty(_0xd49226)){_0x5574a5[_0x8d3a('0x207')](_0x2f1680)[_0x8d3a('0xba')](sendMessageReschedule(_0x2f1680))[_0x8d3a('0xbb')](loggerCatch('[countReScheduled]\x20'));}else{_0x2f1680[_0x8d3a('0x72')]+=_0xd49226[_0x8d3a('0x9b')];_0x2f1680[_0x8d3a('0x3d')]=_0x2f1680[_0x8d3a('0x5a')]===_0x8d3a('0x7')?_0x8d3a('0x176'):'RUNNING';for(var _0x50508c=0x0;_0x50508c<_0xd49226[_0x8d3a('0x9b')];_0x50508c+=0x1){if(_[_0x8d3a('0xb2')](_0xd49226[_0x50508c])||_[_0x8d3a('0xb2')](_0xd49226[_0x50508c][_0x8d3a('0x16e')])||_[_0x8d3a('0xb2')](_0xd49226[_0x50508c][_0x8d3a('0x16e')][_0x8d3a('0x16f')])){_0x5574a5[_0x8d3a('0xd3')](_0x8d3a('0x200'),_0x2f1680,_0xd49226[_0x50508c]);}else{_0x5574a5['checkIsBlackList'](_[_0x8d3a('0xd5')](_0xd49226[_0x50508c],[_0x8d3a('0xd8'),_0x8d3a('0x201')]))[_0x8d3a('0xba')](_0x5574a5[_0x8d3a('0x202')](_0x2f1680,_0xd49226[_0x50508c]))[_0x8d3a('0xbb')](_0x5574a5[_0x8d3a('0xd2')](_0x8d3a('0x200'),_0x2f1680));}}}})[_0x8d3a('0xbb')](loggerGetContactDialer(_0x8d3a('0x208'),_0x2f1680,_0x4f6444));}};Dialer['prototype'][_0x8d3a('0x92')]=function(_0x398d2e){if(_0x398d2e['dialLimitQueue']>0x0){var _0x4de223=_0x398d2e[_0x8d3a('0x205')]-_0x398d2e[_0x8d3a('0x72')]-_0x398d2e[_0x8d3a('0x54')];if(_0x4de223>0x0){this[_0x8d3a('0x209')](_0x398d2e);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x8d3a('0x209')](_0x398d2e);}};Dialer[_0x8d3a('0xaf')]['tryOriginatePredictive']=function(_0xc4052){var _0x43c289=this;var _0x57ae3d=[];_0xc4052['originated']+=0x1;for(var _0x1b9015 in this[_0x8d3a('0x1f')]){if(typeof this['agents'][_0x1b9015]!=='undefined'){if(this[_0x8d3a('0x1f')][_0x1b9015][_0x8d3a('0xab')]===_0x8d3a('0x206')&&this[_0x8d3a('0x1f')][_0x1b9015]['status']===_0x8d3a('0xdf')){_0x57ae3d[_0x8d3a('0x12d')](this['agents'][_0x1b9015]['id']);}}}this[_0x8d3a('0xc6')](_0xc4052['id'],_0x57ae3d,0x1,_0xc4052['dialOrderByScheduledAt'],_0xc4052)[_0x8d3a('0xba')](function(_0x4c594b){if(!checkContactEmpty(_0x4c594b)){checkContactLowerLimitOriginate(_0xc4052,0x1,0x0);_0x43c289['countReScheduled'](_0xc4052)[_0x8d3a('0xba')](sendMessageReschedule(_0xc4052))[_0x8d3a('0xbb')](loggerCatch(_0x8d3a('0xbc')));}else{_0xc4052['message']='RUNNING';if(_[_0x8d3a('0xb2')](_0x4c594b[0x0])||_[_0x8d3a('0xb2')](_0x4c594b[0x0]['Contact'])||_[_0x8d3a('0xb2')](_0x4c594b[0x0]['Contact'][_0x8d3a('0x16f')])){_0x43c289['emptyContact'](_0x8d3a('0x200'),_0xc4052,_0x4c594b[0x0]);}else{_0x43c289[_0x8d3a('0xbd')](_['pick'](_0x4c594b[0x0],[_0x8d3a('0xd8'),_0x8d3a('0x201')]))[_0x8d3a('0xba')](_0x43c289[_0x8d3a('0x202')](_0xc4052,_0x4c594b[0x0]))[_0x8d3a('0xbb')](_0x43c289[_0x8d3a('0xd2')](_0x8d3a('0x20a'),_0xc4052));}}})[_0x8d3a('0xbb')](loggerGetContactDialer(_0x8d3a('0x20b'),_0xc4052,0x1));emitVoiceQueueSummary(_0xc4052);};Dialer[_0x8d3a('0xaf')]['abandonmentRate']=function(_0x5dfdc3,_0x4a3534,_0x430c81,_0x4612bb,_0x24b033,_0x1abb8a){loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20c'));loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20d'),_0x5dfdc3);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20e'),_0x4a3534);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20f'),_0x430c81);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x210'),_0x4612bb);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x211'),_0x24b033);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8f'));return new BPromise(function(_0x1ff953,_0x3f4e3c){if(_0x5dfdc3<=0x0||isNaN(_0x5dfdc3)){return _0x3f4e3c(msgResponse(_0x8d3a('0x212'),'Error','m\x20=\x20'+_0x5dfdc3));}if(_0x430c81<=0x0||isNaN(_0x430c81)){return _0x3f4e3c(msgResponse(_0x8d3a('0x212'),'Error',_0x8d3a('0x213')+_0x430c81));}if(_0x4612bb<=0x0||isNaN(_0x4612bb)){return _0x3f4e3c(msgResponse(_0x8d3a('0x212'),'Error','p\x20=\x20'+_0x4612bb));}if(_0x4a3534<=0x0||isNaN(_0x4a3534)){return _0x3f4e3c(msgResponse(_0x8d3a('0x212'),_0x8d3a('0x46'),'interval\x20=\x20'+_0x4a3534));}if(_0x24b033<=0x0||isNaN(_0x24b033)){return _0x3f4e3c(msgResponse(_0x8d3a('0x212'),_0x8d3a('0x46'),'Amax\x20=\x20'+_0x24b033));}_0x1abb8a=_0x1abb8a||0x0;var _0x21d0cf=0x1/_0x430c81;var _0x218ca9=0x0;var _0xc6dbb4=0x0;var _0x11969f=0x0;var _0x6a27da=0x0;for(var _0x256ce3=0x0;_0x11969f<_0x24b033;_0x256ce3+=0x1){_0xc6dbb4=_0x256ce3/_0x4a3534;_0x218ca9=(_0x4612bb*_0xc6dbb4+_0x1abb8a)/_0x21d0cf;_0x11969f=erlangb(_0x218ca9,_0x5dfdc3);_0x6a27da=_0x218ca9/_0x5dfdc3*(0x1-erlangb(_0x218ca9,_0x5dfdc3));}return _0x1ff953({'erlangCalls':_0x256ce3,'erlangCallToSecond':_0x4a3534/_0x256ce3,'erlangAbandonmentRate':_0x11969f,'erlangBusyFactor':_0x6a27da});});};Dialer[_0x8d3a('0xaf')]['busyFactor']=function(_0x322014,_0xbf0cd,_0x5854ef,_0x30f6d4,_0x141a4e,_0xb0f2c9){loggerPredictive['info'](_0x8d3a('0x214'));loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20d'),_0x322014);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20e'),_0xbf0cd);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x20f'),_0x5854ef);loggerPredictive['info'](_0x8d3a('0x210'),_0x30f6d4);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x215'),_0x141a4e);loggerPredictive[_0x8d3a('0x7e')](_0x8d3a('0x8f'));return new BPromise(function(_0x27ca16,_0xc67c15){if(_0x322014<=0x0||isNaN(_0x322014)){return _0xc67c15(msgResponse('[busyFactor]',_0x8d3a('0x46'),_0x8d3a('0x216')+_0x322014));}if(_0x5854ef<=0x0||isNaN(_0x5854ef)){return _0xc67c15(msgResponse(_0x8d3a('0x217'),_0x8d3a('0x46'),_0x8d3a('0x213')+_0x5854ef));}if(_0x30f6d4<=0x0||isNaN(_0x30f6d4)){return _0xc67c15(msgResponse(_0x8d3a('0x217'),_0x8d3a('0x46'),'p\x20=\x20'+_0x30f6d4));}if(_0xbf0cd<=0x0||isNaN(_0xbf0cd)){return _0xc67c15(msgResponse(_0x8d3a('0x217'),_0x8d3a('0x46'),_0x8d3a('0x218')+_0xbf0cd));}if(_0x141a4e<=0x0||isNaN(_0x141a4e)){return _0xc67c15(msgResponse('[busyFactor]',_0x8d3a('0x46'),_0x8d3a('0x219')+_0x141a4e));}_0xb0f2c9=_0xb0f2c9||0x0;var _0x5ef265=0x1/_0x5854ef;var _0x56fcb4=0x0;var _0x3fff39=0x0;var _0x546b03=0x0;var _0x45398f=0x0;for(var _0x55cbde=0x0;_0x45398f<_0x141a4e;_0x55cbde+=0x1){_0x3fff39=_0x55cbde/_0xbf0cd;_0x56fcb4=(_0x30f6d4*_0x3fff39+_0xb0f2c9)/_0x5ef265;_0x546b03=erlangb(_0x56fcb4,_0x322014);_0x45398f=_0x56fcb4/_0x322014*(0x1-erlangb(_0x56fcb4,_0x322014));}return _0x27ca16({'erlangCalls':_0x55cbde,'erlangCallToSecond':_0xbf0cd/_0x55cbde,'erlangAbandonmentRate':_0x546b03,'erlangBusyFactor':_0x45398f});});};module[_0x8d3a('0x21a')]=Dialer;
\ No newline at end of file
index fc53db4..ff2f05a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc125=['countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x1129d2,_0x3123ec){var _0x1b063f=function(_0x1c0025){while(--_0x1c0025){_0x1129d2['push'](_0x1129d2['shift']());}};_0x1b063f(++_0x3123ec);}(_0xc125,0x93));var _0x5c12=function(_0x34570c,_0x5ab8da){_0x34570c=_0x34570c-0x0;var _0x14bfa4=_0xc125[_0x34570c];return _0x14bfa4;};'use strict';var util=require(_0x5c12('0x0'));var _=require(_0x5c12('0x1'));var moment=require('moment');function getSeconds(_0xa6e807,_0x69252c){var _0x25413f=moment(_0xa6e807)[_0x5c12('0x2')](0x0);var _0x33b155=moment(_0x69252c)[_0x5c12('0x2')](0x0);return _0x25413f[_0x5c12('0x3')](_0x33b155,_0x5c12('0x4'));}function QueueCallerAbandon(_0x1f159b,_0x3deab2){this[_0x5c12('0x5')]=_0x1f159b[_0x5c12('0x5')];this[_0x5c12('0x6')]=_0x1f159b['type'];this[_0x5c12('0x7')]=_0x1f159b[_0x5c12('0x6')]===_0x5c12('0x8')?'queue':_0x1f159b['type'];this[_0x5c12('0x9')]=_0x1f159b[_0x5c12('0x9')];this['countcongestionretry']=_0x1f159b[_0x5c12('0xa')];this[_0x5c12('0xb')]=_0x1f159b[_0x5c12('0xb')];this[_0x5c12('0xc')]=_0x1f159b[_0x5c12('0x9')]+_0x1f159b['countcongestionretry']+_0x1f159b[_0x5c12('0xb')]+_0x1f159b['countnosuchnumberretry']+_0x1f159b['countdropretry']+_0x1f159b['countabandonedretry']+_0x1f159b[_0x5c12('0xd')]+_0x1f159b[_0x5c12('0xe')];this['countnosuchnumberretry']=_0x1f159b[_0x5c12('0xf')];this['countdropretry']=_0x1f159b['countdropretry'];this['countabandonedretry']=_0x1f159b['countabandonedretry'];this[_0x5c12('0xd')]=_0x1f159b['countmachineretry'];this[_0x5c12('0xe')]=_0x1f159b['countagentrejectretry'];this[_0x5c12('0x10')]=_0x3deab2[_0x5c12('0x10')];this[_0x5c12('0x11')]=_0x1f159b['name'];this[_0x5c12('0x12')]=_0x1f159b['number'];this[_0x5c12('0x13')]=_0x1f159b[_0x5c12('0x13')];this[_0x5c12('0x14')]=_0x1f159b[_0x5c12('0x14')];this['droptime']=_0x1f159b[_0x5c12('0x15')];this[_0x5c12('0x16')]=this[_0x5c12('0x15')];this[_0x5c12('0x17')]=getSeconds(_0x1f159b[_0x5c12('0x14')],_0x1f159b[_0x5c12('0x13')]);this['holdtime']=getSeconds(this[_0x5c12('0x15')],_0x1f159b['responsetime']);this[_0x5c12('0x18')]=0x0;this[_0x5c12('0x19')]=_0x3deab2[_0x5c12('0x19')];this[_0x5c12('0x1a')]=_0x3deab2[_0x5c12('0x1b')];this[_0x5c12('0x1c')]=_0x3deab2[_0x5c12('0x1c')];this[_0x5c12('0x1d')]=_0x1f159b[_0x5c12('0x1d')];this['callbackuniqueid']=_0x1f159b['callbackuniqueid'];this[_0x5c12('0x1e')]=_0x1f159b['callbackat'];this[_0x5c12('0x1f')]=_0x1f159b['recallme'];this[_0x5c12('0x20')]=_0x1f159b[_0x5c12('0x20')];this[_0x5c12('0x21')]=_0x1f159b['ListId'];this[_0x5c12('0x22')]=_0x1f159b[_0x5c12('0x22')];this[_0x5c12('0x23')]=_0x1f159b[_0x5c12('0x23')];this[_0x5c12('0x24')]=_0x1f159b[_0x5c12('0x24')];this[_0x5c12('0x25')]=_0x1f159b['originatecalleridnum']||'';this['originatecalleridname']=_0x1f159b[_0x5c12('0x26')]||'';}module[_0x5c12('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xa683=['connectedlinename','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','talktime','membername'];(function(_0x238469,_0x18495d){var _0x16cb9a=function(_0x29db1d){while(--_0x29db1d){_0x238469['push'](_0x238469['shift']());}};_0x16cb9a(++_0x18495d);}(_0xa683,0xda));var _0x3a68=function(_0x5a6f5f,_0x5baa1a){_0x5a6f5f=_0x5a6f5f-0x0;var _0x680a94=_0xa683[_0x5a6f5f];return _0x680a94;};'use strict';var util=require(_0x3a68('0x0'));var _=require('lodash');var moment=require(_0x3a68('0x1'));function getSeconds(_0x5ee4d1,_0x489137){var _0x221925=moment(_0x5ee4d1)[_0x3a68('0x2')](0x0);var _0xd5c71d=moment(_0x489137)['milliseconds'](0x0);return _0x221925['diff'](_0xd5c71d,'seconds');}function QueueCallerAbandon(_0x189fe9,_0x292546){this[_0x3a68('0x3')]=_0x189fe9['scheduledat'];this[_0x3a68('0x4')]=_0x189fe9[_0x3a68('0x4')];this[_0x3a68('0x5')]=_0x189fe9[_0x3a68('0x4')]===_0x3a68('0x6')?_0x3a68('0x7'):_0x189fe9[_0x3a68('0x4')];this[_0x3a68('0x8')]=_0x189fe9[_0x3a68('0x8')];this[_0x3a68('0x9')]=_0x189fe9[_0x3a68('0x9')];this[_0x3a68('0xa')]=_0x189fe9['countnoanswerretry'];this[_0x3a68('0xb')]=_0x189fe9[_0x3a68('0x8')]+_0x189fe9['countcongestionretry']+_0x189fe9[_0x3a68('0xa')]+_0x189fe9[_0x3a68('0xc')]+_0x189fe9[_0x3a68('0xd')]+_0x189fe9[_0x3a68('0xe')]+_0x189fe9[_0x3a68('0xf')]+_0x189fe9[_0x3a68('0x10')];this[_0x3a68('0xc')]=_0x189fe9['countnosuchnumberretry'];this[_0x3a68('0xd')]=_0x189fe9['countdropretry'];this[_0x3a68('0xe')]=_0x189fe9[_0x3a68('0xe')];this['countmachineretry']=_0x189fe9[_0x3a68('0xf')];this[_0x3a68('0x10')]=_0x189fe9['countagentrejectretry'];this[_0x3a68('0x11')]=_0x292546[_0x3a68('0x11')];this[_0x3a68('0x12')]=_0x189fe9[_0x3a68('0x13')];this[_0x3a68('0x14')]=_0x189fe9['number'];this[_0x3a68('0x15')]=_0x189fe9[_0x3a68('0x15')];this[_0x3a68('0x16')]=_0x189fe9[_0x3a68('0x16')];this[_0x3a68('0x17')]=_0x189fe9[_0x3a68('0x17')];this[_0x3a68('0x18')]=this[_0x3a68('0x17')];this[_0x3a68('0x19')]=getSeconds(_0x189fe9[_0x3a68('0x16')],_0x189fe9[_0x3a68('0x15')]);this['holdtime']=getSeconds(this[_0x3a68('0x17')],_0x189fe9[_0x3a68('0x16')]);this[_0x3a68('0x1a')]=0x0;this['queue']=_0x292546['queue'];this[_0x3a68('0x1b')]=_0x292546[_0x3a68('0x1c')];this[_0x3a68('0x1d')]=_0x292546[_0x3a68('0x1d')];this['callback']=_0x189fe9[_0x3a68('0x1e')];this[_0x3a68('0x1f')]=_0x189fe9[_0x3a68('0x1f')];this[_0x3a68('0x20')]=_0x189fe9[_0x3a68('0x20')];this['recallme']=_0x189fe9['recallme'];this['ContactId']=_0x189fe9[_0x3a68('0x21')];this[_0x3a68('0x22')]=_0x189fe9[_0x3a68('0x22')];this[_0x3a68('0x23')]=_0x189fe9[_0x3a68('0x23')];this[_0x3a68('0x24')]=_0x189fe9[_0x3a68('0x24')];this[_0x3a68('0x25')]=_0x189fe9[_0x3a68('0x25')];this[_0x3a68('0x26')]=_0x189fe9['originatecalleridnum']||'';this[_0x3a68('0x27')]=_0x189fe9[_0x3a68('0x27')]||'';}module[_0x3a68('0x28')]=QueueCallerAbandon;
\ No newline at end of file
index 8ab4cee..b8ada2e 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(_0x31abd6,_0x5e0b94){var _0x3fdaee=function(_0x209bab){while(--_0x209bab){_0x31abd6['push'](_0x31abd6['shift']());}};_0x3fdaee(++_0x5e0b94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0x47acd0,_0x37dc02){var _0x25efd5=function(_0x5126e1){while(--_0x5126e1){_0x47acd0['push'](_0x47acd0['shift']());}};_0x25efd5(++_0x37dc02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 acfb1bb..d75d35a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9818=['notify','parse','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','Trunk','isValid','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','from-voip-provider','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','syncVarSet','variable','value','channelstate','channelstatedesc','hasOwnProperty','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','.pdf','application/pdf','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9818,0x1ae));var _0x8981=function(_0x21715c,_0x2d252a){_0x21715c=_0x21715c-0x0;var _0x1d5f8a=_0x9818[_0x21715c];return _0x1d5f8a;};'use strict';var util=require(_0x8981('0x0'));var _=require(_0x8981('0x1'));var BPromise=require(_0x8981('0x2'));var uuid=require(_0x8981('0x3'));var moment=require(_0x8981('0x4'));var path=require(_0x8981('0x5'));var tiff2pdf=require(_0x8981('0x6'));var gs=require(_0x8981('0x7'));var logger=require(_0x8981('0x8'))(_0x8981('0x9'));var ami=require(_0x8981('0xa'));var rpcDb=require(_0x8981('0xb'));var Channel=require(_0x8981('0xc'));var ut=require(_0x8981('0xd'));var Action=require(_0x8981('0xe'));var faxAccount=require(_0x8981('0xf'));var attachment=require(_0x8981('0x10'));var faxMessage=require(_0x8981('0x11'));function Fax(_0x11bcd0){this[_0x8981('0x12')]={};this[_0x8981('0x13')]=_0x11bcd0['faxAccounts'];this[_0x8981('0x14')]=_0x11bcd0['trunks'];this[_0x8981('0x15')]={};ami['on'](_0x8981('0x16'),this[_0x8981('0x17')][_0x8981('0x18')](this));ami['on'](_0x8981('0x19'),this['syncVarSet']['bind'](this));ami['on'](_0x8981('0x1a'),this[_0x8981('0x1b')][_0x8981('0x18')](this));ami['on'](_0x8981('0x1c'),this[_0x8981('0x1d')][_0x8981('0x18')](this));ami['on'](_0x8981('0x1e'),this[_0x8981('0x1f')][_0x8981('0x18')](this));ami['on'](_0x8981('0x20'),this['syncReceiveFax'][_0x8981('0x18')](this));ami['on']('hangup',this[_0x8981('0x21')]['bind'](this));ami['on'](_0x8981('0x22'),this['syncOriginateResponse'][_0x8981('0x18')](this));}Fax['prototype'][_0x8981('0x17')]=function(_0x348f20){if(_0x348f20['context']===_0x8981('0x23')){for(var _0x1b1e0d in this[_0x8981('0x13')]){if(this['faxAccounts']['hasOwnProperty'](_0x1b1e0d)){if(_0x348f20[_0x8981('0x24')]===this['faxAccounts'][_0x1b1e0d][_0x8981('0x25')]){this[_0x8981('0x12')][_0x348f20[_0x8981('0x26')]]={};this[_0x8981('0x12')][_0x348f20[_0x8981('0x26')]][_0x8981('0x27')]=_0x348f20[_0x8981('0x27')];this['channels'][_0x348f20[_0x8981('0x26')]]['id']=this[_0x8981('0x13')][_0x1b1e0d]['id'];this['channels'][_0x348f20[_0x8981('0x26')]][_0x8981('0x28')]=this[_0x8981('0x13')][_0x1b1e0d][_0x8981('0x28')];logger['info'](_0x348f20[_0x8981('0x26')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x348f20[_0x8981('0x26')]]){this[_0x8981('0x12')][_0x348f20[_0x8981('0x26')]]={};this['channels'][_0x348f20[_0x8981('0x26')]][_0x8981('0x27')]=_0x348f20[_0x8981('0x27')];logger[_0x8981('0x29')](_0x348f20[_0x8981('0x26')],_0x8981('0x2a'));}};Fax[_0x8981('0x2b')][_0x8981('0x2c')]=function(_0x5b570c){if(this[_0x8981('0x12')][_0x5b570c['uniqueid']]){for(var _0x3df686 in _0x5b570c[_0x8981('0x2d')]){if(_0x5b570c['variable']['hasOwnProperty'](_0x3df686)){this['channels'][_0x5b570c[_0x8981('0x26')]][_0x3df686]=_0x5b570c[_0x8981('0x2e')];}}}};Fax[_0x8981('0x2b')]['syncNewState']=function(_0x8eab48){if(this[_0x8981('0x12')][_0x8eab48['uniqueid']]){this[_0x8981('0x12')][_0x8eab48[_0x8981('0x26')]][_0x8981('0x2f')]=_0x8eab48[_0x8981('0x2f')];this[_0x8981('0x12')][_0x8eab48[_0x8981('0x26')]][_0x8981('0x30')]=_0x8eab48[_0x8981('0x30')];}};Fax[_0x8981('0x2b')][_0x8981('0x1d')]=function(_0x28031f){if(this[_0x8981('0x12')][_0x28031f[_0x8981('0x26')]]){for(var _0x253173 in _0x28031f[_0x8981('0x2d')]){if(_0x28031f[_0x8981('0x2d')][_0x8981('0x31')](_0x253173)){this[_0x8981('0x12')][_0x28031f[_0x8981('0x26')]][_0x253173]=_0x28031f[_0x8981('0x2e')];}}}};Fax[_0x8981('0x2b')][_0x8981('0x1f')]=function(_0x16d523){if(this['channels'][_0x16d523[_0x8981('0x26')]]){this[_0x8981('0x12')][_0x16d523[_0x8981('0x26')]][_0x8981('0x32')]=_0x16d523[_0x8981('0x32')];this['channels'][_0x16d523[_0x8981('0x26')]][_0x8981('0x33')]=_0x16d523[_0x8981('0x33')];this[_0x8981('0x12')][_0x16d523['uniqueid']][_0x8981('0x25')]=_0x16d523[_0x8981('0x25')];this['channels'][_0x16d523['uniqueid']][_0x8981('0x34')]=_0x16d523[_0x8981('0x34')];logger[_0x8981('0x29')](_0x16d523[_0x8981('0x26')],_0x8981('0x35'));}};Fax[_0x8981('0x2b')]['syncReceiveFax']=function(_0x3def70){var _0x1f9e48=this;if(this['channels'][_0x3def70[_0x8981('0x26')]]){var _0x14d318=this['channels'][_0x3def70['uniqueid']]['id'];this['channels'][_0x3def70[_0x8981('0x26')]][_0x8981('0x36')]=_0x3def70[_0x8981('0x36')];this['channels'][_0x3def70['uniqueid']]['pagestransferred']=_0x3def70[_0x8981('0x37')];this[_0x8981('0x12')][_0x3def70[_0x8981('0x26')]]['localstationid']=_0x3def70['localstationid'];this['channels'][_0x3def70[_0x8981('0x26')]][_0x8981('0x38')]=_0x3def70['resolution'];this['channels'][_0x3def70[_0x8981('0x26')]][_0x8981('0x39')]=_0x3def70[_0x8981('0x39')];this[_0x8981('0x12')][_0x3def70[_0x8981('0x26')]][_0x8981('0x34')]=_0x3def70['filename'];this[_0x8981('0x12')][_0x3def70[_0x8981('0x26')]][_0x8981('0x3a')]=_0x3def70[_0x8981('0x3a')];if(this[_0x8981('0x12')][_0x3def70['uniqueid']][_0x8981('0x37')]>0x0){tiff2pdf(_0x3def70[_0x8981('0x34')],_0x8981('0x3b'),function(_0x1ed7a9){logger[_0x8981('0x29')](_0x3def70['uniqueid'],_0x8981('0x3c'),_0x1ed7a9[_0x8981('0x3d')]);attachment[_0x8981('0x3e')]({'name':path['parse'](_0x3def70[_0x8981('0x34')])['name'],'basename':path['parse'](_0x3def70[_0x8981('0x34')])[_0x8981('0x28')]+_0x8981('0x3f'),'type':_0x8981('0x40')})[_0x8981('0x41')](function(_0x5c878f){faxAccount[_0x8981('0x42')](_0x14d318,{'from':_0x3def70[_0x8981('0x3a')],'mapKey':_0x8981('0x9'),'body':path[_0x8981('0x43')](_0x3def70[_0x8981('0x34')])[_0x8981('0x28')]+_0x8981('0x3f'),'AttachmentId':_0x5c878f['id']})[_0x8981('0x44')](function(_0x5895ea){logger['error'](_0x3def70[_0x8981('0x26')],_0x8981('0x45'),JSON[_0x8981('0x46')](_0x5895ea));});})[_0x8981('0x44')](function(_0x124522){logger[_0x8981('0x47')](_0x3def70[_0x8981('0x26')],'\x20receiveFax\x20',JSON[_0x8981('0x46')](_0x124522));});});}logger[_0x8981('0x29')](_0x3def70[_0x8981('0x26')],_0x8981('0x48'));}};Fax[_0x8981('0x2b')]['syncOriginateResponse']=function(_0x1ac53a){if(this[_0x8981('0x15')][_0x1ac53a[_0x8981('0x26')]]){_[_0x8981('0x49')](this[_0x8981('0x12')][_0x1ac53a[_0x8981('0x26')]],_[_0x8981('0x4a')](_0x1ac53a,[_0x8981('0x4b'),_0x8981('0x4c')]));}};function updateStatus(_0x2829a2){if(_0x2829a2['AttachmentId']){faxMessage[_0x8981('0x4d')](_0x2829a2[_0x8981('0x4e')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x8981('0x41')](function(_0x2f8fc1){ut[_0x8981('0x4f')](_0x8981('0x50'),_0x2f8fc1);})['catch'](function(_0x12486d){ut[_0x8981('0x4f')](_0x8981('0x51'),_0x12486d);});}else{ut[_0x8981('0x4f')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x8981('0x52')]=function(_0x31b7e2,_0x36669b,_0x43f9fa){var _0x5d0c78=this;var _0xf805c4={};if(_0x36669b){_0xf805c4={'read':_0x36669b};}else{_0xf805c4={'failMessage':_0x43f9fa};}if(this[_0x8981('0x15')][_0x31b7e2][_0x8981('0x4e')]){faxMessage['update'](this[_0x8981('0x15')][_0x31b7e2]['AttachmentId'],_0xf805c4)[_0x8981('0x41')](function(_0x336db9){ut['logger'](_0x8981('0x53'),_0x336db9);})[_0x8981('0x44')](function(_0x3e5522){ut[_0x8981('0x4f')]('[Fax][Message][NoUpdate1]',_0x3e5522);})[_0x8981('0x54')](function(){delete _0x5d0c78[_0x8981('0x12')][_0x31b7e2];delete _0x5d0c78[_0x8981('0x15')][_0x31b7e2];});}else{ut['logger'](_0x8981('0x55'));delete this[_0x8981('0x12')][_0x31b7e2];delete this['actions'][_0x31b7e2];}};Fax['prototype'][_0x8981('0x21')]=function(_0x6800a6){var _0x2c5a14=this;if(this['channels'][_0x6800a6[_0x8981('0x26')]]){if(this[_0x8981('0x15')][_0x6800a6[_0x8981('0x26')]]){this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]]['id']=this[_0x8981('0x15')][_0x6800a6['uniqueid']]['id'];this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]]['name']=this[_0x8981('0x15')][_0x6800a6[_0x8981('0x26')]][_0x8981('0x28')];}logger[_0x8981('0x29')](_0x6800a6[_0x8981('0x26')],this['actions'][_0x6800a6[_0x8981('0x26')]]?_0x8981('0x56'):_0x8981('0x57'),JSON[_0x8981('0x46')](this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]]));if(this[_0x8981('0x15')][_0x6800a6['uniqueid']]){if(this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]][_0x8981('0x58')]>0x0&&this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]][_0x8981('0x1e')]===_0x8981('0x59')){this[_0x8981('0x52')](_0x6800a6['uniqueid'],!![]);}else{this[_0x8981('0x52')](_0x6800a6[_0x8981('0x26')],![],this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]]['faxstatusstring']?_0x8981('0x5a')+this[_0x8981('0x12')][_0x6800a6[_0x8981('0x26')]][_0x8981('0x5b')]:_0x8981('0x5c'));}}}};Fax['prototype'][_0x8981('0x5d')]=function(_0x3160dd){var _0x5b937c=this;return new BPromise(function(_0x228614,_0x29c8ed){_0x5b937c[_0x8981('0x5e')](_0x3160dd,_0x5b937c[_0x8981('0x13')][_0x3160dd[_0x8981('0x5f')]])[_0x8981('0x41')](function(_0x5e9ca1){ut[_0x8981('0x4f')](_0x8981('0x60'),_0x5e9ca1);_0x228614(ut[_0x8981('0x3d')](_0x8981('0x61')));})[_0x8981('0x44')](function(_0x39fe0){ut[_0x8981('0x4f')]('[Fax][execOriginate][failure]',_0x39fe0);updateStatus(_0x3160dd);_0x29c8ed(ut['message'](_0x8981('0x62')));});});};Fax['prototype'][_0x8981('0x63')]=function(_0x2d7ede){var _0xaf53bd=this;return new BPromise(function(_0x36125b,_0x57785f){var _0x596729=_0xaf53bd['checkTrunk'](_0xaf53bd[_0x8981('0x13')][_0x2d7ede['FaxAccountId']][_0x8981('0x64')],_0x2d7ede);if(_0x596729[_0x8981('0x65')]){_0x36125b(ut[_0x8981('0x3d')]('Trunk\x20Reachable'));}else{_0x57785f(ut['message'](_0x596729['message']));}});};function originate(_0x42afca,_0x225f2b,_0x59db62){return new BPromise(function(_0x81571a,_0x29221c){if(_0x59db62){var _0x4692b0=util[_0x8981('0x66')](_0x8981('0x67'),path[_0x8981('0x43')](_0x42afca[_0x8981('0x5')])[_0x8981('0x28')],_0x42afca['path']);gs[_0x8981('0x68')](_0x4692b0)[_0x8981('0x41')](function(){_0x42afca[_0x8981('0x5')]=util['format'](_0x8981('0x69'),path[_0x8981('0x43')](_0x42afca[_0x8981('0x5')])[_0x8981('0x6a')],path[_0x8981('0x43')](_0x42afca['path'])[_0x8981('0x28')]);_0x225f2b['XMF-PATH']=_0x42afca[_0x8981('0x5')];ut[_0x8981('0x4f')](_0x8981('0x6b'),'');ami[_0x8981('0x6c')](ut[_0x8981('0x6d')](_0x42afca,_0x225f2b))[_0x8981('0x41')](function(_0xec50c7){_0x81571a(_0xec50c7);})[_0x8981('0x44')](function(_0x25485a){_0x29221c(_0x25485a);});})[_0x8981('0x44')](function(_0x4779f0){_0x29221c(_0x4779f0);});}else{ami[_0x8981('0x6c')](ut['variablesAction'](_0x42afca,_0x225f2b))[_0x8981('0x41')](function(_0x4fd6dd){_0x81571a(_0x4fd6dd);})[_0x8981('0x44')](function(_0x8fcaa3){_0x29221c(_0x8fcaa3);});}});}Fax[_0x8981('0x2b')][_0x8981('0x5e')]=function(_0x5a2a5f,_0x4cc330){var _0xb56d5e=this;return new BPromise(function(_0x1a789c,_0x5020c2){var _0x57c2b3=uuid['v4']();var _0x347982=ut[_0x8981('0x6e')](_0x5a2a5f,_0x4cc330);_0xb56d5e[_0x8981('0x15')][_0x57c2b3]=new Action(_0x57c2b3,_0x4cc330,_0x5a2a5f);var _0x29bccc=_0xb56d5e[_0x8981('0x15')][_0x57c2b3];if(path[_0x8981('0x43')](_0x5a2a5f['path'])['ext']===_0x8981('0x3f')){originate(_0x29bccc,_0x347982,!![])[_0x8981('0x41')](function(_0x367d5e){_0x1a789c(_0x367d5e);})[_0x8981('0x44')](function(_0x20df28){_0x5020c2(_0x20df28);});}else{originate(_0x29bccc,_0x347982,![])[_0x8981('0x41')](function(_0x494636){_0x1a789c(_0x494636);})[_0x8981('0x44')](function(_0x162e18){_0x5020c2(_0x162e18);});}});};Fax[_0x8981('0x2b')][_0x8981('0x6f')]=function(_0x2a75cc){return!_[_0x8981('0x70')](_0x2a75cc)&&!_[_0x8981('0x70')](_0x2a75cc[_0x8981('0x28')])&&!_['isNil'](_0x2a75cc[_0x8981('0x71')])&&_0x2a75cc[_0x8981('0x71')]&&!_['isNil'](this['trunks'][util[_0x8981('0x66')](_0x8981('0x72'),_0x2a75cc['name'])])&&!_[_0x8981('0x70')](this[_0x8981('0x14')][util[_0x8981('0x66')](_0x8981('0x72'),_0x2a75cc[_0x8981('0x28')])][_0x8981('0x33')])&&(this[_0x8981('0x14')][util[_0x8981('0x66')]('SIP/%s',_0x2a75cc[_0x8981('0x28')])][_0x8981('0x33')]===_0x8981('0x73')||this[_0x8981('0x14')][util[_0x8981('0x66')](_0x8981('0x72'),_0x2a75cc[_0x8981('0x28')])][_0x8981('0x33')]===_0x8981('0x74'));};Fax['prototype'][_0x8981('0x75')]=function(_0x154b47,_0x49ef45){if(!this['isTrunkReachable'](_0x154b47)){ut['logger'](_0x8981('0x76'),_['isNil'](_0x154b47)?'':_0x154b47[_0x8981('0x28')]+_0x8981('0x77'));return{'isValid':![],'message':_0x8981('0x78')};}if(_['isNil'](_0x49ef45[_0x8981('0x9')])){ut[_0x8981('0x4f')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x8981('0x46')](_0x49ef45));return{'isValid':![],'message':_0x8981('0x79')};}if(_['isNil'](_0x49ef45[_0x8981('0x5')])){ut[_0x8981('0x4f')](_0x8981('0x7a'),JSON['stringify'](_0x49ef45));return{'isValid':![],'message':_0x8981('0x7b')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax;
\ No newline at end of file
+var _0x75c0=['transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','faxpages','updateStatus','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Is\x20Valid','exports','util','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','bind','syncVarSet','newstate','syncNewState','newexten','syncFaxStatus','receivefax','originateresponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','actions','info','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred'];(function(_0x1f7819,_0x955f17){var _0x1edcaf=function(_0x21b2a0){while(--_0x21b2a0){_0x1f7819['push'](_0x1f7819['shift']());}};_0x1edcaf(++_0x955f17);}(_0x75c0,0x18c));var _0x075c=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x75c0[_0x534c8f];return _0x5a57f5;};'use strict';var util=require(_0x075c('0x0'));var _=require('lodash');var BPromise=require(_0x075c('0x1'));var uuid=require(_0x075c('0x2'));var moment=require(_0x075c('0x3'));var path=require(_0x075c('0x4'));var tiff2pdf=require(_0x075c('0x5'));var gs=require(_0x075c('0x6'));var logger=require(_0x075c('0x7'))('fax');var ami=require(_0x075c('0x8'));var rpcDb=require(_0x075c('0x9'));var Channel=require('./channel');var ut=require(_0x075c('0xa'));var Action=require(_0x075c('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x075c('0xc'));var faxMessage=require(_0x075c('0xd'));function Fax(_0x14d6a1){this[_0x075c('0xe')]={};this['faxAccounts']=_0x14d6a1[_0x075c('0xf')];this[_0x075c('0x10')]=_0x14d6a1[_0x075c('0x10')];this['actions']={};ami['on']('newchannel',this['syncNewchannel'][_0x075c('0x11')](this));ami['on']('varset',this[_0x075c('0x12')][_0x075c('0x11')](this));ami['on'](_0x075c('0x13'),this[_0x075c('0x14')][_0x075c('0x11')](this));ami['on'](_0x075c('0x15'),this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0x075c('0x16')]['bind'](this));ami['on'](_0x075c('0x17'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this['syncHangup'][_0x075c('0x11')](this));ami['on'](_0x075c('0x18'),this['syncOriginateResponse'][_0x075c('0x11')](this));}Fax[_0x075c('0x19')][_0x075c('0x1a')]=function(_0x5c86cb){if(_0x5c86cb[_0x075c('0x1b')]==='from-voip-provider'){for(var _0x4e4397 in this['faxAccounts']){if(this[_0x075c('0xf')][_0x075c('0x1c')](_0x4e4397)){if(_0x5c86cb[_0x075c('0x1d')]===this[_0x075c('0xf')][_0x4e4397][_0x075c('0x1e')]){this[_0x075c('0xe')][_0x5c86cb['uniqueid']]={};this[_0x075c('0xe')][_0x5c86cb[_0x075c('0x1f')]][_0x075c('0x20')]=_0x5c86cb[_0x075c('0x20')];this[_0x075c('0xe')][_0x5c86cb['uniqueid']]['id']=this[_0x075c('0xf')][_0x4e4397]['id'];this['channels'][_0x5c86cb[_0x075c('0x1f')]][_0x075c('0x21')]=this['faxAccounts'][_0x4e4397][_0x075c('0x21')];logger['info'](_0x5c86cb['uniqueid'],_0x075c('0x22'));}}}}if(this[_0x075c('0x23')][_0x5c86cb[_0x075c('0x1f')]]){this['channels'][_0x5c86cb[_0x075c('0x1f')]]={};this['channels'][_0x5c86cb[_0x075c('0x1f')]][_0x075c('0x20')]=_0x5c86cb[_0x075c('0x20')];logger[_0x075c('0x24')](_0x5c86cb[_0x075c('0x1f')],_0x075c('0x22'));}};Fax['prototype'][_0x075c('0x12')]=function(_0x4f7d87){if(this[_0x075c('0xe')][_0x4f7d87[_0x075c('0x1f')]]){for(var _0x2ac179 in _0x4f7d87[_0x075c('0x25')]){if(_0x4f7d87['variable'][_0x075c('0x1c')](_0x2ac179)){this[_0x075c('0xe')][_0x4f7d87['uniqueid']][_0x2ac179]=_0x4f7d87[_0x075c('0x26')];}}}};Fax['prototype'][_0x075c('0x14')]=function(_0x55be8c){if(this['channels'][_0x55be8c[_0x075c('0x1f')]]){this[_0x075c('0xe')][_0x55be8c[_0x075c('0x1f')]][_0x075c('0x27')]=_0x55be8c[_0x075c('0x27')];this['channels'][_0x55be8c[_0x075c('0x1f')]][_0x075c('0x28')]=_0x55be8c[_0x075c('0x28')];}};Fax[_0x075c('0x19')][_0x075c('0x29')]=function(_0x29d4eb){if(this[_0x075c('0xe')][_0x29d4eb[_0x075c('0x1f')]]){for(var _0x500103 in _0x29d4eb[_0x075c('0x25')]){if(_0x29d4eb['variable'][_0x075c('0x1c')](_0x500103)){this['channels'][_0x29d4eb[_0x075c('0x1f')]][_0x500103]=_0x29d4eb[_0x075c('0x26')];}}}};Fax[_0x075c('0x19')][_0x075c('0x16')]=function(_0x430c51){if(this['channels'][_0x430c51[_0x075c('0x1f')]]){this[_0x075c('0xe')][_0x430c51['uniqueid']][_0x075c('0x2a')]=_0x430c51[_0x075c('0x2a')];this[_0x075c('0xe')][_0x430c51[_0x075c('0x1f')]][_0x075c('0x2b')]=_0x430c51['status'];this[_0x075c('0xe')][_0x430c51[_0x075c('0x1f')]][_0x075c('0x1e')]=_0x430c51[_0x075c('0x1e')];this[_0x075c('0xe')][_0x430c51[_0x075c('0x1f')]][_0x075c('0x2c')]=_0x430c51[_0x075c('0x2c')];logger[_0x075c('0x24')](_0x430c51[_0x075c('0x1f')],_0x075c('0x2d'));}};Fax['prototype']['syncReceiveFax']=function(_0x54d8b3){var _0x509c4d=this;if(this['channels'][_0x54d8b3[_0x075c('0x1f')]]){var _0xc6ef0e=this[_0x075c('0xe')][_0x54d8b3[_0x075c('0x1f')]]['id'];this[_0x075c('0xe')][_0x54d8b3[_0x075c('0x1f')]][_0x075c('0x2e')]=_0x54d8b3['remotestationid'];this[_0x075c('0xe')][_0x54d8b3[_0x075c('0x1f')]][_0x075c('0x2f')]=_0x54d8b3[_0x075c('0x2f')];this[_0x075c('0xe')][_0x54d8b3['uniqueid']][_0x075c('0x1e')]=_0x54d8b3['localstationid'];this[_0x075c('0xe')][_0x54d8b3[_0x075c('0x1f')]]['resolution']=_0x54d8b3['resolution'];this[_0x075c('0xe')][_0x54d8b3['uniqueid']][_0x075c('0x30')]=_0x54d8b3[_0x075c('0x30')];this[_0x075c('0xe')][_0x54d8b3[_0x075c('0x1f')]][_0x075c('0x2c')]=_0x54d8b3[_0x075c('0x2c')];this[_0x075c('0xe')][_0x54d8b3[_0x075c('0x1f')]][_0x075c('0x31')]=_0x54d8b3[_0x075c('0x31')];if(this[_0x075c('0xe')][_0x54d8b3['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x54d8b3[_0x075c('0x2c')],_0x075c('0x32'),function(_0x140c10){logger[_0x075c('0x24')](_0x54d8b3['uniqueid'],_0x075c('0x33'),_0x140c10[_0x075c('0x34')]);attachment['create']({'name':path[_0x075c('0x35')](_0x54d8b3[_0x075c('0x2c')])[_0x075c('0x21')],'basename':path[_0x075c('0x35')](_0x54d8b3[_0x075c('0x2c')])['name']+_0x075c('0x36'),'type':_0x075c('0x37')})[_0x075c('0x38')](function(_0x3d3f57){faxAccount[_0x075c('0x39')](_0xc6ef0e,{'from':_0x54d8b3['calleridnum'],'mapKey':_0x075c('0x3a'),'body':path['parse'](_0x54d8b3[_0x075c('0x2c')])[_0x075c('0x21')]+_0x075c('0x36'),'AttachmentId':_0x3d3f57['id']})[_0x075c('0x3b')](function(_0xb79945){logger[_0x075c('0x3c')](_0x54d8b3[_0x075c('0x1f')],_0x075c('0x3d'),JSON[_0x075c('0x3e')](_0xb79945));});})['catch'](function(_0x4edbc3){logger[_0x075c('0x3c')](_0x54d8b3[_0x075c('0x1f')],_0x075c('0x3f'),JSON[_0x075c('0x3e')](_0x4edbc3));});});}logger[_0x075c('0x24')](_0x54d8b3[_0x075c('0x1f')],_0x075c('0x3f'));}};Fax[_0x075c('0x19')]['syncOriginateResponse']=function(_0x480598){if(this['actions'][_0x480598[_0x075c('0x1f')]]){_['merge'](this['channels'][_0x480598[_0x075c('0x1f')]],_['pick'](_0x480598,[_0x075c('0x40'),'reason']));}};function updateStatus(_0x3baa17){if(_0x3baa17[_0x075c('0x41')]){faxMessage[_0x075c('0x42')](_0x3baa17['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x7e5df2){ut[_0x075c('0x43')]('[Fax][Message][Error][Updated]',_0x7e5df2);})[_0x075c('0x3b')](function(_0x15bc00){ut[_0x075c('0x43')]('[Fax][Message][Error][NoUpdate1]',_0x15bc00);});}else{ut['logger'](_0x075c('0x44'));}}Fax['prototype']['updateStatus']=function(_0x45f60f,_0x14d754,_0x3e6ddd){var _0x12200d=this;var _0x45d07f={};if(_0x14d754){_0x45d07f={'read':_0x14d754};}else{_0x45d07f={'failMessage':_0x3e6ddd};}if(this[_0x075c('0x23')][_0x45f60f][_0x075c('0x41')]){faxMessage['update'](this[_0x075c('0x23')][_0x45f60f][_0x075c('0x41')],_0x45d07f)[_0x075c('0x38')](function(_0x1accff){ut['logger'](_0x075c('0x45'),_0x1accff);})[_0x075c('0x3b')](function(_0x5c670f){ut['logger'](_0x075c('0x46'),_0x5c670f);})['finally'](function(){delete _0x12200d[_0x075c('0xe')][_0x45f60f];delete _0x12200d['actions'][_0x45f60f];});}else{ut['logger'](_0x075c('0x47'));delete this[_0x075c('0xe')][_0x45f60f];delete this[_0x075c('0x23')][_0x45f60f];}};Fax['prototype'][_0x075c('0x48')]=function(_0x31e0b4){var _0x51bf3c=this;if(this['channels'][_0x31e0b4[_0x075c('0x1f')]]){if(this['actions'][_0x31e0b4[_0x075c('0x1f')]]){this[_0x075c('0xe')][_0x31e0b4[_0x075c('0x1f')]]['id']=this[_0x075c('0x23')][_0x31e0b4['uniqueid']]['id'];this[_0x075c('0xe')][_0x31e0b4[_0x075c('0x1f')]][_0x075c('0x21')]=this[_0x075c('0x23')][_0x31e0b4[_0x075c('0x1f')]]['name'];}logger[_0x075c('0x24')](_0x31e0b4[_0x075c('0x1f')],this[_0x075c('0x23')][_0x31e0b4['uniqueid']]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x075c('0x3e')](this[_0x075c('0xe')][_0x31e0b4['uniqueid']]));if(this[_0x075c('0x23')][_0x31e0b4[_0x075c('0x1f')]]){if(this[_0x075c('0xe')][_0x31e0b4['uniqueid']][_0x075c('0x49')]>0x0&&this[_0x075c('0xe')][_0x31e0b4[_0x075c('0x1f')]]['faxstatus']==='SUCCESS'){this[_0x075c('0x4a')](_0x31e0b4[_0x075c('0x1f')],!![]);}else{this[_0x075c('0x4a')](_0x31e0b4[_0x075c('0x1f')],![],this[_0x075c('0xe')][_0x31e0b4['uniqueid']][_0x075c('0x4b')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x31e0b4['uniqueid']]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax[_0x075c('0x19')][_0x075c('0x4c')]=function(_0x2afb4e){var _0x394bc2=this;return new BPromise(function(_0x384b58,_0x5a65a9){_0x394bc2[_0x075c('0x4d')](_0x2afb4e,_0x394bc2[_0x075c('0xf')][_0x2afb4e[_0x075c('0x4e')]])['then'](function(_0x19d056){ut[_0x075c('0x43')](_0x075c('0x4f'),_0x19d056);_0x384b58(ut[_0x075c('0x34')](_0x075c('0x50')));})[_0x075c('0x3b')](function(_0x390eaf){ut['logger'](_0x075c('0x51'),_0x390eaf);updateStatus(_0x2afb4e);_0x5a65a9(ut['message'](_0x075c('0x52')));});});};Fax[_0x075c('0x19')][_0x075c('0x53')]=function(_0x534dac){var _0x33eb5d=this;return new BPromise(function(_0x150b42,_0x47f544){var _0x396310=_0x33eb5d['checkTrunk'](_0x33eb5d['faxAccounts'][_0x534dac[_0x075c('0x4e')]][_0x075c('0x54')],_0x534dac);if(_0x396310[_0x075c('0x55')]){_0x150b42(ut[_0x075c('0x34')](_0x075c('0x56')));}else{_0x47f544(ut['message'](_0x396310['message']));}});};function originate(_0x505c20,_0x4a2c40,_0x26cff9){return new BPromise(function(_0x3fdbb3,_0x29f1be){if(_0x26cff9){var _0x9896e7=util[_0x075c('0x57')](_0x075c('0x58'),path[_0x075c('0x35')](_0x505c20[_0x075c('0x4')])[_0x075c('0x21')],_0x505c20[_0x075c('0x4')]);gs[_0x075c('0x59')](_0x9896e7)[_0x075c('0x38')](function(){_0x505c20['path']=util[_0x075c('0x57')](_0x075c('0x5a'),path[_0x075c('0x35')](_0x505c20[_0x075c('0x4')])['dir'],path[_0x075c('0x35')](_0x505c20['path'])['name']);_0x4a2c40[_0x075c('0x5b')]=_0x505c20['path'];ut[_0x075c('0x43')](_0x075c('0x5c'),'');ami['Action'](ut[_0x075c('0x5d')](_0x505c20,_0x4a2c40))[_0x075c('0x38')](function(_0x544f07){_0x3fdbb3(_0x544f07);})[_0x075c('0x3b')](function(_0x345f10){_0x29f1be(_0x345f10);});})['catch'](function(_0x683b95){_0x29f1be(_0x683b95);});}else{ami[_0x075c('0x5e')](ut[_0x075c('0x5d')](_0x505c20,_0x4a2c40))[_0x075c('0x38')](function(_0x4d45eb){_0x3fdbb3(_0x4d45eb);})['catch'](function(_0x21b383){_0x29f1be(_0x21b383);});}});}Fax[_0x075c('0x19')][_0x075c('0x4d')]=function(_0x5e808e,_0x3ccd2e){var _0xa81142=this;return new BPromise(function(_0xd94c1f,_0x20d4d5){var _0x517cb6=uuid['v4']();var _0x312e0a=ut[_0x075c('0x5f')](_0x5e808e,_0x3ccd2e);_0xa81142[_0x075c('0x23')][_0x517cb6]=new Action(_0x517cb6,_0x3ccd2e,_0x5e808e);var _0x1e85f8=_0xa81142[_0x075c('0x23')][_0x517cb6];if(path[_0x075c('0x35')](_0x5e808e[_0x075c('0x4')])[_0x075c('0x60')]===_0x075c('0x36')){originate(_0x1e85f8,_0x312e0a,!![])[_0x075c('0x38')](function(_0x22a3c5){_0xd94c1f(_0x22a3c5);})[_0x075c('0x3b')](function(_0x5deb76){_0x20d4d5(_0x5deb76);});}else{originate(_0x1e85f8,_0x312e0a,![])[_0x075c('0x38')](function(_0x3d06f0){_0xd94c1f(_0x3d06f0);})[_0x075c('0x3b')](function(_0x345153){_0x20d4d5(_0x345153);});}});};Fax['prototype'][_0x075c('0x61')]=function(_0x44f268){return!_[_0x075c('0x62')](_0x44f268)&&!_[_0x075c('0x62')](_0x44f268[_0x075c('0x21')])&&!_['isNil'](_0x44f268['active'])&&_0x44f268[_0x075c('0x63')]&&!_[_0x075c('0x62')](this['trunks'][util['format'](_0x075c('0x64'),_0x44f268[_0x075c('0x21')])])&&!_[_0x075c('0x62')](this[_0x075c('0x10')][util['format'](_0x075c('0x64'),_0x44f268['name'])][_0x075c('0x2b')])&&(this[_0x075c('0x10')][util[_0x075c('0x57')](_0x075c('0x64'),_0x44f268[_0x075c('0x21')])]['status']===_0x075c('0x65')||this['trunks'][util['format'](_0x075c('0x64'),_0x44f268[_0x075c('0x21')])][_0x075c('0x2b')]===_0x075c('0x66'));};Fax[_0x075c('0x19')][_0x075c('0x67')]=function(_0x145ca5,_0x2f03de){if(!this[_0x075c('0x61')](_0x145ca5)){ut[_0x075c('0x43')](_0x075c('0x68'),_[_0x075c('0x62')](_0x145ca5)?'':_0x145ca5[_0x075c('0x21')]+_0x075c('0x69'));return{'isValid':![],'message':_0x075c('0x6a')};}if(_[_0x075c('0x62')](_0x2f03de[_0x075c('0x3a')])){ut['logger'](_0x075c('0x6b'),JSON[_0x075c('0x3e')](_0x2f03de));return{'isValid':![],'message':_0x075c('0x6c')};}if(_[_0x075c('0x62')](_0x2f03de[_0x075c('0x4')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x075c('0x3e')](_0x2f03de));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x075c('0x6d')};};module[_0x075c('0x6e')]=Fax;
\ No newline at end of file
index 85c8acd..419ef4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e83=['bluebird','../../../config/logger','preview','lodash','error','notify','then','catch','util'];(function(_0x515437,_0x5a6843){var _0x365aa9=function(_0x1dab2b){while(--_0x1dab2b){_0x515437['push'](_0x515437['shift']());}};_0x365aa9(++_0x5a6843);}(_0x1e83,0xf2));var _0x31e8=function(_0x470f48,_0x5698f7){_0x470f48=_0x470f48-0x0;var _0x5e00f6=_0x1e83[_0x470f48];return _0x5e00f6;};'use strict';var util=require(_0x31e8('0x0'));var BPromise=require(_0x31e8('0x1'));var logger=require(_0x31e8('0x2'))(_0x31e8('0x3'));var _=require(_0x31e8('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5d8ddd){return function(_0x23da42){logger[_0x31e8('0x5')](_0x5d8ddd,util['inspect'](_0x23da42,{'showHidden':![],'depth':null}));};}exports[_0x31e8('0x6')]=function(_0x1d8ec1,_0x18ea7b){return BPromise['resolve']()[_0x31e8('0x7')](faxAccount['notify'](_0x1d8ec1,_0x18ea7b))[_0x31e8('0x8')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0x5027=['notify','resolve','then','[Notify]\x20','bluebird','../../../config/logger','preview','inspect'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x5027,0xd4));var _0x7502=function(_0x50f2d6,_0x1dabe1){_0x50f2d6=_0x50f2d6-0x0;var _0x12792b=_0x5027[_0x50f2d6];return _0x12792b;};'use strict';var util=require('util');var BPromise=require(_0x7502('0x0'));var logger=require(_0x7502('0x1'))(_0x7502('0x2'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5e7960){return function(_0x4fb0cd){logger['error'](_0x5e7960,util[_0x7502('0x3')](_0x4fb0cd,{'showHidden':![],'depth':null}));};}exports[_0x7502('0x4')]=function(_0x47c419,_0x272445){return BPromise[_0x7502('0x5')]()[_0x7502('0x6')](faxAccount[_0x7502('0x4')](_0x47c419,_0x272445))['catch'](loggerCatch(_0x7502('0x7')));};
\ No newline at end of file
index 45a029f..8565be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b8e=['fax','bluebird','child_process','exec','execute','info','\x20Error\x20:','util','../../../../config/logger'];(function(_0x1f27d4,_0x219a35){var _0x407d74=function(_0x1eab05){while(--_0x1eab05){_0x1f27d4['push'](_0x1f27d4['shift']());}};_0x407d74(++_0x219a35);}(_0x9b8e,0x178));var _0xe9b8=function(_0x553af5,_0x1151e9){_0x553af5=_0x553af5-0x0;var _0x386d34=_0x9b8e[_0x553af5];return _0x386d34;};'use strict';var util=require(_0xe9b8('0x0'));var logger=require(_0xe9b8('0x1'))(_0xe9b8('0x2'));var BPromise=require(_0xe9b8('0x3'));var exec=require(_0xe9b8('0x4'))[_0xe9b8('0x5')];exports[_0xe9b8('0x6')]=function(_0x38db66){return new BPromise(function(_0x4c44bf,_0x5391c6){exec(_0x38db66,function(_0x25e15f,_0x660781,_0x2613d2){logger[_0xe9b8('0x7')]('Exec\x20gs',_0x660781);if(_0x25e15f){logger[_0xe9b8('0x7')]('Exec\x20gs',_0xe9b8('0x8'),util['inspect'](_0x25e15f,{'showHidden':![],'depth':null}),_0x660781,_0x2613d2);_0x5391c6(_0x25e15f);}_0x4c44bf(_0x660781);});});};
\ No newline at end of file
+var _0x5362=['exec','execute','info','Exec\x20gs','\x20Error\x20:','util','fax','bluebird'];(function(_0x18c60b,_0x3a046e){var _0x432c4d=function(_0x8840ad){while(--_0x8840ad){_0x18c60b['push'](_0x18c60b['shift']());}};_0x432c4d(++_0x3a046e);}(_0x5362,0x1a5));var _0x2536=function(_0x42e5d1,_0x4406c3){_0x42e5d1=_0x42e5d1-0x0;var _0x8a150f=_0x5362[_0x42e5d1];return _0x8a150f;};'use strict';var util=require(_0x2536('0x0'));var logger=require('../../../../config/logger')(_0x2536('0x1'));var BPromise=require(_0x2536('0x2'));var exec=require('child_process')[_0x2536('0x3')];exports[_0x2536('0x4')]=function(_0xc87f50){return new BPromise(function(_0x5776ee,_0x533cca){exec(_0xc87f50,function(_0x5cbd6f,_0x314415,_0x270d92){logger[_0x2536('0x5')](_0x2536('0x6'),_0x314415);if(_0x5cbd6f){logger[_0x2536('0x5')](_0x2536('0x6'),_0x2536('0x7'),util['inspect'](_0x5cbd6f,{'showHidden':![],'depth':null}),_0x314415,_0x270d92);_0x533cca(_0x5cbd6f);}_0x5776ee(_0x314415);});});};
\ No newline at end of file
index 0825a85..5b7db7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8d2=['t38timeout','localstationid','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','modem','faxdetect'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xd8d2,0x103));var _0x2d8d=function(_0x1c4782,_0x2e04da){_0x1c4782=_0x1c4782-0x0;var _0x1dae38=_0xd8d2[_0x1c4782];return _0x1dae38;};'use strict';var util=require(_0x2d8d('0x0'));var _=require('lodash');var moment=require(_0x2d8d('0x1'));var logger=require(_0x2d8d('0x2'))('fax');exports[_0x2d8d('0x3')]=function(_0x1dfeba){return{'message':_0x1dfeba};};exports[_0x2d8d('0x4')]=function(_0x57171b,_0xa67c9f){logger[_0x2d8d('0x5')](_0x57171b,util[_0x2d8d('0x6')](_0xa67c9f,{'showHidden':![],'depth':null}));};exports[_0x2d8d('0x7')]=function(_0x25445e,_0x3c0845){var _0xd36277={'XMF-ECM':_0x3c0845[_0x2d8d('0x8')],'XMF-HEADERINFO':_0x3c0845[_0x2d8d('0x9')],'XMF-MINRATE':_0x3c0845[_0x2d8d('0xa')],'XMF-MAXRATE':_0x3c0845['maxrate'],'XMF-MODEM':util[_0x2d8d('0xb')]('\x22%s\x22',_0x3c0845[_0x2d8d('0xc')]),'XMF-GATEWAY':_0x3c0845['gateway'],'XMF-FAXDETECT':_0x3c0845[_0x2d8d('0xd')],'XMF-T38TIMEOUT':_0x3c0845[_0x2d8d('0xe')],'XMF-LOCALSTATIONID':_0x3c0845[_0x2d8d('0xf')],'XMF-PATH':_0x25445e['path']};return _0xd36277;};exports['variablesAction']=function(_0x394758,_0x5d63a5){return{'actionid':_0x394758[_0x2d8d('0x10')],'action':_0x2d8d('0x11'),'channel':_0x394758[_0x2d8d('0x12')],'Exten':_0x2d8d('0x13'),'Context':'from-sip','Priority':'1','callerid':util[_0x2d8d('0xb')](_0x2d8d('0x14'),_0x394758[_0x2d8d('0x9')]?_0x394758[_0x2d8d('0x9')]:'',_0x394758['localstationid']),'variable':_0x5d63a5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x394758[_0x2d8d('0x10')]};};
\ No newline at end of file
+var _0xe75d=['modem','faxdetect','t38timeout','localstationid','path','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe75d,0x136));var _0xde75=function(_0x438988,_0x2a86cf){_0x438988=_0x438988-0x0;var _0x1ce59f=_0xe75d[_0x438988];return _0x1ce59f;};'use strict';var util=require(_0xde75('0x0'));var _=require(_0xde75('0x1'));var moment=require(_0xde75('0x2'));var logger=require(_0xde75('0x3'))(_0xde75('0x4'));exports[_0xde75('0x5')]=function(_0x5df399){return{'message':_0x5df399};};exports[_0xde75('0x6')]=function(_0x2f0597,_0x439bfd){logger[_0xde75('0x7')](_0x2f0597,util[_0xde75('0x8')](_0x439bfd,{'showHidden':![],'depth':null}));};exports[_0xde75('0x9')]=function(_0x2e6410,_0x4a347a){var _0x570c8a={'XMF-ECM':_0x4a347a[_0xde75('0xa')],'XMF-HEADERINFO':_0x4a347a[_0xde75('0xb')],'XMF-MINRATE':_0x4a347a[_0xde75('0xc')],'XMF-MAXRATE':_0x4a347a['maxrate'],'XMF-MODEM':util[_0xde75('0xd')](_0xde75('0xe'),_0x4a347a[_0xde75('0xf')]),'XMF-GATEWAY':_0x4a347a['gateway'],'XMF-FAXDETECT':_0x4a347a[_0xde75('0x10')],'XMF-T38TIMEOUT':_0x4a347a[_0xde75('0x11')],'XMF-LOCALSTATIONID':_0x4a347a[_0xde75('0x12')],'XMF-PATH':_0x2e6410[_0xde75('0x13')]};return _0x570c8a;};exports['variablesAction']=function(_0x44b5fa,_0xcd0d80){return{'actionid':_0x44b5fa[_0xde75('0x14')],'action':_0xde75('0x15'),'channel':_0x44b5fa['channel'],'Exten':_0xde75('0x16'),'Context':_0xde75('0x17'),'Priority':'1','callerid':util[_0xde75('0xd')](_0xde75('0x18'),_0x44b5fa[_0xde75('0xb')]?_0x44b5fa[_0xde75('0xb')]:'',_0x44b5fa[_0xde75('0x12')]),'variable':_0xcd0d80,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x44b5fa[_0xde75('0x14')]};};
\ No newline at end of file
index 2ea0ca2..e6eb7b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96b8=['getVoiceCallReports','initVoiceCallReports','catch','listen','sync','bluebird','moment','./server','./realtime','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','resolve','getAgents','initAgents','then','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory'];(function(_0x3509f9,_0x2b1f7c){var _0x885f7=function(_0x2b436c){while(--_0x2b436c){_0x3509f9['push'](_0x3509f9['shift']());}};_0x885f7(++_0x2b1f7c);}(_0x96b8,0x1a2));var _0x896b=function(_0x10d3b6,_0x40fd9c){_0x10d3b6=_0x10d3b6-0x0;var _0x387f05=_0x96b8[_0x10d3b6];return _0x387f05;};'use strict';var BPromise=require(_0x896b('0x0'));var util=require('util');var moment=require(_0x896b('0x1'));var server=require(_0x896b('0x2'));var Realtime=require(_0x896b('0x3'));var Report=require('./report');var Acw=require(_0x896b('0x4'));var Trigger=require(_0x896b('0x5'));var Dialer=require(_0x896b('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x896b('0x7'));var voiceQueue=require(_0x896b('0x8'));var voiceQueueReport=require(_0x896b('0x9'));var voiceCallReport=require(_0x896b('0xa'));var trunk=require(_0x896b('0xb'));var trigger=require(_0x896b('0xc'));var template=require(_0x896b('0xd'));var cmHopperHistory=require(_0x896b('0xe'));var campaign=require(_0x896b('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x896b('0x10'));var salesforce=require(_0x896b('0x11'));var sugarcrm=require(_0x896b('0x12'));var freshdesk=require(_0x896b('0x13'));var desk=require(_0x896b('0x14'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x896b('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x896b('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x896b('0x17')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x896b('0x17')](_0x896b('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x896b('0x19')]()['then'](user[_0x896b('0x1a')]())['then'](realtime[_0x896b('0x1b')]())[_0x896b('0x1c')](user[_0x896b('0x1d')]())[_0x896b('0x1c')](realtime[_0x896b('0x1e')]())[_0x896b('0x1c')](trunk[_0x896b('0x1f')]())[_0x896b('0x1c')](realtime['initTrunks']())[_0x896b('0x1c')](voiceQueue[_0x896b('0x20')]())[_0x896b('0x1c')](realtime[_0x896b('0x21')]())[_0x896b('0x1c')](trigger[_0x896b('0x22')]())[_0x896b('0x1c')](realtime['initTriggers']())[_0x896b('0x1c')](template[_0x896b('0x23')]())[_0x896b('0x1c')](realtime[_0x896b('0x24')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x896b('0x25')]())[_0x896b('0x1c')](salesforce[_0x896b('0x26')]())[_0x896b('0x1c')](realtime['initSalesforceAccounts']())[_0x896b('0x1c')](sugarcrm['getSugarcrmAccounts']())['then'](realtime['initSugarcrmAccounts']())[_0x896b('0x1c')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x896b('0x27')]())[_0x896b('0x1c')](desk['getDeskAccounts']())[_0x896b('0x1c')](realtime[_0x896b('0x28')]())[_0x896b('0x1c')](zoho['getZohoAccounts']())[_0x896b('0x1c')](realtime[_0x896b('0x29')]())[_0x896b('0x1c')](vtiger[_0x896b('0x2a')]())[_0x896b('0x1c')](realtime[_0x896b('0x2b')]())['then'](freshsales[_0x896b('0x2c')]())[_0x896b('0x1c')](realtime['initFreshsalesAccounts']())[_0x896b('0x1c')](servicenow['getServicenowAccounts']())[_0x896b('0x1c')](realtime['initServicenowAccounts']())[_0x896b('0x1c')](dynamics365[_0x896b('0x2d')]())['then'](realtime[_0x896b('0x2e')]())[_0x896b('0x1c')](campaign['getCampaigns']())['then'](realtime[_0x896b('0x2f')]())['then'](voiceExtension['getVoiceExtensions']())[_0x896b('0x1c')](realtime['initVoiceExtensions']())[_0x896b('0x1c')](faxAccount[_0x896b('0x30')]())[_0x896b('0x1c')](realtime[_0x896b('0x31')]())[_0x896b('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x896b('0x19')]()[_0x896b('0x1c')](voiceQueueReport[_0x896b('0x32')]())[_0x896b('0x1c')](realtime[_0x896b('0x33')]())[_0x896b('0x1c')](cmHopperHistory[_0x896b('0x34')]())[_0x896b('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0x896b('0x1c')](cmHopperHistory[_0x896b('0x35')]())[_0x896b('0x1c')](realtime['initCampaignHopperHistory']())[_0x896b('0x1c')](voiceCallReport[_0x896b('0x36')]())[_0x896b('0x1c')](realtime[_0x896b('0x37')]())['then'](function(_0x2a7d4d){})[_0x896b('0x38')](function(_0x5aff16){console['log'](_0x5aff16);});}function main(){return server[_0x896b('0x39')](realtime,preview,fax)['then'](function(_0x2be58d){return initRealtime();})[_0x896b('0x1c')](function(){return initParams();})[_0x896b('0x1c')](function(){report[_0x896b('0x3a')]();setInterval(initRealtime,0x1388);})[_0x896b('0x38')](function(_0x2b6348){console['log'](_0x2b6348);});}main();
\ No newline at end of file
+var _0xc8ae=['./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','util','moment','./server','./realtime','./report','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue'];(function(_0x3c283a,_0x11e346){var _0xcde1fd=function(_0x2057a3){while(--_0x2057a3){_0x3c283a['push'](_0x3c283a['shift']());}};_0xcde1fd(++_0x11e346);}(_0xc8ae,0x149));var _0xec8a=function(_0x3f1b6d,_0x1ef0c9){_0x3f1b6d=_0x3f1b6d-0x0;var _0x4f600b=_0xc8ae[_0x3f1b6d];return _0x4f600b;};'use strict';var BPromise=require('bluebird');var util=require(_0xec8a('0x0'));var moment=require(_0xec8a('0x1'));var server=require(_0xec8a('0x2'));var Realtime=require(_0xec8a('0x3'));var Report=require(_0xec8a('0x4'));var Acw=require('./acw');var Trigger=require(_0xec8a('0x5'));var Dialer=require(_0xec8a('0x6'));var Preview=require(_0xec8a('0x7'));var Fax=require(_0xec8a('0x8'));var user=require(_0xec8a('0x9'));var voiceQueue=require(_0xec8a('0xa'));var voiceQueueReport=require(_0xec8a('0xb'));var voiceCallReport=require(_0xec8a('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0xec8a('0xd'));var template=require(_0xec8a('0xe'));var cmHopperHistory=require(_0xec8a('0xf'));var campaign=require(_0xec8a('0x10'));var voiceExtension=require(_0xec8a('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xec8a('0x12'));var salesforce=require(_0xec8a('0x13'));var sugarcrm=require(_0xec8a('0x14'));var freshdesk=require(_0xec8a('0x15'));var desk=require(_0xec8a('0x16'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xec8a('0x17'));var freshsales=require(_0xec8a('0x18'));var servicenow=require(_0xec8a('0x19'));var dynamics365=require(_0xec8a('0x1a'));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()[_0xec8a('0x1b')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xec8a('0x1b')](_0xec8a('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xec8a('0x1d')]()[_0xec8a('0x1e')](user[_0xec8a('0x1f')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x20')]())[_0xec8a('0x1e')](user[_0xec8a('0x21')]())[_0xec8a('0x1e')](realtime['initTelephones']())[_0xec8a('0x1e')](trunk['getTrunks']())[_0xec8a('0x1e')](realtime[_0xec8a('0x22')]())[_0xec8a('0x1e')](voiceQueue[_0xec8a('0x23')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x24')]())[_0xec8a('0x1e')](trigger[_0xec8a('0x25')]())[_0xec8a('0x1e')](realtime['initTriggers']())[_0xec8a('0x1e')](template[_0xec8a('0x26')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x27')]())[_0xec8a('0x1e')](zendesk[_0xec8a('0x28')]())[_0xec8a('0x1e')](realtime['initZendeskAccounts']())[_0xec8a('0x1e')](salesforce[_0xec8a('0x29')]())['then'](realtime['initSalesforceAccounts']())[_0xec8a('0x1e')](sugarcrm[_0xec8a('0x2a')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x2b')]())[_0xec8a('0x1e')](freshdesk[_0xec8a('0x2c')]())['then'](realtime[_0xec8a('0x2d')]())[_0xec8a('0x1e')](desk[_0xec8a('0x2e')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x2f')]())[_0xec8a('0x1e')](zoho['getZohoAccounts']())['then'](realtime[_0xec8a('0x30')]())['then'](vtiger['getVtigerAccounts']())[_0xec8a('0x1e')](realtime['initVtigerAccounts']())[_0xec8a('0x1e')](freshsales[_0xec8a('0x31')]())[_0xec8a('0x1e')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0xec8a('0x32')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x33')]())[_0xec8a('0x1e')](dynamics365['getDynamics365Accounts']())[_0xec8a('0x1e')](realtime['initDynamics365Accounts']())['then'](campaign['getCampaigns']())[_0xec8a('0x1e')](realtime[_0xec8a('0x34')]())[_0xec8a('0x1e')](voiceExtension[_0xec8a('0x35')]())['then'](realtime['initVoiceExtensions']())[_0xec8a('0x1e')](faxAccount[_0xec8a('0x36')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x37')]())[_0xec8a('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0xec8a('0x1d')]()[_0xec8a('0x1e')](voiceQueueReport[_0xec8a('0x38')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x39')]())[_0xec8a('0x1e')](cmHopperHistory[_0xec8a('0x3a')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x3b')]())[_0xec8a('0x1e')](cmHopperHistory[_0xec8a('0x3c')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x3d')]())[_0xec8a('0x1e')](voiceCallReport[_0xec8a('0x3e')]())[_0xec8a('0x1e')](realtime[_0xec8a('0x3f')]())[_0xec8a('0x1e')](function(_0x4d62f5){})[_0xec8a('0x40')](function(_0x51035d){console['log'](_0x51035d);});}function main(){return server[_0xec8a('0x41')](realtime,preview,fax)[_0xec8a('0x1e')](function(_0x92ef40){return initRealtime();})[_0xec8a('0x1e')](function(){return initParams();})[_0xec8a('0x1e')](function(){report[_0xec8a('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x44aea9){console[_0xec8a('0x43')](_0x44aea9);});}main();
\ No newline at end of file
index b396207..8836d55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3b8a3e,_0x45eb72){var _0x48b494=function(_0x4ed3c2){while(--_0x4ed3c2){_0x3b8a3e['push'](_0x3b8a3e['shift']());}};_0x48b494(++_0x45eb72);}(_0x34e8,0x12c));var _0x834e=function(_0x5b4078,_0x4993e1){_0x5b4078=_0x5b4078-0x0;var _0x429fa8=_0x34e8[_0x5b4078];return _0x429fa8;};'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
+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(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xedd9,0xfc));var _0x9edd=function(_0x35bad0,_0x21927d){_0x35bad0=_0x35bad0-0x0;var _0x4fe50f=_0xedd9[_0x35bad0];return _0x4fe50f;};'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
index 82ff44a..7f8a15f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7071=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x7071,0x125));var _0x1707=function(_0x333305,_0x383917){_0x333305=_0x333305-0x0;var _0x144c1d=_0x7071[_0x333305];return _0x144c1d;};'use strict';function Campaign(_0x45796f){this['id']=_0x45796f['id']||0x0;this[_0x1707('0x0')]=_0x45796f[_0x1707('0x0')]||'';this['type']=_0x45796f[_0x1707('0x1')]||_0x1707('0x2');this[_0x1707('0x3')]=0x0;this[_0x1707('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x1707('0x5')]=0x0;this[_0x1707('0x6')]='';this[_0x1707('0x7')]=!![];this[_0x1707('0x8')]=_0x45796f[_0x1707('0x8')];this[_0x1707('0x9')]=_0x45796f[_0x1707('0x9')];this[_0x1707('0xa')]=_0x45796f[_0x1707('0xa')]||null;this['dialGlobalInterval']=_0x45796f[_0x1707('0xb')]?_0x45796f[_0x1707('0xb')]:null;this[_0x1707('0xc')]=_0x45796f[_0x1707('0xc')];this[_0x1707('0xd')]=_0x45796f[_0x1707('0xd')];this[_0x1707('0xe')]=_0x45796f['dialOriginateTimeout']||0x1e;this[_0x1707('0xf')]=_0x45796f[_0x1707('0xf')];this[_0x1707('0x10')]=_0x45796f['dialCongestionRetryFrequency'];this[_0x1707('0x11')]=_0x45796f['dialBusyMaxRetry'];this[_0x1707('0x12')]=_0x45796f[_0x1707('0x12')];this['dialNoAnswerMaxRetry']=_0x45796f[_0x1707('0x13')];this[_0x1707('0x14')]=_0x45796f[_0x1707('0x14')];this['dialGlobalMaxRetry']=_0x45796f['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x45796f[_0x1707('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x45796f[_0x1707('0x16')]||0x96;this[_0x1707('0x17')]=_0x45796f[_0x1707('0x17')]||0x3;this[_0x1707('0x18')]=_0x45796f[_0x1707('0x18')]||0x96;this[_0x1707('0x19')]=_0x45796f['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x45796f[_0x1707('0x1a')]||0x96;this[_0x1707('0x1b')]=_0x45796f[_0x1707('0x1b')]||0x3;this[_0x1707('0x1c')]=_0x45796f[_0x1707('0x1c')]||0x96;this[_0x1707('0x1d')]=_0x45796f['dialAgentRejectMaxRetry']||0x3;this[_0x1707('0x1e')]=_0x45796f[_0x1707('0x1e')]||0x96;this['dialOrderByScheduledAt']=_0x45796f[_0x1707('0x1f')]||'DESC';this[_0x1707('0x20')]=_0x45796f['dialPrefix']||undefined;this[_0x1707('0x21')]=_0x45796f[_0x1707('0x21')]||undefined;this['dialCutDigit']=_0x45796f['dialCutDigit']||undefined;this['TrunkBackup']=_0x45796f[_0x1707('0x22')]?_0x45796f['TrunkBackup']:undefined;this['Trunk']=_0x45796f[_0x1707('0x23')]?_0x45796f[_0x1707('0x23')]:undefined;this[_0x1707('0x24')]=_0x45796f[_0x1707('0x24')]?_0x45796f[_0x1707('0x24')]:undefined;this[_0x1707('0x25')]=_0x45796f[_0x1707('0x25')]?_0x45796f[_0x1707('0x25')]:undefined;this['dialQueueProject']=_0x45796f['SquareProject']?_0x45796f[_0x1707('0x25')][_0x1707('0x0')]:undefined;this[_0x1707('0x26')]=_0x45796f[_0x1707('0x26')]||![];this[_0x1707('0x27')]=_0x45796f[_0x1707('0x27')];this['dialAMDGreeting']=_0x45796f[_0x1707('0x28')];this[_0x1707('0x29')]=_0x45796f[_0x1707('0x29')];this['dialAMDTotalAnalysisTime']=_0x45796f['dialAMDTotalAnalysisTime'];this[_0x1707('0x2a')]=_0x45796f[_0x1707('0x2a')];this['dialAMDBetweenWordsSilence']=_0x45796f[_0x1707('0x2b')];this[_0x1707('0x2c')]=_0x45796f[_0x1707('0x2c')];this[_0x1707('0x2d')]=_0x45796f[_0x1707('0x2d')];this['dialAMDMaximumWordLength']=_0x45796f[_0x1707('0x2e')];}module[_0x1707('0x2f')]=Campaign;
\ No newline at end of file
+var _0x682b=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x4da3b6,_0x233aff){var _0x574d38=function(_0x4fa45b){while(--_0x4fa45b){_0x4da3b6['push'](_0x4da3b6['shift']());}};_0x574d38(++_0x233aff);}(_0x682b,0x7d));var _0xb682=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x682b[_0x4b7895];return _0x264180;};'use strict';function Campaign(_0xfddbb7){this['id']=_0xfddbb7['id']||0x0;this['name']=_0xfddbb7['name']||'';this[_0xb682('0x0')]=_0xfddbb7['type']||_0xb682('0x1');this[_0xb682('0x2')]=0x0;this[_0xb682('0x3')]=0x0;this[_0xb682('0x4')]=0x0;this[_0xb682('0x5')]=0x0;this[_0xb682('0x6')]='';this['sendMessageOneNotActive']=!![];this['active']=_0xfddbb7[_0xb682('0x7')];this[_0xb682('0x8')]=_0xfddbb7[_0xb682('0x8')];this[_0xb682('0x9')]=_0xfddbb7[_0xb682('0x9')]||null;this[_0xb682('0xa')]=_0xfddbb7[_0xb682('0xa')]?_0xfddbb7[_0xb682('0xa')]:null;this[_0xb682('0xb')]=_0xfddbb7[_0xb682('0xb')];this['dialOriginateCallerIdNumber']=_0xfddbb7[_0xb682('0xc')];this['dialOriginateTimeout']=_0xfddbb7['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0xfddbb7[_0xb682('0xd')];this[_0xb682('0xe')]=_0xfddbb7[_0xb682('0xe')];this[_0xb682('0xf')]=_0xfddbb7[_0xb682('0xf')];this['dialBusyRetryFrequency']=_0xfddbb7[_0xb682('0x10')];this[_0xb682('0x11')]=_0xfddbb7[_0xb682('0x11')];this[_0xb682('0x12')]=_0xfddbb7[_0xb682('0x12')];this['dialGlobalMaxRetry']=_0xfddbb7[_0xb682('0x13')];this[_0xb682('0x14')]=_0xfddbb7[_0xb682('0x14')]||0x3;this[_0xb682('0x15')]=_0xfddbb7[_0xb682('0x15')]||0x96;this[_0xb682('0x16')]=_0xfddbb7[_0xb682('0x16')]||0x3;this[_0xb682('0x17')]=_0xfddbb7[_0xb682('0x17')]||0x96;this[_0xb682('0x18')]=_0xfddbb7[_0xb682('0x18')]||0x3;this[_0xb682('0x19')]=_0xfddbb7[_0xb682('0x19')]||0x96;this[_0xb682('0x1a')]=_0xfddbb7[_0xb682('0x1a')]||0x3;this[_0xb682('0x1b')]=_0xfddbb7[_0xb682('0x1b')]||0x96;this[_0xb682('0x1c')]=_0xfddbb7[_0xb682('0x1c')]||0x3;this[_0xb682('0x1d')]=_0xfddbb7['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0xfddbb7[_0xb682('0x1e')]||'DESC';this[_0xb682('0x1f')]=_0xfddbb7[_0xb682('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0xfddbb7[_0xb682('0x20')]||undefined;this[_0xb682('0x21')]=_0xfddbb7[_0xb682('0x21')]||undefined;this[_0xb682('0x22')]=_0xfddbb7[_0xb682('0x22')]?_0xfddbb7[_0xb682('0x22')]:undefined;this['Trunk']=_0xfddbb7[_0xb682('0x23')]?_0xfddbb7[_0xb682('0x23')]:undefined;this[_0xb682('0x24')]=_0xfddbb7['Interval']?_0xfddbb7['Interval']:undefined;this[_0xb682('0x25')]=_0xfddbb7['SquareProject']?_0xfddbb7[_0xb682('0x25')]:undefined;this['dialQueueProject']=_0xfddbb7[_0xb682('0x25')]?_0xfddbb7[_0xb682('0x25')][_0xb682('0x26')]:undefined;this[_0xb682('0x27')]=_0xfddbb7[_0xb682('0x27')]||![];this[_0xb682('0x28')]=_0xfddbb7[_0xb682('0x28')];this[_0xb682('0x29')]=_0xfddbb7[_0xb682('0x29')];this[_0xb682('0x2a')]=_0xfddbb7[_0xb682('0x2a')];this['dialAMDTotalAnalysisTime']=_0xfddbb7[_0xb682('0x2b')];this[_0xb682('0x2c')]=_0xfddbb7['dialAMDMinWordLength'];this[_0xb682('0x2d')]=_0xfddbb7['dialAMDBetweenWordsSilence'];this[_0xb682('0x2e')]=_0xfddbb7[_0xb682('0x2e')];this[_0xb682('0x2f')]=_0xfddbb7[_0xb682('0x2f')];this[_0xb682('0x30')]=_0xfddbb7[_0xb682('0x30')];}module[_0xb682('0x31')]=Campaign;
\ No newline at end of file
index ac852a2..8555d17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fe5=['accountcode','context','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','disposition','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','calleridname','connectedlinenum','connectedlinename'];(function(_0x32e00b,_0x3ca6df){var _0x50bb50=function(_0x1c4557){while(--_0x1c4557){_0x32e00b['push'](_0x32e00b['shift']());}};_0x50bb50(++_0x3ca6df);}(_0x2fe5,0x14b));var _0x52fe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2fe5[_0x122ef9];return _0x42fba0;};'use strict';function Channel(){this[_0x52fe('0x0')]=null;this[_0x52fe('0x1')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0x52fe('0x2')]='';this[_0x52fe('0x3')]=undefined;this[_0x52fe('0x4')]=undefined;this[_0x52fe('0x5')]=0x0;this[_0x52fe('0x6')]='';this['uniqueid']=0x0;this[_0x52fe('0x7')]=0x0;this[_0x52fe('0x8')]=0x0;this['answered']=![];this[_0x52fe('0x9')]=null;this[_0x52fe('0xa')]=null;this[_0x52fe('0xb')]=![];this[_0x52fe('0xc')]=![];this[_0x52fe('0xd')]='';this['lastdata']='';this[_0x52fe('0xe')]=0x0;this[_0x52fe('0xf')]=0x0;this[_0x52fe('0x10')]=0x0;this['type']=null;this['tag']=null;this[_0x52fe('0x11')]=null;this[_0x52fe('0x12')]=![];this['monitorFilename']=null;this[_0x52fe('0x13')]=null;this[_0x52fe('0x14')]=[];this[_0x52fe('0x15')]=undefined;this[_0x52fe('0x16')]=undefined;this['transferType']=undefined;this[_0x52fe('0x17')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x78e7=['answertime','endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','mohtime','channel','destinationchannel','calleridname','connectedlinename','accountcode','context','uniqueid','exten','answered'];(function(_0xcc1811,_0x5b9a54){var _0x3ab8a0=function(_0x10d6b0){while(--_0x10d6b0){_0xcc1811['push'](_0xcc1811['shift']());}};_0x3ab8a0(++_0x5b9a54);}(_0x78e7,0x17d));var _0x778e=function(_0x41c84a,_0x503802){_0x41c84a=_0x41c84a-0x0;var _0x5c2869=_0x78e7[_0x41c84a];return _0x5c2869;};'use strict';function Channel(){this['starttime']=null;this[_0x778e('0x0')]='';this[_0x778e('0x1')]='';this['calleridnum']=0x0;this[_0x778e('0x2')]='';this['connectedlinenum']=undefined;this[_0x778e('0x3')]=undefined;this[_0x778e('0x4')]=0x0;this[_0x778e('0x5')]='';this[_0x778e('0x6')]=0x0;this['linkedid']=0x0;this[_0x778e('0x7')]=0x0;this[_0x778e('0x8')]=![];this[_0x778e('0x9')]=null;this[_0x778e('0xa')]=null;this[_0x778e('0xb')]=![];this[_0x778e('0xc')]=![];this[_0x778e('0xd')]='';this['lastdata']='';this[_0x778e('0xe')]=0x0;this[_0x778e('0xf')]=0x0;this[_0x778e('0x10')]=0x0;this[_0x778e('0x11')]=null;this[_0x778e('0x12')]=null;this[_0x778e('0x13')]=null;this[_0x778e('0x14')]=![];this[_0x778e('0x15')]=null;this[_0x778e('0x16')]=null;this[_0x778e('0x17')]=[];this[_0x778e('0x18')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this[_0x778e('0x19')]=0x0;}module['exports']=Channel;
\ No newline at end of file
index 967ca84..154a997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef02=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x3331a8,_0x4b106e){var _0x3ca8b5=function(_0x204ee2){while(--_0x204ee2){_0x3331a8['push'](_0x3331a8['shift']());}};_0x3ca8b5(++_0x4b106e);}(_0xef02,0x107));var _0x2ef0=function(_0x44e00a,_0x248bbc){_0x44e00a=_0x44e00a-0x0;var _0x2bdfba=_0xef02[_0x44e00a];return _0x2bdfba;};'use strict';function DeskAccount(_0x4ee01f){this['id']=_0x4ee01f['id']||0x0;this[_0x2ef0('0x0')]=_0x4ee01f[_0x2ef0('0x0')]||'';this['username']=_0x4ee01f['username']||'';this['remoteUri']=_0x4ee01f[_0x2ef0('0x1')]||'';this[_0x2ef0('0x2')]=_0x4ee01f[_0x2ef0('0x2')]||'';this[_0x2ef0('0x3')]=_0x4ee01f[_0x2ef0('0x3')]||'';this[_0x2ef0('0x4')]=_0x4ee01f[_0x2ef0('0x4')]||'';this[_0x2ef0('0x5')]=_0x4ee01f['consumerSecret']||'';this['token']=_0x4ee01f[_0x2ef0('0x6')]||'';this[_0x2ef0('0x7')]=_0x4ee01f[_0x2ef0('0x7')]||'';this[_0x2ef0('0x8')]=_0x4ee01f[_0x2ef0('0x8')]||'';this['serverUrl']=_0x4ee01f[_0x2ef0('0x9')]||'';this[_0x2ef0('0xa')]=_0x4ee01f['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x2022=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl','name'];(function(_0x569f5f,_0x1c6c5c){var _0x3e8e2e=function(_0x46344f){while(--_0x46344f){_0x569f5f['push'](_0x569f5f['shift']());}};_0x3e8e2e(++_0x1c6c5c);}(_0x2022,0xe5));var _0x2202=function(_0x1c22ac,_0x4c86bd){_0x1c22ac=_0x1c22ac-0x0;var _0x4c867a=_0x2022[_0x1c22ac];return _0x4c867a;};'use strict';function DeskAccount(_0x354335){this['id']=_0x354335['id']||0x0;this[_0x2202('0x0')]=_0x354335[_0x2202('0x0')]||'';this['username']=_0x354335[_0x2202('0x1')]||'';this['remoteUri']=_0x354335[_0x2202('0x2')]||'';this[_0x2202('0x3')]=_0x354335[_0x2202('0x3')]||'';this[_0x2202('0x4')]=_0x354335[_0x2202('0x4')]||'';this['consumerKey']=_0x354335[_0x2202('0x5')]||'';this[_0x2202('0x6')]=_0x354335[_0x2202('0x6')]||'';this[_0x2202('0x7')]=_0x354335[_0x2202('0x7')]||'';this[_0x2202('0x8')]=_0x354335[_0x2202('0x8')]||'';this['type']=_0x354335['type']||'';this[_0x2202('0x9')]=_0x354335['serverUrl']||'';this['Configurations']=_0x354335['Configurations']||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 7a7736b..03d1da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password'];(function(_0x163c77,_0xa83831){var _0x4fd32e=function(_0xf572fb){while(--_0xf572fb){_0x163c77['push'](_0x163c77['shift']());}};_0x4fd32e(++_0xa83831);}(_0xb58b,0x1f1));var _0xbb58=function(_0x1f0c96,_0x34079d){_0x1f0c96=_0x1f0c96-0x0;var _0x2c866b=_0xb58b[_0x1f0c96];return _0x2c866b;};'use strict';function Dynamics365Account(_0x250573){this['id']=_0x250573['id']||0x0;this[_0xbb58('0x0')]=_0x250573[_0xbb58('0x0')]||'';this[_0xbb58('0x1')]=_0x250573['username']||'';this[_0xbb58('0x2')]=_0x250573[_0xbb58('0x2')]||'';this['remoteUri']=_0x250573[_0xbb58('0x3')]||'';this['tenantId']=_0x250573[_0xbb58('0x4')]||'';this[_0xbb58('0x5')]=_0x250573[_0xbb58('0x5')]||'';this['clientSecret']=_0x250573[_0xbb58('0x6')]||{};this[_0xbb58('0x7')]=_0x250573[_0xbb58('0x7')]||'';this[_0xbb58('0x8')]=_0x250573[_0xbb58('0x8')]||{};}module[_0xbb58('0x9')]=Dynamics365Account;
\ No newline at end of file
+var _0xcb91=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x1bbefb,_0x17e79d){var _0x54c6ef=function(_0x3e7f2a){while(--_0x3e7f2a){_0x1bbefb['push'](_0x1bbefb['shift']());}};_0x54c6ef(++_0x17e79d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xcb91[_0x5d6c3e];return _0x44ecb7;};'use strict';function Dynamics365Account(_0x181cac){this['id']=_0x181cac['id']||0x0;this['name']=_0x181cac[_0x1cb9('0x0')]||'';this[_0x1cb9('0x1')]=_0x181cac[_0x1cb9('0x1')]||'';this[_0x1cb9('0x2')]=_0x181cac['password']||'';this[_0x1cb9('0x3')]=_0x181cac[_0x1cb9('0x3')]||'';this['tenantId']=_0x181cac[_0x1cb9('0x4')]||'';this[_0x1cb9('0x5')]=_0x181cac['clientId']||'';this[_0x1cb9('0x6')]=_0x181cac[_0x1cb9('0x6')]||{};this['serverUrl']=_0x181cac[_0x1cb9('0x7')]||'';this[_0x1cb9('0x8')]=_0x181cac['Configurations']||{};}module[_0x1cb9('0x9')]=Dynamics365Account;
\ No newline at end of file
index a992d43..77424b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x508c=['v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate','modem'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x508c,0xd9));var _0xc508=function(_0x2bb067,_0x30dcb9){_0x2bb067=_0x2bb067-0x0;var _0x65d9a3=_0x508c[_0x2bb067];return _0x65d9a3;};'use strict';function FaxAccount(_0x3661e1){this['id']=_0x3661e1['id']||0x0;this[_0xc508('0x0')]=_0x3661e1[_0xc508('0x0')]||'';this['description']=_0x3661e1[_0xc508('0x1')];this[_0xc508('0x2')]=_0x3661e1['ecm'];this['headerinfo']=_0x3661e1['headerinfo'];this[_0xc508('0x3')]=_0x3661e1[_0xc508('0x3')];this[_0xc508('0x4')]=_0x3661e1[_0xc508('0x4')]||0x960;this['maxrate']=_0x3661e1[_0xc508('0x5')]||0x3840;this[_0xc508('0x6')]=_0x3661e1[_0xc508('0x6')]||_0xc508('0x7');this[_0xc508('0x8')]=_0x3661e1['gateway']||'no';this[_0xc508('0x9')]=_0x3661e1[_0xc508('0x9')]||'no';this[_0xc508('0xa')]=_0x3661e1[_0xc508('0xa')]||0x1388;this['tech']=_0x3661e1['tech']||_0xc508('0xb');this[_0xc508('0xc')]=_0x3661e1[_0xc508('0xc')]?_0x3661e1['Trunk']:undefined;this['ListId']=_0x3661e1[_0xc508('0xd')];this[_0xc508('0xe')]=_0x3661e1[_0xc508('0xe')];}module[_0xc508('0xf')]=FaxAccount;
\ No newline at end of file
+var _0xa8c8=['v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','modem'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa8c8,0x8f));var _0x8a8c=function(_0x589c5e,_0x3fa237){_0x589c5e=_0x589c5e-0x0;var _0x5e8102=_0xa8c8[_0x589c5e];return _0x5e8102;};'use strict';function FaxAccount(_0x5695a7){this['id']=_0x5695a7['id']||0x0;this[_0x8a8c('0x0')]=_0x5695a7[_0x8a8c('0x0')]||'';this[_0x8a8c('0x1')]=_0x5695a7[_0x8a8c('0x1')];this[_0x8a8c('0x2')]=_0x5695a7[_0x8a8c('0x2')];this[_0x8a8c('0x3')]=_0x5695a7['headerinfo'];this[_0x8a8c('0x4')]=_0x5695a7[_0x8a8c('0x4')];this[_0x8a8c('0x5')]=_0x5695a7[_0x8a8c('0x5')]||0x960;this['maxrate']=_0x5695a7['maxrate']||0x3840;this[_0x8a8c('0x6')]=_0x5695a7[_0x8a8c('0x6')]||_0x8a8c('0x7');this['gateway']=_0x5695a7[_0x8a8c('0x8')]||'no';this['faxdetect']=_0x5695a7[_0x8a8c('0x9')]||'no';this[_0x8a8c('0xa')]=_0x5695a7[_0x8a8c('0xa')]||0x1388;this['tech']=_0x5695a7['tech']||_0x8a8c('0xb');this[_0x8a8c('0xc')]=_0x5695a7['Trunk']?_0x5695a7[_0x8a8c('0xc')]:undefined;this[_0x8a8c('0xd')]=_0x5695a7[_0x8a8c('0xd')];this[_0x8a8c('0xe')]=_0x5695a7[_0x8a8c('0xe')];}module['exports']=FaxAccount;
\ No newline at end of file
index 75842b1..8c09de6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf87a=['Configurations','name','username','token','serverUrl'];(function(_0x389ab3,_0x2f07cf){var _0x395edb=function(_0x5006a2){while(--_0x5006a2){_0x389ab3['push'](_0x389ab3['shift']());}};_0x395edb(++_0x2f07cf);}(_0xf87a,0x11e));var _0xaf87=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf87a[_0x17d9e3];return _0x14192d;};'use strict';function FreshdeskAccount(_0x54090f){this['id']=_0x54090f['id']||0x0;this[_0xaf87('0x0')]=_0x54090f[_0xaf87('0x0')]||'';this[_0xaf87('0x1')]=_0x54090f[_0xaf87('0x1')]||'';this['apiKey']=_0x54090f[_0xaf87('0x2')]||'';this['remoteUri']=_0x54090f['remoteUri']||'';this[_0xaf87('0x3')]=_0x54090f[_0xaf87('0x3')]||'';this[_0xaf87('0x4')]=_0x54090f['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0x878b=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0x3bc1d7,_0x2cbd54){var _0x1fd8eb=function(_0x54c1e8){while(--_0x54c1e8){_0x3bc1d7['push'](_0x3bc1d7['shift']());}};_0x1fd8eb(++_0x2cbd54);}(_0x878b,0x10e));var _0xb878=function(_0x56ee15,_0x1effd1){_0x56ee15=_0x56ee15-0x0;var _0x94991f=_0x878b[_0x56ee15];return _0x94991f;};'use strict';function FreshdeskAccount(_0x331e88){this['id']=_0x331e88['id']||0x0;this[_0xb878('0x0')]=_0x331e88[_0xb878('0x0')]||'';this[_0xb878('0x1')]=_0x331e88[_0xb878('0x1')]||'';this['apiKey']=_0x331e88[_0xb878('0x2')]||'';this[_0xb878('0x3')]=_0x331e88[_0xb878('0x3')]||'';this[_0xb878('0x4')]=_0x331e88[_0xb878('0x4')]||'';this[_0xb878('0x5')]=_0x331e88[_0xb878('0x5')]||{};}module[_0xb878('0x6')]=FreshdeskAccount;
\ No newline at end of file
index f173250..d2b9bf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56e7=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56e7,0x7b));var _0x756e=function(_0x5e961f,_0x410eac){_0x5e961f=_0x5e961f-0x0;var _0x157371=_0x56e7[_0x5e961f];return _0x157371;};'use strict';function FreshsalesAccount(_0x4ec485){this['id']=_0x4ec485['id']||0x0;this[_0x756e('0x0')]=_0x4ec485[_0x756e('0x0')]||'';this['username']=_0x4ec485[_0x756e('0x1')]||'';this[_0x756e('0x2')]=_0x4ec485[_0x756e('0x3')]||'';this[_0x756e('0x4')]=_0x4ec485[_0x756e('0x4')]||'';this[_0x756e('0x5')]=_0x4ec485[_0x756e('0x5')]||'';this['Configurations']=_0x4ec485[_0x756e('0x6')]||{};}module[_0x756e('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x5162=['token','remoteUri','serverUrl','Configurations','apiKey'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5162,0x103));var _0x2516=function(_0x124ca2,_0x5d5659){_0x124ca2=_0x124ca2-0x0;var _0x329cda=_0x5162[_0x124ca2];return _0x329cda;};'use strict';function FreshsalesAccount(_0x3bac79){this['id']=_0x3bac79['id']||0x0;this['name']=_0x3bac79['name']||'';this['username']=_0x3bac79['username']||'';this[_0x2516('0x0')]=_0x3bac79[_0x2516('0x1')]||'';this[_0x2516('0x2')]=_0x3bac79[_0x2516('0x2')]||'';this[_0x2516('0x3')]=_0x3bac79[_0x2516('0x3')]||'';this[_0x2516('0x4')]=_0x3bac79['Configurations']||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 071c1c0..26e20e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1362=['variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','context','priority','holdtime','assigned','lastAssignedTo'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x1362,0xba));var _0x2136=function(_0xff4d32,_0x355c76){_0xff4d32=_0xff4d32-0x0;var _0x3ee3fd=_0x1362[_0xff4d32];return _0x3ee3fd;};'use strict';function QueueReport(){this[_0x2136('0x0')]=_0x2136('0x1');this[_0x2136('0x2')]='';this['calleridnum']='';this[_0x2136('0x3')]='';this[_0x2136('0x4')]='';this[_0x2136('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x2136('0x6')]=0x1;this[_0x2136('0x7')]=0x1;this[_0x2136('0x8')]=![];this['queuecallerabandonAt']=null;this[_0x2136('0x9')]=![];this[_0x2136('0xa')]=null;this['queuecallerexit']=![];this[_0x2136('0xb')]=null;this[_0x2136('0xc')]=0x1;this[_0x2136('0xd')]='';this[_0x2136('0xe')]='';this[_0x2136('0xf')]='';this['accountcode']='';this[_0x2136('0x10')]='';this['exten']='';this[_0x2136('0x11')]='';this[_0x2136('0x12')]=0x0;this[_0x2136('0x13')]=![];this[_0x2136('0x14')]='';this['mohtime']=0x0;this[_0x2136('0x15')]={};}module[_0x2136('0x16')]=QueueReport;
\ No newline at end of file
+var _0x47fa=['connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','exports','type','inbound','calleridnum','calleridname','queue','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition','connectedlinenum'];(function(_0xcda3c8,_0x268e1c){var _0x316f10=function(_0x51dd80){while(--_0x51dd80){_0xcda3c8['push'](_0xcda3c8['shift']());}};_0x316f10(++_0x268e1c);}(_0x47fa,0x1ad));var _0xa47f=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x47fa[_0x1ab180];return _0xfb2c2d;};'use strict';function QueueReport(){this[_0xa47f('0x0')]=_0xa47f('0x1');this['uniqueid']='';this[_0xa47f('0x2')]='';this[_0xa47f('0x3')]='';this[_0xa47f('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xa47f('0x5')]=0x1;this[_0xa47f('0x6')]=0x1;this['queuecallerabandon']=![];this[_0xa47f('0x7')]=null;this[_0xa47f('0x8')]=![];this[_0xa47f('0x9')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xa47f('0xa')]=0x1;this['channel']='';this[_0xa47f('0xb')]='';this[_0xa47f('0xc')]='';this[_0xa47f('0xd')]='';this['context']='';this[_0xa47f('0xe')]='';this[_0xa47f('0xf')]='';this[_0xa47f('0x10')]=0x0;this[_0xa47f('0x11')]=![];this[_0xa47f('0x12')]='';this[_0xa47f('0x13')]=0x0;this['variables']={};}module[_0xa47f('0x14')]=QueueReport;
\ No newline at end of file
index 6c3aa4a..33a77d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74e0=['remoteUri','password','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0xaca787,_0x41e990){var _0x57d1aa=function(_0xcefb17){while(--_0xcefb17){_0xaca787['push'](_0xaca787['shift']());}};_0x57d1aa(++_0x41e990);}(_0x74e0,0x15e));var _0x074e=function(_0x3cae6c,_0x3d74ba){_0x3cae6c=_0x3cae6c-0x0;var _0x3b7421=_0x74e0[_0x3cae6c];return _0x3b7421;};'use strict';function SalesforceAccount(_0x1e02e2){this['id']=_0x1e02e2['id']||0x0;this[_0x074e('0x0')]=_0x1e02e2['name']||'';this[_0x074e('0x1')]=_0x1e02e2['username']||'';this[_0x074e('0x2')]=_0x1e02e2[_0x074e('0x2')]||'';this[_0x074e('0x3')]=_0x1e02e2[_0x074e('0x3')]||'';this['clientId']=_0x1e02e2['clientId']||'';this['clientSecret']=_0x1e02e2[_0x074e('0x4')]||'';this[_0x074e('0x5')]=_0x1e02e2[_0x074e('0x5')]||'';this[_0x074e('0x6')]=_0x1e02e2[_0x074e('0x6')]||_0x074e('0x7');this[_0x074e('0x8')]=_0x1e02e2['serverUrl']||'';this['Configurations']=_0x1e02e2[_0x074e('0x9')]||{};}module[_0x074e('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0xfaee=['exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations'];(function(_0xfa87f7,_0x3cc23f){var _0x5ed86e=function(_0x3dc05b){while(--_0x3dc05b){_0xfa87f7['push'](_0xfa87f7['shift']());}};_0x5ed86e(++_0x3cc23f);}(_0xfaee,0x15d));var _0xefae=function(_0x2002b3,_0x11e91c){_0x2002b3=_0x2002b3-0x0;var _0x2756f0=_0xfaee[_0x2002b3];return _0x2756f0;};'use strict';function SalesforceAccount(_0x4c4ef9){this['id']=_0x4c4ef9['id']||0x0;this[_0xefae('0x0')]=_0x4c4ef9['name']||'';this[_0xefae('0x1')]=_0x4c4ef9[_0xefae('0x1')]||'';this[_0xefae('0x2')]=_0x4c4ef9[_0xefae('0x2')]||'';this[_0xefae('0x3')]=_0x4c4ef9[_0xefae('0x3')]||'';this[_0xefae('0x4')]=_0x4c4ef9[_0xefae('0x4')]||'';this[_0xefae('0x5')]=_0x4c4ef9[_0xefae('0x5')]||'';this['securityToken']=_0x4c4ef9[_0xefae('0x6')]||'';this[_0xefae('0x7')]=_0x4c4ef9[_0xefae('0x7')]||_0xefae('0x8');this[_0xefae('0x9')]=_0x4c4ef9['serverUrl']||'';this[_0xefae('0xa')]=_0x4c4ef9[_0xefae('0xa')]||{};}module[_0xefae('0xb')]=SalesforceAccount;
\ No newline at end of file
index 7ab8d23..a4fd181 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd5c=['password','remoteUri','serverUrl','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd5c,0xdf));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x46050f){this['id']=_0x46050f['id']||0x0;this['name']=_0x46050f[_0xcfd5('0x0')]||'';this[_0xcfd5('0x1')]=_0x46050f['username']||'';this[_0xcfd5('0x2')]=_0x46050f[_0xcfd5('0x2')]||'';this[_0xcfd5('0x3')]=_0x46050f[_0xcfd5('0x3')]||'';this[_0xcfd5('0x4')]=_0x46050f['serverUrl']||'';this['Configurations']=_0x46050f['Configurations']||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0xaa22=['serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0x5ad0e1,_0x2466be){var _0x355c7b=function(_0x303667){while(--_0x303667){_0x5ad0e1['push'](_0x5ad0e1['shift']());}};_0x355c7b(++_0x2466be);}(_0xaa22,0x15f));var _0x2aa2=function(_0x2904f2,_0x3001ad){_0x2904f2=_0x2904f2-0x0;var _0x17936d=_0xaa22[_0x2904f2];return _0x17936d;};'use strict';function ServicenowAccount(_0x4b9f11){this['id']=_0x4b9f11['id']||0x0;this['name']=_0x4b9f11['name']||'';this['username']=_0x4b9f11[_0x2aa2('0x0')]||'';this[_0x2aa2('0x1')]=_0x4b9f11[_0x2aa2('0x1')]||'';this[_0x2aa2('0x2')]=_0x4b9f11[_0x2aa2('0x2')]||'';this[_0x2aa2('0x3')]=_0x4b9f11['serverUrl']||'';this[_0x2aa2('0x4')]=_0x4b9f11[_0x2aa2('0x4')]||{};}module[_0x2aa2('0x5')]=ServicenowAccount;
\ No newline at end of file
index 93cd880..30c424d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c3=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x1c7bcd,_0x478875){var _0x554320=function(_0x1acb8d){while(--_0x1acb8d){_0x1c7bcd['push'](_0x1c7bcd['shift']());}};_0x554320(++_0x478875);}(_0x81c3,0xd2));var _0x381c=function(_0x5ca96d,_0x3456e0){_0x5ca96d=_0x5ca96d-0x0;var _0x19c941=_0x81c3[_0x5ca96d];return _0x19c941;};'use strict';function SugarcrmAccount(_0x4cd7b0){this['id']=_0x4cd7b0['id']||0x0;this[_0x381c('0x0')]=_0x4cd7b0[_0x381c('0x0')]||'';this['username']=_0x4cd7b0[_0x381c('0x1')]||'';this[_0x381c('0x2')]=_0x4cd7b0['password']||'';this['remoteUri']=_0x4cd7b0[_0x381c('0x3')]||'';this[_0x381c('0x4')]=_0x4cd7b0['serverUrl']||'';this[_0x381c('0x5')]=_0x4cd7b0[_0x381c('0x5')]||{};}module[_0x381c('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x3e58=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5076e3,_0x500ef4){var _0x3c973c=function(_0x5ee0cf){while(--_0x5ee0cf){_0x5076e3['push'](_0x5076e3['shift']());}};_0x3c973c(++_0x500ef4);}(_0x3e58,0x16a));var _0x83e5=function(_0x29733c,_0x2da30b){_0x29733c=_0x29733c-0x0;var _0x49e72f=_0x3e58[_0x29733c];return _0x49e72f;};'use strict';function SugarcrmAccount(_0x39b21b){this['id']=_0x39b21b['id']||0x0;this[_0x83e5('0x0')]=_0x39b21b[_0x83e5('0x0')]||'';this[_0x83e5('0x1')]=_0x39b21b['username']||'';this[_0x83e5('0x2')]=_0x39b21b[_0x83e5('0x2')]||'';this[_0x83e5('0x3')]=_0x39b21b[_0x83e5('0x3')]||'';this[_0x83e5('0x4')]=_0x39b21b[_0x83e5('0x4')]||'';this[_0x83e5('0x5')]=_0x39b21b[_0x83e5('0x5')]||{};}module[_0x83e5('0x6')]=SugarcrmAccount;
\ No newline at end of file
index bd21d0d..cb31ec8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83e1=['accountcode','state','status','unknown','name'];(function(_0xd704ff,_0xa009f1){var _0x4484b9=function(_0x1282c1){while(--_0x1282c1){_0xd704ff['push'](_0xd704ff['shift']());}};_0x4484b9(++_0xa009f1);}(_0x83e1,0x1ad));var _0x183e=function(_0x35a6f8,_0x2a19d0){_0x35a6f8=_0x35a6f8-0x0;var _0x11d2da=_0x83e1[_0x35a6f8];return _0x11d2da;};'use strict';function Telephone(_0x4d037e){this['id']=_0x4d037e['id']||0x0;this[_0x183e('0x0')]=_0x4d037e['name']||'';this[_0x183e('0x1')]=_0x4d037e['accountcode']||'';this[_0x183e('0x2')]='unknown';this['stateTime']=0x0;this[_0x183e('0x3')]=_0x183e('0x4');this['address']='';}module['exports']=Telephone;
\ No newline at end of file
+var _0x4c0e=['status','address','name','accountcode','state','unknown','stateTime'];(function(_0xd88cfa,_0x234dcd){var _0x1a4edf=function(_0x28cff9){while(--_0x28cff9){_0xd88cfa['push'](_0xd88cfa['shift']());}};_0x1a4edf(++_0x234dcd);}(_0x4c0e,0x128));var _0xe4c0=function(_0x5bf840,_0x9fc2ab){_0x5bf840=_0x5bf840-0x0;var _0x4f4355=_0x4c0e[_0x5bf840];return _0x4f4355;};'use strict';function Telephone(_0xfbb107){this['id']=_0xfbb107['id']||0x0;this[_0xe4c0('0x0')]=_0xfbb107[_0xe4c0('0x0')]||'';this[_0xe4c0('0x1')]=_0xfbb107[_0xe4c0('0x1')]||'';this[_0xe4c0('0x2')]=_0xe4c0('0x3');this[_0xe4c0('0x4')]=0x0;this[_0xe4c0('0x5')]='unknown';this[_0xe4c0('0x6')]='';}module['exports']=Telephone;
\ No newline at end of file
index b06ac05..23b425a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x57a648,_0x177b1c){var _0x412913=function(_0x52c49e){while(--_0x52c49e){_0x57a648['push'](_0x57a648['shift']());}};_0x412913(++_0x177b1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x547851,_0x1940b8){var _0x1c3772=function(_0x3fc1e7){while(--_0x3fc1e7){_0x547851['push'](_0x547851['shift']());}};_0x1c3772(++_0x1940b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x3bd2c8,_0x395b96){_0x3bd2c8=_0x3bd2c8-0x0;var _0x25374f=_0xb10b[_0x3bd2c8];return _0x25374f;};'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 bc484e5..67c6fed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x334f4e,_0x4a4184){var _0x8a956f=function(_0x1844fd){while(--_0x1844fd){_0x334f4e['push'](_0x334f4e['shift']());}};_0x8a956f(++_0x4a4184);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1c70e6,_0x45a51b){_0x1c70e6=_0x1c70e6-0x0;var _0x18a528=_0x9ffd[_0x1c70e6];return _0x18a528;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger;
\ No newline at end of file
+var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x5eb8,0xb0));var _0x85eb=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0x5eb8[_0x50148e];return _0x446e9d;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
index 73332ce..ab44bba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf733=['indexOf','split','host','port','domain','domainport','refresh','stateRegistry','defaultuser','exports','active','state','unknown','registry'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0xf733,0x1d8));var _0x3f73=function(_0x5ab602,_0x5bb797){_0x5ab602=_0x5ab602-0x0;var _0x3b7a08=_0xf733[_0x5ab602];return _0x3b7a08;};'use strict';function Trunk(_0x70a2cd){this['id']=_0x70a2cd['id']||0x0;this['active']=_0x70a2cd[_0x3f73('0x0')]||![];this['name']=_0x70a2cd['name']||'';this[_0x3f73('0x1')]=_0x3f73('0x2');this['stateTime']=0x0;this['status']='unknown';this['registry']=_0x70a2cd[_0x3f73('0x3')]&&_0x70a2cd[_0x3f73('0x3')][_0x3f73('0x4')](':')?_0x70a2cd[_0x3f73('0x3')][_0x3f73('0x5')](':')[0x0]:'';this[_0x3f73('0x6')]='';this[_0x3f73('0x7')]='';this[_0x3f73('0x8')]='';this[_0x3f73('0x9')]='';this[_0x3f73('0xa')]='';this[_0x3f73('0xb')]=_0x3f73('0x2');this['registrationtime']='';this['address']='';this[_0x3f73('0xc')]=_0x70a2cd[_0x3f73('0xc')]||'';}module[_0x3f73('0xd')]=Trunk;
\ No newline at end of file
+var _0x6059=['port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','host'];(function(_0x3d3a9a,_0xb4e2aa){var _0x2fe9a5=function(_0x1870f1){while(--_0x1870f1){_0x3d3a9a['push'](_0x3d3a9a['shift']());}};_0x2fe9a5(++_0xb4e2aa);}(_0x6059,0x105));var _0x9605=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x6059[_0x341e0f];return _0x59555a;};'use strict';function Trunk(_0x49392d){this['id']=_0x49392d['id']||0x0;this[_0x9605('0x0')]=_0x49392d[_0x9605('0x0')]||![];this['name']=_0x49392d[_0x9605('0x1')]||'';this[_0x9605('0x2')]=_0x9605('0x3');this[_0x9605('0x4')]=0x0;this[_0x9605('0x5')]=_0x9605('0x3');this[_0x9605('0x6')]=_0x49392d['registry']&&_0x49392d['registry'][_0x9605('0x7')](':')?_0x49392d['registry']['split'](':')[0x0]:'';this[_0x9605('0x8')]='';this[_0x9605('0x9')]='';this[_0x9605('0xa')]='';this[_0x9605('0xb')]='';this[_0x9605('0xc')]='';this[_0x9605('0xd')]=_0x9605('0x3');this[_0x9605('0xe')]='';this[_0x9605('0xf')]='';this['defaultuser']=_0x49392d[_0x9605('0x10')]||'';}module[_0x9605('0x11')]=Trunk;
\ No newline at end of file
index e764fd1..379787e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7347=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x3a3a08,_0x58c9d8){var _0x4963a3=function(_0x3b2466){while(--_0x3b2466){_0x3a3a08['push'](_0x3a3a08['shift']());}};_0x4963a3(++_0x58c9d8);}(_0x7347,0x75));var _0x7734=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7347[_0x2c7618];return _0x5ce3f0;};'use strict';function voiceExtension(_0x3e8baa){this['id']=_0x3e8baa['id']||0x0;this[_0x7734('0x0')]=_0x3e8baa[_0x7734('0x0')]||'';this['recordingFormat']=_0x3e8baa[_0x7734('0x1')]||_0x7734('0x2');this[_0x7734('0x3')]=_0x3e8baa[_0x7734('0x3')]||![];}module[_0x7734('0x4')]=voiceExtension;
\ No newline at end of file
+var _0xcb54=['recordingFormat','exports','exten'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xcb54,0x17c));var _0x4cb5=function(_0x581b3d,_0x2abaed){_0x581b3d=_0x581b3d-0x0;var _0x109224=_0xcb54[_0x581b3d];return _0x109224;};'use strict';function voiceExtension(_0x22a737){this['id']=_0x22a737['id']||0x0;this['exten']=_0x22a737[_0x4cb5('0x0')]||'';this[_0x4cb5('0x1')]=_0x22a737[_0x4cb5('0x1')]||'none';this['mandatoryDisposition']=_0x22a737['mandatoryDisposition']||![];}module[_0x4cb5('0x2')]=voiceExtension;
\ No newline at end of file
index 134289e..9db8305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0fe=['acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','answered','sumDuration','sumHoldTime','unmanaged','loggedIn','available'];(function(_0x176e76,_0x410a54){var _0x317f7e=function(_0x48e049){while(--_0x48e049){_0x176e76['push'](_0x176e76['shift']());}};_0x317f7e(++_0x410a54);}(_0xb0fe,0xd2));var _0xeb0f=function(_0x577077,_0x52f056){_0x577077=_0x577077-0x0;var _0x370769=_0xb0fe[_0x577077];return _0x370769;};'use strict';var statusDesc=['unknown',_0xeb0f('0x0'),_0xeb0f('0x1'),_0xeb0f('0x2'),_0xeb0f('0x3'),_0xeb0f('0x4'),_0xeb0f('0x5'),_0xeb0f('0x6'),'onhold'];var monitorFormat={'wav':_0xeb0f('0x7'),'wav49':_0xeb0f('0x8'),'gsm':_0xeb0f('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xeb0f('0xa')};function VoiceQueue(_0x3a19cb){this['id']=_0x3a19cb['id']||0x0;this[_0xeb0f('0xb')]=_0x3a19cb[_0xeb0f('0xb')]||'';this[_0xeb0f('0xc')]=_0x3a19cb[_0xeb0f('0xc')]||'';this[_0xeb0f('0xd')]=_0x3a19cb[_0xeb0f('0xd')]||_0xeb0f('0xe');this[_0xeb0f('0xf')]=0x0;this['talking']=0x0;this['total']=0x0;this[_0xeb0f('0x10')]=0x0;this[_0xeb0f('0x11')]=0x0;this[_0xeb0f('0x12')]=0x0;this['sumBillable']=0x0;this[_0xeb0f('0x13')]=0x0;this['abandoned']=0x0;this[_0xeb0f('0x14')]=0x0;this[_0xeb0f('0x15')]=0x0;this[_0xeb0f('0x16')]=_0x3a19cb[_0xeb0f('0x16')]||![];this[_0xeb0f('0x17')]=_0x3a19cb['acwTimeout']||0xa;this[_0xeb0f('0x18')]=_0x3a19cb[_0xeb0f('0x18')]||'no';this[_0xeb0f('0x19')]=!![];this[_0xeb0f('0x1a')]='';this['originated']=0x0;this[_0xeb0f('0x1b')]=0x0;this['dialTimezone']=_0x3a19cb[_0xeb0f('0x1c')]||null;this[_0xeb0f('0x1d')]=_0x3a19cb['dialGlobalInterval']?_0x3a19cb[_0xeb0f('0x1d')]:null;this[_0xeb0f('0x1e')]=_0x3a19cb[_0xeb0f('0x1e')];this['dialMethod']=_0x3a19cb[_0xeb0f('0x1f')]||'progressive';this['dialLimitChannel']=_0x3a19cb[_0xeb0f('0x20')]||0x0;this['dialLimitQueue']=_0x3a19cb[_0xeb0f('0x21')]||0x0;this['dialPowerLevel']=_0x3a19cb[_0xeb0f('0x22')]||0x1;this[_0xeb0f('0x23')]=_0x3a19cb[_0xeb0f('0x23')]||_0xeb0f('0x24');this[_0xeb0f('0x25')]=_0x3a19cb[_0xeb0f('0x25')]||0.03;this['dialPredictiveInterval']=_0x3a19cb[_0xeb0f('0x26')]||0x258;this[_0xeb0f('0x27')]=_0x3a19cb[_0xeb0f('0x27')]||_0xeb0f('0x28');this['dialOriginateCallerIdNumber']=_0x3a19cb['dialOriginateCallerIdNumber']||_0xeb0f('0x28');this['dialOriginateTimeout']=_0x3a19cb[_0xeb0f('0x29')]||0x1e;this[_0xeb0f('0x2a')]=_0x3a19cb[_0xeb0f('0x2a')]||'tTxX';this[_0xeb0f('0x2b')]=_0x3a19cb[_0xeb0f('0x2b')]||0x3;this['dialQueueProject']=_0x3a19cb[_0xeb0f('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x3a19cb[_0xeb0f('0x2d')]||0x3;this[_0xeb0f('0x2e')]=_0x3a19cb['dialCongestionRetryFrequency']||0x96;this[_0xeb0f('0x2f')]=_0x3a19cb['dialBusyMaxRetry']||0x3;this[_0xeb0f('0x30')]=_0x3a19cb[_0xeb0f('0x30')]||0x96;this[_0xeb0f('0x31')]=_0x3a19cb[_0xeb0f('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x3a19cb[_0xeb0f('0x32')]||0x96;this[_0xeb0f('0x33')]=_0x3a19cb[_0xeb0f('0x33')]||0x3;this[_0xeb0f('0x34')]=_0x3a19cb[_0xeb0f('0x34')]||0x96;this[_0xeb0f('0x35')]=_0x3a19cb[_0xeb0f('0x35')]||0x3;this[_0xeb0f('0x36')]=_0x3a19cb[_0xeb0f('0x36')]||0x96;this[_0xeb0f('0x37')]=_0x3a19cb[_0xeb0f('0x37')]||0x3;this[_0xeb0f('0x38')]=_0x3a19cb[_0xeb0f('0x38')]||0x96;this[_0xeb0f('0x39')]=_0x3a19cb[_0xeb0f('0x39')]||0x3;this[_0xeb0f('0x3a')]=_0x3a19cb[_0xeb0f('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x3a19cb['dialAgentRejectMaxRetry']||0x3;this[_0xeb0f('0x3b')]=_0x3a19cb[_0xeb0f('0x3b')]||0x96;this[_0xeb0f('0x3c')]=_0x3a19cb['dialGlobalMaxRetry']||0x4;this[_0xeb0f('0x3d')]=_0x3a19cb['Trunk']?_0x3a19cb[_0xeb0f('0x3d')]:undefined;this[_0xeb0f('0x3e')]=_0x3a19cb[_0xeb0f('0x3e')]?_0x3a19cb[_0xeb0f('0x3e')]:undefined;this[_0xeb0f('0x3f')]=_0x3a19cb[_0xeb0f('0x3f')]||undefined;this[_0xeb0f('0x40')]=_0x3a19cb[_0xeb0f('0x40')]?_0x3a19cb[_0xeb0f('0x40')]:undefined;this[_0xeb0f('0x41')]=_0x3a19cb[_0xeb0f('0x41')]||_0xeb0f('0x42');this[_0xeb0f('0x43')]=_0x3a19cb['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xeb0f('0x44')]=_0x3a19cb['dialCutDigit']||undefined;this[_0xeb0f('0x45')]=strategy[_0x3a19cb[_0xeb0f('0x45')]]||_0xeb0f('0x46');this['queueStatusComplete']=!![];this[_0xeb0f('0x47')]=_0x3a19cb[_0xeb0f('0x47')]||![];this[_0xeb0f('0x48')]=_0x3a19cb[_0xeb0f('0x48')];this[_0xeb0f('0x49')]=_0x3a19cb[_0xeb0f('0x49')];this[_0xeb0f('0x4a')]=_0x3a19cb[_0xeb0f('0x4a')];this[_0xeb0f('0x4b')]=_0x3a19cb[_0xeb0f('0x4b')];this['dialAMDMinWordLength']=_0x3a19cb[_0xeb0f('0x4c')];this[_0xeb0f('0x4d')]=_0x3a19cb[_0xeb0f('0x4d')];this[_0xeb0f('0x4e')]=_0x3a19cb[_0xeb0f('0x4e')];this[_0xeb0f('0x4f')]=_0x3a19cb[_0xeb0f('0x4f')];this[_0xeb0f('0x50')]=_0x3a19cb['dialAMDMaximumWordLength'];this[_0xeb0f('0x51')]=0x0;this['pTalking']=0x0;this[_0xeb0f('0x52')]=_0x3a19cb[_0xeb0f('0x52')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xeb0f('0x53')]=0x0;this[_0xeb0f('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xeb0f('0x55')]=0x0;this[_0xeb0f('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xeb0f('0x57')]=0x0;this[_0xeb0f('0x58')]=0x0;this[_0xeb0f('0x59')]=0x0;this[_0xeb0f('0x5a')]=0x0;this[_0xeb0f('0x5b')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xeb0f('0x5c')]=undefined;this[_0xeb0f('0x5d')]=undefined;this[_0xeb0f('0x5e')]=undefined;this[_0xeb0f('0x5f')]=1.05;this[_0xeb0f('0x60')]=0x0;this[_0xeb0f('0x61')]=0x0;this[_0xeb0f('0x62')]=0x0;this[_0xeb0f('0x63')]=0x0;this[_0xeb0f('0x64')]=0x0;this[_0xeb0f('0x65')]=0x0;this[_0xeb0f('0x66')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xeb0f('0x67')]=_0x3a19cb[_0xeb0f('0x68')]||0x14;this['predictiveIntervalMinThreshold']=_0x3a19cb[_0xeb0f('0x68')]||0xa;this[_0xeb0f('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xeb0f('0x6a')]=0x0;this[_0xeb0f('0x6b')]=0x0;this[_0xeb0f('0x6c')]=0x0;this[_0xeb0f('0x6d')]=_0x3a19cb[_0xeb0f('0x6d')]||0x1e;this[_0xeb0f('0x6e')]=_0x3a19cb[_0xeb0f('0x6e')]||![];this['dialQueueProject2']=_0x3a19cb[_0xeb0f('0x6f')]||undefined;this[_0xeb0f('0x70')]=_0x3a19cb[_0xeb0f('0x70')]||![];this[_0xeb0f('0x71')]=_0x3a19cb[_0xeb0f('0x71')]||![];this[_0xeb0f('0xc')]=monitorFormat[_0x3a19cb[_0xeb0f('0xc')]]?monitorFormat[_0x3a19cb[_0xeb0f('0xc')]]:undefined;this['mandatoryDisposition']=_0x3a19cb['mandatoryDisposition']||![];this[_0xeb0f('0x72')]=_0x3a19cb[_0xeb0f('0x72')]?_0x3a19cb['mandatoryDispositionPause']:undefined;}module[_0xeb0f('0x73')]=VoiceQueue;
\ No newline at end of file
+var _0x3527=['dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','total','sumDuration','sumHoldTime','unmanaged','loggedIn','available','acw','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue'];(function(_0xfeffda,_0x1e34fe){var _0x21d6b9=function(_0x36a53e){while(--_0x36a53e){_0xfeffda['push'](_0xfeffda['shift']());}};_0x21d6b9(++_0x1e34fe);}(_0x3527,0x171));var _0x7352=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x3527[_0x4fde08];return _0x12e725;};'use strict';var statusDesc=[_0x7352('0x0'),'not_inuse',_0x7352('0x1'),_0x7352('0x2'),'invalid',_0x7352('0x3'),_0x7352('0x4'),_0x7352('0x5'),_0x7352('0x6')];var monitorFormat={'wav':_0x7352('0x7'),'wav49':_0x7352('0x8'),'gsm':_0x7352('0x9')};var strategy={'rrmemory':_0x7352('0xa'),'roundrobin':_0x7352('0xb')};function VoiceQueue(_0x27c860){this['id']=_0x27c860['id']||0x0;this[_0x7352('0xc')]=_0x27c860[_0x7352('0xc')]||'';this[_0x7352('0xd')]=_0x27c860['monitor_format']||'';this[_0x7352('0xe')]=_0x27c860[_0x7352('0xe')]||'inbound';this[_0x7352('0xf')]=0x0;this[_0x7352('0x10')]=0x0;this[_0x7352('0x11')]=0x0;this['answered']=0x0;this[_0x7352('0x12')]=0x0;this[_0x7352('0x13')]=0x0;this['sumBillable']=0x0;this[_0x7352('0x14')]=0x0;this['abandoned']=0x0;this[_0x7352('0x15')]=0x0;this[_0x7352('0x16')]=0x0;this[_0x7352('0x17')]=_0x27c860[_0x7352('0x17')]||![];this['acwTimeout']=_0x27c860['acwTimeout']||0xa;this[_0x7352('0x18')]=_0x27c860[_0x7352('0x18')]||'no';this['sendMessageOneNotActive']=!![];this[_0x7352('0x19')]='';this[_0x7352('0x1a')]=0x0;this[_0x7352('0x1b')]=0x0;this[_0x7352('0x1c')]=_0x27c860['dialTimezone']||null;this[_0x7352('0x1d')]=_0x27c860[_0x7352('0x1d')]?_0x27c860[_0x7352('0x1d')]:null;this[_0x7352('0x1e')]=_0x27c860[_0x7352('0x1e')];this['dialMethod']=_0x27c860['dialMethod']||_0x7352('0x1f');this['dialLimitChannel']=_0x27c860[_0x7352('0x20')]||0x0;this[_0x7352('0x21')]=_0x27c860[_0x7352('0x21')]||0x0;this[_0x7352('0x22')]=_0x27c860[_0x7352('0x22')]||0x1;this[_0x7352('0x23')]=_0x27c860[_0x7352('0x23')]||_0x7352('0x24');this['dialPredictiveOptimizationPercentage']=_0x27c860[_0x7352('0x25')]||0.03;this['dialPredictiveInterval']=_0x27c860['dialPredictiveInterval']||0x258;this[_0x7352('0x26')]=_0x27c860['dialOriginateCallerIdName']||_0x7352('0x27');this[_0x7352('0x28')]=_0x27c860[_0x7352('0x28')]||_0x7352('0x27');this['dialOriginateTimeout']=_0x27c860[_0x7352('0x29')]||0x1e;this['dialQueueOptions']=_0x27c860[_0x7352('0x2a')]||_0x7352('0x2b');this[_0x7352('0x2c')]=_0x27c860[_0x7352('0x2c')]||0x3;this[_0x7352('0x2d')]=_0x27c860[_0x7352('0x2d')]||undefined;this[_0x7352('0x2e')]=_0x27c860[_0x7352('0x2e')]||0x3;this[_0x7352('0x2f')]=_0x27c860[_0x7352('0x2f')]||0x96;this[_0x7352('0x30')]=_0x27c860[_0x7352('0x30')]||0x3;this[_0x7352('0x31')]=_0x27c860[_0x7352('0x31')]||0x96;this[_0x7352('0x32')]=_0x27c860[_0x7352('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x27c860['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x27c860[_0x7352('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x27c860[_0x7352('0x34')]||0x96;this[_0x7352('0x35')]=_0x27c860[_0x7352('0x35')]||0x3;this[_0x7352('0x36')]=_0x27c860[_0x7352('0x36')]||0x96;this[_0x7352('0x37')]=_0x27c860['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x27c860[_0x7352('0x38')]||0x96;this[_0x7352('0x39')]=_0x27c860[_0x7352('0x39')]||0x3;this[_0x7352('0x3a')]=_0x27c860[_0x7352('0x3a')]||0x96;this[_0x7352('0x3b')]=_0x27c860[_0x7352('0x3b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x27c860[_0x7352('0x3c')]||0x96;this[_0x7352('0x3d')]=_0x27c860[_0x7352('0x3d')]||0x4;this['Trunk']=_0x27c860['Trunk']?_0x27c860[_0x7352('0x3e')]:undefined;this['TrunkBackup']=_0x27c860[_0x7352('0x3f')]?_0x27c860[_0x7352('0x3f')]:undefined;this['dialPrefix']=_0x27c860[_0x7352('0x40')]||undefined;this[_0x7352('0x41')]=_0x27c860[_0x7352('0x41')]?_0x27c860[_0x7352('0x41')]:undefined;this[_0x7352('0x42')]=_0x27c860['dialOrderByScheduledAt']||_0x7352('0x43');this[_0x7352('0x44')]=_0x27c860[_0x7352('0x44')]||undefined;this[_0x7352('0x45')]=_0x27c860[_0x7352('0x45')]||undefined;this['strategy']=strategy[_0x27c860[_0x7352('0x46')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0x7352('0x47')]=_0x27c860[_0x7352('0x47')]||![];this[_0x7352('0x48')]=_0x27c860[_0x7352('0x48')];this[_0x7352('0x49')]=_0x27c860[_0x7352('0x49')];this[_0x7352('0x4a')]=_0x27c860['dialAMDAfterGreetingSilence'];this[_0x7352('0x4b')]=_0x27c860[_0x7352('0x4b')];this[_0x7352('0x4c')]=_0x27c860[_0x7352('0x4c')];this[_0x7352('0x4d')]=_0x27c860[_0x7352('0x4d')];this[_0x7352('0x4e')]=_0x27c860[_0x7352('0x4e')];this[_0x7352('0x4f')]=_0x27c860[_0x7352('0x4f')];this[_0x7352('0x50')]=_0x27c860[_0x7352('0x50')];this[_0x7352('0x51')]=0x0;this[_0x7352('0x52')]=0x0;this['timeout']=_0x27c860[_0x7352('0x53')];this[_0x7352('0x54')]=0x0;this[_0x7352('0x55')]=0x0;this[_0x7352('0x56')]=0x0;this[_0x7352('0x57')]=0x0;this[_0x7352('0x58')]=0x0;this[_0x7352('0x59')]=0x0;this[_0x7352('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x7352('0x5b')]=0x0;this[_0x7352('0x5c')]=0x0;this[_0x7352('0x5d')]=0x0;this[_0x7352('0x5e')]=0x0;this[_0x7352('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this[_0x7352('0x60')]=undefined;this[_0x7352('0x61')]=undefined;this[_0x7352('0x62')]=undefined;this[_0x7352('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x7352('0x64')]=0x0;this[_0x7352('0x65')]=0x0;this[_0x7352('0x66')]=0x0;this[_0x7352('0x67')]=0x0;this[_0x7352('0x68')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x7352('0x69')]=0x0;this[_0x7352('0x6a')]=_0x27c860['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x7352('0x6b')]=_0x27c860['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x7352('0x6c')]=0x1;this[_0x7352('0x6d')]=0x0;this[_0x7352('0x6e')]=0x0;this[_0x7352('0x6f')]=0x0;this[_0x7352('0x70')]=0x0;this[_0x7352('0x71')]=_0x27c860[_0x7352('0x71')]||0x1e;this[_0x7352('0x72')]=_0x27c860['dialRecallInQueue']||![];this[_0x7352('0x73')]=_0x27c860[_0x7352('0x73')]||undefined;this['dialAgiAfterHangupClient']=_0x27c860[_0x7352('0x74')]||![];this[_0x7352('0x75')]=_0x27c860[_0x7352('0x75')]||![];this[_0x7352('0xd')]=monitorFormat[_0x27c860['monitor_format']]?monitorFormat[_0x27c860[_0x7352('0xd')]]:undefined;this[_0x7352('0x76')]=_0x27c860[_0x7352('0x76')]||![];this['mandatoryDispositionPause']=_0x27c860[_0x7352('0x77')]?_0x27c860[_0x7352('0x77')]:undefined;}module[_0x7352('0x78')]=VoiceQueue;
\ No newline at end of file
index 50f3b0f..6a45168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1efa=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0xfb045c,_0x56fc4a){var _0x40954b=function(_0x14371d){while(--_0x14371d){_0xfb045c['push'](_0xfb045c['shift']());}};_0x40954b(++_0x56fc4a);}(_0x1efa,0x15d));var _0xa1ef=function(_0x9c6a6f,_0x2c7179){_0x9c6a6f=_0x9c6a6f-0x0;var _0x1a1524=_0x1efa[_0x9c6a6f];return _0x1a1524;};'use strict';function VtigerAccount(_0x174b2d){this['id']=_0x174b2d['id']||0x0;this[_0xa1ef('0x0')]=_0x174b2d[_0xa1ef('0x0')]||'';this['username']=_0x174b2d[_0xa1ef('0x1')]||'';this[_0xa1ef('0x2')]=_0x174b2d[_0xa1ef('0x2')]||'';this[_0xa1ef('0x3')]=_0x174b2d[_0xa1ef('0x3')]||'';this['serverUrl']=_0x174b2d[_0xa1ef('0x4')]||'';this[_0xa1ef('0x5')]=_0x174b2d[_0xa1ef('0x5')]||{};}module[_0xa1ef('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x5f27=['username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x59c9db,_0x29eac1){var _0x8fd710=function(_0x561829){while(--_0x561829){_0x59c9db['push'](_0x59c9db['shift']());}};_0x8fd710(++_0x29eac1);}(_0x5f27,0xd8));var _0x75f2=function(_0x4688c2,_0x27a4fd){_0x4688c2=_0x4688c2-0x0;var _0x41fc2a=_0x5f27[_0x4688c2];return _0x41fc2a;};'use strict';function VtigerAccount(_0x9faad5){this['id']=_0x9faad5['id']||0x0;this['name']=_0x9faad5['name']||'';this['username']=_0x9faad5[_0x75f2('0x0')]||'';this[_0x75f2('0x1')]=_0x9faad5['accessKey']||'';this[_0x75f2('0x2')]=_0x9faad5[_0x75f2('0x2')]||'';this[_0x75f2('0x3')]=_0x9faad5[_0x75f2('0x3')]||'';this[_0x75f2('0x4')]=_0x9faad5[_0x75f2('0x4')]||{};}module[_0x75f2('0x5')]=VtigerAccount;
\ No newline at end of file
index a783740..fe050fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08b7=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password','token'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x08b7,0x178));var _0x708b=function(_0x35e564,_0x550613){_0x35e564=_0x35e564-0x0;var _0xf4d06d=_0x08b7[_0x35e564];return _0xf4d06d;};'use strict';function ZendeskAccount(_0x5f2ba6){this['id']=_0x5f2ba6['id']||0x0;this[_0x708b('0x0')]=_0x5f2ba6[_0x708b('0x0')]||'';this[_0x708b('0x1')]=_0x5f2ba6[_0x708b('0x1')]||'';this[_0x708b('0x2')]=_0x5f2ba6[_0x708b('0x2')]||'';this[_0x708b('0x3')]=_0x5f2ba6['token']||'';this[_0x708b('0x4')]=_0x5f2ba6[_0x708b('0x4')]||'';this['authType']=_0x5f2ba6[_0x708b('0x5')]||'';this[_0x708b('0x6')]=_0x5f2ba6['type']||_0x708b('0x7');this[_0x708b('0x8')]=_0x5f2ba6[_0x708b('0x8')]||'';this[_0x708b('0x9')]=_0x5f2ba6[_0x708b('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
+var _0x567d=['Configurations','exports','name','username','password','token','authType','type','serverUrl'];(function(_0x137b1c,_0x5939b3){var _0x1f6d21=function(_0x555a41){while(--_0x555a41){_0x137b1c['push'](_0x137b1c['shift']());}};_0x1f6d21(++_0x5939b3);}(_0x567d,0x1e8));var _0xd567=function(_0x5d950f,_0x3df715){_0x5d950f=_0x5d950f-0x0;var _0x532643=_0x567d[_0x5d950f];return _0x532643;};'use strict';function ZendeskAccount(_0x3958b4){this['id']=_0x3958b4['id']||0x0;this['name']=_0x3958b4[_0xd567('0x0')]||'';this[_0xd567('0x1')]=_0x3958b4['username']||'';this[_0xd567('0x2')]=_0x3958b4[_0xd567('0x2')]||'';this[_0xd567('0x3')]=_0x3958b4['token']||'';this['remoteUri']=_0x3958b4['remoteUri']||'';this[_0xd567('0x4')]=_0x3958b4[_0xd567('0x4')]||'';this[_0xd567('0x5')]=_0x3958b4[_0xd567('0x5')]||'integrationTab';this[_0xd567('0x6')]=_0x3958b4[_0xd567('0x6')]||'';this[_0xd567('0x7')]=_0x3958b4['Configurations']||{};}module[_0xd567('0x8')]=ZendeskAccount;
\ No newline at end of file
index 2f9feac..5515b94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde90=['description','host','zone','clientId','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x313426,_0x486f9d){var _0x54a0d9=function(_0x4f340a){while(--_0x4f340a){_0x313426['push'](_0x313426['shift']());}};_0x54a0d9(++_0x486f9d);}(_0xde90,0x15d));var _0x0de9=function(_0x667c6a,_0x2155cd){_0x667c6a=_0x667c6a-0x0;var _0x36396a=_0xde90[_0x667c6a];return _0x36396a;};'use strict';function ZohoAccount(_0x5581d2){this['id']=_0x5581d2['id']||0x0;this[_0x0de9('0x0')]=_0x5581d2[_0x0de9('0x0')]||'';this[_0x0de9('0x1')]=_0x5581d2[_0x0de9('0x1')]||'';this[_0x0de9('0x2')]=_0x5581d2[_0x0de9('0x2')]||'';this[_0x0de9('0x3')]=_0x5581d2[_0x0de9('0x3')]||'';this[_0x0de9('0x4')]=_0x5581d2['clientId']||'';this['clientSecret']=_0x5581d2['clientSecret']||'';this[_0x0de9('0x5')]=_0x5581d2[_0x0de9('0x5')]||'';this['code']=_0x5581d2[_0x0de9('0x6')]||'';this[_0x0de9('0x7')]=_0x5581d2[_0x0de9('0x7')]||'';this[_0x0de9('0x8')]=_0x5581d2[_0x0de9('0x8')]||{};}module[_0x0de9('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0x9445=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret'];(function(_0x75f289,_0x28b524){var _0x3f7c4c=function(_0x3c3cf7){while(--_0x3c3cf7){_0x75f289['push'](_0x75f289['shift']());}};_0x3f7c4c(++_0x28b524);}(_0x9445,0xfe));var _0x5944=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x9445[_0x21a9d9];return _0x46adce;};'use strict';function ZohoAccount(_0x1761c7){this['id']=_0x1761c7['id']||0x0;this['name']=_0x1761c7[_0x5944('0x0')]||'';this[_0x5944('0x1')]=_0x1761c7['description']||'';this[_0x5944('0x2')]=_0x1761c7['host']||'';this['zone']=_0x1761c7[_0x5944('0x3')]||'';this[_0x5944('0x4')]=_0x1761c7[_0x5944('0x4')]||'';this[_0x5944('0x5')]=_0x1761c7[_0x5944('0x5')]||'';this[_0x5944('0x6')]=_0x1761c7[_0x5944('0x6')]||'';this[_0x5944('0x7')]=_0x1761c7['code']||'';this[_0x5944('0x8')]=_0x1761c7['refreshToken']||'';this['Configurations']=_0x1761c7[_0x5944('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index e21d41c..c57280c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1440=['VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','name','type','queue','dialAnswer','channelAgent','membername','format','SIP/%s','calleridname','phone','Contact','lastName','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','Agent'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1440,0x87));var _0x0144=function(_0x1c2ed9,_0x1da882){_0x1c2ed9=_0x1c2ed9-0x0;var _0x3a595b=_0x1440[_0x1c2ed9];return _0x3a595b;};'use strict';var util=require(_0x0144('0x0'));var _=require(_0x0144('0x1'));var moment=require(_0x0144('0x2'));function checkNameSurname(_0xc4a3c,_0x1cab6b,_0x363969){var _0x23143f='';if(!_[_0x0144('0x3')](_0x1cab6b)&&_0x0144('0x4')===typeof _0x1cab6b){_0x23143f+=_0x1cab6b;}if(!_[_0x0144('0x3')](_0x363969)&&_0x0144('0x4')===typeof _0x363969){_0x23143f+='\x20'+_0x363969;}if(_0x23143f!==''){return _0x23143f;}return _0xc4a3c;}function Action(_0x557d46,_0x4935ca,_0x6d5ccc,_0x24fe25,_0x765f3b){this['uniqueid']=_0x6d5ccc||undefined;this[_0x0144('0x5')]=_0x557d46['id'];this['queue']=_0x4935ca[_0x0144('0x6')];this[_0x0144('0x7')]=_0x4935ca[_0x0144('0x7')];this['campaigntype']=_0x0144('0x8');this[_0x0144('0x9')]=![];this['membername']=_[_0x0144('0x3')](_0x557d46['Agent'])?undefined:_0x557d46['Agent'][_0x0144('0x6')];this[_0x0144('0xa')]=this[_0x0144('0xb')]?util[_0x0144('0xc')](_0x0144('0xd'),this['membername']):_0x24fe25||undefined;this[_0x0144('0xe')]=checkNameSurname(_0x557d46['Contact'][_0x0144('0xf')],_0x557d46[_0x0144('0x10')]['firstName'],_0x557d46[_0x0144('0x10')][_0x0144('0x11')]);this['active']=_0x557d46['active']||![];this[_0x0144('0x12')]=_0x557d46[_0x0144('0x10')][_0x0144('0xf')];this[_0x0144('0x13')]=_0x557d46[_0x0144('0x13')];this[_0x0144('0x14')]=_0x557d46[_0x0144('0x14')]||0x0;this[_0x0144('0x15')]=_0x557d46['countcongestionretry']||0x0;this[_0x0144('0x16')]=_0x557d46[_0x0144('0x16')]||0x0;this[_0x0144('0x17')]=(_0x557d46[_0x0144('0x14')]||0x0)+(_0x557d46[_0x0144('0x15')]||0x0)+(_0x557d46['countnoanswerretry']||0x0)+(_0x557d46['countnosuchnumberretry']||0x0)+(_0x557d46[_0x0144('0x18')]||0x0)+(_0x557d46[_0x0144('0x19')]||0x0)+(_0x557d46[_0x0144('0x1a')]||0x0)+(_0x557d46['countagentrejectretry']||0x0);this[_0x0144('0x1b')]=_0x557d46[_0x0144('0x1b')]||0x0;this[_0x0144('0x18')]=_0x557d46[_0x0144('0x18')]||0x0;this[_0x0144('0x19')]=_0x557d46[_0x0144('0x19')]||0x0;this[_0x0144('0x1a')]=_0x557d46['countmachineretry']||0x0;this[_0x0144('0x1c')]=_0x557d46[_0x0144('0x1c')]||0x0;this[_0x0144('0x1d')]=_0x557d46[_0x0144('0x1d')];this['callbackuniqueid']=_0x557d46[_0x0144('0x1e')];this[_0x0144('0x1f')]=_0x557d46[_0x0144('0x1f')];this[_0x0144('0x20')]=_0x557d46[_0x0144('0x20')];this[_0x0144('0x21')]=_0x557d46[_0x0144('0x21')];this['ListId']=_0x557d46[_0x0144('0x22')];this[_0x0144('0x23')]=_[_0x0144('0x3')](_0x557d46[_0x0144('0x24')])?_0x557d46['UserId']:_0x557d46['Agent']['id'];this[_0x0144('0x25')]=_0x557d46[_0x0144('0x25')];this[_0x0144('0x26')]='';this['originatecalleridname']='';}Action[_0x0144('0x27')][_0x0144('0x28')]=function(){return util[_0x0144('0xc')](_0x0144('0x29'),this['calleridname'],this['number']);};module[_0x0144('0x2a')]=Action;
\ No newline at end of file
+var _0xa46c=['getCaller','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','Agent','name','channelAgent','membername','format','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','prototype'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa46c,0x1e7));var _0xca46=function(_0x21b1b5,_0x589b99){_0x21b1b5=_0x21b1b5-0x0;var _0x5bb0a4=_0xa46c[_0x21b1b5];return _0x5bb0a4;};'use strict';var util=require(_0xca46('0x0'));var _=require(_0xca46('0x1'));var moment=require(_0xca46('0x2'));function checkNameSurname(_0x3c4c52,_0x397790,_0x5677cc){var _0x1d7a7d='';if(!_[_0xca46('0x3')](_0x397790)&&'string'===typeof _0x397790){_0x1d7a7d+=_0x397790;}if(!_[_0xca46('0x3')](_0x5677cc)&&_0xca46('0x4')===typeof _0x5677cc){_0x1d7a7d+='\x20'+_0x5677cc;}if(_0x1d7a7d!==''){return _0x1d7a7d;}return _0x3c4c52;}function Action(_0x20ef39,_0x486402,_0x437e8c,_0x1776a2,_0x572350){this[_0xca46('0x5')]=_0x437e8c||undefined;this[_0xca46('0x6')]=_0x20ef39['id'];this[_0xca46('0x7')]=_0x486402['name'];this[_0xca46('0x8')]=_0x486402[_0xca46('0x8')];this[_0xca46('0x9')]=_0xca46('0x7');this['dialAnswer']=![];this['membername']=_[_0xca46('0x3')](_0x20ef39['Agent'])?undefined:_0x20ef39[_0xca46('0xa')][_0xca46('0xb')];this[_0xca46('0xc')]=this[_0xca46('0xd')]?util[_0xca46('0xe')](_0xca46('0xf'),this[_0xca46('0xd')]):_0x1776a2||undefined;this[_0xca46('0x10')]=checkNameSurname(_0x20ef39['Contact'][_0xca46('0x11')],_0x20ef39[_0xca46('0x12')][_0xca46('0x13')],_0x20ef39[_0xca46('0x12')][_0xca46('0x14')]);this[_0xca46('0x15')]=_0x20ef39[_0xca46('0x15')]||![];this['calleridnum']=_0x20ef39[_0xca46('0x12')][_0xca46('0x11')];this[_0xca46('0x16')]=_0x20ef39[_0xca46('0x16')];this[_0xca46('0x17')]=_0x20ef39[_0xca46('0x17')]||0x0;this[_0xca46('0x18')]=_0x20ef39[_0xca46('0x18')]||0x0;this[_0xca46('0x19')]=_0x20ef39[_0xca46('0x19')]||0x0;this[_0xca46('0x1a')]=(_0x20ef39['countbusyretry']||0x0)+(_0x20ef39[_0xca46('0x18')]||0x0)+(_0x20ef39[_0xca46('0x19')]||0x0)+(_0x20ef39[_0xca46('0x1b')]||0x0)+(_0x20ef39[_0xca46('0x1c')]||0x0)+(_0x20ef39[_0xca46('0x1d')]||0x0)+(_0x20ef39[_0xca46('0x1e')]||0x0)+(_0x20ef39[_0xca46('0x1f')]||0x0);this['countnosuchnumberretry']=_0x20ef39['countnosuchnumberretry']||0x0;this[_0xca46('0x1c')]=_0x20ef39[_0xca46('0x1c')]||0x0;this[_0xca46('0x1d')]=_0x20ef39['countabandonedretry']||0x0;this[_0xca46('0x1e')]=_0x20ef39[_0xca46('0x1e')]||0x0;this[_0xca46('0x1f')]=_0x20ef39['countagentrejectretry']||0x0;this[_0xca46('0x20')]=_0x20ef39[_0xca46('0x20')];this[_0xca46('0x21')]=_0x20ef39['callbackuniqueid'];this[_0xca46('0x22')]=_0x20ef39[_0xca46('0x22')];this[_0xca46('0x23')]=_0x20ef39[_0xca46('0x23')];this[_0xca46('0x24')]=_0x20ef39[_0xca46('0x24')];this[_0xca46('0x25')]=_0x20ef39[_0xca46('0x25')];this['UserId']=_[_0xca46('0x3')](_0x20ef39['Agent'])?_0x20ef39['UserId']:_0x20ef39[_0xca46('0xa')]['id'];this[_0xca46('0x26')]=_0x20ef39['VoiceQueueId'];this[_0xca46('0x27')]='';this['originatecalleridname']='';}Action[_0xca46('0x28')][_0xca46('0x29')]=function(){return util[_0xca46('0xe')](_0xca46('0x2a'),this[_0xca46('0x10')],this['number']);};module[_0xca46('0x2b')]=Action;
\ No newline at end of file
index 95053d7..0d714f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5ff=['countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','dialstatus','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','disableContact','execRun','recallme','validateContact','checkIsBlackList','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','Contact','substring','phone','callerid','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:agentconnect','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','responsetime','isFailure','response','unlockContact','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','reason','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./action','redis','defaults','localhost','socket.io-emitter','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','logger','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','clearZombieChannel','isNil','Queue','queue','originated','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action','catch','No\x20such\x20channel','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','rescheduleContact','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','scheduledAt','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED'];(function(_0x267d8d,_0xe90f65){var _0x11a98f=function(_0x5703c9){while(--_0x5703c9){_0x267d8d['push'](_0x267d8d['shift']());}};_0x11a98f(++_0xe90f65);}(_0xa5ff,0x1d1));var _0xfa5f=function(_0x65f90,_0x10b401){_0x65f90=_0x65f90-0x0;var _0x8a5833=_0xa5ff[_0x65f90];return _0x8a5833;};'use strict';var util=require(_0xfa5f('0x0'));var _=require(_0xfa5f('0x1'));var BPromise=require(_0xfa5f('0x2'));var uuid=require(_0xfa5f('0x3'));var moment=require(_0xfa5f('0x4'));var md5=require(_0xfa5f('0x5'));var Redis=require(_0xfa5f('0x6'));var config=require(_0xfa5f('0x7'));var logger=require(_0xfa5f('0x8'))(_0xfa5f('0x9'));var loggerAction=require('../../../config/logger')(_0xfa5f('0xa'));var ami=require(_0xfa5f('0xb'));var rpcDb=require('./rpcDb');var Action=require(_0xfa5f('0xc'));var ut=require('./util/util');config[_0xfa5f('0xd')]=_[_0xfa5f('0xe')](config[_0xfa5f('0xd')],{'host':_0xfa5f('0xf'),'port':0x18eb});var io=require(_0xfa5f('0x10'))(new Redis(config[_0xfa5f('0xd')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x4f2ae7){this[_0xfa5f('0x11')]=this[_0xfa5f('0x11')]?this[_0xfa5f('0x11')][_0xfa5f('0x12')](_0x4f2ae7):_0x4f2ae7();};function Preview(_0x6ef235){this[_0xfa5f('0x13')]=new Sequence();this[_0xfa5f('0x14')]=_0x6ef235[_0xfa5f('0x15')];this[_0xfa5f('0x16')]=_0x6ef235[_0xfa5f('0x16')];this[_0xfa5f('0x17')]={};this[_0xfa5f('0x18')]=_0x6ef235['agents'];this[_0xfa5f('0x19')]=0x0;ami['on'](_0xfa5f('0x1a'),this[_0xfa5f('0x1b')][_0xfa5f('0x1c')](this));ami['on'](_0xfa5f('0x1d'),this[_0xfa5f('0x1e')]['bind'](this));ami['on'](_0xfa5f('0x1f'),this[_0xfa5f('0x20')]['bind'](this));ami['on'](_0xfa5f('0x21'),this[_0xfa5f('0x22')][_0xfa5f('0x1c')](this));ami['on'](_0xfa5f('0x23'),this[_0xfa5f('0x24')]['bind'](this));ami['on'](_0xfa5f('0x25'),this[_0xfa5f('0x26')][_0xfa5f('0x1c')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xfa5f('0x27')][_0xfa5f('0x1c')](this));this[_0xfa5f('0x28')](this[_0xfa5f('0x14')]);}function emit(_0x12390f,_0x40372f,_0x4b1058){io['to'](_0x12390f)[_0xfa5f('0x29')](_0x40372f,_0x4b1058);}function emitCampaignPreview(_0x5ce540){if(_0x5ce540[_0xfa5f('0x2a')]===_0xfa5f('0x2b')){var _0x3ba6e6={'id':_0x5ce540['id'],'name':_0x5ce540[_0xfa5f('0x2c')],'strategy':_0x5ce540['strategy'],'answered':_0x5ce540[_0xfa5f('0x2d')],'available':_0x5ce540['available'],'loggedIn':_0x5ce540[_0xfa5f('0x2e')],'pTalking':_0x5ce540[_0xfa5f('0x2f')],'sumBillable':_0x5ce540['sumBillable'],'sumDuration':_0x5ce540[_0xfa5f('0x30')],'sumHoldTime':_0x5ce540[_0xfa5f('0x31')]||0x0,'talking':_0x5ce540[_0xfa5f('0x32')],'total':_0x5ce540[_0xfa5f('0x33')],'type':_0x5ce540[_0xfa5f('0x2a')],'unmanaged':_0x5ce540[_0xfa5f('0x34')],'abandoned':_0x5ce540[_0xfa5f('0x35')],'waiting':_0x5ce540[_0xfa5f('0x36')],'loggedInDb':_0x5ce540['loggedInDb'],'dialActive':_0x5ce540[_0xfa5f('0x37')],'dialMethod':_0x5ce540[_0xfa5f('0x38')],'dialOriginateCallerIdName':_0x5ce540[_0xfa5f('0x39')],'dialOriginateCallerIdNumber':_0x5ce540[_0xfa5f('0x3a')],'dialOriginateTimeout':_0x5ce540['dialOriginateTimeout'],'dialPrefix':_0x5ce540[_0xfa5f('0x3b')],'outboundAnswerAgiCallsDay':_0x5ce540[_0xfa5f('0x3c')],'outboundAnswerCallsDay':_0x5ce540[_0xfa5f('0x3d')],'outboundBlacklistCallsDay':_0x5ce540[_0xfa5f('0x3e')],'outboundBusyCallsDay':_0x5ce540[_0xfa5f('0x3f')],'outboundCongestionCallsDay':_0x5ce540[_0xfa5f('0x40')],'outboundDropCallsDayACS':_0x5ce540['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x5ce540[_0xfa5f('0x41')],'outboundDropCallsDayTimeout':_0x5ce540['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5ce540['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5ce540[_0xfa5f('0x42')],'outboundOriginateFailureCallsDay':_0x5ce540[_0xfa5f('0x43')],'outboundReCallsDay':_0x5ce540[_0xfa5f('0x44')],'outboundRejectCallsDay':_0x5ce540[_0xfa5f('0x45')],'outboundUnknownCallsDay':_0x5ce540[_0xfa5f('0x46')],'outboundAbandonedCallsDay':_0x5ce540[_0xfa5f('0x47')],'predictiveIntervalAnsweredCalls':_0x5ce540['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x5ce540[_0xfa5f('0x48')],'predictiveIntervalAvgTalktime':_0x5ce540[_0xfa5f('0x49')],'predictiveIntervalDroppedCallsCallersExit':_0x5ce540[_0xfa5f('0x4a')],'predictiveIntervalDroppedCallsTimeout':_0x5ce540[_0xfa5f('0x4b')],'predictiveIntervalErlangCalls':_0x5ce540[_0xfa5f('0x4c')],'predictiveIntervalErlangCallsDroppedCalls':_0x5ce540[_0xfa5f('0x4d')],'predictiveIntervalHitRate':_0x5ce540[_0xfa5f('0x4e')],'predictiveIntervalMultiplicativeFactor':_0x5ce540[_0xfa5f('0x4f')],'predictiveIntervalPauses':_0x5ce540[_0xfa5f('0x50')],'predictiveIntervalAvailable':_0x5ce540['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5ce540[_0xfa5f('0x51')],'message':_0x5ce540[_0xfa5f('0x52')],'originated':_0x5ce540['originated'],'erlangCalls':_0x5ce540['erlangCalls'],'erlangCallToSecond':_0x5ce540[_0xfa5f('0x53')],'erlangAbandonmentRate':_0x5ce540[_0xfa5f('0x54')],'erlangBusyFactor':_0x5ce540[_0xfa5f('0x55')],'startPredictive':_0x5ce540[_0xfa5f('0x56')],'startProgressive':_0x5ce540[_0xfa5f('0x57')]};if(_0x5ce540[_0xfa5f('0x58')]){_0x3ba6e6[_0xfa5f('0x58')]={'id':_0x5ce540[_0xfa5f('0x58')]['id'],'name':_0x5ce540[_0xfa5f('0x58')]['name'],'active':_0x5ce540[_0xfa5f('0x58')][_0xfa5f('0x59')],'callerid':_0x5ce540[_0xfa5f('0x58')]['callerid']};}if(_0x5ce540['Interval']){_0x3ba6e6[_0xfa5f('0x5a')]={'id':_0x5ce540[_0xfa5f('0x5a')]['id'],'name':_0x5ce540[_0xfa5f('0x5a')][_0xfa5f('0x2c')]};}var _0x3b3efb=md5(JSON[_0xfa5f('0x5b')](_0x3ba6e6));if(_0x5ce540[_0xfa5f('0x5')]!==_0x3b3efb){_0x5ce540[_0xfa5f('0x5')]=_0x3b3efb;emit(util[_0xfa5f('0x5c')](_0xfa5f('0x5d'),_0x3ba6e6[_0xfa5f('0x2c')]),_0xfa5f('0x5e'),_0x3ba6e6);}}}function emitVoiceQueueChannelRemove(_0x463997){logger[_0xfa5f('0x5f')](_0xfa5f('0x60'),JSON[_0xfa5f('0x5b')](_0x463997));emit(util['format'](_0xfa5f('0x5d'),_0x463997[_0xfa5f('0x2c')]),_0xfa5f('0x61'),_0x463997);io[_0xfa5f('0x29')]('voice_queue_presence:remove',_0x463997);}function notSendMessagesQueue(_0x56ef52){if(_0x56ef52[_0xfa5f('0x62')]){if(_0x56ef52['originated']===0x0&&_0x56ef52[_0xfa5f('0x2f')]===0x0){_0x56ef52['sendMessageOneNotActive']=![];_0x56ef52[_0xfa5f('0x63')]=0x0;_0x56ef52[_0xfa5f('0x64')]=0x0;_0x56ef52[_0xfa5f('0x52')]=_0xfa5f('0x65');ut['logger'](_0xfa5f('0x66'),_0x56ef52['name']+_0xfa5f('0x67'));}else{_0x56ef52[_0xfa5f('0x52')]=_0xfa5f('0x68');ut[_0xfa5f('0x69')](_0xfa5f('0x66'),_0x56ef52[_0xfa5f('0x2c')]+'\x20is\x20disactive');}emitCampaignPreview(_0x56ef52);}}Preview[_0xfa5f('0x6a')][_0xfa5f('0x28')]=function(){var _0x4bfa1d=this;setInterval(function(){_0x4bfa1d[_0xfa5f('0x6b')]();},0x7cf);};Preview[_0xfa5f('0x6a')][_0xfa5f('0x6b')]=function(){var _0x5e121a=this['campaignsPreview'];this[_0xfa5f('0x19')]+=0x1;for(var _0x151143 in _0x5e121a){if(_0x5e121a[_0xfa5f('0x6c')](_0x151143)&&(_0x5e121a[_0x151143][_0xfa5f('0x38')]===_0xfa5f('0x9')||_0x5e121a[_0x151143]['dialMethod']==='booked')&&_0x5e121a[_0x151143][_0xfa5f('0x2a')]===_0xfa5f('0x2b')){if(this['clockClearZombieChannels']>0x7){this[_0xfa5f('0x19')]=0x0;this[_0xfa5f('0x6d')]();}}if(_0x5e121a[_0xfa5f('0x6c')](_0x151143)&&_0x5e121a[_0x151143][_0xfa5f('0x38')]===_0xfa5f('0x9')&&_0x5e121a[_0x151143]['type']===_0xfa5f('0x2b')){if(_0x5e121a[_0x151143][_0xfa5f('0x37')]){this[_0xfa5f('0x6e')](_0x5e121a[_0x151143]);this['recallMe'](_0x5e121a[_0x151143]);}else{notSendMessagesQueue(_0x5e121a[_0x151143]);}}}};Preview[_0xfa5f('0x6a')][_0xfa5f('0x6f')]=function(_0x45e809){var _0x29bb9e=this;this[_0xfa5f('0x13')]['enqueue'](function(){if(!_[_0xfa5f('0x70')](_0x29bb9e[_0xfa5f('0x17')][_0x45e809])){loggerAction['info']('[clearZombieChannels][talking]',_0x45e809,_0xfa5f('0x71'),_0x29bb9e[_0xfa5f('0x17')][_0x45e809][_0xfa5f('0x72')],'originated:\x20',JSON[_0xfa5f('0x5b')](_0x29bb9e['campaignsPreview'][_0x29bb9e[_0xfa5f('0x17')][_0x45e809]['queue']][_0xfa5f('0x73')]),_0xfa5f('0x74'),JSON[_0xfa5f('0x5b')](_0x29bb9e['campaignsPreview'][_0x29bb9e['actions'][_0x45e809][_0xfa5f('0x72')]][_0xfa5f('0x2f')]),JSON[_0xfa5f('0x5b')](_0x29bb9e['actions'][_0x45e809][_0xfa5f('0x75')]),JSON[_0xfa5f('0x5b')](_[_0xfa5f('0x76')](_0x29bb9e[_0xfa5f('0x17')][_0x45e809],[_0xfa5f('0x77'),'UserId',_0xfa5f('0x78'),_0xfa5f('0x79')])));return ami[_0xfa5f('0x7a')]({'action':'status','channel':_0x29bb9e[_0xfa5f('0x17')][_0x45e809]['channel']})[_0xfa5f('0x7b')](function(_0x12a383){if(_0x12a383[_0xfa5f('0x52')]===_0xfa5f('0x7c')){setTimeout(function(){if(_0x29bb9e[_0xfa5f('0x17')][_0x45e809]){ut['updateOriginated'](_0x29bb9e['campaignsPreview'][_0x29bb9e[_0xfa5f('0x17')][_0x45e809]['queue']],'[clearZombieChannel]');if(_0x29bb9e[_0xfa5f('0x17')][_0x45e809][_0xfa5f('0x75')]===!![]){ut[_0xfa5f('0x7d')](_0x29bb9e[_0xfa5f('0x14')][_0x29bb9e['actions'][_0x45e809][_0xfa5f('0x72')]],_0xfa5f('0x7e'));ut[_0xfa5f('0x7f')](_0xfa5f('0x80')+_0x45e809,_0x29bb9e[_0xfa5f('0x17')][_0x45e809][_0xfa5f('0x72')]);}ut['loggerError'](_0xfa5f('0x81')+_0x45e809,_0x29bb9e[_0xfa5f('0x17')][_0x45e809]['queue']);delete _0x29bb9e['actions'][_0x45e809];}},0x2328);}});}});};Preview[_0xfa5f('0x6a')][_0xfa5f('0x6d')]=function(){var _0x53c37d=this;loggerAction[_0xfa5f('0x5f')](_0xfa5f('0x82'),_[_0xfa5f('0x83')](this[_0xfa5f('0x17')]));for(var _0x2ed7af in this[_0xfa5f('0x17')]){if(_0x53c37d[_0xfa5f('0x17')][_0xfa5f('0x6c')](_0x2ed7af)){_0x53c37d[_0xfa5f('0x6f')](_0x2ed7af);}}};Preview[_0xfa5f('0x6a')][_0xfa5f('0x84')]=function(_0x5ed0c9){var _0x108f07=this;rpcDb[_0xfa5f('0x85')](_0x5ed0c9['id'],ut['agentReadyId'](this[_0xfa5f('0x18')]))[_0xfa5f('0x86')](function(_0x253f32){if(!_[_0xfa5f('0x70')](_0x253f32)){for(var _0x549955=0x0;_0x549955<_0x253f32[_0xfa5f('0x87')];_0x549955+=0x1){if(ut[_0xfa5f('0x88')](_0x253f32[_0x549955][_0xfa5f('0x89')])<_0x5ed0c9[_0xfa5f('0x8a')]*0x3c){if(_0x253f32[_0x549955]['Agent']&&!_0x253f32[_0x549955]['Agent'][_0xfa5f('0x8b')]){_0x108f07[_0xfa5f('0x8c')](_0x253f32[_0x549955]['id'])['then'](ut[_0xfa5f('0x8d')]('[RecallMe]'))['catch'](ut[_0xfa5f('0x8d')](_0xfa5f('0x8e')));}else{rpcDb['disableContact'](_0x253f32[_0x549955]['id']);}}else{var _0x521dc2=new Action(_0x253f32[_0x549955],_0x5ed0c9);_0x521dc2[_0xfa5f('0x8f')]=moment()['format'](_0xfa5f('0x90'));_0x5ed0c9[_0xfa5f('0x44')]+=0x1;ut[_0xfa5f('0x91')](_0x521dc2,0x17,_0xfa5f('0x92'));if(_0x5ed0c9[_0xfa5f('0x93')]){rpcDb['rescheduleContactInQueue'](ut[_0xfa5f('0x94')](_0x253f32[_0x549955]));rpcDb[_0xfa5f('0x95')](_0x521dc2,_0xfa5f('0x96'));}else{ut[_0xfa5f('0x91')](_0x521dc2,0x16,_0xfa5f('0x97'));rpcDb[_0xfa5f('0x95')](_0x521dc2,'[HistoryRecallClose]');rpcDb[_0xfa5f('0x98')](_0x521dc2,'[HistoryRecallClose]');}}}}})[_0xfa5f('0x7b')](ut[_0xfa5f('0x8d')](_0xfa5f('0x99')));};Preview[_0xfa5f('0x6a')][_0xfa5f('0x6e')]=function(_0x3e717b){_0x3e717b[_0xfa5f('0x62')]=!![];if(ut['IsNotLoggedIn'](_0x3e717b['loggedIn'])){_0x3e717b['message']=_0xfa5f('0x9a');}else if(!ut['isActive'](_0x3e717b[_0xfa5f('0x37')])){_0x3e717b['message']=_0xfa5f('0x65');}else if(!this[_0xfa5f('0x9b')](_0x3e717b['Trunk'])){if(!this['isTrunkReachable'](_0x3e717b['TrunkBackup'])){_0x3e717b['message']=_0xfa5f('0x9c');}else{_0x3e717b[_0xfa5f('0x52')]=_0xfa5f('0x9d');}}else{_0x3e717b['message']=_0xfa5f('0x9d');}emitCampaignPreview(_0x3e717b);};Preview[_0xfa5f('0x6a')][_0xfa5f('0x9e')]=function(_0x398709,_0x391f92,_0x1213fe){var _0x1b6039=this;var _0x3d4c16=this[_0xfa5f('0x17')][_0x391f92];var _0x2e4a04=this['campaignsPreview'][_0x3d4c16[_0xfa5f('0x72')]];var _0x36f51c;if(_0x2e4a04){switch(_0x1213fe){case'1':_0x2e4a04['outboundNoSuchCallsDay']+=0x1;_0x3d4c16['countnosuchnumberretry']+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut['logCustomer'](_0x3d4c16,0x0,_0xfa5f('0xa1'));ami[_0xfa5f('0x29')](_0xfa5f('0xa2'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xa4')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xa5'));if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut[_0xfa5f('0xa7')](_0x3d4c16,0xf,_0xfa5f('0xa8'));rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xa9'));}else{if(_0x3d4c16[_0xfa5f('0xaa')]>=_0x2e4a04['dialNoSuchNumberMaxRetry']){rpcDb[_0xfa5f('0x98')](_0x3d4c16,_0xfa5f('0xa9'));}else{rpcDb[_0xfa5f('0xab')](ut['scheduledAt'](_0x3d4c16,'countnosuchnumberretry',_0x2e4a04[_0xfa5f('0xac')]),_0x3d4c16[_0xfa5f('0xad')],_0x3d4c16[_0xfa5f('0xae')]);}}delete this[_0xfa5f('0x17')][_0x398709[_0xfa5f('0xaf')]];break;case _0xfa5f('0xb0'):var _0x225e61=moment()[_0xfa5f('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d4c16['responsetime']=_0x225e61;_0x3d4c16[_0xfa5f('0xb1')]=_0x225e61;_0x3d4c16[_0xfa5f('0x75')]=!![];_0x2e4a04[_0xfa5f('0x2f')]+=0x1;logger[_0xfa5f('0x5f')](_0xfa5f('0xb2'),_0x3d4c16[_0xfa5f('0xb3')],_0xfa5f('0xb4'),_0x2e4a04['name'],_0xfa5f('0x74'),_0x2e4a04['pTalking']);ami[_0xfa5f('0x29')](_0xfa5f('0xb5'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xb6'),this[_0xfa5f('0x14')][_0x3d4c16[_0xfa5f('0x72')]]));if(_0x2e4a04[_0xfa5f('0xb7')]){ami[_0xfa5f('0x29')](_0xfa5f('0xb8'),ut[_0xfa5f('0xb9')](_0x3d4c16));}break;case'16':ami[_0xfa5f('0x29')]('custom:agentcomplete',ut['buildObj'](_0x3d4c16,_0xfa5f('0xba'),this[_0xfa5f('0x14')][_0x3d4c16[_0xfa5f('0x72')]]));emitVoiceQueueChannelRemove(ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xba')));_0x2e4a04['outboundAnswerCallsDay']+=0x1;_0x2e4a04[_0xfa5f('0x33')]+=0x1;_0x2e4a04['answered']+=0x1;ut[_0xfa5f('0x7d')](_0x2e4a04,_0xfa5f('0xbb'));_0x3d4c16[_0xfa5f('0x9f')]=ut['totalGlobal'](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0x4,_0xfa5f('0xbc'));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xbd'));rpcDb[_0xfa5f('0x98')](_0x3d4c16,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xfa5f('0xbe')](_0x3d4c16);_0x2e4a04[_0xfa5f('0x30')]+=_0x3d4c16[_0xfa5f('0xbf')];_0x2e4a04[_0xfa5f('0xc0')]+=_0x3d4c16[_0xfa5f('0xbf')];logger[_0xfa5f('0x5f')](_0xfa5f('0xc1'),_0x3d4c16['uniqueid'],_0xfa5f('0xb4'),_0x2e4a04['name'],'pTalking:\x20',_0x2e4a04[_0xfa5f('0x2f')]);delete this[_0xfa5f('0x17')][_0x398709['linkedid']];break;case _0xfa5f('0xc2'):_0x2e4a04[_0xfa5f('0x3f')]+=0x1;_0x3d4c16[_0xfa5f('0xc3')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0x5,_0xfa5f('0xc4'));ami['emit'](_0xfa5f('0xc5'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xc6')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xc7'));if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut['cloneAction'](_0x3d4c16,0xf,_0xfa5f('0xa8'));rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xc8'));}else{if(_0x3d4c16[_0xfa5f('0xc3')]>=_0x2e4a04['dialBusyMaxRetry']){rpcDb[_0xfa5f('0x98')](_0x3d4c16,_0xfa5f('0xc7'));}else{rpcDb[_0xfa5f('0xab')](ut[_0xfa5f('0xc9')](_0x3d4c16,_0xfa5f('0xc3'),_0x2e4a04[_0xfa5f('0xca')]),_0x3d4c16[_0xfa5f('0xad')],_0x3d4c16[_0xfa5f('0xae')]);}}break;case _0xfa5f('0xcb'):_0x2e4a04[_0xfa5f('0xcc')]+=0x1;_0x3d4c16[_0xfa5f('0xcd')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0x3,_0xfa5f('0xce'));ami[_0xfa5f('0x29')](_0xfa5f('0xcf'),ut['buildObj'](_0x3d4c16,_0xfa5f('0xd0')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut['cloneAction'](_0x3d4c16,0xf,_0xfa5f('0xa8'));rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xd1'));}else{if(_0x3d4c16[_0xfa5f('0xcd')]>=_0x2e4a04[_0xfa5f('0xd2')]){rpcDb[_0xfa5f('0x98')](_0x3d4c16,_0xfa5f('0xd3'));}else{rpcDb[_0xfa5f('0xab')](ut['scheduledAt'](_0x3d4c16,_0xfa5f('0xcd'),_0x2e4a04['dialNoAnswerRetryFrequency']),_0x3d4c16[_0xfa5f('0xad')],_0x3d4c16[_0xfa5f('0xae')]);}}break;case _0xfa5f('0xd4'):_0x2e4a04[_0xfa5f('0x40')]+=0x1;_0x3d4c16[_0xfa5f('0xd5')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0x8,_0xfa5f('0xd6'));ami[_0xfa5f('0x29')](_0xfa5f('0xd7'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xd8')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xd9'));if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut['cloneAction'](_0x3d4c16,0xf,'Global');rpcDb['createCustomerFinal'](_0x36f51c,_0xfa5f('0xda'));}else{if(_0x3d4c16[_0xfa5f('0xd5')]>=_0x2e4a04[_0xfa5f('0xdb')]){rpcDb[_0xfa5f('0x98')](_0x3d4c16,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xfa5f('0xab')](ut[_0xfa5f('0xc9')](_0x3d4c16,_0xfa5f('0xd5'),_0x2e4a04[_0xfa5f('0xca')]),_0x3d4c16[_0xfa5f('0xad')],_0x3d4c16[_0xfa5f('0xae')]);}}break;case _0xfa5f('0xdc'):_0x2e4a04[_0xfa5f('0x45')]+=0x1;_0x3d4c16[_0xfa5f('0xdd')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut['totalGlobal'](_0x3d4c16);ut['logCustomer'](_0x3d4c16,0x14,_0xfa5f('0xde'));ami[_0xfa5f('0x29')](_0xfa5f('0xdf'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xe0')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xe1'));if(ut['totalGlobal'](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut[_0xfa5f('0xa7')](_0x3d4c16,0x14,_0xfa5f('0xde'));rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xe2'));}else{if(_0x3d4c16[_0xfa5f('0xdd')]>=_0x2e4a04['dialAgentRejectMaxRetry']){rpcDb[_0xfa5f('0x98')](_0x3d4c16,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xfa5f('0xab')](ut[_0xfa5f('0xc9')](_0x3d4c16,_0xfa5f('0xdd'),_0x2e4a04[_0xfa5f('0xe3')]),_0x3d4c16['unlockAgent'],_0x3d4c16[_0xfa5f('0xae')]);}}break;case _0xfa5f('0xe4'):_0x2e4a04[_0xfa5f('0x47')]+=0x1;_0x3d4c16[_0xfa5f('0xe5')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut['logCustomer'](_0x3d4c16,0xb,_0xfa5f('0xe6'));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xe7'));if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut[_0xfa5f('0xa7')](_0x3d4c16,0xf,_0xfa5f('0xa8'));rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xe7'));}else{if(_0x3d4c16[_0xfa5f('0xe8')]>=_0x2e4a04[_0xfa5f('0xe9')]){rpcDb[_0xfa5f('0x98')](_0x3d4c16,_0xfa5f('0xe7'));}else{rpcDb[_0xfa5f('0xab')](ut[_0xfa5f('0xc9')](_0x3d4c16,_0xfa5f('0xe5'),_0x2e4a04['dialAbandonedRetryFrequency']),_0x3d4c16['unlockAgent'],_0x3d4c16[_0xfa5f('0xae')]);}}break;case'18':_0x2e4a04[_0xfa5f('0x46')]+=0x1;_0x3d4c16[_0xfa5f('0xea')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0x12,_0x398709['cause-txt']||_0x398709['dialstatus']);ami[_0xfa5f('0x29')](_0xfa5f('0xeb'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xec')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,'[callProgressDetectingCustomer][hangupInAMD]');if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut[_0xfa5f('0xa7')](_0x3d4c16,0xf,_0xfa5f('0xa8'));rpcDb['createCustomerFinal'](_0x36f51c,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xfa5f('0x98')](_0x3d4c16,_0xfa5f('0xed'));}delete this[_0xfa5f('0x17')][_0x398709[_0xfa5f('0xaf')]];break;case'19':_0x2e4a04[_0xfa5f('0x46')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut['totalGlobal'](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0x13,_0x398709[_0xfa5f('0xee')]||_0x398709[_0xfa5f('0xef')]);ami['emit'](_0xfa5f('0xeb'),ut[_0xfa5f('0xa3')](_0x3d4c16,_0xfa5f('0xec')));rpcDb[_0xfa5f('0x95')](_0x3d4c16,_0xfa5f('0xf0'));if(ut['totalGlobal'](_0x3d4c16)>=_0x2e4a04['dialGlobalMaxRetry']){_0x36f51c=ut['cloneAction'](_0x3d4c16,0xf,'Global');rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xf0'));}else{rpcDb[_0xfa5f('0x98')](_0x3d4c16,_0xfa5f('0xf0'));}delete this['actions'][_0x398709[_0xfa5f('0xaf')]];break;default:if(_0x3d4c16[_0xfa5f('0x75')]){ut[_0xfa5f('0x7d')](_0x2e4a04,'[default]');ut[_0xfa5f('0x7f')](_0xfa5f('0xf1')+_0x2e4a04[_0xfa5f('0x2c')],_0x398709);}_0x2e4a04[_0xfa5f('0x46')]+=0x1;_0x3d4c16[_0xfa5f('0x9f')]=ut[_0xfa5f('0xa0')](_0x3d4c16);ut[_0xfa5f('0x91')](_0x3d4c16,0xc,_0x398709[_0xfa5f('0xee')]||_0x398709[_0xfa5f('0xef')]);rpcDb['createCustomerHistory'](_0x3d4c16,_0xfa5f('0xf2'));if(ut[_0xfa5f('0xa0')](_0x3d4c16)>=_0x2e4a04[_0xfa5f('0xa6')]){_0x36f51c=ut[_0xfa5f('0xa7')](_0x3d4c16,0xf,_0xfa5f('0xa8'));rpcDb[_0xfa5f('0x98')](_0x36f51c,_0xfa5f('0xf3'));}else{rpcDb['createCustomerFinal'](_0x3d4c16,_0xfa5f('0xf3'));}delete this[_0xfa5f('0x17')][_0x398709[_0xfa5f('0xaf')]];}if(!(_0x3d4c16['dialAnswer']&&_0x1213fe==='16')){ut[_0xfa5f('0xf4')](_0x2e4a04,_0xfa5f('0xf5'));logger['info'](_0xfa5f('0xf6'),_0x3d4c16[_0xfa5f('0xb3')],'\x20Queue',_0x2e4a04[_0xfa5f('0x2c')],_0xfa5f('0xf7'),_0x2e4a04[_0xfa5f('0x73')]);}if(_0x1213fe!==_0xfa5f('0xb0')){delete this[_0xfa5f('0x17')][_0x398709[_0xfa5f('0xaf')]];delete this[_0xfa5f('0x17')][_0x398709[_0xfa5f('0xf8')]];}}};Preview[_0xfa5f('0x6a')]['callProgressDetectingAgent']=function(_0x87040a,_0x5485f1,_0x4a817d){if(_[_0xfa5f('0xf9')](_0x5485f1)&&_0xfa5f('0xfa')!==typeof _0x5485f1){return;}if(_['isUndefined'](_0x4a817d)&&_0xfa5f('0xfa')!==typeof _0x4a817d){return;}switch(_0x4a817d['reason']){case'0':ut[_0xfa5f('0xfb')](_0x87040a,0x0,'NoSuchNumber');rpcDb[_0xfa5f('0xfc')](_0x87040a,_0xfa5f('0xfd'));break;case'3':ut[_0xfa5f('0xfb')](_0x87040a,0x3,_0xfa5f('0xce'));rpcDb['createAgentHistory'](_0x87040a,_0xfa5f('0xfe'));break;case'5':ut[_0xfa5f('0xfb')](_0x87040a,0x5,_0xfa5f('0xc4'));rpcDb['createAgentHistory'](_0x87040a,_0xfa5f('0xff'));break;case'8':ut[_0xfa5f('0xfb')](_0x87040a,0x8,_0xfa5f('0xd6'));rpcDb[_0xfa5f('0xfc')](_0x87040a,_0xfa5f('0x100'));break;case'22':ut[_0xfa5f('0xfb')](_0x87040a,0x16,_0xfa5f('0x101'));rpcDb[_0xfa5f('0xfc')](_0x87040a,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xfa5f('0xfb')](_0x87040a,0xc,_0x4a817d['reason']);rpcDb[_0xfa5f('0xfc')](_0x87040a,_0xfa5f('0x100'));}ut['updateOriginated'](_0x5485f1,_0xfa5f('0x102'));logger[_0xfa5f('0x5f')](_0xfa5f('0x103'),_0x87040a[_0xfa5f('0xb3')],_0xfa5f('0xb4'),_0x5485f1[_0xfa5f('0x2c')],_0xfa5f('0xf7'),_0x5485f1[_0xfa5f('0x73')]);delete this['actions'][_0x87040a['uniqueid']];};Preview[_0xfa5f('0x6a')]['checkInBlack']=function(_0xdf4bb8,_0x4e36e4,_0x5eaaa5,_0x4d1900,_0x50b01d){var _0x3b1eaf=this;return new BPromise(function(_0x540c62,_0x14bac5){if(_['isNil'](_0x4e36e4)||_[_0xfa5f('0x70')](_0x4e36e4['Contact'])||_[_0xfa5f('0x70')](_0x4e36e4['Contact']['phone'])||_[_0xfa5f('0x70')](_0x4e36e4[_0xfa5f('0x78')])){_0x14bac5(ut['message'](_0xfa5f('0x104'),_0x4d1900,_0x50b01d));return;}var _0x242c16=uuid['v4']();var _0x14eb1e=_0x3b1eaf['campaignsPreview'][_0x4e36e4['Queue'][_0xfa5f('0x2c')]];var _0x58b910=_0x5eaaa5?_0x3b1eaf[_0xfa5f('0x18')][_0x5eaaa5]['id']:undefined;_0x3b1eaf[_0xfa5f('0x17')][_0x242c16]=new Action(_0x4e36e4,_0x14eb1e,_0x242c16,_0x5eaaa5,_0x58b910);var _0x336439=_0x3b1eaf[_0xfa5f('0x17')][_0x242c16];_0x336439[_0xfa5f('0xad')]=_0x4d1900;_0x336439['activeContact']=_0x50b01d;_0x336439[_0xfa5f('0x105')]=_0x5eaaa5;if(_[_0xfa5f('0x106')](_0xdf4bb8)){_0x3b1eaf[_0xfa5f('0x107')](_0x336439,_0x14eb1e,_0x4e36e4,_0x5eaaa5)['then'](function(_0x248918){logger[_0xfa5f('0x5f')](_0xfa5f('0x108'),_0xfa5f('0x109')+_0x336439[_0xfa5f('0x72')]+_0xfa5f('0x10a')+_0x336439[_0xfa5f('0x10b')],JSON['stringify'](_0x248918));ami[_0xfa5f('0x29')](_0xfa5f('0x10c'),ut[_0xfa5f('0xa3')](_0x336439,_0xfa5f('0x10d'),_0x3b1eaf[_0xfa5f('0x14')][_0x336439[_0xfa5f('0x72')]]));_0x540c62(ut[_0xfa5f('0x52')](_0xfa5f('0x10e')));})[_0xfa5f('0x7b')](function(_0x802329){ut[_0xfa5f('0x69')](_0xfa5f('0x10f'),_0x802329);_0x14bac5(ut[_0xfa5f('0x52')]('Call\x20failed',_0x4d1900,_0x50b01d));});}else{_0x14eb1e[_0xfa5f('0x3e')]+=0x1;ut[_0xfa5f('0x110')](_0x336439);rpcDb['createHistory'](_0x336439,_0xfa5f('0x111'));delete _0x3b1eaf['actions'][_0x242c16];_0x14bac5(ut[_0xfa5f('0x52')](_0xfa5f('0x112'),_0x4d1900,_0x50b01d));}});};Preview[_0xfa5f('0x6a')][_0xfa5f('0x9b')]=function(_0x480483){return!_[_0xfa5f('0x70')](_0x480483)&&!_[_0xfa5f('0x70')](_0x480483[_0xfa5f('0x2c')])&&!_['isNil'](_0x480483[_0xfa5f('0x59')])&&_0x480483[_0xfa5f('0x59')]&&!_[_0xfa5f('0x70')](this[_0xfa5f('0x16')][util[_0xfa5f('0x5c')](_0xfa5f('0x113'),_0x480483[_0xfa5f('0x2c')])])&&!_[_0xfa5f('0x70')](this['trunks'][util[_0xfa5f('0x5c')](_0xfa5f('0x113'),_0x480483[_0xfa5f('0x2c')])]['status'])&&(this[_0xfa5f('0x16')][util[_0xfa5f('0x5c')](_0xfa5f('0x113'),_0x480483[_0xfa5f('0x2c')])]['status']===_0xfa5f('0x114')||this[_0xfa5f('0x16')][util[_0xfa5f('0x5c')](_0xfa5f('0x113'),_0x480483['name'])]['status']===_0xfa5f('0x115'));};Preview[_0xfa5f('0x6a')]['run']=function(_0x8d0064,_0x209702){var _0x4fab11=this;return new BPromise(function(_0x460d54,_0x21f3de){_0x4fab11['execRun'](_0x8d0064,_0x209702)['then'](function(_0x3d1eef){_0x460d54(_['pick'](_0x3d1eef,['message']));})[_0xfa5f('0x7b')](function(_0x484073){if(_0x484073['unlock']){rpcDb['unlockContact'](_0x8d0064);}if(_0x484073[_0xfa5f('0x59')]){rpcDb[_0xfa5f('0x116')](_0x8d0064);}_0x21f3de(_[_0xfa5f('0x76')](_0x484073,['message']));});});};Preview['prototype'][_0xfa5f('0x117')]=function(_0x247ad9,_0x1fc697){var _0xe2733=this;return new BPromise(function(_0x48bc40,_0x2894ed){var _0x39cc8b,_0x3fd257;rpcDb['getContactPreview'](_0x247ad9)[_0xfa5f('0x86')](function(_0x132197){if(!_['isNil'](_0x132197[0x0])){_0x3fd257=_0x132197[0x0][_0xfa5f('0x118')]?![]:!![];_0x39cc8b=_0x132197[0x0]['recallme']?!![]:![];_0x39cc8b=_0x1fc697?!![]:_0x39cc8b;}var _0x5d63c4=_0xe2733[_0xfa5f('0x119')](_0x132197);if(_0x5d63c4['isValid']){rpcDb[_0xfa5f('0x11a')](_[_0xfa5f('0x76')](_0x132197[0x0],['VoiceQueueId','Contact.phone']))[_0xfa5f('0x86')](function(_0x3ffee1){_0xe2733[_0xfa5f('0x11b')](_0x3ffee1,_0x132197[0x0],_0x1fc697,_0x3fd257,_0x39cc8b)['then'](function(_0x18d081){_0x48bc40(_0x18d081);})[_0xfa5f('0x7b')](function(_0x25ab20){_0x2894ed(_0x25ab20);});})[_0xfa5f('0x7b')](function(_0x482f7d){ut[_0xfa5f('0x69')](_0xfa5f('0x11c'),_0x482f7d);_0x2894ed(ut[_0xfa5f('0x52')](_0xfa5f('0x11d'),_0x3fd257,_0x39cc8b));});}else{_0x2894ed(ut[_0xfa5f('0x52')](_0x5d63c4[_0xfa5f('0x52')],_0x3fd257,_0x39cc8b));}})[_0xfa5f('0x7b')](function(_0x16923b){ut['logger'](_0xfa5f('0x11e'),_0x16923b);_0x2894ed(ut['message'](_0xfa5f('0x11d'),![],!![]));});});};Preview[_0xfa5f('0x6a')][_0xfa5f('0x119')]=function(_0xf1dd0b){if(_[_0xfa5f('0x70')](_0xf1dd0b)||_[_0xfa5f('0x106')](_0xf1dd0b)||!_[_0xfa5f('0x70')](_0xf1dd0b[0x0][_0xfa5f('0x11f')])&&_[_0xfa5f('0x70')](_0xf1dd0b[0x0][_0xfa5f('0x11f')]['name'])){ut[_0xfa5f('0x69')](_0xfa5f('0x120'),_0xf1dd0b);return{'isValid':![],'message':_0xfa5f('0x121')};}var _0x39ca93=this[_0xfa5f('0x14')][_0xf1dd0b[0x0][_0xfa5f('0x71')][_0xfa5f('0x2c')]];_0x39ca93[_0xfa5f('0x52')]=_0xfa5f('0x9d');if(_[_0xfa5f('0x70')](_0x39ca93)){ut[_0xfa5f('0x69')](_0xfa5f('0x122'),_0x39ca93);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xfa5f('0x9b')](_0x39ca93['Trunk'])){ut[_0xfa5f('0x69')](_0xfa5f('0x123'),_0xfa5f('0x124')+_0x39ca93[_0xfa5f('0x2c')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x39ca93[_0xfa5f('0x125')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x39ca93[_0xfa5f('0x2c')]+_0xfa5f('0x126'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x39ca93[_0xfa5f('0x37')])){ut[_0xfa5f('0x69')](_0xfa5f('0x127'),_0x39ca93[_0xfa5f('0x2c')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x39ca93['name']+_0xfa5f('0x128')};}return{'isValid':!![],'message':_0xfa5f('0x129')};};Preview[_0xfa5f('0x6a')]['execCall']=function(_0x19d128,_0x420d35,_0x3d1757,_0x275793){var _0x39605a=this;return new BPromise(function(_0x523149,_0x4737f4){var _0x21cc81=_0x19d128[_0xfa5f('0xb3')];var _0x2876a2=_0x39605a[_0xfa5f('0x9b')](_0x420d35[_0xfa5f('0x58')])?util[_0xfa5f('0x5c')](_0xfa5f('0x12a'),_0x420d35[_0xfa5f('0x58')][_0xfa5f('0x2c')],_[_0xfa5f('0x70')](_0x420d35[_0xfa5f('0x3b')])?'':_0x420d35['dialPrefix'][_0xfa5f('0x12b')]()||'',_0x420d35[_0xfa5f('0x12c')]>0x0?_0x3d1757[_0xfa5f('0x12d')]['phone'][_0xfa5f('0x12e')](_0x420d35['dialCutDigit']):_0x3d1757[_0xfa5f('0x12d')]['phone']):util[_0xfa5f('0x5c')](_0xfa5f('0x12a'),_[_0xfa5f('0x70')](_0x420d35[_0xfa5f('0x125')])?_0x420d35['Trunk']['name']:_0x420d35[_0xfa5f('0x125')][_0xfa5f('0x2c')],_[_0xfa5f('0x70')](_0x420d35[_0xfa5f('0x3b')])?'':_0x420d35[_0xfa5f('0x3b')][_0xfa5f('0x12b')]()||'',_0x420d35['dialCutDigit']>0x0?_0x3d1757['Contact'][_0xfa5f('0x12f')][_0xfa5f('0x12e')](_0x420d35['dialCutDigit']):_0x3d1757['Contact']['phone']);var _0x4b1297=_0x39605a[_0xfa5f('0x9b')](_0x420d35[_0xfa5f('0x58')])?ut['getCallerId'](_0x420d35['Trunk'][_0xfa5f('0x130')],_0x420d35[_0xfa5f('0x39')],_0x420d35[_0xfa5f('0x131')]>0x0?ut['getCallerIdRandom'](_0x420d35[_0xfa5f('0x3a')],_0x420d35[_0xfa5f('0x131')]):_0x420d35[_0xfa5f('0x3a')]):ut[_0xfa5f('0x132')](_[_0xfa5f('0x70')](_0x420d35['TrunkBackup'])?_0x420d35[_0xfa5f('0x58')][_0xfa5f('0x130')]:_0x420d35['TrunkBackup'][_0xfa5f('0x130')],_0x420d35[_0xfa5f('0x39')],_0x420d35[_0xfa5f('0x131')]>0x0?ut[_0xfa5f('0x133')](_0x420d35[_0xfa5f('0x3a')],_0x420d35[_0xfa5f('0x131')]):_0x420d35[_0xfa5f('0x3a')]);if(_0x4b1297){_0x19d128['originatecalleridname']=ut[_0xfa5f('0x134')](_0x4b1297);_0x19d128[_0xfa5f('0x135')]=ut[_0xfa5f('0x136')](_0x4b1297);}var _0x34a249=ut[_0xfa5f('0x137')](_0x420d35,_0x3d1757,_0x2876a2,_0x4b1297,_0x21cc81,_0x19d128);_['merge'](_0x19d128,ut['toLowerVariables'](_0x34a249));_0x19d128[_0xfa5f('0x8f')]=moment()[_0xfa5f('0x5c')](_0xfa5f('0x90'));ami[_0xfa5f('0x7a')](ut[_0xfa5f('0x138')](_0x19d128,_0x420d35,_0x34a249,_0x19d128[_0xfa5f('0xae')],_0x275793))[_0xfa5f('0x86')](function(_0xc28899){var _0x3a6617=_0x19d128[_0xfa5f('0x139')];if(!_[_0xfa5f('0x70')](_0x3a6617)){if(!_[_0xfa5f('0x70')](_0x39605a[_0xfa5f('0x18')][_0x3a6617])){_0x39605a[_0xfa5f('0x18')][_0x3a6617][_0xfa5f('0x13a')]=_0x19d128[_0xfa5f('0x13b')];emit(util['format']('user:%s',_0x39605a[_0xfa5f('0x18')][_0x3a6617][_0xfa5f('0x2c')]),_0xfa5f('0x13c'),{'destaccountcode':_0x39605a[_0xfa5f('0x18')][_0x3a6617]['accountcode'],'destconnectedlinenum':_0x19d128[_0xfa5f('0x13b')]});}}_0x420d35[_0xfa5f('0x73')]+=0x1;logger[_0xfa5f('0x5f')](_0xfa5f('0x13d'),_0x21cc81,'\x20Queue',_0x420d35[_0xfa5f('0x2c')],_0xfa5f('0xf7'),_0x420d35[_0xfa5f('0x73')]);_0x523149(_0xc28899);})[_0xfa5f('0x7b')](function(_0x6b9395){ut['logAgent'](_0x19d128,0xe,_0xfa5f('0x13e'));rpcDb[_0xfa5f('0xfc')](_0x19d128,_0xfa5f('0x13f'));_0x4737f4(_0x6b9395);});});};Preview[_0xfa5f('0x6a')][_0xfa5f('0x24')]=function(_0x39fb5b){if(this[_0xfa5f('0x17')][_0x39fb5b['linkedid']]){this[_0xfa5f('0x17')][_0x39fb5b['linkedid']][_0xfa5f('0x140')]=_0x39fb5b['channel'];}};Preview[_0xfa5f('0x6a')][_0xfa5f('0x1b')]=function(_0x341c94){var _0x5815b6=this;var _0x502626=this[_0xfa5f('0x17')][_0x341c94[_0xfa5f('0x141')]];if(_0x502626){if(_0x502626['lookAgent']&&this[_0xfa5f('0x18')][_0x502626['lookAgent']]){ut[_0xfa5f('0x142')](_0x502626,this[_0xfa5f('0x18')][_0x502626[_0xfa5f('0x105')]][_0xfa5f('0x2c')],this['agents'][_0x502626[_0xfa5f('0x105')]]['id']);}var _0x3130e1=_[_0xfa5f('0x143')](_0x502626);_0x3130e1[_0xfa5f('0x144')]=moment()[_0xfa5f('0x5c')](_0xfa5f('0x90'));var _0x18ff0d=_0x5815b6[_0xfa5f('0x14')][_0x502626[_0xfa5f('0x72')]];if(ut[_0xfa5f('0x145')](_0x341c94[_0xfa5f('0x146')])){if(_0x502626[_0xfa5f('0xad')]){rpcDb[_0xfa5f('0x147')](_0x502626[_0xfa5f('0x10b')]);}if(_0x502626['activeContact']){rpcDb[_0xfa5f('0x116')](_0x502626[_0xfa5f('0x10b')]);}ami[_0xfa5f('0x29')]('custom:agentringnoanswer',ut[_0xfa5f('0xa3')](_0x502626,_0xfa5f('0x148'),this['campaignsPreview'][_0x502626['queue']]));this['callProgressDetectingAgent'](_0x3130e1,_0x18ff0d,_0x341c94);}else{_0x502626['starttime']=moment()['format'](_0xfa5f('0x90'));ut['logAgent'](_0x3130e1,0x4,_0xfa5f('0xbc'));rpcDb[_0xfa5f('0xfc')](_0x3130e1,_0xfa5f('0x149'));}}};Preview['prototype'][_0xfa5f('0x1e')]=function(_0x4f9dd0){var _0x34bc75=this;var _0x3d3659=this[_0xfa5f('0x17')][_0x4f9dd0[_0xfa5f('0xaf')]];var _0x51d061;if(_0x3d3659){_0x51d061=this[_0xfa5f('0x14')][_0x3d3659[_0xfa5f('0x72')]];logger[_0xfa5f('0x5f')](_0xfa5f('0x14a'),_0x4f9dd0[_0xfa5f('0xaf')],'\x20Queue',_0x51d061[_0xfa5f('0x2c')],_0xfa5f('0x74'),_0x51d061[_0xfa5f('0x2f')]);}if(this[_0xfa5f('0x17')][_0x4f9dd0[_0xfa5f('0xaf')]]&&_0x4f9dd0[_0xfa5f('0xaf')]!==_0x4f9dd0[_0xfa5f('0xb3')]){if(_0x4f9dd0['cause']==='16'&&this[_0xfa5f('0x17')][_0x4f9dd0['linkedid']][_0xfa5f('0x75')]){this[_0xfa5f('0x9e')](_0x4f9dd0,_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0[_0xfa5f('0x14b')]);}else if(this[_0xfa5f('0x17')][_0x4f9dd0['linkedid']][_0xfa5f('0x75')]){logger[_0xfa5f('0x5f')](_0xfa5f('0x14c'),_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0[_0xfa5f('0x14b')],_0xfa5f('0xb4'),_0x51d061[_0xfa5f('0x2c')],_0xfa5f('0x74'),_0x51d061[_0xfa5f('0x2f')]);this[_0xfa5f('0x9e')](_0x4f9dd0,_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0[_0xfa5f('0x14b')]);}}else if(_0x3d3659&&_['isNil'](_0x3d3659[_0xfa5f('0x14d')])&&_0x51d061[_0xfa5f('0x14e')]&&_0x4f9dd0[_0xfa5f('0xaf')]===_0x4f9dd0[_0xfa5f('0xb3')]&&_[_0xfa5f('0x70')](_0x4f9dd0[_0xfa5f('0x14f')])&&_0x4f9dd0[_0xfa5f('0x14b')]==='16'&&_0x4f9dd0['channelstate']==='6'&&_[_0xfa5f('0xf9')](_0x3d3659[_0xfa5f('0x150')])){if(_0x3d3659[_0xfa5f('0xad')]){rpcDb[_0xfa5f('0x147')](_0x3d3659[_0xfa5f('0x10b')]);}if(_0x3d3659['activeContact']){rpcDb[_0xfa5f('0x116')](_0x3d3659['idContact']);}_0x4f9dd0[_0xfa5f('0x14f')]='22';this['callProgressDetectingAgent'](_0x3d3659,_0x51d061,_0x4f9dd0);}else if(_0x3d3659&&_0x3d3659[_0xfa5f('0x150')]){if(_0x4f9dd0[_0xfa5f('0x14b')]==='16'&&this[_0xfa5f('0x17')][_0x4f9dd0[_0xfa5f('0xaf')]][_0xfa5f('0x75')]){logger[_0xfa5f('0x5f')](_0xfa5f('0x151'),_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0['cause'],_0xfa5f('0xb4'),_0x51d061[_0xfa5f('0x2c')],_0xfa5f('0x74'),_0x51d061[_0xfa5f('0x2f')]);this[_0xfa5f('0x9e')](_0x4f9dd0,_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0[_0xfa5f('0x14b')]);}else if(this[_0xfa5f('0x17')][_0x4f9dd0[_0xfa5f('0xaf')]]['dialAnswer']){logger['info']('[syncHangup][talking][cause]',_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0[_0xfa5f('0x14b')],_0xfa5f('0xb4'),_0x51d061['name'],_0xfa5f('0x74'),_0x51d061[_0xfa5f('0x2f')]);this[_0xfa5f('0x9e')](_0x4f9dd0,_0x4f9dd0[_0xfa5f('0xaf')],_0x4f9dd0['cause']);}}};Preview[_0xfa5f('0x6a')][_0xfa5f('0x22')]=function(_0x88a8ba){if(this[_0xfa5f('0x17')][_0x88a8ba['destlinkedid']]&&_0x88a8ba[_0xfa5f('0xf8')]!==_0x88a8ba[_0xfa5f('0x152')]){this[_0xfa5f('0x9e')](_0x88a8ba,_0x88a8ba[_0xfa5f('0xf8')],_0x88a8ba[_0xfa5f('0xef')]);}};Preview['prototype'][_0xfa5f('0x20')]=function(_0x274529){if(this['actions'][_0x274529[_0xfa5f('0xaf')]]&&_0x274529[_0xfa5f('0xaf')]!==_0x274529['uniqueid']&&!this[_0xfa5f('0x17')][_0x274529[_0xfa5f('0xaf')]][_0xfa5f('0x75')]){if(_0x274529[_0xfa5f('0x14b')]==='1'){this['callProgressDetectingCustomer'](_0x274529,_0x274529[_0xfa5f('0xaf')],_0x274529[_0xfa5f('0x14b')]);}}};Preview[_0xfa5f('0x6a')]['addVariable']=function(_0x4658f4,_0xc7dd6,_0x1b8be4){if(this[_0xfa5f('0x17')][_0x4658f4]){if(_['isNil'](this[_0xfa5f('0x17')][_0x4658f4][_0xfa5f('0x153')])){this[_0xfa5f('0x17')][_0x4658f4][_0xfa5f('0x153')]={};}this[_0xfa5f('0x17')][_0x4658f4][_0xfa5f('0x153')][_0xc7dd6]=_0x1b8be4;}};Preview['prototype'][_0xfa5f('0x26')]=function(_0x2cc810){try{if(!_[_0xfa5f('0x70')](_0x2cc810)){if(ut[_0xfa5f('0x154')](_['keys'](_0x2cc810['variable'])[0x0])){this['addVariable'](_0x2cc810[_0xfa5f('0xb3')],_[_0xfa5f('0x155')](_0x2cc810['variable'])[0x0],_0x2cc810['value']);}}}catch(_0x209388){logger[_0xfa5f('0x156')](_0xfa5f('0x157'),util['inspect'](_0x209388,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x1619a3){if(_0x1619a3){if(this[_0xfa5f('0x17')][_0x1619a3['transfertargetlinkedid']]){this['actions'][_0x1619a3[_0xfa5f('0x158')]]['transfer']=!![];}}};Preview['prototype'][_0xfa5f('0x27')]=function(_0x70ea70){if(_0x70ea70){if(this[_0xfa5f('0x17')][_0x70ea70[_0xfa5f('0x159')]]){this['actions'][_0x70ea70['transfererlinkedid']]['transfer']=!![];}}};module[_0xfa5f('0x15a')]=Preview;
\ No newline at end of file
+var _0x7736=['logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unlock','unlockContact','active','pick','execRun','getContactPreview','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','SIP/%s/%s%s','substring','dialCutDigit','dialPrefix','trim','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','responsetime','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','keys','variable','addVariable','value','[syncVarSet][Preview]','inspect','syncAttendedTransfer','transfertargetlinkedid','exports','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangupRequest','dialend','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','blindtransfer','syncBlindTransfer','emit','type','name','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','originated','erlangCalls','erlangCallToSecond','startPredictive','Trunk','callerid','Interval','stringify','md5','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','loopCampaigns','syncCampaigns','prototype','hasOwnProperty','preview','clearZombieChannels','outbound','setMessage','clearZombieChannel','isNil','[clearZombieChannels][talking]','queue','originated:\x20','pTalking:\x20','actions','dialAnswer','contactId','ListId','Action','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','linkedid','ANSWER','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','countbusyretry','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','unlockAgent','activeContact','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]'];(function(_0x4e4c97,_0xb88ed7){var _0x1a0e05=function(_0x2ec99c){while(--_0x2ec99c){_0x4e4c97['push'](_0x4e4c97['shift']());}};_0x1a0e05(++_0xb88ed7);}(_0x7736,0x65));var _0x6773=function(_0xb47222,_0x1e3715){_0xb47222=_0xb47222-0x0;var _0x58382a=_0x7736[_0xb47222];return _0x58382a;};'use strict';var util=require('util');var _=require(_0x6773('0x0'));var BPromise=require('bluebird');var uuid=require(_0x6773('0x1'));var moment=require(_0x6773('0x2'));var md5=require('md5');var Redis=require(_0x6773('0x3'));var config=require(_0x6773('0x4'));var logger=require(_0x6773('0x5'))('preview');var loggerAction=require(_0x6773('0x5'))('actionPreview');var ami=require(_0x6773('0x6'));var rpcDb=require(_0x6773('0x7'));var Action=require(_0x6773('0x8'));var ut=require(_0x6773('0x9'));config[_0x6773('0xa')]=_[_0x6773('0xb')](config['redis'],{'host':_0x6773('0xc'),'port':0x18eb});var io=require(_0x6773('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x6773('0xe')]=function(_0x5d8518){this[_0x6773('0xf')]=this[_0x6773('0xf')]?this[_0x6773('0xf')][_0x6773('0x10')](_0x5d8518):_0x5d8518();};function Preview(_0x39258b){this['sequence']=new Sequence();this[_0x6773('0x11')]=_0x39258b[_0x6773('0x12')];this[_0x6773('0x13')]=_0x39258b['trunks'];this['actions']={};this[_0x6773('0x14')]=_0x39258b[_0x6773('0x14')];this[_0x6773('0x15')]=0x0;ami['on'](_0x6773('0x16'),this[_0x6773('0x17')][_0x6773('0x18')](this));ami['on']('hangup',this['syncHangup'][_0x6773('0x18')](this));ami['on']('hanguprequest',this[_0x6773('0x19')][_0x6773('0x18')](this));ami['on'](_0x6773('0x1a'),this[_0x6773('0x1b')][_0x6773('0x18')](this));ami['on']('newexten',this[_0x6773('0x1c')][_0x6773('0x18')](this));ami['on']('varset',this[_0x6773('0x1d')]['bind'](this));ami['on'](_0x6773('0x1e'),this['syncAttendedTransfer'][_0x6773('0x18')](this));ami['on'](_0x6773('0x1f'),this[_0x6773('0x20')][_0x6773('0x18')](this));this['loopCampaigns'](this[_0x6773('0x11')]);}function emit(_0x425737,_0x50f388,_0x21c358){io['to'](_0x425737)[_0x6773('0x21')](_0x50f388,_0x21c358);}function emitCampaignPreview(_0x207238){if(_0x207238[_0x6773('0x22')]==='outbound'){var _0x141772={'id':_0x207238['id'],'name':_0x207238[_0x6773('0x23')],'strategy':_0x207238['strategy'],'answered':_0x207238[_0x6773('0x24')],'available':_0x207238[_0x6773('0x25')],'loggedIn':_0x207238[_0x6773('0x26')],'pTalking':_0x207238[_0x6773('0x27')],'sumBillable':_0x207238[_0x6773('0x28')],'sumDuration':_0x207238['sumDuration'],'sumHoldTime':_0x207238[_0x6773('0x29')]||0x0,'talking':_0x207238[_0x6773('0x2a')],'total':_0x207238['total'],'type':_0x207238[_0x6773('0x22')],'unmanaged':_0x207238['unmanaged'],'abandoned':_0x207238['abandoned'],'waiting':_0x207238[_0x6773('0x2b')],'loggedInDb':_0x207238[_0x6773('0x2c')],'dialActive':_0x207238[_0x6773('0x2d')],'dialMethod':_0x207238[_0x6773('0x2e')],'dialOriginateCallerIdName':_0x207238[_0x6773('0x2f')],'dialOriginateCallerIdNumber':_0x207238[_0x6773('0x30')],'dialOriginateTimeout':_0x207238['dialOriginateTimeout'],'dialPrefix':_0x207238['dialPrefix'],'outboundAnswerAgiCallsDay':_0x207238[_0x6773('0x31')],'outboundAnswerCallsDay':_0x207238[_0x6773('0x32')],'outboundBlacklistCallsDay':_0x207238['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x207238[_0x6773('0x33')],'outboundCongestionCallsDay':_0x207238[_0x6773('0x34')],'outboundDropCallsDayACS':_0x207238[_0x6773('0x35')],'outboundDropCallsDayCallersExit':_0x207238[_0x6773('0x36')],'outboundDropCallsDayTimeout':_0x207238[_0x6773('0x37')],'outboundNoAnswerCallsDay':_0x207238[_0x6773('0x38')],'outboundNoSuchCallsDay':_0x207238[_0x6773('0x39')],'outboundOriginateFailureCallsDay':_0x207238[_0x6773('0x3a')],'outboundReCallsDay':_0x207238['outboundReCallsDay'],'outboundRejectCallsDay':_0x207238[_0x6773('0x3b')],'outboundUnknownCallsDay':_0x207238['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x207238['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x207238[_0x6773('0x3c')],'predictiveIntervalAvgHoldtime':_0x207238['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x207238['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x207238[_0x6773('0x3d')],'predictiveIntervalDroppedCallsTimeout':_0x207238[_0x6773('0x3e')],'predictiveIntervalErlangCalls':_0x207238[_0x6773('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x207238['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x207238['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x207238[_0x6773('0x40')],'predictiveIntervalPauses':_0x207238[_0x6773('0x41')],'predictiveIntervalAvailable':_0x207238['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x207238['predictiveIntervalTotalCalls'],'message':_0x207238[_0x6773('0x42')],'originated':_0x207238[_0x6773('0x43')],'erlangCalls':_0x207238[_0x6773('0x44')],'erlangCallToSecond':_0x207238[_0x6773('0x45')],'erlangAbandonmentRate':_0x207238['erlangAbandonmentRate'],'erlangBusyFactor':_0x207238['erlangBusyFactor'],'startPredictive':_0x207238[_0x6773('0x46')],'startProgressive':_0x207238['startProgressive']};if(_0x207238[_0x6773('0x47')]){_0x141772[_0x6773('0x47')]={'id':_0x207238['Trunk']['id'],'name':_0x207238[_0x6773('0x47')]['name'],'active':_0x207238[_0x6773('0x47')]['active'],'callerid':_0x207238[_0x6773('0x47')][_0x6773('0x48')]};}if(_0x207238[_0x6773('0x49')]){_0x141772[_0x6773('0x49')]={'id':_0x207238[_0x6773('0x49')]['id'],'name':_0x207238[_0x6773('0x49')][_0x6773('0x23')]};}var _0x2aa3fa=md5(JSON[_0x6773('0x4a')](_0x141772));if(_0x207238[_0x6773('0x4b')]!==_0x2aa3fa){_0x207238[_0x6773('0x4b')]=_0x2aa3fa;emit(util['format'](_0x6773('0x4c'),_0x141772[_0x6773('0x23')]),_0x6773('0x4d'),_0x141772);}}}function emitVoiceQueueChannelRemove(_0x4ae047){logger[_0x6773('0x4e')](_0x6773('0x4f'),JSON['stringify'](_0x4ae047));emit(util['format'](_0x6773('0x4c'),_0x4ae047['name']),'voice_queue_channel:remove',_0x4ae047);io[_0x6773('0x21')](_0x6773('0x50'),_0x4ae047);}function notSendMessagesQueue(_0x360d8c){if(_0x360d8c[_0x6773('0x51')]){if(_0x360d8c[_0x6773('0x43')]===0x0&&_0x360d8c[_0x6773('0x27')]===0x0){_0x360d8c['sendMessageOneNotActive']=![];_0x360d8c[_0x6773('0x25')]=0x0;_0x360d8c['paused']=0x0;_0x360d8c[_0x6773('0x42')]=_0x6773('0x52');ut[_0x6773('0x53')](_0x6773('0x54'),_0x360d8c[_0x6773('0x23')]+'\x20is\x20not\x20active');}else{_0x360d8c['message']=_0x6773('0x55');ut['logger'](_0x6773('0x54'),_0x360d8c[_0x6773('0x23')]+'\x20is\x20disactive');}emitCampaignPreview(_0x360d8c);}}Preview['prototype'][_0x6773('0x56')]=function(){var _0x5a42dc=this;setInterval(function(){_0x5a42dc[_0x6773('0x57')]();},0x7cf);};Preview[_0x6773('0x58')][_0x6773('0x57')]=function(){var _0x4e2ed3=this['campaignsPreview'];this[_0x6773('0x15')]+=0x1;for(var _0x4bd862 in _0x4e2ed3){if(_0x4e2ed3[_0x6773('0x59')](_0x4bd862)&&(_0x4e2ed3[_0x4bd862][_0x6773('0x2e')]===_0x6773('0x5a')||_0x4e2ed3[_0x4bd862]['dialMethod']==='booked')&&_0x4e2ed3[_0x4bd862][_0x6773('0x22')]==='outbound'){if(this[_0x6773('0x15')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x6773('0x5b')]();}}if(_0x4e2ed3[_0x6773('0x59')](_0x4bd862)&&_0x4e2ed3[_0x4bd862][_0x6773('0x2e')]===_0x6773('0x5a')&&_0x4e2ed3[_0x4bd862][_0x6773('0x22')]===_0x6773('0x5c')){if(_0x4e2ed3[_0x4bd862][_0x6773('0x2d')]){this[_0x6773('0x5d')](_0x4e2ed3[_0x4bd862]);this['recallMe'](_0x4e2ed3[_0x4bd862]);}else{notSendMessagesQueue(_0x4e2ed3[_0x4bd862]);}}}};Preview[_0x6773('0x58')][_0x6773('0x5e')]=function(_0x246601){var _0x397a0c=this;this['sequence'][_0x6773('0xe')](function(){if(!_[_0x6773('0x5f')](_0x397a0c['actions'][_0x246601])){loggerAction[_0x6773('0x4e')](_0x6773('0x60'),_0x246601,'Queue',_0x397a0c['actions'][_0x246601][_0x6773('0x61')],_0x6773('0x62'),JSON[_0x6773('0x4a')](_0x397a0c[_0x6773('0x11')][_0x397a0c['actions'][_0x246601]['queue']][_0x6773('0x43')]),_0x6773('0x63'),JSON[_0x6773('0x4a')](_0x397a0c[_0x6773('0x11')][_0x397a0c['actions'][_0x246601][_0x6773('0x61')]][_0x6773('0x27')]),JSON[_0x6773('0x4a')](_0x397a0c[_0x6773('0x64')][_0x246601][_0x6773('0x65')]),JSON[_0x6773('0x4a')](_['pick'](_0x397a0c[_0x6773('0x64')][_0x246601],[_0x6773('0x66'),'UserId','VoiceQueueId',_0x6773('0x67')])));return ami[_0x6773('0x68')]({'action':'status','channel':_0x397a0c[_0x6773('0x64')][_0x246601][_0x6773('0x69')]})['catch'](function(_0xe4e3fa){if(_0xe4e3fa[_0x6773('0x42')]===_0x6773('0x6a')){setTimeout(function(){if(_0x397a0c[_0x6773('0x64')][_0x246601]){ut[_0x6773('0x6b')](_0x397a0c[_0x6773('0x11')][_0x397a0c[_0x6773('0x64')][_0x246601]['queue']],_0x6773('0x6c'));if(_0x397a0c[_0x6773('0x64')][_0x246601][_0x6773('0x65')]===!![]){ut[_0x6773('0x6d')](_0x397a0c['campaignsPreview'][_0x397a0c[_0x6773('0x64')][_0x246601][_0x6773('0x61')]],'[clearZombieChannel]');ut['loggerError'](_0x6773('0x6e')+_0x246601,_0x397a0c[_0x6773('0x64')][_0x246601][_0x6773('0x61')]);}ut[_0x6773('0x6f')](_0x6773('0x70')+_0x246601,_0x397a0c[_0x6773('0x64')][_0x246601][_0x6773('0x61')]);delete _0x397a0c[_0x6773('0x64')][_0x246601];}},0x2328);}});}});};Preview[_0x6773('0x58')][_0x6773('0x5b')]=function(){var _0x480997=this;loggerAction[_0x6773('0x4e')]('[action]',_[_0x6773('0x71')](this[_0x6773('0x64')]));for(var _0x31fb5c in this[_0x6773('0x64')]){if(_0x480997[_0x6773('0x64')]['hasOwnProperty'](_0x31fb5c)){_0x480997['clearZombieChannel'](_0x31fb5c);}}};Preview[_0x6773('0x58')][_0x6773('0x72')]=function(_0x166d0c){var _0x1d6bdf=this;rpcDb[_0x6773('0x73')](_0x166d0c['id'],ut[_0x6773('0x74')](this[_0x6773('0x14')]))[_0x6773('0x75')](function(_0x71cd93){if(!_[_0x6773('0x5f')](_0x71cd93)){for(var _0x181a2c=0x0;_0x181a2c<_0x71cd93[_0x6773('0x76')];_0x181a2c+=0x1){if(ut[_0x6773('0x77')](_0x71cd93[_0x181a2c][_0x6773('0x78')])<_0x166d0c[_0x6773('0x79')]*0x3c){if(_0x71cd93[_0x181a2c][_0x6773('0x7a')]&&!_0x71cd93[_0x181a2c][_0x6773('0x7a')][_0x6773('0x7b')]){_0x1d6bdf[_0x6773('0x7c')](_0x71cd93[_0x181a2c]['id'])[_0x6773('0x75')](ut[_0x6773('0x7d')](_0x6773('0x7e')))[_0x6773('0x7f')](ut[_0x6773('0x7d')](_0x6773('0x7e')));}else{rpcDb[_0x6773('0x80')](_0x71cd93[_0x181a2c]['id']);}}else{var _0x5757c3=new Action(_0x71cd93[_0x181a2c],_0x166d0c);_0x5757c3[_0x6773('0x81')]=moment()[_0x6773('0x82')](_0x6773('0x83'));_0x166d0c[_0x6773('0x84')]+=0x1;ut[_0x6773('0x85')](_0x5757c3,0x17,'RecallInQueue');if(_0x166d0c['dialRecallInQueue']){rpcDb[_0x6773('0x86')](ut[_0x6773('0x87')](_0x71cd93[_0x181a2c]));rpcDb[_0x6773('0x88')](_0x5757c3,_0x6773('0x89'));}else{ut[_0x6773('0x85')](_0x5757c3,0x16,_0x6773('0x8a'));rpcDb['createCustomerHistory'](_0x5757c3,_0x6773('0x8b'));rpcDb[_0x6773('0x8c')](_0x5757c3,'[HistoryRecallClose]');}}}}})[_0x6773('0x7f')](ut[_0x6773('0x7d')](_0x6773('0x8d')));};Preview[_0x6773('0x58')][_0x6773('0x5d')]=function(_0x214abb){_0x214abb[_0x6773('0x51')]=!![];if(ut[_0x6773('0x8e')](_0x214abb['loggedIn'])){_0x214abb[_0x6773('0x42')]=_0x6773('0x8f');}else if(!ut[_0x6773('0x90')](_0x214abb[_0x6773('0x2d')])){_0x214abb[_0x6773('0x42')]='NOT_ACTIVE';}else if(!this[_0x6773('0x91')](_0x214abb[_0x6773('0x47')])){if(!this[_0x6773('0x91')](_0x214abb[_0x6773('0x92')])){_0x214abb[_0x6773('0x42')]=_0x6773('0x93');}else{_0x214abb[_0x6773('0x42')]=_0x6773('0x94');}}else{_0x214abb[_0x6773('0x42')]=_0x6773('0x94');}emitCampaignPreview(_0x214abb);};Preview['prototype'][_0x6773('0x95')]=function(_0x15739b,_0x3b06ea,_0x476e8a){var _0x525e6e=this;var _0x17892b=this[_0x6773('0x64')][_0x3b06ea];var _0x277aa6=this['campaignsPreview'][_0x17892b[_0x6773('0x61')]];var _0x16cc17;if(_0x277aa6){switch(_0x476e8a){case'1':_0x277aa6[_0x6773('0x39')]+=0x1;_0x17892b[_0x6773('0x96')]+=0x1;_0x17892b[_0x6773('0x97')]=ut[_0x6773('0x98')](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x0,'NoSuchNumber');ami[_0x6773('0x21')](_0x6773('0x99'),ut[_0x6773('0x9a')](_0x17892b,_0x6773('0x9b')));rpcDb[_0x6773('0x88')](_0x17892b,_0x6773('0x9c'));if(ut['totalGlobal'](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut[_0x6773('0x9e')](_0x17892b,0xf,_0x6773('0x9f'));rpcDb[_0x6773('0x8c')](_0x16cc17,_0x6773('0xa0'));}else{if(_0x17892b['countnosuchnumberretry']>=_0x277aa6[_0x6773('0xa1')]){rpcDb[_0x6773('0x8c')](_0x17892b,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x6773('0xa2')](ut[_0x6773('0xa3')](_0x17892b,_0x6773('0x96'),_0x277aa6['dialNoSuchNumberRetryFrequency']),_0x17892b['unlockAgent'],_0x17892b['activeContact']);}}delete this['actions'][_0x15739b[_0x6773('0xa4')]];break;case _0x6773('0xa5'):var _0x5439f1=moment()['format'](_0x6773('0x83'));_0x17892b['responsetime']=_0x5439f1;_0x17892b['answertime']=_0x5439f1;_0x17892b[_0x6773('0x65')]=!![];_0x277aa6[_0x6773('0x27')]+=0x1;logger[_0x6773('0x4e')](_0x6773('0xa6'),_0x17892b[_0x6773('0xa7')],_0x6773('0xa8'),_0x277aa6[_0x6773('0x23')],_0x6773('0x63'),_0x277aa6['pTalking']);ami[_0x6773('0x21')]('custom:agentconnect',ut[_0x6773('0x9a')](_0x17892b,_0x6773('0xa9'),this[_0x6773('0x11')][_0x17892b[_0x6773('0x61')]]));if(_0x277aa6[_0x6773('0xaa')]){ami[_0x6773('0x21')](_0x6773('0xab'),ut[_0x6773('0xac')](_0x17892b));}break;case'16':ami[_0x6773('0x21')](_0x6773('0xad'),ut[_0x6773('0x9a')](_0x17892b,'complete',this[_0x6773('0x11')][_0x17892b[_0x6773('0x61')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x17892b,_0x6773('0xae')));_0x277aa6[_0x6773('0x32')]+=0x1;_0x277aa6[_0x6773('0xaf')]+=0x1;_0x277aa6[_0x6773('0x24')]+=0x1;ut[_0x6773('0x6d')](_0x277aa6,_0x6773('0xb0'));_0x17892b[_0x6773('0x97')]=ut[_0x6773('0x98')](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x4,_0x6773('0xb1'));rpcDb[_0x6773('0x88')](_0x17892b,_0x6773('0xb2'));rpcDb[_0x6773('0x8c')](_0x17892b,_0x6773('0xb3'));rpcDb[_0x6773('0xb4')](_0x17892b);_0x277aa6['sumDuration']+=_0x17892b[_0x6773('0xb5')];_0x277aa6[_0x6773('0x28')]+=_0x17892b[_0x6773('0xb5')];logger['info']('[syncHangup][talking][decrement]',_0x17892b[_0x6773('0xa7')],_0x6773('0xa8'),_0x277aa6[_0x6773('0x23')],_0x6773('0x63'),_0x277aa6[_0x6773('0x27')]);delete this[_0x6773('0x64')][_0x15739b[_0x6773('0xa4')]];break;case'BUSY':_0x277aa6['outboundBusyCallsDay']+=0x1;_0x17892b[_0x6773('0xb6')]+=0x1;_0x17892b[_0x6773('0x97')]=ut['totalGlobal'](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x5,_0x6773('0xb7'));ami[_0x6773('0x21')](_0x6773('0xb8'),ut['buildObj'](_0x17892b,'busy'));rpcDb['createCustomerHistory'](_0x17892b,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut[_0x6773('0x9e')](_0x17892b,0xf,'Global');rpcDb['createCustomerFinal'](_0x16cc17,_0x6773('0xb9'));}else{if(_0x17892b[_0x6773('0xb6')]>=_0x277aa6[_0x6773('0xba')]){rpcDb[_0x6773('0x8c')](_0x17892b,_0x6773('0xbb'));}else{rpcDb[_0x6773('0xa2')](ut[_0x6773('0xa3')](_0x17892b,'countbusyretry',_0x277aa6[_0x6773('0xbc')]),_0x17892b[_0x6773('0xbd')],_0x17892b[_0x6773('0xbe')]);}}break;case'NOANSWER':_0x277aa6[_0x6773('0x38')]+=0x1;_0x17892b[_0x6773('0xbf')]+=0x1;_0x17892b[_0x6773('0x97')]=ut['totalGlobal'](_0x17892b);ut['logCustomer'](_0x17892b,0x3,_0x6773('0xc0'));ami['emit'](_0x6773('0xc1'),ut[_0x6773('0x9a')](_0x17892b,_0x6773('0xc2')));rpcDb[_0x6773('0x88')](_0x17892b,_0x6773('0xc3'));if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut[_0x6773('0x9e')](_0x17892b,0xf,'Global');rpcDb[_0x6773('0x8c')](_0x16cc17,_0x6773('0xc4'));}else{if(_0x17892b[_0x6773('0xbf')]>=_0x277aa6[_0x6773('0xc5')]){rpcDb[_0x6773('0x8c')](_0x17892b,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x6773('0xa2')](ut[_0x6773('0xa3')](_0x17892b,_0x6773('0xbf'),_0x277aa6[_0x6773('0xc6')]),_0x17892b[_0x6773('0xbd')],_0x17892b['activeContact']);}}break;case _0x6773('0xc7'):_0x277aa6[_0x6773('0x34')]+=0x1;_0x17892b['countcongestionretry']+=0x1;_0x17892b[_0x6773('0x97')]=ut['totalGlobal'](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x8,_0x6773('0xc8'));ami[_0x6773('0x21')]('custom:agentcongestion',ut[_0x6773('0x9a')](_0x17892b,_0x6773('0xc9')));rpcDb[_0x6773('0x88')](_0x17892b,_0x6773('0xca'));if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut[_0x6773('0x9e')](_0x17892b,0xf,_0x6773('0x9f'));rpcDb[_0x6773('0x8c')](_0x16cc17,_0x6773('0xcb'));}else{if(_0x17892b[_0x6773('0xcc')]>=_0x277aa6[_0x6773('0xcd')]){rpcDb[_0x6773('0x8c')](_0x17892b,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x6773('0xa2')](ut[_0x6773('0xa3')](_0x17892b,_0x6773('0xcc'),_0x277aa6[_0x6773('0xbc')]),_0x17892b[_0x6773('0xbd')],_0x17892b[_0x6773('0xbe')]);}}break;case _0x6773('0xce'):_0x277aa6[_0x6773('0x3b')]+=0x1;_0x17892b[_0x6773('0xcf')]+=0x1;_0x17892b['countglobal']=ut[_0x6773('0x98')](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x14,_0x6773('0xd0'));ami['emit'](_0x6773('0xd1'),ut[_0x6773('0x9a')](_0x17892b,'agentreject'));rpcDb[_0x6773('0x88')](_0x17892b,_0x6773('0xd2'));if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut['cloneAction'](_0x17892b,0x14,_0x6773('0xd0'));rpcDb['createCustomerFinal'](_0x16cc17,_0x6773('0xd3'));}else{if(_0x17892b[_0x6773('0xcf')]>=_0x277aa6['dialAgentRejectMaxRetry']){rpcDb[_0x6773('0x8c')](_0x17892b,_0x6773('0xd3'));}else{rpcDb[_0x6773('0xa2')](ut[_0x6773('0xa3')](_0x17892b,_0x6773('0xcf'),_0x277aa6[_0x6773('0xd4')]),_0x17892b[_0x6773('0xbd')],_0x17892b[_0x6773('0xbe')]);}}break;case'ABANDONED':_0x277aa6['outboundAbandonedCallsDay']+=0x1;_0x17892b[_0x6773('0xd5')]+=0x1;_0x17892b[_0x6773('0x97')]=ut['totalGlobal'](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0xb,_0x6773('0xd6'));rpcDb['createCustomerHistory'](_0x17892b,_0x6773('0xd7'));if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut['cloneAction'](_0x17892b,0xf,_0x6773('0x9f'));rpcDb[_0x6773('0x8c')](_0x16cc17,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x17892b['countabandonedetry']>=_0x277aa6[_0x6773('0xd8')]){rpcDb['createCustomerFinal'](_0x17892b,_0x6773('0xd7'));}else{rpcDb[_0x6773('0xa2')](ut[_0x6773('0xa3')](_0x17892b,'countabandonedretry',_0x277aa6[_0x6773('0xd9')]),_0x17892b[_0x6773('0xbd')],_0x17892b[_0x6773('0xbe')]);}}break;case'18':_0x277aa6[_0x6773('0xda')]+=0x1;_0x17892b['countmachineretry']+=0x1;_0x17892b[_0x6773('0x97')]=ut['totalGlobal'](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x12,_0x15739b[_0x6773('0xdb')]||_0x15739b['dialstatus']);ami[_0x6773('0x21')](_0x6773('0xdc'),ut[_0x6773('0x9a')](_0x17892b,_0x6773('0xdd')));rpcDb[_0x6773('0x88')](_0x17892b,_0x6773('0xde'));if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6['dialGlobalMaxRetry']){_0x16cc17=ut['cloneAction'](_0x17892b,0xf,_0x6773('0x9f'));rpcDb[_0x6773('0x8c')](_0x16cc17,_0x6773('0xde'));}else{rpcDb[_0x6773('0x8c')](_0x17892b,_0x6773('0xde'));}delete this[_0x6773('0x64')][_0x15739b['linkedid']];break;case'19':_0x277aa6[_0x6773('0xda')]+=0x1;_0x17892b['countglobal']=ut[_0x6773('0x98')](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0x13,_0x15739b[_0x6773('0xdb')]||_0x15739b['dialstatus']);ami['emit'](_0x6773('0xdc'),ut[_0x6773('0x9a')](_0x17892b,_0x6773('0xdd')));rpcDb['createCustomerHistory'](_0x17892b,_0x6773('0xdf'));if(ut[_0x6773('0x98')](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut[_0x6773('0x9e')](_0x17892b,0xf,'Global');rpcDb['createCustomerFinal'](_0x16cc17,_0x6773('0xdf'));}else{rpcDb[_0x6773('0x8c')](_0x17892b,'[callProgressDetectingCustomer][machine]');}delete this[_0x6773('0x64')][_0x15739b['linkedid']];break;default:if(_0x17892b['dialAnswer']){ut[_0x6773('0x6d')](_0x277aa6,'[default]');ut[_0x6773('0x6f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x277aa6[_0x6773('0x23')],_0x15739b);}_0x277aa6['outboundUnknownCallsDay']+=0x1;_0x17892b[_0x6773('0x97')]=ut[_0x6773('0x98')](_0x17892b);ut[_0x6773('0x85')](_0x17892b,0xc,_0x15739b[_0x6773('0xdb')]||_0x15739b[_0x6773('0xe0')]);rpcDb[_0x6773('0x88')](_0x17892b,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x17892b)>=_0x277aa6[_0x6773('0x9d')]){_0x16cc17=ut['cloneAction'](_0x17892b,0xf,_0x6773('0x9f'));rpcDb[_0x6773('0x8c')](_0x16cc17,_0x6773('0xe1'));}else{rpcDb[_0x6773('0x8c')](_0x17892b,_0x6773('0xe1'));}delete this[_0x6773('0x64')][_0x15739b[_0x6773('0xa4')]];}if(!(_0x17892b[_0x6773('0x65')]&&_0x476e8a==='16')){ut[_0x6773('0x6b')](_0x277aa6,_0x6773('0xe2'));logger[_0x6773('0x4e')](_0x6773('0xe3'),_0x17892b[_0x6773('0xa7')],_0x6773('0xa8'),_0x277aa6[_0x6773('0x23')],_0x6773('0x62'),_0x277aa6[_0x6773('0x43')]);}if(_0x476e8a!=='ANSWER'){delete this['actions'][_0x15739b['linkedid']];delete this['actions'][_0x15739b[_0x6773('0xe4')]];}}};Preview[_0x6773('0x58')][_0x6773('0xe5')]=function(_0x1d9a48,_0xc3e5b8,_0x59b78e){if(_[_0x6773('0xe6')](_0xc3e5b8)&&_0x6773('0xe7')!==typeof _0xc3e5b8){return;}if(_[_0x6773('0xe6')](_0x59b78e)&&_0x6773('0xe7')!==typeof _0x59b78e){return;}switch(_0x59b78e[_0x6773('0xe8')]){case'0':ut['logAgent'](_0x1d9a48,0x0,_0x6773('0xe9'));rpcDb['createAgentHistory'](_0x1d9a48,_0x6773('0xea'));break;case'3':ut['logAgent'](_0x1d9a48,0x3,_0x6773('0xc0'));rpcDb[_0x6773('0xeb')](_0x1d9a48,_0x6773('0xec'));break;case'5':ut[_0x6773('0xed')](_0x1d9a48,0x5,_0x6773('0xb7'));rpcDb['createAgentHistory'](_0x1d9a48,_0x6773('0xee'));break;case'8':ut[_0x6773('0xed')](_0x1d9a48,0x8,_0x6773('0xc8'));rpcDb[_0x6773('0xeb')](_0x1d9a48,_0x6773('0xef'));break;case'22':ut[_0x6773('0xed')](_0x1d9a48,0x16,_0x6773('0xf0'));rpcDb[_0x6773('0xeb')](_0x1d9a48,_0x6773('0xf1'));break;default:ut[_0x6773('0xed')](_0x1d9a48,0xc,_0x59b78e[_0x6773('0xe8')]);rpcDb[_0x6773('0xeb')](_0x1d9a48,_0x6773('0xef'));}ut['updateOriginated'](_0xc3e5b8,_0x6773('0xf2'));logger[_0x6773('0x4e')](_0x6773('0xf3'),_0x1d9a48[_0x6773('0xa7')],_0x6773('0xa8'),_0xc3e5b8[_0x6773('0x23')],_0x6773('0x62'),_0xc3e5b8[_0x6773('0x43')]);delete this['actions'][_0x1d9a48['uniqueid']];};Preview[_0x6773('0x58')][_0x6773('0xf4')]=function(_0x4cc386,_0xe6df63,_0x398387,_0x194843,_0x3fff4c){var _0x471c4c=this;return new BPromise(function(_0xaaf088,_0x910715){if(_['isNil'](_0xe6df63)||_[_0x6773('0x5f')](_0xe6df63['Contact'])||_['isNil'](_0xe6df63[_0x6773('0xf5')][_0x6773('0xf6')])||_[_0x6773('0x5f')](_0xe6df63[_0x6773('0xf7')])){_0x910715(ut[_0x6773('0x42')](_0x6773('0xf8'),_0x194843,_0x3fff4c));return;}var _0x304f03=uuid['v4']();var _0x2b3fbd=_0x471c4c[_0x6773('0x11')][_0xe6df63[_0x6773('0xf9')][_0x6773('0x23')]];var _0x3cd9ca=_0x398387?_0x471c4c[_0x6773('0x14')][_0x398387]['id']:undefined;_0x471c4c[_0x6773('0x64')][_0x304f03]=new Action(_0xe6df63,_0x2b3fbd,_0x304f03,_0x398387,_0x3cd9ca);var _0x96463d=_0x471c4c[_0x6773('0x64')][_0x304f03];_0x96463d[_0x6773('0xbd')]=_0x194843;_0x96463d[_0x6773('0xbe')]=_0x3fff4c;_0x96463d[_0x6773('0xfa')]=_0x398387;if(_['isEmpty'](_0x4cc386)){_0x471c4c[_0x6773('0xfb')](_0x96463d,_0x2b3fbd,_0xe6df63,_0x398387)[_0x6773('0x75')](function(_0x2e469b){logger[_0x6773('0x4e')]('[Preview][execCall][success]',_0x6773('0xfc')+_0x96463d[_0x6773('0x61')]+_0x6773('0xfd')+_0x96463d[_0x6773('0xfe')],JSON[_0x6773('0x4a')](_0x2e469b));ami[_0x6773('0x21')](_0x6773('0xff'),ut[_0x6773('0x9a')](_0x96463d,_0x6773('0x100'),_0x471c4c[_0x6773('0x11')][_0x96463d[_0x6773('0x61')]]));_0xaaf088(ut[_0x6773('0x42')]('Calling'));})[_0x6773('0x7f')](function(_0x244163){ut[_0x6773('0x53')](_0x6773('0x101'),_0x244163);_0x910715(ut[_0x6773('0x42')](_0x6773('0x102'),_0x194843,_0x3fff4c));});}else{_0x2b3fbd[_0x6773('0x103')]+=0x1;ut[_0x6773('0x104')](_0x96463d);rpcDb['createHistory'](_0x96463d,_0x6773('0x105'));delete _0x471c4c[_0x6773('0x64')][_0x304f03];_0x910715(ut[_0x6773('0x42')](_0x6773('0x106'),_0x194843,_0x3fff4c));}});};Preview[_0x6773('0x58')][_0x6773('0x91')]=function(_0x24833d){return!_[_0x6773('0x5f')](_0x24833d)&&!_[_0x6773('0x5f')](_0x24833d['name'])&&!_[_0x6773('0x5f')](_0x24833d['active'])&&_0x24833d['active']&&!_[_0x6773('0x5f')](this[_0x6773('0x13')][util['format'](_0x6773('0x107'),_0x24833d[_0x6773('0x23')])])&&!_[_0x6773('0x5f')](this[_0x6773('0x13')][util[_0x6773('0x82')]('SIP/%s',_0x24833d['name'])][_0x6773('0x108')])&&(this['trunks'][util[_0x6773('0x82')]('SIP/%s',_0x24833d['name'])][_0x6773('0x108')]===_0x6773('0x109')||this[_0x6773('0x13')][util['format'](_0x6773('0x107'),_0x24833d['name'])][_0x6773('0x108')]==='unmonitored');};Preview[_0x6773('0x58')][_0x6773('0x7c')]=function(_0x25ad81,_0x562a6e){var _0x22ecb4=this;return new BPromise(function(_0x2924b4,_0x52849f){_0x22ecb4['execRun'](_0x25ad81,_0x562a6e)['then'](function(_0x2f64f0){_0x2924b4(_['pick'](_0x2f64f0,[_0x6773('0x42')]));})['catch'](function(_0x354bdd){if(_0x354bdd[_0x6773('0x10a')]){rpcDb[_0x6773('0x10b')](_0x25ad81);}if(_0x354bdd[_0x6773('0x10c')]){rpcDb[_0x6773('0x80')](_0x25ad81);}_0x52849f(_[_0x6773('0x10d')](_0x354bdd,[_0x6773('0x42')]));});});};Preview['prototype'][_0x6773('0x10e')]=function(_0x3d0a33,_0x587801){var _0x4c5c6a=this;return new BPromise(function(_0x41ae46,_0x230783){var _0x445625,_0x47f3a0;rpcDb[_0x6773('0x10f')](_0x3d0a33)['then'](function(_0x26c151){if(!_[_0x6773('0x5f')](_0x26c151[0x0])){_0x47f3a0=_0x26c151[0x0]['recallme']?![]:!![];_0x445625=_0x26c151[0x0][_0x6773('0x110')]?!![]:![];_0x445625=_0x587801?!![]:_0x445625;}var _0x1557b9=_0x4c5c6a['validateContact'](_0x26c151);if(_0x1557b9[_0x6773('0x111')]){rpcDb[_0x6773('0x112')](_[_0x6773('0x10d')](_0x26c151[0x0],[_0x6773('0xf7'),_0x6773('0x113')]))[_0x6773('0x75')](function(_0x45a79f){_0x4c5c6a[_0x6773('0xf4')](_0x45a79f,_0x26c151[0x0],_0x587801,_0x47f3a0,_0x445625)[_0x6773('0x75')](function(_0x1a6bae){_0x41ae46(_0x1a6bae);})[_0x6773('0x7f')](function(_0x41a49c){_0x230783(_0x41a49c);});})[_0x6773('0x7f')](function(_0x4ff5c2){ut[_0x6773('0x53')](_0x6773('0x114'),_0x4ff5c2);_0x230783(ut[_0x6773('0x42')](_0x6773('0x115'),_0x47f3a0,_0x445625));});}else{_0x230783(ut[_0x6773('0x42')](_0x1557b9[_0x6773('0x42')],_0x47f3a0,_0x445625));}})['catch'](function(_0x460ae9){ut[_0x6773('0x53')](_0x6773('0x116'),_0x460ae9);_0x230783(ut['message'](_0x6773('0x115'),![],!![]));});});};Preview['prototype'][_0x6773('0x117')]=function(_0x3587ba){if(_['isNil'](_0x3587ba)||_[_0x6773('0x118')](_0x3587ba)||!_['isNil'](_0x3587ba[0x0][_0x6773('0x7a')])&&_[_0x6773('0x5f')](_0x3587ba[0x0][_0x6773('0x7a')]['name'])){ut[_0x6773('0x53')](_0x6773('0x119'),_0x3587ba);return{'isValid':![],'message':_0x6773('0x11a')};}var _0x222d8c=this[_0x6773('0x11')][_0x3587ba[0x0][_0x6773('0xf9')][_0x6773('0x23')]];_0x222d8c['message']=_0x6773('0x94');if(_['isNil'](_0x222d8c)){ut[_0x6773('0x53')](_0x6773('0x11b'),_0x222d8c);return{'isValid':![],'message':_0x6773('0x11c')};}if(!this[_0x6773('0x91')](_0x222d8c[_0x6773('0x47')])){ut[_0x6773('0x53')](_0x6773('0x11d'),_0x6773('0x11e')+_0x222d8c[_0x6773('0x23')]+_0x6773('0x11f'));if(!this[_0x6773('0x91')](_0x222d8c[_0x6773('0x92')])){ut[_0x6773('0x53')](_0x6773('0x11d'),_0x222d8c['name']+_0x6773('0x120'));return{'isValid':![],'message':_0x6773('0x121')};}}if(!ut['isActive'](_0x222d8c[_0x6773('0x2d')])){ut[_0x6773('0x53')]('[Preview][validateContact][Campaign\x20Active]',_0x222d8c['name']+_0x6773('0x122'));return{'isValid':![],'message':_0x6773('0x11e')+_0x222d8c[_0x6773('0x23')]+_0x6773('0x122')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x6773('0x58')][_0x6773('0xfb')]=function(_0x506800,_0x2c8cb2,_0x292453,_0x2bb7cb){var _0x25dba4=this;return new BPromise(function(_0x4b626a,_0x288a95){var _0x2ee454=_0x506800[_0x6773('0xa7')];var _0x2d8265=_0x25dba4[_0x6773('0x91')](_0x2c8cb2['Trunk'])?util[_0x6773('0x82')](_0x6773('0x123'),_0x2c8cb2[_0x6773('0x47')][_0x6773('0x23')],_[_0x6773('0x5f')](_0x2c8cb2['dialPrefix'])?'':_0x2c8cb2['dialPrefix']['trim']()||'',_0x2c8cb2['dialCutDigit']>0x0?_0x292453[_0x6773('0xf5')][_0x6773('0xf6')][_0x6773('0x124')](_0x2c8cb2[_0x6773('0x125')]):_0x292453[_0x6773('0xf5')][_0x6773('0xf6')]):util[_0x6773('0x82')](_0x6773('0x123'),_[_0x6773('0x5f')](_0x2c8cb2[_0x6773('0x92')])?_0x2c8cb2['Trunk']['name']:_0x2c8cb2[_0x6773('0x92')][_0x6773('0x23')],_[_0x6773('0x5f')](_0x2c8cb2[_0x6773('0x126')])?'':_0x2c8cb2[_0x6773('0x126')][_0x6773('0x127')]()||'',_0x2c8cb2[_0x6773('0x125')]>0x0?_0x292453[_0x6773('0xf5')][_0x6773('0xf6')]['substring'](_0x2c8cb2[_0x6773('0x125')]):_0x292453['Contact'][_0x6773('0xf6')]);var _0x161005=_0x25dba4[_0x6773('0x91')](_0x2c8cb2['Trunk'])?ut['getCallerId'](_0x2c8cb2[_0x6773('0x47')][_0x6773('0x48')],_0x2c8cb2[_0x6773('0x2f')],_0x2c8cb2[_0x6773('0x128')]>0x0?ut[_0x6773('0x129')](_0x2c8cb2[_0x6773('0x30')],_0x2c8cb2[_0x6773('0x128')]):_0x2c8cb2[_0x6773('0x30')]):ut['getCallerId'](_[_0x6773('0x5f')](_0x2c8cb2[_0x6773('0x92')])?_0x2c8cb2['Trunk'][_0x6773('0x48')]:_0x2c8cb2[_0x6773('0x92')][_0x6773('0x48')],_0x2c8cb2[_0x6773('0x2f')],_0x2c8cb2[_0x6773('0x128')]>0x0?ut[_0x6773('0x129')](_0x2c8cb2[_0x6773('0x30')],_0x2c8cb2[_0x6773('0x128')]):_0x2c8cb2[_0x6773('0x30')]);if(_0x161005){_0x506800[_0x6773('0x12a')]=ut[_0x6773('0x12b')](_0x161005);_0x506800[_0x6773('0x12c')]=ut[_0x6773('0x12d')](_0x161005);}var _0x19c6d3=ut[_0x6773('0x12e')](_0x2c8cb2,_0x292453,_0x2d8265,_0x161005,_0x2ee454,_0x506800);_[_0x6773('0x12f')](_0x506800,ut['toLowerVariables'](_0x19c6d3));_0x506800['starttime']=moment()[_0x6773('0x82')](_0x6773('0x83'));ami[_0x6773('0x68')](ut['variablesAction'](_0x506800,_0x2c8cb2,_0x19c6d3,_0x506800[_0x6773('0xbe')],_0x2bb7cb))['then'](function(_0x44bf52){var _0x4d01bb=_0x506800[_0x6773('0x130')];if(!_[_0x6773('0x5f')](_0x4d01bb)){if(!_['isNil'](_0x25dba4['agents'][_0x4d01bb])){_0x25dba4[_0x6773('0x14')][_0x4d01bb][_0x6773('0x131')]=_0x506800[_0x6773('0x132')];emit(util[_0x6773('0x82')](_0x6773('0x133'),_0x25dba4[_0x6773('0x14')][_0x4d01bb][_0x6773('0x23')]),_0x6773('0x134'),{'destaccountcode':_0x25dba4[_0x6773('0x14')][_0x4d01bb][_0x6773('0x135')],'destconnectedlinenum':_0x506800[_0x6773('0x132')]});}}_0x2c8cb2[_0x6773('0x43')]+=0x1;logger[_0x6773('0x4e')]('[originated][increment]',_0x2ee454,'\x20Queue',_0x2c8cb2[_0x6773('0x23')],_0x6773('0x62'),_0x2c8cb2[_0x6773('0x43')]);_0x4b626a(_0x44bf52);})[_0x6773('0x7f')](function(_0xf46d92){ut[_0x6773('0xed')](_0x506800,0xe,_0x6773('0x136'));rpcDb[_0x6773('0xeb')](_0x506800,_0x6773('0x137'));_0x288a95(_0xf46d92);});});};Preview[_0x6773('0x58')][_0x6773('0x1c')]=function(_0x91f1ab){if(this['actions'][_0x91f1ab['linkedid']]){this[_0x6773('0x64')][_0x91f1ab[_0x6773('0xa4')]][_0x6773('0x69')]=_0x91f1ab[_0x6773('0x69')];}};Preview[_0x6773('0x58')][_0x6773('0x17')]=function(_0x3823e9){var _0x454b71=this;var _0x2231d9=this[_0x6773('0x64')][_0x3823e9[_0x6773('0x138')]];if(_0x2231d9){if(_0x2231d9[_0x6773('0xfa')]&&this[_0x6773('0x14')][_0x2231d9[_0x6773('0xfa')]]){ut['logLookAgent'](_0x2231d9,this[_0x6773('0x14')][_0x2231d9[_0x6773('0xfa')]][_0x6773('0x23')],this[_0x6773('0x14')][_0x2231d9[_0x6773('0xfa')]]['id']);}var _0x46e30b=_[_0x6773('0x139')](_0x2231d9);_0x46e30b[_0x6773('0x13a')]=moment()[_0x6773('0x82')](_0x6773('0x83'));var _0x39c52a=_0x454b71[_0x6773('0x11')][_0x2231d9[_0x6773('0x61')]];if(ut[_0x6773('0x13b')](_0x3823e9[_0x6773('0x13c')])){if(_0x2231d9[_0x6773('0xbd')]){rpcDb[_0x6773('0x10b')](_0x2231d9['idContact']);}if(_0x2231d9[_0x6773('0xbe')]){rpcDb[_0x6773('0x80')](_0x2231d9[_0x6773('0xfe')]);}ami[_0x6773('0x21')](_0x6773('0x13d'),ut[_0x6773('0x9a')](_0x2231d9,_0x6773('0x13e'),this['campaignsPreview'][_0x2231d9[_0x6773('0x61')]]));this[_0x6773('0xe5')](_0x46e30b,_0x39c52a,_0x3823e9);}else{_0x2231d9['starttime']=moment()[_0x6773('0x82')](_0x6773('0x83'));ut['logAgent'](_0x46e30b,0x4,_0x6773('0xb1'));rpcDb[_0x6773('0xeb')](_0x46e30b,_0x6773('0x13f'));}}};Preview[_0x6773('0x58')][_0x6773('0x140')]=function(_0x54d956){var _0x581f4f=this;var _0x3587d3=this[_0x6773('0x64')][_0x54d956[_0x6773('0xa4')]];var _0x225a5f;if(_0x3587d3){_0x225a5f=this[_0x6773('0x11')][_0x3587d3['queue']];logger['info']('[syncHangup][talking]',_0x54d956[_0x6773('0xa4')],_0x6773('0xa8'),_0x225a5f[_0x6773('0x23')],_0x6773('0x63'),_0x225a5f[_0x6773('0x27')]);}if(this[_0x6773('0x64')][_0x54d956['linkedid']]&&_0x54d956[_0x6773('0xa4')]!==_0x54d956['uniqueid']){if(_0x54d956['cause']==='16'&&this['actions'][_0x54d956[_0x6773('0xa4')]][_0x6773('0x65')]){this[_0x6773('0x95')](_0x54d956,_0x54d956[_0x6773('0xa4')],_0x54d956[_0x6773('0x141')]);}else if(this[_0x6773('0x64')][_0x54d956[_0x6773('0xa4')]][_0x6773('0x65')]){logger['info'](_0x6773('0x142'),_0x54d956[_0x6773('0xa4')],_0x54d956[_0x6773('0x141')],'\x20Queue',_0x225a5f['name'],'pTalking:\x20',_0x225a5f[_0x6773('0x27')]);this['callProgressDetectingCustomer'](_0x54d956,_0x54d956['linkedid'],_0x54d956[_0x6773('0x141')]);}}else if(_0x3587d3&&_[_0x6773('0x5f')](_0x3587d3['statedesc'])&&_0x225a5f[_0x6773('0x143')]&&_0x54d956[_0x6773('0xa4')]===_0x54d956[_0x6773('0xa7')]&&_[_0x6773('0x5f')](_0x54d956[_0x6773('0xe8')])&&_0x54d956[_0x6773('0x141')]==='16'&&_0x54d956[_0x6773('0x144')]==='6'&&_['isUndefined'](_0x3587d3[_0x6773('0x145')])){if(_0x3587d3[_0x6773('0xbd')]){rpcDb[_0x6773('0x10b')](_0x3587d3[_0x6773('0xfe')]);}if(_0x3587d3[_0x6773('0xbe')]){rpcDb['disableContact'](_0x3587d3['idContact']);}_0x54d956[_0x6773('0xe8')]='22';this['callProgressDetectingAgent'](_0x3587d3,_0x225a5f,_0x54d956);}else if(_0x3587d3&&_0x3587d3[_0x6773('0x145')]){if(_0x54d956[_0x6773('0x141')]==='16'&&this['actions'][_0x54d956[_0x6773('0xa4')]]['dialAnswer']){logger[_0x6773('0x4e')](_0x6773('0x146'),_0x54d956['linkedid'],_0x54d956[_0x6773('0x141')],_0x6773('0xa8'),_0x225a5f[_0x6773('0x23')],_0x6773('0x63'),_0x225a5f[_0x6773('0x27')]);this[_0x6773('0x95')](_0x54d956,_0x54d956[_0x6773('0xa4')],_0x54d956[_0x6773('0x141')]);}else if(this['actions'][_0x54d956[_0x6773('0xa4')]][_0x6773('0x65')]){logger['info']('[syncHangup][talking][cause]',_0x54d956[_0x6773('0xa4')],_0x54d956[_0x6773('0x141')],_0x6773('0xa8'),_0x225a5f[_0x6773('0x23')],'pTalking:\x20',_0x225a5f[_0x6773('0x27')]);this[_0x6773('0x95')](_0x54d956,_0x54d956['linkedid'],_0x54d956[_0x6773('0x141')]);}}};Preview[_0x6773('0x58')][_0x6773('0x1b')]=function(_0x406b29){if(this['actions'][_0x406b29['destlinkedid']]&&_0x406b29[_0x6773('0xe4')]!==_0x406b29[_0x6773('0x147')]){this[_0x6773('0x95')](_0x406b29,_0x406b29[_0x6773('0xe4')],_0x406b29[_0x6773('0xe0')]);}};Preview[_0x6773('0x58')][_0x6773('0x19')]=function(_0x5b165a){if(this[_0x6773('0x64')][_0x5b165a[_0x6773('0xa4')]]&&_0x5b165a[_0x6773('0xa4')]!==_0x5b165a[_0x6773('0xa7')]&&!this[_0x6773('0x64')][_0x5b165a[_0x6773('0xa4')]][_0x6773('0x65')]){if(_0x5b165a[_0x6773('0x141')]==='1'){this[_0x6773('0x95')](_0x5b165a,_0x5b165a[_0x6773('0xa4')],_0x5b165a['cause']);}}};Preview[_0x6773('0x58')]['addVariable']=function(_0x60f254,_0x6f9e0,_0x1d5528){if(this[_0x6773('0x64')][_0x60f254]){if(_['isNil'](this[_0x6773('0x64')][_0x60f254][_0x6773('0x148')])){this[_0x6773('0x64')][_0x60f254]['variables']={};}this[_0x6773('0x64')][_0x60f254][_0x6773('0x148')][_0x6f9e0]=_0x1d5528;}};Preview[_0x6773('0x58')][_0x6773('0x1d')]=function(_0x2482a2){try{if(!_[_0x6773('0x5f')](_0x2482a2)){if(ut['filterKey'](_[_0x6773('0x149')](_0x2482a2[_0x6773('0x14a')])[0x0])){this[_0x6773('0x14b')](_0x2482a2[_0x6773('0xa7')],_['keys'](_0x2482a2['variable'])[0x0],_0x2482a2[_0x6773('0x14c')]);}}}catch(_0x5e7a4b){logger['error'](_0x6773('0x14d'),util[_0x6773('0x14e')](_0x5e7a4b,{'showHidden':![],'depth':null}));}};Preview[_0x6773('0x58')][_0x6773('0x14f')]=function(_0x1ada63){if(_0x1ada63){if(this[_0x6773('0x64')][_0x1ada63['transfertargetlinkedid']]){this[_0x6773('0x64')][_0x1ada63[_0x6773('0x150')]][_0x6773('0x145')]=!![];}}};Preview[_0x6773('0x58')][_0x6773('0x20')]=function(_0x3ccf56){if(_0x3ccf56){if(this[_0x6773('0x64')][_0x3ccf56['transfererlinkedid']]){this[_0x6773('0x64')][_0x3ccf56['transfererlinkedid']]['transfer']=!![];}}};module[_0x6773('0x151')]=Preview;
\ No newline at end of file
index 7c68fc4..9b254e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1ba=['[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallercomplete','endtime','context','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','getContactRecallMe','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','rescheduleContact','UserId','active'];(function(_0x4605bd,_0x5e7593){var _0xdb1464=function(_0x4ba004){while(--_0x4ba004){_0x4605bd['push'](_0x4605bd['shift']());}};_0xdb1464(++_0x5e7593);}(_0xa1ba,0x13b));var _0xaa1b=function(_0x3fb4c2,_0x2b473d){_0x3fb4c2=_0x3fb4c2-0x0;var _0x26dbdc=_0xa1ba[_0x3fb4c2];return _0x26dbdc;};'use strict';var util=require(_0xaa1b('0x0'));var BPromise=require(_0xaa1b('0x1'));var logger=require(_0xaa1b('0x2'))(_0xaa1b('0x3'));var _=require(_0xaa1b('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xaa1b('0x5'));var cmHopperHistory=require(_0xaa1b('0x6'));var cmHopperBlack=require(_0xaa1b('0x7'));var voiceQueueRt=require(_0xaa1b('0x8'));var agentReportPreview=require(_0xaa1b('0x9'));var voiceQueueReport=require(_0xaa1b('0xa'));function loggerCatch(_0x26f2bf){return function(_0x173c62){logger[_0xaa1b('0xb')](_0x26f2bf,util[_0xaa1b('0xc')](_0x173c62,{'showHidden':![],'depth':null}));};}function create(_0x441204){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](cmHopperHistory[_0xaa1b('0xf')](_0x441204))[_0xaa1b('0x10')](loggerCatch(_0xaa1b('0x11')));}function createAgent(_0x3dcbc2){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](agentReportPreview[_0xaa1b('0xf')](_0x3dcbc2))[_0xaa1b('0x10')](loggerCatch(_0xaa1b('0x11')));}function moveContact(_0x1e3839){return BPromise[_0xaa1b('0xd')]()['then'](cmHopper[_0xaa1b('0x12')](_0x1e3839,!![]))['catch'](loggerCatch(_0xaa1b('0x13')));}exports[_0xaa1b('0x14')]=function(_0x5b02ac){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](cmHopperBlack[_0xaa1b('0x14')](_0x5b02ac))[_0xaa1b('0x10')](loggerCatch(_0xaa1b('0x15')));};exports[_0xaa1b('0x16')]=function(_0x40e720){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](cmHopper['getContactPreview'](_0x40e720))[_0xaa1b('0x10')](loggerCatch(_0xaa1b('0x17')));};exports['createHistory']=function(_0x394070,_0x3628f3){create(_0x394070)[_0xaa1b('0x10')](loggerCatch(_0x3628f3));moveContact(_0x394070)['catch'](loggerCatch(_0x3628f3));};exports[_0xaa1b('0x18')]=function(_0x1496ba,_0x53cd27){createAgent(_0x1496ba)[_0xaa1b('0x10')](loggerCatch(_0x53cd27));};exports['createCustomerHistory']=function(_0x201073,_0xdb66cd){create(_0x201073)[_0xaa1b('0x10')](loggerCatch(_0xdb66cd));};exports['createCustomerFinal']=function(_0x1a8158,_0x4f701){moveContact(_0x1a8158)['catch'](loggerCatch(_0x4f701));};exports[_0xaa1b('0x19')]=function(_0x2f46f8,_0x138f15,_0x399dfe){if(_0x138f15){_0x2f46f8[_0xaa1b('0x1a')]=null;}if(_0x399dfe){_0x2f46f8[_0xaa1b('0x1b')]=![];}return BPromise['resolve']()['then'](cmHopper[_0xaa1b('0x19')](_0x2f46f8))[_0xaa1b('0x10')](loggerCatch(_0xaa1b('0x1c')));};exports[_0xaa1b('0x1d')]=function(_0xac6444){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](cmHopper[_0xaa1b('0x1d')](_0xac6444))[_0xaa1b('0x10')](loggerCatch('[countReScheduled]\x20'));};exports[_0xaa1b('0x1e')]=function(_0x108e25){return BPromise['resolve']()['then'](cmHopper[_0xaa1b('0x1e')]({'UserId':null},_0x108e25,0x1))[_0xaa1b('0x10')](loggerCatch('[unlockContact]\x20'));};exports[_0xaa1b('0x1f')]=function(_0x4f5b96){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](cmHopper['unlockContact']({'active':![]},_0x4f5b96,0x1))[_0xaa1b('0x10')](loggerCatch(_0xaa1b('0x20')));};exports['crateCustomerReportQueue']=function(_0x572761){var _0x3e6c1e={};_0x3e6c1e['type']=_0x572761[_0xaa1b('0x21')];_0x3e6c1e['uniqueid']=_0x572761[_0xaa1b('0x22')];_0x3e6c1e[_0xaa1b('0x23')]=_0x572761['calleridnum'];_0x3e6c1e[_0xaa1b('0x24')]=_0x572761[_0xaa1b('0x24')];_0x3e6c1e['queue']=_0x572761[_0xaa1b('0x25')];_0x3e6c1e['queuecallerjoinAt']=_0x572761['answertime'];_0x3e6c1e[_0xaa1b('0x26')]=_0x572761['answertime'];_0x3e6c1e[_0xaa1b('0x27')]=0x1;_0x3e6c1e['queuecallercompleteAt']=_0x572761[_0xaa1b('0x28')];_0x3e6c1e['connectedlinename']=_0x572761['membername'];_0x3e6c1e[_0xaa1b('0x29')]='from-sip';_0x3e6c1e['exten']=_0xaa1b('0x2a');_0x3e6c1e[_0xaa1b('0x2b')]=0x0;_0x3e6c1e[_0xaa1b('0x2c')]=0x1;_0x3e6c1e[_0xaa1b('0x2d')]=_0x572761[_0xaa1b('0x2e')];_0x3e6c1e[_0xaa1b('0x2f')]='COMPLETED';return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](voiceQueueReport['create'](_0x3e6c1e))[_0xaa1b('0x10')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xaa1b('0x30')]=function(_0x10d5a9,_0x563ba6){return BPromise[_0xaa1b('0xd')]()['then'](cmHopper[_0xaa1b('0x30')](_0x10d5a9,_0x563ba6))[_0xaa1b('0x10')](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x1d9fb9){return BPromise[_0xaa1b('0xd')]()[_0xaa1b('0xe')](cmHopper[_0xaa1b('0x19')](_0x1d9fb9,!![],!![]))[_0xaa1b('0x10')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0xd443=['context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','connectedlinename','membername'];(function(_0x1d2494,_0x43c13a){var _0x3320f3=function(_0x2de81f){while(--_0x2de81f){_0x1d2494['push'](_0x1d2494['shift']());}};_0x3320f3(++_0x43c13a);}(_0xd443,0x1c6));var _0x3d44=function(_0x439e70,_0x5be4a1){_0x439e70=_0x439e70-0x0;var _0x2598d0=_0xd443[_0x439e70];return _0x2598d0;};'use strict';var util=require(_0x3d44('0x0'));var BPromise=require(_0x3d44('0x1'));var logger=require('../../../config/logger')(_0x3d44('0x2'));var _=require(_0x3d44('0x3'));var cmHopper=require(_0x3d44('0x4'));var cmHopperFinal=require(_0x3d44('0x5'));var cmHopperHistory=require(_0x3d44('0x6'));var cmHopperBlack=require(_0x3d44('0x7'));var voiceQueueRt=require(_0x3d44('0x8'));var agentReportPreview=require(_0x3d44('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x450dd2){return function(_0x5cdf2a){logger['error'](_0x450dd2,util[_0x3d44('0xa')](_0x5cdf2a,{'showHidden':![],'depth':null}));};}function create(_0x34239a){return BPromise['resolve']()[_0x3d44('0xb')](cmHopperHistory[_0x3d44('0xc')](_0x34239a))[_0x3d44('0xd')](loggerCatch(_0x3d44('0xe')));}function createAgent(_0x4617e6){return BPromise[_0x3d44('0xf')]()['then'](agentReportPreview[_0x3d44('0xc')](_0x4617e6))[_0x3d44('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x11a6f4){return BPromise['resolve']()[_0x3d44('0xb')](cmHopper['moveContactManagedDialer'](_0x11a6f4,!![]))[_0x3d44('0xd')](loggerCatch(_0x3d44('0x10')));}exports[_0x3d44('0x11')]=function(_0x92743a){return BPromise['resolve']()[_0x3d44('0xb')](cmHopperBlack[_0x3d44('0x11')](_0x92743a))[_0x3d44('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x3d44('0x12')]=function(_0x227e70){return BPromise['resolve']()['then'](cmHopper[_0x3d44('0x12')](_0x227e70))['catch'](loggerCatch(_0x3d44('0x13')));};exports[_0x3d44('0xc')]=function(_0x7b7224,_0x5ed349){create(_0x7b7224)[_0x3d44('0xd')](loggerCatch(_0x5ed349));moveContact(_0x7b7224)[_0x3d44('0xd')](loggerCatch(_0x5ed349));};exports[_0x3d44('0x14')]=function(_0x193c88,_0x9fe1){createAgent(_0x193c88)[_0x3d44('0xd')](loggerCatch(_0x9fe1));};exports[_0x3d44('0x15')]=function(_0x2020a9,_0x80d178){create(_0x2020a9)['catch'](loggerCatch(_0x80d178));};exports[_0x3d44('0x16')]=function(_0x44d495,_0x59ec21){moveContact(_0x44d495)[_0x3d44('0xd')](loggerCatch(_0x59ec21));};exports[_0x3d44('0x17')]=function(_0x57a733,_0x8dfb3f,_0x218691){if(_0x8dfb3f){_0x57a733[_0x3d44('0x18')]=null;}if(_0x218691){_0x57a733[_0x3d44('0x19')]=![];}return BPromise[_0x3d44('0xf')]()[_0x3d44('0xb')](cmHopper[_0x3d44('0x17')](_0x57a733))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x3d44('0x1a')]=function(_0x44a532){return BPromise['resolve']()[_0x3d44('0xb')](cmHopper[_0x3d44('0x1a')](_0x44a532))[_0x3d44('0xd')](loggerCatch('[countReScheduled]\x20'));};exports[_0x3d44('0x1b')]=function(_0x3de555){return BPromise[_0x3d44('0xf')]()[_0x3d44('0xb')](cmHopper[_0x3d44('0x1b')]({'UserId':null},_0x3de555,0x1))[_0x3d44('0xd')](loggerCatch(_0x3d44('0x1c')));};exports[_0x3d44('0x1d')]=function(_0x5539b7){return BPromise['resolve']()[_0x3d44('0xb')](cmHopper['unlockContact']({'active':![]},_0x5539b7,0x1))['catch'](loggerCatch('[activeContact]\x20'));};exports[_0x3d44('0x1e')]=function(_0x258072){var _0x46e458={};_0x46e458[_0x3d44('0x1f')]=_0x258072['type'];_0x46e458[_0x3d44('0x20')]=_0x258072[_0x3d44('0x20')];_0x46e458[_0x3d44('0x21')]=_0x258072[_0x3d44('0x21')];_0x46e458[_0x3d44('0x22')]=_0x258072[_0x3d44('0x22')];_0x46e458[_0x3d44('0x23')]=_0x258072[_0x3d44('0x23')];_0x46e458[_0x3d44('0x24')]=_0x258072[_0x3d44('0x25')];_0x46e458['queuecallerleaveAt']=_0x258072[_0x3d44('0x25')];_0x46e458[_0x3d44('0x26')]=0x1;_0x46e458['queuecallercompleteAt']=_0x258072['endtime'];_0x46e458[_0x3d44('0x27')]=_0x258072[_0x3d44('0x28')];_0x46e458[_0x3d44('0x29')]='from-sip';_0x46e458[_0x3d44('0x2a')]=_0x3d44('0x2b');_0x46e458[_0x3d44('0x2c')]=0x0;_0x46e458[_0x3d44('0x2d')]=0x1;_0x46e458[_0x3d44('0x2e')]=_0x258072[_0x3d44('0x28')];_0x46e458[_0x3d44('0x2f')]=_0x3d44('0x30');return BPromise[_0x3d44('0xf')]()[_0x3d44('0xb')](voiceQueueReport[_0x3d44('0x31')](_0x46e458))[_0x3d44('0xd')](loggerCatch(_0x3d44('0x32')));};exports[_0x3d44('0x33')]=function(_0x4d6438,_0x36270b){return BPromise['resolve']()[_0x3d44('0xb')](cmHopper[_0x3d44('0x33')](_0x4d6438,_0x36270b))[_0x3d44('0xd')](loggerCatch(_0x3d44('0x34')));};exports[_0x3d44('0x35')]=function(_0x95dab3){return BPromise[_0x3d44('0xf')]()[_0x3d44('0xb')](cmHopper[_0x3d44('0x17')](_0x95dab3,!![],!![]))[_0x3d44('0xd')](loggerCatch(_0x3d44('0x36')));};
\ No newline at end of file
index 634bb4a..25be156 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdafa=['addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','answertime','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','countbusyretry','countcongestionretry','statedesc','Global','scheduledAt','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','active','countnoanswerretry','callback','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','inspect','logger2','info','message','string','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','isNil'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0xdafa,0x72));var _0xadaf=function(_0x538505,_0x3010e4){_0x538505=_0x538505-0x0;var _0x46c0a9=_0xdafa[_0x538505];return _0x46c0a9;};'use strict';var util=require(_0xadaf('0x0'));var _=require(_0xadaf('0x1'));var moment=require(_0xadaf('0x2'));var logger=require(_0xadaf('0x3'))(_0xadaf('0x4'));var ipAgi=process[_0xadaf('0x5')][_0xadaf('0x6')]||_0xadaf('0x7');function getSeconds(_0xbdf719,_0x429eb7){var _0x31a448=moment(_0xbdf719)[_0xadaf('0x8')](0x0);var _0x18c23f=moment(_0x429eb7)[_0xadaf('0x8')](0x0);return _0x31a448[_0xadaf('0x9')](_0x18c23f,_0xadaf('0xa'));}exports[_0xadaf('0xb')]=function(_0x2315fa){return function(_0x578637){logger[_0xadaf('0xc')](_0x2315fa,util['inspect'](_0x578637,{'showHidden':![],'depth':null}));};};exports[_0xadaf('0xd')]=function(_0x3dbfb7,_0x1fee44){logger['info'](_0x3dbfb7,util[_0xadaf('0xe')](_0x1fee44,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x352a9b,_0x31ff8e){logger[_0xadaf('0xc')](_0x352a9b,util[_0xadaf('0xe')](_0x31ff8e,{'showHidden':![],'depth':null}));};exports[_0xadaf('0xf')]=function(_0x175ce0){return function(_0x11d21f){logger[_0xadaf('0x10')](_0x175ce0,util[_0xadaf('0xe')](_0x11d21f,{'showHidden':![],'depth':null}));};};exports[_0xadaf('0x11')]=function(_0x3ddf0e,_0x273396,_0x6a6082){return{'message':_0x3ddf0e,'unlock':_0x273396,'active':_0x6a6082};};exports['getCallerId']=function(_0x223d92,_0x2a576d,_0x6c2faa){if(!_['isUndefined'](_0x6c2faa)&&_0xadaf('0x12')===typeof _0x6c2faa&&!_['isEmpty'](_0x6c2faa)){if(!_[_0xadaf('0x13')](_0x2a576d)&&_0xadaf('0x12')===typeof _0x2a576d&&!_[_0xadaf('0x14')](_0x2a576d)){return util[_0xadaf('0x15')](_0xadaf('0x16'),_0x2a576d,_0x6c2faa);}return util[_0xadaf('0x15')](_0xadaf('0x16'),_0x6c2faa,_0x6c2faa);}if(!_[_0xadaf('0x13')](_0x223d92)&&'string'===typeof _0x223d92&&!_[_0xadaf('0x14')](_0x223d92)){return _0x223d92;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x15c638){if(_[_0xadaf('0x17')](_0x15c638)){return![];}return _0x15c638;};exports[_0xadaf('0x18')]=function(_0x5d6695,_0x634f01,_0x5a6c94,_0x4305b2,_0x535db5,_0x214f6a){var _0x1152eb={'XMD-QUEUE':_0x634f01[_0xadaf('0x19')]?_0x634f01[_0xadaf('0x19')][_0xadaf('0x1a')]:'','XMD-CALLERID':_0x4305b2,'XMD-CALLERID-PREVIEW':_0x214f6a?util[_0xadaf('0x15')](_0xadaf('0x16'),_0x214f6a['calleridname'],_0x214f6a[_0xadaf('0x1b')]):_0x4305b2,'XMD-DIALID':_0x535db5,'XMD-CONTACTID':_0x634f01[_0xadaf('0x1c')],'XMD-CDRTYPE':_0xadaf('0x1d'),'CALLERID(all)':_0x4305b2,'XMD-VOICEQUEUEID':_0x634f01[_0xadaf('0x1e')],'XMD-DIALCHANNEL':_0x5a6c94,'XMD-DIALTIMEOUT':_0x5d6695[_0xadaf('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xadaf('0x20'),_0x5d6695[_0xadaf('0x21')]?'g':'',_['isEmpty'](_0x5d6695[_0xadaf('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x5d6695[_0xadaf('0x23')]||'','XMD-AGI':_0x5d6695[_0xadaf('0x24')]?util[_0xadaf('0x15')](_0xadaf('0x25'),ipAgi,_0x5d6695[_0xadaf('0x24')]):_0xadaf('0x26'),'XMD-AGIAFTER':_0x5d6695['dialQueueProject2']?util['format'](_0xadaf('0x25'),ipAgi,_0x5d6695[_0xadaf('0x21')]):_0xadaf('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x214f6a?_0x214f6a[_0xadaf('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x214f6a?_0x214f6a[_0xadaf('0x28')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x5d6695[_0xadaf('0x22')])){_0x1152eb[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5d6695['monitor_format'];_0x1152eb[util[_0xadaf('0x15')]('%s',_0xadaf('0x29'))]=_0x535db5;}if(_0x634f01&&_0x634f01[_0xadaf('0x2a')]){for(var _0x15ce35 in _0x634f01[_0xadaf('0x2a')]){if(_0x634f01[_0xadaf('0x2a')][_0xadaf('0x2b')](_0x15ce35)){if(!_[_0xadaf('0x17')](_0x634f01[_0xadaf('0x2a')][_0x15ce35])&&_0x15ce35!=='id'&&_0x15ce35!==_0xadaf('0x2c')&&_0x15ce35!==_0xadaf('0x2d')&&_0x15ce35!==_0xadaf('0x2e')){_0x1152eb[util['format'](_0xadaf('0x2f'),_0xadaf('0x30'),_[_0xadaf('0x31')](_0x15ce35))]=_0x634f01[_0xadaf('0x2a')][_0x15ce35];}}}}return _0x1152eb;};exports[_0xadaf('0x32')]=function(_0x9b9acf){var _0x51afd7={};for(var _0x213009 in _0x9b9acf){if(_0x9b9acf[_0xadaf('0x2b')](_0x213009)){_0x51afd7[util[_0xadaf('0x15')]('%s',_['toLower'](_0x213009))]=_0x9b9acf[_0x213009];}}return{'variables':_0x51afd7};};exports[_0xadaf('0x33')]=function(_0xb388f4,_0x1011a1){if(!_['isNil'](_0xb388f4)){if(_0xb388f4[_0xadaf('0x2b')](_0xadaf('0x34'))){if(_0xb388f4[_0xadaf('0x34')]>0x0){_0xb388f4['originated']-=0x1;}else{logger['error'](_0xadaf('0x35'),_0x1011a1);}}}else{logger[_0xadaf('0xc')](_0xadaf('0x36'),_0x1011a1);}};exports[_0xadaf('0x37')]=function(_0xc4b334){var _0x10cbdc=moment()[_0xadaf('0x15')](_0xadaf('0x38'));_0xc4b334[_0xadaf('0x39')]=0xd;_0xc4b334['statedesc']='Blacklist';_0xc4b334[_0xadaf('0x3a')]=_0x10cbdc;_0xc4b334[_0xadaf('0x3b')]=_0x10cbdc;_0xc4b334[_0xadaf('0x3c')]=_0x10cbdc;};exports[_0xadaf('0x3d')]=function(_0x6df129,_0x1b8cf9,_0x46a4a9){var _0x51313c=moment()[_0xadaf('0x15')](_0xadaf('0x38'));_0x6df129[_0xadaf('0x39')]=_0x1b8cf9;_0x6df129['statedesc']=_0x46a4a9;_0x6df129[_0xadaf('0x3b')]=_0x51313c;_0x6df129[_0xadaf('0x3e')]=getSeconds(_0x6df129[_0xadaf('0x3b')],_0x6df129[_0xadaf('0x3a')]);};exports[_0xadaf('0x3f')]=function(_0x215f4b,_0xdb8449,_0xea0d83){_0x215f4b[_0xadaf('0x40')]=_0xdb8449;_0x215f4b[_0xadaf('0x41')]=_0xea0d83;};exports['logCustomer']=function(_0x3b92b1,_0x2c6d54,_0x2bf354){var _0x574e37=moment()[_0xadaf('0x15')](_0xadaf('0x38'));_0x3b92b1[_0xadaf('0x39')]=_0x2c6d54;_0x3b92b1['statedesc']=_0x2bf354;_0x3b92b1[_0xadaf('0x3b')]=_0x3b92b1[_0xadaf('0x3b')]?_0x3b92b1['responsetime']:_0x574e37;_0x3b92b1[_0xadaf('0x3c')]=_0x3b92b1[_0xadaf('0x3c')]?_0x3b92b1[_0xadaf('0x3c')]:_0x574e37;_0x3b92b1[_0xadaf('0x3e')]=getSeconds(_0x3b92b1[_0xadaf('0x3b')]||0x0,_0x3b92b1[_0xadaf('0x3a')]||0x0);_0x3b92b1['talktime']=_0x3b92b1[_0xadaf('0x42')]?getSeconds(_0x3b92b1[_0xadaf('0x3c')],_0x3b92b1[_0xadaf('0x42')]):0x0;};exports['isFailure']=function(_0x1d11ea){return _0x1d11ea==='Failure';};exports['variablesAction']=function(_0x2e517e,_0x5c9453,_0x4de256,_0x1681eb,_0x544e9d){var _0x400a55=_0x1681eb?_0xadaf('0x43'):_0x2e517e[_0xadaf('0x44')];_0x400a55=_0x544e9d?_0xadaf('0x45'):_0x400a55;return{'actionid':_0x2e517e[_0xadaf('0x46')],'action':_0xadaf('0x47'),'channel':_0x2e517e[_0xadaf('0x48')],'callerid':util[_0xadaf('0x15')](_0xadaf('0x16'),_0x400a55,_0x2e517e[_0xadaf('0x1b')]),'Exten':_0xadaf('0x49'),'Context':'from-sip','Priority':'1','variable':_0x4de256,'timeout':(_0x5c9453[_0xadaf('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2e517e[_0xadaf('0x46')]};};exports['totalGlobal']=function(_0xd1729b){return _0xd1729b[_0xadaf('0x4b')]+_0xd1729b[_0xadaf('0x4c')]+_0xd1729b['countnoanswerretry']+_0xd1729b['countagentrejectretry']+_0xd1729b['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4d1c68){var _0xe6828a=_['clone'](_0x4d1c68);_0xe6828a['state']=0xf;_0xe6828a[_0xadaf('0x4d')]=_0xadaf('0x4e');return _0xe6828a;};exports[_0xadaf('0x4f')]=function(_0x4e0e7a,_0x19ff4e,_0x20c453){var _0x1a08c8={};_0x1a08c8[_0x19ff4e]=_0x4e0e7a[_0x19ff4e];_0x1a08c8['active']=![];_0x1a08c8[_0xadaf('0x50')]=moment()[_0xadaf('0x51')](_0x20c453,'minutes')[_0xadaf('0x15')](_0xadaf('0x38'));_0x1a08c8[_0xadaf('0x1c')]=_0x4e0e7a[_0xadaf('0x1c')];_0x1a08c8['ListId']=_0x4e0e7a[_0xadaf('0x52')];_0x1a08c8[_0xadaf('0x1e')]=_0x4e0e7a['VoiceQueueId']||undefined;return _0x1a08c8;};exports[_0xadaf('0x53')]=function(_0x287f6d,_0x27c66d){if(!_[_0xadaf('0x17')](_0x287f6d)){if(_0x287f6d[_0xadaf('0x54')]>0x0){_0x287f6d[_0xadaf('0x54')]-=0x1;}else{logger[_0xadaf('0xc')](_0x27c66d,_0xadaf('0x55'));}}else{logger[_0xadaf('0xc')](_0x27c66d,_0xadaf('0x56'));}};exports[_0xadaf('0x57')]=function(_0x3aec68){if(_0x3aec68<=0x0){return!![];}return![];};exports[_0xadaf('0x58')]=function(_0x5eebe1,_0x6ad0d5,_0x311c79){_0x5eebe1[_0xadaf('0x59')]=_0x6ad0d5;_0x5eebe1['name']=_0x5eebe1[_0xadaf('0x5a')];_0x5eebe1[_0xadaf('0x5b')]=_0x5eebe1[_0xadaf('0x48')];if(_0x311c79){_0x5eebe1[_0xadaf('0x5c')]=_0x311c79[_0xadaf('0x5c')];}return _0x5eebe1;};exports[_0xadaf('0x5d')]=function(_0x4331b0){var _0x492a44={};_0x492a44[_0xadaf('0x5a')]=_0x4331b0[_0xadaf('0x5a')];_0x492a44[_0xadaf('0x5b')]=_0x4331b0[_0xadaf('0x48')];_0x492a44[_0xadaf('0x46')]=_0x4331b0['uniqueid'];return _0x492a44;};exports[_0xadaf('0x5e')]=function(_0x58c58b){var _0x1c1bb3=[];for(var _0x26bdb1 in _0x58c58b){if(_0x58c58b[_0xadaf('0x2b')](_0x26bdb1)){if(!_[_0xadaf('0x17')](_0x58c58b[_0x26bdb1])&&_0x58c58b[_0x26bdb1][_0xadaf('0x39')]==='not_inuse'&&_0x58c58b[_0x26bdb1]['status']===_0xadaf('0x5f')){_0x1c1bb3[_0xadaf('0x60')](_0x58c58b[_0x26bdb1]['id']);}}}return _0x1c1bb3;};exports[_0xadaf('0x61')]=function(_0x5ac2b5){var _0x31ade9=moment()['milliseconds'](0x0);var _0x411333=moment(_0x5ac2b5)['milliseconds'](0x0);return _0x31ade9['diff'](_0x411333,_0xadaf('0xa'));};exports[_0xadaf('0x62')]=function(_0x1308be){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1308be[_0xadaf('0x1c')],'ListId':_0x1308be[_0xadaf('0x52')],'VoiceQueueId':_0x1308be[_0xadaf('0x1e')]||undefined,'CampaignId':_0x1308be[_0xadaf('0x63')]||undefined};};exports[_0xadaf('0x64')]=function(_0x65e487){if(_0x65e487===_0xadaf('0x46')||_0x65e487===_0xadaf('0x65')||_0x65e487===_0xadaf('0x5a')||_0x65e487===_0xadaf('0x66')||_0x65e487===_0xadaf('0x67')||_0x65e487===_0xadaf('0x68')||_0x65e487==='membername'||_0x65e487===_0xadaf('0x48')||_0x65e487===_0xadaf('0x44')||_0x65e487===_0xadaf('0x69')||_0x65e487==='calleridnum'||_0x65e487===_0xadaf('0x50')||_0x65e487===_0xadaf('0x4b')||_0x65e487===_0xadaf('0x4c')||_0x65e487===_0xadaf('0x6a')||_0x65e487==='countglobal'||_0x65e487===_0xadaf('0x6b')||_0x65e487==='callbackuniqueid'||_0x65e487==='callbackat'||_0x65e487===_0xadaf('0x6c')||_0x65e487===_0xadaf('0x1c')||_0x65e487===_0xadaf('0x52')||_0x65e487===_0xadaf('0x41')||_0x65e487===_0xadaf('0x1e')||_0x65e487===_0xadaf('0x6d')||_0x65e487===_0xadaf('0x6e')||_0x65e487===_0xadaf('0x6f')||_0x65e487===_0xadaf('0x70')||_0x65e487===_0xadaf('0x71')||_0x65e487===_0xadaf('0x72')||_0x65e487===_0xadaf('0x73')||_0x65e487===_0xadaf('0x74')||_0x65e487==='xmd-dialid'||_0x65e487===_0xadaf('0x75')||_0x65e487===_0xadaf('0x76')||_0x65e487==='xmd-cdrtype'||_0x65e487===_0xadaf('0x77')||_0x65e487===_0xadaf('0x78')||_0x65e487===_0xadaf('0x79')||_0x65e487===_0xadaf('0x7a')||_0x65e487===_0xadaf('0x7b')||_0x65e487===_0xadaf('0x7c')||_0x65e487===_0xadaf('0x7d')||_0x65e487===_0xadaf('0x7e')||_0x65e487===_0xadaf('0x7f')||_0x65e487===_0xadaf('0x80')||_0x65e487===_0xadaf('0x81')||_0x65e487===_0xadaf('0x7a')||_0x65e487===_0xadaf('0x7b')||_0x65e487===_0xadaf('0x7c')||_0x65e487===_0xadaf('0x7d')||_0x65e487===_0xadaf('0x7e')||_0x65e487==='rtpaudioqoslossbridged'||_0x65e487===_0xadaf('0x80')||_0x65e487===_0xadaf('0x81')||_0x65e487===_0xadaf('0x82')||_0x65e487===_0xadaf('0x83')||_0x65e487===_0xadaf('0x39')||_0x65e487===_0xadaf('0x4d')){return![];}return!![];};exports[_0xadaf('0x84')]=function(_0x54911a,_0x180b24){var _0x3e75fc,_0x90f693,_0x1495c8;if(_0x180b24<=0x0){_0x180b24=0x1;}_0x3e75fc=new RegExp(_0xadaf('0x85')+_0x180b24+'}$');_0x90f693=Math[_0xadaf('0x86')](0xa,_0x180b24-0x1);_0x1495c8=Math[_0xadaf('0x86')](0xa,_0x180b24)-0x1;return util[_0xadaf('0x15')]('%s',_['replace'](_0x54911a,_0x3e75fc,_[_0xadaf('0x87')](_0x90f693,_0x1495c8)));};exports[_0xadaf('0x88')]=function(_0x240069){var _0xa619a1=_0x240069[_0xadaf('0x89')](/"(.*?)"/);return _0xa619a1?_0xa619a1[0x1]:_0x240069;};exports['extractCalleridNumber']=function(_0x50a7be){var _0x16aa72=_0x50a7be[_0xadaf('0x89')](/<(.*?)>/);return _0x16aa72?_0x16aa72[0x1]:_0x50a7be;};
\ No newline at end of file
+var _0x1fe1=['XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','logger','info','loggerError','inspect','logger2','message','isUndefined','string','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','isEmpty','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','endtime','logAgent','statedesc','responsetime','logLookAgent','membername','UserId','logCustomer','talktime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','timeout','totalGlobal','countcongestionretry','countagentrejectretry','clone','active','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','queue','interface','channelAgent','mandatoryDisposition','buildAcw','agentReadyId','reachable','push','getDiff','diff','createBody','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countbusyretry','callbackuniqueid','recallme','ContactId','xmd-queue','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','moment','../../../../config/logger','preview','env'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1fe1,0x100));var _0x11fe=function(_0x160a37,_0x17adb8){_0x160a37=_0x160a37-0x0;var _0x265abb=_0x1fe1[_0x160a37];return _0x265abb;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x11fe('0x0'));var logger=require(_0x11fe('0x1'))(_0x11fe('0x2'));var ipAgi=process[_0x11fe('0x3')][_0x11fe('0x4')]||_0x11fe('0x5');function getSeconds(_0x3d8fec,_0x36b15e){var _0xc85e16=moment(_0x3d8fec)['milliseconds'](0x0);var _0x3b82c6=moment(_0x36b15e)[_0x11fe('0x6')](0x0);return _0xc85e16['diff'](_0x3b82c6,_0x11fe('0x7'));}exports[_0x11fe('0x8')]=function(_0x5a3b67){return function(_0x20b4c4){logger[_0x11fe('0x9')](_0x5a3b67,util['inspect'](_0x20b4c4,{'showHidden':![],'depth':null}));};};exports[_0x11fe('0xa')]=function(_0x3862ac,_0x23ca51){logger[_0x11fe('0xb')](_0x3862ac,util['inspect'](_0x23ca51,{'showHidden':![],'depth':null}));};exports[_0x11fe('0xc')]=function(_0x1f9eb0,_0x2d2fd8){logger['error'](_0x1f9eb0,util[_0x11fe('0xd')](_0x2d2fd8,{'showHidden':![],'depth':null}));};exports[_0x11fe('0xe')]=function(_0x1b1760){return function(_0x481ecb){logger['info'](_0x1b1760,util[_0x11fe('0xd')](_0x481ecb,{'showHidden':![],'depth':null}));};};exports[_0x11fe('0xf')]=function(_0x331986,_0x393183,_0x359592){return{'message':_0x331986,'unlock':_0x393183,'active':_0x359592};};exports['getCallerId']=function(_0x31f4f9,_0x4a88ce,_0x9d8f1e){if(!_[_0x11fe('0x10')](_0x9d8f1e)&&'string'===typeof _0x9d8f1e&&!_['isEmpty'](_0x9d8f1e)){if(!_[_0x11fe('0x10')](_0x4a88ce)&&_0x11fe('0x11')===typeof _0x4a88ce&&!_['isEmpty'](_0x4a88ce)){return util[_0x11fe('0x12')](_0x11fe('0x13'),_0x4a88ce,_0x9d8f1e);}return util[_0x11fe('0x12')](_0x11fe('0x13'),_0x9d8f1e,_0x9d8f1e);}if(!_[_0x11fe('0x10')](_0x31f4f9)&&'string'===typeof _0x31f4f9&&!_['isEmpty'](_0x31f4f9)){return _0x31f4f9;}return'\x22\x22\x20<>';};exports[_0x11fe('0x14')]=function(_0x46f83a){if(_[_0x11fe('0x15')](_0x46f83a)){return![];}return _0x46f83a;};exports[_0x11fe('0x16')]=function(_0x2b1983,_0x470960,_0x4fb768,_0x51e62,_0x34b832,_0x35bb3f){var _0x1f499f={'XMD-QUEUE':_0x470960[_0x11fe('0x17')]?_0x470960['Queue'][_0x11fe('0x18')]:'','XMD-CALLERID':_0x51e62,'XMD-CALLERID-PREVIEW':_0x35bb3f?util[_0x11fe('0x12')](_0x11fe('0x13'),_0x35bb3f[_0x11fe('0x19')],_0x35bb3f[_0x11fe('0x1a')]):_0x51e62,'XMD-DIALID':_0x34b832,'XMD-CONTACTID':_0x470960['ContactId'],'XMD-CDRTYPE':_0x11fe('0x1b'),'CALLERID(all)':_0x51e62,'XMD-VOICEQUEUEID':_0x470960[_0x11fe('0x1c')],'XMD-DIALCHANNEL':_0x4fb768,'XMD-DIALTIMEOUT':_0x2b1983['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x11fe('0x12')](_0x11fe('0x1d'),_0x2b1983['dialQueueProject2']?'g':'',_[_0x11fe('0x1e')](_0x2b1983[_0x11fe('0x1f')])?'':_0x11fe('0x20')),'XMD-DIALURL':_0x2b1983[_0x11fe('0x21')]||'','XMD-AGI':_0x2b1983[_0x11fe('0x22')]?util[_0x11fe('0x12')](_0x11fe('0x23'),ipAgi,_0x2b1983[_0x11fe('0x22')]):'NONE','XMD-AGIAFTER':_0x2b1983[_0x11fe('0x24')]?util[_0x11fe('0x12')](_0x11fe('0x23'),ipAgi,_0x2b1983[_0x11fe('0x24')]):_0x11fe('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x35bb3f?_0x35bb3f[_0x11fe('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x35bb3f?_0x35bb3f[_0x11fe('0x27')]:'','XMD-DESTINATION':_0x11fe('0x28')};if(!_[_0x11fe('0x1e')](_0x2b1983[_0x11fe('0x1f')])){_0x1f499f[util[_0x11fe('0x12')]('%s',_0x11fe('0x29'))]=_0x2b1983[_0x11fe('0x1f')];_0x1f499f[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x34b832;}if(_0x470960&&_0x470960['Contact']){for(var _0x4d772 in _0x470960[_0x11fe('0x2a')]){if(_0x470960[_0x11fe('0x2a')][_0x11fe('0x2b')](_0x4d772)){if(!_[_0x11fe('0x15')](_0x470960[_0x11fe('0x2a')][_0x4d772])&&_0x4d772!=='id'&&_0x4d772!==_0x11fe('0x2c')&&_0x4d772!==_0x11fe('0x2d')&&_0x4d772!=='updatedAt'){_0x1f499f[util['format']('%s%s',_0x11fe('0x2e'),_[_0x11fe('0x2f')](_0x4d772))]=_0x470960[_0x11fe('0x2a')][_0x4d772];}}}}return _0x1f499f;};exports[_0x11fe('0x30')]=function(_0x41c351){var _0x25806f={};for(var _0x2a17f2 in _0x41c351){if(_0x41c351['hasOwnProperty'](_0x2a17f2)){_0x25806f[util[_0x11fe('0x12')]('%s',_['toLower'](_0x2a17f2))]=_0x41c351[_0x2a17f2];}}return{'variables':_0x25806f};};exports[_0x11fe('0x31')]=function(_0x5cd073,_0x17dc8e){if(!_[_0x11fe('0x15')](_0x5cd073)){if(_0x5cd073[_0x11fe('0x2b')]('originated')){if(_0x5cd073[_0x11fe('0x32')]>0x0){_0x5cd073[_0x11fe('0x32')]-=0x1;}else{logger[_0x11fe('0x9')](_0x11fe('0x33'),_0x17dc8e);}}}else{logger[_0x11fe('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x17dc8e);}};exports[_0x11fe('0x34')]=function(_0x5ce8ae){var _0x1daa7a=moment()['format'](_0x11fe('0x35'));_0x5ce8ae[_0x11fe('0x36')]=0xd;_0x5ce8ae['statedesc']=_0x11fe('0x37');_0x5ce8ae[_0x11fe('0x38')]=_0x1daa7a;_0x5ce8ae['responsetime']=_0x1daa7a;_0x5ce8ae[_0x11fe('0x39')]=_0x1daa7a;};exports[_0x11fe('0x3a')]=function(_0x58f2cf,_0x3cd841,_0x58150c){var _0x2f601d=moment()[_0x11fe('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x58f2cf[_0x11fe('0x36')]=_0x3cd841;_0x58f2cf[_0x11fe('0x3b')]=_0x58150c;_0x58f2cf[_0x11fe('0x3c')]=_0x2f601d;_0x58f2cf['ringtime']=getSeconds(_0x58f2cf[_0x11fe('0x3c')],_0x58f2cf[_0x11fe('0x38')]);};exports[_0x11fe('0x3d')]=function(_0x1c9f0d,_0x347969,_0x48f889){_0x1c9f0d[_0x11fe('0x3e')]=_0x347969;_0x1c9f0d[_0x11fe('0x3f')]=_0x48f889;};exports[_0x11fe('0x40')]=function(_0x51f436,_0xf28deb,_0x5ca054){var _0x25c612=moment()['format'](_0x11fe('0x35'));_0x51f436[_0x11fe('0x36')]=_0xf28deb;_0x51f436[_0x11fe('0x3b')]=_0x5ca054;_0x51f436[_0x11fe('0x3c')]=_0x51f436[_0x11fe('0x3c')]?_0x51f436[_0x11fe('0x3c')]:_0x25c612;_0x51f436[_0x11fe('0x39')]=_0x51f436[_0x11fe('0x39')]?_0x51f436['endtime']:_0x25c612;_0x51f436['ringtime']=getSeconds(_0x51f436[_0x11fe('0x3c')]||0x0,_0x51f436[_0x11fe('0x38')]||0x0);_0x51f436[_0x11fe('0x41')]=_0x51f436['answertime']?getSeconds(_0x51f436[_0x11fe('0x39')],_0x51f436['answertime']):0x0;};exports[_0x11fe('0x42')]=function(_0x2be36b){return _0x2be36b===_0x11fe('0x43');};exports['variablesAction']=function(_0x5ae3e8,_0xab54bb,_0x1714c8,_0x3369f1,_0x569769){var _0x5afad0=_0x3369f1?_0x11fe('0x44'):_0x5ae3e8['calleridname'];_0x5afad0=_0x569769?_0x11fe('0x45'):_0x5afad0;return{'actionid':_0x5ae3e8[_0x11fe('0x46')],'action':_0x11fe('0x47'),'channel':_0x5ae3e8['channelAgent'],'callerid':util[_0x11fe('0x12')](_0x11fe('0x13'),_0x5afad0,_0x5ae3e8['calleridnum']),'Exten':_0x11fe('0x28'),'Context':'from-sip','Priority':'1','variable':_0x1714c8,'timeout':(_0xab54bb[_0x11fe('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5ae3e8[_0x11fe('0x46')]};};exports[_0x11fe('0x49')]=function(_0x4a70d4){return _0x4a70d4['countbusyretry']+_0x4a70d4[_0x11fe('0x4a')]+_0x4a70d4['countnoanswerretry']+_0x4a70d4[_0x11fe('0x4b')]+_0x4a70d4['countnosuchnumberretry'];};exports['cloneAction']=function(_0x4d38da){var _0x5ad5b0=_[_0x11fe('0x4c')](_0x4d38da);_0x5ad5b0['state']=0xf;_0x5ad5b0[_0x11fe('0x3b')]='Global';return _0x5ad5b0;};exports['scheduledAt']=function(_0x5d8821,_0xb98ad6,_0x11c8c5){var _0x1143a9={};_0x1143a9[_0xb98ad6]=_0x5d8821[_0xb98ad6];_0x1143a9[_0x11fe('0x4d')]=![];_0x1143a9['scheduledat']=moment()[_0x11fe('0x4e')](_0x11c8c5,'minutes')['format'](_0x11fe('0x35'));_0x1143a9['ContactId']=_0x5d8821['ContactId'];_0x1143a9[_0x11fe('0x4f')]=_0x5d8821[_0x11fe('0x4f')];_0x1143a9[_0x11fe('0x1c')]=_0x5d8821[_0x11fe('0x1c')]||undefined;return _0x1143a9;};exports['decrementTalkink']=function(_0x223664,_0x1b51b8){if(!_[_0x11fe('0x15')](_0x223664)){if(_0x223664[_0x11fe('0x50')]>0x0){_0x223664[_0x11fe('0x50')]-=0x1;}else{logger['error'](_0x1b51b8,_0x11fe('0x51'));}}else{logger[_0x11fe('0x9')](_0x1b51b8,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x263939){if(_0x263939<=0x0){return!![];}return![];};exports[_0x11fe('0x52')]=function(_0x143cb2,_0x4a8aa9,_0x1cdb41){_0x143cb2[_0x11fe('0x53')]=_0x4a8aa9;_0x143cb2[_0x11fe('0x18')]=_0x143cb2[_0x11fe('0x54')];_0x143cb2[_0x11fe('0x55')]=_0x143cb2[_0x11fe('0x56')];if(_0x1cdb41){_0x143cb2[_0x11fe('0x57')]=_0x1cdb41['mandatoryDisposition'];}return _0x143cb2;};exports[_0x11fe('0x58')]=function(_0xcfeae1){var _0x56ab2e={};_0x56ab2e[_0x11fe('0x54')]=_0xcfeae1[_0x11fe('0x54')];_0x56ab2e[_0x11fe('0x55')]=_0xcfeae1[_0x11fe('0x56')];_0x56ab2e[_0x11fe('0x46')]=_0xcfeae1['uniqueid'];return _0x56ab2e;};exports[_0x11fe('0x59')]=function(_0x514cbb){var _0x486523=[];for(var _0x3dca08 in _0x514cbb){if(_0x514cbb[_0x11fe('0x2b')](_0x3dca08)){if(!_[_0x11fe('0x15')](_0x514cbb[_0x3dca08])&&_0x514cbb[_0x3dca08][_0x11fe('0x36')]==='not_inuse'&&_0x514cbb[_0x3dca08]['status']===_0x11fe('0x5a')){_0x486523[_0x11fe('0x5b')](_0x514cbb[_0x3dca08]['id']);}}}return _0x486523;};exports[_0x11fe('0x5c')]=function(_0x305bf5){var _0xd63a43=moment()[_0x11fe('0x6')](0x0);var _0x4a45b7=moment(_0x305bf5)[_0x11fe('0x6')](0x0);return _0xd63a43[_0x11fe('0x5d')](_0x4a45b7,_0x11fe('0x7'));};exports[_0x11fe('0x5e')]=function(_0x39f7aa){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x39f7aa['ContactId'],'ListId':_0x39f7aa[_0x11fe('0x4f')],'VoiceQueueId':_0x39f7aa[_0x11fe('0x1c')]||undefined,'CampaignId':_0x39f7aa['CampaignId']||undefined};};exports[_0x11fe('0x5f')]=function(_0x34b768){if(_0x34b768===_0x11fe('0x46')||_0x34b768===_0x11fe('0x60')||_0x34b768===_0x11fe('0x54')||_0x34b768==='type'||_0x34b768===_0x11fe('0x61')||_0x34b768===_0x11fe('0x62')||_0x34b768===_0x11fe('0x3e')||_0x34b768===_0x11fe('0x56')||_0x34b768==='calleridname'||_0x34b768===_0x11fe('0x4d')||_0x34b768===_0x11fe('0x1a')||_0x34b768===_0x11fe('0x63')||_0x34b768===_0x11fe('0x64')||_0x34b768===_0x11fe('0x4a')||_0x34b768==='countnoanswerretry'||_0x34b768==='countglobal'||_0x34b768==='callback'||_0x34b768===_0x11fe('0x65')||_0x34b768==='callbackat'||_0x34b768===_0x11fe('0x66')||_0x34b768===_0x11fe('0x67')||_0x34b768===_0x11fe('0x4f')||_0x34b768===_0x11fe('0x3f')||_0x34b768===_0x11fe('0x1c')||_0x34b768==='sipcallid'||_0x34b768==='xmd-voicequeueid'||_0x34b768===_0x11fe('0x68')||_0x34b768===_0x11fe('0x69')||_0x34b768===_0x11fe('0x6a')||_0x34b768==='xmd-dialurl'||_0x34b768==='xmd-dialtimeout'||_0x34b768===_0x11fe('0x6b')||_0x34b768==='xmd-dialid'||_0x34b768===_0x11fe('0x6c')||_0x34b768===_0x11fe('0x6d')||_0x34b768===_0x11fe('0x6e')||_0x34b768===_0x11fe('0x6f')||_0x34b768===_0x11fe('0x70')||_0x34b768===_0x11fe('0x71')||_0x34b768==='rtpaudioqos'||_0x34b768===_0x11fe('0x72')||_0x34b768==='rtpaudioqosjitter'||_0x34b768===_0x11fe('0x73')||_0x34b768===_0x11fe('0x74')||_0x34b768===_0x11fe('0x75')||_0x34b768===_0x11fe('0x76')||_0x34b768===_0x11fe('0x77')||_0x34b768===_0x11fe('0x78')||_0x34b768===_0x11fe('0x72')||_0x34b768===_0x11fe('0x79')||_0x34b768==='rtpaudioqosjitterbridged'||_0x34b768===_0x11fe('0x74')||_0x34b768===_0x11fe('0x75')||_0x34b768===_0x11fe('0x76')||_0x34b768===_0x11fe('0x77')||_0x34b768===_0x11fe('0x7a')||_0x34b768===_0x11fe('0x7b')||_0x34b768===_0x11fe('0x36')||_0x34b768==='statedesc'){return![];}return!![];};exports[_0x11fe('0x7c')]=function(_0x2b74e5,_0x212996){var _0x454253,_0xfb869e,_0x59cccc;if(_0x212996<=0x0){_0x212996=0x1;}_0x454253=new RegExp('\x5cw{0,'+_0x212996+'}$');_0xfb869e=Math[_0x11fe('0x7d')](0xa,_0x212996-0x1);_0x59cccc=Math['pow'](0xa,_0x212996)-0x1;return util['format']('%s',_['replace'](_0x2b74e5,_0x454253,_[_0x11fe('0x7e')](_0xfb869e,_0x59cccc)));};exports[_0x11fe('0x7f')]=function(_0x4eb779){var _0x376c71=_0x4eb779[_0x11fe('0x80')](/"(.*?)"/);return _0x376c71?_0x376c71[0x1]:_0x4eb779;};exports[_0x11fe('0x81')]=function(_0x3867b4){var _0x5541cb=_0x3867b4['match'](/<(.*?)>/);return _0x5541cb?_0x5541cb[0x1]:_0x3867b4;};
\ No newline at end of file
index 6a8f983..20e85cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d8=['queueremove','queuepause','boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','number'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0xa3d8,0x1f1));var _0x8a3d=function(_0x443b9e,_0x23e7ab){_0x443b9e=_0x443b9e-0x0;var _0xd39d56=_0xa3d8[_0x443b9e];return _0xd39d56;};'use strict';exports[_0x8a3d('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x8a3d('0x1'),'required':!![]},'membername':{'type':_0x8a3d('0x1'),'required':!![]},'penalty':{'type':_0x8a3d('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x8a3d('0x3')]={'queue':{'type':_0x8a3d('0x1'),'required':!![]},'interface':{'type':_0x8a3d('0x1'),'required':!![]}};exports[_0x8a3d('0x4')]={'interface':{'type':_0x8a3d('0x1'),'required':!![]},'paused':{'type':_0x8a3d('0x5')},'reason':{'type':_0x8a3d('0x1'),'required':![]}};exports[_0x8a3d('0x6')]={'module':{'type':_0x8a3d('0x1'),'required':![]}};exports[_0x8a3d('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x8a3d('0x8')]={'uniqueid':{'type':_0x8a3d('0x1'),'required':!![]},'filename':{'type':_0x8a3d('0x1')},'format':{'type':_0x8a3d('0x1')},'mixmonitorid':{'type':_0x8a3d('0x1')}};exports[_0x8a3d('0x9')]={'uniqueid':{'type':_0x8a3d('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x8a3d('0x1'),'required':!![]},'exten':{'type':_0x8a3d('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x5c83=['voicequeuechannelhangup','voicequeuechannelredirect','string','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x5b89a8,_0xbbc8f3){var _0x880e31=function(_0x43cbe3){while(--_0x43cbe3){_0x5b89a8['push'](_0x5b89a8['shift']());}};_0x880e31(++_0xbbc8f3);}(_0x5c83,0xbf));var _0x35c8=function(_0x599c44,_0x2fb16e){_0x599c44=_0x599c44-0x0;var _0x1d6cf6=_0x5c83[_0x599c44];return _0x1d6cf6;};'use strict';exports['queueadd']={'queue':{'type':_0x35c8('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x35c8('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x35c8('0x1'),'required':![]}};exports[_0x35c8('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x35c8('0x0'),'required':!![]}};exports[_0x35c8('0x3')]={'interface':{'type':_0x35c8('0x0'),'required':!![]},'paused':{'type':_0x35c8('0x1')},'reason':{'type':_0x35c8('0x0'),'required':![]}};exports[_0x35c8('0x4')]={'module':{'type':_0x35c8('0x0'),'required':![]}};exports[_0x35c8('0x5')]={'uniqueid':{'type':_0x35c8('0x0'),'required':!![]}};exports[_0x35c8('0x6')]={'uniqueid':{'type':_0x35c8('0x0'),'required':!![]},'filename':{'type':_0x35c8('0x0')},'format':{'type':_0x35c8('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x35c8('0x7')]={'uniqueid':{'type':_0x35c8('0x0'),'required':!![]}};exports[_0x35c8('0x8')]={'uniqueid':{'type':_0x35c8('0x0'),'required':!![]},'exten':{'type':_0x35c8('0x0'),'required':!![]},'context':{'type':_0x35c8('0x0')}};
\ No newline at end of file
index 229fff7..9fc9627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1f8=['sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','length','isUndefined','mergeFromDatabase','initTelephones','telephones','initTrunks','initVoiceQueues','initTriggers','triggers','initTemplates','initZendeskAccounts','initZohoAccounts','zohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','answered','sumBillable','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','trunks','voiceQueues','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','SIP/%s','name','total'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf1f8,0x10f));var _0x8f1f=function(_0x268f61,_0x407d84){_0x268f61=_0x268f61-0x0;var _0x3c85d9=_0xf1f8[_0x268f61];return _0x3c85d9;};'use strict';var BPromise=require(_0x8f1f('0x0'));var util=require(_0x8f1f('0x1'));var _=require(_0x8f1f('0x2'));var moment=require(_0x8f1f('0x3'));var Agent=require(_0x8f1f('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x8f1f('0x5'));var VoiceQueue=require(_0x8f1f('0x6'));var Trigger=require(_0x8f1f('0x7'));var Template=require(_0x8f1f('0x8'));var Campaign=require(_0x8f1f('0x9'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8f1f('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x8f1f('0xb'));var SugarcrmAccount=require(_0x8f1f('0xc'));var ZohoAccount=require(_0x8f1f('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x8f1f('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x8f1f('0xf'));var FreshsalesAccount=require(_0x8f1f('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x8f1f('0x11')]={};this['telephones']={};this[_0x8f1f('0x12')]={};this[_0x8f1f('0x13')]={};this['triggers']={};this[_0x8f1f('0x14')]={};this[_0x8f1f('0x15')]={};this[_0x8f1f('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x8f1f('0x17')]={};this[_0x8f1f('0x18')]={};this[_0x8f1f('0x19')]={};this[_0x8f1f('0x1a')]={};this['settings']={};this[_0x8f1f('0x1b')]={};this[_0x8f1f('0x1c')]={};this[_0x8f1f('0x1d')]={};this[_0x8f1f('0x1e')]={};this['zohoAccounts']={};this[_0x8f1f('0x1f')]={};this[_0x8f1f('0x20')]={};this[_0x8f1f('0x21')]={};this[_0x8f1f('0x22')]={};this[_0x8f1f('0x23')]={};this[_0x8f1f('0x24')]={};};function freeIsNotKey(_0x3b704a,_0x37f4b9,_0x5621e0){var _0x25c7f1=_[_0x8f1f('0x25')](_0x3b704a,function(_0x1d1e79,_0x1faedc){return _0x1d1e79[_0x5621e0];});for(var _0x4d25b9 in _0x37f4b9){if(_0x37f4b9[_0x8f1f('0x26')](_0x4d25b9)){if(!_0x25c7f1[_0x4d25b9]){delete _0x37f4b9[_0x4d25b9];}}}}function freeIsNotKeySip(_0x3490f7,_0x11eaea){var _0x2aa737=_['mapKeys'](_0x3490f7,function(_0xbe2fdd,_0x44d46a){return util['format']('SIP/%s',_0xbe2fdd['name']);});for(var _0x394705 in _0x11eaea){if(_0x11eaea[_0x8f1f('0x26')](_0x394705)){if(!_0x2aa737[_0x394705]){delete _0x11eaea[_0x394705];}}}}function freeIsNotKeyAgent(_0x290ffd,_0x52f8ce){var _0x4426ba=_[_0x8f1f('0x25')](_0x290ffd,function(_0x330fbf,_0x7dd128){var _0x2cd503=_[_0x8f1f('0x27')](_0x330fbf['interface'])?util[_0x8f1f('0x28')](_0x8f1f('0x29'),_0x330fbf[_0x8f1f('0x2a')]):_0x330fbf['interface'];return _0x2cd503;});for(var _0x4b4e34 in _0x52f8ce){if(_0x52f8ce['hasOwnProperty'](_0x4b4e34)){if(!_0x4426ba[_0x4b4e34]){delete _0x52f8ce[_0x4b4e34];}}}}function clearVoiceCallReports(_0x5cd802){_0x5cd802[_0x8f1f('0x2b')]=0x0;_0x5cd802['answered']=0x0;_0x5cd802[_0x8f1f('0x2c')]=0x0;_0x5cd802[_0x8f1f('0x2d')]=0x0;_0x5cd802['sumBillable']=0x0;}function clearCampaigns(_0x2ab1f6){if(!_[_0x8f1f('0x2e')](_0x2ab1f6)){for(var _0x5a0251 in _0x2ab1f6){if(_0x2ab1f6['hasOwnProperty'](_0x5a0251)){_0x2ab1f6[_0x5a0251][_0x8f1f('0x2f')]=0x0;_0x2ab1f6[_0x5a0251][_0x8f1f('0x30')]=0x0;}}}}function clearVoiceQueues(_0x19c666){if(!_[_0x8f1f('0x2e')](_0x19c666)){for(var _0x11f76f in _0x19c666){if(_0x19c666['hasOwnProperty'](_0x11f76f)){_0x19c666[_0x11f76f][_0x8f1f('0x2b')]=0x0;_0x19c666[_0x11f76f]['answered']=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x31')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x32')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x2c')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x2d')]=0x0;_0x19c666[_0x11f76f]['sumBillable']=0x0;_0x19c666[_0x11f76f]['outboundAnswerAgiCallsDay']=0x0;_0x19c666[_0x11f76f]['outboundNoAnswerCallsDay']=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x33')]=0x0;_0x19c666[_0x11f76f]['outboundCongestionCallsDay']=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x34')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x35')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x36')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x37')]=0x0;_0x19c666[_0x11f76f]['outboundBlacklistCallsDay']=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x38')]=0x0;_0x19c666[_0x11f76f]['outboundRejectCallsDay']=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x39')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x3a')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x3b')]=0x0;_0x19c666[_0x11f76f][_0x8f1f('0x3c')]=!![];}}}}Realtime[_0x8f1f('0x3d')]['mergeFromDatabase']=function(_0x29f25a,_0x2a0321){for(var _0x32c34b in _0x2a0321){if(_0x29f25a[_0x8f1f('0x26')](_0x32c34b)){_0x29f25a[_0x32c34b]=_0x2a0321[_0x32c34b];}}};Realtime['prototype'][_0x8f1f('0x3e')]=function(){var _0x473aba=this;return function(_0x2483a1){if(_0x2483a1){freeIsNotKeyAgent(_0x2483a1,_0x473aba['agents']);for(var _0x4ec303=0x0,_0xabad5f={},_0x29eb68={};_0x4ec303<_0x2483a1[_0x8f1f('0x3f')];_0x4ec303+=0x1){_0xabad5f=_0x2483a1[_0x4ec303];var _0x41ade3=_[_0x8f1f('0x27')](_0xabad5f['interface'])?util['format'](_0x8f1f('0x29'),_0xabad5f[_0x8f1f('0x2a')]):_0xabad5f['interface'];if(_[_0x8f1f('0x40')](_0x473aba[_0x8f1f('0x11')][_0x41ade3])){_0x473aba[_0x8f1f('0x11')][_0x41ade3]=new Agent(_0xabad5f);}else{_0x473aba[_0x8f1f('0x41')](_0x473aba['agents'][_0x41ade3],_0xabad5f);}}}return _0x473aba['agents'];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x42')]=function(){var _0x2cb2c3=this;return function(_0x4087f5){if(_0x4087f5){freeIsNotKeySip(_0x4087f5,_0x2cb2c3[_0x8f1f('0x43')]);for(var _0x10b3a8=0x0,_0x500c9e={},_0x639bdd={};_0x10b3a8<_0x4087f5[_0x8f1f('0x3f')];_0x10b3a8+=0x1){_0x500c9e=_0x4087f5[_0x10b3a8];if(_['isUndefined'](_0x2cb2c3['telephones'][util[_0x8f1f('0x28')](_0x8f1f('0x29'),_0x500c9e['name'])])){_0x2cb2c3['telephones'][util[_0x8f1f('0x28')](_0x8f1f('0x29'),_0x500c9e[_0x8f1f('0x2a')])]=new Telephone(_0x500c9e);}else{_0x2cb2c3[_0x8f1f('0x41')](_0x2cb2c3[_0x8f1f('0x43')][util['format'](_0x8f1f('0x29'),_0x500c9e[_0x8f1f('0x2a')])],_0x500c9e);}}}return _0x2cb2c3[_0x8f1f('0x43')];};};Realtime['prototype'][_0x8f1f('0x44')]=function(){var _0x43fac7=this;return function(_0x46f84f){if(_0x46f84f){freeIsNotKeySip(_0x46f84f,_0x43fac7[_0x8f1f('0x12')]);for(var _0x4d35e7=0x0,_0x5d51d1={},_0x2352d5={};_0x4d35e7<_0x46f84f[_0x8f1f('0x3f')];_0x4d35e7+=0x1){_0x5d51d1=_0x46f84f[_0x4d35e7];if(_[_0x8f1f('0x40')](_0x43fac7[_0x8f1f('0x12')][util[_0x8f1f('0x28')](_0x8f1f('0x29'),_0x5d51d1[_0x8f1f('0x2a')])])){_0x43fac7['trunks'][util[_0x8f1f('0x28')]('SIP/%s',_0x5d51d1[_0x8f1f('0x2a')])]=new Trunk(_0x5d51d1);}else{_0x43fac7[_0x8f1f('0x41')](_0x43fac7[_0x8f1f('0x12')][util[_0x8f1f('0x28')](_0x8f1f('0x29'),_0x5d51d1[_0x8f1f('0x2a')])],_0x5d51d1);}}}return _0x43fac7[_0x8f1f('0x12')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x45')]=function(){var _0x1cc2ec=this;return function(_0x598b1f){if(_0x598b1f){freeIsNotKey(_0x598b1f,_0x1cc2ec['voiceQueues'],_0x8f1f('0x2a'));for(var _0x2d58a7=0x0,_0x5200e4={},_0x5115d2={};_0x2d58a7<_0x598b1f[_0x8f1f('0x3f')];_0x2d58a7+=0x1){_0x5200e4=_0x598b1f[_0x2d58a7];if(_['isUndefined'](_0x1cc2ec[_0x8f1f('0x13')][_0x5200e4['name']])){_0x1cc2ec[_0x8f1f('0x13')][_0x5200e4[_0x8f1f('0x2a')]]=new VoiceQueue(_0x5200e4);}else{_0x1cc2ec[_0x8f1f('0x41')](_0x1cc2ec[_0x8f1f('0x13')][_0x5200e4[_0x8f1f('0x2a')]],_0x5200e4);}}}return _0x1cc2ec[_0x8f1f('0x13')];};};Realtime['prototype'][_0x8f1f('0x46')]=function(){var _0x450aea=this;return function(_0x4b2218){if(_0x4b2218){freeIsNotKey(_0x4b2218,_0x450aea['triggers'],'id');for(var _0x2a5264=0x0,_0x59062f={},_0x5099af={};_0x2a5264<_0x4b2218[_0x8f1f('0x3f')];_0x2a5264+=0x1){_0x59062f=_0x4b2218[_0x2a5264];if(_['isUndefined'](_0x450aea['triggers'][_0x59062f['id']])){_0x450aea[_0x8f1f('0x47')][_0x59062f['id']]=new Trigger(_0x59062f);}else{_0x450aea['mergeFromDatabase'](_0x450aea[_0x8f1f('0x47')][_0x59062f['id']],_0x59062f);}}}return _0x450aea['triggers'];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x48')]=function(){var _0x439f4c=this;return function(_0x2f5704){if(_0x2f5704){freeIsNotKey(_0x2f5704,_0x439f4c[_0x8f1f('0x15')],'id');for(var _0x4a37b5=0x0,_0x49c4a3={},_0x543b0c={};_0x4a37b5<_0x2f5704['length'];_0x4a37b5+=0x1){_0x49c4a3=_0x2f5704[_0x4a37b5];if(_['isUndefined'](_0x439f4c[_0x8f1f('0x15')][_0x49c4a3['id']])){_0x439f4c['templates'][_0x49c4a3['id']]=new Template(_0x49c4a3);}else{_0x439f4c[_0x8f1f('0x41')](_0x439f4c[_0x8f1f('0x15')][_0x49c4a3['id']],_0x49c4a3);}}}return _0x439f4c[_0x8f1f('0x15')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x49')]=function(){var _0x221134=this;return function(_0x392c48){if(_0x392c48){freeIsNotKey(_0x392c48,_0x221134[_0x8f1f('0x1b')],'id');for(var _0x234847=0x0,_0x2dcf66={},_0x499a17={};_0x234847<_0x392c48[_0x8f1f('0x3f')];_0x234847+=0x1){_0x2dcf66=_0x392c48[_0x234847];if(_[_0x8f1f('0x40')](_0x221134[_0x8f1f('0x1b')][_0x2dcf66['id']])){_0x221134[_0x8f1f('0x1b')][_0x2dcf66['id']]=new ZendeskAccount(_0x2dcf66);}else{_0x221134[_0x8f1f('0x41')](_0x221134['zendeskAccounts'][_0x2dcf66['id']],_0x2dcf66);}}}return _0x221134['zendeskAccounts'];};};Realtime[_0x8f1f('0x3d')]['initSalesforceAccounts']=function(){var _0x87aca4=this;return function(_0x4e555e){if(_0x4e555e){freeIsNotKey(_0x4e555e,_0x87aca4['salesforceAccounts'],'id');for(var _0x224416=0x0,_0x2f295e={},_0x4f08ef={};_0x224416<_0x4e555e['length'];_0x224416+=0x1){_0x2f295e=_0x4e555e[_0x224416];if(_[_0x8f1f('0x40')](_0x87aca4['salesforceAccounts'][_0x2f295e['id']])){_0x87aca4[_0x8f1f('0x1c')][_0x2f295e['id']]=new SalesforceAccount(_0x2f295e);}else{_0x87aca4['mergeFromDatabase'](_0x87aca4[_0x8f1f('0x1c')][_0x2f295e['id']],_0x2f295e);}}}return _0x87aca4[_0x8f1f('0x1c')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x5a4a37=this;return function(_0x1653be){if(_0x1653be){freeIsNotKey(_0x1653be,_0x5a4a37[_0x8f1f('0x1e')],'id');for(var _0x48697d=0x0,_0x3992bc={},_0x13a15e={};_0x48697d<_0x1653be['length'];_0x48697d+=0x1){_0x3992bc=_0x1653be[_0x48697d];if(_['isUndefined'](_0x5a4a37[_0x8f1f('0x1e')][_0x3992bc['id']])){_0x5a4a37[_0x8f1f('0x1e')][_0x3992bc['id']]=new FreshdeskAccount(_0x3992bc);}else{_0x5a4a37[_0x8f1f('0x41')](_0x5a4a37[_0x8f1f('0x1e')][_0x3992bc['id']],_0x3992bc);}}}return _0x5a4a37['freshdeskAccounts'];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x4a')]=function(){var _0x52f4ad=this;return function(_0x2f72d3){if(_0x2f72d3){freeIsNotKey(_0x2f72d3,_0x52f4ad[_0x8f1f('0x4b')],'id');for(var _0x2e543b=0x0,_0x4d924b={},_0x223eba={};_0x2e543b<_0x2f72d3['length'];_0x2e543b+=0x1){_0x4d924b=_0x2f72d3[_0x2e543b];if(_[_0x8f1f('0x40')](_0x52f4ad[_0x8f1f('0x4b')][_0x4d924b['id']])){_0x52f4ad[_0x8f1f('0x4b')][_0x4d924b['id']]=new ZohoAccount(_0x4d924b);}else{_0x52f4ad[_0x8f1f('0x41')](_0x52f4ad[_0x8f1f('0x4b')][_0x4d924b['id']],_0x4d924b);}}}return _0x52f4ad[_0x8f1f('0x4b')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x10ffc3=this;return function(_0x2c0b1e){if(_0x2c0b1e){freeIsNotKey(_0x2c0b1e,_0x10ffc3['deskAccounts'],'id');for(var _0xe75fab=0x0,_0x17c77a={},_0x449692={};_0xe75fab<_0x2c0b1e[_0x8f1f('0x3f')];_0xe75fab+=0x1){_0x17c77a=_0x2c0b1e[_0xe75fab];if(_['isUndefined'](_0x10ffc3[_0x8f1f('0x1f')][_0x17c77a['id']])){_0x10ffc3[_0x8f1f('0x1f')][_0x17c77a['id']]=new DeskAccount(_0x17c77a);}else{_0x10ffc3['mergeFromDatabase'](_0x10ffc3[_0x8f1f('0x1f')][_0x17c77a['id']],_0x17c77a);}}}return _0x10ffc3[_0x8f1f('0x1f')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x4c')]=function(){var _0x5a6f49=this;return function(_0x61b0f6){if(_0x61b0f6){freeIsNotKey(_0x61b0f6,_0x5a6f49['sugarcrmAccounts'],'id');for(var _0x4366d6=0x0,_0x4dcef4={},_0x493f35={};_0x4366d6<_0x61b0f6[_0x8f1f('0x3f')];_0x4366d6+=0x1){_0x4dcef4=_0x61b0f6[_0x4366d6];if(_['isUndefined'](_0x5a6f49[_0x8f1f('0x1d')][_0x4dcef4['id']])){_0x5a6f49['sugarcrmAccounts'][_0x4dcef4['id']]=new SugarcrmAccount(_0x4dcef4);}else{_0x5a6f49[_0x8f1f('0x41')](_0x5a6f49['sugarcrmAccounts'][_0x4dcef4['id']],_0x4dcef4);}}}return _0x5a6f49[_0x8f1f('0x1d')];};};Realtime['prototype'][_0x8f1f('0x4d')]=function(){var _0x2e548e=this;return function(_0x5abc29){if(_0x5abc29){freeIsNotKey(_0x5abc29,_0x2e548e[_0x8f1f('0x20')],'id');for(var _0x49d5d3=0x0,_0x3c05e3={},_0x18743c={};_0x49d5d3<_0x5abc29[_0x8f1f('0x3f')];_0x49d5d3+=0x1){_0x3c05e3=_0x5abc29[_0x49d5d3];if(_[_0x8f1f('0x40')](_0x2e548e[_0x8f1f('0x20')][_0x3c05e3['id']])){_0x2e548e[_0x8f1f('0x20')][_0x3c05e3['id']]=new VtigerAccount(_0x3c05e3);}else{_0x2e548e['mergeFromDatabase'](_0x2e548e[_0x8f1f('0x20')][_0x3c05e3['id']],_0x3c05e3);}}}return _0x2e548e['vtigerAccounts'];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x4e')]=function(){var _0x32280f=this;return function(_0x2c162c){if(_0x2c162c){freeIsNotKey(_0x2c162c,_0x32280f['servicenowAccounts'],'id');for(var _0x2d5328=0x0,_0x5583cd={},_0x4a0882={};_0x2d5328<_0x2c162c[_0x8f1f('0x3f')];_0x2d5328+=0x1){_0x5583cd=_0x2c162c[_0x2d5328];if(_['isUndefined'](_0x32280f[_0x8f1f('0x21')][_0x5583cd['id']])){_0x32280f[_0x8f1f('0x21')][_0x5583cd['id']]=new ServicenowAccount(_0x5583cd);}else{_0x32280f[_0x8f1f('0x41')](_0x32280f[_0x8f1f('0x21')][_0x5583cd['id']],_0x5583cd);}}}return _0x32280f[_0x8f1f('0x21')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x4f')]=function(){var _0x58d3d3=this;return function(_0x529170){if(_0x529170){freeIsNotKey(_0x529170,_0x58d3d3[_0x8f1f('0x22')],'id');for(var _0x4029bc=0x0,_0x17cdca={},_0x4fbe24={};_0x4029bc<_0x529170[_0x8f1f('0x3f')];_0x4029bc+=0x1){_0x17cdca=_0x529170[_0x4029bc];if(_[_0x8f1f('0x40')](_0x58d3d3[_0x8f1f('0x22')][_0x17cdca['id']])){_0x58d3d3[_0x8f1f('0x22')][_0x17cdca['id']]=new Dynamics365Account(_0x17cdca);}else{_0x58d3d3[_0x8f1f('0x41')](_0x58d3d3[_0x8f1f('0x22')][_0x17cdca['id']],_0x17cdca);}}}return _0x58d3d3[_0x8f1f('0x22')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x50')]=function(){var _0x2c4744=this;return function(_0x16926d){if(_0x16926d){freeIsNotKey(_0x16926d,_0x2c4744[_0x8f1f('0x23')],'id');for(var _0x41202a=0x0,_0x4226a5={},_0x2d9a5e={};_0x41202a<_0x16926d[_0x8f1f('0x3f')];_0x41202a+=0x1){_0x4226a5=_0x16926d[_0x41202a];if(_[_0x8f1f('0x40')](_0x2c4744[_0x8f1f('0x23')][_0x4226a5['id']])){_0x2c4744['freshsalesAccounts'][_0x4226a5['id']]=new FreshsalesAccount(_0x4226a5);}else{_0x2c4744[_0x8f1f('0x41')](_0x2c4744[_0x8f1f('0x23')][_0x4226a5['id']],_0x4226a5);}}}return _0x2c4744[_0x8f1f('0x23')];};};Realtime[_0x8f1f('0x3d')]['initVoiceQueueHopperHistory']=function(){var _0x5cf7ab=this;return function(_0x368cad){for(var _0x5c1975=0x0;_0x5c1975<_0x368cad[_0x8f1f('0x3f')];_0x5c1975+=0x1){_['merge'](_0x5cf7ab[_0x8f1f('0x13')][_0x368cad[_0x5c1975][_0x8f1f('0x2a')]],_0x368cad[_0x5c1975]);}return _0x5cf7ab[_0x8f1f('0x13')];};};Realtime[_0x8f1f('0x3d')]['initVoiceQueueReports']=function(){var _0x3579ea=this;return function(_0x1efd9a){clearVoiceQueues(_0x3579ea[_0x8f1f('0x13')]);if(_0x1efd9a){_0x1efd9a=_[_0x8f1f('0x51')](_0x1efd9a,_0x8f1f('0x52'));for(var _0x471a29 in _0x1efd9a){if(_0x1efd9a['hasOwnProperty'](_0x471a29)){var _0x455e4f={};for(var _0x24f726=0x0;_0x24f726<_0x1efd9a[_0x471a29][_0x8f1f('0x3f')];_0x24f726+=0x1){var _0x3805c1=_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x53')];if(_0x3579ea['voiceQueues'][_0x3805c1]){if(_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x54')]){_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x31')]+=0x1;}if(_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x55')]){_0x3579ea['voiceQueues'][_0x3805c1][_0x8f1f('0x32')]+=0x1;}_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x2c')]+=moment(_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x56')])[_0x8f1f('0x57')](moment(_0x1efd9a[_0x471a29][_0x24f726]['queuecallerjoinAt']),_0x8f1f('0x58'))||0x0;if(_0x24f726===_0x1efd9a[_0x471a29]['length']-0x1){_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x2d')]+=moment(_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x59')]||_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x5a')]||_0x1efd9a[_0x471a29][_0x24f726]['queuecallerexitAt'])['diff'](moment(_0x1efd9a[_0x471a29][_0x24f726]['queuecallerjoinAt']),_0x8f1f('0x58'))||0x0;_0x3579ea[_0x8f1f('0x13')][_0x3805c1]['total']+=0x1;if(_0x1efd9a[_0x471a29][_0x24f726]['queuecallercomplete']){_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x5b')]+=0x1;_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x5c')]+=moment(_0x1efd9a[_0x471a29][_0x24f726]['queuecallercompleteAt'])[_0x8f1f('0x57')](moment(_0x1efd9a[_0x471a29][_0x24f726][_0x8f1f('0x56')]),_0x8f1f('0x58'))||0x0;}}else{_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x2d')]+=_0x3579ea[_0x8f1f('0x13')][_0x3805c1][_0x8f1f('0x2c')]||0x0;}}}}}}return _0x3579ea[_0x8f1f('0x13')];};};Realtime[_0x8f1f('0x3d')]['initVoiceCallReports']=function(){var _0x2a4679=this;return function(_0x3971da){clearVoiceCallReports(_0x2a4679[_0x8f1f('0x16')]);if(_0x3971da){for(var _0x384fd9=0x0;_0x384fd9<_0x3971da[_0x8f1f('0x3f')];_0x384fd9+=0x1){_0x2a4679[_0x8f1f('0x16')][_0x8f1f('0x2b')]+=0x1;_0x2a4679[_0x8f1f('0x16')][_0x8f1f('0x2d')]+=_0x3971da[_0x384fd9][_0x8f1f('0x5d')];if(_0x3971da[_0x384fd9][_0x8f1f('0x5e')]===_0x8f1f('0x5f')){_0x2a4679['outbound'][_0x8f1f('0x5b')]+=0x1;_0x2a4679[_0x8f1f('0x16')][_0x8f1f('0x2c')]+=_0x3971da[_0x384fd9][_0x8f1f('0x5d')]-_0x3971da[_0x384fd9]['billableseconds']||0x0;_0x2a4679[_0x8f1f('0x16')][_0x8f1f('0x5c')]+=_0x3971da[_0x384fd9][_0x8f1f('0x60')];}}}return _0x2a4679['outbound'];};};Realtime['prototype']['initCampaigns']=function(){var _0x1aa68d=this;return function(_0x6feb6b){if(_0x6feb6b){freeIsNotKey(_0x6feb6b,_0x1aa68d['campaigns'],_0x8f1f('0x2a'));for(var _0x597270=0x0,_0x5723f4={};_0x597270<_0x6feb6b[_0x8f1f('0x3f')];_0x597270+=0x1){_0x5723f4=_0x6feb6b[_0x597270];if(_[_0x8f1f('0x40')](_0x1aa68d['campaigns'][_0x5723f4['name']])){_0x1aa68d[_0x8f1f('0x14')][_0x5723f4[_0x8f1f('0x2a')]]=new Campaign(_0x5723f4);}else{_0x1aa68d[_0x8f1f('0x41')](_0x1aa68d['campaigns'][_0x5723f4['name']],_0x5723f4);_0x1aa68d[_0x8f1f('0x14')][_0x5723f4[_0x8f1f('0x2a')]][_0x8f1f('0x61')]=_0x5723f4[_0x8f1f('0x62')]?_0x5723f4[_0x8f1f('0x62')][_0x8f1f('0x2a')]:undefined;}}}return _0x1aa68d[_0x8f1f('0x14')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x63')]=function(){var _0x43a694=this;return function(_0x38ca64){if(_0x38ca64){freeIsNotKey(_0x38ca64,_0x43a694[_0x8f1f('0x64')],'id');for(var _0x36870e=0x0,_0x4b1fed={};_0x36870e<_0x38ca64[_0x8f1f('0x3f')];_0x36870e+=0x1){_0x4b1fed=_0x38ca64[_0x36870e];if(_[_0x8f1f('0x40')](_0x43a694[_0x8f1f('0x64')][_0x4b1fed['id']])){_0x43a694[_0x8f1f('0x64')][_0x4b1fed['id']]=new VoiceExtension(_0x4b1fed);}else{_0x43a694['mergeFromDatabase'](_0x43a694[_0x8f1f('0x64')][_0x4b1fed['id']],_0x4b1fed);}}}return _0x43a694[_0x8f1f('0x64')];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x65')]=function(){var _0x1dcd8a=this;return function(_0xf557c4){clearCampaigns(_0x1dcd8a['campaigns']);for(var _0x24ff2e=0x0;_0x24ff2e<_0xf557c4['length'];_0x24ff2e+=0x1){_[_0x8f1f('0x66')](_0x1dcd8a[_0x8f1f('0x14')][_0xf557c4[_0x24ff2e]['name']],_0xf557c4[_0x24ff2e]);}return _0x1dcd8a['campaigns'];};};Realtime[_0x8f1f('0x3d')][_0x8f1f('0x67')]=function(){var _0x3783cc=this;return function(_0x7556dd){if(_0x7556dd){freeIsNotKey(_0x7556dd,_0x3783cc[_0x8f1f('0x24')],'id');for(var _0x4d1bfc=0x0,_0x4d9f9e={},_0x2e3174={};_0x4d1bfc<_0x7556dd[_0x8f1f('0x3f')];_0x4d1bfc+=0x1){_0x4d9f9e=_0x7556dd[_0x4d1bfc];if(_['isUndefined'](_0x3783cc[_0x8f1f('0x24')][_0x4d9f9e['id']])){_0x3783cc['faxAccounts'][_0x4d9f9e['id']]=new FaxAccount(_0x4d9f9e);}else{_0x3783cc['mergeFromDatabase'](_0x3783cc[_0x8f1f('0x24')][_0x4d9f9e['id']],_0x4d9f9e);}}}return _0x3783cc[_0x8f1f('0x24')];};};module[_0x8f1f('0x68')]=Realtime;
\ No newline at end of file
+var _0x3122=['../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','length','isUndefined','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','duration','disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue'];(function(_0x3a9349,_0xdb8806){var _0x2c924b=function(_0x2cbfd8){while(--_0x2cbfd8){_0x3a9349['push'](_0x3a9349['shift']());}};_0x2c924b(++_0xdb8806);}(_0x3122,0x1b2));var _0x2312=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3122[_0x167cc1];return _0x10bc4b;};'use strict';var BPromise=require(_0x2312('0x0'));var util=require(_0x2312('0x1'));var _=require(_0x2312('0x2'));var moment=require('moment');var Agent=require(_0x2312('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x2312('0x4'));var VoiceQueue=require(_0x2312('0x5'));var Trigger=require(_0x2312('0x6'));var Template=require(_0x2312('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x2312('0x8'));var ZendeskAccount=require(_0x2312('0x9'));var SalesforceAccount=require(_0x2312('0xa'));var FreshdeskAccount=require(_0x2312('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x2312('0xc'));var DeskAccount=require(_0x2312('0xd'));var VtigerAccount=require(_0x2312('0xe'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x2312('0xf'));var FreshsalesAccount=require(_0x2312('0x10'));var FaxAccount=require(_0x2312('0x11'));var Realtime=function(){this[_0x2312('0x12')]={};this[_0x2312('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0x2312('0x14')]={};this[_0x2312('0x15')]={};this[_0x2312('0x16')]={};this[_0x2312('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2312('0x18')]={};this[_0x2312('0x19')]={};this['queueChannels']={};this[_0x2312('0x1a')]={};this[_0x2312('0x1b')]={};this['settings']={};this[_0x2312('0x1c')]={};this[_0x2312('0x1d')]={};this[_0x2312('0x1e')]={};this[_0x2312('0x1f')]={};this[_0x2312('0x20')]={};this[_0x2312('0x21')]={};this[_0x2312('0x22')]={};this[_0x2312('0x23')]={};this[_0x2312('0x24')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x490018,_0x584eb8,_0x28867c){var _0x5639d2=_[_0x2312('0x25')](_0x490018,function(_0x34217b,_0x501c47){return _0x34217b[_0x28867c];});for(var _0x23afda in _0x584eb8){if(_0x584eb8[_0x2312('0x26')](_0x23afda)){if(!_0x5639d2[_0x23afda]){delete _0x584eb8[_0x23afda];}}}}function freeIsNotKeySip(_0x296624,_0x14b68a){var _0x2ef20c=_['mapKeys'](_0x296624,function(_0x448a24,_0x7701eb){return util['format'](_0x2312('0x27'),_0x448a24[_0x2312('0x28')]);});for(var _0xc57f27 in _0x14b68a){if(_0x14b68a[_0x2312('0x26')](_0xc57f27)){if(!_0x2ef20c[_0xc57f27]){delete _0x14b68a[_0xc57f27];}}}}function freeIsNotKeyAgent(_0x2467a8,_0x3bedb4){var _0x49f300=_[_0x2312('0x25')](_0x2467a8,function(_0x1281c7,_0x4b34d7){var _0x3e923c=_[_0x2312('0x29')](_0x1281c7[_0x2312('0x2a')])?util[_0x2312('0x2b')](_0x2312('0x27'),_0x1281c7[_0x2312('0x28')]):_0x1281c7['interface'];return _0x3e923c;});for(var _0x4b5890 in _0x3bedb4){if(_0x3bedb4['hasOwnProperty'](_0x4b5890)){if(!_0x49f300[_0x4b5890]){delete _0x3bedb4[_0x4b5890];}}}}function clearVoiceCallReports(_0x316c94){_0x316c94[_0x2312('0x2c')]=0x0;_0x316c94[_0x2312('0x2d')]=0x0;_0x316c94[_0x2312('0x2e')]=0x0;_0x316c94[_0x2312('0x2f')]=0x0;_0x316c94[_0x2312('0x30')]=0x0;}function clearCampaigns(_0x6f66a){if(!_[_0x2312('0x31')](_0x6f66a)){for(var _0x1bb878 in _0x6f66a){if(_0x6f66a[_0x2312('0x26')](_0x1bb878)){_0x6f66a[_0x1bb878][_0x2312('0x32')]=0x0;_0x6f66a[_0x1bb878][_0x2312('0x33')]=0x0;}}}}function clearVoiceQueues(_0x36da44){if(!_[_0x2312('0x31')](_0x36da44)){for(var _0x4fb32f in _0x36da44){if(_0x36da44[_0x2312('0x26')](_0x4fb32f)){_0x36da44[_0x4fb32f]['total']=0x0;_0x36da44[_0x4fb32f][_0x2312('0x2d')]=0x0;_0x36da44[_0x4fb32f]['unmanaged']=0x0;_0x36da44[_0x4fb32f][_0x2312('0x34')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x2e')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x2f')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x30')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x35')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x36')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x37')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x38')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x39')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x3a')]=0x0;_0x36da44[_0x4fb32f]['outboundDropCallsDayTimeout']=0x0;_0x36da44[_0x4fb32f][_0x2312('0x3b')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x3c')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x3d')]=0x0;_0x36da44[_0x4fb32f]['outboundRejectCallsDay']=0x0;_0x36da44[_0x4fb32f][_0x2312('0x3e')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x35')]=0x0;_0x36da44[_0x4fb32f][_0x2312('0x3f')]=0x0;_0x36da44[_0x4fb32f]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x2312('0x40')]=function(_0x51bee7,_0x91192b){for(var _0x2ffa06 in _0x91192b){if(_0x51bee7[_0x2312('0x26')](_0x2ffa06)){_0x51bee7[_0x2ffa06]=_0x91192b[_0x2ffa06];}}};Realtime[_0x2312('0x41')]['initAgents']=function(){var _0x57cfe7=this;return function(_0x540c91){if(_0x540c91){freeIsNotKeyAgent(_0x540c91,_0x57cfe7[_0x2312('0x12')]);for(var _0x17b257=0x0,_0x205cec={},_0x2ca059={};_0x17b257<_0x540c91[_0x2312('0x42')];_0x17b257+=0x1){_0x205cec=_0x540c91[_0x17b257];var _0x3721a8=_[_0x2312('0x29')](_0x205cec['interface'])?util['format'](_0x2312('0x27'),_0x205cec['name']):_0x205cec[_0x2312('0x2a')];if(_[_0x2312('0x43')](_0x57cfe7[_0x2312('0x12')][_0x3721a8])){_0x57cfe7[_0x2312('0x12')][_0x3721a8]=new Agent(_0x205cec);}else{_0x57cfe7[_0x2312('0x40')](_0x57cfe7['agents'][_0x3721a8],_0x205cec);}}}return _0x57cfe7['agents'];};};Realtime['prototype']['initTelephones']=function(){var _0x40755a=this;return function(_0x341c64){if(_0x341c64){freeIsNotKeySip(_0x341c64,_0x40755a[_0x2312('0x13')]);for(var _0x33dcac=0x0,_0x23b33f={},_0x2778c8={};_0x33dcac<_0x341c64['length'];_0x33dcac+=0x1){_0x23b33f=_0x341c64[_0x33dcac];if(_[_0x2312('0x43')](_0x40755a[_0x2312('0x13')][util[_0x2312('0x2b')](_0x2312('0x27'),_0x23b33f[_0x2312('0x28')])])){_0x40755a[_0x2312('0x13')][util[_0x2312('0x2b')]('SIP/%s',_0x23b33f[_0x2312('0x28')])]=new Telephone(_0x23b33f);}else{_0x40755a['mergeFromDatabase'](_0x40755a[_0x2312('0x13')][util[_0x2312('0x2b')]('SIP/%s',_0x23b33f[_0x2312('0x28')])],_0x23b33f);}}}return _0x40755a['telephones'];};};Realtime[_0x2312('0x41')][_0x2312('0x44')]=function(){var _0xf9cec3=this;return function(_0x3163c6){if(_0x3163c6){freeIsNotKeySip(_0x3163c6,_0xf9cec3[_0x2312('0x45')]);for(var _0x12da7b=0x0,_0x42cbe1={},_0x5a452c={};_0x12da7b<_0x3163c6[_0x2312('0x42')];_0x12da7b+=0x1){_0x42cbe1=_0x3163c6[_0x12da7b];if(_[_0x2312('0x43')](_0xf9cec3[_0x2312('0x45')][util[_0x2312('0x2b')](_0x2312('0x27'),_0x42cbe1['name'])])){_0xf9cec3[_0x2312('0x45')][util[_0x2312('0x2b')]('SIP/%s',_0x42cbe1['name'])]=new Trunk(_0x42cbe1);}else{_0xf9cec3[_0x2312('0x40')](_0xf9cec3[_0x2312('0x45')][util['format'](_0x2312('0x27'),_0x42cbe1['name'])],_0x42cbe1);}}}return _0xf9cec3[_0x2312('0x45')];};};Realtime[_0x2312('0x41')][_0x2312('0x46')]=function(){var _0x4165c5=this;return function(_0x37bd03){if(_0x37bd03){freeIsNotKey(_0x37bd03,_0x4165c5['voiceQueues'],_0x2312('0x28'));for(var _0x483d69=0x0,_0x2c969c={},_0x4eb0c0={};_0x483d69<_0x37bd03[_0x2312('0x42')];_0x483d69+=0x1){_0x2c969c=_0x37bd03[_0x483d69];if(_[_0x2312('0x43')](_0x4165c5[_0x2312('0x47')][_0x2c969c['name']])){_0x4165c5[_0x2312('0x47')][_0x2c969c[_0x2312('0x28')]]=new VoiceQueue(_0x2c969c);}else{_0x4165c5[_0x2312('0x40')](_0x4165c5['voiceQueues'][_0x2c969c[_0x2312('0x28')]],_0x2c969c);}}}return _0x4165c5['voiceQueues'];};};Realtime[_0x2312('0x41')][_0x2312('0x48')]=function(){var _0x54a164=this;return function(_0xce1687){if(_0xce1687){freeIsNotKey(_0xce1687,_0x54a164['triggers'],'id');for(var _0x56d7fd=0x0,_0xe6269c={},_0xfc6b1b={};_0x56d7fd<_0xce1687[_0x2312('0x42')];_0x56d7fd+=0x1){_0xe6269c=_0xce1687[_0x56d7fd];if(_[_0x2312('0x43')](_0x54a164[_0x2312('0x14')][_0xe6269c['id']])){_0x54a164[_0x2312('0x14')][_0xe6269c['id']]=new Trigger(_0xe6269c);}else{_0x54a164[_0x2312('0x40')](_0x54a164[_0x2312('0x14')][_0xe6269c['id']],_0xe6269c);}}}return _0x54a164[_0x2312('0x14')];};};Realtime[_0x2312('0x41')][_0x2312('0x49')]=function(){var _0x3b3698=this;return function(_0x4a1311){if(_0x4a1311){freeIsNotKey(_0x4a1311,_0x3b3698['templates'],'id');for(var _0x5bb193=0x0,_0x10c8d7={},_0x37f46e={};_0x5bb193<_0x4a1311[_0x2312('0x42')];_0x5bb193+=0x1){_0x10c8d7=_0x4a1311[_0x5bb193];if(_[_0x2312('0x43')](_0x3b3698[_0x2312('0x16')][_0x10c8d7['id']])){_0x3b3698[_0x2312('0x16')][_0x10c8d7['id']]=new Template(_0x10c8d7);}else{_0x3b3698[_0x2312('0x40')](_0x3b3698[_0x2312('0x16')][_0x10c8d7['id']],_0x10c8d7);}}}return _0x3b3698[_0x2312('0x16')];};};Realtime[_0x2312('0x41')]['initZendeskAccounts']=function(){var _0x51eb4c=this;return function(_0x2470fb){if(_0x2470fb){freeIsNotKey(_0x2470fb,_0x51eb4c[_0x2312('0x1c')],'id');for(var _0x3cfc1d=0x0,_0xc3c0f2={},_0x3fc091={};_0x3cfc1d<_0x2470fb[_0x2312('0x42')];_0x3cfc1d+=0x1){_0xc3c0f2=_0x2470fb[_0x3cfc1d];if(_[_0x2312('0x43')](_0x51eb4c[_0x2312('0x1c')][_0xc3c0f2['id']])){_0x51eb4c[_0x2312('0x1c')][_0xc3c0f2['id']]=new ZendeskAccount(_0xc3c0f2);}else{_0x51eb4c['mergeFromDatabase'](_0x51eb4c[_0x2312('0x1c')][_0xc3c0f2['id']],_0xc3c0f2);}}}return _0x51eb4c[_0x2312('0x1c')];};};Realtime[_0x2312('0x41')][_0x2312('0x4a')]=function(){var _0x1b1489=this;return function(_0x34840b){if(_0x34840b){freeIsNotKey(_0x34840b,_0x1b1489['salesforceAccounts'],'id');for(var _0x5cc3b5=0x0,_0x36287a={},_0x554f40={};_0x5cc3b5<_0x34840b['length'];_0x5cc3b5+=0x1){_0x36287a=_0x34840b[_0x5cc3b5];if(_[_0x2312('0x43')](_0x1b1489['salesforceAccounts'][_0x36287a['id']])){_0x1b1489[_0x2312('0x1d')][_0x36287a['id']]=new SalesforceAccount(_0x36287a);}else{_0x1b1489[_0x2312('0x40')](_0x1b1489['salesforceAccounts'][_0x36287a['id']],_0x36287a);}}}return _0x1b1489[_0x2312('0x1d')];};};Realtime['prototype'][_0x2312('0x4b')]=function(){var _0x128234=this;return function(_0x1e59ac){if(_0x1e59ac){freeIsNotKey(_0x1e59ac,_0x128234[_0x2312('0x1f')],'id');for(var _0x47f4c6=0x0,_0x439958={},_0x14084e={};_0x47f4c6<_0x1e59ac[_0x2312('0x42')];_0x47f4c6+=0x1){_0x439958=_0x1e59ac[_0x47f4c6];if(_[_0x2312('0x43')](_0x128234[_0x2312('0x1f')][_0x439958['id']])){_0x128234['freshdeskAccounts'][_0x439958['id']]=new FreshdeskAccount(_0x439958);}else{_0x128234['mergeFromDatabase'](_0x128234[_0x2312('0x1f')][_0x439958['id']],_0x439958);}}}return _0x128234['freshdeskAccounts'];};};Realtime['prototype'][_0x2312('0x4c')]=function(){var _0x1ee20b=this;return function(_0xf6c322){if(_0xf6c322){freeIsNotKey(_0xf6c322,_0x1ee20b[_0x2312('0x20')],'id');for(var _0x321dd1=0x0,_0x545671={},_0x8aa4ac={};_0x321dd1<_0xf6c322['length'];_0x321dd1+=0x1){_0x545671=_0xf6c322[_0x321dd1];if(_[_0x2312('0x43')](_0x1ee20b['zohoAccounts'][_0x545671['id']])){_0x1ee20b['zohoAccounts'][_0x545671['id']]=new ZohoAccount(_0x545671);}else{_0x1ee20b[_0x2312('0x40')](_0x1ee20b['zohoAccounts'][_0x545671['id']],_0x545671);}}}return _0x1ee20b[_0x2312('0x20')];};};Realtime[_0x2312('0x41')][_0x2312('0x4d')]=function(){var _0x3f99cd=this;return function(_0x29d434){if(_0x29d434){freeIsNotKey(_0x29d434,_0x3f99cd[_0x2312('0x21')],'id');for(var _0x281934=0x0,_0x35121d={},_0x19dac4={};_0x281934<_0x29d434[_0x2312('0x42')];_0x281934+=0x1){_0x35121d=_0x29d434[_0x281934];if(_[_0x2312('0x43')](_0x3f99cd['deskAccounts'][_0x35121d['id']])){_0x3f99cd[_0x2312('0x21')][_0x35121d['id']]=new DeskAccount(_0x35121d);}else{_0x3f99cd[_0x2312('0x40')](_0x3f99cd[_0x2312('0x21')][_0x35121d['id']],_0x35121d);}}}return _0x3f99cd[_0x2312('0x21')];};};Realtime[_0x2312('0x41')][_0x2312('0x4e')]=function(){var _0x2218f2=this;return function(_0x219219){if(_0x219219){freeIsNotKey(_0x219219,_0x2218f2[_0x2312('0x1e')],'id');for(var _0x3beb12=0x0,_0xb46d1c={},_0x3fe90e={};_0x3beb12<_0x219219['length'];_0x3beb12+=0x1){_0xb46d1c=_0x219219[_0x3beb12];if(_[_0x2312('0x43')](_0x2218f2[_0x2312('0x1e')][_0xb46d1c['id']])){_0x2218f2[_0x2312('0x1e')][_0xb46d1c['id']]=new SugarcrmAccount(_0xb46d1c);}else{_0x2218f2['mergeFromDatabase'](_0x2218f2[_0x2312('0x1e')][_0xb46d1c['id']],_0xb46d1c);}}}return _0x2218f2[_0x2312('0x1e')];};};Realtime[_0x2312('0x41')][_0x2312('0x4f')]=function(){var _0x17a8a3=this;return function(_0x1f7f89){if(_0x1f7f89){freeIsNotKey(_0x1f7f89,_0x17a8a3[_0x2312('0x22')],'id');for(var _0x266d9e=0x0,_0x3b89b0={},_0x5a51c8={};_0x266d9e<_0x1f7f89[_0x2312('0x42')];_0x266d9e+=0x1){_0x3b89b0=_0x1f7f89[_0x266d9e];if(_[_0x2312('0x43')](_0x17a8a3[_0x2312('0x22')][_0x3b89b0['id']])){_0x17a8a3[_0x2312('0x22')][_0x3b89b0['id']]=new VtigerAccount(_0x3b89b0);}else{_0x17a8a3[_0x2312('0x40')](_0x17a8a3['vtigerAccounts'][_0x3b89b0['id']],_0x3b89b0);}}}return _0x17a8a3[_0x2312('0x22')];};};Realtime[_0x2312('0x41')][_0x2312('0x50')]=function(){var _0x48a676=this;return function(_0x106898){if(_0x106898){freeIsNotKey(_0x106898,_0x48a676[_0x2312('0x23')],'id');for(var _0x205b9b=0x0,_0x31653a={},_0x4d1728={};_0x205b9b<_0x106898[_0x2312('0x42')];_0x205b9b+=0x1){_0x31653a=_0x106898[_0x205b9b];if(_[_0x2312('0x43')](_0x48a676[_0x2312('0x23')][_0x31653a['id']])){_0x48a676[_0x2312('0x23')][_0x31653a['id']]=new ServicenowAccount(_0x31653a);}else{_0x48a676[_0x2312('0x40')](_0x48a676[_0x2312('0x23')][_0x31653a['id']],_0x31653a);}}}return _0x48a676[_0x2312('0x23')];};};Realtime[_0x2312('0x41')][_0x2312('0x51')]=function(){var _0x23fa21=this;return function(_0x5db7d2){if(_0x5db7d2){freeIsNotKey(_0x5db7d2,_0x23fa21[_0x2312('0x24')],'id');for(var _0x4e3bb8=0x0,_0x31071d={},_0x6de263={};_0x4e3bb8<_0x5db7d2['length'];_0x4e3bb8+=0x1){_0x31071d=_0x5db7d2[_0x4e3bb8];if(_[_0x2312('0x43')](_0x23fa21[_0x2312('0x24')][_0x31071d['id']])){_0x23fa21[_0x2312('0x24')][_0x31071d['id']]=new Dynamics365Account(_0x31071d);}else{_0x23fa21[_0x2312('0x40')](_0x23fa21['dynamics365Accounts'][_0x31071d['id']],_0x31071d);}}}return _0x23fa21['dynamics365Accounts'];};};Realtime[_0x2312('0x41')][_0x2312('0x52')]=function(){var _0x14e09e=this;return function(_0x3c9721){if(_0x3c9721){freeIsNotKey(_0x3c9721,_0x14e09e[_0x2312('0x53')],'id');for(var _0x591346=0x0,_0x1f9626={},_0x3996aa={};_0x591346<_0x3c9721['length'];_0x591346+=0x1){_0x1f9626=_0x3c9721[_0x591346];if(_[_0x2312('0x43')](_0x14e09e[_0x2312('0x53')][_0x1f9626['id']])){_0x14e09e[_0x2312('0x53')][_0x1f9626['id']]=new FreshsalesAccount(_0x1f9626);}else{_0x14e09e[_0x2312('0x40')](_0x14e09e['freshsalesAccounts'][_0x1f9626['id']],_0x1f9626);}}}return _0x14e09e[_0x2312('0x53')];};};Realtime[_0x2312('0x41')][_0x2312('0x54')]=function(){var _0x4a4019=this;return function(_0x2eadea){for(var _0x46973e=0x0;_0x46973e<_0x2eadea['length'];_0x46973e+=0x1){_[_0x2312('0x55')](_0x4a4019[_0x2312('0x47')][_0x2eadea[_0x46973e][_0x2312('0x28')]],_0x2eadea[_0x46973e]);}return _0x4a4019[_0x2312('0x47')];};};Realtime[_0x2312('0x41')][_0x2312('0x56')]=function(){var _0x20e342=this;return function(_0x37936e){clearVoiceQueues(_0x20e342[_0x2312('0x47')]);if(_0x37936e){_0x37936e=_[_0x2312('0x57')](_0x37936e,_0x2312('0x58'));for(var _0x57231d in _0x37936e){if(_0x37936e[_0x2312('0x26')](_0x57231d)){var _0x357679={};for(var _0x62bd90=0x0;_0x62bd90<_0x37936e[_0x57231d]['length'];_0x62bd90+=0x1){var _0x4b8279=_0x37936e[_0x57231d][_0x62bd90]['queue'];if(_0x20e342[_0x2312('0x47')][_0x4b8279]){if(_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x59')]){_0x20e342['voiceQueues'][_0x4b8279][_0x2312('0x5a')]+=0x1;}if(_0x37936e[_0x57231d][_0x62bd90]['queuecallerabandon']){_0x20e342[_0x2312('0x47')][_0x4b8279][_0x2312('0x34')]+=0x1;}_0x20e342['voiceQueues'][_0x4b8279]['sumHoldTime']+=moment(_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x5b')])[_0x2312('0x5c')](moment(_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x5d')]),_0x2312('0x5e'))||0x0;if(_0x62bd90===_0x37936e[_0x57231d][_0x2312('0x42')]-0x1){_0x20e342['voiceQueues'][_0x4b8279][_0x2312('0x2f')]+=moment(_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x5f')]||_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x60')]||_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x61')])[_0x2312('0x5c')](moment(_0x37936e[_0x57231d][_0x62bd90]['queuecallerjoinAt']),_0x2312('0x5e'))||0x0;_0x20e342[_0x2312('0x47')][_0x4b8279]['total']+=0x1;if(_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x62')]){_0x20e342[_0x2312('0x47')][_0x4b8279][_0x2312('0x2d')]+=0x1;_0x20e342[_0x2312('0x47')][_0x4b8279][_0x2312('0x30')]+=moment(_0x37936e[_0x57231d][_0x62bd90]['queuecallercompleteAt'])[_0x2312('0x5c')](moment(_0x37936e[_0x57231d][_0x62bd90][_0x2312('0x5b')]),_0x2312('0x5e'))||0x0;}}else{_0x20e342[_0x2312('0x47')][_0x4b8279][_0x2312('0x2f')]+=_0x20e342[_0x2312('0x47')][_0x4b8279][_0x2312('0x2e')]||0x0;}}}}}}return _0x20e342['voiceQueues'];};};Realtime[_0x2312('0x41')]['initVoiceCallReports']=function(){var _0x54225b=this;return function(_0x23f8fb){clearVoiceCallReports(_0x54225b[_0x2312('0x17')]);if(_0x23f8fb){for(var _0x18036f=0x0;_0x18036f<_0x23f8fb[_0x2312('0x42')];_0x18036f+=0x1){_0x54225b['outbound'][_0x2312('0x2c')]+=0x1;_0x54225b[_0x2312('0x17')][_0x2312('0x2f')]+=_0x23f8fb[_0x18036f][_0x2312('0x63')];if(_0x23f8fb[_0x18036f][_0x2312('0x64')]==='ANSWERED'){_0x54225b[_0x2312('0x17')]['answered']+=0x1;_0x54225b[_0x2312('0x17')][_0x2312('0x2e')]+=_0x23f8fb[_0x18036f][_0x2312('0x63')]-_0x23f8fb[_0x18036f][_0x2312('0x65')]||0x0;_0x54225b[_0x2312('0x17')]['sumBillable']+=_0x23f8fb[_0x18036f][_0x2312('0x65')];}}}return _0x54225b[_0x2312('0x17')];};};Realtime['prototype'][_0x2312('0x66')]=function(){var _0x225122=this;return function(_0x547d7b){if(_0x547d7b){freeIsNotKey(_0x547d7b,_0x225122[_0x2312('0x15')],_0x2312('0x28'));for(var _0x562c05=0x0,_0x2db5d8={};_0x562c05<_0x547d7b[_0x2312('0x42')];_0x562c05+=0x1){_0x2db5d8=_0x547d7b[_0x562c05];if(_[_0x2312('0x43')](_0x225122[_0x2312('0x15')][_0x2db5d8[_0x2312('0x28')]])){_0x225122[_0x2312('0x15')][_0x2db5d8[_0x2312('0x28')]]=new Campaign(_0x2db5d8);}else{_0x225122[_0x2312('0x40')](_0x225122[_0x2312('0x15')][_0x2db5d8[_0x2312('0x28')]],_0x2db5d8);_0x225122[_0x2312('0x15')][_0x2db5d8[_0x2312('0x28')]][_0x2312('0x67')]=_0x2db5d8[_0x2312('0x68')]?_0x2db5d8[_0x2312('0x68')][_0x2312('0x28')]:undefined;}}}return _0x225122[_0x2312('0x15')];};};Realtime['prototype'][_0x2312('0x69')]=function(){var _0x3f5922=this;return function(_0x53a97e){if(_0x53a97e){freeIsNotKey(_0x53a97e,_0x3f5922[_0x2312('0x18')],'id');for(var _0x40b9b7=0x0,_0x34ce01={};_0x40b9b7<_0x53a97e[_0x2312('0x42')];_0x40b9b7+=0x1){_0x34ce01=_0x53a97e[_0x40b9b7];if(_['isUndefined'](_0x3f5922[_0x2312('0x18')][_0x34ce01['id']])){_0x3f5922[_0x2312('0x18')][_0x34ce01['id']]=new VoiceExtension(_0x34ce01);}else{_0x3f5922['mergeFromDatabase'](_0x3f5922[_0x2312('0x18')][_0x34ce01['id']],_0x34ce01);}}}return _0x3f5922[_0x2312('0x18')];};};Realtime[_0x2312('0x41')][_0x2312('0x6a')]=function(){var _0x2f98d3=this;return function(_0x38dec7){clearCampaigns(_0x2f98d3[_0x2312('0x15')]);for(var _0x314186=0x0;_0x314186<_0x38dec7[_0x2312('0x42')];_0x314186+=0x1){_['merge'](_0x2f98d3[_0x2312('0x15')][_0x38dec7[_0x314186][_0x2312('0x28')]],_0x38dec7[_0x314186]);}return _0x2f98d3['campaigns'];};};Realtime['prototype'][_0x2312('0x6b')]=function(){var _0x583825=this;return function(_0xd2f9a7){if(_0xd2f9a7){freeIsNotKey(_0xd2f9a7,_0x583825[_0x2312('0x6c')],'id');for(var _0x466b1f=0x0,_0x20115d={},_0x237538={};_0x466b1f<_0xd2f9a7[_0x2312('0x42')];_0x466b1f+=0x1){_0x20115d=_0xd2f9a7[_0x466b1f];if(_['isUndefined'](_0x583825[_0x2312('0x6c')][_0x20115d['id']])){_0x583825[_0x2312('0x6c')][_0x20115d['id']]=new FaxAccount(_0x20115d);}else{_0x583825[_0x2312('0x40')](_0x583825['faxAccounts'][_0x20115d['id']],_0x20115d);}}}return _0x583825[_0x2312('0x6c')];};};module[_0x2312('0x6d')]=Realtime;
\ No newline at end of file
index 5497a30..48bfd2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe919=['custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','find','accountcode','interface','SIP/%s','name','length','findAgent','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','format','create','match','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','blindTransfer','attendedTransfer','exports','moment','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind'];(function(_0x10ed38,_0x434529){var _0x20d8c1=function(_0x40511d){while(--_0x40511d){_0x10ed38['push'](_0x10ed38['shift']());}};_0x20d8c1(++_0x434529);}(_0xe919,0x153));var _0x9e91=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0xe919[_0x1b76e6];return _0x333b53;};'use strict';var _=require('lodash');var moment=require(_0x9e91('0x0'));var util=require('util');var config=require(_0x9e91('0x1'));var ami=require(_0x9e91('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9e91('0x3'));var RpcVoiceDialReport=require(_0x9e91('0x4'));var RpcMemberReport=require(_0x9e91('0x5'));var RpcVoiceQueueReport=require(_0x9e91('0x6'));var RpcVoiceRecording=require(_0x9e91('0x7'));var RpcVoiceTransferReport=require(_0x9e91('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x9e91('0x9'));var VoiceDialReport=require(_0x9e91('0xa'));var UserReport=require(_0x9e91('0xb'));function Report(_0x7b107d){this[_0x9e91('0xc')]=_0x7b107d;this[_0x9e91('0xd')]=_0x7b107d[_0x9e91('0xd')];this[_0x9e91('0xe')]=_0x7b107d[_0x9e91('0xe')];}Report[_0x9e91('0xf')][_0x9e91('0x10')]=function(_0x55c785){var _0x3cb32d=new VoiceQueueReport(this[_0x9e91('0xc')]);var _0x3e256a=new VoiceAgentReport(this[_0x9e91('0xc')]);var _0x2af598=new VoiceDialReport(this[_0x9e91('0xc')]);var _0x3e4127=new VoiceCallReport(this[_0x9e91('0xc')]);var _0x33a3eb=new UserReport(this[_0x9e91('0xc')]);if(config['xdr']&&config[_0x9e91('0x11')][_0x9e91('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x9e91('0x13')][_0x9e91('0x14')](this));ami['on'](_0x9e91('0x15'),this[_0x9e91('0x16')][_0x9e91('0x14')](this));ami['on'](_0x9e91('0x17'),this[_0x9e91('0x18')][_0x9e91('0x14')](this));ami['on'](_0x9e91('0x19'),this[_0x9e91('0x1a')][_0x9e91('0x14')](this));ami['on'](_0x9e91('0x1b'),this['blindTransfer'][_0x9e91('0x14')](this));ami['on'](_0x9e91('0x1c'),this['attendedTransfer'][_0x9e91('0x14')](this));}};Report[_0x9e91('0xf')]['findAgent']=function(_0x4072aa){var _0x48d752;_0x48d752=_[_0x9e91('0x1d')](this['agents'],function(_0x3e3faf){return _0x3e3faf[_0x9e91('0x1e')]==_0x4072aa||_0x3e3faf['name']==_0x4072aa;});if(_['isNil'](_0x48d752)){var _0x3ab5b1=_[_0x9e91('0x1d')](this[_0x9e91('0xe')],function(_0xd17e1){return _0xd17e1[_0x9e91('0x1e')]==_0x4072aa||_0xd17e1['name']==_0x4072aa;});if(_0x3ab5b1){_0x48d752=_[_0x9e91('0x1d')](this[_0x9e91('0xd')],function(_0xf3e974){return _0xf3e974[_0x9e91('0x1f')]==util['format'](_0x9e91('0x20'),_0x3ab5b1[_0x9e91('0x21')]);});}}return _0x48d752;};Report[_0x9e91('0xf')][_0x9e91('0x13')]=function(_0x53e6e1){for(var _0x364aa1=0x0;_0x364aa1<_0x53e6e1[_0x9e91('0x22')];_0x364aa1+=0x1){var _0x5e9038=this[_0x9e91('0x23')](_0x53e6e1[_0x364aa1][_0x9e91('0x24')]);if(_0x5e9038){_0x53e6e1[_0x364aa1][_0x9e91('0x1e')]=_0x5e9038[_0x9e91('0x1e')];_0x53e6e1[_0x364aa1][_0x9e91('0x25')]=!![];_0x53e6e1[_0x364aa1][_0x9e91('0x26')]=_0x5e9038[_0x9e91('0x21')];_0x53e6e1[_0x364aa1]['interface']=_[_0x9e91('0x27')](_0x5e9038[_0x9e91('0x1f')])?util['format'](_0x9e91('0x20'),_0x5e9038[_0x9e91('0x21')]):_0x5e9038[_0x9e91('0x1f')];if(_0x53e6e1[_0x364aa1][_0x9e91('0x28')]){_0x53e6e1[_0x364aa1][_0x9e91('0x29')]=moment()['format'](_0x9e91('0x2a'));}if(_0x53e6e1[_0x364aa1][_0x9e91('0x2b')]){_0x53e6e1[_0x364aa1][_0x9e91('0x2c')]=moment()[_0x9e91('0x2d')](_0x9e91('0x2a'));}RpcMemberReport[_0x9e91('0x13')](_0x53e6e1[_0x364aa1]);}RpcVoiceQueueReport[_0x9e91('0x2e')](_0x53e6e1[_0x364aa1]);}};function extractCalleridNumber(_0x3647c1){var _0x1c45e0=_0x3647c1[_0x9e91('0x2f')](/<(.*?)>/);return _0x1c45e0?_0x1c45e0[0x1]:_0x3647c1;}Report[_0x9e91('0xf')][_0x9e91('0x16')]=function(_0x4e10b3){_0x4e10b3['destination']=_0x4e10b3[_0x9e91('0x30')]||_0x4e10b3['exten'];if(_0x4e10b3[_0x9e91('0x31')]==_0x9e91('0x32')){_0x4e10b3[_0x9e91('0x33')]=_0x9e91('0x34');_0x4e10b3[_0x9e91('0x35')]=_0x4e10b3['queue'];if(_0x4e10b3[_0x9e91('0x36')]==_0x9e91('0x37')){_0x4e10b3['accountcode']='';_0x4e10b3[_0x9e91('0x30')]=extractCalleridNumber(_0x4e10b3[_0x9e91('0x38')]);}else if(_0x4e10b3['context']==_0x9e91('0x39')){if(_0x4e10b3[_0x9e91('0x30')]==_0x9e91('0x3a')){_0x4e10b3[_0x9e91('0x30')]=extractCalleridNumber(_0x4e10b3[_0x9e91('0x3b')]);_0x4e10b3[_0x9e91('0x3c')]=_0x4e10b3[_0x9e91('0x3d')];_0x4e10b3[_0x9e91('0x3e')]=[_0x4e10b3['channel'],_0x4e10b3[_0x9e91('0x3f')]=_0x4e10b3[_0x9e91('0x3e')]][0x0];_0x4e10b3[_0x9e91('0x38')]=_0x4e10b3[_0x9e91('0x3b')];}else{_0x4e10b3[_0x9e91('0x30')]=_0x4e10b3[_0x9e91('0x3c')];_0x4e10b3[_0x9e91('0x3c')]=_0x4e10b3[_0x9e91('0x3d')];if(_0x4e10b3[_0x9e91('0x40')]==_0x9e91('0x41')){_0x4e10b3[_0x9e91('0x1e')]=_0x4e10b3[_0x9e91('0x24')];}else{_0x4e10b3['accountcode']='';}}}}else{_0x4e10b3[_0x9e91('0x38')]=util[_0x9e91('0x2d')]('\x22%s\x22\x20<%s>',_0x4e10b3[_0x9e91('0x42')],_0x4e10b3[_0x9e91('0x3c')]);}if(RpcVoiceTransferReport[_0x9e91('0x43')][_0x4e10b3[_0x9e91('0x44')]]){var _0x7c976f=RpcVoiceTransferReport['transfers'][_0x4e10b3[_0x9e91('0x44')]];_0x7c976f[_0x9e91('0x45')]=_0x4e10b3[_0x9e91('0x46')];RpcVoiceTransferReport['blindTransfer'](_0x7c976f);delete RpcVoiceTransferReport[_0x9e91('0x43')][_0x4e10b3['linkedid']];}RpcVoiceCallReport[_0x9e91('0x2e')](_0x4e10b3);if(_0x4e10b3[_0x9e91('0x47')]){for(var _0x56b112=0x0;_0x56b112<_0x4e10b3[_0x9e91('0x48')][_0x9e91('0x22')];_0x56b112+=0x1){_0x4e10b3[_0x9e91('0x49')]=_0x4e10b3[_0x9e91('0x48')][_0x56b112]['filename'];_0x4e10b3[_0x9e91('0x4a')]=_0x4e10b3['monitors'][_0x56b112][_0x9e91('0x4a')];if(_0x4e10b3[_0x9e91('0x4b')]==_0x9e91('0x3a')){_0x4e10b3[_0x9e91('0x3c')]=_0x4e10b3[_0x9e91('0x24')];_0x4e10b3[_0x9e91('0x42')]=_0x4e10b3[_0x9e91('0x4c')];_0x4e10b3[_0x9e91('0x24')]=_0x4e10b3[_0x9e91('0x1e')];_0x4e10b3[_0x9e91('0x4c')]=_0x4e10b3['membername'];_0x4e10b3['exten']=_0x4e10b3[_0x9e91('0x3d')];}else if(_0x4e10b3[_0x9e91('0x4b')]==_0x9e91('0x4d')){_0x4e10b3['calleridnum']=_0x4e10b3[_0x9e91('0x30')];_0x4e10b3[_0x9e91('0x4b')]=_0x4e10b3[_0x9e91('0x3d')];}RpcVoiceRecording[_0x9e91('0x2e')](_0x4e10b3);}}};Report['prototype'][_0x9e91('0x18')]=function(_0x57f5d5){if(_[_0x9e91('0x4e')](_0x57f5d5)){_0x57f5d5[_0x9e91('0x4f')](function(_0x54a4e7){RpcVoiceAgentReport[_0x9e91('0x2e')](_0x54a4e7);});}else{RpcVoiceAgentReport[_0x9e91('0x2e')](_0x57f5d5);}};Report[_0x9e91('0xf')]['voiceDialReport']=function(_0x22a0a9){RpcVoiceDialReport[_0x9e91('0x2e')](_0x22a0a9);var _0x296214;var _0x14d2d8;var _0x4d5bb8=_0x22a0a9[_0x9e91('0x3f')];if(_['startsWith'](_0x4d5bb8,_0x9e91('0x50'))){_0x14d2d8=_0x4d5bb8[_0x9e91('0x51')](_0x4d5bb8[_0x9e91('0x52')]('/')+0x1,_0x4d5bb8[_0x9e91('0x52')]('@'));_0x296214=_['find'](this['agents'],function(_0x211113){return _0x211113[_0x9e91('0x53')]==_0x14d2d8||_0x211113[_0x9e91('0x54')]==_0x14d2d8||_0x211113['accountcode']==_0x14d2d8;});}else{_0x14d2d8=_0x4d5bb8[_0x9e91('0x51')](_0x4d5bb8[_0x9e91('0x52')]('/')+0x1,_0x4d5bb8[_0x9e91('0x55')]('-'));_0x296214=this[_0x9e91('0x23')](_0x14d2d8);}if(_0x296214){_0x22a0a9[_0x9e91('0x1f')]=_['isNil'](_0x296214[_0x9e91('0x1f')])?util[_0x9e91('0x2d')](_0x9e91('0x20'),_0x296214[_0x9e91('0x21')]):_0x296214['interface'];_0x22a0a9[_0x9e91('0x56')]=_0x296214[_0x9e91('0x21')];_0x22a0a9[_0x9e91('0x1e')]=_0x296214[_0x9e91('0x1e')];RpcMemberReport[_0x9e91('0x1a')](_0x22a0a9);}};Report[_0x9e91('0xf')][_0x9e91('0x57')]=function(_0x40f5b5){RpcVoiceTransferReport[_0x9e91('0x43')][_0x40f5b5['transfererlinkedid']]=_0x40f5b5;};Report['prototype'][_0x9e91('0x58')]=function(_0x49cb0a){RpcVoiceTransferReport[_0x9e91('0x58')](_0x49cb0a);};module[_0x9e91('0x59')]=Report;
\ No newline at end of file
+var _0x5f63=['lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','calleridnum','originatecalleridnum','channel','destinationchannel','calleridpreview','ANSWERED','transfers','linkedid','transfereelinkedid','monitors','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','sync','xdr','disabled','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','find','accountcode','name','isNil','telephones','interface','format','SIP/%s','length','findAgent','connectedlinenum','assigned'];(function(_0x5d7398,_0x2c3d43){var _0x56f109=function(_0x321467){while(--_0x321467){_0x5d7398['push'](_0x5d7398['shift']());}};_0x56f109(++_0x2c3d43);}(_0x5f63,0x185));var _0x35f6=function(_0x2e6da7,_0x204421){_0x2e6da7=_0x2e6da7-0x0;var _0x2539c0=_0x5f63[_0x2e6da7];return _0x2539c0;};'use strict';var _=require(_0x35f6('0x0'));var moment=require(_0x35f6('0x1'));var util=require(_0x35f6('0x2'));var config=require(_0x35f6('0x3'));var ami=require(_0x35f6('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x35f6('0x5'));var RpcVoiceDialReport=require(_0x35f6('0x6'));var RpcMemberReport=require(_0x35f6('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x35f6('0x8'));var RpcVoiceTransferReport=require(_0x35f6('0x9'));var VoiceQueueReport=require(_0x35f6('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x35f6('0xb'));var VoiceDialReport=require(_0x35f6('0xc'));var UserReport=require(_0x35f6('0xd'));function Report(_0x4a7e0d){this[_0x35f6('0xe')]=_0x4a7e0d;this[_0x35f6('0xf')]=_0x4a7e0d[_0x35f6('0xf')];this['telephones']=_0x4a7e0d['telephones'];}Report['prototype'][_0x35f6('0x10')]=function(_0x4185fc){var _0x2b99de=new VoiceQueueReport(this[_0x35f6('0xe')]);var _0x528835=new VoiceAgentReport(this[_0x35f6('0xe')]);var _0x36f987=new VoiceDialReport(this[_0x35f6('0xe')]);var _0x24abcc=new VoiceCallReport(this['realtime']);var _0x1922d3=new UserReport(this[_0x35f6('0xe')]);if(config[_0x35f6('0x11')]&&config['xdr'][_0x35f6('0x12')]){ami['on']('custom:voiceQueueReport',this[_0x35f6('0x13')][_0x35f6('0x14')](this));ami['on']('custom:voiceCallReport',this[_0x35f6('0x15')][_0x35f6('0x14')](this));ami['on'](_0x35f6('0x16'),this['voiceAgentReport'][_0x35f6('0x14')](this));ami['on']('custom:voiceDialReport',this[_0x35f6('0x17')][_0x35f6('0x14')](this));ami['on'](_0x35f6('0x18'),this[_0x35f6('0x19')][_0x35f6('0x14')](this));ami['on'](_0x35f6('0x1a'),this[_0x35f6('0x1b')][_0x35f6('0x14')](this));}};Report[_0x35f6('0x1c')]['findAgent']=function(_0xb69f39){var _0x26e473;_0x26e473=_[_0x35f6('0x1d')](this[_0x35f6('0xf')],function(_0x2012d5){return _0x2012d5[_0x35f6('0x1e')]==_0xb69f39||_0x2012d5[_0x35f6('0x1f')]==_0xb69f39;});if(_[_0x35f6('0x20')](_0x26e473)){var _0x36822e=_['find'](this[_0x35f6('0x21')],function(_0x33aeb7){return _0x33aeb7[_0x35f6('0x1e')]==_0xb69f39||_0x33aeb7['name']==_0xb69f39;});if(_0x36822e){_0x26e473=_[_0x35f6('0x1d')](this[_0x35f6('0xf')],function(_0x578f18){return _0x578f18[_0x35f6('0x22')]==util[_0x35f6('0x23')](_0x35f6('0x24'),_0x36822e[_0x35f6('0x1f')]);});}}return _0x26e473;};Report[_0x35f6('0x1c')][_0x35f6('0x13')]=function(_0x4692b0){for(var _0x407ef9=0x0;_0x407ef9<_0x4692b0[_0x35f6('0x25')];_0x407ef9+=0x1){var _0x3baa45=this[_0x35f6('0x26')](_0x4692b0[_0x407ef9][_0x35f6('0x27')]);if(_0x3baa45){_0x4692b0[_0x407ef9][_0x35f6('0x1e')]=_0x3baa45[_0x35f6('0x1e')];_0x4692b0[_0x407ef9][_0x35f6('0x28')]=!![];_0x4692b0[_0x407ef9][_0x35f6('0x29')]=_0x3baa45[_0x35f6('0x1f')];_0x4692b0[_0x407ef9][_0x35f6('0x22')]=_['isNil'](_0x3baa45['interface'])?util['format'](_0x35f6('0x24'),_0x3baa45[_0x35f6('0x1f')]):_0x3baa45[_0x35f6('0x22')];if(_0x4692b0[_0x407ef9][_0x35f6('0x2a')]){_0x4692b0[_0x407ef9]['queuecallercompleteAt']=moment()[_0x35f6('0x23')](_0x35f6('0x2b'));}if(_0x4692b0[_0x407ef9]['queuecallerexit']){_0x4692b0[_0x407ef9][_0x35f6('0x2c')]=moment()[_0x35f6('0x23')](_0x35f6('0x2b'));}RpcMemberReport[_0x35f6('0x13')](_0x4692b0[_0x407ef9]);}RpcVoiceQueueReport[_0x35f6('0x2d')](_0x4692b0[_0x407ef9]);}};function extractCalleridNumber(_0x2dfa9e){var _0x7c3e01=_0x2dfa9e[_0x35f6('0x2e')](/<(.*?)>/);return _0x7c3e01?_0x7c3e01[0x1]:_0x2dfa9e;}Report[_0x35f6('0x1c')][_0x35f6('0x15')]=function(_0x4f1487){_0x4f1487['destination']=_0x4f1487[_0x35f6('0x2f')]||_0x4f1487[_0x35f6('0x30')];if(_0x4f1487[_0x35f6('0x31')]==_0x35f6('0x32')){_0x4f1487[_0x35f6('0x33')]=_0x35f6('0x34');_0x4f1487[_0x35f6('0x35')]=_0x4f1487[_0x35f6('0x34')];if(_0x4f1487['context']==_0x35f6('0x36')){_0x4f1487[_0x35f6('0x1e')]='';_0x4f1487[_0x35f6('0x2f')]=extractCalleridNumber(_0x4f1487[_0x35f6('0x37')]);}else if(_0x4f1487[_0x35f6('0x38')]==_0x35f6('0x39')){if(_0x4f1487[_0x35f6('0x2f')]==_0x35f6('0x3a')){_0x4f1487['destination']=extractCalleridNumber(_0x4f1487['calleridpreview']);_0x4f1487[_0x35f6('0x3b')]=_0x4f1487[_0x35f6('0x3c')];_0x4f1487['destinationchannel']=[_0x4f1487[_0x35f6('0x3d')],_0x4f1487[_0x35f6('0x3d')]=_0x4f1487[_0x35f6('0x3e')]][0x0];_0x4f1487[_0x35f6('0x37')]=_0x4f1487[_0x35f6('0x3f')];}else{_0x4f1487['destination']=_0x4f1487[_0x35f6('0x3b')];_0x4f1487['calleridnum']=_0x4f1487['originatecalleridnum'];if(_0x4f1487['disposition']==_0x35f6('0x40')){_0x4f1487['accountcode']=_0x4f1487[_0x35f6('0x27')];}else{_0x4f1487[_0x35f6('0x1e')]='';}}}}else{_0x4f1487[_0x35f6('0x37')]=util[_0x35f6('0x23')]('\x22%s\x22\x20<%s>',_0x4f1487['calleridname'],_0x4f1487[_0x35f6('0x3b')]);}if(RpcVoiceTransferReport[_0x35f6('0x41')][_0x4f1487[_0x35f6('0x42')]]){var _0x84c511=RpcVoiceTransferReport['transfers'][_0x4f1487['linkedid']];_0x84c511[_0x35f6('0x43')]=_0x4f1487['uniqueid'];RpcVoiceTransferReport[_0x35f6('0x19')](_0x84c511);delete RpcVoiceTransferReport[_0x35f6('0x41')][_0x4f1487[_0x35f6('0x42')]];}RpcVoiceCallReport[_0x35f6('0x2d')](_0x4f1487);if(_0x4f1487['monitor']){for(var _0x4068c2=0x0;_0x4068c2<_0x4f1487[_0x35f6('0x44')][_0x35f6('0x25')];_0x4068c2+=0x1){_0x4f1487['monitorFilename']=_0x4f1487[_0x35f6('0x44')][_0x4068c2][_0x35f6('0x45')];_0x4f1487[_0x35f6('0x46')]=_0x4f1487[_0x35f6('0x44')][_0x4068c2]['createdAt'];if(_0x4f1487['exten']=='xcally-motion-preview'){_0x4f1487[_0x35f6('0x3b')]=_0x4f1487['connectedlinenum'];_0x4f1487[_0x35f6('0x47')]=_0x4f1487['connectedlinename'];_0x4f1487[_0x35f6('0x27')]=_0x4f1487['accountcode'];_0x4f1487[_0x35f6('0x48')]=_0x4f1487[_0x35f6('0x49')];_0x4f1487[_0x35f6('0x30')]=_0x4f1487['originatecalleridnum'];}else if(_0x4f1487[_0x35f6('0x30')]==_0x35f6('0x4a')){_0x4f1487[_0x35f6('0x3b')]=_0x4f1487[_0x35f6('0x2f')];_0x4f1487[_0x35f6('0x30')]=_0x4f1487[_0x35f6('0x3c')];}RpcVoiceRecording['create'](_0x4f1487);}}};Report[_0x35f6('0x1c')][_0x35f6('0x4b')]=function(_0x5f48d8){if(_[_0x35f6('0x4c')](_0x5f48d8)){_0x5f48d8[_0x35f6('0x4d')](function(_0x5a66c2){RpcVoiceAgentReport[_0x35f6('0x2d')](_0x5a66c2);});}else{RpcVoiceAgentReport['create'](_0x5f48d8);}};Report[_0x35f6('0x1c')][_0x35f6('0x17')]=function(_0x481f69){RpcVoiceDialReport[_0x35f6('0x2d')](_0x481f69);var _0x5198d1;var _0x5c2666;var _0x1e933c=_0x481f69[_0x35f6('0x3d')];if(_[_0x35f6('0x4e')](_0x1e933c,_0x35f6('0x4f'))){_0x5c2666=_0x1e933c[_0x35f6('0x50')](_0x1e933c[_0x35f6('0x51')]('/')+0x1,_0x1e933c[_0x35f6('0x51')]('@'));_0x5198d1=_[_0x35f6('0x1d')](this['agents'],function(_0x480101){return _0x480101['mobile']==_0x5c2666||_0x480101[_0x35f6('0x52')]==_0x5c2666||_0x480101[_0x35f6('0x1e')]==_0x5c2666;});}else{_0x5c2666=_0x1e933c[_0x35f6('0x50')](_0x1e933c[_0x35f6('0x51')]('/')+0x1,_0x1e933c[_0x35f6('0x53')]('-'));_0x5198d1=this[_0x35f6('0x26')](_0x5c2666);}if(_0x5198d1){_0x481f69['interface']=_[_0x35f6('0x20')](_0x5198d1[_0x35f6('0x22')])?util[_0x35f6('0x23')](_0x35f6('0x24'),_0x5198d1[_0x35f6('0x1f')]):_0x5198d1[_0x35f6('0x22')];_0x481f69[_0x35f6('0x49')]=_0x5198d1[_0x35f6('0x1f')];_0x481f69['accountcode']=_0x5198d1[_0x35f6('0x1e')];RpcMemberReport['voiceDialReport'](_0x481f69);}};Report[_0x35f6('0x1c')][_0x35f6('0x19')]=function(_0x1df4c5){RpcVoiceTransferReport[_0x35f6('0x41')][_0x1df4c5[_0x35f6('0x54')]]=_0x1df4c5;};Report['prototype'][_0x35f6('0x1b')]=function(_0x3c74a0){RpcVoiceTransferReport[_0x35f6('0x1b')](_0x3c74a0);};module[_0x35f6('0x55')]=Report;
\ No newline at end of file
index f9ae6c4..8c89c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x226f=['actionSipPeerStatus','prototype','syncRealtimeShow','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','inuse','local','toLowerCase','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','toNumber','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][devicestatechange]','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry','bind','syncDeviceState','syncPeerStatus','resolve','actionSipShowRegistry','catch','[userReport][sipshowregistry]','error','[userReport][devicestatelist]','inspect','then'];(function(_0xaefc69,_0xc58096){var _0x198b99=function(_0x5269fa){while(--_0x5269fa){_0xaefc69['push'](_0xaefc69['shift']());}};_0x198b99(++_0xc58096);}(_0x226f,0x161));var _0xf226=function(_0x506a07,_0x29a85c){_0x506a07=_0x506a07-0x0;var _0x494c65=_0x226f[_0x506a07];return _0x494c65;};'use strict';var _=require(_0xf226('0x0'));var moment=require(_0xf226('0x1'));var util=require(_0xf226('0x2'));var Redis=require(_0xf226('0x3'));var BPromise=require(_0xf226('0x4'));var config=require(_0xf226('0x5'));var logger=require(_0xf226('0x6'))(_0xf226('0x7'));var ami=require('../ami');config[_0xf226('0x8')]=_['defaults'](config[_0xf226('0x8')],{'host':_0xf226('0x9'),'port':0x18eb});var io=require(_0xf226('0xa'))(new Redis(config[_0xf226('0x8')]));function UserReport(_0x47e08a){this[_0xf226('0xb')]=_0x47e08a[_0xf226('0xb')];this[_0xf226('0xc')]=_0x47e08a[_0xf226('0xc')];this[_0xf226('0xd')]=_0x47e08a[_0xf226('0xd')];ami['on']('registryentry',this[_0xf226('0xe')]['bind'](this));ami['on'](_0xf226('0xf'),this[_0xf226('0xe')][_0xf226('0x10')](this));ami['on']('devicestatechange',this[_0xf226('0x11')][_0xf226('0x10')](this));ami['on']('peerstatus',this[_0xf226('0x12')][_0xf226('0x10')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0xf226('0x13')]()['then'](ami[_0xf226('0x14')]())[_0xf226('0x15')](function(_0x8c7353){logger['error'](_0xf226('0x16'),util['inspect'](_0x8c7353,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xf226('0x13')]()['then'](ami['actionDeviceStateList']())['catch'](function(_0x2a9415){logger[_0xf226('0x17')](_0xf226('0x18'),util[_0xf226('0x19')](_0x2a9415,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xf226('0x13')]()[_0xf226('0x1a')](ami[_0xf226('0x1b')]())[_0xf226('0x15')](function(_0x996976){logger['error']('[userReport][sippeerstatus]',util[_0xf226('0x19')](_0x996976,{'showHidden':![],'depth':null}));});}UserReport[_0xf226('0x1c')][_0xf226('0x1d')]=function(){setInterval(function(){BPromise['resolve']()[_0xf226('0x1a')](showSipRegistrations())[_0xf226('0x1a')](listDeviceStates())[_0xf226('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0xf226('0x1c')]['isNotNull']=function(_0x412dfe){return _0x412dfe!==null&&!_['isUndefined'](_0x412dfe);};UserReport[_0xf226('0x1c')][_0xf226('0x1e')]=function(_0x181b14,_0x32657b,_0x4685b6){io['to'](_0x181b14)[_0xf226('0x1e')](_0x32657b,_0x4685b6);};UserReport['prototype'][_0xf226('0xe')]=function(_0x119c61){try{if(this[_0xf226('0x1f')](_0x119c61)){logger[_0xf226('0x20')](_0xf226('0x21'),_0x119c61[_0xf226('0x22')],_0x119c61[_0xf226('0x23')]);logger[_0xf226('0x24')](_0xf226('0x25'),util[_0xf226('0x19')](_0x119c61,{'showHidden':![],'depth':null}));var _0x3d7a01=_[_0xf226('0x26')](this[_0xf226('0xb')],{'defaultuser':_0x119c61[_0xf226('0x22')]});if(_0x3d7a01){_0x119c61['stateRegistry']=_0x119c61[_0xf226('0x23')];_[_0xf226('0x27')](_0x3d7a01,_[_0xf226('0x28')](_0x119c61,[_0xf226('0x29'),_0xf226('0x2a'),'username','state']));logger[_0xf226('0x24')](_0xf226('0x2b'),util[_0xf226('0x19')](_0x3d7a01,{'showHidden':![],'depth':null}));this[_0xf226('0x1e')](util[_0xf226('0x2c')](_0xf226('0x2d'),_0x3d7a01[_0xf226('0x2e')]),_0xf226('0x2f'),_0x3d7a01);}}}catch(_0x4c47b7){logger[_0xf226('0x17')](_0xf226('0x25'),util[_0xf226('0x19')](_0x4c47b7,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x4387de){try{if(this[_0xf226('0x1f')](_0x4387de)){logger[_0xf226('0x20')](_0xf226('0x30'),_0x4387de[_0xf226('0x31')],_0x4387de[_0xf226('0x23')]);logger[_0xf226('0x24')]('[userReport][devicestatechange]',util[_0xf226('0x19')](_0x4387de,{'showHidden':![],'depth':null}));if(this[_0xf226('0xc')][_0x4387de[_0xf226('0x31')]]){if(!this['agents'][_0x4387de['device']]['local']||_0x4387de[_0xf226('0x23')]['toLowerCase']()==_0xf226('0x32')){this[_0xf226('0xc')][_0x4387de[_0xf226('0x31')]][_0xf226('0x33')]=![];if(this[_0xf226('0xc')][_0x4387de['device']][_0xf226('0x23')]!==_0x4387de[_0xf226('0x23')][_0xf226('0x34')]()){this['agents'][_0x4387de[_0xf226('0x31')]][_0xf226('0x35')]=_['toNumber'](moment()[_0xf226('0x2c')]('x'));}this[_0xf226('0xc')][_0x4387de[_0xf226('0x31')]][_0xf226('0x23')]=_0x4387de[_0xf226('0x23')]['toLowerCase']();this[_0xf226('0xc')][_0x4387de[_0xf226('0x31')]]['updateStatusRealtime'](_0x4387de);}}else if(this['telephones'][_0x4387de[_0xf226('0x31')]]){if(this[_0xf226('0xd')][_0x4387de[_0xf226('0x31')]]['state']!==_0x4387de[_0xf226('0x23')][_0xf226('0x34')]()){this[_0xf226('0xd')][_0x4387de[_0xf226('0x31')]]['stateTime']=_['toNumber'](moment()['format']('x'));}this['telephones'][_0x4387de['device']]['state']=_0x4387de[_0xf226('0x23')][_0xf226('0x34')]();logger[_0xf226('0x24')](_0xf226('0x36'),util[_0xf226('0x19')](this[_0xf226('0xd')][_0x4387de[_0xf226('0x31')]],{'showHidden':![],'depth':null}));this[_0xf226('0x1e')](util[_0xf226('0x2c')](_0xf226('0x37'),this[_0xf226('0xd')][_0x4387de['device']][_0xf226('0x2e')]),_0xf226('0x38'),this['telephones'][_0x4387de[_0xf226('0x31')]]);}else if(this[_0xf226('0xb')][_0x4387de[_0xf226('0x31')]]){if(this[_0xf226('0xb')][_0x4387de[_0xf226('0x31')]][_0xf226('0x23')]!==_0x4387de['state'][_0xf226('0x34')]()){this[_0xf226('0xb')][_0x4387de[_0xf226('0x31')]]['stateTime']=_[_0xf226('0x39')](moment()[_0xf226('0x2c')]('x'));}this[_0xf226('0xb')][_0x4387de['device']]['state']=_0x4387de['state'][_0xf226('0x34')]();logger['debug'](_0xf226('0x3a'),util[_0xf226('0x19')](this['trunks'][_0x4387de[_0xf226('0x31')]],{'showHidden':![],'depth':null}));this[_0xf226('0x1e')](util['format'](_0xf226('0x2d'),this['trunks'][_0x4387de[_0xf226('0x31')]][_0xf226('0x2e')]),'trunk:save',this[_0xf226('0xb')][_0x4387de[_0xf226('0x31')]]);}else if(_[_0xf226('0x3b')](_0x4387de[_0xf226('0x31')],_0xf226('0x3c'))){var _0x4c88d4=_0x4387de['device'];var _0xcfef4c=_0x4c88d4[_0xf226('0x3d')](_0x4c88d4[_0xf226('0x3e')]('/')+0x1,_0x4c88d4[_0xf226('0x3e')]('@'));var _0x49edd5=_['find'](this[_0xf226('0xc')],function(_0x5021ba){return _0x5021ba[_0xf226('0x3f')]==_0xcfef4c||_0x5021ba[_0xf226('0x40')]==_0xcfef4c||_0x5021ba[_0xf226('0x41')]==_0xcfef4c;});if(_0x49edd5){if(_0x49edd5[_0xf226('0x23')]!==_0x4387de['state']['toLowerCase']()){_0x49edd5[_0xf226('0x35')]=_[_0xf226('0x39')](moment()[_0xf226('0x2c')]('x'));}_0x49edd5['state']=_0x4387de[_0xf226('0x23')][_0xf226('0x34')]();_0x49edd5[_0xf226('0x33')]=!![];_0x49edd5[_0xf226('0x42')](_0x4387de);}}}}catch(_0x497dfd){logger[_0xf226('0x17')](_0xf226('0x43'),util[_0xf226('0x19')](_0x497dfd,{'showHidden':![],'depth':null}));}};UserReport[_0xf226('0x1c')]['syncPeerStatus']=function(_0x1b7983){try{if(this[_0xf226('0x1f')](_0x1b7983)&&this[_0xf226('0x1f')](_0x1b7983[_0xf226('0x44')])){logger[_0xf226('0x20')](_0xf226('0x45'),_0x1b7983[_0xf226('0x46')],_0x1b7983[_0xf226('0x47')],_0x1b7983[_0xf226('0x44')]);logger[_0xf226('0x24')](_0xf226('0x48'),util[_0xf226('0x19')](_0x1b7983,{'showHidden':![],'depth':null}));if(this[_0xf226('0xc')][_0x1b7983['peer']]){if(!this[_0xf226('0xc')][_0x1b7983[_0xf226('0x46')]][_0xf226('0x33')]||_0x1b7983[_0xf226('0x44')][_0xf226('0x34')]()=='registered'){this[_0xf226('0xc')][_0x1b7983[_0xf226('0x46')]][_0xf226('0x33')]=![];this[_0xf226('0xc')][_0x1b7983[_0xf226('0x46')]][_0xf226('0x49')]=_0x1b7983[_0xf226('0x44')][_0xf226('0x34')]();this['agents'][_0x1b7983[_0xf226('0x46')]][_0xf226('0x47')]=_0x1b7983[_0xf226('0x47')];this['agents'][_0x1b7983[_0xf226('0x46')]][_0xf226('0x42')](_0x1b7983);}}else if(this[_0xf226('0xd')][_0x1b7983[_0xf226('0x46')]]){this[_0xf226('0xd')][_0x1b7983[_0xf226('0x46')]][_0xf226('0x49')]=_0x1b7983[_0xf226('0x44')][_0xf226('0x34')]();this[_0xf226('0xd')][_0x1b7983[_0xf226('0x46')]][_0xf226('0x47')]=_0x1b7983['address'];logger[_0xf226('0x24')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xf226('0x19')](this[_0xf226('0xd')][_0x1b7983[_0xf226('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xf226('0x2c')]('telephone:%s',this['telephones'][_0x1b7983[_0xf226('0x46')]]['name']),_0xf226('0x38'),this[_0xf226('0xd')][_0x1b7983[_0xf226('0x46')]]);}else if(this[_0xf226('0xb')][_0x1b7983['peer']]){this[_0xf226('0xb')][_0x1b7983[_0xf226('0x46')]][_0xf226('0x49')]=_0x1b7983[_0xf226('0x44')][_0xf226('0x34')]();this['trunks'][_0x1b7983[_0xf226('0x46')]]['address']=_0x1b7983['address'];logger[_0xf226('0x24')](_0xf226('0x4a'),util['inspect'](this['trunks'][_0x1b7983[_0xf226('0x46')]],{'showHidden':![],'depth':null}));this[_0xf226('0x1e')](util['format']('trunk:%s',this['trunks'][_0x1b7983[_0xf226('0x46')]][_0xf226('0x2e')]),_0xf226('0x2f'),this[_0xf226('0xb')][_0x1b7983[_0xf226('0x46')]]);}}}catch(_0x2ae232){logger[_0xf226('0x17')]('[userReport][peerstatus]',util[_0xf226('0x19')](_0x2ae232,{'showHidden':![],'depth':null}));}};module[_0xf226('0x4b')]=UserReport;
\ No newline at end of file
+var _0xca14=['exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','error','inspect','resolve','actionDeviceStateList','catch','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','syncRegistry','username','state','debug','find','stateRegistry','merge','omit','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','info','device','local','toLowerCase','stateTime','toNumber','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','accountcode','updateStatusRealtime','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:'];(function(_0x4e5c24,_0x22729e){var _0x25d056=function(_0x5f0bb2){while(--_0x5f0bb2){_0x4e5c24['push'](_0x4e5c24['shift']());}};_0x25d056(++_0x22729e);}(_0xca14,0x95));var _0x4ca1=function(_0x2f09f7,_0x461707){_0x2f09f7=_0x2f09f7-0x0;var _0x1b266c=_0xca14[_0x2f09f7];return _0x1b266c;};'use strict';var _=require(_0x4ca1('0x0'));var moment=require(_0x4ca1('0x1'));var util=require(_0x4ca1('0x2'));var Redis=require(_0x4ca1('0x3'));var BPromise=require('bluebird');var config=require(_0x4ca1('0x4'));var logger=require(_0x4ca1('0x5'))(_0x4ca1('0x6'));var ami=require(_0x4ca1('0x7'));config[_0x4ca1('0x8')]=_['defaults'](config['redis'],{'host':_0x4ca1('0x9'),'port':0x18eb});var io=require(_0x4ca1('0xa'))(new Redis(config[_0x4ca1('0x8')]));function UserReport(_0x50ea1b){this[_0x4ca1('0xb')]=_0x50ea1b['trunks'];this[_0x4ca1('0xc')]=_0x50ea1b[_0x4ca1('0xc')];this['telephones']=_0x50ea1b[_0x4ca1('0xd')];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on'](_0x4ca1('0xe'),this['syncRegistry'][_0x4ca1('0xf')](this));ami['on'](_0x4ca1('0x10'),this[_0x4ca1('0x11')][_0x4ca1('0xf')](this));ami['on'](_0x4ca1('0x12'),this[_0x4ca1('0x13')][_0x4ca1('0xf')](this));return this[_0x4ca1('0x14')]();}function showSipRegistrations(){Promise['resolve']()[_0x4ca1('0x15')](ami[_0x4ca1('0x16')]())['catch'](function(_0x190799){logger[_0x4ca1('0x17')]('[userReport][sipshowregistry]',util[_0x4ca1('0x18')](_0x190799,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x4ca1('0x19')]()[_0x4ca1('0x15')](ami[_0x4ca1('0x1a')]())[_0x4ca1('0x1b')](function(_0x53ed80){logger[_0x4ca1('0x17')](_0x4ca1('0x1c'),util[_0x4ca1('0x18')](_0x53ed80,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x4ca1('0x19')]()[_0x4ca1('0x15')](ami['actionSipPeerStatus']())[_0x4ca1('0x1b')](function(_0x3c84af){logger[_0x4ca1('0x17')](_0x4ca1('0x1d'),util[_0x4ca1('0x18')](_0x3c84af,{'showHidden':![],'depth':null}));});}UserReport[_0x4ca1('0x1e')][_0x4ca1('0x14')]=function(){setInterval(function(){BPromise[_0x4ca1('0x19')]()[_0x4ca1('0x15')](showSipRegistrations())[_0x4ca1('0x15')](listDeviceStates())[_0x4ca1('0x15')](showPeersStatus());},0x32c8);};UserReport[_0x4ca1('0x1e')][_0x4ca1('0x1f')]=function(_0x46a847){return _0x46a847!==null&&!_[_0x4ca1('0x20')](_0x46a847);};UserReport[_0x4ca1('0x1e')][_0x4ca1('0x21')]=function(_0x3c4324,_0x1f8931,_0x5bfb46){io['to'](_0x3c4324)[_0x4ca1('0x21')](_0x1f8931,_0x5bfb46);};UserReport[_0x4ca1('0x1e')][_0x4ca1('0x22')]=function(_0x4358cf){try{if(this[_0x4ca1('0x1f')](_0x4358cf)){logger['info']('[userReport][registry]\x20registry:%s\x20state:%s',_0x4358cf[_0x4ca1('0x23')],_0x4358cf[_0x4ca1('0x24')]);logger[_0x4ca1('0x25')]('[userReport][registry]',util[_0x4ca1('0x18')](_0x4358cf,{'showHidden':![],'depth':null}));var _0x52609f=_[_0x4ca1('0x26')](this[_0x4ca1('0xb')],{'defaultuser':_0x4358cf[_0x4ca1('0x23')]});if(_0x52609f){_0x4358cf[_0x4ca1('0x27')]=_0x4358cf['state'];_[_0x4ca1('0x28')](_0x52609f,_[_0x4ca1('0x29')](_0x4358cf,[_0x4ca1('0x2a'),'actionid',_0x4ca1('0x23'),'state']));logger[_0x4ca1('0x25')](_0x4ca1('0x2b'),util[_0x4ca1('0x18')](_0x52609f,{'showHidden':![],'depth':null}));this[_0x4ca1('0x21')](util[_0x4ca1('0x2c')](_0x4ca1('0x2d'),_0x52609f[_0x4ca1('0x2e')]),_0x4ca1('0x2f'),_0x52609f);}}}catch(_0x2330af){logger[_0x4ca1('0x17')](_0x4ca1('0x30'),util[_0x4ca1('0x18')](_0x2330af,{'showHidden':![],'depth':null}));}};UserReport[_0x4ca1('0x1e')][_0x4ca1('0x11')]=function(_0x2ab8ff){try{if(this[_0x4ca1('0x1f')](_0x2ab8ff)){logger[_0x4ca1('0x31')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x2ab8ff[_0x4ca1('0x32')],_0x2ab8ff['state']);logger['debug']('[userReport][devicestatechange]',util[_0x4ca1('0x18')](_0x2ab8ff,{'showHidden':![],'depth':null}));if(this[_0x4ca1('0xc')][_0x2ab8ff[_0x4ca1('0x32')]]){if(!this['agents'][_0x2ab8ff['device']][_0x4ca1('0x33')]||_0x2ab8ff['state'][_0x4ca1('0x34')]()=='inuse'){this['agents'][_0x2ab8ff['device']][_0x4ca1('0x33')]=![];if(this[_0x4ca1('0xc')][_0x2ab8ff['device']][_0x4ca1('0x24')]!==_0x2ab8ff[_0x4ca1('0x24')][_0x4ca1('0x34')]()){this[_0x4ca1('0xc')][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x35')]=_[_0x4ca1('0x36')](moment()[_0x4ca1('0x2c')]('x'));}this[_0x4ca1('0xc')][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x24')]=_0x2ab8ff['state'][_0x4ca1('0x34')]();this[_0x4ca1('0xc')][_0x2ab8ff['device']]['updateStatusRealtime'](_0x2ab8ff);}}else if(this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]]){if(this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]]['state']!==_0x2ab8ff[_0x4ca1('0x24')][_0x4ca1('0x34')]()){this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x35')]=_[_0x4ca1('0x36')](moment()[_0x4ca1('0x2c')]('x'));}this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x24')]=_0x2ab8ff[_0x4ca1('0x24')]['toLowerCase']();logger[_0x4ca1('0x25')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x4ca1('0x18')](this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]],{'showHidden':![],'depth':null}));this[_0x4ca1('0x21')](util[_0x4ca1('0x2c')](_0x4ca1('0x37'),this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x2e')]),'telephone:save',this[_0x4ca1('0xd')][_0x2ab8ff[_0x4ca1('0x32')]]);}else if(this[_0x4ca1('0xb')][_0x2ab8ff['device']]){if(this['trunks'][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x24')]!==_0x2ab8ff[_0x4ca1('0x24')][_0x4ca1('0x34')]()){this[_0x4ca1('0xb')][_0x2ab8ff[_0x4ca1('0x32')]]['stateTime']=_[_0x4ca1('0x36')](moment()[_0x4ca1('0x2c')]('x'));}this[_0x4ca1('0xb')][_0x2ab8ff['device']][_0x4ca1('0x24')]=_0x2ab8ff[_0x4ca1('0x24')][_0x4ca1('0x34')]();logger[_0x4ca1('0x25')](_0x4ca1('0x38'),util['inspect'](this[_0x4ca1('0xb')][_0x2ab8ff[_0x4ca1('0x32')]],{'showHidden':![],'depth':null}));this[_0x4ca1('0x21')](util[_0x4ca1('0x2c')]('trunk:%s',this[_0x4ca1('0xb')][_0x2ab8ff[_0x4ca1('0x32')]][_0x4ca1('0x2e')]),_0x4ca1('0x2f'),this['trunks'][_0x2ab8ff[_0x4ca1('0x32')]]);}else if(_[_0x4ca1('0x39')](_0x2ab8ff[_0x4ca1('0x32')],_0x4ca1('0x3a'))){var _0x3d323e=_0x2ab8ff[_0x4ca1('0x32')];var _0x7594fc=_0x3d323e['substring'](_0x3d323e[_0x4ca1('0x3b')]('/')+0x1,_0x3d323e['indexOf']('@'));var _0xd77635=_[_0x4ca1('0x26')](this[_0x4ca1('0xc')],function(_0x14d0b1){return _0x14d0b1[_0x4ca1('0x3c')]==_0x7594fc||_0x14d0b1['phone']==_0x7594fc||_0x14d0b1[_0x4ca1('0x3d')]==_0x7594fc;});if(_0xd77635){if(_0xd77635[_0x4ca1('0x24')]!==_0x2ab8ff['state'][_0x4ca1('0x34')]()){_0xd77635['stateTime']=_[_0x4ca1('0x36')](moment()[_0x4ca1('0x2c')]('x'));}_0xd77635[_0x4ca1('0x24')]=_0x2ab8ff[_0x4ca1('0x24')][_0x4ca1('0x34')]();_0xd77635[_0x4ca1('0x33')]=!![];_0xd77635[_0x4ca1('0x3e')](_0x2ab8ff);}}}}catch(_0x34319e){logger[_0x4ca1('0x17')](_0x4ca1('0x3f'),util['inspect'](_0x34319e,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x4ca1('0x13')]=function(_0x1ebfb0){try{if(this[_0x4ca1('0x1f')](_0x1ebfb0)&&this[_0x4ca1('0x1f')](_0x1ebfb0['peerstatus'])){logger[_0x4ca1('0x31')](_0x4ca1('0x40'),_0x1ebfb0[_0x4ca1('0x41')],_0x1ebfb0[_0x4ca1('0x42')],_0x1ebfb0[_0x4ca1('0x12')]);logger[_0x4ca1('0x25')](_0x4ca1('0x43'),util[_0x4ca1('0x18')](_0x1ebfb0,{'showHidden':![],'depth':null}));if(this[_0x4ca1('0xc')][_0x1ebfb0[_0x4ca1('0x41')]]){if(!this[_0x4ca1('0xc')][_0x1ebfb0[_0x4ca1('0x41')]][_0x4ca1('0x33')]||_0x1ebfb0[_0x4ca1('0x12')][_0x4ca1('0x34')]()==_0x4ca1('0x44')){this[_0x4ca1('0xc')][_0x1ebfb0[_0x4ca1('0x41')]][_0x4ca1('0x33')]=![];this['agents'][_0x1ebfb0[_0x4ca1('0x41')]][_0x4ca1('0x45')]=_0x1ebfb0['peerstatus']['toLowerCase']();this[_0x4ca1('0xc')][_0x1ebfb0['peer']][_0x4ca1('0x42')]=_0x1ebfb0[_0x4ca1('0x42')];this[_0x4ca1('0xc')][_0x1ebfb0[_0x4ca1('0x41')]]['updateStatusRealtime'](_0x1ebfb0);}}else if(this[_0x4ca1('0xd')][_0x1ebfb0[_0x4ca1('0x41')]]){this[_0x4ca1('0xd')][_0x1ebfb0[_0x4ca1('0x41')]][_0x4ca1('0x45')]=_0x1ebfb0[_0x4ca1('0x12')][_0x4ca1('0x34')]();this['telephones'][_0x1ebfb0[_0x4ca1('0x41')]][_0x4ca1('0x42')]=_0x1ebfb0[_0x4ca1('0x42')];logger[_0x4ca1('0x25')](_0x4ca1('0x46'),util[_0x4ca1('0x18')](this['telephones'][_0x1ebfb0[_0x4ca1('0x41')]],{'showHidden':![],'depth':null}));this[_0x4ca1('0x21')](util[_0x4ca1('0x2c')]('telephone:%s',this['telephones'][_0x1ebfb0[_0x4ca1('0x41')]][_0x4ca1('0x2e')]),_0x4ca1('0x47'),this[_0x4ca1('0xd')][_0x1ebfb0['peer']]);}else if(this[_0x4ca1('0xb')][_0x1ebfb0[_0x4ca1('0x41')]]){this[_0x4ca1('0xb')][_0x1ebfb0[_0x4ca1('0x41')]]['status']=_0x1ebfb0[_0x4ca1('0x12')]['toLowerCase']();this['trunks'][_0x1ebfb0[_0x4ca1('0x41')]]['address']=_0x1ebfb0['address'];logger[_0x4ca1('0x25')](_0x4ca1('0x48'),util[_0x4ca1('0x18')](this[_0x4ca1('0xb')][_0x1ebfb0[_0x4ca1('0x41')]],{'showHidden':![],'depth':null}));this[_0x4ca1('0x21')](util['format']('trunk:%s',this['trunks'][_0x1ebfb0[_0x4ca1('0x41')]]['name']),'trunk:save',this['trunks'][_0x1ebfb0[_0x4ca1('0x41')]]);}}}catch(_0x39c3a4){logger[_0x4ca1('0x17')](_0x4ca1('0x43'),util[_0x4ca1('0x18')](_0x39c3a4,{'showHidden':![],'depth':null}));}};module[_0x4ca1('0x49')]=UserReport;
\ No newline at end of file
index d0416d8..2a1d3d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x4761e4,_0x2b7519){var _0x2b1694=function(_0x5899cd){while(--_0x5899cd){_0x4761e4['push'](_0x4761e4['shift']());}};_0x2b1694(++_0x2b7519);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x5d3080,_0xc09afb){var _0x50d488=function(_0x2e4b23){while(--_0x2e4b23){_0x5d3080['push'](_0x5d3080['shift']());}};_0x50d488(++_0xc09afb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index b175dfd..907f01e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5781=['exten','starttime','format','toNumber','user:%s','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','disposition','includes','lastdata','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','linkedid','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','diff','calleridnum','xcally-motion-preview','destinationchannel','UserId','membername','from-sip','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','syncHangup','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','blindTransfers','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','some','origtransfererlinkedid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','not_inuse','busy','unavailable','ringing','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','defaults','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','syncNewState','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','prototype','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','isUndefined','merge','pick','keys','context','split','channel','destconnectedlinenum','connectedlinenum','name','user:agentconnect','accountcode','inspect','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed'];(function(_0xe27f36,_0x1c0455){var _0x35a77e=function(_0x279038){while(--_0x279038){_0xe27f36['push'](_0xe27f36['shift']());}};_0x35a77e(++_0x1c0455);}(_0x5781,0x14a));var _0x1578=function(_0xf7cb1c,_0x3ce6a4){_0xf7cb1c=_0xf7cb1c-0x0;var _0x1773f0=_0x5781[_0xf7cb1c];return _0x1773f0;};'use strict';var BPromise=require(_0x1578('0x0'));var _=require(_0x1578('0x1'));var moment=require(_0x1578('0x2'));var util=require(_0x1578('0x3'));var path=require('path');var Redis=require(_0x1578('0x4'));var config=require(_0x1578('0x5'));var logger=require(_0x1578('0x6'))(_0x1578('0x7'));var ami=require(_0x1578('0x8'));var Channel=require(_0x1578('0x9'));var RpcSetting=require(_0x1578('0xa'));var statusDesc=['unknown',_0x1578('0xb'),'inuse',_0x1578('0xc'),'invalid',_0x1578('0xd'),_0x1578('0xe'),'ringinuse','onhold'];var applications=[_0x1578('0xf'),_0x1578('0x10'),_0x1578('0x11'),_0x1578('0x12'),_0x1578('0x13'),'voicemail'];var dispositions=[_0x1578('0x14'),'FAILED',_0x1578('0x15'),_0x1578('0x14'),'NO\x20ANSWER','NO\x20ANSWER',_0x1578('0x16'),'BUSY',_0x1578('0x15'),_0x1578('0x15'),_0x1578('0x15')];var actions={};config['redis']=_[_0x1578('0x17')](config[_0x1578('0x18')],{'host':_0x1578('0x19'),'port':0x18eb});var io=require(_0x1578('0x1a'))(new Redis(config[_0x1578('0x18')]));function VoiceCallReport(_0x578b4b){this[_0x1578('0x1b')]=_0x578b4b[_0x1578('0x1b')];this[_0x1578('0x1c')]=_0x578b4b[_0x1578('0x1c')];this['blindTransfers']={};ami['on'](_0x1578('0x1d'),this[_0x1578('0x1e')][_0x1578('0x1f')](this));ami['on']('newexten',this['syncNewExten'][_0x1578('0x1f')](this));ami['on'](_0x1578('0x20'),this[_0x1578('0x21')][_0x1578('0x1f')](this));ami['on']('newstate',this[_0x1578('0x22')][_0x1578('0x1f')](this));ami['on']('varset',this['syncVarSet'][_0x1578('0x1f')](this));ami['on'](_0x1578('0x23'),this['syncHangup'][_0x1578('0x1f')](this));ami['on'](_0x1578('0x24'),this[_0x1578('0x25')][_0x1578('0x1f')](this));ami['on'](_0x1578('0x26'),this[_0x1578('0x27')][_0x1578('0x1f')](this));ami['on'](_0x1578('0x28'),this[_0x1578('0x29')]['bind'](this));ami['on'](_0x1578('0x2a'),this[_0x1578('0x2b')]['bind'](this));ami['on'](_0x1578('0x2c'),this['syncMusicOnHoldStop'][_0x1578('0x1f')](this));try{logger[_0x1578('0x2d')](_0x1578('0x2e'));ami[_0x1578('0x2f')]();}catch(_0xa0d7a6){logger[_0x1578('0x30')]('[voiceCallReport][coreshowchannels]',util['inspect'](_0xa0d7a6,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x1578('0x31')]['isNotNull']=function(_0x32c763){return _0x32c763!==null&&!_['isUndefined'](_0x32c763);};VoiceCallReport[_0x1578('0x31')][_0x1578('0x32')]=function(_0x5c0bba,_0x48518a,_0x3c131f){io['to'](_0x5c0bba)[_0x1578('0x32')](_0x48518a,_0x3c131f);};VoiceCallReport[_0x1578('0x31')][_0x1578('0x25')]=function(_0x16f427){try{if(this[_0x1578('0x33')](_0x16f427)){logger[_0x1578('0x2d')](_0x1578('0x34'),_0x16f427[_0x1578('0x35')],_0x16f427[_0x1578('0x36')],_0x16f427['calleridnum']);logger[_0x1578('0x37')](_0x1578('0x38'),_0x16f427[_0x1578('0x35')],util['inspect'](_0x16f427,{'showHidden':![],'depth':null}));if(_0x16f427['uniqueid']===_0x16f427['linkedid']){if(!_[_0x1578('0x39')](this['channels'][_0x16f427[_0x1578('0x35')]])){_[_0x1578('0x3a')](this[_0x1578('0x1b')][_0x16f427[_0x1578('0x35')]],_[_0x1578('0x3b')](_0x16f427,_[_0x1578('0x3c')](this[_0x1578('0x1b')][_0x16f427['uniqueid']])));}}if(_0x16f427[_0x1578('0x3d')]==='from-sip'){if(this[_0x1578('0x1c')][_0x16f427['channel'][_0x1578('0x3e')]('-')[0x0]]){if(_0x16f427['exten']=='xcally-motion-preview'){this[_0x1578('0x1c')][_0x16f427[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x40')]=_0x16f427[_0x1578('0x41')];this['emit'](util['format']('user:%s',this[_0x1578('0x1c')][_0x16f427[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x42')]),_0x1578('0x43'),{'destaccountcode':this[_0x1578('0x1c')][_0x16f427[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x44')],'destconnectedlinenum':_0x16f427['connectedlinenum']});}}}}}catch(_0x36cce1){logger[_0x1578('0x30')]('[%s][voiceCallReport][newcallerid]',_0x16f427[_0x1578('0x35')],util[_0x1578('0x45')](_0x36cce1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')]['syncNewChannel']=function(_0x1b5427){try{if(this[_0x1578('0x33')](_0x1b5427)){logger[_0x1578('0x37')](_0x1578('0x46'),_0x1b5427['uniqueid'],util[_0x1578('0x45')](_0x1b5427,{'showHidden':![],'depth':null}));if(_0x1b5427[_0x1578('0x35')]===_0x1b5427['linkedid']&&_0x1b5427['channel']!=_0x1578('0x47')){if(_['isUndefined'](this[_0x1578('0x1b')][_0x1b5427[_0x1578('0x35')]])){logger[_0x1578('0x2d')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x1b5427[_0x1578('0x35')],_0x1b5427[_0x1578('0x3d')],_0x1b5427[_0x1578('0x48')]);this[_0x1578('0x1b')][_0x1b5427[_0x1578('0x35')]]=new Channel();this[_0x1578('0x1b')][_0x1b5427['uniqueid']][_0x1578('0x49')]=moment()[_0x1578('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1578('0x1b')][_0x1b5427['uniqueid']]['disposition']=dispositions[_[_0x1578('0x4b')](_0x1b5427['channelstate'])];_[_0x1578('0x3a')](this[_0x1578('0x1b')][_0x1b5427[_0x1578('0x35')]],_[_0x1578('0x3b')](_0x1b5427,_[_0x1578('0x3c')](this[_0x1578('0x1b')][_0x1b5427[_0x1578('0x35')]])));if(_0x1b5427['context']==='from-sip'){if(this[_0x1578('0x1c')][_0x1b5427['channel'][_0x1578('0x3e')]('-')[0x0]]){if(_[_0x1578('0x39')](this[_0x1578('0x1c')][_0x1b5427[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]][_0x1578('0x40')])){this[_0x1578('0x1c')][_0x1b5427['channel']['split']('-')[0x0]][_0x1578('0x40')]=_0x1b5427[_0x1578('0x48')];logger[_0x1578('0x37')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x1b5427['uniqueid'],util[_0x1578('0x45')]({'destaccountcode':this['agents'][_0x1b5427[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]][_0x1578('0x44')],'destconnectedlinenum':_0x1b5427[_0x1578('0x48')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x1578('0x4a')](_0x1578('0x4c'),this[_0x1578('0x1c')][_0x1b5427[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x42')]),'user:agentconnect',{'destaccountcode':this[_0x1578('0x1c')][_0x1b5427[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1b5427[_0x1578('0x48')]});}}}}}}}catch(_0x2942ea){logger[_0x1578('0x30')]('[%s][voiceCallReport][newchannel]',_0x1b5427[_0x1578('0x35')],util[_0x1578('0x45')](_0x2942ea,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1578('0x1e')]=function(_0x20bf86){try{if(this[_0x1578('0x33')](_0x20bf86)){logger[_0x1578('0x37')](_0x1578('0x4d'),_0x20bf86[_0x1578('0x35')],util[_0x1578('0x45')](_0x20bf86,{'showHidden':![],'depth':null}));if(_0x20bf86['uniqueid']===_0x20bf86['linkedid']&&_0x20bf86[_0x1578('0x48')]!='h'&&_0x20bf86['channel']!=_0x1578('0x47')){_0x20bf86[_0x1578('0x4e')]=_0x20bf86['application'][_0x1578('0x4f')]();_0x20bf86[_0x1578('0x50')]=_0x20bf86[_0x1578('0x51')]&&_0x20bf86['appdata'][_0x1578('0x52')](_0x1578('0x53'))?_0x20bf86[_0x1578('0x51')]:(_0x20bf86['appdata']||_0x20bf86[_0x1578('0x50')])[_0x1578('0x4f')]();logger[_0x1578('0x2d')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x20bf86[_0x1578('0x35')],_0x20bf86[_0x1578('0x4e')],_0x20bf86[_0x1578('0x50')]);if(_[_0x1578('0x39')](this[_0x1578('0x1b')][_0x20bf86[_0x1578('0x35')]])){this[_0x1578('0x1b')][_0x20bf86[_0x1578('0x35')]]=new Channel();this[_0x1578('0x1b')][_0x20bf86['uniqueid']][_0x1578('0x49')]=_0x20bf86[_0x1578('0x54')]?moment()[_0x1578('0x55')](moment['duration'](_0x20bf86['duration'])[_0x1578('0x56')](),_0x1578('0x56'))[_0x1578('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0x1578('0x57'));this[_0x1578('0x1b')][_0x20bf86[_0x1578('0x35')]][_0x1578('0x58')]='NO\x20ANSWER';}_[_0x1578('0x3a')](this['channels'][_0x20bf86[_0x1578('0x35')]],_[_0x1578('0x3b')](_0x20bf86,_[_0x1578('0x3c')](this[_0x1578('0x1b')][_0x20bf86['uniqueid']])));if(_[_0x1578('0x59')](applications,_0x20bf86[_0x1578('0x4e')])){this['channels'][_0x20bf86[_0x1578('0x35')]]['lastapplication']=_0x20bf86[_0x1578('0x4e')];this[_0x1578('0x1b')][_0x20bf86[_0x1578('0x35')]][_0x1578('0x5a')]=_0x20bf86[_0x1578('0x50')];if(_0x20bf86[_0x1578('0x4e')]===_0x1578('0xf')&&_[_0x1578('0x52')](_0x20bf86[_0x1578('0x50')][_0x1578('0x4f')](),_0x1578('0x5b'))){var _0x1ba37e=_0x20bf86[_0x1578('0x50')]['split']('=');var _0x2ee26a=_0x1ba37e[0x0][_0x1578('0x4f')]()[_0x1578('0x5c')](/cdr\((.*)\)/);if(_0x2ee26a){this[_0x1578('0x1b')][_0x20bf86[_0x1578('0x35')]][_0x2ee26a[0x1]]=_0x1ba37e[0x1];}}else if(_0x20bf86['application']===_0x1578('0x10')){this['channels'][_0x20bf86[_0x1578('0x35')]][_0x1578('0x10')]=_0x20bf86[_0x1578('0x50')][_0x1578('0x3e')](',')[0x0];}}}}}catch(_0x5ecaa6){logger[_0x1578('0x30')](_0x1578('0x5d'),_0x20bf86['uniqueid'],util['inspect'](_0x5ecaa6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')][_0x1578('0x22')]=function(_0x4ebb77){try{if(this[_0x1578('0x33')](_0x4ebb77)){logger[_0x1578('0x2d')](_0x1578('0x5e'),_0x4ebb77['uniqueid'],_0x4ebb77[_0x1578('0x5f')],_0x4ebb77[_0x1578('0x36')],_0x4ebb77['calleridnum']);logger[_0x1578('0x37')](_0x1578('0x60'),_0x4ebb77[_0x1578('0x35')],util['inspect'](_0x4ebb77,{'showHidden':![],'depth':null}));if(_0x4ebb77[_0x1578('0x35')]!==_0x4ebb77['linkedid']){if(this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]]){if(_0x4ebb77[_0x1578('0x61')]==='6'){if(!this['channels'][_0x4ebb77['linkedid']][_0x1578('0x62')]){var _0x54d4a3=moment();this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]][_0x1578('0x62')]=!![];this[_0x1578('0x1b')][_0x4ebb77['linkedid']][_0x1578('0x63')]=_0x54d4a3['format'](_0x1578('0x57'));if(this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]][_0x1578('0x49')]){this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]]['holdtime']=_0x54d4a3[_0x1578('0x64')](this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]][_0x1578('0x49')],_0x1578('0x56'));}}this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]]['linkedid']=_0x4ebb77[_0x1578('0x35')];if(_0x4ebb77[_0x1578('0x65')]!==_0x1578('0x66')){this['channels'][_0x4ebb77[_0x1578('0x5f')]]['connectedlinenum']=_0x4ebb77['calleridnum'];}this['channels'][_0x4ebb77[_0x1578('0x5f')]]['connectedlinename']=_0x4ebb77[_0x1578('0x36')];this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]][_0x1578('0x67')]=_0x4ebb77[_0x1578('0x3f')];this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x5f')]][_0x1578('0x58')]=dispositions[_[_0x1578('0x4b')](_0x4ebb77[_0x1578('0x61')])];if(this[_0x1578('0x1c')][_0x4ebb77['channel']['split']('-')[0x0]]){this[_0x1578('0x1b')][_0x4ebb77['linkedid']]['UserId']=this[_0x1578('0x1c')][_0x4ebb77[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]]['id'];this['channels'][_0x4ebb77['linkedid']]['membername']=this['agents'][_0x4ebb77[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]]['name'];}}}}else{if(this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x35')]]){if(_0x4ebb77[_0x1578('0x61')]==='6'){if(this[_0x1578('0x1c')][_0x4ebb77[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]]){this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x35')]][_0x1578('0x68')]=this[_0x1578('0x1c')][_0x4ebb77['channel']['split']('-')[0x0]]['id'];this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x35')]][_0x1578('0x69')]=this[_0x1578('0x1c')][_0x4ebb77[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x42')];}}}}if(_0x4ebb77[_0x1578('0x61')]==='6'&&_0x4ebb77[_0x1578('0x3d')]===_0x1578('0x6a')){if(this[_0x1578('0x1c')][_0x4ebb77[_0x1578('0x3f')]['split']('-')[0x0]]){this[_0x1578('0x1c')][_0x4ebb77[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]][_0x1578('0x40')]=_0x4ebb77[_0x1578('0x48')];var _0x4b80d8;if(this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x35')]])_0x4b80d8=this[_0x1578('0x1b')][_0x4ebb77[_0x1578('0x35')]][_0x1578('0x6b')];else if(this['channels'][_0x4ebb77[_0x1578('0x5f')]])_0x4b80d8=this[_0x1578('0x1b')][_0x4ebb77['linkedid']]['routealias'];logger[_0x1578('0x37')](_0x1578('0x6c'),_0x4ebb77[_0x1578('0x35')],util[_0x1578('0x45')]({'destaccountcode':this[_0x1578('0x1c')][_0x4ebb77['channel']['split']('-')[0x0]][_0x1578('0x44')],'destconnectedlinenum':_0x4ebb77[_0x1578('0x48')],'routealias':_0x4b80d8},{'showHidden':![],'depth':null}));this[_0x1578('0x32')](util[_0x1578('0x4a')]('user:%s',this['agents'][_0x4ebb77[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x42')]),_0x1578('0x43'),{'destaccountcode':this[_0x1578('0x1c')][_0x4ebb77[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]][_0x1578('0x44')],'destconnectedlinenum':_0x4ebb77[_0x1578('0x48')],'routealias':_0x4b80d8});}}}}catch(_0x13f6d2){logger[_0x1578('0x30')](_0x1578('0x6d'),_0x4ebb77['uniqueid'],util['inspect'](_0x13f6d2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')][_0x1578('0x6e')]=function(_0x4d462d,_0xf59879){try{if(this[_0x1578('0x1b')][_0x4d462d]){logger[_0x1578('0x2d')](_0x1578('0x6f'),_0x4d462d,_0xf59879);this[_0x1578('0x1b')][_0x4d462d]['monitor']=!![];if(_[_0x1578('0x70')](_0xf59879,_0x1578('0x71'))){_0xf59879=_0xf59879[_0x1578('0x72')]('.wav49',_0x1578('0x73'));}this['channels'][_0x4d462d][_0x1578('0x74')]=_0xf59879;var _0x33b499=_['find'](this[_0x1578('0x1b')][_0x4d462d][_0x1578('0x75')],{'filename':_0xf59879});if(_[_0x1578('0x76')](_0x33b499)){this[_0x1578('0x1b')][_0x4d462d][_0x1578('0x75')]['push']({'filename':_0xf59879,'createdAt':moment()[_0x1578('0x4a')](_0x1578('0x57')),'mixmonitorid':'','status':'rec'});}}}catch(_0x451688){logger['error'](_0x1578('0x77'),_0x4d462d,util[_0x1578('0x45')](_0x451688,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')]['syncVarSet']=function(_0x19cf99){try{if(this[_0x1578('0x33')](_0x19cf99)){logger[_0x1578('0x37')](_0x1578('0x78'),_0x19cf99['uniqueid'],util[_0x1578('0x45')](_0x19cf99,{'showHidden':![],'depth':null}));if(this[_0x1578('0x1b')][_0x19cf99['uniqueid']]&&_0x19cf99['channel']!=_0x1578('0x47')){if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')])){if(this['isNotNull'](_0x19cf99[_0x1578('0x79')][_0x1578('0x7a')])){logger[_0x1578('0x2d')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x19cf99[_0x1578('0x35')],_0x19cf99[_0x1578('0x7b')]);this['syncMixMonitorFilename'](_0x19cf99['uniqueid'],_0x19cf99[_0x1578('0x7b')]);}else if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')][_0x1578('0x7c')])){logger[_0x1578('0x2d')](_0x1578('0x7d'),_0x19cf99[_0x1578('0x35')],_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x1b')][_0x19cf99[_0x1578('0x35')]][_0x1578('0x65')]=_0x19cf99['value'];}else if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')][_0x1578('0x7e')])){logger[_0x1578('0x2d')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x19cf99[_0x1578('0x35')],_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x1b')][_0x19cf99[_0x1578('0x35')]][_0x1578('0x7f')]=_0x19cf99['value'];}else if(this['isNotNull'](_0x19cf99[_0x1578('0x79')]['xmd-cdrtype'])){logger[_0x1578('0x2d')](_0x1578('0x80'),_0x19cf99['uniqueid'],_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x1b')][_0x19cf99[_0x1578('0x35')]]['type']=_0x19cf99[_0x1578('0x7b')];}else if(this['isNotNull'](_0x19cf99[_0x1578('0x79')][_0x1578('0x81')])){logger['info'](_0x1578('0x82'),_0x19cf99[_0x1578('0x35')],_0x19cf99[_0x1578('0x7b')][_0x1578('0x3e')](',')[0x0]);this[_0x1578('0x1b')][_0x19cf99[_0x1578('0x35')]][_0x1578('0x10')]=_0x19cf99[_0x1578('0x7b')][_0x1578('0x3e')](',')[0x0];}else if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')]['xmd-originatecalleridnum'])){logger['info'](_0x1578('0x83'),_0x19cf99['uniqueid'],_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x1b')][_0x19cf99['uniqueid']][_0x1578('0x84')]=_0x19cf99[_0x1578('0x7b')];}else if(this['isNotNull'](_0x19cf99[_0x1578('0x79')][_0x1578('0x85')])){logger['info'](_0x1578('0x86'),_0x19cf99[_0x1578('0x35')],_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x1b')][_0x19cf99[_0x1578('0x35')]][_0x1578('0x87')]=_0x19cf99[_0x1578('0x7b')];}else if(this[_0x1578('0x33')](_0x19cf99['variable'][_0x1578('0x88')])){logger[_0x1578('0x2d')](_0x1578('0x89'),_0x19cf99['uniqueid'],_0x19cf99['value']);this['channels'][_0x19cf99[_0x1578('0x35')]][_0x1578('0x8a')]=_0x19cf99[_0x1578('0x7b')];}else if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')][_0x1578('0x8b')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x19cf99['uniqueid'],_0x19cf99[_0x1578('0x7b')]);this['channels'][_0x19cf99[_0x1578('0x35')]][_0x1578('0x10')]=_0x19cf99[_0x1578('0x7b')];}else if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')]['sipcallid'])){logger[_0x1578('0x2d')](_0x1578('0x8c'),_0x19cf99[_0x1578('0x35')],_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x1b')][_0x19cf99[_0x1578('0x35')]][_0x1578('0x8d')]=_0x19cf99[_0x1578('0x7b')];}}}else if(this['isNotNull'](_0x19cf99['variable'][_0x1578('0x7a')])){if(_0x19cf99[_0x1578('0x7b')]){var _0x44c232=path[_0x1578('0x8e')](_0x19cf99['value'])[_0x1578('0x42')];logger[_0x1578('0x2d')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x44c232,_0x19cf99[_0x1578('0x7b')]);this[_0x1578('0x6e')](_0x44c232,_0x19cf99[_0x1578('0x7b')]);}}else if(this[_0x1578('0x1b')][_0x19cf99['linkedid']]){if(this[_0x1578('0x33')](_0x19cf99[_0x1578('0x79')])){if(this[_0x1578('0x33')](_0x19cf99['variable']['sipcallid'])){logger[_0x1578('0x2d')](_0x1578('0x8c'),_0x19cf99[_0x1578('0x5f')],_0x19cf99[_0x1578('0x7b')]);this['channels'][_0x19cf99['linkedid']][_0x1578('0x8f')]=_0x19cf99[_0x1578('0x7b')];}}}}}catch(_0x195d46){logger[_0x1578('0x30')]('[%s][voiceCallReport][varset]',_0x19cf99[_0x1578('0x35')],util[_0x1578('0x45')](_0x195d46,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')][_0x1578('0x90')]=function(_0x23381d){try{if(this['isNotNull'](_0x23381d)){logger[_0x1578('0x37')](_0x1578('0x91'),_0x23381d[_0x1578('0x35')],util['inspect'](_0x23381d,{'showHidden':![],'depth':null}));if(this[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]]){logger['info'](_0x1578('0x92'),_0x23381d[_0x1578('0x35')],_0x23381d[_0x1578('0x93')]);var _0x545046=moment();this[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0x94')]=_0x545046[_0x1578('0x4a')](_0x1578('0x57'));this[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0x54')]=_0x545046[_0x1578('0x64')](this[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0x49')],_0x1578('0x56'));if(this[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0x62')]){this['channels'][_0x23381d[_0x1578('0x35')]][_0x1578('0x95')]=_0x545046[_0x1578('0x64')](this['channels'][_0x23381d[_0x1578('0x35')]]['answertime'],_0x1578('0x56'));this[_0x1578('0x1b')][_0x23381d['uniqueid']]['holdtime']=this[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0x54')]-this[_0x1578('0x1b')][_0x23381d['uniqueid']][_0x1578('0x95')];}if(_0x23381d[_0x1578('0x3d')]===_0x1578('0x6a')){if(this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]]){this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')]['split']('-')[0x0]]=_[_0x1578('0x96')](this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]],[_0x1578('0x40')]);logger[_0x1578('0x37')](_0x1578('0x97'),_0x23381d[_0x1578('0x35')],util['inspect']({'id':this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')][_0x1578('0x3e')]('-')[0x0]]['id'],'destaccountcode':this[_0x1578('0x1c')][_0x23381d['channel'][_0x1578('0x3e')]('-')[0x0]][_0x1578('0x44')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x42')]),_0x1578('0x98'),{'id':this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x1578('0x1c')][_0x23381d[_0x1578('0x3f')]['split']('-')[0x0]][_0x1578('0x44')]});}}var _0x66d2f=this;Promise[_0x1578('0x99')]()[_0x1578('0x9a')](function(){var _0x1967f6=_0x66d2f[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]];if(typeof _0x1967f6[_0x1578('0x9b')]==='undefined')return;if(_[_0x1578('0x9c')](_0x1967f6[_0x1578('0x75')]))return;return RpcSetting['getSettings']()['then'](function(_0x511c54){if(!_0x511c54[_0x1578('0x9d')])return;return Promise['resolve']()[_0x1578('0x9a')](function(){return ami[_0x1578('0x9e')]({'action':_0x1578('0x9f'),'channel':_0x1967f6[_0x1578('0x3f')]})[_0x1578('0xa0')](function(){});})[_0x1578('0x9a')](function(){return ami[_0x1578('0x9e')]({'action':_0x1578('0x9f'),'channel':_0x1967f6[_0x1578('0x67')]})[_0x1578('0xa0')](function(){})[_0x1578('0xa1')](function(){var _0x597bd9=_0x66d2f[_0x1578('0x1c')][_0x1967f6[_0x1578('0x67')][_0x1578('0x3e')]('-')[0x0]];if(!_0x597bd9)return;io[_0x1578('0x32')](_0x1578('0xa2'),{'agentId':_0x597bd9['id'],'uniqueid':_0x1967f6[_0x1578('0x35')]});});});});})[_0x1578('0x9a')](function(){if(_0x23381d[_0x1578('0xa3')]==='BlindTransfer'){_0x66d2f[_0x1578('0xa4')][_0x23381d[_0x1578('0x35')]]=_0x66d2f[_0x1578('0x1b')][_0x23381d['uniqueid']];}else{if(_0x66d2f[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0xa5')]===_0x1578('0xa6')&&_0x66d2f[_0x1578('0xa4')][_0x23381d[_0x1578('0x35')]]){_0x66d2f[_0x1578('0x1b')][_0x23381d['uniqueid']]['uniqueid']=[_0x66d2f[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]][_0x1578('0x5f')],_0x66d2f[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]]['linkedid']=_0x66d2f[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]]['uniqueid']][0x0];delete _0x66d2f['blindTransfers'][_0x23381d[_0x1578('0x35')]];}}logger[_0x1578('0x37')](_0x1578('0xa7'),_0x23381d[_0x1578('0x35')],util[_0x1578('0x45')](_0x66d2f[_0x1578('0x1b')][_0x23381d[_0x1578('0x35')]],{'showHidden':![],'depth':null}));ami['emit'](_0x1578('0xa8'),_0x66d2f['channels'][_0x23381d['uniqueid']]);delete _0x66d2f['channels'][_0x23381d[_0x1578('0x35')]];});}}}catch(_0x50c3c0){logger[_0x1578('0x30')](_0x1578('0xa9'),_0x23381d[_0x1578('0x35')],util[_0x1578('0x45')](_0x50c3c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')]['syncAttendedTransfer']=function(_0x5a64a1){try{if(this['isNotNull'](_0x5a64a1)){logger[_0x1578('0x2d')](_0x1578('0xaa'),_0x5a64a1['uniqueid'],_0x5a64a1[_0x1578('0xab')],_0x5a64a1[_0x1578('0xac')]);logger[_0x1578('0x37')](_0x1578('0xad'),_0x5a64a1[_0x1578('0x35')],util['inspect'](_0x5a64a1,{'showHidden':![],'depth':null}));if(this['channels'][_0x5a64a1[_0x1578('0xae')]]){this['channels'][_0x5a64a1[_0x1578('0xae')]][_0x1578('0xaf')]=_0x5a64a1[_0x1578('0xab')];this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xae')]]['transferconnectedlinenum']=_0x5a64a1[_0x1578('0xac')];if(this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb0')]]){var _0x198a55=this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb0')]];this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb0')]]=this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xae')]];this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xae')]]=_0x198a55;}}else if(this['channels'][_0x5a64a1[_0x1578('0xb1')]]){this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb1')]][_0x1578('0xaf')]=_0x5a64a1[_0x1578('0xab')];this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb1')]][_0x1578('0xb2')]=_0x5a64a1[_0x1578('0xac')];if(this['channels'][_0x5a64a1[_0x1578('0xb3')]]){var _0x198a55=this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb3')]];this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb3')]]=this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb1')]];this['channels'][_0x5a64a1['transfertargetuniqueid']]=_0x198a55;}}if((this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb3')]]||this[_0x1578('0x1b')][_0x5a64a1['origtransfererlinkedid']])&&this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb0')]]){var _0x128e7d=_[_0x1578('0xb4')]([this['channels'][_0x5a64a1[_0x1578('0xb3')]],this[_0x1578('0x1b')][_0x5a64a1['origtransfererlinkedid']],this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb0')]]],function(_0x1cbef3){return _0x1cbef3&&_0x1cbef3[_0x1578('0xa5')]==='outbound'&&_0x1cbef3['routeid'];});if(_0x128e7d){if(this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb3')]])this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb3')]][_0x1578('0x9b')]='ATTENDED';if(this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb5')]])this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb5')]][_0x1578('0x9b')]=_0x1578('0xb6');this[_0x1578('0x1b')][_0x5a64a1[_0x1578('0xb0')]]['transferType']=_0x1578('0xb6');}}}}catch(_0x1bdc8c){logger['error'](_0x1578('0xb7'),_0x5a64a1[_0x1578('0x35')],util[_0x1578('0x45')](_0x1bdc8c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1578('0x29')]=function(_0x51f8c7){try{if(this[_0x1578('0x33')](_0x51f8c7)){logger[_0x1578('0x2d')](_0x1578('0xb8'),_0x51f8c7['uniqueid'],_0x51f8c7[_0x1578('0xb9')],_0x51f8c7[_0x1578('0xba')]);logger['debug'](_0x1578('0xbb'),_0x51f8c7[_0x1578('0x35')],util[_0x1578('0x45')](_0x51f8c7,{'showHidden':![],'depth':null}));if(this['channels'][_0x51f8c7[_0x1578('0xae')]]){this[_0x1578('0x1b')][_0x51f8c7[_0x1578('0xae')]]['transfercalleridnum']=_0x51f8c7[_0x1578('0xb9')];this[_0x1578('0x1b')][_0x51f8c7[_0x1578('0xae')]][_0x1578('0xb2')]=_0x51f8c7[_0x1578('0xba')];this['channels'][_0x51f8c7[_0x1578('0xae')]][_0x1578('0x9b')]=_0x1578('0xbc');this['syncHangup']({'event':_0x1578('0xbd'),'uniqueid':_0x51f8c7[_0x1578('0xae')],'context':_0x51f8c7[_0x1578('0x3d')],'channel':_0x51f8c7['transfererchannel']});}else{this[_0x1578('0x1b')][_0x51f8c7[_0x1578('0xbe')]][_0x1578('0x9b')]='BLIND';}}}catch(_0x406ae3){logger[_0x1578('0x30')](_0x1578('0xbf'),_0x51f8c7[_0x1578('0x35')],util[_0x1578('0x45')](_0x406ae3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')]['syncMusicOnHoldStart']=function(_0x39bba0){try{if(this[_0x1578('0x33')](_0x39bba0)){logger[_0x1578('0x37')](_0x1578('0xc0'),_0x39bba0[_0x1578('0x35')],util[_0x1578('0x45')](_0x39bba0,{'showHidden':![],'depth':null}));if(this[_0x1578('0x1b')][_0x39bba0[_0x1578('0x35')]]){if(!_[_0x1578('0x76')](this[_0x1578('0x1b')][_0x39bba0[_0x1578('0x35')]][_0x1578('0x63')])){this[_0x1578('0x1b')][_0x39bba0[_0x1578('0x35')]][_0x1578('0xc1')]=moment()['format'](_0x1578('0x57'));logger[_0x1578('0x2d')](_0x1578('0xc2'),_0x39bba0['uniqueid'],this['channels'][_0x39bba0[_0x1578('0x35')]][_0x1578('0xc1')]);}}}}catch(_0x3c2522){logger[_0x1578('0x30')]('[%s][voiceCallReport][musiconholdstart]',_0x39bba0[_0x1578('0x35')],util['inspect'](_0x3c2522,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1578('0x31')][_0x1578('0xc3')]=function(_0x54c669){try{if(this[_0x1578('0x33')](_0x54c669)){logger[_0x1578('0x37')](_0x1578('0xc4'),_0x54c669[_0x1578('0x35')],util['inspect'](_0x54c669,{'showHidden':![],'depth':null}));if(this['channels'][_0x54c669[_0x1578('0x35')]]){if(!_[_0x1578('0x76')](this[_0x1578('0x1b')][_0x54c669[_0x1578('0x35')]][_0x1578('0xc1')])){this[_0x1578('0x1b')][_0x54c669['uniqueid']][_0x1578('0xc5')]+=moment()['milliseconds'](0x0)['diff'](this[_0x1578('0x1b')][_0x54c669[_0x1578('0x35')]]['mohstarttime'],_0x1578('0x56'));logger[_0x1578('0x2d')](_0x1578('0xc6'),_0x54c669[_0x1578('0x35')],this['channels'][_0x54c669[_0x1578('0x35')]][_0x1578('0xc5')]);delete this[_0x1578('0x1b')][_0x54c669[_0x1578('0x35')]][_0x1578('0xc1')];}}}}catch(_0x4b6655){logger['error'](_0x1578('0xc7'),_0x54c669['uniqueid'],util[_0x1578('0x45')](_0x4b6655,{'showHidden':![],'depth':null}));}};module[_0x1578('0xc8')]=VoiceCallReport;
\ No newline at end of file
+var _0x40af=['onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','syncNewExten','bind','newexten','syncNewChannel','newstate','varset','syncVarSet','syncHangup','syncNewCallerId','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','pick','keys','context','from-sip','channel','exten','xcally-motion-preview','split','user:%s','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','merge','destconnectedlinenum','accountcode','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','info','subtract','duration','seconds','disposition','lastdata','startsWith','cdr(','match','[%s][voiceCallReport][newexten]','syncNewState','answered','answertime','holdtime','diff','connectedlinenum','connectedlinename','destinationchannel','channelstate','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','starttime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','then','isEmpty','getSettings','resolve','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','type','outbound','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','mohstarttime','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','not_inuse','busy','invalid'];(function(_0x47c75a,_0x447086){var _0x1e6f62=function(_0x1a2907){while(--_0x1a2907){_0x47c75a['push'](_0x47c75a['shift']());}};_0x1e6f62(++_0x447086);}(_0x40af,0xb4));var _0xf40a=function(_0x376a5c,_0x471fb8){_0x376a5c=_0x376a5c-0x0;var _0x5b34ba=_0x40af[_0x376a5c];return _0x5b34ba;};'use strict';var BPromise=require('bluebird');var _=require(_0xf40a('0x0'));var moment=require(_0xf40a('0x1'));var util=require(_0xf40a('0x2'));var path=require(_0xf40a('0x3'));var Redis=require(_0xf40a('0x4'));var config=require(_0xf40a('0x5'));var logger=require(_0xf40a('0x6'))(_0xf40a('0x7'));var ami=require('../ami');var Channel=require(_0xf40a('0x8'));var RpcSetting=require(_0xf40a('0x9'));var statusDesc=['unknown',_0xf40a('0xa'),'inuse',_0xf40a('0xb'),_0xf40a('0xc'),'unavailable','ringing','ringinuse',_0xf40a('0xd')];var applications=[_0xf40a('0xe'),_0xf40a('0xf'),_0xf40a('0x10'),_0xf40a('0x11'),_0xf40a('0x12'),_0xf40a('0x13')];var dispositions=[_0xf40a('0x14'),'FAILED',_0xf40a('0x15'),_0xf40a('0x14'),'NO\x20ANSWER',_0xf40a('0x14'),_0xf40a('0x16'),_0xf40a('0x17'),'FAILED',_0xf40a('0x15'),_0xf40a('0x15')];var actions={};config[_0xf40a('0x18')]=_[_0xf40a('0x19')](config[_0xf40a('0x18')],{'host':_0xf40a('0x1a'),'port':0x18eb});var io=require(_0xf40a('0x1b'))(new Redis(config['redis']));function VoiceCallReport(_0x549fbe){this[_0xf40a('0x1c')]=_0x549fbe[_0xf40a('0x1c')];this[_0xf40a('0x1d')]=_0x549fbe[_0xf40a('0x1d')];this[_0xf40a('0x1e')]={};ami['on']('coreshowchannel',this[_0xf40a('0x1f')][_0xf40a('0x20')](this));ami['on'](_0xf40a('0x21'),this[_0xf40a('0x1f')][_0xf40a('0x20')](this));ami['on']('newchannel',this[_0xf40a('0x22')]['bind'](this));ami['on'](_0xf40a('0x23'),this['syncNewState'][_0xf40a('0x20')](this));ami['on'](_0xf40a('0x24'),this[_0xf40a('0x25')][_0xf40a('0x20')](this));ami['on']('hangup',this[_0xf40a('0x26')][_0xf40a('0x20')](this));ami['on']('newcallerid',this[_0xf40a('0x27')][_0xf40a('0x20')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xf40a('0x28'),this[_0xf40a('0x29')][_0xf40a('0x20')](this));ami['on'](_0xf40a('0x2a'),this[_0xf40a('0x2b')][_0xf40a('0x20')](this));ami['on'](_0xf40a('0x2c'),this['syncMusicOnHoldStop'][_0xf40a('0x20')](this));try{logger['info'](_0xf40a('0x2d'));ami[_0xf40a('0x2e')]();}catch(_0xb41fae){logger[_0xf40a('0x2f')](_0xf40a('0x30'),util[_0xf40a('0x31')](_0xb41fae,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf40a('0x32')]['isNotNull']=function(_0x58ca92){return _0x58ca92!==null&&!_[_0xf40a('0x33')](_0x58ca92);};VoiceCallReport['prototype'][_0xf40a('0x34')]=function(_0x54e865,_0x31760b,_0x224251){io['to'](_0x54e865)[_0xf40a('0x34')](_0x31760b,_0x224251);};VoiceCallReport[_0xf40a('0x32')]['syncNewCallerId']=function(_0x43a303){try{if(this[_0xf40a('0x35')](_0x43a303)){logger['info'](_0xf40a('0x36'),_0x43a303['uniqueid'],_0x43a303[_0xf40a('0x37')],_0x43a303[_0xf40a('0x38')]);logger[_0xf40a('0x39')](_0xf40a('0x3a'),_0x43a303[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x43a303,{'showHidden':![],'depth':null}));if(_0x43a303[_0xf40a('0x3b')]===_0x43a303[_0xf40a('0x3c')]){if(!_[_0xf40a('0x33')](this['channels'][_0x43a303[_0xf40a('0x3b')]])){_['merge'](this[_0xf40a('0x1c')][_0x43a303[_0xf40a('0x3b')]],_[_0xf40a('0x3d')](_0x43a303,_[_0xf40a('0x3e')](this['channels'][_0x43a303[_0xf40a('0x3b')]])));}}if(_0x43a303[_0xf40a('0x3f')]===_0xf40a('0x40')){if(this['agents'][_0x43a303[_0xf40a('0x41')]['split']('-')[0x0]]){if(_0x43a303[_0xf40a('0x42')]==_0xf40a('0x43')){this[_0xf40a('0x1d')][_0x43a303['channel'][_0xf40a('0x44')]('-')[0x0]]['destconnectedlinenum']=_0x43a303['connectedlinenum'];this['emit'](util['format'](_0xf40a('0x45'),this[_0xf40a('0x1d')][_0x43a303[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x46')]),_0xf40a('0x47'),{'destaccountcode':this[_0xf40a('0x1d')][_0x43a303['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x43a303['connectedlinenum']});}}}}}catch(_0x492624){logger[_0xf40a('0x2f')](_0xf40a('0x48'),_0x43a303[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x492624,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf40a('0x22')]=function(_0xfb20e2){try{if(this['isNotNull'](_0xfb20e2)){logger[_0xf40a('0x39')]('[%s][voiceCallReport][newchannel]\x20event:',_0xfb20e2[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0xfb20e2,{'showHidden':![],'depth':null}));if(_0xfb20e2[_0xf40a('0x3b')]===_0xfb20e2[_0xf40a('0x3c')]&&_0xfb20e2[_0xf40a('0x41')]!=_0xf40a('0x49')){if(_[_0xf40a('0x33')](this[_0xf40a('0x1c')][_0xfb20e2[_0xf40a('0x3b')]])){logger['info'](_0xf40a('0x4a'),_0xfb20e2[_0xf40a('0x3b')],_0xfb20e2['context'],_0xfb20e2[_0xf40a('0x42')]);this[_0xf40a('0x1c')][_0xfb20e2[_0xf40a('0x3b')]]=new Channel();this['channels'][_0xfb20e2['uniqueid']]['starttime']=moment()[_0xf40a('0x4b')](_0xf40a('0x4c'));this[_0xf40a('0x1c')][_0xfb20e2[_0xf40a('0x3b')]]['disposition']=dispositions[_[_0xf40a('0x4d')](_0xfb20e2['channelstate'])];_[_0xf40a('0x4e')](this[_0xf40a('0x1c')][_0xfb20e2[_0xf40a('0x3b')]],_['pick'](_0xfb20e2,_[_0xf40a('0x3e')](this[_0xf40a('0x1c')][_0xfb20e2['uniqueid']])));if(_0xfb20e2['context']===_0xf40a('0x40')){if(this[_0xf40a('0x1d')][_0xfb20e2['channel'][_0xf40a('0x44')]('-')[0x0]]){if(_[_0xf40a('0x33')](this[_0xf40a('0x1d')][_0xfb20e2[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x4f')])){this['agents'][_0xfb20e2['channel'][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x4f')]=_0xfb20e2[_0xf40a('0x42')];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0xfb20e2[_0xf40a('0x3b')],util[_0xf40a('0x31')]({'destaccountcode':this[_0xf40a('0x1d')][_0xfb20e2['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xfb20e2[_0xf40a('0x42')]},{'showHidden':![],'depth':null}));this[_0xf40a('0x34')](util[_0xf40a('0x4b')](_0xf40a('0x45'),this[_0xf40a('0x1d')][_0xfb20e2[_0xf40a('0x41')]['split']('-')[0x0]][_0xf40a('0x46')]),'user:agentconnect',{'destaccountcode':this[_0xf40a('0x1d')][_0xfb20e2['channel'][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x50')],'destconnectedlinenum':_0xfb20e2[_0xf40a('0x42')]});}}}}}}}catch(_0x50932f){logger[_0xf40a('0x2f')]('[%s][voiceCallReport][newchannel]',_0xfb20e2[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x50932f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0x1f')]=function(_0x5a84af){try{if(this['isNotNull'](_0x5a84af)){logger['debug'](_0xf40a('0x51'),_0x5a84af[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x5a84af,{'showHidden':![],'depth':null}));if(_0x5a84af[_0xf40a('0x3b')]===_0x5a84af['linkedid']&&_0x5a84af[_0xf40a('0x42')]!='h'&&_0x5a84af[_0xf40a('0x41')]!=_0xf40a('0x49')){_0x5a84af[_0xf40a('0x52')]=_0x5a84af[_0xf40a('0x52')][_0xf40a('0x53')]();_0x5a84af[_0xf40a('0x54')]=_0x5a84af['appdata']&&_0x5a84af['appdata']['startsWith']('CDR(routeAlias)')?_0x5a84af[_0xf40a('0x55')]:(_0x5a84af[_0xf40a('0x55')]||_0x5a84af[_0xf40a('0x54')])['toLowerCase']();logger[_0xf40a('0x56')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x5a84af[_0xf40a('0x3b')],_0x5a84af[_0xf40a('0x52')],_0x5a84af[_0xf40a('0x54')]);if(_[_0xf40a('0x33')](this['channels'][_0x5a84af[_0xf40a('0x3b')]])){this[_0xf40a('0x1c')][_0x5a84af['uniqueid']]=new Channel();this[_0xf40a('0x1c')][_0x5a84af['uniqueid']]['starttime']=_0x5a84af['duration']?moment()[_0xf40a('0x57')](moment['duration'](_0x5a84af[_0xf40a('0x58')])[_0xf40a('0x59')](),_0xf40a('0x59'))['format'](_0xf40a('0x4c')):moment()[_0xf40a('0x4b')](_0xf40a('0x4c'));this[_0xf40a('0x1c')][_0x5a84af[_0xf40a('0x3b')]][_0xf40a('0x5a')]=_0xf40a('0x14');}_['merge'](this[_0xf40a('0x1c')][_0x5a84af[_0xf40a('0x3b')]],_['pick'](_0x5a84af,_['keys'](this['channels'][_0x5a84af['uniqueid']])));if(_['includes'](applications,_0x5a84af[_0xf40a('0x52')])){this[_0xf40a('0x1c')][_0x5a84af['uniqueid']]['lastapplication']=_0x5a84af[_0xf40a('0x52')];this['channels'][_0x5a84af[_0xf40a('0x3b')]][_0xf40a('0x5b')]=_0x5a84af['applicationdata'];if(_0x5a84af['application']===_0xf40a('0xe')&&_[_0xf40a('0x5c')](_0x5a84af[_0xf40a('0x54')]['toLowerCase'](),_0xf40a('0x5d'))){var _0x4ee2d6=_0x5a84af['applicationdata'][_0xf40a('0x44')]('=');var _0x1ddd52=_0x4ee2d6[0x0][_0xf40a('0x53')]()[_0xf40a('0x5e')](/cdr\((.*)\)/);if(_0x1ddd52){this[_0xf40a('0x1c')][_0x5a84af[_0xf40a('0x3b')]][_0x1ddd52[0x1]]=_0x4ee2d6[0x1];}}else if(_0x5a84af[_0xf40a('0x52')]===_0xf40a('0xf')){this['channels'][_0x5a84af['uniqueid']][_0xf40a('0xf')]=_0x5a84af[_0xf40a('0x54')][_0xf40a('0x44')](',')[0x0];}}}}}catch(_0xb9920){logger[_0xf40a('0x2f')](_0xf40a('0x5f'),_0x5a84af[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0xb9920,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0x60')]=function(_0x381e10){try{if(this['isNotNull'](_0x381e10)){logger[_0xf40a('0x56')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x381e10['uniqueid'],_0x381e10[_0xf40a('0x3c')],_0x381e10[_0xf40a('0x37')],_0x381e10[_0xf40a('0x38')]);logger[_0xf40a('0x39')]('[%s][voiceCallReport][newstate]\x20event:',_0x381e10[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x381e10,{'showHidden':![],'depth':null}));if(_0x381e10[_0xf40a('0x3b')]!==_0x381e10[_0xf40a('0x3c')]){if(this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]]){if(_0x381e10['channelstate']==='6'){if(!this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x61')]){var _0x23003b=moment();this['channels'][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x61')]=!![];this['channels'][_0x381e10['linkedid']][_0xf40a('0x62')]=_0x23003b[_0xf40a('0x4b')](_0xf40a('0x4c'));if(this[_0xf40a('0x1c')][_0x381e10['linkedid']]['starttime']){this['channels'][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x63')]=_0x23003b[_0xf40a('0x64')](this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]]['starttime'],_0xf40a('0x59'));}}this['channels'][_0x381e10['linkedid']][_0xf40a('0x3c')]=_0x381e10[_0xf40a('0x3b')];if(_0x381e10[_0xf40a('0x38')]!==_0xf40a('0x43')){this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x65')]=_0x381e10[_0xf40a('0x38')];}this['channels'][_0x381e10['linkedid']][_0xf40a('0x66')]=_0x381e10[_0xf40a('0x37')];this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x67')]=_0x381e10[_0xf40a('0x41')];this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x5a')]=dispositions[_['toNumber'](_0x381e10[_0xf40a('0x68')])];if(this['agents'][_0x381e10[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]){this['channels'][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x69')]=this[_0xf40a('0x1d')][_0x381e10['channel'][_0xf40a('0x44')]('-')[0x0]]['id'];this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]][_0xf40a('0x6a')]=this[_0xf40a('0x1d')][_0x381e10['channel'][_0xf40a('0x44')]('-')[0x0]]['name'];}}}}else{if(this[_0xf40a('0x1c')][_0x381e10['uniqueid']]){if(_0x381e10[_0xf40a('0x68')]==='6'){if(this[_0xf40a('0x1d')][_0x381e10['channel']['split']('-')[0x0]]){this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3b')]][_0xf40a('0x69')]=this[_0xf40a('0x1d')][_0x381e10[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]['id'];this['channels'][_0x381e10[_0xf40a('0x3b')]][_0xf40a('0x6a')]=this[_0xf40a('0x1d')][_0x381e10[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]['name'];}}}}if(_0x381e10['channelstate']==='6'&&_0x381e10[_0xf40a('0x3f')]===_0xf40a('0x40')){if(this[_0xf40a('0x1d')][_0x381e10['channel']['split']('-')[0x0]]){this[_0xf40a('0x1d')][_0x381e10[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x4f')]=_0x381e10[_0xf40a('0x42')];var _0x5744df;if(this[_0xf40a('0x1c')][_0x381e10['uniqueid']])_0x5744df=this[_0xf40a('0x1c')][_0x381e10['uniqueid']][_0xf40a('0x6b')];else if(this['channels'][_0x381e10[_0xf40a('0x3c')]])_0x5744df=this[_0xf40a('0x1c')][_0x381e10[_0xf40a('0x3c')]]['routealias'];logger[_0xf40a('0x39')](_0xf40a('0x6c'),_0x381e10['uniqueid'],util[_0xf40a('0x31')]({'destaccountcode':this['agents'][_0x381e10[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x381e10[_0xf40a('0x42')],'routealias':_0x5744df},{'showHidden':![],'depth':null}));this[_0xf40a('0x34')](util[_0xf40a('0x4b')](_0xf40a('0x45'),this[_0xf40a('0x1d')][_0x381e10['channel']['split']('-')[0x0]][_0xf40a('0x46')]),_0xf40a('0x47'),{'destaccountcode':this[_0xf40a('0x1d')][_0x381e10[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x50')],'destconnectedlinenum':_0x381e10[_0xf40a('0x42')],'routealias':_0x5744df});}}}}catch(_0xf8f509){logger['error'](_0xf40a('0x6d'),_0x381e10[_0xf40a('0x3b')],util['inspect'](_0xf8f509,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0x6e')]=function(_0x41fe8e,_0x1d2c26){try{if(this[_0xf40a('0x1c')][_0x41fe8e]){logger[_0xf40a('0x56')](_0xf40a('0x6f'),_0x41fe8e,_0x1d2c26);this[_0xf40a('0x1c')][_0x41fe8e]['monitor']=!![];if(_[_0xf40a('0x70')](_0x1d2c26,_0xf40a('0x71'))){_0x1d2c26=_0x1d2c26[_0xf40a('0x72')]('.wav49',_0xf40a('0x73'));}this[_0xf40a('0x1c')][_0x41fe8e][_0xf40a('0x74')]=_0x1d2c26;var _0x2b378a=_['find'](this[_0xf40a('0x1c')][_0x41fe8e][_0xf40a('0x75')],{'filename':_0x1d2c26});if(_[_0xf40a('0x76')](_0x2b378a)){this[_0xf40a('0x1c')][_0x41fe8e][_0xf40a('0x75')]['push']({'filename':_0x1d2c26,'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xf40a('0x77')});}}}catch(_0x40031f){logger[_0xf40a('0x2f')](_0xf40a('0x78'),_0x41fe8e,util[_0xf40a('0x31')](_0x40031f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf40a('0x25')]=function(_0x26b46a){try{if(this[_0xf40a('0x35')](_0x26b46a)){logger[_0xf40a('0x39')]('[%s][voiceCallReport][varset]\x20event:',_0x26b46a['uniqueid'],util['inspect'](_0x26b46a,{'showHidden':![],'depth':null}));if(this[_0xf40a('0x1c')][_0x26b46a[_0xf40a('0x3b')]]&&_0x26b46a[_0xf40a('0x41')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x26b46a['variable'])){if(this['isNotNull'](_0x26b46a[_0xf40a('0x79')]['mixmonitor_filename'])){logger[_0xf40a('0x56')](_0xf40a('0x7a'),_0x26b46a['uniqueid'],_0x26b46a[_0xf40a('0x7b')]);this['syncMixMonitorFilename'](_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')]);}else if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')]['xmd-phone'])){logger[_0xf40a('0x56')](_0xf40a('0x7c'),_0x26b46a[_0xf40a('0x3b')],_0x26b46a['value']);this['channels'][_0x26b46a[_0xf40a('0x3b')]]['calleridnum']=_0x26b46a[_0xf40a('0x7b')];}else if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')][_0xf40a('0x7d')])){logger['info'](_0xf40a('0x7e'),_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a['uniqueid']]['callerid']=_0x26b46a[_0xf40a('0x7b')];}else if(this[_0xf40a('0x35')](_0x26b46a['variable']['xmd-cdrtype'])){logger[_0xf40a('0x56')](_0xf40a('0x7f'),_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a[_0xf40a('0x3b')]]['type']=_0x26b46a[_0xf40a('0x7b')];}else if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')]['xmd-queue'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')][_0xf40a('0x44')](',')[0x0]);this['channels'][_0x26b46a['uniqueid']][_0xf40a('0xf')]=_0x26b46a[_0xf40a('0x7b')]['split'](',')[0x0];}else if(this['isNotNull'](_0x26b46a[_0xf40a('0x79')][_0xf40a('0x80')])){logger[_0xf40a('0x56')](_0xf40a('0x81'),_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a[_0xf40a('0x3b')]]['originatecalleridnum']=_0x26b46a[_0xf40a('0x7b')];}else if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')][_0xf40a('0x82')])){logger[_0xf40a('0x56')](_0xf40a('0x83'),_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a[_0xf40a('0x3b')]][_0xf40a('0x84')]=_0x26b46a[_0xf40a('0x7b')];}else if(this[_0xf40a('0x35')](_0x26b46a['variable'][_0xf40a('0x85')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x26b46a['uniqueid'],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a[_0xf40a('0x3b')]]['calleridpreview']=_0x26b46a[_0xf40a('0x7b')];}else if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')]['xmcs-queue'])){logger['info'](_0xf40a('0x86'),_0x26b46a['uniqueid'],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a['uniqueid']][_0xf40a('0xf')]=_0x26b46a[_0xf40a('0x7b')];}else if(this['isNotNull'](_0x26b46a[_0xf40a('0x79')][_0xf40a('0x87')])){logger[_0xf40a('0x56')](_0xf40a('0x88'),_0x26b46a[_0xf40a('0x3b')],_0x26b46a[_0xf40a('0x7b')]);this['channels'][_0x26b46a[_0xf40a('0x3b')]]['sipcalluniqueid']=_0x26b46a['value'];}}}else if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')][_0xf40a('0x89')])){if(_0x26b46a['value']){var _0x29ddc7=path[_0xf40a('0x8a')](_0x26b46a[_0xf40a('0x7b')])[_0xf40a('0x46')];logger['info'](_0xf40a('0x7a'),_0x29ddc7,_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x6e')](_0x29ddc7,_0x26b46a['value']);}}else if(this[_0xf40a('0x1c')][_0x26b46a[_0xf40a('0x3c')]]){if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')])){if(this[_0xf40a('0x35')](_0x26b46a[_0xf40a('0x79')][_0xf40a('0x87')])){logger['info'](_0xf40a('0x88'),_0x26b46a[_0xf40a('0x3c')],_0x26b46a[_0xf40a('0x7b')]);this[_0xf40a('0x1c')][_0x26b46a['linkedid']]['sipcalllinkedid']=_0x26b46a[_0xf40a('0x7b')];}}}}}catch(_0x509c58){logger[_0xf40a('0x2f')](_0xf40a('0x8b'),_0x26b46a[_0xf40a('0x3b')],util['inspect'](_0x509c58,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0x26')]=function(_0x407773){try{if(this[_0xf40a('0x35')](_0x407773)){logger[_0xf40a('0x39')](_0xf40a('0x8c'),_0x407773[_0xf40a('0x3b')],util['inspect'](_0x407773,{'showHidden':![],'depth':null}));if(this['channels'][_0x407773['uniqueid']]){logger[_0xf40a('0x56')](_0xf40a('0x8d'),_0x407773[_0xf40a('0x3b')],_0x407773[_0xf40a('0x8e')]);var _0x52968f=moment();this[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x8f')]=_0x52968f[_0xf40a('0x4b')](_0xf40a('0x4c'));this[_0xf40a('0x1c')][_0x407773['uniqueid']][_0xf40a('0x58')]=_0x52968f[_0xf40a('0x64')](this[_0xf40a('0x1c')][_0x407773['uniqueid']][_0xf40a('0x90')],_0xf40a('0x59'));if(this[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x61')]){this[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x91')]=_0x52968f[_0xf40a('0x64')](this[_0xf40a('0x1c')][_0x407773['uniqueid']][_0xf40a('0x62')],'seconds');this[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x63')]=this[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x58')]-this[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]]['billableseconds'];}if(_0x407773[_0xf40a('0x3f')]===_0xf40a('0x40')){if(this['agents'][_0x407773[_0xf40a('0x41')]['split']('-')[0x0]]){this['agents'][_0x407773[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]=_[_0xf40a('0x92')](this[_0xf40a('0x1d')][_0x407773['channel']['split']('-')[0x0]],[_0xf40a('0x4f')]);logger[_0xf40a('0x39')](_0xf40a('0x93'),_0x407773['uniqueid'],util['inspect']({'id':this[_0xf40a('0x1d')][_0x407773['channel'][_0xf40a('0x44')]('-')[0x0]]['id'],'destaccountcode':this[_0xf40a('0x1d')][_0x407773[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0xf40a('0x34')](util[_0xf40a('0x4b')](_0xf40a('0x45'),this[_0xf40a('0x1d')][_0x407773[_0xf40a('0x41')]['split']('-')[0x0]][_0xf40a('0x46')]),'user:agentcomplete',{'id':this[_0xf40a('0x1d')][_0x407773[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]]['id'],'destaccountcode':this[_0xf40a('0x1d')][_0x407773[_0xf40a('0x41')][_0xf40a('0x44')]('-')[0x0]][_0xf40a('0x50')]});}}var _0xde10c7=this;Promise['resolve']()[_0xf40a('0x94')](function(){var _0x505fc9=_0xde10c7[_0xf40a('0x1c')][_0x407773['uniqueid']];if(typeof _0x505fc9['transferType']==='undefined')return;if(_[_0xf40a('0x95')](_0x505fc9['monitors']))return;return RpcSetting[_0xf40a('0x96')]()['then'](function(_0x31dcfa){if(!_0x31dcfa['stopRecordingOnTransfer'])return;return Promise[_0xf40a('0x97')]()['then'](function(){return ami[_0xf40a('0x98')]({'action':'StopMixMonitor','channel':_0x505fc9['channel']})['catch'](function(){});})[_0xf40a('0x94')](function(){return ami[_0xf40a('0x98')]({'action':_0xf40a('0x99'),'channel':_0x505fc9[_0xf40a('0x67')]})[_0xf40a('0x9a')](function(){})[_0xf40a('0x9b')](function(){var _0x4451f1=_0xde10c7[_0xf40a('0x1d')][_0x505fc9['destinationchannel']['split']('-')[0x0]];if(!_0x4451f1)return;io[_0xf40a('0x34')](_0xf40a('0x9c'),{'agentId':_0x4451f1['id'],'uniqueid':_0x505fc9[_0xf40a('0x3b')]});});});});})[_0xf40a('0x94')](function(){if(_0x407773[_0xf40a('0x9d')]==='BlindTransfer'){_0xde10c7['blindTransfers'][_0x407773[_0xf40a('0x3b')]]=_0xde10c7[_0xf40a('0x1c')][_0x407773['uniqueid']];}else{if(_0xde10c7[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x9e')]===_0xf40a('0x9f')&&_0xde10c7[_0xf40a('0x1e')][_0x407773[_0xf40a('0x3b')]]){_0xde10c7[_0xf40a('0x1c')][_0x407773['uniqueid']][_0xf40a('0x3b')]=[_0xde10c7[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]][_0xf40a('0x3c')],_0xde10c7[_0xf40a('0x1c')][_0x407773['uniqueid']][_0xf40a('0x3c')]=_0xde10c7[_0xf40a('0x1c')][_0x407773['uniqueid']][_0xf40a('0x3b')]][0x0];delete _0xde10c7['blindTransfers'][_0x407773[_0xf40a('0x3b')]];}}logger[_0xf40a('0x39')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x407773[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0xde10c7[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]],{'showHidden':![],'depth':null}));ami[_0xf40a('0x34')]('custom:voiceCallReport',_0xde10c7[_0xf40a('0x1c')][_0x407773['uniqueid']]);delete _0xde10c7[_0xf40a('0x1c')][_0x407773[_0xf40a('0x3b')]];});}}}catch(_0x5bc9d1){logger[_0xf40a('0x2f')](_0xf40a('0xa0'),_0x407773['uniqueid'],util[_0xf40a('0x31')](_0x5bc9d1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0xa1')]=function(_0x5d531d){try{if(this[_0xf40a('0x35')](_0x5d531d)){logger[_0xf40a('0x56')](_0xf40a('0xa2'),_0x5d531d[_0xf40a('0x3b')],_0x5d531d[_0xf40a('0xa3')],_0x5d531d[_0xf40a('0xa4')]);logger[_0xf40a('0x39')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x5d531d[_0xf40a('0x3b')],util['inspect'](_0x5d531d,{'showHidden':![],'depth':null}));if(this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa5')]]){this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa5')]][_0xf40a('0xa6')]=_0x5d531d[_0xf40a('0xa3')];this[_0xf40a('0x1c')][_0x5d531d['transfereeuniqueid']][_0xf40a('0xa7')]=_0x5d531d[_0xf40a('0xa4')];if(this['channels'][_0x5d531d[_0xf40a('0xa8')]]){var _0x3e7669=this['channels'][_0x5d531d[_0xf40a('0xa8')]];this[_0xf40a('0x1c')][_0x5d531d['secondtransfereruniqueid']]=this['channels'][_0x5d531d[_0xf40a('0xa5')]];this['channels'][_0x5d531d['transfereeuniqueid']]=_0x3e7669;}}else if(this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa9')]]){this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa9')]][_0xf40a('0xa6')]=_0x5d531d[_0xf40a('0xa3')];this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa9')]][_0xf40a('0xa7')]=_0x5d531d[_0xf40a('0xa4')];if(this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xaa')]]){var _0x3e7669=this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xaa')]];this[_0xf40a('0x1c')][_0x5d531d['origtransfereruniqueid']]=this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa9')]];this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa9')]]=_0x3e7669;}}if((this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xaa')]]||this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xab')]])&&this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa8')]]){var _0x14d05b=_['some']([this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xaa')]],this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xab')]],this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xa8')]]],function(_0x466633){return _0x466633&&_0x466633[_0xf40a('0x9e')]==='outbound'&&_0x466633[_0xf40a('0xac')];});if(_0x14d05b){if(this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xaa')]])this[_0xf40a('0x1c')][_0x5d531d[_0xf40a('0xaa')]][_0xf40a('0xad')]=_0xf40a('0xae');if(this[_0xf40a('0x1c')][_0x5d531d['origtransfererlinkedid']])this[_0xf40a('0x1c')][_0x5d531d['origtransfererlinkedid']][_0xf40a('0xad')]=_0xf40a('0xae');this[_0xf40a('0x1c')][_0x5d531d['secondtransfereruniqueid']]['transferType']=_0xf40a('0xae');}}}}catch(_0x368506){logger[_0xf40a('0x2f')](_0xf40a('0xaf'),_0x5d531d[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x368506,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0x29')]=function(_0x26d35f){try{if(this[_0xf40a('0x35')](_0x26d35f)){logger[_0xf40a('0x56')]('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x26d35f[_0xf40a('0x3b')],_0x26d35f[_0xf40a('0xb0')],_0x26d35f[_0xf40a('0xb1')]);logger[_0xf40a('0x39')](_0xf40a('0xb2'),_0x26d35f[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x26d35f,{'showHidden':![],'depth':null}));if(this[_0xf40a('0x1c')][_0x26d35f[_0xf40a('0xa5')]]){this['channels'][_0x26d35f['transfereeuniqueid']][_0xf40a('0xa6')]=_0x26d35f['transfereecalleridnum'];this[_0xf40a('0x1c')][_0x26d35f[_0xf40a('0xa5')]]['transferconnectedlinenum']=_0x26d35f[_0xf40a('0xb1')];this[_0xf40a('0x1c')][_0x26d35f[_0xf40a('0xa5')]][_0xf40a('0xad')]=_0xf40a('0xb3');this['syncHangup']({'event':_0xf40a('0xb4'),'uniqueid':_0x26d35f['transfereeuniqueid'],'context':_0x26d35f[_0xf40a('0x3f')],'channel':_0x26d35f[_0xf40a('0xb5')]});}else{this[_0xf40a('0x1c')][_0x26d35f[_0xf40a('0xb6')]][_0xf40a('0xad')]=_0xf40a('0xb3');}}}catch(_0x13c8b6){logger[_0xf40a('0x2f')](_0xf40a('0xb7'),_0x26d35f[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x13c8b6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x4b3b1c){try{if(this[_0xf40a('0x35')](_0x4b3b1c)){logger[_0xf40a('0x39')](_0xf40a('0xb8'),_0x4b3b1c[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x4b3b1c,{'showHidden':![],'depth':null}));if(this[_0xf40a('0x1c')][_0x4b3b1c['uniqueid']]){if(!_[_0xf40a('0x76')](this[_0xf40a('0x1c')][_0x4b3b1c[_0xf40a('0x3b')]]['answertime'])){this[_0xf40a('0x1c')][_0x4b3b1c[_0xf40a('0x3b')]]['mohstarttime']=moment()['format'](_0xf40a('0x4c'));logger['info'](_0xf40a('0xb9'),_0x4b3b1c[_0xf40a('0x3b')],this[_0xf40a('0x1c')][_0x4b3b1c[_0xf40a('0x3b')]]['mohstarttime']);}}}}catch(_0x44fd75){logger[_0xf40a('0x2f')](_0xf40a('0xba'),_0x4b3b1c['uniqueid'],util[_0xf40a('0x31')](_0x44fd75,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf40a('0x32')][_0xf40a('0xbb')]=function(_0x5c1ef3){try{if(this[_0xf40a('0x35')](_0x5c1ef3)){logger[_0xf40a('0x39')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5c1ef3[_0xf40a('0x3b')],util[_0xf40a('0x31')](_0x5c1ef3,{'showHidden':![],'depth':null}));if(this[_0xf40a('0x1c')][_0x5c1ef3['uniqueid']]){if(!_['isNil'](this[_0xf40a('0x1c')][_0x5c1ef3['uniqueid']][_0xf40a('0xbc')])){this[_0xf40a('0x1c')][_0x5c1ef3[_0xf40a('0x3b')]][_0xf40a('0xbd')]+=moment()[_0xf40a('0xbe')](0x0)[_0xf40a('0x64')](this['channels'][_0x5c1ef3[_0xf40a('0x3b')]]['mohstarttime'],_0xf40a('0x59'));logger[_0xf40a('0x56')](_0xf40a('0xbf'),_0x5c1ef3[_0xf40a('0x3b')],this['channels'][_0x5c1ef3[_0xf40a('0x3b')]][_0xf40a('0xbd')]);delete this[_0xf40a('0x1c')][_0x5c1ef3[_0xf40a('0x3b')]][_0xf40a('0xbc')];}}}}catch(_0x5ba760){logger[_0xf40a('0x2f')]('[%s][voiceCallReport][musiconholdstop]',_0x5c1ef3['uniqueid'],util[_0xf40a('0x31')](_0x5ba760,{'showHidden':![],'depth':null}));}};module[_0xf40a('0xc0')]=VoiceCallReport;
\ No newline at end of file
index 8d5ff2b..f97fdc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0012=['outbound','applications','dialbegin','syncDialBegin','bind','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','info','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','answertime','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepeer','membercalls','memberdynamic','memberpenalty','includes','variables','[%s][voiceDialReport][hangup]\x20event:','cause-txt','duration','endtime','diff','starttime','seconds','lastevent','complete','answered','billableseconds','sumHoldTime','holdtime','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','set','applicationdata','appdata','toLowerCase','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','exports','lodash','moment','ioredis','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','channels'];(function(_0x5c3179,_0x5272f2){var _0x525863=function(_0x17afbc){while(--_0x17afbc){_0x5c3179['push'](_0x5c3179['shift']());}};_0x525863(++_0x5272f2);}(_0x0012,0x1f4));var _0x2001=function(_0x536e31,_0x8101da){_0x536e31=_0x536e31-0x0;var _0x2b23bb=_0x0012[_0x536e31];return _0x2b23bb;};'use strict';var _=require(_0x2001('0x0'));var moment=require(_0x2001('0x1'));var util=require('util');var Redis=require(_0x2001('0x2'));var config=require('../../../config/environment');var logger=require(_0x2001('0x3'))(_0x2001('0x4'));var ami=require('../ami');config[_0x2001('0x5')]=_[_0x2001('0x6')](config[_0x2001('0x5')],{'host':_0x2001('0x7'),'port':0x18eb});var io=require(_0x2001('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x3a3b56){this[_0x2001('0x9')]=_0x3a3b56['outboundChannels'];this[_0x2001('0xa')]=_0x3a3b56[_0x2001('0xa')];this[_0x2001('0xb')]={};this['variables']={};ami['on'](_0x2001('0xc'),this[_0x2001('0xd')][_0x2001('0xe')](this));ami['on']('dialend',this[_0x2001('0xf')][_0x2001('0xe')](this));ami['on'](_0x2001('0x10'),this[_0x2001('0x11')][_0x2001('0xe')](this));ami['on'](_0x2001('0x12'),this[_0x2001('0x13')]['bind'](this));ami['on'](_0x2001('0x14'),this[_0x2001('0x15')][_0x2001('0xe')](this));}VoiceDialReport['prototype'][_0x2001('0x16')]=function(_0x3f72d0){return _0x3f72d0!==null&&!_[_0x2001('0x17')](_0x3f72d0);};VoiceDialReport[_0x2001('0x18')][_0x2001('0x19')]=function(_0x182ab5,_0x5637eb,_0xad73b6){io['to'](_0x182ab5)[_0x2001('0x19')](_0x5637eb,_0xad73b6);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x394c8c){try{if(this['isNotNull'](_0x394c8c)){logger['debug'](_0x2001('0x1a'),_0x394c8c[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x394c8c,{'showHidden':![],'depth':null}));if(this['channels'][_0x394c8c[_0x2001('0x1b')]]){_[_0x2001('0x1d')](this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]],{'starttime':moment()[_0x2001('0x1e')](_0x2001('0x1f')),'lastevent':'called','interface':_0x394c8c[_0x2001('0x20')][_0x2001('0x21')](0x0,_0x394c8c[_0x2001('0x20')][_0x2001('0x22')]('-')),'membername':_0x394c8c[_0x2001('0x20')]['substring'](_0x394c8c[_0x2001('0x20')]['lastIndexOf']('/')+0x1,_0x394c8c[_0x2001('0x20')]['lastIndexOf']('-'))},_[_0x2001('0x23')](_0x394c8c,['event','privilege']));logger[_0x2001('0x24')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x394c8c['uniqueid'],this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]][_0x2001('0x25')],this['channels'][_0x394c8c['uniqueid']][_0x2001('0x26')]);logger['debug'](_0x2001('0x27'),_0x394c8c[_0x2001('0x1b')],util[_0x2001('0x1c')](this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x2001('0xb')][_0x394c8c['uniqueid']])_[_0x2001('0x1d')](this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]],this['applications'][_0x394c8c[_0x2001('0x1b')]]);this['emit']('voice:outbound',_0x2001('0x28'),this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]]);logger[_0x2001('0x29')](_0x2001('0x2a'),_0x394c8c[_0x2001('0x1b')],util[_0x2001('0x1c')](this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x2001('0x19')]('custom:dialbegin',this[_0x2001('0x9')][_0x394c8c[_0x2001('0x1b')]]);}}}catch(_0x26cf40){logger[_0x2001('0x2b')](_0x2001('0x2c'),_0x394c8c[_0x2001('0x1b')],util['inspect'](_0x26cf40,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2001('0x18')][_0x2001('0xf')]=function(_0x3583aa){try{if(this[_0x2001('0x16')](_0x3583aa)){logger[_0x2001('0x29')]('[%s][voiceDialReport][dialend]\x20event:',_0x3583aa[_0x2001('0x1b')],util['inspect'](_0x3583aa,{'showHidden':![],'depth':null}));if(this['channels'][_0x3583aa[_0x2001('0x1b')]]){this['channels'][_0x3583aa[_0x2001('0x1b')]]['dialstatus']=_0x3583aa['dialstatus'];if(_0x3583aa[_0x2001('0x2d')]==='ANSWER'){this[_0x2001('0x9')][_0x3583aa[_0x2001('0x1b')]]['connectedlinenum']=_0x3583aa[_0x2001('0x2e')];this[_0x2001('0x9')][_0x3583aa[_0x2001('0x1b')]][_0x2001('0x2f')]=_0x3583aa[_0x2001('0x2f')];this[_0x2001('0x9')][_0x3583aa['uniqueid']][_0x2001('0x30')]=moment()['format'](_0x2001('0x1f'));this['channels'][_0x3583aa[_0x2001('0x1b')]]['lastevent']='connect';logger[_0x2001('0x24')](_0x2001('0x31'),_0x3583aa[_0x2001('0x1b')],_0x3583aa[_0x2001('0x20')][_0x2001('0x21')](_0x3583aa[_0x2001('0x20')][_0x2001('0x22')]('/')+0x1,_0x3583aa['channel'][_0x2001('0x22')]('-')));logger[_0x2001('0x29')](_0x2001('0x32'),_0x3583aa[_0x2001('0x1b')],util[_0x2001('0x1c')](this['channels'][_0x3583aa['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x2001('0x19')](_0x2001('0x33'),this[_0x2001('0x9')][_0x3583aa[_0x2001('0x1b')]]);}logger[_0x2001('0x29')](_0x2001('0x34'),_0x3583aa[_0x2001('0x1b')],util[_0x2001('0x1c')](this['channels'][_0x3583aa['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x2001('0x35'),_0x2001('0x28'),this[_0x2001('0x9')][_0x3583aa[_0x2001('0x1b')]]);}}}catch(_0x5c407b){logger[_0x2001('0x2b')]('[%s][voiceDialReport][dialend]',_0x3583aa[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x5c407b,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x2001('0x11')]=function(_0x3207ac){try{if(this['isNotNull'](_0x3207ac)){logger[_0x2001('0x29')]('[%s][voiceDialReport][varset]\x20event:',_0x3207ac['uniqueid'],util[_0x2001('0x1c')](_0x3207ac,{'showHidden':![],'depth':null}));this[_0x2001('0x36')](_0x3207ac[_0x2001('0x1b')],_[_0x2001('0x37')](_0x3207ac[_0x2001('0x38')])[0x0],_0x3207ac[_0x2001('0x39')]);if(this['isNotNull'](_0x3207ac[_0x2001('0x38')])&&this[_0x2001('0x16')](_0x3207ac[_0x2001('0x38')][_0x2001('0x3a')])){if(_[_0x2001('0x17')](this['channels'][_0x3207ac['uniqueid']])){this['channels'][_0x3207ac['uniqueid']]={'routeId':_0x3207ac[_0x2001('0x39')],'variables':this['variables'][_0x3207ac[_0x2001('0x1b')]]};logger[_0x2001('0x24')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0x3207ac['uniqueid'],_0x3207ac[_0x2001('0x38')][_0x2001('0x3a')],_[_0x2001('0x37')](_0x3207ac[_0x2001('0x38')])[0x0],_0x3207ac[_0x2001('0x39')]);logger[_0x2001('0x29')](_0x2001('0x3b'),_0x3207ac[_0x2001('0x1b')],util['inspect'](this['channels'][_0x3207ac[_0x2001('0x1b')]],{'showHidden':![],'depth':null}));this[_0x2001('0x19')](_0x2001('0x35'),_0x2001('0x28'),this[_0x2001('0x9')][_0x3207ac[_0x2001('0x1b')]]);}}}}catch(_0x374c96){logger[_0x2001('0x2b')]('[%s][voiceDialReport][varset]',_0x3207ac[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x374c96,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2001('0x18')][_0x2001('0x36')]=function(_0x2b7b90,_0x4003a8,_0x2d3ecf){var _0x1737e0=[_0x2001('0x3c'),'rtpaudioqosbridged',_0x2001('0x3d'),_0x2001('0x3e'),_0x2001('0x3f'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri',_0x2001('0x40'),'bridgepvtcallid',_0x2001('0x41'),_0x2001('0x42'),'memberinterface','memberlastcall',_0x2001('0x25'),_0x2001('0x43'),'memberrealtime'];if(!_['isNil'](_0x4003a8)&&!_[_0x2001('0x44')](_0x1737e0,_0x4003a8)){if(_[_0x2001('0x17')](this[_0x2001('0x45')][_0x2b7b90])){this[_0x2001('0x45')][_0x2b7b90]={};}this['variables'][_0x2b7b90][_0x4003a8]=_0x2d3ecf;}};VoiceDialReport[_0x2001('0x18')][_0x2001('0x15')]=function(_0x533cd5){try{if(this[_0x2001('0x16')](_0x533cd5)){logger['debug'](_0x2001('0x46'),_0x533cd5[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x533cd5,{'showHidden':![],'depth':null}));if(this[_0x2001('0x9')][_0x533cd5['uniqueid']]){logger[_0x2001('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x533cd5[_0x2001('0x1b')],_0x533cd5[_0x2001('0x47')]);this['channels'][_0x533cd5['uniqueid']]['endtime']=moment()[_0x2001('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x48')]=moment(this[_0x2001('0x9')][_0x533cd5['uniqueid']][_0x2001('0x49')])[_0x2001('0x4a')](this[_0x2001('0x9')][_0x533cd5['uniqueid']][_0x2001('0x4b')],_0x2001('0x4c'));this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x4d')]=_0x2001('0x4e');this[_0x2001('0xa')]['total']+=0x1;if(this['channels'][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x30')]){this[_0x2001('0xa')][_0x2001('0x4f')]+=0x1;this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]]['holdtime']=moment(this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x30')])[_0x2001('0x4a')](this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x4b')],_0x2001('0x4c'));this['channels'][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x50')]=moment(this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x49')])[_0x2001('0x4a')](this[_0x2001('0x9')][_0x533cd5['uniqueid']][_0x2001('0x30')],_0x2001('0x4c'));this['outbound'][_0x2001('0x51')]+=this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x52')]||0x0;this['outbound']['sumBillable']+=this['channels'][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x50')];}this['outbound']['sumDuration']+=this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]][_0x2001('0x48')];logger[_0x2001('0x29')](_0x2001('0x53'),_0x533cd5[_0x2001('0x1b')],util[_0x2001('0x1c')](this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x2001('0x19')](_0x2001('0x54'),this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x533cd5[_0x2001('0x1b')],util[_0x2001('0x1c')](this[_0x2001('0x9')][_0x533cd5['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x2001('0x19')](_0x2001('0x55'),this['channels'][_0x533cd5[_0x2001('0x1b')]]);logger[_0x2001('0x29')](_0x2001('0x56'),_0x533cd5[_0x2001('0x1b')],util[_0x2001('0x1c')](this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]],{'showHidden':![],'depth':null}));this['emit'](_0x2001('0x35'),_0x2001('0x57'),this['outbound']);logger[_0x2001('0x24')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON['stringify'](this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]]));logger[_0x2001('0x29')](_0x2001('0x58'),_0x533cd5[_0x2001('0x1b')],util[_0x2001('0x1c')](this[_0x2001('0x9')][_0x533cd5[_0x2001('0x1b')]],{'showHidden':![],'depth':null}));this[_0x2001('0x19')](_0x2001('0x35'),_0x2001('0x59'),this['channels'][_0x533cd5['uniqueid']]);delete this['channels'][_0x533cd5[_0x2001('0x1b')]];}else if(this['channels'][_0x533cd5[_0x2001('0x5a')]]){this[_0x2001('0x9')][_0x533cd5[_0x2001('0x5a')]][_0x2001('0x1b')]=this['channels'][_0x533cd5['linkedid']][_0x2001('0x5b')];}if(this['variables'][_0x533cd5[_0x2001('0x1b')]]){delete this[_0x2001('0x45')][_0x533cd5[_0x2001('0x1b')]];}}}catch(_0x1bdbe6){logger[_0x2001('0x2b')](_0x2001('0x5c'),_0x533cd5[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x1bdbe6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2001('0x18')]['syncNewExten']=function(_0x58d5e9){try{if(this['isNotNull'](_0x58d5e9)){logger[_0x2001('0x29')](_0x2001('0x5d'),_0x58d5e9[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x58d5e9,{'showHidden':![],'depth':null}));if(_0x58d5e9['application']['toLowerCase']()===_0x2001('0x5e')){_0x58d5e9[_0x2001('0x5f')]=(_0x58d5e9[_0x2001('0x60')]||_0x58d5e9[_0x2001('0x5f')])[_0x2001('0x61')]();if(_['startsWith'](_0x58d5e9['applicationdata'],_0x2001('0x62'))){if(_[_0x2001('0x17')](this[_0x2001('0xb')][_0x58d5e9['uniqueid']]))this[_0x2001('0xb')][_0x58d5e9[_0x2001('0x1b')]]={};logger[_0x2001('0x24')](_0x2001('0x63'),_0x58d5e9[_0x2001('0x1b')],_0x58d5e9['application'],_0x58d5e9[_0x2001('0x5f')]);var _0x490265=_0x58d5e9[_0x2001('0x5f')]['split']('=');var _0x26da82=_0x490265[0x0][_0x2001('0x64')](/cdr\((.*)\)/);if(_0x26da82)this[_0x2001('0xb')][_0x58d5e9['uniqueid']][_0x26da82[0x1]]=_0x490265[0x1];}}}}catch(_0x19b5fc){logger[_0x2001('0x2b')]('[%s][voiceDialReport][newexten]',_0x58d5e9[_0x2001('0x1b')],util[_0x2001('0x1c')](_0x19b5fc,{'showHidden':![],'depth':null}));}};module[_0x2001('0x65')]=VoiceDialReport;
\ No newline at end of file
+var _0x4be0=['isNotNull','isUndefined','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','merge','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','dialstatus','connectedlinenum','connectedlinename','connect','info','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','sipuri','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','endtime','diff','starttime','lastevent','complete','total','answertime','answered','holdtime','billableseconds','seconds','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','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outbound','applications','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','newexten','hangup','syncHangup','prototype'];(function(_0x14000b,_0x8e0c9c){var _0x1513a0=function(_0x59c06b){while(--_0x59c06b){_0x14000b['push'](_0x14000b['shift']());}};_0x1513a0(++_0x8e0c9c);}(_0x4be0,0x152));var _0x04be=function(_0x4943bf,_0x8509f9){_0x4943bf=_0x4943bf-0x0;var _0xdd22b0=_0x4be0[_0x4943bf];return _0xdd22b0;};'use strict';var _=require(_0x04be('0x0'));var moment=require(_0x04be('0x1'));var util=require('util');var Redis=require(_0x04be('0x2'));var config=require(_0x04be('0x3'));var logger=require(_0x04be('0x4'))(_0x04be('0x5'));var ami=require(_0x04be('0x6'));config['redis']=_[_0x04be('0x7')](config[_0x04be('0x8')],{'host':_0x04be('0x9'),'port':0x18eb});var io=require(_0x04be('0xa'))(new Redis(config[_0x04be('0x8')]));function VoiceDialReport(_0x46be91){this[_0x04be('0xb')]=_0x46be91['outboundChannels'];this[_0x04be('0xc')]=_0x46be91[_0x04be('0xc')];this[_0x04be('0xd')]={};this[_0x04be('0xe')]={};ami['on'](_0x04be('0xf'),this['syncDialBegin'][_0x04be('0x10')](this));ami['on'](_0x04be('0x11'),this[_0x04be('0x12')][_0x04be('0x10')](this));ami['on'](_0x04be('0x13'),this[_0x04be('0x14')][_0x04be('0x10')](this));ami['on'](_0x04be('0x15'),this['syncNewExten'][_0x04be('0x10')](this));ami['on'](_0x04be('0x16'),this[_0x04be('0x17')][_0x04be('0x10')](this));}VoiceDialReport[_0x04be('0x18')][_0x04be('0x19')]=function(_0x275700){return _0x275700!==null&&!_[_0x04be('0x1a')](_0x275700);};VoiceDialReport[_0x04be('0x18')]['emit']=function(_0xec8e4b,_0x28a043,_0x2859b3){io['to'](_0xec8e4b)[_0x04be('0x1b')](_0x28a043,_0x2859b3);};VoiceDialReport[_0x04be('0x18')][_0x04be('0x1c')]=function(_0x482da7){try{if(this[_0x04be('0x19')](_0x482da7)){logger[_0x04be('0x1d')](_0x04be('0x1e'),_0x482da7['uniqueid'],util['inspect'](_0x482da7,{'showHidden':![],'depth':null}));if(this[_0x04be('0xb')][_0x482da7['uniqueid']]){_['merge'](this['channels'][_0x482da7[_0x04be('0x1f')]],{'starttime':moment()[_0x04be('0x20')](_0x04be('0x21')),'lastevent':_0x04be('0x22'),'interface':_0x482da7[_0x04be('0x23')][_0x04be('0x24')](0x0,_0x482da7[_0x04be('0x23')][_0x04be('0x25')]('-')),'membername':_0x482da7[_0x04be('0x23')]['substring'](_0x482da7[_0x04be('0x23')][_0x04be('0x25')]('/')+0x1,_0x482da7['channel'][_0x04be('0x25')]('-'))},_['omit'](_0x482da7,['event',_0x04be('0x26')]));logger['info'](_0x04be('0x27'),_0x482da7['uniqueid'],this['channels'][_0x482da7['uniqueid']][_0x04be('0x28')],this[_0x04be('0xb')][_0x482da7[_0x04be('0x1f')]][_0x04be('0x29')]);logger[_0x04be('0x1d')](_0x04be('0x2a'),_0x482da7[_0x04be('0x1f')],util[_0x04be('0x2b')](this['channels'][_0x482da7[_0x04be('0x1f')]],{'showHidden':![],'depth':null}));if(this[_0x04be('0xd')][_0x482da7[_0x04be('0x1f')]])_[_0x04be('0x2c')](this['channels'][_0x482da7[_0x04be('0x1f')]],this['applications'][_0x482da7['uniqueid']]);this['emit'](_0x04be('0x2d'),_0x04be('0x2e'),this['channels'][_0x482da7['uniqueid']]);logger['debug'](_0x04be('0x2f'),_0x482da7[_0x04be('0x1f')],util[_0x04be('0x2b')](this[_0x04be('0xb')][_0x482da7[_0x04be('0x1f')]],{'showHidden':![],'depth':null}));ami[_0x04be('0x1b')](_0x04be('0x30'),this[_0x04be('0xb')][_0x482da7[_0x04be('0x1f')]]);}}}catch(_0x4b7cbd){logger['error']('[%s][voiceDialReport][dialbegin]',_0x482da7[_0x04be('0x1f')],util[_0x04be('0x2b')](_0x4b7cbd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x04be('0x18')][_0x04be('0x12')]=function(_0x1530a2){try{if(this[_0x04be('0x19')](_0x1530a2)){logger['debug']('[%s][voiceDialReport][dialend]\x20event:',_0x1530a2['uniqueid'],util[_0x04be('0x2b')](_0x1530a2,{'showHidden':![],'depth':null}));if(this[_0x04be('0xb')][_0x1530a2[_0x04be('0x1f')]]){this[_0x04be('0xb')][_0x1530a2[_0x04be('0x1f')]][_0x04be('0x31')]=_0x1530a2['dialstatus'];if(_0x1530a2[_0x04be('0x31')]==='ANSWER'){this[_0x04be('0xb')][_0x1530a2[_0x04be('0x1f')]][_0x04be('0x32')]=_0x1530a2[_0x04be('0x32')];this[_0x04be('0xb')][_0x1530a2[_0x04be('0x1f')]][_0x04be('0x33')]=_0x1530a2['connectedlinename'];this[_0x04be('0xb')][_0x1530a2['uniqueid']]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1530a2[_0x04be('0x1f')]]['lastevent']=_0x04be('0x34');logger[_0x04be('0x35')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x1530a2[_0x04be('0x1f')],_0x1530a2[_0x04be('0x23')][_0x04be('0x24')](_0x1530a2[_0x04be('0x23')][_0x04be('0x25')]('/')+0x1,_0x1530a2[_0x04be('0x23')][_0x04be('0x25')]('-')));logger[_0x04be('0x1d')](_0x04be('0x36'),_0x1530a2[_0x04be('0x1f')],util[_0x04be('0x2b')](this[_0x04be('0xb')][_0x1530a2['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x04be('0x37'),this[_0x04be('0xb')][_0x1530a2[_0x04be('0x1f')]]);}logger[_0x04be('0x1d')](_0x04be('0x38'),_0x1530a2[_0x04be('0x1f')],util[_0x04be('0x2b')](this[_0x04be('0xb')][_0x1530a2['uniqueid']],{'showHidden':![],'depth':null}));this[_0x04be('0x1b')](_0x04be('0x2d'),_0x04be('0x2e'),this[_0x04be('0xb')][_0x1530a2[_0x04be('0x1f')]]);}}}catch(_0x478df4){logger[_0x04be('0x39')](_0x04be('0x3a'),_0x1530a2[_0x04be('0x1f')],util[_0x04be('0x2b')](_0x478df4,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x04be('0x18')][_0x04be('0x14')]=function(_0xdfa6bf){try{if(this[_0x04be('0x19')](_0xdfa6bf)){logger[_0x04be('0x1d')]('[%s][voiceDialReport][varset]\x20event:',_0xdfa6bf['uniqueid'],util[_0x04be('0x2b')](_0xdfa6bf,{'showHidden':![],'depth':null}));this[_0x04be('0x3b')](_0xdfa6bf[_0x04be('0x1f')],_[_0x04be('0x3c')](_0xdfa6bf[_0x04be('0x3d')])[0x0],_0xdfa6bf[_0x04be('0x3e')]);if(this[_0x04be('0x19')](_0xdfa6bf[_0x04be('0x3d')])&&this[_0x04be('0x19')](_0xdfa6bf[_0x04be('0x3d')]['outboundrouteid'])){if(_[_0x04be('0x1a')](this[_0x04be('0xb')][_0xdfa6bf[_0x04be('0x1f')]])){this[_0x04be('0xb')][_0xdfa6bf[_0x04be('0x1f')]]={'routeId':_0xdfa6bf['value'],'variables':this['variables'][_0xdfa6bf['uniqueid']]};logger[_0x04be('0x35')]('[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s',_0xdfa6bf[_0x04be('0x1f')],_0xdfa6bf[_0x04be('0x3d')][_0x04be('0x3f')],_['keys'](_0xdfa6bf['variable'])[0x0],_0xdfa6bf[_0x04be('0x3e')]);logger[_0x04be('0x1d')](_0x04be('0x40'),_0xdfa6bf['uniqueid'],util['inspect'](this[_0x04be('0xb')][_0xdfa6bf[_0x04be('0x1f')]],{'showHidden':![],'depth':null}));this[_0x04be('0x1b')]('voice:outbound',_0x04be('0x2e'),this['channels'][_0xdfa6bf['uniqueid']]);}}}}catch(_0x40f62f){logger[_0x04be('0x39')]('[%s][voiceDialReport][varset]',_0xdfa6bf[_0x04be('0x1f')],util[_0x04be('0x2b')](_0x40f62f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x04be('0x18')][_0x04be('0x3b')]=function(_0x48fe26,_0x443e82,_0x4a7d63){var _0x4822a7=[_0x04be('0x41'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x04be('0x42'),_0x04be('0x43'),_0x04be('0x44'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x04be('0x45'),_0x04be('0x46'),'bridgepeer','bridgepvtcallid',_0x04be('0x47'),_0x04be('0x48'),_0x04be('0x49'),_0x04be('0x4a'),_0x04be('0x28'),_0x04be('0x4b'),'memberrealtime'];if(!_[_0x04be('0x4c')](_0x443e82)&&!_[_0x04be('0x4d')](_0x4822a7,_0x443e82)){if(_[_0x04be('0x1a')](this[_0x04be('0xe')][_0x48fe26])){this[_0x04be('0xe')][_0x48fe26]={};}this[_0x04be('0xe')][_0x48fe26][_0x443e82]=_0x4a7d63;}};VoiceDialReport[_0x04be('0x18')][_0x04be('0x17')]=function(_0x47a4fe){try{if(this[_0x04be('0x19')](_0x47a4fe)){logger[_0x04be('0x1d')](_0x04be('0x4e'),_0x47a4fe['uniqueid'],util[_0x04be('0x2b')](_0x47a4fe,{'showHidden':![],'depth':null}));if(this[_0x04be('0xb')][_0x47a4fe['uniqueid']]){logger['info'](_0x04be('0x4f'),_0x47a4fe[_0x04be('0x1f')],_0x47a4fe[_0x04be('0x50')]);this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]]['endtime']=moment()['format'](_0x04be('0x21'));this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x51')]=moment(this['channels'][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x52')])[_0x04be('0x53')](this['channels'][_0x47a4fe['uniqueid']][_0x04be('0x54')],'seconds');this['channels'][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x55')]=_0x04be('0x56');this[_0x04be('0xc')][_0x04be('0x57')]+=0x1;if(this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x58')]){this[_0x04be('0xc')][_0x04be('0x59')]+=0x1;this[_0x04be('0xb')][_0x47a4fe['uniqueid']][_0x04be('0x5a')]=moment(this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x58')])['diff'](this[_0x04be('0xb')][_0x47a4fe['uniqueid']][_0x04be('0x54')],'seconds');this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x5b')]=moment(this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x52')])[_0x04be('0x53')](this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x58')],_0x04be('0x5c'));this[_0x04be('0xc')][_0x04be('0x5d')]+=this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x5a')]||0x0;this['outbound'][_0x04be('0x5e')]+=this['channels'][_0x47a4fe[_0x04be('0x1f')]][_0x04be('0x5b')];}this[_0x04be('0xc')][_0x04be('0x5f')]+=this[_0x04be('0xb')][_0x47a4fe['uniqueid']][_0x04be('0x51')];logger[_0x04be('0x1d')](_0x04be('0x60'),_0x47a4fe[_0x04be('0x1f')],util[_0x04be('0x2b')](this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]],{'showHidden':![],'depth':null}));ami[_0x04be('0x1b')](_0x04be('0x61'),this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]]);logger['debug'](_0x04be('0x62'),_0x47a4fe['uniqueid'],util[_0x04be('0x2b')](this[_0x04be('0xb')][_0x47a4fe['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x04be('0x1b')](_0x04be('0x63'),this['channels'][_0x47a4fe[_0x04be('0x1f')]]);logger[_0x04be('0x1d')](_0x04be('0x64'),_0x47a4fe['uniqueid'],util['inspect'](this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x04be('0x65'),this[_0x04be('0xc')]);logger[_0x04be('0x35')](_0x04be('0x66'),JSON[_0x04be('0x67')](this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]]));logger['debug'](_0x04be('0x68'),_0x47a4fe[_0x04be('0x1f')],util[_0x04be('0x2b')](this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x1f')]],{'showHidden':![],'depth':null}));this['emit'](_0x04be('0x2d'),_0x04be('0x69'),this[_0x04be('0xb')][_0x47a4fe['uniqueid']]);delete this['channels'][_0x47a4fe[_0x04be('0x1f')]];}else if(this[_0x04be('0xb')][_0x47a4fe['linkedid']]){this[_0x04be('0xb')][_0x47a4fe[_0x04be('0x6a')]][_0x04be('0x1f')]=this['channels'][_0x47a4fe[_0x04be('0x6a')]][_0x04be('0x6b')];}if(this['variables'][_0x47a4fe['uniqueid']]){delete this['variables'][_0x47a4fe[_0x04be('0x1f')]];}}}catch(_0x19ae55){logger[_0x04be('0x39')](_0x04be('0x6c'),_0x47a4fe[_0x04be('0x1f')],util['inspect'](_0x19ae55,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0xa4a546){try{if(this[_0x04be('0x19')](_0xa4a546)){logger[_0x04be('0x1d')](_0x04be('0x6d'),_0xa4a546[_0x04be('0x1f')],util[_0x04be('0x2b')](_0xa4a546,{'showHidden':![],'depth':null}));if(_0xa4a546['application'][_0x04be('0x6e')]()===_0x04be('0x6f')){_0xa4a546['applicationdata']=(_0xa4a546['appdata']||_0xa4a546[_0x04be('0x70')])[_0x04be('0x6e')]();if(_[_0x04be('0x71')](_0xa4a546[_0x04be('0x70')],_0x04be('0x72'))){if(_['isUndefined'](this[_0x04be('0xd')][_0xa4a546['uniqueid']]))this['applications'][_0xa4a546[_0x04be('0x1f')]]={};logger[_0x04be('0x35')](_0x04be('0x73'),_0xa4a546[_0x04be('0x1f')],_0xa4a546[_0x04be('0x74')],_0xa4a546[_0x04be('0x70')]);var _0xe6ba7=_0xa4a546[_0x04be('0x70')][_0x04be('0x75')]('=');var _0x517487=_0xe6ba7[0x0][_0x04be('0x76')](/cdr\((.*)\)/);if(_0x517487)this[_0x04be('0xd')][_0xa4a546['uniqueid']][_0x517487[0x1]]=_0xe6ba7[0x1];}}}}catch(_0x2324c6){logger[_0x04be('0x39')](_0x04be('0x77'),_0xa4a546[_0x04be('0x1f')],util[_0x04be('0x2b')](_0x2324c6,{'showHidden':![],'depth':null}));}};module[_0x04be('0x78')]=VoiceDialReport;
\ No newline at end of file
index 3cfb6fc..90c2c5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b96=['[%s][voiceQueueReport][checkQueueReport]','syncFullyBooted','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','format','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','loggedIn','sumBillable','sumDuration','talking','abandoned','Trunk','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','Action','queues','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','merge','keys','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexit','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','linkedid','queuecallerexitAt','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','variable','queuestatus','lastevent','timeout','custom:timeout','value','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','includes','[%s][voiceQueueReport][hangup]','length','sumHoldTime','diff','milliseconds','seconds','total','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','set','applicationdata','appdata','CDR(routeAlias)','toLowerCase','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','match','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','clearZombieChannels','switch','isNil','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect'];(function(_0x489696,_0x39503e){var _0x2b5dac=function(_0xbe475e){while(--_0xbe475e){_0x489696['push'](_0x489696['shift']());}};_0x2b5dac(++_0x39503e);}(_0x0b96,0xa5));var _0x60b9=function(_0x59557e,_0x8f9209){_0x59557e=_0x59557e-0x0;var _0x2bfe66=_0x0b96[_0x59557e];return _0x2bfe66;};'use strict';var _=require(_0x60b9('0x0'));var moment=require(_0x60b9('0x1'));var util=require(_0x60b9('0x2'));var md5=require('md5');var Redis=require(_0x60b9('0x3'));var config=require(_0x60b9('0x4'));var logger=require(_0x60b9('0x5'))('ami');var ami=require(_0x60b9('0x6'));var QueueReport=require(_0x60b9('0x7'));config['redis']=_[_0x60b9('0x8')](config[_0x60b9('0x9')],{'host':_0x60b9('0xa'),'port':0x18eb});var io=require(_0x60b9('0xb'))(new Redis(config[_0x60b9('0x9')]));var Sequence=function(){};Sequence[_0x60b9('0xc')][_0x60b9('0xd')]=function(_0x5dd8e8){this[_0x60b9('0xe')]=this['tail']?this['tail'][_0x60b9('0xf')](_0x5dd8e8):_0x5dd8e8();};function VoiceQueueReport(_0x189652){this[_0x60b9('0x10')]=new Sequence();this[_0x60b9('0x11')]={};this['agents']=_0x189652[_0x60b9('0x12')];this[_0x60b9('0x13')]=_0x189652[_0x60b9('0x14')];this['voiceQueues']=_0x189652[_0x60b9('0x15')];this[_0x60b9('0x16')]=!![];this[_0x60b9('0x17')]=_0x189652[_0x60b9('0x17')];this[_0x60b9('0x18')]={};ami['on'](_0x60b9('0x19'),this[_0x60b9('0x1a')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x1c'),this[_0x60b9('0x1d')][_0x60b9('0x1b')](this));ami['on']('queuecallerjoin',this[_0x60b9('0x1e')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x1f'),this[_0x60b9('0x20')][_0x60b9('0x1b')](this));ami['on']('queuecallerleave',this[_0x60b9('0x21')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x22'),this[_0x60b9('0x23')]['bind'](this));ami['on']('agentconnect',this[_0x60b9('0x24')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x25'),this[_0x60b9('0x26')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x27'),this[_0x60b9('0x28')]['bind'](this));ami['on'](_0x60b9('0x29'),this['syncFullyBooted'][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x2a'),this[_0x60b9('0x2b')][_0x60b9('0x1b')](this));ami['on']('musiconholdstart',this[_0x60b9('0x2c')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x2d'),this['syncMusicOnHoldStop'][_0x60b9('0x1b')](this));ami['on']('attendedtransfer',this[_0x60b9('0x2e')][_0x60b9('0x1b')](this));ami['on'](_0x60b9('0x2f'),this[_0x60b9('0x30')][_0x60b9('0x1b')](this));this['loopQueueSummary']();this[_0x60b9('0x31')]();}function clearChannels(_0x1544ef){if(!_[_0x60b9('0x32')](_0x1544ef)){for(var _0x943f74 in _0x1544ef){if(_0x1544ef['hasOwnProperty'](_0x943f74)){delete _0x1544ef[_0x943f74];}}}}function clearCampaigns(_0x375534){if(!_['isEmpty'](_0x375534)){for(var _0xf6fc17 in _0x375534){if(_0x375534[_0x60b9('0x33')](_0xf6fc17)){_0x375534[_0xf6fc17][_0x60b9('0x34')]=0x0;}}}}function clearVoiceQueues(_0x2a0fcb){if(!_[_0x60b9('0x32')](_0x2a0fcb)){for(var _0x42929c in _0x2a0fcb){if(_0x2a0fcb[_0x60b9('0x33')](_0x42929c)){_0x2a0fcb[_0x42929c]['originated']=0x0;_0x2a0fcb[_0x42929c]['talking']=0x0;_0x2a0fcb[_0x42929c][_0x60b9('0x35')]=0x0;_0x2a0fcb[_0x42929c][_0x60b9('0x36')]=0x0;_0x2a0fcb[_0x42929c][_0x60b9('0x37')]=!![];}}}}function clearAgentBooked(_0xb40e96){if(!_['isEmpty'](_0xb40e96)){for(var _0x5b07bc in _0xb40e96){if(_0xb40e96[_0x60b9('0x33')](_0x5b07bc)){_0xb40e96[_0x5b07bc]['unlockRR']=!![];}}}}VoiceQueueReport['prototype'][_0x60b9('0x38')]=function(){var _0x3580af=this;for(var _0xdd2e62 in this[_0x60b9('0x13')]){if(this['channels'][_0x60b9('0x33')](_0xdd2e62)&&!this[_0x60b9('0x13')][_0xdd2e62][_0x60b9('0x39')]){this[_0x60b9('0x10')][_0x60b9('0xd')](function(){if(!_[_0x60b9('0x3a')](_0x3580af[_0x60b9('0x13')][_0xdd2e62])){return ami['Action']({'action':_0x60b9('0x3b'),'channel':_0x3580af[_0x60b9('0x13')][_0xdd2e62][_0x60b9('0x3c')]})[_0x60b9('0x3d')](function(_0x27a82c){if(_0x27a82c[_0x60b9('0x3e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3580af['channels'][_0xdd2e62]){delete _0x3580af[_0x60b9('0x13')][_0xdd2e62];logger[_0x60b9('0x3f')](_0x60b9('0x40'),_0xdd2e62,util[_0x60b9('0x41')](_0x27a82c,{'showHidden':![],'depth':null}));}if(_0x3580af[_0x60b9('0x11')][_0xdd2e62]){delete _0x3580af['queueReports'][_0xdd2e62];logger[_0x60b9('0x3f')](_0x60b9('0x42'),_0xdd2e62,util[_0x60b9('0x41')](_0x27a82c,{'showHidden':![],'depth':null}));}if(_0x3580af['variables'][_0xdd2e62]){delete _0x3580af[_0x60b9('0x18')][_0xdd2e62];logger['error']('[%s][voiceQueueReport][checkVariables]',_0xdd2e62,util[_0x60b9('0x41')](_0x27a82c,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x43')]=function(){logger[_0x60b9('0x3f')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x60b9('0x13')]);this[_0x60b9('0x44')](this[_0x60b9('0x11')]);clearAgentBooked(this[_0x60b9('0x12')]);clearVoiceQueues(this[_0x60b9('0x15')]);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0x60b9('0x44')]=function(_0x22bef7){var _0x379eeb=this;if(!_[_0x60b9('0x32')](_0x22bef7)){for(var _0x5060e0 in _0x22bef7){if(_0x22bef7[_0x60b9('0x33')](_0x5060e0)){_0x379eeb[_0x60b9('0x45')](_0x22bef7[_0x5060e0],_0x60b9('0x46'));delete _0x22bef7[_0x5060e0];}}}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x47')]=function(_0x5ac2cb,_0x178605,_0x3e84b0){io['to'](_0x5ac2cb)[_0x60b9('0x47')](_0x178605,_0x3e84b0);};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x48')]=function(_0x267a3e,_0xe572ae){logger[_0x60b9('0x49')]('[%s][voiceQueueReport]['+_0xe572ae+_0x60b9('0x4a'),_0x267a3e[_0x60b9('0x4b')],util['inspect'](_0x267a3e,{'showHidden':![],'depth':null}));this[_0x60b9('0x47')](util['format'](_0x60b9('0x4c'),_0x267a3e[_0x60b9('0x4d')]),_0x60b9('0x4e'),_0x267a3e);io['emit'](_0x60b9('0x4f'),_0x267a3e);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x1cb741,_0x5ea159){logger[_0x60b9('0x49')]('[%s][voiceQueueReport]['+_0x5ea159+_0x60b9('0x50'),_0x1cb741['uniqueid'],util['inspect'](_0x1cb741,{'showHidden':![],'depth':null}));this['emit'](util[_0x60b9('0x51')](_0x60b9('0x4c'),_0x1cb741[_0x60b9('0x4d')]),'voice_queue_channel:remove',_0x1cb741);io[_0x60b9('0x47')](_0x60b9('0x52'),_0x1cb741);};VoiceQueueReport['prototype'][_0x60b9('0x53')]=function(_0x36f3da,_0x5c2194){if(_0x36f3da[_0x60b9('0x54')]===_0x60b9('0x55')){var _0x2286b0={'id':_0x36f3da['id'],'name':_0x36f3da[_0x60b9('0x4d')],'strategy':_0x36f3da['strategy'],'answered':_0x36f3da[_0x60b9('0x56')],'available':_0x36f3da['available'],'loggedIn':_0x36f3da[_0x60b9('0x57')],'pTalking':_0x36f3da[_0x60b9('0x35')],'sumBillable':_0x36f3da[_0x60b9('0x58')],'sumDuration':_0x36f3da[_0x60b9('0x59')],'sumHoldTime':_0x36f3da['sumHoldTime']||0x0,'talking':_0x36f3da[_0x60b9('0x5a')],'total':_0x36f3da['total'],'type':_0x36f3da[_0x60b9('0x54')],'unmanaged':_0x36f3da['unmanaged'],'abandoned':_0x36f3da[_0x60b9('0x5b')],'waiting':_0x36f3da[_0x60b9('0x36')]};if(_0x36f3da[_0x60b9('0x5c')]){_0x2286b0[_0x60b9('0x5c')]={'id':_0x36f3da['Trunk']['id'],'name':_0x36f3da['Trunk'][_0x60b9('0x4d')],'active':_0x36f3da[_0x60b9('0x5c')]['active'],'callerid':_0x36f3da['Trunk'][_0x60b9('0x5d')]};}if(_0x36f3da[_0x60b9('0x5e')]){_0x2286b0['Interval']={'id':_0x36f3da['Interval']['id'],'name':_0x36f3da[_0x60b9('0x5e')][_0x60b9('0x4d')]};}var _0x3d33cc=md5(JSON[_0x60b9('0x5f')](_0x2286b0));if(_0x36f3da['md5']!==_0x3d33cc){_0x36f3da[_0x60b9('0x60')]=_0x3d33cc;logger[_0x60b9('0x49')](_0x60b9('0x61')+_0x5c2194+_0x60b9('0x62'),util[_0x60b9('0x41')](_0x2286b0,{'showHidden':![],'depth':null}));this['emit'](util[_0x60b9('0x51')](_0x60b9('0x4c'),_0x2286b0[_0x60b9('0x4d')]),'voice_queue:save',_0x2286b0);}}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x63')]=function(_0x2cfe24){return _0x2cfe24!==null&&!_['isUndefined'](_0x2cfe24);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x28cff0=this;setInterval(function(){_0x28cff0[_0x60b9('0x38')]();ami[_0x60b9('0x64')]({'action':_0x60b9('0x65')})[_0x60b9('0x3d')](function(_0x119654){logger[_0x60b9('0x3f')]('[voiceQueueReport][queues]',util[_0x60b9('0x41')](_0x119654,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x60b9('0xc')]['loopQueueSummary']=function(){var _0x2c4c6b=this;setInterval(function(){if(_0x2c4c6b[_0x60b9('0x16')]){return ami[_0x60b9('0x64')]({'action':_0x60b9('0x19')})[_0x60b9('0x66')](function(_0x8e2393){_0x2c4c6b[_0x60b9('0x16')]=![];})['catch'](function(_0x1ed346){logger['error'](_0x60b9('0x67'),util[_0x60b9('0x41')](_0x1ed346,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x1a')]=function(_0x59c1d6){try{if(this[_0x60b9('0x63')](_0x59c1d6)&&this[_0x60b9('0x63')](_0x59c1d6['queue'])){logger[_0x60b9('0x49')](_0x60b9('0x68'),util[_0x60b9('0x41')](_0x59c1d6,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]]){logger[_0x60b9('0x6a')](_0x60b9('0x6b'),_0x59c1d6[_0x60b9('0x69')]);var _0x55b9fa=_[_0x60b9('0x6c')](this[_0x60b9('0x13')],_0x60b9('0x69'))[_0x59c1d6['queue']]||0x0;var _0x194b1d=_0x55b9fa-_0x59c1d6['callers'];if(this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]][_0x60b9('0x36')]!==_[_0x60b9('0x6d')](_0x59c1d6[_0x60b9('0x6e')])||this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]]['loggedIn']!==_[_0x60b9('0x6d')](_0x59c1d6[_0x60b9('0x6f')])||this['voiceQueues'][_0x59c1d6[_0x60b9('0x69')]]['available']!==_[_0x60b9('0x6d')](_0x59c1d6[_0x60b9('0x70')])||this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]][_0x60b9('0x5a')]!==_0x194b1d){this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]][_0x60b9('0x36')]=_[_0x60b9('0x6d')](_0x59c1d6[_0x60b9('0x6e')]);this[_0x60b9('0x15')][_0x59c1d6['queue']]['loggedIn']=_[_0x60b9('0x6d')](_0x59c1d6[_0x60b9('0x6f')]);this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]][_0x60b9('0x70')]=_['toNumber'](_0x59c1d6[_0x60b9('0x70')]);this['voiceQueues'][_0x59c1d6[_0x60b9('0x69')]][_0x60b9('0x5a')]=_0x194b1d>0x0?_0x194b1d:0x0;this['voiceQueues'][_0x59c1d6['queue']][_0x60b9('0x5a')]=this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]]['talking']>_[_0x60b9('0x6d')](_0x59c1d6[_0x60b9('0x6f')])?_['toNumber'](_0x59c1d6[_0x60b9('0x6f')]):this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]][_0x60b9('0x5a')];this[_0x60b9('0x53')](this[_0x60b9('0x15')][_0x59c1d6[_0x60b9('0x69')]],'queuesummary');}logger[_0x60b9('0x49')](_0x60b9('0x71'),util['inspect'](this['voiceQueues'][_0x59c1d6[_0x60b9('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0x60b9('0x72'),this['voiceQueues'][_0x59c1d6[_0x60b9('0x69')]]);}}}catch(_0x5954cc){logger['error'](_0x60b9('0x67'),util[_0x60b9('0x41')](_0x5954cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x1d')]=function(_0x25a96e){logger[_0x60b9('0x49')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x60b9('0x41')](_0x25a96e,{'showHidden':![],'depth':null}));this[_0x60b9('0x16')]=!![];};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x1e')]=function(_0xb425e1){try{if(this[_0x60b9('0x63')](_0xb425e1)){logger[_0x60b9('0x49')](_0x60b9('0x73'),_0xb425e1[_0x60b9('0x4b')],util['inspect'](_0xb425e1,{'showHidden':![],'depth':null}));if(_[_0x60b9('0x74')](this[_0x60b9('0x11')][_0xb425e1[_0x60b9('0x4b')]]))this['queueReports'][_0xb425e1['uniqueid']]=[];if(_[_0x60b9('0x74')](this[_0x60b9('0x13')][_0xb425e1['uniqueid']]))this['channels'][_0xb425e1[_0x60b9('0x4b')]]={};var _0x48e35d=new QueueReport();_0x48e35d[_0x60b9('0x4d')]=_0xb425e1['queue'];_0x48e35d[_0x60b9('0x54')]=this[_0x60b9('0x15')][_0x48e35d[_0x60b9('0x4d')]]&&this[_0x60b9('0x15')][_0x48e35d[_0x60b9('0x4d')]][_0x60b9('0x54')]?this[_0x60b9('0x15')][_0x48e35d[_0x60b9('0x4d')]]['type']||'inbound':_0x60b9('0x55');_0x48e35d[_0x60b9('0x69')]=_0xb425e1['queue'];_0x48e35d[_0x60b9('0x75')]=moment()['format'](_0x60b9('0x76'));_0x48e35d['position']=_0xb425e1[_0x60b9('0x77')];_0x48e35d[_0x60b9('0x78')]=_0xb425e1[_0x60b9('0x78')];_0x48e35d[_0x60b9('0x4b')]=_0xb425e1[_0x60b9('0x4b')];_0x48e35d[_0x60b9('0x79')]=this[_0x60b9('0x13')][_0xb425e1[_0x60b9('0x4b')]][_0x60b9('0x79')];logger[_0x60b9('0x6a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x48e35d[_0x60b9('0x4d')],_0x48e35d[_0x60b9('0x54')]);_[_0x60b9('0x7a')](_0x48e35d,_['pick'](_0xb425e1,_[_0x60b9('0x7b')](_0x48e35d)));this[_0x60b9('0x11')][_0xb425e1['uniqueid']][_0x60b9('0x7c')](_0x48e35d);this[_0x60b9('0x13')][_0xb425e1['uniqueid']]=_0x48e35d;this['emitVoiceQueueChannelSave'](_0x48e35d,_0x60b9('0x7d'));}}catch(_0x247d56){logger[_0x60b9('0x3f')](_0x60b9('0x73'),_0xb425e1[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x247d56,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0x20')]=function(_0x36c5d8){try{if(this[_0x60b9('0x63')](_0x36c5d8)){logger[_0x60b9('0x49')](_0x60b9('0x7e'),_0x36c5d8[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x36c5d8,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x11')][_0x36c5d8[_0x60b9('0x4b')]]){var _0xa0a384=_['last'](this[_0x60b9('0x11')][_0x36c5d8['uniqueid']]);_0xa0a384[_0x60b9('0x7f')]=![];_0xa0a384[_0x60b9('0x80')]=null;_0xa0a384['holdtime']=_0x36c5d8[_0x60b9('0x81')];_0xa0a384[_0x60b9('0x82')]=_0x36c5d8['originalposition'];_0xa0a384[_0x60b9('0x1f')]=!![];_0xa0a384['queuecallerabandonAt']=moment()[_0x60b9('0x51')](_0x60b9('0x76'));_0xa0a384[_0x60b9('0x83')]=_0x60b9('0x84');_0xa0a384[_0x60b9('0x85')]=null;logger['info'](_0x60b9('0x86'),_0xa0a384['name'],_0xa0a384['type']);this[_0x60b9('0x13')][_0x36c5d8[_0x60b9('0x4b')]]=_0xa0a384;this[_0x60b9('0x45')](_0xa0a384,'queuecallerabandon');}}}catch(_0x1ec2f1){logger['error'](_0x60b9('0x7e'),_0x36c5d8[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x1ec2f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0x21')]=function(_0x24691c){try{if(this[_0x60b9('0x63')](_0x24691c)){logger[_0x60b9('0x49')](_0x60b9('0x87'),_0x24691c[_0x60b9('0x4b')],util['inspect'](_0x24691c,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x11')][_0x24691c['uniqueid']]){var _0x132f4f=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0x24691c[_0x60b9('0x4b')]]);_0x132f4f[_0x60b9('0x89')]=moment()[_0x60b9('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x132f4f[_0x60b9('0x8a')]=_0x24691c['connectedlinenum'];_0x132f4f['connectedlinename']=_0x24691c[_0x60b9('0x8b')];logger[_0x60b9('0x6a')](_0x60b9('0x8c'),_0x132f4f['name'],_0x132f4f[_0x60b9('0x54')],_0x24691c[_0x60b9('0x8a')],_0x24691c[_0x60b9('0x8b')]);this[_0x60b9('0x13')][_0x24691c[_0x60b9('0x4b')]]=_0x132f4f;this[_0x60b9('0x48')](_0x132f4f,_0x60b9('0x8d'));}}}catch(_0x2ad8c9){logger[_0x60b9('0x3f')](_0x60b9('0x87'),_0x24691c[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x2ad8c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0x24')]=function(_0x37ac7e){try{if(this[_0x60b9('0x63')](_0x37ac7e)){logger[_0x60b9('0x49')](_0x60b9('0x8e'),_0x37ac7e[_0x60b9('0x4b')],util['inspect'](_0x37ac7e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x37ac7e['uniqueid']]){var _0x5f294e=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0x37ac7e[_0x60b9('0x4b')]]);_0x5f294e[_0x60b9('0x7f')]=!![];_0x5f294e[_0x60b9('0x83')]='COMPLETEDBYAGENT';logger[_0x60b9('0x6a')](_0x60b9('0x8f'),_0x5f294e[_0x60b9('0x4d')],_0x5f294e['type']);}}}catch(_0x1f584e){logger[_0x60b9('0x3f')](_0x60b9('0x8e'),_0x37ac7e[_0x60b9('0x4b')],util['inspect'](_0x1f584e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0x23')]=function(_0x446398){try{if(this[_0x60b9('0x63')](_0x446398)){logger[_0x60b9('0x49')](_0x60b9('0x90'),_0x446398[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x446398,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x11')][_0x446398['uniqueid']]){var _0x5ba673=_[_0x60b9('0x88')](this['queueReports'][_0x446398['uniqueid']]);_0x5ba673[_0x60b9('0x1f')]=![];_0x5ba673['queuecallerabandonAt']=null;_0x5ba673[_0x60b9('0x91')]=!![];_0x5ba673[_0x60b9('0x85')]=_0x446398['membername'];_0x5ba673[_0x60b9('0x81')]=_0x446398[_0x60b9('0x81')];_0x5ba673[_0x60b9('0x7f')]=!![];_0x5ba673[_0x60b9('0x92')]=![];_0x5ba673['queuecallerexitAt']=null;if(!_0x5ba673[_0x60b9('0x93')]){if(_0x446398['reason']==_0x60b9('0x93')){_0x5ba673[_0x60b9('0x83')]=_0x60b9('0x94');logger[_0x60b9('0x6a')](_0x60b9('0x95'),_0x5ba673[_0x60b9('0x4d')],_0x5ba673[_0x60b9('0x54')]);}else{if(_[_0x60b9('0x96')](_0x446398['channel']['toLowerCase'](),'local/')){if(this[_0x60b9('0x11')][_0x446398[_0x60b9('0x97')]]){var _0x5c782a=_['last'](this[_0x60b9('0x11')][_0x446398[_0x60b9('0x97')]]);_0x5c782a[_0x60b9('0x7f')]=![];_0x5c782a[_0x60b9('0x92')]=!![];_0x5c782a[_0x60b9('0x98')]=moment(_0x5ba673[_0x60b9('0x75')])['add'](_0x446398[_0x60b9('0x81')],'seconds')[_0x60b9('0x51')](_0x60b9('0x76'));_0x5c782a[_0x60b9('0x83')]=_0x60b9('0x99');_0x5c782a[_0x60b9('0x93')]=!![];_0x5c782a[_0x60b9('0x9a')]='FORWARD';_0x5c782a[_0x60b9('0x9b')]=_0x446398[_0x60b9('0x9c')];_0x5c782a[_0x60b9('0x9d')]=_0x446398[_0x60b9('0x4b')];logger[_0x60b9('0x6a')](_0x60b9('0x9e'),_0x5c782a[_0x60b9('0x4d')],_0x5c782a[_0x60b9('0x54')]);var _0x4d1b14=this[_0x60b9('0x11')][_0x446398[_0x60b9('0x97')]];this[_0x60b9('0x11')][_0x446398[_0x60b9('0x97')]]=this[_0x60b9('0x11')][_0x446398[_0x60b9('0x4b')]];this[_0x60b9('0x11')][_0x446398[_0x60b9('0x4b')]]=_0x4d1b14;}}else{_0x5ba673[_0x60b9('0x83')]=_0x60b9('0x9f')+_0x446398['reason'][_0x60b9('0xa0')]();logger['info'](_0x60b9('0xa1'),_0x5ba673[_0x60b9('0x4d')],_0x5ba673['type'],_0x5ba673[_0x60b9('0x83')]);}}}this[_0x60b9('0x13')][_0x446398[_0x60b9('0x4b')]]=_0x5ba673;this[_0x60b9('0x45')](_0x5ba673,_0x60b9('0x22'));}}}catch(_0x215795){logger[_0x60b9('0x3f')]('[%s][voiceQueueReport][agentcomplete]',_0x446398[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x215795,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x26')]=function(_0x5a7c19){try{if(this[_0x60b9('0x63')](_0x5a7c19)){logger[_0x60b9('0x49')]('[%s][voiceQueueReport][varset]',_0x5a7c19[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x5a7c19,{'showHidden':![],'depth':null}));this['addVariable'](_0x5a7c19[_0x60b9('0x4b')],_[_0x60b9('0x7b')](_0x5a7c19[_0x60b9('0xa2')])[0x0],_0x5a7c19['value']);if(this[_0x60b9('0x11')][_0x5a7c19['uniqueid']]){var _0x21b283=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0x5a7c19[_0x60b9('0x4b')]]);if(_0x21b283){if(this[_0x60b9('0x63')](_0x5a7c19['variable'])&&this[_0x60b9('0x63')](_0x5a7c19[_0x60b9('0xa2')][_0x60b9('0xa3')])){switch(_0x5a7c19['value']){case'CONTINUE':_0x21b283['queuecallerexit']=![];_0x21b283[_0x60b9('0x98')]=null;break;case'TIMEOUT':_0x21b283[_0x60b9('0xa4')]=_0x60b9('0xa5');_0x21b283[_0x60b9('0x92')]=!![];_0x21b283[_0x60b9('0x98')]=moment()[_0x60b9('0x51')](_0x60b9('0x76'));_0x21b283['queuecallerleaveAt']=moment()[_0x60b9('0x51')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x60b9('0x49')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x5a7c19[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x21b283,{'showHidden':![],'depth':null}));ami[_0x60b9('0x47')](_0x60b9('0xa6'),_0x21b283);break;default:_0x21b283[_0x60b9('0x92')]=!![];_0x21b283['queuecallerexitAt']=moment()[_0x60b9('0x51')](_0x60b9('0x76'));_0x21b283[_0x60b9('0x89')]=moment()[_0x60b9('0x51')]('YYYY-MM-DD\x20HH:mm:ss');}_0x21b283[_0x60b9('0x1f')]=![];_0x21b283['queuecallerabandonAt']=null;_0x21b283[_0x60b9('0x83')]=_0x5a7c19[_0x60b9('0xa7')];this[_0x60b9('0x13')][_0x5a7c19[_0x60b9('0x4b')]]=_0x21b283;this[_0x60b9('0x45')](_0x21b283,'varset');}else if(this[_0x60b9('0x63')](_0x5a7c19[_0x60b9('0xa2')])&&this[_0x60b9('0x63')](_0x5a7c19[_0x60b9('0xa2')][_0x60b9('0xa8')])){if(!_0x21b283['queuecallerabandon']){_0x21b283[_0x60b9('0x92')]=!![];_0x21b283['queuecallerexitAt']=moment()[_0x60b9('0x51')](_0x60b9('0x76'));_0x21b283['queuecallerexitreason']=_0x60b9('0xa9');_0x21b283[_0x60b9('0x89')]=moment()[_0x60b9('0x51')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x60b9('0x13')][_0x5a7c19[_0x60b9('0x4b')]]=_0x21b283;}}logger[_0x60b9('0x6a')](_0x60b9('0xaa'),_0x5a7c19[_0x60b9('0x4b')],_0x21b283[_0x60b9('0x4d')],_0x21b283[_0x60b9('0x54')],_[_0x60b9('0x7b')](_0x5a7c19[_0x60b9('0xa2')])[0x0],_0x5a7c19[_0x60b9('0xa7')]);_0x21b283[_0x60b9('0x18')]=this[_0x60b9('0x18')][_0x5a7c19['uniqueid']];}}}}catch(_0x120dc7){logger[_0x60b9('0x3f')](_0x60b9('0xab'),_0x5a7c19['uniqueid'],util[_0x60b9('0x41')](_0x120dc7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0xac')]=function(_0x3c1c5c,_0x3c36ee,_0x1d2af2){var _0x66f6a7=[_0x60b9('0xad'),_0x60b9('0xae'),'rtpaudioqosjitter',_0x60b9('0xaf'),_0x60b9('0xb0'),_0x60b9('0xb1'),_0x60b9('0xb2'),_0x60b9('0xb3'),_0x60b9('0xb4'),_0x60b9('0xb5'),_0x60b9('0xb6'),_0x60b9('0xb7'),_0x60b9('0xb8'),'memberdynamic',_0x60b9('0xb9'),_0x60b9('0xba'),'membername','memberpenalty','memberrealtime'];if(!_[_0x60b9('0x3a')](_0x3c36ee)&&!_[_0x60b9('0xbb')](_0x66f6a7,_0x3c36ee)){if(_[_0x60b9('0x74')](this[_0x60b9('0x18')][_0x3c1c5c])){this['variables'][_0x3c1c5c]={};}this[_0x60b9('0x18')][_0x3c1c5c][_0x3c36ee]=_0x1d2af2;}};VoiceQueueReport['prototype'][_0x60b9('0x28')]=function(_0x5ae5c8){try{if(this[_0x60b9('0x63')](_0x5ae5c8)){logger[_0x60b9('0x49')](_0x60b9('0xbc'),_0x5ae5c8['uniqueid'],util['inspect'](_0x5ae5c8,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x11')][_0x5ae5c8['uniqueid']]){for(var _0x48d8cb=0x0,_0x50453c={};_0x48d8cb<this[_0x60b9('0x11')][_0x5ae5c8[_0x60b9('0x4b')]][_0x60b9('0xbd')];_0x48d8cb+=0x1){_0x50453c=this[_0x60b9('0x11')][_0x5ae5c8[_0x60b9('0x4b')]][_0x48d8cb];if(this['voiceQueues'][_0x50453c[_0x60b9('0x69')]]){if(_0x50453c[_0x60b9('0x92')]&&_0x50453c['transfer']!=!![]){this['voiceQueues'][_0x50453c[_0x60b9('0x69')]]['unmanaged']+=0x1;}if(_0x50453c[_0x60b9('0x1f')]){this[_0x60b9('0x15')][_0x50453c[_0x60b9('0x69')]][_0x60b9('0x5b')]+=0x1;}this[_0x60b9('0x15')][_0x50453c[_0x60b9('0x69')]][_0x60b9('0xbe')]+=moment(_0x50453c[_0x60b9('0x89')])[_0x60b9('0xbf')](_0x50453c[_0x60b9('0x75')],'seconds')||0x0;if(_0x48d8cb===this[_0x60b9('0x11')][_0x5ae5c8['uniqueid']]['length']-0x1){this[_0x60b9('0x15')][_0x50453c['queue']][_0x60b9('0x59')]+=moment()[_0x60b9('0xc0')](0x0)['diff'](_0x50453c[_0x60b9('0x75')],_0x60b9('0xc1'));this[_0x60b9('0x15')][_0x50453c[_0x60b9('0x69')]][_0x60b9('0xc2')]+=0x1;if(_0x50453c[_0x60b9('0x7f')]){this['voiceQueues'][_0x50453c[_0x60b9('0x69')]][_0x60b9('0x56')]+=0x1;this['voiceQueues'][_0x50453c['queue']][_0x60b9('0x58')]+=moment()['milliseconds'](0x0)['diff'](_0x50453c['queuecallerleaveAt'],'seconds');_0x50453c[_0x60b9('0x80')]=moment()[_0x60b9('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x50453c[_0x60b9('0x92')]=![];_0x50453c[_0x60b9('0x98')]=null;}if(_0x50453c['queuecallerexit']&&_0x50453c[_0x60b9('0x93')]!=!![]){_0x50453c[_0x60b9('0xa4')]=_0x60b9('0xc3');logger['debug'](_0x60b9('0xc4'),_0x5ae5c8['uniqueid'],util[_0x60b9('0x41')](_0x50453c,{'showHidden':![],'depth':null}));ami[_0x60b9('0x47')](_0x60b9('0xc5'),_0x50453c);}if(_0x50453c['queuecallerabandon']){_0x50453c[_0x60b9('0xa4')]=_0x60b9('0x5b');logger[_0x60b9('0x49')](_0x60b9('0xc6'),_0x5ae5c8[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x50453c,{'showHidden':![],'depth':null}));ami[_0x60b9('0x47')]('custom:queuecallerabandon',_0x50453c);}}else{this[_0x60b9('0x15')][_0x50453c[_0x60b9('0x69')]]['sumDuration']+=this[_0x60b9('0x15')][_0x50453c[_0x60b9('0x69')]][_0x60b9('0xbe')];}logger[_0x60b9('0x6a')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x5ae5c8['uniqueid'],_0x50453c['name'],_0x50453c[_0x60b9('0x54')],_0x5ae5c8[_0x60b9('0xc7')]);this[_0x60b9('0x13')][_0x5ae5c8[_0x60b9('0x4b')]]=_0x50453c;this['emitVoiceQueueChannelRemove'](_0x50453c,_0x60b9('0x27'));this[_0x60b9('0x53')](this[_0x60b9('0x15')][_0x50453c[_0x60b9('0x69')]],_0x60b9('0x27'));}}logger['debug'](_0x60b9('0xc8'),_0x5ae5c8['uniqueid'],util[_0x60b9('0x41')](this['queueReports'][_0x5ae5c8[_0x60b9('0x4b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceQueueReport',this[_0x60b9('0x11')][_0x5ae5c8[_0x60b9('0x4b')]]);delete this[_0x60b9('0x11')][_0x5ae5c8[_0x60b9('0x4b')]];delete this[_0x60b9('0x13')][_0x5ae5c8[_0x60b9('0x4b')]];}if(this[_0x60b9('0x18')][_0x5ae5c8[_0x60b9('0x4b')]]){delete this['variables'][_0x5ae5c8['uniqueid']];}}}catch(_0x4b22c3){logger[_0x60b9('0x3f')](_0x60b9('0xbc'),_0x5ae5c8[_0x60b9('0x4b')],util['inspect'](_0x4b22c3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x2e')]=function(_0xfa5e21){try{if(this['isNotNull'](_0xfa5e21)){logger[_0x60b9('0x49')](_0x60b9('0xc9'),_0xfa5e21[_0x60b9('0x4b')],util['inspect'](_0xfa5e21,{'showHidden':![],'depth':null}));var _0x3e30f7;if(this[_0x60b9('0x11')][_0xfa5e21['transfereeuniqueid']]){_0x3e30f7=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xca')]]);_0x3e30f7[_0x60b9('0x9b')]=_0xfa5e21[_0x60b9('0xcb')];_0x3e30f7[_0x60b9('0x9d')]=_0xfa5e21[_0x60b9('0xcc')];_0x3e30f7[_0x60b9('0x83')]='ATTENDEDTRANSFER';_0x3e30f7['transfer']=!![];_0x3e30f7[_0x60b9('0x9a')]=_0x60b9('0xcd');if(this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xcc')]]){var _0x45da4a=this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xcc')]];this[_0x60b9('0x11')][_0xfa5e21['secondtransfereruniqueid']]=this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xca')]];this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xca')]]=_0x45da4a;var _0x35a46d=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xca')]]);_0x35a46d[_0x60b9('0x39')]=!![];}logger[_0x60b9('0x6a')](_0x60b9('0xce'),_0xfa5e21[_0x60b9('0x4b')],_0x3e30f7[_0x60b9('0x4d')],_0x3e30f7[_0x60b9('0x54')],_0x3e30f7[_0x60b9('0x9b')],_0x3e30f7['transferuniqueid']);}else if(this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xcf')]]){_0x3e30f7=_[_0x60b9('0x88')](this['queueReports'][_0xfa5e21[_0x60b9('0xcf')]]);_0x3e30f7['transferexten']=_0xfa5e21[_0x60b9('0xd0')];_0x3e30f7[_0x60b9('0x9d')]=_0xfa5e21[_0x60b9('0xd1')];_0x3e30f7[_0x60b9('0x83')]=_0x60b9('0xd2');_0x3e30f7['transfer']=!![];_0x3e30f7[_0x60b9('0x9a')]='ATTENDED';if(this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xd1')]]){var _0x45da4a=this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xd1')]];this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xd1')]]=this['queueReports'][_0xfa5e21[_0x60b9('0xcf')]];this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xcf')]]=_0x45da4a;var _0x35a46d=_['last'](this[_0x60b9('0x11')][_0xfa5e21[_0x60b9('0xcf')]]);_0x35a46d['switch']=!![];}logger[_0x60b9('0x6a')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xfa5e21[_0x60b9('0x4b')],_0x3e30f7[_0x60b9('0x4d')],_0x3e30f7[_0x60b9('0x54')],_0x3e30f7['transferexten'],_0x3e30f7[_0x60b9('0x9d')]);}}}catch(_0x376674){logger[_0x60b9('0x3f')](_0x60b9('0xc9'),_0xfa5e21[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x376674,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0x30')]=function(_0x1ef0f2){try{if(this[_0x60b9('0x63')](_0x1ef0f2)){logger[_0x60b9('0x49')]('[%s][voiceQueueReport][blindtransfer]',_0x1ef0f2[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x1ef0f2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1ef0f2['transfereeuniqueid']]){var _0x3d096e=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0x1ef0f2[_0x60b9('0xca')]]);_0x3d096e[_0x60b9('0x83')]=_0x60b9('0xd3');_0x3d096e['transfer']=!![];_0x3d096e['transfertype']=_0x60b9('0xd4');_0x3d096e[_0x60b9('0x9b')]=_0x1ef0f2['extension'];_0x3d096e['transferuniqueid']=_0x1ef0f2[_0x60b9('0xca')];logger[_0x60b9('0x6a')](_0x60b9('0xd5'),_0x1ef0f2[_0x60b9('0x4b')],_0x3d096e['name'],_0x3d096e[_0x60b9('0x54')],_0x3d096e[_0x60b9('0x9b')],_0x3d096e[_0x60b9('0x9d')]);this[_0x60b9('0x28')]({'event':'BlindTransfer','uniqueid':_0x1ef0f2[_0x60b9('0xca')],'context':_0x1ef0f2[_0x60b9('0xd6')],'channel':_0x1ef0f2[_0x60b9('0xd7')]});}}}catch(_0x22e72b){logger[_0x60b9('0x3f')]('[%s][voiceQueueReport][blindtransfer]',_0x1ef0f2[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x22e72b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0x2c')]=function(_0x5e523f){try{if(this[_0x60b9('0x63')](_0x5e523f)){logger[_0x60b9('0x49')](_0x60b9('0xd8'),_0x5e523f[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x5e523f,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x11')][_0x5e523f[_0x60b9('0x4b')]]){var _0x359a0e=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0x5e523f[_0x60b9('0x4b')]]);if(!_['isNil'](_0x359a0e['queuecallerleaveAt'])){_0x359a0e[_0x60b9('0xd9')]=moment()['format'](_0x60b9('0x76'));logger['info'](_0x60b9('0xda'),_0x5e523f[_0x60b9('0x4b')],_0x359a0e['mohstarttime']);}}}}catch(_0x1bbc90){logger[_0x60b9('0x3f')]('[%s][voiceQueueReport][musiconholdstart]',_0x5e523f['uniqueid'],util[_0x60b9('0x41')](_0x1bbc90,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x60b9('0xdb')]=function(_0x15da43){try{if(this['isNotNull'](_0x15da43)){logger[_0x60b9('0x49')](_0x60b9('0xdc'),_0x15da43['uniqueid'],util['inspect'](_0x15da43,{'showHidden':![],'depth':null}));if(this[_0x60b9('0x11')][_0x15da43['uniqueid']]){var _0xcb81a2=_[_0x60b9('0x88')](this[_0x60b9('0x11')][_0x15da43[_0x60b9('0x4b')]]);if(!_[_0x60b9('0x3a')](_0xcb81a2[_0x60b9('0xd9')])){_0xcb81a2[_0x60b9('0xdd')]+=moment()['milliseconds'](0x0)['diff'](_0xcb81a2[_0x60b9('0xd9')],_0x60b9('0xc1'));logger[_0x60b9('0x6a')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x15da43['uniqueid'],_0xcb81a2[_0x60b9('0xdd')]);delete _0xcb81a2[_0x60b9('0xd9')];}}}}catch(_0x141f67){logger['error'](_0x60b9('0xdc'),_0x15da43['uniqueid'],util[_0x60b9('0x41')](_0x141f67,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x60b9('0xc')][_0x60b9('0x2b')]=function(_0xed6cbb){try{if(this[_0x60b9('0x63')](_0xed6cbb)){logger[_0x60b9('0x49')]('[%s][voiceQueueReport][newexten]\x20event:',_0xed6cbb[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0xed6cbb,{'showHidden':![],'depth':null}));if(_0xed6cbb['application']['toLowerCase']()===_0x60b9('0xde')){_0xed6cbb[_0x60b9('0xdf')]=_0xed6cbb[_0x60b9('0xe0')]&&_0xed6cbb[_0x60b9('0xe0')]['startsWith'](_0x60b9('0xe1'))?_0xed6cbb[_0x60b9('0xe0')]:(_0xed6cbb['appdata']||_0xed6cbb[_0x60b9('0xdf')])[_0x60b9('0xe2')]();if(_[_0x60b9('0x96')](_0xed6cbb[_0x60b9('0xdf')][_0x60b9('0xe2')](),_0x60b9('0xe3'))){logger['info'](_0x60b9('0xe4'),_0xed6cbb[_0x60b9('0x4b')],_0xed6cbb[_0x60b9('0xe5')],_0xed6cbb[_0x60b9('0xdf')]);if(_[_0x60b9('0x74')](this[_0x60b9('0x13')][_0xed6cbb[_0x60b9('0x4b')]]))this[_0x60b9('0x13')][_0xed6cbb['uniqueid']]={};var _0x12d64a=_0xed6cbb[_0x60b9('0xdf')]['split']('=');var _0x42dcee=_0x12d64a[0x0][_0x60b9('0xe2')]()[_0x60b9('0xe6')](/cdr\((.*)\)/);if(_0x42dcee)this['channels'][_0xed6cbb[_0x60b9('0x4b')]][_0x42dcee[0x1]]=_0x12d64a[0x1];}}}}catch(_0x2dfe9b){logger['error']('[%s][voiceQueueReport][newexten]',_0xed6cbb[_0x60b9('0x4b')],util[_0x60b9('0x41')](_0x2dfe9b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x9755=['channels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','hangup','fullybooted','syncFullyBooted','syncNewExten','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','pTalking','waiting','unlockRR','switch','sequence','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emit','emitVoiceQueueChannelSave','debug','format','name','voice_queue_channel:save','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','voice:queue:%s','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','Trunk','active','callerid','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','[voiceQueueReport][queues]','loopQueueSummary','then','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','COMPLETEDBY','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','variable','value','queuestatus','timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','abandoned','diff','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','lodash','util','md5','ioredis','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','agents'];(function(_0x499c98,_0x3343ee){var _0x2a2ea2=function(_0x469768){while(--_0x469768){_0x499c98['push'](_0x499c98['shift']());}};_0x2a2ea2(++_0x3343ee);}(_0x9755,0x1c6));var _0x5975=function(_0x571d85,_0xda439c){_0x571d85=_0x571d85-0x0;var _0x3c2e07=_0x9755[_0x571d85];return _0x3c2e07;};'use strict';var _=require(_0x5975('0x0'));var moment=require('moment');var util=require(_0x5975('0x1'));var md5=require(_0x5975('0x2'));var Redis=require(_0x5975('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x5975('0x4'));var QueueReport=require(_0x5975('0x5'));config[_0x5975('0x6')]=_[_0x5975('0x7')](config[_0x5975('0x6')],{'host':_0x5975('0x8'),'port':0x18eb});var io=require(_0x5975('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x5975('0xa')][_0x5975('0xb')]=function(_0x55e597){this[_0x5975('0xc')]=this[_0x5975('0xc')]?this[_0x5975('0xc')]['finally'](_0x55e597):_0x55e597();};function VoiceQueueReport(_0xa869fe){this['sequence']=new Sequence();this['queueReports']={};this[_0x5975('0xd')]=_0xa869fe[_0x5975('0xd')];this[_0x5975('0xe')]=_0xa869fe['queueChannels'];this[_0x5975('0xf')]=_0xa869fe[_0x5975('0xf')];this[_0x5975('0x10')]=!![];this['campaigns']=_0xa869fe[_0x5975('0x11')];this[_0x5975('0x12')]={};ami['on'](_0x5975('0x13'),this[_0x5975('0x14')]['bind'](this));ami['on']('queuesummarycomplete',this[_0x5975('0x15')][_0x5975('0x16')](this));ami['on'](_0x5975('0x17'),this['syncQueueCallerJoin'][_0x5975('0x16')](this));ami['on']('queuecallerabandon',this[_0x5975('0x18')]['bind'](this));ami['on'](_0x5975('0x19'),this[_0x5975('0x1a')][_0x5975('0x16')](this));ami['on'](_0x5975('0x1b'),this[_0x5975('0x1c')][_0x5975('0x16')](this));ami['on'](_0x5975('0x1d'),this['syncAgentConnect'][_0x5975('0x16')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x5975('0x1e'),this['syncHangup'][_0x5975('0x16')](this));ami['on'](_0x5975('0x1f'),this[_0x5975('0x20')][_0x5975('0x16')](this));ami['on']('newexten',this[_0x5975('0x21')][_0x5975('0x16')](this));ami['on'](_0x5975('0x22'),this['syncMusicOnHoldStart'][_0x5975('0x16')](this));ami['on'](_0x5975('0x23'),this[_0x5975('0x24')][_0x5975('0x16')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x5975('0x16')](this));ami['on'](_0x5975('0x25'),this['syncBlindTransfer'][_0x5975('0x16')](this));this['loopQueueSummary']();this[_0x5975('0x26')]();}function clearChannels(_0x51e316){if(!_['isEmpty'](_0x51e316)){for(var _0x28c52f in _0x51e316){if(_0x51e316['hasOwnProperty'](_0x28c52f)){delete _0x51e316[_0x28c52f];}}}}function clearCampaigns(_0x2290c9){if(!_[_0x5975('0x27')](_0x2290c9)){for(var _0x57efee in _0x2290c9){if(_0x2290c9['hasOwnProperty'](_0x57efee)){_0x2290c9[_0x57efee][_0x5975('0x28')]=0x0;}}}}function clearVoiceQueues(_0x1c1551){if(!_[_0x5975('0x27')](_0x1c1551)){for(var _0x154e1a in _0x1c1551){if(_0x1c1551[_0x5975('0x29')](_0x154e1a)){_0x1c1551[_0x154e1a][_0x5975('0x28')]=0x0;_0x1c1551[_0x154e1a][_0x5975('0x2a')]=0x0;_0x1c1551[_0x154e1a][_0x5975('0x2b')]=0x0;_0x1c1551[_0x154e1a][_0x5975('0x2c')]=0x0;_0x1c1551[_0x154e1a]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x37db84){if(!_[_0x5975('0x27')](_0x37db84)){for(var _0x2920b0 in _0x37db84){if(_0x37db84['hasOwnProperty'](_0x2920b0)){_0x37db84[_0x2920b0][_0x5975('0x2d')]=!![];}}}}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0x2df91e=this;for(var _0x191376 in this[_0x5975('0xe')]){if(this[_0x5975('0xe')][_0x5975('0x29')](_0x191376)&&!this['channels'][_0x191376][_0x5975('0x2e')]){this[_0x5975('0x2f')]['enqueue'](function(){if(!_['isNil'](_0x2df91e['channels'][_0x191376])){return ami[_0x5975('0x30')]({'action':_0x5975('0x31'),'channel':_0x2df91e[_0x5975('0xe')][_0x191376][_0x5975('0x32')]})[_0x5975('0x33')](function(_0x28ab2e){if(_0x28ab2e[_0x5975('0x34')]===_0x5975('0x35')){setTimeout(function(){if(_0x2df91e[_0x5975('0xe')][_0x191376]){delete _0x2df91e[_0x5975('0xe')][_0x191376];logger[_0x5975('0x36')](_0x5975('0x37'),_0x191376,util[_0x5975('0x38')](_0x28ab2e,{'showHidden':![],'depth':null}));}if(_0x2df91e[_0x5975('0x39')][_0x191376]){delete _0x2df91e[_0x5975('0x39')][_0x191376];logger[_0x5975('0x36')](_0x5975('0x3a'),_0x191376,util[_0x5975('0x38')](_0x28ab2e,{'showHidden':![],'depth':null}));}if(_0x2df91e[_0x5975('0x12')][_0x191376]){delete _0x2df91e[_0x5975('0x12')][_0x191376];logger['error'](_0x5975('0x3b'),_0x191376,util[_0x5975('0x38')](_0x28ab2e,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x5975('0x20')]=function(){logger[_0x5975('0x36')](_0x5975('0x3c'));clearChannels(this['channels']);this[_0x5975('0x3d')](this[_0x5975('0x39')]);clearAgentBooked(this[_0x5975('0xd')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x5975('0x11')]);};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x3d')]=function(_0x53904d){var _0x5d8a2f=this;if(!_[_0x5975('0x27')](_0x53904d)){for(var _0x16a296 in _0x53904d){if(_0x53904d['hasOwnProperty'](_0x16a296)){_0x5d8a2f['emitVoiceQueueChannelRemove'](_0x53904d[_0x16a296],'clearqueuereport');delete _0x53904d[_0x16a296];}}}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x3e')]=function(_0x2ef020,_0x3234b3,_0x25e1eb){io['to'](_0x2ef020)['emit'](_0x3234b3,_0x25e1eb);};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x3f')]=function(_0x16c5c0,_0x4785b2){logger[_0x5975('0x40')]('[%s][voiceQueueReport]['+_0x4785b2+']\x20sending\x20voice_queue_channel:save\x20event:',_0x16c5c0['uniqueid'],util[_0x5975('0x38')](_0x16c5c0,{'showHidden':![],'depth':null}));this[_0x5975('0x3e')](util[_0x5975('0x41')]('voice:queue:%s',_0x16c5c0[_0x5975('0x42')]),_0x5975('0x43'),_0x16c5c0);io[_0x5975('0x3e')]('voice_queue_presence:save',_0x16c5c0);};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x44')]=function(_0x1251ab,_0x17b2c6){logger['debug'](_0x5975('0x45')+_0x17b2c6+_0x5975('0x46'),_0x1251ab[_0x5975('0x47')],util[_0x5975('0x38')](_0x1251ab,{'showHidden':![],'depth':null}));this[_0x5975('0x3e')](util[_0x5975('0x41')](_0x5975('0x48'),_0x1251ab['name']),_0x5975('0x49'),_0x1251ab);io[_0x5975('0x3e')]('voice_queue_presence:remove',_0x1251ab);};VoiceQueueReport['prototype'][_0x5975('0x4a')]=function(_0x2ae23e,_0x449529){if(_0x2ae23e['type']===_0x5975('0x4b')){var _0x4c55eb={'id':_0x2ae23e['id'],'name':_0x2ae23e[_0x5975('0x42')],'strategy':_0x2ae23e[_0x5975('0x4c')],'answered':_0x2ae23e[_0x5975('0x4d')],'available':_0x2ae23e[_0x5975('0x4e')],'loggedIn':_0x2ae23e[_0x5975('0x4f')],'pTalking':_0x2ae23e[_0x5975('0x2b')],'sumBillable':_0x2ae23e[_0x5975('0x50')],'sumDuration':_0x2ae23e[_0x5975('0x51')],'sumHoldTime':_0x2ae23e[_0x5975('0x52')]||0x0,'talking':_0x2ae23e[_0x5975('0x2a')],'total':_0x2ae23e[_0x5975('0x53')],'type':_0x2ae23e[_0x5975('0x54')],'unmanaged':_0x2ae23e[_0x5975('0x55')],'abandoned':_0x2ae23e['abandoned'],'waiting':_0x2ae23e[_0x5975('0x2c')]};if(_0x2ae23e[_0x5975('0x56')]){_0x4c55eb[_0x5975('0x56')]={'id':_0x2ae23e[_0x5975('0x56')]['id'],'name':_0x2ae23e[_0x5975('0x56')]['name'],'active':_0x2ae23e[_0x5975('0x56')][_0x5975('0x57')],'callerid':_0x2ae23e['Trunk'][_0x5975('0x58')]};}if(_0x2ae23e[_0x5975('0x59')]){_0x4c55eb[_0x5975('0x59')]={'id':_0x2ae23e[_0x5975('0x59')]['id'],'name':_0x2ae23e['Interval'][_0x5975('0x42')]};}var _0x26d74a=md5(JSON[_0x5975('0x5a')](_0x4c55eb));if(_0x2ae23e[_0x5975('0x2')]!==_0x26d74a){_0x2ae23e['md5']=_0x26d74a;logger[_0x5975('0x40')]('[voiceQueueReport]['+_0x449529+_0x5975('0x5b'),util['inspect'](_0x4c55eb,{'showHidden':![],'depth':null}));this[_0x5975('0x3e')](util[_0x5975('0x41')]('voice:queue:%s',_0x4c55eb[_0x5975('0x42')]),_0x5975('0x5c'),_0x4c55eb);}}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x5d')]=function(_0x434eb9){return _0x434eb9!==null&&!_['isUndefined'](_0x434eb9);};VoiceQueueReport[_0x5975('0xa')]['loopQueueShow']=function(){var _0x334402=this;setInterval(function(){_0x334402['clearZombieChannels']();ami[_0x5975('0x30')]({'action':'queues'})[_0x5975('0x33')](function(_0x32c5ea){logger['error'](_0x5975('0x5e'),util[_0x5975('0x38')](_0x32c5ea,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x5f')]=function(){var _0x23f1cd=this;setInterval(function(){if(_0x23f1cd['flagQueueSummary']){return ami[_0x5975('0x30')]({'action':_0x5975('0x13')})[_0x5975('0x60')](function(_0x111460){_0x23f1cd[_0x5975('0x10')]=![];})[_0x5975('0x33')](function(_0x26845c){logger[_0x5975('0x36')](_0x5975('0x61'),util['inspect'](_0x26845c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x5975('0xa')]['syncQueueSummary']=function(_0x308853){try{if(this[_0x5975('0x5d')](_0x308853)&&this[_0x5975('0x5d')](_0x308853[_0x5975('0x62')])){logger[_0x5975('0x40')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x5975('0x38')](_0x308853,{'showHidden':![],'depth':null}));if(this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]]){logger[_0x5975('0x63')](_0x5975('0x64'),_0x308853[_0x5975('0x62')]);var _0x1ab5d1=_[_0x5975('0x65')](this[_0x5975('0xe')],_0x5975('0x62'))[_0x308853['queue']]||0x0;var _0x5e9d13=_0x1ab5d1-_0x308853['callers'];if(this[_0x5975('0xf')][_0x308853['queue']][_0x5975('0x2c')]!==_[_0x5975('0x66')](_0x308853[_0x5975('0x67')])||this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]][_0x5975('0x4f')]!==_[_0x5975('0x66')](_0x308853[_0x5975('0x68')])||this[_0x5975('0xf')][_0x308853['queue']][_0x5975('0x4e')]!==_[_0x5975('0x66')](_0x308853['available'])||this['voiceQueues'][_0x308853[_0x5975('0x62')]][_0x5975('0x2a')]!==_0x5e9d13){this[_0x5975('0xf')][_0x308853['queue']][_0x5975('0x2c')]=_[_0x5975('0x66')](_0x308853[_0x5975('0x67')]);this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]]['loggedIn']=_[_0x5975('0x66')](_0x308853[_0x5975('0x68')]);this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]][_0x5975('0x4e')]=_[_0x5975('0x66')](_0x308853[_0x5975('0x4e')]);this[_0x5975('0xf')][_0x308853['queue']][_0x5975('0x2a')]=_0x5e9d13>0x0?_0x5e9d13:0x0;this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]][_0x5975('0x2a')]=this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]]['talking']>_[_0x5975('0x66')](_0x308853[_0x5975('0x68')])?_[_0x5975('0x66')](_0x308853[_0x5975('0x68')]):this[_0x5975('0xf')][_0x308853[_0x5975('0x62')]][_0x5975('0x2a')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x308853['queue']],_0x5975('0x13'));}logger['debug'](_0x5975('0x69'),util[_0x5975('0x38')](this['voiceQueues'][_0x308853[_0x5975('0x62')]],{'showHidden':![],'depth':null}));ami[_0x5975('0x3e')](_0x5975('0x6a'),this[_0x5975('0xf')][_0x308853['queue']]);}}}catch(_0x1ee075){logger[_0x5975('0x36')](_0x5975('0x61'),util[_0x5975('0x38')](_0x1ee075,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x15')]=function(_0xf7c865){logger[_0x5975('0x40')](_0x5975('0x6b'),util[_0x5975('0x38')](_0xf7c865,{'showHidden':![],'depth':null}));this[_0x5975('0x10')]=!![];};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x6c')]=function(_0x3a53bd){try{if(this[_0x5975('0x5d')](_0x3a53bd)){logger[_0x5975('0x40')](_0x5975('0x6d'),_0x3a53bd['uniqueid'],util['inspect'](_0x3a53bd,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x5975('0x39')][_0x3a53bd['uniqueid']]))this['queueReports'][_0x3a53bd[_0x5975('0x47')]]=[];if(_[_0x5975('0x6e')](this[_0x5975('0xe')][_0x3a53bd[_0x5975('0x47')]]))this['channels'][_0x3a53bd[_0x5975('0x47')]]={};var _0x35c5eb=new QueueReport();_0x35c5eb[_0x5975('0x42')]=_0x3a53bd[_0x5975('0x62')];_0x35c5eb[_0x5975('0x54')]=this[_0x5975('0xf')][_0x35c5eb[_0x5975('0x42')]]&&this[_0x5975('0xf')][_0x35c5eb[_0x5975('0x42')]][_0x5975('0x54')]?this['voiceQueues'][_0x35c5eb[_0x5975('0x42')]][_0x5975('0x54')]||_0x5975('0x4b'):_0x5975('0x4b');_0x35c5eb[_0x5975('0x62')]=_0x3a53bd[_0x5975('0x62')];_0x35c5eb[_0x5975('0x6f')]=moment()[_0x5975('0x41')](_0x5975('0x70'));_0x35c5eb[_0x5975('0x71')]=_0x3a53bd[_0x5975('0x71')];_0x35c5eb[_0x5975('0x72')]=_0x3a53bd['count'];_0x35c5eb[_0x5975('0x47')]=_0x3a53bd[_0x5975('0x47')];_0x35c5eb[_0x5975('0x73')]=this['channels'][_0x3a53bd['uniqueid']][_0x5975('0x73')];logger['info'](_0x5975('0x74'),_0x35c5eb[_0x5975('0x42')],_0x35c5eb['type']);_[_0x5975('0x75')](_0x35c5eb,_[_0x5975('0x76')](_0x3a53bd,_[_0x5975('0x77')](_0x35c5eb)));this['queueReports'][_0x3a53bd['uniqueid']][_0x5975('0x78')](_0x35c5eb);this[_0x5975('0xe')][_0x3a53bd[_0x5975('0x47')]]=_0x35c5eb;this[_0x5975('0x3f')](_0x35c5eb,_0x5975('0x17'));}}catch(_0xe57ff4){logger[_0x5975('0x36')](_0x5975('0x6d'),_0x3a53bd[_0x5975('0x47')],util[_0x5975('0x38')](_0xe57ff4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x18')]=function(_0x5ac28b){try{if(this[_0x5975('0x5d')](_0x5ac28b)){logger[_0x5975('0x40')](_0x5975('0x79'),_0x5ac28b[_0x5975('0x47')],util[_0x5975('0x38')](_0x5ac28b,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x5ac28b[_0x5975('0x47')]]){var _0x138ff6=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x5ac28b[_0x5975('0x47')]]);_0x138ff6[_0x5975('0x7b')]=![];_0x138ff6[_0x5975('0x7c')]=null;_0x138ff6[_0x5975('0x7d')]=_0x5ac28b['holdtime'];_0x138ff6[_0x5975('0x7e')]=_0x5ac28b['originalposition'];_0x138ff6[_0x5975('0x7f')]=!![];_0x138ff6[_0x5975('0x80')]=moment()[_0x5975('0x41')](_0x5975('0x70'));_0x138ff6[_0x5975('0x81')]=_0x5975('0x82');_0x138ff6[_0x5975('0x83')]=null;logger['info'](_0x5975('0x84'),_0x138ff6[_0x5975('0x42')],_0x138ff6[_0x5975('0x54')]);this[_0x5975('0xe')][_0x5ac28b[_0x5975('0x47')]]=_0x138ff6;this[_0x5975('0x44')](_0x138ff6,_0x5975('0x7f'));}}}catch(_0x16c69c){logger[_0x5975('0x36')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5ac28b['uniqueid'],util['inspect'](_0x16c69c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x1a')]=function(_0x137052){try{if(this[_0x5975('0x5d')](_0x137052)){logger[_0x5975('0x40')](_0x5975('0x85'),_0x137052['uniqueid'],util[_0x5975('0x38')](_0x137052,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x137052['uniqueid']]){var _0x343fdd=_[_0x5975('0x7a')](this['queueReports'][_0x137052[_0x5975('0x47')]]);_0x343fdd[_0x5975('0x86')]=moment()['format'](_0x5975('0x70'));_0x343fdd[_0x5975('0x87')]=_0x137052[_0x5975('0x87')];_0x343fdd['connectedlinename']=_0x137052[_0x5975('0x88')];logger['info'](_0x5975('0x89'),_0x343fdd[_0x5975('0x42')],_0x343fdd[_0x5975('0x54')],_0x137052[_0x5975('0x87')],_0x137052['connectedlinename']);this['channels'][_0x137052['uniqueid']]=_0x343fdd;this[_0x5975('0x3f')](_0x343fdd,'queuecallerleave');}}}catch(_0x12b6f0){logger[_0x5975('0x36')](_0x5975('0x85'),_0x137052[_0x5975('0x47')],util[_0x5975('0x38')](_0x12b6f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0x8a')]=function(_0x5d4fdc){try{if(this[_0x5975('0x5d')](_0x5d4fdc)){logger[_0x5975('0x40')](_0x5975('0x8b'),_0x5d4fdc[_0x5975('0x47')],util[_0x5975('0x38')](_0x5d4fdc,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x5d4fdc[_0x5975('0x47')]]){var _0x30f077=_['last'](this[_0x5975('0x39')][_0x5d4fdc[_0x5975('0x47')]]);_0x30f077[_0x5975('0x7b')]=!![];_0x30f077[_0x5975('0x81')]=_0x5975('0x8c');logger['info'](_0x5975('0x8d'),_0x30f077[_0x5975('0x42')],_0x30f077[_0x5975('0x54')]);}}}catch(_0xdd7704){logger[_0x5975('0x36')]('[%s][voiceQueueReport][agentconnect]',_0x5d4fdc[_0x5975('0x47')],util['inspect'](_0xdd7704,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')]['syncAgentComplete']=function(_0x46ab15){try{if(this[_0x5975('0x5d')](_0x46ab15)){logger[_0x5975('0x40')](_0x5975('0x8e'),_0x46ab15[_0x5975('0x47')],util['inspect'](_0x46ab15,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x46ab15[_0x5975('0x47')]]){var _0x48b555=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x46ab15[_0x5975('0x47')]]);_0x48b555[_0x5975('0x7f')]=![];_0x48b555[_0x5975('0x80')]=null;_0x48b555[_0x5975('0x8f')]=!![];_0x48b555[_0x5975('0x83')]=_0x46ab15[_0x5975('0x90')];_0x48b555['holdtime']=_0x46ab15[_0x5975('0x7d')];_0x48b555[_0x5975('0x7b')]=!![];_0x48b555['queuecallerexit']=![];_0x48b555[_0x5975('0x91')]=null;if(!_0x48b555[_0x5975('0x92')]){if(_0x46ab15['reason']==_0x5975('0x92')){_0x48b555[_0x5975('0x81')]=_0x5975('0x93');logger[_0x5975('0x63')](_0x5975('0x94'),_0x48b555['name'],_0x48b555['type']);}else{if(_[_0x5975('0x95')](_0x46ab15[_0x5975('0x32')][_0x5975('0x96')](),_0x5975('0x97'))){if(this[_0x5975('0x39')][_0x46ab15[_0x5975('0x98')]]){var _0xb8b5ce=_['last'](this[_0x5975('0x39')][_0x46ab15['linkedid']]);_0xb8b5ce[_0x5975('0x7b')]=![];_0xb8b5ce[_0x5975('0x99')]=!![];_0xb8b5ce['queuecallerexitAt']=moment(_0x48b555[_0x5975('0x6f')])[_0x5975('0x9a')](_0x46ab15[_0x5975('0x7d')],_0x5975('0x9b'))[_0x5975('0x41')](_0x5975('0x70'));_0xb8b5ce['queuecallerexitreason']=_0x5975('0x9c');_0xb8b5ce[_0x5975('0x92')]=!![];_0xb8b5ce[_0x5975('0x9d')]=_0x5975('0x9e');_0xb8b5ce['transferexten']=_0x46ab15[_0x5975('0x9f')];_0xb8b5ce[_0x5975('0xa0')]=_0x46ab15[_0x5975('0x47')];logger[_0x5975('0x63')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0xb8b5ce[_0x5975('0x42')],_0xb8b5ce[_0x5975('0x54')]);var _0x5eab9c=this[_0x5975('0x39')][_0x46ab15[_0x5975('0x98')]];this[_0x5975('0x39')][_0x46ab15['linkedid']]=this[_0x5975('0x39')][_0x46ab15['uniqueid']];this[_0x5975('0x39')][_0x46ab15['uniqueid']]=_0x5eab9c;}}else{_0x48b555['queuecallerexitreason']=_0x5975('0xa1')+_0x46ab15[_0x5975('0xa2')]['toUpperCase']();logger['info'](_0x5975('0xa3'),_0x48b555[_0x5975('0x42')],_0x48b555['type'],_0x48b555[_0x5975('0x81')]);}}}this[_0x5975('0xe')][_0x46ab15[_0x5975('0x47')]]=_0x48b555;this[_0x5975('0x44')](_0x48b555,'agentcomplete');}}}catch(_0x2ae1ae){logger[_0x5975('0x36')](_0x5975('0x8e'),_0x46ab15['uniqueid'],util[_0x5975('0x38')](_0x2ae1ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5975('0xa4')]=function(_0x54130b){try{if(this[_0x5975('0x5d')](_0x54130b)){logger[_0x5975('0x40')]('[%s][voiceQueueReport][varset]',_0x54130b['uniqueid'],util['inspect'](_0x54130b,{'showHidden':![],'depth':null}));this['addVariable'](_0x54130b[_0x5975('0x47')],_[_0x5975('0x77')](_0x54130b[_0x5975('0xa5')])[0x0],_0x54130b[_0x5975('0xa6')]);if(this['queueReports'][_0x54130b[_0x5975('0x47')]]){var _0x5c2a01=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x54130b['uniqueid']]);if(_0x5c2a01){if(this[_0x5975('0x5d')](_0x54130b[_0x5975('0xa5')])&&this[_0x5975('0x5d')](_0x54130b[_0x5975('0xa5')][_0x5975('0xa7')])){switch(_0x54130b['value']){case'CONTINUE':_0x5c2a01['queuecallerexit']=![];_0x5c2a01['queuecallerexitAt']=null;break;case'TIMEOUT':_0x5c2a01['lastevent']=_0x5975('0xa8');_0x5c2a01['queuecallerexit']=!![];_0x5c2a01[_0x5975('0x91')]=moment()[_0x5975('0x41')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c2a01['queuecallerleaveAt']=moment()[_0x5975('0x41')](_0x5975('0x70'));logger[_0x5975('0x40')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x54130b[_0x5975('0x47')],util[_0x5975('0x38')](_0x5c2a01,{'showHidden':![],'depth':null}));ami[_0x5975('0x3e')]('custom:timeout',_0x5c2a01);break;default:_0x5c2a01['queuecallerexit']=!![];_0x5c2a01[_0x5975('0x91')]=moment()[_0x5975('0x41')](_0x5975('0x70'));_0x5c2a01['queuecallerleaveAt']=moment()[_0x5975('0x41')](_0x5975('0x70'));}_0x5c2a01[_0x5975('0x7f')]=![];_0x5c2a01[_0x5975('0x80')]=null;_0x5c2a01[_0x5975('0x81')]=_0x54130b[_0x5975('0xa6')];this[_0x5975('0xe')][_0x54130b[_0x5975('0x47')]]=_0x5c2a01;this['emitVoiceQueueChannelRemove'](_0x5c2a01,'varset');}else if(this[_0x5975('0x5d')](_0x54130b['variable'])&&this[_0x5975('0x5d')](_0x54130b['variable']['queueposition'])){if(!_0x5c2a01[_0x5975('0x7f')]){_0x5c2a01[_0x5975('0x99')]=!![];_0x5c2a01[_0x5975('0x91')]=moment()['format'](_0x5975('0x70'));_0x5c2a01[_0x5975('0x81')]=_0x5975('0xa9');_0x5c2a01[_0x5975('0x86')]=moment()[_0x5975('0x41')](_0x5975('0x70'));this[_0x5975('0xe')][_0x54130b[_0x5975('0x47')]]=_0x5c2a01;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x54130b[_0x5975('0x47')],_0x5c2a01['name'],_0x5c2a01[_0x5975('0x54')],_[_0x5975('0x77')](_0x54130b[_0x5975('0xa5')])[0x0],_0x54130b[_0x5975('0xa6')]);_0x5c2a01[_0x5975('0x12')]=this['variables'][_0x54130b[_0x5975('0x47')]];}}}}catch(_0x4cbeb4){logger['error'](_0x5975('0xaa'),_0x54130b[_0x5975('0x47')],util[_0x5975('0x38')](_0x4cbeb4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0xab')]=function(_0x412023,_0x37362e,_0x5e7583){var _0x5fc9c9=[_0x5975('0xac'),'rtpaudioqosbridged',_0x5975('0xad'),_0x5975('0xae'),_0x5975('0xaf'),_0x5975('0xb0'),_0x5975('0xb1'),_0x5975('0xb2'),'sipcallid',_0x5975('0xb3'),_0x5975('0xb4'),'bridgepvtcallid',_0x5975('0xb5'),_0x5975('0xb6'),_0x5975('0xb7'),_0x5975('0xb8'),_0x5975('0x90'),_0x5975('0xb9'),_0x5975('0xba')];if(!_[_0x5975('0xbb')](_0x37362e)&&!_[_0x5975('0xbc')](_0x5fc9c9,_0x37362e)){if(_[_0x5975('0x6e')](this[_0x5975('0x12')][_0x412023])){this[_0x5975('0x12')][_0x412023]={};}this[_0x5975('0x12')][_0x412023][_0x37362e]=_0x5e7583;}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0xbd')]=function(_0x1bb4cb){try{if(this[_0x5975('0x5d')](_0x1bb4cb)){logger[_0x5975('0x40')](_0x5975('0xbe'),_0x1bb4cb[_0x5975('0x47')],util[_0x5975('0x38')](_0x1bb4cb,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x1bb4cb[_0x5975('0x47')]]){for(var _0x4d62e0=0x0,_0x591594={};_0x4d62e0<this[_0x5975('0x39')][_0x1bb4cb[_0x5975('0x47')]][_0x5975('0xbf')];_0x4d62e0+=0x1){_0x591594=this['queueReports'][_0x1bb4cb[_0x5975('0x47')]][_0x4d62e0];if(this[_0x5975('0xf')][_0x591594['queue']]){if(_0x591594[_0x5975('0x99')]&&_0x591594['transfer']!=!![]){this[_0x5975('0xf')][_0x591594['queue']][_0x5975('0x55')]+=0x1;}if(_0x591594[_0x5975('0x7f')]){this['voiceQueues'][_0x591594[_0x5975('0x62')]][_0x5975('0xc0')]+=0x1;}this['voiceQueues'][_0x591594['queue']][_0x5975('0x52')]+=moment(_0x591594[_0x5975('0x86')])[_0x5975('0xc1')](_0x591594[_0x5975('0x6f')],_0x5975('0x9b'))||0x0;if(_0x4d62e0===this['queueReports'][_0x1bb4cb[_0x5975('0x47')]][_0x5975('0xbf')]-0x1){this[_0x5975('0xf')][_0x591594['queue']][_0x5975('0x51')]+=moment()[_0x5975('0xc2')](0x0)[_0x5975('0xc1')](_0x591594['queuecallerjoinAt'],_0x5975('0x9b'));this[_0x5975('0xf')][_0x591594[_0x5975('0x62')]][_0x5975('0x53')]+=0x1;if(_0x591594['queuecallercomplete']){this[_0x5975('0xf')][_0x591594[_0x5975('0x62')]][_0x5975('0x4d')]+=0x1;this['voiceQueues'][_0x591594[_0x5975('0x62')]][_0x5975('0x50')]+=moment()[_0x5975('0xc2')](0x0)['diff'](_0x591594[_0x5975('0x86')],_0x5975('0x9b'));_0x591594[_0x5975('0x7c')]=moment()['format'](_0x5975('0x70'));_0x591594['queuecallerexit']=![];_0x591594[_0x5975('0x91')]=null;}if(_0x591594[_0x5975('0x99')]&&_0x591594[_0x5975('0x92')]!=!![]){_0x591594[_0x5975('0xc3')]=_0x5975('0x55');logger[_0x5975('0x40')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x1bb4cb[_0x5975('0x47')],util[_0x5975('0x38')](_0x591594,{'showHidden':![],'depth':null}));ami[_0x5975('0x3e')]('custom:queuecallerunmanaged',_0x591594);}if(_0x591594['queuecallerabandon']){_0x591594[_0x5975('0xc3')]=_0x5975('0xc0');logger[_0x5975('0x40')](_0x5975('0xc4'),_0x1bb4cb[_0x5975('0x47')],util['inspect'](_0x591594,{'showHidden':![],'depth':null}));ami[_0x5975('0x3e')](_0x5975('0xc5'),_0x591594);}}else{this[_0x5975('0xf')][_0x591594[_0x5975('0x62')]][_0x5975('0x51')]+=this[_0x5975('0xf')][_0x591594[_0x5975('0x62')]][_0x5975('0x52')];}logger[_0x5975('0x63')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1bb4cb[_0x5975('0x47')],_0x591594['name'],_0x591594[_0x5975('0x54')],_0x1bb4cb[_0x5975('0xc6')]);this[_0x5975('0xe')][_0x1bb4cb[_0x5975('0x47')]]=_0x591594;this[_0x5975('0x44')](_0x591594,'hangup');this[_0x5975('0x4a')](this[_0x5975('0xf')][_0x591594[_0x5975('0x62')]],_0x5975('0x1e'));}}logger['debug'](_0x5975('0xc7'),_0x1bb4cb['uniqueid'],util[_0x5975('0x38')](this['queueReports'][_0x1bb4cb[_0x5975('0x47')]],{'showHidden':![],'depth':null}));ami[_0x5975('0x3e')](_0x5975('0xc8'),this[_0x5975('0x39')][_0x1bb4cb[_0x5975('0x47')]]);delete this[_0x5975('0x39')][_0x1bb4cb[_0x5975('0x47')]];delete this[_0x5975('0xe')][_0x1bb4cb[_0x5975('0x47')]];}if(this[_0x5975('0x12')][_0x1bb4cb['uniqueid']]){delete this[_0x5975('0x12')][_0x1bb4cb[_0x5975('0x47')]];}}}catch(_0x41a9e7){logger['error'](_0x5975('0xbe'),_0x1bb4cb['uniqueid'],util['inspect'](_0x41a9e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')]['syncAttendedTransfer']=function(_0x42059b){try{if(this[_0x5975('0x5d')](_0x42059b)){logger[_0x5975('0x40')](_0x5975('0xc9'),_0x42059b[_0x5975('0x47')],util[_0x5975('0x38')](_0x42059b,{'showHidden':![],'depth':null}));var _0x50ad1d;if(this['queueReports'][_0x42059b[_0x5975('0xca')]]){_0x50ad1d=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x42059b[_0x5975('0xca')]]);_0x50ad1d[_0x5975('0xcb')]=_0x42059b[_0x5975('0xcc')];_0x50ad1d[_0x5975('0xa0')]=_0x42059b[_0x5975('0xcd')];_0x50ad1d[_0x5975('0x81')]=_0x5975('0xce');_0x50ad1d[_0x5975('0x92')]=!![];_0x50ad1d[_0x5975('0x9d')]=_0x5975('0xcf');if(this[_0x5975('0x39')][_0x42059b[_0x5975('0xcd')]]){var _0x3e459f=this[_0x5975('0x39')][_0x42059b['secondtransfereruniqueid']];this[_0x5975('0x39')][_0x42059b['secondtransfereruniqueid']]=this[_0x5975('0x39')][_0x42059b['transfereeuniqueid']];this['queueReports'][_0x42059b[_0x5975('0xca')]]=_0x3e459f;var _0x288764=_[_0x5975('0x7a')](this['queueReports'][_0x42059b[_0x5975('0xca')]]);_0x288764[_0x5975('0x2e')]=!![];}logger[_0x5975('0x63')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x42059b['uniqueid'],_0x50ad1d['name'],_0x50ad1d[_0x5975('0x54')],_0x50ad1d[_0x5975('0xcb')],_0x50ad1d[_0x5975('0xa0')]);}else if(this['queueReports'][_0x42059b[_0x5975('0xd0')]]){_0x50ad1d=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x42059b[_0x5975('0xd0')]]);_0x50ad1d[_0x5975('0xcb')]=_0x42059b['origtransfererexten'];_0x50ad1d[_0x5975('0xa0')]=_0x42059b[_0x5975('0xd1')];_0x50ad1d[_0x5975('0x81')]=_0x5975('0xce');_0x50ad1d[_0x5975('0x92')]=!![];_0x50ad1d['transfertype']='ATTENDED';if(this[_0x5975('0x39')][_0x42059b[_0x5975('0xd1')]]){var _0x3e459f=this[_0x5975('0x39')][_0x42059b[_0x5975('0xd1')]];this[_0x5975('0x39')][_0x42059b[_0x5975('0xd1')]]=this['queueReports'][_0x42059b[_0x5975('0xd0')]];this[_0x5975('0x39')][_0x42059b[_0x5975('0xd0')]]=_0x3e459f;var _0x288764=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x42059b[_0x5975('0xd0')]]);_0x288764[_0x5975('0x2e')]=!![];}logger[_0x5975('0x63')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x42059b[_0x5975('0x47')],_0x50ad1d[_0x5975('0x42')],_0x50ad1d[_0x5975('0x54')],_0x50ad1d[_0x5975('0xcb')],_0x50ad1d[_0x5975('0xa0')]);}}}catch(_0xab215){logger[_0x5975('0x36')](_0x5975('0xc9'),_0x42059b[_0x5975('0x47')],util[_0x5975('0x38')](_0xab215,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')][_0x5975('0xd2')]=function(_0x42c897){try{if(this['isNotNull'](_0x42c897)){logger['debug'](_0x5975('0xd3'),_0x42c897[_0x5975('0x47')],util['inspect'](_0x42c897,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x42c897[_0x5975('0xca')]]){var _0x5db97e=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x42c897[_0x5975('0xca')]]);_0x5db97e[_0x5975('0x81')]=_0x5975('0xd4');_0x5db97e['transfer']=!![];_0x5db97e[_0x5975('0x9d')]=_0x5975('0xd5');_0x5db97e[_0x5975('0xcb')]=_0x42c897[_0x5975('0xd6')];_0x5db97e[_0x5975('0xa0')]=_0x42c897[_0x5975('0xca')];logger[_0x5975('0x63')](_0x5975('0xd7'),_0x42c897[_0x5975('0x47')],_0x5db97e[_0x5975('0x42')],_0x5db97e[_0x5975('0x54')],_0x5db97e[_0x5975('0xcb')],_0x5db97e[_0x5975('0xa0')]);this['syncHangup']({'event':_0x5975('0xd8'),'uniqueid':_0x42c897[_0x5975('0xca')],'context':_0x42c897[_0x5975('0xd9')],'channel':_0x42c897[_0x5975('0xda')]});}}}catch(_0x2abc9f){logger[_0x5975('0x36')](_0x5975('0xd3'),_0x42c897['uniqueid'],util[_0x5975('0x38')](_0x2abc9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')]['syncMusicOnHoldStart']=function(_0x545286){try{if(this['isNotNull'](_0x545286)){logger['debug'](_0x5975('0xdb'),_0x545286[_0x5975('0x47')],util['inspect'](_0x545286,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x545286[_0x5975('0x47')]]){var _0x6ef08c=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x545286['uniqueid']]);if(!_[_0x5975('0xbb')](_0x6ef08c['queuecallerleaveAt'])){_0x6ef08c['mohstarttime']=moment()['format'](_0x5975('0x70'));logger['info']('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x545286[_0x5975('0x47')],_0x6ef08c['mohstarttime']);}}}}catch(_0x325a43){logger[_0x5975('0x36')](_0x5975('0xdb'),_0x545286[_0x5975('0x47')],util[_0x5975('0x38')](_0x325a43,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5975('0x24')]=function(_0x4d5036){try{if(this[_0x5975('0x5d')](_0x4d5036)){logger['debug'](_0x5975('0xdc'),_0x4d5036[_0x5975('0x47')],util[_0x5975('0x38')](_0x4d5036,{'showHidden':![],'depth':null}));if(this[_0x5975('0x39')][_0x4d5036[_0x5975('0x47')]]){var _0x12a398=_[_0x5975('0x7a')](this[_0x5975('0x39')][_0x4d5036[_0x5975('0x47')]]);if(!_['isNil'](_0x12a398['mohstarttime'])){_0x12a398['mohtime']+=moment()[_0x5975('0xc2')](0x0)[_0x5975('0xc1')](_0x12a398[_0x5975('0xdd')],_0x5975('0x9b'));logger[_0x5975('0x63')](_0x5975('0xde'),_0x4d5036['uniqueid'],_0x12a398[_0x5975('0xdf')]);delete _0x12a398[_0x5975('0xdd')];}}}}catch(_0x36fcef){logger[_0x5975('0x36')](_0x5975('0xdc'),_0x4d5036[_0x5975('0x47')],util[_0x5975('0x38')](_0x36fcef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5975('0xa')]['syncNewExten']=function(_0x14ef5d){try{if(this['isNotNull'](_0x14ef5d)){logger[_0x5975('0x40')](_0x5975('0xe0'),_0x14ef5d[_0x5975('0x47')],util[_0x5975('0x38')](_0x14ef5d,{'showHidden':![],'depth':null}));if(_0x14ef5d[_0x5975('0xe1')]['toLowerCase']()===_0x5975('0xe2')){_0x14ef5d[_0x5975('0xe3')]=_0x14ef5d[_0x5975('0xe4')]&&_0x14ef5d[_0x5975('0xe4')]['startsWith'](_0x5975('0xe5'))?_0x14ef5d[_0x5975('0xe4')]:(_0x14ef5d[_0x5975('0xe4')]||_0x14ef5d[_0x5975('0xe3')])[_0x5975('0x96')]();if(_[_0x5975('0x95')](_0x14ef5d['applicationdata'][_0x5975('0x96')](),'cdr(')){logger['info'](_0x5975('0xe6'),_0x14ef5d['uniqueid'],_0x14ef5d[_0x5975('0xe1')],_0x14ef5d[_0x5975('0xe3')]);if(_[_0x5975('0x6e')](this[_0x5975('0xe')][_0x14ef5d['uniqueid']]))this[_0x5975('0xe')][_0x14ef5d[_0x5975('0x47')]]={};var _0x25b87c=_0x14ef5d[_0x5975('0xe3')][_0x5975('0xe7')]('=');var _0x592ba0=_0x25b87c[0x0][_0x5975('0x96')]()['match'](/cdr\((.*)\)/);if(_0x592ba0)this[_0x5975('0xe')][_0x14ef5d[_0x5975('0x47')]][_0x592ba0[0x1]]=_0x25b87c[0x1];}}}}catch(_0x50fe9e){logger[_0x5975('0x36')](_0x5975('0xe8'),_0x14ef5d[_0x5975('0x47')],util[_0x5975('0x38')](_0x50fe9e,{'showHidden':![],'depth':null}));}};module[_0x5975('0xe9')]=VoiceQueueReport;
\ No newline at end of file
index 3c70b68..21fa9dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c15=['Request','CreateReportAgentPreview','../client','createHistory'];(function(_0x357910,_0x1d7f29){var _0x3a7b67=function(_0x41774a){while(--_0x41774a){_0x357910['push'](_0x357910['shift']());}};_0x3a7b67(++_0x1d7f29);}(_0x2c15,0x1a6));var _0x52c1=function(_0x5c9517,_0xf7ff2d){_0x5c9517=_0x5c9517-0x0;var _0x46d77c=_0x2c15[_0x5c9517];return _0x46d77c;};'use strict';var client=require(_0x52c1('0x0'));exports[_0x52c1('0x1')]=function(_0x388749){return function(){_0x388749['campaign']=_0x388749['queue'];return client[_0x52c1('0x2')](_0x52c1('0x3'),{'body':_0x388749,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
+var _0x8c9a=['createHistory','campaign','queue','CreateReportAgentPreview','../client'];(function(_0xf87721,_0x21017b){var _0x4de68c=function(_0x534315){while(--_0x534315){_0xf87721['push'](_0xf87721['shift']());}};_0x4de68c(++_0x21017b);}(_0x8c9a,0x1d0));var _0xa8c9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8c9a[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0xa8c9('0x0'));exports[_0xa8c9('0x1')]=function(_0x14ab5c){return function(){_0x14ab5c[_0xa8c9('0x2')]=_0x14ab5c[_0xa8c9('0x3')];return client['Request']('CreateReportAgentPreview',{'body':_0x14ab5c,'log':_0xa8c9('0x4')});};};
\ No newline at end of file
index c920fa3..81c6709 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bdb=['../client','create','CreateAttachment'];(function(_0x222955,_0x32d95c){var _0x3d039b=function(_0x5bee3c){while(--_0x5bee3c){_0x222955['push'](_0x222955['shift']());}};_0x3d039b(++_0x32d95c);}(_0x2bdb,0x1e3));var _0xb2bd=function(_0x15af1d,_0x1df924){_0x15af1d=_0x15af1d-0x0;var _0x15a9df=_0x2bdb[_0x15af1d];return _0x15a9df;};'use strict';var client=require(_0xb2bd('0x0'));exports[_0xb2bd('0x1')]=function(_0xae2840){return client['Request'](_0xb2bd('0x2'),{'body':_0xae2840,'log':_0xb2bd('0x2')});};
\ No newline at end of file
+var _0xaaf7=['CreateAttachment','../client','create','Request'];(function(_0x3b58dd,_0x5f3b40){var _0x3539ca=function(_0xa894bf){while(--_0xa894bf){_0x3b58dd['push'](_0x3b58dd['shift']());}};_0x3539ca(++_0x5f3b40);}(_0xaaf7,0x79));var _0x7aaf=function(_0x58ce90,_0x3284ea){_0x58ce90=_0x58ce90-0x0;var _0x1cd178=_0xaaf7[_0x58ce90];return _0x1cd178;};'use strict';var client=require(_0x7aaf('0x0'));exports[_0x7aaf('0x1')]=function(_0x2250b7){return client[_0x7aaf('0x2')](_0x7aaf('0x3'),{'body':_0x2250b7,'log':_0x7aaf('0x3')});};
\ No newline at end of file
index ca1abb2..b6e7a80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x2e6d69,_0x1084bf){var _0x4f4a1e=function(_0x561fa1){while(--_0x561fa1){_0x2e6d69['push'](_0x2e6d69['shift']());}};_0x4f4a1e(++_0x1084bf);}(_0x326f,0xd1));var _0xf326=function(_0x37d529,_0x49c3bb){_0x37d529=_0x37d529-0x0;var _0x32645c=_0x326f[_0x37d529];return _0x32645c;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x43219a,_0x2e2b72){var _0x15350a=function(_0x389550){while(--_0x389550){_0x43219a['push'](_0x43219a['shift']());}};_0x15350a(++_0x2e2b72);}(_0x326f,0xd1));var _0xf326=function(_0x3aa18e,_0x4c9e5d){_0x3aa18e=_0x3aa18e-0x0;var _0x4f3f41=_0x326f[_0x3aa18e];return _0x4f3f41;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index 52fda92..c70c6c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeace=['CreateCmContact','getContacts','Request','GetCmContact','../client'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xeace,0x180));var _0xeeac=function(_0x44fa9e,_0x3324ef){_0x44fa9e=_0x44fa9e-0x0;var _0x4d60df=_0xeace[_0x44fa9e];return _0x4d60df;};'use strict';var client=require(_0xeeac('0x0'));exports['createContact']=function(_0x4bfa7c){return function(){return client['Request'](_0xeeac('0x1'),{'body':_0x4bfa7c,'log':_0xeeac('0x1')});};};exports[_0xeeac('0x2')]=function(_0xf21f5d){return function(){return client[_0xeeac('0x3')](_0xeeac('0x4'),{'options':_0xf21f5d,'log':_0xeeac('0x4')});};};
\ No newline at end of file
+var _0xdfd6=['getContacts','GetCmContact','../client','createContact','Request'];(function(_0x150313,_0x267275){var _0x3ac18a=function(_0x58a7f7){while(--_0x58a7f7){_0x150313['push'](_0x150313['shift']());}};_0x3ac18a(++_0x267275);}(_0xdfd6,0x1a6));var _0x6dfd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdfd6[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x6dfd('0x0'));exports[_0x6dfd('0x1')]=function(_0x37c76e){return function(){return client[_0x6dfd('0x2')]('CreateCmContact',{'body':_0x37c76e,'log':'CreateCmContact'});};};exports[_0x6dfd('0x3')]=function(_0x1adc52){return function(){return client['Request'](_0x6dfd('0x4'),{'options':_0x1adc52,'log':_0x6dfd('0x4')});};};
\ No newline at end of file
index 2cebccb..cbdaf7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17d2=['scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','ContactId','ListId','countReScheduled','getContactPreview','User','Agent','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','db.CmHopper.UserId','lodash','Request','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','priority','DESC'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x17d2,0x1e9));var _0x217d=function(_0x1d517e,_0x21b4db){_0x1d517e=_0x1d517e-0x0;var _0x33b996=_0x17d2[_0x1d517e];return _0x33b996;};'use strict';var client=require('../client');var moment=require('moment');var _=require(_0x217d('0x0'));exports['getContacts']=function(_0x2ab1a3,_0x38de2d){return function(){return client[_0x217d('0x1')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x2ab1a3},'include':[{'model':_0x217d('0x2'),'as':_0x217d('0x3')}],'limit':_0x38de2d,'raw':![]},'log':_0x217d('0x4')});};};exports[_0x217d('0x5')]=function(_0x42e295,_0x154ad3,_0x586a5e){return function(){return client['Request'](_0x217d('0x6'),{'body':_0x42e295,'options':{'where':{'VoiceQueueId':_0x154ad3,'scheduledat':{'$lte':moment()['format'](_0x217d('0x7'))}},'limit':_0x586a5e},'log':'UpdateCmHopper'});};};exports[_0x217d('0x8')]=function(_0x20da9d){return function(){return client[_0x217d('0x1')](_0x217d('0x6'),{'body':_0x20da9d,'options':{'where':{'ContactId':_0x20da9d['ContactId'],'ListId':_0x20da9d['ListId'],'VoiceQueueId':_0x20da9d[_0x217d('0x9')],'CampaignId':_0x20da9d[_0x217d('0xa')]}},'log':'rescheduleContact'});};};exports[_0x217d('0xb')]=function(_0xb8a492,_0x547407,_0x4fba7e){return function(){return client[_0x217d('0x1')](_0x217d('0xc'),{'options':{'where':{'VoiceQueueId':_0xb8a492,'ListId':_0x547407,'ContactId':_0x4fba7e}},'log':_0x217d('0xc')});};};exports[_0x217d('0xd')]=function(_0x552a4e,_0x397faf,_0x339920,_0x57f56a){return function(){return client['Request'](_0x217d('0xe'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x552a4e,'active':![],'scheduledat':{'$lte':moment()[_0x217d('0xf')](_0x217d('0x7'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x397faf}}]},'order':[[_0x217d('0x10'),_0x217d('0x11')],[_0x217d('0x12'),_0x57f56a],['id',_0x217d('0x13')]],'raw':!![],'limit':_0x339920},'log':_0x217d('0xe')});};};exports[_0x217d('0x14')]=function(_0x5d3f52,_0x221aea,_0x2732ff){return function(){return client[_0x217d('0x1')](_0x217d('0xe'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x5d3f52,'active':![],'scheduledat':{'$lte':moment()[_0x217d('0xf')](_0x217d('0x7'))}},'include':[{'model':'CmContact','as':'Contact'}],'order':[['priority',_0x217d('0x11')],[_0x217d('0x12'),_0x2732ff],['id',_0x217d('0x13')]],'raw':!![],'limit':_0x221aea},'log':_0x217d('0x15')});};};exports[_0x217d('0x16')]=function(_0x6ce706,_0x331f42){return function(){_0x6ce706[_0x217d('0x17')]=_0x6ce706[_0x217d('0x18')];return client[_0x217d('0x1')](_0x217d('0x19'),{'body':_0x6ce706,'options':{'where':{'ContactId':_0x6ce706[_0x217d('0x1a')],'ListId':_0x6ce706[_0x217d('0x1b')],'VoiceQueueId':_0x6ce706[_0x217d('0x9')],'CampaignId':_0x6ce706[_0x217d('0xa')],'active':_0x331f42?undefined:!![]}},'log':_0x217d('0x19')});};};exports[_0x217d('0x1c')]=function(_0x4f610a){return function(){return client[_0x217d('0x1')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x4f610a['id']?_0x4f610a['id']||null:null}},'log':_0x217d('0x1c')});};};exports[_0x217d('0x1d')]=function(_0x40b4c2){return function(){return client[_0x217d('0x1')]('GetCmHopperPreview',{'options':{'where':{'id':_0x40b4c2},'include':[{'model':'CmContact','as':_0x217d('0x3')},{'model':_0x217d('0x1e'),'as':_0x217d('0x1f'),'attributes':['id',_0x217d('0x20')]},{'model':_0x217d('0x21'),'as':_0x217d('0x22'),'attributes':['id',_0x217d('0x20')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x217d('0x23')]=function(_0x278013,_0x14f05e,_0x53188b){return function(){return client[_0x217d('0x1')](_0x217d('0x6'),{'body':_0x278013,'options':{'where':{'id':_0x14f05e},'limit':_0x53188b},'log':_0x217d('0x6')});};};exports[_0x217d('0x24')]=function(_0x546879,_0x156f73){return function(){return client['Request'](_0x217d('0x25'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x546879,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x217d('0xf')](_0x217d('0x7'))},'UserId':{'$in':_0x156f73}},'order':[[_0x217d('0x10'),_0x217d('0x11')],[_0x217d('0x12'),_0x217d('0x11')],['id',_0x217d('0x13')]],'include':[{'model':_0x217d('0x2'),'as':'Contact'},{'model':'User','as':'Agent','attributes':['id',_0x217d('0x20'),'voicePause']}],'group':_0x217d('0x26'),'raw':!![]},'log':_0x217d('0xe')});};};
\ No newline at end of file
+var _0xa948=['name','VoiceQueue','Queue','unlockContact','GetContactRecallMe','db.CmHopper.UserId','../client','moment','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','queue','MoveContactManagedDialer','CountReScheduled','Agent'];(function(_0x4c00a3,_0x2d23e2){var _0x893854=function(_0x6f552c){while(--_0x6f552c){_0x4c00a3['push'](_0x4c00a3['shift']());}};_0x893854(++_0x2d23e2);}(_0xa948,0x1e7));var _0x8a94=function(_0x12f654,_0x4e1c65){_0x12f654=_0x12f654-0x0;var _0x59b5ae=_0xa948[_0x12f654];return _0x59b5ae;};'use strict';var client=require(_0x8a94('0x0'));var moment=require(_0x8a94('0x1'));var _=require('lodash');exports[_0x8a94('0x2')]=function(_0x356861,_0x1420f2){return function(){return client[_0x8a94('0x3')](_0x8a94('0x4'),{'options':{'where':{'VoiceQueueId':_0x356861},'include':[{'model':_0x8a94('0x5'),'as':_0x8a94('0x6')}],'limit':_0x1420f2,'raw':![]},'log':_0x8a94('0x7')});};};exports[_0x8a94('0x8')]=function(_0x1ac885,_0x3c7393,_0x5a4943){return function(){return client[_0x8a94('0x3')](_0x8a94('0x9'),{'body':_0x1ac885,'options':{'where':{'VoiceQueueId':_0x3c7393,'scheduledat':{'$lte':moment()[_0x8a94('0xa')](_0x8a94('0xb'))}},'limit':_0x5a4943},'log':'UpdateCmHopper'});};};exports[_0x8a94('0xc')]=function(_0xafff3e){return function(){return client[_0x8a94('0x3')](_0x8a94('0x9'),{'body':_0xafff3e,'options':{'where':{'ContactId':_0xafff3e[_0x8a94('0xd')],'ListId':_0xafff3e[_0x8a94('0xe')],'VoiceQueueId':_0xafff3e[_0x8a94('0xf')],'CampaignId':_0xafff3e[_0x8a94('0x10')]}},'log':_0x8a94('0xc')});};};exports[_0x8a94('0x11')]=function(_0x1ca438,_0x472d23,_0x34bea9){return function(){return client[_0x8a94('0x3')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x1ca438,'ListId':_0x472d23,'ContactId':_0x34bea9}},'log':_0x8a94('0x12')});};};exports['getContactDialer']=function(_0x19c7ed,_0x294359,_0x99480d,_0x58dd1a){return function(){return client['Request'](_0x8a94('0x13'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x19c7ed,'active':![],'scheduledat':{'$lte':moment()[_0x8a94('0xa')](_0x8a94('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x294359}}]},'order':[[_0x8a94('0x14'),_0x8a94('0x15')],[_0x8a94('0x16'),_0x58dd1a],['id',_0x8a94('0x17')]],'raw':!![],'limit':_0x99480d},'log':_0x8a94('0x13')});};};exports[_0x8a94('0x18')]=function(_0x553f91,_0x3a8ca6,_0x312f55){return function(){return client[_0x8a94('0x3')](_0x8a94('0x13'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x553f91,'active':![],'scheduledat':{'$lte':moment()[_0x8a94('0xa')](_0x8a94('0xb'))}},'include':[{'model':'CmContact','as':'Contact'}],'order':[[_0x8a94('0x14'),_0x8a94('0x15')],['scheduledat',_0x312f55],['id',_0x8a94('0x17')]],'raw':!![],'limit':_0x3a8ca6},'log':_0x8a94('0x19')});};};exports[_0x8a94('0x1a')]=function(_0x500870,_0x317256){return function(){_0x500870['campaign']=_0x500870[_0x8a94('0x1b')];return client['Request']('MoveContactManagedDialer',{'body':_0x500870,'options':{'where':{'ContactId':_0x500870['ContactId'],'ListId':_0x500870[_0x8a94('0xe')],'VoiceQueueId':_0x500870['VoiceQueueId'],'CampaignId':_0x500870[_0x8a94('0x10')],'active':_0x317256?undefined:!![]}},'log':_0x8a94('0x1c')});};};exports['countReScheduled']=function(_0x23884f){return function(){return client[_0x8a94('0x3')](_0x8a94('0x1d'),{'options':{'where':{'VoiceQueueId':_0x23884f['id']?_0x23884f['id']||null:null}},'log':'countReScheduled'});};};exports['getContactPreview']=function(_0x2e9f2c){return function(){return client[_0x8a94('0x3')]('GetCmHopperPreview',{'options':{'where':{'id':_0x2e9f2c},'include':[{'model':'CmContact','as':'Contact'},{'model':'User','as':_0x8a94('0x1e'),'attributes':['id',_0x8a94('0x1f')]},{'model':_0x8a94('0x20'),'as':_0x8a94('0x21'),'attributes':['id','name']}],'raw':!![]},'log':_0x8a94('0x7')});};};exports[_0x8a94('0x22')]=function(_0x1322e5,_0x16c704,_0x12941b){return function(){return client['Request'](_0x8a94('0x9'),{'body':_0x1322e5,'options':{'where':{'id':_0x16c704},'limit':_0x12941b},'log':_0x8a94('0x9')});};};exports['getContactRecallMe']=function(_0xac83da,_0x1d3d98){return function(){return client[_0x8a94('0x3')](_0x8a94('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0xac83da,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x8a94('0xa')](_0x8a94('0xb'))},'UserId':{'$in':_0x1d3d98}},'order':[['priority',_0x8a94('0x15')],['scheduledat',_0x8a94('0x15')],['id',_0x8a94('0x17')]],'include':[{'model':_0x8a94('0x5'),'as':'Contact'},{'model':'User','as':_0x8a94('0x1e'),'attributes':['id','name','voicePause']}],'group':_0x8a94('0x24'),'raw':!![]},'log':_0x8a94('0x13')});};};
\ No newline at end of file
index 59a8c02..928a0f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['phone','GetCmHopperBlackIvr','Request','GetCmHopperBlack','VoiceQueueId','Contact','checkIsBlackListIvr','CampaignId'];(function(_0x29f63a,_0x308298){var _0xfcda7a=function(_0xda39ad){while(--_0xda39ad){_0x29f63a['push'](_0x29f63a['shift']());}};_0xfcda7a(++_0x308298);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['checkIsBlackList']=function(_0x2936e7){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'where':{'VoiceQueueId':_0x2936e7[_0x3071('0x2')],'phone':_0x2936e7[_0x3071('0x3')]['phone']},'raw':![]},'log':_0x3071('0x1')});};};exports[_0x3071('0x4')]=function(_0x33a70c){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'where':{'CampaignId':_0x33a70c[_0x3071('0x5')],'phone':_0x33a70c[_0x3071('0x3')][_0x3071('0x6')]},'raw':![]},'log':_0x3071('0x7')});};};
\ No newline at end of file
+var _0x4483=['Contact','phone','Request','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','GetCmHopperBlack','VoiceQueueId'];(function(_0x4c7410,_0x43bf77){var _0x2cf87d=function(_0x5f3db0){while(--_0x5f3db0){_0x4c7410['push'](_0x4c7410['shift']());}};_0x2cf87d(++_0x43bf77);}(_0x4483,0x1a3));var _0x3448=function(_0x4a3a54,_0x9aaf38){_0x4a3a54=_0x4a3a54-0x0;var _0x131789=_0x4483[_0x4a3a54];return _0x131789;};'use strict';var client=require(_0x3448('0x0'));exports[_0x3448('0x1')]=function(_0x229c0c){return function(){return client['Request'](_0x3448('0x2'),{'options':{'where':{'VoiceQueueId':_0x229c0c[_0x3448('0x3')],'phone':_0x229c0c[_0x3448('0x4')][_0x3448('0x5')]},'raw':![]},'log':_0x3448('0x2')});};};exports['checkIsBlackListIvr']=function(_0xeb5b8){return function(){return client[_0x3448('0x6')](_0x3448('0x2'),{'options':{'where':{'CampaignId':_0xeb5b8[_0x3448('0x7')],'phone':_0xeb5b8[_0x3448('0x4')][_0x3448('0x5')]},'raw':![]},'log':_0x3448('0x8')});};};
\ No newline at end of file
index 6b2e777..b0ed7fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71c0=['CreateCmHopperFinal','../client','createContact','campaign','queue','Request'];(function(_0x4fdfa2,_0x3f0cfa){var _0x26a53a=function(_0x1e897d){while(--_0x1e897d){_0x4fdfa2['push'](_0x4fdfa2['shift']());}};_0x26a53a(++_0x3f0cfa);}(_0x71c0,0x187));var _0x071c=function(_0x57af6d,_0x19da59){_0x57af6d=_0x57af6d-0x0;var _0x1ae783=_0x71c0[_0x57af6d];return _0x1ae783;};'use strict';var client=require(_0x071c('0x0'));exports[_0x071c('0x1')]=function(_0x3adc80){return function(){_0x3adc80[_0x071c('0x2')]=_0x3adc80[_0x071c('0x3')];return client[_0x071c('0x4')](_0x071c('0x5'),{'body':_0x3adc80,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0x93f6=['queue','Request','CreateCmHopperFinal','campaign'];(function(_0x42a094,_0x2b8da0){var _0xfe98e6=function(_0x4131ce){while(--_0x4131ce){_0x42a094['push'](_0x42a094['shift']());}};_0xfe98e6(++_0x2b8da0);}(_0x93f6,0x1f3));var _0x693f=function(_0x39a259,_0xb4e7a9){_0x39a259=_0x39a259-0x0;var _0x515be6=_0x93f6[_0x39a259];return _0x515be6;};'use strict';var client=require('../client');exports['createContact']=function(_0x2b51dc){return function(){_0x2b51dc[_0x693f('0x0')]=_0x2b51dc[_0x693f('0x1')];return client[_0x693f('0x2')](_0x693f('0x3'),{'body':_0x2b51dc,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
index eeb3023..46675a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae09=['endOf','queue','getCampaignHopperHistory','GetCampaignHopperHistory','startOf','campaign','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','day'];(function(_0x18b165,_0x40a7ea){var _0x1d8e19=function(_0x49d432){while(--_0x49d432){_0x18b165['push'](_0x18b165['shift']());}};_0x1d8e19(++_0x40a7ea);}(_0xae09,0x1d5));var _0x9ae0=function(_0x202b56,_0x534cc4){_0x202b56=_0x202b56-0x0;var _0x4def88=_0xae09[_0x202b56];return _0x4def88;};'use strict';var client=require('../client');var moment=require('moment');exports['createHistory']=function(_0x262b38){return function(){_0x262b38[_0x9ae0('0x0')]=_0x262b38['queue'];return client[_0x9ae0('0x1')](_0x9ae0('0x2'),{'body':_0x262b38,'log':'CreateCmHopperHistory'});};};exports[_0x9ae0('0x3')]=function(_0x59cb64){return function(){return client[_0x9ae0('0x1')](_0x9ae0('0x4'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x59cb64,_0x9ae0('0x5'))[_0x9ae0('0x6')](_0x9ae0('0x7')),moment()['format'](_0x9ae0('0x7'))]}},'raw':![]},'log':_0x9ae0('0x8')});};};exports['getVoiceQueueHopperHistory']=function(_0x49f6b9){return function(){return client[_0x9ae0('0x1')](_0x9ae0('0x9'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x9ae0('0xa'))[_0x9ae0('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x9ae0('0xb')]('day')[_0x9ae0('0x6')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x9ae0('0xc')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0x9ae0('0xd')]=function(_0x2d9e7c){return function(){return client[_0x9ae0('0x1')](_0x9ae0('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x9ae0('0xf')](_0x9ae0('0xa'))[_0x9ae0('0x6')](_0x9ae0('0x7')),moment()[_0x9ae0('0xb')]('day')[_0x9ae0('0x6')](_0x9ae0('0x7'))]},'campaigntype':'ivr'},'raw':![]},'log':_0x9ae0('0xe')});};};
\ No newline at end of file
+var _0x01aa=['avgHandleTime','Request','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory','GetCampaignHopperHistory','ivr','moment','campaign','queue','CreateCmHopperHistory'];(function(_0x294d3c,_0x4f573b){var _0x1db14d=function(_0x25337a){while(--_0x25337a){_0x294d3c['push'](_0x294d3c['shift']());}};_0x1db14d(++_0x4f573b);}(_0x01aa,0xa7));var _0xa01a=function(_0x3b32ff,_0x16b2b4){_0x3b32ff=_0x3b32ff-0x0;var _0x1f0f6f=_0x01aa[_0x3b32ff];return _0x1f0f6f;};'use strict';var client=require('../client');var moment=require(_0xa01a('0x0'));exports['createHistory']=function(_0x448b11){return function(){_0x448b11[_0xa01a('0x1')]=_0x448b11[_0xa01a('0x2')];return client['Request'](_0xa01a('0x3'),{'body':_0x448b11,'log':_0xa01a('0x3')});};};exports[_0xa01a('0x4')]=function(_0x25b7f9){return function(){return client[_0xa01a('0x5')](_0xa01a('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x25b7f9,_0xa01a('0x7'))[_0xa01a('0x8')](_0xa01a('0x9')),moment()[_0xa01a('0x8')](_0xa01a('0x9'))]}},'raw':![]},'log':_0xa01a('0xa')});};};exports[_0xa01a('0xb')]=function(_0x5a670f){return function(){return client[_0xa01a('0x5')](_0xa01a('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xa01a('0xd')](_0xa01a('0xe'))['format'](_0xa01a('0x9')),moment()[_0xa01a('0xf')](_0xa01a('0xe'))[_0xa01a('0x8')](_0xa01a('0x9'))]},'campaigntype':_0xa01a('0x2')},'raw':![]},'log':_0xa01a('0xc')});};};exports[_0xa01a('0x10')]=function(_0x163555){return function(){return client[_0xa01a('0x5')](_0xa01a('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xa01a('0xd')]('day')[_0xa01a('0x8')](_0xa01a('0x9')),moment()[_0xa01a('0xf')]('day')[_0xa01a('0x8')](_0xa01a('0x9'))]},'campaigntype':_0xa01a('0x12')},'raw':![]},'log':_0xa01a('0x11')});};};
\ No newline at end of file
index 066449f..e256344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e24=['TrunkId','ListId','key','Trunk','name','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','description','ecm','headerinfo','localstationid','maxrate','modem','gateway','faxdetect','t38timeout','tech'];(function(_0x2ab365,_0xa3812e){var _0x49fef3=function(_0x29b883){while(--_0x29b883){_0x2ab365['push'](_0x2ab365['shift']());}};_0x49fef3(++_0xa3812e);}(_0x1e24,0x82));var _0x41e2=function(_0x5e1fb6,_0xf3495b){_0x5e1fb6=_0x5e1fb6-0x0;var _0x2cf20e=_0x1e24[_0x5e1fb6];return _0x2cf20e;};'use strict';var client=require(_0x41e2('0x0'));exports[_0x41e2('0x1')]=function(){return function(){return client[_0x41e2('0x2')](_0x41e2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x41e2('0x4'),_0x41e2('0x5'),_0x41e2('0x6'),_0x41e2('0x7'),'minrate',_0x41e2('0x8'),_0x41e2('0x9'),_0x41e2('0xa'),_0x41e2('0xb'),_0x41e2('0xc'),_0x41e2('0xd'),_0x41e2('0xe'),_0x41e2('0xf'),_0x41e2('0x10')],'include':[{'model':'Trunk','as':_0x41e2('0x11'),'attributes':['id',_0x41e2('0x12'),_0x41e2('0x13'),_0x41e2('0x14')]}]},'log':_0x41e2('0x15')});};};exports[_0x41e2('0x16')]=function(_0x19a116,_0x45f65c){return client[_0x41e2('0x2')]('NotifyFaxAccount',{'account':{'id':_0x19a116},'body':_0x45f65c,'log':_0x41e2('0x17')});};
\ No newline at end of file
+var _0x2ace=['notify','NotifyFaxAccount','getFaxAccounts','Request','GetFaxAccount','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','active'];(function(_0x58a310,_0x139725){var _0x4c5599=function(_0x433d24){while(--_0x433d24){_0x58a310['push'](_0x58a310['shift']());}};_0x4c5599(++_0x139725);}(_0x2ace,0x17e));var _0xe2ac=function(_0x254744,_0x219e6b){_0x254744=_0x254744-0x0;var _0x2a6a96=_0x2ace[_0x254744];return _0x2a6a96;};'use strict';var client=require('../client');exports[_0xe2ac('0x0')]=function(){return function(){return client[_0xe2ac('0x1')](_0xe2ac('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xe2ac('0x3'),_0xe2ac('0x4'),'headerinfo',_0xe2ac('0x5'),_0xe2ac('0x6'),_0xe2ac('0x7'),_0xe2ac('0x8'),_0xe2ac('0x9'),_0xe2ac('0xa'),_0xe2ac('0xb'),_0xe2ac('0xc'),_0xe2ac('0xd'),_0xe2ac('0xe'),_0xe2ac('0xf')],'include':[{'model':_0xe2ac('0x10'),'as':_0xe2ac('0x10'),'attributes':['id','name','callerid',_0xe2ac('0x11')]}]},'log':'getFaxAccount'});};};exports[_0xe2ac('0x12')]=function(_0x36fbdf,_0x540a1e){return client[_0xe2ac('0x1')](_0xe2ac('0x13'),{'account':{'id':_0x36fbdf},'body':_0x540a1e,'log':_0xe2ac('0x13')});};
\ No newline at end of file
index 661b0eb..af6e35c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde49=['../client'];(function(_0x40015a,_0x415db5){var _0x42f8a4=function(_0x5685ad){while(--_0x5685ad){_0x40015a['push'](_0x40015a['shift']());}};_0x42f8a4(++_0x415db5);}(_0xde49,0x18b));var _0x9de4=function(_0x2e8105,_0x10d6e5){_0x2e8105=_0x2e8105-0x0;var _0x413a95=_0xde49[_0x2e8105];return _0x413a95;};'use strict';var client=require(_0x9de4('0x0'));exports['update']=function(_0x2fe355,_0x27ba42){return client['Request']('UpdateFaxMessage',{'body':_0x27ba42,'options':{'where':{'AttachmentId':_0x2fe355}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x4504=['UpdateFaxMessage','../client','update','Request'];(function(_0x3cc6fe,_0x53ddb1){var _0x4c5c6f=function(_0x240105){while(--_0x240105){_0x3cc6fe['push'](_0x3cc6fe['shift']());}};_0x4c5c6f(++_0x53ddb1);}(_0x4504,0xe5));var _0x4450=function(_0xe6fe89,_0x4775bd){_0xe6fe89=_0xe6fe89-0x0;var _0x2a5fe1=_0x4504[_0xe6fe89];return _0x2a5fe1;};'use strict';var client=require(_0x4450('0x0'));exports[_0x4450('0x1')]=function(_0x5a5e8c,_0x214af7){return client[_0x4450('0x2')]('UpdateFaxMessage',{'body':_0x214af7,'options':{'where':{'AttachmentId':_0x5a5e8c}},'log':_0x4450('0x3')});};
\ No newline at end of file
index 5b59ab7..f21be8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x483b=['authType','type','DeskConfiguration','Configurations','Subjects','variableName','Variable','DeskField','Descriptions','content','key','keyType','keyContent','idField','nameField','customField','Tag','Tags','getDeskAccounts','GetDeskAccount','name','description','username','password','remoteUri'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x483b,0xa8));var _0xb483=function(_0xbbbed6,_0x943818){_0xbbbed6=_0xbbbed6-0x0;var _0x177503=_0x483b[_0xbbbed6];return _0x177503;};'use strict';var client=require('../../client');exports[_0xb483('0x0')]=function(){return function(_0x265b78){return client['Request'](_0xb483('0x1'),{'options':{'raw':![],'attributes':['id',_0xb483('0x2'),_0xb483('0x3'),_0xb483('0x4'),_0xb483('0x5'),_0xb483('0x6'),_0xb483('0x7'),_0xb483('0x8'),'serverUrl'],'include':[{'model':_0xb483('0x9'),'as':_0xb483('0xa'),'attributes':['id',_0xb483('0x2')],'include':[{'model':'DeskField','as':_0xb483('0xb'),'attributes':['id',_0xb483('0x8'),'content',_0xb483('0xc')],'include':[{'model':_0xb483('0xd'),'as':_0xb483('0xd'),'attributes':['id',_0xb483('0x2')]}]},{'model':_0xb483('0xe'),'as':_0xb483('0xf'),'attributes':['id','type',_0xb483('0x10'),_0xb483('0x11'),_0xb483('0x12'),_0xb483('0x13'),_0xb483('0xc')],'include':[{'model':'Variable','as':_0xb483('0xd'),'attributes':['id',_0xb483('0x2')]}]},{'model':_0xb483('0xe'),'as':'Fields','attributes':['id',_0xb483('0x8'),_0xb483('0x10'),_0xb483('0x14'),_0xb483('0x15'),_0xb483('0x16'),_0xb483('0xc')],'include':[{'model':_0xb483('0xd'),'as':_0xb483('0xd'),'attributes':['id',_0xb483('0x2')]}]},{'model':_0xb483('0x17'),'as':_0xb483('0x18'),'attributes':['id','name']}]}]},'log':_0xb483('0x1')});};};
\ No newline at end of file
+var _0x32c0=['Subjects','content','variableName','Variable','Descriptions','keyType','keyContent','idField','nameField','Tag','Tags','../../client','getDeskAccounts','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','Configurations','DeskField'];(function(_0x2f5189,_0x189535){var _0x2f48f3=function(_0x36009d){while(--_0x36009d){_0x2f5189['push'](_0x2f5189['shift']());}};_0x2f48f3(++_0x189535);}(_0x32c0,0xe3));var _0x032c=function(_0x4d6db9,_0x2496a2){_0x4d6db9=_0x4d6db9-0x0;var _0x16e9d5=_0x32c0[_0x4d6db9];return _0x16e9d5;};'use strict';var client=require(_0x032c('0x0'));exports[_0x032c('0x1')]=function(){return function(_0x40e548){return client['Request'](_0x032c('0x2'),{'options':{'raw':![],'attributes':['id',_0x032c('0x3'),_0x032c('0x4'),_0x032c('0x5'),_0x032c('0x6'),_0x032c('0x7'),_0x032c('0x8'),_0x032c('0x9'),_0x032c('0xa')],'include':[{'model':'DeskConfiguration','as':_0x032c('0xb'),'attributes':['id',_0x032c('0x3')],'include':[{'model':_0x032c('0xc'),'as':_0x032c('0xd'),'attributes':['id',_0x032c('0x9'),_0x032c('0xe'),_0x032c('0xf')],'include':[{'model':_0x032c('0x10'),'as':_0x032c('0x10'),'attributes':['id',_0x032c('0x3')]}]},{'model':_0x032c('0xc'),'as':_0x032c('0x11'),'attributes':['id','type',_0x032c('0xe'),'key',_0x032c('0x12'),_0x032c('0x13'),_0x032c('0xf')],'include':[{'model':_0x032c('0x10'),'as':_0x032c('0x10'),'attributes':['id',_0x032c('0x3')]}]},{'model':_0x032c('0xc'),'as':'Fields','attributes':['id',_0x032c('0x9'),_0x032c('0xe'),_0x032c('0x14'),_0x032c('0x15'),'customField','variableName'],'include':[{'model':'Variable','as':_0x032c('0x10'),'attributes':['id',_0x032c('0x3')]}]},{'model':_0x032c('0x16'),'as':_0x032c('0x17'),'attributes':['id',_0x032c('0x3')]}]}]},'log':_0x032c('0x2')});};};
\ No newline at end of file
index ec4075b..1dcc622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4ee=['Fields','idField','customField','../../client','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','description','Dynamics365Configuration','Configurations','ticketType','Variable','Dynamics365Field','Descriptions','type','content','keyType','keyContent'];(function(_0x3c9cec,_0x983d9){var _0x191094=function(_0x22f702){while(--_0x22f702){_0x3c9cec['push'](_0x3c9cec['shift']());}};_0x191094(++_0x983d9);}(_0xa4ee,0x1d1));var _0xea4e=function(_0xd31621,_0x17b567){_0xd31621=_0xd31621-0x0;var _0x2e7ac0=_0xa4ee[_0xd31621];return _0x2e7ac0;};'use strict';var client=require(_0xea4e('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x33b80b){return client[_0xea4e('0x1')](_0xea4e('0x2'),{'options':{'raw':![],'attributes':['id',_0xea4e('0x3'),_0xea4e('0x4'),_0xea4e('0x5'),_0xea4e('0x6'),_0xea4e('0x7'),'clientId','clientSecret','serverUrl',_0xea4e('0x8')],'include':[{'model':_0xea4e('0x9'),'as':_0xea4e('0xa'),'attributes':['id',_0xea4e('0x3'),_0xea4e('0xb')],'include':[{'model':'Dynamics365Field','as':'Subjects','attributes':['id','type','content','variableName'],'include':[{'model':_0xea4e('0xc'),'as':_0xea4e('0xc'),'attributes':['id',_0xea4e('0x3')]}]},{'model':_0xea4e('0xd'),'as':_0xea4e('0xe'),'attributes':['id',_0xea4e('0xf'),_0xea4e('0x10'),'key',_0xea4e('0x11'),_0xea4e('0x12'),'variableName'],'include':[{'model':_0xea4e('0xc'),'as':_0xea4e('0xc'),'attributes':['id','name']}]},{'model':_0xea4e('0xd'),'as':_0xea4e('0x13'),'attributes':['id',_0xea4e('0xf'),_0xea4e('0x10'),_0xea4e('0x14'),'nameField',_0xea4e('0x15'),'variableName'],'include':[{'model':_0xea4e('0xc'),'as':_0xea4e('0xc'),'attributes':['id',_0xea4e('0x3')]}]}]}]},'log':_0xea4e('0x2')});};};
\ No newline at end of file
+var _0x82ea=['Fields','nameField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','username','remoteUri','clientId','clientSecret','description','Dynamics365Configuration','name','ticketType','Subjects','type','variableName','Variable','Descriptions','content','key','keyType','keyContent','Dynamics365Field'];(function(_0x288b04,_0x1ec33e){var _0x43a226=function(_0x3e5675){while(--_0x3e5675){_0x288b04['push'](_0x288b04['shift']());}};_0x43a226(++_0x1ec33e);}(_0x82ea,0xda));var _0xa82e=function(_0x12431f,_0x4be086){_0x12431f=_0x12431f-0x0;var _0x4ddd0a=_0x82ea[_0x12431f];return _0x4ddd0a;};'use strict';var client=require(_0xa82e('0x0'));exports[_0xa82e('0x1')]=function(){return function(_0xbc7b52){return client[_0xa82e('0x2')](_0xa82e('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xa82e('0x4'),'password',_0xa82e('0x5'),'tenantId',_0xa82e('0x6'),_0xa82e('0x7'),'serverUrl',_0xa82e('0x8')],'include':[{'model':_0xa82e('0x9'),'as':'Configurations','attributes':['id',_0xa82e('0xa'),_0xa82e('0xb')],'include':[{'model':'Dynamics365Field','as':_0xa82e('0xc'),'attributes':['id',_0xa82e('0xd'),'content',_0xa82e('0xe')],'include':[{'model':_0xa82e('0xf'),'as':'Variable','attributes':['id',_0xa82e('0xa')]}]},{'model':'Dynamics365Field','as':_0xa82e('0x10'),'attributes':['id','type',_0xa82e('0x11'),_0xa82e('0x12'),_0xa82e('0x13'),_0xa82e('0x14'),_0xa82e('0xe')],'include':[{'model':'Variable','as':_0xa82e('0xf'),'attributes':['id',_0xa82e('0xa')]}]},{'model':_0xa82e('0x15'),'as':_0xa82e('0x16'),'attributes':['id',_0xa82e('0xd'),_0xa82e('0x11'),'idField',_0xa82e('0x17'),'customField',_0xa82e('0xe')],'include':[{'model':_0xa82e('0xf'),'as':_0xa82e('0xf'),'attributes':['id',_0xa82e('0xa')]}]}]}]},'log':_0xa82e('0x3')});};};
\ No newline at end of file
index 1e04bb9..d36cb29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d93=['Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','customField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName'];(function(_0x44e9ec,_0x5c812e){var _0x442d36=function(_0x381b9c){while(--_0x381b9c){_0x44e9ec['push'](_0x44e9ec['shift']());}};_0x442d36(++_0x5c812e);}(_0x2d93,0xf3));var _0x32d9=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x2d93[_0x41d432];return _0x1650f9;};'use strict';var client=require(_0x32d9('0x0'));exports[_0x32d9('0x1')]=function(){return function(_0x37871f){return client[_0x32d9('0x2')](_0x32d9('0x3'),{'options':{'raw':![],'attributes':['id',_0x32d9('0x4'),_0x32d9('0x5'),_0x32d9('0x6'),_0x32d9('0x7'),_0x32d9('0x8')],'include':[{'model':_0x32d9('0x9'),'as':_0x32d9('0xa'),'attributes':['id',_0x32d9('0x4')],'include':[{'model':_0x32d9('0xb'),'attributes':['id','name']},{'model':_0x32d9('0xc'),'as':_0x32d9('0xd'),'attributes':['id',_0x32d9('0xe'),_0x32d9('0xf'),_0x32d9('0x10')],'include':[{'model':'Variable','as':_0x32d9('0x11'),'attributes':['id',_0x32d9('0x4')]}]},{'model':_0x32d9('0xc'),'as':_0x32d9('0x12'),'attributes':['id',_0x32d9('0xe'),_0x32d9('0xf'),_0x32d9('0x13'),_0x32d9('0x14'),_0x32d9('0x15'),_0x32d9('0x10')],'include':[{'model':_0x32d9('0x11'),'as':'Variable','attributes':['id','name']}]},{'model':_0x32d9('0xc'),'as':_0x32d9('0x16'),'attributes':['id',_0x32d9('0xe'),_0x32d9('0xf'),_0x32d9('0x17'),_0x32d9('0x18'),_0x32d9('0x19'),_0x32d9('0x10')],'include':[{'model':_0x32d9('0x11'),'as':_0x32d9('0x11'),'attributes':['id',_0x32d9('0x4')]}]}]}]},'log':_0x32d9('0x3')});};};
\ No newline at end of file
+var _0x3360=['serverUrl','FreshdeskConfiguration','Configurations','FreshdeskField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields','nameField','customField','../../client','getFreshdeskAccounts','name','remoteUri'];(function(_0x5c9f56,_0x42c9ad){var _0x2a726b=function(_0x4a13cd){while(--_0x4a13cd){_0x5c9f56['push'](_0x5c9f56['shift']());}};_0x2a726b(++_0x42c9ad);}(_0x3360,0x1d7));var _0x0336=function(_0xaef7df,_0x3d62ce){_0xaef7df=_0xaef7df-0x0;var _0x27dabc=_0x3360[_0xaef7df];return _0x27dabc;};'use strict';var client=require(_0x0336('0x0'));exports[_0x0336('0x1')]=function(){return function(_0x4f2539){return client['Request']('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x0336('0x2'),'username','apiKey',_0x0336('0x3'),_0x0336('0x4')],'include':[{'model':_0x0336('0x5'),'as':_0x0336('0x6'),'attributes':['id',_0x0336('0x2')],'include':[{'model':'Tag','attributes':['id','name']},{'model':_0x0336('0x7'),'as':_0x0336('0x8'),'attributes':['id',_0x0336('0x9'),_0x0336('0xa'),_0x0336('0xb')],'include':[{'model':'Variable','as':_0x0336('0xc'),'attributes':['id',_0x0336('0x2')]}]},{'model':_0x0336('0x7'),'as':'Descriptions','attributes':['id',_0x0336('0x9'),'content',_0x0336('0xd'),_0x0336('0xe'),_0x0336('0xf'),_0x0336('0xb')],'include':[{'model':_0x0336('0xc'),'as':'Variable','attributes':['id',_0x0336('0x2')]}]},{'model':_0x0336('0x7'),'as':_0x0336('0x10'),'attributes':['id',_0x0336('0x9'),_0x0336('0xa'),'idField',_0x0336('0x11'),_0x0336('0x12'),_0x0336('0xb')],'include':[{'model':_0x0336('0xc'),'as':'Variable','attributes':['id',_0x0336('0x2')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
index 25da0a4..c112295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['content','variableName','Variable','Descriptions','key','keyType','keyContent','GetFreshsalesccount','../../client','Request','GetFreshsalesAccount','name','FreshsalesConfiguration','Configurations','Subjects','type'];(function(_0x52a588,_0x69266f){var _0x138cc8=function(_0x5bf505){while(--_0x5bf505){_0x52a588['push'](_0x52a588['shift']());}};_0x138cc8(++_0x69266f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x4f6607,_0x2f0612){_0x4f6607=_0x4f6607-0x0;var _0x3c651a=_0xbd51[_0x4f6607];return _0x3c651a;};'use strict';var client=require(_0x1bd5('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x16551f){return client[_0x1bd5('0x1')](_0x1bd5('0x2'),{'options':{'raw':![],'attributes':['id',_0x1bd5('0x3'),'username','apiKey','remoteUri','serverUrl'],'include':[{'model':_0x1bd5('0x4'),'as':_0x1bd5('0x5'),'attributes':['id',_0x1bd5('0x3')],'include':[{'model':'FreshsalesField','as':_0x1bd5('0x6'),'attributes':['id',_0x1bd5('0x7'),_0x1bd5('0x8'),_0x1bd5('0x9')],'include':[{'model':_0x1bd5('0xa'),'as':'Variable','attributes':['id',_0x1bd5('0x3')]}]},{'model':'FreshsalesField','as':_0x1bd5('0xb'),'attributes':['id',_0x1bd5('0x7'),_0x1bd5('0x8'),_0x1bd5('0xc'),_0x1bd5('0xd'),_0x1bd5('0xe'),'variableName'],'include':[{'model':_0x1bd5('0xa'),'as':'Variable','attributes':['id',_0x1bd5('0x3')]}]}]}]},'log':_0x1bd5('0xf')});};};
\ No newline at end of file
+var _0x71ab=['Variable','Descriptions','keyType','keyContent','GetFreshsalesccount','getFreshsalesAccounts','Request','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','variableName'];(function(_0x43297d,_0x54d14e){var _0x466070=function(_0x4d2f3f){while(--_0x4d2f3f){_0x43297d['push'](_0x43297d['shift']());}};_0x466070(++_0x54d14e);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var client=require('../../client');exports[_0xb71a('0x0')]=function(){return function(_0x4d5607){return client[_0xb71a('0x1')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0xb71a('0x2'),_0xb71a('0x3'),_0xb71a('0x4'),_0xb71a('0x5'),_0xb71a('0x6')],'include':[{'model':_0xb71a('0x7'),'as':_0xb71a('0x8'),'attributes':['id',_0xb71a('0x2')],'include':[{'model':_0xb71a('0x9'),'as':_0xb71a('0xa'),'attributes':['id',_0xb71a('0xb'),_0xb71a('0xc'),_0xb71a('0xd')],'include':[{'model':_0xb71a('0xe'),'as':_0xb71a('0xe'),'attributes':['id',_0xb71a('0x2')]}]},{'model':_0xb71a('0x9'),'as':_0xb71a('0xf'),'attributes':['id','type',_0xb71a('0xc'),'key',_0xb71a('0x10'),_0xb71a('0x11'),_0xb71a('0xd')],'include':[{'model':'Variable','as':_0xb71a('0xe'),'attributes':['id','name']}]}]}]},'log':_0xb71a('0x12')});};};
\ No newline at end of file
index 67ff48d..92b10c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa693=['Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','additionalSearchContact','SalesforceField','Subjects','Variable','Descriptions'];(function(_0x434138,_0x74656){var _0x40ebdd=function(_0x2b8c41){while(--_0x2b8c41){_0x434138['push'](_0x434138['shift']());}};_0x40ebdd(++_0x74656);}(_0xa693,0xf1));var _0x3a69=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0xa693[_0x5280f4];return _0xba93e7;};'use strict';var client=require(_0x3a69('0x0'));exports[_0x3a69('0x1')]=function(){return function(_0x53ac86){return client[_0x3a69('0x2')](_0x3a69('0x3'),{'options':{'raw':![],'attributes':['id',_0x3a69('0x4'),'username','password','remoteUri',_0x3a69('0x5'),_0x3a69('0x6'),_0x3a69('0x7'),_0x3a69('0x8'),_0x3a69('0x9')],'include':[{'model':_0x3a69('0xa'),'as':_0x3a69('0xb'),'attributes':['id','name',_0x3a69('0xc'),_0x3a69('0xd'),'ticketType','leadId','additionalSearchAccount',_0x3a69('0xe'),'additionalSearchLead'],'include':[{'model':_0x3a69('0xf'),'as':_0x3a69('0x10'),'include':[{'model':_0x3a69('0x11'),'as':_0x3a69('0x11'),'attributes':['id',_0x3a69('0x4')]}]},{'model':'SalesforceField','as':_0x3a69('0x12'),'include':[{'model':_0x3a69('0x11'),'as':'Variable','attributes':['id',_0x3a69('0x4')]}]},{'model':_0x3a69('0xf'),'as':_0x3a69('0x13'),'include':[{'model':_0x3a69('0x11'),'as':_0x3a69('0x11'),'attributes':['id',_0x3a69('0x4')]}]}]}]},'log':_0x3a69('0x3')});};};
\ No newline at end of file
+var _0x1956=['Subjects','Variable','Descriptions','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','remoteUri','clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleCreate','ticketType','leadId','additionalSearchAccount','additionalSearchContact','SalesforceField'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0x1956,0x15c));var _0x6195=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x1956[_0x50007c];return _0x5c1ec7;};'use strict';var client=require(_0x6195('0x0'));exports[_0x6195('0x1')]=function(){return function(_0x2c897b){return client[_0x6195('0x2')](_0x6195('0x3'),{'options':{'raw':![],'attributes':['id',_0x6195('0x4'),_0x6195('0x5'),'password',_0x6195('0x6'),_0x6195('0x7'),_0x6195('0x8'),_0x6195('0x9'),_0x6195('0xa'),_0x6195('0xb')],'include':[{'model':_0x6195('0xc'),'as':_0x6195('0xd'),'attributes':['id',_0x6195('0x4'),'moduleSearch',_0x6195('0xe'),_0x6195('0xf'),_0x6195('0x10'),_0x6195('0x11'),_0x6195('0x12'),'additionalSearchLead'],'include':[{'model':_0x6195('0x13'),'as':_0x6195('0x14'),'include':[{'model':'Variable','as':_0x6195('0x15'),'attributes':['id',_0x6195('0x4')]}]},{'model':_0x6195('0x13'),'as':_0x6195('0x16'),'include':[{'model':_0x6195('0x15'),'as':_0x6195('0x15'),'attributes':['id',_0x6195('0x4')]}]},{'model':_0x6195('0x13'),'as':'Fields','include':[{'model':_0x6195('0x15'),'as':_0x6195('0x15'),'attributes':['id','name']}]}]}]},'log':_0x6195('0x3')});};};
\ No newline at end of file
index 6b68478..55c1cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','type','content','variableName','Variable','ServicenowField','Descriptions','key','keyContent','Fields'];(function(_0x3dcd44,_0xc9392e){var _0x4eb28f=function(_0x3c1746){while(--_0x3c1746){_0x3dcd44['push'](_0x3dcd44['shift']());}};_0x4eb28f(++_0xc9392e);}(_0xf494,0x1c6));var _0x4f49=function(_0x14e62e,_0x4c90f9){_0x14e62e=_0x14e62e-0x0;var _0x2dc24e=_0xf494[_0x14e62e];return _0x2dc24e;};'use strict';var client=require(_0x4f49('0x0'));exports[_0x4f49('0x1')]=function(){return function(_0x3063f3){return client['Request'](_0x4f49('0x2'),{'options':{'raw':![],'attributes':['id',_0x4f49('0x3'),_0x4f49('0x4'),_0x4f49('0x5'),_0x4f49('0x6'),_0x4f49('0x7'),_0x4f49('0x8'),_0x4f49('0x9')],'include':[{'model':_0x4f49('0xa'),'as':_0x4f49('0xb'),'attributes':['id',_0x4f49('0x3')],'include':[{'model':'ServicenowField','as':'Subjects','attributes':['id',_0x4f49('0xc'),_0x4f49('0xd'),_0x4f49('0xe')],'include':[{'model':_0x4f49('0xf'),'as':_0x4f49('0xf'),'attributes':['id',_0x4f49('0x3')]}]},{'model':_0x4f49('0x10'),'as':_0x4f49('0x11'),'attributes':['id','type',_0x4f49('0xd'),_0x4f49('0x12'),'keyType',_0x4f49('0x13'),'variableName'],'include':[{'model':'Variable','as':_0x4f49('0xf'),'attributes':['id',_0x4f49('0x3')]}]},{'model':'ServicenowField','as':_0x4f49('0x14'),'attributes':['id',_0x4f49('0xc'),_0x4f49('0xd'),_0x4f49('0x15'),_0x4f49('0x16'),_0x4f49('0x17'),_0x4f49('0xe')],'include':[{'model':'Variable','as':_0x4f49('0xf'),'attributes':['id',_0x4f49('0x3')]}]}]}]},'log':_0x4f49('0x18')});};};
\ No newline at end of file
+var _0xadb5=['keyContent','Fields','nameField','customField','GetServicenowkAccount','getServicenowAccounts','Request','GetServicenowAccount','name','username','password','email','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType'];(function(_0x5c36c8,_0x25c6d7){var _0x2855a5=function(_0x2778b7){while(--_0x2778b7){_0x5c36c8['push'](_0x5c36c8['shift']());}};_0x2855a5(++_0x25c6d7);}(_0xadb5,0xad));var _0x5adb=function(_0x17890c,_0x4e6187){_0x17890c=_0x17890c-0x0;var _0x234dda=_0xadb5[_0x17890c];return _0x234dda;};'use strict';var client=require('../../client');exports[_0x5adb('0x0')]=function(){return function(_0x49fc17){return client[_0x5adb('0x1')](_0x5adb('0x2'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x3'),'description',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'remoteUri',_0x5adb('0x7')],'include':[{'model':_0x5adb('0x8'),'as':_0x5adb('0x9'),'attributes':['id',_0x5adb('0x3')],'include':[{'model':_0x5adb('0xa'),'as':_0x5adb('0xb'),'attributes':['id',_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe')],'include':[{'model':_0x5adb('0xf'),'as':_0x5adb('0xf'),'attributes':['id',_0x5adb('0x3')]}]},{'model':_0x5adb('0xa'),'as':_0x5adb('0x10'),'attributes':['id','type','content',_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),'variableName'],'include':[{'model':_0x5adb('0xf'),'as':'Variable','attributes':['id',_0x5adb('0x3')]}]},{'model':'ServicenowField','as':_0x5adb('0x14'),'attributes':['id',_0x5adb('0xc'),_0x5adb('0xd'),'idField',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0xe')],'include':[{'model':'Variable','as':_0x5adb('0xf'),'attributes':['id','name']}]}]}]},'log':_0x5adb('0x17')});};};
\ No newline at end of file
index 6396950..d2279e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0xdb28,0x106));var _0x8db2=function(_0x56f55c,_0x2dab80){_0x56f55c=_0x56f55c-0x0;var _0xb49524=_0xdb28[_0x56f55c];return _0xb49524;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
+var _0x1a85=['serverUrl','Configurations','SugarcrmField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','name','Fields','idField','nameField','Request','GetSugarcrmAccount','password','remoteUri'];(function(_0x380447,_0x10a72){var _0xbbba8d=function(_0x2feeca){while(--_0x2feeca){_0x380447['push'](_0x380447['shift']());}};_0xbbba8d(++_0x10a72);}(_0x1a85,0x178));var _0x51a8=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0x1a85[_0x4057f9];return _0x5552b7;};'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 c44ed21..b4071e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dba=['description','serverUrl','VtigerConfiguration','Configurations','VtigerField','type','content','Variable','Descriptions','keyType','keyContent','variableName','idField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x7dba,0x109));var _0xa7db=function(_0x4412bd,_0x1d02df){_0x4412bd=_0x4412bd-0x0;var _0x2b56b8=_0x7dba[_0x4412bd];return _0x2b56b8;};'use strict';var client=require(_0xa7db('0x0'));exports[_0xa7db('0x1')]=function(){return function(_0x220b93){return client[_0xa7db('0x2')](_0xa7db('0x3'),{'options':{'raw':![],'attributes':['id',_0xa7db('0x4'),_0xa7db('0x5'),'username','accessKey','remoteUri',_0xa7db('0x6')],'include':[{'model':_0xa7db('0x7'),'as':_0xa7db('0x8'),'attributes':['id','name'],'include':[{'model':_0xa7db('0x9'),'as':'Subjects','attributes':['id',_0xa7db('0xa'),_0xa7db('0xb'),'variableName'],'include':[{'model':_0xa7db('0xc'),'as':_0xa7db('0xc'),'attributes':['id',_0xa7db('0x4')]}]},{'model':_0xa7db('0x9'),'as':_0xa7db('0xd'),'attributes':['id','type',_0xa7db('0xb'),'key',_0xa7db('0xe'),_0xa7db('0xf'),_0xa7db('0x10')],'include':[{'model':_0xa7db('0xc'),'as':_0xa7db('0xc'),'attributes':['id',_0xa7db('0x4')]}]},{'model':_0xa7db('0x9'),'as':'Fields','attributes':['id',_0xa7db('0xa'),_0xa7db('0xb'),_0xa7db('0x11'),'nameField','customField','variableName'],'include':[{'model':_0xa7db('0xc'),'as':_0xa7db('0xc'),'attributes':['id',_0xa7db('0x4')]}]}]}]},'log':_0xa7db('0x3')});};};
\ No newline at end of file
+var _0x4092=['Subjects','type','content','Variable','VtigerField','Descriptions','key','keyType','variableName','Fields','idField','nameField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','accessKey','serverUrl','VtigerConfiguration','Configurations'];(function(_0x49a77c,_0x25ae63){var _0x34757b=function(_0x4dc88a){while(--_0x4dc88a){_0x49a77c['push'](_0x49a77c['shift']());}};_0x34757b(++_0x25ae63);}(_0x4092,0x64));var _0x2409=function(_0x38e870,_0x3d2e6a){_0x38e870=_0x38e870-0x0;var _0x2dabbe=_0x4092[_0x38e870];return _0x2dabbe;};'use strict';var client=require(_0x2409('0x0'));exports[_0x2409('0x1')]=function(){return function(_0x157337){return client[_0x2409('0x2')](_0x2409('0x3'),{'options':{'raw':![],'attributes':['id',_0x2409('0x4'),_0x2409('0x5'),'username',_0x2409('0x6'),'remoteUri',_0x2409('0x7')],'include':[{'model':_0x2409('0x8'),'as':_0x2409('0x9'),'attributes':['id',_0x2409('0x4')],'include':[{'model':'VtigerField','as':_0x2409('0xa'),'attributes':['id',_0x2409('0xb'),_0x2409('0xc'),'variableName'],'include':[{'model':_0x2409('0xd'),'as':'Variable','attributes':['id',_0x2409('0x4')]}]},{'model':_0x2409('0xe'),'as':_0x2409('0xf'),'attributes':['id',_0x2409('0xb'),_0x2409('0xc'),_0x2409('0x10'),_0x2409('0x11'),'keyContent',_0x2409('0x12')],'include':[{'model':_0x2409('0xd'),'as':_0x2409('0xd'),'attributes':['id',_0x2409('0x4')]}]},{'model':_0x2409('0xe'),'as':_0x2409('0x13'),'attributes':['id',_0x2409('0xb'),_0x2409('0xc'),_0x2409('0x14'),_0x2409('0x15'),'customField',_0x2409('0x12')],'include':[{'model':_0x2409('0xd'),'as':_0x2409('0xd'),'attributes':['id','name']}]}]}]},'log':_0x2409('0x3')});};};
\ No newline at end of file
index e528704..2582591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6fc=['Descriptions','key','keyType','keyContent','Variable','content','idField','nameField','customField','getZendeskAccounts','Request','GetZendeskAccount','name','password','remoteUri','authType','serverUrl','type','Configurations','Tag','ZendeskField','Subjects','variableName'];(function(_0x56d1ed,_0x237e84){var _0x1b282b=function(_0x56648c){while(--_0x56648c){_0x56d1ed['push'](_0x56d1ed['shift']());}};_0x1b282b(++_0x237e84);}(_0xe6fc,0x14b));var _0xce6f=function(_0xeb133b,_0x3b5bcc){_0xeb133b=_0xeb133b-0x0;var _0xbd1965=_0xe6fc[_0xeb133b];return _0xbd1965;};'use strict';var client=require('../../client');exports[_0xce6f('0x0')]=function(){return function(_0x7fe590){return client[_0xce6f('0x1')](_0xce6f('0x2'),{'options':{'raw':![],'attributes':['id',_0xce6f('0x3'),'username',_0xce6f('0x4'),'token',_0xce6f('0x5'),_0xce6f('0x6'),_0xce6f('0x7'),_0xce6f('0x8')],'include':[{'model':'ZendeskConfiguration','as':_0xce6f('0x9'),'attributes':['id','name'],'include':[{'model':_0xce6f('0xa'),'attributes':['id','name']},{'model':_0xce6f('0xb'),'as':_0xce6f('0xc'),'attributes':['id','type','content',_0xce6f('0xd')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0xce6f('0xb'),'as':_0xce6f('0xe'),'attributes':['id',_0xce6f('0x8'),'content',_0xce6f('0xf'),_0xce6f('0x10'),_0xce6f('0x11'),_0xce6f('0xd')],'include':[{'model':_0xce6f('0x12'),'as':_0xce6f('0x12'),'attributes':['id',_0xce6f('0x3')]}]},{'model':_0xce6f('0xb'),'as':'Fields','attributes':['id',_0xce6f('0x8'),_0xce6f('0x13'),_0xce6f('0x14'),_0xce6f('0x15'),_0xce6f('0x16'),_0xce6f('0xd')],'include':[{'model':_0xce6f('0x12'),'as':_0xce6f('0x12'),'attributes':['id',_0xce6f('0x3')]}]}]}]},'log':_0xce6f('0x2')});};};
\ No newline at end of file
+var _0x2e14=['remoteUri','authType','type','ZendeskConfiguration','Configurations','Tag','Subjects','variableName','Variable','ZendeskField','content','key','keyType','keyContent','idField','customField','../../client','getZendeskAccounts','GetZendeskAccount','name','username','password','token'];(function(_0x344ad7,_0x45be5b){var _0x1d5d2d=function(_0x26881c){while(--_0x26881c){_0x344ad7['push'](_0x344ad7['shift']());}};_0x1d5d2d(++_0x45be5b);}(_0x2e14,0x83));var _0x42e1=function(_0x4c4d07,_0x48512b){_0x4c4d07=_0x4c4d07-0x0;var _0x278851=_0x2e14[_0x4c4d07];return _0x278851;};'use strict';var client=require(_0x42e1('0x0'));exports[_0x42e1('0x1')]=function(){return function(_0x58a1d7){return client['Request'](_0x42e1('0x2'),{'options':{'raw':![],'attributes':['id',_0x42e1('0x3'),_0x42e1('0x4'),_0x42e1('0x5'),_0x42e1('0x6'),_0x42e1('0x7'),_0x42e1('0x8'),'serverUrl',_0x42e1('0x9')],'include':[{'model':_0x42e1('0xa'),'as':_0x42e1('0xb'),'attributes':['id',_0x42e1('0x3')],'include':[{'model':_0x42e1('0xc'),'attributes':['id','name']},{'model':'ZendeskField','as':_0x42e1('0xd'),'attributes':['id','type','content',_0x42e1('0xe')],'include':[{'model':_0x42e1('0xf'),'as':'Variable','attributes':['id',_0x42e1('0x3')]}]},{'model':_0x42e1('0x10'),'as':'Descriptions','attributes':['id',_0x42e1('0x9'),_0x42e1('0x11'),_0x42e1('0x12'),_0x42e1('0x13'),_0x42e1('0x14'),_0x42e1('0xe')],'include':[{'model':_0x42e1('0xf'),'as':_0x42e1('0xf'),'attributes':['id',_0x42e1('0x3')]}]},{'model':'ZendeskField','as':'Fields','attributes':['id',_0x42e1('0x9'),_0x42e1('0x11'),_0x42e1('0x15'),'nameField',_0x42e1('0x16'),_0x42e1('0xe')],'include':[{'model':'Variable','as':_0x42e1('0xf'),'attributes':['id',_0x42e1('0x3')]}]}]}]},'log':_0x42e1('0x2')});};};
\ No newline at end of file
index 744c5ea..5235d23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba97=['ZohoField','Descriptions','content','key','keyContent','Fields','idField','customField','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','ZohoConfiguration','moduleCreate','moduleSearch','Subjects','type','variableName','Variable'];(function(_0x2ff98a,_0x2ca3ab){var _0x2bcf36=function(_0x58d7a7){while(--_0x58d7a7){_0x2ff98a['push'](_0x2ff98a['shift']());}};_0x2bcf36(++_0x2ca3ab);}(_0xba97,0x1e3));var _0x7ba9=function(_0x32d58b,_0x3271a2){_0x32d58b=_0x32d58b-0x0;var _0x35c4b7=_0xba97[_0x32d58b];return _0x35c4b7;};'use strict';var client=require('../../client');exports[_0x7ba9('0x0')]=function(){return function(_0x1a8531){return client[_0x7ba9('0x1')](_0x7ba9('0x2'),{'options':{'raw':![],'attributes':['id',_0x7ba9('0x3'),_0x7ba9('0x4'),_0x7ba9('0x5'),_0x7ba9('0x6'),_0x7ba9('0x7'),_0x7ba9('0x8'),_0x7ba9('0x9'),'code','refreshToken'],'include':[{'model':_0x7ba9('0xa'),'as':'Configurations','attributes':['id','name',_0x7ba9('0xb'),_0x7ba9('0xc'),_0x7ba9('0x4')],'include':[{'model':'ZohoField','as':_0x7ba9('0xd'),'attributes':['id',_0x7ba9('0xe'),'content',_0x7ba9('0xf')],'include':[{'model':_0x7ba9('0x10'),'as':_0x7ba9('0x10'),'attributes':['id',_0x7ba9('0x3')]}]},{'model':_0x7ba9('0x11'),'as':_0x7ba9('0x12'),'attributes':['id',_0x7ba9('0xe'),_0x7ba9('0x13'),_0x7ba9('0x14'),'keyType',_0x7ba9('0x15'),'variableName'],'include':[{'model':_0x7ba9('0x10'),'as':_0x7ba9('0x10'),'attributes':['id',_0x7ba9('0x3')]}]},{'model':'ZohoField','as':_0x7ba9('0x16'),'attributes':['id',_0x7ba9('0xe'),'content',_0x7ba9('0x17'),'nameField',_0x7ba9('0x18'),_0x7ba9('0xf')],'include':[{'model':'Variable','as':_0x7ba9('0x10'),'attributes':['id',_0x7ba9('0x3')]}]}]}]},'log':_0x7ba9('0x2')});};};
\ No newline at end of file
+var _0x5a70=['refreshToken','ZohoConfiguration','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','key','keyType','keyContent','Fields','idField','../../client','getZohoAccounts','Request','name','host','zone','clientId','clientSecret','serverUrl'];(function(_0x18eeea,_0x95700c){var _0x1e1f60=function(_0x184955){while(--_0x184955){_0x18eeea['push'](_0x18eeea['shift']());}};_0x1e1f60(++_0x95700c);}(_0x5a70,0x1ef));var _0x05a7=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x5a70[_0x202c61];return _0x540691;};'use strict';var client=require(_0x05a7('0x0'));exports[_0x05a7('0x1')]=function(){return function(_0x3dc4db){return client[_0x05a7('0x2')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0x05a7('0x3'),'description',_0x05a7('0x4'),_0x05a7('0x5'),_0x05a7('0x6'),_0x05a7('0x7'),_0x05a7('0x8'),'code',_0x05a7('0x9')],'include':[{'model':_0x05a7('0xa'),'as':'Configurations','attributes':['id',_0x05a7('0x3'),_0x05a7('0xb'),_0x05a7('0xc'),'description'],'include':[{'model':_0x05a7('0xd'),'as':_0x05a7('0xe'),'attributes':['id',_0x05a7('0xf'),_0x05a7('0x10'),_0x05a7('0x11')],'include':[{'model':_0x05a7('0x12'),'as':'Variable','attributes':['id','name']}]},{'model':_0x05a7('0xd'),'as':'Descriptions','attributes':['id','type',_0x05a7('0x10'),_0x05a7('0x13'),_0x05a7('0x14'),_0x05a7('0x15'),'variableName'],'include':[{'model':'Variable','as':_0x05a7('0x12'),'attributes':['id','name']}]},{'model':_0x05a7('0xd'),'as':_0x05a7('0x16'),'attributes':['id',_0x05a7('0xf'),_0x05a7('0x10'),_0x05a7('0x17'),'nameField','customField','variableName'],'include':[{'model':_0x05a7('0x12'),'as':_0x05a7('0x12'),'attributes':['id',_0x05a7('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
index bed0cee..55553d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde12=['diff','seconds','calleridnum','exten','agent','accountcode','toNumber','uniqueid','starttime','endtime','outbound','dialstring','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt'];(function(_0x55f6a9,_0x29b8c6){var _0x2ca2d0=function(_0x1d9852){while(--_0x1d9852){_0x55f6a9['push'](_0x55f6a9['shift']());}};_0x2ca2d0(++_0x29b8c6);}(_0xde12,0x135));var _0x2de1=function(_0x56a559,_0x3081de){_0x56a559=_0x56a559-0x0;var _0x142c11=_0xde12[_0x56a559];return _0x142c11;};'use strict';var moment=require(_0x2de1('0x0'));var _=require(_0x2de1('0x1'));var util=require('util');var client=require(_0x2de1('0x2'));exports[_0x2de1('0x3')]=function(_0x178bf0){var _0x58273f=_0x178bf0[_0x2de1('0x4')]||_0x178bf0[_0x2de1('0x5')];return client[_0x2de1('0x6')](_0x2de1('0x7'),{'body':{'channel':_0x2de1('0x8'),'membername':_0x178bf0[_0x2de1('0x9')],'interface':_[_0x2de1('0xa')](_0x178bf0[_0x2de1('0xb')])?util['format'](_0x2de1('0xc'),_0x178bf0[_0x2de1('0x9')]):_0x178bf0[_0x2de1('0xb')],'type':_0x2de1('0xd'),'enterAt':_0x178bf0[_0x2de1('0xe')],'exitAt':_0x58273f,'duration':moment(_0x58273f)[_0x2de1('0xf')](_0x178bf0['queuecallerleaveAt'],_0x2de1('0x10')),'data1':'inbound','data2':_0x178bf0[_0x2de1('0x11')],'data3':_0x178bf0[_0x2de1('0x12')],'data4':null,'data5':_0x178bf0['queue'],'role':_0x2de1('0x13'),'internal':_0x178bf0[_0x2de1('0x14')]?_[_0x2de1('0x15')](_0x178bf0[_0x2de1('0x14')]):undefined,'uniqueid':_0x178bf0[_0x2de1('0x16')]},'log':_0x2de1('0x7')});};exports['voiceDialReport']=function(_0x9e5aca){return client[_0x2de1('0x6')](_0x2de1('0x7'),{'body':{'channel':_0x2de1('0x8'),'membername':_0x9e5aca['membername'],'interface':_0x9e5aca['interface'],'type':_0x2de1('0xd'),'enterAt':_0x9e5aca[_0x2de1('0x17')],'exitAt':_0x9e5aca[_0x2de1('0x18')],'duration':moment(_0x9e5aca[_0x2de1('0x18')])[_0x2de1('0xf')](_0x9e5aca[_0x2de1('0x17')],_0x2de1('0x10'))>=0x0?moment(_0x9e5aca[_0x2de1('0x18')])[_0x2de1('0xf')](_0x9e5aca[_0x2de1('0x17')],_0x2de1('0x10')):null,'data1':_0x2de1('0x19'),'data2':_0x9e5aca[_0x2de1('0x14')],'data3':_0x9e5aca[_0x2de1('0x12')],'data4':_0x9e5aca[_0x2de1('0x1a')]||null,'role':_0x2de1('0x13'),'internal':_0x9e5aca[_0x2de1('0x14')]?_[_0x2de1('0x15')](_0x9e5aca[_0x2de1('0x14')]):undefined,'uniqueid':_0x9e5aca[_0x2de1('0x16')]},'log':_0x2de1('0x7')});};
\ No newline at end of file
+var _0x7022=['starttime','endtime','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','interface','format','SIP/%s','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','voiceDialReport','voice','membername'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x7022,0x18b));var _0x2702=function(_0x14d22c,_0x26e920){_0x14d22c=_0x14d22c-0x0;var _0x41862c=_0x7022[_0x14d22c];return _0x41862c;};'use strict';var moment=require(_0x2702('0x0'));var _=require(_0x2702('0x1'));var util=require(_0x2702('0x2'));var client=require(_0x2702('0x3'));exports[_0x2702('0x4')]=function(_0x575a59){var _0x462396=_0x575a59[_0x2702('0x5')]||_0x575a59[_0x2702('0x6')];return client[_0x2702('0x7')](_0x2702('0x8'),{'body':{'channel':'voice','membername':_0x575a59[_0x2702('0x9')],'interface':_['isNil'](_0x575a59[_0x2702('0xa')])?util[_0x2702('0xb')](_0x2702('0xc'),_0x575a59[_0x2702('0x9')]):_0x575a59[_0x2702('0xa')],'type':'TALKING','enterAt':_0x575a59['queuecallerleaveAt'],'exitAt':_0x462396,'duration':moment(_0x462396)[_0x2702('0xd')](_0x575a59['queuecallerleaveAt'],_0x2702('0xe')),'data1':_0x2702('0xf'),'data2':_0x575a59[_0x2702('0x10')],'data3':_0x575a59[_0x2702('0x11')],'data4':null,'data5':_0x575a59[_0x2702('0x12')],'role':_0x2702('0x13'),'internal':_0x575a59['accountcode']?_['toNumber'](_0x575a59[_0x2702('0x14')]):undefined,'uniqueid':_0x575a59[_0x2702('0x15')]},'log':'CreateMemberReport'});};exports[_0x2702('0x16')]=function(_0xe68448){return client['Request'](_0x2702('0x8'),{'body':{'channel':_0x2702('0x17'),'membername':_0xe68448[_0x2702('0x18')],'interface':_0xe68448['interface'],'type':'TALKING','enterAt':_0xe68448[_0x2702('0x19')],'exitAt':_0xe68448[_0x2702('0x1a')],'duration':moment(_0xe68448['endtime'])['diff'](_0xe68448[_0x2702('0x19')],_0x2702('0xe'))>=0x0?moment(_0xe68448[_0x2702('0x1a')])[_0x2702('0xd')](_0xe68448[_0x2702('0x19')],_0x2702('0xe')):null,'data1':'outbound','data2':_0xe68448[_0x2702('0x14')],'data3':_0xe68448[_0x2702('0x11')],'data4':_0xe68448[_0x2702('0x1b')]||null,'role':_0x2702('0x13'),'internal':_0xe68448[_0x2702('0x14')]?_['toNumber'](_0xe68448['accountcode']):undefined,'uniqueid':_0xe68448[_0x2702('0x15')]},'log':'CreateMemberReport'});};
\ No newline at end of file
index 29e4446..448735c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x180f=['getSettings','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0x2bab6c,_0x16de9f){var _0x5db1b9=function(_0x1318d1){while(--_0x1318d1){_0x2bab6c['push'](_0x2bab6c['shift']());}};_0x5db1b9(++_0x16de9f);}(_0x180f,0xf3));var _0xf180=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x180f[_0x413b4d];return _0x8b810a;};'use strict';var client=require(_0xf180('0x0'));exports[_0xf180('0x1')]=function(){return client['Request'](_0xf180('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xf180('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x8093=['GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0xd0b55c,_0x518d87){var _0x18877d=function(_0x2f4f33){while(--_0x2f4f33){_0xd0b55c['push'](_0xd0b55c['shift']());}};_0x18877d(++_0x518d87);}(_0x8093,0xa9));var _0x3809=function(_0xf4a734,_0x1a4fe7){_0xf4a734=_0xf4a734-0x0;var _0x10ee33=_0x8093[_0xf4a734];return _0x10ee33;};'use strict';var client=require(_0x3809('0x0'));exports[_0x3809('0x1')]=function(){return client[_0x3809('0x2')](_0x3809('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3809('0x4')]},'log':_0x3809('0x5')});};
\ No newline at end of file
index bae3abb..0265e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f74=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x2d2b51,_0x50e5b6){var _0x2af037=function(_0x5b9267){while(--_0x5b9267){_0x2d2b51['push'](_0x2d2b51['shift']());}};_0x2af037(++_0x50e5b6);}(_0x2f74,0xf0));var _0x42f7=function(_0x5bf2a6,_0x96d3b8){_0x5bf2a6=_0x5bf2a6-0x0;var _0x284505=_0x2f74[_0x5bf2a6];return _0x284505;};'use strict';var client=require(_0x42f7('0x0'));exports[_0x42f7('0x1')]=function(_0x29de28){return function(_0x13ca54){return client[_0x42f7('0x2')](_0x42f7('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x42f7('0x4')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0x32f4=['../client','getTemplates','GetTemplate','name'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x32f4,0x168));var _0x432f=function(_0x8ca2f7,_0x2a6e77){_0x8ca2f7=_0x8ca2f7-0x0;var _0x307e20=_0x32f4[_0x8ca2f7];return _0x307e20;};'use strict';var client=require(_0x432f('0x0'));exports[_0x432f('0x1')]=function(_0x9e6187){return function(_0x404867){return client['Request'](_0x432f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x432f('0x3'),'html']},'log':_0x432f('0x2')});};};
\ No newline at end of file
index 689457c..f6832f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7742=['Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','value','Action','Actions','action','data1','data2','data3','data4','data5','data6','../client','getTriggers'];(function(_0x152a07,_0x419545){var _0x5ec0b0=function(_0x336228){while(--_0x336228){_0x152a07['push'](_0x152a07['shift']());}};_0x5ec0b0(++_0x419545);}(_0x7742,0x1b6));var _0x2774=function(_0x9150d8,_0x4042e8){_0x9150d8=_0x9150d8-0x0;var _0x571d79=_0x7742[_0x9150d8];return _0x571d79;};'use strict';var client=require(_0x2774('0x0'));exports[_0x2774('0x1')]=function(_0x8224c4){return function(_0x487dc1){return client[_0x2774('0x2')](_0x2774('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x2774('0x4'),_0x2774('0x5')],'include':[{'model':_0x2774('0x6'),'as':_0x2774('0x7'),'attributes':['id',_0x2774('0x8'),_0x2774('0x9'),'value']},{'model':_0x2774('0x6'),'as':'AnyConditions','attributes':['id',_0x2774('0x8'),_0x2774('0x9'),_0x2774('0xa')]},{'model':_0x2774('0xb'),'as':_0x2774('0xc'),'attributes':['id',_0x2774('0xd'),_0x2774('0xe'),_0x2774('0xf'),_0x2774('0x10'),_0x2774('0x11'),_0x2774('0x12'),_0x2774('0x13'),'data7']}]},'log':_0x2774('0x3')});};};
\ No newline at end of file
+var _0x2299=['status','Condition','field','operator','value','AnyConditions','Action','data2','data3','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x2299,0x11b));var _0x9229=function(_0x2f8237,_0x3e1e6e){_0x2f8237=_0x2f8237-0x0;var _0x5b1f3b=_0x2299[_0x2f8237];return _0x5b1f3b;};'use strict';var client=require(_0x9229('0x0'));exports[_0x9229('0x1')]=function(_0x50ae31){return function(_0x3e1c00){return client[_0x9229('0x2')](_0x9229('0x3'),{'options':{'raw':![],'attributes':['id',_0x9229('0x4'),_0x9229('0x5'),_0x9229('0x6')],'include':[{'model':_0x9229('0x7'),'as':'AllConditions','attributes':['id',_0x9229('0x8'),_0x9229('0x9'),_0x9229('0xa')]},{'model':'Condition','as':_0x9229('0xb'),'attributes':['id','field',_0x9229('0x9'),_0x9229('0xa')]},{'model':_0x9229('0xc'),'as':'Actions','attributes':['id','action','data1',_0x9229('0xd'),_0x9229('0xe'),'data4','data5',_0x9229('0xf'),_0x9229('0x10')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
index 971ea4e..3a3bdc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf73=['name','registry','../client','getTrunks','GetTrunk'];(function(_0x1f96bf,_0x2d3391){var _0x167865=function(_0x5c24ff){while(--_0x5c24ff){_0x1f96bf['push'](_0x1f96bf['shift']());}};_0x167865(++_0x2d3391);}(_0xaf73,0x1ec));var _0x3af7=function(_0x4148a7,_0x3d3a4f){_0x4148a7=_0x4148a7-0x0;var _0x324acf=_0xaf73[_0x4148a7];return _0x324acf;};'use strict';var client=require(_0x3af7('0x0'));exports[_0x3af7('0x1')]=function(_0x13f77f){return function(_0x12f66d){return client['Request'](_0x3af7('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3af7('0x3'),_0x3af7('0x4'),'defaultuser']},'log':_0x3af7('0x2')});};};
\ No newline at end of file
+var _0x2cd3=['registry','../client','Request','GetTrunk','name'];(function(_0x130c43,_0x4b4fa8){var _0x1951e0=function(_0x535068){while(--_0x535068){_0x130c43['push'](_0x130c43['shift']());}};_0x1951e0(++_0x4b4fa8);}(_0x2cd3,0xf1));var _0x32cd=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x2cd3[_0x57b236];return _0x4feb29;};'use strict';var client=require(_0x32cd('0x0'));exports['getTrunks']=function(_0x259d34){return function(_0x39041a){return client[_0x32cd('0x1')](_0x32cd('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x32cd('0x3'),_0x32cd('0x4'),'defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
index e88f23e..ba75d67 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x4ea430,_0x1666d9){var _0x565a6d=function(_0x481dc1){while(--_0x481dc1){_0x4ea430['push'](_0x4ea430['shift']());}};_0x565a6d(++_0x1666d9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0xcb91[_0x5ac84c];return _0x3c53d2;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});};
\ No newline at end of file
index e5aec46..8cd75c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6daf=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x28bad3,_0x58f2e4){var _0x3bac1c=function(_0x28e41d){while(--_0x28e41d){_0x28bad3['push'](_0x28bad3['shift']());}};_0x3bac1c(++_0x58f2e4);}(_0x6daf,0x12a));var _0xf6da=function(_0x15ad69,_0x3ba49c){_0x15ad69=_0x15ad69-0x0;var _0x5589c0=_0x6daf[_0x15ad69];return _0x5589c0;};'use strict';var client=require(_0xf6da('0x0'));exports[_0xf6da('0x1')]=function(_0x4fa60d){return client[_0xf6da('0x2')](_0xf6da('0x3'),{'body':_0x4fa60d,'log':_0xf6da('0x3')});};exports[_0xf6da('0x4')]=function(_0x5eb485,_0x43e5dc,_0x283aa1){return client[_0xf6da('0x2')](_0xf6da('0x5'),{'body':_0x5eb485,'options':{'where':{'uniqueid':_0x43e5dc,'interface':_0x283aa1,'agentcomplete':!![]}},'log':_0xf6da('0x5')});};
\ No newline at end of file
+var _0xd276=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0xd276,0xa3));var _0x6d27=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd276[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x6d27('0x0'));exports[_0x6d27('0x1')]=function(_0x404591){return client[_0x6d27('0x2')](_0x6d27('0x3'),{'body':_0x404591,'log':_0x6d27('0x3')});};exports['update']=function(_0x461989,_0x72f681,_0xbd5311){return client[_0x6d27('0x2')](_0x6d27('0x4'),{'body':_0x461989,'options':{'where':{'uniqueid':_0x72f681,'interface':_0xbd5311,'agentcomplete':!![]}},'log':_0x6d27('0x4')});};
\ No newline at end of file
index f040c57..6eb9b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda43=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf'];(function(_0x5e2cf9,_0x3adb53){var _0x3c4158=function(_0x36edb1){while(--_0x36edb1){_0x5e2cf9['push'](_0x5e2cf9['shift']());}};_0x3c4158(++_0x3adb53);}(_0xda43,0x197));var _0x3da4=function(_0x5e5c74,_0x1c0d09){_0x5e5c74=_0x5e5c74-0x0;var _0x5d2127=_0xda43[_0x5e5c74];return _0x5d2127;};'use strict';var moment=require(_0x3da4('0x0'));var util=require(_0x3da4('0x1'));var _=require('lodash');var client=require(_0x3da4('0x2'));exports[_0x3da4('0x3')]=function(_0x47b756){return client[_0x3da4('0x4')](_0x3da4('0x5'),{'body':_[_0x3da4('0x6')](_0x47b756,{'source':_0x47b756[_0x3da4('0x7')],'destinationcontext':_0x47b756['context'],'callerid':_0x47b756[_0x3da4('0x8')],'amaflags':_0x3da4('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0x3da4('0xa')]=function(){return function(){return client[_0x3da4('0x4')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x3da4('0xb')],'createdAt':{'$between':[moment()[_0x3da4('0xc')](_0x3da4('0xd'))[_0x3da4('0xe')](_0x3da4('0xf')),moment()[_0x3da4('0x10')](_0x3da4('0xd'))['format'](_0x3da4('0xf'))]}},'attributes':[_0x3da4('0x11'),_0x3da4('0x12'),'duration',_0x3da4('0x13')]},'log':_0x3da4('0x14')});};};
\ No newline at end of file
+var _0x31f8=['startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','util','../client','Request','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','outbound'];(function(_0x135595,_0x418062){var _0x2761f1=function(_0x52a416){while(--_0x52a416){_0x135595['push'](_0x135595['shift']());}};_0x2761f1(++_0x418062);}(_0x31f8,0x86));var _0x831f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31f8[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var util=require(_0x831f('0x0'));var _=require('lodash');var client=require(_0x831f('0x1'));exports['create']=function(_0xa1a047){return client[_0x831f('0x2')]('CreateVoiceCallReport',{'body':_[_0x831f('0x3')](_0xa1a047,{'source':_0xa1a047[_0x831f('0x4')],'destinationcontext':_0xa1a047[_0x831f('0x5')],'callerid':_0xa1a047[_0x831f('0x6')],'amaflags':_0x831f('0x7')}),'log':_0x831f('0x8')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x831f('0x2')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x831f('0x9')],'createdAt':{'$between':[moment()[_0x831f('0xa')](_0x831f('0xb'))[_0x831f('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x831f('0xd')](_0x831f('0xb'))[_0x831f('0xc')](_0x831f('0xe'))]}},'attributes':[_0x831f('0xf'),_0x831f('0x10'),_0x831f('0x11'),'billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 3aee5b5..cca3245 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf11f=['CreateVoiceDialReport','create'];(function(_0x3eb378,_0x6700c5){var _0x1f5eca=function(_0xe06eab){while(--_0xe06eab){_0x3eb378['push'](_0x3eb378['shift']());}};_0x1f5eca(++_0x6700c5);}(_0xf11f,0xd1));var _0xff11=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0xf11f[_0x57fa33];return _0x12e724;};'use strict';var client=require('../client');exports[_0xff11('0x0')]=function(_0x20487c){return client['Request']('CreateVoiceDialReport',{'body':_0x20487c,'log':_0xff11('0x1')});};
\ No newline at end of file
+var _0x358a=['Request','CreateVoiceDialReport','../client','create'];(function(_0x18f5bd,_0xc02ad7){var _0x2426d6=function(_0x412975){while(--_0x412975){_0x18f5bd['push'](_0x18f5bd['shift']());}};_0x2426d6(++_0xc02ad7);}(_0x358a,0xc2));var _0xa358=function(_0x5b4a05,_0x2f82a4){_0x5b4a05=_0x5b4a05-0x0;var _0x127ac9=_0x358a[_0x5b4a05];return _0x127ac9;};'use strict';var client=require(_0xa358('0x0'));exports[_0xa358('0x1')]=function(_0x42b391){return client[_0xa358('0x2')](_0xa358('0x3'),{'body':_0x42b391,'log':_0xa358('0x3')});};
\ No newline at end of file
index 7d8685e..f816c45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3140=['getVoiceExtensions','Request','GetVoiceExtension','../client'];(function(_0x4fdae2,_0x16ec59){var _0x527e8d=function(_0x1dc77a){while(--_0x1dc77a){_0x4fdae2['push'](_0x4fdae2['shift']());}};_0x527e8d(++_0x16ec59);}(_0x3140,0xaf));var _0x0314=function(_0x5eaa6a,_0x41d4f9){_0x5eaa6a=_0x5eaa6a-0x0;var _0x332a98=_0x3140[_0x5eaa6a];return _0x332a98;};'use strict';var client=require(_0x0314('0x0'));exports[_0x0314('0x1')]=function(){return function(){return client[_0x0314('0x2')](_0x0314('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x0314('0x1')});};};
\ No newline at end of file
+var _0x6324=['GetVoiceExtension','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x34e84d,_0x3f3502){var _0x3f9125=function(_0x2cfc58){while(--_0x2cfc58){_0x34e84d['push'](_0x34e84d['shift']());}};_0x3f9125(++_0x3f3502);}(_0x6324,0x142));var _0x4632=function(_0x35a6f8,_0x2a19d0){_0x35a6f8=_0x35a6f8-0x0;var _0x11d2da=_0x6324[_0x35a6f8];return _0x11d2da;};'use strict';var client=require(_0x4632('0x0'));exports[_0x4632('0x1')]=function(){return function(){return client[_0x4632('0x2')](_0x4632('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x4632('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index 32036cd..aa253c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e43=['dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','callerid','active','Pause','Trunk','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e43,0x14d));var _0x36e4=function(_0x189524,_0x4aba71){_0x189524=_0x189524-0x0;var _0xfd209d=_0x6e43[_0x189524];return _0xfd209d;};'use strict';var client=require(_0x36e4('0x0'));exports[_0x36e4('0x1')]=function(){return function(){return client[_0x36e4('0x2')](_0x36e4('0x3'),{'options':{'raw':![],'attributes':['id',_0x36e4('0x4'),'acw',_0x36e4('0x5'),_0x36e4('0x6'),_0x36e4('0x7'),_0x36e4('0x8'),'dialActive',_0x36e4('0x9'),_0x36e4('0xa'),_0x36e4('0xb'),_0x36e4('0xc'),_0x36e4('0xd'),_0x36e4('0xe'),_0x36e4('0xf'),_0x36e4('0x10'),_0x36e4('0x11'),'dialOriginateTimeout',_0x36e4('0x12'),_0x36e4('0x13'),'dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x36e4('0x14'),_0x36e4('0x15'),_0x36e4('0x16'),'dialNoAnswerRetryFrequency',_0x36e4('0x17'),_0x36e4('0x18'),'dialGlobalInterval','dialPrefix',_0x36e4('0x19'),_0x36e4('0x1a'),_0x36e4('0x1b'),'dialAMDGreeting',_0x36e4('0x1c'),_0x36e4('0x1d'),_0x36e4('0x1e'),_0x36e4('0x1f'),_0x36e4('0x20'),_0x36e4('0x21'),_0x36e4('0x22'),_0x36e4('0x23'),_0x36e4('0x24'),_0x36e4('0x25'),_0x36e4('0x26'),_0x36e4('0x27'),_0x36e4('0x28'),_0x36e4('0x29'),_0x36e4('0x7'),_0x36e4('0x2a'),_0x36e4('0x2b'),_0x36e4('0x2c'),_0x36e4('0x2d'),'dialNoSuchNumberRetryFrequency',_0x36e4('0x2e'),_0x36e4('0x2f'),_0x36e4('0x30'),_0x36e4('0x31'),_0x36e4('0x32'),_0x36e4('0x33'),_0x36e4('0x34'),_0x36e4('0x35'),'mandatoryDisposition',_0x36e4('0x36'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x36e4('0x4'),_0x36e4('0x37'),_0x36e4('0x38')]},{'model':_0x36e4('0x39'),'as':'mandatoryDispositionPause','attributes':['id',_0x36e4('0x4')]},{'model':_0x36e4('0x3a'),'as':_0x36e4('0x3b'),'attributes':['id','name',_0x36e4('0x37'),_0x36e4('0x38')]},{'model':_0x36e4('0x3c'),'as':_0x36e4('0x3c'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x36e4('0x3d'),'attributes':['id',_0x36e4('0x4'),_0x36e4('0x3e')]}]}]},'log':_0x36e4('0x1')});};};
\ No newline at end of file
+var _0xf0d4=['dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDMinWordLength','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialAgiAfterHangupAgent','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','Pause','TrunkBackup','callerid','Interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xf0d4,0xfa));var _0x4f0d=function(_0x2a53ad,_0x234135){_0x2a53ad=_0x2a53ad-0x0;var _0x31b3b6=_0xf0d4[_0x2a53ad];return _0x31b3b6;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client['Request'](_0x4f0d('0x0'),{'options':{'raw':![],'attributes':['id',_0x4f0d('0x1'),_0x4f0d('0x2'),_0x4f0d('0x3'),_0x4f0d('0x4'),_0x4f0d('0x5'),_0x4f0d('0x6'),_0x4f0d('0x7'),'dialMethod',_0x4f0d('0x8'),'dialLimitQueue',_0x4f0d('0x9'),_0x4f0d('0xa'),_0x4f0d('0xb'),'dialPredictiveInterval',_0x4f0d('0xc'),_0x4f0d('0xd'),_0x4f0d('0xe'),_0x4f0d('0xf'),_0x4f0d('0x10'),_0x4f0d('0x11'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x4f0d('0x12'),_0x4f0d('0x13'),_0x4f0d('0x14'),_0x4f0d('0x15'),_0x4f0d('0x16'),_0x4f0d('0x17'),_0x4f0d('0x18'),_0x4f0d('0x19'),'dialCheckDuplicateType',_0x4f0d('0x1a'),_0x4f0d('0x1b'),'dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x4f0d('0x1c'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x4f0d('0x1d'),_0x4f0d('0x1e'),_0x4f0d('0x1f'),_0x4f0d('0x20'),'dialRecallInQueue','dialOrderByScheduledAt',_0x4f0d('0x21'),'dialAgiAfterHangupClient','dialQueueProject2',_0x4f0d('0x5'),'strategy',_0x4f0d('0x22'),_0x4f0d('0x23'),_0x4f0d('0x24'),_0x4f0d('0x25'),_0x4f0d('0x26'),_0x4f0d('0x27'),_0x4f0d('0x28'),'dialAbandonedRetryFrequency',_0x4f0d('0x29'),_0x4f0d('0x2a'),_0x4f0d('0x2b'),'dialAgentRejectRetryFrequency',_0x4f0d('0x2c'),_0x4f0d('0x2d'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x4f0d('0x2e'),'as':'Trunk','attributes':['id',_0x4f0d('0x1'),'callerid',_0x4f0d('0x2f')]},{'model':_0x4f0d('0x30'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x4f0d('0x2e'),'as':_0x4f0d('0x31'),'attributes':['id','name',_0x4f0d('0x32'),_0x4f0d('0x2f')]},{'model':_0x4f0d('0x33'),'as':_0x4f0d('0x33'),'attributes':['id',_0x4f0d('0x1')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x4f0d('0x34')});};};
\ No newline at end of file
index 50f0ff3..7104d49 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(_0x1e29bc,_0x41137d){var _0x5f1e3c=function(_0x4c9bac){while(--_0x4c9bac){_0x1e29bc['push'](_0x1e29bc['shift']());}};_0x5f1e3c(++_0x41137d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x459f09,_0x2552f3){var _0x41a0e5=function(_0x5ede7b){while(--_0x5ede7b){_0x459f09['push'](_0x459f09['shift']());}};_0x41a0e5(++_0x2552f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 81243d3..041d8d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e97=['../client','getVoiceQueueRtPauses'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0x5e97,0x160));var _0x75e9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5e97[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0x75e9('0x0'));exports['getVoiceQueueRtPauses']=function(_0x5f2da4){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5f2da4,'paused':!![]},'raw':!![]},'log':_0x75e9('0x1')});};};
\ No newline at end of file
+var _0x66b5=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x11b6e9,_0x144376){var _0x20e413=function(_0x54f6fd){while(--_0x54f6fd){_0x11b6e9['push'](_0x11b6e9['shift']());}};_0x20e413(++_0x144376);}(_0x66b5,0x1bb));var _0x566b=function(_0x144bcf,_0x213f2d){_0x144bcf=_0x144bcf-0x0;var _0x54efad=_0x66b5[_0x144bcf];return _0x54efad;};'use strict';var client=require(_0x566b('0x0'));exports[_0x566b('0x1')]=function(_0x5e1add){return function(){return client[_0x566b('0x2')](_0x566b('0x3'),{'options':{'where':{'VoiceQueueId':_0x5e1add,'paused':!![]},'raw':!![]},'log':_0x566b('0x1')});};};
\ No newline at end of file
index fa5842d..858cfe0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3380c7,_0x513df0){var _0x4a0da2=function(_0x36f493){while(--_0x36f493){_0x3380c7['push'](_0x3380c7['shift']());}};_0x4a0da2(++_0x513df0);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x4fe17b,_0x3399c9){var _0x2973f3=function(_0x11cb84){while(--_0x11cb84){_0x4fe17b['push'](_0x4fe17b['shift']());}};_0x2973f3(++_0x3399c9);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index dc9a4d8..b44ab01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54c6=['transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended'];(function(_0x174ac2,_0xa91d82){var _0x28ca76=function(_0xba7291){while(--_0xba7291){_0x174ac2['push'](_0x174ac2['shift']());}};_0x28ca76(++_0xa91d82);}(_0x54c6,0x7b));var _0x654c=function(_0x602f33,_0x26af94){_0x602f33=_0x602f33-0x0;var _0x3520b4=_0x54c6[_0x602f33];return _0x3520b4;};'use strict';var client=require('../client');exports[_0x654c('0x0')]={};exports[_0x654c('0x1')]=function(_0x5206b1){return client[_0x654c('0x2')](_0x654c('0x3'),{'body':{'result':_0x5206b1[_0x654c('0x4')],'transfererchannel':_0x5206b1[_0x654c('0x5')],'transferercalleridnum':_0x5206b1[_0x654c('0x6')],'transferercalleridname':_0x5206b1['transferercalleridname'],'transfererconnectedlinenum':_0x5206b1[_0x654c('0x7')],'transfererconnectedlinename':_0x5206b1['transfererconnectedlinename'],'transfereraccountcode':_0x5206b1[_0x654c('0x8')],'transferercontext':_0x5206b1[_0x654c('0x9')],'transfererexten':_0x5206b1[_0x654c('0xa')],'transfererlinkedid':_0x5206b1[_0x654c('0xb')],'transfereechannel':_0x5206b1[_0x654c('0xc')],'transfereecalleridnum':_0x5206b1[_0x654c('0xd')],'transfereecalleridname':_0x5206b1[_0x654c('0xe')],'transfereeconnectedlinenum':_0x5206b1[_0x654c('0xf')],'transfereeconnectedlinename':_0x5206b1[_0x654c('0x10')],'transfereeaccountcode':_0x5206b1[_0x654c('0x11')],'transfereecontext':_0x5206b1[_0x654c('0x12')],'transfereeexten':_0x5206b1[_0x654c('0x13')],'transfereelinkedid':_0x5206b1[_0x654c('0x14')],'isexternal':_0x5206b1[_0x654c('0x15')],'context':_0x5206b1[_0x654c('0x16')],'extension':_0x5206b1['extension'],'type':'blind'},'log':_0x654c('0x3')});};exports['attendedTransfer']=function(_0x34e9de){return client['Request'](_0x654c('0x3'),{'body':{'result':_0x34e9de[_0x654c('0x4')],'transfererchannel':_0x34e9de[_0x654c('0x17')],'transferercalleridnum':_0x34e9de[_0x654c('0x18')],'transferercalleridname':_0x34e9de[_0x654c('0x19')],'transfererconnectedlinenum':_0x34e9de[_0x654c('0x1a')],'transfererconnectedlinename':_0x34e9de[_0x654c('0x1b')],'transfereraccountcode':_0x34e9de[_0x654c('0x1c')],'transferercontext':_0x34e9de[_0x654c('0x1d')],'transfererexten':_0x34e9de[_0x654c('0x1e')],'transfererlinkedid':_0x34e9de['origtransfererlinkedid'],'transfereechannel':_0x34e9de[_0x654c('0x1f')],'transfereecalleridnum':_0x34e9de[_0x654c('0x20')],'transfereecalleridname':_0x34e9de[_0x654c('0x21')],'transfereeconnectedlinenum':_0x34e9de[_0x654c('0x22')],'transfereeconnectedlinename':_0x34e9de[_0x654c('0x23')],'transfereeaccountcode':_0x34e9de[_0x654c('0x24')],'transfereecontext':_0x34e9de[_0x654c('0x25')],'transfereeexten':_0x34e9de[_0x654c('0x26')],'transfereelinkedid':_0x34e9de['transfertargetlinkedid'],'isexternal':_0x34e9de[_0x654c('0x15')],'context':_0x34e9de[_0x654c('0x27')],'extension':_0x34e9de['origtransfererexten'],'type':_0x654c('0x28')},'log':_0x654c('0x3')});};
\ No newline at end of file
+var _0x20cc=['transfererchannel','transferercalleridnum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransfererexten','attended','../client','transfers','Request','CreateVoiceTransferReport','result'];(function(_0x7f49d2,_0x43f538){var _0x2fcd02=function(_0x2e786b){while(--_0x2e786b){_0x7f49d2['push'](_0x7f49d2['shift']());}};_0x2fcd02(++_0x43f538);}(_0x20cc,0xaa));var _0xc20c=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x20cc[_0x2d7f0e];return _0x110b07;};'use strict';var client=require(_0xc20c('0x0'));exports[_0xc20c('0x1')]={};exports['blindTransfer']=function(_0x1f44c6){return client[_0xc20c('0x2')](_0xc20c('0x3'),{'body':{'result':_0x1f44c6[_0xc20c('0x4')],'transfererchannel':_0x1f44c6[_0xc20c('0x5')],'transferercalleridnum':_0x1f44c6[_0xc20c('0x6')],'transferercalleridname':_0x1f44c6['transferercalleridname'],'transfererconnectedlinenum':_0x1f44c6['transfererconnectedlinenum'],'transfererconnectedlinename':_0x1f44c6['transfererconnectedlinename'],'transfereraccountcode':_0x1f44c6['transfereraccountcode'],'transferercontext':_0x1f44c6[_0xc20c('0x7')],'transfererexten':_0x1f44c6[_0xc20c('0x8')],'transfererlinkedid':_0x1f44c6[_0xc20c('0x9')],'transfereechannel':_0x1f44c6[_0xc20c('0xa')],'transfereecalleridnum':_0x1f44c6['transfereecalleridnum'],'transfereecalleridname':_0x1f44c6[_0xc20c('0xb')],'transfereeconnectedlinenum':_0x1f44c6[_0xc20c('0xc')],'transfereeconnectedlinename':_0x1f44c6[_0xc20c('0xd')],'transfereeaccountcode':_0x1f44c6[_0xc20c('0xe')],'transfereecontext':_0x1f44c6[_0xc20c('0xf')],'transfereeexten':_0x1f44c6[_0xc20c('0x10')],'transfereelinkedid':_0x1f44c6[_0xc20c('0x11')],'isexternal':_0x1f44c6['isexternal'],'context':_0x1f44c6['context'],'extension':_0x1f44c6['extension'],'type':'blind'},'log':_0xc20c('0x3')});};exports[_0xc20c('0x12')]=function(_0x3a7645){return client[_0xc20c('0x2')](_0xc20c('0x3'),{'body':{'result':_0x3a7645['result'],'transfererchannel':_0x3a7645[_0xc20c('0x13')],'transferercalleridnum':_0x3a7645[_0xc20c('0x14')],'transferercalleridname':_0x3a7645[_0xc20c('0x15')],'transfererconnectedlinenum':_0x3a7645[_0xc20c('0x16')],'transfererconnectedlinename':_0x3a7645['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3a7645[_0xc20c('0x17')],'transferercontext':_0x3a7645[_0xc20c('0x18')],'transfererexten':_0x3a7645['secondtransfererexten'],'transfererlinkedid':_0x3a7645[_0xc20c('0x19')],'transfereechannel':_0x3a7645['transfertargetchannel'],'transfereecalleridnum':_0x3a7645['transfertargetcalleridnum'],'transfereecalleridname':_0x3a7645[_0xc20c('0x1a')],'transfereeconnectedlinenum':_0x3a7645[_0xc20c('0x1b')],'transfereeconnectedlinename':_0x3a7645[_0xc20c('0x1c')],'transfereeaccountcode':_0x3a7645[_0xc20c('0x1d')],'transfereecontext':_0x3a7645[_0xc20c('0x1e')],'transfereeexten':_0x3a7645['transfertargetexten'],'transfereelinkedid':_0x3a7645[_0xc20c('0x1f')],'isexternal':_0x3a7645[_0xc20c('0x20')],'context':_0x3a7645['origtransferercontext'],'extension':_0x3a7645[_0xc20c('0x21')],'type':_0xc20c('0x22')},'log':_0xc20c('0x3')});};
\ No newline at end of file
index e273808..f420e9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9505=['omit','undefined','values','channels','voicechannel','map','find','filename','uniqueid','wav','Action','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','channel','destinationchannel','StopMixMonitor','stop','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','telephones','trunks','campaigns','run','event','emit','custom:','faxAccounts','send','checkAfterSend','server','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','format','%s/%s','SIP','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','message','catch','command','Command','then','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length'];(function(_0x2f3b86,_0x1fffad){var _0x9741a0=function(_0x654b64){while(--_0x654b64){_0x2f3b86['push'](_0x2f3b86['shift']());}};_0x9741a0(++_0x1fffad);}(_0x9505,0x1e5));var _0x5950=function(_0x2ae20a,_0x634591){_0x2ae20a=_0x2ae20a-0x0;var _0x3c864d=_0x9505[_0x2ae20a];return _0x3c864d;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var jayson=require('jayson/promise');var schema=require(_0x5950('0x2'));var BPromise=require(_0x5950('0x3'));var moment=require(_0x5950('0x4'));var config=require(_0x5950('0x5'));var properties=require(_0x5950('0x6'));var ami=require('../ami');exports['listen']=function(_0x2494fc,_0x43f5b6,_0x3ac153){return new BPromise(function(_0x3a5973,_0x4aa518){var _0x4b9478={'QueuePause':function(_0x425d17){return new Promise(function(_0x362f04,_0x3986aa){var _0x16f0e9=util[_0x5950('0x7')](_0x5950('0x8'),_0x5950('0x9'),_0x425d17[_0x5950('0xa')]);if(_0x2494fc[_0x5950('0xb')]&&_0x2494fc['timers'][_0x16f0e9]&&_0x2494fc[_0x5950('0xb')][_0x16f0e9][_0x5950('0xc')]){_0x2494fc['timers'][_0x16f0e9]['updateAcw']();}if(_0x2494fc[_0x5950('0xd')][_0x16f0e9]){_0x2494fc[_0x5950('0xd')][_0x16f0e9][_0x5950('0xe')]({'statePause':_0x425d17[_0x5950('0xf')]?!![]:![]});}_0x362f04({'code':0xc8,'message':_0x5950('0x10')});});},'Reload':function(_0x2bf7ae){var _0x17c263=this;return new Promise(function(_0x38d757,_0x409092){if(ami[_0x5950('0x11')]()==![]){return _0x409092(_0x17c263[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}_0x2bf7ae=_[_0x5950('0x17')](_0x2bf7ae,_[_0x5950('0x18')](properties[_0x5950('0x19')]));_0x2bf7ae[_0x5950('0x1a')]=_0x5950('0x1b');return ami['Action'](_0x2bf7ae)['then'](function(_0x30e759){_0x38d757({'code':0xc8,'message':_0x30e759[_0x5950('0x1c')]});})[_0x5950('0x1d')](function(_0x5a9530){_0x409092(_0x17c263[_0x5950('0x12')](0x1f5,_0x5a9530['message']));});});},'Command':function(_0x49bb78){var _0x119f1f=this;return new Promise(function(_0x2ada72,_0x1ad343){if(ami['isConnected']()==![]){return _0x1ad343(_0x119f1f[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}_0x49bb78=_[_0x5950('0x17')](_0x49bb78,_0x5950('0x1e'));_0x49bb78[_0x5950('0x1a')]=_0x5950('0x1f');return ami['Action'](_0x49bb78)[_0x5950('0x20')](function(_0x3c58f4){_0x2ada72({'code':0xc8,'message':_0x3c58f4[_0x5950('0x21')]});})[_0x5950('0x1d')](function(_0x4757fd){_0x1ad343(_0x119f1f[_0x5950('0x12')](0x1f5,_0x4757fd[_0x5950('0x1c')]));});});},'VoiceQueues':function(_0x4b64a2){return new Promise(function(_0x4d9317,_0x1b2265){var _0x32c197=[];for(var _0x545354 in _0x2494fc[_0x5950('0x22')]){if(_0x2494fc[_0x5950('0x22')]['hasOwnProperty'](_0x545354)){var _0x4a7b22=_0x2494fc['voiceQueues'][_0x545354];var _0x20679e={'id':_0x4a7b22['id'],'name':_0x4a7b22[_0x5950('0xa')],'strategy':_0x4a7b22[_0x5950('0x23')],'answered':_0x4a7b22[_0x5950('0x24')],'available':_0x4a7b22[_0x5950('0x25')],'loggedIn':_0x4a7b22[_0x5950('0x26')],'pTalking':_0x4a7b22[_0x5950('0x27')],'sumBillable':_0x4a7b22[_0x5950('0x28')],'sumDuration':_0x4a7b22[_0x5950('0x29')],'sumHoldTime':_0x4a7b22[_0x5950('0x2a')]||0x0,'talking':_0x4a7b22[_0x5950('0x2b')],'total':_0x4a7b22[_0x5950('0x2c')],'type':_0x4a7b22[_0x5950('0x2d')],'unmanaged':_0x4a7b22[_0x5950('0x2e')],'abandoned':_0x4a7b22[_0x5950('0x2f')],'waiting':_0x4a7b22[_0x5950('0x30')],'loggedInDb':_0x4a7b22[_0x5950('0x31')]};if(_0x4a7b22[_0x5950('0x2d')]===_0x5950('0x32')){_0x20679e[_0x5950('0x33')]=_0x4a7b22[_0x5950('0x33')];_0x20679e[_0x5950('0x34')]=_0x4a7b22[_0x5950('0x34')];_0x20679e[_0x5950('0x35')]=_0x4a7b22[_0x5950('0x35')];_0x20679e[_0x5950('0x36')]=_0x4a7b22[_0x5950('0x36')];_0x20679e[_0x5950('0x37')]=_0x4a7b22['dialOriginateTimeout'];_0x20679e[_0x5950('0x38')]=_0x4a7b22[_0x5950('0x38')];_0x20679e[_0x5950('0x39')]=_0x4a7b22[_0x5950('0x39')];_0x20679e[_0x5950('0x3a')]=_0x4a7b22['outboundAnswerAgiCallsDay'];_0x20679e['outboundAnswerCallsDay']=_0x4a7b22[_0x5950('0x3b')];_0x20679e[_0x5950('0x3c')]=_0x4a7b22['outboundBlacklistCallsDay'];_0x20679e[_0x5950('0x3d')]=_0x4a7b22['outboundBusyCallsDay'];_0x20679e[_0x5950('0x3e')]=_0x4a7b22[_0x5950('0x3e')];_0x20679e[_0x5950('0x3f')]=_0x4a7b22['outboundDropCallsDayACS'];_0x20679e[_0x5950('0x40')]=_0x4a7b22['outboundDropCallsDayCallersExit'];_0x20679e[_0x5950('0x41')]=_0x4a7b22[_0x5950('0x41')];_0x20679e[_0x5950('0x42')]=_0x4a7b22[_0x5950('0x42')];_0x20679e['outboundNoSuchCallsDay']=_0x4a7b22[_0x5950('0x43')];_0x20679e[_0x5950('0x44')]=_0x4a7b22[_0x5950('0x44')];_0x20679e['outboundReCallsDay']=_0x4a7b22[_0x5950('0x45')];_0x20679e[_0x5950('0x46')]=_0x4a7b22['outboundRejectCallsDay'];_0x20679e['outboundUnknownCallsDay']=_0x4a7b22['outboundUnknownCallsDay'];_0x20679e[_0x5950('0x47')]=_0x4a7b22[_0x5950('0x47')];_0x20679e[_0x5950('0x48')]=_0x4a7b22[_0x5950('0x48')];_0x20679e[_0x5950('0x49')]=_0x4a7b22['predictiveIntervalAvgTalktime'];_0x20679e['predictiveIntervalDroppedCallsCallersExit']=_0x4a7b22['predictiveIntervalDroppedCallsCallersExit'];_0x20679e['predictiveIntervalDroppedCallsTimeout']=_0x4a7b22[_0x5950('0x4a')];_0x20679e[_0x5950('0x4b')]=_0x4a7b22[_0x5950('0x4b')];_0x20679e[_0x5950('0x4c')]=_0x4a7b22['predictiveIntervalErlangCallsDroppedCalls'];_0x20679e[_0x5950('0x4d')]=_0x4a7b22[_0x5950('0x4d')];_0x20679e['predictiveIntervalMultiplicativeFactor']=_0x4a7b22[_0x5950('0x4e')];_0x20679e[_0x5950('0x4f')]=_0x4a7b22[_0x5950('0x4f')];_0x20679e[_0x5950('0x50')]=_0x4a7b22[_0x5950('0x50')];_0x20679e[_0x5950('0x51')]=_0x4a7b22[_0x5950('0x51')];_0x20679e['message']=_0x4a7b22[_0x5950('0x1c')];_0x20679e['originated']=_0x4a7b22[_0x5950('0x52')];_0x20679e[_0x5950('0x53')]=_0x4a7b22['erlangCalls'];_0x20679e[_0x5950('0x54')]=_0x4a7b22[_0x5950('0x54')];_0x20679e[_0x5950('0x55')]=_0x4a7b22[_0x5950('0x55')];_0x20679e['erlangBusyFactor']=_0x4a7b22[_0x5950('0x56')];_0x20679e[_0x5950('0x57')]=_0x4a7b22[_0x5950('0x57')];_0x20679e[_0x5950('0x58')]=_0x4a7b22['startProgressive'];}if(_0x4a7b22[_0x5950('0x59')]){_0x20679e[_0x5950('0x59')]={'id':_0x4a7b22[_0x5950('0x59')]['id'],'name':_0x4a7b22['Trunk'][_0x5950('0xa')],'active':_0x4a7b22['Trunk'][_0x5950('0x5a')],'callerid':_0x4a7b22[_0x5950('0x59')][_0x5950('0x5b')]};}if(_0x4a7b22[_0x5950('0x5c')]){_0x20679e[_0x5950('0x5c')]={'id':_0x4a7b22[_0x5950('0x5c')]['id'],'name':_0x4a7b22[_0x5950('0x5c')]['name']};}_0x32c197[_0x5950('0x5d')](_0x20679e);}}_0x4d9317({'count':_0x32c197[_0x5950('0x5e')],'rows':_0x32c197});});},'UpdateVoiceQueue':function(_0x3a96d1){return new Promise(function(_0x1bdcec,_0x32375){var _0x52ba16=_['find'](_0x2494fc[_0x5950('0x22')],{'id':parseInt(_0x3a96d1['id'])});var _0x44189e=_[_0x5950('0x5f')](_0x3a96d1,['id']);if(_0x52ba16){for(var _0x4e560f in _0x44189e){if(typeof _0x44189e[_0x4e560f]!==_0x5950('0x60')&&typeof _0x52ba16[_0x4e560f]!==_0x5950('0x60')){_0x52ba16[_0x4e560f]=_0x44189e[_0x4e560f];}}_0x1bdcec(_0x52ba16);}else{_0x32375();}});},'VoiceChannels':function(_0x228b26){return new Promise(function(_0x4eae97,_0x554158){var _0x49f202=_[_0x5950('0x61')](_0x2494fc[_0x5950('0x62')]);_0x4eae97({'count':_0x49f202[_0x5950('0x5e')],'rows':_0x49f202});});},'VoiceChannelMixMonitor':function(_0x396cad){var _0x2f3371=this;return new Promise(function(_0x287470,_0x441ad5){if(ami[_0x5950('0x11')]()==![]){return _0x441ad5(_0x2f3371[_0x5950('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}var _0x1cbe8d=schema(properties[_0x5950('0x63')])[_0x5950('0x2')](_0x396cad);if(_0x1cbe8d[_0x5950('0x5e')]>0x0){return _0x441ad5(_0x2f3371[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x1cbe8d,'message')[_0x5950('0x16')](',\x20')));}var _0x168829=_[_0x5950('0x65')](_0x2494fc[_0x5950('0x62')],{'uniqueid':_0x396cad['uniqueid']});if(_0x168829&&_0x168829['channel']){var _0x3b36a9=util[_0x5950('0x7')]('%s.%s',_0x396cad[_0x5950('0x66')]||_0x396cad[_0x5950('0x67')],_0x396cad[_0x5950('0x7')]||_0x5950('0x68'));return ami[_0x5950('0x69')]({'action':_0x5950('0x6a'),'channel':_0x168829['channel'],'file':_0x3b36a9,'options':_0x5950('0x6b')})[_0x5950('0x20')](function(_0x4c6906){var _0x791ee9=_[_0x5950('0x65')](_0x168829[_0x5950('0x6c')],{'filename':'/var/spool/asterisk/monitor/'+_0x3b36a9[_0x5950('0x6d')]()});if(_[_0x5950('0x6e')](_0x791ee9)){_0x168829[_0x5950('0x6c')][_0x5950('0x5d')]({'filename':_0x5950('0x6f')+_0x3b36a9[_0x5950('0x6d')](),'createdAt':moment()[_0x5950('0x7')](_0x5950('0x70')),'mixmonitorid':_0x4c6906[_0x5950('0x71')],'status':'rec'});}else{_0x791ee9[_0x5950('0x71')]=_0x4c6906[_0x5950('0x71')];_0x791ee9[_0x5950('0x72')]=_0x5950('0x73');}_0x287470({'code':0xc8,'message':[_0x396cad[_0x5950('0x67')],_0x5950('0x74'),_0x4c6906[_0x5950('0x71')]]['join']('\x20'),'mixmonitorid':_0x4c6906[_0x5950('0x71')]});})['catch'](function(_0x3e417a){_0x441ad5(_0x2f3371['error'](0x1f5,[_0x396cad[_0x5950('0x67')],_0x3e417a[_0x5950('0x1c')]['toLowerCase']()][_0x5950('0x16')]('\x20')));});}else{return _0x441ad5(_0x2f3371['error'](0x1f5,_0x5950('0x75')));}});},'VoiceChannelStopMixMonitor':function(_0x4ebd64){var _0x50a3a8=this;return new Promise(function(_0x5c743b,_0x34fc6e){if(ami[_0x5950('0x11')]()==![]){return _0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}var _0x5bb971=schema(properties['voicechannel'])[_0x5950('0x2')](_0x4ebd64);if(_0x5bb971['length']>0x0){return _0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x5bb971,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x76b97=_['find'](_0x2494fc[_0x5950('0x62')],{'uniqueid':_0x4ebd64[_0x5950('0x67')]});if(_0x76b97){return BPromise[_0x5950('0x76')]()['then'](function(){if(_0x76b97['channel']){return ami[_0x5950('0x69')]({'action':'StopMixMonitor','channel':_0x76b97[_0x5950('0x77')],'mixmonitorid':_0x4ebd64[_0x5950('0x71')]})['catch'](function(_0x459df6){});}})[_0x5950('0x20')](function(){if(_0x76b97[_0x5950('0x78')]){return ami[_0x5950('0x69')]({'action':_0x5950('0x79'),'channel':_0x76b97[_0x5950('0x78')],'mixmonitorid':_0x4ebd64['mixmonitorid']})[_0x5950('0x1d')](function(_0xd9dd45){});}})[_0x5950('0x20')](function(_0x4cddfb){var _0x5129f7=_[_0x5950('0x65')](_0x76b97[_0x5950('0x6c')],{'mixmonitorid':_0x4ebd64[_0x5950('0x71')]});if(_0x5129f7){_0x5129f7[_0x5950('0x72')]=_0x5950('0x7a');}})[_0x5950('0x20')](function(){var _0x5dc25e=util[_0x5950('0x7')](_0x5950('0x7b'),_0x4ebd64[_0x5950('0x66')]||_0x4ebd64[_0x5950('0x67')],_0x4ebd64['format']||_0x5950('0x68'));var _0x4aa2ab=_['find'](_0x76b97[_0x5950('0x6c')],{'filename':'/var/spool/asterisk/monitor/'+_0x5dc25e[_0x5950('0x6d')]()});if(_0x4aa2ab){_0x4aa2ab['status']=_0x5950('0x7a');}})[_0x5950('0x20')](function(){_0x5c743b({'code':0xc8,'message':[_0x4ebd64['uniqueid'],_0x5950('0x7c')][_0x5950('0x16')]('\x20')});})[_0x5950('0x1d')](function(_0x5738b5){_0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f5,[_0x4ebd64[_0x5950('0x67')],_0x5738b5[_0x5950('0x1c')][_0x5950('0x6d')]()][_0x5950('0x16')]('\x20')));});}else{return _0x34fc6e(_0x50a3a8[_0x5950('0x12')](0x1f5,_0x5950('0x75')));}});},'VoiceQueuesChannels':function(_0x192dbc){return new Promise(function(_0x58ba24,_0x4217e9){var _0x21529d=_[_0x5950('0x61')](_0x2494fc[_0x5950('0x7d')]);_0x58ba24({'count':_0x21529d['length'],'rows':_0x21529d});});},'VoiceQueuesChannel':function(_0x29bd2e){var _0x3d2c59=this;return new Promise(function(_0xf3f0b0,_0x1539a7){var _0x5a7f13=schema(properties['voicequeuechannel'])[_0x5950('0x2')](_0x29bd2e);if(_0x5a7f13['length']>0x0){return _0x1539a7(_0x3d2c59[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x5a7f13,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x3a19e1=_['find'](_0x2494fc[_0x5950('0x7d')],{'uniqueid':_0x29bd2e[_0x5950('0x67')]});if(_0x3a19e1){_0xf3f0b0(_0x3a19e1);}else{return _0x1539a7(_0x3d2c59['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x183096){var _0xbc06ac=this;return new Promise(function(_0x3bdfb3,_0x46a2f8){if(ami[_0x5950('0x11')]()==![]){return _0x46a2f8(_0xbc06ac['error'](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],_0x5950('0x15')][_0x5950('0x16')]('\x20')));}var _0x58556f=schema(properties[_0x5950('0x7e')])[_0x5950('0x2')](_0x183096);if(_0x58556f['length']>0x0){return _0x46a2f8(_0xbc06ac['error'](0x1f4,_[_0x5950('0x64')](_0x58556f,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x3ad101=_[_0x5950('0x65')](_0x2494fc['queueChannels'],{'uniqueid':_0x183096['uniqueid']});if(_0x3ad101&&_0x3ad101[_0x5950('0x77')]){return ami[_0x5950('0x69')]({'action':'Hangup','channel':_0x3ad101[_0x5950('0x77')]})[_0x5950('0x20')](function(_0x1c067d){_0x3bdfb3({'code':0xc8,'message':[_0x183096[_0x5950('0x67')],_0x1c067d[_0x5950('0x1c')]['toLowerCase']()][_0x5950('0x16')]('\x20')});})['catch'](function(_0x58c58d){_0x46a2f8(_0xbc06ac[_0x5950('0x12')](0x1f5,[_0x183096[_0x5950('0x67')],_0x58c58d[_0x5950('0x1c')]['toLowerCase']()][_0x5950('0x16')]('\x20')));});}else{return _0x46a2f8(_0xbc06ac[_0x5950('0x12')](0x1f5,_0x5950('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x595575){var _0x4fdaa7=this;return new Promise(function(_0x39df9a,_0x3406cf){if(ami[_0x5950('0x11')]()==![]){return _0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f4,[config[_0x5950('0x13')]['ip'],config[_0x5950('0x13')][_0x5950('0x14')],'ami\x20disconnected'][_0x5950('0x16')]('\x20')));}var _0x5e14ca=schema(properties[_0x5950('0x7f')])[_0x5950('0x2')](_0x595575);if(_0x5e14ca[_0x5950('0x5e')]>0x0){return _0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f4,_[_0x5950('0x64')](_0x5e14ca,_0x5950('0x1c'))[_0x5950('0x16')](',\x20')));}var _0x56282a=_['find'](_0x2494fc[_0x5950('0x7d')],{'uniqueid':_0x595575[_0x5950('0x67')]});if(_0x56282a&&_0x56282a[_0x5950('0x77')]){return ami['Action']({'action':_0x5950('0x80'),'channel':_0x56282a[_0x5950('0x77')],'exten':_0x595575['exten'],'context':_0x595575['context']||_0x56282a[_0x5950('0x81')],'priority':0x1})[_0x5950('0x20')](function(_0x4349d8){_0x39df9a({'code':0xc8,'message':[_0x595575[_0x5950('0x67')],_0x4349d8[_0x5950('0x1c')]['toLowerCase']()]['join']('\x20')});})[_0x5950('0x1d')](function(_0x5373f8){_0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f5,[_0x595575['uniqueid'],_0x5373f8['message'][_0x5950('0x6d')]()]['join']('\x20')));});}else{return _0x3406cf(_0x4fdaa7[_0x5950('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x178d62){return new Promise(function(_0x57d6f1,_0x450805){var _0x3e55be=_[_0x5950('0x61')](_0x2494fc[_0x5950('0xd')]);_0x57d6f1({'count':_0x3e55be['length'],'rows':_0x3e55be});});},'Telephones':function(_0x2b4f2a){return new Promise(function(_0x214a33,_0x5ea984){var _0x1f4618=_['values'](_0x2494fc[_0x5950('0x82')]);_0x214a33({'count':_0x1f4618[_0x5950('0x5e')],'rows':_0x1f4618});});},'Trunks':function(_0x564ba2){return new Promise(function(_0x42b91b,_0x5e1806){var _0x5e89c8=_['values'](_0x2494fc[_0x5950('0x83')]);_0x42b91b({'count':_0x5e89c8[_0x5950('0x5e')],'rows':_0x5e89c8});});},'OutboundChannels':function(_0x185710){return new Promise(function(_0x9e555d,_0x274c9b){var _0x468274=_['values'](_0x2494fc['outboundChannels']);_0x9e555d({'count':_0x468274[_0x5950('0x5e')],'rows':_0x468274});});},'Outbound':function(_0x510ee3){return new Promise(function(_0x42702d,_0x5f1076){_0x42702d(_0x2494fc[_0x5950('0x32')]);});},'Campaigns':function(_0x38aa1e){return new Promise(function(_0x1c8c14,_0x5a07b9){var _0x409f30=_[_0x5950('0x61')](_0x2494fc[_0x5950('0x84')]);_0x1c8c14({'count':_0x409f30['length'],'rows':_0x409f30});});},'VoiceQueuesPreview':function(_0xedcf92){var _0x5021ef=this;return new Promise(function(_0x2bc976,_0x466fe3){_0x43f5b6[_0x5950('0x85')](_0xedcf92['id'])[_0x5950('0x20')](function(_0x5cfa95){_0x2bc976({'code':0xc8,'message':_0x5cfa95['message']});})[_0x5950('0x1d')](function(_0x27f433){_0x466fe3(_0x5021ef[_0x5950('0x12')](0x1f4,_0x27f433[_0x5950('0x1c')]));});});},'EventManager':function(_0x1ac4b0){var _0x2fa930=this;return new Promise(function(_0x4fe998,_0x5e80a7){if(!_0x1ac4b0[_0x5950('0x86')]){return _0x5e80a7(_0x2fa930[_0x5950('0x12')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x5950('0x87')](_0x5950('0x88')+_0x1ac4b0[_0x5950('0x86')],_0x1ac4b0[_0x5950('0x1c')]);_0x4fe998({'code':0xc8,'message':_0x1ac4b0});});},'FaxAccounts':function(_0xc5de0d){return new Promise(function(_0x1015a0,_0x2ac5c4){var _0x15ff36=_['values'](_0x2494fc[_0x5950('0x89')]);_0x1015a0({'count':_0x15ff36[_0x5950('0x5e')],'rows':_0x15ff36});});},'SendFax':function(_0x5ec0a8){var _0x5e9af3=this;return new Promise(function(_0x24f8c4,_0x4cf0ff){_0x3ac153[_0x5950('0x8a')](_0x5ec0a8)[_0x5950('0x20')](function(_0xf628f8){_0x24f8c4({'code':0xc8,'message':_0xf628f8[_0x5950('0x1c')]});})['catch'](function(_0x1e1552){_0x4cf0ff(_0x5e9af3[_0x5950('0x12')](0x1f4,_0x1e1552['message']));});});},'CheckAfterSend':function(_0x2c78be){var _0x2f5583=this;return new Promise(function(_0x47d316,_0x55a5e4){_0x3ac153[_0x5950('0x8b')](_0x2c78be)[_0x5950('0x20')](function(_0x2ad6d1){_0x47d316({'code':0xc8,'message':_0x2ad6d1[_0x5950('0x1c')]});})['catch'](function(_0x6af976){_0x55a5e4(_0x2f5583['error'](0x1f4,_0x6af976[_0x5950('0x1c')]));});});}};var _0x4e5874=jayson[_0x5950('0x8c')](_0x4b9478)['http']();_0x4e5874['on'](_0x5950('0x12'),function(_0x396a74){return _0x4aa518(_0x396a74);});_0x4e5874[_0x5950('0x8d')](0x232a,_0x5950('0x8e'),function(){console[_0x5950('0x8f')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3a5973(_0x5950('0x90')+0x232a);});});};
\ No newline at end of file
+var _0x6596=['erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','map','channels','uniqueid','channel','filename','wav','ai(mixmonitorid)','then','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','join','pick','keys','module','action','Reload','catch','message','ami\x20disconnected','command','Command','Action','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x497a00,_0x204016){var _0x590520=function(_0x79f1fd){while(--_0x79f1fd){_0x497a00['push'](_0x497a00['shift']());}};_0x590520(++_0x204016);}(_0x6596,0x1d3));var _0x6659=function(_0x65e36b,_0x4830d3){_0x65e36b=_0x65e36b-0x0;var _0x2f8a9c=_0x6596[_0x65e36b];return _0x2f8a9c;};'use strict';var _=require(_0x6659('0x0'));var util=require(_0x6659('0x1'));var jayson=require('jayson/promise');var schema=require(_0x6659('0x2'));var BPromise=require(_0x6659('0x3'));var moment=require(_0x6659('0x4'));var config=require(_0x6659('0x5'));var properties=require(_0x6659('0x6'));var ami=require(_0x6659('0x7'));exports['listen']=function(_0x483945,_0x7edf11,_0x3091f1){return new BPromise(function(_0xd6bf59,_0x1ed458){var _0x29292b={'QueuePause':function(_0x4a900d){return new Promise(function(_0x485ea0,_0x24bfdf){var _0x7b07d5=util[_0x6659('0x8')](_0x6659('0x9'),_0x6659('0xa'),_0x4a900d[_0x6659('0xb')]);if(_0x483945['timers']&&_0x483945[_0x6659('0xc')][_0x7b07d5]&&_0x483945['timers'][_0x7b07d5]['timer']){_0x483945[_0x6659('0xc')][_0x7b07d5]['updateAcw']();}if(_0x483945[_0x6659('0xd')][_0x7b07d5]){_0x483945[_0x6659('0xd')][_0x7b07d5][_0x6659('0xe')]({'statePause':_0x4a900d[_0x6659('0xf')]?!![]:![]});}_0x485ea0({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x3d68c5){var _0x329ebc=this;return new Promise(function(_0x518769,_0x2b3118){if(ami[_0x6659('0x10')]()==![]){return _0x2b3118(_0x329ebc[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')][_0x6659('0x13')],'ami\x20disconnected'][_0x6659('0x14')]('\x20')));}_0x3d68c5=_[_0x6659('0x15')](_0x3d68c5,_[_0x6659('0x16')](properties[_0x6659('0x17')]));_0x3d68c5[_0x6659('0x18')]=_0x6659('0x19');return ami['Action'](_0x3d68c5)['then'](function(_0x441d6d){_0x518769({'code':0xc8,'message':_0x441d6d['message']});})[_0x6659('0x1a')](function(_0x38e4d6){_0x2b3118(_0x329ebc['error'](0x1f5,_0x38e4d6[_0x6659('0x1b')]));});});},'Command':function(_0x5253e5){var _0xa5e094=this;return new Promise(function(_0x1dc4f1,_0x522f2e){if(ami[_0x6659('0x10')]()==![]){return _0x522f2e(_0xa5e094[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')][_0x6659('0x13')],_0x6659('0x1c')][_0x6659('0x14')]('\x20')));}_0x5253e5=_['pick'](_0x5253e5,_0x6659('0x1d'));_0x5253e5[_0x6659('0x18')]=_0x6659('0x1e');return ami[_0x6659('0x1f')](_0x5253e5)['then'](function(_0x4ce553){_0x1dc4f1({'code':0xc8,'message':_0x4ce553['content']});})['catch'](function(_0xbad53f){_0x522f2e(_0xa5e094[_0x6659('0x11')](0x1f5,_0xbad53f[_0x6659('0x1b')]));});});},'VoiceQueues':function(_0x6fc27){return new Promise(function(_0x45effc,_0x12b218){var _0x436691=[];for(var _0x3cb0dc in _0x483945[_0x6659('0x20')]){if(_0x483945['voiceQueues'][_0x6659('0x21')](_0x3cb0dc)){var _0x373a3d=_0x483945[_0x6659('0x20')][_0x3cb0dc];var _0x4866e0={'id':_0x373a3d['id'],'name':_0x373a3d['name'],'strategy':_0x373a3d[_0x6659('0x22')],'answered':_0x373a3d[_0x6659('0x23')],'available':_0x373a3d['available'],'loggedIn':_0x373a3d[_0x6659('0x24')],'pTalking':_0x373a3d[_0x6659('0x25')],'sumBillable':_0x373a3d[_0x6659('0x26')],'sumDuration':_0x373a3d[_0x6659('0x27')],'sumHoldTime':_0x373a3d[_0x6659('0x28')]||0x0,'talking':_0x373a3d['talking'],'total':_0x373a3d[_0x6659('0x29')],'type':_0x373a3d[_0x6659('0x2a')],'unmanaged':_0x373a3d[_0x6659('0x2b')],'abandoned':_0x373a3d[_0x6659('0x2c')],'waiting':_0x373a3d[_0x6659('0x2d')],'loggedInDb':_0x373a3d['loggedInDb']};if(_0x373a3d[_0x6659('0x2a')]===_0x6659('0x2e')){_0x4866e0[_0x6659('0x2f')]=_0x373a3d[_0x6659('0x2f')];_0x4866e0[_0x6659('0x30')]=_0x373a3d[_0x6659('0x30')];_0x4866e0[_0x6659('0x31')]=_0x373a3d['dialOriginateCallerIdName'];_0x4866e0[_0x6659('0x32')]=_0x373a3d[_0x6659('0x32')];_0x4866e0['dialOriginateTimeout']=_0x373a3d[_0x6659('0x33')];_0x4866e0['dialPrefix']=_0x373a3d[_0x6659('0x34')];_0x4866e0['temp']=_0x373a3d[_0x6659('0x35')];_0x4866e0[_0x6659('0x36')]=_0x373a3d['outboundAnswerAgiCallsDay'];_0x4866e0['outboundAnswerCallsDay']=_0x373a3d[_0x6659('0x37')];_0x4866e0['outboundBlacklistCallsDay']=_0x373a3d[_0x6659('0x38')];_0x4866e0['outboundBusyCallsDay']=_0x373a3d[_0x6659('0x39')];_0x4866e0['outboundCongestionCallsDay']=_0x373a3d[_0x6659('0x3a')];_0x4866e0[_0x6659('0x3b')]=_0x373a3d['outboundDropCallsDayACS'];_0x4866e0[_0x6659('0x3c')]=_0x373a3d[_0x6659('0x3c')];_0x4866e0[_0x6659('0x3d')]=_0x373a3d[_0x6659('0x3d')];_0x4866e0[_0x6659('0x3e')]=_0x373a3d['outboundNoAnswerCallsDay'];_0x4866e0[_0x6659('0x3f')]=_0x373a3d['outboundNoSuchCallsDay'];_0x4866e0['outboundOriginateFailureCallsDay']=_0x373a3d[_0x6659('0x40')];_0x4866e0[_0x6659('0x41')]=_0x373a3d[_0x6659('0x41')];_0x4866e0['outboundRejectCallsDay']=_0x373a3d[_0x6659('0x42')];_0x4866e0['outboundUnknownCallsDay']=_0x373a3d['outboundUnknownCallsDay'];_0x4866e0[_0x6659('0x43')]=_0x373a3d[_0x6659('0x43')];_0x4866e0[_0x6659('0x44')]=_0x373a3d[_0x6659('0x44')];_0x4866e0[_0x6659('0x45')]=_0x373a3d[_0x6659('0x45')];_0x4866e0[_0x6659('0x46')]=_0x373a3d['predictiveIntervalDroppedCallsCallersExit'];_0x4866e0['predictiveIntervalDroppedCallsTimeout']=_0x373a3d[_0x6659('0x47')];_0x4866e0[_0x6659('0x48')]=_0x373a3d[_0x6659('0x48')];_0x4866e0['predictiveIntervalErlangCallsDroppedCalls']=_0x373a3d[_0x6659('0x49')];_0x4866e0[_0x6659('0x4a')]=_0x373a3d['predictiveIntervalHitRate'];_0x4866e0[_0x6659('0x4b')]=_0x373a3d[_0x6659('0x4b')];_0x4866e0[_0x6659('0x4c')]=_0x373a3d[_0x6659('0x4c')];_0x4866e0[_0x6659('0x4d')]=_0x373a3d['predictiveIntervalAvailable'];_0x4866e0['predictiveIntervalTotalCalls']=_0x373a3d['predictiveIntervalTotalCalls'];_0x4866e0['message']=_0x373a3d[_0x6659('0x1b')];_0x4866e0['originated']=_0x373a3d['originated'];_0x4866e0[_0x6659('0x4e')]=_0x373a3d[_0x6659('0x4e')];_0x4866e0['erlangCallToSecond']=_0x373a3d[_0x6659('0x4f')];_0x4866e0[_0x6659('0x50')]=_0x373a3d['erlangAbandonmentRate'];_0x4866e0[_0x6659('0x51')]=_0x373a3d[_0x6659('0x51')];_0x4866e0[_0x6659('0x52')]=_0x373a3d[_0x6659('0x52')];_0x4866e0['startProgressive']=_0x373a3d[_0x6659('0x53')];}if(_0x373a3d['Trunk']){_0x4866e0[_0x6659('0x54')]={'id':_0x373a3d[_0x6659('0x54')]['id'],'name':_0x373a3d[_0x6659('0x54')][_0x6659('0xb')],'active':_0x373a3d[_0x6659('0x54')][_0x6659('0x55')],'callerid':_0x373a3d['Trunk']['callerid']};}if(_0x373a3d[_0x6659('0x56')]){_0x4866e0[_0x6659('0x56')]={'id':_0x373a3d[_0x6659('0x56')]['id'],'name':_0x373a3d[_0x6659('0x56')][_0x6659('0xb')]};}_0x436691[_0x6659('0x57')](_0x4866e0);}}_0x45effc({'count':_0x436691[_0x6659('0x58')],'rows':_0x436691});});},'UpdateVoiceQueue':function(_0x358f15){return new Promise(function(_0x3077a8,_0x440c7c){var _0x529f35=_[_0x6659('0x59')](_0x483945['voiceQueues'],{'id':parseInt(_0x358f15['id'])});var _0x104d61=_[_0x6659('0x5a')](_0x358f15,['id']);if(_0x529f35){for(var _0x577d7f in _0x104d61){if(typeof _0x104d61[_0x577d7f]!==_0x6659('0x5b')&&typeof _0x529f35[_0x577d7f]!==_0x6659('0x5b')){_0x529f35[_0x577d7f]=_0x104d61[_0x577d7f];}}_0x3077a8(_0x529f35);}else{_0x440c7c();}});},'VoiceChannels':function(_0x5cfef5){return new Promise(function(_0x2cbd80,_0x345313){var _0x6e0e41=_[_0x6659('0x5c')](_0x483945['channels']);_0x2cbd80({'count':_0x6e0e41['length'],'rows':_0x6e0e41});});},'VoiceChannelMixMonitor':function(_0x1832cc){var _0x268e06=this;return new Promise(function(_0x2c4c0e,_0x29f7f1){if(ami[_0x6659('0x10')]()==![]){return _0x29f7f1(_0x268e06[_0x6659('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6659('0x12')][_0x6659('0x13')],'ami\x20disconnected'][_0x6659('0x14')]('\x20')));}var _0x29e7cc=schema(properties['voicechannel'])[_0x6659('0x2')](_0x1832cc);if(_0x29e7cc[_0x6659('0x58')]>0x0){return _0x29f7f1(_0x268e06[_0x6659('0x11')](0x1f4,_[_0x6659('0x5d')](_0x29e7cc,_0x6659('0x1b'))[_0x6659('0x14')](',\x20')));}var _0x4686d3=_[_0x6659('0x59')](_0x483945[_0x6659('0x5e')],{'uniqueid':_0x1832cc[_0x6659('0x5f')]});if(_0x4686d3&&_0x4686d3[_0x6659('0x60')]){var _0x499c47=util['format']('%s.%s',_0x1832cc[_0x6659('0x61')]||_0x1832cc[_0x6659('0x5f')],_0x1832cc['format']||_0x6659('0x62'));return ami[_0x6659('0x1f')]({'action':'MixMonitor','channel':_0x4686d3[_0x6659('0x60')],'file':_0x499c47,'options':_0x6659('0x63')})[_0x6659('0x64')](function(_0x4f9abf){var _0xf2348f=_['find'](_0x4686d3['monitors'],{'filename':_0x6659('0x65')+_0x499c47[_0x6659('0x66')]()});if(_[_0x6659('0x67')](_0xf2348f)){_0x4686d3[_0x6659('0x68')][_0x6659('0x57')]({'filename':_0x6659('0x65')+_0x499c47[_0x6659('0x66')](),'createdAt':moment()[_0x6659('0x8')](_0x6659('0x69')),'mixmonitorid':_0x4f9abf[_0x6659('0x6a')],'status':_0x6659('0x6b')});}else{_0xf2348f[_0x6659('0x6a')]=_0x4f9abf[_0x6659('0x6a')];_0xf2348f['status']=_0x6659('0x6b');}_0x2c4c0e({'code':0xc8,'message':[_0x1832cc[_0x6659('0x5f')],'MixMonitor\x20Success',_0x4f9abf[_0x6659('0x6a')]][_0x6659('0x14')]('\x20'),'mixmonitorid':_0x4f9abf[_0x6659('0x6a')]});})['catch'](function(_0x21a365){_0x29f7f1(_0x268e06[_0x6659('0x11')](0x1f5,[_0x1832cc[_0x6659('0x5f')],_0x21a365[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x29f7f1(_0x268e06['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x35ac7d){var _0x316cb0=this;return new Promise(function(_0x230e61,_0x479178){if(ami[_0x6659('0x10')]()==![]){return _0x479178(_0x316cb0[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')][_0x6659('0x13')],_0x6659('0x1c')][_0x6659('0x14')]('\x20')));}var _0x55db3e=schema(properties['voicechannel'])['validate'](_0x35ac7d);if(_0x55db3e['length']>0x0){return _0x479178(_0x316cb0['error'](0x1f4,_['map'](_0x55db3e,_0x6659('0x1b'))[_0x6659('0x14')](',\x20')));}var _0x13f31d=_['find'](_0x483945[_0x6659('0x5e')],{'uniqueid':_0x35ac7d[_0x6659('0x5f')]});if(_0x13f31d){return BPromise['resolve']()[_0x6659('0x64')](function(){if(_0x13f31d[_0x6659('0x60')]){return ami[_0x6659('0x1f')]({'action':_0x6659('0x6d'),'channel':_0x13f31d['channel'],'mixmonitorid':_0x35ac7d[_0x6659('0x6a')]})[_0x6659('0x1a')](function(_0x1162e8){});}})[_0x6659('0x64')](function(){if(_0x13f31d[_0x6659('0x6e')]){return ami[_0x6659('0x1f')]({'action':'StopMixMonitor','channel':_0x13f31d[_0x6659('0x6e')],'mixmonitorid':_0x35ac7d[_0x6659('0x6a')]})[_0x6659('0x1a')](function(_0x23ba92){});}})['then'](function(_0x34b12e){var _0x4a551d=_['find'](_0x13f31d[_0x6659('0x68')],{'mixmonitorid':_0x35ac7d['mixmonitorid']});if(_0x4a551d){_0x4a551d[_0x6659('0x6f')]=_0x6659('0x70');}})['then'](function(){var _0x3977be=util[_0x6659('0x8')](_0x6659('0x71'),_0x35ac7d['filename']||_0x35ac7d[_0x6659('0x5f')],_0x35ac7d[_0x6659('0x8')]||_0x6659('0x62'));var _0x4c2b65=_['find'](_0x13f31d[_0x6659('0x68')],{'filename':_0x6659('0x65')+_0x3977be[_0x6659('0x66')]()});if(_0x4c2b65){_0x4c2b65['status']=_0x6659('0x70');}})[_0x6659('0x64')](function(){_0x230e61({'code':0xc8,'message':[_0x35ac7d[_0x6659('0x5f')],_0x6659('0x72')][_0x6659('0x14')]('\x20')});})[_0x6659('0x1a')](function(_0x1fcf50){_0x479178(_0x316cb0['error'](0x1f5,[_0x35ac7d[_0x6659('0x5f')],_0x1fcf50[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x479178(_0x316cb0['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceQueuesChannels':function(_0x50b75e){return new Promise(function(_0x466210,_0x4cb1aa){var _0x1027b4=_[_0x6659('0x5c')](_0x483945['queueChannels']);_0x466210({'count':_0x1027b4['length'],'rows':_0x1027b4});});},'VoiceQueuesChannel':function(_0x58755b){var _0x42e469=this;return new Promise(function(_0x58220d,_0x4e7e3e){var _0x445d9b=schema(properties[_0x6659('0x73')])[_0x6659('0x2')](_0x58755b);if(_0x445d9b[_0x6659('0x58')]>0x0){return _0x4e7e3e(_0x42e469['error'](0x1f4,_[_0x6659('0x5d')](_0x445d9b,_0x6659('0x1b'))[_0x6659('0x14')](',\x20')));}var _0x6d5339=_[_0x6659('0x59')](_0x483945[_0x6659('0x74')],{'uniqueid':_0x58755b[_0x6659('0x5f')]});if(_0x6d5339){_0x58220d(_0x6d5339);}else{return _0x4e7e3e(_0x42e469['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x55a3a9){var _0x2cf584=this;return new Promise(function(_0x27fbf7,_0x5d0a46){if(ami['isConnected']()==![]){return _0x5d0a46(_0x2cf584[_0x6659('0x11')](0x1f4,[config[_0x6659('0x12')]['ip'],config[_0x6659('0x12')]['username'],_0x6659('0x1c')][_0x6659('0x14')]('\x20')));}var _0x2704e8=schema(properties['voicequeuechannelhangup'])[_0x6659('0x2')](_0x55a3a9);if(_0x2704e8[_0x6659('0x58')]>0x0){return _0x5d0a46(_0x2cf584['error'](0x1f4,_['map'](_0x2704e8,_0x6659('0x1b'))['join'](',\x20')));}var _0x445fa8=_[_0x6659('0x59')](_0x483945[_0x6659('0x74')],{'uniqueid':_0x55a3a9[_0x6659('0x5f')]});if(_0x445fa8&&_0x445fa8[_0x6659('0x60')]){return ami[_0x6659('0x1f')]({'action':_0x6659('0x75'),'channel':_0x445fa8[_0x6659('0x60')]})[_0x6659('0x64')](function(_0x24b310){_0x27fbf7({'code':0xc8,'message':[_0x55a3a9[_0x6659('0x5f')],_0x24b310[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')});})[_0x6659('0x1a')](function(_0x472485){_0x5d0a46(_0x2cf584[_0x6659('0x11')](0x1f5,[_0x55a3a9[_0x6659('0x5f')],_0x472485[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x5d0a46(_0x2cf584['error'](0x1f5,_0x6659('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x43a607){var _0x39bd7d=this;return new Promise(function(_0x55e3e1,_0x1c6bff){if(ami[_0x6659('0x10')]()==![]){return _0x1c6bff(_0x39bd7d[_0x6659('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6659('0x12')][_0x6659('0x13')],'ami\x20disconnected'][_0x6659('0x14')]('\x20')));}var _0x4f2c4f=schema(properties[_0x6659('0x76')])[_0x6659('0x2')](_0x43a607);if(_0x4f2c4f[_0x6659('0x58')]>0x0){return _0x1c6bff(_0x39bd7d[_0x6659('0x11')](0x1f4,_['map'](_0x4f2c4f,'message')[_0x6659('0x14')](',\x20')));}var _0x1cf948=_[_0x6659('0x59')](_0x483945[_0x6659('0x74')],{'uniqueid':_0x43a607[_0x6659('0x5f')]});if(_0x1cf948&&_0x1cf948[_0x6659('0x60')]){return ami[_0x6659('0x1f')]({'action':_0x6659('0x77'),'channel':_0x1cf948[_0x6659('0x60')],'exten':_0x43a607[_0x6659('0x78')],'context':_0x43a607[_0x6659('0x79')]||_0x1cf948['context'],'priority':0x1})[_0x6659('0x64')](function(_0x52eee1){_0x55e3e1({'code':0xc8,'message':[_0x43a607[_0x6659('0x5f')],_0x52eee1[_0x6659('0x1b')][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')});})['catch'](function(_0x373c74){_0x1c6bff(_0x39bd7d[_0x6659('0x11')](0x1f5,[_0x43a607[_0x6659('0x5f')],_0x373c74['message'][_0x6659('0x66')]()][_0x6659('0x14')]('\x20')));});}else{return _0x1c6bff(_0x39bd7d['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2637b2){return new Promise(function(_0x42dffc,_0x58631d){var _0x38f9d8=_[_0x6659('0x5c')](_0x483945['agents']);_0x42dffc({'count':_0x38f9d8[_0x6659('0x58')],'rows':_0x38f9d8});});},'Telephones':function(_0x10a6e5){return new Promise(function(_0x3a5530,_0x597b0a){var _0x3abac8=_[_0x6659('0x5c')](_0x483945[_0x6659('0x7a')]);_0x3a5530({'count':_0x3abac8['length'],'rows':_0x3abac8});});},'Trunks':function(_0x1aeebc){return new Promise(function(_0x4e91b6,_0x5e8a39){var _0x5b0e0d=_[_0x6659('0x5c')](_0x483945['trunks']);_0x4e91b6({'count':_0x5b0e0d[_0x6659('0x58')],'rows':_0x5b0e0d});});},'OutboundChannels':function(_0x51f147){return new Promise(function(_0x339a4b,_0x3aabe9){var _0x377f91=_[_0x6659('0x5c')](_0x483945[_0x6659('0x7b')]);_0x339a4b({'count':_0x377f91['length'],'rows':_0x377f91});});},'Outbound':function(_0x52a25e){return new Promise(function(_0x2d8ffd,_0x5589e5){_0x2d8ffd(_0x483945[_0x6659('0x2e')]);});},'Campaigns':function(_0x257235){return new Promise(function(_0x460916,_0x23fe5b){var _0x17222b=_['values'](_0x483945[_0x6659('0x7c')]);_0x460916({'count':_0x17222b['length'],'rows':_0x17222b});});},'VoiceQueuesPreview':function(_0x3653ca){var _0x3b7f51=this;return new Promise(function(_0x5cd96a,_0x5f259a){_0x7edf11[_0x6659('0x7d')](_0x3653ca['id'])[_0x6659('0x64')](function(_0x407371){_0x5cd96a({'code':0xc8,'message':_0x407371[_0x6659('0x1b')]});})[_0x6659('0x1a')](function(_0x140261){_0x5f259a(_0x3b7f51[_0x6659('0x11')](0x1f4,_0x140261[_0x6659('0x1b')]));});});},'EventManager':function(_0x47b382){var _0x14ee7b=this;return new Promise(function(_0xb58af9,_0x33c6d9){if(!_0x47b382[_0x6659('0x7e')]){return _0x33c6d9(_0x14ee7b[_0x6659('0x11')](0x1f4,_0x6659('0x7f')));}ami['emit'](_0x6659('0x80')+_0x47b382['event'],_0x47b382[_0x6659('0x1b')]);_0xb58af9({'code':0xc8,'message':_0x47b382});});},'FaxAccounts':function(_0x3bd970){return new Promise(function(_0x590b7c,_0x3b0534){var _0x188807=_[_0x6659('0x5c')](_0x483945[_0x6659('0x81')]);_0x590b7c({'count':_0x188807[_0x6659('0x58')],'rows':_0x188807});});},'SendFax':function(_0x3fcf16){var _0x21fd8d=this;return new Promise(function(_0x22415c,_0x3b1dcf){_0x3091f1[_0x6659('0x82')](_0x3fcf16)['then'](function(_0x2ddc13){_0x22415c({'code':0xc8,'message':_0x2ddc13[_0x6659('0x1b')]});})[_0x6659('0x1a')](function(_0x1265b0){_0x3b1dcf(_0x21fd8d[_0x6659('0x11')](0x1f4,_0x1265b0[_0x6659('0x1b')]));});});},'CheckAfterSend':function(_0x2c5caf){var _0xfa0367=this;return new Promise(function(_0x43bb74,_0x1642fd){_0x3091f1[_0x6659('0x83')](_0x2c5caf)[_0x6659('0x64')](function(_0x310958){_0x43bb74({'code':0xc8,'message':_0x310958[_0x6659('0x1b')]});})[_0x6659('0x1a')](function(_0x350e91){_0x1642fd(_0xfa0367[_0x6659('0x11')](0x1f4,_0x350e91[_0x6659('0x1b')]));});});}};var _0x4b7f92=jayson[_0x6659('0x84')](_0x29292b)[_0x6659('0x85')]();_0x4b7f92['on']('error',function(_0x46cc91){return _0x1ed458(_0x46cc91);});_0x4b7f92[_0x6659('0x86')](0x232a,_0x6659('0x87'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xd6bf59(_0x6659('0x88')+0x232a);});});};
\ No newline at end of file
index e90780d..e4b74f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81da=['data4','isNil','calleridname','<unknown>','Unknown','firstName','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','map','routeId','destcalleridnum','calleridnum','lastName','mobile','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x31e13b,_0x2515f7){var _0x76bd9d=function(_0x1ae827){while(--_0x1ae827){_0x31e13b['push'](_0x31e13b['shift']());}};_0x76bd9d(++_0x2515f7);}(_0x81da,0xe3));var _0xa81d=function(_0x33ebc7,_0x227653){_0x33ebc7=_0x33ebc7-0x0;var _0x543aa1=_0x81da[_0x33ebc7];return _0x543aa1;};'use strict';var _=require(_0xa81d('0x0'));var BPromise=require(_0xa81d('0x1'));var Redis=require('ioredis');var util=require(_0xa81d('0x2'));var config=require(_0xa81d('0x3'));var logger=require('../../../../config/logger')(_0xa81d('0x4'));var cmContactRpc=require(_0xa81d('0x5'));config[_0xa81d('0x6')]=_[_0xa81d('0x7')](config[_0xa81d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa81d('0x8'))(new Redis(config[_0xa81d('0x6')]));function emit(_0x34b675,_0x40a245,_0x5d5ad5,_0x50f152,_0x24a23b){logger[_0xa81d('0x9')](_0xa81d('0xa'),_0x34b675,_0x40a245['id'],_0x5d5ad5,_0x50f152,JSON['stringify'](_0x24a23b));io['to'](_0x5d5ad5)[_0xa81d('0xb')](_0x50f152,_0x24a23b);}exports[_0xa81d('0xc')]=function(_0x45d1f1,_0x131193,_0x4bfe98,_0x2f1345){var _0x556d60,_0x2f57a3;var _0x39112b={};var _0x333f56=Number(_0x4bfe98[_0xa81d('0xd')]);var _0xedb190=_0x4bfe98['data2']?Boolean(Number(_0x4bfe98[_0xa81d('0xe')])):![];var _0x39f131;if(_0x2f1345[_0xa81d('0xf')]){_0x39112b['id']=_0x2f1345[_0xa81d('0xf')];}if(!_0x39112b['id']){_0x39112b[_0xa81d('0x10')]=_0x333f56;_0x39f131=_0x4bfe98[_0xa81d('0x11')]&&_0x4bfe98[_0xa81d('0x11')]!=='0'?_0x4bfe98['data3'][_0xa81d('0x12')](','):['phone'];_0x39112b['$or']=_[_0xa81d('0x13')](_0x39f131,function(_0x4654ec){var _0x3c1ec8={};_0x3c1ec8[_0x4654ec]=_0x2f1345[_0xa81d('0x14')]?_0x2f1345[_0xa81d('0x15')]:_0x2f1345[_0xa81d('0x16')];return _0x3c1ec8;});}var _0x5af4b9=['id','firstName',_0xa81d('0x17'),'phone',_0xa81d('0x18'),'fax',_0xa81d('0x10'),_0xa81d('0x19'),_0xa81d('0x1a'),_0xa81d('0x1b')];var _0x3f578c=_[_0xa81d('0x1c')](_0x5af4b9,_0x39f131);BPromise['resolve']()[_0xa81d('0x1d')](cmContactRpc[_0xa81d('0x1e')]({'attributes':_0x3f578c,'where':_0x39112b}))['then'](function(_0xd2f368){_0x2f57a3=_0xd2f368;if(!_[_0xa81d('0x1f')](_0x2f57a3)){if(_0x2f57a3[_0xa81d('0x20')]===0x1){_0x556d60=_0x2f57a3[0x0];logger[_0xa81d('0x9')](_0xa81d('0x21'),_0x2f1345['uniqueid'],_0x131193['id'],_0x556d60['id']);}else{logger[_0xa81d('0x9')](_0xa81d('0x22'),_0x2f1345[_0xa81d('0x23')],_0x131193['id'],_[_0xa81d('0x13')](_0x2f57a3,'id')[_0xa81d('0x24')](','));}return;}else{logger['info'](_0xa81d('0x25'),_0x2f1345[_0xa81d('0x23')],_0x131193['id']);var _0x35e983={'ListId':_0x333f56};var _0x8050d=_0x4bfe98[_0xa81d('0x26')]&&_0x4bfe98[_0xa81d('0x26')]!=='0'?_0x4bfe98[_0xa81d('0x26')]:'phone';if(_0xedb190){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2f1345['uniqueid'],_0x131193['id']);_0x35e983[_0x8050d]=_[_0xa81d('0x27')](_0x2f1345[_0xa81d('0x14')])?_0x2f1345[_0xa81d('0x16')]:_0x2f1345['destcalleridnum'];if(_['isNil'](_0x2f1345[_0xa81d('0x14')])){_0x35e983['firstName']=_0x2f1345[_0xa81d('0x28')]&&_0x2f1345['calleridname']!==_0xa81d('0x29')?_0x2f1345[_0xa81d('0x28')]:_0xa81d('0x2a');}else{_0x35e983[_0xa81d('0x2b')]=_0x2f1345[_0xa81d('0x2c')]&&_0x2f1345[_0xa81d('0x2c')]!==_0xa81d('0x29')?_0x2f1345[_0xa81d('0x2c')]:_0xa81d('0x2a');}return BPromise['resolve']()['then'](cmContactRpc[_0xa81d('0x2d')](_0x35e983))[_0xa81d('0x1d')](function(_0x3eabfb){_0x556d60=_0x3eabfb;_0x2f57a3[_0xa81d('0x2e')](_0x3eabfb);if(_0x556d60){logger[_0xa81d('0x9')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2f1345[_0xa81d('0x23')],_0x131193['id'],_0x556d60['id']);}return;});}else{logger[_0xa81d('0x9')](_0xa81d('0x2f'),_0x2f1345[_0xa81d('0x23')],_0x131193['id']);_0x35e983[_0x8050d]=_[_0xa81d('0x27')](_0x2f1345['routeId'])?_0x2f1345[_0xa81d('0x16')]:_0x2f1345[_0xa81d('0x15')];if(_[_0xa81d('0x27')](_0x2f1345[_0xa81d('0x14')])){_0x35e983['firstName']=_0x2f1345[_0xa81d('0x28')]&&_0x2f1345[_0xa81d('0x28')]!==_0xa81d('0x29')?_0x2f1345['calleridname']:_0xa81d('0x2a');}else{_0x35e983[_0xa81d('0x2b')]=_0x2f1345[_0xa81d('0x2c')]&&_0x2f1345[_0xa81d('0x2c')]!==_0xa81d('0x29')?_0x2f1345['destcalleridname']:_0xa81d('0x2a');}_0x556d60=_0x35e983;_0x2f57a3['push'](_0x35e983);return;}}})[_0xa81d('0x1d')](function(){if(_0x45d1f1){emit(_0x2f1345[_0xa81d('0x23')],_0x131193,util['format']('user:%s',_0x45d1f1[_0xa81d('0x30')]),util[_0xa81d('0x31')]('trigger:%s',_0x4bfe98[_0xa81d('0x32')][_0xa81d('0x33')]()),{'evt':_[_0xa81d('0x34')](_0x2f1345,{'autoCreate':_0xedb190}),'contact':_0x556d60===undefined?{}:_0x556d60,'contacts':_0x2f57a3[_0xa81d('0x20')]===0x0?undefined:_0x2f57a3});}});};
\ No newline at end of file
+var _0x7a8b=['then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','isNil','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','emit','exec','data2','xmd-contactid','ListId','map','routeId','destcalleridnum','calleridnum','firstName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','resolve'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7a8b,0x15c));var _0xb7a8=function(_0x2f2a8b,_0x4208b3){_0x2f2a8b=_0x2f2a8b-0x0;var _0x586892=_0x7a8b[_0x2f2a8b];return _0x586892;};'use strict';var _=require(_0xb7a8('0x0'));var BPromise=require(_0xb7a8('0x1'));var Redis=require(_0xb7a8('0x2'));var util=require(_0xb7a8('0x3'));var config=require(_0xb7a8('0x4'));var logger=require(_0xb7a8('0x5'))(_0xb7a8('0x6'));var cmContactRpc=require(_0xb7a8('0x7'));config[_0xb7a8('0x8')]=_[_0xb7a8('0x9')](config[_0xb7a8('0x8')],{'host':_0xb7a8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xdebeef,_0x4a6508,_0x8758eb,_0x340233,_0x27a94d){logger[_0xb7a8('0xb')]('[CM][%s][%s]',_0xdebeef,_0x4a6508['id'],_0x8758eb,_0x340233,JSON[_0xb7a8('0xc')](_0x27a94d));io['to'](_0x8758eb)[_0xb7a8('0xd')](_0x340233,_0x27a94d);}exports[_0xb7a8('0xe')]=function(_0x2f6c92,_0x54b0ce,_0x937abd,_0xcfa34b){var _0x288e40,_0x2b78ca;var _0x401257={};var _0xce7c50=Number(_0x937abd['data1']);var _0x40cb45=_0x937abd[_0xb7a8('0xf')]?Boolean(Number(_0x937abd['data2'])):![];var _0x5a4fd3;if(_0xcfa34b[_0xb7a8('0x10')]){_0x401257['id']=_0xcfa34b[_0xb7a8('0x10')];}if(!_0x401257['id']){_0x401257[_0xb7a8('0x11')]=_0xce7c50;_0x5a4fd3=_0x937abd['data3']&&_0x937abd['data3']!=='0'?_0x937abd['data3']['split'](','):['phone'];_0x401257['$or']=_[_0xb7a8('0x12')](_0x5a4fd3,function(_0x37aad8){var _0x54afa2={};_0x54afa2[_0x37aad8]=_0xcfa34b[_0xb7a8('0x13')]?_0xcfa34b[_0xb7a8('0x14')]:_0xcfa34b[_0xb7a8('0x15')];return _0x54afa2;});}var _0x35181b=['id',_0xb7a8('0x16'),'lastName',_0xb7a8('0x17'),_0xb7a8('0x18'),_0xb7a8('0x19'),_0xb7a8('0x11'),_0xb7a8('0x1a'),_0xb7a8('0x1b'),_0xb7a8('0x1c')];var _0x18443c=_['union'](_0x35181b,_0x5a4fd3);BPromise[_0xb7a8('0x1d')]()[_0xb7a8('0x1e')](cmContactRpc[_0xb7a8('0x1f')]({'attributes':_0x18443c,'where':_0x401257}))['then'](function(_0x41f121){_0x2b78ca=_0x41f121;if(!_[_0xb7a8('0x20')](_0x2b78ca)){if(_0x2b78ca[_0xb7a8('0x21')]===0x1){_0x288e40=_0x2b78ca[0x0];logger[_0xb7a8('0xb')](_0xb7a8('0x22'),_0xcfa34b['uniqueid'],_0x54b0ce['id'],_0x288e40['id']);}else{logger[_0xb7a8('0xb')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xcfa34b[_0xb7a8('0x23')],_0x54b0ce['id'],_['map'](_0x2b78ca,'id')[_0xb7a8('0x24')](','));}return;}else{logger['info'](_0xb7a8('0x25'),_0xcfa34b[_0xb7a8('0x23')],_0x54b0ce['id']);var _0x1f49a9={'ListId':_0xce7c50};var _0x1abc56=_0x937abd[_0xb7a8('0x26')]&&_0x937abd[_0xb7a8('0x26')]!=='0'?_0x937abd[_0xb7a8('0x26')]:'phone';if(_0x40cb45){logger[_0xb7a8('0xb')](_0xb7a8('0x27'),_0xcfa34b[_0xb7a8('0x23')],_0x54b0ce['id']);_0x1f49a9[_0x1abc56]=_['isNil'](_0xcfa34b[_0xb7a8('0x13')])?_0xcfa34b[_0xb7a8('0x15')]:_0xcfa34b[_0xb7a8('0x14')];if(_['isNil'](_0xcfa34b['routeId'])){_0x1f49a9[_0xb7a8('0x16')]=_0xcfa34b[_0xb7a8('0x28')]&&_0xcfa34b[_0xb7a8('0x28')]!==_0xb7a8('0x29')?_0xcfa34b[_0xb7a8('0x28')]:_0xb7a8('0x2a');}else{_0x1f49a9['firstName']=_0xcfa34b['destcalleridname']&&_0xcfa34b[_0xb7a8('0x2b')]!=='<unknown>'?_0xcfa34b[_0xb7a8('0x2b')]:_0xb7a8('0x2a');}return BPromise[_0xb7a8('0x1d')]()[_0xb7a8('0x1e')](cmContactRpc[_0xb7a8('0x2c')](_0x1f49a9))[_0xb7a8('0x1e')](function(_0x47edc2){_0x288e40=_0x47edc2;_0x2b78ca[_0xb7a8('0x2d')](_0x47edc2);if(_0x288e40){logger[_0xb7a8('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xcfa34b[_0xb7a8('0x23')],_0x54b0ce['id'],_0x288e40['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0xcfa34b[_0xb7a8('0x23')],_0x54b0ce['id']);_0x1f49a9[_0x1abc56]=_[_0xb7a8('0x2e')](_0xcfa34b['routeId'])?_0xcfa34b['calleridnum']:_0xcfa34b[_0xb7a8('0x14')];if(_[_0xb7a8('0x2e')](_0xcfa34b[_0xb7a8('0x13')])){_0x1f49a9['firstName']=_0xcfa34b[_0xb7a8('0x28')]&&_0xcfa34b['calleridname']!==_0xb7a8('0x29')?_0xcfa34b[_0xb7a8('0x28')]:'Unknown';}else{_0x1f49a9[_0xb7a8('0x16')]=_0xcfa34b[_0xb7a8('0x2b')]&&_0xcfa34b[_0xb7a8('0x2b')]!=='<unknown>'?_0xcfa34b['destcalleridname']:_0xb7a8('0x2a');}_0x288e40=_0x1f49a9;_0x2b78ca['push'](_0x1f49a9);return;}}})['then'](function(){if(_0x2f6c92){emit(_0xcfa34b[_0xb7a8('0x23')],_0x54b0ce,util[_0xb7a8('0x2f')](_0xb7a8('0x30'),_0x2f6c92[_0xb7a8('0x31')]),util[_0xb7a8('0x2f')](_0xb7a8('0x32'),_0x937abd[_0xb7a8('0x33')][_0xb7a8('0x34')]()),{'evt':_[_0xb7a8('0x35')](_0xcfa34b,{'autoCreate':_0x40cb45}),'contact':_0x288e40===undefined?{}:_0x288e40,'contacts':_0x2b78ca[_0xb7a8('0x21')]===0x0?undefined:_0x2b78ca});}});};
\ No newline at end of file
index 29577f9..4c55eee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x464a=['localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','sugarcrmAccounts','vtigerAccounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','emit','info','stringify','prototype','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','motionbar','data1','TemplateId','html','render','data2','template\x20not\x20found','buildUri','data3','isNil','location','windowWidth','data5','800','windowHeight','data6','600','winApplication','winArguments','format','user:%s','name','toLowerCase','jscripty','trigger:%s','exec','accounts','routeId','urlforward','parse','query','search','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','queue','membername','lastevent','exports','util','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis'];(function(_0x2f980c,_0x2c3e8e){var _0x5c43cd=function(_0x1c9335){while(--_0x1c9335){_0x2f980c['push'](_0x2f980c['shift']());}};_0x5c43cd(++_0x2c3e8e);}(_0x464a,0x150));var _0xa464=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x464a[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0xa464('0x0'));var _=require('lodash');var url=require(_0xa464('0x1'));var Mustache=require(_0xa464('0x2'));var Redis=require('ioredis');var urlforward=require(_0xa464('0x3'));var integration=require(_0xa464('0x4'));var cmContact=require(_0xa464('0x5'));var script=require(_0xa464('0x6'));var config=require(_0xa464('0x7'));var logger=require(_0xa464('0x8'))('trigger');var ami=require(_0xa464('0x9'));config['redis']=_[_0xa464('0xa')](config[_0xa464('0xb')],{'host':_0xa464('0xc'),'port':0x18eb});var io=require(_0xa464('0xd'))(new Redis(config[_0xa464('0xb')]));var operators={'equals':function(_0x92f2e0,_0x293857){return _0x92f2e0==_0x293857;},'not_equals':function(_0x1b04e8,_0x2b603a){return _0x1b04e8!=_0x2b603a;}};var barAndWebActions=[_0xa464('0xe'),'url',_0xa464('0xf')];function Trigger(_0x493318){this['triggers']=_0x493318[_0xa464('0x10')];this[_0xa464('0x11')]=_0x493318[_0xa464('0x11')];this['voiceQueues']=_0x493318[_0xa464('0x12')];this[_0xa464('0x13')]=_0x493318['templates'];this['voiceExtensions']=_0x493318[_0xa464('0x14')];this[_0xa464('0x15')]=_0x493318['zendeskAccounts'];this[_0xa464('0x16')]=_0x493318[_0xa464('0x16')];this[_0xa464('0x17')]=_0x493318[_0xa464('0x17')];this['sugarcrmAccounts']=_0x493318['sugarcrmAccounts'];this[_0xa464('0x18')]=_0x493318[_0xa464('0x18')];this['deskAccounts']=_0x493318[_0xa464('0x19')];this['vtigerAccounts']=_0x493318['vtigerAccounts'];this['servicenowAccounts']=_0x493318[_0xa464('0x1a')];this[_0xa464('0x1b')]=_0x493318['dynamics365Accounts'];this['freshsalesAccounts']=_0x493318['freshsalesAccounts'];this['accounts']={'zendesk':this[_0xa464('0x15')],'salesforce':this[_0xa464('0x17')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xa464('0x1c')],'zoho':this[_0xa464('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0xa464('0x1d')],'dynamics365':this[_0xa464('0x1b')],'freshsales':this[_0xa464('0x1e')],'servicenow':this[_0xa464('0x1a')]};ami['on'](_0xa464('0x1f'),this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on']('custom:agentconnect',this[_0xa464('0x20')]['bind'](this));ami['on'](_0xa464('0x22'),this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on'](_0xa464('0x23'),this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on']('custom:agentnosuchnumber',this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on'](_0xa464('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa464('0x25'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xa464('0x21')](this));ami['on'](_0xa464('0x26'),this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on'](_0xa464('0x27'),this[_0xa464('0x20')]['bind'](this));ami['on'](_0xa464('0x28'),this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on'](_0xa464('0x29'),this[_0xa464('0x20')]['bind'](this));ami['on'](_0xa464('0x2a'),this[_0xa464('0x2b')][_0xa464('0x21')](this));ami['on'](_0xa464('0x2c'),this[_0xa464('0x2b')][_0xa464('0x21')](this));ami['on'](_0xa464('0x2d'),this[_0xa464('0x2b')][_0xa464('0x21')](this));ami['on']('custom:newinteraction',this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on'](_0xa464('0x2e'),this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on']('custom:incomingmessage',this[_0xa464('0x20')][_0xa464('0x21')](this));ami['on'](_0xa464('0x2f'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa464('0x30'),this['syncCustomEvent'][_0xa464('0x21')](this));ami['on']('custom:rejectmessage',this[_0xa464('0x20')][_0xa464('0x21')](this));}Trigger['prototype'][_0xa464('0x31')]=function(_0x31625d,_0x5e8bd4,_0xc578e6){logger[_0xa464('0x32')](_0x31625d,_0x5e8bd4,JSON[_0xa464('0x33')](_0xc578e6));io['to'](_0x31625d)[_0xa464('0x31')](_0x5e8bd4,_0xc578e6);};Trigger[_0xa464('0x34')][_0xa464('0x20')]=function(_0x31dfac){var _0x48e49b=_['clone'](_0x31dfac);this[_0xa464('0x35')](_0x48e49b);};Trigger[_0xa464('0x34')][_0xa464('0x2b')]=function(_0x50daf7){if(this[_0xa464('0x11')][_0x50daf7[_0xa464('0x36')]]){this[_0xa464('0x20')](_0x50daf7);}};Trigger[_0xa464('0x34')]['checkTriggers']=function(_0x3d1ce9){var _0x38d406;for(var _0x142126 in this['triggers']){if(this[_0xa464('0x10')][_0xa464('0x37')](_0x142126)){if(this[_0xa464('0x10')][_0x142126][_0xa464('0x38')]){_0x38d406=this[_0xa464('0x39')](this[_0xa464('0x10')][_0x142126],_0x3d1ce9);if(_0x38d406){_[_0xa464('0x3a')](_0x3d1ce9,_0x3d1ce9[_0xa464('0x3b')]);for(var _0xf4132e=0x0,_0x47dd03,_0xc005fd,_0x302c2d;_0xf4132e<this['triggers'][_0x142126][_0xa464('0x3c')][_0xa464('0x3d')];_0xf4132e+=0x1){_0x47dd03=this[_0xa464('0x10')][_0x142126][_0xa464('0x3c')][_0xf4132e];if(this['agents'][_0x3d1ce9[_0xa464('0x36')]]){switch(_0x47dd03[_0xa464('0x3e')]['toLowerCase']()){case'contactmanager':break;case _0xa464('0x3f'):case'browser':var _0x5b3c7c={};switch(barAndWebActions[_0x47dd03[_0xa464('0x40')]]){case _0xa464('0xe'):_0x5b3c7c[_0xa464('0x41')]=_0x47dd03['data2'];_0x5b3c7c[_0xa464('0x42')]=this['templates'][_0x47dd03['data2']]?Mustache[_0xa464('0x43')](this['templates'][_0x47dd03[_0xa464('0x44')]][_0xa464('0x42')],_0x3d1ce9):_0xa464('0x45');break;case _0xa464('0x1'):_0x5b3c7c['uri']=this[_0xa464('0x46')](_0x47dd03[_0xa464('0x44')],_0x3d1ce9,_['isNil'](_0x47dd03[_0xa464('0x47')])?!![]:parseInt(_0x47dd03['data3'],0xa));if(_[_0xa464('0x48')](_0x47dd03['data4'])){_0x5b3c7c[_0xa464('0x49')]='0';}else{_0x5b3c7c['uriLocation']=_0x47dd03['data4'];_0x5b3c7c[_0xa464('0x4a')]=_[_0xa464('0x48')](_0x47dd03[_0xa464('0x4b')])?_0xa464('0x4c'):_0x47dd03[_0xa464('0x4b')];_0x5b3c7c[_0xa464('0x4d')]=_['isNil'](_0x47dd03[_0xa464('0x4e')])?_0xa464('0x4f'):_0x47dd03[_0xa464('0x4e')];}break;case _0xa464('0xf'):_0x5b3c7c[_0xa464('0x50')]=_0x47dd03['data2']?Mustache[_0xa464('0x43')](_0x47dd03['data2'],_0x3d1ce9):'';_0x5b3c7c[_0xa464('0x51')]=_0x47dd03[_0xa464('0x47')]?Mustache[_0xa464('0x43')](_0x47dd03['data3'],_0x3d1ce9):'';break;}this[_0xa464('0x31')](util[_0xa464('0x52')](_0xa464('0x53'),this[_0xa464('0x11')][_0x3d1ce9['interface']][_0xa464('0x54')]),util[_0xa464('0x52')]('trigger:%s:%s',_0x47dd03[_0xa464('0x3e')][_0xa464('0x55')](),barAndWebActions[_0x47dd03[_0xa464('0x40')]]),_[_0xa464('0x3a')](_0x5b3c7c,_0x3d1ce9));break;case _0xa464('0x56'):this['emit'](util['format'](_0xa464('0x53'),this[_0xa464('0x11')][_0x3d1ce9[_0xa464('0x36')]][_0xa464('0x54')]),util[_0xa464('0x52')]('trigger:%s',_0x47dd03[_0xa464('0x3e')][_0xa464('0x55')]()),_[_0xa464('0x3a')]({'ProjectId':parseInt(_0x47dd03[_0xa464('0x40')],0xa)},_0x3d1ce9));break;default:this[_0xa464('0x31')](util['format'](_0xa464('0x53'),this[_0xa464('0x11')][_0x3d1ce9[_0xa464('0x36')]][_0xa464('0x54')]),util[_0xa464('0x52')](_0xa464('0x57'),_0x47dd03[_0xa464('0x3e')]['toLowerCase']()),_[_0xa464('0x3a')]({},_0x47dd03,_0x3d1ce9));}}switch(_0x47dd03[_0xa464('0x3e')][_0xa464('0x55')]()){case'contactmanager':cmContact[_0xa464('0x58')](this[_0xa464('0x11')][_0x3d1ce9[_0xa464('0x36')]],this[_0xa464('0x10')][_0x142126],_0x47dd03,_0x3d1ce9);break;case'integration':integration[_0xa464('0x58')](_0x47dd03,_0x3d1ce9,this[_0xa464('0x59')],this['agents'][_0x3d1ce9['interface']],this[_0xa464('0x12')][_0x3d1ce9['queue']],this[_0xa464('0x14')][_0x3d1ce9[_0xa464('0x5a')]]);break;case _0xa464('0x5b'):urlforward['exec'](_0x47dd03,_0x3d1ce9);break;case'script':script['exec'](_0x47dd03,_0x3d1ce9);break;}}}}}}};Trigger[_0xa464('0x34')][_0xa464('0x46')]=function(_0xaefe2,_0x2f90a5,_0x4d1cbe){var _0x3f4939=url[_0xa464('0x5c')](Mustache['render'](_0xaefe2,_0x2f90a5),!![]);if(_0x4d1cbe){_[_0xa464('0x3a')](_0x3f4939[_0xa464('0x5d')],_0x2f90a5);}delete _0x3f4939[_0xa464('0x5e')];var _0x4995f5=url[_0xa464('0x52')](_0x3f4939);_0x4995f5=_0x4995f5[_0xa464('0x5f')](/\/\?/g,'?');return _0x4995f5;};Trigger[_0xa464('0x34')][_0xa464('0x39')]=function(_0x27c339,_0x4d6f83){var _0x293b42=!![],_0x3228c8=!![];if(_0x27c339[_0xa464('0x60')]['length']){_0x293b42=_[_0xa464('0x61')](_0x27c339[_0xa464('0x60')],this[_0xa464('0x62')](_0x4d6f83,_0x27c339[_0xa464('0x63')]));}if(_0x27c339[_0xa464('0x64')][_0xa464('0x3d')]){_0x3228c8=_[_0xa464('0x65')](_0x27c339[_0xa464('0x64')],this['checkConditions'](_0x4d6f83,_0x27c339[_0xa464('0x63')]));}return _0x293b42&&_0x3228c8;};Trigger['prototype'][_0xa464('0x62')]=function(_0xa3b01e,_0x467e0c){return function(_0x5d6e68){switch(_0x5d6e68['field']){case _0xa464('0x66'):if(_0xa3b01e[_0xa464('0x63')]===_0x467e0c){if(_0x467e0c===_0xa464('0x67')){return _0xa3b01e[_0xa464('0x68')]?operators[_0x5d6e68[_0xa464('0x69')]](Number(_0x5d6e68[_0xa464('0x6a')]),_0xa3b01e[_0xa464('0x68')]):![];}else{return _0xa3b01e[_[_0xa464('0x6b')](_0x467e0c)+'AccountId']?operators[_0x5d6e68[_0xa464('0x69')]](Number(_0x5d6e68[_0xa464('0x6a')]),_0xa3b01e[_['upperFirst'](_0x467e0c)+_0xa464('0x6c')]):![];}}break;case _0xa464('0x6d'):case _0xa464('0x6e'):if(_0xa3b01e[_0xa464('0x63')]===_0x467e0c){return _0xa3b01e[_0xa464('0x6f')]?operators[_0x5d6e68['operator']](_0x5d6e68[_0xa464('0x6a')],_0xa3b01e['event']):![];}break;case _0xa464('0x70'):return _0xa3b01e[_0xa464('0x70')]?operators[_0x5d6e68[_0xa464('0x69')]](_0x5d6e68[_0xa464('0x6a')],_0xa3b01e[_0xa464('0x70')]):![];case'agent':return _0xa3b01e[_0xa464('0x71')]?operators[_0x5d6e68[_0xa464('0x69')]](_0x5d6e68[_0xa464('0x6a')],_0xa3b01e['membername']):![];case _0xa464('0x72'):return _0xa3b01e['lastevent']?operators[_0x5d6e68[_0xa464('0x69')]](_0x5d6e68[_0xa464('0x6a')],_0xa3b01e['lastevent']):![];case'routeId':return _0xa3b01e['routeId']?operators[_0x5d6e68[_0xa464('0x69')]](_0x5d6e68['value'],_0xa3b01e['routeId']):![];}return![];};};module[_0xa464('0x73')]=Trigger;
\ No newline at end of file
+var _0x50ff=['exec','integration','queue','voiceExtensions','urlforward','script','parse','query','search','replace','AllConditions','every','checkConditions','channel','AnyConditions','account','chat','ChatWebsiteId','operator','upperFirst','AccountId','interaction','message','event','value','agent','lastevent','routeId','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','zendeskAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','salesforceAccounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','prototype','emit','info','clone','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','Actions','length','action','contactmanager','motionbar','browser','data1','data2','render','html','template\x20not\x20found','uri','buildUri','data3','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winapp','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','toLowerCase'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x50ff,0x95));var _0xf50f=function(_0x13f550,_0x3dc497){_0x13f550=_0x13f550-0x0;var _0x42ccf5=_0x50ff[_0x13f550];return _0x42ccf5;};'use strict';var util=require('util');var _=require(_0xf50f('0x0'));var url=require(_0xf50f('0x1'));var Mustache=require(_0xf50f('0x2'));var Redis=require(_0xf50f('0x3'));var urlforward=require(_0xf50f('0x4'));var integration=require(_0xf50f('0x5'));var cmContact=require(_0xf50f('0x6'));var script=require(_0xf50f('0x7'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xf50f('0x8'));var ami=require(_0xf50f('0x9'));config[_0xf50f('0xa')]=_[_0xf50f('0xb')](config[_0xf50f('0xa')],{'host':_0xf50f('0xc'),'port':0x18eb});var io=require(_0xf50f('0xd'))(new Redis(config[_0xf50f('0xa')]));var operators={'equals':function(_0x3941ad,_0x1d4d36){return _0x3941ad==_0x1d4d36;},'not_equals':function(_0x4c8e41,_0x3cabc9){return _0x4c8e41!=_0x3cabc9;}};var barAndWebActions=[_0xf50f('0xe'),'url','winapp'];function Trigger(_0x5957f2){this['triggers']=_0x5957f2[_0xf50f('0xf')];this[_0xf50f('0x10')]=_0x5957f2[_0xf50f('0x10')];this[_0xf50f('0x11')]=_0x5957f2['voiceQueues'];this[_0xf50f('0x12')]=_0x5957f2[_0xf50f('0x12')];this['voiceExtensions']=_0x5957f2['voiceExtensions'];this[_0xf50f('0x13')]=_0x5957f2[_0xf50f('0x13')];this['freshdeskAccounts']=_0x5957f2['freshdeskAccounts'];this['salesforceAccounts']=_0x5957f2['salesforceAccounts'];this[_0xf50f('0x14')]=_0x5957f2['sugarcrmAccounts'];this['zohoAccounts']=_0x5957f2['zohoAccounts'];this['deskAccounts']=_0x5957f2[_0xf50f('0x15')];this[_0xf50f('0x16')]=_0x5957f2[_0xf50f('0x16')];this[_0xf50f('0x17')]=_0x5957f2[_0xf50f('0x17')];this[_0xf50f('0x18')]=_0x5957f2[_0xf50f('0x18')];this[_0xf50f('0x19')]=_0x5957f2[_0xf50f('0x19')];this[_0xf50f('0x1a')]={'zendesk':this[_0xf50f('0x13')],'salesforce':this[_0xf50f('0x1b')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xf50f('0x14')],'zoho':this[_0xf50f('0x1c')],'desk':this[_0xf50f('0x15')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xf50f('0x18')],'freshsales':this[_0xf50f('0x19')],'servicenow':this[_0xf50f('0x17')]};ami['on'](_0xf50f('0x1d'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x20'),this[_0xf50f('0x1e')]['bind'](this));ami['on'](_0xf50f('0x21'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x22'),this[_0xf50f('0x1e')]['bind'](this));ami['on'](_0xf50f('0x23'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x24'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentbusy',this[_0xf50f('0x1e')]['bind'](this));ami['on'](_0xf50f('0x25'),this['syncCustomEvent'][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x26'),this['syncCustomEvent'][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x27'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x28'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on']('custom:timeout',this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x29'),this[_0xf50f('0x2a')]['bind'](this));ami['on'](_0xf50f('0x2b'),this[_0xf50f('0x2a')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x2c'),this[_0xf50f('0x2a')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x2d'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on']('custom:closedinteraction',this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on'](_0xf50f('0x2e'),this[_0xf50f('0x1e')]['bind'](this));ami['on'](_0xf50f('0x2f'),this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on']('custom:acceptmessage',this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));ami['on']('custom:rejectmessage',this[_0xf50f('0x1e')][_0xf50f('0x1f')](this));}Trigger[_0xf50f('0x30')][_0xf50f('0x31')]=function(_0x3fd37b,_0x2adff5,_0x90bc9c){logger[_0xf50f('0x32')](_0x3fd37b,_0x2adff5,JSON['stringify'](_0x90bc9c));io['to'](_0x3fd37b)[_0xf50f('0x31')](_0x2adff5,_0x90bc9c);};Trigger['prototype'][_0xf50f('0x1e')]=function(_0x1cf618){var _0x45f8d1=_[_0xf50f('0x33')](_0x1cf618);this[_0xf50f('0x34')](_0x45f8d1);};Trigger['prototype'][_0xf50f('0x2a')]=function(_0x11da42){if(this[_0xf50f('0x10')][_0x11da42[_0xf50f('0x35')]]){this[_0xf50f('0x1e')](_0x11da42);}};Trigger[_0xf50f('0x30')][_0xf50f('0x34')]=function(_0xc87035){var _0x47fd63;for(var _0x263cfa in this[_0xf50f('0xf')]){if(this[_0xf50f('0xf')][_0xf50f('0x36')](_0x263cfa)){if(this[_0xf50f('0xf')][_0x263cfa][_0xf50f('0x37')]){_0x47fd63=this[_0xf50f('0x38')](this[_0xf50f('0xf')][_0x263cfa],_0xc87035);if(_0x47fd63){_[_0xf50f('0x39')](_0xc87035,_0xc87035['variables']);for(var _0x3e32dc=0x0,_0x2c36bd,_0xc05bcd,_0x554410;_0x3e32dc<this[_0xf50f('0xf')][_0x263cfa][_0xf50f('0x3a')][_0xf50f('0x3b')];_0x3e32dc+=0x1){_0x2c36bd=this[_0xf50f('0xf')][_0x263cfa][_0xf50f('0x3a')][_0x3e32dc];if(this[_0xf50f('0x10')][_0xc87035[_0xf50f('0x35')]]){switch(_0x2c36bd[_0xf50f('0x3c')]['toLowerCase']()){case _0xf50f('0x3d'):break;case _0xf50f('0x3e'):case _0xf50f('0x3f'):var _0x12625d={};switch(barAndWebActions[_0x2c36bd[_0xf50f('0x40')]]){case _0xf50f('0xe'):_0x12625d['TemplateId']=_0x2c36bd[_0xf50f('0x41')];_0x12625d['html']=this[_0xf50f('0x12')][_0x2c36bd[_0xf50f('0x41')]]?Mustache[_0xf50f('0x42')](this[_0xf50f('0x12')][_0x2c36bd[_0xf50f('0x41')]][_0xf50f('0x43')],_0xc87035):_0xf50f('0x44');break;case _0xf50f('0x1'):_0x12625d[_0xf50f('0x45')]=this[_0xf50f('0x46')](_0x2c36bd[_0xf50f('0x41')],_0xc87035,_['isNil'](_0x2c36bd['data3'])?!![]:parseInt(_0x2c36bd[_0xf50f('0x47')],0xa));if(_[_0xf50f('0x48')](_0x2c36bd[_0xf50f('0x49')])){_0x12625d['location']='0';}else{_0x12625d[_0xf50f('0x4a')]=_0x2c36bd[_0xf50f('0x49')];_0x12625d[_0xf50f('0x4b')]=_[_0xf50f('0x48')](_0x2c36bd[_0xf50f('0x4c')])?_0xf50f('0x4d'):_0x2c36bd[_0xf50f('0x4c')];_0x12625d[_0xf50f('0x4e')]=_['isNil'](_0x2c36bd[_0xf50f('0x4f')])?_0xf50f('0x50'):_0x2c36bd[_0xf50f('0x4f')];}break;case _0xf50f('0x51'):_0x12625d[_0xf50f('0x52')]=_0x2c36bd[_0xf50f('0x41')]?Mustache[_0xf50f('0x42')](_0x2c36bd[_0xf50f('0x41')],_0xc87035):'';_0x12625d[_0xf50f('0x53')]=_0x2c36bd[_0xf50f('0x47')]?Mustache[_0xf50f('0x42')](_0x2c36bd[_0xf50f('0x47')],_0xc87035):'';break;}this[_0xf50f('0x31')](util[_0xf50f('0x54')](_0xf50f('0x55'),this[_0xf50f('0x10')][_0xc87035['interface']][_0xf50f('0x56')]),util[_0xf50f('0x54')](_0xf50f('0x57'),_0x2c36bd[_0xf50f('0x3c')]['toLowerCase'](),barAndWebActions[_0x2c36bd[_0xf50f('0x40')]]),_[_0xf50f('0x39')](_0x12625d,_0xc87035));break;case _0xf50f('0x58'):this['emit'](util[_0xf50f('0x54')](_0xf50f('0x55'),this['agents'][_0xc87035[_0xf50f('0x35')]][_0xf50f('0x56')]),util[_0xf50f('0x54')](_0xf50f('0x59'),_0x2c36bd[_0xf50f('0x3c')][_0xf50f('0x5a')]()),_[_0xf50f('0x39')]({'ProjectId':parseInt(_0x2c36bd[_0xf50f('0x40')],0xa)},_0xc87035));break;default:this[_0xf50f('0x31')](util['format'](_0xf50f('0x55'),this['agents'][_0xc87035['interface']]['name']),util['format'](_0xf50f('0x59'),_0x2c36bd[_0xf50f('0x3c')][_0xf50f('0x5a')]()),_[_0xf50f('0x39')]({},_0x2c36bd,_0xc87035));}}switch(_0x2c36bd['action'][_0xf50f('0x5a')]()){case _0xf50f('0x3d'):cmContact[_0xf50f('0x5b')](this['agents'][_0xc87035[_0xf50f('0x35')]],this[_0xf50f('0xf')][_0x263cfa],_0x2c36bd,_0xc87035);break;case _0xf50f('0x5c'):integration[_0xf50f('0x5b')](_0x2c36bd,_0xc87035,this[_0xf50f('0x1a')],this['agents'][_0xc87035['interface']],this[_0xf50f('0x11')][_0xc87035[_0xf50f('0x5d')]],this[_0xf50f('0x5e')][_0xc87035['routeId']]);break;case _0xf50f('0x5f'):urlforward[_0xf50f('0x5b')](_0x2c36bd,_0xc87035);break;case _0xf50f('0x60'):script[_0xf50f('0x5b')](_0x2c36bd,_0xc87035);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x47915e,_0x24b2ff,_0x11dfb5){var _0x36ede1=url[_0xf50f('0x61')](Mustache[_0xf50f('0x42')](_0x47915e,_0x24b2ff),!![]);if(_0x11dfb5){_['merge'](_0x36ede1[_0xf50f('0x62')],_0x24b2ff);}delete _0x36ede1[_0xf50f('0x63')];var _0x1cfe75=url[_0xf50f('0x54')](_0x36ede1);_0x1cfe75=_0x1cfe75[_0xf50f('0x64')](/\/\?/g,'?');return _0x1cfe75;};Trigger['prototype'][_0xf50f('0x38')]=function(_0x42bec2,_0xfc26c2){var _0x30be01=!![],_0x550ff5=!![];if(_0x42bec2[_0xf50f('0x65')]['length']){_0x30be01=_[_0xf50f('0x66')](_0x42bec2['AllConditions'],this[_0xf50f('0x67')](_0xfc26c2,_0x42bec2[_0xf50f('0x68')]));}if(_0x42bec2[_0xf50f('0x69')]['length']){_0x550ff5=_['some'](_0x42bec2[_0xf50f('0x69')],this['checkConditions'](_0xfc26c2,_0x42bec2[_0xf50f('0x68')]));}return _0x30be01&&_0x550ff5;};Trigger[_0xf50f('0x30')][_0xf50f('0x67')]=function(_0x579020,_0x328880){return function(_0x34d471){switch(_0x34d471['field']){case _0xf50f('0x6a'):if(_0x579020[_0xf50f('0x68')]===_0x328880){if(_0x328880===_0xf50f('0x6b')){return _0x579020[_0xf50f('0x6c')]?operators[_0x34d471[_0xf50f('0x6d')]](Number(_0x34d471['value']),_0x579020[_0xf50f('0x6c')]):![];}else{return _0x579020[_[_0xf50f('0x6e')](_0x328880)+_0xf50f('0x6f')]?operators[_0x34d471[_0xf50f('0x6d')]](Number(_0x34d471['value']),_0x579020[_['upperFirst'](_0x328880)+'AccountId']):![];}}break;case _0xf50f('0x70'):case _0xf50f('0x71'):if(_0x579020[_0xf50f('0x68')]===_0x328880){return _0x579020[_0xf50f('0x72')]?operators[_0x34d471[_0xf50f('0x6d')]](_0x34d471[_0xf50f('0x73')],_0x579020[_0xf50f('0x72')]):![];}break;case _0xf50f('0x5d'):return _0x579020[_0xf50f('0x5d')]?operators[_0x34d471[_0xf50f('0x6d')]](_0x34d471[_0xf50f('0x73')],_0x579020['queue']):![];case _0xf50f('0x74'):return _0x579020['membername']?operators[_0x34d471[_0xf50f('0x6d')]](_0x34d471['value'],_0x579020['membername']):![];case _0xf50f('0x75'):return _0x579020[_0xf50f('0x75')]?operators[_0x34d471['operator']](_0x34d471['value'],_0x579020[_0xf50f('0x75')]):![];case _0xf50f('0x76'):return _0x579020[_0xf50f('0x76')]?operators[_0x34d471[_0xf50f('0x6d')]](_0x34d471[_0xf50f('0x73')],_0x579020[_0xf50f('0x76')]):![];}return![];};};module[_0xf50f('0x77')]=Trigger;
\ No newline at end of file
index 44a5721..9893c9f 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(_0x4ca5de,_0x3417e9){var _0x805bb=function(_0x1c6b74){while(--_0x1c6b74){_0x4ca5de['push'](_0x4ca5de['shift']());}};_0x805bb(++_0x3417e9);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x5fc3,0xa8));var _0x35fc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x5fc3[_0x279d37];return _0x530173;};'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 5543d95..300aae3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4738=[']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','localhost','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','internalemailaddress','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','userId','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','customField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','phonecall','phonecalls','queue','callDirection','ticketId','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4738,0x1e0));var _0x8473=function(_0x2a657c,_0x139c34){_0x2a657c=_0x2a657c-0x0;var _0x43b748=_0x4738[_0x2a657c];return _0x43b748;};'use strict';var _=require('lodash');var BPromise=require(_0x8473('0x0'));var rp=require(_0x8473('0x1'));var util=require(_0x8473('0x2'));var intUtil=require('./util');var md5=require(_0x8473('0x3'));var Redis=require(_0x8473('0x4'));var logger=require(_0x8473('0x5'))('dynamics365');var config=require(_0x8473('0x6'));config['redis']=_['defaults'](config[_0x8473('0x7')],{'host':_0x8473('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8473('0x7')]));function getAuthToken(_0x447811,_0xfbebe4,_0x38a4cd){var _0x233852={'method':_0x8473('0x9'),'uri':_0xfbebe4,'form':{'client_id':_0x447811[_0x8473('0xa')],'resource':_0x447811[_0x8473('0xb')],'username':_0x447811[_0x8473('0xc')],'password':_0x447811[_0x8473('0xd')],'grant_type':_0x8473('0xd'),'client_secret':_0x447811[_0x8473('0xe')]},'json':!![]};return rp(_0x233852)[_0x8473('0xf')](function(_0x380d8f){return _0x380d8f['access_token'];})[_0x8473('0x10')](function(_0x5b5f07){logger[_0x8473('0x11')]('['+[_0x38a4cd[_0x8473('0x12')]()]+']\x20Wrong\x20credentials!');return _0x5b5f07[_0x8473('0x13')];});}function getUser(_0x1ca425,_0x59821b,_0xd7dce7,_0x2bed5c,_0x13a28c,_0x3655c9){return new BPromise(function(_0x330666,_0x127ff8){return getAuthToken(_0x59821b,_0x2bed5c,_0x3655c9)[_0x8473('0xf')](function(_0x3c06bd){var _0x556fcb={'method':_0x8473('0x14'),'uri':_0x13a28c+_0x8473('0x15'),'headers':{'Authorization':_0x8473('0x16')+_0x3c06bd,'OData-Version':_0x8473('0x17')},'json':!![]};return rp(_0x556fcb);})['then'](function(_0x1b26a7){var _0xd921ab=_0x1b26a7[_0x8473('0x18')];var _0x5351c1=![];var _0x4e22c6=null;if(!_[_0x8473('0x19')](_0xd7dce7)){if(intUtil[_0x8473('0x1a')](_0xd7dce7[_0x8473('0x1b')])){_0x1ca425['userEmail']=_0xd7dce7[_0x8473('0x1b')];for(_0x4e22c6=0x0;_0x4e22c6<_0xd921ab[_0x8473('0x1c')];_0x4e22c6++){if(_0xd921ab[_0x4e22c6]['internalemailaddress']===_0xd7dce7[_0x8473('0x1b')]&&!_0xd921ab[_0x4e22c6]['isdisabled']){_0x5351c1=!![];logger[_0x8473('0x1d')]('['+[_0x3655c9[_0x8473('0x12')]()]+_0x8473('0x1e')+_0xd921ab[_0x4e22c6][_0x8473('0x1f')]+'!');_0x1ca425['userId']=_0xd921ab[_0x4e22c6][_0x8473('0x1f')];}}}}if(!_0x5351c1){logger[_0x8473('0x1d')]('['+[_0x3655c9['toUpperCase']()]+_0x8473('0x20'));_0x1ca425[_0x8473('0x21')]=_0x59821b[_0x8473('0xc')];for(_0x4e22c6=0x0;_0x4e22c6<_0xd921ab['length'];_0x4e22c6++){if(_0xd921ab[_0x4e22c6][_0x8473('0x22')]===_0x59821b[_0x8473('0xc')]){_0x1ca425['userId']=_0xd921ab[_0x4e22c6]['systemuserid'];}}}_0x330666(_0x1ca425);})[_0x8473('0x10')](function(_0x2732e1){_0x127ff8(_0x2732e1[_0x8473('0x13')]);});});}function createEndUser(_0x3a9437,_0x3be8a5,_0x1918ef,_0xced07,_0x22f6d5,_0x4b9471){return new BPromise(function(_0x1f103f,_0x2433e5){return getAuthToken(_0x3be8a5,_0x1918ef,_0x4b9471)[_0x8473('0xf')](function(_0x4eeafa){var _0x2508f2=_0x4b9471[_0x8473('0x23')]()===_0x8473('0x24')?_0x22f6d5[_0x8473('0x25')]:_0x22f6d5[_0x8473('0x26')];var _0x55c03f={'method':_0x8473('0x9'),'uri':_0xced07+_0x8473('0x27'),'body':{'telephone1':_0x2508f2,'fullname':_0x2508f2,'firstname':_0x2508f2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x8473('0x28')+_0x3a9437[_0x8473('0x29')]+')'},'headers':{'Authorization':_0x8473('0x16')+_0x4eeafa,'OData-Version':_0x8473('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x55c03f);})[_0x8473('0xf')](function(_0x266e94){var _0x319412=_0x266e94[_0x8473('0x2a')][_0x8473('0x2b')];var _0x2ed00c=_0x319412[_0x8473('0x2c')](_0x319412[_0x8473('0x2d')]('(')+0x1,_0x319412[_0x8473('0x2d')](')'));_0x3a9437[_0x8473('0x2e')]=_0x2ed00c;_0x1f103f(_0x3a9437);})['catch'](function(_0x5cd2b5){_0x2433e5(_0x5cd2b5['message']);});});}function getEndUser(_0x48640b,_0x51af63,_0x2afb73,_0x21db55,_0x13bd71,_0x325733){return new BPromise(function(_0xc7db38,_0x307ed5){var _0x6ee93=_0x325733['toLowerCase']()==='outbound'?_0x13bd71['destcalleridnum']:_0x13bd71['calleridnum'];return getAuthToken(_0x51af63,_0x2afb73,_0x325733)[_0x8473('0xf')](function(_0x4c8e48){var _0x429703={'method':_0x8473('0x14'),'uri':_0x21db55+_0x8473('0x2f')+_0x6ee93['replace']('+',_0x8473('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x4c8e48,'If-None-Match':null,'OData-Version':_0x8473('0x17')},'json':!![]};return rp(_0x429703);})[_0x8473('0xf')](function(_0x4260dd){var _0x5542ac=null;if(_0x4260dd){var _0x31ae27=_0x4260dd['value'];var _0x7fe0c3=![];for(_0x5542ac=0x0;_0x5542ac<_0x31ae27[_0x8473('0x1c')];_0x5542ac++){if(_0x31ae27[_0x5542ac]['telephone1']===_0x6ee93){_0x7fe0c3=!![];_0x48640b['enduserId']=_0x31ae27[_0x5542ac][_0x8473('0x31')];}}if(_0x7fe0c3){_0xc7db38(_0x48640b);}else{return createEndUser(_0x48640b,_0x51af63,_0x2afb73,_0x21db55,_0x13bd71,_0x325733)[_0x8473('0xf')](function(_0x307065){logger[_0x8473('0x1d')]('['+[_0x325733[_0x8473('0x12')]()]+_0x8473('0x32'),_0x307065[_0x8473('0x2e')]);_0xc7db38(_0x307065);});}}else{return createEndUser(_0x48640b,_0x51af63,_0x2afb73,_0x21db55,_0x13bd71,_0x325733)[_0x8473('0xf')](function(_0x4c020e){logger[_0x8473('0x1d')]('['+[_0x325733[_0x8473('0x12')]()]+_0x8473('0x33'),_0x4c020e[_0x8473('0x2e')]);_0xc7db38(_0x4c020e);});}});});}function getCustomFields(_0x4ce2e3,_0x28c50d,_0x3bdbb0){var _0x335f27={};if(_0x4ce2e3[_0x8473('0x1c')]>0x0){_[_0x8473('0x34')](_0x4ce2e3,function(_0x252f78){if(_[_0x8473('0x35')]([_0x8473('0x36'),_0x8473('0x37')],_0x252f78[_0x8473('0x38')])&&_0x252f78[_0x8473('0x39')]&&!_0x252f78[_0x8473('0x3a')]){var _0x2be4ef=_0x252f78['idField'][_0x8473('0x23')]();var _0xb8e340=_0x2be4ef[_0x8473('0x2c')](0x0,_0x2be4ef[_0x8473('0x3b')]('_'));var _0x42ee06=_0x2be4ef[_0x8473('0x2c')](_0x2be4ef[_0x8473('0x3b')]('_')+0x1);if(_0xb8e340===_0x3bdbb0){_0x335f27[_0x42ee06]=_0x252f78[_0x8473('0x3c')];}}});}return _0x335f27;}function getTicket(_0x5ea77e,_0x3336f2,_0x298c02,_0x1964a9,_0x16da9e,_0x316e4f,_0x173a77){return new BPromise(function(_0x2e42e1,_0x359b4e){var _0x259cb6;return getAuthToken(_0x3336f2,_0x298c02,_0x173a77)[_0x8473('0xf')](function(_0x40e404){if(_0x316e4f[_0x8473('0x3d')]===_0x8473('0x3e')){_0x259cb6={'method':'POST','uri':_0x1964a9+_0x8473('0x3f'),'body':Object[_0x8473('0x40')]({},{'title':intUtil[_0x8473('0x41')](_0x316e4f[_0x8473('0x42')],_0x16da9e,'\x20'),'description':intUtil[_0x8473('0x41')](_0x316e4f[_0x8473('0x43')],_0x16da9e,'\x0a'),'customerid_contact@odata.bind':_0x8473('0x44')+_0x5ea77e['enduserId']+')','ownerid@odata.bind':_0x8473('0x28')+_0x5ea77e[_0x8473('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x316e4f['Fields'],_0x16da9e,_0x316e4f[_0x8473('0x3d')])),'headers':{'Authorization':_0x8473('0x16')+_0x40e404,'OData-Version':_0x8473('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x316e4f[_0x8473('0x3d')]===_0x8473('0x45')){_0x259cb6={'method':'POST','uri':_0x1964a9+_0x8473('0x46'),'body':Object[_0x8473('0x40')]({},{'subject':intUtil[_0x8473('0x41')](_0x316e4f[_0x8473('0x42')],_0x16da9e,'\x20'),'phonenumber':String(_0x16da9e[_0x8473('0x26')]),'description':intUtil[_0x8473('0x41')](_0x316e4f[_0x8473('0x43')],_0x16da9e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x8473('0x44')+_0x5ea77e['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x5ea77e[_0x8473('0x29')]+')','directioncode':_0x5ea77e['callDirection']===_0x8473('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x8473('0x28')+_0x5ea77e[_0x8473('0x29')]+')','participationtypemask':_0x5ea77e[_0x8473('0x48')]===_0x8473('0x47')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5ea77e[_0x8473('0x2e')]+')','participationtypemask':_0x5ea77e[_0x8473('0x48')]===_0x8473('0x47')?0x1:0x2}]},getCustomFields(_0x316e4f['Fields'],_0x16da9e,_0x316e4f[_0x8473('0x3d')])),'headers':{'Authorization':_0x8473('0x16')+_0x40e404,'OData-Version':_0x8473('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x259cb6);})[_0x8473('0xf')](function(_0x1817b3){var _0x5bf5ad=_0x1817b3[_0x8473('0x2a')][_0x8473('0x2b')];var _0x4ef460=_0x5bf5ad[_0x8473('0x2c')](_0x5bf5ad[_0x8473('0x2d')]('(')+0x1,_0x5bf5ad[_0x8473('0x2d')](')'));_0x5ea77e[_0x8473('0x49')]=_0x4ef460;_0x2e42e1(_0x5ea77e);})[_0x8473('0x10')](function(_0x440424){_0x359b4e(_0x440424[_0x8473('0x13')]);});});}function emit(_0x3a372b,_0x10f150,_0x36f7ad,_0x4ec4d6){var _0x3d1439={'uri':util[_0x8473('0x4a')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x3a372b,_0x36f7ad,_0x4ec4d6)};io['to'](util['format']('user:%s',_0x10f150))[_0x8473('0x4b')](_0x8473('0x4c'),_0x3d1439);}exports['cs']=function(_0xa9ada8,_0x1fcd8a,_0x403531,_0x48a114,_0x138338,_0x2677be,_0x58477f,_0x29e682){var _0x1c6065={};_0x2677be[_0x8473('0xb')]=intUtil[_0x8473('0x4d')](_0x2677be[_0x8473('0xb')]);_0x2677be[_0x8473('0x4e')]=intUtil[_0x8473('0x4d')](_0x2677be['serverUrl']);_0x1c6065[_0x8473('0x48')]=_0x29e682===_0x8473('0x47')||_0x29e682===_0x8473('0x4f')?'queue':_0x8473('0x24');var _0x3d639b=util[_0x8473('0x4a')]('%s/api/data/v9.0/',_0x2677be['remoteUri']);var _0x4b49a5=util[_0x8473('0x4a')](_0x8473('0x50'),_0x2677be[_0x8473('0x51')]);var _0x42e89d=util[_0x8473('0x4a')](_0x8473('0x52'),_0x2677be[_0x8473('0x4e')],_0x1fcd8a[_0x8473('0x53')],md5(_0x1fcd8a[_0x8473('0x53')]));if(_0x138338&&_0x138338['monitor_format']){logger['info'](_0x8473('0x54'),_0x8473('0x55'));_0x1fcd8a['recordingURL']=_0x42e89d;}else if(_0x58477f&&_0x58477f[_0x8473('0x56')]&&_0x58477f[_0x8473('0x56')]!==_0x8473('0x57')){logger[_0x8473('0x1d')](_0x8473('0x58'),_0x8473('0x55'));_0x1fcd8a['recordingURL']=_0x42e89d;}else{_0x1fcd8a[_0x8473('0x59')]='';}return getUser(_0x1c6065,_0x2677be,_0x48a114,_0x4b49a5,_0x3d639b,_0x29e682)['then'](function(_0x1c41eb){logger[_0x8473('0x1d')]('['+_0x29e682[_0x8473('0x12')]()+_0x8473('0x5a'),_0x1c41eb['userId']);logger[_0x8473('0x1d')]('['+_0x29e682[_0x8473('0x12')]()+']\x20The\x20User\x20email\x20is:',_0x1c41eb['userEmail']);return getEndUser(_0x1c41eb,_0x2677be,_0x4b49a5,_0x3d639b,_0x1fcd8a,_0x29e682);})[_0x8473('0xf')](function(_0x32fe68){logger[_0x8473('0x1d')]('['+_0x29e682[_0x8473('0x12')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x32fe68[_0x8473('0x2e')]);logger[_0x8473('0x1d')]('['+_0x29e682[_0x8473('0x12')]()+_0x8473('0x5b'),_0x1fcd8a[_0x8473('0x26')]);return getTicket(_0x32fe68,_0x2677be,_0x4b49a5,_0x3d639b,_0x1fcd8a,_0x403531,_0x29e682);})['then'](function(_0x416718){logger[_0x8473('0x1d')](util[_0x8473('0x4a')]('['+_0x29e682[_0x8473('0x12')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x403531[_0x8473('0x3d')],_0x416718[_0x8473('0x49')]));logger['info'](util[_0x8473('0x4a')]('['+_0x29e682[_0x8473('0x12')]()+']\x20Call\x20direction:\x20%s',_0x29e682));if(_0x29e682!==_0x8473('0x4f')){logger[_0x8473('0x1d')]('['+_0x29e682['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2677be[_0x8473('0xb')],_0x48a114[_0x8473('0x5c')],_0x403531[_0x8473('0x3d')],_0x416718[_0x8473('0x49')]);}})[_0x8473('0x10')](function(_0x4c8bdc){logger[_0x8473('0x11')]('['+_0x29e682[_0x8473('0x12')]()+_0x8473('0x5d'),util[_0x8473('0x5e')](_0x4c8bdc,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x50df=['length','email','isdisabled',']\x20Agent\x20found\x20','systemuserid','info','internalemailaddress','username','userId','message','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1',']\x20Enduser\x20created!','forEach','includes','type','nameField','customField','idField','indexOf','content','ticketType','assign','getString','Subjects','Fields','phonecalls','Descriptions','/contacts(','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId','unmanaged','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','clientId','remoteUri','password','clientSecret','then','access_token','catch','toUpperCase','GET','Bearer\x20','4.0','value','isNil','validateEmail','userEmail'];(function(_0x20a068,_0x324d59){var _0x58a410=function(_0xd9c89c){while(--_0xd9c89c){_0x20a068['push'](_0x20a068['shift']());}};_0x58a410(++_0x324d59);}(_0x50df,0x168));var _0xf50d=function(_0x219c4e,_0x299170){_0x219c4e=_0x219c4e-0x0;var _0x10e65d=_0x50df[_0x219c4e];return _0x10e65d;};'use strict';var _=require(_0xf50d('0x0'));var BPromise=require('bluebird');var rp=require(_0xf50d('0x1'));var util=require(_0xf50d('0x2'));var intUtil=require(_0xf50d('0x3'));var md5=require(_0xf50d('0x4'));var Redis=require(_0xf50d('0x5'));var logger=require(_0xf50d('0x6'))(_0xf50d('0x7'));var config=require(_0xf50d('0x8'));config['redis']=_[_0xf50d('0x9')](config[_0xf50d('0xa')],{'host':_0xf50d('0xb'),'port':0x18eb});var io=require(_0xf50d('0xc'))(new Redis(config[_0xf50d('0xa')]));function getAuthToken(_0x3905e7,_0x52d39a,_0x4294fb){var _0x27fced={'method':'POST','uri':_0x52d39a,'form':{'client_id':_0x3905e7[_0xf50d('0xd')],'resource':_0x3905e7[_0xf50d('0xe')],'username':_0x3905e7['username'],'password':_0x3905e7[_0xf50d('0xf')],'grant_type':_0xf50d('0xf'),'client_secret':_0x3905e7[_0xf50d('0x10')]},'json':!![]};return rp(_0x27fced)[_0xf50d('0x11')](function(_0x1f562a){return _0x1f562a[_0xf50d('0x12')];})[_0xf50d('0x13')](function(_0x18619c){logger['error']('['+[_0x4294fb[_0xf50d('0x14')]()]+']\x20Wrong\x20credentials!');return _0x18619c['message'];});}function getUser(_0x270dd8,_0x4674b6,_0x5196db,_0x23ae3f,_0x72de7c,_0xaa2d2b){return new BPromise(function(_0x16f68e,_0x9a6453){return getAuthToken(_0x4674b6,_0x23ae3f,_0xaa2d2b)[_0xf50d('0x11')](function(_0x3abb2b){var _0x20c6c4={'method':_0xf50d('0x15'),'uri':_0x72de7c+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xf50d('0x16')+_0x3abb2b,'OData-Version':_0xf50d('0x17')},'json':!![]};return rp(_0x20c6c4);})[_0xf50d('0x11')](function(_0x244ff7){var _0x5aac7e=_0x244ff7[_0xf50d('0x18')];var _0x403f44=![];var _0x517e43=null;if(!_[_0xf50d('0x19')](_0x5196db)){if(intUtil[_0xf50d('0x1a')](_0x5196db['email'])){_0x270dd8[_0xf50d('0x1b')]=_0x5196db['email'];for(_0x517e43=0x0;_0x517e43<_0x5aac7e[_0xf50d('0x1c')];_0x517e43++){if(_0x5aac7e[_0x517e43]['internalemailaddress']===_0x5196db[_0xf50d('0x1d')]&&!_0x5aac7e[_0x517e43][_0xf50d('0x1e')]){_0x403f44=!![];logger['info']('['+[_0xaa2d2b[_0xf50d('0x14')]()]+_0xf50d('0x1f')+_0x5aac7e[_0x517e43][_0xf50d('0x20')]+'!');_0x270dd8['userId']=_0x5aac7e[_0x517e43][_0xf50d('0x20')];}}}}if(!_0x403f44){logger[_0xf50d('0x21')]('['+[_0xaa2d2b[_0xf50d('0x14')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x270dd8[_0xf50d('0x1b')]=_0x4674b6['username'];for(_0x517e43=0x0;_0x517e43<_0x5aac7e[_0xf50d('0x1c')];_0x517e43++){if(_0x5aac7e[_0x517e43][_0xf50d('0x22')]===_0x4674b6[_0xf50d('0x23')]){_0x270dd8[_0xf50d('0x24')]=_0x5aac7e[_0x517e43][_0xf50d('0x20')];}}}_0x16f68e(_0x270dd8);})[_0xf50d('0x13')](function(_0x251d70){_0x9a6453(_0x251d70[_0xf50d('0x25')]);});});}function createEndUser(_0x232904,_0x4e7009,_0x185563,_0x5f1ea1,_0x9e931a,_0x412a4d){return new BPromise(function(_0x7e7724,_0x255f13){return getAuthToken(_0x4e7009,_0x185563,_0x412a4d)['then'](function(_0xd1356f){var _0x2553dd=_0x412a4d['toLowerCase']()===_0xf50d('0x26')?_0x9e931a[_0xf50d('0x27')]:_0x9e931a[_0xf50d('0x28')];var _0x4849f0={'method':_0xf50d('0x29'),'uri':_0x5f1ea1+_0xf50d('0x2a'),'body':{'telephone1':_0x2553dd,'fullname':_0x2553dd,'firstname':_0x2553dd,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xf50d('0x2b')+_0x232904[_0xf50d('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0xd1356f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4849f0);})[_0xf50d('0x11')](function(_0x2eec66){var _0x8173c7=_0x2eec66[_0xf50d('0x2c')]['odata-entityid'];var _0x55031d=_0x8173c7[_0xf50d('0x2d')](_0x8173c7[_0xf50d('0x2e')]('(')+0x1,_0x8173c7['lastIndexOf'](')'));_0x232904[_0xf50d('0x2f')]=_0x55031d;_0x7e7724(_0x232904);})[_0xf50d('0x13')](function(_0x3cb34e){_0x255f13(_0x3cb34e['message']);});});}function getEndUser(_0x32f01e,_0x45fe66,_0x358a36,_0x5dc201,_0x4d3e40,_0x57b483){return new BPromise(function(_0x2993c1,_0x434e67){var _0x2bfea6=_0x57b483[_0xf50d('0x30')]()===_0xf50d('0x26')?_0x4d3e40[_0xf50d('0x27')]:_0x4d3e40['calleridnum'];return getAuthToken(_0x45fe66,_0x358a36,_0x57b483)[_0xf50d('0x11')](function(_0x116d3a){var _0x20c919={'method':'GET','uri':_0x5dc201+_0xf50d('0x31')+_0x2bfea6[_0xf50d('0x32')]('+',_0xf50d('0x33'))+'\x27','headers':{'Authorization':_0xf50d('0x16')+_0x116d3a,'If-None-Match':null,'OData-Version':_0xf50d('0x17')},'json':!![]};return rp(_0x20c919);})['then'](function(_0x40f2d5){var _0x377d21=null;if(_0x40f2d5){var _0x53161c=_0x40f2d5[_0xf50d('0x18')];var _0x140afa=![];for(_0x377d21=0x0;_0x377d21<_0x53161c[_0xf50d('0x1c')];_0x377d21++){if(_0x53161c[_0x377d21][_0xf50d('0x34')]===_0x2bfea6){_0x140afa=!![];_0x32f01e[_0xf50d('0x2f')]=_0x53161c[_0x377d21]['contactid'];}}if(_0x140afa){_0x2993c1(_0x32f01e);}else{return createEndUser(_0x32f01e,_0x45fe66,_0x358a36,_0x5dc201,_0x4d3e40,_0x57b483)[_0xf50d('0x11')](function(_0x2e2dce){logger['info']('['+[_0x57b483[_0xf50d('0x14')]()]+_0xf50d('0x35'),_0x2e2dce[_0xf50d('0x2f')]);_0x2993c1(_0x2e2dce);});}}else{return createEndUser(_0x32f01e,_0x45fe66,_0x358a36,_0x5dc201,_0x4d3e40,_0x57b483)[_0xf50d('0x11')](function(_0x51d585){logger[_0xf50d('0x21')]('['+[_0x57b483['toUpperCase']()]+']\x20Enduser\x20Created!',_0x51d585[_0xf50d('0x2f')]);_0x2993c1(_0x51d585);});}});});}function getCustomFields(_0x49fc86,_0x44c569,_0x2f23c9){var _0x50958a={};if(_0x49fc86['length']>0x0){_[_0xf50d('0x36')](_0x49fc86,function(_0x500b5a){if(_[_0xf50d('0x37')](['string','picklist'],_0x500b5a[_0xf50d('0x38')])&&_0x500b5a[_0xf50d('0x39')]&&!_0x500b5a[_0xf50d('0x3a')]){var _0x291adb=_0x500b5a[_0xf50d('0x3b')][_0xf50d('0x30')]();var _0x50444e=_0x291adb['substring'](0x0,_0x291adb[_0xf50d('0x3c')]('_'));var _0x557133=_0x291adb['substring'](_0x291adb['indexOf']('_')+0x1);if(_0x50444e===_0x2f23c9){_0x50958a[_0x557133]=_0x500b5a[_0xf50d('0x3d')];}}});}return _0x50958a;}function getTicket(_0x34bc4f,_0x20df1a,_0x312d77,_0x371a9b,_0xbca06b,_0x116749,_0x619efa){return new BPromise(function(_0x43f3a2,_0xbc5a5c){var _0x4b036a;return getAuthToken(_0x20df1a,_0x312d77,_0x619efa)['then'](function(_0x41072a){if(_0x116749[_0xf50d('0x3e')]==='incident'){_0x4b036a={'method':_0xf50d('0x29'),'uri':_0x371a9b+'incidents','body':Object[_0xf50d('0x3f')]({},{'title':intUtil[_0xf50d('0x40')](_0x116749[_0xf50d('0x41')],_0xbca06b,'\x20'),'description':intUtil['getString'](_0x116749['Descriptions'],_0xbca06b,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x34bc4f[_0xf50d('0x2f')]+')','ownerid@odata.bind':_0xf50d('0x2b')+_0x34bc4f[_0xf50d('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x116749[_0xf50d('0x42')],_0xbca06b,_0x116749[_0xf50d('0x3e')])),'headers':{'Authorization':'Bearer\x20'+_0x41072a,'OData-Version':_0xf50d('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x116749['ticketType']==='phonecall'){_0x4b036a={'method':_0xf50d('0x29'),'uri':_0x371a9b+_0xf50d('0x43'),'body':Object[_0xf50d('0x3f')]({},{'subject':intUtil[_0xf50d('0x40')](_0x116749[_0xf50d('0x41')],_0xbca06b,'\x20'),'phonenumber':String(_0xbca06b[_0xf50d('0x28')]),'description':intUtil[_0xf50d('0x40')](_0x116749[_0xf50d('0x44')],_0xbca06b,'\x0a'),'regardingobjectid_contact@odata.bind':_0xf50d('0x45')+_0x34bc4f[_0xf50d('0x2f')]+')','ownerid@odata.bind':_0xf50d('0x2b')+_0x34bc4f['userId']+')','directioncode':_0x34bc4f[_0xf50d('0x46')]===_0xf50d('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xf50d('0x2b')+_0x34bc4f['userId']+')','participationtypemask':_0x34bc4f[_0xf50d('0x46')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0xf50d('0x45')+_0x34bc4f[_0xf50d('0x2f')]+')','participationtypemask':_0x34bc4f[_0xf50d('0x46')]===_0xf50d('0x47')?0x1:0x2}]},getCustomFields(_0x116749[_0xf50d('0x42')],_0xbca06b,_0x116749[_0xf50d('0x3e')])),'headers':{'Authorization':_0xf50d('0x16')+_0x41072a,'OData-Version':_0xf50d('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4b036a);})[_0xf50d('0x11')](function(_0x113d5c){var _0x594da4=_0x113d5c[_0xf50d('0x2c')]['odata-entityid'];var _0x58a9f2=_0x594da4['substring'](_0x594da4[_0xf50d('0x2e')]('(')+0x1,_0x594da4[_0xf50d('0x2e')](')'));_0x34bc4f['ticketId']=_0x58a9f2;_0x43f3a2(_0x34bc4f);})[_0xf50d('0x13')](function(_0x4746c0){_0xbc5a5c(_0x4746c0[_0xf50d('0x25')]);});});}function emit(_0x757cf4,_0xc8bf20,_0x2cd3de,_0x5aa55e){var _0xe1e2bc={'uri':util[_0xf50d('0x48')](_0xf50d('0x49'),_0x757cf4,_0x2cd3de,_0x5aa55e)};io['to'](util[_0xf50d('0x48')](_0xf50d('0x4a'),_0xc8bf20))[_0xf50d('0x4b')]('trigger:browser:url',_0xe1e2bc);}exports['cs']=function(_0x470f48,_0x5b6225,_0x4025c4,_0xab0a02,_0xcec938,_0x5d2293,_0x51f62b,_0x4b52a3){var _0x3fde20={};_0x5d2293[_0xf50d('0xe')]=intUtil[_0xf50d('0x4c')](_0x5d2293[_0xf50d('0xe')]);_0x5d2293[_0xf50d('0x4d')]=intUtil[_0xf50d('0x4c')](_0x5d2293[_0xf50d('0x4d')]);_0x3fde20[_0xf50d('0x46')]=_0x4b52a3===_0xf50d('0x47')||_0x4b52a3==='unmanaged'?'queue':'outbound';var _0x472fc7=util[_0xf50d('0x48')](_0xf50d('0x4e'),_0x5d2293[_0xf50d('0xe')]);var _0x4e1d68=util[_0xf50d('0x48')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5d2293[_0xf50d('0x4f')]);var _0x142572=util['format'](_0xf50d('0x50'),_0x5d2293['serverUrl'],_0x5b6225[_0xf50d('0x51')],md5(_0x5b6225[_0xf50d('0x51')]));if(_0xcec938&&_0xcec938[_0xf50d('0x52')]){logger[_0xf50d('0x21')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5b6225[_0xf50d('0x53')]=_0x142572;}else if(_0x51f62b&&_0x51f62b['recordingFormat']&&_0x51f62b[_0xf50d('0x54')]!==_0xf50d('0x55')){logger[_0xf50d('0x21')](_0xf50d('0x56'),_0xf50d('0x57'));_0x5b6225[_0xf50d('0x53')]=_0x142572;}else{_0x5b6225[_0xf50d('0x53')]='';}return getUser(_0x3fde20,_0x5d2293,_0xab0a02,_0x4e1d68,_0x472fc7,_0x4b52a3)['then'](function(_0x47ebf7){logger['info']('['+_0x4b52a3[_0xf50d('0x14')]()+_0xf50d('0x58'),_0x47ebf7[_0xf50d('0x24')]);logger[_0xf50d('0x21')]('['+_0x4b52a3['toUpperCase']()+_0xf50d('0x59'),_0x47ebf7[_0xf50d('0x1b')]);return getEndUser(_0x47ebf7,_0x5d2293,_0x4e1d68,_0x472fc7,_0x5b6225,_0x4b52a3);})['then'](function(_0x2eb0f4){logger[_0xf50d('0x21')]('['+_0x4b52a3[_0xf50d('0x14')]()+_0xf50d('0x5a'),_0x2eb0f4['enduserId']);logger[_0xf50d('0x21')]('['+_0x4b52a3[_0xf50d('0x14')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x5b6225[_0xf50d('0x28')]);return getTicket(_0x2eb0f4,_0x5d2293,_0x4e1d68,_0x472fc7,_0x5b6225,_0x4025c4,_0x4b52a3);})[_0xf50d('0x11')](function(_0x1616d8){logger[_0xf50d('0x21')](util['format']('['+_0x4b52a3[_0xf50d('0x14')]()+_0xf50d('0x5b'),_0x4025c4[_0xf50d('0x3e')],_0x1616d8[_0xf50d('0x5c')]));logger[_0xf50d('0x21')](util[_0xf50d('0x48')]('['+_0x4b52a3[_0xf50d('0x14')]()+']\x20Call\x20direction:\x20%s',_0x4b52a3));if(_0x4b52a3!==_0xf50d('0x5d')){logger['info']('['+_0x4b52a3['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5d2293[_0xf50d('0xe')],_0xab0a02[_0xf50d('0x5e')],_0x4025c4[_0xf50d('0x3e')],_0x1616d8['ticketId']);}})[_0xf50d('0x13')](function(_0xac9325){logger[_0xf50d('0x5f')]('['+_0x4b52a3[_0xf50d('0x14')]()+_0xf50d('0x60'),util['inspect'](_0xac9325,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index f8f71d2..cb4e521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd48f=['Recording\x20is\x20enabled!','destcalleridnum','[OUTBOUND]','user:%s','unmanaged','monitor_format','toUpperCase','md5','util','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','email','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','map','forEach','includes','string','type','customField','nameField','toLowerCase','content','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0xd48f,0x10c));var _0xfd48=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xd48f[_0x2261ce];return _0x524640;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xfd48('0x0'));var util=require(_0xfd48('0x1'));var Redis=require('ioredis');var intUtil=require(_0xfd48('0x2'));var config=require(_0xfd48('0x3'));var logger=require('../../../../config/logger')('freshdesk');config[_0xfd48('0x4')]=_[_0xfd48('0x5')](config['redis'],{'host':_0xfd48('0x6'),'port':0x18eb});var io=require(_0xfd48('0x7'))(new Redis(config[_0xfd48('0x4')]));var headers={'Content-Type':_0xfd48('0x8'),'Accept':_0xfd48('0x8')};function emit(_0x4c0bad,_0x45d102,_0x316c50){io['to'](_0x4c0bad)[_0xfd48('0x9')](_0x45d102,_0x316c50);}function getTicket(_0x40394c,_0x20a401,_0x321c08,_0x26cf13,_0x121dde){logger[_0xfd48('0xa')](_0xfd48('0xb'));var _0x4ff503=_[_0xfd48('0xc')]({'responder_id':_0x20a401['id'],'requester_id':_0x321c08['id'],'name':util[_0xfd48('0xd')](_0xfd48('0xe'),_0x121dde[_0xfd48('0xf')]),'phone':_0x121dde[_0xfd48('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xfd48('0x11')](_0x26cf13['Subjects'],_0x121dde,'\x20'),'description':intUtil['getString'](_0x26cf13[_0xfd48('0x12')],_0x121dde,'<br>'),'tags':getTags(_0x26cf13['Tags'],_0xfd48('0x13'))},getCustomFields(_0x26cf13[_0xfd48('0x14')],_0x121dde));_0x4ff503[_0xfd48('0x15')]=_['mapValues'](_[_0xfd48('0x16')](_0x4ff503[_0xfd48('0x15')],'id'),_0xfd48('0x17'));return request({'uri':util[_0xfd48('0xd')](_0xfd48('0x18'),_0x40394c[_0xfd48('0x19')]),'method':_0xfd48('0x1a'),'body':_0x4ff503})[_0xfd48('0x1b')](function(_0x4ae1bb){logger[_0xfd48('0xa')](_0xfd48('0x1c'));return _0x4ae1bb;});}function getUser(_0x2c8b83,_0x374bdb){if(intUtil[_0xfd48('0x1d')](_0x374bdb)){return request({'uri':util[_0xfd48('0xd')](_0xfd48('0x1e'),_0x2c8b83[_0xfd48('0x19')]),'qs':{'email':_0x374bdb}})['then'](function(_0x4e2cef){if(_0x4e2cef[_0xfd48('0x1f')]){logger[_0xfd48('0xa')]('Agent\x20found!');return _[_0xfd48('0x20')](_0x4e2cef,function(_0x1fc85e){return _0x1fc85e[_0xfd48('0x21')][_0xfd48('0x22')]===_0x374bdb;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xfd48('0xd')](_0xfd48('0x23'),_0x2c8b83[_0xfd48('0x19')])})['then'](function(_0x33cf7d){logger[_0xfd48('0xa')]('Admin\x20account\x20selected.');return _0x33cf7d;});}});}else{logger[_0xfd48('0xa')](_0xfd48('0x24'));return request({'uri':util['format'](_0xfd48('0x23'),_0x2c8b83[_0xfd48('0x19')])})[_0xfd48('0x1b')](function(_0x1bbe33){logger[_0xfd48('0xa')]('Admin\x20account\x20selected.');return _0x1bbe33;});}}function getEndUser(_0xa92f0e,_0x4c9ad4,_0x6ef507){logger[_0xfd48('0xa')](_0xfd48('0x25'),_0x6ef507);return request({'uri':util[_0xfd48('0xd')](_0xfd48('0x26'),_0xa92f0e[_0xfd48('0x19')]),'qs':{'phone':_0x6ef507}})[_0xfd48('0x1b')](function(_0x5080af){if(_0x5080af['length']){logger[_0xfd48('0xa')]('Enduser\x20found!');return _[_0xfd48('0x20')](_0x5080af,{'phone':_0x6ef507});}else{logger[_0xfd48('0xa')](_0xfd48('0x27'));return request({'uri':util[_0xfd48('0xd')](_0xfd48('0x26'),_0xa92f0e[_0xfd48('0x19')]),'method':_0xfd48('0x1a'),'body':{'name':_0x4c9ad4,'phone':_0x6ef507}})[_0xfd48('0x1b')](function(_0x19ae12){logger['info'](_0xfd48('0x28'));return _0x19ae12;});}});}function getAuth(_0x24af02){return util[_0xfd48('0xd')](_0xfd48('0x29'),new Buffer(_0x24af02[_0xfd48('0x2a')]+':X')[_0xfd48('0x2b')](_0xfd48('0x2c')));}function request(_0x2fdaae){logger['debug'](_0xfd48('0x2d'),JSON[_0xfd48('0x2e')](_0x2fdaae));return rp(_[_0xfd48('0x5')](_0x2fdaae,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5059c8,_0x229fe6){var _0x3207fd=[];if(_0x5059c8&&_0x5059c8[_0xfd48('0x1f')]>0x0){_0x3207fd=_[_0xfd48('0x2f')](_0x5059c8,_0x229fe6);}return _0x3207fd;}function getCustomFields(_0xe70c96,_0x3c4829){var _0xf149a4=[];var _0x10865f={'custom_fields':[]};if(_0xe70c96['length']>0x0){_[_0xfd48('0x30')](_0xe70c96,function(_0xd0cf63){if(_[_0xfd48('0x31')]([_0xfd48('0x32'),'picklist'],_0xd0cf63[_0xfd48('0x33')])&&_0xd0cf63['nameField']&&!_0xd0cf63[_0xfd48('0x34')]){_0x10865f[_0xd0cf63[_0xfd48('0x35')][_0xfd48('0x36')]()]=_0xd0cf63[_0xfd48('0x37')][_0xfd48('0x2b')]();}else if(_[_0xfd48('0x31')]([_0xfd48('0x32'),'picklist'],_0xd0cf63['type'])&&_0xd0cf63['idField']&&_0xd0cf63[_0xfd48('0x34')]){_0x10865f[_0xfd48('0x15')][_0xfd48('0x38')]({'id':_0xd0cf63[_0xfd48('0x39')],'value':_0xd0cf63[_0xfd48('0x37')][_0xfd48('0x2b')]()});}else if(_0xd0cf63[_0xfd48('0x33')]===_0xfd48('0x3a')&&_0xd0cf63['variableName']&&_0xd0cf63[_0xfd48('0x39')]&&_0xd0cf63['customField']){_0x3c4829[_0xd0cf63[_0xfd48('0x3b')]]&&_0x10865f[_0xfd48('0x15')][_0xfd48('0x38')]({'id':_0xd0cf63['idField'],'value':_0x3c4829[_0xd0cf63[_0xfd48('0x3b')]][_0xfd48('0x2b')]()});}else if(_0xd0cf63[_0xfd48('0x33')]===_0xfd48('0x3c')&&_0xd0cf63[_0xfd48('0x3d')]&&_0xd0cf63[_0xfd48('0x3d')][_0xfd48('0x13')]&&_0xd0cf63['idField']&&_0xd0cf63[_0xfd48('0x34')]){_0x3c4829[_0xd0cf63[_0xfd48('0x3d')]['name']['toLowerCase']()]&&_0x10865f[_0xfd48('0x15')][_0xfd48('0x38')]({'id':_0xd0cf63[_0xfd48('0x39')],'value':_0x3c4829[_0xd0cf63[_0xfd48('0x3d')][_0xfd48('0x13')][_0xfd48('0x36')]()]['toString']()});}});}return _0x10865f;}exports[_0xfd48('0x3e')]=function(_0x4d3fb3,_0x3548dc,_0x1d426b,_0x3031f4,_0x2bc2a6,_0x104885){var _0x4989d3,_0x5621f9;_0x104885[_0xfd48('0x19')]=intUtil['stripTrailingSlash'](_0x104885[_0xfd48('0x19')]);_0x104885['serverUrl']=intUtil[_0xfd48('0x3f')](_0x104885[_0xfd48('0x40')]);if(_0x2bc2a6&&_0x2bc2a6['monitor_format']){logger[_0xfd48('0xa')](_0xfd48('0x41'),'Recording\x20is\x20enabled!');_0x3548dc[_0xfd48('0x42')]=util[_0xfd48('0xd')](_0xfd48('0x43'),_0x104885[_0xfd48('0x40')],_0x3548dc[_0xfd48('0x44')],md5(_0x3548dc[_0xfd48('0x44')]));}else{_0x3548dc['recordingURL']='';}headers[_0xfd48('0x45')]=getAuth(_0x104885);return getUser(_0x104885,_0x3031f4['email'])[_0xfd48('0x1b')](function(_0x1695c2){_0x4989d3=_0x1695c2;logger[_0xfd48('0xa')](_0xfd48('0x46'),_0x4989d3['id']);return getEndUser(_0x104885,_0x3548dc[_0xfd48('0xf')],_0x3548dc['calleridnum']);})['then'](function(_0x21b64b){_0x5621f9=_0x21b64b;logger['info'](_0xfd48('0x47'),_0x5621f9['id']);return getTicket(_0x104885,_0x4989d3,_0x5621f9,_0x1d426b,_0x3548dc);})[_0xfd48('0x1b')](function(_0x5d3166){if(_0x5d3166&&_0x5d3166['id']){logger[_0xfd48('0xa')](_0xfd48('0x1c'));logger[_0xfd48('0xa')](_0xfd48('0x48'),_0x5d3166['id']);logger[_0xfd48('0xa')](_0xfd48('0x41'),_0xfd48('0x49'));emit(util[_0xfd48('0xd')]('user:%s',_0x3031f4[_0xfd48('0x13')]),_0xfd48('0x4a'),{'uri':util['format'](_0xfd48('0x4b'),_0x104885['remoteUri'],_0x5d3166['id'])});}})[_0xfd48('0x4c')](function(_0x101f35){logger[_0xfd48('0x4d')](_0xfd48('0x41'),JSON['stringify'](_0x101f35));});};exports['outbound']=function(_0xc4eae,_0x240a3e,_0x127714,_0x12ca30,_0x25ce10,_0x41b976,_0x30ff70){var _0x5d745a,_0x357aaa;_0x41b976['remoteUri']=intUtil[_0xfd48('0x3f')](_0x41b976['remoteUri']);_0x41b976[_0xfd48('0x40')]=intUtil[_0xfd48('0x3f')](_0x41b976[_0xfd48('0x40')]);if(_0x30ff70&&_0x30ff70[_0xfd48('0x4e')]&&_0x30ff70[_0xfd48('0x4e')]!==_0xfd48('0x4f')){logger[_0xfd48('0xa')]('[OUTBOUND]',_0xfd48('0x50'));_0x240a3e[_0xfd48('0x42')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x41b976['serverUrl'],_0x240a3e['uniqueid'],md5(_0x240a3e[_0xfd48('0x44')]));}headers[_0xfd48('0x45')]=getAuth(_0x41b976);return getUser(_0x41b976,_0x12ca30[_0xfd48('0x22')])['then'](function(_0x1870a7){_0x5d745a=_0x1870a7;logger['info'](_0xfd48('0x46'),_0x5d745a['id']);return getEndUser(_0x41b976,_0x240a3e['destcalleridname'],_0x240a3e[_0xfd48('0x51')]);})[_0xfd48('0x1b')](function(_0x4872dd){_0x357aaa=_0x4872dd;logger['info'](_0xfd48('0x47'),_0x357aaa['id']);return getTicket(_0x41b976,_0x5d745a,_0x357aaa,_0x127714,_0x240a3e);})['then'](function(_0x29acdc){if(_0x29acdc&&_0x29acdc['id']){logger[_0xfd48('0xa')](_0xfd48('0x1c'));logger[_0xfd48('0xa')](_0xfd48('0x48'),_0x29acdc['id']);logger['info'](_0xfd48('0x52'),_0xfd48('0x49'));emit(util['format'](_0xfd48('0x53'),_0x12ca30['name']),_0xfd48('0x4a'),{'uri':util[_0xfd48('0xd')]('%s/helpdesk/tickets/%d',_0x41b976[_0xfd48('0x19')],_0x29acdc['id'])});}})[_0xfd48('0x4c')](function(_0x39a06a){logger[_0xfd48('0x4d')](_0xfd48('0x52'),JSON['stringify'](_0x39a06a));});};exports[_0xfd48('0x54')]=function(_0x104c9f,_0x4cc292,_0x5f5711,_0x52dcaf,_0x549dca,_0xc1c014){var _0xc4aacc,_0x2c8f70;_0xc1c014[_0xfd48('0x19')]=intUtil['stripTrailingSlash'](_0xc1c014['remoteUri']);_0xc1c014['serverUrl']=intUtil[_0xfd48('0x3f')](_0xc1c014[_0xfd48('0x40')]);if(_0x549dca&&_0x549dca[_0xfd48('0x55')]){logger[_0xfd48('0xa')]('['+_0x4cc292['lastevent'][_0xfd48('0x56')]()+']',_0xfd48('0x50'));_0x4cc292[_0xfd48('0x42')]=util[_0xfd48('0xd')](_0xfd48('0x43'),_0xc1c014['serverUrl'],_0x4cc292['uniqueid'],md5(_0x4cc292[_0xfd48('0x44')]));}else{_0x4cc292[_0xfd48('0x42')]='';}headers[_0xfd48('0x45')]=getAuth(_0xc1c014);return getUser(_0xc1c014,'')[_0xfd48('0x1b')](function(_0x1bbbf1){_0xc4aacc=_0x1bbbf1;logger[_0xfd48('0xa')](_0xfd48('0x46'),_0xc4aacc['id']);return getEndUser(_0xc1c014,_0x4cc292[_0xfd48('0xf')],_0x4cc292[_0xfd48('0x10')]);})['then'](function(_0x524db1){_0x2c8f70=_0x524db1;logger['info'](_0xfd48('0x47'),_0x2c8f70['id']);return getTicket(_0xc1c014,_0xc4aacc,_0x2c8f70,_0x5f5711,_0x4cc292);})[_0xfd48('0x1b')](function(_0x5151fc){if(_0x5151fc){logger[_0xfd48('0xa')]('Ticket\x20created!');logger[_0xfd48('0xa')](_0xfd48('0x48'),_0x5151fc['id']);}})[_0xfd48('0x4c')](function(_0xace69d){logger[_0xfd48('0x4d')]('['+_0x4cc292['lastevent'][_0xfd48('0x56')]()+']',JSON[_0xfd48('0x2e')](_0xace69d));});};
\ No newline at end of file
+var _0xc090=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','calleridname','calleridnum','getString','Descriptions','<br>','Tags','Fields','custom_fields','mapValues','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','debug','stringify','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','variable','variableName','push','customVariable','name','Variable','stripTrailingSlash','serverUrl','monitor_format','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:browser:url','lastevent','toUpperCase','lodash','util','ioredis'];(function(_0x11fc82,_0x37b91f){var _0x3cb0dc=function(_0x1b9bfe){while(--_0x1b9bfe){_0x11fc82['push'](_0x11fc82['shift']());}};_0x3cb0dc(++_0x37b91f);}(_0xc090,0x111));var _0x0c09=function(_0x1f944c,_0x48e821){_0x1f944c=_0x1f944c-0x0;var _0x195b9c=_0xc090[_0x1f944c];return _0x195b9c;};'use strict';var _=require(_0x0c09('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x0c09('0x1'));var Redis=require(_0x0c09('0x2'));var intUtil=require(_0x0c09('0x3'));var config=require(_0x0c09('0x4'));var logger=require(_0x0c09('0x5'))(_0x0c09('0x6'));config[_0x0c09('0x7')]=_[_0x0c09('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0c09('0x9'))(new Redis(config[_0x0c09('0x7')]));var headers={'Content-Type':'application/json','Accept':_0x0c09('0xa')};function emit(_0x263c1f,_0x424943,_0x21a298){io['to'](_0x263c1f)[_0x0c09('0xb')](_0x424943,_0x21a298);}function getTicket(_0x9f3908,_0x159210,_0x11fe12,_0x6d36b4,_0x50f970){logger[_0x0c09('0xc')](_0x0c09('0xd'));var _0x4b9b96=_[_0x0c09('0xe')]({'responder_id':_0x159210['id'],'requester_id':_0x11fe12['id'],'name':util['format']('Caller\x20-\x20%s',_0x50f970[_0x0c09('0xf')]),'phone':_0x50f970[_0x0c09('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x0c09('0x11')](_0x6d36b4['Subjects'],_0x50f970,'\x20'),'description':intUtil[_0x0c09('0x11')](_0x6d36b4[_0x0c09('0x12')],_0x50f970,_0x0c09('0x13')),'tags':getTags(_0x6d36b4[_0x0c09('0x14')],'name')},getCustomFields(_0x6d36b4[_0x0c09('0x15')],_0x50f970));_0x4b9b96[_0x0c09('0x16')]=_[_0x0c09('0x17')](_['keyBy'](_0x4b9b96[_0x0c09('0x16')],'id'),_0x0c09('0x18'));return request({'uri':util[_0x0c09('0x19')](_0x0c09('0x1a'),_0x9f3908[_0x0c09('0x1b')]),'method':_0x0c09('0x1c'),'body':_0x4b9b96})[_0x0c09('0x1d')](function(_0xfdce80){logger[_0x0c09('0xc')](_0x0c09('0x1e'));return _0xfdce80;});}function getUser(_0x3cb5df,_0x1b16af){if(intUtil[_0x0c09('0x1f')](_0x1b16af)){return request({'uri':util[_0x0c09('0x19')](_0x0c09('0x20'),_0x3cb5df[_0x0c09('0x1b')]),'qs':{'email':_0x1b16af}})[_0x0c09('0x1d')](function(_0x3d2e37){if(_0x3d2e37[_0x0c09('0x21')]){logger[_0x0c09('0xc')](_0x0c09('0x22'));return _[_0x0c09('0x23')](_0x3d2e37,function(_0x22ecc2){return _0x22ecc2[_0x0c09('0x24')]['email']===_0x1b16af;});}else{logger['info'](_0x0c09('0x25'));return request({'uri':util[_0x0c09('0x19')](_0x0c09('0x26'),_0x3cb5df[_0x0c09('0x1b')])})[_0x0c09('0x1d')](function(_0x27c3c1){logger['info'](_0x0c09('0x27'));return _0x27c3c1;});}});}else{logger['info'](_0x0c09('0x28'));return request({'uri':util['format'](_0x0c09('0x26'),_0x3cb5df[_0x0c09('0x1b')])})[_0x0c09('0x1d')](function(_0x2b48e8){logger[_0x0c09('0xc')](_0x0c09('0x27'));return _0x2b48e8;});}}function getEndUser(_0x38f21f,_0x3478e6,_0x361601){logger[_0x0c09('0xc')]('Searching\x20enduser\x20with\x20phone',_0x361601);return request({'uri':util['format']('%s/api/v2/contacts',_0x38f21f[_0x0c09('0x1b')]),'qs':{'phone':_0x361601}})[_0x0c09('0x1d')](function(_0x458c8f){if(_0x458c8f[_0x0c09('0x21')]){logger[_0x0c09('0xc')](_0x0c09('0x29'));return _['find'](_0x458c8f,{'phone':_0x361601});}else{logger['info'](_0x0c09('0x2a'));return request({'uri':util[_0x0c09('0x19')]('%s/api/v2/contacts',_0x38f21f[_0x0c09('0x1b')]),'method':_0x0c09('0x1c'),'body':{'name':_0x3478e6,'phone':_0x361601}})[_0x0c09('0x1d')](function(_0x3dc0cc){logger[_0x0c09('0xc')](_0x0c09('0x2b'));return _0x3dc0cc;});}});}function getAuth(_0x60646a){return util['format'](_0x0c09('0x2c'),new Buffer(_0x60646a['apiKey']+':X')[_0x0c09('0x2d')](_0x0c09('0x2e')));}function request(_0x467bef){logger[_0x0c09('0x2f')]('[HTTP]',JSON[_0x0c09('0x30')](_0x467bef));return rp(_['defaults'](_0x467bef,{'method':_0x0c09('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x59a696,_0x5271ef){var _0x25474f=[];if(_0x59a696&&_0x59a696['length']>0x0){_0x25474f=_[_0x0c09('0x32')](_0x59a696,_0x5271ef);}return _0x25474f;}function getCustomFields(_0x2aca31,_0x145040){var _0x2a524b=[];var _0x1b08a4={'custom_fields':[]};if(_0x2aca31[_0x0c09('0x21')]>0x0){_[_0x0c09('0x33')](_0x2aca31,function(_0x3e8a07){if(_[_0x0c09('0x34')](['string',_0x0c09('0x35')],_0x3e8a07[_0x0c09('0x36')])&&_0x3e8a07[_0x0c09('0x37')]&&!_0x3e8a07[_0x0c09('0x38')]){_0x1b08a4[_0x3e8a07[_0x0c09('0x37')][_0x0c09('0x39')]()]=_0x3e8a07[_0x0c09('0x3a')][_0x0c09('0x2d')]();}else if(_['includes']([_0x0c09('0x3b'),_0x0c09('0x35')],_0x3e8a07[_0x0c09('0x36')])&&_0x3e8a07['idField']&&_0x3e8a07[_0x0c09('0x38')]){_0x1b08a4[_0x0c09('0x16')]['push']({'id':_0x3e8a07[_0x0c09('0x3c')],'value':_0x3e8a07[_0x0c09('0x3a')]['toString']()});}else if(_0x3e8a07[_0x0c09('0x36')]===_0x0c09('0x3d')&&_0x3e8a07[_0x0c09('0x3e')]&&_0x3e8a07[_0x0c09('0x3c')]&&_0x3e8a07[_0x0c09('0x38')]){_0x145040[_0x3e8a07['variableName']]&&_0x1b08a4[_0x0c09('0x16')][_0x0c09('0x3f')]({'id':_0x3e8a07[_0x0c09('0x3c')],'value':_0x145040[_0x3e8a07[_0x0c09('0x3e')]][_0x0c09('0x2d')]()});}else if(_0x3e8a07['type']===_0x0c09('0x40')&&_0x3e8a07['Variable']&&_0x3e8a07['Variable'][_0x0c09('0x41')]&&_0x3e8a07[_0x0c09('0x3c')]&&_0x3e8a07[_0x0c09('0x38')]){_0x145040[_0x3e8a07[_0x0c09('0x42')][_0x0c09('0x41')][_0x0c09('0x39')]()]&&_0x1b08a4[_0x0c09('0x16')]['push']({'id':_0x3e8a07[_0x0c09('0x3c')],'value':_0x145040[_0x3e8a07[_0x0c09('0x42')]['name'][_0x0c09('0x39')]()][_0x0c09('0x2d')]()});}});}return _0x1b08a4;}exports['queue']=function(_0x3766c0,_0x43b061,_0x15756c,_0x337577,_0x128e36,_0xf17b96){var _0x2a741c,_0xed1aa;_0xf17b96['remoteUri']=intUtil['stripTrailingSlash'](_0xf17b96['remoteUri']);_0xf17b96['serverUrl']=intUtil[_0x0c09('0x43')](_0xf17b96[_0x0c09('0x44')]);if(_0x128e36&&_0x128e36[_0x0c09('0x45')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x43b061[_0x0c09('0x46')]=util[_0x0c09('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf17b96['serverUrl'],_0x43b061[_0x0c09('0x47')],md5(_0x43b061[_0x0c09('0x47')]));}else{_0x43b061[_0x0c09('0x46')]='';}headers['Authorization']=getAuth(_0xf17b96);return getUser(_0xf17b96,_0x337577['email'])[_0x0c09('0x1d')](function(_0x257f23){_0x2a741c=_0x257f23;logger[_0x0c09('0xc')](_0x0c09('0x48'),_0x2a741c['id']);return getEndUser(_0xf17b96,_0x43b061[_0x0c09('0xf')],_0x43b061[_0x0c09('0x10')]);})[_0x0c09('0x1d')](function(_0x15d474){_0xed1aa=_0x15d474;logger[_0x0c09('0xc')]('The\x20Enduser\x20ID\x20is:',_0xed1aa['id']);return getTicket(_0xf17b96,_0x2a741c,_0xed1aa,_0x15756c,_0x43b061);})['then'](function(_0x58a1bf){if(_0x58a1bf&&_0x58a1bf['id']){logger[_0x0c09('0xc')](_0x0c09('0x1e'));logger['info'](_0x0c09('0x49'),_0x58a1bf['id']);logger[_0x0c09('0xc')](_0x0c09('0x4a'),_0x0c09('0x4b'));emit(util[_0x0c09('0x19')](_0x0c09('0x4c'),_0x337577['name']),'trigger:browser:url',{'uri':util['format'](_0x0c09('0x4d'),_0xf17b96[_0x0c09('0x1b')],_0x58a1bf['id'])});}})[_0x0c09('0x4e')](function(_0x1c6f61){logger[_0x0c09('0x4f')]('[QUEUE]',JSON[_0x0c09('0x30')](_0x1c6f61));});};exports[_0x0c09('0x50')]=function(_0x3ea73e,_0x8afdce,_0x4beea1,_0x1a6496,_0x53e14e,_0x1c91ab,_0x3e2327){var _0x4cd243,_0x571e63;_0x1c91ab[_0x0c09('0x1b')]=intUtil['stripTrailingSlash'](_0x1c91ab[_0x0c09('0x1b')]);_0x1c91ab[_0x0c09('0x44')]=intUtil['stripTrailingSlash'](_0x1c91ab[_0x0c09('0x44')]);if(_0x3e2327&&_0x3e2327[_0x0c09('0x51')]&&_0x3e2327[_0x0c09('0x51')]!==_0x0c09('0x52')){logger[_0x0c09('0xc')](_0x0c09('0x53'),'Recording\x20is\x20enabled!');_0x8afdce[_0x0c09('0x46')]=util['format'](_0x0c09('0x54'),_0x1c91ab['serverUrl'],_0x8afdce['uniqueid'],md5(_0x8afdce[_0x0c09('0x47')]));}headers[_0x0c09('0x55')]=getAuth(_0x1c91ab);return getUser(_0x1c91ab,_0x1a6496[_0x0c09('0x56')])[_0x0c09('0x1d')](function(_0x33c748){_0x4cd243=_0x33c748;logger[_0x0c09('0xc')](_0x0c09('0x48'),_0x4cd243['id']);return getEndUser(_0x1c91ab,_0x8afdce['destcalleridname'],_0x8afdce[_0x0c09('0x57')]);})[_0x0c09('0x1d')](function(_0x9a5149){_0x571e63=_0x9a5149;logger['info'](_0x0c09('0x58'),_0x571e63['id']);return getTicket(_0x1c91ab,_0x4cd243,_0x571e63,_0x4beea1,_0x8afdce);})[_0x0c09('0x1d')](function(_0x4be942){if(_0x4be942&&_0x4be942['id']){logger[_0x0c09('0xc')]('Ticket\x20created!');logger[_0x0c09('0xc')](_0x0c09('0x49'),_0x4be942['id']);logger[_0x0c09('0xc')](_0x0c09('0x53'),_0x0c09('0x4b'));emit(util['format'](_0x0c09('0x4c'),_0x1a6496[_0x0c09('0x41')]),_0x0c09('0x59'),{'uri':util[_0x0c09('0x19')](_0x0c09('0x4d'),_0x1c91ab[_0x0c09('0x1b')],_0x4be942['id'])});}})['catch'](function(_0x2f9745){logger[_0x0c09('0x4f')]('[OUTBOUND]',JSON['stringify'](_0x2f9745));});};exports['unmanaged']=function(_0x190d29,_0x576af9,_0x4480ff,_0x2ba42f,_0x297d7e,_0x1052dc){var _0x501e12,_0x2191b8;_0x1052dc[_0x0c09('0x1b')]=intUtil[_0x0c09('0x43')](_0x1052dc[_0x0c09('0x1b')]);_0x1052dc[_0x0c09('0x44')]=intUtil['stripTrailingSlash'](_0x1052dc[_0x0c09('0x44')]);if(_0x297d7e&&_0x297d7e[_0x0c09('0x45')]){logger[_0x0c09('0xc')]('['+_0x576af9[_0x0c09('0x5a')][_0x0c09('0x5b')]()+']','Recording\x20is\x20enabled!');_0x576af9[_0x0c09('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1052dc[_0x0c09('0x44')],_0x576af9[_0x0c09('0x47')],md5(_0x576af9[_0x0c09('0x47')]));}else{_0x576af9['recordingURL']='';}headers[_0x0c09('0x55')]=getAuth(_0x1052dc);return getUser(_0x1052dc,'')[_0x0c09('0x1d')](function(_0x434392){_0x501e12=_0x434392;logger[_0x0c09('0xc')](_0x0c09('0x48'),_0x501e12['id']);return getEndUser(_0x1052dc,_0x576af9['calleridname'],_0x576af9[_0x0c09('0x10')]);})[_0x0c09('0x1d')](function(_0x48c2d8){_0x2191b8=_0x48c2d8;logger['info'](_0x0c09('0x58'),_0x2191b8['id']);return getTicket(_0x1052dc,_0x501e12,_0x2191b8,_0x4480ff,_0x576af9);})[_0x0c09('0x1d')](function(_0x5eef32){if(_0x5eef32){logger[_0x0c09('0xc')](_0x0c09('0x1e'));logger[_0x0c09('0xc')](_0x0c09('0x49'),_0x5eef32['id']);}})[_0x0c09('0x4e')](function(_0x317912){logger[_0x0c09('0x4f')]('['+_0x576af9[_0x0c09('0x5a')][_0x0c09('0x5b')]()+']',JSON[_0x0c09('0x30')](_0x317912));});};
\ No newline at end of file
index 7052346..f459633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x542b=['serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','Admin\x20selected','userEmail','adminEmail','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x542b,0x6c));var _0xb542=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x542b[_0x4b91c4];return _0x25cb80;};'use strict';var _=require(_0xb542('0x0'));var rp=require(_0xb542('0x1'));var md5=require(_0xb542('0x2'));var util=require(_0xb542('0x3'));var moment=require(_0xb542('0x4'));var Promise=require(_0xb542('0x5'));var Redis=require(_0xb542('0x6'));var intUtil=require(_0xb542('0x7'));var config=require(_0xb542('0x8'));var logger=require(_0xb542('0x9'))(_0xb542('0xa'));config[_0xb542('0xb')]=_[_0xb542('0xc')](config[_0xb542('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x3f7738,_0x2ca0f0,_0x44735d,_0x304268){return new Promise(function(_0x50486a,_0x4b44aa){var _0x497716=![];var _0x40f3b4={'method':_0xb542('0xd'),'uri':_0x304268+'/api/selector/owners','json':!![]};_0x40f3b4[_0xb542('0xe')]=_0x44735d;logger[_0xb542('0xf')](_0xb542('0x10'));return rp(_0x40f3b4)[_0xb542('0x11')](function(_0x5e31d5){if(_0x5e31d5){var _0x310e3a=_0x5e31d5[_0xb542('0x12')];var _0x71ba85=null;for(_0x71ba85=0x0;_0x71ba85<_0x310e3a[_0xb542('0x13')];_0x71ba85++){if(_0x310e3a[_0x71ba85][_0xb542('0x14')]===_0x3f7738['adminEmail']){_0x3f7738[_0xb542('0x15')]=_0x310e3a[_0x71ba85]['id'];_0x497716=!![];}}if(_0x497716){logger[_0xb542('0xf')](_0xb542('0x16'),_0x3f7738[_0xb542('0x15')]);_0x50486a(_0x3f7738);}else{_0x4b44aa({'statusCode':0x194,'message':_0xb542('0x17')});}}else{_0x4b44aa({'statusCode':0x194,'message':_0xb542('0x17')});}})[_0xb542('0x18')](function(_0x2585d9){logger[_0xb542('0x19')]('['+[_0x2ca0f0[_0xb542('0x1a')]()]+']',_0x2585d9[_0xb542('0x1b')]);_0x4b44aa(_0x2585d9);});});}function getUser(_0x29be7b,_0xc7dce1,_0x466671){return function(_0x266d9d){return new Promise(function(_0x514999,_0x264e7e){var _0x45882c={'method':_0xb542('0xd'),'uri':_0x466671+_0xb542('0x1c'),'json':!![]};_0x45882c[_0xb542('0xe')]=_0xc7dce1;logger['info'](_0xb542('0x1d'));return rp(_0x45882c)['then'](function(_0x3950ea){if(_0x3950ea){var _0x1bb0a5=_0x3950ea['users'];var _0x3e7b37=![];var _0x21cb35=null;if(_0x266d9d[_0xb542('0x1e')]!==null){logger[_0xb542('0xf')](_0xb542('0x1f'),_0x266d9d[_0xb542('0x1e')]);_0x266d9d['userEmail']=_0x266d9d[_0xb542('0x1e')];for(_0x21cb35=0x0;_0x21cb35<_0x1bb0a5[_0xb542('0x13')];_0x21cb35++){if(_0x1bb0a5[_0x21cb35][_0xb542('0x14')]===_0x266d9d['agentEmail']){_0x3e7b37=!![];_0x266d9d[_0xb542('0x20')]=_0x1bb0a5[_0x21cb35]['id'];logger[_0xb542('0xf')](_0xb542('0x21'),_0x266d9d['userId']);}}}if(!_0x3e7b37){logger['info'](_0xb542('0x22'));_0x266d9d[_0xb542('0x23')]=_0x266d9d[_0xb542('0x24')];_0x266d9d[_0xb542('0x20')]=_0x266d9d['adminId'];_0x3e7b37=!![];}if(_0x3e7b37){_0x514999(_0x266d9d);}else{_0x264e7e({'statusCode':0x194,'message':_0xb542('0x17')});}}else{_0x264e7e({'statusCode':0x194,'message':_0xb542('0x17')});}})[_0xb542('0x18')](function(_0x1b98c7){logger[_0xb542('0x19')]('['+[_0x29be7b['toUpperCase']()]+']',_0x1b98c7[_0xb542('0x1b')]);_0x264e7e(_0x1b98c7);});});};}function searchContact(_0x4a285d,_0x383f75,_0x5cd037,_0x40df77){return new Promise(function(_0x1f24da,_0x195d86){var _0x44d78c={'method':_0xb542('0xd'),'headers':_0x383f75,'uri':_0x4a285d+'/api/lookup?q='+_0x40df77+'&f='+_0x5cd037+'&entities=contact','json':!![]};rp(_0x44d78c)[_0xb542('0x11')](function(_0x1648c5){var _0xb8ab8f=_[_0xb542('0x25')](_0x1648c5[_0xb542('0x26')][_0xb542('0x26')],[_0x5cd037,_0x40df77]);_0x1f24da(_0xb8ab8f);})[_0xb542('0x18')](function(_0x42c93a){_0x195d86(_0x42c93a);});});}function getEndUser(_0x3c99e7,_0x5e240d,_0x3bba75){return function(_0x121f26){return new Promise(function(_0x4fd27a,_0x53947c){logger['info'](util['format'](_0xb542('0x27'),_0x121f26[_0xb542('0x28')]));searchContact(_0x3bba75,_0x5e240d,_0xb542('0x29'),_0x121f26['contactNumber'])[_0xb542('0x11')](function(_0x112e11){if(_0x112e11){_0x121f26[_0xb542('0x2a')]=_0x112e11['id'];logger[_0xb542('0xf')](_0xb542('0x2b'),_0x121f26['endUserId']);return _0x4fd27a(_0x121f26);}searchContact(_0x3bba75,_0x5e240d,_0xb542('0x2c'),_0x121f26[_0xb542('0x28')])[_0xb542('0x11')](function(_0xd0771b){if(_0xd0771b){_0x121f26[_0xb542('0x2a')]=_0xd0771b['id'];logger['info'](_0xb542('0x2d'),_0x121f26[_0xb542('0x2a')]);return _0x4fd27a(_0x121f26);}createEndUser(_0x121f26,_0x3c99e7,_0x5e240d,_0x3bba75)[_0xb542('0x11')](function(_0x6799d6){logger['info'](_0xb542('0x2e'),_0x6799d6[_0xb542('0x2a')]);return _0x4fd27a(_0x6799d6);});});})['catch'](function(_0x1340cd){_0x53947c(_0x1340cd);});});};}function createEndUser(_0x11a4ca,_0xd5347c,_0x654fc3,_0x4a2d19){return new Promise(function(_0x5e22cd,_0x247326){var _0x5f0cb8=moment();var _0x5d860b={'method':_0xb542('0x2f'),'uri':_0x4a2d19+'/api/contacts','body':{'contact':{'last_name':_0x11a4ca[_0xb542('0x28')],'work_number':_0x11a4ca['contactNumber'],'mobile_number':_0x11a4ca[_0xb542('0x28')],'owner_id':_0x11a4ca[_0xb542('0x20')],'created_at':_0x5f0cb8[_0xb542('0x30')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x5d860b[_0xb542('0xe')]=_0x654fc3;logger[_0xb542('0xf')](_0xb542('0x31'));return rp(_0x5d860b)['then'](function(_0x2846a2){_0x11a4ca['endUserId']=_0x2846a2['contact']['id'];_0x5e22cd(_0x11a4ca);})[_0xb542('0x18')](function(_0x5e04c3){logger[_0xb542('0x19')]('['+[_0xd5347c['toUpperCase']()]+']',_0x5e04c3[_0xb542('0x1b')]);_0x247326(_0x5e04c3[_0xb542('0x1b')]);});});}function getTicket(_0x531528,_0x11cbb4,_0x53be06,_0x4a0a04,_0x15968e){return function(_0x2c0e7c){logger[_0xb542('0xf')](_0xb542('0x32'));return new Promise(function(_0x582faf,_0x277933){var _0x571180=moment();var _0xf32a1={'method':_0xb542('0x2f'),'uri':_0x53be06+_0xb542('0x33'),'body':{'title':intUtil[_0xb542('0x34')](_0x4a0a04[_0xb542('0x35')],_0x15968e,'\x20'),'description':intUtil[_0xb542('0x34')](_0x4a0a04['Descriptions'],_0x15968e,'\x0a'),'owner_id':_0x2c0e7c[_0xb542('0x20')],'creater_id':_0x2c0e7c[_0xb542('0x15')],'targetable_id':_0x2c0e7c['endUserId'],'targetable_type':'Contact','created_at':_0x571180[_0xb542('0x30')](_0xb542('0x36')),'due_date':_0x571180[_0xb542('0x37')](0x1e,'m')[_0xb542('0x30')](_0xb542('0x36'))},'json':!![]};_0xf32a1[_0xb542('0xe')]=_0x11cbb4;return rp(_0xf32a1)[_0xb542('0x11')](function(_0x5a546c){_0x2c0e7c[_0xb542('0x38')]=_0x5a546c[_0xb542('0x39')]['id'];logger[_0xb542('0xf')](_0xb542('0x3a'),_0x2c0e7c[_0xb542('0x38')]);_0x582faf(_0x2c0e7c);})[_0xb542('0x18')](function(_0x52f010){logger[_0xb542('0x19')]('['+[_0x531528[_0xb542('0x1a')]()]+']',_0x52f010[_0xb542('0x1b')]);_0x277933(_0x52f010[_0xb542('0x1b')]);});});};}function emit(_0x3ff7ae,_0x48d97a,_0x508314){var _0x2c961e={'uri':_0x3ff7ae+_0xb542('0x3b')+_0x508314};io['to'](util[_0xb542('0x30')](_0xb542('0x3c'),_0x48d97a))[_0xb542('0x3d')](_0xb542('0x3e'),_0x2c961e);}exports['cs']=function(_0xb1028f,_0x1d2ae8,_0x26a3db,_0x336fd9,_0x287264,_0x2dfa14,_0x9a2175,_0x1b1ab1){var _0x2b5507={};var _0x1efa0e={'Authorization':_0xb542('0x3f')+_0x2dfa14['apiKey']};_0x2dfa14[_0xb542('0x40')]=intUtil[_0xb542('0x41')](_0x2dfa14[_0xb542('0x40')]);_0x2dfa14[_0xb542('0x42')]=intUtil[_0xb542('0x41')](_0x2dfa14[_0xb542('0x42')]);var _0x350133=_0x2dfa14['remoteUri'];_0x2b5507[_0xb542('0x24')]=_0x2dfa14['username'];_0x2b5507[_0xb542('0x28')]=_0x1b1ab1[_0xb542('0x43')]()===_0xb542('0x44')?_0x1d2ae8[_0xb542('0x45')]:_0x1d2ae8[_0xb542('0x46')];_0x2b5507[_0xb542('0x47')]=_0x1b1ab1==='queue'||_0x1b1ab1==='unmanaged'?_0xb542('0x48'):_0xb542('0x44');if(_0x336fd9){_0x2b5507[_0xb542('0x1e')]=_0x336fd9[_0xb542('0x14')];}var _0x460d89=util['format'](_0xb542('0x49'),_0x2dfa14[_0xb542('0x42')],_0x1d2ae8['uniqueid'],md5(_0x1d2ae8[_0xb542('0x4a')]));if(_0x287264&&_0x287264[_0xb542('0x4b')]){logger[_0xb542('0xf')](_0xb542('0x4c'),_0xb542('0x4d'));_0x1d2ae8['recordingURL']=_0x460d89;}else if(_0x9a2175&&_0x9a2175[_0xb542('0x4e')]&&_0x9a2175[_0xb542('0x4e')]!==_0xb542('0x4f')){logger[_0xb542('0xf')](_0xb542('0x50'),_0xb542('0x4d'));_0x1d2ae8[_0xb542('0x51')]=_0x460d89;}else{_0x1d2ae8['recordingURL']='';}return getAdminId(_0x2b5507,_0x1b1ab1,_0x1efa0e,_0x350133)['then'](getUser(_0x1b1ab1,_0x1efa0e,_0x350133))[_0xb542('0x11')](getEndUser(_0x1b1ab1,_0x1efa0e,_0x350133))['then'](getTicket(_0x1b1ab1,_0x1efa0e,_0x350133,_0x26a3db,_0x1d2ae8))['then'](function(_0x33eaa0){logger[_0xb542('0xf')](util['format'](_0xb542('0x52'),_0x33eaa0[_0xb542('0x38')]));if(_0x1b1ab1!=='unmanaged'){logger[_0xb542('0xf')]('['+[_0x1b1ab1[_0xb542('0x1a')]()]+']',_0xb542('0x53'));emit(_0x350133,_0x336fd9[_0xb542('0x54')],_0x33eaa0[_0xb542('0x2a')]);}})[_0xb542('0x18')](function(_0x452900){logger[_0xb542('0x19')]('['+[_0x1b1ab1[_0xb542('0x1a')]()]+_0xb542('0x55'),util[_0xb542('0x56')](_0x452900,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4cdb=['[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected','userEmail','error','message','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','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','Subjects','getString','Contact','task','Task\x20created:','ticketId','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none'];(function(_0x38dcf9,_0x236797){var _0x246b3c=function(_0x217e6b){while(--_0x217e6b){_0x38dcf9['push'](_0x38dcf9['shift']());}};_0x246b3c(++_0x236797);}(_0x4cdb,0xb6));var _0xb4cd=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0x4cdb[_0x874cf1];return _0x233579;};'use strict';var _=require(_0xb4cd('0x0'));var rp=require(_0xb4cd('0x1'));var md5=require('md5');var util=require(_0xb4cd('0x2'));var moment=require(_0xb4cd('0x3'));var Promise=require(_0xb4cd('0x4'));var Redis=require(_0xb4cd('0x5'));var intUtil=require('./util');var config=require(_0xb4cd('0x6'));var logger=require(_0xb4cd('0x7'))(_0xb4cd('0x8'));config['redis']=_[_0xb4cd('0x9')](config[_0xb4cd('0xa')],{'host':_0xb4cd('0xb'),'port':0x18eb});var io=require(_0xb4cd('0xc'))(new Redis(config[_0xb4cd('0xa')]));function getAdminId(_0x5cd15a,_0x1d688f,_0x2ec22c,_0x4455c9){return new Promise(function(_0x30cf82,_0x155d62){var _0x4cd37b=![];var _0x58f228={'method':_0xb4cd('0xd'),'uri':_0x4455c9+_0xb4cd('0xe'),'json':!![]};_0x58f228[_0xb4cd('0xf')]=_0x2ec22c;logger[_0xb4cd('0x10')](_0xb4cd('0x11'));return rp(_0x58f228)[_0xb4cd('0x12')](function(_0x5db3fb){if(_0x5db3fb){var _0x4f318e=_0x5db3fb[_0xb4cd('0x13')];var _0x4b43f8=null;for(_0x4b43f8=0x0;_0x4b43f8<_0x4f318e[_0xb4cd('0x14')];_0x4b43f8++){if(_0x4f318e[_0x4b43f8][_0xb4cd('0x15')]===_0x5cd15a[_0xb4cd('0x16')]){_0x5cd15a[_0xb4cd('0x17')]=_0x4f318e[_0x4b43f8]['id'];_0x4cd37b=!![];}}if(_0x4cd37b){logger[_0xb4cd('0x10')]('Admin\x20found:',_0x5cd15a[_0xb4cd('0x17')]);_0x30cf82(_0x5cd15a);}else{_0x155d62({'statusCode':0x194,'message':_0xb4cd('0x18')});}}else{_0x155d62({'statusCode':0x194,'message':_0xb4cd('0x18')});}})[_0xb4cd('0x19')](function(_0x4da2cf){logger['error']('['+[_0x1d688f[_0xb4cd('0x1a')]()]+']',_0x4da2cf['message']);_0x155d62(_0x4da2cf);});});}function getUser(_0x120866,_0x2ddd69,_0x3d4963){return function(_0x521b51){return new Promise(function(_0x5a307b,_0x5d3911){var _0x1b33f6={'method':_0xb4cd('0xd'),'uri':_0x3d4963+_0xb4cd('0xe'),'json':!![]};_0x1b33f6[_0xb4cd('0xf')]=_0x2ddd69;logger[_0xb4cd('0x10')]('Getting\x20user\x20list');return rp(_0x1b33f6)[_0xb4cd('0x12')](function(_0x533c46){if(_0x533c46){var _0x336411=_0x533c46[_0xb4cd('0x13')];var _0x1534b3=![];var _0x2abab5=null;if(_0x521b51[_0xb4cd('0x1b')]!==null){logger[_0xb4cd('0x10')](_0xb4cd('0x1c'),_0x521b51[_0xb4cd('0x1b')]);_0x521b51['userEmail']=_0x521b51[_0xb4cd('0x1b')];for(_0x2abab5=0x0;_0x2abab5<_0x336411[_0xb4cd('0x14')];_0x2abab5++){if(_0x336411[_0x2abab5][_0xb4cd('0x15')]===_0x521b51[_0xb4cd('0x1b')]){_0x1534b3=!![];_0x521b51[_0xb4cd('0x1d')]=_0x336411[_0x2abab5]['id'];logger[_0xb4cd('0x10')]('User\x20found:',_0x521b51[_0xb4cd('0x1d')]);}}}if(!_0x1534b3){logger['info'](_0xb4cd('0x1e'));_0x521b51[_0xb4cd('0x1f')]=_0x521b51[_0xb4cd('0x16')];_0x521b51[_0xb4cd('0x1d')]=_0x521b51[_0xb4cd('0x17')];_0x1534b3=!![];}if(_0x1534b3){_0x5a307b(_0x521b51);}else{_0x5d3911({'statusCode':0x194,'message':_0xb4cd('0x18')});}}else{_0x5d3911({'statusCode':0x194,'message':_0xb4cd('0x18')});}})[_0xb4cd('0x19')](function(_0x591de8){logger[_0xb4cd('0x20')]('['+[_0x120866[_0xb4cd('0x1a')]()]+']',_0x591de8[_0xb4cd('0x21')]);_0x5d3911(_0x591de8);});});};}function searchContact(_0x4b4046,_0x471bd1,_0x1c3ed6,_0x1805a4){return new Promise(function(_0x543f06,_0x6f8ae0){var _0x16338d={'method':_0xb4cd('0xd'),'headers':_0x471bd1,'uri':_0x4b4046+'/api/lookup?q='+_0x1805a4+_0xb4cd('0x22')+_0x1c3ed6+_0xb4cd('0x23'),'json':!![]};rp(_0x16338d)[_0xb4cd('0x12')](function(_0x39b06d){var _0x587b76=_[_0xb4cd('0x24')](_0x39b06d[_0xb4cd('0x25')]['contacts'],[_0x1c3ed6,_0x1805a4]);_0x543f06(_0x587b76);})[_0xb4cd('0x19')](function(_0x389521){_0x6f8ae0(_0x389521);});});}function getEndUser(_0x27ea00,_0x48b3a3,_0x589fb5){return function(_0x10b0e4){return new Promise(function(_0x17c5b4,_0x179542){logger['info'](util[_0xb4cd('0x26')](_0xb4cd('0x27'),_0x10b0e4[_0xb4cd('0x28')]));searchContact(_0x589fb5,_0x48b3a3,_0xb4cd('0x29'),_0x10b0e4[_0xb4cd('0x28')])['then'](function(_0x396993){if(_0x396993){_0x10b0e4['endUserId']=_0x396993['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x10b0e4[_0xb4cd('0x2a')]);return _0x17c5b4(_0x10b0e4);}searchContact(_0x589fb5,_0x48b3a3,_0xb4cd('0x2b'),_0x10b0e4['contactNumber'])[_0xb4cd('0x12')](function(_0x329072){if(_0x329072){_0x10b0e4[_0xb4cd('0x2a')]=_0x329072['id'];logger[_0xb4cd('0x10')](_0xb4cd('0x2c'),_0x10b0e4[_0xb4cd('0x2a')]);return _0x17c5b4(_0x10b0e4);}createEndUser(_0x10b0e4,_0x27ea00,_0x48b3a3,_0x589fb5)['then'](function(_0x2cfd20){logger[_0xb4cd('0x10')](_0xb4cd('0x2d'),_0x2cfd20[_0xb4cd('0x2a')]);return _0x17c5b4(_0x2cfd20);});});})[_0xb4cd('0x19')](function(_0x45e6a5){_0x179542(_0x45e6a5);});});};}function createEndUser(_0x30e02c,_0x48bbf7,_0x3e45dc,_0x4459f9){return new Promise(function(_0x10269c,_0x536cb0){var _0x38e0d4=moment();var _0x49d84c={'method':_0xb4cd('0x2e'),'uri':_0x4459f9+_0xb4cd('0x2f'),'body':{'contact':{'last_name':_0x30e02c[_0xb4cd('0x28')],'work_number':_0x30e02c[_0xb4cd('0x28')],'mobile_number':_0x30e02c['contactNumber'],'owner_id':_0x30e02c[_0xb4cd('0x1d')],'created_at':_0x38e0d4['format'](_0xb4cd('0x30'))}},'json':!![]};_0x49d84c[_0xb4cd('0xf')]=_0x3e45dc;logger[_0xb4cd('0x10')](_0xb4cd('0x31'));return rp(_0x49d84c)['then'](function(_0x425145){_0x30e02c[_0xb4cd('0x2a')]=_0x425145[_0xb4cd('0x32')]['id'];_0x10269c(_0x30e02c);})[_0xb4cd('0x19')](function(_0x4da051){logger[_0xb4cd('0x20')]('['+[_0x48bbf7['toUpperCase']()]+']',_0x4da051[_0xb4cd('0x21')]);_0x536cb0(_0x4da051[_0xb4cd('0x21')]);});});}function getTicket(_0x58598c,_0x44f0c8,_0x3911d8,_0x5a6d87,_0x1af01){return function(_0x274735){logger[_0xb4cd('0x10')](_0xb4cd('0x33'));return new Promise(function(_0x3ae9aa,_0x4766ba){var _0x209a64=moment();var _0x1229c1={'method':_0xb4cd('0x2e'),'uri':_0x3911d8+_0xb4cd('0x34'),'body':{'title':intUtil['getString'](_0x5a6d87[_0xb4cd('0x35')],_0x1af01,'\x20'),'description':intUtil[_0xb4cd('0x36')](_0x5a6d87['Descriptions'],_0x1af01,'\x0a'),'owner_id':_0x274735[_0xb4cd('0x1d')],'creater_id':_0x274735[_0xb4cd('0x17')],'targetable_id':_0x274735['endUserId'],'targetable_type':_0xb4cd('0x37'),'created_at':_0x209a64[_0xb4cd('0x26')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x209a64['add'](0x1e,'m')[_0xb4cd('0x26')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x1229c1['headers']=_0x44f0c8;return rp(_0x1229c1)['then'](function(_0x18a187){_0x274735['ticketId']=_0x18a187[_0xb4cd('0x38')]['id'];logger[_0xb4cd('0x10')](_0xb4cd('0x39'),_0x274735[_0xb4cd('0x3a')]);_0x3ae9aa(_0x274735);})[_0xb4cd('0x19')](function(_0x19b6c0){logger['error']('['+[_0x58598c[_0xb4cd('0x1a')]()]+']',_0x19b6c0['message']);_0x4766ba(_0x19b6c0[_0xb4cd('0x21')]);});});};}function emit(_0x334ab3,_0x4d75ef,_0x38bb05){var _0x485f36={'uri':_0x334ab3+_0xb4cd('0x3b')+_0x38bb05};io['to'](util['format'](_0xb4cd('0x3c'),_0x4d75ef))[_0xb4cd('0x3d')](_0xb4cd('0x3e'),_0x485f36);}exports['cs']=function(_0x384e3c,_0x131d50,_0x4a3609,_0x17ef28,_0xea13a5,_0x2caad1,_0x1a8eb3,_0x1e4c65){var _0x3cbb6e={};var _0x44a363={'Authorization':'Token\x20token='+_0x2caad1[_0xb4cd('0x3f')]};_0x2caad1[_0xb4cd('0x40')]=intUtil[_0xb4cd('0x41')](_0x2caad1[_0xb4cd('0x40')]);_0x2caad1[_0xb4cd('0x42')]=intUtil[_0xb4cd('0x41')](_0x2caad1[_0xb4cd('0x42')]);var _0x21f61a=_0x2caad1[_0xb4cd('0x40')];_0x3cbb6e['adminEmail']=_0x2caad1[_0xb4cd('0x43')];_0x3cbb6e[_0xb4cd('0x28')]=_0x1e4c65[_0xb4cd('0x44')]()===_0xb4cd('0x45')?_0x131d50[_0xb4cd('0x46')]:_0x131d50[_0xb4cd('0x47')];_0x3cbb6e['callDirection']=_0x1e4c65===_0xb4cd('0x48')||_0x1e4c65===_0xb4cd('0x49')?_0xb4cd('0x48'):_0xb4cd('0x45');if(_0x17ef28){_0x3cbb6e['agentEmail']=_0x17ef28[_0xb4cd('0x15')];}var _0x36f285=util[_0xb4cd('0x26')](_0xb4cd('0x4a'),_0x2caad1[_0xb4cd('0x42')],_0x131d50[_0xb4cd('0x4b')],md5(_0x131d50['uniqueid']));if(_0xea13a5&&_0xea13a5[_0xb4cd('0x4c')]){logger['info'](_0xb4cd('0x4d'),_0xb4cd('0x4e'));_0x131d50[_0xb4cd('0x4f')]=_0x36f285;}else if(_0x1a8eb3&&_0x1a8eb3[_0xb4cd('0x50')]&&_0x1a8eb3[_0xb4cd('0x50')]!==_0xb4cd('0x51')){logger['info'](_0xb4cd('0x52'),'Recording\x20is\x20enabled!');_0x131d50[_0xb4cd('0x4f')]=_0x36f285;}else{_0x131d50[_0xb4cd('0x4f')]='';}return getAdminId(_0x3cbb6e,_0x1e4c65,_0x44a363,_0x21f61a)[_0xb4cd('0x12')](getUser(_0x1e4c65,_0x44a363,_0x21f61a))[_0xb4cd('0x12')](getEndUser(_0x1e4c65,_0x44a363,_0x21f61a))[_0xb4cd('0x12')](getTicket(_0x1e4c65,_0x44a363,_0x21f61a,_0x4a3609,_0x131d50))[_0xb4cd('0x12')](function(_0xd51f47){logger[_0xb4cd('0x10')](util[_0xb4cd('0x26')](_0xb4cd('0x53'),_0xd51f47['ticketId']));if(_0x1e4c65!==_0xb4cd('0x49')){logger['info']('['+[_0x1e4c65[_0xb4cd('0x1a')]()]+']',_0xb4cd('0x54'));emit(_0x21f61a,_0x17ef28[_0xb4cd('0x55')],_0xd51f47[_0xb4cd('0x2a')]);}})[_0xb4cd('0x19')](function(_0x292f50){logger['error']('['+[_0x1e4c65['toUpperCase']()]+_0xb4cd('0x56'),util[_0xb4cd('0x57')](_0x292f50,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0c43ea2..0c448ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b8e=['log','EVENT\x20UNKNOWN','unmanaged','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','freshsales','includes','data1','toLowerCase','data2','find','data3','queue','routeId','outbound'];(function(_0x3de99a,_0x20140b){var _0x3d9667=function(_0x18284c){while(--_0x18284c){_0x3de99a['push'](_0x3de99a['shift']());}};_0x3d9667(++_0x20140b);}(_0x8b8e,0x108));var _0xe8b8=function(_0x385835,_0x484804){_0x385835=_0x385835-0x0;var _0x3359db=_0x8b8e[_0x385835];return _0x3359db;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var zendesk=require(_0xe8b8('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0xe8b8('0x2'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xe8b8('0x3'));var vtiger=require(_0xe8b8('0x4'));var servicenow=require(_0xe8b8('0x5'));var dynamics365=require(_0xe8b8('0x6'));var freshsales=require(_0xe8b8('0x7'));var integrations=[_0xe8b8('0x8'),_0xe8b8('0x9'),_0xe8b8('0xa'),_0xe8b8('0xb'),_0xe8b8('0xc'),'desk',_0xe8b8('0xd'),'dynamics365',_0xe8b8('0xe'),'servicenow'];exports['exec']=function(_0x2ccbeb,_0xcf1e01,_0x568241,_0x54eb14,_0x259a1a,_0x42bb8a){if(_0x568241){if(_[_0xe8b8('0xf')](integrations,_0x2ccbeb[_0xe8b8('0x10')][_0xe8b8('0x11')]())){try{var _0x298bae=null;var _0x3de76b='';var _0x11fb1a=_0x568241[_0x2ccbeb[_0xe8b8('0x10')][_0xe8b8('0x11')]()];if(_0x11fb1a){var _0x1c5062=_0x11fb1a[_0x2ccbeb[_0xe8b8('0x12')]];if(_0x1c5062){var _0x30bfc7=_[_0xe8b8('0x13')](_0x1c5062['Configurations'],{'id':parseInt(_0x2ccbeb[_0xe8b8('0x14')],0xa)});if(_0x30bfc7){if(_0x54eb14){if(_0x259a1a&&_0xcf1e01['queue']){_0x3de76b=_0xe8b8('0x15');}else if(_0xcf1e01[_0xe8b8('0x16')]){_0x3de76b=_0xe8b8('0x17');}else{console[_0xe8b8('0x18')](_0xe8b8('0x19'),_0xcf1e01);}}else{_0x3de76b=_0xe8b8('0x1a');}switch(_0x2ccbeb[_0xe8b8('0x10')][_0xe8b8('0x11')]()){case _0xe8b8('0x8'):zendesk[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case _0xe8b8('0x9'):salesforce[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case'sugarcrm':sugarcrm[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case _0xe8b8('0xb'):freshdesk[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case _0xe8b8('0xc'):zoho[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case'desk':desk[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case _0xe8b8('0xd'):vtiger[_0x3de76b](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a);break;case _0xe8b8('0xe'):freshsales['cs'](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a,_0x3de76b);break;case _0xe8b8('0x1b'):servicenow['cs'](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a,_0x3de76b);break;case _0xe8b8('0x1c'):dynamics365['cs'](_0x2ccbeb,_0xcf1e01,_0x30bfc7,_0x54eb14,_0x259a1a,_0x1c5062,_0x42bb8a,_0x3de76b);break;default:console[_0xe8b8('0x18')](_0xe8b8('0x1d'));}}else{_0x298bae=require(_0xe8b8('0x1e'))(_0x2ccbeb[_0xe8b8('0x10')][_0xe8b8('0x11')]());_0x298bae[_0xe8b8('0x1f')](_0xe8b8('0x20'),util[_0xe8b8('0x21')](_0xe8b8('0x22'),_0x2ccbeb[_0xe8b8('0x10')][_0xe8b8('0x11')](),_0x2ccbeb[_0xe8b8('0x14')]));}}else{_0x298bae=require(_0xe8b8('0x1e'))(_0x2ccbeb['data1']['toLowerCase']());_0x298bae['error'](_0xe8b8('0x20'),util['format'](_0xe8b8('0x23'),_0x2ccbeb['data1'][_0xe8b8('0x11')](),_0x2ccbeb[_0xe8b8('0x12')]));}}else{}}catch(_0x5e3fa2){console['error'](_0x5e3fa2);}}}};
\ No newline at end of file
+var _0x9ca8=['freshsales','unknown\x20integration','error','format','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./desk','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','routeId','outbound','log','EVENT\x20UNKNOWN','zendesk','vtiger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ca8,0x1f1));var _0x89ca=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x9ca8[_0xab9f3d];return _0x5283bf;};'use strict';var _=require(_0x89ca('0x0'));var util=require('util');var zendesk=require(_0x89ca('0x1'));var salesforce=require(_0x89ca('0x2'));var sugarcrm=require(_0x89ca('0x3'));var freshdesk=require(_0x89ca('0x4'));var zoho=require('./zoho');var desk=require(_0x89ca('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x89ca('0x6'));var freshsales=require(_0x89ca('0x7'));var integrations=['zendesk',_0x89ca('0x8'),_0x89ca('0x9'),_0x89ca('0xa'),_0x89ca('0xb'),_0x89ca('0xc'),'vtiger',_0x89ca('0xd'),'freshsales',_0x89ca('0xe')];exports[_0x89ca('0xf')]=function(_0x1303ad,_0x167cd9,_0x784ded,_0x6f5d4d,_0x1c761b,_0x5ea542){if(_0x784ded){if(_[_0x89ca('0x10')](integrations,_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')]())){try{var _0x3e0853=null;var _0x864430='';var _0x56a60c=_0x784ded[_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')]()];if(_0x56a60c){var _0x2e5611=_0x56a60c[_0x1303ad['data2']];if(_0x2e5611){var _0x37965e=_[_0x89ca('0x13')](_0x2e5611[_0x89ca('0x14')],{'id':parseInt(_0x1303ad[_0x89ca('0x15')],0xa)});if(_0x37965e){if(_0x6f5d4d){if(_0x1c761b&&_0x167cd9['queue']){_0x864430='queue';}else if(_0x167cd9[_0x89ca('0x16')]){_0x864430=_0x89ca('0x17');}else{console[_0x89ca('0x18')](_0x89ca('0x19'),_0x167cd9);}}else{_0x864430='unmanaged';}switch(_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')]()){case _0x89ca('0x1a'):zendesk[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0x8'):salesforce[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0x9'):sugarcrm[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0xa'):freshdesk[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0xb'):zoho[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0xc'):desk[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0x1b'):vtiger[_0x864430](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542);break;case _0x89ca('0x1c'):freshsales['cs'](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542,_0x864430);break;case'servicenow':servicenow['cs'](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542,_0x864430);break;case _0x89ca('0xd'):dynamics365['cs'](_0x1303ad,_0x167cd9,_0x37965e,_0x6f5d4d,_0x1c761b,_0x2e5611,_0x5ea542,_0x864430);break;default:console['log'](_0x89ca('0x1d'));}}else{_0x3e0853=require('../../../../config/logger')(_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')]());_0x3e0853[_0x89ca('0x1e')]('[EXEC]',util[_0x89ca('0x1f')](_0x89ca('0x20'),_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')](),_0x1303ad[_0x89ca('0x15')]));}}else{_0x3e0853=require('../../../../config/logger')(_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')]());_0x3e0853['error'](_0x89ca('0x21'),util[_0x89ca('0x1f')](_0x89ca('0x22'),_0x1303ad[_0x89ca('0x11')][_0x89ca('0x12')](),_0x1303ad['data2']));}}else{}}catch(_0x6ea2e5){console[_0x89ca('0x1e')](_0x6ea2e5);}}}};
\ No newline at end of file
index 7f26252..2b25804 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1d=['Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridnum',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','Subjects','Descriptions','ticketType','Task','utc','IsRecurrence','contact','endUserType','account','WhatId','Case','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','then','length','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','$or','Contact','execute','cloneDeep','additionalSearchLead','account_contact_lead','Lead','additionalSearchAccount','Account','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','<unknown>','format','LastName','Company','No\x20Company','Caller\x20-\x20%s','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','Variable','name','password','concat','securityToken','remoteUri','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname'];(function(_0x4d183d,_0x388268){var _0xf9fa89=function(_0x302c98){while(--_0x302c98){_0x4d183d['push'](_0x4d183d['shift']());}};_0xf9fa89(++_0x388268);}(_0xaf1d,0x195));var _0xdaf1=function(_0x407382,_0x526512){_0x407382=_0x407382-0x0;var _0x37670f=_0xaf1d[_0x407382];return _0x37670f;};'use strict';var _=require('lodash');var rp=require(_0xdaf1('0x0'));var moment=require(_0xdaf1('0x1'));var BPromise=require(_0xdaf1('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xdaf1('0x3'));var Redis=require(_0xdaf1('0x4'));var intUtil=require(_0xdaf1('0x5'));var config=require(_0xdaf1('0x6'));var logger=require(_0xdaf1('0x7'))(_0xdaf1('0x8'));config[_0xdaf1('0x9')]=_[_0xdaf1('0xa')](config['redis'],{'host':_0xdaf1('0xb'),'port':0x18eb});var io=require(_0xdaf1('0xc'))(new Redis(config[_0xdaf1('0x9')]));function emit(_0x1041ca,_0x3b8a0a,_0x8a965c){io['to'](_0x1041ca)[_0xdaf1('0xd')](_0x3b8a0a,_0x8a965c);}function getTicket(_0x1b8ca8,_0x20d055,_0x1e6953,_0x463b17,_0x48503e,_0x4354d9,_0x110c83,_0x56a975){var _0x47abe7=Object[_0xdaf1('0xe')]({},{'OwnerId':_0x20d055['id'],'Subject':intUtil['getString'](_0x463b17[_0xdaf1('0xf')],_0x48503e,'\x20'),'Description':intUtil['getString'](_0x463b17[_0xdaf1('0x10')],_0x48503e,'\x0a')},getCustomFields(_0x4354d9,_0x48503e));if(_0x1e6953){if(_0x463b17[_0xdaf1('0x11')]===_0xdaf1('0x12')){_0x47abe7['ActivityDate']=moment[_0xdaf1('0x13')]();_0x47abe7['IsReminderSet']=![];_0x47abe7[_0xdaf1('0x14')]=![];if(_0x1e6953['endUserType']===_0xdaf1('0x15')||_0x1e6953[_0xdaf1('0x16')]==='lead'){_0x47abe7['WhoId']=_0x1e6953['id'];}else if(_0x1e6953[_0xdaf1('0x16')]===_0xdaf1('0x17')){_0x47abe7[_0xdaf1('0x18')]=_0x1e6953['id'];}}else if(_0x463b17['ticketType']===_0xdaf1('0x19')){if(_0x1e6953['endUserType']===_0xdaf1('0x15')){_0x47abe7['ContactId']=_0x1e6953['id'];}else if(_0x1e6953[_0xdaf1('0x16')]===_0xdaf1('0x17')){_0x47abe7['AccountId']=_0x1e6953['id'];}else if(_0x1e6953['endUserType']===_0xdaf1('0x1a')&&_0x463b17[_0xdaf1('0x1b')]){_0x47abe7[_0x463b17[_0xdaf1('0x1b')]]=_0x1e6953['id'];}else{logger[_0xdaf1('0x1c')](_0xdaf1('0x1d'));}}}return _0x110c83[_0xdaf1('0x1e')](_0x463b17['ticketType'])[_0xdaf1('0x1f')](_0x47abe7);}function getUser(_0x24b810,_0x45c41c,_0x5aa545){if(!_['isNil'](_0x45c41c)&&intUtil[_0xdaf1('0x20')](_0x45c41c)){var _0xc6e568={'Email':_0x45c41c};var _0x3b8f82={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5aa545[_0xdaf1('0x1e')](_0xdaf1('0x21'))[_0xdaf1('0x22')](_0xc6e568,_0x3b8f82)['execute']()[_0xdaf1('0x23')](function(_0x13f877){if(_0x13f877[_0xdaf1('0x24')]){var _0x5ccdd2=_['find'](_0x13f877,function(_0x2d8ac5){return _0x2d8ac5['Email']===_0x45c41c;});if(_0x5ccdd2){logger[_0xdaf1('0x1c')]('Agent\x20%s\x20found.',_0x45c41c);return BPromise['resolve']({'id':_0x5ccdd2['Id'],'name':_0x5ccdd2[_0xdaf1('0x25')]});}}else{logger[_0xdaf1('0x1c')](_0xdaf1('0x26'),_0x45c41c);return _0x5aa545[_0xdaf1('0x27')]()[_0xdaf1('0x23')](function(_0x2f64ce){return BPromise['resolve']({'id':_0x2f64ce['user_id'],'name':_0x2f64ce['display_name']});});}});}else{logger['info'](_0xdaf1('0x26'),_0x45c41c);return _0x5aa545[_0xdaf1('0x27')]()['then'](function(_0xf5180b){return BPromise['resolve']({'id':_0xf5180b[_0xdaf1('0x28')],'name':_0xf5180b[_0xdaf1('0x29')]});});}}function getEndUser(_0x1d066f,_0x49bedb,_0x2ab5c8,_0x1c81a7,_0x5b3f12){var _0x3e5936={'$or':{'Phone':_0x1c81a7}};var _0x1d5064={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xdaf1('0x2a')]()[_0xdaf1('0x23')](function(){logger[_0xdaf1('0x1c')](_0xdaf1('0x2b'),_0x1c81a7,_0x49bedb[_0xdaf1('0x2c')]);switch(_0x49bedb[_0xdaf1('0x2c')]){case'contact_lead':var _0x36aca3=_['cloneDeep'](_0x3e5936);if(_0x49bedb[_0xdaf1('0x2d')]){var _0x1e02af={};_0x1e02af[_0x49bedb[_0xdaf1('0x2d')]]=_0x1c81a7;_[_0xdaf1('0x2e')](_0x36aca3[_0xdaf1('0x2f')],_0x1e02af);}return _0x5b3f12[_0xdaf1('0x1e')](_0xdaf1('0x30'))[_0xdaf1('0x22')](_0x36aca3,_0x1d5064)[_0xdaf1('0x31')]()[_0xdaf1('0x23')](function(_0x201ca4){if(_0x201ca4&&_0x201ca4[_0xdaf1('0x24')]){return _0x201ca4;}else{var _0x24ba3c=_[_0xdaf1('0x32')](_0x3e5936);if(_0x49bedb[_0xdaf1('0x33')]){var _0x57a566={};_0x57a566[_0x49bedb[_0xdaf1('0x33')]]=_0x1c81a7;_[_0xdaf1('0x2e')](_0x24ba3c[_0xdaf1('0x2f')],_0x57a566);}return _0x5b3f12[_0xdaf1('0x1e')]('Lead')[_0xdaf1('0x22')](_0x24ba3c,_0x1d5064);}});case _0xdaf1('0x34'):var _0x112aca=_['cloneDeep'](_0x3e5936);if(_0x49bedb['additionalSearchAccount']){var _0x1e02af={};_0x1e02af[_0x49bedb['additionalSearchAccount']]=_0x1c81a7;_[_0xdaf1('0x2e')](_0x112aca['$or'],_0x1e02af);}return _0x5b3f12[_0xdaf1('0x1e')]('Account')[_0xdaf1('0x22')](_0x112aca,_0x1d5064)[_0xdaf1('0x31')]()['then'](function(_0x3f1769){if(_0x3f1769&&_0x3f1769[_0xdaf1('0x24')]){return _0x3f1769;}else{var _0x42ff8f=_[_0xdaf1('0x32')](_0x3e5936);if(_0x49bedb[_0xdaf1('0x2d')]){var _0x5dbf36={};_0x5dbf36[_0x49bedb[_0xdaf1('0x2d')]]=_0x1c81a7;_[_0xdaf1('0x2e')](_0x42ff8f[_0xdaf1('0x2f')],_0x5dbf36);}return _0x5b3f12[_0xdaf1('0x1e')](_0xdaf1('0x30'))[_0xdaf1('0x22')](_0x42ff8f,_0x1d5064)[_0xdaf1('0x23')](function(_0x2c8f22){if(_0x2c8f22&&_0x2c8f22[_0xdaf1('0x24')]){return _0x2c8f22;}else{var _0x1ca3ff=_['cloneDeep'](_0x3e5936);if(_0x49bedb[_0xdaf1('0x33')]){var _0x453c45={};_0x453c45[_0x49bedb[_0xdaf1('0x33')]]=_0x1c81a7;_['merge'](_0x1ca3ff['$or'],_0x453c45);}return _0x5b3f12[_0xdaf1('0x1e')](_0xdaf1('0x35'))[_0xdaf1('0x22')](_0x1ca3ff,_0x1d5064);}});}});case'contact':var _0x36aca3=_[_0xdaf1('0x32')](_0x3e5936);if(_0x49bedb[_0xdaf1('0x2d')]){var _0x1e02af={};_0x1e02af[_0x49bedb['additionalSearchContact']]=_0x1c81a7;_['merge'](_0x36aca3[_0xdaf1('0x2f')],_0x1e02af);}return _0x5b3f12[_0xdaf1('0x1e')](_0xdaf1('0x30'))[_0xdaf1('0x22')](_0x36aca3,_0x1d5064)[_0xdaf1('0x31')]();case'lead':var _0x49a576=_[_0xdaf1('0x32')](_0x3e5936);if(_0x49bedb[_0xdaf1('0x33')]){var _0x1e02af={};_0x1e02af[_0x49bedb['additionalSearchLead']]=_0x1c81a7;_[_0xdaf1('0x2e')](_0x49a576[_0xdaf1('0x2f')],_0x1e02af);}return _0x5b3f12[_0xdaf1('0x1e')](_0xdaf1('0x35'))['find'](_0x49a576,_0x1d5064);case _0xdaf1('0x17'):var _0x112aca=_[_0xdaf1('0x32')](_0x3e5936);if(_0x49bedb['additionalSearchAccount']){var _0x1e02af={};_0x1e02af[_0x49bedb[_0xdaf1('0x36')]]=_0x1c81a7;_[_0xdaf1('0x2e')](_0x112aca[_0xdaf1('0x2f')],_0x1e02af);}return _0x5b3f12[_0xdaf1('0x1e')](_0xdaf1('0x37'))[_0xdaf1('0x22')](_0x112aca,_0x1d5064);default:return null;}})[_0xdaf1('0x23')](function(_0x1d150b){if(_0x1d150b&&_0x1d150b[_0xdaf1('0x24')]){var _0x425d38=_['first'](_0x1d150b);if(_0x425d38){return BPromise[_0xdaf1('0x2a')]({'id':_0x425d38['Id'],'name':_0x425d38['Name'],'phone':_0x425d38[_0xdaf1('0x38')],'endUserType':_0x425d38[_0xdaf1('0x39')]['type'][_0xdaf1('0x3a')]()});}}})[_0xdaf1('0x23')](function(_0x4b48bf){if(_0x4b48bf){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4b48bf[_0xdaf1('0x16')],_0x1c81a7);return BPromise[_0xdaf1('0x2a')](_0x4b48bf);}else{logger[_0xdaf1('0x1c')](_0xdaf1('0x3b'),_0x1c81a7);var _0x39161e={'Phone':_0x1c81a7};if(_0x49bedb[_0xdaf1('0x3c')]){if(_0x49bedb[_0xdaf1('0x3c')]===_0xdaf1('0x15')){logger[_0xdaf1('0x1c')](_0xdaf1('0x3d'),_0x1c81a7,_0x49bedb[_0xdaf1('0x3c')]);_0x39161e['LastName']=_0x2ab5c8!==_0xdaf1('0x3e')?_0x2ab5c8:util[_0xdaf1('0x3f')]('Caller\x20-\x20%s',_0x1c81a7);}else if(_0x49bedb['moduleCreate']===_0xdaf1('0x1a')){logger[_0xdaf1('0x1c')](_0xdaf1('0x3d'),_0x1c81a7,_0x49bedb[_0xdaf1('0x3c')]);_0x39161e[_0xdaf1('0x40')]=_0x2ab5c8!==_0xdaf1('0x3e')?_0x2ab5c8:util[_0xdaf1('0x3f')]('Caller\x20-\x20%s',_0x1c81a7);_0x39161e[_0xdaf1('0x41')]=_0xdaf1('0x42');}else if(_0x49bedb[_0xdaf1('0x3c')]===_0xdaf1('0x17')){logger[_0xdaf1('0x1c')](_0xdaf1('0x3d'),_0x1c81a7,_0x49bedb[_0xdaf1('0x3c')]);_0x39161e[_0xdaf1('0x25')]=_0x2ab5c8!=='<unknown>'?_0x2ab5c8:util[_0xdaf1('0x3f')](_0xdaf1('0x43'),_0x1c81a7);}else{return null;}}return _0x5b3f12[_0xdaf1('0x1e')](_[_0xdaf1('0x44')](_0x49bedb[_0xdaf1('0x3c')]))[_0xdaf1('0x1f')](_0x39161e)[_0xdaf1('0x23')](function(_0x43326e){return BPromise['resolve']({'id':_0x43326e['id'],'endUserType':_0x49bedb[_0xdaf1('0x3c')]});});}});}function getCustomFields(_0xf9a8e6,_0x4cfa1c){var _0x1627a6={};if(_0xf9a8e6[_0xdaf1('0x24')]>0x0){_[_0xdaf1('0x45')](_0xf9a8e6,function(_0x129d60){if(_[_0xdaf1('0x46')]([_0xdaf1('0x47'),_0xdaf1('0x48')],_0x129d60[_0xdaf1('0x49')])&&_0x129d60[_0xdaf1('0x4a')]){_0x1627a6[_0x129d60['idField']]=_0x129d60[_0xdaf1('0x4b')][_0xdaf1('0x4c')]();}else if(_0x129d60[_0xdaf1('0x49')]===_0xdaf1('0x4d')&&_0x129d60[_0xdaf1('0x4e')]&&_0x129d60['idField']){_0x4cfa1c[_0x129d60[_0xdaf1('0x4e')]]&&(_0x1627a6[_0x129d60[_0xdaf1('0x4a')]]=_0x4cfa1c[_0x129d60['variableName']][_0xdaf1('0x4c')]());}else if(_0x129d60[_0xdaf1('0x49')]==='customVariable'&&_0x129d60[_0xdaf1('0x4f')]&&_0x129d60[_0xdaf1('0x4f')][_0xdaf1('0x50')]&&_0x129d60[_0xdaf1('0x4a')]){_0x4cfa1c[_0x129d60[_0xdaf1('0x4f')][_0xdaf1('0x50')][_0xdaf1('0x3a')]()]&&(_0x1627a6[_0x129d60[_0xdaf1('0x4a')]]=_0x4cfa1c[_0x129d60[_0xdaf1('0x4f')][_0xdaf1('0x50')][_0xdaf1('0x3a')]()][_0xdaf1('0x4c')]());}});}return _0x1627a6;}function getConnection(_0x20aa44){var _0x4a3fd5=_0x20aa44[_0xdaf1('0x51')][_0xdaf1('0x52')](_0x20aa44[_0xdaf1('0x53')]);var _0x39e488=new jsforce['Connection']({'oauth2':{'loginUrl':_0x20aa44[_0xdaf1('0x54')]||'https://login.salesforce.com','clientId':_0x20aa44[_0xdaf1('0x55')],'clientSecret':_0x20aa44['clientSecret']}});return _0x39e488[_0xdaf1('0x56')](_0x20aa44[_0xdaf1('0x57')],_0x4a3fd5)[_0xdaf1('0x23')](function(){logger['info'](_0xdaf1('0x58'));return _0x39e488;});}exports[_0xdaf1('0x59')]=function(_0x163c09,_0xa0f9f2,_0x18bc4d,_0x3589da,_0x1e3fcf,_0x229fc1){var _0x2dff54,_0x1c36d1,_0x5acb86,_0x991fb4;_0x229fc1[_0xdaf1('0x5a')]=intUtil[_0xdaf1('0x5b')](_0x229fc1[_0xdaf1('0x5a')]);_0x229fc1[_0xdaf1('0x54')]=intUtil[_0xdaf1('0x5b')](_0x229fc1[_0xdaf1('0x54')]);if(_0x1e3fcf&&_0x1e3fcf[_0xdaf1('0x5c')]){logger[_0xdaf1('0x1c')](_0xdaf1('0x5d'),_0xdaf1('0x5e'));_0xa0f9f2[_0xdaf1('0x5f')]=util[_0xdaf1('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x229fc1[_0xdaf1('0x5a')],_0xa0f9f2[_0xdaf1('0x60')],md5(_0xa0f9f2[_0xdaf1('0x60')]));}else{_0xa0f9f2['recordingURL']='';}return getConnection(_0x229fc1)[_0xdaf1('0x23')](function(_0x38c339){_0x991fb4=_0x38c339;return getUser(_0x229fc1,_0x3589da[_0xdaf1('0x61')],_0x991fb4);})['then'](function(_0x7cc80d){_0x2dff54=_0x7cc80d;return getEndUser(_0x229fc1,_0x18bc4d,_0xa0f9f2[_0xdaf1('0x62')],_0xa0f9f2['calleridnum'],_0x991fb4);})['then'](function(_0x2b153e){_0x1c36d1=_0x2b153e;return getTicket(_0x229fc1,_0x2dff54,_0x1c36d1,_0x18bc4d,_0xa0f9f2,_0x18bc4d[_0xdaf1('0x63')],_0x991fb4,_0xdaf1('0x59'));})['then'](function(_0x2b4f4f){_0x5acb86=_0x2b4f4f;logger[_0xdaf1('0x1c')](_0xdaf1('0x64'),_0x5acb86['id']);logger[_0xdaf1('0x1c')](_0xdaf1('0x65'),_0x5acb86['id'],_0x3589da[_0xdaf1('0x50')],_0x229fc1[_0xdaf1('0x49')]);switch(_0x229fc1[_0xdaf1('0x49')]){case _0xdaf1('0x66'):emit(util['format'](_0xdaf1('0x67'),_0x3589da[_0xdaf1('0x50')]),_0xdaf1('0x68'),{'recordId':_0x5acb86['id']});break;case'newTab':emit(util[_0xdaf1('0x3f')](_0xdaf1('0x67'),_0x3589da[_0xdaf1('0x50')]),_0xdaf1('0x69'),{'uri':util['format']('%s/%s/e',_0x991fb4[_0xdaf1('0x6a')],_0x5acb86['id'])});break;default:logger[_0xdaf1('0x6b')](_0xdaf1('0x6c'));}})[_0xdaf1('0x6d')](function(_0x4cc5b2){logger['error'](_0xdaf1('0x5d'),_0x4cc5b2);});};exports[_0xdaf1('0x6e')]=function(_0x7736af,_0x1982fe,_0x29b6e7,_0x239f27,_0x81bdce,_0x88953f,_0x33cd66){var _0x48acb8,_0x547895,_0x2d10ad,_0x40ad5d;_0x88953f[_0xdaf1('0x5a')]=intUtil[_0xdaf1('0x5b')](_0x88953f[_0xdaf1('0x5a')]);_0x88953f[_0xdaf1('0x54')]=intUtil[_0xdaf1('0x5b')](_0x88953f['remoteUri']);if(_0x33cd66&&_0x33cd66[_0xdaf1('0x6f')]&&_0x33cd66[_0xdaf1('0x6f')]!==_0xdaf1('0x70')){logger[_0xdaf1('0x1c')](_0xdaf1('0x71'),_0xdaf1('0x5e'));_0x1982fe[_0xdaf1('0x5f')]=util['format'](_0xdaf1('0x72'),_0x88953f['serverUrl'],_0x1982fe[_0xdaf1('0x60')],md5(_0x1982fe[_0xdaf1('0x60')]));}return getConnection(_0x88953f)['then'](function(_0x4b9df8){_0x40ad5d=_0x4b9df8;return getUser(_0x88953f,_0x239f27[_0xdaf1('0x61')],_0x40ad5d);})[_0xdaf1('0x23')](function(_0x152bb9){_0x48acb8=_0x152bb9;return getEndUser(_0x88953f,_0x29b6e7,_0x1982fe[_0xdaf1('0x73')],_0x1982fe[_0xdaf1('0x74')],_0x40ad5d);})['then'](function(_0x43848f){_0x547895=_0x43848f;return getTicket(_0x88953f,_0x48acb8,_0x547895,_0x29b6e7,_0x1982fe,_0x29b6e7[_0xdaf1('0x63')],_0x40ad5d,_0xdaf1('0x6e'));})[_0xdaf1('0x23')](function(_0x5c5a74){_0x2d10ad=_0x5c5a74;logger['info'](_0xdaf1('0x75'),_0x2d10ad['id']);logger[_0xdaf1('0x1c')](_0xdaf1('0x76'),_0x2d10ad['id'],_0x239f27['name'],_0x88953f[_0xdaf1('0x49')]);switch(_0x88953f[_0xdaf1('0x49')]){case _0xdaf1('0x66'):emit(util[_0xdaf1('0x3f')](_0xdaf1('0x67'),_0x239f27[_0xdaf1('0x50')]),_0xdaf1('0x68'),{'recordId':_0x2d10ad['id']});break;case _0xdaf1('0x77'):emit(util[_0xdaf1('0x3f')](_0xdaf1('0x67'),_0x239f27['name']),_0xdaf1('0x69'),{'uri':util[_0xdaf1('0x3f')](_0xdaf1('0x78'),_0x40ad5d[_0xdaf1('0x6a')],_0x2d10ad['id'])});break;default:logger[_0xdaf1('0x6b')](_0xdaf1('0x71'),_0xdaf1('0x79'));}})[_0xdaf1('0x6d')](function(_0x522c84){logger[_0xdaf1('0x6b')](_0xdaf1('0x71'),_0x522c84);});};exports['unmanaged']=function(_0x49d8f4,_0xb24b6d,_0x476a42,_0x567147,_0x3368b5,_0x368923){var _0x4a77ad,_0x43a066,_0x30cb0e,_0x5d8017;_0x368923[_0xdaf1('0x5a')]=intUtil[_0xdaf1('0x5b')](_0x368923[_0xdaf1('0x5a')]);_0x368923[_0xdaf1('0x54')]=intUtil[_0xdaf1('0x5b')](_0x368923[_0xdaf1('0x54')]);if(_0x3368b5&&_0x3368b5[_0xdaf1('0x5c')]){logger[_0xdaf1('0x1c')]('['+_0xb24b6d[_0xdaf1('0x7a')][_0xdaf1('0x7b')]()+']',_0xdaf1('0x5e'));_0xb24b6d[_0xdaf1('0x5f')]=util[_0xdaf1('0x3f')](_0xdaf1('0x72'),_0x368923[_0xdaf1('0x5a')],_0xb24b6d['uniqueid'],md5(_0xb24b6d[_0xdaf1('0x60')]));}else{_0xb24b6d[_0xdaf1('0x5f')]='';}return getConnection(_0x368923)['then'](function(_0x48702a){_0x5d8017=_0x48702a;if(!_['isNil'](_0x567147)){return getUser(_0x368923,_0x567147[_0xdaf1('0x50')],_0x5d8017);}else{return getUser(_0x368923,null,_0x5d8017);}})['then'](function(_0x49a403){_0x4a77ad=_0x49a403;return getEndUser(_0x368923,_0x476a42,_0xb24b6d[_0xdaf1('0x62')],_0xb24b6d[_0xdaf1('0x7c')],_0x5d8017);})[_0xdaf1('0x23')](function(_0x103e6f){_0x43a066=_0x103e6f;return getTicket(_0x368923,_0x4a77ad,_0x43a066,_0x476a42,_0xb24b6d,_0x476a42['Fields'],_0x5d8017);})[_0xdaf1('0x23')](function(_0x555cf9){_0x30cb0e=_0x555cf9;logger[_0xdaf1('0x1c')]('['+_0xb24b6d[_0xdaf1('0x7a')][_0xdaf1('0x7b')]()+']\x20Ticket\x20%s\x20created.',_0x30cb0e['id']);logger[_0xdaf1('0x1c')]('['+_0xb24b6d[_0xdaf1('0x7a')][_0xdaf1('0x7b')]()+_0xdaf1('0x7d'),_0x368923[_0xdaf1('0x49')]);})['catch'](function(_0x3635be){logger[_0xdaf1('0x6b')]('['+_0xb24b6d['lastevent']['toUpperCase']()+']',_0x3635be);});};
\ No newline at end of file
+var _0x3f0a=['isNil','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','getString','Subjects','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','sobject','create','validateEmail','find','execute','Email','Agent\x20%s\x20found.','resolve','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','then','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','length','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','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','Company','No\x20Company','Name','Caller\x20-\x20%s','forEach','includes','picklist','idField','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','remoteUri','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','monitor_format','toUpperCase'];(function(_0x471ca7,_0x3a473d){var _0xed2c8e=function(_0x4ed037){while(--_0x4ed037){_0x471ca7['push'](_0x471ca7['shift']());}};_0xed2c8e(++_0x3a473d);}(_0x3f0a,0x85));var _0xa3f0=function(_0x41df26,_0x5b66f9){_0x41df26=_0x41df26-0x0;var _0x2c4ca1=_0x3f0a[_0x41df26];return _0x2c4ca1;};'use strict';var _=require(_0xa3f0('0x0'));var rp=require(_0xa3f0('0x1'));var moment=require(_0xa3f0('0x2'));var BPromise=require(_0xa3f0('0x3'));var md5=require(_0xa3f0('0x4'));var jsforce=require(_0xa3f0('0x5'));var util=require(_0xa3f0('0x6'));var Redis=require(_0xa3f0('0x7'));var intUtil=require(_0xa3f0('0x8'));var config=require(_0xa3f0('0x9'));var logger=require(_0xa3f0('0xa'))(_0xa3f0('0xb'));config[_0xa3f0('0xc')]=_[_0xa3f0('0xd')](config[_0xa3f0('0xc')],{'host':_0xa3f0('0xe'),'port':0x18eb});var io=require(_0xa3f0('0xf'))(new Redis(config['redis']));function emit(_0x812092,_0x1cd3d5,_0x47414e){io['to'](_0x812092)[_0xa3f0('0x10')](_0x1cd3d5,_0x47414e);}function getTicket(_0x4df8ed,_0x51461d,_0x12f804,_0x19c176,_0x339a00,_0xab3dc0,_0x36ca69,_0x403ca1){var _0xf55fb6=Object['assign']({},{'OwnerId':_0x51461d['id'],'Subject':intUtil[_0xa3f0('0x11')](_0x19c176[_0xa3f0('0x12')],_0x339a00,'\x20'),'Description':intUtil[_0xa3f0('0x11')](_0x19c176['Descriptions'],_0x339a00,'\x0a')},getCustomFields(_0xab3dc0,_0x339a00));if(_0x12f804){if(_0x19c176[_0xa3f0('0x13')]===_0xa3f0('0x14')){_0xf55fb6[_0xa3f0('0x15')]=moment['utc']();_0xf55fb6[_0xa3f0('0x16')]=![];_0xf55fb6[_0xa3f0('0x17')]=![];if(_0x12f804[_0xa3f0('0x18')]===_0xa3f0('0x19')||_0x12f804[_0xa3f0('0x18')]===_0xa3f0('0x1a')){_0xf55fb6[_0xa3f0('0x1b')]=_0x12f804['id'];}else if(_0x12f804['endUserType']===_0xa3f0('0x1c')){_0xf55fb6[_0xa3f0('0x1d')]=_0x12f804['id'];}}else if(_0x19c176[_0xa3f0('0x13')]===_0xa3f0('0x1e')){if(_0x12f804[_0xa3f0('0x18')]===_0xa3f0('0x19')){_0xf55fb6[_0xa3f0('0x1f')]=_0x12f804['id'];}else if(_0x12f804[_0xa3f0('0x18')]===_0xa3f0('0x1c')){_0xf55fb6[_0xa3f0('0x20')]=_0x12f804['id'];}else if(_0x12f804['endUserType']===_0xa3f0('0x1a')&&_0x19c176[_0xa3f0('0x21')]){_0xf55fb6[_0x19c176[_0xa3f0('0x21')]]=_0x12f804['id'];}else{logger[_0xa3f0('0x22')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x36ca69[_0xa3f0('0x23')](_0x19c176['ticketType'])[_0xa3f0('0x24')](_0xf55fb6);}function getUser(_0x25413f,_0xf6d896,_0x5e163d){if(!_['isNil'](_0xf6d896)&&intUtil[_0xa3f0('0x25')](_0xf6d896)){var _0x423751={'Email':_0xf6d896};var _0x553af9={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5e163d[_0xa3f0('0x23')]('User')[_0xa3f0('0x26')](_0x423751,_0x553af9)[_0xa3f0('0x27')]()['then'](function(_0x491d67){if(_0x491d67['length']){var _0x169f70=_[_0xa3f0('0x26')](_0x491d67,function(_0x3d0669){return _0x3d0669[_0xa3f0('0x28')]===_0xf6d896;});if(_0x169f70){logger[_0xa3f0('0x22')](_0xa3f0('0x29'),_0xf6d896);return BPromise[_0xa3f0('0x2a')]({'id':_0x169f70['Id'],'name':_0x169f70['Name']});}}else{logger[_0xa3f0('0x22')](_0xa3f0('0x2b'),_0xf6d896);return _0x5e163d['identity']()[_0xa3f0('0x2c')](function(_0x54d367){return BPromise[_0xa3f0('0x2a')]({'id':_0x54d367[_0xa3f0('0x2d')],'name':_0x54d367[_0xa3f0('0x2e')]});});}});}else{logger[_0xa3f0('0x22')](_0xa3f0('0x2b'),_0xf6d896);return _0x5e163d[_0xa3f0('0x2f')]()['then'](function(_0x3c444a){return BPromise['resolve']({'id':_0x3c444a[_0xa3f0('0x2d')],'name':_0x3c444a[_0xa3f0('0x2e')]});});}}function getEndUser(_0x88fb85,_0x14a25b,_0x317d6a,_0x50561d,_0x11a1f0){var _0x3121fc={'$or':{'Phone':_0x50561d}};var _0x5df72e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa3f0('0x2a')]()[_0xa3f0('0x2c')](function(){logger[_0xa3f0('0x22')](_0xa3f0('0x30'),_0x50561d,_0x14a25b[_0xa3f0('0x31')]);switch(_0x14a25b[_0xa3f0('0x31')]){case'contact_lead':var _0x14a56b=_[_0xa3f0('0x32')](_0x3121fc);if(_0x14a25b[_0xa3f0('0x33')]){var _0x3a3402={};_0x3a3402[_0x14a25b[_0xa3f0('0x33')]]=_0x50561d;_[_0xa3f0('0x34')](_0x14a56b[_0xa3f0('0x35')],_0x3a3402);}return _0x11a1f0[_0xa3f0('0x23')]('Contact')[_0xa3f0('0x26')](_0x14a56b,_0x5df72e)[_0xa3f0('0x27')]()[_0xa3f0('0x2c')](function(_0xa82676){if(_0xa82676&&_0xa82676[_0xa3f0('0x36')]){return _0xa82676;}else{var _0x130404=_[_0xa3f0('0x32')](_0x3121fc);if(_0x14a25b[_0xa3f0('0x37')]){var _0x3dcd58={};_0x3dcd58[_0x14a25b[_0xa3f0('0x37')]]=_0x50561d;_[_0xa3f0('0x34')](_0x130404[_0xa3f0('0x35')],_0x3dcd58);}return _0x11a1f0['sobject'](_0xa3f0('0x38'))[_0xa3f0('0x26')](_0x130404,_0x5df72e);}});case _0xa3f0('0x39'):var _0x3904ae=_['cloneDeep'](_0x3121fc);if(_0x14a25b[_0xa3f0('0x3a')]){var _0x3a3402={};_0x3a3402[_0x14a25b['additionalSearchAccount']]=_0x50561d;_[_0xa3f0('0x34')](_0x3904ae[_0xa3f0('0x35')],_0x3a3402);}return _0x11a1f0[_0xa3f0('0x23')](_0xa3f0('0x3b'))[_0xa3f0('0x26')](_0x3904ae,_0x5df72e)[_0xa3f0('0x27')]()[_0xa3f0('0x2c')](function(_0x38cf09){if(_0x38cf09&&_0x38cf09[_0xa3f0('0x36')]){return _0x38cf09;}else{var _0x31a6f2=_[_0xa3f0('0x32')](_0x3121fc);if(_0x14a25b[_0xa3f0('0x33')]){var _0x16c141={};_0x16c141[_0x14a25b[_0xa3f0('0x33')]]=_0x50561d;_[_0xa3f0('0x34')](_0x31a6f2[_0xa3f0('0x35')],_0x16c141);}return _0x11a1f0[_0xa3f0('0x23')](_0xa3f0('0x3c'))[_0xa3f0('0x26')](_0x31a6f2,_0x5df72e)['then'](function(_0x58986d){if(_0x58986d&&_0x58986d['length']){return _0x58986d;}else{var _0x7185=_[_0xa3f0('0x32')](_0x3121fc);if(_0x14a25b['additionalSearchLead']){var _0x32806d={};_0x32806d[_0x14a25b['additionalSearchLead']]=_0x50561d;_[_0xa3f0('0x34')](_0x7185['$or'],_0x32806d);}return _0x11a1f0[_0xa3f0('0x23')](_0xa3f0('0x38'))[_0xa3f0('0x26')](_0x7185,_0x5df72e);}});}});case _0xa3f0('0x19'):var _0x14a56b=_[_0xa3f0('0x32')](_0x3121fc);if(_0x14a25b[_0xa3f0('0x33')]){var _0x3a3402={};_0x3a3402[_0x14a25b[_0xa3f0('0x33')]]=_0x50561d;_[_0xa3f0('0x34')](_0x14a56b[_0xa3f0('0x35')],_0x3a3402);}return _0x11a1f0['sobject'](_0xa3f0('0x3c'))[_0xa3f0('0x26')](_0x14a56b,_0x5df72e)[_0xa3f0('0x27')]();case'lead':var _0x51d7ca=_['cloneDeep'](_0x3121fc);if(_0x14a25b[_0xa3f0('0x37')]){var _0x3a3402={};_0x3a3402[_0x14a25b[_0xa3f0('0x37')]]=_0x50561d;_[_0xa3f0('0x34')](_0x51d7ca['$or'],_0x3a3402);}return _0x11a1f0[_0xa3f0('0x23')](_0xa3f0('0x38'))[_0xa3f0('0x26')](_0x51d7ca,_0x5df72e);case _0xa3f0('0x1c'):var _0x3904ae=_['cloneDeep'](_0x3121fc);if(_0x14a25b[_0xa3f0('0x3a')]){var _0x3a3402={};_0x3a3402[_0x14a25b[_0xa3f0('0x3a')]]=_0x50561d;_[_0xa3f0('0x34')](_0x3904ae[_0xa3f0('0x35')],_0x3a3402);}return _0x11a1f0[_0xa3f0('0x23')](_0xa3f0('0x3b'))[_0xa3f0('0x26')](_0x3904ae,_0x5df72e);default:return null;}})[_0xa3f0('0x2c')](function(_0x387112){if(_0x387112&&_0x387112[_0xa3f0('0x36')]){var _0x540b30=_['first'](_0x387112);if(_0x540b30){return BPromise[_0xa3f0('0x2a')]({'id':_0x540b30['Id'],'name':_0x540b30['Name'],'phone':_0x540b30['Phone'],'endUserType':_0x540b30[_0xa3f0('0x3d')][_0xa3f0('0x3e')][_0xa3f0('0x3f')]()});}}})[_0xa3f0('0x2c')](function(_0x3a450e){if(_0x3a450e){logger['info'](_0xa3f0('0x40'),_0x3a450e[_0xa3f0('0x18')],_0x50561d);return BPromise[_0xa3f0('0x2a')](_0x3a450e);}else{logger[_0xa3f0('0x22')](_0xa3f0('0x41'),_0x50561d);var _0x3fcee1={'Phone':_0x50561d};if(_0x14a25b[_0xa3f0('0x42')]){if(_0x14a25b[_0xa3f0('0x42')]===_0xa3f0('0x19')){logger[_0xa3f0('0x22')](_0xa3f0('0x43'),_0x50561d,_0x14a25b['moduleCreate']);_0x3fcee1[_0xa3f0('0x44')]=_0x317d6a!==_0xa3f0('0x45')?_0x317d6a:util[_0xa3f0('0x46')]('Caller\x20-\x20%s',_0x50561d);}else if(_0x14a25b[_0xa3f0('0x42')]===_0xa3f0('0x1a')){logger[_0xa3f0('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x50561d,_0x14a25b['moduleCreate']);_0x3fcee1[_0xa3f0('0x44')]=_0x317d6a!=='<unknown>'?_0x317d6a:util[_0xa3f0('0x46')]('Caller\x20-\x20%s',_0x50561d);_0x3fcee1[_0xa3f0('0x47')]=_0xa3f0('0x48');}else if(_0x14a25b['moduleCreate']===_0xa3f0('0x1c')){logger[_0xa3f0('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x50561d,_0x14a25b[_0xa3f0('0x42')]);_0x3fcee1[_0xa3f0('0x49')]=_0x317d6a!=='<unknown>'?_0x317d6a:util[_0xa3f0('0x46')](_0xa3f0('0x4a'),_0x50561d);}else{return null;}}return _0x11a1f0[_0xa3f0('0x23')](_['upperFirst'](_0x14a25b[_0xa3f0('0x42')]))['create'](_0x3fcee1)[_0xa3f0('0x2c')](function(_0xe67323){return BPromise[_0xa3f0('0x2a')]({'id':_0xe67323['id'],'endUserType':_0x14a25b['moduleCreate']});});}});}function getCustomFields(_0x5aba28,_0x2d5ea0){var _0x1ccb93={};if(_0x5aba28[_0xa3f0('0x36')]>0x0){_[_0xa3f0('0x4b')](_0x5aba28,function(_0x20d3fe){if(_[_0xa3f0('0x4c')](['string',_0xa3f0('0x4d')],_0x20d3fe[_0xa3f0('0x3e')])&&_0x20d3fe[_0xa3f0('0x4e')]){_0x1ccb93[_0x20d3fe['idField']]=_0x20d3fe['content']['toString']();}else if(_0x20d3fe[_0xa3f0('0x3e')]===_0xa3f0('0x4f')&&_0x20d3fe[_0xa3f0('0x50')]&&_0x20d3fe[_0xa3f0('0x4e')]){_0x2d5ea0[_0x20d3fe[_0xa3f0('0x50')]]&&(_0x1ccb93[_0x20d3fe[_0xa3f0('0x4e')]]=_0x2d5ea0[_0x20d3fe[_0xa3f0('0x50')]]['toString']());}else if(_0x20d3fe[_0xa3f0('0x3e')]===_0xa3f0('0x51')&&_0x20d3fe[_0xa3f0('0x52')]&&_0x20d3fe[_0xa3f0('0x52')]['name']&&_0x20d3fe[_0xa3f0('0x4e')]){_0x2d5ea0[_0x20d3fe[_0xa3f0('0x52')]['name'][_0xa3f0('0x3f')]()]&&(_0x1ccb93[_0x20d3fe[_0xa3f0('0x4e')]]=_0x2d5ea0[_0x20d3fe[_0xa3f0('0x52')][_0xa3f0('0x53')][_0xa3f0('0x3f')]()]['toString']());}});}return _0x1ccb93;}function getConnection(_0x27ccd4){var _0x521748=_0x27ccd4['password'][_0xa3f0('0x54')](_0x27ccd4[_0xa3f0('0x55')]);var _0x2585a6=new jsforce[(_0xa3f0('0x56'))]({'oauth2':{'loginUrl':_0x27ccd4['remoteUri']||_0xa3f0('0x57'),'clientId':_0x27ccd4[_0xa3f0('0x58')],'clientSecret':_0x27ccd4[_0xa3f0('0x59')]}});return _0x2585a6[_0xa3f0('0x5a')](_0x27ccd4[_0xa3f0('0x5b')],_0x521748)[_0xa3f0('0x2c')](function(){logger[_0xa3f0('0x22')](_0xa3f0('0x5c'));return _0x2585a6;});}exports[_0xa3f0('0x5d')]=function(_0x64fa3b,_0x537a65,_0x2308db,_0x31379e,_0xe97d59,_0xb932dc){var _0x5e0969,_0x343330,_0x40f09d,_0x59e40c;_0xb932dc['serverUrl']=intUtil[_0xa3f0('0x5e')](_0xb932dc['serverUrl']);_0xb932dc[_0xa3f0('0x5f')]=intUtil[_0xa3f0('0x5e')](_0xb932dc[_0xa3f0('0x5f')]);if(_0xe97d59&&_0xe97d59['monitor_format']){logger['info']('[QUEUE]',_0xa3f0('0x60'));_0x537a65[_0xa3f0('0x61')]=util[_0xa3f0('0x46')](_0xa3f0('0x62'),_0xb932dc[_0xa3f0('0x63')],_0x537a65[_0xa3f0('0x64')],md5(_0x537a65['uniqueid']));}else{_0x537a65[_0xa3f0('0x61')]='';}return getConnection(_0xb932dc)[_0xa3f0('0x2c')](function(_0x37d25c){_0x59e40c=_0x37d25c;return getUser(_0xb932dc,_0x31379e[_0xa3f0('0x65')],_0x59e40c);})[_0xa3f0('0x2c')](function(_0x5d7202){_0x5e0969=_0x5d7202;return getEndUser(_0xb932dc,_0x2308db,_0x537a65[_0xa3f0('0x66')],_0x537a65[_0xa3f0('0x67')],_0x59e40c);})[_0xa3f0('0x2c')](function(_0x129998){_0x343330=_0x129998;return getTicket(_0xb932dc,_0x5e0969,_0x343330,_0x2308db,_0x537a65,_0x2308db[_0xa3f0('0x68')],_0x59e40c,_0xa3f0('0x5d'));})['then'](function(_0x49f6cc){_0x40f09d=_0x49f6cc;logger[_0xa3f0('0x22')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x40f09d['id']);logger[_0xa3f0('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x40f09d['id'],_0x31379e[_0xa3f0('0x53')],_0xb932dc[_0xa3f0('0x3e')]);switch(_0xb932dc[_0xa3f0('0x3e')]){case _0xa3f0('0x69'):emit(util[_0xa3f0('0x46')](_0xa3f0('0x6a'),_0x31379e[_0xa3f0('0x53')]),_0xa3f0('0x6b'),{'recordId':_0x40f09d['id']});break;case _0xa3f0('0x6c'):emit(util[_0xa3f0('0x46')](_0xa3f0('0x6a'),_0x31379e[_0xa3f0('0x53')]),_0xa3f0('0x6d'),{'uri':util[_0xa3f0('0x46')](_0xa3f0('0x6e'),_0x59e40c[_0xa3f0('0x6f')],_0x40f09d['id'])});break;default:logger[_0xa3f0('0x70')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x1dbc9e){logger[_0xa3f0('0x70')](_0xa3f0('0x71'),_0x1dbc9e);});};exports['outbound']=function(_0x2b637d,_0x56a781,_0xa8998d,_0x2a8ec2,_0x3b669d,_0x54986d,_0x6dea60){var _0x13c664,_0x5be789,_0x47a38a,_0x194686;_0x54986d[_0xa3f0('0x63')]=intUtil[_0xa3f0('0x5e')](_0x54986d['serverUrl']);_0x54986d[_0xa3f0('0x5f')]=intUtil[_0xa3f0('0x5e')](_0x54986d[_0xa3f0('0x5f')]);if(_0x6dea60&&_0x6dea60[_0xa3f0('0x72')]&&_0x6dea60['recordingFormat']!==_0xa3f0('0x73')){logger[_0xa3f0('0x22')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x56a781[_0xa3f0('0x61')]=util[_0xa3f0('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x54986d[_0xa3f0('0x63')],_0x56a781[_0xa3f0('0x64')],md5(_0x56a781['uniqueid']));}return getConnection(_0x54986d)[_0xa3f0('0x2c')](function(_0x55e67c){_0x194686=_0x55e67c;return getUser(_0x54986d,_0x2a8ec2[_0xa3f0('0x65')],_0x194686);})[_0xa3f0('0x2c')](function(_0x5a0fbf){_0x13c664=_0x5a0fbf;return getEndUser(_0x54986d,_0xa8998d,_0x56a781[_0xa3f0('0x74')],_0x56a781[_0xa3f0('0x75')],_0x194686);})[_0xa3f0('0x2c')](function(_0x3fce0e){_0x5be789=_0x3fce0e;return getTicket(_0x54986d,_0x13c664,_0x5be789,_0xa8998d,_0x56a781,_0xa8998d[_0xa3f0('0x68')],_0x194686,'outbound');})['then'](function(_0x98f51c){_0x47a38a=_0x98f51c;logger['info'](_0xa3f0('0x76'),_0x47a38a['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x47a38a['id'],_0x2a8ec2[_0xa3f0('0x53')],_0x54986d[_0xa3f0('0x3e')]);switch(_0x54986d['type']){case _0xa3f0('0x69'):emit(util[_0xa3f0('0x46')](_0xa3f0('0x6a'),_0x2a8ec2[_0xa3f0('0x53')]),'trigger:salesforce:display',{'recordId':_0x47a38a['id']});break;case'newTab':emit(util['format'](_0xa3f0('0x6a'),_0x2a8ec2['name']),_0xa3f0('0x6d'),{'uri':util[_0xa3f0('0x46')]('%s/%s/e',_0x194686['instanceUrl'],_0x47a38a['id'])});break;default:logger[_0xa3f0('0x70')](_0xa3f0('0x77'),_0xa3f0('0x78'));}})[_0xa3f0('0x79')](function(_0x327556){logger[_0xa3f0('0x70')](_0xa3f0('0x77'),_0x327556);});};exports[_0xa3f0('0x7a')]=function(_0x5bf636,_0x3a3b6f,_0x28ea91,_0x2c76c0,_0x45e2d9,_0x166982){var _0x45022e,_0x123013,_0x51cb57,_0x525ca6;_0x166982[_0xa3f0('0x63')]=intUtil['stripTrailingSlash'](_0x166982[_0xa3f0('0x63')]);_0x166982['remoteUri']=intUtil[_0xa3f0('0x5e')](_0x166982[_0xa3f0('0x5f')]);if(_0x45e2d9&&_0x45e2d9[_0xa3f0('0x7b')]){logger[_0xa3f0('0x22')]('['+_0x3a3b6f['lastevent'][_0xa3f0('0x7c')]()+']',_0xa3f0('0x60'));_0x3a3b6f[_0xa3f0('0x61')]=util[_0xa3f0('0x46')](_0xa3f0('0x62'),_0x166982[_0xa3f0('0x63')],_0x3a3b6f['uniqueid'],md5(_0x3a3b6f[_0xa3f0('0x64')]));}else{_0x3a3b6f[_0xa3f0('0x61')]='';}return getConnection(_0x166982)[_0xa3f0('0x2c')](function(_0x5087f7){_0x525ca6=_0x5087f7;if(!_[_0xa3f0('0x7d')](_0x2c76c0)){return getUser(_0x166982,_0x2c76c0[_0xa3f0('0x53')],_0x525ca6);}else{return getUser(_0x166982,null,_0x525ca6);}})[_0xa3f0('0x2c')](function(_0x1cf20f){_0x45022e=_0x1cf20f;return getEndUser(_0x166982,_0x28ea91,_0x3a3b6f[_0xa3f0('0x66')],_0x3a3b6f['calleridnum'],_0x525ca6);})[_0xa3f0('0x2c')](function(_0x336c21){_0x123013=_0x336c21;return getTicket(_0x166982,_0x45022e,_0x123013,_0x28ea91,_0x3a3b6f,_0x28ea91[_0xa3f0('0x68')],_0x525ca6);})[_0xa3f0('0x2c')](function(_0x4fca5b){_0x51cb57=_0x4fca5b;logger[_0xa3f0('0x22')]('['+_0x3a3b6f[_0xa3f0('0x7e')][_0xa3f0('0x7c')]()+_0xa3f0('0x7f'),_0x51cb57['id']);logger[_0xa3f0('0x22')]('['+_0x3a3b6f[_0xa3f0('0x7e')][_0xa3f0('0x7c')]()+_0xa3f0('0x80'),_0x166982['type']);})[_0xa3f0('0x79')](function(_0x3a326f){logger[_0xa3f0('0x70')]('['+_0x3a3b6f[_0xa3f0('0x7e')][_0xa3f0('0x7c')]()+']',_0x3a326f);});};
\ No newline at end of file
index 969ac9d..2fd064f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40cd=['recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','idField','toLowerCase','content','variable','variableName','toString','customVariable','Variable',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','name','%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','username','password','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','outbound','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x2cd420,_0x45aad7){var _0x7d4081=function(_0xe17e00){while(--_0xe17e00){_0x2cd420['push'](_0x2cd420['shift']());}};_0x7d4081(++_0x45aad7);}(_0x40cd,0xe8));var _0xd40c=function(_0x486d35,_0x106f4e){_0x486d35=_0x486d35-0x0;var _0x56d8b5=_0x40cd[_0x486d35];return _0x56d8b5;};'use strict';var _=require(_0xd40c('0x0'));var Promise=require(_0xd40c('0x1'));var rp=require('request-promise');var util=require(_0xd40c('0x2'));var md5=require(_0xd40c('0x3'));var Redis=require(_0xd40c('0x4'));var intUtil=require(_0xd40c('0x5'));var config=require(_0xd40c('0x6'));var logger=require(_0xd40c('0x7'))('servicenow');config[_0xd40c('0x8')]=_[_0xd40c('0x9')](config[_0xd40c('0x8')],{'host':_0xd40c('0xa'),'port':0x18eb});var io=require(_0xd40c('0xb'))(new Redis(config[_0xd40c('0x8')]));function getAdminUser(_0x44279c,_0x211988,_0x1faf4a,_0x5c10ed,_0x214275,_0x586a18){return new Promise(function(_0x14bec6,_0x3a8593){var _0x496998={'method':'GET','uri':_0x5c10ed+_0xd40c('0xc')+'&'+_0x214275+'&'+_0x586a18,'auth':_0x211988,'json':!![]};return rp(_0x496998)[_0xd40c('0xd')](function(_0x470a27){if(_0x470a27[_0xd40c('0xe')][_0xd40c('0xf')]>0x0){_0x1faf4a[_0xd40c('0x10')]=_0x470a27[_0xd40c('0xe')][0x0]['sys_id'];}logger[_0xd40c('0x11')]('['+[_0x44279c[_0xd40c('0x12')]()]+_0xd40c('0x13'),_0x1faf4a);_0x14bec6(_0x1faf4a);})[_0xd40c('0x14')](function(_0x2f1ed4){logger[_0xd40c('0x15')]('['+[_0x44279c[_0xd40c('0x12')]()]+']',_0x2f1ed4[_0xd40c('0x16')]);_0x3a8593(_0x2f1ed4[_0xd40c('0x16')]);});});}function getUser(_0x4a988e,_0x3d477d,_0x2ba1c2,_0x2ca236,_0x8034ef){return function(_0xcd5613){logger[_0xd40c('0x11')]('['+[_0x4a988e[_0xd40c('0x12')]()]+_0xd40c('0x17'),_0xcd5613);return new Promise(function(_0x378bf0,_0x240eb8){if(intUtil[_0xd40c('0x18')](_0xcd5613[_0xd40c('0x19')])){var _0x1f8a96={'method':_0xd40c('0x1a'),'uri':_0x2ba1c2+_0xd40c('0x1b')+_0xcd5613['userEmail']+'&'+_0x2ca236+'&'+_0x8034ef,'auth':_0x3d477d,'json':!![]};logger[_0xd40c('0x11')]('['+[_0x4a988e[_0xd40c('0x12')]()]+_0xd40c('0x1c'),_0x1f8a96);return rp(_0x1f8a96)[_0xd40c('0xd')](function(_0x46c943){logger[_0xd40c('0x11')]('['+[_0x4a988e[_0xd40c('0x12')]()]+_0xd40c('0x1d'),_0x46c943);if(_0x46c943[_0xd40c('0xe')][_0xd40c('0xf')]>0x0&&String(_0x46c943[_0xd40c('0xe')][0x0][_0xd40c('0x1e')])===_0xd40c('0x1f')){_0xcd5613[_0xd40c('0x20')]=_0x46c943[_0xd40c('0xe')][0x0][_0xd40c('0x21')];}else{_0xcd5613['userId']=_0xcd5613['adminId'];_0xcd5613[_0xd40c('0x19')]=_0xcd5613[_0xd40c('0x22')];}logger[_0xd40c('0x11')]('['+[_0x4a988e[_0xd40c('0x12')]()]+_0xd40c('0x23'),_0xcd5613);_0x378bf0(_0xcd5613);})[_0xd40c('0x14')](function(_0x47f72b){logger[_0xd40c('0x15')]('['+[_0x4a988e['toUpperCase']()]+']',_0x47f72b[_0xd40c('0x16')]);_0x240eb8(_0x47f72b[_0xd40c('0x16')]);});}else{logger['info']('['+[_0x4a988e[_0xd40c('0x12')]()]+_0xd40c('0x24'));_0xcd5613[_0xd40c('0x20')]=_0xcd5613['adminId'];_0xcd5613[_0xd40c('0x19')]=_0xcd5613[_0xd40c('0x22')];_0x378bf0(_0xcd5613);}});};}function createEndUser(_0x537f51,_0x4d3e6d,_0x53b1f7,_0x5b0e3b,_0x249d8a){logger[_0xd40c('0x11')]('['+[_0x537f51[_0xd40c('0x12')]()]+_0xd40c('0x25'),_0x53b1f7);return new Promise(function(_0x3130fb,_0x4243d1){var _0x356bed={'method':_0xd40c('0x26'),'uri':_0x5b0e3b+_0xd40c('0x27')+_0x249d8a,'body':{'user_name':_0x53b1f7['endUserNumber'],'roles':'user','first_name':_0x53b1f7[_0xd40c('0x28')],'active':_0xd40c('0x1f'),'date_format':'System','phone':_0x53b1f7['endUserNumber']},'auth':_0x4d3e6d,'json':!![]};return rp(_0x356bed)[_0xd40c('0xd')](function(_0x4bc1bb){logger['info']('['+[_0x537f51[_0xd40c('0x12')]()]+'],\x20EndUser\x20schema',_0x4bc1bb[_0xd40c('0xe')]);_0x53b1f7[_0xd40c('0x29')]=_0x4bc1bb['result']['sys_id'];_0x3130fb(_0x53b1f7);})[_0xd40c('0x14')](function(_0x56638b){logger['error']('['+[_0x537f51[_0xd40c('0x12')]()]+']',_0x56638b['message']);_0x4243d1(_0x56638b['message']);});});}function getEndUser(_0x545780,_0x1a86e8,_0x17e768,_0x3db208,_0x586b37){return function(_0x2616db){logger[_0xd40c('0x11')]('['+[_0x545780[_0xd40c('0x12')]()]+_0xd40c('0x2a'),_0x2616db);return new Promise(function(_0x2d0bc7,_0x512f31){var _0xbbb399={'method':_0xd40c('0x1a'),'uri':_0x17e768+_0xd40c('0x2b')+_0x2616db[_0xd40c('0x28')]+'&'+_0x3db208+'&'+_0x586b37,'auth':_0x1a86e8,'json':!![]};return rp(_0xbbb399)[_0xd40c('0xd')](function(_0x23b99e){if(_0x23b99e[_0xd40c('0xe')]['length']>0x0){_0x2616db[_0xd40c('0x29')]=_0x23b99e['result'][0x0]['sys_id'];logger[_0xd40c('0x11')]('['+[_0x545780[_0xd40c('0x12')]()]+'],\x20getEndUser\x20crm',_0x2616db);_0x2d0bc7(_0x2616db);}else{return createEndUser(_0x545780,_0x1a86e8,_0x2616db,_0x17e768,_0x3db208)[_0xd40c('0xd')](function(_0x36600e){logger[_0xd40c('0x11')]('['+[_0x545780[_0xd40c('0x12')]()]+_0xd40c('0x2c'),_0x36600e);_0x2d0bc7(_0x36600e);});}})[_0xd40c('0x14')](function(_0x3bbcf1){logger[_0xd40c('0x15')]('['+[_0x545780['toUpperCase']()]+']',_0x3bbcf1['message']);_0x512f31(_0x3bbcf1[_0xd40c('0x16')]);});});};}function getCustomFields(_0x465fa7,_0x5e0aad){var _0xb07b5d={};if(_0x465fa7['length']>0x0){_[_0xd40c('0x2d')](_0x465fa7,function(_0x15499e){if(_[_0xd40c('0x2e')]([_0xd40c('0x2f'),'picklist'],_0x15499e[_0xd40c('0x30')])&&_0x15499e[_0xd40c('0x31')]&&!_0x15499e[_0xd40c('0x32')]){_0xb07b5d[_0x15499e['nameField']['toLowerCase']()]=_0x15499e['content']['toString']();}else if(_[_0xd40c('0x2e')]([_0xd40c('0x2f'),'picklist'],_0x15499e[_0xd40c('0x30')])&&_0x15499e[_0xd40c('0x33')]&&_0x15499e[_0xd40c('0x32')]){_0xb07b5d[_0x15499e[_0xd40c('0x33')][_0xd40c('0x34')]()]=_0x15499e[_0xd40c('0x35')]['toString']();}else if(_0x15499e['type']===_0xd40c('0x36')&&_0x15499e['variableName']&&_0x15499e[_0xd40c('0x33')]&&_0x15499e['customField']){_0xb07b5d[_0x15499e['idField'][_0xd40c('0x34')]()]=_0x5e0aad[_0x15499e[_0xd40c('0x37')]][_0xd40c('0x38')]();}else if(_0x15499e['type']===_0xd40c('0x39')&&_0x15499e['Variable']&&_0x15499e['Variable']['name']&&_0x15499e[_0xd40c('0x33')]&&_0x15499e[_0xd40c('0x32')]){_0xb07b5d[_0x15499e['idField'][_0xd40c('0x34')]()]=_0x5e0aad[_0x15499e[_0xd40c('0x3a')]['name']['toLowerCase']()][_0xd40c('0x38')]();}});}return _0xb07b5d;}function getTicket(_0x52afe5,_0x501553,_0x4b4e5a,_0x1af6c2,_0x265ba6,_0x402e52){return function(_0x1fbf9f){logger[_0xd40c('0x11')]('['+[_0x52afe5[_0xd40c('0x12')]()]+_0xd40c('0x3b'),_0x1fbf9f);return new Promise(function(_0x3e3dba,_0x11b12f){var _0x454c3f=_0x52afe5['toLowerCase']()==='outbound'?_0x1fbf9f[_0xd40c('0x20')]:_0x1fbf9f['endUserId'];var _0x692f5f={'method':_0xd40c('0x26'),'uri':_0x4b4e5a+_0xd40c('0x3c')+'?'+_0x402e52,'body':Object[_0xd40c('0x3d')]({},{'active':_0xd40c('0x1f'),'caller_id':_0x454c3f,'assigned_to':_0x1fbf9f[_0xd40c('0x20')],'short_description':intUtil[_0xd40c('0x3e')](_0x1af6c2['Subjects'],_0x265ba6,'\x20'),'description':intUtil[_0xd40c('0x3e')](_0x1af6c2[_0xd40c('0x3f')],_0x265ba6,'\x0a')},getCustomFields(_0x1af6c2[_0xd40c('0x40')],_0x265ba6)),'auth':_0x501553,'json':!![]};return rp(_0x692f5f)[_0xd40c('0xd')](function(_0x2aa6c6){logger[_0xd40c('0x11')]('['+[_0x52afe5[_0xd40c('0x12')]()]+_0xd40c('0x41'),_0x2aa6c6[_0xd40c('0xe')]);_0x1fbf9f[_0xd40c('0x42')]=_0x2aa6c6[_0xd40c('0xe')][_0xd40c('0x21')];_0x1fbf9f[_0xd40c('0x43')]=_0x2aa6c6[_0xd40c('0xe')][_0xd40c('0x44')];logger[_0xd40c('0x11')]('['+[_0x52afe5[_0xd40c('0x12')]()]+_0xd40c('0x45'),_0x1fbf9f);_0x3e3dba(_0x1fbf9f);})[_0xd40c('0x14')](function(_0x120b3b){logger[_0xd40c('0x15')]('['+[_0x52afe5[_0xd40c('0x12')]()]+']',_0x120b3b[_0xd40c('0x16')]);_0x11b12f(_0x120b3b['message']);});});};}function createRemoteTag(_0x22188e,_0x43fc15,_0x455e3e,_0x42286b){return new Promise(function(_0x432322,_0x416a22){var _0x43743f={'method':_0xd40c('0x26'),'uri':_0x455e3e+_0xd40c('0x46')+'?'+_0x42286b,'body':{'short_description':_0x22188e,'global':!![],'active':!![],'name':_0x22188e},'auth':_0x43fc15,'json':!![]};return rp(_0x43743f)[_0xd40c('0xd')](function(_0x171710){var _0x5187d0=_0x171710[_0xd40c('0xe')][_0xd40c('0x21')];_0x432322(_0x5187d0);});});}function getRemoteTag(_0x28b855,_0x3d547f,_0x583072,_0x3cb1af,_0x4aebd0){return new Promise(function(_0xdbe3fd,_0x176832){var _0x1dd04c={'method':_0xd40c('0x1a'),'uri':_0x583072+_0xd40c('0x46')+_0xd40c('0x47')+_0x28b855+'&'+_0x3cb1af,'auth':_0x3d547f,'json':!![]};return rp(_0x1dd04c)['then'](function(_0x4f4343){if(_0x4f4343[_0xd40c('0xe')]['length']>0x0){var _0x52b090=_0x4f4343[_0xd40c('0xe')][0x0][_0xd40c('0x21')];_0xdbe3fd(_0x52b090);}else{return createRemoteTag(_0x28b855,_0x3d547f,_0x583072,_0x3cb1af)[_0xd40c('0xd')](function(_0x449da8){_0xdbe3fd(_0x449da8);});}});});}function assignTagToIncident(_0x4bee06,_0x54ef99,_0x254c48,_0xff9adb,_0x344455){return new Promise(function(_0x4403c0,_0xdf25ed){var _0x4a1453={'method':'POST','uri':_0x254c48+'label_entry'+'?'+_0x344455,'body':{'label':_0x4bee06,'table':'incident','id_type':'Incident','table_key':_0xff9adb[_0xd40c('0x42')],'title':_0xd40c('0x48')+_0xff9adb[_0xd40c('0x43')],'id_display':_0xff9adb['ticketNumber']},'auth':_0x54ef99,'json':!![]};return rp(_0x4a1453)[_0xd40c('0xd')](function(_0x51bb0e){_0x4403c0();})['catch'](function(){_0x4403c0();});});}function manageTags(_0xc52cac,_0x3de444,_0x1d4d78,_0x379c34,_0x6f89a8,_0x34410b,_0x2a9fd3){return new Promise(function(_0x382c97,_0x3ee306){var _0x37741e=[];_0x3de444[_0xd40c('0x2d')](function(_0x22418a){_0x37741e[_0xd40c('0x49')](getRemoteTag(_0x22418a,_0x1d4d78,_0x379c34,_0x34410b,_0x2a9fd3));});return Promise['all'](_0x37741e)['then'](function(_0xe2e2f5){if(_0xe2e2f5[_0xd40c('0xf')]){logger['info']('['+[_0xc52cac['toUpperCase']()]+_0xd40c('0x4a'),_0xe2e2f5);var _0x3cf923=[];_0xe2e2f5[_0xd40c('0x2d')](function(_0x40b329){_0x3cf923['push'](assignTagToIncident(_0x40b329,_0x1d4d78,_0x379c34,_0x6f89a8,_0x34410b));});return Promise[_0xd40c('0x4b')](_0x3cf923)[_0xd40c('0xd')](function(){_0x382c97();})[_0xd40c('0x14')](function(){_0x382c97();});}else{_0x382c97();}});});}function getTags(_0x44d5de,_0x48a489,_0x19c375,_0x7900a5,_0x2fe541,_0x21fdf0){return function(_0x2478c8){return new Promise(function(_0x457870,_0x542a1c){var _0x3b23ba=[];var _0x2098ea=_0x7900a5[_0xd40c('0x4c')];if(_0x2098ea&&_0x2098ea['length']>0x0){_0x3b23ba=_['map'](_0x2098ea,_0xd40c('0x4d'));}if(_0x3b23ba[_0xd40c('0xf')]>0x0){return manageTags(_0x44d5de,_0x3b23ba,_0x48a489,_0x19c375,_0x2478c8,_0x2fe541,_0x21fdf0)[_0xd40c('0xd')](function(){_0x457870(_0x2478c8);});}else{_0x457870(_0x2478c8);}});};}function emit(_0x3ca655,_0x43aeb7,_0x4559b9){var _0x40e8ad='%26sysparm_record_target%3Dincident'+_0xd40c('0x4e')+_0xd40c('0x4f')+_0xd40c('0x50');var _0x532326={'uri':_0x3ca655+_0xd40c('0x51')+_0x4559b9+_0x40e8ad};io['to'](util[_0xd40c('0x52')](_0xd40c('0x53'),_0x43aeb7))[_0xd40c('0x54')]('trigger:browser:url',_0x532326);}exports['cs']=function(_0xafe3cb,_0x1f846c,_0x3df088,_0x246a0e,_0x45d95e,_0x29c2e6,_0x4469da,_0x32d661){var _0x12c6f1={};var _0x36de8e={'user':_0x29c2e6[_0xd40c('0x55')],'pass':_0x29c2e6[_0xd40c('0x56')]};var _0x1347a4='sysparm_limit=1';var _0x243d42=_0xd40c('0x57');_0x29c2e6['remoteUri']=intUtil[_0xd40c('0x58')](_0x29c2e6[_0xd40c('0x59')]);_0x29c2e6[_0xd40c('0x5a')]=intUtil['stripTrailingSlash'](_0x29c2e6['serverUrl']);var _0xfff6e5=util['format'](_0xd40c('0x5b'),_0x29c2e6[_0xd40c('0x59')]);_0x12c6f1[_0xd40c('0x19')]=!_[_0xd40c('0x5c')](_0x246a0e)?_0x246a0e[_0xd40c('0x5d')]:null;_0x12c6f1[_0xd40c('0x22')]=_0x29c2e6[_0xd40c('0x5d')];_0x12c6f1['endUserNumber']=_0x32d661['toLowerCase']()===_0xd40c('0x5e')?_0x1f846c['destcalleridnum']:_0x1f846c[_0xd40c('0x5f')];_0x12c6f1[_0xd40c('0x60')]=_0x32d661==='queue'||_0x32d661===_0xd40c('0x61')?_0xd40c('0x62'):'outbound';var _0xc053a6=util[_0xd40c('0x52')](_0xd40c('0x63'),_0x29c2e6[_0xd40c('0x5a')],_0x1f846c[_0xd40c('0x64')],md5(_0x1f846c[_0xd40c('0x64')]));if(_0x45d95e&&_0x45d95e['monitor_format']){logger['info'](_0xd40c('0x65'),_0xd40c('0x66'));_0x1f846c[_0xd40c('0x67')]=_0xc053a6;}else if(_0x4469da&&_0x4469da[_0xd40c('0x68')]&&_0x4469da[_0xd40c('0x68')]!==_0xd40c('0x69')){logger[_0xd40c('0x11')](_0xd40c('0x6a'),'Recording\x20is\x20enabled!');_0x1f846c[_0xd40c('0x67')]=_0xc053a6;}else{_0x1f846c[_0xd40c('0x67')]='';}return getAdminUser(_0x32d661,_0x36de8e,_0x12c6f1,_0xfff6e5,_0x243d42,_0x1347a4)[_0xd40c('0xd')](getUser(_0x32d661,_0x36de8e,_0xfff6e5,_0x243d42,_0x1347a4))[_0xd40c('0xd')](getEndUser(_0x32d661,_0x36de8e,_0xfff6e5,_0x243d42,_0x1347a4))[_0xd40c('0xd')](getTicket(_0x32d661,_0x36de8e,_0xfff6e5,_0x3df088,_0x1f846c,_0x243d42))[_0xd40c('0xd')](function(_0x4cf2db){logger['info'](util['format'](_0xd40c('0x6b'),_0x4cf2db[_0xd40c('0x42')]));logger[_0xd40c('0x11')](util['format'](_0xd40c('0x6c'),_0x32d661));if(_0x32d661!==_0xd40c('0x61')){logger[_0xd40c('0x11')]('['+[_0x32d661[_0xd40c('0x12')]()]+']',_0xd40c('0x6d'));emit(_0x29c2e6[_0xd40c('0x59')],_0x246a0e[_0xd40c('0x4d')],_0x4cf2db[_0xd40c('0x42')]);}})[_0xd40c('0x14')](function(_0x50263f){logger['error']('['+[_0x32d661[_0xd40c('0x12')]()]+_0xd40c('0x6e'),util[_0xd40c('0x6f')](_0x50263f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x41ab=['inspect','lodash','bluebird','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','socket.io-emitter','GET','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','toUpperCase','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','true','userId','adminEmail','],\x20getUser\x20crm','catch','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','picklist','customField','toLowerCase','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketNumber','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','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','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x469b7d,_0x4317b0){var _0x5d4b29=function(_0x3b5210){while(--_0x3b5210){_0x469b7d['push'](_0x469b7d['shift']());}};_0x5d4b29(++_0x4317b0);}(_0x41ab,0x6e));var _0xb41a=function(_0x2f05c6,_0x42673e){_0x2f05c6=_0x2f05c6-0x0;var _0x21df7c=_0x41ab[_0x2f05c6];return _0x21df7c;};'use strict';var _=require(_0xb41a('0x0'));var Promise=require(_0xb41a('0x1'));var rp=require(_0xb41a('0x2'));var util=require('util');var md5=require(_0xb41a('0x3'));var Redis=require('ioredis');var intUtil=require(_0xb41a('0x4'));var config=require(_0xb41a('0x5'));var logger=require(_0xb41a('0x6'))(_0xb41a('0x7'));config[_0xb41a('0x8')]=_['defaults'](config[_0xb41a('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xb41a('0x9'))(new Redis(config[_0xb41a('0x8')]));function getAdminUser(_0x15d5fb,_0x4ec632,_0x334167,_0x4437ed,_0x4178fb,_0x4a7d43){return new Promise(function(_0x5e3159,_0x290710){var _0x1a0c9d={'method':_0xb41a('0xa'),'uri':_0x4437ed+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x4178fb+'&'+_0x4a7d43,'auth':_0x4ec632,'json':!![]};return rp(_0x1a0c9d)['then'](function(_0x1ddba8){if(_0x1ddba8[_0xb41a('0xb')][_0xb41a('0xc')]>0x0){_0x334167[_0xb41a('0xd')]=_0x1ddba8[_0xb41a('0xb')][0x0][_0xb41a('0xe')];}logger[_0xb41a('0xf')]('['+[_0x15d5fb['toUpperCase']()]+_0xb41a('0x10'),_0x334167);_0x5e3159(_0x334167);})['catch'](function(_0x21736d){logger['error']('['+[_0x15d5fb[_0xb41a('0x11')]()]+']',_0x21736d[_0xb41a('0x12')]);_0x290710(_0x21736d[_0xb41a('0x12')]);});});}function getUser(_0x454ca2,_0xca1e9d,_0x8799ad,_0x5a8aa3,_0x17b837){return function(_0x13cf0e){logger[_0xb41a('0xf')]('['+[_0x454ca2[_0xb41a('0x11')]()]+_0xb41a('0x13'),_0x13cf0e);return new Promise(function(_0x42dd64,_0x40de6e){if(intUtil['validateEmail'](_0x13cf0e[_0xb41a('0x14')])){var _0x412d0a={'method':_0xb41a('0xa'),'uri':_0x8799ad+_0xb41a('0x15')+_0x13cf0e[_0xb41a('0x14')]+'&'+_0x5a8aa3+'&'+_0x17b837,'auth':_0xca1e9d,'json':!![]};logger[_0xb41a('0xf')]('['+[_0x454ca2[_0xb41a('0x11')]()]+_0xb41a('0x16'),_0x412d0a);return rp(_0x412d0a)[_0xb41a('0x17')](function(_0x17dcb8){logger['info']('['+[_0x454ca2[_0xb41a('0x11')]()]+'],\x20getUser\x20entity',_0x17dcb8);if(_0x17dcb8[_0xb41a('0xb')][_0xb41a('0xc')]>0x0&&String(_0x17dcb8[_0xb41a('0xb')][0x0]['active'])===_0xb41a('0x18')){_0x13cf0e[_0xb41a('0x19')]=_0x17dcb8[_0xb41a('0xb')][0x0][_0xb41a('0xe')];}else{_0x13cf0e[_0xb41a('0x19')]=_0x13cf0e[_0xb41a('0xd')];_0x13cf0e[_0xb41a('0x14')]=_0x13cf0e[_0xb41a('0x1a')];}logger['info']('['+[_0x454ca2[_0xb41a('0x11')]()]+_0xb41a('0x1b'),_0x13cf0e);_0x42dd64(_0x13cf0e);})[_0xb41a('0x1c')](function(_0x2d90d0){logger[_0xb41a('0x1d')]('['+[_0x454ca2[_0xb41a('0x11')]()]+']',_0x2d90d0['message']);_0x40de6e(_0x2d90d0[_0xb41a('0x12')]);});}else{logger['info']('['+[_0x454ca2[_0xb41a('0x11')]()]+_0xb41a('0x1e'));_0x13cf0e['userId']=_0x13cf0e['adminId'];_0x13cf0e['userEmail']=_0x13cf0e[_0xb41a('0x1a')];_0x42dd64(_0x13cf0e);}});};}function createEndUser(_0x2394a2,_0x8657a2,_0x5c67bf,_0x1573d1,_0xc02e66){logger[_0xb41a('0xf')]('['+[_0x2394a2[_0xb41a('0x11')]()]+_0xb41a('0x1f'),_0x5c67bf);return new Promise(function(_0x421817,_0x205e17){var _0x5ee718={'method':_0xb41a('0x20'),'uri':_0x1573d1+_0xb41a('0x21')+_0xc02e66,'body':{'user_name':_0x5c67bf[_0xb41a('0x22')],'roles':_0xb41a('0x23'),'first_name':_0x5c67bf[_0xb41a('0x22')],'active':_0xb41a('0x18'),'date_format':'System','phone':_0x5c67bf[_0xb41a('0x22')]},'auth':_0x8657a2,'json':!![]};return rp(_0x5ee718)[_0xb41a('0x17')](function(_0x1d88e4){logger['info']('['+[_0x2394a2['toUpperCase']()]+_0xb41a('0x24'),_0x1d88e4[_0xb41a('0xb')]);_0x5c67bf['endUserId']=_0x1d88e4[_0xb41a('0xb')][_0xb41a('0xe')];_0x421817(_0x5c67bf);})[_0xb41a('0x1c')](function(_0x242a9e){logger[_0xb41a('0x1d')]('['+[_0x2394a2[_0xb41a('0x11')]()]+']',_0x242a9e[_0xb41a('0x12')]);_0x205e17(_0x242a9e['message']);});});}function getEndUser(_0x11ea75,_0x23fd0b,_0x8c6555,_0x3e1d32,_0x17caf2){return function(_0x58bf63){logger['info']('['+[_0x11ea75[_0xb41a('0x11')]()]+_0xb41a('0x25'),_0x58bf63);return new Promise(function(_0x5083ca,_0x2e96d7){var _0x3d02ec={'method':_0xb41a('0xa'),'uri':_0x8c6555+_0xb41a('0x26')+_0x58bf63[_0xb41a('0x22')]+'&'+_0x3e1d32+'&'+_0x17caf2,'auth':_0x23fd0b,'json':!![]};return rp(_0x3d02ec)[_0xb41a('0x17')](function(_0x49efeb){if(_0x49efeb['result'][_0xb41a('0xc')]>0x0){_0x58bf63[_0xb41a('0x27')]=_0x49efeb[_0xb41a('0xb')][0x0][_0xb41a('0xe')];logger['info']('['+[_0x11ea75[_0xb41a('0x11')]()]+_0xb41a('0x28'),_0x58bf63);_0x5083ca(_0x58bf63);}else{return createEndUser(_0x11ea75,_0x23fd0b,_0x58bf63,_0x8c6555,_0x3e1d32)['then'](function(_0x79c636){logger['info']('['+[_0x11ea75[_0xb41a('0x11')]()]+_0xb41a('0x29'),_0x79c636);_0x5083ca(_0x79c636);});}})[_0xb41a('0x1c')](function(_0x14f4c3){logger[_0xb41a('0x1d')]('['+[_0x11ea75[_0xb41a('0x11')]()]+']',_0x14f4c3[_0xb41a('0x12')]);_0x2e96d7(_0x14f4c3['message']);});});};}function getCustomFields(_0x9427cd,_0x3921e3){var _0x20e6d5={};if(_0x9427cd[_0xb41a('0xc')]>0x0){_['forEach'](_0x9427cd,function(_0x4fa67c){if(_['includes'](['string',_0xb41a('0x2a')],_0x4fa67c['type'])&&_0x4fa67c['nameField']&&!_0x4fa67c[_0xb41a('0x2b')]){_0x20e6d5[_0x4fa67c['nameField'][_0xb41a('0x2c')]()]=_0x4fa67c['content']['toString']();}else if(_['includes']([_0xb41a('0x2d'),_0xb41a('0x2a')],_0x4fa67c[_0xb41a('0x2e')])&&_0x4fa67c[_0xb41a('0x2f')]&&_0x4fa67c[_0xb41a('0x2b')]){_0x20e6d5[_0x4fa67c['idField'][_0xb41a('0x2c')]()]=_0x4fa67c[_0xb41a('0x30')][_0xb41a('0x31')]();}else if(_0x4fa67c[_0xb41a('0x2e')]===_0xb41a('0x32')&&_0x4fa67c['variableName']&&_0x4fa67c['idField']&&_0x4fa67c[_0xb41a('0x2b')]){_0x20e6d5[_0x4fa67c[_0xb41a('0x2f')]['toLowerCase']()]=_0x3921e3[_0x4fa67c[_0xb41a('0x33')]][_0xb41a('0x31')]();}else if(_0x4fa67c['type']===_0xb41a('0x34')&&_0x4fa67c[_0xb41a('0x35')]&&_0x4fa67c[_0xb41a('0x35')][_0xb41a('0x36')]&&_0x4fa67c['idField']&&_0x4fa67c['customField']){_0x20e6d5[_0x4fa67c['idField'][_0xb41a('0x2c')]()]=_0x3921e3[_0x4fa67c[_0xb41a('0x35')][_0xb41a('0x36')][_0xb41a('0x2c')]()]['toString']();}});}return _0x20e6d5;}function getTicket(_0xa6632d,_0x11e69e,_0x28dea7,_0x405b40,_0x138bc6,_0x43186b){return function(_0xccad9a){logger[_0xb41a('0xf')]('['+[_0xa6632d[_0xb41a('0x11')]()]+_0xb41a('0x37'),_0xccad9a);return new Promise(function(_0x4c2290,_0x133ef0){var _0x2eb102=_0xa6632d[_0xb41a('0x2c')]()===_0xb41a('0x38')?_0xccad9a[_0xb41a('0x19')]:_0xccad9a[_0xb41a('0x27')];var _0x450c7f={'method':_0xb41a('0x20'),'uri':_0x28dea7+_0xb41a('0x39')+'?'+_0x43186b,'body':Object[_0xb41a('0x3a')]({},{'active':_0xb41a('0x18'),'caller_id':_0x2eb102,'assigned_to':_0xccad9a[_0xb41a('0x19')],'short_description':intUtil[_0xb41a('0x3b')](_0x405b40['Subjects'],_0x138bc6,'\x20'),'description':intUtil['getString'](_0x405b40[_0xb41a('0x3c')],_0x138bc6,'\x0a')},getCustomFields(_0x405b40[_0xb41a('0x3d')],_0x138bc6)),'auth':_0x11e69e,'json':!![]};return rp(_0x450c7f)['then'](function(_0x89f8c7){logger[_0xb41a('0xf')]('['+[_0xa6632d[_0xb41a('0x11')]()]+_0xb41a('0x3e'),_0x89f8c7[_0xb41a('0xb')]);_0xccad9a[_0xb41a('0x3f')]=_0x89f8c7[_0xb41a('0xb')][_0xb41a('0xe')];_0xccad9a['ticketNumber']=_0x89f8c7[_0xb41a('0xb')][_0xb41a('0x40')];logger[_0xb41a('0xf')]('['+[_0xa6632d[_0xb41a('0x11')]()]+_0xb41a('0x41'),_0xccad9a);_0x4c2290(_0xccad9a);})[_0xb41a('0x1c')](function(_0x45f754){logger[_0xb41a('0x1d')]('['+[_0xa6632d[_0xb41a('0x11')]()]+']',_0x45f754[_0xb41a('0x12')]);_0x133ef0(_0x45f754[_0xb41a('0x12')]);});});};}function createRemoteTag(_0x483d5f,_0x1c0c90,_0x179c7a,_0x95ef04){return new Promise(function(_0xdc6fc0,_0x34662d){var _0x35ad8d={'method':'POST','uri':_0x179c7a+_0xb41a('0x42')+'?'+_0x95ef04,'body':{'short_description':_0x483d5f,'global':!![],'active':!![],'name':_0x483d5f},'auth':_0x1c0c90,'json':!![]};return rp(_0x35ad8d)[_0xb41a('0x17')](function(_0x189b78){var _0x52886c=_0x189b78[_0xb41a('0xb')][_0xb41a('0xe')];_0xdc6fc0(_0x52886c);});});}function getRemoteTag(_0x28f1e7,_0x579fc2,_0x8b2ed2,_0x22759a,_0x77fa8){return new Promise(function(_0xb15675,_0xdc7133){var _0x3504f4={'method':'GET','uri':_0x8b2ed2+_0xb41a('0x42')+_0xb41a('0x43')+_0x28f1e7+'&'+_0x22759a,'auth':_0x579fc2,'json':!![]};return rp(_0x3504f4)[_0xb41a('0x17')](function(_0x1c1f3c){if(_0x1c1f3c[_0xb41a('0xb')]['length']>0x0){var _0x130159=_0x1c1f3c[_0xb41a('0xb')][0x0][_0xb41a('0xe')];_0xb15675(_0x130159);}else{return createRemoteTag(_0x28f1e7,_0x579fc2,_0x8b2ed2,_0x22759a)[_0xb41a('0x17')](function(_0x4e463a){_0xb15675(_0x4e463a);});}});});}function assignTagToIncident(_0x170d19,_0x260568,_0x1202ff,_0xb60bb2,_0x118daa){return new Promise(function(_0x44da54,_0x56ac61){var _0x11a885={'method':_0xb41a('0x20'),'uri':_0x1202ff+_0xb41a('0x44')+'?'+_0x118daa,'body':{'label':_0x170d19,'table':_0xb41a('0x39'),'id_type':_0xb41a('0x45'),'table_key':_0xb60bb2[_0xb41a('0x3f')],'title':'Incident\x20-\x20'+_0xb60bb2['ticketNumber'],'id_display':_0xb60bb2[_0xb41a('0x46')]},'auth':_0x260568,'json':!![]};return rp(_0x11a885)[_0xb41a('0x17')](function(_0x2e3623){_0x44da54();})['catch'](function(){_0x44da54();});});}function manageTags(_0x27262a,_0x131ccf,_0x480619,_0x5d1da1,_0x5d93c2,_0x1dd6e2,_0x3d6cfa){return new Promise(function(_0x54c35a,_0x2201c8){var _0x565370=[];_0x131ccf[_0xb41a('0x47')](function(_0x1507e8){_0x565370[_0xb41a('0x48')](getRemoteTag(_0x1507e8,_0x480619,_0x5d1da1,_0x1dd6e2,_0x3d6cfa));});return Promise[_0xb41a('0x49')](_0x565370)['then'](function(_0x219228){if(_0x219228[_0xb41a('0xc')]){logger[_0xb41a('0xf')]('['+[_0x27262a[_0xb41a('0x11')]()]+_0xb41a('0x4a'),_0x219228);var _0x34b3d2=[];_0x219228[_0xb41a('0x47')](function(_0x3ca654){_0x34b3d2['push'](assignTagToIncident(_0x3ca654,_0x480619,_0x5d1da1,_0x5d93c2,_0x1dd6e2));});return Promise['all'](_0x34b3d2)[_0xb41a('0x17')](function(){_0x54c35a();})[_0xb41a('0x1c')](function(){_0x54c35a();});}else{_0x54c35a();}});});}function getTags(_0x1c45ae,_0x15e995,_0x5e1e9f,_0x1984f4,_0x3280c5,_0x3fe34c){return function(_0x552b6e){return new Promise(function(_0x24c2c2,_0x47bbe9){var _0x4642dc=[];var _0xf4af51=_0x1984f4[_0xb41a('0x4b')];if(_0xf4af51&&_0xf4af51[_0xb41a('0xc')]>0x0){_0x4642dc=_[_0xb41a('0x4c')](_0xf4af51,'name');}if(_0x4642dc['length']>0x0){return manageTags(_0x1c45ae,_0x4642dc,_0x15e995,_0x5e1e9f,_0x552b6e,_0x3280c5,_0x3fe34c)[_0xb41a('0x17')](function(){_0x24c2c2(_0x552b6e);});}else{_0x24c2c2(_0x552b6e);}});};}function emit(_0x5356c5,_0x53a836,_0x127092){var _0x1c54b8='%26sysparm_record_target%3Dincident'+_0xb41a('0x4d')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xb41a('0x4e');var _0x426f58={'uri':_0x5356c5+_0xb41a('0x4f')+_0x127092+_0x1c54b8};io['to'](util[_0xb41a('0x50')]('user:%s',_0x53a836))[_0xb41a('0x51')](_0xb41a('0x52'),_0x426f58);}exports['cs']=function(_0x292b15,_0x2ea427,_0x2e582a,_0x364fb3,_0x2cb8a6,_0x3c5c47,_0x331076,_0x18c64f){var _0x546beb={};var _0x225126={'user':_0x3c5c47[_0xb41a('0x53')],'pass':_0x3c5c47[_0xb41a('0x54')]};var _0x38c45f=_0xb41a('0x55');var _0x1da988=_0xb41a('0x56');_0x3c5c47['remoteUri']=intUtil[_0xb41a('0x57')](_0x3c5c47[_0xb41a('0x58')]);_0x3c5c47[_0xb41a('0x59')]=intUtil[_0xb41a('0x57')](_0x3c5c47['serverUrl']);var _0x2e51ff=util[_0xb41a('0x50')](_0xb41a('0x5a'),_0x3c5c47[_0xb41a('0x58')]);_0x546beb[_0xb41a('0x14')]=!_[_0xb41a('0x5b')](_0x364fb3)?_0x364fb3[_0xb41a('0x5c')]:null;_0x546beb[_0xb41a('0x1a')]=_0x3c5c47[_0xb41a('0x5c')];_0x546beb[_0xb41a('0x22')]=_0x18c64f[_0xb41a('0x2c')]()===_0xb41a('0x38')?_0x2ea427[_0xb41a('0x5d')]:_0x2ea427[_0xb41a('0x5e')];_0x546beb[_0xb41a('0x5f')]=_0x18c64f==='queue'||_0x18c64f===_0xb41a('0x60')?_0xb41a('0x61'):_0xb41a('0x38');var _0x45813b=util[_0xb41a('0x50')](_0xb41a('0x62'),_0x3c5c47[_0xb41a('0x59')],_0x2ea427[_0xb41a('0x63')],md5(_0x2ea427['uniqueid']));if(_0x2cb8a6&&_0x2cb8a6[_0xb41a('0x64')]){logger['info'](_0xb41a('0x65'),_0xb41a('0x66'));_0x2ea427[_0xb41a('0x67')]=_0x45813b;}else if(_0x331076&&_0x331076[_0xb41a('0x68')]&&_0x331076['recordingFormat']!==_0xb41a('0x69')){logger[_0xb41a('0xf')]('[OUTBOUND]',_0xb41a('0x66'));_0x2ea427[_0xb41a('0x67')]=_0x45813b;}else{_0x2ea427['recordingURL']='';}return getAdminUser(_0x18c64f,_0x225126,_0x546beb,_0x2e51ff,_0x1da988,_0x38c45f)[_0xb41a('0x17')](getUser(_0x18c64f,_0x225126,_0x2e51ff,_0x1da988,_0x38c45f))[_0xb41a('0x17')](getEndUser(_0x18c64f,_0x225126,_0x2e51ff,_0x1da988,_0x38c45f))['then'](getTicket(_0x18c64f,_0x225126,_0x2e51ff,_0x2e582a,_0x2ea427,_0x1da988))[_0xb41a('0x17')](function(_0x1ab528){logger['info'](util[_0xb41a('0x50')](_0xb41a('0x6a'),_0x1ab528[_0xb41a('0x3f')]));logger[_0xb41a('0xf')](util[_0xb41a('0x50')]('call\x20direction:\x20%s',_0x18c64f));if(_0x18c64f!==_0xb41a('0x60')){logger[_0xb41a('0xf')]('['+[_0x18c64f[_0xb41a('0x11')]()]+']',_0xb41a('0x6b'));emit(_0x3c5c47[_0xb41a('0x58')],_0x364fb3[_0xb41a('0x36')],_0x1ab528[_0xb41a('0x3f')]);}})[_0xb41a('0x1c')](function(_0x5e387e){logger[_0xb41a('0x1d')]('['+[_0x18c64f[_0xb41a('0x11')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xb41a('0x6c')](_0x5e387e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index d6ceef3..07e3376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80b0=['uri','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','user:%s','catch','unmanaged','lastevent','toUpperCase','Fields','lodash','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','Descriptions','toISOString','slice','replace','duration_hours','parent_type','Contacts','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','format','apiKey','toString','base64','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','find','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','stringify','Caller\x20-\x20%s','Enduser\x20created.','first_name','[HTTP]','map','string','customField','nameField','toLowerCase','content','type','custom_fields','push','customVariable','Variable','username','password','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','error','outbound'];(function(_0x569311,_0x122db9){var _0x1f8338=function(_0x4d3b85){while(--_0x4d3b85){_0x569311['push'](_0x569311['shift']());}};_0x1f8338(++_0x122db9);}(_0x80b0,0x83));var _0x080b=function(_0x58dc64,_0x952c6e){_0x58dc64=_0x58dc64-0x0;var _0x585a1d=_0x80b0[_0x58dc64];return _0x585a1d;};'use strict';var _=require(_0x080b('0x0'));var rp=require('request-promise');var BPromise=require(_0x080b('0x1'));var md5=require('md5');var util=require(_0x080b('0x2'));var Redis=require(_0x080b('0x3'));var intUtil=require(_0x080b('0x4'));var config=require(_0x080b('0x5'));var logger=require(_0x080b('0x6'))(_0x080b('0x7'));config[_0x080b('0x8')]=_[_0x080b('0x9')](config[_0x080b('0x8')],{'host':_0x080b('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x080b('0x8')]));var def={'method':_0x080b('0xb'),'json':!![]};function emit(_0x4abf0c,_0xaf8adf,_0x238520){io['to'](_0x4abf0c)[_0x080b('0xc')](_0xaf8adf,_0x238520);}function getTicket(_0x21e6f3,_0x31bb5d,_0x2c0c9a,_0xce5218,_0x2ac442,_0x58369c,_0x3f268a,_0x110f70){logger['info'](_0x080b('0xd'));var _0x3c1750=new Date();var _0x29fe5e=[{'name':_0x080b('0xe'),'value':intUtil[_0x080b('0xf')](_0xce5218['Subjects'],_0x2ac442,'\x20')},{'name':_0x080b('0x10'),'value':_0x31bb5d['id']},{'name':_0x080b('0x11'),'value':_0x31bb5d['id']},{'name':'description','value':intUtil[_0x080b('0xf')](_0xce5218[_0x080b('0x12')],_0x2ac442,'\x0a')},{'name':'date_start','value':_0x3c1750[_0x080b('0x13')]()[_0x080b('0x14')](0x0,0x13)[_0x080b('0x15')]('T','\x20')},{'name':_0x080b('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x2c0c9a['id']},{'name':_0x080b('0x17'),'value':_0x080b('0x18')},{'name':_0x080b('0x19'),'value':_0x2c0c9a[_0x080b('0xe')]},{'name':_0x080b('0x1a'),'value':_0x110f70}];if(_0x58369c[_0x080b('0x1b')]){_[_0x080b('0x1c')](_0x58369c,function(_0x46bb18){if(_0x2ac442[_0x46bb18[_0x080b('0x1d')]]){_0x29fe5e['push']({'name':_0x46bb18[_0x080b('0x1e')],'value':_0x2ac442[_0x46bb18[_0x080b('0x1d')]]});}});}return request({'form':{'method':_0x080b('0x1f'),'input_type':_0x080b('0x20'),'response_type':_0x080b('0x20'),'rest_data':JSON['stringify']({'session':_0x3f268a['id'],'module_name':'Calls','name_value_list':_0x29fe5e})}});}function getAuth(_0xa75475){return util[_0x080b('0x21')]('Basic\x20%s',new Buffer(_0xa75475[_0x080b('0x22')]+':X')[_0x080b('0x23')](_0x080b('0x24')));}function getServerInfo(_0xcd2cf6){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x080b('0x20'),'rest_data':JSON['stringify']({'session':_0xcd2cf6['id']})}});}function getUser(_0x1c88b8,_0x57c333,_0x1f1fe5){if(!_[_0x080b('0x25')](_0x57c333)){logger[_0x080b('0x26')](_0x080b('0x27'),_0x57c333);return request({'form':{'method':_0x080b('0x28'),'input_type':'JSON','response_type':_0x080b('0x20'),'rest_data':JSON['stringify']({'session':_0x1f1fe5['id'],'module_name':_0x080b('0x29'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x57c333),'order_by':'','offset':'0','select_fields':['id',_0x080b('0xe'),_0x080b('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x080b('0x2b')](function(_0x450eff){if(_0x450eff[_0x080b('0x2c')][_0x080b('0x1b')]){var _0x43f3d8=_['find'](_0x450eff[_0x080b('0x2c')],function(_0x1c3a49){return _0x1c3a49[_0x080b('0x2d')][_0x080b('0x2a')][_0x080b('0x2e')]===_0x57c333;});if(_0x43f3d8){logger[_0x080b('0x26')](_0x080b('0x2f'));return BPromise[_0x080b('0x30')]({'id':_0x43f3d8[_0x080b('0x2d')]['id'][_0x080b('0x2e')],'name':_0x43f3d8[_0x080b('0x2d')][_0x080b('0xe')]['value']});}}logger[_0x080b('0x26')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x080b('0x30')]({'id':_0x1f1fe5[_0x080b('0x2d')][_0x080b('0x31')][_0x080b('0x2e')],'name':_0x1f1fe5[_0x080b('0x2d')][_0x080b('0x2a')][_0x080b('0x2e')]});});}else{logger[_0x080b('0x26')](_0x080b('0x32'));return BPromise[_0x080b('0x30')]({'id':_0x1f1fe5['name_value_list']['user_id'][_0x080b('0x2e')],'name':_0x1f1fe5['name_value_list'][_0x080b('0x2a')][_0x080b('0x2e')]});}}function getEndUser(_0x599945,_0x3b29c6,_0x56676a,_0x3759a0){logger[_0x080b('0x26')](_0x080b('0x33'),_0x56676a);return request({'form':{'method':_0x080b('0x28'),'input_type':_0x080b('0x20'),'response_type':_0x080b('0x20'),'rest_data':JSON['stringify']({'session':_0x3759a0['id'],'module_name':_0x080b('0x18'),'query':util[_0x080b('0x21')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x56676a),'order_by':'','offset':'0','select_fields':['id',_0x080b('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x26e67f){if(_0x26e67f[_0x080b('0x2c')][_0x080b('0x1b')]){var _0x5b2570=_[_0x080b('0x34')](_0x26e67f[_0x080b('0x2c')],function(_0x249d5e){return _0x249d5e[_0x080b('0x2d')][_0x080b('0x35')][_0x080b('0x2e')]===_0x56676a;});if(_0x5b2570){logger[_0x080b('0x26')](_0x080b('0x36'));return BPromise[_0x080b('0x30')]({'id':_0x5b2570[_0x080b('0x2d')]['id'][_0x080b('0x2e')],'name':_0x5b2570[_0x080b('0x2d')][_0x080b('0xe')][_0x080b('0x2e')],'phone':_0x5b2570[_0x080b('0x2d')]['phone_home'][_0x080b('0x2e')]});}}else{logger[_0x080b('0x26')](_0x080b('0x37'));return request({'form':{'method':_0x080b('0x1f'),'input_type':_0x080b('0x20'),'response_type':_0x080b('0x20'),'rest_data':JSON[_0x080b('0x38')]({'session':_0x3759a0['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x3b29c6!=='<unknown>'?_0x3b29c6:util['format'](_0x080b('0x39'),_0x56676a)},{'name':_0x080b('0x35'),'value':_0x56676a}]})}})[_0x080b('0x2b')](function(_0x141896){logger[_0x080b('0x26')](_0x080b('0x3a'));return BPromise[_0x080b('0x30')]({'id':_0x141896['id'],'name':_0x141896[_0x080b('0x2c')][_0x080b('0x3b')][_0x080b('0x2e')],'phone':_0x141896['entry_list'][_0x080b('0x35')][_0x080b('0x2e')]});});}});}function request(_0x201716){logger['debug'](_0x080b('0x3c'),JSON[_0x080b('0x38')](_0x201716));return rp(_['merge'](def,_0x201716));}function getTags(_0x25822d,_0x123fd8){var _0x113ce6=[];if(_0x25822d&&_0x25822d['length']>0x0){_0x113ce6=_[_0x080b('0x3d')](_0x25822d,_0x123fd8);}return _0x113ce6;}function getCustomFields(_0x403c44,_0x4b387e){var _0x5f18d9=[];var _0xd973fd={'custom_fields':[]};if(_0x403c44[_0x080b('0x1b')]>0x0){_[_0x080b('0x1c')](_0x403c44,function(_0x59a60b){if(_0x59a60b['type']===_0x080b('0x3e')&&_0x59a60b['nameField']&&!_0x59a60b[_0x080b('0x3f')]){_0xd973fd[_0x59a60b[_0x080b('0x40')][_0x080b('0x41')]()]=_0x59a60b[_0x080b('0x42')][_0x080b('0x23')]();}else if(_0x59a60b['type']==='string'&&_0x59a60b[_0x080b('0x1e')]&&_0x59a60b[_0x080b('0x3f')]){_0xd973fd['custom_fields']['push']({'id':_0x59a60b['idField'],'value':_0x59a60b[_0x080b('0x42')]['toString']()});}else if(_0x59a60b[_0x080b('0x43')]==='variable'&&_0x59a60b[_0x080b('0x1d')]&&_0x59a60b['idField']&&_0x59a60b[_0x080b('0x3f')]){_0x4b387e[_0x59a60b[_0x080b('0x1d')]]&&_0xd973fd[_0x080b('0x44')][_0x080b('0x45')]({'id':_0x59a60b[_0x080b('0x1e')],'value':_0x4b387e[_0x59a60b[_0x080b('0x1d')]][_0x080b('0x23')]()});}else if(_0x59a60b['type']===_0x080b('0x46')&&_0x59a60b['Variable']&&_0x59a60b[_0x080b('0x47')]['name']&&_0x59a60b['idField']&&_0x59a60b['customField']){_0x4b387e[_0x59a60b[_0x080b('0x47')][_0x080b('0xe')][_0x080b('0x41')]()]&&_0xd973fd[_0x080b('0x44')][_0x080b('0x45')]({'id':_0x59a60b['idField'],'value':_0x4b387e[_0x59a60b['Variable']['name'][_0x080b('0x41')]()]['toString']()});}});}return _0xd973fd;}function getConnection(_0x3e5349){return request({'method':_0x080b('0xb'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3e5349[_0x080b('0x48')],'password':_0x3e5349[_0x080b('0x49')],'encryption':'PLAIN'},'application':_0x080b('0x4a')})}})[_0x080b('0x2b')](function(_0x3d5e28){var _0x2f9a29=_0x3d5e28;if(_0x2f9a29['id']){def['sessionID']=_0x2f9a29['id'];return BPromise[_0x080b('0x30')](_0x2f9a29);}else{throw new Error(util[_0x080b('0x21')](_0x080b('0x4b'),_0x3e5349['id']));}});}function setRelationship(_0x333ed4,_0x12e84e,_0x299ad6,_0x4b4fe2){return request({'form':{'method':'set_relationship','input_type':_0x080b('0x20'),'response_type':_0x080b('0x20'),'rest_data':JSON[_0x080b('0x38')]({'session':_0x333ed4['id'],'module_name':_0x080b('0x4c'),'module_id':_0x299ad6['id'],'link_field_name':_0x4b4fe2,'related_ids':[_0x12e84e['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x080b('0x4d')]=function(_0x3ad14a,_0x1bf98c,_0x3e3fdf,_0x2863ca,_0x546842,_0x4e65b8){var _0x1d28c0,_0x12d2db,_0x1e60ae,_0x523ad6;_0x4e65b8[_0x080b('0x4e')]=intUtil[_0x080b('0x4f')](_0x4e65b8['remoteUri']);_0x4e65b8['serverUrl']=intUtil['stripTrailingSlash'](_0x4e65b8[_0x080b('0x50')]);def['uri']=util[_0x080b('0x21')](_0x080b('0x51'),_0x4e65b8['remoteUri']);if(_0x546842&&_0x546842[_0x080b('0x52')]){logger[_0x080b('0x26')](_0x080b('0x53'),_0x080b('0x54'));_0x1bf98c['recordingURL']=util[_0x080b('0x21')](_0x080b('0x55'),_0x4e65b8[_0x080b('0x50')],_0x1bf98c[_0x080b('0x56')],md5(_0x1bf98c[_0x080b('0x56')]));}else{_0x1bf98c[_0x080b('0x57')]='';}return getConnection(_0x4e65b8)[_0x080b('0x2b')](function(_0x501d44){_0x523ad6=_0x501d44;return getUser(_0x4e65b8,_0x2863ca[_0x080b('0xe')],_0x523ad6);})['then'](function(_0xb07c79){_0x1d28c0=_0xb07c79;logger[_0x080b('0x26')]('The\x20User\x20ID\x20is:',_0x1d28c0['id']);return getEndUser(_0x4e65b8,_0x1bf98c[_0x080b('0x58')],_0x1bf98c[_0x080b('0x59')],_0x523ad6);})[_0x080b('0x2b')](function(_0x50b00a){_0x12d2db=_0x50b00a;logger['info'](_0x080b('0x5a'),_0x12d2db['id']);return getTicket(_0x4e65b8,_0x1d28c0,_0x12d2db,_0x3e3fdf,_0x1bf98c,_0x3e3fdf['Fields'],_0x523ad6,_0x080b('0x5b'));})['then'](function(_0x35daf3){_0x1e60ae=_0x35daf3;logger[_0x080b('0x26')](_0x080b('0x5c'));logger[_0x080b('0x26')](_0x080b('0x5d'),_0x1e60ae['id']);return setRelationship(_0x523ad6,_0x1d28c0,_0x1e60ae,_0x080b('0x5e'));})[_0x080b('0x2b')](function(){return setRelationship(_0x523ad6,_0x12d2db,_0x1e60ae,_0x080b('0x5f'));})[_0x080b('0x2b')](function(){return getServerInfo(_0x523ad6);})[_0x080b('0x2b')](function(_0x4ebeaf){var _0x551bb7=parseInt(_0x4ebeaf[_0x080b('0x60')][_0x080b('0x61')](0x0));var _0x4c9341=util[_0x080b('0x21')](_0x080b('0x62'),_0x4e65b8[_0x080b('0x4e')],_0x1e60ae['id']);if(_0x551bb7>0x6){_0x4c9341=util[_0x080b('0x21')](_0x080b('0x63'),_0x4e65b8[_0x080b('0x4e')],_0x1e60ae['id']);}logger[_0x080b('0x26')](_0x080b('0x53'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x080b('0x21')]('user:%s',_0x2863ca['name']),_0x080b('0x64'),{'uri':_0x4c9341});})['catch'](function(_0xce1e95){logger[_0x080b('0x65')]('[QUEUE]',JSON[_0x080b('0x38')](_0xce1e95));});};exports[_0x080b('0x66')]=function(_0x309953,_0x5088db,_0x3b2cc2,_0x442995,_0x18d6ce,_0x588120,_0x5d2047){var _0x1bef32,_0x2ec7f7,_0x242ce4,_0x578b52;_0x588120[_0x080b('0x4e')]=intUtil[_0x080b('0x4f')](_0x588120['remoteUri']);_0x588120['serverUrl']=intUtil[_0x080b('0x4f')](_0x588120[_0x080b('0x50')]);def[_0x080b('0x67')]=util[_0x080b('0x21')](_0x080b('0x51'),_0x588120[_0x080b('0x4e')]);if(_0x5d2047&&_0x5d2047['recordingFormat']&&_0x5d2047[_0x080b('0x68')]!==_0x080b('0x69')){logger[_0x080b('0x26')]('[OUTBOUND]',_0x080b('0x54'));_0x5088db[_0x080b('0x57')]=util[_0x080b('0x21')](_0x080b('0x55'),_0x588120[_0x080b('0x50')],_0x5088db[_0x080b('0x56')],md5(_0x5088db[_0x080b('0x56')]));}return getConnection(_0x588120)['then'](function(_0x4f6644){_0x578b52=_0x4f6644;return getUser(_0x588120,_0x442995[_0x080b('0xe')],_0x578b52);})[_0x080b('0x2b')](function(_0x198ba2){_0x1bef32=_0x198ba2;logger[_0x080b('0x26')](_0x080b('0x6a'),_0x1bef32['id']);return getEndUser(_0x588120,_0x5088db[_0x080b('0x6b')],_0x5088db[_0x080b('0x6c')],_0x578b52);})[_0x080b('0x2b')](function(_0x23a630){_0x2ec7f7=_0x23a630;logger[_0x080b('0x26')](_0x080b('0x5a'),_0x2ec7f7['id']);return getTicket(_0x588120,_0x1bef32,_0x2ec7f7,_0x3b2cc2,_0x5088db,_0x3b2cc2['Fields'],_0x578b52,_0x080b('0x6d'));})[_0x080b('0x2b')](function(_0x360357){_0x242ce4=_0x360357;logger[_0x080b('0x26')]('Ticket\x20created!');logger[_0x080b('0x26')]('The\x20Ticket\x20ID\x20is:',_0x242ce4['id']);return setRelationship(_0x578b52,_0x1bef32,_0x242ce4,_0x080b('0x5e'));})['then'](function(){return setRelationship(_0x578b52,_0x2ec7f7,_0x242ce4,'contacts');})['then'](function(){return getServerInfo(_0x578b52);})[_0x080b('0x2b')](function(_0x109df8){var _0x2ac459=parseInt(_0x109df8[_0x080b('0x60')][_0x080b('0x61')](0x0));var _0x573449=util[_0x080b('0x21')](_0x080b('0x62'),_0x588120['remoteUri'],_0x242ce4['id']);if(_0x2ac459>0x6){_0x573449=util[_0x080b('0x21')](_0x080b('0x63'),_0x588120[_0x080b('0x4e')],_0x242ce4['id']);}logger[_0x080b('0x26')](_0x080b('0x6e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x080b('0x21')](_0x080b('0x6f'),_0x442995[_0x080b('0xe')]),_0x080b('0x64'),{'uri':_0x573449});})[_0x080b('0x70')](function(_0x59e226){logger['error']('[OUTBOUND]',JSON[_0x080b('0x38')](_0x59e226));});};exports[_0x080b('0x71')]=function(_0x539497,_0xef44fd,_0x262e1d,_0xbc3de9,_0x4362f3,_0x2d72cd){var _0x4e2fbf,_0x353bd1,_0x41b84d,_0x52a21c;_0x2d72cd[_0x080b('0x4e')]=intUtil[_0x080b('0x4f')](_0x2d72cd[_0x080b('0x4e')]);_0x2d72cd['serverUrl']=intUtil[_0x080b('0x4f')](_0x2d72cd[_0x080b('0x50')]);def[_0x080b('0x67')]=util[_0x080b('0x21')](_0x080b('0x51'),_0x2d72cd[_0x080b('0x4e')]);if(_0x4362f3&&_0x4362f3['monitor_format']){logger['info']('['+_0xef44fd[_0x080b('0x72')][_0x080b('0x73')]()+']',_0x080b('0x54'));_0xef44fd[_0x080b('0x57')]=util[_0x080b('0x21')](_0x080b('0x55'),_0x2d72cd['serverUrl'],_0xef44fd[_0x080b('0x56')],md5(_0xef44fd['uniqueid']));}else{_0xef44fd[_0x080b('0x57')]='';}return getConnection(_0x2d72cd)[_0x080b('0x2b')](function(_0x42d405){_0x52a21c=_0x42d405;if(!_[_0x080b('0x25')](_0xbc3de9)){return getUser(_0x2d72cd,_0xbc3de9[_0x080b('0xe')],_0x52a21c);}else{return getUser(_0x2d72cd,null,_0x52a21c);}})[_0x080b('0x2b')](function(_0x3fae40){_0x4e2fbf=_0x3fae40;logger[_0x080b('0x26')](_0x080b('0x6a'),_0x4e2fbf['id']);return getEndUser(_0x2d72cd,_0xef44fd[_0x080b('0x58')],_0xef44fd['calleridnum'],_0x52a21c);})[_0x080b('0x2b')](function(_0x131c8d){_0x353bd1=_0x131c8d;logger['info'](_0x080b('0x5a'),_0x353bd1['id']);return getTicket(_0x2d72cd,_0x4e2fbf,_0x353bd1,_0x262e1d,_0xef44fd,_0x262e1d[_0x080b('0x74')],_0x52a21c,_0x080b('0x5b'));})[_0x080b('0x2b')](function(_0x2fd986){_0x41b84d=_0x2fd986;logger[_0x080b('0x26')](_0x080b('0x5c'));logger[_0x080b('0x26')](_0x080b('0x5d'),_0x41b84d['id']);return setRelationship(_0x52a21c,_0x4e2fbf,_0x41b84d,_0x080b('0x5e'));})['then'](function(){return setRelationship(_0x52a21c,_0x353bd1,_0x41b84d,_0x080b('0x5f'));})['then'](function(){return getServerInfo(_0x52a21c);})['catch'](function(_0x4e8e73){logger[_0x080b('0x65')]('['+_0xef44fd[_0x080b('0x72')][_0x080b('0x73')]()+']',JSON[_0x080b('0x38')](_0x4e8e73));});};
\ No newline at end of file
+var _0xbc73=['../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','emit','info','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','name','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','apiKey','base64','get_server_info','Getting\x20agent\x20with\x20name','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!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Caller\x20-\x20%s','Enduser\x20created.','map','type','string','nameField','customField','toLowerCase','content','custom_fields','toString','variable','idField','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','stripTrailingSlash','Recording\x20is\x20enabled!','destcalleridnum','Outbound','contacts','charAt','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase','isNil','The\x20User\x20ID\x20is:','calleridnum','catch','lodash','request-promise','bluebird','md5','util','ioredis','./util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbc73,0xe9));var _0x3bc7=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0xbc73[_0xa9eaa0];return _0x30897a;};'use strict';var _=require(_0x3bc7('0x0'));var rp=require(_0x3bc7('0x1'));var BPromise=require(_0x3bc7('0x2'));var md5=require(_0x3bc7('0x3'));var util=require(_0x3bc7('0x4'));var Redis=require(_0x3bc7('0x5'));var intUtil=require(_0x3bc7('0x6'));var config=require('../../../../config/environment');var logger=require(_0x3bc7('0x7'))(_0x3bc7('0x8'));config[_0x3bc7('0x9')]=_[_0x3bc7('0xa')](config[_0x3bc7('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3bc7('0xb'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x4ac737,_0x79dd87,_0x432476){io['to'](_0x4ac737)[_0x3bc7('0xc')](_0x79dd87,_0x432476);}function getTicket(_0x2134e2,_0x53e9bd,_0x172422,_0x597fbb,_0xc8ea6f,_0x1730ad,_0x3a3f07,_0x224e85){logger[_0x3bc7('0xd')]('Creating\x20new\x20ticket...');var _0x4574f6=new Date();var _0x3d7437=[{'name':'name','value':intUtil[_0x3bc7('0xe')](_0x597fbb[_0x3bc7('0xf')],_0xc8ea6f,'\x20')},{'name':_0x3bc7('0x10'),'value':_0x53e9bd['id']},{'name':_0x3bc7('0x11'),'value':_0x53e9bd['id']},{'name':_0x3bc7('0x12'),'value':intUtil[_0x3bc7('0xe')](_0x597fbb[_0x3bc7('0x13')],_0xc8ea6f,'\x0a')},{'name':_0x3bc7('0x14'),'value':_0x4574f6[_0x3bc7('0x15')]()[_0x3bc7('0x16')](0x0,0x13)[_0x3bc7('0x17')]('T','\x20')},{'name':_0x3bc7('0x18'),'value':'0'},{'name':_0x3bc7('0x19'),'value':'15'},{'name':_0x3bc7('0x1a'),'value':_0x172422['id']},{'name':_0x3bc7('0x1b'),'value':_0x3bc7('0x1c')},{'name':'parent_name','value':_0x172422[_0x3bc7('0x1d')]},{'name':_0x3bc7('0x1e'),'value':_0x224e85}];if(_0x1730ad[_0x3bc7('0x1f')]){_[_0x3bc7('0x20')](_0x1730ad,function(_0x4201ac){if(_0xc8ea6f[_0x4201ac[_0x3bc7('0x21')]]){_0x3d7437[_0x3bc7('0x22')]({'name':_0x4201ac['idField'],'value':_0xc8ea6f[_0x4201ac['variableName']]});}});}return request({'form':{'method':_0x3bc7('0x23'),'input_type':'JSON','response_type':_0x3bc7('0x24'),'rest_data':JSON[_0x3bc7('0x25')]({'session':_0x3a3f07['id'],'module_name':_0x3bc7('0x26'),'name_value_list':_0x3d7437})}});}function getAuth(_0x3ce4a0){return util[_0x3bc7('0x27')]('Basic\x20%s',new Buffer(_0x3ce4a0[_0x3bc7('0x28')]+':X')['toString'](_0x3bc7('0x29')));}function getServerInfo(_0x219c83){return request({'form':{'method':_0x3bc7('0x2a'),'input_type':_0x3bc7('0x24'),'response_type':_0x3bc7('0x24'),'rest_data':JSON[_0x3bc7('0x25')]({'session':_0x219c83['id']})}});}function getUser(_0x13b367,_0x446b1f,_0x28649a){if(!_['isNil'](_0x446b1f)){logger[_0x3bc7('0xd')](_0x3bc7('0x2b'),_0x446b1f);return request({'form':{'method':'get_entry_list','input_type':_0x3bc7('0x24'),'response_type':_0x3bc7('0x24'),'rest_data':JSON['stringify']({'session':_0x28649a['id'],'module_name':_0x3bc7('0x2c'),'query':util[_0x3bc7('0x27')](_0x3bc7('0x2d'),_0x446b1f),'order_by':'','offset':'0','select_fields':['id',_0x3bc7('0x1d'),_0x3bc7('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3bc7('0x2f')](function(_0xd3ac67){if(_0xd3ac67[_0x3bc7('0x30')]['length']){var _0xf35c1=_[_0x3bc7('0x31')](_0xd3ac67[_0x3bc7('0x30')],function(_0x47607f){return _0x47607f[_0x3bc7('0x32')][_0x3bc7('0x2e')][_0x3bc7('0x33')]===_0x446b1f;});if(_0xf35c1){logger['info'](_0x3bc7('0x34'));return BPromise[_0x3bc7('0x35')]({'id':_0xf35c1[_0x3bc7('0x32')]['id']['value'],'name':_0xf35c1['name_value_list'][_0x3bc7('0x1d')][_0x3bc7('0x33')]});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3bc7('0x35')]({'id':_0x28649a[_0x3bc7('0x32')][_0x3bc7('0x36')][_0x3bc7('0x33')],'name':_0x28649a[_0x3bc7('0x32')][_0x3bc7('0x2e')]['value']});});}else{logger[_0x3bc7('0xd')](_0x3bc7('0x37'));return BPromise[_0x3bc7('0x35')]({'id':_0x28649a[_0x3bc7('0x32')][_0x3bc7('0x36')][_0x3bc7('0x33')],'name':_0x28649a[_0x3bc7('0x32')]['user_name'][_0x3bc7('0x33')]});}}function getEndUser(_0x45aa8f,_0x1e879b,_0x43cd89,_0x1a8353){logger[_0x3bc7('0xd')](_0x3bc7('0x38'),_0x43cd89);return request({'form':{'method':_0x3bc7('0x39'),'input_type':_0x3bc7('0x24'),'response_type':_0x3bc7('0x24'),'rest_data':JSON[_0x3bc7('0x25')]({'session':_0x1a8353['id'],'module_name':_0x3bc7('0x1c'),'query':util[_0x3bc7('0x27')](_0x3bc7('0x3a'),_0x43cd89),'order_by':'','offset':'0','select_fields':['id',_0x3bc7('0x1d'),_0x3bc7('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3bc7('0x2f')](function(_0x1fd201){if(_0x1fd201[_0x3bc7('0x30')][_0x3bc7('0x1f')]){var _0x28400b=_[_0x3bc7('0x31')](_0x1fd201[_0x3bc7('0x30')],function(_0x58134a){return _0x58134a['name_value_list'][_0x3bc7('0x3b')][_0x3bc7('0x33')]===_0x43cd89;});if(_0x28400b){logger[_0x3bc7('0xd')](_0x3bc7('0x3c'));return BPromise[_0x3bc7('0x35')]({'id':_0x28400b[_0x3bc7('0x32')]['id']['value'],'name':_0x28400b[_0x3bc7('0x32')][_0x3bc7('0x1d')]['value'],'phone':_0x28400b[_0x3bc7('0x32')]['phone_home']['value']});}}else{logger[_0x3bc7('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x3bc7('0x23'),'input_type':_0x3bc7('0x24'),'response_type':_0x3bc7('0x24'),'rest_data':JSON[_0x3bc7('0x25')]({'session':_0x1a8353['id'],'module_name':_0x3bc7('0x1c'),'name_value_list':[{'name':'first_name','value':_0x1e879b!=='<unknown>'?_0x1e879b:util[_0x3bc7('0x27')](_0x3bc7('0x3d'),_0x43cd89)},{'name':_0x3bc7('0x3b'),'value':_0x43cd89}]})}})['then'](function(_0x4bf0c5){logger[_0x3bc7('0xd')](_0x3bc7('0x3e'));return BPromise[_0x3bc7('0x35')]({'id':_0x4bf0c5['id'],'name':_0x4bf0c5['entry_list']['first_name'][_0x3bc7('0x33')],'phone':_0x4bf0c5[_0x3bc7('0x30')][_0x3bc7('0x3b')][_0x3bc7('0x33')]});});}});}function request(_0x1a808e){logger['debug']('[HTTP]',JSON[_0x3bc7('0x25')](_0x1a808e));return rp(_['merge'](def,_0x1a808e));}function getTags(_0x490970,_0x1236b5){var _0xe24f8c=[];if(_0x490970&&_0x490970[_0x3bc7('0x1f')]>0x0){_0xe24f8c=_[_0x3bc7('0x3f')](_0x490970,_0x1236b5);}return _0xe24f8c;}function getCustomFields(_0x1155b4,_0xff7f8c){var _0x58f45c=[];var _0x17be46={'custom_fields':[]};if(_0x1155b4[_0x3bc7('0x1f')]>0x0){_[_0x3bc7('0x20')](_0x1155b4,function(_0x5a66a8){if(_0x5a66a8[_0x3bc7('0x40')]===_0x3bc7('0x41')&&_0x5a66a8[_0x3bc7('0x42')]&&!_0x5a66a8[_0x3bc7('0x43')]){_0x17be46[_0x5a66a8[_0x3bc7('0x42')][_0x3bc7('0x44')]()]=_0x5a66a8[_0x3bc7('0x45')]['toString']();}else if(_0x5a66a8[_0x3bc7('0x40')]===_0x3bc7('0x41')&&_0x5a66a8['idField']&&_0x5a66a8[_0x3bc7('0x43')]){_0x17be46[_0x3bc7('0x46')][_0x3bc7('0x22')]({'id':_0x5a66a8['idField'],'value':_0x5a66a8[_0x3bc7('0x45')][_0x3bc7('0x47')]()});}else if(_0x5a66a8[_0x3bc7('0x40')]===_0x3bc7('0x48')&&_0x5a66a8[_0x3bc7('0x21')]&&_0x5a66a8['idField']&&_0x5a66a8[_0x3bc7('0x43')]){_0xff7f8c[_0x5a66a8[_0x3bc7('0x21')]]&&_0x17be46['custom_fields'][_0x3bc7('0x22')]({'id':_0x5a66a8[_0x3bc7('0x49')],'value':_0xff7f8c[_0x5a66a8[_0x3bc7('0x21')]][_0x3bc7('0x47')]()});}else if(_0x5a66a8[_0x3bc7('0x40')]===_0x3bc7('0x4a')&&_0x5a66a8[_0x3bc7('0x4b')]&&_0x5a66a8[_0x3bc7('0x4b')]['name']&&_0x5a66a8['idField']&&_0x5a66a8[_0x3bc7('0x43')]){_0xff7f8c[_0x5a66a8['Variable']['name'][_0x3bc7('0x44')]()]&&_0x17be46[_0x3bc7('0x46')][_0x3bc7('0x22')]({'id':_0x5a66a8[_0x3bc7('0x49')],'value':_0xff7f8c[_0x5a66a8[_0x3bc7('0x4b')][_0x3bc7('0x1d')]['toLowerCase']()][_0x3bc7('0x47')]()});}});}return _0x17be46;}function getConnection(_0x167ad0){return request({'method':'POST','form':{'method':'login','input_type':_0x3bc7('0x24'),'response_type':_0x3bc7('0x24'),'rest_data':JSON[_0x3bc7('0x25')]({'user_auth':{'user_name':_0x167ad0[_0x3bc7('0x4c')],'password':_0x167ad0[_0x3bc7('0x4d')],'encryption':_0x3bc7('0x4e')},'application':_0x3bc7('0x4f')})}})['then'](function(_0xfd8d35){var _0x2a4ee0=_0xfd8d35;if(_0x2a4ee0['id']){def[_0x3bc7('0x50')]=_0x2a4ee0['id'];return BPromise[_0x3bc7('0x35')](_0x2a4ee0);}else{throw new Error(util['format'](_0x3bc7('0x51'),_0x167ad0['id']));}});}function setRelationship(_0x1ed4da,_0x23afd3,_0xb110e3,_0x13479a){return request({'form':{'method':'set_relationship','input_type':_0x3bc7('0x24'),'response_type':'JSON','rest_data':JSON[_0x3bc7('0x25')]({'session':_0x1ed4da['id'],'module_name':'Calls','module_id':_0xb110e3['id'],'link_field_name':_0x13479a,'related_ids':[_0x23afd3['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x5d14b8,_0x65eae9,_0x480a01,_0x1dfeda,_0x4b5164,_0x2d826d){var _0x25035b,_0x21afad,_0x26b9ee,_0x334fed;_0x2d826d['remoteUri']=intUtil['stripTrailingSlash'](_0x2d826d[_0x3bc7('0x52')]);_0x2d826d['serverUrl']=intUtil['stripTrailingSlash'](_0x2d826d[_0x3bc7('0x53')]);def[_0x3bc7('0x54')]=util[_0x3bc7('0x27')](_0x3bc7('0x55'),_0x2d826d[_0x3bc7('0x52')]);if(_0x4b5164&&_0x4b5164['monitor_format']){logger[_0x3bc7('0xd')](_0x3bc7('0x56'),'Recording\x20is\x20enabled!');_0x65eae9['recordingURL']=util[_0x3bc7('0x27')](_0x3bc7('0x57'),_0x2d826d[_0x3bc7('0x53')],_0x65eae9[_0x3bc7('0x58')],md5(_0x65eae9[_0x3bc7('0x58')]));}else{_0x65eae9[_0x3bc7('0x59')]='';}return getConnection(_0x2d826d)['then'](function(_0x424aa7){_0x334fed=_0x424aa7;return getUser(_0x2d826d,_0x1dfeda[_0x3bc7('0x1d')],_0x334fed);})[_0x3bc7('0x2f')](function(_0xbf16fb){_0x25035b=_0xbf16fb;logger[_0x3bc7('0xd')]('The\x20User\x20ID\x20is:',_0x25035b['id']);return getEndUser(_0x2d826d,_0x65eae9[_0x3bc7('0x5a')],_0x65eae9['calleridnum'],_0x334fed);})[_0x3bc7('0x2f')](function(_0x33f5be){_0x21afad=_0x33f5be;logger[_0x3bc7('0xd')](_0x3bc7('0x5b'),_0x21afad['id']);return getTicket(_0x2d826d,_0x25035b,_0x21afad,_0x480a01,_0x65eae9,_0x480a01[_0x3bc7('0x5c')],_0x334fed,_0x3bc7('0x5d'));})['then'](function(_0x49757b){_0x26b9ee=_0x49757b;logger[_0x3bc7('0xd')](_0x3bc7('0x5e'));logger['info'](_0x3bc7('0x5f'),_0x26b9ee['id']);return setRelationship(_0x334fed,_0x25035b,_0x26b9ee,_0x3bc7('0x60'));})['then'](function(){return setRelationship(_0x334fed,_0x21afad,_0x26b9ee,'contacts');})[_0x3bc7('0x2f')](function(){return getServerInfo(_0x334fed);})[_0x3bc7('0x2f')](function(_0x53eb4e){var _0xa667ab=parseInt(_0x53eb4e[_0x3bc7('0x61')]['charAt'](0x0));var _0x38a742=util[_0x3bc7('0x27')](_0x3bc7('0x62'),_0x2d826d[_0x3bc7('0x52')],_0x26b9ee['id']);if(_0xa667ab>0x6){_0x38a742=util['format'](_0x3bc7('0x63'),_0x2d826d['remoteUri'],_0x26b9ee['id']);}logger['info'](_0x3bc7('0x56'),_0x3bc7('0x64'));emit(util[_0x3bc7('0x27')](_0x3bc7('0x65'),_0x1dfeda['name']),_0x3bc7('0x66'),{'uri':_0x38a742});})['catch'](function(_0x1a9b68){logger[_0x3bc7('0x67')](_0x3bc7('0x56'),JSON['stringify'](_0x1a9b68));});};exports[_0x3bc7('0x68')]=function(_0x3697b9,_0x1786d4,_0x55d9aa,_0x5e722a,_0x27a8f8,_0x366e6d,_0x618e1f){var _0xcae909,_0x3ec050,_0x5d9531,_0x44936e;_0x366e6d[_0x3bc7('0x52')]=intUtil[_0x3bc7('0x69')](_0x366e6d[_0x3bc7('0x52')]);_0x366e6d[_0x3bc7('0x53')]=intUtil[_0x3bc7('0x69')](_0x366e6d[_0x3bc7('0x53')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x366e6d[_0x3bc7('0x52')]);if(_0x618e1f&&_0x618e1f['recordingFormat']&&_0x618e1f['recordingFormat']!=='none'){logger[_0x3bc7('0xd')]('[OUTBOUND]',_0x3bc7('0x6a'));_0x1786d4['recordingURL']=util[_0x3bc7('0x27')](_0x3bc7('0x57'),_0x366e6d[_0x3bc7('0x53')],_0x1786d4[_0x3bc7('0x58')],md5(_0x1786d4[_0x3bc7('0x58')]));}return getConnection(_0x366e6d)[_0x3bc7('0x2f')](function(_0x93b9e8){_0x44936e=_0x93b9e8;return getUser(_0x366e6d,_0x5e722a[_0x3bc7('0x1d')],_0x44936e);})[_0x3bc7('0x2f')](function(_0x2078a2){_0xcae909=_0x2078a2;logger['info']('The\x20User\x20ID\x20is:',_0xcae909['id']);return getEndUser(_0x366e6d,_0x1786d4['destcalleridname'],_0x1786d4[_0x3bc7('0x6b')],_0x44936e);})['then'](function(_0x1d0517){_0x3ec050=_0x1d0517;logger[_0x3bc7('0xd')](_0x3bc7('0x5b'),_0x3ec050['id']);return getTicket(_0x366e6d,_0xcae909,_0x3ec050,_0x55d9aa,_0x1786d4,_0x55d9aa[_0x3bc7('0x5c')],_0x44936e,_0x3bc7('0x6c'));})[_0x3bc7('0x2f')](function(_0x1aed8c){_0x5d9531=_0x1aed8c;logger[_0x3bc7('0xd')]('Ticket\x20created!');logger[_0x3bc7('0xd')](_0x3bc7('0x5f'),_0x5d9531['id']);return setRelationship(_0x44936e,_0xcae909,_0x5d9531,_0x3bc7('0x60'));})[_0x3bc7('0x2f')](function(){return setRelationship(_0x44936e,_0x3ec050,_0x5d9531,_0x3bc7('0x6d'));})[_0x3bc7('0x2f')](function(){return getServerInfo(_0x44936e);})[_0x3bc7('0x2f')](function(_0x507a89){var _0x2af62e=parseInt(_0x507a89[_0x3bc7('0x61')][_0x3bc7('0x6e')](0x0));var _0x1c3db1=util['format'](_0x3bc7('0x62'),_0x366e6d[_0x3bc7('0x52')],_0x5d9531['id']);if(_0x2af62e>0x6){_0x1c3db1=util[_0x3bc7('0x27')](_0x3bc7('0x63'),_0x366e6d['remoteUri'],_0x5d9531['id']);}logger[_0x3bc7('0xd')](_0x3bc7('0x6f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x3bc7('0x65'),_0x5e722a['name']),_0x3bc7('0x66'),{'uri':_0x1c3db1});})['catch'](function(_0x199fb){logger[_0x3bc7('0x67')](_0x3bc7('0x6f'),JSON[_0x3bc7('0x25')](_0x199fb));});};exports[_0x3bc7('0x70')]=function(_0x709585,_0x423e67,_0x4746c2,_0x277435,_0x3c0c99,_0x147a77){var _0x351b60,_0x3aad9f,_0x5e8c58,_0x449700;_0x147a77[_0x3bc7('0x52')]=intUtil[_0x3bc7('0x69')](_0x147a77[_0x3bc7('0x52')]);_0x147a77[_0x3bc7('0x53')]=intUtil[_0x3bc7('0x69')](_0x147a77[_0x3bc7('0x53')]);def['uri']=util[_0x3bc7('0x27')](_0x3bc7('0x55'),_0x147a77[_0x3bc7('0x52')]);if(_0x3c0c99&&_0x3c0c99[_0x3bc7('0x71')]){logger[_0x3bc7('0xd')]('['+_0x423e67[_0x3bc7('0x72')][_0x3bc7('0x73')]()+']',_0x3bc7('0x6a'));_0x423e67[_0x3bc7('0x59')]=util['format'](_0x3bc7('0x57'),_0x147a77[_0x3bc7('0x53')],_0x423e67[_0x3bc7('0x58')],md5(_0x423e67['uniqueid']));}else{_0x423e67[_0x3bc7('0x59')]='';}return getConnection(_0x147a77)[_0x3bc7('0x2f')](function(_0x4d7d5d){_0x449700=_0x4d7d5d;if(!_[_0x3bc7('0x74')](_0x277435)){return getUser(_0x147a77,_0x277435['name'],_0x449700);}else{return getUser(_0x147a77,null,_0x449700);}})[_0x3bc7('0x2f')](function(_0x23c14c){_0x351b60=_0x23c14c;logger['info'](_0x3bc7('0x75'),_0x351b60['id']);return getEndUser(_0x147a77,_0x423e67[_0x3bc7('0x5a')],_0x423e67[_0x3bc7('0x76')],_0x449700);})[_0x3bc7('0x2f')](function(_0x2ccf81){_0x3aad9f=_0x2ccf81;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3aad9f['id']);return getTicket(_0x147a77,_0x351b60,_0x3aad9f,_0x4746c2,_0x423e67,_0x4746c2[_0x3bc7('0x5c')],_0x449700,_0x3bc7('0x5d'));})[_0x3bc7('0x2f')](function(_0x5c7116){_0x5e8c58=_0x5c7116;logger['info']('Ticket\x20created!');logger['info'](_0x3bc7('0x5f'),_0x5e8c58['id']);return setRelationship(_0x449700,_0x351b60,_0x5e8c58,_0x3bc7('0x60'));})[_0x3bc7('0x2f')](function(){return setRelationship(_0x449700,_0x3aad9f,_0x5e8c58,_0x3bc7('0x6d'));})[_0x3bc7('0x2f')](function(){return getServerInfo(_0x449700);})[_0x3bc7('0x77')](function(_0x430e2b){logger[_0x3bc7('0x67')]('['+_0x423e67[_0x3bc7('0x72')][_0x3bc7('0x73')]()+']',JSON[_0x3bc7('0x25')](_0x430e2b));});};
\ No newline at end of file
index 9580353..40d1609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf024=['substring','lastIndexOf','validateEmail','isNil','getString','sortBy','length','string','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','format','%s:\x20%s','key','keyContent','keyType','join','stripTrailingSlash'];(function(_0x47aa49,_0x572f84){var _0x302629=function(_0x295baf){while(--_0x295baf){_0x47aa49['push'](_0x47aa49['shift']());}};_0x302629(++_0x572f84);}(_0xf024,0x156));var _0x4f02=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xf024[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require('util');exports[_0x4f02('0x0')]=function(_0x3a1915,_0x5406b5,_0xf326e4){var _0x100a18=[];if(_0x3a1915['length']>0x0){var _0x467f11=_[_0x4f02('0x1')](_0x3a1915,['id']);for(var _0x18afc5=0x0;_0x18afc5<_0x467f11[_0x4f02('0x2')];_0x18afc5++){var _0x55fabc=_0x467f11[_0x18afc5];if(_0x55fabc['type']===_0x4f02('0x3')){_0x100a18[_0x4f02('0x4')](_0x55fabc[_0x4f02('0x5')]);}else if(_0x55fabc[_0x4f02('0x6')]===_0x4f02('0x7')&&_0x55fabc[_0x4f02('0x8')]){_0x5406b5[_0x55fabc[_0x4f02('0x8')]]&&_0x100a18[_0x4f02('0x4')](_0x5406b5[_0x55fabc[_0x4f02('0x8')]]['toString']());}else if(_0x55fabc['type']===_0x4f02('0x9')&&_0x55fabc[_0x4f02('0xa')]&&_0x55fabc[_0x4f02('0xa')]['name']){_0x5406b5[_0x55fabc[_0x4f02('0xa')][_0x4f02('0xb')]['toLowerCase']()]&&_0x100a18[_0x4f02('0x4')](_0x5406b5[_0x55fabc[_0x4f02('0xa')]['name'][_0x4f02('0xc')]()][_0x4f02('0xd')]());}else if(_0x55fabc[_0x4f02('0x6')]===_0x4f02('0xe')){if(_0x55fabc['keyType']===_0x4f02('0x3')&&_0x55fabc['key']){_0x100a18['push'](util[_0x4f02('0xf')](_0x4f02('0x10'),_0x55fabc[_0x4f02('0x11')],_0x55fabc[_0x4f02('0x12')]));}else if(_0x55fabc[_0x4f02('0x13')]===_0x4f02('0x7')&&_0x55fabc['variableName']&&_0x55fabc[_0x4f02('0x11')]){_0x5406b5[_0x55fabc[_0x4f02('0x8')]]&&_0x100a18[_0x4f02('0x4')](util[_0x4f02('0xf')](_0x4f02('0x10'),_0x55fabc[_0x4f02('0x11')],_0x5406b5[_0x55fabc[_0x4f02('0x8')]]));}else if(_0x55fabc['keyType']===_0x4f02('0x9')&&_0x55fabc[_0x4f02('0xa')]&&_0x55fabc['Variable'][_0x4f02('0xb')]&&_0x55fabc[_0x4f02('0x11')]){_0x5406b5[_0x55fabc['Variable'][_0x4f02('0xb')][_0x4f02('0xc')]()]&&_0x100a18[_0x4f02('0x4')](util[_0x4f02('0xf')](_0x4f02('0x10'),_0x55fabc['key'],_0x5406b5[_0x55fabc[_0x4f02('0xa')][_0x4f02('0xb')][_0x4f02('0xc')]()]));}}}}return _0x100a18[_0x4f02('0x14')](_0xf326e4);};exports[_0x4f02('0x15')]=function(_0x3cf7a7){var _0x379a91=_0x3cf7a7['slice'](-0x1);if(_0x379a91==='/'){_0x3cf7a7=_0x3cf7a7[_0x4f02('0x16')](0x0,_0x3cf7a7[_0x4f02('0x17')](_0x379a91));}return _0x3cf7a7;};exports[_0x4f02('0x18')]=function(_0x1bc5bf){if(!_[_0x4f02('0x19')](_0x1bc5bf)&&_0x1bc5bf!==''){var _0x28e5b5=/^(([^<>()\[\]\\.,;:\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 _0x28e5b5['test'](String(_0x1bc5bf)[_0x4f02('0xc')]());}else{return![];}};
\ No newline at end of file
+var _0x11d1=['sortBy','string','content','type','variable','variableName','push','toString','Variable','name','toLowerCase','key','format','%s:\x20%s','keyContent','keyType','customVariable','stripTrailingSlash','slice','substring','lodash','getString','length'];(function(_0x2f6ce3,_0x23cd93){var _0x20cf45=function(_0x1d3462){while(--_0x1d3462){_0x2f6ce3['push'](_0x2f6ce3['shift']());}};_0x20cf45(++_0x23cd93);}(_0x11d1,0x9e));var _0x111d=function(_0xc7983a,_0x219a60){_0xc7983a=_0xc7983a-0x0;var _0x1d696c=_0x11d1[_0xc7983a];return _0x1d696c;};'use strict';var _=require(_0x111d('0x0'));var util=require('util');exports[_0x111d('0x1')]=function(_0x2568e3,_0x26b5bc,_0x338865){var _0x1f4023=[];if(_0x2568e3[_0x111d('0x2')]>0x0){var _0x3cbbd1=_[_0x111d('0x3')](_0x2568e3,['id']);for(var _0x52fa26=0x0;_0x52fa26<_0x3cbbd1[_0x111d('0x2')];_0x52fa26++){var _0x5a08ab=_0x3cbbd1[_0x52fa26];if(_0x5a08ab['type']===_0x111d('0x4')){_0x1f4023['push'](_0x5a08ab[_0x111d('0x5')]);}else if(_0x5a08ab[_0x111d('0x6')]===_0x111d('0x7')&&_0x5a08ab['variableName']){_0x26b5bc[_0x5a08ab[_0x111d('0x8')]]&&_0x1f4023[_0x111d('0x9')](_0x26b5bc[_0x5a08ab[_0x111d('0x8')]][_0x111d('0xa')]());}else if(_0x5a08ab[_0x111d('0x6')]==='customVariable'&&_0x5a08ab[_0x111d('0xb')]&&_0x5a08ab[_0x111d('0xb')][_0x111d('0xc')]){_0x26b5bc[_0x5a08ab[_0x111d('0xb')]['name'][_0x111d('0xd')]()]&&_0x1f4023['push'](_0x26b5bc[_0x5a08ab[_0x111d('0xb')][_0x111d('0xc')][_0x111d('0xd')]()][_0x111d('0xa')]());}else if(_0x5a08ab['type']==='keyValue'){if(_0x5a08ab['keyType']===_0x111d('0x4')&&_0x5a08ab[_0x111d('0xe')]){_0x1f4023[_0x111d('0x9')](util[_0x111d('0xf')](_0x111d('0x10'),_0x5a08ab['key'],_0x5a08ab[_0x111d('0x11')]));}else if(_0x5a08ab[_0x111d('0x12')]===_0x111d('0x7')&&_0x5a08ab[_0x111d('0x8')]&&_0x5a08ab[_0x111d('0xe')]){_0x26b5bc[_0x5a08ab[_0x111d('0x8')]]&&_0x1f4023['push'](util['format'](_0x111d('0x10'),_0x5a08ab['key'],_0x26b5bc[_0x5a08ab[_0x111d('0x8')]]));}else if(_0x5a08ab[_0x111d('0x12')]===_0x111d('0x13')&&_0x5a08ab[_0x111d('0xb')]&&_0x5a08ab[_0x111d('0xb')][_0x111d('0xc')]&&_0x5a08ab[_0x111d('0xe')]){_0x26b5bc[_0x5a08ab[_0x111d('0xb')][_0x111d('0xc')][_0x111d('0xd')]()]&&_0x1f4023[_0x111d('0x9')](util[_0x111d('0xf')](_0x111d('0x10'),_0x5a08ab[_0x111d('0xe')],_0x26b5bc[_0x5a08ab[_0x111d('0xb')][_0x111d('0xc')][_0x111d('0xd')]()]));}}}}return _0x1f4023['join'](_0x338865);};exports[_0x111d('0x14')]=function(_0x3577b1){var _0x2086a4=_0x3577b1[_0x111d('0x15')](-0x1);if(_0x2086a4==='/'){_0x3577b1=_0x3577b1[_0x111d('0x16')](0x0,_0x3577b1['lastIndexOf'](_0x2086a4));}return _0x3577b1;};exports['validateEmail']=function(_0xb1c9d){if(!_['isNil'](_0xb1c9d)&&_0xb1c9d!==''){var _0x555829=/^(([^<>()\[\]\\.,;:\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 _0x555829['test'](String(_0xb1c9d)[_0x111d('0xd')]());}else{return![];}};
\ No newline at end of file
index ae8a18a..065af35 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(_0x50db95,_0x52534d){var _0x1026bc=function(_0x500d17){while(--_0x500d17){_0x50db95['push'](_0x50db95['shift']());}};_0x1026bc(++_0x52534d);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'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 _0xd8b0=['info','Creating\x20new\x20ticket...','merge','Normal','Subjects','POST','format','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','then','Agent\x20found!','resolve','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','catch','userId','getUser','Searching\x20end\x20user\x20with\x20phone','GET','query','Enduser\x20found!','firstname','Enduser\x20created.','lastname','phone','accessKey','getchallenge','login','token','getConnection','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','lastevent','toUpperCase','lodash','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','localhost','socket.io-emitter','emit','length','forEach','includes','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var rp=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require('util');var Redis=require(_0x0d8b('0x2'));var intUtil=require(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));config['redis']=_['defaults'](config[_0x0d8b('0x7')],{'host':_0x0d8b('0x8'),'port':0x18eb});var io=require(_0x0d8b('0x9'))(new Redis(config['redis']));function emit(_0x413284,_0x284169,_0x58e4e2){io['to'](_0x413284)[_0x0d8b('0xa')](_0x284169,_0x58e4e2);}function getCustomFields(_0x348e65,_0x3b027f){var _0x1f4800={};if(_0x348e65[_0x0d8b('0xb')]>0x0){_[_0x0d8b('0xc')](_0x348e65,function(_0x2c5e9e){if(_[_0x0d8b('0xd')](['string',_0x0d8b('0xe')],_0x2c5e9e['type'])&&_0x2c5e9e[_0x0d8b('0xf')]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x2c5e9e[_0x0d8b('0x10')][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x13')&&_0x2c5e9e[_0x0d8b('0x14')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x14')]][_0x0d8b('0x11')]();}else if(_0x2c5e9e[_0x0d8b('0x12')]===_0x0d8b('0x15')&&_0x2c5e9e['Variable']&&_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]&&_0x2c5e9e[_0x0d8b('0xf')]&&_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')]['toLowerCase']()]){_0x1f4800[_0x2c5e9e[_0x0d8b('0xf')]]=_0x3b027f[_0x2c5e9e[_0x0d8b('0x16')][_0x0d8b('0x17')][_0x0d8b('0x18')]()][_0x0d8b('0x11')]();}});}return _0x1f4800;}function createTicket(_0x18dd2d,_0x264b39,_0xa3612a,_0x4a15bf,_0x27512e,_0x23d58f,_0x196c0a){logger[_0x0d8b('0x19')](_0x0d8b('0x1a'));var _0x5b709c=_[_0x0d8b('0x1b')]({'parent_id':'','assigned_user_id':_0x264b39['id'],'ticketpriorities':_0x0d8b('0x1c'),'ticketstatus':'Open','ticket_title':intUtil['getString'](_0x4a15bf[_0x0d8b('0x1d')],_0x27512e,'\x20'),'description':intUtil['getString'](_0x4a15bf['Descriptions'],_0x27512e,'\x0a'),'contact_id':_0xa3612a['id']},getCustomFields(_0x23d58f,_0x27512e));var _0x5527d8={'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x18dd2d[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'username':_0x18dd2d[_0x0d8b('0x23')],'sessionName':_0x196c0a[_0x0d8b('0x24')],'elementType':_0x0d8b('0x25'),'element':JSON[_0x0d8b('0x26')](_0x5b709c)},'json':!![]};return request(_0x5527d8)['then'](function(_0xe8bbee){if(_0xe8bbee[_0x0d8b('0x27')]){return BPromise['resolve']({'id':_0xe8bbee[_0x0d8b('0x28')]['id']});}else{throw new Error(util['format'](_0x0d8b('0x29'),JSON[_0x0d8b('0x26')](_0xe8bbee[_0x0d8b('0x2a')])));}})['catch'](function(_0x59a905){var _0x28f639=_0x59a905[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),'createTicket',_0x28f639,JSON[_0x0d8b('0x26')](_0x59a905));});}function getUser(_0x4b59e5,_0x97050a,_0x48f24f){if(intUtil[_0x0d8b('0x2d')](_0x97050a)){logger['info'](_0x0d8b('0x2e'),_0x97050a);return request({'method':'GET','uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x4b59e5[_0x0d8b('0x21')]),'qs':{'operation':'query','username':_0x4b59e5['username'],'sessionName':_0x48f24f['sessionName'],'query':util[_0x0d8b('0x1f')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x97050a)},'json':!![]})[_0x0d8b('0x2f')](function(_0x54f6f3){if(_0x54f6f3['success']&&_0x54f6f3[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x30'));return BPromise[_0x0d8b('0x31')]({'id':_0x54f6f3[_0x0d8b('0x28')][0x0]['id'],'email':_0x54f6f3[_0x0d8b('0x28')][0x0][_0x0d8b('0x32')],'name':_0x54f6f3['result'][0x0][_0x0d8b('0x33')]+'\x20'+_0x54f6f3[_0x0d8b('0x28')]['last_name']});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f['userId'],'email':_0x4b59e5[_0x0d8b('0x23')],'name':_0x0d8b('0x35')});}})[_0x0d8b('0x36')](function(_0x31ceba){var _0x933e01=_0x31ceba['statusCode']||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),'getUser',_0x933e01,JSON[_0x0d8b('0x26')](_0x31ceba));});}else{logger[_0x0d8b('0x19')](_0x0d8b('0x34'));return BPromise[_0x0d8b('0x31')]({'id':_0x48f24f[_0x0d8b('0x37')],'email':_0x4b59e5['username'],'name':'admin'})[_0x0d8b('0x36')](function(_0x5c2c04){var _0x531c55=_0x5c2c04[_0x0d8b('0x2b')]||0x1f4;logger[_0x0d8b('0x2a')](_0x0d8b('0x2c'),_0x0d8b('0x38'),_0x531c55,JSON[_0x0d8b('0x26')](_0x5c2c04));});}}function getEndUser(_0x24c789,_0x579324,_0x6e5bab,_0x6a02ad){logger[_0x0d8b('0x19')](_0x0d8b('0x39'),_0x6e5bab);return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x24c789['remoteUri']),'qs':{'operation':_0x0d8b('0x3b'),'username':_0x24c789[_0x0d8b('0x23')],'sessionName':_0x6a02ad[_0x0d8b('0x24')],'query':util[_0x0d8b('0x1f')]('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;',_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab,_0x6e5bab)},'json':!![]})[_0x0d8b('0x2f')](function(_0x4b4bde){if(_0x4b4bde[_0x0d8b('0x27')]&&_0x4b4bde[_0x0d8b('0x28')][_0x0d8b('0xb')]){logger[_0x0d8b('0x19')](_0x0d8b('0x3c'));return BPromise[_0x0d8b('0x31')]({'id':_0x4b4bde[_0x0d8b('0x28')][0x0]['id'],'name':_0x4b4bde[_0x0d8b('0x28')][0x0][_0x0d8b('0x3d')]+'\x20'+_0x4b4bde[_0x0d8b('0x28')][0x0]['lastname'],'phone':_0x6e5bab});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':'POST','uri':util['format'](_0x0d8b('0x20'),_0x24c789[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x22'),'sessionName':_0x6a02ad['sessionName'],'elementType':'Contacts','element':JSON[_0x0d8b('0x26')]({'lastname':_0x579324,'phone':_0x6e5bab,'assigned_user_id':'\x20'})},'json':!![]})[_0x0d8b('0x2f')](function(_0x344278){logger['info'](_0x0d8b('0x3e'));return BPromise[_0x0d8b('0x31')]({'id':_0x344278['result']['id'],'name':_0x344278['result'][_0x0d8b('0x3f')],'phone':_0x344278['result'][_0x0d8b('0x40')]});})['catch'](function(_0x53f643){var _0x30ccee=_0x53f643[_0x0d8b('0x2b')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getEndUser',_0x30ccee,JSON['stringify'](_0x53f643));});}});}function getConnection(_0x374d40){var _0x1e0498=_0x374d40[_0x0d8b('0x23')];var _0x490eda=_0x374d40[_0x0d8b('0x41')];return request({'method':_0x0d8b('0x3a'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'qs':{'operation':_0x0d8b('0x42'),'username':_0x1e0498},'json':!![]})[_0x0d8b('0x2f')](function(_0x1d5067){if(_0x1d5067[_0x0d8b('0x27')]){return request({'method':_0x0d8b('0x1e'),'uri':util[_0x0d8b('0x1f')](_0x0d8b('0x20'),_0x374d40[_0x0d8b('0x21')]),'form':{'operation':_0x0d8b('0x43'),'username':_0x1e0498,'accessKey':md5(_0x1d5067[_0x0d8b('0x28')][_0x0d8b('0x44')]+_0x490eda)},'json':!![]});}})[_0x0d8b('0x2f')](function(_0x1e162c){if(_0x1e162c[_0x0d8b('0x27')]){return BPromise['resolve'](_0x1e162c[_0x0d8b('0x28')]);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x374d40['id']));}})[_0x0d8b('0x36')](function(_0x113fb7){var _0x3f943a=_0x113fb7[_0x0d8b('0x2b')]||0x1f4;logger['error'](_0x0d8b('0x2c'),_0x0d8b('0x45'),_0x3f943a,JSON[_0x0d8b('0x26')](_0x113fb7));});}function request(_0x241587){logger[_0x0d8b('0x19')]('[HTTP]',JSON['stringify'](_0x241587));return rp(_0x241587);}exports['queue']=function(_0x573f4f,_0x368ede,_0xf22c3c,_0x5e3bb4,_0x4950a8,_0x44c5c1){var _0x3d3cb6,_0x5c5bd7,_0x5ef6c3,_0x900906;_0x44c5c1[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x44c5c1[_0x0d8b('0x21')]);if(_0x4950a8&&_0x4950a8[_0x0d8b('0x47')]){logger['info'](_0x0d8b('0x48'),_0x0d8b('0x49'));_0x368ede['recordingURL']=util['format'](_0x0d8b('0x4a'),_0x44c5c1[_0x0d8b('0x4b')],_0x368ede['uniqueid'],md5(_0x368ede['uniqueid']));}else{_0x368ede[_0x0d8b('0x4c')]='';}return getConnection(_0x44c5c1)[_0x0d8b('0x2f')](function(_0x377027){_0x900906=_0x377027;return getUser(_0x44c5c1,_0x5e3bb4[_0x0d8b('0x4d')],_0x900906);})['then'](function(_0x356b3d){_0x3d3cb6=_0x356b3d;logger['info']('The\x20User\x20ID\x20is:',_0x3d3cb6['id']);return getEndUser(_0x44c5c1,_0x368ede[_0x0d8b('0x4e')],_0x368ede[_0x0d8b('0x4f')],_0x900906);})['then'](function(_0x4a8f33){_0x5c5bd7=_0x4a8f33;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x5c5bd7['id']);return createTicket(_0x44c5c1,_0x3d3cb6,_0x5c5bd7,_0xf22c3c,_0x368ede,_0xf22c3c[_0x0d8b('0x51')],_0x900906);})[_0x0d8b('0x2f')](function(_0x3afc3a){_0x5ef6c3=_0x3afc3a;logger[_0x0d8b('0x19')](_0x0d8b('0x52'));logger[_0x0d8b('0x19')]('The\x20Ticket\x20ID\x20is:',_0x5ef6c3['id']);var _0x24a859=util[_0x0d8b('0x1f')](_0x0d8b('0x53'),_0x44c5c1[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5ef6c3['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x48'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')]('user:%s',_0x5e3bb4[_0x0d8b('0x17')]),_0x0d8b('0x56'),{'uri':_0x24a859});})[_0x0d8b('0x36')](function(_0x23de9e){logger[_0x0d8b('0x2a')]('[QUEUE]',JSON[_0x0d8b('0x26')](_0x23de9e));});};exports[_0x0d8b('0x57')]=function(_0x181d49,_0x17a87f,_0x1d6cd4,_0x59ada2,_0x4d0e7c,_0x3b1166,_0x291b83){var _0x3e4a41,_0xbbb520,_0x5a70bd,_0x199122;_0x3b1166[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x3b1166['remoteUri']);_0x3b1166[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x3b1166[_0x0d8b('0x4b')]);if(_0x291b83&&_0x291b83[_0x0d8b('0x58')]&&_0x291b83[_0x0d8b('0x58')]!==_0x0d8b('0x59')){logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),'Recording\x20is\x20enabled!');_0x17a87f[_0x0d8b('0x4c')]=util['format'](_0x0d8b('0x4a'),_0x3b1166[_0x0d8b('0x4b')],_0x17a87f[_0x0d8b('0x5b')],md5(_0x17a87f[_0x0d8b('0x5b')]));}return getConnection(_0x3b1166)['then'](function(_0x19e097){_0x199122=_0x19e097;return getUser(_0x3b1166,_0x59ada2[_0x0d8b('0x4d')],_0x199122);})[_0x0d8b('0x2f')](function(_0x2332fc){_0x3e4a41=_0x2332fc;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0x3e4a41['id']);return getEndUser(_0x3b1166,_0x17a87f[_0x0d8b('0x5d')],_0x17a87f[_0x0d8b('0x5e')],_0x199122);})[_0x0d8b('0x2f')](function(_0x34affb){_0xbbb520=_0x34affb;logger['info']('The\x20Enduser\x20ID\x20is:',_0xbbb520['id']);return createTicket(_0x3b1166,_0x3e4a41,_0xbbb520,_0x1d6cd4,_0x17a87f,_0x1d6cd4[_0x0d8b('0x51')],_0x199122);})[_0x0d8b('0x2f')](function(_0x53e399){_0x5a70bd=_0x53e399;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger['info'](_0x0d8b('0x5f'),_0x5a70bd['id']);var _0x1c4e96=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x3b1166[_0x0d8b('0x21')],_[_0x0d8b('0x54')](_0x5a70bd['id'],'x')[0x1]);logger[_0x0d8b('0x19')](_0x0d8b('0x5a'),_0x0d8b('0x55'));emit(util[_0x0d8b('0x1f')](_0x0d8b('0x60'),_0x59ada2['name']),_0x0d8b('0x56'),{'uri':_0x1c4e96});})['catch'](function(_0x1a203e){logger[_0x0d8b('0x2a')](_0x0d8b('0x5a'),JSON[_0x0d8b('0x26')](_0x1a203e));});};exports['unmanaged']=function(_0x3fe47d,_0x4a1c4a,_0x3a356b,_0x2c6c5f,_0x1c5fe2,_0x2ebea3){var _0xc5c35f,_0x2b44e5,_0x3e927c,_0x91aa89;_0x2ebea3[_0x0d8b('0x21')]=intUtil[_0x0d8b('0x46')](_0x2ebea3['remoteUri']);_0x2ebea3[_0x0d8b('0x4b')]=intUtil['stripTrailingSlash'](_0x2ebea3[_0x0d8b('0x4b')]);if(_0x1c5fe2&&_0x1c5fe2[_0x0d8b('0x47')]){logger['info']('['+_0x4a1c4a[_0x0d8b('0x61')]['toUpperCase']()+']',_0x0d8b('0x49'));_0x4a1c4a[_0x0d8b('0x4c')]=util[_0x0d8b('0x1f')](_0x0d8b('0x4a'),_0x2ebea3[_0x0d8b('0x4b')],_0x4a1c4a[_0x0d8b('0x5b')],md5(_0x4a1c4a[_0x0d8b('0x5b')]));}else{_0x4a1c4a[_0x0d8b('0x4c')]='';}return getConnection(_0x2ebea3)['then'](function(_0x10eca6){_0x91aa89=_0x10eca6;return getUser(_0x2ebea3,'',_0x91aa89);})[_0x0d8b('0x2f')](function(_0x5b2916){_0xc5c35f=_0x5b2916;logger[_0x0d8b('0x19')](_0x0d8b('0x5c'),_0xc5c35f['id']);return getEndUser(_0x2ebea3,_0x4a1c4a[_0x0d8b('0x4e')],_0x4a1c4a[_0x0d8b('0x4f')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0x9e44b4){_0x2b44e5=_0x9e44b4;logger[_0x0d8b('0x19')](_0x0d8b('0x50'),_0x2b44e5['id']);return createTicket(_0x2ebea3,_0xc5c35f,_0x2b44e5,_0x3a356b,_0x4a1c4a,_0x3a356b[_0x0d8b('0x51')],_0x91aa89);})[_0x0d8b('0x2f')](function(_0xe35028){_0x3e927c=_0xe35028;logger[_0x0d8b('0x19')]('Ticket\x20created!');logger[_0x0d8b('0x19')](_0x0d8b('0x5f'),_0x3e927c['id']);})[_0x0d8b('0x36')](function(_0x58525c){logger['error']('['+_0x4a1c4a[_0x0d8b('0x61')][_0x0d8b('0x62')]()+']',JSON[_0x0d8b('0x26')](_0x58525c));});};
\ No newline at end of file
index 29de84f..0cf6bf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf681=['customField','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','replace','error','lastevent','toUpperCase','lodash','request-promise','md5','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','application/json','format','%s/tickets.json','Tags','name','getString','Subjects','Fields','then','info','Ticket\x20created!','ticket','%s/search.json','remoteUri','count','Agent\x20found!','find','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','first','Enduser\x20found!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s/token:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','GET','map','includes','string','picklist','type','nameField','toLowerCase','content','custom_fields','push','variableName','idField'];(function(_0x2a6cf3,_0x58b2a1){var _0x2fe922=function(_0x3c74e1){while(--_0x3c74e1){_0x2a6cf3['push'](_0x2a6cf3['shift']());}};_0x2fe922(++_0x58b2a1);}(_0xf681,0x1c8));var _0x1f68=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf681[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x1f68('0x0'));var rp=require(_0x1f68('0x1'));var md5=require(_0x1f68('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x1f68('0x3'));var logger=require(_0x1f68('0x4'))('zendesk');config[_0x1f68('0x5')]=_['defaults'](config['redis'],{'host':_0x1f68('0x6'),'port':0x18eb});var io=require(_0x1f68('0x7'))(new Redis(config[_0x1f68('0x5')]));function emit(_0x1b8647,_0x3dc73b,_0x1df072){io['to'](_0x1b8647)['emit'](_0x3dc73b,_0x1df072);}var headers={'Content-Type':_0x1f68('0x8'),'Accept':_0x1f68('0x8')};function getTicket(_0x2de0bf,_0xf512ae,_0x132516,_0x5d0851,_0x5a77f1){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x1f68('0x9')](_0x1f68('0xa'),_0x2de0bf['remoteUri']),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x132516['id'],'submitter_id':_0xf512ae?_0xf512ae['id']:undefined,'assignee_id':_0xf512ae?_0xf512ae['id']:undefined,'tags':getTags(_0x5d0851[_0x1f68('0xb')],_0x1f68('0xc')),'subject':intUtil[_0x1f68('0xd')](_0x5d0851[_0x1f68('0xe')],_0x5a77f1,'\x20'),'description':intUtil[_0x1f68('0xd')](_0x5d0851['Descriptions'],_0x5a77f1,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1f68('0xd')](_0x5d0851['Descriptions'],_0x5a77f1,'\x0a')}},getCustomFields(_0x5d0851[_0x1f68('0xf')],_0x5a77f1))}})[_0x1f68('0x10')](function(_0x2ba95e){logger[_0x1f68('0x11')](_0x1f68('0x12'));return _0x2ba95e[_0x1f68('0x13')];});}function getUser(_0x43c515,_0x13dc7a){if(intUtil['validateEmail'](_0x13dc7a)){logger[_0x1f68('0x11')]('Getting\x20agent\x20with\x20email',_0x13dc7a);return request({'uri':util[_0x1f68('0x9')](_0x1f68('0x14'),_0x43c515[_0x1f68('0x15')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x13dc7a)}})[_0x1f68('0x10')](function(_0x107238){if(_0x107238[_0x1f68('0x16')]){logger[_0x1f68('0x11')](_0x1f68('0x17'));return _[_0x1f68('0x18')](_0x107238['results'],{'email':_0x13dc7a,'role':_0x1f68('0x19')});}else{logger[_0x1f68('0x11')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1f68('0x9')](_0x1f68('0x1a'),_0x43c515[_0x1f68('0x15')])})[_0x1f68('0x10')](function(_0xdca3f5){logger[_0x1f68('0x11')]('Admin\x20account\x20selected.');return _0xdca3f5[_0x1f68('0x1b')];});}});}else{logger[_0x1f68('0x11')](_0x1f68('0x1c'));return request({'uri':util[_0x1f68('0x9')](_0x1f68('0x1a'),_0x43c515[_0x1f68('0x15')])})['then'](function(_0x4142fc){logger[_0x1f68('0x11')](_0x1f68('0x1d'));return _0x4142fc[_0x1f68('0x1b')];});}}function getEndUser(_0x352a21,_0x44ff8f,_0x2030ef){logger[_0x1f68('0x11')](_0x1f68('0x1e'),_0x2030ef);return request({'uri':util[_0x1f68('0x9')]('%s/search.json',_0x352a21[_0x1f68('0x15')]),'qs':{'query':util[_0x1f68('0x9')]('type:user\x20role:end-user\x20phone:%s',_0x2030ef)}})[_0x1f68('0x10')](function(_0x4e86e4){var _0x476f21;if(_0x4e86e4[_0x1f68('0x1f')][_0x1f68('0x20')]){_0x4e86e4[_0x1f68('0x1f')]=_[_0x1f68('0x21')](_0x4e86e4['results'],{'suspended':![],'role':_0x1f68('0x22')});if(_0x4e86e4[_0x1f68('0x1f')][_0x1f68('0x20')]){_0x476f21=_[_0x1f68('0x23')](_0x4e86e4[_0x1f68('0x1f')]);}}if(_0x476f21){logger['info'](_0x1f68('0x24'));return _0x476f21;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1f68('0x9')](_0x1f68('0x25'),_0x352a21[_0x1f68('0x15')]),'method':_0x1f68('0x26'),'body':{'user':{'role':_0x1f68('0x22'),'name':util['format'](_0x1f68('0x27'),_0x44ff8f||_0x2030ef),'phone':_0x2030ef}}})[_0x1f68('0x10')](function(_0x5e9087){logger[_0x1f68('0x11')](_0x1f68('0x28'));return _0x5e9087[_0x1f68('0x1b')];});}});}function getAuth(_0x3ee257){var _0x406850;if(_0x3ee257[_0x1f68('0x29')]===_0x1f68('0x2a')){_0x406850=util[_0x1f68('0x9')]('%s:%s',_0x3ee257['username'],_0x3ee257['password']);}else if(_0x3ee257['authType']==='token'){_0x406850=util[_0x1f68('0x9')](_0x1f68('0x2b'),_0x3ee257[_0x1f68('0x2c')],_0x3ee257[_0x1f68('0x2d')]);}return util[_0x1f68('0x9')](_0x1f68('0x2e'),new Buffer(_0x406850)[_0x1f68('0x2f')](_0x1f68('0x30')));}function request(_0x22a953){logger[_0x1f68('0x31')](_0x1f68('0x32'),JSON['stringify'](_0x22a953));return rp(_['defaults'](_0x22a953,{'method':_0x1f68('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5bf4df,_0x4e3d73){var _0x4cbb8b=[];if(_0x5bf4df&&_0x5bf4df['length']>0x0){_0x4cbb8b=_[_0x1f68('0x34')](_0x5bf4df,_0x4e3d73);}return _0x4cbb8b;}function getCustomFields(_0x7a7016,_0xda0e27){var _0x4cc70c=[];var _0x196216={'custom_fields':[]};if(_0x7a7016['length']>0x0){_['forEach'](_0x7a7016,function(_0x49e529){if(_[_0x1f68('0x35')]([_0x1f68('0x36'),_0x1f68('0x37')],_0x49e529[_0x1f68('0x38')])&&_0x49e529[_0x1f68('0x39')]&&!_0x49e529['customField']){_0x196216[_0x49e529[_0x1f68('0x39')][_0x1f68('0x3a')]()]=_0x49e529[_0x1f68('0x3b')][_0x1f68('0x2f')]();}else if(_[_0x1f68('0x35')]([_0x1f68('0x36'),_0x1f68('0x37')],_0x49e529['type'])&&_0x49e529['idField']&&_0x49e529['customField']){_0x196216[_0x1f68('0x3c')][_0x1f68('0x3d')]({'id':_0x49e529['idField'],'value':_0x49e529['content'][_0x1f68('0x2f')]()});}else if(_0x49e529[_0x1f68('0x38')]==='variable'&&_0x49e529[_0x1f68('0x3e')]&&_0x49e529[_0x1f68('0x3f')]&&_0x49e529[_0x1f68('0x40')]){_0xda0e27[_0x49e529[_0x1f68('0x3e')]]&&_0x196216['custom_fields'][_0x1f68('0x3d')]({'id':_0x49e529['idField'],'value':_0xda0e27[_0x49e529[_0x1f68('0x3e')]][_0x1f68('0x2f')]()});}else if(_0x49e529[_0x1f68('0x38')]===_0x1f68('0x41')&&_0x49e529['Variable']&&_0x49e529[_0x1f68('0x42')][_0x1f68('0xc')]&&_0x49e529[_0x1f68('0x3f')]&&_0x49e529[_0x1f68('0x40')]){_0xda0e27[_0x49e529[_0x1f68('0x42')]['name'][_0x1f68('0x3a')]()]&&_0x196216[_0x1f68('0x3c')][_0x1f68('0x3d')]({'id':_0x49e529[_0x1f68('0x3f')],'value':_0xda0e27[_0x49e529[_0x1f68('0x42')][_0x1f68('0xc')][_0x1f68('0x3a')]()][_0x1f68('0x2f')]()});}});}return _0x196216;}exports['queue']=function(_0x3b4e24,_0x19eb3f,_0x2ed86d,_0x54520f,_0x137768,_0x2d4d57){var _0x52b114,_0x4106ac;_0x2d4d57[_0x1f68('0x15')]=intUtil[_0x1f68('0x43')](_0x2d4d57[_0x1f68('0x15')]);_0x2d4d57['serverUrl']=intUtil['stripTrailingSlash'](_0x2d4d57[_0x1f68('0x44')]);if(_0x137768&&_0x137768[_0x1f68('0x45')]){logger[_0x1f68('0x11')]('[QUEUE]',_0x1f68('0x46'));_0x19eb3f[_0x1f68('0x47')]=util['format'](_0x1f68('0x48'),_0x2d4d57['serverUrl'],_0x19eb3f[_0x1f68('0x49')],md5(_0x19eb3f[_0x1f68('0x49')]));}else{_0x19eb3f[_0x1f68('0x47')]='';}headers[_0x1f68('0x4a')]=getAuth(_0x2d4d57);return getUser(_0x2d4d57,_0x54520f[_0x1f68('0x4b')])[_0x1f68('0x10')](function(_0xf90989){_0x52b114=_0xf90989;logger[_0x1f68('0x11')](_0x1f68('0x4c'),_0x52b114['id']);return getEndUser(_0x2d4d57,_0x19eb3f[_0x1f68('0x4d')],_0x19eb3f[_0x1f68('0x4e')]);})[_0x1f68('0x10')](function(_0xcd6c35){_0x4106ac=_0xcd6c35;logger[_0x1f68('0x11')]('The\x20Enduser\x20ID\x20is:',_0x4106ac['id']);return getTicket(_0x2d4d57,_0x52b114,_0x4106ac,_0x2ed86d,_0x19eb3f);})[_0x1f68('0x10')](function(_0x85fb51){if(_0x85fb51){logger[_0x1f68('0x11')](_0x1f68('0x4f'),_0x85fb51['id']);switch(_0x2d4d57['type']){case _0x1f68('0x50'):logger['info'](_0x1f68('0x51'),_0x1f68('0x52'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2d4d57[_0x1f68('0x15')],_0x52b114['id'],_0x85fb51['id']),'method':'POST'});case _0x1f68('0x53'):logger[_0x1f68('0x11')](_0x1f68('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x1f68('0x9')](_0x1f68('0x54'),_0x54520f['name']),_0x1f68('0x55'),{'uri':util[_0x1f68('0x9')](_0x1f68('0x56'),_0x2d4d57[_0x1f68('0x15')]['replace'](_0x1f68('0x57'),''),_0x85fb51['id'])});break;default:logger['error']('[QUEUE]',_0x1f68('0x58'));}}})[_0x1f68('0x59')](function(_0x5eb99f){logger['error'](_0x1f68('0x5a'),util[_0x1f68('0x5b')](_0x5eb99f,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x3e1b91,_0x304e38,_0x32fc78,_0x2b30cd,_0x44c8da,_0x3be9e4,_0x335023){var _0x72fe80,_0x9e527;_0x3be9e4[_0x1f68('0x15')]=intUtil[_0x1f68('0x43')](_0x3be9e4['remoteUri']);_0x3be9e4[_0x1f68('0x44')]=intUtil[_0x1f68('0x43')](_0x3be9e4['serverUrl']);if(_0x335023&&_0x335023['recordingFormat']&&_0x335023[_0x1f68('0x5c')]!==_0x1f68('0x5d')){logger['info'](_0x1f68('0x5e'),'Recording\x20is\x20enabled!');_0x304e38[_0x1f68('0x47')]=util[_0x1f68('0x9')](_0x1f68('0x48'),_0x3be9e4['serverUrl'],_0x304e38[_0x1f68('0x49')],md5(_0x304e38[_0x1f68('0x49')]));}headers[_0x1f68('0x4a')]=getAuth(_0x3be9e4);return getUser(_0x3be9e4,_0x2b30cd[_0x1f68('0x4b')])[_0x1f68('0x10')](function(_0x3643b9){_0x72fe80=_0x3643b9;logger[_0x1f68('0x11')](_0x1f68('0x4c'),_0x72fe80['id']);return getEndUser(_0x3be9e4,_0x304e38[_0x1f68('0x5f')],_0x304e38[_0x1f68('0x60')]);})['then'](function(_0x5cce2e){_0x9e527=_0x5cce2e;logger[_0x1f68('0x11')](_0x1f68('0x61'),_0x9e527['id']);return getTicket(_0x3be9e4,_0x72fe80,_0x9e527,_0x32fc78,_0x304e38);})[_0x1f68('0x10')](function(_0x123ba3){if(_0x123ba3){logger[_0x1f68('0x11')](_0x1f68('0x4f'),_0x123ba3['id']);switch(_0x3be9e4['type']){case _0x1f68('0x50'):logger[_0x1f68('0x11')](_0x1f68('0x5e'),_0x1f68('0x52'));return request({'uri':util[_0x1f68('0x9')](_0x1f68('0x62'),_0x3be9e4['remoteUri'],_0x72fe80['id'],_0x123ba3['id']),'method':'POST'});case _0x1f68('0x53'):logger['info'](_0x1f68('0x5e'),_0x1f68('0x63'));emit(util[_0x1f68('0x9')]('user:%s',_0x2b30cd[_0x1f68('0xc')]),_0x1f68('0x55'),{'uri':util[_0x1f68('0x9')](_0x1f68('0x56'),_0x3be9e4['remoteUri'][_0x1f68('0x64')](_0x1f68('0x57'),''),_0x123ba3['id'])});break;default:logger[_0x1f68('0x65')](_0x1f68('0x5e'),_0x1f68('0x58'));}}})[_0x1f68('0x59')](function(_0x4f146f){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x4f146f,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x345903,_0x5eb6d9,_0x497289,_0x44d8de,_0x9dee07,_0x136510){var _0x2c697b,_0x37870f;_0x136510['remoteUri']=intUtil['stripTrailingSlash'](_0x136510['remoteUri']);_0x136510[_0x1f68('0x44')]=intUtil[_0x1f68('0x43')](_0x136510[_0x1f68('0x44')]);if(_0x9dee07&&_0x9dee07[_0x1f68('0x45')]){logger['info']('['+_0x5eb6d9[_0x1f68('0x66')][_0x1f68('0x67')]()+']',_0x1f68('0x46'));_0x5eb6d9['recordingURL']=util[_0x1f68('0x9')](_0x1f68('0x48'),_0x136510['serverUrl'],_0x5eb6d9[_0x1f68('0x49')],md5(_0x5eb6d9[_0x1f68('0x49')]));}else{_0x5eb6d9[_0x1f68('0x47')]='';}headers['Authorization']=getAuth(_0x136510);return getUser(_0x136510)['then'](function(_0x287492){_0x2c697b=_0x287492;logger['info']('The\x20User\x20ID\x20is:',_0x2c697b['id']);return getEndUser(_0x136510,_0x5eb6d9[_0x1f68('0x4d')],_0x5eb6d9[_0x1f68('0x4e')]);})[_0x1f68('0x10')](function(_0x27fcb4){_0x37870f=_0x27fcb4;logger[_0x1f68('0x11')]('The\x20Enduser\x20ID\x20is:',_0x37870f['id']);return getTicket(_0x136510,_0x2c697b,_0x37870f,_0x497289,_0x5eb6d9);})[_0x1f68('0x10')](function(_0x4147a6){if(_0x4147a6){logger[_0x1f68('0x11')](_0x1f68('0x4f'),_0x4147a6['id']);}})[_0x1f68('0x59')](function(_0x21acf7){logger[_0x1f68('0x65')]('['+_0x5eb6d9[_0x1f68('0x66')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x1f68('0x5b')](_0x21acf7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xd104=['getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','count','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','filter','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','end-user','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','GET','map','includes','string','picklist','type','customField','nameField','toLowerCase','idField','custom_fields','content','variable','variableName','customVariable','Variable','push','queue','stripTrailingSlash','serverUrl','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','replace','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','info','format','remoteUri','merge','name'];(function(_0xf4a457,_0x5bd9c8){var _0x166b3d=function(_0x3efeea){while(--_0x3efeea){_0xf4a457['push'](_0xf4a457['shift']());}};_0x166b3d(++_0x5bd9c8);}(_0xd104,0xd0));var _0x4d10=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd104[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4d10('0x0'));var rp=require(_0x4d10('0x1'));var md5=require(_0x4d10('0x2'));var util=require(_0x4d10('0x3'));var Redis=require(_0x4d10('0x4'));var intUtil=require(_0x4d10('0x5'));var config=require(_0x4d10('0x6'));var logger=require(_0x4d10('0x7'))(_0x4d10('0x8'));config[_0x4d10('0x9')]=_[_0x4d10('0xa')](config[_0x4d10('0x9')],{'host':_0x4d10('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d10('0x9')]));function emit(_0xda0a5f,_0x1c6ceb,_0x1ddb47){io['to'](_0xda0a5f)[_0x4d10('0xc')](_0x1c6ceb,_0x1ddb47);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0xd9239c,_0x3c1eff,_0x3a96b2,_0x44debd,_0x5eaa55){logger[_0x4d10('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x4d10('0xe')]('%s/tickets.json',_0xd9239c[_0x4d10('0xf')]),'method':'POST','body':{'ticket':_[_0x4d10('0x10')]({'requester_id':_0x3a96b2['id'],'submitter_id':_0x3c1eff?_0x3c1eff['id']:undefined,'assignee_id':_0x3c1eff?_0x3c1eff['id']:undefined,'tags':getTags(_0x44debd['Tags'],_0x4d10('0x11')),'subject':intUtil[_0x4d10('0x12')](_0x44debd[_0x4d10('0x13')],_0x5eaa55,'\x20'),'description':intUtil[_0x4d10('0x12')](_0x44debd[_0x4d10('0x14')],_0x5eaa55,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4d10('0x12')](_0x44debd[_0x4d10('0x14')],_0x5eaa55,'\x0a')}},getCustomFields(_0x44debd[_0x4d10('0x15')],_0x5eaa55))}})[_0x4d10('0x16')](function(_0x16bdc0){logger[_0x4d10('0xd')]('Ticket\x20created!');return _0x16bdc0[_0x4d10('0x17')];});}function getUser(_0x5f24a6,_0x1984d6){if(intUtil[_0x4d10('0x18')](_0x1984d6)){logger[_0x4d10('0xd')](_0x4d10('0x19'),_0x1984d6);return request({'uri':util[_0x4d10('0xe')]('%s/search.json',_0x5f24a6[_0x4d10('0xf')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x1984d6)}})[_0x4d10('0x16')](function(_0x18320f){if(_0x18320f[_0x4d10('0x1a')]){logger['info']('Agent\x20found!');return _['find'](_0x18320f['results'],{'email':_0x1984d6,'role':'agent'});}else{logger[_0x4d10('0xd')](_0x4d10('0x1b'));return request({'uri':util['format'](_0x4d10('0x1c'),_0x5f24a6[_0x4d10('0xf')])})[_0x4d10('0x16')](function(_0x22bf8f){logger[_0x4d10('0xd')](_0x4d10('0x1d'));return _0x22bf8f[_0x4d10('0x1e')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4d10('0xe')](_0x4d10('0x1c'),_0x5f24a6['remoteUri'])})[_0x4d10('0x16')](function(_0xf1b81f){logger[_0x4d10('0xd')](_0x4d10('0x1d'));return _0xf1b81f[_0x4d10('0x1e')];});}}function getEndUser(_0x56cf71,_0x16372f,_0x1ade17){logger['info'](_0x4d10('0x1f'),_0x1ade17);return request({'uri':util[_0x4d10('0xe')](_0x4d10('0x20'),_0x56cf71[_0x4d10('0xf')]),'qs':{'query':util['format'](_0x4d10('0x21'),_0x1ade17)}})[_0x4d10('0x16')](function(_0x22b5a5){var _0xbbdb7b;if(_0x22b5a5[_0x4d10('0x22')]['length']){_0x22b5a5[_0x4d10('0x22')]=_[_0x4d10('0x23')](_0x22b5a5[_0x4d10('0x22')],{'suspended':![],'role':'end-user'});if(_0x22b5a5[_0x4d10('0x22')][_0x4d10('0x24')]){_0xbbdb7b=_[_0x4d10('0x25')](_0x22b5a5[_0x4d10('0x22')]);}}if(_0xbbdb7b){logger[_0x4d10('0xd')](_0x4d10('0x26'));return _0xbbdb7b;}else{logger[_0x4d10('0xd')](_0x4d10('0x27'));return request({'uri':util[_0x4d10('0xe')](_0x4d10('0x28'),_0x56cf71[_0x4d10('0xf')]),'method':_0x4d10('0x29'),'body':{'user':{'role':_0x4d10('0x2a'),'name':util[_0x4d10('0xe')](_0x4d10('0x2b'),_0x16372f||_0x1ade17),'phone':_0x1ade17}}})[_0x4d10('0x16')](function(_0x21ab2c){logger[_0x4d10('0xd')](_0x4d10('0x2c'));return _0x21ab2c[_0x4d10('0x1e')];});}});}function getAuth(_0x3719b3){var _0x5a8a76;if(_0x3719b3['authType']===_0x4d10('0x2d')){_0x5a8a76=util[_0x4d10('0xe')]('%s:%s',_0x3719b3[_0x4d10('0x2e')],_0x3719b3[_0x4d10('0x2d')]);}else if(_0x3719b3[_0x4d10('0x2f')]===_0x4d10('0x30')){_0x5a8a76=util[_0x4d10('0xe')](_0x4d10('0x31'),_0x3719b3[_0x4d10('0x2e')],_0x3719b3[_0x4d10('0x30')]);}return util[_0x4d10('0xe')](_0x4d10('0x32'),new Buffer(_0x5a8a76)[_0x4d10('0x33')](_0x4d10('0x34')));}function request(_0x3583a5){logger[_0x4d10('0x35')]('[HTTP]',JSON[_0x4d10('0x36')](_0x3583a5));return rp(_[_0x4d10('0xa')](_0x3583a5,{'method':_0x4d10('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x45aee6,_0xbcb39c){var _0x5da05f=[];if(_0x45aee6&&_0x45aee6[_0x4d10('0x24')]>0x0){_0x5da05f=_[_0x4d10('0x38')](_0x45aee6,_0xbcb39c);}return _0x5da05f;}function getCustomFields(_0x1ceac4,_0x1f016a){var _0xe2a193=[];var _0x3f4c10={'custom_fields':[]};if(_0x1ceac4[_0x4d10('0x24')]>0x0){_['forEach'](_0x1ceac4,function(_0x14f048){if(_[_0x4d10('0x39')]([_0x4d10('0x3a'),_0x4d10('0x3b')],_0x14f048[_0x4d10('0x3c')])&&_0x14f048['nameField']&&!_0x14f048[_0x4d10('0x3d')]){_0x3f4c10[_0x14f048[_0x4d10('0x3e')][_0x4d10('0x3f')]()]=_0x14f048['content'][_0x4d10('0x33')]();}else if(_[_0x4d10('0x39')]([_0x4d10('0x3a'),_0x4d10('0x3b')],_0x14f048[_0x4d10('0x3c')])&&_0x14f048[_0x4d10('0x40')]&&_0x14f048['customField']){_0x3f4c10[_0x4d10('0x41')]['push']({'id':_0x14f048[_0x4d10('0x40')],'value':_0x14f048[_0x4d10('0x42')][_0x4d10('0x33')]()});}else if(_0x14f048['type']===_0x4d10('0x43')&&_0x14f048[_0x4d10('0x44')]&&_0x14f048[_0x4d10('0x40')]&&_0x14f048[_0x4d10('0x3d')]){_0x1f016a[_0x14f048[_0x4d10('0x44')]]&&_0x3f4c10[_0x4d10('0x41')]['push']({'id':_0x14f048[_0x4d10('0x40')],'value':_0x1f016a[_0x14f048['variableName']][_0x4d10('0x33')]()});}else if(_0x14f048['type']===_0x4d10('0x45')&&_0x14f048['Variable']&&_0x14f048['Variable'][_0x4d10('0x11')]&&_0x14f048['idField']&&_0x14f048[_0x4d10('0x3d')]){_0x1f016a[_0x14f048[_0x4d10('0x46')][_0x4d10('0x11')][_0x4d10('0x3f')]()]&&_0x3f4c10[_0x4d10('0x41')][_0x4d10('0x47')]({'id':_0x14f048[_0x4d10('0x40')],'value':_0x1f016a[_0x14f048[_0x4d10('0x46')]['name'][_0x4d10('0x3f')]()][_0x4d10('0x33')]()});}});}return _0x3f4c10;}exports[_0x4d10('0x48')]=function(_0x2a4805,_0x4febf3,_0x1983d3,_0x5cdbec,_0x2a6e74,_0x322b1b){var _0x50ddb6,_0x50a4f8;_0x322b1b[_0x4d10('0xf')]=intUtil[_0x4d10('0x49')](_0x322b1b[_0x4d10('0xf')]);_0x322b1b[_0x4d10('0x4a')]=intUtil['stripTrailingSlash'](_0x322b1b[_0x4d10('0x4a')]);if(_0x2a6e74&&_0x2a6e74[_0x4d10('0x4b')]){logger[_0x4d10('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x4febf3[_0x4d10('0x4c')]=util[_0x4d10('0xe')](_0x4d10('0x4d'),_0x322b1b[_0x4d10('0x4a')],_0x4febf3[_0x4d10('0x4e')],md5(_0x4febf3['uniqueid']));}else{_0x4febf3[_0x4d10('0x4c')]='';}headers[_0x4d10('0x4f')]=getAuth(_0x322b1b);return getUser(_0x322b1b,_0x5cdbec['email'])[_0x4d10('0x16')](function(_0x8c5b4c){_0x50ddb6=_0x8c5b4c;logger[_0x4d10('0xd')](_0x4d10('0x50'),_0x50ddb6['id']);return getEndUser(_0x322b1b,_0x4febf3[_0x4d10('0x51')],_0x4febf3[_0x4d10('0x52')]);})[_0x4d10('0x16')](function(_0x110048){_0x50a4f8=_0x110048;logger[_0x4d10('0xd')](_0x4d10('0x53'),_0x50a4f8['id']);return getTicket(_0x322b1b,_0x50ddb6,_0x50a4f8,_0x1983d3,_0x4febf3);})['then'](function(_0x3c9c77){if(_0x3c9c77){logger[_0x4d10('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3c9c77['id']);switch(_0x322b1b[_0x4d10('0x3c')]){case _0x4d10('0x54'):logger['info'](_0x4d10('0x55'),_0x4d10('0x56'));return request({'uri':util[_0x4d10('0xe')](_0x4d10('0x57'),_0x322b1b[_0x4d10('0xf')],_0x50ddb6['id'],_0x3c9c77['id']),'method':_0x4d10('0x29')});case _0x4d10('0x58'):logger[_0x4d10('0xd')](_0x4d10('0x55'),_0x4d10('0x59'));emit(util[_0x4d10('0xe')]('user:%s',_0x5cdbec[_0x4d10('0x11')]),_0x4d10('0x5a'),{'uri':util[_0x4d10('0xe')]('%s/agent/tickets/%s',_0x322b1b[_0x4d10('0xf')][_0x4d10('0x5b')]('/api/v2',''),_0x3c9c77['id'])});break;default:logger[_0x4d10('0x5c')](_0x4d10('0x55'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x4d10('0x5d')](function(_0x3509c4){logger[_0x4d10('0x5c')](_0x4d10('0x5e'),util['inspect'](_0x3509c4,{'showHidden':!![],'depth':null}));});};exports[_0x4d10('0x5f')]=function(_0x3bbd4c,_0x418f7d,_0x3ece43,_0x2415cc,_0x3123c1,_0xc1765b,_0x5d7771){var _0x2002a1,_0x59f0fa;_0xc1765b['remoteUri']=intUtil['stripTrailingSlash'](_0xc1765b[_0x4d10('0xf')]);_0xc1765b[_0x4d10('0x4a')]=intUtil['stripTrailingSlash'](_0xc1765b[_0x4d10('0x4a')]);if(_0x5d7771&&_0x5d7771[_0x4d10('0x60')]&&_0x5d7771[_0x4d10('0x60')]!==_0x4d10('0x61')){logger[_0x4d10('0xd')](_0x4d10('0x62'),_0x4d10('0x63'));_0x418f7d[_0x4d10('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xc1765b[_0x4d10('0x4a')],_0x418f7d['uniqueid'],md5(_0x418f7d[_0x4d10('0x4e')]));}headers[_0x4d10('0x4f')]=getAuth(_0xc1765b);return getUser(_0xc1765b,_0x2415cc[_0x4d10('0x64')])[_0x4d10('0x16')](function(_0x329129){_0x2002a1=_0x329129;logger[_0x4d10('0xd')](_0x4d10('0x50'),_0x2002a1['id']);return getEndUser(_0xc1765b,_0x418f7d['destcalleridname'],_0x418f7d[_0x4d10('0x65')]);})[_0x4d10('0x16')](function(_0x1e4898){_0x59f0fa=_0x1e4898;logger[_0x4d10('0xd')](_0x4d10('0x53'),_0x59f0fa['id']);return getTicket(_0xc1765b,_0x2002a1,_0x59f0fa,_0x3ece43,_0x418f7d);})['then'](function(_0x16edc7){if(_0x16edc7){logger['info'](_0x4d10('0x66'),_0x16edc7['id']);switch(_0xc1765b['type']){case _0x4d10('0x54'):logger['info']('[OUTBOUND]',_0x4d10('0x56'));return request({'uri':util['format'](_0x4d10('0x57'),_0xc1765b['remoteUri'],_0x2002a1['id'],_0x16edc7['id']),'method':_0x4d10('0x29')});case _0x4d10('0x58'):logger[_0x4d10('0xd')](_0x4d10('0x62'),_0x4d10('0x59'));emit(util[_0x4d10('0xe')](_0x4d10('0x67'),_0x2415cc[_0x4d10('0x11')]),_0x4d10('0x5a'),{'uri':util[_0x4d10('0xe')](_0x4d10('0x68'),_0xc1765b[_0x4d10('0xf')][_0x4d10('0x5b')](_0x4d10('0x69'),''),_0x16edc7['id'])});break;default:logger['error'](_0x4d10('0x62'),_0x4d10('0x6a'));}}})[_0x4d10('0x5d')](function(_0x5bfce6){logger['error'](_0x4d10('0x6b'),util[_0x4d10('0x6c')](_0x5bfce6,{'showHidden':!![],'depth':null}));});};exports[_0x4d10('0x6d')]=function(_0x51abaa,_0x4ecdd9,_0x5319d1,_0x144bdc,_0x4955e3,_0x1706b5){var _0x3b64ce,_0xeb5266;_0x1706b5[_0x4d10('0xf')]=intUtil['stripTrailingSlash'](_0x1706b5[_0x4d10('0xf')]);_0x1706b5[_0x4d10('0x4a')]=intUtil[_0x4d10('0x49')](_0x1706b5[_0x4d10('0x4a')]);if(_0x4955e3&&_0x4955e3[_0x4d10('0x4b')]){logger[_0x4d10('0xd')]('['+_0x4ecdd9[_0x4d10('0x6e')][_0x4d10('0x6f')]()+']',_0x4d10('0x63'));_0x4ecdd9[_0x4d10('0x4c')]=util[_0x4d10('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1706b5['serverUrl'],_0x4ecdd9[_0x4d10('0x4e')],md5(_0x4ecdd9[_0x4d10('0x4e')]));}else{_0x4ecdd9[_0x4d10('0x4c')]='';}headers['Authorization']=getAuth(_0x1706b5);return getUser(_0x1706b5)[_0x4d10('0x16')](function(_0x22b6ed){_0x3b64ce=_0x22b6ed;logger[_0x4d10('0xd')](_0x4d10('0x50'),_0x3b64ce['id']);return getEndUser(_0x1706b5,_0x4ecdd9['calleridname'],_0x4ecdd9[_0x4d10('0x52')]);})[_0x4d10('0x16')](function(_0x30f190){_0xeb5266=_0x30f190;logger[_0x4d10('0xd')](_0x4d10('0x53'),_0xeb5266['id']);return getTicket(_0x1706b5,_0x3b64ce,_0xeb5266,_0x5319d1,_0x4ecdd9);})[_0x4d10('0x16')](function(_0x37c859){if(_0x37c859){logger['info'](_0x4d10('0x66'),_0x37c859['id']);}})['catch'](function(_0x5e944f){logger['error']('['+_0x4ecdd9[_0x4d10('0x6e')][_0x4d10('0x6f')]()+']'+_0x4d10('0x70'),util[_0x4d10('0x6c')](_0x5e944f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index d009417..af72156 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x758e=['variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','isArrayLikeObject','findIndex','email','users','profile','Administrator','Using\x20the\x20admin\x20account!','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','startCase','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','Contacts','then','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Who_Id','Full_Name','First_Name','Last_Name','$se_module','Call_Duration','talktime','mm:ss','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridnum','Outbound','unmanaged','monitor_format','toUpperCase','lodash','util','./util','moment','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','[HTTP]','stringify','forEach','includes','picklist','idField','content','toString','type'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x758e,0x1af));var _0xe758=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x758e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe758('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xe758('0x1'));var intUtil=require(_0xe758('0x2'));var moment=require(_0xe758('0x3'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0xe758('0x4'));var logger=require(_0xe758('0x5'))(_0xe758('0x6'));config[_0xe758('0x7')]=_['defaults'](config[_0xe758('0x7')],{'host':_0xe758('0x8'),'port':0x18eb});var io=require(_0xe758('0x9'))(new Redis(config['redis']));function emit(_0x4c03ba,_0x454ee0,_0x55601a){io['to'](_0x4c03ba)['emit'](_0x454ee0,_0x55601a);}function request(_0x4c16c3){logger['debug'](_0xe758('0xa'),JSON[_0xe758('0xb')](_0x4c16c3));return rp(_0x4c16c3);}function getCustomFields(_0xa84160,_0x4cdd20){var _0x3971f7={};if(_0xa84160['length']>0x0){_[_0xe758('0xc')](_0xa84160,function(_0x38131a){if(_[_0xe758('0xd')](['string',_0xe758('0xe')],_0x38131a['type'])&&_0x38131a[_0xe758('0xf')]){_0x3971f7[_0x38131a[_0xe758('0xf')]]=_0x38131a[_0xe758('0x10')][_0xe758('0x11')]();}else if(_0x38131a[_0xe758('0x12')]===_0xe758('0x13')&&_0x38131a[_0xe758('0x14')]&&_0x38131a[_0xe758('0xf')]&&_0x4cdd20[_0x38131a[_0xe758('0x14')]]){_0x3971f7[_0x38131a['idField']]=_0x4cdd20[_0x38131a[_0xe758('0x14')]]['toString']();}else if(_0x38131a['type']===_0xe758('0x15')&&_0x38131a[_0xe758('0x16')]&&_0x38131a['Variable']['name']&&_0x38131a[_0xe758('0xf')]&&_0x4cdd20[_0x38131a[_0xe758('0x16')][_0xe758('0x17')][_0xe758('0x18')]()]){_0x3971f7[_0x38131a[_0xe758('0xf')]]=_0x4cdd20[_0x38131a[_0xe758('0x16')]['name']['toLowerCase']()][_0xe758('0x11')]();}});}return _0x3971f7;}function getName(_0x2b5729){if(_0x2b5729[_0xe758('0x19')]('\x20')>0x0){var _0x1dc8fc=_0x2b5729[_0xe758('0x1a')](/ (.+)/);if(_0x1dc8fc[0x1]){return _0x1dc8fc;}}return[_0x2b5729,_0x2b5729];}var accountsTokens={};function getAccessToken(_0x4d35d3){return new Promise(function(_0x4eeb82,_0x2a490f){if(!_[_0xe758('0x1b')](accountsTokens[_0x4d35d3['id']])&&!_[_0xe758('0x1b')](accountsTokens[_0x4d35d3['id']][_0xe758('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x4d35d3['id']][_0xe758('0x1d')])){_0x4eeb82(accountsTokens[_0x4d35d3['id']][_0xe758('0x1c')]);}}var _0x19373a;switch(_0x4d35d3[_0xe758('0x1e')]){case'US':_0x19373a=_0xe758('0x1f');break;case'AU':_0x19373a=_0xe758('0x20');break;case'EU':_0x19373a=_0xe758('0x21');break;case'IN':_0x19373a='https://accounts.zoho.in';break;case'CN':_0x19373a='https://accounts.zoho.com.cn';break;default:_0x19373a='https://accounts.zoho.eu';break;}var _0x4e3828={'method':_0xe758('0x22'),'uri':_0x19373a+_0xe758('0x23'),'qs':{'refresh_token':_0x4d35d3[_0xe758('0x24')],'client_id':_0x4d35d3[_0xe758('0x25')],'client_secret':_0x4d35d3['clientSecret'],'grant_type':_0xe758('0x26')},'json':!![]};return rp(_0x4e3828)['then'](function(_0x3bcdac){accountsTokens[_0x4d35d3['id']]={'access_token':_0x3bcdac['access_token'],'expires_in':moment()['add'](_0x3bcdac[_0xe758('0x1d')],_0xe758('0x27'))};_0x4eeb82(_0x3bcdac[_0xe758('0x1c')]);})[_0xe758('0x28')](function(_0x5d557b){logger[_0xe758('0x29')](_0xe758('0x2a'),_0x5d557b[_0xe758('0x2b')]);_0x2a490f(_0x5d557b);});});}function getUser(_0x1934d9,_0x52279e,_0x3a7e96,_0x596835){logger[_0xe758('0x2c')](_0xe758('0x2d'));return request({'method':_0xe758('0x2e'),'uri':util[_0xe758('0x2f')](_0xe758('0x30'),_0x52279e),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1934d9},'json':!![]})['then'](function(_0x450271){if(_0x450271['users']){var _0x44f767=-0x1;if(_[_0xe758('0x31')](_0x450271['users'])){if(!_['isNil'](_0x596835)){_0x44f767=_[_0xe758('0x32')](_0x450271['users'],function(_0xcd9e89){return _0xcd9e89[_0xe758('0x33')]===_0x596835;});}if(_0x44f767>=0x0){logger[_0xe758('0x2c')]('Agent\x20found!');}else{logger[_0xe758('0x2c')]('Using\x20the\x20admin\x20account!');_0x44f767=_[_0xe758('0x32')](_0x450271[_0xe758('0x34')],function(_0x5a01e1){return _0x5a01e1[_0xe758('0x35')][_0xe758('0x17')]===_0xe758('0x36');});}return _0x450271['users'][_0x44f767];}else{if(_0x450271['user'][_0xe758('0x35')]['name']===_0xe758('0x36')){logger[_0xe758('0x2c')](_0xe758('0x37'));user=_0x450271[_0xe758('0x38')];return user;}else{logger[_0xe758('0x29')](_0xe758('0x39'),JSON['stringify'](_0x450271));throw new Error(_0xe758('0x3a')+JSON['stringify'](_0x450271));}}}else{logger['error'](_0xe758('0x39'),JSON[_0xe758('0xb')](_0x450271));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xe758('0xb')](_0x450271));}})[_0xe758('0x28')](function(_0x473711){console['error'](_0x473711);});}function getZohoUser(_0x2a003b,_0x32457e){return new BPromise(function(_0x43403a,_0xaa0351){request(_0x2a003b)['then'](function(_0x1facc6){var _0x6f31e1=null;if(_0x1facc6){_0x6f31e1=_0x1facc6[_0xe758('0x3b')][0x0];_0x6f31e1[_0xe758('0x3c')]=_0x32457e;}_0x43403a(_0x6f31e1);})['catch'](function(_0x392e1a){_0xaa0351(_0x392e1a);});});}function createEndUser(_0x528b68,_0x50304f,_0x36e6e7,_0x28ecd9,_0x932fad,_0x57190e){var _0x36e6e7=getName(_0x36e6e7);return request({'method':_0xe758('0x22'),'uri':_0xe758('0x3d')+_0x50304f+_0xe758('0x3e')+_['startCase'](_0x57190e[_0xe758('0x3f')])+'s','body':{'data':[{'Last_Name':_0x36e6e7[0x1],'First_Name':_0x36e6e7[0x0],'Phone':_0x28ecd9,'Owner':{'name':!_[_0xe758('0x1b')](_0x932fad[_0xe758('0x40')][_0xe758('0x17')])?_0x932fad['role'][_0xe758('0x17')]:!_['isNil'](_0x932fad[_0xe758('0x41')])?_0x932fad[_0xe758('0x41')]+'\x20'+_0x932fad['last_name']:_0x932fad[_0xe758('0x42')],'id':_0x932fad['id']}}]},'headers':{'Authorization':_0xe758('0x43')+_0x528b68},'json':!![]})['then'](function(_0x42469a){if(_0x42469a&&_0x42469a[_0xe758('0x3b')][0x0][_0xe758('0x44')]===_0xe758('0x45')){var _0x1aec7b=_0x42469a[_0xe758('0x3b')][0x0][_0xe758('0x46')];_0x1aec7b[_0xe758('0x3c')]=_[_0xe758('0x47')](_0x57190e['moduleCreate'])+'s';return _0x1aec7b;}logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0xe758('0x48')+JSON[_0xe758('0xb')](data));})[_0xe758('0x28')](function(_0xb18ce1){console[_0xe758('0x49')](_0xe758('0x4a'),_0xb18ce1);});}function getEndUser(_0x5f5a88,_0x63b899,_0x1a29cd,_0x550903,_0x544993,_0x252000,_0x2d96d7){var _0x3d3d6f={'method':_0xe758('0x2e'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5f5a88},'json':!![]};switch(_0x2d96d7[_0xe758('0x4b')]){case _0xe758('0x4c'):_0x3d3d6f[_0xe758('0x4d')]='https://www.zohoapis.'+_0x63b899+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x544993+'))';return getZohoUser(_0x3d3d6f,_0xe758('0x4e'))[_0xe758('0x4f')](function(_0x26abce){if(_0x26abce)return _0x26abce;_0x3d3d6f[_0xe758('0x4d')]=_0xe758('0x3d')+_0x63b899+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x544993+'))';return getZohoUser(_0x3d3d6f,_0xe758('0x50'))[_0xe758('0x4f')](function(_0x58ebcc){if(_0x58ebcc)return _0x58ebcc;if(_0x2d96d7['moduleCreate']!=_0xe758('0x51')){return createEndUser(_0x5f5a88,_0x63b899,_0x550903,_0x544993,_0x252000,_0x2d96d7);}else{return{};}});});break;case _0xe758('0x52'):_0x3d3d6f['uri']=_0xe758('0x3d')+_0x63b899+_0xe758('0x53')+_0x544993+'))';return getZohoUser(_0x3d3d6f,_0xe758('0x4e'))['then'](function(_0x344bea){if(_0x344bea)return _0x344bea;if(_0x2d96d7[_0xe758('0x3f')]!='nothing'){return createEndUser(_0x5f5a88,_0x63b899,_0x550903,_0x544993,_0x252000,_0x2d96d7);}else{return{};}});break;case _0xe758('0x54'):_0x3d3d6f[_0xe758('0x4d')]='https://www.zohoapis.'+_0x63b899+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x544993+'))';return getZohoUser(_0x3d3d6f,_0xe758('0x50'))[_0xe758('0x4f')](function(_0x16bf26){if(_0x16bf26)return _0x16bf26;if(_0x2d96d7[_0xe758('0x3f')]!=_0xe758('0x51')){return createEndUser(_0x5f5a88,_0x63b899,_0x550903,_0x544993,_0x252000,_0x2d96d7);}else{return{};}});break;}}function getCall(_0x29bc4e,_0x158fb3,_0x1c8364,_0x5a0348,_0xb02e52,_0x457b5d,_0x30d61d,_0x5f50d8){logger['info'](_0xe758('0x55'));var _0x4d66a1={};_0x4d66a1[_0xe758('0x56')]={'name':!_[_0xe758('0x1b')](_0x5a0348['role'][_0xe758('0x17')])&&!_[_0xe758('0x1b')](_0x5a0348[_0xe758('0x35')][_0xe758('0x17')])&&_0x5a0348['profile'][_0xe758('0x17')]===_0xe758('0x57')?_0x5a0348['role'][_0xe758('0x17')]:!_['isNil'](_0x5a0348['first_name'])?_0x5a0348[_0xe758('0x41')]+'\x20'+_0x5a0348[_0xe758('0x42')]:_0x5a0348[_0xe758('0x42')],'id':_0x5a0348['id']};_0x4d66a1[_0xe758('0x58')]=intUtil[_0xe758('0x59')](_0x457b5d[_0xe758('0x5a')],_0x30d61d,'\x20');_0x4d66a1['Description']=intUtil[_0xe758('0x59')](_0x457b5d['Descriptions'],_0x30d61d,'\x0a');if(_0xb02e52[_0xe758('0x3c')]==='Contacts'){_0x4d66a1[_0xe758('0x5b')]={'name':!_[_0xe758('0x1b')](_0xb02e52[_0xe758('0x5c')])?_0xb02e52[_0xe758('0x5c')]:!_['isNil'](_0xb02e52[_0xe758('0x5d')])?_0xb02e52['First_Name']+'\x20'+_0xb02e52[_0xe758('0x5e')]:_0xb02e52['Last_Name'],'id':_0xb02e52['id']};}if(_0xb02e52[_0xe758('0x3c')]===_0xe758('0x50')){_0x4d66a1['What_Id']={'name':!_[_0xe758('0x1b')](_0xb02e52['Full_Name'])?_0xb02e52[_0xe758('0x5c')]:!_[_0xe758('0x1b')](_0xb02e52['First_Name'])?_0xb02e52[_0xe758('0x5d')]+'\x20'+_0xb02e52['Last_Name']:_0xb02e52[_0xe758('0x5e')],'id':_0xb02e52['id']};_0x4d66a1[_0xe758('0x5f')]=_[_0xe758('0x47')](_0xb02e52[_0xe758('0x3c')]);}if(_0x30d61d['talktime']){_0x4d66a1[_0xe758('0x60')]=moment['utc'](parseInt(_0x30d61d[_0xe758('0x61')])*0x3e8)[_0xe758('0x2f')](_0xe758('0x62'));}else if(_0x30d61d[_0xe758('0x63')]&&_0x30d61d[_0xe758('0x64')]){_0x4d66a1['Call_Duration']=moment[_0xe758('0x65')](moment(_0x30d61d[_0xe758('0x64')],_0xe758('0x66'))['diff'](moment(_0x30d61d[_0xe758('0x67')],'YYYY-MM-DDTHH:mm:ss')))[_0xe758('0x2f')](_0xe758('0x62'));}switch(_0x30d61d[_0xe758('0x68')]){case'called':_0x4d66a1[_0xe758('0x69')]='Called';break;case _0xe758('0x6a'):case _0xe758('0x6b'):_0x4d66a1[_0xe758('0x69')]=_0xe758('0x6c');break;case _0xe758('0x6d'):_0x4d66a1[_0xe758('0x69')]=_0xe758('0x6e');break;case _0xe758('0x6f'):_0x4d66a1[_0xe758('0x69')]=_0xe758('0x70');break;case _0xe758('0x71'):_0x4d66a1[_0xe758('0x69')]=_0xe758('0x72');default:}_0x4d66a1[_0xe758('0x73')]=(_0x5f50d8===_0xe758('0x74')?moment(_0x30d61d[_0xe758('0x67')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x30d61d['agentcalledAt'])[_0xe758('0x2f')](_0xe758('0x66')))||moment()[_0xe758('0x2f')](_0xe758('0x66'));_0x4d66a1[_0xe758('0x75')]=_0x5f50d8||_0xe758('0x76');_0x4d66a1=_[_0xe758('0x77')](_0x4d66a1,getCustomFields(_0x457b5d[_0xe758('0x78')],_0x30d61d));return request({'method':_0xe758('0x22'),'uri':_0xe758('0x3d')+_0x158fb3+'/crm/v2/Calls','headers':{'Authorization':_0xe758('0x43')+_0x29bc4e},'body':{'data':[_0x4d66a1]},'json':!![]})[_0xe758('0x4f')](function(_0x108758){if(_0x108758&&_0x108758[_0xe758('0x3b')][0x0][_0xe758('0x44')]===_0xe758('0x45')){logger[_0xe758('0x2c')](_0xe758('0x79'));return{'id':_0x108758['data'][0x0][_0xe758('0x46')]['id']};}})[_0xe758('0x28')](function(_0x53809b){logger[_0xe758('0x2c')]('err',_0x53809b[_0xe758('0x2b')]);console['log'](_0xe758('0x7a'),_0x53809b);});}exports[_0xe758('0x7b')]=function(_0x1d05ee,_0x259a78,_0x3aea99,_0x1268b4,_0x4e61e5,_0x463ae7){var _0x4411fa,_0x2abe24,_0x3aa291;_0x463ae7[_0xe758('0x7c')]=intUtil[_0xe758('0x7d')](_0x463ae7[_0xe758('0x7c')]);_0x463ae7[_0xe758('0x7e')]=intUtil[_0xe758('0x7d')](_0x463ae7[_0xe758('0x7e')]);if(_0x4e61e5&&_0x4e61e5['monitor_format']){logger[_0xe758('0x2c')]('[QUEUE]',_0xe758('0x7f'));_0x259a78[_0xe758('0x80')]=_0x463ae7['serverUrl']+_0xe758('0x81')+_0x259a78['uniqueid']+_0xe758('0x82')+md5(_0x259a78[_0xe758('0x83')]);}else{_0x259a78[_0xe758('0x80')]='';}var _0x405adf=_0x463ae7[_0xe758('0x7c')]===_0xe758('0x84')?'eu':_0xe758('0x85');return getAccessToken(_0x463ae7)[_0xe758('0x4f')](function(_0x2b8c69){_0x3aa291=_0x2b8c69;return getUser(_0x3aa291,_0x405adf,_0x463ae7,_0x1268b4[_0xe758('0x33')]);})['then'](function(_0x14c7d7){_0x4411fa=_0x14c7d7;logger[_0xe758('0x2c')](_0xe758('0x86'),_0x4411fa['id']);return getEndUser(_0x3aa291,_0x405adf,_0x463ae7,_0x259a78[_0xe758('0x87')],_0x259a78[_0xe758('0x88')],_0x4411fa,_0x3aea99);})[_0xe758('0x4f')](function(_0x4fb550){_0x2abe24=_0x4fb550;return getCall(_0x3aa291,_0x405adf,_0x463ae7,_0x4411fa,_0x2abe24,_0x3aea99,_0x259a78,_0xe758('0x76'));})[_0xe758('0x4f')](function(_0x3a41c2){if(_0x3a41c2){logger[_0xe758('0x2c')](_0xe758('0x89'),_0x3a41c2['id']);logger[_0xe758('0x2c')](_0xe758('0x8a'),_0xe758('0x8b'));emit(util[_0xe758('0x2f')](_0xe758('0x8c'),_0x1268b4['name']),'trigger:browser:url',{'uri':_0xe758('0x8d')+_0x463ae7['host']+_0xe758('0x8e')+_0x3a41c2['id']});}})[_0xe758('0x28')](function(_0x12da60){logger[_0xe758('0x29')](_0xe758('0x8a'),JSON[_0xe758('0xb')](_0x12da60));});};exports[_0xe758('0x74')]=function(_0x2f03d6,_0x269610,_0x440c46,_0x34412b,_0x329604,_0x2a190a,_0x955859){var _0x4cf9a7,_0x5559e3,_0x4d887a;_0x2a190a[_0xe758('0x7c')]=intUtil[_0xe758('0x7d')](_0x2a190a[_0xe758('0x7c')]);_0x2a190a[_0xe758('0x7e')]=intUtil[_0xe758('0x7d')](_0x2a190a[_0xe758('0x7e')]);if(_0x955859&&_0x955859['recordingFormat']&&_0x955859[_0xe758('0x8f')]!=='none'){logger[_0xe758('0x2c')](_0xe758('0x90'),_0xe758('0x7f'));_0x269610[_0xe758('0x80')]=_0x2a190a[_0xe758('0x7e')]+_0xe758('0x81')+_0x269610[_0xe758('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x269610[_0xe758('0x83')]);}var _0x3aedbe=_0x2a190a['host']===_0xe758('0x84')?'eu':'com';return getAccessToken(_0x2a190a)[_0xe758('0x4f')](function(_0x864cee){_0x4d887a=_0x864cee;return getUser(_0x4d887a,_0x3aedbe,_0x2a190a,_0x34412b[_0xe758('0x33')]);})[_0xe758('0x4f')](function(_0x21268b){_0x4cf9a7=_0x21268b;logger['info'](_0xe758('0x86'),_0x4cf9a7['id']);return getEndUser(_0x4d887a,_0x3aedbe,_0x2a190a,_0x269610['destcalleridname'],_0x269610[_0xe758('0x91')],_0x4cf9a7,_0x440c46);})[_0xe758('0x4f')](function(_0x16a134){_0x5559e3=_0x16a134;return getCall(_0x4d887a,_0x3aedbe,_0x2a190a,_0x4cf9a7,_0x5559e3,_0x440c46,_0x269610,_0xe758('0x92'));})[_0xe758('0x4f')](function(_0x5555b9){if(_0x5555b9){logger['info'](_0xe758('0x89'),_0x5555b9['id']);logger[_0xe758('0x2c')](_0xe758('0x90'),_0xe758('0x8b'));emit(util[_0xe758('0x2f')](_0xe758('0x8c'),_0x34412b[_0xe758('0x17')]),'trigger:browser:url',{'uri':_0xe758('0x8d')+_0x2a190a['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x5555b9['id']});}})[_0xe758('0x28')](function(_0x5c3465){logger[_0xe758('0x29')](_0xe758('0x90'),JSON[_0xe758('0xb')](_0x5c3465));});};exports[_0xe758('0x93')]=function(_0x5bd737,_0x4474b2,_0x3ab804,_0x5a7986,_0x36b59f,_0x373d24){var _0x43d9cd,_0x4c1b32,_0x1d8600;_0x373d24[_0xe758('0x7c')]=intUtil['stripTrailingSlash'](_0x373d24[_0xe758('0x7c')]);_0x373d24['serverUrl']=intUtil['stripTrailingSlash'](_0x373d24[_0xe758('0x7e')]);if(_0x36b59f&&_0x36b59f[_0xe758('0x94')]){logger[_0xe758('0x2c')]('['+_0x4474b2[_0xe758('0x68')][_0xe758('0x95')]()+']',_0xe758('0x7f'));_0x4474b2[_0xe758('0x80')]=_0x373d24[_0xe758('0x7e')]+_0xe758('0x81')+_0x4474b2[_0xe758('0x83')]+_0xe758('0x82')+md5(_0x4474b2[_0xe758('0x83')]);}else{_0x4474b2[_0xe758('0x80')]='';}var _0x57a702=_0x373d24['host']===_0xe758('0x84')?'eu':'com';return getAccessToken(_0x373d24)['then'](function(_0x401caa){_0x1d8600=_0x401caa;return getUser(_0x1d8600,_0x57a702,_0x373d24);})[_0xe758('0x4f')](function(_0x5127fa){_0x43d9cd=_0x5127fa;logger[_0xe758('0x2c')](_0xe758('0x86'),_0x43d9cd['id']);return getEndUser(_0x1d8600,_0x57a702,_0x373d24,_0x4474b2[_0xe758('0x87')],_0x4474b2['calleridnum'],_0x43d9cd,_0x3ab804);})[_0xe758('0x4f')](function(_0x3ce595){_0x4c1b32=_0x3ce595;return getCall(_0x1d8600,_0x57a702,_0x373d24,_0x43d9cd,_0x4c1b32,_0x3ab804,_0x4474b2,_0xe758('0x76'));})[_0xe758('0x4f')](function(_0x2ad7c2){if(_0x2ad7c2){logger['info'](_0xe758('0x89'),_0x2ad7c2['id']);}})[_0xe758('0x28')](function(_0x45be6e){logger[_0xe758('0x29')]('['+_0x4474b2[_0xe758('0x68')][_0xe758('0x95')]()+']',JSON['stringify'](_0x45be6e));});};
\ No newline at end of file
+var _0x5694=['debug','[HTTP]','stringify','length','forEach','string','picklist','idField','content','toString','variable','variableName','type','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','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','clientId','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','users','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','/crm/v2/','moduleCreate','role','first_name','last_name','data','SUCCESS','enduserType','startCase','The\x20failing\x20result\x20is','Error:\x20','log','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','administrator','Subject','Subjects','Description','getString','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Timeout','Call_Start_Time','agentcalledAt','merge','code','Call\x20created!','details','err','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','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=','outbound','host','recordingFormat','none','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x219ed2,_0x1f5c44){var _0x450260=function(_0xd20a3b){while(--_0xd20a3b){_0x219ed2['push'](_0x219ed2['shift']());}};_0x450260(++_0x1f5c44);}(_0x5694,0x1ca));var _0x4569=function(_0x4855ad,_0x365626){_0x4855ad=_0x4855ad-0x0;var _0x22eec4=_0x5694[_0x4855ad];return _0x22eec4;};'use strict';var _=require(_0x4569('0x0'));var rp=require(_0x4569('0x1'));var md5=require(_0x4569('0x2'));var util=require(_0x4569('0x3'));var intUtil=require('./util');var moment=require(_0x4569('0x4'));var Redis=require(_0x4569('0x5'));var BPromise=require(_0x4569('0x6'));var config=require('../../../../config/environment');var logger=require(_0x4569('0x7'))('zoho');config[_0x4569('0x8')]=_[_0x4569('0x9')](config[_0x4569('0x8')],{'host':_0x4569('0xa'),'port':0x18eb});var io=require(_0x4569('0xb'))(new Redis(config[_0x4569('0x8')]));function emit(_0x86dbc4,_0x2cbcfa,_0x2b729e){io['to'](_0x86dbc4)[_0x4569('0xc')](_0x2cbcfa,_0x2b729e);}function request(_0x5e4c6a){logger[_0x4569('0xd')](_0x4569('0xe'),JSON[_0x4569('0xf')](_0x5e4c6a));return rp(_0x5e4c6a);}function getCustomFields(_0x2f4036,_0x54bb8f){var _0x4b0837={};if(_0x2f4036[_0x4569('0x10')]>0x0){_[_0x4569('0x11')](_0x2f4036,function(_0x9ec70e){if(_['includes']([_0x4569('0x12'),_0x4569('0x13')],_0x9ec70e['type'])&&_0x9ec70e[_0x4569('0x14')]){_0x4b0837[_0x9ec70e[_0x4569('0x14')]]=_0x9ec70e[_0x4569('0x15')][_0x4569('0x16')]();}else if(_0x9ec70e['type']===_0x4569('0x17')&&_0x9ec70e[_0x4569('0x18')]&&_0x9ec70e[_0x4569('0x14')]&&_0x54bb8f[_0x9ec70e[_0x4569('0x18')]]){_0x4b0837[_0x9ec70e['idField']]=_0x54bb8f[_0x9ec70e[_0x4569('0x18')]]['toString']();}else if(_0x9ec70e[_0x4569('0x19')]===_0x4569('0x1a')&&_0x9ec70e[_0x4569('0x1b')]&&_0x9ec70e['Variable'][_0x4569('0x1c')]&&_0x9ec70e[_0x4569('0x14')]&&_0x54bb8f[_0x9ec70e[_0x4569('0x1b')]['name'][_0x4569('0x1d')]()]){_0x4b0837[_0x9ec70e[_0x4569('0x14')]]=_0x54bb8f[_0x9ec70e[_0x4569('0x1b')]['name'][_0x4569('0x1d')]()][_0x4569('0x16')]();}});}return _0x4b0837;}function getName(_0x26f38b){if(_0x26f38b[_0x4569('0x1e')]('\x20')>0x0){var _0xe541e6=_0x26f38b['split'](/ (.+)/);if(_0xe541e6[0x1]){return _0xe541e6;}}return[_0x26f38b,_0x26f38b];}var accountsTokens={};function getAccessToken(_0x1b8a00){return new Promise(function(_0x170f6e,_0xdce0bd){if(!_[_0x4569('0x1f')](accountsTokens[_0x1b8a00['id']])&&!_['isNil'](accountsTokens[_0x1b8a00['id']][_0x4569('0x20')])){if(moment()['isBefore'](accountsTokens[_0x1b8a00['id']][_0x4569('0x21')])){_0x170f6e(accountsTokens[_0x1b8a00['id']][_0x4569('0x20')]);}}var _0x1b181d;switch(_0x1b8a00[_0x4569('0x22')]){case'US':_0x1b181d=_0x4569('0x23');break;case'AU':_0x1b181d=_0x4569('0x24');break;case'EU':_0x1b181d=_0x4569('0x25');break;case'IN':_0x1b181d=_0x4569('0x26');break;case'CN':_0x1b181d=_0x4569('0x27');break;default:_0x1b181d=_0x4569('0x25');break;}var _0x282c12={'method':_0x4569('0x28'),'uri':_0x1b181d+_0x4569('0x29'),'qs':{'refresh_token':_0x1b8a00['refreshToken'],'client_id':_0x1b8a00[_0x4569('0x2a')],'client_secret':_0x1b8a00[_0x4569('0x2b')],'grant_type':_0x4569('0x2c')},'json':!![]};return rp(_0x282c12)['then'](function(_0x510df6){accountsTokens[_0x1b8a00['id']]={'access_token':_0x510df6[_0x4569('0x20')],'expires_in':moment()[_0x4569('0x2d')](_0x510df6['expires_in'],_0x4569('0x2e'))};_0x170f6e(_0x510df6['access_token']);})[_0x4569('0x2f')](function(_0x500ea9){logger[_0x4569('0x30')](_0x4569('0x31'),_0x500ea9[_0x4569('0x32')]);_0xdce0bd(_0x500ea9);});});}function getUser(_0xb5a26c,_0x75e04c,_0x29f6b1,_0x16bd59){logger['info'](_0x4569('0x33'));return request({'method':_0x4569('0x34'),'uri':util[_0x4569('0x35')](_0x4569('0x36'),_0x75e04c),'qs':{'type':_0x4569('0x37')},'headers':{'Authorization':_0x4569('0x38')+_0xb5a26c},'json':!![]})['then'](function(_0x434184){if(_0x434184['users']){var _0x566ca7=-0x1;if(_[_0x4569('0x39')](_0x434184['users'])){if(!_[_0x4569('0x1f')](_0x16bd59)){_0x566ca7=_[_0x4569('0x3a')](_0x434184['users'],function(_0x435a6a){return _0x435a6a[_0x4569('0x3b')]===_0x16bd59;});}if(_0x566ca7>=0x0){logger[_0x4569('0x3c')](_0x4569('0x3d'));}else{logger['info'](_0x4569('0x3e'));_0x566ca7=_['findIndex'](_0x434184[_0x4569('0x3f')],function(_0x430f79){return _0x430f79[_0x4569('0x40')][_0x4569('0x1c')]===_0x4569('0x41');});}return _0x434184['users'][_0x566ca7];}else{if(_0x434184[_0x4569('0x42')]['profile']['name']==='Administrator'){logger[_0x4569('0x3c')](_0x4569('0x3e'));user=_0x434184['user'];return user;}else{logger[_0x4569('0x30')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x434184));throw new Error(_0x4569('0x43')+JSON[_0x4569('0xf')](_0x434184));}}}else{logger[_0x4569('0x30')]('The\x20failing\x20result\x20is',JSON[_0x4569('0xf')](_0x434184));throw new Error(_0x4569('0x43')+JSON[_0x4569('0xf')](_0x434184));}})[_0x4569('0x2f')](function(_0x2f4a00){console[_0x4569('0x30')](_0x2f4a00);});}function getZohoUser(_0x4a54f0,_0x1ae2e7){return new BPromise(function(_0x31cfb5,_0x42bc0e){request(_0x4a54f0)[_0x4569('0x44')](function(_0x5c7fd5){var _0xb1e2e7=null;if(_0x5c7fd5){_0xb1e2e7=_0x5c7fd5['data'][0x0];_0xb1e2e7['enduserType']=_0x1ae2e7;}_0x31cfb5(_0xb1e2e7);})['catch'](function(_0x15edbd){_0x42bc0e(_0x15edbd);});});}function createEndUser(_0x78c6dd,_0x122563,_0x2a8f95,_0x5c090a,_0x3908b3,_0x3841d8){var _0x2a8f95=getName(_0x2a8f95);return request({'method':_0x4569('0x28'),'uri':'https://www.zohoapis.'+_0x122563+_0x4569('0x45')+_['startCase'](_0x3841d8[_0x4569('0x46')])+'s','body':{'data':[{'Last_Name':_0x2a8f95[0x1],'First_Name':_0x2a8f95[0x0],'Phone':_0x5c090a,'Owner':{'name':!_[_0x4569('0x1f')](_0x3908b3[_0x4569('0x47')][_0x4569('0x1c')])?_0x3908b3[_0x4569('0x47')][_0x4569('0x1c')]:!_[_0x4569('0x1f')](_0x3908b3[_0x4569('0x48')])?_0x3908b3[_0x4569('0x48')]+'\x20'+_0x3908b3[_0x4569('0x49')]:_0x3908b3['last_name'],'id':_0x3908b3['id']}}]},'headers':{'Authorization':_0x4569('0x38')+_0x78c6dd},'json':!![]})[_0x4569('0x44')](function(_0x8147a0){if(_0x8147a0&&_0x8147a0[_0x4569('0x4a')][0x0]['code']===_0x4569('0x4b')){var _0x155ebb=_0x8147a0[_0x4569('0x4a')][0x0]['details'];_0x155ebb[_0x4569('0x4c')]=_[_0x4569('0x4d')](_0x3841d8[_0x4569('0x46')])+'s';return _0x155ebb;}logger[_0x4569('0x30')](_0x4569('0x4e'),JSON[_0x4569('0xf')](data));throw new Error(_0x4569('0x4f')+JSON[_0x4569('0xf')](data));})[_0x4569('0x2f')](function(_0x2c7f70){console[_0x4569('0x50')]('CREATE\x20ERROR',_0x2c7f70);});}function getEndUser(_0x2aac64,_0x4445ae,_0xb21a51,_0x19a645,_0x424e84,_0x1140a2,_0x879270){var _0x3224b9={'method':'GET','uri':'','headers':{'Authorization':_0x4569('0x38')+_0x2aac64},'json':!![]};switch(_0x879270[_0x4569('0x51')]){case _0x4569('0x52'):_0x3224b9[_0x4569('0x53')]=_0x4569('0x54')+_0x4445ae+_0x4569('0x55')+_0x424e84+'))';return getZohoUser(_0x3224b9,'Contacts')[_0x4569('0x44')](function(_0x44d349){if(_0x44d349)return _0x44d349;_0x3224b9[_0x4569('0x53')]=_0x4569('0x54')+_0x4445ae+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x424e84+'))';return getZohoUser(_0x3224b9,'Leads')[_0x4569('0x44')](function(_0x1ef032){if(_0x1ef032)return _0x1ef032;if(_0x879270[_0x4569('0x46')]!=_0x4569('0x56')){return createEndUser(_0x2aac64,_0x4445ae,_0x19a645,_0x424e84,_0x1140a2,_0x879270);}else{return{};}});});break;case'contact':_0x3224b9[_0x4569('0x53')]=_0x4569('0x54')+_0x4445ae+_0x4569('0x55')+_0x424e84+'))';return getZohoUser(_0x3224b9,'Contacts')[_0x4569('0x44')](function(_0x28957d){if(_0x28957d)return _0x28957d;if(_0x879270[_0x4569('0x46')]!=_0x4569('0x56')){return createEndUser(_0x2aac64,_0x4445ae,_0x19a645,_0x424e84,_0x1140a2,_0x879270);}else{return{};}});break;case'lead':_0x3224b9[_0x4569('0x53')]='https://www.zohoapis.'+_0x4445ae+_0x4569('0x57')+_0x424e84+'))';return getZohoUser(_0x3224b9,_0x4569('0x58'))[_0x4569('0x44')](function(_0x3304d3){if(_0x3304d3)return _0x3304d3;if(_0x879270[_0x4569('0x46')]!=_0x4569('0x56')){return createEndUser(_0x2aac64,_0x4445ae,_0x19a645,_0x424e84,_0x1140a2,_0x879270);}else{return{};}});break;}}function getCall(_0x303f6e,_0x101878,_0xf6aa41,_0x9a1679,_0x5b8b1b,_0x33be27,_0x46cefd,_0x3734c1){logger[_0x4569('0x3c')]('Creating\x20new\x20call...');var _0x1aaafe={};_0x1aaafe['Owner']={'name':!_[_0x4569('0x1f')](_0x9a1679[_0x4569('0x47')]['name'])&&!_[_0x4569('0x1f')](_0x9a1679[_0x4569('0x40')][_0x4569('0x1c')])&&_0x9a1679[_0x4569('0x40')][_0x4569('0x1c')]===_0x4569('0x59')?_0x9a1679[_0x4569('0x47')][_0x4569('0x1c')]:!_[_0x4569('0x1f')](_0x9a1679[_0x4569('0x48')])?_0x9a1679[_0x4569('0x48')]+'\x20'+_0x9a1679[_0x4569('0x49')]:_0x9a1679[_0x4569('0x49')],'id':_0x9a1679['id']};_0x1aaafe[_0x4569('0x5a')]=intUtil['getString'](_0x33be27[_0x4569('0x5b')],_0x46cefd,'\x20');_0x1aaafe[_0x4569('0x5c')]=intUtil[_0x4569('0x5d')](_0x33be27[_0x4569('0x5e')],_0x46cefd,'\x0a');if(_0x5b8b1b[_0x4569('0x4c')]===_0x4569('0x5f')){_0x1aaafe[_0x4569('0x60')]={'name':!_['isNil'](_0x5b8b1b[_0x4569('0x61')])?_0x5b8b1b[_0x4569('0x61')]:!_[_0x4569('0x1f')](_0x5b8b1b[_0x4569('0x62')])?_0x5b8b1b[_0x4569('0x62')]+'\x20'+_0x5b8b1b['Last_Name']:_0x5b8b1b[_0x4569('0x63')],'id':_0x5b8b1b['id']};}if(_0x5b8b1b[_0x4569('0x4c')]===_0x4569('0x58')){_0x1aaafe[_0x4569('0x64')]={'name':!_['isNil'](_0x5b8b1b[_0x4569('0x61')])?_0x5b8b1b[_0x4569('0x61')]:!_['isNil'](_0x5b8b1b[_0x4569('0x62')])?_0x5b8b1b[_0x4569('0x62')]+'\x20'+_0x5b8b1b[_0x4569('0x63')]:_0x5b8b1b[_0x4569('0x63')],'id':_0x5b8b1b['id']};_0x1aaafe[_0x4569('0x65')]=_[_0x4569('0x4d')](_0x5b8b1b[_0x4569('0x4c')]);}if(_0x46cefd[_0x4569('0x66')]){_0x1aaafe[_0x4569('0x67')]=moment[_0x4569('0x68')](parseInt(_0x46cefd['talktime'])*0x3e8)[_0x4569('0x35')]('mm:ss');}else if(_0x46cefd[_0x4569('0x69')]&&_0x46cefd[_0x4569('0x6a')]){_0x1aaafe[_0x4569('0x67')]=moment[_0x4569('0x68')](moment(_0x46cefd[_0x4569('0x6a')],'YYYY-MM-DDTHH:mm:ss')[_0x4569('0x6b')](moment(_0x46cefd[_0x4569('0x6c')],_0x4569('0x6d'))))[_0x4569('0x35')](_0x4569('0x6e'));}switch(_0x46cefd[_0x4569('0x6f')]){case _0x4569('0x70'):_0x1aaafe[_0x4569('0x71')]=_0x4569('0x72');break;case _0x4569('0x73'):case _0x4569('0x74'):_0x1aaafe['Call_Result']=_0x4569('0x75');break;case _0x4569('0x76'):_0x1aaafe[_0x4569('0x71')]=_0x4569('0x77');break;case _0x4569('0x78'):_0x1aaafe[_0x4569('0x71')]='Abandoned';break;case'timeout':_0x1aaafe[_0x4569('0x71')]=_0x4569('0x79');default:}_0x1aaafe[_0x4569('0x7a')]=(_0x3734c1==='outbound'?moment(_0x46cefd[_0x4569('0x6c')])[_0x4569('0x35')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x46cefd[_0x4569('0x7b')])[_0x4569('0x35')](_0x4569('0x6d')))||moment()['format'](_0x4569('0x6d'));_0x1aaafe['Call_Type']=_0x3734c1||'Inbound';_0x1aaafe=_[_0x4569('0x7c')](_0x1aaafe,getCustomFields(_0x33be27['Fields'],_0x46cefd));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x101878+'/crm/v2/Calls','headers':{'Authorization':_0x4569('0x38')+_0x303f6e},'body':{'data':[_0x1aaafe]},'json':!![]})[_0x4569('0x44')](function(_0x3c788c){if(_0x3c788c&&_0x3c788c['data'][0x0][_0x4569('0x7d')]==='SUCCESS'){logger[_0x4569('0x3c')](_0x4569('0x7e'));return{'id':_0x3c788c['data'][0x0][_0x4569('0x7f')]['id']};}})['catch'](function(_0x3c5ee5){logger['info']('err',_0x3c5ee5['stack']);console['log'](_0x4569('0x80'),_0x3c5ee5);});}exports[_0x4569('0x81')]=function(_0x202448,_0x14e6e0,_0x5f0471,_0x33a464,_0x23bb4a,_0x328632){var _0x1de164,_0x370d71,_0x4bae19;_0x328632['host']=intUtil[_0x4569('0x82')](_0x328632['host']);_0x328632[_0x4569('0x83')]=intUtil[_0x4569('0x82')](_0x328632[_0x4569('0x83')]);if(_0x23bb4a&&_0x23bb4a[_0x4569('0x84')]){logger[_0x4569('0x3c')](_0x4569('0x85'),_0x4569('0x86'));_0x14e6e0[_0x4569('0x87')]=_0x328632[_0x4569('0x83')]+_0x4569('0x88')+_0x14e6e0['uniqueid']+_0x4569('0x89')+md5(_0x14e6e0[_0x4569('0x8a')]);}else{_0x14e6e0[_0x4569('0x87')]='';}var _0xd350d3=_0x328632['host']===_0x4569('0x8b')?'eu':_0x4569('0x8c');return getAccessToken(_0x328632)[_0x4569('0x44')](function(_0x166944){_0x4bae19=_0x166944;return getUser(_0x4bae19,_0xd350d3,_0x328632,_0x33a464[_0x4569('0x3b')]);})['then'](function(_0x2dbfe7){_0x1de164=_0x2dbfe7;logger[_0x4569('0x3c')](_0x4569('0x8d'),_0x1de164['id']);return getEndUser(_0x4bae19,_0xd350d3,_0x328632,_0x14e6e0[_0x4569('0x8e')],_0x14e6e0['calleridnum'],_0x1de164,_0x5f0471);})[_0x4569('0x44')](function(_0x84d28c){_0x370d71=_0x84d28c;return getCall(_0x4bae19,_0xd350d3,_0x328632,_0x1de164,_0x370d71,_0x5f0471,_0x14e6e0,_0x4569('0x8f'));})[_0x4569('0x44')](function(_0x221f3a){if(_0x221f3a){logger[_0x4569('0x3c')](_0x4569('0x90'),_0x221f3a['id']);logger[_0x4569('0x3c')](_0x4569('0x85'),_0x4569('0x91'));emit(util[_0x4569('0x35')](_0x4569('0x92'),_0x33a464[_0x4569('0x1c')]),_0x4569('0x93'),{'uri':_0x4569('0x94')+_0x328632['host']+_0x4569('0x95')+_0x221f3a['id']});}})[_0x4569('0x2f')](function(_0x9b4d1d){logger['error'](_0x4569('0x85'),JSON[_0x4569('0xf')](_0x9b4d1d));});};exports[_0x4569('0x96')]=function(_0xad80ce,_0x287912,_0x37f75b,_0x1dd6b7,_0xc011c7,_0x13aa98,_0x48fd61){var _0x16f4b7,_0xf94c58,_0xf6b907;_0x13aa98[_0x4569('0x97')]=intUtil[_0x4569('0x82')](_0x13aa98[_0x4569('0x97')]);_0x13aa98[_0x4569('0x83')]=intUtil[_0x4569('0x82')](_0x13aa98['serverUrl']);if(_0x48fd61&&_0x48fd61['recordingFormat']&&_0x48fd61[_0x4569('0x98')]!==_0x4569('0x99')){logger['info'](_0x4569('0x9a'),_0x4569('0x86'));_0x287912['recordingURL']=_0x13aa98[_0x4569('0x83')]+'/api/voice/recordings/'+_0x287912[_0x4569('0x8a')]+_0x4569('0x89')+md5(_0x287912[_0x4569('0x8a')]);}var _0xe3863e=_0x13aa98[_0x4569('0x97')]===_0x4569('0x8b')?'eu':'com';return getAccessToken(_0x13aa98)['then'](function(_0x65b16e){_0xf6b907=_0x65b16e;return getUser(_0xf6b907,_0xe3863e,_0x13aa98,_0x1dd6b7[_0x4569('0x3b')]);})[_0x4569('0x44')](function(_0x2c5fc9){_0x16f4b7=_0x2c5fc9;logger[_0x4569('0x3c')]('The\x20User\x20ID\x20is:',_0x16f4b7['id']);return getEndUser(_0xf6b907,_0xe3863e,_0x13aa98,_0x287912['destcalleridname'],_0x287912['destcalleridnum'],_0x16f4b7,_0x37f75b);})[_0x4569('0x44')](function(_0x4b14c2){_0xf94c58=_0x4b14c2;return getCall(_0xf6b907,_0xe3863e,_0x13aa98,_0x16f4b7,_0xf94c58,_0x37f75b,_0x287912,'Outbound');})['then'](function(_0x520789){if(_0x520789){logger['info'](_0x4569('0x90'),_0x520789['id']);logger[_0x4569('0x3c')](_0x4569('0x9a'),_0x4569('0x91'));emit(util[_0x4569('0x35')](_0x4569('0x92'),_0x1dd6b7['name']),_0x4569('0x93'),{'uri':_0x4569('0x94')+_0x13aa98[_0x4569('0x97')]+_0x4569('0x95')+_0x520789['id']});}})['catch'](function(_0x430791){logger[_0x4569('0x30')](_0x4569('0x9a'),JSON[_0x4569('0xf')](_0x430791));});};exports[_0x4569('0x9b')]=function(_0x193320,_0x2a9e01,_0x5477b8,_0x2dae29,_0x381cdc,_0x35a592){var _0x5708f1,_0x5d0f30,_0x293d47;_0x35a592[_0x4569('0x97')]=intUtil[_0x4569('0x82')](_0x35a592[_0x4569('0x97')]);_0x35a592[_0x4569('0x83')]=intUtil[_0x4569('0x82')](_0x35a592[_0x4569('0x83')]);if(_0x381cdc&&_0x381cdc[_0x4569('0x84')]){logger[_0x4569('0x3c')]('['+_0x2a9e01['lastevent'][_0x4569('0x9c')]()+']',_0x4569('0x86'));_0x2a9e01[_0x4569('0x87')]=_0x35a592['serverUrl']+_0x4569('0x88')+_0x2a9e01[_0x4569('0x8a')]+'/downloads?type=uniqueid&token='+md5(_0x2a9e01[_0x4569('0x8a')]);}else{_0x2a9e01[_0x4569('0x87')]='';}var _0x1fe034=_0x35a592[_0x4569('0x97')]===_0x4569('0x8b')?'eu':_0x4569('0x8c');return getAccessToken(_0x35a592)['then'](function(_0x268de9){_0x293d47=_0x268de9;return getUser(_0x293d47,_0x1fe034,_0x35a592);})[_0x4569('0x44')](function(_0x45f8e6){_0x5708f1=_0x45f8e6;logger[_0x4569('0x3c')](_0x4569('0x8d'),_0x5708f1['id']);return getEndUser(_0x293d47,_0x1fe034,_0x35a592,_0x2a9e01[_0x4569('0x8e')],_0x2a9e01['calleridnum'],_0x5708f1,_0x5477b8);})['then'](function(_0x55eee4){_0x5d0f30=_0x55eee4;return getCall(_0x293d47,_0x1fe034,_0x35a592,_0x5708f1,_0x5d0f30,_0x5477b8,_0x2a9e01,_0x4569('0x8f'));})[_0x4569('0x44')](function(_0x12b762){if(_0x12b762){logger[_0x4569('0x3c')](_0x4569('0x90'),_0x12b762['id']);}})['catch'](function(_0x1b0c74){logger[_0x4569('0x30')]('['+_0x2a9e01[_0x4569('0x6f')]['toUpperCase']()+']',JSON[_0x4569('0xf')](_0x1b0c74));});};
\ No newline at end of file
index e5573e0..66b56e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c74=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','error','format'];(function(_0x5b2a20,_0x53a830){var _0x9d623a=function(_0x312009){while(--_0x312009){_0x5b2a20['push'](_0x5b2a20['shift']());}};_0x9d623a(++_0x53a830);}(_0x6c74,0x12e));var _0x46c7=function(_0x2d0bf6,_0x45cf09){_0x2d0bf6=_0x2d0bf6-0x0;var _0x552e9a=_0x6c74[_0x2d0bf6];return _0x552e9a;};'use strict';var util=require(_0x46c7('0x0'));var sh=require('shelljs');var Mustache=require(_0x46c7('0x1'));var logger=require(_0x46c7('0x2'))(_0x46c7('0x3'));exports[_0x46c7('0x4')]=function(_0x42513f,_0x9ba7b8){var _0x50fd89=_0x42513f[_0x46c7('0x5')]?_0x42513f['data2']:_0x46c7('0x6');var _0x3f828c=_0x42513f[_0x46c7('0x7')]?Mustache['render'](_0x42513f['data3'],_0x9ba7b8):_0x9ba7b8;sh[_0x46c7('0x4')](_0x3f828c,function(_0xeb7279,_0x497401,_0x2ac3ce){if(_0xeb7279!==0x0){logger[_0x46c7('0x8')](util[_0x46c7('0x9')](_0x46c7('0xa'),_0x50fd89,_0x3f828c,_0xeb7279,_0x2ac3ce));}else{logger[_0x46c7('0xb')](util[_0x46c7('0x9')](_0x46c7('0xc'),_0x50fd89,_0x3f828c,_0x497401));}});};
\ No newline at end of file
+var _0x872e=['util','trigger','exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x530fda,_0xc2185b){var _0xf7b960=function(_0x32c1b1){while(--_0x32c1b1){_0x530fda['push'](_0x530fda['shift']());}};_0xf7b960(++_0xc2185b);}(_0x872e,0x181));var _0xe872=function(_0x200769,_0x2c900a){_0x200769=_0x200769-0x0;var _0x628a3a=_0x872e[_0x200769];return _0x628a3a;};'use strict';var util=require(_0xe872('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0xe872('0x1'));exports[_0xe872('0x2')]=function(_0x3ac339,_0x4b0e70){var _0x410167=_0x3ac339[_0xe872('0x3')]?_0x3ac339['data2']:_0xe872('0x4');var _0x4d18ec=_0x3ac339['data3']?Mustache['render'](_0x3ac339[_0xe872('0x5')],_0x4b0e70):_0x4b0e70;sh['exec'](_0x4d18ec,function(_0x4be444,_0x35175d,_0x502bed){if(_0x4be444!==0x0){logger[_0xe872('0x6')](util[_0xe872('0x7')](_0xe872('0x8'),_0x410167,_0x4d18ec,_0x4be444,_0x502bed));}else{logger[_0xe872('0x9')](util[_0xe872('0x7')](_0xe872('0xa'),_0x410167,_0x4d18ec,_0x35175d));}});};
\ No newline at end of file
index c892315..c9085a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4a0=['render','data5','number','headers','data6','error','stack','GET','DELETE','POST','parse','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','isNil',',\x20request\x20body:\x20','object','info','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xf4a0,0x1e7));var _0x0f4a=function(_0x326a32,_0x918aaa){_0x326a32=_0x326a32-0x0;var _0x31ffe6=_0xf4a0[_0x326a32];return _0x31ffe6;};'use strict';var rp=require(_0x0f4a('0x0'));var util=require('util');var _=require(_0x0f4a('0x1'));var Mustache=require(_0x0f4a('0x2'));var logger=require(_0x0f4a('0x3'))(_0x0f4a('0x4'));exports[_0x0f4a('0x5')]=function(_0x3095f9,_0x3cad01){var _0x10f36f,_0x2bdb3e;var _0x1e0ae3={'method':_0x3095f9[_0x0f4a('0x6')][_0x0f4a('0x7')](),'uri':Mustache[_0x0f4a('0x8')](_0x3095f9['data2'],_0x3cad01),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3095f9[_0x0f4a('0x9')])===_0x0f4a('0xa')&&parseInt(_0x3095f9['data5'])>=0x1&&parseInt(_0x3095f9[_0x0f4a('0x9')])<=0xa?parseInt(_0x3095f9[_0x0f4a('0x9')])*0x3e8:0x5*0x3e8};try{_0x1e0ae3[_0x0f4a('0xb')]=_0x3095f9[_0x0f4a('0xc')]?JSON['parse'](Mustache[_0x0f4a('0x8')](_0x3095f9[_0x0f4a('0xc')],_0x3cad01)):{};}catch(_0x578bfb){logger[_0x0f4a('0xd')](_0x578bfb[_0x0f4a('0xe')]);}switch(_0x3095f9[_0x0f4a('0x6')][_0x0f4a('0x7')]()){case _0x0f4a('0xf'):case _0x0f4a('0x10'):_0x10f36f=null;_0x1e0ae3['qs']=_0x3cad01;break;case _0x0f4a('0x11'):case'PUT':if(_0x3095f9['data7']){try{_0x10f36f=JSON[_0x0f4a('0x12')](Mustache[_0x0f4a('0x8')](_0x3095f9[_0x0f4a('0x13')],_0x3cad01));_0x1e0ae3[_0x0f4a('0x14')]=_0x10f36f;}catch(_0x3a3055){logger[_0x0f4a('0xd')](_0x3a3055[_0x0f4a('0xe')]);logger[_0x0f4a('0xd')](_0x0f4a('0x15'));}}else{_0x10f36f=_0x3cad01;_0x1e0ae3[_0x0f4a('0x14')]=_0x10f36f;}break;}logger['info'](util['format'](_0x0f4a('0x16'),_0x3095f9[_0x0f4a('0x6')],_0x3095f9[_0x0f4a('0x17')],JSON[_0x0f4a('0x18')](_0x1e0ae3)));rp(_0x1e0ae3)['then'](function(_0xd5db40){_0x10f36f=!_[_0x0f4a('0x19')](_0x10f36f)?_0x0f4a('0x1a')+_0x10f36f:'';_0x2bdb3e=typeof _0xd5db40['body']===_0x0f4a('0x1b')?JSON[_0x0f4a('0x18')](_0xd5db40[_0x0f4a('0x14')]):_0xd5db40[_0x0f4a('0x14')];logger[_0x0f4a('0x1c')](util[_0x0f4a('0x1d')](_0x0f4a('0x1e'),_0x3095f9[_0x0f4a('0x6')],_0x3095f9[_0x0f4a('0x17')],_0xd5db40[_0x0f4a('0x1f')],_0x2bdb3e));})['catch'](function(_0x1b063e){logger['error'](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x3095f9[_0x0f4a('0x6')],_0x3095f9[_0x0f4a('0x17')],_0x1b063e[_0x0f4a('0x1f')],_0x1b063e['name'],_0x1b063e[_0x0f4a('0x20')]));});};
\ No newline at end of file
+var _0xd031=['stringify','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','trigger','exec','data1','toUpperCase','render','data2','data5','data6','error','GET','DELETE','POST','data7','stack','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x490283,_0x3ddec1){var _0x2938d7=function(_0x2fb6b7){while(--_0x2fb6b7){_0x490283['push'](_0x490283['shift']());}};_0x2938d7(++_0x3ddec1);}(_0xd031,0x1ef));var _0x1d03=function(_0x5a9c9b,_0x6e1724){_0x5a9c9b=_0x5a9c9b-0x0;var _0x5f066d=_0xd031[_0x5a9c9b];return _0x5f066d;};'use strict';var rp=require('request-promise');var util=require('util');var _=require('lodash');var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x1d03('0x0'));exports[_0x1d03('0x1')]=function(_0x3fe720,_0x383433){var _0x574ee2,_0x63ca4f;var _0x5276a3={'method':_0x3fe720[_0x1d03('0x2')][_0x1d03('0x3')](),'uri':Mustache[_0x1d03('0x4')](_0x3fe720[_0x1d03('0x5')],_0x383433),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x3fe720[_0x1d03('0x6')])==='number'&&parseInt(_0x3fe720[_0x1d03('0x6')])>=0x1&&parseInt(_0x3fe720[_0x1d03('0x6')])<=0xa?parseInt(_0x3fe720[_0x1d03('0x6')])*0x3e8:0x5*0x3e8};try{_0x5276a3['headers']=_0x3fe720['data6']?JSON['parse'](Mustache[_0x1d03('0x4')](_0x3fe720[_0x1d03('0x7')],_0x383433)):{};}catch(_0x1b2c05){logger[_0x1d03('0x8')](_0x1b2c05['stack']);}switch(_0x3fe720[_0x1d03('0x2')][_0x1d03('0x3')]()){case _0x1d03('0x9'):case _0x1d03('0xa'):_0x574ee2=null;_0x5276a3['qs']=_0x383433;break;case _0x1d03('0xb'):case'PUT':if(_0x3fe720[_0x1d03('0xc')]){try{_0x574ee2=JSON['parse'](Mustache[_0x1d03('0x4')](_0x3fe720[_0x1d03('0xc')],_0x383433));_0x5276a3['body']=_0x574ee2;}catch(_0x286395){logger[_0x1d03('0x8')](_0x286395[_0x1d03('0xd')]);logger[_0x1d03('0x8')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x574ee2=_0x383433;_0x5276a3[_0x1d03('0xe')]=_0x574ee2;}break;}logger[_0x1d03('0xf')](util[_0x1d03('0x10')](_0x1d03('0x11'),_0x3fe720['data1'],_0x3fe720[_0x1d03('0x5')],JSON[_0x1d03('0x12')](_0x5276a3)));rp(_0x5276a3)['then'](function(_0x116282){_0x574ee2=!_[_0x1d03('0x13')](_0x574ee2)?_0x1d03('0x14')+_0x574ee2:'';_0x63ca4f=typeof _0x116282['body']==='object'?JSON['stringify'](_0x116282[_0x1d03('0xe')]):_0x116282[_0x1d03('0xe')];logger[_0x1d03('0xf')](util[_0x1d03('0x10')](_0x1d03('0x15'),_0x3fe720[_0x1d03('0x2')],_0x3fe720['data2'],_0x116282['statusCode'],_0x63ca4f));})[_0x1d03('0x16')](function(_0x5e6504){logger[_0x1d03('0x8')](util[_0x1d03('0x10')](_0x1d03('0x17'),_0x3fe720[_0x1d03('0x2')],_0x3fe720['data2'],_0x5e6504[_0x1d03('0x18')],_0x5e6504[_0x1d03('0x19')],_0x5e6504[_0x1d03('0x1a')]));});};
\ No newline at end of file
index 59ce487..5652ace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e25=['http','then','debug','rpc','error','message','result','jayson/promise','bluebird','routing','client'];(function(_0x4f6e5e,_0x27cd66){var _0x5b0f60=function(_0x404642){while(--_0x404642){_0x4f6e5e['push'](_0x4f6e5e['shift']());}};_0x5b0f60(++_0x27cd66);}(_0x0e25,0x193));var _0x50e2=function(_0x584c0e,_0x325af2){_0x584c0e=_0x584c0e-0x0;var _0xc46984=_0x0e25[_0x584c0e];return _0xc46984;};'use strict';var jayson=require(_0x50e2('0x0'));var BPromise=require(_0x50e2('0x1'));var logger=require('../../config/logger')(_0x50e2('0x2'));var client=jayson[_0x50e2('0x3')][_0x50e2('0x4')]({'port':0x2329});client['Request']=function(_0x940fd2,_0x50487f){return new BPromise(function(_0x4b7240,_0x190beb){return client['request'](_0x940fd2,_0x50487f)[_0x50e2('0x5')](function(_0x1b240f){logger[_0x50e2('0x6')](_0x50e2('0x7'),'routing',_0x940fd2,_0x50487f,_0x1b240f);if(_0x1b240f['error']){logger[_0x50e2('0x8')](_0x50e2('0x7'),_0x50e2('0x2'),_0x940fd2,_0x1b240f['error']['message'],_0x50487f);return _0x190beb(_0x1b240f[_0x50e2('0x8')][_0x50e2('0x9')]);}else{return _0x4b7240(_0x1b240f[_0x50e2('0xa')]);}})['catch'](function(_0x4b21d2){logger['error'](_0x50e2('0x7'),_0x50e2('0x2'),_0x940fd2,_0x4b21d2,_0x50487f);return _0x190beb(_0x4b21d2);});});};module['exports']=client;
\ No newline at end of file
+var _0x6c94=['client','http','Request','then','debug','rpc','error','message','result','exports','jayson/promise','bluebird','routing'];(function(_0x197de3,_0x3e76f8){var _0x3a04ad=function(_0xf614f4){while(--_0xf614f4){_0x197de3['push'](_0x197de3['shift']());}};_0x3a04ad(++_0x3e76f8);}(_0x6c94,0x7f));var _0x46c9=function(_0x3400fb,_0x41d8c1){_0x3400fb=_0x3400fb-0x0;var _0x48a2db=_0x6c94[_0x3400fb];return _0x48a2db;};'use strict';var jayson=require(_0x46c9('0x0'));var BPromise=require(_0x46c9('0x1'));var logger=require('../../config/logger')(_0x46c9('0x2'));var client=jayson[_0x46c9('0x3')][_0x46c9('0x4')]({'port':0x2329});client[_0x46c9('0x5')]=function(_0x339368,_0x5386a6){return new BPromise(function(_0x94ae40,_0x5a18fa){return client['request'](_0x339368,_0x5386a6)[_0x46c9('0x6')](function(_0x2777a1){logger[_0x46c9('0x7')](_0x46c9('0x8'),_0x46c9('0x2'),_0x339368,_0x5386a6,_0x2777a1);if(_0x2777a1[_0x46c9('0x9')]){logger[_0x46c9('0x9')](_0x46c9('0x8'),_0x46c9('0x2'),_0x339368,_0x2777a1[_0x46c9('0x9')][_0x46c9('0xa')],_0x5386a6);return _0x5a18fa(_0x2777a1[_0x46c9('0x9')][_0x46c9('0xa')]);}else{return _0x94ae40(_0x2777a1[_0x46c9('0xb')]);}})['catch'](function(_0x24b85d){logger[_0x46c9('0x9')](_0x46c9('0x8'),_0x46c9('0x2'),_0x339368,_0x24b85d,_0x5386a6);return _0x5a18fa(_0x24b85d);});});};module[_0x46c9('0xc')]=client;
\ No newline at end of file
index a85d39c..42894aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4cf=['then','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','getMailAccounts'];(function(_0x44565e,_0x19e34){var _0x583604=function(_0xdf22e1){while(--_0xdf22e1){_0x44565e['push'](_0x44565e['shift']());}};_0x583604(++_0x19e34);}(_0xc4cf,0xc8));var _0xfc4c=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xc4cf[_0x525c7b];return _0x27b33e;};'use strict';var BPromise=require(_0xfc4c('0x0'));var server=require(_0xfc4c('0x1'));var Realtime=require(_0xfc4c('0x2'));var EmailChannel=require(_0xfc4c('0x3'));var mailAccount=require(_0xfc4c('0x4'));var setting=require(_0xfc4c('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xfc4c('0x6')]()['then'](mailAccount[_0xfc4c('0x7')]())[_0xfc4c('0x8')](realtime['initMailAccounts']())['then'](function(){email[_0xfc4c('0x9')](realtime[_0xfc4c('0xa')]);return realtime;});}function main(){return server[_0xfc4c('0xb')](realtime,email)[_0xfc4c('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0xfc4c('0xc')]();})[_0xfc4c('0x8')](function(_0x82baba){return setInterval(initRealtime,_0x82baba[_0xfc4c('0xd')]*0x3e8);})[_0xfc4c('0xe')](function(_0x2b188d){console[_0xfc4c('0xf')](_0x2b188d);});}main();
\ No newline at end of file
+var _0x108f=['./realtime','./rpc/setting','resolve','getMailAccounts','initMailAccounts','then','refresh','mailAccounts','getSettings','catch','bluebird','./server'];(function(_0x33d4c5,_0x21b867){var _0x3ebdaf=function(_0x7d2412){while(--_0x7d2412){_0x33d4c5['push'](_0x33d4c5['shift']());}};_0x3ebdaf(++_0x21b867);}(_0x108f,0xbe));var _0xf108=function(_0x8e47de,_0x571670){_0x8e47de=_0x8e47de-0x0;var _0x24bdcd=_0x108f[_0x8e47de];return _0x24bdcd;};'use strict';var BPromise=require(_0xf108('0x0'));var server=require(_0xf108('0x1'));var Realtime=require(_0xf108('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xf108('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xf108('0x4')]()['then'](mailAccount[_0xf108('0x5')]())['then'](realtime[_0xf108('0x6')]())[_0xf108('0x7')](function(){email[_0xf108('0x8')](realtime[_0xf108('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf108('0x7')](function(){return initRealtime();})[_0xf108('0x7')](function(){return setting[_0xf108('0xa')]();})[_0xf108('0x7')](function(_0x2a604b){return setInterval(initRealtime,_0x2a604b['loginMailFrequency']*0x3e8);})[_0xf108('0xb')](function(_0x3e07f4){console['log'](_0x3e07f4);});}main();
\ No newline at end of file
index 9bc48ca..75bf595 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b61=['then','info','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','prototype','sendMail','verifySmtp','verify','Smtp','lodash','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','./imap','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','emit','key','Imap','status','total','mailAccount:update','hasOwnProperty','active','box','bind','end','handleImapEnd','error','handleImapError','isNil','disabled','messageStatus','handleImapBox','name','messages','handleImapEmail','firstName','from','notify'];(function(_0x3e4f74,_0x26ce71){var _0xd07d99=function(_0x2b09b0){while(--_0x2b09b0){_0x3e4f74['push'](_0x3e4f74['shift']());}};_0xd07d99(++_0x26ce71);}(_0x1b61,0xa2));var _0x11b6=function(_0x9117ad,_0x386be4){_0x9117ad=_0x9117ad-0x0;var _0x540f0c=_0x1b61[_0x9117ad];return _0x540f0c;};'use strict';var _=require(_0x11b6('0x0'));var moment=require('moment');var BPromise=require(_0x11b6('0x1'));var md5=require(_0x11b6('0x2'));var Redis=require(_0x11b6('0x3'));var config=require(_0x11b6('0x4'));var logger=require('../../../config/logger')(_0x11b6('0x5'));config[_0x11b6('0x6')]=_[_0x11b6('0x7')](config[_0x11b6('0x6')],{'host':_0x11b6('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x11b6('0x6')]));var EmailImap=require(_0x11b6('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x11b6('0xa'));var md5Accounts={};function EmailChannel(_0x5d97b2){logger['info']('start\x20email\x20channel');this[_0x11b6('0xb')]=_0x5d97b2['mailAccounts'];this[_0x11b6('0xc')]={};this[_0x11b6('0xd')]=new EmailSmtp();}EmailChannel['prototype'][_0x11b6('0xe')]=function(_0x3c9228){var _0x4ff6a0=this[_0x11b6('0xb')][_0x3c9228];var _0x39d433={'id':_0x4ff6a0['id'],'name':_0x4ff6a0['name'],'key':_0x4ff6a0[_0x11b6('0xf')],'active':_0x4ff6a0['active'],'Imap':{'status':_0x4ff6a0[_0x11b6('0x10')][_0x11b6('0x11')],'messageStatus':_0x4ff6a0[_0x11b6('0x10')]['messageStatus'],'total':_0x4ff6a0[_0x11b6('0x10')][_0x11b6('0x12')]}};if(_['isNil'](md5Accounts[_0x3c9228])){md5Accounts[_0x3c9228]={};}var _0x3b9249=md5(JSON['stringify'](_0x39d433));if(md5Accounts[_0x3c9228][_0x11b6('0x2')]!==_0x3b9249){md5Accounts[_0x3c9228][_0x11b6('0x2')]=_0x3b9249;io[_0x11b6('0xe')](_0x11b6('0x13'),_0x39d433);}};EmailChannel['prototype']['refresh']=function(_0xc8c31){for(var _0x443670 in _0xc8c31){if(_0xc8c31[_0x11b6('0x14')](_0x443670)){if(_0xc8c31[_0x443670]['Imap']&&_0xc8c31[_0x443670][_0x11b6('0x15')]){var _0x1cf1fd=_0xc8c31[_0x443670][_0x11b6('0x10')];if(!this[_0x11b6('0xc')][_0x11b6('0x14')](_0x1cf1fd['id'])){this[_0x11b6('0xc')][_0x1cf1fd['id']]=new EmailImap(_0x1cf1fd,_0xc8c31[_0x443670]['email']);this[_0x11b6('0xc')][_0x1cf1fd['id']]['on'](_0x11b6('0x16'),this['handleImapBox'][_0x11b6('0x17')](this,_0x443670));this['imapAccounts'][_0x1cf1fd['id']]['on'](_0x11b6('0x5'),this['handleImapEmail'][_0x11b6('0x17')](this,_0x443670));this[_0x11b6('0xc')][_0x1cf1fd['id']]['on'](_0x11b6('0x18'),this[_0x11b6('0x19')][_0x11b6('0x17')](this,_0x443670));this[_0x11b6('0xc')][_0x1cf1fd['id']]['on'](_0x11b6('0x1a'),this[_0x11b6('0x1b')]['bind'](this,_0x443670));}}else{if(_[_0x11b6('0x1c')](this['mailAccounts'][_0x443670][_0x11b6('0x10')])){this['mailAccounts'][_0x443670][_0x11b6('0x10')]={};}this['mailAccounts'][_0x443670]['Imap'][_0x11b6('0x11')]=_0x11b6('0x1d');this['mailAccounts'][_0x443670][_0x11b6('0x10')][_0x11b6('0x1e')]='';this[_0x11b6('0xe')](_0x443670);}}}};EmailChannel['prototype'][_0x11b6('0x1f')]=function(_0x346385,_0x3fdb19){if(this[_0x11b6('0xb')][_0x346385]){this[_0x11b6('0xb')][_0x346385]['Imap'][_0x11b6('0x11')]='connected';this[_0x11b6('0xb')][_0x346385]['Imap'][_0x11b6('0x1e')]=_0x3fdb19[_0x11b6('0x20')];if(_0x3fdb19[_0x11b6('0x21')]){this[_0x11b6('0xb')][_0x346385][_0x11b6('0x10')]['total']=_0x3fdb19[_0x11b6('0x21')][_0x11b6('0x12')];}return this[_0x11b6('0xe')](_0x346385);}};EmailChannel['prototype'][_0x11b6('0x22')]=function(_0xc5e30b,_0x126bc4){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x126bc4[_0x11b6('0x23')],_0x126bc4['lastName'],_0x126bc4[_0x11b6('0x24')],_0xc5e30b);if(this[_0x11b6('0xb')][_0xc5e30b]){return mailAccount[_0x11b6('0x25')](_0xc5e30b,_0x126bc4)[_0x11b6('0x26')](function(_0x26a3a0){if(_0x26a3a0){logger[_0x11b6('0x27')](_0x11b6('0x28'));}})[_0x11b6('0x29')](function(_0x5e7497){logger[_0x11b6('0x1a')](_0x11b6('0x2a'),JSON[_0x11b6('0x2b')](_0x5e7497));});}};EmailChannel['prototype'][_0x11b6('0x19')]=function(_0x57dc5b){if(this[_0x11b6('0xb')][_0x57dc5b]&&this[_0x11b6('0xb')][_0x57dc5b][_0x11b6('0x10')]){if(this[_0x11b6('0xc')][this[_0x11b6('0xb')][_0x57dc5b]['Imap']['id']]){delete this['imapAccounts'][this[_0x11b6('0xb')][_0x57dc5b]['Imap']['id']];}this[_0x11b6('0xb')][_0x57dc5b][_0x11b6('0x10')][_0x11b6('0x2c')]=moment();this[_0x11b6('0xe')](_0x57dc5b);}};EmailChannel[_0x11b6('0x2d')]['handleImapError']=function(_0x4759c1,_0x5e50d1){if(this[_0x11b6('0xb')][_0x4759c1]){this['mailAccounts'][_0x4759c1][_0x11b6('0x10')][_0x11b6('0x11')]=_0x11b6('0x1a');this[_0x11b6('0xb')][_0x4759c1][_0x11b6('0x10')][_0x11b6('0x1e')]=_0x5e50d1;return this[_0x11b6('0xe')](_0x4759c1);}};EmailChannel['prototype'][_0x11b6('0x2e')]=function(_0x362d4a,_0x190025){return this[_0x11b6('0xd')]['send'](_0x362d4a,_0x190025);};EmailChannel[_0x11b6('0x2d')][_0x11b6('0x2f')]=function(_0x25bbb2){var _0x395b87=this;if(this[_0x11b6('0xb')][_0x25bbb2['id']]){if(_[_0x11b6('0x1c')](this[_0x11b6('0xb')][_0x25bbb2['id']]['Smtp'])){this[_0x11b6('0xb')][_0x25bbb2['id']]['Smtp']={};}this[_0x11b6('0xb')][_0x25bbb2['id']]['Smtp'][_0x11b6('0x2c')]=moment();return new BPromise(function(_0x5b2ef7,_0x977daa){return _0x395b87['smtp'][_0x11b6('0x30')](_0x25bbb2)[_0x11b6('0x26')](function(_0x6c531f){_0x395b87[_0x11b6('0xb')][_0x25bbb2['id']]['Smtp'][_0x11b6('0x11')]='verified';_0x395b87[_0x11b6('0xb')][_0x25bbb2['id']][_0x11b6('0x31')]['messageStatus']='';_0x395b87[_0x11b6('0xe')](_0x25bbb2['id']);_0x5b2ef7(_0x6c531f);})['catch'](function(_0x50189f){_0x395b87[_0x11b6('0xb')][_0x25bbb2['id']][_0x11b6('0x31')][_0x11b6('0x11')]=_0x11b6('0x1a');_0x395b87['mailAccounts'][_0x25bbb2['id']]['Smtp'][_0x11b6('0x1e')]=_0x50189f;_0x395b87[_0x11b6('0xe')](_0x25bbb2['id']);_0x977daa(_0x50189f);});});}return this['smtp'][_0x11b6('0x30')](_0x25bbb2);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0x9cbc=['md5','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','status','messageStatus','total','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','handleImapEmail','end','bind','error','handleImapError','isNil','disabled','emit','messages','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cbc,0x9e));var _0xc9cb=function(_0x431ae1,_0x385f06){_0x431ae1=_0x431ae1-0x0;var _0x27fcbd=_0x9cbc[_0x431ae1];return _0x27fcbd;};'use strict';var _=require(_0xc9cb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xc9cb('0x1'));var Redis=require('ioredis');var config=require(_0xc9cb('0x2'));var logger=require(_0xc9cb('0x3'))('email');config[_0xc9cb('0x4')]=_[_0xc9cb('0x5')](config[_0xc9cb('0x4')],{'host':_0xc9cb('0x6'),'port':0x18eb});var io=require(_0xc9cb('0x7'))(new Redis(config[_0xc9cb('0x4')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require(_0xc9cb('0x8'));var md5Accounts={};function EmailChannel(_0x1b240a){logger[_0xc9cb('0x9')](_0xc9cb('0xa'));this[_0xc9cb('0xb')]=_0x1b240a[_0xc9cb('0xb')];this[_0xc9cb('0xc')]={};this[_0xc9cb('0xd')]=new EmailSmtp();}EmailChannel[_0xc9cb('0xe')]['emit']=function(_0x107b7c){var _0x1d92ca=this[_0xc9cb('0xb')][_0x107b7c];var _0x18cbea={'id':_0x1d92ca['id'],'name':_0x1d92ca[_0xc9cb('0xf')],'key':_0x1d92ca[_0xc9cb('0x10')],'active':_0x1d92ca[_0xc9cb('0x11')],'Imap':{'status':_0x1d92ca[_0xc9cb('0x12')][_0xc9cb('0x13')],'messageStatus':_0x1d92ca[_0xc9cb('0x12')][_0xc9cb('0x14')],'total':_0x1d92ca[_0xc9cb('0x12')][_0xc9cb('0x15')]}};if(_['isNil'](md5Accounts[_0x107b7c])){md5Accounts[_0x107b7c]={};}var _0x4628e6=md5(JSON[_0xc9cb('0x16')](_0x18cbea));if(md5Accounts[_0x107b7c][_0xc9cb('0x1')]!==_0x4628e6){md5Accounts[_0x107b7c]['md5']=_0x4628e6;io['emit'](_0xc9cb('0x17'),_0x18cbea);}};EmailChannel['prototype'][_0xc9cb('0x18')]=function(_0x4a7c66){for(var _0x7194fb in _0x4a7c66){if(_0x4a7c66[_0xc9cb('0x19')](_0x7194fb)){if(_0x4a7c66[_0x7194fb][_0xc9cb('0x12')]&&_0x4a7c66[_0x7194fb][_0xc9cb('0x11')]){var _0xd627e0=_0x4a7c66[_0x7194fb][_0xc9cb('0x12')];if(!this[_0xc9cb('0xc')][_0xc9cb('0x19')](_0xd627e0['id'])){this[_0xc9cb('0xc')][_0xd627e0['id']]=new EmailImap(_0xd627e0,_0x4a7c66[_0x7194fb]['email']);this[_0xc9cb('0xc')][_0xd627e0['id']]['on'](_0xc9cb('0x1a'),this[_0xc9cb('0x1b')]['bind'](this,_0x7194fb));this[_0xc9cb('0xc')][_0xd627e0['id']]['on']('email',this[_0xc9cb('0x1c')]['bind'](this,_0x7194fb));this['imapAccounts'][_0xd627e0['id']]['on'](_0xc9cb('0x1d'),this['handleImapEnd'][_0xc9cb('0x1e')](this,_0x7194fb));this['imapAccounts'][_0xd627e0['id']]['on'](_0xc9cb('0x1f'),this[_0xc9cb('0x20')]['bind'](this,_0x7194fb));}}else{if(_[_0xc9cb('0x21')](this[_0xc9cb('0xb')][_0x7194fb]['Imap'])){this[_0xc9cb('0xb')][_0x7194fb][_0xc9cb('0x12')]={};}this[_0xc9cb('0xb')][_0x7194fb]['Imap'][_0xc9cb('0x13')]=_0xc9cb('0x22');this[_0xc9cb('0xb')][_0x7194fb][_0xc9cb('0x12')]['messageStatus']='';this[_0xc9cb('0x23')](_0x7194fb);}}}};EmailChannel['prototype'][_0xc9cb('0x1b')]=function(_0x20d022,_0x12b129){if(this[_0xc9cb('0xb')][_0x20d022]){this[_0xc9cb('0xb')][_0x20d022][_0xc9cb('0x12')][_0xc9cb('0x13')]='connected';this['mailAccounts'][_0x20d022][_0xc9cb('0x12')][_0xc9cb('0x14')]=_0x12b129['name'];if(_0x12b129['messages']){this[_0xc9cb('0xb')][_0x20d022][_0xc9cb('0x12')][_0xc9cb('0x15')]=_0x12b129[_0xc9cb('0x24')][_0xc9cb('0x15')];}return this['emit'](_0x20d022);}};EmailChannel[_0xc9cb('0xe')]['handleImapEmail']=function(_0xdbd274,_0x4aba05){logger[_0xc9cb('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x4aba05[_0xc9cb('0x25')],_0x4aba05[_0xc9cb('0x26')],_0x4aba05['from'],_0xdbd274);if(this[_0xc9cb('0xb')][_0xdbd274]){return mailAccount[_0xc9cb('0x27')](_0xdbd274,_0x4aba05)[_0xc9cb('0x28')](function(_0x3c8ea8){if(_0x3c8ea8){logger['info'](_0xc9cb('0x29'));}})[_0xc9cb('0x2a')](function(_0xc5e1e7){logger[_0xc9cb('0x1f')](_0xc9cb('0x2b'),JSON['stringify'](_0xc5e1e7));});}};EmailChannel[_0xc9cb('0xe')][_0xc9cb('0x2c')]=function(_0x50cd7e){if(this[_0xc9cb('0xb')][_0x50cd7e]&&this[_0xc9cb('0xb')][_0x50cd7e][_0xc9cb('0x12')]){if(this[_0xc9cb('0xc')][this['mailAccounts'][_0x50cd7e][_0xc9cb('0x12')]['id']]){delete this[_0xc9cb('0xc')][this['mailAccounts'][_0x50cd7e][_0xc9cb('0x12')]['id']];}this['mailAccounts'][_0x50cd7e][_0xc9cb('0x12')]['lastSync']=moment();this[_0xc9cb('0x23')](_0x50cd7e);}};EmailChannel[_0xc9cb('0xe')][_0xc9cb('0x20')]=function(_0x18e356,_0x8c5fcf){if(this['mailAccounts'][_0x18e356]){this[_0xc9cb('0xb')][_0x18e356][_0xc9cb('0x12')]['status']=_0xc9cb('0x1f');this['mailAccounts'][_0x18e356][_0xc9cb('0x12')][_0xc9cb('0x14')]=_0x8c5fcf;return this[_0xc9cb('0x23')](_0x18e356);}};EmailChannel[_0xc9cb('0xe')][_0xc9cb('0x2d')]=function(_0x268cb3,_0x5377c3){return this[_0xc9cb('0xd')][_0xc9cb('0x2e')](_0x268cb3,_0x5377c3);};EmailChannel[_0xc9cb('0xe')][_0xc9cb('0x2f')]=function(_0x418f5f){var _0x29d010=this;if(this[_0xc9cb('0xb')][_0x418f5f['id']]){if(_[_0xc9cb('0x21')](this['mailAccounts'][_0x418f5f['id']][_0xc9cb('0x30')])){this[_0xc9cb('0xb')][_0x418f5f['id']][_0xc9cb('0x30')]={};}this[_0xc9cb('0xb')][_0x418f5f['id']]['Smtp'][_0xc9cb('0x31')]=moment();return new BPromise(function(_0x1a8cfa,_0x55693e){return _0x29d010['smtp'][_0xc9cb('0x32')](_0x418f5f)[_0xc9cb('0x28')](function(_0x16f3d4){_0x29d010['mailAccounts'][_0x418f5f['id']][_0xc9cb('0x30')]['status']=_0xc9cb('0x33');_0x29d010[_0xc9cb('0xb')][_0x418f5f['id']][_0xc9cb('0x30')][_0xc9cb('0x14')]='';_0x29d010[_0xc9cb('0x23')](_0x418f5f['id']);_0x1a8cfa(_0x16f3d4);})[_0xc9cb('0x2a')](function(_0x4a90bb){_0x29d010[_0xc9cb('0xb')][_0x418f5f['id']][_0xc9cb('0x30')]['status']=_0xc9cb('0x1f');_0x29d010[_0xc9cb('0xb')][_0x418f5f['id']][_0xc9cb('0x30')][_0xc9cb('0x14')]=_0x4a90bb;_0x29d010[_0xc9cb('0x23')](_0x418f5f['id']);_0x55693e(_0x4a90bb);});});}return this['smtp'][_0xc9cb('0x32')](_0x418f5f);};module[_0xc9cb('0x34')]=EmailChannel;
\ No newline at end of file
index 21eae6f..4d663fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['end','handleEnd','error','connect','authTimeout','service','user','password','host','port','tls','required','prototype','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleSimpleParser','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','mailparser','simpleParser','iconv','Iconv','events','./utils','email','INBOX','account','getAccount','ready','handleReady','bind','once'];(function(_0x1aab45,_0xcd9db8){var _0x374e14=function(_0x5212bc){while(--_0x5212bc){_0x1aab45['push'](_0x1aab45['shift']());}};_0x374e14(++_0xcd9db8);}(_0xef17,0x1be));var _0x7ef1=function(_0x1affb0,_0x2cbc50){_0x1affb0=_0x1affb0-0x0;var _0x36eaa0=_0xef17[_0x1affb0];return _0x36eaa0;};'use strict';var fs=require('fs');var path=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var Imap=require(_0x7ef1('0x2'));var _=require('lodash');var rs=require(_0x7ef1('0x3'));var simpleParser=require(_0x7ef1('0x4'))[_0x7ef1('0x5')];var Iconv=require(_0x7ef1('0x6'))[_0x7ef1('0x7')];var EventEmitter=require(_0x7ef1('0x8'))['EventEmitter'];var utils=require(_0x7ef1('0x9'));var logger=require('../../../config/logger')(_0x7ef1('0xa'));function EmailImap(_0x109b59,_0x77785b){this['mailbox']=_0x7ef1('0xb');this[_0x7ef1('0xc')]=this[_0x7ef1('0xd')](_0x109b59,_0x77785b);this['imap']=new Imap(this[_0x7ef1('0xc')]);this[_0x7ef1('0x2')]['once'](_0x7ef1('0xe'),this[_0x7ef1('0xf')][_0x7ef1('0x10')](this));this['imap'][_0x7ef1('0x11')](_0x7ef1('0x12'),this[_0x7ef1('0x13')][_0x7ef1('0x10')](this));this[_0x7ef1('0x2')]['on'](_0x7ef1('0x14'),this['handleError'][_0x7ef1('0x10')](this));this[_0x7ef1('0x2')][_0x7ef1('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x7ef1('0xd')]=function(_0xcf6617,_0x5775d4){var _0x1d23e6={'connTimeout':_0xcf6617['connTimeout']?_0xcf6617['connTimeout']*0x3e8:0x2710,'authTimeout':_0xcf6617[_0x7ef1('0x16')]?_0xcf6617[_0x7ef1('0x16')]*0x3e8:0x1388};if(_['isNil'](_0xcf6617[_0x7ef1('0x17')])){if(_0xcf6617['authentication']){_0x1d23e6[_0x7ef1('0x18')]=_0xcf6617['user'];_0x1d23e6[_0x7ef1('0x19')]=_0xcf6617[_0x7ef1('0x19')];}_0x1d23e6[_0x7ef1('0x1a')]=_0xcf6617[_0x7ef1('0x1a')];_0x1d23e6['port']=_0xcf6617[_0x7ef1('0x1b')]||0x3e1;if(_0xcf6617[_0x7ef1('0x1c')]){_0x1d23e6[_0x7ef1('0x1c')]=!![];}else{_0x1d23e6[_0x7ef1('0x1c')]=![];_0x1d23e6['autotls']=_0x7ef1('0x1d');}}else{_0x1d23e6[_0x7ef1('0x18')]=_0xcf6617[_0x7ef1('0x18')];_0x1d23e6[_0x7ef1('0x19')]=_0xcf6617[_0x7ef1('0x19')];_0x1d23e6[_0x7ef1('0x1a')]=utils['getHost'](_0xcf6617[_0x7ef1('0x17')]);_0x1d23e6[_0x7ef1('0x1b')]=0x3e1;_0x1d23e6[_0x7ef1('0x1c')]=!![];}_0x1d23e6['email']=_0x5775d4||_0xcf6617[_0x7ef1('0x18')]||'anonymous@xcally.com';return _0x1d23e6;};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0xf')]=function(){this[_0x7ef1('0x2')][_0x7ef1('0x1f')](this[_0x7ef1('0x20')],![],this[_0x7ef1('0x21')]['bind'](this));};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x21')]=function(_0x3da6ea,_0x27418e){if(_0x3da6ea){this[_0x7ef1('0x22')](_0x3da6ea,!![]);}else{this[_0x7ef1('0x23')](_0x7ef1('0x24'),_0x27418e);this[_0x7ef1('0x25')]();}};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x26')]=function(_0x36379c){if(_0x36379c){this[_0x7ef1('0x22')](_0x36379c,!![]);}else{this['imap']['end']();}};EmailImap['prototype'][_0x7ef1('0x25')]=function(){this[_0x7ef1('0x2')][_0x7ef1('0x27')]([_0x7ef1('0x28')],this[_0x7ef1('0x29')][_0x7ef1('0x10')](this));};EmailImap[_0x7ef1('0x1e')]['handleReadUnseen']=function(_0x8d893b,_0x69aeb3){if(_0x8d893b){this[_0x7ef1('0x22')](_0x8d893b,!![]);}else{if(_0x69aeb3['length']){try{var _0x311ba6=this[_0x7ef1('0x2')][_0x7ef1('0x2a')](_0x69aeb3,{'bodies':'','markSeen':!![]});_0x311ba6['on']('message',this[_0x7ef1('0x2b')][_0x7ef1('0x10')](this));_0x311ba6[_0x7ef1('0x11')](_0x7ef1('0x14'),this[_0x7ef1('0x2c')]['bind'](this));_0x311ba6[_0x7ef1('0x11')](_0x7ef1('0x12'),this[_0x7ef1('0x2d')]['bind'](this));}catch(_0x563b40){logger['error'](_0x563b40);}}else{this[_0x7ef1('0x2')][_0x7ef1('0x2e')](!![],this[_0x7ef1('0x26')][_0x7ef1('0x10')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x4a3d2a,_0x4bde29){_0x4a3d2a['on'](_0x7ef1('0x2f'),this[_0x7ef1('0x30')][_0x7ef1('0x10')](this));_0x4a3d2a['once'](_0x7ef1('0x31'),this['handleMessageAttributes'][_0x7ef1('0x10')](this));_0x4a3d2a[_0x7ef1('0x11')](_0x7ef1('0x12'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x7ef1('0x1e')]['handleMessageBody']=function(_0x347eb2,_0x47efa2){simpleParser(_0x347eb2,{'Iconv':Iconv},this[_0x7ef1('0x32')][_0x7ef1('0x10')](this));};EmailImap[_0x7ef1('0x1e')]['handleMessageAttributes']=function(_0x1b21a3){};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x33')]=function(){};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x32')]=function(_0xaa1939,_0x38425e){if(_0xaa1939){logger[_0x7ef1('0x14')](_0xaa1939);}else{var _0x103ffd=this;utils[_0x7ef1('0x34')](this[_0x7ef1('0xc')],_0x38425e,function(_0x5e3555){_0x103ffd[_0x7ef1('0x23')](_0x7ef1('0xa'),_0x5e3555);});}};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x2d')]=function(){this[_0x7ef1('0x2')][_0x7ef1('0x2e')](!![],this[_0x7ef1('0x26')]['bind'](this));};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x2c')]=function(_0x121510){this[_0x7ef1('0x22')](_0x121510);this[_0x7ef1('0x2')]['closeBox'](!![],this[_0x7ef1('0x26')][_0x7ef1('0x10')](this));};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x13')]=function(){this[_0x7ef1('0x23')](_0x7ef1('0x12'));};EmailImap[_0x7ef1('0x1e')][_0x7ef1('0x22')]=function(_0x3e2f5e,_0x1dab6c){logger['error']('handleError',this[_0x7ef1('0xc')]['email'],JSON[_0x7ef1('0x35')](_0x3e2f5e));var _0x2f67f5='';if(_0x3e2f5e){if(_0x3e2f5e[_0x7ef1('0x36')]){_0x2f67f5=_0x3e2f5e[_0x7ef1('0x36')];}else{for(var _0x5e3125 in _0x3e2f5e){if(_0x3e2f5e[_0x7ef1('0x37')](_0x5e3125)){_0x2f67f5+=_[_0x7ef1('0x38')](_0x5e3125)+':\x20'+_0x3e2f5e[_0x5e3125]+'\x0a';}}}}if(_0x1dab6c){this['imap']['end']();}else{this[_0x7ef1('0x23')](_0x7ef1('0x14'),_0x2f67f5);this[_0x7ef1('0x23')]('end');}};module[_0x7ef1('0x39')]=EmailImap;
\ No newline at end of file
+var _0x44af=['upperFirst','exports','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account','ready','end','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchMessage','once','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','handleEnd','stringify','textCode'];(function(_0x9bde0f,_0x22e0ce){var _0x14ff47=function(_0xb1cb25){while(--_0xb1cb25){_0x9bde0f['push'](_0x9bde0f['shift']());}};_0x14ff47(++_0x22e0ce);}(_0x44af,0xc5));var _0xf44a=function(_0x486a95,_0x18bed7){_0x486a95=_0x486a95-0x0;var _0x1cc0ec=_0x44af[_0x486a95];return _0x1cc0ec;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var Imap=require(_0xf44a('0x0'));var _=require(_0xf44a('0x1'));var rs=require(_0xf44a('0x2'));var simpleParser=require(_0xf44a('0x3'))[_0xf44a('0x4')];var Iconv=require(_0xf44a('0x5'))['Iconv'];var EventEmitter=require(_0xf44a('0x6'))[_0xf44a('0x7')];var utils=require(_0xf44a('0x8'));var logger=require(_0xf44a('0x9'))(_0xf44a('0xa'));function EmailImap(_0x38c550,_0x971b34){this[_0xf44a('0xb')]=_0xf44a('0xc');this['account']=this[_0xf44a('0xd')](_0x38c550,_0x971b34);this[_0xf44a('0x0')]=new Imap(this[_0xf44a('0xe')]);this[_0xf44a('0x0')]['once'](_0xf44a('0xf'),this['handleReady']['bind'](this));this[_0xf44a('0x0')]['once'](_0xf44a('0x10'),this['handleEnd'][_0xf44a('0x11')](this));this[_0xf44a('0x0')]['on'](_0xf44a('0x12'),this[_0xf44a('0x13')][_0xf44a('0x11')](this));this['imap'][_0xf44a('0x14')]();}util[_0xf44a('0x15')](EmailImap,EventEmitter);EmailImap[_0xf44a('0x16')][_0xf44a('0xd')]=function(_0x8262d3,_0x5b50ef){var _0x1cfcf6={'connTimeout':_0x8262d3[_0xf44a('0x17')]?_0x8262d3['connTimeout']*0x3e8:0x2710,'authTimeout':_0x8262d3['authTimeout']?_0x8262d3[_0xf44a('0x18')]*0x3e8:0x1388};if(_[_0xf44a('0x19')](_0x8262d3[_0xf44a('0x1a')])){if(_0x8262d3[_0xf44a('0x1b')]){_0x1cfcf6[_0xf44a('0x1c')]=_0x8262d3[_0xf44a('0x1c')];_0x1cfcf6['password']=_0x8262d3[_0xf44a('0x1d')];}_0x1cfcf6[_0xf44a('0x1e')]=_0x8262d3[_0xf44a('0x1e')];_0x1cfcf6[_0xf44a('0x1f')]=_0x8262d3['port']||0x3e1;if(_0x8262d3['tls']){_0x1cfcf6[_0xf44a('0x20')]=!![];}else{_0x1cfcf6[_0xf44a('0x20')]=![];_0x1cfcf6[_0xf44a('0x21')]=_0xf44a('0x22');}}else{_0x1cfcf6[_0xf44a('0x1c')]=_0x8262d3[_0xf44a('0x1c')];_0x1cfcf6[_0xf44a('0x1d')]=_0x8262d3[_0xf44a('0x1d')];_0x1cfcf6[_0xf44a('0x1e')]=utils[_0xf44a('0x23')](_0x8262d3[_0xf44a('0x1a')]);_0x1cfcf6[_0xf44a('0x1f')]=0x3e1;_0x1cfcf6['tls']=!![];}_0x1cfcf6[_0xf44a('0xa')]=_0x5b50ef||_0x8262d3['user']||_0xf44a('0x24');return _0x1cfcf6;};EmailImap[_0xf44a('0x16')][_0xf44a('0x25')]=function(){this['imap'][_0xf44a('0x26')](this[_0xf44a('0xb')],![],this[_0xf44a('0x27')][_0xf44a('0x11')](this));};EmailImap[_0xf44a('0x16')][_0xf44a('0x27')]=function(_0x5de164,_0x4d443e){if(_0x5de164){this[_0xf44a('0x13')](_0x5de164,!![]);}else{this[_0xf44a('0x28')](_0xf44a('0x29'),_0x4d443e);this['readUnseen']();}};EmailImap[_0xf44a('0x16')][_0xf44a('0x2a')]=function(_0x4cc8eb){if(_0x4cc8eb){this[_0xf44a('0x13')](_0x4cc8eb,!![]);}else{this['imap'][_0xf44a('0x10')]();}};EmailImap[_0xf44a('0x16')][_0xf44a('0x2b')]=function(){this[_0xf44a('0x0')][_0xf44a('0x2c')](['UNSEEN'],this[_0xf44a('0x2d')][_0xf44a('0x11')](this));};EmailImap[_0xf44a('0x16')][_0xf44a('0x2d')]=function(_0x1d02e6,_0x394aed){if(_0x1d02e6){this['handleError'](_0x1d02e6,!![]);}else{if(_0x394aed[_0xf44a('0x2e')]){try{var _0x3c2e7a=this['imap'][_0xf44a('0x2f')](_0x394aed,{'bodies':'','markSeen':!![]});_0x3c2e7a['on'](_0xf44a('0x30'),this[_0xf44a('0x31')][_0xf44a('0x11')](this));_0x3c2e7a[_0xf44a('0x32')](_0xf44a('0x12'),this['handleFetchError'][_0xf44a('0x11')](this));_0x3c2e7a[_0xf44a('0x32')]('end',this['handleFetchEnd'][_0xf44a('0x11')](this));}catch(_0x10ce9c){logger[_0xf44a('0x12')](_0x10ce9c);}}else{this['imap'][_0xf44a('0x33')](!![],this[_0xf44a('0x2a')]['bind'](this));}}};EmailImap['prototype'][_0xf44a('0x31')]=function(_0x5e14dc,_0x7d6980){_0x5e14dc['on'](_0xf44a('0x34'),this[_0xf44a('0x35')][_0xf44a('0x11')](this));_0x5e14dc[_0xf44a('0x32')](_0xf44a('0x36'),this[_0xf44a('0x37')][_0xf44a('0x11')](this));_0x5e14dc[_0xf44a('0x32')]('end',this[_0xf44a('0x38')][_0xf44a('0x11')](this));};EmailImap[_0xf44a('0x16')]['handleMessageBody']=function(_0x4f4da5,_0x4f3875){simpleParser(_0x4f4da5,{'Iconv':Iconv},this[_0xf44a('0x39')][_0xf44a('0x11')](this));};EmailImap['prototype'][_0xf44a('0x37')]=function(_0x819185){};EmailImap[_0xf44a('0x16')][_0xf44a('0x38')]=function(){};EmailImap[_0xf44a('0x16')]['handleSimpleParser']=function(_0x549660,_0x4e6da2){if(_0x549660){logger[_0xf44a('0x12')](_0x549660);}else{var _0x31f27c=this;utils[_0xf44a('0x3a')](this['account'],_0x4e6da2,function(_0x1668f0){_0x31f27c['emit'](_0xf44a('0xa'),_0x1668f0);});}};EmailImap['prototype'][_0xf44a('0x3b')]=function(){this[_0xf44a('0x0')][_0xf44a('0x33')](!![],this[_0xf44a('0x2a')][_0xf44a('0x11')](this));};EmailImap[_0xf44a('0x16')]['handleFetchError']=function(_0x353b34){this['handleError'](_0x353b34);this[_0xf44a('0x0')][_0xf44a('0x33')](!![],this[_0xf44a('0x2a')]['bind'](this));};EmailImap[_0xf44a('0x16')][_0xf44a('0x3c')]=function(){this[_0xf44a('0x28')]('end');};EmailImap[_0xf44a('0x16')][_0xf44a('0x13')]=function(_0x940341,_0x1e3729){logger[_0xf44a('0x12')](_0xf44a('0x13'),this[_0xf44a('0xe')][_0xf44a('0xa')],JSON[_0xf44a('0x3d')](_0x940341));var _0x356607='';if(_0x940341){if(_0x940341['textCode']){_0x356607=_0x940341[_0xf44a('0x3e')];}else{for(var _0x2a754c in _0x940341){if(_0x940341['hasOwnProperty'](_0x2a754c)){_0x356607+=_[_0xf44a('0x3f')](_0x2a754c)+':\x20'+_0x940341[_0x2a754c]+'\x0a';}}}}if(_0x1e3729){this[_0xf44a('0x0')][_0xf44a('0x10')]();}else{this['emit'](_0xf44a('0x12'),_0x356607);this[_0xf44a('0x28')](_0xf44a('0x10'));}};module[_0xf44a('0x40')]=EmailImap;
\ No newline at end of file
index 8f3d9c9..2b2dab8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0427=['verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','toString','prototype'];(function(_0x6123ec,_0x4cb6b6){var _0x3c2cfe=function(_0x1fb1c4){while(--_0x1fb1c4){_0x6123ec['push'](_0x6123ec['shift']());}};_0x3c2cfe(++_0x4cb6b6);}(_0x0427,0x1a5));var _0x7042=function(_0x509844,_0x23aaf7){_0x509844=_0x509844-0x0;var _0x47268c=_0x0427[_0x509844];return _0x47268c;};'use strict';var nodemailer=require('nodemailer');var BPromise=require('bluebird');var inlineBase64=require(_0x7042('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0x7042('0x1')]=function(_0x45b8c1,_0x265344){return new BPromise(function(_0x4a47ce,_0x72d258){var _0xde1762=nodemailer[_0x7042('0x2')](_0x45b8c1);_0xde1762[_0x7042('0x3')](_0x7042('0x4'),inlineBase64());_0xde1762[_0x7042('0x5')](_0x265344,function(_0xaa5817,_0x52f923){if(_0xaa5817){_0x72d258(_0xaa5817[_0x7042('0x6')]());}else{_0x4a47ce(_0x52f923);}});});};EmailSmtp[_0x7042('0x7')][_0x7042('0x8')]=function(_0x35503e){return new BPromise(function(_0x4e7137,_0x53f5be){var _0x43cbdf=nodemailer[_0x7042('0x2')](_0x35503e);_0x43cbdf[_0x7042('0x8')](function(_0x1efb1,_0x54b363){if(_0x1efb1){_0x53f5be(_0x1efb1[_0x7042('0x6')]());}else{if(_0x54b363){_0x4e7137(_0x54b363);}else{_0x53f5be(_0x7042('0x9'));}}});});};module[_0x7042('0xa')]=EmailSmtp;
\ No newline at end of file
+var _0x4378=['toString','createTransport','Not\x20verifired','exports','nodemailer','bluebird','prototype','send','use','compile','sendMail'];(function(_0x206934,_0x496ee3){var _0x4ac1ca=function(_0x38a0e3){while(--_0x38a0e3){_0x206934['push'](_0x206934['shift']());}};_0x4ac1ca(++_0x496ee3);}(_0x4378,0x101));var _0x8437=function(_0xc99e68,_0x1aba84){_0xc99e68=_0xc99e68-0x0;var _0x8a94d5=_0x4378[_0xc99e68];return _0x8a94d5;};'use strict';var nodemailer=require(_0x8437('0x0'));var BPromise=require(_0x8437('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8437('0x2')][_0x8437('0x3')]=function(_0x2775d4,_0x551717){return new BPromise(function(_0xb11993,_0x1a7686){var _0x209e7b=nodemailer['createTransport'](_0x2775d4);_0x209e7b[_0x8437('0x4')](_0x8437('0x5'),inlineBase64());_0x209e7b[_0x8437('0x6')](_0x551717,function(_0x2bde26,_0x10c790){if(_0x2bde26){_0x1a7686(_0x2bde26[_0x8437('0x7')]());}else{_0xb11993(_0x10c790);}});});};EmailSmtp[_0x8437('0x2')]['verify']=function(_0x38f7fb){return new BPromise(function(_0x4db14f,_0x3c215f){var _0x4db2ca=nodemailer[_0x8437('0x8')](_0x38f7fb);_0x4db2ca['verify'](function(_0x444334,_0x511d95){if(_0x444334){_0x3c215f(_0x444334['toString']());}else{if(_0x511d95){_0x4db14f(_0x511d95);}else{_0x3c215f(_0x8437('0x9'));}}});});};module[_0x8437('0xa')]=EmailSmtp;
\ No newline at end of file
index 270e7fe..c397059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5b3=['application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','value','address','anonymous','generate','@xcally.com','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','test','html','replace','includes','attachments','forEach','push','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originCc','originTo','bcc','type','filename','attachment-','%s-%s','now','root','writeFileSync','content','contentType','headerLines','Precedence:\x20auto_reply','isAutoreply','from','subject','inReplyTo','format','filter'];(function(_0x4603a0,_0x34f97a){var _0x34d839=function(_0x44c3ee){while(--_0x44c3ee){_0x4603a0['push'](_0x4603a0['shift']());}};_0x34d839(++_0x34f97a);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xc5b3[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x3c5b('0x0'));var moment=require(_0x3c5b('0x1'));var random=require(_0x3c5b('0x2'));var fs=require('fs');var path=require(_0x3c5b('0x3'));var util=require(_0x3c5b('0x4'));var tnef=require(_0x3c5b('0x5'));var logger=require(_0x3c5b('0x6'))(_0x3c5b('0x7'));var config=require('../../../config/environment');function getAddress(_0x3cd21d){var _0x721a26=_['head'](_0x3cd21d[_0x3c5b('0x8')]);return _0x721a26&&_0x721a26['address']?_0x721a26[_0x3c5b('0x9')]:_0x3c5b('0xa')+random[_0x3c5b('0xb')](0x6)+_0x3c5b('0xc');}function getFirstName(_0x32586d){var _0x1d0174=_[_0x3c5b('0xd')](_0x32586d['value']);if(_0x1d0174&&_0x1d0174[_0x3c5b('0xe')]){if(_0x1d0174[_0x3c5b('0xe')]==_0x1d0174[_0x3c5b('0x9')]){return _0x1d0174[_0x3c5b('0xe')][_0x3c5b('0xf')](0x0,_0x1d0174['name'][_0x3c5b('0x10')]('@'));}var _0x2ce28d=_0x1d0174[_0x3c5b('0xe')][_0x3c5b('0x11')](/\s+/);return _0x2ce28d[_0x3c5b('0x12')]>0x1?_0x2ce28d[_0x3c5b('0x13')](0x0,-0x1)[_0x3c5b('0x14')]('\x20'):_0x1d0174['name'];}return _0x3c5b('0x15');}function getLastName(_0x4769e3){var _0x1890d7=_[_0x3c5b('0xd')](_0x4769e3['value']);if(_0x1890d7&&_0x1890d7[_0x3c5b('0xe')]){var _0x5e5fbb=_0x1890d7[_0x3c5b('0xe')][_0x3c5b('0x11')](/\s+/);return _0x5e5fbb['length']>0x1?_0x5e5fbb[_0x3c5b('0x16')]():'';}return'';}function getMails(_0x88069a,_0x5d64cb){var _0x32c58e='';for(var _0x1cbe52=0x0;_0x1cbe52<_0x5d64cb[_0x3c5b('0x8')]['length'];_0x1cbe52+=0x1){if(_0x5d64cb[_0x3c5b('0x8')][_0x1cbe52]['address']!==_0x88069a){if(!_[_0x3c5b('0x17')](_0x32c58e)){_0x32c58e+=',';}_0x32c58e+=_0x5d64cb[_0x3c5b('0x8')][_0x1cbe52][_0x3c5b('0xe')]||_0x5d64cb[_0x3c5b('0x8')][_0x1cbe52][_0x3c5b('0x9')]||'';_0x32c58e+='\x20<';_0x32c58e+=_0x5d64cb[_0x3c5b('0x8')][_0x1cbe52]['address']?_0x5d64cb['value'][_0x1cbe52][_0x3c5b('0x9')]:'anonymous'+random[_0x3c5b('0xb')](0x6)+_0x3c5b('0xc');_0x32c58e+='>';}}return _0x32c58e;}function parseEmail(_0x135666,_0x4cb3d3,_0x3184e0){if(_0x4cb3d3['html']){var _0x2b7e4f=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x2b7e4f[_0x3c5b('0x18')](_0x4cb3d3[_0x3c5b('0x19')])){_0x4cb3d3[_0x3c5b('0x19')]=_0x4cb3d3[_0x3c5b('0x19')][_0x3c5b('0x1a')](_0x2b7e4f,'');}if(_0x4cb3d3[_0x3c5b('0x19')][_0x3c5b('0x1b')]('<img')){var _0x194692=[];_0x4cb3d3[_0x3c5b('0x1c')][_0x3c5b('0x1d')](_0x5c9b62=>{_0x194692[_0x3c5b('0x1e')](_0x5c9b62['filename']);});var _0x5be530=/<img.*? _SRC(.*?)[^>]+>/g;var _0x5a78c9=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x4de3fa=_0x4cb3d3[_0x3c5b('0x19')][_0x3c5b('0x1a')](_0x5a78c9,_0x3c5b('0x1f'));var _0x51a77f=_0x4de3fa[_0x3c5b('0x1a')](_0x5be530,'_IMG');for(let _0x3548e9=0x0;_0x3548e9<_0x194692[_0x3c5b('0x12')];_0x3548e9++){var _0x1e0b84=_0x51a77f[_0x3c5b('0x1a')](_0x3c5b('0x20'),_0x3c5b('0x21')+_0x194692[_0x3548e9]+_0x3c5b('0x22'));_0x51a77f=_0x1e0b84;}_0x4cb3d3[_0x3c5b('0x19')]=_0x51a77f;}_0x3184e0[_0x3c5b('0x23')]=_0x4cb3d3['html'];}else{_0x3184e0[_0x3c5b('0x23')]=_0x4cb3d3[_0x3c5b('0x24')];}if(_0x3184e0[_0x3c5b('0x23')]){_0x3184e0[_0x3c5b('0x23')]=_0x3184e0[_0x3c5b('0x23')][_0x3c5b('0x1a')](/<a\s+/gi,_0x3c5b('0x25'));}if(_0x4cb3d3['to']){_0x3184e0[_0x3c5b('0x26')]['originTo']=getMails(null,_0x4cb3d3['to']);var _0x5ac5c2=getMails(_0x135666[_0x3c5b('0x7')],_0x4cb3d3['to']);if(!_[_0x3c5b('0x17')](_0x5ac5c2)){_0x3184e0['message']['cc']+=_0x5ac5c2;}}if(_0x4cb3d3['cc']){_0x3184e0[_0x3c5b('0x26')][_0x3c5b('0x27')]=getMails(null,_0x4cb3d3['cc']);var _0x52a50b=getMails(_0x135666[_0x3c5b('0x7')],_0x4cb3d3['cc']);if(!_[_0x3c5b('0x17')](_0x52a50b)){if(!_['isEmpty'](_0x3184e0[_0x3c5b('0x26')]['cc'])){_0x3184e0[_0x3c5b('0x26')]['cc']+=',';}_0x3184e0[_0x3c5b('0x26')]['cc']+=_0x52a50b;}}if(!_[_0x3c5b('0x1b')](_0x3184e0[_0x3c5b('0x26')][_0x3c5b('0x28')],_0x135666[_0x3c5b('0x7')])&&!_[_0x3c5b('0x1b')](_0x3184e0[_0x3c5b('0x26')][_0x3c5b('0x27')],_0x135666[_0x3c5b('0x7')])){_0x3184e0[_0x3c5b('0x26')][_0x3c5b('0x29')]=_0x135666[_0x3c5b('0x7')];}if(_0x4cb3d3['attachments']&&_0x4cb3d3[_0x3c5b('0x1c')][_0x3c5b('0x12')]){_0x3184e0[_0x3c5b('0x26')]['attach']=_0x4cb3d3['attachments'][_0x3c5b('0x12')];for(var _0x4ecde3=0x0,_0x336245,_0x5a468,_0x217c39;_0x4ecde3<_0x4cb3d3[_0x3c5b('0x1c')][_0x3c5b('0x12')];_0x4ecde3+=0x1){if(_0x4cb3d3[_0x3c5b('0x1c')][_0x4ecde3][_0x3c5b('0x2a')]==='attachment'){_0x217c39=_0x4cb3d3['attachments'][_0x4ecde3][_0x3c5b('0x2b')]||_0x3c5b('0x2c')+_0x4ecde3;_0x336245=util['format'](_0x3c5b('0x2d'),Date[_0x3c5b('0x2e')](),_0x217c39);_0x5a468=path[_0x3c5b('0x14')](config[_0x3c5b('0x2f')],'server/files/attachments/',_0x336245);fs[_0x3c5b('0x30')](_0x5a468,_0x4cb3d3[_0x3c5b('0x1c')][_0x4ecde3][_0x3c5b('0x31')]);_0x3184e0['message']['attachments'][_0x3c5b('0x1e')]({'name':_0x217c39,'basename':_0x336245,'type':_0x4cb3d3[_0x3c5b('0x1c')][_0x4ecde3][_0x3c5b('0x32')],'filepath':_0x5a468});}}}if(_0x4cb3d3[_0x3c5b('0x33')]&&_0x4cb3d3[_0x3c5b('0x33')][_0x3c5b('0x12')]>0x0){var _0x5110b2=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x3c5b('0x34')];for(var _0x4119e8=0x0;_0x4119e8<_0x4cb3d3[_0x3c5b('0x33')]['length'];_0x4119e8++){var _0x55a107=_[_0x3c5b('0x10')](_0x5110b2,_0x4cb3d3[_0x3c5b('0x33')][_0x4119e8]['line']);if(_0x55a107>=0x0){_0x3184e0[_0x3c5b('0x35')]=!![];}}}return _0x3184e0;}exports['parser']=function(_0x4feb0b,_0x27cb54,_0x7d1d35){var _0x2c149d={'from':getAddress(_0x27cb54[_0x3c5b('0x36')]),'firstName':getFirstName(_0x27cb54[_0x3c5b('0x36')]),'lastName':getLastName(_0x27cb54[_0x3c5b('0x36')]),'mapKey':_0x3c5b('0x7'),'message':{'from':getMails(_0x4feb0b[_0x3c5b('0x7')],_0x27cb54[_0x3c5b('0x36')]),'to':_0x4feb0b[_0x3c5b('0x7')],'cc':'','subject':_0x27cb54[_0x3c5b('0x37')]||'','messageId':_0x27cb54['messageId'],'inReplyTo':_0x27cb54[_0x3c5b('0x38')],'sentAt':moment(_0x27cb54['date'])[_0x3c5b('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x27cb54[_0x3c5b('0x19')]&&!_0x27cb54[_0x3c5b('0x24')]){var _0x4223f5=_[_0x3c5b('0x3a')](_0x27cb54[_0x3c5b('0x1c')],{'contentType':_0x3c5b('0x3b')});if(_0x4223f5[_0x3c5b('0x12')]){logger[_0x3c5b('0x3c')](util['format'](_0x3c5b('0x3d'),_0x27cb54[_0x3c5b('0x3e')]));tnef[_0x3c5b('0x3f')](_[_0x3c5b('0x40')](_0x4223f5)['content'],function(_0x32d71f,_0x34f7bd){if(_0x34f7bd){_0x27cb54[_0x3c5b('0x19')]=_0x34f7bd[_0x3c5b('0x41')]||_0x3c5b('0x42');if(_0x34f7bd[_0x3c5b('0x43')]){for(var _0x24d4f6=0x0;_0x24d4f6<_0x34f7bd[_0x3c5b('0x43')][_0x3c5b('0x12')];_0x24d4f6++){var _0x264ef9=_0x34f7bd[_0x3c5b('0x43')][_0x24d4f6];_0x2c149d[_0x3c5b('0x26')]['attachments']['push']({'filename':_0x264ef9[_0x3c5b('0x44')],'content':Buffer[_0x3c5b('0x36')](_0x264ef9[_0x3c5b('0x45')])});}}}_0x7d1d35(parseEmail(_0x4feb0b,_0x27cb54,_0x2c149d));});}else{_0x27cb54['html']=_0x3c5b('0x42');_0x7d1d35(parseEmail(_0x4feb0b,_0x27cb54,_0x2c149d));}}else{_0x7d1d35(parseEmail(_0x4feb0b,_0x27cb54,_0x2c149d));}};exports['getHost']=function(_0x9c0d0b){switch(_0x9c0d0b){case _0x3c5b('0x46'):return _0x3c5b('0x47');case _0x3c5b('0x48'):return _0x3c5b('0x49');case _0x3c5b('0x4a'):return _0x3c5b('0x4b');case _0x3c5b('0x4c'):return _0x3c5b('0x4d');}return _0x3c5b('0x4e');};
\ No newline at end of file
+var _0x1b9b=['@xcally.com','head','name','indexOf','split','length','slice','join','Anonymous','isEmpty','html','replace','includes','<img','attachments','filename','_SRC','_IMG','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','type','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Data','getHost','gmail','yahoo','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','randomstring','path','util','node-tnef','email','../../../config/environment','value','address','anonymous','generate'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1b9b,0x89));var _0xb1b9=function(_0x150822,_0x520791){_0x150822=_0x150822-0x0;var _0x109639=_0x1b9b[_0x150822];return _0x109639;};'use strict';var _=require(_0xb1b9('0x0'));var moment=require('moment');var random=require(_0xb1b9('0x1'));var fs=require('fs');var path=require(_0xb1b9('0x2'));var util=require(_0xb1b9('0x3'));var tnef=require(_0xb1b9('0x4'));var logger=require('../../../config/logger')(_0xb1b9('0x5'));var config=require(_0xb1b9('0x6'));function getAddress(_0x597f8f){var _0x5c24be=_['head'](_0x597f8f[_0xb1b9('0x7')]);return _0x5c24be&&_0x5c24be[_0xb1b9('0x8')]?_0x5c24be['address']:_0xb1b9('0x9')+random[_0xb1b9('0xa')](0x6)+_0xb1b9('0xb');}function getFirstName(_0x55dc7b){var _0x175f77=_[_0xb1b9('0xc')](_0x55dc7b[_0xb1b9('0x7')]);if(_0x175f77&&_0x175f77['name']){if(_0x175f77[_0xb1b9('0xd')]==_0x175f77['address']){return _0x175f77[_0xb1b9('0xd')]['substring'](0x0,_0x175f77[_0xb1b9('0xd')][_0xb1b9('0xe')]('@'));}var _0x1595a6=_0x175f77[_0xb1b9('0xd')][_0xb1b9('0xf')](/\s+/);return _0x1595a6[_0xb1b9('0x10')]>0x1?_0x1595a6[_0xb1b9('0x11')](0x0,-0x1)[_0xb1b9('0x12')]('\x20'):_0x175f77['name'];}return _0xb1b9('0x13');}function getLastName(_0x3aa4bf){var _0x11714e=_['head'](_0x3aa4bf[_0xb1b9('0x7')]);if(_0x11714e&&_0x11714e[_0xb1b9('0xd')]){var _0x2b3e71=_0x11714e[_0xb1b9('0xd')][_0xb1b9('0xf')](/\s+/);return _0x2b3e71[_0xb1b9('0x10')]>0x1?_0x2b3e71['pop']():'';}return'';}function getMails(_0x10316f,_0x4cfdfe){var _0x3993e0='';for(var _0xa09e06=0x0;_0xa09e06<_0x4cfdfe[_0xb1b9('0x7')][_0xb1b9('0x10')];_0xa09e06+=0x1){if(_0x4cfdfe['value'][_0xa09e06][_0xb1b9('0x8')]!==_0x10316f){if(!_[_0xb1b9('0x14')](_0x3993e0)){_0x3993e0+=',';}_0x3993e0+=_0x4cfdfe[_0xb1b9('0x7')][_0xa09e06]['name']||_0x4cfdfe[_0xb1b9('0x7')][_0xa09e06][_0xb1b9('0x8')]||'';_0x3993e0+='\x20<';_0x3993e0+=_0x4cfdfe[_0xb1b9('0x7')][_0xa09e06][_0xb1b9('0x8')]?_0x4cfdfe[_0xb1b9('0x7')][_0xa09e06]['address']:'anonymous'+random['generate'](0x6)+_0xb1b9('0xb');_0x3993e0+='>';}}return _0x3993e0;}function parseEmail(_0x27c7f0,_0x14f4e4,_0x31b067){if(_0x14f4e4[_0xb1b9('0x15')]){var _0x1fae00=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x1fae00['test'](_0x14f4e4['html'])){_0x14f4e4[_0xb1b9('0x15')]=_0x14f4e4[_0xb1b9('0x15')][_0xb1b9('0x16')](_0x1fae00,'');}if(_0x14f4e4['html'][_0xb1b9('0x17')](_0xb1b9('0x18'))){var _0x50c2a7=[];_0x14f4e4[_0xb1b9('0x19')]['forEach'](_0x162eda=>{_0x50c2a7['push'](_0x162eda[_0xb1b9('0x1a')]);});var _0x578116=/<img.*? _SRC(.*?)[^>]+>/g;var _0x326e8f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x37e4ea=_0x14f4e4[_0xb1b9('0x15')][_0xb1b9('0x16')](_0x326e8f,_0xb1b9('0x1b'));var _0x5f45e8=_0x37e4ea[_0xb1b9('0x16')](_0x578116,_0xb1b9('0x1c'));for(let _0x3f2e10=0x0;_0x3f2e10<_0x50c2a7[_0xb1b9('0x10')];_0x3f2e10++){var _0x28fe86=_0x5f45e8[_0xb1b9('0x16')](_0xb1b9('0x1c'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x50c2a7[_0x3f2e10]+'\x20]</span>');_0x5f45e8=_0x28fe86;}_0x14f4e4['html']=_0x5f45e8;}_0x31b067[_0xb1b9('0x1d')]=_0x14f4e4[_0xb1b9('0x15')];}else{_0x31b067[_0xb1b9('0x1d')]=_0x14f4e4[_0xb1b9('0x1e')];}if(_0x31b067[_0xb1b9('0x1d')]){_0x31b067[_0xb1b9('0x1d')]=_0x31b067[_0xb1b9('0x1d')][_0xb1b9('0x16')](/<a\s+/gi,_0xb1b9('0x1f'));}if(_0x14f4e4['to']){_0x31b067[_0xb1b9('0x20')][_0xb1b9('0x21')]=getMails(null,_0x14f4e4['to']);var _0x321790=getMails(_0x27c7f0['email'],_0x14f4e4['to']);if(!_[_0xb1b9('0x14')](_0x321790)){_0x31b067[_0xb1b9('0x20')]['cc']+=_0x321790;}}if(_0x14f4e4['cc']){_0x31b067[_0xb1b9('0x20')][_0xb1b9('0x22')]=getMails(null,_0x14f4e4['cc']);var _0x598cae=getMails(_0x27c7f0[_0xb1b9('0x5')],_0x14f4e4['cc']);if(!_[_0xb1b9('0x14')](_0x598cae)){if(!_[_0xb1b9('0x14')](_0x31b067[_0xb1b9('0x20')]['cc'])){_0x31b067[_0xb1b9('0x20')]['cc']+=',';}_0x31b067[_0xb1b9('0x20')]['cc']+=_0x598cae;}}if(!_[_0xb1b9('0x17')](_0x31b067['message'][_0xb1b9('0x21')],_0x27c7f0[_0xb1b9('0x5')])&&!_[_0xb1b9('0x17')](_0x31b067['message'][_0xb1b9('0x22')],_0x27c7f0[_0xb1b9('0x5')])){_0x31b067[_0xb1b9('0x20')]['bcc']=_0x27c7f0['email'];}if(_0x14f4e4[_0xb1b9('0x19')]&&_0x14f4e4[_0xb1b9('0x19')][_0xb1b9('0x10')]){_0x31b067[_0xb1b9('0x20')]['attach']=_0x14f4e4[_0xb1b9('0x19')][_0xb1b9('0x10')];for(var _0x19ea1a=0x0,_0x3bc66f,_0x39993d,_0x3bbabc;_0x19ea1a<_0x14f4e4['attachments']['length'];_0x19ea1a+=0x1){if(_0x14f4e4[_0xb1b9('0x19')][_0x19ea1a][_0xb1b9('0x23')]===_0xb1b9('0x24')){_0x3bbabc=_0x14f4e4[_0xb1b9('0x19')][_0x19ea1a][_0xb1b9('0x1a')]||_0xb1b9('0x25')+_0x19ea1a;_0x3bc66f=util[_0xb1b9('0x26')](_0xb1b9('0x27'),Date[_0xb1b9('0x28')](),_0x3bbabc);_0x39993d=path[_0xb1b9('0x12')](config[_0xb1b9('0x29')],_0xb1b9('0x2a'),_0x3bc66f);fs[_0xb1b9('0x2b')](_0x39993d,_0x14f4e4[_0xb1b9('0x19')][_0x19ea1a]['content']);_0x31b067['message'][_0xb1b9('0x19')][_0xb1b9('0x2c')]({'name':_0x3bbabc,'basename':_0x3bc66f,'type':_0x14f4e4[_0xb1b9('0x19')][_0x19ea1a][_0xb1b9('0x2d')],'filepath':_0x39993d});}}}if(_0x14f4e4[_0xb1b9('0x2e')]&&_0x14f4e4[_0xb1b9('0x2e')][_0xb1b9('0x10')]>0x0){var _0x4a8118=[_0xb1b9('0x2f'),_0xb1b9('0x30'),_0xb1b9('0x31')];for(var _0x257e0e=0x0;_0x257e0e<_0x14f4e4['headerLines'][_0xb1b9('0x10')];_0x257e0e++){var _0xe7ad2a=_['indexOf'](_0x4a8118,_0x14f4e4[_0xb1b9('0x2e')][_0x257e0e][_0xb1b9('0x32')]);if(_0xe7ad2a>=0x0){_0x31b067['isAutoreply']=!![];}}}return _0x31b067;}exports[_0xb1b9('0x33')]=function(_0x3d1f39,_0x38516c,_0x4befbe){var _0x4e91fe={'from':getAddress(_0x38516c[_0xb1b9('0x34')]),'firstName':getFirstName(_0x38516c[_0xb1b9('0x34')]),'lastName':getLastName(_0x38516c[_0xb1b9('0x34')]),'mapKey':'email','message':{'from':getMails(_0x3d1f39[_0xb1b9('0x5')],_0x38516c[_0xb1b9('0x34')]),'to':_0x3d1f39[_0xb1b9('0x5')],'cc':'','subject':_0x38516c['subject']||'','messageId':_0x38516c['messageId'],'inReplyTo':_0x38516c[_0xb1b9('0x35')],'sentAt':moment(_0x38516c[_0xb1b9('0x36')])[_0xb1b9('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x38516c['html']&&!_0x38516c['textAsHtml']){var _0x1626e0=_[_0xb1b9('0x37')](_0x38516c[_0xb1b9('0x19')],{'contentType':_0xb1b9('0x38')});if(_0x1626e0[_0xb1b9('0x10')]){logger[_0xb1b9('0x39')](util[_0xb1b9('0x26')](_0xb1b9('0x3a'),_0x38516c[_0xb1b9('0x3b')]));tnef[_0xb1b9('0x3c')](_[_0xb1b9('0x3d')](_0x1626e0)[_0xb1b9('0x3e')],function(_0x418c49,_0x16c76e){if(_0x16c76e){_0x38516c['html']=_0x16c76e[_0xb1b9('0x3f')]||_0xb1b9('0x40');if(_0x16c76e[_0xb1b9('0x41')]){for(var _0x3f712e=0x0;_0x3f712e<_0x16c76e[_0xb1b9('0x41')][_0xb1b9('0x10')];_0x3f712e++){var _0x91a243=_0x16c76e[_0xb1b9('0x41')][_0x3f712e];_0x4e91fe['message'][_0xb1b9('0x19')][_0xb1b9('0x2c')]({'filename':_0x91a243['Title'],'content':Buffer[_0xb1b9('0x34')](_0x91a243[_0xb1b9('0x42')])});}}}_0x4befbe(parseEmail(_0x3d1f39,_0x38516c,_0x4e91fe));});}else{_0x38516c[_0xb1b9('0x15')]=_0xb1b9('0x40');_0x4befbe(parseEmail(_0x3d1f39,_0x38516c,_0x4e91fe));}}else{_0x4befbe(parseEmail(_0x3d1f39,_0x38516c,_0x4e91fe));}};exports[_0xb1b9('0x43')]=function(_0x21aa71){switch(_0x21aa71){case _0xb1b9('0x44'):return'imap.gmail.com';case _0xb1b9('0x45'):return'imap.mail.yahoo.com';case _0xb1b9('0x46'):return _0xb1b9('0x47');case _0xb1b9('0x48'):return'outlook.office365.com';}return _0xb1b9('0x49');};
\ No newline at end of file
index 67a1516..8c1110c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa763=['name','key','SERV','active','Imap','exports'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xa763,0x13e));var _0x3a76=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0xa763[_0x355ce8];return _0x1db8b8;};'use strict';var _=require('lodash');function MailAccount(_0x1a2629){this['id']=_0x1a2629['id']||0x0;this[_0x3a76('0x0')]=_0x1a2629[_0x3a76('0x0')]||'Service';this[_0x3a76('0x1')]=_0x1a2629[_0x3a76('0x1')]||_0x3a76('0x2');this[_0x3a76('0x3')]=_0x1a2629[_0x3a76('0x3')]||![];this['Imap']=_0x1a2629[_0x3a76('0x4')]||[];this['Smtp']=_0x1a2629['Smtp']||[];}module[_0x3a76('0x5')]=MailAccount;
\ No newline at end of file
+var _0x5336=['Smtp','exports','lodash','name','Service','key','active','Imap'];(function(_0x14f2fa,_0x2004bd){var _0x2b3e45=function(_0x59dd0e){while(--_0x59dd0e){_0x14f2fa['push'](_0x14f2fa['shift']());}};_0x2b3e45(++_0x2004bd);}(_0x5336,0x6a));var _0x6533=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x5336[_0x45b034];return _0x509cb0;};'use strict';var _=require(_0x6533('0x0'));function MailAccount(_0x2a89fb){this['id']=_0x2a89fb['id']||0x0;this[_0x6533('0x1')]=_0x2a89fb[_0x6533('0x1')]||_0x6533('0x2');this[_0x6533('0x3')]=_0x2a89fb[_0x6533('0x3')]||'SERV';this[_0x6533('0x4')]=_0x2a89fb[_0x6533('0x4')]||![];this[_0x6533('0x5')]=_0x2a89fb[_0x6533('0x5')]||[];this[_0x6533('0x6')]=_0x2a89fb['Smtp']||[];}module[_0x6533('0x7')]=MailAccount;
\ No newline at end of file
index 778cc40..238fd82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec37=['../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','exports','lodash'];(function(_0x5934fe,_0x5d30eb){var _0x9c4e47=function(_0x52d9c3){while(--_0x52d9c3){_0x5934fe['push'](_0x5934fe['shift']());}};_0x9c4e47(++_0x5d30eb);}(_0xec37,0x11f));var _0x7ec3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xec37[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7ec3('0x0'));var MailAccount=require(_0x7ec3('0x1'));var Realtime=function(){this[_0x7ec3('0x2')]={};};function freeIsNotKey(_0x4b7f3c,_0x19a9e2,_0x39f835){var _0x54e1f3=_[_0x7ec3('0x3')](_0x4b7f3c,function(_0x907b0,_0x39c774){return _0x907b0[_0x39f835];});for(var _0x603433 in _0x19a9e2){if(_0x19a9e2[_0x7ec3('0x4')](_0x603433)){if(!_0x54e1f3[_0x603433]){delete _0x19a9e2[_0x603433];}}}}Realtime[_0x7ec3('0x5')]['mergeFromDatabase']=function(_0x434fda,_0x5e1a3f){for(var _0x1c7ff3 in _0x5e1a3f){if(_0x434fda[_0x7ec3('0x4')](_0x1c7ff3)){_0x434fda[_0x1c7ff3]=_0x5e1a3f[_0x1c7ff3];}}};Realtime[_0x7ec3('0x5')][_0x7ec3('0x6')]=function(){var _0x1f719e=this;return function(_0x5ca5b4){if(_0x5ca5b4){freeIsNotKey(_0x5ca5b4,_0x1f719e['mailAccounts'],'id');for(var _0x59e260=0x0,_0x577131={},_0x416488={};_0x59e260<_0x5ca5b4['length'];_0x59e260+=0x1){_0x577131=_0x5ca5b4[_0x59e260];if(_['isUndefined'](_0x1f719e['mailAccounts'][_0x577131['id']])){_0x1f719e[_0x7ec3('0x2')][_0x577131['id']]=new MailAccount(_0x577131);}else{_['merge'](_0x1f719e[_0x7ec3('0x2')][_0x577131['id']],_0x577131);}}}return _0x1f719e[_0x7ec3('0x2')];};};module[_0x7ec3('0x7')]=Realtime;
\ No newline at end of file
+var _0x7f63=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','lodash','../model/mailAccount','mailAccounts'];(function(_0x597d94,_0x5cd090){var _0x67418e=function(_0x186d07){while(--_0x186d07){_0x597d94['push'](_0x597d94['shift']());}};_0x67418e(++_0x5cd090);}(_0x7f63,0x1aa));var _0x37f6=function(_0x4ca731,_0x3d9665){_0x4ca731=_0x4ca731-0x0;var _0x1fd0a1=_0x7f63[_0x4ca731];return _0x1fd0a1;};'use strict';var _=require(_0x37f6('0x0'));var MailAccount=require(_0x37f6('0x1'));var Realtime=function(){this[_0x37f6('0x2')]={};};function freeIsNotKey(_0x3a352b,_0x3749d9,_0x1609b1){var _0x5bf6fa=_[_0x37f6('0x3')](_0x3a352b,function(_0x46bd8e,_0x46faa8){return _0x46bd8e[_0x1609b1];});for(var _0x1a3dc3 in _0x3749d9){if(_0x3749d9[_0x37f6('0x4')](_0x1a3dc3)){if(!_0x5bf6fa[_0x1a3dc3]){delete _0x3749d9[_0x1a3dc3];}}}}Realtime[_0x37f6('0x5')][_0x37f6('0x6')]=function(_0x58e063,_0x4b9186){for(var _0x351fd1 in _0x4b9186){if(_0x58e063['hasOwnProperty'](_0x351fd1)){_0x58e063[_0x351fd1]=_0x4b9186[_0x351fd1];}}};Realtime['prototype'][_0x37f6('0x7')]=function(){var _0xdc358b=this;return function(_0x33e68b){if(_0x33e68b){freeIsNotKey(_0x33e68b,_0xdc358b[_0x37f6('0x2')],'id');for(var _0x1b6cd0=0x0,_0x5d390e={},_0x4a7a6a={};_0x1b6cd0<_0x33e68b[_0x37f6('0x8')];_0x1b6cd0+=0x1){_0x5d390e=_0x33e68b[_0x1b6cd0];if(_[_0x37f6('0x9')](_0xdc358b[_0x37f6('0x2')][_0x5d390e['id']])){_0xdc358b[_0x37f6('0x2')][_0x5d390e['id']]=new MailAccount(_0x5d390e);}else{_[_0x37f6('0xa')](_0xdc358b['mailAccounts'][_0x5d390e['id']],_0x5d390e);}}}return _0xdc358b[_0x37f6('0x2')];};};module['exports']=Realtime;
\ No newline at end of file
index 54582e6..d2b14c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e1d=['NotifyMailAccount','../client','GetMailAccount','name','service','email','active','key','TemplateId','MailServerIn','Imap','Smtp','getMailAccount','notify','Request'];(function(_0x4c6d4b,_0x51409b){var _0x53b282=function(_0xdea3e5){while(--_0xdea3e5){_0x4c6d4b['push'](_0x4c6d4b['shift']());}};_0x53b282(++_0x51409b);}(_0x7e1d,0x15a));var _0xd7e1=function(_0x3ea311,_0x568c4b){_0x3ea311=_0x3ea311-0x0;var _0x362de6=_0x7e1d[_0x3ea311];return _0x362de6;};'use strict';var client=require(_0xd7e1('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xd7e1('0x1'),{'options':{'attributes':['id',_0xd7e1('0x2'),_0xd7e1('0x3'),_0xd7e1('0x4'),_0xd7e1('0x5'),_0xd7e1('0x6'),'ListId',_0xd7e1('0x7')],'raw':![],'include':[{'model':_0xd7e1('0x8'),'as':_0xd7e1('0x9')},{'model':'MailServerOut','as':_0xd7e1('0xa')}]},'log':_0xd7e1('0xb')});};};exports[_0xd7e1('0xc')]=function(_0x3bcb45,_0x158be6){return client[_0xd7e1('0xd')](_0xd7e1('0xe'),{'account':{'id':_0x3bcb45},'body':_0x158be6,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0xac73=['../client','getMailAccounts','Request','GetMailAccount','name','active','key','ListId','TemplateId','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount'];(function(_0x5d02c6,_0x1bfdbc){var _0x22cc4e=function(_0xf68f41){while(--_0xf68f41){_0x5d02c6['push'](_0x5d02c6['shift']());}};_0x22cc4e(++_0x1bfdbc);}(_0xac73,0x186));var _0x3ac7=function(_0x30b8a3,_0x2b7e6e){_0x30b8a3=_0x30b8a3-0x0;var _0x29d437=_0xac73[_0x30b8a3];return _0x29d437;};'use strict';var client=require(_0x3ac7('0x0'));exports[_0x3ac7('0x1')]=function(){return function(){return client[_0x3ac7('0x2')](_0x3ac7('0x3'),{'options':{'attributes':['id',_0x3ac7('0x4'),'service','email',_0x3ac7('0x5'),_0x3ac7('0x6'),_0x3ac7('0x7'),_0x3ac7('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x3ac7('0x9')},{'model':_0x3ac7('0xa'),'as':_0x3ac7('0xb')}]},'log':_0x3ac7('0xc')});};};exports[_0x3ac7('0xd')]=function(_0x4ee9b7,_0x43b616){return client[_0x3ac7('0x2')](_0x3ac7('0xe'),{'account':{'id':_0x4ee9b7},'body':_0x43b616,'log':'NotifyMailAccount'});};
\ No newline at end of file
index 43dd9a9..caafa81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eb6=['getSettings','Request','loginMailFrequency','GetSettings','../client'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x6eb6,0x1a3));var _0x66eb=function(_0x5e2b39,_0x400342){_0x5e2b39=_0x5e2b39-0x0;var _0x2a44a8=_0x6eb6[_0x5e2b39];return _0x2a44a8;};'use strict';var client=require(_0x66eb('0x0'));exports[_0x66eb('0x1')]=function(){return client[_0x66eb('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x66eb('0x3')]},'log':_0x66eb('0x4')});};
\ No newline at end of file
+var _0xc622=['getSettings','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x234eb6,_0x44606e){var _0x483068=function(_0x8bb1b){while(--_0x8bb1b){_0x234eb6['push'](_0x234eb6['shift']());}};_0x483068(++_0x44606e);}(_0xc622,0x128));var _0x2c62=function(_0x2c492c,_0x50e279){_0x2c492c=_0x2c492c-0x0;var _0x51c7f6=_0xc622[_0x2c492c];return _0x51c7f6;};'use strict';var client=require('../client');exports[_0x2c62('0x0')]=function(){return client['Request'](_0x2c62('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2c62('0x2')]},'log':_0x2c62('0x3')});};
\ No newline at end of file
index 68ccb31..303176e 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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 253cc4a..50e1e3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ac2=['default','../../config/socketio','../../config/express','../../routes','once','listening','log','exports','lodash','express','sticky-session','ioredis','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers'];(function(_0x4a912c,_0x2027a2){var _0x29ffed=function(_0x3fa90d){while(--_0x3fa90d){_0x4a912c['push'](_0x4a912c['shift']());}};_0x29ffed(++_0x2027a2);}(_0x0ac2,0x68));var _0x20ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0ac2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x20ac('0x0'));var http=require('http');var express=require(_0x20ac('0x1'));var sticky=require(_0x20ac('0x2'));var Redis=require(_0x20ac('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x20ac('0x4')](app);server[_0x20ac('0x5')]=0xdbba0;if(sticky[_0x20ac('0x6')](server,config[_0x20ac('0x7')])){var socketio=require(_0x20ac('0x8'))(server,{'transports':[_0x20ac('0x9'),_0x20ac('0xa')]});config[_0x20ac('0xb')]=_[_0x20ac('0xc')](config[_0x20ac('0xb')],{'host':_0x20ac('0xd'),'port':0x18eb});socketio['adapter'](require(_0x20ac('0xe'))({'pubClient':new Redis(config[_0x20ac('0xb')]),'subClient':new Redis(config[_0x20ac('0xb')])}));require(_0x20ac('0xf'))[_0x20ac('0x10')]();require(_0x20ac('0x11'))[_0x20ac('0x10')](socketio);require(_0x20ac('0x12'))['default'](app);require(_0x20ac('0x13'))[_0x20ac('0x10')](app);}else{server[_0x20ac('0x14')](_0x20ac('0x15'),function(){console[_0x20ac('0x16')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x20ac('0x7')]);});}exports=module[_0x20ac('0x17')]=app;
\ No newline at end of file
+var _0x1327=['listen','port','socket.io','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/express','../../routes','log','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout'];(function(_0x4fe93e,_0x44f9e2){var _0x5f1d5a=function(_0x2c5bc3){while(--_0x2c5bc3){_0x4fe93e['push'](_0x4fe93e['shift']());}};_0x5f1d5a(++_0x44f9e2);}(_0x1327,0x92));var _0x7132=function(_0x5ea6c0,_0x2c6a29){_0x5ea6c0=_0x5ea6c0-0x0;var _0x811be=_0x1327[_0x5ea6c0];return _0x811be;};'use strict';var _=require(_0x7132('0x0'));var http=require(_0x7132('0x1'));var express=require(_0x7132('0x2'));var sticky=require(_0x7132('0x3'));var Redis=require(_0x7132('0x4'));var config=require(_0x7132('0x5'));var app=express();var server=http[_0x7132('0x6')](app);server[_0x7132('0x7')]=0xdbba0;if(sticky[_0x7132('0x8')](server,config[_0x7132('0x9')])){var socketio=require(_0x7132('0xa'))(server,{'transports':['websocket',_0x7132('0xb')]});config[_0x7132('0xc')]=_[_0x7132('0xd')](config[_0x7132('0xc')],{'host':_0x7132('0xe'),'port':0x18eb});socketio[_0x7132('0xf')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x7132('0x10'))[_0x7132('0x11')]();require('../../config/socketio')['default'](socketio);require(_0x7132('0x12'))[_0x7132('0x11')](app);require(_0x7132('0x13'))[_0x7132('0x11')](app);}else{server['once']('listening',function(){console[_0x7132('0x14')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x7132('0x9')]);});}exports=module[_0x7132('0x15')]=app;
\ No newline at end of file
index c6e1a53..3944ca9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef2d=['error','message','result','exports','jayson/promise','../../config/logger','routing','client','http','request','then','debug','rpc'];(function(_0x1aef65,_0x521e60){var _0x4a4594=function(_0x120020){while(--_0x120020){_0x1aef65['push'](_0x1aef65['shift']());}};_0x4a4594(++_0x521e60);}(_0xef2d,0x93));var _0xdef2=function(_0x4851ac,_0x1a82ff){_0x4851ac=_0x4851ac-0x0;var _0xfe00b6=_0xef2d[_0x4851ac];return _0xfe00b6;};'use strict';var jayson=require(_0xdef2('0x0'));var BPromise=require('bluebird');var logger=require(_0xdef2('0x1'))(_0xdef2('0x2'));var client=jayson[_0xdef2('0x3')][_0xdef2('0x4')]({'port':0x2329});client['Request']=function(_0x20b4dc,_0x3221b1){return new BPromise(function(_0x43f047,_0x3d67c5){return client[_0xdef2('0x5')](_0x20b4dc,_0x3221b1)[_0xdef2('0x6')](function(_0x4e6d75){logger[_0xdef2('0x7')](_0xdef2('0x8'),'routing',_0x20b4dc,_0x3221b1,_0x4e6d75);if(_0x4e6d75['error']){logger[_0xdef2('0x9')](_0xdef2('0x8'),_0xdef2('0x2'),_0x20b4dc,_0x4e6d75[_0xdef2('0x9')][_0xdef2('0xa')],_0x3221b1);return _0x3d67c5(_0x4e6d75['error'][_0xdef2('0xa')]);}else{return _0x43f047(_0x4e6d75[_0xdef2('0xb')]);}})['catch'](function(_0x5d9183){logger['error'](_0xdef2('0x8'),_0xdef2('0x2'),_0x20b4dc,_0x5d9183,_0x3221b1);return _0x3d67c5(_0x5d9183);});});};module[_0xdef2('0xc')]=client;
\ No newline at end of file
+var _0xcd8b=['routing','client','http','Request','request','then','debug','error','message','result','catch','rpc','../../config/logger'];(function(_0x3fbf32,_0x2cb594){var _0x473f08=function(_0x5ac92d){while(--_0x5ac92d){_0x3fbf32['push'](_0x3fbf32['shift']());}};_0x473f08(++_0x2cb594);}(_0xcd8b,0x8e));var _0xbcd8=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xcd8b[_0x4b7895];return _0x264180;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xbcd8('0x0'))(_0xbcd8('0x1'));var client=jayson[_0xbcd8('0x2')][_0xbcd8('0x3')]({'port':0x2329});client[_0xbcd8('0x4')]=function(_0x4652b1,_0x52fb4a){return new BPromise(function(_0xbf4f08,_0x26e0c4){return client[_0xbcd8('0x5')](_0x4652b1,_0x52fb4a)[_0xbcd8('0x6')](function(_0x1fa767){logger[_0xbcd8('0x7')]('rpc','routing',_0x4652b1,_0x52fb4a,_0x1fa767);if(_0x1fa767[_0xbcd8('0x8')]){logger['error']('rpc','routing',_0x4652b1,_0x1fa767['error'][_0xbcd8('0x9')],_0x52fb4a);return _0x26e0c4(_0x1fa767[_0xbcd8('0x8')][_0xbcd8('0x9')]);}else{return _0xbf4f08(_0x1fa767[_0xbcd8('0xa')]);}})[_0xbcd8('0xb')](function(_0x570c4c){logger[_0xbcd8('0x8')](_0xbcd8('0xc'),'routing',_0x4652b1,_0x570c4c,_0x52fb4a);return _0x26e0c4(_0x570c4c);});});};module['exports']=client;
\ No newline at end of file
index f007ca0..df9d37a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2773=['initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getMailQueues'];(function(_0x4b00e9,_0x4248f8){var _0xbdc8d3=function(_0x4312d5){while(--_0x4312d5){_0x4b00e9['push'](_0x4b00e9['shift']());}};_0xbdc8d3(++_0x4248f8);}(_0x2773,0x1a6));var _0x3277=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2773[_0x4a9fb1];return _0x348672;};'use strict';var BPromise=require('bluebird');var server=require(_0x3277('0x0'));var Realtime=require(_0x3277('0x1'));var user=require(_0x3277('0x2'));var interval=require(_0x3277('0x3'));var openchannelQueue=require(_0x3277('0x4'));var chatQueue=require(_0x3277('0x5'));var smsQueue=require(_0x3277('0x6'));var mailQueue=require(_0x3277('0x7'));var faxQueue=require(_0x3277('0x8'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x3277('0x9')]()[_0x3277('0xa')](user[_0x3277('0xb')]())[_0x3277('0xa')](realtime[_0x3277('0xc')]())[_0x3277('0xa')](interval[_0x3277('0xd')]())[_0x3277('0xa')](realtime[_0x3277('0xe')]())[_0x3277('0xa')](openchannelQueue[_0x3277('0xf')]())[_0x3277('0xa')](realtime[_0x3277('0x10')]())[_0x3277('0xa')](chatQueue[_0x3277('0x11')]())['then'](realtime[_0x3277('0x12')]())[_0x3277('0xa')](smsQueue['getSmsQueues']())[_0x3277('0xa')](realtime['initSmsQueues']())[_0x3277('0xa')](mailQueue[_0x3277('0x13')]())[_0x3277('0xa')](realtime[_0x3277('0x14')]())[_0x3277('0xa')](faxQueue['getFaxQueues']())[_0x3277('0xa')](realtime[_0x3277('0x15')]())[_0x3277('0xa')](whatsappQueue[_0x3277('0x16')]())[_0x3277('0xa')](realtime[_0x3277('0x17')]())['then'](function(){return realtime;});}function main(){return server[_0x3277('0x18')](realtime)[_0x3277('0xa')](function(_0x5955bd){return initRealtime();})['then'](function(_0x1efc75){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2435bb){console[_0x3277('0x19')](_0x2435bb);});}main();
\ No newline at end of file
+var _0x8ea3=['./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x8ea3,0x188));var _0x38ea=function(_0x45bf7f,_0x4e5f06){_0x45bf7f=_0x45bf7f-0x0;var _0x2b5458=_0x8ea3[_0x45bf7f];return _0x2b5458;};'use strict';var BPromise=require(_0x38ea('0x0'));var server=require(_0x38ea('0x1'));var Realtime=require(_0x38ea('0x2'));var user=require(_0x38ea('0x3'));var interval=require(_0x38ea('0x4'));var openchannelQueue=require(_0x38ea('0x5'));var chatQueue=require(_0x38ea('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x38ea('0x7'));var whatsappQueue=require(_0x38ea('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x38ea('0x9')]()[_0x38ea('0xa')](user[_0x38ea('0xb')]())[_0x38ea('0xa')](realtime['initAgents']())[_0x38ea('0xa')](interval[_0x38ea('0xc')]())[_0x38ea('0xa')](realtime[_0x38ea('0xd')]())[_0x38ea('0xa')](openchannelQueue[_0x38ea('0xe')]())[_0x38ea('0xa')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x38ea('0xf')]())[_0x38ea('0xa')](realtime[_0x38ea('0x10')]())[_0x38ea('0xa')](smsQueue[_0x38ea('0x11')]())[_0x38ea('0xa')](realtime['initSmsQueues']())[_0x38ea('0xa')](mailQueue[_0x38ea('0x12')]())[_0x38ea('0xa')](realtime[_0x38ea('0x13')]())[_0x38ea('0xa')](faxQueue['getFaxQueues']())[_0x38ea('0xa')](realtime[_0x38ea('0x14')]())[_0x38ea('0xa')](whatsappQueue[_0x38ea('0x15')]())[_0x38ea('0xa')](realtime[_0x38ea('0x16')]())[_0x38ea('0xa')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x3d25d5){return initRealtime();})[_0x38ea('0xa')](function(_0x4694ad){return setInterval(initRealtime,0x1388);})[_0x38ea('0x17')](function(_0x1842b5){console[_0x38ea('0x18')](_0x1842b5);});}main();
\ No newline at end of file
index a6aca39..96aff64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x2e7522,_0x5b1548){var _0x200019=function(_0x4aebdd){while(--_0x4aebdd){_0x2e7522['push'](_0x2e7522['shift']());}};_0x200019(++_0x5b1548);}(_0x814b,0x1a2));var _0xb814=function(_0x1193ea,_0xc04ef0){_0x1193ea=_0x1193ea-0x0;var _0x5e4000=_0x814b[_0x1193ea];return _0x5e4000;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
+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(_0x33a723,_0x4211c8){var _0x325483=function(_0x5c572c){while(--_0x5c572c){_0x33a723['push'](_0x33a723['shift']());}};_0x325483(++_0x4211c8);}(_0x7a54,0x106));var _0x47a5=function(_0x55951a,_0x170146){_0x55951a=_0x55951a-0x0;var _0x392a3f=_0x7a54[_0x55951a];return _0x392a3f;};'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
index 31bc293..01e00de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f93=['SendMail','bluebird','client','http','error','result','sendMailMessage'];(function(_0x80420a,_0x2d7dfa){var _0x59c1e0=function(_0x231115){while(--_0x231115){_0x80420a['push'](_0x80420a['shift']());}};_0x59c1e0(++_0x2d7dfa);}(_0x7f93,0xb0));var _0x37f9=function(_0x3341d5,_0x340ca0){_0x3341d5=_0x3341d5-0x0;var _0x10cc68=_0x7f93[_0x3341d5];return _0x10cc68;};'use strict';var BPromise=require(_0x37f9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x37f9('0x1')][_0x37f9('0x2')]({'port':0x232b});function request(_0x51bbe8,_0xb2f751){return new BPromise(function(_0x24860b,_0x258ea4){return client['request'](_0x51bbe8,_0xb2f751)['then'](function(_0x2c9335){if(_0x2c9335['error']){return _0x258ea4(_0x2c9335[_0x37f9('0x3')]['message']);}else{return _0x24860b(_0x2c9335[_0x37f9('0x4')]);}})['catch'](function(_0x4017a3){return _0x258ea4(_0x4017a3);});});}exports[_0x37f9('0x5')]=function(_0x2afd6d,_0x34094d){return request(_0x37f9('0x6'),{'account':_0x2afd6d,'message':_0x34094d});};
\ No newline at end of file
+var _0x41e7=['result','catch','SendMail','bluebird','jayson/promise','client','request','then','error'];(function(_0x2766f2,_0x4c35f4){var _0x2630ee=function(_0x5e45f9){while(--_0x5e45f9){_0x2766f2['push'](_0x2766f2['shift']());}};_0x2630ee(++_0x4c35f4);}(_0x41e7,0xff));var _0x741e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x41e7[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x741e('0x0'));var jayson=require(_0x741e('0x1'));var client=jayson[_0x741e('0x2')]['http']({'port':0x232b});function request(_0x5117ac,_0x6a6af1){return new BPromise(function(_0x47faca,_0xbeaee0){return client[_0x741e('0x3')](_0x5117ac,_0x6a6af1)[_0x741e('0x4')](function(_0x2928b4){if(_0x2928b4['error']){return _0xbeaee0(_0x2928b4[_0x741e('0x5')]['message']);}else{return _0x47faca(_0x2928b4[_0x741e('0x6')]);}})[_0x741e('0x7')](function(_0x2d0991){return _0xbeaee0(_0x2d0991);});});}exports['sendMailMessage']=function(_0x253749,_0x1a680f){return request(_0x741e('0x8'),{'account':_0x253749,'message':_0x1a680f});};
\ No newline at end of file
index c42e3ae..d648d03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2a=['smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','working','idle','prototype','mail','chat','openchannel','fax','length','Status','mailStatusTime','faxStatusTime','openchannelStatus','stringify','user:save','exports','lodash','md5','ioredis','defaults','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus'];(function(_0x212671,_0x4f2a5d){var _0x2c702b=function(_0x487215){while(--_0x487215){_0x212671['push'](_0x212671['shift']());}};_0x2c702b(++_0x4f2a5d);}(_0x9b2a,0x8a));var _0xa9b2=function(_0xd8e242,_0x3de2e4){_0xd8e242=_0xd8e242-0x0;var _0xfb7f14=_0x9b2a[_0xd8e242];return _0xfb7f14;};'use strict';var _=require(_0xa9b2('0x0'));var moment=require('moment');var md5=require(_0xa9b2('0x1'));var Redis=require(_0xa9b2('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xa9b2('0x3')](config[_0xa9b2('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9b2('0x4')]));function Agent(_0x32965c){this['id']=_0x32965c['id']||0x0;this[_0xa9b2('0x5')]=_0x32965c['name']||'';this[_0xa9b2('0x6')]=_0x32965c['online']||!![];this[_0xa9b2('0x7')]=_0x32965c['voicePause']||![];this['chatPause']=_0x32965c[_0xa9b2('0x8')]||![];this[_0xa9b2('0x9')]=_0x32965c['mailPause']||![];this[_0xa9b2('0xa')]=_0x32965c[_0xa9b2('0xa')]||![];this['smsPause']=_0x32965c[_0xa9b2('0xb')]||![];this['openchannelPause']=_0x32965c[_0xa9b2('0xc')]||![];this['chatStatus']=_0xa9b2('0xd');this[_0xa9b2('0xe')]=0x0;this[_0xa9b2('0xf')]=_0x32965c['chatCapacity']||0x0;this[_0xa9b2('0x10')]=0x0;this[_0xa9b2('0x11')]=_0xa9b2('0xd');this['mailStatusTime']=0x0;this[_0xa9b2('0x12')]=_0x32965c['mailCapacity']||0x0;this[_0xa9b2('0x13')]=0x0;this[_0xa9b2('0x14')]=_0xa9b2('0xd');this['faxStatusTime']=0x0;this['faxCapacity']=_0x32965c[_0xa9b2('0x15')]||0x0;this[_0xa9b2('0x16')]=0x0;this[_0xa9b2('0x17')]=_0xa9b2('0xd');this['smsStatusTime']=0x0;this[_0xa9b2('0x18')]=_0x32965c[_0xa9b2('0x18')]||0x0;this[_0xa9b2('0x19')]=0x0;this[_0xa9b2('0x1a')]='unknown';this[_0xa9b2('0x1b')]=0x0;this[_0xa9b2('0x1c')]=_0x32965c[_0xa9b2('0x1c')]||0x0;this[_0xa9b2('0x1d')]=0x0;this['openchannelStatus']='unknown';this[_0xa9b2('0x1e')]=0x0;this[_0xa9b2('0x1f')]=_0x32965c['openchannelCapacity']||0x0;this[_0xa9b2('0x20')]=0x0;this[_0xa9b2('0x21')]=![];this[_0xa9b2('0x22')]=undefined;this['md5']='';this[_0xa9b2('0x23')]();}Agent['prototype'][_0xa9b2('0x24')]=function(_0x3e42fc){if(this[_0x3e42fc+_0xa9b2('0x25')]>0x0){if(this[_0x3e42fc+_0xa9b2('0x26')]>0x0&&this[_0x3e42fc+'CurrentCapacity']>=this[_0x3e42fc+_0xa9b2('0x26')]){return'maxcapacity';}else{return _0xa9b2('0x27');}}else{return _0xa9b2('0x28');}};Agent[_0xa9b2('0x29')][_0xa9b2('0x23')]=function(){var _0x36bae7=[_0xa9b2('0x2a'),_0xa9b2('0x2b'),_0xa9b2('0x2c'),_0xa9b2('0x2d'),'sms','whatsapp'];for(var _0x322e91=0x0;_0x322e91<_0x36bae7[_0xa9b2('0x2e')];_0x322e91+=0x1){var _0x415ea2=this['getChannelStatus'](_0x36bae7[_0x322e91]);if(this[_0x36bae7[_0x322e91]+_0xa9b2('0x2f')]!==_0x415ea2){this[_0x36bae7[_0x322e91]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x36bae7[_0x322e91]+_0xa9b2('0x2f')]=_0x415ea2;}var _0x13d54f={'id':this['id'],'name':this['name'],'online':this[_0xa9b2('0x6')],'voicePause':this[_0xa9b2('0x7')],'chatPause':this['chatPause'],'mailPause':this[_0xa9b2('0x9')],'smsPause':this[_0xa9b2('0xb')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xa9b2('0xe')],'chatCapacity':this[_0xa9b2('0xf')],'chatCurrentCapacity':this[_0xa9b2('0x10')],'mailStatus':this[_0xa9b2('0x11')],'mailStatusTime':this[_0xa9b2('0x30')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xa9b2('0x13')],'faxStatus':this[_0xa9b2('0x14')],'faxStatusTime':this[_0xa9b2('0x31')],'faxCapacity':this[_0xa9b2('0x15')],'faxCurrentCapacity':this[_0xa9b2('0x16')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xa9b2('0x18')],'smsCurrentCapacity':this[_0xa9b2('0x19')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xa9b2('0x1c')],'whatsappCurrentCapacity':this[_0xa9b2('0x1d')],'openchannelStatus':this[_0xa9b2('0x32')],'openchannelStatusTime':this[_0xa9b2('0x1e')],'openchannelCapacity':this[_0xa9b2('0x1f')],'openchannelCurrentCapacity':this[_0xa9b2('0x20')],'busy':this[_0xa9b2('0x21')],'busyQueue':this['busyQueue']};var _0x212e92=md5(JSON[_0xa9b2('0x33')](_0x13d54f));if(this['md5']!==_0x212e92){this[_0xa9b2('0x1')]=_0x212e92;io['emit'](_0xa9b2('0x34'),_0x13d54f);}};module[_0xa9b2('0x35')]=Agent;
\ No newline at end of file
+var _0xf680=['faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','mail','openchannel','fax','whatsapp','length','Status','toNumber','format','online','whatsappStatus','whatsappStatusTime','busy','stringify','emit','user:save','exports','lodash','moment','md5','ioredis','defaults','redis','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime'];(function(_0x108691,_0x3a3588){var _0xd8a129=function(_0x44ed4e){while(--_0x44ed4e){_0x108691['push'](_0x108691['shift']());}};_0xd8a129(++_0x3a3588);}(_0xf680,0x154));var _0x0f68=function(_0x4b2315,_0x175388){_0x4b2315=_0x4b2315-0x0;var _0x3a24e3=_0xf680[_0x4b2315];return _0x3a24e3;};'use strict';var _=require(_0x0f68('0x0'));var moment=require(_0x0f68('0x1'));var md5=require(_0x0f68('0x2'));var Redis=require(_0x0f68('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x0f68('0x4')](config[_0x0f68('0x5')],{'host':_0x0f68('0x6'),'port':0x18eb});var io=require(_0x0f68('0x7'))(new Redis(config[_0x0f68('0x5')]));function Agent(_0x14f46e){this['id']=_0x14f46e['id']||0x0;this['name']=_0x14f46e[_0x0f68('0x8')]||'';this['online']=_0x14f46e['online']||!![];this[_0x0f68('0x9')]=_0x14f46e[_0x0f68('0x9')]||![];this[_0x0f68('0xa')]=_0x14f46e[_0x0f68('0xa')]||![];this[_0x0f68('0xb')]=_0x14f46e[_0x0f68('0xb')]||![];this[_0x0f68('0xc')]=_0x14f46e['faxPause']||![];this['smsPause']=_0x14f46e[_0x0f68('0xd')]||![];this[_0x0f68('0xe')]=_0x14f46e[_0x0f68('0xe')]||![];this[_0x0f68('0xf')]=_0x0f68('0x10');this[_0x0f68('0x11')]=0x0;this[_0x0f68('0x12')]=_0x14f46e[_0x0f68('0x12')]||0x0;this[_0x0f68('0x13')]=0x0;this[_0x0f68('0x14')]='unknown';this[_0x0f68('0x15')]=0x0;this[_0x0f68('0x16')]=_0x14f46e[_0x0f68('0x16')]||0x0;this[_0x0f68('0x17')]=0x0;this[_0x0f68('0x18')]=_0x0f68('0x10');this[_0x0f68('0x19')]=0x0;this[_0x0f68('0x1a')]=_0x14f46e['faxCapacity']||0x0;this[_0x0f68('0x1b')]=0x0;this['smsStatus']=_0x0f68('0x10');this[_0x0f68('0x1c')]=0x0;this[_0x0f68('0x1d')]=_0x14f46e[_0x0f68('0x1d')]||0x0;this[_0x0f68('0x1e')]=0x0;this['whatsappStatus']=_0x0f68('0x10');this['whatsappStatusTime']=0x0;this[_0x0f68('0x1f')]=_0x14f46e[_0x0f68('0x1f')]||0x0;this[_0x0f68('0x20')]=0x0;this[_0x0f68('0x21')]=_0x0f68('0x10');this[_0x0f68('0x22')]=0x0;this[_0x0f68('0x23')]=_0x14f46e[_0x0f68('0x23')]||0x0;this[_0x0f68('0x24')]=0x0;this['busy']=![];this[_0x0f68('0x25')]=undefined;this[_0x0f68('0x2')]='';this['updateRealtime']();}Agent[_0x0f68('0x26')][_0x0f68('0x27')]=function(_0x485abc){if(this[_0x485abc+_0x0f68('0x28')]>0x0){if(this[_0x485abc+_0x0f68('0x29')]>0x0&&this[_0x485abc+'CurrentCapacity']>=this[_0x485abc+_0x0f68('0x29')]){return _0x0f68('0x2a');}else{return _0x0f68('0x2b');}}else{return'idle';}};Agent[_0x0f68('0x26')][_0x0f68('0x2c')]=function(){var _0x118378=[_0x0f68('0x2d'),'chat',_0x0f68('0x2e'),_0x0f68('0x2f'),'sms',_0x0f68('0x30')];for(var _0x39118f=0x0;_0x39118f<_0x118378[_0x0f68('0x31')];_0x39118f+=0x1){var _0x3d7d30=this[_0x0f68('0x27')](_0x118378[_0x39118f]);if(this[_0x118378[_0x39118f]+_0x0f68('0x32')]!==_0x3d7d30){this[_0x118378[_0x39118f]+'StatusTime']=_[_0x0f68('0x33')](moment()[_0x0f68('0x34')]('x'));}this[_0x118378[_0x39118f]+_0x0f68('0x32')]=_0x3d7d30;}var _0x51a982={'id':this['id'],'name':this[_0x0f68('0x8')],'online':this[_0x0f68('0x35')],'voicePause':this['voicePause'],'chatPause':this[_0x0f68('0xa')],'mailPause':this[_0x0f68('0xb')],'smsPause':this[_0x0f68('0xd')],'faxPause':this[_0x0f68('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x0f68('0x11')],'chatCapacity':this[_0x0f68('0x12')],'chatCurrentCapacity':this[_0x0f68('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x0f68('0x15')],'mailCapacity':this[_0x0f68('0x16')],'mailCurrentCapacity':this[_0x0f68('0x17')],'faxStatus':this[_0x0f68('0x18')],'faxStatusTime':this[_0x0f68('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x0f68('0x1b')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x0f68('0x1d')],'smsCurrentCapacity':this[_0x0f68('0x1e')],'whatsappStatus':this[_0x0f68('0x36')],'whatsappStatusTime':this[_0x0f68('0x37')],'whatsappCapacity':this[_0x0f68('0x1f')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x0f68('0x21')],'openchannelStatusTime':this[_0x0f68('0x22')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x0f68('0x24')],'busy':this[_0x0f68('0x38')],'busyQueue':this[_0x0f68('0x25')]};var _0x11714c=md5(JSON[_0x0f68('0x39')](_0x51a982));if(this[_0x0f68('0x2')]!==_0x11714c){this['md5']=_0x11714c;io[_0x0f68('0x3a')](_0x0f68('0x3b'),_0x51a982);}};module[_0x0f68('0x3c')]=Agent;
\ No newline at end of file
index bd4b7b7..2067e21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd28=['md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','length','loggedIn','chatPause','available','name','waiting','stringify','format','chat_queue:save','lodash'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xdd28,0x187));var _0x8dd2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8dd2('0x0'));var md5=require(_0x8dd2('0x1'));var util=require(_0x8dd2('0x2'));var Redis=require(_0x8dd2('0x3'));var config=require('../../../config/environment');config[_0x8dd2('0x4')]=_[_0x8dd2('0x5')](config['redis'],{'host':_0x8dd2('0x6'),'port':0x18eb});var io=require(_0x8dd2('0x7'))(new Redis(config[_0x8dd2('0x4')]));function ChatQueue(_0x42cc28){this['id']=_0x42cc28['id']||0x0;this['name']=_0x42cc28['name']||'';this[_0x8dd2('0x8')]=_0x42cc28['timeout']||0xa;this[_0x8dd2('0x9')]=_0x42cc28[_0x8dd2('0x9')]||_0x8dd2('0xa');this[_0x8dd2('0xb')]=_0x42cc28[_0x8dd2('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8dd2('0x1')]='';this[_0x8dd2('0xc')]();this[_0x8dd2('0xd')]();}ChatQueue[_0x8dd2('0xe')][_0x8dd2('0xc')]=function(){var _0x584c11=this[_0x8dd2('0xf')]['_rr'];this[_0x8dd2('0xf')]=_[_0x8dd2('0x10')](this['Agents'],'id');this[_0x8dd2('0xf')][_0x8dd2('0x11')]=_0x584c11;};ChatQueue[_0x8dd2('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x8dd2('0x12')]=0x0;for(var _0x3e7931=0x0;_0x3e7931<this[_0x8dd2('0xb')][_0x8dd2('0x13')];_0x3e7931+=0x1){if(this['Agents'][_0x3e7931]['online']){this[_0x8dd2('0x14')]+=0x1;}if(this[_0x8dd2('0xb')][_0x3e7931][_0x8dd2('0x15')]){this[_0x8dd2('0x12')]+=0x1;}}this[_0x8dd2('0x16')]=this[_0x8dd2('0x14')]-this['paused'];this['available']=this['available']>=0x0?this[_0x8dd2('0x16')]:0x0;var _0x4a9f17={'id':this['id'],'available':this[_0x8dd2('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x8dd2('0x17')],'paused':this['paused'],'waiting':this[_0x8dd2('0x18')]};var _0x2f8b38=md5(JSON[_0x8dd2('0x19')](_0x4a9f17));if(this[_0x8dd2('0x1')]!==_0x2f8b38){this[_0x8dd2('0x1')]=_0x2f8b38;io['to'](util[_0x8dd2('0x1a')]('chat:queue:%s',_0x4a9f17[_0x8dd2('0x17')]))['emit'](_0x8dd2('0x1b'),_0x4a9f17);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0x4c29=['prototype','map','_rr','paused','length','online','chatPause','available','loggedIn','waiting','stringify','format','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c29,0x178));var _0x94c2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x4c29[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x94c2('0x0'));var md5=require(_0x94c2('0x1'));var util=require(_0x94c2('0x2'));var Redis=require(_0x94c2('0x3'));var config=require(_0x94c2('0x4'));config[_0x94c2('0x5')]=_[_0x94c2('0x6')](config[_0x94c2('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x94c2('0x7'))(new Redis(config[_0x94c2('0x5')]));function ChatQueue(_0x4d1a11){this['id']=_0x4d1a11['id']||0x0;this[_0x94c2('0x8')]=_0x4d1a11[_0x94c2('0x8')]||'';this['timeout']=_0x4d1a11[_0x94c2('0x9')]||0xa;this[_0x94c2('0xa')]=_0x4d1a11[_0x94c2('0xa')]||_0x94c2('0xb');this[_0x94c2('0xc')]=_0x4d1a11[_0x94c2('0xc')];this[_0x94c2('0xd')]={};this['waiting']=0x0;this[_0x94c2('0x1')]='';this[_0x94c2('0xe')]();this[_0x94c2('0xf')]();}ChatQueue[_0x94c2('0x10')]['updateRouting']=function(){var _0x233442=this[_0x94c2('0xd')]['_rr'];this[_0x94c2('0xd')]=_[_0x94c2('0x11')](this[_0x94c2('0xc')],'id');this[_0x94c2('0xd')][_0x94c2('0x12')]=_0x233442;};ChatQueue[_0x94c2('0x10')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x94c2('0x13')]=0x0;for(var _0x42658a=0x0;_0x42658a<this[_0x94c2('0xc')][_0x94c2('0x14')];_0x42658a+=0x1){if(this[_0x94c2('0xc')][_0x42658a][_0x94c2('0x15')]){this['loggedIn']+=0x1;}if(this[_0x94c2('0xc')][_0x42658a][_0x94c2('0x16')]){this[_0x94c2('0x13')]+=0x1;}}this[_0x94c2('0x17')]=this[_0x94c2('0x18')]-this[_0x94c2('0x13')];this[_0x94c2('0x17')]=this['available']>=0x0?this[_0x94c2('0x17')]:0x0;var _0x170129={'id':this['id'],'available':this[_0x94c2('0x17')],'loggedIn':this[_0x94c2('0x18')],'name':this[_0x94c2('0x8')],'paused':this['paused'],'waiting':this[_0x94c2('0x19')]};var _0x7604a0=md5(JSON[_0x94c2('0x1a')](_0x170129));if(this[_0x94c2('0x1')]!==_0x7604a0){this['md5']=_0x7604a0;io['to'](util[_0x94c2('0x1b')]('chat:queue:%s',_0x170129['name']))['emit']('chat_queue:save',_0x170129);}};module['exports']=ChatQueue;
\ No newline at end of file
index dcc7567..0a4c9ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c60=['beepall','Agents','mapAgentsId','md5','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','length','online','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','fax_queue:save','exports','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x386e6d,_0x4e74aa){var _0x53b0eb=function(_0x2a5044){while(--_0x2a5044){_0x386e6d['push'](_0x386e6d['shift']());}};_0x53b0eb(++_0x4e74aa);}(_0x7c60,0x15f));var _0x07c6=function(_0x578f5b,_0x40c3c3){_0x578f5b=_0x578f5b-0x0;var _0x161dce=_0x7c60[_0x578f5b];return _0x161dce;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x07c6('0x0'));var Redis=require('ioredis');var config=require(_0x07c6('0x1'));config[_0x07c6('0x2')]=_[_0x07c6('0x3')](config[_0x07c6('0x2')],{'host':_0x07c6('0x4'),'port':0x18eb});var io=require(_0x07c6('0x5'))(new Redis(config[_0x07c6('0x2')]));function FaxQueue(_0x25af0f){this['id']=_0x25af0f['id']||0x0;this[_0x07c6('0x6')]=_0x25af0f['name']||'';this[_0x07c6('0x7')]=_0x25af0f[_0x07c6('0x7')]||0xa;this[_0x07c6('0x8')]=_0x25af0f[_0x07c6('0x8')]||_0x07c6('0x9');this[_0x07c6('0xa')]=_0x25af0f['Agents'];this[_0x07c6('0xb')]={};this['waiting']=0x0;this[_0x07c6('0xc')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0x07c6('0xd')][_0x07c6('0xe')]=function(){var _0x75fe6c=this['mapAgentsId'][_0x07c6('0xf')];this[_0x07c6('0xb')]=_[_0x07c6('0x10')](this[_0x07c6('0xa')],'id');this[_0x07c6('0xb')][_0x07c6('0xf')]=_0x75fe6c;};FaxQueue['prototype'][_0x07c6('0x11')]=function(){this[_0x07c6('0x12')]=0x0;this['paused']=0x0;for(var _0x45a14c=0x0;_0x45a14c<this[_0x07c6('0xa')][_0x07c6('0x13')];_0x45a14c+=0x1){if(this[_0x07c6('0xa')][_0x45a14c][_0x07c6('0x14')]){this[_0x07c6('0x12')]+=0x1;}if(this[_0x07c6('0xa')][_0x45a14c][_0x07c6('0x15')]){this[_0x07c6('0x16')]+=0x1;}}this['available']=this[_0x07c6('0x12')]-this[_0x07c6('0x16')];this['available']=this[_0x07c6('0x17')]>=0x0?this['available']:0x0;var _0x22b349={'id':this['id'],'available':this[_0x07c6('0x17')],'loggedIn':this[_0x07c6('0x12')],'name':this[_0x07c6('0x6')],'paused':this['paused'],'waiting':this[_0x07c6('0x18')]};var _0x5f3786=md5(JSON[_0x07c6('0x19')](_0x22b349));if(this[_0x07c6('0xc')]!==_0x5f3786){this[_0x07c6('0xc')]=_0x5f3786;io['to'](util[_0x07c6('0x1a')](_0x07c6('0x1b'),_0x22b349[_0x07c6('0x6')]))['emit'](_0x07c6('0x1c'),_0x22b349);}};module[_0x07c6('0x1d')]=FaxQueue;
\ No newline at end of file
+var _0xeadb=['exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','strategy','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','_rr','length','loggedIn','faxPause','paused','available','emit','fax_queue:save'];(function(_0x35717d,_0x1fad98){var _0xafb902=function(_0x1339c0){while(--_0x1339c0){_0x35717d['push'](_0x35717d['shift']());}};_0xafb902(++_0x1fad98);}(_0xeadb,0xb0));var _0xbead=function(_0x488b31,_0xea31c3){_0x488b31=_0x488b31-0x0;var _0x424bf1=_0xeadb[_0x488b31];return _0x424bf1;};'use strict';var _=require(_0xbead('0x0'));var md5=require(_0xbead('0x1'));var util=require(_0xbead('0x2'));var Redis=require(_0xbead('0x3'));var config=require(_0xbead('0x4'));config['redis']=_[_0xbead('0x5')](config[_0xbead('0x6')],{'host':_0xbead('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbead('0x6')]));function FaxQueue(_0x463dd5){this['id']=_0x463dd5['id']||0x0;this[_0xbead('0x8')]=_0x463dd5[_0xbead('0x8')]||'';this['timeout']=_0x463dd5['timeout']||0xa;this[_0xbead('0x9')]=_0x463dd5[_0xbead('0x9')]||_0xbead('0xa');this[_0xbead('0xb')]=_0x463dd5[_0xbead('0xb')];this['mapAgentsId']={};this[_0xbead('0xc')]=0x0;this[_0xbead('0x1')]='';this['updateRouting']();this[_0xbead('0xd')]();}FaxQueue[_0xbead('0xe')]['updateRouting']=function(){var _0x524225=this[_0xbead('0xf')]['_rr'];this['mapAgentsId']=_['map'](this[_0xbead('0xb')],'id');this[_0xbead('0xf')][_0xbead('0x10')]=_0x524225;};FaxQueue[_0xbead('0xe')][_0xbead('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x535c0b=0x0;_0x535c0b<this[_0xbead('0xb')][_0xbead('0x11')];_0x535c0b+=0x1){if(this[_0xbead('0xb')][_0x535c0b]['online']){this[_0xbead('0x12')]+=0x1;}if(this[_0xbead('0xb')][_0x535c0b][_0xbead('0x13')]){this[_0xbead('0x14')]+=0x1;}}this[_0xbead('0x15')]=this[_0xbead('0x12')]-this[_0xbead('0x14')];this[_0xbead('0x15')]=this[_0xbead('0x15')]>=0x0?this['available']:0x0;var _0x39f572={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbead('0x12')],'name':this['name'],'paused':this[_0xbead('0x14')],'waiting':this[_0xbead('0xc')]};var _0x43eadc=md5(JSON['stringify'](_0x39f572));if(this['md5']!==_0x43eadc){this[_0xbead('0x1')]=_0x43eadc;io['to'](util['format']('fax:queue:%s',_0x39f572['name']))[_0xbead('0x16')](_0xbead('0x17'),_0x39f572);}};module[_0xbead('0x18')]=FaxQueue;
\ No newline at end of file
index 4b25cf6..e781627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x030c=['exports','name','Intervals'];(function(_0x538271,_0x215b3a){var _0xbdf575=function(_0x5073f4){while(--_0x5073f4){_0x538271['push'](_0x538271['shift']());}};_0xbdf575(++_0x215b3a);}(_0x030c,0x151));var _0xc030=function(_0x27ff08,_0x411e8a){_0x27ff08=_0x27ff08-0x0;var _0x49b799=_0x030c[_0x27ff08];return _0x49b799;};'use strict';function Interval(_0x589749){this['id']=_0x589749['id']||0x0;this[_0xc030('0x0')]=_0x589749[_0xc030('0x0')]||'';this[_0xc030('0x1')]=_0x589749[_0xc030('0x1')]||{};}module[_0xc030('0x2')]=Interval;
\ No newline at end of file
+var _0xaca4=['name'];(function(_0x300bbe,_0x3e3634){var _0x3f6a22=function(_0x3bd419){while(--_0x3bd419){_0x300bbe['push'](_0x300bbe['shift']());}};_0x3f6a22(++_0x3e3634);}(_0xaca4,0x65));var _0x4aca=function(_0x428dbd,_0x30eeb5){_0x428dbd=_0x428dbd-0x0;var _0xc411d8=_0xaca4[_0x428dbd];return _0xc411d8;};'use strict';function Interval(_0x1a4eef){this['id']=_0x1a4eef['id']||0x0;this[_0x4aca('0x0')]=_0x1a4eef['name']||'';this['Intervals']=_0x1a4eef['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
index e7631a9..1227eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb443=['mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','online','mailPause','paused','available','stringify','mail:queue:%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb443,0x110));var _0x3b44=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xb443[_0x616290];return _0x453879;};'use strict';var _=require('lodash');var md5=require(_0x3b44('0x0'));var util=require(_0x3b44('0x1'));var Redis=require(_0x3b44('0x2'));var config=require(_0x3b44('0x3'));config[_0x3b44('0x4')]=_['defaults'](config[_0x3b44('0x4')],{'host':_0x3b44('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b44('0x4')]));function MailQueue(_0x13f19b){this['id']=_0x13f19b['id']||0x0;this[_0x3b44('0x6')]=_0x13f19b[_0x3b44('0x6')]||'';this[_0x3b44('0x7')]=_0x13f19b[_0x3b44('0x7')]||0xa;this[_0x3b44('0x8')]=_0x13f19b[_0x3b44('0x8')]||_0x3b44('0x9');this[_0x3b44('0xa')]=_0x13f19b[_0x3b44('0xa')];this[_0x3b44('0xb')]={};this['waiting']=0x0;this[_0x3b44('0x0')]='';this[_0x3b44('0xc')]();this[_0x3b44('0xd')]();}MailQueue['prototype'][_0x3b44('0xc')]=function(){var _0x20b825=this[_0x3b44('0xb')][_0x3b44('0xe')];this[_0x3b44('0xb')]=_[_0x3b44('0xf')](this[_0x3b44('0xa')],'id');this['mapAgentsId'][_0x3b44('0xe')]=_0x20b825;};MailQueue[_0x3b44('0x10')][_0x3b44('0xd')]=function(){this[_0x3b44('0x11')]=0x0;this['paused']=0x0;for(var _0x370fe3=0x0;_0x370fe3<this['Agents'][_0x3b44('0x12')];_0x370fe3+=0x1){if(this['Agents'][_0x370fe3][_0x3b44('0x13')]){this[_0x3b44('0x11')]+=0x1;}if(this[_0x3b44('0xa')][_0x370fe3][_0x3b44('0x14')]){this[_0x3b44('0x15')]+=0x1;}}this[_0x3b44('0x16')]=this['loggedIn']-this[_0x3b44('0x15')];this[_0x3b44('0x16')]=this['available']>=0x0?this[_0x3b44('0x16')]:0x0;var _0x4927b7={'id':this['id'],'available':this[_0x3b44('0x16')],'loggedIn':this[_0x3b44('0x11')],'name':this[_0x3b44('0x6')],'paused':this[_0x3b44('0x15')],'waiting':this['waiting']};var _0x57188a=md5(JSON[_0x3b44('0x17')](_0x4927b7));if(this['md5']!==_0x57188a){this[_0x3b44('0x0')]=_0x57188a;io['to'](util['format'](_0x3b44('0x18'),_0x4927b7[_0x3b44('0x6')]))['emit'](_0x3b44('0x19'),_0x4927b7);}};module[_0x3b44('0x1a')]=MailQueue;
\ No newline at end of file
+var _0x7bf9=['mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','mailPause','available','name','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents'];(function(_0x5b2c50,_0x4db66b){var _0x47f2f9=function(_0xef76e4){while(--_0xef76e4){_0x5b2c50['push'](_0x5b2c50['shift']());}};_0x47f2f9(++_0x4db66b);}(_0x7bf9,0x17c));var _0x97bf=function(_0x2ea9ef,_0x5a4c79){_0x2ea9ef=_0x2ea9ef-0x0;var _0xb5721a=_0x7bf9[_0x2ea9ef];return _0xb5721a;};'use strict';var _=require(_0x97bf('0x0'));var md5=require(_0x97bf('0x1'));var util=require('util');var Redis=require(_0x97bf('0x2'));var config=require(_0x97bf('0x3'));config[_0x97bf('0x4')]=_[_0x97bf('0x5')](config[_0x97bf('0x4')],{'host':_0x97bf('0x6'),'port':0x18eb});var io=require(_0x97bf('0x7'))(new Redis(config[_0x97bf('0x4')]));function MailQueue(_0x45481e){this['id']=_0x45481e['id']||0x0;this['name']=_0x45481e['name']||'';this[_0x97bf('0x8')]=_0x45481e[_0x97bf('0x8')]||0xa;this[_0x97bf('0x9')]=_0x45481e[_0x97bf('0x9')]||_0x97bf('0xa');this['Agents']=_0x45481e[_0x97bf('0xb')];this[_0x97bf('0xc')]={};this[_0x97bf('0xd')]=0x0;this[_0x97bf('0x1')]='';this['updateRouting']();this[_0x97bf('0xe')]();}MailQueue[_0x97bf('0xf')]['updateRouting']=function(){var _0x1f36e9=this[_0x97bf('0xc')][_0x97bf('0x10')];this['mapAgentsId']=_[_0x97bf('0x11')](this[_0x97bf('0xb')],'id');this[_0x97bf('0xc')][_0x97bf('0x10')]=_0x1f36e9;};MailQueue[_0x97bf('0xf')][_0x97bf('0xe')]=function(){this[_0x97bf('0x12')]=0x0;this[_0x97bf('0x13')]=0x0;for(var _0x3e17a9=0x0;_0x3e17a9<this[_0x97bf('0xb')]['length'];_0x3e17a9+=0x1){if(this[_0x97bf('0xb')][_0x3e17a9][_0x97bf('0x14')]){this[_0x97bf('0x12')]+=0x1;}if(this[_0x97bf('0xb')][_0x3e17a9][_0x97bf('0x15')]){this[_0x97bf('0x13')]+=0x1;}}this[_0x97bf('0x16')]=this['loggedIn']-this['paused'];this[_0x97bf('0x16')]=this[_0x97bf('0x16')]>=0x0?this[_0x97bf('0x16')]:0x0;var _0x4008bb={'id':this['id'],'available':this[_0x97bf('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x97bf('0x17')],'paused':this[_0x97bf('0x13')],'waiting':this['waiting']};var _0x524de6=md5(JSON['stringify'](_0x4008bb));if(this[_0x97bf('0x1')]!==_0x524de6){this[_0x97bf('0x1')]=_0x524de6;io['to'](util[_0x97bf('0x18')](_0x97bf('0x19'),_0x4008bb[_0x97bf('0x17')]))[_0x97bf('0x1a')](_0x97bf('0x1b'),_0x4008bb);}};module['exports']=MailQueue;
\ No newline at end of file
index ea27d4c..6e57481 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(_0x5311a1,_0x304912){var _0x2acb9f=function(_0x4803e7){while(--_0x4803e7){_0x5311a1['push'](_0x5311a1['shift']());}};_0x2acb9f(++_0x304912);}(_0xadb5,0xad));var _0x5adb=function(_0xc899ac,_0x393684){_0xc899ac=_0xc899ac-0x0;var _0x41e1b0=_0xadb5[_0xc899ac];return _0x41e1b0;};'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(_0x1e393b,_0x355f6b){var _0x3d0bfe=function(_0x320830){while(--_0x320830){_0x1e393b['push'](_0x1e393b['shift']());}};_0x3d0bfe(++_0x355f6b);}(_0x2ef3,0xba));var _0x32ef=function(_0x32a138,_0x3c7dd7){_0x32a138=_0x32a138-0x0;var _0x24130e=_0x2ef3[_0x32a138];return _0x24130e;};'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 03a14fc..337da65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf53f=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','mapAgentsId','updateRouting','prototype','_rr','Agents','updateRealtime','loggedIn','online','smsPause','paused','available','stringify','format','sms:queue:%s','name','emit','sms_queue:save','lodash','md5','util','ioredis'];(function(_0x485a48,_0x10d407){var _0x5cbe42=function(_0x487dce){while(--_0x487dce){_0x485a48['push'](_0x485a48['shift']());}};_0x5cbe42(++_0x10d407);}(_0xf53f,0x8d));var _0xff53=function(_0x253d70,_0x24bc2b){_0x253d70=_0x253d70-0x0;var _0x369798=_0xf53f[_0x253d70];return _0x369798;};'use strict';var _=require(_0xff53('0x0'));var md5=require(_0xff53('0x1'));var util=require(_0xff53('0x2'));var Redis=require(_0xff53('0x3'));var config=require(_0xff53('0x4'));config[_0xff53('0x5')]=_[_0xff53('0x6')](config[_0xff53('0x5')],{'host':_0xff53('0x7'),'port':0x18eb});var io=require(_0xff53('0x8'))(new Redis(config[_0xff53('0x5')]));function SmsQueue(_0x495edc){this['id']=_0x495edc['id']||0x0;this['name']=_0x495edc['name']||'';this[_0xff53('0x9')]=_0x495edc['timeout']||0xa;this[_0xff53('0xa')]=_0x495edc[_0xff53('0xa')]||_0xff53('0xb');this['Agents']=_0x495edc['Agents'];this[_0xff53('0xc')]={};this['waiting']=0x0;this[_0xff53('0x1')]='';this[_0xff53('0xd')]();this['updateRealtime']();}SmsQueue[_0xff53('0xe')][_0xff53('0xd')]=function(){var _0x4c8069=this[_0xff53('0xc')][_0xff53('0xf')];this[_0xff53('0xc')]=_['map'](this[_0xff53('0x10')],'id');this[_0xff53('0xc')][_0xff53('0xf')]=_0x4c8069;};SmsQueue['prototype'][_0xff53('0x11')]=function(){this[_0xff53('0x12')]=0x0;this['paused']=0x0;for(var _0x55c489=0x0;_0x55c489<this['Agents']['length'];_0x55c489+=0x1){if(this[_0xff53('0x10')][_0x55c489][_0xff53('0x13')]){this[_0xff53('0x12')]+=0x1;}if(this['Agents'][_0x55c489][_0xff53('0x14')]){this['paused']+=0x1;}}this['available']=this[_0xff53('0x12')]-this[_0xff53('0x15')];this[_0xff53('0x16')]=this[_0xff53('0x16')]>=0x0?this[_0xff53('0x16')]:0x0;var _0x319ce5={'id':this['id'],'available':this[_0xff53('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xff53('0x15')],'waiting':this['waiting']};var _0x197e95=md5(JSON[_0xff53('0x17')](_0x319ce5));if(this[_0xff53('0x1')]!==_0x197e95){this[_0xff53('0x1')]=_0x197e95;io['to'](util[_0xff53('0x18')](_0xff53('0x19'),_0x319ce5[_0xff53('0x1a')]))[_0xff53('0x1b')](_0xff53('0x1c'),_0x319ce5);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0x34e8=['loggedIn','paused','length','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x34e8,0x12c));var _0x834e=function(_0x4d6794,_0x4e9002){_0x4d6794=_0x4d6794-0x0;var _0x30164e=_0x34e8[_0x4d6794];return _0x30164e;};'use strict';var _=require(_0x834e('0x0'));var md5=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var Redis=require(_0x834e('0x3'));var config=require('../../../config/environment');config[_0x834e('0x4')]=_[_0x834e('0x5')](config[_0x834e('0x4')],{'host':_0x834e('0x6'),'port':0x18eb});var io=require(_0x834e('0x7'))(new Redis(config[_0x834e('0x4')]));function SmsQueue(_0x398bee){this['id']=_0x398bee['id']||0x0;this['name']=_0x398bee[_0x834e('0x8')]||'';this['timeout']=_0x398bee[_0x834e('0x9')]||0xa;this[_0x834e('0xa')]=_0x398bee[_0x834e('0xa')]||_0x834e('0xb');this[_0x834e('0xc')]=_0x398bee[_0x834e('0xc')];this[_0x834e('0xd')]={};this[_0x834e('0xe')]=0x0;this[_0x834e('0x1')]='';this[_0x834e('0xf')]();this[_0x834e('0x10')]();}SmsQueue[_0x834e('0x11')][_0x834e('0xf')]=function(){var _0x2e1a37=this[_0x834e('0xd')][_0x834e('0x12')];this[_0x834e('0xd')]=_['map'](this[_0x834e('0xc')],'id');this[_0x834e('0xd')]['_rr']=_0x2e1a37;};SmsQueue[_0x834e('0x11')][_0x834e('0x10')]=function(){this[_0x834e('0x13')]=0x0;this[_0x834e('0x14')]=0x0;for(var _0x50e860=0x0;_0x50e860<this[_0x834e('0xc')][_0x834e('0x15')];_0x50e860+=0x1){if(this['Agents'][_0x50e860][_0x834e('0x16')]){this['loggedIn']+=0x1;}if(this[_0x834e('0xc')][_0x50e860][_0x834e('0x17')]){this['paused']+=0x1;}}this[_0x834e('0x18')]=this[_0x834e('0x13')]-this[_0x834e('0x14')];this['available']=this[_0x834e('0x18')]>=0x0?this[_0x834e('0x18')]:0x0;var _0x34e41a={'id':this['id'],'available':this[_0x834e('0x18')],'loggedIn':this[_0x834e('0x13')],'name':this[_0x834e('0x8')],'paused':this[_0x834e('0x14')],'waiting':this['waiting']};var _0x2545b4=md5(JSON[_0x834e('0x19')](_0x34e41a));if(this[_0x834e('0x1')]!==_0x2545b4){this[_0x834e('0x1')]=_0x2545b4;io['to'](util['format'](_0x834e('0x1a'),_0x34e41a[_0x834e('0x8')]))['emit'](_0x834e('0x1b'),_0x34e41a);}};module[_0x834e('0x1c')]=SmsQueue;
\ No newline at end of file
index 22416c0..210404a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91e6=['whatsapp_queue:save','exports','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','map','mapAgentsId','loggedIn','paused','whatsappPause','available','stringify','emit'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x91e6,0x120));var _0x691e=function(_0x1c56fd,_0x274082){_0x1c56fd=_0x1c56fd-0x0;var _0x3638fe=_0x91e6[_0x1c56fd];return _0x3638fe;};'use strict';var _=require(_0x691e('0x0'));var md5=require(_0x691e('0x1'));var util=require(_0x691e('0x2'));var Redis=require('ioredis');var config=require(_0x691e('0x3'));config[_0x691e('0x4')]=_['defaults'](config[_0x691e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x691e('0x5'))(new Redis(config[_0x691e('0x4')]));function WhatsappQueue(_0x3de176){this['id']=_0x3de176['id']||0x0;this[_0x691e('0x6')]=_0x3de176[_0x691e('0x6')]||'';this['timeout']=_0x3de176[_0x691e('0x7')]||0xa;this[_0x691e('0x8')]=_0x3de176[_0x691e('0x8')]||_0x691e('0x9');this['Agents']=_0x3de176[_0x691e('0xa')];this['mapAgentsId']={};this[_0x691e('0xb')]=0x0;this['md5']='';this[_0x691e('0xc')]();this[_0x691e('0xd')]();}WhatsappQueue[_0x691e('0xe')][_0x691e('0xc')]=function(){var _0x2c0f09=this['mapAgentsId'][_0x691e('0xf')];this['mapAgentsId']=_[_0x691e('0x10')](this[_0x691e('0xa')],'id');this[_0x691e('0x11')][_0x691e('0xf')]=_0x2c0f09;};WhatsappQueue[_0x691e('0xe')]['updateRealtime']=function(){this[_0x691e('0x12')]=0x0;this[_0x691e('0x13')]=0x0;for(var _0x2b27bc=0x0;_0x2b27bc<this[_0x691e('0xa')]['length'];_0x2b27bc+=0x1){if(this['Agents'][_0x2b27bc]['online']){this[_0x691e('0x12')]+=0x1;}if(this[_0x691e('0xa')][_0x2b27bc][_0x691e('0x14')]){this[_0x691e('0x13')]+=0x1;}}this[_0x691e('0x15')]=this['loggedIn']-this[_0x691e('0x13')];this[_0x691e('0x15')]=this[_0x691e('0x15')]>=0x0?this[_0x691e('0x15')]:0x0;var _0x534f79={'id':this['id'],'available':this[_0x691e('0x15')],'loggedIn':this[_0x691e('0x12')],'name':this[_0x691e('0x6')],'paused':this[_0x691e('0x13')],'waiting':this['waiting']};var _0x2fd341=md5(JSON[_0x691e('0x16')](_0x534f79));if(this[_0x691e('0x1')]!==_0x2fd341){this['md5']=_0x2fd341;io['to'](util['format']('whatsapp:queue:%s',_0x534f79[_0x691e('0x6')]))[_0x691e('0x17')](_0x691e('0x18'),_0x534f79);}};module[_0x691e('0x19')]=WhatsappQueue;
\ No newline at end of file
+var _0x66e8=['emit','whatsapp_queue:save','exports','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','prototype','loggedIn','paused','length','whatsappPause','available','whatsapp:queue:%s'];(function(_0x263916,_0x2f1bf2){var _0x2072ff=function(_0xc895c9){while(--_0xc895c9){_0x263916['push'](_0x263916['shift']());}};_0x2072ff(++_0x2f1bf2);}(_0x66e8,0x153));var _0x866e=function(_0x7649d7,_0x2fa566){_0x7649d7=_0x7649d7-0x0;var _0x4336a6=_0x66e8[_0x7649d7];return _0x4336a6;};'use strict';var _=require('lodash');var md5=require(_0x866e('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x866e('0x1'));config[_0x866e('0x2')]=_['defaults'](config['redis'],{'host':_0x866e('0x3'),'port':0x18eb});var io=require(_0x866e('0x4'))(new Redis(config[_0x866e('0x2')]));function WhatsappQueue(_0x812b90){this['id']=_0x812b90['id']||0x0;this[_0x866e('0x5')]=_0x812b90['name']||'';this[_0x866e('0x6')]=_0x812b90[_0x866e('0x6')]||0xa;this[_0x866e('0x7')]=_0x812b90[_0x866e('0x7')]||_0x866e('0x8');this[_0x866e('0x9')]=_0x812b90['Agents'];this[_0x866e('0xa')]={};this[_0x866e('0xb')]=0x0;this[_0x866e('0x0')]='';this['updateRouting']();this[_0x866e('0xc')]();}WhatsappQueue['prototype'][_0x866e('0xd')]=function(){var _0x48b435=this['mapAgentsId']['_rr'];this[_0x866e('0xa')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x48b435;};WhatsappQueue[_0x866e('0xe')]['updateRealtime']=function(){this[_0x866e('0xf')]=0x0;this[_0x866e('0x10')]=0x0;for(var _0x12cb0e=0x0;_0x12cb0e<this[_0x866e('0x9')][_0x866e('0x11')];_0x12cb0e+=0x1){if(this['Agents'][_0x12cb0e]['online']){this[_0x866e('0xf')]+=0x1;}if(this[_0x866e('0x9')][_0x12cb0e][_0x866e('0x12')]){this[_0x866e('0x10')]+=0x1;}}this[_0x866e('0x13')]=this[_0x866e('0xf')]-this[_0x866e('0x10')];this[_0x866e('0x13')]=this[_0x866e('0x13')]>=0x0?this[_0x866e('0x13')]:0x0;var _0x2a6b89={'id':this['id'],'available':this[_0x866e('0x13')],'loggedIn':this[_0x866e('0xf')],'name':this[_0x866e('0x5')],'paused':this['paused'],'waiting':this[_0x866e('0xb')]};var _0x3f618b=md5(JSON['stringify'](_0x2a6b89));if(this[_0x866e('0x0')]!==_0x3f618b){this['md5']=_0x3f618b;io['to'](util['format'](_0x866e('0x14'),_0x2a6b89[_0x866e('0x5')]))[_0x866e('0x15')](_0x866e('0x16'),_0x2a6b89);}};module[_0x866e('0x17')]=WhatsappQueue;
\ No newline at end of file
index d827442..b7f7e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _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(_0x346573,_0x3a62f6){var _0x398090=function(_0x551375){while(--_0x551375){_0x346573['push'](_0x346573['shift']());}};_0x398090(++_0x3a62f6);}(_0xb10b,0x12a));var _0xbb10=function(_0x57a670,_0x30e402){_0x57a670=_0x57a670-0x0;var _0x41ce21=_0xb10b[_0x57a670];return _0x41ce21;};'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 4d930bd..ee70baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc81e=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xc81e,0xcf));var _0xec81=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0xc81e[_0x705b98];return _0x47b72f;};'use strict';var client=require(_0xec81('0x0'));exports[_0xec81('0x1')]=function(_0x5ab64f,_0x1aa846){return client['Request'](_0xec81('0x2'),{'body':_0x1aa846,'options':{'where':{'id':_0x5ab64f}},'log':_0xec81('0x3')});};exports[_0xec81('0x4')]=function(_0x1d998b,_0x3012fd){return client['Request'](_0xec81('0x5'),{'body':_0x3012fd,'options':{'where':{'id':_0x1d998b}},'log':_0xec81('0x6')});};
\ No newline at end of file
+var _0x92b3=['AddTagsToChatInteraction','update','Request','addTags'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92b3,0x12d));var _0x392b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x92b3[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports[_0x392b('0x0')]=function(_0x2d3c0b,_0xcd39f6){return client[_0x392b('0x1')]('UpdateChatInteraction',{'body':_0xcd39f6,'options':{'where':{'id':_0x2d3c0b}},'log':'updateChatInteraction'});};exports[_0x392b('0x2')]=function(_0x4b3710,_0xa9cf54){return client[_0x392b('0x1')](_0x392b('0x3'),{'body':_0xa9cf54,'options':{'where':{'id':_0x4b3710}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index c59ff68..069fc9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7970=['createChatMessage','../client','create','CreateChatMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7970,0x109));var _0x0797=function(_0x4d3965,_0xb1bc57){_0x4d3965=_0x4d3965-0x0;var _0x5e826b=_0x7970[_0x4d3965];return _0x5e826b;};'use strict';var client=require(_0x0797('0x0'));exports[_0x0797('0x1')]=function(_0x596f7e){return client['Request'](_0x0797('0x2'),{'body':_0x596f7e,'log':_0x0797('0x3')});};
\ No newline at end of file
+var _0x741a=['createChatMessage','create','Request','CreateChatMessage'];(function(_0x4a6fac,_0x398714){var _0x109bfa=function(_0x38cabd){while(--_0x38cabd){_0x4a6fac['push'](_0x4a6fac['shift']());}};_0x109bfa(++_0x398714);}(_0x741a,0x9d));var _0xa741=function(_0xd50b7f,_0x53c16c){_0xd50b7f=_0xd50b7f-0x0;var _0x380972=_0x741a[_0xd50b7f];return _0x380972;};'use strict';var client=require('../client');exports[_0xa741('0x0')]=function(_0xf9ee71){return client[_0xa741('0x1')](_0xa741('0x2'),{'body':_0xf9ee71,'log':_0xa741('0x3')});};
\ No newline at end of file
index 716d6f8..c061786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf041=['GetChatQueue','name','timeout','User','getChatQueues','Request'];(function(_0x556370,_0x4016e6){var _0x549e06=function(_0x229bd4){while(--_0x229bd4){_0x556370['push'](_0x556370['shift']());}};_0x549e06(++_0x4016e6);}(_0xf041,0x15b));var _0x1f04=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf041[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x1f04('0x0')](_0x1f04('0x1'),{'options':{'raw':![],'attributes':['id',_0x1f04('0x2'),_0x1f04('0x3'),'strategy'],'include':[{'model':_0x1f04('0x4'),'as':'Agents','attributes':['id',_0x1f04('0x2'),'online','chatPause']}]},'log':_0x1f04('0x5')});};};
\ No newline at end of file
+var _0xac21=['Request','name','strategy','User','chatPause','getChatQueues'];(function(_0x3aef17,_0x1563c2){var _0x2ca07b=function(_0x45d548){while(--_0x45d548){_0x3aef17['push'](_0x3aef17['shift']());}};_0x2ca07b(++_0x1563c2);}(_0xac21,0x1af));var _0x1ac2=function(_0x53edfa,_0x3ac32){_0x53edfa=_0x53edfa-0x0;var _0x2c8227=_0xac21[_0x53edfa];return _0x2c8227;};'use strict';var client=require('../client');exports[_0x1ac2('0x0')]=function(){return function(){return client[_0x1ac2('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x1ac2('0x2'),'timeout',_0x1ac2('0x3')],'include':[{'model':_0x1ac2('0x4'),'as':'Agents','attributes':['id',_0x1ac2('0x2'),'online',_0x1ac2('0x5')]}]},'log':_0x1ac2('0x0')});};};
\ No newline at end of file
index 3f95424..68828a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61a1=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61a1,0x127));var _0x161a=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x61a1[_0x55ff79];return _0x579067;};'use strict';var client=require(_0x161a('0x0'));exports[_0x161a('0x1')]=function(_0x1befc0){return client[_0x161a('0x2')](_0x161a('0x3'),{'body':_0x1befc0,'log':'CreateChatQueueReport'});};exports[_0x161a('0x4')]=function(_0x912651,_0x52aadb){return client[_0x161a('0x2')](_0x161a('0x5'),{'body':_0x52aadb,'options':{'where':{'uniqueid':_0x912651},'order':[['id',_0x161a('0x6')]],'limit':0x1},'log':_0x161a('0x5')});};
\ No newline at end of file
+var _0x4876=['CreateChatQueueReport','Request','UpdateChatQueueReport'];(function(_0x47c26b,_0x586700){var _0x3248d7=function(_0x4b1334){while(--_0x4b1334){_0x47c26b['push'](_0x47c26b['shift']());}};_0x3248d7(++_0x586700);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['create']=function(_0x153e7f){return client['Request']('CreateChatQueueReport',{'body':_0x153e7f,'log':_0x6487('0x0')});};exports['update']=function(_0x43e7e8,_0x2bace9){return client[_0x6487('0x1')](_0x6487('0x2'),{'body':_0x2bace9,'options':{'where':{'uniqueid':_0x43e7e8},'order':[['id','DESC']],'limit':0x1},'log':_0x6487('0x2')});};
\ No newline at end of file
index 36c00ec..6f4f000 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xbeefde,_0x31b267){var _0x49185a=function(_0x4eeaa1){while(--_0x4eeaa1){_0xbeefde['push'](_0xbeefde['shift']());}};_0x49185a(++_0x31b267);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x7a54,0x106));var _0x47a5=function(_0x556f9c,_0x5d5f73){_0x556f9c=_0x556f9c-0x0;var _0x425574=_0x7a54[_0x556f9c];return _0x425574;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
index 2575296..f915c04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc004=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x83609a,_0x4623de){var _0x3de3aa=function(_0x46d4e6){while(--_0x46d4e6){_0x83609a['push'](_0x83609a['shift']());}};_0x3de3aa(++_0x4623de);}(_0xc004,0xd0));var _0x4c00=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0xc004[_0x4953da];return _0x2d3780;};'use strict';var client=require(_0x4c00('0x0'));exports[_0x4c00('0x1')]=function(_0x4f4870){return client[_0x4c00('0x2')](_0x4c00('0x3'),{'body':_0x4f4870,'log':_0x4c00('0x4')});};
\ No newline at end of file
+var _0x1c9a=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x2595fb,_0xf12429){var _0x1d0d01=function(_0x401b4e){while(--_0x401b4e){_0x2595fb['push'](_0x2595fb['shift']());}};_0x1d0d01(++_0xf12429);}(_0x1c9a,0x1e6));var _0xa1c9=function(_0x296710,_0x54b35e){_0x296710=_0x296710-0x0;var _0x4ad342=_0x1c9a[_0x296710];return _0x4ad342;};'use strict';var client=require(_0xa1c9('0x0'));exports[_0xa1c9('0x1')]=function(_0x2097ab){return client[_0xa1c9('0x2')](_0xa1c9('0x3'),{'body':_0x2097ab,'log':_0xa1c9('0x4')});};
\ No newline at end of file
index f482144..39e52d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9be=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','User','Agents','online'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xb9be,0x182));var _0xeb9b=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0xb9be[_0x506d2f];return _0x101255;};'use strict';var client=require(_0xeb9b('0x0'));exports[_0xeb9b('0x1')]=function(){return function(){return client[_0xeb9b('0x2')](_0xeb9b('0x3'),{'options':{'raw':![],'attributes':['id',_0xeb9b('0x4'),_0xeb9b('0x5'),_0xeb9b('0x6')],'include':[{'model':_0xeb9b('0x7'),'as':_0xeb9b('0x8'),'attributes':['id',_0xeb9b('0x4'),_0xeb9b('0x9'),_0xeb9b('0xa')]}]},'log':_0xeb9b('0x1')});};};
\ No newline at end of file
+var _0x3f48=['Request','GetFaxQueue','name','strategy','online','../client','getFaxQueues'];(function(_0x526bbe,_0x4b63a2){var _0x5c74fc=function(_0x1a1d51){while(--_0x1a1d51){_0x526bbe['push'](_0x526bbe['shift']());}};_0x5c74fc(++_0x4b63a2);}(_0x3f48,0x1a9));var _0x83f4=function(_0x584d7a,_0x490fb8){_0x584d7a=_0x584d7a-0x0;var _0x5a3603=_0x3f48[_0x584d7a];return _0x5a3603;};'use strict';var client=require(_0x83f4('0x0'));exports[_0x83f4('0x1')]=function(){return function(){return client[_0x83f4('0x2')](_0x83f4('0x3'),{'options':{'raw':![],'attributes':['id',_0x83f4('0x4'),'timeout',_0x83f4('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x83f4('0x4'),_0x83f4('0x6'),'faxPause']}]},'log':_0x83f4('0x1')});};};
\ No newline at end of file
index 0aa2c5b..40495ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b12=['UpdateFaxQueueReport','DESC','../client','Request','CreateFaxQueueReport','update'];(function(_0x4f8b2b,_0x1dc8dd){var _0x2f230a=function(_0x232685){while(--_0x232685){_0x4f8b2b['push'](_0x4f8b2b['shift']());}};_0x2f230a(++_0x1dc8dd);}(_0x7b12,0x1e8));var _0x27b1=function(_0x245c9f,_0x1d9e8c){_0x245c9f=_0x245c9f-0x0;var _0x276b79=_0x7b12[_0x245c9f];return _0x276b79;};'use strict';var client=require(_0x27b1('0x0'));exports['create']=function(_0x3a1fd2){return client[_0x27b1('0x1')]('CreateFaxQueueReport',{'body':_0x3a1fd2,'log':_0x27b1('0x2')});};exports[_0x27b1('0x3')]=function(_0x435c7e,_0x446217){return client[_0x27b1('0x1')](_0x27b1('0x4'),{'body':_0x446217,'options':{'where':{'uniqueid':_0x435c7e},'order':[['id',_0x27b1('0x5')]],'limit':0x1},'log':_0x27b1('0x4')});};
\ No newline at end of file
+var _0x6f36=['UpdateFaxQueueReport','Request','CreateFaxQueueReport','update'];(function(_0x33fd82,_0x50be76){var _0x138aac=function(_0x20595a){while(--_0x20595a){_0x33fd82['push'](_0x33fd82['shift']());}};_0x138aac(++_0x50be76);}(_0x6f36,0x195));var _0x66f3=function(_0x54fa2c,_0x54fbe7){_0x54fa2c=_0x54fa2c-0x0;var _0x26d50a=_0x6f36[_0x54fa2c];return _0x26d50a;};'use strict';var client=require('../client');exports['create']=function(_0x472a7d){return client[_0x66f3('0x0')](_0x66f3('0x1'),{'body':_0x472a7d,'log':_0x66f3('0x1')});};exports[_0x66f3('0x2')]=function(_0x430516,_0x3250ee){return client[_0x66f3('0x0')](_0x66f3('0x3'),{'body':_0x3250ee,'options':{'where':{'uniqueid':_0x430516},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 742d4bb..c695214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb606=['getIntervals','Request','Intervals','interval','../client'];(function(_0x28ccde,_0x1430d2){var _0x52ec3d=function(_0x36c83d){while(--_0x36c83d){_0x28ccde['push'](_0x28ccde['shift']());}};_0x52ec3d(++_0x1430d2);}(_0xb606,0x13f));var _0x6b60=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0xb606[_0x438fe1];return _0x3c8e1b;};'use strict';var client=require(_0x6b60('0x0'));exports[_0x6b60('0x1')]=function(){return function(){return client[_0x6b60('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x6b60('0x3'),'attributes':['id','name',_0x6b60('0x4')]}]},'log':_0x6b60('0x1')});};};
\ No newline at end of file
+var _0xbd08=['../client','getIntervals','Request','name','Interval'];(function(_0x304850,_0x3de906){var _0xa334fe=function(_0x4d74fb){while(--_0x4d74fb){_0x304850['push'](_0x304850['shift']());}};_0xa334fe(++_0x3de906);}(_0xbd08,0x6e));var _0x8bd0=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xbd08[_0x616290];return _0x453879;};'use strict';var client=require(_0x8bd0('0x0'));exports[_0x8bd0('0x1')]=function(){return function(){return client[_0x8bd0('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8bd0('0x3')],'include':[{'model':_0x8bd0('0x4'),'as':'Intervals','attributes':['id',_0x8bd0('0x3'),'interval']}]},'log':_0x8bd0('0x1')});};};
\ No newline at end of file
index 6e2ea1e..930f241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','../client'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x896e,0x1e9));var _0xe896=function(_0x5d195c,_0xdff1cc){_0x5d195c=_0x5d195c-0x0;var _0xd12701=_0x896e[_0x5d195c];return _0xd12701;};'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
+var _0x33af=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x319e2e,_0x2f727f){var _0x302524=function(_0x5cad9d){while(--_0x5cad9d){_0x319e2e['push'](_0x319e2e['shift']());}};_0x302524(++_0x2f727f);}(_0x33af,0xec));var _0xf33a=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x33af[_0xf91841];return _0x4b9c44;};'use strict';var client=require('../client');exports[_0xf33a('0x0')]=function(_0x54b114,_0x2137be){return client[_0xf33a('0x1')](_0xf33a('0x2'),{'body':_0x2137be,'options':{'where':{'id':_0x54b114}},'log':_0xf33a('0x3')});};exports[_0xf33a('0x4')]=function(_0x25f156,_0x4c734e){return client[_0xf33a('0x1')](_0xf33a('0x5'),{'body':_0x4c734e,'options':{'where':{'id':_0x25f156}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index d7de50d..9f322f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61b1=['Request','CreateMailMessage','../client'];(function(_0x19af51,_0x3834ac){var _0x997581=function(_0x4ba64c){while(--_0x4ba64c){_0x19af51['push'](_0x19af51['shift']());}};_0x997581(++_0x3834ac);}(_0x61b1,0x134));var _0x161b=function(_0x17723c,_0x1ea81d){_0x17723c=_0x17723c-0x0;var _0x1ffbf3=_0x61b1[_0x17723c];return _0x1ffbf3;};'use strict';var client=require(_0x161b('0x0'));exports['create']=function(_0x14f96c){return client[_0x161b('0x1')](_0x161b('0x2'),{'body':_0x14f96c,'log':'createMailMessage'});};
\ No newline at end of file
+var _0x6af4=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0x3c393d,_0x43e801){var _0x270897=function(_0x191e2f){while(--_0x191e2f){_0x3c393d['push'](_0x3c393d['shift']());}};_0x270897(++_0x43e801);}(_0x6af4,0x109));var _0x46af=function(_0x489bc1,_0x31584a){_0x489bc1=_0x489bc1-0x0;var _0x46b045=_0x6af4[_0x489bc1];return _0x46b045;};'use strict';var client=require(_0x46af('0x0'));exports['create']=function(_0x5e3c86){return client[_0x46af('0x1')](_0x46af('0x2'),{'body':_0x5e3c86,'log':_0x46af('0x3')});};
\ No newline at end of file
index d618785..658265d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfce=['mailPause','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xbfce,0x161));var _0xebfc=function(_0xe196e5,_0x29a7a6){_0xe196e5=_0xe196e5-0x0;var _0xffdcb4=_0xbfce[_0xe196e5];return _0xffdcb4;};'use strict';var client=require('../client');exports[_0xebfc('0x0')]=function(){return function(){return client[_0xebfc('0x1')](_0xebfc('0x2'),{'options':{'raw':![],'attributes':['id',_0xebfc('0x3'),_0xebfc('0x4'),_0xebfc('0x5')],'include':[{'model':'User','as':_0xebfc('0x6'),'attributes':['id','name','online',_0xebfc('0x7')]}]},'log':_0xebfc('0x0')});};};
\ No newline at end of file
+var _0xe135=['strategy','online','mailPause','getMailQueues','Request','GetMailQueue','name'];(function(_0xce02ef,_0x128323){var _0x213b39=function(_0x4ab49b){while(--_0x4ab49b){_0xce02ef['push'](_0xce02ef['shift']());}};_0x213b39(++_0x128323);}(_0xe135,0x1a7));var _0x5e13=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xe135[_0x174ef5];return _0x1cc379;};'use strict';var client=require('../client');exports[_0x5e13('0x0')]=function(){return function(){return client[_0x5e13('0x1')](_0x5e13('0x2'),{'options':{'raw':![],'attributes':['id',_0x5e13('0x3'),'timeout',_0x5e13('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id','name',_0x5e13('0x5'),_0x5e13('0x6')]}]},'log':_0x5e13('0x0')});};};
\ No newline at end of file
index 79a5796..574c1fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9d2=['Request','update','UpdateMailQueueReport','DESC','create'];(function(_0x105919,_0x2c2689){var _0x527277=function(_0x4e482a){while(--_0x4e482a){_0x105919['push'](_0x105919['shift']());}};_0x527277(++_0x2c2689);}(_0xa9d2,0xdb));var _0x2a9d=function(_0x59bb42,_0xe5b9ef){_0x59bb42=_0x59bb42-0x0;var _0x84c39=_0xa9d2[_0x59bb42];return _0x84c39;};'use strict';var client=require('../client');exports[_0x2a9d('0x0')]=function(_0x60372c){return client[_0x2a9d('0x1')]('CreateMailQueueReport',{'body':_0x60372c,'log':'CreateMailQueueReport'});};exports[_0x2a9d('0x2')]=function(_0x3e4504,_0xa8ad2b){return client[_0x2a9d('0x1')](_0x2a9d('0x3'),{'body':_0xa8ad2b,'options':{'where':{'uniqueid':_0x3e4504},'order':[['id',_0x2a9d('0x4')]],'limit':0x1},'log':_0x2a9d('0x3')});};
\ No newline at end of file
+var _0x053a=['UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x245819,_0x25c7b9){var _0x378d96=function(_0x426d0d){while(--_0x426d0d){_0x245819['push'](_0x245819['shift']());}};_0x378d96(++_0x25c7b9);}(_0x053a,0x7a));var _0xa053=function(_0x51fa63,_0x4fb931){_0x51fa63=_0x51fa63-0x0;var _0x3214cd=_0x053a[_0x51fa63];return _0x3214cd;};'use strict';var client=require(_0xa053('0x0'));exports[_0xa053('0x1')]=function(_0x155d65){return client['Request'](_0xa053('0x2'),{'body':_0x155d65,'log':'CreateMailQueueReport'});};exports[_0xa053('0x3')]=function(_0x38e507,_0x3e4e95){return client['Request'](_0xa053('0x4'),{'body':_0x3e4e95,'options':{'where':{'uniqueid':_0x38e507},'order':[['id',_0xa053('0x5')]],'limit':0x1},'log':_0xa053('0x4')});};
\ No newline at end of file
index d3476de..5fc0088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dfe=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x41e588,_0x2bed38){var _0x438bb0=function(_0x3c73e1){while(--_0x3c73e1){_0x41e588['push'](_0x41e588['shift']());}};_0x438bb0(++_0x2bed38);}(_0x3dfe,0x19b));var _0xe3df=function(_0x15131b,_0x435e72){_0x15131b=_0x15131b-0x0;var _0x41921a=_0x3dfe[_0x15131b];return _0x41921a;};'use strict';var client=require(_0xe3df('0x0'));exports['update']=function(_0x1667e7,_0x1ceebd){return client[_0xe3df('0x1')](_0xe3df('0x2'),{'body':_0x1ceebd,'options':{'where':{'id':_0x1667e7}},'log':_0xe3df('0x3')});};exports[_0xe3df('0x4')]=function(_0x1d2e92,_0x2daad1){return client[_0xe3df('0x1')](_0xe3df('0x5'),{'body':_0x2daad1,'options':{'where':{'id':_0x1d2e92}},'log':_0xe3df('0x6')});};
\ No newline at end of file
+var _0x93ae=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x93ae,0x1b1));var _0xe93a=function(_0xf83ddb,_0xf3711f){_0xf83ddb=_0xf83ddb-0x0;var _0x417fd1=_0x93ae[_0xf83ddb];return _0x417fd1;};'use strict';var client=require(_0xe93a('0x0'));exports[_0xe93a('0x1')]=function(_0x54ddac,_0x2e8617){return client[_0xe93a('0x2')](_0xe93a('0x3'),{'body':_0x2e8617,'options':{'where':{'id':_0x54ddac}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x1830ba,_0x19e309){return client[_0xe93a('0x2')](_0xe93a('0x4'),{'body':_0x19e309,'options':{'where':{'id':_0x1830ba}},'log':_0xe93a('0x5')});};
\ No newline at end of file
index 4b8c963..2c8ebcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6156=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x1138cf,_0x540bf9){var _0x7d77e6=function(_0x2190af){while(--_0x2190af){_0x1138cf['push'](_0x1138cf['shift']());}};_0x7d77e6(++_0x540bf9);}(_0x6156,0x1e4));var _0x6615=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x6156[_0xdea41a];return _0x15d0d8;};'use strict';var client=require('../client');exports[_0x6615('0x0')]=function(_0x525d5e){return client[_0x6615('0x1')](_0x6615('0x2'),{'body':_0x525d5e,'log':_0x6615('0x3')});};
\ No newline at end of file
+var _0x40d9=['Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x13b623,_0x261eb3){var _0xd1d762=function(_0x3d18cd){while(--_0x3d18cd){_0x13b623['push'](_0x13b623['shift']());}};_0xd1d762(++_0x261eb3);}(_0x40d9,0xc6));var _0x940d=function(_0xb53232,_0x213bec){_0xb53232=_0xb53232-0x0;var _0x5719f9=_0x40d9[_0xb53232];return _0x5719f9;};'use strict';var client=require('../client');exports['create']=function(_0x59c99e){return client[_0x940d('0x0')](_0x940d('0x1'),{'body':_0x59c99e,'log':_0x940d('0x2')});};
\ No newline at end of file
index d408a41..7aa5334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe70c=['timeout','User','Agents','getOpenchannelQueues','../client','Request','name'];(function(_0x7816ac,_0x372d82){var _0x531068=function(_0x18525a){while(--_0x18525a){_0x7816ac['push'](_0x7816ac['shift']());}};_0x531068(++_0x372d82);}(_0xe70c,0x1a8));var _0xce70=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe70c[_0x501510];return _0x1e6ee5;};'use strict';var client=require(_0xce70('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xce70('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xce70('0x2'),_0xce70('0x3'),'strategy'],'include':[{'model':_0xce70('0x4'),'as':_0xce70('0x5'),'attributes':['id','name','online','openchannelPause']}]},'log':_0xce70('0x6')});};};
\ No newline at end of file
+var _0xd506=['strategy','User','Agents','online','openchannelPause','../client','getOpenchannelQueues','name','timeout'];(function(_0xa041de,_0x3600e2){var _0x1d654c=function(_0x295d70){while(--_0x295d70){_0xa041de['push'](_0xa041de['shift']());}};_0x1d654c(++_0x3600e2);}(_0xd506,0x7a));var _0x6d50=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xd506[_0x1beef3];return _0x5af964;};'use strict';var client=require(_0x6d50('0x0'));exports[_0x6d50('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x6d50('0x2'),_0x6d50('0x3'),_0x6d50('0x4')],'include':[{'model':_0x6d50('0x5'),'as':_0x6d50('0x6'),'attributes':['id',_0x6d50('0x2'),_0x6d50('0x7'),_0x6d50('0x8')]}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index 3ba0b0d..9882878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0dc=['Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x1e1c5f,_0x4afc9e){var _0x587dab=function(_0x3c07a6){while(--_0x3c07a6){_0x1e1c5f['push'](_0x1e1c5f['shift']());}};_0x587dab(++_0x4afc9e);}(_0xd0dc,0x1c1));var _0xcd0d=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0xd0dc[_0x153e7d];return _0x3c22dd;};'use strict';var client=require(_0xcd0d('0x0'));exports['create']=function(_0x593e36){return client[_0xcd0d('0x1')](_0xcd0d('0x2'),{'body':_0x593e36,'log':_0xcd0d('0x2')});};exports[_0xcd0d('0x3')]=function(_0x3a5893,_0x1bd82d){return client[_0xcd0d('0x1')](_0xcd0d('0x4'),{'body':_0x1bd82d,'options':{'where':{'uniqueid':_0x3a5893},'order':[['id',_0xcd0d('0x5')]],'limit':0x1},'log':_0xcd0d('0x4')});};
\ No newline at end of file
+var _0x1789=['DESC','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','update'];(function(_0xc77ae2,_0x570115){var _0x3e56cb=function(_0x3dfdab){while(--_0x3dfdab){_0xc77ae2['push'](_0xc77ae2['shift']());}};_0x3e56cb(++_0x570115);}(_0x1789,0x92));var _0x9178=function(_0x45321d,_0x58eb4f){_0x45321d=_0x45321d-0x0;var _0x1a999a=_0x1789[_0x45321d];return _0x1a999a;};'use strict';var client=require(_0x9178('0x0'));exports[_0x9178('0x1')]=function(_0x1bbc30){return client['Request'](_0x9178('0x2'),{'body':_0x1bbc30,'log':_0x9178('0x2')});};exports[_0x9178('0x3')]=function(_0x3a573d,_0x45af56){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x45af56,'options':{'where':{'uniqueid':_0x3a573d},'order':[['id',_0x9178('0x4')]],'limit':0x1},'log':_0x9178('0x5')});};
\ No newline at end of file
index b106eb1..322e8c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe647=['update','Request','UpdateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x45e7ee,_0x5137c5){var _0x2f2d0e=function(_0x1447df){while(--_0x1447df){_0x45e7ee['push'](_0x45e7ee['shift']());}};_0x2f2d0e(++_0x5137c5);}(_0xe647,0x16d));var _0x7e64=function(_0x1495a5,_0x157c45){_0x1495a5=_0x1495a5-0x0;var _0x4dae73=_0xe647[_0x1495a5];return _0x4dae73;};'use strict';var client=require(_0x7e64('0x0'));exports[_0x7e64('0x1')]=function(_0x54aaab,_0x41d99f){return client[_0x7e64('0x2')](_0x7e64('0x3'),{'body':_0x41d99f,'options':{'where':{'id':_0x54aaab}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x7ed710,_0x2e00b0){return client[_0x7e64('0x2')](_0x7e64('0x4'),{'body':_0x2e00b0,'options':{'where':{'id':_0x7ed710}},'log':_0x7e64('0x5')});};
\ No newline at end of file
+var _0xf2ca=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xf2ca[_0xa60623];return _0x4a6487;};'use strict';var client=require(_0xaf2c('0x0'));exports[_0xaf2c('0x1')]=function(_0x26a8a7,_0x598667){return client[_0xaf2c('0x2')](_0xaf2c('0x3'),{'body':_0x598667,'options':{'where':{'id':_0x26a8a7}},'log':_0xaf2c('0x4')});};exports[_0xaf2c('0x5')]=function(_0x3a724c,_0x10c910){return client['Request'](_0xaf2c('0x6'),{'body':_0x10c910,'options':{'where':{'id':_0x3a724c}},'log':_0xaf2c('0x7')});};
\ No newline at end of file
index 81311cf..15f0c1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb8e=['createSmsMessage','../client','create'];(function(_0x465f5e,_0x49c5fe){var _0x1510e8=function(_0x36ec8a){while(--_0x36ec8a){_0x465f5e['push'](_0x465f5e['shift']());}};_0x1510e8(++_0x49c5fe);}(_0xcb8e,0xcd));var _0xecb8=function(_0x2c0af1,_0x4b5709){_0x2c0af1=_0x2c0af1-0x0;var _0x53fe48=_0xcb8e[_0x2c0af1];return _0x53fe48;};'use strict';var client=require(_0xecb8('0x0'));exports[_0xecb8('0x1')]=function(_0x32fb77){return client['Request']('CreateSmsMessage',{'body':_0x32fb77,'log':_0xecb8('0x2')});};
\ No newline at end of file
+var _0x2261=['Request','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2261,0xa1));var _0x1226=function(_0x4e3665,_0x5ccb5a){_0x4e3665=_0x4e3665-0x0;var _0x140ba4=_0x2261[_0x4e3665];return _0x140ba4;};'use strict';var client=require(_0x1226('0x0'));exports['create']=function(_0x4fa925){return client[_0x1226('0x1')]('CreateSmsMessage',{'body':_0x4fa925,'log':'createSmsMessage'});};
\ No newline at end of file
index 3b00cf2..8303930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x4b0470,_0x38b9a5){var _0x241632=function(_0x4fbb19){while(--_0x4fbb19){_0x4b0470['push'](_0x4b0470['shift']());}};_0x241632(++_0x38b9a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb7e7[_0x580576];return _0x3f55a0;};'use strict';var client=require(_0x7b7e('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0x7b7e('0x1')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x7b7e('0x2'),'timeout',_0x7b7e('0x3')],'include':[{'model':'User','as':_0x7b7e('0x4'),'attributes':['id',_0x7b7e('0x2'),_0x7b7e('0x5'),'smsPause']}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x3ec50a,_0x55f230){var _0x59fe9c=function(_0x1fee02){while(--_0x1fee02){_0x3ec50a['push'](_0x3ec50a['shift']());}};_0x59fe9c(++_0x55f230);}(_0xe706,0xa3));var _0x6e70=function(_0xfd365d,_0x4fc464){_0xfd365d=_0xfd365d-0x0;var _0xf6cae3=_0xe706[_0xfd365d];return _0xf6cae3;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};};
\ No newline at end of file
index b96dcf7..25e672f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x580999,_0x12b518){var _0x407f05=function(_0x139293){while(--_0x139293){_0x580999['push'](_0x580999['shift']());}};_0x407f05(++_0x12b518);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});};
\ No newline at end of file
+var _0x3e74=['CreateSmsQueueReport','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x3fd39b,_0x552caa){var _0x563171=function(_0x21b93d){while(--_0x21b93d){_0x3fd39b['push'](_0x3fd39b['shift']());}};_0x563171(++_0x552caa);}(_0x3e74,0x175));var _0x43e7=function(_0x280c2,_0x460936){_0x280c2=_0x280c2-0x0;var _0x370d33=_0x3e74[_0x280c2];return _0x370d33;};'use strict';var client=require(_0x43e7('0x0'));exports['create']=function(_0x349480){return client[_0x43e7('0x1')](_0x43e7('0x2'),{'body':_0x349480,'log':'CreateSmsQueueReport'});};exports['update']=function(_0xc58479,_0x4f9bbe){return client[_0x43e7('0x1')](_0x43e7('0x3'),{'body':_0x4f9bbe,'options':{'where':{'uniqueid':_0xc58479},'order':[['id',_0x43e7('0x4')]],'limit':0x1},'log':_0x43e7('0x3')});};
\ No newline at end of file
index 40a7b5f..d17f0c6 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(_0x14f49d,_0x54b7a9){var _0x167a5d=function(_0x1b1050){while(--_0x1b1050){_0x14f49d['push'](_0x14f49d['shift']());}};_0x167a5d(++_0x54b7a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x56581e,_0x2ceb55){var _0x1e6eed=function(_0x4e01f7){while(--_0x4e01f7){_0x56581e['push'](_0x56581e['shift']());}};_0x1e6eed(++_0x2ceb55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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 7dd8dcb..7c27e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x5ae7ff,_0x323cbf){var _0x1a0d63=function(_0x2f26f7){while(--_0x2f26f7){_0x5ae7ff['push'](_0x5ae7ff['shift']());}};_0x1a0d63(++_0x323cbf);}(_0x4819,0xcd));var _0x9481=function(_0x14a79a,_0x281ce9){_0x14a79a=_0x14a79a-0x0;var _0x55d55b=_0x4819[_0x14a79a];return _0x55d55b;};'use strict';var client=require('../client');exports[_0x9481('0x0')]=function(_0x3307b0,_0xa9557a){return client[_0x9481('0x1')](_0x9481('0x2'),{'body':_0xa9557a,'options':{'where':{'id':_0x3307b0}},'log':_0x9481('0x3')});};exports[_0x9481('0x4')]=function(_0x14dc10,_0xc39edf){return client[_0x9481('0x1')]('AddTagsToWhatsappInteraction',{'body':_0xc39edf,'options':{'where':{'id':_0x14dc10}},'log':_0x9481('0x5')});};
\ No newline at end of file
+var _0xf9d5=['addTags','addTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x63c794,_0x14f52c){var _0x16f319=function(_0x149940){while(--_0x149940){_0x63c794['push'](_0x63c794['shift']());}};_0x16f319(++_0x14f52c);}(_0xf9d5,0x122));var _0x5f9d=function(_0x39b859,_0x97abb0){_0x39b859=_0x39b859-0x0;var _0x36499c=_0xf9d5[_0x39b859];return _0x36499c;};'use strict';var client=require('../client');exports[_0x5f9d('0x0')]=function(_0x875bbc,_0x5acece){return client[_0x5f9d('0x1')](_0x5f9d('0x2'),{'body':_0x5acece,'options':{'where':{'id':_0x875bbc}},'log':_0x5f9d('0x3')});};exports[_0x5f9d('0x4')]=function(_0x25fa8c,_0xdd68fd){return client[_0x5f9d('0x1')]('AddTagsToWhatsappInteraction',{'body':_0xdd68fd,'options':{'where':{'id':_0x25fa8c}},'log':_0x5f9d('0x5')});};
\ No newline at end of file
index 90a333b..e7683a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f07=['createWhatsappMessage','../client','CreateWhatsappMessage'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x9f07,0x175));var _0x79f0=function(_0x3e4888,_0x4dcb89){_0x3e4888=_0x3e4888-0x0;var _0x2cec4c=_0x9f07[_0x3e4888];return _0x2cec4c;};'use strict';var client=require(_0x79f0('0x0'));exports['create']=function(_0x18e5bd){return client['Request'](_0x79f0('0x1'),{'body':_0x18e5bd,'log':_0x79f0('0x2')});};
\ No newline at end of file
+var _0x291c=['CreateWhatsappMessage','../client'];(function(_0x78f816,_0x29ec87){var _0x41f045=function(_0x4faa94){while(--_0x4faa94){_0x78f816['push'](_0x78f816['shift']());}};_0x41f045(++_0x29ec87);}(_0x291c,0x1af));var _0xc291=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x291c[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xc291('0x0'));exports['create']=function(_0xcf59b7){return client['Request'](_0xc291('0x1'),{'body':_0xcf59b7,'log':'createWhatsappMessage'});};
\ No newline at end of file
index 4228b52..1857e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa70e=['whatsappPause','../client','getWhatsappQueues','Request','timeout','strategy','User','Agents','name'];(function(_0x15b8ea,_0x55dcf0){var _0x190fe1=function(_0x53ecea){while(--_0x53ecea){_0x15b8ea['push'](_0x15b8ea['shift']());}};_0x190fe1(++_0x55dcf0);}(_0xa70e,0x64));var _0xea70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa70e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xea70('0x0'));exports[_0xea70('0x1')]=function(){return function(){return client[_0xea70('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0xea70('0x3'),_0xea70('0x4')],'include':[{'model':_0xea70('0x5'),'as':_0xea70('0x6'),'attributes':['id',_0xea70('0x7'),'online',_0xea70('0x8')]}]},'log':_0xea70('0x1')});};};
\ No newline at end of file
+var _0x3e76=['whatsappPause','../client','getWhatsappQueues','Request','timeout','strategy','User','Agents'];(function(_0xefbb1d,_0x51a311){var _0x14c9f2=function(_0x587c5c){while(--_0x587c5c){_0xefbb1d['push'](_0xefbb1d['shift']());}};_0x14c9f2(++_0x51a311);}(_0x3e76,0x1a1));var _0x63e7=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x3e76[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x63e7('0x0'));exports[_0x63e7('0x1')]=function(){return function(){return client[_0x63e7('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x63e7('0x3'),_0x63e7('0x4')],'include':[{'model':_0x63e7('0x5'),'as':_0x63e7('0x6'),'attributes':['id','name','online',_0x63e7('0x7')]}]},'log':_0x63e7('0x1')});};};
\ No newline at end of file
index 4cd2274..f039583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83be=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x792894,_0x436789){var _0x290638=function(_0x3ce3c4){while(--_0x3ce3c4){_0x792894['push'](_0x792894['shift']());}};_0x290638(++_0x436789);}(_0x83be,0x160));var _0xe83b=function(_0x405637,_0x48918b){_0x405637=_0x405637-0x0;var _0x37d854=_0x83be[_0x405637];return _0x37d854;};'use strict';var client=require(_0xe83b('0x0'));exports[_0xe83b('0x1')]=function(_0x3aeada){return client[_0xe83b('0x2')]('CreateWhatsappQueueReport',{'body':_0x3aeada,'log':_0xe83b('0x3')});};exports[_0xe83b('0x4')]=function(_0x35fcbb,_0x2324e7){return client['Request'](_0xe83b('0x5'),{'body':_0x2324e7,'options':{'where':{'uniqueid':_0x35fcbb},'order':[['id',_0xe83b('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
+var _0x9efb=['DESC','../client','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x24ec81,_0x497b1e){var _0x4458ec=function(_0x5ed4eb){while(--_0x5ed4eb){_0x24ec81['push'](_0x24ec81['shift']());}};_0x4458ec(++_0x497b1e);}(_0x9efb,0x18d));var _0xb9ef=function(_0xad4ca8,_0x36afe1){_0xad4ca8=_0xad4ca8-0x0;var _0x5b3b25=_0x9efb[_0xad4ca8];return _0x5b3b25;};'use strict';var client=require(_0xb9ef('0x0'));exports['create']=function(_0x4331bf){return client[_0xb9ef('0x1')](_0xb9ef('0x2'),{'body':_0x4331bf,'log':_0xb9ef('0x2')});};exports[_0xb9ef('0x3')]=function(_0x193e3c,_0x4c67af){return client[_0xb9ef('0x1')](_0xb9ef('0x4'),{'body':_0x4c67af,'options':{'where':{'uniqueid':_0x193e3c},'order':[['id',_0xb9ef('0x5')]],'limit':0x1},'log':_0xb9ef('0x4')});};
\ No newline at end of file
index 0807cf4..066fddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1aad=['[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','find','agents','timeout','atimeout','channel','rules','end','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x1aad,0x1ca));var _0xd1aa=function(_0x533290,_0x31e3ae){_0x533290=_0x533290-0x0;var _0x23f13d=_0x1aad[_0x533290];return _0x23f13d;};'use strict';var schema=require(_0xd1aa('0x0'));var _=require(_0xd1aa('0x1'));var util=require(_0xd1aa('0x2'));var seqqueue=require(_0xd1aa('0x3'));var logger=require(_0xd1aa('0x4'))(_0xd1aa('0x5'));var strategy=require(_0xd1aa('0x6'));var queue=schema({'name':{'type':_0xd1aa('0x7'),'required':!![],'message':_0xd1aa('0x8')},'timeout':{'type':_0xd1aa('0x9'),'message':_0xd1aa('0xa')}});function writeLog(_0x4f7963,_0x604d93,_0x5785f7){return logger[_0xd1aa('0xb')](util[_0xd1aa('0xc')](_0xd1aa('0xd'),_0x4f7963,_0x604d93[_0xd1aa('0xe')],_0x5785f7));}function handleFindAgent(_0x1d548a){return function(_0x23c3b5){return _0x23c3b5[_0xd1aa('0xe')][_0xd1aa('0xf')]()===_0x1d548a[_0xd1aa('0xf')]();};}exports[_0xd1aa('0x10')]=function(_0x528d9c,_0x2e264a,_0x2f0b0a,_0x2cda7a){return function(_0x34cc94){try{var _0xc3b27a={'name':_0x2e264a[0x0],'timeout':_0x2e264a[0x1]};var _0x1fbba5=queue[_0xd1aa('0x0')](_0xc3b27a,{'typecast':!![]});if(_0x1fbba5[_0xd1aa('0x11')]){logger[_0xd1aa('0x12')](_0xd1aa('0x13'),_0x528d9c,_[_0xd1aa('0x14')](_0x1fbba5,'message')[_0xd1aa('0x15')](',\x20'));_0x34cc94['stop']();}else{var _0x13bf2f=_[_0xd1aa('0x16')](_0x2f0b0a[_0xd1aa('0x17')],handleFindAgent(_0xc3b27a[_0xd1aa('0xe')]));if(_0x13bf2f){var _0x30e587=(_0xc3b27a[_0xd1aa('0x18')]||0xa)*0x3e8;var _0x11e931,_0x100fd6;var _0x530074=seqqueue['createQueue'](_0x30e587);_0x530074['id']=_0x528d9c;_0x530074[_0xd1aa('0x19')]=_0x30e587;_0x530074[_0xd1aa('0x1a')]=_0x2cda7a[_0xd1aa('0x1a')];writeLog(_0x528d9c,_0x13bf2f,util[_0xd1aa('0xc')]('START:%s',_0x30e587));_0x2f0b0a[_0xd1aa('0x1b')][_0x528d9c]['on'](_0xd1aa('0x1c'),function(){logger[_0xd1aa('0xb')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x528d9c);clearTimeout(_0x100fd6);_0x100fd6=undefined;_0x530074['close']();if(_0x2f0b0a[_0xd1aa('0x1b')][_0x528d9c]){delete _0x2f0b0a[_0xd1aa('0x1b')][_0x528d9c];}_0x34cc94[_0xd1aa('0x1d')]();});_0x2f0b0a[_0xd1aa('0x1b')][_0x528d9c]['on'](_0xd1aa('0x1e'),function(){if(_0x2f0b0a[_0xd1aa('0x1b')][_0x528d9c]){delete _0x2f0b0a[_0xd1aa('0x1b')][_0x528d9c];}});_0x100fd6=setTimeout(function(){logger[_0xd1aa('0xb')](_0xd1aa('0x1f'),_0x528d9c);clearTimeout(_0x100fd6);_0x530074[_0xd1aa('0x20')]();_0x34cc94['next']();},_0x30e587);strategy[_0xd1aa('0x21')](_0x530074,_0x13bf2f,_0x2f0b0a,_0x2cda7a);}else{logger[_0xd1aa('0x12')](_0xd1aa('0x22'),_0x528d9c,_0xc3b27a[_0xd1aa('0xe')]);_0x34cc94[_0xd1aa('0x1d')]();}}}catch(_0x23efa1){console[_0xd1aa('0x23')](_0x23efa1);logger[_0xd1aa('0x12')](_0xd1aa('0x24'),_0x528d9c,_0x23efa1[_0xd1aa('0x25')]);_0x34cc94['stop']();}};};
\ No newline at end of file
+var _0xe530=['stop','find','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','info','[%s][AGENT]\x20ROUTING\x20END','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','consequence','[%s][AGENT]\x20%s','message','join'];(function(_0x5b1c2d,_0x46332d){var _0x442317=function(_0xf7e486){while(--_0xf7e486){_0x5b1c2d['push'](_0x5b1c2d['shift']());}};_0x442317(++_0x46332d);}(_0xe530,0x1d0));var _0x0e53=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xe530[_0x2b4411];return _0x8e41ef;};'use strict';var schema=require(_0x0e53('0x0'));var _=require(_0x0e53('0x1'));var util=require(_0x0e53('0x2'));var seqqueue=require(_0x0e53('0x3'));var logger=require(_0x0e53('0x4'))(_0x0e53('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x0e53('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x0e53('0x7'),'message':_0x0e53('0x8')}});function writeLog(_0x751c76,_0x192a2c,_0xa231f){return logger['info'](util[_0x0e53('0x9')](_0x0e53('0xa'),_0x751c76,_0x192a2c[_0x0e53('0xb')],_0xa231f));}function handleFindAgent(_0x15f5a5){return function(_0x4f4360){return _0x4f4360[_0x0e53('0xb')]['toLowerCase']()===_0x15f5a5['toLowerCase']();};}exports[_0x0e53('0xc')]=function(_0x2d1b18,_0x5dcee5,_0x5ebf60,_0x14614b){return function(_0x346f4f){try{var _0x5b3171={'name':_0x5dcee5[0x0],'timeout':_0x5dcee5[0x1]};var _0xf909bb=queue['validate'](_0x5b3171,{'typecast':!![]});if(_0xf909bb['length']){logger['error'](_0x0e53('0xd'),_0x2d1b18,_['map'](_0xf909bb,_0x0e53('0xe'))[_0x0e53('0xf')](',\x20'));_0x346f4f[_0x0e53('0x10')]();}else{var _0x16143f=_[_0x0e53('0x11')](_0x5ebf60['agents'],handleFindAgent(_0x5b3171['name']));if(_0x16143f){var _0x4e846f=(_0x5b3171['timeout']||0xa)*0x3e8;var _0x2ea8fe,_0x2ec61d;var _0x22ad5e=seqqueue['createQueue'](_0x4e846f);_0x22ad5e['id']=_0x2d1b18;_0x22ad5e['atimeout']=_0x4e846f;_0x22ad5e[_0x0e53('0x12')]=_0x14614b[_0x0e53('0x12')];writeLog(_0x2d1b18,_0x16143f,util['format'](_0x0e53('0x13'),_0x4e846f));_0x5ebf60[_0x0e53('0x14')][_0x2d1b18]['on']('end',function(){logger['info'](_0x0e53('0x15'),_0x2d1b18);clearTimeout(_0x2ec61d);_0x2ec61d=undefined;_0x22ad5e[_0x0e53('0x16')]();if(_0x5ebf60['rules'][_0x2d1b18]){delete _0x5ebf60['rules'][_0x2d1b18];}_0x346f4f['stop']();});_0x5ebf60[_0x0e53('0x14')][_0x2d1b18]['on'](_0x0e53('0x17'),function(){if(_0x5ebf60[_0x0e53('0x14')][_0x2d1b18]){delete _0x5ebf60[_0x0e53('0x14')][_0x2d1b18];}});_0x2ec61d=setTimeout(function(){logger[_0x0e53('0x18')](_0x0e53('0x19'),_0x2d1b18);clearTimeout(_0x2ec61d);_0x22ad5e[_0x0e53('0x16')]();_0x346f4f[_0x0e53('0x1a')]();},_0x4e846f);strategy['agent'](_0x22ad5e,_0x16143f,_0x5ebf60,_0x14614b);}else{logger[_0x0e53('0x1b')](_0x0e53('0x1c'),_0x2d1b18,_0x5b3171[_0x0e53('0xb')]);_0x346f4f[_0x0e53('0x10')]();}}}catch(_0x3510f4){console[_0x0e53('0x1d')](_0x3510f4);logger[_0x0e53('0x1b')](_0x0e53('0x1e'),_0x2d1b18,_0x3510f4[_0x0e53('0x1f')]);_0x346f4f[_0x0e53('0x10')]();}};};
\ No newline at end of file
index 4640cad..b21faad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x810e=['interaction','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','out','channel','sms','phone','chat','ChatWebsiteId','upperFirst','created','isEmpty','body','getMustacheRender','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','toString','postText','error','message','amazonlex','providerResponse','create','dialogState','Failed','lodash','aws-sdk','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil'];(function(_0xcfe8cc,_0xb83aeb){var _0x55ac53=function(_0x4067d4){while(--_0x4067d4){_0xcfe8cc['push'](_0xcfe8cc['shift']());}};_0x55ac53(++_0xb83aeb);}(_0x810e,0xfe));var _0xe810=function(_0x5c0997,_0x13422c){_0x5c0997=_0x5c0997-0x0;var _0x5d79e2=_0x810e[_0x5c0997];return _0x5d79e2;};'use strict';var _=require(_0xe810('0x0'));var moment=require('moment');var AWS=require(_0xe810('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xe810('0x2')),'openchannelMessage':require(_0xe810('0x3')),'mailMessage':require(_0xe810('0x4')),'smsMessage':require(_0xe810('0x5')),'faxMessage':require(_0xe810('0x6')),'whatsappMessage':require(_0xe810('0x7'))};exports[_0xe810('0x8')]=function(_0x4e2f9a,_0x45a6d9){return function(_0x4df95e){try{if(!_[_0xe810('0x9')](this[_0xe810('0xa')]['UserId'])){logger['info'](_0xe810('0xb'),_0x4e2f9a,_0xe810('0xc'));return _0x4df95e[_0xe810('0xd')]();}var _0x327ac9={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xe810('0xe')};if(this[_0xe810('0xf')]===_0xe810('0x10')||this[_0xe810('0xf')]==='whatsapp'){_0x327ac9[_0xe810('0x11')]=this['interaction']['phone'];}var _0x1c6a69=this[_0xe810('0xf')];if(_0x1c6a69===_0xe810('0x12')){_0x327ac9[_0xe810('0x13')]=this['account']['id'];}else{_0x327ac9[_[_0xe810('0x14')](_0x1c6a69)+'AccountId']=this['account']['id'];}_0x327ac9[_[_0xe810('0x14')](_0x1c6a69)+'InteractionId']=this[_0xe810('0xa')]['id'];if(this[_0xe810('0xa')][_0xe810('0x15')]){var _0x255dba=_0x45a6d9[0x4];if(!_[_0xe810('0x16')](_0x255dba)){_0x327ac9[_0xe810('0x17')]=utils[_0xe810('0x18')](_0x255dba,this);return rpc[_0x1c6a69+'Message']['create'](_0x327ac9)[_0xe810('0x19')](function(_0x1da28e){logger['info'](_0xe810('0xb'),_0x4e2f9a,_0x327ac9['body']);})[_0xe810('0x1a')](function(_0x45fbf4){logger['error'](_0xe810('0xb'),_0x4e2f9a,JSON[_0xe810('0x1b')](_0x45fbf4));})[_0xe810('0x1c')](function(){logger['info'](_0xe810('0x1d'),_0x4e2f9a);_0x4df95e['stop']();});}else{logger[_0xe810('0x1e')](_0xe810('0x1f'),_0x4e2f9a);_0x4df95e[_0xe810('0x20')]();}}else{var _0xb03e24=this;var _0x57cc5a=new AWS[(_0xe810('0x21'))]({'accessKeyId':_0x45a6d9[0x0],'secretAccessKey':_0x45a6d9[0x1],'region':_0x45a6d9[0x2]});var _0xc1833e={'botAlias':_0xe810('0x22'),'botName':_0x45a6d9[0x3],'inputText':this['message']['body'],'userId':this[_0xe810('0xf')]+':'+this[_0xe810('0xa')]['id'][_0xe810('0x23')]()};_0x57cc5a[_0xe810('0x24')](_0xc1833e,function(_0x12a9e1,_0x4e74b2){if(_0x12a9e1){logger[_0xe810('0x25')](_0xe810('0xb'),_0x4e2f9a,_0x12a9e1[_0xe810('0x26')]);_0x4df95e[_0xe810('0xd')]();}else if(_0x4e74b2&&_0x4e74b2[_0xe810('0x26')]){_0xb03e24[_0xe810('0x17')][_0xe810('0x27')]=_0x4e74b2;_0x327ac9[_0xe810('0x17')]=_0x4e74b2[_0xe810('0x26')];_0x327ac9['providerName']=_0xe810('0x27');_0x327ac9[_0xe810('0x28')]=JSON[_0xe810('0x1b')](_0x4e74b2);return rpc[_0x1c6a69+'Message'][_0xe810('0x29')](_0x327ac9)[_0xe810('0x19')](function(_0x5208de){logger[_0xe810('0x1e')](_0xe810('0xb'),_0x4e2f9a,_0x327ac9['body']);if(_0x4e74b2[_0xe810('0x2a')]==_0xe810('0x2b')){_0x4df95e['next']();}else{_0x4df95e[_0xe810('0x20')]();}})[_0xe810('0x1a')](function(_0x4b5a4b){logger['error'](_0xe810('0xb'),_0x4e2f9a,JSON[_0xe810('0x1b')](_0x4b5a4b));_0x4df95e[_0xe810('0xd')]();});}else{_0x4df95e['next']();}});}}catch(_0x559638){logger[_0xe810('0x25')]('[%s][AMAZONLEX]\x20%s',_0x4e2f9a,JSON[_0xe810('0x1b')](_0x559638));_0x4df95e[_0xe810('0x20')]();}};};
\ No newline at end of file
+var _0xac21=['message','toString','next','providerName','amazonlex','providerResponse','dialogState','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','contact','format','out','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','info','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST'];(function(_0x2d8a23,_0x522080){var _0xd7bce1=function(_0x6adbdd){while(--_0x6adbdd){_0x2d8a23['push'](_0x2d8a23['shift']());}};_0xd7bce1(++_0x522080);}(_0xac21,0x97));var _0x1ac2=function(_0x5be218,_0x7f370){_0x5be218=_0x5be218-0x0;var _0x85ca43=_0xac21[_0x5be218];return _0x85ca43;};'use strict';var _=require('lodash');var moment=require(_0x1ac2('0x0'));var AWS=require(_0x1ac2('0x1'));var utils=require(_0x1ac2('0x2'));var logger=require(_0x1ac2('0x3'))(_0x1ac2('0x4'));var rpc={'chatMessage':require(_0x1ac2('0x5')),'openchannelMessage':require(_0x1ac2('0x6')),'mailMessage':require(_0x1ac2('0x7')),'smsMessage':require(_0x1ac2('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x1ac2('0x9'))};exports[_0x1ac2('0xa')]=function(_0x977257,_0x429ff5){return function(_0x5a7bc0){try{if(!_[_0x1ac2('0xb')](this[_0x1ac2('0xc')][_0x1ac2('0xd')])){logger['info'](_0x1ac2('0xe'),_0x977257,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5a7bc0['next']();}var _0x1052c4={'ContactId':this[_0x1ac2('0xf')]['id'],'sentAt':moment()[_0x1ac2('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1ac2('0x11')};if(this[_0x1ac2('0x12')]==='sms'||this[_0x1ac2('0x12')]===_0x1ac2('0x13')){_0x1052c4[_0x1ac2('0x14')]=this[_0x1ac2('0xc')][_0x1ac2('0x14')];}var _0x2282dd=this['channel'];if(_0x2282dd==='chat'){_0x1052c4['ChatWebsiteId']=this[_0x1ac2('0x15')]['id'];}else{_0x1052c4[_[_0x1ac2('0x16')](_0x2282dd)+_0x1ac2('0x17')]=this[_0x1ac2('0x15')]['id'];}_0x1052c4[_[_0x1ac2('0x16')](_0x2282dd)+_0x1ac2('0x18')]=this[_0x1ac2('0xc')]['id'];if(this[_0x1ac2('0xc')][_0x1ac2('0x19')]){var _0x5ceaa1=_0x429ff5[0x4];if(!_[_0x1ac2('0x1a')](_0x5ceaa1)){_0x1052c4[_0x1ac2('0x1b')]=utils[_0x1ac2('0x1c')](_0x5ceaa1,this);return rpc[_0x2282dd+_0x1ac2('0x1d')][_0x1ac2('0x1e')](_0x1052c4)[_0x1ac2('0x1f')](function(_0x3f3e9d){logger[_0x1ac2('0x20')](_0x1ac2('0xe'),_0x977257,_0x1052c4[_0x1ac2('0x1b')]);})[_0x1ac2('0x21')](function(_0xf1937f){logger[_0x1ac2('0x22')]('[%s][AMAZONLEX]\x20%s',_0x977257,JSON[_0x1ac2('0x23')](_0xf1937f));})[_0x1ac2('0x24')](function(){logger[_0x1ac2('0x20')](_0x1ac2('0x25'),_0x977257);_0x5a7bc0['stop']();});}else{logger[_0x1ac2('0x20')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x977257);_0x5a7bc0[_0x1ac2('0x26')]();}}else{var _0x199da0=this;var _0x500b80=new AWS[(_0x1ac2('0x27'))]({'accessKeyId':_0x429ff5[0x0],'secretAccessKey':_0x429ff5[0x1],'region':_0x429ff5[0x2]});var _0x4751a2={'botAlias':_0x1ac2('0x28'),'botName':_0x429ff5[0x3],'inputText':this[_0x1ac2('0x29')]['body'],'userId':this[_0x1ac2('0x12')]+':'+this['interaction']['id'][_0x1ac2('0x2a')]()};_0x500b80['postText'](_0x4751a2,function(_0x47b561,_0x5720c8){if(_0x47b561){logger[_0x1ac2('0x22')](_0x1ac2('0xe'),_0x977257,_0x47b561[_0x1ac2('0x29')]);_0x5a7bc0[_0x1ac2('0x2b')]();}else if(_0x5720c8&&_0x5720c8[_0x1ac2('0x29')]){_0x199da0[_0x1ac2('0x1b')]['amazonlex']=_0x5720c8;_0x1052c4[_0x1ac2('0x1b')]=_0x5720c8[_0x1ac2('0x29')];_0x1052c4[_0x1ac2('0x2c')]=_0x1ac2('0x2d');_0x1052c4[_0x1ac2('0x2e')]=JSON['stringify'](_0x5720c8);return rpc[_0x2282dd+_0x1ac2('0x1d')][_0x1ac2('0x1e')](_0x1052c4)[_0x1ac2('0x1f')](function(_0x32ce41){logger[_0x1ac2('0x20')](_0x1ac2('0xe'),_0x977257,_0x1052c4[_0x1ac2('0x1b')]);if(_0x5720c8[_0x1ac2('0x2f')]=='Failed'){_0x5a7bc0[_0x1ac2('0x2b')]();}else{_0x5a7bc0[_0x1ac2('0x26')]();}})['catch'](function(_0xfa6bc2){logger[_0x1ac2('0x22')](_0x1ac2('0xe'),_0x977257,JSON['stringify'](_0xfa6bc2));_0x5a7bc0[_0x1ac2('0x2b')]();});}else{_0x5a7bc0[_0x1ac2('0x2b')]();}});}}catch(_0x3a86f1){logger[_0x1ac2('0x22')]('[%s][AMAZONLEX]\x20%s',_0x977257,JSON[_0x1ac2('0x23')](_0x3a86f1));_0x5a7bc0[_0x1ac2('0x26')]();}};};
\ No newline at end of file
index 0f62b6c..0a773ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x388d=['phone','read','subject','startsWith','chat','ChatWebsiteId','upperFirst','AccountId','Message','account','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','auto-replied','All','auto_reply','sendMailMessage','then','messageId','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','body','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','message','from'];(function(_0x428c2a,_0x86699d){var _0x49b013=function(_0x53bff9){while(--_0x53bff9){_0x428c2a['push'](_0x428c2a['shift']());}};_0x49b013(++_0x86699d);}(_0x388d,0xc4));var _0xd388=function(_0xf08123,_0x5c3532){_0xf08123=_0xf08123-0x0;var _0x1af7d4=_0x388d[_0xf08123];return _0x1af7d4;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0xd388('0x0'));var logger=require(_0xd388('0x1'))(_0xd388('0x2'));var rpc={'chatMessage':require(_0xd388('0x3')),'openchannelMessage':require(_0xd388('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd388('0x5')),'faxMessage':require(_0xd388('0x6')),'whatsappMessage':require(_0xd388('0x7')),'chatInteraction':require(_0xd388('0x8')),'openchannelInteraction':require(_0xd388('0x9')),'mailInteraction':require(_0xd388('0xa')),'smsInteraction':require(_0xd388('0xb')),'faxInteraction':require(_0xd388('0xc')),'whatsappInteraction':require(_0xd388('0xd'))};var mailRpc=require(_0xd388('0xe'));exports[_0xd388('0xf')]=function(_0xcf763a,_0xa86396,_0x53a747,_0x62c5a9){return function(_0x1b5d5f){try{var _0xb596fc=this['channel'];if(_0xb596fc==='mail'&&_0x62c5a9[_0xd388('0x10')]['isAutoreply']){logger[_0xd388('0x11')]('[%s][AUTOREPLY]\x20%s',_0xcf763a,_0xd388('0x12'));return _0x1b5d5f['next']();}if(_0xa86396[0x0]==='1'&&(_['isNil'](this[_0xd388('0x13')][_0xd388('0x14')])||!this[_0xd388('0x13')][_0xd388('0x14')])){logger[_0xd388('0x11')](_0xd388('0x15'),_0xcf763a,_0xd388('0x16'));return _0x1b5d5f[_0xd388('0x17')]();}if(_0xa86396[0x0]==='2'&&this['interaction'][_0xd388('0x18')]){logger['info'](_0xd388('0x19'),_0xcf763a,'One\x20Time\x20already\x20sent');return _0x1b5d5f['next']();}var _0x1c1911={'ContactId':this[_0xd388('0x1a')]['id'],'sentAt':moment()[_0xd388('0x1b')](_0xd388('0x1c')),'direction':_0xd388('0x1d')};if(this[_0xd388('0x1e')]===_0xd388('0x1f')){_0x1c1911['body']=utils[_0xd388('0x20')](_0xa86396[0x2],this);}else{_0x1c1911[_0xd388('0x10')]=utils[_0xd388('0x20')](_0xa86396[0x1],this);}if(this[_0xd388('0x21')]){_0x1c1911['to']=this['message'][_0xd388('0x22')]||'';if(this[_0xd388('0x1e')]==='mail'&&_0xa86396[0x1]==='1'){_0x1c1911['cc']=this[_0xd388('0x21')]['cc']||'';}_0x1c1911['from']=this[_0xd388('0x21')]['to']||'';_0x1c1911[_0xd388('0x23')]=this['message'][_0xd388('0x23')]||'';_0x1c1911[_0xd388('0x24')]=!![];if(this[_0xd388('0x21')][_0xd388('0x25')]){_0x1c1911[_0xd388('0x25')]='';_0x1c1911[_0xd388('0x25')]+=_[_0xd388('0x26')](this[_0xd388('0x21')][_0xd388('0x25')],'Re:')?'':'Re:\x20';_0x1c1911[_0xd388('0x25')]+=this[_0xd388('0x21')][_0xd388('0x25')];}}if(this['channel']===_0xd388('0x27')){_0x1c1911[_0xd388('0x28')]=this['account']['id'];}else{_0x1c1911[_[_0xd388('0x29')](this[_0xd388('0x1e')])+_0xd388('0x2a')]=this['account']['id'];}_0x1c1911[_[_0xd388('0x29')](this[_0xd388('0x1e')])+'InteractionId']=this[_0xd388('0x13')]['id'];var _0x47cad9=this[_0xd388('0x13')];if(rpc[this[_0xd388('0x1e')]+_0xd388('0x2b')]){if(this[_0xd388('0x1e')]==='mail'){var _0x3ef6c9={'tls':{'rejectUnauthorized':![]}};if(this[_0xd388('0x2c')][_0xd388('0x2d')][_0xd388('0x2e')]){_0x3ef6c9[_0xd388('0x2e')]=this[_0xd388('0x2c')]['Smtp']['service'];}else{_0x3ef6c9[_0xd388('0x2f')]=this[_0xd388('0x2c')][_0xd388('0x2d')][_0xd388('0x2f')];_0x3ef6c9[_0xd388('0x30')]=this['account'][_0xd388('0x2d')][_0xd388('0x30')];_0x3ef6c9[_0xd388('0x31')]=this[_0xd388('0x2c')][_0xd388('0x2d')][_0xd388('0x31')];}if(this[_0xd388('0x2c')][_0xd388('0x2d')][_0xd388('0x32')]){_0x3ef6c9[_0xd388('0x33')]={'user':this['account'][_0xd388('0x2d')][_0xd388('0x34')],'pass':this['account']['Smtp'][_0xd388('0x35')]};}_0x1c1911[_0xd388('0x36')]=this[_0xd388('0x21')]['messageId'];_0x1c1911[_0xd388('0x37')]=_0xd388('0x38')+_[_0xd388('0x39')](_0x1c1911[_0xd388('0x10')],_0xd388('0x3a'),'<div')+_0xd388('0x3b');_0x1c1911['headers']={'Auto-Submitted':_0xd388('0x3c'),'X-Auto-Response-Suppress':_0xd388('0x3d'),'Precedence':_0xd388('0x3e')};return mailRpc[_0xd388('0x3f')](_0x3ef6c9,_0x1c1911)[_0xd388('0x40')](function(_0x77d048){logger[_0xd388('0x11')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0xcf763a);_0x1c1911[_0xd388('0x41')]=_0x77d048[_0xd388('0x21')][_0xd388('0x41')];return rpc[_0xb596fc+_0xd388('0x2b')][_0xd388('0x42')](_0x1c1911);})['then'](function(_0x587a60){logger['info'](_0xd388('0x15'),_0xcf763a,JSON[_0xd388('0x43')](_0x587a60));})['catch'](function(_0x1ff2dd){logger[_0xd388('0x44')](_0xd388('0x45'),_0xcf763a,JSON[_0xd388('0x43')](_0x1ff2dd));})[_0xd388('0x46')](function(){Promise[_0xd388('0x47')]()[_0xd388('0x40')](function(){if(_0xa86396[0x0]!=='2'||_0x47cad9['autoreplyExecuted'])return;return rpc[_0xb596fc+_0xd388('0x48')][_0xd388('0x49')](_0x47cad9['id'],{'autoreplyExecuted':!![]})[_0xd388('0x40')](function(_0x5f34bc){logger[_0xd388('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xcf763a,JSON[_0xd388('0x43')](_0x5f34bc));})[_0xd388('0x4a')](function(_0x1a902d){logger[_0xd388('0x44')](_0xd388('0x4b'),_0xcf763a,JSON[_0xd388('0x43')](_0x1a902d));});})[_0xd388('0x40')](function(){_0x1b5d5f[_0xd388('0x17')]();});});}else{return rpc[this[_0xd388('0x1e')]+_0xd388('0x2b')][_0xd388('0x42')](_0x1c1911)[_0xd388('0x40')](function(_0x172054){logger[_0xd388('0x11')](_0xd388('0x15'),_0xcf763a,_0x1c1911[_0xd388('0x10')]);})[_0xd388('0x4a')](function(_0x313605){logger['error'](_0xd388('0x15'),_0xcf763a,JSON[_0xd388('0x43')](_0x313605));})[_0xd388('0x46')](function(){Promise[_0xd388('0x47')]()[_0xd388('0x40')](function(){if(_0xa86396[0x0]!=='2'||_0x47cad9['autoreplyExecuted'])return;return rpc[_0xb596fc+'Interaction']['update'](_0x47cad9['id'],{'autoreplyExecuted':!![]})[_0xd388('0x40')](function(_0xbffaf8){logger[_0xd388('0x11')](_0xd388('0x19'),_0xcf763a,JSON[_0xd388('0x43')](_0xbffaf8));})['catch'](function(_0x21b775){logger[_0xd388('0x44')](_0xd388('0x4b'),_0xcf763a,JSON['stringify'](_0x21b775));});})['then'](function(){_0x1b5d5f[_0xd388('0x17')]();});});}}}catch(_0x3c0b1d){logger[_0xd388('0x44')]('[%s][AUTOREPLY]\x20%s',_0xcf763a,JSON[_0xd388('0x43')](_0x3c0b1d));_0x1b5d5f[_0xd388('0x4c')]();}};};
\ No newline at end of file
+var _0x38ee=['read','subject','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp','service','port','secure','auth','user','messageId','html','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','from','message','phone'];(function(_0x566ad4,_0x17b92b){var _0x3bdca3=function(_0x2f8afc){while(--_0x2f8afc){_0x566ad4['push'](_0x566ad4['shift']());}};_0x3bdca3(++_0x17b92b);}(_0x38ee,0x71));var _0xe38e=function(_0x2634a7,_0x118508){_0x2634a7=_0x2634a7-0x0;var _0xa52e2c=_0x38ee[_0x2634a7];return _0xa52e2c;};'use strict';var _=require(_0xe38e('0x0'));var moment=require('moment');var utils=require(_0xe38e('0x1'));var logger=require(_0xe38e('0x2'))('routing');var rpc={'chatMessage':require(_0xe38e('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xe38e('0x4')),'smsMessage':require(_0xe38e('0x5')),'faxMessage':require(_0xe38e('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xe38e('0x7')),'openchannelInteraction':require(_0xe38e('0x8')),'mailInteraction':require(_0xe38e('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xe38e('0xa')),'whatsappInteraction':require(_0xe38e('0xb'))};var mailRpc=require(_0xe38e('0xc'));exports[_0xe38e('0xd')]=function(_0x335290,_0x3f2faa,_0xef4e25,_0x475878){return function(_0x52b0a8){try{var _0x5af7c6=this[_0xe38e('0xe')];if(_0x5af7c6===_0xe38e('0xf')&&_0x475878[_0xe38e('0x10')][_0xe38e('0x11')]){logger[_0xe38e('0x12')](_0xe38e('0x13'),_0x335290,_0xe38e('0x14'));return _0x52b0a8[_0xe38e('0x15')]();}if(_0x3f2faa[0x0]==='1'&&(_[_0xe38e('0x16')](this[_0xe38e('0x17')][_0xe38e('0x18')])||!this[_0xe38e('0x17')][_0xe38e('0x18')])){logger['info'](_0xe38e('0x13'),_0x335290,_0xe38e('0x19'));return _0x52b0a8[_0xe38e('0x15')]();}if(_0x3f2faa[0x0]==='2'&&this['interaction'][_0xe38e('0x1a')]){logger['info'](_0xe38e('0x1b'),_0x335290,_0xe38e('0x1c'));return _0x52b0a8[_0xe38e('0x15')]();}var _0x358cfa={'ContactId':this[_0xe38e('0x1d')]['id'],'sentAt':moment()['format'](_0xe38e('0x1e')),'direction':'out'};if(this['channel']==='mail'){_0x358cfa['body']=utils[_0xe38e('0x1f')](_0x3f2faa[0x2],this);}else{_0x358cfa[_0xe38e('0x10')]=utils['getMustacheRender'](_0x3f2faa[0x1],this);}if(this['message']){_0x358cfa['to']=this['message'][_0xe38e('0x20')]||'';if(this[_0xe38e('0xe')]===_0xe38e('0xf')&&_0x3f2faa[0x1]==='1'){_0x358cfa['cc']=this['message']['cc']||'';}_0x358cfa['from']=this[_0xe38e('0x21')]['to']||'';_0x358cfa[_0xe38e('0x22')]=this[_0xe38e('0x21')][_0xe38e('0x22')]||'';_0x358cfa[_0xe38e('0x23')]=!![];if(this[_0xe38e('0x21')][_0xe38e('0x24')]){_0x358cfa['subject']='';_0x358cfa[_0xe38e('0x24')]+=_['startsWith'](this[_0xe38e('0x21')][_0xe38e('0x24')],_0xe38e('0x25'))?'':_0xe38e('0x26');_0x358cfa[_0xe38e('0x24')]+=this[_0xe38e('0x21')]['subject'];}}if(this['channel']===_0xe38e('0x27')){_0x358cfa[_0xe38e('0x28')]=this[_0xe38e('0x29')]['id'];}else{_0x358cfa[_[_0xe38e('0x2a')](this['channel'])+_0xe38e('0x2b')]=this[_0xe38e('0x29')]['id'];}_0x358cfa[_[_0xe38e('0x2a')](this[_0xe38e('0xe')])+_0xe38e('0x2c')]=this['interaction']['id'];var _0x40cd26=this[_0xe38e('0x17')];if(rpc[this[_0xe38e('0xe')]+_0xe38e('0x2d')]){if(this[_0xe38e('0xe')]==='mail'){var _0xcf488={'tls':{'rejectUnauthorized':![]}};if(this[_0xe38e('0x29')][_0xe38e('0x2e')][_0xe38e('0x2f')]){_0xcf488[_0xe38e('0x2f')]=this[_0xe38e('0x29')][_0xe38e('0x2e')][_0xe38e('0x2f')];}else{_0xcf488['host']=this[_0xe38e('0x29')][_0xe38e('0x2e')]['host'];_0xcf488[_0xe38e('0x30')]=this['account'][_0xe38e('0x2e')]['port'];_0xcf488[_0xe38e('0x31')]=this[_0xe38e('0x29')][_0xe38e('0x2e')][_0xe38e('0x31')];}if(this[_0xe38e('0x29')][_0xe38e('0x2e')]['authentication']){_0xcf488[_0xe38e('0x32')]={'user':this[_0xe38e('0x29')]['Smtp'][_0xe38e('0x33')],'pass':this[_0xe38e('0x29')][_0xe38e('0x2e')]['pass']};}_0x358cfa['inReplyTo']=this[_0xe38e('0x21')][_0xe38e('0x34')];_0x358cfa[_0xe38e('0x35')]='<div\x20id=\x22xm-mail-content\x22>'+_[_0xe38e('0x36')](_0x358cfa[_0xe38e('0x10')],_0xe38e('0x37'),_0xe38e('0x38'))+_0xe38e('0x39');_0x358cfa[_0xe38e('0x3a')]={'Auto-Submitted':_0xe38e('0x3b'),'X-Auto-Response-Suppress':_0xe38e('0x3c'),'Precedence':'auto_reply'};return mailRpc[_0xe38e('0x3d')](_0xcf488,_0x358cfa)[_0xe38e('0x3e')](function(_0x306d71){logger[_0xe38e('0x12')](_0xe38e('0x3f'),_0x335290);_0x358cfa[_0xe38e('0x34')]=_0x306d71[_0xe38e('0x21')]['messageId'];return rpc[_0x5af7c6+_0xe38e('0x2d')][_0xe38e('0x40')](_0x358cfa);})[_0xe38e('0x3e')](function(_0x48b7f9){logger['info'](_0xe38e('0x13'),_0x335290,JSON[_0xe38e('0x41')](_0x48b7f9));})[_0xe38e('0x42')](function(_0xfa8fd3){logger[_0xe38e('0x43')](_0xe38e('0x44'),_0x335290,JSON[_0xe38e('0x41')](_0xfa8fd3));})[_0xe38e('0x45')](function(){Promise['resolve']()[_0xe38e('0x3e')](function(){if(_0x3f2faa[0x0]!=='2'||_0x40cd26[_0xe38e('0x1a')])return;return rpc[_0x5af7c6+_0xe38e('0x46')][_0xe38e('0x47')](_0x40cd26['id'],{'autoreplyExecuted':!![]})['then'](function(_0x32c9df){logger[_0xe38e('0x12')](_0xe38e('0x1b'),_0x335290,JSON[_0xe38e('0x41')](_0x32c9df));})[_0xe38e('0x42')](function(_0x1dfea3){logger[_0xe38e('0x43')](_0xe38e('0x48'),_0x335290,JSON[_0xe38e('0x41')](_0x1dfea3));});})[_0xe38e('0x3e')](function(){_0x52b0a8['next']();});});}else{return rpc[this['channel']+_0xe38e('0x2d')]['create'](_0x358cfa)[_0xe38e('0x3e')](function(_0x3fbd72){logger[_0xe38e('0x12')](_0xe38e('0x13'),_0x335290,_0x358cfa[_0xe38e('0x10')]);})['catch'](function(_0xbc4fb5){logger['error'](_0xe38e('0x13'),_0x335290,JSON[_0xe38e('0x41')](_0xbc4fb5));})['finally'](function(){Promise['resolve']()[_0xe38e('0x3e')](function(){if(_0x3f2faa[0x0]!=='2'||_0x40cd26[_0xe38e('0x1a')])return;return rpc[_0x5af7c6+_0xe38e('0x46')][_0xe38e('0x47')](_0x40cd26['id'],{'autoreplyExecuted':!![]})[_0xe38e('0x3e')](function(_0x54808a){logger[_0xe38e('0x12')](_0xe38e('0x1b'),_0x335290,JSON['stringify'](_0x54808a));})[_0xe38e('0x42')](function(_0x687e){logger[_0xe38e('0x43')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x335290,JSON[_0xe38e('0x41')](_0x687e));});})[_0xe38e('0x3e')](function(){_0x52b0a8[_0xe38e('0x15')]();});});}}}catch(_0x5bd9e7){logger[_0xe38e('0x43')](_0xe38e('0x13'),_0x335290,JSON[_0xe38e('0x41')](_0x5bd9e7));_0x52b0a8[_0xe38e('0x49')]();}};};
\ No newline at end of file
index ea1a264..c698103 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d8b=['consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x9d8b,0x118));var _0xb9d8=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x9d8b[_0x257642];return _0x3d813b;};'use strict';var moment=require(_0xb9d8('0x0'));var logger=require(_0xb9d8('0x1'))(_0xb9d8('0x2'));var rpc={'chatInteraction':require(_0xb9d8('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xb9d8('0x4')),'mailInteraction':require(_0xb9d8('0x5')),'faxInteraction':require(_0xb9d8('0x6')),'whatsappInteraction':require(_0xb9d8('0x7'))};exports[_0xb9d8('0x8')]=function(_0x521af3,_0x4f0cb0,_0x441ba6,_0x389d9d){return function(_0x484361){try{logger[_0xb9d8('0x9')](_0xb9d8('0xa'),_0x521af3,_0x4f0cb0[0x0]);var _0xc2e786={'closed':0x1,'closedAt':moment()[_0xb9d8('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xb9d8('0xc'),'disposition':_0x4f0cb0[0x0]};if(rpc[_0x389d9d[_0xb9d8('0xd')]+_0xb9d8('0xe')]){rpc[_0x389d9d[_0xb9d8('0xd')]+_0xb9d8('0xe')][_0xb9d8('0xf')](_0x389d9d[_0xb9d8('0x10')]['id'],_0xc2e786)['then'](function(_0x203718){logger[_0xb9d8('0x9')](_0xb9d8('0x11'),_0x521af3,_0x389d9d['interaction']['id']);})[_0xb9d8('0x12')](function(_0x2733a5){logger[_0xb9d8('0x13')](_0xb9d8('0x14'),_0x521af3,JSON[_0xb9d8('0x15')](_0x2733a5));})[_0xb9d8('0x16')](function(){_0x484361[_0xb9d8('0x17')]();});}}catch(_0x3629db){logger[_0xb9d8('0x13')](_0xb9d8('0x14'),_0x521af3,JSON[_0xb9d8('0x15')](_0x3629db));_0x484361['stop']();}};};
\ No newline at end of file
+var _0x7748=['error','[%s][CLOSE]\x20%s','stringify','stop','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!'];(function(_0x5ec8c,_0x413d66){var _0x16cc20=function(_0x1e1277){while(--_0x1e1277){_0x5ec8c['push'](_0x5ec8c['shift']());}};_0x16cc20(++_0x413d66);}(_0x7748,0x16c));var _0x8774=function(_0x2d4359,_0x8201a9){_0x2d4359=_0x2d4359-0x0;var _0x556474=_0x7748[_0x2d4359];return _0x556474;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x8774('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x8774('0x1')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8774('0x2')),'whatsappInteraction':require(_0x8774('0x3'))};exports[_0x8774('0x4')]=function(_0x498335,_0x354338,_0x6f41b8,_0xb0c875){return function(_0x165161){try{logger[_0x8774('0x5')]('[%s][CLOSE]\x20reason\x20%s',_0x498335,_0x354338[0x0]);var _0x5e2fed={'closed':0x1,'closedAt':moment()[_0x8774('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x8774('0x7'),'disposition':_0x354338[0x0]};if(rpc[_0xb0c875[_0x8774('0x8')]+_0x8774('0x9')]){rpc[_0xb0c875[_0x8774('0x8')]+_0x8774('0x9')][_0x8774('0xa')](_0xb0c875[_0x8774('0xb')]['id'],_0x5e2fed)[_0x8774('0xc')](function(_0x16a72d){logger[_0x8774('0x5')](_0x8774('0xd'),_0x498335,_0xb0c875['interaction']['id']);})['catch'](function(_0xffcdd6){logger[_0x8774('0xe')](_0x8774('0xf'),_0x498335,JSON[_0x8774('0x10')](_0xffcdd6));})['finally'](function(){_0x165161[_0x8774('0x11')]();});}}catch(_0x315c2f){logger[_0x8774('0xe')](_0x8774('0xf'),_0x498335,JSON[_0x8774('0x10')](_0x315c2f));_0x165161['stop']();}};};
\ No newline at end of file
index 41fc0b4..4c420b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36f3=['then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','dialogflow','fulfillment','speech','providerName','Message','result','metadata','endConversation','catch','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','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','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','create'];(function(_0x57e7d5,_0x41f3ea){var _0xa36637=function(_0x5ac237){while(--_0x5ac237){_0x57e7d5['push'](_0x57e7d5['shift']());}};_0xa36637(++_0x41f3ea);}(_0x36f3,0xe6));var _0x336f=function(_0x10cf5d,_0x396a02){_0x10cf5d=_0x10cf5d-0x0;var _0x5b9d4b=_0x36f3[_0x10cf5d];return _0x5b9d4b;};'use strict';var _=require('lodash');var moment=require(_0x336f('0x0'));var apiai=require(_0x336f('0x1'));var md5=require(_0x336f('0x2'));var utils=require(_0x336f('0x3'));var logger=require(_0x336f('0x4'))(_0x336f('0x5'));var rpc={'chatMessage':require(_0x336f('0x6')),'openchannelMessage':require(_0x336f('0x7')),'mailMessage':require(_0x336f('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x336f('0x9')),'whatsappMessage':require(_0x336f('0xa'))};exports[_0x336f('0xb')]=function(_0x4ef72f,_0x56100c){return function(_0x3963d1){try{if(!_[_0x336f('0xc')](this[_0x336f('0xd')][_0x336f('0xe')])){logger[_0x336f('0xf')](_0x336f('0x10'),_0x4ef72f,_0x336f('0x11'));return _0x3963d1[_0x336f('0x12')]();}var _0x575df4={'ContactId':this[_0x336f('0x13')]['id'],'sentAt':moment()[_0x336f('0x14')](_0x336f('0x15')),'direction':_0x336f('0x16')};if(this['channel']==='sms'||this[_0x336f('0x17')]==='whatsapp'){_0x575df4[_0x336f('0x18')]=this[_0x336f('0xd')]['phone'];}var _0x1770e1=this[_0x336f('0x17')];if(_0x1770e1===_0x336f('0x19')){_0x575df4[_0x336f('0x1a')]=this[_0x336f('0x1b')]['id'];}else{_0x575df4[_[_0x336f('0x1c')](_0x1770e1)+_0x336f('0x1d')]=this['account']['id'];}_0x575df4[_[_0x336f('0x1c')](_0x1770e1)+_0x336f('0x1e')]=this[_0x336f('0xd')]['id'];if(this[_0x336f('0xd')]['created']){var _0x128024=_0x56100c[0x2];if(!_[_0x336f('0x1f')](_0x128024)){_0x575df4[_0x336f('0x20')]=utils[_0x336f('0x21')](_0x128024,this);return rpc[_0x1770e1+'Message'][_0x336f('0x22')](_0x575df4)[_0x336f('0x23')](function(_0x5d1eec){logger[_0x336f('0xf')](_0x336f('0x10'),_0x4ef72f,_0x575df4[_0x336f('0x20')]);})['catch'](function(_0x1eb065){logger[_0x336f('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x4ef72f,JSON[_0x336f('0x25')](_0x1eb065));})[_0x336f('0x26')](function(){logger[_0x336f('0xf')](_0x336f('0x27'),_0x4ef72f);_0x3963d1['stop']();});}else{logger[_0x336f('0xf')](_0x336f('0x28'),_0x4ef72f);_0x3963d1[_0x336f('0x29')]();}}else{var _0x2031b3=this;var _0x175637=apiai(_0x56100c[0x0],{'language':_0x56100c[0x1]||'en'});return _0x175637[_0x336f('0x2a')](this[_0x336f('0x2b')][_0x336f('0x20')],{'sessionId':md5(this[_0x336f('0xd')]['id'])})[_0x336f('0x23')](function(_0x1a6e60){_0x2031b3[_0x336f('0x20')][_0x336f('0x2c')]=_0x1a6e60;_0x575df4['body']=_0x1a6e60['result'][_0x336f('0x2d')][_0x336f('0x2e')];_0x575df4[_0x336f('0x2f')]=_0x336f('0x2c');_0x575df4['providerResponse']=JSON[_0x336f('0x25')](_0x1a6e60);return rpc[_0x1770e1+_0x336f('0x30')][_0x336f('0x22')](_0x575df4)['then'](function(_0x11f89e){logger[_0x336f('0xf')](_0x336f('0x10'),_0x4ef72f,_0x575df4['body']);if(_0x1a6e60[_0x336f('0x31')][_0x336f('0x32')][_0x336f('0x33')]){_0x3963d1[_0x336f('0x12')]();}else{_0x3963d1[_0x336f('0x29')]();}})[_0x336f('0x34')](function(_0x5d5684){logger['error'](_0x336f('0x10'),_0x4ef72f,JSON[_0x336f('0x25')](_0x5d5684));_0x3963d1[_0x336f('0x12')]();});})[_0x336f('0x34')](function(_0x30b5b3){logger[_0x336f('0x24')](_0x336f('0x10'),_0x4ef72f,_0x30b5b3['message']);_0x3963d1[_0x336f('0x12')]();});}}catch(_0xd0e857){logger[_0x336f('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x4ef72f,JSON['stringify'](_0xd0e857));_0x3963d1[_0x336f('0x29')]();}};};
\ No newline at end of file
+var _0x78d3=['[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','dialogflow','result','speech','providerName','providerResponse','stringify','create','metadata','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','Message','then','catch','error'];(function(_0x1c28a0,_0x21a309){var _0x106434=function(_0x4b362a){while(--_0x4b362a){_0x1c28a0['push'](_0x1c28a0['shift']());}};_0x106434(++_0x21a309);}(_0x78d3,0x73));var _0x378d=function(_0x349f12,_0x424402){_0x349f12=_0x349f12-0x0;var _0x598967=_0x78d3[_0x349f12];return _0x598967;};'use strict';var _=require(_0x378d('0x0'));var moment=require(_0x378d('0x1'));var apiai=require(_0x378d('0x2'));var md5=require(_0x378d('0x3'));var utils=require(_0x378d('0x4'));var logger=require(_0x378d('0x5'))(_0x378d('0x6'));var rpc={'chatMessage':require(_0x378d('0x7')),'openchannelMessage':require(_0x378d('0x8')),'mailMessage':require(_0x378d('0x9')),'smsMessage':require(_0x378d('0xa')),'faxMessage':require(_0x378d('0xb')),'whatsappMessage':require(_0x378d('0xc'))};exports[_0x378d('0xd')]=function(_0x47a99f,_0x4fef30){return function(_0x1c880e){try{if(!_['isNil'](this[_0x378d('0xe')][_0x378d('0xf')])){logger[_0x378d('0x10')](_0x378d('0x11'),_0x47a99f,_0x378d('0x12'));return _0x1c880e[_0x378d('0x13')]();}var _0x53a4b6={'ContactId':this[_0x378d('0x14')]['id'],'sentAt':moment()[_0x378d('0x15')](_0x378d('0x16')),'direction':'out'};if(this[_0x378d('0x17')]==='sms'||this['channel']===_0x378d('0x18')){_0x53a4b6[_0x378d('0x19')]=this['interaction'][_0x378d('0x19')];}var _0x10d0aa=this[_0x378d('0x17')];if(_0x10d0aa==='chat'){_0x53a4b6[_0x378d('0x1a')]=this['account']['id'];}else{_0x53a4b6[_[_0x378d('0x1b')](_0x10d0aa)+_0x378d('0x1c')]=this[_0x378d('0x1d')]['id'];}_0x53a4b6[_[_0x378d('0x1b')](_0x10d0aa)+_0x378d('0x1e')]=this['interaction']['id'];if(this[_0x378d('0xe')]['created']){var _0x2f24dc=_0x4fef30[0x2];if(!_[_0x378d('0x1f')](_0x2f24dc)){_0x53a4b6[_0x378d('0x20')]=utils[_0x378d('0x21')](_0x2f24dc,this);return rpc[_0x10d0aa+_0x378d('0x22')]['create'](_0x53a4b6)[_0x378d('0x23')](function(_0x4b54c7){logger[_0x378d('0x10')](_0x378d('0x11'),_0x47a99f,_0x53a4b6[_0x378d('0x20')]);})[_0x378d('0x24')](function(_0x1ffbaf){logger[_0x378d('0x25')](_0x378d('0x11'),_0x47a99f,JSON['stringify'](_0x1ffbaf));})['finally'](function(){logger[_0x378d('0x10')](_0x378d('0x26'),_0x47a99f);_0x1c880e['stop']();});}else{logger[_0x378d('0x10')](_0x378d('0x27'),_0x47a99f);_0x1c880e[_0x378d('0x28')]();}}else{var _0x1339fb=this;var _0x3acdf9=apiai(_0x4fef30[0x0],{'language':_0x4fef30[0x1]||'en'});return _0x3acdf9['textRequest'](this[_0x378d('0x29')]['body'],{'sessionId':md5(this[_0x378d('0xe')]['id'])})[_0x378d('0x23')](function(_0x3f2ebc){_0x1339fb['body'][_0x378d('0x2a')]=_0x3f2ebc;_0x53a4b6[_0x378d('0x20')]=_0x3f2ebc[_0x378d('0x2b')]['fulfillment'][_0x378d('0x2c')];_0x53a4b6[_0x378d('0x2d')]=_0x378d('0x2a');_0x53a4b6[_0x378d('0x2e')]=JSON[_0x378d('0x2f')](_0x3f2ebc);return rpc[_0x10d0aa+_0x378d('0x22')][_0x378d('0x30')](_0x53a4b6)[_0x378d('0x23')](function(_0x5724f9){logger['info'](_0x378d('0x11'),_0x47a99f,_0x53a4b6['body']);if(_0x3f2ebc[_0x378d('0x2b')][_0x378d('0x31')][_0x378d('0x32')]){_0x1c880e[_0x378d('0x13')]();}else{_0x1c880e['stop']();}})['catch'](function(_0x3de1af){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x47a99f,JSON['stringify'](_0x3de1af));_0x1c880e[_0x378d('0x13')]();});})['catch'](function(_0x4d1de5){logger[_0x378d('0x25')]('[%s][DIALOGFLOW]\x20%s',_0x47a99f,_0x4d1de5[_0x378d('0x29')]);_0x1c880e[_0x378d('0x13')]();});}}catch(_0x2fa358){logger['error'](_0x378d('0x11'),_0x47a99f,JSON[_0x378d('0x2f')](_0x2fa358));_0x1c880e[_0x378d('0x28')]();}};};
\ No newline at end of file
index b2d506d..160a8f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dcc=['DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','catch','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','Message','create','info','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','then','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','boolValue'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x6dcc,0xa6));var _0xc6dc=function(_0x10f24f,_0x111448){_0x10f24f=_0x10f24f-0x0;var _0x412ad2=_0x6dcc[_0x10f24f];return _0x412ad2;};'use strict';var _=require(_0xc6dc('0x0'));var dialogflow=require(_0xc6dc('0x1'));var md5=require(_0xc6dc('0x2'));var moment=require(_0xc6dc('0x3'));var Promise=require(_0xc6dc('0x4'));var logger=require(_0xc6dc('0x5'))(_0xc6dc('0x6'));var utils=require(_0xc6dc('0x7'));var rpc={'chatMessage':require(_0xc6dc('0x8')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc6dc('0x9')),'smsMessage':require(_0xc6dc('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xc6dc('0xb'))};function createMessage(_0x4ee80e,_0x3fde47,_0xd848bc,_0x1cda56){return new Promise(function(_0x2cad34,_0x4c26c3){var _0x697fb3=_[_0xc6dc('0xc')](_0xd848bc);_0x697fb3['body']=_0x1cda56;return rpc[_0x3fde47+_0xc6dc('0xd')][_0xc6dc('0xe')](_0x697fb3)['then'](function(){logger[_0xc6dc('0xf')](_0xc6dc('0x10'),_0x4ee80e,_0x697fb3['body']);_0x2cad34();})['catch'](function(_0x139815){logger['error'](_0xc6dc('0x10'),_0x4ee80e,JSON[_0xc6dc('0x11')](_0x139815));_0x4c26c3(_0x139815);});});}exports[_0xc6dc('0x12')]=function(_0x3a7f80,_0x3db086){return function(_0xfe833c){try{if(!_[_0xc6dc('0x13')](this[_0xc6dc('0x14')][_0xc6dc('0x15')])){logger[_0xc6dc('0xf')](_0xc6dc('0x10'),_0x3a7f80,_0xc6dc('0x16'));return _0xfe833c[_0xc6dc('0x17')]();}var _0x452ff5={'ContactId':this[_0xc6dc('0x18')]['id'],'sentAt':moment()[_0xc6dc('0x19')](_0xc6dc('0x1a')),'direction':'out'};if(this[_0xc6dc('0x1b')]===_0xc6dc('0x1c')||this[_0xc6dc('0x1b')]===_0xc6dc('0x1d')){_0x452ff5[_0xc6dc('0x1e')]=this[_0xc6dc('0x14')][_0xc6dc('0x1e')];}var _0x3caacc=this[_0xc6dc('0x1b')];if(_0x3caacc===_0xc6dc('0x1f')){_0x452ff5[_0xc6dc('0x20')]=this[_0xc6dc('0x21')]['id'];}else{_0x452ff5[_[_0xc6dc('0x22')](_0x3caacc)+_0xc6dc('0x23')]=this[_0xc6dc('0x21')]['id'];}_0x452ff5[_[_0xc6dc('0x22')](_0x3caacc)+_0xc6dc('0x24')]=this['interaction']['id'];if(this[_0xc6dc('0x14')][_0xc6dc('0x25')]){var _0x2735ca=_0x3db086[0x4];if(!_[_0xc6dc('0x26')](_0x2735ca)){_0x452ff5[_0xc6dc('0x27')]=utils[_0xc6dc('0x28')](_0x2735ca,this);return rpc[_0x3caacc+_0xc6dc('0xd')][_0xc6dc('0xe')](_0x452ff5)[_0xc6dc('0x29')](function(_0x38b189){logger[_0xc6dc('0xf')](_0xc6dc('0x10'),_0x3a7f80,_0x452ff5[_0xc6dc('0x27')]);})['catch'](function(_0x19cf48){logger[_0xc6dc('0x2a')](_0xc6dc('0x10'),_0x3a7f80,JSON[_0xc6dc('0x11')](_0x19cf48));})[_0xc6dc('0x2b')](function(){logger[_0xc6dc('0xf')](_0xc6dc('0x2c'),_0x3a7f80);_0xfe833c[_0xc6dc('0x2d')]();});}else{logger[_0xc6dc('0xf')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3a7f80);_0xfe833c[_0xc6dc('0x2d')]();}}else{var _0x42175d=this;var _0x2aed92=_0x3db086[0x2][_0xc6dc('0x2e')](/\\n/g,'\x0a');var _0x1b0484={'credentials':{'private_key':_0x2aed92,'client_email':_0x3db086[0x1]}};var _0x560f67=new dialogflow['SessionsClient'](_0x1b0484);var _0x3af73a=_0x560f67[_0xc6dc('0x2f')](_0x3db086[0x0],md5(_0x42175d['interaction']['id']));var _0x3cb082={'session':_0x3af73a,'queryInput':{'text':{'text':_0x42175d[_0xc6dc('0x30')][_0xc6dc('0x27')],'languageCode':_0x3db086[0x3]||'en'}}};return _0x560f67[_0xc6dc('0x31')](_0x3cb082)[_0xc6dc('0x29')](function(_0x425313){if(_0x425313&&_0x425313['length']){_0x42175d['body'][_0xc6dc('0x32')]=_0x425313;var _0x46f4b1=_0x425313[0x0];var _0x539fa6=_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x34')]&&_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x34')][_0xc6dc('0x35')]?_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x34')][_0xc6dc('0x35')][_0xc6dc('0x36')]['boolValue']:![];_0x42175d[_0xc6dc('0x27')][_0xc6dc('0x37')]=_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x38')];_0x42175d['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x46f4b1[_0xc6dc('0x33')]['allRequiredParamsPresent'];_0x42175d[_0xc6dc('0x27')][_0xc6dc('0x39')]=_0x46f4b1[_0xc6dc('0x33')]['diagnosticInfo']&&_0x46f4b1[_0xc6dc('0x33')]['diagnosticInfo'][_0xc6dc('0x35')]?_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x34')][_0xc6dc('0x35')][_0xc6dc('0x36')][_0xc6dc('0x3a')]:![];_0x42175d['body'][_0xc6dc('0x3b')]=_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x3c')][_0xc6dc('0x3d')];_0x42175d['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x46f4b1['queryResult'][_0xc6dc('0x3c')]['displayName'];_0x42175d[_0xc6dc('0x27')][_0xc6dc('0x3e')]=_0x46f4b1['queryResult'][_0xc6dc('0x3c')][_0xc6dc('0x3f')];_0x42175d[_0xc6dc('0x27')][_0xc6dc('0x40')]=_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x41')];_0x42175d[_0xc6dc('0x27')][_0xc6dc('0x42')]=_0x46f4b1[_0xc6dc('0x33')][_0xc6dc('0x43')];_0x42175d['body'][_0xc6dc('0x44')]=_0x46f4b1['queryResult']['intentDetectionConfidence'];_0x452ff5[_0xc6dc('0x45')]=_0xc6dc('0x32');_0x452ff5[_0xc6dc('0x46')]=JSON[_0xc6dc('0x11')](_0x425313);var _0x36381f=[];for(var _0x418764=0x0;_0x418764<_0x425313['length'];_0x418764++){var _0x49f850=_0x425313[_0x418764];if(_0x49f850&&_0x49f850[_0xc6dc('0x33')]&&_0x49f850[_0xc6dc('0x33')][_0xc6dc('0x47')]){_0x36381f[_0xc6dc('0x48')](createMessage(_0x3a7f80,_0x3caacc,_0x452ff5,_0x49f850[_0xc6dc('0x33')][_0xc6dc('0x47')]));}}return Promise[_0xc6dc('0x49')](_0x36381f)[_0xc6dc('0x29')](function(){if(_0x539fa6){_0xfe833c['next']();}else{_0xfe833c['stop']();}})[_0xc6dc('0x4a')](function(_0x20bcf5){logger[_0xc6dc('0x2a')](_0xc6dc('0x10'),_0x3a7f80,JSON[_0xc6dc('0x11')](_0x20bcf5));_0xfe833c[_0xc6dc('0x17')]();});}})[_0xc6dc('0x4a')](function(_0x2cd1ed){logger['error'](_0xc6dc('0x10'),_0x3a7f80,_0x2cd1ed[_0xc6dc('0x30')]);_0xfe833c[_0xc6dc('0x17')]();});}}catch(_0xc7cb1f){logger[_0xc6dc('0x2a')](_0xc6dc('0x10'),_0x3a7f80,JSON[_0xc6dc('0x11')](_0xc7cb1f));_0xfe833c[_0xc6dc('0x2d')]();}};};
\ No newline at end of file
+var _0xde0f=['intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','push','next','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','interaction','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','finally','stop','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xde0f,0xa2));var _0xfde0=function(_0x6a56af,_0x54b920){_0x6a56af=_0x6a56af-0x0;var _0x3d3aa4=_0xde0f[_0x6a56af];return _0x3d3aa4;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0xfde0('0x0'));var moment=require(_0xfde0('0x1'));var Promise=require(_0xfde0('0x2'));var logger=require(_0xfde0('0x3'))(_0xfde0('0x4'));var utils=require('./utils');var rpc={'chatMessage':require(_0xfde0('0x5')),'openchannelMessage':require(_0xfde0('0x6')),'mailMessage':require(_0xfde0('0x7')),'smsMessage':require(_0xfde0('0x8')),'faxMessage':require(_0xfde0('0x9')),'whatsappMessage':require(_0xfde0('0xa'))};function createMessage(_0x19fd5f,_0x333cc,_0x26a9e0,_0x331f59){return new Promise(function(_0x242d86,_0x46da7c){var _0x8be1bc=_['clone'](_0x26a9e0);_0x8be1bc[_0xfde0('0xb')]=_0x331f59;return rpc[_0x333cc+_0xfde0('0xc')][_0xfde0('0xd')](_0x8be1bc)[_0xfde0('0xe')](function(){logger['info'](_0xfde0('0xf'),_0x19fd5f,_0x8be1bc[_0xfde0('0xb')]);_0x242d86();})[_0xfde0('0x10')](function(_0x3d2476){logger[_0xfde0('0x11')](_0xfde0('0xf'),_0x19fd5f,JSON[_0xfde0('0x12')](_0x3d2476));_0x46da7c(_0x3d2476);});});}exports[_0xfde0('0x13')]=function(_0x59de6c,_0x29023f){return function(_0x9accee){try{if(!_[_0xfde0('0x14')](this['interaction'][_0xfde0('0x15')])){logger[_0xfde0('0x16')]('[%s][DIALOGFLOWV2]\x20%s',_0x59de6c,_0xfde0('0x17'));return _0x9accee['next']();}var _0x239e69={'ContactId':this[_0xfde0('0x18')]['id'],'sentAt':moment()[_0xfde0('0x19')](_0xfde0('0x1a')),'direction':_0xfde0('0x1b')};if(this[_0xfde0('0x1c')]==='sms'||this['channel']===_0xfde0('0x1d')){_0x239e69['phone']=this[_0xfde0('0x1e')][_0xfde0('0x1f')];}var _0x35d503=this[_0xfde0('0x1c')];if(_0x35d503==='chat'){_0x239e69[_0xfde0('0x20')]=this[_0xfde0('0x21')]['id'];}else{_0x239e69[_['upperFirst'](_0x35d503)+_0xfde0('0x22')]=this[_0xfde0('0x21')]['id'];}_0x239e69[_[_0xfde0('0x23')](_0x35d503)+_0xfde0('0x24')]=this['interaction']['id'];if(this[_0xfde0('0x1e')]['created']){var _0x203558=_0x29023f[0x4];if(!_[_0xfde0('0x25')](_0x203558)){_0x239e69[_0xfde0('0xb')]=utils['getMustacheRender'](_0x203558,this);return rpc[_0x35d503+_0xfde0('0xc')]['create'](_0x239e69)[_0xfde0('0xe')](function(_0x14488e){logger[_0xfde0('0x16')](_0xfde0('0xf'),_0x59de6c,_0x239e69[_0xfde0('0xb')]);})[_0xfde0('0x10')](function(_0x4fd7d2){logger[_0xfde0('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x59de6c,JSON[_0xfde0('0x12')](_0x4fd7d2));})[_0xfde0('0x26')](function(){logger[_0xfde0('0x16')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x59de6c);_0x9accee['stop']();});}else{logger[_0xfde0('0x16')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x59de6c);_0x9accee[_0xfde0('0x27')]();}}else{var _0x35b18f=this;var _0x3a953a=_0x29023f[0x2]['replace'](/\\n/g,'\x0a');var _0x45d7a3={'credentials':{'private_key':_0x3a953a,'client_email':_0x29023f[0x1]}};var _0x3a2bb3=new dialogflow[(_0xfde0('0x28'))](_0x45d7a3);var _0x2654a2=_0x3a2bb3[_0xfde0('0x29')](_0x29023f[0x0],md5(_0x35b18f[_0xfde0('0x1e')]['id']));var _0x3e4cb8={'session':_0x2654a2,'queryInput':{'text':{'text':_0x35b18f[_0xfde0('0x2a')][_0xfde0('0xb')],'languageCode':_0x29023f[0x3]||'en'}}};return _0x3a2bb3[_0xfde0('0x2b')](_0x3e4cb8)[_0xfde0('0xe')](function(_0xc2fcb0){if(_0xc2fcb0&&_0xc2fcb0[_0xfde0('0x2c')]){_0x35b18f[_0xfde0('0xb')][_0xfde0('0x2d')]=_0xc2fcb0;var _0x5b411d=_0xc2fcb0[0x0];var _0x371ba9=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x2f')]&&_0x5b411d[_0xfde0('0x2e')]['diagnosticInfo']['fields']?_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x2f')][_0xfde0('0x30')][_0xfde0('0x31')][_0xfde0('0x32')]:![];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x33')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x34')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x35')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x36')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x37')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x2f')]&&_0x5b411d[_0xfde0('0x2e')]['diagnosticInfo'][_0xfde0('0x30')]?_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x2f')][_0xfde0('0x30')][_0xfde0('0x31')]['boolValue']:![];_0x35b18f['body'][_0xfde0('0x38')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x39')][_0xfde0('0x3a')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x3b')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x39')][_0xfde0('0x3c')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x3d')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x39')][_0xfde0('0x3e')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x3f')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x40')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x41')]=_0x5b411d['queryResult'][_0xfde0('0x42')];_0x35b18f[_0xfde0('0xb')][_0xfde0('0x43')]=_0x5b411d[_0xfde0('0x2e')][_0xfde0('0x44')];_0x239e69[_0xfde0('0x45')]=_0xfde0('0x2d');_0x239e69['providerResponse']=JSON[_0xfde0('0x12')](_0xc2fcb0);var _0x4d4658=[];for(var _0x223dcf=0x0;_0x223dcf<_0xc2fcb0[_0xfde0('0x2c')];_0x223dcf++){var _0xc7fa8d=_0xc2fcb0[_0x223dcf];if(_0xc7fa8d&&_0xc7fa8d['queryResult']&&_0xc7fa8d[_0xfde0('0x2e')][_0xfde0('0x46')]){_0x4d4658[_0xfde0('0x47')](createMessage(_0x59de6c,_0x35d503,_0x239e69,_0xc7fa8d['queryResult'][_0xfde0('0x46')]));}}return Promise['all'](_0x4d4658)[_0xfde0('0xe')](function(){if(_0x371ba9){_0x9accee[_0xfde0('0x48')]();}else{_0x9accee['stop']();}})[_0xfde0('0x10')](function(_0x1e3e6a){logger['error'](_0xfde0('0xf'),_0x59de6c,JSON[_0xfde0('0x12')](_0x1e3e6a));_0x9accee[_0xfde0('0x48')]();});}})[_0xfde0('0x10')](function(_0x30fa1b){logger[_0xfde0('0x11')](_0xfde0('0xf'),_0x59de6c,_0x30fa1b[_0xfde0('0x2a')]);_0x9accee[_0xfde0('0x48')]();});}}catch(_0x4f2bc0){logger[_0xfde0('0x11')](_0xfde0('0xf'),_0x59de6c,JSON[_0xfde0('0x12')](_0x4f2bc0));_0x9accee[_0xfde0('0x27')]();}};};
\ No newline at end of file
index 6289f9a..7804670 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5bb=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','replace','error','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x1e5c16,_0x31b3f2){var _0x12b5c7=function(_0x54ddfb){while(--_0x54ddfb){_0x1e5c16['push'](_0x1e5c16['shift']());}};_0x12b5c7(++_0x31b3f2);}(_0xd5bb,0xd2));var _0xbd5b=function(_0x361b4f,_0x3a9c1d){_0x361b4f=_0x361b4f-0x0;var _0x62bb09=_0xd5bb[_0x361b4f];return _0x62bb09;};'use strict';var schema=require(_0xbd5b('0x0'));var _=require(_0xbd5b('0x1'));var htmlToText=require(_0xbd5b('0x2'));var utils=require(_0xbd5b('0x3'));var logger=require('../../../../config/logger')(_0xbd5b('0x4'));var gotoif=schema({'condition':{'type':_0xbd5b('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xbd5b('0x6'),'message':_0xbd5b('0x7')},'priorityFalse':{'type':_0xbd5b('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xbd5b('0x8')]=function(_0x562da7,_0x4d107f){return function(_0x2e06c3){try{var _0x5b0f28={'condition':htmlToText[_0xbd5b('0x9')](utils['getMustacheRender'](_0x4d107f[0x0],this),{'wordwrap':![]})[_0xbd5b('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4d107f[0x1],'priorityFalse':_0x4d107f[0x2]};var _0x3749fa=gotoif['validate'](_0x5b0f28,{'typecast':!![]});if(_0x3749fa['length']){logger[_0xbd5b('0xb')]('[%s][GOTOIF]\x20%s',_0x562da7,_[_0xbd5b('0xc')](_0x3749fa,_0xbd5b('0xd'))[_0xbd5b('0xe')](',\x20'));_0x2e06c3[_0xbd5b('0xf')]();}else{try{var _0x1c0dbc=eval('('+_0x5b0f28[_0xbd5b('0x10')]+')');var _0x3ec783=_0x1c0dbc?_0x5b0f28[_0xbd5b('0x11')]:_0x5b0f28[_0xbd5b('0x12')];logger['info'](_0xbd5b('0x13'),_0x562da7,_0x5b0f28[_0xbd5b('0x10')],_0x1c0dbc,_0x3ec783||_0xbd5b('0x14'));if(_0x3ec783){var _0x5c5752=_[_0xbd5b('0x15')](_0x2e06c3['rules'](),{'p':_0x3ec783});if(_0x5c5752>=0x0){logger[_0xbd5b('0x16')](_0xbd5b('0x17'),_0x562da7,_0x3ec783||_0xbd5b('0x14'),_0x5c5752);_0x2e06c3[_0xbd5b('0x14')](_0x5c5752);}else{logger[_0xbd5b('0x16')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x562da7,_0x3ec783||_0xbd5b('0x14'));_0x2e06c3[_0xbd5b('0xf')]();}}else{_0x2e06c3['next']();}}catch(_0x454ceb){logger[_0xbd5b('0xb')](_0xbd5b('0x18'),_0x562da7,_0x454ceb[_0xbd5b('0xd')]);_0x2e06c3[_0xbd5b('0xf')]();}}}catch(_0x3c3e60){logger[_0xbd5b('0xb')]('[%s][GOTOIF]\x20%s',_0x562da7,JSON[_0xbd5b('0x19')](_0x3c3e60));_0x2e06c3[_0xbd5b('0xf')]();}};};
\ No newline at end of file
+var _0xb2ad=['number','consequence','getMustacheRender','replace','length','error','map','message','join','priorityTrue','info','condition','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0xd74e3d,_0x8de80b){var _0x3b3ca9=function(_0x167ba5){while(--_0x167ba5){_0xd74e3d['push'](_0xd74e3d['shift']());}};_0x3b3ca9(++_0x8de80b);}(_0xb2ad,0x10d));var _0xdb2a=function(_0x54f4d7,_0x97f9a1){_0x54f4d7=_0x54f4d7-0x0;var _0x5d3764=_0xb2ad[_0x54f4d7];return _0x5d3764;};'use strict';var schema=require(_0xdb2a('0x0'));var _=require(_0xdb2a('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xdb2a('0x2'));var logger=require(_0xdb2a('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xdb2a('0x4'),'required':!![],'message':_0xdb2a('0x5')},'priorityTrue':{'type':_0xdb2a('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xdb2a('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xdb2a('0x7')]=function(_0xc00f74,_0x341f81){return function(_0x1acc66){try{var _0x34b86b={'condition':htmlToText['fromString'](utils[_0xdb2a('0x8')](_0x341f81[0x0],this),{'wordwrap':![]})[_0xdb2a('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x341f81[0x1],'priorityFalse':_0x341f81[0x2]};var _0x37d28a=gotoif[_0xdb2a('0x0')](_0x34b86b,{'typecast':!![]});if(_0x37d28a[_0xdb2a('0xa')]){logger[_0xdb2a('0xb')]('[%s][GOTOIF]\x20%s',_0xc00f74,_[_0xdb2a('0xc')](_0x37d28a,_0xdb2a('0xd'))[_0xdb2a('0xe')](',\x20'));_0x1acc66['stop']();}else{try{var _0x130fd2=eval('('+_0x34b86b['condition']+')');var _0x1e0ab4=_0x130fd2?_0x34b86b[_0xdb2a('0xf')]:_0x34b86b['priorityFalse'];logger[_0xdb2a('0x10')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0xc00f74,_0x34b86b[_0xdb2a('0x11')],_0x130fd2,_0x1e0ab4||_0xdb2a('0x12'));if(_0x1e0ab4){var _0x18c46b=_['findIndex'](_0x1acc66[_0xdb2a('0x13')](),{'p':_0x1e0ab4});if(_0x18c46b>=0x0){logger[_0xdb2a('0x10')](_0xdb2a('0x14'),_0xc00f74,_0x1e0ab4||_0xdb2a('0x12'),_0x18c46b);_0x1acc66[_0xdb2a('0x12')](_0x18c46b);}else{logger['info'](_0xdb2a('0x15'),_0xc00f74,_0x1e0ab4||'next');_0x1acc66['stop']();}}else{_0x1acc66['next']();}}catch(_0x5dc310){logger[_0xdb2a('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0xc00f74,_0x5dc310[_0xdb2a('0xd')]);_0x1acc66[_0xdb2a('0x16')]();}}}catch(_0x53c205){logger[_0xdb2a('0xb')](_0xdb2a('0x17'),_0xc00f74,JSON[_0xdb2a('0x18')](_0x53c205));_0x1acc66['stop']();}};};
\ No newline at end of file
index c73ad3b..2417e89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x505d=['map','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','validate','../../../../config/logger','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s'];(function(_0x48f880,_0x47ccea){var _0x13b7c6=function(_0x1251d9){while(--_0x1251d9){_0x48f880['push'](_0x48f880['shift']());}};_0x13b7c6(++_0x47ccea);}(_0x505d,0x180));var _0xd505=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x505d[_0x1d1d09];return _0x8827e;};'use strict';var schema=require(_0xd505('0x0'));var _=require('lodash');var logger=require(_0xd505('0x1'))('routing');var gotop=schema({'priority':{'type':_0xd505('0x2'),'required':!![],'message':_0xd505('0x3')}});exports['consequence']=function(_0x4800f9,_0x3a8cf9){return function(_0x2796b5){try{var _0x78ee51={'priority':_0x3a8cf9[0x0]};var _0x2e5bdc=gotop['validate'](_0x78ee51,{'typecast':!![]});if(_0x2e5bdc[_0xd505('0x4')]){logger['error'](_0xd505('0x5'),_0x4800f9,_[_0xd505('0x6')](_0x2e5bdc,'message')['join'](',\x20'));_0x2796b5['stop']();}else{logger['info'](_0xd505('0x7'),_0x4800f9,_0x78ee51[_0xd505('0x8')]);if(_0x78ee51['priority']){var _0xe75f06=_[_0xd505('0x9')](_0x2796b5[_0xd505('0xa')](),{'p':_0x78ee51[_0xd505('0x8')]});if(_0xe75f06>=0x0){logger[_0xd505('0xb')](_0xd505('0xc'),_0x4800f9,_0x78ee51['priority']||_0xd505('0xd'),_0xe75f06);_0x2796b5[_0xd505('0xd')](_0xe75f06);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x4800f9,_0x78ee51[_0xd505('0x8')]||_0xd505('0xd'));_0x2796b5[_0xd505('0xe')]();}}else{_0x2796b5[_0xd505('0xd')]();}}}catch(_0x70ef6f){logger['error'](_0xd505('0x5'),_0x4800f9,JSON['stringify'](_0x70ef6f));_0x2796b5[_0xd505('0xe')]();}};};
\ No newline at end of file
+var _0xc250=['lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate'];(function(_0x4e46ca,_0x405659){var _0xa133a0=function(_0x47a72b){while(--_0x47a72b){_0x4e46ca['push'](_0x4e46ca['shift']());}};_0xa133a0(++_0x405659);}(_0xc250,0x143));var _0x0c25=function(_0x5040c4,_0x23dcb6){_0x5040c4=_0x5040c4-0x0;var _0x241c56=_0xc250[_0x5040c4];return _0x241c56;};'use strict';var schema=require(_0x0c25('0x0'));var _=require(_0x0c25('0x1'));var logger=require(_0x0c25('0x2'))(_0x0c25('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x0c25('0x4')}});exports[_0x0c25('0x5')]=function(_0x44e74f,_0x5ee3f6){return function(_0x5706b6){try{var _0x5cb4d6={'priority':_0x5ee3f6[0x0]};var _0xcf75b3=gotop[_0x0c25('0x0')](_0x5cb4d6,{'typecast':!![]});if(_0xcf75b3[_0x0c25('0x6')]){logger[_0x0c25('0x7')]('[%s][GOTOP]\x20%s',_0x44e74f,_[_0x0c25('0x8')](_0xcf75b3,_0x0c25('0x9'))['join'](',\x20'));_0x5706b6['stop']();}else{logger[_0x0c25('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x44e74f,_0x5cb4d6['priority']);if(_0x5cb4d6[_0x0c25('0xb')]){var _0x57e229=_[_0x0c25('0xc')](_0x5706b6[_0x0c25('0xd')](),{'p':_0x5cb4d6[_0x0c25('0xb')]});if(_0x57e229>=0x0){logger[_0x0c25('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x44e74f,_0x5cb4d6[_0x0c25('0xb')]||_0x0c25('0xe'),_0x57e229);_0x5706b6[_0x0c25('0xe')](_0x57e229);}else{logger[_0x0c25('0xa')](_0x0c25('0xf'),_0x44e74f,_0x5cb4d6[_0x0c25('0xb')]||_0x0c25('0xe'));_0x5706b6[_0x0c25('0x10')]();}}else{_0x5706b6['next']();}}}catch(_0x37b92b){logger[_0x0c25('0x7')]('[%s][GOTOP]\x20%s',_0x44e74f,JSON[_0x0c25('0x11')](_0x37b92b));_0x5706b6[_0x0c25('0x10')]();}};};
\ No newline at end of file
index dbdbb84..43457f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27dd=['[%s][MESSAGE]\x20%s','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','consequence','getMustacheRender','contact','chat','account','AccountId','InteractionId','interaction','channel','Message','info','body','next','catch','stop','error'];(function(_0x21b2b5,_0x2836a9){var _0x496682=function(_0x4594ed){while(--_0x4594ed){_0x21b2b5['push'](_0x21b2b5['shift']());}};_0x496682(++_0x2836a9);}(_0x27dd,0x177));var _0xd27d=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0x27dd[_0x4bb581];return _0x316bf5;};'use strict';var _=require(_0xd27d('0x0'));var utils=require('./utils');var logger=require(_0xd27d('0x1'))(_0xd27d('0x2'));var rpc={'chatMessage':require(_0xd27d('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd27d('0x4')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xd27d('0x5')]=function(_0xf4f0c0,_0x57f9df){return function(_0x1485e7){try{var _0x2c917e={'body':utils[_0xd27d('0x6')](_0x57f9df[0x0],this),'ContactId':this[_0xd27d('0x7')]['id']};if(this['channel']===_0xd27d('0x8')){_0x2c917e['ChatWebsiteId']=this[_0xd27d('0x9')]['id'];}else{_0x2c917e[_['upperFirst'](this['channel'])+_0xd27d('0xa')]=this[_0xd27d('0x9')]['id'];}_0x2c917e[_['upperFirst'](this['channel'])+_0xd27d('0xb')]=this[_0xd27d('0xc')]['id'];if(rpc[this[_0xd27d('0xd')]+_0xd27d('0xe')]){return rpc[this[_0xd27d('0xd')]+'Message']['create'](_0x2c917e)['then'](function(_0x4925c7){logger[_0xd27d('0xf')]('[%s][MESSAGE]\x20%s',_0xf4f0c0,_0x2c917e[_0xd27d('0x10')]);_0x1485e7[_0xd27d('0x11')]();})[_0xd27d('0x12')](function(_0x55ee0c){logger['error']('[%s][MESSAGE]\x20%s',_0xf4f0c0,JSON['stringify'](_0x55ee0c));_0x1485e7[_0xd27d('0x13')]();});}}catch(_0x4b2a48){logger[_0xd27d('0x14')](_0xd27d('0x15'),_0xf4f0c0,JSON['stringify'](_0x4b2a48));_0x1485e7[_0xd27d('0x13')]();}};};
\ No newline at end of file
+var _0xd5a2=['next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body'];(function(_0x4682e9,_0x20afcd){var _0x390b05=function(_0x169fa9){while(--_0x169fa9){_0x4682e9['push'](_0x4682e9['shift']());}};_0x390b05(++_0x20afcd);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0xfbfcc2,_0x496365){_0xfbfcc2=_0xfbfcc2-0x0;var _0x1f2fcb=_0xd5a2[_0xfbfcc2];return _0x1f2fcb;};'use strict';var _=require('lodash');var utils=require(_0x2d5a('0x0'));var logger=require(_0x2d5a('0x1'))(_0x2d5a('0x2'));var rpc={'chatMessage':require(_0x2d5a('0x3')),'openchannelMessage':require(_0x2d5a('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x2d5a('0x5')),'faxMessage':require(_0x2d5a('0x6')),'whatsappMessage':require(_0x2d5a('0x7'))};exports[_0x2d5a('0x8')]=function(_0x2f7a0a,_0x1187b5){return function(_0x923c29){try{var _0x1ae103={'body':utils[_0x2d5a('0x9')](_0x1187b5[0x0],this),'ContactId':this[_0x2d5a('0xa')]['id']};if(this[_0x2d5a('0xb')]==='chat'){_0x1ae103['ChatWebsiteId']=this[_0x2d5a('0xc')]['id'];}else{_0x1ae103[_['upperFirst'](this[_0x2d5a('0xb')])+_0x2d5a('0xd')]=this['account']['id'];}_0x1ae103[_[_0x2d5a('0xe')](this[_0x2d5a('0xb')])+_0x2d5a('0xf')]=this[_0x2d5a('0x10')]['id'];if(rpc[this[_0x2d5a('0xb')]+'Message']){return rpc[this[_0x2d5a('0xb')]+_0x2d5a('0x11')][_0x2d5a('0x12')](_0x1ae103)[_0x2d5a('0x13')](function(_0x583be2){logger['info'](_0x2d5a('0x14'),_0x2f7a0a,_0x1ae103[_0x2d5a('0x15')]);_0x923c29[_0x2d5a('0x16')]();})[_0x2d5a('0x17')](function(_0x5c1416){logger[_0x2d5a('0x18')](_0x2d5a('0x14'),_0x2f7a0a,JSON[_0x2d5a('0x19')](_0x5c1416));_0x923c29[_0x2d5a('0x1a')]();});}}catch(_0x281af3){logger['error'](_0x2d5a('0x14'),_0x2f7a0a,JSON[_0x2d5a('0x19')](_0x281af3));_0x923c29[_0x2d5a('0x1a')]();}};};
\ No newline at end of file
index cb1890d..6b7b712 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7e4=['[%s][NOOP]\x20%s','getMustacheRender','next','error','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0xc7e4,0xcb));var _0x4c7e=function(_0x1a3ca2,_0xe144e7){_0x1a3ca2=_0x1a3ca2-0x0;var _0x30ea08=_0xc7e4[_0x1a3ca2];return _0x30ea08;};'use strict';var utils=require(_0x4c7e('0x0'));var logger=require(_0x4c7e('0x1'))(_0x4c7e('0x2'));exports[_0x4c7e('0x3')]=function(_0x1b17e0,_0x22bc47){return function(_0x3480b2){try{logger['info'](_0x4c7e('0x4'),_0x1b17e0,utils[_0x4c7e('0x5')](_0x22bc47[0x0],this));_0x3480b2[_0x4c7e('0x6')]();}catch(_0x697383){logger[_0x4c7e('0x7')](_0x4c7e('0x4'),_0x1b17e0,JSON['stringify'](_0x697383));_0x3480b2[_0x4c7e('0x8')]();}};};
\ No newline at end of file
+var _0xc744=['[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x403af9,_0x607320){var _0x3878d6=function(_0x523ba2){while(--_0x523ba2){_0x403af9['push'](_0x403af9['shift']());}};_0x3878d6(++_0x607320);}(_0xc744,0x87));var _0x4c74=function(_0x2290d4,_0x43d284){_0x2290d4=_0x2290d4-0x0;var _0x1f68ee=_0xc744[_0x2290d4];return _0x1f68ee;};'use strict';var utils=require(_0x4c74('0x0'));var logger=require(_0x4c74('0x1'))(_0x4c74('0x2'));exports[_0x4c74('0x3')]=function(_0x5c1425,_0x22568f){return function(_0x7a4a48){try{logger[_0x4c74('0x4')](_0x4c74('0x5'),_0x5c1425,utils['getMustacheRender'](_0x22568f[0x0],this));_0x7a4a48[_0x4c74('0x6')]();}catch(_0x4f6671){logger[_0x4c74('0x7')]('[%s][NOOP]\x20%s',_0x5c1425,JSON[_0x4c74('0x8')](_0x4f6671));_0x7a4a48[_0x4c74('0x9')]();}};};
\ No newline at end of file
index 4163530..a0d0a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe206=['atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','log','stack','lodash','util','seq-queue','moment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','from','joinAt','emit','clone','account','pick','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','waiting','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue'];(function(_0x47cc74,_0x4598df){var _0xdfe813=function(_0x291ca6){while(--_0x291ca6){_0x47cc74['push'](_0x47cc74['shift']());}};_0xdfe813(++_0x4598df);}(_0xe206,0x101));var _0x6e20=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xe206[_0xc4001c];return _0x49f7bc;};'use strict';var schema=require('validate');var _=require(_0x6e20('0x0'));var util=require(_0x6e20('0x1'));var seqqueue=require(_0x6e20('0x2'));var moment=require(_0x6e20('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x6e20('0x4'))(_0x6e20('0x5'));var strategy=require('./strategy');config[_0x6e20('0x6')]=_[_0x6e20('0x7')](config['redis'],{'host':_0x6e20('0x8'),'port':0x18eb});var io=require(_0x6e20('0x9'))(new Redis(config[_0x6e20('0x6')]));var attributes=['id',_0x6e20('0xa'),'account','queue',_0x6e20('0xb'),_0x6e20('0xc')];function emit(_0x35dbf0,_0x520dd0,_0x17fb38){io['to'](_0x35dbf0)[_0x6e20('0xd')](_0x520dd0,_0x17fb38);}function emitChannelQueueInteraction(_0xd8a7a5,_0x164d66,_0x10d113,_0x2827c6,_0x3f539e,_0x1cd9ba,_0x1cadd6,_0x56bf99){var _0x368057=_[_0x6e20('0xe')](_0x10d113);_0x368057[_0x6e20('0xa')]=_0x56bf99;_0x368057['queue']=_0x164d66;_0x368057[_0x6e20('0xf')]=_0x2827c6;_0x368057['id']=_0x3f539e;if(_0x1cd9ba){_0x1cadd6[util['format']('%sQueuesWaitingInteractions',_0xd8a7a5)][_0x3f539e]=_[_0x6e20('0x10')](_0x368057,attributes);}else{delete _0x1cadd6[util[_0x6e20('0x11')](_0x6e20('0x12'),_0xd8a7a5)][_0x3f539e];}emit(util[_0x6e20('0x11')](_0x6e20('0x13'),_0xd8a7a5,_0x164d66),util['format'](_0x6e20('0x14'),_0xd8a7a5,_0x1cd9ba?'save':_0x6e20('0x15')),_[_0x6e20('0x10')](_0x368057,attributes));}var rpc={'openchannelQueueReport':require(_0x6e20('0x16')),'mailQueueReport':require(_0x6e20('0x17')),'chatQueueReport':require(_0x6e20('0x18')),'smsQueueReport':require(_0x6e20('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x6e20('0x1a'))};var queue=schema({'name':{'type':_0x6e20('0x1b'),'required':!![],'message':_0x6e20('0x1c')},'timeout':{'type':'number','message':_0x6e20('0x1d')}});function startRouting(_0x132658,_0x2dd657,_0x54b22f,_0x384ff6){if(_0x132658&&_0x2dd657&&_0x54b22f){_0x2dd657['waiting']+=0x1;var _0x191016={'uniqueid':_0x132658,'from':_0x54b22f[_0x6e20('0x1e')]?_0x54b22f['body'][_0x6e20('0xb')]:'','joinAt':moment()['format'](_0x6e20('0x1f')),'ContactId':_0x54b22f['contact']?_0x54b22f[_0x6e20('0x20')]['id']:null,'ListId':_0x54b22f[_0x6e20('0x21')]?_0x54b22f['list']['id']:null};_0x191016[_['upperFirst'](_0x54b22f[_0x6e20('0x22')])+'QueueId']=_0x2dd657['id']||null;_0x191016[_[_0x6e20('0x23')](_0x54b22f[_0x6e20('0x22')])+_0x6e20('0x24')]=_0x54b22f[_0x6e20('0x25')]?_0x54b22f[_0x6e20('0x25')]['id']:null;_0x191016[_[_0x6e20('0x23')](_0x54b22f[_0x6e20('0x22')])+_0x6e20('0x26')]=_0x54b22f['message']?_0x54b22f[_0x6e20('0x27')]['id']:null;_0x191016[_[_0x6e20('0x23')](_0x54b22f[_0x6e20('0x22')])+(_0x54b22f[_0x6e20('0x22')]!==_0x6e20('0x28')?_0x6e20('0x29'):_0x6e20('0x2a'))]=_0x54b22f[_0x6e20('0xf')]?_0x54b22f[_0x6e20('0xf')]['id']:null;logger[_0x6e20('0x2b')](util[_0x6e20('0x11')](_0x6e20('0x2c'),_0x132658,_0x2dd657[_0x6e20('0x2d')]));emitChannelQueueInteraction(_0x54b22f[_0x6e20('0x22')],_0x2dd657[_0x6e20('0x2d')],_0x191016,_0x54b22f[_0x6e20('0xf')]['name'],_0x54b22f[_0x6e20('0x27')]['id'],!![],_0x384ff6,_0x2dd657['id']);if(rpc[_0x54b22f[_0x6e20('0x22')]+_0x6e20('0x2e')]){return rpc[_0x54b22f[_0x6e20('0x22')]+_0x6e20('0x2e')]['create'](_0x191016)[_0x6e20('0x2f')](function(_0x27b11a){logger[_0x6e20('0x30')](_0x6e20('0x31'));});}}}function stopRouting(_0x531787,_0x5e99ef,_0x591f1f,_0x49af5f){if(_0x531787&&_0x5e99ef){_0x5e99ef['waiting']-=0x1;var _0x19d4ca={'leaveAt':moment()[_0x6e20('0x11')](_0x6e20('0x1f')),'acceptAt':moment()[_0x6e20('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6e20('0x32')};logger[_0x6e20('0x2b')](util[_0x6e20('0x11')](_0x6e20('0x33'),_0x531787,_0x5e99ef['name']));emitChannelQueueInteraction(_0x591f1f['channel'],_0x5e99ef['name'],_0x591f1f[_0x6e20('0x1e')],_0x591f1f['account'][_0x6e20('0x2d')],_0x591f1f[_0x6e20('0x27')]['id'],![],_0x49af5f,_0x5e99ef['id']);if(rpc[_0x591f1f[_0x6e20('0x22')]+_0x6e20('0x2e')]){return rpc[_0x591f1f[_0x6e20('0x22')]+_0x6e20('0x2e')][_0x6e20('0x34')](_0x531787,_0x19d4ca)[_0x6e20('0x2f')](function(_0x4095f6){logger[_0x6e20('0x30')]('update\x20queue\x20report');});}}}function endRouting(_0x51ab7f,_0x422cca,_0x3a7f1f,_0x1b710b){if(_0x51ab7f&&_0x422cca){_0x422cca[_0x6e20('0x35')]-=0x1;var _0x55450a={'leaveAt':moment()[_0x6e20('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x6e20('0x11')](_0x6e20('0x1f')),'reason':_0x6e20('0x36')};logger[_0x6e20('0x2b')](util['format'](_0x6e20('0x37'),_0x51ab7f,_0x422cca[_0x6e20('0x2d')]));emitChannelQueueInteraction(_0x3a7f1f[_0x6e20('0x22')],_0x422cca[_0x6e20('0x2d')],_0x3a7f1f['body'],_0x3a7f1f[_0x6e20('0xf')][_0x6e20('0x2d')],_0x3a7f1f['message']['id'],![],_0x1b710b);if(rpc[_0x3a7f1f[_0x6e20('0x22')]+_0x6e20('0x2e')]){return rpc[_0x3a7f1f[_0x6e20('0x22')]+_0x6e20('0x2e')][_0x6e20('0x34')](_0x51ab7f,_0x55450a)['catch'](function(_0x168b4b){logger[_0x6e20('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x3dad56){return function(_0x4dcc27){return _0x4dcc27[_0x6e20('0x2d')][_0x6e20('0x38')]()===_0x3dad56[_0x6e20('0x38')]();};}exports[_0x6e20('0x39')]=function(_0x45bd6c,_0x5c8972,_0x19a252,_0x190d15){return function(_0x3c1109){try{var _0x5502f3={'name':_0x5c8972[0x0],'timeout':_0x5c8972[0x1]};var _0x5e3752=queue[_0x6e20('0x3a')](_0x5502f3,{'typecast':!![]});if(_0x5e3752[_0x6e20('0x3b')]){logger[_0x6e20('0x30')](_0x6e20('0x3c'),_0x45bd6c,_[_0x6e20('0x3d')](_0x5e3752,_0x6e20('0x27'))[_0x6e20('0x3e')](',\x20'));_0x3c1109[_0x6e20('0x3f')]();}else{var _0x43a1ec=_[_0x6e20('0x40')](_0x19a252[_0x190d15[_0x6e20('0x22')]+_0x6e20('0x41')],handleFindQueue(_0x5502f3[_0x6e20('0x2d')]));if(_0x43a1ec){startRouting(_0x45bd6c,_0x43a1ec,_0x190d15,_0x19a252);var _0x5e9cf2=(_0x43a1ec['timeout']||0xa)*0x3e8;var _0x57aaca=(_0x5502f3[_0x6e20('0x36')]||0x14)*0x3e8;var _0x178cca,_0x48f831;if(_0x5e9cf2>_0x57aaca){_0x57aaca=_0x5e9cf2;}var _0x23101e=seqqueue[_0x6e20('0x42')](_0x5e9cf2);_0x23101e['id']=_0x45bd6c;_0x23101e[_0x6e20('0x43')]=_0x5e9cf2;_0x23101e[_0x6e20('0x44')]=_0x57aaca;_0x23101e[_0x6e20('0x22')]=_0x190d15[_0x6e20('0x22')];_0x19a252['rules'][_0x45bd6c]['on'](_0x6e20('0x45'),function(){logger[_0x6e20('0x2b')](_0x6e20('0x46'),_0x45bd6c);stopRouting(_0x45bd6c,_0x43a1ec,_0x190d15,_0x19a252);clearTimeout(_0x178cca);_0x178cca=undefined;_0x23101e[_0x6e20('0x47')](!![]);if(_0x19a252[_0x6e20('0x48')][_0x45bd6c]){delete _0x19a252[_0x6e20('0x48')][_0x45bd6c];}_0x3c1109[_0x6e20('0x3f')]();});_0x19a252[_0x6e20('0x48')][_0x45bd6c]['on'](_0x6e20('0x49'),function(){if(_0x19a252[_0x6e20('0x48')][_0x45bd6c]){delete _0x19a252['rules'][_0x45bd6c];}});_0x178cca=setTimeout(function(){logger[_0x6e20('0x2b')](_0x6e20('0x4a'),_0x45bd6c);endRouting(_0x45bd6c,_0x43a1ec,_0x190d15,_0x19a252);clearTimeout(_0x178cca);_0x23101e[_0x6e20('0x47')](!![]);_0x3c1109[_0x6e20('0x4b')]();},_0x57aaca);switch(_0x43a1ec[_0x6e20('0x4c')]){case _0x6e20('0x4d'):strategy[_0x6e20('0x4d')](_0x23101e,_0x43a1ec,_0x19a252,_0x190d15);break;default:strategy[_0x6e20('0x4e')](_0x23101e,_0x43a1ec,_0x19a252,_0x190d15);}}else{logger[_0x6e20('0x30')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x45bd6c,_0x5502f3[_0x6e20('0x2d')]);_0x3c1109['stop']();}}}catch(_0x130548){console[_0x6e20('0x4f')](_0x130548);logger[_0x6e20('0x30')](_0x6e20('0x3c'),_0x45bd6c,_0x130548[_0x6e20('0x50')]);_0x3c1109[_0x6e20('0x3f')]();}};};
\ No newline at end of file
+var _0xbdff=['validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','routing','./strategy','localhost','redis','queue_id','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','body','contact','list','channel','QueueId','InteractionId','interaction','upperFirst','message','account','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','map','stop','Queues','qtimeout','rules','end','close','complete','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xbdff,0x114));var _0xfbdf=function(_0x59a631,_0x186915){_0x59a631=_0x59a631-0x0;var _0x24d8a9=_0xbdff[_0x59a631];return _0x24d8a9;};'use strict';var schema=require(_0xfbdf('0x0'));var _=require(_0xfbdf('0x1'));var util=require(_0xfbdf('0x2'));var seqqueue=require(_0xfbdf('0x3'));var moment=require(_0xfbdf('0x4'));var Redis=require(_0xfbdf('0x5'));var config=require(_0xfbdf('0x6'));var logger=require('../../../../config/logger')(_0xfbdf('0x7'));var strategy=require(_0xfbdf('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0xfbdf('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfbdf('0xa')]));var attributes=['id',_0xfbdf('0xb'),'account',_0xfbdf('0xc'),_0xfbdf('0xd'),_0xfbdf('0xe')];function emit(_0x4ef000,_0x1d259f,_0x5268f9){io['to'](_0x4ef000)[_0xfbdf('0xf')](_0x1d259f,_0x5268f9);}function emitChannelQueueInteraction(_0x424c53,_0x41e702,_0x5259f8,_0x30bded,_0xb376c4,_0x4d44ca,_0x4ba8b1,_0x1505fe){var _0x458817=_[_0xfbdf('0x10')](_0x5259f8);_0x458817[_0xfbdf('0xb')]=_0x1505fe;_0x458817['queue']=_0x41e702;_0x458817['account']=_0x30bded;_0x458817['id']=_0xb376c4;if(_0x4d44ca){_0x4ba8b1[util[_0xfbdf('0x11')](_0xfbdf('0x12'),_0x424c53)][_0xb376c4]=_[_0xfbdf('0x13')](_0x458817,attributes);}else{delete _0x4ba8b1[util['format'](_0xfbdf('0x12'),_0x424c53)][_0xb376c4];}emit(util[_0xfbdf('0x11')]('%s:queue:%s',_0x424c53,_0x41e702),util[_0xfbdf('0x11')](_0xfbdf('0x14'),_0x424c53,_0x4d44ca?'save':_0xfbdf('0x15')),_[_0xfbdf('0x13')](_0x458817,attributes));}var rpc={'openchannelQueueReport':require(_0xfbdf('0x16')),'mailQueueReport':require(_0xfbdf('0x17')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xfbdf('0x18')),'whatsappQueueReport':require(_0xfbdf('0x19'))};var queue=schema({'name':{'type':_0xfbdf('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xfbdf('0x1b'),'message':_0xfbdf('0x1c')}});function startRouting(_0x29c34f,_0xad3e04,_0x493f43,_0x5cff0c){if(_0x29c34f&&_0xad3e04&&_0x493f43){_0xad3e04['waiting']+=0x1;var _0x3eacbb={'uniqueid':_0x29c34f,'from':_0x493f43[_0xfbdf('0x1d')]?_0x493f43[_0xfbdf('0x1d')][_0xfbdf('0xd')]:'','joinAt':moment()[_0xfbdf('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x493f43[_0xfbdf('0x1e')]?_0x493f43[_0xfbdf('0x1e')]['id']:null,'ListId':_0x493f43[_0xfbdf('0x1f')]?_0x493f43[_0xfbdf('0x1f')]['id']:null};_0x3eacbb[_['upperFirst'](_0x493f43[_0xfbdf('0x20')])+_0xfbdf('0x21')]=_0xad3e04['id']||null;_0x3eacbb[_['upperFirst'](_0x493f43['channel'])+_0xfbdf('0x22')]=_0x493f43[_0xfbdf('0x23')]?_0x493f43[_0xfbdf('0x23')]['id']:null;_0x3eacbb[_[_0xfbdf('0x24')](_0x493f43['channel'])+'MessageId']=_0x493f43['message']?_0x493f43[_0xfbdf('0x25')]['id']:null;_0x3eacbb[_['upperFirst'](_0x493f43[_0xfbdf('0x20')])+(_0x493f43[_0xfbdf('0x20')]!=='chat'?'AccountId':'WebsiteId')]=_0x493f43[_0xfbdf('0x26')]?_0x493f43[_0xfbdf('0x26')]['id']:null;logger['info'](util['format'](_0xfbdf('0x27'),_0x29c34f,_0xad3e04[_0xfbdf('0x28')]));emitChannelQueueInteraction(_0x493f43[_0xfbdf('0x20')],_0xad3e04[_0xfbdf('0x28')],_0x3eacbb,_0x493f43['account'][_0xfbdf('0x28')],_0x493f43[_0xfbdf('0x25')]['id'],!![],_0x5cff0c,_0xad3e04['id']);if(rpc[_0x493f43[_0xfbdf('0x20')]+_0xfbdf('0x29')]){return rpc[_0x493f43[_0xfbdf('0x20')]+_0xfbdf('0x29')][_0xfbdf('0x2a')](_0x3eacbb)['catch'](function(_0x1e38d2){logger[_0xfbdf('0x2b')]('create\x20queue\x20report');});}}}function stopRouting(_0x1bb8cc,_0xe35091,_0x32bfb5,_0x140456){if(_0x1bb8cc&&_0xe35091){_0xe35091['waiting']-=0x1;var _0x4f7f45={'leaveAt':moment()[_0xfbdf('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xfbdf('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xfbdf('0x2c')};logger[_0xfbdf('0x2d')](util[_0xfbdf('0x11')](_0xfbdf('0x2e'),_0x1bb8cc,_0xe35091[_0xfbdf('0x28')]));emitChannelQueueInteraction(_0x32bfb5[_0xfbdf('0x20')],_0xe35091[_0xfbdf('0x28')],_0x32bfb5['body'],_0x32bfb5['account'][_0xfbdf('0x28')],_0x32bfb5[_0xfbdf('0x25')]['id'],![],_0x140456,_0xe35091['id']);if(rpc[_0x32bfb5[_0xfbdf('0x20')]+'QueueReport']){return rpc[_0x32bfb5[_0xfbdf('0x20')]+_0xfbdf('0x29')][_0xfbdf('0x2f')](_0x1bb8cc,_0x4f7f45)[_0xfbdf('0x30')](function(_0x115a2a){logger[_0xfbdf('0x2b')](_0xfbdf('0x31'));});}}}function endRouting(_0x5678cc,_0x6213c,_0x115f7c,_0x3d0c67){if(_0x5678cc&&_0x6213c){_0x6213c['waiting']-=0x1;var _0x12f1e2={'leaveAt':moment()[_0xfbdf('0x11')](_0xfbdf('0x32')),'exitAt':moment()[_0xfbdf('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xfbdf('0x33')};logger['info'](util['format'](_0xfbdf('0x34'),_0x5678cc,_0x6213c['name']));emitChannelQueueInteraction(_0x115f7c[_0xfbdf('0x20')],_0x6213c['name'],_0x115f7c[_0xfbdf('0x1d')],_0x115f7c['account'][_0xfbdf('0x28')],_0x115f7c[_0xfbdf('0x25')]['id'],![],_0x3d0c67);if(rpc[_0x115f7c[_0xfbdf('0x20')]+'QueueReport']){return rpc[_0x115f7c[_0xfbdf('0x20')]+_0xfbdf('0x29')][_0xfbdf('0x2f')](_0x5678cc,_0x12f1e2)[_0xfbdf('0x30')](function(_0x48615b){logger[_0xfbdf('0x2b')](_0xfbdf('0x31'));});}}}function handleFindQueue(_0x1e6449){return function(_0x439634){return _0x439634[_0xfbdf('0x28')][_0xfbdf('0x35')]()===_0x1e6449[_0xfbdf('0x35')]();};}exports['consequence']=function(_0x2083e9,_0x19c55c,_0x25ca22,_0x4ba5cc){return function(_0x280211){try{var _0x5e55f5={'name':_0x19c55c[0x0],'timeout':_0x19c55c[0x1]};var _0x20f027=queue[_0xfbdf('0x0')](_0x5e55f5,{'typecast':!![]});if(_0x20f027[_0xfbdf('0x36')]){logger[_0xfbdf('0x2b')]('[%s][QUEUE]\x20%s',_0x2083e9,_[_0xfbdf('0x37')](_0x20f027,_0xfbdf('0x25'))['join'](',\x20'));_0x280211[_0xfbdf('0x38')]();}else{var _0x282a70=_['find'](_0x25ca22[_0x4ba5cc['channel']+_0xfbdf('0x39')],handleFindQueue(_0x5e55f5['name']));if(_0x282a70){startRouting(_0x2083e9,_0x282a70,_0x4ba5cc,_0x25ca22);var _0x34c769=(_0x282a70[_0xfbdf('0x33')]||0xa)*0x3e8;var _0x2b7813=(_0x5e55f5[_0xfbdf('0x33')]||0x14)*0x3e8;var _0x467d1c,_0x243f0f;if(_0x34c769>_0x2b7813){_0x2b7813=_0x34c769;}var _0x340230=seqqueue['createQueue'](_0x34c769);_0x340230['id']=_0x2083e9;_0x340230['atimeout']=_0x34c769;_0x340230[_0xfbdf('0x3a')]=_0x2b7813;_0x340230['channel']=_0x4ba5cc['channel'];_0x25ca22[_0xfbdf('0x3b')][_0x2083e9]['on'](_0xfbdf('0x3c'),function(){logger[_0xfbdf('0x2d')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2083e9);stopRouting(_0x2083e9,_0x282a70,_0x4ba5cc,_0x25ca22);clearTimeout(_0x467d1c);_0x467d1c=undefined;_0x340230[_0xfbdf('0x3d')](!![]);if(_0x25ca22[_0xfbdf('0x3b')][_0x2083e9]){delete _0x25ca22[_0xfbdf('0x3b')][_0x2083e9];}_0x280211[_0xfbdf('0x38')]();});_0x25ca22['rules'][_0x2083e9]['on'](_0xfbdf('0x3e'),function(){if(_0x25ca22[_0xfbdf('0x3b')][_0x2083e9]){delete _0x25ca22[_0xfbdf('0x3b')][_0x2083e9];}});_0x467d1c=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x2083e9);endRouting(_0x2083e9,_0x282a70,_0x4ba5cc,_0x25ca22);clearTimeout(_0x467d1c);_0x340230[_0xfbdf('0x3d')](!![]);_0x280211[_0xfbdf('0x3f')]();},_0x2b7813);switch(_0x282a70['strategy']){case _0xfbdf('0x40'):strategy[_0xfbdf('0x40')](_0x340230,_0x282a70,_0x25ca22,_0x4ba5cc);break;default:strategy[_0xfbdf('0x41')](_0x340230,_0x282a70,_0x25ca22,_0x4ba5cc);}}else{logger[_0xfbdf('0x2b')](_0xfbdf('0x42'),_0x2083e9,_0x5e55f5['name']);_0x280211[_0xfbdf('0x38')]();}}}catch(_0x588a9b){console[_0xfbdf('0x43')](_0x588a9b);logger[_0xfbdf('0x2b')]('[%s][QUEUE]\x20%s',_0x2083e9,_0x588a9b[_0xfbdf('0x44')]);_0x280211[_0xfbdf('0x38')]();}};};
\ No newline at end of file
index 54b9e80..8296e6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6bc=['exports','lodash','./util','routing','notificationId','agent','realtime','push','bind','handleTimeout','squeue','timeout','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','forcedOwnership','isAgentAvailable','channel','busyQueue','writeLog','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP'];(function(_0x1f0988,_0x299c68){var _0x3caf61=function(_0x454981){while(--_0x454981){_0x1f0988['push'](_0x1f0988['shift']());}};_0x3caf61(++_0x299c68);}(_0xf6bc,0x106));var _0xcf6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcf6b('0x0'));var uuid=require('uuid');var util=require(_0xcf6b('0x1'));var logger=require('../../../../../config/logger')(_0xcf6b('0x2'));var Agent=function(_0x2bdfe1,_0x470401,_0x1a45d6,_0x787fbb){this[_0xcf6b('0x3')]=uuid['v4']();this['squeue']=_0x2bdfe1;this[_0xcf6b('0x4')]=_0x470401;this[_0xcf6b('0x5')]=_0x1a45d6;this[_0xcf6b('0x2')]=_0x787fbb;this['squeue'][_0xcf6b('0x6')](this['handleRun'][_0xcf6b('0x7')](this),this[_0xcf6b('0x8')][_0xcf6b('0x7')](this));this[_0xcf6b('0x9')]['on'](_0xcf6b('0xa'),this[_0xcf6b('0x8')][_0xcf6b('0x7')](this));this['squeue']['on']('drained',this[_0xcf6b('0xb')][_0xcf6b('0x7')](this));};Agent[_0xcf6b('0xc')][_0xcf6b('0x6')]=function(){this[_0xcf6b('0x9')][_0xcf6b('0x6')](this[_0xcf6b('0xd')][_0xcf6b('0x7')](this),this['handleTimeout'][_0xcf6b('0x7')](this));};Agent['prototype']['handleDrained']=function(){this[_0xcf6b('0x8')](!![]);};Agent[_0xcf6b('0xc')]['handleRun']=function(_0x5423c7){logger['info'](_0xcf6b('0xe'),this[_0xcf6b('0x9')]['id'],this[_0xcf6b('0x4')]['id']);if(_[_0xcf6b('0xf')](this[_0xcf6b('0x5')][_0xcf6b('0x10')][this['agent']['id']])){logger[_0xcf6b('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xcf6b('0x9')]['id'],this['agent']['id']);setTimeout(this[_0xcf6b('0x6')]['bind'](this),0x3e8);}else{if(this[_0xcf6b('0x2')][_0xcf6b('0x12')]||util[_0xcf6b('0x13')](this[_0xcf6b('0x9')]['id'],this[_0xcf6b('0x5')][_0xcf6b('0x10')][this['agent']['id']],this[_0xcf6b('0x9')][_0xcf6b('0x14')],![])){this['realtime']['agents'][this[_0xcf6b('0x4')]['id']]['busy']=!![];this['realtime']['agents'][this[_0xcf6b('0x4')]['id']][_0xcf6b('0x15')]=undefined;util['showNotification'](this[_0xcf6b('0x3')],this['squeue']['id'],this['realtime'][_0xcf6b('0x10')][this[_0xcf6b('0x4')]['id']],null,this['routing']);util[_0xcf6b('0x16')](this[_0xcf6b('0x9')]['id'],this[_0xcf6b('0x5')][_0xcf6b('0x10')][this[_0xcf6b('0x4')]['id']],'RINGING'+(this[_0xcf6b('0x2')]['forcedOwnership']?':FORCED':''));}else{logger[_0xcf6b('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xcf6b('0x9')]['id'],this[_0xcf6b('0x4')]['id']);setTimeout(this[_0xcf6b('0x6')][_0xcf6b('0x7')](this),0x3e8);}}};Agent[_0xcf6b('0xc')][_0xcf6b('0x8')]=function(_0x638e47){if(_[_0xcf6b('0xf')](this[_0xcf6b('0x5')][_0xcf6b('0x10')][this[_0xcf6b('0x4')]['id']])){return logger['info'](_0xcf6b('0x17'),this[_0xcf6b('0x9')]['id'],this[_0xcf6b('0x4')]['id']);}else{logger['info'](_0xcf6b('0x18'),this['squeue']['id'],this[_0xcf6b('0x4')]['id']);util[_0xcf6b('0x19')](this[_0xcf6b('0x3')],this[_0xcf6b('0x9')]['id'],this['realtime'][_0xcf6b('0x10')][this[_0xcf6b('0x4')]['id']],null,this[_0xcf6b('0x2')]);this[_0xcf6b('0x5')]['agents'][this[_0xcf6b('0x4')]['id']][_0xcf6b('0x1a')]=![];this[_0xcf6b('0x5')][_0xcf6b('0x10')][this[_0xcf6b('0x4')]['id']][_0xcf6b('0x15')]=undefined;util['writeLog'](this['squeue']['id'],this[_0xcf6b('0x5')]['agents'][this[_0xcf6b('0x4')]['id']],_0x638e47?_0xcf6b('0x1b'):'TIMEOUT');}if(!_0x638e47){setTimeout(this[_0xcf6b('0x6')][_0xcf6b('0x7')](this),0x3e8);}};function agent(_0x471274,_0x2de3df,_0x507774,_0x481537){return new Agent(_0x471274,_0x2de3df,_0x507774,_0x481537);}module[_0xcf6b('0x1c')]=agent;
\ No newline at end of file
+var _0x531b=['./util','../../../../../config/logger','routing','notificationId','agent','squeue','push','handleRun','bind','handleTimeout','handleDrained','prototype','info','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','realtime','showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','exports','uuid'];(function(_0x1fca80,_0x527187){var _0x5ab676=function(_0x1af7c6){while(--_0x1af7c6){_0x1fca80['push'](_0x1fca80['shift']());}};_0x5ab676(++_0x527187);}(_0x531b,0x13e));var _0xb531=function(_0x2072f4,_0x1f2f7e){_0x2072f4=_0x2072f4-0x0;var _0x330448=_0x531b[_0x2072f4];return _0x330448;};'use strict';var _=require('lodash');var uuid=require(_0xb531('0x0'));var util=require(_0xb531('0x1'));var logger=require(_0xb531('0x2'))(_0xb531('0x3'));var Agent=function(_0x3751d1,_0x5db0aa,_0x180f51,_0x4443fa){this[_0xb531('0x4')]=uuid['v4']();this['squeue']=_0x3751d1;this[_0xb531('0x5')]=_0x5db0aa;this['realtime']=_0x180f51;this[_0xb531('0x3')]=_0x4443fa;this[_0xb531('0x6')][_0xb531('0x7')](this[_0xb531('0x8')][_0xb531('0x9')](this),this['handleTimeout']['bind'](this));this[_0xb531('0x6')]['on']('timeout',this[_0xb531('0xa')][_0xb531('0x9')](this));this[_0xb531('0x6')]['on']('drained',this[_0xb531('0xb')][_0xb531('0x9')](this));};Agent[_0xb531('0xc')][_0xb531('0x7')]=function(){this[_0xb531('0x6')][_0xb531('0x7')](this[_0xb531('0x8')][_0xb531('0x9')](this),this[_0xb531('0xa')][_0xb531('0x9')](this));};Agent[_0xb531('0xc')][_0xb531('0xb')]=function(){this[_0xb531('0xa')](!![]);};Agent[_0xb531('0xc')][_0xb531('0x8')]=function(_0x5baa00){logger[_0xb531('0xd')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xb531('0x6')]['id'],this[_0xb531('0x5')]['id']);if(_['isNil'](this['realtime'][_0xb531('0xe')][this[_0xb531('0x5')]['id']])){logger[_0xb531('0xd')](_0xb531('0xf'),this['squeue']['id'],this[_0xb531('0x5')]['id']);setTimeout(this['push'][_0xb531('0x9')](this),0x3e8);}else{if(this[_0xb531('0x3')]['forcedOwnership']||util[_0xb531('0x10')](this[_0xb531('0x6')]['id'],this['realtime'][_0xb531('0xe')][this[_0xb531('0x5')]['id']],this[_0xb531('0x6')][_0xb531('0x11')],![])){this['realtime'][_0xb531('0xe')][this[_0xb531('0x5')]['id']][_0xb531('0x12')]=!![];this[_0xb531('0x13')][_0xb531('0xe')][this[_0xb531('0x5')]['id']]['busyQueue']=undefined;util[_0xb531('0x14')](this[_0xb531('0x4')],this[_0xb531('0x6')]['id'],this[_0xb531('0x13')]['agents'][this[_0xb531('0x5')]['id']],null,this[_0xb531('0x3')]);util[_0xb531('0x15')](this['squeue']['id'],this[_0xb531('0x13')][_0xb531('0xe')][this['agent']['id']],_0xb531('0x16')+(this[_0xb531('0x3')][_0xb531('0x17')]?_0xb531('0x18'):''));}else{logger['info'](_0xb531('0x19'),this[_0xb531('0x6')]['id'],this[_0xb531('0x5')]['id']);setTimeout(this[_0xb531('0x7')][_0xb531('0x9')](this),0x3e8);}}};Agent[_0xb531('0xc')][_0xb531('0xa')]=function(_0x1c366e){if(_['isNil'](this[_0xb531('0x13')][_0xb531('0xe')][this[_0xb531('0x5')]['id']])){return logger[_0xb531('0xd')](_0xb531('0xf'),this[_0xb531('0x6')]['id'],this[_0xb531('0x5')]['id']);}else{logger[_0xb531('0xd')](_0xb531('0x1a'),this[_0xb531('0x6')]['id'],this[_0xb531('0x5')]['id']);util['hideNotification'](this[_0xb531('0x4')],this[_0xb531('0x6')]['id'],this['realtime']['agents'][this[_0xb531('0x5')]['id']],null,this[_0xb531('0x3')]);this[_0xb531('0x13')][_0xb531('0xe')][this['agent']['id']]['busy']=![];this[_0xb531('0x13')]['agents'][this[_0xb531('0x5')]['id']]['busyQueue']=undefined;util[_0xb531('0x15')](this[_0xb531('0x6')]['id'],this[_0xb531('0x13')][_0xb531('0xe')][this[_0xb531('0x5')]['id']],_0x1c366e?_0xb531('0x1b'):'TIMEOUT');}if(!_0x1c366e){setTimeout(this[_0xb531('0x7')][_0xb531('0x9')](this),0x3e8);}};function agent(_0x1300b3,_0x110a14,_0x3d8f7f,_0x25a7ff){return new Agent(_0x1300b3,_0x110a14,_0x3d8f7f,_0x25a7ff);}module[_0xb531('0x1c')]=agent;
\ No newline at end of file
index 9e58269..9b8d7c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc43c=['timeout','drained','handleDrained','prototype','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','notificationId','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','push','handleRun','bind','handleTimeout'];(function(_0x37ff34,_0x20fc02){var _0x192c2b=function(_0x5b387d){while(--_0x5b387d){_0x37ff34['push'](_0x37ff34['shift']());}};_0x192c2b(++_0x20fc02);}(_0xc43c,0x152));var _0xcc43=function(_0x20476c,_0x5d4788){_0x20476c=_0x20476c-0x0;var _0x23031e=_0xc43c[_0x20476c];return _0x23031e;};'use strict';var _=require(_0xcc43('0x0'));var uuid=require(_0xcc43('0x1'));var util=require(_0xcc43('0x2'));var logger=require(_0xcc43('0x3'))(_0xcc43('0x4'));var Beepall=function(_0x275c81,_0x53ef5e,_0x162a11,_0x258c7e){this['notificationId']=uuid['v4']();this[_0xcc43('0x5')]=_0x275c81;this[_0xcc43('0x6')]=_0x53ef5e;this[_0xcc43('0x7')]=_0x162a11;this[_0xcc43('0x4')]=_0x258c7e;this[_0xcc43('0x5')][_0xcc43('0x8')](this[_0xcc43('0x9')][_0xcc43('0xa')](this),this[_0xcc43('0xb')][_0xcc43('0xa')](this));this['squeue']['on'](_0xcc43('0xc'),this[_0xcc43('0xb')][_0xcc43('0xa')](this));this[_0xcc43('0x5')]['on'](_0xcc43('0xd'),this[_0xcc43('0xe')]['bind'](this));};Beepall[_0xcc43('0xf')][_0xcc43('0x8')]=function(){this[_0xcc43('0x5')][_0xcc43('0x8')](this[_0xcc43('0x9')][_0xcc43('0xa')](this),this['handleTimeout'][_0xcc43('0xa')](this));};Beepall['prototype'][_0xcc43('0xe')]=function(_0x18bb3b){this['handleTimeout'](!![]);};Beepall['prototype'][_0xcc43('0x9')]=function(_0x20401f){var _0x289990=!![];if(!_[_0xcc43('0x10')](this[_0xcc43('0x6')])&&!_[_0xcc43('0x10')](this['queue']['Agents'])&&this[_0xcc43('0x6')][_0xcc43('0x11')][_0xcc43('0x12')]>0x0){for(var _0x2e053d=0x0,_0x4f2f44;_0x2e053d<this[_0xcc43('0x6')][_0xcc43('0x11')][_0xcc43('0x12')];_0x2e053d+=0x1){_0x4f2f44=this['queue']['Agents'][_0x2e053d]['id'];if(_[_0xcc43('0x10')](this[_0xcc43('0x7')]['agents'][_0x4f2f44])){logger['info'](_0xcc43('0x13'),this[_0xcc43('0x5')]['id'],_0x4f2f44);}else{if(util[_0xcc43('0x14')](this[_0xcc43('0x5')]['id'],this[_0xcc43('0x7')][_0xcc43('0x15')][_0x4f2f44],this[_0xcc43('0x5')][_0xcc43('0x16')],!![])){_0x289990=![];util[_0xcc43('0x17')](this[_0xcc43('0x5')]['id'],this['realtime'][_0xcc43('0x15')][_0x4f2f44],_0xcc43('0x18'));this[_0xcc43('0x7')][_0xcc43('0x15')][_0x4f2f44][_0xcc43('0x19')]=!![];this['realtime'][_0xcc43('0x15')][_0x4f2f44][_0xcc43('0x1a')]=this[_0xcc43('0x6')][_0xcc43('0x1b')];util[_0xcc43('0x1c')](this['notificationId'],this[_0xcc43('0x5')]['id'],this[_0xcc43('0x7')][_0xcc43('0x15')][_0x4f2f44],this[_0xcc43('0x6')],this[_0xcc43('0x4')]);}}}if(_0x289990){logger[_0xcc43('0x1d')](_0xcc43('0x1e'),this[_0xcc43('0x5')]['id']);setTimeout(this[_0xcc43('0x8')][_0xcc43('0xa')](this),0x3e8);}}else{logger['info']('[%s][QUEUE]\x20EMPTY',this[_0xcc43('0x5')]['id']);setTimeout(this[_0xcc43('0x8')][_0xcc43('0xa')](this),0x3e8);}};Beepall[_0xcc43('0xf')][_0xcc43('0xb')]=function(_0x38c47e){if(!_[_0xcc43('0x10')](this[_0xcc43('0x6')])&&!_['isNil'](this[_0xcc43('0x6')][_0xcc43('0x11')])){for(var _0x1d6dc7=0x0,_0x467652;_0x1d6dc7<this[_0xcc43('0x6')][_0xcc43('0x11')][_0xcc43('0x12')];_0x1d6dc7+=0x1){_0x467652=this[_0xcc43('0x6')][_0xcc43('0x11')][_0x1d6dc7]['id'];if(_['isNil'](this[_0xcc43('0x7')][_0xcc43('0x15')][_0x467652])){logger['info'](_0xcc43('0x13'),this[_0xcc43('0x5')]['id'],_0x467652);}else{util[_0xcc43('0x1f')](this[_0xcc43('0x20')],this[_0xcc43('0x5')]['id'],this[_0xcc43('0x7')]['agents'][_0x467652],this[_0xcc43('0x6')],this[_0xcc43('0x4')]);util[_0xcc43('0x17')](this['squeue']['id'],this['realtime'][_0xcc43('0x15')][_0x467652],_0x38c47e?'STOP':_0xcc43('0x21'));this['realtime'][_0xcc43('0x15')][_0x467652]['busy']=![];this[_0xcc43('0x7')]['agents'][_0x467652][_0xcc43('0x1a')]=undefined;}}}if(!_0x38c47e){setTimeout(this['push'][_0xcc43('0xa')](this),0x3e8);}};function beepall(_0x566bce,_0x21fdea,_0x887d9c,_0x65b2dd){return new Beepall(_0x566bce,_0x21fdea,_0x887d9c,_0x65b2dd);}module[_0xcc43('0x22')]=beepall;
\ No newline at end of file
+var _0x6bff=['exports','lodash','uuid','../../../../../config/logger','squeue','queue','realtime','routing','push','handleRun','bind','timeout','handleTimeout','drained','prototype','isNil','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','writeLog','busyQueue','name','showNotification','notificationId','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6bff,0xa6));var _0xf6bf=function(_0x56d84b,_0x22b4dd){_0x56d84b=_0x56d84b-0x0;var _0x57babd=_0x6bff[_0x56d84b];return _0x57babd;};'use strict';var _=require(_0xf6bf('0x0'));var uuid=require(_0xf6bf('0x1'));var util=require('./util');var logger=require(_0xf6bf('0x2'))('routing');var Beepall=function(_0x290028,_0xd1df50,_0x3ab762,_0x14a2d8){this['notificationId']=uuid['v4']();this[_0xf6bf('0x3')]=_0x290028;this[_0xf6bf('0x4')]=_0xd1df50;this[_0xf6bf('0x5')]=_0x3ab762;this[_0xf6bf('0x6')]=_0x14a2d8;this[_0xf6bf('0x3')][_0xf6bf('0x7')](this[_0xf6bf('0x8')][_0xf6bf('0x9')](this),this['handleTimeout']['bind'](this));this['squeue']['on'](_0xf6bf('0xa'),this[_0xf6bf('0xb')][_0xf6bf('0x9')](this));this[_0xf6bf('0x3')]['on'](_0xf6bf('0xc'),this['handleDrained'][_0xf6bf('0x9')](this));};Beepall[_0xf6bf('0xd')]['push']=function(){this['squeue'][_0xf6bf('0x7')](this[_0xf6bf('0x8')]['bind'](this),this[_0xf6bf('0xb')]['bind'](this));};Beepall[_0xf6bf('0xd')]['handleDrained']=function(_0x1aed26){this[_0xf6bf('0xb')](!![]);};Beepall['prototype']['handleRun']=function(_0xfd2b28){var _0x532cb1=!![];if(!_[_0xf6bf('0xe')](this[_0xf6bf('0x4')])&&!_[_0xf6bf('0xe')](this[_0xf6bf('0x4')][_0xf6bf('0xf')])&&this[_0xf6bf('0x4')]['Agents'][_0xf6bf('0x10')]>0x0){for(var _0x3608bf=0x0,_0x14e33f;_0x3608bf<this[_0xf6bf('0x4')]['Agents'][_0xf6bf('0x10')];_0x3608bf+=0x1){_0x14e33f=this[_0xf6bf('0x4')][_0xf6bf('0xf')][_0x3608bf]['id'];if(_[_0xf6bf('0xe')](this[_0xf6bf('0x5')]['agents'][_0x14e33f])){logger[_0xf6bf('0x11')](_0xf6bf('0x12'),this[_0xf6bf('0x3')]['id'],_0x14e33f);}else{if(util[_0xf6bf('0x13')](this[_0xf6bf('0x3')]['id'],this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x14e33f],this[_0xf6bf('0x3')][_0xf6bf('0x15')],!![])){_0x532cb1=![];util[_0xf6bf('0x16')](this[_0xf6bf('0x3')]['id'],this[_0xf6bf('0x5')]['agents'][_0x14e33f],'RINGING');this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x14e33f]['busy']=!![];this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x14e33f][_0xf6bf('0x17')]=this['queue'][_0xf6bf('0x18')];util[_0xf6bf('0x19')](this[_0xf6bf('0x1a')],this[_0xf6bf('0x3')]['id'],this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x14e33f],this[_0xf6bf('0x4')],this['routing']);}}}if(_0x532cb1){logger[_0xf6bf('0x11')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0xf6bf('0x3')]['id']);setTimeout(this[_0xf6bf('0x7')][_0xf6bf('0x9')](this),0x3e8);}}else{logger[_0xf6bf('0x11')](_0xf6bf('0x1b'),this['squeue']['id']);setTimeout(this[_0xf6bf('0x7')][_0xf6bf('0x9')](this),0x3e8);}};Beepall[_0xf6bf('0xd')]['handleTimeout']=function(_0x5bc7cc){if(!_[_0xf6bf('0xe')](this[_0xf6bf('0x4')])&&!_[_0xf6bf('0xe')](this[_0xf6bf('0x4')][_0xf6bf('0xf')])){for(var _0x25f742=0x0,_0x4173d8;_0x25f742<this[_0xf6bf('0x4')][_0xf6bf('0xf')][_0xf6bf('0x10')];_0x25f742+=0x1){_0x4173d8=this[_0xf6bf('0x4')][_0xf6bf('0xf')][_0x25f742]['id'];if(_[_0xf6bf('0xe')](this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x4173d8])){logger[_0xf6bf('0x11')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf6bf('0x3')]['id'],_0x4173d8);}else{util[_0xf6bf('0x1c')](this['notificationId'],this['squeue']['id'],this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x4173d8],this['queue'],this[_0xf6bf('0x6')]);util[_0xf6bf('0x16')](this[_0xf6bf('0x3')]['id'],this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x4173d8],_0x5bc7cc?_0xf6bf('0x1d'):_0xf6bf('0x1e'));this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x4173d8][_0xf6bf('0x1f')]=![];this[_0xf6bf('0x5')][_0xf6bf('0x14')][_0x4173d8]['busyQueue']=undefined;}}}if(!_0x5bc7cc){setTimeout(this['push']['bind'](this),0x3e8);}};function beepall(_0x4a379b,_0x554f4b,_0x3b5238,_0xbe6360){return new Beepall(_0x4a379b,_0x554f4b,_0x3b5238,_0xbe6360);}module[_0xf6bf('0x20')]=beepall;
\ No newline at end of file
index 13c18fb..05777ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeafb=['./rrmemory','./beepall','./agent'];(function(_0x44492f,_0x5c8560){var _0x37c7eb=function(_0x4e3a42){while(--_0x4e3a42){_0x44492f['push'](_0x44492f['shift']());}};_0x37c7eb(++_0x5c8560);}(_0xeafb,0x126));var _0xbeaf=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xeafb[_0xac151d];return _0x111dba;};'use strict';module['exports']={'rrmemory':require(_0xbeaf('0x0')),'beepall':require(_0xbeaf('0x1')),'agent':require(_0xbeaf('0x2'))};
\ No newline at end of file
+var _0xb8b2=['./beepall','./agent','exports','./rrmemory'];(function(_0xdeefbd,_0x9e1b3d){var _0x4ff63f=function(_0x4b51f9){while(--_0x4b51f9){_0xdeefbd['push'](_0xdeefbd['shift']());}};_0x4ff63f(++_0x9e1b3d);}(_0xb8b2,0x132));var _0x2b8b=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xb8b2[_0x4c7fb5];return _0x2e10ac;};'use strict';module[_0x2b8b('0x0')]={'rrmemory':require(_0x2b8b('0x1')),'beepall':require(_0x2b8b('0x2')),'agent':require(_0x2b8b('0x3'))};
\ No newline at end of file
index a475f3f..412991a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1789=['busy','exports','./util','routing','queue','realtime','push','handleRun','handleTimeout','squeue','timeout','bind','drained','prototype','handleDrained','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','done','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busyQueue','name','notificationId','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','isNil','TIMEOUT'];(function(_0x2a5664,_0x636888){var _0x21d552=function(_0x227fc3){while(--_0x227fc3){_0x2a5664['push'](_0x2a5664['shift']());}};_0x21d552(++_0x636888);}(_0x1789,0x1de));var _0x9178=function(_0x5914a3,_0x22e240){_0x5914a3=_0x5914a3-0x0;var _0x25af13=_0x1789[_0x5914a3];return _0x25af13;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require('uuid');var util=require(_0x9178('0x0'));var logger=require('../../../../../config/logger')(_0x9178('0x1'));var RRMemory=function(_0x1bf0fe,_0x5efdb5,_0x321527,_0x5ceaf4){this['notificationId']=uuid['v4']();this['squeue']=_0x1bf0fe;this[_0x9178('0x2')]=_0x5efdb5;this[_0x9178('0x3')]=_0x321527;this[_0x9178('0x1')]=_0x5ceaf4;this['intervals']={};this['squeue'][_0x9178('0x4')](this[_0x9178('0x5')]['bind'](this),this[_0x9178('0x6')]['bind'](this),this['module']);this[_0x9178('0x7')]['on'](_0x9178('0x8'),this[_0x9178('0x6')][_0x9178('0x9')](this));this[_0x9178('0x7')]['on'](_0x9178('0xa'),this['handleDrained'][_0x9178('0x9')](this));};RRMemory[_0x9178('0xb')][_0x9178('0x4')]=function(){this[_0x9178('0x7')][_0x9178('0x4')](this['handleRun']['bind'](this),this[_0x9178('0x6')][_0x9178('0x9')](this));};RRMemory[_0x9178('0xb')][_0x9178('0xc')]=function(_0x2a0442){this[_0x9178('0x6')](!![]);};RRMemory[_0x9178('0xb')]['handleCheckReject']=function(_0x168eb1){if(util['isAgentAvailable'](this[_0x9178('0x7')]['id'],this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]],this[_0x9178('0x7')][_0x9178('0xf')],!![])){logger[_0x9178('0x10')](_0x9178('0x11'),this['squeue']['id'],this[_0x9178('0xe')]);clearInterval(this[_0x9178('0x12')][this[_0x9178('0xe')]]);_0x168eb1[_0x9178('0x13')]();setTimeout(this['push'][_0x9178('0x9')](this),0x3e8);}};RRMemory[_0x9178('0xb')]['handleRun']=function(_0x21da9a){this[_0x9178('0xe')]=rr(this[_0x9178('0x2')]['mapAgentsId']);logger['info'](_0x9178('0x14'),this[_0x9178('0x7')]['id'],this[_0x9178('0xe')]);if(_['isNil'](this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]])){logger[_0x9178('0x10')](_0x9178('0x15'),this[_0x9178('0x7')]['id'],this[_0x9178('0xe')]);_0x21da9a[_0x9178('0x13')]();setTimeout(this[_0x9178('0x4')][_0x9178('0x9')](this),0x3e8);}else{if(util[_0x9178('0x16')](this[_0x9178('0x7')]['id'],this[_0x9178('0x3')][_0x9178('0xd')][this['agentId']],this['squeue']['channel'],!![])){this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]]['busy']=!![];this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]][_0x9178('0x17')]=this[_0x9178('0x2')][_0x9178('0x18')];util['showNotification'](this[_0x9178('0x19')],this[_0x9178('0x7')]['id'],this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]],this[_0x9178('0x2')],this['routing']);util[_0x9178('0x1a')](this[_0x9178('0x7')]['id'],this[_0x9178('0x3')][_0x9178('0xd')][this['agentId']],_0x9178('0x1b'));this[_0x9178('0x12')][this[_0x9178('0xe')]]=setInterval(this['handleCheckReject'][_0x9178('0x9')](this,_0x21da9a),0x3e8);}else{logger[_0x9178('0x10')](_0x9178('0x1c'),this[_0x9178('0x7')]['id'],this['agentId']);_0x21da9a[_0x9178('0x13')]();setTimeout(this[_0x9178('0x4')][_0x9178('0x9')](this),0x3e8);}}};RRMemory[_0x9178('0xb')]['handleTimeout']=function(_0x42dcb8){logger[_0x9178('0x10')](_0x9178('0x1d'),this['squeue']['id'],this['agentId']);if(_[_0x9178('0x1e')](this[_0x9178('0x3')][_0x9178('0xd')][this['agentId']])){logger[_0x9178('0x10')](_0x9178('0x15'),this[_0x9178('0x7')]['id'],this[_0x9178('0xe')]);}else{clearInterval(this[_0x9178('0x12')][this[_0x9178('0xe')]]);util['hideNotification'](this[_0x9178('0x19')],this['squeue']['id'],this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]],this[_0x9178('0x2')],this[_0x9178('0x1')]);util[_0x9178('0x1a')](this[_0x9178('0x7')]['id'],this['realtime'][_0x9178('0xd')][this['agentId']],_0x9178('0x1f'));this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]][_0x9178('0x20')]=![];this[_0x9178('0x3')][_0x9178('0xd')][this[_0x9178('0xe')]]['busyQueue']=undefined;}if(!_0x42dcb8){setTimeout(this[_0x9178('0x4')]['bind'](this),0x3e8);}};function rrmemory(_0x41d8bf,_0xbf8619,_0x1aea1e,_0x338d7a){return new RRMemory(_0x41d8bf,_0xbf8619,_0x1aea1e,_0x338d7a);}module[_0x9178('0x21')]=rrmemory;
\ No newline at end of file
+var _0x678d=['mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','busy','busyQueue','name','queue','writeLog','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','bind','handleTimeout','module','timeout','handleDrained','prototype','handleRun','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','done'];(function(_0x5c04c9,_0x411697){var _0x4bae3b=function(_0xd784c3){while(--_0xd784c3){_0x5c04c9['push'](_0x5c04c9['shift']());}};_0x4bae3b(++_0x411697);}(_0x678d,0xc3));var _0xd678=function(_0x25214b,_0x5800bb){_0x25214b=_0x25214b-0x0;var _0x12a93c=_0x678d[_0x25214b];return _0x12a93c;};'use strict';var rr=require('rr');var _=require(_0xd678('0x0'));var uuid=require('uuid');var util=require(_0xd678('0x1'));var logger=require(_0xd678('0x2'))(_0xd678('0x3'));var RRMemory=function(_0x23dfde,_0x3d69d8,_0x13bac9,_0x434687){this[_0xd678('0x4')]=uuid['v4']();this[_0xd678('0x5')]=_0x23dfde;this['queue']=_0x3d69d8;this[_0xd678('0x6')]=_0x13bac9;this['routing']=_0x434687;this['intervals']={};this[_0xd678('0x5')][_0xd678('0x7')](this['handleRun'][_0xd678('0x8')](this),this[_0xd678('0x9')][_0xd678('0x8')](this),this[_0xd678('0xa')]);this[_0xd678('0x5')]['on'](_0xd678('0xb'),this[_0xd678('0x9')]['bind'](this));this[_0xd678('0x5')]['on']('drained',this[_0xd678('0xc')]['bind'](this));};RRMemory[_0xd678('0xd')][_0xd678('0x7')]=function(){this[_0xd678('0x5')][_0xd678('0x7')](this[_0xd678('0xe')][_0xd678('0x8')](this),this[_0xd678('0x9')][_0xd678('0x8')](this));};RRMemory[_0xd678('0xd')]['handleDrained']=function(_0x422f6b){this[_0xd678('0x9')](!![]);};RRMemory[_0xd678('0xd')]['handleCheckReject']=function(_0x501369){if(util['isAgentAvailable'](this[_0xd678('0x5')]['id'],this[_0xd678('0x6')]['agents'][this[_0xd678('0xf')]],this[_0xd678('0x5')][_0xd678('0x10')],!![])){logger[_0xd678('0x11')](_0xd678('0x12'),this['squeue']['id'],this[_0xd678('0xf')]);clearInterval(this[_0xd678('0x13')][this[_0xd678('0xf')]]);_0x501369[_0xd678('0x14')]();setTimeout(this[_0xd678('0x7')][_0xd678('0x8')](this),0x3e8);}};RRMemory['prototype'][_0xd678('0xe')]=function(_0x33ab89){this[_0xd678('0xf')]=rr(this['queue'][_0xd678('0x15')]);logger[_0xd678('0x11')](_0xd678('0x16'),this[_0xd678('0x5')]['id'],this[_0xd678('0xf')]);if(_[_0xd678('0x17')](this[_0xd678('0x6')][_0xd678('0x18')][this[_0xd678('0xf')]])){logger[_0xd678('0x11')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xd678('0x5')]['id'],this[_0xd678('0xf')]);_0x33ab89[_0xd678('0x14')]();setTimeout(this[_0xd678('0x7')][_0xd678('0x8')](this),0x3e8);}else{if(util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0xd678('0x18')][this['agentId']],this['squeue'][_0xd678('0x10')],!![])){this[_0xd678('0x6')]['agents'][this[_0xd678('0xf')]][_0xd678('0x19')]=!![];this[_0xd678('0x6')]['agents'][this['agentId']][_0xd678('0x1a')]=this['queue'][_0xd678('0x1b')];util['showNotification'](this[_0xd678('0x4')],this[_0xd678('0x5')]['id'],this[_0xd678('0x6')][_0xd678('0x18')][this[_0xd678('0xf')]],this[_0xd678('0x1c')],this[_0xd678('0x3')]);util[_0xd678('0x1d')](this[_0xd678('0x5')]['id'],this['realtime']['agents'][this[_0xd678('0xf')]],_0xd678('0x1e'));this[_0xd678('0x13')][this[_0xd678('0xf')]]=setInterval(this[_0xd678('0x1f')][_0xd678('0x8')](this,_0x33ab89),0x3e8);}else{logger['info'](_0xd678('0x20'),this['squeue']['id'],this[_0xd678('0xf')]);_0x33ab89[_0xd678('0x14')]();setTimeout(this[_0xd678('0x7')]['bind'](this),0x3e8);}}};RRMemory[_0xd678('0xd')][_0xd678('0x9')]=function(_0x3e70a0){logger[_0xd678('0x11')](_0xd678('0x21'),this['squeue']['id'],this['agentId']);if(_[_0xd678('0x17')](this[_0xd678('0x6')]['agents'][this[_0xd678('0xf')]])){logger[_0xd678('0x11')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xd678('0xf')]);}else{clearInterval(this[_0xd678('0x13')][this[_0xd678('0xf')]]);util[_0xd678('0x22')](this[_0xd678('0x4')],this[_0xd678('0x5')]['id'],this[_0xd678('0x6')]['agents'][this[_0xd678('0xf')]],this[_0xd678('0x1c')],this['routing']);util['writeLog'](this[_0xd678('0x5')]['id'],this[_0xd678('0x6')][_0xd678('0x18')][this[_0xd678('0xf')]],_0xd678('0x23'));this[_0xd678('0x6')][_0xd678('0x18')][this[_0xd678('0xf')]][_0xd678('0x19')]=![];this[_0xd678('0x6')][_0xd678('0x18')][this[_0xd678('0xf')]][_0xd678('0x1a')]=undefined;}if(!_0x3e70a0){setTimeout(this['push'][_0xd678('0x8')](this),0x3e8);}};function rrmemory(_0x1e6106,_0x458fa5,_0x25296b,_0x232e4d){return new RRMemory(_0x1e6106,_0x458fa5,_0x25296b,_0x232e4d);}module['exports']=rrmemory;
\ No newline at end of file
index bfb9893..0284dfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','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','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE'];(function(_0x5680d9,_0x35e00a){var _0x35fcf4=function(_0x513f4d){while(--_0x513f4d){_0x5680d9['push'](_0x5680d9['shift']());}};_0x35fcf4(++_0x35e00a);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0x3f8a[_0x271060];return _0x40540b;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var utils=require(_0xa3f8('0x2'));var Mustache=require(_0xa3f8('0x3'));var Redis=require('ioredis');var config=require(_0xa3f8('0x4'));var logger=require(_0xa3f8('0x5'))(_0xa3f8('0x6'));config[_0xa3f8('0x7')]=_[_0xa3f8('0x8')](config[_0xa3f8('0x7')],{'host':_0xa3f8('0x9'),'port':0x18eb});var io=require(_0xa3f8('0xa'))(new Redis(config[_0xa3f8('0x7')]));function emit(_0xf895d9,_0xcfea5,_0x268332){io['to'](_0xf895d9)[_0xa3f8('0xb')](_0xcfea5,_0x268332);}function sendNotification(_0x2448de,_0x2c89bb,_0x350935,_0xcdb0d4,_0x5c3288,_0x47496a){io['to'](util[_0xa3f8('0xc')](_0xa3f8('0xd'),_0xcdb0d4[_0xa3f8('0xe')]))['emit'](_0xa3f8('0xf'),_0xcdb0d4);var _0x26f0a0=_0x47496a||{};var _0x414bd7=_0x350935[_0xa3f8('0x10')]('.');var _0xd97ac9={'uniqueid':_0x2c89bb,'channel':_0x414bd7[0x0],'id':_0x414bd7[0x1],'title':_0x414bd7[0x0]+_0xa3f8('0x11'),'interactionId':_0x414bd7[0x2],'queue':_0x5c3288?_0x5c3288[_0xa3f8('0xe')]:null,'sound':_0x26f0a0[_0xa3f8('0x12')][_0xa3f8('0x13')],'shake':_0x26f0a0[_0xa3f8('0x12')][_0xa3f8('0x14')]};try{if(!_0x26f0a0[_0xa3f8('0x15')]){_0x26f0a0['body']={};}if(_0x5c3288){_0x26f0a0[_0xa3f8('0x15')][_0xa3f8('0x16')]=_0x5c3288;}else if(_0x26f0a0[_0xa3f8('0x15')][_0xa3f8('0x16')]){delete _0x26f0a0['body'][_0xa3f8('0x16')];}_0xd97ac9[_0xa3f8('0x17')]=utils[_0xa3f8('0x18')](_0x26f0a0[_0xa3f8('0x12')][_0xa3f8('0x19')],_0x26f0a0);}catch(_0x259efe){_0xd97ac9[_0xa3f8('0x17')]=_0xa3f8('0x1a');logger[_0xa3f8('0x1b')](util[_0xa3f8('0xc')]('[%s][QUEUE]\x20%s',_0x2c89bb,_0x259efe[_0xa3f8('0x1c')]));}io['to'](util['format'](_0xa3f8('0xd'),_0xcdb0d4[_0xa3f8('0xe')]))[_0xa3f8('0xb')](util[_0xa3f8('0xc')]('notification:%s',_0x2448de?_0xa3f8('0x1d'):'remove'),_0xd97ac9);}function writeLog(_0x43c393,_0x58336d,_0x4066bb){return logger[_0xa3f8('0x1e')](util[_0xa3f8('0xc')](_0xa3f8('0x1f'),_0x43c393,_0x58336d[_0xa3f8('0xe')],_0x4066bb));}exports[_0xa3f8('0x20')]=function(_0x187352,_0x490717,_0xae76ec,_0x4d0e72){if(_0x490717[_0xa3f8('0x21')]){writeLog(_0x187352,_0x490717,_0xa3f8('0x22'));return![];}if(!_0x490717[_0xa3f8('0x23')]){writeLog(_0x187352,_0x490717,_0xa3f8('0x24'));return![];}if(_0x490717[_0xae76ec+_0xa3f8('0x25')]){writeLog(_0x187352,_0x490717,_0xa3f8('0x26'));return![];}if(_0x4d0e72&&_0x490717[_0xa3f8('0x27')](_0xae76ec+_0xa3f8('0x28'))&&_0x490717[_0xa3f8('0x27')](_0xae76ec+_0xa3f8('0x29'))){if(_0x490717[_0xae76ec+'Capacity']>0x0&&_0x490717[_0xae76ec+_0xa3f8('0x29')]>=_0x490717[_0xae76ec+_0xa3f8('0x28')]){writeLog(_0x187352,_0x490717,_0xae76ec[_0xa3f8('0x2a')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xa3f8('0x2b')]=function(_0x57f6be,_0xbad6a6,_0x3a3746,_0x3c1128,_0x4ea213){return sendNotification(!![],_0x57f6be,_0xbad6a6,_0x3a3746,_0x3c1128,_0x4ea213);};exports[_0xa3f8('0x2c')]=function(_0x5e69e2,_0x21c57e,_0x4281ea,_0x226153,_0x406140){return sendNotification(![],_0x5e69e2,_0x21c57e,_0x4281ea,_0x226153,_0x406140);};exports[_0xa3f8('0x2d')]=writeLog;
\ No newline at end of file
+var _0x5d17=['../../../../../config/logger','redis','defaults','localhost','emit','user:%s','name','user:save','split','\x20interaction','account','notificationSound','notificationShake','queue','body','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','showNotification','writeLog','lodash','util','ioredis','../../../../../config/environment'];(function(_0x2d72b7,_0x583095){var _0x9b5296=function(_0x557374){while(--_0x557374){_0x2d72b7['push'](_0x2d72b7['shift']());}};_0x9b5296(++_0x583095);}(_0x5d17,0x114));var _0x75d1=function(_0x2e0bed,_0x24b28d){_0x2e0bed=_0x2e0bed-0x0;var _0x45e74e=_0x5d17[_0x2e0bed];return _0x45e74e;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x75d1('0x2'));var config=require(_0x75d1('0x3'));var logger=require(_0x75d1('0x4'))('routing');config[_0x75d1('0x5')]=_[_0x75d1('0x6')](config[_0x75d1('0x5')],{'host':_0x75d1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x75d1('0x5')]));function emit(_0x116a51,_0x5c957a,_0x1ee61b){io['to'](_0x116a51)[_0x75d1('0x8')](_0x5c957a,_0x1ee61b);}function sendNotification(_0x105607,_0xf9f8e,_0x5acfa0,_0x4cf632,_0x40df40,_0x4a3bb3){io['to'](util['format'](_0x75d1('0x9'),_0x4cf632[_0x75d1('0xa')]))['emit'](_0x75d1('0xb'),_0x4cf632);var _0x3d7e39=_0x4a3bb3||{};var _0x28b9b4=_0x5acfa0[_0x75d1('0xc')]('.');var _0x6c1265={'uniqueid':_0xf9f8e,'channel':_0x28b9b4[0x0],'id':_0x28b9b4[0x1],'title':_0x28b9b4[0x0]+_0x75d1('0xd'),'interactionId':_0x28b9b4[0x2],'queue':_0x40df40?_0x40df40['name']:null,'sound':_0x3d7e39[_0x75d1('0xe')][_0x75d1('0xf')],'shake':_0x3d7e39[_0x75d1('0xe')][_0x75d1('0x10')]};try{if(!_0x3d7e39['body']){_0x3d7e39['body']={};}if(_0x40df40){_0x3d7e39['body'][_0x75d1('0x11')]=_0x40df40;}else if(_0x3d7e39[_0x75d1('0x12')][_0x75d1('0x11')]){delete _0x3d7e39['body'][_0x75d1('0x11')];}_0x6c1265[_0x75d1('0x13')]=utils[_0x75d1('0x14')](_0x3d7e39[_0x75d1('0xe')][_0x75d1('0x15')],_0x3d7e39);}catch(_0x39a26b){_0x6c1265[_0x75d1('0x13')]=_0x75d1('0x16');logger[_0x75d1('0x17')](util[_0x75d1('0x18')](_0x75d1('0x19'),_0xf9f8e,_0x39a26b['message']));}io['to'](util['format'](_0x75d1('0x9'),_0x4cf632[_0x75d1('0xa')]))['emit'](util[_0x75d1('0x18')](_0x75d1('0x1a'),_0x105607?_0x75d1('0x1b'):_0x75d1('0x1c')),_0x6c1265);}function writeLog(_0xa42dbe,_0xac6a24,_0x51d3b0){return logger[_0x75d1('0x1d')](util[_0x75d1('0x18')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0xa42dbe,_0xac6a24[_0x75d1('0xa')],_0x51d3b0));}exports[_0x75d1('0x1e')]=function(_0x526f6c,_0x2c0c21,_0x5e70ec,_0x3a85c0){if(_0x2c0c21[_0x75d1('0x1f')]){writeLog(_0x526f6c,_0x2c0c21,_0x75d1('0x20'));return![];}if(!_0x2c0c21['online']){writeLog(_0x526f6c,_0x2c0c21,'OFFLINE');return![];}if(_0x2c0c21[_0x5e70ec+_0x75d1('0x21')]){writeLog(_0x526f6c,_0x2c0c21,_0x75d1('0x22'));return![];}if(_0x3a85c0&&_0x2c0c21[_0x75d1('0x23')](_0x5e70ec+_0x75d1('0x24'))&&_0x2c0c21['hasOwnProperty'](_0x5e70ec+_0x75d1('0x25'))){if(_0x2c0c21[_0x5e70ec+_0x75d1('0x24')]>0x0&&_0x2c0c21[_0x5e70ec+_0x75d1('0x25')]>=_0x2c0c21[_0x5e70ec+'Capacity']){writeLog(_0x526f6c,_0x2c0c21,_0x5e70ec['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x75d1('0x26')]=function(_0x30d9f3,_0x45c182,_0x468bf0,_0x38653d,_0x519ceb){return sendNotification(!![],_0x30d9f3,_0x45c182,_0x468bf0,_0x38653d,_0x519ceb);};exports['hideNotification']=function(_0x410e16,_0x197f52,_0x4967b5,_0x2408b6,_0x5aa4fa){return sendNotification(![],_0x410e16,_0x197f52,_0x4967b5,_0x2408b6,_0x5aa4fa);};exports[_0x75d1('0x27')]=writeLog;
\ No newline at end of file
index 4607eca..868ec3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3280=['map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','isObject','stringify','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s'];(function(_0xba9ce3,_0xe1816d){var _0x580c36=function(_0x2140c9){while(--_0x2140c9){_0xba9ce3['push'](_0xba9ce3['shift']());}};_0x580c36(++_0xe1816d);}(_0x3280,0x17a));var _0x0328=function(_0x3ddc2e,_0xbe589f){_0x3ddc2e=_0x3ddc2e-0x0;var _0x5ab513=_0x3280[_0x3ddc2e];return _0x5ab513;};'use strict';var schema=require('validate');var sh=require(_0x0328('0x0'));var _=require(_0x0328('0x1'));var utils=require(_0x0328('0x2'));var logger=require(_0x0328('0x3'))(_0x0328('0x4'));var system=schema({'command':{'type':_0x0328('0x5'),'required':!![],'message':_0x0328('0x6')}});exports[_0x0328('0x7')]=function(_0x557b66,_0x46c439){return function(_0x1e66ed){try{var _0x47701f={'command':_0x46c439[0x0]};var _0x1cca1b=system[_0x0328('0x8')](_0x47701f,{'typecast':!![]});if(_0x1cca1b[_0x0328('0x9')]){logger[_0x0328('0xa')](_0x0328('0xb'),_0x557b66,_[_0x0328('0xc')](_0x1cca1b,_0x0328('0xd'))['join'](',\x20'));logger[_0x0328('0xe')](_0x0328('0xf'),_0x557b66);_0x1e66ed['next']();}else{var _0x3ec825=this;var _0xc8bfd9=utils['getMustacheRender'](_0x46c439[0x0],this);logger[_0x0328('0xe')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x557b66,_0xc8bfd9);sh['exec'](_[_0x0328('0x10')](_0xc8bfd9),function(_0x541554,_0x430a57){logger['info'](_0x0328('0x11'),_0x557b66,_0x541554);if(_0x541554==0x0){var _0x33c259=_0x430a57[_0x0328('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x0328('0x13')](_0x46c439[0x1])||_[_0x0328('0x14')](_0x46c439[0x1])){logger['info'](_0x0328('0x15'),_0x557b66);_0x3ec825[_0x0328('0x16')][_0x46c439[0x1]]=_0x33c259;}else{logger[_0x0328('0xe')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x557b66,_0x46c439[0x1],_0x33c259);_0x3ec825[_0x0328('0x16')][_0x46c439[0x1]]=_0x33c259;}}_0x1e66ed[_0x0328('0x17')]();});}}catch(_0x31f8e7){logger[_0x0328('0xa')](_0x0328('0xb'),_0x557b66,_[_0x0328('0x18')](_0x31f8e7)?JSON[_0x0328('0x19')](_0x31f8e7):_0x31f8e7);logger[_0x0328('0xe')](_0x0328('0xf'),_0x557b66);_0x1e66ed[_0x0328('0x17')]();}};};
\ No newline at end of file
+var _0xf53f=['./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','info','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash'];(function(_0x2f7ccd,_0x17589f){var _0x614602=function(_0x38467d){while(--_0x38467d){_0x2f7ccd['push'](_0x2f7ccd['shift']());}};_0x614602(++_0x17589f);}(_0xf53f,0x8d));var _0xff53=function(_0x4b0d89,_0xf5cd19){_0x4b0d89=_0x4b0d89-0x0;var _0x37a81a=_0xf53f[_0x4b0d89];return _0x37a81a;};'use strict';var schema=require(_0xff53('0x0'));var sh=require(_0xff53('0x1'));var _=require(_0xff53('0x2'));var utils=require(_0xff53('0x3'));var logger=require(_0xff53('0x4'))(_0xff53('0x5'));var system=schema({'command':{'type':_0xff53('0x6'),'required':!![],'message':_0xff53('0x7')}});exports[_0xff53('0x8')]=function(_0x2077b9,_0x28dacf){return function(_0x495edc){try{var _0x54d39c={'command':_0x28dacf[0x0]};var _0x54e637=system[_0xff53('0x0')](_0x54d39c,{'typecast':!![]});if(_0x54e637['length']){logger[_0xff53('0x9')](_0xff53('0xa'),_0x2077b9,_[_0xff53('0xb')](_0x54e637,'message')['join'](',\x20'));logger[_0xff53('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2077b9);_0x495edc[_0xff53('0xd')]();}else{var _0xecf2a7=this;var _0x511667=utils[_0xff53('0xe')](_0x28dacf[0x0],this);logger[_0xff53('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x2077b9,_0x511667);sh[_0xff53('0xf')](_[_0xff53('0x10')](_0x511667),function(_0x3f784c,_0x48f3d3){logger[_0xff53('0xc')](_0xff53('0x11'),_0x2077b9,_0x3f784c);if(_0x3f784c==0x0){var _0x97617c=_0x48f3d3['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xff53('0x12')](_0x28dacf[0x1])||_[_0xff53('0x13')](_0x28dacf[0x1])){logger['info']('[%s][SYSTEM]\x20no\x20variable',_0x2077b9);_0xecf2a7['body'][_0x28dacf[0x1]]=_0x97617c;}else{logger['info'](_0xff53('0x14'),_0x2077b9,_0x28dacf[0x1],_0x97617c);_0xecf2a7[_0xff53('0x15')][_0x28dacf[0x1]]=_0x97617c;}}_0x495edc[_0xff53('0xd')]();});}}catch(_0x5561ec){logger[_0xff53('0x9')]('[%s][SYSTEM]\x20%s',_0x2077b9,_['isObject'](_0x5561ec)?JSON[_0xff53('0x16')](_0x5561ec):_0x5561ec);logger[_0xff53('0xc')](_0xff53('0x17'),_0x2077b9);_0x495edc[_0xff53('0xd')]();}};};
\ No newline at end of file
index b0f40cf..efbb5e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e60=['lodash','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','error','[%s][TAG]\x20%s','finally','stringify','next','validate'];(function(_0x2e9e7a,_0x5b939a){var _0x1608b0=function(_0x2295b8){while(--_0x2295b8){_0x2e9e7a['push'](_0x2e9e7a['shift']());}};_0x1608b0(++_0x5b939a);}(_0x9e60,0x179));var _0x09e6=function(_0x30a9a7,_0x4e8b26){_0x30a9a7=_0x30a9a7-0x0;var _0x253ca6=_0x9e60[_0x30a9a7];return _0x253ca6;};'use strict';var schema=require(_0x09e6('0x0'));var _=require(_0x09e6('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x09e6('0x2')),'mailInteraction':require(_0x09e6('0x3')),'faxInteraction':require(_0x09e6('0x4')),'whatsappInteraction':require(_0x09e6('0x5'))};var logger=require(_0x09e6('0x6'))(_0x09e6('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x09e6('0x8')}});exports[_0x09e6('0x9')]=function(_0x4b5f8e,_0x1216cf,_0x5e4d1b,_0x2d2603){return function(_0x3c109c){try{var _0x4a50c2={'tag':_0x1216cf[0x0]};var _0x1ec4d2=tag[_0x09e6('0x0')](_0x4a50c2,{'typecast':!![]});if(_0x1ec4d2[_0x09e6('0xa')]){logger['error']('[%s][TAG]\x20%s',_0x4b5f8e,_[_0x09e6('0xb')](_0x1ec4d2,_0x09e6('0xc'))[_0x09e6('0xd')](',\x20'));logger[_0x09e6('0xe')](_0x09e6('0xf'),_0x4b5f8e);_0x3c109c['next']();}else{var _0x154f8f={'ids':[_0x1216cf[0x0]]};if(rpc[_0x2d2603[_0x09e6('0x10')]+_0x09e6('0x11')]){rpc[_0x2d2603['channel']+_0x09e6('0x11')]['addTags'](_0x2d2603[_0x09e6('0x12')]['id'],_0x154f8f)[_0x09e6('0x13')](function(_0x3ce0bc){logger['info'](_0x09e6('0x14'),_0x4b5f8e,_0x1216cf[0x1],_0x2d2603['channel'],_0x2d2603['interaction']['id']);})[_0x09e6('0x15')](function(_0x58e459){logger[_0x09e6('0x16')](_0x09e6('0x17'),_0x4b5f8e,JSON['stringify'](_0x58e459));logger['info'](_0x09e6('0xf'),_0x4b5f8e);})[_0x09e6('0x18')](function(){_0x3c109c['next']();});}}}catch(_0x351291){logger[_0x09e6('0x16')]('[%s][TAG]\x20%s',_0x4b5f8e,_['isObject'](_0x351291)?JSON[_0x09e6('0x19')](_0x351291):_0x351291);logger[_0x09e6('0xe')](_0x09e6('0xf'),_0x4b5f8e);_0x3c109c[_0x09e6('0x1a')]();}};};
\ No newline at end of file
+var _0xa010=['validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','consequence','length','error','map','message','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','isObject','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x1bcc20,_0x381264){var _0x2ccf96=function(_0x3782ec){while(--_0x3782ec){_0x1bcc20['push'](_0x1bcc20['shift']());}};_0x2ccf96(++_0x381264);}(_0xa010,0x91));var _0x0a01=function(_0x5ef37b,_0x166e27){_0x5ef37b=_0x5ef37b-0x0;var _0x2a10fa=_0xa010[_0x5ef37b];return _0x2a10fa;};'use strict';var schema=require(_0x0a01('0x0'));var _=require(_0x0a01('0x1'));var rpc={'chatInteraction':require(_0x0a01('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x0a01('0x3')),'mailInteraction':require(_0x0a01('0x4')),'faxInteraction':require(_0x0a01('0x5')),'whatsappInteraction':require(_0x0a01('0x6'))};var logger=require(_0x0a01('0x7'))(_0x0a01('0x8'));var tag=schema({'tag':{'type':_0x0a01('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x0a01('0xa')]=function(_0x16f49a,_0x3c0bda,_0x8a91ef,_0x34d628){return function(_0x5aa622){try{var _0x240a6b={'tag':_0x3c0bda[0x0]};var _0x39e69d=tag[_0x0a01('0x0')](_0x240a6b,{'typecast':!![]});if(_0x39e69d[_0x0a01('0xb')]){logger[_0x0a01('0xc')]('[%s][TAG]\x20%s',_0x16f49a,_[_0x0a01('0xd')](_0x39e69d,_0x0a01('0xe'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x16f49a);_0x5aa622[_0x0a01('0xf')]();}else{var _0x571986={'ids':[_0x3c0bda[0x0]]};if(rpc[_0x34d628[_0x0a01('0x10')]+'Interaction']){rpc[_0x34d628['channel']+_0x0a01('0x11')][_0x0a01('0x12')](_0x34d628[_0x0a01('0x13')]['id'],_0x571986)[_0x0a01('0x14')](function(_0x3788bd){logger[_0x0a01('0x15')](_0x0a01('0x16'),_0x16f49a,_0x3c0bda[0x1],_0x34d628['channel'],_0x34d628[_0x0a01('0x13')]['id']);})[_0x0a01('0x17')](function(_0x583428){logger['error'](_0x0a01('0x18'),_0x16f49a,JSON[_0x0a01('0x19')](_0x583428));logger[_0x0a01('0x15')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x16f49a);})[_0x0a01('0x1a')](function(){_0x5aa622[_0x0a01('0xf')]();});}}}catch(_0x11622e){logger['error'](_0x0a01('0x18'),_0x16f49a,_[_0x0a01('0x1b')](_0x11622e)?JSON['stringify'](_0x11622e):_0x11622e);logger['info'](_0x0a01('0x1c'),_0x16f49a);_0x5aa622[_0x0a01('0xf')]();}};};
\ No newline at end of file
index ce2f9d3..c99940f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x5ac676,_0x502b07){var _0x1b80ba=function(_0xa93984){while(--_0xa93984){_0x5ac676['push'](_0x5ac676['shift']());}};_0x1b80ba(++_0x502b07);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}};
\ No newline at end of file
+var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1bed5a,_0x4ac2af){var _0xe715bb=function(_0x31d948){while(--_0x31d948){_0x1bed5a['push'](_0x1bed5a['shift']());}};_0xe715bb(++_0x4ac2af);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
index 0c49dba..d264330 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea30=['error','stack','routing\x20is\x20empty','agent','agents','busyQueue','channel','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','end','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','values','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','message','interaction','applications','isArray','length','join','.js','app','toLowerCase','autoreply','appdata','split','mail','push','dialogflow','slice','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','matchPath','emit','complete'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xea30,0x1a6));var _0x0ea3=function(_0x3845b1,_0x7beff6){_0x3845b1=_0x3845b1-0x0;var _0x282430=_0xea30[_0x3845b1];return _0x282430;};'use strict';var _=require('lodash');var util=require(_0x0ea3('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x0ea3('0x1'));var BPromise=require(_0x0ea3('0x2'));var uuid=require(_0x0ea3('0x3'));var config=require(_0x0ea3('0x4'));var logger=require('../../../config/logger')(_0x0ea3('0x5'));var rpc={'openchannelQueueReport':require(_0x0ea3('0x6')),'mailQueueReport':require(_0x0ea3('0x7')),'chatQueueReport':require(_0x0ea3('0x8')),'smsQueueReport':require(_0x0ea3('0x9')),'faxQueueReport':require(_0x0ea3('0xa')),'whatsappQueueReport':require(_0x0ea3('0xb'))};var RuleEngine=require(_0x0ea3('0xc'));function getId(_0x3e01df,_0x512be0,_0x3b728d){return util[_0x0ea3('0xd')](_0x0ea3('0xe'),_0x3e01df,_0x512be0||0x0,_0x3b728d||0x0);}function getIntervals(_0x5c60e2,_0x396f60){var _0x5c0fd8=[];if(!_['isNil'](_0x396f60[_0x0ea3('0xf')])&&!_[_0x0ea3('0x10')](_0x5c60e2[_0x396f60[_0x0ea3('0xf')]])&&!_[_0x0ea3('0x10')](_0x5c60e2[_0x396f60['IntervalId']][_0x0ea3('0x11')])){_0x5c0fd8=_['map'](_0x5c60e2[_0x396f60[_0x0ea3('0xf')]]['Intervals'],_0x0ea3('0x12'));}else if(!_['isNil'](_0x396f60[_0x0ea3('0x12')])){_0x5c0fd8=[_0x396f60['interval']];}return _0x5c0fd8;}exports[_0x0ea3('0x13')]=function(_0x49f68e){_0x49f68e[_0x0ea3('0x14')]={};return new BPromise(function(_0x1dcd1f,_0x37102a){var _0x3c0cf8={'Start':function(_0x1f4f74){var _0x391d3f=this;return new Promise(function(_0x3446dc,_0x4e0047){if(_0x1f4f74){try{var _0xee22a1=[];var _0x5bead7=getId(_0x1f4f74['channel'],_0x1f4f74[_0x0ea3('0x15')]?_0x1f4f74['message']['id']:0x0,_0x1f4f74[_0x0ea3('0x16')]?_0x1f4f74[_0x0ea3('0x16')]['id']:0x0);if(_0x1f4f74[_0x0ea3('0x17')]&&_[_0x0ea3('0x18')](_0x1f4f74['applications'])&&_0x1f4f74[_0x0ea3('0x17')]['length']){for(var _0x595cd8=0x0;_0x595cd8<_0x1f4f74[_0x0ea3('0x17')][_0x0ea3('0x19')];_0x595cd8+=0x1){var _0x52739b=_0x1f4f74[_0x0ea3('0x17')][_0x595cd8];if(fs['existsSync'](path[_0x0ea3('0x1a')](__dirname,'applications',_0x52739b['app']+_0x0ea3('0x1b')))){var _0x4dd874=[];switch(_0x52739b[_0x0ea3('0x1c')][_0x0ea3('0x1d')]()){case _0x0ea3('0x1e'):var _0x5298e6=_0x52739b[_0x0ea3('0x1f')][_0x0ea3('0x20')](',');if(_0x1f4f74['channel']===_0x0ea3('0x21')){_0x4dd874['push'](_0x5298e6[0x0]);_0x4dd874[_0x0ea3('0x22')](_0x5298e6[0x1]);_0x4dd874[_0x0ea3('0x22')](_0x5298e6['slice'](0x2,_0x5298e6[_0x0ea3('0x19')])[_0x0ea3('0x1a')](','));}else{_0x4dd874[_0x0ea3('0x22')](_0x5298e6[0x0]);_0x4dd874[_0x0ea3('0x22')](_0x5298e6['slice'](0x1,_0x5298e6[_0x0ea3('0x19')])[_0x0ea3('0x1a')](','));}break;case _0x0ea3('0x23'):var _0x558ea3=_0x52739b[_0x0ea3('0x1f')][_0x0ea3('0x20')](',');_0x4dd874[_0x0ea3('0x22')](_0x558ea3[0x0]);_0x4dd874['push'](_0x558ea3[0x1]);_0x4dd874[_0x0ea3('0x22')](_0x558ea3[_0x0ea3('0x24')](0x2,_0x558ea3[_0x0ea3('0x19')])['join'](','));break;case _0x0ea3('0x25'):var _0x2caad4=_0x52739b[_0x0ea3('0x1f')][_0x0ea3('0x20')](',');_0x4dd874['push'](_0x2caad4[0x0]);_0x4dd874[_0x0ea3('0x22')](_0x2caad4[0x1]);_0x4dd874[_0x0ea3('0x22')](_0x2caad4[0x2]);_0x4dd874[_0x0ea3('0x22')](_0x2caad4[0x3]);_0x4dd874[_0x0ea3('0x22')](_0x2caad4[_0x0ea3('0x24')](0x4,_0x2caad4[_0x0ea3('0x19')])[_0x0ea3('0x1a')](','));break;case _0x0ea3('0x26'):var _0x37640a=_0x52739b[_0x0ea3('0x1f')][_0x0ea3('0x20')](',');_0x4dd874[_0x0ea3('0x22')](_0x37640a[0x0]);_0x4dd874['push'](_0x37640a[0x1]);_0x4dd874[_0x0ea3('0x22')](_0x37640a[0x2]);_0x4dd874['push'](_0x37640a[0x3]);_0x4dd874[_0x0ea3('0x22')](_0x37640a[_0x0ea3('0x24')](0x4,_0x37640a[_0x0ea3('0x19')])[_0x0ea3('0x1a')](','));break;case _0x0ea3('0x15'):_0x4dd874[_0x0ea3('0x22')](_0x52739b['appdata']);break;case _0x0ea3('0x27'):_0x4dd874[_0x0ea3('0x22')](_0x52739b[_0x0ea3('0x28')]);_0x4dd874[_0x0ea3('0x22')](_0x52739b[_0x0ea3('0x1f')]);break;default:_0x4dd874=_[_0x0ea3('0x10')](_0x52739b[_0x0ea3('0x1f')])?[]:_0x52739b[_0x0ea3('0x1f')]['split'](',');}var _0x3aa601={'id':util[_0x0ea3('0xd')](_0x0ea3('0x29'),_0x5bead7,_0x52739b['id'],_0x52739b['app']),'condition':require('./interval')[_0x0ea3('0x2a')](_0x5bead7,getIntervals(_0x49f68e[_0x0ea3('0x2b')],_0x52739b),_0x49f68e),'consequence':require(_0x0ea3('0x2c')+_0x52739b[_0x0ea3('0x1c')])[_0x0ea3('0x2d')](_0x5bead7,_0x4dd874,_0x49f68e,_0x1f4f74),'p':_0x52739b['priority']||0x0};logger[_0x0ea3('0x2e')](_0x0ea3('0x2f'),_0x3aa601['id'],_0x0ea3('0x30'),getIntervals(_0x49f68e[_0x0ea3('0x2b')],_0x52739b)['join']('\x20|\x20'));_0xee22a1['push'](_0x3aa601);}else{logger['error'](_0x0ea3('0x31'),path[_0x0ea3('0x1a')](__dirname,_0x0ea3('0x17'),_0x52739b[_0x0ea3('0x1c')]+_0x0ea3('0x1b')));}}_0x49f68e['rules'][_0x5bead7]=new RuleEngine(_0xee22a1);_0x49f68e[_0x0ea3('0x14')][_0x5bead7]['execute'](_0x1f4f74,function(_0x39f12b){logger[_0x0ea3('0x2e')]('Applications\x20executed',JSON['stringify'](_0x39f12b[_0x0ea3('0x32')]));if(_0x49f68e[_0x0ea3('0x14')][_0x5bead7]){_0x49f68e[_0x0ea3('0x14')][_0x5bead7][_0x0ea3('0x33')](_0x0ea3('0x34'));}});return _0x3446dc({'code':0xc8,'message':_0x1f4f74});}else{logger[_0x0ea3('0x2e')]('No\x20applications\x20to\x20execute');return _0x3446dc({'code':0xc8,'message':_0x1f4f74});}}catch(_0x5e1199){logger[_0x0ea3('0x35')](_0x5e1199[_0x0ea3('0x36')]);return _0x4e0047(_0x391d3f[_0x0ea3('0x35')](0x1f4,_0x5e1199));}}return _0x4e0047(_0x0ea3('0x37'));});},'AcceptMessage':function(_0x462bd6){var _0x284668=this;return new Promise(function(_0xa6cc48,_0x1489b2){if(_0x462bd6[_0x0ea3('0x38')]&&_0x462bd6[_0x0ea3('0x38')]['id']){if(_0x49f68e[_0x0ea3('0x39')][_0x462bd6[_0x0ea3('0x38')]['id']]){_0x49f68e[_0x0ea3('0x39')][_0x462bd6[_0x0ea3('0x38')]['id']]['busy']=![];_0x49f68e[_0x0ea3('0x39')][_0x462bd6[_0x0ea3('0x38')]['id']][_0x0ea3('0x3a')]=undefined;}}if(_0x462bd6[_0x0ea3('0x15')]&&_0x462bd6[_0x0ea3('0x15')]['id']){try{var _0x5713c9=getId(_0x462bd6[_0x0ea3('0x3b')],_0x462bd6[_0x0ea3('0x15')]?_0x462bd6[_0x0ea3('0x15')]['id']:0x0,_0x462bd6[_0x0ea3('0x16')]?_0x462bd6[_0x0ea3('0x16')]['id']:0x0);if(_0x49f68e[_0x0ea3('0x14')][_0x5713c9]){_0x49f68e[_0x0ea3('0x14')][_0x5713c9][_0x0ea3('0x33')]('end');if(rpc[_0x462bd6['channel']+_0x0ea3('0x3c')]){rpc[_0x462bd6[_0x0ea3('0x3b')]+'QueueReport'][_0x0ea3('0x3d')](_0x5713c9,{'UserId':_0x462bd6[_0x0ea3('0x15')][_0x0ea3('0x3e')]})[_0x0ea3('0x3f')](function(_0x11e176){logger['error'](_0x0ea3('0x40'));});}}return _0xa6cc48({'code':0xc8,'message':_0x462bd6});}catch(_0x4ab885){logger[_0x0ea3('0x35')](_0x4ab885[_0x0ea3('0x36')]);return _0x1489b2(_0x284668[_0x0ea3('0x35')](0x1f4,_0x4ab885));}}logger[_0x0ea3('0x35')](_0x0ea3('0x41'));return _0x1489b2(_0x284668[_0x0ea3('0x35')](0x1f4,_0x0ea3('0x41')));});},'RejectMessage':function(_0x423c93){var _0x41c8ce=this;return new Promise(function(_0x2820b3,_0x2abf97){if(_0x423c93[_0x0ea3('0x38')]&&_0x423c93[_0x0ea3('0x38')]['id']){try{if(_0x49f68e[_0x0ea3('0x39')][_0x423c93[_0x0ea3('0x38')]['id']]){_0x49f68e['agents'][_0x423c93[_0x0ea3('0x38')]['id']][_0x0ea3('0x42')]=![];_0x49f68e[_0x0ea3('0x39')][_0x423c93[_0x0ea3('0x38')]['id']][_0x0ea3('0x3a')]=undefined;}return _0x2820b3({'code':0xc8,'message':_0x423c93});}catch(_0x1bbd2b){logger['error'](_0x1bbd2b[_0x0ea3('0x36')]);return _0x2abf97(_0x41c8ce[_0x0ea3('0x35')](0x1f4,_0x1bbd2b));}}logger[_0x0ea3('0x35')]('message\x20is\x20empty');return _0x2abf97(_0x41c8ce['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x30ae20){var _0x2d7a11=this;return new Promise(function(_0x4a3654,_0x309166){if(_0x30ae20[_0x0ea3('0x3b')]&&_0x30ae20[_0x0ea3('0x16')]&&_0x30ae20[_0x0ea3('0x16')]['id']){try{var _0x22456b=getId(_0x30ae20['channel'],_0x30ae20[_0x0ea3('0x15')]?_0x30ae20['message']['id']:0x0,_0x30ae20[_0x0ea3('0x16')]?_0x30ae20[_0x0ea3('0x16')]['id']:0x0);if(_0x49f68e[_0x0ea3('0x14')][_0x22456b]){_0x49f68e[_0x0ea3('0x14')][_0x22456b][_0x0ea3('0x33')](_0x0ea3('0x43'));}return _0x4a3654({'code':0xc8,'message':_0x30ae20});}catch(_0x57e783){logger['error'](_0x57e783[_0x0ea3('0x36')]);return _0x309166(_0x2d7a11['error'](0x1f4,_0x57e783));}}logger[_0x0ea3('0x35')](_0x0ea3('0x41'));return _0x309166(_0x2d7a11[_0x0ea3('0x35')](0x1f4,_0x0ea3('0x41')));});},'AgentCapacity':function(_0x183ea4){var _0x1aa124=this;return new Promise(function(_0x2ef8a2,_0xab91f5){if(_0x49f68e[_0x0ea3('0x39')]['hasOwnProperty'](_0x183ea4['id'])){for(var _0x30be78 in _0x183ea4[_0x0ea3('0x44')]){if(_0x183ea4[_0x0ea3('0x44')][_0x0ea3('0x45')](_0x30be78)){if(_0x49f68e['agents'][_0x183ea4['id']][_0x0ea3('0x45')](_0x30be78+_0x0ea3('0x46'))){_0x49f68e[_0x0ea3('0x39')][_0x183ea4['id']][_0x30be78+_0x0ea3('0x46')]=parseInt(_0x183ea4[_0x0ea3('0x44')][_0x30be78],0xa);}}}_0x49f68e[_0x0ea3('0x39')][_0x183ea4['id']]['updateRealtime']();return _0x2ef8a2({'code':0xc8,'message':_0x49f68e[_0x0ea3('0x39')][_0x183ea4['id']]});}else{return _0xab91f5(_0x1aa124[_0x0ea3('0x35')](0x1f4,_0x0ea3('0x47')));}});},'Agents':function(_0x1ae93c){return new Promise(function(_0x4bf5d3,_0x2fb263){var _0x356acb=_['values'](_0x49f68e[_0x0ea3('0x39')]);_0x4bf5d3({'count':_0x356acb['length'],'rows':_0x356acb});});},'ChatQueues':function(_0x43d499){return new Promise(function(_0x57e76a,_0xdeb137){var _0x158871=[];for(var _0xa6e3de in _0x49f68e[_0x0ea3('0x48')]){if(_0x49f68e[_0x0ea3('0x48')][_0x0ea3('0x45')](_0xa6e3de)){var _0x4ae15e=_0x49f68e[_0x0ea3('0x48')][_0xa6e3de];var _0x30cf27={'id':_0x4ae15e['id'],'available':_0x4ae15e[_0x0ea3('0x49')],'loggedIn':_0x4ae15e[_0x0ea3('0x4a')],'name':_0x4ae15e[_0x0ea3('0x4b')],'paused':_0x4ae15e[_0x0ea3('0x4c')],'waiting':_0x4ae15e['waiting']};_0x158871[_0x0ea3('0x22')](_0x30cf27);}}_0x57e76a({'count':_0x158871[_0x0ea3('0x19')],'rows':_0x158871});});},'MailQueues':function(_0x184ec9){return new Promise(function(_0x5e9d70,_0x2644cb){var _0x274bf2=[];for(var _0x2a4252 in _0x49f68e[_0x0ea3('0x4d')]){if(_0x49f68e['mailQueues'][_0x0ea3('0x45')](_0x2a4252)){var _0x46c783=_0x49f68e[_0x0ea3('0x4d')][_0x2a4252];var _0x1dfe99={'id':_0x46c783['id'],'available':_0x46c783[_0x0ea3('0x49')],'loggedIn':_0x46c783[_0x0ea3('0x4a')],'name':_0x46c783[_0x0ea3('0x4b')],'paused':_0x46c783[_0x0ea3('0x4c')],'waiting':_0x46c783[_0x0ea3('0x4e')]};_0x274bf2['push'](_0x1dfe99);}}_0x5e9d70({'count':_0x274bf2[_0x0ea3('0x19')],'rows':_0x274bf2});});},'OpenchannelQueues':function(_0x80ef8c){return new Promise(function(_0x37a185,_0x185750){var _0x4ffd34=[];for(var _0x56e529 in _0x49f68e[_0x0ea3('0x4f')]){if(_0x49f68e[_0x0ea3('0x4f')]['hasOwnProperty'](_0x56e529)){var _0x3ae424=_0x49f68e[_0x0ea3('0x4f')][_0x56e529];var _0x83ced8={'id':_0x3ae424['id'],'available':_0x3ae424[_0x0ea3('0x49')],'loggedIn':_0x3ae424[_0x0ea3('0x4a')],'name':_0x3ae424[_0x0ea3('0x4b')],'paused':_0x3ae424[_0x0ea3('0x4c')],'waiting':_0x3ae424[_0x0ea3('0x4e')]};_0x4ffd34['push'](_0x83ced8);}}_0x37a185({'count':_0x4ffd34[_0x0ea3('0x19')],'rows':_0x4ffd34});});},'SmsQueues':function(_0x59010a){return new Promise(function(_0x2e40c0,_0x375981){var _0xa1fb0d=[];for(var _0x32e565 in _0x49f68e['smsQueues']){if(_0x49f68e[_0x0ea3('0x50')]['hasOwnProperty'](_0x32e565)){var _0x23f32c=_0x49f68e['smsQueues'][_0x32e565];var _0x2efdf0={'id':_0x23f32c['id'],'available':_0x23f32c[_0x0ea3('0x49')],'loggedIn':_0x23f32c['loggedIn'],'name':_0x23f32c[_0x0ea3('0x4b')],'paused':_0x23f32c['paused'],'waiting':_0x23f32c[_0x0ea3('0x4e')]};_0xa1fb0d[_0x0ea3('0x22')](_0x2efdf0);}}_0x2e40c0({'count':_0xa1fb0d[_0x0ea3('0x19')],'rows':_0xa1fb0d});});},'FaxQueues':function(_0x534843){return new Promise(function(_0x145557,_0x4f81eb){var _0xe71b51=[];for(var _0x3de656 in _0x49f68e[_0x0ea3('0x51')]){if(_0x49f68e[_0x0ea3('0x51')]['hasOwnProperty'](_0x3de656)){var _0x558289=_0x49f68e[_0x0ea3('0x51')][_0x3de656];var _0x52c8b6={'id':_0x558289['id'],'available':_0x558289['available'],'loggedIn':_0x558289[_0x0ea3('0x4a')],'name':_0x558289['name'],'paused':_0x558289['paused'],'waiting':_0x558289[_0x0ea3('0x4e')]};_0xe71b51[_0x0ea3('0x22')](_0x52c8b6);}}_0x145557({'count':_0xe71b51['length'],'rows':_0xe71b51});});},'WhatsappQueues':function(_0x4faf12){return new Promise(function(_0x23b18b,_0x514989){var _0x13baf3=[];for(var _0x524243 in _0x49f68e[_0x0ea3('0x52')]){if(_0x49f68e['whatsappQueues'][_0x0ea3('0x45')](_0x524243)){var _0x120534=_0x49f68e[_0x0ea3('0x52')][_0x524243];var _0x1be7d3={'id':_0x120534['id'],'available':_0x120534[_0x0ea3('0x49')],'loggedIn':_0x120534[_0x0ea3('0x4a')],'name':_0x120534[_0x0ea3('0x4b')],'paused':_0x120534['paused'],'waiting':_0x120534['waiting']};_0x13baf3['push'](_0x1be7d3);}}_0x23b18b({'count':_0x13baf3[_0x0ea3('0x19')],'rows':_0x13baf3});});},'ChatQueuesWaitingInteractions':function(_0x1f514f){return new Promise(function(_0x481cbf,_0x6eb1e2){var _0x19286b=_['values'](_0x49f68e[_0x0ea3('0x53')]);_0x481cbf({'count':_0x19286b[_0x0ea3('0x19')],'rows':_0x19286b});});},'MailQueuesWaitingInteractions':function(_0x7c1f5b){return new Promise(function(_0x5b4ef8,_0x29dfbb){var _0x5f1979=_['values'](_0x49f68e['mailQueuesWaitingInteractions']);_0x5b4ef8({'count':_0x5f1979[_0x0ea3('0x19')],'rows':_0x5f1979});});},'OpenchannelQueuesWaitingInteractions':function(_0x587541){return new Promise(function(_0x47a830,_0x395511){var _0x4e5f9e=_['values'](_0x49f68e[_0x0ea3('0x54')]);_0x47a830({'count':_0x4e5f9e[_0x0ea3('0x19')],'rows':_0x4e5f9e});});},'SmsQueuesWaitingInteractions':function(_0x1cdafd){return new Promise(function(_0x45af96,_0x4b1b53){var _0x5a8d75=_['values'](_0x49f68e['smsQueuesWaitingInteractions']);_0x45af96({'count':_0x5a8d75[_0x0ea3('0x19')],'rows':_0x5a8d75});});},'FaxQueuesWaitingInteractions':function(_0x37817b){return new Promise(function(_0x33c6b9,_0x1ee3a0){var _0x42edd1=_['values'](_0x49f68e[_0x0ea3('0x55')]);_0x33c6b9({'count':_0x42edd1[_0x0ea3('0x19')],'rows':_0x42edd1});});},'WhatsappQueuesWaitingInteractions':function(_0x503d43){return new Promise(function(_0x554c6d,_0x27ad4d){var _0x327a83=_[_0x0ea3('0x56')](_0x49f68e[_0x0ea3('0x57')]);_0x554c6d({'count':_0x327a83['length'],'rows':_0x327a83});});}};var _0x160659=jayson[_0x0ea3('0x58')](_0x3c0cf8)[_0x0ea3('0x59')]();_0x160659['on']('error',function(_0x706e36){logger[_0x0ea3('0x35')](JSON[_0x0ea3('0x5a')](_0x706e36));return _0x37102a(_0x706e36);});_0x160659[_0x0ea3('0x13')](0x232c,_0x0ea3('0x5b'),function(){console[_0x0ea3('0x5c')](_0x0ea3('0x5d'),0x232c);return _0x1dcd1f(_0x0ea3('0x5e')+0x232c);});});};
\ No newline at end of file
+var _0xf132=['busyQueue','emit','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','dialogflowv2','amazonlex','./interval','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Applications\x20executed','matchPath','complete','error','routing\x20is\x20empty','agent','agents','busy'];(function(_0x1b4f4f,_0x3e22ef){var _0x35e4c4=function(_0x113883){while(--_0x113883){_0x1b4f4f['push'](_0x1b4f4f['shift']());}};_0x35e4c4(++_0x3e22ef);}(_0xf132,0xd1));var _0x2f13=function(_0x53f5fa,_0x1aa52b){_0x53f5fa=_0x53f5fa-0x0;var _0x4eb717=_0xf132[_0x53f5fa];return _0x4eb717;};'use strict';var _=require('lodash');var util=require(_0x2f13('0x0'));var path=require(_0x2f13('0x1'));var fs=require('fs');var jayson=require(_0x2f13('0x2'));var BPromise=require(_0x2f13('0x3'));var uuid=require(_0x2f13('0x4'));var config=require(_0x2f13('0x5'));var logger=require(_0x2f13('0x6'))('routing');var rpc={'openchannelQueueReport':require(_0x2f13('0x7')),'mailQueueReport':require(_0x2f13('0x8')),'chatQueueReport':require(_0x2f13('0x9')),'smsQueueReport':require(_0x2f13('0xa')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x2f13('0xb'));function getId(_0x5c0aa2,_0x5293fe,_0x29c95d){return util[_0x2f13('0xc')]('%s.%s.%s',_0x5c0aa2,_0x5293fe||0x0,_0x29c95d||0x0);}function getIntervals(_0x1b952f,_0x2b21c4){var _0xaa6ed3=[];if(!_[_0x2f13('0xd')](_0x2b21c4['IntervalId'])&&!_[_0x2f13('0xd')](_0x1b952f[_0x2b21c4[_0x2f13('0xe')]])&&!_[_0x2f13('0xd')](_0x1b952f[_0x2b21c4[_0x2f13('0xe')]][_0x2f13('0xf')])){_0xaa6ed3=_[_0x2f13('0x10')](_0x1b952f[_0x2b21c4[_0x2f13('0xe')]][_0x2f13('0xf')],'interval');}else if(!_[_0x2f13('0xd')](_0x2b21c4[_0x2f13('0x11')])){_0xaa6ed3=[_0x2b21c4[_0x2f13('0x11')]];}return _0xaa6ed3;}exports[_0x2f13('0x12')]=function(_0x322c07){_0x322c07[_0x2f13('0x13')]={};return new BPromise(function(_0x360196,_0x2d6495){var _0x30bf95={'Start':function(_0x269a09){var _0x4cfa78=this;return new Promise(function(_0x5628f5,_0x4a38fe){if(_0x269a09){try{var _0xedc911=[];var _0x182b67=getId(_0x269a09[_0x2f13('0x14')],_0x269a09[_0x2f13('0x15')]?_0x269a09[_0x2f13('0x15')]['id']:0x0,_0x269a09[_0x2f13('0x16')]?_0x269a09[_0x2f13('0x16')]['id']:0x0);if(_0x269a09[_0x2f13('0x17')]&&_[_0x2f13('0x18')](_0x269a09[_0x2f13('0x17')])&&_0x269a09[_0x2f13('0x17')][_0x2f13('0x19')]){for(var _0x2ba346=0x0;_0x2ba346<_0x269a09[_0x2f13('0x17')]['length'];_0x2ba346+=0x1){var _0x10f553=_0x269a09[_0x2f13('0x17')][_0x2ba346];if(fs[_0x2f13('0x1a')](path[_0x2f13('0x1b')](__dirname,'applications',_0x10f553[_0x2f13('0x1c')]+_0x2f13('0x1d')))){var _0x487e79=[];switch(_0x10f553[_0x2f13('0x1c')][_0x2f13('0x1e')]()){case _0x2f13('0x1f'):var _0xe8b35b=_0x10f553[_0x2f13('0x20')][_0x2f13('0x21')](',');if(_0x269a09[_0x2f13('0x14')]===_0x2f13('0x22')){_0x487e79['push'](_0xe8b35b[0x0]);_0x487e79[_0x2f13('0x23')](_0xe8b35b[0x1]);_0x487e79[_0x2f13('0x23')](_0xe8b35b['slice'](0x2,_0xe8b35b[_0x2f13('0x19')])['join'](','));}else{_0x487e79['push'](_0xe8b35b[0x0]);_0x487e79[_0x2f13('0x23')](_0xe8b35b[_0x2f13('0x24')](0x1,_0xe8b35b[_0x2f13('0x19')])[_0x2f13('0x1b')](','));}break;case'dialogflow':var _0x4ebc7d=_0x10f553['appdata'][_0x2f13('0x21')](',');_0x487e79['push'](_0x4ebc7d[0x0]);_0x487e79['push'](_0x4ebc7d[0x1]);_0x487e79[_0x2f13('0x23')](_0x4ebc7d[_0x2f13('0x24')](0x2,_0x4ebc7d[_0x2f13('0x19')])[_0x2f13('0x1b')](','));break;case _0x2f13('0x25'):var _0x452f74=_0x10f553[_0x2f13('0x20')][_0x2f13('0x21')](',');_0x487e79['push'](_0x452f74[0x0]);_0x487e79[_0x2f13('0x23')](_0x452f74[0x1]);_0x487e79[_0x2f13('0x23')](_0x452f74[0x2]);_0x487e79[_0x2f13('0x23')](_0x452f74[0x3]);_0x487e79[_0x2f13('0x23')](_0x452f74['slice'](0x4,_0x452f74[_0x2f13('0x19')])[_0x2f13('0x1b')](','));break;case _0x2f13('0x26'):var _0x463f56=_0x10f553[_0x2f13('0x20')][_0x2f13('0x21')](',');_0x487e79[_0x2f13('0x23')](_0x463f56[0x0]);_0x487e79[_0x2f13('0x23')](_0x463f56[0x1]);_0x487e79[_0x2f13('0x23')](_0x463f56[0x2]);_0x487e79[_0x2f13('0x23')](_0x463f56[0x3]);_0x487e79[_0x2f13('0x23')](_0x463f56['slice'](0x4,_0x463f56['length'])[_0x2f13('0x1b')](','));break;case _0x2f13('0x15'):_0x487e79[_0x2f13('0x23')](_0x10f553[_0x2f13('0x20')]);break;case'tag':_0x487e79[_0x2f13('0x23')](_0x10f553['TagId']);_0x487e79[_0x2f13('0x23')](_0x10f553['appdata']);break;default:_0x487e79=_[_0x2f13('0xd')](_0x10f553[_0x2f13('0x20')])?[]:_0x10f553['appdata'][_0x2f13('0x21')](',');}var _0x40d12b={'id':util['format']('%s:%s:%s',_0x182b67,_0x10f553['id'],_0x10f553[_0x2f13('0x1c')]),'condition':require(_0x2f13('0x27'))['condition'](_0x182b67,getIntervals(_0x322c07[_0x2f13('0x28')],_0x10f553),_0x322c07),'consequence':require(_0x2f13('0x29')+_0x10f553[_0x2f13('0x1c')])['consequence'](_0x182b67,_0x487e79,_0x322c07,_0x269a09),'p':_0x10f553[_0x2f13('0x2a')]||0x0};logger[_0x2f13('0x2b')](_0x2f13('0x2c'),_0x40d12b['id'],_0x2f13('0x2d'),getIntervals(_0x322c07[_0x2f13('0x28')],_0x10f553)[_0x2f13('0x1b')](_0x2f13('0x2e')));_0xedc911['push'](_0x40d12b);}else{logger['error']('Please\x20create\x20a\x20new\x20file\x20under',path[_0x2f13('0x1b')](__dirname,_0x2f13('0x17'),_0x10f553[_0x2f13('0x1c')]+_0x2f13('0x1d')));}}_0x322c07[_0x2f13('0x13')][_0x182b67]=new RuleEngine(_0xedc911);_0x322c07[_0x2f13('0x13')][_0x182b67]['execute'](_0x269a09,function(_0x1f1f12){logger['info'](_0x2f13('0x2f'),JSON['stringify'](_0x1f1f12[_0x2f13('0x30')]));if(_0x322c07[_0x2f13('0x13')][_0x182b67]){_0x322c07[_0x2f13('0x13')][_0x182b67]['emit'](_0x2f13('0x31'));}});return _0x5628f5({'code':0xc8,'message':_0x269a09});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x5628f5({'code':0xc8,'message':_0x269a09});}}catch(_0x35bf4c){logger[_0x2f13('0x32')](_0x35bf4c['stack']);return _0x4a38fe(_0x4cfa78[_0x2f13('0x32')](0x1f4,_0x35bf4c));}}return _0x4a38fe(_0x2f13('0x33'));});},'AcceptMessage':function(_0x1f61cd){var _0x487299=this;return new Promise(function(_0x360039,_0x1d31b2){if(_0x1f61cd[_0x2f13('0x34')]&&_0x1f61cd[_0x2f13('0x34')]['id']){if(_0x322c07[_0x2f13('0x35')][_0x1f61cd[_0x2f13('0x34')]['id']]){_0x322c07[_0x2f13('0x35')][_0x1f61cd['agent']['id']][_0x2f13('0x36')]=![];_0x322c07[_0x2f13('0x35')][_0x1f61cd[_0x2f13('0x34')]['id']][_0x2f13('0x37')]=undefined;}}if(_0x1f61cd['message']&&_0x1f61cd[_0x2f13('0x15')]['id']){try{var _0x33ba4b=getId(_0x1f61cd[_0x2f13('0x14')],_0x1f61cd[_0x2f13('0x15')]?_0x1f61cd[_0x2f13('0x15')]['id']:0x0,_0x1f61cd[_0x2f13('0x16')]?_0x1f61cd[_0x2f13('0x16')]['id']:0x0);if(_0x322c07[_0x2f13('0x13')][_0x33ba4b]){_0x322c07['rules'][_0x33ba4b][_0x2f13('0x38')]('end');if(rpc[_0x1f61cd[_0x2f13('0x14')]+_0x2f13('0x39')]){rpc[_0x1f61cd[_0x2f13('0x14')]+_0x2f13('0x39')][_0x2f13('0x3a')](_0x33ba4b,{'UserId':_0x1f61cd[_0x2f13('0x15')][_0x2f13('0x3b')]})[_0x2f13('0x3c')](function(_0x804415){logger[_0x2f13('0x32')](_0x2f13('0x3d'));});}}return _0x360039({'code':0xc8,'message':_0x1f61cd});}catch(_0x6d3476){logger[_0x2f13('0x32')](_0x6d3476[_0x2f13('0x3e')]);return _0x1d31b2(_0x487299[_0x2f13('0x32')](0x1f4,_0x6d3476));}}logger['error'](_0x2f13('0x3f'));return _0x1d31b2(_0x487299[_0x2f13('0x32')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x17e400){var _0x4a0cae=this;return new Promise(function(_0x37ef0b,_0x4d607e){if(_0x17e400[_0x2f13('0x34')]&&_0x17e400['agent']['id']){try{if(_0x322c07[_0x2f13('0x35')][_0x17e400['agent']['id']]){_0x322c07['agents'][_0x17e400[_0x2f13('0x34')]['id']][_0x2f13('0x36')]=![];_0x322c07[_0x2f13('0x35')][_0x17e400['agent']['id']][_0x2f13('0x37')]=undefined;}return _0x37ef0b({'code':0xc8,'message':_0x17e400});}catch(_0x39dbbf){logger[_0x2f13('0x32')](_0x39dbbf[_0x2f13('0x3e')]);return _0x4d607e(_0x4a0cae[_0x2f13('0x32')](0x1f4,_0x39dbbf));}}logger[_0x2f13('0x32')]('message\x20is\x20empty');return _0x4d607e(_0x4a0cae[_0x2f13('0x32')](0x1f4,_0x2f13('0x3f')));});},'AbandonInteraction':function(_0x1f107d){var _0x8ee96a=this;return new Promise(function(_0x58e688,_0x19005d){if(_0x1f107d[_0x2f13('0x14')]&&_0x1f107d[_0x2f13('0x16')]&&_0x1f107d[_0x2f13('0x16')]['id']){try{var _0x2eec1b=getId(_0x1f107d['channel'],_0x1f107d[_0x2f13('0x15')]?_0x1f107d[_0x2f13('0x15')]['id']:0x0,_0x1f107d[_0x2f13('0x16')]?_0x1f107d[_0x2f13('0x16')]['id']:0x0);if(_0x322c07[_0x2f13('0x13')][_0x2eec1b]){_0x322c07['rules'][_0x2eec1b][_0x2f13('0x38')](_0x2f13('0x40'));}return _0x58e688({'code':0xc8,'message':_0x1f107d});}catch(_0x4b126a){logger[_0x2f13('0x32')](_0x4b126a['stack']);return _0x19005d(_0x8ee96a[_0x2f13('0x32')](0x1f4,_0x4b126a));}}logger[_0x2f13('0x32')](_0x2f13('0x3f'));return _0x19005d(_0x8ee96a['error'](0x1f4,_0x2f13('0x3f')));});},'AgentCapacity':function(_0x8e558){var _0x3317ef=this;return new Promise(function(_0x31186d,_0x59eb82){if(_0x322c07[_0x2f13('0x35')][_0x2f13('0x41')](_0x8e558['id'])){for(var _0xae6241 in _0x8e558[_0x2f13('0x42')]){if(_0x8e558[_0x2f13('0x42')][_0x2f13('0x41')](_0xae6241)){if(_0x322c07[_0x2f13('0x35')][_0x8e558['id']][_0x2f13('0x41')](_0xae6241+'CurrentCapacity')){_0x322c07[_0x2f13('0x35')][_0x8e558['id']][_0xae6241+_0x2f13('0x43')]=parseInt(_0x8e558[_0x2f13('0x42')][_0xae6241],0xa);}}}_0x322c07[_0x2f13('0x35')][_0x8e558['id']][_0x2f13('0x44')]();return _0x31186d({'code':0xc8,'message':_0x322c07['agents'][_0x8e558['id']]});}else{return _0x59eb82(_0x3317ef[_0x2f13('0x32')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xa6f7b0){return new Promise(function(_0x4f8dc5,_0x37c37f){var _0x3e43e8=_[_0x2f13('0x45')](_0x322c07['agents']);_0x4f8dc5({'count':_0x3e43e8[_0x2f13('0x19')],'rows':_0x3e43e8});});},'ChatQueues':function(_0x2aa38b){return new Promise(function(_0x37977d,_0x35d921){var _0x4055cc=[];for(var _0x35f901 in _0x322c07[_0x2f13('0x46')]){if(_0x322c07['chatQueues'][_0x2f13('0x41')](_0x35f901)){var _0x1fa2b5=_0x322c07[_0x2f13('0x46')][_0x35f901];var _0x2c144e={'id':_0x1fa2b5['id'],'available':_0x1fa2b5[_0x2f13('0x47')],'loggedIn':_0x1fa2b5[_0x2f13('0x48')],'name':_0x1fa2b5[_0x2f13('0x49')],'paused':_0x1fa2b5[_0x2f13('0x4a')],'waiting':_0x1fa2b5[_0x2f13('0x4b')]};_0x4055cc['push'](_0x2c144e);}}_0x37977d({'count':_0x4055cc[_0x2f13('0x19')],'rows':_0x4055cc});});},'MailQueues':function(_0x1c266f){return new Promise(function(_0x4a984f,_0x22d259){var _0x148e59=[];for(var _0x5259ca in _0x322c07[_0x2f13('0x4c')]){if(_0x322c07['mailQueues']['hasOwnProperty'](_0x5259ca)){var _0x22f9de=_0x322c07['mailQueues'][_0x5259ca];var _0x44ed9e={'id':_0x22f9de['id'],'available':_0x22f9de[_0x2f13('0x47')],'loggedIn':_0x22f9de[_0x2f13('0x48')],'name':_0x22f9de[_0x2f13('0x49')],'paused':_0x22f9de['paused'],'waiting':_0x22f9de[_0x2f13('0x4b')]};_0x148e59[_0x2f13('0x23')](_0x44ed9e);}}_0x4a984f({'count':_0x148e59[_0x2f13('0x19')],'rows':_0x148e59});});},'OpenchannelQueues':function(_0x2eb982){return new Promise(function(_0xacaec3,_0x25f7b4){var _0x105d00=[];for(var _0x2c156f in _0x322c07['openchannelQueues']){if(_0x322c07[_0x2f13('0x4d')][_0x2f13('0x41')](_0x2c156f)){var _0x135127=_0x322c07[_0x2f13('0x4d')][_0x2c156f];var _0x3e36db={'id':_0x135127['id'],'available':_0x135127[_0x2f13('0x47')],'loggedIn':_0x135127['loggedIn'],'name':_0x135127[_0x2f13('0x49')],'paused':_0x135127[_0x2f13('0x4a')],'waiting':_0x135127[_0x2f13('0x4b')]};_0x105d00[_0x2f13('0x23')](_0x3e36db);}}_0xacaec3({'count':_0x105d00['length'],'rows':_0x105d00});});},'SmsQueues':function(_0x51ca1b){return new Promise(function(_0x172d9e,_0x3582c4){var _0x20b6b1=[];for(var _0x563dc7 in _0x322c07[_0x2f13('0x4e')]){if(_0x322c07[_0x2f13('0x4e')][_0x2f13('0x41')](_0x563dc7)){var _0x4a9b33=_0x322c07['smsQueues'][_0x563dc7];var _0x3cad9e={'id':_0x4a9b33['id'],'available':_0x4a9b33['available'],'loggedIn':_0x4a9b33['loggedIn'],'name':_0x4a9b33[_0x2f13('0x49')],'paused':_0x4a9b33['paused'],'waiting':_0x4a9b33[_0x2f13('0x4b')]};_0x20b6b1[_0x2f13('0x23')](_0x3cad9e);}}_0x172d9e({'count':_0x20b6b1[_0x2f13('0x19')],'rows':_0x20b6b1});});},'FaxQueues':function(_0x3f9f86){return new Promise(function(_0x343180,_0x31d167){var _0x53e230=[];for(var _0x35fc3c in _0x322c07[_0x2f13('0x4f')]){if(_0x322c07['faxQueues'][_0x2f13('0x41')](_0x35fc3c)){var _0x559cc9=_0x322c07[_0x2f13('0x4f')][_0x35fc3c];var _0xd5a4ea={'id':_0x559cc9['id'],'available':_0x559cc9['available'],'loggedIn':_0x559cc9[_0x2f13('0x48')],'name':_0x559cc9[_0x2f13('0x49')],'paused':_0x559cc9[_0x2f13('0x4a')],'waiting':_0x559cc9[_0x2f13('0x4b')]};_0x53e230[_0x2f13('0x23')](_0xd5a4ea);}}_0x343180({'count':_0x53e230[_0x2f13('0x19')],'rows':_0x53e230});});},'WhatsappQueues':function(_0x1745e6){return new Promise(function(_0x2686fb,_0xd3880a){var _0x5d4496=[];for(var _0x38ac03 in _0x322c07[_0x2f13('0x50')]){if(_0x322c07[_0x2f13('0x50')][_0x2f13('0x41')](_0x38ac03)){var _0x51d710=_0x322c07[_0x2f13('0x50')][_0x38ac03];var _0x7e9317={'id':_0x51d710['id'],'available':_0x51d710['available'],'loggedIn':_0x51d710[_0x2f13('0x48')],'name':_0x51d710['name'],'paused':_0x51d710['paused'],'waiting':_0x51d710[_0x2f13('0x4b')]};_0x5d4496[_0x2f13('0x23')](_0x7e9317);}}_0x2686fb({'count':_0x5d4496[_0x2f13('0x19')],'rows':_0x5d4496});});},'ChatQueuesWaitingInteractions':function(_0x13c739){return new Promise(function(_0x4cae63,_0x378b95){var _0x240f64=_['values'](_0x322c07[_0x2f13('0x51')]);_0x4cae63({'count':_0x240f64[_0x2f13('0x19')],'rows':_0x240f64});});},'MailQueuesWaitingInteractions':function(_0x8293f4){return new Promise(function(_0x45eddc,_0x41f868){var _0x33f4ca=_['values'](_0x322c07[_0x2f13('0x52')]);_0x45eddc({'count':_0x33f4ca[_0x2f13('0x19')],'rows':_0x33f4ca});});},'OpenchannelQueuesWaitingInteractions':function(_0x4a1587){return new Promise(function(_0x4c590a,_0x50546f){var _0x26b1a5=_[_0x2f13('0x45')](_0x322c07['openchannelQueuesWaitingInteractions']);_0x4c590a({'count':_0x26b1a5['length'],'rows':_0x26b1a5});});},'SmsQueuesWaitingInteractions':function(_0x12772d){return new Promise(function(_0x28adfe,_0x56394e){var _0x438e13=_[_0x2f13('0x45')](_0x322c07[_0x2f13('0x53')]);_0x28adfe({'count':_0x438e13[_0x2f13('0x19')],'rows':_0x438e13});});},'FaxQueuesWaitingInteractions':function(_0x4b435a){return new Promise(function(_0x2aba71,_0x1e94f4){var _0x410619=_[_0x2f13('0x45')](_0x322c07['faxQueuesWaitingInteractions']);_0x2aba71({'count':_0x410619[_0x2f13('0x19')],'rows':_0x410619});});},'WhatsappQueuesWaitingInteractions':function(_0x171e83){return new Promise(function(_0x418a84,_0xe98bea){var _0x3680f1=_[_0x2f13('0x45')](_0x322c07['whatsappQueuesWaitingInteractions']);_0x418a84({'count':_0x3680f1[_0x2f13('0x19')],'rows':_0x3680f1});});}};var _0x591d7e=jayson[_0x2f13('0x54')](_0x30bf95)['http']();_0x591d7e['on'](_0x2f13('0x32'),function(_0x18e0dd){logger['error'](JSON['stringify'](_0x18e0dd));return _0x2d6495(_0x18e0dd);});_0x591d7e['listen'](0x232c,'127.0.0.1',function(){console[_0x2f13('0x55')](_0x2f13('0x56'),0x232c);return _0x360196(_0x2f13('0x57')+0x232c);});});};
\ No newline at end of file
index 09f2d8b..7c0132e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf23c=['\x20|\x20','when','log','join','jayson/promise','lodash','../../../config/logger','client','request','then','error','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','message','true','[%s][INTERVAL]\x20%s','some','info','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf23c,0x112));var _0xcf23=function(_0x786e9,_0x1a029){_0x786e9=_0x786e9-0x0;var _0x1f891b=_0xf23c[_0x786e9];return _0x1f891b;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require(_0xcf23('0x0'));var _=require(_0xcf23('0x1'));var logger=require(_0xcf23('0x2'))('routing');var client=jayson[_0xcf23('0x3')]['http']({'port':0x232a});function request(_0x273ca5,_0x2e8abb){return new BPromise(function(_0x49d064,_0x401765){return client[_0xcf23('0x4')](_0x273ca5,_0x2e8abb)[_0xcf23('0x5')](function(_0x36bb93){if(_0x36bb93[_0xcf23('0x6')]){return _0x401765(_0x36bb93[_0xcf23('0x6')]['message']);}else{return _0x49d064(_0x36bb93['result']);}})[_0xcf23('0x7')](function(_0x30baf2){return _0x401765(_0x30baf2);});});}exports[_0xcf23('0x8')]=function(_0x144d4a,_0x2d6b2d,_0x4c0cf8){return function(_0x22e910){if(_0x4c0cf8[_0xcf23('0x9')]&&!_0x4c0cf8[_0xcf23('0x9')][_0x144d4a]){logger['info'](_0xcf23('0xa'),_0x144d4a);return _0x22e910[_0xcf23('0xb')]();}var _0x577409=[];for(var _0xcd580=0x0;_0xcd580<_0x2d6b2d[_0xcf23('0xc')];_0xcd580+=0x1){_0x577409[_0xcf23('0xd')](request(_0xcf23('0xe'),{'command':util[_0xcf23('0xf')](_0xcf23('0x10'),_0x2d6b2d[_0xcd580])})[_0xcf23('0x5')](function(_0x5997c3){return _0x5997c3&&_0x5997c3[_0xcf23('0x11')]&&_0x5997c3[_0xcf23('0x11')]['indexOf'](_0xcf23('0x12'))>=0x0?!![]:![];})[_0xcf23('0x7')](function(_0x5163c8){logger[_0xcf23('0x6')](_0xcf23('0x13'),_0x144d4a,_0x2d6b2d[_0xcd580]);}));}BPromise['all'](_0x577409)[_0xcf23('0x5')](function(_0x2b68db){var _0x19c8e2=_[_0xcf23('0x14')](_0x2b68db);logger[_0xcf23('0x15')](_0xcf23('0x16'),_0x144d4a,_0x2d6b2d['join'](_0xcf23('0x17')),_0x19c8e2);_0x22e910[_0xcf23('0x18')](_0x19c8e2);})[_0xcf23('0x7')](function(_0x3019e1){console[_0xcf23('0x19')](_0x3019e1);logger[_0xcf23('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x144d4a,_0x2d6b2d[_0xcf23('0x1a')]('\x20|\x20'),_0x3019e1['stack']);_0x22e910[_0xcf23('0xb')]();});};};
\ No newline at end of file
+var _0x46c7=['message','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','jayson/promise','lodash','../../../config/logger','client','http','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x46c7,0x1cd));var _0x746c=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x46c7[_0x599e60];return _0x468e19;};'use strict';var util=require(_0x746c('0x0'));var BPromise=require('bluebird');var jayson=require(_0x746c('0x1'));var _=require(_0x746c('0x2'));var logger=require(_0x746c('0x3'))('routing');var client=jayson[_0x746c('0x4')][_0x746c('0x5')]({'port':0x232a});function request(_0x88c144,_0x447ff1){return new BPromise(function(_0x10278e,_0x338593){return client['request'](_0x88c144,_0x447ff1)[_0x746c('0x6')](function(_0x21a329){if(_0x21a329['error']){return _0x338593(_0x21a329[_0x746c('0x7')]['message']);}else{return _0x10278e(_0x21a329[_0x746c('0x8')]);}})[_0x746c('0x9')](function(_0xe6b057){return _0x338593(_0xe6b057);});});}exports[_0x746c('0xa')]=function(_0x390315,_0x3395cf,_0x4e73a5){return function(_0x4d3159){if(_0x4e73a5[_0x746c('0xb')]&&!_0x4e73a5[_0x746c('0xb')][_0x390315]){logger[_0x746c('0xc')](_0x746c('0xd'),_0x390315);return _0x4d3159[_0x746c('0xe')]();}var _0x1146ea=[];for(var _0x2fa9b1=0x0;_0x2fa9b1<_0x3395cf['length'];_0x2fa9b1+=0x1){_0x1146ea[_0x746c('0xf')](request(_0x746c('0x10'),{'command':util[_0x746c('0x11')](_0x746c('0x12'),_0x3395cf[_0x2fa9b1])})[_0x746c('0x6')](function(_0x509bc){return _0x509bc&&_0x509bc[_0x746c('0x13')]&&_0x509bc[_0x746c('0x13')][_0x746c('0x14')](_0x746c('0x15'))>=0x0?!![]:![];})['catch'](function(_0x1733e3){logger['error']('[%s][INTERVAL]\x20%s',_0x390315,_0x3395cf[_0x2fa9b1]);}));}BPromise[_0x746c('0x16')](_0x1146ea)['then'](function(_0x27f9b0){var _0x44f9b8=_[_0x746c('0x17')](_0x27f9b0);logger[_0x746c('0xc')](_0x746c('0x18'),_0x390315,_0x3395cf['join'](_0x746c('0x19')),_0x44f9b8);_0x4d3159[_0x746c('0x1a')](_0x44f9b8);})[_0x746c('0x9')](function(_0x517fe){console[_0x746c('0x1b')](_0x517fe);logger[_0x746c('0x7')](_0x746c('0x18'),_0x390315,_0x3395cf[_0x746c('0x1c')](_0x746c('0x19')),_0x517fe[_0x746c('0x1d')]);_0x4d3159[_0x746c('0xe')]();});};};
\ No newline at end of file
index f74d315..5834a03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0102=['agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','util','./utils','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]'];(function(_0x37c67a,_0x2c906a){var _0x110b50=function(_0x1bac2c){while(--_0x1bac2c){_0x37c67a['push'](_0x37c67a['shift']());}};_0x110b50(++_0x2c906a);}(_0x0102,0x186));var _0x2010=function(_0xc53c7f,_0x152f27){_0xc53c7f=_0xc53c7f-0x0;var _0x2dd2da=_0x0102[_0xc53c7f];return _0x2dd2da;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var utils=require(_0x2010('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34c31e,_0x9ae519){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34c31e['uniqueid'],_0x34c31e['channel'],_0x34c31e[_0x2010('0x2')],_0x34c31e[_0x2010('0x3')],_0x34c31e[_0x2010('0x4')],_0x34c31e[_0x2010('0x5')],_0x34c31e['connectedlinenum'],_0x34c31e[_0x2010('0x6')]));if(_0x34c31e['queue']){utils[_0x2010('0x7')](_0x34c31e[_0x2010('0x2')])['then'](function(_0x1f94ca){if(_0x1f94ca){_0x34c31e[_0x2010('0x8')]=_0x1f94ca[_0x2010('0x8')];_0x34c31e[_0x2010('0x9')]=_0x34c31e[_0x2010('0xa')]?_0x1f94ca[_0x2010('0xb')]:![];_0x34c31e[_0x2010('0xc')]=_0x34c31e[_0x2010('0x9')]?_0x1f94ca[_0x2010('0xd')]:0x0;}utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);});}else{utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);}if(_0x9ae519){delete transfers[_0x34c31e[_0x2010('0x10')]];}else{delete agents[_0x34c31e[_0x2010('0x11')]];}}exports[_0x2010('0x12')]=function(_0x528a38){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38[_0x2010('0x10')]),_0x528a38);agents[_0x528a38[_0x2010('0x11')]]=_0x528a38;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x15')]=utils['now']();agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x6')]='called';agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x16')]=null;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x17')]=null;utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x19'),_0x528a38[_0x2010('0x10')],agents[_0x528a38[_0x2010('0x11')]]['membername'],_0x528a38['destuniqueid']));}catch(_0x3c72a8){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38['uniqueid']),_0x3c72a8);}};exports['agentringnoanswer']=function(_0x22c252){try{if(!_[_0x2010('0x1b')](agents[_0x22c252[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x1d'),_0x22c252['uniqueid']),_0x22c252);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x22c252['uniqueid'],agents[_0x22c252['destuniqueid']][_0x2010('0x3')],_0x22c252['destuniqueid']));agents[_0x22c252[_0x2010('0x11')]]['agentringnoanswer']=!![];agents[_0x22c252['destuniqueid']][_0x2010('0x1e')]=utils[_0x2010('0x1f')]();agents[_0x22c252['destuniqueid']][_0x2010('0x6')]='timeout';agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x20')]=_0x2010('0x21');agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x22')]=_0x22c252[_0x2010('0x23')]?parseInt(_0x22c252[_0x2010('0x23')])/0x3e8:0x0;agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x24')]=0x0;unanswered[_0x2010('0x25')](_0x22c252[_0x2010('0x11')]);}}catch(_0x2ebdbb){utils['error'](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]',_0x22c252[_0x2010('0x10')]),_0x2ebdbb);}};exports[_0x2010('0x26')]=function(_0xd16c04){try{_[_0x2010('0x27')](agents,function(_0x564a64,_0x554f66){if(_0x564a64[_0x2010('0x10')]==_0xd16c04['uniqueid']&&!_[_0x2010('0x28')](unanswered,_0x564a64[_0x2010('0x11')])){utils['debug'](util[_0x2010('0x13')](_0x2010('0x29'),_0xd16c04[_0x2010('0x10')]),_0xd16c04);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd16c04[_0x2010('0x10')],_0x564a64[_0x2010('0x3')],_0x564a64[_0x2010('0x11')]));_0x564a64['agentringnoanswer']=!![];_0x564a64['agentringnoanswerAt']=utils[_0x2010('0x1f')]();_0x564a64[_0x2010('0x6')]=_0x2010('0x2a');_0x564a64['reason']='abandoned';_0x564a64[_0x2010('0x22')]=_0xd16c04[_0x2010('0x22')];_0x564a64[_0x2010('0x24')]=0x0;writeDB(_0x564a64);}});}catch(_0x339fd2){utils[_0x2010('0x1a')](util['format']('[%s][agents][queuecallerabandon]',_0xd16c04['uniqueid']),_0x339fd2);}};exports[_0x2010('0x2b')]=function(_0x447eed){try{if(agents[_0x447eed[_0x2010('0x11')]]){utils['debug'](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x447eed);utils[_0x2010('0x18')](util['format'](_0x2010('0x2d'),_0x447eed[_0x2010('0x10')],agents[_0x447eed[_0x2010('0x11')]]['membername'],_0x447eed[_0x2010('0x11')]));agents[_0x447eed['destuniqueid']][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x16')]=_0x447eed[_0x2010('0x16')];agents[_0x447eed[_0x2010('0x11')]]['connectedlinename']=_0x447eed[_0x2010('0x17')];agents[_0x447eed['destuniqueid']][_0x2010('0x22')]=_0x447eed[_0x2010('0x23')];agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x2f');_[_0x2010('0x27')](agents,function(_0x398f10,_0x36ff3e){if(_0x398f10[_0x2010('0x11')]!=_0x447eed[_0x2010('0x11')]&&_0x398f10[_0x2010('0x10')]==_0x447eed[_0x2010('0x10')]){_0x398f10[_0x2010('0x24')]=0x0;_0x398f10[_0x2010('0x22')]=_0x447eed['ringtime'];_0x398f10['agentringnoanswer']=!![];_0x398f10[_0x2010('0x1e')]=utils[_0x2010('0x1f')]();_0x398f10[_0x2010('0x6')]=_0x2010('0x30');_0x398f10[_0x2010('0x20')]=_0x2010('0x30');_0x398f10[_0x2010('0x31')]=_0x447eed['destuniqueid'];_0x398f10[_0x2010('0x32')]=_0x447eed['membername'];writeDB(_0x398f10);}});}}catch(_0x27fd64){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x27fd64);}};exports['agentcomplete']=function(_0x364338){try{if(!_[_0x2010('0x1b')](agents[_0x364338[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util['format'](_0x2010('0x33'),_0x364338['uniqueid']),_0x364338);utils['info'](util['format'](_0x2010('0x34'),_0x364338[_0x2010('0x10')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x3')],_0x364338[_0x2010('0x11')]));agents[_0x364338[_0x2010('0x11')]]['agentcomplete']=!![];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();agents[_0x364338['destuniqueid']]['talktime']=utils[_0x2010('0x36')](agents[_0x364338['destuniqueid']][_0x2010('0x35')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x2e')]);agents[_0x364338[_0x2010('0x11')]]['reason']=_0x364338[_0x2010('0x20')];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x37');writeDB(agents[_0x364338[_0x2010('0x11')]]);}}catch(_0x2a53b3){utils['error'](util[_0x2010('0x13')](_0x2010('0x33'),_0x364338[_0x2010('0x10')]),_0x2a53b3);}};exports['blindtransfer']=function(_0x30e5d0){try{if(!_[_0x2010('0x1b')](agents[_0x30e5d0['transfereruniqueid']])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x30e5d0);utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x39'),_0x30e5d0[_0x2010('0x10')],agents[_0x30e5d0['transfereruniqueid']]['membername'],agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')]));agents[_0x30e5d0['transfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3c')]=_0x2010('0x3d');agents[_0x30e5d0[_0x2010('0x3a')]]['transferexten']=_0x30e5d0['extension'];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3e')]=agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')];}}catch(_0x38e596){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x38e596);}};exports[_0x2010('0x3f')]=function(_0x1cc164){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x40'),_0x1cc164['origtransfereruniqueid']),_0x1cc164);if(_0x1cc164[_0x2010('0x41')]==_0x1cc164[_0x2010('0x42')]){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x43')]])){utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3')]));agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3b')]=!![];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x46')]=_0x1cc164[_0x2010('0x47')];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3e')]=_0x1cc164[_0x2010('0x41')];}if(_0x1cc164[_0x2010('0x48')]&&agents[_0x1cc164[_0x2010('0x48')]]){agents[_0x1cc164['transfereeuniqueid']][_0x2010('0x49')]=0x1;transfers[_0x1cc164['transfereeuniqueid']]=_['clone'](agents[_0x1cc164[_0x2010('0x48')]]);transfers[_0x1cc164[_0x2010('0x48')]]['calleridnum']=agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x4a')]=agents[_0x1cc164['secondtransfereruniqueid']][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x15')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164['transfereeuniqueid']][_0x2010('0x2e')]=utils['now']();transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x49')]=0x2;}}else if(_0x1cc164['secondtransfereruniqueid']==_0x1cc164['secondtransfererlinkedid']){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x41')]])){utils['info'](util['format'](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3')]));agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x46')]=_0x1cc164['secondtransfererexten'];agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3e')]=_0x1cc164['secondtransfereruniqueid'];}if(_0x1cc164[_0x2010('0x4b')]&&agents[_0x1cc164[_0x2010('0x4b')]]){agents[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x49')]=0x1;transfers[_0x1cc164[_0x2010('0x4b')]]=_[_0x2010('0x4c')](agents[_0x1cc164[_0x2010('0x4b')]]);transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x5')]=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x4b')]]['calleridname']=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x4b')]]['agentcalledAt']=utils['now']();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x4b')]]['agententerreason']=0x2;}}}catch(_0xe37cef){utils[_0x2010('0x1a')](util[_0x2010('0x13')]('[%s][agents][attendedtransfer]',_0x1cc164[_0x2010('0x41')]),_0xe37cef);}};exports[_0x2010('0x4d')]=function(_0x13d06d){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x4e'),_0x13d06d['uniqueid']),_0x13d06d);if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]]['reason']==='timeout'){if(_0x13d06d[_0x2010('0x4f')]==='21'){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')]=_0x2010('0x50');agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x50');}utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3')],agents[_0x13d06d['uniqueid']][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d[_0x2010('0x10')]]);var _0x517afa=unanswered[_0x2010('0x52')](_0x13d06d[_0x2010('0x10')]);if(_0x517afa>-0x1){unanswered['splice'](_0x517afa,0x1);}}if(transfers[_0x13d06d['uniqueid']]){transfers[_0x13d06d[_0x2010('0x10')]]['agentcomplete']=!![];transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x24')]=utils[_0x2010('0x36')](transfers[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]);transfers[_0x13d06d[_0x2010('0x10')]]['reason']=_0x2010('0x53');transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d[_0x2010('0x10')],transfers[_0x13d06d['uniqueid']][_0x2010('0x3')],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],transfers[_0x13d06d['uniqueid']][_0x2010('0x6')]));writeDB(transfers[_0x13d06d[_0x2010('0x10')]],!![]);}if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0xa')]=!![];agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt']=utils[_0x2010('0x1f')]();agents[_0x13d06d[_0x2010('0x10')]]['talktime']=utils[_0x2010('0x36')](agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],agents[_0x13d06d[_0x2010('0x10')]]['agentconnectAt']);agents[_0x13d06d['uniqueid']][_0x2010('0x20')]=agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3b')]?_0x2010('0x3b'):_0x2010('0x53');agents[_0x13d06d[_0x2010('0x10')]]['lastevent']=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]]['membername'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d['uniqueid']]);}}catch(_0x496280){utils['error'](util[_0x2010('0x13')]('[%s][agents][hangup]',_0x13d06d[_0x2010('0x10')]),_0x496280);}};
\ No newline at end of file
+var _0x16d2=['blind','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','complete','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','called','connectedlinename','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','now','timeout','holdtime','ringtime','push','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x16d2,0x123));var _0x216d=function(_0x3d57f5,_0x58043f){_0x3d57f5=_0x3d57f5-0x0;var _0x1b6ef3=_0x16d2[_0x3d57f5];return _0x1b6ef3;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var utils=require(_0x216d('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x371e93,_0x1688cc){utils[_0x216d('0x3')](util[_0x216d('0x4')](_0x216d('0x5'),_0x371e93[_0x216d('0x6')],_0x371e93['channel'],_0x371e93[_0x216d('0x7')],_0x371e93[_0x216d('0x8')],_0x371e93[_0x216d('0x9')],_0x371e93[_0x216d('0xa')],_0x371e93[_0x216d('0xb')],_0x371e93[_0x216d('0xc')]));if(_0x371e93[_0x216d('0x7')]){utils[_0x216d('0xd')](_0x371e93['queue'])[_0x216d('0xe')](function(_0x1aeb55){if(_0x1aeb55){_0x371e93[_0x216d('0xf')]=_0x1aeb55[_0x216d('0xf')];_0x371e93[_0x216d('0x10')]=_0x371e93[_0x216d('0x11')]?_0x1aeb55['acw']:![];_0x371e93[_0x216d('0x12')]=_0x371e93['agentacw']?_0x1aeb55[_0x216d('0x13')]:0x0;}utils[_0x216d('0x14')](_0x216d('0x15'),_0x371e93);});}else{utils[_0x216d('0x14')](_0x216d('0x15'),_0x371e93);}if(_0x1688cc){delete transfers[_0x371e93[_0x216d('0x6')]];}else{delete agents[_0x371e93['destuniqueid']];}}exports[_0x216d('0x16')]=function(_0x4c07d0){try{utils[_0x216d('0x17')](util[_0x216d('0x4')]('[%s][agents][agentcalled]',_0x4c07d0[_0x216d('0x6')]),_0x4c07d0);agents[_0x4c07d0[_0x216d('0x18')]]=_0x4c07d0;agents[_0x4c07d0['destuniqueid']][_0x216d('0x19')]=utils['now']();agents[_0x4c07d0[_0x216d('0x18')]][_0x216d('0xc')]=_0x216d('0x1a');agents[_0x4c07d0[_0x216d('0x18')]][_0x216d('0xb')]=null;agents[_0x4c07d0[_0x216d('0x18')]][_0x216d('0x1b')]=null;utils[_0x216d('0x3')](util[_0x216d('0x4')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4c07d0[_0x216d('0x6')],agents[_0x4c07d0['destuniqueid']]['membername'],_0x4c07d0[_0x216d('0x18')]));}catch(_0x35dbe8){utils['error'](util[_0x216d('0x4')](_0x216d('0x1c'),_0x4c07d0['uniqueid']),_0x35dbe8);}};exports[_0x216d('0x1d')]=function(_0x13b8e0){try{if(!_[_0x216d('0x1e')](agents[_0x13b8e0[_0x216d('0x18')]])){utils['debug'](util[_0x216d('0x4')](_0x216d('0x1f'),_0x13b8e0[_0x216d('0x6')]),_0x13b8e0);utils[_0x216d('0x3')](util[_0x216d('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x13b8e0[_0x216d('0x6')],agents[_0x13b8e0[_0x216d('0x18')]][_0x216d('0x8')],_0x13b8e0[_0x216d('0x18')]));agents[_0x13b8e0[_0x216d('0x18')]]['agentringnoanswer']=!![];agents[_0x13b8e0[_0x216d('0x18')]][_0x216d('0x20')]=utils[_0x216d('0x21')]();agents[_0x13b8e0['destuniqueid']]['lastevent']='timeout';agents[_0x13b8e0['destuniqueid']]['reason']=_0x216d('0x22');agents[_0x13b8e0[_0x216d('0x18')]][_0x216d('0x23')]=_0x13b8e0[_0x216d('0x24')]?parseInt(_0x13b8e0[_0x216d('0x24')])/0x3e8:0x0;agents[_0x13b8e0['destuniqueid']]['talktime']=0x0;unanswered[_0x216d('0x25')](_0x13b8e0['destuniqueid']);}}catch(_0x23d1c3){utils[_0x216d('0x26')](util[_0x216d('0x4')](_0x216d('0x1f'),_0x13b8e0[_0x216d('0x6')]),_0x23d1c3);}};exports[_0x216d('0x27')]=function(_0x28fcc2){try{_[_0x216d('0x28')](agents,function(_0x169cfa,_0x28f56a){if(_0x169cfa[_0x216d('0x6')]==_0x28fcc2[_0x216d('0x6')]&&!_[_0x216d('0x29')](unanswered,_0x169cfa['destuniqueid'])){utils[_0x216d('0x17')](util[_0x216d('0x4')](_0x216d('0x2a'),_0x28fcc2['uniqueid']),_0x28fcc2);utils[_0x216d('0x3')](util[_0x216d('0x4')](_0x216d('0x2b'),_0x28fcc2[_0x216d('0x6')],_0x169cfa['membername'],_0x169cfa[_0x216d('0x18')]));_0x169cfa[_0x216d('0x1d')]=!![];_0x169cfa[_0x216d('0x20')]=utils[_0x216d('0x21')]();_0x169cfa[_0x216d('0xc')]=_0x216d('0x2c');_0x169cfa[_0x216d('0x2d')]=_0x216d('0x2c');_0x169cfa[_0x216d('0x23')]=_0x28fcc2[_0x216d('0x23')];_0x169cfa[_0x216d('0x2e')]=0x0;writeDB(_0x169cfa);}});}catch(_0x4a2caa){utils[_0x216d('0x26')](util[_0x216d('0x4')](_0x216d('0x2a'),_0x28fcc2['uniqueid']),_0x4a2caa);}};exports[_0x216d('0x2f')]=function(_0x2e86f9){try{if(agents[_0x2e86f9['destuniqueid']]){utils[_0x216d('0x17')](util['format']('[%s][agents][agentconnect]',_0x2e86f9[_0x216d('0x6')]),_0x2e86f9);utils[_0x216d('0x3')](util[_0x216d('0x4')](_0x216d('0x30'),_0x2e86f9['uniqueid'],agents[_0x2e86f9['destuniqueid']]['membername'],_0x2e86f9[_0x216d('0x18')]));agents[_0x2e86f9[_0x216d('0x18')]]['agentconnectAt']=utils[_0x216d('0x21')]();agents[_0x2e86f9[_0x216d('0x18')]]['connectedlinenum']=_0x2e86f9[_0x216d('0xb')];agents[_0x2e86f9[_0x216d('0x18')]][_0x216d('0x1b')]=_0x2e86f9[_0x216d('0x1b')];agents[_0x2e86f9[_0x216d('0x18')]][_0x216d('0x23')]=_0x2e86f9[_0x216d('0x24')];agents[_0x2e86f9[_0x216d('0x18')]]['lastevent']='connect';_[_0x216d('0x28')](agents,function(_0x2be24f,_0x504a34){if(_0x2be24f[_0x216d('0x18')]!=_0x2e86f9[_0x216d('0x18')]&&_0x2be24f[_0x216d('0x6')]==_0x2e86f9['uniqueid']){_0x2be24f[_0x216d('0x2e')]=0x0;_0x2be24f[_0x216d('0x23')]=_0x2e86f9[_0x216d('0x24')];_0x2be24f[_0x216d('0x1d')]=!![];_0x2be24f['agentringnoanswerAt']=utils[_0x216d('0x21')]();_0x2be24f[_0x216d('0xc')]='answered_elsewhere';_0x2be24f[_0x216d('0x2d')]=_0x216d('0x31');_0x2be24f['answeredelsewheredestinationuniqueid']=_0x2e86f9['destuniqueid'];_0x2be24f[_0x216d('0x32')]=_0x2e86f9[_0x216d('0x8')];writeDB(_0x2be24f);}});}}catch(_0x3c491e){utils['error'](util[_0x216d('0x4')]('[%s][agents][agentconnect]',_0x2e86f9['uniqueid']),_0x3c491e);}};exports[_0x216d('0x11')]=function(_0x43336e){try{if(!_[_0x216d('0x1e')](agents[_0x43336e['destuniqueid']])){utils[_0x216d('0x17')](util['format'](_0x216d('0x33'),_0x43336e[_0x216d('0x6')]),_0x43336e);utils[_0x216d('0x3')](util['format'](_0x216d('0x34'),_0x43336e[_0x216d('0x6')],agents[_0x43336e[_0x216d('0x18')]][_0x216d('0x8')],_0x43336e['destuniqueid']));agents[_0x43336e['destuniqueid']]['agentcomplete']=!![];agents[_0x43336e[_0x216d('0x18')]][_0x216d('0x35')]=utils[_0x216d('0x21')]();agents[_0x43336e[_0x216d('0x18')]][_0x216d('0x2e')]=utils[_0x216d('0x36')](agents[_0x43336e[_0x216d('0x18')]][_0x216d('0x35')],agents[_0x43336e['destuniqueid']][_0x216d('0x37')]);agents[_0x43336e[_0x216d('0x18')]][_0x216d('0x2d')]=_0x43336e[_0x216d('0x2d')];agents[_0x43336e['destuniqueid']][_0x216d('0xc')]='complete';writeDB(agents[_0x43336e[_0x216d('0x18')]]);}}catch(_0x36179){utils[_0x216d('0x26')](util['format']('[%s][agents][agentcomplete]',_0x43336e[_0x216d('0x6')]),_0x36179);}};exports[_0x216d('0x38')]=function(_0x3932a3){try{if(!_[_0x216d('0x1e')](agents[_0x3932a3[_0x216d('0x39')]])){utils[_0x216d('0x17')](util['format']('[%s][agents][blindtransfer]',_0x3932a3[_0x216d('0x6')]),_0x3932a3);utils['info'](util[_0x216d('0x4')](_0x216d('0x3a'),_0x3932a3['uniqueid'],agents[_0x3932a3['transfereruniqueid']]['membername'],agents[_0x3932a3['transfereruniqueid']][_0x216d('0x6')]));agents[_0x3932a3[_0x216d('0x39')]][_0x216d('0x3b')]=!![];agents[_0x3932a3[_0x216d('0x39')]][_0x216d('0x3c')]=_0x216d('0x3d');agents[_0x3932a3[_0x216d('0x39')]]['transferexten']=_0x3932a3[_0x216d('0x3e')];agents[_0x3932a3[_0x216d('0x39')]][_0x216d('0x3f')]=agents[_0x3932a3['transfereruniqueid']][_0x216d('0x6')];}}catch(_0x10fe2e){utils[_0x216d('0x26')](util[_0x216d('0x4')]('[%s][agents][blindtransfer]',_0x3932a3[_0x216d('0x6')]),_0x10fe2e);}};exports[_0x216d('0x40')]=function(_0x18a0bf){try{utils[_0x216d('0x17')](util['format'](_0x216d('0x41'),_0x18a0bf[_0x216d('0x42')]),_0x18a0bf);if(_0x18a0bf['origtransfereruniqueid']==_0x18a0bf[_0x216d('0x43')]){if(!_['isNil'](agents[_0x18a0bf[_0x216d('0x44')]])){utils[_0x216d('0x3')](util[_0x216d('0x4')](_0x216d('0x45'),_0x18a0bf[_0x216d('0x42')],agents[_0x18a0bf[_0x216d('0x44')]][_0x216d('0x8')]));agents[_0x18a0bf[_0x216d('0x44')]][_0x216d('0x3b')]=!![];agents[_0x18a0bf['secondtransfereruniqueid']][_0x216d('0x3c')]=_0x216d('0x46');agents[_0x18a0bf['secondtransfereruniqueid']][_0x216d('0x47')]=_0x18a0bf[_0x216d('0x48')];agents[_0x18a0bf['secondtransfereruniqueid']]['transferuniqueid']=_0x18a0bf[_0x216d('0x42')];}if(_0x18a0bf['transfereeuniqueid']&&agents[_0x18a0bf[_0x216d('0x49')]]){agents[_0x18a0bf[_0x216d('0x49')]][_0x216d('0x4a')]=0x1;transfers[_0x18a0bf['transfereeuniqueid']]=_[_0x216d('0x4b')](agents[_0x18a0bf['transfereeuniqueid']]);transfers[_0x18a0bf['transfereeuniqueid']][_0x216d('0xa')]=agents[_0x18a0bf[_0x216d('0x44')]]['calleridnum'];transfers[_0x18a0bf[_0x216d('0x49')]][_0x216d('0x4c')]=agents[_0x18a0bf[_0x216d('0x44')]][_0x216d('0x4c')];transfers[_0x18a0bf[_0x216d('0x49')]][_0x216d('0x19')]=utils['now']();transfers[_0x18a0bf['transfereeuniqueid']][_0x216d('0x37')]=utils[_0x216d('0x21')]();transfers[_0x18a0bf[_0x216d('0x49')]][_0x216d('0x23')]=0x0;transfers[_0x18a0bf[_0x216d('0x49')]][_0x216d('0x4a')]=0x2;}}else if(_0x18a0bf[_0x216d('0x44')]==_0x18a0bf[_0x216d('0x4d')]){if(!_[_0x216d('0x1e')](agents[_0x18a0bf[_0x216d('0x42')]])){utils[_0x216d('0x3')](util[_0x216d('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x18a0bf['origtransfereruniqueid'],agents[_0x18a0bf[_0x216d('0x42')]][_0x216d('0x8')]));agents[_0x18a0bf['origtransfereruniqueid']][_0x216d('0x3b')]=!![];agents[_0x18a0bf['origtransfereruniqueid']]['transfertype']=_0x216d('0x46');agents[_0x18a0bf[_0x216d('0x42')]][_0x216d('0x47')]=_0x18a0bf[_0x216d('0x4e')];agents[_0x18a0bf[_0x216d('0x42')]][_0x216d('0x3f')]=_0x18a0bf[_0x216d('0x44')];}if(_0x18a0bf[_0x216d('0x4f')]&&agents[_0x18a0bf[_0x216d('0x4f')]]){agents[_0x18a0bf[_0x216d('0x4f')]][_0x216d('0x4a')]=0x1;transfers[_0x18a0bf[_0x216d('0x4f')]]=_[_0x216d('0x4b')](agents[_0x18a0bf[_0x216d('0x4f')]]);transfers[_0x18a0bf[_0x216d('0x4f')]][_0x216d('0xa')]=agents[_0x18a0bf[_0x216d('0x42')]][_0x216d('0xa')];transfers[_0x18a0bf[_0x216d('0x4f')]][_0x216d('0x4c')]=agents[_0x18a0bf[_0x216d('0x42')]][_0x216d('0x4c')];transfers[_0x18a0bf['transfertargetuniqueid']][_0x216d('0x19')]=utils['now']();transfers[_0x18a0bf[_0x216d('0x4f')]]['agentconnectAt']=utils[_0x216d('0x21')]();transfers[_0x18a0bf[_0x216d('0x4f')]]['holdtime']=0x0;transfers[_0x18a0bf[_0x216d('0x4f')]][_0x216d('0x4a')]=0x2;}}}catch(_0x3729b6){utils[_0x216d('0x26')](util[_0x216d('0x4')](_0x216d('0x41'),_0x18a0bf[_0x216d('0x42')]),_0x3729b6);}};exports[_0x216d('0x50')]=function(_0x2727c7){try{utils['debug'](util[_0x216d('0x4')](_0x216d('0x51'),_0x2727c7[_0x216d('0x6')]),_0x2727c7);if(agents[_0x2727c7['uniqueid']]&&agents[_0x2727c7['uniqueid']]['reason']==='timeout'){if(_0x2727c7[_0x216d('0x52')]==='21'){agents[_0x2727c7['uniqueid']][_0x216d('0x2d')]=_0x216d('0x53');agents[_0x2727c7[_0x216d('0x6')]][_0x216d('0xc')]=_0x216d('0x53');}utils[_0x216d('0x3')](util[_0x216d('0x4')](_0x216d('0x54'),_0x2727c7[_0x216d('0x6')],agents[_0x2727c7['uniqueid']][_0x216d('0x8')],agents[_0x2727c7[_0x216d('0x6')]]['reason'],agents[_0x2727c7[_0x216d('0x6')]][_0x216d('0xc')]));writeDB(agents[_0x2727c7[_0x216d('0x6')]]);var _0x1650fd=unanswered[_0x216d('0x55')](_0x2727c7[_0x216d('0x6')]);if(_0x1650fd>-0x1){unanswered['splice'](_0x1650fd,0x1);}}if(transfers[_0x2727c7['uniqueid']]){transfers[_0x2727c7[_0x216d('0x6')]]['agentcomplete']=!![];transfers[_0x2727c7[_0x216d('0x6')]][_0x216d('0x35')]=utils[_0x216d('0x21')]();transfers[_0x2727c7['uniqueid']]['talktime']=utils['diffTime'](transfers[_0x2727c7[_0x216d('0x6')]][_0x216d('0x35')],transfers[_0x2727c7[_0x216d('0x6')]][_0x216d('0x37')]);transfers[_0x2727c7['uniqueid']][_0x216d('0x2d')]=_0x216d('0x56');transfers[_0x2727c7[_0x216d('0x6')]]['lastevent']='complete';utils[_0x216d('0x3')](util[_0x216d('0x4')](_0x216d('0x54'),_0x2727c7[_0x216d('0x6')],transfers[_0x2727c7[_0x216d('0x6')]]['membername'],transfers[_0x2727c7[_0x216d('0x6')]][_0x216d('0x2d')],transfers[_0x2727c7[_0x216d('0x6')]][_0x216d('0xc')]));writeDB(transfers[_0x2727c7['uniqueid']],!![]);}if(agents[_0x2727c7[_0x216d('0x6')]]&&agents[_0x2727c7['uniqueid']][_0x216d('0x37')]){agents[_0x2727c7['uniqueid']][_0x216d('0x11')]=!![];agents[_0x2727c7[_0x216d('0x6')]][_0x216d('0x35')]=utils[_0x216d('0x21')]();agents[_0x2727c7[_0x216d('0x6')]]['talktime']=utils[_0x216d('0x36')](agents[_0x2727c7['uniqueid']]['agentcompleteAt'],agents[_0x2727c7['uniqueid']]['agentconnectAt']);agents[_0x2727c7[_0x216d('0x6')]][_0x216d('0x2d')]=agents[_0x2727c7[_0x216d('0x6')]]['transfer']?'transfer':_0x216d('0x56');agents[_0x2727c7[_0x216d('0x6')]][_0x216d('0xc')]=_0x216d('0x57');utils[_0x216d('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2727c7[_0x216d('0x6')],agents[_0x2727c7['uniqueid']][_0x216d('0x8')],agents[_0x2727c7['uniqueid']][_0x216d('0x2d')],agents[_0x2727c7[_0x216d('0x6')]][_0x216d('0xc')]));writeDB(agents[_0x2727c7[_0x216d('0x6')]]);}}catch(_0x4899d1){utils['error'](util[_0x216d('0x4')](_0x216d('0x51'),_0x2727c7[_0x216d('0x6')]),_0x4899d1);}};
\ No newline at end of file
index 584cc4a..6abd9df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d67=['includes','noop','execif','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','connectedlinenum','lastevent','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','accountcode','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','destinationchannel','answertime','toNumber','hangup','callerid','calleridnum','cause-txt','endtime','duration','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','split','substring','lastIndexOf'];(function(_0x7e55a4,_0x10ff38){var _0x1e152b=function(_0x58ec93){while(--_0x58ec93){_0x7e55a4['push'](_0x7e55a4['shift']());}};_0x1e152b(++_0x10ff38);}(_0x4d67,0xde));var _0x74d6=function(_0x5dca3b,_0x1fdac5){_0x5dca3b=_0x5dca3b-0x0;var _0x585514=_0x4d67[_0x5dca3b];return _0x585514;};'use strict';var _=require(_0x74d6('0x0'));var util=require(_0x74d6('0x1'));var utils=require(_0x74d6('0x2'));var transfers=require(_0x74d6('0x3'));var dispositions=[_0x74d6('0x4'),_0x74d6('0x5'),_0x74d6('0x5'),_0x74d6('0x4'),'NO\x20ANSWER','NO\x20ANSWER',_0x74d6('0x6'),_0x74d6('0x7'),_0x74d6('0x5'),'FAILED',_0x74d6('0x5')];var channels={};function writeDB(_0x2d509e){var _0x6c461d;if(transfers[_0x74d6('0x8')][_0x2d509e[_0x74d6('0x9')]]){_0x6c461d=_0x2d509e[_0x74d6('0x9')];_0x2d509e[_0x74d6('0x9')]=transfers['blinds'][_0x2d509e['uniqueid']][_0x74d6('0xa')];}utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0xd'),_0x2d509e['uniqueid'],_0x2d509e['channel'],_0x2d509e[_0x74d6('0xe')],_0x2d509e[_0x74d6('0xf')],_0x2d509e[_0x74d6('0x10')],_0x2d509e['calleridnum'],_0x2d509e[_0x74d6('0x11')],_0x2d509e[_0x74d6('0x12')]));if(_0x2d509e['accountcode']){utils['getUserByInternal'](_0x2d509e['accountcode'])[_0x74d6('0x13')](function(_0x93227c){if(_0x93227c){_0x2d509e[_0x74d6('0x14')]=_0x93227c['id'];}utils[_0x74d6('0x15')](_0x74d6('0x16'),_0x2d509e);});}else{utils[_0x74d6('0x15')]('CreateVoiceCallReport',_0x2d509e);}if(channels[_0x2d509e[_0x74d6('0x9')]]){delete channels[_0x2d509e[_0x74d6('0x9')]];}else if(_0x6c461d&&channels[_0x6c461d]){delete transfers[_0x74d6('0x8')][_0x6c461d];delete channels[_0x6c461d];}}exports[_0x74d6('0x17')]=function(_0x351f1d){try{utils[_0x74d6('0x18')](util['format'](_0x74d6('0x19'),_0x351f1d[_0x74d6('0x9')]),_0x351f1d);if(_0x351f1d['uniqueid']==_0x351f1d[_0x74d6('0x1a')]&&_0x351f1d[_0x74d6('0x1b')]!=_0x74d6('0x1c')){utils['info'](util['format'](_0x74d6('0x1d'),_0x351f1d[_0x74d6('0x9')],_0x351f1d[_0x74d6('0x1e')],_0x351f1d[_0x74d6('0x1f')]));channels[_0x351f1d[_0x74d6('0x9')]]={'uniqueid':_0x351f1d[_0x74d6('0x9')],'accountcode':_0x351f1d[_0x74d6('0x20')],'source':_0x351f1d['calleridnum'],'destination':_0x351f1d[_0x74d6('0x1f')],'destinationcontext':_0x351f1d[_0x74d6('0x1e')],'channel':_0x351f1d['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x74d6('0x4'),'amaflags':_0x74d6('0x21')};}}catch(_0x5dddc7){utils[_0x74d6('0x22')](util[_0x74d6('0xc')](_0x74d6('0x19'),_0x351f1d[_0x74d6('0x9')]),_0x5dddc7);}};exports[_0x74d6('0x23')]=function(_0x430f3f){try{utils[_0x74d6('0x18')](util[_0x74d6('0xc')](_0x74d6('0x24'),_0x430f3f[_0x74d6('0x9')]),_0x430f3f);if(!_[_0x74d6('0x25')](channels[_0x430f3f[_0x74d6('0x9')]])&&_0x430f3f[_0x74d6('0x26')]==0x6){utils['info'](util['format'](_0x74d6('0x27'),_0x430f3f['uniqueid'],_0x430f3f[_0x74d6('0x1e')],_0x430f3f[_0x74d6('0x1b')]));if(_[_0x74d6('0x25')](channels[_0x430f3f[_0x74d6('0x9')]][_0x74d6('0x28')])){channels[_0x430f3f[_0x74d6('0x9')]][_0x74d6('0x28')]=utils[_0x74d6('0x29')]();}}else if(!_[_0x74d6('0x25')](channels[_0x430f3f[_0x74d6('0x1a')]])&&_0x430f3f[_0x74d6('0x26')]==0x6&&_0x430f3f['context']!=_0x74d6('0x2a')){utils[_0x74d6('0xb')](util[_0x74d6('0xc')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x430f3f[_0x74d6('0x9')],_0x430f3f[_0x74d6('0x1a')],_0x430f3f[_0x74d6('0x1e')],_0x430f3f['channel']));channels[_0x430f3f[_0x74d6('0x1a')]][_0x74d6('0x20')]=_0x430f3f[_0x74d6('0x20')];channels[_0x430f3f['linkedid']][_0x74d6('0x2b')]=_0x430f3f[_0x74d6('0x1b')];if(_[_0x74d6('0x25')](channels[_0x430f3f[_0x74d6('0x1a')]]['answertime'])){channels[_0x430f3f[_0x74d6('0x1a')]][_0x74d6('0x2c')]=utils[_0x74d6('0x29')]();}channels[_0x430f3f[_0x74d6('0x1a')]]['disposition']=dispositions[_[_0x74d6('0x2d')](_0x430f3f['channelstate'])]||_0x74d6('0x6');}}catch(_0x57638b){utils[_0x74d6('0x22')](util[_0x74d6('0xc')](_0x74d6('0x24'),_0x430f3f['uniqueid']),_0x57638b);}};exports[_0x74d6('0x2e')]=function(_0x575c2a){try{if(!_[_0x74d6('0x25')](channels[_0x575c2a[_0x74d6('0x9')]])){utils['debug'](util['format']('[%s][calls][hangup]',_0x575c2a[_0x74d6('0x9')]),_0x575c2a);if(_[_0x74d6('0x25')](channels[_0x575c2a[_0x74d6('0x9')]][_0x74d6('0x2f')])){channels[_0x575c2a[_0x74d6('0x9')]]['callerid']=_0x575c2a['calleridname']+'\x20<'+_0x575c2a[_0x74d6('0x30')]+'>';}utils[_0x74d6('0xb')](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x575c2a[_0x74d6('0x9')],channels[_0x575c2a[_0x74d6('0x9')]][_0x74d6('0x2f')],_0x575c2a[_0x74d6('0x31')]));channels[_0x575c2a['uniqueid']][_0x74d6('0x32')]=utils['now']();channels[_0x575c2a['uniqueid']][_0x74d6('0x33')]=utils['diffTime'](channels[_0x575c2a['uniqueid']][_0x74d6('0x32')],channels[_0x575c2a[_0x74d6('0x9')]][_0x74d6('0x34')]);channels[_0x575c2a[_0x74d6('0x9')]][_0x74d6('0x35')]=channels[_0x575c2a[_0x74d6('0x9')]][_0x74d6('0x2c')]?utils[_0x74d6('0x36')](channels[_0x575c2a[_0x74d6('0x9')]][_0x74d6('0x32')],channels[_0x575c2a[_0x74d6('0x9')]]['answertime']):0x0;writeDB(channels[_0x575c2a['uniqueid']]);}}catch(_0x3cca4b){utils[_0x74d6('0x22')](util[_0x74d6('0xc')](_0x74d6('0x37'),_0x575c2a[_0x74d6('0x9')]),_0x3cca4b);}};exports[_0x74d6('0x38')]=function(_0x316f75){try{if(!_['isNil'](channels[_0x316f75[_0x74d6('0x39')]])){utils[_0x74d6('0x18')](util[_0x74d6('0xc')]('[%s][calls][attendedtransfer]',_0x316f75['origtransfereruniqueid']),_0x316f75);if(channels[_0x316f75[_0x74d6('0x39')]]['channel']==_0x316f75[_0x74d6('0x3a')]){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x3b'),_0x316f75[_0x74d6('0x3c')],_0x316f75['localtwolinkedid'],_0x316f75['secondtransfererchannel']));channels[_0x316f75['localtwolinkedid']][_0x74d6('0x2b')]=_0x316f75[_0x74d6('0x3d')];channels[_0x316f75['localtwolinkedid']]['userfield']=_0x74d6('0x3e');}else if(channels[_0x316f75[_0x74d6('0x39')]][_0x74d6('0x1b')]=_0x316f75[_0x74d6('0x3f')]){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x3b'),_0x316f75[_0x74d6('0x3c')],_0x316f75['localtwolinkedid'],_0x316f75[_0x74d6('0x40')]));channels[_0x316f75[_0x74d6('0x39')]]['destinationchannel']=_0x316f75['origtransfererchannel'];channels[_0x316f75[_0x74d6('0x39')]]['userfield']='_attended';}}}catch(_0x33d197){utils[_0x74d6('0x22')](util[_0x74d6('0xc')](_0x74d6('0x41'),_0x316f75[_0x74d6('0x3c')]),_0x33d197);}};exports['musiconholdstart']=function(_0x4e3899){try{if(!_[_0x74d6('0x25')](channels[_0x4e3899['uniqueid']])){utils[_0x74d6('0x18')](util[_0x74d6('0xc')](_0x74d6('0x42'),_0x4e3899[_0x74d6('0x9')]),_0x4e3899);channels[_0x4e3899[_0x74d6('0x9')]][_0x74d6('0x43')]=utils[_0x74d6('0x29')]();utils[_0x74d6('0xb')](util[_0x74d6('0xc')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4e3899[_0x74d6('0x9')],channels[_0x4e3899['uniqueid']][_0x74d6('0x43')]));}}catch(_0xfef324){utils[_0x74d6('0x22')](util[_0x74d6('0xc')]('[%s][calls][musiconholdstart]',_0x4e3899[_0x74d6('0x9')]),_0xfef324);}};exports['musiconholdstop']=function(_0x4115ee){try{if(!_['isNil'](channels[_0x4115ee[_0x74d6('0x9')]])){utils[_0x74d6('0x18')](util[_0x74d6('0xc')](_0x74d6('0x44'),_0x4115ee[_0x74d6('0x9')]),_0x4115ee);if(!_['isNil'](channels[_0x4115ee[_0x74d6('0x9')]][_0x74d6('0x43')])){channels[_0x4115ee[_0x74d6('0x9')]][_0x74d6('0x45')]+=utils[_0x74d6('0x36')](utils[_0x74d6('0x29')](),channels[_0x4115ee[_0x74d6('0x9')]]['musiconholdstartAt']);utils[_0x74d6('0xb')](util[_0x74d6('0xc')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x4115ee[_0x74d6('0x9')],channels[_0x4115ee['uniqueid']][_0x74d6('0x45')]));delete channels[_0x4115ee[_0x74d6('0x9')]][_0x74d6('0x43')];}}}catch(_0x5bbc9f){utils[_0x74d6('0x22')](util[_0x74d6('0xc')]('[%s][calls][musiconholdstop]',_0x4115ee[_0x74d6('0x9')]),_0x5bbc9f);}};exports[_0x74d6('0x46')]=function(_0x12e8c6){try{if(!_[_0x74d6('0x25')](channels[_0x12e8c6[_0x74d6('0x9')]])){utils[_0x74d6('0x18')](util[_0x74d6('0xc')](_0x74d6('0x47'),_0x12e8c6[_0x74d6('0x9')]),_0x12e8c6);if(!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')]['xmd-originatecalleridnum'])){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x49'),_0x12e8c6[_0x74d6('0x9')],_0x12e8c6[_0x74d6('0x4a')]));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x4b')]=_0x12e8c6['value'];}if(!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')]['xmd-phone'])){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x4c'),_0x12e8c6[_0x74d6('0x9')],_0x12e8c6[_0x74d6('0x4a')]));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x4d')]=_0x12e8c6[_0x74d6('0x4a')];channels[_0x12e8c6[_0x74d6('0x9')]]['callerid']='\x22'+_0x12e8c6[_0x74d6('0x4a')]+_0x74d6('0x4e')+_0x12e8c6[_0x74d6('0x4a')]+'>';}if(!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')][_0x74d6('0x4f')])||!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')][_0x74d6('0x50')])){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x51'),_0x12e8c6['uniqueid'],!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')][_0x74d6('0x4f')])?_0x74d6('0x4f'):_0x74d6('0x50'),_0x12e8c6[_0x74d6('0x4a')]));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x2f')]=_0x12e8c6[_0x74d6('0x4a')];}if(!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')][_0x74d6('0x52')])||!_['isNil'](_0x12e8c6[_0x74d6('0x48')][_0x74d6('0x53')])){utils[_0x74d6('0xb')](util['format'](_0x74d6('0x51'),_0x12e8c6['uniqueid'],!_['isNil'](_0x12e8c6[_0x74d6('0x48')]['xmd-queue'])?_0x74d6('0x52'):_0x74d6('0x53'),_0x12e8c6[_0x74d6('0x4a')]));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x54')]=_0x74d6('0x55');channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x56')]=_0x12e8c6[_0x74d6('0x4a')];channels[_0x12e8c6[_0x74d6('0x9')]]['queue']=!![];}if(!_[_0x74d6('0x25')](_0x12e8c6['variable'][_0x74d6('0x57')])){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x58'),_0x12e8c6[_0x74d6('0x9')],_0x12e8c6['value']));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x59')]=_0x12e8c6[_0x74d6('0x4a')];}if(!_['isNil'](_0x12e8c6[_0x74d6('0x48')][_0x74d6('0x5a')])){utils['info'](util['format'](_0x74d6('0x5b'),_0x12e8c6['uniqueid'],_0x12e8c6[_0x74d6('0x4a')]));channels[_0x12e8c6['uniqueid']][_0x74d6('0x5c')]=_0x12e8c6['value'];}if(!_[_0x74d6('0x25')](_0x12e8c6[_0x74d6('0x48')]['outboundrouteid'])){utils['info'](util['format'](_0x74d6('0x5d'),_0x12e8c6['uniqueid'],_0x12e8c6['value']));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x5e')]=_0x12e8c6[_0x74d6('0x4a')];}if(!_[_0x74d6('0x25')](_0x12e8c6['variable']['sipcallid'])){utils[_0x74d6('0xb')](util[_0x74d6('0xc')](_0x74d6('0x5f'),_0x12e8c6['uniqueid'],_0x12e8c6['value']));channels[_0x12e8c6[_0x74d6('0x9')]][_0x74d6('0x60')]=_0x12e8c6[_0x74d6('0x4a')];}}}catch(_0x162199){utils[_0x74d6('0x22')](util['format'](_0x74d6('0x47'),_0x12e8c6[_0x74d6('0x9')]),_0x162199);}};exports[_0x74d6('0x61')]=function(_0x13cf3c){try{if(!_[_0x74d6('0x25')](channels[_0x13cf3c[_0x74d6('0x9')]])){utils[_0x74d6('0x18')](util[_0x74d6('0xc')](_0x74d6('0x62'),_0x13cf3c[_0x74d6('0x9')]),_0x13cf3c);utils[_0x74d6('0xb')](util[_0x74d6('0xc')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x13cf3c['uniqueid'],_0x13cf3c[_0x74d6('0x63')],_0x13cf3c[_0x74d6('0x64')]));if(_0x13cf3c['application']['toLowerCase']()=='set'&&_['startsWith'](_0x13cf3c['appdata'][_0x74d6('0x65')](),'cdr')){var _0x9cc05c=_0x13cf3c[_0x74d6('0x64')][_0x74d6('0x66')]('=');var _0x1e9565=_0x9cc05c[0x0][_0x74d6('0x67')](_0x9cc05c[0x0][_0x74d6('0x68')]('(')+0x1,_0x9cc05c[0x0]['lastIndexOf'](')'));var _0x18f64e=_0x9cc05c[0x1];channels[_0x13cf3c['uniqueid']][_0x1e9565]=_0x18f64e;}if(!_[_0x74d6('0x69')](['hangup',_0x74d6('0x6a'),_0x74d6('0x6b'),'set',_0x74d6('0x6c')],_0x13cf3c['application'][_0x74d6('0x65')]())){channels[_0x13cf3c['uniqueid']][_0x74d6('0x54')]=_0x13cf3c['application'];channels[_0x13cf3c[_0x74d6('0x9')]][_0x74d6('0x56')]=_0x13cf3c[_0x74d6('0x64')];}}}catch(_0x22b48f){utils['error'](util[_0x74d6('0xc')]('[%s][calls][newexten]',_0x13cf3c['uniqueid']),_0x22b48f);}};
\ No newline at end of file
+var _0x6fef=['startsWith','appdata','cdr','split','lastIndexOf','includes','noop','execif','gotoif','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','duration','diffTime','endtime','starttime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6fef,0x76));var _0xf6fe=function(_0x32cae2,_0x1d8e53){_0x32cae2=_0x32cae2-0x0;var _0xbc434b=_0x6fef[_0x32cae2];return _0xbc434b;};'use strict';var _=require('lodash');var util=require(_0xf6fe('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0xf6fe('0x1'),_0xf6fe('0x2'),_0xf6fe('0x2'),_0xf6fe('0x1'),_0xf6fe('0x1'),'NO\x20ANSWER',_0xf6fe('0x3'),_0xf6fe('0x4'),_0xf6fe('0x2'),'FAILED',_0xf6fe('0x2')];var channels={};function writeDB(_0x491d24){var _0x47e85d;if(transfers['blinds'][_0x491d24[_0xf6fe('0x5')]]){_0x47e85d=_0x491d24[_0xf6fe('0x5')];_0x491d24[_0xf6fe('0x5')]=transfers[_0xf6fe('0x6')][_0x491d24['uniqueid']][_0xf6fe('0x7')];}utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0xa'),_0x491d24['uniqueid'],_0x491d24[_0xf6fe('0xb')],_0x491d24['queue'],_0x491d24[_0xf6fe('0xc')],_0x491d24['interface'],_0x491d24[_0xf6fe('0xd')],_0x491d24[_0xf6fe('0xe')],_0x491d24[_0xf6fe('0xf')]));if(_0x491d24[_0xf6fe('0x10')]){utils[_0xf6fe('0x11')](_0x491d24[_0xf6fe('0x10')])['then'](function(_0x13d5a1){if(_0x13d5a1){_0x491d24['UserId']=_0x13d5a1['id'];}utils[_0xf6fe('0x12')](_0xf6fe('0x13'),_0x491d24);});}else{utils[_0xf6fe('0x12')](_0xf6fe('0x13'),_0x491d24);}if(channels[_0x491d24['uniqueid']]){delete channels[_0x491d24['uniqueid']];}else if(_0x47e85d&&channels[_0x47e85d]){delete transfers[_0xf6fe('0x6')][_0x47e85d];delete channels[_0x47e85d];}}exports[_0xf6fe('0x14')]=function(_0x2b0739){try{utils[_0xf6fe('0x15')](util[_0xf6fe('0x9')](_0xf6fe('0x16'),_0x2b0739[_0xf6fe('0x5')]),_0x2b0739);if(_0x2b0739[_0xf6fe('0x5')]==_0x2b0739[_0xf6fe('0x17')]&&_0x2b0739[_0xf6fe('0xb')]!=_0xf6fe('0x18')){utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x19'),_0x2b0739[_0xf6fe('0x5')],_0x2b0739[_0xf6fe('0x1a')],_0x2b0739[_0xf6fe('0x1b')]));channels[_0x2b0739[_0xf6fe('0x5')]]={'uniqueid':_0x2b0739[_0xf6fe('0x5')],'accountcode':_0x2b0739[_0xf6fe('0x10')],'source':_0x2b0739[_0xf6fe('0xd')],'destination':_0x2b0739['exten'],'destinationcontext':_0x2b0739['context'],'channel':_0x2b0739[_0xf6fe('0xb')],'starttime':utils[_0xf6fe('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf6fe('0x1d')};}}catch(_0x5dc770){utils[_0xf6fe('0x1e')](util[_0xf6fe('0x9')]('[%s][calls][newchannel]',_0x2b0739[_0xf6fe('0x5')]),_0x5dc770);}};exports['newstate']=function(_0x3bb51f){try{utils[_0xf6fe('0x15')](util[_0xf6fe('0x9')]('[%s][calls][newstate]',_0x3bb51f[_0xf6fe('0x5')]),_0x3bb51f);if(!_[_0xf6fe('0x1f')](channels[_0x3bb51f[_0xf6fe('0x5')]])&&_0x3bb51f[_0xf6fe('0x20')]==0x6){utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x21'),_0x3bb51f[_0xf6fe('0x5')],_0x3bb51f[_0xf6fe('0x1a')],_0x3bb51f[_0xf6fe('0xb')]));if(_[_0xf6fe('0x1f')](channels[_0x3bb51f[_0xf6fe('0x5')]][_0xf6fe('0x22')])){channels[_0x3bb51f['uniqueid']]['systemanswertime']=utils[_0xf6fe('0x1c')]();}}else if(!_[_0xf6fe('0x1f')](channels[_0x3bb51f['linkedid']])&&_0x3bb51f['channelstate']==0x6&&_0x3bb51f[_0xf6fe('0x1a')]!=_0xf6fe('0x23')){utils[_0xf6fe('0x8')](util['format'](_0xf6fe('0x24'),_0x3bb51f['uniqueid'],_0x3bb51f[_0xf6fe('0x17')],_0x3bb51f[_0xf6fe('0x1a')],_0x3bb51f[_0xf6fe('0xb')]));channels[_0x3bb51f['linkedid']][_0xf6fe('0x10')]=_0x3bb51f[_0xf6fe('0x10')];channels[_0x3bb51f[_0xf6fe('0x17')]]['destinationchannel']=_0x3bb51f[_0xf6fe('0xb')];if(_[_0xf6fe('0x1f')](channels[_0x3bb51f['linkedid']][_0xf6fe('0x25')])){channels[_0x3bb51f[_0xf6fe('0x17')]][_0xf6fe('0x25')]=utils[_0xf6fe('0x1c')]();}channels[_0x3bb51f['linkedid']]['disposition']=dispositions[_[_0xf6fe('0x26')](_0x3bb51f[_0xf6fe('0x20')])]||_0xf6fe('0x3');}}catch(_0x69dda){utils[_0xf6fe('0x1e')](util['format'](_0xf6fe('0x27'),_0x3bb51f['uniqueid']),_0x69dda);}};exports[_0xf6fe('0x28')]=function(_0xdd06ef){try{if(!_[_0xf6fe('0x1f')](channels[_0xdd06ef['uniqueid']])){utils[_0xf6fe('0x15')](util[_0xf6fe('0x9')](_0xf6fe('0x29'),_0xdd06ef[_0xf6fe('0x5')]),_0xdd06ef);if(_[_0xf6fe('0x1f')](channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x2a')])){channels[_0xdd06ef['uniqueid']][_0xf6fe('0x2a')]=_0xdd06ef[_0xf6fe('0x2b')]+'\x20<'+_0xdd06ef['calleridnum']+'>';}utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0xdd06ef[_0xf6fe('0x5')],channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x2a')],_0xdd06ef[_0xf6fe('0x2c')]));channels[_0xdd06ef[_0xf6fe('0x5')]]['endtime']=utils[_0xf6fe('0x1c')]();channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x2d')]=utils[_0xf6fe('0x2e')](channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x2f')],channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x30')]);channels[_0xdd06ef[_0xf6fe('0x5')]]['billableseconds']=channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x25')]?utils['diffTime'](channels[_0xdd06ef[_0xf6fe('0x5')]][_0xf6fe('0x2f')],channels[_0xdd06ef['uniqueid']]['answertime']):0x0;writeDB(channels[_0xdd06ef['uniqueid']]);}}catch(_0x45f733){utils[_0xf6fe('0x1e')](util[_0xf6fe('0x9')](_0xf6fe('0x29'),_0xdd06ef['uniqueid']),_0x45f733);}};exports[_0xf6fe('0x31')]=function(_0x52309b){try{if(!_['isNil'](channels[_0x52309b['localtwolinkedid']])){utils[_0xf6fe('0x15')](util[_0xf6fe('0x9')](_0xf6fe('0x32'),_0x52309b[_0xf6fe('0x33')]),_0x52309b);if(channels[_0x52309b[_0xf6fe('0x34')]][_0xf6fe('0xb')]==_0x52309b[_0xf6fe('0x35')]){utils[_0xf6fe('0x8')](util['format'](_0xf6fe('0x36'),_0x52309b[_0xf6fe('0x33')],_0x52309b[_0xf6fe('0x34')],_0x52309b[_0xf6fe('0x37')]));channels[_0x52309b[_0xf6fe('0x34')]][_0xf6fe('0x38')]=_0x52309b[_0xf6fe('0x37')];channels[_0x52309b[_0xf6fe('0x34')]]['userfield']=_0xf6fe('0x39');}else if(channels[_0x52309b[_0xf6fe('0x34')]][_0xf6fe('0xb')]=_0x52309b[_0xf6fe('0x3a')]){utils['info'](util['format'](_0xf6fe('0x36'),_0x52309b['origtransfereruniqueid'],_0x52309b['localtwolinkedid'],_0x52309b[_0xf6fe('0x3b')]));channels[_0x52309b[_0xf6fe('0x34')]]['destinationchannel']=_0x52309b[_0xf6fe('0x3b')];channels[_0x52309b[_0xf6fe('0x34')]][_0xf6fe('0x3c')]='_attended';}}}catch(_0x3b8165){utils[_0xf6fe('0x1e')](util[_0xf6fe('0x9')](_0xf6fe('0x32'),_0x52309b[_0xf6fe('0x33')]),_0x3b8165);}};exports[_0xf6fe('0x3d')]=function(_0x272b99){try{if(!_[_0xf6fe('0x1f')](channels[_0x272b99[_0xf6fe('0x5')]])){utils[_0xf6fe('0x15')](util['format'](_0xf6fe('0x3e'),_0x272b99['uniqueid']),_0x272b99);channels[_0x272b99['uniqueid']][_0xf6fe('0x3f')]=utils[_0xf6fe('0x1c')]();utils['info'](util[_0xf6fe('0x9')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x272b99[_0xf6fe('0x5')],channels[_0x272b99['uniqueid']]['musiconholdstartAt']));}}catch(_0xd026b1){utils[_0xf6fe('0x1e')](util[_0xf6fe('0x9')](_0xf6fe('0x3e'),_0x272b99[_0xf6fe('0x5')]),_0xd026b1);}};exports[_0xf6fe('0x40')]=function(_0x25af94){try{if(!_[_0xf6fe('0x1f')](channels[_0x25af94[_0xf6fe('0x5')]])){utils[_0xf6fe('0x15')](util['format'](_0xf6fe('0x41'),_0x25af94[_0xf6fe('0x5')]),_0x25af94);if(!_[_0xf6fe('0x1f')](channels[_0x25af94[_0xf6fe('0x5')]][_0xf6fe('0x3f')])){channels[_0x25af94[_0xf6fe('0x5')]]['mohtime']+=utils[_0xf6fe('0x2e')](utils[_0xf6fe('0x1c')](),channels[_0x25af94[_0xf6fe('0x5')]][_0xf6fe('0x3f')]);utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x42'),_0x25af94[_0xf6fe('0x5')],channels[_0x25af94[_0xf6fe('0x5')]]['mohtime']));delete channels[_0x25af94[_0xf6fe('0x5')]][_0xf6fe('0x3f')];}}}catch(_0x2f31e9){utils[_0xf6fe('0x1e')](util[_0xf6fe('0x9')](_0xf6fe('0x41'),_0x25af94[_0xf6fe('0x5')]),_0x2f31e9);}};exports[_0xf6fe('0x43')]=function(_0x11b9d9){try{if(!_['isNil'](channels[_0x11b9d9[_0xf6fe('0x5')]])){utils[_0xf6fe('0x15')](util[_0xf6fe('0x9')]('[%s][calls][varset]',_0x11b9d9[_0xf6fe('0x5')]),_0x11b9d9);if(!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')]['xmd-originatecalleridnum'])){utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x45'),_0x11b9d9[_0xf6fe('0x5')],_0x11b9d9['value']));channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x46')]=_0x11b9d9[_0xf6fe('0x47')];}if(!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x48')])){utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x49'),_0x11b9d9[_0xf6fe('0x5')],_0x11b9d9[_0xf6fe('0x47')]));channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x4a')]=_0x11b9d9[_0xf6fe('0x47')];channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x2a')]='\x22'+_0x11b9d9[_0xf6fe('0x47')]+_0xf6fe('0x4b')+_0x11b9d9[_0xf6fe('0x47')]+'>';}if(!_['isNil'](_0x11b9d9['variable'][_0xf6fe('0x4c')])||!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x4d')])){utils['info'](util[_0xf6fe('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x11b9d9[_0xf6fe('0x5')],!_['isNil'](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x4c')])?'xmd-callerid-preview':'xmd-callerid',_0x11b9d9['value']));channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x2a')]=_0x11b9d9[_0xf6fe('0x47')];}if(!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x4e')])||!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x4f')])){utils['info'](util[_0xf6fe('0x9')](_0xf6fe('0x50'),_0x11b9d9[_0xf6fe('0x5')],!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x4e')])?_0xf6fe('0x4e'):_0xf6fe('0x4f'),_0x11b9d9[_0xf6fe('0x47')]));channels[_0x11b9d9[_0xf6fe('0x5')]]['lastapplication']=_0xf6fe('0x51');channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x52')]=_0x11b9d9[_0xf6fe('0x47')];channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x53')]=!![];}if(!_[_0xf6fe('0x1f')](_0x11b9d9['variable'][_0xf6fe('0x54')])){utils['info'](util[_0xf6fe('0x9')](_0xf6fe('0x55'),_0x11b9d9[_0xf6fe('0x5')],_0x11b9d9[_0xf6fe('0x47')]));channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x56')]=_0x11b9d9[_0xf6fe('0x47')];}if(!_[_0xf6fe('0x1f')](_0x11b9d9['variable'][_0xf6fe('0x57')])){utils['info'](util[_0xf6fe('0x9')](_0xf6fe('0x58'),_0x11b9d9[_0xf6fe('0x5')],_0x11b9d9[_0xf6fe('0x47')]));channels[_0x11b9d9['uniqueid']]['type']=_0x11b9d9[_0xf6fe('0x47')];}if(!_[_0xf6fe('0x1f')](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x59')])){utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x5a'),_0x11b9d9[_0xf6fe('0x5')],_0x11b9d9[_0xf6fe('0x47')]));channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x5b')]=_0x11b9d9[_0xf6fe('0x47')];}if(!_['isNil'](_0x11b9d9[_0xf6fe('0x44')][_0xf6fe('0x5c')])){utils[_0xf6fe('0x8')](util[_0xf6fe('0x9')](_0xf6fe('0x5d'),_0x11b9d9[_0xf6fe('0x5')],_0x11b9d9[_0xf6fe('0x47')]));channels[_0x11b9d9[_0xf6fe('0x5')]][_0xf6fe('0x5c')]=_0x11b9d9['value'];}}}catch(_0x41af02){utils['error'](util[_0xf6fe('0x9')](_0xf6fe('0x5e'),_0x11b9d9[_0xf6fe('0x5')]),_0x41af02);}};exports['newexten']=function(_0x3a6fbe){try{if(!_[_0xf6fe('0x1f')](channels[_0x3a6fbe[_0xf6fe('0x5')]])){utils['debug'](util[_0xf6fe('0x9')](_0xf6fe('0x5f'),_0x3a6fbe[_0xf6fe('0x5')]),_0x3a6fbe);utils['info'](util['format'](_0xf6fe('0x60'),_0x3a6fbe[_0xf6fe('0x5')],_0x3a6fbe[_0xf6fe('0x61')],_0x3a6fbe['appdata']));if(_0x3a6fbe['application'][_0xf6fe('0x62')]()==_0xf6fe('0x63')&&_[_0xf6fe('0x64')](_0x3a6fbe[_0xf6fe('0x65')][_0xf6fe('0x62')](),_0xf6fe('0x66'))){var _0x4046b9=_0x3a6fbe[_0xf6fe('0x65')][_0xf6fe('0x67')]('=');var _0x31aac0=_0x4046b9[0x0]['substring'](_0x4046b9[0x0][_0xf6fe('0x68')]('(')+0x1,_0x4046b9[0x0]['lastIndexOf'](')'));var _0x27d2d3=_0x4046b9[0x1];channels[_0x3a6fbe[_0xf6fe('0x5')]][_0x31aac0]=_0x27d2d3;}if(!_[_0xf6fe('0x69')]([_0xf6fe('0x28'),_0xf6fe('0x6a'),_0xf6fe('0x6b'),_0xf6fe('0x63'),_0xf6fe('0x6c')],_0x3a6fbe[_0xf6fe('0x61')][_0xf6fe('0x62')]())){channels[_0x3a6fbe['uniqueid']]['lastapplication']=_0x3a6fbe['application'];channels[_0x3a6fbe[_0xf6fe('0x5')]][_0xf6fe('0x52')]=_0x3a6fbe[_0xf6fe('0x65')];}}}catch(_0xfebecb){utils[_0xf6fe('0x1e')](util[_0xf6fe('0x9')](_0xf6fe('0x5f'),_0x3a6fbe[_0xf6fe('0x5')]),_0xfebecb);}};
\ No newline at end of file
index 7387065..3a89c40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x180e=['info','[core]\x20connected','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','connect'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x180e,0xa1));var _0xe180=function(_0x412dd8,_0x355780){_0x412dd8=_0x412dd8-0x0;var _0x47b96=_0x180e[_0x412dd8];return _0x47b96;};'use strict';var utils=require('./utils');exports[_0xe180('0x0')]=function(){utils[_0xe180('0x1')](_0xe180('0x2'));};exports['shutdown']=function(){utils['info'](_0xe180('0x3'));};exports[_0xe180('0x4')]=function(){utils[_0xe180('0x1')](_0xe180('0x5'));};exports[_0xe180('0x6')]=function(_0xca2e1c){utils[_0xe180('0x6')]('[core]\x20error',_0xca2e1c);};exports[_0xe180('0x7')]=function(){utils[_0xe180('0x1')](_0xe180('0x8'));};exports['managerevent']=function(_0x1c5368){};
\ No newline at end of file
+var _0x8548=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','managerevent','./utils','connect','info','[core]\x20connected','shutdown'];(function(_0x2d6d58,_0x1593a1){var _0x598b95=function(_0x86ea4c){while(--_0x86ea4c){_0x2d6d58['push'](_0x2d6d58['shift']());}};_0x598b95(++_0x1593a1);}(_0x8548,0x1e5));var _0x8854=function(_0xc4e3c0,_0x423646){_0xc4e3c0=_0xc4e3c0-0x0;var _0x5779c9=_0x8548[_0xc4e3c0];return _0x5779c9;};'use strict';var utils=require(_0x8854('0x0'));exports[_0x8854('0x1')]=function(){utils[_0x8854('0x2')](_0x8854('0x3'));};exports[_0x8854('0x4')]=function(){utils['info'](_0x8854('0x5'));};exports[_0x8854('0x6')]=function(){utils[_0x8854('0x2')](_0x8854('0x7'));};exports['error']=function(_0x4a087a){utils[_0x8854('0x8')]('[core]\x20error',_0x4a087a);};exports['close']=function(){utils[_0x8854('0x2')]('[core]\x20close');};exports[_0x8854('0x9')]=function(_0x3de28){};
\ No newline at end of file
index 02c5c1a..06e0513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e57=['[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','lastevent','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','diffTime','answertime','endtime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','error','varset','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','called'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x3e57,0xe8));var _0x73e5=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x3e57[_0x4ca333];return _0x13b2e1;};'use strict';var _=require(_0x73e5('0x0'));var util=require(_0x73e5('0x1'));var utils=require(_0x73e5('0x2'));var dials={};function writeDB(_0x3827bc){utils[_0x73e5('0x3')](util[_0x73e5('0x4')](_0x73e5('0x5'),_0x3827bc['uniqueid'],_0x3827bc[_0x73e5('0x6')],_0x3827bc['dialstring'],_0x3827bc[_0x73e5('0x7')],_0x3827bc['connectedlinenum'],_0x3827bc[_0x73e5('0x8')]));utils[_0x73e5('0x9')](_0x73e5('0xa'),_0x3827bc);delete dials[_0x3827bc[_0x73e5('0xb')]];}exports['newexten']=function(_0x53a389){try{utils[_0x73e5('0xc')](util[_0x73e5('0x4')](_0x73e5('0xd'),_0x53a389[_0x73e5('0xb')]),_0x53a389);utils[_0x73e5('0x3')](util[_0x73e5('0x4')](_0x73e5('0xe'),_0x53a389[_0x73e5('0xb')],_0x53a389[_0x73e5('0xf')],_0x53a389[_0x73e5('0x10')]));if(_0x53a389[_0x73e5('0xf')][_0x73e5('0x11')]()=='set'&&_[_0x73e5('0x12')](_0x53a389[_0x73e5('0x10')][_0x73e5('0x11')](),'cdr(routeid)')){var _0x1f3377=_0x53a389[_0x73e5('0x10')][_0x73e5('0x13')]('=');dials[_0x53a389[_0x73e5('0xb')]]={'routeId':_0x1f3377[0x1]};}}catch(_0x3fbfde){utils[_0x73e5('0x14')](util[_0x73e5('0x4')](_0x73e5('0xd'),_0x53a389['uniqueid']),_0x3fbfde);}};exports[_0x73e5('0x15')]=function(_0x415326){try{utils[_0x73e5('0xc')](util['format']('[%s][dials][varset]',_0x415326[_0x73e5('0xb')]),_0x415326);if(!_[_0x73e5('0x16')](_0x415326[_0x73e5('0x17')][_0x73e5('0x18')])){utils[_0x73e5('0x3')](util[_0x73e5('0x4')](_0x73e5('0x19'),_0x415326[_0x73e5('0xb')],_0x415326['value']));dials[_0x415326[_0x73e5('0xb')]]={'routeId':_0x415326[_0x73e5('0x1a')]};}}catch(_0x555b1d){utils[_0x73e5('0x14')](util[_0x73e5('0x4')]('[%s][dials][varset]',_0x415326[_0x73e5('0xb')]),_0x555b1d);}};exports[_0x73e5('0x1b')]=function(_0x307564){try{if(!_[_0x73e5('0x16')](dials[_0x307564[_0x73e5('0xb')]])){utils[_0x73e5('0xc')](util[_0x73e5('0x4')]('[%s][dials][dialbegin]',_0x307564[_0x73e5('0xb')]),_0x307564);dials[_0x307564['uniqueid']]=_[_0x73e5('0x1c')](dials[_0x307564[_0x73e5('0xb')]],_0x307564);dials[_0x307564[_0x73e5('0xb')]][_0x73e5('0x1d')]=utils[_0x73e5('0x1e')]();dials[_0x307564[_0x73e5('0xb')]]['lastevent']=_0x73e5('0x1f');utils[_0x73e5('0x3')](util[_0x73e5('0x4')](_0x73e5('0x20'),_0x307564['uniqueid'],dials[_0x307564[_0x73e5('0xb')]]['starttime']));}}catch(_0x34cd62){utils['error'](util[_0x73e5('0x4')](_0x73e5('0x21'),_0x307564['uniqueid']),_0x34cd62);}};exports[_0x73e5('0x22')]=function(_0x52b043){try{if(!_[_0x73e5('0x16')](dials[_0x52b043[_0x73e5('0xb')]])){utils[_0x73e5('0xc')](util[_0x73e5('0x4')](_0x73e5('0x23'),_0x52b043[_0x73e5('0xb')]),_0x52b043);dials[_0x52b043[_0x73e5('0xb')]][_0x73e5('0x8')]=_0x52b043[_0x73e5('0x8')];if(_0x52b043[_0x73e5('0x8')]=='ANSWER'){dials[_0x52b043[_0x73e5('0xb')]]=_['assign'](dials[_0x52b043[_0x73e5('0xb')]],_0x52b043);dials[_0x52b043[_0x73e5('0xb')]]['answertime']=utils[_0x73e5('0x1e')]();dials[_0x52b043['uniqueid']][_0x73e5('0x24')]='connect';utils[_0x73e5('0x3')](util[_0x73e5('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x52b043[_0x73e5('0xb')],_0x52b043[_0x73e5('0x8')],dials[_0x52b043[_0x73e5('0xb')]]['answertime']));}else{utils[_0x73e5('0x3')](util[_0x73e5('0x4')]('[%s][dials][dialend]\x20dialstatus:%s',_0x52b043['uniqueid'],_0x52b043['dialstatus']));}}}catch(_0x4f2044){utils[_0x73e5('0x14')](util[_0x73e5('0x4')](_0x73e5('0x23'),_0x52b043['uniqueid']),_0x4f2044);}};exports['hangup']=function(_0x7811a8){try{if(!_[_0x73e5('0x16')](dials[_0x7811a8[_0x73e5('0xb')]])){utils[_0x73e5('0xc')](util['format'](_0x73e5('0x25'),_0x7811a8[_0x73e5('0xb')]),_0x7811a8);utils['info'](util[_0x73e5('0x4')](_0x73e5('0x26'),_0x7811a8[_0x73e5('0xb')],_0x7811a8['calleridnum'],_0x7811a8[_0x73e5('0x27')],_0x7811a8[_0x73e5('0x28')]));dials[_0x7811a8[_0x73e5('0xb')]]=_[_0x73e5('0x1c')](dials[_0x7811a8[_0x73e5('0xb')]],{'endtime':utils[_0x73e5('0x1e')](),'lastevent':'complete'});dials[_0x7811a8[_0x73e5('0xb')]]['duration']=utils[_0x73e5('0x29')](dials[_0x7811a8[_0x73e5('0xb')]]['endtime'],dials[_0x7811a8[_0x73e5('0xb')]][_0x73e5('0x1d')]);dials[_0x7811a8[_0x73e5('0xb')]]['holdtime']=utils[_0x73e5('0x29')](dials[_0x7811a8['uniqueid']][_0x73e5('0x2a')]||dials[_0x7811a8[_0x73e5('0xb')]][_0x73e5('0x2b')],dials[_0x7811a8[_0x73e5('0xb')]][_0x73e5('0x1d')]);dials[_0x7811a8['uniqueid']]['billableseconds']=dials[_0x7811a8['uniqueid']]['answertime']?utils['diffTime'](dials[_0x7811a8['uniqueid']]['endtime'],dials[_0x7811a8[_0x73e5('0xb')]][_0x73e5('0x2a')]):0x0;writeDB(dials[_0x7811a8[_0x73e5('0xb')]]);}}catch(_0x1a9a51){utils['error'](util[_0x73e5('0x4')](_0x73e5('0x25'),_0x7811a8[_0x73e5('0xb')]),_0x1a9a51);}};
\ No newline at end of file
+var _0xa88d=['CreateVoiceDialReport','newexten','[%s][dials][newexten]','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','lastevent','called','starttime','dialend','debug','[%s][dials][dialend]','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','dialstatus','request'];(function(_0x39ef0e,_0x1dd6b9){var _0x1b96e6=function(_0x295028){while(--_0x295028){_0x39ef0e['push'](_0x39ef0e['shift']());}};_0x1b96e6(++_0x1dd6b9);}(_0xa88d,0xf4));var _0xda88=function(_0x8b42ef,_0x1100c2){_0x8b42ef=_0x8b42ef-0x0;var _0x5d9c02=_0xa88d[_0x8b42ef];return _0x5d9c02;};'use strict';var _=require(_0xda88('0x0'));var util=require(_0xda88('0x1'));var utils=require(_0xda88('0x2'));var dials={};function writeDB(_0xdf149f){utils[_0xda88('0x3')](util[_0xda88('0x4')](_0xda88('0x5'),_0xdf149f[_0xda88('0x6')],_0xdf149f['channel'],_0xdf149f[_0xda88('0x7')],_0xdf149f[_0xda88('0x8')],_0xdf149f['connectedlinenum'],_0xdf149f[_0xda88('0x9')]));utils[_0xda88('0xa')](_0xda88('0xb'),_0xdf149f);delete dials[_0xdf149f[_0xda88('0x6')]];}exports[_0xda88('0xc')]=function(_0x28f41f){try{utils['debug'](util[_0xda88('0x4')](_0xda88('0xd'),_0x28f41f['uniqueid']),_0x28f41f);utils[_0xda88('0x3')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x28f41f[_0xda88('0x6')],_0x28f41f[_0xda88('0xe')],_0x28f41f[_0xda88('0xf')]));if(_0x28f41f[_0xda88('0xe')][_0xda88('0x10')]()==_0xda88('0x11')&&_[_0xda88('0x12')](_0x28f41f['appdata']['toLowerCase'](),_0xda88('0x13'))){var _0x546ddb=_0x28f41f[_0xda88('0xf')][_0xda88('0x14')]('=');dials[_0x28f41f[_0xda88('0x6')]]={'routeId':_0x546ddb[0x1]};}}catch(_0xfbff7c){utils[_0xda88('0x15')](util[_0xda88('0x4')]('[%s][dials][newexten]',_0x28f41f[_0xda88('0x6')]),_0xfbff7c);}};exports[_0xda88('0x16')]=function(_0x1e7f86){try{utils['debug'](util[_0xda88('0x4')](_0xda88('0x17'),_0x1e7f86[_0xda88('0x6')]),_0x1e7f86);if(!_['isNil'](_0x1e7f86[_0xda88('0x18')][_0xda88('0x19')])){utils[_0xda88('0x3')](util[_0xda88('0x4')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x1e7f86['uniqueid'],_0x1e7f86['value']));dials[_0x1e7f86[_0xda88('0x6')]]={'routeId':_0x1e7f86[_0xda88('0x1a')]};}}catch(_0x411864){utils[_0xda88('0x15')](util[_0xda88('0x4')](_0xda88('0x17'),_0x1e7f86[_0xda88('0x6')]),_0x411864);}};exports[_0xda88('0x1b')]=function(_0x1fb650){try{if(!_[_0xda88('0x1c')](dials[_0x1fb650[_0xda88('0x6')]])){utils['debug'](util[_0xda88('0x4')](_0xda88('0x1d'),_0x1fb650[_0xda88('0x6')]),_0x1fb650);dials[_0x1fb650['uniqueid']]=_[_0xda88('0x1e')](dials[_0x1fb650[_0xda88('0x6')]],_0x1fb650);dials[_0x1fb650[_0xda88('0x6')]]['starttime']=utils['now']();dials[_0x1fb650['uniqueid']][_0xda88('0x1f')]=_0xda88('0x20');utils[_0xda88('0x3')](util[_0xda88('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1fb650[_0xda88('0x6')],dials[_0x1fb650[_0xda88('0x6')]][_0xda88('0x21')]));}}catch(_0x2a9241){utils[_0xda88('0x15')](util[_0xda88('0x4')]('[%s][dials][dialbegin]',_0x1fb650['uniqueid']),_0x2a9241);}};exports[_0xda88('0x22')]=function(_0x275dee){try{if(!_['isNil'](dials[_0x275dee[_0xda88('0x6')]])){utils[_0xda88('0x23')](util[_0xda88('0x4')](_0xda88('0x24'),_0x275dee[_0xda88('0x6')]),_0x275dee);dials[_0x275dee['uniqueid']][_0xda88('0x9')]=_0x275dee['dialstatus'];if(_0x275dee['dialstatus']=='ANSWER'){dials[_0x275dee['uniqueid']]=_[_0xda88('0x1e')](dials[_0x275dee[_0xda88('0x6')]],_0x275dee);dials[_0x275dee[_0xda88('0x6')]][_0xda88('0x25')]=utils[_0xda88('0x26')]();dials[_0x275dee['uniqueid']][_0xda88('0x1f')]='connect';utils['info'](util[_0xda88('0x4')](_0xda88('0x27'),_0x275dee[_0xda88('0x6')],_0x275dee[_0xda88('0x9')],dials[_0x275dee['uniqueid']][_0xda88('0x25')]));}else{utils[_0xda88('0x3')](util[_0xda88('0x4')](_0xda88('0x28'),_0x275dee[_0xda88('0x6')],_0x275dee[_0xda88('0x9')]));}}}catch(_0x58ff93){utils[_0xda88('0x15')](util[_0xda88('0x4')](_0xda88('0x24'),_0x275dee[_0xda88('0x6')]),_0x58ff93);}};exports[_0xda88('0x29')]=function(_0x37963c){try{if(!_[_0xda88('0x1c')](dials[_0x37963c['uniqueid']])){utils[_0xda88('0x23')](util[_0xda88('0x4')](_0xda88('0x2a'),_0x37963c[_0xda88('0x6')]),_0x37963c);utils['info'](util[_0xda88('0x4')](_0xda88('0x2b'),_0x37963c[_0xda88('0x6')],_0x37963c[_0xda88('0x8')],_0x37963c[_0xda88('0x2c')],_0x37963c[_0xda88('0x2d')]));dials[_0x37963c[_0xda88('0x6')]]=_['assign'](dials[_0x37963c[_0xda88('0x6')]],{'endtime':utils[_0xda88('0x26')](),'lastevent':_0xda88('0x2e')});dials[_0x37963c['uniqueid']]['duration']=utils[_0xda88('0x2f')](dials[_0x37963c[_0xda88('0x6')]][_0xda88('0x30')],dials[_0x37963c[_0xda88('0x6')]][_0xda88('0x21')]);dials[_0x37963c['uniqueid']][_0xda88('0x31')]=utils[_0xda88('0x2f')](dials[_0x37963c[_0xda88('0x6')]]['answertime']||dials[_0x37963c[_0xda88('0x6')]][_0xda88('0x30')],dials[_0x37963c[_0xda88('0x6')]]['starttime']);dials[_0x37963c[_0xda88('0x6')]][_0xda88('0x32')]=dials[_0x37963c[_0xda88('0x6')]][_0xda88('0x25')]?utils[_0xda88('0x2f')](dials[_0x37963c[_0xda88('0x6')]][_0xda88('0x30')],dials[_0x37963c['uniqueid']][_0xda88('0x25')]):0x0;writeDB(dials[_0x37963c['uniqueid']]);}}catch(_0x236d1c){utils['error'](util[_0xda88('0x4')](_0xda88('0x2a'),_0x37963c[_0xda88('0x6')]),_0x236d1c);}};
\ No newline at end of file
index db5dc6c..8b4087a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a6f=['format','[%s][index][devicestatechange]','device','debug','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','asterisk','username','xdr','disabled','info','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange'];(function(_0x4b79ad,_0x16d966){var _0x41a02c=function(_0x48d4c0){while(--_0x48d4c0){_0x4b79ad['push'](_0x4b79ad['shift']());}};_0x41a02c(++_0x16d966);}(_0x2a6f,0xdf));var _0xf2a6=function(_0x3cb142,_0x197877){_0x3cb142=_0x3cb142-0x0;var _0x42309e=_0x2a6f[_0x3cb142];return _0x42309e;};var AsteriskManager=require('asterisk-manager');var config=require(_0xf2a6('0x0'));var utils=require(_0xf2a6('0x1'));var util=require(_0xf2a6('0x2'));var ami=new AsteriskManager(config[_0xf2a6('0x3')]['port'],config[_0xf2a6('0x3')]['ip'],config[_0xf2a6('0x3')][_0xf2a6('0x4')],config[_0xf2a6('0x3')]['password'],!![]);ami['keepConnected']();if(config[_0xf2a6('0x5')]&&config[_0xf2a6('0x5')][_0xf2a6('0x6')]){utils[_0xf2a6('0x7')]('XDR\x20DISABLED');}else{var agents=require(_0xf2a6('0x8'));var calls=require(_0xf2a6('0x9'));var queues=require('./queues.controller');var recordings=require(_0xf2a6('0xa'));var members=require(_0xf2a6('0xb'));var dials=require(_0xf2a6('0xc'));var transfers=require('./transfers.controller');var core=require(_0xf2a6('0xd'));ami['on'](_0xf2a6('0xe'),core[_0xf2a6('0xe')]);ami['on'](_0xf2a6('0xf'),core[_0xf2a6('0xf')]);ami['on'](_0xf2a6('0x10'),core['fullybooted']);ami['on'](_0xf2a6('0x11'),core[_0xf2a6('0x11')]);ami['on'](_0xf2a6('0x12'),core[_0xf2a6('0x12')]);ami['on'](_0xf2a6('0x13'),core[_0xf2a6('0x13')]);ami['on'](_0xf2a6('0x14'),function(_0x291df1){try{utils['debug'](util[_0xf2a6('0x15')]('[%s][index][devicestatechange]',_0x291df1['device']),_0x291df1);members[_0xf2a6('0x14')](_0x291df1);}catch(_0x4bf19b){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x16'),_0x291df1[_0xf2a6('0x17')]),_0x4bf19b);}});ami['on']('agentcalled',function(_0x3861f5){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')]('[%s][index][agentcalled]',_0x3861f5[_0xf2a6('0x19')]),_0x3861f5);agents['agentcalled'](_0x3861f5);}catch(_0x4357a9){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')]('[%s][index][agentcalled]',_0x3861f5[_0xf2a6('0x19')]),_0x4357a9);}});ami['on'](_0xf2a6('0x1a'),function(_0x329992){try{utils[_0xf2a6('0x18')](util['format'](_0xf2a6('0x1b'),_0x329992[_0xf2a6('0x19')]),_0x329992);agents[_0xf2a6('0x1a')](_0x329992);}catch(_0x24ea08){utils['error'](util[_0xf2a6('0x15')](_0xf2a6('0x1b'),_0x329992[_0xf2a6('0x19')]),_0x24ea08);}});ami['on']('agentconnect',function(_0x422494){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')]('[%s][index][agentconnect]',_0x422494[_0xf2a6('0x19')]),_0x422494);agents['agentconnect'](_0x422494);queues['agentconnect'](_0x422494);}catch(_0x4ab579){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x1c'),_0x422494[_0xf2a6('0x19')]),_0x4ab579);}});ami['on']('agentcomplete',function(_0x3546f0){try{utils[_0xf2a6('0x18')](util['format'](_0xf2a6('0x1d'),_0x3546f0[_0xf2a6('0x19')]),_0x3546f0);agents[_0xf2a6('0x1e')](_0x3546f0);queues[_0xf2a6('0x1e')](_0x3546f0);members['agentcomplete'](_0x3546f0);}catch(_0x8d8742){utils['error'](util['format'](_0xf2a6('0x1d'),_0x3546f0['uniqueid']),_0x8d8742);}});ami['on'](_0xf2a6('0x1f'),function(_0x2ee574){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x20'),_0x2ee574['uniqueid']),_0x2ee574);agents[_0xf2a6('0x1f')](_0x2ee574);queues['queuecallerabandon'](_0x2ee574);}catch(_0x33f952){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')]('[%s][index][queuecallerabandon]',_0x2ee574[_0xf2a6('0x19')]),_0x33f952);}});ami['on'](_0xf2a6('0x21'),function(_0x49cb87){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x22'),_0x49cb87[_0xf2a6('0x19')]),_0x49cb87);queues[_0xf2a6('0x21')](_0x49cb87);recordings[_0xf2a6('0x21')](_0x49cb87);}catch(_0x41d672){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x22'),_0x49cb87[_0xf2a6('0x19')]),_0x41d672);}});ami['on'](_0xf2a6('0x23'),function(_0x1b9ecf){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x24'),_0x1b9ecf[_0xf2a6('0x19')]),_0x1b9ecf);queues[_0xf2a6('0x23')](_0x1b9ecf);}catch(_0x19b71c){utils['error'](util[_0xf2a6('0x15')]('[%s][index][queuecallerleave]',_0x1b9ecf['uniqueid']),_0x19b71c);}});ami['on']('musiconholdstart',function(_0x225fdd){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x25'),_0x225fdd['uniqueid']),_0x225fdd);queues[_0xf2a6('0x26')](_0x225fdd);calls[_0xf2a6('0x26')](_0x225fdd);}catch(_0x40c1ac){utils[_0xf2a6('0x11')](util['format'](_0xf2a6('0x25'),_0x225fdd['uniqueid']),_0x40c1ac);}});ami['on'](_0xf2a6('0x27'),function(_0x9941db){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')]('[%s][index][musiconholdstop]',_0x9941db[_0xf2a6('0x19')]),_0x9941db);queues['musiconholdstop'](_0x9941db);calls[_0xf2a6('0x27')](_0x9941db);}catch(_0x3e9a72){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x28'),_0x9941db[_0xf2a6('0x19')]),_0x3e9a72);}});ami['on'](_0xf2a6('0x29'),function(_0x23c47d){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x2a'),_0x23c47d['uniqueid']),_0x23c47d);calls[_0xf2a6('0x29')](_0x23c47d);recordings[_0xf2a6('0x29')](_0x23c47d);}catch(_0x2d643a){utils['error'](util[_0xf2a6('0x15')](_0xf2a6('0x2a'),_0x23c47d[_0xf2a6('0x19')]),_0x2d643a);}});ami['on'](_0xf2a6('0x2b'),function(_0x332560){try{utils['debug'](util[_0xf2a6('0x15')](_0xf2a6('0x2c'),_0x332560[_0xf2a6('0x19')]),_0x332560);calls[_0xf2a6('0x2b')](_0x332560);recordings[_0xf2a6('0x2b')](_0x332560);dials[_0xf2a6('0x2b')](_0x332560);agents['hangup'](_0x332560);queues['hangup'](_0x332560);}catch(_0x2fbb18){utils[_0xf2a6('0x11')](util['format'](_0xf2a6('0x2c'),_0x332560[_0xf2a6('0x19')]),_0x2fbb18);}});ami['on'](_0xf2a6('0x2d'),function(_0x575550){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')]('[%s][index][cdr]',_0x575550[_0xf2a6('0x19')]),_0x575550);members[_0xf2a6('0x2d')](_0x575550);}catch(_0xc1d5e8){utils['error'](util[_0xf2a6('0x15')]('[%s][index][cdr]',_0x575550[_0xf2a6('0x19')]),_0xc1d5e8);}});ami['on'](_0xf2a6('0x2e'),function(_0x57efad){try{utils[_0xf2a6('0x18')](util['format'](_0xf2a6('0x2f'),_0x57efad['uniqueid']),_0x57efad);queues[_0xf2a6('0x2e')](_0x57efad);agents[_0xf2a6('0x2e')](_0x57efad);transfers[_0xf2a6('0x2e')](_0x57efad);}catch(_0x5b7d31){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x2f'),_0x57efad[_0xf2a6('0x19')]),_0x5b7d31);}});ami['on']('attendedtransfer',function(_0x20bf07){try{utils[_0xf2a6('0x18')](util['format'](_0xf2a6('0x30'),_0x20bf07[_0xf2a6('0x31')]),_0x20bf07);queues[_0xf2a6('0x32')](_0x20bf07);transfers[_0xf2a6('0x32')](_0x20bf07);agents[_0xf2a6('0x32')](_0x20bf07);calls['attendedtransfer'](_0x20bf07);}catch(_0x3d94d6){utils[_0xf2a6('0x11')](util['format'](_0xf2a6('0x30'),_0x20bf07['origtransfereruniqueid']),_0x3d94d6);}});ami['on'](_0xf2a6('0x33'),function(_0x1b2ea6){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x34'),_0x1b2ea6[_0xf2a6('0x19')]),_0x1b2ea6);queues[_0xf2a6('0x33')](_0x1b2ea6);recordings['varset'](_0x1b2ea6);calls['varset'](_0x1b2ea6);dials[_0xf2a6('0x33')](_0x1b2ea6);}catch(_0x241b37){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x34'),_0x1b2ea6['uniqueid']),_0x241b37);}});ami['on'](_0xf2a6('0x35'),function(_0x2469a4){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')]('[%s][index][newexten]',_0x2469a4[_0xf2a6('0x19')]),_0x2469a4);calls[_0xf2a6('0x35')](_0x2469a4);recordings[_0xf2a6('0x35')](_0x2469a4);dials[_0xf2a6('0x35')](_0x2469a4);}catch(_0x20ee24){utils['error'](util[_0xf2a6('0x15')](_0xf2a6('0x36'),_0x2469a4[_0xf2a6('0x19')]),_0x20ee24);}});ami['on'](_0xf2a6('0x37'),function(_0x16808b){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x38'),_0x16808b[_0xf2a6('0x19')]),_0x16808b);calls[_0xf2a6('0x37')](_0x16808b);recordings[_0xf2a6('0x37')](_0x16808b);}catch(_0x342deb){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')](_0xf2a6('0x38'),_0x16808b[_0xf2a6('0x19')]),_0x342deb);}});ami['on'](_0xf2a6('0x39'),function(_0x562286){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')]('[%s][index][dialbegin]',_0x562286[_0xf2a6('0x19')]),_0x562286);dials[_0xf2a6('0x39')](_0x562286);}catch(_0x486627){utils[_0xf2a6('0x11')](util['format'](_0xf2a6('0x3a'),_0x562286[_0xf2a6('0x19')]),_0x486627);}});ami['on'](_0xf2a6('0x3b'),function(_0x1d571e){try{utils[_0xf2a6('0x18')](util[_0xf2a6('0x15')](_0xf2a6('0x3c'),_0x1d571e[_0xf2a6('0x19')]),_0x1d571e);dials[_0xf2a6('0x3b')](_0x1d571e);}catch(_0x4490c0){utils[_0xf2a6('0x11')](util[_0xf2a6('0x15')]('[%s][index][dialend]',_0x1d571e['uniqueid']),_0x4490c0);}});}
\ No newline at end of file
+var _0x7efa=['hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','asterisk','port','username','xdr','disabled','XDR\x20DISABLED','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','[%s][index][devicestatechange]','device','devicestatechange','format','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]'];(function(_0x455e47,_0x439568){var _0x39001f=function(_0x5ddf79){while(--_0x5ddf79){_0x455e47['push'](_0x455e47['shift']());}};_0x39001f(++_0x439568);}(_0x7efa,0x95));var _0xa7ef=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x7efa[_0x326e79];return _0x37eb89;};var AsteriskManager=require(_0xa7ef('0x0'));var config=require(_0xa7ef('0x1'));var utils=require(_0xa7ef('0x2'));var util=require('util');var ami=new AsteriskManager(config[_0xa7ef('0x3')][_0xa7ef('0x4')],config['asterisk']['ip'],config[_0xa7ef('0x3')][_0xa7ef('0x5')],config[_0xa7ef('0x3')]['password'],!![]);ami['keepConnected']();if(config[_0xa7ef('0x6')]&&config[_0xa7ef('0x6')][_0xa7ef('0x7')]){utils['info'](_0xa7ef('0x8'));}else{var agents=require('./agents.controller');var calls=require(_0xa7ef('0x9'));var queues=require(_0xa7ef('0xa'));var recordings=require('./recordings.controller');var members=require(_0xa7ef('0xb'));var dials=require(_0xa7ef('0xc'));var transfers=require(_0xa7ef('0xd'));var core=require('./core.controller');ami['on'](_0xa7ef('0xe'),core[_0xa7ef('0xe')]);ami['on'](_0xa7ef('0xf'),core[_0xa7ef('0xf')]);ami['on'](_0xa7ef('0x10'),core['fullybooted']);ami['on'](_0xa7ef('0x11'),core[_0xa7ef('0x11')]);ami['on'](_0xa7ef('0x12'),core[_0xa7ef('0x12')]);ami['on'](_0xa7ef('0x13'),core[_0xa7ef('0x13')]);ami['on']('devicestatechange',function(_0x46cc4b){try{utils['debug'](util['format'](_0xa7ef('0x14'),_0x46cc4b[_0xa7ef('0x15')]),_0x46cc4b);members[_0xa7ef('0x16')](_0x46cc4b);}catch(_0x23c7b3){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x14'),_0x46cc4b[_0xa7ef('0x15')]),_0x23c7b3);}});ami['on'](_0xa7ef('0x18'),function(_0x58e414){try{utils[_0xa7ef('0x19')](util[_0xa7ef('0x17')](_0xa7ef('0x1a'),_0x58e414[_0xa7ef('0x1b')]),_0x58e414);agents[_0xa7ef('0x18')](_0x58e414);}catch(_0x47a0a1){utils[_0xa7ef('0x11')](util['format'](_0xa7ef('0x1a'),_0x58e414[_0xa7ef('0x1b')]),_0x47a0a1);}});ami['on'](_0xa7ef('0x1c'),function(_0x2e8cf2){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x1d'),_0x2e8cf2['uniqueid']),_0x2e8cf2);agents[_0xa7ef('0x1c')](_0x2e8cf2);}catch(_0x74161a){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')]('[%s][index][agentringnoanswer]',_0x2e8cf2[_0xa7ef('0x1b')]),_0x74161a);}});ami['on']('agentconnect',function(_0x57de04){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x1e'),_0x57de04[_0xa7ef('0x1b')]),_0x57de04);agents[_0xa7ef('0x1f')](_0x57de04);queues[_0xa7ef('0x1f')](_0x57de04);}catch(_0x578cc4){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x1e'),_0x57de04[_0xa7ef('0x1b')]),_0x578cc4);}});ami['on'](_0xa7ef('0x20'),function(_0x2f4153){try{utils[_0xa7ef('0x19')](util[_0xa7ef('0x17')](_0xa7ef('0x21'),_0x2f4153[_0xa7ef('0x1b')]),_0x2f4153);agents[_0xa7ef('0x20')](_0x2f4153);queues[_0xa7ef('0x20')](_0x2f4153);members['agentcomplete'](_0x2f4153);}catch(_0x47a8ee){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x21'),_0x2f4153['uniqueid']),_0x47a8ee);}});ami['on'](_0xa7ef('0x22'),function(_0x20e196){try{utils[_0xa7ef('0x19')](util[_0xa7ef('0x17')](_0xa7ef('0x23'),_0x20e196[_0xa7ef('0x1b')]),_0x20e196);agents['queuecallerabandon'](_0x20e196);queues[_0xa7ef('0x22')](_0x20e196);}catch(_0x4b2b7b){utils['error'](util['format'](_0xa7ef('0x23'),_0x20e196[_0xa7ef('0x1b')]),_0x4b2b7b);}});ami['on']('queuecallerjoin',function(_0x5b926a){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x24'),_0x5b926a[_0xa7ef('0x1b')]),_0x5b926a);queues[_0xa7ef('0x25')](_0x5b926a);recordings[_0xa7ef('0x25')](_0x5b926a);}catch(_0x41c4b6){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x24'),_0x5b926a[_0xa7ef('0x1b')]),_0x41c4b6);}});ami['on'](_0xa7ef('0x26'),function(_0x3a2572){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x27'),_0x3a2572[_0xa7ef('0x1b')]),_0x3a2572);queues['queuecallerleave'](_0x3a2572);}catch(_0x249dd8){utils['error'](util[_0xa7ef('0x17')](_0xa7ef('0x27'),_0x3a2572[_0xa7ef('0x1b')]),_0x249dd8);}});ami['on'](_0xa7ef('0x28'),function(_0x3e6f0b){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x29'),_0x3e6f0b[_0xa7ef('0x1b')]),_0x3e6f0b);queues[_0xa7ef('0x28')](_0x3e6f0b);calls[_0xa7ef('0x28')](_0x3e6f0b);}catch(_0x5d21b7){utils['error'](util[_0xa7ef('0x17')](_0xa7ef('0x29'),_0x3e6f0b[_0xa7ef('0x1b')]),_0x5d21b7);}});ami['on']('musiconholdstop',function(_0x2c6787){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x2a'),_0x2c6787['uniqueid']),_0x2c6787);queues[_0xa7ef('0x2b')](_0x2c6787);calls['musiconholdstop'](_0x2c6787);}catch(_0x30cc19){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x2a'),_0x2c6787['uniqueid']),_0x30cc19);}});ami['on'](_0xa7ef('0x2c'),function(_0x168aac){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x2d'),_0x168aac[_0xa7ef('0x1b')]),_0x168aac);calls['newstate'](_0x168aac);recordings[_0xa7ef('0x2c')](_0x168aac);}catch(_0x4c0697){utils[_0xa7ef('0x11')](util['format']('[%s][index][newstate]',_0x168aac[_0xa7ef('0x1b')]),_0x4c0697);}});ami['on'](_0xa7ef('0x2e'),function(_0x43f6fd){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x2f'),_0x43f6fd[_0xa7ef('0x1b')]),_0x43f6fd);calls[_0xa7ef('0x2e')](_0x43f6fd);recordings[_0xa7ef('0x2e')](_0x43f6fd);dials[_0xa7ef('0x2e')](_0x43f6fd);agents[_0xa7ef('0x2e')](_0x43f6fd);queues[_0xa7ef('0x2e')](_0x43f6fd);}catch(_0xbe679e){utils['error'](util[_0xa7ef('0x17')](_0xa7ef('0x2f'),_0x43f6fd[_0xa7ef('0x1b')]),_0xbe679e);}});ami['on'](_0xa7ef('0x30'),function(_0x5097be){try{utils[_0xa7ef('0x19')](util[_0xa7ef('0x17')]('[%s][index][cdr]',_0x5097be['uniqueid']),_0x5097be);members[_0xa7ef('0x30')](_0x5097be);}catch(_0x5ed831){utils['error'](util[_0xa7ef('0x17')](_0xa7ef('0x31'),_0x5097be[_0xa7ef('0x1b')]),_0x5ed831);}});ami['on'](_0xa7ef('0x32'),function(_0x129086){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x33'),_0x129086['uniqueid']),_0x129086);queues['blindtransfer'](_0x129086);agents[_0xa7ef('0x32')](_0x129086);transfers[_0xa7ef('0x32')](_0x129086);}catch(_0x39b8e4){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')]('[%s][index][blindtransfer]',_0x129086[_0xa7ef('0x1b')]),_0x39b8e4);}});ami['on'](_0xa7ef('0x34'),function(_0xd8065f){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x35'),_0xd8065f[_0xa7ef('0x36')]),_0xd8065f);queues[_0xa7ef('0x34')](_0xd8065f);transfers[_0xa7ef('0x34')](_0xd8065f);agents[_0xa7ef('0x34')](_0xd8065f);calls[_0xa7ef('0x34')](_0xd8065f);}catch(_0x51fef5){utils['error'](util[_0xa7ef('0x17')]('[%s][index][attendedtransfer]',_0xd8065f[_0xa7ef('0x36')]),_0x51fef5);}});ami['on'](_0xa7ef('0x37'),function(_0x425113){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x38'),_0x425113[_0xa7ef('0x1b')]),_0x425113);queues[_0xa7ef('0x37')](_0x425113);recordings[_0xa7ef('0x37')](_0x425113);calls[_0xa7ef('0x37')](_0x425113);dials[_0xa7ef('0x37')](_0x425113);}catch(_0x2b9b77){utils[_0xa7ef('0x11')](util['format'](_0xa7ef('0x38'),_0x425113[_0xa7ef('0x1b')]),_0x2b9b77);}});ami['on'](_0xa7ef('0x39'),function(_0x53f624){try{utils[_0xa7ef('0x19')](util['format']('[%s][index][newexten]',_0x53f624[_0xa7ef('0x1b')]),_0x53f624);calls[_0xa7ef('0x39')](_0x53f624);recordings[_0xa7ef('0x39')](_0x53f624);dials[_0xa7ef('0x39')](_0x53f624);}catch(_0x1d0445){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x3a'),_0x53f624[_0xa7ef('0x1b')]),_0x1d0445);}});ami['on'](_0xa7ef('0x3b'),function(_0x46c000){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x3c'),_0x46c000[_0xa7ef('0x1b')]),_0x46c000);calls[_0xa7ef('0x3b')](_0x46c000);recordings[_0xa7ef('0x3b')](_0x46c000);}catch(_0x2b8aea){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')]('[%s][index][newchannel]',_0x46c000[_0xa7ef('0x1b')]),_0x2b8aea);}});ami['on']('dialbegin',function(_0x50937e){try{utils[_0xa7ef('0x19')](util['format'](_0xa7ef('0x3d'),_0x50937e[_0xa7ef('0x1b')]),_0x50937e);dials[_0xa7ef('0x3e')](_0x50937e);}catch(_0x8cc18b){utils[_0xa7ef('0x11')](util['format']('[%s]dialbegin',_0x50937e['uniqueid']),_0x8cc18b);}});ami['on'](_0xa7ef('0x3f'),function(_0x5d437c){try{utils['debug'](util[_0xa7ef('0x17')](_0xa7ef('0x40'),_0x5d437c['uniqueid']),_0x5d437c);dials['dialend'](_0x5d437c);}catch(_0x2f56da){utils[_0xa7ef('0x11')](util[_0xa7ef('0x17')](_0xa7ef('0x40'),_0x5d437c[_0xa7ef('0x1b')]),_0x2f56da);}});}
\ No newline at end of file
index d055920..1a26d42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d95=['destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','Local/_attended@transfer','Queue:','info','format','channel','data2','interface','getUserByInterface','then','membername','internal','request','CreateMemberReport','getUserByName','split','catch','error','uniqueid','some','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','data1','type','source','destination','data3'];(function(_0x41b369,_0x29e21f){var _0x2af633=function(_0x588c87){while(--_0x588c87){_0x41b369['push'](_0x41b369['shift']());}};_0x2af633(++_0x29e21f);}(_0x5d95,0x161));var _0x55d9=function(_0x478b23,_0x4ee793){_0x478b23=_0x478b23-0x0;var _0x758196=_0x5d95[_0x478b23];return _0x758196;};'use strict';var _=require(_0x55d9('0x0'));var util=require(_0x55d9('0x1'));var utils=require('./utils');var members={};var exclude=[_0x55d9('0x2'),_0x55d9('0x3')];function writeDB(_0x29e725){utils[_0x55d9('0x4')](util[_0x55d9('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x29e725['uniqueid'],_0x29e725['interface'],_0x29e725[_0x55d9('0x6')],_0x29e725[_0x55d9('0x7')],_0x29e725['membername'],_0x29e725['type']));if(_0x29e725[_0x55d9('0x8')]){utils[_0x55d9('0x9')](_0x29e725['interface'])[_0x55d9('0xa')](function(_0x99d169){if(_0x99d169){_0x29e725[_0x55d9('0xb')]=_0x99d169['name'];_0x29e725[_0x55d9('0xc')]=_0x99d169[_0x55d9('0xc')];utils[_0x55d9('0xd')](_0x55d9('0xe'),_0x29e725);}else{utils[_0x55d9('0xf')](_0x29e725[_0x55d9('0x8')][_0x55d9('0x10')]('/')[0x1])[_0x55d9('0xa')](function(_0x7acd71){if(_0x7acd71){_0x29e725[_0x55d9('0xb')]=_0x7acd71['name'];_0x29e725[_0x55d9('0xc')]=_0x7acd71['internal'];utils[_0x55d9('0xd')](_0x55d9('0xe'),_0x29e725);}});}})[_0x55d9('0x11')](function(_0x11ad00){utils[_0x55d9('0x12')](util['format']('[%s][members][writeDB]',_0x29e725[_0x55d9('0x13')]),_0x11ad00);});}delete members[_0x29e725[_0x55d9('0x8')]];}function startsWith(_0xebfecb,_0x3fdd4b){return _[_0x55d9('0x14')](_0xebfecb,function(_0x46ae90){return _['startsWith'](_0x3fdd4b,_0x46ae90);});}exports['devicestatechange']=function(_0x373947){try{utils[_0x55d9('0x15')](util['format'](_0x55d9('0x16'),members[_0x373947[_0x55d9('0x17')]]?members[_0x373947[_0x55d9('0x17')]][_0x55d9('0x13')]:_0x373947[_0x55d9('0x17')]),_0x373947);utils[_0x55d9('0x4')](util['format'](_0x55d9('0x18'),members[_0x373947['device']]?members[_0x373947[_0x55d9('0x17')]]['uniqueid']:_0x373947['device'],_0x373947[_0x55d9('0x19')],_0x373947[_0x55d9('0x17')]));switch(_0x373947[_0x55d9('0x19')]){case _0x55d9('0x1a'):case _0x55d9('0x1b'):if(!startsWith(exclude,_0x373947['device'])){members[_0x373947['device']]={'channel':_0x55d9('0x1c'),'interface':_0x373947[_0x55d9('0x17')],'type':_0x55d9('0x1d'),'enterAt':utils[_0x55d9('0x1e')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x55d9('0x1f')](members[_0x373947[_0x55d9('0x17')]])){members[_0x373947['device']][_0x55d9('0x20')]=utils[_0x55d9('0x1e')]();members[_0x373947['device']][_0x55d9('0x21')]=utils[_0x55d9('0x22')](members[_0x373947[_0x55d9('0x17')]][_0x55d9('0x20')],members[_0x373947[_0x55d9('0x17')]][_0x55d9('0x23')]);if(members[_0x373947[_0x55d9('0x17')]]['uniqueid']){writeDB(members[_0x373947[_0x55d9('0x17')]]);}}break;default:break;}}catch(_0xe1394){utils[_0x55d9('0x12')](util[_0x55d9('0x5')]('[%s][members][devicestatechange]',members[_0x373947[_0x55d9('0x17')]]?members[_0x373947[_0x55d9('0x17')]][_0x55d9('0x13')]:_0x373947[_0x55d9('0x17')]),_0xe1394);}};exports[_0x55d9('0x24')]=function(_0x29008b){try{if(!_[_0x55d9('0x1f')](members[_0x29008b['interface']])){utils[_0x55d9('0x15')](util[_0x55d9('0x5')](_0x55d9('0x25'),_0x29008b[_0x55d9('0x13')]),_0x29008b);utils[_0x55d9('0x4')](util[_0x55d9('0x5')](_0x55d9('0x26'),_0x29008b['uniqueid'],_0x29008b[_0x55d9('0x8')],_0x29008b[_0x55d9('0x27')]));members[_0x29008b[_0x55d9('0x8')]]=_[_0x55d9('0x28')](members[_0x29008b[_0x55d9('0x8')]],{'data4':_0x29008b[_0x55d9('0x27')],'uniqueid':_0x29008b[_0x55d9('0x13')]});}}catch(_0x1f1c88){utils[_0x55d9('0x12')](util[_0x55d9('0x5')](_0x55d9('0x25'),_0x29008b['uniqueid']),_0x1f1c88);}};exports[_0x55d9('0x29')]=function(_0x2bbe84){try{utils[_0x55d9('0x15')](util[_0x55d9('0x5')]('[%s][members][cdr]',_0x2bbe84[_0x55d9('0x13')]),_0x2bbe84);if(_0x2bbe84[_0x55d9('0x6')]){var _0x552e8a=_0x2bbe84[_0x55d9('0x6')][_0x55d9('0x10')]('-')[0x0];if(!_[_0x55d9('0x1f')](members[_0x552e8a])){members[_0x552e8a]=_['assign'](members[_0x552e8a],{'data1':members[_0x552e8a][_0x55d9('0x2a')]||_0x2bbe84[_0x55d9('0x2b')],'data2':members[_0x552e8a][_0x55d9('0x7')]||_0x2bbe84[_0x55d9('0x2c')],'data3':members[_0x552e8a]['data3']||_0x2bbe84[_0x55d9('0x2d')],'uniqueid':members[_0x552e8a]['uniqueid']||_0x2bbe84['uniqueid']});utils[_0x55d9('0x4')](util[_0x55d9('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x2bbe84[_0x55d9('0x13')],members[_0x552e8a][_0x55d9('0x2a')],members[_0x552e8a]['data2'],members[_0x552e8a][_0x55d9('0x2e')]));if(members[_0x552e8a][_0x55d9('0x20')]){writeDB(members[_0x552e8a]);}}}if(_0x2bbe84[_0x55d9('0x2f')]){var _0x395865=_0x2bbe84[_0x55d9('0x2f')]['split']('-')[0x0];if(!_[_0x55d9('0x1f')](members[_0x395865])){members[_0x395865]=_['assign'](members[_0x395865],{'data1':members[_0x395865][_0x55d9('0x2a')]||_0x2bbe84[_0x55d9('0x2b')],'data2':members[_0x395865][_0x55d9('0x7')]||_0x2bbe84[_0x55d9('0x2c')],'data3':members[_0x395865][_0x55d9('0x2e')]||_0x2bbe84[_0x55d9('0x2d')],'uniqueid':members[_0x395865][_0x55d9('0x13')]||_0x2bbe84[_0x55d9('0x13')]});utils[_0x55d9('0x4')](util[_0x55d9('0x5')](_0x55d9('0x30'),_0x2bbe84['uniqueid'],members[_0x395865][_0x55d9('0x2a')],members[_0x395865]['data2'],members[_0x395865][_0x55d9('0x2e')]));if(members[_0x395865][_0x55d9('0x20')]){writeDB(members[_0x395865]);}}}}catch(_0x3b1fe3){utils[_0x55d9('0x12')](util['format'](_0x55d9('0x31'),_0x2bbe84[_0x55d9('0x13')]),_0x3b1fe3);}};
\ No newline at end of file
+var _0x0f1e=['info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','type','getUserByInterface','membername','name','internal','request','CreateMemberReport','getUserByName','catch','error','format','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','split','./utils','Queue:'];(function(_0x1b74f0,_0x5a7991){var _0x24f81c=function(_0xd5f0dc){while(--_0xd5f0dc){_0x1b74f0['push'](_0x1b74f0['shift']());}};_0x24f81c(++_0x5a7991);}(_0x0f1e,0x18e));var _0xe0f1=function(_0x29a709,_0x56e5cd){_0x29a709=_0x29a709-0x0;var _0x35d73e=_0x0f1e[_0x29a709];return _0x35d73e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xe0f1('0x0'));var members={};var exclude=['Local/_attended@transfer',_0xe0f1('0x1')];function writeDB(_0x2a0b5f){utils[_0xe0f1('0x2')](util['format'](_0xe0f1('0x3'),_0x2a0b5f[_0xe0f1('0x4')],_0x2a0b5f[_0xe0f1('0x5')],_0x2a0b5f[_0xe0f1('0x6')],_0x2a0b5f['data2'],_0x2a0b5f['membername'],_0x2a0b5f[_0xe0f1('0x7')]));if(_0x2a0b5f['interface']){utils[_0xe0f1('0x8')](_0x2a0b5f[_0xe0f1('0x5')])['then'](function(_0x337edb){if(_0x337edb){_0x2a0b5f[_0xe0f1('0x9')]=_0x337edb[_0xe0f1('0xa')];_0x2a0b5f[_0xe0f1('0xb')]=_0x337edb[_0xe0f1('0xb')];utils[_0xe0f1('0xc')](_0xe0f1('0xd'),_0x2a0b5f);}else{utils[_0xe0f1('0xe')](_0x2a0b5f[_0xe0f1('0x5')]['split']('/')[0x1])['then'](function(_0x50836d){if(_0x50836d){_0x2a0b5f['membername']=_0x50836d[_0xe0f1('0xa')];_0x2a0b5f[_0xe0f1('0xb')]=_0x50836d[_0xe0f1('0xb')];utils['request'](_0xe0f1('0xd'),_0x2a0b5f);}});}})[_0xe0f1('0xf')](function(_0x51e540){utils[_0xe0f1('0x10')](util[_0xe0f1('0x11')]('[%s][members][writeDB]',_0x2a0b5f[_0xe0f1('0x4')]),_0x51e540);});}delete members[_0x2a0b5f[_0xe0f1('0x5')]];}function startsWith(_0x3f7295,_0x245a0d){return _['some'](_0x3f7295,function(_0x295e97){return _[_0xe0f1('0x12')](_0x245a0d,_0x295e97);});}exports['devicestatechange']=function(_0xd76938){try{utils[_0xe0f1('0x13')](util[_0xe0f1('0x11')](_0xe0f1('0x14'),members[_0xd76938['device']]?members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x4')]:_0xd76938[_0xe0f1('0x15')]),_0xd76938);utils['info'](util['format'](_0xe0f1('0x16'),members[_0xd76938[_0xe0f1('0x15')]]?members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x4')]:_0xd76938[_0xe0f1('0x15')],_0xd76938[_0xe0f1('0x17')],_0xd76938['device']));switch(_0xd76938[_0xe0f1('0x17')]){case _0xe0f1('0x18'):case'BUSY':if(!startsWith(exclude,_0xd76938[_0xe0f1('0x15')])){members[_0xd76938[_0xe0f1('0x15')]]={'channel':_0xe0f1('0x19'),'interface':_0xd76938[_0xe0f1('0x15')],'type':_0xe0f1('0x1a'),'enterAt':utils[_0xe0f1('0x1b')](),'role':_0xe0f1('0x1c')};}break;case _0xe0f1('0x1d'):if(!_[_0xe0f1('0x1e')](members[_0xd76938[_0xe0f1('0x15')]])){members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x1f')]=utils[_0xe0f1('0x1b')]();members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x20')]=utils[_0xe0f1('0x21')](members[_0xd76938[_0xe0f1('0x15')]]['exitAt'],members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x22')]);if(members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x4')]){writeDB(members[_0xd76938['device']]);}}break;default:break;}}catch(_0x5177c1){utils[_0xe0f1('0x10')](util[_0xe0f1('0x11')]('[%s][members][devicestatechange]',members[_0xd76938[_0xe0f1('0x15')]]?members[_0xd76938[_0xe0f1('0x15')]][_0xe0f1('0x4')]:_0xd76938['device']),_0x5177c1);}};exports[_0xe0f1('0x23')]=function(_0x82bc98){try{if(!_[_0xe0f1('0x1e')](members[_0x82bc98[_0xe0f1('0x5')]])){utils[_0xe0f1('0x13')](util[_0xe0f1('0x11')]('[%s][members][agentcomplete]',_0x82bc98[_0xe0f1('0x4')]),_0x82bc98);utils[_0xe0f1('0x2')](util[_0xe0f1('0x11')](_0xe0f1('0x24'),_0x82bc98[_0xe0f1('0x4')],_0x82bc98['interface'],_0x82bc98[_0xe0f1('0x25')]));members[_0x82bc98[_0xe0f1('0x5')]]=_[_0xe0f1('0x26')](members[_0x82bc98[_0xe0f1('0x5')]],{'data4':_0x82bc98[_0xe0f1('0x25')],'uniqueid':_0x82bc98['uniqueid']});}}catch(_0x4bfc9d){utils[_0xe0f1('0x10')](util[_0xe0f1('0x11')](_0xe0f1('0x27'),_0x82bc98['uniqueid']),_0x4bfc9d);}};exports[_0xe0f1('0x28')]=function(_0x54a701){try{utils[_0xe0f1('0x13')](util[_0xe0f1('0x11')](_0xe0f1('0x29'),_0x54a701['uniqueid']),_0x54a701);if(_0x54a701['channel']){var _0x3269e1=_0x54a701[_0xe0f1('0x6')]['split']('-')[0x0];if(!_[_0xe0f1('0x1e')](members[_0x3269e1])){members[_0x3269e1]=_['assign'](members[_0x3269e1],{'data1':members[_0x3269e1][_0xe0f1('0x2a')]||_0x54a701[_0xe0f1('0x7')],'data2':members[_0x3269e1][_0xe0f1('0x2b')]||_0x54a701[_0xe0f1('0x2c')],'data3':members[_0x3269e1][_0xe0f1('0x2d')]||_0x54a701[_0xe0f1('0x2e')],'uniqueid':members[_0x3269e1][_0xe0f1('0x4')]||_0x54a701[_0xe0f1('0x4')]});utils['info'](util['format'](_0xe0f1('0x2f'),_0x54a701['uniqueid'],members[_0x3269e1][_0xe0f1('0x2a')],members[_0x3269e1][_0xe0f1('0x2b')],members[_0x3269e1][_0xe0f1('0x2d')]));if(members[_0x3269e1][_0xe0f1('0x1f')]){writeDB(members[_0x3269e1]);}}}if(_0x54a701[_0xe0f1('0x30')]){var _0x3e003b=_0x54a701[_0xe0f1('0x30')][_0xe0f1('0x31')]('-')[0x0];if(!_['isNil'](members[_0x3e003b])){members[_0x3e003b]=_[_0xe0f1('0x26')](members[_0x3e003b],{'data1':members[_0x3e003b][_0xe0f1('0x2a')]||_0x54a701[_0xe0f1('0x7')],'data2':members[_0x3e003b][_0xe0f1('0x2b')]||_0x54a701[_0xe0f1('0x2c')],'data3':members[_0x3e003b][_0xe0f1('0x2d')]||_0x54a701[_0xe0f1('0x2e')],'uniqueid':members[_0x3e003b][_0xe0f1('0x4')]||_0x54a701[_0xe0f1('0x4')]});utils[_0xe0f1('0x2')](util['format'](_0xe0f1('0x2f'),_0x54a701[_0xe0f1('0x4')],members[_0x3e003b][_0xe0f1('0x2a')],members[_0x3e003b][_0xe0f1('0x2b')],members[_0x3e003b]['data3']));if(members[_0x3e003b]['exitAt']){writeDB(members[_0x3e003b]);}}}}catch(_0xf8c7cf){utils[_0xe0f1('0x10')](util[_0xe0f1('0x11')](_0xe0f1('0x29'),_0x54a701[_0xe0f1('0x4')]),_0xf8c7cf);}};
\ No newline at end of file
index 16895f9..5761067 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd35e=['agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','clone','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','./utils','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','queuestatus','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','variable','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','connectedlinenum','holdtime','diffTime','count','connectedlinename','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','accountcode','destaccountcode'];(function(_0x363d28,_0x54258d){var _0x283e53=function(_0x274ddf){while(--_0x274ddf){_0x363d28['push'](_0x363d28['shift']());}};_0x283e53(++_0x54258d);}(_0xd35e,0x101));var _0xed35=function(_0x2a5262,_0x578588){_0x2a5262=_0x2a5262-0x0;var _0x483802=_0xd35e[_0x2a5262];return _0x483802;};'use strict';var _=require('lodash');var util=require(_0xed35('0x0'));var utils=require(_0xed35('0x1'));var queues={};function writeDB(_0x3ea9c2){utils['info'](util[_0xed35('0x2')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3ea9c2[_0xed35('0x3')],_0x3ea9c2[_0xed35('0x4')],_0x3ea9c2[_0xed35('0x5')],_0x3ea9c2[_0xed35('0x6')],_0x3ea9c2[_0xed35('0x7')],_0x3ea9c2['accountcode'],_0x3ea9c2[_0xed35('0x8')]));if(_0x3ea9c2[_0xed35('0x5')]){utils[_0xed35('0x9')](_0x3ea9c2[_0xed35('0x5')])[_0xed35('0xa')](function(_0x291a9e){if(_0x291a9e){_0x3ea9c2[_0xed35('0xb')]=_0x291a9e[_0xed35('0xb')];}utils[_0xed35('0xc')](_0xed35('0xd'),_0x3ea9c2);});}else{utils[_0xed35('0xc')](_0xed35('0xd'),_0x3ea9c2);}if(_0x3ea9c2[_0xed35('0xe')]){delete queues[_0x3ea9c2[_0xed35('0xe')]];}else{delete queues[_0x3ea9c2[_0xed35('0x3')]];}}exports['queuecallerjoin']=function(_0x16dbc1){try{utils[_0xed35('0xf')](util[_0xed35('0x2')](_0xed35('0x10'),_0x16dbc1[_0xed35('0x3')]),_0x16dbc1);utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x12'),_0x16dbc1[_0xed35('0x3')],_0x16dbc1[_0xed35('0x5')],_0x16dbc1[_0xed35('0x13')]));queues[_0x16dbc1[_0xed35('0x3')]]=_[_0xed35('0x14')](_0x16dbc1,{'originalposition':_0x16dbc1[_0xed35('0x13')],'queuecallerjoinAt':utils[_0xed35('0x15')](),'mohtime':0x0});}catch(_0x55b2c9){utils[_0xed35('0x16')](util[_0xed35('0x2')](_0xed35('0x10'),_0x16dbc1[_0xed35('0x3')]),_0x55b2c9);}};exports[_0xed35('0x17')]=function(_0x383a29){try{if(!_[_0xed35('0x18')](queues[_0x383a29[_0xed35('0x3')]])){utils['debug'](util['format'](_0xed35('0x19'),_0x383a29[_0xed35('0x3')]),_0x383a29);if(queues[_0x383a29[_0xed35('0x3')]][_0xed35('0x1a')]){if(!queues[_0x383a29[_0xed35('0x3')]]['queuecallerabandon']&&!queues[_0x383a29['uniqueid']][_0xed35('0x1b')]){queues[_0x383a29[_0xed35('0x3')]][_0xed35('0x1c')]=!![];queues[_0x383a29['uniqueid']]['queuecallercompleteAt']=utils[_0xed35('0x15')]();queues[_0x383a29['uniqueid']][_0xed35('0x8')]=_0xed35('0x1d');}utils[_0xed35('0x11')](util['format'](_0xed35('0x1e'),_0x383a29[_0xed35('0x3')],queues[_0x383a29[_0xed35('0x3')]][_0xed35('0x1f')],queues[_0x383a29[_0xed35('0x3')]][_0xed35('0x8')]));writeDB(queues[_0x383a29[_0xed35('0x3')]]);}else if(queues[_0x383a29['uniqueid']][_0xed35('0xe')]){utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x20'),_0x383a29[_0xed35('0x3')],queues[_0x383a29[_0xed35('0x3')]]['name'],queues[_0x383a29['uniqueid']][_0xed35('0xe')]));queues[queues[_0x383a29[_0xed35('0x3')]]['transfereduniqueid']]=queues[_0x383a29['uniqueid']];queues[queues[_0x383a29[_0xed35('0x3')]][_0xed35('0xe')]][_0xed35('0x21')]=0x2;delete queues[_0x383a29[_0xed35('0x3')]];}}}catch(_0x4f8e5f){utils[_0xed35('0x16')](util['format'](_0xed35('0x19'),_0x383a29[_0xed35('0x3')]),_0x4f8e5f);}};exports[_0xed35('0x22')]=function(_0x319437){try{utils[_0xed35('0xf')](util['format'](_0xed35('0x23'),_0x319437[_0xed35('0x3')]),_0x319437);if(!_[_0xed35('0x18')](_0x319437['variable'][_0xed35('0x24')])&&_0x319437['value'][_0xed35('0x25')]()!==_0xed35('0x26')){if(!_['isNil'](queues[_0x319437[_0xed35('0x3')]])){queues[_0x319437[_0xed35('0x3')]][_0xed35('0x27')]=![];queues[_0x319437[_0xed35('0x3')]][_0xed35('0x28')]=null;queues[_0x319437[_0xed35('0x3')]][_0xed35('0x1b')]=!![];queues[_0x319437[_0xed35('0x3')]][_0xed35('0x29')]=utils[_0xed35('0x15')]();queues[_0x319437['uniqueid']]['queuecallerexitreason']=_0x319437[_0xed35('0x2a')][_0xed35('0x25')]();utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x2b'),_0x319437[_0xed35('0x3')],queues[_0x319437[_0xed35('0x3')]][_0xed35('0x1f')],_0x319437['value'],queues[_0x319437['uniqueid']][_0xed35('0x8')]));writeDB(queues[_0x319437[_0xed35('0x3')]]);}}else if(!_[_0xed35('0x18')](_0x319437[_0xed35('0x2c')][_0xed35('0x2d')])){if(!_[_0xed35('0x18')](queues[_0x319437[_0xed35('0x3')]])&&!queues[_0x319437[_0xed35('0x3')]][_0xed35('0x27')]){queues[_0x319437[_0xed35('0x3')]][_0xed35('0x27')]=![];queues[_0x319437[_0xed35('0x3')]][_0xed35('0x28')]=null;queues[_0x319437[_0xed35('0x3')]]['queuecallerexit']=!![];queues[_0x319437[_0xed35('0x3')]][_0xed35('0x29')]=utils[_0xed35('0x15')]();queues[_0x319437['uniqueid']][_0xed35('0x8')]=_0xed35('0x2e');utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x2f'),_0x319437['uniqueid'],queues[_0x319437[_0xed35('0x3')]][_0xed35('0x1f')],_0x319437[_0xed35('0x2a')],queues[_0x319437[_0xed35('0x3')]][_0xed35('0x8')]));}}}catch(_0x486506){utils['error'](util['format']('[%s][queues][varset]',_0x319437[_0xed35('0x3')]),_0x486506);}};exports[_0xed35('0x27')]=function(_0x142ee7){try{if(!_[_0xed35('0x18')](queues[_0x142ee7[_0xed35('0x3')]])){utils[_0xed35('0xf')](util[_0xed35('0x2')](_0xed35('0x30'),_0x142ee7[_0xed35('0x3')]),_0x142ee7);queues[_0x142ee7[_0xed35('0x3')]][_0xed35('0x1b')]=![];queues[_0x142ee7[_0xed35('0x3')]][_0xed35('0x29')]=null;queues[_0x142ee7['uniqueid']][_0xed35('0x27')]=!![];queues[_0x142ee7['uniqueid']]['queuecallerabandonAt']=utils[_0xed35('0x15')]();queues[_0x142ee7[_0xed35('0x3')]][_0xed35('0x8')]=_0xed35('0x31');utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x32'),_0x142ee7[_0xed35('0x3')],queues[_0x142ee7[_0xed35('0x3')]][_0xed35('0x1f')],queues[_0x142ee7[_0xed35('0x3')]][_0xed35('0x8')]));}}catch(_0x4eeccd){utils[_0xed35('0x16')](util[_0xed35('0x2')](_0xed35('0x30'),_0x142ee7[_0xed35('0x3')]),_0x4eeccd);}};exports[_0xed35('0x33')]=function(_0x902cd1){try{if(!_[_0xed35('0x18')](queues[_0x902cd1[_0xed35('0x3')]])){utils['debug'](util[_0xed35('0x2')]('[%s][queues][queuecallerleave]',_0x902cd1[_0xed35('0x3')]),_0x902cd1);utils[_0xed35('0x11')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x902cd1[_0xed35('0x3')],queues[_0x902cd1[_0xed35('0x3')]]['name'],_0x902cd1[_0xed35('0x34')],_0x902cd1['connectedlinename']));queues[_0x902cd1[_0xed35('0x3')]]['queuecallerleave']=!![];queues[_0x902cd1[_0xed35('0x3')]][_0xed35('0x1a')]=utils[_0xed35('0x15')]();queues[_0x902cd1['uniqueid']][_0xed35('0x35')]=utils[_0xed35('0x36')](queues[_0x902cd1[_0xed35('0x3')]][_0xed35('0x1a')],queues[_0x902cd1[_0xed35('0x3')]]['queuecallerjoinAt']);queues[_0x902cd1[_0xed35('0x3')]][_0xed35('0x13')]=_0x902cd1[_0xed35('0x13')];queues[_0x902cd1['uniqueid']][_0xed35('0x37')]=_0x902cd1[_0xed35('0x37')];queues[_0x902cd1['uniqueid']][_0xed35('0x34')]=_0x902cd1[_0xed35('0x34')];queues[_0x902cd1['uniqueid']][_0xed35('0x38')]=_0x902cd1[_0xed35('0x38')];}}catch(_0x18865d){utils[_0xed35('0x16')](util[_0xed35('0x2')](_0xed35('0x39'),_0x902cd1['uniqueid']),_0x18865d);}};exports['agentconnect']=function(_0x57403c){try{if(!_[_0xed35('0x18')](queues[_0x57403c[_0xed35('0x3')]])){utils[_0xed35('0xf')](util[_0xed35('0x2')](_0xed35('0x3a'),_0x57403c[_0xed35('0x3')]),_0x57403c);utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x3b'),_0x57403c['uniqueid'],queues[_0x57403c['uniqueid']][_0xed35('0x1f')],_0x57403c[_0xed35('0x3c')],_0x57403c['destaccountcode']));queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x27')]=![];queues[_0x57403c['uniqueid']][_0xed35('0x27')]=![];queues[_0x57403c[_0xed35('0x3')]]['queuecallerabandonAt']=null;queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x1b')]=![];queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x8')]=null;queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x29')]=null;queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x3d')]=!![];queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x3e')]=_0x57403c[_0xed35('0x3f')];queues[_0x57403c[_0xed35('0x3')]][_0xed35('0x6')]=_0x57403c[_0xed35('0x3c')];}}catch(_0x3e9d8f){utils[_0xed35('0x16')](util[_0xed35('0x2')]('[%s][queues][agentconnect]',_0x57403c[_0xed35('0x3')]),_0x3e9d8f);}};exports[_0xed35('0x40')]=function(_0xb2621d){try{if(!_[_0xed35('0x18')](queues[_0xb2621d[_0xed35('0x3')]])){if(queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x1a')]){utils[_0xed35('0xf')](util[_0xed35('0x2')](_0xed35('0x41'),_0xb2621d[_0xed35('0x3')]),_0xb2621d);queues[_0xb2621d[_0xed35('0x3')]]['queuecallerabandon']=![];queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x27')]=![];queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x28')]=null;queues[_0xb2621d[_0xed35('0x3')]]['queuecallerexit']=![];queues[_0xb2621d[_0xed35('0x3')]]['queuecallerexitAt']=null;queues[_0xb2621d[_0xed35('0x3')]]['assigned']=!![];queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x6')]=_0xb2621d[_0xed35('0x3c')];queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x1c')]=!![];queues[_0xb2621d[_0xed35('0x3')]]['queuecallercompleteAt']=utils[_0xed35('0x15')]();if(_0xb2621d[_0xed35('0x42')]=='transfer'){if(!queues[_0xb2621d['uniqueid']][_0xed35('0x43')]){queues[_0xb2621d['uniqueid']][_0xed35('0x8')]=_0xed35('0x44');}}else{queues[_0xb2621d['uniqueid']]['queuecallerexitreason']=_0xed35('0x45')+_0xb2621d[_0xed35('0x42')][_0xed35('0x25')]();}utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x46'),_0xb2621d[_0xed35('0x3')],queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x1f')],_0xb2621d[_0xed35('0x3c')],queues[_0xb2621d[_0xed35('0x3')]][_0xed35('0x8')]));writeDB(queues[_0xb2621d[_0xed35('0x3')]]);}}}catch(_0x306697){utils[_0xed35('0x16')](util[_0xed35('0x2')](_0xed35('0x41'),_0xb2621d[_0xed35('0x3')]),_0x306697);}};exports[_0xed35('0x47')]=function(_0x5ba16){try{if(!_[_0xed35('0x18')](queues[_0x5ba16['transfereeuniqueid']])){utils[_0xed35('0xf')](util['format'](_0xed35('0x48'),_0x5ba16[_0xed35('0x3')]),_0x5ba16);queues[_0x5ba16[_0xed35('0x49')]]['transfer']=!![];queues[_0x5ba16[_0xed35('0x49')]][_0xed35('0x4a')]=_0xed35('0x4b');queues[_0x5ba16['transfereeuniqueid']][_0xed35('0x4c')]=_0x5ba16[_0xed35('0x4d')];queues[_0x5ba16[_0xed35('0x49')]][_0xed35('0x4e')]=_0x5ba16[_0xed35('0x49')];queues[_0x5ba16['transfereeuniqueid']]['queuecallerexitreason']=_0xed35('0x4f');utils[_0xed35('0x11')](util[_0xed35('0x2')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x5ba16['uniqueid'],queues[_0x5ba16[_0xed35('0x49')]]['name'],_0x5ba16['transfereeuniqueid'],_0x5ba16['extension']));}}catch(_0x512135){utils[_0xed35('0x16')](util[_0xed35('0x2')](_0xed35('0x48'),_0x5ba16['uniqueid']),_0x512135);}};exports[_0xed35('0x50')]=function(_0x285ddf){try{utils[_0xed35('0xf')](util[_0xed35('0x2')](_0xed35('0x51'),_0x285ddf[_0xed35('0x52')]),_0x285ddf);if(_0x285ddf[_0xed35('0x52')]==_0x285ddf[_0xed35('0x53')]){if(!_[_0xed35('0x18')](queues[_0x285ddf[_0xed35('0x54')]])){utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x55'),_0x285ddf[_0xed35('0x52')],queues[_0x285ddf['secondtransfererlinkedid']][_0xed35('0x1f')],_0x285ddf[_0xed35('0x56')]));queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x43')]=!![];queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x4a')]=_0xed35('0x57');queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x4c')]=_0x285ddf['origtransfererexten'];queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x4e')]=_0x285ddf[_0xed35('0x52')];queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x8')]=_0xed35('0x58');}if(!_[_0xed35('0x18')](queues[_0x285ddf[_0xed35('0x53')]])){if(_0x285ddf[_0xed35('0x59')]&&queues[_0x285ddf[_0xed35('0x59')]]){queues[_0x285ddf[_0xed35('0x59')]][_0xed35('0x21')]=0x1;queues[_0x285ddf[_0xed35('0x49')]]=_['clone'](queues[_0x285ddf['transfereelinkedid']]);queues[_0x285ddf[_0xed35('0x49')]]['transfereduniqueid']=_0x285ddf['transfertargetuniqueid'];queues[_0x285ddf['transfereeuniqueid']][_0xed35('0x21')]=0x2;queues[_0x285ddf[_0xed35('0x49')]][_0xed35('0x7')]=queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x7')];queues[_0x285ddf[_0xed35('0x49')]]['calleridname']=queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x5a')];queues[_0x285ddf[_0xed35('0x49')]][_0xed35('0x5b')]=utils['now']();queues[_0x285ddf[_0xed35('0x49')]][_0xed35('0x1a')]=utils[_0xed35('0x15')]();queues[_0x285ddf[_0xed35('0x49')]]['holdtime']=0x0;queues[_0x285ddf[_0xed35('0x49')]][_0xed35('0x5c')]=0x0;utils[_0xed35('0x11')](util['format'](_0xed35('0x5d'),_0x285ddf[_0xed35('0x52')],queues[_0x285ddf[_0xed35('0x49')]][_0xed35('0x1f')],queues[_0x285ddf[_0xed35('0x49')]][_0xed35('0x7')],queues[_0x285ddf['transfereeuniqueid']][_0xed35('0x5a')]));}else{utils['info'](util[_0xed35('0x2')](_0xed35('0x5e'),_0x285ddf['origtransfereruniqueid'],queues[_0x285ddf[_0xed35('0x53')]][_0xed35('0x1f')],_0x285ddf[_0xed35('0x54')]));queues[_0x285ddf[_0xed35('0x53')]][_0xed35('0xe')]=_0x285ddf['secondtransfererlinkedid'];}}}else if(_0x285ddf[_0xed35('0x5f')]==_0x285ddf[_0xed35('0x54')]){if(!_[_0xed35('0x18')](queues[_0x285ddf[_0xed35('0x53')]])){utils['info'](util[_0xed35('0x2')](_0xed35('0x60'),_0x285ddf[_0xed35('0x52')],queues[_0x285ddf[_0xed35('0x53')]]['name'],_0x285ddf[_0xed35('0x5f')],_0x285ddf[_0xed35('0x61')]));queues[_0x285ddf['origtransfererlinkedid']][_0xed35('0x43')]=!![];queues[_0x285ddf[_0xed35('0x53')]][_0xed35('0x4a')]=_0xed35('0x57');queues[_0x285ddf[_0xed35('0x53')]]['transferexten']=_0x285ddf[_0xed35('0x61')];queues[_0x285ddf[_0xed35('0x53')]][_0xed35('0x4e')]=_0x285ddf[_0xed35('0x5f')];queues[_0x285ddf[_0xed35('0x53')]][_0xed35('0x8')]=_0xed35('0x58');}if(!_[_0xed35('0x18')](queues[_0x285ddf['secondtransfererlinkedid']])){if(_0x285ddf[_0xed35('0x62')]&&queues[_0x285ddf[_0xed35('0x62')]]){queues[_0x285ddf[_0xed35('0x62')]][_0xed35('0x21')]=0x1;queues[_0x285ddf[_0xed35('0x63')]]=_[_0xed35('0x64')](queues[_0x285ddf['transfertargetlinkedid']]);queues[_0x285ddf[_0xed35('0x63')]]['transfereduniqueid']=_0x285ddf[_0xed35('0x63')];queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x21')]=0x2;queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x7')]=queues[_0x285ddf[_0xed35('0x53')]]['calleridnum'];queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x5a')]=queues[_0x285ddf[_0xed35('0x53')]][_0xed35('0x5a')];queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x5b')]=utils[_0xed35('0x15')]();queues[_0x285ddf['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xed35('0x15')]();queues[_0x285ddf[_0xed35('0x63')]]['holdtime']=0x0;queues[_0x285ddf['transfertargetuniqueid']][_0xed35('0x5c')]=0x0;utils[_0xed35('0x11')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x285ddf[_0xed35('0x52')],queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x1f')],queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0xe')],queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x7')],queues[_0x285ddf[_0xed35('0x63')]][_0xed35('0x5a')]));}else{utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x5e'),_0x285ddf[_0xed35('0x52')],queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0x1f')],_0x285ddf[_0xed35('0x53')]));queues[_0x285ddf[_0xed35('0x54')]][_0xed35('0xe')]=_0x285ddf['origtransfererlinkedid'];}}}}catch(_0x416266){utils['error'](util[_0xed35('0x2')](_0xed35('0x51'),_0x285ddf[_0xed35('0x52')]),_0x416266);}};exports[_0xed35('0x65')]=function(_0x1ed589){try{if(!_[_0xed35('0x18')](queues[_0x1ed589[_0xed35('0x3')]])){utils[_0xed35('0xf')](util['format'](_0xed35('0x66'),_0x1ed589[_0xed35('0x3')]),_0x1ed589);queues[_0x1ed589[_0xed35('0x3')]]['musiconholdstartAt']=utils['now']();utils[_0xed35('0x11')](util[_0xed35('0x2')](_0xed35('0x67'),_0x1ed589[_0xed35('0x3')],queues[_0x1ed589['uniqueid']][_0xed35('0x1f')],queues[_0x1ed589[_0xed35('0x3')]][_0xed35('0x68')]));}}catch(_0x76570f){utils['error'](util[_0xed35('0x2')](_0xed35('0x66'),_0x1ed589['uniqueid']),_0x76570f);}};exports['musiconholdstop']=function(_0x535804){try{if(!_[_0xed35('0x18')](queues[_0x535804[_0xed35('0x3')]])){if(!_[_0xed35('0x18')](queues[_0x535804[_0xed35('0x3')]][_0xed35('0x68')])){utils[_0xed35('0xf')](util[_0xed35('0x2')]('[%s][queues][musiconholdstop]',_0x535804[_0xed35('0x3')]),_0x535804);queues[_0x535804['uniqueid']][_0xed35('0x5c')]+=utils['diffTime'](utils[_0xed35('0x15')](),queues[_0x535804['uniqueid']][_0xed35('0x68')]);utils['info'](util['format'](_0xed35('0x69'),_0x535804[_0xed35('0x3')],queues[_0x535804['uniqueid']][_0xed35('0x1f')],queues[_0x535804[_0xed35('0x3')]][_0xed35('0x5c')]));delete queues[_0x535804['uniqueid']]['musiconholdstartAt'];}}}catch(_0x5447b2){utils[_0xed35('0x16')](util[_0xed35('0x2')](_0xed35('0x6a'),_0x535804[_0xed35('0x3')]),_0x5447b2);}};
\ No newline at end of file
+var _0x97d2=['secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transferuniqueid','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','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','ATTENDED','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','accountcode','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','hangup','[%s][queues][hangup]','queuecallerexit','queuecallerexitreason','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','error','varset','[%s][queues][varset]','isNil','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','variable','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x4b1bb0,_0x7dc32b){var _0x549407=function(_0xa08deb){while(--_0xa08deb){_0x4b1bb0['push'](_0x4b1bb0['shift']());}};_0x549407(++_0x7dc32b);}(_0x97d2,0xe5));var _0x297d=function(_0x317fea,_0xecb32b){_0x317fea=_0x317fea-0x0;var _0x3ed543=_0x97d2[_0x317fea];return _0x3ed543;};'use strict';var _=require(_0x297d('0x0'));var util=require(_0x297d('0x1'));var utils=require(_0x297d('0x2'));var queues={};function writeDB(_0x4b0d6b){utils[_0x297d('0x3')](util[_0x297d('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4b0d6b[_0x297d('0x5')],_0x4b0d6b['channel'],_0x4b0d6b[_0x297d('0x6')],_0x4b0d6b[_0x297d('0x7')],_0x4b0d6b['calleridnum'],_0x4b0d6b[_0x297d('0x8')],_0x4b0d6b['queuecallerexitreason']));if(_0x4b0d6b[_0x297d('0x6')]){utils[_0x297d('0x9')](_0x4b0d6b[_0x297d('0x6')])[_0x297d('0xa')](function(_0x30f696){if(_0x30f696){_0x4b0d6b[_0x297d('0xb')]=_0x30f696[_0x297d('0xb')];}utils[_0x297d('0xc')]('CreateVoiceQueueReport',_0x4b0d6b);});}else{utils[_0x297d('0xc')](_0x297d('0xd'),_0x4b0d6b);}if(_0x4b0d6b['transfereduniqueid']){delete queues[_0x4b0d6b[_0x297d('0xe')]];}else{delete queues[_0x4b0d6b[_0x297d('0x5')]];}}exports[_0x297d('0xf')]=function(_0xd7fae3){try{utils[_0x297d('0x10')](util[_0x297d('0x4')](_0x297d('0x11'),_0xd7fae3['uniqueid']),_0xd7fae3);utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x12'),_0xd7fae3[_0x297d('0x5')],_0xd7fae3['queue'],_0xd7fae3[_0x297d('0x13')]));queues[_0xd7fae3[_0x297d('0x5')]]=_[_0x297d('0x14')](_0xd7fae3,{'originalposition':_0xd7fae3['position'],'queuecallerjoinAt':utils[_0x297d('0x15')](),'mohtime':0x0});}catch(_0x219581){utils['error'](util[_0x297d('0x4')]('[%s][queues][queuecallerjoin]',_0xd7fae3[_0x297d('0x5')]),_0x219581);}};exports[_0x297d('0x16')]=function(_0x49b84b){try{if(!_['isNil'](queues[_0x49b84b[_0x297d('0x5')]])){utils[_0x297d('0x10')](util[_0x297d('0x4')](_0x297d('0x17'),_0x49b84b[_0x297d('0x5')]),_0x49b84b);if(queues[_0x49b84b[_0x297d('0x5')]]['queuecallerleaveAt']){if(!queues[_0x49b84b[_0x297d('0x5')]]['queuecallerabandon']&&!queues[_0x49b84b[_0x297d('0x5')]][_0x297d('0x18')]){queues[_0x49b84b['uniqueid']]['queuecallercomplete']=!![];queues[_0x49b84b['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x49b84b[_0x297d('0x5')]][_0x297d('0x19')]=_0x297d('0x1a');}utils['info'](util['format'](_0x297d('0x1b'),_0x49b84b[_0x297d('0x5')],queues[_0x49b84b[_0x297d('0x5')]][_0x297d('0x1c')],queues[_0x49b84b[_0x297d('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x49b84b[_0x297d('0x5')]]);}else if(queues[_0x49b84b[_0x297d('0x5')]]['transfereduniqueid']){utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x1d'),_0x49b84b['uniqueid'],queues[_0x49b84b['uniqueid']][_0x297d('0x1c')],queues[_0x49b84b[_0x297d('0x5')]][_0x297d('0xe')]));queues[queues[_0x49b84b[_0x297d('0x5')]][_0x297d('0xe')]]=queues[_0x49b84b[_0x297d('0x5')]];queues[queues[_0x49b84b['uniqueid']]['transfereduniqueid']][_0x297d('0x1e')]=0x2;delete queues[_0x49b84b['uniqueid']];}}}catch(_0x4c8358){utils[_0x297d('0x1f')](util[_0x297d('0x4')](_0x297d('0x17'),_0x49b84b[_0x297d('0x5')]),_0x4c8358);}};exports[_0x297d('0x20')]=function(_0x4f5475){try{utils[_0x297d('0x10')](util['format'](_0x297d('0x21'),_0x4f5475[_0x297d('0x5')]),_0x4f5475);if(!_[_0x297d('0x22')](_0x4f5475['variable']['queuestatus'])&&_0x4f5475[_0x297d('0x23')][_0x297d('0x24')]()!==_0x297d('0x25')){if(!_[_0x297d('0x22')](queues[_0x4f5475[_0x297d('0x5')]])){queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x26')]=![];queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x27')]=null;queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x18')]=!![];queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x28')]=utils[_0x297d('0x15')]();queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x19')]=_0x4f5475['value']['toUpperCase']();utils[_0x297d('0x3')](util[_0x297d('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x4f5475[_0x297d('0x5')],queues[_0x4f5475[_0x297d('0x5')]]['name'],_0x4f5475[_0x297d('0x23')],queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x19')]));writeDB(queues[_0x4f5475[_0x297d('0x5')]]);}}else if(!_['isNil'](_0x4f5475[_0x297d('0x29')][_0x297d('0x2a')])){if(!_[_0x297d('0x22')](queues[_0x4f5475[_0x297d('0x5')]])&&!queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x26')]){queues[_0x4f5475['uniqueid']]['queuecallerabandon']=![];queues[_0x4f5475['uniqueid']][_0x297d('0x27')]=null;queues[_0x4f5475['uniqueid']][_0x297d('0x18')]=!![];queues[_0x4f5475[_0x297d('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x19')]=_0x297d('0x2b');utils[_0x297d('0x3')](util[_0x297d('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4f5475['uniqueid'],queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x1c')],_0x4f5475['value'],queues[_0x4f5475[_0x297d('0x5')]][_0x297d('0x19')]));}}}catch(_0x4d823e){utils[_0x297d('0x1f')](util[_0x297d('0x4')](_0x297d('0x21'),_0x4f5475['uniqueid']),_0x4d823e);}};exports['queuecallerabandon']=function(_0x15d44d){try{if(!_[_0x297d('0x22')](queues[_0x15d44d[_0x297d('0x5')]])){utils[_0x297d('0x10')](util[_0x297d('0x4')](_0x297d('0x2c'),_0x15d44d[_0x297d('0x5')]),_0x15d44d);queues[_0x15d44d[_0x297d('0x5')]][_0x297d('0x18')]=![];queues[_0x15d44d['uniqueid']][_0x297d('0x28')]=null;queues[_0x15d44d[_0x297d('0x5')]][_0x297d('0x26')]=!![];queues[_0x15d44d[_0x297d('0x5')]][_0x297d('0x27')]=utils[_0x297d('0x15')]();queues[_0x15d44d['uniqueid']][_0x297d('0x19')]='ABANDONED';utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x2d'),_0x15d44d['uniqueid'],queues[_0x15d44d[_0x297d('0x5')]][_0x297d('0x1c')],queues[_0x15d44d['uniqueid']][_0x297d('0x19')]));}}catch(_0xfc6e75){utils[_0x297d('0x1f')](util['format'](_0x297d('0x2c'),_0x15d44d[_0x297d('0x5')]),_0xfc6e75);}};exports[_0x297d('0x2e')]=function(_0x4d73a0){try{if(!_[_0x297d('0x22')](queues[_0x4d73a0[_0x297d('0x5')]])){utils[_0x297d('0x10')](util[_0x297d('0x4')](_0x297d('0x2f'),_0x4d73a0[_0x297d('0x5')]),_0x4d73a0);utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x30'),_0x4d73a0[_0x297d('0x5')],queues[_0x4d73a0['uniqueid']]['name'],_0x4d73a0[_0x297d('0x31')],_0x4d73a0[_0x297d('0x32')]));queues[_0x4d73a0[_0x297d('0x5')]][_0x297d('0x2e')]=!![];queues[_0x4d73a0[_0x297d('0x5')]]['queuecallerleaveAt']=utils[_0x297d('0x15')]();queues[_0x4d73a0[_0x297d('0x5')]][_0x297d('0x33')]=utils[_0x297d('0x34')](queues[_0x4d73a0['uniqueid']][_0x297d('0x35')],queues[_0x4d73a0['uniqueid']][_0x297d('0x36')]);queues[_0x4d73a0[_0x297d('0x5')]]['position']=_0x4d73a0[_0x297d('0x13')];queues[_0x4d73a0[_0x297d('0x5')]]['count']=_0x4d73a0['count'];queues[_0x4d73a0['uniqueid']][_0x297d('0x31')]=_0x4d73a0['connectedlinenum'];queues[_0x4d73a0[_0x297d('0x5')]]['connectedlinename']=_0x4d73a0['connectedlinename'];}}catch(_0x5c7622){utils[_0x297d('0x1f')](util[_0x297d('0x4')](_0x297d('0x2f'),_0x4d73a0['uniqueid']),_0x5c7622);}};exports[_0x297d('0x37')]=function(_0x10837d){try{if(!_['isNil'](queues[_0x10837d['uniqueid']])){utils[_0x297d('0x10')](util[_0x297d('0x4')](_0x297d('0x38'),_0x10837d[_0x297d('0x5')]),_0x10837d);utils['info'](util[_0x297d('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x10837d[_0x297d('0x5')],queues[_0x10837d['uniqueid']][_0x297d('0x1c')],_0x10837d[_0x297d('0x39')],_0x10837d[_0x297d('0x3a')]));queues[_0x10837d[_0x297d('0x5')]][_0x297d('0x26')]=![];queues[_0x10837d['uniqueid']][_0x297d('0x26')]=![];queues[_0x10837d[_0x297d('0x5')]][_0x297d('0x27')]=null;queues[_0x10837d['uniqueid']][_0x297d('0x18')]=![];queues[_0x10837d[_0x297d('0x5')]][_0x297d('0x19')]=null;queues[_0x10837d[_0x297d('0x5')]][_0x297d('0x28')]=null;queues[_0x10837d['uniqueid']][_0x297d('0x3b')]=!![];queues[_0x10837d[_0x297d('0x5')]][_0x297d('0x8')]=_0x10837d[_0x297d('0x3a')];queues[_0x10837d[_0x297d('0x5')]]['lastAssignedTo']=_0x10837d[_0x297d('0x39')];}}catch(_0x5f5b37){utils[_0x297d('0x1f')](util[_0x297d('0x4')](_0x297d('0x38'),_0x10837d[_0x297d('0x5')]),_0x5f5b37);}};exports[_0x297d('0x3c')]=function(_0x150112){try{if(!_['isNil'](queues[_0x150112[_0x297d('0x5')]])){if(queues[_0x150112[_0x297d('0x5')]][_0x297d('0x35')]){utils[_0x297d('0x10')](util['format'](_0x297d('0x3d'),_0x150112[_0x297d('0x5')]),_0x150112);queues[_0x150112['uniqueid']][_0x297d('0x26')]=![];queues[_0x150112['uniqueid']][_0x297d('0x26')]=![];queues[_0x150112[_0x297d('0x5')]][_0x297d('0x27')]=null;queues[_0x150112[_0x297d('0x5')]][_0x297d('0x18')]=![];queues[_0x150112[_0x297d('0x5')]]['queuecallerexitAt']=null;queues[_0x150112[_0x297d('0x5')]]['assigned']=!![];queues[_0x150112[_0x297d('0x5')]][_0x297d('0x7')]=_0x150112[_0x297d('0x39')];queues[_0x150112[_0x297d('0x5')]][_0x297d('0x3e')]=!![];queues[_0x150112[_0x297d('0x5')]]['queuecallercompleteAt']=utils[_0x297d('0x15')]();if(_0x150112[_0x297d('0x3f')]==_0x297d('0x40')){if(!queues[_0x150112[_0x297d('0x5')]][_0x297d('0x40')]){queues[_0x150112[_0x297d('0x5')]][_0x297d('0x19')]='TRANSFER';}}else{queues[_0x150112[_0x297d('0x5')]][_0x297d('0x19')]='COMPLETEDBY'+_0x150112['reason'][_0x297d('0x24')]();}utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x41'),_0x150112[_0x297d('0x5')],queues[_0x150112[_0x297d('0x5')]][_0x297d('0x1c')],_0x150112['membername'],queues[_0x150112[_0x297d('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x150112[_0x297d('0x5')]]);}}}catch(_0x4adcf0){utils[_0x297d('0x1f')](util['format'](_0x297d('0x3d'),_0x150112['uniqueid']),_0x4adcf0);}};exports[_0x297d('0x42')]=function(_0x3143ac){try{if(!_[_0x297d('0x22')](queues[_0x3143ac[_0x297d('0x43')]])){utils['debug'](util[_0x297d('0x4')](_0x297d('0x44'),_0x3143ac[_0x297d('0x5')]),_0x3143ac);queues[_0x3143ac[_0x297d('0x43')]][_0x297d('0x40')]=!![];queues[_0x3143ac[_0x297d('0x43')]][_0x297d('0x45')]=_0x297d('0x46');queues[_0x3143ac[_0x297d('0x43')]][_0x297d('0x47')]=_0x3143ac[_0x297d('0x48')];queues[_0x3143ac['transfereeuniqueid']]['transferuniqueid']=_0x3143ac['transfereeuniqueid'];queues[_0x3143ac['transfereeuniqueid']][_0x297d('0x19')]=_0x297d('0x49');utils[_0x297d('0x3')](util[_0x297d('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x3143ac[_0x297d('0x5')],queues[_0x3143ac[_0x297d('0x43')]][_0x297d('0x1c')],_0x3143ac['transfereeuniqueid'],_0x3143ac['extension']));}}catch(_0x28bec2){utils[_0x297d('0x1f')](util[_0x297d('0x4')](_0x297d('0x44'),_0x3143ac[_0x297d('0x5')]),_0x28bec2);}};exports[_0x297d('0x4a')]=function(_0x137f71){try{utils[_0x297d('0x10')](util['format'](_0x297d('0x4b'),_0x137f71[_0x297d('0x4c')]),_0x137f71);if(_0x137f71['origtransfereruniqueid']==_0x137f71['origtransfererlinkedid']){if(!_[_0x297d('0x22')](queues[_0x137f71[_0x297d('0x4d')]])){utils[_0x297d('0x3')](util['format'](_0x297d('0x4e'),_0x137f71['origtransfereruniqueid'],queues[_0x137f71[_0x297d('0x4d')]]['name'],_0x137f71['origtransfererexten']));queues[_0x137f71['secondtransfererlinkedid']][_0x297d('0x40')]=!![];queues[_0x137f71[_0x297d('0x4d')]][_0x297d('0x45')]='ATTENDED';queues[_0x137f71[_0x297d('0x4d')]][_0x297d('0x47')]=_0x137f71['origtransfererexten'];queues[_0x137f71[_0x297d('0x4d')]][_0x297d('0x4f')]=_0x137f71[_0x297d('0x4c')];queues[_0x137f71[_0x297d('0x4d')]]['queuecallerexitreason']=_0x297d('0x50');}if(!_[_0x297d('0x22')](queues[_0x137f71[_0x297d('0x51')]])){if(_0x137f71[_0x297d('0x52')]&&queues[_0x137f71[_0x297d('0x52')]]){queues[_0x137f71[_0x297d('0x52')]][_0x297d('0x1e')]=0x1;queues[_0x137f71['transfereeuniqueid']]=_[_0x297d('0x53')](queues[_0x137f71[_0x297d('0x52')]]);queues[_0x137f71[_0x297d('0x43')]]['transfereduniqueid']=_0x137f71[_0x297d('0x54')];queues[_0x137f71[_0x297d('0x43')]][_0x297d('0x1e')]=0x2;queues[_0x137f71[_0x297d('0x43')]][_0x297d('0x55')]=queues[_0x137f71[_0x297d('0x4d')]][_0x297d('0x55')];queues[_0x137f71[_0x297d('0x43')]]['calleridname']=queues[_0x137f71[_0x297d('0x4d')]][_0x297d('0x56')];queues[_0x137f71['transfereeuniqueid']][_0x297d('0x36')]=utils['now']();queues[_0x137f71[_0x297d('0x43')]]['queuecallerleaveAt']=utils['now']();queues[_0x137f71['transfereeuniqueid']]['holdtime']=0x0;queues[_0x137f71['transfereeuniqueid']][_0x297d('0x57')]=0x0;utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x58'),_0x137f71[_0x297d('0x4c')],queues[_0x137f71[_0x297d('0x43')]]['name'],queues[_0x137f71[_0x297d('0x43')]]['calleridnum'],queues[_0x137f71['transfereeuniqueid']][_0x297d('0x56')]));}else{utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x59'),_0x137f71[_0x297d('0x4c')],queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x1c')],_0x137f71[_0x297d('0x4d')]));queues[_0x137f71['origtransfererlinkedid']]['transfereduniqueid']=_0x137f71[_0x297d('0x4d')];}}}else if(_0x137f71[_0x297d('0x5a')]==_0x137f71[_0x297d('0x4d')]){if(!_[_0x297d('0x22')](queues[_0x137f71[_0x297d('0x51')]])){utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x5b'),_0x137f71[_0x297d('0x4c')],queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x1c')],_0x137f71[_0x297d('0x5a')],_0x137f71[_0x297d('0x5c')]));queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x40')]=!![];queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x45')]=_0x297d('0x5d');queues[_0x137f71['origtransfererlinkedid']]['transferexten']=_0x137f71[_0x297d('0x5c')];queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x4f')]=_0x137f71[_0x297d('0x5a')];queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x19')]=_0x297d('0x50');}if(!_[_0x297d('0x22')](queues[_0x137f71[_0x297d('0x4d')]])){if(_0x137f71[_0x297d('0x5e')]&&queues[_0x137f71[_0x297d('0x5e')]]){queues[_0x137f71[_0x297d('0x5e')]][_0x297d('0x1e')]=0x1;queues[_0x137f71[_0x297d('0x54')]]=_[_0x297d('0x53')](queues[_0x137f71[_0x297d('0x5e')]]);queues[_0x137f71['transfertargetuniqueid']][_0x297d('0xe')]=_0x137f71['transfertargetuniqueid'];queues[_0x137f71['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x137f71['transfertargetuniqueid']]['calleridnum']=queues[_0x137f71[_0x297d('0x51')]][_0x297d('0x55')];queues[_0x137f71['transfertargetuniqueid']][_0x297d('0x56')]=queues[_0x137f71['origtransfererlinkedid']][_0x297d('0x56')];queues[_0x137f71[_0x297d('0x54')]][_0x297d('0x36')]=utils[_0x297d('0x15')]();queues[_0x137f71[_0x297d('0x54')]][_0x297d('0x35')]=utils[_0x297d('0x15')]();queues[_0x137f71[_0x297d('0x54')]][_0x297d('0x33')]=0x0;queues[_0x137f71[_0x297d('0x54')]]['mohtime']=0x0;utils[_0x297d('0x3')](util[_0x297d('0x4')](_0x297d('0x5f'),_0x137f71[_0x297d('0x4c')],queues[_0x137f71[_0x297d('0x54')]][_0x297d('0x1c')],queues[_0x137f71[_0x297d('0x54')]][_0x297d('0xe')],queues[_0x137f71[_0x297d('0x54')]][_0x297d('0x55')],queues[_0x137f71['transfertargetuniqueid']][_0x297d('0x56')]));}else{utils['info'](util[_0x297d('0x4')](_0x297d('0x59'),_0x137f71[_0x297d('0x4c')],queues[_0x137f71[_0x297d('0x4d')]]['name'],_0x137f71[_0x297d('0x51')]));queues[_0x137f71[_0x297d('0x4d')]][_0x297d('0xe')]=_0x137f71[_0x297d('0x51')];}}}}catch(_0x20b034){utils[_0x297d('0x1f')](util[_0x297d('0x4')](_0x297d('0x4b'),_0x137f71[_0x297d('0x4c')]),_0x20b034);}};exports[_0x297d('0x60')]=function(_0x570426){try{if(!_['isNil'](queues[_0x570426['uniqueid']])){utils[_0x297d('0x10')](util[_0x297d('0x4')](_0x297d('0x61'),_0x570426[_0x297d('0x5')]),_0x570426);queues[_0x570426[_0x297d('0x5')]][_0x297d('0x62')]=utils[_0x297d('0x15')]();utils['info'](util['format'](_0x297d('0x63'),_0x570426['uniqueid'],queues[_0x570426['uniqueid']][_0x297d('0x1c')],queues[_0x570426['uniqueid']][_0x297d('0x62')]));}}catch(_0x23d7e2){utils['error'](util[_0x297d('0x4')]('[%s][queues][musiconholdstart]',_0x570426[_0x297d('0x5')]),_0x23d7e2);}};exports[_0x297d('0x64')]=function(_0x564be2){try{if(!_[_0x297d('0x22')](queues[_0x564be2['uniqueid']])){if(!_['isNil'](queues[_0x564be2[_0x297d('0x5')]][_0x297d('0x62')])){utils['debug'](util['format'](_0x297d('0x65'),_0x564be2[_0x297d('0x5')]),_0x564be2);queues[_0x564be2[_0x297d('0x5')]][_0x297d('0x57')]+=utils[_0x297d('0x34')](utils['now'](),queues[_0x564be2[_0x297d('0x5')]][_0x297d('0x62')]);utils['info'](util[_0x297d('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x564be2[_0x297d('0x5')],queues[_0x564be2['uniqueid']][_0x297d('0x1c')],queues[_0x564be2[_0x297d('0x5')]][_0x297d('0x57')]));delete queues[_0x564be2[_0x297d('0x5')]]['musiconholdstartAt'];}}}catch(_0x4e7f52){utils[_0x297d('0x1f')](util['format'](_0x297d('0x65'),_0x564be2['uniqueid']),_0x4e7f52);}};
\ No newline at end of file
index b61f5d8..2b2adc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc078=['forEach','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','./utils','format','[%s][recordings][writeDB]','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x4b6c23,_0x590998){var _0x3f5877=function(_0x5ab3c6){while(--_0x5ab3c6){_0x4b6c23['push'](_0x4b6c23['shift']());}};_0x3f5877(++_0x590998);}(_0xc078,0x17b));var _0x8c07=function(_0x1e112d,_0x48864d){_0x1e112d=_0x1e112d-0x0;var _0x4c24ef=_0xc078[_0x1e112d];return _0x4c24ef;};'use strict';var _=require(_0x8c07('0x0'));var util=require('util');var utils=require(_0x8c07('0x1'));var recordings={};function writeDB(_0x77aa44){utils['info'](util[_0x8c07('0x2')](_0x8c07('0x3'),_0x77aa44['uniqueid']));if(_0x77aa44[_0x8c07('0x4')]){utils['getUserByInternal'](_0x77aa44[_0x8c07('0x4')])[_0x8c07('0x5')](function(_0x467fc7){if(_0x467fc7){_0x77aa44[_0x8c07('0x6')]=_0x467fc7[_0x8c07('0x7')];_0x77aa44[_0x8c07('0x8')]=_0x467fc7['id'];}utils[_0x8c07('0x9')](_0x8c07('0xa'),_0x77aa44);});}else{utils[_0x8c07('0x9')](_0x8c07('0xa'),_0x77aa44);}}exports[_0x8c07('0xb')]=function(_0x355eed){try{utils[_0x8c07('0xc')](util[_0x8c07('0x2')](_0x8c07('0xd'),_0x355eed[_0x8c07('0xe')]),_0x355eed);if(_0x355eed[_0x8c07('0xe')]==_0x355eed['linkedid']){utils[_0x8c07('0xf')](util['format'](_0x8c07('0x10'),_0x355eed['uniqueid'],_0x355eed[_0x8c07('0x11')],_0x355eed[_0x8c07('0x12')]));recordings[_0x355eed[_0x8c07('0xe')]]={'uniqueid':_0x355eed[_0x8c07('0xe')],'accountcode':_0x355eed['accountcode'],'exten':_0x355eed['exten'],'context':_0x355eed[_0x8c07('0x11')],'channel':_0x355eed[_0x8c07('0x13')],'monitors':[]};}}catch(_0x5366f6){utils['error'](util[_0x8c07('0x2')]('[%s][recordings][newchannel]',_0x355eed[_0x8c07('0xe')]),_0x5366f6);}};exports[_0x8c07('0x14')]=function(_0x2c92f2){try{utils[_0x8c07('0xc')](util[_0x8c07('0x2')](_0x8c07('0x15'),_0x2c92f2[_0x8c07('0xe')]),_0x2c92f2);if(!_[_0x8c07('0x16')](recordings[_0x2c92f2[_0x8c07('0xe')]])&&_0x2c92f2[_0x8c07('0x17')]==0x6){utils['info'](util['format'](_0x8c07('0x18'),_0x2c92f2[_0x8c07('0xe')],_0x2c92f2[_0x8c07('0x11')],_0x2c92f2[_0x8c07('0x13')]));}else if(!_[_0x8c07('0x16')](recordings[_0x2c92f2[_0x8c07('0x19')]])&&_0x2c92f2[_0x8c07('0x17')]==0x6&&_0x2c92f2[_0x8c07('0x11')]!=_0x8c07('0x1a')){utils['info'](util[_0x8c07('0x2')](_0x8c07('0x1b'),_0x2c92f2[_0x8c07('0xe')],_0x2c92f2[_0x8c07('0x19')],_0x2c92f2[_0x8c07('0x11')],_0x2c92f2[_0x8c07('0x13')]));recordings[_0x2c92f2[_0x8c07('0x19')]]['accountcode']=_0x2c92f2[_0x8c07('0x4')];}}catch(_0x2b8ce6){utils[_0x8c07('0x1c')](util[_0x8c07('0x2')]('[%s][recordings][newstate]',_0x2c92f2['uniqueid']),_0x2b8ce6);}};exports['varset']=function(_0x4d1776){try{if(!_[_0x8c07('0x16')](_0x4d1776['variable'])&&!_['isNil'](_0x4d1776['variable']['mixmonitor_filename'])){utils[_0x8c07('0xc')](util[_0x8c07('0x2')](_0x8c07('0x1d'),_0x4d1776[_0x8c07('0xe')]),_0x4d1776);utils[_0x8c07('0xf')](util['format'](_0x8c07('0x1e'),_0x4d1776[_0x8c07('0xe')],_0x4d1776[_0x8c07('0x1f')],_0x4d1776[_0x8c07('0x20')]));if(_[_0x8c07('0x21')](_0x4d1776[_0x8c07('0x20')],_0x8c07('0x22'))){_0x4d1776['value']=_0x4d1776[_0x8c07('0x20')][_0x8c07('0x23')](_0x8c07('0x22'),_0x8c07('0x24'));}if(recordings[_0x4d1776[_0x8c07('0x19')]]){var _0x1a2d9a=_[_0x8c07('0x25')](recordings[_0x4d1776[_0x8c07('0x19')]][_0x8c07('0x26')],{'value':_0x4d1776['value']});if(_[_0x8c07('0x16')](_0x1a2d9a)){recordings[_0x4d1776['linkedid']][_0x8c07('0x26')][_0x8c07('0x27')]({'value':_0x4d1776['value']});}}}}catch(_0x11a4ac){utils[_0x8c07('0x1c')](util[_0x8c07('0x2')](_0x8c07('0x1d'),_0x4d1776[_0x8c07('0xe')]),_0x11a4ac);}};exports[_0x8c07('0x28')]=function(_0x5e0df6){try{if(!_[_0x8c07('0x16')](recordings[_0x5e0df6['uniqueid']])){utils[_0x8c07('0xc')](util[_0x8c07('0x2')](_0x8c07('0x29'),_0x5e0df6[_0x8c07('0xe')]),_0x5e0df6);utils[_0x8c07('0xf')](util['format'](_0x8c07('0x2a'),_0x5e0df6['uniqueid'],_0x5e0df6['calleridnum'],_0x5e0df6['calleridname'],_0x5e0df6[_0x8c07('0x2b')]));recordings[_0x5e0df6[_0x8c07('0xe')]][_0x8c07('0x2c')]=_0x5e0df6[_0x8c07('0x2c')];recordings[_0x5e0df6[_0x8c07('0xe')]][_0x8c07('0x2d')]=_0x5e0df6[_0x8c07('0x2d')];recordings[_0x5e0df6['uniqueid']][_0x8c07('0x2e')]=_0x5e0df6['connectedlinenum'];recordings[_0x5e0df6[_0x8c07('0xe')]]['connectedlinename']=_0x5e0df6[_0x8c07('0x2f')];if(recordings[_0x5e0df6['uniqueid']]['type']=='outbound'&&recordings[_0x5e0df6[_0x8c07('0xe')]]['accountcode']){recordings[_0x5e0df6[_0x8c07('0xe')]]['connectedlinenum']=recordings[_0x5e0df6[_0x8c07('0xe')]][_0x8c07('0x4')];recordings[_0x5e0df6[_0x8c07('0xe')]][_0x8c07('0x2f')]='';}recordings[_0x5e0df6[_0x8c07('0xe')]][_0x8c07('0x26')][_0x8c07('0x30')](function(_0x3e46fd){var _0xd50078=_['clone'](recordings[_0x5e0df6[_0x8c07('0xe')]]);_0xd50078[_0x8c07('0x20')]=_0x3e46fd[_0x8c07('0x20')];writeDB(_0xd50078);});delete recordings[_0x5e0df6[_0x8c07('0xe')]];}}catch(_0x38f856){utils[_0x8c07('0x1c')](util[_0x8c07('0x2')]('[%s][recordings][hangup]',_0x5e0df6[_0x8c07('0xe')]),_0x38f856);}};exports[_0x8c07('0x31')]=function(_0x1e1524){try{if(!_[_0x8c07('0x16')](recordings[_0x1e1524[_0x8c07('0xe')]])){utils['debug'](util[_0x8c07('0x2')]('[%s][recordings][newexten]',_0x1e1524[_0x8c07('0xe')]),_0x1e1524);utils[_0x8c07('0xf')](util[_0x8c07('0x2')](_0x8c07('0x32'),_0x1e1524[_0x8c07('0xe')],_0x1e1524[_0x8c07('0x33')],_0x1e1524[_0x8c07('0x34')]));if(_0x1e1524['application'][_0x8c07('0x35')]()==_0x8c07('0x36')&&_['startsWith'](_0x1e1524[_0x8c07('0x34')][_0x8c07('0x35')](),_0x8c07('0x37'))){var _0x4bbdf6=_0x1e1524['appdata']['split']('=');var _0xeb07c4=_0x4bbdf6[0x0]['substring'](_0x4bbdf6[0x0]['lastIndexOf']('(')+0x1,_0x4bbdf6[0x0][_0x8c07('0x38')](')'));var _0x1f5c6d=_0x4bbdf6[0x1];recordings[_0x1e1524[_0x8c07('0xe')]][_0xeb07c4]=_0x1f5c6d;}}}catch(_0x3d5fbb){utils[_0x8c07('0x1c')](util[_0x8c07('0x2')](_0x8c07('0x39'),_0x1e1524['uniqueid']),_0x3d5fbb);}};exports[_0x8c07('0x3a')]=function(_0x44dc71){try{if(!_[_0x8c07('0x16')](recordings[_0x44dc71['uniqueid']])){utils[_0x8c07('0xc')](util[_0x8c07('0x2')](_0x8c07('0x3b'),_0x44dc71[_0x8c07('0xe')]),_0x44dc71);utils[_0x8c07('0xf')](util[_0x8c07('0x2')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x44dc71[_0x8c07('0xe')],_0x44dc71[_0x8c07('0x3c')]));recordings[_0x44dc71[_0x8c07('0xe')]][_0x8c07('0x3c')]=_0x44dc71[_0x8c07('0x3c')];}}catch(_0x29b38f){utils[_0x8c07('0x1c')](util['format'](_0x8c07('0x3b'),_0x44dc71[_0x8c07('0xe')]),_0x29b38f);}};
\ No newline at end of file
+var _0x4301=['./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','appdata','toLowerCase','set','startsWith','cdr','split','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x4301,0x17e));var _0x1430=function(_0x49d45c,_0x1b2dad){_0x49d45c=_0x49d45c-0x0;var _0x30f881=_0x4301[_0x49d45c];return _0x30f881;};'use strict';var _=require(_0x1430('0x0'));var util=require(_0x1430('0x1'));var utils=require(_0x1430('0x2'));var recordings={};function writeDB(_0x16f116){utils[_0x1430('0x3')](util[_0x1430('0x4')](_0x1430('0x5'),_0x16f116[_0x1430('0x6')]));if(_0x16f116[_0x1430('0x7')]){utils[_0x1430('0x8')](_0x16f116[_0x1430('0x7')])[_0x1430('0x9')](function(_0xb5a1b0){if(_0xb5a1b0){_0x16f116[_0x1430('0xa')]=_0xb5a1b0[_0x1430('0xb')];_0x16f116['UserId']=_0xb5a1b0['id'];}utils['request']('CreateVoiceRecording',_0x16f116);});}else{utils[_0x1430('0xc')](_0x1430('0xd'),_0x16f116);}}exports[_0x1430('0xe')]=function(_0x5d0ebb){try{utils[_0x1430('0xf')](util['format']('[%s][recordings][newchannel]',_0x5d0ebb[_0x1430('0x6')]),_0x5d0ebb);if(_0x5d0ebb[_0x1430('0x6')]==_0x5d0ebb[_0x1430('0x10')]){utils[_0x1430('0x3')](util[_0x1430('0x4')](_0x1430('0x11'),_0x5d0ebb[_0x1430('0x6')],_0x5d0ebb['context'],_0x5d0ebb[_0x1430('0x12')]));recordings[_0x5d0ebb[_0x1430('0x6')]]={'uniqueid':_0x5d0ebb[_0x1430('0x6')],'accountcode':_0x5d0ebb[_0x1430('0x7')],'exten':_0x5d0ebb[_0x1430('0x12')],'context':_0x5d0ebb['context'],'channel':_0x5d0ebb[_0x1430('0x13')],'monitors':[]};}}catch(_0x734042){utils[_0x1430('0x14')](util[_0x1430('0x4')](_0x1430('0x15'),_0x5d0ebb[_0x1430('0x6')]),_0x734042);}};exports[_0x1430('0x16')]=function(_0x3d6f85){try{utils[_0x1430('0xf')](util[_0x1430('0x4')](_0x1430('0x17'),_0x3d6f85['uniqueid']),_0x3d6f85);if(!_[_0x1430('0x18')](recordings[_0x3d6f85[_0x1430('0x6')]])&&_0x3d6f85[_0x1430('0x19')]==0x6){utils[_0x1430('0x3')](util[_0x1430('0x4')](_0x1430('0x1a'),_0x3d6f85[_0x1430('0x6')],_0x3d6f85[_0x1430('0x1b')],_0x3d6f85[_0x1430('0x13')]));}else if(!_[_0x1430('0x18')](recordings[_0x3d6f85['linkedid']])&&_0x3d6f85[_0x1430('0x19')]==0x6&&_0x3d6f85[_0x1430('0x1b')]!='transfer'){utils[_0x1430('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3d6f85[_0x1430('0x6')],_0x3d6f85['linkedid'],_0x3d6f85['context'],_0x3d6f85[_0x1430('0x13')]));recordings[_0x3d6f85[_0x1430('0x10')]][_0x1430('0x7')]=_0x3d6f85['accountcode'];}}catch(_0x4a67a4){utils[_0x1430('0x14')](util[_0x1430('0x4')](_0x1430('0x17'),_0x3d6f85[_0x1430('0x6')]),_0x4a67a4);}};exports[_0x1430('0x1c')]=function(_0x2cdadb){try{if(!_[_0x1430('0x18')](_0x2cdadb[_0x1430('0x1d')])&&!_[_0x1430('0x18')](_0x2cdadb[_0x1430('0x1d')][_0x1430('0x1e')])){utils[_0x1430('0xf')](util['format'](_0x1430('0x1f'),_0x2cdadb[_0x1430('0x6')]),_0x2cdadb);utils[_0x1430('0x3')](util[_0x1430('0x4')](_0x1430('0x20'),_0x2cdadb[_0x1430('0x6')],_0x2cdadb[_0x1430('0x1d')],_0x2cdadb[_0x1430('0x21')]));if(_[_0x1430('0x22')](_0x2cdadb[_0x1430('0x21')],_0x1430('0x23'))){_0x2cdadb[_0x1430('0x21')]=_0x2cdadb[_0x1430('0x21')][_0x1430('0x24')]('.wav49',_0x1430('0x25'));}if(recordings[_0x2cdadb[_0x1430('0x10')]]){var _0x15d831=_[_0x1430('0x26')](recordings[_0x2cdadb[_0x1430('0x10')]][_0x1430('0x27')],{'value':_0x2cdadb[_0x1430('0x21')]});if(_[_0x1430('0x18')](_0x15d831)){recordings[_0x2cdadb[_0x1430('0x10')]][_0x1430('0x27')][_0x1430('0x28')]({'value':_0x2cdadb[_0x1430('0x21')]});}}}}catch(_0x248bc1){utils[_0x1430('0x14')](util[_0x1430('0x4')](_0x1430('0x1f'),_0x2cdadb[_0x1430('0x6')]),_0x248bc1);}};exports['hangup']=function(_0x3a84ab){try{if(!_[_0x1430('0x18')](recordings[_0x3a84ab[_0x1430('0x6')]])){utils['debug'](util[_0x1430('0x4')](_0x1430('0x29'),_0x3a84ab[_0x1430('0x6')]),_0x3a84ab);utils[_0x1430('0x3')](util[_0x1430('0x4')](_0x1430('0x2a'),_0x3a84ab[_0x1430('0x6')],_0x3a84ab[_0x1430('0x2b')],_0x3a84ab[_0x1430('0x2c')],_0x3a84ab[_0x1430('0x2d')]));recordings[_0x3a84ab[_0x1430('0x6')]][_0x1430('0x2b')]=_0x3a84ab[_0x1430('0x2b')];recordings[_0x3a84ab[_0x1430('0x6')]][_0x1430('0x2c')]=_0x3a84ab[_0x1430('0x2c')];recordings[_0x3a84ab['uniqueid']][_0x1430('0x2e')]=_0x3a84ab['connectedlinenum'];recordings[_0x3a84ab[_0x1430('0x6')]][_0x1430('0x2f')]=_0x3a84ab[_0x1430('0x2f')];if(recordings[_0x3a84ab[_0x1430('0x6')]][_0x1430('0x30')]==_0x1430('0x31')&&recordings[_0x3a84ab[_0x1430('0x6')]]['accountcode']){recordings[_0x3a84ab[_0x1430('0x6')]][_0x1430('0x2e')]=recordings[_0x3a84ab[_0x1430('0x6')]]['accountcode'];recordings[_0x3a84ab[_0x1430('0x6')]]['connectedlinename']='';}recordings[_0x3a84ab[_0x1430('0x6')]]['monitors'][_0x1430('0x32')](function(_0x5505f4){var _0x1546a8=_[_0x1430('0x33')](recordings[_0x3a84ab[_0x1430('0x6')]]);_0x1546a8[_0x1430('0x21')]=_0x5505f4[_0x1430('0x21')];writeDB(_0x1546a8);});delete recordings[_0x3a84ab[_0x1430('0x6')]];}}catch(_0xf05ffb){utils['error'](util[_0x1430('0x4')]('[%s][recordings][hangup]',_0x3a84ab['uniqueid']),_0xf05ffb);}};exports[_0x1430('0x34')]=function(_0x59ec1e){try{if(!_[_0x1430('0x18')](recordings[_0x59ec1e[_0x1430('0x6')]])){utils[_0x1430('0xf')](util[_0x1430('0x4')](_0x1430('0x35'),_0x59ec1e[_0x1430('0x6')]),_0x59ec1e);utils[_0x1430('0x3')](util[_0x1430('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x59ec1e[_0x1430('0x6')],_0x59ec1e[_0x1430('0x36')],_0x59ec1e[_0x1430('0x37')]));if(_0x59ec1e['application'][_0x1430('0x38')]()==_0x1430('0x39')&&_[_0x1430('0x3a')](_0x59ec1e[_0x1430('0x37')][_0x1430('0x38')](),_0x1430('0x3b'))){var _0x1a2b35=_0x59ec1e[_0x1430('0x37')][_0x1430('0x3c')]('=');var _0x2cc202=_0x1a2b35[0x0]['substring'](_0x1a2b35[0x0]['lastIndexOf']('(')+0x1,_0x1a2b35[0x0]['lastIndexOf'](')'));var _0x53d3ac=_0x1a2b35[0x1];recordings[_0x59ec1e[_0x1430('0x6')]][_0x2cc202]=_0x53d3ac;}}}catch(_0x102636){utils[_0x1430('0x14')](util['format'](_0x1430('0x35'),_0x59ec1e[_0x1430('0x6')]),_0x102636);}};exports[_0x1430('0x3d')]=function(_0x3974c8){try{if(!_[_0x1430('0x18')](recordings[_0x3974c8['uniqueid']])){utils[_0x1430('0xf')](util[_0x1430('0x4')](_0x1430('0x3e'),_0x3974c8[_0x1430('0x6')]),_0x3974c8);utils[_0x1430('0x3')](util[_0x1430('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x3974c8[_0x1430('0x6')],_0x3974c8['queue']));recordings[_0x3974c8[_0x1430('0x6')]][_0x1430('0x3f')]=_0x3974c8['queue'];}}catch(_0x2f067d){utils[_0x1430('0x14')](util[_0x1430('0x4')](_0x1430('0x3e'),_0x3974c8[_0x1430('0x6')]),_0x2f067d);}};
\ No newline at end of file
index e9e3878..480e18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa08f=['[%s][transfers][attendedtransfer]','lodash','util','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transfereecalleridnum','transfereecalleridname','blinds','transfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0xa08f,0x141));var _0xfa08=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa08f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfa08('0x0'));var util=require(_0xfa08('0x1'));var utils=require('./utils');function writeDB(_0x1d606e){utils[_0xfa08('0x2')](util[_0xfa08('0x3')](_0xfa08('0x4'),_0x1d606e[_0xfa08('0x5')]===_0xfa08('0x6')?_0x1d606e[_0xfa08('0x7')]:_0x1d606e['uniqueid'],_0x1d606e['type']));utils[_0xfa08('0x8')](_0xfa08('0x9'),_0x1d606e);}exports['blinds']={};exports['blindtransfer']=function(_0x1c13a2){try{utils[_0xfa08('0xa')](util[_0xfa08('0x3')](_0xfa08('0xb'),_0x1c13a2['uniqueid']),_0x1c13a2);utils[_0xfa08('0x2')](util[_0xfa08('0x3')](_0xfa08('0xc'),_0x1c13a2[_0xfa08('0xd')],_0x1c13a2[_0xfa08('0xe')],_0x1c13a2['transferercalleridname'],_0x1c13a2[_0xfa08('0xf')],_0x1c13a2[_0xfa08('0x10')]));_0x1c13a2[_0xfa08('0x5')]='blind';exports[_0xfa08('0x11')][_0x1c13a2[_0xfa08('0x12')]]=_0x1c13a2;writeDB(_0x1c13a2);}catch(_0x9f84bd){utils['error'](util['format'](_0xfa08('0xb'),_0x1c13a2[_0xfa08('0xd')]),_0x9f84bd);}};exports['attendedtransfer']=function(_0x3cb6f0){try{utils[_0xfa08('0xa')](util[_0xfa08('0x3')]('[%s][transfers][attendedtransfer]',_0x3cb6f0[_0xfa08('0x7')]),_0x3cb6f0);utils[_0xfa08('0x2')](util[_0xfa08('0x3')](_0xfa08('0x13'),_0x3cb6f0[_0xfa08('0x7')],_0x3cb6f0[_0xfa08('0x14')],_0x3cb6f0[_0xfa08('0x15')],_0x3cb6f0[_0xfa08('0x16')],_0x3cb6f0['transfertargetcalleridname']));_0x3cb6f0=_[_0xfa08('0x17')](_0x3cb6f0,{'transfererchannel':_0x3cb6f0[_0xfa08('0x18')],'transferercalleridnum':_0x3cb6f0['origtransferercalleridnum'],'transferercalleridname':_0x3cb6f0[_0xfa08('0x15')],'transfererconnectedlinenum':_0x3cb6f0['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3cb6f0[_0xfa08('0x19')],'transfereraccountcode':_0x3cb6f0[_0xfa08('0x1a')],'transferercontext':_0x3cb6f0[_0xfa08('0x1b')],'transfererexten':_0x3cb6f0['secondtransfererexten'],'transfererlinkedid':_0x3cb6f0[_0xfa08('0x1c')],'context':_0x3cb6f0[_0xfa08('0x1d')],'extension':_0x3cb6f0['origtransfererexten'],'type':'attended'});if(_[_0xfa08('0x1e')](_0x3cb6f0[_0xfa08('0x1f')])){_0x3cb6f0=_[_0xfa08('0x17')](_0x3cb6f0,{'transfereechannel':_0x3cb6f0['transfertargetchannel'],'transfereecalleridnum':_0x3cb6f0['transfertargetcalleridnum'],'transfereecalleridname':_0x3cb6f0[_0xfa08('0x20')],'transfereeconnectedlinenum':_0x3cb6f0[_0xfa08('0x21')],'transfereeconnectedlinename':_0x3cb6f0[_0xfa08('0x22')],'transfereeaccountcode':_0x3cb6f0[_0xfa08('0x23')],'transfereecontext':_0x3cb6f0[_0xfa08('0x24')],'transfereeexten':_0x3cb6f0['transfertargetexten'],'transfereelinkedid':_0x3cb6f0[_0xfa08('0x25')]});}writeDB(_0x3cb6f0);}catch(_0x4d255d){utils[_0xfa08('0x26')](util[_0xfa08('0x3')](_0xfa08('0x27'),_0x3cb6f0[_0xfa08('0x7')]),_0x4d255d);}};
\ No newline at end of file
+var _0xd881=['secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum'];(function(_0x23a43d,_0x4d825b){var _0x237807=function(_0x3c398a){while(--_0x3c398a){_0x23a43d['push'](_0x23a43d['shift']());}};_0x237807(++_0x4d825b);}(_0xd881,0x167));var _0x1d88=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd881[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x1d88('0x0'));var util=require(_0x1d88('0x1'));var utils=require(_0x1d88('0x2'));function writeDB(_0x4f0c8a){utils[_0x1d88('0x3')](util[_0x1d88('0x4')](_0x1d88('0x5'),_0x4f0c8a[_0x1d88('0x6')]==='attended'?_0x4f0c8a[_0x1d88('0x7')]:_0x4f0c8a[_0x1d88('0x8')],_0x4f0c8a['type']));utils['request'](_0x1d88('0x9'),_0x4f0c8a);}exports[_0x1d88('0xa')]={};exports[_0x1d88('0xb')]=function(_0x3e90d2){try{utils[_0x1d88('0xc')](util['format'](_0x1d88('0xd'),_0x3e90d2['uniqueid']),_0x3e90d2);utils[_0x1d88('0x3')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3e90d2[_0x1d88('0x8')],_0x3e90d2[_0x1d88('0xe')],_0x3e90d2['transferercalleridname'],_0x3e90d2[_0x1d88('0xf')],_0x3e90d2[_0x1d88('0x10')]));_0x3e90d2['type']='blind';exports[_0x1d88('0xa')][_0x3e90d2[_0x1d88('0x11')]]=_0x3e90d2;writeDB(_0x3e90d2);}catch(_0x1d69af){utils[_0x1d88('0x12')](util[_0x1d88('0x4')](_0x1d88('0xd'),_0x3e90d2['uniqueid']),_0x1d69af);}};exports[_0x1d88('0x13')]=function(_0x1daee2){try{utils[_0x1d88('0xc')](util[_0x1d88('0x4')](_0x1d88('0x14'),_0x1daee2[_0x1d88('0x7')]),_0x1daee2);utils[_0x1d88('0x3')](util[_0x1d88('0x4')](_0x1d88('0x15'),_0x1daee2[_0x1d88('0x7')],_0x1daee2['origtransferercalleridnum'],_0x1daee2['origtransferercalleridname'],_0x1daee2['transfertargetcalleridnum'],_0x1daee2[_0x1d88('0x16')]));_0x1daee2=_[_0x1d88('0x17')](_0x1daee2,{'transfererchannel':_0x1daee2[_0x1d88('0x18')],'transferercalleridnum':_0x1daee2[_0x1d88('0x19')],'transferercalleridname':_0x1daee2[_0x1d88('0x1a')],'transfererconnectedlinenum':_0x1daee2[_0x1d88('0x1b')],'transfererconnectedlinename':_0x1daee2[_0x1d88('0x1c')],'transfereraccountcode':_0x1daee2[_0x1d88('0x1d')],'transferercontext':_0x1daee2[_0x1d88('0x1e')],'transfererexten':_0x1daee2[_0x1d88('0x1f')],'transfererlinkedid':_0x1daee2[_0x1d88('0x20')],'context':_0x1daee2['origtransferercontext'],'extension':_0x1daee2['origtransfererexten'],'type':_0x1d88('0x21')});if(_[_0x1d88('0x22')](_0x1daee2[_0x1d88('0x23')])){_0x1daee2=_[_0x1d88('0x17')](_0x1daee2,{'transfereechannel':_0x1daee2[_0x1d88('0x24')],'transfereecalleridnum':_0x1daee2['transfertargetcalleridnum'],'transfereecalleridname':_0x1daee2[_0x1d88('0x16')],'transfereeconnectedlinenum':_0x1daee2[_0x1d88('0x25')],'transfereeconnectedlinename':_0x1daee2[_0x1d88('0x26')],'transfereeaccountcode':_0x1daee2[_0x1d88('0x27')],'transfereecontext':_0x1daee2[_0x1d88('0x28')],'transfereeexten':_0x1daee2[_0x1d88('0x29')],'transfereelinkedid':_0x1daee2[_0x1d88('0x2a')]});}writeDB(_0x1daee2);}catch(_0x783ad9){utils['error'](util[_0x1d88('0x4')](_0x1d88('0x14'),_0x1daee2[_0x1d88('0x7')]),_0x783ad9);}};
\ No newline at end of file
index 171f19b..89d12e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f8=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','internal','name','[utils][getUser]\x20where:%s','stringify','result','length','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s'];(function(_0x188b52,_0x42017e){var _0x1ac963=function(_0x4de353){while(--_0x4de353){_0x188b52['push'](_0x188b52['shift']());}};_0x1ac963(++_0x42017e);}(_0x81f8,0x186));var _0x881f=function(_0x37bc4b,_0x4f3525){_0x37bc4b=_0x37bc4b-0x0;var _0x4599db=_0x81f8[_0x37bc4b];return _0x4599db;};'use strict';var BPromise=require(_0x881f('0x0'));var jayson=require(_0x881f('0x1'));var moment=require('moment');var util=require(_0x881f('0x2'));var client=jayson[_0x881f('0x3')][_0x881f('0x4')]({'port':0x2329});var logger=require(_0x881f('0x5'))(_0x881f('0x6'));exports['info']=function(_0x1c77c0,_0x3c26d3){logger[_0x881f('0x7')](_0x1c77c0,_0x3c26d3?util[_0x881f('0x8')](_0x3c26d3,{'showHidden':![],'depth':null}):'');};exports[_0x881f('0x9')]=function(_0x30b48c,_0x2d93bc){logger['debug'](_0x30b48c,_0x2d93bc?util['inspect'](_0x2d93bc,{'showHidden':![],'depth':null}):'');};exports[_0x881f('0xa')]=function(_0x2e9748,_0x493708){logger[_0x881f('0xa')](_0x2e9748,_0x493708?util[_0x881f('0x8')](_0x493708,{'showHidden':![],'depth':null}):'');};exports[_0x881f('0xb')]=function(_0x63d5a6,_0x56d967){return client['request'](_0x63d5a6,{'body':_0x56d967})[_0x881f('0xc')](function(_0x22907a){logger[_0x881f('0x9')]('[utils][request]\x20name:%s',_0x63d5a6,_0x22907a?util['inspect'](_0x22907a,{'showHidden':![],'depth':null}):'');})[_0x881f('0xd')](function(_0x422ee5){logger['error']('[utils][request]\x20name:%s',_0x63d5a6,_0x422ee5?util[_0x881f('0x8')](_0x422ee5,{'showHidden':![],'depth':null}):'');});};function getUser(_0x399146){return client[_0x881f('0xb')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x881f('0xe'),_0x881f('0xf'),'interface'],'where':_0x399146,'limit':0x1}})[_0x881f('0xc')](function(_0x3d9e50){logger['debug'](_0x881f('0x10'),JSON[_0x881f('0x11')](_0x399146),_0x3d9e50?util[_0x881f('0x8')](_0x3d9e50,{'showHidden':![],'depth':null}):'');return _0x3d9e50[_0x881f('0x12')][_0x881f('0x13')]?_0x3d9e50[_0x881f('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x349c17){return new BPromise(function(_0x4f0540,_0x5d2955){if(_0x349c17){return getUser({'internal':_0x349c17})[_0x881f('0xc')](function(_0x123fbf){logger[_0x881f('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x349c17,_0x123fbf?_0x881f('0x14'):_0x881f('0x15'));return _0x4f0540(_0x123fbf);})['catch'](function(_0x954062){logger[_0x881f('0xa')](_0x881f('0x16'),_0x954062?util['inspect'](_0x954062,{'showHidden':![],'depth':null}):'');return _0x4f0540(null);});}return _0x4f0540(null);});};exports['getUserByInterface']=function(_0x38f7a7){return new BPromise(function(_0x100e7f,_0x161eea){if(_0x38f7a7){return getUser({'interface':_0x38f7a7})[_0x881f('0xc')](function(_0x4f43ee){logger[_0x881f('0x7')](_0x881f('0x17'),_0x38f7a7,_0x4f43ee?_0x881f('0x14'):'notfound');return _0x100e7f(_0x4f43ee);})[_0x881f('0xd')](function(_0x51bbb2){logger[_0x881f('0xa')]('[utils][getUserByInterface]',_0x51bbb2?util[_0x881f('0x8')](_0x51bbb2,{'showHidden':![],'depth':null}):'');return _0x100e7f(null);});}return _0x100e7f(null);});};exports[_0x881f('0x18')]=function(_0x2d6a34){return new BPromise(function(_0x341e3c,_0x5f39cc){if(_0x2d6a34){return getUser({'name':_0x2d6a34})[_0x881f('0xc')](function(_0xdfe89b){logger[_0x881f('0x7')](_0x881f('0x19'),_0x2d6a34,_0xdfe89b?_0x881f('0x14'):_0x881f('0x15'));return _0x341e3c(_0xdfe89b);})['catch'](function(_0x25a134){logger[_0x881f('0xa')](_0x881f('0x1a'),_0x25a134?util[_0x881f('0x8')](_0x25a134,{'showHidden':![],'depth':null}):'');return _0x341e3c(null);});}return _0x341e3c(null);});};exports[_0x881f('0x1b')]=function(_0x518ddb){return new BPromise(function(_0x56cc05,_0x40d75b){if(_0x518ddb){return client[_0x881f('0xb')](_0x881f('0x1c'),{'options':{'raw':!![],'attributes':['id','name',_0x881f('0x1d'),_0x881f('0x1e'),_0x881f('0x1f')],'where':{'name':_0x518ddb},'limit':0x1}})[_0x881f('0xc')](function(_0x4a17fd){logger[_0x881f('0x9')](_0x881f('0x20'),_0x518ddb,_0x4a17fd?util[_0x881f('0x8')](_0x4a17fd,{'showHidden':![],'depth':null}):'');logger[_0x881f('0x7')](_0x881f('0x21'),_0x518ddb,_0x4a17fd?_0x881f('0x14'):_0x881f('0x15'));return _0x56cc05(_0x4a17fd[_0x881f('0x12')]['length']?_0x4a17fd[_0x881f('0x12')][0x0]:null);})[_0x881f('0xd')](function(_0x16dcea){logger['error'](_0x881f('0x22'),_0x16dcea?util[_0x881f('0x8')](_0x16dcea,{'showHidden':![],'depth':null}):'');return _0x56cc05(null);});}return _0x56cc05(null);});};exports['addTime']=function(_0x28e64a,_0x368f4c){return moment(_0x28e64a)[_0x881f('0x23')](_0x368f4c,_0x881f('0x24'))[_0x881f('0x25')](_0x881f('0x26'));};exports[_0x881f('0x27')]=function(_0x38fc1d,_0x3d169d){return moment(_0x38fc1d)[_0x881f('0x28')](_0x3d169d,_0x881f('0x24'))['format'](_0x881f('0x26'));};exports[_0x881f('0x29')]=function(_0x4dcec2,_0x24006f){return moment(_0x4dcec2)[_0x881f('0x2a')](moment(_0x24006f),_0x881f('0x24'));};exports[_0x881f('0x2b')]=function(_0x2054ff,_0x4c0513){return parseInt(_0x2054ff,0xa)+parseInt(_0x4c0513,0xa);};exports['now']=function(){return moment()[_0x881f('0x25')](_0x881f('0x26'));};exports['isAfter']=function(_0x131416,_0x5af5de){if(_0x5af5de){return moment(_0x131416)[_0x881f('0x2c')](_0x5af5de);}return!![];};exports[_0x881f('0x2d')]=function(_0x3a858a,_0x207f3a){if(_0x207f3a){return moment(_0x3a858a)[_0x881f('0x2d')](_0x207f3a);}else if(_0x3a858a){return!![];}return![];};
\ No newline at end of file
+var _0xec66=['subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','now','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','[utils][getUser]\x20where:%s','stringify','length','result','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format'];(function(_0x3c70e0,_0x1573dd){var _0x2f2f6e=function(_0x16c7a6){while(--_0x16c7a6){_0x3c70e0['push'](_0x3c70e0['shift']());}};_0x2f2f6e(++_0x1573dd);}(_0xec66,0x103));var _0x6ec6=function(_0x2ed7d1,_0x363741){_0x2ed7d1=_0x2ed7d1-0x0;var _0x38ae3c=_0xec66[_0x2ed7d1];return _0x38ae3c;};'use strict';var BPromise=require(_0x6ec6('0x0'));var jayson=require(_0x6ec6('0x1'));var moment=require(_0x6ec6('0x2'));var util=require(_0x6ec6('0x3'));var client=jayson['client'][_0x6ec6('0x4')]({'port':0x2329});var logger=require(_0x6ec6('0x5'))(_0x6ec6('0x6'));exports['info']=function(_0x1222b9,_0x4cc593){logger[_0x6ec6('0x7')](_0x1222b9,_0x4cc593?util['inspect'](_0x4cc593,{'showHidden':![],'depth':null}):'');};exports[_0x6ec6('0x8')]=function(_0xbda0ae,_0x18b97c){logger[_0x6ec6('0x8')](_0xbda0ae,_0x18b97c?util[_0x6ec6('0x9')](_0x18b97c,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x486113,_0x54c5c1){logger[_0x6ec6('0xa')](_0x486113,_0x54c5c1?util[_0x6ec6('0x9')](_0x54c5c1,{'showHidden':![],'depth':null}):'');};exports[_0x6ec6('0xb')]=function(_0x3d4a62,_0x307dda){return client[_0x6ec6('0xb')](_0x3d4a62,{'body':_0x307dda})[_0x6ec6('0xc')](function(_0x2c2e5e){logger[_0x6ec6('0x8')]('[utils][request]\x20name:%s',_0x3d4a62,_0x2c2e5e?util[_0x6ec6('0x9')](_0x2c2e5e,{'showHidden':![],'depth':null}):'');})[_0x6ec6('0xd')](function(_0x45726b){logger[_0x6ec6('0xa')](_0x6ec6('0xe'),_0x3d4a62,_0x45726b?util[_0x6ec6('0x9')](_0x45726b,{'showHidden':![],'depth':null}):'');});};function getUser(_0x478764){return client[_0x6ec6('0xb')](_0x6ec6('0xf'),{'options':{'raw':!![],'attributes':['id',_0x6ec6('0x10'),'name','interface'],'where':_0x478764,'limit':0x1}})[_0x6ec6('0xc')](function(_0x18a133){logger[_0x6ec6('0x8')](_0x6ec6('0x11'),JSON[_0x6ec6('0x12')](_0x478764),_0x18a133?util[_0x6ec6('0x9')](_0x18a133,{'showHidden':![],'depth':null}):'');return _0x18a133['result'][_0x6ec6('0x13')]?_0x18a133[_0x6ec6('0x14')][0x0]:null;});}exports['getUserByInternal']=function(_0x4c7f2e){return new BPromise(function(_0xc41b0a,_0x1ef506){if(_0x4c7f2e){return getUser({'internal':_0x4c7f2e})[_0x6ec6('0xc')](function(_0x332f4e){logger[_0x6ec6('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x4c7f2e,_0x332f4e?_0x6ec6('0x15'):_0x6ec6('0x16'));return _0xc41b0a(_0x332f4e);})[_0x6ec6('0xd')](function(_0x3a33fe){logger[_0x6ec6('0xa')](_0x6ec6('0x17'),_0x3a33fe?util[_0x6ec6('0x9')](_0x3a33fe,{'showHidden':![],'depth':null}):'');return _0xc41b0a(null);});}return _0xc41b0a(null);});};exports['getUserByInterface']=function(_0x5e6824){return new BPromise(function(_0x2ed5c6,_0x544a2d){if(_0x5e6824){return getUser({'interface':_0x5e6824})[_0x6ec6('0xc')](function(_0x20884b){logger[_0x6ec6('0x7')](_0x6ec6('0x18'),_0x5e6824,_0x20884b?_0x6ec6('0x15'):_0x6ec6('0x16'));return _0x2ed5c6(_0x20884b);})['catch'](function(_0x45e46f){logger[_0x6ec6('0xa')](_0x6ec6('0x19'),_0x45e46f?util[_0x6ec6('0x9')](_0x45e46f,{'showHidden':![],'depth':null}):'');return _0x2ed5c6(null);});}return _0x2ed5c6(null);});};exports[_0x6ec6('0x1a')]=function(_0x40a2d2){return new BPromise(function(_0x25c32d,_0x2577f2){if(_0x40a2d2){return getUser({'name':_0x40a2d2})[_0x6ec6('0xc')](function(_0x48c4ca){logger[_0x6ec6('0x7')]('[utils][getUserByName]\x20name:%s\x20%s',_0x40a2d2,_0x48c4ca?_0x6ec6('0x15'):_0x6ec6('0x16'));return _0x25c32d(_0x48c4ca);})[_0x6ec6('0xd')](function(_0x470fd2){logger[_0x6ec6('0xa')]('[utils][getUserByName]',_0x470fd2?util['inspect'](_0x470fd2,{'showHidden':![],'depth':null}):'');return _0x25c32d(null);});}return _0x25c32d(null);});};exports[_0x6ec6('0x1b')]=function(_0x580d3a){return new BPromise(function(_0x2df116,_0x4b20e4){if(_0x580d3a){return client[_0x6ec6('0xb')](_0x6ec6('0x1c'),{'options':{'raw':!![],'attributes':['id','name',_0x6ec6('0x1d'),'acw','acwTimeout'],'where':{'name':_0x580d3a},'limit':0x1}})[_0x6ec6('0xc')](function(_0x18917f){logger['debug'](_0x6ec6('0x1e'),_0x580d3a,_0x18917f?util[_0x6ec6('0x9')](_0x18917f,{'showHidden':![],'depth':null}):'');logger[_0x6ec6('0x7')](_0x6ec6('0x1f'),_0x580d3a,_0x18917f?_0x6ec6('0x15'):'notfound');return _0x2df116(_0x18917f[_0x6ec6('0x14')][_0x6ec6('0x13')]?_0x18917f[_0x6ec6('0x14')][0x0]:null);})[_0x6ec6('0xd')](function(_0x53cbed){logger['error']('[utils][getVoiceQueueByName]',_0x53cbed?util['inspect'](_0x53cbed,{'showHidden':![],'depth':null}):'');return _0x2df116(null);});}return _0x2df116(null);});};exports['addTime']=function(_0xae11e6,_0x1e443f){return moment(_0xae11e6)[_0x6ec6('0x20')](_0x1e443f,_0x6ec6('0x21'))[_0x6ec6('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6ec6('0x23')]=function(_0x586dd6,_0xb20f4e){return moment(_0x586dd6)[_0x6ec6('0x24')](_0xb20f4e,'seconds')['format'](_0x6ec6('0x25'));};exports[_0x6ec6('0x26')]=function(_0x4cc0ae,_0x475db6){return moment(_0x4cc0ae)[_0x6ec6('0x27')](moment(_0x475db6),_0x6ec6('0x21'));};exports['sumTime']=function(_0x366864,_0x1f306b){return parseInt(_0x366864,0xa)+parseInt(_0x1f306b,0xa);};exports[_0x6ec6('0x28')]=function(){return moment()[_0x6ec6('0x22')](_0x6ec6('0x25'));};exports['isAfter']=function(_0x213c16,_0x3ff891){if(_0x3ff891){return moment(_0x213c16)['isAfter'](_0x3ff891);}return!![];};exports[_0x6ec6('0x29')]=function(_0x5871af,_0x5e4563){if(_0x5e4563){return moment(_0x5871af)['isBefore'](_0x5e4563);}else if(_0x5871af){return!![];}return![];};
\ No newline at end of file